class J1 {
  constructor() {
    this.rootNodes = [], this.cameras = [], this.lights = [], this.meshes = [], this.skeletons = [], this.particleSystems = [], this.animations = [], this.animationGroups = [], this.multiMaterials = [], this.materials = [], this.morphTargetManagers = [], this.geometries = [], this.transformNodes = [], this.actionManagers = [], this.textures = [], this._environmentTexture = null, this.postProcesses = [];
  }
  /**
   * Adds a parser in the list of available ones
   * @param name Defines the name of the parser
   * @param parser Defines the parser to add
   */
  static AddParser(e, t) {
    this._BabylonFileParsers[e] = t;
  }
  /**
   * Gets a general parser from the list of available ones
   * @param name Defines the name of the parser
   * @returns the requested parser or null
   */
  static GetParser(e) {
    return this._BabylonFileParsers[e] ? this._BabylonFileParsers[e] : null;
  }
  /**
   * Adds n individual parser in the list of available ones
   * @param name Defines the name of the parser
   * @param parser Defines the parser to add
   */
  static AddIndividualParser(e, t) {
    this._IndividualBabylonFileParsers[e] = t;
  }
  /**
   * Gets an individual parser from the list of available ones
   * @param name Defines the name of the parser
   * @returns the requested parser or null
   */
  static GetIndividualParser(e) {
    return this._IndividualBabylonFileParsers[e] ? this._IndividualBabylonFileParsers[e] : null;
  }
  /**
   * Parser json data and populate both a scene and its associated container object
   * @param jsonData Defines the data to parse
   * @param scene Defines the scene to parse the data for
   * @param container Defines the container attached to the parsing sequence
   * @param rootUrl Defines the root url of the data
   */
  static Parse(e, t, r, n) {
    for (const i in this._BabylonFileParsers)
      Object.prototype.hasOwnProperty.call(this._BabylonFileParsers, i) && this._BabylonFileParsers[i](e, t, r, n);
  }
  /**
   * Texture used in all pbr material as the reflection texture.
   * As in the majority of the scene they are the same (exception for multi room and so on),
   * this is easier to reference from here than from all the materials.
   */
  get environmentTexture() {
    return this._environmentTexture;
  }
  set environmentTexture(e) {
    this._environmentTexture = e;
  }
  /**
   * @returns all meshes, lights, cameras, transformNodes and bones
   */
  getNodes() {
    let e = [];
    return e = e.concat(this.meshes), e = e.concat(this.lights), e = e.concat(this.cameras), e = e.concat(this.transformNodes), this.skeletons.forEach((t) => e = e.concat(t.bones)), e;
  }
}
J1._BabylonFileParsers = {};
J1._IndividualBabylonFileParsers = {};
class Ml {
  constructor() {
    this.hoverCursor = "", this.actions = [], this.isRecursive = !1;
  }
  /**
   * Does exist one action manager with at least one trigger
   **/
  static get HasTriggers() {
    for (const e in Ml.Triggers)
      if (Object.prototype.hasOwnProperty.call(Ml.Triggers, e))
        return !0;
    return !1;
  }
  /**
   * Does exist one action manager with at least one pick trigger
   **/
  static get HasPickTriggers() {
    for (const e in Ml.Triggers)
      if (Object.prototype.hasOwnProperty.call(Ml.Triggers, e)) {
        const t = parseInt(e);
        if (t >= 1 && t <= 7)
          return !0;
      }
    return !1;
  }
  /**
   * Does exist one action manager that handles actions of a given trigger
   * @param trigger defines the trigger to be tested
   * @returns a boolean indicating whether the trigger is handled by at least one action manager
   **/
  static HasSpecificTrigger(e) {
    for (const t in Ml.Triggers)
      if (Object.prototype.hasOwnProperty.call(Ml.Triggers, t) && parseInt(t) === e)
        return !0;
    return !1;
  }
}
Ml.Triggers = {};
class IN {
  /**
   * Create a new EventState
   * @param mask defines the mask associated with this state
   * @param skipNextObservers defines a flag which will instruct the observable to skip following observers when set to true
   * @param target defines the original target of the state
   * @param currentTarget defines the current target of the state
   */
  constructor(e, t = !1, r, n) {
    this.initialize(e, t, r, n);
  }
  /**
   * Initialize the current event state
   * @param mask defines the mask associated with this state
   * @param skipNextObservers defines a flag which will instruct the observable to skip following observers when set to true
   * @param target defines the original target of the state
   * @param currentTarget defines the current target of the state
   * @returns the current event state
   */
  initialize(e, t = !1, r, n) {
    return this.mask = e, this.skipNextObservers = t, this.target = r, this.currentTarget = n, this;
  }
}
class c$ {
  /**
   * Creates a new observer
   * @param callback defines the callback to call when the observer is notified
   * @param mask defines the mask of the observer (used to filter notifications)
   * @param scope defines the current scope used to restore the JS context
   */
  constructor(e, t, r = null) {
    this.callback = e, this.mask = t, this.scope = r, this._willBeUnregistered = !1, this.unregisterOnNextCall = !1, this._remove = null;
  }
  /**
   * Remove the observer from its observable
   * This can be used instead of using the observable's remove function.
   */
  remove() {
    this._remove && this._remove();
  }
}
class Oe {
  /**
   * Create an observable from a Promise.
   * @param promise a promise to observe for fulfillment.
   * @param onErrorObservable an observable to notify if a promise was rejected.
   * @returns the new Observable
   */
  static FromPromise(e, t) {
    const r = new Oe();
    return e.then((n) => {
      r.notifyObservers(n);
    }).catch((n) => {
      if (t)
        t.notifyObservers(n);
      else
        throw n;
    }), r;
  }
  /**
   * Gets the list of observers
   * Note that observers that were recently deleted may still be present in the list because they are only really deleted on the next javascript tick!
   */
  get observers() {
    return this._observers;
  }
  /**
   * Creates a new observable
   * @param onObserverAdded defines a callback to call when a new observer is added
   * @param notifyIfTriggered If set to true the observable will notify when an observer was added if the observable was already triggered.
   */
  constructor(e, t = !1) {
    this.notifyIfTriggered = t, this._observers = new Array(), this._numObserversMarkedAsDeleted = 0, this._hasNotified = !1, this._eventState = new IN(0), e && (this._onObserverAdded = e);
  }
  add(e, t = -1, r = !1, n = null, i = !1) {
    if (!e)
      return null;
    const s = new c$(e, t, n);
    return s.unregisterOnNextCall = i, r ? this._observers.unshift(s) : this._observers.push(s), this._onObserverAdded && this._onObserverAdded(s), this._hasNotified && this.notifyIfTriggered && this._lastNotifiedValue !== void 0 && this.notifyObserver(s, this._lastNotifiedValue), s._remove = () => {
      this.remove(s);
    }, s;
  }
  addOnce(e) {
    return this.add(e, void 0, void 0, void 0, !0);
  }
  /**
   * Remove an Observer from the Observable object
   * @param observer the instance of the Observer to remove
   * @returns false if it doesn't belong to this Observable
   */
  remove(e) {
    return e ? (e._remove = null, this._observers.indexOf(e) !== -1 ? (this._deferUnregister(e), !0) : !1) : !1;
  }
  /**
   * Remove a callback from the Observable object
   * @param callback the callback to remove
   * @param scope optional scope. If used only the callbacks with this scope will be removed
   * @returns false if it doesn't belong to this Observable
   */
  removeCallback(e, t) {
    for (let r = 0; r < this._observers.length; r++) {
      const n = this._observers[r];
      if (!n._willBeUnregistered && n.callback === e && (!t || t === n.scope))
        return this._deferUnregister(n), !0;
    }
    return !1;
  }
  /**
   * @internal
   */
  _deferUnregister(e) {
    e._willBeUnregistered || (this._numObserversMarkedAsDeleted++, e.unregisterOnNextCall = !1, e._willBeUnregistered = !0, setTimeout(() => {
      this._remove(e);
    }, 0));
  }
  // This should only be called when not iterating over _observers to avoid callback skipping.
  // Removes an observer from the _observer Array.
  _remove(e, t = !0) {
    if (!e)
      return !1;
    const r = this._observers.indexOf(e);
    return r !== -1 ? (t && this._numObserversMarkedAsDeleted--, this._observers.splice(r, 1), !0) : !1;
  }
  /**
   * Moves the observable to the top of the observer list making it get called first when notified
   * @param observer the observer to move
   */
  makeObserverTopPriority(e) {
    this._remove(e, !1), this._observers.unshift(e);
  }
  /**
   * Moves the observable to the bottom of the observer list making it get called last when notified
   * @param observer the observer to move
   */
  makeObserverBottomPriority(e) {
    this._remove(e, !1), this._observers.push(e);
  }
  /**
   * Notify all Observers by calling their respective callback with the given data
   * Will return true if all observers were executed, false if an observer set skipNextObservers to true, then prevent the subsequent ones to execute
   * @param eventData defines the data to send to all observers
   * @param mask defines the mask of the current notification (observers with incompatible mask (ie mask & observer.mask === 0) will not be notified)
   * @param target defines the original target of the state
   * @param currentTarget defines the current target of the state
   * @param userInfo defines any user info to send to observers
   * @returns false if the complete observer chain was not processed (because one observer set the skipNextObservers to true)
   */
  notifyObservers(e, t = -1, r, n, i) {
    if (this.notifyIfTriggered && (this._hasNotified = !0, this._lastNotifiedValue = e), !this._observers.length)
      return !0;
    const s = this._eventState;
    s.mask = t, s.target = r, s.currentTarget = n, s.skipNextObservers = !1, s.lastReturnValue = e, s.userInfo = i;
    for (const a of this._observers)
      if (!a._willBeUnregistered && (a.mask & t && (a.unregisterOnNextCall && this._deferUnregister(a), a.scope ? s.lastReturnValue = a.callback.apply(a.scope, [e, s]) : s.lastReturnValue = a.callback(e, s)), s.skipNextObservers))
        return !1;
    return !0;
  }
  /**
   * Notify a specific observer
   * @param observer defines the observer to notify
   * @param eventData defines the data to be sent to each callback
   * @param mask is used to filter observers defaults to -1
   */
  notifyObserver(e, t, r = -1) {
    if (this.notifyIfTriggered && (this._hasNotified = !0, this._lastNotifiedValue = t), e._willBeUnregistered)
      return;
    const n = this._eventState;
    n.mask = r, n.skipNextObservers = !1, e.unregisterOnNextCall && this._deferUnregister(e), e.callback(t, n);
  }
  /**
   * Gets a boolean indicating if the observable has at least one observer
   * @returns true is the Observable has at least one Observer registered
   */
  hasObservers() {
    return this._observers.length - this._numObserversMarkedAsDeleted > 0;
  }
  /**
   * Clear the list of observers
   */
  clear() {
    for (; this._observers.length; ) {
      const e = this._observers.pop();
      e && (e._remove = null);
    }
    this._onObserverAdded = null, this._numObserversMarkedAsDeleted = 0, this.cleanLastNotifiedState();
  }
  /**
   * Clean the last notified state - both the internal last value and the has-notified flag
   */
  cleanLastNotifiedState() {
    this._hasNotified = !1, this._lastNotifiedValue = void 0;
  }
  /**
   * Clone the current observable
   * @returns a new observable
   */
  clone() {
    const e = new Oe();
    return e._observers = this._observers.slice(0), e;
  }
  /**
   * Does this observable handles observer registered with a given mask
   * @param mask defines the mask to be tested
   * @returns whether or not one observer registered with the given mask is handled
   **/
  hasSpecificMask(e = -1) {
    for (const t of this._observers)
      if (t.mask & e || t.mask === e)
        return !0;
    return !1;
  }
}
class Xt {
  /**
   * Boolean : true if the absolute difference between a and b is lower than epsilon (default = 1.401298E-45)
   * @param a number
   * @param b number
   * @param epsilon (default = 1.401298E-45)
   * @returns true if the absolute difference between a and b is lower than epsilon (default = 1.401298E-45)
   */
  static WithinEpsilon(e, t, r = 1401298e-51) {
    return Math.abs(e - t) <= r;
  }
  /**
   * Returns a string : the upper case translation of the number i to hexadecimal.
   * @param i number
   * @returns the upper case translation of the number i to hexadecimal.
   */
  static ToHex(e) {
    const t = e.toString(16);
    return e <= 15 ? ("0" + t).toUpperCase() : t.toUpperCase();
  }
  /**
   * Returns -1 if value is negative and +1 is value is positive.
   * @param value the value
   * @returns the value itself if it's equal to zero.
   */
  static Sign(e) {
    return e = +e, e === 0 || isNaN(e) ? e : e > 0 ? 1 : -1;
  }
  /**
   * Returns the value itself if it's between min and max.
   * Returns min if the value is lower than min.
   * Returns max if the value is greater than max.
   * @param value the value to clmap
   * @param min the min value to clamp to (default: 0)
   * @param max the max value to clamp to (default: 1)
   * @returns the clamped value
   */
  static Clamp(e, t = 0, r = 1) {
    return Math.min(r, Math.max(t, e));
  }
  /**
   * the log2 of value.
   * @param value the value to compute log2 of
   * @returns the log2 of value.
   */
  static Log2(e) {
    return Math.log(e) * Math.LOG2E;
  }
  /**
   * the floor part of a log2 value.
   * @param value the value to compute log2 of
   * @returns the log2 of value.
   */
  static ILog2(e) {
    if (Math.log2)
      return Math.floor(Math.log2(e));
    if (e < 0)
      return NaN;
    if (e === 0)
      return -1 / 0;
    let t = 0;
    if (e < 1) {
      for (; e < 1; )
        t++, e = e * 2;
      t = -t;
    } else if (e > 1)
      for (; e > 1; )
        t++, e = Math.floor(e / 2);
    return t;
  }
  /**
   * Loops the value, so that it is never larger than length and never smaller than 0.
   *
   * This is similar to the modulo operator but it works with floating point numbers.
   * For example, using 3.0 for t and 2.5 for length, the result would be 0.5.
   * With t = 5 and length = 2.5, the result would be 0.0.
   * Note, however, that the behaviour is not defined for negative numbers as it is for the modulo operator
   * @param value the value
   * @param length the length
   * @returns the looped value
   */
  static Repeat(e, t) {
    return e - Math.floor(e / t) * t;
  }
  /**
   * Normalize the value between 0.0 and 1.0 using min and max values
   * @param value value to normalize
   * @param min max to normalize between
   * @param max min to normalize between
   * @returns the normalized value
   */
  static Normalize(e, t, r) {
    return (e - t) / (r - t);
  }
  /**
   * Denormalize the value from 0.0 and 1.0 using min and max values
   * @param normalized value to denormalize
   * @param min max to denormalize between
   * @param max min to denormalize between
   * @returns the denormalized value
   */
  static Denormalize(e, t, r) {
    return e * (r - t) + t;
  }
  /**
   * Calculates the shortest difference between two given angles given in degrees.
   * @param current current angle in degrees
   * @param target target angle in degrees
   * @returns the delta
   */
  static DeltaAngle(e, t) {
    let r = Xt.Repeat(t - e, 360);
    return r > 180 && (r -= 360), r;
  }
  /**
   * PingPongs the value t, so that it is never larger than length and never smaller than 0.
   * @param tx value
   * @param length length
   * @returns The returned value will move back and forth between 0 and length
   */
  static PingPong(e, t) {
    const r = Xt.Repeat(e, t * 2);
    return t - Math.abs(r - t);
  }
  /**
   * Interpolates between min and max with smoothing at the limits.
   *
   * This function interpolates between min and max in a similar way to Lerp. However, the interpolation will gradually speed up
   * from the start and slow down toward the end. This is useful for creating natural-looking animation, fading and other transitions.
   * @param from from
   * @param to to
   * @param tx value
   * @returns the smooth stepped value
   */
  static SmoothStep(e, t, r) {
    let n = Xt.Clamp(r);
    return n = -2 * n * n * n + 3 * n * n, t * n + e * (1 - n);
  }
  /**
   * Moves a value current towards target.
   *
   * This is essentially the same as Mathf.Lerp but instead the function will ensure that the speed never exceeds maxDelta.
   * Negative values of maxDelta pushes the value away from target.
   * @param current current value
   * @param target target value
   * @param maxDelta max distance to move
   * @returns resulting value
   */
  static MoveTowards(e, t, r) {
    let n = 0;
    return Math.abs(t - e) <= r ? n = t : n = e + Xt.Sign(t - e) * r, n;
  }
  /**
   * Same as MoveTowards but makes sure the values interpolate correctly when they wrap around 360 degrees.
   *
   * Variables current and target are assumed to be in degrees. For optimization reasons, negative values of maxDelta
   *  are not supported and may cause oscillation. To push current away from a target angle, add 180 to that angle instead.
   * @param current current value
   * @param target target value
   * @param maxDelta max distance to move
   * @returns resulting angle
   */
  static MoveTowardsAngle(e, t, r) {
    const n = Xt.DeltaAngle(e, t);
    let i = 0;
    return -r < n && n < r ? i = t : (t = e + n, i = Xt.MoveTowards(e, t, r)), i;
  }
  /**
   * Creates a new scalar with values linearly interpolated of "amount" between the start scalar and the end scalar.
   * @param start start value
   * @param end target value
   * @param amount amount to lerp between
   * @returns the lerped value
   */
  static Lerp(e, t, r) {
    return e + (t - e) * r;
  }
  /**
   * Same as Lerp but makes sure the values interpolate correctly when they wrap around 360 degrees.
   * The parameter t is clamped to the range [0, 1]. Variables a and b are assumed to be in degrees.
   * @param start start value
   * @param end target value
   * @param amount amount to lerp between
   * @returns the lerped value
   */
  static LerpAngle(e, t, r) {
    let n = Xt.Repeat(t - e, 360);
    return n > 180 && (n -= 360), e + n * Xt.Clamp(r);
  }
  /**
   * Calculates the linear parameter t that produces the interpolant value within the range [a, b].
   * @param a start value
   * @param b target value
   * @param value value between a and b
   * @returns the inverseLerp value
   */
  static InverseLerp(e, t, r) {
    let n = 0;
    return e != t ? n = Xt.Clamp((r - e) / (t - e)) : n = 0, n;
  }
  /**
   * Returns a new scalar located for "amount" (float) on the Hermite spline defined by the scalars "value1", "value3", "tangent1", "tangent2".
   * @see http://mathworld.wolfram.com/HermitePolynomial.html
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param amount defines the amount on the interpolation spline (between 0 and 1)
   * @returns hermite result
   */
  static Hermite(e, t, r, n, i) {
    const s = i * i, a = i * s, f = 2 * a - 3 * s + 1, o = -2 * a + 3 * s, d = a - 2 * s + i, v = a - s;
    return e * f + r * o + t * d + n * v;
  }
  /**
   * Returns a new scalar which is the 1st derivative of the Hermite spline defined by the scalars "value1", "value2", "tangent1", "tangent2".
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @returns 1st derivative
   */
  static Hermite1stDerivative(e, t, r, n, i) {
    const s = i * i;
    return (s - i) * 6 * e + (3 * s - 4 * i + 1) * t + (-s + i) * 6 * r + (3 * s - 2 * i) * n;
  }
  /**
   * Returns a random float number between and min and max values
   * @param min min value of random
   * @param max max value of random
   * @returns random value
   */
  static RandomRange(e, t) {
    return e === t ? e : Math.random() * (t - e) + e;
  }
  /**
   * This function returns percentage of a number in a given range.
   *
   * RangeToPercent(40,20,60) will return 0.5 (50%)
   * RangeToPercent(34,0,100) will return 0.34 (34%)
   * @param number to convert to percentage
   * @param min min range
   * @param max max range
   * @returns the percentage
   */
  static RangeToPercent(e, t, r) {
    return (e - t) / (r - t);
  }
  /**
   * This function returns number that corresponds to the percentage in a given range.
   *
   * PercentToRange(0.34,0,100) will return 34.
   * @param percent to convert to number
   * @param min min range
   * @param max max range
   * @returns the number
   */
  static PercentToRange(e, t, r) {
    return (r - t) * e + t;
  }
  /**
   * Returns the angle converted to equivalent value between -Math.PI and Math.PI radians.
   * @param angle The angle to normalize in radian.
   * @returns The converted angle.
   */
  static NormalizeRadians(e) {
    return e -= Xt.TwoPi * Math.floor((e + Math.PI) / Xt.TwoPi), e;
  }
  /**
   * Returns the highest common factor of two integers.
   * @param a first parameter
   * @param b second parameter
   * @returns HCF of a and b
   */
  static HCF(e, t) {
    const r = e % t;
    return r === 0 ? t : Xt.HCF(t, r);
  }
}
Xt.TwoPi = Math.PI * 2;
const JW = 1 / 2.2, xI = 2.2, kf = (1 + Math.sqrt(5)) / 2, Dn = 1e-3;
class Nf {
  /**
   * Returns an array of the given size filled with elements built from the given constructor and the parameters.
   * @param size the number of element to construct and put in the array.
   * @param itemBuilder a callback responsible for creating new instance of item. Called once per array entry.
   * @returns a new array filled with new objects.
   */
  static BuildArray(e, t) {
    const r = [];
    for (let n = 0; n < e; ++n)
      r.push(t());
    return r;
  }
  /**
   * Returns a tuple of the given size filled with elements built from the given constructor and the parameters.
   * @param size he number of element to construct and put in the tuple.
   * @param itemBuilder a callback responsible for creating new instance of item. Called once per tuple entry.
   * @returns a new tuple filled with new objects.
   */
  static BuildTuple(e, t) {
    return Nf.BuildArray(e, t);
  }
}
function j9e(A, e, t) {
  const r = A[e];
  if (typeof r != "function")
    return null;
  const n = function() {
    const i = A.length, s = n.previous.apply(A, arguments);
    return t(e, i), s;
  };
  return r.next = n, n.previous = r, A[e] = n, () => {
    const i = n.previous;
    if (!i)
      return;
    const s = n.next;
    s ? (i.next = s, s.previous = i) : (i.next = void 0, A[e] = i), n.next = void 0, n.previous = void 0;
  };
}
const w9e = ["push", "splice", "pop", "shift", "unshift"];
function p$(A, e) {
  const t = w9e.map((r) => j9e(A, r, e));
  return () => {
    t.forEach((r) => {
      r == null || r();
    });
  };
}
const h$ = {};
function Ue(A, e) {
  h$[A] = e;
}
function Jo(A) {
  return h$[A];
}
class k9 {
  /**
   * @internal
   */
  static SetMatrixPrecision(e) {
    if (k9.MatrixTrackPrecisionChange = !1, e && !k9.MatrixUse64Bits && k9.MatrixTrackedMatrices)
      for (let t = 0; t < k9.MatrixTrackedMatrices.length; ++t) {
        const r = k9.MatrixTrackedMatrices[t], n = r._m;
        r._m = new Array(16);
        for (let i = 0; i < 16; ++i)
          r._m[i] = n[i];
      }
    k9.MatrixUse64Bits = e, k9.MatrixCurrentType = k9.MatrixUse64Bits ? Array : Float32Array, k9.MatrixTrackedMatrices = null;
  }
}
k9.MatrixUse64Bits = !1;
k9.MatrixTrackPrecisionChange = !0;
k9.MatrixCurrentType = Float32Array;
k9.MatrixTrackedMatrices = [];
class gr {
  /**
   * Gets the latest created engine
   */
  static get LastCreatedEngine() {
    return this.Instances.length === 0 ? null : this.Instances[this.Instances.length - 1];
  }
  /**
   * Gets the latest created scene
   */
  static get LastCreatedScene() {
    return this._LastCreatedScene;
  }
}
gr.Instances = [];
gr.OnEnginesDisposedObservable = new Oe();
gr._LastCreatedScene = null;
gr.UseFallbackTexture = !0;
gr.FallbackTexture = "";
const Kl = (A) => parseInt(A.toString().replace(/\W/g, ""));
class at {
  /**
   * Creates a new Vector2 from the given x and y coordinates
   * @param x defines the first coordinate
   * @param y defines the second coordinate
   */
  constructor(e = 0, t = 0) {
    this.x = e, this.y = t;
  }
  /**
   * Gets a string with the Vector2 coordinates
   * @returns a string with the Vector2 coordinates
   */
  toString() {
    return `{X: ${this.x} Y: ${this.y}}`;
  }
  /**
   * Gets class name
   * @returns the string "Vector2"
   */
  getClassName() {
    return "Vector2";
  }
  /**
   * Gets current vector hash code
   * @returns the Vector2 hash code as a number
   */
  getHashCode() {
    const e = Kl(this.x), t = Kl(this.y);
    let r = e;
    return r = r * 397 ^ t, r;
  }
  // Operators
  /**
   * Sets the Vector2 coordinates in the given array or Float32Array from the given index.
   * Example Playground https://playground.babylonjs.com/#QYBWV4#15
   * @param array defines the source array
   * @param index defines the offset in source array
   * @returns the current Vector2
   */
  toArray(e, t = 0) {
    return e[t] = this.x, e[t + 1] = this.y, this;
  }
  /**
   * Update the current vector from an array
   * Example Playground https://playground.babylonjs.com/#QYBWV4#39
   * @param array defines the destination array
   * @param index defines the offset in the destination array
   * @returns the current Vector2
   */
  fromArray(e, t = 0) {
    return at.FromArrayToRef(e, t, this), this;
  }
  /**
   * Copy the current vector to an array
   * Example Playground https://playground.babylonjs.com/#QYBWV4#40
   * @returns a new array with 2 elements: the Vector2 coordinates.
   */
  asArray() {
    const e = [];
    return this.toArray(e, 0), e;
  }
  /**
   * Sets the Vector2 coordinates with the given Vector2 coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#24
   * @param source defines the source Vector2
   * @returns the current updated Vector2
   */
  copyFrom(e) {
    return this.x = e.x, this.y = e.y, this;
  }
  /**
   * Sets the Vector2 coordinates with the given floats
   * Example Playground https://playground.babylonjs.com/#QYBWV4#25
   * @param x defines the first coordinate
   * @param y defines the second coordinate
   * @returns the current updated Vector2
   */
  copyFromFloats(e, t) {
    return this.x = e, this.y = t, this;
  }
  /**
   * Sets the Vector2 coordinates with the given floats
   * Example Playground https://playground.babylonjs.com/#QYBWV4#62
   * @param x defines the first coordinate
   * @param y defines the second coordinate
   * @returns the current updated Vector2
   */
  set(e, t) {
    return this.copyFromFloats(e, t);
  }
  /**
   * Add another vector with the current one
   * Example Playground https://playground.babylonjs.com/#QYBWV4#11
   * @param otherVector defines the other vector
   * @returns a new Vector2 set with the addition of the current Vector2 and the given one coordinates
   */
  add(e) {
    return new this.constructor(this.x + e.x, this.y + e.y);
  }
  /**
   * Sets the "result" coordinates with the addition of the current Vector2 and the given one coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#12
   * @param otherVector defines the other vector
   * @param result defines the target vector
   * @returns result input
   */
  addToRef(e, t) {
    return t.x = this.x + e.x, t.y = this.y + e.y, t;
  }
  /**
   * Set the Vector2 coordinates by adding the given Vector2 coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#13
   * @param otherVector defines the other vector
   * @returns the current updated Vector2
   */
  addInPlace(e) {
    return this.x += e.x, this.y += e.y, this;
  }
  /**
   * Gets a new Vector2 by adding the current Vector2 coordinates to the given Vector3 x, y coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#14
   * @param otherVector defines the other vector
   * @returns a new Vector2
   */
  addVector3(e) {
    return new this.constructor(this.x + e.x, this.y + e.y);
  }
  /**
   * Gets a new Vector2 set with the subtracted coordinates of the given one from the current Vector2
   * Example Playground https://playground.babylonjs.com/#QYBWV4#61
   * @param otherVector defines the other vector
   * @returns a new Vector2
   */
  subtract(e) {
    return new this.constructor(this.x - e.x, this.y - e.y);
  }
  /**
   * Sets the "result" coordinates with the subtraction of the given one from the current Vector2 coordinates.
   * Example Playground https://playground.babylonjs.com/#QYBWV4#63
   * @param otherVector defines the other vector
   * @param result defines the target vector
   * @returns result input
   */
  subtractToRef(e, t) {
    return t.x = this.x - e.x, t.y = this.y - e.y, t;
  }
  /**
   * Sets the current Vector2 coordinates by subtracting from it the given one coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#88
   * @param otherVector defines the other vector
   * @returns the current updated Vector2
   */
  subtractInPlace(e) {
    return this.x -= e.x, this.y -= e.y, this;
  }
  /**
   * Multiplies in place the current Vector2 coordinates by the given ones
   * Example Playground https://playground.babylonjs.com/#QYBWV4#43
   * @param otherVector defines the other vector
   * @returns the current updated Vector2
   */
  multiplyInPlace(e) {
    return this.x *= e.x, this.y *= e.y, this;
  }
  /**
   * Returns a new Vector2 set with the multiplication of the current Vector2 and the given one coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#42
   * @param otherVector defines the other vector
   * @returns a new Vector2
   */
  multiply(e) {
    return new this.constructor(this.x * e.x, this.y * e.y);
  }
  /**
   * Sets "result" coordinates with the multiplication of the current Vector2 and the given one coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#44
   * @param otherVector defines the other vector
   * @param result defines the target vector
   * @returns result input
   */
  multiplyToRef(e, t) {
    return t.x = this.x * e.x, t.y = this.y * e.y, t;
  }
  /**
   * Gets a new Vector2 set with the Vector2 coordinates multiplied by the given floats
   * Example Playground https://playground.babylonjs.com/#QYBWV4#89
   * @param x defines the first coordinate
   * @param y defines the second coordinate
   * @returns a new Vector2
   */
  multiplyByFloats(e, t) {
    return new this.constructor(this.x * e, this.y * t);
  }
  /**
   * Returns a new Vector2 set with the Vector2 coordinates divided by the given one coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#27
   * @param otherVector defines the other vector
   * @returns a new Vector2
   */
  divide(e) {
    return new this.constructor(this.x / e.x, this.y / e.y);
  }
  /**
   * Sets the "result" coordinates with the Vector2 divided by the given one coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#30
   * @param otherVector defines the other vector
   * @param result defines the target vector
   * @returns result input
   */
  divideToRef(e, t) {
    return t.x = this.x / e.x, t.y = this.y / e.y, t;
  }
  /**
   * Divides the current Vector2 coordinates by the given ones
   * Example Playground https://playground.babylonjs.com/#QYBWV4#28
   * @param otherVector defines the other vector
   * @returns the current updated Vector2
   */
  divideInPlace(e) {
    return this.divideToRef(e, this);
  }
  /**
   * Gets a new Vector2 with current Vector2 negated coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#22
   * @returns a new Vector2
   */
  negate() {
    return new this.constructor(-this.x, -this.y);
  }
  /**
   * Negate this vector in place
   * Example Playground https://playground.babylonjs.com/#QYBWV4#23
   * @returns this
   */
  negateInPlace() {
    return this.x *= -1, this.y *= -1, this;
  }
  /**
   * Negate the current Vector2 and stores the result in the given vector "result" coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#41
   * @param result defines the Vector3 object where to store the result
   * @returns the result
   */
  negateToRef(e) {
    return e.copyFromFloats(this.x * -1, this.y * -1);
  }
  /**
   * Multiply the Vector2 coordinates by
   * Example Playground https://playground.babylonjs.com/#QYBWV4#59
   * @param scale defines the scaling factor
   * @returns the current updated Vector2
   */
  scaleInPlace(e) {
    return this.x *= e, this.y *= e, this;
  }
  /**
   * Returns a new Vector2 scaled by "scale" from the current Vector2
   * Example Playground https://playground.babylonjs.com/#QYBWV4#52
   * @param scale defines the scaling factor
   * @returns a new Vector2
   */
  scale(e) {
    const t = new this.constructor(0, 0);
    return this.scaleToRef(e, t), t;
  }
  /**
   * Scale the current Vector2 values by a factor to a given Vector2
   * Example Playground https://playground.babylonjs.com/#QYBWV4#57
   * @param scale defines the scale factor
   * @param result defines the Vector2 object where to store the result
   * @returns result input
   */
  scaleToRef(e, t) {
    return t.x = this.x * e, t.y = this.y * e, t;
  }
  /**
   * Scale the current Vector2 values by a factor and add the result to a given Vector2
   * Example Playground https://playground.babylonjs.com/#QYBWV4#58
   * @param scale defines the scale factor
   * @param result defines the Vector2 object where to store the result
   * @returns result input
   */
  scaleAndAddToRef(e, t) {
    return t.x += this.x * e, t.y += this.y * e, t;
  }
  /**
   * Gets a boolean if two vectors are equals
   * Example Playground https://playground.babylonjs.com/#QYBWV4#31
   * @param otherVector defines the other vector
   * @returns true if the given vector coordinates strictly equal the current Vector2 ones
   */
  equals(e) {
    return e && this.x === e.x && this.y === e.y;
  }
  /**
   * Gets a boolean if two vectors are equals (using an epsilon value)
   * Example Playground https://playground.babylonjs.com/#QYBWV4#32
   * @param otherVector defines the other vector
   * @param epsilon defines the minimal distance to consider equality
   * @returns true if the given vector coordinates are close to the current ones by a distance of epsilon.
   */
  equalsWithEpsilon(e, t = Dn) {
    return e && Xt.WithinEpsilon(this.x, e.x, t) && Xt.WithinEpsilon(this.y, e.y, t);
  }
  /**
   * Gets a new Vector2 from current Vector2 floored values
   * Example Playground https://playground.babylonjs.com/#QYBWV4#35
   * eg (1.2, 2.31) returns (1, 2)
   * @returns a new Vector2
   */
  floor() {
    return new this.constructor(Math.floor(this.x), Math.floor(this.y));
  }
  /**
   * Gets a new Vector2 from current Vector2 fractional values
   * Example Playground https://playground.babylonjs.com/#QYBWV4#34
   * eg (1.2, 2.31) returns (0.2, 0.31)
   * @returns a new Vector2
   */
  fract() {
    return new this.constructor(this.x - Math.floor(this.x), this.y - Math.floor(this.y));
  }
  /**
   * Rotate the current vector into a given result vector
   * Example Playground https://playground.babylonjs.com/#QYBWV4#49
   * @param angle defines the rotation angle
   * @param result defines the result vector where to store the rotated vector
   * @returns result input
   */
  rotateToRef(e, t) {
    const r = Math.cos(e), n = Math.sin(e), i = r * this.x - n * this.y, s = n * this.x + r * this.y;
    return t.x = i, t.y = s, t;
  }
  // Properties
  /**
   * Gets the length of the vector
   * @returns the vector length (float)
   */
  length() {
    return Math.sqrt(this.x * this.x + this.y * this.y);
  }
  /**
   * Gets the vector squared length
   * @returns the vector squared length (float)
   */
  lengthSquared() {
    return this.x * this.x + this.y * this.y;
  }
  // Methods
  /**
   * Normalize the vector
   * Example Playground https://playground.babylonjs.com/#QYBWV4#48
   * @returns the current updated Vector2
   */
  normalize() {
    return this.normalizeFromLength(this.length());
  }
  /**
   * Normalize the current Vector2 with the given input length.
   * Please note that this is an in place operation.
   * @param len the length of the vector
   * @returns the current updated Vector2
   */
  normalizeFromLength(e) {
    return e === 0 || e === 1 ? this : this.scaleInPlace(1 / e);
  }
  /**
   * Normalize the current Vector2 to a new vector
   * @returns the new Vector2
   */
  normalizeToNew() {
    const e = new this.constructor(0, 0);
    return this.normalizeToRef(e), e;
  }
  /**
   * Normalize the current Vector2 to the reference
   * @param reference define the Vector2 to update
   * @returns the updated Vector2
   */
  normalizeToRef(e) {
    const t = this.length();
    return t === 0 || t === 1 ? e.copyFromFloats(this.x, this.y) : this.scaleToRef(1 / t, e);
  }
  /**
   * Gets a new Vector2 copied from the Vector2
   * Example Playground https://playground.babylonjs.com/#QYBWV4#20
   * @returns a new Vector2
   */
  clone() {
    return new this.constructor(this.x, this.y);
  }
  /**
   * Gets the dot product of the current vector and the vector "otherVector"
   * @param otherVector defines second vector
   * @returns the dot product (float)
   */
  dot(e) {
    return this.x * e.x + this.y * e.y;
  }
  // Statics
  /**
   * Gets a new Vector2(0, 0)
   * @returns a new Vector2
   */
  static Zero() {
    return new at(0, 0);
  }
  /**
   * Gets a new Vector2(1, 1)
   * @returns a new Vector2
   */
  static One() {
    return new at(1, 1);
  }
  /**
   * Returns a new Vector2 with random values between min and max
   * @param min the minimum random value
   * @param max the maximum random value
   * @returns a Vector2 with random values between min and max
   */
  static Random(e = 0, t = 1) {
    return new at(Xt.RandomRange(e, t), Xt.RandomRange(e, t));
  }
  /**
   * Gets a zero Vector2 that must not be updated
   */
  static get ZeroReadOnly() {
    return at._ZeroReadOnly;
  }
  /**
   * Gets a new Vector2 set from the given index element of the given array
   * Example Playground https://playground.babylonjs.com/#QYBWV4#79
   * @param array defines the data source
   * @param offset defines the offset in the data source
   * @returns a new Vector2
   */
  static FromArray(e, t = 0) {
    return new at(e[t], e[t + 1]);
  }
  /**
   * Sets "result" from the given index element of the given array
   * Example Playground https://playground.babylonjs.com/#QYBWV4#80
   * @param array defines the data source
   * @param offset defines the offset in the data source
   * @param result defines the target vector
   * @returns result input
   */
  static FromArrayToRef(e, t, r) {
    return r.x = e[t], r.y = e[t + 1], r;
  }
  /**
   * Gets a new Vector2 located for "amount" (float) on the CatmullRom spline defined by the given four Vector2
   * Example Playground https://playground.babylonjs.com/#QYBWV4#65
   * @param value1 defines 1st point of control
   * @param value2 defines 2nd point of control
   * @param value3 defines 3rd point of control
   * @param value4 defines 4th point of control
   * @param amount defines the interpolation factor
   * @returns a new Vector2
   */
  static CatmullRom(e, t, r, n, i) {
    const s = i * i, a = i * s, f = 0.5 * (2 * t.x + (-e.x + r.x) * i + (2 * e.x - 5 * t.x + 4 * r.x - n.x) * s + (-e.x + 3 * t.x - 3 * r.x + n.x) * a), o = 0.5 * (2 * t.y + (-e.y + r.y) * i + (2 * e.y - 5 * t.y + 4 * r.y - n.y) * s + (-e.y + 3 * t.y - 3 * r.y + n.y) * a);
    return new e.constructor(f, o);
  }
  /**
   * Returns a new Vector2 set with same the coordinates than "value" ones if the vector "value" is in the square defined by "min" and "max".
   * If a coordinate of "value" is lower than "min" coordinates, the returned Vector2 is given this "min" coordinate.
   * If a coordinate of "value" is greater than "max" coordinates, the returned Vector2 is given this "max" coordinate
   * Example Playground https://playground.babylonjs.com/#QYBWV4#76
   * @param value defines the value to clamp
   * @param min defines the lower limit
   * @param max defines the upper limit
   * @returns a new Vector2
   */
  static Clamp(e, t, r) {
    let n = e.x;
    n = n > r.x ? r.x : n, n = n < t.x ? t.x : n;
    let i = e.y;
    return i = i > r.y ? r.y : i, i = i < t.y ? t.y : i, new e.constructor(n, i);
  }
  /**
   * Returns a new Vector2 located for "amount" (float) on the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2"
   * Example Playground https://playground.babylonjs.com/#QYBWV4#81
   * @param value1 defines the 1st control point
   * @param tangent1 defines the outgoing tangent
   * @param value2 defines the 2nd control point
   * @param tangent2 defines the incoming tangent
   * @param amount defines the interpolation factor
   * @returns a new Vector2
   */
  static Hermite(e, t, r, n, i) {
    const s = i * i, a = i * s, f = 2 * a - 3 * s + 1, o = -2 * a + 3 * s, d = a - 2 * s + i, v = a - s, u = e.x * f + r.x * o + t.x * d + n.x * v, l = e.y * f + r.y * o + t.y * d + n.y * v;
    return new e.constructor(u, l);
  }
  /**
   * Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
   * Example Playground https://playground.babylonjs.com/#QYBWV4#82
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @returns 1st derivative
   */
  static Hermite1stDerivative(e, t, r, n, i) {
    const s = new e.constructor();
    return this.Hermite1stDerivativeToRef(e, t, r, n, i, s), s;
  }
  /**
   * Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
   * Example Playground https://playground.babylonjs.com/#QYBWV4#83
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @param result define where the derivative will be stored
   * @returns result input
   */
  static Hermite1stDerivativeToRef(e, t, r, n, i, s) {
    const a = i * i;
    return s.x = (a - i) * 6 * e.x + (3 * a - 4 * i + 1) * t.x + (-a + i) * 6 * r.x + (3 * a - 2 * i) * n.x, s.y = (a - i) * 6 * e.y + (3 * a - 4 * i + 1) * t.y + (-a + i) * 6 * r.y + (3 * a - 2 * i) * n.y, s;
  }
  /**
   * Returns a new Vector2 located for "amount" (float) on the linear interpolation between the vector "start" adn the vector "end".
   * Example Playground https://playground.babylonjs.com/#QYBWV4#84
   * @param start defines the start vector
   * @param end defines the end vector
   * @param amount defines the interpolation factor
   * @returns a new Vector2
   */
  static Lerp(e, t, r) {
    const n = e.x + (t.x - e.x) * r, i = e.y + (t.y - e.y) * r;
    return new e.constructor(n, i);
  }
  /**
   * Gets the dot product of the vector "left" and the vector "right"
   * Example Playground https://playground.babylonjs.com/#QYBWV4#90
   * @param left defines first vector
   * @param right defines second vector
   * @returns the dot product (float)
   */
  static Dot(e, t) {
    return e.x * t.x + e.y * t.y;
  }
  /**
   * Returns a new Vector2 equal to the normalized given vector
   * Example Playground https://playground.babylonjs.com/#QYBWV4#46
   * @param vector defines the vector to normalize
   * @returns a new Vector2
   */
  static Normalize(e) {
    const t = new e.constructor();
    return at.NormalizeToRef(e, t), t;
  }
  /**
   * Normalize a given vector into a second one
   * Example Playground https://playground.babylonjs.com/#QYBWV4#50
   * @param vector defines the vector to normalize
   * @param result defines the vector where to store the result
   * @returns result input
   */
  static NormalizeToRef(e, t) {
    return e.normalizeToRef(t), t;
  }
  /**
   * Gets a new Vector2 set with the minimal coordinate values from the "left" and "right" vectors
   * Example Playground https://playground.babylonjs.com/#QYBWV4#86
   * @param left defines 1st vector
   * @param right defines 2nd vector
   * @returns a new Vector2
   */
  static Minimize(e, t) {
    const r = e.x < t.x ? e.x : t.x, n = e.y < t.y ? e.y : t.y;
    return new e.constructor(r, n);
  }
  /**
   * Gets a new Vector2 set with the maximal coordinate values from the "left" and "right" vectors
   * Example Playground https://playground.babylonjs.com/#QYBWV4#86
   * @param left defines 1st vector
   * @param right defines 2nd vector
   * @returns a new Vector2
   */
  static Maximize(e, t) {
    const r = e.x > t.x ? e.x : t.x, n = e.y > t.y ? e.y : t.y;
    return new e.constructor(r, n);
  }
  /**
   * Gets a new Vector2 set with the transformed coordinates of the given vector by the given transformation matrix
   * Example Playground https://playground.babylonjs.com/#QYBWV4#17
   * @param vector defines the vector to transform
   * @param transformation defines the matrix to apply
   * @returns a new Vector2
   */
  static Transform(e, t) {
    const r = new e.constructor();
    return at.TransformToRef(e, t, r), r;
  }
  /**
   * Transforms the given vector coordinates by the given transformation matrix and stores the result in the vector "result" coordinates
   * Example Playground https://playground.babylonjs.com/#QYBWV4#19
   * @param vector defines the vector to transform
   * @param transformation defines the matrix to apply
   * @param result defines the target vector
   * @returns result input
   */
  static TransformToRef(e, t, r) {
    const n = t.m, i = e.x * n[0] + e.y * n[4] + n[12], s = e.x * n[1] + e.y * n[5] + n[13];
    return r.x = i, r.y = s, r;
  }
  /**
   * Determines if a given vector is included in a triangle
   * Example Playground https://playground.babylonjs.com/#QYBWV4#87
   * @param p defines the vector to test
   * @param p0 defines 1st triangle point
   * @param p1 defines 2nd triangle point
   * @param p2 defines 3rd triangle point
   * @returns true if the point "p" is in the triangle defined by the vectors "p0", "p1", "p2"
   */
  static PointInTriangle(e, t, r, n) {
    const i = 0.5 * (-r.y * n.x + t.y * (-r.x + n.x) + t.x * (r.y - n.y) + r.x * n.y), s = i < 0 ? -1 : 1, a = (t.y * n.x - t.x * n.y + (n.y - t.y) * e.x + (t.x - n.x) * e.y) * s, f = (t.x * r.y - t.y * r.x + (t.y - r.y) * e.x + (r.x - t.x) * e.y) * s;
    return a > 0 && f > 0 && a + f < 2 * i * s;
  }
  /**
   * Gets the distance between the vectors "value1" and "value2"
   * Example Playground https://playground.babylonjs.com/#QYBWV4#71
   * @param value1 defines first vector
   * @param value2 defines second vector
   * @returns the distance between vectors
   */
  static Distance(e, t) {
    return Math.sqrt(at.DistanceSquared(e, t));
  }
  /**
   * Returns the squared distance between the vectors "value1" and "value2"
   * Example Playground https://playground.babylonjs.com/#QYBWV4#72
   * @param value1 defines first vector
   * @param value2 defines second vector
   * @returns the squared distance between vectors
   */
  static DistanceSquared(e, t) {
    const r = e.x - t.x, n = e.y - t.y;
    return r * r + n * n;
  }
  /**
   * Gets a new Vector2 located at the center of the vectors "value1" and "value2"
   * Example Playground https://playground.babylonjs.com/#QYBWV4#86
   * Example Playground https://playground.babylonjs.com/#QYBWV4#66
   * @param value1 defines first vector
   * @param value2 defines second vector
   * @returns a new Vector2
   */
  static Center(e, t) {
    const r = new e.constructor();
    return at.CenterToRef(e, t, r);
  }
  /**
   * Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref"
   * Example Playground https://playground.babylonjs.com/#QYBWV4#66
   * @param value1 defines first vector
   * @param value2 defines second vector
   * @param ref defines third vector
   * @returns ref
   */
  static CenterToRef(e, t, r) {
    return r.copyFromFloats((e.x + t.x) / 2, (e.y + t.y) / 2);
  }
  /**
   * Gets the shortest distance (float) between the point "p" and the segment defined by the two points "segA" and "segB".
   * Example Playground https://playground.babylonjs.com/#QYBWV4#77
   * @param p defines the middle point
   * @param segA defines one point of the segment
   * @param segB defines the other point of the segment
   * @returns the shortest distance
   */
  static DistanceOfPointFromSegment(e, t, r) {
    const n = at.DistanceSquared(t, r);
    if (n === 0)
      return at.Distance(e, t);
    const i = r.subtract(t), s = Math.max(0, Math.min(1, at.Dot(e.subtract(t), i) / n)), a = t.add(i.multiplyByFloats(s, s));
    return at.Distance(e, a);
  }
}
at._ZeroReadOnly = at.Zero();
class S {
  /** Gets or sets the x coordinate */
  get x() {
    return this._x;
  }
  set x(e) {
    this._x = e, this._isDirty = !0;
  }
  /** Gets or sets the y coordinate */
  get y() {
    return this._y;
  }
  set y(e) {
    this._y = e, this._isDirty = !0;
  }
  /** Gets or sets the z coordinate */
  get z() {
    return this._z;
  }
  set z(e) {
    this._z = e, this._isDirty = !0;
  }
  /**
   * Creates a new Vector3 object from the given x, y, z (floats) coordinates.
   * @param x defines the first coordinates (on X axis)
   * @param y defines the second coordinates (on Y axis)
   * @param z defines the third coordinates (on Z axis)
   */
  constructor(e = 0, t = 0, r = 0) {
    this._isDirty = !0, this._x = e, this._y = t, this._z = r;
  }
  /**
   * Creates a string representation of the Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#67
   * @returns a string with the Vector3 coordinates.
   */
  toString() {
    return `{X: ${this._x} Y: ${this._y} Z: ${this._z}}`;
  }
  /**
   * Gets the class name
   * @returns the string "Vector3"
   */
  getClassName() {
    return "Vector3";
  }
  /**
   * Creates the Vector3 hash code
   * @returns a number which tends to be unique between Vector3 instances
   */
  getHashCode() {
    const e = Kl(this._x), t = Kl(this._y), r = Kl(this._z);
    let n = e;
    return n = n * 397 ^ t, n = n * 397 ^ r, n;
  }
  // Operators
  /**
   * Creates an array containing three elements : the coordinates of the Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#10
   * @returns a new array of numbers
   */
  asArray() {
    const e = [];
    return this.toArray(e, 0), e;
  }
  /**
   * Populates the given array or Float32Array from the given index with the successive coordinates of the Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#65
   * @param array defines the destination array
   * @param index defines the offset in the destination array
   * @returns the current Vector3
   */
  toArray(e, t = 0) {
    return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, this;
  }
  /**
   * Update the current vector from an array
   * Example Playground https://playground.babylonjs.com/#R1F8YU#24
   * @param array defines the destination array
   * @param index defines the offset in the destination array
   * @returns the current Vector3
   */
  fromArray(e, t = 0) {
    return S.FromArrayToRef(e, t, this), this;
  }
  /**
   * Converts the current Vector3 into a quaternion (considering that the Vector3 contains Euler angles representation of a rotation)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#66
   * @returns a new Quaternion object, computed from the Vector3 coordinates
   */
  toQuaternion() {
    return Ze.RotationYawPitchRoll(this._y, this._x, this._z);
  }
  /**
   * Adds the given vector to the current Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#4
   * @param otherVector defines the second operand
   * @returns the current updated Vector3
   */
  addInPlace(e) {
    return this.addInPlaceFromFloats(e._x, e._y, e._z);
  }
  /**
   * Adds the given coordinates to the current Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#5
   * @param x defines the x coordinate of the operand
   * @param y defines the y coordinate of the operand
   * @param z defines the z coordinate of the operand
   * @returns the current updated Vector3
   */
  addInPlaceFromFloats(e, t, r) {
    return this._x += e, this._y += t, this._z += r, this._isDirty = !0, this;
  }
  /**
   * Gets a new Vector3, result of the addition the current Vector3 and the given vector
   * Example Playground https://playground.babylonjs.com/#R1F8YU#3
   * @param otherVector defines the second operand
   * @returns the resulting Vector3
   */
  add(e) {
    return new this.constructor(this._x + e._x, this._y + e._y, this._z + e._z);
  }
  /**
   * Adds the current Vector3 to the given one and stores the result in the vector "result"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#6
   * @param otherVector defines the second operand
   * @param result defines the Vector3 object where to store the result
   * @returns the result
   */
  addToRef(e, t) {
    return t.copyFromFloats(this._x + e._x, this._y + e._y, this._z + e._z);
  }
  /**
   * Subtract the given vector from the current Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#61
   * @param otherVector defines the second operand
   * @returns the current updated Vector3
   */
  subtractInPlace(e) {
    return this._x -= e._x, this._y -= e._y, this._z -= e._z, this._isDirty = !0, this;
  }
  /**
   * Returns a new Vector3, result of the subtraction of the given vector from the current Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#60
   * @param otherVector defines the second operand
   * @returns the resulting Vector3
   */
  subtract(e) {
    return new this.constructor(this._x - e._x, this._y - e._y, this._z - e._z);
  }
  /**
   * Subtracts the given vector from the current Vector3 and stores the result in the vector "result".
   * Example Playground https://playground.babylonjs.com/#R1F8YU#63
   * @param otherVector defines the second operand
   * @param result defines the Vector3 object where to store the result
   * @returns the result
   */
  subtractToRef(e, t) {
    return this.subtractFromFloatsToRef(e._x, e._y, e._z, t);
  }
  /**
   * Returns a new Vector3 set with the subtraction of the given floats from the current Vector3 coordinates
   * Example Playground https://playground.babylonjs.com/#R1F8YU#62
   * @param x defines the x coordinate of the operand
   * @param y defines the y coordinate of the operand
   * @param z defines the z coordinate of the operand
   * @returns the resulting Vector3
   */
  subtractFromFloats(e, t, r) {
    return new this.constructor(this._x - e, this._y - t, this._z - r);
  }
  /**
   * Subtracts the given floats from the current Vector3 coordinates and set the given vector "result" with this result
   * Example Playground https://playground.babylonjs.com/#R1F8YU#64
   * @param x defines the x coordinate of the operand
   * @param y defines the y coordinate of the operand
   * @param z defines the z coordinate of the operand
   * @param result defines the Vector3 object where to store the result
   * @returns the result
   */
  subtractFromFloatsToRef(e, t, r, n) {
    return n.copyFromFloats(this._x - e, this._y - t, this._z - r);
  }
  /**
   * Gets a new Vector3 set with the current Vector3 negated coordinates
   * Example Playground https://playground.babylonjs.com/#R1F8YU#35
   * @returns a new Vector3
   */
  negate() {
    return new this.constructor(-this._x, -this._y, -this._z);
  }
  /**
   * Negate this vector in place
   * Example Playground https://playground.babylonjs.com/#R1F8YU#36
   * @returns this
   */
  negateInPlace() {
    return this._x *= -1, this._y *= -1, this._z *= -1, this._isDirty = !0, this;
  }
  /**
   * Negate the current Vector3 and stores the result in the given vector "result" coordinates
   * Example Playground https://playground.babylonjs.com/#R1F8YU#37
   * @param result defines the Vector3 object where to store the result
   * @returns the result
   */
  negateToRef(e) {
    return e.copyFromFloats(this._x * -1, this._y * -1, this._z * -1);
  }
  /**
   * Multiplies the Vector3 coordinates by the float "scale"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#56
   * @param scale defines the multiplier factor
   * @returns the current updated Vector3
   */
  scaleInPlace(e) {
    return this._x *= e, this._y *= e, this._z *= e, this._isDirty = !0, this;
  }
  /**
   * Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float "scale"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#53
   * @param scale defines the multiplier factor
   * @returns a new Vector3
   */
  scale(e) {
    return new this.constructor(this._x * e, this._y * e, this._z * e);
  }
  /**
   * Multiplies the current Vector3 coordinates by the float "scale" and stores the result in the given vector "result" coordinates
   * Example Playground https://playground.babylonjs.com/#R1F8YU#57
   * @param scale defines the multiplier factor
   * @param result defines the Vector3 object where to store the result
   * @returns the result
   */
  scaleToRef(e, t) {
    return t.copyFromFloats(this._x * e, this._y * e, this._z * e);
  }
  /**
   * Creates a vector normal (perpendicular) to the current Vector3 and stores the result in the given vector
   * Out of the infinite possibilities the normal chosen is the one formed by rotating the current vector
   * 90 degrees about an axis which lies perpendicular to the current vector
   * and its projection on the xz plane. In the case of a current vector in the xz plane
   * the normal is calculated to be along the y axis.
   * Example Playground https://playground.babylonjs.com/#R1F8YU#230
   * Example Playground https://playground.babylonjs.com/#R1F8YU#231
   * @param result defines the Vector3 object where to store the resultant normal
   * returns the result
   */
  getNormalToRef(e) {
    const t = this.length();
    let r = Math.acos(this.y / t);
    const n = Math.atan2(this.z, this.x);
    r > Math.PI / 2 ? r -= Math.PI / 2 : r += Math.PI / 2;
    const i = t * Math.sin(r) * Math.cos(n), s = t * Math.cos(r), a = t * Math.sin(r) * Math.sin(n);
    return e.set(i, s, a), e;
  }
  /**
   * Rotates the vector using the given unit quaternion and stores the new vector in result
   * Example Playground https://playground.babylonjs.com/#R1F8YU#9
   * @param q the unit quaternion representing the rotation
   * @param result the output vector
   * @returns the result
   */
  applyRotationQuaternionToRef(e, t) {
    const r = this._x, n = this._y, i = this._z, s = e._x, a = e._y, f = e._z, o = e._w, d = 2 * (a * i - f * n), v = 2 * (f * r - s * i), u = 2 * (s * n - a * r);
    return t._x = r + o * d + a * u - f * v, t._y = n + o * v + f * d - s * u, t._z = i + o * u + s * v - a * d, t._isDirty = !0, t;
  }
  /**
   * Rotates the vector in place using the given unit quaternion
   * Example Playground https://playground.babylonjs.com/#R1F8YU#8
   * @param q the unit quaternion representing the rotation
   * @returns the current updated Vector3
   */
  applyRotationQuaternionInPlace(e) {
    return this.applyRotationQuaternionToRef(e, this);
  }
  /**
   * Rotates the vector using the given unit quaternion and returns the new vector
   * Example Playground https://playground.babylonjs.com/#R1F8YU#7
   * @param q the unit quaternion representing the rotation
   * @returns a new Vector3
   */
  applyRotationQuaternion(e) {
    return this.applyRotationQuaternionToRef(e, new this.constructor());
  }
  /**
   * Scale the current Vector3 values by a factor and add the result to a given Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#55
   * @param scale defines the scale factor
   * @param result defines the Vector3 object where to store the result
   * @returns result input
   */
  scaleAndAddToRef(e, t) {
    return t.addInPlaceFromFloats(this._x * e, this._y * e, this._z * e);
  }
  /**
   * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
   * Example Playground https://playground.babylonjs.com/#R1F8YU#48
   * @param plane defines the plane to project to
   * @param origin defines the origin of the projection ray
   * @returns the projected vector3
   */
  projectOnPlane(e, t) {
    const r = new this.constructor();
    return this.projectOnPlaneToRef(e, t, r), r;
  }
  /**
   * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
   * Example Playground https://playground.babylonjs.com/#R1F8YU#49
   * @param plane defines the plane to project to
   * @param origin defines the origin of the projection ray
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  projectOnPlaneToRef(e, t, r) {
    const n = e.normal, i = e.d, s = Kr.Vector3[0];
    this.subtractToRef(t, s), s.normalize();
    const a = S.Dot(s, n);
    if (Math.abs(a) < 1e-10)
      r.setAll(1 / 0);
    else {
      const f = -(S.Dot(t, n) + i) / a, o = s.scaleInPlace(f);
      t.addToRef(o, r);
    }
    return r;
  }
  /**
   * Returns true if the current Vector3 and the given vector coordinates are strictly equal
   * Example Playground https://playground.babylonjs.com/#R1F8YU#19
   * @param otherVector defines the second operand
   * @returns true if both vectors are equals
   */
  equals(e) {
    return e && this._x === e._x && this._y === e._y && this._z === e._z;
  }
  /**
   * Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon
   * Example Playground https://playground.babylonjs.com/#R1F8YU#21
   * @param otherVector defines the second operand
   * @param epsilon defines the minimal distance to define values as equals
   * @returns true if both vectors are distant less than epsilon
   */
  equalsWithEpsilon(e, t = Dn) {
    return e && Xt.WithinEpsilon(this._x, e._x, t) && Xt.WithinEpsilon(this._y, e._y, t) && Xt.WithinEpsilon(this._z, e._z, t);
  }
  /**
   * Returns true if the current Vector3 coordinates equals the given floats
   * Example Playground https://playground.babylonjs.com/#R1F8YU#20
   * @param x defines the x coordinate of the operand
   * @param y defines the y coordinate of the operand
   * @param z defines the z coordinate of the operand
   * @returns true if both vectors are equal
   */
  equalsToFloats(e, t, r) {
    return this._x === e && this._y === t && this._z === r;
  }
  /**
   * Multiplies the current Vector3 coordinates by the given ones
   * Example Playground https://playground.babylonjs.com/#R1F8YU#32
   * @param otherVector defines the second operand
   * @returns the current updated Vector3
   */
  multiplyInPlace(e) {
    return this._x *= e._x, this._y *= e._y, this._z *= e._z, this._isDirty = !0, this;
  }
  /**
   * Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector
   * Example Playground https://playground.babylonjs.com/#R1F8YU#31
   * @param otherVector defines the second operand
   * @returns the new Vector3
   */
  multiply(e) {
    return this.multiplyByFloats(e._x, e._y, e._z);
  }
  /**
   * Multiplies the current Vector3 by the given one and stores the result in the given vector "result"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#33
   * @param otherVector defines the second operand
   * @param result defines the Vector3 object where to store the result
   * @returns the result
   */
  multiplyToRef(e, t) {
    return t.copyFromFloats(this._x * e._x, this._y * e._y, this._z * e._z);
  }
  /**
   * Returns a new Vector3 set with the result of the multiplication of the current Vector3 coordinates by the given floats
   * Example Playground https://playground.babylonjs.com/#R1F8YU#34
   * @param x defines the x coordinate of the operand
   * @param y defines the y coordinate of the operand
   * @param z defines the z coordinate of the operand
   * @returns the new Vector3
   */
  multiplyByFloats(e, t, r) {
    return new this.constructor(this._x * e, this._y * t, this._z * r);
  }
  /**
   * Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones
   * Example Playground https://playground.babylonjs.com/#R1F8YU#16
   * @param otherVector defines the second operand
   * @returns the new Vector3
   */
  divide(e) {
    return new this.constructor(this._x / e._x, this._y / e._y, this._z / e._z);
  }
  /**
   * Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#18
   * @param otherVector defines the second operand
   * @param result defines the Vector3 object where to store the result
   * @returns the result
   */
  divideToRef(e, t) {
    return t.copyFromFloats(this._x / e._x, this._y / e._y, this._z / e._z);
  }
  /**
   * Divides the current Vector3 coordinates by the given ones.
   * Example Playground https://playground.babylonjs.com/#R1F8YU#17
   * @param otherVector defines the second operand
   * @returns the current updated Vector3
   */
  divideInPlace(e) {
    return this.divideToRef(e, this);
  }
  /**
   * Updates the current Vector3 with the minimal coordinate values between its and the given vector ones
   * Example Playground https://playground.babylonjs.com/#R1F8YU#29
   * @param other defines the second operand
   * @returns the current updated Vector3
   */
  minimizeInPlace(e) {
    return this.minimizeInPlaceFromFloats(e._x, e._y, e._z);
  }
  /**
   * Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.
   * Example Playground https://playground.babylonjs.com/#R1F8YU#27
   * @param other defines the second operand
   * @returns the current updated Vector3
   */
  maximizeInPlace(e) {
    return this.maximizeInPlaceFromFloats(e._x, e._y, e._z);
  }
  /**
   * Updates the current Vector3 with the minimal coordinate values between its and the given coordinates
   * Example Playground https://playground.babylonjs.com/#R1F8YU#30
   * @param x defines the x coordinate of the operand
   * @param y defines the y coordinate of the operand
   * @param z defines the z coordinate of the operand
   * @returns the current updated Vector3
   */
  minimizeInPlaceFromFloats(e, t, r) {
    return e < this._x && (this.x = e), t < this._y && (this.y = t), r < this._z && (this.z = r), this;
  }
  /**
   * Updates the current Vector3 with the maximal coordinate values between its and the given coordinates.
   * Example Playground https://playground.babylonjs.com/#R1F8YU#28
   * @param x defines the x coordinate of the operand
   * @param y defines the y coordinate of the operand
   * @param z defines the z coordinate of the operand
   * @returns the current updated Vector3
   */
  maximizeInPlaceFromFloats(e, t, r) {
    return e > this._x && (this.x = e), t > this._y && (this.y = t), r > this._z && (this.z = r), this;
  }
  /**
   * Due to float precision, scale of a mesh could be uniform but float values are off by a small fraction
   * Check if is non uniform within a certain amount of decimal places to account for this
   * @param epsilon the amount the values can differ
   * @returns if the vector is non uniform to a certain number of decimal places
   */
  isNonUniformWithinEpsilon(e) {
    const t = Math.abs(this._x), r = Math.abs(this._y);
    if (!Xt.WithinEpsilon(t, r, e))
      return !0;
    const n = Math.abs(this._z);
    return !Xt.WithinEpsilon(t, n, e) || !Xt.WithinEpsilon(r, n, e);
  }
  /**
   * Gets a boolean indicating that the vector is non uniform meaning x, y or z are not all the same
   */
  get isNonUniform() {
    const e = Math.abs(this._x), t = Math.abs(this._y);
    if (e !== t)
      return !0;
    const r = Math.abs(this._z);
    return e !== r;
  }
  /**
   * Gets a new Vector3 from current Vector3 floored values
   * Example Playground https://playground.babylonjs.com/#R1F8YU#22
   * @returns a new Vector3
   */
  floor() {
    return new this.constructor(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));
  }
  /**
   * Gets a new Vector3 from current Vector3 fractional values
   * Example Playground https://playground.babylonjs.com/#R1F8YU#23
   * @returns a new Vector3
   */
  fract() {
    return new this.constructor(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z));
  }
  // Properties
  /**
   * Gets the length of the Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#25
   * @returns the length of the Vector3
   */
  length() {
    return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z);
  }
  /**
   * Gets the squared length of the Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#26
   * @returns squared length of the Vector3
   */
  lengthSquared() {
    return this._x * this._x + this._y * this._y + this._z * this._z;
  }
  /**
   * Gets a boolean indicating if the vector contains a zero in one of its components
   * Example Playground https://playground.babylonjs.com/#R1F8YU#1
   */
  get hasAZeroComponent() {
    return this._x * this._y * this._z === 0;
  }
  /**
   * Normalize the current Vector3.
   * Please note that this is an in place operation.
   * Example Playground https://playground.babylonjs.com/#R1F8YU#122
   * @returns the current updated Vector3
   */
  normalize() {
    return this.normalizeFromLength(this.length());
  }
  /**
   * Reorders the x y z properties of the vector in place
   * Example Playground https://playground.babylonjs.com/#R1F8YU#44
   * @param order new ordering of the properties (eg. for vector 1,2,3 with "ZYX" will produce 3,2,1)
   * @returns the current updated vector
   */
  reorderInPlace(e) {
    if (e = e.toLowerCase(), e === "xyz")
      return this;
    const t = Kr.Vector3[0].copyFrom(this);
    return this.x = t[e[0]], this.y = t[e[1]], this.z = t[e[2]], this;
  }
  /**
   * Rotates the vector around 0,0,0 by a quaternion
   * Example Playground https://playground.babylonjs.com/#R1F8YU#47
   * @param quaternion the rotation quaternion
   * @param result vector to store the result
   * @returns the resulting vector
   */
  rotateByQuaternionToRef(e, t) {
    return e.toRotationMatrix(Kr.Matrix[0]), S.TransformCoordinatesToRef(this, Kr.Matrix[0], t), t;
  }
  /**
   * Rotates a vector around a given point
   * Example Playground https://playground.babylonjs.com/#R1F8YU#46
   * @param quaternion the rotation quaternion
   * @param point the point to rotate around
   * @param result vector to store the result
   * @returns the resulting vector
   */
  rotateByQuaternionAroundPointToRef(e, t, r) {
    return this.subtractToRef(t, Kr.Vector3[0]), Kr.Vector3[0].rotateByQuaternionToRef(e, Kr.Vector3[0]), t.addToRef(Kr.Vector3[0], r), r;
  }
  /**
   * Returns a new Vector3 as the cross product of the current vector and the "other" one
   * The cross product is then orthogonal to both current and "other"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#14
   * @param other defines the right operand
   * @returns the cross product
   */
  cross(e) {
    const t = new this.constructor();
    return S.CrossToRef(this, e, t);
  }
  /**
   * Normalize the current Vector3 with the given input length.
   * Please note that this is an in place operation.
   * Example Playground https://playground.babylonjs.com/#R1F8YU#123
   * @param len the length of the vector
   * @returns the current updated Vector3
   */
  normalizeFromLength(e) {
    return e === 0 || e === 1 ? this : this.scaleInPlace(1 / e);
  }
  /**
   * Normalize the current Vector3 to a new vector
   * Example Playground https://playground.babylonjs.com/#R1F8YU#124
   * @returns the new Vector3
   */
  normalizeToNew() {
    const e = new this.constructor(0, 0, 0);
    return this.normalizeToRef(e), e;
  }
  /**
   * Normalize the current Vector3 to the reference
   * Example Playground https://playground.babylonjs.com/#R1F8YU#125
   * @param reference define the Vector3 to update
   * @returns the updated Vector3
   */
  normalizeToRef(e) {
    const t = this.length();
    return t === 0 || t === 1 ? e.copyFromFloats(this._x, this._y, this._z) : this.scaleToRef(1 / t, e);
  }
  /**
   * Creates a new Vector3 copied from the current Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#11
   * @returns the new Vector3
   */
  clone() {
    return new this.constructor(this._x, this._y, this._z);
  }
  /**
   * Copies the given vector coordinates to the current Vector3 ones
   * Example Playground https://playground.babylonjs.com/#R1F8YU#12
   * @param source defines the source Vector3
   * @returns the current updated Vector3
   */
  copyFrom(e) {
    return this.copyFromFloats(e._x, e._y, e._z);
  }
  /**
   * Copies the given floats to the current Vector3 coordinates
   * Example Playground https://playground.babylonjs.com/#R1F8YU#13
   * @param x defines the x coordinate of the operand
   * @param y defines the y coordinate of the operand
   * @param z defines the z coordinate of the operand
   * @returns the current updated Vector3
   */
  copyFromFloats(e, t, r) {
    return this._x = e, this._y = t, this._z = r, this._isDirty = !0, this;
  }
  /**
   * Copies the given floats to the current Vector3 coordinates
   * Example Playground https://playground.babylonjs.com/#R1F8YU#58
   * @param x defines the x coordinate of the operand
   * @param y defines the y coordinate of the operand
   * @param z defines the z coordinate of the operand
   * @returns the current updated Vector3
   */
  set(e, t, r) {
    return this.copyFromFloats(e, t, r);
  }
  /**
   * Copies the given float to the current Vector3 coordinates
   * Example Playground https://playground.babylonjs.com/#R1F8YU#59
   * @param v defines the x, y and z coordinates of the operand
   * @returns the current updated Vector3
   */
  setAll(e) {
    return this._x = this._y = this._z = e, this._isDirty = !0, this;
  }
  // Statics
  /**
   * Get the clip factor between two vectors
   * Example Playground https://playground.babylonjs.com/#R1F8YU#126
   * @param vector0 defines the first operand
   * @param vector1 defines the second operand
   * @param axis defines the axis to use
   * @param size defines the size along the axis
   * @returns the clip factor
   */
  static GetClipFactor(e, t, r, n) {
    const i = S.Dot(e, r), s = S.Dot(t, r);
    return (i - n) / (i - s);
  }
  /**
   * Get angle between two vectors
   * Example Playground https://playground.babylonjs.com/#R1F8YU#86
   * @param vector0 the starting point
   * @param vector1 the ending point
   * @param normal direction of the normal
   * @returns the angle between vector0 and vector1
   */
  static GetAngleBetweenVectors(e, t, r) {
    const n = e.normalizeToRef(Kr.Vector3[1]), i = t.normalizeToRef(Kr.Vector3[2]);
    let s = S.Dot(n, i);
    s = Xt.Clamp(s, -1, 1);
    const a = Math.acos(s), f = Kr.Vector3[3];
    return S.CrossToRef(n, i, f), S.Dot(f, r) > 0 ? isNaN(a) ? 0 : a : isNaN(a) ? -Math.PI : -Math.acos(s);
  }
  /**
   * Get angle between two vectors projected on a plane
   * Example Playground https://playground.babylonjs.com/#R1F8YU#87
   * Expectation compute time: 0.01 ms (median) and 0.02 ms (percentile 95%)
   * @param vector0 angle between vector0 and vector1
   * @param vector1 angle between vector0 and vector1
   * @param normal Normal of the projection plane
   * @returns the angle in radians (float) between vector0 and vector1 projected on the plane with the specified normal
   */
  static GetAngleBetweenVectorsOnPlane(e, t, r) {
    Kr.Vector3[0].copyFrom(e);
    const n = Kr.Vector3[0];
    Kr.Vector3[1].copyFrom(t);
    const i = Kr.Vector3[1];
    Kr.Vector3[2].copyFrom(r);
    const s = Kr.Vector3[2], a = Kr.Vector3[3], f = Kr.Vector3[4];
    n.normalize(), i.normalize(), s.normalize(), S.CrossToRef(s, n, a), S.CrossToRef(a, s, f);
    const o = Math.atan2(S.Dot(i, a), S.Dot(i, f));
    return Xt.NormalizeRadians(o);
  }
  /**
   * Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point and stores it in the ref Vector3
   * Example PG https://playground.babylonjs.com/#R1F8YU#189
   * @param start the starting point
   * @param target the target point
   * @param ref the vector3 to store the result
   * @returns ref in the form (pitch, yaw, 0)
   */
  static PitchYawRollToMoveBetweenPointsToRef(e, t, r) {
    const n = ue.Vector3[0];
    return t.subtractToRef(e, n), r._y = Math.atan2(n.x, n.z) || 0, r._x = Math.atan2(Math.sqrt(n.x ** 2 + n.z ** 2), n.y) || 0, r._z = 0, r._isDirty = !0, r;
  }
  /**
   * Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point
   * Example PG https://playground.babylonjs.com/#R1F8YU#188
   * @param start the starting point
   * @param target the target point
   * @returns the rotation in the form (pitch, yaw, 0)
   */
  static PitchYawRollToMoveBetweenPoints(e, t) {
    const r = S.Zero();
    return S.PitchYawRollToMoveBetweenPointsToRef(e, t, r);
  }
  /**
   * Slerp between two vectors. See also `SmoothToRef`
   * Slerp is a spherical linear interpolation
   * giving a slow in and out effect
   * Example Playground 1 https://playground.babylonjs.com/#R1F8YU#108
   * Example Playground 2 https://playground.babylonjs.com/#R1F8YU#109
   * @param vector0 Start vector
   * @param vector1 End vector
   * @param slerp amount (will be clamped between 0 and 1)
   * @param result The slerped vector
   */
  static SlerpToRef(e, t, r, n) {
    r = Xt.Clamp(r, 0, 1);
    const i = Kr.Vector3[0], s = Kr.Vector3[1];
    i.copyFrom(e);
    const a = i.length();
    i.normalizeFromLength(a), s.copyFrom(t);
    const f = s.length();
    s.normalizeFromLength(f);
    const o = S.Dot(i, s);
    let d, v;
    if (o < 1 - Dn) {
      const u = Math.acos(o), l = 1 / Math.sin(u);
      d = Math.sin((1 - r) * u) * l, v = Math.sin(r * u) * l;
    } else
      d = 1 - r, v = r;
    return i.scaleInPlace(d), s.scaleInPlace(v), n.copyFrom(i).addInPlace(s), n.scaleInPlace(Xt.Lerp(a, f, r)), n;
  }
  /**
   * Smooth interpolation between two vectors using Slerp
   * Example Playground https://playground.babylonjs.com/#R1F8YU#110
   * @param source source vector
   * @param goal goal vector
   * @param deltaTime current interpolation frame
   * @param lerpTime total interpolation time
   * @param result the smoothed vector
   */
  static SmoothToRef(e, t, r, n, i) {
    return S.SlerpToRef(e, t, n === 0 ? 1 : r / n, i), i;
  }
  /**
   * Returns a new Vector3 set from the index "offset" of the given array
   * Example Playground https://playground.babylonjs.com/#R1F8YU#83
   * @param array defines the source array
   * @param offset defines the offset in the source array
   * @returns the new Vector3
   */
  static FromArray(e, t = 0) {
    return new S(e[t], e[t + 1], e[t + 2]);
  }
  /**
   * Returns a new Vector3 set from the index "offset" of the given Float32Array
   * @param array defines the source array
   * @param offset defines the offset in the source array
   * @returns the new Vector3
   * @deprecated Please use FromArray instead.
   */
  static FromFloatArray(e, t) {
    return S.FromArray(e, t);
  }
  /**
   * Sets the given vector "result" with the element values from the index "offset" of the given array
   * Example Playground https://playground.babylonjs.com/#R1F8YU#84
   * @param array defines the source array
   * @param offset defines the offset in the source array
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static FromArrayToRef(e, t, r) {
    return r._x = e[t], r._y = e[t + 1], r._z = e[t + 2], r._isDirty = !0, r;
  }
  /**
   * Sets the given vector "result" with the element values from the index "offset" of the given Float32Array
   * @param array defines the source array
   * @param offset defines the offset in the source array
   * @param result defines the Vector3 where to store the result
   * @deprecated Please use FromArrayToRef instead.
   */
  static FromFloatArrayToRef(e, t, r) {
    return S.FromArrayToRef(e, t, r);
  }
  /**
   * Sets the given vector "result" with the given floats.
   * Example Playground https://playground.babylonjs.com/#R1F8YU#85
   * @param x defines the x coordinate of the source
   * @param y defines the y coordinate of the source
   * @param z defines the z coordinate of the source
   * @param result defines the Vector3 where to store the result
   */
  static FromFloatsToRef(e, t, r, n) {
    return n.copyFromFloats(e, t, r), n;
  }
  /**
   * Returns a new Vector3 set to (0.0, 0.0, 0.0)
   * @returns a new empty Vector3
   */
  static Zero() {
    return new S(0, 0, 0);
  }
  /**
   * Returns a new Vector3 set to (1.0, 1.0, 1.0)
   * @returns a new Vector3
   */
  static One() {
    return new S(1, 1, 1);
  }
  /**
   * Returns a new Vector3 set to (0.0, 1.0, 0.0)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#71
   * @returns a new up Vector3
   */
  static Up() {
    return new S(0, 1, 0);
  }
  /**
   * Gets an up Vector3 that must not be updated
   */
  static get UpReadOnly() {
    return S._UpReadOnly;
  }
  /**
   * Gets a down Vector3 that must not be updated
   */
  static get DownReadOnly() {
    return S._DownReadOnly;
  }
  /**
   * Gets a right Vector3 that must not be updated
   */
  static get RightReadOnly() {
    return S._RightReadOnly;
  }
  /**
   * Gets a left Vector3 that must not be updated
   */
  static get LeftReadOnly() {
    return S._LeftReadOnly;
  }
  /**
   * Gets a forward Vector3 that must not be updated
   */
  static get LeftHandedForwardReadOnly() {
    return S._LeftHandedForwardReadOnly;
  }
  /**
   * Gets a forward Vector3 that must not be updated
   */
  static get RightHandedForwardReadOnly() {
    return S._RightHandedForwardReadOnly;
  }
  /**
   * Gets a backward Vector3 that must not be updated
   */
  static get LeftHandedBackwardReadOnly() {
    return S._LeftHandedBackwardReadOnly;
  }
  /**
   * Gets a backward Vector3 that must not be updated
   */
  static get RightHandedBackwardReadOnly() {
    return S._RightHandedBackwardReadOnly;
  }
  /**
   * Gets a zero Vector3 that must not be updated
   */
  static get ZeroReadOnly() {
    return S._ZeroReadOnly;
  }
  /**
   * Gets a one Vector3 that must not be updated
   */
  static get OneReadOnly() {
    return S._OneReadOnly;
  }
  /**
   * Returns a new Vector3 set to (0.0, -1.0, 0.0)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#71
   * @returns a new down Vector3
   */
  static Down() {
    return new S(0, -1, 0);
  }
  /**
   * Returns a new Vector3 set to (0.0, 0.0, 1.0)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#71
   * @param rightHandedSystem is the scene right-handed (negative z)
   * @returns a new forward Vector3
   */
  static Forward(e = !1) {
    return new S(0, 0, e ? -1 : 1);
  }
  /**
   * Returns a new Vector3 set to (0.0, 0.0, -1.0)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#71
   * @param rightHandedSystem is the scene right-handed (negative-z)
   * @returns a new Backward Vector3
   */
  static Backward(e = !1) {
    return new S(0, 0, e ? 1 : -1);
  }
  /**
   * Returns a new Vector3 set to (1.0, 0.0, 0.0)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#71
   * @returns a new right Vector3
   */
  static Right() {
    return new S(1, 0, 0);
  }
  /**
   * Returns a new Vector3 set to (-1.0, 0.0, 0.0)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#71
   * @returns a new left Vector3
   */
  static Left() {
    return new S(-1, 0, 0);
  }
  /**
   * Returns a new Vector3 with random values between min and max
   * @param min the minimum random value
   * @param max the maximum random value
   * @returns a Vector3 with random values between min and max
   */
  static Random(e = 0, t = 1) {
    return new S(Xt.RandomRange(e, t), Xt.RandomRange(e, t), Xt.RandomRange(e, t));
  }
  /**
   * Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector.
   * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#111
   * @param vector defines the Vector3 to transform
   * @param transformation defines the transformation matrix
   * @returns the transformed Vector3
   */
  static TransformCoordinates(e, t) {
    const r = S.Zero();
    return S.TransformCoordinatesToRef(e, t, r), r;
  }
  /**
   * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector
   * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#113
   * @param vector defines the Vector3 to transform
   * @param transformation defines the transformation matrix
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static TransformCoordinatesToRef(e, t, r) {
    return S.TransformCoordinatesFromFloatsToRef(e._x, e._y, e._z, t, r), r;
  }
  /**
   * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
   * This method computes transformed coordinates only, not transformed direction vectors
   * Example Playground https://playground.babylonjs.com/#R1F8YU#115
   * @param x define the x coordinate of the source vector
   * @param y define the y coordinate of the source vector
   * @param z define the z coordinate of the source vector
   * @param transformation defines the transformation matrix
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static TransformCoordinatesFromFloatsToRef(e, t, r, n, i) {
    const s = n.m, a = e * s[0] + t * s[4] + r * s[8] + s[12], f = e * s[1] + t * s[5] + r * s[9] + s[13], o = e * s[2] + t * s[6] + r * s[10] + s[14], d = 1 / (e * s[3] + t * s[7] + r * s[11] + s[15]);
    return i._x = a * d, i._y = f * d, i._z = o * d, i._isDirty = !0, i;
  }
  /**
   * Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector
   * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#112
   * @param vector defines the Vector3 to transform
   * @param transformation defines the transformation matrix
   * @returns the new Vector3
   */
  static TransformNormal(e, t) {
    const r = S.Zero();
    return S.TransformNormalToRef(e, t, r), r;
  }
  /**
   * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector
   * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#114
   * @param vector defines the Vector3 to transform
   * @param transformation defines the transformation matrix
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static TransformNormalToRef(e, t, r) {
    return this.TransformNormalFromFloatsToRef(e._x, e._y, e._z, t, r), r;
  }
  /**
   * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z)
   * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
   * Example Playground https://playground.babylonjs.com/#R1F8YU#116
   * @param x define the x coordinate of the source vector
   * @param y define the y coordinate of the source vector
   * @param z define the z coordinate of the source vector
   * @param transformation defines the transformation matrix
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static TransformNormalFromFloatsToRef(e, t, r, n, i) {
    const s = n.m;
    return i._x = e * s[0] + t * s[4] + r * s[8], i._y = e * s[1] + t * s[5] + r * s[9], i._z = e * s[2] + t * s[6] + r * s[10], i._isDirty = !0, i;
  }
  /**
   * Returns a new Vector3 located for "amount" on the CatmullRom interpolation spline defined by the vectors "value1", "value2", "value3", "value4"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#69
   * @param value1 defines the first control point
   * @param value2 defines the second control point
   * @param value3 defines the third control point
   * @param value4 defines the fourth control point
   * @param amount defines the amount on the spline to use
   * @returns the new Vector3
   */
  static CatmullRom(e, t, r, n, i) {
    const s = i * i, a = i * s, f = 0.5 * (2 * t._x + (-e._x + r._x) * i + (2 * e._x - 5 * t._x + 4 * r._x - n._x) * s + (-e._x + 3 * t._x - 3 * r._x + n._x) * a), o = 0.5 * (2 * t._y + (-e._y + r._y) * i + (2 * e._y - 5 * t._y + 4 * r._y - n._y) * s + (-e._y + 3 * t._y - 3 * r._y + n._y) * a), d = 0.5 * (2 * t._z + (-e._z + r._z) * i + (2 * e._z - 5 * t._z + 4 * r._z - n._z) * s + (-e._z + 3 * t._z - 3 * r._z + n._z) * a);
    return new e.constructor(f, o, d);
  }
  /**
   * Returns a new Vector3 set with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max"
   * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
   * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
   * Example Playground https://playground.babylonjs.com/#R1F8YU#76
   * @param value defines the current value
   * @param min defines the lower range value
   * @param max defines the upper range value
   * @returns the new Vector3
   */
  static Clamp(e, t, r) {
    const n = new e.constructor();
    return S.ClampToRef(e, t, r, n), n;
  }
  /**
   * Sets the given vector "result" with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max"
   * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
   * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
   * Example Playground https://playground.babylonjs.com/#R1F8YU#77
   * @param value defines the current value
   * @param min defines the lower range value
   * @param max defines the upper range value
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static ClampToRef(e, t, r, n) {
    let i = e._x;
    i = i > r._x ? r._x : i, i = i < t._x ? t._x : i;
    let s = e._y;
    s = s > r._y ? r._y : s, s = s < t._y ? t._y : s;
    let a = e._z;
    return a = a > r._z ? r._z : a, a = a < t._z ? t._z : a, n.copyFromFloats(i, s, a), n;
  }
  /**
   * Checks if a given vector is inside a specific range
   * Example Playground https://playground.babylonjs.com/#R1F8YU#75
   * @param v defines the vector to test
   * @param min defines the minimum range
   * @param max defines the maximum range
   */
  static CheckExtends(e, t, r) {
    t.minimizeInPlace(e), r.maximizeInPlace(e);
  }
  /**
   * Returns a new Vector3 located for "amount" (float) on the Hermite interpolation spline defined by the vectors "value1", "tangent1", "value2", "tangent2"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#89
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent vector
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent vector
   * @param amount defines the amount on the interpolation spline (between 0 and 1)
   * @returns the new Vector3
   */
  static Hermite(e, t, r, n, i) {
    const s = i * i, a = i * s, f = 2 * a - 3 * s + 1, o = -2 * a + 3 * s, d = a - 2 * s + i, v = a - s, u = e._x * f + r._x * o + t._x * d + n._x * v, l = e._y * f + r._y * o + t._y * d + n._y * v, P = e._z * f + r._z * o + t._z * d + n._z * v;
    return new e.constructor(u, l, P);
  }
  /**
   * Returns a new Vector3 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
   * Example Playground https://playground.babylonjs.com/#R1F8YU#90
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @returns 1st derivative
   */
  static Hermite1stDerivative(e, t, r, n, i) {
    const s = new e.constructor();
    return this.Hermite1stDerivativeToRef(e, t, r, n, i, s), s;
  }
  /**
   * Update a Vector3 with the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
   * Example Playground https://playground.babylonjs.com/#R1F8YU#91
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @param result define where to store the derivative
   * @returns result input
   */
  static Hermite1stDerivativeToRef(e, t, r, n, i, s) {
    const a = i * i;
    return s._x = (a - i) * 6 * e._x + (3 * a - 4 * i + 1) * t._x + (-a + i) * 6 * r._x + (3 * a - 2 * i) * n._x, s._y = (a - i) * 6 * e._y + (3 * a - 4 * i + 1) * t._y + (-a + i) * 6 * r._y + (3 * a - 2 * i) * n._y, s._z = (a - i) * 6 * e._z + (3 * a - 4 * i + 1) * t._z + (-a + i) * 6 * r._z + (3 * a - 2 * i) * n._z, s._isDirty = !0, s;
  }
  /**
   * Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#95
   * @param start defines the start value
   * @param end defines the end value
   * @param amount max defines amount between both (between 0 and 1)
   * @returns the new Vector3
   */
  static Lerp(e, t, r) {
    const n = new e.constructor(0, 0, 0);
    return S.LerpToRef(e, t, r, n), n;
  }
  /**
   * Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#93
   * @param start defines the start value
   * @param end defines the end value
   * @param amount max defines amount between both (between 0 and 1)
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static LerpToRef(e, t, r, n) {
    return n._x = e._x + (t._x - e._x) * r, n._y = e._y + (t._y - e._y) * r, n._z = e._z + (t._z - e._z) * r, n._isDirty = !0, n;
  }
  /**
   * Returns the dot product (float) between the vectors "left" and "right"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#82
   * @param left defines the left operand
   * @param right defines the right operand
   * @returns the dot product
   */
  static Dot(e, t) {
    return e._x * t._x + e._y * t._y + e._z * t._z;
  }
  /**
   * Returns the dot product (float) between the current vectors and "otherVector"
   * @param otherVector defines the right operand
   * @returns the dot product
   */
  dot(e) {
    return this._x * e._x + this._y * e._y + this._z * e._z;
  }
  /**
   * Returns a new Vector3 as the cross product of the vectors "left" and "right"
   * The cross product is then orthogonal to both "left" and "right"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#15
   * @param left defines the left operand
   * @param right defines the right operand
   * @returns the cross product
   */
  static Cross(e, t) {
    const r = new e.constructor();
    return S.CrossToRef(e, t, r), r;
  }
  /**
   * Sets the given vector "result" with the cross product of "left" and "right"
   * The cross product is then orthogonal to both "left" and "right"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#78
   * @param left defines the left operand
   * @param right defines the right operand
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static CrossToRef(e, t, r) {
    const n = e._y * t._z - e._z * t._y, i = e._z * t._x - e._x * t._z, s = e._x * t._y - e._y * t._x;
    return r.copyFromFloats(n, i, s), r;
  }
  /**
   * Returns a new Vector3 as the normalization of the given vector
   * Example Playground https://playground.babylonjs.com/#R1F8YU#98
   * @param vector defines the Vector3 to normalize
   * @returns the new Vector3
   */
  static Normalize(e) {
    const t = S.Zero();
    return S.NormalizeToRef(e, t), t;
  }
  /**
   * Sets the given vector "result" with the normalization of the given first vector
   * Example Playground https://playground.babylonjs.com/#R1F8YU#98
   * @param vector defines the Vector3 to normalize
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static NormalizeToRef(e, t) {
    return e.normalizeToRef(t), t;
  }
  /**
   * Project a Vector3 onto screen space
   * Example Playground https://playground.babylonjs.com/#R1F8YU#101
   * @param vector defines the Vector3 to project
   * @param world defines the world matrix to use
   * @param transform defines the transform (view x projection) matrix to use
   * @param viewport defines the screen viewport to use
   * @returns the new Vector3
   */
  static Project(e, t, r, n) {
    const i = new e.constructor();
    return S.ProjectToRef(e, t, r, n, i), i;
  }
  /**
   * Project a Vector3 onto screen space to reference
   * Example Playground https://playground.babylonjs.com/#R1F8YU#102
   * @param vector defines the Vector3 to project
   * @param world defines the world matrix to use
   * @param transform defines the transform (view x projection) matrix to use
   * @param viewport defines the screen viewport to use
   * @param result the vector in which the screen space will be stored
   * @returns result input
   */
  static ProjectToRef(e, t, r, n, i) {
    const s = n.width, a = n.height, f = n.x, o = n.y, d = Kr.Matrix[1];
    he.FromValuesToRef(s / 2, 0, 0, 0, 0, -a / 2, 0, 0, 0, 0, 0.5, 0, f + s / 2, a / 2 + o, 0.5, 1, d);
    const v = Kr.Matrix[0];
    return t.multiplyToRef(r, v), v.multiplyToRef(d, v), S.TransformCoordinatesToRef(e, v, i), i;
  }
  /**
   * Reflects a vector off the plane defined by a normalized normal
   * @param inDirection defines the vector direction
   * @param normal defines the normal - Must be normalized
   * @returns the resulting vector
   */
  static Reflect(e, t) {
    return this.ReflectToRef(e, t, new S());
  }
  /**
   * Reflects a vector off the plane defined by a normalized normal to reference
   * @param inDirection defines the vector direction
   * @param normal defines the normal - Must be normalized
   * @param result defines the Vector3 where to store the result
   * @returns the resulting vector
   */
  static ReflectToRef(e, t, r) {
    const n = ue.Vector3[0];
    return n.copyFrom(t).scaleInPlace(2 * S.Dot(e, t)), r.copyFrom(e).subtractInPlace(n);
  }
  /**
   * @internal
   */
  static _UnprojectFromInvertedMatrixToRef(e, t, r) {
    S.TransformCoordinatesToRef(e, t, r);
    const n = t.m, i = e._x * n[3] + e._y * n[7] + e._z * n[11] + n[15];
    return Xt.WithinEpsilon(i, 1) && r.scaleInPlace(1 / i), r;
  }
  /**
   * Unproject from screen space to object space
   * Example Playground https://playground.babylonjs.com/#R1F8YU#121
   * @param source defines the screen space Vector3 to use
   * @param viewportWidth defines the current width of the viewport
   * @param viewportHeight defines the current height of the viewport
   * @param world defines the world matrix to use (can be set to Identity to go to world space)
   * @param transform defines the transform (view x projection) matrix to use
   * @returns the new Vector3
   */
  static UnprojectFromTransform(e, t, r, n, i) {
    return this.Unproject(e, t, r, n, i, he.IdentityReadOnly);
  }
  /**
   * Unproject from screen space to object space
   * Example Playground https://playground.babylonjs.com/#R1F8YU#117
   * @param source defines the screen space Vector3 to use
   * @param viewportWidth defines the current width of the viewport
   * @param viewportHeight defines the current height of the viewport
   * @param world defines the world matrix to use (can be set to Identity to go to world space)
   * @param view defines the view matrix to use
   * @param projection defines the projection matrix to use
   * @returns the new Vector3
   */
  static Unproject(e, t, r, n, i, s) {
    const a = new e.constructor();
    return S.UnprojectToRef(e, t, r, n, i, s, a), a;
  }
  /**
   * Unproject from screen space to object space
   * Example Playground https://playground.babylonjs.com/#R1F8YU#119
   * @param source defines the screen space Vector3 to use
   * @param viewportWidth defines the current width of the viewport
   * @param viewportHeight defines the current height of the viewport
   * @param world defines the world matrix to use (can be set to Identity to go to world space)
   * @param view defines the view matrix to use
   * @param projection defines the projection matrix to use
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static UnprojectToRef(e, t, r, n, i, s, a) {
    return S.UnprojectFloatsToRef(e._x, e._y, e._z, t, r, n, i, s, a), a;
  }
  /**
   * Unproject from screen space to object space
   * Example Playground https://playground.babylonjs.com/#R1F8YU#120
   * @param sourceX defines the screen space x coordinate to use
   * @param sourceY defines the screen space y coordinate to use
   * @param sourceZ defines the screen space z coordinate to use
   * @param viewportWidth defines the current width of the viewport
   * @param viewportHeight defines the current height of the viewport
   * @param world defines the world matrix to use (can be set to Identity to go to world space)
   * @param view defines the view matrix to use
   * @param projection defines the projection matrix to use
   * @param result defines the Vector3 where to store the result
   * @returns result input
   */
  static UnprojectFloatsToRef(e, t, r, n, i, s, a, f, o) {
    var d;
    const v = Kr.Matrix[0];
    s.multiplyToRef(a, v), v.multiplyToRef(f, v), v.invert();
    const u = Kr.Vector3[0];
    return u.x = e / n * 2 - 1, u.y = -(t / i * 2 - 1), !((d = gr.LastCreatedEngine) === null || d === void 0) && d.isNDCHalfZRange ? u.z = r : u.z = 2 * r - 1, S._UnprojectFromInvertedMatrixToRef(u, v, o), o;
  }
  /**
   * Gets the minimal coordinate values between two Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#97
   * @param left defines the first operand
   * @param right defines the second operand
   * @returns the new Vector3
   */
  static Minimize(e, t) {
    const r = new e.constructor();
    return r.copyFrom(e), r.minimizeInPlace(t), r;
  }
  /**
   * Gets the maximal coordinate values between two Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#96
   * @param left defines the first operand
   * @param right defines the second operand
   * @returns the new Vector3
   */
  static Maximize(e, t) {
    const r = new e.constructor();
    return r.copyFrom(e), r.maximizeInPlace(t), r;
  }
  /**
   * Returns the distance between the vectors "value1" and "value2"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#81
   * @param value1 defines the first operand
   * @param value2 defines the second operand
   * @returns the distance
   */
  static Distance(e, t) {
    return Math.sqrt(S.DistanceSquared(e, t));
  }
  /**
   * Returns the squared distance between the vectors "value1" and "value2"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#80
   * @param value1 defines the first operand
   * @param value2 defines the second operand
   * @returns the squared distance
   */
  static DistanceSquared(e, t) {
    const r = e._x - t._x, n = e._y - t._y, i = e._z - t._z;
    return r * r + n * n + i * i;
  }
  /**
   * Projects "vector" on the triangle determined by its extremities "p0", "p1" and "p2", stores the result in "ref"
   * and returns the distance to the projected point.
   * Example Playground https://playground.babylonjs.com/#R1F8YU#104
   * From http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.104.4264&rep=rep1&type=pdf
   *
   * @param vector the vector to get distance from
   * @param p0 extremity of the triangle
   * @param p1 extremity of the triangle
   * @param p2 extremity of the triangle
   * @param ref variable to store the result to
   * @returns The distance between "ref" and "vector"
   */
  static ProjectOnTriangleToRef(e, t, r, n, i) {
    const s = Kr.Vector3[0], a = Kr.Vector3[1], f = Kr.Vector3[2], o = Kr.Vector3[3], d = Kr.Vector3[4];
    r.subtractToRef(t, s), n.subtractToRef(t, a), n.subtractToRef(r, f);
    const v = s.length(), u = a.length(), l = f.length();
    if (v < Dn || u < Dn || l < Dn)
      return i.copyFrom(t), S.Distance(e, t);
    e.subtractToRef(t, d), S.CrossToRef(s, a, o);
    const P = o.length();
    if (P < Dn)
      return i.copyFrom(t), S.Distance(e, t);
    o.normalizeFromLength(P);
    let p = d.length();
    if (p < Dn)
      return i.copyFrom(t), 0;
    d.normalizeFromLength(p);
    const c = S.Dot(o, d), H = Kr.Vector3[5], T = Kr.Vector3[6];
    H.copyFrom(o).scaleInPlace(-p * c), T.copyFrom(e).addInPlace(H);
    const q = Kr.Vector3[4], b = Kr.Vector3[5], j = Kr.Vector3[7], w = Kr.Vector3[8];
    q.copyFrom(s).scaleInPlace(1 / v), w.copyFrom(a).scaleInPlace(1 / u), q.addInPlace(w).scaleInPlace(-1), b.copyFrom(s).scaleInPlace(-1 / v), w.copyFrom(f).scaleInPlace(1 / l), b.addInPlace(w).scaleInPlace(-1), j.copyFrom(f).scaleInPlace(-1 / l), w.copyFrom(a).scaleInPlace(-1 / u), j.addInPlace(w).scaleInPlace(-1);
    const m = Kr.Vector3[9];
    let I;
    m.copyFrom(T).subtractInPlace(t), S.CrossToRef(q, m, w), I = S.Dot(w, o);
    const N = I;
    m.copyFrom(T).subtractInPlace(r), S.CrossToRef(b, m, w), I = S.Dot(w, o);
    const k = I;
    m.copyFrom(T).subtractInPlace(n), S.CrossToRef(j, m, w), I = S.Dot(w, o);
    const R = I, y = Kr.Vector3[10];
    let O, Y;
    N > 0 && k < 0 ? (y.copyFrom(s), O = t, Y = r) : k > 0 && R < 0 ? (y.copyFrom(f), O = r, Y = n) : (y.copyFrom(a).scaleInPlace(-1), O = n, Y = t);
    const ee = Kr.Vector3[9], Z = Kr.Vector3[4];
    if (O.subtractToRef(T, w), Y.subtractToRef(T, ee), S.CrossToRef(w, ee, Z), !(S.Dot(Z, o) < 0))
      return i.copyFrom(T), Math.abs(p * c);
    const fe = Kr.Vector3[5];
    S.CrossToRef(y, Z, fe), fe.normalize();
    const _ = Kr.Vector3[9];
    _.copyFrom(O).subtractInPlace(T);
    const G = _.length();
    if (G < Dn)
      return i.copyFrom(O), S.Distance(e, O);
    _.normalizeFromLength(G);
    const L = S.Dot(fe, _), $ = Kr.Vector3[7];
    $.copyFrom(T).addInPlace(fe.scaleInPlace(G * L)), w.copyFrom($).subtractInPlace(O), p = y.length(), y.normalizeFromLength(p);
    let ae = S.Dot(w, y) / Math.max(p, Dn);
    return ae = Xt.Clamp(ae, 0, 1), $.copyFrom(O).addInPlace(y.scaleInPlace(ae * p)), i.copyFrom($), S.Distance(e, $);
  }
  /**
   * Returns a new Vector3 located at the center between "value1" and "value2"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#72
   * @param value1 defines the first operand
   * @param value2 defines the second operand
   * @returns the new Vector3
   */
  static Center(e, t) {
    return S.CenterToRef(e, t, S.Zero());
  }
  /**
   * Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref"
   * Example Playground https://playground.babylonjs.com/#R1F8YU#73
   * @param value1 defines first vector
   * @param value2 defines second vector
   * @param ref defines third vector
   * @returns ref
   */
  static CenterToRef(e, t, r) {
    return r.copyFromFloats((e._x + t._x) / 2, (e._y + t._y) / 2, (e._z + t._z) / 2);
  }
  /**
   * Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system),
   * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply
   * to something in order to rotate it from its local system to the given target system
   * Note: axis1, axis2 and axis3 are normalized during this operation
   * Example Playground https://playground.babylonjs.com/#R1F8YU#106
   * @param axis1 defines the first axis
   * @param axis2 defines the second axis
   * @param axis3 defines the third axis
   * @returns a new Vector3
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/target_align
   */
  static RotationFromAxis(e, t, r) {
    const n = new e.constructor();
    return S.RotationFromAxisToRef(e, t, r, n), n;
  }
  /**
   * The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3
   * Example Playground https://playground.babylonjs.com/#R1F8YU#107
   * @param axis1 defines the first axis
   * @param axis2 defines the second axis
   * @param axis3 defines the third axis
   * @param ref defines the Vector3 where to store the result
   * @returns result input
   */
  static RotationFromAxisToRef(e, t, r, n) {
    const i = Kr.Quaternion[0];
    return Ze.RotationQuaternionFromAxisToRef(e, t, r, i), i.toEulerAnglesToRef(n), n;
  }
}
S._UpReadOnly = S.Up();
S._DownReadOnly = S.Down();
S._LeftHandedForwardReadOnly = S.Forward(!1);
S._RightHandedForwardReadOnly = S.Forward(!0);
S._LeftHandedBackwardReadOnly = S.Backward(!1);
S._RightHandedBackwardReadOnly = S.Backward(!0);
S._RightReadOnly = S.Right();
S._LeftReadOnly = S.Left();
S._ZeroReadOnly = S.Zero();
S._OneReadOnly = S.One();
class Ir {
  /**
   * Creates a Vector4 object from the given floats.
   * @param x x value of the vector
   * @param y y value of the vector
   * @param z z value of the vector
   * @param w w value of the vector
   */
  constructor(e = 0, t = 0, r = 0, n = 0) {
    this.x = e, this.y = t, this.z = r, this.w = n;
  }
  /**
   * Returns the string with the Vector4 coordinates.
   * @returns a string containing all the vector values
   */
  toString() {
    return `{X: ${this.x} Y: ${this.y} Z: ${this.z} W: ${this.w}}`;
  }
  /**
   * Returns the string "Vector4".
   * @returns "Vector4"
   */
  getClassName() {
    return "Vector4";
  }
  /**
   * Returns the Vector4 hash code.
   * @returns a unique hash code
   */
  getHashCode() {
    const e = Kl(this.x), t = Kl(this.y), r = Kl(this.z), n = Kl(this.w);
    let i = e;
    return i = i * 397 ^ t, i = i * 397 ^ r, i = i * 397 ^ n, i;
  }
  // Operators
  /**
   * Returns a new array populated with 4 elements : the Vector4 coordinates.
   * @returns the resulting array
   */
  asArray() {
    const e = [];
    return this.toArray(e, 0), e;
  }
  /**
   * Populates the given array from the given index with the Vector4 coordinates.
   * @param array array to populate
   * @param index index of the array to start at (default: 0)
   * @returns the Vector4.
   */
  toArray(e, t) {
    return t === void 0 && (t = 0), e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, this;
  }
  /**
   * Update the current vector from an array
   * @param array defines the destination array
   * @param index defines the offset in the destination array
   * @returns the current Vector3
   */
  fromArray(e, t = 0) {
    return Ir.FromArrayToRef(e, t, this), this;
  }
  /**
   * Adds the given vector to the current Vector4.
   * @param otherVector the vector to add
   * @returns the updated Vector4.
   */
  addInPlace(e) {
    return this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this;
  }
  /**
   * Returns a new Vector4 as the result of the addition of the current Vector4 and the given one.
   * @param otherVector the vector to add
   * @returns the resulting vector
   */
  add(e) {
    return new this.constructor(this.x + e.x, this.y + e.y, this.z + e.z, this.w + e.w);
  }
  /**
   * Updates the given vector "result" with the result of the addition of the current Vector4 and the given one.
   * @param otherVector the vector to add
   * @param result the vector to store the result
   * @returns result input
   */
  addToRef(e, t) {
    return t.x = this.x + e.x, t.y = this.y + e.y, t.z = this.z + e.z, t.w = this.w + e.w, t;
  }
  /**
   * Subtract in place the given vector from the current Vector4.
   * @param otherVector the vector to subtract
   * @returns the updated Vector4.
   */
  subtractInPlace(e) {
    return this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this;
  }
  /**
   * Returns a new Vector4 with the result of the subtraction of the given vector from the current Vector4.
   * @param otherVector the vector to add
   * @returns the new vector with the result
   */
  subtract(e) {
    return new this.constructor(this.x - e.x, this.y - e.y, this.z - e.z, this.w - e.w);
  }
  /**
   * Sets the given vector "result" with the result of the subtraction of the given vector from the current Vector4.
   * @param otherVector the vector to subtract
   * @param result the vector to store the result
   * @returns result input
   */
  subtractToRef(e, t) {
    return t.x = this.x - e.x, t.y = this.y - e.y, t.z = this.z - e.z, t.w = this.w - e.w, t;
  }
  /**
   * Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates.
   */
  /**
   * Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates.
   * @param x value to subtract
   * @param y value to subtract
   * @param z value to subtract
   * @param w value to subtract
   * @returns new vector containing the result
   */
  subtractFromFloats(e, t, r, n) {
    return new this.constructor(this.x - e, this.y - t, this.z - r, this.w - n);
  }
  /**
   * Sets the given vector "result" set with the result of the subtraction of the given floats from the current Vector4 coordinates.
   * @param x value to subtract
   * @param y value to subtract
   * @param z value to subtract
   * @param w value to subtract
   * @param result the vector to store the result in
   * @returns result input
   */
  subtractFromFloatsToRef(e, t, r, n, i) {
    return i.x = this.x - e, i.y = this.y - t, i.z = this.z - r, i.w = this.w - n, i;
  }
  /**
   * Returns a new Vector4 set with the current Vector4 negated coordinates.
   * @returns a new vector with the negated values
   */
  negate() {
    return new this.constructor(-this.x, -this.y, -this.z, -this.w);
  }
  /**
   * Negate this vector in place
   * @returns this
   */
  negateInPlace() {
    return this.x *= -1, this.y *= -1, this.z *= -1, this.w *= -1, this;
  }
  /**
   * Negate the current Vector4 and stores the result in the given vector "result" coordinates
   * @param result defines the Vector3 object where to store the result
   * @returns the result
   */
  negateToRef(e) {
    return e.copyFromFloats(this.x * -1, this.y * -1, this.z * -1, this.w * -1);
  }
  /**
   * Multiplies the current Vector4 coordinates by scale (float).
   * @param scale the number to scale with
   * @returns the updated Vector4.
   */
  scaleInPlace(e) {
    return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this;
  }
  /**
   * Returns a new Vector4 set with the current Vector4 coordinates multiplied by scale (float).
   * @param scale the number to scale with
   * @returns a new vector with the result
   */
  scale(e) {
    return new this.constructor(this.x * e, this.y * e, this.z * e, this.w * e);
  }
  /**
   * Sets the given vector "result" with the current Vector4 coordinates multiplied by scale (float).
   * @param scale the number to scale with
   * @param result a vector to store the result in
   * @returns result input
   */
  scaleToRef(e, t) {
    return t.x = this.x * e, t.y = this.y * e, t.z = this.z * e, t.w = this.w * e, t;
  }
  /**
   * Scale the current Vector4 values by a factor and add the result to a given Vector4
   * @param scale defines the scale factor
   * @param result defines the Vector4 object where to store the result
   * @returns result input
   */
  scaleAndAddToRef(e, t) {
    return t.x += this.x * e, t.y += this.y * e, t.z += this.z * e, t.w += this.w * e, t;
  }
  /**
   * Boolean : True if the current Vector4 coordinates are stricly equal to the given ones.
   * @param otherVector the vector to compare against
   * @returns true if they are equal
   */
  equals(e) {
    return e && this.x === e.x && this.y === e.y && this.z === e.z && this.w === e.w;
  }
  /**
   * Boolean : True if the current Vector4 coordinates are each beneath the distance "epsilon" from the given vector ones.
   * @param otherVector vector to compare against
   * @param epsilon (Default: very small number)
   * @returns true if they are equal
   */
  equalsWithEpsilon(e, t = Dn) {
    return e && Xt.WithinEpsilon(this.x, e.x, t) && Xt.WithinEpsilon(this.y, e.y, t) && Xt.WithinEpsilon(this.z, e.z, t) && Xt.WithinEpsilon(this.w, e.w, t);
  }
  /**
   * Boolean : True if the given floats are strictly equal to the current Vector4 coordinates.
   * @param x x value to compare against
   * @param y y value to compare against
   * @param z z value to compare against
   * @param w w value to compare against
   * @returns true if equal
   */
  equalsToFloats(e, t, r, n) {
    return this.x === e && this.y === t && this.z === r && this.w === n;
  }
  /**
   * Multiplies in place the current Vector4 by the given one.
   * @param otherVector vector to multiple with
   * @returns the updated Vector4.
   */
  multiplyInPlace(e) {
    return this.x *= e.x, this.y *= e.y, this.z *= e.z, this.w *= e.w, this;
  }
  /**
   * Returns a new Vector4 set with the multiplication result of the current Vector4 and the given one.
   * @param otherVector vector to multiple with
   * @returns resulting new vector
   */
  multiply(e) {
    return new this.constructor(this.x * e.x, this.y * e.y, this.z * e.z, this.w * e.w);
  }
  /**
   * Updates the given vector "result" with the multiplication result of the current Vector4 and the given one.
   * @param otherVector vector to multiple with
   * @param result vector to store the result
   * @returns result input
   */
  multiplyToRef(e, t) {
    return t.x = this.x * e.x, t.y = this.y * e.y, t.z = this.z * e.z, t.w = this.w * e.w, t;
  }
  /**
   * Returns a new Vector4 set with the multiplication result of the given floats and the current Vector4 coordinates.
   * @param x x value multiply with
   * @param y y value multiply with
   * @param z z value multiply with
   * @param w w value multiply with
   * @returns resulting new vector
   */
  multiplyByFloats(e, t, r, n) {
    return new this.constructor(this.x * e, this.y * t, this.z * r, this.w * n);
  }
  /**
   * Returns a new Vector4 set with the division result of the current Vector4 by the given one.
   * @param otherVector vector to devide with
   * @returns resulting new vector
   */
  divide(e) {
    return new this.constructor(this.x / e.x, this.y / e.y, this.z / e.z, this.w / e.w);
  }
  /**
   * Updates the given vector "result" with the division result of the current Vector4 by the given one.
   * @param otherVector vector to devide with
   * @param result vector to store the result
   * @returns result input
   */
  divideToRef(e, t) {
    return t.x = this.x / e.x, t.y = this.y / e.y, t.z = this.z / e.z, t.w = this.w / e.w, t;
  }
  /**
   * Divides the current Vector3 coordinates by the given ones.
   * @param otherVector vector to devide with
   * @returns the updated Vector3.
   */
  divideInPlace(e) {
    return this.divideToRef(e, this);
  }
  /**
   * Updates the Vector4 coordinates with the minimum values between its own and the given vector ones
   * @param other defines the second operand
   * @returns the current updated Vector4
   */
  minimizeInPlace(e) {
    return e.x < this.x && (this.x = e.x), e.y < this.y && (this.y = e.y), e.z < this.z && (this.z = e.z), e.w < this.w && (this.w = e.w), this;
  }
  /**
   * Updates the Vector4 coordinates with the maximum values between its own and the given vector ones
   * @param other defines the second operand
   * @returns the current updated Vector4
   */
  maximizeInPlace(e) {
    return e.x > this.x && (this.x = e.x), e.y > this.y && (this.y = e.y), e.z > this.z && (this.z = e.z), e.w > this.w && (this.w = e.w), this;
  }
  /**
   * Gets a new Vector4 from current Vector4 floored values
   * @returns a new Vector4
   */
  floor() {
    return new this.constructor(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w));
  }
  /**
   * Gets a new Vector4 from current Vector4 fractional values
   * @returns a new Vector4
   */
  fract() {
    return new this.constructor(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z), this.w - Math.floor(this.w));
  }
  // Properties
  /**
   * Returns the Vector4 length (float).
   * @returns the length
   */
  length() {
    return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
  }
  /**
   * Returns the Vector4 squared length (float).
   * @returns the length squared
   */
  lengthSquared() {
    return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
  }
  // Methods
  /**
   * Normalizes in place the Vector4.
   * @returns the updated Vector4.
   */
  normalize() {
    return this.normalizeFromLength(this.length());
  }
  /**
   * Normalize the current Vector4 with the given input length.
   * Please note that this is an in place operation.
   * @param len the length of the vector
   * @returns the current updated Vector4
   */
  normalizeFromLength(e) {
    return e === 0 || e === 1 ? this : this.scaleInPlace(1 / e);
  }
  /**
   * Normalize the current Vector4 to a new vector
   * @returns the new Vector4
   */
  normalizeToNew() {
    const e = new this.constructor(0, 0, 0, 0);
    return this.normalizeToRef(e), e;
  }
  /**
   * Normalize the current Vector4 to the reference
   * @param reference define the Vector4 to update
   * @returns the updated Vector4
   */
  normalizeToRef(e) {
    const t = this.length();
    return t === 0 || t === 1 ? e.copyFromFloats(this.x, this.y, this.z, this.w) : this.scaleToRef(1 / t, e);
  }
  /**
   * Returns a new Vector3 from the Vector4 (x, y, z) coordinates.
   * @returns this converted to a new vector3
   */
  toVector3() {
    return new S(this.x, this.y, this.z);
  }
  /**
   * Returns a new Vector4 copied from the current one.
   * @returns the new cloned vector
   */
  clone() {
    return new this.constructor(this.x, this.y, this.z, this.w);
  }
  /**
   * Updates the current Vector4 with the given one coordinates.
   * @param source the source vector to copy from
   * @returns the updated Vector4.
   */
  copyFrom(e) {
    return this.x = e.x, this.y = e.y, this.z = e.z, this.w = e.w, this;
  }
  /**
   * Updates the current Vector4 coordinates with the given floats.
   * @param x float to copy from
   * @param y float to copy from
   * @param z float to copy from
   * @param w float to copy from
   * @returns the updated Vector4.
   */
  copyFromFloats(e, t, r, n) {
    return this.x = e, this.y = t, this.z = r, this.w = n, this;
  }
  /**
   * Updates the current Vector4 coordinates with the given floats.
   * @param x float to set from
   * @param y float to set from
   * @param z float to set from
   * @param w float to set from
   * @returns the updated Vector4.
   */
  set(e, t, r, n) {
    return this.copyFromFloats(e, t, r, n);
  }
  /**
   * Copies the given float to the current Vector3 coordinates
   * @param v defines the x, y, z and w coordinates of the operand
   * @returns the current updated Vector3
   */
  setAll(e) {
    return this.x = this.y = this.z = this.w = e, this;
  }
  /**
   * Returns the dot product (float) between the current vectors and "otherVector"
   * @param otherVector defines the right operand
   * @returns the dot product
   */
  dot(e) {
    return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w;
  }
  // Statics
  /**
   * Returns a new Vector4 set from the starting index of the given array.
   * @param array the array to pull values from
   * @param offset the offset into the array to start at
   * @returns the new vector
   */
  static FromArray(e, t) {
    return t || (t = 0), new Ir(e[t], e[t + 1], e[t + 2], e[t + 3]);
  }
  /**
   * Updates the given vector "result" from the starting index of the given array.
   * @param array the array to pull values from
   * @param offset the offset into the array to start at
   * @param result the vector to store the result in
   * @returns result input
   */
  static FromArrayToRef(e, t, r) {
    return r.x = e[t], r.y = e[t + 1], r.z = e[t + 2], r.w = e[t + 3], r;
  }
  /**
   * Updates the given vector "result" from the starting index of the given Float32Array.
   * @param array the array to pull values from
   * @param offset the offset into the array to start at
   * @param result the vector to store the result in
   * @returns result input
   */
  static FromFloatArrayToRef(e, t, r) {
    return Ir.FromArrayToRef(e, t, r), r;
  }
  /**
   * Updates the given vector "result" coordinates from the given floats.
   * @param x float to set from
   * @param y float to set from
   * @param z float to set from
   * @param w float to set from
   * @param result the vector to the floats in
   * @returns result input
   */
  static FromFloatsToRef(e, t, r, n, i) {
    return i.x = e, i.y = t, i.z = r, i.w = n, i;
  }
  /**
   * Returns a new Vector4 set to (0.0, 0.0, 0.0, 0.0)
   * @returns the new vector
   */
  static Zero() {
    return new Ir(0, 0, 0, 0);
  }
  /**
   * Returns a new Vector4 set to (1.0, 1.0, 1.0, 1.0)
   * @returns the new vector
   */
  static One() {
    return new Ir(1, 1, 1, 1);
  }
  /**
   * Returns a new Vector4 with random values between min and max
   * @param min the minimum random value
   * @param max the maximum random value
   * @returns a Vector4 with random values between min and max
   */
  static Random(e = 0, t = 1) {
    return new Ir(Xt.RandomRange(e, t), Xt.RandomRange(e, t), Xt.RandomRange(e, t), Xt.RandomRange(e, t));
  }
  /**
   * Gets a zero Vector4 that must not be updated
   */
  static get ZeroReadOnly() {
    return Ir._ZeroReadOnly;
  }
  /**
   * Returns a new normalized Vector4 from the given one.
   * @param vector the vector to normalize
   * @returns the vector
   */
  static Normalize(e) {
    const t = Ir.Zero();
    return Ir.NormalizeToRef(e, t), t;
  }
  /**
   * Updates the given vector "result" from the normalization of the given one.
   * @param vector the vector to normalize
   * @param result the vector to store the result in
   * @returns result input
   */
  static NormalizeToRef(e, t) {
    return e.normalizeToRef(t), t;
  }
  /**
   * Returns a vector with the minimum values from the left and right vectors
   * @param left left vector to minimize
   * @param right right vector to minimize
   * @returns a new vector with the minimum of the left and right vector values
   */
  static Minimize(e, t) {
    const r = new e.constructor();
    return r.copyFrom(e), r.minimizeInPlace(t), r;
  }
  /**
   * Returns a vector with the maximum values from the left and right vectors
   * @param left left vector to maximize
   * @param right right vector to maximize
   * @returns a new vector with the maximum of the left and right vector values
   */
  static Maximize(e, t) {
    const r = new e.constructor();
    return r.copyFrom(e), r.maximizeInPlace(t), r;
  }
  /**
   * Returns the distance (float) between the vectors "value1" and "value2".
   * @param value1 value to calulate the distance between
   * @param value2 value to calulate the distance between
   * @returns the distance between the two vectors
   */
  static Distance(e, t) {
    return Math.sqrt(Ir.DistanceSquared(e, t));
  }
  /**
   * Returns the squared distance (float) between the vectors "value1" and "value2".
   * @param value1 value to calulate the distance between
   * @param value2 value to calulate the distance between
   * @returns the distance between the two vectors squared
   */
  static DistanceSquared(e, t) {
    const r = e.x - t.x, n = e.y - t.y, i = e.z - t.z, s = e.w - t.w;
    return r * r + n * n + i * i + s * s;
  }
  /**
   * Returns a new Vector4 located at the center between the vectors "value1" and "value2".
   * @param value1 value to calulate the center between
   * @param value2 value to calulate the center between
   * @returns the center between the two vectors
   */
  static Center(e, t) {
    return Ir.CenterToRef(e, t, Ir.Zero());
  }
  /**
   * Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref"
   * @param value1 defines first vector
   * @param value2 defines second vector
   * @param ref defines third vector
   * @returns ref
   */
  static CenterToRef(e, t, r) {
    return r.copyFromFloats((e.x + t.x) / 2, (e.y + t.y) / 2, (e.z + t.z) / 2, (e.w + t.w) / 2);
  }
  /**
   * Returns a new Vector4 set with the result of the transformation by the given matrix of the given vector.
   * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
   * The difference with Vector3.TransformCoordinates is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead
   * @param vector defines the Vector3 to transform
   * @param transformation defines the transformation matrix
   * @returns the transformed Vector4
   */
  static TransformCoordinates(e, t) {
    const r = Ir.Zero();
    return Ir.TransformCoordinatesToRef(e, t, r), r;
  }
  /**
   * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector
   * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
   * The difference with Vector3.TransformCoordinatesToRef is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead
   * @param vector defines the Vector3 to transform
   * @param transformation defines the transformation matrix
   * @param result defines the Vector4 where to store the result
   * @returns result input
   */
  static TransformCoordinatesToRef(e, t, r) {
    return Ir.TransformCoordinatesFromFloatsToRef(e._x, e._y, e._z, t, r), r;
  }
  /**
   * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
   * This method computes tranformed coordinates only, not transformed direction vectors
   * The difference with Vector3.TransformCoordinatesFromFloatsToRef is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead
   * @param x define the x coordinate of the source vector
   * @param y define the y coordinate of the source vector
   * @param z define the z coordinate of the source vector
   * @param transformation defines the transformation matrix
   * @param result defines the Vector4 where to store the result
   * @returns result input
   */
  static TransformCoordinatesFromFloatsToRef(e, t, r, n, i) {
    const s = n.m, a = e * s[0] + t * s[4] + r * s[8] + s[12], f = e * s[1] + t * s[5] + r * s[9] + s[13], o = e * s[2] + t * s[6] + r * s[10] + s[14], d = e * s[3] + t * s[7] + r * s[11] + s[15];
    return i.x = a, i.y = f, i.z = o, i.w = d, i;
  }
  /**
   * Returns a new Vector4 set with the result of the normal transformation by the given matrix of the given vector.
   * This methods computes transformed normalized direction vectors only.
   * @param vector the vector to transform
   * @param transformation the transformation matrix to apply
   * @returns the new vector
   */
  static TransformNormal(e, t) {
    const r = new e.constructor();
    return Ir.TransformNormalToRef(e, t, r), r;
  }
  /**
   * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector.
   * This methods computes transformed normalized direction vectors only.
   * @param vector the vector to transform
   * @param transformation the transformation matrix to apply
   * @param result the vector to store the result in
   * @returns result input
   */
  static TransformNormalToRef(e, t, r) {
    const n = t.m, i = e.x * n[0] + e.y * n[4] + e.z * n[8], s = e.x * n[1] + e.y * n[5] + e.z * n[9], a = e.x * n[2] + e.y * n[6] + e.z * n[10];
    return r.x = i, r.y = s, r.z = a, r.w = e.w, r;
  }
  /**
   * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z, w).
   * This methods computes transformed normalized direction vectors only.
   * @param x value to transform
   * @param y value to transform
   * @param z value to transform
   * @param w value to transform
   * @param transformation the transformation matrix to apply
   * @param result the vector to store the results in
   * @returns result input
   */
  static TransformNormalFromFloatsToRef(e, t, r, n, i, s) {
    const a = i.m;
    return s.x = e * a[0] + t * a[4] + r * a[8], s.y = e * a[1] + t * a[5] + r * a[9], s.z = e * a[2] + t * a[6] + r * a[10], s.w = n, s;
  }
  /**
   * Creates a new Vector4 from a Vector3
   * @param source defines the source data
   * @param w defines the 4th component (default is 0)
   * @returns a new Vector4
   */
  static FromVector3(e, t = 0) {
    return new Ir(e._x, e._y, e._z, t);
  }
  /**
   * Returns the dot product (float) between the vectors "left" and "right"
   * @param left defines the left operand
   * @param right defines the right operand
   * @returns the dot product
   */
  static Dot(e, t) {
    return e.dot(t);
  }
}
Ir._ZeroReadOnly = Ir.Zero();
class Ze {
  /** Gets or sets the x coordinate */
  get x() {
    return this._x;
  }
  set x(e) {
    this._x = e, this._isDirty = !0;
  }
  /** Gets or sets the y coordinate */
  get y() {
    return this._y;
  }
  set y(e) {
    this._y = e, this._isDirty = !0;
  }
  /** Gets or sets the z coordinate */
  get z() {
    return this._z;
  }
  set z(e) {
    this._z = e, this._isDirty = !0;
  }
  /** Gets or sets the w coordinate */
  get w() {
    return this._w;
  }
  set w(e) {
    this._w = e, this._isDirty = !0;
  }
  /**
   * Creates a new Quaternion from the given floats
   * @param x defines the first component (0 by default)
   * @param y defines the second component (0 by default)
   * @param z defines the third component (0 by default)
   * @param w defines the fourth component (1.0 by default)
   */
  constructor(e = 0, t = 0, r = 0, n = 1) {
    this._isDirty = !0, this._x = e, this._y = t, this._z = r, this._w = n;
  }
  /**
   * Gets a string representation for the current quaternion
   * @returns a string with the Quaternion coordinates
   */
  toString() {
    return `{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`;
  }
  /**
   * Gets the class name of the quaternion
   * @returns the string "Quaternion"
   */
  getClassName() {
    return "Quaternion";
  }
  /**
   * Gets a hash code for this quaternion
   * @returns the quaternion hash code
   */
  getHashCode() {
    const e = Kl(this._x), t = Kl(this._y), r = Kl(this._z), n = Kl(this._w);
    let i = e;
    return i = i * 397 ^ t, i = i * 397 ^ r, i = i * 397 ^ n, i;
  }
  /**
   * Copy the quaternion to an array
   * Example Playground https://playground.babylonjs.com/#L49EJ7#13
   * @returns a new array populated with 4 elements from the quaternion coordinates
   */
  asArray() {
    return [this._x, this._y, this._z, this._w];
  }
  /**
   * Stores from the starting index in the given array the Quaternion successive values
   * Example Playground https://playground.babylonjs.com/#L49EJ7#59
   * @param array defines the array where to store the x,y,z,w components
   * @param index defines an optional index in the target array to define where to start storing values
   * @returns the current Quaternion object
   */
  toArray(e, t = 0) {
    return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._w, this;
  }
  /**
   * Check if two quaternions are equals
   * Example Playground https://playground.babylonjs.com/#L49EJ7#38
   * @param otherQuaternion defines the second operand
   * @returns true if the current quaternion and the given one coordinates are strictly equals
   */
  equals(e) {
    return e && this._x === e._x && this._y === e._y && this._z === e._z && this._w === e._w;
  }
  /**
   * Gets a boolean if two quaternions are equals (using an epsilon value)
   * Example Playground https://playground.babylonjs.com/#L49EJ7#37
   * @param otherQuaternion defines the other quaternion
   * @param epsilon defines the minimal distance to consider equality
   * @returns true if the given quaternion coordinates are close to the current ones by a distance of epsilon.
   */
  equalsWithEpsilon(e, t = Dn) {
    return e && Xt.WithinEpsilon(this._x, e._x, t) && Xt.WithinEpsilon(this._y, e._y, t) && Xt.WithinEpsilon(this._z, e._z, t) && Xt.WithinEpsilon(this._w, e._w, t);
  }
  /**
   * Clone the current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#12
   * @returns a new quaternion copied from the current one
   */
  clone() {
    return new this.constructor(this._x, this._y, this._z, this._w);
  }
  /**
   * Copy a quaternion to the current one
   * Example Playground https://playground.babylonjs.com/#L49EJ7#86
   * @param other defines the other quaternion
   * @returns the updated current quaternion
   */
  copyFrom(e) {
    return this._x = e._x, this._y = e._y, this._z = e._z, this._w = e._w, this._isDirty = !0, this;
  }
  /**
   * Updates the current quaternion with the given float coordinates
   * Example Playground https://playground.babylonjs.com/#L49EJ7#87
   * @param x defines the x coordinate
   * @param y defines the y coordinate
   * @param z defines the z coordinate
   * @param w defines the w coordinate
   * @returns the updated current quaternion
   */
  copyFromFloats(e, t, r, n) {
    return this._x = e, this._y = t, this._z = r, this._w = n, this._isDirty = !0, this;
  }
  /**
   * Updates the current quaternion from the given float coordinates
   * Example Playground https://playground.babylonjs.com/#L49EJ7#56
   * @param x defines the x coordinate
   * @param y defines the y coordinate
   * @param z defines the z coordinate
   * @param w defines the w coordinate
   * @returns the updated current quaternion
   */
  set(e, t, r, n) {
    return this.copyFromFloats(e, t, r, n);
  }
  /**
   * Adds two quaternions
   * Example Playground https://playground.babylonjs.com/#L49EJ7#10
   * @param other defines the second operand
   * @returns a new quaternion as the addition result of the given one and the current quaternion
   */
  add(e) {
    return new this.constructor(this._x + e._x, this._y + e._y, this._z + e._z, this._w + e._w);
  }
  /**
   * Add a quaternion to the current one
   * Example Playground https://playground.babylonjs.com/#L49EJ7#11
   * @param other defines the quaternion to add
   * @returns the current quaternion
   */
  addInPlace(e) {
    return this._x += e._x, this._y += e._y, this._z += e._z, this._w += e._w, this._isDirty = !0, this;
  }
  /**
   * Subtract two quaternions
   * Example Playground https://playground.babylonjs.com/#L49EJ7#57
   * @param other defines the second operand
   * @returns a new quaternion as the subtraction result of the given one from the current one
   */
  subtract(e) {
    return new this.constructor(this._x - e._x, this._y - e._y, this._z - e._z, this._w - e._w);
  }
  /**
   * Subtract a quaternion to the current one
   * Example Playground https://playground.babylonjs.com/#L49EJ7#58
   * @param other defines the quaternion to subtract
   * @returns the current quaternion
   */
  subtractInPlace(e) {
    return this._x -= e._x, this._y -= e._y, this._z -= e._z, this._w -= e._w, this._isDirty = !0, this;
  }
  /**
   * Multiplies the current quaternion by a scale factor
   * Example Playground https://playground.babylonjs.com/#L49EJ7#88
   * @param value defines the scale factor
   * @returns a new quaternion set by multiplying the current quaternion coordinates by the float "scale"
   */
  scale(e) {
    return new this.constructor(this._x * e, this._y * e, this._z * e, this._w * e);
  }
  /**
   * Scale the current quaternion values by a factor and stores the result to a given quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#89
   * @param scale defines the scale factor
   * @param result defines the Quaternion object where to store the result
   * @returns result input
   */
  scaleToRef(e, t) {
    return t._x = this._x * e, t._y = this._y * e, t._z = this._z * e, t._w = this._w * e, t._isDirty = !0, t;
  }
  /**
   * Multiplies in place the current quaternion by a scale factor
   * Example Playground https://playground.babylonjs.com/#L49EJ7#90
   * @param value defines the scale factor
   * @returns the current modified quaternion
   */
  scaleInPlace(e) {
    return this._x *= e, this._y *= e, this._z *= e, this._w *= e, this._isDirty = !0, this;
  }
  /**
   * Scale the current quaternion values by a factor and add the result to a given quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#91
   * @param scale defines the scale factor
   * @param result defines the Quaternion object where to store the result
   * @returns result input
   */
  scaleAndAddToRef(e, t) {
    return t._x += this._x * e, t._y += this._y * e, t._z += this._z * e, t._w += this._w * e, t._isDirty = !0, t;
  }
  /**
   * Multiplies two quaternions
   * Example Playground https://playground.babylonjs.com/#L49EJ7#43
   * @param q1 defines the second operand
   * @returns a new quaternion set as the multiplication result of the current one with the given one "q1"
   */
  multiply(e) {
    const t = new this.constructor(0, 0, 0, 1);
    return this.multiplyToRef(e, t), t;
  }
  /**
   * Sets the given "result" as the multiplication result of the current one with the given one "q1"
   * Example Playground https://playground.babylonjs.com/#L49EJ7#45
   * @param q1 defines the second operand
   * @param result defines the target quaternion
   * @returns the current quaternion
   */
  multiplyToRef(e, t) {
    const r = this._x * e._w + this._y * e._z - this._z * e._y + this._w * e._x, n = -this._x * e._z + this._y * e._w + this._z * e._x + this._w * e._y, i = this._x * e._y - this._y * e._x + this._z * e._w + this._w * e._z, s = -this._x * e._x - this._y * e._y - this._z * e._z + this._w * e._w;
    return t.copyFromFloats(r, n, i, s), t;
  }
  /**
   * Updates the current quaternion with the multiplication of itself with the given one "q1"
   * Example Playground https://playground.babylonjs.com/#L49EJ7#46
   * @param q1 defines the second operand
   * @returns the currentupdated quaternion
   */
  multiplyInPlace(e) {
    return this.multiplyToRef(e, this), this;
  }
  /**
   * Conjugates the current quaternion and stores the result in the given quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#81
   * @param ref defines the target quaternion
   * @returns result input
   */
  conjugateToRef(e) {
    return e.copyFromFloats(-this._x, -this._y, -this._z, this._w), e;
  }
  /**
   * Conjugates in place the current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#82
   * @returns the current updated quaternion
   */
  conjugateInPlace() {
    return this._x *= -1, this._y *= -1, this._z *= -1, this._isDirty = !0, this;
  }
  /**
   * Conjugates (1-q) the current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#83
   * @returns a new quaternion
   */
  conjugate() {
    return new this.constructor(-this._x, -this._y, -this._z, this._w);
  }
  /**
   * Returns the inverse of the current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#84
   * @returns a new quaternion
   */
  invert() {
    const e = this.conjugate(), t = this.lengthSquared();
    return t == 0 || t == 1 || e.scaleInPlace(1 / t), e;
  }
  /**
   * Invert in place the current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#85
   * @returns this quaternion
   */
  invertInPlace() {
    this.conjugateInPlace();
    const e = this.lengthSquared();
    return e == 0 || e == 1 ? this : (this.scaleInPlace(1 / e), this);
  }
  /**
   * Gets squared length of current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#29
   * @returns the quaternion length (float)
   */
  lengthSquared() {
    return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
  }
  /**
   * Gets length of current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#28
   * @returns the quaternion length (float)
   */
  length() {
    return Math.sqrt(this.lengthSquared());
  }
  /**
   * Normalize in place the current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#54
   * @returns the current updated quaternion
   */
  normalize() {
    return this.normalizeFromLength(this.length());
  }
  /**
   * Normalize the current quaternion with the given input length.
   * Please note that this is an in place operation.
   * @param len the length of the quaternion
   * @returns the current updated Quaternion
   */
  normalizeFromLength(e) {
    return e === 0 || e === 1 ? this : this.scaleInPlace(1 / e);
  }
  /**
   * Normalize a copy of the current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#55
   * @returns the normalized quaternion
   */
  normalizeToNew() {
    const e = new this.constructor(0, 0, 0, 1);
    return this.normalizeToRef(e), e;
  }
  /**
   * Normalize the current Quaternion to the reference
   * @param reference define the Quaternion to update
   * @returns the updated Quaternion
   */
  normalizeToRef(e) {
    const t = this.length();
    return t === 0 || t === 1 ? e.copyFromFloats(this._x, this._y, this._z, this._w) : this.scaleToRef(1 / t, e);
  }
  /**
   * Returns a new Vector3 set with the Euler angles translated from the current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#32
   * @returns a new Vector3 containing the Euler angles
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions
   */
  toEulerAngles() {
    const e = S.Zero();
    return this.toEulerAnglesToRef(e), e;
  }
  /**
   * Sets the given vector3 "result" with the Euler angles translated from the current quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#31
   * @param result defines the vector which will be filled with the Euler angles
   * @returns result input
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions
   */
  toEulerAnglesToRef(e) {
    const t = this._z, r = this._x, n = this._y, i = this._w, s = n * t - r * i, a = 0.4999999;
    if (s < -a)
      e._y = 2 * Math.atan2(n, i), e._x = Math.PI / 2, e._z = 0, e._isDirty = !0;
    else if (s > a)
      e._y = 2 * Math.atan2(n, i), e._x = -Math.PI / 2, e._z = 0, e._isDirty = !0;
    else {
      const f = i * i, o = t * t, d = r * r, v = n * n;
      e._z = Math.atan2(2 * (r * n + t * i), -o - d + v + f), e._x = Math.asin(-2 * s), e._y = Math.atan2(2 * (t * r + n * i), o - d - v + f), e._isDirty = !0;
    }
    return e;
  }
  /**
   * Updates the given rotation matrix with the current quaternion values
   * Example Playground https://playground.babylonjs.com/#L49EJ7#67
   * @param result defines the target matrix
   * @returns the updated matrix with the rotation
   */
  toRotationMatrix(e) {
    return he.FromQuaternionToRef(this, e), e;
  }
  /**
   * Updates the current quaternion from the given rotation matrix values
   * Example Playground https://playground.babylonjs.com/#L49EJ7#41
   * @param matrix defines the source matrix
   * @returns the current updated quaternion
   */
  fromRotationMatrix(e) {
    return Ze.FromRotationMatrixToRef(e, this), this;
  }
  /**
   * Returns the dot product (float) between the current quaternions and "other"
   * @param other defines the right operand
   * @returns the dot product
   */
  dot(e) {
    return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w;
  }
  // Statics
  /**
   * Creates a new quaternion from a rotation matrix
   * Example Playground https://playground.babylonjs.com/#L49EJ7#101
   * @param matrix defines the source matrix
   * @returns a new quaternion created from the given rotation matrix values
   */
  static FromRotationMatrix(e) {
    const t = new Ze();
    return Ze.FromRotationMatrixToRef(e, t), t;
  }
  /**
   * Updates the given quaternion with the given rotation matrix values
   * Example Playground https://playground.babylonjs.com/#L49EJ7#102
   * @param matrix defines the source matrix
   * @param result defines the target quaternion
   * @returns result input
   */
  static FromRotationMatrixToRef(e, t) {
    const r = e.m, n = r[0], i = r[4], s = r[8], a = r[1], f = r[5], o = r[9], d = r[2], v = r[6], u = r[10], l = n + f + u;
    let P;
    return l > 0 ? (P = 0.5 / Math.sqrt(l + 1), t._w = 0.25 / P, t._x = (v - o) * P, t._y = (s - d) * P, t._z = (a - i) * P, t._isDirty = !0) : n > f && n > u ? (P = 2 * Math.sqrt(1 + n - f - u), t._w = (v - o) / P, t._x = 0.25 * P, t._y = (i + a) / P, t._z = (s + d) / P, t._isDirty = !0) : f > u ? (P = 2 * Math.sqrt(1 + f - n - u), t._w = (s - d) / P, t._x = (i + a) / P, t._y = 0.25 * P, t._z = (o + v) / P, t._isDirty = !0) : (P = 2 * Math.sqrt(1 + u - n - f), t._w = (a - i) / P, t._x = (s + d) / P, t._y = (o + v) / P, t._z = 0.25 * P, t._isDirty = !0), t;
  }
  /**
   * Returns the dot product (float) between the quaternions "left" and "right"
   * Example Playground https://playground.babylonjs.com/#L49EJ7#61
   * @param left defines the left operand
   * @param right defines the right operand
   * @returns the dot product
   */
  static Dot(e, t) {
    return e._x * t._x + e._y * t._y + e._z * t._z + e._w * t._w;
  }
  /**
   * Checks if the orientations of two rotation quaternions are close to each other
   * Example Playground https://playground.babylonjs.com/#L49EJ7#60
   * @param quat0 defines the first quaternion to check
   * @param quat1 defines the second quaternion to check
   * @param epsilon defines closeness, 0 same orientation, 1 PI apart, default 0.1
   * @returns true if the two quaternions are close to each other within epsilon
   */
  static AreClose(e, t, r = 0.1) {
    const n = Ze.Dot(e, t);
    return 1 - n * n <= r;
  }
  /**
   * Smooth interpolation between two quaternions using Slerp
   * Example Playground https://playground.babylonjs.com/#L49EJ7#93
   * @param source source quaternion
   * @param goal goal quaternion
   * @param deltaTime current interpolation frame
   * @param lerpTime total interpolation time
   * @param result the smoothed quaternion
   */
  static SmoothToRef(e, t, r, n, i) {
    let s = n === 0 ? 1 : r / n;
    return s = Xt.Clamp(s, 0, 1), Ze.SlerpToRef(e, t, s, i), i;
  }
  /**
   * Creates an empty quaternion
   * @returns a new quaternion set to (0.0, 0.0, 0.0)
   */
  static Zero() {
    return new Ze(0, 0, 0, 0);
  }
  /**
   * Inverse a given quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#103
   * @param q defines the source quaternion
   * @returns a new quaternion as the inverted current quaternion
   */
  static Inverse(e) {
    return new e.constructor(-e._x, -e._y, -e._z, e._w);
  }
  /**
   * Inverse a given quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#104
   * @param q defines the source quaternion
   * @param result the quaternion the result will be stored in
   * @returns the result quaternion
   */
  static InverseToRef(e, t) {
    return t.set(-e._x, -e._y, -e._z, e._w), t;
  }
  /**
   * Creates an identity quaternion
   * @returns the identity quaternion
   */
  static Identity() {
    return new Ze(0, 0, 0, 1);
  }
  /**
   * Gets a boolean indicating if the given quaternion is identity
   * @param quaternion defines the quaternion to check
   * @returns true if the quaternion is identity
   */
  static IsIdentity(e) {
    return e && e._x === 0 && e._y === 0 && e._z === 0 && e._w === 1;
  }
  /**
   * Creates a quaternion from a rotation around an axis
   * Example Playground https://playground.babylonjs.com/#L49EJ7#72
   * @param axis defines the axis to use
   * @param angle defines the angle to use
   * @returns a new quaternion created from the given axis (Vector3) and angle in radians (float)
   */
  static RotationAxis(e, t) {
    return Ze.RotationAxisToRef(e, t, new Ze());
  }
  /**
   * Creates a rotation around an axis and stores it into the given quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#73
   * @param axis defines the axis to use
   * @param angle defines the angle to use
   * @param result defines the target quaternion
   * @returns the target quaternion
   */
  static RotationAxisToRef(e, t, r) {
    const n = Math.sin(t / 2);
    return e.normalize(), r._w = Math.cos(t / 2), r._x = e._x * n, r._y = e._y * n, r._z = e._z * n, r._isDirty = !0, r;
  }
  /**
   * Creates a new quaternion from data stored into an array
   * Example Playground https://playground.babylonjs.com/#L49EJ7#63
   * @param array defines the data source
   * @param offset defines the offset in the source array where the data starts
   * @returns a new quaternion
   */
  static FromArray(e, t) {
    return t || (t = 0), new Ze(e[t], e[t + 1], e[t + 2], e[t + 3]);
  }
  /**
   * Updates the given quaternion "result" from the starting index of the given array.
   * Example Playground https://playground.babylonjs.com/#L49EJ7#64
   * @param array the array to pull values from
   * @param offset the offset into the array to start at
   * @param result the quaternion to store the result in
   * @returns result input
   */
  static FromArrayToRef(e, t, r) {
    return r._x = e[t], r._y = e[t + 1], r._z = e[t + 2], r._w = e[t + 3], r._isDirty = !0, r;
  }
  /**
   * Create a quaternion from Euler rotation angles
   * Example Playground https://playground.babylonjs.com/#L49EJ7#33
   * @param x Pitch
   * @param y Yaw
   * @param z Roll
   * @returns the new Quaternion
   */
  static FromEulerAngles(e, t, r) {
    const n = new Ze();
    return Ze.RotationYawPitchRollToRef(t, e, r, n), n;
  }
  /**
   * Updates a quaternion from Euler rotation angles
   * Example Playground https://playground.babylonjs.com/#L49EJ7#34
   * @param x Pitch
   * @param y Yaw
   * @param z Roll
   * @param result the quaternion to store the result
   * @returns the updated quaternion
   */
  static FromEulerAnglesToRef(e, t, r, n) {
    return Ze.RotationYawPitchRollToRef(t, e, r, n), n;
  }
  /**
   * Create a quaternion from Euler rotation vector
   * Example Playground https://playground.babylonjs.com/#L49EJ7#35
   * @param vec the Euler vector (x Pitch, y Yaw, z Roll)
   * @returns the new Quaternion
   */
  static FromEulerVector(e) {
    const t = new Ze();
    return Ze.RotationYawPitchRollToRef(e._y, e._x, e._z, t), t;
  }
  /**
   * Updates a quaternion from Euler rotation vector
   * Example Playground https://playground.babylonjs.com/#L49EJ7#36
   * @param vec the Euler vector (x Pitch, y Yaw, z Roll)
   * @param result the quaternion to store the result
   * @returns the updated quaternion
   */
  static FromEulerVectorToRef(e, t) {
    return Ze.RotationYawPitchRollToRef(e._y, e._x, e._z, t), t;
  }
  /**
   * Updates a quaternion so that it rotates vector vecFrom to vector vecTo
   * Example Playground - https://playground.babylonjs.com/#L49EJ7#70
   * @param vecFrom defines the direction vector from which to rotate
   * @param vecTo defines the direction vector to which to rotate
   * @param result the quaternion to store the result
   * @param epsilon defines the minimal dot value to define vecs as opposite. Default: `BABYLON.Epsilon`
   * @returns the updated quaternion
   */
  static FromUnitVectorsToRef(e, t, r, n = Dn) {
    const i = S.Dot(e, t) + 1;
    return i < n ? Math.abs(e.x) > Math.abs(e.z) ? r.set(-e.y, e.x, 0, 0) : r.set(0, -e.z, e.y, 0) : (S.CrossToRef(e, t, ue.Vector3[0]), r.set(ue.Vector3[0].x, ue.Vector3[0].y, ue.Vector3[0].z, i)), r.normalize();
  }
  /**
   * Creates a new quaternion from the given Euler float angles (y, x, z)
   * Example Playground https://playground.babylonjs.com/#L49EJ7#77
   * @param yaw defines the rotation around Y axis
   * @param pitch defines the rotation around X axis
   * @param roll defines the rotation around Z axis
   * @returns the new quaternion
   */
  static RotationYawPitchRoll(e, t, r) {
    const n = new Ze();
    return Ze.RotationYawPitchRollToRef(e, t, r, n), n;
  }
  /**
   * Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#78
   * @param yaw defines the rotation around Y axis
   * @param pitch defines the rotation around X axis
   * @param roll defines the rotation around Z axis
   * @param result defines the target quaternion
   * @returns result input
   */
  static RotationYawPitchRollToRef(e, t, r, n) {
    const i = r * 0.5, s = t * 0.5, a = e * 0.5, f = Math.sin(i), o = Math.cos(i), d = Math.sin(s), v = Math.cos(s), u = Math.sin(a), l = Math.cos(a);
    return n._x = l * d * o + u * v * f, n._y = u * v * o - l * d * f, n._z = l * v * f - u * d * o, n._w = l * v * o + u * d * f, n._isDirty = !0, n;
  }
  /**
   * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation
   * Example Playground https://playground.babylonjs.com/#L49EJ7#68
   * @param alpha defines the rotation around first axis
   * @param beta defines the rotation around second axis
   * @param gamma defines the rotation around third axis
   * @returns the new quaternion
   */
  static RotationAlphaBetaGamma(e, t, r) {
    const n = new Ze();
    return Ze.RotationAlphaBetaGammaToRef(e, t, r, n), n;
  }
  /**
   * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation and stores it in the target quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#69
   * @param alpha defines the rotation around first axis
   * @param beta defines the rotation around second axis
   * @param gamma defines the rotation around third axis
   * @param result defines the target quaternion
   * @returns result input
   */
  static RotationAlphaBetaGammaToRef(e, t, r, n) {
    const i = (r + e) * 0.5, s = (r - e) * 0.5, a = t * 0.5;
    return n._x = Math.cos(s) * Math.sin(a), n._y = Math.sin(s) * Math.sin(a), n._z = Math.sin(i) * Math.cos(a), n._w = Math.cos(i) * Math.cos(a), n._isDirty = !0, n;
  }
  /**
   * Creates a new quaternion containing the rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation)
   * Example Playground https://playground.babylonjs.com/#L49EJ7#75
   * @param axis1 defines the first axis
   * @param axis2 defines the second axis
   * @param axis3 defines the third axis
   * @returns the new quaternion
   */
  static RotationQuaternionFromAxis(e, t, r) {
    const n = new Ze(0, 0, 0, 0);
    return Ze.RotationQuaternionFromAxisToRef(e, t, r, n), n;
  }
  /**
   * Creates a rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) and stores it in the target quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#76
   * @param axis1 defines the first axis
   * @param axis2 defines the second axis
   * @param axis3 defines the third axis
   * @param ref defines the target quaternion
   * @returns result input
   */
  static RotationQuaternionFromAxisToRef(e, t, r, n) {
    const i = Kr.Matrix[0];
    return he.FromXYZAxesToRef(e.normalize(), t.normalize(), r.normalize(), i), Ze.FromRotationMatrixToRef(i, n), n;
  }
  /**
   * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up".
   * This function works in left handed mode
   * Example Playground https://playground.babylonjs.com/#L49EJ7#96
   * @param forward defines the forward direction - Must be normalized and orthogonal to up.
   * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
   * @returns A new quaternion oriented toward the specified forward and up.
   */
  static FromLookDirectionLH(e, t) {
    const r = new Ze();
    return Ze.FromLookDirectionLHToRef(e, t, r), r;
  }
  /**
   * Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like "up", and stores it in the target quaternion.
   * This function works in left handed mode
   * Example Playground https://playground.babylonjs.com/#L49EJ7#97
   * @param forward defines the forward direction - Must be normalized and orthogonal to up.
   * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
   * @param ref defines the target quaternion.
   * @returns result input
   */
  static FromLookDirectionLHToRef(e, t, r) {
    const n = Kr.Matrix[0];
    return he.LookDirectionLHToRef(e, t, n), Ze.FromRotationMatrixToRef(n, r), r;
  }
  /**
   * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up".
   * This function works in right handed mode
   * Example Playground https://playground.babylonjs.com/#L49EJ7#98
   * @param forward defines the forward direction - Must be normalized and orthogonal to up.
   * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
   * @returns A new quaternion oriented toward the specified forward and up.
   */
  static FromLookDirectionRH(e, t) {
    const r = new Ze();
    return Ze.FromLookDirectionRHToRef(e, t, r), r;
  }
  /**
   * Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like "up", and stores it in the target quaternion.
   * This function works in right handed mode
   * Example Playground https://playground.babylonjs.com/#L49EJ7#105
   * @param forward defines the forward direction - Must be normalized and orthogonal to up.
   * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
   * @param ref defines the target quaternion.
   * @returns result input
   */
  static FromLookDirectionRHToRef(e, t, r) {
    const n = Kr.Matrix[0];
    return he.LookDirectionRHToRef(e, t, n), Ze.FromRotationMatrixToRef(n, r);
  }
  /**
   * Interpolates between two quaternions
   * Example Playground https://playground.babylonjs.com/#L49EJ7#79
   * @param left defines first quaternion
   * @param right defines second quaternion
   * @param amount defines the gradient to use
   * @returns the new interpolated quaternion
   */
  static Slerp(e, t, r) {
    const n = Ze.Identity();
    return Ze.SlerpToRef(e, t, r, n), n;
  }
  /**
   * Interpolates between two quaternions and stores it into a target quaternion
   * Example Playground https://playground.babylonjs.com/#L49EJ7#92
   * @param left defines first quaternion
   * @param right defines second quaternion
   * @param amount defines the gradient to use
   * @param result defines the target quaternion
   * @returns result input
   */
  static SlerpToRef(e, t, r, n) {
    let i, s, a = e._x * t._x + e._y * t._y + e._z * t._z + e._w * t._w, f = !1;
    if (a < 0 && (f = !0, a = -a), a > 0.999999)
      s = 1 - r, i = f ? -r : r;
    else {
      const o = Math.acos(a), d = 1 / Math.sin(o);
      s = Math.sin((1 - r) * o) * d, i = f ? -Math.sin(r * o) * d : Math.sin(r * o) * d;
    }
    return n._x = s * e._x + i * t._x, n._y = s * e._y + i * t._y, n._z = s * e._z + i * t._z, n._w = s * e._w + i * t._w, n._isDirty = !0, n;
  }
  /**
   * Interpolate between two quaternions using Hermite interpolation
   * Example Playground https://playground.babylonjs.com/#L49EJ7#47
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#hermite-quaternion-spline
   * @param value1 defines first quaternion
   * @param tangent1 defines the incoming tangent
   * @param value2 defines second quaternion
   * @param tangent2 defines the outgoing tangent
   * @param amount defines the target quaternion
   * @returns the new interpolated quaternion
   */
  static Hermite(e, t, r, n, i) {
    const s = i * i, a = i * s, f = 2 * a - 3 * s + 1, o = -2 * a + 3 * s, d = a - 2 * s + i, v = a - s, u = e._x * f + r._x * o + t._x * d + n._x * v, l = e._y * f + r._y * o + t._y * d + n._y * v, P = e._z * f + r._z * o + t._z * d + n._z * v, p = e._w * f + r._w * o + t._w * d + n._w * v;
    return new e.constructor(u, l, P, p);
  }
  /**
   * Returns a new Quaternion which is the 1st derivative of the Hermite spline defined by the quaternions "value1", "value2", "tangent1", "tangent2".
   * Example Playground https://playground.babylonjs.com/#L49EJ7#48
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @returns 1st derivative
   */
  static Hermite1stDerivative(e, t, r, n, i) {
    const s = new e.constructor();
    return this.Hermite1stDerivativeToRef(e, t, r, n, i, s), s;
  }
  /**
   * Update a Quaternion with the 1st derivative of the Hermite spline defined by the quaternions "value1", "value2", "tangent1", "tangent2".
   * Example Playground https://playground.babylonjs.com/#L49EJ7#49
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @param result define where to store the derivative
   * @returns result input
   */
  static Hermite1stDerivativeToRef(e, t, r, n, i, s) {
    const a = i * i;
    return s._x = (a - i) * 6 * e._x + (3 * a - 4 * i + 1) * t._x + (-a + i) * 6 * r._x + (3 * a - 2 * i) * n._x, s._y = (a - i) * 6 * e._y + (3 * a - 4 * i + 1) * t._y + (-a + i) * 6 * r._y + (3 * a - 2 * i) * n._y, s._z = (a - i) * 6 * e._z + (3 * a - 4 * i + 1) * t._z + (-a + i) * 6 * r._z + (3 * a - 2 * i) * n._z, s._w = (a - i) * 6 * e._w + (3 * a - 4 * i + 1) * t._w + (-a + i) * 6 * r._w + (3 * a - 2 * i) * n._w, s._isDirty = !0, s;
  }
  /**
   * Returns a new Quaternion as the normalization of the given Quaternion
   * @param quat defines the Quaternion to normalize
   * @returns the new Quaternion
   */
  static Normalize(e) {
    const t = Ze.Zero();
    return Ze.NormalizeToRef(e, t), t;
  }
  /**
   * Sets the given Quaternion "result" with the normalization of the given first Quaternion
   * @param quat defines the Quaternion to normalize
   * @param result defines the Quaternion where to store the result
   * @returns result input
   */
  static NormalizeToRef(e, t) {
    return e.normalizeToRef(t), t;
  }
}
class he {
  /**
   * Gets the precision of matrix computations
   */
  static get Use64Bits() {
    return k9.MatrixUse64Bits;
  }
  /**
   * Gets the internal data of the matrix
   */
  get m() {
    return this._m;
  }
  /**
   * Update the updateFlag to indicate that the matrix has been updated
   */
  markAsUpdated() {
    this.updateFlag = he._UpdateFlagSeed++, this._isIdentity = !1, this._isIdentity3x2 = !1, this._isIdentityDirty = !0, this._isIdentity3x2Dirty = !0;
  }
  _updateIdentityStatus(e, t = !1, r = !1, n = !0) {
    this._isIdentity = e, this._isIdentity3x2 = e || r, this._isIdentityDirty = this._isIdentity ? !1 : t, this._isIdentity3x2Dirty = this._isIdentity3x2 ? !1 : n;
  }
  /**
   * Creates an empty matrix (filled with zeros)
   */
  constructor() {
    this._isIdentity = !1, this._isIdentityDirty = !0, this._isIdentity3x2 = !0, this._isIdentity3x2Dirty = !0, this.updateFlag = -1, k9.MatrixTrackPrecisionChange && k9.MatrixTrackedMatrices.push(this), this._m = new k9.MatrixCurrentType(16), this.markAsUpdated();
  }
  // Properties
  /**
   * Check if the current matrix is identity
   * @returns true is the matrix is the identity matrix
   */
  isIdentity() {
    if (this._isIdentityDirty) {
      this._isIdentityDirty = !1;
      const e = this._m;
      this._isIdentity = e[0] === 1 && e[1] === 0 && e[2] === 0 && e[3] === 0 && e[4] === 0 && e[5] === 1 && e[6] === 0 && e[7] === 0 && e[8] === 0 && e[9] === 0 && e[10] === 1 && e[11] === 0 && e[12] === 0 && e[13] === 0 && e[14] === 0 && e[15] === 1;
    }
    return this._isIdentity;
  }
  /**
   * Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)
   * @returns true is the matrix is the identity matrix
   */
  isIdentityAs3x2() {
    return this._isIdentity3x2Dirty && (this._isIdentity3x2Dirty = !1, this._m[0] !== 1 || this._m[5] !== 1 || this._m[15] !== 1 ? this._isIdentity3x2 = !1 : this._m[1] !== 0 || this._m[2] !== 0 || this._m[3] !== 0 || this._m[4] !== 0 || this._m[6] !== 0 || this._m[7] !== 0 || this._m[8] !== 0 || this._m[9] !== 0 || this._m[10] !== 0 || this._m[11] !== 0 || this._m[12] !== 0 || this._m[13] !== 0 || this._m[14] !== 0 ? this._isIdentity3x2 = !1 : this._isIdentity3x2 = !0), this._isIdentity3x2;
  }
  /**
   * Gets the determinant of the matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#34
   * @returns the matrix determinant
   */
  determinant() {
    if (this._isIdentity === !0)
      return 1;
    const e = this._m, t = e[0], r = e[1], n = e[2], i = e[3], s = e[4], a = e[5], f = e[6], o = e[7], d = e[8], v = e[9], u = e[10], l = e[11], P = e[12], p = e[13], c = e[14], H = e[15], T = u * H - c * l, q = v * H - p * l, b = v * c - p * u, j = d * H - P * l, w = d * c - u * P, m = d * p - P * v, I = +(a * T - f * q + o * b), N = -(s * T - f * j + o * w), k = +(s * q - a * j + o * m), R = -(s * b - a * w + f * m);
    return t * I + r * N + n * k + i * R;
  }
  // Methods
  /**
   * Gets a string with the Matrix values
   * @returns a string with the Matrix values
   */
  toString() {
    return `{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}
${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}
${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}
${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`;
  }
  /**
   * Returns the matrix as a Float32Array or Array<number>
   * Example Playground - https://playground.babylonjs.com/#AV9X17#49
   * @returns the matrix underlying array
   */
  toArray() {
    return this._m;
  }
  /**
   * Returns the matrix as a Float32Array or Array<number>
   * Example Playground - https://playground.babylonjs.com/#AV9X17#114
   * @returns the matrix underlying array.
   */
  asArray() {
    return this._m;
  }
  /**
   * Inverts the current matrix in place
   * Example Playground - https://playground.babylonjs.com/#AV9X17#118
   * @returns the current inverted matrix
   */
  invert() {
    return this.invertToRef(this), this;
  }
  /**
   * Sets all the matrix elements to zero
   * @returns the current matrix
   */
  reset() {
    return he.FromValuesToRef(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, this), this._updateIdentityStatus(!1), this;
  }
  /**
   * Adds the current matrix with a second one
   * Example Playground - https://playground.babylonjs.com/#AV9X17#44
   * @param other defines the matrix to add
   * @returns a new matrix as the addition of the current matrix and the given one
   */
  add(e) {
    const t = new this.constructor();
    return this.addToRef(e, t), t;
  }
  /**
   * Sets the given matrix "result" to the addition of the current matrix and the given one
   * Example Playground - https://playground.babylonjs.com/#AV9X17#45
   * @param other defines the matrix to add
   * @param result defines the target matrix
   * @returns result input
   */
  addToRef(e, t) {
    const r = this._m, n = t._m, i = e.m;
    for (let s = 0; s < 16; s++)
      n[s] = r[s] + i[s];
    return t.markAsUpdated(), t;
  }
  /**
   * Adds in place the given matrix to the current matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#46
   * @param other defines the second operand
   * @returns the current updated matrix
   */
  addToSelf(e) {
    const t = this._m, r = e.m;
    for (let n = 0; n < 16; n++)
      t[n] += r[n];
    return this.markAsUpdated(), this;
  }
  /**
   * Sets the given matrix to the current inverted Matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#119
   * @param other defines the target matrix
   * @returns result input
   */
  invertToRef(e) {
    if (this._isIdentity === !0)
      return he.IdentityToRef(e), e;
    const t = this._m, r = t[0], n = t[1], i = t[2], s = t[3], a = t[4], f = t[5], o = t[6], d = t[7], v = t[8], u = t[9], l = t[10], P = t[11], p = t[12], c = t[13], H = t[14], T = t[15], q = l * T - H * P, b = u * T - c * P, j = u * H - c * l, w = v * T - p * P, m = v * H - l * p, I = v * c - p * u, N = +(f * q - o * b + d * j), k = -(a * q - o * w + d * m), R = +(a * b - f * w + d * I), y = -(a * j - f * m + o * I), O = r * N + n * k + i * R + s * y;
    if (O === 0)
      return e.copyFrom(this), e;
    const Y = 1 / O, ee = o * T - H * d, Z = f * T - c * d, te = f * H - c * o, fe = a * T - p * d, _ = a * H - p * o, G = a * c - p * f, L = o * P - l * d, $ = f * P - u * d, ae = f * l - u * o, Pe = a * P - v * d, ge = a * l - v * o, me = a * u - v * f, Xe = -(n * q - i * b + s * j), De = +(r * q - i * w + s * m), ne = -(r * b - n * w + s * I), re = +(r * j - n * m + i * I), ve = +(n * ee - i * Z + s * te), qe = -(r * ee - i * fe + s * _), ke = +(r * Z - n * fe + s * G), be = -(r * te - n * _ + i * G), Fe = -(n * L - i * $ + s * ae), Ke = +(r * L - i * Pe + s * ge), nt = -(r * $ - n * Pe + s * me), ut = +(r * ae - n * ge + i * me);
    return he.FromValuesToRef(N * Y, Xe * Y, ve * Y, Fe * Y, k * Y, De * Y, qe * Y, Ke * Y, R * Y, ne * Y, ke * Y, nt * Y, y * Y, re * Y, be * Y, ut * Y, e), e;
  }
  /**
   * add a value at the specified position in the current Matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#47
   * @param index the index of the value within the matrix. between 0 and 15.
   * @param value the value to be added
   * @returns the current updated matrix
   */
  addAtIndex(e, t) {
    return this._m[e] += t, this.markAsUpdated(), this;
  }
  /**
   * mutiply the specified position in the current Matrix by a value
   * @param index the index of the value within the matrix. between 0 and 15.
   * @param value the value to be added
   * @returns the current updated matrix
   */
  multiplyAtIndex(e, t) {
    return this._m[e] *= t, this.markAsUpdated(), this;
  }
  /**
   * Inserts the translation vector (using 3 floats) in the current matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#120
   * @param x defines the 1st component of the translation
   * @param y defines the 2nd component of the translation
   * @param z defines the 3rd component of the translation
   * @returns the current updated matrix
   */
  setTranslationFromFloats(e, t, r) {
    return this._m[12] = e, this._m[13] = t, this._m[14] = r, this.markAsUpdated(), this;
  }
  /**
   * Adds the translation vector (using 3 floats) in the current matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#20
   * Example Playground - https://playground.babylonjs.com/#AV9X17#48
   * @param x defines the 1st component of the translation
   * @param y defines the 2nd component of the translation
   * @param z defines the 3rd component of the translation
   * @returns the current updated matrix
   */
  addTranslationFromFloats(e, t, r) {
    return this._m[12] += e, this._m[13] += t, this._m[14] += r, this.markAsUpdated(), this;
  }
  /**
   * Inserts the translation vector in the current matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#121
   * @param vector3 defines the translation to insert
   * @returns the current updated matrix
   */
  setTranslation(e) {
    return this.setTranslationFromFloats(e._x, e._y, e._z);
  }
  /**
   * Gets the translation value of the current matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#122
   * @returns a new Vector3 as the extracted translation from the matrix
   */
  getTranslation() {
    return new S(this._m[12], this._m[13], this._m[14]);
  }
  /**
   * Fill a Vector3 with the extracted translation from the matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#123
   * @param result defines the Vector3 where to store the translation
   * @returns the current matrix
   */
  getTranslationToRef(e) {
    return e.x = this._m[12], e.y = this._m[13], e.z = this._m[14], e;
  }
  /**
   * Remove rotation and scaling part from the matrix
   * @returns the updated matrix
   */
  removeRotationAndScaling() {
    const e = this.m;
    return he.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, e[12], e[13], e[14], e[15], this), this._updateIdentityStatus(e[12] === 0 && e[13] === 0 && e[14] === 0 && e[15] === 1), this;
  }
  /**
   * Multiply two matrices
   * Example Playground - https://playground.babylonjs.com/#AV9X17#15
   * A.multiply(B) means apply B to A so result is B x A
   * @param other defines the second operand
   * @returns a new matrix set with the multiplication result of the current Matrix and the given one
   */
  multiply(e) {
    const t = new this.constructor();
    return this.multiplyToRef(e, t), t;
  }
  /**
   * Copy the current matrix from the given one
   * Example Playground - https://playground.babylonjs.com/#AV9X17#21
   * @param other defines the source matrix
   * @returns the current updated matrix
   */
  copyFrom(e) {
    e.copyToArray(this._m);
    const t = e;
    return this.updateFlag = t.updateFlag, this._updateIdentityStatus(t._isIdentity, t._isIdentityDirty, t._isIdentity3x2, t._isIdentity3x2Dirty), this;
  }
  /**
   * Populates the given array from the starting index with the current matrix values
   * @param array defines the target array
   * @param offset defines the offset in the target array where to start storing values
   * @returns the current matrix
   */
  copyToArray(e, t = 0) {
    const r = this._m;
    return e[t] = r[0], e[t + 1] = r[1], e[t + 2] = r[2], e[t + 3] = r[3], e[t + 4] = r[4], e[t + 5] = r[5], e[t + 6] = r[6], e[t + 7] = r[7], e[t + 8] = r[8], e[t + 9] = r[9], e[t + 10] = r[10], e[t + 11] = r[11], e[t + 12] = r[12], e[t + 13] = r[13], e[t + 14] = r[14], e[t + 15] = r[15], this;
  }
  /**
   * Sets the given matrix "result" with the multiplication result of the current Matrix and the given one
   * A.multiplyToRef(B, R) means apply B to A and store in R and R = B x A
   * Example Playground - https://playground.babylonjs.com/#AV9X17#16
   * @param other defines the second operand
   * @param result defines the matrix where to store the multiplication
   * @returns result input
   */
  multiplyToRef(e, t) {
    return this._isIdentity ? (t.copyFrom(e), t) : e._isIdentity ? (t.copyFrom(this), t) : (this.multiplyToArray(e, t._m, 0), t.markAsUpdated(), t);
  }
  /**
   * Sets the Float32Array "result" from the given index "offset" with the multiplication of the current matrix and the given one
   * @param other defines the second operand
   * @param result defines the array where to store the multiplication
   * @param offset defines the offset in the target array where to start storing values
   * @returns the current matrix
   */
  multiplyToArray(e, t, r) {
    const n = this._m, i = e.m, s = n[0], a = n[1], f = n[2], o = n[3], d = n[4], v = n[5], u = n[6], l = n[7], P = n[8], p = n[9], c = n[10], H = n[11], T = n[12], q = n[13], b = n[14], j = n[15], w = i[0], m = i[1], I = i[2], N = i[3], k = i[4], R = i[5], y = i[6], O = i[7], Y = i[8], ee = i[9], Z = i[10], te = i[11], fe = i[12], _ = i[13], G = i[14], L = i[15];
    return t[r] = s * w + a * k + f * Y + o * fe, t[r + 1] = s * m + a * R + f * ee + o * _, t[r + 2] = s * I + a * y + f * Z + o * G, t[r + 3] = s * N + a * O + f * te + o * L, t[r + 4] = d * w + v * k + u * Y + l * fe, t[r + 5] = d * m + v * R + u * ee + l * _, t[r + 6] = d * I + v * y + u * Z + l * G, t[r + 7] = d * N + v * O + u * te + l * L, t[r + 8] = P * w + p * k + c * Y + H * fe, t[r + 9] = P * m + p * R + c * ee + H * _, t[r + 10] = P * I + p * y + c * Z + H * G, t[r + 11] = P * N + p * O + c * te + H * L, t[r + 12] = T * w + q * k + b * Y + j * fe, t[r + 13] = T * m + q * R + b * ee + j * _, t[r + 14] = T * I + q * y + b * Z + j * G, t[r + 15] = T * N + q * O + b * te + j * L, this;
  }
  /**
   * Check equality between this matrix and a second one
   * @param value defines the second matrix to compare
   * @returns true is the current matrix and the given one values are strictly equal
   */
  equals(e) {
    const t = e;
    if (!t)
      return !1;
    if ((this._isIdentity || t._isIdentity) && !this._isIdentityDirty && !t._isIdentityDirty)
      return this._isIdentity && t._isIdentity;
    const r = this.m, n = t.m;
    return r[0] === n[0] && r[1] === n[1] && r[2] === n[2] && r[3] === n[3] && r[4] === n[4] && r[5] === n[5] && r[6] === n[6] && r[7] === n[7] && r[8] === n[8] && r[9] === n[9] && r[10] === n[10] && r[11] === n[11] && r[12] === n[12] && r[13] === n[13] && r[14] === n[14] && r[15] === n[15];
  }
  /**
   * Clone the current matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#18
   * @returns a new matrix from the current matrix
   */
  clone() {
    const e = new this.constructor();
    return e.copyFrom(this), e;
  }
  /**
   * Returns the name of the current matrix class
   * @returns the string "Matrix"
   */
  getClassName() {
    return "Matrix";
  }
  /**
   * Gets the hash code of the current matrix
   * @returns the hash code
   */
  getHashCode() {
    let e = Kl(this._m[0]);
    for (let t = 1; t < 16; t++)
      e = e * 397 ^ Kl(this._m[t]);
    return e;
  }
  /**
   * Decomposes the current Matrix into a translation, rotation and scaling components of the provided node
   * Example Playground - https://playground.babylonjs.com/#AV9X17#13
   * @param node the node to decompose the matrix to
   * @returns true if operation was successful
   */
  decomposeToTransformNode(e) {
    return e.rotationQuaternion = e.rotationQuaternion || new Ze(), this.decompose(e.scaling, e.rotationQuaternion, e.position);
  }
  /**
   * Decomposes the current Matrix into a translation, rotation and scaling components
   * Example Playground - https://playground.babylonjs.com/#AV9X17#12
   * @param scale defines the scale vector3 given as a reference to update
   * @param rotation defines the rotation quaternion given as a reference to update
   * @param translation defines the translation vector3 given as a reference to update
   * @param preserveScalingNode Use scaling sign coming from this node. Otherwise scaling sign might change.
   * @param useAbsoluteScaling Use scaling sign coming from this absoluteScaling when true or scaling otherwise.
   * @returns true if operation was successful
   */
  decompose(e, t, r, n, i = !0) {
    if (this._isIdentity)
      return r && r.setAll(0), e && e.setAll(1), t && t.copyFromFloats(0, 0, 0, 1), !0;
    const s = this._m;
    if (r && r.copyFromFloats(s[12], s[13], s[14]), e = e || Kr.Vector3[0], e.x = Math.sqrt(s[0] * s[0] + s[1] * s[1] + s[2] * s[2]), e.y = Math.sqrt(s[4] * s[4] + s[5] * s[5] + s[6] * s[6]), e.z = Math.sqrt(s[8] * s[8] + s[9] * s[9] + s[10] * s[10]), n) {
      const a = (i ? n.absoluteScaling.x : n.scaling.x) < 0 ? -1 : 1, f = (i ? n.absoluteScaling.y : n.scaling.y) < 0 ? -1 : 1, o = (i ? n.absoluteScaling.z : n.scaling.z) < 0 ? -1 : 1;
      e.x *= a, e.y *= f, e.z *= o;
    } else
      this.determinant() <= 0 && (e.y *= -1);
    if (e._x === 0 || e._y === 0 || e._z === 0)
      return t && t.copyFromFloats(0, 0, 0, 1), !1;
    if (t) {
      const a = 1 / e._x, f = 1 / e._y, o = 1 / e._z;
      he.FromValuesToRef(s[0] * a, s[1] * a, s[2] * a, 0, s[4] * f, s[5] * f, s[6] * f, 0, s[8] * o, s[9] * o, s[10] * o, 0, 0, 0, 0, 1, Kr.Matrix[0]), Ze.FromRotationMatrixToRef(Kr.Matrix[0], t);
    }
    return !0;
  }
  /**
   * Gets specific row of the matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#36
   * @param index defines the number of the row to get
   * @returns the index-th row of the current matrix as a new Vector4
   */
  getRow(e) {
    if (e < 0 || e > 3)
      return null;
    const t = e * 4;
    return new Ir(this._m[t + 0], this._m[t + 1], this._m[t + 2], this._m[t + 3]);
  }
  /**
   * Gets specific row of the matrix to ref
   * Example Playground - https://playground.babylonjs.com/#AV9X17#36
   * @param index defines the number of the row to get
   * @param rowVector vector to store the index-th row of the current matrix
   * @returns result input
   */
  getRowToRef(e, t) {
    if (e >= 0 && e <= 3) {
      const r = e * 4;
      t.x = this._m[r + 0], t.y = this._m[r + 1], t.z = this._m[r + 2], t.w = this._m[r + 3];
    }
    return t;
  }
  /**
   * Sets the index-th row of the current matrix to the vector4 values
   * Example Playground - https://playground.babylonjs.com/#AV9X17#36
   * @param index defines the number of the row to set
   * @param row defines the target vector4
   * @returns the updated current matrix
   */
  setRow(e, t) {
    return this.setRowFromFloats(e, t.x, t.y, t.z, t.w);
  }
  /**
   * Compute the transpose of the matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#40
   * @returns the new transposed matrix
   */
  transpose() {
    const e = new this.constructor();
    return he.TransposeToRef(this, e), e;
  }
  /**
   * Compute the transpose of the matrix and store it in a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#41
   * @param result defines the target matrix
   * @returns result input
   */
  transposeToRef(e) {
    return he.TransposeToRef(this, e), e;
  }
  /**
   * Sets the index-th row of the current matrix with the given 4 x float values
   * Example Playground - https://playground.babylonjs.com/#AV9X17#36
   * @param index defines the row index
   * @param x defines the x component to set
   * @param y defines the y component to set
   * @param z defines the z component to set
   * @param w defines the w component to set
   * @returns the updated current matrix
   */
  setRowFromFloats(e, t, r, n, i) {
    if (e < 0 || e > 3)
      return this;
    const s = e * 4;
    return this._m[s + 0] = t, this._m[s + 1] = r, this._m[s + 2] = n, this._m[s + 3] = i, this.markAsUpdated(), this;
  }
  /**
   * Compute a new matrix set with the current matrix values multiplied by scale (float)
   * @param scale defines the scale factor
   * @returns a new matrix
   */
  scale(e) {
    const t = new this.constructor();
    return this.scaleToRef(e, t), t;
  }
  /**
   * Scale the current matrix values by a factor to a given result matrix
   * @param scale defines the scale factor
   * @param result defines the matrix to store the result
   * @returns result input
   */
  scaleToRef(e, t) {
    for (let r = 0; r < 16; r++)
      t._m[r] = this._m[r] * e;
    return t.markAsUpdated(), t;
  }
  /**
   * Scale the current matrix values by a factor and add the result to a given matrix
   * @param scale defines the scale factor
   * @param result defines the Matrix to store the result
   * @returns result input
   */
  scaleAndAddToRef(e, t) {
    for (let r = 0; r < 16; r++)
      t._m[r] += this._m[r] * e;
    return t.markAsUpdated(), t;
  }
  /**
   * Writes to the given matrix a normal matrix, computed from this one (using values from identity matrix for fourth row and column).
   * Example Playground - https://playground.babylonjs.com/#AV9X17#17
   * @param ref matrix to store the result
   */
  toNormalMatrix(e) {
    const t = Kr.Matrix[0];
    this.invertToRef(t), t.transposeToRef(e);
    const r = e._m;
    return he.FromValuesToRef(r[0], r[1], r[2], 0, r[4], r[5], r[6], 0, r[8], r[9], r[10], 0, 0, 0, 0, 1, e), e;
  }
  /**
   * Gets only rotation part of the current matrix
   * @returns a new matrix sets to the extracted rotation matrix from the current one
   */
  getRotationMatrix() {
    const e = new this.constructor();
    return this.getRotationMatrixToRef(e), e;
  }
  /**
   * Extracts the rotation matrix from the current one and sets it as the given "result"
   * @param result defines the target matrix to store data to
   * @returns result input
   */
  getRotationMatrixToRef(e) {
    const t = Kr.Vector3[0];
    if (!this.decompose(t))
      return he.IdentityToRef(e), e;
    const r = this._m, n = 1 / t._x, i = 1 / t._y, s = 1 / t._z;
    return he.FromValuesToRef(r[0] * n, r[1] * n, r[2] * n, 0, r[4] * i, r[5] * i, r[6] * i, 0, r[8] * s, r[9] * s, r[10] * s, 0, 0, 0, 0, 1, e), e;
  }
  /**
   * Toggles model matrix from being right handed to left handed in place and vice versa
   */
  toggleModelMatrixHandInPlace() {
    const e = this._m;
    return e[2] *= -1, e[6] *= -1, e[8] *= -1, e[9] *= -1, e[14] *= -1, this.markAsUpdated(), this;
  }
  /**
   * Toggles projection matrix from being right handed to left handed in place and vice versa
   */
  toggleProjectionMatrixHandInPlace() {
    const e = this._m;
    return e[8] *= -1, e[9] *= -1, e[10] *= -1, e[11] *= -1, this.markAsUpdated(), this;
  }
  // Statics
  /**
   * Creates a matrix from an array
   * Example Playground - https://playground.babylonjs.com/#AV9X17#42
   * @param array defines the source array
   * @param offset defines an offset in the source array
   * @returns a new Matrix set from the starting index of the given array
   */
  static FromArray(e, t = 0) {
    const r = new he();
    return he.FromArrayToRef(e, t, r), r;
  }
  /**
   * Copy the content of an array into a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#43
   * @param array defines the source array
   * @param offset defines an offset in the source array
   * @param result defines the target matrix
   * @returns result input
   */
  static FromArrayToRef(e, t, r) {
    for (let n = 0; n < 16; n++)
      r._m[n] = e[n + t];
    return r.markAsUpdated(), r;
  }
  /**
   * Stores an array into a matrix after having multiplied each component by a given factor
   * Example Playground - https://playground.babylonjs.com/#AV9X17#50
   * @param array defines the source array
   * @param offset defines the offset in the source array
   * @param scale defines the scaling factor
   * @param result defines the target matrix
   * @returns result input
   */
  static FromFloat32ArrayToRefScaled(e, t, r, n) {
    for (let i = 0; i < 16; i++)
      n._m[i] = e[i + t] * r;
    return n.markAsUpdated(), n;
  }
  /**
   * Gets an identity matrix that must not be updated
   */
  static get IdentityReadOnly() {
    return he._IdentityReadOnly;
  }
  /**
   * Stores a list of values (16) inside a given matrix
   * @param initialM11 defines 1st value of 1st row
   * @param initialM12 defines 2nd value of 1st row
   * @param initialM13 defines 3rd value of 1st row
   * @param initialM14 defines 4th value of 1st row
   * @param initialM21 defines 1st value of 2nd row
   * @param initialM22 defines 2nd value of 2nd row
   * @param initialM23 defines 3rd value of 2nd row
   * @param initialM24 defines 4th value of 2nd row
   * @param initialM31 defines 1st value of 3rd row
   * @param initialM32 defines 2nd value of 3rd row
   * @param initialM33 defines 3rd value of 3rd row
   * @param initialM34 defines 4th value of 3rd row
   * @param initialM41 defines 1st value of 4th row
   * @param initialM42 defines 2nd value of 4th row
   * @param initialM43 defines 3rd value of 4th row
   * @param initialM44 defines 4th value of 4th row
   * @param result defines the target matrix
   * @returns result input
   */
  static FromValuesToRef(e, t, r, n, i, s, a, f, o, d, v, u, l, P, p, c, H) {
    const T = H._m;
    T[0] = e, T[1] = t, T[2] = r, T[3] = n, T[4] = i, T[5] = s, T[6] = a, T[7] = f, T[8] = o, T[9] = d, T[10] = v, T[11] = u, T[12] = l, T[13] = P, T[14] = p, T[15] = c, H.markAsUpdated();
  }
  /**
   * Creates new matrix from a list of values (16)
   * @param initialM11 defines 1st value of 1st row
   * @param initialM12 defines 2nd value of 1st row
   * @param initialM13 defines 3rd value of 1st row
   * @param initialM14 defines 4th value of 1st row
   * @param initialM21 defines 1st value of 2nd row
   * @param initialM22 defines 2nd value of 2nd row
   * @param initialM23 defines 3rd value of 2nd row
   * @param initialM24 defines 4th value of 2nd row
   * @param initialM31 defines 1st value of 3rd row
   * @param initialM32 defines 2nd value of 3rd row
   * @param initialM33 defines 3rd value of 3rd row
   * @param initialM34 defines 4th value of 3rd row
   * @param initialM41 defines 1st value of 4th row
   * @param initialM42 defines 2nd value of 4th row
   * @param initialM43 defines 3rd value of 4th row
   * @param initialM44 defines 4th value of 4th row
   * @returns the new matrix
   */
  static FromValues(e, t, r, n, i, s, a, f, o, d, v, u, l, P, p, c) {
    const H = new he(), T = H._m;
    return T[0] = e, T[1] = t, T[2] = r, T[3] = n, T[4] = i, T[5] = s, T[6] = a, T[7] = f, T[8] = o, T[9] = d, T[10] = v, T[11] = u, T[12] = l, T[13] = P, T[14] = p, T[15] = c, H.markAsUpdated(), H;
  }
  /**
   * Creates a new matrix composed by merging scale (vector3), rotation (quaternion) and translation (vector3)
   * Example Playground - https://playground.babylonjs.com/#AV9X17#24
   * @param scale defines the scale vector3
   * @param rotation defines the rotation quaternion
   * @param translation defines the translation vector3
   * @returns a new matrix
   */
  static Compose(e, t, r) {
    const n = new he();
    return he.ComposeToRef(e, t, r, n), n;
  }
  /**
   * Sets a matrix to a value composed by merging scale (vector3), rotation (quaternion) and translation (vector3)
   * Example Playground - https://playground.babylonjs.com/#AV9X17#25
   * @param scale defines the scale vector3
   * @param rotation defines the rotation quaternion
   * @param translation defines the translation vector3
   * @param result defines the target matrix
   * @returns result input
   */
  static ComposeToRef(e, t, r, n) {
    const i = n._m, s = t._x, a = t._y, f = t._z, o = t._w, d = s + s, v = a + a, u = f + f, l = s * d, P = s * v, p = s * u, c = a * v, H = a * u, T = f * u, q = o * d, b = o * v, j = o * u, w = e._x, m = e._y, I = e._z;
    return i[0] = (1 - (c + T)) * w, i[1] = (P + j) * w, i[2] = (p - b) * w, i[3] = 0, i[4] = (P - j) * m, i[5] = (1 - (l + T)) * m, i[6] = (H + q) * m, i[7] = 0, i[8] = (p + b) * I, i[9] = (H - q) * I, i[10] = (1 - (l + c)) * I, i[11] = 0, i[12] = r._x, i[13] = r._y, i[14] = r._z, i[15] = 1, n.markAsUpdated(), n;
  }
  /**
   * Creates a new identity matrix
   * @returns a new identity matrix
   */
  static Identity() {
    const e = he.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    return e._updateIdentityStatus(!0), e;
  }
  /**
   * Creates a new identity matrix and stores the result in a given matrix
   * @param result defines the target matrix
   * @returns result input
   */
  static IdentityToRef(e) {
    return he.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, e), e._updateIdentityStatus(!0), e;
  }
  /**
   * Creates a new zero matrix
   * @returns a new zero matrix
   */
  static Zero() {
    const e = he.FromValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    return e._updateIdentityStatus(!1), e;
  }
  /**
   * Creates a new rotation matrix for "angle" radians around the X axis
   * Example Playground - https://playground.babylonjs.com/#AV9X17#97
   * @param angle defines the angle (in radians) to use
   * @returns the new matrix
   */
  static RotationX(e) {
    const t = new he();
    return he.RotationXToRef(e, t), t;
  }
  /**
   * Creates a new matrix as the invert of a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#124
   * @param source defines the source matrix
   * @returns the new matrix
   */
  static Invert(e) {
    const t = new e.constructor();
    return e.invertToRef(t), t;
  }
  /**
   * Creates a new rotation matrix for "angle" radians around the X axis and stores it in a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#98
   * @param angle defines the angle (in radians) to use
   * @param result defines the target matrix
   * @returns result input
   */
  static RotationXToRef(e, t) {
    const r = Math.sin(e), n = Math.cos(e);
    return he.FromValuesToRef(1, 0, 0, 0, 0, n, r, 0, 0, -r, n, 0, 0, 0, 0, 1, t), t._updateIdentityStatus(n === 1 && r === 0), t;
  }
  /**
   * Creates a new rotation matrix for "angle" radians around the Y axis
   * Example Playground - https://playground.babylonjs.com/#AV9X17#99
   * @param angle defines the angle (in radians) to use
   * @returns the new matrix
   */
  static RotationY(e) {
    const t = new he();
    return he.RotationYToRef(e, t), t;
  }
  /**
   * Creates a new rotation matrix for "angle" radians around the Y axis and stores it in a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#100
   * @param angle defines the angle (in radians) to use
   * @param result defines the target matrix
   * @returns result input
   */
  static RotationYToRef(e, t) {
    const r = Math.sin(e), n = Math.cos(e);
    return he.FromValuesToRef(n, 0, -r, 0, 0, 1, 0, 0, r, 0, n, 0, 0, 0, 0, 1, t), t._updateIdentityStatus(n === 1 && r === 0), t;
  }
  /**
   * Creates a new rotation matrix for "angle" radians around the Z axis
   * Example Playground - https://playground.babylonjs.com/#AV9X17#101
   * @param angle defines the angle (in radians) to use
   * @returns the new matrix
   */
  static RotationZ(e) {
    const t = new he();
    return he.RotationZToRef(e, t), t;
  }
  /**
   * Creates a new rotation matrix for "angle" radians around the Z axis and stores it in a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#102
   * @param angle defines the angle (in radians) to use
   * @param result defines the target matrix
   * @returns result input
   */
  static RotationZToRef(e, t) {
    const r = Math.sin(e), n = Math.cos(e);
    return he.FromValuesToRef(n, r, 0, 0, -r, n, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, t), t._updateIdentityStatus(n === 1 && r === 0), t;
  }
  /**
   * Creates a new rotation matrix for "angle" radians around the given axis
   * Example Playground - https://playground.babylonjs.com/#AV9X17#96
   * @param axis defines the axis to use
   * @param angle defines the angle (in radians) to use
   * @returns the new matrix
   */
  static RotationAxis(e, t) {
    const r = new he();
    return he.RotationAxisToRef(e, t, r), r;
  }
  /**
   * Creates a new rotation matrix for "angle" radians around the given axis and stores it in a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#94
   * @param axis defines the axis to use
   * @param angle defines the angle (in radians) to use
   * @param result defines the target matrix
   * @returns result input
   */
  static RotationAxisToRef(e, t, r) {
    const n = Math.sin(-t), i = Math.cos(-t), s = 1 - i;
    e.normalize();
    const a = r._m;
    return a[0] = e._x * e._x * s + i, a[1] = e._x * e._y * s - e._z * n, a[2] = e._x * e._z * s + e._y * n, a[3] = 0, a[4] = e._y * e._x * s + e._z * n, a[5] = e._y * e._y * s + i, a[6] = e._y * e._z * s - e._x * n, a[7] = 0, a[8] = e._z * e._x * s - e._y * n, a[9] = e._z * e._y * s + e._x * n, a[10] = e._z * e._z * s + i, a[11] = 0, a[12] = 0, a[13] = 0, a[14] = 0, a[15] = 1, r.markAsUpdated(), r;
  }
  /**
   * Takes normalised vectors and returns a rotation matrix to align "from" with "to".
   * Taken from http://www.iquilezles.org/www/articles/noacos/noacos.htm
   * Example Playground - https://playground.babylonjs.com/#AV9X17#93
   * @param from defines the vector to align
   * @param to defines the vector to align to
   * @param result defines the target matrix
   * @param useYAxisForCoplanar defines a boolean indicating that we should favor Y axis for coplanar vectors (default is false)
   * @returns result input
   */
  static RotationAlignToRef(e, t, r, n = !1) {
    const i = S.Dot(t, e), s = r._m;
    if (i < -1 + Dn)
      s[0] = -1, s[1] = 0, s[2] = 0, s[3] = 0, s[4] = 0, s[5] = n ? 1 : -1, s[6] = 0, s[7] = 0, s[8] = 0, s[9] = 0, s[10] = n ? -1 : 1, s[11] = 0;
    else {
      const a = S.Cross(t, e), f = 1 / (1 + i);
      s[0] = a._x * a._x * f + i, s[1] = a._y * a._x * f - a._z, s[2] = a._z * a._x * f + a._y, s[3] = 0, s[4] = a._x * a._y * f + a._z, s[5] = a._y * a._y * f + i, s[6] = a._z * a._y * f - a._x, s[7] = 0, s[8] = a._x * a._z * f - a._y, s[9] = a._y * a._z * f + a._x, s[10] = a._z * a._z * f + i, s[11] = 0;
    }
    return s[12] = 0, s[13] = 0, s[14] = 0, s[15] = 1, r.markAsUpdated(), r;
  }
  /**
   * Creates a rotation matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#103
   * Example Playground - https://playground.babylonjs.com/#AV9X17#105
   * @param yaw defines the yaw angle in radians (Y axis)
   * @param pitch defines the pitch angle in radians (X axis)
   * @param roll defines the roll angle in radians (Z axis)
   * @returns the new rotation matrix
   */
  static RotationYawPitchRoll(e, t, r) {
    const n = new he();
    return he.RotationYawPitchRollToRef(e, t, r, n), n;
  }
  /**
   * Creates a rotation matrix and stores it in a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#104
   * @param yaw defines the yaw angle in radians (Y axis)
   * @param pitch defines the pitch angle in radians (X axis)
   * @param roll defines the roll angle in radians (Z axis)
   * @param result defines the target matrix
   * @returns result input
   */
  static RotationYawPitchRollToRef(e, t, r, n) {
    return Ze.RotationYawPitchRollToRef(e, t, r, Kr.Quaternion[0]), Kr.Quaternion[0].toRotationMatrix(n), n;
  }
  /**
   * Creates a scaling matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#107
   * @param x defines the scale factor on X axis
   * @param y defines the scale factor on Y axis
   * @param z defines the scale factor on Z axis
   * @returns the new matrix
   */
  static Scaling(e, t, r) {
    const n = new he();
    return he.ScalingToRef(e, t, r, n), n;
  }
  /**
   * Creates a scaling matrix and stores it in a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#108
   * @param x defines the scale factor on X axis
   * @param y defines the scale factor on Y axis
   * @param z defines the scale factor on Z axis
   * @param result defines the target matrix
   * @returns result input
   */
  static ScalingToRef(e, t, r, n) {
    return he.FromValuesToRef(e, 0, 0, 0, 0, t, 0, 0, 0, 0, r, 0, 0, 0, 0, 1, n), n._updateIdentityStatus(e === 1 && t === 1 && r === 1), n;
  }
  /**
   * Creates a translation matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#109
   * @param x defines the translation on X axis
   * @param y defines the translation on Y axis
   * @param z defines the translationon Z axis
   * @returns the new matrix
   */
  static Translation(e, t, r) {
    const n = new he();
    return he.TranslationToRef(e, t, r, n), n;
  }
  /**
   * Creates a translation matrix and stores it in a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#110
   * @param x defines the translation on X axis
   * @param y defines the translation on Y axis
   * @param z defines the translationon Z axis
   * @param result defines the target matrix
   * @returns result input
   */
  static TranslationToRef(e, t, r, n) {
    return he.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, e, t, r, 1, n), n._updateIdentityStatus(e === 0 && t === 0 && r === 0), n;
  }
  /**
   * Returns a new Matrix whose values are the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
   * Example Playground - https://playground.babylonjs.com/#AV9X17#55
   * @param startValue defines the start value
   * @param endValue defines the end value
   * @param gradient defines the gradient factor
   * @returns the new matrix
   */
  static Lerp(e, t, r) {
    const n = new e.constructor();
    return he.LerpToRef(e, t, r, n), n;
  }
  /**
   * Set the given matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
   * Example Playground - https://playground.babylonjs.com/#AV9X17#54
   * @param startValue defines the start value
   * @param endValue defines the end value
   * @param gradient defines the gradient factor
   * @param result defines the Matrix object where to store data
   * @returns result input
   */
  static LerpToRef(e, t, r, n) {
    const i = n._m, s = e.m, a = t.m;
    for (let f = 0; f < 16; f++)
      i[f] = s[f] * (1 - r) + a[f] * r;
    return n.markAsUpdated(), n;
  }
  /**
   * Builds a new matrix whose values are computed by:
   * * decomposing the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
   * * interpolating for "gradient" (float) the values between each of these decomposed matrices between the start and the end
   * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices
   * Example Playground - https://playground.babylonjs.com/#AV9X17#22
   * Example Playground - https://playground.babylonjs.com/#AV9X17#51
   * @param startValue defines the first matrix
   * @param endValue defines the second matrix
   * @param gradient defines the gradient between the two matrices
   * @returns the new matrix
   */
  static DecomposeLerp(e, t, r) {
    const n = new e.constructor();
    return he.DecomposeLerpToRef(e, t, r, n), n;
  }
  /**
   * Update a matrix to values which are computed by:
   * * decomposing the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
   * * interpolating for "gradient" (float) the values between each of these decomposed matrices between the start and the end
   * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices
   * Example Playground - https://playground.babylonjs.com/#AV9X17#23
   * Example Playground - https://playground.babylonjs.com/#AV9X17#53
   * @param startValue defines the first matrix
   * @param endValue defines the second matrix
   * @param gradient defines the gradient between the two matrices
   * @param result defines the target matrix
   * @returns result input
   */
  static DecomposeLerpToRef(e, t, r, n) {
    const i = Kr.Vector3[0], s = Kr.Quaternion[0], a = Kr.Vector3[1];
    e.decompose(i, s, a);
    const f = Kr.Vector3[2], o = Kr.Quaternion[1], d = Kr.Vector3[3];
    t.decompose(f, o, d);
    const v = Kr.Vector3[4];
    S.LerpToRef(i, f, r, v);
    const u = Kr.Quaternion[2];
    Ze.SlerpToRef(s, o, r, u);
    const l = Kr.Vector3[5];
    return S.LerpToRef(a, d, r, l), he.ComposeToRef(v, u, l, n), n;
  }
  /**
   * Creates a new matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.
   * This function generates a matrix suitable for a left handed coordinate system
   * Example Playground - https://playground.babylonjs.com/#AV9X17#58
   * Example Playground - https://playground.babylonjs.com/#AV9X17#59
   * @param eye defines the final position of the entity
   * @param target defines where the entity should look at
   * @param up defines the up vector for the entity
   * @returns the new matrix
   */
  static LookAtLH(e, t, r) {
    const n = new he();
    return he.LookAtLHToRef(e, t, r, n), n;
  }
  /**
   * Sets the given "result" Matrix to a matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.
   * This function generates a matrix suitable for a left handed coordinate system
   * Example Playground - https://playground.babylonjs.com/#AV9X17#60
   * Example Playground - https://playground.babylonjs.com/#AV9X17#61
   * @param eye defines the final position of the entity
   * @param target defines where the entity should look at
   * @param up defines the up vector for the entity
   * @param result defines the target matrix
   * @returns result input
   */
  static LookAtLHToRef(e, t, r, n) {
    const i = Kr.Vector3[0], s = Kr.Vector3[1], a = Kr.Vector3[2];
    t.subtractToRef(e, a), a.normalize(), S.CrossToRef(r, a, i);
    const f = i.lengthSquared();
    f === 0 ? i.x = 1 : i.normalizeFromLength(Math.sqrt(f)), S.CrossToRef(a, i, s), s.normalize();
    const o = -S.Dot(i, e), d = -S.Dot(s, e), v = -S.Dot(a, e);
    return he.FromValuesToRef(i._x, s._x, a._x, 0, i._y, s._y, a._y, 0, i._z, s._z, a._z, 0, o, d, v, 1, n), n;
  }
  /**
   * Creates a new matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.
   * This function generates a matrix suitable for a right handed coordinate system
   * Example Playground - https://playground.babylonjs.com/#AV9X17#62
   * Example Playground - https://playground.babylonjs.com/#AV9X17#63
   * @param eye defines the final position of the entity
   * @param target defines where the entity should look at
   * @param up defines the up vector for the entity
   * @returns the new matrix
   */
  static LookAtRH(e, t, r) {
    const n = new he();
    return he.LookAtRHToRef(e, t, r, n), n;
  }
  /**
   * Sets the given "result" Matrix to a matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.
   * This function generates a matrix suitable for a right handed coordinate system
   * Example Playground - https://playground.babylonjs.com/#AV9X17#64
   * Example Playground - https://playground.babylonjs.com/#AV9X17#65
   * @param eye defines the final position of the entity
   * @param target defines where the entity should look at
   * @param up defines the up vector for the entity
   * @param result defines the target matrix
   * @returns result input
   */
  static LookAtRHToRef(e, t, r, n) {
    const i = Kr.Vector3[0], s = Kr.Vector3[1], a = Kr.Vector3[2];
    e.subtractToRef(t, a), a.normalize(), S.CrossToRef(r, a, i);
    const f = i.lengthSquared();
    f === 0 ? i.x = 1 : i.normalizeFromLength(Math.sqrt(f)), S.CrossToRef(a, i, s), s.normalize();
    const o = -S.Dot(i, e), d = -S.Dot(s, e), v = -S.Dot(a, e);
    return he.FromValuesToRef(i._x, s._x, a._x, 0, i._y, s._y, a._y, 0, i._z, s._z, a._z, 0, o, d, v, 1, n), n;
  }
  /**
   * Creates a new matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)
   * This function generates a matrix suitable for a left handed coordinate system
   * Example Playground - https://playground.babylonjs.com/#AV9X17#66
   * @param forward defines the forward direction - Must be normalized and orthogonal to up.
   * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
   * @returns the new matrix
   */
  static LookDirectionLH(e, t) {
    const r = new he();
    return he.LookDirectionLHToRef(e, t, r), r;
  }
  /**
   * Sets the given "result" Matrix to a matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)
   * This function generates a matrix suitable for a left handed coordinate system
   * Example Playground - https://playground.babylonjs.com/#AV9X17#67
   * @param forward defines the forward direction - Must be normalized and orthogonal to up.
   * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
   * @param result defines the target matrix
   * @returns result input
   */
  static LookDirectionLHToRef(e, t, r) {
    const n = Kr.Vector3[0];
    n.copyFrom(e), n.scaleInPlace(-1);
    const i = Kr.Vector3[1];
    return S.CrossToRef(t, n, i), he.FromValuesToRef(i._x, i._y, i._z, 0, t._x, t._y, t._z, 0, n._x, n._y, n._z, 0, 0, 0, 0, 1, r), r;
  }
  /**
   * Creates a new matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)
   * This function generates a matrix suitable for a right handed coordinate system
   * Example Playground - https://playground.babylonjs.com/#AV9X17#68
   * @param forward defines the forward direction - Must be normalized and orthogonal to up.
   * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
   * @returns the new matrix
   */
  static LookDirectionRH(e, t) {
    const r = new he();
    return he.LookDirectionRHToRef(e, t, r), r;
  }
  /**
   * Sets the given "result" Matrix to a matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)
   * This function generates a matrix suitable for a right handed coordinate system
   * Example Playground - https://playground.babylonjs.com/#AV9X17#69
   * @param forward defines the forward direction - Must be normalized and orthogonal to up.
   * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
   * @param result defines the target matrix
   * @returns result input
   */
  static LookDirectionRHToRef(e, t, r) {
    const n = Kr.Vector3[2];
    return S.CrossToRef(t, e, n), he.FromValuesToRef(n._x, n._y, n._z, 0, t._x, t._y, t._z, 0, e._x, e._y, e._z, 0, 0, 0, 0, 1, r), r;
  }
  /**
   * Create a left-handed orthographic projection matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#70
   * @param width defines the viewport width
   * @param height defines the viewport height
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @returns a new matrix as a left-handed orthographic projection matrix
   */
  static OrthoLH(e, t, r, n, i) {
    const s = new he();
    return he.OrthoLHToRef(e, t, r, n, s, i), s;
  }
  /**
   * Store a left-handed orthographic projection to a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#71
   * @param width defines the viewport width
   * @param height defines the viewport height
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane
   * @param result defines the target matrix
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @returns result input
   */
  static OrthoLHToRef(e, t, r, n, i, s) {
    const a = r, f = n, o = 2 / e, d = 2 / t, v = 2 / (f - a), u = -(f + a) / (f - a);
    return he.FromValuesToRef(o, 0, 0, 0, 0, d, 0, 0, 0, 0, v, 0, 0, 0, u, 1, i), s && i.multiplyToRef(kw, i), i._updateIdentityStatus(o === 1 && d === 1 && v === 1 && u === 0), i;
  }
  /**
   * Create a left-handed orthographic projection matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#72
   * @param left defines the viewport left coordinate
   * @param right defines the viewport right coordinate
   * @param bottom defines the viewport bottom coordinate
   * @param top defines the viewport top coordinate
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @returns a new matrix as a left-handed orthographic projection matrix
   */
  static OrthoOffCenterLH(e, t, r, n, i, s, a) {
    const f = new he();
    return he.OrthoOffCenterLHToRef(e, t, r, n, i, s, f, a), f;
  }
  /**
   * Stores a left-handed orthographic projection into a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#73
   * @param left defines the viewport left coordinate
   * @param right defines the viewport right coordinate
   * @param bottom defines the viewport bottom coordinate
   * @param top defines the viewport top coordinate
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane
   * @param result defines the target matrix
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @returns result input
   */
  static OrthoOffCenterLHToRef(e, t, r, n, i, s, a, f) {
    const o = i, d = s, v = 2 / (t - e), u = 2 / (n - r), l = 2 / (d - o), P = -(d + o) / (d - o), p = (e + t) / (e - t), c = (n + r) / (r - n);
    return he.FromValuesToRef(v, 0, 0, 0, 0, u, 0, 0, 0, 0, l, 0, p, c, P, 1, a), f && a.multiplyToRef(kw, a), a.markAsUpdated(), a;
  }
  /**
   * Stores a left-handed oblique projection into a given matrix
   * @param left defines the viewport left coordinate
   * @param right defines the viewport right coordinate
   * @param bottom defines the viewport bottom coordinate
   * @param top defines the viewport top coordinate
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane
   * @param angle Angle (along X/Y Plane) to apply shear
   * @param length Length of the shear
   * @param distance Distance from shear point
   * @param result defines the target matrix
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @returns result input
   */
  static ObliqueOffCenterLHToRef(e, t, r, n, i, s, a, f, o, d, v) {
    const u = -a * Math.cos(f), l = -a * Math.sin(f);
    return he.TranslationToRef(0, 0, -o, Kr.Matrix[1]), he.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, u, l, 1, 0, 0, 0, 0, 1, Kr.Matrix[0]), Kr.Matrix[1].multiplyToRef(Kr.Matrix[0], Kr.Matrix[0]), he.TranslationToRef(0, 0, o, Kr.Matrix[1]), Kr.Matrix[0].multiplyToRef(Kr.Matrix[1], Kr.Matrix[0]), he.OrthoOffCenterLHToRef(e, t, r, n, i, s, d, v), Kr.Matrix[0].multiplyToRef(d, d), d;
  }
  /**
   * Creates a right-handed orthographic projection matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#76
   * @param left defines the viewport left coordinate
   * @param right defines the viewport right coordinate
   * @param bottom defines the viewport bottom coordinate
   * @param top defines the viewport top coordinate
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @returns a new matrix as a right-handed orthographic projection matrix
   */
  static OrthoOffCenterRH(e, t, r, n, i, s, a) {
    const f = new he();
    return he.OrthoOffCenterRHToRef(e, t, r, n, i, s, f, a), f;
  }
  /**
   * Stores a right-handed orthographic projection into a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#77
   * @param left defines the viewport left coordinate
   * @param right defines the viewport right coordinate
   * @param bottom defines the viewport bottom coordinate
   * @param top defines the viewport top coordinate
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane
   * @param result defines the target matrix
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @returns result input
   */
  static OrthoOffCenterRHToRef(e, t, r, n, i, s, a, f) {
    return he.OrthoOffCenterLHToRef(e, t, r, n, i, s, a, f), a._m[10] *= -1, a;
  }
  /**
   * Stores a right-handed oblique projection into a given matrix
   * @param left defines the viewport left coordinate
   * @param right defines the viewport right coordinate
   * @param bottom defines the viewport bottom coordinate
   * @param top defines the viewport top coordinate
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane
   * @param angle Angle (along X/Y Plane) to apply shear
   * @param length Length of the shear
   * @param distance Distance from shear point
   * @param result defines the target matrix
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @returns result input
   */
  static ObliqueOffCenterRHToRef(e, t, r, n, i, s, a, f, o, d, v) {
    const u = a * Math.cos(f), l = a * Math.sin(f);
    return he.TranslationToRef(0, 0, o, Kr.Matrix[1]), he.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, u, l, 1, 0, 0, 0, 0, 1, Kr.Matrix[0]), Kr.Matrix[1].multiplyToRef(Kr.Matrix[0], Kr.Matrix[0]), he.TranslationToRef(0, 0, -o, Kr.Matrix[1]), Kr.Matrix[0].multiplyToRef(Kr.Matrix[1], Kr.Matrix[0]), he.OrthoOffCenterRHToRef(e, t, r, n, i, s, d, v), Kr.Matrix[0].multiplyToRef(d, d), d;
  }
  /**
   * Creates a left-handed perspective projection matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#85
   * @param width defines the viewport width
   * @param height defines the viewport height
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
   * @returns a new matrix as a left-handed perspective projection matrix
   */
  static PerspectiveLH(e, t, r, n, i, s = 0) {
    const a = new he(), f = r, o = n, d = 2 * f / e, v = 2 * f / t, u = (o + f) / (o - f), l = -2 * o * f / (o - f), P = Math.tan(s);
    return he.FromValuesToRef(d, 0, 0, 0, 0, v, 0, P, 0, 0, u, 1, 0, 0, l, 0, a), i && a.multiplyToRef(kw, a), a._updateIdentityStatus(!1), a;
  }
  /**
   * Creates a left-handed perspective projection matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#78
   * @param fov defines the horizontal field of view
   * @param aspect defines the aspect ratio
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane. If 0, assume we are in "infinite zfar" mode
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
   * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)
   * @returns a new matrix as a left-handed perspective projection matrix
   */
  static PerspectiveFovLH(e, t, r, n, i, s = 0, a = !1) {
    const f = new he();
    return he.PerspectiveFovLHToRef(e, t, r, n, f, !0, i, s, a), f;
  }
  /**
   * Stores a left-handed perspective projection into a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#81
   * @param fov defines the horizontal field of view
   * @param aspect defines the aspect ratio
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane. If 0, assume we are in "infinite zfar" mode
   * @param result defines the target matrix
   * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
   * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)
   * @returns result input
   */
  static PerspectiveFovLHToRef(e, t, r, n, i, s = !0, a, f = 0, o = !1) {
    const d = r, v = n, u = 1 / Math.tan(e * 0.5), l = s ? u / t : u, P = s ? u : u * t, p = o && d === 0 ? -1 : v !== 0 ? (v + d) / (v - d) : 1, c = o && d === 0 ? 2 * v : v !== 0 ? -2 * v * d / (v - d) : -2 * d, H = Math.tan(f);
    return he.FromValuesToRef(l, 0, 0, 0, 0, P, 0, H, 0, 0, p, 1, 0, 0, c, 0, i), a && i.multiplyToRef(kw, i), i._updateIdentityStatus(!1), i;
  }
  /**
   * Stores a left-handed perspective projection into a given matrix with depth reversed
   * Example Playground - https://playground.babylonjs.com/#AV9X17#89
   * @param fov defines the horizontal field of view
   * @param aspect defines the aspect ratio
   * @param znear defines the near clip plane
   * @param zfar not used as infinity is used as far clip
   * @param result defines the target matrix
   * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
   * @returns result input
   */
  static PerspectiveFovReverseLHToRef(e, t, r, n, i, s = !0, a, f = 0) {
    const o = 1 / Math.tan(e * 0.5), d = s ? o / t : o, v = s ? o : o * t, u = Math.tan(f);
    return he.FromValuesToRef(d, 0, 0, 0, 0, v, 0, u, 0, 0, -r, 1, 0, 0, 1, 0, i), a && i.multiplyToRef(kw, i), i._updateIdentityStatus(!1), i;
  }
  /**
   * Creates a right-handed perspective projection matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#83
   * @param fov defines the horizontal field of view
   * @param aspect defines the aspect ratio
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane. If 0, assume we are in "infinite zfar" mode
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
   * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)
   * @returns a new matrix as a right-handed perspective projection matrix
   */
  static PerspectiveFovRH(e, t, r, n, i, s = 0, a = !1) {
    const f = new he();
    return he.PerspectiveFovRHToRef(e, t, r, n, f, !0, i, s, a), f;
  }
  /**
   * Stores a right-handed perspective projection into a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#84
   * @param fov defines the horizontal field of view
   * @param aspect defines the aspect ratio
   * @param znear defines the near clip plane
   * @param zfar defines the far clip plane. If 0, assume we are in "infinite zfar" mode
   * @param result defines the target matrix
   * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
   * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)
   * @returns result input
   */
  static PerspectiveFovRHToRef(e, t, r, n, i, s = !0, a, f = 0, o = !1) {
    const d = r, v = n, u = 1 / Math.tan(e * 0.5), l = s ? u / t : u, P = s ? u : u * t, p = o && d === 0 ? 1 : v !== 0 ? -(v + d) / (v - d) : -1, c = o && d === 0 ? 2 * v : v !== 0 ? -2 * v * d / (v - d) : -2 * d, H = Math.tan(f);
    return he.FromValuesToRef(l, 0, 0, 0, 0, P, 0, H, 0, 0, p, -1, 0, 0, c, 0, i), a && i.multiplyToRef(kw, i), i._updateIdentityStatus(!1), i;
  }
  /**
   * Stores a right-handed perspective projection into a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#90
   * @param fov defines the horizontal field of view
   * @param aspect defines the aspect ratio
   * @param znear defines the near clip plane
   * @param zfar not used as infinity is used as far clip
   * @param result defines the target matrix
   * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
   * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
   * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
   * @returns result input
   */
  static PerspectiveFovReverseRHToRef(e, t, r, n, i, s = !0, a, f = 0) {
    const o = 1 / Math.tan(e * 0.5), d = s ? o / t : o, v = s ? o : o * t, u = Math.tan(f);
    return he.FromValuesToRef(d, 0, 0, 0, 0, v, 0, u, 0, 0, -r, -1, 0, 0, -1, 0, i), a && i.multiplyToRef(kw, i), i._updateIdentityStatus(!1), i;
  }
  /**
   * Computes a complete transformation matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#113
   * @param viewport defines the viewport to use
   * @param world defines the world matrix
   * @param view defines the view matrix
   * @param projection defines the projection matrix
   * @param zmin defines the near clip plane
   * @param zmax defines the far clip plane
   * @returns the transformation matrix
   */
  static GetFinalMatrix(e, t, r, n, i, s) {
    const a = e.width, f = e.height, o = e.x, d = e.y, v = he.FromValues(a / 2, 0, 0, 0, 0, -f / 2, 0, 0, 0, 0, s - i, 0, o + a / 2, f / 2 + d, i, 1), u = new t.constructor();
    return t.multiplyToRef(r, u), u.multiplyToRef(n, u), u.multiplyToRef(v, u);
  }
  /**
   * Extracts a 2x2 matrix from a given matrix and store the result in a Float32Array
   * @param matrix defines the matrix to use
   * @returns a new Float32Array array with 4 elements : the 2x2 matrix extracted from the given matrix
   */
  static GetAsMatrix2x2(e) {
    const t = e.m, r = [t[0], t[1], t[4], t[5]];
    return k9.MatrixUse64Bits ? r : new Float32Array(r);
  }
  /**
   * Extracts a 3x3 matrix from a given matrix and store the result in a Float32Array
   * @param matrix defines the matrix to use
   * @returns a new Float32Array array with 9 elements : the 3x3 matrix extracted from the given matrix
   */
  static GetAsMatrix3x3(e) {
    const t = e.m, r = [t[0], t[1], t[2], t[4], t[5], t[6], t[8], t[9], t[10]];
    return k9.MatrixUse64Bits ? r : new Float32Array(r);
  }
  /**
   * Compute the transpose of a given matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#111
   * @param matrix defines the matrix to transpose
   * @returns the new matrix
   */
  static Transpose(e) {
    const t = new e.constructor();
    return he.TransposeToRef(e, t), t;
  }
  /**
   * Compute the transpose of a matrix and store it in a target matrix
   * Example Playground - https://playground.babylonjs.com/#AV9X17#112
   * @param matrix defines the matrix to transpose
   * @param result defines the target matrix
   * @returns result input
   */
  static TransposeToRef(e, t) {
    const r = e.m, n = r[0], i = r[4], s = r[8], a = r[12], f = r[1], o = r[5], d = r[9], v = r[13], u = r[2], l = r[6], P = r[10], p = r[14], c = r[3], H = r[7], T = r[11], q = r[15], b = t._m;
    return b[0] = n, b[1] = i, b[2] = s, b[3] = a, b[4] = f, b[5] = o, b[6] = d, b[7] = v, b[8] = u, b[9] = l, b[10] = P, b[11] = p, b[12] = c, b[13] = H, b[14] = T, b[15] = q, t.markAsUpdated(), t._updateIdentityStatus(e._isIdentity, e._isIdentityDirty), t;
  }
  /**
   * Computes a reflection matrix from a plane
   * Example Playground - https://playground.babylonjs.com/#AV9X17#87
   * @param plane defines the reflection plane
   * @returns a new matrix
   */
  static Reflection(e) {
    const t = new he();
    return he.ReflectionToRef(e, t), t;
  }
  /**
   * Computes a reflection matrix from a plane
   * Example Playground - https://playground.babylonjs.com/#AV9X17#88
   * @param plane defines the reflection plane
   * @param result defines the target matrix
   * @returns result input
   */
  static ReflectionToRef(e, t) {
    e.normalize();
    const r = e.normal.x, n = e.normal.y, i = e.normal.z, s = -2 * r, a = -2 * n, f = -2 * i;
    return he.FromValuesToRef(s * r + 1, a * r, f * r, 0, s * n, a * n + 1, f * n, 0, s * i, a * i, f * i + 1, 0, s * e.d, a * e.d, f * e.d, 1, t), t;
  }
  /**
   * Sets the given matrix as a rotation matrix composed from the 3 left handed axes
   * @param xaxis defines the value of the 1st axis
   * @param yaxis defines the value of the 2nd axis
   * @param zaxis defines the value of the 3rd axis
   * @param result defines the target matrix
   * @returns result input
   */
  static FromXYZAxesToRef(e, t, r, n) {
    return he.FromValuesToRef(e._x, e._y, e._z, 0, t._x, t._y, t._z, 0, r._x, r._y, r._z, 0, 0, 0, 0, 1, n), n;
  }
  /**
   * Creates a rotation matrix from a quaternion and stores it in a target matrix
   * @param quat defines the quaternion to use
   * @param result defines the target matrix
   * @returns result input
   */
  static FromQuaternionToRef(e, t) {
    const r = e._x * e._x, n = e._y * e._y, i = e._z * e._z, s = e._x * e._y, a = e._z * e._w, f = e._z * e._x, o = e._y * e._w, d = e._y * e._z, v = e._x * e._w;
    return t._m[0] = 1 - 2 * (n + i), t._m[1] = 2 * (s + a), t._m[2] = 2 * (f - o), t._m[3] = 0, t._m[4] = 2 * (s - a), t._m[5] = 1 - 2 * (i + r), t._m[6] = 2 * (d + v), t._m[7] = 0, t._m[8] = 2 * (f + o), t._m[9] = 2 * (d - v), t._m[10] = 1 - 2 * (n + r), t._m[11] = 0, t._m[12] = 0, t._m[13] = 0, t._m[14] = 0, t._m[15] = 1, t.markAsUpdated(), t;
  }
}
he._UpdateFlagSeed = 0;
he._IdentityReadOnly = he.Identity();
class Kr {
}
Kr.Vector3 = Nf.BuildTuple(11, S.Zero);
Kr.Matrix = Nf.BuildTuple(2, he.Identity);
Kr.Quaternion = Nf.BuildTuple(3, Ze.Zero);
class ue {
}
ue.Vector2 = Nf.BuildTuple(3, at.Zero);
ue.Vector3 = Nf.BuildTuple(13, S.Zero);
ue.Vector4 = Nf.BuildTuple(3, Ir.Zero);
ue.Quaternion = Nf.BuildTuple(2, Ze.Zero);
ue.Matrix = Nf.BuildTuple(8, he.Identity);
Ue("BABYLON.Vector2", at);
Ue("BABYLON.Vector3", S);
Ue("BABYLON.Vector4", Ir);
Ue("BABYLON.Matrix", he);
const kw = he.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1);
function zW(A) {
  return Math.pow(A, xI);
}
function GW(A) {
  return A <= 0.04045 ? 0.0773993808 * A : Math.pow(0.947867299 * (A + 0.055), 2.4);
}
function ZW(A) {
  return Math.pow(A, JW);
}
function _W(A) {
  return A <= 31308e-7 ? 12.92 * A : 1.055 * Math.pow(A, 0.41666) - 0.055;
}
class Ne {
  /**
   * Creates a new Color3 object from red, green, blue values, all between 0 and 1
   * @param r defines the red component (between 0 and 1, default is 0)
   * @param g defines the green component (between 0 and 1, default is 0)
   * @param b defines the blue component (between 0 and 1, default is 0)
   */
  constructor(e = 0, t = 0, r = 0) {
    this.r = e, this.g = t, this.b = r;
  }
  /**
   * Creates a string with the Color3 current values
   * @returns the string representation of the Color3 object
   */
  toString() {
    return "{R: " + this.r + " G:" + this.g + " B:" + this.b + "}";
  }
  /**
   * Returns the string "Color3"
   * @returns "Color3"
   */
  getClassName() {
    return "Color3";
  }
  /**
   * Compute the Color3 hash code
   * @returns an unique number that can be used to hash Color3 objects
   */
  getHashCode() {
    let e = this.r * 255 | 0;
    return e = e * 397 ^ (this.g * 255 | 0), e = e * 397 ^ (this.b * 255 | 0), e;
  }
  // Operators
  /**
   * Stores in the given array from the given starting index the red, green, blue values as successive elements
   * @param array defines the array where to store the r,g,b components
   * @param index defines an optional index in the target array to define where to start storing values
   * @returns the current Color3 object
   */
  toArray(e, t = 0) {
    return e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, this;
  }
  /**
   * Update the current color with values stored in an array from the starting index of the given array
   * @param array defines the source array
   * @param offset defines an offset in the source array
   * @returns the current Color3 object
   */
  fromArray(e, t = 0) {
    return Ne.FromArrayToRef(e, t, this), this;
  }
  /**
   * Returns a new Color4 object from the current Color3 and the given alpha
   * @param alpha defines the alpha component on the new Color4 object (default is 1)
   * @returns a new Color4 object
   */
  toColor4(e = 1) {
    return new xt(this.r, this.g, this.b, e);
  }
  /**
   * Returns a new array populated with 3 numeric elements : red, green and blue values
   * @returns the new array
   */
  asArray() {
    return [this.r, this.g, this.b];
  }
  /**
   * Returns the luminance value
   * @returns a float value
   */
  toLuminance() {
    return this.r * 0.3 + this.g * 0.59 + this.b * 0.11;
  }
  /**
   * Multiply each Color3 rgb values by the given Color3 rgb values in a new Color3 object
   * @param otherColor defines the second operand
   * @returns the new Color3 object
   */
  multiply(e) {
    return new Ne(this.r * e.r, this.g * e.g, this.b * e.b);
  }
  /**
   * Multiply the rgb values of the Color3 and the given Color3 and stores the result in the object "result"
   * @param otherColor defines the second operand
   * @param result defines the Color3 object where to store the result
   * @returns the current Color3
   */
  multiplyToRef(e, t) {
    return t.r = this.r * e.r, t.g = this.g * e.g, t.b = this.b * e.b, this;
  }
  /**
   * Determines equality between Color3 objects
   * @param otherColor defines the second operand
   * @returns true if the rgb values are equal to the given ones
   */
  equals(e) {
    return e && this.r === e.r && this.g === e.g && this.b === e.b;
  }
  /**
   * Determines equality between the current Color3 object and a set of r,b,g values
   * @param r defines the red component to check
   * @param g defines the green component to check
   * @param b defines the blue component to check
   * @returns true if the rgb values are equal to the given ones
   */
  equalsFloats(e, t, r) {
    return this.r === e && this.g === t && this.b === r;
  }
  /**
   * Creates a new Color3 with the current Color3 values multiplied by scale
   * @param scale defines the scaling factor to apply
   * @returns a new Color3 object
   */
  scale(e) {
    return new Ne(this.r * e, this.g * e, this.b * e);
  }
  /**
   * Multiplies the Color3 values by the float "scale"
   * @param scale defines the scaling factor to apply
   * @returns the current updated Color3
   */
  scaleInPlace(e) {
    return this.r *= e, this.g *= e, this.b *= e, this;
  }
  /**
   * Multiplies the rgb values by scale and stores the result into "result"
   * @param scale defines the scaling factor
   * @param result defines the Color3 object where to store the result
   * @returns the unmodified current Color3
   */
  scaleToRef(e, t) {
    return t.r = this.r * e, t.g = this.g * e, t.b = this.b * e, this;
  }
  /**
   * Scale the current Color3 values by a factor and add the result to a given Color3
   * @param scale defines the scale factor
   * @param result defines color to store the result into
   * @returns the unmodified current Color3
   */
  scaleAndAddToRef(e, t) {
    return t.r += this.r * e, t.g += this.g * e, t.b += this.b * e, this;
  }
  /**
   * Clamps the rgb values by the min and max values and stores the result into "result"
   * @param min defines minimum clamping value (default is 0)
   * @param max defines maximum clamping value (default is 1)
   * @param result defines color to store the result into
   * @returns the original Color3
   */
  clampToRef(e = 0, t = 1, r) {
    return r.r = Xt.Clamp(this.r, e, t), r.g = Xt.Clamp(this.g, e, t), r.b = Xt.Clamp(this.b, e, t), this;
  }
  /**
   * Creates a new Color3 set with the added values of the current Color3 and of the given one
   * @param otherColor defines the second operand
   * @returns the new Color3
   */
  add(e) {
    return new Ne(this.r + e.r, this.g + e.g, this.b + e.b);
  }
  /**
   * Stores the result of the addition of the current Color3 and given one rgb values into "result"
   * @param otherColor defines the second operand
   * @param result defines Color3 object to store the result into
   * @returns the unmodified current Color3
   */
  addToRef(e, t) {
    return t.r = this.r + e.r, t.g = this.g + e.g, t.b = this.b + e.b, this;
  }
  /**
   * Returns a new Color3 set with the subtracted values of the given one from the current Color3
   * @param otherColor defines the second operand
   * @returns the new Color3
   */
  subtract(e) {
    return new Ne(this.r - e.r, this.g - e.g, this.b - e.b);
  }
  /**
   * Stores the result of the subtraction of given one from the current Color3 rgb values into "result"
   * @param otherColor defines the second operand
   * @param result defines Color3 object to store the result into
   * @returns the unmodified current Color3
   */
  subtractToRef(e, t) {
    return t.r = this.r - e.r, t.g = this.g - e.g, t.b = this.b - e.b, this;
  }
  /**
   * Copy the current object
   * @returns a new Color3 copied the current one
   */
  clone() {
    return new Ne(this.r, this.g, this.b);
  }
  /**
   * Copies the rgb values from the source in the current Color3
   * @param source defines the source Color3 object
   * @returns the updated Color3 object
   */
  copyFrom(e) {
    return this.r = e.r, this.g = e.g, this.b = e.b, this;
  }
  /**
   * Updates the Color3 rgb values from the given floats
   * @param r defines the red component to read from
   * @param g defines the green component to read from
   * @param b defines the blue component to read from
   * @returns the current Color3 object
   */
  copyFromFloats(e, t, r) {
    return this.r = e, this.g = t, this.b = r, this;
  }
  /**
   * Updates the Color3 rgb values from the given floats
   * @param r defines the red component to read from
   * @param g defines the green component to read from
   * @param b defines the blue component to read from
   * @returns the current Color3 object
   */
  set(e, t, r) {
    return this.copyFromFloats(e, t, r);
  }
  /**
   * Compute the Color3 hexadecimal code as a string
   * @returns a string containing the hexadecimal representation of the Color3 object
   */
  toHexString() {
    const e = Math.round(this.r * 255), t = Math.round(this.g * 255), r = Math.round(this.b * 255);
    return "#" + Xt.ToHex(e) + Xt.ToHex(t) + Xt.ToHex(r);
  }
  /**
   * Converts current color in rgb space to HSV values
   * @returns a new color3 representing the HSV values
   */
  toHSV() {
    const e = new Ne();
    return this.toHSVToRef(e), e;
  }
  /**
   * Converts current color in rgb space to HSV values
   * @param result defines the Color3 where to store the HSV values
   */
  toHSVToRef(e) {
    const t = this.r, r = this.g, n = this.b, i = Math.max(t, r, n), s = Math.min(t, r, n);
    let a = 0, f = 0;
    const o = i, d = i - s;
    i !== 0 && (f = d / i), i != s && (i == t ? (a = (r - n) / d, r < n && (a += 6)) : i == r ? a = (n - t) / d + 2 : i == n && (a = (t - r) / d + 4), a *= 60), e.r = a, e.g = f, e.b = o;
  }
  /**
   * Computes a new Color3 converted from the current one to linear space
   * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
   * @returns a new Color3 object
   */
  toLinearSpace(e = !1) {
    const t = new Ne();
    return this.toLinearSpaceToRef(t, e), t;
  }
  /**
   * Converts the Color3 values to linear space and stores the result in "convertedColor"
   * @param convertedColor defines the Color3 object where to store the linear space version
   * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
   * @returns the unmodified Color3
   */
  toLinearSpaceToRef(e, t = !1) {
    return t ? (e.r = GW(this.r), e.g = GW(this.g), e.b = GW(this.b)) : (e.r = zW(this.r), e.g = zW(this.g), e.b = zW(this.b)), this;
  }
  /**
   * Computes a new Color3 converted from the current one to gamma space
   * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
   * @returns a new Color3 object
   */
  toGammaSpace(e = !1) {
    const t = new Ne();
    return this.toGammaSpaceToRef(t, e), t;
  }
  /**
   * Converts the Color3 values to gamma space and stores the result in "convertedColor"
   * @param convertedColor defines the Color3 object where to store the gamma space version
   * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
   * @returns the unmodified Color3
   */
  toGammaSpaceToRef(e, t = !1) {
    return t ? (e.r = _W(this.r), e.g = _W(this.g), e.b = _W(this.b)) : (e.r = ZW(this.r), e.g = ZW(this.g), e.b = ZW(this.b)), this;
  }
  /**
   * Converts Hue, saturation and value to a Color3 (RGB)
   * @param hue defines the hue (value between 0 and 360)
   * @param saturation defines the saturation (value between 0 and 1)
   * @param value defines the value (value between 0 and 1)
   * @param result defines the Color3 where to store the RGB values
   */
  static HSVtoRGBToRef(e, t, r, n) {
    const i = r * t, s = e / 60, a = i * (1 - Math.abs(s % 2 - 1));
    let f = 0, o = 0, d = 0;
    s >= 0 && s <= 1 ? (f = i, o = a) : s >= 1 && s <= 2 ? (f = a, o = i) : s >= 2 && s <= 3 ? (o = i, d = a) : s >= 3 && s <= 4 ? (o = a, d = i) : s >= 4 && s <= 5 ? (f = a, d = i) : s >= 5 && s <= 6 && (f = i, d = a);
    const v = r - i;
    n.set(f + v, o + v, d + v);
  }
  /**
   * Converts Hue, saturation and value to a new Color3 (RGB)
   * @param hue defines the hue (value between 0 and 360)
   * @param saturation defines the saturation (value between 0 and 1)
   * @param value defines the value (value between 0 and 1)
   * @returns a new Color3 object
   */
  static FromHSV(e, t, r) {
    const n = new Ne(0, 0, 0);
    return Ne.HSVtoRGBToRef(e, t, r, n), n;
  }
  /**
   * Creates a new Color3 from the string containing valid hexadecimal values
   * @param hex defines a string containing valid hexadecimal values
   * @returns a new Color3 object
   */
  static FromHexString(e) {
    if (e.substring(0, 1) !== "#" || e.length !== 7)
      return new Ne(0, 0, 0);
    const t = parseInt(e.substring(1, 3), 16), r = parseInt(e.substring(3, 5), 16), n = parseInt(e.substring(5, 7), 16);
    return Ne.FromInts(t, r, n);
  }
  /**
   * Creates a new Color3 from the starting index of the given array
   * @param array defines the source array
   * @param offset defines an offset in the source array
   * @returns a new Color3 object
   */
  static FromArray(e, t = 0) {
    return new Ne(e[t], e[t + 1], e[t + 2]);
  }
  /**
   * Creates a new Color3 from the starting index element of the given array
   * @param array defines the source array to read from
   * @param offset defines the offset in the source array
   * @param result defines the target Color3 object
   */
  static FromArrayToRef(e, t = 0, r) {
    r.r = e[t], r.g = e[t + 1], r.b = e[t + 2];
  }
  /**
   * Creates a new Color3 from integer values (< 256)
   * @param r defines the red component to read from (value between 0 and 255)
   * @param g defines the green component to read from (value between 0 and 255)
   * @param b defines the blue component to read from (value between 0 and 255)
   * @returns a new Color3 object
   */
  static FromInts(e, t, r) {
    return new Ne(e / 255, t / 255, r / 255);
  }
  /**
   * Creates a new Color3 with values linearly interpolated of "amount" between the start Color3 and the end Color3
   * @param start defines the start Color3 value
   * @param end defines the end Color3 value
   * @param amount defines the gradient value between start and end
   * @returns a new Color3 object
   */
  static Lerp(e, t, r) {
    const n = new Ne(0, 0, 0);
    return Ne.LerpToRef(e, t, r, n), n;
  }
  /**
   * Creates a new Color3 with values linearly interpolated of "amount" between the start Color3 and the end Color3
   * @param left defines the start value
   * @param right defines the end value
   * @param amount defines the gradient factor
   * @param result defines the Color3 object where to store the result
   */
  static LerpToRef(e, t, r, n) {
    n.r = e.r + (t.r - e.r) * r, n.g = e.g + (t.g - e.g) * r, n.b = e.b + (t.b - e.b) * r;
  }
  /**
   * Returns a new Color3 located for "amount" (float) on the Hermite interpolation spline defined by the vectors "value1", "tangent1", "value2", "tangent2"
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent Color3
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent Color3
   * @param amount defines the amount on the interpolation spline (between 0 and 1)
   * @returns the new Color3
   */
  static Hermite(e, t, r, n, i) {
    const s = i * i, a = i * s, f = 2 * a - 3 * s + 1, o = -2 * a + 3 * s, d = a - 2 * s + i, v = a - s, u = e.r * f + r.r * o + t.r * d + n.r * v, l = e.g * f + r.g * o + t.g * d + n.g * v, P = e.b * f + r.b * o + t.b * d + n.b * v;
    return new Ne(u, l, P);
  }
  /**
   * Returns a new Color3 which is the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @returns 1st derivative
   */
  static Hermite1stDerivative(e, t, r, n, i) {
    const s = Ne.Black();
    return this.Hermite1stDerivativeToRef(e, t, r, n, i, s), s;
  }
  /**
   * Returns a new Color3 which is the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @param result define where to store the derivative
   */
  static Hermite1stDerivativeToRef(e, t, r, n, i, s) {
    const a = i * i;
    s.r = (a - i) * 6 * e.r + (3 * a - 4 * i + 1) * t.r + (-a + i) * 6 * r.r + (3 * a - 2 * i) * n.r, s.g = (a - i) * 6 * e.g + (3 * a - 4 * i + 1) * t.g + (-a + i) * 6 * r.g + (3 * a - 2 * i) * n.g, s.b = (a - i) * 6 * e.b + (3 * a - 4 * i + 1) * t.b + (-a + i) * 6 * r.b + (3 * a - 2 * i) * n.b;
  }
  /**
   * Returns a Color3 value containing a red color
   * @returns a new Color3 object
   */
  static Red() {
    return new Ne(1, 0, 0);
  }
  /**
   * Returns a Color3 value containing a green color
   * @returns a new Color3 object
   */
  static Green() {
    return new Ne(0, 1, 0);
  }
  /**
   * Returns a Color3 value containing a blue color
   * @returns a new Color3 object
   */
  static Blue() {
    return new Ne(0, 0, 1);
  }
  /**
   * Returns a Color3 value containing a black color
   * @returns a new Color3 object
   */
  static Black() {
    return new Ne(0, 0, 0);
  }
  /**
   * Gets a Color3 value containing a black color that must not be updated
   */
  static get BlackReadOnly() {
    return Ne._BlackReadOnly;
  }
  /**
   * Returns a Color3 value containing a white color
   * @returns a new Color3 object
   */
  static White() {
    return new Ne(1, 1, 1);
  }
  /**
   * Returns a Color3 value containing a purple color
   * @returns a new Color3 object
   */
  static Purple() {
    return new Ne(0.5, 0, 0.5);
  }
  /**
   * Returns a Color3 value containing a magenta color
   * @returns a new Color3 object
   */
  static Magenta() {
    return new Ne(1, 0, 1);
  }
  /**
   * Returns a Color3 value containing a yellow color
   * @returns a new Color3 object
   */
  static Yellow() {
    return new Ne(1, 1, 0);
  }
  /**
   * Returns a Color3 value containing a gray color
   * @returns a new Color3 object
   */
  static Gray() {
    return new Ne(0.5, 0.5, 0.5);
  }
  /**
   * Returns a Color3 value containing a teal color
   * @returns a new Color3 object
   */
  static Teal() {
    return new Ne(0, 1, 1);
  }
  /**
   * Returns a Color3 value containing a random color
   * @returns a new Color3 object
   */
  static Random() {
    return new Ne(Math.random(), Math.random(), Math.random());
  }
}
Ne._BlackReadOnly = Ne.Black();
class xt {
  /**
   * Creates a new Color4 object from red, green, blue values, all between 0 and 1
   * @param r defines the red component (between 0 and 1, default is 0)
   * @param g defines the green component (between 0 and 1, default is 0)
   * @param b defines the blue component (between 0 and 1, default is 0)
   * @param a defines the alpha component (between 0 and 1, default is 1)
   */
  constructor(e = 0, t = 0, r = 0, n = 1) {
    this.r = e, this.g = t, this.b = r, this.a = n;
  }
  // Operators
  /**
   * Adds in place the given Color4 values to the current Color4 object
   * @param right defines the second operand
   * @returns the current updated Color4 object
   */
  addInPlace(e) {
    return this.r += e.r, this.g += e.g, this.b += e.b, this.a += e.a, this;
  }
  /**
   * Creates a new array populated with 4 numeric elements : red, green, blue, alpha values
   * @returns the new array
   */
  asArray() {
    return [this.r, this.g, this.b, this.a];
  }
  /**
   * Stores from the starting index in the given array the Color4 successive values
   * @param array defines the array where to store the r,g,b components
   * @param index defines an optional index in the target array to define where to start storing values
   * @returns the current Color4 object
   */
  toArray(e, t = 0) {
    return e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e[t + 3] = this.a, this;
  }
  /**
   * Update the current color with values stored in an array from the starting index of the given array
   * @param array defines the source array
   * @param offset defines an offset in the source array
   * @returns the current Color4 object
   */
  fromArray(e, t = 0) {
    return xt.FromArrayToRef(e, t, this), this;
  }
  /**
   * Determines equality between Color4 objects
   * @param otherColor defines the second operand
   * @returns true if the rgba values are equal to the given ones
   */
  equals(e) {
    return e && this.r === e.r && this.g === e.g && this.b === e.b && this.a === e.a;
  }
  /**
   * Creates a new Color4 set with the added values of the current Color4 and of the given one
   * @param right defines the second operand
   * @returns a new Color4 object
   */
  add(e) {
    return new xt(this.r + e.r, this.g + e.g, this.b + e.b, this.a + e.a);
  }
  /**
   * Creates a new Color4 set with the subtracted values of the given one from the current Color4
   * @param right defines the second operand
   * @returns a new Color4 object
   */
  subtract(e) {
    return new xt(this.r - e.r, this.g - e.g, this.b - e.b, this.a - e.a);
  }
  /**
   * Subtracts the given ones from the current Color4 values and stores the results in "result"
   * @param right defines the second operand
   * @param result defines the Color4 object where to store the result
   * @returns the current Color4 object
   */
  subtractToRef(e, t) {
    return t.r = this.r - e.r, t.g = this.g - e.g, t.b = this.b - e.b, t.a = this.a - e.a, this;
  }
  /**
   * Creates a new Color4 with the current Color4 values multiplied by scale
   * @param scale defines the scaling factor to apply
   * @returns a new Color4 object
   */
  scale(e) {
    return new xt(this.r * e, this.g * e, this.b * e, this.a * e);
  }
  /**
   * Multiplies the Color4 values by the float "scale"
   * @param scale defines the scaling factor to apply
   * @returns the current updated Color4
   */
  scaleInPlace(e) {
    return this.r *= e, this.g *= e, this.b *= e, this.a *= e, this;
  }
  /**
   * Multiplies the current Color4 values by scale and stores the result in "result"
   * @param scale defines the scaling factor to apply
   * @param result defines the Color4 object where to store the result
   * @returns the current unmodified Color4
   */
  scaleToRef(e, t) {
    return t.r = this.r * e, t.g = this.g * e, t.b = this.b * e, t.a = this.a * e, this;
  }
  /**
   * Scale the current Color4 values by a factor and add the result to a given Color4
   * @param scale defines the scale factor
   * @param result defines the Color4 object where to store the result
   * @returns the unmodified current Color4
   */
  scaleAndAddToRef(e, t) {
    return t.r += this.r * e, t.g += this.g * e, t.b += this.b * e, t.a += this.a * e, this;
  }
  /**
   * Clamps the rgb values by the min and max values and stores the result into "result"
   * @param min defines minimum clamping value (default is 0)
   * @param max defines maximum clamping value (default is 1)
   * @param result defines color to store the result into.
   * @returns the current Color4
   */
  clampToRef(e = 0, t = 1, r) {
    return r.r = Xt.Clamp(this.r, e, t), r.g = Xt.Clamp(this.g, e, t), r.b = Xt.Clamp(this.b, e, t), r.a = Xt.Clamp(this.a, e, t), this;
  }
  /**
   * Multiply an Color4 value by another and return a new Color4 object
   * @param color defines the Color4 value to multiply by
   * @returns a new Color4 object
   */
  multiply(e) {
    return new xt(this.r * e.r, this.g * e.g, this.b * e.b, this.a * e.a);
  }
  /**
   * Multiply a Color4 value by another and push the result in a reference value
   * @param color defines the Color4 value to multiply by
   * @param result defines the Color4 to fill the result in
   * @returns the result Color4
   */
  multiplyToRef(e, t) {
    return t.r = this.r * e.r, t.g = this.g * e.g, t.b = this.b * e.b, t.a = this.a * e.a, t;
  }
  /**
   * Creates a string with the Color4 current values
   * @returns the string representation of the Color4 object
   */
  toString() {
    return "{R: " + this.r + " G:" + this.g + " B:" + this.b + " A:" + this.a + "}";
  }
  /**
   * Returns the string "Color4"
   * @returns "Color4"
   */
  getClassName() {
    return "Color4";
  }
  /**
   * Compute the Color4 hash code
   * @returns an unique number that can be used to hash Color4 objects
   */
  getHashCode() {
    let e = this.r * 255 | 0;
    return e = e * 397 ^ (this.g * 255 | 0), e = e * 397 ^ (this.b * 255 | 0), e = e * 397 ^ (this.a * 255 | 0), e;
  }
  /**
   * Creates a new Color4 copied from the current one
   * @returns a new Color4 object
   */
  clone() {
    return new xt(this.r, this.g, this.b, this.a);
  }
  /**
   * Copies the given Color4 values into the current one
   * @param source defines the source Color4 object
   * @returns the current updated Color4 object
   */
  copyFrom(e) {
    return this.r = e.r, this.g = e.g, this.b = e.b, this.a = e.a, this;
  }
  /**
   * Copies the given float values into the current one
   * @param r defines the red component to read from
   * @param g defines the green component to read from
   * @param b defines the blue component to read from
   * @param a defines the alpha component to read from
   * @returns the current updated Color4 object
   */
  copyFromFloats(e, t, r, n) {
    return this.r = e, this.g = t, this.b = r, this.a = n, this;
  }
  /**
   * Copies the given float values into the current one
   * @param r defines the red component to read from
   * @param g defines the green component to read from
   * @param b defines the blue component to read from
   * @param a defines the alpha component to read from
   * @returns the current updated Color4 object
   */
  set(e, t, r, n) {
    return this.copyFromFloats(e, t, r, n);
  }
  /**
   * Compute the Color4 hexadecimal code as a string
   * @param returnAsColor3 defines if the string should only contains RGB values (off by default)
   * @returns a string containing the hexadecimal representation of the Color4 object
   */
  toHexString(e = !1) {
    const t = Math.round(this.r * 255), r = Math.round(this.g * 255), n = Math.round(this.b * 255);
    if (e)
      return "#" + Xt.ToHex(t) + Xt.ToHex(r) + Xt.ToHex(n);
    const i = Math.round(this.a * 255);
    return "#" + Xt.ToHex(t) + Xt.ToHex(r) + Xt.ToHex(n) + Xt.ToHex(i);
  }
  /**
   * Computes a new Color4 converted from the current one to linear space
   * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
   * @returns a new Color4 object
   */
  toLinearSpace(e = !1) {
    const t = new xt();
    return this.toLinearSpaceToRef(t, e), t;
  }
  /**
   * Converts the Color4 values to linear space and stores the result in "convertedColor"
   * @param convertedColor defines the Color4 object where to store the linear space version
   * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
   * @returns the unmodified Color4
   */
  toLinearSpaceToRef(e, t = !1) {
    return t ? (e.r = GW(this.r), e.g = GW(this.g), e.b = GW(this.b)) : (e.r = zW(this.r), e.g = zW(this.g), e.b = zW(this.b)), e.a = this.a, this;
  }
  /**
   * Computes a new Color4 converted from the current one to gamma space
   * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
   * @returns a new Color4 object
   */
  toGammaSpace(e = !1) {
    const t = new xt();
    return this.toGammaSpaceToRef(t, e), t;
  }
  /**
   * Converts the Color4 values to gamma space and stores the result in "convertedColor"
   * @param convertedColor defines the Color4 object where to store the gamma space version
   * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
   * @returns the unmodified Color4
   */
  toGammaSpaceToRef(e, t = !1) {
    return t ? (e.r = _W(this.r), e.g = _W(this.g), e.b = _W(this.b)) : (e.r = ZW(this.r), e.g = ZW(this.g), e.b = ZW(this.b)), e.a = this.a, this;
  }
  // Statics
  /**
   * Creates a new Color4 from the string containing valid hexadecimal values.
   *
   * A valid hex string is either in the format #RRGGBB or #RRGGBBAA.
   *
   * When a hex string without alpha is passed, the resulting Color4 has
   * its alpha value set to 1.0.
   *
   * An invalid string results in a Color with all its channels set to 0.0,
   * i.e. "transparent black".
   *
   * @param hex defines a string containing valid hexadecimal values
   * @returns a new Color4 object
   */
  static FromHexString(e) {
    if (e.substring(0, 1) !== "#" || e.length !== 9 && e.length !== 7)
      return new xt(0, 0, 0, 0);
    const t = parseInt(e.substring(1, 3), 16), r = parseInt(e.substring(3, 5), 16), n = parseInt(e.substring(5, 7), 16), i = e.length === 9 ? parseInt(e.substring(7, 9), 16) : 255;
    return xt.FromInts(t, r, n, i);
  }
  /**
   * Creates a new Color4 object set with the linearly interpolated values of "amount" between the left Color4 object and the right Color4 object
   * @param left defines the start value
   * @param right defines the end value
   * @param amount defines the gradient factor
   * @returns a new Color4 object
   */
  static Lerp(e, t, r) {
    const n = new xt(0, 0, 0, 0);
    return xt.LerpToRef(e, t, r, n), n;
  }
  /**
   * Set the given "result" with the linearly interpolated values of "amount" between the left Color4 object and the right Color4 object
   * @param left defines the start value
   * @param right defines the end value
   * @param amount defines the gradient factor
   * @param result defines the Color4 object where to store data
   */
  static LerpToRef(e, t, r, n) {
    n.r = e.r + (t.r - e.r) * r, n.g = e.g + (t.g - e.g) * r, n.b = e.b + (t.b - e.b) * r, n.a = e.a + (t.a - e.a) * r;
  }
  /**
   * Interpolate between two Color4 using Hermite interpolation
   * @param value1 defines first Color4
   * @param tangent1 defines the incoming tangent
   * @param value2 defines second Color4
   * @param tangent2 defines the outgoing tangent
   * @param amount defines the target Color4
   * @returns the new interpolated Color4
   */
  static Hermite(e, t, r, n, i) {
    const s = i * i, a = i * s, f = 2 * a - 3 * s + 1, o = -2 * a + 3 * s, d = a - 2 * s + i, v = a - s, u = e.r * f + r.r * o + t.r * d + n.r * v, l = e.g * f + r.g * o + t.g * d + n.g * v, P = e.b * f + r.b * o + t.b * d + n.b * v, p = e.a * f + r.a * o + t.a * d + n.a * v;
    return new xt(u, l, P, p);
  }
  /**
   * Returns a new Color4 which is the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @returns 1st derivative
   */
  static Hermite1stDerivative(e, t, r, n, i) {
    const s = new xt();
    return this.Hermite1stDerivativeToRef(e, t, r, n, i, s), s;
  }
  /**
   * Update a Color4 with the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
   * @param value1 defines the first control point
   * @param tangent1 defines the first tangent
   * @param value2 defines the second control point
   * @param tangent2 defines the second tangent
   * @param time define where the derivative must be done
   * @param result define where to store the derivative
   */
  static Hermite1stDerivativeToRef(e, t, r, n, i, s) {
    const a = i * i;
    s.r = (a - i) * 6 * e.r + (3 * a - 4 * i + 1) * t.r + (-a + i) * 6 * r.r + (3 * a - 2 * i) * n.r, s.g = (a - i) * 6 * e.g + (3 * a - 4 * i + 1) * t.g + (-a + i) * 6 * r.g + (3 * a - 2 * i) * n.g, s.b = (a - i) * 6 * e.b + (3 * a - 4 * i + 1) * t.b + (-a + i) * 6 * r.b + (3 * a - 2 * i) * n.b, s.a = (a - i) * 6 * e.a + (3 * a - 4 * i + 1) * t.a + (-a + i) * 6 * r.a + (3 * a - 2 * i) * n.a;
  }
  /**
   * Creates a new Color4 from a Color3 and an alpha value
   * @param color3 defines the source Color3 to read from
   * @param alpha defines the alpha component (1.0 by default)
   * @returns a new Color4 object
   */
  static FromColor3(e, t = 1) {
    return new xt(e.r, e.g, e.b, t);
  }
  /**
   * Creates a new Color4 from the starting index element of the given array
   * @param array defines the source array to read from
   * @param offset defines the offset in the source array
   * @returns a new Color4 object
   */
  static FromArray(e, t = 0) {
    return new xt(e[t], e[t + 1], e[t + 2], e[t + 3]);
  }
  /**
   * Creates a new Color4 from the starting index element of the given array
   * @param array defines the source array to read from
   * @param offset defines the offset in the source array
   * @param result defines the target Color4 object
   */
  static FromArrayToRef(e, t = 0, r) {
    r.r = e[t], r.g = e[t + 1], r.b = e[t + 2], r.a = e[t + 3];
  }
  /**
   * Creates a new Color3 from integer values (< 256)
   * @param r defines the red component to read from (value between 0 and 255)
   * @param g defines the green component to read from (value between 0 and 255)
   * @param b defines the blue component to read from (value between 0 and 255)
   * @param a defines the alpha component to read from (value between 0 and 255)
   * @returns a new Color3 object
   */
  static FromInts(e, t, r, n) {
    return new xt(e / 255, t / 255, r / 255, n / 255);
  }
  /**
   * Check the content of a given array and convert it to an array containing RGBA data
   * If the original array was already containing count * 4 values then it is returned directly
   * @param colors defines the array to check
   * @param count defines the number of RGBA data to expect
   * @returns an array containing count * 4 values (RGBA)
   */
  static CheckColors4(e, t) {
    if (e.length === t * 3) {
      const r = [];
      for (let n = 0; n < e.length; n += 3) {
        const i = n / 3 * 4;
        r[i] = e[n], r[i + 1] = e[n + 1], r[i + 2] = e[n + 2], r[i + 3] = 1;
      }
      return r;
    }
    return e;
  }
}
class Hs {
}
Hs.Color3 = Nf.BuildArray(3, Ne.Black);
Hs.Color4 = Nf.BuildArray(3, () => new xt(0, 0, 0, 0));
Ue("BABYLON.Color3", Ne);
Ue("BABYLON.Color4", xt);
class wa {
  /**
   * Creates a new Action
   * @param triggerOptions the trigger, with or without parameters, for the action
   * @param condition an optional determinant of action
   */
  constructor(e, t) {
    this.triggerOptions = e, this.onBeforeExecuteObservable = new Oe(), e.parameter ? (this.trigger = e.trigger, this._triggerParameter = e.parameter) : e.trigger ? this.trigger = e.trigger : this.trigger = e, this._nextActiveAction = this, this._condition = t;
  }
  /**
   * Internal only
   * @internal
   */
  _prepare() {
  }
  /**
   * Gets the trigger parameter
   * @returns the trigger parameter
   */
  getTriggerParameter() {
    return this._triggerParameter;
  }
  /**
   * Sets the trigger parameter
   * @param value defines the new trigger parameter
   */
  setTriggerParameter(e) {
    this._triggerParameter = e;
  }
  /**
   * Internal only - Returns if the current condition allows to run the action
   * @internal
   */
  _evaluateConditionForCurrentFrame() {
    const e = this._condition;
    if (!e)
      return !0;
    const t = this._actionManager.getScene().getRenderId();
    return e._evaluationId !== t && (e._evaluationId = t, e._currentResult = e.isValid()), e._currentResult;
  }
  /**
   * Internal only - executes current action event
   * @internal
   */
  _executeCurrent(e) {
    this._evaluateConditionForCurrentFrame() && (this.onBeforeExecuteObservable.notifyObservers(this), this._nextActiveAction.execute(e), this.skipToNextActiveAction());
  }
  /**
   * Execute placeholder for child classes
   * @param evt optional action event
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  execute(e) {
  }
  /**
   * Skips to next active action
   */
  skipToNextActiveAction() {
    this._nextActiveAction._child ? (this._nextActiveAction._child._actionManager || (this._nextActiveAction._child._actionManager = this._actionManager), this._nextActiveAction = this._nextActiveAction._child) : this._nextActiveAction = this;
  }
  /**
   * Adds action to chain of actions, may be a DoNothingAction
   * @param action defines the next action to execute
   * @returns The action passed in
   * @see https://www.babylonjs-playground.com/#1T30HR#0
   */
  then(e) {
    return this._child = e, e._actionManager = this._actionManager, e._prepare(), e;
  }
  /**
   * Internal only
   * @internal
   */
  _getProperty(e) {
    return this._actionManager._getProperty(e);
  }
  /**
   * @internal
   */
  _getEffectiveTarget(e, t) {
    return this._actionManager._getEffectiveTarget(e, t);
  }
  /**
   * Serialize placeholder for child classes
   * @param parent of child
   * @returns the serialized object
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  serialize(e) {
  }
  /**
   * Internal only called by serialize
   * @internal
   */
  _serialize(e, t) {
    const r = {
      type: 1,
      children: [],
      name: e.name,
      properties: e.properties || []
    };
    if (this._child && this._child.serialize(r), this._condition) {
      const n = this._condition.serialize();
      return n.children.push(r), t && t.children.push(n), n;
    }
    return t && t.children.push(r), r;
  }
}
wa._SerializeValueAsString = (A) => typeof A == "number" ? A.toString() : typeof A == "boolean" ? A ? "true" : "false" : A instanceof at ? A.x + ", " + A.y : A instanceof S ? A.x + ", " + A.y + ", " + A.z : A instanceof Ne ? A.r + ", " + A.g + ", " + A.b : A instanceof xt ? A.r + ", " + A.g + ", " + A.b + ", " + A.a : A;
wa._GetTargetProperty = (A) => ({
  name: "target",
  targetType: A._isMesh ? "MeshProperties" : A._isLight ? "LightProperties" : A._isCamera ? "CameraProperties" : A._isMaterial ? "MaterialProperties" : "SceneProperties",
  value: A._isScene ? "Scene" : A.name
});
Ue("BABYLON.Action", wa);
class mo {
  /**
   * Creates a new ActionEvent
   * @param source The mesh or sprite that triggered the action
   * @param pointerX The X mouse cursor position at the time of the event
   * @param pointerY The Y mouse cursor position at the time of the event
   * @param meshUnderPointer The mesh that is currently pointed at (can be null)
   * @param sourceEvent the original (browser) event that triggered the ActionEvent
   * @param additionalData additional data for the event
   */
  constructor(e, t, r, n, i, s) {
    this.source = e, this.pointerX = t, this.pointerY = r, this.meshUnderPointer = n, this.sourceEvent = i, this.additionalData = s;
  }
  /**
   * Helper function to auto-create an ActionEvent from a source mesh.
   * @param source The source mesh that triggered the event
   * @param evt The original (browser) event
   * @param additionalData additional data for the event
   * @returns the new ActionEvent
   */
  static CreateNew(e, t, r) {
    const n = e.getScene();
    return new mo(e, n.pointerX, n.pointerY, n.meshUnderPointer || e, t, r);
  }
  /**
   * Helper function to auto-create an ActionEvent from a source sprite
   * @param source The source sprite that triggered the event
   * @param scene Scene associated with the sprite
   * @param evt The original (browser) event
   * @param additionalData additional data for the event
   * @returns the new ActionEvent
   */
  static CreateNewFromSprite(e, t, r, n) {
    return new mo(e, t.pointerX, t.pointerY, t.meshUnderPointer, r, n);
  }
  /**
   * Helper function to auto-create an ActionEvent from a scene. If triggered by a mesh use ActionEvent.CreateNew
   * @param scene the scene where the event occurred
   * @param evt The original (browser) event
   * @returns the new ActionEvent
   */
  static CreateNewFromScene(e, t) {
    return new mo(null, e.pointerX, e.pointerY, e.meshUnderPointer, t);
  }
  /**
   * Helper function to auto-create an ActionEvent from a primitive
   * @param prim defines the target primitive
   * @param pointerPos defines the pointer position
   * @param evt The original (browser) event
   * @param additionalData additional data for the event
   * @returns the new ActionEvent
   */
  static CreateNewFromPrimitive(e, t, r, n) {
    return new mo(e, t.x, t.y, null, r, n);
  }
}
class DS {
  /**
   * Creates a new Condition
   * @param actionManager the manager of the action the condition is applied to
   */
  constructor(e) {
    this._actionManager = e;
  }
  /**
   * Check if the current condition is valid
   * @returns a boolean
   */
  isValid() {
    return !0;
  }
  /**
   * @internal
   */
  _getProperty(e) {
    return this._actionManager._getProperty(e);
  }
  /**
   * @internal
   */
  _getEffectiveTarget(e, t) {
    return this._actionManager._getEffectiveTarget(e, t);
  }
  /**
   * Serialize placeholder for child classes
   * @returns the serialized object
   */
  serialize() {
  }
  /**
   * @internal
   */
  _serialize(e) {
    return {
      type: 2,
      children: [],
      name: e.name,
      properties: e.properties
    };
  }
}
class C9 extends DS {
  /**
   * returns the number for IsEqual
   */
  static get IsEqual() {
    return C9._IsEqual;
  }
  /**
   * Returns the number for IsDifferent
   */
  static get IsDifferent() {
    return C9._IsDifferent;
  }
  /**
   * Returns the number for IsGreater
   */
  static get IsGreater() {
    return C9._IsGreater;
  }
  /**
   * Returns the number for IsLesser
   */
  static get IsLesser() {
    return C9._IsLesser;
  }
  /**
   * Creates a new ValueCondition
   * @param actionManager manager for the action the condition applies to
   * @param target for the action
   * @param propertyPath path to specify the property of the target the conditional operator uses
   * @param value the value compared by the conditional operator against the current value of the property
   * @param operator the conditional operator, default ValueCondition.IsEqual
   */
  constructor(e, t, r, n, i = C9.IsEqual) {
    super(e), this.propertyPath = r, this.value = n, this.operator = i, this._target = t, this._effectiveTarget = this._getEffectiveTarget(t, this.propertyPath), this._property = this._getProperty(this.propertyPath);
  }
  /**
   * Compares the given value with the property value for the specified conditional operator
   * @returns the result of the comparison
   */
  isValid() {
    switch (this.operator) {
      case C9.IsGreater:
        return this._effectiveTarget[this._property] > this.value;
      case C9.IsLesser:
        return this._effectiveTarget[this._property] < this.value;
      case C9.IsEqual:
      case C9.IsDifferent: {
        let e;
        return this.value.equals ? e = this.value.equals(this._effectiveTarget[this._property]) : e = this.value === this._effectiveTarget[this._property], this.operator === C9.IsEqual ? e : !e;
      }
    }
    return !1;
  }
  /**
   * Serialize the ValueCondition into a JSON compatible object
   * @returns serialization object
   */
  serialize() {
    return this._serialize({
      name: "ValueCondition",
      properties: [
        wa._GetTargetProperty(this._target),
        { name: "propertyPath", value: this.propertyPath },
        { name: "value", value: wa._SerializeValueAsString(this.value) },
        { name: "operator", value: C9.GetOperatorName(this.operator) }
      ]
    });
  }
  /**
   * Gets the name of the conditional operator for the ValueCondition
   * @param operator the conditional operator
   * @returns the name
   */
  static GetOperatorName(e) {
    switch (e) {
      case C9._IsEqual:
        return "IsEqual";
      case C9._IsDifferent:
        return "IsDifferent";
      case C9._IsGreater:
        return "IsGreater";
      case C9._IsLesser:
        return "IsLesser";
      default:
        return "";
    }
  }
}
C9._IsEqual = 0;
C9._IsDifferent = 1;
C9._IsGreater = 2;
C9._IsLesser = 3;
class H$ extends DS {
  /**
   * Creates a new PredicateCondition
   * @param actionManager manager for the action the condition applies to
   * @param predicate defines the predicate function used to validate the condition
   */
  constructor(e, t) {
    super(e), this.predicate = t;
  }
  /**
   * @returns the validity of the predicate condition
   */
  isValid() {
    return this.predicate();
  }
}
class g$ extends DS {
  /**
   * Creates a new StateCondition
   * @param actionManager manager for the action the condition applies to
   * @param target of the condition
   * @param value to compare with target state
   */
  constructor(e, t, r) {
    super(e), this.value = r, this._target = t;
  }
  /**
   * Gets a boolean indicating if the current condition is met
   * @returns the validity of the state
   */
  isValid() {
    return this._target.state === this.value;
  }
  /**
   * Serialize the StateCondition into a JSON compatible object
   * @returns serialization object
   */
  serialize() {
    return this._serialize({
      name: "StateCondition",
      properties: [wa._GetTargetProperty(this._target), { name: "value", value: this.value }]
    });
  }
}
Ue("BABYLON.ValueCondition", C9);
Ue("BABYLON.PredicateCondition", H$);
Ue("BABYLON.StateCondition", g$);
class Se {
  static _CheckLimit(e, t) {
    let r = Se._LogLimitOutputs[e];
    return r ? r.current++ : (r = { limit: t, current: 1 }, Se._LogLimitOutputs[e] = r), r.current <= r.limit;
  }
  static _GenerateLimitMessage(e, t = 1) {
    var r;
    const n = Se._LogLimitOutputs[e];
    if (!n || !Se.MessageLimitReached)
      return;
    const i = this._Levels[t];
    n.current === n.limit && Se[i.name](Se.MessageLimitReached.replace(/%LIMIT%/g, "" + n.limit).replace(/%TYPE%/g, (r = i.name) !== null && r !== void 0 ? r : ""));
  }
  static _AddLogEntry(e) {
    Se._LogCache = e + Se._LogCache, Se.OnNewCacheEntry && Se.OnNewCacheEntry(e);
  }
  static _FormatMessage(e) {
    const t = (n) => n < 10 ? "0" + n : "" + n, r = /* @__PURE__ */ new Date();
    return "[" + t(r.getHours()) + ":" + t(r.getMinutes()) + ":" + t(r.getSeconds()) + "]: " + e;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static _LogDisabled(e, t) {
  }
  static _LogEnabled(e = 1, t, r) {
    if (r !== void 0 && !Se._CheckLimit(t, r))
      return;
    const n = Se._FormatMessage(t), i = this._Levels[e];
    i.logFunc && i.logFunc("BJS - " + n);
    const s = `<div style='color:${i.color}'>${n}</div><br>`;
    Se._AddLogEntry(s), Se._GenerateLimitMessage(t, e);
  }
  /**
   * Gets current log cache (list of logs)
   */
  static get LogCache() {
    return Se._LogCache;
  }
  /**
   * Clears the log cache
   */
  static ClearLogCache() {
    Se._LogCache = "", Se._LogLimitOutputs = {}, Se.errorsCount = 0;
  }
  /**
   * Sets the current log level (MessageLogLevel / WarningLogLevel / ErrorLogLevel)
   */
  static set LogLevels(e) {
    Se.Log = Se._LogDisabled, Se.Warn = Se._LogDisabled, Se.Error = Se._LogDisabled, [Se.MessageLogLevel, Se.WarningLogLevel, Se.ErrorLogLevel].forEach((t) => {
      if ((e & t) === t) {
        const r = this._Levels[t];
        Se[r.name] = Se._LogEnabled.bind(Se, t);
      }
    });
  }
}
Se.NoneLogLevel = 0;
Se.MessageLogLevel = 1;
Se.WarningLogLevel = 2;
Se.ErrorLogLevel = 4;
Se.AllLogLevel = 7;
Se.MessageLimitReached = "Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.";
Se._LogCache = "";
Se._LogLimitOutputs = {};
Se._Levels = [
  {},
  { color: "white", logFunc: console.log, name: "Log" },
  { color: "orange", logFunc: console.warn, name: "Warn" },
  {},
  { color: "red", logFunc: console.error, name: "Error" }
];
Se.errorsCount = 0;
Se.Log = Se._LogEnabled.bind(Se, Se.MessageLogLevel);
Se.Warn = Se._LogEnabled.bind(Se, Se.WarningLogLevel);
Se.Error = Se._LogEnabled.bind(Se, Se.ErrorLogLevel);
class X$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param target defines the object containing the boolean
   * @param propertyPath defines the path to the boolean property in the target object
   * @param condition defines the trigger related conditions
   */
  constructor(e, t, r, n) {
    super(e, n), this.propertyPath = r, this._target = this._effectiveTarget = t;
  }
  /** @internal */
  _prepare() {
    this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);
  }
  /**
   * Execute the action toggle the boolean value.
   */
  execute() {
    this._effectiveTarget[this._property] = !this._effectiveTarget[this._property];
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "SwitchBooleanAction",
      properties: [wa._GetTargetProperty(this._target), { name: "propertyPath", value: this.propertyPath }]
    }, e);
  }
}
class T$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param target defines the object containing the state property
   * @param value defines the value to store in the state field
   * @param condition defines the trigger related conditions
   */
  constructor(e, t, r, n) {
    super(e, n), this.value = r, this._target = t;
  }
  /**
   * Execute the action and store the value on the target state property.
   */
  execute() {
    this._target.state = this.value;
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "SetStateAction",
      properties: [wa._GetTargetProperty(this._target), { name: "value", value: this.value }]
    }, e);
  }
}
class q$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param target defines the object containing the property
   * @param propertyPath defines the path of the property to set in the target
   * @param value defines the value to set in the property
   * @param condition defines the trigger related conditions
   */
  constructor(e, t, r, n, i) {
    super(e, i), this.propertyPath = r, this.value = n, this._target = this._effectiveTarget = t;
  }
  /** @internal */
  _prepare() {
    this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);
  }
  /**
   * Execute the action and set the targeted property to the desired value.
   */
  execute() {
    this._effectiveTarget[this._property] = this.value, this._target.markAsDirty && this._target.markAsDirty(this._property);
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "SetValueAction",
      properties: [
        wa._GetTargetProperty(this._target),
        { name: "propertyPath", value: this.propertyPath },
        { name: "value", value: wa._SerializeValueAsString(this.value) }
      ]
    }, e);
  }
}
class b$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param target defines the object containing the property
   * @param propertyPath defines the path of the property to increment in the target
   * @param value defines the value value we should increment the property by
   * @param condition defines the trigger related conditions
   */
  constructor(e, t, r, n, i) {
    super(e, i), this.propertyPath = r, this.value = n, this._target = this._effectiveTarget = t;
  }
  /** @internal */
  _prepare() {
    this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath), typeof this._effectiveTarget[this._property] != "number" && Se.Warn("Warning: IncrementValueAction can only be used with number values");
  }
  /**
   * Execute the action and increment the target of the value amount.
   */
  execute() {
    this._effectiveTarget[this._property] += this.value, this._target.markAsDirty && this._target.markAsDirty(this._property);
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "IncrementValueAction",
      properties: [
        wa._GetTargetProperty(this._target),
        { name: "propertyPath", value: this.propertyPath },
        { name: "value", value: wa._SerializeValueAsString(this.value) }
      ]
    }, e);
  }
}
class x$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param target defines the target animation or animation name
   * @param from defines from where the animation should start (animation frame)
   * @param to defines where the animation should stop (animation frame)
   * @param loop defines if the animation should loop or stop after the first play
   * @param condition defines the trigger related conditions
   */
  constructor(e, t, r, n, i, s) {
    super(e, s), this.from = r, this.to = n, this.loop = i, this._target = t;
  }
  /** @internal */
  _prepare() {
  }
  /**
   * Execute the action and play the animation.
   */
  execute() {
    this._actionManager.getScene().beginAnimation(this._target, this.from, this.to, this.loop);
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "PlayAnimationAction",
      properties: [
        wa._GetTargetProperty(this._target),
        { name: "from", value: String(this.from) },
        { name: "to", value: String(this.to) },
        { name: "loop", value: wa._SerializeValueAsString(this.loop) || !1 }
      ]
    }, e);
  }
}
class D$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param target defines the target animation or animation name
   * @param condition defines the trigger related conditions
   */
  constructor(e, t, r) {
    super(e, r), this._target = t;
  }
  /** @internal */
  _prepare() {
  }
  /**
   * Execute the action and stop the animation.
   */
  execute() {
    this._actionManager.getScene().stopAnimation(this._target);
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "StopAnimationAction",
      properties: [wa._GetTargetProperty(this._target)]
    }, e);
  }
}
class RN extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param condition defines the trigger related conditions
   */
  constructor(e = 0, t) {
    super(e, t);
  }
  /**
   * Execute the action and do nothing.
   */
  execute() {
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "DoNothingAction",
      properties: []
    }, e);
  }
}
class j$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param children defines the list of aggregated animations to run
   * @param condition defines the trigger related conditions
   * @param enableChildrenConditions defines if the children actions conditions should be check before execution
   */
  constructor(e, t, r, n = !0) {
    super(e, r), this.children = t, this.enableChildrenConditions = n;
  }
  /** @internal */
  _prepare() {
    for (let e = 0; e < this.children.length; e++)
      this.children[e]._actionManager = this._actionManager, this.children[e]._prepare();
  }
  /**
   * Execute the action and executes all the aggregated actions.
   * @param evt
   */
  execute(e) {
    for (const t of this.children)
      (!this.enableChildrenConditions || t._evaluateConditionForCurrentFrame()) && t.execute(e);
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    const t = super._serialize({
      name: "CombineAction",
      properties: [],
      combine: []
    }, e);
    for (let r = 0; r < this.children.length; r++)
      t.combine.push(this.children[r].serialize(null));
    return t;
  }
}
class w$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param func defines the callback function to run
   * @param condition defines the trigger related conditions
   */
  constructor(e, t, r) {
    super(e, r), this.func = t;
  }
  /**
   * Execute the action and run the attached code.
   * @param evt
   */
  execute(e) {
    this.func(e);
  }
}
class VN extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param target defines the target containing the parent property
   * @param parent defines from where the animation should start (animation frame)
   * @param condition defines the trigger related conditions
   */
  constructor(e, t, r, n) {
    super(e, n), this._target = t, this._parent = r;
  }
  /** @internal */
  _prepare() {
  }
  /**
   * Execute the action and set the parent property.
   */
  execute() {
    if (this._target.parent === this._parent)
      return;
    const e = this._parent.getWorldMatrix().clone();
    e.invert(), this._target.position = S.TransformCoordinates(this._target.position, e), this._target.parent = this._parent;
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "SetParentAction",
      properties: [wa._GetTargetProperty(this._target), wa._GetTargetProperty(this._parent)]
    }, e);
  }
}
Ue("BABYLON.SetParentAction", VN);
Ue("BABYLON.ExecuteCodeAction", w$);
Ue("BABYLON.DoNothingAction", RN);
Ue("BABYLON.StopAnimationAction", D$);
Ue("BABYLON.PlayAnimationAction", x$);
Ue("BABYLON.IncrementValueAction", b$);
Ue("BABYLON.SetValueAction", q$);
Ue("BABYLON.SetStateAction", T$);
Ue("BABYLON.SetParentAction", VN);
Ue("BABYLON.SwitchBooleanAction", X$);
Ue("BABYLON.CombineAction", j$);
const iG = (A, e, t) => !A || A.getClassName && A.getClassName() === "Mesh" ? null : A.getClassName && (A.getClassName() === "SubMesh" || A.getClassName() === "PhysicsBody") ? A.clone(e) : A.clone ? A.clone() : Array.isArray(A) ? A.slice() : t && typeof A == "object" ? Object.assign({}, A) : null;
function m9e(A) {
  const e = [];
  do
    Object.getOwnPropertyNames(A).forEach(function(t) {
      e.indexOf(t) === -1 && e.push(t);
    });
  while (A = Object.getPrototypeOf(A));
  return e;
}
class sA {
  /**
   * Tries to copy an object by duplicating every property
   * @param source defines the source object
   * @param destination defines the target object
   * @param doNotCopyList defines a list of properties to avoid
   * @param mustCopyList defines a list of properties to copy (even if they start with _)
   * @param shallowCopyValues defines wether properties referencing objects (none cloneable) must be shallow copied (false by default)
   * @remarks shallowCopyValues will not instantite the copied values which makes it only usable for "JSON objects"
   */
  static DeepCopy(e, t, r, n, i = !1) {
    const s = m9e(e);
    for (const a of s) {
      if (a[0] === "_" && (!n || n.indexOf(a) === -1) || a.endsWith("Observable") || r && r.indexOf(a) !== -1)
        continue;
      const f = e[a], o = typeof f;
      if (o !== "function")
        try {
          if (o === "object")
            if (f instanceof Uint8Array)
              t[a] = Uint8Array.from(f);
            else if (f instanceof Array) {
              if (t[a] = [], f.length > 0)
                if (typeof f[0] == "object")
                  for (let d = 0; d < f.length; d++) {
                    const v = iG(f[d], t, i);
                    t[a].indexOf(v) === -1 && t[a].push(v);
                  }
                else
                  t[a] = f.slice(0);
            } else
              t[a] = iG(f, t, i);
          else
            t[a] = f;
        } catch (d) {
          Se.Warn(d.message);
        }
    }
  }
}
class Rs extends Ml {
  /**
   * Creates a new action manager
   * @param scene defines the hosting scene
   */
  constructor(e) {
    super(), e = e || gr.LastCreatedScene, e && (this._scene = e, e.actionManagers.push(this));
  }
  // Methods
  /**
   * Releases all associated resources
   */
  dispose() {
    const e = this._scene.actionManagers.indexOf(this);
    for (let r = 0; r < this.actions.length; r++) {
      const n = this.actions[r];
      Rs.Triggers[n.trigger]--, Rs.Triggers[n.trigger] === 0 && delete Rs.Triggers[n.trigger];
    }
    this.actions.length = 0, e > -1 && this._scene.actionManagers.splice(e, 1);
    const t = this._scene.meshes.filter((r) => r.actionManager === this);
    for (const r of t)
      r.actionManager = null;
  }
  /**
   * Gets hosting scene
   * @returns the hosting scene
   */
  getScene() {
    return this._scene;
  }
  /**
   * Does this action manager handles actions of any of the given triggers
   * @param triggers defines the triggers to be tested
   * @returns a boolean indicating whether one (or more) of the triggers is handled
   */
  hasSpecificTriggers(e) {
    for (let t = 0; t < this.actions.length; t++) {
      const r = this.actions[t];
      if (e.indexOf(r.trigger) > -1)
        return !0;
    }
    return !1;
  }
  /**
   * Does this action manager handles actions of any of the given triggers. This function takes two arguments for
   * speed.
   * @param triggerA defines the trigger to be tested
   * @param triggerB defines the trigger to be tested
   * @returns a boolean indicating whether one (or more) of the triggers is handled
   */
  hasSpecificTriggers2(e, t) {
    for (let r = 0; r < this.actions.length; r++) {
      const n = this.actions[r];
      if (e == n.trigger || t == n.trigger)
        return !0;
    }
    return !1;
  }
  /**
   * Does this action manager handles actions of a given trigger
   * @param trigger defines the trigger to be tested
   * @param parameterPredicate defines an optional predicate to filter triggers by parameter
   * @returns whether the trigger is handled
   */
  hasSpecificTrigger(e, t) {
    for (let r = 0; r < this.actions.length; r++) {
      const n = this.actions[r];
      if (n.trigger === e)
        if (t) {
          if (t(n.getTriggerParameter()))
            return !0;
        } else
          return !0;
    }
    return !1;
  }
  /**
   * Does this action manager has pointer triggers
   */
  get hasPointerTriggers() {
    for (let e = 0; e < this.actions.length; e++) {
      const t = this.actions[e];
      if (t.trigger >= Rs.OnPickTrigger && t.trigger <= Rs.OnPointerOutTrigger)
        return !0;
    }
    return !1;
  }
  /**
   * Does this action manager has pick triggers
   */
  get hasPickTriggers() {
    for (let e = 0; e < this.actions.length; e++) {
      const t = this.actions[e];
      if (t.trigger >= Rs.OnPickTrigger && t.trigger <= Rs.OnPickUpTrigger)
        return !0;
    }
    return !1;
  }
  /**
   * Registers an action to this action manager
   * @param action defines the action to be registered
   * @returns the action amended (prepared) after registration
   */
  registerAction(e) {
    return e.trigger === Rs.OnEveryFrameTrigger && this.getScene().actionManager !== this ? (Se.Warn("OnEveryFrameTrigger can only be used with scene.actionManager"), null) : (this.actions.push(e), this.getScene()._registeredActions++, Rs.Triggers[e.trigger] ? Rs.Triggers[e.trigger]++ : Rs.Triggers[e.trigger] = 1, e._actionManager = this, e._prepare(), e);
  }
  /**
   * Unregisters an action to this action manager
   * @param action defines the action to be unregistered
   * @returns a boolean indicating whether the action has been unregistered
   */
  unregisterAction(e) {
    const t = this.actions.indexOf(e);
    return t !== -1 ? (this.actions.splice(t, 1), Rs.Triggers[e.trigger] -= 1, Rs.Triggers[e.trigger] === 0 && delete Rs.Triggers[e.trigger], e._actionManager = null, this.getScene()._registeredActions--, !0) : !1;
  }
  /**
   * Process a specific trigger
   * @param trigger defines the trigger to process
   * @param evt defines the event details to be processed
   */
  processTrigger(e, t) {
    for (let r = 0; r < this.actions.length; r++) {
      const n = this.actions[r];
      if (n.trigger === e) {
        if (t && (e === Rs.OnKeyUpTrigger || e === Rs.OnKeyDownTrigger)) {
          const i = n.getTriggerParameter();
          if (typeof i == "function") {
            if (!i(t))
              continue;
          } else if (i && i !== t.sourceEvent.keyCode) {
            if (!i.toLowerCase)
              continue;
            const s = i.toLowerCase();
            if (s !== t.sourceEvent.key) {
              const a = t.sourceEvent.charCode ? t.sourceEvent.charCode : t.sourceEvent.keyCode;
              if (String.fromCharCode(a).toLowerCase() !== s)
                continue;
            }
          }
        }
        n._executeCurrent(t);
      }
    }
  }
  /**
   * @internal
   */
  _getEffectiveTarget(e, t) {
    const r = t.split(".");
    for (let n = 0; n < r.length - 1; n++)
      e = e[r[n]];
    return e;
  }
  /**
   * @internal
   */
  _getProperty(e) {
    const t = e.split(".");
    return t[t.length - 1];
  }
  /**
   * Serialize this manager to a JSON object
   * @param name defines the property name to store this manager
   * @returns a JSON representation of this manager
   */
  serialize(e) {
    const t = {
      children: new Array(),
      name: e,
      type: 3,
      properties: new Array()
      // Empty for root but required
    };
    for (let r = 0; r < this.actions.length; r++) {
      const n = {
        type: 0,
        children: new Array(),
        name: Rs.GetTriggerName(this.actions[r].trigger),
        properties: new Array()
      }, i = this.actions[r].triggerOptions;
      if (i && typeof i != "number")
        if (i.parameter instanceof Node)
          n.properties.push(wa._GetTargetProperty(i.parameter));
        else if (typeof i.parameter == "object") {
          const s = {};
          sA.DeepCopy(i.parameter, s, ["mesh"]), i.parameter && i.parameter.mesh && (s._meshId = i.parameter.mesh.id), n.properties.push({ name: "parameter", targetType: null, value: s });
        } else
          n.properties.push({ name: "parameter", targetType: null, value: i.parameter });
      this.actions[r].serialize(n), t.children.push(n);
    }
    return t;
  }
  /**
   * Creates a new ActionManager from a JSON data
   * @param parsedActions defines the JSON data to read from
   * @param object defines the hosting mesh
   * @param scene defines the hosting scene
   */
  static Parse(e, t, r) {
    const n = new Rs(r);
    t === null ? r.actionManager = n : t.actionManager = n;
    const i = (f, o) => {
      const d = Jo("BABYLON." + f);
      return d && new d(...o);
    }, s = (f, o, d, v) => {
      if (v === null) {
        const p = parseFloat(o);
        return o === "true" || o === "false" ? o === "true" : isNaN(p) ? o : p;
      }
      const u = v.split("."), l = o.split(",");
      for (let p = 0; p < u.length; p++)
        d = d[u[p]];
      if (typeof d == "boolean")
        return l[0] === "true";
      if (typeof d == "string")
        return l[0];
      const P = [];
      for (let p = 0; p < l.length; p++)
        P.push(parseFloat(l[p]));
      return d instanceof S ? S.FromArray(P) : d instanceof Ir ? Ir.FromArray(P) : d instanceof Ne ? Ne.FromArray(P) : d instanceof xt ? xt.FromArray(P) : parseFloat(l[0]);
    }, a = (f, o, d, v, u = null) => {
      if (f.detached)
        return;
      const l = [];
      let P = null, p = null;
      const c = f.combine && f.combine.length > 0;
      if (f.type === 2 ? l.push(n) : l.push(o), c) {
        const T = [];
        for (let q = 0; q < f.combine.length; q++)
          a(f.combine[q], Rs.NothingTrigger, d, v, T);
        l.push(T);
      } else
        for (let T = 0; T < f.properties.length; T++) {
          let q = f.properties[T].value;
          const b = f.properties[T].name, j = f.properties[T].targetType;
          b === "target" ? j === "SceneProperties" ? q = P = r : j === "MaterialProperties" ? q = P = r.getMaterialByName(q) : q = P = r.getNodeByName(q) : b === "parent" ? q = r.getNodeByName(q) : b === "sound" ? r.getSoundByName && (q = r.getSoundByName(q)) : b !== "propertyPath" ? f.type === 2 && b === "operator" ? q = C9[q] : q = s(b, q, P, b === "value" ? p : null) : p = q, l.push(q);
        }
      if (u === null ? l.push(d) : l.push(null), f.name === "InterpolateValueAction") {
        const T = l[l.length - 2];
        l[l.length - 1] = T, l[l.length - 2] = d;
      }
      let H = i(f.name, l);
      if (H instanceof DS && d !== null) {
        const T = new RN(o, d);
        v ? v.then(T) : n.registerAction(T), v = T;
      }
      u === null ? H instanceof DS ? (d = H, H = v) : (d = null, v ? v.then(H) : n.registerAction(H)) : u.push(H);
      for (let T = 0; T < f.children.length; T++)
        a(f.children[T], o, d, H, null);
    };
    for (let f = 0; f < e.children.length; f++) {
      let o;
      const d = e.children[f];
      if (d.properties.length > 0) {
        const v = d.properties[0].value, u = d.properties[0].targetType === null ? v : r.getMeshByName(v);
        u._meshId && (u.mesh = r.getMeshById(u._meshId)), o = { trigger: Rs[d.name], parameter: u };
      } else
        o = Rs[d.name];
      for (let v = 0; v < d.children.length; v++)
        d.detached || a(d.children[v], o, null, null);
    }
  }
  /**
   * Get a trigger name by index
   * @param trigger defines the trigger index
   * @returns a trigger name
   */
  static GetTriggerName(e) {
    switch (e) {
      case 0:
        return "NothingTrigger";
      case 1:
        return "OnPickTrigger";
      case 2:
        return "OnLeftPickTrigger";
      case 3:
        return "OnRightPickTrigger";
      case 4:
        return "OnCenterPickTrigger";
      case 5:
        return "OnPickDownTrigger";
      case 6:
        return "OnDoublePickTrigger";
      case 7:
        return "OnPickUpTrigger";
      case 8:
        return "OnLongPressTrigger";
      case 9:
        return "OnPointerOverTrigger";
      case 10:
        return "OnPointerOutTrigger";
      case 11:
        return "OnEveryFrameTrigger";
      case 12:
        return "OnIntersectionEnterTrigger";
      case 13:
        return "OnIntersectionExitTrigger";
      case 14:
        return "OnKeyDownTrigger";
      case 15:
        return "OnKeyUpTrigger";
      case 16:
        return "OnPickOutTrigger";
      default:
        return "";
    }
  }
}
Rs.NothingTrigger = 0;
Rs.OnPickTrigger = 1;
Rs.OnLeftPickTrigger = 2;
Rs.OnRightPickTrigger = 3;
Rs.OnCenterPickTrigger = 4;
Rs.OnPickDownTrigger = 5;
Rs.OnDoublePickTrigger = 6;
Rs.OnPickUpTrigger = 7;
Rs.OnPickOutTrigger = 16;
Rs.OnLongPressTrigger = 8;
Rs.OnPointerOverTrigger = 9;
Rs.OnPointerOutTrigger = 10;
Rs.OnEveryFrameTrigger = 11;
Rs.OnIntersectionEnterTrigger = 12;
Rs.OnIntersectionExitTrigger = 13;
Rs.OnKeyDownTrigger = 14;
Rs.OnKeyUpTrigger = 15;
class m$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param sound defines the sound to play
   * @param condition defines the trigger related conditions
   */
  constructor(e, t, r) {
    super(e, r), this._sound = t;
  }
  /** @internal */
  _prepare() {
  }
  /**
   * Execute the action and play the sound.
   */
  execute() {
    this._sound !== void 0 && this._sound.play();
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "PlaySoundAction",
      properties: [{ name: "sound", value: this._sound.name }]
    }, e);
  }
}
class B$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param sound defines the sound to stop
   * @param condition defines the trigger related conditions
   */
  constructor(e, t, r) {
    super(e, r), this._sound = t;
  }
  /** @internal */
  _prepare() {
  }
  /**
   * Execute the action and stop the sound.
   */
  execute() {
    this._sound !== void 0 && this._sound.stop();
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "StopSoundAction",
      properties: [{ name: "sound", value: this._sound.name }]
    }, e);
  }
}
Ue("BABYLON.PlaySoundAction", m$);
Ue("BABYLON.StopSoundAction", B$);
class Mx {
  /**
   * Evaluate a query
   * @param query defines the query to evaluate
   * @param evaluateCallback defines the callback used to filter result
   * @returns true if the query matches
   */
  static Eval(e, t) {
    return e.match(/\([^()]*\)/g) ? e = e.replace(/\([^()]*\)/g, (r) => (r = r.slice(1, r.length - 1), Mx._HandleParenthesisContent(r, t))) : e = Mx._HandleParenthesisContent(e, t), e === "true" ? !0 : e === "false" ? !1 : Mx.Eval(e, t);
  }
  static _HandleParenthesisContent(e, t) {
    t = t || ((i) => i === "true");
    let r;
    const n = e.split("||");
    for (const i in n)
      if (Object.prototype.hasOwnProperty.call(n, i)) {
        let s = Mx._SimplifyNegation(n[i].trim());
        const a = s.split("&&");
        if (a.length > 1)
          for (let f = 0; f < a.length; ++f) {
            const o = Mx._SimplifyNegation(a[f].trim());
            if (o !== "true" && o !== "false" ? o[0] === "!" ? r = !t(o.substring(1)) : r = t(o) : r = o === "true", !r) {
              s = "false";
              break;
            }
          }
        if (r || s === "true") {
          r = !0;
          break;
        }
        s !== "true" && s !== "false" ? s[0] === "!" ? r = !t(s.substring(1)) : r = t(s) : r = s === "true";
      }
    return r ? "true" : "false";
  }
  static _SimplifyNegation(e) {
    return e = e.replace(/^[\s!]+/, (t) => (t = t.replace(/[\s]/g, () => ""), t.length % 2 ? "!" : "")), e = e.trim(), e === "!true" ? e = "false" : e === "!false" && (e = "true"), e;
  }
}
class Zi {
  /**
   * Adds support for tags on the given object
   * @param obj defines the object to use
   */
  static EnableFor(e) {
    e._tags = e._tags || {}, e.hasTags = () => Zi.HasTags(e), e.addTags = (t) => Zi.AddTagsTo(e, t), e.removeTags = (t) => Zi.RemoveTagsFrom(e, t), e.matchesTagsQuery = (t) => Zi.MatchesQuery(e, t);
  }
  /**
   * Removes tags support
   * @param obj defines the object to use
   */
  static DisableFor(e) {
    delete e._tags, delete e.hasTags, delete e.addTags, delete e.removeTags, delete e.matchesTagsQuery;
  }
  /**
   * Gets a boolean indicating if the given object has tags
   * @param obj defines the object to use
   * @returns a boolean
   */
  static HasTags(e) {
    if (!e._tags)
      return !1;
    const t = e._tags;
    for (const r in t)
      if (Object.prototype.hasOwnProperty.call(t, r))
        return !0;
    return !1;
  }
  /**
   * Gets the tags available on a given object
   * @param obj defines the object to use
   * @param asString defines if the tags must be returned as a string instead of an array of strings
   * @returns the tags
   */
  static GetTags(e, t = !0) {
    if (!e._tags)
      return null;
    if (t) {
      const r = [];
      for (const n in e._tags)
        Object.prototype.hasOwnProperty.call(e._tags, n) && e._tags[n] === !0 && r.push(n);
      return r.join(" ");
    } else
      return e._tags;
  }
  /**
   * Adds tags to an object
   * @param obj defines the object to use
   * @param tagsString defines the tag string. The tags 'true' and 'false' are reserved and cannot be used as tags.
   * A tag cannot start with '||', '&&', and '!'. It cannot contain whitespaces
   */
  static AddTagsTo(e, t) {
    if (!t || typeof t != "string")
      return;
    t.split(" ").forEach(function(n) {
      Zi._AddTagTo(e, n);
    });
  }
  /**
   * @internal
   */
  static _AddTagTo(e, t) {
    t = t.trim(), !(t === "" || t === "true" || t === "false") && (t.match(/[\s]/) || t.match(/^([!]|([|]|[&]){2})/) || (Zi.EnableFor(e), e._tags[t] = !0));
  }
  /**
   * Removes specific tags from a specific object
   * @param obj defines the object to use
   * @param tagsString defines the tags to remove
   */
  static RemoveTagsFrom(e, t) {
    if (!Zi.HasTags(e))
      return;
    const r = t.split(" ");
    for (const n in r)
      Zi._RemoveTagFrom(e, r[n]);
  }
  /**
   * @internal
   */
  static _RemoveTagFrom(e, t) {
    delete e._tags[t];
  }
  /**
   * Defines if tags hosted on an object match a given query
   * @param obj defines the object to use
   * @param tagsQuery defines the tag query
   * @returns a boolean
   */
  static MatchesQuery(e, t) {
    return t === void 0 ? !0 : t === "" ? Zi.HasTags(e) : Mx.Eval(t, (r) => Zi.HasTags(e) && e._tags[r]);
  }
}
const sG = {};
function qn(A, e = !1) {
  if (!(e && sG[A]))
    return sG[A] = !0, `${A} needs to be imported before as it contains a side-effect required by your code.`;
}
const xC = {}, vC = {}, aG = function(A, e, t, r = {}) {
  const n = A();
  Zi && Zi.HasTags(e) && Zi.AddTagsTo(n, Zi.GetTags(e, !0));
  const i = N5(n), s = {};
  for (const a in i) {
    const f = i[a], o = e[a], d = f.type;
    if (o != null && (a !== "uniqueId" || jt.AllowLoadingUniqueId))
      switch (d) {
        case 0:
        case 6:
        case 11:
          n[a] = o;
          break;
        case 1:
          r.cloneTexturesOnlyOnce && s[o.uniqueId] ? n[a] = s[o.uniqueId] : (n[a] = t || o.isRenderTarget ? o : o.clone(), s[o.uniqueId] = n[a]);
          break;
        case 2:
        case 3:
        case 4:
        case 5:
        case 7:
        case 10:
        case 12:
          n[a] = t ? o : o.clone();
          break;
      }
  }
  return n;
};
function B9e(A) {
  const e = A.getClassName();
  return xC[e] || (xC[e] = {}), xC[e];
}
function N5(A) {
  const e = A.getClassName();
  if (vC[e])
    return vC[e];
  vC[e] = {};
  const t = vC[e];
  let r = A, n = e;
  for (; n; ) {
    const i = xC[n];
    for (const f in i)
      t[f] = i[f];
    let s, a = !1;
    do {
      if (s = Object.getPrototypeOf(r), !s.getClassName) {
        a = !0;
        break;
      }
      if (s.getClassName() !== n)
        break;
      r = s;
    } while (s);
    if (a)
      break;
    n = s.getClassName(), r = s;
  }
  return t;
}
function Dp(A, e) {
  return (t, r) => {
    const n = B9e(t);
    n[r] || (n[r] = { type: A, sourceName: e });
  };
}
function W9e(A, e = null) {
  return (t, r) => {
    const n = e || "_" + r;
    Object.defineProperty(t, r, {
      get: function() {
        return this[n];
      },
      set: function(i) {
        typeof this.equals == "function" && this.equals(i) || this[n] !== i && (this[n] = i, t[A].apply(this));
      },
      enumerable: !0,
      configurable: !0
    });
  };
}
function At(A, e = null) {
  return W9e(A, e);
}
function M(A) {
  return Dp(0, A);
}
function en(A) {
  return Dp(1, A);
}
function Oi(A) {
  return Dp(2, A);
}
function eU(A) {
  return Dp(3, A);
}
function HR(A) {
  return Dp(4, A);
}
function fo(A) {
  return Dp(5, A);
}
function tU(A) {
  return Dp(6, A);
}
function W$(A) {
  return Dp(7, A);
}
function rU(A) {
  return Dp(8, A);
}
function CN(A) {
  return Dp(9, A);
}
function S$(A) {
  return Dp(10, A);
}
function qO(A) {
  return Dp(12, A);
}
function U$(A) {
  return Dp(11, A);
}
class jt {
  /**
   * Appends the serialized animations from the source animations
   * @param source Source containing the animations
   * @param destination Target to store the animations
   */
  static AppendSerializedAnimations(e, t) {
    if (e.animations) {
      t.animations = [];
      for (let r = 0; r < e.animations.length; r++) {
        const n = e.animations[r];
        t.animations.push(n.serialize());
      }
    }
  }
  /**
   * Static function used to serialized a specific entity
   * @param entity defines the entity to serialize
   * @param serializationObject defines the optional target object where serialization data will be stored
   * @returns a JSON compatible object representing the serialization of the entity
   */
  static Serialize(e, t) {
    t || (t = {}), Zi && (t.tags = Zi.GetTags(e));
    const r = N5(e);
    for (const n in r) {
      const i = r[n], s = i.sourceName || n, a = i.type, f = e[n];
      if (f != null && (n !== "uniqueId" || jt.AllowLoadingUniqueId))
        switch (a) {
          case 0:
            t[s] = f;
            break;
          case 1:
            t[s] = f.serialize();
            break;
          case 2:
            t[s] = f.asArray();
            break;
          case 3:
            t[s] = f.serialize();
            break;
          case 4:
            t[s] = f.asArray();
            break;
          case 5:
            t[s] = f.asArray();
            break;
          case 6:
            t[s] = f.id;
            break;
          case 7:
            t[s] = f.serialize();
            break;
          case 8:
            t[s] = f.asArray();
            break;
          case 9:
            t[s] = f.serialize();
            break;
          case 10:
            t[s] = f.asArray();
            break;
          case 11:
            t[s] = f.id;
            break;
          case 12:
            t[s] = f.asArray();
            break;
        }
    }
    return t;
  }
  /**
   * Given a source json and a destination object in a scene, this function will parse the source and will try to apply its content to the destination object
   * @param source the source json data
   * @param destination the destination object
   * @param scene the scene where the object is
   * @param rootUrl root url to use to load assets
   */
  static ParseProperties(e, t, r, n) {
    n || (n = "");
    const i = N5(t);
    for (const s in i) {
      const a = i[s], f = e[a.sourceName || s], o = a.type;
      if (f != null && (s !== "uniqueId" || jt.AllowLoadingUniqueId)) {
        const d = t;
        switch (o) {
          case 0:
            d[s] = f;
            break;
          case 1:
            r && (d[s] = jt._TextureParser(f, r, n));
            break;
          case 2:
            d[s] = Ne.FromArray(f);
            break;
          case 3:
            d[s] = jt._FresnelParametersParser(f);
            break;
          case 4:
            d[s] = at.FromArray(f);
            break;
          case 5:
            d[s] = S.FromArray(f);
            break;
          case 6:
            r && (d[s] = r.getLastMeshById(f));
            break;
          case 7:
            d[s] = jt._ColorCurvesParser(f);
            break;
          case 8:
            d[s] = xt.FromArray(f);
            break;
          case 9:
            d[s] = jt._ImageProcessingConfigurationParser(f);
            break;
          case 10:
            d[s] = Ze.FromArray(f);
            break;
          case 11:
            r && (d[s] = r.getCameraById(f));
            break;
          case 12:
            d[s] = he.FromArray(f);
            break;
        }
      }
    }
  }
  /**
   * Creates a new entity from a serialization data object
   * @param creationFunction defines a function used to instanciated the new entity
   * @param source defines the source serialization data
   * @param scene defines the hosting scene
   * @param rootUrl defines the root url for resources
   * @returns a new entity
   */
  static Parse(e, t, r, n = null) {
    const i = e();
    return Zi && Zi.AddTagsTo(i, t.tags), jt.ParseProperties(t, i, r, n), i;
  }
  /**
   * Clones an object
   * @param creationFunction defines the function used to instanciate the new object
   * @param source defines the source object
   * @returns the cloned object
   */
  static Clone(e, t, r = {}) {
    return aG(e, t, !1, r);
  }
  /**
   * Instanciates a new object based on a source one (some data will be shared between both object)
   * @param creationFunction defines the function used to instanciate the new object
   * @param source defines the source object
   * @returns the new object
   */
  static Instanciate(e, t) {
    return aG(e, t, !0);
  }
}
jt.AllowLoadingUniqueId = !1;
jt._ImageProcessingConfigurationParser = (A) => {
  throw qn("ImageProcessingConfiguration");
};
jt._FresnelParametersParser = (A) => {
  throw qn("FresnelParameters");
};
jt._ColorCurvesParser = (A) => {
  throw qn("ColorCurves");
};
jt._TextureParser = (A, e, t) => {
  throw qn("Texture");
};
function Hq(A, e, t, r) {
  const n = t.value;
  t.value = (...i) => {
    let s = n;
    if (typeof _native < "u" && _native[e]) {
      const a = _native[e];
      r ? s = (...f) => r(...f) ? a(...f) : n(...f) : s = a;
    }
    return A[e] = s, s(...i);
  };
}
Hq.filter = function(A) {
  return (e, t, r) => Hq(e, t, r, A);
};
var CI;
(function(A) {
  A[A.NONE = 0] = "NONE", A[A.STEP = 1] = "STEP";
})(CI || (CI = {}));
class Am {
  /**
   * Initializes the range of an animation
   * @param name The name of the animation range
   * @param from The starting frame of the animation
   * @param to The ending frame of the animation
   */
  constructor(e, t, r) {
    this.name = e, this.from = t, this.to = r;
  }
  /**
   * Makes a copy of the animation range
   * @returns A copy of the animation range
   */
  clone() {
    return new Am(this.name, this.from, this.to);
  }
}
function C(A, e, t, r) {
  var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, s;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
    i = Reflect.decorate(A, e, t, r);
  else
    for (var a = A.length - 1; a >= 0; a--)
      (s = A[a]) && (i = (n < 3 ? s(i) : n > 3 ? s(e, t, i) : s(e, t)) || i);
  return n > 3 && i && Object.defineProperty(e, t, i), i;
}
class S9e {
  constructor() {
    this._doNotSerialize = !1, this._isDisposed = !1, this._sceneRootNodesIndex = -1, this._isEnabled = !0, this._isParentEnabled = !0, this._isReady = !0, this._onEnabledStateChangedObservable = new Oe(), this._onClonedObservable = new Oe();
  }
}
let Cs = class Q5 {
  /**
   * Add a new node constructor
   * @param type defines the type name of the node to construct
   * @param constructorFunc defines the constructor function
   */
  static AddNodeConstructor(e, t) {
    this._NodeConstructors[e] = t;
  }
  /**
   * Returns a node constructor based on type name
   * @param type defines the type name
   * @param name defines the new node name
   * @param scene defines the hosting scene
   * @param options defines optional options to transmit to constructors
   * @returns the new constructor or null
   */
  static Construct(e, t, r, n) {
    const i = this._NodeConstructors[e];
    return i ? i(t, r, n) : null;
  }
  /**
   * Gets or sets the accessibility tag to describe the node for accessibility purpose.
   */
  set accessibilityTag(e) {
    this._accessibilityTag = e, this.onAccessibilityTagChangedObservable.notifyObservers(e);
  }
  get accessibilityTag() {
    return this._accessibilityTag;
  }
  /**
   * Gets or sets a boolean used to define if the node must be serialized
   */
  get doNotSerialize() {
    return this._nodeDataStorage._doNotSerialize ? !0 : this._parentNode ? this._parentNode.doNotSerialize : !1;
  }
  set doNotSerialize(e) {
    this._nodeDataStorage._doNotSerialize = e;
  }
  /**
   * Gets a boolean indicating if the node has been disposed
   * @returns true if the node was disposed
   */
  isDisposed() {
    return this._nodeDataStorage._isDisposed;
  }
  /**
   * Gets or sets the parent of the node (without keeping the current position in the scene)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/parent
   */
  set parent(e) {
    if (this._parentNode === e)
      return;
    const t = this._parentNode;
    if (this._parentNode && this._parentNode._children !== void 0 && this._parentNode._children !== null) {
      const r = this._parentNode._children.indexOf(this);
      r !== -1 && this._parentNode._children.splice(r, 1), !e && !this._nodeDataStorage._isDisposed && this._addToSceneRootNodes();
    }
    this._parentNode = e, this._parentNode && ((this._parentNode._children === void 0 || this._parentNode._children === null) && (this._parentNode._children = new Array()), this._parentNode._children.push(this), t || this._removeFromSceneRootNodes()), this._syncParentEnabledState();
  }
  get parent() {
    return this._parentNode;
  }
  /**
   * @internal
   */
  _serializeAsParent(e) {
    e.parentId = this.uniqueId;
  }
  /** @internal */
  _addToSceneRootNodes() {
    this._nodeDataStorage._sceneRootNodesIndex === -1 && (this._nodeDataStorage._sceneRootNodesIndex = this._scene.rootNodes.length, this._scene.rootNodes.push(this));
  }
  /** @internal */
  _removeFromSceneRootNodes() {
    if (this._nodeDataStorage._sceneRootNodesIndex !== -1) {
      const e = this._scene.rootNodes, t = e.length - 1;
      e[this._nodeDataStorage._sceneRootNodesIndex] = e[t], e[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex = this._nodeDataStorage._sceneRootNodesIndex, this._scene.rootNodes.pop(), this._nodeDataStorage._sceneRootNodesIndex = -1;
    }
  }
  /**
   * Gets or sets the animation properties override
   */
  get animationPropertiesOverride() {
    return this._animationPropertiesOverride ? this._animationPropertiesOverride : this._scene.animationPropertiesOverride;
  }
  set animationPropertiesOverride(e) {
    this._animationPropertiesOverride = e;
  }
  /**
   * Gets a string identifying the name of the class
   * @returns "Node" string
   */
  getClassName() {
    return "Node";
  }
  /**
   * Sets a callback that will be raised when the node will be disposed
   */
  set onDispose(e) {
    this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);
  }
  /**
   * An event triggered when the enabled state of the node changes
   */
  get onEnabledStateChangedObservable() {
    return this._nodeDataStorage._onEnabledStateChangedObservable;
  }
  /**
   * An event triggered when the node is cloned
   */
  get onClonedObservable() {
    return this._nodeDataStorage._onClonedObservable;
  }
  /**
   * Creates a new Node
   * @param name the name and id to be given to this node
   * @param scene the scene this node will be added to
   */
  constructor(e, t = null) {
    this._isDirty = !1, this._nodeDataStorage = new S9e(), this.state = "", this.metadata = null, this.reservedDataStore = null, this._accessibilityTag = null, this.onAccessibilityTagChangedObservable = new Oe(), this._parentContainer = null, this.animations = [], this._ranges = {}, this.onReady = null, this._currentRenderId = -1, this._parentUpdateId = -1, this._childUpdateId = -1, this._waitingParentId = null, this._waitingParentInstanceIndex = null, this._waitingParsedUniqueId = null, this._cache = {}, this._parentNode = null, this._children = null, this._worldMatrix = he.Identity(), this._worldMatrixDeterminant = 0, this._worldMatrixDeterminantIsDirty = !0, this._animationPropertiesOverride = null, this._isNode = !0, this.onDisposeObservable = new Oe(), this._onDisposeObserver = null, this._behaviors = new Array(), this.name = e, this.id = e, this._scene = t || gr.LastCreatedScene, this.uniqueId = this._scene.getUniqueId(), this._initCache();
  }
  /**
   * Gets the scene of the node
   * @returns a scene
   */
  getScene() {
    return this._scene;
  }
  /**
   * Gets the engine of the node
   * @returns a Engine
   */
  getEngine() {
    return this._scene.getEngine();
  }
  /**
   * Attach a behavior to the node
   * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors
   * @param behavior defines the behavior to attach
   * @param attachImmediately defines that the behavior must be attached even if the scene is still loading
   * @returns the current Node
   */
  addBehavior(e, t = !1) {
    return this._behaviors.indexOf(e) !== -1 ? this : (e.init(), this._scene.isLoading && !t ? this._scene.onDataLoadedObservable.addOnce(() => {
      e.attach(this);
    }) : e.attach(this), this._behaviors.push(e), this);
  }
  /**
   * Remove an attached behavior
   * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors
   * @param behavior defines the behavior to attach
   * @returns the current Node
   */
  removeBehavior(e) {
    const t = this._behaviors.indexOf(e);
    return t === -1 ? this : (this._behaviors[t].detach(), this._behaviors.splice(t, 1), this);
  }
  /**
   * Gets the list of attached behaviors
   * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors
   */
  get behaviors() {
    return this._behaviors;
  }
  /**
   * Gets an attached behavior by name
   * @param name defines the name of the behavior to look for
   * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors
   * @returns null if behavior was not found else the requested behavior
   */
  getBehaviorByName(e) {
    for (const t of this._behaviors)
      if (t.name === e)
        return t;
    return null;
  }
  /**
   * Returns the latest update of the World matrix
   * @returns a Matrix
   */
  getWorldMatrix() {
    return this._currentRenderId !== this._scene.getRenderId() && this.computeWorldMatrix(), this._worldMatrix;
  }
  /** @internal */
  _getWorldMatrixDeterminant() {
    return this._worldMatrixDeterminantIsDirty && (this._worldMatrixDeterminantIsDirty = !1, this._worldMatrixDeterminant = this._worldMatrix.determinant()), this._worldMatrixDeterminant;
  }
  /**
   * Returns directly the latest state of the mesh World matrix.
   * A Matrix is returned.
   */
  get worldMatrixFromCache() {
    return this._worldMatrix;
  }
  // override it in derived class if you add new variables to the cache
  // and call the parent class method
  /** @internal */
  _initCache() {
    this._cache = {}, this._cache.parent = void 0;
  }
  /**
   * @internal
   */
  updateCache(e) {
    !e && this.isSynchronized() || (this._cache.parent = this.parent, this._updateCache());
  }
  /**
   * @internal
   */
  _getActionManagerForTrigger(e, t = !0) {
    return this.parent ? this.parent._getActionManagerForTrigger(e, !1) : null;
  }
  // override it in derived class if you add new variables to the cache
  // and call the parent class method if !ignoreParentClass
  /**
   * @internal
   */
  _updateCache(e) {
  }
  // override it in derived class if you add new variables to the cache
  /** @internal */
  _isSynchronized() {
    return !0;
  }
  /** @internal */
  _markSyncedWithParent() {
    this._parentNode && (this._parentUpdateId = this._parentNode._childUpdateId);
  }
  /** @internal */
  isSynchronizedWithParent() {
    return this._parentNode ? this._parentNode._isDirty || this._parentUpdateId !== this._parentNode._childUpdateId ? !1 : this._parentNode.isSynchronized() : !0;
  }
  /** @internal */
  isSynchronized() {
    return this._cache.parent !== this._parentNode ? (this._cache.parent = this._parentNode, !1) : this._parentNode && !this.isSynchronizedWithParent() ? !1 : this._isSynchronized();
  }
  /**
   * Is this node ready to be used/rendered
   * @param _completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
   * @returns true if the node is ready
   */
  isReady(e = !1) {
    return this._nodeDataStorage._isReady;
  }
  /**
   * Flag the  node as dirty (Forcing it to update everything)
   * @param _property helps children apply precise "dirtyfication"
   * @returns this node
   */
  markAsDirty(e) {
    return this._currentRenderId = Number.MAX_VALUE, this._isDirty = !0, this;
  }
  /**
   * Is this node enabled?
   * If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true
   * @param checkAncestors indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors
   * @returns whether this node (and its parent) is enabled
   */
  isEnabled(e = !0) {
    return e === !1 ? this._nodeDataStorage._isEnabled : this._nodeDataStorage._isEnabled ? this._nodeDataStorage._isParentEnabled : !1;
  }
  /** @internal */
  _syncParentEnabledState() {
    this._nodeDataStorage._isParentEnabled = this._parentNode ? this._parentNode.isEnabled() : !0, this._children && this._children.forEach((e) => {
      e._syncParentEnabledState();
    });
  }
  /**
   * Set the enabled state of this node
   * @param value defines the new enabled state
   */
  setEnabled(e) {
    this._nodeDataStorage._isEnabled !== e && (this._nodeDataStorage._isEnabled = e, this._syncParentEnabledState(), this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(e));
  }
  /**
   * Is this node a descendant of the given node?
   * The function will iterate up the hierarchy until the ancestor was found or no more parents defined
   * @param ancestor defines the parent node to inspect
   * @returns a boolean indicating if this node is a descendant of the given node
   */
  isDescendantOf(e) {
    return this.parent ? this.parent === e ? !0 : this.parent.isDescendantOf(e) : !1;
  }
  /**
   * @internal
   */
  _getDescendants(e, t = !1, r) {
    if (this._children)
      for (let n = 0; n < this._children.length; n++) {
        const i = this._children[n];
        (!r || r(i)) && e.push(i), t || i._getDescendants(e, !1, r);
      }
  }
  /**
   * Will return all nodes that have this node as ascendant
   * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
   * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
   * @returns all children nodes of all types
   */
  getDescendants(e, t) {
    const r = [];
    return this._getDescendants(r, e, t), r;
  }
  /**
   * Get all child-meshes of this node
   * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)
   * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
   * @returns an array of AbstractMesh
   */
  getChildMeshes(e, t) {
    const r = [];
    return this._getDescendants(r, e, (n) => (!t || t(n)) && n.cullingStrategy !== void 0), r;
  }
  /**
   * Get all direct children of this node
   * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
   * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)
   * @returns an array of Node
   */
  getChildren(e, t = !0) {
    return this.getDescendants(t, e);
  }
  /**
   * @internal
   */
  _setReady(e) {
    if (e !== this._nodeDataStorage._isReady) {
      if (!e) {
        this._nodeDataStorage._isReady = !1;
        return;
      }
      this.onReady && this.onReady(this), this._nodeDataStorage._isReady = !0;
    }
  }
  /**
   * Get an animation by name
   * @param name defines the name of the animation to look for
   * @returns null if not found else the requested animation
   */
  getAnimationByName(e) {
    for (let t = 0; t < this.animations.length; t++) {
      const r = this.animations[t];
      if (r.name === e)
        return r;
    }
    return null;
  }
  /**
   * Creates an animation range for this node
   * @param name defines the name of the range
   * @param from defines the starting key
   * @param to defines the end key
   */
  createAnimationRange(e, t, r) {
    if (!this._ranges[e]) {
      this._ranges[e] = Q5._AnimationRangeFactory(e, t, r);
      for (let n = 0, i = this.animations.length; n < i; n++)
        this.animations[n] && this.animations[n].createRange(e, t, r);
    }
  }
  /**
   * Delete a specific animation range
   * @param name defines the name of the range to delete
   * @param deleteFrames defines if animation frames from the range must be deleted as well
   */
  deleteAnimationRange(e, t = !0) {
    for (let r = 0, n = this.animations.length; r < n; r++)
      this.animations[r] && this.animations[r].deleteRange(e, t);
    this._ranges[e] = null;
  }
  /**
   * Get an animation range by name
   * @param name defines the name of the animation range to look for
   * @returns null if not found else the requested animation range
   */
  getAnimationRange(e) {
    return this._ranges[e] || null;
  }
  /**
   * Clone the current node
   * @param name Name of the new clone
   * @param newParent New parent for the clone
   * @param doNotCloneChildren Do not clone children hierarchy
   * @returns the new transform node
   */
  clone(e, t, r) {
    const n = jt.Clone(() => new Q5(e, this.getScene()), this);
    if (t && (n.parent = t), !r) {
      const i = this.getDescendants(!0);
      for (let s = 0; s < i.length; s++) {
        const a = i[s];
        a.clone(e + "." + a.name, n);
      }
    }
    return n;
  }
  /**
   * Gets the list of all animation ranges defined on this node
   * @returns an array
   */
  getAnimationRanges() {
    const e = [];
    let t;
    for (t in this._ranges)
      e.push(this._ranges[t]);
    return e;
  }
  /**
   * Will start the animation sequence
   * @param name defines the range frames for animation sequence
   * @param loop defines if the animation should loop (false by default)
   * @param speedRatio defines the speed factor in which to run the animation (1 by default)
   * @param onAnimationEnd defines a function to be executed when the animation ended (undefined by default)
   * @returns the object created for this animation. If range does not exist, it will return null
   */
  beginAnimation(e, t, r, n) {
    const i = this.getAnimationRange(e);
    return i ? this._scene.beginAnimation(this, i.from, i.to, t, r, n) : null;
  }
  /**
   * Serialize animation ranges into a JSON compatible object
   * @returns serialization object
   */
  serializeAnimationRanges() {
    const e = [];
    for (const t in this._ranges) {
      const r = this._ranges[t];
      if (!r)
        continue;
      const n = {};
      n.name = t, n.from = r.from, n.to = r.to, e.push(n);
    }
    return e;
  }
  /**
   * Computes the world matrix of the node
   * @param _force defines if the cache version should be invalidated forcing the world matrix to be created from scratch
   * @returns the world matrix
   */
  computeWorldMatrix(e) {
    return this._worldMatrix || (this._worldMatrix = he.Identity()), this._worldMatrix;
  }
  /**
   * Releases resources associated with this node.
   * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
   * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
   */
  dispose(e, t = !1) {
    if (this._nodeDataStorage._isDisposed = !0, !e) {
      const r = this.getDescendants(!0);
      for (const n of r)
        n.dispose(e, t);
    }
    this.parent ? this.parent = null : this._removeFromSceneRootNodes(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onEnabledStateChangedObservable.clear(), this.onClonedObservable.clear();
    for (const r of this._behaviors)
      r.detach();
    this._behaviors.length = 0, this.metadata = null;
  }
  /**
   * Parse animation range data from a serialization object and store them into a given node
   * @param node defines where to store the animation ranges
   * @param parsedNode defines the serialization object to read data from
   * @param _scene defines the hosting scene
   */
  static ParseAnimationRanges(e, t, r) {
    if (t.ranges)
      for (let n = 0; n < t.ranges.length; n++) {
        const i = t.ranges[n];
        e.createAnimationRange(i.name, i.from, i.to);
      }
  }
  /**
   * Return the minimum and maximum world vectors of the entire hierarchy under current node
   * @param includeDescendants Include bounding info from descendants as well (true by default)
   * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
   * @returns the new bounding vectors
   */
  getHierarchyBoundingVectors(e = !0, t = null) {
    this.getScene().incrementRenderId(), this.computeWorldMatrix(!0);
    let r, n;
    const i = this;
    if (i.getBoundingInfo && i.subMeshes) {
      const s = i.getBoundingInfo();
      r = s.boundingBox.minimumWorld.clone(), n = s.boundingBox.maximumWorld.clone();
    } else
      r = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), n = new S(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
    if (e) {
      const s = this.getDescendants(!1);
      for (const a of s) {
        const f = a;
        if (f.computeWorldMatrix(!0), t && !t(f) || !f.getBoundingInfo || f.getTotalVertices() === 0)
          continue;
        const d = f.getBoundingInfo().boundingBox, v = d.minimumWorld, u = d.maximumWorld;
        S.CheckExtends(v, r, n), S.CheckExtends(u, r, n);
      }
    }
    return {
      min: r,
      max: n
    };
  }
};
Cs._AnimationRangeFactory = (A, e, t) => {
  throw qn("AnimationRange");
};
Cs._NodeConstructors = {};
C([
  M()
], Cs.prototype, "name", void 0);
C([
  M()
], Cs.prototype, "id", void 0);
C([
  M()
], Cs.prototype, "uniqueId", void 0);
C([
  M()
], Cs.prototype, "state", void 0);
C([
  M()
], Cs.prototype, "metadata", void 0);
class Qd {
  /**
   * Creates a Size object from the given width and height (floats).
   * @param width width of the new size
   * @param height height of the new size
   */
  constructor(e, t) {
    this.width = e, this.height = t;
  }
  /**
   * Returns a string with the Size width and height
   * @returns a string with the Size width and height
   */
  toString() {
    return `{W: ${this.width}, H: ${this.height}}`;
  }
  /**
   * "Size"
   * @returns the string "Size"
   */
  getClassName() {
    return "Size";
  }
  /**
   * Returns the Size hash code.
   * @returns a hash code for a unique width and height
   */
  getHashCode() {
    let e = this.width | 0;
    return e = e * 397 ^ (this.height | 0), e;
  }
  /**
   * Updates the current size from the given one.
   * @param src the given size
   */
  copyFrom(e) {
    this.width = e.width, this.height = e.height;
  }
  /**
   * Updates in place the current Size from the given floats.
   * @param width width of the new size
   * @param height height of the new size
   * @returns the updated Size.
   */
  copyFromFloats(e, t) {
    return this.width = e, this.height = t, this;
  }
  /**
   * Updates in place the current Size from the given floats.
   * @param width width to set
   * @param height height to set
   * @returns the updated Size.
   */
  set(e, t) {
    return this.copyFromFloats(e, t);
  }
  /**
   * Multiplies the width and height by numbers
   * @param w factor to multiple the width by
   * @param h factor to multiple the height by
   * @returns a new Size set with the multiplication result of the current Size and the given floats.
   */
  multiplyByFloats(e, t) {
    return new Qd(this.width * e, this.height * t);
  }
  /**
   * Clones the size
   * @returns a new Size copied from the given one.
   */
  clone() {
    return new Qd(this.width, this.height);
  }
  /**
   * True if the current Size and the given one width and height are strictly equal.
   * @param other the other size to compare against
   * @returns True if the current Size and the given one width and height are strictly equal.
   */
  equals(e) {
    return e ? this.width === e.width && this.height === e.height : !1;
  }
  /**
   * The surface of the Size : width * height (float).
   */
  get surface() {
    return this.width * this.height;
  }
  /**
   * Create a new size of zero
   * @returns a new Size set to (0.0, 0.0)
   */
  static Zero() {
    return new Qd(0, 0);
  }
  /**
   * Sums the width and height of two sizes
   * @param otherSize size to add to this size
   * @returns a new Size set as the addition result of the current Size and the given one.
   */
  add(e) {
    return new Qd(this.width + e.width, this.height + e.height);
  }
  /**
   * Subtracts the width and height of two
   * @param otherSize size to subtract to this size
   * @returns a new Size set as the subtraction result of  the given one from the current Size.
   */
  subtract(e) {
    return new Qd(this.width - e.width, this.height - e.height);
  }
  /**
   * Scales the width and height
   * @param scale the scale to multiply the width and height by
   * @returns a new Size set with the multiplication result of the current Size and the given floats.
   */
  scale(e) {
    return new Qd(this.width * e, this.height * e);
  }
  /**
   * Creates a new Size set at the linear interpolation "amount" between "start" and "end"
   * @param start starting size to lerp between
   * @param end end size to lerp between
   * @param amount amount to lerp between the start and end values
   * @returns a new Size set at the linear interpolation "amount" between "start" and "end"
   */
  static Lerp(e, t, r) {
    const n = e.width + (t.width - e.width) * r, i = e.height + (t.height - e.height) * r;
    return new Qd(n, i);
  }
}
function U9e() {
  return typeof _native < "u" && _native.XMLHttpRequest ? new _native.XMLHttpRequest() : new XMLHttpRequest();
}
class ho {
  constructor() {
    this._xhr = U9e(), this._requestURL = "";
  }
  /**
   * This function can be called to check if there are request modifiers for network requests
   * @returns true if there are any custom requests available
   */
  static get IsCustomRequestAvailable() {
    return Object.keys(ho.CustomRequestHeaders).length > 0 || ho.CustomRequestModifiers.length > 0;
  }
  _injectCustomRequestHeaders() {
    if (!this._shouldSkipRequestModifications(this._requestURL))
      for (const e in ho.CustomRequestHeaders) {
        const t = ho.CustomRequestHeaders[e];
        t && this._xhr.setRequestHeader(e, t);
      }
  }
  _shouldSkipRequestModifications(e) {
    return ho.SkipRequestModificationForBabylonCDN && (e.includes("preview.babylonjs.com") || e.includes("cdn.babylonjs.com"));
  }
  /**
   * Gets or sets a function to be called when loading progress changes
   */
  get onprogress() {
    return this._xhr.onprogress;
  }
  set onprogress(e) {
    this._xhr.onprogress = e;
  }
  /**
   * Returns client's state
   */
  get readyState() {
    return this._xhr.readyState;
  }
  /**
   * Returns client's status
   */
  get status() {
    return this._xhr.status;
  }
  /**
   * Returns client's status as a text
   */
  get statusText() {
    return this._xhr.statusText;
  }
  /**
   * Returns client's response
   */
  get response() {
    return this._xhr.response;
  }
  /**
   * Returns client's response url
   */
  get responseURL() {
    return this._xhr.responseURL;
  }
  /**
   * Returns client's response as text
   */
  get responseText() {
    return this._xhr.responseText;
  }
  /**
   * Gets or sets the expected response type
   */
  get responseType() {
    return this._xhr.responseType;
  }
  set responseType(e) {
    this._xhr.responseType = e;
  }
  /**
   * Gets or sets the timeout value in milliseconds
   */
  get timeout() {
    return this._xhr.timeout;
  }
  set timeout(e) {
    this._xhr.timeout = e;
  }
  addEventListener(e, t, r) {
    this._xhr.addEventListener(e, t, r);
  }
  removeEventListener(e, t, r) {
    this._xhr.removeEventListener(e, t, r);
  }
  /**
   * Cancels any network activity
   */
  abort() {
    this._xhr.abort();
  }
  /**
   * Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD
   * @param body defines an optional request body
   */
  send(e) {
    ho.CustomRequestHeaders && this._injectCustomRequestHeaders(), this._xhr.send(e);
  }
  /**
   * Sets the request method, request URL
   * @param method defines the method to use (GET, POST, etc..)
   * @param url defines the url to connect with
   */
  open(e, t) {
    for (const r of ho.CustomRequestModifiers) {
      if (this._shouldSkipRequestModifications(t))
        return;
      r(this._xhr, t);
    }
    return t = t.replace("file:http:", "http:"), t = t.replace("file:https:", "https:"), this._requestURL = t, this._xhr.open(e, t, !0);
  }
  /**
   * Sets the value of a request header.
   * @param name The name of the header whose value is to be set
   * @param value The value to set as the body of the header
   */
  setRequestHeader(e, t) {
    this._xhr.setRequestHeader(e, t);
  }
  /**
   * Get the string containing the text of a particular header's value.
   * @param name The name of the header
   * @returns The string containing the text of the given header name
   */
  getResponseHeader(e) {
    return this._xhr.getResponseHeader(e);
  }
}
ho.CustomRequestHeaders = {};
ho.CustomRequestModifiers = new Array();
ho.SkipRequestModificationForBabylonCDN = !0;
const ON = Object.freeze(new Ze(0, 0, 0, 0)), yN = Object.freeze(S.Zero()), kN = Object.freeze(at.Zero()), EN = Object.freeze(Qd.Zero()), FN = Object.freeze(Ne.Black()), NN = Object.freeze(new xt(0, 0, 0, 0)), kH = {
  key: 0,
  repeatCount: 0,
  loopMode: 2
};
class st {
  /**
   * @internal Internal use
   */
  static _PrepareAnimation(e, t, r, n, i, s, a, f) {
    let o;
    if (!isNaN(parseFloat(i)) && isFinite(i) ? o = st.ANIMATIONTYPE_FLOAT : i instanceof Ze ? o = st.ANIMATIONTYPE_QUATERNION : i instanceof S ? o = st.ANIMATIONTYPE_VECTOR3 : i instanceof at ? o = st.ANIMATIONTYPE_VECTOR2 : i instanceof Ne ? o = st.ANIMATIONTYPE_COLOR3 : i instanceof xt ? o = st.ANIMATIONTYPE_COLOR4 : i instanceof Qd && (o = st.ANIMATIONTYPE_SIZE), o == null)
      return null;
    const d = new st(e, t, r, o, a), v = [
      { frame: 0, value: i },
      { frame: n, value: s }
    ];
    return d.setKeys(v), f !== void 0 && d.setEasingFunction(f), d;
  }
  /**
   * Sets up an animation
   * @param property The property to animate
   * @param animationType The animation type to apply
   * @param framePerSecond The frames per second of the animation
   * @param easingFunction The easing function used in the animation
   * @returns The created animation
   */
  static CreateAnimation(e, t, r, n) {
    const i = new st(e + "Animation", e, r, t, st.ANIMATIONLOOPMODE_CONSTANT);
    return i.setEasingFunction(n), i;
  }
  /**
   * Create and start an animation on a node
   * @param name defines the name of the global animation that will be run on all nodes
   * @param target defines the target where the animation will take place
   * @param targetProperty defines property to animate
   * @param framePerSecond defines the number of frame per second yo use
   * @param totalFrame defines the number of frames in total
   * @param from defines the initial value
   * @param to defines the final value
   * @param loopMode defines which loop mode you want to use (off by default)
   * @param easingFunction defines the easing function to use (linear by default)
   * @param onAnimationEnd defines the callback to call when animation end
   * @param scene defines the hosting scene
   * @returns the animatable created for this animation
   */
  static CreateAndStartAnimation(e, t, r, n, i, s, a, f, o, d, v) {
    const u = st._PrepareAnimation(e, r, n, i, s, a, f, o);
    return !u || (t.getScene && (v = t.getScene()), !v) ? null : v.beginDirectAnimation(t, [u], 0, i, u.loopMode === 1, 1, d);
  }
  /**
   * Create and start an animation on a node and its descendants
   * @param name defines the name of the global animation that will be run on all nodes
   * @param node defines the root node where the animation will take place
   * @param directDescendantsOnly if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used
   * @param targetProperty defines property to animate
   * @param framePerSecond defines the number of frame per second to use
   * @param totalFrame defines the number of frames in total
   * @param from defines the initial value
   * @param to defines the final value
   * @param loopMode defines which loop mode you want to use (off by default)
   * @param easingFunction defines the easing function to use (linear by default)
   * @param onAnimationEnd defines the callback to call when an animation ends (will be called once per node)
   * @returns the list of animatables created for all nodes
   * @example https://www.babylonjs-playground.com/#MH0VLI
   */
  static CreateAndStartHierarchyAnimation(e, t, r, n, i, s, a, f, o, d, v) {
    const u = st._PrepareAnimation(e, n, i, s, a, f, o, d);
    return u ? t.getScene().beginDirectHierarchyAnimation(t, r, [u], 0, s, u.loopMode === 1, 1, v) : null;
  }
  /**
   * Creates a new animation, merges it with the existing animations and starts it
   * @param name Name of the animation
   * @param node Node which contains the scene that begins the animations
   * @param targetProperty Specifies which property to animate
   * @param framePerSecond The frames per second of the animation
   * @param totalFrame The total number of frames
   * @param from The frame at the beginning of the animation
   * @param to The frame at the end of the animation
   * @param loopMode Specifies the loop mode of the animation
   * @param easingFunction (Optional) The easing function of the animation, which allow custom mathematical formulas for animations
   * @param onAnimationEnd Callback to run once the animation is complete
   * @returns Nullable animation
   */
  static CreateMergeAndStartAnimation(e, t, r, n, i, s, a, f, o, d) {
    const v = st._PrepareAnimation(e, r, n, i, s, a, f, o);
    return v ? (t.animations.push(v), t.getScene().beginAnimation(t, 0, i, v.loopMode === 1, 1, d)) : null;
  }
  /** @internal */
  static MakeAnimationAdditive(e, t, r, n = !1, i) {
    var s, a;
    let f;
    typeof t == "object" ? f = t : f = {
      referenceFrame: t ?? 0,
      range: r,
      cloneOriginalAnimation: n,
      clonedAnimationName: i
    };
    let o = e;
    if (f.cloneOriginalAnimation && (o = e.clone(), o.name = f.clonedAnimationName || o.name), !o._keys.length)
      return o;
    const d = f.referenceFrame && f.referenceFrame >= 0 ? f.referenceFrame : 0;
    let v = 0;
    const u = o._keys[0];
    let l = o._keys.length - 1;
    const P = o._keys[l], p = {
      referenceValue: u.value,
      referencePosition: ue.Vector3[0],
      referenceQuaternion: ue.Quaternion[0],
      referenceScaling: ue.Vector3[1],
      keyPosition: ue.Vector3[2],
      keyQuaternion: ue.Quaternion[1],
      keyScaling: ue.Vector3[3]
    };
    let c = u.frame, H = P.frame;
    if (f.range) {
      const b = o.getRange(f.range);
      b && (c = b.from, H = b.to);
    } else
      c = (s = f.fromFrame) !== null && s !== void 0 ? s : c, H = (a = f.toFrame) !== null && a !== void 0 ? a : H;
    if (c !== u.frame && (v = o.createKeyForFrame(c)), H !== P.frame && (l = o.createKeyForFrame(H)), o._keys.length === 1) {
      const b = o._getKeyValue(o._keys[0]);
      p.referenceValue = b.clone ? b.clone() : b;
    } else if (d <= u.frame) {
      const b = o._getKeyValue(u.value);
      p.referenceValue = b.clone ? b.clone() : b;
    } else if (d >= P.frame) {
      const b = o._getKeyValue(P.value);
      p.referenceValue = b.clone ? b.clone() : b;
    } else {
      kH.key = 0;
      const b = o._interpolate(d, kH);
      p.referenceValue = b.clone ? b.clone() : b;
    }
    o.dataType === st.ANIMATIONTYPE_QUATERNION ? p.referenceValue.normalize().conjugateInPlace() : o.dataType === st.ANIMATIONTYPE_MATRIX && (p.referenceValue.decompose(p.referenceScaling, p.referenceQuaternion, p.referencePosition), p.referenceQuaternion.normalize().conjugateInPlace());
    let T = Number.MAX_VALUE;
    const q = f.clipKeys ? [] : null;
    for (let b = v; b <= l; b++) {
      let j = o._keys[b];
      if (q && (j = {
        frame: j.frame,
        value: j.value.clone ? j.value.clone() : j.value,
        inTangent: j.inTangent,
        outTangent: j.outTangent,
        interpolation: j.interpolation,
        lockedTangent: j.lockedTangent
      }, T === Number.MAX_VALUE && (T = j.frame), j.frame -= T, q.push(j)), !(b && o.dataType !== st.ANIMATIONTYPE_FLOAT && j.value === u.value))
        switch (o.dataType) {
          case st.ANIMATIONTYPE_MATRIX:
            j.value.decompose(p.keyScaling, p.keyQuaternion, p.keyPosition), p.keyPosition.subtractInPlace(p.referencePosition), p.keyScaling.divideInPlace(p.referenceScaling), p.referenceQuaternion.multiplyToRef(p.keyQuaternion, p.keyQuaternion), he.ComposeToRef(p.keyScaling, p.keyQuaternion, p.keyPosition, j.value);
            break;
          case st.ANIMATIONTYPE_QUATERNION:
            p.referenceValue.multiplyToRef(j.value, j.value);
            break;
          case st.ANIMATIONTYPE_VECTOR2:
          case st.ANIMATIONTYPE_VECTOR3:
          case st.ANIMATIONTYPE_COLOR3:
          case st.ANIMATIONTYPE_COLOR4:
            j.value.subtractToRef(p.referenceValue, j.value);
            break;
          case st.ANIMATIONTYPE_SIZE:
            j.value.width -= p.referenceValue.width, j.value.height -= p.referenceValue.height;
            break;
          default:
            j.value -= p.referenceValue;
        }
    }
    return q && o.setKeys(q, !0), o;
  }
  /**
   * Transition property of an host to the target Value
   * @param property The property to transition
   * @param targetValue The target Value of the property
   * @param host The object where the property to animate belongs
   * @param scene Scene used to run the animation
   * @param frameRate Framerate (in frame/s) to use
   * @param transition The transition type we want to use
   * @param duration The duration of the animation, in milliseconds
   * @param onAnimationEnd Callback trigger at the end of the animation
   * @returns Nullable animation
   */
  static TransitionTo(e, t, r, n, i, s, a, f = null) {
    if (a <= 0)
      return r[e] = t, f && f(), null;
    const o = i * (a / 1e3);
    s.setKeys([
      {
        frame: 0,
        value: r[e].clone ? r[e].clone() : r[e]
      },
      {
        frame: o,
        value: t
      }
    ]), r.animations || (r.animations = []), r.animations.push(s);
    const d = n.beginAnimation(r, 0, o, !1);
    return d.onAnimationEnd = f, d;
  }
  /**
   * Return the array of runtime animations currently using this animation
   */
  get runtimeAnimations() {
    return this._runtimeAnimations;
  }
  /**
   * Specifies if any of the runtime animations are currently running
   */
  get hasRunningRuntimeAnimations() {
    for (const e of this._runtimeAnimations)
      if (!e.isStopped())
        return !0;
    return !1;
  }
  /**
   * Initializes the animation
   * @param name Name of the animation
   * @param targetProperty Property to animate
   * @param framePerSecond The frames per second of the animation
   * @param dataType The data type of the animation
   * @param loopMode The loop mode of the animation
   * @param enableBlending Specifies if blending should be enabled
   */
  constructor(e, t, r, n, i, s) {
    this.name = e, this.targetProperty = t, this.framePerSecond = r, this.dataType = n, this.loopMode = i, this.enableBlending = s, this._easingFunction = null, this._runtimeAnimations = new Array(), this._events = new Array(), this.blendingSpeed = 0.01, this._ranges = {}, this.targetPropertyPath = t.split("."), this.dataType = n, this.loopMode = i === void 0 ? st.ANIMATIONLOOPMODE_CYCLE : i, this.uniqueId = st._UniqueIdGenerator++;
  }
  // Methods
  /**
   * Converts the animation to a string
   * @param fullDetails support for multiple levels of logging within scene loading
   * @returns String form of the animation
   */
  toString(e) {
    let t = "Name: " + this.name + ", property: " + this.targetProperty;
    if (t += ", datatype: " + ["Float", "Vector3", "Quaternion", "Matrix", "Color3", "Vector2"][this.dataType], t += ", nKeys: " + (this._keys ? this._keys.length : "none"), t += ", nRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none"), e) {
      t += ", Ranges: {";
      let r = !0;
      for (const n in this._ranges)
        r && (t += ", ", r = !1), t += n;
      t += "}";
    }
    return t;
  }
  /**
   * Add an event to this animation
   * @param event Event to add
   */
  addEvent(e) {
    this._events.push(e), this._events.sort((t, r) => t.frame - r.frame);
  }
  /**
   * Remove all events found at the given frame
   * @param frame The frame to remove events from
   */
  removeEvents(e) {
    for (let t = 0; t < this._events.length; t++)
      this._events[t].frame === e && (this._events.splice(t, 1), t--);
  }
  /**
   * Retrieves all the events from the animation
   * @returns Events from the animation
   */
  getEvents() {
    return this._events;
  }
  /**
   * Creates an animation range
   * @param name Name of the animation range
   * @param from Starting frame of the animation range
   * @param to Ending frame of the animation
   */
  createRange(e, t, r) {
    this._ranges[e] || (this._ranges[e] = new Am(e, t, r));
  }
  /**
   * Deletes an animation range by name
   * @param name Name of the animation range to delete
   * @param deleteFrames Specifies if the key frames for the range should also be deleted (true) or not (false)
   */
  deleteRange(e, t = !0) {
    const r = this._ranges[e];
    if (r) {
      if (t) {
        const n = r.from, i = r.to;
        for (let s = this._keys.length - 1; s >= 0; s--)
          this._keys[s].frame >= n && this._keys[s].frame <= i && this._keys.splice(s, 1);
      }
      this._ranges[e] = null;
    }
  }
  /**
   * Gets the animation range by name, or null if not defined
   * @param name Name of the animation range
   * @returns Nullable animation range
   */
  getRange(e) {
    return this._ranges[e];
  }
  /**
   * Gets the key frames from the animation
   * @returns The key frames of the animation
   */
  getKeys() {
    return this._keys;
  }
  /**
   * Gets the highest frame rate of the animation
   * @returns Highest frame rate of the animation
   */
  getHighestFrame() {
    let e = 0;
    for (let t = 0, r = this._keys.length; t < r; t++)
      e < this._keys[t].frame && (e = this._keys[t].frame);
    return e;
  }
  /**
   * Gets the easing function of the animation
   * @returns Easing function of the animation
   */
  getEasingFunction() {
    return this._easingFunction;
  }
  /**
   * Sets the easing function of the animation
   * @param easingFunction A custom mathematical formula for animation
   */
  setEasingFunction(e) {
    this._easingFunction = e;
  }
  /**
   * Interpolates a scalar linearly
   * @param startValue Start value of the animation curve
   * @param endValue End value of the animation curve
   * @param gradient Scalar amount to interpolate
   * @returns Interpolated scalar value
   */
  floatInterpolateFunction(e, t, r) {
    return Xt.Lerp(e, t, r);
  }
  /**
   * Interpolates a scalar cubically
   * @param startValue Start value of the animation curve
   * @param outTangent End tangent of the animation
   * @param endValue End value of the animation curve
   * @param inTangent Start tangent of the animation curve
   * @param gradient Scalar amount to interpolate
   * @returns Interpolated scalar value
   */
  floatInterpolateFunctionWithTangents(e, t, r, n, i) {
    return Xt.Hermite(e, t, r, n, i);
  }
  /**
   * Interpolates a quaternion using a spherical linear interpolation
   * @param startValue Start value of the animation curve
   * @param endValue End value of the animation curve
   * @param gradient Scalar amount to interpolate
   * @returns Interpolated quaternion value
   */
  quaternionInterpolateFunction(e, t, r) {
    return Ze.Slerp(e, t, r);
  }
  /**
   * Interpolates a quaternion cubically
   * @param startValue Start value of the animation curve
   * @param outTangent End tangent of the animation curve
   * @param endValue End value of the animation curve
   * @param inTangent Start tangent of the animation curve
   * @param gradient Scalar amount to interpolate
   * @returns Interpolated quaternion value
   */
  quaternionInterpolateFunctionWithTangents(e, t, r, n, i) {
    return Ze.Hermite(e, t, r, n, i).normalize();
  }
  /**
   * Interpolates a Vector3 linearly
   * @param startValue Start value of the animation curve
   * @param endValue End value of the animation curve
   * @param gradient Scalar amount to interpolate (value between 0 and 1)
   * @returns Interpolated scalar value
   */
  vector3InterpolateFunction(e, t, r) {
    return S.Lerp(e, t, r);
  }
  /**
   * Interpolates a Vector3 cubically
   * @param startValue Start value of the animation curve
   * @param outTangent End tangent of the animation
   * @param endValue End value of the animation curve
   * @param inTangent Start tangent of the animation curve
   * @param gradient Scalar amount to interpolate (value between 0 and 1)
   * @returns InterpolatedVector3 value
   */
  vector3InterpolateFunctionWithTangents(e, t, r, n, i) {
    return S.Hermite(e, t, r, n, i);
  }
  /**
   * Interpolates a Vector2 linearly
   * @param startValue Start value of the animation curve
   * @param endValue End value of the animation curve
   * @param gradient Scalar amount to interpolate (value between 0 and 1)
   * @returns Interpolated Vector2 value
   */
  vector2InterpolateFunction(e, t, r) {
    return at.Lerp(e, t, r);
  }
  /**
   * Interpolates a Vector2 cubically
   * @param startValue Start value of the animation curve
   * @param outTangent End tangent of the animation
   * @param endValue End value of the animation curve
   * @param inTangent Start tangent of the animation curve
   * @param gradient Scalar amount to interpolate (value between 0 and 1)
   * @returns Interpolated Vector2 value
   */
  vector2InterpolateFunctionWithTangents(e, t, r, n, i) {
    return at.Hermite(e, t, r, n, i);
  }
  /**
   * Interpolates a size linearly
   * @param startValue Start value of the animation curve
   * @param endValue End value of the animation curve
   * @param gradient Scalar amount to interpolate
   * @returns Interpolated Size value
   */
  sizeInterpolateFunction(e, t, r) {
    return Qd.Lerp(e, t, r);
  }
  /**
   * Interpolates a Color3 linearly
   * @param startValue Start value of the animation curve
   * @param endValue End value of the animation curve
   * @param gradient Scalar amount to interpolate
   * @returns Interpolated Color3 value
   */
  color3InterpolateFunction(e, t, r) {
    return Ne.Lerp(e, t, r);
  }
  /**
   * Interpolates a Color3 cubically
   * @param startValue Start value of the animation curve
   * @param outTangent End tangent of the animation
   * @param endValue End value of the animation curve
   * @param inTangent Start tangent of the animation curve
   * @param gradient Scalar amount to interpolate
   * @returns interpolated value
   */
  color3InterpolateFunctionWithTangents(e, t, r, n, i) {
    return Ne.Hermite(e, t, r, n, i);
  }
  /**
   * Interpolates a Color4 linearly
   * @param startValue Start value of the animation curve
   * @param endValue End value of the animation curve
   * @param gradient Scalar amount to interpolate
   * @returns Interpolated Color3 value
   */
  color4InterpolateFunction(e, t, r) {
    return xt.Lerp(e, t, r);
  }
  /**
   * Interpolates a Color4 cubically
   * @param startValue Start value of the animation curve
   * @param outTangent End tangent of the animation
   * @param endValue End value of the animation curve
   * @param inTangent Start tangent of the animation curve
   * @param gradient Scalar amount to interpolate
   * @returns interpolated value
   */
  color4InterpolateFunctionWithTangents(e, t, r, n, i) {
    return xt.Hermite(e, t, r, n, i);
  }
  /**
   * @internal Internal use only
   */
  _getKeyValue(e) {
    return typeof e == "function" ? e() : e;
  }
  /**
   * Evaluate the animation value at a given frame
   * @param currentFrame defines the frame where we want to evaluate the animation
   * @returns the animation value
   */
  evaluate(e) {
    return kH.key = 0, this._interpolate(e, kH);
  }
  /**
   * @internal Internal use only
   */
  _interpolate(e, t, r = !1) {
    var n;
    if (t.loopMode === st.ANIMATIONLOOPMODE_CONSTANT && t.repeatCount > 0)
      return t.highLimitValue.clone ? t.highLimitValue.clone() : t.highLimitValue;
    const i = this._keys, s = i.length;
    let a = t.key;
    for (; a >= 0 && e < i[a].frame; )
      --a;
    for (; a + 1 <= s - 1 && e >= i[a + 1].frame; )
      ++a;
    if (t.key = a, a < 0)
      return r ? void 0 : this._getKeyValue(i[0].value);
    if (a + 1 > s - 1)
      return r ? void 0 : this._getKeyValue(i[s - 1].value);
    const f = i[a], o = i[a + 1];
    if (r && (e === f.frame || e === o.frame))
      return;
    const d = this._getKeyValue(f.value), v = this._getKeyValue(o.value);
    if (f.interpolation === CI.STEP)
      return o.frame > e ? d : v;
    const u = f.outTangent !== void 0 && o.inTangent !== void 0, l = o.frame - f.frame;
    let P = (e - f.frame) / l;
    const p = f.easingFunction || this.getEasingFunction();
    switch (p !== null && (P = p.ease(P)), this.dataType) {
      case st.ANIMATIONTYPE_FLOAT: {
        const c = u ? this.floatInterpolateFunctionWithTangents(d, f.outTangent * l, v, o.inTangent * l, P) : this.floatInterpolateFunction(d, v, P);
        switch (t.loopMode) {
          case st.ANIMATIONLOOPMODE_CYCLE:
          case st.ANIMATIONLOOPMODE_CONSTANT:
          case st.ANIMATIONLOOPMODE_YOYO:
            return c;
          case st.ANIMATIONLOOPMODE_RELATIVE:
          case st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
            return ((n = t.offsetValue) !== null && n !== void 0 ? n : 0) * t.repeatCount + c;
        }
        break;
      }
      case st.ANIMATIONTYPE_QUATERNION: {
        const c = u ? this.quaternionInterpolateFunctionWithTangents(d, f.outTangent.scale(l), v, o.inTangent.scale(l), P) : this.quaternionInterpolateFunction(d, v, P);
        switch (t.loopMode) {
          case st.ANIMATIONLOOPMODE_CYCLE:
          case st.ANIMATIONLOOPMODE_CONSTANT:
          case st.ANIMATIONLOOPMODE_YOYO:
            return c;
          case st.ANIMATIONLOOPMODE_RELATIVE:
          case st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
            return c.addInPlace((t.offsetValue || ON).scale(t.repeatCount));
        }
        return c;
      }
      case st.ANIMATIONTYPE_VECTOR3: {
        const c = u ? this.vector3InterpolateFunctionWithTangents(d, f.outTangent.scale(l), v, o.inTangent.scale(l), P) : this.vector3InterpolateFunction(d, v, P);
        switch (t.loopMode) {
          case st.ANIMATIONLOOPMODE_CYCLE:
          case st.ANIMATIONLOOPMODE_CONSTANT:
          case st.ANIMATIONLOOPMODE_YOYO:
            return c;
          case st.ANIMATIONLOOPMODE_RELATIVE:
          case st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
            return c.add((t.offsetValue || yN).scale(t.repeatCount));
        }
        break;
      }
      case st.ANIMATIONTYPE_VECTOR2: {
        const c = u ? this.vector2InterpolateFunctionWithTangents(d, f.outTangent.scale(l), v, o.inTangent.scale(l), P) : this.vector2InterpolateFunction(d, v, P);
        switch (t.loopMode) {
          case st.ANIMATIONLOOPMODE_CYCLE:
          case st.ANIMATIONLOOPMODE_CONSTANT:
          case st.ANIMATIONLOOPMODE_YOYO:
            return c;
          case st.ANIMATIONLOOPMODE_RELATIVE:
          case st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
            return c.add((t.offsetValue || kN).scale(t.repeatCount));
        }
        break;
      }
      case st.ANIMATIONTYPE_SIZE: {
        switch (t.loopMode) {
          case st.ANIMATIONLOOPMODE_CYCLE:
          case st.ANIMATIONLOOPMODE_CONSTANT:
          case st.ANIMATIONLOOPMODE_YOYO:
            return this.sizeInterpolateFunction(d, v, P);
          case st.ANIMATIONLOOPMODE_RELATIVE:
          case st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
            return this.sizeInterpolateFunction(d, v, P).add((t.offsetValue || EN).scale(t.repeatCount));
        }
        break;
      }
      case st.ANIMATIONTYPE_COLOR3: {
        const c = u ? this.color3InterpolateFunctionWithTangents(d, f.outTangent.scale(l), v, o.inTangent.scale(l), P) : this.color3InterpolateFunction(d, v, P);
        switch (t.loopMode) {
          case st.ANIMATIONLOOPMODE_CYCLE:
          case st.ANIMATIONLOOPMODE_CONSTANT:
          case st.ANIMATIONLOOPMODE_YOYO:
            return c;
          case st.ANIMATIONLOOPMODE_RELATIVE:
          case st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
            return c.add((t.offsetValue || FN).scale(t.repeatCount));
        }
        break;
      }
      case st.ANIMATIONTYPE_COLOR4: {
        const c = u ? this.color4InterpolateFunctionWithTangents(d, f.outTangent.scale(l), v, o.inTangent.scale(l), P) : this.color4InterpolateFunction(d, v, P);
        switch (t.loopMode) {
          case st.ANIMATIONLOOPMODE_CYCLE:
          case st.ANIMATIONLOOPMODE_CONSTANT:
          case st.ANIMATIONLOOPMODE_YOYO:
            return c;
          case st.ANIMATIONLOOPMODE_RELATIVE:
          case st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
            return c.add((t.offsetValue || NN).scale(t.repeatCount));
        }
        break;
      }
      case st.ANIMATIONTYPE_MATRIX: {
        switch (t.loopMode) {
          case st.ANIMATIONLOOPMODE_CYCLE:
          case st.ANIMATIONLOOPMODE_CONSTANT:
          case st.ANIMATIONLOOPMODE_YOYO:
            return st.AllowMatricesInterpolation ? this.matrixInterpolateFunction(d, v, P, t.workValue) : d;
          case st.ANIMATIONLOOPMODE_RELATIVE:
          case st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
            return d;
        }
        break;
      }
    }
    return 0;
  }
  /**
   * Defines the function to use to interpolate matrices
   * @param startValue defines the start matrix
   * @param endValue defines the end matrix
   * @param gradient defines the gradient between both matrices
   * @param result defines an optional target matrix where to store the interpolation
   * @returns the interpolated matrix
   */
  matrixInterpolateFunction(e, t, r, n) {
    return st.AllowMatrixDecomposeForInterpolation ? n ? (he.DecomposeLerpToRef(e, t, r, n), n) : he.DecomposeLerp(e, t, r) : n ? (he.LerpToRef(e, t, r, n), n) : he.Lerp(e, t, r);
  }
  /**
   * Makes a copy of the animation
   * @returns Cloned animation
   */
  clone() {
    const e = new st(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode);
    if (e.enableBlending = this.enableBlending, e.blendingSpeed = this.blendingSpeed, this._keys && e.setKeys(this._keys), this._ranges) {
      e._ranges = {};
      for (const t in this._ranges) {
        const r = this._ranges[t];
        r && (e._ranges[t] = r.clone());
      }
    }
    return e;
  }
  /**
   * Sets the key frames of the animation
   * @param values The animation key frames to set
   * @param dontClone Whether to clone the keys or not (default is false, so the array of keys is cloned)
   */
  setKeys(e, t = !1) {
    this._keys = t ? e : e.slice(0);
  }
  /**
   * Creates a key for the frame passed as a parameter and adds it to the animation IF a key doesn't already exist for that frame
   * @param frame Frame number
   * @returns The key index if the key was added or the index of the pre existing key if the frame passed as parameter already has a corresponding key
   */
  createKeyForFrame(e) {
    kH.key = 0;
    const t = this._interpolate(e, kH, !0);
    if (!t)
      return kH.key === e ? kH.key : kH.key + 1;
    const r = {
      frame: e,
      value: t.clone ? t.clone() : t
    };
    return this._keys.splice(kH.key + 1, 0, r), kH.key + 1;
  }
  /**
   * Serializes the animation to an object
   * @returns Serialized object
   */
  serialize() {
    const e = {};
    e.name = this.name, e.property = this.targetProperty, e.framePerSecond = this.framePerSecond, e.dataType = this.dataType, e.loopBehavior = this.loopMode, e.enableBlending = this.enableBlending, e.blendingSpeed = this.blendingSpeed;
    const t = this.dataType;
    e.keys = [];
    const r = this.getKeys();
    for (let n = 0; n < r.length; n++) {
      const i = r[n], s = {};
      switch (s.frame = i.frame, t) {
        case st.ANIMATIONTYPE_FLOAT:
          s.values = [i.value], i.inTangent !== void 0 && s.values.push(i.inTangent), i.outTangent !== void 0 && (i.inTangent === void 0 && s.values.push(void 0), s.values.push(i.outTangent)), i.interpolation !== void 0 && (i.inTangent === void 0 && s.values.push(void 0), i.outTangent === void 0 && s.values.push(void 0), s.values.push(i.interpolation));
          break;
        case st.ANIMATIONTYPE_QUATERNION:
        case st.ANIMATIONTYPE_MATRIX:
        case st.ANIMATIONTYPE_VECTOR3:
        case st.ANIMATIONTYPE_COLOR3:
        case st.ANIMATIONTYPE_COLOR4:
          s.values = i.value.asArray(), i.inTangent != null && s.values.push(i.inTangent.asArray()), i.outTangent != null && (i.inTangent === void 0 && s.values.push(void 0), s.values.push(i.outTangent.asArray())), i.interpolation !== void 0 && (i.inTangent === void 0 && s.values.push(void 0), i.outTangent === void 0 && s.values.push(void 0), s.values.push(i.interpolation));
          break;
      }
      e.keys.push(s);
    }
    e.ranges = [];
    for (const n in this._ranges) {
      const i = this._ranges[n];
      if (!i)
        continue;
      const s = {};
      s.name = n, s.from = i.from, s.to = i.to, e.ranges.push(s);
    }
    return e;
  }
  /**
   * @internal
   */
  static _UniversalLerp(e, t, r) {
    const n = e.constructor;
    return n.Lerp ? n.Lerp(e, t, r) : n.Slerp ? n.Slerp(e, t, r) : e.toFixed ? e * (1 - r) + r * t : t;
  }
  /**
   * Parses an animation object and creates an animation
   * @param parsedAnimation Parsed animation object
   * @returns Animation object
   */
  static Parse(e) {
    const t = new st(e.name, e.property, e.framePerSecond, e.dataType, e.loopBehavior), r = e.dataType, n = [];
    let i, s;
    for (e.enableBlending && (t.enableBlending = e.enableBlending), e.blendingSpeed && (t.blendingSpeed = e.blendingSpeed), s = 0; s < e.keys.length; s++) {
      const a = e.keys[s];
      let f, o, d;
      switch (r) {
        case st.ANIMATIONTYPE_FLOAT:
          i = a.values[0], a.values.length >= 2 && (f = a.values[1]), a.values.length >= 3 && (o = a.values[2]), a.values.length >= 4 && (d = a.values[3]);
          break;
        case st.ANIMATIONTYPE_QUATERNION:
          if (i = Ze.FromArray(a.values), a.values.length >= 8) {
            const u = Ze.FromArray(a.values.slice(4, 8));
            u.equals(Ze.Zero()) || (f = u);
          }
          if (a.values.length >= 12) {
            const u = Ze.FromArray(a.values.slice(8, 12));
            u.equals(Ze.Zero()) || (o = u);
          }
          a.values.length >= 13 && (d = a.values[12]);
          break;
        case st.ANIMATIONTYPE_MATRIX:
          i = he.FromArray(a.values), a.values.length >= 17 && (d = a.values[16]);
          break;
        case st.ANIMATIONTYPE_COLOR3:
          i = Ne.FromArray(a.values), a.values[3] && (f = Ne.FromArray(a.values[3])), a.values[4] && (o = Ne.FromArray(a.values[4])), a.values[5] && (d = a.values[5]);
          break;
        case st.ANIMATIONTYPE_COLOR4:
          i = xt.FromArray(a.values), a.values[4] && (f = xt.FromArray(a.values[4])), a.values[5] && (o = xt.FromArray(a.values[5])), a.values[6] && (d = xt.FromArray(a.values[6]));
          break;
        case st.ANIMATIONTYPE_VECTOR3:
        default:
          i = S.FromArray(a.values), a.values[3] && (f = S.FromArray(a.values[3])), a.values[4] && (o = S.FromArray(a.values[4])), a.values[5] && (d = a.values[5]);
          break;
      }
      const v = {};
      v.frame = a.frame, v.value = i, f != null && (v.inTangent = f), o != null && (v.outTangent = o), d != null && (v.interpolation = d), n.push(v);
    }
    if (t.setKeys(n), e.ranges)
      for (s = 0; s < e.ranges.length; s++)
        i = e.ranges[s], t.createRange(i.name, i.from, i.to);
    return t;
  }
  /**
   * Appends the serialized animations from the source animations
   * @param source Source containing the animations
   * @param destination Target to store the animations
   */
  static AppendSerializedAnimations(e, t) {
    jt.AppendSerializedAnimations(e, t);
  }
  /**
   * Creates a new animation or an array of animations from a snippet saved in a remote file
   * @param name defines the name of the animation to create (can be null or empty to use the one from the json data)
   * @param url defines the url to load from
   * @returns a promise that will resolve to the new animation or an array of animations
   */
  static ParseFromFileAsync(e, t) {
    return new Promise((r, n) => {
      const i = new ho();
      i.addEventListener("readystatechange", () => {
        if (i.readyState == 4)
          if (i.status == 200) {
            let s = JSON.parse(i.responseText);
            if (s.animations && (s = s.animations), s.length) {
              const a = [];
              for (const f of s)
                a.push(this.Parse(f));
              r(a);
            } else {
              const a = this.Parse(s);
              e && (a.name = e), r(a);
            }
          } else
            n("Unable to load the animation");
      }), i.open("GET", t), i.send();
    });
  }
  /**
   * Creates an animation or an array of animations from a snippet saved by the Inspector
   * @param snippetId defines the snippet to load
   * @returns a promise that will resolve to the new animation or a new array of animations
   */
  static ParseFromSnippetAsync(e) {
    return new Promise((t, r) => {
      const n = new ho();
      n.addEventListener("readystatechange", () => {
        if (n.readyState == 4)
          if (n.status == 200) {
            const i = JSON.parse(JSON.parse(n.responseText).jsonPayload);
            if (i.animations) {
              const s = JSON.parse(i.animations), a = [];
              for (const f of s.animations) {
                const o = this.Parse(f);
                o.snippetId = e, a.push(o);
              }
              t(a);
            } else {
              const s = JSON.parse(i.animation), a = this.Parse(s);
              a.snippetId = e, t(a);
            }
          } else
            r("Unable to load the snippet " + e);
      }), n.open("GET", this.SnippetUrl + "/" + e.replace(/#/g, "/")), n.send();
    });
  }
}
st._UniqueIdGenerator = 0;
st.AllowMatricesInterpolation = !1;
st.AllowMatrixDecomposeForInterpolation = !0;
st.SnippetUrl = "https://snippet.babylonjs.com";
st.ANIMATIONTYPE_FLOAT = 0;
st.ANIMATIONTYPE_VECTOR3 = 1;
st.ANIMATIONTYPE_QUATERNION = 2;
st.ANIMATIONTYPE_MATRIX = 3;
st.ANIMATIONTYPE_COLOR3 = 4;
st.ANIMATIONTYPE_COLOR4 = 7;
st.ANIMATIONTYPE_VECTOR2 = 5;
st.ANIMATIONTYPE_SIZE = 6;
st.ANIMATIONLOOPMODE_RELATIVE = 0;
st.ANIMATIONLOOPMODE_CYCLE = 1;
st.ANIMATIONLOOPMODE_CONSTANT = 2;
st.ANIMATIONLOOPMODE_YOYO = 4;
st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT = 5;
st.CreateFromSnippetAsync = st.ParseFromSnippetAsync;
Ue("BABYLON.Animation", st);
Cs._AnimationRangeFactory = (A, e, t) => new Am(A, e, t);
class I$ extends wa {
  /**
   * Instantiate the action
   * @param triggerOptions defines the trigger options
   * @param target defines the object containing the value to interpolate
   * @param propertyPath defines the path to the property in the target object
   * @param value defines the target value at the end of the interpolation
   * @param duration defines the time it will take for the property to interpolate to the value.
   * @param condition defines the trigger related conditions
   * @param stopOtherAnimations defines if the other scene animations should be stopped when the action has been triggered
   * @param onInterpolationDone defines a callback raised once the interpolation animation has been done
   */
  constructor(e, t, r, n, i = 1e3, s, a, f) {
    super(e, s), this.duration = 1e3, this.onInterpolationDoneObservable = new Oe(), this.propertyPath = r, this.value = n, this.duration = i, this.stopOtherAnimations = a, this.onInterpolationDone = f, this._target = this._effectiveTarget = t;
  }
  /** @internal */
  _prepare() {
    this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);
  }
  /**
   * Execute the action starts the value interpolation.
   */
  execute() {
    const e = this._actionManager.getScene(), t = [
      {
        frame: 0,
        value: this._effectiveTarget[this._property]
      },
      {
        frame: 100,
        value: this.value
      }
    ];
    let r;
    if (typeof this.value == "number")
      r = st.ANIMATIONTYPE_FLOAT;
    else if (this.value instanceof Ne)
      r = st.ANIMATIONTYPE_COLOR3;
    else if (this.value instanceof S)
      r = st.ANIMATIONTYPE_VECTOR3;
    else if (this.value instanceof he)
      r = st.ANIMATIONTYPE_MATRIX;
    else if (this.value instanceof Ze)
      r = st.ANIMATIONTYPE_QUATERNION;
    else {
      Se.Warn("InterpolateValueAction: Unsupported type (" + typeof this.value + ")");
      return;
    }
    const n = new st("InterpolateValueAction", this._property, 100 * (1e3 / this.duration), r, st.ANIMATIONLOOPMODE_CONSTANT);
    n.setKeys(t), this.stopOtherAnimations && e.stopAnimation(this._effectiveTarget);
    const i = () => {
      this.onInterpolationDoneObservable.notifyObservers(this), this.onInterpolationDone && this.onInterpolationDone();
    };
    e.beginDirectAnimation(this._effectiveTarget, [n], 0, 100, !1, 1, i);
  }
  /**
   * Serializes the actions and its related information.
   * @param parent defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    return super._serialize({
      name: "InterpolateValueAction",
      properties: [
        wa._GetTargetProperty(this._target),
        { name: "propertyPath", value: this.propertyPath },
        { name: "value", value: wa._SerializeValueAsString(this.value) },
        { name: "duration", value: wa._SerializeValueAsString(this.duration) },
        { name: "stopOtherAnimations", value: wa._SerializeValueAsString(this.stopOtherAnimations) || !1 }
      ]
    }, e);
  }
}
Ue("BABYLON.InterpolateValueAction", I$);
class R$ {
  /**
   * Gets the current frame of the runtime animation
   */
  get currentFrame() {
    return this._currentFrame;
  }
  /**
   * Gets the weight of the runtime animation
   */
  get weight() {
    return this._weight;
  }
  /**
   * Gets the current value of the runtime animation
   */
  get currentValue() {
    return this._currentValue;
  }
  /**
   * Gets or sets the target path of the runtime animation
   */
  get targetPath() {
    return this._targetPath;
  }
  /**
   * Gets the actual target of the runtime animation
   */
  get target() {
    return this._currentActiveTarget;
  }
  /**
   * Gets the additive state of the runtime animation
   */
  get isAdditive() {
    return this._host && this._host.isAdditive;
  }
  /**
   * Create a new RuntimeAnimation object
   * @param target defines the target of the animation
   * @param animation defines the source animation object
   * @param scene defines the hosting scene
   * @param host defines the initiating Animatable
   */
  constructor(e, t, r, n) {
    if (this._events = new Array(), this._currentFrame = 0, this._originalValue = new Array(), this._originalBlendValue = null, this._offsetsCache = {}, this._highLimitsCache = {}, this._stopped = !1, this._blendingFactor = 0, this._currentValue = null, this._currentActiveTarget = null, this._directTarget = null, this._targetPath = "", this._weight = 1, this._absoluteFrameOffset = 0, this._previousElapsedTime = 0, this._previousAbsoluteFrame = 0, this._targetIsArray = !1, this._animation = t, this._target = e, this._scene = r, this._host = n, this._activeTargets = [], t._runtimeAnimations.push(this), this._animationState = {
      key: 0,
      repeatCount: 0,
      loopMode: this._getCorrectLoopMode()
    }, this._animation.dataType === st.ANIMATIONTYPE_MATRIX && (this._animationState.workValue = he.Zero()), this._keys = this._animation.getKeys(), this._minFrame = this._keys[0].frame, this._maxFrame = this._keys[this._keys.length - 1].frame, this._minValue = this._keys[0].value, this._maxValue = this._keys[this._keys.length - 1].value, this._minFrame !== 0) {
      const s = { frame: 0, value: this._minValue };
      this._keys.splice(0, 0, s);
    }
    if (this._target instanceof Array) {
      let s = 0;
      for (const a of this._target)
        this._preparePath(a, s), this._getOriginalValues(s), s++;
      this._targetIsArray = !0;
    } else
      this._preparePath(this._target), this._getOriginalValues(), this._targetIsArray = !1, this._directTarget = this._activeTargets[0];
    const i = t.getEvents();
    i && i.length > 0 && i.forEach((s) => {
      this._events.push(s._clone());
    }), this._enableBlending = e && e.animationPropertiesOverride ? e.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
  }
  _preparePath(e, t = 0) {
    const r = this._animation.targetPropertyPath;
    if (r.length > 1) {
      let n = e[r[0]];
      for (let i = 1; i < r.length - 1; i++)
        n = n[r[i]];
      this._targetPath = r[r.length - 1], this._activeTargets[t] = n;
    } else
      this._targetPath = r[0], this._activeTargets[t] = e;
  }
  /**
   * Gets the animation from the runtime animation
   */
  get animation() {
    return this._animation;
  }
  /**
   * Resets the runtime animation to the beginning
   * @param restoreOriginal defines whether to restore the target property to the original value
   */
  reset(e = !1) {
    if (e)
      if (this._target instanceof Array) {
        let t = 0;
        for (const r of this._target)
          this._originalValue[t] !== void 0 && this._setValue(r, this._activeTargets[t], this._originalValue[t], -1, t), t++;
      } else
        this._originalValue[0] !== void 0 && this._setValue(this._target, this._directTarget, this._originalValue[0], -1, 0);
    this._offsetsCache = {}, this._highLimitsCache = {}, this._currentFrame = 0, this._blendingFactor = 0;
    for (let t = 0; t < this._events.length; t++)
      this._events[t].isDone = !1;
  }
  /**
   * Specifies if the runtime animation is stopped
   * @returns Boolean specifying if the runtime animation is stopped
   */
  isStopped() {
    return this._stopped;
  }
  /**
   * Disposes of the runtime animation
   */
  dispose() {
    const e = this._animation.runtimeAnimations.indexOf(this);
    e > -1 && this._animation.runtimeAnimations.splice(e, 1);
  }
  /**
   * Apply the interpolated value to the target
   * @param currentValue defines the value computed by the animation
   * @param weight defines the weight to apply to this value (Defaults to 1.0)
   */
  setValue(e, t) {
    if (this._targetIsArray) {
      for (let r = 0; r < this._target.length; r++) {
        const n = this._target[r];
        this._setValue(n, this._activeTargets[r], e, t, r);
      }
      return;
    }
    this._setValue(this._target, this._directTarget, e, t, 0);
  }
  _getOriginalValues(e = 0) {
    let t;
    const r = this._activeTargets[e];
    r.getLocalMatrix && this._targetPath === "_matrix" ? t = r.getLocalMatrix() : t = r[this._targetPath], t && t.clone ? this._originalValue[e] = t.clone() : this._originalValue[e] = t;
  }
  _setValue(e, t, r, n, i) {
    if (this._currentActiveTarget = t, this._weight = n, this._enableBlending && this._blendingFactor <= 1) {
      if (!this._originalBlendValue) {
        const a = t[this._targetPath];
        a.clone ? this._originalBlendValue = a.clone() : this._originalBlendValue = a;
      }
      this._originalBlendValue.m ? st.AllowMatrixDecomposeForInterpolation ? this._currentValue ? he.DecomposeLerpToRef(this._originalBlendValue, r, this._blendingFactor, this._currentValue) : this._currentValue = he.DecomposeLerp(this._originalBlendValue, r, this._blendingFactor) : this._currentValue ? he.LerpToRef(this._originalBlendValue, r, this._blendingFactor, this._currentValue) : this._currentValue = he.Lerp(this._originalBlendValue, r, this._blendingFactor) : this._currentValue = st._UniversalLerp(this._originalBlendValue, r, this._blendingFactor);
      const s = e && e.animationPropertiesOverride ? e.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
      this._blendingFactor += s;
    } else
      this._currentValue ? this._currentValue.copyFrom ? this._currentValue.copyFrom(r) : this._currentValue = r : r != null && r.clone ? this._currentValue = r.clone() : this._currentValue = r;
    n !== -1 ? this._scene._registerTargetForLateAnimationBinding(this, this._originalValue[i]) : this._animationState.loopMode === st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT ? this._currentValue.addToRef ? this._currentValue.addToRef(this._originalValue[i], t[this._targetPath]) : t[this._targetPath] = this._originalValue[i] + this._currentValue : t[this._targetPath] = this._currentValue, e.markAsDirty && e.markAsDirty(this._animation.targetProperty);
  }
  /**
   * Gets the loop pmode of the runtime animation
   * @returns Loop Mode
   */
  _getCorrectLoopMode() {
    return this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.loopMode : this._animation.loopMode;
  }
  /**
   * Move the current animation to a given frame
   * @param frame defines the frame to move to
   */
  goToFrame(e) {
    const t = this._animation.getKeys();
    e < t[0].frame ? e = t[0].frame : e > t[t.length - 1].frame && (e = t[t.length - 1].frame);
    const r = this._events;
    if (r.length)
      for (let i = 0; i < r.length; i++)
        r[i].onlyOnce || (r[i].isDone = r[i].frame < e);
    this._currentFrame = e;
    const n = this._animation._interpolate(e, this._animationState);
    this.setValue(n, -1);
  }
  /**
   * @internal Internal use only
   */
  _prepareForSpeedRatioChange(e) {
    const t = this._previousElapsedTime * (this._animation.framePerSecond * e) / 1e3;
    this._absoluteFrameOffset = this._previousAbsoluteFrame - t;
  }
  /**
   * Execute the current animation
   * @param elapsedTimeSinceAnimationStart defines the elapsed time (in milliseconds) since the animation was started
   * @param from defines the lower frame of the animation range
   * @param to defines the upper frame of the animation range
   * @param loop defines if the current animation must loop
   * @param speedRatio defines the current speed ratio
   * @param weight defines the weight of the animation (default is -1 so no weight)
   * @returns a boolean indicating if the animation is running
   */
  animate(e, t, r, n, i, s = -1) {
    const a = this._animation, f = a.targetPropertyPath;
    if (!f || f.length < 1)
      return this._stopped = !0, !1;
    let o = !0;
    (t < this._minFrame || t > this._maxFrame) && (t = this._minFrame), (r < this._minFrame || r > this._maxFrame) && (r = this._maxFrame);
    const d = r - t;
    let v, u = e * (a.framePerSecond * i) / 1e3 + this._absoluteFrameOffset, l = 0;
    if (n && this._animationState.loopMode === st.ANIMATIONLOOPMODE_YOYO) {
      const H = (u - t) / d;
      u = Math.abs(Math.sin(H * Math.PI)) * d + t;
    }
    if (this._previousElapsedTime = e, this._previousAbsoluteFrame = u, !n && r >= t && u >= d)
      o = !1, l = a._getKeyValue(this._maxValue);
    else if (!n && t >= r && u <= d)
      o = !1, l = a._getKeyValue(this._minValue);
    else if (this._animationState.loopMode !== st.ANIMATIONLOOPMODE_CYCLE) {
      const H = r.toString() + t.toString();
      if (!this._offsetsCache[H]) {
        this._animationState.repeatCount = 0, this._animationState.loopMode = st.ANIMATIONLOOPMODE_CYCLE;
        const T = a._interpolate(t, this._animationState), q = a._interpolate(r, this._animationState);
        switch (this._animationState.loopMode = this._getCorrectLoopMode(), a.dataType) {
          case st.ANIMATIONTYPE_FLOAT:
            this._offsetsCache[H] = q - T;
            break;
          case st.ANIMATIONTYPE_QUATERNION:
            this._offsetsCache[H] = q.subtract(T);
            break;
          case st.ANIMATIONTYPE_VECTOR3:
            this._offsetsCache[H] = q.subtract(T);
            break;
          case st.ANIMATIONTYPE_VECTOR2:
            this._offsetsCache[H] = q.subtract(T);
            break;
          case st.ANIMATIONTYPE_SIZE:
            this._offsetsCache[H] = q.subtract(T);
            break;
          case st.ANIMATIONTYPE_COLOR3:
            this._offsetsCache[H] = q.subtract(T);
            break;
        }
        this._highLimitsCache[H] = q;
      }
      l = this._highLimitsCache[H], v = this._offsetsCache[H];
    }
    if (v === void 0)
      switch (a.dataType) {
        case st.ANIMATIONTYPE_FLOAT:
          v = 0;
          break;
        case st.ANIMATIONTYPE_QUATERNION:
          v = ON;
          break;
        case st.ANIMATIONTYPE_VECTOR3:
          v = yN;
          break;
        case st.ANIMATIONTYPE_VECTOR2:
          v = kN;
          break;
        case st.ANIMATIONTYPE_SIZE:
          v = EN;
          break;
        case st.ANIMATIONTYPE_COLOR3:
          v = FN;
          break;
        case st.ANIMATIONTYPE_COLOR4:
          v = NN;
          break;
      }
    let P;
    if (this._host && this._host.syncRoot) {
      const H = this._host.syncRoot, T = (H.masterFrame - H.fromFrame) / (H.toFrame - H.fromFrame);
      P = t + d * T;
    } else
      u > 0 && t > r || u < 0 && t < r ? P = o && d !== 0 ? r + u % d : t : P = o && d !== 0 ? t + u % d : r;
    const p = this._events;
    if (i > 0 && this.currentFrame > P || i < 0 && this.currentFrame < P) {
      this._onLoop();
      for (let H = 0; H < p.length; H++)
        p[H].onlyOnce || (p[H].isDone = !1);
      this._animationState.key = i > 0 ? 0 : a.getKeys().length - 1;
    }
    this._currentFrame = P, this._animationState.repeatCount = d === 0 ? 0 : u / d >> 0, this._animationState.highLimitValue = l, this._animationState.offsetValue = v;
    const c = a._interpolate(P, this._animationState);
    if (this.setValue(c, s), p.length) {
      for (let H = 0; H < p.length; H++)
        if (d > 0 && P >= p[H].frame && p[H].frame >= t || d < 0 && P <= p[H].frame && p[H].frame <= t) {
          const T = p[H];
          T.isDone || (T.onlyOnce && (p.splice(H, 1), H--), T.isDone = !0, T.action(P));
        }
    }
    return o || (this._stopped = !0), o;
  }
}
function u9() {
  return typeof window < "u";
}
function Mw() {
  return typeof navigator < "u";
}
function $w() {
  return typeof document < "u";
}
function gR(A) {
  let e = "", t = A.firstChild;
  for (; t; )
    t.nodeType === 3 && (e += t.textContent), t = t.nextSibling;
  return e;
}
const I9e = {
  /**
   * Checks if the window object exists
   * @returns true if the window object exists
   */
  IsWindowObjectExist: u9,
  /**
   * Checks if the navigator object exists
   * @returns true if the navigator object exists
   */
  IsNavigatorAvailable: Mw,
  /**
   * Check if the document object exists
   * @returns true if the document object exists
   */
  IsDocumentAvailable: $w,
  /**
   * Extracts text content from a DOM element hierarchy
   * @param element defines the root element
   * @returns a string
   */
  GetDOMTextContent: gR
};
class Yi {
  /**
   * Gets either window.performance.now() if supported or Date.now() else
   */
  static get Now() {
    return u9() && window.performance && window.performance.now ? window.performance.now() : Date.now();
  }
}
class em {
}
em.FilesToLoad = {};
class V$ {
  /**
   * Function used to defines an exponential back off strategy
   * @param maxRetries defines the maximum number of retries (3 by default)
   * @param baseInterval defines the interval between retries
   * @returns the strategy function to use
   */
  static ExponentialBackoff(e = 3, t = 500) {
    return (r, n, i) => n.status !== 0 || i >= e || r.indexOf("file:") !== -1 ? -1 : Math.pow(2, i) * t;
  }
}
class dm extends Error {
}
dm._setPrototypeOf = Object.setPrototypeOf || ((A, e) => (A.__proto__ = e, A));
const Z2 = {
  // Mesh errors 0-999
  /** Invalid or empty mesh vertex positions. */
  MeshInvalidPositionsError: 0,
  // Texture errors 1000-1999
  /** Unsupported texture found. */
  UnsupportedTextureError: 1e3,
  // GLTFLoader errors 2000-2999
  /** Unexpected magic number found in GLTF file header. */
  GLTFLoaderUnexpectedMagicError: 2e3,
  // SceneLoader errors 3000-3999
  /** SceneLoader generic error code. Ideally wraps the inner exception. */
  SceneLoaderError: 3e3,
  // File related errors 4000-4999
  /** Load file error */
  LoadFileError: 4e3,
  /** Request file error */
  RequestFileError: 4001,
  /** Read file error */
  ReadFileError: 4002
};
class O0 extends dm {
  /**
   * Creates a new RuntimeError
   * @param message defines the message of the error
   * @param errorCode the error code
   * @param innerError the error that caused the outer error
   */
  constructor(e, t, r) {
    super(e), this.errorCode = t, this.innerError = r, this.name = "RuntimeError", dm._setPrototypeOf(this, O0.prototype);
  }
}
const C$ = (A, e) => A.endsWith(e), O$ = (A, e) => A ? A.startsWith(e) : !1, QN = (A) => {
  if (typeof TextDecoder < "u")
    return new TextDecoder().decode(A);
  let e = "";
  for (let t = 0; t < A.byteLength; t++)
    e += String.fromCharCode(A[t]);
  return e;
}, XR = (A) => {
  const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  let t = "", r, n, i, s, a, f, o, d = 0;
  const v = ArrayBuffer.isView(A) ? new Uint8Array(A.buffer, A.byteOffset, A.byteLength) : new Uint8Array(A);
  for (; d < v.length; )
    r = v[d++], n = d < v.length ? v[d++] : Number.NaN, i = d < v.length ? v[d++] : Number.NaN, s = r >> 2, a = (r & 3) << 4 | n >> 4, f = (n & 15) << 2 | i >> 6, o = i & 63, isNaN(n) ? f = o = 64 : isNaN(i) && (o = 64), t += e.charAt(s) + e.charAt(a) + e.charAt(f) + e.charAt(o);
  return t;
}, bO = (A) => atob(A), TR = (A) => {
  const e = bO(A), t = e.length, r = new Uint8Array(new ArrayBuffer(t));
  for (let n = 0; n < t; n++)
    r[n] = e.charCodeAt(n);
  return r.buffer;
}, y$ = (A, e) => {
  let t = String(A);
  for (; t.length < e; )
    t = "0" + t;
  return t;
}, R9e = {
  EndsWith: C$,
  StartsWith: O$,
  Decode: QN,
  EncodeArrayBufferToBase64: XR,
  DecodeBase64ToString: bO,
  DecodeBase64ToBinary: TR,
  PadNumber: y$
}, V9e = "attribute", C9e = "varying";
class DI {
  constructor() {
    this.children = [];
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  isValid(e) {
    return !0;
  }
  process(e, t) {
    var r, n, i, s, a, f, o;
    let d = "";
    if (this.line) {
      let v = this.line;
      const u = t.processor;
      if (u) {
        u.lineProcessor && (v = u.lineProcessor(v, t.isFragment, t.processingContext));
        const l = (n = (r = t.processor) === null || r === void 0 ? void 0 : r.attributeKeywordName) !== null && n !== void 0 ? n : V9e, P = t.isFragment && (!((i = t.processor) === null || i === void 0) && i.varyingFragmentKeywordName) ? (s = t.processor) === null || s === void 0 ? void 0 : s.varyingFragmentKeywordName : !t.isFragment && (!((a = t.processor) === null || a === void 0) && a.varyingVertexKeywordName) ? (f = t.processor) === null || f === void 0 ? void 0 : f.varyingVertexKeywordName : C9e;
        !t.isFragment && u.attributeProcessor && this.line.startsWith(l) ? v = u.attributeProcessor(this.line, e, t.processingContext) : u.varyingProcessor && (!((o = u.varyingCheck) === null || o === void 0) && o.call(u, this.line, t.isFragment) || !u.varyingCheck && this.line.startsWith(P)) ? v = u.varyingProcessor(this.line, t.isFragment, e, t.processingContext) : u.uniformProcessor && u.uniformRegexp && u.uniformRegexp.test(this.line) ? t.lookForClosingBracketForUniformBuffer || (v = u.uniformProcessor(this.line, t.isFragment, e, t.processingContext)) : u.uniformBufferProcessor && u.uniformBufferRegexp && u.uniformBufferRegexp.test(this.line) ? t.lookForClosingBracketForUniformBuffer || (v = u.uniformBufferProcessor(this.line, t.isFragment, t.processingContext), t.lookForClosingBracketForUniformBuffer = !0) : u.textureProcessor && u.textureRegexp && u.textureRegexp.test(this.line) ? v = u.textureProcessor(this.line, t.isFragment, e, t.processingContext) : (u.uniformProcessor || u.uniformBufferProcessor) && this.line.startsWith("uniform") && !t.lookForClosingBracketForUniformBuffer && (/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line) ? u.uniformProcessor && (v = u.uniformProcessor(this.line, t.isFragment, e, t.processingContext)) : u.uniformBufferProcessor && (v = u.uniformBufferProcessor(this.line, t.isFragment, t.processingContext), t.lookForClosingBracketForUniformBuffer = !0)), t.lookForClosingBracketForUniformBuffer && this.line.indexOf("}") !== -1 && (t.lookForClosingBracketForUniformBuffer = !1, u.endOfUniformBufferProcessor && (v = u.endOfUniformBufferProcessor(this.line, t.isFragment, t.processingContext)));
      }
      d += v + `
`;
    }
    return this.children.forEach((v) => {
      d += v.process(e, t);
    }), this.additionalDefineKey && (e[this.additionalDefineKey] = this.additionalDefineValue || "true"), d;
  }
}
class O9e {
  constructor() {
    this._lines = [];
  }
  get currentLine() {
    return this._lines[this.lineIndex];
  }
  get canRead() {
    return this.lineIndex < this._lines.length - 1;
  }
  set lines(e) {
    this._lines.length = 0;
    for (const t of e) {
      if (!t || t === "\r")
        continue;
      if (t[0] === "#") {
        this._lines.push(t);
        continue;
      }
      const r = t.trim();
      if (!r)
        continue;
      if (r.startsWith("//")) {
        this._lines.push(t);
        continue;
      }
      const n = r.indexOf(";");
      if (n === -1)
        this._lines.push(r);
      else if (n === r.length - 1)
        r.length > 1 && this._lines.push(r);
      else {
        const i = t.split(";");
        for (let s = 0; s < i.length; s++) {
          let a = i[s];
          a && (a = a.trim(), a && this._lines.push(a + (s !== i.length - 1 ? ";" : "")));
        }
      }
    }
  }
}
class PE extends DI {
  process(e, t) {
    for (let r = 0; r < this.children.length; r++) {
      const n = this.children[r];
      if (n.isValid(e))
        return n.process(e, t);
    }
    return "";
  }
}
class y9e extends DI {
  isValid(e) {
    return this.testExpression.isTrue(e);
  }
}
class M1 {
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  isTrue(e) {
    return !0;
  }
  static postfixToInfix(e) {
    const t = [];
    for (const r of e)
      if (M1._OperatorPriority[r] === void 0)
        t.push(r);
      else {
        const n = t[t.length - 1], i = t[t.length - 2];
        t.length -= 2, t.push(`(${i}${r}${n})`);
      }
    return t[t.length - 1];
  }
  /**
   * Converts an infix expression to a postfix expression.
   *
   * This method is used to transform infix expressions, which are more human-readable,
   * into postfix expressions, also known as Reverse Polish Notation (RPN), that can be
   * evaluated more efficiently by a computer. The conversion is based on the operator
   * priority defined in _OperatorPriority.
   *
   * The function employs a stack-based algorithm for the conversion and caches the result
   * to improve performance. The cache keeps track of each converted expression's access time
   * to manage the cache size and optimize memory usage. When the cache size exceeds a specified
   * limit, the least recently accessed items in the cache are deleted.
   *
   * The cache mechanism is particularly helpful for shader compilation, where the same infix
   * expressions might be encountered repeatedly, hence the caching can speed up the process.
   *
   * @param infix - The infix expression to be converted.
   * @returns The postfix expression as an array of strings.
   */
  static infixToPostfix(e) {
    const t = M1._InfixToPostfixCache.get(e);
    if (t)
      return t.accessTime = Date.now(), t.result;
    if (!e.includes("&&") && !e.includes("||") && !e.includes(")") && !e.includes("("))
      return [e];
    const r = [];
    let n = -1;
    const i = () => {
      d = d.trim(), d !== "" && (r.push(d), d = "");
    }, s = (v) => {
      n < M1._Stack.length - 1 && (M1._Stack[++n] = v);
    }, a = () => M1._Stack[n], f = () => n === -1 ? "!!INVALID EXPRESSION!!" : M1._Stack[n--];
    let o = 0, d = "";
    for (; o < e.length; ) {
      const v = e.charAt(o), u = o < e.length - 1 ? e.substr(o, 2) : "";
      if (v === "(")
        d = "", s(v);
      else if (v === ")") {
        for (i(); n !== -1 && a() !== "("; )
          r.push(f());
        f();
      } else if (M1._OperatorPriority[u] > 1) {
        for (i(); n !== -1 && M1._OperatorPriority[a()] >= M1._OperatorPriority[u]; )
          r.push(f());
        s(u), o++;
      } else
        d += v;
      o++;
    }
    for (i(); n !== -1; )
      a() === "(" ? f() : r.push(f());
    return M1._InfixToPostfixCache.size >= M1.InfixToPostfixCacheLimitSize && M1.ClearCache(), M1._InfixToPostfixCache.set(e, { result: r, accessTime: Date.now() }), r;
  }
  static ClearCache() {
    const e = Array.from(M1._InfixToPostfixCache.entries()).sort((t, r) => t[1].accessTime - r[1].accessTime);
    for (let t = 0; t < M1.InfixToPostfixCacheCleanupSize; t++)
      M1._InfixToPostfixCache.delete(e[t][0]);
  }
}
M1.InfixToPostfixCacheLimitSize = 5e4;
M1.InfixToPostfixCacheCleanupSize = 25e3;
M1._InfixToPostfixCache = /* @__PURE__ */ new Map();
M1._OperatorPriority = {
  ")": 0,
  "(": 1,
  "||": 2,
  "&&": 3
};
M1._Stack = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""];
class uC extends M1 {
  constructor(e, t = !1) {
    super(), this.define = e, this.not = t;
  }
  isTrue(e) {
    let t = e[this.define] !== void 0;
    return this.not && (t = !t), t;
  }
}
class k9e extends M1 {
  isTrue(e) {
    return this.leftOperand.isTrue(e) || this.rightOperand.isTrue(e);
  }
}
class E9e extends M1 {
  isTrue(e) {
    return this.leftOperand.isTrue(e) && this.rightOperand.isTrue(e);
  }
}
class F9e extends M1 {
  constructor(e, t, r) {
    super(), this.define = e, this.operand = t, this.testValue = r;
  }
  isTrue(e) {
    let t = e[this.define];
    t === void 0 && (t = this.define);
    let r = !1;
    const n = parseInt(t), i = parseInt(this.testValue);
    switch (this.operand) {
      case ">":
        r = n > i;
        break;
      case "<":
        r = n < i;
        break;
      case "<=":
        r = n <= i;
        break;
      case ">=":
        r = n >= i;
        break;
      case "==":
        r = n === i;
        break;
      case "!=":
        r = n !== i;
        break;
    }
    return r;
  }
}
var za;
(function(A) {
  A[A.GLSL = 0] = "GLSL", A[A.WGSL = 1] = "WGSL";
})(za || (za = {}));
const N9e = /defined\s*?\((.+?)\)/g, cE = /defined\s*?\[(.+?)\]/g, Q9e = /#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g, Y9e = /__decl__/, oG = /light\{X\}.(\w*)/g, fG = /\{X\}/g, lC = [];
class hp {
  static Initialize(e) {
    e.processor && e.processor.initializeShaders && e.processor.initializeShaders(e.processingContext);
  }
  static Process(e, t, r, n) {
    var i;
    !((i = t.processor) === null || i === void 0) && i.preProcessShaderCode && (e = t.processor.preProcessShaderCode(e, t.isFragment)), this._ProcessIncludes(e, t, (s) => {
      t.processCodeAfterIncludes && (s = t.processCodeAfterIncludes(t.isFragment ? "fragment" : "vertex", s));
      const a = this._ProcessShaderConversion(s, t, n);
      r(a, s);
    });
  }
  static PreProcess(e, t, r, n) {
    var i;
    !((i = t.processor) === null || i === void 0) && i.preProcessShaderCode && (e = t.processor.preProcessShaderCode(e, t.isFragment)), this._ProcessIncludes(e, t, (s) => {
      t.processCodeAfterIncludes && (s = t.processCodeAfterIncludes(t.isFragment ? "fragment" : "vertex", s));
      const a = this._ApplyPreProcessing(s, t, n);
      r(a, s);
    });
  }
  static Finalize(e, t, r) {
    return !r.processor || !r.processor.finalizeShaders ? { vertexCode: e, fragmentCode: t } : r.processor.finalizeShaders(e, t, r.processingContext);
  }
  static _ProcessPrecision(e, t) {
    var r;
    if (!((r = t.processor) === null || r === void 0) && r.noPrecision)
      return e;
    const n = t.shouldUseHighPrecisionShader;
    return e.indexOf("precision highp float") === -1 ? n ? e = `precision highp float;
` + e : e = `precision mediump float;
` + e : n || (e = e.replace("precision highp float", "precision mediump float")), e;
  }
  static _ExtractOperation(e) {
    const r = /defined\((.+)\)/.exec(e);
    if (r && r.length)
      return new uC(r[1].trim(), e[0] === "!");
    const n = ["==", "!=", ">=", "<=", "<", ">"];
    let i = "", s = 0;
    for (i of n)
      if (s = e.indexOf(i), s > -1)
        break;
    if (s === -1)
      return new uC(e);
    const a = e.substring(0, s).trim(), f = e.substring(s + i.length).trim();
    return new F9e(a, i, f);
  }
  static _BuildSubExpression(e) {
    e = e.replace(N9e, "defined[$1]");
    const t = M1.infixToPostfix(e), r = [];
    for (const i of t)
      if (i !== "||" && i !== "&&")
        r.push(i);
      else if (r.length >= 2) {
        let s = r[r.length - 1], a = r[r.length - 2];
        r.length -= 2;
        const f = i == "&&" ? new E9e() : new k9e();
        typeof s == "string" && (s = s.replace(cE, "defined($1)")), typeof a == "string" && (a = a.replace(cE, "defined($1)")), f.leftOperand = typeof a == "string" ? this._ExtractOperation(a) : a, f.rightOperand = typeof s == "string" ? this._ExtractOperation(s) : s, r.push(f);
      }
    let n = r[r.length - 1];
    return typeof n == "string" && (n = n.replace(cE, "defined($1)")), typeof n == "string" ? this._ExtractOperation(n) : n;
  }
  static _BuildExpression(e, t) {
    const r = new y9e(), n = e.substring(0, t);
    let i = e.substring(t);
    return i = i.substring(0, (i.indexOf("//") + 1 || i.length + 1) - 1).trim(), n === "#ifdef" ? r.testExpression = new uC(i) : n === "#ifndef" ? r.testExpression = new uC(i, !0) : r.testExpression = this._BuildSubExpression(i), r;
  }
  static _MoveCursorWithinIf(e, t, r) {
    let n = e.currentLine;
    for (; this._MoveCursor(e, r); ) {
      n = e.currentLine;
      const i = n.substring(0, 5).toLowerCase();
      if (i === "#else") {
        const s = new DI();
        t.children.push(s), this._MoveCursor(e, s);
        return;
      } else if (i === "#elif") {
        const s = this._BuildExpression(n, 5);
        t.children.push(s), r = s;
      }
    }
  }
  static _MoveCursor(e, t) {
    for (; e.canRead; ) {
      e.lineIndex++;
      const r = e.currentLine;
      if (r.indexOf("#") >= 0) {
        const i = hp._MoveCursorRegex.exec(r);
        if (i && i.length) {
          switch (i[0]) {
            case "#ifdef": {
              const a = new PE();
              t.children.push(a);
              const f = this._BuildExpression(r, 6);
              a.children.push(f), this._MoveCursorWithinIf(e, a, f);
              break;
            }
            case "#else":
            case "#elif":
              return !0;
            case "#endif":
              return !1;
            case "#ifndef": {
              const a = new PE();
              t.children.push(a);
              const f = this._BuildExpression(r, 7);
              a.children.push(f), this._MoveCursorWithinIf(e, a, f);
              break;
            }
            case "#if": {
              const a = new PE(), f = this._BuildExpression(r, 3);
              t.children.push(a), a.children.push(f), this._MoveCursorWithinIf(e, a, f);
              break;
            }
          }
          continue;
        }
      }
      const n = new DI();
      if (n.line = r, t.children.push(n), r[0] === "#" && r[1] === "d") {
        const i = r.replace(";", "").split(" ");
        n.additionalDefineKey = i[1], i.length === 3 && (n.additionalDefineValue = i[2]);
      }
    }
    return !1;
  }
  static _EvaluatePreProcessors(e, t, r) {
    const n = new DI(), i = new O9e();
    return i.lineIndex = -1, i.lines = e.split(`
`), this._MoveCursor(i, n), n.process(t, r);
  }
  static _PreparePreProcessors(e, t) {
    var r;
    const n = e.defines, i = {};
    for (const s of n) {
      const f = s.replace("#define", "").replace(";", "").trim().split(" ");
      i[f[0]] = f.length > 1 ? f[1] : "";
    }
    return ((r = e.processor) === null || r === void 0 ? void 0 : r.shaderLanguage) === za.GLSL && (i.GL_ES = "true"), i.__VERSION__ = e.version, i[e.platformName] = "true", t._getGlobalDefines(i), i;
  }
  static _ProcessShaderConversion(e, t, r) {
    let n = this._ProcessPrecision(e, t);
    if (!t.processor || t.processor.shaderLanguage === za.GLSL && n.indexOf("#version 3") !== -1 && (n = n.replace("#version 300 es", ""), !t.processor.parseGLES3))
      return n;
    const i = t.defines, s = this._PreparePreProcessors(t, r);
    return t.processor.preProcessor && (n = t.processor.preProcessor(n, i, t.isFragment, t.processingContext)), n = this._EvaluatePreProcessors(n, s, t), t.processor.postProcessor && (n = t.processor.postProcessor(n, i, t.isFragment, t.processingContext, r)), r._features.needShaderCodeInlining && (n = r.inlineShaderCode(n)), n;
  }
  static _ApplyPreProcessing(e, t, r) {
    var n, i;
    let s = e;
    const a = t.defines, f = this._PreparePreProcessors(t, r);
    return !((n = t.processor) === null || n === void 0) && n.preProcessor && (s = t.processor.preProcessor(s, a, t.isFragment, t.processingContext)), s = this._EvaluatePreProcessors(s, f, t), !((i = t.processor) === null || i === void 0) && i.postProcessor && (s = t.processor.postProcessor(s, a, t.isFragment, t.processingContext, r)), r._features.needShaderCodeInlining && (s = r.inlineShaderCode(s)), s;
  }
  /** @internal */
  static _ProcessIncludes(e, t, r) {
    lC.length = 0;
    let n;
    for (; (n = Q9e.exec(e)) !== null; )
      lC.push(n);
    let i = String(e), s = [e], a = !1;
    for (const f of lC) {
      let o = f[1];
      if (o.indexOf("__decl__") !== -1 && (o = o.replace(Y9e, ""), t.supportsUniformBuffers && (o = o.replace("Vertex", "Ubo").replace("Fragment", "Ubo")), o = o + "Declaration"), t.includesShadersStore[o]) {
        let d = t.includesShadersStore[o];
        if (f[2]) {
          const u = f[3].split(",");
          for (let l = 0; l < u.length; l += 2) {
            const P = new RegExp(u[l], "g"), p = u[l + 1];
            d = d.replace(P, p);
          }
        }
        if (f[4]) {
          const u = f[5];
          if (u.indexOf("..") !== -1) {
            const l = u.split(".."), P = parseInt(l[0]);
            let p = parseInt(l[1]), c = d.slice(0);
            d = "", isNaN(p) && (p = t.indexParameters[l[1]]);
            for (let H = P; H < p; H++)
              t.supportsUniformBuffers || (c = c.replace(oG, (T, q) => q + "{X}")), d += c.replace(fG, H.toString()) + `
`;
          } else
            t.supportsUniformBuffers || (d = d.replace(oG, (l, P) => P + "{X}")), d = d.replace(fG, u);
        }
        const v = [];
        for (const u of s) {
          const l = u.split(f[0]);
          for (let P = 0; P < l.length - 1; P++)
            v.push(l[P]), v.push(d);
          v.push(l[l.length - 1]);
        }
        s = v, a = a || d.indexOf("#include<") >= 0 || d.indexOf("#include <") >= 0;
      } else {
        const d = t.shadersRepository + "ShadersInclude/" + o + ".fx";
        hp._FileToolsLoadFile(d, (v) => {
          t.includesShadersStore[o] = v, this._ProcessIncludes(s.join(""), t, r);
        });
        return;
      }
    }
    lC.length = 0, i = s.join(""), a ? this._ProcessIncludes(i.toString(), t, r) : r(i);
  }
  /**
   * Loads a file from a url
   * @param url url to load
   * @param onSuccess callback called when the file successfully loads
   * @param onProgress callback called while file is loading (if the server supports this mode)
   * @param offlineProvider defines the offline provider for caching
   * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
   * @param onError callback called when the file fails to load
   * @returns a file request object
   * @internal
   */
  static _FileToolsLoadFile(e, t, r, n, i, s) {
    throw qn("FileTools");
  }
}
hp._MoveCursorRegex = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;
class Le {
  /**
   * Gets the shaders repository path for a given shader language
   * @param shaderLanguage the shader language
   * @returns the path to the shaders repository
   */
  static GetShadersRepository(e = za.GLSL) {
    return e === za.GLSL ? Le.ShadersRepository : Le.ShadersRepositoryWGSL;
  }
  /**
   * Gets the shaders store of a given shader language
   * @param shaderLanguage the shader language
   * @returns the shaders store
   */
  static GetShadersStore(e = za.GLSL) {
    return e === za.GLSL ? Le.ShadersStore : Le.ShadersStoreWGSL;
  }
  /**
   * Gets the include shaders store of a given shader language
   * @param shaderLanguage the shader language
   * @returns the include shaders store
   */
  static GetIncludesShadersStore(e = za.GLSL) {
    return e === za.GLSL ? Le.IncludesShadersStore : Le.IncludesShadersStoreWGSL;
  }
}
Le.ShadersRepository = "src/Shaders/";
Le.ShadersStore = {};
Le.IncludesShadersStore = {};
Le.ShadersRepositoryWGSL = "src/ShadersWGSL/";
Le.ShadersStoreWGSL = {};
Le.IncludesShadersStoreWGSL = {};
class An {
  /**
   * Gets or sets the relative url used to load shaders if using the engine in non-minified mode
   */
  static get ShadersRepository() {
    return Le.ShadersRepository;
  }
  static set ShadersRepository(e) {
    Le.ShadersRepository = e;
  }
  /**
   * Observable that will be called when effect is bound.
   */
  get onBindObservable() {
    return this._onBindObservable || (this._onBindObservable = new Oe()), this._onBindObservable;
  }
  /**
   * Instantiates an effect.
   * An effect can be used to create/manage/execute vertex and fragment shaders.
   * @param baseName Name of the effect.
   * @param attributesNamesOrOptions List of attribute names that will be passed to the shader or set of all options to create the effect.
   * @param uniformsNamesOrEngine List of uniform variable names that will be passed to the shader or the engine that will be used to render effect.
   * @param samplers List of sampler variables that will be passed to the shader.
   * @param engine Engine to be used to render the effect
   * @param defines Define statements to be added to the shader.
   * @param fallbacks Possible fallbacks for this effect to improve performance when needed.
   * @param onCompiled Callback that will be called when the shader is compiled.
   * @param onError Callback that will be called if an error occurs during shader compilation.
   * @param indexParameters Parameters to be used with Babylons include syntax to iterate over an array (eg. \{lights: 10\})
   * @param key Effect Key identifying uniquely compiled shader variants
   * @param shaderLanguage the language the shader is written in (default: GLSL)
   */
  constructor(e, t, r, n = null, i, s = null, a = null, f = null, o = null, d, v = "", u = za.GLSL) {
    var l, P, p;
    if (this.name = null, this.defines = "", this.onCompiled = null, this.onError = null, this.onBind = null, this.uniqueId = 0, this.onCompileObservable = new Oe(), this.onErrorObservable = new Oe(), this._onBindObservable = null, this._wasPreviouslyReady = !1, this._forceRebindOnNextCall = !1, this._wasPreviouslyUsingInstances = null, this._isDisposed = !1, this._bonesComputationForcedToCPU = !1, this._uniformBuffersNames = {}, this._multiTarget = !1, this._samplers = {}, this._isReady = !1, this._compilationError = "", this._allFallbacksProcessed = !1, this._uniforms = {}, this._key = "", this._fallbacks = null, this._vertexSourceCodeOverride = "", this._fragmentSourceCodeOverride = "", this._transformFeedbackVaryings = null, this._pipelineContext = null, this._vertexSourceCode = "", this._fragmentSourceCode = "", this._vertexSourceCodeBeforeMigration = "", this._fragmentSourceCodeBeforeMigration = "", this._rawVertexSourceCode = "", this._rawFragmentSourceCode = "", this._processCodeAfterIncludes = void 0, this._processFinalCode = null, this.name = e, this._key = v, t.attributes) {
      const c = t;
      if (this._engine = r, this._attributesNames = c.attributes, this._uniformsNames = c.uniformsNames.concat(c.samplers), this._samplerList = c.samplers.slice(), this.defines = c.defines, this.onError = c.onError, this.onCompiled = c.onCompiled, this._fallbacks = c.fallbacks, this._indexParameters = c.indexParameters, this._transformFeedbackVaryings = c.transformFeedbackVaryings || null, this._multiTarget = !!c.multiTarget, this._shaderLanguage = (l = c.shaderLanguage) !== null && l !== void 0 ? l : za.GLSL, c.uniformBuffersNames) {
        this._uniformBuffersNamesList = c.uniformBuffersNames.slice();
        for (let H = 0; H < c.uniformBuffersNames.length; H++)
          this._uniformBuffersNames[c.uniformBuffersNames[H]] = H;
      }
      this._processFinalCode = (P = c.processFinalCode) !== null && P !== void 0 ? P : null, this._processCodeAfterIncludes = (p = c.processCodeAfterIncludes) !== null && p !== void 0 ? p : void 0;
    } else
      this._engine = i, this.defines = s ?? "", this._uniformsNames = r.concat(n), this._samplerList = n ? n.slice() : [], this._attributesNames = t, this._uniformBuffersNamesList = [], this._shaderLanguage = u, this.onError = o, this.onCompiled = f, this._indexParameters = d, this._fallbacks = a;
    this._attributeLocationByName = {}, this.uniqueId = An._UniqueIdSeed++, this._processShaderCode();
  }
  /** @internal */
  _processShaderCode(e = null, t = !1) {
    let r, n;
    const i = this.name, s = u9() ? this._engine.getHostDocument() : null;
    i.vertexSource ? r = "source:" + i.vertexSource : i.vertexElement ? (r = s ? s.getElementById(i.vertexElement) : null, r || (r = i.vertexElement)) : r = i.vertex || i, i.fragmentSource ? n = "source:" + i.fragmentSource : i.fragmentElement ? (n = s ? s.getElementById(i.fragmentElement) : null, n || (n = i.fragmentElement)) : n = i.fragment || i, this._processingContext = this._engine._getShaderProcessingContext(this._shaderLanguage);
    let a = {
      defines: this.defines.split(`
`),
      indexParameters: this._indexParameters,
      isFragment: !1,
      shouldUseHighPrecisionShader: this._engine._shouldUseHighPrecisionShader,
      processor: e ?? this._engine._getShaderProcessor(this._shaderLanguage),
      supportsUniformBuffers: this._engine.supportsUniformBuffers,
      shadersRepository: Le.GetShadersRepository(this._shaderLanguage),
      includesShadersStore: Le.GetIncludesShadersStore(this._shaderLanguage),
      version: (this._engine.version * 100).toString(),
      platformName: this._engine.shaderPlatformName,
      processingContext: this._processingContext,
      isNDCHalfZRange: this._engine.isNDCHalfZRange,
      useReverseDepthBuffer: this._engine.useReverseDepthBuffer,
      processCodeAfterIncludes: this._processCodeAfterIncludes
    };
    const f = [void 0, void 0], o = () => {
      if (f[0] && f[1]) {
        a.isFragment = !0;
        const [d, v] = f;
        hp.Process(v, a, (u, l) => {
          this._fragmentSourceCodeBeforeMigration = l, this._processFinalCode && (u = this._processFinalCode("fragment", u));
          const P = hp.Finalize(d, u, a);
          a = null, this._useFinalCode(P.vertexCode, P.fragmentCode, i, t);
        }, this._engine);
      }
    };
    this._loadShader(r, "Vertex", "", (d) => {
      hp.Initialize(a), hp.Process(d, a, (v, u) => {
        this._rawVertexSourceCode = d, this._vertexSourceCodeBeforeMigration = u, this._processFinalCode && (v = this._processFinalCode("vertex", v)), f[0] = v, o();
      }, this._engine);
    }), this._loadShader(n, "Fragment", "Pixel", (d) => {
      this._rawFragmentSourceCode = d, f[1] = d, o();
    });
  }
  _useFinalCode(e, t, r, n = !1) {
    if (r) {
      const i = r.vertexElement || r.vertex || r.spectorName || r, s = r.fragmentElement || r.fragment || r.spectorName || r;
      this._vertexSourceCode = (this._shaderLanguage === za.WGSL ? "//" : "") + "#define SHADER_NAME vertex:" + i + `
` + e, this._fragmentSourceCode = (this._shaderLanguage === za.WGSL ? "//" : "") + "#define SHADER_NAME fragment:" + s + `
` + t;
    } else
      this._vertexSourceCode = e, this._fragmentSourceCode = t;
    this._prepareEffect(n);
  }
  /**
   * Unique key for this effect
   */
  get key() {
    return this._key;
  }
  /**
   * If the effect has been compiled and prepared.
   * @returns if the effect is compiled and prepared.
   */
  isReady() {
    try {
      return this._isReadyInternal();
    } catch {
      return !1;
    }
  }
  _isReadyInternal() {
    return this._isReady ? !0 : this._pipelineContext ? this._pipelineContext.isReady : !1;
  }
  /**
   * The engine the effect was initialized with.
   * @returns the engine.
   */
  getEngine() {
    return this._engine;
  }
  /**
   * The pipeline context for this effect
   * @returns the associated pipeline context
   */
  getPipelineContext() {
    return this._pipelineContext;
  }
  /**
   * The set of names of attribute variables for the shader.
   * @returns An array of attribute names.
   */
  getAttributesNames() {
    return this._attributesNames;
  }
  /**
   * Returns the attribute at the given index.
   * @param index The index of the attribute.
   * @returns The location of the attribute.
   */
  getAttributeLocation(e) {
    return this._attributes[e];
  }
  /**
   * Returns the attribute based on the name of the variable.
   * @param name of the attribute to look up.
   * @returns the attribute location.
   */
  getAttributeLocationByName(e) {
    return this._attributeLocationByName[e];
  }
  /**
   * The number of attributes.
   * @returns the number of attributes.
   */
  getAttributesCount() {
    return this._attributes.length;
  }
  /**
   * Gets the index of a uniform variable.
   * @param uniformName of the uniform to look up.
   * @returns the index.
   */
  getUniformIndex(e) {
    return this._uniformsNames.indexOf(e);
  }
  /**
   * Returns the attribute based on the name of the variable.
   * @param uniformName of the uniform to look up.
   * @returns the location of the uniform.
   */
  getUniform(e) {
    return this._uniforms[e];
  }
  /**
   * Returns an array of sampler variable names
   * @returns The array of sampler variable names.
   */
  getSamplers() {
    return this._samplerList;
  }
  /**
   * Returns an array of uniform variable names
   * @returns The array of uniform variable names.
   */
  getUniformNames() {
    return this._uniformsNames;
  }
  /**
   * Returns an array of uniform buffer variable names
   * @returns The array of uniform buffer variable names.
   */
  getUniformBuffersNames() {
    return this._uniformBuffersNamesList;
  }
  /**
   * Returns the index parameters used to create the effect
   * @returns The index parameters object
   */
  getIndexParameters() {
    return this._indexParameters;
  }
  /**
   * The error from the last compilation.
   * @returns the error string.
   */
  getCompilationError() {
    return this._compilationError;
  }
  /**
   * Gets a boolean indicating that all fallbacks were used during compilation
   * @returns true if all fallbacks were used
   */
  allFallbacksProcessed() {
    return this._allFallbacksProcessed;
  }
  /**
   * Adds a callback to the onCompiled observable and call the callback immediately if already ready.
   * @param func The callback to be used.
   */
  executeWhenCompiled(e) {
    if (this.isReady()) {
      e(this);
      return;
    }
    this.onCompileObservable.add((t) => {
      e(t);
    }), (!this._pipelineContext || this._pipelineContext.isAsync) && setTimeout(() => {
      this._checkIsReady(null);
    }, 16);
  }
  _checkIsReady(e) {
    try {
      if (this._isReadyInternal())
        return;
    } catch (t) {
      this._processCompilationErrors(t, e);
      return;
    }
    this._isDisposed || setTimeout(() => {
      this._checkIsReady(e);
    }, 16);
  }
  _loadShader(e, t, r, n) {
    if (typeof HTMLElement < "u" && e instanceof HTMLElement) {
      const a = gR(e);
      n(a);
      return;
    }
    if (e.substr(0, 7) === "source:") {
      n(e.substr(7));
      return;
    }
    if (e.substr(0, 7) === "base64:") {
      const a = window.atob(e.substr(7));
      n(a);
      return;
    }
    const i = Le.GetShadersStore(this._shaderLanguage);
    if (i[e + t + "Shader"]) {
      n(i[e + t + "Shader"]);
      return;
    }
    if (r && i[e + r + "Shader"]) {
      n(i[e + r + "Shader"]);
      return;
    }
    let s;
    e[0] === "." || e[0] === "/" || e.indexOf("http") > -1 ? s = e : s = Le.GetShadersRepository(this._shaderLanguage) + e, this._engine._loadFile(s + "." + t.toLowerCase() + ".fx", n);
  }
  /**
   * Gets the vertex shader source code of this effect
   * This is the final source code that will be compiled, after all the processing has been done (pre-processing applied, code injection/replacement, etc)
   */
  get vertexSourceCode() {
    var e, t;
    return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? this._vertexSourceCodeOverride : (t = (e = this._pipelineContext) === null || e === void 0 ? void 0 : e._getVertexShaderCode()) !== null && t !== void 0 ? t : this._vertexSourceCode;
  }
  /**
   * Gets the fragment shader source code of this effect
   * This is the final source code that will be compiled, after all the processing has been done (pre-processing applied, code injection/replacement, etc)
   */
  get fragmentSourceCode() {
    var e, t;
    return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? this._fragmentSourceCodeOverride : (t = (e = this._pipelineContext) === null || e === void 0 ? void 0 : e._getFragmentShaderCode()) !== null && t !== void 0 ? t : this._fragmentSourceCode;
  }
  /**
   * Gets the vertex shader source code before migration.
   * This is the source code after the include directives have been replaced by their contents but before the code is migrated, i.e. before ShaderProcess._ProcessShaderConversion is executed.
   * This method is, among other things, responsible for parsing #if/#define directives as well as converting GLES2 syntax to GLES3 (in the case of WebGL).
   */
  get vertexSourceCodeBeforeMigration() {
    return this._vertexSourceCodeBeforeMigration;
  }
  /**
   * Gets the fragment shader source code before migration.
   * This is the source code after the include directives have been replaced by their contents but before the code is migrated, i.e. before ShaderProcess._ProcessShaderConversion is executed.
   * This method is, among other things, responsible for parsing #if/#define directives as well as converting GLES2 syntax to GLES3 (in the case of WebGL).
   */
  get fragmentSourceCodeBeforeMigration() {
    return this._fragmentSourceCodeBeforeMigration;
  }
  /**
   * Gets the vertex shader source code before it has been modified by any processing
   */
  get rawVertexSourceCode() {
    return this._rawVertexSourceCode;
  }
  /**
   * Gets the fragment shader source code before it has been modified by any processing
   */
  get rawFragmentSourceCode() {
    return this._rawFragmentSourceCode;
  }
  /**
   * Recompiles the webGL program
   * @param vertexSourceCode The source code for the vertex shader.
   * @param fragmentSourceCode The source code for the fragment shader.
   * @param onCompiled Callback called when completed.
   * @param onError Callback called on error.
   * @internal
   */
  _rebuildProgram(e, t, r, n) {
    this._isReady = !1, this._vertexSourceCodeOverride = e, this._fragmentSourceCodeOverride = t, this.onError = (i, s) => {
      n && n(s);
    }, this.onCompiled = () => {
      const i = this.getEngine().scenes;
      if (i)
        for (let s = 0; s < i.length; s++)
          i[s].markAllMaterialsAsDirty(63);
      this._pipelineContext._handlesSpectorRebuildCallback(r);
    }, this._fallbacks = null, this._prepareEffect();
  }
  /**
   * Prepares the effect
   * @internal
   */
  _prepareEffect(e = !1) {
    var t;
    const r = this._attributesNames, n = this.defines, i = this._pipelineContext;
    this._isReady = !1;
    try {
      const s = this._engine;
      this._pipelineContext = (t = e ? i : void 0) !== null && t !== void 0 ? t : s.createPipelineContext(this._processingContext), this._pipelineContext._name = this._key.replace(/\r/g, "").replace(/\n/g, "|");
      const a = (f, o, d, v) => this._rebuildProgram(f, o, d, v);
      this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? s._preparePipelineContext(this._pipelineContext, this._vertexSourceCodeOverride, this._fragmentSourceCodeOverride, !0, this._rawVertexSourceCode, this._rawFragmentSourceCode, a, null, this._transformFeedbackVaryings, this._key) : s._preparePipelineContext(this._pipelineContext, this._vertexSourceCode, this._fragmentSourceCode, !1, this._rawVertexSourceCode, this._rawFragmentSourceCode, a, n, this._transformFeedbackVaryings, this._key), s._executeWhenRenderingStateIsCompiled(this._pipelineContext, () => {
        if (this._attributes = [], this._pipelineContext._fillEffectInformation(this, this._uniformBuffersNames, this._uniformsNames, this._uniforms, this._samplerList, this._samplers, r, this._attributes), r)
          for (let f = 0; f < r.length; f++) {
            const o = r[f];
            this._attributeLocationByName[o] = this._attributes[f];
          }
        s.bindSamplers(this), this._compilationError = "", this._isReady = !0, this.onCompiled && this.onCompiled(this), this.onCompileObservable.notifyObservers(this), this.onCompileObservable.clear(), this._fallbacks && this._fallbacks.unBindMesh(), i && !e && this.getEngine()._deletePipelineContext(i);
      }), this._pipelineContext.isAsync && this._checkIsReady(i);
    } catch (s) {
      this._processCompilationErrors(s, i);
    }
  }
  _getShaderCodeAndErrorLine(e, t, r) {
    const n = r ? /FRAGMENT SHADER ERROR: 0:(\d+?):/ : /VERTEX SHADER ERROR: 0:(\d+?):/;
    let i = null;
    if (t && e) {
      const s = t.match(n);
      if (s && s.length === 2) {
        const a = parseInt(s[1]), f = e.split(`
`, -1);
        f.length >= a && (i = `Offending line [${a}] in ${r ? "fragment" : "vertex"} code: ${f[a - 1]}`);
      }
    }
    return [e, i];
  }
  _processCompilationErrors(e, t = null) {
    var r, n, i;
    this._compilationError = e.message;
    const s = this._attributesNames, a = this._fallbacks;
    if (Se.Error("Unable to compile effect:"), Se.Error("Uniforms: " + this._uniformsNames.map(function(o) {
      return " " + o;
    })), Se.Error("Attributes: " + s.map(function(o) {
      return " " + o;
    })), Se.Error(`Defines:
` + this.defines), An.LogShaderCodeOnCompilationError) {
      let o = null, d = null, v = null;
      !((r = this._pipelineContext) === null || r === void 0) && r._getVertexShaderCode() && ([v, o] = this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(), this._compilationError, !1), v && (Se.Error("Vertex code:"), Se.Error(v))), !((n = this._pipelineContext) === null || n === void 0) && n._getFragmentShaderCode() && ([v, d] = this._getShaderCodeAndErrorLine((i = this._pipelineContext) === null || i === void 0 ? void 0 : i._getFragmentShaderCode(), this._compilationError, !0), v && (Se.Error("Fragment code:"), Se.Error(v))), o && Se.Error(o), d && Se.Error(d);
    }
    Se.Error("Error: " + this._compilationError);
    const f = () => {
      this.onError && this.onError(this, this._compilationError), this.onErrorObservable.notifyObservers(this);
    };
    t && (this._pipelineContext = t, this._isReady = !0, f()), a ? (this._pipelineContext = null, a.hasMoreFallbacks ? (this._allFallbacksProcessed = !1, Se.Error("Trying next fallback."), this.defines = a.reduce(this.defines, this), this._prepareEffect()) : (this._allFallbacksProcessed = !0, f(), this.onErrorObservable.clear(), this._fallbacks && this._fallbacks.unBindMesh())) : (this._allFallbacksProcessed = !0, t || f());
  }
  /**
   * Checks if the effect is supported. (Must be called after compilation)
   */
  get isSupported() {
    return this._compilationError === "";
  }
  /**
   * Binds a texture to the engine to be used as output of the shader.
   * @param channel Name of the output variable.
   * @param texture Texture to bind.
   * @internal
   */
  _bindTexture(e, t) {
    this._engine._bindTexture(this._samplers[e], t, e);
  }
  /**
   * Sets a texture on the engine to be used in the shader.
   * @param channel Name of the sampler variable.
   * @param texture Texture to set.
   */
  setTexture(e, t) {
    this._engine.setTexture(this._samplers[e], this._uniforms[e], t, e);
  }
  /**
   * Sets a depth stencil texture from a render target on the engine to be used in the shader.
   * @param channel Name of the sampler variable.
   * @param texture Texture to set.
   */
  setDepthStencilTexture(e, t) {
    this._engine.setDepthStencilTexture(this._samplers[e], this._uniforms[e], t, e);
  }
  /**
   * Sets an array of textures on the engine to be used in the shader.
   * @param channel Name of the variable.
   * @param textures Textures to set.
   */
  setTextureArray(e, t) {
    const r = e + "Ex";
    if (this._samplerList.indexOf(r + "0") === -1) {
      const n = this._samplerList.indexOf(e);
      for (let s = 1; s < t.length; s++) {
        const a = r + (s - 1).toString();
        this._samplerList.splice(n + s, 0, a);
      }
      let i = 0;
      for (const s of this._samplerList)
        this._samplers[s] = i, i += 1;
    }
    this._engine.setTextureArray(this._samplers[e], this._uniforms[e], t, e);
  }
  /**
   * Sets a texture to be the input of the specified post process. (To use the output, pass in the next post process in the pipeline)
   * @param channel Name of the sampler variable.
   * @param postProcess Post process to get the input texture from.
   */
  setTextureFromPostProcess(e, t) {
    this._engine.setTextureFromPostProcess(this._samplers[e], t, e);
  }
  /**
   * (Warning! setTextureFromPostProcessOutput may be desired instead)
   * Sets the input texture of the passed in post process to be input of this effect. (To use the output of the passed in post process use setTextureFromPostProcessOutput)
   * @param channel Name of the sampler variable.
   * @param postProcess Post process to get the output texture from.
   */
  setTextureFromPostProcessOutput(e, t) {
    this._engine.setTextureFromPostProcessOutput(this._samplers[e], t, e);
  }
  /**
   * Binds a buffer to a uniform.
   * @param buffer Buffer to bind.
   * @param name Name of the uniform variable to bind to.
   */
  bindUniformBuffer(e, t) {
    const r = this._uniformBuffersNames[t];
    r === void 0 || An._BaseCache[r] === e && this._engine._features.useUBOBindingCache || (An._BaseCache[r] = e, this._engine.bindUniformBufferBase(e, r, t));
  }
  /**
   * Binds block to a uniform.
   * @param blockName Name of the block to bind.
   * @param index Index to bind.
   */
  bindUniformBlock(e, t) {
    this._engine.bindUniformBlock(this._pipelineContext, e, t);
  }
  /**
   * Sets an integer value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value Value to be set.
   * @returns this effect.
   */
  setInt(e, t) {
    return this._pipelineContext.setInt(e, t), this;
  }
  /**
   * Sets an int2 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int2.
   * @param y Second int in int2.
   * @returns this effect.
   */
  setInt2(e, t, r) {
    return this._pipelineContext.setInt2(e, t, r), this;
  }
  /**
   * Sets an int3 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int3.
   * @param y Second int in int3.
   * @param z Third int in int3.
   * @returns this effect.
   */
  setInt3(e, t, r, n) {
    return this._pipelineContext.setInt3(e, t, r, n), this;
  }
  /**
   * Sets an int4 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int4.
   * @param y Second int in int4.
   * @param z Third int in int4.
   * @param w Fourth int in int4.
   * @returns this effect.
   */
  setInt4(e, t, r, n, i) {
    return this._pipelineContext.setInt4(e, t, r, n, i), this;
  }
  /**
   * Sets an int array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setIntArray(e, t) {
    return this._pipelineContext.setIntArray(e, t), this;
  }
  /**
   * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setIntArray2(e, t) {
    return this._pipelineContext.setIntArray2(e, t), this;
  }
  /**
   * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setIntArray3(e, t) {
    return this._pipelineContext.setIntArray3(e, t), this;
  }
  /**
   * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setIntArray4(e, t) {
    return this._pipelineContext.setIntArray4(e, t), this;
  }
  /**
   * Sets an unsigned integer value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value Value to be set.
   * @returns this effect.
   */
  setUInt(e, t) {
    return this._pipelineContext.setUInt(e, t), this;
  }
  /**
   * Sets an unsigned int2 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint2.
   * @param y Second unsigned int in uint2.
   * @returns this effect.
   */
  setUInt2(e, t, r) {
    return this._pipelineContext.setUInt2(e, t, r), this;
  }
  /**
   * Sets an unsigned int3 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint3.
   * @param y Second unsigned int in uint3.
   * @param z Third unsigned int in uint3.
   * @returns this effect.
   */
  setUInt3(e, t, r, n) {
    return this._pipelineContext.setUInt3(e, t, r, n), this;
  }
  /**
   * Sets an unsigned int4 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint4.
   * @param y Second unsigned int in uint4.
   * @param z Third unsigned int in uint4.
   * @param w Fourth unsigned int in uint4.
   * @returns this effect.
   */
  setUInt4(e, t, r, n, i) {
    return this._pipelineContext.setUInt4(e, t, r, n, i), this;
  }
  /**
   * Sets an unsigned int array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setUIntArray(e, t) {
    return this._pipelineContext.setUIntArray(e, t), this;
  }
  /**
   * Sets an unsigned int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setUIntArray2(e, t) {
    return this._pipelineContext.setUIntArray2(e, t), this;
  }
  /**
   * Sets an unsigned int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setUIntArray3(e, t) {
    return this._pipelineContext.setUIntArray3(e, t), this;
  }
  /**
   * Sets an unsigned int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setUIntArray4(e, t) {
    return this._pipelineContext.setUIntArray4(e, t), this;
  }
  /**
   * Sets an float array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setFloatArray(e, t) {
    return this._pipelineContext.setArray(e, t), this;
  }
  /**
   * Sets an float array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setFloatArray2(e, t) {
    return this._pipelineContext.setArray2(e, t), this;
  }
  /**
   * Sets an float array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setFloatArray3(e, t) {
    return this._pipelineContext.setArray3(e, t), this;
  }
  /**
   * Sets an float array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setFloatArray4(e, t) {
    return this._pipelineContext.setArray4(e, t), this;
  }
  /**
   * Sets an array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setArray(e, t) {
    return this._pipelineContext.setArray(e, t), this;
  }
  /**
   * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setArray2(e, t) {
    return this._pipelineContext.setArray2(e, t), this;
  }
  /**
   * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setArray3(e, t) {
    return this._pipelineContext.setArray3(e, t), this;
  }
  /**
   * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setArray4(e, t) {
    return this._pipelineContext.setArray4(e, t), this;
  }
  /**
   * Sets matrices on a uniform variable.
   * @param uniformName Name of the variable.
   * @param matrices matrices to be set.
   * @returns this effect.
   */
  setMatrices(e, t) {
    return this._pipelineContext.setMatrices(e, t), this;
  }
  /**
   * Sets matrix on a uniform variable.
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   * @returns this effect.
   */
  setMatrix(e, t) {
    return this._pipelineContext.setMatrix(e, t), this;
  }
  /**
   * Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   * @returns this effect.
   */
  setMatrix3x3(e, t) {
    return this._pipelineContext.setMatrix3x3(e, t), this;
  }
  /**
   * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   * @returns this effect.
   */
  setMatrix2x2(e, t) {
    return this._pipelineContext.setMatrix2x2(e, t), this;
  }
  /**
   * Sets a float on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value value to be set.
   * @returns this effect.
   */
  setFloat(e, t) {
    return this._pipelineContext.setFloat(e, t), this;
  }
  /**
   * Sets a boolean on a uniform variable.
   * @param uniformName Name of the variable.
   * @param bool value to be set.
   * @returns this effect.
   */
  setBool(e, t) {
    return this._pipelineContext.setInt(e, t ? 1 : 0), this;
  }
  /**
   * Sets a Vector2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector2 vector2 to be set.
   * @returns this effect.
   */
  setVector2(e, t) {
    return this._pipelineContext.setVector2(e, t), this;
  }
  /**
   * Sets a float2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float2.
   * @param y Second float in float2.
   * @returns this effect.
   */
  setFloat2(e, t, r) {
    return this._pipelineContext.setFloat2(e, t, r), this;
  }
  /**
   * Sets a Vector3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector3 Value to be set.
   * @returns this effect.
   */
  setVector3(e, t) {
    return this._pipelineContext.setVector3(e, t), this;
  }
  /**
   * Sets a float3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float3.
   * @param y Second float in float3.
   * @param z Third float in float3.
   * @returns this effect.
   */
  setFloat3(e, t, r, n) {
    return this._pipelineContext.setFloat3(e, t, r, n), this;
  }
  /**
   * Sets a Vector4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector4 Value to be set.
   * @returns this effect.
   */
  setVector4(e, t) {
    return this._pipelineContext.setVector4(e, t), this;
  }
  /**
   * Sets a Quaternion on a uniform variable.
   * @param uniformName Name of the variable.
   * @param quaternion Value to be set.
   * @returns this effect.
   */
  setQuaternion(e, t) {
    return this._pipelineContext.setQuaternion(e, t), this;
  }
  /**
   * Sets a float4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float4.
   * @param y Second float in float4.
   * @param z Third float in float4.
   * @param w Fourth float in float4.
   * @returns this effect.
   */
  setFloat4(e, t, r, n, i) {
    return this._pipelineContext.setFloat4(e, t, r, n, i), this;
  }
  /**
   * Sets a Color3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param color3 Value to be set.
   * @returns this effect.
   */
  setColor3(e, t) {
    return this._pipelineContext.setColor3(e, t), this;
  }
  /**
   * Sets a Color4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param color3 Value to be set.
   * @param alpha Alpha value to be set.
   * @returns this effect.
   */
  setColor4(e, t, r) {
    return this._pipelineContext.setColor4(e, t, r), this;
  }
  /**
   * Sets a Color4 on a uniform variable
   * @param uniformName defines the name of the variable
   * @param color4 defines the value to be set
   * @returns this effect.
   */
  setDirectColor4(e, t) {
    return this._pipelineContext.setDirectColor4(e, t), this;
  }
  /**
   * Release all associated resources.
   **/
  dispose() {
    this._pipelineContext && this._pipelineContext.dispose(), this._engine._releaseEffect(this), this._isDisposed = !0;
  }
  /**
   * This function will add a new shader to the shader store
   * @param name the name of the shader
   * @param pixelShader optional pixel shader content
   * @param vertexShader optional vertex shader content
   * @param shaderLanguage the language the shader is written in (default: GLSL)
   */
  static RegisterShader(e, t, r, n = za.GLSL) {
    t && (Le.GetShadersStore(n)[`${e}PixelShader`] = t), r && (Le.GetShadersStore(n)[`${e}VertexShader`] = r);
  }
  /**
   * Resets the cache of effects.
   */
  static ResetCache() {
    An._BaseCache = {};
  }
}
An.LogShaderCodeOnCompilationError = !0;
An._UniqueIdSeed = 0;
An._BaseCache = {};
An.ShadersStore = Le.ShadersStore;
An.IncludesShadersStore = Le.IncludesShadersStore;
class YN {
  /**
   * Initializes the state.
   * @param reset
   */
  constructor(e = !0) {
    this._isDepthTestDirty = !1, this._isDepthMaskDirty = !1, this._isDepthFuncDirty = !1, this._isCullFaceDirty = !1, this._isCullDirty = !1, this._isZOffsetDirty = !1, this._isFrontFaceDirty = !1, e && this.reset();
  }
  get isDirty() {
    return this._isDepthFuncDirty || this._isDepthTestDirty || this._isDepthMaskDirty || this._isCullFaceDirty || this._isCullDirty || this._isZOffsetDirty || this._isFrontFaceDirty;
  }
  get zOffset() {
    return this._zOffset;
  }
  set zOffset(e) {
    this._zOffset !== e && (this._zOffset = e, this._isZOffsetDirty = !0);
  }
  get zOffsetUnits() {
    return this._zOffsetUnits;
  }
  set zOffsetUnits(e) {
    this._zOffsetUnits !== e && (this._zOffsetUnits = e, this._isZOffsetDirty = !0);
  }
  get cullFace() {
    return this._cullFace;
  }
  set cullFace(e) {
    this._cullFace !== e && (this._cullFace = e, this._isCullFaceDirty = !0);
  }
  get cull() {
    return this._cull;
  }
  set cull(e) {
    this._cull !== e && (this._cull = e, this._isCullDirty = !0);
  }
  get depthFunc() {
    return this._depthFunc;
  }
  set depthFunc(e) {
    this._depthFunc !== e && (this._depthFunc = e, this._isDepthFuncDirty = !0);
  }
  get depthMask() {
    return this._depthMask;
  }
  set depthMask(e) {
    this._depthMask !== e && (this._depthMask = e, this._isDepthMaskDirty = !0);
  }
  get depthTest() {
    return this._depthTest;
  }
  set depthTest(e) {
    this._depthTest !== e && (this._depthTest = e, this._isDepthTestDirty = !0);
  }
  get frontFace() {
    return this._frontFace;
  }
  set frontFace(e) {
    this._frontFace !== e && (this._frontFace = e, this._isFrontFaceDirty = !0);
  }
  reset() {
    this._depthMask = !0, this._depthTest = !0, this._depthFunc = null, this._cullFace = null, this._cull = null, this._zOffset = 0, this._zOffsetUnits = 0, this._frontFace = null, this._isDepthTestDirty = !0, this._isDepthMaskDirty = !0, this._isDepthFuncDirty = !1, this._isCullFaceDirty = !1, this._isCullDirty = !1, this._isZOffsetDirty = !0, this._isFrontFaceDirty = !1;
  }
  apply(e) {
    this.isDirty && (this._isCullDirty && (this.cull ? e.enable(e.CULL_FACE) : e.disable(e.CULL_FACE), this._isCullDirty = !1), this._isCullFaceDirty && (e.cullFace(this.cullFace), this._isCullFaceDirty = !1), this._isDepthMaskDirty && (e.depthMask(this.depthMask), this._isDepthMaskDirty = !1), this._isDepthTestDirty && (this.depthTest ? e.enable(e.DEPTH_TEST) : e.disable(e.DEPTH_TEST), this._isDepthTestDirty = !1), this._isDepthFuncDirty && (e.depthFunc(this.depthFunc), this._isDepthFuncDirty = !1), this._isZOffsetDirty && (this.zOffset || this.zOffsetUnits ? (e.enable(e.POLYGON_OFFSET_FILL), e.polygonOffset(this.zOffset, this.zOffsetUnits)) : e.disable(e.POLYGON_OFFSET_FILL), this._isZOffsetDirty = !1), this._isFrontFaceDirty && (e.frontFace(this.frontFace), this._isFrontFaceDirty = !1));
  }
}
class L2 {
  constructor() {
    this.reset();
  }
  reset() {
    this.enabled = !1, this.mask = 255, this.func = L2.ALWAYS, this.funcRef = 1, this.funcMask = 255, this.opStencilFail = L2.KEEP, this.opDepthFail = L2.KEEP, this.opStencilDepthPass = L2.REPLACE;
  }
  get stencilFunc() {
    return this.func;
  }
  set stencilFunc(e) {
    this.func = e;
  }
  get stencilFuncRef() {
    return this.funcRef;
  }
  set stencilFuncRef(e) {
    this.funcRef = e;
  }
  get stencilFuncMask() {
    return this.funcMask;
  }
  set stencilFuncMask(e) {
    this.funcMask = e;
  }
  get stencilOpStencilFail() {
    return this.opStencilFail;
  }
  set stencilOpStencilFail(e) {
    this.opStencilFail = e;
  }
  get stencilOpDepthFail() {
    return this.opDepthFail;
  }
  set stencilOpDepthFail(e) {
    this.opDepthFail = e;
  }
  get stencilOpStencilDepthPass() {
    return this.opStencilDepthPass;
  }
  set stencilOpStencilDepthPass(e) {
    this.opStencilDepthPass = e;
  }
  get stencilMask() {
    return this.mask;
  }
  set stencilMask(e) {
    this.mask = e;
  }
  get stencilTest() {
    return this.enabled;
  }
  set stencilTest(e) {
    this.enabled = e;
  }
}
L2.ALWAYS = 519;
L2.KEEP = 7680;
L2.REPLACE = 7681;
class k$ {
  /**
   * Initializes the state.
   */
  constructor() {
    this._blendFunctionParameters = new Array(4), this._blendEquationParameters = new Array(2), this._blendConstants = new Array(4), this._isBlendConstantsDirty = !1, this._alphaBlend = !1, this._isAlphaBlendDirty = !1, this._isBlendFunctionParametersDirty = !1, this._isBlendEquationParametersDirty = !1, this.reset();
  }
  get isDirty() {
    return this._isAlphaBlendDirty || this._isBlendFunctionParametersDirty || this._isBlendEquationParametersDirty;
  }
  get alphaBlend() {
    return this._alphaBlend;
  }
  set alphaBlend(e) {
    this._alphaBlend !== e && (this._alphaBlend = e, this._isAlphaBlendDirty = !0);
  }
  setAlphaBlendConstants(e, t, r, n) {
    this._blendConstants[0] === e && this._blendConstants[1] === t && this._blendConstants[2] === r && this._blendConstants[3] === n || (this._blendConstants[0] = e, this._blendConstants[1] = t, this._blendConstants[2] = r, this._blendConstants[3] = n, this._isBlendConstantsDirty = !0);
  }
  setAlphaBlendFunctionParameters(e, t, r, n) {
    this._blendFunctionParameters[0] === e && this._blendFunctionParameters[1] === t && this._blendFunctionParameters[2] === r && this._blendFunctionParameters[3] === n || (this._blendFunctionParameters[0] = e, this._blendFunctionParameters[1] = t, this._blendFunctionParameters[2] = r, this._blendFunctionParameters[3] = n, this._isBlendFunctionParametersDirty = !0);
  }
  setAlphaEquationParameters(e, t) {
    this._blendEquationParameters[0] === e && this._blendEquationParameters[1] === t || (this._blendEquationParameters[0] = e, this._blendEquationParameters[1] = t, this._isBlendEquationParametersDirty = !0);
  }
  reset() {
    this._alphaBlend = !1, this._blendFunctionParameters[0] = null, this._blendFunctionParameters[1] = null, this._blendFunctionParameters[2] = null, this._blendFunctionParameters[3] = null, this._blendEquationParameters[0] = null, this._blendEquationParameters[1] = null, this._blendConstants[0] = null, this._blendConstants[1] = null, this._blendConstants[2] = null, this._blendConstants[3] = null, this._isAlphaBlendDirty = !0, this._isBlendFunctionParametersDirty = !1, this._isBlendEquationParametersDirty = !1, this._isBlendConstantsDirty = !1;
  }
  apply(e) {
    this.isDirty && (this._isAlphaBlendDirty && (this._alphaBlend ? e.enable(e.BLEND) : e.disable(e.BLEND), this._isAlphaBlendDirty = !1), this._isBlendFunctionParametersDirty && (e.blendFuncSeparate(this._blendFunctionParameters[0], this._blendFunctionParameters[1], this._blendFunctionParameters[2], this._blendFunctionParameters[3]), this._isBlendFunctionParametersDirty = !1), this._isBlendEquationParametersDirty && (e.blendEquationSeparate(this._blendEquationParameters[0], this._blendEquationParameters[1]), this._isBlendEquationParametersDirty = !1), this._isBlendConstantsDirty && (e.blendColor(this._blendConstants[0], this._blendConstants[1], this._blendConstants[2], this._blendConstants[3]), this._isBlendConstantsDirty = !1));
  }
}
class MN {
  /**
   * | Value | Type               | Description |
   * | ----- | ------------------ | ----------- |
   * | 0     | CLAMP_ADDRESSMODE  |             |
   * | 1     | WRAP_ADDRESSMODE   |             |
   * | 2     | MIRROR_ADDRESSMODE |             |
   */
  get wrapU() {
    return this._cachedWrapU;
  }
  set wrapU(e) {
    this._cachedWrapU = e;
  }
  /**
   * | Value | Type               | Description |
   * | ----- | ------------------ | ----------- |
   * | 0     | CLAMP_ADDRESSMODE  |             |
   * | 1     | WRAP_ADDRESSMODE   |             |
   * | 2     | MIRROR_ADDRESSMODE |             |
   */
  get wrapV() {
    return this._cachedWrapV;
  }
  set wrapV(e) {
    this._cachedWrapV = e;
  }
  /**
   * | Value | Type               | Description |
   * | ----- | ------------------ | ----------- |
   * | 0     | CLAMP_ADDRESSMODE  |             |
   * | 1     | WRAP_ADDRESSMODE   |             |
   * | 2     | MIRROR_ADDRESSMODE |             |
   */
  get wrapR() {
    return this._cachedWrapR;
  }
  set wrapR(e) {
    this._cachedWrapR = e;
  }
  /**
   * With compliant hardware and browser (supporting anisotropic filtering)
   * this defines the level of anisotropic filtering in the texture.
   * The higher the better but the slower.
   */
  get anisotropicFilteringLevel() {
    return this._cachedAnisotropicFilteringLevel;
  }
  set anisotropicFilteringLevel(e) {
    this._cachedAnisotropicFilteringLevel = e;
  }
  /**
   * Gets or sets the comparison function (513, 514, etc). Set 0 to not use a comparison function
   */
  get comparisonFunction() {
    return this._comparisonFunction;
  }
  set comparisonFunction(e) {
    this._comparisonFunction = e;
  }
  /**
   * Indicates to use the mip maps (if available on the texture).
   * Thanks to this flag, you can instruct the sampler to not sample the mipmaps even if they exist (and if the sampling mode is set to a value that normally samples the mipmaps!)
   */
  get useMipMaps() {
    return this._useMipMaps;
  }
  set useMipMaps(e) {
    this._useMipMaps = e;
  }
  /**
   * Creates a Sampler instance
   */
  constructor() {
    this.samplingMode = -1, this._useMipMaps = !0, this._cachedWrapU = null, this._cachedWrapV = null, this._cachedWrapR = null, this._cachedAnisotropicFilteringLevel = null, this._comparisonFunction = 0;
  }
  /**
   * Sets all the parameters of the sampler
   * @param wrapU u address mode (default: TEXTURE_WRAP_ADDRESSMODE)
   * @param wrapV v address mode (default: TEXTURE_WRAP_ADDRESSMODE)
   * @param wrapR r address mode (default: TEXTURE_WRAP_ADDRESSMODE)
   * @param anisotropicFilteringLevel anisotropic level (default: 1)
   * @param samplingMode sampling mode (default: 2)
   * @param comparisonFunction comparison function (default: 0 - no comparison function)
   * @returns the current sampler instance
   */
  setParameters(e = 1, t = 1, r = 1, n = 1, i = 2, s = 0) {
    return this._cachedWrapU = e, this._cachedWrapV = t, this._cachedWrapR = r, this._cachedAnisotropicFilteringLevel = n, this.samplingMode = i, this._comparisonFunction = s, this;
  }
  /**
   * Compares this sampler with another one
   * @param other sampler to compare with
   * @returns true if the samplers have the same parametres, else false
   */
  compareSampler(e) {
    return this._cachedWrapU === e._cachedWrapU && this._cachedWrapV === e._cachedWrapV && this._cachedWrapR === e._cachedWrapR && this._cachedAnisotropicFilteringLevel === e._cachedAnisotropicFilteringLevel && this.samplingMode === e.samplingMode && this._comparisonFunction === e._comparisonFunction && this._useMipMaps === e._useMipMaps;
  }
}
var ri;
(function(A) {
  A[A.Unknown = 0] = "Unknown", A[A.Url = 1] = "Url", A[A.Temp = 2] = "Temp", A[A.Raw = 3] = "Raw", A[A.Dynamic = 4] = "Dynamic", A[A.RenderTarget = 5] = "RenderTarget", A[A.MultiRenderTarget = 6] = "MultiRenderTarget", A[A.Cube = 7] = "Cube", A[A.CubeRaw = 8] = "CubeRaw", A[A.CubePrefiltered = 9] = "CubePrefiltered", A[A.Raw3D = 10] = "Raw3D", A[A.Raw2DArray = 11] = "Raw2DArray", A[A.DepthStencil = 12] = "DepthStencil", A[A.CubeRawRGBD = 13] = "CubeRawRGBD", A[A.Depth = 14] = "Depth";
})(ri || (ri = {}));
class As extends MN {
  /**
   * Gets a boolean indicating if the texture uses mipmaps
   * TODO implements useMipMaps as a separate setting from generateMipMaps
   */
  get useMipMaps() {
    return this.generateMipMaps;
  }
  set useMipMaps(e) {
    this.generateMipMaps = e;
  }
  /** Gets the unique id of the internal texture */
  get uniqueId() {
    return this._uniqueId;
  }
  /** @internal */
  _setUniqueId(e) {
    this._uniqueId = e;
  }
  /**
   * Gets the Engine the texture belongs to.
   * @returns The babylon engine
   */
  getEngine() {
    return this._engine;
  }
  /**
   * Gets the data source type of the texture
   */
  get source() {
    return this._source;
  }
  /**
   * Creates a new InternalTexture
   * @param engine defines the engine to use
   * @param source defines the type of data that will be used
   * @param delayAllocation if the texture allocation should be delayed (default: false)
   */
  constructor(e, t, r = !1) {
    super(), this.isReady = !1, this.isCube = !1, this.is3D = !1, this.is2DArray = !1, this.isMultiview = !1, this.url = "", this.generateMipMaps = !1, this.samples = 0, this.type = -1, this.format = -1, this.onLoadedObservable = new Oe(), this.onErrorObservable = new Oe(), this.onRebuildCallback = null, this.width = 0, this.height = 0, this.depth = 0, this.baseWidth = 0, this.baseHeight = 0, this.baseDepth = 0, this.invertY = !1, this._invertVScale = !1, this._associatedChannel = -1, this._source = ri.Unknown, this._buffer = null, this._bufferView = null, this._bufferViewArray = null, this._bufferViewArrayArray = null, this._size = 0, this._extension = "", this._files = null, this._workingCanvas = null, this._workingContext = null, this._cachedCoordinatesMode = null, this._isDisabled = !1, this._compression = null, this._sphericalPolynomial = null, this._sphericalPolynomialPromise = null, this._sphericalPolynomialComputed = !1, this._lodGenerationScale = 0, this._lodGenerationOffset = 0, this._useSRGBBuffer = !1, this._lodTextureHigh = null, this._lodTextureMid = null, this._lodTextureLow = null, this._isRGBD = !1, this._linearSpecularLOD = !1, this._irradianceTexture = null, this._hardwareTexture = null, this._maxLodLevel = null, this._references = 1, this._gammaSpace = null, this._premulAlpha = !1, this._dynamicTextureSource = null, this._engine = e, this._source = t, this._uniqueId = As._Counter++, r || (this._hardwareTexture = e._createHardwareTexture());
  }
  /**
   * Increments the number of references (ie. the number of Texture that point to it)
   */
  incrementReferences() {
    this._references++;
  }
  /**
   * Change the size of the texture (not the size of the content)
   * @param width defines the new width
   * @param height defines the new height
   * @param depth defines the new depth (1 by default)
   */
  updateSize(e, t, r = 1) {
    this._engine.updateTextureDimensions(this, e, t, r), this.width = e, this.height = t, this.depth = r, this.baseWidth = e, this.baseHeight = t, this.baseDepth = r, this._size = e * t * r;
  }
  /** @internal */
  _rebuild() {
    var e;
    if (this.isReady = !1, this._cachedCoordinatesMode = null, this._cachedWrapU = null, this._cachedWrapV = null, this._cachedWrapR = null, this._cachedAnisotropicFilteringLevel = null, this.onRebuildCallback) {
      const r = this.onRebuildCallback(this), n = (i) => {
        i._swapAndDie(this, !1), this.isReady = r.isReady;
      };
      r.isAsync ? r.proxy.then(n) : n(r.proxy);
      return;
    }
    let t;
    switch (this.source) {
      case ri.Temp:
        break;
      case ri.Url:
        t = this._engine.createTexture(
          (e = this._originalUrl) !== null && e !== void 0 ? e : this.url,
          !this.generateMipMaps,
          this.invertY,
          null,
          this.samplingMode,
          // Do not use Proxy here as it could be fully synchronous
          // and proxy would be undefined.
          (r) => {
            r._swapAndDie(this, !1), this.isReady = !0;
          },
          null,
          this._buffer,
          void 0,
          this.format,
          this._extension,
          void 0,
          void 0,
          void 0,
          this._useSRGBBuffer
        );
        return;
      case ri.Raw:
        t = this._engine.createRawTexture(this._bufferView, this.baseWidth, this.baseHeight, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type, void 0, this._useSRGBBuffer), t._swapAndDie(this, !1), this.isReady = !0;
        break;
      case ri.Raw3D:
        t = this._engine.createRawTexture3D(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type), t._swapAndDie(this, !1), this.isReady = !0;
        break;
      case ri.Raw2DArray:
        t = this._engine.createRawTexture2DArray(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type), t._swapAndDie(this, !1), this.isReady = !0;
        break;
      case ri.Dynamic:
        t = this._engine.createDynamicTexture(this.baseWidth, this.baseHeight, this.generateMipMaps, this.samplingMode), t._swapAndDie(this, !1), this._dynamicTextureSource && this._engine.updateDynamicTexture(this, this._dynamicTextureSource, this.invertY, this._premulAlpha, this.format, !0);
        break;
      case ri.Cube:
        t = this._engine.createCubeTexture(this.url, null, this._files, !this.generateMipMaps, () => {
          t._swapAndDie(this, !1), this.isReady = !0;
        }, null, this.format, this._extension, !1, 0, 0, null, void 0, this._useSRGBBuffer);
        return;
      case ri.CubeRaw:
        t = this._engine.createRawCubeTexture(this._bufferViewArray, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression), t._swapAndDie(this, !1), this.isReady = !0;
        break;
      case ri.CubeRawRGBD:
        return;
      case ri.CubePrefiltered:
        t = this._engine.createPrefilteredCubeTexture(this.url, null, this._lodGenerationScale, this._lodGenerationOffset, (r) => {
          r && r._swapAndDie(this, !1), this.isReady = !0;
        }, null, this.format, this._extension), t._sphericalPolynomial = this._sphericalPolynomial;
        return;
    }
  }
  /**
   * @internal
   */
  _swapAndDie(e, t = !0) {
    var r;
    (r = this._hardwareTexture) === null || r === void 0 || r.setUsage(e._source, this.generateMipMaps, this.isCube, this.width, this.height), e._hardwareTexture = this._hardwareTexture, t && (e._isRGBD = this._isRGBD), this._lodTextureHigh && (e._lodTextureHigh && e._lodTextureHigh.dispose(), e._lodTextureHigh = this._lodTextureHigh), this._lodTextureMid && (e._lodTextureMid && e._lodTextureMid.dispose(), e._lodTextureMid = this._lodTextureMid), this._lodTextureLow && (e._lodTextureLow && e._lodTextureLow.dispose(), e._lodTextureLow = this._lodTextureLow), this._irradianceTexture && (e._irradianceTexture && e._irradianceTexture.dispose(), e._irradianceTexture = this._irradianceTexture);
    const n = this._engine.getLoadedTexturesCache();
    let i = n.indexOf(this);
    i !== -1 && n.splice(i, 1), i = n.indexOf(e), i === -1 && n.push(e);
  }
  /**
   * Dispose the current allocated resources
   */
  dispose() {
    this._references--, this.onLoadedObservable.clear(), this.onErrorObservable.clear(), this._references === 0 && (this._engine._releaseTexture(this), this._hardwareTexture = null, this._dynamicTextureSource = null);
  }
}
As._Counter = 0;
class M9e {
  constructor() {
    this.shaderLanguage = za.GLSL;
  }
  postProcessor(e, t, r, n, i) {
    if (!i.getCaps().drawBuffersExtension) {
      const s = /#extension.+GL_EXT_draw_buffers.+(enable|require)/g;
      e = e.replace(s, "");
    }
    return e;
  }
}
const L9e = /(flat\s)?\s*varying\s*.*/;
class LN {
  constructor() {
    this.shaderLanguage = za.GLSL;
  }
  attributeProcessor(e) {
    return e.replace("attribute", "in");
  }
  varyingCheck(e, t) {
    return L9e.test(e);
  }
  varyingProcessor(e, t) {
    return e.replace("varying", t ? "in" : "out");
  }
  postProcessor(e, t, r) {
    const n = e.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1, i = /#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;
    if (e = e.replace(i, ""), e = e.replace(/texture2D\s*\(/g, "texture("), r) {
      const s = e.search(/layout *\(location *= *0\) *out/g) !== -1;
      e = e.replace(/texture2DLodEXT\s*\(/g, "textureLod("), e = e.replace(/textureCubeLodEXT\s*\(/g, "textureLod("), e = e.replace(/textureCube\s*\(/g, "texture("), e = e.replace(/gl_FragDepthEXT/g, "gl_FragDepth"), e = e.replace(/gl_FragColor/g, "glFragColor"), e = e.replace(/gl_FragData/g, "glFragData"), e = e.replace(/void\s+?main\s*\(/g, (n || s ? "" : `layout(location = 0) out vec4 glFragColor;
`) + "void main(");
    } else if (t.indexOf("#define MULTIVIEW") !== -1)
      return `#extension GL_OVR_multiview2 : require
layout (num_views = 2) in;
` + e;
    return e;
  }
}
class tg {
  /**
   * Gets the underlying buffer
   */
  get underlyingResource() {
    return null;
  }
  /**
   * Constructs the buffer
   */
  constructor() {
    this.references = 0, this.capacity = 0, this.is32Bits = !1, this.uniqueId = tg._Counter++;
  }
}
tg._Counter = 0;
class jS extends tg {
  constructor(e) {
    super(), this._buffer = e;
  }
  get underlyingResource() {
    return this._buffer;
  }
}
class E$ {
  constructor() {
    this._valueCache = {}, this.vertexCompilationError = null, this.fragmentCompilationError = null, this.programLinkError = null, this.programValidationError = null, this._isDisposed = !1;
  }
  get isAsync() {
    return this.isParallelCompiled;
  }
  get isReady() {
    return this.program ? this.isParallelCompiled ? this.engine._isRenderingStateCompiled(this) : !0 : !1;
  }
  _handlesSpectorRebuildCallback(e) {
    e && this.program && e(this.program);
  }
  _fillEffectInformation(e, t, r, n, i, s, a, f) {
    const o = this.engine;
    if (o.supportsUniformBuffers)
      for (const u in t)
        e.bindUniformBlock(u, t[u]);
    this.engine.getUniforms(this, r).forEach((u, l) => {
      n[r[l]] = u;
    }), this._uniforms = n;
    let v;
    for (v = 0; v < i.length; v++)
      e.getUniform(i[v]) == null && (i.splice(v, 1), v--);
    i.forEach((u, l) => {
      s[u] = l;
    });
    for (const u of o.getAttributes(this, a))
      f.push(u);
  }
  /**
   * Release all associated resources.
   **/
  dispose() {
    this._uniforms = {}, this._isDisposed = !0;
  }
  /**
   * @internal
   */
  _cacheMatrix(e, t) {
    const r = this._valueCache[e], n = t.updateFlag;
    return r !== void 0 && r === n ? !1 : (this._valueCache[e] = n, !0);
  }
  /**
   * @internal
   */
  _cacheFloat2(e, t, r) {
    let n = this._valueCache[e];
    if (!n || n.length !== 2)
      return n = [t, r], this._valueCache[e] = n, !0;
    let i = !1;
    return n[0] !== t && (n[0] = t, i = !0), n[1] !== r && (n[1] = r, i = !0), i;
  }
  /**
   * @internal
   */
  _cacheFloat3(e, t, r, n) {
    let i = this._valueCache[e];
    if (!i || i.length !== 3)
      return i = [t, r, n], this._valueCache[e] = i, !0;
    let s = !1;
    return i[0] !== t && (i[0] = t, s = !0), i[1] !== r && (i[1] = r, s = !0), i[2] !== n && (i[2] = n, s = !0), s;
  }
  /**
   * @internal
   */
  _cacheFloat4(e, t, r, n, i) {
    let s = this._valueCache[e];
    if (!s || s.length !== 4)
      return s = [t, r, n, i], this._valueCache[e] = s, !0;
    let a = !1;
    return s[0] !== t && (s[0] = t, a = !0), s[1] !== r && (s[1] = r, a = !0), s[2] !== n && (s[2] = n, a = !0), s[3] !== i && (s[3] = i, a = !0), a;
  }
  /**
   * Sets an integer value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value Value to be set.
   */
  setInt(e, t) {
    const r = this._valueCache[e];
    r !== void 0 && r === t || this.engine.setInt(this._uniforms[e], t) && (this._valueCache[e] = t);
  }
  /**
   * Sets a int2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int2.
   * @param y Second int in int2.
   */
  setInt2(e, t, r) {
    this._cacheFloat2(e, t, r) && (this.engine.setInt2(this._uniforms[e], t, r) || (this._valueCache[e] = null));
  }
  /**
   * Sets a int3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int3.
   * @param y Second int in int3.
   * @param z Third int in int3.
   */
  setInt3(e, t, r, n) {
    this._cacheFloat3(e, t, r, n) && (this.engine.setInt3(this._uniforms[e], t, r, n) || (this._valueCache[e] = null));
  }
  /**
   * Sets a int4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int4.
   * @param y Second int in int4.
   * @param z Third int in int4.
   * @param w Fourth int in int4.
   */
  setInt4(e, t, r, n, i) {
    this._cacheFloat4(e, t, r, n, i) && (this.engine.setInt4(this._uniforms[e], t, r, n, i) || (this._valueCache[e] = null));
  }
  /**
   * Sets an int array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray(e, t) {
    this._valueCache[e] = null, this.engine.setIntArray(this._uniforms[e], t);
  }
  /**
   * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray2(e, t) {
    this._valueCache[e] = null, this.engine.setIntArray2(this._uniforms[e], t);
  }
  /**
   * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray3(e, t) {
    this._valueCache[e] = null, this.engine.setIntArray3(this._uniforms[e], t);
  }
  /**
   * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray4(e, t) {
    this._valueCache[e] = null, this.engine.setIntArray4(this._uniforms[e], t);
  }
  /**
   * Sets an unsigned integer value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value Value to be set.
   */
  setUInt(e, t) {
    const r = this._valueCache[e];
    r !== void 0 && r === t || this.engine.setUInt(this._uniforms[e], t) && (this._valueCache[e] = t);
  }
  /**
   * Sets an unsigned int2 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint2.
   * @param y Second unsigned int in uint2.
   */
  setUInt2(e, t, r) {
    this._cacheFloat2(e, t, r) && (this.engine.setUInt2(this._uniforms[e], t, r) || (this._valueCache[e] = null));
  }
  /**
   * Sets an unsigned int3 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint3.
   * @param y Second unsigned int in uint3.
   * @param z Third unsigned int in uint3.
   */
  setUInt3(e, t, r, n) {
    this._cacheFloat3(e, t, r, n) && (this.engine.setUInt3(this._uniforms[e], t, r, n) || (this._valueCache[e] = null));
  }
  /**
   * Sets an unsigned int4 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint4.
   * @param y Second unsigned int in uint4.
   * @param z Third unsigned int in uint4.
   * @param w Fourth unsigned int in uint4.
   */
  setUInt4(e, t, r, n, i) {
    this._cacheFloat4(e, t, r, n, i) && (this.engine.setUInt4(this._uniforms[e], t, r, n, i) || (this._valueCache[e] = null));
  }
  /**
   * Sets an unsigned int array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray(e, t) {
    this._valueCache[e] = null, this.engine.setUIntArray(this._uniforms[e], t);
  }
  /**
   * Sets an unsigned int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray2(e, t) {
    this._valueCache[e] = null, this.engine.setUIntArray2(this._uniforms[e], t);
  }
  /**
   * Sets an unsigned int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray3(e, t) {
    this._valueCache[e] = null, this.engine.setUIntArray3(this._uniforms[e], t);
  }
  /**
   * Sets an unsigned int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray4(e, t) {
    this._valueCache[e] = null, this.engine.setUIntArray4(this._uniforms[e], t);
  }
  /**
   * Sets an array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setArray(e, t) {
    this._valueCache[e] = null, this.engine.setArray(this._uniforms[e], t);
  }
  /**
   * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setArray2(e, t) {
    this._valueCache[e] = null, this.engine.setArray2(this._uniforms[e], t);
  }
  /**
   * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setArray3(e, t) {
    this._valueCache[e] = null, this.engine.setArray3(this._uniforms[e], t);
  }
  /**
   * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setArray4(e, t) {
    this._valueCache[e] = null, this.engine.setArray4(this._uniforms[e], t);
  }
  /**
   * Sets matrices on a uniform variable.
   * @param uniformName Name of the variable.
   * @param matrices matrices to be set.
   */
  setMatrices(e, t) {
    t && (this._valueCache[e] = null, this.engine.setMatrices(this._uniforms[e], t));
  }
  /**
   * Sets matrix on a uniform variable.
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   */
  setMatrix(e, t) {
    this._cacheMatrix(e, t) && (this.engine.setMatrices(this._uniforms[e], t.toArray()) || (this._valueCache[e] = null));
  }
  /**
   * Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   */
  setMatrix3x3(e, t) {
    this._valueCache[e] = null, this.engine.setMatrix3x3(this._uniforms[e], t);
  }
  /**
   * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   */
  setMatrix2x2(e, t) {
    this._valueCache[e] = null, this.engine.setMatrix2x2(this._uniforms[e], t);
  }
  /**
   * Sets a float on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value value to be set.
   * @returns this effect.
   */
  setFloat(e, t) {
    const r = this._valueCache[e];
    r !== void 0 && r === t || this.engine.setFloat(this._uniforms[e], t) && (this._valueCache[e] = t);
  }
  /**
   * Sets a Vector2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector2 vector2 to be set.
   */
  setVector2(e, t) {
    this._cacheFloat2(e, t.x, t.y) && (this.engine.setFloat2(this._uniforms[e], t.x, t.y) || (this._valueCache[e] = null));
  }
  /**
   * Sets a float2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float2.
   * @param y Second float in float2.
   */
  setFloat2(e, t, r) {
    this._cacheFloat2(e, t, r) && (this.engine.setFloat2(this._uniforms[e], t, r) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Vector3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector3 Value to be set.
   */
  setVector3(e, t) {
    this._cacheFloat3(e, t.x, t.y, t.z) && (this.engine.setFloat3(this._uniforms[e], t.x, t.y, t.z) || (this._valueCache[e] = null));
  }
  /**
   * Sets a float3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float3.
   * @param y Second float in float3.
   * @param z Third float in float3.
   */
  setFloat3(e, t, r, n) {
    this._cacheFloat3(e, t, r, n) && (this.engine.setFloat3(this._uniforms[e], t, r, n) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Vector4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector4 Value to be set.
   */
  setVector4(e, t) {
    this._cacheFloat4(e, t.x, t.y, t.z, t.w) && (this.engine.setFloat4(this._uniforms[e], t.x, t.y, t.z, t.w) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Quaternion on a uniform variable.
   * @param uniformName Name of the variable.
   * @param quaternion Value to be set.
   */
  setQuaternion(e, t) {
    this._cacheFloat4(e, t.x, t.y, t.z, t.w) && (this.engine.setFloat4(this._uniforms[e], t.x, t.y, t.z, t.w) || (this._valueCache[e] = null));
  }
  /**
   * Sets a float4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float4.
   * @param y Second float in float4.
   * @param z Third float in float4.
   * @param w Fourth float in float4.
   * @returns this effect.
   */
  setFloat4(e, t, r, n, i) {
    this._cacheFloat4(e, t, r, n, i) && (this.engine.setFloat4(this._uniforms[e], t, r, n, i) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Color3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param color3 Value to be set.
   */
  setColor3(e, t) {
    this._cacheFloat3(e, t.r, t.g, t.b) && (this.engine.setFloat3(this._uniforms[e], t.r, t.g, t.b) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Color4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param color3 Value to be set.
   * @param alpha Alpha value to be set.
   */
  setColor4(e, t, r) {
    this._cacheFloat4(e, t.r, t.g, t.b, r) && (this.engine.setFloat4(this._uniforms[e], t.r, t.g, t.b, r) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Color4 on a uniform variable
   * @param uniformName defines the name of the variable
   * @param color4 defines the value to be set
   */
  setDirectColor4(e, t) {
    this._cacheFloat4(e, t.r, t.g, t.b, t.a) && (this.engine.setFloat4(this._uniforms[e], t.r, t.g, t.b, t.a) || (this._valueCache[e] = null));
  }
  _getVertexShaderCode() {
    return this.vertexShader ? this.engine._getShaderSource(this.vertexShader) : null;
  }
  _getFragmentShaderCode() {
    return this.fragmentShader ? this.engine._getShaderSource(this.fragmentShader) : null;
  }
}
class jm {
  get underlyingResource() {
    return this._webGLTexture;
  }
  constructor(e = null, t) {
    if (this._MSAARenderBuffers = null, this._context = t, !e && (e = t.createTexture(), !e))
      throw new Error("Unable to create webGL texture");
    this.set(e);
  }
  setUsage() {
  }
  set(e) {
    this._webGLTexture = e;
  }
  reset() {
    this._webGLTexture = null, this._MSAARenderBuffers = null;
  }
  addMSAARenderBuffer(e) {
    this._MSAARenderBuffers || (this._MSAARenderBuffers = []), this._MSAARenderBuffers.push(e);
  }
  releaseMSAARenderBuffers() {
    if (this._MSAARenderBuffers) {
      for (const e of this._MSAARenderBuffers)
        this._context.deleteRenderbuffer(e);
      this._MSAARenderBuffers = null;
    }
  }
  getMSAARenderBuffer(e = 0) {
    var t, r;
    return (r = (t = this._MSAARenderBuffers) === null || t === void 0 ? void 0 : t[e]) !== null && r !== void 0 ? r : null;
  }
  release() {
    this.releaseMSAARenderBuffers(), this._webGLTexture && this._context.deleteTexture(this._webGLTexture), this.reset();
  }
}
class zo {
  static IsWrapper(e) {
    return e.getPipelineContext === void 0;
  }
  static GetEffect(e) {
    return e.getPipelineContext === void 0 ? e.effect : e;
  }
  constructor(e, t = !0) {
    this.effect = null, this.defines = null, this.drawContext = e.createDrawContext(), t && (this.materialContext = e.createMaterialContext());
  }
  setEffect(e, t, r = !0) {
    var n;
    this.effect = e, t !== void 0 && (this.defines = t), r && ((n = this.drawContext) === null || n === void 0 || n.reset());
  }
  dispose() {
    var e;
    (e = this.drawContext) === null || e === void 0 || e.dispose();
  }
}
class KN {
  get isDirty() {
    return this._isStencilTestDirty || this._isStencilMaskDirty || this._isStencilFuncDirty || this._isStencilOpDirty;
  }
  get func() {
    return this._func;
  }
  set func(e) {
    this._func !== e && (this._func = e, this._isStencilFuncDirty = !0);
  }
  get funcRef() {
    return this._funcRef;
  }
  set funcRef(e) {
    this._funcRef !== e && (this._funcRef = e, this._isStencilFuncDirty = !0);
  }
  get funcMask() {
    return this._funcMask;
  }
  set funcMask(e) {
    this._funcMask !== e && (this._funcMask = e, this._isStencilFuncDirty = !0);
  }
  get opStencilFail() {
    return this._opStencilFail;
  }
  set opStencilFail(e) {
    this._opStencilFail !== e && (this._opStencilFail = e, this._isStencilOpDirty = !0);
  }
  get opDepthFail() {
    return this._opDepthFail;
  }
  set opDepthFail(e) {
    this._opDepthFail !== e && (this._opDepthFail = e, this._isStencilOpDirty = !0);
  }
  get opStencilDepthPass() {
    return this._opStencilDepthPass;
  }
  set opStencilDepthPass(e) {
    this._opStencilDepthPass !== e && (this._opStencilDepthPass = e, this._isStencilOpDirty = !0);
  }
  get mask() {
    return this._mask;
  }
  set mask(e) {
    this._mask !== e && (this._mask = e, this._isStencilMaskDirty = !0);
  }
  get enabled() {
    return this._enabled;
  }
  set enabled(e) {
    this._enabled !== e && (this._enabled = e, this._isStencilTestDirty = !0);
  }
  constructor(e = !0) {
    this._isStencilTestDirty = !1, this._isStencilMaskDirty = !1, this._isStencilFuncDirty = !1, this._isStencilOpDirty = !1, this.useStencilGlobalOnly = !1, e && this.reset();
  }
  reset() {
    var e;
    this.stencilMaterial = void 0, (e = this.stencilGlobal) === null || e === void 0 || e.reset(), this._isStencilTestDirty = !0, this._isStencilMaskDirty = !0, this._isStencilFuncDirty = !0, this._isStencilOpDirty = !0;
  }
  apply(e) {
    var t;
    if (!e)
      return;
    const r = !this.useStencilGlobalOnly && !!(!((t = this.stencilMaterial) === null || t === void 0) && t.enabled);
    this.enabled = r ? this.stencilMaterial.enabled : this.stencilGlobal.enabled, this.func = r ? this.stencilMaterial.func : this.stencilGlobal.func, this.funcRef = r ? this.stencilMaterial.funcRef : this.stencilGlobal.funcRef, this.funcMask = r ? this.stencilMaterial.funcMask : this.stencilGlobal.funcMask, this.opStencilFail = r ? this.stencilMaterial.opStencilFail : this.stencilGlobal.opStencilFail, this.opDepthFail = r ? this.stencilMaterial.opDepthFail : this.stencilGlobal.opDepthFail, this.opStencilDepthPass = r ? this.stencilMaterial.opStencilDepthPass : this.stencilGlobal.opStencilDepthPass, this.mask = r ? this.stencilMaterial.mask : this.stencilGlobal.mask, this.isDirty && (this._isStencilTestDirty && (this.enabled ? e.enable(e.STENCIL_TEST) : e.disable(e.STENCIL_TEST), this._isStencilTestDirty = !1), this._isStencilMaskDirty && (e.stencilMask(this.mask), this._isStencilMaskDirty = !1), this._isStencilFuncDirty && (e.stencilFunc(this.func, this.funcRef, this.funcMask), this._isStencilFuncDirty = !1), this._isStencilOpDirty && (e.stencilOp(this.opStencilFail, this.opDepthFail, this.opStencilDepthPass), this._isStencilOpDirty = !1));
  }
}
class K9e {
}
class hr {
  /**
   * Returns the current npm package of the sdk
   */
  // Not mixed with Version for tooling purpose.
  static get NpmPackage() {
    return "babylonjs@6.33.0";
  }
  /**
   * Returns the current version of the framework
   */
  static get Version() {
    return "6.33.0";
  }
  /**
   * Returns a string describing the current engine
   */
  get description() {
    let e = this.name + this.webGLVersion;
    return this._caps.parallelShaderCompile && (e += " - Parallel shader compilation"), e;
  }
  /**
   * Gets or sets the name of the engine
   */
  get name() {
    return this._name;
  }
  set name(e) {
    this._name = e;
  }
  /**
   * Returns the version of the engine
   */
  get version() {
    return this._webGLVersion;
  }
  get isDisposed() {
    return this._isDisposed;
  }
  /**
   * Gets or sets the relative url used to load shaders if using the engine in non-minified mode
   */
  static get ShadersRepository() {
    return An.ShadersRepository;
  }
  static set ShadersRepository(e) {
    An.ShadersRepository = e;
  }
  /**
   * @internal
   */
  _getShaderProcessor(e) {
    return this._shaderProcessor;
  }
  /**
   * Gets or sets a boolean indicating if depth buffer should be reverse, going from far to near.
   * This can provide greater z depth for distant objects.
   */
  get useReverseDepthBuffer() {
    return this._useReverseDepthBuffer;
  }
  set useReverseDepthBuffer(e) {
    e !== this._useReverseDepthBuffer && (this._useReverseDepthBuffer = e, e ? this._depthCullingState.depthFunc = 518 : this._depthCullingState.depthFunc = 515);
  }
  /**
   * Gets the current frame id
   */
  get frameId() {
    return this._frameId;
  }
  /**
   * Gets a boolean indicating that the engine supports uniform buffers
   * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
   */
  get supportsUniformBuffers() {
    return this.webGLVersion > 1 && !this.disableUniformBuffers;
  }
  /**
   * Gets the options used for engine creation
   * @returns EngineOptions object
   */
  getCreationOptions() {
    return this._creationOptions;
  }
  /** @internal */
  get _shouldUseHighPrecisionShader() {
    return !!(this._caps.highPrecisionShaderSupported && this._highPrecisionShadersAllowed);
  }
  /**
   * Gets a boolean indicating that only power of 2 textures are supported
   * Please note that you can still use non power of 2 textures but in this case the engine will forcefully convert them
   */
  get needPOTTextures() {
    return this._webGLVersion < 2 || this.forcePOTTextures;
  }
  /**
   * Gets the list of current active render loop functions
   * @returns an array with the current render loop functions
   */
  get activeRenderLoops() {
    return this._activeRenderLoops;
  }
  /**
   * Gets or sets a boolean indicating if resources should be retained to be able to handle context lost events
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#handling-webgl-context-lost
   */
  get doNotHandleContextLost() {
    return this._doNotHandleContextLost;
  }
  set doNotHandleContextLost(e) {
    this._doNotHandleContextLost = e;
  }
  get _supportsHardwareTextureRescaling() {
    return !1;
  }
  /**
   * sets the object from which width and height will be taken from when getting render width and height
   * Will fallback to the gl object
   * @param dimensions the framebuffer width and height that will be used.
   */
  set framebufferDimensionsObject(e) {
    this._framebufferDimensionsObject = e;
  }
  /**
   * Gets the current viewport
   */
  get currentViewport() {
    return this._cachedViewport;
  }
  /**
   * Gets the default empty texture
   */
  get emptyTexture() {
    return this._emptyTexture || (this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, 5, !1, !1, 1)), this._emptyTexture;
  }
  /**
   * Gets the default empty 3D texture
   */
  get emptyTexture3D() {
    return this._emptyTexture3D || (this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, 5, !1, !1, 1)), this._emptyTexture3D;
  }
  /**
   * Gets the default empty 2D array texture
   */
  get emptyTexture2DArray() {
    return this._emptyTexture2DArray || (this._emptyTexture2DArray = this.createRawTexture2DArray(new Uint8Array(4), 1, 1, 1, 5, !1, !1, 1)), this._emptyTexture2DArray;
  }
  /**
   * Gets the default empty cube texture
   */
  get emptyCubeTexture() {
    if (!this._emptyCubeTexture) {
      const e = new Uint8Array(4), t = [e, e, e, e, e, e];
      this._emptyCubeTexture = this.createRawCubeTexture(t, 1, 5, 0, !1, !1, 1);
    }
    return this._emptyCubeTexture;
  }
  /**
   * Gets a boolean indicating if the engine runs in WebGPU or not.
   */
  get isWebGPU() {
    return this._isWebGPU;
  }
  /**
   * Gets the shader platform name used by the effects.
   */
  get shaderPlatformName() {
    return this._shaderPlatformName;
  }
  /**
   * Enables or disables the snapshot rendering mode
   * Note that the WebGL engine does not support snapshot rendering so setting the value won't have any effect for this engine
   */
  get snapshotRendering() {
    return !1;
  }
  set snapshotRendering(e) {
  }
  /**
   * Gets or sets the snapshot rendering mode
   */
  get snapshotRenderingMode() {
    return this._snapshotRenderingMode;
  }
  set snapshotRenderingMode(e) {
    this._snapshotRenderingMode = e;
  }
  /**
   * Creates a new snapshot at the next frame using the current snapshotRenderingMode
   */
  snapshotRenderingReset() {
    this.snapshotRendering = !1;
  }
  static _CreateCanvas(e, t) {
    if (typeof document > "u")
      return new OffscreenCanvas(e, t);
    const r = document.createElement("canvas");
    return r.width = e, r.height = t, r;
  }
  /**
   * Create a canvas. This method is overridden by other engines
   * @param width width
   * @param height height
   * @returns ICanvas interface
   */
  createCanvas(e, t) {
    return hr._CreateCanvas(e, t);
  }
  /**
   * Create an image to use with canvas
   * @returns IImage interface
   */
  createCanvasImage() {
    return document.createElement("img");
  }
  /**
   * Creates a new engine
   * @param canvasOrContext defines the canvas or WebGL context to use for rendering. If you provide a WebGL context, Babylon.js will not hook events on the canvas (like pointers, keyboards, etc...) so no event observables will be available. This is mostly used when Babylon.js is used as a plugin on a system which already used the WebGL context
   * @param antialias defines enable antialiasing (default: false)
   * @param options defines further options to be sent to the getContext() function
   * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
   */
  constructor(e, t, r, n) {
    var i, s, a, f, o, d, v, u, l, P, p;
    this._name = "WebGL", this._isDisposed = !1, this.forcePOTTextures = !1, this.isFullscreen = !1, this.cullBackFaces = null, this.renderEvenInBackground = !0, this.preventCacheWipeBetweenFrames = !1, this.validateShaderPrograms = !1, this._useReverseDepthBuffer = !1, this.isNDCHalfZRange = !1, this.hasOriginBottomLeft = !0, this.disableUniformBuffers = !1, this.onDisposeObservable = new Oe(), this._frameId = 0, this._uniformBuffers = new Array(), this._storageBuffers = new Array(), this._webGLVersion = 1, this._windowIsBackground = !1, this._highPrecisionShadersAllowed = !0, this._badOS = !1, this._badDesktopOS = !1, this._renderingQueueLaunched = !1, this._activeRenderLoops = new Array(), this.onContextLostObservable = new Oe(), this.onContextRestoredObservable = new Oe(), this._contextWasLost = !1, this._doNotHandleContextLost = !1, this.disableVertexArrayObjects = !1, this._colorWrite = !0, this._colorWriteChanged = !0, this._depthCullingState = new YN(), this._stencilStateComposer = new KN(), this._stencilState = new L2(), this._alphaState = new k$(), this._alphaMode = 1, this._alphaEquation = 0, this._internalTexturesCache = new Array(), this._renderTargetWrapperCache = new Array(), this._activeChannel = 0, this._currentTextureChannel = -1, this._boundTexturesCache = {}, this._compiledEffects = {}, this._vertexAttribArraysEnabled = [], this._currentRenderTarget = null, this._uintIndicesCurrentlySet = !1, this._currentBoundBuffer = new Array(), this._currentFramebuffer = null, this._dummyFramebuffer = null, this._currentBufferPointers = new Array(), this._currentInstanceLocations = new Array(), this._currentInstanceBuffers = new Array(), this._vaoRecordInProgress = !1, this._mustWipeVertexAttributes = !1, this._nextFreeTextureSlots = new Array(), this._maxSimultaneousTextures = 0, this._maxMSAASamplesOverride = null, this._activeRequests = new Array(), this.adaptToDeviceRatio = !1, this._lastDevicePixelRatio = 1, this._transformTextureUrl = null, this.hostInformation = {
      isMobile: !1
    }, this.premultipliedAlpha = !0, this.onBeforeTextureInitObservable = new Oe(), this._isWebGPU = !1, this._snapshotRenderingMode = 0, this._viewportCached = { x: 0, y: 0, z: 0, w: 0 }, this._unpackFlipYCached = null, this.enableUnpackFlipYCached = !0, this._boundUniforms = {}, this.startTime = Yi.Now;
    let c = null;
    r = r || {}, this._creationOptions = r, this.adaptToDeviceRatio = n ?? !1, this._stencilStateComposer.stencilGlobal = this._stencilState, k9.SetMatrixPrecision(!!r.useHighPrecisionMatrix), r.antialias = t ?? r.antialias, r.deterministicLockstep = (i = r.deterministicLockstep) !== null && i !== void 0 ? i : !1, r.lockstepMaxSteps = (s = r.lockstepMaxSteps) !== null && s !== void 0 ? s : 4, r.timeStep = (a = r.timeStep) !== null && a !== void 0 ? a : 1 / 60, r.audioEngine = (f = r.audioEngine) !== null && f !== void 0 ? f : !0, r.stencil = (o = r.stencil) !== null && o !== void 0 ? o : !0, this._audioContext = (v = (d = r.audioEngineOptions) === null || d === void 0 ? void 0 : d.audioContext) !== null && v !== void 0 ? v : null, this._audioDestination = (l = (u = r.audioEngineOptions) === null || u === void 0 ? void 0 : u.audioDestination) !== null && l !== void 0 ? l : null, this.premultipliedAlpha = (P = r.premultipliedAlpha) !== null && P !== void 0 ? P : !0, this.useExactSrgbConversions = (p = r.useExactSrgbConversions) !== null && p !== void 0 ? p : !1, this._doNotHandleContextLost = !!r.doNotHandleContextLost, this._isStencilEnable = !!r.stencil, n = n || r.adaptToDeviceRatio || !1;
    const H = u9() && window.devicePixelRatio || 1, T = r.limitDeviceRatio || H;
    if (this._hardwareScalingLevel = n ? 1 / Math.min(T, H) : 1, this._lastDevicePixelRatio = H, !e)
      return;
    if (e.getContext) {
      if (c = e, this._renderingCanvas = c, r.preserveDrawingBuffer === void 0 && (r.preserveDrawingBuffer = !1), r.xrCompatible === void 0 && (r.xrCompatible = !0), navigator && navigator.userAgent) {
        this._setupMobileChecks();
        const b = navigator.userAgent;
        for (const j of hr.ExceptionList) {
          const w = j.key, m = j.targets;
          if (new RegExp(w).test(b)) {
            if (j.capture && j.captureConstraint) {
              const N = j.capture, k = j.captureConstraint, y = new RegExp(N).exec(b);
              if (y && y.length > 0 && parseInt(y[y.length - 1]) >= k)
                continue;
            }
            for (const N of m)
              switch (N) {
                case "uniformBuffer":
                  this.disableUniformBuffers = !0;
                  break;
                case "vao":
                  this.disableVertexArrayObjects = !0;
                  break;
                case "antialias":
                  r.antialias = !1;
                  break;
                case "maxMSAASamples":
                  this._maxMSAASamplesOverride = 1;
                  break;
              }
          }
        }
      }
      if (this._doNotHandleContextLost || (this._onContextLost = (b) => {
        b.preventDefault(), this._contextWasLost = !0, Se.Warn("WebGL context lost."), this.onContextLostObservable.notifyObservers(this);
      }, this._onContextRestored = () => {
        this._restoreEngineAfterContextLost(() => this._initGLContext());
      }, c.addEventListener("webglcontextlost", this._onContextLost, !1), c.addEventListener("webglcontextrestored", this._onContextRestored, !1), r.powerPreference = r.powerPreference || "high-performance"), this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), this._badDesktopOS && (r.xrCompatible = !1), !r.disableWebGL2Support)
        try {
          this._gl = c.getContext("webgl2", r) || c.getContext("experimental-webgl2", r), this._gl && (this._webGLVersion = 2, this._shaderPlatformName = "WEBGL2", this._gl.deleteQuery || (this._webGLVersion = 1, this._shaderPlatformName = "WEBGL1"));
        } catch {
        }
      if (!this._gl) {
        if (!c)
          throw new Error("The provided canvas is null or undefined.");
        try {
          this._gl = c.getContext("webgl", r) || c.getContext("experimental-webgl", r);
        } catch {
          throw new Error("WebGL not supported");
        }
      }
      if (!this._gl)
        throw new Error("WebGL not supported");
    } else {
      this._gl = e, this._renderingCanvas = this._gl.canvas, this._gl.renderbufferStorageMultisample ? (this._webGLVersion = 2, this._shaderPlatformName = "WEBGL2") : this._shaderPlatformName = "WEBGL1";
      const b = this._gl.getContextAttributes();
      b && (r.stencil = b.stencil);
    }
    this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE), r.useHighPrecisionFloats !== void 0 && (this._highPrecisionShadersAllowed = r.useHighPrecisionFloats), this.resize(), this._initGLContext(), this._initFeatures();
    for (let b = 0; b < this._caps.maxVertexAttribs; b++)
      this._currentBufferPointers[b] = new K9e();
    this._shaderProcessor = this.webGLVersion > 1 ? new LN() : new M9e(), this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent);
    const q = `Babylon.js v${hr.Version}`;
    console.log(q + ` - ${this.description}`), this._renderingCanvas && this._renderingCanvas.setAttribute && this._renderingCanvas.setAttribute("data-engine", q);
  }
  _setupMobileChecks() {
    navigator && navigator.userAgent && (this._checkForMobile = () => {
      const e = navigator.userAgent;
      this.hostInformation.isMobile = e.indexOf("Mobile") !== -1 || // Needed for iOS 13+ detection on iPad (inspired by solution from https://stackoverflow.com/questions/9038625/detect-if-device-is-ios)
      e.indexOf("Mac") !== -1 && $w() && "ontouchend" in document;
    }, this._checkForMobile(), u9() && window.addEventListener("resize", this._checkForMobile));
  }
  _restoreEngineAfterContextLost(e) {
    setTimeout(async () => {
      var t;
      this._dummyFramebuffer = null;
      const r = this._depthCullingState.depthTest, n = this._depthCullingState.depthFunc, i = this._depthCullingState.depthMask, s = this._stencilState.stencilTest;
      await e(), this.wipeCaches(!0), this._rebuildEffects(), (t = this._rebuildComputeEffects) === null || t === void 0 || t.call(this), this._rebuildBuffers(), this._rebuildInternalTextures(), this._rebuildRenderTargetWrappers(), this.wipeCaches(!0), this._depthCullingState.depthTest = r, this._depthCullingState.depthFunc = n, this._depthCullingState.depthMask = i, this._stencilState.stencilTest = s, Se.Warn(this.name + " context successfully restored."), this.onContextRestoredObservable.notifyObservers(this), this._contextWasLost = !1;
    }, 0);
  }
  /**
   * Shared initialization across engines types.
   * @param canvas The canvas associated with this instance of the engine.
   */
  _sharedInit(e) {
    this._renderingCanvas = e;
  }
  /**
   * @internal
   */
  _getShaderProcessingContext(e) {
    return null;
  }
  _rebuildInternalTextures() {
    const e = this._internalTexturesCache.slice();
    for (const t of e)
      t._rebuild();
  }
  _rebuildRenderTargetWrappers() {
    const e = this._renderTargetWrapperCache.slice();
    for (const t of e)
      t._rebuild();
  }
  _rebuildEffects() {
    for (const e in this._compiledEffects) {
      const t = this._compiledEffects[e];
      t._pipelineContext = null, t._wasPreviouslyReady = !1, t._prepareEffect();
    }
    An.ResetCache();
  }
  /**
   * Gets a boolean indicating if all created effects are ready
   * @returns true if all effects are ready
   */
  areAllEffectsReady() {
    for (const e in this._compiledEffects)
      if (!this._compiledEffects[e].isReady())
        return !1;
    return !0;
  }
  _rebuildBuffers() {
    for (const e of this._uniformBuffers)
      e._rebuild();
    for (const e of this._storageBuffers)
      e._rebuild();
  }
  _initGLContext() {
    var e;
    this._caps = {
      maxTexturesImageUnits: this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),
      maxCombinedTexturesImageUnits: this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),
      maxVertexTextureImageUnits: this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
      maxTextureSize: this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),
      maxSamples: this._webGLVersion > 1 ? this._gl.getParameter(this._gl.MAX_SAMPLES) : 1,
      maxCubemapTextureSize: this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),
      maxRenderTextureSize: this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),
      maxVertexAttribs: this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),
      maxVaryingVectors: this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),
      maxFragmentUniformVectors: this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),
      maxVertexUniformVectors: this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),
      parallelShaderCompile: this._gl.getExtension("KHR_parallel_shader_compile") || void 0,
      standardDerivatives: this._webGLVersion > 1 || this._gl.getExtension("OES_standard_derivatives") !== null,
      maxAnisotropy: 1,
      astc: this._gl.getExtension("WEBGL_compressed_texture_astc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),
      bptc: this._gl.getExtension("EXT_texture_compression_bptc") || this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),
      s3tc: this._gl.getExtension("WEBGL_compressed_texture_s3tc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),
      // eslint-disable-next-line @typescript-eslint/naming-convention
      s3tc_srgb: this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),
      pvrtc: this._gl.getExtension("WEBGL_compressed_texture_pvrtc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
      etc1: this._gl.getExtension("WEBGL_compressed_texture_etc1") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),
      etc2: this._gl.getExtension("WEBGL_compressed_texture_etc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc") || this._gl.getExtension("WEBGL_compressed_texture_es3_0"),
      textureAnisotropicFilterExtension: this._gl.getExtension("EXT_texture_filter_anisotropic") || this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic") || this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),
      uintIndices: this._webGLVersion > 1 || this._gl.getExtension("OES_element_index_uint") !== null,
      fragmentDepthSupported: this._webGLVersion > 1 || this._gl.getExtension("EXT_frag_depth") !== null,
      highPrecisionShaderSupported: !1,
      timerQuery: this._gl.getExtension("EXT_disjoint_timer_query_webgl2") || this._gl.getExtension("EXT_disjoint_timer_query"),
      supportOcclusionQuery: this._webGLVersion > 1,
      canUseTimestampForTimerQuery: !1,
      drawBuffersExtension: !1,
      maxMSAASamples: 1,
      colorBufferFloat: !!(this._webGLVersion > 1 && this._gl.getExtension("EXT_color_buffer_float")),
      supportFloatTexturesResolve: !1,
      colorBufferHalfFloat: !!(this._webGLVersion > 1 && this._gl.getExtension("EXT_color_buffer_half_float")),
      textureFloat: !!(this._webGLVersion > 1 || this._gl.getExtension("OES_texture_float")),
      textureHalfFloat: !!(this._webGLVersion > 1 || this._gl.getExtension("OES_texture_half_float")),
      textureHalfFloatRender: !1,
      textureFloatLinearFiltering: !1,
      textureFloatRender: !1,
      textureHalfFloatLinearFiltering: !1,
      vertexArrayObject: !1,
      instancedArrays: !1,
      textureLOD: !!(this._webGLVersion > 1 || this._gl.getExtension("EXT_shader_texture_lod")),
      texelFetch: this._webGLVersion !== 1,
      blendMinMax: !1,
      multiview: this._gl.getExtension("OVR_multiview2"),
      oculusMultiview: this._gl.getExtension("OCULUS_multiview"),
      depthTextureExtension: !1,
      canUseGLInstanceID: this._webGLVersion > 1,
      canUseGLVertexID: this._webGLVersion > 1,
      supportComputeShaders: !1,
      supportSRGBBuffers: !1,
      supportTransformFeedbacks: this._webGLVersion > 1,
      textureMaxLevel: this._webGLVersion > 1,
      texture2DArrayMaxLayerCount: this._webGLVersion > 1 ? this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS) : 128,
      disableMorphTargetTexture: !1
    }, this._caps.supportFloatTexturesResolve = this._caps.colorBufferFloat, this._glVersion = this._gl.getParameter(this._gl.VERSION);
    const t = this._gl.getExtension("WEBGL_debug_renderer_info");
    if (t != null && (this._glRenderer = this._gl.getParameter(t.UNMASKED_RENDERER_WEBGL), this._glVendor = this._gl.getParameter(t.UNMASKED_VENDOR_WEBGL)), this._glVendor || (this._glVendor = this._gl.getParameter(this._gl.VENDOR) || "Unknown vendor"), this._glRenderer || (this._glRenderer = this._gl.getParameter(this._gl.RENDERER) || "Unknown renderer"), this._gl.HALF_FLOAT_OES !== 36193 && (this._gl.HALF_FLOAT_OES = 36193), this._gl.RGBA16F !== 34842 && (this._gl.RGBA16F = 34842), this._gl.RGBA32F !== 34836 && (this._gl.RGBA32F = 34836), this._gl.DEPTH24_STENCIL8 !== 35056 && (this._gl.DEPTH24_STENCIL8 = 35056), this._caps.timerQuery && (this._webGLVersion === 1 && (this._gl.getQuery = this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)), this._caps.canUseTimestampForTimerQuery = ((e = this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT, this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)) !== null && e !== void 0 ? e : 0) > 0), this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0, this._caps.textureFloatLinearFiltering = !!(this._caps.textureFloat && this._gl.getExtension("OES_texture_float_linear")), this._caps.textureFloatRender = !!(this._caps.textureFloat && this._canRenderToFloatFramebuffer()), this._caps.textureHalfFloatLinearFiltering = !!(this._webGLVersion > 1 || this._caps.textureHalfFloat && this._gl.getExtension("OES_texture_half_float_linear")), this._caps.astc && (this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR), this._caps.bptc && (this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT), this._caps.s3tc_srgb && (this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT, this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT), this._caps.etc2 && (this._gl.COMPRESSED_SRGB8_ETC2 = this._caps.etc2.COMPRESSED_SRGB8_ETC2, this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC), this._webGLVersion > 1 && this._gl.HALF_FLOAT_OES !== 5131 && (this._gl.HALF_FLOAT_OES = 5131), this._caps.textureHalfFloatRender = this._caps.textureHalfFloat && this._canRenderToHalfFloatFramebuffer(), this._webGLVersion > 1)
      this._caps.drawBuffersExtension = !0, this._caps.maxMSAASamples = this._maxMSAASamplesOverride !== null ? this._maxMSAASamplesOverride : this._gl.getParameter(this._gl.MAX_SAMPLES);
    else {
      const r = this._gl.getExtension("WEBGL_draw_buffers");
      if (r !== null) {
        this._caps.drawBuffersExtension = !0, this._gl.drawBuffers = r.drawBuffersWEBGL.bind(r), this._gl.DRAW_FRAMEBUFFER = this._gl.FRAMEBUFFER;
        for (let n = 0; n < 16; n++)
          this._gl["COLOR_ATTACHMENT" + n + "_WEBGL"] = r["COLOR_ATTACHMENT" + n + "_WEBGL"];
      }
    }
    if (this._webGLVersion > 1)
      this._caps.depthTextureExtension = !0;
    else {
      const r = this._gl.getExtension("WEBGL_depth_texture");
      r != null && (this._caps.depthTextureExtension = !0, this._gl.UNSIGNED_INT_24_8 = r.UNSIGNED_INT_24_8_WEBGL);
    }
    if (this.disableVertexArrayObjects)
      this._caps.vertexArrayObject = !1;
    else if (this._webGLVersion > 1)
      this._caps.vertexArrayObject = !0;
    else {
      const r = this._gl.getExtension("OES_vertex_array_object");
      r != null && (this._caps.vertexArrayObject = !0, this._gl.createVertexArray = r.createVertexArrayOES.bind(r), this._gl.bindVertexArray = r.bindVertexArrayOES.bind(r), this._gl.deleteVertexArray = r.deleteVertexArrayOES.bind(r));
    }
    if (this._webGLVersion > 1)
      this._caps.instancedArrays = !0;
    else {
      const r = this._gl.getExtension("ANGLE_instanced_arrays");
      r != null ? (this._caps.instancedArrays = !0, this._gl.drawArraysInstanced = r.drawArraysInstancedANGLE.bind(r), this._gl.drawElementsInstanced = r.drawElementsInstancedANGLE.bind(r), this._gl.vertexAttribDivisor = r.vertexAttribDivisorANGLE.bind(r)) : this._caps.instancedArrays = !1;
    }
    if (this._gl.getShaderPrecisionFormat) {
      const r = this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER, this._gl.HIGH_FLOAT), n = this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT);
      r && n && (this._caps.highPrecisionShaderSupported = r.precision !== 0 && n.precision !== 0);
    }
    if (this._webGLVersion > 1)
      this._caps.blendMinMax = !0;
    else {
      const r = this._gl.getExtension("EXT_blend_minmax");
      r != null && (this._caps.blendMinMax = !0, this._gl.MAX = r.MAX_EXT, this._gl.MIN = r.MIN_EXT);
    }
    if (!this._caps.supportSRGBBuffers) {
      if (this._webGLVersion > 1)
        this._caps.supportSRGBBuffers = !0, this._glSRGBExtensionValues = {
          SRGB: WebGL2RenderingContext.SRGB,
          SRGB8: WebGL2RenderingContext.SRGB8,
          SRGB8_ALPHA8: WebGL2RenderingContext.SRGB8_ALPHA8
        };
      else {
        const r = this._gl.getExtension("EXT_sRGB");
        r != null && (this._caps.supportSRGBBuffers = !0, this._glSRGBExtensionValues = {
          SRGB: r.SRGB_EXT,
          SRGB8: r.SRGB_ALPHA_EXT,
          SRGB8_ALPHA8: r.SRGB_ALPHA_EXT
        });
      }
      this._caps.supportSRGBBuffers = this._caps.supportSRGBBuffers && !!(this._creationOptions && this._creationOptions.forceSRGBBufferSupportState);
    }
    this._depthCullingState.depthTest = !0, this._depthCullingState.depthFunc = this._gl.LEQUAL, this._depthCullingState.depthMask = !0, this._maxSimultaneousTextures = this._caps.maxCombinedTexturesImageUnits;
    for (let r = 0; r < this._maxSimultaneousTextures; r++)
      this._nextFreeTextureSlots.push(r);
    this._glRenderer === "Mali-G72" && (this._caps.disableMorphTargetTexture = !0);
  }
  _initFeatures() {
    this._features = {
      forceBitmapOverHTMLImageElement: !1,
      supportRenderAndCopyToLodForFloatTextures: this._webGLVersion !== 1,
      supportDepthStencilTexture: this._webGLVersion !== 1,
      supportShadowSamplers: this._webGLVersion !== 1,
      uniformBufferHardCheckMatrix: !1,
      allowTexturePrefiltering: this._webGLVersion !== 1,
      trackUbosInFrame: !1,
      checkUbosContentBeforeUpload: !1,
      supportCSM: this._webGLVersion !== 1,
      basisNeedsPOT: this._webGLVersion === 1,
      support3DTextures: this._webGLVersion !== 1,
      needTypeSuffixInShaderConstants: this._webGLVersion !== 1,
      supportMSAA: this._webGLVersion !== 1,
      supportSSAO2: this._webGLVersion !== 1,
      supportExtendedTextureFormats: this._webGLVersion !== 1,
      supportSwitchCaseInShader: this._webGLVersion !== 1,
      supportSyncTextureRead: !0,
      needsInvertingBitmap: !0,
      useUBOBindingCache: !0,
      needShaderCodeInlining: !1,
      needToAlwaysBindUniformBuffers: !1,
      supportRenderPasses: !1,
      supportSpriteInstancing: !0,
      forceVertexBufferStrideMultiple4Bytes: !1,
      _collectUbosUpdatedInFrame: !1
    };
  }
  /**
   * Gets version of the current webGL context
   * Keep it for back compat - use version instead
   */
  get webGLVersion() {
    return this._webGLVersion;
  }
  /**
   * Gets a string identifying the name of the class
   * @returns "Engine" string
   */
  getClassName() {
    return "ThinEngine";
  }
  /**
   * Returns true if the stencil buffer has been enabled through the creation option of the context.
   */
  get isStencilEnable() {
    return this._isStencilEnable;
  }
  /** @internal */
  _prepareWorkingCanvas() {
    if (this._workingCanvas)
      return;
    this._workingCanvas = this.createCanvas(1, 1);
    const e = this._workingCanvas.getContext("2d");
    e && (this._workingContext = e);
  }
  /**
   * Reset the texture cache to empty state
   */
  resetTextureCache() {
    for (const e in this._boundTexturesCache)
      Object.prototype.hasOwnProperty.call(this._boundTexturesCache, e) && (this._boundTexturesCache[e] = null);
    this._currentTextureChannel = -1;
  }
  /**
   * Gets an object containing information about the current engine context
   * @returns an object containing the vendor, the renderer and the version of the current engine context
   */
  getInfo() {
    return this.getGlInfo();
  }
  /**
   * Gets an object containing information about the current webGL context
   * @returns an object containing the vendor, the renderer and the version of the current webGL context
   */
  getGlInfo() {
    return {
      vendor: this._glVendor,
      renderer: this._glRenderer,
      version: this._glVersion
    };
  }
  /**
   * Defines the hardware scaling level.
   * By default the hardware scaling level is computed from the window device ratio.
   * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.
   * @param level defines the level to use
   */
  setHardwareScalingLevel(e) {
    this._hardwareScalingLevel = e, this.resize();
  }
  /**
   * Gets the current hardware scaling level.
   * By default the hardware scaling level is computed from the window device ratio.
   * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.
   * @returns a number indicating the current hardware scaling level
   */
  getHardwareScalingLevel() {
    return this._hardwareScalingLevel;
  }
  /**
   * Gets the list of loaded textures
   * @returns an array containing all loaded textures
   */
  getLoadedTexturesCache() {
    return this._internalTexturesCache;
  }
  /**
   * Gets the object containing all engine capabilities
   * @returns the EngineCapabilities object
   */
  getCaps() {
    return this._caps;
  }
  /**
   * stop executing a render loop function and remove it from the execution array
   * @param renderFunction defines the function to be removed. If not provided all functions will be removed.
   */
  stopRenderLoop(e) {
    if (!e) {
      this._activeRenderLoops.length = 0, this._cancelFrame();
      return;
    }
    const t = this._activeRenderLoops.indexOf(e);
    t >= 0 && (this._activeRenderLoops.splice(t, 1), this._activeRenderLoops.length == 0 && this._cancelFrame());
  }
  _cancelFrame() {
    if (this._renderingQueueLaunched && this._frameHandler) {
      if (this._renderingQueueLaunched = !1, u9()) {
        const { cancelAnimationFrame: e } = this.getHostWindow() || window;
        if (typeof e == "function")
          return e(this._frameHandler);
      } else if (typeof cancelAnimationFrame == "function")
        return cancelAnimationFrame(this._frameHandler);
      return clearTimeout(this._frameHandler);
    }
  }
  /** @internal */
  _renderLoop() {
    if (!this._contextWasLost) {
      let e = !0;
      if ((this._isDisposed || !this.renderEvenInBackground && this._windowIsBackground) && (e = !1), e) {
        this.beginFrame();
        for (let t = 0; t < this._activeRenderLoops.length; t++) {
          const r = this._activeRenderLoops[t];
          r();
        }
        this.endFrame();
      }
    }
    this._activeRenderLoops.length > 0 ? this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow()) : this._renderingQueueLaunched = !1;
  }
  /**
   * Gets the HTML canvas attached with the current webGL context
   * @returns a HTML canvas
   */
  getRenderingCanvas() {
    return this._renderingCanvas;
  }
  /**
   * Gets the audio context specified in engine initialization options
   * @returns an Audio Context
   */
  getAudioContext() {
    return this._audioContext;
  }
  /**
   * Gets the audio destination specified in engine initialization options
   * @returns an audio destination node
   */
  getAudioDestination() {
    return this._audioDestination;
  }
  /**
   * Gets host window
   * @returns the host window object
   */
  getHostWindow() {
    return u9() ? this._renderingCanvas && this._renderingCanvas.ownerDocument && this._renderingCanvas.ownerDocument.defaultView ? this._renderingCanvas.ownerDocument.defaultView : window : null;
  }
  /**
   * Gets the current render width
   * @param useScreen defines if screen size must be used (or the current render target if any)
   * @returns a number defining the current render width
   */
  getRenderWidth(e = !1) {
    return !e && this._currentRenderTarget ? this._currentRenderTarget.width : this._framebufferDimensionsObject ? this._framebufferDimensionsObject.framebufferWidth : this._gl.drawingBufferWidth;
  }
  /**
   * Gets the current render height
   * @param useScreen defines if screen size must be used (or the current render target if any)
   * @returns a number defining the current render height
   */
  getRenderHeight(e = !1) {
    return !e && this._currentRenderTarget ? this._currentRenderTarget.height : this._framebufferDimensionsObject ? this._framebufferDimensionsObject.framebufferHeight : this._gl.drawingBufferHeight;
  }
  /**
   * Can be used to override the current requestAnimationFrame requester.
   * @internal
   */
  _queueNewFrame(e, t) {
    return hr.QueueNewFrame(e, t);
  }
  /**
   * Register and execute a render loop. The engine can have more than one render function
   * @param renderFunction defines the function to continuously execute
   */
  runRenderLoop(e) {
    this._activeRenderLoops.indexOf(e) === -1 && (this._activeRenderLoops.push(e), this._renderingQueueLaunched || (this._renderingQueueLaunched = !0, this._boundRenderFunction = () => this._renderLoop(), this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow())));
  }
  /**
   * Clear the current render buffer or the current render target (if any is set up)
   * @param color defines the color to use
   * @param backBuffer defines if the back buffer must be cleared
   * @param depth defines if the depth buffer must be cleared
   * @param stencil defines if the stencil buffer must be cleared
   */
  clear(e, t, r, n = !1) {
    var i, s;
    const a = this.stencilStateComposer.useStencilGlobalOnly;
    this.stencilStateComposer.useStencilGlobalOnly = !0, this.applyStates(), this.stencilStateComposer.useStencilGlobalOnly = a;
    let f = 0;
    if (t && e) {
      let o = !0;
      if (this._currentRenderTarget) {
        const d = (i = this._currentRenderTarget.texture) === null || i === void 0 ? void 0 : i.format;
        if (d === 8 || d === 9 || d === 10 || d === 11) {
          const v = (s = this._currentRenderTarget.texture) === null || s === void 0 ? void 0 : s.type;
          v === 7 || v === 5 ? (hr._TempClearColorUint32[0] = e.r * 255, hr._TempClearColorUint32[1] = e.g * 255, hr._TempClearColorUint32[2] = e.b * 255, hr._TempClearColorUint32[3] = e.a * 255, this._gl.clearBufferuiv(this._gl.COLOR, 0, hr._TempClearColorUint32), o = !1) : (hr._TempClearColorInt32[0] = e.r * 255, hr._TempClearColorInt32[1] = e.g * 255, hr._TempClearColorInt32[2] = e.b * 255, hr._TempClearColorInt32[3] = e.a * 255, this._gl.clearBufferiv(this._gl.COLOR, 0, hr._TempClearColorInt32), o = !1);
        }
      }
      o && (this._gl.clearColor(e.r, e.g, e.b, e.a !== void 0 ? e.a : 1), f |= this._gl.COLOR_BUFFER_BIT);
    }
    r && (this.useReverseDepthBuffer ? (this._depthCullingState.depthFunc = this._gl.GEQUAL, this._gl.clearDepth(0)) : this._gl.clearDepth(1), f |= this._gl.DEPTH_BUFFER_BIT), n && (this._gl.clearStencil(0), f |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(f);
  }
  /**
   * @internal
   */
  _viewport(e, t, r, n) {
    (e !== this._viewportCached.x || t !== this._viewportCached.y || r !== this._viewportCached.z || n !== this._viewportCached.w) && (this._viewportCached.x = e, this._viewportCached.y = t, this._viewportCached.z = r, this._viewportCached.w = n, this._gl.viewport(e, t, r, n));
  }
  /**
   * Set the WebGL's viewport
   * @param viewport defines the viewport element to be used
   * @param requiredWidth defines the width required for rendering. If not provided the rendering canvas' width is used
   * @param requiredHeight defines the height required for rendering. If not provided the rendering canvas' height is used
   */
  setViewport(e, t, r) {
    const n = t || this.getRenderWidth(), i = r || this.getRenderHeight(), s = e.x || 0, a = e.y || 0;
    this._cachedViewport = e, this._viewport(s * n, a * i, n * e.width, i * e.height);
  }
  /**
   * Begin a new frame
   */
  beginFrame() {
  }
  /**
   * Enf the current frame
   */
  endFrame() {
    this._badOS && this.flushFramebuffer(), this._frameId++;
  }
  /**
   * Resize the view according to the canvas' size
   * @param forceSetSize true to force setting the sizes of the underlying canvas
   */
  resize(e = !1) {
    let t, r;
    if (this.adaptToDeviceRatio) {
      const n = u9() && window.devicePixelRatio || 1, i = this._lastDevicePixelRatio / n;
      this._lastDevicePixelRatio = n, this._hardwareScalingLevel *= i;
    }
    if (u9() && $w())
      if (this._renderingCanvas) {
        const n = this._renderingCanvas.getBoundingClientRect ? this._renderingCanvas.getBoundingClientRect() : {
          // fallback to last solution in case the function doesn't exist
          width: this._renderingCanvas.width * this._hardwareScalingLevel,
          height: this._renderingCanvas.height * this._hardwareScalingLevel
        };
        t = this._renderingCanvas.clientWidth || n.width || this._renderingCanvas.width || 100, r = this._renderingCanvas.clientHeight || n.height || this._renderingCanvas.height || 100;
      } else
        t = window.innerWidth, r = window.innerHeight;
    else
      t = this._renderingCanvas ? this._renderingCanvas.width : 100, r = this._renderingCanvas ? this._renderingCanvas.height : 100;
    this.setSize(t / this._hardwareScalingLevel, r / this._hardwareScalingLevel, e);
  }
  /**
   * Force a specific size of the canvas
   * @param width defines the new canvas' width
   * @param height defines the new canvas' height
   * @param forceSetSize true to force setting the sizes of the underlying canvas
   * @returns true if the size was changed
   */
  setSize(e, t, r = !1) {
    return !this._renderingCanvas || (e = e | 0, t = t | 0, !r && this._renderingCanvas.width === e && this._renderingCanvas.height === t) ? !1 : (this._renderingCanvas.width = e, this._renderingCanvas.height = t, !0);
  }
  /**
   * Binds the frame buffer to the specified texture.
   * @param rtWrapper The render target wrapper to render to
   * @param faceIndex The face of the texture to render to in case of cube texture and if the render target wrapper is not a multi render target
   * @param requiredWidth The width of the target to render to
   * @param requiredHeight The height of the target to render to
   * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true
   * @param lodLevel Defines the lod level to bind to the frame buffer
   * @param layer Defines the 2d array index to bind to the frame buffer if the render target wrapper is not a multi render target
   */
  bindFramebuffer(e, t = 0, r, n, i, s = 0, a = 0) {
    var f, o, d, v, u, l;
    const P = e;
    this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = e, this._bindUnboundFramebuffer(P._MSAAFramebuffer ? P._MSAAFramebuffer : P._framebuffer);
    const p = this._gl;
    e.isMulti || (e.is2DArray ? p.framebufferTextureLayer(p.FRAMEBUFFER, p.COLOR_ATTACHMENT0, (f = e.texture._hardwareTexture) === null || f === void 0 ? void 0 : f.underlyingResource, s, a) : e.isCube ? p.framebufferTexture2D(p.FRAMEBUFFER, p.COLOR_ATTACHMENT0, p.TEXTURE_CUBE_MAP_POSITIVE_X + t, (o = e.texture._hardwareTexture) === null || o === void 0 ? void 0 : o.underlyingResource, s) : P._currentLOD !== s && (p.framebufferTexture2D(p.FRAMEBUFFER, p.COLOR_ATTACHMENT0, p.TEXTURE_2D, (d = e.texture._hardwareTexture) === null || d === void 0 ? void 0 : d.underlyingResource, s), P._currentLOD = s));
    const c = e._depthStencilTexture;
    if (c) {
      const H = e._depthStencilTextureWithStencil ? p.DEPTH_STENCIL_ATTACHMENT : p.DEPTH_ATTACHMENT;
      e.is2DArray ? p.framebufferTextureLayer(p.FRAMEBUFFER, H, (v = c._hardwareTexture) === null || v === void 0 ? void 0 : v.underlyingResource, s, a) : e.isCube ? p.framebufferTexture2D(p.FRAMEBUFFER, H, p.TEXTURE_CUBE_MAP_POSITIVE_X + t, (u = c._hardwareTexture) === null || u === void 0 ? void 0 : u.underlyingResource, s) : p.framebufferTexture2D(p.FRAMEBUFFER, H, p.TEXTURE_2D, (l = c._hardwareTexture) === null || l === void 0 ? void 0 : l.underlyingResource, s);
    }
    this._cachedViewport && !i ? this.setViewport(this._cachedViewport, r, n) : (r || (r = e.width, s && (r = r / Math.pow(2, s))), n || (n = e.height, s && (n = n / Math.pow(2, s))), this._viewport(0, 0, r, n)), this.wipeCaches();
  }
  /**
   * Set various states to the webGL context
   * @param culling defines culling state: true to enable culling, false to disable it
   * @param zOffset defines the value to apply to zOffset (0 by default)
   * @param force defines if states must be applied even if cache is up to date
   * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)
   * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)
   * @param stencil stencil states to set
   * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)
   */
  setState(e, t = 0, r, n = !1, i, s, a = 0) {
    var f, o;
    (this._depthCullingState.cull !== e || r) && (this._depthCullingState.cull = e);
    const d = !((o = (f = this.cullBackFaces) !== null && f !== void 0 ? f : i) !== null && o !== void 0) || o ? this._gl.BACK : this._gl.FRONT;
    (this._depthCullingState.cullFace !== d || r) && (this._depthCullingState.cullFace = d), this.setZOffset(t), this.setZOffsetUnits(a);
    const v = n ? this._gl.CW : this._gl.CCW;
    (this._depthCullingState.frontFace !== v || r) && (this._depthCullingState.frontFace = v), this._stencilStateComposer.stencilMaterial = s;
  }
  /**
   * Gets a boolean indicating if depth testing is enabled
   * @returns the current state
   */
  getDepthBuffer() {
    return this._depthCullingState.depthTest;
  }
  /**
   * Enable or disable depth buffering
   * @param enable defines the state to set
   */
  setDepthBuffer(e) {
    this._depthCullingState.depthTest = e;
  }
  /**
   * Set the z offset Factor to apply to current rendering
   * @param value defines the offset to apply
   */
  setZOffset(e) {
    this._depthCullingState.zOffset = this.useReverseDepthBuffer ? -e : e;
  }
  /**
   * Gets the current value of the zOffset Factor
   * @returns the current zOffset Factor state
   */
  getZOffset() {
    const e = this._depthCullingState.zOffset;
    return this.useReverseDepthBuffer ? -e : e;
  }
  /**
   * Set the z offset Units to apply to current rendering
   * @param value defines the offset to apply
   */
  setZOffsetUnits(e) {
    this._depthCullingState.zOffsetUnits = this.useReverseDepthBuffer ? -e : e;
  }
  /**
   * Gets the current value of the zOffset Units
   * @returns the current zOffset Units state
   */
  getZOffsetUnits() {
    const e = this._depthCullingState.zOffsetUnits;
    return this.useReverseDepthBuffer ? -e : e;
  }
  /**
   * @internal
   */
  _bindUnboundFramebuffer(e) {
    this._currentFramebuffer !== e && (this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, e), this._currentFramebuffer = e);
  }
  /** @internal */
  _currentFrameBufferIsDefaultFrameBuffer() {
    return this._currentFramebuffer === null;
  }
  /**
   * Generates the mipmaps for a texture
   * @param texture texture to generate the mipmaps for
   */
  generateMipmaps(e) {
    this._bindTextureDirectly(this._gl.TEXTURE_2D, e, !0), this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
  }
  /**
   * Unbind the current render target texture from the webGL context
   * @param texture defines the render target wrapper to unbind
   * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
   * @param onBeforeUnbind defines a function which will be called before the effective unbind
   */
  unBindFramebuffer(e, t = !1, r) {
    var n;
    const i = e;
    this._currentRenderTarget = null;
    const s = this._gl;
    if (i._MSAAFramebuffer) {
      if (e.isMulti) {
        this.unBindMultiColorAttachmentFramebuffer(e, t, r);
        return;
      }
      s.bindFramebuffer(s.READ_FRAMEBUFFER, i._MSAAFramebuffer), s.bindFramebuffer(s.DRAW_FRAMEBUFFER, i._framebuffer), s.blitFramebuffer(0, 0, e.width, e.height, 0, 0, e.width, e.height, s.COLOR_BUFFER_BIT, s.NEAREST);
    }
    !((n = e.texture) === null || n === void 0) && n.generateMipMaps && !t && !e.isCube && this.generateMipmaps(e.texture), r && (i._MSAAFramebuffer && this._bindUnboundFramebuffer(i._framebuffer), r()), this._bindUnboundFramebuffer(null);
  }
  /**
   * Force a webGL flush (ie. a flush of all waiting webGL commands)
   */
  flushFramebuffer() {
    this._gl.flush();
  }
  /**
   * Unbind the current render target and bind the default framebuffer
   */
  restoreDefaultFramebuffer() {
    this._currentRenderTarget ? this.unBindFramebuffer(this._currentRenderTarget) : this._bindUnboundFramebuffer(null), this._cachedViewport && this.setViewport(this._cachedViewport), this.wipeCaches();
  }
  // VBOs
  /** @internal */
  _resetVertexBufferBinding() {
    this.bindArrayBuffer(null), this._cachedVertexBuffers = null;
  }
  /**
   * Creates a vertex buffer
   * @param data the data for the vertex buffer
   * @param _updatable whether the buffer should be created as updatable
   * @param _label defines the label of the buffer (for debug purpose)
   * @returns the new WebGL static buffer
   */
  createVertexBuffer(e, t, r) {
    return this._createVertexBuffer(e, this._gl.STATIC_DRAW);
  }
  _createVertexBuffer(e, t) {
    const r = this._gl.createBuffer();
    if (!r)
      throw new Error("Unable to create vertex buffer");
    const n = new jS(r);
    return this.bindArrayBuffer(n), e instanceof Array ? this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(e), t) : this._gl.bufferData(this._gl.ARRAY_BUFFER, e, t), this._resetVertexBufferBinding(), n.references = 1, n;
  }
  /**
   * Creates a dynamic vertex buffer
   * @param data the data for the dynamic vertex buffer
   * @param _label defines the label of the buffer (for debug purpose)
   * @returns the new WebGL dynamic buffer
   */
  createDynamicVertexBuffer(e, t) {
    return this._createVertexBuffer(e, this._gl.DYNAMIC_DRAW);
  }
  _resetIndexBufferBinding() {
    this.bindIndexBuffer(null), this._cachedIndexBuffer = null;
  }
  /**
   * Creates a new index buffer
   * @param indices defines the content of the index buffer
   * @param updatable defines if the index buffer must be updatable
   * @param _label defines the label of the buffer (for debug purpose)
   * @returns a new webGL buffer
   */
  createIndexBuffer(e, t, r) {
    const n = this._gl.createBuffer(), i = new jS(n);
    if (!n)
      throw new Error("Unable to create index buffer");
    this.bindIndexBuffer(i);
    const s = this._normalizeIndexData(e);
    return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, s, t ? this._gl.DYNAMIC_DRAW : this._gl.STATIC_DRAW), this._resetIndexBufferBinding(), i.references = 1, i.is32Bits = s.BYTES_PER_ELEMENT === 4, i;
  }
  _normalizeIndexData(e) {
    if (e.BYTES_PER_ELEMENT === 2)
      return e;
    if (this._caps.uintIndices) {
      if (e instanceof Uint32Array)
        return e;
      for (let r = 0; r < e.length; r++)
        if (e[r] >= 65535)
          return new Uint32Array(e);
      return new Uint16Array(e);
    }
    return new Uint16Array(e);
  }
  /**
   * Bind a webGL buffer to the webGL context
   * @param buffer defines the buffer to bind
   */
  bindArrayBuffer(e) {
    this._vaoRecordInProgress || this._unbindVertexArrayObject(), this._bindBuffer(e, this._gl.ARRAY_BUFFER);
  }
  /**
   * Bind a specific block at a given index in a specific shader program
   * @param pipelineContext defines the pipeline context to use
   * @param blockName defines the block name
   * @param index defines the index where to bind the block
   */
  bindUniformBlock(e, t, r) {
    const n = e.program, i = this._gl.getUniformBlockIndex(n, t);
    this._gl.uniformBlockBinding(n, i, r);
  }
  // eslint-disable-next-line @typescript-eslint/naming-convention
  bindIndexBuffer(e) {
    this._vaoRecordInProgress || this._unbindVertexArrayObject(), this._bindBuffer(e, this._gl.ELEMENT_ARRAY_BUFFER);
  }
  _bindBuffer(e, t) {
    (this._vaoRecordInProgress || this._currentBoundBuffer[t] !== e) && (this._gl.bindBuffer(t, e ? e.underlyingResource : null), this._currentBoundBuffer[t] = e);
  }
  /**
   * update the bound buffer with the given data
   * @param data defines the data to update
   */
  updateArrayBuffer(e) {
    this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, e);
  }
  _vertexAttribPointer(e, t, r, n, i, s, a) {
    const f = this._currentBufferPointers[t];
    if (!f)
      return;
    let o = !1;
    f.active ? (f.buffer !== e && (f.buffer = e, o = !0), f.size !== r && (f.size = r, o = !0), f.type !== n && (f.type = n, o = !0), f.normalized !== i && (f.normalized = i, o = !0), f.stride !== s && (f.stride = s, o = !0), f.offset !== a && (f.offset = a, o = !0)) : (o = !0, f.active = !0, f.index = t, f.size = r, f.type = n, f.normalized = i, f.stride = s, f.offset = a, f.buffer = e), (o || this._vaoRecordInProgress) && (this.bindArrayBuffer(e), n === this._gl.UNSIGNED_INT || n === this._gl.INT ? this._gl.vertexAttribIPointer(t, r, n, s, a) : this._gl.vertexAttribPointer(t, r, n, i, s, a));
  }
  /**
   * @internal
   */
  _bindIndexBufferWithCache(e) {
    e != null && this._cachedIndexBuffer !== e && (this._cachedIndexBuffer = e, this.bindIndexBuffer(e), this._uintIndicesCurrentlySet = e.is32Bits);
  }
  _bindVertexBuffersAttributes(e, t, r) {
    const n = t.getAttributesNames();
    this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.unbindAllAttributes();
    for (let i = 0; i < n.length; i++) {
      const s = t.getAttributeLocation(i);
      if (s >= 0) {
        const a = n[i];
        let f = null;
        if (r && (f = r[a]), f || (f = e[a]), !f)
          continue;
        this._gl.enableVertexAttribArray(s), this._vaoRecordInProgress || (this._vertexAttribArraysEnabled[s] = !0);
        const o = f.getBuffer();
        o && (this._vertexAttribPointer(o, s, f.getSize(), f.type, f.normalized, f.byteStride, f.byteOffset), f.getIsInstanced() && (this._gl.vertexAttribDivisor(s, f.getInstanceDivisor()), this._vaoRecordInProgress || (this._currentInstanceLocations.push(s), this._currentInstanceBuffers.push(o))));
      }
    }
  }
  /**
   * Records a vertex array object
   * @see https://doc.babylonjs.com/setup/support/webGL2#vertex-array-objects
   * @param vertexBuffers defines the list of vertex buffers to store
   * @param indexBuffer defines the index buffer to store
   * @param effect defines the effect to store
   * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
   * @returns the new vertex array object
   */
  recordVertexArrayObject(e, t, r, n) {
    const i = this._gl.createVertexArray();
    if (!i)
      throw new Error("Unable to create VAO");
    return this._vaoRecordInProgress = !0, this._gl.bindVertexArray(i), this._mustWipeVertexAttributes = !0, this._bindVertexBuffersAttributes(e, r, n), this.bindIndexBuffer(t), this._vaoRecordInProgress = !1, this._gl.bindVertexArray(null), i;
  }
  /**
   * Bind a specific vertex array object
   * @see https://doc.babylonjs.com/setup/support/webGL2#vertex-array-objects
   * @param vertexArrayObject defines the vertex array object to bind
   * @param indexBuffer defines the index buffer to bind
   */
  bindVertexArrayObject(e, t) {
    this._cachedVertexArrayObject !== e && (this._cachedVertexArrayObject = e, this._gl.bindVertexArray(e), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._uintIndicesCurrentlySet = t != null && t.is32Bits, this._mustWipeVertexAttributes = !0);
  }
  /**
   * Bind webGl buffers directly to the webGL context
   * @param vertexBuffer defines the vertex buffer to bind
   * @param indexBuffer defines the index buffer to bind
   * @param vertexDeclaration defines the vertex declaration to use with the vertex buffer
   * @param vertexStrideSize defines the vertex stride of the vertex buffer
   * @param effect defines the effect associated with the vertex buffer
   */
  bindBuffersDirectly(e, t, r, n, i) {
    if (this._cachedVertexBuffers !== e || this._cachedEffectForVertexBuffers !== i) {
      this._cachedVertexBuffers = e, this._cachedEffectForVertexBuffers = i;
      const s = i.getAttributesCount();
      this._unbindVertexArrayObject(), this.unbindAllAttributes();
      let a = 0;
      for (let f = 0; f < s; f++)
        if (f < r.length) {
          const o = i.getAttributeLocation(f);
          o >= 0 && (this._gl.enableVertexAttribArray(o), this._vertexAttribArraysEnabled[o] = !0, this._vertexAttribPointer(e, o, r[f], this._gl.FLOAT, !1, n, a)), a += r[f] * 4;
        }
    }
    this._bindIndexBufferWithCache(t);
  }
  _unbindVertexArrayObject() {
    this._cachedVertexArrayObject && (this._cachedVertexArrayObject = null, this._gl.bindVertexArray(null));
  }
  /**
   * Bind a list of vertex buffers to the webGL context
   * @param vertexBuffers defines the list of vertex buffers to bind
   * @param indexBuffer defines the index buffer to bind
   * @param effect defines the effect associated with the vertex buffers
   * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
   */
  bindBuffers(e, t, r, n) {
    (this._cachedVertexBuffers !== e || this._cachedEffectForVertexBuffers !== r) && (this._cachedVertexBuffers = e, this._cachedEffectForVertexBuffers = r, this._bindVertexBuffersAttributes(e, r, n)), this._bindIndexBufferWithCache(t);
  }
  /**
   * Unbind all instance attributes
   */
  unbindInstanceAttributes() {
    let e;
    for (let t = 0, r = this._currentInstanceLocations.length; t < r; t++) {
      const n = this._currentInstanceBuffers[t];
      e != n && n.references && (e = n, this.bindArrayBuffer(n));
      const i = this._currentInstanceLocations[t];
      this._gl.vertexAttribDivisor(i, 0);
    }
    this._currentInstanceBuffers.length = 0, this._currentInstanceLocations.length = 0;
  }
  /**
   * Release and free the memory of a vertex array object
   * @param vao defines the vertex array object to delete
   */
  releaseVertexArrayObject(e) {
    this._gl.deleteVertexArray(e);
  }
  /**
   * @internal
   */
  _releaseBuffer(e) {
    return e.references--, e.references === 0 ? (this._deleteBuffer(e), !0) : !1;
  }
  _deleteBuffer(e) {
    this._gl.deleteBuffer(e.underlyingResource);
  }
  /**
   * Update the content of a webGL buffer used with instantiation and bind it to the webGL context
   * @param instancesBuffer defines the webGL buffer to update and bind
   * @param data defines the data to store in the buffer
   * @param offsetLocations defines the offsets or attributes information used to determine where data must be stored in the buffer
   */
  updateAndBindInstancesBuffer(e, t, r) {
    if (this.bindArrayBuffer(e), t && this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, t), r[0].index !== void 0)
      this.bindInstancesBuffer(e, r, !0);
    else
      for (let n = 0; n < 4; n++) {
        const i = r[n];
        this._vertexAttribArraysEnabled[i] || (this._gl.enableVertexAttribArray(i), this._vertexAttribArraysEnabled[i] = !0), this._vertexAttribPointer(e, i, 4, this._gl.FLOAT, !1, 64, n * 16), this._gl.vertexAttribDivisor(i, 1), this._currentInstanceLocations.push(i), this._currentInstanceBuffers.push(e);
      }
  }
  /**
   * Bind the content of a webGL buffer used with instantiation
   * @param instancesBuffer defines the webGL buffer to bind
   * @param attributesInfo defines the offsets or attributes information used to determine where data must be stored in the buffer
   * @param computeStride defines Whether to compute the strides from the info or use the default 0
   */
  bindInstancesBuffer(e, t, r = !0) {
    this.bindArrayBuffer(e);
    let n = 0;
    if (r)
      for (let i = 0; i < t.length; i++) {
        const s = t[i];
        n += s.attributeSize * 4;
      }
    for (let i = 0; i < t.length; i++) {
      const s = t[i];
      s.index === void 0 && (s.index = this._currentEffect.getAttributeLocationByName(s.attributeName)), !(s.index < 0) && (this._vertexAttribArraysEnabled[s.index] || (this._gl.enableVertexAttribArray(s.index), this._vertexAttribArraysEnabled[s.index] = !0), this._vertexAttribPointer(e, s.index, s.attributeSize, s.attributeType || this._gl.FLOAT, s.normalized || !1, n, s.offset), this._gl.vertexAttribDivisor(s.index, s.divisor === void 0 ? 1 : s.divisor), this._currentInstanceLocations.push(s.index), this._currentInstanceBuffers.push(e));
    }
  }
  /**
   * Disable the instance attribute corresponding to the name in parameter
   * @param name defines the name of the attribute to disable
   */
  disableInstanceAttributeByName(e) {
    if (!this._currentEffect)
      return;
    const t = this._currentEffect.getAttributeLocationByName(e);
    this.disableInstanceAttribute(t);
  }
  /**
   * Disable the instance attribute corresponding to the location in parameter
   * @param attributeLocation defines the attribute location of the attribute to disable
   */
  disableInstanceAttribute(e) {
    let t = !1, r;
    for (; (r = this._currentInstanceLocations.indexOf(e)) !== -1; )
      this._currentInstanceLocations.splice(r, 1), this._currentInstanceBuffers.splice(r, 1), t = !0, r = this._currentInstanceLocations.indexOf(e);
    t && (this._gl.vertexAttribDivisor(e, 0), this.disableAttributeByIndex(e));
  }
  /**
   * Disable the attribute corresponding to the location in parameter
   * @param attributeLocation defines the attribute location of the attribute to disable
   */
  disableAttributeByIndex(e) {
    this._gl.disableVertexAttribArray(e), this._vertexAttribArraysEnabled[e] = !1, this._currentBufferPointers[e].active = !1;
  }
  /**
   * Send a draw order
   * @param useTriangles defines if triangles must be used to draw (else wireframe will be used)
   * @param indexStart defines the starting index
   * @param indexCount defines the number of index to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  draw(e, t, r, n) {
    this.drawElementsType(e ? 0 : 1, t, r, n);
  }
  /**
   * Draw a list of points
   * @param verticesStart defines the index of first vertex to draw
   * @param verticesCount defines the count of vertices to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  drawPointClouds(e, t, r) {
    this.drawArraysType(2, e, t, r);
  }
  /**
   * Draw a list of unindexed primitives
   * @param useTriangles defines if triangles must be used to draw (else wireframe will be used)
   * @param verticesStart defines the index of first vertex to draw
   * @param verticesCount defines the count of vertices to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  drawUnIndexed(e, t, r, n) {
    this.drawArraysType(e ? 0 : 1, t, r, n);
  }
  /**
   * Draw a list of indexed primitives
   * @param fillMode defines the primitive to use
   * @param indexStart defines the starting index
   * @param indexCount defines the number of index to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  drawElementsType(e, t, r, n) {
    this.applyStates(), this._reportDrawCall();
    const i = this._drawMode(e), s = this._uintIndicesCurrentlySet ? this._gl.UNSIGNED_INT : this._gl.UNSIGNED_SHORT, a = this._uintIndicesCurrentlySet ? 4 : 2;
    n ? this._gl.drawElementsInstanced(i, r, s, t * a, n) : this._gl.drawElements(i, r, s, t * a);
  }
  /**
   * Draw a list of unindexed primitives
   * @param fillMode defines the primitive to use
   * @param verticesStart defines the index of first vertex to draw
   * @param verticesCount defines the count of vertices to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  drawArraysType(e, t, r, n) {
    this.applyStates(), this._reportDrawCall();
    const i = this._drawMode(e);
    n ? this._gl.drawArraysInstanced(i, t, r, n) : this._gl.drawArrays(i, t, r);
  }
  _drawMode(e) {
    switch (e) {
      case 0:
        return this._gl.TRIANGLES;
      case 2:
        return this._gl.POINTS;
      case 1:
        return this._gl.LINES;
      case 3:
        return this._gl.POINTS;
      case 4:
        return this._gl.LINES;
      case 5:
        return this._gl.LINE_LOOP;
      case 6:
        return this._gl.LINE_STRIP;
      case 7:
        return this._gl.TRIANGLE_STRIP;
      case 8:
        return this._gl.TRIANGLE_FAN;
      default:
        return this._gl.TRIANGLES;
    }
  }
  /** @internal */
  _reportDrawCall() {
  }
  // Shaders
  /**
   * @internal
   */
  _releaseEffect(e) {
    this._compiledEffects[e._key] && delete this._compiledEffects[e._key];
    const t = e.getPipelineContext();
    t && this._deletePipelineContext(t);
  }
  /**
   * @internal
   */
  _deletePipelineContext(e) {
    const t = e;
    t && t.program && (t.program.__SPECTOR_rebuildProgram = null, this._gl.deleteProgram(t.program));
  }
  /** @internal */
  _getGlobalDefines(e) {
    if (e) {
      this.isNDCHalfZRange ? e.IS_NDC_HALF_ZRANGE = "" : delete e.IS_NDC_HALF_ZRANGE, this.useReverseDepthBuffer ? e.USE_REVERSE_DEPTHBUFFER = "" : delete e.USE_REVERSE_DEPTHBUFFER, this.useExactSrgbConversions ? e.USE_EXACT_SRGB_CONVERSIONS = "" : delete e.USE_EXACT_SRGB_CONVERSIONS;
      return;
    } else {
      let t = "";
      return this.isNDCHalfZRange && (t += "#define IS_NDC_HALF_ZRANGE"), this.useReverseDepthBuffer && (t && (t += `
`), t += "#define USE_REVERSE_DEPTHBUFFER"), this.useExactSrgbConversions && (t && (t += `
`), t += "#define USE_EXACT_SRGB_CONVERSIONS"), t;
    }
  }
  /**
   * Create a new effect (used to store vertex/fragment shaders)
   * @param baseName defines the base name of the effect (The name of file without .fragment.fx or .vertex.fx)
   * @param attributesNamesOrOptions defines either a list of attribute names or an IEffectCreationOptions object
   * @param uniformsNamesOrEngine defines either a list of uniform names or the engine to use
   * @param samplers defines an array of string used to represent textures
   * @param defines defines the string containing the defines to use to compile the shaders
   * @param fallbacks defines the list of potential fallbacks to use if shader compilation fails
   * @param onCompiled defines a function to call when the effect creation is successful
   * @param onError defines a function to call when the effect creation has failed
   * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
   * @param shaderLanguage the language the shader is written in (default: GLSL)
   * @returns the new Effect
   */
  createEffect(e, t, r, n, i, s, a, f, o, d = za.GLSL) {
    var v;
    const u = e.vertexElement || e.vertex || e.vertexToken || e.vertexSource || e, l = e.fragmentElement || e.fragment || e.fragmentToken || e.fragmentSource || e, P = this._getGlobalDefines();
    let p = (v = i ?? t.defines) !== null && v !== void 0 ? v : "";
    P && (p += P);
    const c = u + "+" + l + "@" + p;
    if (this._compiledEffects[c]) {
      const T = this._compiledEffects[c];
      return a && T.isReady() && a(T), T;
    }
    const H = new An(e, t, r, n, this, i, s, a, f, o, c, d);
    return this._compiledEffects[c] = H, H;
  }
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static _ConcatenateShader(e, t, r = "") {
    return r + (t ? t + `
` : "") + e;
  }
  _compileShader(e, t, r, n) {
    return this._compileRawShader(hr._ConcatenateShader(e, r, n), t);
  }
  _compileRawShader(e, t) {
    const r = this._gl, n = r.createShader(t === "vertex" ? r.VERTEX_SHADER : r.FRAGMENT_SHADER);
    if (!n) {
      let i = r.NO_ERROR, s = r.NO_ERROR;
      for (; (s = r.getError()) !== r.NO_ERROR; )
        i = s;
      throw new Error(`Something went wrong while creating a gl ${t} shader object. gl error=${i}, gl isContextLost=${r.isContextLost()}, _contextWasLost=${this._contextWasLost}`);
    }
    return r.shaderSource(n, e), r.compileShader(n), n;
  }
  /**
   * @internal
   */
  _getShaderSource(e) {
    return this._gl.getShaderSource(e);
  }
  /**
   * Directly creates a webGL program
   * @param pipelineContext  defines the pipeline context to attach to
   * @param vertexCode defines the vertex shader code to use
   * @param fragmentCode defines the fragment shader code to use
   * @param context defines the webGL context to use (if not set, the current one will be used)
   * @param transformFeedbackVaryings defines the list of transform feedback varyings to use
   * @returns the new webGL program
   */
  createRawShaderProgram(e, t, r, n, i = null) {
    n = n || this._gl;
    const s = this._compileRawShader(t, "vertex"), a = this._compileRawShader(r, "fragment");
    return this._createShaderProgram(e, s, a, n, i);
  }
  /**
   * Creates a webGL program
   * @param pipelineContext  defines the pipeline context to attach to
   * @param vertexCode  defines the vertex shader code to use
   * @param fragmentCode defines the fragment shader code to use
   * @param defines defines the string containing the defines to use to compile the shaders
   * @param context defines the webGL context to use (if not set, the current one will be used)
   * @param transformFeedbackVaryings defines the list of transform feedback varyings to use
   * @returns the new webGL program
   */
  createShaderProgram(e, t, r, n, i, s = null) {
    i = i || this._gl;
    const a = this._webGLVersion > 1 ? `#version 300 es
#define WEBGL2 
` : "", f = this._compileShader(t, "vertex", n, a), o = this._compileShader(r, "fragment", n, a);
    return this._createShaderProgram(e, f, o, i, s);
  }
  /**
   * Inline functions in shader code that are marked to be inlined
   * @param code code to inline
   * @returns inlined code
   */
  inlineShaderCode(e) {
    return e;
  }
  /**
   * Creates a new pipeline context
   * @param shaderProcessingContext defines the shader processing context used during the processing if available
   * @returns the new pipeline
   */
  createPipelineContext(e) {
    const t = new E$();
    return t.engine = this, this._caps.parallelShaderCompile && (t.isParallelCompiled = !0), t;
  }
  /**
   * Creates a new material context
   * @returns the new context
   */
  createMaterialContext() {
  }
  /**
   * Creates a new draw context
   * @returns the new context
   */
  createDrawContext() {
  }
  _createShaderProgram(e, t, r, n, i = null) {
    const s = n.createProgram();
    if (e.program = s, !s)
      throw new Error("Unable to create program");
    return n.attachShader(s, t), n.attachShader(s, r), n.linkProgram(s), e.context = n, e.vertexShader = t, e.fragmentShader = r, e.isParallelCompiled || this._finalizePipelineContext(e), s;
  }
  _finalizePipelineContext(e) {
    const t = e.context, r = e.vertexShader, n = e.fragmentShader, i = e.program;
    if (!t.getProgramParameter(i, t.LINK_STATUS)) {
      if (!this._gl.getShaderParameter(r, this._gl.COMPILE_STATUS)) {
        const f = this._gl.getShaderInfoLog(r);
        if (f)
          throw e.vertexCompilationError = f, new Error("VERTEX SHADER " + f);
      }
      if (!this._gl.getShaderParameter(n, this._gl.COMPILE_STATUS)) {
        const f = this._gl.getShaderInfoLog(n);
        if (f)
          throw e.fragmentCompilationError = f, new Error("FRAGMENT SHADER " + f);
      }
      const a = t.getProgramInfoLog(i);
      if (a)
        throw e.programLinkError = a, new Error(a);
    }
    if (this.validateShaderPrograms && (t.validateProgram(i), !t.getProgramParameter(i, t.VALIDATE_STATUS))) {
      const f = t.getProgramInfoLog(i);
      if (f)
        throw e.programValidationError = f, new Error(f);
    }
    t.deleteShader(r), t.deleteShader(n), e.vertexShader = void 0, e.fragmentShader = void 0, e.onCompiled && (e.onCompiled(), e.onCompiled = void 0);
  }
  /**
   * @internal
   */
  _preparePipelineContext(e, t, r, n, i, s, a, f, o, d) {
    const v = e;
    n ? v.program = this.createRawShaderProgram(v, t, r, void 0, o) : v.program = this.createShaderProgram(v, t, r, f, void 0, o), v.program.__SPECTOR_rebuildProgram = a;
  }
  /**
   * @internal
   */
  _isRenderingStateCompiled(e) {
    const t = e;
    return this._isDisposed || t._isDisposed ? !1 : this._gl.getProgramParameter(t.program, this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR) ? (this._finalizePipelineContext(t), !0) : !1;
  }
  /**
   * @internal
   */
  _executeWhenRenderingStateIsCompiled(e, t) {
    const r = e;
    if (!r.isParallelCompiled) {
      t();
      return;
    }
    const n = r.onCompiled;
    n ? r.onCompiled = () => {
      n(), t();
    } : r.onCompiled = t;
  }
  /**
   * Gets the list of webGL uniform locations associated with a specific program based on a list of uniform names
   * @param pipelineContext defines the pipeline context to use
   * @param uniformsNames defines the list of uniform names
   * @returns an array of webGL uniform locations
   */
  getUniforms(e, t) {
    const r = new Array(), n = e;
    for (let i = 0; i < t.length; i++)
      r.push(this._gl.getUniformLocation(n.program, t[i]));
    return r;
  }
  /**
   * Gets the list of active attributes for a given webGL program
   * @param pipelineContext defines the pipeline context to use
   * @param attributesNames defines the list of attribute names to get
   * @returns an array of indices indicating the offset of each attribute
   */
  getAttributes(e, t) {
    const r = [], n = e;
    for (let i = 0; i < t.length; i++)
      try {
        r.push(this._gl.getAttribLocation(n.program, t[i]));
      } catch {
        r.push(-1);
      }
    return r;
  }
  /**
   * Activates an effect, making it the current one (ie. the one used for rendering)
   * @param effect defines the effect to activate
   */
  enableEffect(e) {
    e = e !== null && zo.IsWrapper(e) ? e.effect : e, !(!e || e === this._currentEffect) && (this._stencilStateComposer.stencilMaterial = void 0, e = e, this.bindSamplers(e), this._currentEffect = e, e.onBind && e.onBind(e), e._onBindObservable && e._onBindObservable.notifyObservers(e));
  }
  /**
   * Set the value of an uniform to a number (int)
   * @param uniform defines the webGL uniform location where to store the value
   * @param value defines the int number to store
   * @returns true if the value was set
   */
  setInt(e, t) {
    return e ? (this._gl.uniform1i(e, t), !0) : !1;
  }
  /**
   * Set the value of an uniform to a int2
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @returns true if the value was set
   */
  setInt2(e, t, r) {
    return e ? (this._gl.uniform2i(e, t, r), !0) : !1;
  }
  /**
   * Set the value of an uniform to a int3
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @param z defines the 3rd component of the value
   * @returns true if the value was set
   */
  setInt3(e, t, r, n) {
    return e ? (this._gl.uniform3i(e, t, r, n), !0) : !1;
  }
  /**
   * Set the value of an uniform to a int4
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @param z defines the 3rd component of the value
   * @param w defines the 4th component of the value
   * @returns true if the value was set
   */
  setInt4(e, t, r, n, i) {
    return e ? (this._gl.uniform4i(e, t, r, n, i), !0) : !1;
  }
  /**
   * Set the value of an uniform to an array of int32
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of int32 to store
   * @returns true if the value was set
   */
  setIntArray(e, t) {
    return e ? (this._gl.uniform1iv(e, t), !0) : !1;
  }
  /**
   * Set the value of an uniform to an array of int32 (stored as vec2)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of int32 to store
   * @returns true if the value was set
   */
  setIntArray2(e, t) {
    return !e || t.length % 2 !== 0 ? !1 : (this._gl.uniform2iv(e, t), !0);
  }
  /**
   * Set the value of an uniform to an array of int32 (stored as vec3)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of int32 to store
   * @returns true if the value was set
   */
  setIntArray3(e, t) {
    return !e || t.length % 3 !== 0 ? !1 : (this._gl.uniform3iv(e, t), !0);
  }
  /**
   * Set the value of an uniform to an array of int32 (stored as vec4)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of int32 to store
   * @returns true if the value was set
   */
  setIntArray4(e, t) {
    return !e || t.length % 4 !== 0 ? !1 : (this._gl.uniform4iv(e, t), !0);
  }
  /**
   * Set the value of an uniform to a number (unsigned int)
   * @param uniform defines the webGL uniform location where to store the value
   * @param value defines the unsigned int number to store
   * @returns true if the value was set
   */
  setUInt(e, t) {
    return e ? (this._gl.uniform1ui(e, t), !0) : !1;
  }
  /**
   * Set the value of an uniform to a unsigned int2
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @returns true if the value was set
   */
  setUInt2(e, t, r) {
    return e ? (this._gl.uniform2ui(e, t, r), !0) : !1;
  }
  /**
   * Set the value of an uniform to a unsigned int3
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @param z defines the 3rd component of the value
   * @returns true if the value was set
   */
  setUInt3(e, t, r, n) {
    return e ? (this._gl.uniform3ui(e, t, r, n), !0) : !1;
  }
  /**
   * Set the value of an uniform to a unsigned int4
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @param z defines the 3rd component of the value
   * @param w defines the 4th component of the value
   * @returns true if the value was set
   */
  setUInt4(e, t, r, n, i) {
    return e ? (this._gl.uniform4ui(e, t, r, n, i), !0) : !1;
  }
  /**
   * Set the value of an uniform to an array of unsigned int32
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of unsigned int32 to store
   * @returns true if the value was set
   */
  setUIntArray(e, t) {
    return e ? (this._gl.uniform1uiv(e, t), !0) : !1;
  }
  /**
   * Set the value of an uniform to an array of unsigned int32 (stored as vec2)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of unsigned int32 to store
   * @returns true if the value was set
   */
  setUIntArray2(e, t) {
    return !e || t.length % 2 !== 0 ? !1 : (this._gl.uniform2uiv(e, t), !0);
  }
  /**
   * Set the value of an uniform to an array of unsigned int32 (stored as vec3)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of unsigned int32 to store
   * @returns true if the value was set
   */
  setUIntArray3(e, t) {
    return !e || t.length % 3 !== 0 ? !1 : (this._gl.uniform3uiv(e, t), !0);
  }
  /**
   * Set the value of an uniform to an array of unsigned int32 (stored as vec4)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of unsigned int32 to store
   * @returns true if the value was set
   */
  setUIntArray4(e, t) {
    return !e || t.length % 4 !== 0 ? !1 : (this._gl.uniform4uiv(e, t), !0);
  }
  /**
   * Set the value of an uniform to an array of number
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of number to store
   * @returns true if the value was set
   */
  setArray(e, t) {
    return !e || t.length < 1 ? !1 : (this._gl.uniform1fv(e, t), !0);
  }
  /**
   * Set the value of an uniform to an array of number (stored as vec2)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of number to store
   * @returns true if the value was set
   */
  setArray2(e, t) {
    return !e || t.length % 2 !== 0 ? !1 : (this._gl.uniform2fv(e, t), !0);
  }
  /**
   * Set the value of an uniform to an array of number (stored as vec3)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of number to store
   * @returns true if the value was set
   */
  setArray3(e, t) {
    return !e || t.length % 3 !== 0 ? !1 : (this._gl.uniform3fv(e, t), !0);
  }
  /**
   * Set the value of an uniform to an array of number (stored as vec4)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of number to store
   * @returns true if the value was set
   */
  setArray4(e, t) {
    return !e || t.length % 4 !== 0 ? !1 : (this._gl.uniform4fv(e, t), !0);
  }
  /**
   * Set the value of an uniform to an array of float32 (stored as matrices)
   * @param uniform defines the webGL uniform location where to store the value
   * @param matrices defines the array of float32 to store
   * @returns true if the value was set
   */
  setMatrices(e, t) {
    return e ? (this._gl.uniformMatrix4fv(e, !1, t), !0) : !1;
  }
  /**
   * Set the value of an uniform to a matrix (3x3)
   * @param uniform defines the webGL uniform location where to store the value
   * @param matrix defines the Float32Array representing the 3x3 matrix to store
   * @returns true if the value was set
   */
  setMatrix3x3(e, t) {
    return e ? (this._gl.uniformMatrix3fv(e, !1, t), !0) : !1;
  }
  /**
   * Set the value of an uniform to a matrix (2x2)
   * @param uniform defines the webGL uniform location where to store the value
   * @param matrix defines the Float32Array representing the 2x2 matrix to store
   * @returns true if the value was set
   */
  setMatrix2x2(e, t) {
    return e ? (this._gl.uniformMatrix2fv(e, !1, t), !0) : !1;
  }
  /**
   * Set the value of an uniform to a number (float)
   * @param uniform defines the webGL uniform location where to store the value
   * @param value defines the float number to store
   * @returns true if the value was transferred
   */
  setFloat(e, t) {
    return e ? (this._gl.uniform1f(e, t), !0) : !1;
  }
  /**
   * Set the value of an uniform to a vec2
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @returns true if the value was set
   */
  setFloat2(e, t, r) {
    return e ? (this._gl.uniform2f(e, t, r), !0) : !1;
  }
  /**
   * Set the value of an uniform to a vec3
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @param z defines the 3rd component of the value
   * @returns true if the value was set
   */
  setFloat3(e, t, r, n) {
    return e ? (this._gl.uniform3f(e, t, r, n), !0) : !1;
  }
  /**
   * Set the value of an uniform to a vec4
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @param z defines the 3rd component of the value
   * @param w defines the 4th component of the value
   * @returns true if the value was set
   */
  setFloat4(e, t, r, n, i) {
    return e ? (this._gl.uniform4f(e, t, r, n, i), !0) : !1;
  }
  // States
  /**
   * Apply all cached states (depth, culling, stencil and alpha)
   */
  applyStates() {
    if (this._depthCullingState.apply(this._gl), this._stencilStateComposer.apply(this._gl), this._alphaState.apply(this._gl), this._colorWriteChanged) {
      this._colorWriteChanged = !1;
      const e = this._colorWrite;
      this._gl.colorMask(e, e, e, e);
    }
  }
  /**
   * Enable or disable color writing
   * @param enable defines the state to set
   */
  setColorWrite(e) {
    e !== this._colorWrite && (this._colorWriteChanged = !0, this._colorWrite = e);
  }
  /**
   * Gets a boolean indicating if color writing is enabled
   * @returns the current color writing state
   */
  getColorWrite() {
    return this._colorWrite;
  }
  /**
   * Gets the depth culling state manager
   */
  get depthCullingState() {
    return this._depthCullingState;
  }
  /**
   * Gets the alpha state manager
   */
  get alphaState() {
    return this._alphaState;
  }
  /**
   * Gets the stencil state manager
   */
  get stencilState() {
    return this._stencilState;
  }
  /**
   * Gets the stencil state composer
   */
  get stencilStateComposer() {
    return this._stencilStateComposer;
  }
  // Textures
  /**
   * Clears the list of texture accessible through engine.
   * This can help preventing texture load conflict due to name collision.
   */
  clearInternalTexturesCache() {
    this._internalTexturesCache.length = 0;
  }
  /**
   * Force the entire cache to be cleared
   * You should not have to use this function unless your engine needs to share the webGL context with another engine
   * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)
   */
  wipeCaches(e) {
    this.preventCacheWipeBetweenFrames && !e || (this._currentEffect = null, this._viewportCached.x = 0, this._viewportCached.y = 0, this._viewportCached.z = 0, this._viewportCached.w = 0, this._unbindVertexArrayObject(), e && (this._currentProgram = null, this.resetTextureCache(), this._stencilStateComposer.reset(), this._depthCullingState.reset(), this._depthCullingState.depthFunc = this._gl.LEQUAL, this._alphaState.reset(), this._alphaMode = 1, this._alphaEquation = 0, this._colorWrite = !0, this._colorWriteChanged = !0, this._unpackFlipYCached = null, this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE), this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0), this._mustWipeVertexAttributes = !0, this.unbindAllAttributes()), this._resetVertexBufferBinding(), this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null, this.bindIndexBuffer(null));
  }
  /**
   * @internal
   */
  _getSamplingParameters(e, t) {
    const r = this._gl;
    let n = r.NEAREST, i = r.NEAREST;
    switch (e) {
      case 11:
        n = r.LINEAR, t ? i = r.LINEAR_MIPMAP_NEAREST : i = r.LINEAR;
        break;
      case 3:
        n = r.LINEAR, t ? i = r.LINEAR_MIPMAP_LINEAR : i = r.LINEAR;
        break;
      case 8:
        n = r.NEAREST, t ? i = r.NEAREST_MIPMAP_LINEAR : i = r.NEAREST;
        break;
      case 4:
        n = r.NEAREST, t ? i = r.NEAREST_MIPMAP_NEAREST : i = r.NEAREST;
        break;
      case 5:
        n = r.NEAREST, t ? i = r.LINEAR_MIPMAP_NEAREST : i = r.LINEAR;
        break;
      case 6:
        n = r.NEAREST, t ? i = r.LINEAR_MIPMAP_LINEAR : i = r.LINEAR;
        break;
      case 7:
        n = r.NEAREST, i = r.LINEAR;
        break;
      case 1:
        n = r.NEAREST, i = r.NEAREST;
        break;
      case 9:
        n = r.LINEAR, t ? i = r.NEAREST_MIPMAP_NEAREST : i = r.NEAREST;
        break;
      case 10:
        n = r.LINEAR, t ? i = r.NEAREST_MIPMAP_LINEAR : i = r.NEAREST;
        break;
      case 2:
        n = r.LINEAR, i = r.LINEAR;
        break;
      case 12:
        n = r.LINEAR, i = r.NEAREST;
        break;
    }
    return {
      min: i,
      mag: n
    };
  }
  /** @internal */
  _createTexture() {
    const e = this._gl.createTexture();
    if (!e)
      throw new Error("Unable to create texture");
    return e;
  }
  /** @internal */
  _createHardwareTexture() {
    return new jm(this._createTexture(), this._gl);
  }
  /**
   * Creates an internal texture without binding it to a framebuffer
   * @internal
   * @param size defines the size of the texture
   * @param options defines the options used to create the texture
   * @param delayGPUTextureCreation true to delay the texture creation the first time it is really needed. false to create it right away
   * @param source source type of the texture
   * @returns a new internal texture
   */
  _createInternalTexture(e, t, r = !0, n = ri.Unknown) {
    var i;
    let s = !1, a = 0, f = 3, o = 5, d = !1, v = 1, u;
    t !== void 0 && typeof t == "object" ? (s = !!t.generateMipMaps, a = t.type === void 0 ? 0 : t.type, f = t.samplingMode === void 0 ? 3 : t.samplingMode, o = t.format === void 0 ? 5 : t.format, d = t.useSRGBBuffer === void 0 ? !1 : t.useSRGBBuffer, v = (i = t.samples) !== null && i !== void 0 ? i : 1, u = t.label) : s = !!t, d && (d = this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU)), (a === 1 && !this._caps.textureFloatLinearFiltering || a === 2 && !this._caps.textureHalfFloatLinearFiltering) && (f = 1), a === 1 && !this._caps.textureFloat && (a = 0, Se.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));
    const l = this._gl, P = new As(this, n), p = e.width || e, c = e.height || e, H = e.layers || 0, T = this._getSamplingParameters(f, s), q = H !== 0 ? l.TEXTURE_2D_ARRAY : l.TEXTURE_2D, b = this._getRGBABufferInternalSizedFormat(a, o, d), j = this._getInternalFormat(o), w = this._getWebGLTextureType(a);
    return this._bindTextureDirectly(q, P), H !== 0 ? (P.is2DArray = !0, l.texImage3D(q, 0, b, p, c, H, 0, j, w, null)) : l.texImage2D(q, 0, b, p, c, 0, j, w, null), l.texParameteri(q, l.TEXTURE_MAG_FILTER, T.mag), l.texParameteri(q, l.TEXTURE_MIN_FILTER, T.min), l.texParameteri(q, l.TEXTURE_WRAP_S, l.CLAMP_TO_EDGE), l.texParameteri(q, l.TEXTURE_WRAP_T, l.CLAMP_TO_EDGE), s && this._gl.generateMipmap(q), this._bindTextureDirectly(q, null), P._useSRGBBuffer = d, P.baseWidth = p, P.baseHeight = c, P.width = p, P.height = c, P.depth = H, P.isReady = !0, P.samples = v, P.generateMipMaps = s, P.samplingMode = f, P.type = a, P.format = o, P.label = u, this._internalTexturesCache.push(P), P;
  }
  /**
   * @internal
   */
  _getUseSRGBBuffer(e, t) {
    return e && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU || t);
  }
  _createTextureBase(e, t, r, n, i = 3, s = null, a = null, f, o, d = null, v = null, u = null, l = null, P, p, c) {
    e = e || "";
    const H = e.substr(0, 5) === "data:", T = e.substr(0, 5) === "blob:", q = H && e.indexOf(";base64,") !== -1, b = v || new As(this, ri.Url);
    b !== v && (b.label = e.substring(0, 60));
    const j = e;
    this._transformTextureUrl && !q && !v && !d && (e = this._transformTextureUrl(e)), j !== e && (b._originalUrl = j);
    const w = e.lastIndexOf(".");
    let m = l || (w > -1 ? e.substring(w).toLowerCase() : ""), I = null;
    m.indexOf("?") > -1 && (m = m.split("?")[0]);
    for (const y of hr._TextureLoaders)
      if (y.canLoad(m, P)) {
        I = y;
        break;
      }
    n && n.addPendingData(b), b.url = e, b.generateMipMaps = !t, b.samplingMode = i, b.invertY = r, b._useSRGBBuffer = this._getUseSRGBBuffer(!!c, t), this._doNotHandleContextLost || (b._buffer = d);
    let k = null;
    s && !v && (k = b.onLoadedObservable.add(s)), v || this._internalTexturesCache.push(b);
    const R = (y, O) => {
      n && n.removePendingData(b), e === j ? (k && b.onLoadedObservable.remove(k), gr.UseFallbackTexture && this._createTextureBase(gr.FallbackTexture, t, b.invertY, n, i, null, a, f, o, d, b), y = (y || "Unknown error") + (gr.UseFallbackTexture ? " - Fallback texture was used" : ""), b.onErrorObservable.notifyObservers({ message: y, exception: O }), a && a(y, O)) : (Se.Warn(`Failed to load ${e}, falling back to ${j}`), this._createTextureBase(j, t, b.invertY, n, i, s, a, f, o, d, b, u, l, P, p, c));
    };
    if (I) {
      const y = (O) => {
        I.loadData(O, b, (Y, ee, Z, te, fe, _) => {
          _ ? R("TextureLoader failed to load data") : f(b, m, n, { width: Y, height: ee }, b.invertY, !Z, te, () => (fe(), !1), i);
        }, p);
      };
      d ? d instanceof ArrayBuffer ? y(new Uint8Array(d)) : ArrayBuffer.isView(d) ? y(d) : a && a("Unable to load: only ArrayBuffer or ArrayBufferView is supported", null) : this._loadFile(e, (O) => y(new Uint8Array(O)), void 0, n ? n.offlineProvider : void 0, !0, (O, Y) => {
        R("Unable to load " + (O && O.responseURL, Y));
      });
    } else {
      const y = (O) => {
        T && !this._doNotHandleContextLost && (b._buffer = O), f(b, m, n, O, b.invertY, t, !1, o, i);
      };
      !H || q ? d && (typeof d.decoding == "string" || d.close) ? y(d) : hr._FileToolsLoadImage(e, y, R, n ? n.offlineProvider : null, P, b.invertY && this._features.needsInvertingBitmap ? { imageOrientation: "flipY" } : void 0) : typeof d == "string" || d instanceof ArrayBuffer || ArrayBuffer.isView(d) || d instanceof Blob ? hr._FileToolsLoadImage(d, y, R, n ? n.offlineProvider : null, P, b.invertY && this._features.needsInvertingBitmap ? { imageOrientation: "flipY" } : void 0) : d && y(d);
    }
    return b;
  }
  /**
   * Usually called from Texture.ts.
   * Passed information to create a WebGLTexture
   * @param url defines a value which contains one of the following:
   * * A conventional http URL, e.g. 'http://...' or 'file://...'
   * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
   * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
   * @param noMipmap defines a boolean indicating that no mipmaps shall be generated.  Ignored for compressed textures.  They must be in the file
   * @param invertY when true, image is flipped when loaded.  You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
   * @param scene needed for loading to the correct scene
   * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
   * @param onLoad optional callback to be called upon successful completion
   * @param onError optional callback to be called upon failure
   * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
   * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
   * @param format internal format.  Default: RGB when extension is '.jpg' else RGBA.  Ignored for compressed textures
   * @param forcedExtension defines the extension to use to pick the right loader
   * @param mimeType defines an optional mime type
   * @param loaderOptions options to be passed to the loader
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   * @returns a InternalTexture for assignment back into BABYLON.Texture
   */
  createTexture(e, t, r, n, i = 3, s = null, a = null, f = null, o = null, d = null, v = null, u, l, P, p) {
    return this._createTextureBase(e, t, r, n, i, s, a, this._prepareWebGLTexture.bind(this), (c, H, T, q, b, j) => {
      const w = this._gl, m = T.width === c && T.height === H, I = this._getTexImageParametersForCreateTexture(d, q, b._useSRGBBuffer);
      if (m)
        return w.texImage2D(w.TEXTURE_2D, 0, I.internalFormat, I.format, I.type, T), !1;
      const N = this._caps.maxTextureSize;
      if (T.width > N || T.height > N || !this._supportsHardwareTextureRescaling)
        return this._prepareWorkingCanvas(), !this._workingCanvas || !this._workingContext || (this._workingCanvas.width = c, this._workingCanvas.height = H, this._workingContext.drawImage(T, 0, 0, T.width, T.height, 0, 0, c, H), w.texImage2D(w.TEXTURE_2D, 0, I.internalFormat, I.format, I.type, this._workingCanvas), b.width = c, b.height = H), !1;
      {
        const k = new As(this, ri.Temp);
        this._bindTextureDirectly(w.TEXTURE_2D, k, !0), w.texImage2D(w.TEXTURE_2D, 0, I.internalFormat, I.format, I.type, T), this._rescaleTexture(k, b, n, I.format, () => {
          this._releaseTexture(k), this._bindTextureDirectly(w.TEXTURE_2D, b, !0), j();
        });
      }
      return !0;
    }, f, o, d, v, u, l, p);
  }
  /**
   * Calls to the GL texImage2D and texImage3D functions require three arguments describing the pixel format of the texture.
   * createTexture derives these from the babylonFormat and useSRGBBuffer arguments and also the file extension of the URL it's working with.
   * This function encapsulates that derivation for easy unit testing.
   * @param babylonFormat Babylon's format enum, as specified in ITextureCreationOptions.
   * @param fileExtension The file extension including the dot, e.g. .jpg.
   * @param useSRGBBuffer Use SRGB not linear.
   * @returns The options to pass to texImage2D or texImage3D calls.
   * @internal
   */
  _getTexImageParametersForCreateTexture(e, t, r) {
    e == null && (e = t === ".jpg" && !r ? 4 : 5);
    let n, i;
    return this.webGLVersion === 1 ? (n = this._getInternalFormat(e, r), i = n) : (n = this._getInternalFormat(e, !1), i = this._getRGBABufferInternalSizedFormat(0, e, r)), {
      internalFormat: i,
      format: n,
      type: this._gl.UNSIGNED_BYTE
    };
  }
  /**
   * Loads an image as an HTMLImageElement.
   * @param input url string, ArrayBuffer, or Blob to load
   * @param onLoad callback called when the image successfully loads
   * @param onError callback called when the image fails to load
   * @param offlineProvider offline provider for caching
   * @param mimeType optional mime type
   * @param imageBitmapOptions optional the options to use when creating an ImageBitmap
   * @returns the HTMLImageElement of the loaded image
   * @internal
   */
  static _FileToolsLoadImage(e, t, r, n, i, s) {
    throw qn("FileTools");
  }
  /**
   * @internal
   */
  _rescaleTexture(e, t, r, n, i) {
  }
  /**
   * Creates a raw texture
   * @param data defines the data to store in the texture
   * @param width defines the width of the texture
   * @param height defines the height of the texture
   * @param format defines the format of the data
   * @param generateMipMaps defines if the engine should generate the mip levels
   * @param invertY defines if data must be stored with Y axis inverted
   * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
   * @param compression defines the compression used (null by default)
   * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   * @returns the raw texture inside an InternalTexture
   */
  createRawTexture(e, t, r, n, i, s, a, f = null, o = 0, d = 0, v = !1) {
    throw qn("Engine.RawTexture");
  }
  /**
   * Creates a new raw cube texture
   * @param data defines the array of data to use to create each face
   * @param size defines the size of the textures
   * @param format defines the format of the data
   * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
   * @param generateMipMaps  defines if the engine should generate the mip levels
   * @param invertY defines if data must be stored with Y axis inverted
   * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
   * @param compression defines the compression used (null by default)
   * @returns the cube texture as an InternalTexture
   */
  createRawCubeTexture(e, t, r, n, i, s, a, f = null) {
    throw qn("Engine.RawTexture");
  }
  /**
   * Creates a new raw 3D texture
   * @param data defines the data used to create the texture
   * @param width defines the width of the texture
   * @param height defines the height of the texture
   * @param depth defines the depth of the texture
   * @param format defines the format of the texture
   * @param generateMipMaps defines if the engine must generate mip levels
   * @param invertY defines if data must be stored with Y axis inverted
   * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
   * @param compression defines the compressed used (can be null)
   * @param textureType defines the compressed used (can be null)
   * @returns a new raw 3D texture (stored in an InternalTexture)
   */
  createRawTexture3D(e, t, r, n, i, s, a, f, o = null, d = 0) {
    throw qn("Engine.RawTexture");
  }
  /**
   * Creates a new raw 2D array texture
   * @param data defines the data used to create the texture
   * @param width defines the width of the texture
   * @param height defines the height of the texture
   * @param depth defines the number of layers of the texture
   * @param format defines the format of the texture
   * @param generateMipMaps defines if the engine must generate mip levels
   * @param invertY defines if data must be stored with Y axis inverted
   * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
   * @param compression defines the compressed used (can be null)
   * @param textureType defines the compressed used (can be null)
   * @returns a new raw 2D array texture (stored in an InternalTexture)
   */
  createRawTexture2DArray(e, t, r, n, i, s, a, f, o = null, d = 0) {
    throw qn("Engine.RawTexture");
  }
  /**
   * @internal
   */
  _unpackFlipY(e) {
    this._unpackFlipYCached !== e && (this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, e ? 1 : 0), this.enableUnpackFlipYCached && (this._unpackFlipYCached = e));
  }
  /** @internal */
  _getUnpackAlignement() {
    return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT);
  }
  _getTextureTarget(e) {
    return e.isCube ? this._gl.TEXTURE_CUBE_MAP : e.is3D ? this._gl.TEXTURE_3D : e.is2DArray || e.isMultiview ? this._gl.TEXTURE_2D_ARRAY : this._gl.TEXTURE_2D;
  }
  /**
   * Update the sampling mode of a given texture
   * @param samplingMode defines the required sampling mode
   * @param texture defines the texture to update
   * @param generateMipMaps defines whether to generate mipmaps for the texture
   */
  updateTextureSamplingMode(e, t, r = !1) {
    const n = this._getTextureTarget(t), i = this._getSamplingParameters(e, t.useMipMaps || r);
    this._setTextureParameterInteger(n, this._gl.TEXTURE_MAG_FILTER, i.mag, t), this._setTextureParameterInteger(n, this._gl.TEXTURE_MIN_FILTER, i.min), r && (t.generateMipMaps = !0, this._gl.generateMipmap(n)), this._bindTextureDirectly(n, null), t.samplingMode = e;
  }
  /**
   * Update the dimensions of a texture
   * @param texture texture to update
   * @param width new width of the texture
   * @param height new height of the texture
   * @param depth new depth of the texture
   */
  updateTextureDimensions(e, t, r, n = 1) {
  }
  /**
   * Update the sampling mode of a given texture
   * @param texture defines the texture to update
   * @param wrapU defines the texture wrap mode of the u coordinates
   * @param wrapV defines the texture wrap mode of the v coordinates
   * @param wrapR defines the texture wrap mode of the r coordinates
   */
  updateTextureWrappingMode(e, t, r = null, n = null) {
    const i = this._getTextureTarget(e);
    t !== null && (this._setTextureParameterInteger(i, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(t), e), e._cachedWrapU = t), r !== null && (this._setTextureParameterInteger(i, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(r), e), e._cachedWrapV = r), (e.is2DArray || e.is3D) && n !== null && (this._setTextureParameterInteger(i, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(n), e), e._cachedWrapR = n), this._bindTextureDirectly(i, null);
  }
  /**
   * @internal
   */
  _setupDepthStencilTexture(e, t, r, n, i, s = 1) {
    const a = t.width || t, f = t.height || t, o = t.layers || 0;
    e.baseWidth = a, e.baseHeight = f, e.width = a, e.height = f, e.is2DArray = o > 0, e.depth = o, e.isReady = !0, e.samples = s, e.generateMipMaps = !1, e.samplingMode = n ? 2 : 1, e.type = 0, e._comparisonFunction = i;
    const d = this._gl, v = this._getTextureTarget(e), u = this._getSamplingParameters(e.samplingMode, !1);
    d.texParameteri(v, d.TEXTURE_MAG_FILTER, u.mag), d.texParameteri(v, d.TEXTURE_MIN_FILTER, u.min), d.texParameteri(v, d.TEXTURE_WRAP_S, d.CLAMP_TO_EDGE), d.texParameteri(v, d.TEXTURE_WRAP_T, d.CLAMP_TO_EDGE), this.webGLVersion > 1 && (i === 0 ? (d.texParameteri(v, d.TEXTURE_COMPARE_FUNC, 515), d.texParameteri(v, d.TEXTURE_COMPARE_MODE, d.NONE)) : (d.texParameteri(v, d.TEXTURE_COMPARE_FUNC, i), d.texParameteri(v, d.TEXTURE_COMPARE_MODE, d.COMPARE_REF_TO_TEXTURE)));
  }
  /**
   * @internal
   */
  _uploadCompressedDataToTextureDirectly(e, t, r, n, i, s = 0, a = 0) {
    const f = this._gl;
    let o = f.TEXTURE_2D;
    if (e.isCube && (o = f.TEXTURE_CUBE_MAP_POSITIVE_X + s), e._useSRGBBuffer)
      switch (t) {
        case 37492:
        case 36196:
          this._caps.etc2 ? t = f.COMPRESSED_SRGB8_ETC2 : e._useSRGBBuffer = !1;
          break;
        case 37496:
          this._caps.etc2 ? t = f.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : e._useSRGBBuffer = !1;
          break;
        case 36492:
          t = f.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;
          break;
        case 37808:
          t = f.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
          break;
        case 33776:
          this._caps.s3tc_srgb ? t = f.COMPRESSED_SRGB_S3TC_DXT1_EXT : e._useSRGBBuffer = !1;
          break;
        case 33777:
          this._caps.s3tc_srgb ? t = f.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT : e._useSRGBBuffer = !1;
          break;
        case 33779:
          this._caps.s3tc_srgb ? t = f.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT : e._useSRGBBuffer = !1;
          break;
        default:
          e._useSRGBBuffer = !1;
          break;
      }
    this._gl.compressedTexImage2D(o, a, t, r, n, 0, i);
  }
  /**
   * @internal
   */
  _uploadDataToTextureDirectly(e, t, r = 0, n = 0, i, s = !1) {
    const a = this._gl, f = this._getWebGLTextureType(e.type), o = this._getInternalFormat(e.format), d = i === void 0 ? this._getRGBABufferInternalSizedFormat(e.type, e.format, e._useSRGBBuffer) : this._getInternalFormat(i, e._useSRGBBuffer);
    this._unpackFlipY(e.invertY);
    let v = a.TEXTURE_2D;
    e.isCube && (v = a.TEXTURE_CUBE_MAP_POSITIVE_X + r);
    const u = Math.round(Math.log(e.width) * Math.LOG2E), l = Math.round(Math.log(e.height) * Math.LOG2E), P = s ? e.width : Math.pow(2, Math.max(u - n, 0)), p = s ? e.height : Math.pow(2, Math.max(l - n, 0));
    a.texImage2D(v, n, d, P, p, 0, o, f, t);
  }
  /**
   * Update a portion of an internal texture
   * @param texture defines the texture to update
   * @param imageData defines the data to store into the texture
   * @param xOffset defines the x coordinates of the update rectangle
   * @param yOffset defines the y coordinates of the update rectangle
   * @param width defines the width of the update rectangle
   * @param height defines the height of the update rectangle
   * @param faceIndex defines the face index if texture is a cube (0 by default)
   * @param lod defines the lod level to update (0 by default)
   * @param generateMipMaps defines whether to generate mipmaps or not
   */
  updateTextureData(e, t, r, n, i, s, a = 0, f = 0, o = !1) {
    const d = this._gl, v = this._getWebGLTextureType(e.type), u = this._getInternalFormat(e.format);
    this._unpackFlipY(e.invertY);
    let l = d.TEXTURE_2D, P = d.TEXTURE_2D;
    e.isCube && (P = d.TEXTURE_CUBE_MAP_POSITIVE_X + a, l = d.TEXTURE_CUBE_MAP), this._bindTextureDirectly(l, e, !0), d.texSubImage2D(P, f, r, n, i, s, u, v, t), o && this._gl.generateMipmap(P), this._bindTextureDirectly(l, null);
  }
  /**
   * @internal
   */
  _uploadArrayBufferViewToTexture(e, t, r = 0, n = 0) {
    const i = this._gl, s = e.isCube ? i.TEXTURE_CUBE_MAP : i.TEXTURE_2D;
    this._bindTextureDirectly(s, e, !0), this._uploadDataToTextureDirectly(e, t, r, n), this._bindTextureDirectly(s, null, !0);
  }
  _prepareWebGLTextureContinuation(e, t, r, n, i) {
    const s = this._gl;
    if (!s)
      return;
    const a = this._getSamplingParameters(i, !r);
    s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.mag), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.min), !r && !n && s.generateMipmap(s.TEXTURE_2D), this._bindTextureDirectly(s.TEXTURE_2D, null), t && t.removePendingData(e), e.onLoadedObservable.notifyObservers(e), e.onLoadedObservable.clear();
  }
  _prepareWebGLTexture(e, t, r, n, i, s, a, f, o = 3) {
    const d = this.getCaps().maxTextureSize, v = Math.min(d, this.needPOTTextures ? hr.GetExponentOfTwo(n.width, d) : n.width), u = Math.min(d, this.needPOTTextures ? hr.GetExponentOfTwo(n.height, d) : n.height), l = this._gl;
    if (l) {
      if (!e._hardwareTexture) {
        r && r.removePendingData(e);
        return;
      }
      this._bindTextureDirectly(l.TEXTURE_2D, e, !0), this._unpackFlipY(i === void 0 ? !0 : !!i), e.baseWidth = n.width, e.baseHeight = n.height, e.width = v, e.height = u, e.isReady = !0, e.type = e.type !== -1 ? e.type : 0, e.format = e.format !== -1 ? e.format : t === ".jpg" && !e._useSRGBBuffer ? 4 : 5, !f(v, u, n, t, e, () => {
        this._prepareWebGLTextureContinuation(e, r, s, a, o);
      }) && this._prepareWebGLTextureContinuation(e, r, s, a, o);
    }
  }
  /**
   * @internal
   */
  _setupFramebufferDepthAttachments(e, t, r, n, i = 1) {
    const s = this._gl;
    if (e && t)
      return this._createRenderBuffer(r, n, i, s.DEPTH_STENCIL, s.DEPTH24_STENCIL8, s.DEPTH_STENCIL_ATTACHMENT);
    if (t) {
      let a = s.DEPTH_COMPONENT16;
      return this._webGLVersion > 1 && (a = s.DEPTH_COMPONENT32F), this._createRenderBuffer(r, n, i, a, a, s.DEPTH_ATTACHMENT);
    }
    return e ? this._createRenderBuffer(r, n, i, s.STENCIL_INDEX8, s.STENCIL_INDEX8, s.STENCIL_ATTACHMENT) : null;
  }
  /**
   * @internal
   */
  _createRenderBuffer(e, t, r, n, i, s, a = !0) {
    const o = this._gl.createRenderbuffer();
    return this._updateRenderBuffer(o, e, t, r, n, i, s, a);
  }
  _updateRenderBuffer(e, t, r, n, i, s, a, f = !0) {
    const o = this._gl;
    return o.bindRenderbuffer(o.RENDERBUFFER, e), n > 1 && o.renderbufferStorageMultisample ? o.renderbufferStorageMultisample(o.RENDERBUFFER, n, s, t, r) : o.renderbufferStorage(o.RENDERBUFFER, i, t, r), o.framebufferRenderbuffer(o.FRAMEBUFFER, a, o.RENDERBUFFER, e), f && o.bindRenderbuffer(o.RENDERBUFFER, null), e;
  }
  /**
   * @internal
   */
  _releaseTexture(e) {
    var t;
    this._deleteTexture((t = e._hardwareTexture) === null || t === void 0 ? void 0 : t.underlyingResource), this.unbindAllTextures();
    const r = this._internalTexturesCache.indexOf(e);
    r !== -1 && this._internalTexturesCache.splice(r, 1), e._lodTextureHigh && e._lodTextureHigh.dispose(), e._lodTextureMid && e._lodTextureMid.dispose(), e._lodTextureLow && e._lodTextureLow.dispose(), e._irradianceTexture && e._irradianceTexture.dispose();
  }
  /**
   * @internal
   */
  _releaseRenderTargetWrapper(e) {
    const t = this._renderTargetWrapperCache.indexOf(e);
    t !== -1 && this._renderTargetWrapperCache.splice(t, 1);
  }
  _deleteTexture(e) {
    e && this._gl.deleteTexture(e);
  }
  _setProgram(e) {
    this._currentProgram !== e && (this._gl.useProgram(e), this._currentProgram = e);
  }
  /**
   * Binds an effect to the webGL context
   * @param effect defines the effect to bind
   */
  bindSamplers(e) {
    const t = e.getPipelineContext();
    this._setProgram(t.program);
    const r = e.getSamplers();
    for (let n = 0; n < r.length; n++) {
      const i = e.getUniform(r[n]);
      i && (this._boundUniforms[n] = i);
    }
    this._currentEffect = null;
  }
  _activateCurrentTexture() {
    this._currentTextureChannel !== this._activeChannel && (this._gl.activeTexture(this._gl.TEXTURE0 + this._activeChannel), this._currentTextureChannel = this._activeChannel);
  }
  /**
   * @internal
   */
  _bindTextureDirectly(e, t, r = !1, n = !1) {
    var i, s;
    let a = !1;
    const f = t && t._associatedChannel > -1;
    if (r && f && (this._activeChannel = t._associatedChannel), this._boundTexturesCache[this._activeChannel] !== t || n) {
      if (this._activateCurrentTexture(), t && t.isMultiview)
        throw console.error(e, t), "_bindTextureDirectly called with a multiview texture!";
      this._gl.bindTexture(e, (s = (i = t == null ? void 0 : t._hardwareTexture) === null || i === void 0 ? void 0 : i.underlyingResource) !== null && s !== void 0 ? s : null), this._boundTexturesCache[this._activeChannel] = t, t && (t._associatedChannel = this._activeChannel);
    } else
      r && (a = !0, this._activateCurrentTexture());
    return f && !r && this._bindSamplerUniformToChannel(t._associatedChannel, this._activeChannel), a;
  }
  /**
   * @internal
   */
  _bindTexture(e, t, r) {
    if (e === void 0)
      return;
    t && (t._associatedChannel = e), this._activeChannel = e;
    const n = t ? this._getTextureTarget(t) : this._gl.TEXTURE_2D;
    this._bindTextureDirectly(n, t);
  }
  /**
   * Unbind all textures from the webGL context
   */
  unbindAllTextures() {
    for (let e = 0; e < this._maxSimultaneousTextures; e++)
      this._activeChannel = e, this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), this.webGLVersion > 1 && (this._bindTextureDirectly(this._gl.TEXTURE_3D, null), this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY, null));
  }
  /**
   * Sets a texture to the according uniform.
   * @param channel The texture channel
   * @param uniform The uniform to set
   * @param texture The texture to apply
   * @param name The name of the uniform in the effect
   */
  setTexture(e, t, r, n) {
    e !== void 0 && (t && (this._boundUniforms[e] = t), this._setTexture(e, r));
  }
  _bindSamplerUniformToChannel(e, t) {
    const r = this._boundUniforms[e];
    !r || r._currentState === t || (this._gl.uniform1i(r, t), r._currentState = t);
  }
  _getTextureWrapMode(e) {
    switch (e) {
      case 1:
        return this._gl.REPEAT;
      case 0:
        return this._gl.CLAMP_TO_EDGE;
      case 2:
        return this._gl.MIRRORED_REPEAT;
    }
    return this._gl.REPEAT;
  }
  _setTexture(e, t, r = !1, n = !1, i = "") {
    if (!t)
      return this._boundTexturesCache[e] != null && (this._activeChannel = e, this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), this.webGLVersion > 1 && (this._bindTextureDirectly(this._gl.TEXTURE_3D, null), this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY, null))), !1;
    if (t.video) {
      this._activeChannel = e;
      const o = t.getInternalTexture();
      o && (o._associatedChannel = e), t.update();
    } else if (t.delayLoadState === 4)
      return t.delayLoad(), !1;
    let s;
    n ? s = t.depthStencilTexture : t.isReady() ? s = t.getInternalTexture() : t.isCube ? s = this.emptyCubeTexture : t.is3D ? s = this.emptyTexture3D : t.is2DArray ? s = this.emptyTexture2DArray : s = this.emptyTexture, !r && s && (s._associatedChannel = e);
    let a = !0;
    this._boundTexturesCache[e] === s && (r || this._bindSamplerUniformToChannel(s._associatedChannel, e), a = !1), this._activeChannel = e;
    const f = this._getTextureTarget(s);
    if (a && this._bindTextureDirectly(f, s, r), s && !s.isMultiview) {
      if (s.isCube && s._cachedCoordinatesMode !== t.coordinatesMode) {
        s._cachedCoordinatesMode = t.coordinatesMode;
        const o = t.coordinatesMode !== 3 && t.coordinatesMode !== 5 ? 1 : 0;
        t.wrapU = o, t.wrapV = o;
      }
      s._cachedWrapU !== t.wrapU && (s._cachedWrapU = t.wrapU, this._setTextureParameterInteger(f, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(t.wrapU), s)), s._cachedWrapV !== t.wrapV && (s._cachedWrapV = t.wrapV, this._setTextureParameterInteger(f, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(t.wrapV), s)), s.is3D && s._cachedWrapR !== t.wrapR && (s._cachedWrapR = t.wrapR, this._setTextureParameterInteger(f, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(t.wrapR), s)), this._setAnisotropicLevel(f, s, t.anisotropicFilteringLevel);
    }
    return !0;
  }
  /**
   * Sets an array of texture to the webGL context
   * @param channel defines the channel where the texture array must be set
   * @param uniform defines the associated uniform location
   * @param textures defines the array of textures to bind
   * @param name name of the channel
   */
  setTextureArray(e, t, r, n) {
    if (!(e === void 0 || !t)) {
      (!this._textureUnits || this._textureUnits.length !== r.length) && (this._textureUnits = new Int32Array(r.length));
      for (let i = 0; i < r.length; i++) {
        const s = r[i].getInternalTexture();
        s ? (this._textureUnits[i] = e + i, s._associatedChannel = e + i) : this._textureUnits[i] = -1;
      }
      this._gl.uniform1iv(t, this._textureUnits);
      for (let i = 0; i < r.length; i++)
        this._setTexture(this._textureUnits[i], r[i], !0);
    }
  }
  /**
   * @internal
   */
  _setAnisotropicLevel(e, t, r) {
    const n = this._caps.textureAnisotropicFilterExtension;
    t.samplingMode !== 11 && t.samplingMode !== 3 && t.samplingMode !== 2 && (r = 1), n && t._cachedAnisotropicFilteringLevel !== r && (this._setTextureParameterFloat(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(r, this._caps.maxAnisotropy), t), t._cachedAnisotropicFilteringLevel = r);
  }
  _setTextureParameterFloat(e, t, r, n) {
    this._bindTextureDirectly(e, n, !0, !0), this._gl.texParameterf(e, t, r);
  }
  _setTextureParameterInteger(e, t, r, n) {
    n && this._bindTextureDirectly(e, n, !0, !0), this._gl.texParameteri(e, t, r);
  }
  /**
   * Unbind all vertex attributes from the webGL context
   */
  unbindAllAttributes() {
    if (this._mustWipeVertexAttributes) {
      this._mustWipeVertexAttributes = !1;
      for (let e = 0; e < this._caps.maxVertexAttribs; e++)
        this.disableAttributeByIndex(e);
      return;
    }
    for (let e = 0, t = this._vertexAttribArraysEnabled.length; e < t; e++)
      e >= this._caps.maxVertexAttribs || !this._vertexAttribArraysEnabled[e] || this.disableAttributeByIndex(e);
  }
  /**
   * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled
   */
  releaseEffects() {
    for (const e in this._compiledEffects) {
      const t = this._compiledEffects[e].getPipelineContext();
      this._deletePipelineContext(t);
    }
    this._compiledEffects = {};
  }
  /**
   * Dispose and release all associated resources
   */
  dispose() {
    var e, t;
    this._isDisposed = !0, this.stopRenderLoop(), this.onBeforeTextureInitObservable && this.onBeforeTextureInitObservable.clear(), this._emptyTexture && (this._releaseTexture(this._emptyTexture), this._emptyTexture = null), this._emptyCubeTexture && (this._releaseTexture(this._emptyCubeTexture), this._emptyCubeTexture = null), this._dummyFramebuffer && this._gl.deleteFramebuffer(this._dummyFramebuffer), this.releaseEffects(), (e = this.releaseComputeEffects) === null || e === void 0 || e.call(this), this.unbindAllAttributes(), this._boundUniforms = {}, u9() && this._renderingCanvas && (this._doNotHandleContextLost || (this._renderingCanvas.removeEventListener("webglcontextlost", this._onContextLost), this._renderingCanvas.removeEventListener("webglcontextrestored", this._onContextRestored)), window.removeEventListener("resize", this._checkForMobile)), this._workingCanvas = null, this._workingContext = null, this._currentBufferPointers.length = 0, this._renderingCanvas = null, this._currentProgram = null, this._boundRenderFunction = null, An.ResetCache();
    for (const r of this._activeRequests)
      r.abort();
    this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this._creationOptions.loseContextOnDispose && ((t = this._gl.getExtension("WEBGL_lose_context")) === null || t === void 0 || t.loseContext());
  }
  /**
   * Attach a new callback raised when context lost event is fired
   * @param callback defines the callback to call
   */
  attachContextLostEvent(e) {
    this._renderingCanvas && this._renderingCanvas.addEventListener("webglcontextlost", e, !1);
  }
  /**
   * Attach a new callback raised when context restored event is fired
   * @param callback defines the callback to call
   */
  attachContextRestoredEvent(e) {
    this._renderingCanvas && this._renderingCanvas.addEventListener("webglcontextrestored", e, !1);
  }
  /**
   * Get the current error code of the webGL context
   * @returns the error code
   * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError
   */
  getError() {
    return this._gl.getError();
  }
  _canRenderToFloatFramebuffer() {
    return this._webGLVersion > 1 ? this._caps.colorBufferFloat : this._canRenderToFramebuffer(1);
  }
  _canRenderToHalfFloatFramebuffer() {
    return this._webGLVersion > 1 ? this._caps.colorBufferFloat : this._canRenderToFramebuffer(2);
  }
  // Thank you : http://stackoverflow.com/questions/28827511/webgl-ios-render-to-floating-point-texture
  _canRenderToFramebuffer(e) {
    const t = this._gl;
    for (; t.getError() !== t.NO_ERROR; )
      ;
    let r = !0;
    const n = t.createTexture();
    t.bindTexture(t.TEXTURE_2D, n), t.texImage2D(t.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(e), 1, 1, 0, t.RGBA, this._getWebGLTextureType(e), null), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.NEAREST), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.NEAREST);
    const i = t.createFramebuffer();
    t.bindFramebuffer(t.FRAMEBUFFER, i), t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, n, 0);
    const s = t.checkFramebufferStatus(t.FRAMEBUFFER);
    if (r = r && s === t.FRAMEBUFFER_COMPLETE, r = r && t.getError() === t.NO_ERROR, r && (t.clear(t.COLOR_BUFFER_BIT), r = r && t.getError() === t.NO_ERROR), r) {
      t.bindFramebuffer(t.FRAMEBUFFER, null);
      const a = t.RGBA, f = t.UNSIGNED_BYTE, o = new Uint8Array(4);
      t.readPixels(0, 0, 1, 1, a, f, o), r = r && t.getError() === t.NO_ERROR;
    }
    for (t.deleteTexture(n), t.deleteFramebuffer(i), t.bindFramebuffer(t.FRAMEBUFFER, null); !r && t.getError() !== t.NO_ERROR; )
      ;
    return r;
  }
  /**
   * @internal
   */
  _getWebGLTextureType(e) {
    if (this._webGLVersion === 1) {
      switch (e) {
        case 1:
          return this._gl.FLOAT;
        case 2:
          return this._gl.HALF_FLOAT_OES;
        case 0:
          return this._gl.UNSIGNED_BYTE;
        case 8:
          return this._gl.UNSIGNED_SHORT_4_4_4_4;
        case 9:
          return this._gl.UNSIGNED_SHORT_5_5_5_1;
        case 10:
          return this._gl.UNSIGNED_SHORT_5_6_5;
      }
      return this._gl.UNSIGNED_BYTE;
    }
    switch (e) {
      case 3:
        return this._gl.BYTE;
      case 0:
        return this._gl.UNSIGNED_BYTE;
      case 4:
        return this._gl.SHORT;
      case 5:
        return this._gl.UNSIGNED_SHORT;
      case 6:
        return this._gl.INT;
      case 7:
        return this._gl.UNSIGNED_INT;
      case 1:
        return this._gl.FLOAT;
      case 2:
        return this._gl.HALF_FLOAT;
      case 8:
        return this._gl.UNSIGNED_SHORT_4_4_4_4;
      case 9:
        return this._gl.UNSIGNED_SHORT_5_5_5_1;
      case 10:
        return this._gl.UNSIGNED_SHORT_5_6_5;
      case 11:
        return this._gl.UNSIGNED_INT_2_10_10_10_REV;
      case 12:
        return this._gl.UNSIGNED_INT_24_8;
      case 13:
        return this._gl.UNSIGNED_INT_10F_11F_11F_REV;
      case 14:
        return this._gl.UNSIGNED_INT_5_9_9_9_REV;
      case 15:
        return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV;
    }
    return this._gl.UNSIGNED_BYTE;
  }
  /**
   * @internal
   */
  _getInternalFormat(e, t = !1) {
    let r = t ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : this._gl.RGBA;
    switch (e) {
      case 0:
        r = this._gl.ALPHA;
        break;
      case 1:
        r = this._gl.LUMINANCE;
        break;
      case 2:
        r = this._gl.LUMINANCE_ALPHA;
        break;
      case 6:
        r = this._gl.RED;
        break;
      case 7:
        r = this._gl.RG;
        break;
      case 4:
        r = t ? this._glSRGBExtensionValues.SRGB : this._gl.RGB;
        break;
      case 5:
        r = t ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : this._gl.RGBA;
        break;
    }
    if (this._webGLVersion > 1)
      switch (e) {
        case 8:
          r = this._gl.RED_INTEGER;
          break;
        case 9:
          r = this._gl.RG_INTEGER;
          break;
        case 10:
          r = this._gl.RGB_INTEGER;
          break;
        case 11:
          r = this._gl.RGBA_INTEGER;
          break;
      }
    return r;
  }
  /**
   * @internal
   */
  _getRGBABufferInternalSizedFormat(e, t, r = !1) {
    if (this._webGLVersion === 1) {
      if (t !== void 0)
        switch (t) {
          case 0:
            return this._gl.ALPHA;
          case 1:
            return this._gl.LUMINANCE;
          case 2:
            return this._gl.LUMINANCE_ALPHA;
          case 4:
            return r ? this._glSRGBExtensionValues.SRGB : this._gl.RGB;
        }
      return this._gl.RGBA;
    }
    switch (e) {
      case 3:
        switch (t) {
          case 6:
            return this._gl.R8_SNORM;
          case 7:
            return this._gl.RG8_SNORM;
          case 4:
            return this._gl.RGB8_SNORM;
          case 8:
            return this._gl.R8I;
          case 9:
            return this._gl.RG8I;
          case 10:
            return this._gl.RGB8I;
          case 11:
            return this._gl.RGBA8I;
          default:
            return this._gl.RGBA8_SNORM;
        }
      case 0:
        switch (t) {
          case 6:
            return this._gl.R8;
          case 7:
            return this._gl.RG8;
          case 4:
            return r ? this._glSRGBExtensionValues.SRGB8 : this._gl.RGB8;
          case 5:
            return r ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : this._gl.RGBA8;
          case 8:
            return this._gl.R8UI;
          case 9:
            return this._gl.RG8UI;
          case 10:
            return this._gl.RGB8UI;
          case 11:
            return this._gl.RGBA8UI;
          case 0:
            return this._gl.ALPHA;
          case 1:
            return this._gl.LUMINANCE;
          case 2:
            return this._gl.LUMINANCE_ALPHA;
          default:
            return this._gl.RGBA8;
        }
      case 4:
        switch (t) {
          case 8:
            return this._gl.R16I;
          case 9:
            return this._gl.RG16I;
          case 10:
            return this._gl.RGB16I;
          case 11:
            return this._gl.RGBA16I;
          default:
            return this._gl.RGBA16I;
        }
      case 5:
        switch (t) {
          case 8:
            return this._gl.R16UI;
          case 9:
            return this._gl.RG16UI;
          case 10:
            return this._gl.RGB16UI;
          case 11:
            return this._gl.RGBA16UI;
          default:
            return this._gl.RGBA16UI;
        }
      case 6:
        switch (t) {
          case 8:
            return this._gl.R32I;
          case 9:
            return this._gl.RG32I;
          case 10:
            return this._gl.RGB32I;
          case 11:
            return this._gl.RGBA32I;
          default:
            return this._gl.RGBA32I;
        }
      case 7:
        switch (t) {
          case 8:
            return this._gl.R32UI;
          case 9:
            return this._gl.RG32UI;
          case 10:
            return this._gl.RGB32UI;
          case 11:
            return this._gl.RGBA32UI;
          default:
            return this._gl.RGBA32UI;
        }
      case 1:
        switch (t) {
          case 6:
            return this._gl.R32F;
          case 7:
            return this._gl.RG32F;
          case 4:
            return this._gl.RGB32F;
          case 5:
            return this._gl.RGBA32F;
          default:
            return this._gl.RGBA32F;
        }
      case 2:
        switch (t) {
          case 6:
            return this._gl.R16F;
          case 7:
            return this._gl.RG16F;
          case 4:
            return this._gl.RGB16F;
          case 5:
            return this._gl.RGBA16F;
          default:
            return this._gl.RGBA16F;
        }
      case 10:
        return this._gl.RGB565;
      case 13:
        return this._gl.R11F_G11F_B10F;
      case 14:
        return this._gl.RGB9_E5;
      case 8:
        return this._gl.RGBA4;
      case 9:
        return this._gl.RGB5_A1;
      case 11:
        switch (t) {
          case 5:
            return this._gl.RGB10_A2;
          case 11:
            return this._gl.RGB10_A2UI;
          default:
            return this._gl.RGB10_A2;
        }
    }
    return r ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : this._gl.RGBA8;
  }
  /**
   * @internal
   */
  _loadFile(e, t, r, n, i, s) {
    const a = hr._FileToolsLoadFile(e, t, r, n, i, s);
    return this._activeRequests.push(a), a.onCompleteObservable.add((f) => {
      this._activeRequests.splice(this._activeRequests.indexOf(f), 1);
    }), a;
  }
  /**
   * Loads a file from a url
   * @param url url to load
   * @param onSuccess callback called when the file successfully loads
   * @param onProgress callback called while file is loading (if the server supports this mode)
   * @param offlineProvider defines the offline provider for caching
   * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
   * @param onError callback called when the file fails to load
   * @returns a file request object
   * @internal
   */
  static _FileToolsLoadFile(e, t, r, n, i, s) {
    throw qn("FileTools");
  }
  /**
   * Reads pixels from the current frame buffer. Please note that this function can be slow
   * @param x defines the x coordinate of the rectangle where pixels must be read
   * @param y defines the y coordinate of the rectangle where pixels must be read
   * @param width defines the width of the rectangle where pixels must be read
   * @param height defines the height of the rectangle where pixels must be read
   * @param hasAlpha defines whether the output should have alpha or not (defaults to true)
   * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
   * @returns a ArrayBufferView promise (Uint8Array) containing RGBA colors
   */
  readPixels(e, t, r, n, i = !0, s = !0) {
    const a = i ? 4 : 3, f = i ? this._gl.RGBA : this._gl.RGB, o = new Uint8Array(n * r * a);
    return s && this.flushFramebuffer(), this._gl.readPixels(e, t, r, n, f, this._gl.UNSIGNED_BYTE, o), Promise.resolve(o);
  }
  /**
   * Gets a Promise<boolean> indicating if the engine can be instantiated (ie. if a webGL context can be found)
   */
  static get IsSupportedAsync() {
    return Promise.resolve(this.isSupported());
  }
  /**
   * Gets a boolean indicating if the engine can be instantiated (ie. if a webGL context can be found)
   */
  static get IsSupported() {
    return this.isSupported();
  }
  /**
   * Gets a boolean indicating if the engine can be instantiated (ie. if a webGL context can be found)
   * @returns true if the engine can be created
   * @ignorenaming
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static isSupported() {
    if (this._HasMajorPerformanceCaveat !== null)
      return !this._HasMajorPerformanceCaveat;
    if (this._IsSupported === null)
      try {
        const e = this._CreateCanvas(1, 1), t = e.getContext("webgl") || e.getContext("experimental-webgl");
        this._IsSupported = t != null && !!window.WebGLRenderingContext;
      } catch {
        this._IsSupported = !1;
      }
    return this._IsSupported;
  }
  /**
   * Gets a boolean indicating if the engine can be instantiated on a performant device (ie. if a webGL context can be found and it does not use a slow implementation)
   */
  static get HasMajorPerformanceCaveat() {
    if (this._HasMajorPerformanceCaveat === null)
      try {
        const e = this._CreateCanvas(1, 1), t = e.getContext("webgl", { failIfMajorPerformanceCaveat: !0 }) || e.getContext("experimental-webgl", { failIfMajorPerformanceCaveat: !0 });
        this._HasMajorPerformanceCaveat = !t;
      } catch {
        this._HasMajorPerformanceCaveat = !1;
      }
    return this._HasMajorPerformanceCaveat;
  }
  /**
   * Find the next highest power of two.
   * @param x Number to start search from.
   * @returns Next highest power of two.
   */
  static CeilingPOT(e) {
    return e--, e |= e >> 1, e |= e >> 2, e |= e >> 4, e |= e >> 8, e |= e >> 16, e++, e;
  }
  /**
   * Find the next lowest power of two.
   * @param x Number to start search from.
   * @returns Next lowest power of two.
   */
  static FloorPOT(e) {
    return e = e | e >> 1, e = e | e >> 2, e = e | e >> 4, e = e | e >> 8, e = e | e >> 16, e - (e >> 1);
  }
  /**
   * Find the nearest power of two.
   * @param x Number to start search from.
   * @returns Next nearest power of two.
   */
  static NearestPOT(e) {
    const t = hr.CeilingPOT(e), r = hr.FloorPOT(e);
    return t - e > e - r ? r : t;
  }
  /**
   * Get the closest exponent of two
   * @param value defines the value to approximate
   * @param max defines the maximum value to return
   * @param mode defines how to define the closest value
   * @returns closest exponent of two of the given value
   */
  static GetExponentOfTwo(e, t, r = 2) {
    let n;
    switch (r) {
      case 1:
        n = hr.FloorPOT(e);
        break;
      case 2:
        n = hr.NearestPOT(e);
        break;
      case 3:
      default:
        n = hr.CeilingPOT(e);
        break;
    }
    return Math.min(n, t);
  }
  /**
   * Queue a new function into the requested animation frame pool (ie. this function will be executed by the browser (or the javascript engine) for the next frame)
   * @param func - the function to be called
   * @param requester - the object that will request the next frame. Falls back to window.
   * @returns frame number
   */
  static QueueNewFrame(e, t) {
    if (u9()) {
      const { requestAnimationFrame: r } = t || window;
      if (typeof r == "function")
        return r(e);
    } else if (typeof requestAnimationFrame == "function")
      return requestAnimationFrame(e);
    return setTimeout(e, 16);
  }
  /**
   * Gets host document
   * @returns the host document object
   */
  getHostDocument() {
    return this._renderingCanvas && this._renderingCanvas.ownerDocument ? this._renderingCanvas.ownerDocument : $w() ? document : null;
  }
}
hr._TempClearColorUint32 = new Uint32Array(4);
hr._TempClearColorInt32 = new Int32Array(4);
hr.ExceptionList = [
  { key: "Chrome/63.0", capture: "63\\.0\\.3239\\.(\\d+)", captureConstraint: 108, targets: ["uniformBuffer"] },
  { key: "Firefox/58", capture: null, captureConstraint: null, targets: ["uniformBuffer"] },
  { key: "Firefox/59", capture: null, captureConstraint: null, targets: ["uniformBuffer"] },
  { key: "Chrome/72.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] },
  { key: "Chrome/73.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] },
  { key: "Chrome/74.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] },
  { key: "Mac OS.+Chrome/71", capture: null, captureConstraint: null, targets: ["vao"] },
  { key: "Mac OS.+Chrome/72", capture: null, captureConstraint: null, targets: ["vao"] },
  { key: "Mac OS.+Chrome", capture: null, captureConstraint: null, targets: ["uniformBuffer"] },
  // desktop osx safari 15.4
  { key: ".*AppleWebKit.*(15.4).*Safari", capture: null, captureConstraint: null, targets: ["antialias", "maxMSAASamples"] },
  // mobile browsers using safari 15.4 on ios
  { key: ".*(15.4).*AppleWebKit.*Safari", capture: null, captureConstraint: null, targets: ["antialias", "maxMSAASamples"] }
];
hr._TextureLoaders = [];
hr.CollisionsEpsilon = 1e-3;
hr._IsSupported = null;
hr._HasMajorPerformanceCaveat = null;
class wS {
  /**
   * Polyfill for setImmediate
   * @param action defines the action to execute after the current execution block
   */
  static SetImmediate(e) {
    u9() && window.setImmediate ? window.setImmediate(e) : setTimeout(e, 1);
  }
}
const F$ = new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i);
class mS extends O0 {
  /**
   * Creates a new LoadFileError
   * @param message defines the message of the error
   * @param object defines the optional web request
   */
  constructor(e, t) {
    super(e, Z2.LoadFileError), this.name = "LoadFileError", dm._setPrototypeOf(this, mS.prototype), t instanceof ho ? this.request = t : this.file = t;
  }
}
class OI extends O0 {
  /**
   * Creates a new LoadFileError
   * @param message defines the message of the error
   * @param request defines the optional web request
   */
  constructor(e, t) {
    super(e, Z2.RequestFileError), this.request = t, this.name = "RequestFileError", dm._setPrototypeOf(this, OI.prototype);
  }
}
class xO extends O0 {
  /**
   * Creates a new ReadFileError
   * @param message defines the message of the error
   * @param file defines the optional file
   */
  constructor(e, t) {
    super(e, Z2.ReadFileError), this.file = t, this.name = "ReadFileError", dm._setPrototypeOf(this, xO.prototype);
  }
}
const A9 = {
  /**
   * Gets or sets the retry strategy to apply when an error happens while loading an asset.
   * When defining this function, return the wait time before trying again or return -1 to
   * stop retrying and error out.
   */
  DefaultRetryStrategy: V$.ExponentialBackoff(),
  /**
   * Gets or sets the base URL to use to load assets
   */
  BaseUrl: "",
  /**
   * Default behaviour for cors in the application.
   * It can be a string if the expected behavior is identical in the entire app.
   * Or a callback to be able to set it per url or on a group of them (in case of Video source for instance)
   */
  CorsBehavior: "anonymous",
  /**
   * Gets or sets a function used to pre-process url before using them to load assets
   * @param url
   */
  PreprocessUrl: (A) => A,
  /**
   * Gets or sets the base URL to use to load scripts
   * Used for both JS and WASM
   */
  ScriptBaseUrl: "",
  /**
   * Gets or sets a function used to pre-process script url before using them to load.
   * Used for both JS and WASM
   * @param url defines the url to process
   */
  ScriptPreprocessUrl: (A) => A
}, N$ = (A) => (A = A.replace(/#/gm, "%23"), A), DO = (A, e) => {
  if (!(A && A.indexOf("data:") === 0) && A9.CorsBehavior)
    if (typeof A9.CorsBehavior == "string" || A9.CorsBehavior instanceof String)
      e.crossOrigin = A9.CorsBehavior;
    else {
      const t = A9.CorsBehavior(A);
      t && (e.crossOrigin = t);
    }
}, nU = (A, e, t, r, n = "", i) => {
  var s;
  let a, f = !1;
  A instanceof ArrayBuffer || ArrayBuffer.isView(A) ? typeof Blob < "u" && typeof URL < "u" ? (a = URL.createObjectURL(new Blob([A], { type: n })), f = !0) : a = `data:${n};base64,` + XR(A) : A instanceof Blob ? (a = URL.createObjectURL(A), f = !0) : (a = N$(A), a = A9.PreprocessUrl(A));
  const o = gr.LastCreatedEngine, d = (w) => {
    if (t) {
      const m = a || A.toString();
      t(`Error while trying to load image: ${m.indexOf("http") === 0 || m.length <= 128 ? m : m.slice(0, 128) + "..."}`, w);
    }
  };
  if (typeof Image > "u" || (s = o == null ? void 0 : o._features.forceBitmapOverHTMLImageElement) !== null && s !== void 0 && s)
    return gq(a, (w) => {
      o.createImageBitmap(new Blob([w], { type: n }), Object.assign({ premultiplyAlpha: "none" }, i)).then((m) => {
        e(m), f && URL.revokeObjectURL(a);
      }).catch((m) => {
        t && t("Error while trying to load image: " + A, m);
      });
    }, void 0, r || void 0, !0, (w, m) => {
      d(m);
    }), null;
  const v = new Image();
  DO(a, v);
  const u = [], l = () => {
    u.forEach((w) => {
      w.target.addEventListener(w.name, w.handler);
    });
  }, P = () => {
    u.forEach((w) => {
      w.target.removeEventListener(w.name, w.handler);
    }), u.length = 0;
  }, p = () => {
    P(), e(v), f && v.src && URL.revokeObjectURL(v.src);
  }, c = (w) => {
    P(), d(w), f && v.src && URL.revokeObjectURL(v.src);
  }, H = (w) => {
    if (w.blockedURI !== v.src)
      return;
    P();
    const m = new Error(`CSP violation of policy ${w.effectiveDirective} ${w.blockedURI}. Current policy is ${w.originalPolicy}`);
    gr.UseFallbackTexture = !1, d(m), f && v.src && URL.revokeObjectURL(v.src), v.src = "";
  };
  u.push({ target: v, name: "load", handler: p }), u.push({ target: v, name: "error", handler: c }), u.push({ target: document, name: "securitypolicyviolation", handler: H }), l();
  const T = a.substring(0, 5) === "blob:", q = a.substring(0, 5) === "data:", b = () => {
    T || q || !ho.IsCustomRequestAvailable ? v.src = a : gq(a, (w, m, I) => {
      const N = !n && I ? I : n, k = new Blob([w], { type: N }), R = URL.createObjectURL(k);
      f = !0, v.src = R;
    }, void 0, r || void 0, !0, (w, m) => {
      d(m);
    });
  }, j = () => {
    r && r.loadImage(a, v);
  };
  if (!T && !q && r && r.enableTexturesOffline)
    r.open(j, b);
  else {
    if (a.indexOf("file:") !== -1) {
      const w = decodeURIComponent(a.substring(5).toLowerCase());
      if (em.FilesToLoad[w] && typeof URL < "u") {
        try {
          let m;
          try {
            m = URL.createObjectURL(em.FilesToLoad[w]);
          } catch {
            m = URL.createObjectURL(em.FilesToLoad[w]);
          }
          v.src = m, f = !0;
        } catch {
          v.src = "";
        }
        return v;
      }
    }
    b();
  }
  return v;
}, BS = (A, e, t, r, n) => {
  const i = new FileReader(), s = {
    onCompleteObservable: new Oe(),
    abort: () => i.abort()
  };
  return i.onloadend = () => s.onCompleteObservable.notifyObservers(s), n && (i.onerror = () => {
    n(new xO(`Unable to read ${A.name}`, A));
  }), i.onload = (a) => {
    e(a.target.result);
  }, t && (i.onprogress = t), r ? i.readAsArrayBuffer(A) : i.readAsText(A), s;
}, gq = (A, e, t, r, n, i, s) => {
  if (A.name)
    return BS(A, e, t, n, i ? (d) => {
      i(void 0, d);
    } : void 0);
  const a = A;
  if (a.indexOf("file:") !== -1) {
    let d = decodeURIComponent(a.substring(5).toLowerCase());
    d.indexOf("./") === 0 && (d = d.substring(2));
    const v = em.FilesToLoad[d];
    if (v)
      return BS(v, e, t, n, i ? (u) => i(void 0, new mS(u.message, u.file)) : void 0);
  }
  const { match: f, type: o } = Q$(a);
  if (f) {
    const d = {
      onCompleteObservable: new Oe(),
      abort: () => () => {
      }
    };
    try {
      const v = n ? iU(a) : zN(a);
      e(v, void 0, o);
    } catch (v) {
      i ? i(void 0, v) : Se.Error(v.message || "Failed to parse the Data URL");
    }
    return wS.SetImmediate(() => {
      d.onCompleteObservable.notifyObservers(d);
    }), d;
  }
  return jO(a, (d, v) => {
    e(d, v == null ? void 0 : v.responseURL, v == null ? void 0 : v.getResponseHeader("content-type"));
  }, t, r, n, i ? (d) => {
    i(d.request, new mS(d.message, d.request));
  } : void 0, s);
}, jO = (A, e, t, r, n, i, s) => {
  A = N$(A), A = A9.PreprocessUrl(A);
  const a = A9.BaseUrl + A;
  let f = !1;
  const o = {
    onCompleteObservable: new Oe(),
    abort: () => f = !0
  }, d = () => {
    let v = new ho(), u = null, l;
    const P = () => {
      v && (t && v.removeEventListener("progress", t), l && v.removeEventListener("readystatechange", l), v.removeEventListener("loadend", p));
    };
    let p = () => {
      P(), o.onCompleteObservable.notifyObservers(o), o.onCompleteObservable.clear(), t = void 0, l = null, p = null, i = void 0, s = void 0, e = void 0;
    };
    o.abort = () => {
      f = !0, p && p(), v && v.readyState !== (XMLHttpRequest.DONE || 4) && v.abort(), u !== null && (clearTimeout(u), u = null), v = null;
    };
    const c = (T) => {
      const q = T.message || "Unknown error";
      i && v ? i(new OI(q, v)) : Se.Error(q);
    }, H = (T) => {
      if (v) {
        if (v.open("GET", a), s)
          try {
            s(v);
          } catch (q) {
            c(q);
            return;
          }
        n && (v.responseType = "arraybuffer"), t && v.addEventListener("progress", t), p && v.addEventListener("loadend", p), l = () => {
          if (!(f || !v) && v.readyState === (XMLHttpRequest.DONE || 4)) {
            if (l && v.removeEventListener("readystatechange", l), v.status >= 200 && v.status < 300 || v.status === 0 && (!u9() || JN())) {
              try {
                e && e(n ? v.response : v.responseText, v);
              } catch (j) {
                c(j);
              }
              return;
            }
            const q = A9.DefaultRetryStrategy;
            if (q) {
              const j = q(a, v, T);
              if (j !== -1) {
                P(), v = new ho(), u = setTimeout(() => H(T + 1), j);
                return;
              }
            }
            const b = new OI("Error status: " + v.status + " " + v.statusText + " - Unable to load " + a, v);
            i && i(b);
          }
        }, v.addEventListener("readystatechange", l), v.send();
      }
    };
    H(0);
  };
  if (r && r.enableSceneOffline) {
    const v = (l) => {
      l && l.status > 400 ? i && i(l) : d();
    }, u = () => {
      r && r.loadFile(A9.BaseUrl + A, (l) => {
        !f && e && e(l), o.onCompleteObservable.notifyObservers(o);
      }, t ? (l) => {
        !f && t && t(l);
      } : void 0, v, n);
    };
    r.open(u, v);
  } else
    d();
  return o;
}, JN = () => typeof location < "u" && location.protocol === "file:", qR = (A) => F$.test(A), Q$ = (A) => {
  const e = F$.exec(A);
  return e === null || e.length === 0 ? { match: !1, type: "" } : { match: !0, type: e[0].replace("data:", "").replace("base64,", "") };
};
function iU(A) {
  return TR(A.split(",")[1]);
}
const zN = (A) => bO(A.split(",")[1]), J9e = () => {
  hr._FileToolsLoadImage = nU, hr._FileToolsLoadFile = gq, hp._FileToolsLoadFile = gq;
};
J9e();
let kW;
const Y$ = (A, e, t, r, n, i, s, a, f, o) => {
  kW = {
    DecodeBase64UrlToBinary: A,
    DecodeBase64UrlToString: e,
    DefaultRetryStrategy: t.DefaultRetryStrategy,
    BaseUrl: t.BaseUrl,
    CorsBehavior: t.CorsBehavior,
    PreprocessUrl: t.PreprocessUrl,
    IsBase64DataUrl: r,
    IsFileURL: n,
    LoadFile: i,
    LoadImage: s,
    ReadFile: a,
    RequestFile: f,
    SetCorsBehavior: o
  }, Object.defineProperty(kW, "DefaultRetryStrategy", {
    get: function() {
      return t.DefaultRetryStrategy;
    },
    set: function(d) {
      t.DefaultRetryStrategy = d;
    }
  }), Object.defineProperty(kW, "BaseUrl", {
    get: function() {
      return t.BaseUrl;
    },
    set: function(d) {
      t.BaseUrl = d;
    }
  }), Object.defineProperty(kW, "PreprocessUrl", {
    get: function() {
      return t.PreprocessUrl;
    },
    set: function(d) {
      t.PreprocessUrl = d;
    }
  }), Object.defineProperty(kW, "CorsBehavior", {
    get: function() {
      return t.CorsBehavior;
    },
    set: function(d) {
      t.CorsBehavior = d;
    }
  });
};
Y$(iU, zN, A9, qR, JN, gq, nU, BS, jO, DO);
class jI {
  /**
   * Tries to instantiate a new object from a given class name
   * @param className defines the class name to instantiate
   * @returns the new object or null if the system was not able to do the instantiation
   */
  static Instantiate(e) {
    if (this.RegisteredExternalClasses && this.RegisteredExternalClasses[e])
      return this.RegisteredExternalClasses[e];
    const t = Jo(e);
    if (t)
      return t;
    Se.Warn(e + " not found, you may have missed an import.");
    const r = e.split(".");
    let n = window || this;
    for (let i = 0, s = r.length; i < s; i++)
      n = n[r[i]];
    return typeof n != "function" ? null : n;
  }
}
jI.RegisteredExternalClasses = {};
function v4() {
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (A) => {
    const e = Math.random() * 16 | 0;
    return (A === "x" ? e : e & 3 | 8).toString(16);
  });
}
const z9e = {
  /**
   * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523
   * Be aware Math.random() could cause collisions, but:
   * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide"
   * @returns a pseudo random id
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  RandomId: v4
};
class ye {
  /**
   * Gets or sets the base URL to use to load assets
   */
  static get BaseUrl() {
    return A9.BaseUrl;
  }
  static set BaseUrl(e) {
    A9.BaseUrl = e;
  }
  /**
   * This function checks whether a URL is absolute or not.
   * It will also detect data and blob URLs
   * @param url the url to check
   * @returns is the url absolute or relative
   */
  static IsAbsoluteUrl(e) {
    return e.indexOf("//") === 0 ? !0 : e.indexOf("://") === -1 || e.indexOf(".") === -1 || e.indexOf("/") === -1 || e.indexOf(":") > e.indexOf("/") ? !1 : e.indexOf("://") < e.indexOf(".") || e.indexOf("data:") === 0 || e.indexOf("blob:") === 0;
  }
  /**
   * Sets the base URL to use to load scripts
   */
  static set ScriptBaseUrl(e) {
    A9.ScriptBaseUrl = e;
  }
  static get ScriptBaseUrl() {
    return A9.ScriptBaseUrl;
  }
  /**
   * Sets a preprocessing function to run on a source URL before importing it
   * Note that this function will execute AFTER the base URL is appended to the URL
   */
  static set ScriptPreprocessUrl(e) {
    A9.ScriptPreprocessUrl = e;
  }
  static get ScriptPreprocessUrl() {
    return A9.ScriptPreprocessUrl;
  }
  /**
   * Gets or sets the retry strategy to apply when an error happens while loading an asset
   */
  static get DefaultRetryStrategy() {
    return A9.DefaultRetryStrategy;
  }
  static set DefaultRetryStrategy(e) {
    A9.DefaultRetryStrategy = e;
  }
  /**
   * Default behavior for cors in the application.
   * It can be a string if the expected behavior is identical in the entire app.
   * Or a callback to be able to set it per url or on a group of them (in case of Video source for instance)
   */
  static get CorsBehavior() {
    return A9.CorsBehavior;
  }
  static set CorsBehavior(e) {
    A9.CorsBehavior = e;
  }
  /**
   * Gets or sets a global variable indicating if fallback texture must be used when a texture cannot be loaded
   * @ignorenaming
   */
  static get UseFallbackTexture() {
    return gr.UseFallbackTexture;
  }
  static set UseFallbackTexture(e) {
    gr.UseFallbackTexture = e;
  }
  /**
   * Use this object to register external classes like custom textures or material
   * to allow the loaders to instantiate them
   */
  static get RegisteredExternalClasses() {
    return jI.RegisteredExternalClasses;
  }
  static set RegisteredExternalClasses(e) {
    jI.RegisteredExternalClasses = e;
  }
  /**
   * Texture content used if a texture cannot loaded
   * @ignorenaming
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static get fallbackTexture() {
    return gr.FallbackTexture;
  }
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static set fallbackTexture(e) {
    gr.FallbackTexture = e;
  }
  /**
   * Read the content of a byte array at a specified coordinates (taking in account wrapping)
   * @param u defines the coordinate on X axis
   * @param v defines the coordinate on Y axis
   * @param width defines the width of the source data
   * @param height defines the height of the source data
   * @param pixels defines the source byte array
   * @param color defines the output color
   */
  static FetchToRef(e, t, r, n, i, s) {
    const a = Math.abs(e) * r % r | 0, f = Math.abs(t) * n % n | 0, o = (a + f * r) * 4;
    s.r = i[o] / 255, s.g = i[o + 1] / 255, s.b = i[o + 2] / 255, s.a = i[o + 3] / 255;
  }
  /**
   * Interpolates between a and b via alpha
   * @param a The lower value (returned when alpha = 0)
   * @param b The upper value (returned when alpha = 1)
   * @param alpha The interpolation-factor
   * @returns The mixed value
   */
  static Mix(e, t, r) {
    return e * (1 - r) + t * r;
  }
  /**
   * Tries to instantiate a new object from a given class name
   * @param className defines the class name to instantiate
   * @returns the new object or null if the system was not able to do the instantiation
   */
  static Instantiate(e) {
    return jI.Instantiate(e);
  }
  /**
   * Polyfill for setImmediate
   * @param action defines the action to execute after the current execution block
   */
  static SetImmediate(e) {
    wS.SetImmediate(e);
  }
  /**
   * Function indicating if a number is an exponent of 2
   * @param value defines the value to test
   * @returns true if the value is an exponent of 2
   */
  static IsExponentOfTwo(e) {
    let t = 1;
    do
      t *= 2;
    while (t < e);
    return t === e;
  }
  /**
   * Returns the nearest 32-bit single precision float representation of a Number
   * @param value A Number.  If the parameter is of a different type, it will get converted
   * to a number or to NaN if it cannot be converted
   * @returns number
   */
  static FloatRound(e) {
    return Math.fround(e);
  }
  /**
   * Extracts the filename from a path
   * @param path defines the path to use
   * @returns the filename
   */
  static GetFilename(e) {
    const t = e.lastIndexOf("/");
    return t < 0 ? e : e.substring(t + 1);
  }
  /**
   * Extracts the "folder" part of a path (everything before the filename).
   * @param uri The URI to extract the info from
   * @param returnUnchangedIfNoSlash Do not touch the URI if no slashes are present
   * @returns The "folder" part of the path
   */
  static GetFolderPath(e, t = !1) {
    const r = e.lastIndexOf("/");
    return r < 0 ? t ? e : "" : e.substring(0, r + 1);
  }
  /**
   * Convert an angle in radians to degrees
   * @param angle defines the angle to convert
   * @returns the angle in degrees
   */
  static ToDegrees(e) {
    return e * 180 / Math.PI;
  }
  /**
   * Convert an angle in degrees to radians
   * @param angle defines the angle to convert
   * @returns the angle in radians
   */
  static ToRadians(e) {
    return e * Math.PI / 180;
  }
  /**
   * Smooth angle changes (kind of low-pass filter), in particular for device orientation "shaking"
   * Use trigonometric functions to avoid discontinuity (0/360, -180/180)
   * @param previousAngle defines last angle value, in degrees
   * @param newAngle defines new angle value, in degrees
   * @param smoothFactor defines smoothing sensitivity; min 0: no smoothing, max 1: new data ignored
   * @returns the angle in degrees
   */
  static SmoothAngleChange(e, t, r = 0.9) {
    const n = this.ToRadians(e), i = this.ToRadians(t);
    return this.ToDegrees(Math.atan2((1 - r) * Math.sin(i) + r * Math.sin(n), (1 - r) * Math.cos(i) + r * Math.cos(n)));
  }
  /**
   * Returns an array if obj is not an array
   * @param obj defines the object to evaluate as an array
   * @param allowsNullUndefined defines a boolean indicating if obj is allowed to be null or undefined
   * @returns either obj directly if obj is an array or a new array containing obj
   */
  static MakeArray(e, t) {
    return t !== !0 && (e === void 0 || e == null) ? null : Array.isArray(e) ? e : [e];
  }
  /**
   * Gets the pointer prefix to use
   * @param engine defines the engine we are finding the prefix for
   * @returns "pointer" if touch is enabled. Else returns "mouse"
   */
  static GetPointerPrefix(e) {
    let t = "pointer";
    return u9() && !window.PointerEvent && (t = "mouse"), e._badDesktopOS && !e._badOS && // And not ipad pros who claim to be macs...
    !(document && "ontouchend" in document) && (t = "mouse"), t;
  }
  /**
   * Sets the cors behavior on a dom element. This will add the required Tools.CorsBehavior to the element.
   * @param url define the url we are trying
   * @param element define the dom element where to configure the cors policy
   * @param element.crossOrigin
   */
  static SetCorsBehavior(e, t) {
    DO(e, t);
  }
  /**
   * Sets the referrerPolicy behavior on a dom element.
   * @param referrerPolicy define the referrer policy to use
   * @param element define the dom element where to configure the referrer policy
   * @param element.referrerPolicy
   */
  static SetReferrerPolicyBehavior(e, t) {
    t.referrerPolicy = e;
  }
  // External files
  /**
   * Removes unwanted characters from an url
   * @param url defines the url to clean
   * @returns the cleaned url
   */
  static CleanUrl(e) {
    return e = e.replace(/#/gm, "%23"), e;
  }
  /**
   * Gets or sets a function used to pre-process url before using them to load assets
   */
  static get PreprocessUrl() {
    return A9.PreprocessUrl;
  }
  static set PreprocessUrl(e) {
    A9.PreprocessUrl = e;
  }
  /**
   * Loads an image as an HTMLImageElement.
   * @param input url string, ArrayBuffer, or Blob to load
   * @param onLoad callback called when the image successfully loads
   * @param onError callback called when the image fails to load
   * @param offlineProvider offline provider for caching
   * @param mimeType optional mime type
   * @param imageBitmapOptions optional the options to use when creating an ImageBitmap
   * @returns the HTMLImageElement of the loaded image
   */
  static LoadImage(e, t, r, n, i, s) {
    return nU(e, t, r, n, i, s);
  }
  /**
   * Loads a file from a url
   * @param url url string, ArrayBuffer, or Blob to load
   * @param onSuccess callback called when the file successfully loads
   * @param onProgress callback called while file is loading (if the server supports this mode)
   * @param offlineProvider defines the offline provider for caching
   * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
   * @param onError callback called when the file fails to load
   * @returns a file request object
   */
  static LoadFile(e, t, r, n, i, s) {
    return gq(e, t, r, n, i, s);
  }
  /**
   * Loads a file from a url
   * @param url the file url to load
   * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
   * @returns a promise containing an ArrayBuffer corresponding to the loaded file
   */
  static LoadFileAsync(e, t = !0) {
    return new Promise((r, n) => {
      gq(e, (i) => {
        r(i);
      }, void 0, void 0, t, (i, s) => {
        n(s);
      });
    });
  }
  /**
   * Get a script URL including preprocessing
   * @param scriptUrl the script Url to process
   * @returns a modified URL to use
   */
  static GetBabylonScriptURL(e, t) {
    if (!e)
      return "";
    if (ye.ScriptBaseUrl && e.startsWith(ye._DefaultCdnUrl)) {
      const r = ye.ScriptBaseUrl[ye.ScriptBaseUrl.length - 1] === "/" ? ye.ScriptBaseUrl.substring(0, ye.ScriptBaseUrl.length - 1) : ye.ScriptBaseUrl;
      e = e.replace(ye._DefaultCdnUrl, r);
    }
    return e = ye.ScriptPreprocessUrl(e), t && (e = ye.GetAbsoluteUrl(e)), e;
  }
  /**
   * This function is used internally by babylon components to load a script (identified by an url). When the url returns, the
   * content of this file is added into a new script element, attached to the DOM (body element)
   * @param scriptUrl defines the url of the script to load
   * @param onSuccess defines the callback called when the script is loaded
   * @param onError defines the callback to call if an error occurs
   * @param scriptId defines the id of the script element
   */
  static LoadBabylonScript(e, t, r, n) {
    e = ye.GetBabylonScriptURL(e), ye.LoadScript(e, t, r);
  }
  /**
   * Load an asynchronous script (identified by an url). When the url returns, the
   * content of this file is added into a new script element, attached to the DOM (body element)
   * @param scriptUrl defines the url of the script to laod
   * @returns a promise request object
   */
  static LoadBabylonScriptAsync(e) {
    return e = ye.GetBabylonScriptURL(e), ye.LoadScriptAsync(e);
  }
  /**
   * This function is used internally by babylon components to load a script (identified by an url). When the url returns, the
   * content of this file is added into a new script element, attached to the DOM (body element)
   * @param scriptUrl defines the url of the script to load
   * @param onSuccess defines the callback called when the script is loaded
   * @param onError defines the callback to call if an error occurs
   * @param scriptId defines the id of the script element
   */
  static LoadScript(e, t, r, n) {
    if (typeof importScripts == "function") {
      try {
        importScripts(e), t();
      } catch (a) {
        r == null || r(`Unable to load script '${e}' in worker`, a);
      }
      return;
    } else if (!u9()) {
      r == null || r(`Cannot load script '${e}' outside of a window or a worker`);
      return;
    }
    const i = document.getElementsByTagName("head")[0], s = document.createElement("script");
    s.setAttribute("type", "text/javascript"), s.setAttribute("src", e), n && (s.id = n), s.onload = () => {
      t && t();
    }, s.onerror = (a) => {
      r && r(`Unable to load script '${e}'`, a);
    }, i.appendChild(s);
  }
  /**
   * Load an asynchronous script (identified by an url). When the url returns, the
   * content of this file is added into a new script element, attached to the DOM (body element)
   * @param scriptUrl defines the url of the script to laod
   * @returns a promise request object
   */
  static LoadScriptAsync(e) {
    return new Promise((t, r) => {
      this.LoadScript(e, () => {
        t();
      }, (n, i) => {
        r(i || new Error(n));
      });
    });
  }
  /**
   * Loads a file from a blob
   * @param fileToLoad defines the blob to use
   * @param callback defines the callback to call when data is loaded
   * @param progressCallback defines the callback to call during loading process
   * @returns a file request object
   */
  static ReadFileAsDataURL(e, t, r) {
    const n = new FileReader(), i = {
      onCompleteObservable: new Oe(),
      abort: () => n.abort()
    };
    return n.onloadend = () => {
      i.onCompleteObservable.notifyObservers(i);
    }, n.onload = (s) => {
      t(s.target.result);
    }, n.onprogress = r, n.readAsDataURL(e), i;
  }
  /**
   * Reads a file from a File object
   * @param file defines the file to load
   * @param onSuccess defines the callback to call when data is loaded
   * @param onProgress defines the callback to call during loading process
   * @param useArrayBuffer defines a boolean indicating that data must be returned as an ArrayBuffer
   * @param onError defines the callback to call when an error occurs
   * @returns a file request object
   */
  static ReadFile(e, t, r, n, i) {
    return BS(e, t, r, n, i);
  }
  /**
   * Creates a data url from a given string content
   * @param content defines the content to convert
   * @returns the new data url link
   */
  static FileAsURL(e) {
    const t = new Blob([e]);
    return window.URL.createObjectURL(t);
  }
  /**
   * Format the given number to a specific decimal format
   * @param value defines the number to format
   * @param decimals defines the number of decimals to use
   * @returns the formatted string
   */
  static Format(e, t = 2) {
    return e.toFixed(t);
  }
  /**
   * Tries to copy an object by duplicating every property
   * @param source defines the source object
   * @param destination defines the target object
   * @param doNotCopyList defines a list of properties to avoid
   * @param mustCopyList defines a list of properties to copy (even if they start with _)
   */
  static DeepCopy(e, t, r, n) {
    sA.DeepCopy(e, t, r, n);
  }
  /**
   * Gets a boolean indicating if the given object has no own property
   * @param obj defines the object to test
   * @returns true if object has no own property
   */
  static IsEmpty(e) {
    for (const t in e)
      if (Object.prototype.hasOwnProperty.call(e, t))
        return !1;
    return !0;
  }
  /**
   * Function used to register events at window level
   * @param windowElement defines the Window object to use
   * @param events defines the events to register
   */
  static RegisterTopRootEvents(e, t) {
    for (let r = 0; r < t.length; r++) {
      const n = t[r];
      e.addEventListener(n.name, n.handler, !1);
      try {
        window.parent && window.parent.addEventListener(n.name, n.handler, !1);
      } catch {
      }
    }
  }
  /**
   * Function used to unregister events from window level
   * @param windowElement defines the Window object to use
   * @param events defines the events to unregister
   */
  static UnregisterTopRootEvents(e, t) {
    for (let r = 0; r < t.length; r++) {
      const n = t[r];
      e.removeEventListener(n.name, n.handler);
      try {
        e.parent && e.parent.removeEventListener(n.name, n.handler);
      } catch {
      }
    }
  }
  /**
   * Dumps the current bound framebuffer
   * @param width defines the rendering width
   * @param height defines the rendering height
   * @param engine defines the hosting engine
   * @param successCallback defines the callback triggered once the data are available
   * @param mimeType defines the mime type of the result
   * @param fileName defines the filename to download. If present, the result will automatically be downloaded
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   * @returns a void promise
   */
  static async DumpFramebuffer(e, t, r, n, i = "image/png", s, a) {
    throw qn("DumpTools");
  }
  /**
   * Dumps an array buffer
   * @param width defines the rendering width
   * @param height defines the rendering height
   * @param data the data array
   * @param successCallback defines the callback triggered once the data are available
   * @param mimeType defines the mime type of the result
   * @param fileName defines the filename to download. If present, the result will automatically be downloaded
   * @param invertY true to invert the picture in the Y dimension
   * @param toArrayBuffer true to convert the data to an ArrayBuffer (encoded as `mimeType`) instead of a base64 string
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   */
  static DumpData(e, t, r, n, i = "image/png", s, a = !1, f = !1, o) {
    throw qn("DumpTools");
  }
  /**
   * Dumps an array buffer
   * @param width defines the rendering width
   * @param height defines the rendering height
   * @param data the data array
   * @param mimeType defines the mime type of the result
   * @param fileName defines the filename to download. If present, the result will automatically be downloaded
   * @param invertY true to invert the picture in the Y dimension
   * @param toArrayBuffer true to convert the data to an ArrayBuffer (encoded as `mimeType`) instead of a base64 string
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   * @returns a promise that resolve to the final data
   */
  static DumpDataAsync(e, t, r, n = "image/png", i, s = !1, a = !1, f) {
    throw qn("DumpTools");
  }
  static _IsOffScreenCanvas(e) {
    return e.convertToBlob !== void 0;
  }
  /**
   * Converts the canvas data to blob.
   * This acts as a polyfill for browsers not supporting the to blob function.
   * @param canvas Defines the canvas to extract the data from (can be an offscreen canvas)
   * @param successCallback Defines the callback triggered once the data are available
   * @param mimeType Defines the mime type of the result
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   */
  static ToBlob(e, t, r = "image/png", n) {
    !ye._IsOffScreenCanvas(e) && !e.toBlob && (e.toBlob = function(i, s, a) {
      setTimeout(() => {
        const f = atob(this.toDataURL(s, a).split(",")[1]), o = f.length, d = new Uint8Array(o);
        for (let v = 0; v < o; v++)
          d[v] = f.charCodeAt(v);
        i(new Blob([d]));
      });
    }), ye._IsOffScreenCanvas(e) ? e.convertToBlob({
      type: r,
      quality: n
    }).then((i) => t(i)) : e.toBlob(function(i) {
      t(i);
    }, r, n);
  }
  /**
   * Download a Blob object
   * @param blob the Blob object
   * @param fileName the file name to download
   * @returns
   */
  static DownloadBlob(e, t) {
    if ("download" in document.createElement("a")) {
      if (!t) {
        const r = /* @__PURE__ */ new Date();
        t = "screenshot_" + ((r.getFullYear() + "-" + (r.getMonth() + 1)).slice(2) + "-" + r.getDate() + "_" + r.getHours() + "-" + ("0" + r.getMinutes()).slice(-2)) + ".png";
      }
      ye.Download(e, t);
    } else if (e && typeof URL < "u") {
      const r = URL.createObjectURL(e), n = window.open("");
      if (!n)
        return;
      const i = n.document.createElement("img");
      i.onload = function() {
        URL.revokeObjectURL(r);
      }, i.src = r, n.document.body.appendChild(i);
    }
  }
  /**
   * Encodes the canvas data to base 64, or automatically downloads the result if `fileName` is defined.
   * @param canvas The canvas to get the data from, which can be an offscreen canvas.
   * @param successCallback The callback which is triggered once the data is available. If `fileName` is defined, the callback will be invoked after the download occurs, and the `data` argument will be an empty string.
   * @param mimeType The mime type of the result.
   * @param fileName The name of the file to download. If defined, the result will automatically be downloaded. If not defined, and `successCallback` is also not defined, the result will automatically be downloaded with an auto-generated file name.
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   */
  static EncodeScreenshotCanvasData(e, t, r = "image/png", n, i) {
    if (typeof n == "string" || !t)
      this.ToBlob(e, function(s) {
        s && ye.DownloadBlob(s, n), t && t("");
      }, r, i);
    else if (t) {
      if (ye._IsOffScreenCanvas(e)) {
        e.convertToBlob({
          type: r,
          quality: i
        }).then((a) => {
          const f = new FileReader();
          f.readAsDataURL(a), f.onloadend = () => {
            const o = f.result;
            t(o);
          };
        });
        return;
      }
      const s = e.toDataURL(r, i);
      t(s);
    }
  }
  /**
   * Downloads a blob in the browser
   * @param blob defines the blob to download
   * @param fileName defines the name of the downloaded file
   */
  static Download(e, t) {
    if (typeof URL > "u")
      return;
    const r = window.URL.createObjectURL(e), n = document.createElement("a");
    document.body.appendChild(n), n.style.display = "none", n.href = r, n.download = t, n.addEventListener("click", () => {
      n.parentElement && n.parentElement.removeChild(n);
    }), n.click(), window.URL.revokeObjectURL(r);
  }
  /**
   * Will return the right value of the noPreventDefault variable
   * Needed to keep backwards compatibility to the old API.
   *
   * @param args arguments passed to the attachControl function
   * @returns the correct value for noPreventDefault
   */
  static BackCompatCameraNoPreventDefault(e) {
    return typeof e[0] == "boolean" ? e[0] : typeof e[1] == "boolean" ? e[1] : !1;
  }
  /**
   * Captures a screenshot of the current rendering
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
   * @param engine defines the rendering engine
   * @param camera defines the source camera
   * @param size This parameter can be set to a single number or to an object with the
   * following (optional) properties: precision, width, height. If a single number is passed,
   * it will be used for both width and height. If an object is passed, the screenshot size
   * will be derived from the parameters. The precision property is a multiplier allowing
   * rendering at a higher or lower resolution
   * @param successCallback defines the callback receives a single parameter which contains the
   * screenshot as a string of base64-encoded characters. This string can be assigned to the
   * src parameter of an <img> to display it
   * @param mimeType defines the MIME type of the screenshot image (default: image/png).
   * Check your browser for supported MIME types
   * @param forceDownload force the system to download the image even if a successCallback is provided
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static CreateScreenshot(e, t, r, n, i = "image/png", s = !1, a) {
    throw qn("ScreenshotTools");
  }
  /**
   * Captures a screenshot of the current rendering
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
   * @param engine defines the rendering engine
   * @param camera defines the source camera
   * @param size This parameter can be set to a single number or to an object with the
   * following (optional) properties: precision, width, height. If a single number is passed,
   * it will be used for both width and height. If an object is passed, the screenshot size
   * will be derived from the parameters. The precision property is a multiplier allowing
   * rendering at a higher or lower resolution
   * @param mimeType defines the MIME type of the screenshot image (default: image/png).
   * Check your browser for supported MIME types
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   * @returns screenshot as a string of base64-encoded characters. This string can be assigned
   * to the src parameter of an <img> to display it
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static CreateScreenshotAsync(e, t, r, n = "image/png", i) {
    throw qn("ScreenshotTools");
  }
  /**
   * Generates an image screenshot from the specified camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
   * @param engine The engine to use for rendering
   * @param camera The camera to use for rendering
   * @param size This parameter can be set to a single number or to an object with the
   * following (optional) properties: precision, width, height. If a single number is passed,
   * it will be used for both width and height. If an object is passed, the screenshot size
   * will be derived from the parameters. The precision property is a multiplier allowing
   * rendering at a higher or lower resolution
   * @param successCallback The callback receives a single parameter which contains the
   * screenshot as a string of base64-encoded characters. This string can be assigned to the
   * src parameter of an <img> to display it
   * @param mimeType The MIME type of the screenshot image (default: image/png).
   * Check your browser for supported MIME types
   * @param samples Texture samples (default: 1)
   * @param antialiasing Whether antialiasing should be turned on or not (default: false)
   * @param fileName A name for for the downloaded file.
   * @param renderSprites Whether the sprites should be rendered or not (default: false)
   * @param enableStencilBuffer Whether the stencil buffer should be enabled or not (default: false)
   * @param useLayerMask if the camera's layer mask should be used to filter what should be rendered (default: true)
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static CreateScreenshotUsingRenderTarget(e, t, r, n, i = "image/png", s = 1, a = !1, f, o = !1, d = !1, v = !0, u) {
    throw qn("ScreenshotTools");
  }
  /**
   * Generates an image screenshot from the specified camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
   * @param engine The engine to use for rendering
   * @param camera The camera to use for rendering
   * @param size This parameter can be set to a single number or to an object with the
   * following (optional) properties: precision, width, height. If a single number is passed,
   * it will be used for both width and height. If an object is passed, the screenshot size
   * will be derived from the parameters. The precision property is a multiplier allowing
   * rendering at a higher or lower resolution
   * @param mimeType The MIME type of the screenshot image (default: image/png).
   * Check your browser for supported MIME types
   * @param samples Texture samples (default: 1)
   * @param antialiasing Whether antialiasing should be turned on or not (default: false)
   * @param fileName A name for for the downloaded file.
   * @returns screenshot as a string of base64-encoded characters. This string can be assigned
   * @param renderSprites Whether the sprites should be rendered or not (default: false)
   * @param enableStencilBuffer Whether the stencil buffer should be enabled or not (default: false)
   * @param useLayerMask if the camera's layer mask should be used to filter what should be rendered (default: true)
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   * to the src parameter of an <img> to display it
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static CreateScreenshotUsingRenderTargetAsync(e, t, r, n = "image/png", i = 1, s = !1, a, f = !1, o = !1, d = !0, v) {
    throw qn("ScreenshotTools");
  }
  /**
   * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523
   * Be aware Math.random() could cause collisions, but:
   * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide"
   * @returns a pseudo random id
   */
  static RandomId() {
    return v4();
  }
  /**
   * Test if the given uri is a base64 string
   * @deprecated Please use FileTools.IsBase64DataUrl instead.
   * @param uri The uri to test
   * @returns True if the uri is a base64 string or false otherwise
   */
  static IsBase64(e) {
    return qR(e);
  }
  /**
   * Decode the given base64 uri.
   * @deprecated Please use FileTools.DecodeBase64UrlToBinary instead.
   * @param uri The uri to decode
   * @returns The decoded base64 data.
   */
  static DecodeBase64(e) {
    return iU(e);
  }
  /**
   * Gets a value indicating the number of loading errors
   * @ignorenaming
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static get errorsCount() {
    return Se.errorsCount;
  }
  /**
   * Log a message to the console
   * @param message defines the message to log
   */
  static Log(e) {
    Se.Log(e);
  }
  /**
   * Write a warning message to the console
   * @param message defines the message to log
   */
  static Warn(e) {
    Se.Warn(e);
  }
  /**
   * Write an error message to the console
   * @param message defines the message to log
   */
  static Error(e) {
    Se.Error(e);
  }
  /**
   * Gets current log cache (list of logs)
   */
  static get LogCache() {
    return Se.LogCache;
  }
  /**
   * Clears the log cache
   */
  static ClearLogCache() {
    Se.ClearLogCache();
  }
  /**
   * Sets the current log level (MessageLogLevel / WarningLogLevel / ErrorLogLevel)
   */
  static set LogLevels(e) {
    Se.LogLevels = e;
  }
  /**
   * Sets the current performance log level
   */
  static set PerformanceLogLevel(e) {
    if ((e & ye.PerformanceUserMarkLogLevel) === ye.PerformanceUserMarkLogLevel) {
      ye.StartPerformanceCounter = ye._StartUserMark, ye.EndPerformanceCounter = ye._EndUserMark;
      return;
    }
    if ((e & ye.PerformanceConsoleLogLevel) === ye.PerformanceConsoleLogLevel) {
      ye.StartPerformanceCounter = ye._StartPerformanceConsole, ye.EndPerformanceCounter = ye._EndPerformanceConsole;
      return;
    }
    ye.StartPerformanceCounter = ye._StartPerformanceCounterDisabled, ye.EndPerformanceCounter = ye._EndPerformanceCounterDisabled;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static _StartPerformanceCounterDisabled(e, t) {
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static _EndPerformanceCounterDisabled(e, t) {
  }
  static _StartUserMark(e, t = !0) {
    if (!ye._Performance) {
      if (!u9())
        return;
      ye._Performance = window.performance;
    }
    !t || !ye._Performance.mark || ye._Performance.mark(e + "-Begin");
  }
  static _EndUserMark(e, t = !0) {
    !t || !ye._Performance.mark || (ye._Performance.mark(e + "-End"), ye._Performance.measure(e, e + "-Begin", e + "-End"));
  }
  static _StartPerformanceConsole(e, t = !0) {
    t && (ye._StartUserMark(e, t), console.time && console.time(e));
  }
  static _EndPerformanceConsole(e, t = !0) {
    t && (ye._EndUserMark(e, t), console.timeEnd(e));
  }
  /**
   * Gets either window.performance.now() if supported or Date.now() else
   */
  static get Now() {
    return Yi.Now;
  }
  /**
   * This method will return the name of the class used to create the instance of the given object.
   * It will works only on Javascript basic data types (number, string, ...) and instance of class declared with the @className decorator.
   * @param object the object to get the class name from
   * @param isType defines if the object is actually a type
   * @returns the name of the class, will be "object" for a custom data type not using the @className decorator
   */
  static GetClassName(e, t = !1) {
    let r = null;
    return !t && e.getClassName ? r = e.getClassName() : (e instanceof Object && (r = (t ? e : Object.getPrototypeOf(e)).constructor.__bjsclassName__), r || (r = typeof e)), r;
  }
  /**
   * Gets the first element of an array satisfying a given predicate
   * @param array defines the array to browse
   * @param predicate defines the predicate to use
   * @returns null if not found or the element
   */
  static First(e, t) {
    for (const r of e)
      if (t(r))
        return r;
    return null;
  }
  /**
   * This method will return the name of the full name of the class, including its owning module (if any).
   * It will works only on Javascript basic data types (number, string, ...) and instance of class declared with the @className decorator or implementing a method getClassName():string (in which case the module won't be specified).
   * @param object the object to get the class name from
   * @param isType defines if the object is actually a type
   * @returns a string that can have two forms: "moduleName.className" if module was specified when the class' Name was registered or "className" if there was not module specified.
   * @ignorenaming
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static getFullClassName(e, t = !1) {
    let r = null, n = null;
    if (!t && e.getClassName)
      r = e.getClassName();
    else {
      if (e instanceof Object) {
        const i = t ? e : Object.getPrototypeOf(e);
        r = i.constructor.__bjsclassName__, n = i.constructor.__bjsmoduleName__;
      }
      r || (r = typeof e);
    }
    return r ? (n != null ? n + "." : "") + r : null;
  }
  /**
   * Returns a promise that resolves after the given amount of time.
   * @param delay Number of milliseconds to delay
   * @returns Promise that resolves after the given amount of time
   */
  static DelayAsync(e) {
    return new Promise((t) => {
      setTimeout(() => {
        t();
      }, e);
    });
  }
  /**
   * Utility function to detect if the current user agent is Safari
   * @returns whether or not the current user agent is safari
   */
  static IsSafari() {
    return Mw() ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
  }
}
ye.UseCustomRequestHeaders = !1;
ye.CustomRequestHeaders = ho.CustomRequestHeaders;
ye.GetDOMTextContent = gR;
ye._DefaultCdnUrl = "https://cdn.babylonjs.com";
ye.GetAbsoluteUrl = typeof document == "object" ? (A) => {
  const e = document.createElement("a");
  return e.href = A, e.href;
} : typeof URL == "function" && typeof location == "object" ? (A) => new URL(A, location.origin).href : () => {
  throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.");
};
ye.NoneLogLevel = Se.NoneLogLevel;
ye.MessageLogLevel = Se.MessageLogLevel;
ye.WarningLogLevel = Se.WarningLogLevel;
ye.ErrorLogLevel = Se.ErrorLogLevel;
ye.AllLogLevel = Se.AllLogLevel;
ye.IsWindowObjectExist = u9;
ye.PerformanceNoneLogLevel = 0;
ye.PerformanceUserMarkLogLevel = 1;
ye.PerformanceConsoleLogLevel = 2;
ye.StartPerformanceCounter = ye._StartPerformanceCounterDisabled;
ye.EndPerformanceCounter = ye._EndPerformanceCounterDisabled;
function G9e(A, e) {
  return (t) => {
    t.__bjsclassName__ = A, t.__bjsmoduleName__ = e ?? null;
  };
}
class up {
  /**
   * Constructor.
   * @param iterations the number of iterations.
   * @param func the function to run each iteration
   * @param successCallback the callback that will be called upon successful execution
   * @param offset starting offset.
   */
  constructor(e, t, r, n = 0) {
    this.iterations = e, this.index = n - 1, this._done = !1, this._fn = t, this._successCallback = r;
  }
  /**
   * Execute the next iteration. Must be called after the last iteration was finished.
   */
  executeNext() {
    this._done || (this.index + 1 < this.iterations ? (++this.index, this._fn(this)) : this.breakLoop());
  }
  /**
   * Break the loop and run the success callback.
   */
  breakLoop() {
    this._done = !0, this._successCallback();
  }
  /**
   * Create and run an async loop.
   * @param iterations the number of iterations.
   * @param fn the function to run each iteration
   * @param successCallback the callback that will be called upon successful execution
   * @param offset starting offset.
   * @returns the created async loop object
   */
  static Run(e, t, r, n = 0) {
    const i = new up(e, t, r, n);
    return i.executeNext(), i;
  }
  /**
   * A for-loop that will run a given number of iterations synchronous and the rest async.
   * @param iterations total number of iterations
   * @param syncedIterations number of synchronous iterations in each async iteration.
   * @param fn the function to call each iteration.
   * @param callback a success call back that will be called when iterating stops.
   * @param breakFunction a break condition (optional)
   * @param timeout timeout settings for the setTimeout function. default - 0.
   * @returns the created async loop object
   */
  static SyncAsyncForLoop(e, t, r, n, i, s = 0) {
    return up.Run(Math.ceil(e / t), (a) => {
      i && i() ? a.breakLoop() : setTimeout(() => {
        for (let f = 0; f < t; ++f) {
          const o = a.index * t + f;
          if (o >= e)
            break;
          if (r(o), i && i()) {
            a.breakLoop();
            break;
          }
        }
        a.executeNext();
      }, s);
    }, n);
  }
}
gr.FallbackTexture = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z";
class qf {
  /**
   * Instantiates a Smart Array.
   * @param capacity defines the default capacity of the array.
   */
  constructor(e) {
    this.length = 0, this.data = new Array(e), this._id = qf._GlobalId++;
  }
  /**
   * Pushes a value at the end of the active data.
   * @param value defines the object to push in the array.
   */
  push(e) {
    this.data[this.length++] = e, this.length > this.data.length && (this.data.length *= 2);
  }
  /**
   * Iterates over the active data and apply the lambda to them.
   * @param func defines the action to apply on each value.
   */
  forEach(e) {
    for (let t = 0; t < this.length; t++)
      e(this.data[t]);
  }
  /**
   * Sorts the full sets of data.
   * @param compareFn defines the comparison function to apply.
   */
  sort(e) {
    this.data.sort(e);
  }
  /**
   * Resets the active data to an empty array.
   */
  reset() {
    this.length = 0;
  }
  /**
   * Releases all the data from the array as well as the array.
   */
  dispose() {
    this.reset(), this.data && (this.data.length = 0);
  }
  /**
   * Concats the active data with a given array.
   * @param array defines the data to concatenate with.
   */
  concat(e) {
    if (e.length !== 0) {
      this.length + e.length > this.data.length && (this.data.length = (this.length + e.length) * 2);
      for (let t = 0; t < e.length; t++)
        this.data[this.length++] = (e.data || e)[t];
    }
  }
  /**
   * Returns the position of a value in the active data.
   * @param value defines the value to find the index for
   * @returns the index if found in the active data otherwise -1
   */
  indexOf(e) {
    const t = this.data.indexOf(e);
    return t >= this.length ? -1 : t;
  }
  /**
   * Returns whether an element is part of the active data.
   * @param value defines the value to look for
   * @returns true if found in the active data otherwise false
   */
  contains(e) {
    return this.indexOf(e) !== -1;
  }
}
qf._GlobalId = 0;
class K8 extends qf {
  constructor() {
    super(...arguments), this._duplicateId = 0;
  }
  /**
   * Pushes a value at the end of the active data.
   * THIS DOES NOT PREVENT DUPPLICATE DATA
   * @param value defines the object to push in the array.
   */
  push(e) {
    super.push(e), e.__smartArrayFlags || (e.__smartArrayFlags = {}), e.__smartArrayFlags[this._id] = this._duplicateId;
  }
  /**
   * Pushes a value at the end of the active data.
   * If the data is already present, it won t be added again
   * @param value defines the object to push in the array.
   * @returns true if added false if it was already present
   */
  pushNoDuplicate(e) {
    return e.__smartArrayFlags && e.__smartArrayFlags[this._id] === this._duplicateId ? !1 : (this.push(e), !0);
  }
  /**
   * Resets the active data to an empty array.
   */
  reset() {
    super.reset(), this._duplicateId++;
  }
  /**
   * Concats the active data with a given array.
   * This ensures no duplicate will be present in the result.
   * @param array defines the data to concatenate with.
   */
  concatWithNoDuplicate(e) {
    if (e.length !== 0) {
      this.length + e.length > this.data.length && (this.data.length = (this.length + e.length) * 2);
      for (let t = 0; t < e.length; t++) {
        const r = (e.data || e)[t];
        this.pushNoDuplicate(r);
      }
    }
  }
}
class YC {
  constructor() {
    this._count = 0, this._data = {};
  }
  /**
   * This will clear this dictionary and copy the content from the 'source' one.
   * If the T value is a custom object, it won't be copied/cloned, the same object will be used
   * @param source the dictionary to take the content from and copy to this dictionary
   */
  copyFrom(e) {
    this.clear(), e.forEach((t, r) => this.add(t, r));
  }
  /**
   * Get a value based from its key
   * @param key the given key to get the matching value from
   * @returns the value if found, otherwise undefined is returned
   */
  get(e) {
    const t = this._data[e];
    if (t !== void 0)
      return t;
  }
  /**
   * Get a value from its key or add it if it doesn't exist.
   * This method will ensure you that a given key/data will be present in the dictionary.
   * @param key the given key to get the matching value from
   * @param factory the factory that will create the value if the key is not present in the dictionary.
   * The factory will only be invoked if there's no data for the given key.
   * @returns the value corresponding to the key.
   */
  getOrAddWithFactory(e, t) {
    let r = this.get(e);
    return r !== void 0 || (r = t(e), r && this.add(e, r)), r;
  }
  /**
   * Get a value from its key if present in the dictionary otherwise add it
   * @param key the key to get the value from
   * @param val if there's no such key/value pair in the dictionary add it with this value
   * @returns the value corresponding to the key
   */
  getOrAdd(e, t) {
    const r = this.get(e);
    return r !== void 0 ? r : (this.add(e, t), t);
  }
  /**
   * Check if there's a given key in the dictionary
   * @param key the key to check for
   * @returns true if the key is present, false otherwise
   */
  contains(e) {
    return this._data[e] !== void 0;
  }
  /**
   * Add a new key and its corresponding value
   * @param key the key to add
   * @param value the value corresponding to the key
   * @returns true if the operation completed successfully, false if we couldn't insert the key/value because there was already this key in the dictionary
   */
  add(e, t) {
    return this._data[e] !== void 0 ? !1 : (this._data[e] = t, ++this._count, !0);
  }
  /**
   * Update a specific value associated to a key
   * @param key defines the key to use
   * @param value defines the value to store
   * @returns true if the value was updated (or false if the key was not found)
   */
  set(e, t) {
    return this._data[e] === void 0 ? !1 : (this._data[e] = t, !0);
  }
  /**
   * Get the element of the given key and remove it from the dictionary
   * @param key defines the key to search
   * @returns the value associated with the key or null if not found
   */
  getAndRemove(e) {
    const t = this.get(e);
    return t !== void 0 ? (delete this._data[e], --this._count, t) : null;
  }
  /**
   * Remove a key/value from the dictionary.
   * @param key the key to remove
   * @returns true if the item was successfully deleted, false if no item with such key exist in the dictionary
   */
  remove(e) {
    return this.contains(e) ? (delete this._data[e], --this._count, !0) : !1;
  }
  /**
   * Clear the whole content of the dictionary
   */
  clear() {
    this._data = {}, this._count = 0;
  }
  /**
   * Gets the current count
   */
  get count() {
    return this._count;
  }
  /**
   * Execute a callback on each key/val of the dictionary.
   * Note that you can remove any element in this dictionary in the callback implementation
   * @param callback the callback to execute on a given key/value pair
   */
  forEach(e) {
    for (const t in this._data) {
      const r = this._data[t];
      e(t, r);
    }
  }
  /**
   * Execute a callback on every occurrence of the dictionary until it returns a valid TRes object.
   * If the callback returns null or undefined the method will iterate to the next key/value pair
   * Note that you can remove any element in this dictionary in the callback implementation
   * @param callback the callback to execute, if it return a valid T instanced object the enumeration will stop and the object will be returned
   * @returns the first item
   */
  first(e) {
    for (const t in this._data) {
      const r = this._data[t], n = e(t, r);
      if (n)
        return n;
    }
    return null;
  }
}
class na {
  /**
   * Creates a new instance
   * @param externalProperties list of external properties to inject into the object
   */
  constructor(e) {
    if (this._keys = [], this._isDirty = !0, this._areLightsDirty = !0, this._areLightsDisposed = !1, this._areAttributesDirty = !0, this._areTexturesDirty = !0, this._areFresnelDirty = !0, this._areMiscDirty = !0, this._arePrePassDirty = !0, this._areImageProcessingDirty = !0, this._normals = !1, this._uvs = !1, this._needNormals = !1, this._needUVs = !1, this._externalProperties = e, e)
      for (const t in e)
        Object.prototype.hasOwnProperty.call(e, t) && this._setDefaultValue(t);
  }
  /**
   * Specifies if the material needs to be re-calculated
   */
  get isDirty() {
    return this._isDirty;
  }
  /**
   * Marks the material to indicate that it has been re-calculated
   */
  markAsProcessed() {
    this._isDirty = !1, this._areAttributesDirty = !1, this._areTexturesDirty = !1, this._areFresnelDirty = !1, this._areLightsDirty = !1, this._areLightsDisposed = !1, this._areMiscDirty = !1, this._arePrePassDirty = !1, this._areImageProcessingDirty = !1;
  }
  /**
   * Marks the material to indicate that it needs to be re-calculated
   */
  markAsUnprocessed() {
    this._isDirty = !0;
  }
  /**
   * Marks the material to indicate all of its defines need to be re-calculated
   */
  markAllAsDirty() {
    this._areTexturesDirty = !0, this._areAttributesDirty = !0, this._areLightsDirty = !0, this._areFresnelDirty = !0, this._areMiscDirty = !0, this._arePrePassDirty = !1, this._areImageProcessingDirty = !0, this._isDirty = !0;
  }
  /**
   * Marks the material to indicate that image processing needs to be re-calculated
   */
  markAsImageProcessingDirty() {
    this._areImageProcessingDirty = !0, this._isDirty = !0;
  }
  /**
   * Marks the material to indicate the lights need to be re-calculated
   * @param disposed Defines whether the light is dirty due to dispose or not
   */
  markAsLightDirty(e = !1) {
    this._areLightsDirty = !0, this._areLightsDisposed = this._areLightsDisposed || e, this._isDirty = !0;
  }
  /**
   * Marks the attribute state as changed
   */
  markAsAttributesDirty() {
    this._areAttributesDirty = !0, this._isDirty = !0;
  }
  /**
   * Marks the texture state as changed
   */
  markAsTexturesDirty() {
    this._areTexturesDirty = !0, this._isDirty = !0;
  }
  /**
   * Marks the fresnel state as changed
   */
  markAsFresnelDirty() {
    this._areFresnelDirty = !0, this._isDirty = !0;
  }
  /**
   * Marks the misc state as changed
   */
  markAsMiscDirty() {
    this._areMiscDirty = !0, this._isDirty = !0;
  }
  /**
   * Marks the prepass state as changed
   */
  markAsPrePassDirty() {
    this._arePrePassDirty = !0, this._isDirty = !0;
  }
  /**
   * Rebuilds the material defines
   */
  rebuild() {
    this._keys.length = 0;
    for (const e of Object.keys(this))
      e[0] !== "_" && this._keys.push(e);
    if (this._externalProperties)
      for (const e in this._externalProperties)
        this._keys.indexOf(e) === -1 && this._keys.push(e);
  }
  /**
   * Specifies if two material defines are equal
   * @param other - A material define instance to compare to
   * @returns - Boolean indicating if the material defines are equal (true) or not (false)
   */
  isEqual(e) {
    if (this._keys.length !== e._keys.length)
      return !1;
    for (let t = 0; t < this._keys.length; t++) {
      const r = this._keys[t];
      if (this[r] !== e[r])
        return !1;
    }
    return !0;
  }
  /**
   * Clones this instance's defines to another instance
   * @param other - material defines to clone values to
   */
  cloneTo(e) {
    this._keys.length !== e._keys.length && (e._keys = this._keys.slice(0));
    for (let t = 0; t < this._keys.length; t++) {
      const r = this._keys[t];
      e[r] = this[r];
    }
  }
  /**
   * Resets the material define values
   */
  reset() {
    this._keys.forEach((e) => this._setDefaultValue(e));
  }
  _setDefaultValue(e) {
    var t, r, n, i, s;
    const a = (n = (r = (t = this._externalProperties) === null || t === void 0 ? void 0 : t[e]) === null || r === void 0 ? void 0 : r.type) !== null && n !== void 0 ? n : typeof this[e], f = (s = (i = this._externalProperties) === null || i === void 0 ? void 0 : i[e]) === null || s === void 0 ? void 0 : s.default;
    switch (a) {
      case "number":
        this[e] = f ?? 0;
        break;
      case "string":
        this[e] = f ?? "";
        break;
      default:
        this[e] = f ?? !1;
        break;
    }
  }
  /**
   * Converts the material define values to a string
   * @returns - String of material define information
   */
  toString() {
    let e = "";
    for (let t = 0; t < this._keys.length; t++) {
      const r = this._keys[t], n = this[r];
      switch (typeof n) {
        case "number":
        case "string":
          e += "#define " + r + " " + n + `
`;
          break;
        default:
          n && (e += "#define " + r + `
`);
          break;
      }
    }
    return e;
  }
}
class so {
  constructor() {
    this._dirty = !0, this._tempColor = new xt(0, 0, 0, 0), this._globalCurve = new xt(0, 0, 0, 0), this._highlightsCurve = new xt(0, 0, 0, 0), this._midtonesCurve = new xt(0, 0, 0, 0), this._shadowsCurve = new xt(0, 0, 0, 0), this._positiveCurve = new xt(0, 0, 0, 0), this._negativeCurve = new xt(0, 0, 0, 0), this._globalHue = 30, this._globalDensity = 0, this._globalSaturation = 0, this._globalExposure = 0, this._highlightsHue = 30, this._highlightsDensity = 0, this._highlightsSaturation = 0, this._highlightsExposure = 0, this._midtonesHue = 30, this._midtonesDensity = 0, this._midtonesSaturation = 0, this._midtonesExposure = 0, this._shadowsHue = 30, this._shadowsDensity = 0, this._shadowsSaturation = 0, this._shadowsExposure = 0;
  }
  /**
   * Gets the global Hue value.
   * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
   */
  get globalHue() {
    return this._globalHue;
  }
  /**
   * Sets the global Hue value.
   * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
   */
  set globalHue(e) {
    this._globalHue = e, this._dirty = !0;
  }
  /**
   * Gets the global Density value.
   * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
   * Values less than zero provide a filter of opposite hue.
   */
  get globalDensity() {
    return this._globalDensity;
  }
  /**
   * Sets the global Density value.
   * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
   * Values less than zero provide a filter of opposite hue.
   */
  set globalDensity(e) {
    this._globalDensity = e, this._dirty = !0;
  }
  /**
   * Gets the global Saturation value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
   */
  get globalSaturation() {
    return this._globalSaturation;
  }
  /**
   * Sets the global Saturation value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
   */
  set globalSaturation(e) {
    this._globalSaturation = e, this._dirty = !0;
  }
  /**
   * Gets the global Exposure value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
   */
  get globalExposure() {
    return this._globalExposure;
  }
  /**
   * Sets the global Exposure value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
   */
  set globalExposure(e) {
    this._globalExposure = e, this._dirty = !0;
  }
  /**
   * Gets the highlights Hue value.
   * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
   */
  get highlightsHue() {
    return this._highlightsHue;
  }
  /**
   * Sets the highlights Hue value.
   * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
   */
  set highlightsHue(e) {
    this._highlightsHue = e, this._dirty = !0;
  }
  /**
   * Gets the highlights Density value.
   * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
   * Values less than zero provide a filter of opposite hue.
   */
  get highlightsDensity() {
    return this._highlightsDensity;
  }
  /**
   * Sets the highlights Density value.
   * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
   * Values less than zero provide a filter of opposite hue.
   */
  set highlightsDensity(e) {
    this._highlightsDensity = e, this._dirty = !0;
  }
  /**
   * Gets the highlights Saturation value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
   */
  get highlightsSaturation() {
    return this._highlightsSaturation;
  }
  /**
   * Sets the highlights Saturation value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
   */
  set highlightsSaturation(e) {
    this._highlightsSaturation = e, this._dirty = !0;
  }
  /**
   * Gets the highlights Exposure value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
   */
  get highlightsExposure() {
    return this._highlightsExposure;
  }
  /**
   * Sets the highlights Exposure value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
   */
  set highlightsExposure(e) {
    this._highlightsExposure = e, this._dirty = !0;
  }
  /**
   * Gets the midtones Hue value.
   * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
   */
  get midtonesHue() {
    return this._midtonesHue;
  }
  /**
   * Sets the midtones Hue value.
   * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
   */
  set midtonesHue(e) {
    this._midtonesHue = e, this._dirty = !0;
  }
  /**
   * Gets the midtones Density value.
   * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
   * Values less than zero provide a filter of opposite hue.
   */
  get midtonesDensity() {
    return this._midtonesDensity;
  }
  /**
   * Sets the midtones Density value.
   * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
   * Values less than zero provide a filter of opposite hue.
   */
  set midtonesDensity(e) {
    this._midtonesDensity = e, this._dirty = !0;
  }
  /**
   * Gets the midtones Saturation value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
   */
  get midtonesSaturation() {
    return this._midtonesSaturation;
  }
  /**
   * Sets the midtones Saturation value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
   */
  set midtonesSaturation(e) {
    this._midtonesSaturation = e, this._dirty = !0;
  }
  /**
   * Gets the midtones Exposure value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
   */
  get midtonesExposure() {
    return this._midtonesExposure;
  }
  /**
   * Sets the midtones Exposure value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
   */
  set midtonesExposure(e) {
    this._midtonesExposure = e, this._dirty = !0;
  }
  /**
   * Gets the shadows Hue value.
   * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
   */
  get shadowsHue() {
    return this._shadowsHue;
  }
  /**
   * Sets the shadows Hue value.
   * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
   */
  set shadowsHue(e) {
    this._shadowsHue = e, this._dirty = !0;
  }
  /**
   * Gets the shadows Density value.
   * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
   * Values less than zero provide a filter of opposite hue.
   */
  get shadowsDensity() {
    return this._shadowsDensity;
  }
  /**
   * Sets the shadows Density value.
   * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
   * Values less than zero provide a filter of opposite hue.
   */
  set shadowsDensity(e) {
    this._shadowsDensity = e, this._dirty = !0;
  }
  /**
   * Gets the shadows Saturation value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
   */
  get shadowsSaturation() {
    return this._shadowsSaturation;
  }
  /**
   * Sets the shadows Saturation value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
   */
  set shadowsSaturation(e) {
    this._shadowsSaturation = e, this._dirty = !0;
  }
  /**
   * Gets the shadows Exposure value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
   */
  get shadowsExposure() {
    return this._shadowsExposure;
  }
  /**
   * Sets the shadows Exposure value.
   * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
   */
  set shadowsExposure(e) {
    this._shadowsExposure = e, this._dirty = !0;
  }
  /**
   * Returns the class name
   * @returns The class name
   */
  getClassName() {
    return "ColorCurves";
  }
  /**
   * Binds the color curves to the shader.
   * @param colorCurves The color curve to bind
   * @param effect The effect to bind to
   * @param positiveUniform The positive uniform shader parameter
   * @param neutralUniform The neutral uniform shader parameter
   * @param negativeUniform The negative uniform shader parameter
   */
  static Bind(e, t, r = "vCameraColorCurvePositive", n = "vCameraColorCurveNeutral", i = "vCameraColorCurveNegative") {
    e._dirty && (e._dirty = !1, e._getColorGradingDataToRef(e._globalHue, e._globalDensity, e._globalSaturation, e._globalExposure, e._globalCurve), e._getColorGradingDataToRef(e._highlightsHue, e._highlightsDensity, e._highlightsSaturation, e._highlightsExposure, e._tempColor), e._tempColor.multiplyToRef(e._globalCurve, e._highlightsCurve), e._getColorGradingDataToRef(e._midtonesHue, e._midtonesDensity, e._midtonesSaturation, e._midtonesExposure, e._tempColor), e._tempColor.multiplyToRef(e._globalCurve, e._midtonesCurve), e._getColorGradingDataToRef(e._shadowsHue, e._shadowsDensity, e._shadowsSaturation, e._shadowsExposure, e._tempColor), e._tempColor.multiplyToRef(e._globalCurve, e._shadowsCurve), e._highlightsCurve.subtractToRef(e._midtonesCurve, e._positiveCurve), e._midtonesCurve.subtractToRef(e._shadowsCurve, e._negativeCurve)), t && (t.setFloat4(r, e._positiveCurve.r, e._positiveCurve.g, e._positiveCurve.b, e._positiveCurve.a), t.setFloat4(n, e._midtonesCurve.r, e._midtonesCurve.g, e._midtonesCurve.b, e._midtonesCurve.a), t.setFloat4(i, e._negativeCurve.r, e._negativeCurve.g, e._negativeCurve.b, e._negativeCurve.a));
  }
  /**
   * Prepare the list of uniforms associated with the ColorCurves effects.
   * @param uniformsList The list of uniforms used in the effect
   */
  static PrepareUniforms(e) {
    e.push("vCameraColorCurveNeutral", "vCameraColorCurvePositive", "vCameraColorCurveNegative");
  }
  /**
   * Returns color grading data based on a hue, density, saturation and exposure value.
   * @param hue
   * @param density
   * @param saturation The saturation.
   * @param exposure The exposure.
   * @param result The result data container.
   */
  _getColorGradingDataToRef(e, t, r, n, i) {
    e != null && (e = so._Clamp(e, 0, 360), t = so._Clamp(t, -100, 100), r = so._Clamp(r, -100, 100), n = so._Clamp(n, -100, 100), t = so._ApplyColorGradingSliderNonlinear(t), t *= 0.5, n = so._ApplyColorGradingSliderNonlinear(n), t < 0 && (t *= -1, e = (e + 180) % 360), so._FromHSBToRef(e, t, 50 + 0.25 * n, i), i.scaleToRef(2, i), i.a = 1 + 0.01 * r);
  }
  /**
   * Takes an input slider value and returns an adjusted value that provides extra control near the centre.
   * @param value The input slider value in range [-100,100].
   * @returns Adjusted value.
   */
  static _ApplyColorGradingSliderNonlinear(e) {
    e /= 100;
    let t = Math.abs(e);
    return t = Math.pow(t, 2), e < 0 && (t *= -1), t *= 100, t;
  }
  /**
   * Returns an RGBA Color4 based on Hue, Saturation and Brightness (also referred to as value, HSV).
   * @param hue The hue (H) input.
   * @param saturation The saturation (S) input.
   * @param brightness The brightness (B) input.
   * @param result
   * @result An RGBA color represented as Vector4.
   */
  static _FromHSBToRef(e, t, r, n) {
    let i = so._Clamp(e, 0, 360);
    const s = so._Clamp(t / 100, 0, 1), a = so._Clamp(r / 100, 0, 1);
    if (s === 0)
      n.r = a, n.g = a, n.b = a;
    else {
      i /= 60;
      const f = Math.floor(i), o = i - f, d = a * (1 - s), v = a * (1 - s * o), u = a * (1 - s * (1 - o));
      switch (f) {
        case 0:
          n.r = a, n.g = u, n.b = d;
          break;
        case 1:
          n.r = v, n.g = a, n.b = d;
          break;
        case 2:
          n.r = d, n.g = a, n.b = u;
          break;
        case 3:
          n.r = d, n.g = v, n.b = a;
          break;
        case 4:
          n.r = u, n.g = d, n.b = a;
          break;
        default:
          n.r = a, n.g = d, n.b = v;
          break;
      }
    }
    n.a = 1;
  }
  /**
   * Returns a value clamped between min and max
   * @param value The value to clamp
   * @param min The minimum of value
   * @param max The maximum of value
   * @returns The clamped value.
   */
  static _Clamp(e, t, r) {
    return Math.min(Math.max(e, t), r);
  }
  /**
   * Clones the current color curve instance.
   * @returns The cloned curves
   */
  clone() {
    return jt.Clone(() => new so(), this);
  }
  /**
   * Serializes the current color curve instance to a json representation.
   * @returns a JSON representation
   */
  serialize() {
    return jt.Serialize(this);
  }
  /**
   * Parses the color curve from a json representation.
   * @param source the JSON source to parse
   * @returns The parsed curves
   */
  static Parse(e) {
    return jt.Parse(() => new so(), e, null, null);
  }
}
C([
  M()
], so.prototype, "_globalHue", void 0);
C([
  M()
], so.prototype, "_globalDensity", void 0);
C([
  M()
], so.prototype, "_globalSaturation", void 0);
C([
  M()
], so.prototype, "_globalExposure", void 0);
C([
  M()
], so.prototype, "_highlightsHue", void 0);
C([
  M()
], so.prototype, "_highlightsDensity", void 0);
C([
  M()
], so.prototype, "_highlightsSaturation", void 0);
C([
  M()
], so.prototype, "_highlightsExposure", void 0);
C([
  M()
], so.prototype, "_midtonesHue", void 0);
C([
  M()
], so.prototype, "_midtonesDensity", void 0);
C([
  M()
], so.prototype, "_midtonesSaturation", void 0);
C([
  M()
], so.prototype, "_midtonesExposure", void 0);
jt._ColorCurvesParser = so.Parse;
class M$ extends na {
  constructor() {
    super(), this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.EXPOSURE = !1, this.SKIPFINALCOLORCLAMP = !1, this.rebuild();
  }
}
class Ui {
  constructor() {
    this.colorCurves = new so(), this._colorCurvesEnabled = !1, this._colorGradingEnabled = !1, this._colorGradingWithGreenDepth = !0, this._colorGradingBGR = !0, this._exposure = 1, this._toneMappingEnabled = !1, this._toneMappingType = Ui.TONEMAPPING_STANDARD, this._contrast = 1, this.vignetteStretch = 0, this.vignetteCenterX = 0, this.vignetteCenterY = 0, this.vignetteWeight = 1.5, this.vignetteColor = new xt(0, 0, 0, 0), this.vignetteCameraFov = 0.5, this._vignetteBlendMode = Ui.VIGNETTEMODE_MULTIPLY, this._vignetteEnabled = !1, this._ditheringEnabled = !1, this._ditheringIntensity = 1 / 255, this._skipFinalColorClamp = !1, this._applyByPostProcess = !1, this._isEnabled = !0, this.onUpdateParameters = new Oe();
  }
  /**
   * Gets whether the color curves effect is enabled.
   */
  get colorCurvesEnabled() {
    return this._colorCurvesEnabled;
  }
  /**
   * Sets whether the color curves effect is enabled.
   */
  set colorCurvesEnabled(e) {
    this._colorCurvesEnabled !== e && (this._colorCurvesEnabled = e, this._updateParameters());
  }
  /**
   * Color grading LUT texture used in the effect if colorGradingEnabled is set to true
   */
  get colorGradingTexture() {
    return this._colorGradingTexture;
  }
  /**
   * Color grading LUT texture used in the effect if colorGradingEnabled is set to true
   */
  set colorGradingTexture(e) {
    this._colorGradingTexture !== e && (this._colorGradingTexture = e, this._updateParameters());
  }
  /**
   * Gets whether the color grading effect is enabled.
   */
  get colorGradingEnabled() {
    return this._colorGradingEnabled;
  }
  /**
   * Sets whether the color grading effect is enabled.
   */
  set colorGradingEnabled(e) {
    this._colorGradingEnabled !== e && (this._colorGradingEnabled = e, this._updateParameters());
  }
  /**
   * Gets whether the color grading effect is using a green depth for the 3d Texture.
   */
  get colorGradingWithGreenDepth() {
    return this._colorGradingWithGreenDepth;
  }
  /**
   * Sets whether the color grading effect is using a green depth for the 3d Texture.
   */
  set colorGradingWithGreenDepth(e) {
    this._colorGradingWithGreenDepth !== e && (this._colorGradingWithGreenDepth = e, this._updateParameters());
  }
  /**
   * Gets whether the color grading texture contains BGR values.
   */
  get colorGradingBGR() {
    return this._colorGradingBGR;
  }
  /**
   * Sets whether the color grading texture contains BGR values.
   */
  set colorGradingBGR(e) {
    this._colorGradingBGR !== e && (this._colorGradingBGR = e, this._updateParameters());
  }
  /**
   * Gets the Exposure used in the effect.
   */
  get exposure() {
    return this._exposure;
  }
  /**
   * Sets the Exposure used in the effect.
   */
  set exposure(e) {
    this._exposure !== e && (this._exposure = e, this._updateParameters());
  }
  /**
   * Gets whether the tone mapping effect is enabled.
   */
  get toneMappingEnabled() {
    return this._toneMappingEnabled;
  }
  /**
   * Sets whether the tone mapping effect is enabled.
   */
  set toneMappingEnabled(e) {
    this._toneMappingEnabled !== e && (this._toneMappingEnabled = e, this._updateParameters());
  }
  /**
   * Gets the type of tone mapping effect.
   */
  get toneMappingType() {
    return this._toneMappingType;
  }
  /**
   * Sets the type of tone mapping effect used in BabylonJS.
   */
  set toneMappingType(e) {
    this._toneMappingType !== e && (this._toneMappingType = e, this._updateParameters());
  }
  /**
   * Gets the contrast used in the effect.
   */
  get contrast() {
    return this._contrast;
  }
  /**
   * Sets the contrast used in the effect.
   */
  set contrast(e) {
    this._contrast !== e && (this._contrast = e, this._updateParameters());
  }
  /**
   * Back Compat: Vignette center Y Offset.
   * @deprecated use vignetteCenterY instead
   */
  get vignetteCentreY() {
    return this.vignetteCenterY;
  }
  set vignetteCentreY(e) {
    this.vignetteCenterY = e;
  }
  /**
   * Back Compat: Vignette center X Offset.
   * @deprecated use vignetteCenterX instead
   */
  get vignetteCentreX() {
    return this.vignetteCenterX;
  }
  set vignetteCentreX(e) {
    this.vignetteCenterX = e;
  }
  /**
   * Gets the vignette blend mode allowing different kind of effect.
   */
  get vignetteBlendMode() {
    return this._vignetteBlendMode;
  }
  /**
   * Sets the vignette blend mode allowing different kind of effect.
   */
  set vignetteBlendMode(e) {
    this._vignetteBlendMode !== e && (this._vignetteBlendMode = e, this._updateParameters());
  }
  /**
   * Gets whether the vignette effect is enabled.
   */
  get vignetteEnabled() {
    return this._vignetteEnabled;
  }
  /**
   * Sets whether the vignette effect is enabled.
   */
  set vignetteEnabled(e) {
    this._vignetteEnabled !== e && (this._vignetteEnabled = e, this._updateParameters());
  }
  /**
   * Gets whether the dithering effect is enabled.
   * The dithering effect can be used to reduce banding.
   */
  get ditheringEnabled() {
    return this._ditheringEnabled;
  }
  /**
   * Sets whether the dithering effect is enabled.
   * The dithering effect can be used to reduce banding.
   */
  set ditheringEnabled(e) {
    this._ditheringEnabled !== e && (this._ditheringEnabled = e, this._updateParameters());
  }
  /**
   * Gets the dithering intensity. 0 is no dithering. Default is 1.0 / 255.0.
   */
  get ditheringIntensity() {
    return this._ditheringIntensity;
  }
  /**
   * Sets the dithering intensity. 0 is no dithering. Default is 1.0 / 255.0.
   */
  set ditheringIntensity(e) {
    this._ditheringIntensity !== e && (this._ditheringIntensity = e, this._updateParameters());
  }
  /**
   * If apply by post process is set to true, setting this to true will skip the final color clamp step in the fragment shader
   * Applies to PBR materials.
   */
  get skipFinalColorClamp() {
    return this._skipFinalColorClamp;
  }
  /**
   * If apply by post process is set to true, setting this to true will skip the final color clamp step in the fragment shader
   * Applies to PBR materials.
   */
  set skipFinalColorClamp(e) {
    this._skipFinalColorClamp !== e && (this._skipFinalColorClamp = e, this._updateParameters());
  }
  /**
   * Gets whether the image processing is applied through a post process or not.
   */
  get applyByPostProcess() {
    return this._applyByPostProcess;
  }
  /**
   * Sets whether the image processing is applied through a post process or not.
   */
  set applyByPostProcess(e) {
    this._applyByPostProcess !== e && (this._applyByPostProcess = e, this._updateParameters());
  }
  /**
   * Gets whether the image processing is enabled or not.
   */
  get isEnabled() {
    return this._isEnabled;
  }
  /**
   * Sets whether the image processing is enabled or not.
   */
  set isEnabled(e) {
    this._isEnabled !== e && (this._isEnabled = e, this._updateParameters());
  }
  /**
   * Method called each time the image processing information changes requires to recompile the effect.
   */
  _updateParameters() {
    this.onUpdateParameters.notifyObservers(this);
  }
  /**
   * Gets the current class name.
   * @returns "ImageProcessingConfiguration"
   */
  getClassName() {
    return "ImageProcessingConfiguration";
  }
  /**
   * Prepare the list of uniforms associated with the Image Processing effects.
   * @param uniforms The list of uniforms used in the effect
   * @param defines the list of defines currently in use
   */
  static PrepareUniforms(e, t) {
    t.EXPOSURE && e.push("exposureLinear"), t.CONTRAST && e.push("contrast"), t.COLORGRADING && e.push("colorTransformSettings"), (t.VIGNETTE || t.DITHER) && e.push("vInverseScreenSize"), t.VIGNETTE && (e.push("vignetteSettings1"), e.push("vignetteSettings2")), t.COLORCURVES && so.PrepareUniforms(e), t.DITHER && e.push("ditherIntensity");
  }
  /**
   * Prepare the list of samplers associated with the Image Processing effects.
   * @param samplersList The list of uniforms used in the effect
   * @param defines the list of defines currently in use
   */
  static PrepareSamplers(e, t) {
    t.COLORGRADING && e.push("txColorTransform");
  }
  /**
   * Prepare the list of defines associated to the shader.
   * @param defines the list of defines to complete
   * @param forPostProcess Define if we are currently in post process mode or not
   */
  prepareDefines(e, t = !1) {
    if (t !== this.applyByPostProcess || !this._isEnabled) {
      e.VIGNETTE = !1, e.TONEMAPPING = !1, e.TONEMAPPING_ACES = !1, e.CONTRAST = !1, e.EXPOSURE = !1, e.COLORCURVES = !1, e.COLORGRADING = !1, e.COLORGRADING3D = !1, e.DITHER = !1, e.IMAGEPROCESSING = !1, e.SKIPFINALCOLORCLAMP = this.skipFinalColorClamp, e.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess && this._isEnabled;
      return;
    }
    switch (e.VIGNETTE = this.vignetteEnabled, e.VIGNETTEBLENDMODEMULTIPLY = this.vignetteBlendMode === Ui._VIGNETTEMODE_MULTIPLY, e.VIGNETTEBLENDMODEOPAQUE = !e.VIGNETTEBLENDMODEMULTIPLY, e.TONEMAPPING = this.toneMappingEnabled, this._toneMappingType) {
      case Ui.TONEMAPPING_ACES:
        e.TONEMAPPING_ACES = !0;
        break;
      default:
        e.TONEMAPPING_ACES = !1;
        break;
    }
    e.CONTRAST = this.contrast !== 1, e.EXPOSURE = this.exposure !== 1, e.COLORCURVES = this.colorCurvesEnabled && !!this.colorCurves, e.COLORGRADING = this.colorGradingEnabled && !!this.colorGradingTexture, e.COLORGRADING ? e.COLORGRADING3D = this.colorGradingTexture.is3D : e.COLORGRADING3D = !1, e.SAMPLER3DGREENDEPTH = this.colorGradingWithGreenDepth, e.SAMPLER3DBGRMAP = this.colorGradingBGR, e.DITHER = this._ditheringEnabled, e.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess, e.SKIPFINALCOLORCLAMP = this.skipFinalColorClamp, e.IMAGEPROCESSING = e.VIGNETTE || e.TONEMAPPING || e.CONTRAST || e.EXPOSURE || e.COLORCURVES || e.COLORGRADING || e.DITHER;
  }
  /**
   * Returns true if all the image processing information are ready.
   * @returns True if ready, otherwise, false
   */
  isReady() {
    return !this.colorGradingEnabled || !this.colorGradingTexture || this.colorGradingTexture.isReady();
  }
  /**
   * Binds the image processing to the shader.
   * @param effect The effect to bind to
   * @param overrideAspectRatio Override the aspect ratio of the effect
   */
  bind(e, t) {
    if (this._colorCurvesEnabled && this.colorCurves && so.Bind(this.colorCurves, e), this._vignetteEnabled || this._ditheringEnabled) {
      const r = 1 / e.getEngine().getRenderWidth(), n = 1 / e.getEngine().getRenderHeight();
      if (e.setFloat2("vInverseScreenSize", r, n), this._ditheringEnabled && e.setFloat("ditherIntensity", 0.5 * this._ditheringIntensity), this._vignetteEnabled) {
        const i = t ?? n / r;
        let s = Math.tan(this.vignetteCameraFov * 0.5), a = s * i;
        const f = Math.sqrt(a * s);
        a = ye.Mix(a, f, this.vignetteStretch), s = ye.Mix(s, f, this.vignetteStretch), e.setFloat4("vignetteSettings1", a, s, -a * this.vignetteCenterX, -s * this.vignetteCenterY);
        const o = -2 * this.vignetteWeight;
        e.setFloat4("vignetteSettings2", this.vignetteColor.r, this.vignetteColor.g, this.vignetteColor.b, o);
      }
    }
    if (e.setFloat("exposureLinear", this.exposure), e.setFloat("contrast", this.contrast), this.colorGradingTexture) {
      e.setTexture("txColorTransform", this.colorGradingTexture);
      const r = this.colorGradingTexture.getSize().height;
      e.setFloat4(
        "colorTransformSettings",
        (r - 1) / r,
        // textureScale
        0.5 / r,
        // textureOffset
        r,
        // textureSize
        this.colorGradingTexture.level
        // weight
      );
    }
  }
  /**
   * Clones the current image processing instance.
   * @returns The cloned image processing
   */
  clone() {
    return jt.Clone(() => new Ui(), this);
  }
  /**
   * Serializes the current image processing instance to a json representation.
   * @returns a JSON representation
   */
  serialize() {
    return jt.Serialize(this);
  }
  /**
   * Parses the image processing from a json representation.
   * @param source the JSON source to parse
   * @returns The parsed image processing
   */
  static Parse(e) {
    const t = jt.Parse(() => new Ui(), e, null, null);
    return e.vignetteCentreX !== void 0 && (t.vignetteCenterX = e.vignetteCentreX), e.vignetteCentreY !== void 0 && (t.vignetteCenterY = e.vignetteCentreY), t;
  }
  /**
   * Used to apply the vignette as a mix with the pixel color.
   */
  static get VIGNETTEMODE_MULTIPLY() {
    return this._VIGNETTEMODE_MULTIPLY;
  }
  /**
   * Used to apply the vignette as a replacement of the pixel color.
   */
  static get VIGNETTEMODE_OPAQUE() {
    return this._VIGNETTEMODE_OPAQUE;
  }
}
Ui.TONEMAPPING_STANDARD = 0;
Ui.TONEMAPPING_ACES = 1;
Ui._VIGNETTEMODE_MULTIPLY = 0;
Ui._VIGNETTEMODE_OPAQUE = 1;
C([
  W$()
], Ui.prototype, "colorCurves", void 0);
C([
  M()
], Ui.prototype, "_colorCurvesEnabled", void 0);
C([
  en("colorGradingTexture")
], Ui.prototype, "_colorGradingTexture", void 0);
C([
  M()
], Ui.prototype, "_colorGradingEnabled", void 0);
C([
  M()
], Ui.prototype, "_colorGradingWithGreenDepth", void 0);
C([
  M()
], Ui.prototype, "_colorGradingBGR", void 0);
C([
  M()
], Ui.prototype, "_exposure", void 0);
C([
  M()
], Ui.prototype, "_toneMappingEnabled", void 0);
C([
  M()
], Ui.prototype, "_toneMappingType", void 0);
C([
  M()
], Ui.prototype, "_contrast", void 0);
C([
  M()
], Ui.prototype, "vignetteStretch", void 0);
C([
  M()
], Ui.prototype, "vignetteCenterX", void 0);
C([
  M()
], Ui.prototype, "vignetteCenterY", void 0);
C([
  M()
], Ui.prototype, "vignetteWeight", void 0);
C([
  rU()
], Ui.prototype, "vignetteColor", void 0);
C([
  M()
], Ui.prototype, "vignetteCameraFov", void 0);
C([
  M()
], Ui.prototype, "_vignetteBlendMode", void 0);
C([
  M()
], Ui.prototype, "_vignetteEnabled", void 0);
C([
  M()
], Ui.prototype, "_ditheringEnabled", void 0);
C([
  M()
], Ui.prototype, "_ditheringIntensity", void 0);
C([
  M()
], Ui.prototype, "_skipFinalColorClamp", void 0);
C([
  M()
], Ui.prototype, "_applyByPostProcess", void 0);
C([
  M()
], Ui.prototype, "_isEnabled", void 0);
jt._ImageProcessingConfigurationParser = Ui.Parse;
hr.prototype.createUniformBuffer = function(A, e) {
  const t = this._gl.createBuffer();
  if (!t)
    throw new Error("Unable to create uniform buffer");
  const r = new jS(t);
  return this.bindUniformBuffer(r), A instanceof Float32Array ? this._gl.bufferData(this._gl.UNIFORM_BUFFER, A, this._gl.STATIC_DRAW) : this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(A), this._gl.STATIC_DRAW), this.bindUniformBuffer(null), r.references = 1, r;
};
hr.prototype.createDynamicUniformBuffer = function(A, e) {
  const t = this._gl.createBuffer();
  if (!t)
    throw new Error("Unable to create dynamic uniform buffer");
  const r = new jS(t);
  return this.bindUniformBuffer(r), A instanceof Float32Array ? this._gl.bufferData(this._gl.UNIFORM_BUFFER, A, this._gl.DYNAMIC_DRAW) : this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(A), this._gl.DYNAMIC_DRAW), this.bindUniformBuffer(null), r.references = 1, r;
};
hr.prototype.updateUniformBuffer = function(A, e, t, r) {
  this.bindUniformBuffer(A), t === void 0 && (t = 0), r === void 0 ? e instanceof Float32Array ? this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, t, e) : this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, t, new Float32Array(e)) : e instanceof Float32Array ? this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, e.subarray(t, t + r)) : this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, new Float32Array(e).subarray(t, t + r)), this.bindUniformBuffer(null);
};
hr.prototype.bindUniformBuffer = function(A) {
  this._gl.bindBuffer(this._gl.UNIFORM_BUFFER, A ? A.underlyingResource : null);
};
hr.prototype.bindUniformBufferBase = function(A, e, t) {
  this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER, e, A ? A.underlyingResource : null);
};
hr.prototype.bindUniformBlock = function(A, e, t) {
  const r = A.program, n = this._gl.getUniformBlockIndex(r, e);
  n !== 4294967295 && this._gl.uniformBlockBinding(r, n, t);
};
class yr {
  /**
   * Instantiates a new Uniform buffer objects.
   *
   * Handles blocks of uniform on the GPU.
   *
   * If WebGL 2 is not available, this class falls back on traditional setUniformXXX calls.
   *
   * For more information, please refer to :
   * @see https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object
   * @param engine Define the engine the buffer is associated with
   * @param data Define the data contained in the buffer
   * @param dynamic Define if the buffer is updatable
   * @param name to assign to the buffer (debugging purpose)
   * @param forceNoUniformBuffer define that this object must not rely on UBO objects
   */
  constructor(e, t, r, n, i = !1) {
    this._valueCache = {}, this._engine = e, this._noUBO = !e.supportsUniformBuffers || i, this._dynamic = r, this._name = n ?? "no-name", this._data = t || [], this._uniformLocations = {}, this._uniformSizes = {}, this._uniformArraySizes = {}, this._uniformLocationPointer = 0, this._needSync = !1, this._engine._features.trackUbosInFrame && (this._buffers = [], this._bufferIndex = -1, this._createBufferOnWrite = !1, this._currentFrameId = 0), this._noUBO ? (this.updateMatrix3x3 = this._updateMatrix3x3ForEffect, this.updateMatrix2x2 = this._updateMatrix2x2ForEffect, this.updateFloat = this._updateFloatForEffect, this.updateFloat2 = this._updateFloat2ForEffect, this.updateFloat3 = this._updateFloat3ForEffect, this.updateFloat4 = this._updateFloat4ForEffect, this.updateFloatArray = this._updateFloatArrayForEffect, this.updateArray = this._updateArrayForEffect, this.updateIntArray = this._updateIntArrayForEffect, this.updateUIntArray = this._updateUIntArrayForEffect, this.updateMatrix = this._updateMatrixForEffect, this.updateMatrices = this._updateMatricesForEffect, this.updateVector3 = this._updateVector3ForEffect, this.updateVector4 = this._updateVector4ForEffect, this.updateColor3 = this._updateColor3ForEffect, this.updateColor4 = this._updateColor4ForEffect, this.updateDirectColor4 = this._updateDirectColor4ForEffect, this.updateInt = this._updateIntForEffect, this.updateInt2 = this._updateInt2ForEffect, this.updateInt3 = this._updateInt3ForEffect, this.updateInt4 = this._updateInt4ForEffect, this.updateUInt = this._updateUIntForEffect, this.updateUInt2 = this._updateUInt2ForEffect, this.updateUInt3 = this._updateUInt3ForEffect, this.updateUInt4 = this._updateUInt4ForEffect) : (this._engine._uniformBuffers.push(this), this.updateMatrix3x3 = this._updateMatrix3x3ForUniform, this.updateMatrix2x2 = this._updateMatrix2x2ForUniform, this.updateFloat = this._updateFloatForUniform, this.updateFloat2 = this._updateFloat2ForUniform, this.updateFloat3 = this._updateFloat3ForUniform, this.updateFloat4 = this._updateFloat4ForUniform, this.updateFloatArray = this._updateFloatArrayForUniform, this.updateArray = this._updateArrayForUniform, this.updateIntArray = this._updateIntArrayForUniform, this.updateUIntArray = this._updateUIntArrayForUniform, this.updateMatrix = this._updateMatrixForUniform, this.updateMatrices = this._updateMatricesForUniform, this.updateVector3 = this._updateVector3ForUniform, this.updateVector4 = this._updateVector4ForUniform, this.updateColor3 = this._updateColor3ForUniform, this.updateColor4 = this._updateColor4ForUniform, this.updateDirectColor4 = this._updateDirectColor4ForUniform, this.updateInt = this._updateIntForUniform, this.updateInt2 = this._updateInt2ForUniform, this.updateInt3 = this._updateInt3ForUniform, this.updateInt4 = this._updateInt4ForUniform, this.updateUInt = this._updateUIntForUniform, this.updateUInt2 = this._updateUInt2ForUniform, this.updateUInt3 = this._updateUInt3ForUniform, this.updateUInt4 = this._updateUInt4ForUniform);
  }
  /**
   * Indicates if the buffer is using the WebGL2 UBO implementation,
   * or just falling back on setUniformXXX calls.
   */
  get useUbo() {
    return !this._noUBO;
  }
  /**
   * Indicates if the WebGL underlying uniform buffer is in sync
   * with the javascript cache data.
   */
  get isSync() {
    return !this._needSync;
  }
  /**
   * Indicates if the WebGL underlying uniform buffer is dynamic.
   * Also, a dynamic UniformBuffer will disable cache verification and always
   * update the underlying WebGL uniform buffer to the GPU.
   * @returns if Dynamic, otherwise false
   */
  isDynamic() {
    return this._dynamic !== void 0;
  }
  /**
   * The data cache on JS side.
   * @returns the underlying data as a float array
   */
  getData() {
    return this._bufferData;
  }
  /**
   * The underlying WebGL Uniform buffer.
   * @returns the webgl buffer
   */
  getBuffer() {
    return this._buffer;
  }
  /**
   * std140 layout specifies how to align data within an UBO structure.
   * See https://khronos.org/registry/OpenGL/specs/gl/glspec45.core.pdf#page=159
   * for specs.
   * @param size
   */
  _fillAlignment(e) {
    let t;
    if (e <= 2 ? t = e : t = 4, this._uniformLocationPointer % t !== 0) {
      const r = this._uniformLocationPointer;
      this._uniformLocationPointer += t - this._uniformLocationPointer % t;
      const n = this._uniformLocationPointer - r;
      for (let i = 0; i < n; i++)
        this._data.push(0);
    }
  }
  /**
   * Adds an uniform in the buffer.
   * Warning : the subsequents calls of this function must be in the same order as declared in the shader
   * for the layout to be correct ! The addUniform function only handles types like float, vec2, vec3, vec4, mat4,
   * meaning size=1,2,3,4 or 16. It does not handle struct types.
   * @param name Name of the uniform, as used in the uniform block in the shader.
   * @param size Data size, or data directly.
   * @param arraySize The number of elements in the array, 0 if not an array.
   */
  addUniform(e, t, r = 0) {
    if (this._noUBO || this._uniformLocations[e] !== void 0)
      return;
    let n;
    if (r > 0) {
      if (t instanceof Array)
        throw "addUniform should not be use with Array in UBO: " + e;
      if (this._fillAlignment(4), this._uniformArraySizes[e] = { strideSize: t, arraySize: r }, t == 16)
        t = t * r;
      else {
        const s = (4 - t) * r;
        t = t * r + s;
      }
      n = [];
      for (let i = 0; i < t; i++)
        n.push(0);
    } else {
      if (t instanceof Array)
        n = t, t = n.length;
      else {
        t = t, n = [];
        for (let i = 0; i < t; i++)
          n.push(0);
      }
      this._fillAlignment(t);
    }
    this._uniformSizes[e] = t, this._uniformLocations[e] = this._uniformLocationPointer, this._uniformLocationPointer += t;
    for (let i = 0; i < t; i++)
      this._data.push(n[i]);
    this._needSync = !0;
  }
  /**
   * Adds a Matrix 4x4 to the uniform buffer.
   * @param name Name of the uniform, as used in the uniform block in the shader.
   * @param mat A 4x4 matrix.
   */
  addMatrix(e, t) {
    this.addUniform(e, Array.prototype.slice.call(t.toArray()));
  }
  /**
   * Adds a vec2 to the uniform buffer.
   * @param name Name of the uniform, as used in the uniform block in the shader.
   * @param x Define the x component value of the vec2
   * @param y Define the y component value of the vec2
   */
  addFloat2(e, t, r) {
    const n = [t, r];
    this.addUniform(e, n);
  }
  /**
   * Adds a vec3 to the uniform buffer.
   * @param name Name of the uniform, as used in the uniform block in the shader.
   * @param x Define the x component value of the vec3
   * @param y Define the y component value of the vec3
   * @param z Define the z component value of the vec3
   */
  addFloat3(e, t, r, n) {
    const i = [t, r, n];
    this.addUniform(e, i);
  }
  /**
   * Adds a vec3 to the uniform buffer.
   * @param name Name of the uniform, as used in the uniform block in the shader.
   * @param color Define the vec3 from a Color
   */
  addColor3(e, t) {
    const r = [t.r, t.g, t.b];
    this.addUniform(e, r);
  }
  /**
   * Adds a vec4 to the uniform buffer.
   * @param name Name of the uniform, as used in the uniform block in the shader.
   * @param color Define the rgb components from a Color
   * @param alpha Define the a component of the vec4
   */
  addColor4(e, t, r) {
    const n = [t.r, t.g, t.b, r];
    this.addUniform(e, n);
  }
  /**
   * Adds a vec3 to the uniform buffer.
   * @param name Name of the uniform, as used in the uniform block in the shader.
   * @param vector Define the vec3 components from a Vector
   */
  addVector3(e, t) {
    const r = [t.x, t.y, t.z];
    this.addUniform(e, r);
  }
  /**
   * Adds a Matrix 3x3 to the uniform buffer.
   * @param name Name of the uniform, as used in the uniform block in the shader.
   */
  addMatrix3x3(e) {
    this.addUniform(e, 12);
  }
  /**
   * Adds a Matrix 2x2 to the uniform buffer.
   * @param name Name of the uniform, as used in the uniform block in the shader.
   */
  addMatrix2x2(e) {
    this.addUniform(e, 8);
  }
  /**
   * Effectively creates the WebGL Uniform Buffer, once layout is completed with `addUniform`.
   */
  create() {
    this._noUBO || this._buffer || (this._fillAlignment(4), this._bufferData = new Float32Array(this._data), this._rebuild(), this._needSync = !0);
  }
  _getNames() {
    const e = [];
    for (const t in this._uniformLocations)
      e.push(t);
    return e.join(",");
  }
  /** @internal */
  _rebuild() {
    this._noUBO || !this._bufferData || (this._dynamic ? this._buffer = this._engine.createDynamicUniformBuffer(this._bufferData, this._name + "_UniformList:" + this._getNames()) : this._buffer = this._engine.createUniformBuffer(this._bufferData, this._name + "_UniformList:" + this._getNames()), this._engine._features.trackUbosInFrame && (this._buffers.push([this._buffer, this._engine._features.checkUbosContentBeforeUpload ? this._bufferData.slice() : void 0]), this._bufferIndex = this._buffers.length - 1, this._createBufferOnWrite = !1));
  }
  /** @internal */
  get _numBuffers() {
    return this._buffers.length;
  }
  /** @internal */
  get _indexBuffer() {
    return this._bufferIndex;
  }
  /** Gets the name of this buffer */
  get name() {
    return this._name;
  }
  /** Gets the current effect */
  get currentEffect() {
    return this._currentEffect;
  }
  _buffersEqual(e, t) {
    for (let r = 0; r < e.length; ++r)
      if (e[r] !== t[r])
        return !1;
    return !0;
  }
  _copyBuffer(e, t) {
    for (let r = 0; r < e.length; ++r)
      t[r] = e[r];
  }
  /**
   * Updates the WebGL Uniform Buffer on the GPU.
   * If the `dynamic` flag is set to true, no cache comparison is done.
   * Otherwise, the buffer will be updated only if the cache differs.
   */
  update() {
    if (!this._noUBO) {
      if (this.bindUniformBuffer(), !this._buffer) {
        this.create();
        return;
      }
      if (!this._dynamic && !this._needSync) {
        this._createBufferOnWrite = this._engine._features.trackUbosInFrame;
        return;
      }
      if (this._buffers && this._buffers.length > 1 && this._buffers[this._bufferIndex][1])
        if (this._buffersEqual(this._bufferData, this._buffers[this._bufferIndex][1])) {
          this._needSync = !1, this._createBufferOnWrite = this._engine._features.trackUbosInFrame;
          return;
        } else
          this._copyBuffer(this._bufferData, this._buffers[this._bufferIndex][1]);
      this._engine.updateUniformBuffer(this._buffer, this._bufferData), this._engine._features._collectUbosUpdatedInFrame && (yr._UpdatedUbosInFrame[this._name] || (yr._UpdatedUbosInFrame[this._name] = 0), yr._UpdatedUbosInFrame[this._name]++), this._needSync = !1, this._createBufferOnWrite = this._engine._features.trackUbosInFrame;
    }
  }
  _createNewBuffer() {
    this._bufferIndex + 1 < this._buffers.length ? (this._bufferIndex++, this._buffer = this._buffers[this._bufferIndex][0], this._createBufferOnWrite = !1, this._needSync = !0) : this._rebuild();
  }
  _checkNewFrame() {
    this._engine._features.trackUbosInFrame && this._currentFrameId !== this._engine.frameId && (this._currentFrameId = this._engine.frameId, this._createBufferOnWrite = !1, this._buffers && this._buffers.length > 0 ? (this._needSync = this._bufferIndex !== 0, this._bufferIndex = 0, this._buffer = this._buffers[this._bufferIndex][0]) : this._bufferIndex = -1);
  }
  /**
   * Updates the value of an uniform. The `update` method must be called afterwards to make it effective in the GPU.
   * @param uniformName Define the name of the uniform, as used in the uniform block in the shader.
   * @param data Define the flattened data
   * @param size Define the size of the data.
   */
  updateUniform(e, t, r) {
    this._checkNewFrame();
    let n = this._uniformLocations[e];
    if (n === void 0) {
      if (this._buffer) {
        Se.Error("Cannot add an uniform after UBO has been created.");
        return;
      }
      this.addUniform(e, r), n = this._uniformLocations[e];
    }
    if (this._buffer || this.create(), this._dynamic)
      for (let i = 0; i < r; i++)
        this._bufferData[n + i] = t[i];
    else {
      let i = !1;
      for (let s = 0; s < r; s++)
        (r === 16 && !this._engine._features.uniformBufferHardCheckMatrix || this._bufferData[n + s] !== Math.fround(t[s])) && (i = !0, this._createBufferOnWrite && this._createNewBuffer(), this._bufferData[n + s] = t[s]);
      this._needSync = this._needSync || i;
    }
  }
  /**
   * Updates the value of an uniform. The `update` method must be called afterwards to make it effective in the GPU.
   * @param uniformName Define the name of the uniform, as used in the uniform block in the shader.
   * @param data Define the flattened data
   * @param size Define the size of the data.
   */
  updateUniformArray(e, t, r) {
    this._checkNewFrame();
    const n = this._uniformLocations[e];
    if (n === void 0) {
      Se.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");
      return;
    }
    this._buffer || this.create();
    const i = this._uniformArraySizes[e];
    if (this._dynamic)
      for (let s = 0; s < r; s++)
        this._bufferData[n + s] = t[s];
    else {
      let s = !1, a = 0, f = 0;
      for (let o = 0; o < r; o++)
        if (this._bufferData[n + f * 4 + a] !== ye.FloatRound(t[o]) && (s = !0, this._createBufferOnWrite && this._createNewBuffer(), this._bufferData[n + f * 4 + a] = t[o]), a++, a === i.strideSize) {
          for (; a < 4; a++)
            this._bufferData[n + f * 4 + a] = 0;
          a = 0, f++;
        }
      this._needSync = this._needSync || s;
    }
  }
  _cacheMatrix(e, t) {
    this._checkNewFrame();
    const r = this._valueCache[e], n = t.updateFlag;
    return r !== void 0 && r === n ? !1 : (this._valueCache[e] = n, !0);
  }
  // Update methods
  _updateMatrix3x3ForUniform(e, t) {
    for (let r = 0; r < 3; r++)
      yr._TempBuffer[r * 4] = t[r * 3], yr._TempBuffer[r * 4 + 1] = t[r * 3 + 1], yr._TempBuffer[r * 4 + 2] = t[r * 3 + 2], yr._TempBuffer[r * 4 + 3] = 0;
    this.updateUniform(e, yr._TempBuffer, 12);
  }
  _updateMatrix3x3ForEffect(e, t) {
    this._currentEffect.setMatrix3x3(e, t);
  }
  _updateMatrix2x2ForEffect(e, t) {
    this._currentEffect.setMatrix2x2(e, t);
  }
  _updateMatrix2x2ForUniform(e, t) {
    for (let r = 0; r < 2; r++)
      yr._TempBuffer[r * 4] = t[r * 2], yr._TempBuffer[r * 4 + 1] = t[r * 2 + 1], yr._TempBuffer[r * 4 + 2] = 0, yr._TempBuffer[r * 4 + 3] = 0;
    this.updateUniform(e, yr._TempBuffer, 8);
  }
  _updateFloatForEffect(e, t) {
    this._currentEffect.setFloat(e, t);
  }
  _updateFloatForUniform(e, t) {
    yr._TempBuffer[0] = t, this.updateUniform(e, yr._TempBuffer, 1);
  }
  _updateFloat2ForEffect(e, t, r, n = "") {
    this._currentEffect.setFloat2(e + n, t, r);
  }
  _updateFloat2ForUniform(e, t, r) {
    yr._TempBuffer[0] = t, yr._TempBuffer[1] = r, this.updateUniform(e, yr._TempBuffer, 2);
  }
  _updateFloat3ForEffect(e, t, r, n, i = "") {
    this._currentEffect.setFloat3(e + i, t, r, n);
  }
  _updateFloat3ForUniform(e, t, r, n) {
    yr._TempBuffer[0] = t, yr._TempBuffer[1] = r, yr._TempBuffer[2] = n, this.updateUniform(e, yr._TempBuffer, 3);
  }
  _updateFloat4ForEffect(e, t, r, n, i, s = "") {
    this._currentEffect.setFloat4(e + s, t, r, n, i);
  }
  _updateFloat4ForUniform(e, t, r, n, i) {
    yr._TempBuffer[0] = t, yr._TempBuffer[1] = r, yr._TempBuffer[2] = n, yr._TempBuffer[3] = i, this.updateUniform(e, yr._TempBuffer, 4);
  }
  _updateFloatArrayForEffect(e, t) {
    this._currentEffect.setFloatArray(e, t);
  }
  _updateFloatArrayForUniform(e, t) {
    this.updateUniformArray(e, t, t.length);
  }
  _updateArrayForEffect(e, t) {
    this._currentEffect.setArray(e, t);
  }
  _updateArrayForUniform(e, t) {
    this.updateUniformArray(e, t, t.length);
  }
  _updateIntArrayForEffect(e, t) {
    this._currentEffect.setIntArray(e, t);
  }
  _updateIntArrayForUniform(e, t) {
    yr._TempBufferInt32View.set(t), this.updateUniformArray(e, yr._TempBuffer, t.length);
  }
  _updateUIntArrayForEffect(e, t) {
    this._currentEffect.setUIntArray(e, t);
  }
  _updateUIntArrayForUniform(e, t) {
    yr._TempBufferUInt32View.set(t), this.updateUniformArray(e, yr._TempBuffer, t.length);
  }
  _updateMatrixForEffect(e, t) {
    this._currentEffect.setMatrix(e, t);
  }
  _updateMatrixForUniform(e, t) {
    this._cacheMatrix(e, t) && this.updateUniform(e, t.toArray(), 16);
  }
  _updateMatricesForEffect(e, t) {
    this._currentEffect.setMatrices(e, t);
  }
  _updateMatricesForUniform(e, t) {
    this.updateUniform(e, t, t.length);
  }
  _updateVector3ForEffect(e, t) {
    this._currentEffect.setVector3(e, t);
  }
  _updateVector3ForUniform(e, t) {
    yr._TempBuffer[0] = t.x, yr._TempBuffer[1] = t.y, yr._TempBuffer[2] = t.z, this.updateUniform(e, yr._TempBuffer, 3);
  }
  _updateVector4ForEffect(e, t) {
    this._currentEffect.setVector4(e, t);
  }
  _updateVector4ForUniform(e, t) {
    yr._TempBuffer[0] = t.x, yr._TempBuffer[1] = t.y, yr._TempBuffer[2] = t.z, yr._TempBuffer[3] = t.w, this.updateUniform(e, yr._TempBuffer, 4);
  }
  _updateColor3ForEffect(e, t, r = "") {
    this._currentEffect.setColor3(e + r, t);
  }
  _updateColor3ForUniform(e, t) {
    yr._TempBuffer[0] = t.r, yr._TempBuffer[1] = t.g, yr._TempBuffer[2] = t.b, this.updateUniform(e, yr._TempBuffer, 3);
  }
  _updateColor4ForEffect(e, t, r, n = "") {
    this._currentEffect.setColor4(e + n, t, r);
  }
  _updateDirectColor4ForEffect(e, t, r = "") {
    this._currentEffect.setDirectColor4(e + r, t);
  }
  _updateColor4ForUniform(e, t, r) {
    yr._TempBuffer[0] = t.r, yr._TempBuffer[1] = t.g, yr._TempBuffer[2] = t.b, yr._TempBuffer[3] = r, this.updateUniform(e, yr._TempBuffer, 4);
  }
  _updateDirectColor4ForUniform(e, t) {
    yr._TempBuffer[0] = t.r, yr._TempBuffer[1] = t.g, yr._TempBuffer[2] = t.b, yr._TempBuffer[3] = t.a, this.updateUniform(e, yr._TempBuffer, 4);
  }
  _updateIntForEffect(e, t, r = "") {
    this._currentEffect.setInt(e + r, t);
  }
  _updateIntForUniform(e, t) {
    yr._TempBufferInt32View[0] = t, this.updateUniform(e, yr._TempBuffer, 1);
  }
  _updateInt2ForEffect(e, t, r, n = "") {
    this._currentEffect.setInt2(e + n, t, r);
  }
  _updateInt2ForUniform(e, t, r) {
    yr._TempBufferInt32View[0] = t, yr._TempBufferInt32View[1] = r, this.updateUniform(e, yr._TempBuffer, 2);
  }
  _updateInt3ForEffect(e, t, r, n, i = "") {
    this._currentEffect.setInt3(e + i, t, r, n);
  }
  _updateInt3ForUniform(e, t, r, n) {
    yr._TempBufferInt32View[0] = t, yr._TempBufferInt32View[1] = r, yr._TempBufferInt32View[2] = n, this.updateUniform(e, yr._TempBuffer, 3);
  }
  _updateInt4ForEffect(e, t, r, n, i, s = "") {
    this._currentEffect.setInt4(e + s, t, r, n, i);
  }
  _updateInt4ForUniform(e, t, r, n, i) {
    yr._TempBufferInt32View[0] = t, yr._TempBufferInt32View[1] = r, yr._TempBufferInt32View[2] = n, yr._TempBufferInt32View[3] = i, this.updateUniform(e, yr._TempBuffer, 4);
  }
  _updateUIntForEffect(e, t, r = "") {
    this._currentEffect.setUInt(e + r, t);
  }
  _updateUIntForUniform(e, t) {
    yr._TempBufferUInt32View[0] = t, this.updateUniform(e, yr._TempBuffer, 1);
  }
  _updateUInt2ForEffect(e, t, r, n = "") {
    this._currentEffect.setUInt2(e + n, t, r);
  }
  _updateUInt2ForUniform(e, t, r) {
    yr._TempBufferUInt32View[0] = t, yr._TempBufferUInt32View[1] = r, this.updateUniform(e, yr._TempBuffer, 2);
  }
  _updateUInt3ForEffect(e, t, r, n, i = "") {
    this._currentEffect.setUInt3(e + i, t, r, n);
  }
  _updateUInt3ForUniform(e, t, r, n) {
    yr._TempBufferUInt32View[0] = t, yr._TempBufferUInt32View[1] = r, yr._TempBufferUInt32View[2] = n, this.updateUniform(e, yr._TempBuffer, 3);
  }
  _updateUInt4ForEffect(e, t, r, n, i, s = "") {
    this._currentEffect.setUInt4(e + s, t, r, n, i);
  }
  _updateUInt4ForUniform(e, t, r, n, i) {
    yr._TempBufferUInt32View[0] = t, yr._TempBufferUInt32View[1] = r, yr._TempBufferUInt32View[2] = n, yr._TempBufferUInt32View[3] = i, this.updateUniform(e, yr._TempBuffer, 4);
  }
  /**
   * Sets a sampler uniform on the effect.
   * @param name Define the name of the sampler.
   * @param texture Define the texture to set in the sampler
   */
  setTexture(e, t) {
    this._currentEffect.setTexture(e, t);
  }
  /**
   * Sets a sampler uniform on the effect.
   * @param name Define the name of the sampler.
   * @param texture Define the (internal) texture to set in the sampler
   */
  bindTexture(e, t) {
    this._currentEffect._bindTexture(e, t);
  }
  /**
   * Directly updates the value of the uniform in the cache AND on the GPU.
   * @param uniformName Define the name of the uniform, as used in the uniform block in the shader.
   * @param data Define the flattened data
   */
  updateUniformDirectly(e, t) {
    this.updateUniform(e, t, t.length), this.update();
  }
  /**
   * Associates an effect to this uniform buffer
   * @param effect Define the effect to associate the buffer to
   * @param name Name of the uniform block in the shader.
   */
  bindToEffect(e, t) {
    this._currentEffect = e, this._currentEffectName = t;
  }
  /**
   * Binds the current (GPU) buffer to the effect
   */
  bindUniformBuffer() {
    !this._noUBO && this._buffer && this._currentEffect && this._currentEffect.bindUniformBuffer(this._buffer, this._currentEffectName);
  }
  /**
   * Dissociates the current effect from this uniform buffer
   */
  unbindEffect() {
    this._currentEffect = void 0, this._currentEffectName = void 0;
  }
  /**
   * Sets the current state of the class (_bufferIndex, _buffer) to point to the data buffer passed in parameter if this buffer is one of the buffers handled by the class (meaning if it can be found in the _buffers array)
   * This method is meant to be able to update a buffer at any time: just call setDataBuffer to set the class in the right state, call some updateXXX methods and then call udpate() => that will update the GPU buffer on the graphic card
   * @param dataBuffer buffer to look for
   * @returns true if the buffer has been found and the class internal state points to it, else false
   */
  setDataBuffer(e) {
    if (!this._buffers)
      return this._buffer === e;
    for (let t = 0; t < this._buffers.length; ++t)
      if (this._buffers[t][0] === e)
        return this._bufferIndex = t, this._buffer = e, this._createBufferOnWrite = !1, this._currentEffect = void 0, !0;
    return !1;
  }
  /**
   * Disposes the uniform buffer.
   */
  dispose() {
    if (this._noUBO)
      return;
    const e = this._engine._uniformBuffers, t = e.indexOf(this);
    if (t !== -1 && (e[t] = e[e.length - 1], e.pop()), this._engine._features.trackUbosInFrame && this._buffers)
      for (let r = 0; r < this._buffers.length; ++r) {
        const n = this._buffers[r][0];
        this._engine._releaseBuffer(n);
      }
    else
      this._buffer && this._engine._releaseBuffer(this._buffer) && (this._buffer = null);
  }
}
yr._UpdatedUbosInFrame = {};
yr._MAX_UNIFORM_SIZE = 256;
yr._TempBuffer = new Float32Array(yr._MAX_UNIFORM_SIZE);
yr._TempBufferInt32View = new Int32Array(yr._TempBuffer.buffer);
yr._TempBufferUInt32View = new Uint32Array(yr._TempBuffer.buffer);
let P9 = class {
  /**
   * Gets a boolean indicating if the Buffer is disposed
   */
  get isDisposed() {
    return this._isDisposed;
  }
  /**
   * Constructor
   * @param engine the engine
   * @param data the data to use for this buffer
   * @param updatable whether the data is updatable
   * @param stride the stride (optional)
   * @param postponeInternalCreation whether to postpone creating the internal WebGL buffer (optional)
   * @param instanced whether the buffer is instanced (optional)
   * @param useBytes set to true if the stride in in bytes (optional)
   * @param divisor sets an optional divisor for instances (1 by default)
   * @param label defines the label of the buffer (for debug purpose)
   */
  constructor(e, t, r, n = 0, i = !1, s = !1, a = !1, f, o) {
    this._isAlreadyOwned = !1, this._isDisposed = !1, e && e.getScene ? this._engine = e.getScene().getEngine() : this._engine = e, this._updatable = r, this._instanced = s, this._divisor = f || 1, this._label = o, t instanceof tg ? (this._data = null, this._buffer = t) : (this._data = t, this._buffer = null), this.byteStride = a ? n : n * Float32Array.BYTES_PER_ELEMENT, i || this.create();
  }
  /**
   * Create a new VertexBuffer based on the current buffer
   * @param kind defines the vertex buffer kind (position, normal, etc.)
   * @param offset defines offset in the buffer (0 by default)
   * @param size defines the size in floats of attributes (position is 3 for instance)
   * @param stride defines the stride size in floats in the buffer (the offset to apply to reach next value when data is interleaved)
   * @param instanced defines if the vertex buffer contains indexed data
   * @param useBytes defines if the offset and stride are in bytes     *
   * @param divisor sets an optional divisor for instances (1 by default)
   * @returns the new vertex buffer
   */
  createVertexBuffer(e, t, r, n, i, s = !1, a) {
    const f = s ? t : t * Float32Array.BYTES_PER_ELEMENT, o = n ? s ? n : n * Float32Array.BYTES_PER_ELEMENT : this.byteStride;
    return new J(this._engine, this, e, this._updatable, !0, o, i === void 0 ? this._instanced : i, f, r, void 0, void 0, !0, this._divisor || a);
  }
  // Properties
  /**
   * Gets a boolean indicating if the Buffer is updatable?
   * @returns true if the buffer is updatable
   */
  isUpdatable() {
    return this._updatable;
  }
  /**
   * Gets current buffer's data
   * @returns a DataArray or null
   */
  getData() {
    return this._data;
  }
  /**
   * Gets underlying native buffer
   * @returns underlying native buffer
   */
  getBuffer() {
    return this._buffer;
  }
  /**
   * Gets the stride in float32 units (i.e. byte stride / 4).
   * May not be an integer if the byte stride is not divisible by 4.
   * @returns the stride in float32 units
   * @deprecated Please use byteStride instead.
   */
  getStrideSize() {
    return this.byteStride / Float32Array.BYTES_PER_ELEMENT;
  }
  // Methods
  /**
   * Store data into the buffer. Creates the buffer if not used already.
   * If the buffer was already used, it will be updated only if it is updatable, otherwise it will do nothing.
   * @param data defines the data to store
   */
  create(e = null) {
    !e && this._buffer || (e = e || this._data, e && (this._buffer ? this._updatable && (this._engine.updateDynamicVertexBuffer(this._buffer, e), this._data = e) : this._updatable ? (this._buffer = this._engine.createDynamicVertexBuffer(e, this._label), this._data = e) : this._buffer = this._engine.createVertexBuffer(e, void 0, this._label)));
  }
  /** @internal */
  _rebuild() {
    this._buffer = null, this.create(this._data);
  }
  /**
   * Update current buffer data
   * @param data defines the data to store
   */
  update(e) {
    this.create(e);
  }
  /**
   * Updates the data directly.
   * @param data the new data
   * @param offset the new offset
   * @param vertexCount the vertex count (optional)
   * @param useBytes set to true if the offset is in bytes
   */
  updateDirectly(e, t, r, n = !1) {
    this._buffer && this._updatable && (this._engine.updateDynamicVertexBuffer(this._buffer, e, n ? t : t * Float32Array.BYTES_PER_ELEMENT, r ? r * this.byteStride : void 0), t === 0 && r === void 0 ? this._data = e : this._data = null);
  }
  /** @internal */
  _increaseReferences() {
    if (this._buffer) {
      if (!this._isAlreadyOwned) {
        this._isAlreadyOwned = !0;
        return;
      }
      this._buffer.references++;
    }
  }
  /**
   * Release all resources
   */
  dispose() {
    this._buffer && this._engine._releaseBuffer(this._buffer) && (this._isDisposed = !0, this._data = null, this._buffer = null);
  }
};
class J {
  /**
   * Gets a boolean indicating if the Buffer is disposed
   */
  get isDisposed() {
    return this._isDisposed;
  }
  /**
   * Gets or sets the instance divisor when in instanced mode
   */
  get instanceDivisor() {
    return this._instanceDivisor;
  }
  set instanceDivisor(e) {
    const t = e != 0;
    this._instanceDivisor = e, t !== this._instanced && (this._instanced = t, this._computeHashCode());
  }
  /**
   * Gets the number of vertices in the buffer
   */
  get totalVertices() {
    const e = this.getData();
    return e ? Array.isArray(e) ? e.length / (this.byteStride / 4) - this.byteOffset / 4 : (e.byteLength - this.byteOffset) / this.byteStride : 0;
  }
  /** @internal */
  constructor(e, t, r, n, i, s, a, f, o, d, v = !1, u = !1, l = 1, P = !1) {
    var p, c, H, T, q;
    this._isDisposed = !1;
    let b = !1;
    if (this.engine = e, typeof n == "object" && n !== null ? (b = (p = n.updatable) !== null && p !== void 0 ? p : !1, i = n.postponeInternalCreation, s = n.stride, a = n.instanced, f = n.offset, o = n.size, d = n.type, v = (c = n.normalized) !== null && c !== void 0 ? c : !1, u = (H = n.useBytes) !== null && H !== void 0 ? H : !1, l = (T = n.divisor) !== null && T !== void 0 ? T : 1, P = (q = n.takeBufferOwnership) !== null && q !== void 0 ? q : !1, this._label = n.label) : b = !!n, t instanceof P9 ? (this._buffer = t, this._ownsBuffer = P) : (this._buffer = new P9(e, t, b, s, i, a, u, l, this._label), this._ownsBuffer = !0), this.uniqueId = J._Counter++, this._kind = r, d === void 0) {
      const w = this.getData();
      this.type = w ? J.GetDataType(w) : J.FLOAT;
    } else
      this.type = d;
    const j = J.GetTypeByteLength(this.type);
    u ? (this._size = o || (s ? s / j : J.DeduceStride(r)), this.byteStride = s || this._buffer.byteStride || this._size * j, this.byteOffset = f || 0) : (this._size = o || s || J.DeduceStride(r), this.byteStride = s ? s * j : this._buffer.byteStride || this._size * j, this.byteOffset = (f || 0) * j), this.normalized = v, this._instanced = a !== void 0 ? a : !1, this._instanceDivisor = a ? l : 0, this._alignBuffer(), this._computeHashCode();
  }
  _computeHashCode() {
    this.hashCode = (this.type - 5120 << 0) + ((this.normalized ? 1 : 0) << 3) + (this._size << 4) + ((this._instanced ? 1 : 0) << 6) + /* keep 5 bits free */
    (this.byteStride << 12);
  }
  /** @internal */
  _rebuild() {
    var e;
    (e = this._buffer) === null || e === void 0 || e._rebuild();
  }
  /**
   * Returns the kind of the VertexBuffer (string)
   * @returns a string
   */
  getKind() {
    return this._kind;
  }
  // Properties
  /**
   * Gets a boolean indicating if the VertexBuffer is updatable?
   * @returns true if the buffer is updatable
   */
  isUpdatable() {
    return this._buffer.isUpdatable();
  }
  /**
   * Gets current buffer's data
   * @returns a DataArray or null
   */
  getData() {
    return this._buffer.getData();
  }
  /**
   * Gets current buffer's data as a float array. Float data is constructed if the vertex buffer data cannot be returned directly.
   * @param totalVertices number of vertices in the buffer to take into account
   * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
   * @returns a float array containing vertex data
   */
  getFloatData(e, t) {
    const r = this.getData();
    return r ? (e = e ?? this.totalVertices, J.GetFloatData(r, this._size, this.type, this.byteOffset, this.byteStride, this.normalized, e, t)) : null;
  }
  /**
   * Gets underlying native buffer
   * @returns underlying native buffer
   */
  getBuffer() {
    return this._buffer.getBuffer();
  }
  /**
   * Gets the stride in float32 units (i.e. byte stride / 4).
   * May not be an integer if the byte stride is not divisible by 4.
   * @returns the stride in float32 units
   * @deprecated Please use byteStride instead.
   */
  getStrideSize() {
    return this.byteStride / J.GetTypeByteLength(this.type);
  }
  /**
   * Returns the offset as a multiple of the type byte length.
   * @returns the offset in bytes
   * @deprecated Please use byteOffset instead.
   */
  getOffset() {
    return this.byteOffset / J.GetTypeByteLength(this.type);
  }
  /**
   * Returns the number of components or the byte size per vertex attribute
   * @param sizeInBytes If true, returns the size in bytes or else the size in number of components of the vertex attribute (default: false)
   * @returns the number of components
   */
  getSize(e = !1) {
    return e ? this._size * J.GetTypeByteLength(this.type) : this._size;
  }
  /**
   * Gets a boolean indicating is the internal buffer of the VertexBuffer is instanced
   * @returns true if this buffer is instanced
   */
  getIsInstanced() {
    return this._instanced;
  }
  /**
   * Returns the instancing divisor, zero for non-instanced (integer).
   * @returns a number
   */
  getInstanceDivisor() {
    return this._instanceDivisor;
  }
  // Methods
  /**
   * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property
   * @param data defines the data to store
   */
  create(e) {
    this._buffer.create(e), this._alignBuffer();
  }
  /**
   * Updates the underlying buffer according to the passed numeric array or Float32Array.
   * This function will create a new buffer if the current one is not updatable
   * @param data defines the data to store
   */
  update(e) {
    this._buffer.update(e), this._alignBuffer();
  }
  /**
   * Updates directly the underlying WebGLBuffer according to the passed numeric array or Float32Array.
   * Returns the directly updated WebGLBuffer.
   * @param data the new data
   * @param offset the new offset
   * @param useBytes set to true if the offset is in bytes
   */
  updateDirectly(e, t, r = !1) {
    this._buffer.updateDirectly(e, t, void 0, r), this._alignBuffer();
  }
  /**
   * Disposes the VertexBuffer and the underlying WebGLBuffer.
   */
  dispose() {
    this._ownsBuffer && this._buffer.dispose(), this._isDisposed = !0;
  }
  /**
   * Enumerates each value of this vertex buffer as numbers.
   * @param count the number of values to enumerate
   * @param callback the callback function called for each value
   */
  forEach(e, t) {
    J.ForEach(this._buffer.getData(), this.byteOffset, this.byteStride, this._size, this.type, e, this.normalized, t);
  }
  /** @internal */
  _alignBuffer() {
  }
  /**
   * Deduces the stride given a kind.
   * @param kind The kind string to deduce
   * @returns The deduced stride
   */
  static DeduceStride(e) {
    switch (e) {
      case J.UVKind:
      case J.UV2Kind:
      case J.UV3Kind:
      case J.UV4Kind:
      case J.UV5Kind:
      case J.UV6Kind:
        return 2;
      case J.NormalKind:
      case J.PositionKind:
        return 3;
      case J.ColorKind:
      case J.ColorInstanceKind:
      case J.MatricesIndicesKind:
      case J.MatricesIndicesExtraKind:
      case J.MatricesWeightsKind:
      case J.MatricesWeightsExtraKind:
      case J.TangentKind:
        return 4;
      default:
        throw new Error("Invalid kind '" + e + "'");
    }
  }
  /**
   * Gets the vertex buffer type of the given data array.
   * @param data the data array
   * @returns the vertex buffer type
   */
  static GetDataType(e) {
    return e instanceof Int8Array ? J.BYTE : e instanceof Uint8Array ? J.UNSIGNED_BYTE : e instanceof Int16Array ? J.SHORT : e instanceof Uint16Array ? J.UNSIGNED_SHORT : e instanceof Int32Array ? J.INT : e instanceof Uint32Array ? J.UNSIGNED_INT : J.FLOAT;
  }
  /**
   * Gets the byte length of the given type.
   * @param type the type
   * @returns the number of bytes
   */
  static GetTypeByteLength(e) {
    switch (e) {
      case J.BYTE:
      case J.UNSIGNED_BYTE:
        return 1;
      case J.SHORT:
      case J.UNSIGNED_SHORT:
        return 2;
      case J.INT:
      case J.UNSIGNED_INT:
      case J.FLOAT:
        return 4;
      default:
        throw new Error(`Invalid type '${e}'`);
    }
  }
  /**
   * Enumerates each value of the given parameters as numbers.
   * @param data the data to enumerate
   * @param byteOffset the byte offset of the data
   * @param byteStride the byte stride of the data
   * @param componentCount the number of components per element
   * @param componentType the type of the component
   * @param count the number of values to enumerate
   * @param normalized whether the data is normalized
   * @param callback the callback function called for each value
   */
  static ForEach(e, t, r, n, i, s, a, f) {
    if (e instanceof Array) {
      let o = t / 4;
      const d = r / 4;
      for (let v = 0; v < s; v += n) {
        for (let u = 0; u < n; u++)
          f(e[o + u], v + u);
        o += d;
      }
    } else {
      const o = e instanceof ArrayBuffer ? new DataView(e) : new DataView(e.buffer, e.byteOffset, e.byteLength), d = J.GetTypeByteLength(i);
      for (let v = 0; v < s; v += n) {
        let u = t;
        for (let l = 0; l < n; l++) {
          const P = J._GetFloatValue(o, i, u, a);
          f(P, v + l), u += d;
        }
        t += r;
      }
    }
  }
  static _GetFloatValue(e, t, r, n) {
    switch (t) {
      case J.BYTE: {
        let i = e.getInt8(r);
        return n && (i = Math.max(i / 127, -1)), i;
      }
      case J.UNSIGNED_BYTE: {
        let i = e.getUint8(r);
        return n && (i = i / 255), i;
      }
      case J.SHORT: {
        let i = e.getInt16(r, !0);
        return n && (i = Math.max(i / 32767, -1)), i;
      }
      case J.UNSIGNED_SHORT: {
        let i = e.getUint16(r, !0);
        return n && (i = i / 65535), i;
      }
      case J.INT:
        return e.getInt32(r, !0);
      case J.UNSIGNED_INT:
        return e.getUint32(r, !0);
      case J.FLOAT:
        return e.getFloat32(r, !0);
      default:
        throw new Error(`Invalid component type ${t}`);
    }
  }
  /**
   * Gets the given data array as a float array. Float data is constructed if the data array cannot be returned directly.
   * @param data the input data array
   * @param size the number of components
   * @param type the component type
   * @param byteOffset the byte offset of the data
   * @param byteStride the byte stride of the data
   * @param normalized whether the data is normalized
   * @param totalVertices number of vertices in the buffer to take into account
   * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
   * @returns a float array containing vertex data
   */
  static GetFloatData(e, t, r, n, i, s, a, f) {
    const o = t * J.GetTypeByteLength(r), d = a * t;
    if (r !== J.FLOAT || i !== o) {
      const v = new Float32Array(d);
      return J.ForEach(e, n, i, t, r, d, s, (u, l) => v[l] = u), v;
    }
    if (!(e instanceof Array || e instanceof Float32Array) || n !== 0 || e.length !== d)
      if (e instanceof Array) {
        const v = n / 4;
        return e.slice(v, v + d);
      } else {
        if (e instanceof ArrayBuffer)
          return new Float32Array(e, n, d);
        {
          let v = e.byteOffset + n;
          if (f) {
            const l = new Float32Array(d), P = new Float32Array(e.buffer, v, d);
            return l.set(P), l;
          }
          const u = v % 4;
          return u && (v = Math.max(0, v - u)), new Float32Array(e.buffer, v, d);
        }
      }
    return f ? e.slice() : e;
  }
}
J._Counter = 0;
J.BYTE = 5120;
J.UNSIGNED_BYTE = 5121;
J.SHORT = 5122;
J.UNSIGNED_SHORT = 5123;
J.INT = 5124;
J.UNSIGNED_INT = 5125;
J.FLOAT = 5126;
J.PositionKind = "position";
J.NormalKind = "normal";
J.TangentKind = "tangent";
J.UVKind = "uv";
J.UV2Kind = "uv2";
J.UV3Kind = "uv3";
J.UV4Kind = "uv4";
J.UV5Kind = "uv5";
J.UV6Kind = "uv6";
J.ColorKind = "color";
J.ColorInstanceKind = "instanceColor";
J.MatricesIndicesKind = "matricesIndices";
J.MatricesWeightsKind = "matricesWeights";
J.MatricesIndicesExtraKind = "matricesIndicesExtra";
J.MatricesWeightsExtraKind = "matricesWeightsExtra";
class F9 {
  constructor() {
    this.hit = !1, this.distance = 0, this.pickedPoint = null, this.pickedMesh = null, this.bu = 0, this.bv = 0, this.faceId = -1, this.subMeshFaceId = -1, this.subMeshId = 0, this.pickedSprite = null, this.thinInstanceIndex = -1, this.ray = null, this.originMesh = null, this.aimTransform = null, this.gripTransform = null;
  }
  /**
   * Gets the normal corresponding to the face the pick collided with
   * @param useWorldCoordinates If the resulting normal should be relative to the world (default: false)
   * @param useVerticesNormals If the vertices normals should be used to calculate the normal instead of the normal map (default: true)
   * @returns The normal corresponding to the face the pick collided with
   * @remarks Note that the returned normal will always point towards the picking ray.
   */
  getNormal(e = !1, t = !0) {
    if (!this.pickedMesh || t && !this.pickedMesh.isVerticesDataPresent(J.NormalKind))
      return null;
    let r = this.pickedMesh.getIndices();
    (r == null ? void 0 : r.length) === 0 && (r = null);
    let n;
    const i = ue.Vector3[0], s = ue.Vector3[1], a = ue.Vector3[2];
    if (t) {
      const o = this.pickedMesh.getVerticesData(J.NormalKind);
      let d = r ? S.FromArrayToRef(o, r[this.faceId * 3] * 3, i) : i.copyFromFloats(o[this.faceId * 3 * 3], o[this.faceId * 3 * 3 + 1], o[this.faceId * 3 * 3 + 2]), v = r ? S.FromArrayToRef(o, r[this.faceId * 3 + 1] * 3, s) : s.copyFromFloats(o[(this.faceId * 3 + 1) * 3], o[(this.faceId * 3 + 1) * 3 + 1], o[(this.faceId * 3 + 1) * 3 + 2]), u = r ? S.FromArrayToRef(o, r[this.faceId * 3 + 2] * 3, a) : a.copyFromFloats(o[(this.faceId * 3 + 2) * 3], o[(this.faceId * 3 + 2) * 3 + 1], o[(this.faceId * 3 + 2) * 3 + 2]);
      d = d.scale(this.bu), v = v.scale(this.bv), u = u.scale(1 - this.bu - this.bv), n = new S(d.x + v.x + u.x, d.y + v.y + u.y, d.z + v.z + u.z);
    } else {
      const o = this.pickedMesh.getVerticesData(J.PositionKind), d = r ? S.FromArrayToRef(o, r[this.faceId * 3] * 3, i) : i.copyFromFloats(o[this.faceId * 3 * 3], o[this.faceId * 3 * 3 + 1], o[this.faceId * 3 * 3 + 2]), v = r ? S.FromArrayToRef(o, r[this.faceId * 3 + 1] * 3, s) : s.copyFromFloats(o[(this.faceId * 3 + 1) * 3], o[(this.faceId * 3 + 1) * 3 + 1], o[(this.faceId * 3 + 1) * 3 + 2]), u = r ? S.FromArrayToRef(o, r[this.faceId * 3 + 2] * 3, a) : a.copyFromFloats(o[(this.faceId * 3 + 2) * 3], o[(this.faceId * 3 + 2) * 3 + 1], o[(this.faceId * 3 + 2) * 3 + 2]), l = d.subtract(v), P = u.subtract(v);
      n = S.Cross(l, P);
    }
    const f = (o, d) => {
      let v = o.getWorldMatrix();
      o.nonUniformScaling && (ue.Matrix[0].copyFrom(v), v = ue.Matrix[0], v.setTranslationFromFloats(0, 0, 0), v.invert(), v.transposeToRef(ue.Matrix[1]), v = ue.Matrix[1]), S.TransformNormalToRef(d, v, d);
    };
    if (e && f(this.pickedMesh, n), this.ray) {
      const o = ue.Vector3[0].copyFrom(n);
      e || f(this.pickedMesh, o), S.Dot(o, this.ray.direction) > 0 && n.negateInPlace();
    }
    return n.normalize(), n;
  }
  /**
   * Gets the texture coordinates of where the pick occurred
   * @param uvSet The UV set to use to calculate the texture coordinates (default: VertexBuffer.UVKind)
   * @returns The vector containing the coordinates of the texture
   */
  getTextureCoordinates(e = J.UVKind) {
    if (!this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(e))
      return null;
    const t = this.pickedMesh.getIndices();
    if (!t)
      return null;
    const r = this.pickedMesh.getVerticesData(e);
    if (!r)
      return null;
    let n = at.FromArray(r, t[this.faceId * 3] * 2), i = at.FromArray(r, t[this.faceId * 3 + 1] * 2), s = at.FromArray(r, t[this.faceId * 3 + 2] * 2);
    return n = n.scale(this.bu), i = i.scale(this.bv), s = s.scale(1 - this.bu - this.bv), new at(n.x + i.x + s.x, n.y + i.y + s.y);
  }
}
class yI {
  /**
   * Creates a new instance PostProcess
   * @param scene The scene that the post process is associated with.
   */
  constructor(e) {
    this._vertexBuffers = {}, this._scene = e;
  }
  _prepareBuffers() {
    if (this._vertexBuffers[J.PositionKind])
      return;
    const e = [];
    e.push(1, 1), e.push(-1, 1), e.push(-1, -1), e.push(1, -1), this._vertexBuffers[J.PositionKind] = new J(this._scene.getEngine(), e, J.PositionKind, !1, !1, 2), this._buildIndexBuffer();
  }
  _buildIndexBuffer() {
    const e = [];
    e.push(0), e.push(1), e.push(2), e.push(0), e.push(2), e.push(3), this._indexBuffer = this._scene.getEngine().createIndexBuffer(e);
  }
  /**
   * Rebuilds the vertex buffers of the manager.
   * @internal
   */
  _rebuild() {
    const e = this._vertexBuffers[J.PositionKind];
    e && (e._rebuild(), this._buildIndexBuffer());
  }
  // Methods
  /**
   * Prepares a frame to be run through a post process.
   * @param sourceTexture The input texture to the post processes. (default: null)
   * @param postProcesses An array of post processes to be run. (default: null)
   * @returns True if the post processes were able to be run.
   * @internal
   */
  _prepareFrame(e = null, t = null) {
    const r = this._scene.activeCamera;
    return !r || (t = t || r._postProcesses.filter((n) => n != null), !t || t.length === 0 || !this._scene.postProcessesEnabled) ? !1 : (t[0].activate(r, e, t != null), !0);
  }
  /**
   * Manually render a set of post processes to a texture.
   * Please note, the frame buffer won't be unbound after the call in case you have more render to do.
   * @param postProcesses An array of post processes to be run.
   * @param targetTexture The render target wrapper to render to.
   * @param forceFullscreenViewport force gl.viewport to be full screen eg. 0,0,textureWidth,textureHeight
   * @param faceIndex defines the face to render to if a cubemap is defined as the target
   * @param lodLevel defines which lod of the texture to render to
   * @param doNotBindFrambuffer If set to true, assumes that the framebuffer has been bound previously
   */
  directRender(e, t = null, r = !1, n = 0, i = 0, s = !1) {
    var a;
    const f = this._scene.getEngine();
    for (let o = 0; o < e.length; o++) {
      o < e.length - 1 ? e[o + 1].activate(this._scene.activeCamera, t == null ? void 0 : t.texture) : (t ? f.bindFramebuffer(t, n, void 0, void 0, r, i) : s || f.restoreDefaultFramebuffer(), (a = f._debugInsertMarker) === null || a === void 0 || a.call(f, `post process ${e[o].name} output`));
      const d = e[o], v = d.apply();
      v && (d.onBeforeRenderObservable.notifyObservers(v), this._prepareBuffers(), f.bindBuffers(this._vertexBuffers, this._indexBuffer, v), f.drawElementsType(0, 0, 6), d.onAfterRenderObservable.notifyObservers(v));
    }
    f.setDepthBuffer(!0), f.setDepthWrite(!0);
  }
  /**
   * Finalize the result of the output of the postprocesses.
   * @param doNotPresent If true the result will not be displayed to the screen.
   * @param targetTexture The render target wrapper to render to.
   * @param faceIndex The index of the face to bind the target texture to.
   * @param postProcesses The array of post processes to render.
   * @param forceFullscreenViewport force gl.viewport to be full screen eg. 0,0,textureWidth,textureHeight (default: false)
   * @internal
   */
  _finalizeFrame(e, t, r, n, i = !1) {
    var s;
    const a = this._scene.activeCamera;
    if (!a || (n = n || a._postProcesses.filter((o) => o != null), n.length === 0 || !this._scene.postProcessesEnabled))
      return;
    const f = this._scene.getEngine();
    for (let o = 0, d = n.length; o < d; o++) {
      const v = n[o];
      if (o < d - 1 ? v._outputTexture = n[o + 1].activate(a, t == null ? void 0 : t.texture) : (t ? (f.bindFramebuffer(t, r, void 0, void 0, i), v._outputTexture = t) : (f.restoreDefaultFramebuffer(), v._outputTexture = null), (s = f._debugInsertMarker) === null || s === void 0 || s.call(f, `post process ${n[o].name} output`)), e)
        break;
      const u = v.apply();
      u && (v.onBeforeRenderObservable.notifyObservers(u), this._prepareBuffers(), f.bindBuffers(this._vertexBuffers, this._indexBuffer, u), f.drawElementsType(0, 0, 6), v.onAfterRenderObservable.notifyObservers(u));
    }
    f.setDepthBuffer(!0), f.setDepthWrite(!0), f.setAlphaMode(0);
  }
  /**
   * Disposes of the post process manager.
   */
  dispose() {
    const e = this._vertexBuffers[J.PositionKind];
    e && (e.dispose(), this._vertexBuffers[J.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null);
  }
}
class x0 {
  /**
   * Set the opaque sort comparison function.
   * If null the sub meshes will be render in the order they were created
   */
  set opaqueSortCompareFn(e) {
    e ? this._opaqueSortCompareFn = e : this._opaqueSortCompareFn = x0.PainterSortCompare, this._renderOpaque = this._renderOpaqueSorted;
  }
  /**
   * Set the alpha test sort comparison function.
   * If null the sub meshes will be render in the order they were created
   */
  set alphaTestSortCompareFn(e) {
    e ? this._alphaTestSortCompareFn = e : this._alphaTestSortCompareFn = x0.PainterSortCompare, this._renderAlphaTest = this._renderAlphaTestSorted;
  }
  /**
   * Set the transparent sort comparison function.
   * If null the sub meshes will be render in the order they were created
   */
  set transparentSortCompareFn(e) {
    e ? this._transparentSortCompareFn = e : this._transparentSortCompareFn = x0.defaultTransparentSortCompare, this._renderTransparent = this._renderTransparentSorted;
  }
  /**
   * Creates a new rendering group.
   * @param index The rendering group index
   * @param scene
   * @param opaqueSortCompareFn The opaque sort comparison function. If null no order is applied
   * @param alphaTestSortCompareFn The alpha test sort comparison function. If null no order is applied
   * @param transparentSortCompareFn The transparent sort comparison function. If null back to front + alpha index sort is applied
   */
  constructor(e, t, r = null, n = null, i = null) {
    this.index = e, this._opaqueSubMeshes = new qf(256), this._transparentSubMeshes = new qf(256), this._alphaTestSubMeshes = new qf(256), this._depthOnlySubMeshes = new qf(256), this._particleSystems = new qf(256), this._spriteManagers = new qf(256), this._empty = !0, this._edgesRenderers = new K8(16), this._scene = t, this.opaqueSortCompareFn = r, this.alphaTestSortCompareFn = n, this.transparentSortCompareFn = i;
  }
  /**
   * Render all the sub meshes contained in the group.
   * @param customRenderFunction Used to override the default render behaviour of the group.
   * @param renderSprites
   * @param renderParticles
   * @param activeMeshes
   * @returns true if rendered some submeshes.
   */
  render(e, t, r, n) {
    if (e) {
      e(this._opaqueSubMeshes, this._alphaTestSubMeshes, this._transparentSubMeshes, this._depthOnlySubMeshes);
      return;
    }
    const i = this._scene.getEngine();
    this._depthOnlySubMeshes.length !== 0 && (i.setColorWrite(!1), this._renderAlphaTest(this._depthOnlySubMeshes), i.setColorWrite(!0)), this._opaqueSubMeshes.length !== 0 && this._renderOpaque(this._opaqueSubMeshes), this._alphaTestSubMeshes.length !== 0 && this._renderAlphaTest(this._alphaTestSubMeshes);
    const s = i.getStencilBuffer();
    if (i.setStencilBuffer(!1), t && this._renderSprites(), r && this._renderParticles(n), this.onBeforeTransparentRendering && this.onBeforeTransparentRendering(), this._transparentSubMeshes.length !== 0 || this._scene.useOrderIndependentTransparency) {
      if (i.setStencilBuffer(s), this._scene.useOrderIndependentTransparency) {
        const a = this._scene.depthPeelingRenderer.render(this._transparentSubMeshes);
        a.length && this._renderTransparent(a);
      } else
        this._renderTransparent(this._transparentSubMeshes);
      i.setAlphaMode(0);
    }
    if (i.setStencilBuffer(!1), this._edgesRenderers.length) {
      for (let a = 0; a < this._edgesRenderers.length; a++)
        this._edgesRenderers.data[a].render();
      i.setAlphaMode(0);
    }
    i.setStencilBuffer(s);
  }
  /**
   * Renders the opaque submeshes in the order from the opaqueSortCompareFn.
   * @param subMeshes The submeshes to render
   */
  _renderOpaqueSorted(e) {
    return x0._RenderSorted(e, this._opaqueSortCompareFn, this._scene.activeCamera, !1);
  }
  /**
   * Renders the opaque submeshes in the order from the alphatestSortCompareFn.
   * @param subMeshes The submeshes to render
   */
  _renderAlphaTestSorted(e) {
    return x0._RenderSorted(e, this._alphaTestSortCompareFn, this._scene.activeCamera, !1);
  }
  /**
   * Renders the opaque submeshes in the order from the transparentSortCompareFn.
   * @param subMeshes The submeshes to render
   */
  _renderTransparentSorted(e) {
    return x0._RenderSorted(e, this._transparentSortCompareFn, this._scene.activeCamera, !0);
  }
  /**
   * Renders the submeshes in a specified order.
   * @param subMeshes The submeshes to sort before render
   * @param sortCompareFn The comparison function use to sort
   * @param camera The camera position use to preprocess the submeshes to help sorting
   * @param transparent Specifies to activate blending if true
   */
  static _RenderSorted(e, t, r, n) {
    let i = 0, s;
    const a = r ? r.globalPosition : x0._ZeroVector;
    if (n)
      for (; i < e.length; i++)
        s = e.data[i], s._alphaIndex = s.getMesh().alphaIndex, s._distanceToCamera = S.Distance(s.getBoundingInfo().boundingSphere.centerWorld, a);
    const f = e.length === e.data.length ? e.data : e.data.slice(0, e.length);
    t && f.sort(t);
    const o = f[0].getMesh().getScene();
    for (i = 0; i < f.length; i++)
      if (s = f[i], !(o._activeMeshesFrozenButKeepClipping && !s.isInFrustum(o._frustumPlanes))) {
        if (n) {
          const d = s.getMaterial();
          if (d && d.needDepthPrePass) {
            const v = d.getScene().getEngine();
            v.setColorWrite(!1), v.setAlphaMode(0), s.render(!1), v.setColorWrite(!0);
          }
        }
        s.render(n);
      }
  }
  /**
   * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
   * are rendered back to front if in the same alpha index.
   *
   * @param a The first submesh
   * @param b The second submesh
   * @returns The result of the comparison
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static defaultTransparentSortCompare(e, t) {
    return e._alphaIndex > t._alphaIndex ? 1 : e._alphaIndex < t._alphaIndex ? -1 : x0.backToFrontSortCompare(e, t);
  }
  /**
   * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
   * are rendered back to front.
   *
   * @param a The first submesh
   * @param b The second submesh
   * @returns The result of the comparison
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static backToFrontSortCompare(e, t) {
    return e._distanceToCamera < t._distanceToCamera ? 1 : e._distanceToCamera > t._distanceToCamera ? -1 : 0;
  }
  /**
   * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
   * are rendered front to back (prevent overdraw).
   *
   * @param a The first submesh
   * @param b The second submesh
   * @returns The result of the comparison
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static frontToBackSortCompare(e, t) {
    return e._distanceToCamera < t._distanceToCamera ? -1 : e._distanceToCamera > t._distanceToCamera ? 1 : 0;
  }
  /**
   * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
   * are grouped by material then geometry.
   *
   * @param a The first submesh
   * @param b The second submesh
   * @returns The result of the comparison
   */
  static PainterSortCompare(e, t) {
    const r = e.getMesh(), n = t.getMesh();
    return r.material && n.material ? r.material.uniqueId - n.material.uniqueId : r.uniqueId - n.uniqueId;
  }
  /**
   * Resets the different lists of submeshes to prepare a new frame.
   */
  prepare() {
    this._opaqueSubMeshes.reset(), this._transparentSubMeshes.reset(), this._alphaTestSubMeshes.reset(), this._depthOnlySubMeshes.reset(), this._particleSystems.reset(), this.prepareSprites(), this._edgesRenderers.reset(), this._empty = !0;
  }
  /**
   * Resets the different lists of sprites to prepare a new frame.
   */
  prepareSprites() {
    this._spriteManagers.reset();
  }
  dispose() {
    this._opaqueSubMeshes.dispose(), this._transparentSubMeshes.dispose(), this._alphaTestSubMeshes.dispose(), this._depthOnlySubMeshes.dispose(), this._particleSystems.dispose(), this._spriteManagers.dispose(), this._edgesRenderers.dispose();
  }
  /**
   * Inserts the submesh in its correct queue depending on its material.
   * @param subMesh The submesh to dispatch
   * @param [mesh] Optional reference to the submeshes's mesh. Provide if you have an exiting reference to improve performance.
   * @param [material] Optional reference to the submeshes's material. Provide if you have an exiting reference to improve performance.
   */
  dispatch(e, t, r) {
    t === void 0 && (t = e.getMesh()), r === void 0 && (r = e.getMaterial()), r != null && (r.needAlphaBlendingForMesh(t) ? this._transparentSubMeshes.push(e) : r.needAlphaTesting() ? (r.needDepthPrePass && this._depthOnlySubMeshes.push(e), this._alphaTestSubMeshes.push(e)) : (r.needDepthPrePass && this._depthOnlySubMeshes.push(e), this._opaqueSubMeshes.push(e)), t._renderingGroup = this, t._edgesRenderer && t._edgesRenderer.isEnabled && this._edgesRenderers.pushNoDuplicate(t._edgesRenderer), this._empty = !1);
  }
  dispatchSprites(e) {
    this._spriteManagers.push(e), this._empty = !1;
  }
  dispatchParticles(e) {
    this._particleSystems.push(e), this._empty = !1;
  }
  _renderParticles(e) {
    if (this._particleSystems.length === 0)
      return;
    const t = this._scene.activeCamera;
    this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);
    for (let r = 0; r < this._particleSystems.length; r++) {
      const n = this._particleSystems.data[r];
      if ((t && t.layerMask & n.layerMask) === 0)
        continue;
      const i = n.emitter;
      (!i.position || !e || e.indexOf(i) !== -1) && this._scene._activeParticles.addCount(n.render(), !1);
    }
    this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene);
  }
  _renderSprites() {
    if (!this._scene.spritesEnabled || this._spriteManagers.length === 0)
      return;
    const e = this._scene.activeCamera;
    this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);
    for (let t = 0; t < this._spriteManagers.length; t++) {
      const r = this._spriteManagers.data[t];
      (e && e.layerMask & r.layerMask) !== 0 && r.render();
    }
    this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene);
  }
}
x0._ZeroVector = S.Zero();
class L$ {
}
class $6 {
  /**
   * Gets or sets a boolean indicating that the manager will not reset between frames.
   * This means that if a mesh becomes invisible or transparent it will not be visible until this boolean is set to false again.
   * By default, the rendering manager will dispatch all active meshes per frame (moving them to the transparent, opaque or alpha testing lists).
   * By turning this property on, you will accelerate the rendering by keeping all these lists unchanged between frames.
   */
  get maintainStateBetweenFrames() {
    return this._maintainStateBetweenFrames;
  }
  set maintainStateBetweenFrames(e) {
    e !== this._maintainStateBetweenFrames && (this._maintainStateBetweenFrames = e, this._maintainStateBetweenFrames || this.restoreDispachedFlags());
  }
  /**
   * Restore wasDispatched flags on the lists of elements to render.
   */
  restoreDispachedFlags() {
    for (const e of this._scene.meshes)
      if (e.subMeshes)
        for (const t of e.subMeshes)
          t._wasDispatched = !1;
    if (this._scene.spriteManagers)
      for (const e of this._scene.spriteManagers)
        e._wasDispatched = !1;
    for (const e of this._scene.particleSystems)
      e._wasDispatched = !1;
  }
  /**
   * Instantiates a new rendering group for a particular scene
   * @param scene Defines the scene the groups belongs to
   */
  constructor(e) {
    this._useSceneAutoClearSetup = !1, this._renderingGroups = new Array(), this._autoClearDepthStencil = {}, this._customOpaqueSortCompareFn = {}, this._customAlphaTestSortCompareFn = {}, this._customTransparentSortCompareFn = {}, this._renderingGroupInfo = new L$(), this._maintainStateBetweenFrames = !1, this._scene = e;
    for (let t = $6.MIN_RENDERINGGROUPS; t < $6.MAX_RENDERINGGROUPS; t++)
      this._autoClearDepthStencil[t] = { autoClear: !0, depth: !0, stencil: !0 };
  }
  /**
   * Gets the rendering group with the specified id.
   */
  getRenderingGroup(e) {
    const t = e || 0;
    return this._prepareRenderingGroup(t), this._renderingGroups[t];
  }
  _clearDepthStencilBuffer(e = !0, t = !0) {
    this._depthStencilBufferAlreadyCleaned || (this._scene.getEngine().clear(null, !1, e, t), this._depthStencilBufferAlreadyCleaned = !0);
  }
  /**
   * Renders the entire managed groups. This is used by the scene or the different render targets.
   * @internal
   */
  render(e, t, r, n) {
    const i = this._renderingGroupInfo;
    if (i.scene = this._scene, i.camera = this._scene.activeCamera, this._scene.spriteManagers && n)
      for (let s = 0; s < this._scene.spriteManagers.length; s++) {
        const a = this._scene.spriteManagers[s];
        this.dispatchSprites(a);
      }
    for (let s = $6.MIN_RENDERINGGROUPS; s < $6.MAX_RENDERINGGROUPS; s++) {
      this._depthStencilBufferAlreadyCleaned = s === $6.MIN_RENDERINGGROUPS;
      const a = this._renderingGroups[s];
      if (!a || a._empty)
        continue;
      const f = Math.pow(2, s);
      if (i.renderingGroupId = s, this._scene.onBeforeRenderingGroupObservable.notifyObservers(i, f), $6.AUTOCLEAR) {
        const o = this._useSceneAutoClearSetup ? this._scene.getAutoClearDepthStencilSetup(s) : this._autoClearDepthStencil[s];
        o && o.autoClear && this._clearDepthStencilBuffer(o.depth, o.stencil);
      }
      for (const o of this._scene._beforeRenderingGroupDrawStage)
        o.action(s);
      a.render(e, n, r, t);
      for (const o of this._scene._afterRenderingGroupDrawStage)
        o.action(s);
      this._scene.onAfterRenderingGroupObservable.notifyObservers(i, f);
    }
  }
  /**
   * Resets the different information of the group to prepare a new frame
   * @internal
   */
  reset() {
    if (!this.maintainStateBetweenFrames)
      for (let e = $6.MIN_RENDERINGGROUPS; e < $6.MAX_RENDERINGGROUPS; e++) {
        const t = this._renderingGroups[e];
        t && t.prepare();
      }
  }
  /**
   * Resets the sprites information of the group to prepare a new frame
   * @internal
   */
  resetSprites() {
    if (!this.maintainStateBetweenFrames)
      for (let e = $6.MIN_RENDERINGGROUPS; e < $6.MAX_RENDERINGGROUPS; e++) {
        const t = this._renderingGroups[e];
        t && t.prepareSprites();
      }
  }
  /**
   * Dispose and release the group and its associated resources.
   * @internal
   */
  dispose() {
    this.freeRenderingGroups(), this._renderingGroups.length = 0, this._renderingGroupInfo = null;
  }
  /**
   * Clear the info related to rendering groups preventing retention points during dispose.
   */
  freeRenderingGroups() {
    for (let e = $6.MIN_RENDERINGGROUPS; e < $6.MAX_RENDERINGGROUPS; e++) {
      const t = this._renderingGroups[e];
      t && t.dispose();
    }
  }
  _prepareRenderingGroup(e) {
    this._renderingGroups[e] === void 0 && (this._renderingGroups[e] = new x0(e, this._scene, this._customOpaqueSortCompareFn[e], this._customAlphaTestSortCompareFn[e], this._customTransparentSortCompareFn[e]));
  }
  /**
   * Add a sprite manager to the rendering manager in order to render it this frame.
   * @param spriteManager Define the sprite manager to render
   */
  dispatchSprites(e) {
    this.maintainStateBetweenFrames && e._wasDispatched || (e._wasDispatched = !0, this.getRenderingGroup(e.renderingGroupId).dispatchSprites(e));
  }
  /**
   * Add a particle system to the rendering manager in order to render it this frame.
   * @param particleSystem Define the particle system to render
   */
  dispatchParticles(e) {
    this.maintainStateBetweenFrames && e._wasDispatched || (e._wasDispatched = !0, this.getRenderingGroup(e.renderingGroupId).dispatchParticles(e));
  }
  /**
   * Add a submesh to the manager in order to render it this frame
   * @param subMesh The submesh to dispatch
   * @param mesh Optional reference to the submeshes's mesh. Provide if you have an exiting reference to improve performance.
   * @param material Optional reference to the submeshes's material. Provide if you have an exiting reference to improve performance.
   */
  dispatch(e, t, r) {
    t === void 0 && (t = e.getMesh()), !(this.maintainStateBetweenFrames && e._wasDispatched) && (e._wasDispatched = !0, this.getRenderingGroup(t.renderingGroupId).dispatch(e, t, r));
  }
  /**
   * Overrides the default sort function applied in the rendering group to prepare the meshes.
   * This allowed control for front to back rendering or reversely depending of the special needs.
   *
   * @param renderingGroupId The rendering group id corresponding to its index
   * @param opaqueSortCompareFn The opaque queue comparison function use to sort.
   * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.
   * @param transparentSortCompareFn The transparent queue comparison function use to sort.
   */
  setRenderingOrder(e, t = null, r = null, n = null) {
    if (this._customOpaqueSortCompareFn[e] = t, this._customAlphaTestSortCompareFn[e] = r, this._customTransparentSortCompareFn[e] = n, this._renderingGroups[e]) {
      const i = this._renderingGroups[e];
      i.opaqueSortCompareFn = this._customOpaqueSortCompareFn[e], i.alphaTestSortCompareFn = this._customAlphaTestSortCompareFn[e], i.transparentSortCompareFn = this._customTransparentSortCompareFn[e];
    }
  }
  /**
   * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
   *
   * @param renderingGroupId The rendering group id corresponding to its index
   * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
   * @param depth Automatically clears depth between groups if true and autoClear is true.
   * @param stencil Automatically clears stencil between groups if true and autoClear is true.
   */
  setRenderingAutoClearDepthStencil(e, t, r = !0, n = !0) {
    this._autoClearDepthStencil[e] = {
      autoClear: t,
      depth: r,
      stencil: n
    };
  }
  /**
   * Gets the current auto clear configuration for one rendering group of the rendering
   * manager.
   * @param index the rendering group index to get the information for
   * @returns The auto clear setup for the requested rendering group
   */
  getAutoClearDepthStencilSetup(e) {
    return this._autoClearDepthStencil[e];
  }
}
$6.MAX_RENDERINGGROUPS = 4;
$6.MIN_RENDERINGGROUPS = 0;
$6.AUTOCLEAR = !0;
class Ot {
}
Ot.NAME_EFFECTLAYER = "EffectLayer";
Ot.NAME_LAYER = "Layer";
Ot.NAME_LENSFLARESYSTEM = "LensFlareSystem";
Ot.NAME_BOUNDINGBOXRENDERER = "BoundingBoxRenderer";
Ot.NAME_PARTICLESYSTEM = "ParticleSystem";
Ot.NAME_GAMEPAD = "Gamepad";
Ot.NAME_SIMPLIFICATIONQUEUE = "SimplificationQueue";
Ot.NAME_GEOMETRYBUFFERRENDERER = "GeometryBufferRenderer";
Ot.NAME_PREPASSRENDERER = "PrePassRenderer";
Ot.NAME_DEPTHRENDERER = "DepthRenderer";
Ot.NAME_DEPTHPEELINGRENDERER = "DepthPeelingRenderer";
Ot.NAME_POSTPROCESSRENDERPIPELINEMANAGER = "PostProcessRenderPipelineManager";
Ot.NAME_SPRITE = "Sprite";
Ot.NAME_SUBSURFACE = "SubSurface";
Ot.NAME_OUTLINERENDERER = "Outline";
Ot.NAME_PROCEDURALTEXTURE = "ProceduralTexture";
Ot.NAME_SHADOWGENERATOR = "ShadowGenerator";
Ot.NAME_OCTREE = "Octree";
Ot.NAME_PHYSICSENGINE = "PhysicsEngine";
Ot.NAME_AUDIO = "Audio";
Ot.NAME_FLUIDRENDERER = "FluidRenderer";
Ot.STEP_ISREADYFORMESH_EFFECTLAYER = 0;
Ot.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0;
Ot.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0;
Ot.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER = 0;
Ot.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1;
Ot.STEP_BEFORECAMERADRAW_PREPASS = 0;
Ot.STEP_BEFORECAMERADRAW_EFFECTLAYER = 1;
Ot.STEP_BEFORECAMERADRAW_LAYER = 2;
Ot.STEP_BEFORERENDERTARGETDRAW_PREPASS = 0;
Ot.STEP_BEFORERENDERTARGETDRAW_LAYER = 1;
Ot.STEP_BEFORERENDERINGMESH_PREPASS = 0;
Ot.STEP_BEFORERENDERINGMESH_OUTLINE = 1;
Ot.STEP_AFTERRENDERINGMESH_PREPASS = 0;
Ot.STEP_AFTERRENDERINGMESH_OUTLINE = 1;
Ot.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0;
Ot.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1;
Ot.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0;
Ot.STEP_BEFORECAMERAUPDATE_GAMEPAD = 1;
Ot.STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0;
Ot.STEP_BEFORECLEAR_PREPASS = 1;
Ot.STEP_BEFORERENDERTARGETCLEAR_PREPASS = 0;
Ot.STEP_AFTERRENDERTARGETDRAW_PREPASS = 0;
Ot.STEP_AFTERRENDERTARGETDRAW_LAYER = 1;
Ot.STEP_AFTERCAMERADRAW_PREPASS = 0;
Ot.STEP_AFTERCAMERADRAW_EFFECTLAYER = 1;
Ot.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 2;
Ot.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 3;
Ot.STEP_AFTERCAMERADRAW_LAYER = 4;
Ot.STEP_AFTERCAMERADRAW_FLUIDRENDERER = 5;
Ot.STEP_AFTERCAMERAPOSTPROCESS_LAYER = 0;
Ot.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER = 0;
Ot.STEP_AFTERRENDER_AUDIO = 0;
Ot.STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 0;
Ot.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1;
Ot.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 2;
Ot.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3;
Ot.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0;
Ot.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER = 1;
Ot.STEP_POINTERMOVE_SPRITE = 0;
Ot.STEP_POINTERDOWN_SPRITE = 0;
Ot.STEP_POINTERUP_SPRITE = 0;
class Y1 extends Array {
  /**
   * Hide ctor from the rest of the world.
   * @param items The items to add.
   */
  constructor(e) {
    super(...e);
  }
  /**
   * Creates a new Stage.
   * @returns A new instance of a Stage
   */
  static Create() {
    return Object.create(Y1.prototype);
  }
  /**
   * Registers a step in an ordered way in the targeted stage.
   * @param index Defines the position to register the step in
   * @param component Defines the component attached to the step
   * @param action Defines the action to launch during the step
   */
  registerStep(e, t, r) {
    let n = 0, i = Number.MAX_VALUE;
    for (; n < this.length && (i = this[n].index, !(e < i)); n++)
      ;
    this.splice(n, 0, { index: e, component: t, action: r.bind(t) });
  }
  /**
   * Clears all the steps from the stage.
   */
  clear() {
    this.length = 0;
  }
}
class ir {
}
ir.POINTERDOWN = 1;
ir.POINTERUP = 2;
ir.POINTERMOVE = 4;
ir.POINTERWHEEL = 8;
ir.POINTERPICK = 16;
ir.POINTERTAP = 32;
ir.POINTERDOUBLETAP = 64;
class GN {
  /**
   * Instantiates the base class of pointers info.
   * @param type Defines the type of event (PointerEventTypes)
   * @param event Defines the related dom event
   */
  constructor(e, t) {
    this.type = e, this.event = t;
  }
}
class K$ extends GN {
  /**
   * Instantiates a PointerInfoPre to store pointer related info to the onPrePointerObservable event.
   * @param type Defines the type of event (PointerEventTypes)
   * @param event Defines the related dom event
   * @param localX Defines the local x coordinates of the pointer when the event occured
   * @param localY Defines the local y coordinates of the pointer when the event occured
   */
  constructor(e, t, r, n) {
    super(e, t), this.ray = null, this.originalPickingInfo = null, this.skipOnPointerObservable = !1, this.localPosition = new at(r, n);
  }
}
class vp extends GN {
  /**
   * Defines the picking info associated with this PointerInfo object (if applicable)
   */
  get pickInfo() {
    return this._pickInfo || this._generatePickInfo(), this._pickInfo;
  }
  /**
   * Instantiates a PointerInfo to store pointer related info to the onPointerObservable event.
   * @param type Defines the type of event (PointerEventTypes)
   * @param event Defines the related dom event
   * @param pickInfo Defines the picking info associated to the info (if any)
   * @param inputManager Defines the InputManager to use if there is no pickInfo
   */
  constructor(e, t, r, n = null) {
    super(e, t), this._pickInfo = r, this._inputManager = n;
  }
  /**
   * Generates the picking info if needed
   */
  /** @internal */
  _generatePickInfo() {
    this._inputManager && (this._pickInfo = this._inputManager._pickMove(this.event), this._inputManager._setRayOnPointerInfo(this._pickInfo, this.event), this._inputManager = null);
  }
}
class t4 {
}
t4.KEYDOWN = 1;
t4.KEYUP = 2;
class MC {
  /**
   * Instantiates a new keyboard info.
   * This class is used to store keyboard related info for the onKeyboardObservable event.
   * @param type Defines the type of event (KeyboardEventTypes)
   * @param event Defines the related dom event
   */
  constructor(e, t) {
    this.type = e, this.event = t;
  }
}
class Y5 extends MC {
  /**
   * Defines whether the engine should skip the next onKeyboardObservable associated to this pre.
   * @deprecated use skipOnKeyboardObservable property instead
   */
  get skipOnPointerObservable() {
    return this.skipOnKeyboardObservable;
  }
  set skipOnPointerObservable(e) {
    this.skipOnKeyboardObservable = e;
  }
  /**
   * Instantiates a new keyboard pre info.
   * This class is used to store keyboard related info for the onPreKeyboardObservable event.
   * @param type Defines the type of event (KeyboardEventTypes)
   * @param event Defines the related dom event
   */
  constructor(e, t) {
    super(e, t), this.type = e, this.event = t, this.skipOnKeyboardObservable = !1;
  }
}
var vn;
(function(A) {
  A[A.Generic = 0] = "Generic", A[A.Keyboard = 1] = "Keyboard", A[A.Mouse = 2] = "Mouse", A[A.Touch = 3] = "Touch", A[A.DualShock = 4] = "DualShock", A[A.Xbox = 5] = "Xbox", A[A.Switch = 6] = "Switch", A[A.DualSense = 7] = "DualSense";
})(vn || (vn = {}));
var Yn;
(function(A) {
  A[A.Horizontal = 0] = "Horizontal", A[A.Vertical = 1] = "Vertical", A[A.LeftClick = 2] = "LeftClick", A[A.MiddleClick = 3] = "MiddleClick", A[A.RightClick = 4] = "RightClick", A[A.BrowserBack = 5] = "BrowserBack", A[A.BrowserForward = 6] = "BrowserForward", A[A.MouseWheelX = 7] = "MouseWheelX", A[A.MouseWheelY = 8] = "MouseWheelY", A[A.MouseWheelZ = 9] = "MouseWheelZ", A[A.Move = 12] = "Move";
})(Yn || (Yn = {}));
var kI;
(function(A) {
  A[A.Horizontal = 0] = "Horizontal", A[A.Vertical = 1] = "Vertical", A[A.LeftClick = 2] = "LeftClick", A[A.MiddleClick = 3] = "MiddleClick", A[A.RightClick = 4] = "RightClick", A[A.BrowserBack = 5] = "BrowserBack", A[A.BrowserForward = 6] = "BrowserForward", A[A.MouseWheelX = 7] = "MouseWheelX", A[A.MouseWheelY = 8] = "MouseWheelY", A[A.MouseWheelZ = 9] = "MouseWheelZ", A[A.DeltaHorizontal = 10] = "DeltaHorizontal", A[A.DeltaVertical = 11] = "DeltaVertical";
})(kI || (kI = {}));
var M5;
(function(A) {
  A[A.Cross = 0] = "Cross", A[A.Circle = 1] = "Circle", A[A.Square = 2] = "Square", A[A.Triangle = 3] = "Triangle", A[A.L1 = 4] = "L1", A[A.R1 = 5] = "R1", A[A.L2 = 6] = "L2", A[A.R2 = 7] = "R2", A[A.Share = 8] = "Share", A[A.Options = 9] = "Options", A[A.L3 = 10] = "L3", A[A.R3 = 11] = "R3", A[A.DPadUp = 12] = "DPadUp", A[A.DPadDown = 13] = "DPadDown", A[A.DPadLeft = 14] = "DPadLeft", A[A.DPadRight = 15] = "DPadRight", A[A.Home = 16] = "Home", A[A.TouchPad = 17] = "TouchPad", A[A.LStickXAxis = 18] = "LStickXAxis", A[A.LStickYAxis = 19] = "LStickYAxis", A[A.RStickXAxis = 20] = "RStickXAxis", A[A.RStickYAxis = 21] = "RStickYAxis";
})(M5 || (M5 = {}));
var L5;
(function(A) {
  A[A.Cross = 0] = "Cross", A[A.Circle = 1] = "Circle", A[A.Square = 2] = "Square", A[A.Triangle = 3] = "Triangle", A[A.L1 = 4] = "L1", A[A.R1 = 5] = "R1", A[A.L2 = 6] = "L2", A[A.R2 = 7] = "R2", A[A.Create = 8] = "Create", A[A.Options = 9] = "Options", A[A.L3 = 10] = "L3", A[A.R3 = 11] = "R3", A[A.DPadUp = 12] = "DPadUp", A[A.DPadDown = 13] = "DPadDown", A[A.DPadLeft = 14] = "DPadLeft", A[A.DPadRight = 15] = "DPadRight", A[A.Home = 16] = "Home", A[A.TouchPad = 17] = "TouchPad", A[A.LStickXAxis = 18] = "LStickXAxis", A[A.LStickYAxis = 19] = "LStickYAxis", A[A.RStickXAxis = 20] = "RStickXAxis", A[A.RStickYAxis = 21] = "RStickYAxis";
})(L5 || (L5 = {}));
var K5;
(function(A) {
  A[A.A = 0] = "A", A[A.B = 1] = "B", A[A.X = 2] = "X", A[A.Y = 3] = "Y", A[A.LB = 4] = "LB", A[A.RB = 5] = "RB", A[A.LT = 6] = "LT", A[A.RT = 7] = "RT", A[A.Back = 8] = "Back", A[A.Start = 9] = "Start", A[A.LS = 10] = "LS", A[A.RS = 11] = "RS", A[A.DPadUp = 12] = "DPadUp", A[A.DPadDown = 13] = "DPadDown", A[A.DPadLeft = 14] = "DPadLeft", A[A.DPadRight = 15] = "DPadRight", A[A.Home = 16] = "Home", A[A.LStickXAxis = 17] = "LStickXAxis", A[A.LStickYAxis = 18] = "LStickYAxis", A[A.RStickXAxis = 19] = "RStickXAxis", A[A.RStickYAxis = 20] = "RStickYAxis";
})(K5 || (K5 = {}));
var J5;
(function(A) {
  A[A.B = 0] = "B", A[A.A = 1] = "A", A[A.Y = 2] = "Y", A[A.X = 3] = "X", A[A.L = 4] = "L", A[A.R = 5] = "R", A[A.ZL = 6] = "ZL", A[A.ZR = 7] = "ZR", A[A.Minus = 8] = "Minus", A[A.Plus = 9] = "Plus", A[A.LS = 10] = "LS", A[A.RS = 11] = "RS", A[A.DPadUp = 12] = "DPadUp", A[A.DPadDown = 13] = "DPadDown", A[A.DPadLeft = 14] = "DPadLeft", A[A.DPadRight = 15] = "DPadRight", A[A.Home = 16] = "Home", A[A.Capture = 17] = "Capture", A[A.LStickXAxis = 18] = "LStickXAxis", A[A.LStickYAxis = 19] = "LStickYAxis", A[A.RStickXAxis = 20] = "RStickXAxis", A[A.RStickYAxis = 21] = "RStickYAxis";
})(J5 || (J5 = {}));
var z5;
(function(A) {
  A[A.PointerMove = 0] = "PointerMove", A[A.PointerDown = 1] = "PointerDown", A[A.PointerUp = 2] = "PointerUp";
})(z5 || (z5 = {}));
class wm {
}
wm.DOM_DELTA_PIXEL = 0;
wm.DOM_DELTA_LINE = 1;
wm.DOM_DELTA_PAGE = 2;
class Fw {
  /**
   * Create device input events based on provided type and slot
   *
   * @param deviceType Type of device
   * @param deviceSlot "Slot" or index that device is referenced in
   * @param inputIndex Id of input to be checked
   * @param currentState Current value for given input
   * @param deviceInputSystem Reference to DeviceInputSystem
   * @param elementToAttachTo HTMLElement to reference as target for inputs
   * @returns IUIEvent object
   */
  static CreateDeviceEvent(e, t, r, n, i, s, a) {
    switch (e) {
      case vn.Keyboard:
        return this._CreateKeyboardEvent(r, n, i, s);
      case vn.Mouse:
        if (r === Yn.MouseWheelX || r === Yn.MouseWheelY || r === Yn.MouseWheelZ)
          return this._CreateWheelEvent(e, t, r, n, i, s);
      case vn.Touch:
        return this._CreatePointerEvent(e, t, r, n, i, s, a);
      default:
        throw `Unable to generate event for device ${vn[e]}`;
    }
  }
  /**
   * Creates pointer event
   *
   * @param deviceType Type of device
   * @param deviceSlot "Slot" or index that device is referenced in
   * @param inputIndex Id of input to be checked
   * @param currentState Current value for given input
   * @param deviceInputSystem Reference to DeviceInputSystem
   * @param elementToAttachTo HTMLElement to reference as target for inputs
   * @returns IUIEvent object (Pointer)
   */
  static _CreatePointerEvent(e, t, r, n, i, s, a) {
    const f = this._CreateMouseEvent(e, t, r, n, i, s);
    e === vn.Mouse ? (f.deviceType = vn.Mouse, f.pointerId = 1, f.pointerType = "mouse") : (f.deviceType = vn.Touch, f.pointerId = a ?? t, f.pointerType = "touch");
    let o = 0;
    return o += i.pollInput(e, t, Yn.LeftClick), o += i.pollInput(e, t, Yn.RightClick) * 2, o += i.pollInput(e, t, Yn.MiddleClick) * 4, f.buttons = o, r === Yn.Move ? f.type = "pointermove" : r >= Yn.LeftClick && r <= Yn.RightClick && (f.type = n === 1 ? "pointerdown" : "pointerup", f.button = r - 2), f;
  }
  /**
   * Create Mouse Wheel Event
   * @param deviceType Type of device
   * @param deviceSlot "Slot" or index that device is referenced in
   * @param inputIndex Id of input to be checked
   * @param currentState Current value for given input
   * @param deviceInputSystem Reference to DeviceInputSystem
   * @param elementToAttachTo HTMLElement to reference as target for inputs
   * @returns IUIEvent object (Wheel)
   */
  static _CreateWheelEvent(e, t, r, n, i, s) {
    const a = this._CreateMouseEvent(e, t, r, n, i, s);
    switch (a.pointerId = 1, a.type = "wheel", a.deltaMode = wm.DOM_DELTA_PIXEL, a.deltaX = 0, a.deltaY = 0, a.deltaZ = 0, r) {
      case Yn.MouseWheelX:
        a.deltaX = n;
        break;
      case Yn.MouseWheelY:
        a.deltaY = n;
        break;
      case Yn.MouseWheelZ:
        a.deltaZ = n;
        break;
    }
    return a;
  }
  /**
   * Create Mouse Event
   * @param deviceType Type of device
   * @param deviceSlot "Slot" or index that device is referenced in
   * @param inputIndex Id of input to be checked
   * @param currentState Current value for given input
   * @param deviceInputSystem Reference to DeviceInputSystem
   * @param elementToAttachTo HTMLElement to reference as target for inputs
   * @returns IUIEvent object (Mouse)
   */
  static _CreateMouseEvent(e, t, r, n, i, s) {
    const a = this._CreateEvent(s), f = i.pollInput(e, t, Yn.Horizontal), o = i.pollInput(e, t, Yn.Vertical);
    return s ? (a.movementX = 0, a.movementY = 0, a.offsetX = a.movementX - s.getBoundingClientRect().x, a.offsetY = a.movementY - s.getBoundingClientRect().y) : (a.movementX = i.pollInput(e, t, kI.DeltaHorizontal), a.movementY = i.pollInput(e, t, kI.DeltaVertical), a.offsetX = 0, a.offsetY = 0), this._CheckNonCharacterKeys(a, i), a.clientX = f, a.clientY = o, a.x = f, a.y = o, a.deviceType = e, a.deviceSlot = t, a.inputIndex = r, a;
  }
  /**
   * Create Keyboard Event
   * @param inputIndex Id of input to be checked
   * @param currentState Current value for given input
   * @param deviceInputSystem Reference to DeviceInputSystem
   * @param elementToAttachTo HTMLElement to reference as target for inputs
   * @returns IEvent object (Keyboard)
   */
  static _CreateKeyboardEvent(e, t, r, n) {
    const i = this._CreateEvent(n);
    return this._CheckNonCharacterKeys(i, r), i.deviceType = vn.Keyboard, i.deviceSlot = 0, i.inputIndex = e, i.type = t === 1 ? "keydown" : "keyup", i.key = String.fromCharCode(e), i.keyCode = e, i;
  }
  /**
   * Add parameters for non-character keys (Ctrl, Alt, Meta, Shift)
   * @param evt Event object to add parameters to
   * @param deviceInputSystem DeviceInputSystem to pull values from
   */
  static _CheckNonCharacterKeys(e, t) {
    const r = t.isDeviceAvailable(vn.Keyboard), n = r && t.pollInput(vn.Keyboard, 0, 18) === 1, i = r && t.pollInput(vn.Keyboard, 0, 17) === 1, s = r && (t.pollInput(vn.Keyboard, 0, 91) === 1 || t.pollInput(vn.Keyboard, 0, 92) === 1 || t.pollInput(vn.Keyboard, 0, 93) === 1), a = r && t.pollInput(vn.Keyboard, 0, 16) === 1;
    e.altKey = n, e.ctrlKey = i, e.metaKey = s, e.shiftKey = a;
  }
  /**
   * Create base event object
   * @param elementToAttachTo Value to use as event target
   * @returns
   */
  static _CreateEvent(e) {
    const t = {};
    return t.preventDefault = () => {
    }, t.target = e, t;
  }
}
class Z9e {
  constructor(e, t, r) {
    this._nativeInput = _native.DeviceInputSystem ? new _native.DeviceInputSystem(e, t, (n, i, s, a) => {
      const f = Fw.CreateDeviceEvent(n, i, s, a, this);
      r(n, i, f);
    }) : this._createDummyNativeInput();
  }
  // Public functions
  /**
   * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
   * @param deviceType Enum specifying device type
   * @param deviceSlot "Slot" or index that device is referenced in
   * @param inputIndex Id of input to be checked
   * @returns Current value of input
   */
  pollInput(e, t, r) {
    return this._nativeInput.pollInput(e, t, r);
  }
  /**
   * Check for a specific device in the DeviceInputSystem
   * @param deviceType Type of device to check for
   * @returns bool with status of device's existence
   */
  isDeviceAvailable(e) {
    return e === vn.Mouse || e === vn.Touch;
  }
  /**
   * Dispose of all the observables
   */
  dispose() {
    this._nativeInput.dispose();
  }
  /**
   * For versions of BabylonNative that don't have the NativeInput plugin initialized, create a dummy version
   * @returns Object with dummy functions
   */
  _createDummyNativeInput() {
    return {
      pollInput: () => 0,
      isDeviceAvailable: () => !1,
      dispose: () => {
      }
    };
  }
}
const AG = 255, dG = Object.keys(Yn).length / 2;
class _9e {
  /**
   * Constructor for the WebDeviceInputSystem
   * @param engine Engine to reference
   * @param onDeviceConnected Callback to execute when device is connected
   * @param onDeviceDisconnected Callback to execute when device is disconnected
   * @param onInputChanged Callback to execute when input changes on device
   */
  constructor(e, t, r, n) {
    this._inputs = [], this._keyboardActive = !1, this._pointerActive = !1, this._usingSafari = ye.IsSafari(), this._usingMacOS = Mw() && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform), this._keyboardDownEvent = (i) => {
    }, this._keyboardUpEvent = (i) => {
    }, this._keyboardBlurEvent = (i) => {
    }, this._pointerMoveEvent = (i) => {
    }, this._pointerDownEvent = (i) => {
    }, this._pointerUpEvent = (i) => {
    }, this._pointerCancelEvent = (i) => {
    }, this._pointerWheelEvent = (i) => {
    }, this._pointerBlurEvent = (i) => {
    }, this._pointerMacOSChromeOutEvent = (i) => {
    }, this._eventsAttached = !1, this._mouseId = -1, this._isUsingFirefox = Mw() && navigator.userAgent && navigator.userAgent.indexOf("Firefox") !== -1, this._isUsingChromium = Mw() && navigator.userAgent && navigator.userAgent.indexOf("Chrome") !== -1, this._maxTouchPoints = 0, this._pointerInputClearObserver = null, this._gamepadConnectedEvent = (i) => {
    }, this._gamepadDisconnectedEvent = (i) => {
    }, this._eventPrefix = ye.GetPointerPrefix(e), this._engine = e, this._onDeviceConnected = t, this._onDeviceDisconnected = r, this._onInputChanged = n, this._mouseId = this._isUsingFirefox ? 0 : 1, this._enableEvents(), this._usingMacOS && (this._metaKeys = []), this._engine._onEngineViewChanged || (this._engine._onEngineViewChanged = () => {
      this._enableEvents();
    });
  }
  // Public functions
  /**
   * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
   * @param deviceType Enum specifying device type
   * @param deviceSlot "Slot" or index that device is referenced in
   * @param inputIndex Id of input to be checked
   * @returns Current value of input
   */
  pollInput(e, t, r) {
    const n = this._inputs[e][t];
    if (!n)
      throw `Unable to find device ${vn[e]}`;
    e >= vn.DualShock && e <= vn.DualSense && this._updateDevice(e, t, r);
    const i = n[r];
    if (i === void 0)
      throw `Unable to find input ${r} for device ${vn[e]} in slot ${t}`;
    return r === Yn.Move && ye.Warn("Unable to provide information for PointerInput.Move.  Try using PointerInput.Horizontal or PointerInput.Vertical for move data."), i;
  }
  /**
   * Check for a specific device in the DeviceInputSystem
   * @param deviceType Type of device to check for
   * @returns bool with status of device's existence
   */
  isDeviceAvailable(e) {
    return this._inputs[e] !== void 0;
  }
  /**
   * Dispose of all the eventlisteners
   */
  dispose() {
    this._onDeviceConnected = () => {
    }, this._onDeviceDisconnected = () => {
    }, this._onInputChanged = () => {
    }, delete this._engine._onEngineViewChanged, this._elementToAttachTo && this._disableEvents();
  }
  /**
   * Enable listening for user input events
   */
  _enableEvents() {
    const e = this === null || this === void 0 ? void 0 : this._engine.getInputElement();
    if (e && (!this._eventsAttached || this._elementToAttachTo !== e)) {
      if (this._disableEvents(), this._inputs) {
        for (const t of this._inputs)
          if (t)
            for (const r in t) {
              const n = +r, i = t[n];
              if (i)
                for (let s = 0; s < i.length; s++)
                  i[s] = 0;
            }
      }
      this._elementToAttachTo = e, this._elementToAttachTo.tabIndex = this._elementToAttachTo.tabIndex !== -1 ? this._elementToAttachTo.tabIndex : this._engine.canvasTabIndex, this._handleKeyActions(), this._handlePointerActions(), this._handleGamepadActions(), this._eventsAttached = !0, this._checkForConnectedDevices();
    }
  }
  /**
   * Disable listening for user input events
   */
  _disableEvents() {
    this._elementToAttachTo && (this._elementToAttachTo.removeEventListener("blur", this._keyboardBlurEvent), this._elementToAttachTo.removeEventListener("blur", this._pointerBlurEvent), this._elementToAttachTo.removeEventListener("keydown", this._keyboardDownEvent), this._elementToAttachTo.removeEventListener("keyup", this._keyboardUpEvent), this._elementToAttachTo.removeEventListener(this._eventPrefix + "move", this._pointerMoveEvent), this._elementToAttachTo.removeEventListener(this._eventPrefix + "down", this._pointerDownEvent), this._elementToAttachTo.removeEventListener(this._eventPrefix + "up", this._pointerUpEvent), this._elementToAttachTo.removeEventListener(this._eventPrefix + "cancel", this._pointerCancelEvent), this._elementToAttachTo.removeEventListener(this._wheelEventName, this._pointerWheelEvent), this._usingMacOS && this._isUsingChromium && this._elementToAttachTo.removeEventListener("lostpointercapture", this._pointerMacOSChromeOutEvent), window.removeEventListener("gamepadconnected", this._gamepadConnectedEvent), window.removeEventListener("gamepaddisconnected", this._gamepadDisconnectedEvent)), this._pointerInputClearObserver && this._engine.onEndFrameObservable.remove(this._pointerInputClearObserver), this._eventsAttached = !1;
  }
  /**
   * Checks for existing connections to devices and register them, if necessary
   * Currently handles gamepads and mouse
   */
  _checkForConnectedDevices() {
    if (navigator.getGamepads) {
      const e = navigator.getGamepads();
      for (const t of e)
        t && this._addGamePad(t);
    }
    typeof matchMedia == "function" && matchMedia("(pointer:fine)").matches && this._addPointerDevice(vn.Mouse, 0, 0, 0);
  }
  // Private functions
  /**
   * Add a gamepad to the DeviceInputSystem
   * @param gamepad A single DOM Gamepad object
   */
  _addGamePad(e) {
    const t = this._getGamepadDeviceType(e.id), r = e.index;
    this._gamepads = this._gamepads || new Array(e.index + 1), this._registerDevice(t, r, e.buttons.length + e.axes.length), this._gamepads[r] = t;
  }
  /**
   * Add pointer device to DeviceInputSystem
   * @param deviceType Type of Pointer to add
   * @param deviceSlot Pointer ID (0 for mouse, pointerId for Touch)
   * @param currentX Current X at point of adding
   * @param currentY Current Y at point of adding
   */
  _addPointerDevice(e, t, r, n) {
    this._pointerActive || (this._pointerActive = !0), this._registerDevice(e, t, dG);
    const i = this._inputs[e][t];
    i[0] = r, i[1] = n;
  }
  /**
   * Add device and inputs to device array
   * @param deviceType Enum specifying device type
   * @param deviceSlot "Slot" or index that device is referenced in
   * @param numberOfInputs Number of input entries to create for given device
   */
  _registerDevice(e, t, r) {
    if (t === void 0)
      throw `Unable to register device ${vn[e]} to undefined slot.`;
    if (this._inputs[e] || (this._inputs[e] = {}), !this._inputs[e][t]) {
      const n = new Array(r);
      n.fill(0), this._inputs[e][t] = n, this._onDeviceConnected(e, t);
    }
  }
  /**
   * Given a specific device name, remove that device from the device map
   * @param deviceType Enum specifying device type
   * @param deviceSlot "Slot" or index that device is referenced in
   */
  _unregisterDevice(e, t) {
    this._inputs[e][t] && (delete this._inputs[e][t], this._onDeviceDisconnected(e, t));
  }
  /**
   * Handle all actions that come from keyboard interaction
   */
  _handleKeyActions() {
    this._keyboardDownEvent = (e) => {
      this._keyboardActive || (this._keyboardActive = !0, this._registerDevice(vn.Keyboard, 0, AG));
      const t = this._inputs[vn.Keyboard][0];
      if (t) {
        t[e.keyCode] = 1;
        const r = e;
        r.inputIndex = e.keyCode, this._usingMacOS && e.metaKey && e.key !== "Meta" && (this._metaKeys.includes(e.keyCode) || this._metaKeys.push(e.keyCode)), this._onInputChanged(vn.Keyboard, 0, r);
      }
    }, this._keyboardUpEvent = (e) => {
      this._keyboardActive || (this._keyboardActive = !0, this._registerDevice(vn.Keyboard, 0, AG));
      const t = this._inputs[vn.Keyboard][0];
      if (t) {
        t[e.keyCode] = 0;
        const r = e;
        if (r.inputIndex = e.keyCode, this._usingMacOS && e.key === "Meta" && this._metaKeys.length > 0) {
          for (const n of this._metaKeys) {
            const i = Fw.CreateDeviceEvent(vn.Keyboard, 0, n, 0, this, this._elementToAttachTo);
            t[n] = 0, this._onInputChanged(vn.Keyboard, 0, i);
          }
          this._metaKeys.splice(0, this._metaKeys.length);
        }
        this._onInputChanged(vn.Keyboard, 0, r);
      }
    }, this._keyboardBlurEvent = () => {
      if (this._keyboardActive) {
        const e = this._inputs[vn.Keyboard][0];
        for (let t = 0; t < e.length; t++)
          if (e[t] !== 0) {
            e[t] = 0;
            const r = Fw.CreateDeviceEvent(vn.Keyboard, 0, t, 0, this, this._elementToAttachTo);
            this._onInputChanged(vn.Keyboard, 0, r);
          }
        this._usingMacOS && this._metaKeys.splice(0, this._metaKeys.length);
      }
    }, this._elementToAttachTo.addEventListener("keydown", this._keyboardDownEvent), this._elementToAttachTo.addEventListener("keyup", this._keyboardUpEvent), this._elementToAttachTo.addEventListener("blur", this._keyboardBlurEvent);
  }
  /**
   * Handle all actions that come from pointer interaction
   */
  _handlePointerActions() {
    this._maxTouchPoints = Mw() && navigator.maxTouchPoints || 2, this._activeTouchIds || (this._activeTouchIds = new Array(this._maxTouchPoints));
    for (let r = 0; r < this._maxTouchPoints; r++)
      this._activeTouchIds[r] = -1;
    this._pointerMoveEvent = (r) => {
      const n = this._getPointerType(r);
      let i = n === vn.Mouse ? 0 : this._activeTouchIds.indexOf(r.pointerId);
      if (n === vn.Touch && i === -1) {
        const a = this._activeTouchIds.indexOf(-1);
        if (a >= 0)
          i = a, this._activeTouchIds[a] = r.pointerId, this._onDeviceConnected(n, i);
        else {
          ye.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);
          return;
        }
      }
      this._inputs[n] || (this._inputs[n] = {}), this._inputs[n][i] || this._addPointerDevice(n, i, r.clientX, r.clientY);
      const s = this._inputs[n][i];
      if (s) {
        const a = r;
        a.inputIndex = Yn.Move, s[Yn.Horizontal] = r.clientX, s[Yn.Vertical] = r.clientY, n === vn.Touch && s[Yn.LeftClick] === 0 && (s[Yn.LeftClick] = 1), r.pointerId === void 0 && (r.pointerId = this._mouseId), this._onInputChanged(n, i, a), !this._usingSafari && r.button !== -1 && (a.inputIndex = r.button + 2, s[r.button + 2] = s[r.button + 2] ? 0 : 1, this._onInputChanged(n, i, a));
      }
    }, this._pointerDownEvent = (r) => {
      const n = this._getPointerType(r);
      let i = n === vn.Mouse ? 0 : r.pointerId;
      if (n === vn.Touch) {
        const a = this._activeTouchIds.indexOf(-1);
        if (a >= 0)
          i = a, this._activeTouchIds[a] = r.pointerId;
        else {
          ye.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);
          return;
        }
      }
      this._inputs[n] || (this._inputs[n] = {}), this._inputs[n][i] ? n === vn.Touch && this._onDeviceConnected(n, i) : this._addPointerDevice(n, i, r.clientX, r.clientY);
      const s = this._inputs[n][i];
      if (s) {
        const a = s[Yn.Horizontal], f = s[Yn.Vertical];
        if (n === vn.Mouse) {
          if (r.pointerId === void 0 && (r.pointerId = this._mouseId), !document.pointerLockElement)
            try {
              this._elementToAttachTo.setPointerCapture(this._mouseId);
            } catch {
            }
        } else if (r.pointerId && !document.pointerLockElement)
          try {
            this._elementToAttachTo.setPointerCapture(r.pointerId);
          } catch {
          }
        s[Yn.Horizontal] = r.clientX, s[Yn.Vertical] = r.clientY, s[r.button + 2] = 1;
        const o = r;
        o.inputIndex = r.button + 2, this._onInputChanged(n, i, o), (a !== r.clientX || f !== r.clientY) && (o.inputIndex = Yn.Move, this._onInputChanged(n, i, o));
      }
    }, this._pointerUpEvent = (r) => {
      var n, i, s, a, f;
      const o = this._getPointerType(r), d = o === vn.Mouse ? 0 : this._activeTouchIds.indexOf(r.pointerId);
      if (o === vn.Touch) {
        if (d === -1)
          return;
        this._activeTouchIds[d] = -1;
      }
      const v = (n = this._inputs[o]) === null || n === void 0 ? void 0 : n[d];
      if (v && v[r.button + 2] !== 0) {
        const u = v[Yn.Horizontal], l = v[Yn.Vertical];
        v[Yn.Horizontal] = r.clientX, v[Yn.Vertical] = r.clientY, v[r.button + 2] = 0;
        const P = r;
        r.pointerId === void 0 && (r.pointerId = this._mouseId), (u !== r.clientX || l !== r.clientY) && (P.inputIndex = Yn.Move, this._onInputChanged(o, d, P)), P.inputIndex = r.button + 2, o === vn.Mouse && this._mouseId >= 0 && (!((s = (i = this._elementToAttachTo).hasPointerCapture) === null || s === void 0) && s.call(i, this._mouseId)) ? this._elementToAttachTo.releasePointerCapture(this._mouseId) : r.pointerId && (!((f = (a = this._elementToAttachTo).hasPointerCapture) === null || f === void 0) && f.call(a, r.pointerId)) && this._elementToAttachTo.releasePointerCapture(r.pointerId), this._onInputChanged(o, d, P), o === vn.Touch && this._onDeviceDisconnected(o, d);
      }
    }, this._pointerCancelEvent = (r) => {
      var n, i, s, a;
      if (r.pointerType === "mouse") {
        const f = this._inputs[vn.Mouse][0];
        this._mouseId >= 0 && (!((i = (n = this._elementToAttachTo).hasPointerCapture) === null || i === void 0) && i.call(n, this._mouseId)) && this._elementToAttachTo.releasePointerCapture(this._mouseId);
        for (let o = Yn.LeftClick; o <= Yn.BrowserForward; o++)
          if (f[o] === 1) {
            f[o] = 0;
            const d = Fw.CreateDeviceEvent(vn.Mouse, 0, o, 0, this, this._elementToAttachTo);
            this._onInputChanged(vn.Mouse, 0, d);
          }
      } else {
        const f = this._activeTouchIds.indexOf(r.pointerId);
        if (f === -1)
          return;
        !((a = (s = this._elementToAttachTo).hasPointerCapture) === null || a === void 0) && a.call(s, r.pointerId) && this._elementToAttachTo.releasePointerCapture(r.pointerId), this._inputs[vn.Touch][f][Yn.LeftClick] = 0;
        const o = Fw.CreateDeviceEvent(vn.Touch, f, Yn.LeftClick, 0, this, this._elementToAttachTo, r.pointerId);
        this._onInputChanged(vn.Touch, f, o), this._activeTouchIds[f] = -1, this._onDeviceDisconnected(vn.Touch, f);
      }
    }, this._wheelEventName = "onwheel" in document.createElement("div") ? "wheel" : document.onmousewheel !== void 0 ? "mousewheel" : "DOMMouseScroll";
    let e = !1;
    const t = function() {
    };
    try {
      const r = Object.defineProperty({}, "passive", {
        get: function() {
          e = !0;
        }
      });
      this._elementToAttachTo.addEventListener("test", t, r), this._elementToAttachTo.removeEventListener("test", t, r);
    } catch {
    }
    this._pointerBlurEvent = () => {
      var r, n, i, s, a;
      if (this.isDeviceAvailable(vn.Mouse)) {
        const f = this._inputs[vn.Mouse][0];
        this._mouseId >= 0 && (!((n = (r = this._elementToAttachTo).hasPointerCapture) === null || n === void 0) && n.call(r, this._mouseId)) && this._elementToAttachTo.releasePointerCapture(this._mouseId);
        for (let o = Yn.LeftClick; o <= Yn.BrowserForward; o++)
          if (f[o] === 1) {
            f[o] = 0;
            const d = Fw.CreateDeviceEvent(vn.Mouse, 0, o, 0, this, this._elementToAttachTo);
            this._onInputChanged(vn.Mouse, 0, d);
          }
      }
      if (this.isDeviceAvailable(vn.Touch)) {
        const f = this._inputs[vn.Touch];
        for (let o = 0; o < this._activeTouchIds.length; o++) {
          const d = this._activeTouchIds[o];
          if (!((s = (i = this._elementToAttachTo).hasPointerCapture) === null || s === void 0) && s.call(i, d) && this._elementToAttachTo.releasePointerCapture(d), d !== -1 && ((a = f[o]) === null || a === void 0 ? void 0 : a[Yn.LeftClick]) === 1) {
            f[o][Yn.LeftClick] = 0;
            const v = Fw.CreateDeviceEvent(vn.Touch, o, Yn.LeftClick, 0, this, this._elementToAttachTo, d);
            this._onInputChanged(vn.Touch, o, v), this._activeTouchIds[o] = -1, this._onDeviceDisconnected(vn.Touch, o);
          }
        }
      }
    }, this._pointerWheelEvent = (r) => {
      const n = vn.Mouse, i = 0;
      this._inputs[n] || (this._inputs[n] = []), this._inputs[n][i] || (this._pointerActive = !0, this._registerDevice(n, i, dG));
      const s = this._inputs[n][i];
      if (s) {
        s[Yn.MouseWheelX] = r.deltaX || 0, s[Yn.MouseWheelY] = r.deltaY || r.wheelDelta || 0, s[Yn.MouseWheelZ] = r.deltaZ || 0;
        const a = r;
        r.pointerId === void 0 && (r.pointerId = this._mouseId), s[Yn.MouseWheelX] !== 0 && (a.inputIndex = Yn.MouseWheelX, this._onInputChanged(n, i, a)), s[Yn.MouseWheelY] !== 0 && (a.inputIndex = Yn.MouseWheelY, this._onInputChanged(n, i, a)), s[Yn.MouseWheelZ] !== 0 && (a.inputIndex = Yn.MouseWheelZ, this._onInputChanged(n, i, a));
      }
    }, this._usingMacOS && this._isUsingChromium && (this._pointerMacOSChromeOutEvent = (r) => {
      r.buttons > 1 && this._pointerCancelEvent(r);
    }, this._elementToAttachTo.addEventListener("lostpointercapture", this._pointerMacOSChromeOutEvent)), this._elementToAttachTo.addEventListener(this._eventPrefix + "move", this._pointerMoveEvent), this._elementToAttachTo.addEventListener(this._eventPrefix + "down", this._pointerDownEvent), this._elementToAttachTo.addEventListener(this._eventPrefix + "up", this._pointerUpEvent), this._elementToAttachTo.addEventListener(this._eventPrefix + "cancel", this._pointerCancelEvent), this._elementToAttachTo.addEventListener("blur", this._pointerBlurEvent), this._elementToAttachTo.addEventListener(this._wheelEventName, this._pointerWheelEvent, e ? { passive: !1 } : !1), this._pointerInputClearObserver = this._engine.onEndFrameObservable.add(() => {
      if (this.isDeviceAvailable(vn.Mouse)) {
        const r = this._inputs[vn.Mouse][0];
        r[Yn.MouseWheelX] = 0, r[Yn.MouseWheelY] = 0, r[Yn.MouseWheelZ] = 0;
      }
    });
  }
  /**
   * Handle all actions that come from gamepad interaction
   */
  _handleGamepadActions() {
    this._gamepadConnectedEvent = (e) => {
      this._addGamePad(e.gamepad);
    }, this._gamepadDisconnectedEvent = (e) => {
      if (this._gamepads) {
        const t = this._getGamepadDeviceType(e.gamepad.id), r = e.gamepad.index;
        this._unregisterDevice(t, r), delete this._gamepads[r];
      }
    }, window.addEventListener("gamepadconnected", this._gamepadConnectedEvent), window.addEventListener("gamepaddisconnected", this._gamepadDisconnectedEvent);
  }
  /**
   * Update all non-event based devices with each frame
   * @param deviceType Enum specifying device type
   * @param deviceSlot "Slot" or index that device is referenced in
   * @param inputIndex Id of input to be checked
   */
  _updateDevice(e, t, r) {
    const n = navigator.getGamepads()[t];
    if (n && e === this._gamepads[t]) {
      const i = this._inputs[e][t];
      r >= n.buttons.length ? i[r] = n.axes[r - n.buttons.length].valueOf() : i[r] = n.buttons[r].value;
    }
  }
  /**
   * Gets DeviceType from the device name
   * @param deviceName Name of Device from DeviceInputSystem
   * @returns DeviceType enum value
   */
  _getGamepadDeviceType(e) {
    return e.indexOf("054c") !== -1 ? e.indexOf("0ce6") !== -1 ? vn.DualSense : vn.DualShock : e.indexOf("Xbox One") !== -1 || e.search("Xbox 360") !== -1 || e.search("xinput") !== -1 ? vn.Xbox : e.indexOf("057e") !== -1 ? vn.Switch : vn.Generic;
  }
  /**
   * Get DeviceType from a given pointer/mouse/touch event.
   * @param evt PointerEvent to evaluate
   * @returns DeviceType interpreted from event
   */
  _getPointerType(e) {
    let t = vn.Mouse;
    return (e.pointerType === "touch" || e.pointerType === "pen" || e.touches) && (t = vn.Touch), t;
  }
}
class G5 {
  /**
   * Default Constructor
   * @param deviceInputSystem - Reference to DeviceInputSystem
   * @param deviceType - Type of device
   * @param deviceSlot - "Slot" or index that device is referenced in
   */
  constructor(e, t, r = 0) {
    this.deviceType = t, this.deviceSlot = r, this.onInputChangedObservable = new Oe(), this._deviceInputSystem = e;
  }
  /**
   * Get input for specific input
   * @param inputIndex - index of specific input on device
   * @returns Input value from DeviceInputSystem
   */
  getInput(e) {
    return this._deviceInputSystem.pollInput(this.deviceType, this.deviceSlot, e);
  }
}
class $9e {
  constructor(e) {
    this._registeredManagers = new Array(), this._refCount = 0, this.registerManager = (s) => {
      for (let a = 0; a < this._devices.length; a++) {
        const f = this._devices[a];
        for (const o in f) {
          const d = +o;
          s._addDevice(new G5(this._deviceInputSystem, a, d));
        }
      }
      this._registeredManagers.push(s);
    }, this.unregisterManager = (s) => {
      const a = this._registeredManagers.indexOf(s);
      a > -1 && this._registeredManagers.splice(a, 1);
    };
    const t = Object.keys(vn).length / 2;
    this._devices = new Array(t);
    const r = (s, a) => {
      this._devices[s] || (this._devices[s] = new Array()), this._devices[s][a] || (this._devices[s][a] = a);
      for (const f of this._registeredManagers) {
        const o = new G5(this._deviceInputSystem, s, a);
        f._addDevice(o);
      }
    }, n = (s, a) => {
      var f;
      !((f = this._devices[s]) === null || f === void 0) && f[a] && delete this._devices[s][a];
      for (const o of this._registeredManagers)
        o._removeDevice(s, a);
    }, i = (s, a, f) => {
      if (f)
        for (const o of this._registeredManagers)
          o._onInputChanged(s, a, f);
    };
    typeof _native < "u" ? this._deviceInputSystem = new Z9e(r, n, i) : this._deviceInputSystem = new _9e(e, r, n, i);
  }
  dispose() {
    this._deviceInputSystem.dispose();
  }
}
class J$ {
  // Public Functions
  /**
   * Gets a DeviceSource, given a type and slot
   * @param deviceType - Type of Device
   * @param deviceSlot - Slot or ID of device
   * @returns DeviceSource
   */
  getDeviceSource(e, t) {
    if (t === void 0) {
      if (this._firstDevice[e] === void 0)
        return null;
      t = this._firstDevice[e];
    }
    return !this._devices[e] || this._devices[e][t] === void 0 ? null : this._devices[e][t];
  }
  /**
   * Gets an array of DeviceSource objects for a given device type
   * @param deviceType - Type of Device
   * @returns All available DeviceSources of a given type
   */
  getDeviceSources(e) {
    return this._devices[e] ? this._devices[e].filter((t) => !!t) : [];
  }
  /**
   * Default constructor
   * @param engine - Used to get canvas (if applicable)
   */
  constructor(e) {
    const t = Object.keys(vn).length / 2;
    this._devices = new Array(t), this._firstDevice = new Array(t), this._engine = e, this._engine._deviceSourceManager || (this._engine._deviceSourceManager = new $9e(e)), this._engine._deviceSourceManager._refCount++, this.onDeviceConnectedObservable = new Oe((r) => {
      for (const n of this._devices)
        if (n)
          for (const i of n)
            i && this.onDeviceConnectedObservable.notifyObserver(r, i);
    }), this.onDeviceDisconnectedObservable = new Oe(), this._engine._deviceSourceManager.registerManager(this), this._onDisposeObserver = e.onDisposeObservable.add(() => {
      this.dispose();
    });
  }
  /**
   * Dispose of DeviceSourceManager
   */
  dispose() {
    this.onDeviceConnectedObservable.clear(), this.onDeviceDisconnectedObservable.clear(), this._engine._deviceSourceManager && (this._engine._deviceSourceManager.unregisterManager(this), --this._engine._deviceSourceManager._refCount < 1 && (this._engine._deviceSourceManager.dispose(), delete this._engine._deviceSourceManager)), this._engine.onDisposeObservable.remove(this._onDisposeObserver);
  }
  // Hidden Functions
  /**
   * @param deviceSource - Source to add
   * @internal
   */
  _addDevice(e) {
    this._devices[e.deviceType] || (this._devices[e.deviceType] = new Array()), this._devices[e.deviceType][e.deviceSlot] || (this._devices[e.deviceType][e.deviceSlot] = e, this._updateFirstDevices(e.deviceType)), this.onDeviceConnectedObservable.notifyObservers(e);
  }
  /**
   * @param deviceType - DeviceType
   * @param deviceSlot - DeviceSlot
   * @internal
   */
  _removeDevice(e, t) {
    var r, n;
    const i = (r = this._devices[e]) === null || r === void 0 ? void 0 : r[t];
    this.onDeviceDisconnectedObservable.notifyObservers(i), !((n = this._devices[e]) === null || n === void 0) && n[t] && delete this._devices[e][t], this._updateFirstDevices(e);
  }
  /**
   * @param deviceType - DeviceType
   * @param deviceSlot - DeviceSlot
   * @param eventData - Event
   * @internal
   */
  _onInputChanged(e, t, r) {
    var n, i;
    (i = (n = this._devices[e]) === null || n === void 0 ? void 0 : n[t]) === null || i === void 0 || i.onInputChangedObservable.notifyObservers(r);
  }
  // Private Functions
  _updateFirstDevices(e) {
    switch (e) {
      case vn.Keyboard:
      case vn.Mouse:
        this._firstDevice[e] = 0;
        break;
      case vn.Touch:
      case vn.DualSense:
      case vn.DualShock:
      case vn.Xbox:
      case vn.Switch:
      case vn.Generic: {
        delete this._firstDevice[e];
        const t = this._devices[e];
        if (t) {
          for (let r = 0; r < t.length; r++)
            if (t[r]) {
              this._firstDevice[e] = r;
              break;
            }
        }
        break;
      }
    }
  }
}
class vG {
  constructor() {
    this._singleClick = !1, this._doubleClick = !1, this._hasSwiped = !1, this._ignore = !1;
  }
  get singleClick() {
    return this._singleClick;
  }
  get doubleClick() {
    return this._doubleClick;
  }
  get hasSwiped() {
    return this._hasSwiped;
  }
  get ignore() {
    return this._ignore;
  }
  set singleClick(e) {
    this._singleClick = e;
  }
  set doubleClick(e) {
    this._doubleClick = e;
  }
  set hasSwiped(e) {
    this._hasSwiped = e;
  }
  set ignore(e) {
    this._ignore = e;
  }
}
class Xf {
  /**
   * Creates a new InputManager
   * @param scene - defines the hosting scene
   */
  constructor(e) {
    this._alreadyAttached = !1, this._meshPickProceed = !1, this._currentPickResult = null, this._previousPickResult = null, this._totalPointersPressed = 0, this._doubleClickOccured = !1, this._isSwiping = !1, this._swipeButtonPressed = -1, this._skipPointerTap = !1, this._isMultiTouchGesture = !1, this._pointerX = 0, this._pointerY = 0, this._startingPointerPosition = new at(0, 0), this._previousStartingPointerPosition = new at(0, 0), this._startingPointerTime = 0, this._previousStartingPointerTime = 0, this._pointerCaptures = {}, this._meshUnderPointerId = {}, this._movePointerInfo = null, this._cameraObserverCount = 0, this._delayedClicks = [null, null, null, null, null], this._deviceSourceManager = null, this._scene = e || gr.LastCreatedScene, this._scene;
  }
  /**
   * Gets the mesh that is currently under the pointer
   * @returns Mesh that the pointer is pointer is hovering over
   */
  get meshUnderPointer() {
    return this._movePointerInfo && (this._movePointerInfo._generatePickInfo(), this._movePointerInfo = null), this._pointerOverMesh;
  }
  /**
   * When using more than one pointer (for example in XR) you can get the mesh under the specific pointer
   * @param pointerId - the pointer id to use
   * @returns The mesh under this pointer id or null if not found
   */
  getMeshUnderPointerByPointerId(e) {
    return this._meshUnderPointerId[e] || null;
  }
  /**
   * Gets the pointer coordinates in 2D without any translation (ie. straight out of the pointer event)
   * @returns Vector with X/Y values directly from pointer event
   */
  get unTranslatedPointer() {
    return new at(this._unTranslatedPointerX, this._unTranslatedPointerY);
  }
  /**
   * Gets or sets the current on-screen X position of the pointer
   * @returns Translated X with respect to screen
   */
  get pointerX() {
    return this._pointerX;
  }
  set pointerX(e) {
    this._pointerX = e;
  }
  /**
   * Gets or sets the current on-screen Y position of the pointer
   * @returns Translated Y with respect to screen
   */
  get pointerY() {
    return this._pointerY;
  }
  set pointerY(e) {
    this._pointerY = e;
  }
  _updatePointerPosition(e) {
    const t = this._scene.getEngine().getInputElementClientRect();
    t && (this._pointerX = e.clientX - t.left, this._pointerY = e.clientY - t.top, this._unTranslatedPointerX = this._pointerX, this._unTranslatedPointerY = this._pointerY);
  }
  _processPointerMove(e, t) {
    const r = this._scene, n = r.getEngine(), i = n.getInputElement();
    i && (i.tabIndex = n.canvasTabIndex, r.doNotHandleCursors || (i.style.cursor = r.defaultCursor)), this._setCursorAndPointerOverMesh(e, t, r);
    for (const f of r._pointerMoveStage) {
      e = e || this._pickMove(t);
      const o = !!(e != null && e.pickedMesh);
      e = f.action(this._unTranslatedPointerX, this._unTranslatedPointerY, e, o, i);
    }
    const s = t.inputIndex >= Yn.MouseWheelX && t.inputIndex <= Yn.MouseWheelZ ? ir.POINTERWHEEL : ir.POINTERMOVE;
    r.onPointerMove && (e = e || this._pickMove(t), r.onPointerMove(t, e, s));
    let a;
    e ? (a = new vp(s, t, e), this._setRayOnPointerInfo(e, t)) : (a = new vp(s, t, null, this), this._movePointerInfo = a), r.onPointerObservable.hasObservers() && r.onPointerObservable.notifyObservers(a, s);
  }
  // Pointers handling
  /** @internal */
  _setRayOnPointerInfo(e, t) {
    const r = this._scene;
    e && r._pickingAvailable && (e.ray || (e.ray = r.createPickingRay(t.offsetX, t.offsetY, he.Identity(), r.activeCamera)));
  }
  /** @internal */
  _addCameraPointerObserver(e, t) {
    return this._cameraObserverCount++, this._scene.onPointerObservable.add(e, t);
  }
  /** @internal */
  _removeCameraPointerObserver(e) {
    return this._cameraObserverCount--, this._scene.onPointerObservable.remove(e);
  }
  _checkForPicking() {
    return !!(this._scene.onPointerObservable.observers.length > this._cameraObserverCount || this._scene.onPointerPick);
  }
  _checkPrePointerObservable(e, t, r) {
    const n = this._scene, i = new K$(r, t, this._unTranslatedPointerX, this._unTranslatedPointerY);
    return e && (i.originalPickingInfo = e, i.ray = e.ray, e.originMesh && (i.nearInteractionPickingInfo = e)), n.onPrePointerObservable.notifyObservers(i, r), !!i.skipOnPointerObservable;
  }
  /** @internal */
  _pickMove(e) {
    const t = this._scene, r = t.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, t.pointerMovePredicate, t.pointerMoveFastCheck, t.cameraToUseForPointers, t.pointerMoveTrianglePredicate);
    return this._setCursorAndPointerOverMesh(r, e, t), r;
  }
  _setCursorAndPointerOverMesh(e, t, r) {
    const i = r.getEngine().getInputElement();
    if (e != null && e.pickedMesh) {
      if (this.setPointerOverMesh(e.pickedMesh, t.pointerId, e, t), !r.doNotHandleCursors && i && this._pointerOverMesh) {
        const s = this._pointerOverMesh._getActionManagerForTrigger();
        s && s.hasPointerTriggers && (i.style.cursor = s.hoverCursor || r.hoverCursor);
      }
    } else
      this.setPointerOverMesh(null, t.pointerId, e, t);
  }
  /**
   * Use this method to simulate a pointer move on a mesh
   * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
   * @param pickResult - pickingInfo of the object wished to simulate pointer event on
   * @param pointerEventInit - pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
   */
  simulatePointerMove(e, t) {
    const r = new PointerEvent("pointermove", t);
    r.inputIndex = Yn.Move, !this._checkPrePointerObservable(e, r, ir.POINTERMOVE) && this._processPointerMove(e, r);
  }
  /**
   * Use this method to simulate a pointer down on a mesh
   * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
   * @param pickResult - pickingInfo of the object wished to simulate pointer event on
   * @param pointerEventInit - pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
   */
  simulatePointerDown(e, t) {
    const r = new PointerEvent("pointerdown", t);
    r.inputIndex = r.button + 2, !this._checkPrePointerObservable(e, r, ir.POINTERDOWN) && this._processPointerDown(e, r);
  }
  _processPointerDown(e, t) {
    const r = this._scene;
    if (e != null && e.pickedMesh) {
      this._pickedDownMesh = e.pickedMesh;
      const s = e.pickedMesh._getActionManagerForTrigger();
      if (s) {
        if (s.hasPickTriggers)
          switch (s.processTrigger(5, mo.CreateNew(e.pickedMesh, t, e)), t.button) {
            case 0:
              s.processTrigger(2, mo.CreateNew(e.pickedMesh, t, e));
              break;
            case 1:
              s.processTrigger(4, mo.CreateNew(e.pickedMesh, t, e));
              break;
            case 2:
              s.processTrigger(3, mo.CreateNew(e.pickedMesh, t, e));
              break;
          }
        s.hasSpecificTrigger(8) && window.setTimeout(() => {
          const a = r.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, (f) => f.isPickable && f.isVisible && f.isReady() && f.actionManager && f.actionManager.hasSpecificTrigger(8) && f === this._pickedDownMesh, !1, r.cameraToUseForPointers);
          a != null && a.pickedMesh && s && this._totalPointersPressed !== 0 && Date.now() - this._startingPointerTime > Xf.LongPressDelay && !this._isPointerSwiping() && (this._startingPointerTime = 0, s.processTrigger(8, mo.CreateNew(a.pickedMesh, t)));
        }, Xf.LongPressDelay);
      }
    } else
      for (const s of r._pointerDownStage)
        e = s.action(this._unTranslatedPointerX, this._unTranslatedPointerY, e, t, !1);
    let n;
    const i = ir.POINTERDOWN;
    e ? (r.onPointerDown && r.onPointerDown(t, e, i), n = new vp(i, t, e), this._setRayOnPointerInfo(e, t)) : n = new vp(i, t, null, this), r.onPointerObservable.hasObservers() && r.onPointerObservable.notifyObservers(n, i);
  }
  /**
   * @internal
   * @internals Boolean if delta for pointer exceeds drag movement threshold
   */
  _isPointerSwiping() {
    return this._isSwiping;
  }
  /**
   * Use this method to simulate a pointer up on a mesh
   * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
   * @param pickResult - pickingInfo of the object wished to simulate pointer event on
   * @param pointerEventInit - pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
   * @param doubleTap - indicates that the pointer up event should be considered as part of a double click (false by default)
   */
  simulatePointerUp(e, t, r) {
    const n = new PointerEvent("pointerup", t);
    n.inputIndex = Yn.Move;
    const i = new vG();
    r ? i.doubleClick = !0 : i.singleClick = !0, !this._checkPrePointerObservable(e, n, ir.POINTERUP) && this._processPointerUp(e, n, i);
  }
  _processPointerUp(e, t, r) {
    const n = this._scene;
    if (e != null && e.pickedMesh) {
      if (this._pickedUpMesh = e.pickedMesh, this._pickedDownMesh === this._pickedUpMesh && (n.onPointerPick && n.onPointerPick(t, e), r.singleClick && !r.ignore && n.onPointerObservable.observers.length > this._cameraObserverCount)) {
        const s = ir.POINTERPICK, a = new vp(s, t, e);
        this._setRayOnPointerInfo(e, t), n.onPointerObservable.notifyObservers(a, s);
      }
      const i = e.pickedMesh._getActionManagerForTrigger();
      if (i && !r.ignore) {
        i.processTrigger(7, mo.CreateNew(e.pickedMesh, t, e)), !r.hasSwiped && r.singleClick && i.processTrigger(1, mo.CreateNew(e.pickedMesh, t, e));
        const s = e.pickedMesh._getActionManagerForTrigger(6);
        r.doubleClick && s && s.processTrigger(6, mo.CreateNew(e.pickedMesh, t, e));
      }
    } else if (!r.ignore)
      for (const i of n._pointerUpStage)
        e = i.action(this._unTranslatedPointerX, this._unTranslatedPointerY, e, t, r.doubleClick);
    if (this._pickedDownMesh && this._pickedDownMesh !== this._pickedUpMesh) {
      const i = this._pickedDownMesh._getActionManagerForTrigger(16);
      i && i.processTrigger(16, mo.CreateNew(this._pickedDownMesh, t));
    }
    if (!r.ignore) {
      const i = new vp(ir.POINTERUP, t, e);
      if (this._setRayOnPointerInfo(e, t), n.onPointerObservable.notifyObservers(i, ir.POINTERUP), n.onPointerUp && n.onPointerUp(t, e, ir.POINTERUP), !r.hasSwiped && !this._skipPointerTap && !this._isMultiTouchGesture) {
        let s = 0;
        if (r.singleClick ? s = ir.POINTERTAP : r.doubleClick && (s = ir.POINTERDOUBLETAP), s) {
          const a = new vp(s, t, e);
          n.onPointerObservable.hasObservers() && n.onPointerObservable.hasSpecificMask(s) && n.onPointerObservable.notifyObservers(a, s);
        }
      }
    }
  }
  /**
   * Gets a boolean indicating if the current pointer event is captured (meaning that the scene has already handled the pointer down)
   * @param pointerId - defines the pointer id to use in a multi-touch scenario (0 by default)
   * @returns true if the pointer was captured
   */
  isPointerCaptured(e = 0) {
    return this._pointerCaptures[e];
  }
  /**
   * Attach events to the canvas (To handle actionManagers triggers and raise onPointerMove, onPointerDown and onPointerUp
   * @param attachUp - defines if you want to attach events to pointerup
   * @param attachDown - defines if you want to attach events to pointerdown
   * @param attachMove - defines if you want to attach events to pointermove
   * @param elementToAttachTo - defines the target DOM element to attach to (will use the canvas by default)
   */
  attachControl(e = !0, t = !0, r = !0, n = null) {
    const i = this._scene, s = i.getEngine();
    n || (n = s.getInputElement()), this._alreadyAttached && this.detachControl(), n && (this._alreadyAttachedTo = n), this._deviceSourceManager = new J$(s), this._initActionManager = (a) => {
      if (!this._meshPickProceed) {
        const f = i.skipPointerUpPicking || i._registeredActions === 0 && !this._checkForPicking() && !i.onPointerUp ? null : i.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, i.pointerUpPredicate, i.pointerUpFastCheck, i.cameraToUseForPointers);
        this._currentPickResult = f, f && (a = f.hit && f.pickedMesh ? f.pickedMesh._getActionManagerForTrigger() : null), this._meshPickProceed = !0;
      }
      return a;
    }, this._delayedSimpleClick = (a, f, o) => {
      if ((Date.now() - this._previousStartingPointerTime > Xf.DoubleClickDelay && !this._doubleClickOccured || a !== this._previousButtonPressed) && (this._doubleClickOccured = !1, f.singleClick = !0, f.ignore = !1, this._delayedClicks[a])) {
        const d = this._delayedClicks[a].evt, v = ir.POINTERTAP, u = new vp(v, d, this._currentPickResult);
        i.onPointerObservable.hasObservers() && i.onPointerObservable.hasSpecificMask(v) && i.onPointerObservable.notifyObservers(u, v), this._delayedClicks[a] = null;
      }
    }, this._initClickEvent = (a, f, o, d) => {
      var v, u;
      const l = new vG();
      this._currentPickResult = null;
      let P = null, p = a.hasSpecificMask(ir.POINTERPICK) || f.hasSpecificMask(ir.POINTERPICK) || a.hasSpecificMask(ir.POINTERTAP) || f.hasSpecificMask(ir.POINTERTAP) || a.hasSpecificMask(ir.POINTERDOUBLETAP) || f.hasSpecificMask(ir.POINTERDOUBLETAP);
      !p && Ml && (P = this._initActionManager(P, l), P && (p = P.hasPickTriggers));
      let c = !1;
      if (p) {
        const H = o.button;
        if (l.hasSwiped = this._isPointerSwiping(), !l.hasSwiped) {
          let T = !Xf.ExclusiveDoubleClickMode;
          if (T || (T = !a.hasSpecificMask(ir.POINTERDOUBLETAP) && !f.hasSpecificMask(ir.POINTERDOUBLETAP), T && !Ml.HasSpecificTrigger(6) && (P = this._initActionManager(P, l), P && (T = !P.hasSpecificTrigger(6)))), T)
            (Date.now() - this._previousStartingPointerTime > Xf.DoubleClickDelay || H !== this._previousButtonPressed) && (l.singleClick = !0, d(l, this._currentPickResult), c = !0);
          else {
            const b = {
              evt: o,
              clickInfo: l,
              timeoutId: window.setTimeout(this._delayedSimpleClick.bind(this, H, l, d), Xf.DoubleClickDelay)
            };
            this._delayedClicks[H] = b;
          }
          let q = a.hasSpecificMask(ir.POINTERDOUBLETAP) || f.hasSpecificMask(ir.POINTERDOUBLETAP);
          !q && Ml.HasSpecificTrigger(6) && (P = this._initActionManager(P, l), P && (q = P.hasSpecificTrigger(6))), q && (H === this._previousButtonPressed && Date.now() - this._previousStartingPointerTime < Xf.DoubleClickDelay && !this._doubleClickOccured ? (!l.hasSwiped && !this._isPointerSwiping() ? (this._previousStartingPointerTime = 0, this._doubleClickOccured = !0, l.doubleClick = !0, l.ignore = !1, Xf.ExclusiveDoubleClickMode && this._delayedClicks[H] && (clearTimeout((v = this._delayedClicks[H]) === null || v === void 0 ? void 0 : v.timeoutId), this._delayedClicks[H] = null), d(l, this._currentPickResult)) : (this._doubleClickOccured = !1, this._previousStartingPointerTime = this._startingPointerTime, this._previousStartingPointerPosition.x = this._startingPointerPosition.x, this._previousStartingPointerPosition.y = this._startingPointerPosition.y, this._previousButtonPressed = H, Xf.ExclusiveDoubleClickMode ? (this._delayedClicks[H] && (clearTimeout((u = this._delayedClicks[H]) === null || u === void 0 ? void 0 : u.timeoutId), this._delayedClicks[H] = null), d(l, this._previousPickResult)) : d(l, this._currentPickResult)), c = !0) : (this._doubleClickOccured = !1, this._previousStartingPointerTime = this._startingPointerTime, this._previousStartingPointerPosition.x = this._startingPointerPosition.x, this._previousStartingPointerPosition.y = this._startingPointerPosition.y, this._previousButtonPressed = H));
        }
      }
      c || d(l, this._currentPickResult);
    }, this._onPointerMove = (a) => {
      if (this._updatePointerPosition(a), !this._isSwiping && this._swipeButtonPressed !== -1 && (this._isSwiping = Math.abs(this._startingPointerPosition.x - this._pointerX) > Xf.DragMovementThreshold || Math.abs(this._startingPointerPosition.y - this._pointerY) > Xf.DragMovementThreshold), s.isPointerLock && s._verifyPointerLock(), this._checkPrePointerObservable(null, a, a.inputIndex >= Yn.MouseWheelX && a.inputIndex <= Yn.MouseWheelZ ? ir.POINTERWHEEL : ir.POINTERMOVE) || !i.cameraToUseForPointers && !i.activeCamera)
        return;
      if (i.skipPointerMovePicking) {
        this._processPointerMove(new F9(), a);
        return;
      }
      i.pointerMovePredicate || (i.pointerMovePredicate = (o) => o.isPickable && o.isVisible && o.isReady() && o.isEnabled() && (o.enablePointerMoveEvents || i.constantlyUpdateMeshUnderPointer || o._getActionManagerForTrigger() !== null) && (!i.cameraToUseForPointers || (i.cameraToUseForPointers.layerMask & o.layerMask) !== 0));
      const f = i._registeredActions > 0 || i.constantlyUpdateMeshUnderPointer ? this._pickMove(a) : null;
      this._processPointerMove(f, a);
    }, this._onPointerDown = (a) => {
      var f;
      if (this._totalPointersPressed++, this._pickedDownMesh = null, this._meshPickProceed = !1, Xf.ExclusiveDoubleClickMode) {
        for (let d = 0; d < this._delayedClicks.length; d++)
          if (this._delayedClicks[d])
            if (a.button === d)
              clearTimeout((f = this._delayedClicks[d]) === null || f === void 0 ? void 0 : f.timeoutId);
            else {
              const v = this._delayedClicks[d].clickInfo;
              this._doubleClickOccured = !1, v.singleClick = !0, v.ignore = !1;
              const u = this._delayedClicks[d].evt, l = ir.POINTERTAP, P = new vp(l, u, this._currentPickResult);
              i.onPointerObservable.hasObservers() && i.onPointerObservable.hasSpecificMask(l) && i.onPointerObservable.notifyObservers(P, l), this._delayedClicks[d] = null;
            }
      }
      if (this._updatePointerPosition(a), this._swipeButtonPressed === -1 && (this._swipeButtonPressed = a.button), i.preventDefaultOnPointerDown && n && (a.preventDefault(), n.focus()), this._startingPointerPosition.x = this._pointerX, this._startingPointerPosition.y = this._pointerY, this._startingPointerTime = Date.now(), this._checkPrePointerObservable(null, a, ir.POINTERDOWN) || !i.cameraToUseForPointers && !i.activeCamera)
        return;
      this._pointerCaptures[a.pointerId] = !0, i.pointerDownPredicate || (i.pointerDownPredicate = (d) => d.isPickable && d.isVisible && d.isReady() && d.isEnabled() && (!i.cameraToUseForPointers || (i.cameraToUseForPointers.layerMask & d.layerMask) !== 0)), this._pickedDownMesh = null;
      let o;
      i.skipPointerDownPicking || i._registeredActions === 0 && !this._checkForPicking() && !i.onPointerDown ? o = new F9() : o = i.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, i.pointerDownPredicate, i.pointerDownFastCheck, i.cameraToUseForPointers), this._processPointerDown(o, a);
    }, this._onPointerUp = (a) => {
      this._totalPointersPressed !== 0 && (this._totalPointersPressed--, this._pickedUpMesh = null, this._meshPickProceed = !1, this._updatePointerPosition(a), i.preventDefaultOnPointerUp && n && (a.preventDefault(), n.focus()), this._initClickEvent(i.onPrePointerObservable, i.onPointerObservable, a, (f, o) => {
        if (i.onPrePointerObservable.hasObservers() && (this._skipPointerTap = !1, !f.ignore)) {
          if (this._checkPrePointerObservable(null, a, ir.POINTERUP)) {
            this._swipeButtonPressed === a.button && (this._isSwiping = !1, this._swipeButtonPressed = -1), a.buttons === 0 && (this._pointerCaptures[a.pointerId] = !1);
            return;
          }
          f.hasSwiped || (f.singleClick && i.onPrePointerObservable.hasSpecificMask(ir.POINTERTAP) && this._checkPrePointerObservable(null, a, ir.POINTERTAP) && (this._skipPointerTap = !0), f.doubleClick && i.onPrePointerObservable.hasSpecificMask(ir.POINTERDOUBLETAP) && this._checkPrePointerObservable(null, a, ir.POINTERDOUBLETAP) && (this._skipPointerTap = !0));
        }
        if (!this._pointerCaptures[a.pointerId]) {
          this._swipeButtonPressed === a.button && (this._isSwiping = !1, this._swipeButtonPressed = -1);
          return;
        }
        a.buttons === 0 && (this._pointerCaptures[a.pointerId] = !1), !(!i.cameraToUseForPointers && !i.activeCamera) && (i.pointerUpPredicate || (i.pointerUpPredicate = (d) => d.isPickable && d.isVisible && d.isReady() && d.isEnabled() && (!i.cameraToUseForPointers || (i.cameraToUseForPointers.layerMask & d.layerMask) !== 0)), !this._meshPickProceed && (Ml && Ml.HasTriggers || this._checkForPicking() || i.onPointerUp) && this._initActionManager(null, f), o || (o = this._currentPickResult), this._processPointerUp(o, a, f), this._previousPickResult = this._currentPickResult, this._swipeButtonPressed === a.button && (this._isSwiping = !1, this._swipeButtonPressed = -1));
      }));
    }, this._onKeyDown = (a) => {
      const f = t4.KEYDOWN;
      if (i.onPreKeyboardObservable.hasObservers()) {
        const o = new Y5(f, a);
        if (i.onPreKeyboardObservable.notifyObservers(o, f), o.skipOnKeyboardObservable)
          return;
      }
      if (i.onKeyboardObservable.hasObservers()) {
        const o = new MC(f, a);
        i.onKeyboardObservable.notifyObservers(o, f);
      }
      i.actionManager && i.actionManager.processTrigger(14, mo.CreateNewFromScene(i, a));
    }, this._onKeyUp = (a) => {
      const f = t4.KEYUP;
      if (i.onPreKeyboardObservable.hasObservers()) {
        const o = new Y5(f, a);
        if (i.onPreKeyboardObservable.notifyObservers(o, f), o.skipOnKeyboardObservable)
          return;
      }
      if (i.onKeyboardObservable.hasObservers()) {
        const o = new MC(f, a);
        i.onKeyboardObservable.notifyObservers(o, f);
      }
      i.actionManager && i.actionManager.processTrigger(15, mo.CreateNewFromScene(i, a));
    }, this._deviceSourceManager.onDeviceConnectedObservable.add((a) => {
      a.deviceType === vn.Mouse ? a.onInputChangedObservable.add((f) => {
        f.inputIndex === Yn.LeftClick || f.inputIndex === Yn.MiddleClick || f.inputIndex === Yn.RightClick || f.inputIndex === Yn.BrowserBack || f.inputIndex === Yn.BrowserForward ? t && a.getInput(f.inputIndex) === 1 ? this._onPointerDown(f) : e && a.getInput(f.inputIndex) === 0 && this._onPointerUp(f) : r && (f.inputIndex === Yn.Move ? this._onPointerMove(f) : (f.inputIndex === Yn.MouseWheelX || f.inputIndex === Yn.MouseWheelY || f.inputIndex === Yn.MouseWheelZ) && this._onPointerMove(f));
      }) : a.deviceType === vn.Touch ? a.onInputChangedObservable.add((f) => {
        f.inputIndex === Yn.LeftClick && (t && a.getInput(f.inputIndex) === 1 ? (this._onPointerDown(f), this._totalPointersPressed > 1 && (this._isMultiTouchGesture = !0)) : e && a.getInput(f.inputIndex) === 0 && (this._onPointerUp(f), this._totalPointersPressed === 0 && (this._isMultiTouchGesture = !1))), r && f.inputIndex === Yn.Move && this._onPointerMove(f);
      }) : a.deviceType === vn.Keyboard && a.onInputChangedObservable.add((f) => {
        f.type === "keydown" ? this._onKeyDown(f) : f.type === "keyup" && this._onKeyUp(f);
      });
    }), this._alreadyAttached = !0;
  }
  /**
   * Detaches all event handlers
   */
  detachControl() {
    this._alreadyAttached && (this._deviceSourceManager.dispose(), this._deviceSourceManager = null, this._alreadyAttachedTo && !this._scene.doNotHandleCursors && (this._alreadyAttachedTo.style.cursor = this._scene.defaultCursor), this._alreadyAttached = !1, this._alreadyAttachedTo = null);
  }
  /**
   * Force the value of meshUnderPointer
   * @param mesh - defines the mesh to use
   * @param pointerId - optional pointer id when using more than one pointer. Defaults to 0
   * @param pickResult - optional pickingInfo data used to find mesh
   * @param evt - optional pointer event
   */
  setPointerOverMesh(e, t = 0, r, n) {
    if (this._meshUnderPointerId[t] === e && (!e || !e._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting))
      return;
    const i = this._meshUnderPointerId[t];
    let s;
    i && (s = i._getActionManagerForTrigger(10), s && s.processTrigger(10, mo.CreateNew(i, n, { pointerId: t }))), e ? (this._meshUnderPointerId[t] = e, this._pointerOverMesh = e, s = e._getActionManagerForTrigger(9), s && s.processTrigger(9, mo.CreateNew(e, n, { pointerId: t, pickResult: r }))) : (delete this._meshUnderPointerId[t], this._pointerOverMesh = null);
  }
  /**
   * Gets the mesh under the pointer
   * @returns a Mesh or null if no mesh is under the pointer
   */
  getPointerOverMesh() {
    return this.meshUnderPointer;
  }
  /**
   * @param mesh - Mesh to invalidate
   * @internal
   */
  _invalidateMesh(e) {
    this._pointerOverMesh === e && (this._pointerOverMesh = null), this._pickedDownMesh === e && (this._pickedDownMesh = null), this._pickedUpMesh === e && (this._pickedUpMesh = null);
    for (const t in this._meshUnderPointerId)
      this._meshUnderPointerId[t] === e && delete this._meshUnderPointerId[t];
  }
}
Xf.DragMovementThreshold = 10;
Xf.LongPressDelay = 500;
Xf.DoubleClickDelay = 300;
Xf.ExclusiveDoubleClickMode = !1;
class v9 {
  /**
   * Returns the smallest value ever
   */
  get min() {
    return this._min;
  }
  /**
   * Returns the biggest value ever
   */
  get max() {
    return this._max;
  }
  /**
   * Returns the average value since the performance counter is running
   */
  get average() {
    return this._average;
  }
  /**
   * Returns the average value of the last second the counter was monitored
   */
  get lastSecAverage() {
    return this._lastSecAverage;
  }
  /**
   * Returns the current value
   */
  get current() {
    return this._current;
  }
  /**
   * Gets the accumulated total
   */
  get total() {
    return this._totalAccumulated;
  }
  /**
   * Gets the total value count
   */
  get count() {
    return this._totalValueCount;
  }
  /**
   * Creates a new counter
   */
  constructor() {
    this._startMonitoringTime = 0, this._min = 0, this._max = 0, this._average = 0, this._lastSecAverage = 0, this._current = 0, this._totalValueCount = 0, this._totalAccumulated = 0, this._lastSecAccumulated = 0, this._lastSecTime = 0, this._lastSecValueCount = 0;
  }
  /**
   * Call this method to start monitoring a new frame.
   * This scenario is typically used when you accumulate monitoring time many times for a single frame, you call this method at the start of the frame, then beginMonitoring to start recording and endMonitoring(false) to accumulated the recorded time to the PerfCounter or addCount() to accumulate a monitored count.
   */
  fetchNewFrame() {
    this._totalValueCount++, this._current = 0, this._lastSecValueCount++;
  }
  /**
   * Call this method to monitor a count of something (e.g. mesh drawn in viewport count)
   * @param newCount the count value to add to the monitored count
   * @param fetchResult true when it's the last time in the frame you add to the counter and you wish to update the statistics properties (min/max/average), false if you only want to update statistics.
   */
  addCount(e, t) {
    v9.Enabled && (this._current += e, t && this._fetchResult());
  }
  /**
   * Start monitoring this performance counter
   */
  beginMonitoring() {
    v9.Enabled && (this._startMonitoringTime = Yi.Now);
  }
  /**
   * Compute the time lapsed since the previous beginMonitoring() call.
   * @param newFrame true by default to fetch the result and monitor a new frame, if false the time monitored will be added to the current frame counter
   */
  endMonitoring(e = !0) {
    if (!v9.Enabled)
      return;
    e && this.fetchNewFrame();
    const t = Yi.Now;
    this._current = t - this._startMonitoringTime, e && this._fetchResult();
  }
  /**
   * Call this method to end the monitoring of a frame.
   * This scenario is typically used when you accumulate monitoring time many times for a single frame, you call this method at the end of the frame, after beginMonitoring to start recording and endMonitoring(false) to accumulated the recorded time to the PerfCounter or addCount() to accumulate a monitored count.
   */
  endFrame() {
    this._fetchResult();
  }
  _fetchResult() {
    this._totalAccumulated += this._current, this._lastSecAccumulated += this._current, this._min = Math.min(this._min, this._current), this._max = Math.max(this._max, this._current), this._average = this._totalAccumulated / this._totalValueCount;
    const e = Yi.Now;
    e - this._lastSecTime > 1e3 && (this._lastSecAverage = this._lastSecAccumulated / this._lastSecValueCount, this._lastSecTime = e, this._lastSecAccumulated = 0, this._lastSecValueCount = 0);
  }
}
v9.Enabled = !0;
class BA {
  /**
   * Creates a Plane object according to the given floats a, b, c, d and the plane equation : ax + by + cz + d = 0
   * @param a a component of the plane
   * @param b b component of the plane
   * @param c c component of the plane
   * @param d d component of the plane
   */
  constructor(e, t, r, n) {
    this.normal = new S(e, t, r), this.d = n;
  }
  /**
   * @returns the plane coordinates as a new array of 4 elements [a, b, c, d].
   */
  asArray() {
    return [this.normal.x, this.normal.y, this.normal.z, this.d];
  }
  // Methods
  /**
   * @returns a new plane copied from the current Plane.
   */
  clone() {
    return new BA(this.normal.x, this.normal.y, this.normal.z, this.d);
  }
  /**
   * @returns the string "Plane".
   */
  getClassName() {
    return "Plane";
  }
  /**
   * @returns the Plane hash code.
   */
  getHashCode() {
    let e = this.normal.getHashCode();
    return e = e * 397 ^ (this.d | 0), e;
  }
  /**
   * Normalize the current Plane in place.
   * @returns the updated Plane.
   */
  normalize() {
    const e = Math.sqrt(this.normal.x * this.normal.x + this.normal.y * this.normal.y + this.normal.z * this.normal.z);
    let t = 0;
    return e !== 0 && (t = 1 / e), this.normal.x *= t, this.normal.y *= t, this.normal.z *= t, this.d *= t, this;
  }
  /**
   * Applies a transformation the plane and returns the result
   * @param transformation the transformation matrix to be applied to the plane
   * @returns a new Plane as the result of the transformation of the current Plane by the given matrix.
   */
  transform(e) {
    const t = BA._TmpMatrix;
    e.invertToRef(t);
    const r = t.m, n = this.normal.x, i = this.normal.y, s = this.normal.z, a = this.d, f = n * r[0] + i * r[1] + s * r[2] + a * r[3], o = n * r[4] + i * r[5] + s * r[6] + a * r[7], d = n * r[8] + i * r[9] + s * r[10] + a * r[11], v = n * r[12] + i * r[13] + s * r[14] + a * r[15];
    return new BA(f, o, d, v);
  }
  /**
   * Compute the dot product between the point and the plane normal
   * @param point point to calculate the dot product with
   * @returns the dot product (float) of the point coordinates and the plane normal.
   */
  dotCoordinate(e) {
    return this.normal.x * e.x + this.normal.y * e.y + this.normal.z * e.z + this.d;
  }
  /**
   * Updates the current Plane from the plane defined by the three given points.
   * @param point1 one of the points used to construct the plane
   * @param point2 one of the points used to construct the plane
   * @param point3 one of the points used to construct the plane
   * @returns the updated Plane.
   */
  copyFromPoints(e, t, r) {
    const n = t.x - e.x, i = t.y - e.y, s = t.z - e.z, a = r.x - e.x, f = r.y - e.y, o = r.z - e.z, d = i * o - s * f, v = s * a - n * o, u = n * f - i * a, l = Math.sqrt(d * d + v * v + u * u);
    let P;
    return l !== 0 ? P = 1 / l : P = 0, this.normal.x = d * P, this.normal.y = v * P, this.normal.z = u * P, this.d = -(this.normal.x * e.x + this.normal.y * e.y + this.normal.z * e.z), this;
  }
  /**
   * Checks if the plane is facing a given direction (meaning if the plane's normal is pointing in the opposite direction of the given vector).
   * Note that for this function to work as expected you should make sure that:
   *   - direction and the plane normal are normalized
   *   - epsilon is a number just bigger than -1, something like -0.99 for eg
   * @param direction the direction to check if the plane is facing
   * @param epsilon value the dot product is compared against (returns true if dot <= epsilon)
   * @returns True if the plane is facing the given direction
   */
  isFrontFacingTo(e, t) {
    return S.Dot(this.normal, e) <= t;
  }
  /**
   * Calculates the distance to a point
   * @param point point to calculate distance to
   * @returns the signed distance (float) from the given point to the Plane.
   */
  signedDistanceTo(e) {
    return S.Dot(e, this.normal) + this.d;
  }
  // Statics
  /**
   * Creates a plane from an  array
   * @param array the array to create a plane from
   * @returns a new Plane from the given array.
   */
  static FromArray(e) {
    return new BA(e[0], e[1], e[2], e[3]);
  }
  /**
   * Creates a plane from three points
   * @param point1 point used to create the plane
   * @param point2 point used to create the plane
   * @param point3 point used to create the plane
   * @returns a new Plane defined by the three given points.
   */
  static FromPoints(e, t, r) {
    const n = new BA(0, 0, 0, 0);
    return n.copyFromPoints(e, t, r), n;
  }
  /**
   * Creates a plane from an origin point and a normal
   * @param origin origin of the plane to be constructed
   * @param normal normal of the plane to be constructed
   * @returns a new Plane the normal vector to this plane at the given origin point.
   */
  static FromPositionAndNormal(e, t) {
    const r = new BA(0, 0, 0, 0);
    return this.FromPositionAndNormalToRef(e, t, r);
  }
  /**
   * Updates the given Plane "result" from an origin point and a normal.
   * @param origin origin of the plane to be constructed
   * @param normal the normalized normals of the plane to be constructed
   * @param result defines the Plane where to store the result
   * @returns result input
   */
  static FromPositionAndNormalToRef(e, t, r) {
    return r.normal.copyFrom(t), r.normal.normalize(), r.d = -e.dot(r.normal), r;
  }
  /**
   * Calculates the distance from a plane and a point
   * @param origin origin of the plane to be constructed
   * @param normal normal of the plane to be constructed
   * @param point point to calculate distance to
   * @returns the signed distance between the plane defined by the normal vector at the "origin"" point and the given other point.
   */
  static SignedDistanceToPlaneFromPositionAndNormal(e, t, r) {
    const n = -(t.x * e.x + t.y * e.y + t.z * e.z);
    return S.Dot(r, t) + n;
  }
}
BA._TmpMatrix = he.Identity();
class Xc {
  /**
   * Gets the planes representing the frustum
   * @param transform matrix to be applied to the returned planes
   * @returns a new array of 6 Frustum planes computed by the given transformation matrix.
   */
  static GetPlanes(e) {
    const t = [];
    for (let r = 0; r < 6; r++)
      t.push(new BA(0, 0, 0, 0));
    return Xc.GetPlanesToRef(e, t), t;
  }
  /**
   * Gets the near frustum plane transformed by the transform matrix
   * @param transform transformation matrix to be applied to the resulting frustum plane
   * @param frustumPlane the resulting frustum plane
   */
  static GetNearPlaneToRef(e, t) {
    const r = e.m;
    t.normal.x = r[3] + r[2], t.normal.y = r[7] + r[6], t.normal.z = r[11] + r[10], t.d = r[15] + r[14], t.normalize();
  }
  /**
   * Gets the far frustum plane transformed by the transform matrix
   * @param transform transformation matrix to be applied to the resulting frustum plane
   * @param frustumPlane the resulting frustum plane
   */
  static GetFarPlaneToRef(e, t) {
    const r = e.m;
    t.normal.x = r[3] - r[2], t.normal.y = r[7] - r[6], t.normal.z = r[11] - r[10], t.d = r[15] - r[14], t.normalize();
  }
  /**
   * Gets the left frustum plane transformed by the transform matrix
   * @param transform transformation matrix to be applied to the resulting frustum plane
   * @param frustumPlane the resulting frustum plane
   */
  static GetLeftPlaneToRef(e, t) {
    const r = e.m;
    t.normal.x = r[3] + r[0], t.normal.y = r[7] + r[4], t.normal.z = r[11] + r[8], t.d = r[15] + r[12], t.normalize();
  }
  /**
   * Gets the right frustum plane transformed by the transform matrix
   * @param transform transformation matrix to be applied to the resulting frustum plane
   * @param frustumPlane the resulting frustum plane
   */
  static GetRightPlaneToRef(e, t) {
    const r = e.m;
    t.normal.x = r[3] - r[0], t.normal.y = r[7] - r[4], t.normal.z = r[11] - r[8], t.d = r[15] - r[12], t.normalize();
  }
  /**
   * Gets the top frustum plane transformed by the transform matrix
   * @param transform transformation matrix to be applied to the resulting frustum plane
   * @param frustumPlane the resulting frustum plane
   */
  static GetTopPlaneToRef(e, t) {
    const r = e.m;
    t.normal.x = r[3] - r[1], t.normal.y = r[7] - r[5], t.normal.z = r[11] - r[9], t.d = r[15] - r[13], t.normalize();
  }
  /**
   * Gets the bottom frustum plane transformed by the transform matrix
   * @param transform transformation matrix to be applied to the resulting frustum plane
   * @param frustumPlane the resulting frustum plane
   */
  static GetBottomPlaneToRef(e, t) {
    const r = e.m;
    t.normal.x = r[3] + r[1], t.normal.y = r[7] + r[5], t.normal.z = r[11] + r[9], t.d = r[15] + r[13], t.normalize();
  }
  /**
   * Sets the given array "frustumPlanes" with the 6 Frustum planes computed by the given transformation matrix.
   * @param transform transformation matrix to be applied to the resulting frustum planes
   * @param frustumPlanes the resulting frustum planes
   */
  static GetPlanesToRef(e, t) {
    Xc.GetNearPlaneToRef(e, t[0]), Xc.GetFarPlaneToRef(e, t[1]), Xc.GetLeftPlaneToRef(e, t[2]), Xc.GetRightPlaneToRef(e, t[3]), Xc.GetTopPlaneToRef(e, t[4]), Xc.GetBottomPlaneToRef(e, t[5]);
  }
  /**
   * Tests if a point is located between the frustum planes.
   * @param point defines the point to test
   * @param frustumPlanes defines the frustum planes to test
   * @returns true if the point is located between the frustum planes
   */
  static IsPointInFrustum(e, t) {
    for (let r = 0; r < 6; r++)
      if (t[r].dotCoordinate(e) < 0)
        return !1;
    return !0;
  }
}
class bR {
  /**
   * Gets an unique (relatively to the current scene) Id
   */
  static get UniqueId() {
    const e = this._UniqueIdCounter;
    return this._UniqueIdCounter++, e;
  }
}
bR._UniqueIdCounter = 1;
class ra {
  /**
   * Sort function to order lights for rendering.
   * @param a First Light object to compare to second.
   * @param b Second Light object to compare first.
   * @returns -1 to reduce's a's index relative to be, 0 for no change, 1 to increase a's index relative to b.
   */
  static CompareLightsPriority(e, t) {
    return e.shadowEnabled !== t.shadowEnabled ? (t.shadowEnabled ? 1 : 0) - (e.shadowEnabled ? 1 : 0) : t.renderPriority - e.renderPriority;
  }
}
ra.FALLOFF_DEFAULT = 0;
ra.FALLOFF_PHYSICAL = 1;
ra.FALLOFF_GLTF = 2;
ra.FALLOFF_STANDARD = 3;
ra.LIGHTMAP_DEFAULT = 0;
ra.LIGHTMAP_SPECULAR = 1;
ra.LIGHTMAP_SHADOWSONLY = 2;
ra.INTENSITYMODE_AUTOMATIC = 0;
ra.INTENSITYMODE_LUMINOUSPOWER = 1;
ra.INTENSITYMODE_LUMINOUSINTENSITY = 2;
ra.INTENSITYMODE_ILLUMINANCE = 3;
ra.INTENSITYMODE_LUMINANCE = 4;
ra.LIGHTTYPEID_POINTLIGHT = 0;
ra.LIGHTTYPEID_DIRECTIONALLIGHT = 1;
ra.LIGHTTYPEID_SPOTLIGHT = 2;
ra.LIGHTTYPEID_HEMISPHERICLIGHT = 3;
class e6e {
  constructor() {
    this.pointerDownFastCheck = !1, this.pointerUpFastCheck = !1, this.pointerMoveFastCheck = !1, this.skipPointerMovePicking = !1, this.skipPointerDownPicking = !1, this.skipPointerUpPicking = !1;
  }
}
var $H;
(function(A) {
  A[A.BackwardCompatible = 0] = "BackwardCompatible", A[A.Intermediate = 1] = "Intermediate", A[A.Aggressive = 2] = "Aggressive";
})($H || ($H = {}));
class sr extends J1 {
  /**
   * Factory used to create the default material.
   * @param scene The scene to create the material for
   * @returns The default material
   */
  static DefaultMaterialFactory(e) {
    throw qn("StandardMaterial");
  }
  /**
   * Factory used to create the a collision coordinator.
   * @returns The collision coordinator
   */
  static CollisionCoordinatorFactory() {
    throw qn("DefaultCollisionCoordinator");
  }
  /**
   * Texture used in all pbr material as the reflection texture.
   * As in the majority of the scene they are the same (exception for multi room and so on),
   * this is easier to reference from here than from all the materials.
   */
  get environmentTexture() {
    return this._environmentTexture;
  }
  /**
   * Texture used in all pbr material as the reflection texture.
   * As in the majority of the scene they are the same (exception for multi room and so on),
   * this is easier to set here than in all the materials.
   */
  set environmentTexture(e) {
    this._environmentTexture !== e && (this._environmentTexture = e, this.markAllMaterialsAsDirty(1));
  }
  /**
   * Default image processing configuration used either in the rendering
   * Forward main pass or through the imageProcessingPostProcess if present.
   * As in the majority of the scene they are the same (exception for multi camera),
   * this is easier to reference from here than from all the materials and post process.
   *
   * No setter as we it is a shared configuration, you can set the values instead.
   */
  get imageProcessingConfiguration() {
    return this._imageProcessingConfiguration;
  }
  /**
   * Gets or sets a value indicating how to treat performance relatively to ease of use and backward compatibility
   */
  get performancePriority() {
    return this._performancePriority;
  }
  set performancePriority(e) {
    if (e !== this._performancePriority) {
      switch (this._performancePriority = e, e) {
        case $H.BackwardCompatible:
          this.skipFrustumClipping = !1, this._renderingManager.maintainStateBetweenFrames = !1, this.skipPointerMovePicking = !1, this.autoClear = !0;
          break;
        case $H.Intermediate:
          this.skipFrustumClipping = !1, this._renderingManager.maintainStateBetweenFrames = !1, this.skipPointerMovePicking = !0, this.autoClear = !1;
          break;
        case $H.Aggressive:
          this.skipFrustumClipping = !0, this._renderingManager.maintainStateBetweenFrames = !0, this.skipPointerMovePicking = !0, this.autoClear = !1;
          break;
      }
      this.onScenePerformancePriorityChangedObservable.notifyObservers(e);
    }
  }
  /**
   * Gets or sets a boolean indicating if all rendering must be done in wireframe
   */
  set forceWireframe(e) {
    this._forceWireframe !== e && (this._forceWireframe = e, this.markAllMaterialsAsDirty(16));
  }
  get forceWireframe() {
    return this._forceWireframe;
  }
  /**
   * Gets or sets a boolean indicating if we should skip the frustum clipping part of the active meshes selection
   */
  set skipFrustumClipping(e) {
    this._skipFrustumClipping !== e && (this._skipFrustumClipping = e);
  }
  get skipFrustumClipping() {
    return this._skipFrustumClipping;
  }
  /**
   * Gets or sets a boolean indicating if all rendering must be done in point cloud
   */
  set forcePointsCloud(e) {
    this._forcePointsCloud !== e && (this._forcePointsCloud = e, this.markAllMaterialsAsDirty(16));
  }
  get forcePointsCloud() {
    return this._forcePointsCloud;
  }
  /**
   * Gets or sets the animation properties override
   */
  get animationPropertiesOverride() {
    return this._animationPropertiesOverride;
  }
  set animationPropertiesOverride(e) {
    this._animationPropertiesOverride = e;
  }
  /** Sets a function to be executed when this scene is disposed. */
  set onDispose(e) {
    this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);
  }
  /** Sets a function to be executed before rendering this scene */
  set beforeRender(e) {
    this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), e && (this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e));
  }
  /** Sets a function to be executed after rendering this scene */
  set afterRender(e) {
    this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), e && (this._onAfterRenderObserver = this.onAfterRenderObservable.add(e));
  }
  /** Sets a function to be executed before rendering a camera*/
  set beforeCameraRender(e) {
    this._onBeforeCameraRenderObserver && this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = this.onBeforeCameraRenderObservable.add(e);
  }
  /** Sets a function to be executed after rendering a camera*/
  set afterCameraRender(e) {
    this._onAfterCameraRenderObserver && this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = this.onAfterCameraRenderObservable.add(e);
  }
  /**
   * Gets or sets a predicate used to select candidate meshes for a pointer down event
   */
  get pointerDownPredicate() {
    return this._pointerPickingConfiguration.pointerDownPredicate;
  }
  set pointerDownPredicate(e) {
    this._pointerPickingConfiguration.pointerDownPredicate = e;
  }
  /**
   * Gets or sets a predicate used to select candidate meshes for a pointer up event
   */
  get pointerUpPredicate() {
    return this._pointerPickingConfiguration.pointerUpPredicate;
  }
  set pointerUpPredicate(e) {
    this._pointerPickingConfiguration.pointerUpPredicate = e;
  }
  /**
   * Gets or sets a predicate used to select candidate meshes for a pointer move event
   */
  get pointerMovePredicate() {
    return this._pointerPickingConfiguration.pointerMovePredicate;
  }
  set pointerMovePredicate(e) {
    this._pointerPickingConfiguration.pointerMovePredicate = e;
  }
  /**
   * Gets or sets a predicate used to select candidate meshes for a pointer down event
   */
  get pointerDownFastCheck() {
    return this._pointerPickingConfiguration.pointerDownFastCheck;
  }
  set pointerDownFastCheck(e) {
    this._pointerPickingConfiguration.pointerDownFastCheck = e;
  }
  /**
   * Gets or sets a predicate used to select candidate meshes for a pointer up event
   */
  get pointerUpFastCheck() {
    return this._pointerPickingConfiguration.pointerUpFastCheck;
  }
  set pointerUpFastCheck(e) {
    this._pointerPickingConfiguration.pointerUpFastCheck = e;
  }
  /**
   * Gets or sets a predicate used to select candidate meshes for a pointer move event
   */
  get pointerMoveFastCheck() {
    return this._pointerPickingConfiguration.pointerMoveFastCheck;
  }
  set pointerMoveFastCheck(e) {
    this._pointerPickingConfiguration.pointerMoveFastCheck = e;
  }
  /**
   * Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer move event occurs.
   */
  get skipPointerMovePicking() {
    return this._pointerPickingConfiguration.skipPointerMovePicking;
  }
  set skipPointerMovePicking(e) {
    this._pointerPickingConfiguration.skipPointerMovePicking = e;
  }
  /**
   * Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer down event occurs.
   */
  get skipPointerDownPicking() {
    return this._pointerPickingConfiguration.skipPointerDownPicking;
  }
  set skipPointerDownPicking(e) {
    this._pointerPickingConfiguration.skipPointerDownPicking = e;
  }
  /**
   * Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer up event occurs.  Off by default.
   */
  get skipPointerUpPicking() {
    return this._pointerPickingConfiguration.skipPointerUpPicking;
  }
  set skipPointerUpPicking(e) {
    this._pointerPickingConfiguration.skipPointerUpPicking = e;
  }
  /**
   * Gets the pointer coordinates without any translation (ie. straight out of the pointer event)
   */
  get unTranslatedPointer() {
    return this._inputManager.unTranslatedPointer;
  }
  /**
   * Gets or sets the distance in pixel that you have to move to prevent some events. Default is 10 pixels
   */
  static get DragMovementThreshold() {
    return Xf.DragMovementThreshold;
  }
  static set DragMovementThreshold(e) {
    Xf.DragMovementThreshold = e;
  }
  /**
   * Time in milliseconds to wait to raise long press events if button is still pressed. Default is 500 ms
   */
  static get LongPressDelay() {
    return Xf.LongPressDelay;
  }
  static set LongPressDelay(e) {
    Xf.LongPressDelay = e;
  }
  /**
   * Time in milliseconds to wait to raise long press events if button is still pressed. Default is 300 ms
   */
  static get DoubleClickDelay() {
    return Xf.DoubleClickDelay;
  }
  static set DoubleClickDelay(e) {
    Xf.DoubleClickDelay = e;
  }
  /** If you need to check double click without raising a single click at first click, enable this flag */
  static get ExclusiveDoubleClickMode() {
    return Xf.ExclusiveDoubleClickMode;
  }
  static set ExclusiveDoubleClickMode(e) {
    Xf.ExclusiveDoubleClickMode = e;
  }
  /**
   * Bind the current view position to an effect.
   * @param effect The effect to be bound
   * @param variableName name of the shader variable that will hold the eye position
   * @param isVector3 true to indicates that variableName is a Vector3 and not a Vector4
   * @returns the computed eye position
   */
  bindEyePosition(e, t = "vEyePosition", r = !1) {
    const n = this._forcedViewPosition ? this._forcedViewPosition : this._mirroredCameraPosition ? this._mirroredCameraPosition : this.activeCamera.globalPosition, i = this.useRightHandedSystem === (this._mirroredCameraPosition != null);
    return ue.Vector4[0].set(n.x, n.y, n.z, i ? -1 : 1), e && (r ? e.setFloat3(t, ue.Vector4[0].x, ue.Vector4[0].y, ue.Vector4[0].z) : e.setVector4(t, ue.Vector4[0])), ue.Vector4[0];
  }
  /**
   * Update the scene ubo before it can be used in rendering processing
   * @returns the scene UniformBuffer
   */
  finalizeSceneUbo() {
    const e = this.getSceneUniformBuffer(), t = this.bindEyePosition(null);
    return e.updateFloat4("vEyePosition", t.x, t.y, t.z, t.w), e.update(), e;
  }
  /**
   * Gets or sets a boolean indicating if the scene must use right-handed coordinates system
   */
  set useRightHandedSystem(e) {
    this._useRightHandedSystem !== e && (this._useRightHandedSystem = e, this.markAllMaterialsAsDirty(16));
  }
  get useRightHandedSystem() {
    return this._useRightHandedSystem;
  }
  /**
   * Sets the step Id used by deterministic lock step
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
   * @param newStepId defines the step Id
   */
  setStepId(e) {
    this._currentStepId = e;
  }
  /**
   * Gets the step Id used by deterministic lock step
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
   * @returns the step Id
   */
  getStepId() {
    return this._currentStepId;
  }
  /**
   * Gets the internal step used by deterministic lock step
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
   * @returns the internal step
   */
  getInternalStep() {
    return this._currentInternalStep;
  }
  /**
   * Gets or sets a boolean indicating if fog is enabled on this scene
   * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/environment_introduction#fog
   * (Default is true)
   */
  set fogEnabled(e) {
    this._fogEnabled !== e && (this._fogEnabled = e, this.markAllMaterialsAsDirty(16));
  }
  get fogEnabled() {
    return this._fogEnabled;
  }
  /**
   * Gets or sets the fog mode to use
   * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/environment_introduction#fog
   * | mode | value |
   * | --- | --- |
   * | FOGMODE_NONE | 0 |
   * | FOGMODE_EXP | 1 |
   * | FOGMODE_EXP2 | 2 |
   * | FOGMODE_LINEAR | 3 |
   */
  set fogMode(e) {
    this._fogMode !== e && (this._fogMode = e, this.markAllMaterialsAsDirty(16));
  }
  get fogMode() {
    return this._fogMode;
  }
  /**
   * Flag indicating that the frame buffer binding is handled by another component
   */
  get prePass() {
    return !!this.prePassRenderer && this.prePassRenderer.defaultRT.enabled;
  }
  /**
   * Gets or sets a boolean indicating if shadows are enabled on this scene
   */
  set shadowsEnabled(e) {
    this._shadowsEnabled !== e && (this._shadowsEnabled = e, this.markAllMaterialsAsDirty(2));
  }
  get shadowsEnabled() {
    return this._shadowsEnabled;
  }
  /**
   * Gets or sets a boolean indicating if lights are enabled on this scene
   */
  set lightsEnabled(e) {
    this._lightsEnabled !== e && (this._lightsEnabled = e, this.markAllMaterialsAsDirty(2));
  }
  get lightsEnabled() {
    return this._lightsEnabled;
  }
  /** All of the active cameras added to this scene. */
  get activeCameras() {
    return this._activeCameras;
  }
  set activeCameras(e) {
    this._unObserveActiveCameras && (this._unObserveActiveCameras(), this._unObserveActiveCameras = null), e && (this._unObserveActiveCameras = p$(e, () => {
      this.onActiveCamerasChanged.notifyObservers(this);
    })), this._activeCameras = e;
  }
  /** Gets or sets the current active camera */
  get activeCamera() {
    return this._activeCamera;
  }
  set activeCamera(e) {
    e !== this._activeCamera && (this._activeCamera = e, this.onActiveCameraChanged.notifyObservers(this));
  }
  /** The default material used on meshes when no material is affected */
  get defaultMaterial() {
    return this._defaultMaterial || (this._defaultMaterial = sr.DefaultMaterialFactory(this)), this._defaultMaterial;
  }
  /** The default material used on meshes when no material is affected */
  set defaultMaterial(e) {
    this._defaultMaterial = e;
  }
  /**
   * Gets or sets a boolean indicating if textures are enabled on this scene
   */
  set texturesEnabled(e) {
    this._texturesEnabled !== e && (this._texturesEnabled = e, this.markAllMaterialsAsDirty(1));
  }
  get texturesEnabled() {
    return this._texturesEnabled;
  }
  /**
   * Gets or sets a boolean indicating if skeletons are enabled on this scene
   */
  set skeletonsEnabled(e) {
    this._skeletonsEnabled !== e && (this._skeletonsEnabled = e, this.markAllMaterialsAsDirty(8));
  }
  get skeletonsEnabled() {
    return this._skeletonsEnabled;
  }
  /** @internal */
  get collisionCoordinator() {
    return this._collisionCoordinator || (this._collisionCoordinator = sr.CollisionCoordinatorFactory(), this._collisionCoordinator.init(this)), this._collisionCoordinator;
  }
  /**
   * Gets the scene's rendering manager
   */
  get renderingManager() {
    return this._renderingManager;
  }
  /**
   * Gets the list of frustum planes (built from the active camera)
   */
  get frustumPlanes() {
    return this._frustumPlanes;
  }
  /**
   * Registers the transient components if needed.
   */
  _registerTransientComponents() {
    if (this._transientComponents.length > 0) {
      for (const e of this._transientComponents)
        e.register();
      this._transientComponents.length = 0;
    }
  }
  /**
   * @internal
   * Add a component to the scene.
   * Note that the ccomponent could be registered on th next frame if this is called after
   * the register component stage.
   * @param component Defines the component to add to the scene
   */
  _addComponent(e) {
    this._components.push(e), this._transientComponents.push(e);
    const t = e;
    t.addFromContainer && t.serialize && this._serializableComponents.push(t);
  }
  /**
   * @internal
   * Gets a component from the scene.
   * @param name defines the name of the component to retrieve
   * @returns the component or null if not present
   */
  _getComponent(e) {
    for (const t of this._components)
      if (t.name === e)
        return t;
    return null;
  }
  /**
   * Creates a new Scene
   * @param engine defines the engine to use to render this scene
   * @param options defines the scene options
   */
  constructor(e, t) {
    super(), this._inputManager = new Xf(this), this.cameraToUseForPointers = null, this._isScene = !0, this._blockEntityCollection = !1, this.autoClear = !0, this.autoClearDepthAndStencil = !0, this.clearColor = new xt(0.2, 0.2, 0.3, 1), this.ambientColor = new Ne(0, 0, 0), this.environmentIntensity = 1, this._performancePriority = $H.BackwardCompatible, this.onScenePerformancePriorityChangedObservable = new Oe(), this._forceWireframe = !1, this._skipFrustumClipping = !1, this._forcePointsCloud = !1, this.animationsEnabled = !0, this._animationPropertiesOverride = null, this.useConstantAnimationDeltaTime = !1, this.constantlyUpdateMeshUnderPointer = !1, this.hoverCursor = "pointer", this.defaultCursor = "", this.doNotHandleCursors = !1, this.preventDefaultOnPointerDown = !0, this.preventDefaultOnPointerUp = !0, this.metadata = null, this.reservedDataStore = null, this.disableOfflineSupportExceptionRules = [], this.onDisposeObservable = new Oe(), this._onDisposeObserver = null, this.onBeforeRenderObservable = new Oe(), this._onBeforeRenderObserver = null, this.onAfterRenderObservable = new Oe(), this.onAfterRenderCameraObservable = new Oe(), this._onAfterRenderObserver = null, this.onBeforeAnimationsObservable = new Oe(), this.onAfterAnimationsObservable = new Oe(), this.onBeforeDrawPhaseObservable = new Oe(), this.onAfterDrawPhaseObservable = new Oe(), this.onReadyObservable = new Oe(), this.onBeforeCameraRenderObservable = new Oe(), this._onBeforeCameraRenderObserver = null, this.onAfterCameraRenderObservable = new Oe(), this._onAfterCameraRenderObserver = null, this.onBeforeActiveMeshesEvaluationObservable = new Oe(), this.onAfterActiveMeshesEvaluationObservable = new Oe(), this.onBeforeParticlesRenderingObservable = new Oe(), this.onAfterParticlesRenderingObservable = new Oe(), this.onDataLoadedObservable = new Oe(), this.onNewCameraAddedObservable = new Oe(), this.onCameraRemovedObservable = new Oe(), this.onNewLightAddedObservable = new Oe(), this.onLightRemovedObservable = new Oe(), this.onNewGeometryAddedObservable = new Oe(), this.onGeometryRemovedObservable = new Oe(), this.onNewTransformNodeAddedObservable = new Oe(), this.onTransformNodeRemovedObservable = new Oe(), this.onNewMeshAddedObservable = new Oe(), this.onMeshRemovedObservable = new Oe(), this.onNewSkeletonAddedObservable = new Oe(), this.onSkeletonRemovedObservable = new Oe(), this.onNewMaterialAddedObservable = new Oe(), this.onNewMultiMaterialAddedObservable = new Oe(), this.onMaterialRemovedObservable = new Oe(), this.onMultiMaterialRemovedObservable = new Oe(), this.onNewTextureAddedObservable = new Oe(), this.onTextureRemovedObservable = new Oe(), this.onBeforeRenderTargetsRenderObservable = new Oe(), this.onAfterRenderTargetsRenderObservable = new Oe(), this.onBeforeStepObservable = new Oe(), this.onAfterStepObservable = new Oe(), this.onActiveCameraChanged = new Oe(), this.onActiveCamerasChanged = new Oe(), this.onBeforeRenderingGroupObservable = new Oe(), this.onAfterRenderingGroupObservable = new Oe(), this.onMeshImportedObservable = new Oe(), this.onAnimationFileImportedObservable = new Oe(), this._registeredForLateAnimationBindings = new K8(256), this._pointerPickingConfiguration = new e6e(), this.onPrePointerObservable = new Oe(), this.onPointerObservable = new Oe(), this.onPreKeyboardObservable = new Oe(), this.onKeyboardObservable = new Oe(), this._useRightHandedSystem = !1, this._timeAccumulator = 0, this._currentStepId = 0, this._currentInternalStep = 0, this._fogEnabled = !0, this._fogMode = sr.FOGMODE_NONE, this.fogColor = new Ne(0.2, 0.2, 0.3), this.fogDensity = 0.1, this.fogStart = 0, this.fogEnd = 1e3, this.needsPreviousWorldMatrices = !1, this._shadowsEnabled = !0, this._lightsEnabled = !0, this._unObserveActiveCameras = null, this._texturesEnabled = !0, this.physicsEnabled = !0, this.particlesEnabled = !0, this.spritesEnabled = !0, this._skeletonsEnabled = !0, this.lensFlaresEnabled = !0, this.collisionsEnabled = !0, this.gravity = new S(0, -9.807, 0), this.postProcessesEnabled = !0, this.renderTargetsEnabled = !0, this.dumpNextRenderTargets = !1, this.customRenderTargets = [], this.importedMeshesFiles = [], this.probesEnabled = !0, this._meshesForIntersections = new K8(256), this.proceduralTexturesEnabled = !0, this._totalVertices = new v9(), this._activeIndices = new v9(), this._activeParticles = new v9(), this._activeBones = new v9(), this._animationTime = 0, this.animationTimeScale = 1, this._renderId = 0, this._frameId = 0, this._executeWhenReadyTimeoutId = null, this._intermediateRendering = !1, this._defaultFrameBufferCleared = !1, this._viewUpdateFlag = -1, this._projectionUpdateFlag = -1, this._toBeDisposed = new Array(256), this._activeRequests = new Array(), this._pendingData = new Array(), this._isDisposed = !1, this.dispatchAllSubMeshesOfActiveMeshes = !1, this._activeMeshes = new qf(256), this._processedMaterials = new qf(256), this._renderTargets = new K8(256), this._materialsRenderTargets = new K8(256), this._activeParticleSystems = new qf(256), this._activeSkeletons = new K8(32), this._softwareSkinnedMeshes = new K8(32), this._activeAnimatables = new Array(), this._transformMatrix = he.Zero(), this.requireLightSorting = !1, this._components = [], this._serializableComponents = [], this._transientComponents = [], this._beforeCameraUpdateStage = Y1.Create(), this._beforeClearStage = Y1.Create(), this._beforeRenderTargetClearStage = Y1.Create(), this._gatherRenderTargetsStage = Y1.Create(), this._gatherActiveCameraRenderTargetsStage = Y1.Create(), this._isReadyForMeshStage = Y1.Create(), this._beforeEvaluateActiveMeshStage = Y1.Create(), this._evaluateSubMeshStage = Y1.Create(), this._preActiveMeshStage = Y1.Create(), this._cameraDrawRenderTargetStage = Y1.Create(), this._beforeCameraDrawStage = Y1.Create(), this._beforeRenderTargetDrawStage = Y1.Create(), this._beforeRenderingGroupDrawStage = Y1.Create(), this._beforeRenderingMeshStage = Y1.Create(), this._afterRenderingMeshStage = Y1.Create(), this._afterRenderingGroupDrawStage = Y1.Create(), this._afterCameraDrawStage = Y1.Create(), this._afterCameraPostProcessStage = Y1.Create(), this._afterRenderTargetDrawStage = Y1.Create(), this._afterRenderTargetPostProcessStage = Y1.Create(), this._afterRenderStage = Y1.Create(), this._pointerMoveStage = Y1.Create(), this._pointerDownStage = Y1.Create(), this._pointerUpStage = Y1.Create(), this._geometriesByUniqueId = null, this._defaultMeshCandidates = {
      data: [],
      length: 0
    }, this._defaultSubMeshCandidates = {
      data: [],
      length: 0
    }, this._preventFreeActiveMeshesAndRenderingGroups = !1, this._activeMeshesFrozen = !1, this._activeMeshesFrozenButKeepClipping = !1, this._skipEvaluateActiveMeshesCompletely = !1, this._allowPostProcessClearColor = !0, this.getDeterministicFrameTime = () => this._engine.getTimeStep(), this._registeredActions = 0, this._blockMaterialDirtyMechanism = !1, this._perfCollector = null, this.activeCameras = [];
    const r = Object.assign({ useGeometryUniqueIdsMap: !0, useMaterialMeshMap: !0, useClonedMeshMap: !0, virtual: !1 }, t);
    e = this._engine = e || gr.LastCreatedEngine, r.virtual ? e._virtualScenes.push(this) : (gr._LastCreatedScene = this, e.scenes.push(this)), this._uid = null, this._renderingManager = new $6(this), yI && (this.postProcessManager = new yI(this)), u9() && this.attachControl(), this._createUbo(), Ui && (this._imageProcessingConfiguration = new Ui()), this.setDefaultCandidateProviders(), r.useGeometryUniqueIdsMap && (this._geometriesByUniqueId = {}), this.useMaterialMeshMap = r.useMaterialMeshMap, this.useClonedMeshMap = r.useClonedMeshMap, (!t || !t.virtual) && e.onNewSceneAddedObservable.notifyObservers(this);
  }
  /**
   * Gets a string identifying the name of the class
   * @returns "Scene" string
   */
  getClassName() {
    return "Scene";
  }
  /**
   * @internal
   */
  _getDefaultMeshCandidates() {
    return this._defaultMeshCandidates.data = this.meshes, this._defaultMeshCandidates.length = this.meshes.length, this._defaultMeshCandidates;
  }
  /**
   * @internal
   */
  _getDefaultSubMeshCandidates(e) {
    return this._defaultSubMeshCandidates.data = e.subMeshes, this._defaultSubMeshCandidates.length = e.subMeshes.length, this._defaultSubMeshCandidates;
  }
  /**
   * Sets the default candidate providers for the scene.
   * This sets the getActiveMeshCandidates, getActiveSubMeshCandidates, getIntersectingSubMeshCandidates
   * and getCollidingSubMeshCandidates to their default function
   */
  setDefaultCandidateProviders() {
    this.getActiveMeshCandidates = () => this._getDefaultMeshCandidates(), this.getActiveSubMeshCandidates = (e) => this._getDefaultSubMeshCandidates(e), this.getIntersectingSubMeshCandidates = (e, t) => this._getDefaultSubMeshCandidates(e), this.getCollidingSubMeshCandidates = (e, t) => this._getDefaultSubMeshCandidates(e);
  }
  /**
   * Gets the mesh that is currently under the pointer
   */
  get meshUnderPointer() {
    return this._inputManager.meshUnderPointer;
  }
  /**
   * Gets or sets the current on-screen X position of the pointer
   */
  get pointerX() {
    return this._inputManager.pointerX;
  }
  set pointerX(e) {
    this._inputManager.pointerX = e;
  }
  /**
   * Gets or sets the current on-screen Y position of the pointer
   */
  get pointerY() {
    return this._inputManager.pointerY;
  }
  set pointerY(e) {
    this._inputManager.pointerY = e;
  }
  /**
   * Gets the cached material (ie. the latest rendered one)
   * @returns the cached material
   */
  getCachedMaterial() {
    return this._cachedMaterial;
  }
  /**
   * Gets the cached effect (ie. the latest rendered one)
   * @returns the cached effect
   */
  getCachedEffect() {
    return this._cachedEffect;
  }
  /**
   * Gets the cached visibility state (ie. the latest rendered one)
   * @returns the cached visibility state
   */
  getCachedVisibility() {
    return this._cachedVisibility;
  }
  /**
   * Gets a boolean indicating if the current material / effect / visibility must be bind again
   * @param material defines the current material
   * @param effect defines the current effect
   * @param visibility defines the current visibility state
   * @returns true if one parameter is not cached
   */
  isCachedMaterialInvalid(e, t, r = 1) {
    return this._cachedEffect !== t || this._cachedMaterial !== e || this._cachedVisibility !== r;
  }
  /**
   * Gets the engine associated with the scene
   * @returns an Engine
   */
  getEngine() {
    return this._engine;
  }
  /**
   * Gets the total number of vertices rendered per frame
   * @returns the total number of vertices rendered per frame
   */
  getTotalVertices() {
    return this._totalVertices.current;
  }
  /**
   * Gets the performance counter for total vertices
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
   */
  get totalVerticesPerfCounter() {
    return this._totalVertices;
  }
  /**
   * Gets the total number of active indices rendered per frame (You can deduce the number of rendered triangles by dividing this number by 3)
   * @returns the total number of active indices rendered per frame
   */
  getActiveIndices() {
    return this._activeIndices.current;
  }
  /**
   * Gets the performance counter for active indices
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
   */
  get totalActiveIndicesPerfCounter() {
    return this._activeIndices;
  }
  /**
   * Gets the total number of active particles rendered per frame
   * @returns the total number of active particles rendered per frame
   */
  getActiveParticles() {
    return this._activeParticles.current;
  }
  /**
   * Gets the performance counter for active particles
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
   */
  get activeParticlesPerfCounter() {
    return this._activeParticles;
  }
  /**
   * Gets the total number of active bones rendered per frame
   * @returns the total number of active bones rendered per frame
   */
  getActiveBones() {
    return this._activeBones.current;
  }
  /**
   * Gets the performance counter for active bones
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
   */
  get activeBonesPerfCounter() {
    return this._activeBones;
  }
  /**
   * Gets the array of active meshes
   * @returns an array of AbstractMesh
   */
  getActiveMeshes() {
    return this._activeMeshes;
  }
  /**
   * Gets the animation ratio (which is 1.0 is the scene renders at 60fps and 2 if the scene renders at 30fps, etc.)
   * @returns a number
   */
  getAnimationRatio() {
    return this._animationRatio !== void 0 ? this._animationRatio : 1;
  }
  /**
   * Gets an unique Id for the current render phase
   * @returns a number
   */
  getRenderId() {
    return this._renderId;
  }
  /**
   * Gets an unique Id for the current frame
   * @returns a number
   */
  getFrameId() {
    return this._frameId;
  }
  /** Call this function if you want to manually increment the render Id*/
  incrementRenderId() {
    this._renderId++;
  }
  _createUbo() {
    this.setSceneUniformBuffer(this.createSceneUniformBuffer());
  }
  /**
   * Use this method to simulate a pointer move on a mesh
   * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
   * @param pickResult pickingInfo of the object wished to simulate pointer event on
   * @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
   * @returns the current scene
   */
  simulatePointerMove(e, t) {
    return this._inputManager.simulatePointerMove(e, t), this;
  }
  /**
   * Use this method to simulate a pointer down on a mesh
   * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
   * @param pickResult pickingInfo of the object wished to simulate pointer event on
   * @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
   * @returns the current scene
   */
  simulatePointerDown(e, t) {
    return this._inputManager.simulatePointerDown(e, t), this;
  }
  /**
   * Use this method to simulate a pointer up on a mesh
   * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
   * @param pickResult pickingInfo of the object wished to simulate pointer event on
   * @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
   * @param doubleTap indicates that the pointer up event should be considered as part of a double click (false by default)
   * @returns the current scene
   */
  simulatePointerUp(e, t, r) {
    return this._inputManager.simulatePointerUp(e, t, r), this;
  }
  /**
   * Gets a boolean indicating if the current pointer event is captured (meaning that the scene has already handled the pointer down)
   * @param pointerId defines the pointer id to use in a multi-touch scenario (0 by default)
   * @returns true if the pointer was captured
   */
  isPointerCaptured(e = 0) {
    return this._inputManager.isPointerCaptured(e);
  }
  /**
   * Attach events to the canvas (To handle actionManagers triggers and raise onPointerMove, onPointerDown and onPointerUp
   * @param attachUp defines if you want to attach events to pointerup
   * @param attachDown defines if you want to attach events to pointerdown
   * @param attachMove defines if you want to attach events to pointermove
   */
  attachControl(e = !0, t = !0, r = !0) {
    this._inputManager.attachControl(e, t, r);
  }
  /** Detaches all event handlers*/
  detachControl() {
    this._inputManager.detachControl();
  }
  /**
   * This function will check if the scene can be rendered (textures are loaded, shaders are compiled)
   * Delay loaded resources are not taking in account
   * @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: true)
   * @returns true if all required resources are ready
   */
  isReady(e = !0) {
    var t, r, n;
    if (this._isDisposed)
      return !1;
    let i;
    const s = this.getEngine(), a = s.currentRenderPassId;
    s.currentRenderPassId = (r = (t = this.activeCamera) === null || t === void 0 ? void 0 : t.renderPassId) !== null && r !== void 0 ? r : a;
    let f = !0;
    for (this._pendingData.length > 0 && (f = !1), (n = this.prePassRenderer) === null || n === void 0 || n.update(), this.useOrderIndependentTransparency && this.depthPeelingRenderer && f && (f = this.depthPeelingRenderer.isReady()), e && (this._processedMaterials.reset(), this._materialsRenderTargets.reset()), i = 0; i < this.meshes.length; i++) {
      const o = this.meshes[i];
      if (!o.subMeshes || o.subMeshes.length === 0)
        continue;
      if (!o.isReady(!0)) {
        f = !1;
        continue;
      }
      const d = o.hasThinInstances || o.getClassName() === "InstancedMesh" || o.getClassName() === "InstancedLinesMesh" || s.getCaps().instancedArrays && o.instances.length > 0;
      for (const u of this._isReadyForMeshStage)
        u.action(o, d) || (f = !1);
      if (!e)
        continue;
      const v = o.material || this.defaultMaterial;
      if (v)
        if (v._storeEffectOnSubMeshes)
          for (const u of o.subMeshes) {
            const l = u.getMaterial();
            l && l.hasRenderTargetTextures && l.getRenderTargetTextures != null && this._processedMaterials.indexOf(l) === -1 && (this._processedMaterials.push(l), this._materialsRenderTargets.concatWithNoDuplicate(l.getRenderTargetTextures()));
          }
        else
          v.hasRenderTargetTextures && v.getRenderTargetTextures != null && this._processedMaterials.indexOf(v) === -1 && (this._processedMaterials.push(v), this._materialsRenderTargets.concatWithNoDuplicate(v.getRenderTargetTextures()));
    }
    if (e)
      for (i = 0; i < this._materialsRenderTargets.length; ++i)
        this._materialsRenderTargets.data[i].isReadyForRendering() || (f = !1);
    for (i = 0; i < this.geometries.length; i++)
      this.geometries[i].delayLoadState === 2 && (f = !1);
    if (this.activeCameras && this.activeCameras.length > 0)
      for (const o of this.activeCameras)
        o.isReady(!0) || (f = !1);
    else
      this.activeCamera && (this.activeCamera.isReady(!0) || (f = !1));
    for (const o of this.particleSystems)
      o.isReady() || (f = !1);
    if (this.layers)
      for (const o of this.layers)
        o.isReady() || (f = !1);
    return s.areAllEffectsReady() || (f = !1), s.currentRenderPassId = a, f;
  }
  /** Resets all cached information relative to material (including effect and visibility) */
  resetCachedMaterial() {
    this._cachedMaterial = null, this._cachedEffect = null, this._cachedVisibility = null;
  }
  /**
   * Registers a function to be called before every frame render
   * @param func defines the function to register
   */
  registerBeforeRender(e) {
    this.onBeforeRenderObservable.add(e);
  }
  /**
   * Unregisters a function called before every frame render
   * @param func defines the function to unregister
   */
  unregisterBeforeRender(e) {
    this.onBeforeRenderObservable.removeCallback(e);
  }
  /**
   * Registers a function to be called after every frame render
   * @param func defines the function to register
   */
  registerAfterRender(e) {
    this.onAfterRenderObservable.add(e);
  }
  /**
   * Unregisters a function called after every frame render
   * @param func defines the function to unregister
   */
  unregisterAfterRender(e) {
    this.onAfterRenderObservable.removeCallback(e);
  }
  _executeOnceBeforeRender(e) {
    const t = () => {
      e(), setTimeout(() => {
        this.unregisterBeforeRender(t);
      });
    };
    this.registerBeforeRender(t);
  }
  /**
   * The provided function will run before render once and will be disposed afterwards.
   * A timeout delay can be provided so that the function will be executed in N ms.
   * The timeout is using the browser's native setTimeout so time percision cannot be guaranteed.
   * @param func The function to be executed.
   * @param timeout optional delay in ms
   */
  executeOnceBeforeRender(e, t) {
    t !== void 0 ? setTimeout(() => {
      this._executeOnceBeforeRender(e);
    }, t) : this._executeOnceBeforeRender(e);
  }
  /**
   * This function can help adding any object to the list of data awaited to be ready in order to check for a complete scene loading.
   * @param data defines the object to wait for
   */
  addPendingData(e) {
    this._pendingData.push(e);
  }
  /**
   * Remove a pending data from the loading list which has previously been added with addPendingData.
   * @param data defines the object to remove from the pending list
   */
  removePendingData(e) {
    const t = this.isLoading, r = this._pendingData.indexOf(e);
    r !== -1 && this._pendingData.splice(r, 1), t && !this.isLoading && this.onDataLoadedObservable.notifyObservers(this);
  }
  /**
   * Returns the number of items waiting to be loaded
   * @returns the number of items waiting to be loaded
   */
  getWaitingItemsCount() {
    return this._pendingData.length;
  }
  /**
   * Returns a boolean indicating if the scene is still loading data
   */
  get isLoading() {
    return this._pendingData.length > 0;
  }
  /**
   * Registers a function to be executed when the scene is ready
   * @param func - the function to be executed
   * @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: false)
   */
  executeWhenReady(e, t = !1) {
    this.onReadyObservable.addOnce(e), this._executeWhenReadyTimeoutId === null && this._checkIsReady(t);
  }
  /**
   * Returns a promise that resolves when the scene is ready
   * @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: false)
   * @returns A promise that resolves when the scene is ready
   */
  whenReadyAsync(e = !1) {
    return new Promise((t) => {
      this.executeWhenReady(() => {
        t();
      }, e);
    });
  }
  /**
   * @internal
   */
  _checkIsReady(e = !1) {
    if (this._registerTransientComponents(), this.isReady(e)) {
      this.onReadyObservable.notifyObservers(this), this.onReadyObservable.clear(), this._executeWhenReadyTimeoutId = null;
      return;
    }
    if (this._isDisposed) {
      this.onReadyObservable.clear(), this._executeWhenReadyTimeoutId = null;
      return;
    }
    this._executeWhenReadyTimeoutId = setTimeout(() => {
      this.incrementRenderId(), this._checkIsReady(e);
    }, 100);
  }
  /**
   * Gets all animatable attached to the scene
   */
  get animatables() {
    return this._activeAnimatables;
  }
  /**
   * Resets the last animation time frame.
   * Useful to override when animations start running when loading a scene for the first time.
   */
  resetLastAnimationTimeFrame() {
    this._animationTimeLast = Yi.Now;
  }
  // Matrix
  /**
   * Gets the current view matrix
   * @returns a Matrix
   */
  getViewMatrix() {
    return this._viewMatrix;
  }
  /**
   * Gets the current projection matrix
   * @returns a Matrix
   */
  getProjectionMatrix() {
    return this._projectionMatrix;
  }
  /**
   * Gets the current transform matrix
   * @returns a Matrix made of View * Projection
   */
  getTransformMatrix() {
    return this._transformMatrix;
  }
  /**
   * Sets the current transform matrix
   * @param viewL defines the View matrix to use
   * @param projectionL defines the Projection matrix to use
   * @param viewR defines the right View matrix to use (if provided)
   * @param projectionR defines the right Projection matrix to use (if provided)
   */
  setTransformMatrix(e, t, r, n) {
    !r && !n && this._multiviewSceneUbo && (this._multiviewSceneUbo.dispose(), this._multiviewSceneUbo = null), !(this._viewUpdateFlag === e.updateFlag && this._projectionUpdateFlag === t.updateFlag) && (this._viewUpdateFlag = e.updateFlag, this._projectionUpdateFlag = t.updateFlag, this._viewMatrix = e, this._projectionMatrix = t, this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._frustumPlanes ? Xc.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = Xc.GetPlanes(this._transformMatrix), this._multiviewSceneUbo && this._multiviewSceneUbo.useUbo ? this._updateMultiviewUbo(r, n) : this._sceneUbo.useUbo && (this._sceneUbo.updateMatrix("viewProjection", this._transformMatrix), this._sceneUbo.updateMatrix("view", this._viewMatrix), this._sceneUbo.updateMatrix("projection", this._projectionMatrix)));
  }
  /**
   * Gets the uniform buffer used to store scene data
   * @returns a UniformBuffer
   */
  getSceneUniformBuffer() {
    return this._multiviewSceneUbo ? this._multiviewSceneUbo : this._sceneUbo;
  }
  /**
   * Creates a scene UBO
   * @param name name of the uniform buffer (optional, for debugging purpose only)
   * @returns a new ubo
   */
  createSceneUniformBuffer(e) {
    const t = new yr(this._engine, void 0, !1, e ?? "scene");
    return t.addUniform("viewProjection", 16), t.addUniform("view", 16), t.addUniform("projection", 16), t.addUniform("vEyePosition", 4), t;
  }
  /**
   * Sets the scene ubo
   * @param ubo the ubo to set for the scene
   */
  setSceneUniformBuffer(e) {
    this._sceneUbo = e, this._viewUpdateFlag = -1, this._projectionUpdateFlag = -1;
  }
  /**
   * Gets an unique (relatively to the current scene) Id
   * @returns an unique number for the scene
   */
  getUniqueId() {
    return bR.UniqueId;
  }
  /**
   * Add a mesh to the list of scene's meshes
   * @param newMesh defines the mesh to add
   * @param recursive if all child meshes should also be added to the scene
   */
  addMesh(e, t = !1) {
    this._blockEntityCollection || (this.meshes.push(e), e._resyncLightSources(), e.parent || e._addToSceneRootNodes(), this.onNewMeshAddedObservable.notifyObservers(e), t && e.getChildMeshes().forEach((r) => {
      this.addMesh(r);
    }));
  }
  /**
   * Remove a mesh for the list of scene's meshes
   * @param toRemove defines the mesh to remove
   * @param recursive if all child meshes should also be removed from the scene
   * @returns the index where the mesh was in the mesh list
   */
  removeMesh(e, t = !1) {
    const r = this.meshes.indexOf(e);
    return r !== -1 && (this.meshes[r] = this.meshes[this.meshes.length - 1], this.meshes.pop(), e.parent || e._removeFromSceneRootNodes()), this._inputManager._invalidateMesh(e), this.onMeshRemovedObservable.notifyObservers(e), t && e.getChildMeshes().forEach((n) => {
      this.removeMesh(n);
    }), r;
  }
  /**
   * Add a transform node to the list of scene's transform nodes
   * @param newTransformNode defines the transform node to add
   */
  addTransformNode(e) {
    this._blockEntityCollection || e.getScene() === this && e._indexInSceneTransformNodesArray !== -1 || (e._indexInSceneTransformNodesArray = this.transformNodes.length, this.transformNodes.push(e), e.parent || e._addToSceneRootNodes(), this.onNewTransformNodeAddedObservable.notifyObservers(e));
  }
  /**
   * Remove a transform node for the list of scene's transform nodes
   * @param toRemove defines the transform node to remove
   * @returns the index where the transform node was in the transform node list
   */
  removeTransformNode(e) {
    const t = e._indexInSceneTransformNodesArray;
    if (t !== -1) {
      if (t !== this.transformNodes.length - 1) {
        const r = this.transformNodes[this.transformNodes.length - 1];
        this.transformNodes[t] = r, r._indexInSceneTransformNodesArray = t;
      }
      e._indexInSceneTransformNodesArray = -1, this.transformNodes.pop(), e.parent || e._removeFromSceneRootNodes();
    }
    return this.onTransformNodeRemovedObservable.notifyObservers(e), t;
  }
  /**
   * Remove a skeleton for the list of scene's skeletons
   * @param toRemove defines the skeleton to remove
   * @returns the index where the skeleton was in the skeleton list
   */
  removeSkeleton(e) {
    const t = this.skeletons.indexOf(e);
    return t !== -1 && (this.skeletons.splice(t, 1), this.onSkeletonRemovedObservable.notifyObservers(e), this._executeActiveContainerCleanup(this._activeSkeletons)), t;
  }
  /**
   * Remove a morph target for the list of scene's morph targets
   * @param toRemove defines the morph target to remove
   * @returns the index where the morph target was in the morph target list
   */
  removeMorphTargetManager(e) {
    const t = this.morphTargetManagers.indexOf(e);
    return t !== -1 && this.morphTargetManagers.splice(t, 1), t;
  }
  /**
   * Remove a light for the list of scene's lights
   * @param toRemove defines the light to remove
   * @returns the index where the light was in the light list
   */
  removeLight(e) {
    const t = this.lights.indexOf(e);
    if (t !== -1) {
      for (const r of this.meshes)
        r._removeLightSource(e, !1);
      this.lights.splice(t, 1), this.sortLightsByPriority(), e.parent || e._removeFromSceneRootNodes();
    }
    return this.onLightRemovedObservable.notifyObservers(e), t;
  }
  /**
   * Remove a camera for the list of scene's cameras
   * @param toRemove defines the camera to remove
   * @returns the index where the camera was in the camera list
   */
  removeCamera(e) {
    const t = this.cameras.indexOf(e);
    if (t !== -1 && (this.cameras.splice(t, 1), e.parent || e._removeFromSceneRootNodes()), this.activeCameras) {
      const r = this.activeCameras.indexOf(e);
      r !== -1 && this.activeCameras.splice(r, 1);
    }
    return this.activeCamera === e && (this.cameras.length > 0 ? this.activeCamera = this.cameras[0] : this.activeCamera = null), this.onCameraRemovedObservable.notifyObservers(e), t;
  }
  /**
   * Remove a particle system for the list of scene's particle systems
   * @param toRemove defines the particle system to remove
   * @returns the index where the particle system was in the particle system list
   */
  removeParticleSystem(e) {
    const t = this.particleSystems.indexOf(e);
    return t !== -1 && (this.particleSystems.splice(t, 1), this._executeActiveContainerCleanup(this._activeParticleSystems)), t;
  }
  /**
   * Remove a animation for the list of scene's animations
   * @param toRemove defines the animation to remove
   * @returns the index where the animation was in the animation list
   */
  removeAnimation(e) {
    const t = this.animations.indexOf(e);
    return t !== -1 && this.animations.splice(t, 1), t;
  }
  /**
   * Will stop the animation of the given target
   * @param target - the target
   * @param animationName - the name of the animation to stop (all animations will be stopped if both this and targetMask are empty)
   * @param targetMask - a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)
   */
  stopAnimation(e, t, r) {
  }
  /**
   * Removes the given animation group from this scene.
   * @param toRemove The animation group to remove
   * @returns The index of the removed animation group
   */
  removeAnimationGroup(e) {
    const t = this.animationGroups.indexOf(e);
    return t !== -1 && this.animationGroups.splice(t, 1), t;
  }
  /**
   * Removes the given multi-material from this scene.
   * @param toRemove The multi-material to remove
   * @returns The index of the removed multi-material
   */
  removeMultiMaterial(e) {
    const t = this.multiMaterials.indexOf(e);
    return t !== -1 && this.multiMaterials.splice(t, 1), this.onMultiMaterialRemovedObservable.notifyObservers(e), t;
  }
  /**
   * Removes the given material from this scene.
   * @param toRemove The material to remove
   * @returns The index of the removed material
   */
  removeMaterial(e) {
    const t = e._indexInSceneMaterialArray;
    if (t !== -1 && t < this.materials.length) {
      if (t !== this.materials.length - 1) {
        const r = this.materials[this.materials.length - 1];
        this.materials[t] = r, r._indexInSceneMaterialArray = t;
      }
      e._indexInSceneMaterialArray = -1, this.materials.pop();
    }
    return this.onMaterialRemovedObservable.notifyObservers(e), t;
  }
  /**
   * Removes the given action manager from this scene.
   * @deprecated
   * @param toRemove The action manager to remove
   * @returns The index of the removed action manager
   */
  removeActionManager(e) {
    const t = this.actionManagers.indexOf(e);
    return t !== -1 && this.actionManagers.splice(t, 1), t;
  }
  /**
   * Removes the given texture from this scene.
   * @param toRemove The texture to remove
   * @returns The index of the removed texture
   */
  removeTexture(e) {
    const t = this.textures.indexOf(e);
    return t !== -1 && this.textures.splice(t, 1), this.onTextureRemovedObservable.notifyObservers(e), t;
  }
  /**
   * Adds the given light to this scene
   * @param newLight The light to add
   */
  addLight(e) {
    if (!this._blockEntityCollection) {
      this.lights.push(e), this.sortLightsByPriority(), e.parent || e._addToSceneRootNodes();
      for (const t of this.meshes)
        t.lightSources.indexOf(e) === -1 && (t.lightSources.push(e), t._resyncLightSources());
      this.onNewLightAddedObservable.notifyObservers(e);
    }
  }
  /**
   * Sorts the list list based on light priorities
   */
  sortLightsByPriority() {
    this.requireLightSorting && this.lights.sort(ra.CompareLightsPriority);
  }
  /**
   * Adds the given camera to this scene
   * @param newCamera The camera to add
   */
  addCamera(e) {
    this._blockEntityCollection || (this.cameras.push(e), this.onNewCameraAddedObservable.notifyObservers(e), e.parent || e._addToSceneRootNodes());
  }
  /**
   * Adds the given skeleton to this scene
   * @param newSkeleton The skeleton to add
   */
  addSkeleton(e) {
    this._blockEntityCollection || (this.skeletons.push(e), this.onNewSkeletonAddedObservable.notifyObservers(e));
  }
  /**
   * Adds the given particle system to this scene
   * @param newParticleSystem The particle system to add
   */
  addParticleSystem(e) {
    this._blockEntityCollection || this.particleSystems.push(e);
  }
  /**
   * Adds the given animation to this scene
   * @param newAnimation The animation to add
   */
  addAnimation(e) {
    this._blockEntityCollection || this.animations.push(e);
  }
  /**
   * Adds the given animation group to this scene.
   * @param newAnimationGroup The animation group to add
   */
  addAnimationGroup(e) {
    this._blockEntityCollection || this.animationGroups.push(e);
  }
  /**
   * Adds the given multi-material to this scene
   * @param newMultiMaterial The multi-material to add
   */
  addMultiMaterial(e) {
    this._blockEntityCollection || (this.multiMaterials.push(e), this.onNewMultiMaterialAddedObservable.notifyObservers(e));
  }
  /**
   * Adds the given material to this scene
   * @param newMaterial The material to add
   */
  addMaterial(e) {
    this._blockEntityCollection || e.getScene() === this && e._indexInSceneMaterialArray !== -1 || (e._indexInSceneMaterialArray = this.materials.length, this.materials.push(e), this.onNewMaterialAddedObservable.notifyObservers(e));
  }
  /**
   * Adds the given morph target to this scene
   * @param newMorphTargetManager The morph target to add
   */
  addMorphTargetManager(e) {
    this._blockEntityCollection || this.morphTargetManagers.push(e);
  }
  /**
   * Adds the given geometry to this scene
   * @param newGeometry The geometry to add
   */
  addGeometry(e) {
    this._blockEntityCollection || (this._geometriesByUniqueId && (this._geometriesByUniqueId[e.uniqueId] = this.geometries.length), this.geometries.push(e));
  }
  /**
   * Adds the given action manager to this scene
   * @deprecated
   * @param newActionManager The action manager to add
   */
  addActionManager(e) {
    this.actionManagers.push(e);
  }
  /**
   * Adds the given texture to this scene.
   * @param newTexture The texture to add
   */
  addTexture(e) {
    this._blockEntityCollection || (this.textures.push(e), this.onNewTextureAddedObservable.notifyObservers(e));
  }
  /**
   * Switch active camera
   * @param newCamera defines the new active camera
   * @param attachControl defines if attachControl must be called for the new active camera (default: true)
   */
  switchActiveCamera(e, t = !0) {
    this._engine.getInputElement() && (this.activeCamera && this.activeCamera.detachControl(), this.activeCamera = e, t && e.attachControl());
  }
  /**
   * sets the active camera of the scene using its Id
   * @param id defines the camera's Id
   * @returns the new active camera or null if none found.
   */
  setActiveCameraById(e) {
    const t = this.getCameraById(e);
    return t ? (this.activeCamera = t, t) : null;
  }
  /**
   * sets the active camera of the scene using its name
   * @param name defines the camera's name
   * @returns the new active camera or null if none found.
   */
  setActiveCameraByName(e) {
    const t = this.getCameraByName(e);
    return t ? (this.activeCamera = t, t) : null;
  }
  /**
   * get an animation group using its name
   * @param name defines the material's name
   * @returns the animation group or null if none found.
   */
  getAnimationGroupByName(e) {
    for (let t = 0; t < this.animationGroups.length; t++)
      if (this.animationGroups[t].name === e)
        return this.animationGroups[t];
    return null;
  }
  _getMaterial(e, t) {
    for (let r = 0; r < this.materials.length; r++) {
      const n = this.materials[r];
      if (t(n))
        return n;
    }
    if (e)
      for (let r = 0; r < this.multiMaterials.length; r++) {
        const n = this.multiMaterials[r];
        if (t(n))
          return n;
      }
    return null;
  }
  /**
   * Get a material using its unique id
   * @param uniqueId defines the material's unique id
   * @param allowMultiMaterials determines whether multimaterials should be considered
   * @returns the material or null if none found.
   */
  getMaterialByUniqueID(e, t = !1) {
    return this._getMaterial(t, (r) => r.uniqueId === e);
  }
  /**
   * get a material using its id
   * @param id defines the material's Id
   * @param allowMultiMaterials determines whether multimaterials should be considered
   * @returns the material or null if none found.
   */
  getMaterialById(e, t = !1) {
    return this._getMaterial(t, (r) => r.id === e);
  }
  /**
   * Gets a material using its name
   * @param name defines the material's name
   * @param allowMultiMaterials determines whether multimaterials should be considered
   * @returns the material or null if none found.
   */
  getMaterialByName(e, t = !1) {
    return this._getMaterial(t, (r) => r.name === e);
  }
  /**
   * Gets a last added material using a given id
   * @param id defines the material's id
   * @param allowMultiMaterials determines whether multimaterials should be considered
   * @returns the last material with the given id or null if none found.
   */
  getLastMaterialById(e, t = !1) {
    for (let r = this.materials.length - 1; r >= 0; r--)
      if (this.materials[r].id === e)
        return this.materials[r];
    if (t) {
      for (let r = this.multiMaterials.length - 1; r >= 0; r--)
        if (this.multiMaterials[r].id === e)
          return this.multiMaterials[r];
    }
    return null;
  }
  /**
   * Get a texture using its unique id
   * @param uniqueId defines the texture's unique id
   * @returns the texture or null if none found.
   */
  getTextureByUniqueId(e) {
    for (let t = 0; t < this.textures.length; t++)
      if (this.textures[t].uniqueId === e)
        return this.textures[t];
    return null;
  }
  /**
   * Gets a texture using its name
   * @param name defines the texture's name
   * @returns the texture or null if none found.
   */
  getTextureByName(e) {
    for (let t = 0; t < this.textures.length; t++)
      if (this.textures[t].name === e)
        return this.textures[t];
    return null;
  }
  /**
   * Gets a camera using its Id
   * @param id defines the Id to look for
   * @returns the camera or null if not found
   */
  getCameraById(e) {
    for (let t = 0; t < this.cameras.length; t++)
      if (this.cameras[t].id === e)
        return this.cameras[t];
    return null;
  }
  /**
   * Gets a camera using its unique Id
   * @param uniqueId defines the unique Id to look for
   * @returns the camera or null if not found
   */
  getCameraByUniqueId(e) {
    for (let t = 0; t < this.cameras.length; t++)
      if (this.cameras[t].uniqueId === e)
        return this.cameras[t];
    return null;
  }
  /**
   * Gets a camera using its name
   * @param name defines the camera's name
   * @returns the camera or null if none found.
   */
  getCameraByName(e) {
    for (let t = 0; t < this.cameras.length; t++)
      if (this.cameras[t].name === e)
        return this.cameras[t];
    return null;
  }
  /**
   * Gets a bone using its Id
   * @param id defines the bone's Id
   * @returns the bone or null if not found
   */
  getBoneById(e) {
    for (let t = 0; t < this.skeletons.length; t++) {
      const r = this.skeletons[t];
      for (let n = 0; n < r.bones.length; n++)
        if (r.bones[n].id === e)
          return r.bones[n];
    }
    return null;
  }
  /**
   * Gets a bone using its id
   * @param name defines the bone's name
   * @returns the bone or null if not found
   */
  getBoneByName(e) {
    for (let t = 0; t < this.skeletons.length; t++) {
      const r = this.skeletons[t];
      for (let n = 0; n < r.bones.length; n++)
        if (r.bones[n].name === e)
          return r.bones[n];
    }
    return null;
  }
  /**
   * Gets a light node using its name
   * @param name defines the light's name
   * @returns the light or null if none found.
   */
  getLightByName(e) {
    for (let t = 0; t < this.lights.length; t++)
      if (this.lights[t].name === e)
        return this.lights[t];
    return null;
  }
  /**
   * Gets a light node using its Id
   * @param id defines the light's Id
   * @returns the light or null if none found.
   */
  getLightById(e) {
    for (let t = 0; t < this.lights.length; t++)
      if (this.lights[t].id === e)
        return this.lights[t];
    return null;
  }
  /**
   * Gets a light node using its scene-generated unique Id
   * @param uniqueId defines the light's unique Id
   * @returns the light or null if none found.
   */
  getLightByUniqueId(e) {
    for (let t = 0; t < this.lights.length; t++)
      if (this.lights[t].uniqueId === e)
        return this.lights[t];
    return null;
  }
  /**
   * Gets a particle system by Id
   * @param id defines the particle system Id
   * @returns the corresponding system or null if none found
   */
  getParticleSystemById(e) {
    for (let t = 0; t < this.particleSystems.length; t++)
      if (this.particleSystems[t].id === e)
        return this.particleSystems[t];
    return null;
  }
  /**
   * Gets a geometry using its Id
   * @param id defines the geometry's Id
   * @returns the geometry or null if none found.
   */
  getGeometryById(e) {
    for (let t = 0; t < this.geometries.length; t++)
      if (this.geometries[t].id === e)
        return this.geometries[t];
    return null;
  }
  _getGeometryByUniqueId(e) {
    if (this._geometriesByUniqueId) {
      const t = this._geometriesByUniqueId[e];
      if (t !== void 0)
        return this.geometries[t];
    } else
      for (let t = 0; t < this.geometries.length; t++)
        if (this.geometries[t].uniqueId === e)
          return this.geometries[t];
    return null;
  }
  /**
   * Add a new geometry to this scene
   * @param geometry defines the geometry to be added to the scene.
   * @param force defines if the geometry must be pushed even if a geometry with this id already exists
   * @returns a boolean defining if the geometry was added or not
   */
  pushGeometry(e, t) {
    return !t && this._getGeometryByUniqueId(e.uniqueId) ? !1 : (this.addGeometry(e), this.onNewGeometryAddedObservable.notifyObservers(e), !0);
  }
  /**
   * Removes an existing geometry
   * @param geometry defines the geometry to be removed from the scene
   * @returns a boolean defining if the geometry was removed or not
   */
  removeGeometry(e) {
    let t;
    if (this._geometriesByUniqueId) {
      if (t = this._geometriesByUniqueId[e.uniqueId], t === void 0)
        return !1;
    } else if (t = this.geometries.indexOf(e), t < 0)
      return !1;
    if (t !== this.geometries.length - 1) {
      const r = this.geometries[this.geometries.length - 1];
      r && (this.geometries[t] = r, this._geometriesByUniqueId && (this._geometriesByUniqueId[r.uniqueId] = t));
    }
    return this._geometriesByUniqueId && (this._geometriesByUniqueId[e.uniqueId] = void 0), this.geometries.pop(), this.onGeometryRemovedObservable.notifyObservers(e), !0;
  }
  /**
   * Gets the list of geometries attached to the scene
   * @returns an array of Geometry
   */
  getGeometries() {
    return this.geometries;
  }
  /**
   * Gets the first added mesh found of a given Id
   * @param id defines the Id to search for
   * @returns the mesh found or null if not found at all
   */
  getMeshById(e) {
    for (let t = 0; t < this.meshes.length; t++)
      if (this.meshes[t].id === e)
        return this.meshes[t];
    return null;
  }
  /**
   * Gets a list of meshes using their Id
   * @param id defines the Id to search for
   * @returns a list of meshes
   */
  getMeshesById(e) {
    return this.meshes.filter(function(t) {
      return t.id === e;
    });
  }
  /**
   * Gets the first added transform node found of a given Id
   * @param id defines the Id to search for
   * @returns the found transform node or null if not found at all.
   */
  getTransformNodeById(e) {
    for (let t = 0; t < this.transformNodes.length; t++)
      if (this.transformNodes[t].id === e)
        return this.transformNodes[t];
    return null;
  }
  /**
   * Gets a transform node with its auto-generated unique Id
   * @param uniqueId defines the unique Id to search for
   * @returns the found transform node or null if not found at all.
   */
  getTransformNodeByUniqueId(e) {
    for (let t = 0; t < this.transformNodes.length; t++)
      if (this.transformNodes[t].uniqueId === e)
        return this.transformNodes[t];
    return null;
  }
  /**
   * Gets a list of transform nodes using their Id
   * @param id defines the Id to search for
   * @returns a list of transform nodes
   */
  getTransformNodesById(e) {
    return this.transformNodes.filter(function(t) {
      return t.id === e;
    });
  }
  /**
   * Gets a mesh with its auto-generated unique Id
   * @param uniqueId defines the unique Id to search for
   * @returns the found mesh or null if not found at all.
   */
  getMeshByUniqueId(e) {
    for (let t = 0; t < this.meshes.length; t++)
      if (this.meshes[t].uniqueId === e)
        return this.meshes[t];
    return null;
  }
  /**
   * Gets a the last added mesh using a given Id
   * @param id defines the Id to search for
   * @returns the found mesh or null if not found at all.
   */
  getLastMeshById(e) {
    for (let t = this.meshes.length - 1; t >= 0; t--)
      if (this.meshes[t].id === e)
        return this.meshes[t];
    return null;
  }
  /**
   * Gets a the last transform node using a given Id
   * @param id defines the Id to search for
   * @returns the found mesh or null if not found at all.
   */
  getLastTransformNodeById(e) {
    for (let t = this.transformNodes.length - 1; t >= 0; t--)
      if (this.transformNodes[t].id === e)
        return this.transformNodes[t];
    return null;
  }
  /**
   * Gets a the last added node (Mesh, Camera, Light) using a given Id
   * @param id defines the Id to search for
   * @returns the found node or null if not found at all
   */
  getLastEntryById(e) {
    let t;
    for (t = this.meshes.length - 1; t >= 0; t--)
      if (this.meshes[t].id === e)
        return this.meshes[t];
    for (t = this.transformNodes.length - 1; t >= 0; t--)
      if (this.transformNodes[t].id === e)
        return this.transformNodes[t];
    for (t = this.cameras.length - 1; t >= 0; t--)
      if (this.cameras[t].id === e)
        return this.cameras[t];
    for (t = this.lights.length - 1; t >= 0; t--)
      if (this.lights[t].id === e)
        return this.lights[t];
    return null;
  }
  /**
   * Gets a node (Mesh, Camera, Light) using a given Id
   * @param id defines the Id to search for
   * @returns the found node or null if not found at all
   */
  getNodeById(e) {
    const t = this.getMeshById(e);
    if (t)
      return t;
    const r = this.getTransformNodeById(e);
    if (r)
      return r;
    const n = this.getLightById(e);
    if (n)
      return n;
    const i = this.getCameraById(e);
    if (i)
      return i;
    const s = this.getBoneById(e);
    return s || null;
  }
  /**
   * Gets a node (Mesh, Camera, Light) using a given name
   * @param name defines the name to search for
   * @returns the found node or null if not found at all.
   */
  getNodeByName(e) {
    const t = this.getMeshByName(e);
    if (t)
      return t;
    const r = this.getTransformNodeByName(e);
    if (r)
      return r;
    const n = this.getLightByName(e);
    if (n)
      return n;
    const i = this.getCameraByName(e);
    if (i)
      return i;
    const s = this.getBoneByName(e);
    return s || null;
  }
  /**
   * Gets a mesh using a given name
   * @param name defines the name to search for
   * @returns the found mesh or null if not found at all.
   */
  getMeshByName(e) {
    for (let t = 0; t < this.meshes.length; t++)
      if (this.meshes[t].name === e)
        return this.meshes[t];
    return null;
  }
  /**
   * Gets a transform node using a given name
   * @param name defines the name to search for
   * @returns the found transform node or null if not found at all.
   */
  getTransformNodeByName(e) {
    for (let t = 0; t < this.transformNodes.length; t++)
      if (this.transformNodes[t].name === e)
        return this.transformNodes[t];
    return null;
  }
  /**
   * Gets a skeleton using a given Id (if many are found, this function will pick the last one)
   * @param id defines the Id to search for
   * @returns the found skeleton or null if not found at all.
   */
  getLastSkeletonById(e) {
    for (let t = this.skeletons.length - 1; t >= 0; t--)
      if (this.skeletons[t].id === e)
        return this.skeletons[t];
    return null;
  }
  /**
   * Gets a skeleton using a given auto generated unique id
   * @param  uniqueId defines the unique id to search for
   * @returns the found skeleton or null if not found at all.
   */
  getSkeletonByUniqueId(e) {
    for (let t = 0; t < this.skeletons.length; t++)
      if (this.skeletons[t].uniqueId === e)
        return this.skeletons[t];
    return null;
  }
  /**
   * Gets a skeleton using a given id (if many are found, this function will pick the first one)
   * @param id defines the id to search for
   * @returns the found skeleton or null if not found at all.
   */
  getSkeletonById(e) {
    for (let t = 0; t < this.skeletons.length; t++)
      if (this.skeletons[t].id === e)
        return this.skeletons[t];
    return null;
  }
  /**
   * Gets a skeleton using a given name
   * @param name defines the name to search for
   * @returns the found skeleton or null if not found at all.
   */
  getSkeletonByName(e) {
    for (let t = 0; t < this.skeletons.length; t++)
      if (this.skeletons[t].name === e)
        return this.skeletons[t];
    return null;
  }
  /**
   * Gets a morph target manager  using a given id (if many are found, this function will pick the last one)
   * @param id defines the id to search for
   * @returns the found morph target manager or null if not found at all.
   */
  getMorphTargetManagerById(e) {
    for (let t = 0; t < this.morphTargetManagers.length; t++)
      if (this.morphTargetManagers[t].uniqueId === e)
        return this.morphTargetManagers[t];
    return null;
  }
  /**
   * Gets a morph target using a given id (if many are found, this function will pick the first one)
   * @param id defines the id to search for
   * @returns the found morph target or null if not found at all.
   */
  getMorphTargetById(e) {
    for (let t = 0; t < this.morphTargetManagers.length; ++t) {
      const r = this.morphTargetManagers[t];
      for (let n = 0; n < r.numTargets; ++n) {
        const i = r.getTarget(n);
        if (i.id === e)
          return i;
      }
    }
    return null;
  }
  /**
   * Gets a morph target using a given name (if many are found, this function will pick the first one)
   * @param name defines the name to search for
   * @returns the found morph target or null if not found at all.
   */
  getMorphTargetByName(e) {
    for (let t = 0; t < this.morphTargetManagers.length; ++t) {
      const r = this.morphTargetManagers[t];
      for (let n = 0; n < r.numTargets; ++n) {
        const i = r.getTarget(n);
        if (i.name === e)
          return i;
      }
    }
    return null;
  }
  /**
   * Gets a post process using a given name (if many are found, this function will pick the first one)
   * @param name defines the name to search for
   * @returns the found post process or null if not found at all.
   */
  getPostProcessByName(e) {
    for (let t = 0; t < this.postProcesses.length; ++t) {
      const r = this.postProcesses[t];
      if (r.name === e)
        return r;
    }
    return null;
  }
  /**
   * Gets a boolean indicating if the given mesh is active
   * @param mesh defines the mesh to look for
   * @returns true if the mesh is in the active list
   */
  isActiveMesh(e) {
    return this._activeMeshes.indexOf(e) !== -1;
  }
  /**
   * Return a unique id as a string which can serve as an identifier for the scene
   */
  get uid() {
    return this._uid || (this._uid = ye.RandomId()), this._uid;
  }
  /**
   * Add an externally attached data from its key.
   * This method call will fail and return false, if such key already exists.
   * If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method.
   * @param key the unique key that identifies the data
   * @param data the data object to associate to the key for this Engine instance
   * @returns true if no such key were already present and the data was added successfully, false otherwise
   */
  addExternalData(e, t) {
    return this._externalData || (this._externalData = new YC()), this._externalData.add(e, t);
  }
  /**
   * Get an externally attached data from its key
   * @param key the unique key that identifies the data
   * @returns the associated data, if present (can be null), or undefined if not present
   */
  getExternalData(e) {
    return this._externalData ? this._externalData.get(e) : null;
  }
  /**
   * Get an externally attached data from its key, create it using a factory if it's not already present
   * @param key the unique key that identifies the data
   * @param factory the factory that will be called to create the instance if and only if it doesn't exists
   * @returns the associated data, can be null if the factory returned null.
   */
  getOrAddExternalDataWithFactory(e, t) {
    return this._externalData || (this._externalData = new YC()), this._externalData.getOrAddWithFactory(e, t);
  }
  /**
   * Remove an externally attached data from the Engine instance
   * @param key the unique key that identifies the data
   * @returns true if the data was successfully removed, false if it doesn't exist
   */
  removeExternalData(e) {
    return this._externalData.remove(e);
  }
  _evaluateSubMesh(e, t, r, n) {
    if (n || e.isInFrustum(this._frustumPlanes)) {
      for (const s of this._evaluateSubMeshStage)
        s.action(t, e);
      const i = e.getMaterial();
      i != null && (i.hasRenderTargetTextures && i.getRenderTargetTextures != null && this._processedMaterials.indexOf(i) === -1 && (this._processedMaterials.push(i), this._materialsRenderTargets.concatWithNoDuplicate(i.getRenderTargetTextures())), this._renderingManager.dispatch(e, t, i));
    }
  }
  /**
   * Clear the processed materials smart array preventing retention point in material dispose.
   */
  freeProcessedMaterials() {
    this._processedMaterials.dispose();
  }
  /** Gets or sets a boolean blocking all the calls to freeActiveMeshes and freeRenderingGroups
   * It can be used in order to prevent going through methods freeRenderingGroups and freeActiveMeshes several times to improve performance
   * when disposing several meshes in a row or a hierarchy of meshes.
   * When used, it is the responsibility of the user to blockfreeActiveMeshesAndRenderingGroups back to false.
   */
  get blockfreeActiveMeshesAndRenderingGroups() {
    return this._preventFreeActiveMeshesAndRenderingGroups;
  }
  set blockfreeActiveMeshesAndRenderingGroups(e) {
    this._preventFreeActiveMeshesAndRenderingGroups !== e && (e && (this.freeActiveMeshes(), this.freeRenderingGroups()), this._preventFreeActiveMeshesAndRenderingGroups = e);
  }
  /**
   * Clear the active meshes smart array preventing retention point in mesh dispose.
   */
  freeActiveMeshes() {
    if (!this.blockfreeActiveMeshesAndRenderingGroups && (this._activeMeshes.dispose(), this.activeCamera && this.activeCamera._activeMeshes && this.activeCamera._activeMeshes.dispose(), this.activeCameras))
      for (let e = 0; e < this.activeCameras.length; e++) {
        const t = this.activeCameras[e];
        t && t._activeMeshes && t._activeMeshes.dispose();
      }
  }
  /**
   * Clear the info related to rendering groups preventing retention points during dispose.
   */
  freeRenderingGroups() {
    if (!this.blockfreeActiveMeshesAndRenderingGroups && (this._renderingManager && this._renderingManager.freeRenderingGroups(), this.textures))
      for (let e = 0; e < this.textures.length; e++) {
        const t = this.textures[e];
        t && t.renderList && t.freeRenderingGroups();
      }
  }
  /** @internal */
  _isInIntermediateRendering() {
    return this._intermediateRendering;
  }
  /**
   * Use this function to stop evaluating active meshes. The current list will be keep alive between frames
   * @param skipEvaluateActiveMeshes defines an optional boolean indicating that the evaluate active meshes step must be completely skipped
   * @param onSuccess optional success callback
   * @param onError optional error callback
   * @param freezeMeshes defines if meshes should be frozen (true by default)
   * @param keepFrustumCulling defines if you want to keep running the frustum clipping (false by default)
   * @returns the current scene
   */
  freezeActiveMeshes(e = !1, t, r, n = !0, i = !1) {
    return this.executeWhenReady(() => {
      if (!this.activeCamera) {
        r && r("No active camera found");
        return;
      }
      if (this._frustumPlanes || this.updateTransformMatrix(), this._evaluateActiveMeshes(), this._activeMeshesFrozen = !0, this._activeMeshesFrozenButKeepClipping = i, this._skipEvaluateActiveMeshesCompletely = e, n)
        for (let s = 0; s < this._activeMeshes.length; s++)
          this._activeMeshes.data[s]._freeze();
      t && t();
    }), this;
  }
  /**
   * Use this function to restart evaluating active meshes on every frame
   * @returns the current scene
   */
  unfreezeActiveMeshes() {
    for (let e = 0; e < this.meshes.length; e++) {
      const t = this.meshes[e];
      t._internalAbstractMeshDataInfo && (t._internalAbstractMeshDataInfo._isActive = !1);
    }
    for (let e = 0; e < this._activeMeshes.length; e++)
      this._activeMeshes.data[e]._unFreeze();
    return this._activeMeshesFrozen = !1, this;
  }
  _executeActiveContainerCleanup(e) {
    !(this._engine.snapshotRendering && this._engine.snapshotRenderingMode === 1) && this._activeMeshesFrozen && this._activeMeshes.length || this.onBeforeRenderObservable.addOnce(() => e.dispose());
  }
  _evaluateActiveMeshes() {
    var e;
    if (this._engine.snapshotRendering && this._engine.snapshotRenderingMode === 1) {
      this._activeMeshes.length > 0 && ((e = this.activeCamera) === null || e === void 0 || e._activeMeshes.reset(), this._activeMeshes.reset(), this._renderingManager.reset(), this._processedMaterials.reset(), this._activeParticleSystems.reset(), this._activeSkeletons.reset(), this._softwareSkinnedMeshes.reset());
      return;
    }
    if (this._activeMeshesFrozen && this._activeMeshes.length) {
      if (!this._skipEvaluateActiveMeshesCompletely) {
        const n = this._activeMeshes.length;
        for (let i = 0; i < n; i++)
          this._activeMeshes.data[i].computeWorldMatrix();
      }
      if (this._activeParticleSystems) {
        const n = this._activeParticleSystems.length;
        for (let i = 0; i < n; i++)
          this._activeParticleSystems.data[i].animate();
      }
      this._renderingManager.resetSprites();
      return;
    }
    if (!this.activeCamera)
      return;
    this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this), this.activeCamera._activeMeshes.reset(), this._activeMeshes.reset(), this._renderingManager.reset(), this._processedMaterials.reset(), this._activeParticleSystems.reset(), this._activeSkeletons.reset(), this._softwareSkinnedMeshes.reset(), this._materialsRenderTargets.reset();
    for (const n of this._beforeEvaluateActiveMeshStage)
      n.action();
    const t = this.getActiveMeshCandidates(), r = t.length;
    for (let n = 0; n < r; n++) {
      const i = t.data[n];
      if (i._internalAbstractMeshDataInfo._currentLODIsUpToDate = !1, i.isBlocked || (this._totalVertices.addCount(i.getTotalVertices(), !1), !i.isReady() || !i.isEnabled() || i.scaling.hasAZeroComponent))
        continue;
      i.computeWorldMatrix(), i.actionManager && i.actionManager.hasSpecificTriggers2(12, 13) && this._meshesForIntersections.pushNoDuplicate(i);
      let s = this.customLODSelector ? this.customLODSelector(i, this.activeCamera) : i.getLOD(this.activeCamera);
      if (i._internalAbstractMeshDataInfo._currentLOD = s, i._internalAbstractMeshDataInfo._currentLODIsUpToDate = !0, s != null && (s !== i && s.billboardMode !== 0 && s.computeWorldMatrix(), i._preActivate(), i.isVisible && i.visibility > 0 && i.layerMask & this.activeCamera.layerMask && (this._skipFrustumClipping || i.alwaysSelectAsActiveMesh || i.isInFrustum(this._frustumPlanes)))) {
        this._activeMeshes.push(i), this.activeCamera._activeMeshes.push(i), s !== i && s._activate(this._renderId, !1);
        for (const a of this._preActiveMeshStage)
          a.action(i);
        i._activate(this._renderId, !1) && (i.isAnInstance ? i._internalAbstractMeshDataInfo._actAsRegularMesh && (s = i) : s._internalAbstractMeshDataInfo._onlyForInstances = !1, s._internalAbstractMeshDataInfo._isActive = !0, this._activeMesh(i, s)), i._postActivate();
      }
    }
    if (this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this), this.particlesEnabled) {
      this.onBeforeParticlesRenderingObservable.notifyObservers(this);
      for (let n = 0; n < this.particleSystems.length; n++) {
        const i = this.particleSystems[n];
        if (!i.isStarted() || !i.emitter)
          continue;
        const s = i.emitter;
        (!s.position || s.isEnabled()) && (this._activeParticleSystems.push(i), i.animate(), this._renderingManager.dispatchParticles(i));
      }
      this.onAfterParticlesRenderingObservable.notifyObservers(this);
    }
  }
  _activeMesh(e, t) {
    this._skeletonsEnabled && t.skeleton !== null && t.skeleton !== void 0 && (this._activeSkeletons.pushNoDuplicate(t.skeleton) && (t.skeleton.prepare(), this._activeBones.addCount(t.skeleton.bones.length, !1)), t.computeBonesUsingShaders || this._softwareSkinnedMeshes.pushNoDuplicate(t));
    let r = e.hasInstances || e.isAnInstance || this.dispatchAllSubMeshesOfActiveMeshes || this._skipFrustumClipping || t.alwaysSelectAsActiveMesh;
    if (t && t.subMeshes && t.subMeshes.length > 0) {
      const n = this.getActiveSubMeshCandidates(t), i = n.length;
      r = r || i === 1;
      for (let s = 0; s < i; s++) {
        const a = n.data[s];
        this._evaluateSubMesh(a, t, e, r);
      }
    }
  }
  /**
   * Update the transform matrix to update from the current active camera
   * @param force defines a boolean used to force the update even if cache is up to date
   */
  updateTransformMatrix(e) {
    const t = this.activeCamera;
    if (t)
      if (t._renderingMultiview) {
        const r = t._rigCameras[0], n = t._rigCameras[1];
        this.setTransformMatrix(r.getViewMatrix(), r.getProjectionMatrix(e), n.getViewMatrix(), n.getProjectionMatrix(e));
      } else
        this.setTransformMatrix(t.getViewMatrix(), t.getProjectionMatrix(e));
  }
  _bindFrameBuffer(e, t = !0) {
    e && e._multiviewTexture ? e._multiviewTexture._bindFrameBuffer() : e && e.outputRenderTarget ? e.outputRenderTarget._bindFrameBuffer() : this._engine._currentFrameBufferIsDefaultFrameBuffer() || this._engine.restoreDefaultFramebuffer(), t && this._clearFrameBuffer(e);
  }
  _clearFrameBuffer(e) {
    if (!(e && e._multiviewTexture))
      if (e && e.outputRenderTarget && !e._renderingMultiview) {
        const t = e.outputRenderTarget;
        t.onClearObservable.hasObservers() ? t.onClearObservable.notifyObservers(this._engine) : t.skipInitialClear || (this.autoClear && this._engine.clear(t.clearColor || this.clearColor, !t._cleared, !0, !0), t._cleared = !0);
      } else
        this._defaultFrameBufferCleared ? this._engine.clear(null, !1, !0, !0) : (this._defaultFrameBufferCleared = !0, this._clear());
  }
  /**
   * @internal
   */
  _renderForCamera(e, t, r = !0) {
    var n, i, s;
    if (e && e._skipRendering)
      return;
    const a = this._engine;
    if (this._activeCamera = e, !this.activeCamera)
      throw new Error("Active camera not set");
    if (a.setViewport(this.activeCamera.viewport), this.resetCachedMaterial(), this._renderId++, !this.prePass && r) {
      let o = !0;
      e._renderingMultiview && e.outputRenderTarget && (o = e.outputRenderTarget.skipInitialClear, this.autoClear && (this._defaultFrameBufferCleared = !1, e.outputRenderTarget.skipInitialClear = !1)), this._bindFrameBuffer(this._activeCamera), e._renderingMultiview && e.outputRenderTarget && (e.outputRenderTarget.skipInitialClear = o);
    }
    this.updateTransformMatrix(), this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera), this._evaluateActiveMeshes();
    for (let o = 0; o < this._softwareSkinnedMeshes.length; o++) {
      const d = this._softwareSkinnedMeshes.data[o];
      d.applySkeleton(d.skeleton);
    }
    this.onBeforeRenderTargetsRenderObservable.notifyObservers(this), this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets), e.customRenderTargets && e.customRenderTargets.length > 0 && this._renderTargets.concatWithNoDuplicate(e.customRenderTargets), t && t.customRenderTargets && t.customRenderTargets.length > 0 && this._renderTargets.concatWithNoDuplicate(t.customRenderTargets), this.environmentTexture && this.environmentTexture.isRenderTarget && this._renderTargets.pushNoDuplicate(this.environmentTexture);
    for (const o of this._gatherActiveCameraRenderTargetsStage)
      o.action(this._renderTargets);
    let f = !1;
    if (this.renderTargetsEnabled) {
      if (this._intermediateRendering = !0, this._renderTargets.length > 0) {
        ye.StartPerformanceCounter("Render targets", this._renderTargets.length > 0);
        for (let o = 0; o < this._renderTargets.length; o++) {
          const d = this._renderTargets.data[o];
          if (d._shouldRender()) {
            this._renderId++;
            const v = d.activeCamera && d.activeCamera !== this.activeCamera;
            d.render(v, this.dumpNextRenderTargets), f = !0;
          }
        }
        ye.EndPerformanceCounter("Render targets", this._renderTargets.length > 0), this._renderId++;
      }
      for (const o of this._cameraDrawRenderTargetStage)
        f = o.action(this.activeCamera) || f;
      this._intermediateRendering = !1;
    }
    this._engine.currentRenderPassId = (s = (i = (n = e.outputRenderTarget) === null || n === void 0 ? void 0 : n.renderPassId) !== null && i !== void 0 ? i : e.renderPassId) !== null && s !== void 0 ? s : 0, f && !this.prePass && this._bindFrameBuffer(this._activeCamera, !1), this.onAfterRenderTargetsRenderObservable.notifyObservers(this), this.postProcessManager && !e._multiviewTexture && !this.prePass && this.postProcessManager._prepareFrame();
    for (const o of this._beforeCameraDrawStage)
      o.action(this.activeCamera);
    this.onBeforeDrawPhaseObservable.notifyObservers(this), a.snapshotRendering && a.snapshotRenderingMode === 1 && this.finalizeSceneUbo(), this._renderingManager.render(null, null, !0, !0), this.onAfterDrawPhaseObservable.notifyObservers(this);
    for (const o of this._afterCameraDrawStage)
      o.action(this.activeCamera);
    if (this.postProcessManager && !e._multiviewTexture) {
      const o = e.outputRenderTarget ? e.outputRenderTarget.renderTarget : void 0;
      this.postProcessManager._finalizeFrame(e.isIntermediate, o);
    }
    for (const o of this._afterCameraPostProcessStage)
      o.action(this.activeCamera);
    this._renderTargets.reset(), this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera);
  }
  _processSubCameras(e, t = !0) {
    if (e.cameraRigMode === 0 || e._renderingMultiview) {
      e._renderingMultiview && !this._multiviewSceneUbo && this._createMultiviewUbo(), this._renderForCamera(e, void 0, t), this.onAfterRenderCameraObservable.notifyObservers(e);
      return;
    }
    if (e._useMultiviewToSingleView)
      this._renderMultiviewToSingleView(e);
    else {
      this.onBeforeCameraRenderObservable.notifyObservers(e);
      for (let r = 0; r < e._rigCameras.length; r++)
        this._renderForCamera(e._rigCameras[r], e);
    }
    this._activeCamera = e, this.updateTransformMatrix(), this.onAfterRenderCameraObservable.notifyObservers(e);
  }
  _checkIntersections() {
    for (let e = 0; e < this._meshesForIntersections.length; e++) {
      const t = this._meshesForIntersections.data[e];
      if (t.actionManager)
        for (let r = 0; t.actionManager && r < t.actionManager.actions.length; r++) {
          const n = t.actionManager.actions[r];
          if (n.trigger === 12 || n.trigger === 13) {
            const i = n.getTriggerParameter(), s = i.mesh ? i.mesh : i, a = s.intersectsMesh(t, i.usePreciseIntersection), f = t._intersectionsInProgress.indexOf(s);
            a && f === -1 ? n.trigger === 12 ? (n._executeCurrent(mo.CreateNew(t, void 0, s)), t._intersectionsInProgress.push(s)) : n.trigger === 13 && t._intersectionsInProgress.push(s) : !a && f > -1 && (n.trigger === 13 && n._executeCurrent(mo.CreateNew(t, void 0, s)), (!t.actionManager.hasSpecificTrigger(13, (o) => {
              const d = o.mesh ? o.mesh : o;
              return s === d;
            }) || n.trigger === 13) && t._intersectionsInProgress.splice(f, 1));
          }
        }
    }
  }
  /**
   * @internal
   */
  _advancePhysicsEngineStep(e) {
  }
  /** @internal */
  _animate() {
  }
  /** Execute all animations (for a frame) */
  animate() {
    if (this._engine.isDeterministicLockStep()) {
      let e = Math.max(sr.MinDeltaTime, Math.min(this._engine.getDeltaTime(), sr.MaxDeltaTime)) + this._timeAccumulator;
      const t = this._engine.getTimeStep(), r = 1e3 / t / 1e3;
      let n = 0;
      const i = this._engine.getLockstepMaxSteps();
      let s = Math.floor(e / t);
      for (s = Math.min(s, i); e > 0 && n < s; )
        this.onBeforeStepObservable.notifyObservers(this), this._animationRatio = t * r, this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this.physicsEnabled && this._advancePhysicsEngineStep(t), this.onAfterStepObservable.notifyObservers(this), this._currentStepId++, n++, e -= t;
      this._timeAccumulator = e < 0 ? 0 : e;
    } else {
      const e = this.useConstantAnimationDeltaTime ? 16 : Math.max(sr.MinDeltaTime, Math.min(this._engine.getDeltaTime(), sr.MaxDeltaTime));
      this._animationRatio = e * (60 / 1e3), this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this.physicsEnabled && this._advancePhysicsEngineStep(e);
    }
  }
  _clear() {
    (this.autoClearDepthAndStencil || this.autoClear) && this._engine.clear(this.clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil);
  }
  _checkCameraRenderTarget(e) {
    var t;
    if (e != null && e.outputRenderTarget && !(e != null && e.isRigCamera) && (e.outputRenderTarget._cleared = !1), !((t = e == null ? void 0 : e.rigCameras) === null || t === void 0) && t.length)
      for (let r = 0; r < e.rigCameras.length; ++r) {
        const n = e.rigCameras[r].outputRenderTarget;
        n && (n._cleared = !1);
      }
  }
  /**
   * Resets the draw wrappers cache of all meshes
   * @param passId If provided, releases only the draw wrapper corresponding to this render pass id
   */
  resetDrawCache(e) {
    if (this.meshes)
      for (const t of this.meshes)
        t.resetDrawCache(e);
  }
  /**
   * Render the scene
   * @param updateCameras defines a boolean indicating if cameras must update according to their inputs (true by default)
   * @param ignoreAnimations defines a boolean indicating if animations should not be executed (false by default)
   */
  render(e = !0, t = !1) {
    var r, n, i;
    if (this.isDisposed)
      return;
    this.onReadyObservable.hasObservers() && this._executeWhenReadyTimeoutId === null && this._checkIsReady(), this._frameId++, this._defaultFrameBufferCleared = !1, this._checkCameraRenderTarget(this.activeCamera), !((r = this.activeCameras) === null || r === void 0) && r.length && this.activeCameras.forEach(this._checkCameraRenderTarget), this._registerTransientComponents(), this._activeParticles.fetchNewFrame(), this._totalVertices.fetchNewFrame(), this._activeIndices.fetchNewFrame(), this._activeBones.fetchNewFrame(), this._meshesForIntersections.reset(), this.resetCachedMaterial(), this.onBeforeAnimationsObservable.notifyObservers(this), this.actionManager && this.actionManager.processTrigger(11), t || this.animate();
    for (const f of this._beforeCameraUpdateStage)
      f.action();
    if (e) {
      if (this.activeCameras && this.activeCameras.length > 0)
        for (let f = 0; f < this.activeCameras.length; f++) {
          const o = this.activeCameras[f];
          if (o.update(), o.cameraRigMode !== 0)
            for (let d = 0; d < o._rigCameras.length; d++)
              o._rigCameras[d].update();
        }
      else if (this.activeCamera && (this.activeCamera.update(), this.activeCamera.cameraRigMode !== 0))
        for (let f = 0; f < this.activeCamera._rigCameras.length; f++)
          this.activeCamera._rigCameras[f].update();
    }
    this.onBeforeRenderObservable.notifyObservers(this);
    const s = this.getEngine();
    this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);
    const a = !((n = this.activeCameras) === null || n === void 0) && n.length ? this.activeCameras[0] : this.activeCamera;
    if (this.renderTargetsEnabled) {
      ye.StartPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0), this._intermediateRendering = !0;
      for (let f = 0; f < this.customRenderTargets.length; f++) {
        const o = this.customRenderTargets[f];
        if (o._shouldRender()) {
          if (this._renderId++, this.activeCamera = o.activeCamera || this.activeCamera, !this.activeCamera)
            throw new Error("Active camera not set");
          s.setViewport(this.activeCamera.viewport), this.updateTransformMatrix(), o.render(a !== this.activeCamera, this.dumpNextRenderTargets);
        }
      }
      ye.EndPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0), this._intermediateRendering = !1, this._renderId++;
    }
    this._engine.currentRenderPassId = (i = a == null ? void 0 : a.renderPassId) !== null && i !== void 0 ? i : 0, this.activeCamera = a, this._activeCamera && this._activeCamera.cameraRigMode !== 22 && !this.prePass && this._bindFrameBuffer(this._activeCamera, !1), this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
    for (const f of this._beforeClearStage)
      f.action();
    this._clearFrameBuffer(this.activeCamera);
    for (const f of this._gatherRenderTargetsStage)
      f.action(this._renderTargets);
    if (this.activeCameras && this.activeCameras.length > 0)
      for (let f = 0; f < this.activeCameras.length; f++)
        this._processSubCameras(this.activeCameras[f], f > 0);
    else {
      if (!this.activeCamera)
        throw new Error("No camera defined");
      this._processSubCameras(this.activeCamera, !!this.activeCamera.outputRenderTarget);
    }
    this._checkIntersections();
    for (const f of this._afterRenderStage)
      f.action();
    if (this.afterRender && this.afterRender(), this.onAfterRenderObservable.notifyObservers(this), this._toBeDisposed.length) {
      for (let f = 0; f < this._toBeDisposed.length; f++) {
        const o = this._toBeDisposed[f];
        o && o.dispose();
      }
      this._toBeDisposed.length = 0;
    }
    this.dumpNextRenderTargets && (this.dumpNextRenderTargets = !1), this._activeBones.addCount(0, !0), this._activeIndices.addCount(0, !0), this._activeParticles.addCount(0, !0), this._engine.restoreDefaultFramebuffer();
  }
  /**
   * Freeze all materials
   * A frozen material will not be updatable but should be faster to render
   * Note: multimaterials will not be frozen, but their submaterials will
   */
  freezeMaterials() {
    for (let e = 0; e < this.materials.length; e++)
      this.materials[e].freeze();
  }
  /**
   * Unfreeze all materials
   * A frozen material will not be updatable but should be faster to render
   */
  unfreezeMaterials() {
    for (let e = 0; e < this.materials.length; e++)
      this.materials[e].unfreeze();
  }
  /**
   * Releases all held resources
   */
  dispose() {
    if (this.isDisposed)
      return;
    this.beforeRender = null, this.afterRender = null, this.metadata = null, this.skeletons.length = 0, this.morphTargetManagers.length = 0, this._transientComponents.length = 0, this._isReadyForMeshStage.clear(), this._beforeEvaluateActiveMeshStage.clear(), this._evaluateSubMeshStage.clear(), this._preActiveMeshStage.clear(), this._cameraDrawRenderTargetStage.clear(), this._beforeCameraDrawStage.clear(), this._beforeRenderTargetDrawStage.clear(), this._beforeRenderingGroupDrawStage.clear(), this._beforeRenderingMeshStage.clear(), this._afterRenderingMeshStage.clear(), this._afterRenderingGroupDrawStage.clear(), this._afterCameraDrawStage.clear(), this._afterRenderTargetDrawStage.clear(), this._afterRenderStage.clear(), this._beforeCameraUpdateStage.clear(), this._beforeClearStage.clear(), this._gatherRenderTargetsStage.clear(), this._gatherActiveCameraRenderTargetsStage.clear(), this._pointerMoveStage.clear(), this._pointerDownStage.clear(), this._pointerUpStage.clear(), this.importedMeshesFiles = [], this.stopAllAnimations && (this._activeAnimatables.forEach((i) => {
      i.onAnimationEndObservable.clear(), i.onAnimationEnd = null;
    }), this.stopAllAnimations()), this.resetCachedMaterial(), this.activeCamera && (this.activeCamera._activeMeshes.dispose(), this.activeCamera = null), this.activeCameras = null, this._activeMeshes.dispose(), this._renderingManager.dispose(), this._processedMaterials.dispose(), this._activeParticleSystems.dispose(), this._activeSkeletons.dispose(), this._softwareSkinnedMeshes.dispose(), this._renderTargets.dispose(), this._materialsRenderTargets.dispose(), this._registeredForLateAnimationBindings.dispose(), this._meshesForIntersections.dispose(), this._toBeDisposed.length = 0;
    const e = this._activeRequests.slice();
    for (const i of e)
      i.abort();
    this._activeRequests.length = 0;
    try {
      this.onDisposeObservable.notifyObservers(this);
    } catch (i) {
      console.error("An error occurred while calling onDisposeObservable!", i);
    }
    if (this.detachControl(), this._engine.getInputElement())
      for (let i = 0; i < this.cameras.length; i++)
        this.cameras[i].detachControl();
    this._disposeList(this.animationGroups), this._disposeList(this.lights), this._disposeList(this.meshes, (i) => i.dispose(!0)), this._disposeList(this.transformNodes, (i) => i.dispose(!0));
    const r = this.cameras;
    this._disposeList(r), this._defaultMaterial && this._defaultMaterial.dispose(), this._disposeList(this.multiMaterials), this._disposeList(this.materials), this._disposeList(this.particleSystems), this._disposeList(this.postProcesses), this._disposeList(this.textures), this._disposeList(this.morphTargetManagers), this._sceneUbo.dispose(), this._multiviewSceneUbo && this._multiviewSceneUbo.dispose(), this.postProcessManager.dispose(), this._disposeList(this._components);
    let n = this._engine.scenes.indexOf(this);
    n > -1 && this._engine.scenes.splice(n, 1), gr._LastCreatedScene === this && (this._engine.scenes.length > 0 ? gr._LastCreatedScene = this._engine.scenes[this._engine.scenes.length - 1] : gr._LastCreatedScene = null), n = this._engine._virtualScenes.indexOf(this), n > -1 && this._engine._virtualScenes.splice(n, 1), this._engine.wipeCaches(!0), this.onDisposeObservable.clear(), this.onBeforeRenderObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderTargetsRenderObservable.clear(), this.onAfterRenderTargetsRenderObservable.clear(), this.onAfterStepObservable.clear(), this.onBeforeStepObservable.clear(), this.onBeforeActiveMeshesEvaluationObservable.clear(), this.onAfterActiveMeshesEvaluationObservable.clear(), this.onBeforeParticlesRenderingObservable.clear(), this.onAfterParticlesRenderingObservable.clear(), this.onBeforeDrawPhaseObservable.clear(), this.onAfterDrawPhaseObservable.clear(), this.onBeforeAnimationsObservable.clear(), this.onAfterAnimationsObservable.clear(), this.onDataLoadedObservable.clear(), this.onBeforeRenderingGroupObservable.clear(), this.onAfterRenderingGroupObservable.clear(), this.onMeshImportedObservable.clear(), this.onBeforeCameraRenderObservable.clear(), this.onAfterCameraRenderObservable.clear(), this.onAfterRenderCameraObservable.clear(), this.onReadyObservable.clear(), this.onNewCameraAddedObservable.clear(), this.onCameraRemovedObservable.clear(), this.onNewLightAddedObservable.clear(), this.onLightRemovedObservable.clear(), this.onNewGeometryAddedObservable.clear(), this.onGeometryRemovedObservable.clear(), this.onNewTransformNodeAddedObservable.clear(), this.onTransformNodeRemovedObservable.clear(), this.onNewMeshAddedObservable.clear(), this.onMeshRemovedObservable.clear(), this.onNewSkeletonAddedObservable.clear(), this.onSkeletonRemovedObservable.clear(), this.onNewMaterialAddedObservable.clear(), this.onNewMultiMaterialAddedObservable.clear(), this.onMaterialRemovedObservable.clear(), this.onMultiMaterialRemovedObservable.clear(), this.onNewTextureAddedObservable.clear(), this.onTextureRemovedObservable.clear(), this.onPrePointerObservable.clear(), this.onPointerObservable.clear(), this.onPreKeyboardObservable.clear(), this.onKeyboardObservable.clear(), this.onActiveCameraChanged.clear(), this.onScenePerformancePriorityChangedObservable.clear(), this._isDisposed = !0;
  }
  _disposeList(e, t) {
    const r = e.slice(0);
    t = t ?? ((n) => n.dispose());
    for (const n of r)
      t(n);
    e.length = 0;
  }
  /**
   * Gets if the scene is already disposed
   */
  get isDisposed() {
    return this._isDisposed;
  }
  /**
   * Call this function to reduce memory footprint of the scene.
   * Vertex buffers will not store CPU data anymore (this will prevent picking, collisions or physics to work correctly)
   */
  clearCachedVertexData() {
    for (let e = 0; e < this.meshes.length; e++) {
      const r = this.meshes[e].geometry;
      r && r.clearCachedData();
    }
  }
  /**
   * This function will remove the local cached buffer data from texture.
   * It will save memory but will prevent the texture from being rebuilt
   */
  cleanCachedTextureBuffer() {
    for (const e of this.textures)
      e._buffer && (e._buffer = null);
  }
  /**
   * Get the world extend vectors with an optional filter
   *
   * @param filterPredicate the predicate - which meshes should be included when calculating the world size
   * @returns {{ min: Vector3; max: Vector3 }} min and max vectors
   */
  getWorldExtends(e) {
    const t = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), r = new S(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
    return e = e || (() => !0), this.meshes.filter(e).forEach((n) => {
      if (n.computeWorldMatrix(!0), !n.subMeshes || n.subMeshes.length === 0 || n.infiniteDistance)
        return;
      const i = n.getBoundingInfo(), s = i.boundingBox.minimumWorld, a = i.boundingBox.maximumWorld;
      S.CheckExtends(s, t, r), S.CheckExtends(a, t, r);
    }), {
      min: t,
      max: r
    };
  }
  // Picking
  /**
   * Creates a ray that can be used to pick in the scene
   * @param x defines the x coordinate of the origin (on-screen)
   * @param y defines the y coordinate of the origin (on-screen)
   * @param world defines the world matrix to use if you want to pick in object space (instead of world space)
   * @param camera defines the camera to use for the picking
   * @param cameraViewSpace defines if picking will be done in view space (false by default)
   * @returns a Ray
   */
  createPickingRay(e, t, r, n, i = !1) {
    throw qn("Ray");
  }
  /**
   * Creates a ray that can be used to pick in the scene
   * @param x defines the x coordinate of the origin (on-screen)
   * @param y defines the y coordinate of the origin (on-screen)
   * @param world defines the world matrix to use if you want to pick in object space (instead of world space)
   * @param result defines the ray where to store the picking ray
   * @param camera defines the camera to use for the picking
   * @param cameraViewSpace defines if picking will be done in view space (false by default)
   * @param enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)
   * @returns the current scene
   */
  createPickingRayToRef(e, t, r, n, i, s = !1, a = !1) {
    throw qn("Ray");
  }
  /**
   * Creates a ray that can be used to pick in the scene
   * @param x defines the x coordinate of the origin (on-screen)
   * @param y defines the y coordinate of the origin (on-screen)
   * @param camera defines the camera to use for the picking
   * @returns a Ray
   */
  createPickingRayInCameraSpace(e, t, r) {
    throw qn("Ray");
  }
  /**
   * Creates a ray that can be used to pick in the scene
   * @param x defines the x coordinate of the origin (on-screen)
   * @param y defines the y coordinate of the origin (on-screen)
   * @param result defines the ray where to store the picking ray
   * @param camera defines the camera to use for the picking
   * @returns the current scene
   */
  createPickingRayInCameraSpaceToRef(e, t, r, n) {
    throw qn("Ray");
  }
  /** @internal */
  get _pickingAvailable() {
    return !1;
  }
  /** Launch a ray to try to pick a mesh in the scene
   * @param x position on screen
   * @param y position on screen
   * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
   * @param fastCheck defines if the first intersection will be used (and not the closest)
   * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
   * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
   * @returns a PickingInfo
   */
  pick(e, t, r, n, i, s) {
    const a = qn("Ray", !0);
    return a && Se.Warn(a), new F9();
  }
  /** Launch a ray to try to pick a mesh in the scene using only bounding information of the main mesh (not using submeshes)
   * @param x position on screen
   * @param y position on screen
   * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
   * @param fastCheck defines if the first intersection will be used (and not the closest)
   * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
   * @returns a PickingInfo (Please note that some info will not be set like distance, bv, bu and everything that cannot be capture by only using bounding infos)
   */
  pickWithBoundingInfo(e, t, r, n, i) {
    const s = qn("Ray", !0);
    return s && Se.Warn(s), new F9();
  }
  /**
   * Use the given ray to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,
   * irrespective of orientation.
   * @param ray The ray to use to pick meshes
   * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must have isPickable set to true
   * @param fastCheck defines if the first intersection will be used (and not the closest)
   * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
   * @returns a PickingInfo
   */
  pickWithRay(e, t, r, n) {
    throw qn("Ray");
  }
  /**
   * Launch a ray to try to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,
   * irrespective of orientation.
   * @param x X position on screen
   * @param y Y position on screen
   * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
   * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
   * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
   * @returns an array of PickingInfo
   */
  multiPick(e, t, r, n, i) {
    throw qn("Ray");
  }
  /**
   * Launch a ray to try to pick a mesh in the scene
   * @param ray Ray to use
   * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
   * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
   * @returns an array of PickingInfo
   */
  multiPickWithRay(e, t, r) {
    throw qn("Ray");
  }
  /**
   * Force the value of meshUnderPointer
   * @param mesh defines the mesh to use
   * @param pointerId optional pointer id when using more than one pointer
   * @param pickResult optional pickingInfo data used to find mesh
   */
  setPointerOverMesh(e, t, r) {
    this._inputManager.setPointerOverMesh(e, t, r);
  }
  /**
   * Gets the mesh under the pointer
   * @returns a Mesh or null if no mesh is under the pointer
   */
  getPointerOverMesh() {
    return this._inputManager.getPointerOverMesh();
  }
  // Misc.
  /** @internal */
  _rebuildGeometries() {
    for (const e of this.geometries)
      e._rebuild();
    for (const e of this.meshes)
      e._rebuild();
    this.postProcessManager && this.postProcessManager._rebuild();
    for (const e of this._components)
      e.rebuild();
    for (const e of this.particleSystems)
      e.rebuild();
    if (this.spriteManagers)
      for (const e of this.spriteManagers)
        e.rebuild();
  }
  /** @internal */
  _rebuildTextures() {
    for (const e of this.textures)
      e._rebuild();
    this.markAllMaterialsAsDirty(1);
  }
  /**
   * Get from a list of objects by tags
   * @param list the list of objects to use
   * @param tagsQuery the query to use
   * @param filter a predicate to filter for tags
   * @returns
   */
  _getByTags(e, t, r) {
    if (t === void 0)
      return e;
    const n = [];
    for (const i in e) {
      const s = e[i];
      Zi && Zi.MatchesQuery(s, t) && (!r || r(s)) && n.push(s);
    }
    return n;
  }
  /**
   * Get a list of meshes by tags
   * @param tagsQuery defines the tags query to use
   * @param filter defines a predicate used to filter results
   * @returns an array of Mesh
   */
  getMeshesByTags(e, t) {
    return this._getByTags(this.meshes, e, t);
  }
  /**
   * Get a list of cameras by tags
   * @param tagsQuery defines the tags query to use
   * @param filter defines a predicate used to filter results
   * @returns an array of Camera
   */
  getCamerasByTags(e, t) {
    return this._getByTags(this.cameras, e, t);
  }
  /**
   * Get a list of lights by tags
   * @param tagsQuery defines the tags query to use
   * @param filter defines a predicate used to filter results
   * @returns an array of Light
   */
  getLightsByTags(e, t) {
    return this._getByTags(this.lights, e, t);
  }
  /**
   * Get a list of materials by tags
   * @param tagsQuery defines the tags query to use
   * @param filter defines a predicate used to filter results
   * @returns an array of Material
   */
  getMaterialByTags(e, t) {
    return this._getByTags(this.materials, e, t).concat(this._getByTags(this.multiMaterials, e, t));
  }
  /**
   * Get a list of transform nodes by tags
   * @param tagsQuery defines the tags query to use
   * @param filter defines a predicate used to filter results
   * @returns an array of TransformNode
   */
  getTransformNodesByTags(e, t) {
    return this._getByTags(this.transformNodes, e, t);
  }
  /**
   * Overrides the default sort function applied in the rendering group to prepare the meshes.
   * This allowed control for front to back rendering or reversly depending of the special needs.
   *
   * @param renderingGroupId The rendering group id corresponding to its index
   * @param opaqueSortCompareFn The opaque queue comparison function use to sort.
   * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.
   * @param transparentSortCompareFn The transparent queue comparison function use to sort.
   */
  setRenderingOrder(e, t = null, r = null, n = null) {
    this._renderingManager.setRenderingOrder(e, t, r, n);
  }
  /**
   * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
   *
   * @param renderingGroupId The rendering group id corresponding to its index
   * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
   * @param depth Automatically clears depth between groups if true and autoClear is true.
   * @param stencil Automatically clears stencil between groups if true and autoClear is true.
   */
  setRenderingAutoClearDepthStencil(e, t, r = !0, n = !0) {
    this._renderingManager.setRenderingAutoClearDepthStencil(e, t, r, n);
  }
  /**
   * Gets the current auto clear configuration for one rendering group of the rendering
   * manager.
   * @param index the rendering group index to get the information for
   * @returns The auto clear setup for the requested rendering group
   */
  getAutoClearDepthStencilSetup(e) {
    return this._renderingManager.getAutoClearDepthStencilSetup(e);
  }
  /** @internal */
  _forceBlockMaterialDirtyMechanism(e) {
    this._blockMaterialDirtyMechanism = e;
  }
  /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
  get blockMaterialDirtyMechanism() {
    return this._blockMaterialDirtyMechanism;
  }
  set blockMaterialDirtyMechanism(e) {
    this._blockMaterialDirtyMechanism !== e && (this._blockMaterialDirtyMechanism = e, e || this.markAllMaterialsAsDirty(63));
  }
  /**
   * Will flag all materials as dirty to trigger new shader compilation
   * @param flag defines the flag used to specify which material part must be marked as dirty
   * @param predicate If not null, it will be used to specify if a material has to be marked as dirty
   */
  markAllMaterialsAsDirty(e, t) {
    if (!this._blockMaterialDirtyMechanism)
      for (const r of this.materials)
        t && !t(r) || r.markAsDirty(e);
  }
  /**
   * @internal
   */
  _loadFile(e, t, r, n, i, s, a) {
    const f = gq(e, t, r, n ? this.offlineProvider : void 0, i, s, a);
    return this._activeRequests.push(f), f.onCompleteObservable.add((o) => {
      this._activeRequests.splice(this._activeRequests.indexOf(o), 1);
    }), f;
  }
  /**
   * @internal
   */
  _loadFileAsync(e, t, r, n, i) {
    return new Promise((s, a) => {
      this._loadFile(e, (f) => {
        s(f);
      }, t, r, n, (f, o) => {
        a(o);
      }, i);
    });
  }
  /**
   * @internal
   */
  _requestFile(e, t, r, n, i, s, a) {
    const f = jO(e, t, r, n ? this.offlineProvider : void 0, i, s, a);
    return this._activeRequests.push(f), f.onCompleteObservable.add((o) => {
      this._activeRequests.splice(this._activeRequests.indexOf(o), 1);
    }), f;
  }
  /**
   * @internal
   */
  _requestFileAsync(e, t, r, n, i) {
    return new Promise((s, a) => {
      this._requestFile(e, (f) => {
        s(f);
      }, t, r, n, (f) => {
        a(f);
      }, i);
    });
  }
  /**
   * @internal
   */
  _readFile(e, t, r, n, i) {
    const s = BS(e, t, r, n, i);
    return this._activeRequests.push(s), s.onCompleteObservable.add((a) => {
      this._activeRequests.splice(this._activeRequests.indexOf(a), 1);
    }), s;
  }
  /**
   * @internal
   */
  _readFileAsync(e, t, r) {
    return new Promise((n, i) => {
      this._readFile(e, (s) => {
        n(s);
      }, t, r, (s) => {
        i(s);
      });
    });
  }
  /**
   * This method gets the performance collector belonging to the scene, which is generally shared with the inspector.
   * @returns the perf collector belonging to the scene.
   */
  getPerfCollector() {
    throw qn("performanceViewerSceneExtension");
  }
  // deprecated
  /**
   * Sets the active camera of the scene using its Id
   * @param id defines the camera's Id
   * @returns the new active camera or null if none found.
   * @deprecated Please use setActiveCameraById instead
   */
  setActiveCameraByID(e) {
    return this.setActiveCameraById(e);
  }
  /**
   * Get a material using its id
   * @param id defines the material's Id
   * @returns the material or null if none found.
   * @deprecated Please use getMaterialById instead
   */
  getMaterialByID(e) {
    return this.getMaterialById(e);
  }
  /**
   * Gets a the last added material using a given id
   * @param id defines the material's Id
   * @returns the last material with the given id or null if none found.
   * @deprecated Please use getLastMaterialById instead
   */
  getLastMaterialByID(e) {
    return this.getLastMaterialById(e);
  }
  /**
   * Get a texture using its unique id
   * @param uniqueId defines the texture's unique id
   * @returns the texture or null if none found.
   * @deprecated Please use getTextureByUniqueId instead
   */
  getTextureByUniqueID(e) {
    return this.getTextureByUniqueId(e);
  }
  /**
   * Gets a camera using its Id
   * @param id defines the Id to look for
   * @returns the camera or null if not found
   * @deprecated Please use getCameraById instead
   */
  getCameraByID(e) {
    return this.getCameraById(e);
  }
  /**
   * Gets a camera using its unique Id
   * @param uniqueId defines the unique Id to look for
   * @returns the camera or null if not found
   * @deprecated Please use getCameraByUniqueId instead
   */
  getCameraByUniqueID(e) {
    return this.getCameraByUniqueId(e);
  }
  /**
   * Gets a bone using its Id
   * @param id defines the bone's Id
   * @returns the bone or null if not found
   * @deprecated Please use getBoneById instead
   */
  getBoneByID(e) {
    return this.getBoneById(e);
  }
  /**
   * Gets a light node using its Id
   * @param id defines the light's Id
   * @returns the light or null if none found.
   * @deprecated Please use getLightById instead
   */
  getLightByID(e) {
    return this.getLightById(e);
  }
  /**
   * Gets a light node using its scene-generated unique Id
   * @param uniqueId defines the light's unique Id
   * @returns the light or null if none found.
   * @deprecated Please use getLightByUniqueId instead
   */
  getLightByUniqueID(e) {
    return this.getLightByUniqueId(e);
  }
  /**
   * Gets a particle system by Id
   * @param id defines the particle system Id
   * @returns the corresponding system or null if none found
   * @deprecated Please use getParticleSystemById instead
   */
  getParticleSystemByID(e) {
    return this.getParticleSystemById(e);
  }
  /**
   * Gets a geometry using its Id
   * @param id defines the geometry's Id
   * @returns the geometry or null if none found.
   * @deprecated Please use getGeometryById instead
   */
  getGeometryByID(e) {
    return this.getGeometryById(e);
  }
  /**
   * Gets the first added mesh found of a given Id
   * @param id defines the Id to search for
   * @returns the mesh found or null if not found at all
   * @deprecated Please use getMeshById instead
   */
  getMeshByID(e) {
    return this.getMeshById(e);
  }
  /**
   * Gets a mesh with its auto-generated unique Id
   * @param uniqueId defines the unique Id to search for
   * @returns the found mesh or null if not found at all.
   * @deprecated Please use getMeshByUniqueId instead
   */
  getMeshByUniqueID(e) {
    return this.getMeshByUniqueId(e);
  }
  /**
   * Gets a the last added mesh using a given Id
   * @param id defines the Id to search for
   * @returns the found mesh or null if not found at all.
   * @deprecated Please use getLastMeshById instead
   */
  getLastMeshByID(e) {
    return this.getLastMeshById(e);
  }
  /**
   * Gets a list of meshes using their Id
   * @param id defines the Id to search for
   * @returns a list of meshes
   * @deprecated Please use getMeshesById instead
   */
  getMeshesByID(e) {
    return this.getMeshesById(e);
  }
  /**
   * Gets the first added transform node found of a given Id
   * @param id defines the Id to search for
   * @returns the found transform node or null if not found at all.
   * @deprecated Please use getTransformNodeById instead
   */
  getTransformNodeByID(e) {
    return this.getTransformNodeById(e);
  }
  /**
   * Gets a transform node with its auto-generated unique Id
   * @param uniqueId defines the unique Id to search for
   * @returns the found transform node or null if not found at all.
   * @deprecated Please use getTransformNodeByUniqueId instead
   */
  getTransformNodeByUniqueID(e) {
    return this.getTransformNodeByUniqueId(e);
  }
  /**
   * Gets a list of transform nodes using their Id
   * @param id defines the Id to search for
   * @returns a list of transform nodes
   * @deprecated Please use getTransformNodesById instead
   */
  getTransformNodesByID(e) {
    return this.getTransformNodesById(e);
  }
  /**
   * Gets a node (Mesh, Camera, Light) using a given Id
   * @param id defines the Id to search for
   * @returns the found node or null if not found at all
   * @deprecated Please use getNodeById instead
   */
  getNodeByID(e) {
    return this.getNodeById(e);
  }
  /**
   * Gets a the last added node (Mesh, Camera, Light) using a given Id
   * @param id defines the Id to search for
   * @returns the found node or null if not found at all
   * @deprecated Please use getLastEntryById instead
   */
  getLastEntryByID(e) {
    return this.getLastEntryById(e);
  }
  /**
   * Gets a skeleton using a given Id (if many are found, this function will pick the last one)
   * @param id defines the Id to search for
   * @returns the found skeleton or null if not found at all.
   * @deprecated Please use getLastSkeletonById instead
   */
  getLastSkeletonByID(e) {
    return this.getLastSkeletonById(e);
  }
}
sr.FOGMODE_NONE = 0;
sr.FOGMODE_EXP = 1;
sr.FOGMODE_EXP2 = 2;
sr.FOGMODE_LINEAR = 3;
sr.MinDeltaTime = 1;
sr.MaxDeltaTime = 1e3;
var ai;
(function(A) {
  A[A.LOCAL = 0] = "LOCAL", A[A.WORLD = 1] = "WORLD", A[A.BONE = 2] = "BONE";
})(ai || (ai = {}));
class bf {
}
bf.X = new S(1, 0, 0);
bf.Y = new S(0, 1, 0);
bf.Z = new S(0, 0, 1);
var Lx;
(function(A) {
  A[A.X = 0] = "X", A[A.Y = 1] = "Y", A[A.Z = 2] = "Z";
})(Lx || (Lx = {}));
class da extends Cs {
  /** @internal */
  get _matrix() {
    return this._compose(), this._localMatrix;
  }
  /** @internal */
  set _matrix(e) {
    e.updateFlag === this._localMatrix.updateFlag && !this._needToCompose || (this._needToCompose = !1, this._localMatrix.copyFrom(e), this._markAsDirtyAndDecompose());
  }
  /**
   * Create a new bone
   * @param name defines the bone name
   * @param skeleton defines the parent skeleton
   * @param parentBone defines the parent (can be null if the bone is the root)
   * @param localMatrix defines the local matrix (default: identity)
   * @param restMatrix defines the rest matrix (default: localMatrix)
   * @param bindMatrix defines the bind matrix (default: localMatrix)
   * @param index defines index of the bone in the hierarchy (default: null)
   */
  constructor(e, t, r = null, n = null, i = null, s = null, a = null) {
    var f;
    super(e, t.getScene()), this.name = e, this.children = [], this.animations = [], this._index = null, this._scalingDeterminant = 1, this._needToDecompose = !0, this._needToCompose = !1, this._linkedTransformNode = null, this._waitingTransformNodeId = null, this._skeleton = t, this._localMatrix = (f = n == null ? void 0 : n.clone()) !== null && f !== void 0 ? f : he.Identity(), this._restMatrix = i ?? this._localMatrix.clone(), this._bindMatrix = s ?? this._localMatrix.clone(), this._index = a, this._absoluteMatrix = new he(), this._absoluteBindMatrix = new he(), this._absoluteInverseBindMatrix = new he(), this._finalMatrix = new he(), t.bones.push(this), this.setParent(r, !1), this._updateAbsoluteBindMatrices();
  }
  /**
   * Gets the current object class name.
   * @returns the class name
   */
  getClassName() {
    return "Bone";
  }
  // Members
  /**
   * Gets the parent skeleton
   * @returns a skeleton
   */
  getSkeleton() {
    return this._skeleton;
  }
  get parent() {
    return this._parentNode;
  }
  /**
   * Gets parent bone
   * @returns a bone or null if the bone is the root of the bone hierarchy
   */
  getParent() {
    return this.parent;
  }
  /**
   * Returns an array containing the children of the bone
   * @returns an array containing the children of the bone (can be empty if the bone has no children)
   */
  getChildren() {
    return this.children;
  }
  /**
   * Gets the node index in matrix array generated for rendering
   * @returns the node index
   */
  getIndex() {
    return this._index === null ? this.getSkeleton().bones.indexOf(this) : this._index;
  }
  set parent(e) {
    this.setParent(e);
  }
  /**
   * Sets the parent bone
   * @param parent defines the parent (can be null if the bone is the root)
   * @param updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be updated
   */
  setParent(e, t = !0) {
    if (this.parent !== e) {
      if (this.parent) {
        const r = this.parent.children.indexOf(this);
        r !== -1 && this.parent.children.splice(r, 1);
      }
      this._parentNode = e, this.parent && this.parent.children.push(this), t && this._updateAbsoluteBindMatrices(), this.markAsDirty();
    }
  }
  /**
   * Gets the local matrix
   * @returns the local matrix
   */
  getLocalMatrix() {
    return this._compose(), this._localMatrix;
  }
  /**
   * Gets the bind matrix
   * @returns the bind matrix
   */
  getBindMatrix() {
    return this._bindMatrix;
  }
  /**
   * Gets the bind matrix.
   * @returns the bind matrix
   * @deprecated Please use getBindMatrix instead
   */
  getBaseMatrix() {
    return this.getBindMatrix();
  }
  /**
   * Gets the rest matrix
   * @returns the rest matrix
   */
  getRestMatrix() {
    return this._restMatrix;
  }
  /**
   * Gets the rest matrix
   * @returns the rest matrix
   * @deprecated Please use getRestMatrix instead
   */
  getRestPose() {
    return this.getRestMatrix();
  }
  /**
   * Sets the rest matrix
   * @param matrix the local-space rest matrix to set for this bone
   */
  setRestMatrix(e) {
    this._restMatrix.copyFrom(e);
  }
  /**
   * Sets the rest matrix
   * @param matrix the local-space rest to set for this bone
   * @deprecated Please use setRestMatrix instead
   */
  setRestPose(e) {
    this.setRestMatrix(e);
  }
  /**
   * Gets the bind matrix
   * @returns the bind matrix
   * @deprecated Please use getBindMatrix instead
   */
  getBindPose() {
    return this.getBindMatrix();
  }
  /**
   * Sets the bind matrix
   * This will trigger a recomputation of the absolute bind and absolute inverse bind matrices for this bone and its children
   * Note that the local matrix will also be set with the matrix passed in parameter!
   * @param matrix the local-space bind matrix to set for this bone
   */
  setBindMatrix(e) {
    this.updateMatrix(e);
  }
  /**
   * Sets the bind matrix
   * @param matrix the local-space bind to set for this bone
   * @deprecated Please use setBindMatrix instead
   */
  setBindPose(e) {
    this.setBindMatrix(e);
  }
  /**
   * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)
   */
  getFinalMatrix() {
    return this._finalMatrix;
  }
  /**
   * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)
   * @deprecated Please use getFinalMatrix instead
   */
  getWorldMatrix() {
    return this.getFinalMatrix();
  }
  /**
   * Sets the local matrix to the rest matrix
   */
  returnToRest() {
    var e;
    if (this._linkedTransformNode) {
      const t = ue.Vector3[0], r = ue.Quaternion[0], n = ue.Vector3[1];
      this.getRestMatrix().decompose(t, r, n), this._linkedTransformNode.position.copyFrom(n), this._linkedTransformNode.rotationQuaternion = (e = this._linkedTransformNode.rotationQuaternion) !== null && e !== void 0 ? e : Ze.Identity(), this._linkedTransformNode.rotationQuaternion.copyFrom(r), this._linkedTransformNode.scaling.copyFrom(t);
    } else
      this._matrix = this._restMatrix;
  }
  /**
   * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)
   * @returns the inverse bind matrix, in world space
   */
  getAbsoluteInverseBindMatrix() {
    return this._absoluteInverseBindMatrix;
  }
  /**
   * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)
   * @returns the inverse bind matrix, in world space
   * @deprecated Please use getAbsoluteInverseBindMatrix instead
   */
  getInvertedAbsoluteTransform() {
    return this.getAbsoluteInverseBindMatrix();
  }
  /**
   * Gets the bone matrix, in world space (relative to the skeleton root)
   * @returns the bone matrix, in world space
   */
  getAbsoluteMatrix() {
    return this._absoluteMatrix;
  }
  /**
   * Gets the bone matrix, in world space (relative to the skeleton root)
   * @returns the bone matrix, in world space
   * @deprecated Please use getAbsoluteMatrix instead
   */
  getAbsoluteTransform() {
    return this._absoluteMatrix;
  }
  /**
   * Links with the given transform node.
   * The local matrix of this bone is overwritten by the transform of the node every frame.
   * @param transformNode defines the transform node to link to
   */
  linkTransformNode(e) {
    this._linkedTransformNode && this._skeleton._numBonesWithLinkedTransformNode--, this._linkedTransformNode = e, this._linkedTransformNode && this._skeleton._numBonesWithLinkedTransformNode++;
  }
  // Properties (matches TransformNode properties)
  /**
   * Gets the node used to drive the bone's transformation
   * @returns a transform node or null
   */
  getTransformNode() {
    return this._linkedTransformNode;
  }
  /** Gets or sets current position (in local space) */
  get position() {
    return this._decompose(), this._localPosition;
  }
  set position(e) {
    this._decompose(), this._localPosition.copyFrom(e), this._markAsDirtyAndCompose();
  }
  /** Gets or sets current rotation (in local space) */
  get rotation() {
    return this.getRotation();
  }
  set rotation(e) {
    this.setRotation(e);
  }
  /** Gets or sets current rotation quaternion (in local space) */
  get rotationQuaternion() {
    return this._decompose(), this._localRotation;
  }
  set rotationQuaternion(e) {
    this.setRotationQuaternion(e);
  }
  /** Gets or sets current scaling (in local space) */
  get scaling() {
    return this.getScale();
  }
  set scaling(e) {
    this.setScale(e);
  }
  /**
   * Gets the animation properties override
   */
  get animationPropertiesOverride() {
    return this._skeleton.animationPropertiesOverride;
  }
  // Methods
  _decompose() {
    this._needToDecompose && (this._needToDecompose = !1, this._localScaling || (this._localScaling = S.Zero(), this._localRotation = Ze.Zero(), this._localPosition = S.Zero()), this._localMatrix.decompose(this._localScaling, this._localRotation, this._localPosition));
  }
  _compose() {
    if (this._needToCompose) {
      if (!this._localScaling) {
        this._needToCompose = !1;
        return;
      }
      this._needToCompose = !1, he.ComposeToRef(this._localScaling, this._localRotation, this._localPosition, this._localMatrix);
    }
  }
  /**
   * Update the bind (and optionally the local) matrix
   * @param bindMatrix defines the new matrix to set to the bind/local matrix, in local space
   * @param updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be recomputed (default: true)
   * @param updateLocalMatrix defines if the local matrix should also be updated with the matrix passed in parameter (default: true)
   */
  updateMatrix(e, t = !0, r = !0) {
    this._bindMatrix.copyFrom(e), t && this._updateAbsoluteBindMatrices(), r ? this._matrix = e : this.markAsDirty();
  }
  /**
   * @internal
   */
  _updateAbsoluteBindMatrices(e, t = !0) {
    if (e || (e = this._bindMatrix), this.parent ? e.multiplyToRef(this.parent._absoluteBindMatrix, this._absoluteBindMatrix) : this._absoluteBindMatrix.copyFrom(e), this._absoluteBindMatrix.invertToRef(this._absoluteInverseBindMatrix), t)
      for (let r = 0; r < this.children.length; r++)
        this.children[r]._updateAbsoluteBindMatrices();
    this._scalingDeterminant = this._absoluteBindMatrix.determinant() < 0 ? -1 : 1;
  }
  /**
   * Flag the bone as dirty (Forcing it to update everything)
   * @returns this bone
   */
  markAsDirty() {
    return this._currentRenderId++, this._childUpdateId++, this._skeleton._markAsDirty(), this;
  }
  /** @internal */
  _markAsDirtyAndCompose() {
    this.markAsDirty(), this._needToCompose = !0;
  }
  _markAsDirtyAndDecompose() {
    this.markAsDirty(), this._needToDecompose = !0;
  }
  _updatePosition(e, t = ai.LOCAL, r, n = !0) {
    const i = this.getLocalMatrix();
    if (t == ai.LOCAL)
      n ? (i.addAtIndex(12, e.x), i.addAtIndex(13, e.y), i.addAtIndex(14, e.z)) : i.setTranslationFromFloats(e.x, e.y, e.z);
    else {
      let s = null;
      r && (s = r.getWorldMatrix()), this._skeleton.computeAbsoluteMatrices();
      const a = da._TmpMats[0], f = da._TmpVecs[0];
      this.parent ? r && s ? (a.copyFrom(this.parent.getAbsoluteMatrix()), a.multiplyToRef(s, a)) : a.copyFrom(this.parent.getAbsoluteMatrix()) : he.IdentityToRef(a), n && a.setTranslationFromFloats(0, 0, 0), a.invert(), S.TransformCoordinatesToRef(e, a, f), n ? (i.addAtIndex(12, f.x), i.addAtIndex(13, f.y), i.addAtIndex(14, f.z)) : i.setTranslationFromFloats(f.x, f.y, f.z);
    }
    this._markAsDirtyAndDecompose();
  }
  /**
   * Translate the bone in local or world space
   * @param vec The amount to translate the bone
   * @param space The space that the translation is in (default: Space.LOCAL)
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   */
  translate(e, t = ai.LOCAL, r) {
    this._updatePosition(e, t, r, !0);
  }
  /**
   * Set the position of the bone in local or world space
   * @param position The position to set the bone
   * @param space The space that the position is in (default: Space.LOCAL)
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   */
  setPosition(e, t = ai.LOCAL, r) {
    this._updatePosition(e, t, r, !1);
  }
  /**
   * Set the absolute position of the bone (world space)
   * @param position The position to set the bone
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   */
  setAbsolutePosition(e, t) {
    this.setPosition(e, ai.WORLD, t);
  }
  /**
   * Scale the bone on the x, y and z axes (in local space)
   * @param x The amount to scale the bone on the x axis
   * @param y The amount to scale the bone on the y axis
   * @param z The amount to scale the bone on the z axis
   * @param scaleChildren sets this to true if children of the bone should be scaled as well (false by default)
   */
  scale(e, t, r, n = !1) {
    const i = this.getLocalMatrix(), s = da._TmpMats[0];
    he.ScalingToRef(e, t, r, s), s.multiplyToRef(i, i), s.invert();
    for (const a of this.children) {
      const f = a.getLocalMatrix();
      f.multiplyToRef(s, f), f.multiplyAtIndex(12, e), f.multiplyAtIndex(13, t), f.multiplyAtIndex(14, r), a._markAsDirtyAndDecompose();
    }
    if (this._markAsDirtyAndDecompose(), n)
      for (const a of this.children)
        a.scale(e, t, r, n);
  }
  /**
   * Set the bone scaling in local space
   * @param scale defines the scaling vector
   */
  setScale(e) {
    this._decompose(), this._localScaling.copyFrom(e), this._markAsDirtyAndCompose();
  }
  /**
   * Gets the current scaling in local space
   * @returns the current scaling vector
   */
  getScale() {
    return this._decompose(), this._localScaling;
  }
  /**
   * Gets the current scaling in local space and stores it in a target vector
   * @param result defines the target vector
   */
  getScaleToRef(e) {
    this._decompose(), e.copyFrom(this._localScaling);
  }
  /**
   * Set the yaw, pitch, and roll of the bone in local or world space
   * @param yaw The rotation of the bone on the y axis
   * @param pitch The rotation of the bone on the x axis
   * @param roll The rotation of the bone on the z axis
   * @param space The space that the axes of rotation are in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   */
  setYawPitchRoll(e, t, r, n = ai.LOCAL, i) {
    if (n === ai.LOCAL) {
      const f = da._TmpQuat;
      Ze.RotationYawPitchRollToRef(e, t, r, f), this.setRotationQuaternion(f, n, i);
      return;
    }
    const s = da._TmpMats[0];
    if (!this._getAbsoluteInverseMatrixUnscaledToRef(s, i))
      return;
    const a = da._TmpMats[1];
    he.RotationYawPitchRollToRef(e, t, r, a), s.multiplyToRef(a, a), this._rotateWithMatrix(a, n, i);
  }
  /**
   * Add a rotation to the bone on an axis in local or world space
   * @param axis The axis to rotate the bone on
   * @param amount The amount to rotate the bone
   * @param space The space that the axis is in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   */
  rotate(e, t, r = ai.LOCAL, n) {
    const i = da._TmpMats[0];
    i.setTranslationFromFloats(0, 0, 0), he.RotationAxisToRef(e, t, i), this._rotateWithMatrix(i, r, n);
  }
  /**
   * Set the rotation of the bone to a particular axis angle in local or world space
   * @param axis The axis to rotate the bone on
   * @param angle The angle that the bone should be rotated to
   * @param space The space that the axis is in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   */
  setAxisAngle(e, t, r = ai.LOCAL, n) {
    if (r === ai.LOCAL) {
      const a = da._TmpQuat;
      Ze.RotationAxisToRef(e, t, a), this.setRotationQuaternion(a, r, n);
      return;
    }
    const i = da._TmpMats[0];
    if (!this._getAbsoluteInverseMatrixUnscaledToRef(i, n))
      return;
    const s = da._TmpMats[1];
    he.RotationAxisToRef(e, t, s), i.multiplyToRef(s, s), this._rotateWithMatrix(s, r, n);
  }
  /**
   * Set the euler rotation of the bone in local or world space
   * @param rotation The euler rotation that the bone should be set to
   * @param space The space that the rotation is in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   */
  setRotation(e, t = ai.LOCAL, r) {
    this.setYawPitchRoll(e.y, e.x, e.z, t, r);
  }
  /**
   * Set the quaternion rotation of the bone in local or world space
   * @param quat The quaternion rotation that the bone should be set to
   * @param space The space that the rotation is in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   */
  setRotationQuaternion(e, t = ai.LOCAL, r) {
    if (t === ai.LOCAL) {
      this._decompose(), this._localRotation.copyFrom(e), this._markAsDirtyAndCompose();
      return;
    }
    const n = da._TmpMats[0];
    if (!this._getAbsoluteInverseMatrixUnscaledToRef(n, r))
      return;
    const i = da._TmpMats[1];
    he.FromQuaternionToRef(e, i), n.multiplyToRef(i, i), this._rotateWithMatrix(i, t, r);
  }
  /**
   * Set the rotation matrix of the bone in local or world space
   * @param rotMat The rotation matrix that the bone should be set to
   * @param space The space that the rotation is in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   */
  setRotationMatrix(e, t = ai.LOCAL, r) {
    if (t === ai.LOCAL) {
      const s = da._TmpQuat;
      Ze.FromRotationMatrixToRef(e, s), this.setRotationQuaternion(s, t, r);
      return;
    }
    const n = da._TmpMats[0];
    if (!this._getAbsoluteInverseMatrixUnscaledToRef(n, r))
      return;
    const i = da._TmpMats[1];
    i.copyFrom(e), n.multiplyToRef(e, i), this._rotateWithMatrix(i, t, r);
  }
  _rotateWithMatrix(e, t = ai.LOCAL, r) {
    const n = this.getLocalMatrix(), i = n.m[12], s = n.m[13], a = n.m[14], f = this.getParent(), o = da._TmpMats[3], d = da._TmpMats[4];
    f && t == ai.WORLD ? (r ? (o.copyFrom(r.getWorldMatrix()), f.getAbsoluteMatrix().multiplyToRef(o, o)) : o.copyFrom(f.getAbsoluteMatrix()), d.copyFrom(o), d.invert(), n.multiplyToRef(o, n), n.multiplyToRef(e, n), n.multiplyToRef(d, n)) : t == ai.WORLD && r ? (o.copyFrom(r.getWorldMatrix()), d.copyFrom(o), d.invert(), n.multiplyToRef(o, n), n.multiplyToRef(e, n), n.multiplyToRef(d, n)) : n.multiplyToRef(e, n), n.setTranslationFromFloats(i, s, a), this.computeAbsoluteMatrices(), this._markAsDirtyAndDecompose();
  }
  _getAbsoluteInverseMatrixUnscaledToRef(e, t) {
    const r = da._TmpMats[2];
    return e.copyFrom(this.getAbsoluteMatrix()), t ? (e.multiplyToRef(t.getWorldMatrix(), e), he.ScalingToRef(t.scaling.x, t.scaling.y, t.scaling.z, r)) : he.IdentityToRef(r), e.invert(), isNaN(e.m[0]) ? !1 : (r.multiplyAtIndex(0, this._scalingDeterminant), e.multiplyToRef(r, e), !0);
  }
  /**
   * Get the position of the bone in local or world space
   * @param space The space that the returned position is in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @returns The position of the bone
   */
  getPosition(e = ai.LOCAL, t = null) {
    const r = S.Zero();
    return this.getPositionToRef(e, t, r), r;
  }
  /**
   * Copy the position of the bone to a vector3 in local or world space
   * @param space The space that the returned position is in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @param result The vector3 to copy the position to
   */
  getPositionToRef(e = ai.LOCAL, t, r) {
    if (e == ai.LOCAL) {
      const n = this.getLocalMatrix();
      r.x = n.m[12], r.y = n.m[13], r.z = n.m[14];
    } else {
      let n = null;
      t && (n = t.getWorldMatrix()), this._skeleton.computeAbsoluteMatrices();
      let i = da._TmpMats[0];
      t && n ? (i.copyFrom(this.getAbsoluteMatrix()), i.multiplyToRef(n, i)) : i = this.getAbsoluteMatrix(), r.x = i.m[12], r.y = i.m[13], r.z = i.m[14];
    }
  }
  /**
   * Get the absolute position of the bone (world space)
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @returns The absolute position of the bone
   */
  getAbsolutePosition(e = null) {
    const t = S.Zero();
    return this.getPositionToRef(ai.WORLD, e, t), t;
  }
  /**
   * Copy the absolute position of the bone (world space) to the result param
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @param result The vector3 to copy the absolute position to
   */
  getAbsolutePositionToRef(e, t) {
    this.getPositionToRef(ai.WORLD, e, t);
  }
  /**
   * Compute the absolute matrices of this bone and its children
   */
  computeAbsoluteMatrices() {
    if (this._compose(), this.parent)
      this._localMatrix.multiplyToRef(this.parent._absoluteMatrix, this._absoluteMatrix);
    else {
      this._absoluteMatrix.copyFrom(this._localMatrix);
      const r = this._skeleton.getPoseMatrix();
      r && this._absoluteMatrix.multiplyToRef(r, this._absoluteMatrix);
    }
    const e = this.children, t = e.length;
    for (let r = 0; r < t; r++)
      e[r].computeAbsoluteMatrices();
  }
  /**
   * Compute the absolute matrices of this bone and its children
   * @deprecated Please use computeAbsoluteMatrices instead
   */
  computeAbsoluteTransforms() {
    this.computeAbsoluteMatrices();
  }
  /**
   * Get the world direction from an axis that is in the local space of the bone
   * @param localAxis The local direction that is used to compute the world direction
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @returns The world direction
   */
  getDirection(e, t = null) {
    const r = S.Zero();
    return this.getDirectionToRef(e, t, r), r;
  }
  /**
   * Copy the world direction to a vector3 from an axis that is in the local space of the bone
   * @param localAxis The local direction that is used to compute the world direction
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @param result The vector3 that the world direction will be copied to
   */
  getDirectionToRef(e, t = null, r) {
    let n = null;
    t && (n = t.getWorldMatrix()), this._skeleton.computeAbsoluteMatrices();
    const i = da._TmpMats[0];
    i.copyFrom(this.getAbsoluteMatrix()), t && n && i.multiplyToRef(n, i), S.TransformNormalToRef(e, i, r), r.normalize();
  }
  /**
   * Get the euler rotation of the bone in local or world space
   * @param space The space that the rotation should be in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @returns The euler rotation
   */
  getRotation(e = ai.LOCAL, t = null) {
    const r = S.Zero();
    return this.getRotationToRef(e, t, r), r;
  }
  /**
   * Copy the euler rotation of the bone to a vector3.  The rotation can be in either local or world space
   * @param space The space that the rotation should be in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @param result The vector3 that the rotation should be copied to
   */
  getRotationToRef(e = ai.LOCAL, t = null, r) {
    const n = da._TmpQuat;
    this.getRotationQuaternionToRef(e, t, n), n.toEulerAnglesToRef(r);
  }
  /**
   * Get the quaternion rotation of the bone in either local or world space
   * @param space The space that the rotation should be in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @returns The quaternion rotation
   */
  getRotationQuaternion(e = ai.LOCAL, t = null) {
    const r = Ze.Identity();
    return this.getRotationQuaternionToRef(e, t, r), r;
  }
  /**
   * Copy the quaternion rotation of the bone to a quaternion.  The rotation can be in either local or world space
   * @param space The space that the rotation should be in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @param result The quaternion that the rotation should be copied to
   */
  getRotationQuaternionToRef(e = ai.LOCAL, t = null, r) {
    if (e == ai.LOCAL)
      this._decompose(), r.copyFrom(this._localRotation);
    else {
      const n = da._TmpMats[0], i = this.getAbsoluteMatrix();
      t ? i.multiplyToRef(t.getWorldMatrix(), n) : n.copyFrom(i), n.multiplyAtIndex(0, this._scalingDeterminant), n.multiplyAtIndex(1, this._scalingDeterminant), n.multiplyAtIndex(2, this._scalingDeterminant), n.decompose(void 0, r, void 0);
    }
  }
  /**
   * Get the rotation matrix of the bone in local or world space
   * @param space The space that the rotation should be in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @returns The rotation matrix
   */
  getRotationMatrix(e = ai.LOCAL, t) {
    const r = he.Identity();
    return this.getRotationMatrixToRef(e, t, r), r;
  }
  /**
   * Copy the rotation matrix of the bone to a matrix.  The rotation can be in either local or world space
   * @param space The space that the rotation should be in
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @param result The quaternion that the rotation should be copied to
   */
  getRotationMatrixToRef(e = ai.LOCAL, t, r) {
    if (e == ai.LOCAL)
      this.getLocalMatrix().getRotationMatrixToRef(r);
    else {
      const n = da._TmpMats[0], i = this.getAbsoluteMatrix();
      t ? i.multiplyToRef(t.getWorldMatrix(), n) : n.copyFrom(i), n.multiplyAtIndex(0, this._scalingDeterminant), n.multiplyAtIndex(1, this._scalingDeterminant), n.multiplyAtIndex(2, this._scalingDeterminant), n.getRotationMatrixToRef(r);
    }
  }
  /**
   * Get the world position of a point that is in the local space of the bone
   * @param position The local position
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @returns The world position
   */
  getAbsolutePositionFromLocal(e, t = null) {
    const r = S.Zero();
    return this.getAbsolutePositionFromLocalToRef(e, t, r), r;
  }
  /**
   * Get the world position of a point that is in the local space of the bone and copy it to the result param
   * @param position The local position
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @param result The vector3 that the world position should be copied to
   */
  getAbsolutePositionFromLocalToRef(e, t = null, r) {
    let n = null;
    t && (n = t.getWorldMatrix()), this._skeleton.computeAbsoluteMatrices();
    const i = da._TmpMats[0];
    i.copyFrom(this.getAbsoluteMatrix()), t && n && i.multiplyToRef(n, i), S.TransformCoordinatesToRef(e, i, r);
  }
  /**
   * Get the local position of a point that is in world space
   * @param position The world position
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @returns The local position
   */
  getLocalPositionFromAbsolute(e, t = null) {
    const r = S.Zero();
    return this.getLocalPositionFromAbsoluteToRef(e, t, r), r;
  }
  /**
   * Get the local position of a point that is in world space and copy it to the result param
   * @param position The world position
   * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
   * @param result The vector3 that the local position should be copied to
   */
  getLocalPositionFromAbsoluteToRef(e, t = null, r) {
    let n = null;
    t && (n = t.getWorldMatrix()), this._skeleton.computeAbsoluteMatrices();
    const i = da._TmpMats[0];
    i.copyFrom(this.getAbsoluteMatrix()), t && n && i.multiplyToRef(n, i), i.invert(), S.TransformCoordinatesToRef(e, i, r);
  }
  /**
   * Set the current local matrix as the restMatrix for this bone.
   */
  setCurrentPoseAsRest() {
    this.setRestMatrix(this.getLocalMatrix());
  }
}
da._TmpVecs = Nf.BuildArray(2, S.Zero);
da._TmpQuat = Ze.Identity();
da._TmpMats = Nf.BuildArray(5, he.Identity);
class ZN {
  /**
   * Gets the root Animatable used to synchronize and normalize animations
   */
  get syncRoot() {
    return this._syncRoot;
  }
  /**
   * Gets the current frame of the first RuntimeAnimation
   * Used to synchronize Animatables
   */
  get masterFrame() {
    return this._runtimeAnimations.length === 0 ? 0 : this._runtimeAnimations[0].currentFrame;
  }
  /**
   * Gets or sets the animatable weight (-1.0 by default meaning not weighted)
   */
  get weight() {
    return this._weight;
  }
  set weight(e) {
    if (e === -1) {
      this._weight = -1;
      return;
    }
    this._weight = Math.min(Math.max(e, 0), 1);
  }
  /**
   * Gets or sets the speed ratio to apply to the animatable (1.0 by default)
   */
  get speedRatio() {
    return this._speedRatio;
  }
  set speedRatio(e) {
    for (let t = 0; t < this._runtimeAnimations.length; t++)
      this._runtimeAnimations[t]._prepareForSpeedRatioChange(e);
    this._speedRatio = e, this._goToFrame !== null && this.goToFrame(this._goToFrame);
  }
  /**
   * Gets the elapsed time since the animatable started in milliseconds
   */
  get elapsedTime() {
    return this._localDelayOffset === null ? 0 : this._scene._animationTime - this._localDelayOffset;
  }
  /**
   * Creates a new Animatable
   * @param scene defines the hosting scene
   * @param target defines the target object
   * @param fromFrame defines the starting frame number (default is 0)
   * @param toFrame defines the ending frame number (default is 100)
   * @param loopAnimation defines if the animation must loop (default is false)
   * @param speedRatio defines the factor to apply to animation speed (default is 1)
   * @param onAnimationEnd defines a callback to call when animation ends if it is not looping
   * @param animations defines a group of animation to add to the new Animatable
   * @param onAnimationLoop defines a callback to call when animation loops
   * @param isAdditive defines whether the animation should be evaluated additively
   * @param playOrder defines the order in which this animatable should be processed in the list of active animatables (default: 0)
   */
  constructor(e, t, r = 0, n = 100, i = !1, s = 1, a, f, o, d = !1, v = 0) {
    this.target = t, this.fromFrame = r, this.toFrame = n, this.loopAnimation = i, this.onAnimationEnd = a, this.onAnimationLoop = o, this.isAdditive = d, this.playOrder = v, this._localDelayOffset = null, this._pausedDelay = null, this._manualJumpDelay = null, this._runtimeAnimations = new Array(), this._paused = !1, this._speedRatio = 1, this._weight = -1, this._syncRoot = null, this._frameToSyncFromJump = null, this._goToFrame = null, this.disposeOnEnd = !0, this.animationStarted = !1, this.onAnimationEndObservable = new Oe(), this.onAnimationLoopObservable = new Oe(), this._scene = e, f && this.appendAnimations(t, f), this._speedRatio = s, e._activeAnimatables.push(this);
  }
  // Methods
  /**
   * Synchronize and normalize current Animatable with a source Animatable
   * This is useful when using animation weights and when animations are not of the same length
   * @param root defines the root Animatable to synchronize with (null to stop synchronizing)
   * @returns the current Animatable
   */
  syncWith(e) {
    if (this._syncRoot = e, e) {
      const t = this._scene._activeAnimatables.indexOf(this);
      t > -1 && (this._scene._activeAnimatables.splice(t, 1), this._scene._activeAnimatables.push(this));
    }
    return this;
  }
  /**
   * Gets the list of runtime animations
   * @returns an array of RuntimeAnimation
   */
  getAnimations() {
    return this._runtimeAnimations;
  }
  /**
   * Adds more animations to the current animatable
   * @param target defines the target of the animations
   * @param animations defines the new animations to add
   */
  appendAnimations(e, t) {
    for (let r = 0; r < t.length; r++) {
      const n = t[r], i = new R$(e, n, this._scene, this);
      i._onLoop = () => {
        this.onAnimationLoopObservable.notifyObservers(this), this.onAnimationLoop && this.onAnimationLoop();
      }, this._runtimeAnimations.push(i);
    }
  }
  /**
   * Gets the source animation for a specific property
   * @param property defines the property to look for
   * @returns null or the source animation for the given property
   */
  getAnimationByTargetProperty(e) {
    const t = this._runtimeAnimations;
    for (let r = 0; r < t.length; r++)
      if (t[r].animation.targetProperty === e)
        return t[r].animation;
    return null;
  }
  /**
   * Gets the runtime animation for a specific property
   * @param property defines the property to look for
   * @returns null or the runtime animation for the given property
   */
  getRuntimeAnimationByTargetProperty(e) {
    const t = this._runtimeAnimations;
    for (let r = 0; r < t.length; r++)
      if (t[r].animation.targetProperty === e)
        return t[r];
    return null;
  }
  /**
   * Resets the animatable to its original state
   */
  reset() {
    const e = this._runtimeAnimations;
    for (let t = 0; t < e.length; t++)
      e[t].reset(!0);
    this._localDelayOffset = null, this._pausedDelay = null;
  }
  /**
   * Allows the animatable to blend with current running animations
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-blending
   * @param blendingSpeed defines the blending speed to use
   */
  enableBlending(e) {
    const t = this._runtimeAnimations;
    for (let r = 0; r < t.length; r++)
      t[r].animation.enableBlending = !0, t[r].animation.blendingSpeed = e;
  }
  /**
   * Disable animation blending
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-blending
   */
  disableBlending() {
    const e = this._runtimeAnimations;
    for (let t = 0; t < e.length; t++)
      e[t].animation.enableBlending = !1;
  }
  /**
   * Jump directly to a given frame
   * @param frame defines the frame to jump to
   */
  goToFrame(e) {
    var t;
    const r = this._runtimeAnimations;
    if (r[0]) {
      const n = r[0].animation.framePerSecond;
      this._frameToSyncFromJump = (t = this._frameToSyncFromJump) !== null && t !== void 0 ? t : r[0].currentFrame;
      const i = this.speedRatio === 0 ? 0 : (e - this._frameToSyncFromJump) / n * 1e3 / this.speedRatio;
      this._manualJumpDelay = -i;
    }
    for (let n = 0; n < r.length; n++)
      r[n].goToFrame(e);
    this._goToFrame = e;
  }
  /**
   * Returns true if the animations for this animatable are paused
   */
  get paused() {
    return this._paused;
  }
  /**
   * Pause the animation
   */
  pause() {
    this._paused || (this._paused = !0);
  }
  /**
   * Restart the animation
   */
  restart() {
    this._paused = !1;
  }
  _raiseOnAnimationEnd() {
    this.onAnimationEnd && this.onAnimationEnd(), this.onAnimationEndObservable.notifyObservers(this);
  }
  /**
   * Stop and delete the current animation
   * @param animationName defines a string used to only stop some of the runtime animations instead of all
   * @param targetMask a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)
   * @param useGlobalSplice if true, the animatables will be removed by the caller of this function (false by default)
   */
  stop(e, t, r = !1) {
    if (e || t) {
      const n = this._scene._activeAnimatables.indexOf(this);
      if (n > -1) {
        const i = this._runtimeAnimations;
        for (let s = i.length - 1; s >= 0; s--) {
          const a = i[s];
          e && a.animation.name != e || t && !t(a.target) || (a.dispose(), i.splice(s, 1));
        }
        i.length == 0 && (r || this._scene._activeAnimatables.splice(n, 1), this._raiseOnAnimationEnd());
      }
    } else {
      const n = this._scene._activeAnimatables.indexOf(this);
      if (n > -1) {
        r || this._scene._activeAnimatables.splice(n, 1);
        const i = this._runtimeAnimations;
        for (let s = 0; s < i.length; s++)
          i[s].dispose();
        this._runtimeAnimations.length = 0, this._raiseOnAnimationEnd();
      }
    }
  }
  /**
   * Wait asynchronously for the animation to end
   * @returns a promise which will be fulfilled when the animation ends
   */
  waitAsync() {
    return new Promise((e) => {
      this.onAnimationEndObservable.add(() => {
        e(this);
      }, void 0, void 0, this, !0);
    });
  }
  /**
   * @internal
   */
  _animate(e) {
    if (this._paused)
      return this.animationStarted = !1, this._pausedDelay === null && (this._pausedDelay = e), !0;
    if (this._localDelayOffset === null ? (this._localDelayOffset = e, this._pausedDelay = null) : this._pausedDelay !== null && (this._localDelayOffset += e - this._pausedDelay, this._pausedDelay = null), this._manualJumpDelay !== null && (this._localDelayOffset += this._manualJumpDelay, this._manualJumpDelay = null, this._frameToSyncFromJump = null), this._goToFrame = null, this._weight === 0)
      return !0;
    let t = !1;
    const r = this._runtimeAnimations;
    let n;
    for (n = 0; n < r.length; n++) {
      const s = r[n].animate(e - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio, this._weight);
      t = t || s;
    }
    if (this.animationStarted = t, !t) {
      if (this.disposeOnEnd)
        for (n = this._scene._activeAnimatables.indexOf(this), this._scene._activeAnimatables.splice(n, 1), n = 0; n < r.length; n++)
          r[n].dispose();
      this._raiseOnAnimationEnd(), this.disposeOnEnd && (this.onAnimationEnd = null, this.onAnimationLoop = null, this.onAnimationLoopObservable.clear(), this.onAnimationEndObservable.clear());
    }
    return t;
  }
}
sr.prototype._animate = function() {
  if (!this.animationsEnabled)
    return;
  const A = Yi.Now;
  if (!this._animationTimeLast) {
    if (this._pendingData.length > 0)
      return;
    this._animationTimeLast = A;
  }
  this.deltaTime = this.useConstantAnimationDeltaTime ? 16 : (A - this._animationTimeLast) * this.animationTimeScale, this._animationTimeLast = A;
  const e = this._activeAnimatables;
  if (e.length === 0)
    return;
  this._animationTime += this.deltaTime;
  const t = this._animationTime;
  for (let r = 0; r < e.length; r++) {
    const n = e[r];
    !n._animate(t) && n.disposeOnEnd && r--;
  }
  this._processLateAnimationBindings();
};
sr.prototype.sortActiveAnimatables = function() {
  this._activeAnimatables.sort((A, e) => A.playOrder - e.playOrder);
};
sr.prototype.beginWeightedAnimation = function(A, e, t, r = 1, n, i = 1, s, a, f, o, d = !1) {
  const v = this.beginAnimation(A, e, t, n, i, s, a, !1, f, o, d);
  return v.weight = r, v;
};
sr.prototype.beginAnimation = function(A, e, t, r, n = 1, i, s, a = !0, f, o, d = !1) {
  e > t && n > 0 && (n *= -1), a && this.stopAnimation(A, void 0, f), s || (s = new ZN(this, A, e, t, r, n, i, void 0, o, d));
  const v = f ? f(A) : !0;
  if (A.animations && v && s.appendAnimations(A, A.animations), A.getAnimatables) {
    const u = A.getAnimatables();
    for (let l = 0; l < u.length; l++)
      this.beginAnimation(u[l], e, t, r, n, i, s, a, f, o);
  }
  return s.reset(), s;
};
sr.prototype.beginHierarchyAnimation = function(A, e, t, r, n, i = 1, s, a, f = !0, o, d, v = !1) {
  const u = A.getDescendants(e), l = [];
  l.push(this.beginAnimation(A, t, r, n, i, s, a, f, o, void 0, v));
  for (const P of u)
    l.push(this.beginAnimation(P, t, r, n, i, s, a, f, o, void 0, v));
  return l;
};
sr.prototype.beginDirectAnimation = function(A, e, t, r, n, i, s, a, f = !1) {
  if (i === void 0 && (i = 1), t > r && i > 0)
    i *= -1;
  else if (r > t && i < 0) {
    const d = r;
    r = t, t = d;
  }
  return new ZN(this, A, t, r, n, i, s, e, a, f);
};
sr.prototype.beginDirectHierarchyAnimation = function(A, e, t, r, n, i, s, a, f, o = !1) {
  const d = A.getDescendants(e), v = [];
  v.push(this.beginDirectAnimation(A, t, r, n, i, s, a, f, o));
  for (const u of d)
    v.push(this.beginDirectAnimation(u, t, r, n, i, s, a, f, o));
  return v;
};
sr.prototype.getAnimatableByTarget = function(A) {
  for (let e = 0; e < this._activeAnimatables.length; e++)
    if (this._activeAnimatables[e].target === A)
      return this._activeAnimatables[e];
  return null;
};
sr.prototype.getAllAnimatablesByTarget = function(A) {
  const e = [];
  for (let t = 0; t < this._activeAnimatables.length; t++)
    this._activeAnimatables[t].target === A && e.push(this._activeAnimatables[t]);
  return e;
};
sr.prototype.stopAnimation = function(A, e, t) {
  const r = this.getAllAnimatablesByTarget(A);
  for (const n of r)
    n.stop(e, t);
};
sr.prototype.stopAllAnimations = function() {
  if (this._activeAnimatables) {
    for (let A = 0; A < this._activeAnimatables.length; A++)
      this._activeAnimatables[A].stop(void 0, void 0, !0);
    this._activeAnimatables.length = 0;
  }
  for (const A of this.animationGroups)
    A.stop();
};
sr.prototype._registerTargetForLateAnimationBinding = function(A, e) {
  const t = A.target;
  this._registeredForLateAnimationBindings.pushNoDuplicate(t), t._lateAnimationHolders || (t._lateAnimationHolders = {}), t._lateAnimationHolders[A.targetPath] || (t._lateAnimationHolders[A.targetPath] = {
    totalWeight: 0,
    totalAdditiveWeight: 0,
    animations: [],
    additiveAnimations: [],
    originalValue: e
  }), A.isAdditive ? (t._lateAnimationHolders[A.targetPath].additiveAnimations.push(A), t._lateAnimationHolders[A.targetPath].totalAdditiveWeight += A.weight) : (t._lateAnimationHolders[A.targetPath].animations.push(A), t._lateAnimationHolders[A.targetPath].totalWeight += A.weight);
};
sr.prototype._processLateAnimationBindingsForMatrices = function(A) {
  if (A.totalWeight === 0 && A.totalAdditiveWeight === 0)
    return A.originalValue;
  let e = 1;
  const t = ue.Vector3[0], r = ue.Vector3[1], n = ue.Quaternion[0];
  let i = 0;
  const s = A.animations[0], a = A.originalValue;
  let f = 1, o = !1;
  if (A.totalWeight < 1)
    f = 1 - A.totalWeight, a.decompose(r, n, t);
  else {
    if (i = 1, e = A.totalWeight, f = s.weight / e, f == 1)
      if (A.totalAdditiveWeight)
        o = !0;
      else
        return s.currentValue;
    s.currentValue.decompose(r, n, t);
  }
  if (!o) {
    r.scaleInPlace(f), t.scaleInPlace(f), n.scaleInPlace(f);
    for (let v = i; v < A.animations.length; v++) {
      const u = A.animations[v];
      if (u.weight === 0)
        continue;
      f = u.weight / e;
      const l = ue.Vector3[2], P = ue.Vector3[3], p = ue.Quaternion[1];
      u.currentValue.decompose(P, p, l), P.scaleAndAddToRef(f, r), p.scaleAndAddToRef(Ze.Dot(n, p) > 0 ? f : -f, n), l.scaleAndAddToRef(f, t);
    }
    n.normalize();
  }
  for (let v = 0; v < A.additiveAnimations.length; v++) {
    const u = A.additiveAnimations[v];
    if (u.weight === 0)
      continue;
    const l = ue.Vector3[2], P = ue.Vector3[3], p = ue.Quaternion[1];
    u.currentValue.decompose(P, p, l), P.multiplyToRef(r, P), S.LerpToRef(r, P, u.weight, r), n.multiplyToRef(p, p), Ze.SlerpToRef(n, p, u.weight, n), l.scaleAndAddToRef(u.weight, t);
  }
  const d = s ? s._animationState.workValue : ue.Matrix[0].clone();
  return he.ComposeToRef(r, n, t, d), d;
};
sr.prototype._processLateAnimationBindingsForQuaternions = function(A, e) {
  if (A.totalWeight === 0 && A.totalAdditiveWeight === 0)
    return e;
  const t = A.animations[0], r = A.originalValue;
  let n = e;
  if (A.totalWeight === 0 && A.totalAdditiveWeight > 0)
    n.copyFrom(r);
  else if (A.animations.length === 1) {
    if (Ze.SlerpToRef(r, t.currentValue, Math.min(1, A.totalWeight), n), A.totalAdditiveWeight === 0)
      return n;
  } else if (A.animations.length > 1) {
    let i = 1, s, a;
    if (A.totalWeight < 1) {
      const o = 1 - A.totalWeight;
      s = [], a = [], s.push(r), a.push(o);
    } else {
      if (A.animations.length === 2 && (Ze.SlerpToRef(A.animations[0].currentValue, A.animations[1].currentValue, A.animations[1].weight / A.totalWeight, e), A.totalAdditiveWeight === 0))
        return e;
      s = [], a = [], i = A.totalWeight;
    }
    for (let o = 0; o < A.animations.length; o++) {
      const d = A.animations[o];
      s.push(d.currentValue), a.push(d.weight / i);
    }
    let f = 0;
    for (let o = 0; o < s.length; ) {
      if (!o) {
        Ze.SlerpToRef(s[o], s[o + 1], a[o + 1] / (a[o] + a[o + 1]), e), n = e, f = a[o] + a[o + 1], o += 2;
        continue;
      }
      f += a[o], Ze.SlerpToRef(n, s[o], a[o] / f, n), o++;
    }
  }
  for (let i = 0; i < A.additiveAnimations.length; i++) {
    const s = A.additiveAnimations[i];
    s.weight !== 0 && (n.multiplyToRef(s.currentValue, ue.Quaternion[0]), Ze.SlerpToRef(n, ue.Quaternion[0], s.weight, n));
  }
  return n;
};
sr.prototype._processLateAnimationBindings = function() {
  if (this._registeredForLateAnimationBindings.length) {
    for (let A = 0; A < this._registeredForLateAnimationBindings.length; A++) {
      const e = this._registeredForLateAnimationBindings.data[A];
      for (const t in e._lateAnimationHolders) {
        const r = e._lateAnimationHolders[t], n = r.animations[0], i = r.originalValue;
        if (i == null)
          continue;
        const s = st.AllowMatrixDecomposeForInterpolation && i.m;
        let a = e[t];
        if (s)
          a = this._processLateAnimationBindingsForMatrices(r);
        else if (i.w !== void 0)
          a = this._processLateAnimationBindingsForQuaternions(r, a || Ze.Identity());
        else {
          let o = 0, d = 1;
          const v = n && n._animationState.loopMode === st.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT;
          if (r.totalWeight < 1)
            v ? a = i.clone ? i.clone() : i : n && i.scale ? a = i.scale(1 - r.totalWeight) : n ? a = i * (1 - r.totalWeight) : i.clone ? a = i.clone() : a = i;
          else if (n) {
            d = r.totalWeight;
            const u = n.weight / d;
            u !== 1 ? n.currentValue.scale ? a = n.currentValue.scale(u) : a = n.currentValue * u : a = n.currentValue, v && (a.addToRef ? a.addToRef(i, a) : a += i), o = 1;
          }
          for (let u = o; u < r.animations.length; u++) {
            const l = r.animations[u], P = l.weight / d;
            if (P)
              l.currentValue.scaleAndAddToRef ? l.currentValue.scaleAndAddToRef(P, a) : a += l.currentValue * P;
            else
              continue;
          }
          for (let u = 0; u < r.additiveAnimations.length; u++) {
            const l = r.additiveAnimations[u], P = l.weight;
            if (P)
              l.currentValue.scaleAndAddToRef ? l.currentValue.scaleAndAddToRef(P, a) : a += l.currentValue * P;
            else
              continue;
          }
        }
        e[t] = a;
      }
      e._lateAnimationHolders = {};
    }
    this._registeredForLateAnimationBindings.reset();
  }
};
da.prototype.copyAnimationRange = function(A, e, t, r = !1, n = null) {
  this.animations.length === 0 && (this.animations.push(new st(this.name, "_matrix", A.animations[0].framePerSecond, st.ANIMATIONTYPE_MATRIX, 0)), this.animations[0].setKeys([]));
  const i = A.animations[0].getRange(e);
  if (!i)
    return !1;
  const s = i.from, a = i.to, f = A.animations[0].getKeys(), o = A.length, d = A.getParent(), v = this.getParent(), u = r && d && o && this.length && o !== this.length, l = u && v && d ? v.length / d.length : 1, P = r && !v && n && (n.x !== 1 || n.y !== 1 || n.z !== 1), p = this.animations[0].getKeys();
  let c, H, T;
  for (let q = 0, b = f.length; q < b; q++)
    c = f[q], c.frame >= s && c.frame <= a && (r ? (T = c.value.clone(), u ? (H = T.getTranslation(), T.setTranslation(H.scaleInPlace(l))) : P && n ? (H = T.getTranslation(), T.setTranslation(H.multiplyInPlace(n))) : T = c.value) : T = c.value, p.push({ frame: c.frame + t, value: T }));
  return this.animations[0].createRange(e, s + t, a + t), !0;
};
class t6e {
  constructor() {
    this.enableBlending = !1, this.blendingSpeed = 0.01, this.loopMode = st.ANIMATIONLOOPMODE_CYCLE;
  }
}
var tm;
(function(A) {
  A[A.CW = 0] = "CW", A[A.CCW = 1] = "CCW";
})(tm || (tm = {}));
class z$ {
  /**
   * Returns the cubic Bezier interpolated value (float) at "t" (float) from the given x1, y1, x2, y2 floats
   * @param t defines the time
   * @param x1 defines the left coordinate on X axis
   * @param y1 defines the left coordinate on Y axis
   * @param x2 defines the right coordinate on X axis
   * @param y2 defines the right coordinate on Y axis
   * @returns the interpolated value
   */
  static Interpolate(e, t, r, n, i) {
    const s = 1 - 3 * n + 3 * t, a = 3 * n - 6 * t, f = 3 * t;
    let o = e;
    for (let d = 0; d < 5; d++) {
      const v = o * o, u = v * o, l = s * u + a * v + f * o, P = 1 / (3 * s * v + 2 * a * o + f);
      o -= (l - e) * P, o = Math.min(1, Math.max(0, o));
    }
    return 3 * Math.pow(1 - o, 2) * o * r + 3 * (1 - o) * Math.pow(o, 2) * i + Math.pow(o, 3);
  }
}
class JH {
  /**
   * Creates an Angle object of "radians" radians (float).
   * @param radians the angle in radians
   */
  constructor(e) {
    this._radians = e, this._radians < 0 && (this._radians += 2 * Math.PI);
  }
  /**
   * Get value in degrees
   * @returns the Angle value in degrees (float)
   */
  degrees() {
    return this._radians * 180 / Math.PI;
  }
  /**
   * Get value in radians
   * @returns the Angle value in radians (float)
   */
  radians() {
    return this._radians;
  }
  /**
   * Gets a new Angle object with a value of the angle (in radians) between the line connecting the two points and the x-axis
   * @param a defines first point as the origin
   * @param b defines point
   * @returns a new Angle
   */
  static BetweenTwoPoints(e, t) {
    const r = t.subtract(e), n = Math.atan2(r.y, r.x);
    return new JH(n);
  }
  /**
   * Gets the angle between the two vectors
   * @param a defines first vector
   * @param b defines vector
   * @returns Returns an new Angle between 0 and PI
   */
  static BetweenTwoVectors(e, t) {
    let r = e.lengthSquared() * t.lengthSquared();
    if (r === 0)
      return new JH(Math.PI / 2);
    r = Math.sqrt(r);
    let n = e.dot(t) / r;
    n = Xt.Clamp(n, -1, 1);
    const i = Math.acos(n);
    return new JH(i);
  }
  /**
   * Gets a new Angle object from the given float in radians
   * @param radians defines the angle value in radians
   * @returns a new Angle
   */
  static FromRadians(e) {
    return new JH(e);
  }
  /**
   * Gets a new Angle object from the given float in degrees
   * @param degrees defines the angle value in degrees
   * @returns a new Angle
   */
  static FromDegrees(e) {
    return new JH(e * Math.PI / 180);
  }
}
class G$ {
  /**
   * Creates an Arc object from the three given points : start, middle and end.
   * @param startPoint Defines the start point of the arc
   * @param midPoint Defines the middle point of the arc
   * @param endPoint Defines the end point of the arc
   */
  constructor(e, t, r) {
    this.startPoint = e, this.midPoint = t, this.endPoint = r;
    const n = Math.pow(t.x, 2) + Math.pow(t.y, 2), i = (Math.pow(e.x, 2) + Math.pow(e.y, 2) - n) / 2, s = (n - Math.pow(r.x, 2) - Math.pow(r.y, 2)) / 2, a = (e.x - t.x) * (t.y - r.y) - (t.x - r.x) * (e.y - t.y);
    this.centerPoint = new at((i * (t.y - r.y) - s * (e.y - t.y)) / a, ((e.x - t.x) * s - (t.x - r.x) * i) / a), this.radius = this.centerPoint.subtract(this.startPoint).length(), this.startAngle = JH.BetweenTwoPoints(this.centerPoint, this.startPoint);
    const f = this.startAngle.degrees();
    let o = JH.BetweenTwoPoints(this.centerPoint, this.midPoint).degrees(), d = JH.BetweenTwoPoints(this.centerPoint, this.endPoint).degrees();
    o - f > 180 && (o -= 360), o - f < -180 && (o += 360), d - o > 180 && (d -= 360), d - o < -180 && (d += 360), this.orientation = o - f < 0 ? tm.CW : tm.CCW, this.angle = JH.FromDegrees(this.orientation === tm.CW ? f - d : d - f);
  }
}
class sU {
  /**
   * Creates a Path2 object from the starting 2D coordinates x and y.
   * @param x the starting points x value
   * @param y the starting points y value
   */
  constructor(e, t) {
    this._points = new Array(), this._length = 0, this.closed = !1, this._points.push(new at(e, t));
  }
  /**
   * Adds a new segment until the given coordinates (x, y) to the current Path2.
   * @param x the added points x value
   * @param y the added points y value
   * @returns the updated Path2.
   */
  addLineTo(e, t) {
    if (this.closed)
      return this;
    const r = new at(e, t), n = this._points[this._points.length - 1];
    return this._points.push(r), this._length += r.subtract(n).length(), this;
  }
  /**
   * Adds _numberOfSegments_ segments according to the arc definition (middle point coordinates, end point coordinates, the arc start point being the current Path2 last point) to the current Path2.
   * @param midX middle point x value
   * @param midY middle point y value
   * @param endX end point x value
   * @param endY end point y value
   * @param numberOfSegments (default: 36)
   * @returns the updated Path2.
   */
  addArcTo(e, t, r, n, i = 36) {
    if (this.closed)
      return this;
    const s = this._points[this._points.length - 1], a = new at(e, t), f = new at(r, n), o = new G$(s, a, f);
    let d = o.angle.radians() / i;
    o.orientation === tm.CW && (d *= -1);
    let v = o.startAngle.radians() + d;
    for (let u = 0; u < i; u++) {
      const l = Math.cos(v) * o.radius + o.centerPoint.x, P = Math.sin(v) * o.radius + o.centerPoint.y;
      this.addLineTo(l, P), v += d;
    }
    return this;
  }
  /**
   * Adds _numberOfSegments_ segments according to the quadratic curve definition to the current Path2.
   * @param controlX control point x value
   * @param controlY control point y value
   * @param endX end point x value
   * @param endY end point y value
   * @param numberOfSegments (default: 36)
   * @returns the updated Path2.
   */
  addQuadraticCurveTo(e, t, r, n, i = 36) {
    if (this.closed)
      return this;
    const s = (f, o, d, v) => (1 - f) * (1 - f) * o + 2 * f * (1 - f) * d + f * f * v, a = this._points[this._points.length - 1];
    for (let f = 0; f <= i; f++) {
      const o = f / i, d = s(o, a.x, e, r), v = s(o, a.y, t, n);
      this.addLineTo(d, v);
    }
    return this;
  }
  /**
   * Adds _numberOfSegments_ segments according to the bezier curve definition to the current Path2.
   * @param originTangentX tangent vector at the origin point x value
   * @param originTangentY tangent vector at the origin point y value
   * @param destinationTangentX tangent vector at the destination point x value
   * @param destinationTangentY tangent vector at the destination point y value
   * @param endX end point x value
   * @param endY end point y value
   * @param numberOfSegments (default: 36)
   * @returns the updated Path2.
   */
  addBezierCurveTo(e, t, r, n, i, s, a = 36) {
    if (this.closed)
      return this;
    const f = (d, v, u, l, P) => (1 - d) * (1 - d) * (1 - d) * v + 3 * d * (1 - d) * (1 - d) * u + 3 * d * d * (1 - d) * l + d * d * d * P, o = this._points[this._points.length - 1];
    for (let d = 0; d <= a; d++) {
      const v = d / a, u = f(v, o.x, e, r, i), l = f(v, o.y, t, n, s);
      this.addLineTo(u, l);
    }
    return this;
  }
  /**
   * Defines if a given point is inside the polygon defines by the path
   * @param point defines the point to test
   * @returns true if the point is inside
   */
  isPointInside(e) {
    let t = !1;
    const r = this._points.length;
    for (let n = r - 1, i = 0; i < r; n = i++) {
      let s = this._points[n], a = this._points[i], f = a.x - s.x, o = a.y - s.y;
      if (Math.abs(o) > Number.EPSILON) {
        if (o < 0 && (s = this._points[i], f = -f, a = this._points[n], o = -o), e.y < s.y || e.y > a.y)
          continue;
        if (e.y === s.y && e.x === s.x)
          return !0;
        {
          const d = o * (e.x - s.x) - f * (e.y - s.y);
          if (d === 0)
            return !0;
          if (d < 0)
            continue;
          t = !t;
        }
      } else {
        if (e.y !== s.y)
          continue;
        if (a.x <= e.x && e.x <= s.x || s.x <= e.x && e.x <= a.x)
          return !0;
      }
    }
    return t;
  }
  /**
   * Closes the Path2.
   * @returns the Path2.
   */
  close() {
    return this.closed = !0, this;
  }
  /**
   * Gets the sum of the distance between each sequential point in the path
   * @returns the Path2 total length (float).
   */
  length() {
    let e = this._length;
    if (this.closed) {
      const t = this._points[this._points.length - 1], r = this._points[0];
      e += r.subtract(t).length();
    }
    return e;
  }
  /**
   * Gets the area of the polygon defined by the path
   * @returns area value
   */
  area() {
    const e = this._points.length;
    let t = 0;
    for (let r = e - 1, n = 0; n < e; r = n++)
      t += this._points[r].x * this._points[n].y - this._points[n].x * this._points[r].y;
    return t * 0.5;
  }
  /**
   * Gets the points which construct the path
   * @returns the Path2 internal array of points.
   */
  getPoints() {
    return this._points;
  }
  /**
   * Retrieves the point at the distance aways from the starting point
   * @param normalizedLengthPosition the length along the path to retrieve the point from
   * @returns a new Vector2 located at a percentage of the Path2 total length on this path.
   */
  getPointAtLengthPosition(e) {
    if (e < 0 || e > 1)
      return at.Zero();
    const t = e * this.length();
    let r = 0;
    for (let n = 0; n < this._points.length; n++) {
      const i = (n + 1) % this._points.length, s = this._points[n], f = this._points[i].subtract(s), o = f.length() + r;
      if (t >= r && t <= o) {
        const d = f.normalize(), v = t - r;
        return new at(s.x + d.x * v, s.y + d.y * v);
      }
      r = o;
    }
    return at.Zero();
  }
  /**
   * Creates a new path starting from an x and y position
   * @param x starting x value
   * @param y starting y value
   * @returns a new Path2 starting at the coordinates (x, y).
   */
  static StartingAt(e, t) {
    return new sU(e, t);
  }
}
class vm {
  /**
   * new Path3D(path, normal, raw)
   * Creates a Path3D. A Path3D is a logical math object, so not a mesh.
   * please read the description in the tutorial : https://doc.babylonjs.com/features/featuresDeepDive/mesh/path3D
   * @param path an array of Vector3, the curve axis of the Path3D
   * @param firstNormal (options) Vector3, the first wanted normal to the curve. Ex (0, 1, 0) for a vertical normal.
   * @param raw (optional, default false) : boolean, if true the returned Path3D isn't normalized. Useful to depict path acceleration or speed.
   * @param alignTangentsWithPath (optional, default false) : boolean, if true the tangents will be aligned with the path.
   */
  constructor(e, t = null, r, n = !1) {
    this.path = e, this._curve = new Array(), this._distances = new Array(), this._tangents = new Array(), this._normals = new Array(), this._binormals = new Array(), this._pointAtData = {
      id: 0,
      point: S.Zero(),
      previousPointArrayIndex: 0,
      position: 0,
      subPosition: 0,
      interpolateReady: !1,
      interpolationMatrix: he.Identity()
    };
    for (let i = 0; i < e.length; i++)
      this._curve[i] = e[i].clone();
    this._raw = r || !1, this._alignTangentsWithPath = n, this._compute(t, n);
  }
  /**
   * Returns the Path3D array of successive Vector3 designing its curve.
   * @returns the Path3D array of successive Vector3 designing its curve.
   */
  getCurve() {
    return this._curve;
  }
  /**
   * Returns the Path3D array of successive Vector3 designing its curve.
   * @returns the Path3D array of successive Vector3 designing its curve.
   */
  getPoints() {
    return this._curve;
  }
  /**
   * @returns the computed length (float) of the path.
   */
  length() {
    return this._distances[this._distances.length - 1];
  }
  /**
   * Returns an array populated with tangent vectors on each Path3D curve point.
   * @returns an array populated with tangent vectors on each Path3D curve point.
   */
  getTangents() {
    return this._tangents;
  }
  /**
   * Returns an array populated with normal vectors on each Path3D curve point.
   * @returns an array populated with normal vectors on each Path3D curve point.
   */
  getNormals() {
    return this._normals;
  }
  /**
   * Returns an array populated with binormal vectors on each Path3D curve point.
   * @returns an array populated with binormal vectors on each Path3D curve point.
   */
  getBinormals() {
    return this._binormals;
  }
  /**
   * Returns an array populated with distances (float) of the i-th point from the first curve point.
   * @returns an array populated with distances (float) of the i-th point from the first curve point.
   */
  getDistances() {
    return this._distances;
  }
  /**
   * Returns an interpolated point along this path
   * @param position the position of the point along this path, from 0.0 to 1.0
   * @returns a new Vector3 as the point
   */
  getPointAt(e) {
    return this._updatePointAtData(e).point;
  }
  /**
   * Returns the tangent vector of an interpolated Path3D curve point at the specified position along this path.
   * @param position the position of the point along this path, from 0.0 to 1.0
   * @param interpolated (optional, default false) : boolean, if true returns an interpolated tangent instead of the tangent of the previous path point.
   * @returns a tangent vector corresponding to the interpolated Path3D curve point, if not interpolated, the tangent is taken from the precomputed tangents array.
   */
  getTangentAt(e, t = !1) {
    return this._updatePointAtData(e, t), t ? S.TransformCoordinates(S.Forward(), this._pointAtData.interpolationMatrix) : this._tangents[this._pointAtData.previousPointArrayIndex];
  }
  /**
   * Returns the tangent vector of an interpolated Path3D curve point at the specified position along this path.
   * @param position the position of the point along this path, from 0.0 to 1.0
   * @param interpolated (optional, default false) : boolean, if true returns an interpolated normal instead of the normal of the previous path point.
   * @returns a normal vector corresponding to the interpolated Path3D curve point, if not interpolated, the normal is taken from the precomputed normals array.
   */
  getNormalAt(e, t = !1) {
    return this._updatePointAtData(e, t), t ? S.TransformCoordinates(S.Right(), this._pointAtData.interpolationMatrix) : this._normals[this._pointAtData.previousPointArrayIndex];
  }
  /**
   * Returns the binormal vector of an interpolated Path3D curve point at the specified position along this path.
   * @param position the position of the point along this path, from 0.0 to 1.0
   * @param interpolated (optional, default false) : boolean, if true returns an interpolated binormal instead of the binormal of the previous path point.
   * @returns a binormal vector corresponding to the interpolated Path3D curve point, if not interpolated, the binormal is taken from the precomputed binormals array.
   */
  getBinormalAt(e, t = !1) {
    return this._updatePointAtData(e, t), t ? S.TransformCoordinates(S.UpReadOnly, this._pointAtData.interpolationMatrix) : this._binormals[this._pointAtData.previousPointArrayIndex];
  }
  /**
   * Returns the distance (float) of an interpolated Path3D curve point at the specified position along this path.
   * @param position the position of the point along this path, from 0.0 to 1.0
   * @returns the distance of the interpolated Path3D curve point at the specified position along this path.
   */
  getDistanceAt(e) {
    return this.length() * e;
  }
  /**
   * Returns the array index of the previous point of an interpolated point along this path
   * @param position the position of the point to interpolate along this path, from 0.0 to 1.0
   * @returns the array index
   */
  getPreviousPointIndexAt(e) {
    return this._updatePointAtData(e), this._pointAtData.previousPointArrayIndex;
  }
  /**
   * Returns the position of an interpolated point relative to the two path points it lies between, from 0.0 (point A) to 1.0 (point B)
   * @param position the position of the point to interpolate along this path, from 0.0 to 1.0
   * @returns the sub position
   */
  getSubPositionAt(e) {
    return this._updatePointAtData(e), this._pointAtData.subPosition;
  }
  /**
   * Returns the position of the closest virtual point on this path to an arbitrary Vector3, from 0.0 to 1.0
   * @param target the vector of which to get the closest position to
   * @returns the position of the closest virtual point on this path to the target vector
   */
  getClosestPositionTo(e) {
    let t = Number.MAX_VALUE, r = 0;
    for (let n = 0; n < this._curve.length - 1; n++) {
      const i = this._curve[n + 0], s = this._curve[n + 1].subtract(i).normalize(), a = this._distances[n + 1] - this._distances[n + 0], f = Math.min(Math.max(S.Dot(s, e.subtract(i).normalize()), 0) * S.Distance(i, e) / a, 1), o = S.Distance(i.add(s.scale(f * a)), e);
      o < t && (t = o, r = (this._distances[n + 0] + a * f) / this.length());
    }
    return r;
  }
  /**
   * Returns a sub path (slice) of this path
   * @param start the position of the fist path point, from 0.0 to 1.0, or a negative value, which will get wrapped around from the end of the path to 0.0 to 1.0 values
   * @param end the position of the last path point, from 0.0 to 1.0, or a negative value, which will get wrapped around from the end of the path to 0.0 to 1.0 values
   * @returns a sub path (slice) of this path
   */
  slice(e = 0, t = 1) {
    if (e < 0 && (e = 1 - e * -1 % 1), t < 0 && (t = 1 - t * -1 % 1), e > t) {
      const o = e;
      e = t, t = o;
    }
    const r = this.getCurve(), n = this.getPointAt(e);
    let i = this.getPreviousPointIndexAt(e);
    const s = this.getPointAt(t), a = this.getPreviousPointIndexAt(t) + 1, f = [];
    return e !== 0 && (i++, f.push(n)), f.push(...r.slice(i, a)), (t !== 1 || e === 1) && f.push(s), new vm(f, this.getNormalAt(e), this._raw, this._alignTangentsWithPath);
  }
  /**
   * Forces the Path3D tangent, normal, binormal and distance recomputation.
   * @param path path which all values are copied into the curves points
   * @param firstNormal which should be projected onto the curve
   * @param alignTangentsWithPath (optional, default false) : boolean, if true the tangents will be aligned with the path
   * @returns the same object updated.
   */
  update(e, t = null, r = !1) {
    for (let n = 0; n < e.length; n++)
      this._curve[n].x = e[n].x, this._curve[n].y = e[n].y, this._curve[n].z = e[n].z;
    return this._compute(t, r), this;
  }
  // private function compute() : computes tangents, normals and binormals
  _compute(e, t = !1) {
    const r = this._curve.length;
    if (r < 2)
      return;
    this._tangents[0] = this._getFirstNonNullVector(0), this._raw || this._tangents[0].normalize(), this._tangents[r - 1] = this._curve[r - 1].subtract(this._curve[r - 2]), this._raw || this._tangents[r - 1].normalize();
    const n = this._tangents[0], i = this._normalVector(n, e);
    this._normals[0] = i, this._raw || this._normals[0].normalize(), this._binormals[0] = S.Cross(n, this._normals[0]), this._raw || this._binormals[0].normalize(), this._distances[0] = 0;
    let s, a, f, o, d;
    for (let v = 1; v < r; v++)
      s = this._getLastNonNullVector(v), v < r - 1 && (a = this._getFirstNonNullVector(v), this._tangents[v] = t ? a : s.add(a), this._tangents[v].normalize()), this._distances[v] = this._distances[v - 1] + this._curve[v].subtract(this._curve[v - 1]).length(), f = this._tangents[v], d = this._binormals[v - 1], this._normals[v] = S.Cross(d, f), this._raw || (this._normals[v].length() === 0 ? (o = this._normals[v - 1], this._normals[v] = o.clone()) : this._normals[v].normalize()), this._binormals[v] = S.Cross(f, this._normals[v]), this._raw || this._binormals[v].normalize();
    this._pointAtData.id = NaN;
  }
  // private function getFirstNonNullVector(index)
  // returns the first non null vector from index : curve[index + N].subtract(curve[index])
  _getFirstNonNullVector(e) {
    let t = 1, r = this._curve[e + t].subtract(this._curve[e]);
    for (; r.length() === 0 && e + t + 1 < this._curve.length; )
      t++, r = this._curve[e + t].subtract(this._curve[e]);
    return r;
  }
  // private function getLastNonNullVector(index)
  // returns the last non null vector from index : curve[index].subtract(curve[index - N])
  _getLastNonNullVector(e) {
    let t = 1, r = this._curve[e].subtract(this._curve[e - t]);
    for (; r.length() === 0 && e > t + 1; )
      t++, r = this._curve[e].subtract(this._curve[e - t]);
    return r;
  }
  // private function normalVector(v0, vt, va) :
  // returns an arbitrary point in the plane defined by the point v0 and the vector vt orthogonal to this plane
  // if va is passed, it returns the va projection on the plane orthogonal to vt at the point v0
  _normalVector(e, t) {
    let r, n = e.length();
    if (n === 0 && (n = 1), t == null) {
      let i;
      Xt.WithinEpsilon(Math.abs(e.y) / n, 1, Dn) ? Xt.WithinEpsilon(Math.abs(e.x) / n, 1, Dn) ? Xt.WithinEpsilon(Math.abs(e.z) / n, 1, Dn) ? i = S.Zero() : i = new S(0, 0, 1) : i = new S(1, 0, 0) : i = new S(0, -1, 0), r = S.Cross(e, i);
    } else
      r = S.Cross(e, t), S.CrossToRef(r, e, r);
    return r.normalize(), r;
  }
  /**
   * Updates the point at data for an interpolated point along this curve
   * @param position the position of the point along this curve, from 0.0 to 1.0
   * @param interpolateTNB
   * @interpolateTNB whether to compute the interpolated tangent, normal and binormal
   * @returns the (updated) point at data
   */
  _updatePointAtData(e, t = !1) {
    if (this._pointAtData.id === e)
      return this._pointAtData.interpolateReady || this._updateInterpolationMatrix(), this._pointAtData;
    this._pointAtData.id = e;
    const r = this.getPoints();
    if (e <= 0)
      return this._setPointAtData(0, 0, r[0], 0, t);
    if (e >= 1)
      return this._setPointAtData(1, 1, r[r.length - 1], r.length - 1, t);
    let n = r[0], i, s = 0;
    const a = e * this.length();
    for (let f = 1; f < r.length; f++) {
      i = r[f];
      const o = S.Distance(n, i);
      if (s += o, s === a)
        return this._setPointAtData(e, 1, i, f, t);
      if (s > a) {
        const v = (s - a) / o, u = n.subtract(i), l = i.add(u.scaleInPlace(v));
        return this._setPointAtData(e, 1 - v, l, f - 1, t);
      }
      n = i;
    }
    return this._pointAtData;
  }
  /**
   * Updates the point at data from the specified parameters
   * @param position where along the path the interpolated point is, from 0.0 to 1.0
   * @param subPosition
   * @param point the interpolated point
   * @param parentIndex the index of an existing curve point that is on, or else positionally the first behind, the interpolated point
   * @param interpolateTNB
   */
  _setPointAtData(e, t, r, n, i) {
    return this._pointAtData.point = r, this._pointAtData.position = e, this._pointAtData.subPosition = t, this._pointAtData.previousPointArrayIndex = n, this._pointAtData.interpolateReady = i, i && this._updateInterpolationMatrix(), this._pointAtData;
  }
  /**
   * Updates the point at interpolation matrix for the tangents, normals and binormals
   */
  _updateInterpolationMatrix() {
    this._pointAtData.interpolationMatrix = he.Identity();
    const e = this._pointAtData.previousPointArrayIndex;
    if (e !== this._tangents.length - 1) {
      const t = e + 1, r = this._tangents[e].clone(), n = this._normals[e].clone(), i = this._binormals[e].clone(), s = this._tangents[t].clone(), a = this._normals[t].clone(), f = this._binormals[t].clone(), o = Ze.RotationQuaternionFromAxis(n, i, r), d = Ze.RotationQuaternionFromAxis(a, f, s);
      Ze.Slerp(o, d, this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix);
    }
  }
}
class j0 {
  /**
   * Returns a Curve3 object along a Quadratic Bezier curve : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#quadratic-bezier-curve
   * @param v0 (Vector3) the origin point of the Quadratic Bezier
   * @param v1 (Vector3) the control point
   * @param v2 (Vector3) the end point of the Quadratic Bezier
   * @param nbPoints (integer) the wanted number of points in the curve
   * @returns the created Curve3
   */
  static CreateQuadraticBezier(e, t, r, n) {
    n = n > 2 ? n : 3;
    const i = [], s = (a, f, o, d) => (1 - a) * (1 - a) * f + 2 * a * (1 - a) * o + a * a * d;
    for (let a = 0; a <= n; a++)
      i.push(new S(s(a / n, e.x, t.x, r.x), s(a / n, e.y, t.y, r.y), s(a / n, e.z, t.z, r.z)));
    return new j0(i);
  }
  /**
   * Returns a Curve3 object along a Cubic Bezier curve : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#cubic-bezier-curve
   * @param v0 (Vector3) the origin point of the Cubic Bezier
   * @param v1 (Vector3) the first control point
   * @param v2 (Vector3) the second control point
   * @param v3 (Vector3) the end point of the Cubic Bezier
   * @param nbPoints (integer) the wanted number of points in the curve
   * @returns the created Curve3
   */
  static CreateCubicBezier(e, t, r, n, i) {
    i = i > 3 ? i : 4;
    const s = [], a = (f, o, d, v, u) => (1 - f) * (1 - f) * (1 - f) * o + 3 * f * (1 - f) * (1 - f) * d + 3 * f * f * (1 - f) * v + f * f * f * u;
    for (let f = 0; f <= i; f++)
      s.push(new S(a(f / i, e.x, t.x, r.x, n.x), a(f / i, e.y, t.y, r.y, n.y), a(f / i, e.z, t.z, r.z, n.z)));
    return new j0(s);
  }
  /**
   * Returns a Curve3 object along a Hermite Spline curve : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#hermite-spline
   * @param p1 (Vector3) the origin point of the Hermite Spline
   * @param t1 (Vector3) the tangent vector at the origin point
   * @param p2 (Vector3) the end point of the Hermite Spline
   * @param t2 (Vector3) the tangent vector at the end point
   * @param nSeg (integer) the number of curve segments or nSeg + 1 points in the array
   * @returns the created Curve3
   */
  static CreateHermiteSpline(e, t, r, n, i) {
    const s = [], a = 1 / i;
    for (let f = 0; f <= i; f++)
      s.push(S.Hermite(e, t, r, n, f * a));
    return new j0(s);
  }
  /**
   * Returns a Curve3 object along a CatmullRom Spline curve :
   * @param points (array of Vector3) the points the spline must pass through. At least, four points required
   * @param nbPoints (integer) the wanted number of points between each curve control points
   * @param closed (boolean) optional with default false, when true forms a closed loop from the points
   * @returns the created Curve3
   */
  static CreateCatmullRomSpline(e, t, r) {
    const n = [], i = 1 / t;
    let s = 0;
    if (r) {
      const a = e.length;
      for (let f = 0; f < a; f++) {
        s = 0;
        for (let o = 0; o < t; o++)
          n.push(S.CatmullRom(e[f % a], e[(f + 1) % a], e[(f + 2) % a], e[(f + 3) % a], s)), s += i;
      }
      n.push(n[0]);
    } else {
      const a = [];
      a.push(e[0].clone()), Array.prototype.push.apply(a, e), a.push(e[e.length - 1].clone());
      let f = 0;
      for (; f < a.length - 3; f++) {
        s = 0;
        for (let o = 0; o < t; o++)
          n.push(S.CatmullRom(a[f], a[f + 1], a[f + 2], a[f + 3], s)), s += i;
      }
      f--, n.push(S.CatmullRom(a[f], a[f + 1], a[f + 2], a[f + 3], s));
    }
    return new j0(n);
  }
  /**
   * Returns a Curve3 object along an arc through three vector3 points:
   * The three points should not be colinear. When they are the Curve3 is empty.
   * @param first (Vector3) the first point the arc must pass through.
   * @param second (Vector3) the second point the arc must pass through.
   * @param third (Vector3) the third point the arc must pass through.
   * @param steps (number) the larger the number of steps the more detailed the arc.
   * @param closed (boolean) optional with default false, when true forms the chord from the first and third point
   * @param fullCircle Circle (boolean) optional with default false, when true forms the complete circle through the three points
   * @returns the created Curve3
   */
  static ArcThru3Points(e, t, r, n = 32, i = !1, s = !1) {
    const a = [], f = t.subtract(e), o = r.subtract(t), d = e.subtract(r), v = S.Cross(f, o), u = v.length();
    if (u < Math.pow(10, -8))
      return new j0(a);
    const l = f.lengthSquared(), P = o.lengthSquared(), p = d.lengthSquared(), c = v.lengthSquared(), H = f.length(), T = o.length(), q = d.length(), b = 0.5 * H * T * q / u, j = S.Dot(f, d), w = S.Dot(f, o), m = S.Dot(o, d), I = -0.5 * P * j / c, N = -0.5 * p * w / c, k = -0.5 * l * m / c, R = e.scale(I).add(t.scale(N)).add(r.scale(k)), O = e.subtract(R).normalize(), Y = S.Cross(v, O).normalize();
    if (s) {
      const ee = 2 * Math.PI / n;
      for (let Z = 0; Z <= 2 * Math.PI; Z += ee)
        a.push(R.add(O.scale(b * Math.cos(Z)).add(Y.scale(b * Math.sin(Z)))));
      a.push(e);
    } else {
      const ee = 1 / n;
      let Z = 0, te = S.Zero();
      do
        te = R.add(O.scale(b * Math.cos(Z)).add(Y.scale(b * Math.sin(Z)))), a.push(te), Z += ee;
      while (!te.equalsWithEpsilon(r, b * ee * 1.1));
      a.push(r), i && a.push(e);
    }
    return new j0(a);
  }
  /**
   * A Curve3 object is a logical object, so not a mesh, to handle curves in the 3D geometric space.
   * A Curve3 is designed from a series of successive Vector3.
   * Tuto : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#curve3-object
   * @param points points which make up the curve
   */
  constructor(e) {
    this._length = 0, this._points = e, this._length = this._computeLength(e);
  }
  /**
   * @returns the Curve3 stored array of successive Vector3
   */
  getPoints() {
    return this._points;
  }
  /**
   * @returns the computed length (float) of the curve.
   */
  length() {
    return this._length;
  }
  /**
   * Returns a new instance of Curve3 object : var curve = curveA.continue(curveB);
   * This new Curve3 is built by translating and sticking the curveB at the end of the curveA.
   * curveA and curveB keep unchanged.
   * @param curve the curve to continue from this curve
   * @returns the newly constructed curve
   */
  continue(e) {
    const t = this._points[this._points.length - 1], r = this._points.slice(), n = e.getPoints();
    for (let s = 1; s < n.length; s++)
      r.push(n[s].subtract(n[0]).add(t));
    return new j0(r);
  }
  _computeLength(e) {
    let t = 0;
    for (let r = 1; r < e.length; r++)
      t += e[r].subtract(e[r - 1]).length();
    return t;
  }
}
class u1 {
  constructor() {
    this._easingMode = u1.EASINGMODE_EASEIN;
  }
  /**
   * Sets the easing mode of the current function.
   * @param easingMode Defines the willing mode (EASINGMODE_EASEIN, EASINGMODE_EASEOUT or EASINGMODE_EASEINOUT)
   */
  setEasingMode(e) {
    const t = Math.min(Math.max(e, 0), 2);
    this._easingMode = t;
  }
  /**
   * Gets the current easing mode.
   * @returns the easing mode
   */
  getEasingMode() {
    return this._easingMode;
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  easeInCore(e) {
    throw new Error("You must implement this method");
  }
  /**
   * Given an input gradient between 0 and 1, this returns the corresponding value
   * of the easing function.
   * @param gradient Defines the value between 0 and 1 we want the easing value for
   * @returns the corresponding value on the curve defined by the easing function
   */
  ease(e) {
    switch (this._easingMode) {
      case u1.EASINGMODE_EASEIN:
        return this.easeInCore(e);
      case u1.EASINGMODE_EASEOUT:
        return 1 - this.easeInCore(1 - e);
    }
    return e >= 0.5 ? (1 - this.easeInCore((1 - e) * 2)) * 0.5 + 0.5 : this.easeInCore(e * 2) * 0.5;
  }
}
u1.EASINGMODE_EASEIN = 0;
u1.EASINGMODE_EASEOUT = 1;
u1.EASINGMODE_EASEINOUT = 2;
class Z$ extends u1 {
  /**
   * @internal
   */
  easeInCore(e) {
    return e = Math.max(0, Math.min(1, e)), 1 - Math.sqrt(1 - e * e);
  }
}
class _$ extends u1 {
  /**
   * Instantiates a back ease easing
   * @see https://easings.net/#easeInBack
   * @param amplitude Defines the amplitude of the function
   */
  constructor(e = 1) {
    super(), this.amplitude = e;
  }
  /**
   * @internal
   */
  easeInCore(e) {
    const t = Math.max(0, this.amplitude);
    return Math.pow(e, 3) - e * t * Math.sin(3.141592653589793 * e);
  }
}
class r6e extends u1 {
  /**
   * Instantiates a bounce easing
   * @see https://easings.net/#easeInBounce
   * @param bounces Defines the number of bounces
   * @param bounciness Defines the amplitude of the bounce
   */
  constructor(e = 3, t = 2) {
    super(), this.bounces = e, this.bounciness = t;
  }
  /**
   * @internal
   */
  easeInCore(e) {
    const t = Math.max(0, this.bounces);
    let r = this.bounciness;
    r <= 1 && (r = 1.001);
    const n = Math.pow(r, t), i = 1 - r, s = (1 - n) / i + n * 0.5, a = e * s, f = Math.log(-a * (1 - r) + 1) / Math.log(r), o = Math.floor(f), d = o + 1, v = (1 - Math.pow(r, o)) / (i * s), u = (1 - Math.pow(r, d)) / (i * s), l = (v + u) * 0.5, P = e - l, p = l - v;
    return -Math.pow(1 / r, t - o) / (p * p) * (P - p) * (P + p);
  }
}
class n6e extends u1 {
  /**
   * @internal
   */
  easeInCore(e) {
    return e * e * e;
  }
}
class i6e extends u1 {
  /**
   * Instantiates an elastic easing function
   * @see https://easings.net/#easeInElastic
   * @param oscillations Defines the number of oscillations
   * @param springiness Defines the amplitude of the oscillations
   */
  constructor(e = 3, t = 3) {
    super(), this.oscillations = e, this.springiness = t;
  }
  /**
   * @internal
   */
  easeInCore(e) {
    let t;
    const r = Math.max(0, this.oscillations), n = Math.max(0, this.springiness);
    return n == 0 ? t = e : t = (Math.exp(n * e) - 1) / (Math.exp(n) - 1), t * Math.sin((6.283185307179586 * r + 1.5707963267948966) * e);
  }
}
class $$ extends u1 {
  /**
   * Instantiates an exponential easing function
   * @see https://easings.net/#easeInExpo
   * @param exponent Defines the exponent of the function
   */
  constructor(e = 2) {
    super(), this.exponent = e;
  }
  /**
   * @internal
   */
  easeInCore(e) {
    return this.exponent <= 0 ? e : (Math.exp(this.exponent * e) - 1) / (Math.exp(this.exponent) - 1);
  }
}
class s6e extends u1 {
  /**
   * Instantiates an power base easing function
   * @see https://easings.net/#easeInQuad
   * @param power Defines the power of the function
   */
  constructor(e = 2) {
    super(), this.power = e;
  }
  /**
   * @internal
   */
  easeInCore(e) {
    const t = Math.max(0, this.power);
    return Math.pow(e, t);
  }
}
class _N extends u1 {
  /**
   * @internal
   */
  easeInCore(e) {
    return e * e;
  }
}
class a6e extends u1 {
  /**
   * @internal
   */
  easeInCore(e) {
    return e * e * e * e;
  }
}
class o6e extends u1 {
  /**
   * @internal
   */
  easeInCore(e) {
    return e * e * e * e * e;
  }
}
class $N extends u1 {
  /**
   * @internal
   */
  easeInCore(e) {
    return 1 - Math.sin(1.5707963267948966 * (1 - e));
  }
}
class f6e extends u1 {
  /**
   * Instantiates a bezier function
   * @see http://cubic-bezier.com/#.17,.67,.83,.67
   * @param x1 Defines the x component of the start tangent in the bezier curve
   * @param y1 Defines the y component of the start tangent in the bezier curve
   * @param x2 Defines the x component of the end tangent in the bezier curve
   * @param y2 Defines the y component of the end tangent in the bezier curve
   */
  constructor(e = 0, t = 0, r = 1, n = 1) {
    super(), this.x1 = e, this.y1 = t, this.x2 = r, this.y2 = n;
  }
  /**
   * @internal
   */
  easeInCore(e) {
    return z$.Interpolate(e, this.x1, this.y1, this.x2, this.y2);
  }
}
class wO {
  /**
   * Initializes the animation event
   * @param frame The frame for which the event is triggered
   * @param action The event to perform when triggered
   * @param onlyOnce Specifies if the event should be triggered only once
   */
  constructor(e, t, r) {
    this.frame = e, this.action = t, this.onlyOnce = r, this.isDone = !1;
  }
  /** @internal */
  _clone() {
    return new wO(this.frame, this.action, this.onlyOnce);
  }
}
class eee {
  /**
   * Returns the string "TargetedAnimation"
   * @returns "TargetedAnimation"
   */
  getClassName() {
    return "TargetedAnimation";
  }
  /**
   * Serialize the object
   * @returns the JSON object representing the current entity
   */
  serialize() {
    const e = {};
    return e.animation = this.animation.serialize(), e.targetId = this.target.id, e;
  }
}
class w0 {
  /**
   * Makes sure that the animations are either played or stopped according to the animation group mask.
   * Note however that the call won't have any effect if the animation group has not been started yet.
   * You should call this function if you modify the mask after the animation group has been started.
   */
  syncWithMask() {
    if (!this.mask) {
      this._numActiveAnimatables = this._targetedAnimations.length;
      return;
    }
    this._numActiveAnimatables = 0;
    for (let e = 0; e < this._animatables.length; ++e) {
      const t = this._animatables[e];
      this.mask.retainsTarget(t.target.name) ? (this._numActiveAnimatables++, t.paused && t.restart()) : t.paused || t.pause();
    }
  }
  /**
   * Removes all animations for the targets not retained by the animation group mask.
   * Use this function if you know you won't need those animations anymore and if you want to free memory.
   */
  removeUnmaskedAnimations() {
    if (this.mask) {
      for (let e = 0; e < this._animatables.length; ++e) {
        const t = this._animatables[e];
        this.mask.retainsTarget(t.target.name) || (t.stop(), this._animatables.splice(e, 1), --e);
      }
      for (let e = 0; e < this._targetedAnimations.length; e++) {
        const t = this._targetedAnimations[e];
        this.mask.retainsTarget(t.target.name) || (this._targetedAnimations.splice(e, 1), --e);
      }
    }
  }
  /**
   * Gets the first frame
   */
  get from() {
    return this._from;
  }
  /**
   * Gets the last frame
   */
  get to() {
    return this._to;
  }
  /**
   * Define if the animations are started
   */
  get isStarted() {
    return this._isStarted;
  }
  /**
   * Gets a value indicating that the current group is playing
   */
  get isPlaying() {
    return this._isStarted && !this._isPaused;
  }
  /**
   * Gets or sets the speed ratio to use for all animations
   */
  get speedRatio() {
    return this._speedRatio;
  }
  /**
   * Gets or sets the speed ratio to use for all animations
   */
  set speedRatio(e) {
    if (this._speedRatio !== e) {
      this._speedRatio = e;
      for (let t = 0; t < this._animatables.length; t++) {
        const r = this._animatables[t];
        r.speedRatio = this._speedRatio;
      }
    }
  }
  /**
   * Gets or sets if all animations should loop or not
   */
  get loopAnimation() {
    return this._loopAnimation;
  }
  set loopAnimation(e) {
    if (this._loopAnimation !== e) {
      this._loopAnimation = e;
      for (let t = 0; t < this._animatables.length; t++) {
        const r = this._animatables[t];
        r.loopAnimation = this._loopAnimation;
      }
    }
  }
  /**
   * Gets or sets if all animations should be evaluated additively
   */
  get isAdditive() {
    return this._isAdditive;
  }
  set isAdditive(e) {
    if (this._isAdditive !== e) {
      this._isAdditive = e;
      for (let t = 0; t < this._animatables.length; t++) {
        const r = this._animatables[t];
        r.isAdditive = this._isAdditive;
      }
    }
  }
  /**
   * Gets or sets the weight to apply to all animations of the group
   */
  get weight() {
    return this._weight;
  }
  set weight(e) {
    this._weight !== e && (this._weight = e, this.setWeightForAllAnimatables(this._weight));
  }
  /**
   * Gets the targeted animations for this animation group
   */
  get targetedAnimations() {
    return this._targetedAnimations;
  }
  /**
   * returning the list of animatables controlled by this animation group.
   */
  get animatables() {
    return this._animatables;
  }
  /**
   * Gets the list of target animations
   */
  get children() {
    return this._targetedAnimations;
  }
  /**
   * Gets or sets the order of play of the animation group (default: 0)
   */
  get playOrder() {
    return this._playOrder;
  }
  set playOrder(e) {
    if (this._playOrder !== e && (this._playOrder = e, this._animatables.length > 0)) {
      for (let t = 0; t < this._animatables.length; t++)
        this._animatables[t].playOrder = this._playOrder;
      this._scene.sortActiveAnimatables();
    }
  }
  /**
   * Allows the animations of the animation group to blend with current running animations
   * Note that a null value means that each animation will use their own existing blending configuration (Animation.enableBlending)
   */
  get enableBlending() {
    return this._enableBlending;
  }
  set enableBlending(e) {
    if (this._enableBlending !== e && (this._enableBlending = e, e !== null))
      for (let t = 0; t < this._targetedAnimations.length; ++t)
        this._targetedAnimations[t].animation.enableBlending = e;
  }
  /**
   * Gets or sets the animation blending speed
   * Note that a null value means that each animation will use their own existing blending configuration (Animation.blendingSpeed)
   */
  get blendingSpeed() {
    return this._blendingSpeed;
  }
  set blendingSpeed(e) {
    if (this._blendingSpeed !== e && (this._blendingSpeed = e, e !== null))
      for (let t = 0; t < this._targetedAnimations.length; ++t)
        this._targetedAnimations[t].animation.blendingSpeed = e;
  }
  /**
   * Gets the length (in seconds) of the animation group
   * This function assumes that all animations are played at the same framePerSecond speed!
   * Note: you can only call this method after you've added at least one targeted animation!
   * @param from Starting frame range (default is AnimationGroup.from)
   * @param to Ending frame range (default is AnimationGroup.to)
   * @returns The length in seconds
   */
  getLength(e, t) {
    e = e ?? this._from, t = t ?? this._to;
    const r = this.targetedAnimations[0].animation.framePerSecond * this._speedRatio;
    return (t - e) / r;
  }
  /**
   * Merge the array of animation groups into a new animation group
   * @param animationGroups List of animation groups to merge
   * @param disposeSource If true, animation groups will be disposed after being merged (default: true)
   * @param normalize If true, animation groups will be normalized before being merged, so that all animations have the same "from" and "to" frame (default: false)
   * @param weight Weight for the new animation group. If not provided, it will inherit the weight from the first animation group of the array
   * @returns The new animation group or null if no animation groups were passed
   */
  static MergeAnimationGroups(e, t = !0, r = !1, n) {
    if (e.length === 0)
      return null;
    n = n ?? e[0].weight;
    let i = Number.MAX_VALUE, s = -Number.MAX_VALUE;
    if (r)
      for (const f of e)
        f.from < i && (i = f.from), f.to > s && (s = f.to);
    const a = new w0(e[0].name + "_merged", e[0]._scene, n);
    for (const f of e) {
      r && f.normalize(i, s);
      for (const o of f.targetedAnimations)
        a.addTargetedAnimation(o.animation, o.target);
      t && f.dispose();
    }
    return a;
  }
  /**
   * Instantiates a new Animation Group.
   * This helps managing several animations at once.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations
   * @param name Defines the name of the group
   * @param scene Defines the scene the group belongs to
   * @param weight Defines the weight to use for animations in the group (-1.0 by default, meaning "no weight")
   * @param playOrder Defines the order of play of the animation group (default is 0)
   */
  constructor(e, t = null, r = -1, n = 0) {
    this.name = e, this._targetedAnimations = new Array(), this._animatables = new Array(), this._from = Number.MAX_VALUE, this._to = -Number.MAX_VALUE, this._speedRatio = 1, this._loopAnimation = !1, this._isAdditive = !1, this._weight = -1, this._playOrder = 0, this._enableBlending = null, this._blendingSpeed = null, this._numActiveAnimatables = 0, this._parentContainer = null, this.onAnimationEndObservable = new Oe(), this.onAnimationLoopObservable = new Oe(), this.onAnimationGroupLoopObservable = new Oe(), this.onAnimationGroupEndObservable = new Oe(), this.onAnimationGroupPauseObservable = new Oe(), this.onAnimationGroupPlayObservable = new Oe(), this.metadata = null, this._animationLoopFlags = [], this._scene = t || gr.LastCreatedScene, this._weight = r, this._playOrder = n, this.uniqueId = this._scene.getUniqueId(), this._scene.addAnimationGroup(this);
  }
  /**
   * Add an animation (with its target) in the group
   * @param animation defines the animation we want to add
   * @param target defines the target of the animation
   * @returns the TargetedAnimation object
   */
  addTargetedAnimation(e, t) {
    const r = new eee();
    r.animation = e, r.target = t;
    const n = e.getKeys();
    return this._from > n[0].frame && (this._from = n[0].frame), this._to < n[n.length - 1].frame && (this._to = n[n.length - 1].frame), this._enableBlending !== null && (e.enableBlending = this._enableBlending), this._blendingSpeed !== null && (e.blendingSpeed = this._blendingSpeed), this._targetedAnimations.push(r), r;
  }
  /**
   * Remove an animation from the group
   * @param animation defines the animation we want to remove
   */
  removeTargetedAnimation(e) {
    for (let t = this._targetedAnimations.length - 1; t > -1; t--)
      this._targetedAnimations[t].animation === e && this._targetedAnimations.splice(t, 1);
  }
  /**
   * This function will normalize every animation in the group to make sure they all go from beginFrame to endFrame
   * It can add constant keys at begin or end
   * @param beginFrame defines the new begin frame for all animations or the smallest begin frame of all animations if null (defaults to null)
   * @param endFrame defines the new end frame for all animations or the largest end frame of all animations if null (defaults to null)
   * @returns the animation group
   */
  normalize(e = null, t = null) {
    e == null && (e = this._from), t == null && (t = this._to);
    for (let r = 0; r < this._targetedAnimations.length; r++) {
      const i = this._targetedAnimations[r].animation.getKeys(), s = i[0], a = i[i.length - 1];
      if (s.frame > e) {
        const f = {
          frame: e,
          value: s.value,
          inTangent: s.inTangent,
          outTangent: s.outTangent,
          interpolation: s.interpolation
        };
        i.splice(0, 0, f);
      }
      if (a.frame < t) {
        const f = {
          frame: t,
          value: a.value,
          inTangent: a.inTangent,
          outTangent: a.outTangent,
          interpolation: a.interpolation
        };
        i.push(f);
      }
    }
    return this._from = e, this._to = t, this;
  }
  _processLoop(e, t, r) {
    e.onAnimationLoop = () => {
      this.onAnimationLoopObservable.notifyObservers(t), !this._animationLoopFlags[r] && (this._animationLoopFlags[r] = !0, this._animationLoopCount++, this._animationLoopCount === this._numActiveAnimatables && (this.onAnimationGroupLoopObservable.notifyObservers(this), this._animationLoopCount = 0, this._animationLoopFlags.length = 0));
    };
  }
  /**
   * Start all animations on given targets
   * @param loop defines if animations must loop
   * @param speedRatio defines the ratio to apply to animation speed (1 by default)
   * @param from defines the from key (optional)
   * @param to defines the to key (optional)
   * @param isAdditive defines the additive state for the resulting animatables (optional)
   * @returns the current animation group
   */
  start(e = !1, t = 1, r, n, i) {
    if (this._isStarted || this._targetedAnimations.length === 0)
      return this;
    this._loopAnimation = e, this._animationLoopCount = 0, this._animationLoopFlags.length = 0;
    for (let s = 0; s < this._targetedAnimations.length; s++) {
      const a = this._targetedAnimations[s], f = this._scene.beginDirectAnimation(a.target, [a.animation], r !== void 0 ? r : this._from, n !== void 0 ? n : this._to, e, t, void 0, void 0, i !== void 0 ? i : this._isAdditive);
      f.weight = this._weight, f.playOrder = this._playOrder, f.onAnimationEnd = () => {
        this.onAnimationEndObservable.notifyObservers(a), this._checkAnimationGroupEnded(f);
      }, this._processLoop(f, a, s), this._animatables.push(f);
    }
    return this.syncWithMask(), this._scene.sortActiveAnimatables(), this._speedRatio = t, this._isStarted = !0, this._isPaused = !1, this.onAnimationGroupPlayObservable.notifyObservers(this), this;
  }
  /**
   * Pause all animations
   * @returns the animation group
   */
  pause() {
    if (!this._isStarted)
      return this;
    this._isPaused = !0;
    for (let e = 0; e < this._animatables.length; e++)
      this._animatables[e].pause();
    return this.onAnimationGroupPauseObservable.notifyObservers(this), this;
  }
  /**
   * Play all animations to initial state
   * This function will start() the animations if they were not started or will restart() them if they were paused
   * @param loop defines if animations must loop
   * @returns the animation group
   */
  play(e) {
    return this.isStarted && this._animatables.length === this._targetedAnimations.length ? (e !== void 0 && (this.loopAnimation = e), this.restart()) : (this.stop(), this.start(e, this._speedRatio)), this._isPaused = !1, this;
  }
  /**
   * Reset all animations to initial state
   * @returns the animation group
   */
  reset() {
    if (!this._isStarted)
      return this.play(), this.goToFrame(0), this.stop(), this;
    for (let e = 0; e < this._animatables.length; e++)
      this._animatables[e].reset();
    return this;
  }
  /**
   * Restart animations from key 0
   * @returns the animation group
   */
  restart() {
    if (!this._isStarted)
      return this;
    for (let e = 0; e < this._animatables.length; e++)
      this._animatables[e].restart();
    return this.onAnimationGroupPlayObservable.notifyObservers(this), this;
  }
  /**
   * Stop all animations
   * @returns the animation group
   */
  stop() {
    if (!this._isStarted)
      return this;
    const e = this._animatables.slice();
    for (let r = 0; r < e.length; r++)
      e[r].stop(void 0, void 0, !0);
    let t = 0;
    for (let r = 0; r < this._scene._activeAnimatables.length; r++) {
      const n = this._scene._activeAnimatables[r];
      n._runtimeAnimations.length > 0 && (this._scene._activeAnimatables[t++] = n);
    }
    return this._scene._activeAnimatables.length = t, this._isStarted = !1, this;
  }
  /**
   * Set animation weight for all animatables
   *
   * @since 6.12.4
   *  You can pass the weight to the AnimationGroup constructor, or use the weight property to set it after the group has been created,
   *  making it easier to define the overall animation weight than calling setWeightForAllAnimatables() after the animation group has been started
   * @param weight defines the weight to use
   * @returns the animationGroup
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-weights
   */
  setWeightForAllAnimatables(e) {
    for (let t = 0; t < this._animatables.length; t++) {
      const r = this._animatables[t];
      r.weight = e;
    }
    return this;
  }
  /**
   * Synchronize and normalize all animatables with a source animatable
   * @param root defines the root animatable to synchronize with (null to stop synchronizing)
   * @returns the animationGroup
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-weights
   */
  syncAllAnimationsWith(e) {
    for (let t = 0; t < this._animatables.length; t++)
      this._animatables[t].syncWith(e);
    return this;
  }
  /**
   * Goes to a specific frame in this animation group
   * @param frame the frame number to go to
   * @returns the animationGroup
   */
  goToFrame(e) {
    if (!this._isStarted)
      return this;
    for (let t = 0; t < this._animatables.length; t++)
      this._animatables[t].goToFrame(e);
    return this;
  }
  /**
   * Dispose all associated resources
   */
  dispose() {
    this._targetedAnimations.length = 0, this._animatables.length = 0;
    const e = this._scene.animationGroups.indexOf(this);
    if (e > -1 && this._scene.animationGroups.splice(e, 1), this._parentContainer) {
      const t = this._parentContainer.animationGroups.indexOf(this);
      t > -1 && this._parentContainer.animationGroups.splice(t, 1), this._parentContainer = null;
    }
    this.onAnimationEndObservable.clear(), this.onAnimationGroupEndObservable.clear(), this.onAnimationGroupPauseObservable.clear(), this.onAnimationGroupPlayObservable.clear(), this.onAnimationLoopObservable.clear(), this.onAnimationGroupLoopObservable.clear();
  }
  _checkAnimationGroupEnded(e) {
    const t = this._animatables.indexOf(e);
    t > -1 && this._animatables.splice(t, 1), this._animatables.length === 0 && (this._isStarted = !1, this.onAnimationGroupEndObservable.notifyObservers(this));
  }
  /**
   * Clone the current animation group and returns a copy
   * @param newName defines the name of the new group
   * @param targetConverter defines an optional function used to convert current animation targets to new ones
   * @param cloneAnimations defines if the animations should be cloned or referenced
   * @returns the new animation group
   */
  clone(e, t, r = !1) {
    const n = new w0(e || this.name, this._scene, this._weight, this._playOrder);
    n._from = this.from, n._to = this.to, n._speedRatio = this.speedRatio, n._loopAnimation = this.loopAnimation, n._isAdditive = this.isAdditive, n._enableBlending = this.enableBlending, n._blendingSpeed = this.blendingSpeed, n.metadata = this.metadata, n.mask = this.mask;
    for (const i of this._targetedAnimations)
      n.addTargetedAnimation(r ? i.animation.clone() : i.animation, t ? t(i.target) : i.target);
    return n;
  }
  /**
   * Serializes the animationGroup to an object
   * @returns Serialized object
   */
  serialize() {
    const e = {};
    e.name = this.name, e.from = this.from, e.to = this.to, e.speedRatio = this.speedRatio, e.loopAnimation = this.loopAnimation, e.isAdditive = this.isAdditive, e.weight = this.weight, e.playOrder = this.playOrder, e.enableBlending = this.enableBlending, e.blendingSpeed = this.blendingSpeed, e.targetedAnimations = [];
    for (let t = 0; t < this.targetedAnimations.length; t++) {
      const r = this.targetedAnimations[t];
      e.targetedAnimations[t] = r.serialize();
    }
    return Zi && Zi.HasTags(this) && (e.tags = Zi.GetTags(this)), this.metadata && (e.metadata = this.metadata), e;
  }
  // Statics
  /**
   * Returns a new AnimationGroup object parsed from the source provided.
   * @param parsedAnimationGroup defines the source
   * @param scene defines the scene that will receive the animationGroup
   * @returns a new AnimationGroup
   */
  static Parse(e, t) {
    const r = new w0(e.name, t, e.weight, e.playOrder);
    for (let n = 0; n < e.targetedAnimations.length; n++) {
      const i = e.targetedAnimations[n], s = st.Parse(i.animation), a = i.targetId;
      if (i.animation.property === "influence") {
        const f = t.getMorphTargetById(a);
        f && r.addTargetedAnimation(s, f);
      } else {
        const f = t.getNodeById(a);
        f != null && r.addTargetedAnimation(s, f);
      }
    }
    return Zi && Zi.AddTagsTo(r, e.tags), e.from !== null && e.to !== null && r.normalize(e.from, e.to), e.speedRatio !== void 0 && (r._speedRatio = e.speedRatio), e.loopAnimation !== void 0 && (r._loopAnimation = e.loopAnimation), e.isAdditive !== void 0 && (r._isAdditive = e.isAdditive), e.weight !== void 0 && (r._weight = e.weight), e.playOrder !== void 0 && (r._playOrder = e.playOrder), e.enableBlending !== void 0 && (r._enableBlending = e.enableBlending), e.blendingSpeed !== void 0 && (r._blendingSpeed = e.blendingSpeed), e.metadata !== void 0 && (r.metadata = e.metadata), r;
  }
  /** @internal */
  static MakeAnimationAdditive(e, t, r, n = !1, i) {
    let s;
    typeof t == "object" ? s = t : s = {
      referenceFrame: t,
      range: r,
      cloneOriginalAnimationGroup: n,
      clonedAnimationName: i
    };
    let a = e;
    s.cloneOriginalAnimationGroup && (a = e.clone(s.clonedAnimationGroupName || a.name));
    const f = a.targetedAnimations;
    for (let o = 0; o < f.length; o++) {
      const d = f[o];
      d.animation = st.MakeAnimationAdditive(d.animation, s);
    }
    if (a.isAdditive = !0, s.clipKeys) {
      let o = Number.MAX_VALUE, d = -Number.MAX_VALUE;
      const v = a.targetedAnimations;
      for (let u = 0; u < v.length; u++) {
        const p = v[u].animation.getKeys();
        o > p[0].frame && (o = p[0].frame), d < p[p.length - 1].frame && (d = p[p.length - 1].frame);
      }
      a._from = o, a._to = d;
    }
    return a;
  }
  /**
   * Creates a new animation, keeping only the keys that are inside a given key range
   * @param sourceAnimationGroup defines the animation group on which to operate
   * @param fromKey defines the lower bound of the range
   * @param toKey defines the upper bound of the range
   * @param name defines the name of the new animation group. If not provided, use the same name as animationGroup
   * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned
   * @returns a new animation group stripped from all the keys outside the given range
   */
  static ClipKeys(e, t, r, n, i) {
    const s = e.clone(n || e.name);
    return w0.ClipKeysInPlace(s, t, r, i);
  }
  /**
   * Updates an existing animation, keeping only the keys that are inside a given key range
   * @param animationGroup defines the animation group on which to operate
   * @param fromKey defines the lower bound of the range
   * @param toKey defines the upper bound of the range
   * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned
   * @returns the animationGroup stripped from all the keys outside the given range
   */
  static ClipKeysInPlace(e, t, r, n) {
    return w0.ClipInPlace(e, t, r, n, !1);
  }
  /**
   * Creates a new animation, keeping only the frames that are inside a given frame range
   * @param sourceAnimationGroup defines the animation group on which to operate
   * @param fromFrame defines the lower bound of the range
   * @param toFrame defines the upper bound of the range
   * @param name defines the name of the new animation group. If not provided, use the same name as animationGroup
   * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the frames. Default is false, so animations will be cloned
   * @returns a new animation group stripped from all the frames outside the given range
   */
  static ClipFrames(e, t, r, n, i) {
    const s = e.clone(n || e.name);
    return w0.ClipFramesInPlace(s, t, r, i);
  }
  /**
   * Updates an existing animation, keeping only the frames that are inside a given frame range
   * @param animationGroup defines the animation group on which to operate
   * @param fromFrame defines the lower bound of the range
   * @param toFrame defines the upper bound of the range
   * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the frames. Default is false, so animations will be cloned
   * @returns the animationGroup stripped from all the frames outside the given range
   */
  static ClipFramesInPlace(e, t, r, n) {
    return w0.ClipInPlace(e, t, r, n, !0);
  }
  /**
   * Updates an existing animation, keeping only the keys that are inside a given key or frame range
   * @param animationGroup defines the animation group on which to operate
   * @param start defines the lower bound of the range
   * @param end defines the upper bound of the range
   * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned
   * @param useFrame defines if the range is defined by frame numbers or key indices (default is false which means use key indices)
   * @returns the animationGroup stripped from all the keys outside the given range
   */
  static ClipInPlace(e, t, r, n, i = !1) {
    let s = Number.MAX_VALUE, a = -Number.MAX_VALUE;
    const f = e.targetedAnimations;
    for (let o = 0; o < f.length; o++) {
      const d = f[o], v = n ? d.animation : d.animation.clone();
      i && (v.createKeyForFrame(t), v.createKeyForFrame(r));
      const u = v.getKeys(), l = [];
      let P = Number.MAX_VALUE;
      for (let p = 0; p < u.length; p++) {
        const c = u[p];
        if (!i && p >= t && p <= r || i && c.frame >= t && c.frame <= r) {
          const H = {
            frame: c.frame,
            value: c.value.clone ? c.value.clone() : c.value,
            inTangent: c.inTangent,
            outTangent: c.outTangent,
            interpolation: c.interpolation,
            lockedTangent: c.lockedTangent
          };
          P === Number.MAX_VALUE && (P = H.frame), H.frame -= P, l.push(H);
        }
      }
      if (l.length === 0) {
        f.splice(o, 1), o--;
        continue;
      }
      s > l[0].frame && (s = l[0].frame), a < l[l.length - 1].frame && (a = l[l.length - 1].frame), v.setKeys(l, !0), d.animation = v;
    }
    return e._from = s, e._to = a, e;
  }
  /**
   * Returns the string "AnimationGroup"
   * @returns "AnimationGroup"
   */
  getClassName() {
    return "AnimationGroup";
  }
  /**
   * Creates a detailed string about the object
   * @param fullDetails defines if the output string will support multiple levels of logging within scene loading
   * @returns a string representing the object
   */
  toString(e) {
    let t = "Name: " + this.name;
    return t += ", type: " + this.getClassName(), e && (t += ", from: " + this._from, t += ", to: " + this._to, t += ", isStarted: " + this._isStarted, t += ", speedRatio: " + this._speedRatio, t += ", targetedAnimations length: " + this._targetedAnimations.length, t += ", animatables length: " + this._animatables), t;
  }
}
class A6e {
  /**
   * Initializes the path cursor
   * @param _path The path to track
   */
  constructor(e) {
    this._path = e, this._onchange = new Array(), this.value = 0, this.animations = [];
  }
  /**
   * Gets the cursor point on the path
   * @returns A point on the path cursor at the cursor location
   */
  getPoint() {
    const e = this._path.getPointAtLengthPosition(this.value);
    return new S(e.x, 0, e.y);
  }
  /**
   * Moves the cursor ahead by the step amount
   * @param step The amount to move the cursor forward
   * @returns This path cursor
   */
  moveAhead(e = 2e-3) {
    return this.move(e), this;
  }
  /**
   * Moves the cursor behind by the step amount
   * @param step The amount to move the cursor back
   * @returns This path cursor
   */
  moveBack(e = 2e-3) {
    return this.move(-e), this;
  }
  /**
   * Moves the cursor by the step amount
   * If the step amount is greater than one, an exception is thrown
   * @param step The amount to move the cursor
   * @returns This path cursor
   */
  move(e) {
    if (Math.abs(e) > 1)
      throw "step size should be less than 1.";
    return this.value += e, this._ensureLimits(), this._raiseOnChange(), this;
  }
  /**
   * Ensures that the value is limited between zero and one
   * @returns This path cursor
   */
  _ensureLimits() {
    for (; this.value > 1; )
      this.value -= 1;
    for (; this.value < 0; )
      this.value += 1;
    return this;
  }
  /**
   * Runs onchange callbacks on change (used by the animation engine)
   * @returns This path cursor
   */
  _raiseOnChange() {
    return this._onchange.forEach((e) => e(this)), this;
  }
  /**
   * Executes a function on change
   * @param f A path cursor onchange callback
   * @returns This path cursor
   */
  onchange(e) {
    return this._onchange.push(e), this;
  }
}
var EI;
(function(A) {
  A[A.Include = 0] = "Include", A[A.Exclude = 1] = "Exclude";
})(EI || (EI = {}));
class d6e {
  /**
   * Creates a new mask
   * @param names The list of target names to add to the mask (optional)
   * @param mode Defines the mode for the mask (default: AnimationGroupMaskMode.Include)
   */
  constructor(e, t = EI.Include) {
    this.mode = t, this._targetNames = /* @__PURE__ */ new Set(), e && this.addTargetName(e);
  }
  /**
   * Adds one or several target names to the mask
   * @param name The name(s) to add to the mask
   */
  addTargetName(e) {
    if (Array.isArray(e)) {
      for (const t of e)
        this._targetNames.add(t);
      return;
    }
    this._targetNames.add(e);
  }
  /**
   * Removes one or several target names from the mask
   * @param name The name(s) to remove from the mask
   */
  removeTargetName(e) {
    if (Array.isArray(e)) {
      for (const t of e)
        this._targetNames.delete(t);
      return;
    }
    this._targetNames.delete(e);
  }
  /**
   * Checks if the mask includes a target name.
   * This method is intended to know if a given target name is included in the mask, not if the name is actually retained by the mask (see retainsTarget() instead).
   * @param name The name to check with the mask
   * @returns True if the mask includes the name, false otherwise
   */
  hasTarget(e) {
    return this._targetNames.has(e);
  }
  /**
   * Checks if the mask retains a target name.
   * Note that in the "Exclude" mode, this will return false if the mask includes the name, and true otherwise!
   * This method is intended to know if a given target name is retained by the mask, not if the name is in the list of target names.
   * @param name The name to check with the mask
   * @returns True if the mask retains the name, false otherwise
   */
  retainsTarget(e) {
    return this._targetNames.has(e) === (this.mode === EI.Include);
  }
}
function FI(A, e, t) {
  try {
    const r = A.next();
    r.done ? e(r) : r.value ? r.value.then(() => {
      r.value = void 0, e(r);
    }, t) : e(r);
  } catch (r) {
    t(r);
  }
}
function tee(A = 25) {
  let e;
  return (t, r, n) => {
    const i = performance.now();
    e === void 0 || i - e > A ? (e = i, setTimeout(() => {
      FI(t, r, n);
    }, 0)) : FI(t, r, n);
  };
}
function eQ(A, e, t, r, n) {
  const i = () => {
    let s;
    const a = (f) => {
      f.done ? t(f.value) : s === void 0 ? s = !0 : i();
    };
    do
      s = void 0, !n || !n.aborted ? e(A, a, r) : r(new Error("Aborted")), s === void 0 && (s = !1);
    while (s);
  };
  i();
}
function mO(A, e) {
  let t;
  return eQ(A, FI, (r) => t = r, (r) => {
    throw r;
  }, e), t;
}
function BO(A, e, t) {
  return new Promise((r, n) => {
    eQ(A, e, r, n, t);
  });
}
function ree(A, e) {
  return (...t) => mO(A(...t), e);
}
function v6e(A, e, t) {
  return (...r) => BO(A(...r), e, t);
}
class WA {
  /**
   * Creates a Viewport object located at (x, y) and sized (width, height)
   * @param x defines viewport left coordinate
   * @param y defines viewport top coordinate
   * @param width defines the viewport width
   * @param height defines the viewport height
   */
  constructor(e, t, r, n) {
    this.x = e, this.y = t, this.width = r, this.height = n;
  }
  /**
   * Creates a new viewport using absolute sizing (from 0-> width, 0-> height instead of 0->1)
   * @param renderWidth defines the rendering width
   * @param renderHeight defines the rendering height
   * @returns a new Viewport
   */
  toGlobal(e, t) {
    return new WA(this.x * e, this.y * t, this.width * e, this.height * t);
  }
  /**
   * Stores absolute viewport value into a target viewport (from 0-> width, 0-> height instead of 0->1)
   * @param renderWidth defines the rendering width
   * @param renderHeight defines the rendering height
   * @param ref defines the target viewport
   * @returns the current viewport
   */
  toGlobalToRef(e, t, r) {
    return r.x = this.x * e, r.y = this.y * t, r.width = this.width * e, r.height = this.height * t, this;
  }
  /**
   * Returns a new Viewport copied from the current one
   * @returns a new Viewport
   */
  clone() {
    return new WA(this.x, this.y, this.width, this.height);
  }
}
class Tr extends Cs {
  /**
   * Define the current local position of the camera in the scene
   */
  get position() {
    return this._position;
  }
  set position(e) {
    this._position = e;
  }
  /**
   * The vector the camera should consider as up.
   * (default is Vector3(0, 1, 0) aka Vector3.Up())
   */
  set upVector(e) {
    this._upVector = e;
  }
  get upVector() {
    return this._upVector;
  }
  /**
   * The screen area in scene units squared
   */
  get screenArea() {
    var e, t, r, n;
    let i = 0, s = 0;
    if (this.mode === Tr.PERSPECTIVE_CAMERA)
      this.fovMode === Tr.FOVMODE_VERTICAL_FIXED ? (s = this.minZ * 2 * Math.tan(this.fov / 2), i = this.getEngine().getAspectRatio(this) * s) : (i = this.minZ * 2 * Math.tan(this.fov / 2), s = i / this.getEngine().getAspectRatio(this));
    else {
      const a = this.getEngine().getRenderWidth() / 2, f = this.getEngine().getRenderHeight() / 2;
      i = ((e = this.orthoRight) !== null && e !== void 0 ? e : a) - ((t = this.orthoLeft) !== null && t !== void 0 ? t : -a), s = ((r = this.orthoTop) !== null && r !== void 0 ? r : f) - ((n = this.orthoBottom) !== null && n !== void 0 ? n : -f);
    }
    return i * s;
  }
  set orthoLeft(e) {
    this._orthoLeft = e;
    for (const t of this._rigCameras)
      t.orthoLeft = e;
  }
  get orthoLeft() {
    return this._orthoLeft;
  }
  set orthoRight(e) {
    this._orthoRight = e;
    for (const t of this._rigCameras)
      t.orthoRight = e;
  }
  get orthoRight() {
    return this._orthoRight;
  }
  set orthoBottom(e) {
    this._orthoBottom = e;
    for (const t of this._rigCameras)
      t.orthoBottom = e;
  }
  get orthoBottom() {
    return this._orthoBottom;
  }
  set orthoTop(e) {
    this._orthoTop = e;
    for (const t of this._rigCameras)
      t.orthoTop = e;
  }
  get orthoTop() {
    return this._orthoTop;
  }
  set mode(e) {
    this._mode = e;
    for (const t of this._rigCameras)
      t.mode = e;
  }
  get mode() {
    return this._mode;
  }
  /**
   * Instantiates a new camera object.
   * This should not be used directly but through the inherited cameras: ArcRotate, Free...
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
   * @param name Defines the name of the camera in the scene
   * @param position Defines the position of the camera
   * @param scene Defines the scene the camera belongs too
   * @param setActiveOnSceneIfNoneActive Defines if the camera should be set as active after creation if no other camera have been defined in the scene
   */
  constructor(e, t, r, n = !0) {
    super(e, r), this._position = S.Zero(), this._upVector = S.Up(), this.oblique = null, this._orthoLeft = null, this._orthoRight = null, this._orthoBottom = null, this._orthoTop = null, this.fov = 0.8, this.projectionPlaneTilt = 0, this.minZ = 1, this.maxZ = 1e4, this.inertia = 0.9, this._mode = Tr.PERSPECTIVE_CAMERA, this.isIntermediate = !1, this.viewport = new WA(0, 0, 1, 1), this.layerMask = 268435455, this.fovMode = Tr.FOVMODE_VERTICAL_FIXED, this.cameraRigMode = Tr.RIG_MODE_NONE, this.customRenderTargets = [], this.outputRenderTarget = null, this.onViewMatrixChangedObservable = new Oe(), this.onProjectionMatrixChangedObservable = new Oe(), this.onAfterCheckInputsObservable = new Oe(), this.onRestoreStateObservable = new Oe(), this.isRigCamera = !1, this._rigCameras = new Array(), this._skipRendering = !1, this._projectionMatrix = new he(), this._postProcesses = new Array(), this._activeMeshes = new qf(256), this._globalPosition = S.Zero(), this._computedViewMatrix = he.Identity(), this._doNotComputeProjectionMatrix = !1, this._transformMatrix = he.Zero(), this._refreshFrustumPlanes = !0, this._absoluteRotation = Ze.Identity(), this._isCamera = !0, this._isLeftCamera = !1, this._isRightCamera = !1, this.getScene().addCamera(this), n && !this.getScene().activeCamera && (this.getScene().activeCamera = this), this.position = t, this.renderPassId = this.getScene().getEngine().createRenderPassId(`Camera ${e}`);
  }
  /**
   * Store current camera state (fov, position, etc..)
   * @returns the camera
   */
  storeState() {
    return this._stateStored = !0, this._storedFov = this.fov, this;
  }
  /**
   * Restores the camera state values if it has been stored. You must call storeState() first
   */
  _restoreStateValues() {
    return this._stateStored ? (this.fov = this._storedFov, !0) : !1;
  }
  /**
   * Restored camera state. You must call storeState() first.
   * @returns true if restored and false otherwise
   */
  restoreState() {
    return this._restoreStateValues() ? (this.onRestoreStateObservable.notifyObservers(this), !0) : !1;
  }
  /**
   * Gets the class name of the camera.
   * @returns the class name
   */
  getClassName() {
    return "Camera";
  }
  /**
   * Gets a string representation of the camera useful for debug purpose.
   * @param fullDetails Defines that a more verbose level of logging is required
   * @returns the string representation
   */
  toString(e) {
    let t = "Name: " + this.name;
    if (t += ", type: " + this.getClassName(), this.animations)
      for (let r = 0; r < this.animations.length; r++)
        t += ", animation[0]: " + this.animations[r].toString(e);
    return t;
  }
  /**
   * Automatically tilts the projection plane, using `projectionPlaneTilt`, to correct the perspective effect on vertical lines.
   */
  applyVerticalCorrection() {
    const e = this.absoluteRotation.toEulerAngles();
    this.projectionPlaneTilt = this._scene.useRightHandedSystem ? -e.x : e.x;
  }
  /**
   * Gets the current world space position of the camera.
   */
  get globalPosition() {
    return this._globalPosition;
  }
  /**
   * Gets the list of active meshes this frame (meshes no culled or excluded by lod s in the frame)
   * @returns the active meshe list
   */
  getActiveMeshes() {
    return this._activeMeshes;
  }
  /**
   * Check whether a mesh is part of the current active mesh list of the camera
   * @param mesh Defines the mesh to check
   * @returns true if active, false otherwise
   */
  isActiveMesh(e) {
    return this._activeMeshes.indexOf(e) !== -1;
  }
  /**
   * Is this camera ready to be used/rendered
   * @param completeCheck defines if a complete check (including post processes) has to be done (false by default)
   * @returns true if the camera is ready
   */
  isReady(e = !1) {
    if (e) {
      for (const t of this._postProcesses)
        if (t && !t.isReady())
          return !1;
    }
    return super.isReady(e);
  }
  /** @internal */
  _initCache() {
    super._initCache(), this._cache.position = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.upVector = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.mode = void 0, this._cache.minZ = void 0, this._cache.maxZ = void 0, this._cache.fov = void 0, this._cache.fovMode = void 0, this._cache.aspectRatio = void 0, this._cache.orthoLeft = void 0, this._cache.orthoRight = void 0, this._cache.orthoBottom = void 0, this._cache.orthoTop = void 0, this._cache.obliqueAngle = void 0, this._cache.obliqueLength = void 0, this._cache.obliqueOffset = void 0, this._cache.renderWidth = void 0, this._cache.renderHeight = void 0;
  }
  /**
   * @internal
   */
  _updateCache(e) {
    e || super._updateCache(), this._cache.position.copyFrom(this.position), this._cache.upVector.copyFrom(this.upVector);
  }
  /** @internal */
  _isSynchronized() {
    return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();
  }
  /** @internal */
  _isSynchronizedViewMatrix() {
    return super._isSynchronized() ? this._cache.position.equals(this.position) && this._cache.upVector.equals(this.upVector) && this.isSynchronizedWithParent() : !1;
  }
  /** @internal */
  _isSynchronizedProjectionMatrix() {
    let e = this._cache.mode === this.mode && this._cache.minZ === this.minZ && this._cache.maxZ === this.maxZ;
    if (!e)
      return !1;
    const t = this.getEngine();
    return this.mode === Tr.PERSPECTIVE_CAMERA ? e = this._cache.fov === this.fov && this._cache.fovMode === this.fovMode && this._cache.aspectRatio === t.getAspectRatio(this) && this._cache.projectionPlaneTilt === this.projectionPlaneTilt : (e = this._cache.orthoLeft === this.orthoLeft && this._cache.orthoRight === this.orthoRight && this._cache.orthoBottom === this.orthoBottom && this._cache.orthoTop === this.orthoTop && this._cache.renderWidth === t.getRenderWidth() && this._cache.renderHeight === t.getRenderHeight(), this.oblique && (e = e && this._cache.obliqueAngle === this.oblique.angle && this._cache.obliqueLength === this.oblique.length && this._cache.obliqueOffset === this.oblique.offset)), e;
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * This function is here because typescript removes the typing of the last function.
   * @param _ignored defines an ignored parameter kept for backward compatibility.
   * @param _noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e, t) {
  }
  /**
   * Detach the current controls from the specified dom element.
   * This function is here because typescript removes the typing of the last function.
   * @param _ignored defines an ignored parameter kept for backward compatibility.
   */
  detachControl(e) {
  }
  /**
   * Update the camera state according to the different inputs gathered during the frame.
   */
  update() {
    this._checkInputs(), this.cameraRigMode !== Tr.RIG_MODE_NONE && this._updateRigCameras(), this.getViewMatrix(), this.getProjectionMatrix();
  }
  /** @internal */
  _checkInputs() {
    this.onAfterCheckInputsObservable.notifyObservers(this);
  }
  /** @internal */
  get rigCameras() {
    return this._rigCameras;
  }
  /**
   * Gets the post process used by the rig cameras
   */
  get rigPostProcess() {
    return this._rigPostProcess;
  }
  /**
   * Internal, gets the first post process.
   * @returns the first post process to be run on this camera.
   */
  _getFirstPostProcess() {
    for (let e = 0; e < this._postProcesses.length; e++)
      if (this._postProcesses[e] !== null)
        return this._postProcesses[e];
    return null;
  }
  _cascadePostProcessesToRigCams() {
    const e = this._getFirstPostProcess();
    e && e.markTextureDirty();
    for (let t = 0, r = this._rigCameras.length; t < r; t++) {
      const n = this._rigCameras[t], i = n._rigPostProcess;
      i ? (i.getEffectName() === "pass" && (n.isIntermediate = this._postProcesses.length === 0), n._postProcesses = this._postProcesses.slice(0).concat(i), i.markTextureDirty()) : n._postProcesses = this._postProcesses.slice(0);
    }
  }
  /**
   * Attach a post process to the camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess
   * @param postProcess The post process to attach to the camera
   * @param insertAt The position of the post process in case several of them are in use in the scene
   * @returns the position the post process has been inserted at
   */
  attachPostProcess(e, t = null) {
    return !e.isReusable() && this._postProcesses.indexOf(e) > -1 ? (Se.Error("You're trying to reuse a post process not defined as reusable."), 0) : (t == null || t < 0 ? this._postProcesses.push(e) : this._postProcesses[t] === null ? this._postProcesses[t] = e : this._postProcesses.splice(t, 0, e), this._cascadePostProcessesToRigCams(), this._scene.prePassRenderer && this._scene.prePassRenderer.markAsDirty(), this._postProcesses.indexOf(e));
  }
  /**
   * Detach a post process to the camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess
   * @param postProcess The post process to detach from the camera
   */
  detachPostProcess(e) {
    const t = this._postProcesses.indexOf(e);
    t !== -1 && (this._postProcesses[t] = null), this._scene.prePassRenderer && this._scene.prePassRenderer.markAsDirty(), this._cascadePostProcessesToRigCams();
  }
  /**
   * Gets the current world matrix of the camera
   */
  getWorldMatrix() {
    return this._isSynchronizedViewMatrix() ? this._worldMatrix : (this.getViewMatrix(), this._worldMatrix);
  }
  /** @internal */
  _getViewMatrix() {
    return he.Identity();
  }
  /**
   * Gets the current view matrix of the camera.
   * @param force forces the camera to recompute the matrix without looking at the cached state
   * @returns the view matrix
   */
  getViewMatrix(e) {
    return !e && this._isSynchronizedViewMatrix() ? this._computedViewMatrix : (this.updateCache(), this._computedViewMatrix = this._getViewMatrix(), this._currentRenderId = this.getScene().getRenderId(), this._childUpdateId++, this._refreshFrustumPlanes = !0, this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix && this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix), this.parent && this.parent.onViewMatrixChangedObservable && this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent), this.onViewMatrixChangedObservable.notifyObservers(this), this._computedViewMatrix.invertToRef(this._worldMatrix), this._computedViewMatrix);
  }
  /**
   * Freeze the projection matrix.
   * It will prevent the cache check of the camera projection compute and can speed up perf
   * if no parameter of the camera are meant to change
   * @param projection Defines manually a projection if necessary
   */
  freezeProjectionMatrix(e) {
    this._doNotComputeProjectionMatrix = !0, e !== void 0 && (this._projectionMatrix = e);
  }
  /**
   * Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix.
   */
  unfreezeProjectionMatrix() {
    this._doNotComputeProjectionMatrix = !1;
  }
  /**
   * Gets the current projection matrix of the camera.
   * @param force forces the camera to recompute the matrix without looking at the cached state
   * @returns the projection matrix
   */
  getProjectionMatrix(e) {
    var t, r, n, i, s, a, f, o, d, v, u, l, P, p, c, H, T, q, b;
    if (this._doNotComputeProjectionMatrix || !e && this._isSynchronizedProjectionMatrix())
      return this._projectionMatrix;
    this._cache.mode = this.mode, this._cache.minZ = this.minZ, this._cache.maxZ = this.maxZ, this._refreshFrustumPlanes = !0;
    const j = this.getEngine(), w = this.getScene(), m = j.useReverseDepthBuffer;
    if (this.mode === Tr.PERSPECTIVE_CAMERA) {
      this._cache.fov = this.fov, this._cache.fovMode = this.fovMode, this._cache.aspectRatio = j.getAspectRatio(this), this._cache.projectionPlaneTilt = this.projectionPlaneTilt, this.minZ <= 0 && (this.minZ = 0.1);
      let I;
      w.useRightHandedSystem ? I = he.PerspectiveFovRHToRef : I = he.PerspectiveFovLHToRef, I(this.fov, j.getAspectRatio(this), m ? this.maxZ : this.minZ, m ? this.minZ : this.maxZ, this._projectionMatrix, this.fovMode === Tr.FOVMODE_VERTICAL_FIXED, j.isNDCHalfZRange, this.projectionPlaneTilt, m);
    } else {
      const I = j.getRenderWidth() / 2, N = j.getRenderHeight() / 2;
      w.useRightHandedSystem ? this.oblique ? he.ObliqueOffCenterRHToRef((t = this.orthoLeft) !== null && t !== void 0 ? t : -I, (r = this.orthoRight) !== null && r !== void 0 ? r : I, (n = this.orthoBottom) !== null && n !== void 0 ? n : -N, (i = this.orthoTop) !== null && i !== void 0 ? i : N, m ? this.maxZ : this.minZ, m ? this.minZ : this.maxZ, this.oblique.length, this.oblique.angle, this._computeObliqueDistance(this.oblique.offset), this._projectionMatrix, j.isNDCHalfZRange) : he.OrthoOffCenterRHToRef((s = this.orthoLeft) !== null && s !== void 0 ? s : -I, (a = this.orthoRight) !== null && a !== void 0 ? a : I, (f = this.orthoBottom) !== null && f !== void 0 ? f : -N, (o = this.orthoTop) !== null && o !== void 0 ? o : N, m ? this.maxZ : this.minZ, m ? this.minZ : this.maxZ, this._projectionMatrix, j.isNDCHalfZRange) : this.oblique ? he.ObliqueOffCenterLHToRef((d = this.orthoLeft) !== null && d !== void 0 ? d : -I, (v = this.orthoRight) !== null && v !== void 0 ? v : I, (u = this.orthoBottom) !== null && u !== void 0 ? u : -N, (l = this.orthoTop) !== null && l !== void 0 ? l : N, m ? this.maxZ : this.minZ, m ? this.minZ : this.maxZ, this.oblique.length, this.oblique.angle, this._computeObliqueDistance(this.oblique.offset), this._projectionMatrix, j.isNDCHalfZRange) : he.OrthoOffCenterLHToRef((P = this.orthoLeft) !== null && P !== void 0 ? P : -I, (p = this.orthoRight) !== null && p !== void 0 ? p : I, (c = this.orthoBottom) !== null && c !== void 0 ? c : -N, (H = this.orthoTop) !== null && H !== void 0 ? H : N, m ? this.maxZ : this.minZ, m ? this.minZ : this.maxZ, this._projectionMatrix, j.isNDCHalfZRange), this._cache.orthoLeft = this.orthoLeft, this._cache.orthoRight = this.orthoRight, this._cache.orthoBottom = this.orthoBottom, this._cache.orthoTop = this.orthoTop, this._cache.obliqueAngle = (T = this.oblique) === null || T === void 0 ? void 0 : T.angle, this._cache.obliqueLength = (q = this.oblique) === null || q === void 0 ? void 0 : q.length, this._cache.obliqueOffset = (b = this.oblique) === null || b === void 0 ? void 0 : b.offset, this._cache.renderWidth = j.getRenderWidth(), this._cache.renderHeight = j.getRenderHeight();
    }
    return this.onProjectionMatrixChangedObservable.notifyObservers(this), this._projectionMatrix;
  }
  /**
   * Gets the transformation matrix (ie. the multiplication of view by projection matrices)
   * @returns a Matrix
   */
  getTransformationMatrix() {
    return this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._transformMatrix;
  }
  _computeObliqueDistance(e) {
    const t = this, r = this;
    return (t.radius || (r.target ? S.Distance(this.position, r.target) : this.position.length())) + e;
  }
  _updateFrustumPlanes() {
    this._refreshFrustumPlanes && (this.getTransformationMatrix(), this._frustumPlanes ? Xc.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = Xc.GetPlanes(this._transformMatrix), this._refreshFrustumPlanes = !1);
  }
  /**
   * Checks if a cullable object (mesh...) is in the camera frustum
   * This checks the bounding box center. See isCompletelyInFrustum for a full bounding check
   * @param target The object to check
   * @param checkRigCameras If the rig cameras should be checked (eg. with VR camera both eyes should be checked) (Default: false)
   * @returns true if the object is in frustum otherwise false
   */
  isInFrustum(e, t = !1) {
    if (this._updateFrustumPlanes(), t && this.rigCameras.length > 0) {
      let r = !1;
      return this.rigCameras.forEach((n) => {
        n._updateFrustumPlanes(), r = r || e.isInFrustum(n._frustumPlanes);
      }), r;
    } else
      return e.isInFrustum(this._frustumPlanes);
  }
  /**
   * Checks if a cullable object (mesh...) is in the camera frustum
   * Unlike isInFrustum this checks the full bounding box
   * @param target The object to check
   * @returns true if the object is in frustum otherwise false
   */
  isCompletelyInFrustum(e) {
    return this._updateFrustumPlanes(), e.isCompletelyInFrustum(this._frustumPlanes);
  }
  /**
   * Gets a ray in the forward direction from the camera.
   * @param length Defines the length of the ray to create
   * @param transform Defines the transform to apply to the ray, by default the world matrix is used to create a workd space ray
   * @param origin Defines the start point of the ray which defaults to the camera position
   * @returns the forward ray
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getForwardRay(e = 100, t, r) {
    throw qn("Ray");
  }
  /**
   * Gets a ray in the forward direction from the camera.
   * @param refRay the ray to (re)use when setting the values
   * @param length Defines the length of the ray to create
   * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray
   * @param origin Defines the start point of the ray which defaults to the camera position
   * @returns the forward ray
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getForwardRayToRef(e, t = 100, r, n) {
    throw qn("Ray");
  }
  /**
   * Releases resources associated with this node.
   * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
   * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
   */
  dispose(e, t = !1) {
    for (this.onViewMatrixChangedObservable.clear(), this.onProjectionMatrixChangedObservable.clear(), this.onAfterCheckInputsObservable.clear(), this.onRestoreStateObservable.clear(), this.inputs && this.inputs.clear(), this.getScene().stopAnimation(this), this.getScene().removeCamera(this); this._rigCameras.length > 0; ) {
      const n = this._rigCameras.pop();
      n && n.dispose();
    }
    if (this._parentContainer) {
      const n = this._parentContainer.cameras.indexOf(this);
      n > -1 && this._parentContainer.cameras.splice(n, 1), this._parentContainer = null;
    }
    if (this._rigPostProcess)
      this._rigPostProcess.dispose(this), this._rigPostProcess = null, this._postProcesses.length = 0;
    else if (this.cameraRigMode !== Tr.RIG_MODE_NONE)
      this._rigPostProcess = null, this._postProcesses.length = 0;
    else {
      let n = this._postProcesses.length;
      for (; --n >= 0; ) {
        const i = this._postProcesses[n];
        i && i.dispose(this);
      }
    }
    let r = this.customRenderTargets.length;
    for (; --r >= 0; )
      this.customRenderTargets[r].dispose();
    this.customRenderTargets.length = 0, this._activeMeshes.dispose(), this.getScene().getEngine().releaseRenderPassId(this.renderPassId), super.dispose(e, t);
  }
  /**
   * Gets the left camera of a rig setup in case of Rigged Camera
   */
  get isLeftCamera() {
    return this._isLeftCamera;
  }
  /**
   * Gets the right camera of a rig setup in case of Rigged Camera
   */
  get isRightCamera() {
    return this._isRightCamera;
  }
  /**
   * Gets the left camera of a rig setup in case of Rigged Camera
   */
  get leftCamera() {
    return this._rigCameras.length < 1 ? null : this._rigCameras[0];
  }
  /**
   * Gets the right camera of a rig setup in case of Rigged Camera
   */
  get rightCamera() {
    return this._rigCameras.length < 2 ? null : this._rigCameras[1];
  }
  /**
   * Gets the left camera target of a rig setup in case of Rigged Camera
   * @returns the target position
   */
  getLeftTarget() {
    return this._rigCameras.length < 1 ? null : this._rigCameras[0].getTarget();
  }
  /**
   * Gets the right camera target of a rig setup in case of Rigged Camera
   * @returns the target position
   */
  getRightTarget() {
    return this._rigCameras.length < 2 ? null : this._rigCameras[1].getTarget();
  }
  /**
   * @internal
   */
  setCameraRigMode(e, t) {
    if (this.cameraRigMode !== e) {
      for (; this._rigCameras.length > 0; ) {
        const r = this._rigCameras.pop();
        r && r.dispose();
      }
      if (this.cameraRigMode = e, this._cameraRigParams = {}, this._cameraRigParams.interaxialDistance = t.interaxialDistance || 0.0637, this._cameraRigParams.stereoHalfAngle = ye.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637), this.cameraRigMode !== Tr.RIG_MODE_NONE) {
        const r = this.createRigCamera(this.name + "_L", 0);
        r && (r._isLeftCamera = !0);
        const n = this.createRigCamera(this.name + "_R", 1);
        n && (n._isRightCamera = !0), r && n && (this._rigCameras.push(r), this._rigCameras.push(n));
      }
      this._setRigMode(t), this._cascadePostProcessesToRigCams(), this.update();
    }
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _setRigMode(e) {
  }
  /** @internal */
  _getVRProjectionMatrix() {
    return he.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix, !0, this.getEngine().isNDCHalfZRange), this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix), this._projectionMatrix;
  }
  /**
   * @internal
   */
  setCameraRigParameter(e, t) {
    this._cameraRigParams || (this._cameraRigParams = {}), this._cameraRigParams[e] = t, e === "interaxialDistance" && (this._cameraRigParams.stereoHalfAngle = ye.ToRadians(t / 0.0637));
  }
  /**
   * needs to be overridden by children so sub has required properties to be copied
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  createRigCamera(e, t) {
    return null;
  }
  /**
   * May need to be overridden by children
   * @internal
   */
  _updateRigCameras() {
    for (let e = 0; e < this._rigCameras.length; e++)
      this._rigCameras[e].minZ = this.minZ, this._rigCameras[e].maxZ = this.maxZ, this._rigCameras[e].fov = this.fov, this._rigCameras[e].upVector.copyFrom(this.upVector);
    this.cameraRigMode === Tr.RIG_MODE_STEREOSCOPIC_ANAGLYPH && (this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport);
  }
  /** @internal */
  _setupInputs() {
  }
  /**
   * Serialiaze the camera setup to a json representation
   * @returns the JSON representation
   */
  serialize() {
    const e = jt.Serialize(this);
    return e.uniqueId = this.uniqueId, e.type = this.getClassName(), this.parent && this.parent._serializeAsParent(e), this.inputs && this.inputs.serialize(e), jt.AppendSerializedAnimations(this, e), e.ranges = this.serializeAnimationRanges(), e.isEnabled = this.isEnabled(), e;
  }
  /**
   * Clones the current camera.
   * @param name The cloned camera name
   * @param newParent The cloned camera's new parent (none by default)
   * @returns the cloned camera
   */
  clone(e, t = null) {
    const r = jt.Clone(Tr.GetConstructorFromName(this.getClassName(), e, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this);
    return r.name = e, r.parent = t, this.onClonedObservable.notifyObservers(r), r;
  }
  /**
   * Gets the direction of the camera relative to a given local axis.
   * @param localAxis Defines the reference axis to provide a relative direction.
   * @returns the direction
   */
  getDirection(e) {
    const t = S.Zero();
    return this.getDirectionToRef(e, t), t;
  }
  /**
   * Returns the current camera absolute rotation
   */
  get absoluteRotation() {
    return this.getWorldMatrix().decompose(void 0, this._absoluteRotation), this._absoluteRotation;
  }
  /**
   * Gets the direction of the camera relative to a given local axis into a passed vector.
   * @param localAxis Defines the reference axis to provide a relative direction.
   * @param result Defines the vector to store the result in
   */
  getDirectionToRef(e, t) {
    S.TransformNormalToRef(e, this.getWorldMatrix(), t);
  }
  /**
   * Gets a camera constructor for a given camera type
   * @param type The type of the camera to construct (should be equal to one of the camera class name)
   * @param name The name of the camera the result will be able to instantiate
   * @param scene The scene the result will construct the camera in
   * @param interaxial_distance In case of stereoscopic setup, the distance between both eyes
   * @param isStereoscopicSideBySide In case of stereoscopic setup, should the sereo be side b side
   * @returns a factory method to construct the camera
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static GetConstructorFromName(e, t, r, n = 0, i = !0) {
    const s = Cs.Construct(e, t, r, {
      // eslint-disable-next-line @typescript-eslint/naming-convention
      interaxial_distance: n,
      isStereoscopicSideBySide: i
    });
    return s || (() => Tr._CreateDefaultParsedCamera(t, r));
  }
  /**
   * Compute the world  matrix of the camera.
   * @returns the camera world matrix
   */
  computeWorldMatrix() {
    return this.getWorldMatrix();
  }
  /**
   * Parse a JSON and creates the camera from the parsed information
   * @param parsedCamera The JSON to parse
   * @param scene The scene to instantiate the camera in
   * @returns the newly constructed camera
   */
  static Parse(e, t) {
    const r = e.type, n = Tr.GetConstructorFromName(r, e.name, t, e.interaxial_distance, e.isStereoscopicSideBySide), i = jt.Parse(n, e, t);
    if (e.parentId !== void 0 && (i._waitingParentId = e.parentId), e.parentInstanceIndex !== void 0 && (i._waitingParentInstanceIndex = e.parentInstanceIndex), i.inputs && (i.inputs.parse(e), i._setupInputs()), e.upVector && (i.upVector = S.FromArray(e.upVector)), i.setPosition && (i.position.copyFromFloats(0, 0, 0), i.setPosition(S.FromArray(e.position))), e.target && i.setTarget && i.setTarget(S.FromArray(e.target)), e.cameraRigMode) {
      const s = e.interaxial_distance ? { interaxialDistance: e.interaxial_distance } : {};
      i.setCameraRigMode(e.cameraRigMode, s);
    }
    if (e.animations) {
      for (let s = 0; s < e.animations.length; s++) {
        const a = e.animations[s], f = Jo("BABYLON.Animation");
        f && i.animations.push(f.Parse(a));
      }
      Cs.ParseAnimationRanges(i, e, t);
    }
    return e.autoAnimate && t.beginAnimation(i, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1), e.isEnabled !== void 0 && i.setEnabled(e.isEnabled), i;
  }
  /** @internal */
  _calculateHandednessMultiplier() {
    let e = this.getScene().useRightHandedSystem ? -1 : 1;
    return this.parent && this.parent._getWorldMatrixDeterminant() < 0 && (e *= -1), e;
  }
}
Tr._CreateDefaultParsedCamera = (A, e) => {
  throw qn("UniversalCamera");
};
Tr.PERSPECTIVE_CAMERA = 0;
Tr.ORTHOGRAPHIC_CAMERA = 1;
Tr.FOVMODE_VERTICAL_FIXED = 0;
Tr.FOVMODE_HORIZONTAL_FIXED = 1;
Tr.RIG_MODE_NONE = 0;
Tr.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10;
Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11;
Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12;
Tr.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13;
Tr.RIG_MODE_STEREOSCOPIC_INTERLACED = 14;
Tr.RIG_MODE_VR = 20;
Tr.RIG_MODE_CUSTOM = 22;
Tr.ForceAttachControlToAlwaysPreventDefault = !1;
C([
  fo("position")
], Tr.prototype, "_position", void 0);
C([
  fo("upVector")
], Tr.prototype, "_upVector", void 0);
C([
  M()
], Tr.prototype, "orthoLeft", null);
C([
  M()
], Tr.prototype, "orthoRight", null);
C([
  M()
], Tr.prototype, "orthoBottom", null);
C([
  M()
], Tr.prototype, "orthoTop", null);
C([
  M()
], Tr.prototype, "fov", void 0);
C([
  M()
], Tr.prototype, "projectionPlaneTilt", void 0);
C([
  M()
], Tr.prototype, "minZ", void 0);
C([
  M()
], Tr.prototype, "maxZ", void 0);
C([
  M()
], Tr.prototype, "inertia", void 0);
C([
  M()
], Tr.prototype, "mode", null);
C([
  M()
], Tr.prototype, "layerMask", void 0);
C([
  M()
], Tr.prototype, "fovMode", void 0);
C([
  M()
], Tr.prototype, "cameraRigMode", void 0);
C([
  M()
], Tr.prototype, "interaxialDistance", void 0);
C([
  M()
], Tr.prototype, "isStereoscopicSideBySide", void 0);
class LC {
  constructor(e, t, r) {
    this.bu = e, this.bv = t, this.distance = r, this.faceId = 0, this.subMeshId = 0;
  }
}
class cp {
  /**
   * Creates a new bounding box
   * @param min defines the minimum vector (in local space)
   * @param max defines the maximum vector (in local space)
   * @param worldMatrix defines the new world matrix
   */
  constructor(e, t, r) {
    this.vectors = Nf.BuildArray(8, S.Zero), this.center = S.Zero(), this.centerWorld = S.Zero(), this.extendSize = S.Zero(), this.extendSizeWorld = S.Zero(), this.directions = Nf.BuildArray(3, S.Zero), this.vectorsWorld = Nf.BuildArray(8, S.Zero), this.minimumWorld = S.Zero(), this.maximumWorld = S.Zero(), this.minimum = S.Zero(), this.maximum = S.Zero(), this._drawWrapperFront = null, this._drawWrapperBack = null, this.reConstruct(e, t, r);
  }
  // Methods
  /**
   * Recreates the entire bounding box from scratch as if we call the constructor in place
   * @param min defines the new minimum vector (in local space)
   * @param max defines the new maximum vector (in local space)
   * @param worldMatrix defines the new world matrix
   */
  reConstruct(e, t, r) {
    const n = e.x, i = e.y, s = e.z, a = t.x, f = t.y, o = t.z, d = this.vectors;
    this.minimum.copyFromFloats(n, i, s), this.maximum.copyFromFloats(a, f, o), d[0].copyFromFloats(n, i, s), d[1].copyFromFloats(a, f, o), d[2].copyFromFloats(a, i, s), d[3].copyFromFloats(n, f, s), d[4].copyFromFloats(n, i, o), d[5].copyFromFloats(a, f, s), d[6].copyFromFloats(n, f, o), d[7].copyFromFloats(a, i, o), t.addToRef(e, this.center).scaleInPlace(0.5), t.subtractToRef(e, this.extendSize).scaleInPlace(0.5), this._worldMatrix = r || he.IdentityReadOnly, this._update(this._worldMatrix);
  }
  /**
   * Scale the current bounding box by applying a scale factor
   * @param factor defines the scale factor to apply
   * @returns the current bounding box
   */
  scale(e) {
    const t = cp._TmpVector3, r = this.maximum.subtractToRef(this.minimum, t[0]), n = r.length();
    r.normalizeFromLength(n);
    const i = n * e, s = r.scaleInPlace(i * 0.5), a = this.center.subtractToRef(s, t[1]), f = this.center.addToRef(s, t[2]);
    return this.reConstruct(a, f, this._worldMatrix), this;
  }
  /**
   * Gets the world matrix of the bounding box
   * @returns a matrix
   */
  getWorldMatrix() {
    return this._worldMatrix;
  }
  /**
   * @internal
   */
  _update(e) {
    const t = this.minimumWorld, r = this.maximumWorld, n = this.directions, i = this.vectorsWorld, s = this.vectors;
    if (e.isIdentity()) {
      t.copyFrom(this.minimum), r.copyFrom(this.maximum);
      for (let a = 0; a < 8; ++a)
        i[a].copyFrom(s[a]);
      this.extendSizeWorld.copyFrom(this.extendSize), this.centerWorld.copyFrom(this.center);
    } else {
      t.setAll(Number.MAX_VALUE), r.setAll(-Number.MAX_VALUE);
      for (let a = 0; a < 8; ++a) {
        const f = i[a];
        S.TransformCoordinatesToRef(s[a], e, f), t.minimizeInPlace(f), r.maximizeInPlace(f);
      }
      r.subtractToRef(t, this.extendSizeWorld).scaleInPlace(0.5), r.addToRef(t, this.centerWorld).scaleInPlace(0.5);
    }
    S.FromArrayToRef(e.m, 0, n[0]), S.FromArrayToRef(e.m, 4, n[1]), S.FromArrayToRef(e.m, 8, n[2]), this._worldMatrix = e;
  }
  /**
   * Tests if the bounding box is intersecting the frustum planes
   * @param frustumPlanes defines the frustum planes to test
   * @returns true if there is an intersection
   */
  isInFrustum(e) {
    return cp.IsInFrustum(this.vectorsWorld, e);
  }
  /**
   * Tests if the bounding box is entirely inside the frustum planes
   * @param frustumPlanes defines the frustum planes to test
   * @returns true if there is an inclusion
   */
  isCompletelyInFrustum(e) {
    return cp.IsCompletelyInFrustum(this.vectorsWorld, e);
  }
  /**
   * Tests if a point is inside the bounding box
   * @param point defines the point to test
   * @returns true if the point is inside the bounding box
   */
  intersectsPoint(e) {
    const t = this.minimumWorld, r = this.maximumWorld, n = t.x, i = t.y, s = t.z, a = r.x, f = r.y, o = r.z, d = e.x, v = e.y, u = e.z, l = -Dn;
    return !(a - d < l || l > d - n || f - v < l || l > v - i || o - u < l || l > u - s);
  }
  /**
   * Tests if the bounding box intersects with a bounding sphere
   * @param sphere defines the sphere to test
   * @returns true if there is an intersection
   */
  intersectsSphere(e) {
    return cp.IntersectsSphere(this.minimumWorld, this.maximumWorld, e.centerWorld, e.radiusWorld);
  }
  /**
   * Tests if the bounding box intersects with a box defined by a min and max vectors
   * @param min defines the min vector to use
   * @param max defines the max vector to use
   * @returns true if there is an intersection
   */
  intersectsMinMax(e, t) {
    const r = this.minimumWorld, n = this.maximumWorld, i = r.x, s = r.y, a = r.z, f = n.x, o = n.y, d = n.z, v = e.x, u = e.y, l = e.z, P = t.x, p = t.y, c = t.z;
    return !(f < v || i > P || o < u || s > p || d < l || a > c);
  }
  /**
   * Disposes the resources of the class
   */
  dispose() {
    var e, t;
    (e = this._drawWrapperFront) === null || e === void 0 || e.dispose(), (t = this._drawWrapperBack) === null || t === void 0 || t.dispose();
  }
  // Statics
  /**
   * Tests if two bounding boxes are intersections
   * @param box0 defines the first box to test
   * @param box1 defines the second box to test
   * @returns true if there is an intersection
   */
  static Intersects(e, t) {
    return e.intersectsMinMax(t.minimumWorld, t.maximumWorld);
  }
  /**
   * Tests if a bounding box defines by a min/max vectors intersects a sphere
   * @param minPoint defines the minimum vector of the bounding box
   * @param maxPoint defines the maximum vector of the bounding box
   * @param sphereCenter defines the sphere center
   * @param sphereRadius defines the sphere radius
   * @returns true if there is an intersection
   */
  static IntersectsSphere(e, t, r, n) {
    const i = cp._TmpVector3[0];
    return S.ClampToRef(r, e, t, i), S.DistanceSquared(r, i) <= n * n;
  }
  /**
   * Tests if a bounding box defined with 8 vectors is entirely inside frustum planes
   * @param boundingVectors defines an array of 8 vectors representing a bounding box
   * @param frustumPlanes defines the frustum planes to test
   * @returns true if there is an inclusion
   */
  static IsCompletelyInFrustum(e, t) {
    for (let r = 0; r < 6; ++r) {
      const n = t[r];
      for (let i = 0; i < 8; ++i)
        if (n.dotCoordinate(e[i]) < 0)
          return !1;
    }
    return !0;
  }
  /**
   * Tests if a bounding box defined with 8 vectors intersects frustum planes
   * @param boundingVectors defines an array of 8 vectors representing a bounding box
   * @param frustumPlanes defines the frustum planes to test
   * @returns true if there is an intersection
   */
  static IsInFrustum(e, t) {
    for (let r = 0; r < 6; ++r) {
      let n = !0;
      const i = t[r];
      for (let s = 0; s < 8; ++s)
        if (i.dotCoordinate(e[s]) >= 0) {
          n = !1;
          break;
        }
      if (n)
        return !1;
    }
    return !0;
  }
}
cp._TmpVector3 = Nf.BuildArray(3, S.Zero);
class rg {
  /**
   * Creates a new bounding sphere
   * @param min defines the minimum vector (in local space)
   * @param max defines the maximum vector (in local space)
   * @param worldMatrix defines the new world matrix
   */
  constructor(e, t, r) {
    this.center = S.Zero(), this.centerWorld = S.Zero(), this.minimum = S.Zero(), this.maximum = S.Zero(), this.reConstruct(e, t, r);
  }
  /**
   * Recreates the entire bounding sphere from scratch as if we call the constructor in place
   * @param min defines the new minimum vector (in local space)
   * @param max defines the new maximum vector (in local space)
   * @param worldMatrix defines the new world matrix
   */
  reConstruct(e, t, r) {
    this.minimum.copyFrom(e), this.maximum.copyFrom(t);
    const n = S.Distance(e, t);
    t.addToRef(e, this.center).scaleInPlace(0.5), this.radius = n * 0.5, this._update(r || he.IdentityReadOnly);
  }
  /**
   * Scale the current bounding sphere by applying a scale factor
   * @param factor defines the scale factor to apply
   * @returns the current bounding box
   */
  scale(e) {
    const t = this.radius * e, r = rg._TmpVector3, n = r[0].setAll(t), i = this.center.subtractToRef(n, r[1]), s = this.center.addToRef(n, r[2]);
    return this.reConstruct(i, s, this._worldMatrix), this;
  }
  /**
   * Gets the world matrix of the bounding box
   * @returns a matrix
   */
  getWorldMatrix() {
    return this._worldMatrix;
  }
  // Methods
  /**
   * @internal
   */
  _update(e) {
    if (e.isIdentity())
      this.centerWorld.copyFrom(this.center), this.radiusWorld = this.radius;
    else {
      S.TransformCoordinatesToRef(this.center, e, this.centerWorld);
      const t = rg._TmpVector3[0];
      S.TransformNormalFromFloatsToRef(1, 1, 1, e, t), this.radiusWorld = Math.max(Math.abs(t.x), Math.abs(t.y), Math.abs(t.z)) * this.radius;
    }
  }
  /**
   * Tests if the bounding sphere is intersecting the frustum planes
   * @param frustumPlanes defines the frustum planes to test
   * @returns true if there is an intersection
   */
  isInFrustum(e) {
    const t = this.centerWorld, r = this.radiusWorld;
    for (let n = 0; n < 6; n++)
      if (e[n].dotCoordinate(t) <= -r)
        return !1;
    return !0;
  }
  /**
   * Tests if the bounding sphere center is in between the frustum planes.
   * Used for optimistic fast inclusion.
   * @param frustumPlanes defines the frustum planes to test
   * @returns true if the sphere center is in between the frustum planes
   */
  isCenterInFrustum(e) {
    const t = this.centerWorld;
    for (let r = 0; r < 6; r++)
      if (e[r].dotCoordinate(t) < 0)
        return !1;
    return !0;
  }
  /**
   * Tests if a point is inside the bounding sphere
   * @param point defines the point to test
   * @returns true if the point is inside the bounding sphere
   */
  intersectsPoint(e) {
    const t = S.DistanceSquared(this.centerWorld, e);
    return !(this.radiusWorld * this.radiusWorld < t);
  }
  // Statics
  /**
   * Checks if two sphere intersect
   * @param sphere0 sphere 0
   * @param sphere1 sphere 1
   * @returns true if the spheres intersect
   */
  static Intersects(e, t) {
    const r = S.DistanceSquared(e.centerWorld, t.centerWorld), n = e.radiusWorld + t.radiusWorld;
    return !(n * n < r);
  }
  /**
   * Creates a sphere from a center and a radius
   * @param center The center
   * @param radius radius
   * @param matrix Optional worldMatrix
   * @returns The sphere
   */
  static CreateFromCenterAndRadius(e, t, r) {
    this._TmpVector3[0].copyFrom(e), this._TmpVector3[1].copyFromFloats(0, 0, t), this._TmpVector3[2].copyFrom(e), this._TmpVector3[0].addInPlace(this._TmpVector3[1]), this._TmpVector3[2].subtractInPlace(this._TmpVector3[1]);
    const n = new rg(this._TmpVector3[0], this._TmpVector3[2]);
    return r ? n._worldMatrix = r : n._worldMatrix = he.Identity(), n;
  }
}
rg._TmpVector3 = Nf.BuildArray(3, S.Zero);
const pE = { min: 0, max: 0 }, hE = { min: 0, max: 0 }, uG = (A, e, t) => {
  const r = S.Dot(e.centerWorld, A), n = Math.abs(S.Dot(e.directions[0], A)) * e.extendSize.x, i = Math.abs(S.Dot(e.directions[1], A)) * e.extendSize.y, s = Math.abs(S.Dot(e.directions[2], A)) * e.extendSize.z, a = n + i + s;
  t.min = r - a, t.max = r + a;
}, Ol = (A, e, t) => (uG(A, e, pE), uG(A, t, hE), !(pE.min > hE.max || hE.min > pE.max));
class Md {
  /**
   * Constructs bounding info
   * @param minimum min vector of the bounding box/sphere
   * @param maximum max vector of the bounding box/sphere
   * @param worldMatrix defines the new world matrix
   */
  constructor(e, t, r) {
    this._isLocked = !1, this.boundingBox = new cp(e, t, r), this.boundingSphere = new rg(e, t, r);
  }
  /**
   * Recreates the entire bounding info from scratch as if we call the constructor in place
   * @param min defines the new minimum vector (in local space)
   * @param max defines the new maximum vector (in local space)
   * @param worldMatrix defines the new world matrix
   */
  reConstruct(e, t, r) {
    this.boundingBox.reConstruct(e, t, r), this.boundingSphere.reConstruct(e, t, r);
  }
  /**
   * min vector of the bounding box/sphere
   */
  get minimum() {
    return this.boundingBox.minimum;
  }
  /**
   * max vector of the bounding box/sphere
   */
  get maximum() {
    return this.boundingBox.maximum;
  }
  /**
   * If the info is locked and won't be updated to avoid perf overhead
   */
  get isLocked() {
    return this._isLocked;
  }
  set isLocked(e) {
    this._isLocked = e;
  }
  // Methods
  /**
   * Updates the bounding sphere and box
   * @param world world matrix to be used to update
   */
  update(e) {
    this._isLocked || (this.boundingBox._update(e), this.boundingSphere._update(e));
  }
  /**
   * Recreate the bounding info to be centered around a specific point given a specific extend.
   * @param center New center of the bounding info
   * @param extend New extend of the bounding info
   * @returns the current bounding info
   */
  centerOn(e, t) {
    const r = Md._TmpVector3[0].copyFrom(e).subtractInPlace(t), n = Md._TmpVector3[1].copyFrom(e).addInPlace(t);
    return this.boundingBox.reConstruct(r, n, this.boundingBox.getWorldMatrix()), this.boundingSphere.reConstruct(r, n, this.boundingBox.getWorldMatrix()), this;
  }
  /**
   * Grows the bounding info to include the given point.
   * @param point The point that will be included in the current bounding info (in local space)
   * @returns the current bounding info
   */
  encapsulate(e) {
    const t = S.Minimize(this.minimum, e), r = S.Maximize(this.maximum, e);
    return this.reConstruct(t, r, this.boundingBox.getWorldMatrix()), this;
  }
  /**
   * Grows the bounding info to encapsulate the given bounding info.
   * @param toEncapsulate The bounding info that will be encapsulated in the current bounding info
   * @returns the current bounding info
   */
  encapsulateBoundingInfo(e) {
    const t = ue.Matrix[0];
    this.boundingBox.getWorldMatrix().invertToRef(t);
    const r = ue.Vector3[0];
    return S.TransformCoordinatesToRef(e.boundingBox.minimumWorld, t, r), this.encapsulate(r), S.TransformCoordinatesToRef(e.boundingBox.maximumWorld, t, r), this.encapsulate(r), this;
  }
  /**
   * Scale the current bounding info by applying a scale factor
   * @param factor defines the scale factor to apply
   * @returns the current bounding info
   */
  scale(e) {
    return this.boundingBox.scale(e), this.boundingSphere.scale(e), this;
  }
  /**
   * Returns `true` if the bounding info is within the frustum defined by the passed array of planes.
   * @param frustumPlanes defines the frustum to test
   * @param strategy defines the strategy to use for the culling (default is BABYLON.AbstractMesh.CULLINGSTRATEGY_STANDARD)
   * The different strategies available are:
   * * BABYLON.AbstractMesh.CULLINGSTRATEGY_STANDARD most accurate but slower @see https://doc.babylonjs.com/typedoc/classes/BABYLON.AbstractMesh#CULLINGSTRATEGY_STANDARD
   * * BABYLON.AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY faster but less accurate @see https://doc.babylonjs.com/typedoc/classes/BABYLON.AbstractMesh#CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY
   * * BABYLON.AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION can be faster if always visible @see https://doc.babylonjs.com/typedoc/classes/BABYLON.AbstractMesh#CULLINGSTRATEGY_OPTIMISTIC_INCLUSION
   * * BABYLON.AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY can be faster if always visible @see https://doc.babylonjs.com/typedoc/classes/BABYLON.AbstractMesh#CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY
   * @returns true if the bounding info is in the frustum planes
   */
  isInFrustum(e, t = 0) {
    return (t === 2 || t === 3) && this.boundingSphere.isCenterInFrustum(e) ? !0 : this.boundingSphere.isInFrustum(e) ? t === 1 || t === 3 ? !0 : this.boundingBox.isInFrustum(e) : !1;
  }
  /**
   * Gets the world distance between the min and max points of the bounding box
   */
  get diagonalLength() {
    const e = this.boundingBox;
    return e.maximumWorld.subtractToRef(e.minimumWorld, Md._TmpVector3[0]).length();
  }
  /**
   * Checks if a cullable object (mesh...) is in the camera frustum
   * Unlike isInFrustum this checks the full bounding box
   * @param frustumPlanes Camera near/planes
   * @returns true if the object is in frustum otherwise false
   */
  isCompletelyInFrustum(e) {
    return this.boundingBox.isCompletelyInFrustum(e);
  }
  /**
   * @internal
   */
  _checkCollision(e) {
    return e._canDoCollision(this.boundingSphere.centerWorld, this.boundingSphere.radiusWorld, this.boundingBox.minimumWorld, this.boundingBox.maximumWorld);
  }
  /**
   * Checks if a point is inside the bounding box and bounding sphere or the mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect
   * @param point the point to check intersection with
   * @returns if the point intersects
   */
  intersectsPoint(e) {
    return !(!this.boundingSphere.centerWorld || !this.boundingSphere.intersectsPoint(e) || !this.boundingBox.intersectsPoint(e));
  }
  /**
   * Checks if another bounding info intersects the bounding box and bounding sphere or the mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect
   * @param boundingInfo the bounding info to check intersection with
   * @param precise if the intersection should be done using OBB
   * @returns if the bounding info intersects
   */
  intersects(e, t) {
    if (!rg.Intersects(this.boundingSphere, e.boundingSphere) || !cp.Intersects(this.boundingBox, e.boundingBox))
      return !1;
    if (!t)
      return !0;
    const r = this.boundingBox, n = e.boundingBox;
    return !(!Ol(r.directions[0], r, n) || !Ol(r.directions[1], r, n) || !Ol(r.directions[2], r, n) || !Ol(n.directions[0], r, n) || !Ol(n.directions[1], r, n) || !Ol(n.directions[2], r, n) || !Ol(S.Cross(r.directions[0], n.directions[0]), r, n) || !Ol(S.Cross(r.directions[0], n.directions[1]), r, n) || !Ol(S.Cross(r.directions[0], n.directions[2]), r, n) || !Ol(S.Cross(r.directions[1], n.directions[0]), r, n) || !Ol(S.Cross(r.directions[1], n.directions[1]), r, n) || !Ol(S.Cross(r.directions[1], n.directions[2]), r, n) || !Ol(S.Cross(r.directions[2], n.directions[0]), r, n) || !Ol(S.Cross(r.directions[2], n.directions[1]), r, n) || !Ol(S.Cross(r.directions[2], n.directions[2]), r, n));
  }
}
Md._TmpVector3 = Nf.BuildArray(2, S.Zero);
class WO {
  static extractMinAndMaxIndexed(e, t, r, n, i, s) {
    for (let a = r; a < r + n; a++) {
      const f = t[a] * 3, o = e[f], d = e[f + 1], v = e[f + 2];
      i.minimizeInPlaceFromFloats(o, d, v), s.maximizeInPlaceFromFloats(o, d, v);
    }
  }
  static extractMinAndMax(e, t, r, n, i, s) {
    for (let a = t, f = t * n; a < t + r; a++, f += n) {
      const o = e[f], d = e[f + 1], v = e[f + 2];
      i.minimizeInPlaceFromFloats(o, d, v), s.maximizeInPlaceFromFloats(o, d, v);
    }
  }
}
C([
  Hq.filter((...[A, e]) => !Array.isArray(A) && !Array.isArray(e))
  // eslint-disable-next-line @typescript-eslint/naming-convention
], WO, "extractMinAndMaxIndexed", null);
C([
  Hq.filter((...[A]) => !Array.isArray(A))
  // eslint-disable-next-line @typescript-eslint/naming-convention
], WO, "extractMinAndMax", null);
function nee(A, e, t, r, n = null) {
  const i = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), s = new S(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
  return WO.extractMinAndMaxIndexed(A, e, t, r, i, s), n && (i.x -= i.x * n.x + n.y, i.y -= i.y * n.x + n.y, i.z -= i.z * n.x + n.y, s.x += s.x * n.x + n.y, s.y += s.y * n.x + n.y, s.z += s.z * n.x + n.y), {
    minimum: i,
    maximum: s
  };
}
function WS(A, e, t, r = null, n) {
  const i = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), s = new S(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
  return n || (n = 3), WO.extractMinAndMax(A, e, t, n, i, s), r && (i.x -= i.x * r.x + r.y, i.y -= i.y * r.x + r.y, i.z -= i.z * r.x + r.y, s.x += s.x * r.x + r.y, s.y += s.y * r.x + r.y, s.z += s.z * r.x + r.y), {
    minimum: i,
    maximum: s
  };
}
class rA {
  /**
   * Gets material defines used by the effect associated to the sub mesh
   */
  get materialDefines() {
    var e;
    return this._mainDrawWrapperOverride ? this._mainDrawWrapperOverride.defines : (e = this._getDrawWrapper()) === null || e === void 0 ? void 0 : e.defines;
  }
  /**
   * Sets material defines used by the effect associated to the sub mesh
   */
  set materialDefines(e) {
    var t;
    const r = (t = this._mainDrawWrapperOverride) !== null && t !== void 0 ? t : this._getDrawWrapper(void 0, !0);
    r.defines = e;
  }
  /**
   * @internal
   */
  _getDrawWrapper(e, t = !1) {
    e = e ?? this._engine.currentRenderPassId;
    let r = this._drawWrappers[e];
    return !r && t && (this._drawWrappers[e] = r = new zo(this._mesh.getScene().getEngine())), r;
  }
  /**
   * @internal
   */
  _removeDrawWrapper(e, t = !0) {
    var r;
    t && ((r = this._drawWrappers[e]) === null || r === void 0 || r.dispose()), this._drawWrappers[e] = void 0;
  }
  /**
   * Gets associated (main) effect (possibly the effect override if defined)
   */
  get effect() {
    var e, t;
    return this._mainDrawWrapperOverride ? this._mainDrawWrapperOverride.effect : (t = (e = this._getDrawWrapper()) === null || e === void 0 ? void 0 : e.effect) !== null && t !== void 0 ? t : null;
  }
  /** @internal */
  get _drawWrapper() {
    var e;
    return (e = this._mainDrawWrapperOverride) !== null && e !== void 0 ? e : this._getDrawWrapper(void 0, !0);
  }
  /** @internal */
  get _drawWrapperOverride() {
    return this._mainDrawWrapperOverride;
  }
  /**
   * @internal
   */
  _setMainDrawWrapperOverride(e) {
    this._mainDrawWrapperOverride = e;
  }
  /**
   * Sets associated effect (effect used to render this submesh)
   * @param effect defines the effect to associate with
   * @param defines defines the set of defines used to compile this effect
   * @param materialContext material context associated to the effect
   * @param resetContext true to reset the draw context
   */
  setEffect(e, t = null, r, n = !0) {
    const i = this._drawWrapper;
    i.setEffect(e, t, n), r !== void 0 && (i.materialContext = r), e || (i.defines = null, i.materialContext = void 0);
  }
  /**
   * Resets the draw wrappers cache
   * @param passId If provided, releases only the draw wrapper corresponding to this render pass id
   */
  resetDrawCache(e) {
    if (this._drawWrappers)
      if (e !== void 0) {
        this._removeDrawWrapper(e);
        return;
      } else
        for (const t of this._drawWrappers)
          t == null || t.dispose();
    this._drawWrappers = [];
  }
  /**
   * Add a new submesh to a mesh
   * @param materialIndex defines the material index to use
   * @param verticesStart defines vertex index start
   * @param verticesCount defines vertices count
   * @param indexStart defines index start
   * @param indexCount defines indices count
   * @param mesh defines the parent mesh
   * @param renderingMesh defines an optional rendering mesh
   * @param createBoundingBox defines if bounding box should be created for this submesh
   * @returns the new submesh
   */
  static AddToMesh(e, t, r, n, i, s, a, f = !0) {
    return new rA(e, t, r, n, i, s, a, f);
  }
  /**
   * Creates a new submesh
   * @param materialIndex defines the material index to use
   * @param verticesStart defines vertex index start
   * @param verticesCount defines vertices count
   * @param indexStart defines index start
   * @param indexCount defines indices count
   * @param mesh defines the parent mesh
   * @param renderingMesh defines an optional rendering mesh
   * @param createBoundingBox defines if bounding box should be created for this submesh
   * @param addToMesh defines a boolean indicating that the submesh must be added to the mesh.subMeshes array (true by default)
   */
  constructor(e, t, r, n, i, s, a, f = !0, o = !0) {
    this.materialIndex = e, this.verticesStart = t, this.verticesCount = r, this.indexStart = n, this.indexCount = i, this._mainDrawWrapperOverride = null, this._linesIndexCount = 0, this._linesIndexBuffer = null, this._lastColliderWorldVertices = null, this._lastColliderTransformMatrix = null, this._wasDispatched = !1, this._renderId = 0, this._alphaIndex = 0, this._distanceToCamera = 0, this._currentMaterial = null, this._mesh = s, this._renderingMesh = a || s, o && s.subMeshes.push(this), this._engine = this._mesh.getScene().getEngine(), this.resetDrawCache(), this._trianglePlanes = [], this._id = s.subMeshes.length - 1, f && (this.refreshBoundingInfo(), s.computeWorldMatrix(!0));
  }
  /**
   * Returns true if this submesh covers the entire parent mesh
   * @ignorenaming
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  get IsGlobal() {
    return this.verticesStart === 0 && this.verticesCount === this._mesh.getTotalVertices() && this.indexStart === 0 && this.indexCount === this._mesh.getTotalIndices();
  }
  /**
   * Returns the submesh BoundingInfo object
   * @returns current bounding info (or mesh's one if the submesh is global)
   */
  getBoundingInfo() {
    return this.IsGlobal || this._mesh.hasThinInstances ? this._mesh.getBoundingInfo() : this._boundingInfo;
  }
  /**
   * Sets the submesh BoundingInfo
   * @param boundingInfo defines the new bounding info to use
   * @returns the SubMesh
   */
  setBoundingInfo(e) {
    return this._boundingInfo = e, this;
  }
  /**
   * Returns the mesh of the current submesh
   * @returns the parent mesh
   */
  getMesh() {
    return this._mesh;
  }
  /**
   * Returns the rendering mesh of the submesh
   * @returns the rendering mesh (could be different from parent mesh)
   */
  getRenderingMesh() {
    return this._renderingMesh;
  }
  /**
   * Returns the replacement mesh of the submesh
   * @returns the replacement mesh (could be different from parent mesh)
   */
  getReplacementMesh() {
    return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : null;
  }
  /**
   * Returns the effective mesh of the submesh
   * @returns the effective mesh (could be different from parent mesh)
   */
  getEffectiveMesh() {
    const e = this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : null;
    return e || this._renderingMesh;
  }
  /**
   * Returns the submesh material
   * @param getDefaultMaterial Defines whether or not to get the default material if nothing has been defined.
   * @returns null or the current material
   */
  getMaterial(e = !0) {
    var t;
    const r = (t = this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId)) !== null && t !== void 0 ? t : this._renderingMesh.material;
    if (r) {
      if (this._isMultiMaterial(r)) {
        const n = r.getSubMaterial(this.materialIndex);
        return this._currentMaterial !== n && (this._currentMaterial = n, this.resetDrawCache()), n;
      }
    } else
      return e ? this._mesh.getScene().defaultMaterial : null;
    return r;
  }
  _isMultiMaterial(e) {
    return e.getSubMaterial !== void 0;
  }
  // Methods
  /**
   * Sets a new updated BoundingInfo object to the submesh
   * @param data defines an optional position array to use to determine the bounding info
   * @returns the SubMesh
   */
  refreshBoundingInfo(e = null) {
    if (this._lastColliderWorldVertices = null, this.IsGlobal || !this._renderingMesh || !this._renderingMesh.geometry)
      return this;
    if (e || (e = this._renderingMesh.getVerticesData(J.PositionKind)), !e)
      return this._boundingInfo = this._mesh.getBoundingInfo(), this;
    const t = this._renderingMesh.getIndices();
    let r;
    if (this.indexStart === 0 && this.indexCount === t.length) {
      const n = this._renderingMesh.getBoundingInfo();
      r = { minimum: n.minimum.clone(), maximum: n.maximum.clone() };
    } else
      r = nee(e, t, this.indexStart, this.indexCount, this._renderingMesh.geometry.boundingBias);
    return this._boundingInfo ? this._boundingInfo.reConstruct(r.minimum, r.maximum) : this._boundingInfo = new Md(r.minimum, r.maximum), this;
  }
  /**
   * @internal
   */
  _checkCollision(e) {
    return this.getBoundingInfo()._checkCollision(e);
  }
  /**
   * Updates the submesh BoundingInfo
   * @param world defines the world matrix to use to update the bounding info
   * @returns the submesh
   */
  updateBoundingInfo(e) {
    let t = this.getBoundingInfo();
    return t || (this.refreshBoundingInfo(), t = this.getBoundingInfo()), t && t.update(e), this;
  }
  /**
   * True is the submesh bounding box intersects the frustum defined by the passed array of planes.
   * @param frustumPlanes defines the frustum planes
   * @returns true if the submesh is intersecting with the frustum
   */
  isInFrustum(e) {
    const t = this.getBoundingInfo();
    return t ? t.isInFrustum(e, this._mesh.cullingStrategy) : !1;
  }
  /**
   * True is the submesh bounding box is completely inside the frustum defined by the passed array of planes
   * @param frustumPlanes defines the frustum planes
   * @returns true if the submesh is inside the frustum
   */
  isCompletelyInFrustum(e) {
    const t = this.getBoundingInfo();
    return t ? t.isCompletelyInFrustum(e) : !1;
  }
  /**
   * Renders the submesh
   * @param enableAlphaMode defines if alpha needs to be used
   * @returns the submesh
   */
  render(e) {
    return this._renderingMesh.render(this, e, this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : void 0), this;
  }
  /**
   * @internal
   */
  _getLinesIndexBuffer(e, t) {
    if (!this._linesIndexBuffer) {
      const r = [];
      for (let n = this.indexStart; n < this.indexStart + this.indexCount; n += 3)
        r.push(e[n], e[n + 1], e[n + 1], e[n + 2], e[n + 2], e[n]);
      this._linesIndexBuffer = t.createIndexBuffer(r), this._linesIndexCount = r.length;
    }
    return this._linesIndexBuffer;
  }
  /**
   * Checks if the submesh intersects with a ray
   * @param ray defines the ray to test
   * @returns true is the passed ray intersects the submesh bounding box
   */
  canIntersects(e) {
    const t = this.getBoundingInfo();
    return t ? e.intersectsBox(t.boundingBox) : !1;
  }
  /**
   * Intersects current submesh with a ray
   * @param ray defines the ray to test
   * @param positions defines mesh's positions array
   * @param indices defines mesh's indices array
   * @param fastCheck defines if the first intersection will be used (and not the closest)
   * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
   * @returns intersection info or null if no intersection
   */
  intersects(e, t, r, n, i) {
    const s = this.getMaterial();
    if (!s)
      return null;
    let a = 3, f = !1;
    switch (s.fillMode) {
      case 3:
      case 5:
      case 6:
      case 8:
        return null;
      case 7:
        a = 1, f = !0;
        break;
    }
    return s.fillMode === 4 ? r.length ? this._intersectLines(e, t, r, this._mesh.intersectionThreshold, n) : this._intersectUnIndexedLines(e, t, r, this._mesh.intersectionThreshold, n) : !r.length && this._mesh._unIndexed ? this._intersectUnIndexedTriangles(e, t, r, n, i) : this._intersectTriangles(e, t, r, a, f, n, i);
  }
  /**
   * @internal
   */
  _intersectLines(e, t, r, n, i) {
    let s = null;
    for (let a = this.indexStart; a < this.indexStart + this.indexCount; a += 2) {
      const f = t[r[a]], o = t[r[a + 1]], d = e.intersectionSegment(f, o, n);
      if (!(d < 0) && (i || !s || d < s.distance) && (s = new LC(null, null, d), s.faceId = a / 2, i))
        break;
    }
    return s;
  }
  /**
   * @internal
   */
  _intersectUnIndexedLines(e, t, r, n, i) {
    let s = null;
    for (let a = this.verticesStart; a < this.verticesStart + this.verticesCount; a += 2) {
      const f = t[a], o = t[a + 1], d = e.intersectionSegment(f, o, n);
      if (!(d < 0) && (i || !s || d < s.distance) && (s = new LC(null, null, d), s.faceId = a / 2, i))
        break;
    }
    return s;
  }
  /**
   * @internal
   */
  _intersectTriangles(e, t, r, n, i, s, a) {
    let f = null, o = -1;
    for (let d = this.indexStart; d < this.indexStart + this.indexCount - (3 - n); d += n) {
      o++;
      const v = r[d], u = r[d + 1], l = r[d + 2];
      if (i && l === 4294967295) {
        d += 2;
        continue;
      }
      const P = t[v], p = t[u], c = t[l];
      if (!P || !p || !c || a && !a(P, p, c, e, v, u, l))
        continue;
      const H = e.intersectsTriangle(P, p, c);
      if (H) {
        if (H.distance < 0)
          continue;
        if ((s || !f || H.distance < f.distance) && (f = H, f.faceId = o, s))
          break;
      }
    }
    return f;
  }
  /**
   * @internal
   */
  _intersectUnIndexedTriangles(e, t, r, n, i) {
    let s = null;
    for (let a = this.verticesStart; a < this.verticesStart + this.verticesCount; a += 3) {
      const f = t[a], o = t[a + 1], d = t[a + 2];
      if (i && !i(f, o, d, e, -1, -1, -1))
        continue;
      const v = e.intersectsTriangle(f, o, d);
      if (v) {
        if (v.distance < 0)
          continue;
        if ((n || !s || v.distance < s.distance) && (s = v, s.faceId = a / 3, n))
          break;
      }
    }
    return s;
  }
  /** @internal */
  _rebuild() {
    this._linesIndexBuffer && (this._linesIndexBuffer = null);
  }
  // Clone
  /**
   * Creates a new submesh from the passed mesh
   * @param newMesh defines the new hosting mesh
   * @param newRenderingMesh defines an optional rendering mesh
   * @returns the new submesh
   */
  clone(e, t) {
    const r = new rA(this.materialIndex, this.verticesStart, this.verticesCount, this.indexStart, this.indexCount, e, t, !1);
    if (!this.IsGlobal) {
      const n = this.getBoundingInfo();
      if (!n)
        return r;
      r._boundingInfo = new Md(n.minimum, n.maximum);
    }
    return r;
  }
  // Dispose
  /**
   * Release associated resources
   */
  dispose() {
    this._linesIndexBuffer && (this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer), this._linesIndexBuffer = null);
    const e = this._mesh.subMeshes.indexOf(this);
    this._mesh.subMeshes.splice(e, 1), this.resetDrawCache();
  }
  /**
   * Gets the class name
   * @returns the string "SubMesh".
   */
  getClassName() {
    return "SubMesh";
  }
  // Statics
  /**
   * Creates a new submesh from indices data
   * @param materialIndex the index of the main mesh material
   * @param startIndex the index where to start the copy in the mesh indices array
   * @param indexCount the number of indices to copy then from the startIndex
   * @param mesh the main mesh to create the submesh from
   * @param renderingMesh the optional rendering mesh
   * @param createBoundingBox defines if bounding box should be created for this submesh
   * @returns a new submesh
   */
  static CreateFromIndices(e, t, r, n, i, s = !0) {
    let a = Number.MAX_VALUE, f = -Number.MAX_VALUE;
    const d = (i || n).getIndices();
    for (let v = t; v < t + r; v++) {
      const u = d[v];
      u < a && (a = u), u > f && (f = u);
    }
    return new rA(e, a, f - a + 1, t, r, n, i, s);
  }
}
class wI {
}
class Ut {
  /**
   * Creates a new VertexData
   */
  constructor() {
    this.uniqueId = 0, this.metadata = {}, this._applyTo = ree(this._applyToCoroutine.bind(this)), this.uniqueId = Ut._UniqueIDGenerator, Ut._UniqueIDGenerator++;
  }
  /**
   * Uses the passed data array to set the set the values for the specified kind of data
   * @param data a linear array of floating numbers
   * @param kind the type of data that is being set, eg positions, colors etc
   */
  set(e, t) {
    switch (e.length || Se.Warn(`Setting vertex data kind '${t}' with an empty array`), t) {
      case J.PositionKind:
        this.positions = e;
        break;
      case J.NormalKind:
        this.normals = e;
        break;
      case J.TangentKind:
        this.tangents = e;
        break;
      case J.UVKind:
        this.uvs = e;
        break;
      case J.UV2Kind:
        this.uvs2 = e;
        break;
      case J.UV3Kind:
        this.uvs3 = e;
        break;
      case J.UV4Kind:
        this.uvs4 = e;
        break;
      case J.UV5Kind:
        this.uvs5 = e;
        break;
      case J.UV6Kind:
        this.uvs6 = e;
        break;
      case J.ColorKind:
        this.colors = e;
        break;
      case J.MatricesIndicesKind:
        this.matricesIndices = e;
        break;
      case J.MatricesWeightsKind:
        this.matricesWeights = e;
        break;
      case J.MatricesIndicesExtraKind:
        this.matricesIndicesExtra = e;
        break;
      case J.MatricesWeightsExtraKind:
        this.matricesWeightsExtra = e;
        break;
    }
  }
  /**
   * Associates the vertexData to the passed Mesh.
   * Sets it as updatable or not (default `false`)
   * @param mesh the mesh the vertexData is applied to
   * @param updatable when used and having the value true allows new data to update the vertexData
   * @returns the VertexData
   */
  applyToMesh(e, t) {
    return this._applyTo(e, t, !1), this;
  }
  /**
   * Associates the vertexData to the passed Geometry.
   * Sets it as updatable or not (default `false`)
   * @param geometry the geometry the vertexData is applied to
   * @param updatable when used and having the value true allows new data to update the vertexData
   * @returns VertexData
   */
  applyToGeometry(e, t) {
    return this._applyTo(e, t, !1), this;
  }
  /**
   * Updates the associated mesh
   * @param mesh the mesh to be updated
   * @returns VertexData
   */
  updateMesh(e) {
    return this._update(e), this;
  }
  /**
   * Updates the associated geometry
   * @param geometry the geometry to be updated
   * @returns VertexData.
   */
  updateGeometry(e) {
    return this._update(e), this;
  }
  /**
   * @internal
   */
  *_applyToCoroutine(e, t = !1, r) {
    if (this.positions && (e.setVerticesData(J.PositionKind, this.positions, t), r && (yield)), this.normals && (e.setVerticesData(J.NormalKind, this.normals, t), r && (yield)), this.tangents && (e.setVerticesData(J.TangentKind, this.tangents, t), r && (yield)), this.uvs && (e.setVerticesData(J.UVKind, this.uvs, t), r && (yield)), this.uvs2 && (e.setVerticesData(J.UV2Kind, this.uvs2, t), r && (yield)), this.uvs3 && (e.setVerticesData(J.UV3Kind, this.uvs3, t), r && (yield)), this.uvs4 && (e.setVerticesData(J.UV4Kind, this.uvs4, t), r && (yield)), this.uvs5 && (e.setVerticesData(J.UV5Kind, this.uvs5, t), r && (yield)), this.uvs6 && (e.setVerticesData(J.UV6Kind, this.uvs6, t), r && (yield)), this.colors && (e.setVerticesData(J.ColorKind, this.colors, t), r && (yield)), this.matricesIndices && (e.setVerticesData(J.MatricesIndicesKind, this.matricesIndices, t), r && (yield)), this.matricesWeights && (e.setVerticesData(J.MatricesWeightsKind, this.matricesWeights, t), r && (yield)), this.matricesIndicesExtra && (e.setVerticesData(J.MatricesIndicesExtraKind, this.matricesIndicesExtra, t), r && (yield)), this.matricesWeightsExtra && (e.setVerticesData(J.MatricesWeightsExtraKind, this.matricesWeightsExtra, t), r && (yield)), this.indices ? (e.setIndices(this.indices, null, t), r && (yield)) : e.setIndices([], null), e.subMeshes && this.materialInfos && this.materialInfos.length > 1) {
      const n = e;
      n.subMeshes = [];
      for (const i of this.materialInfos)
        new rA(i.materialIndex, i.verticesStart, i.verticesCount, i.indexStart, i.indexCount, n);
    }
    return this;
  }
  _update(e, t, r) {
    return this.positions && e.updateVerticesData(J.PositionKind, this.positions, t, r), this.normals && e.updateVerticesData(J.NormalKind, this.normals, t, r), this.tangents && e.updateVerticesData(J.TangentKind, this.tangents, t, r), this.uvs && e.updateVerticesData(J.UVKind, this.uvs, t, r), this.uvs2 && e.updateVerticesData(J.UV2Kind, this.uvs2, t, r), this.uvs3 && e.updateVerticesData(J.UV3Kind, this.uvs3, t, r), this.uvs4 && e.updateVerticesData(J.UV4Kind, this.uvs4, t, r), this.uvs5 && e.updateVerticesData(J.UV5Kind, this.uvs5, t, r), this.uvs6 && e.updateVerticesData(J.UV6Kind, this.uvs6, t, r), this.colors && e.updateVerticesData(J.ColorKind, this.colors, t, r), this.matricesIndices && e.updateVerticesData(J.MatricesIndicesKind, this.matricesIndices, t, r), this.matricesWeights && e.updateVerticesData(J.MatricesWeightsKind, this.matricesWeights, t, r), this.matricesIndicesExtra && e.updateVerticesData(J.MatricesIndicesExtraKind, this.matricesIndicesExtra, t, r), this.matricesWeightsExtra && e.updateVerticesData(J.MatricesWeightsExtraKind, this.matricesWeightsExtra, t, r), this.indices && e.setIndices(this.indices, null), this;
  }
  static _TransformVector3Coordinates(e, t, r = 0, n = e.length) {
    const i = ue.Vector3[0], s = ue.Vector3[1];
    for (let a = r; a < r + n; a += 3)
      S.FromArrayToRef(e, a, i), S.TransformCoordinatesToRef(i, t, s), e[a] = s.x, e[a + 1] = s.y, e[a + 2] = s.z;
  }
  static _TransformVector3Normals(e, t, r = 0, n = e.length) {
    const i = ue.Vector3[0], s = ue.Vector3[1];
    for (let a = r; a < r + n; a += 3)
      S.FromArrayToRef(e, a, i), S.TransformNormalToRef(i, t, s), e[a] = s.x, e[a + 1] = s.y, e[a + 2] = s.z;
  }
  static _TransformVector4Normals(e, t, r = 0, n = e.length) {
    const i = ue.Vector4[0], s = ue.Vector4[1];
    for (let a = r; a < r + n; a += 4)
      Ir.FromArrayToRef(e, a, i), Ir.TransformNormalToRef(i, t, s), e[a] = s.x, e[a + 1] = s.y, e[a + 2] = s.z, e[a + 3] = s.w;
  }
  static _FlipFaces(e, t = 0, r = e.length) {
    for (let n = t; n < t + r; n += 3) {
      const i = e[n + 1];
      e[n + 1] = e[n + 2], e[n + 2] = i;
    }
  }
  /**
   * Transforms each position and each normal of the vertexData according to the passed Matrix
   * @param matrix the transforming matrix
   * @returns the VertexData
   */
  transform(e) {
    const t = e.determinant() < 0;
    return this.positions && Ut._TransformVector3Coordinates(this.positions, e), this.normals && Ut._TransformVector3Normals(this.normals, e), this.tangents && Ut._TransformVector4Normals(this.tangents, e), t && this.indices && Ut._FlipFaces(this.indices), this;
  }
  /**
   * Generates an array of vertex data where each vertex data only has one material info
   * @returns An array of VertexData
   */
  splitBasedOnMaterialID() {
    if (!this.materialInfos || this.materialInfos.length < 2)
      return [this];
    const e = [];
    for (const t of this.materialInfos) {
      const r = new Ut();
      if (this.positions && (r.positions = this.positions.slice(t.verticesStart * 3, (t.verticesCount + t.verticesStart) * 3)), this.normals && (r.normals = this.normals.slice(t.verticesStart * 3, (t.verticesCount + t.verticesStart) * 3)), this.tangents && (r.tangents = this.tangents.slice(t.verticesStart * 4, (t.verticesCount + t.verticesStart) * 4)), this.colors && (r.colors = this.colors.slice(t.verticesStart * 4, (t.verticesCount + t.verticesStart) * 4)), this.uvs && (r.uvs = this.uvs.slice(t.verticesStart * 2, (t.verticesCount + t.verticesStart) * 2)), this.uvs2 && (r.uvs2 = this.uvs2.slice(t.verticesStart * 2, (t.verticesCount + t.verticesStart) * 2)), this.uvs3 && (r.uvs3 = this.uvs3.slice(t.verticesStart * 2, (t.verticesCount + t.verticesStart) * 2)), this.uvs4 && (r.uvs4 = this.uvs4.slice(t.verticesStart * 2, (t.verticesCount + t.verticesStart) * 2)), this.uvs5 && (r.uvs5 = this.uvs5.slice(t.verticesStart * 2, (t.verticesCount + t.verticesStart) * 2)), this.uvs6 && (r.uvs6 = this.uvs6.slice(t.verticesStart * 2, (t.verticesCount + t.verticesStart) * 2)), this.matricesIndices && (r.matricesIndices = this.matricesIndices.slice(t.verticesStart * 4, (t.verticesCount + t.verticesStart) * 4)), this.matricesIndicesExtra && (r.matricesIndicesExtra = this.matricesIndicesExtra.slice(t.verticesStart * 4, (t.verticesCount + t.verticesStart) * 4)), this.matricesWeights && (r.matricesWeights = this.matricesWeights.slice(t.verticesStart * 4, (t.verticesCount + t.verticesStart) * 4)), this.matricesWeightsExtra && (r.matricesWeightsExtra = this.matricesWeightsExtra.slice(t.verticesStart * 4, (t.verticesCount + t.verticesStart) * 4)), this.indices) {
        r.indices = [];
        for (let i = t.indexStart; i < t.indexStart + t.indexCount; i++)
          r.indices.push(this.indices[i] - t.verticesStart);
      }
      const n = new wI();
      n.indexStart = 0, n.indexCount = r.indices ? r.indices.length : 0, n.materialIndex = t.materialIndex, n.verticesStart = 0, n.verticesCount = (r.positions ? r.positions.length : 0) / 3, r.materialInfos = [n], e.push(r);
    }
    return e;
  }
  /**
   * Merges the passed VertexData into the current one
   * @param others the VertexData to be merged into the current one
   * @param use32BitsIndices defines a boolean indicating if indices must be store in a 32 bits array
   * @param forceCloneIndices defines a boolean indicating if indices are forced to be cloned
   * @param mergeMaterialIds defines a boolean indicating if we need to merge the material infos
   * @param enableCompletion defines a boolean indicating if the vertex data should be completed to be compatible
   * @returns the modified VertexData
   */
  merge(e, t = !1, r = !1, n = !1, i = !1) {
    const s = Array.isArray(e) ? e.map((a) => ({ vertexData: a })) : [{ vertexData: e }];
    return mO(this._mergeCoroutine(void 0, s, t, !1, r, n, i));
  }
  /**
   * @internal
   */
  *_mergeCoroutine(e, t, r = !1, n, i, s = !1, a = !1) {
    var f, o, d, v;
    this._validate();
    let u = t.map((H) => H.vertexData), l = this;
    if (a)
      for (const H of u)
        H && (H._validate(), !this.normals && H.normals && (this.normals = new Float32Array(this.positions.length)), !this.tangents && H.tangents && (this.tangents = new Float32Array(this.positions.length / 3 * 4)), !this.uvs && H.uvs && (this.uvs = new Float32Array(this.positions.length / 3 * 2)), !this.uvs2 && H.uvs2 && (this.uvs2 = new Float32Array(this.positions.length / 3 * 2)), !this.uvs3 && H.uvs3 && (this.uvs3 = new Float32Array(this.positions.length / 3 * 2)), !this.uvs4 && H.uvs4 && (this.uvs4 = new Float32Array(this.positions.length / 3 * 2)), !this.uvs5 && H.uvs5 && (this.uvs5 = new Float32Array(this.positions.length / 3 * 2)), !this.uvs6 && H.uvs6 && (this.uvs6 = new Float32Array(this.positions.length / 3 * 2)), !this.colors && H.colors && (this.colors = new Float32Array(this.positions.length / 3 * 4), this.colors.fill(1)), !this.matricesIndices && H.matricesIndices && (this.matricesIndices = new Float32Array(this.positions.length / 3 * 4)), !this.matricesWeights && H.matricesWeights && (this.matricesWeights = new Float32Array(this.positions.length / 3 * 4)), !this.matricesIndicesExtra && H.matricesIndicesExtra && (this.matricesIndicesExtra = new Float32Array(this.positions.length / 3 * 4)), !this.matricesWeightsExtra && H.matricesWeightsExtra && (this.matricesWeightsExtra = new Float32Array(this.positions.length / 3 * 4)));
    for (const H of u)
      if (H) {
        if (a)
          this.normals && !H.normals && (H.normals = new Float32Array(H.positions.length)), this.tangents && !H.tangents && (H.tangents = new Float32Array(H.positions.length / 3 * 4)), this.uvs && !H.uvs && (H.uvs = new Float32Array(H.positions.length / 3 * 2)), this.uvs2 && !H.uvs2 && (H.uvs2 = new Float32Array(H.positions.length / 3 * 2)), this.uvs3 && !H.uvs3 && (H.uvs3 = new Float32Array(H.positions.length / 3 * 2)), this.uvs4 && !H.uvs4 && (H.uvs4 = new Float32Array(H.positions.length / 3 * 2)), this.uvs5 && !H.uvs5 && (H.uvs5 = new Float32Array(H.positions.length / 3 * 2)), this.uvs6 && !H.uvs6 && (H.uvs6 = new Float32Array(H.positions.length / 3 * 2)), this.colors && !H.colors && (H.colors = new Float32Array(H.positions.length / 3 * 4), H.colors.fill(1)), this.matricesIndices && !H.matricesIndices && (H.matricesIndices = new Float32Array(H.positions.length / 3 * 4)), this.matricesWeights && !H.matricesWeights && (H.matricesWeights = new Float32Array(H.positions.length / 3 * 4)), this.matricesIndicesExtra && !H.matricesIndicesExtra && (H.matricesIndicesExtra = new Float32Array(H.positions.length / 3 * 4)), this.matricesWeightsExtra && !H.matricesWeightsExtra && (H.matricesWeightsExtra = new Float32Array(H.positions.length / 3 * 4));
        else if (H._validate(), !this.normals != !H.normals || !this.tangents != !H.tangents || !this.uvs != !H.uvs || !this.uvs2 != !H.uvs2 || !this.uvs3 != !H.uvs3 || !this.uvs4 != !H.uvs4 || !this.uvs5 != !H.uvs5 || !this.uvs6 != !H.uvs6 || !this.colors != !H.colors || !this.matricesIndices != !H.matricesIndices || !this.matricesWeights != !H.matricesWeights || !this.matricesIndicesExtra != !H.matricesIndicesExtra || !this.matricesWeightsExtra != !H.matricesWeightsExtra)
          throw new Error("Cannot merge vertex data that do not have the same set of attributes");
      }
    if (s) {
      let H = 0, T = 0, q = 0;
      const b = [];
      let j = null;
      const w = [];
      for (const I of this.splitBasedOnMaterialID())
        w.push({ vertexData: I, transform: e });
      for (const I of t)
        if (I.vertexData)
          for (const N of I.vertexData.splitBasedOnMaterialID())
            w.push({ vertexData: N, transform: I.transform });
      w.sort((I, N) => {
        const k = I.vertexData.materialInfos ? I.vertexData.materialInfos[0].materialIndex : 0, R = N.vertexData.materialInfos ? N.vertexData.materialInfos[0].materialIndex : 0;
        return k > R ? 1 : k === R ? 0 : -1;
      });
      for (const I of w) {
        const N = I.vertexData;
        if (N.materialInfos ? H = N.materialInfos[0].materialIndex : H = 0, j && j.materialIndex === H)
          j.indexCount += N.indices.length, j.verticesCount += N.positions.length / 3;
        else {
          const k = new wI();
          k.materialIndex = H, k.indexStart = T, k.indexCount = N.indices.length, k.verticesStart = q, k.verticesCount = N.positions.length / 3, b.push(k), j = k;
        }
        T += N.indices.length, q += N.positions.length / 3;
      }
      const m = w.splice(0, 1)[0];
      l = m.vertexData, e = m.transform, u = w.map((I) => I.vertexData), t = w, this.materialInfos = b;
    }
    const P = u.reduce((H, T) => {
      var q, b;
      return H + ((b = (q = T.indices) === null || q === void 0 ? void 0 : q.length) !== null && b !== void 0 ? b : 0);
    }, (o = (f = l.indices) === null || f === void 0 ? void 0 : f.length) !== null && o !== void 0 ? o : 0);
    let c = i || u.some((H) => H.indices === l.indices) ? (d = l.indices) === null || d === void 0 ? void 0 : d.slice() : l.indices;
    if (P > 0) {
      let H = (v = c == null ? void 0 : c.length) !== null && v !== void 0 ? v : 0;
      if (c || (c = new Array(P)), c.length !== P) {
        if (Array.isArray(c))
          c.length = P;
        else {
          const q = r || c instanceof Uint32Array ? new Uint32Array(P) : new Uint16Array(P);
          q.set(c), c = q;
        }
        e && e.determinant() < 0 && Ut._FlipFaces(c, 0, H);
      }
      let T = l.positions ? l.positions.length / 3 : 0;
      for (const { vertexData: q, transform: b } of t)
        if (q.indices) {
          for (let j = 0; j < q.indices.length; j++)
            c[H + j] = q.indices[j] + T;
          b && b.determinant() < 0 && Ut._FlipFaces(c, H, q.indices.length), T += q.positions.length / 3, H += q.indices.length, n && (yield);
        }
    }
    return this.indices = c, this.positions = Ut._MergeElement(J.PositionKind, l.positions, e, t.map((H) => [H.vertexData.positions, H.transform])), n && (yield), l.normals && (this.normals = Ut._MergeElement(J.NormalKind, l.normals, e, t.map((H) => [H.vertexData.normals, H.transform])), n && (yield)), l.tangents && (this.tangents = Ut._MergeElement(J.TangentKind, l.tangents, e, t.map((H) => [H.vertexData.tangents, H.transform])), n && (yield)), l.uvs && (this.uvs = Ut._MergeElement(J.UVKind, l.uvs, e, t.map((H) => [H.vertexData.uvs, H.transform])), n && (yield)), l.uvs2 && (this.uvs2 = Ut._MergeElement(J.UV2Kind, l.uvs2, e, t.map((H) => [H.vertexData.uvs2, H.transform])), n && (yield)), l.uvs3 && (this.uvs3 = Ut._MergeElement(J.UV3Kind, l.uvs3, e, t.map((H) => [H.vertexData.uvs3, H.transform])), n && (yield)), l.uvs4 && (this.uvs4 = Ut._MergeElement(J.UV4Kind, l.uvs4, e, t.map((H) => [H.vertexData.uvs4, H.transform])), n && (yield)), l.uvs5 && (this.uvs5 = Ut._MergeElement(J.UV5Kind, l.uvs5, e, t.map((H) => [H.vertexData.uvs5, H.transform])), n && (yield)), l.uvs6 && (this.uvs6 = Ut._MergeElement(J.UV6Kind, l.uvs6, e, t.map((H) => [H.vertexData.uvs6, H.transform])), n && (yield)), l.colors && (this.colors = Ut._MergeElement(J.ColorKind, l.colors, e, t.map((H) => [H.vertexData.colors, H.transform])), n && (yield)), l.matricesIndices && (this.matricesIndices = Ut._MergeElement(J.MatricesIndicesKind, l.matricesIndices, e, t.map((H) => [H.vertexData.matricesIndices, H.transform])), n && (yield)), l.matricesWeights && (this.matricesWeights = Ut._MergeElement(J.MatricesWeightsKind, l.matricesWeights, e, t.map((H) => [H.vertexData.matricesWeights, H.transform])), n && (yield)), l.matricesIndicesExtra && (this.matricesIndicesExtra = Ut._MergeElement(J.MatricesIndicesExtraKind, l.matricesIndicesExtra, e, t.map((H) => [H.vertexData.matricesIndicesExtra, H.transform])), n && (yield)), l.matricesWeightsExtra && (this.matricesWeightsExtra = Ut._MergeElement(J.MatricesWeightsExtraKind, l.matricesWeightsExtra, e, t.map((H) => [H.vertexData.matricesWeightsExtra, H.transform]))), this;
  }
  static _MergeElement(e, t, r, n) {
    const i = n.filter((f) => f[0] !== null && f[0] !== void 0);
    if (!t && i.length == 0)
      return t;
    if (!t)
      return this._MergeElement(e, i[0][0], i[0][1], i.slice(1));
    const s = i.reduce((f, o) => f + o[0].length, t.length), a = e === J.PositionKind ? Ut._TransformVector3Coordinates : e === J.NormalKind ? Ut._TransformVector3Normals : e === J.TangentKind ? Ut._TransformVector4Normals : () => {
    };
    if (t instanceof Float32Array) {
      const f = new Float32Array(s);
      f.set(t), r && a(f, r, 0, t.length);
      let o = t.length;
      for (const [d, v] of i)
        f.set(d, o), v && a(f, v, o, d.length), o += d.length;
      return f;
    } else {
      const f = new Array(s);
      for (let d = 0; d < t.length; d++)
        f[d] = t[d];
      r && a(f, r, 0, t.length);
      let o = t.length;
      for (const [d, v] of i) {
        for (let u = 0; u < d.length; u++)
          f[o + u] = d[u];
        v && a(f, v, o, d.length), o += d.length;
      }
      return f;
    }
  }
  _validate() {
    if (!this.positions)
      throw new O0("Positions are required", Z2.MeshInvalidPositionsError);
    const e = (n, i) => {
      const s = J.DeduceStride(n);
      if (i.length % s !== 0)
        throw new Error("The " + n + "s array count must be a multiple of " + s);
      return i.length / s;
    }, t = e(J.PositionKind, this.positions), r = (n, i) => {
      const s = e(n, i);
      if (s !== t)
        throw new Error("The " + n + "s element count (" + s + ") does not match the positions count (" + t + ")");
    };
    this.normals && r(J.NormalKind, this.normals), this.tangents && r(J.TangentKind, this.tangents), this.uvs && r(J.UVKind, this.uvs), this.uvs2 && r(J.UV2Kind, this.uvs2), this.uvs3 && r(J.UV3Kind, this.uvs3), this.uvs4 && r(J.UV4Kind, this.uvs4), this.uvs5 && r(J.UV5Kind, this.uvs5), this.uvs6 && r(J.UV6Kind, this.uvs6), this.colors && r(J.ColorKind, this.colors), this.matricesIndices && r(J.MatricesIndicesKind, this.matricesIndices), this.matricesWeights && r(J.MatricesWeightsKind, this.matricesWeights), this.matricesIndicesExtra && r(J.MatricesIndicesExtraKind, this.matricesIndicesExtra), this.matricesWeightsExtra && r(J.MatricesWeightsExtraKind, this.matricesWeightsExtra);
  }
  /**
   * Clone the current vertex data
   * @returns a copy of the current data
   */
  clone() {
    const e = this.serialize();
    return Ut.Parse(e);
  }
  /**
   * Serializes the VertexData
   * @returns a serialized object
   */
  serialize() {
    const e = {};
    if (this.positions && (e.positions = Array.from(this.positions)), this.normals && (e.normals = Array.from(this.normals)), this.tangents && (e.tangents = Array.from(this.tangents)), this.uvs && (e.uvs = Array.from(this.uvs)), this.uvs2 && (e.uvs2 = Array.from(this.uvs2)), this.uvs3 && (e.uvs3 = Array.from(this.uvs3)), this.uvs4 && (e.uvs4 = Array.from(this.uvs4)), this.uvs5 && (e.uvs5 = Array.from(this.uvs5)), this.uvs6 && (e.uvs6 = Array.from(this.uvs6)), this.colors && (e.colors = Array.from(this.colors)), this.matricesIndices && (e.matricesIndices = Array.from(this.matricesIndices), e.matricesIndices._isExpanded = !0), this.matricesWeights && (e.matricesWeights = Array.from(this.matricesWeights)), this.matricesIndicesExtra && (e.matricesIndicesExtra = Array.from(this.matricesIndicesExtra), e.matricesIndicesExtra._isExpanded = !0), this.matricesWeightsExtra && (e.matricesWeightsExtra = Array.from(this.matricesWeightsExtra)), e.indices = Array.from(this.indices), this.materialInfos) {
      e.materialInfos = [];
      for (const t of this.materialInfos) {
        const r = {
          indexStart: t.indexStart,
          indexCount: t.indexCount,
          materialIndex: t.materialIndex,
          verticesStart: t.verticesStart,
          verticesCount: t.verticesCount
        };
        e.materialInfos.push(r);
      }
    }
    return e;
  }
  // Statics
  /**
   * Extracts the vertexData from a mesh
   * @param mesh the mesh from which to extract the VertexData
   * @param copyWhenShared defines if the VertexData must be cloned when shared between multiple meshes, optional, default false
   * @param forceCopy indicating that the VertexData must be cloned, optional, default false
   * @returns the object VertexData associated to the passed mesh
   */
  static ExtractFromMesh(e, t, r) {
    return Ut._ExtractFrom(e, t, r);
  }
  /**
   * Extracts the vertexData from the geometry
   * @param geometry the geometry from which to extract the VertexData
   * @param copyWhenShared defines if the VertexData must be cloned when the geometry is shared between multiple meshes, optional, default false
   * @param forceCopy indicating that the VertexData must be cloned, optional, default false
   * @returns the object VertexData associated to the passed mesh
   */
  static ExtractFromGeometry(e, t, r) {
    return Ut._ExtractFrom(e, t, r);
  }
  static _ExtractFrom(e, t, r) {
    const n = new Ut();
    return e.isVerticesDataPresent(J.PositionKind) && (n.positions = e.getVerticesData(J.PositionKind, t, r)), e.isVerticesDataPresent(J.NormalKind) && (n.normals = e.getVerticesData(J.NormalKind, t, r)), e.isVerticesDataPresent(J.TangentKind) && (n.tangents = e.getVerticesData(J.TangentKind, t, r)), e.isVerticesDataPresent(J.UVKind) && (n.uvs = e.getVerticesData(J.UVKind, t, r)), e.isVerticesDataPresent(J.UV2Kind) && (n.uvs2 = e.getVerticesData(J.UV2Kind, t, r)), e.isVerticesDataPresent(J.UV3Kind) && (n.uvs3 = e.getVerticesData(J.UV3Kind, t, r)), e.isVerticesDataPresent(J.UV4Kind) && (n.uvs4 = e.getVerticesData(J.UV4Kind, t, r)), e.isVerticesDataPresent(J.UV5Kind) && (n.uvs5 = e.getVerticesData(J.UV5Kind, t, r)), e.isVerticesDataPresent(J.UV6Kind) && (n.uvs6 = e.getVerticesData(J.UV6Kind, t, r)), e.isVerticesDataPresent(J.ColorKind) && (n.colors = e.getVerticesData(J.ColorKind, t, r)), e.isVerticesDataPresent(J.MatricesIndicesKind) && (n.matricesIndices = e.getVerticesData(J.MatricesIndicesKind, t, r)), e.isVerticesDataPresent(J.MatricesWeightsKind) && (n.matricesWeights = e.getVerticesData(J.MatricesWeightsKind, t, r)), e.isVerticesDataPresent(J.MatricesIndicesExtraKind) && (n.matricesIndicesExtra = e.getVerticesData(J.MatricesIndicesExtraKind, t, r)), e.isVerticesDataPresent(J.MatricesWeightsExtraKind) && (n.matricesWeightsExtra = e.getVerticesData(J.MatricesWeightsExtraKind, t, r)), n.indices = e.getIndices(t, r), n;
  }
  /**
   * Creates the VertexData for a Ribbon
   * @param options an object used to set the following optional parameters for the ribbon, required but can be empty
   * * pathArray array of paths, each of which an array of successive Vector3
   * * closeArray creates a seam between the first and the last paths of the pathArray, optional, default false
   * * closePath creates a seam between the first and the last points of each path of the path array, optional, default false
   * * offset a positive integer, only used when pathArray contains a single path (offset = 10 means the point 1 is joined to the point 11), default rounded half size of the pathArray length
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * * invertUV swaps in the U and V coordinates when applying a texture, optional, default false
   * * uvs a linear array, of length 2 * number of vertices, of custom UV values, optional
   * * colors a linear array, of length 4 * number of vertices, of custom color values, optional
   * @param options.pathArray
   * @param options.closeArray
   * @param options.closePath
   * @param options.offset
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @param options.invertUV
   * @param options.uvs
   * @param options.colors
   * @returns the VertexData of the ribbon
   * @deprecated use CreateRibbonVertexData instead
   */
  static CreateRibbon(e) {
    throw qn("ribbonBuilder");
  }
  /**
   * Creates the VertexData for a box
   * @param options an object used to set the following optional parameters for the box, required but can be empty
   * * size sets the width, height and depth of the box to the value of size, optional default 1
   * * width sets the width (x direction) of the box, overwrites the width set by size, optional, default size
   * * height sets the height (y direction) of the box, overwrites the height set by size, optional, default size
   * * depth sets the depth (z direction) of the box, overwrites the depth set by size, optional, default size
   * * faceUV an array of 6 Vector4 elements used to set different images to each box side
   * * faceColors an array of 6 Color3 elements used to set different colors to each box side
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param options.size
   * @param options.width
   * @param options.height
   * @param options.depth
   * @param options.faceUV
   * @param options.faceColors
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @returns the VertexData of the box
   * @deprecated Please use CreateBoxVertexData from the BoxBuilder file instead
   */
  static CreateBox(e) {
    throw qn("boxBuilder");
  }
  /**
   * Creates the VertexData for a tiled box
   * @param options an object used to set the following optional parameters for the box, required but can be empty
   * * faceTiles sets the pattern, tile size and number of tiles for a face
   * * faceUV an array of 6 Vector4 elements used to set different images to each box side
   * * faceColors an array of 6 Color3 elements used to set different colors to each box side
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * @param options.pattern
   * @param options.width
   * @param options.height
   * @param options.depth
   * @param options.tileSize
   * @param options.tileWidth
   * @param options.tileHeight
   * @param options.alignHorizontal
   * @param options.alignVertical
   * @param options.faceUV
   * @param options.faceColors
   * @param options.sideOrientation
   * @returns the VertexData of the box
   * @deprecated Please use CreateTiledBoxVertexData instead
   */
  static CreateTiledBox(e) {
    throw qn("tiledBoxBuilder");
  }
  /**
   * Creates the VertexData for a tiled plane
   * @param options an object used to set the following optional parameters for the box, required but can be empty
   * * pattern a limited pattern arrangement depending on the number
   * * tileSize sets the width, height and depth of the tile to the value of size, optional default 1
   * * tileWidth sets the width (x direction) of the tile, overwrites the width set by size, optional, default size
   * * tileHeight sets the height (y direction) of the tile, overwrites the height set by size, optional, default size
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param options.pattern
   * @param options.tileSize
   * @param options.tileWidth
   * @param options.tileHeight
   * @param options.size
   * @param options.width
   * @param options.height
   * @param options.alignHorizontal
   * @param options.alignVertical
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @returns the VertexData of the tiled plane
   * @deprecated use CreateTiledPlaneVertexData instead
   */
  static CreateTiledPlane(e) {
    throw qn("tiledPlaneBuilder");
  }
  /**
   * Creates the VertexData for an ellipsoid, defaults to a sphere
   * @param options an object used to set the following optional parameters for the box, required but can be empty
   * * segments sets the number of horizontal strips optional, default 32
   * * diameter sets the axes dimensions, diameterX, diameterY and diameterZ to the value of diameter, optional default 1
   * * diameterX sets the diameterX (x direction) of the ellipsoid, overwrites the diameterX set by diameter, optional, default diameter
   * * diameterY sets the diameterY (y direction) of the ellipsoid, overwrites the diameterY set by diameter, optional, default diameter
   * * diameterZ sets the diameterZ (z direction) of the ellipsoid, overwrites the diameterZ set by diameter, optional, default diameter
   * * arc a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the circumference (latitude) given by the arc value, optional, default 1
   * * slice a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the height (latitude) given by the arc value, optional, default 1
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param options.segments
   * @param options.diameter
   * @param options.diameterX
   * @param options.diameterY
   * @param options.diameterZ
   * @param options.arc
   * @param options.slice
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @returns the VertexData of the ellipsoid
   * @deprecated use CreateSphereVertexData instead
   */
  static CreateSphere(e) {
    throw qn("sphereBuilder");
  }
  /**
   * Creates the VertexData for a cylinder, cone or prism
   * @param options an object used to set the following optional parameters for the box, required but can be empty
   * * height sets the height (y direction) of the cylinder, optional, default 2
   * * diameterTop sets the diameter of the top of the cone, overwrites diameter,  optional, default diameter
   * * diameterBottom sets the diameter of the bottom of the cone, overwrites diameter,  optional, default diameter
   * * diameter sets the diameter of the top and bottom of the cone, optional default 1
   * * tessellation the number of prism sides, 3 for a triangular prism, optional, default 24
   * * subdivisions` the number of rings along the cylinder height, optional, default 1
   * * arc a number from 0 to 1, to create an unclosed cylinder based on the fraction of the circumference given by the arc value, optional, default 1
   * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
   * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
   * * hasRings when true makes each subdivision independently treated as a face for faceUV and faceColors, optional, default false
   * * enclose when true closes an open cylinder by adding extra flat faces between the height axis and vertical edges, think cut cake
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param options.height
   * @param options.diameterTop
   * @param options.diameterBottom
   * @param options.diameter
   * @param options.tessellation
   * @param options.subdivisions
   * @param options.arc
   * @param options.faceColors
   * @param options.faceUV
   * @param options.hasRings
   * @param options.enclose
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @returns the VertexData of the cylinder, cone or prism
   * @deprecated please use CreateCylinderVertexData instead
   */
  static CreateCylinder(e) {
    throw qn("cylinderBuilder");
  }
  /**
   * Creates the VertexData for a torus
   * @param options an object used to set the following optional parameters for the box, required but can be empty
   * * diameter the diameter of the torus, optional default 1
   * * thickness the diameter of the tube forming the torus, optional default 0.5
   * * tessellation the number of prism sides, 3 for a triangular prism, optional, default 24
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param options.diameter
   * @param options.thickness
   * @param options.tessellation
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @returns the VertexData of the torus
   * @deprecated use CreateTorusVertexData instead
   */
  static CreateTorus(e) {
    throw qn("torusBuilder");
  }
  /**
   * Creates the VertexData of the LineSystem
   * @param options an object used to set the following optional parameters for the LineSystem, required but can be empty
   *  - lines an array of lines, each line being an array of successive Vector3
   *  - colors an array of line colors, each of the line colors being an array of successive Color4, one per line point
   * @param options.lines
   * @param options.colors
   * @returns the VertexData of the LineSystem
   * @deprecated use CreateLineSystemVertexData instead
   */
  static CreateLineSystem(e) {
    throw qn("linesBuilder");
  }
  /**
   * Create the VertexData for a DashedLines
   * @param options an object used to set the following optional parameters for the DashedLines, required but can be empty
   *  - points an array successive Vector3
   *  - dashSize the size of the dashes relative to the dash number, optional, default 3
   *  - gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1
   *  - dashNb the intended total number of dashes, optional, default 200
   * @param options.points
   * @param options.dashSize
   * @param options.gapSize
   * @param options.dashNb
   * @returns the VertexData for the DashedLines
   * @deprecated use CreateDashedLinesVertexData instead
   */
  static CreateDashedLines(e) {
    throw qn("linesBuilder");
  }
  /**
   * Creates the VertexData for a Ground
   * @param options an object used to set the following optional parameters for the Ground, required but can be empty
   *  - width the width (x direction) of the ground, optional, default 1
   *  - height the height (z direction) of the ground, optional, default 1
   *  - subdivisions the number of subdivisions per side, optional, default 1
   * @param options.width
   * @param options.height
   * @param options.subdivisions
   * @param options.subdivisionsX
   * @param options.subdivisionsY
   * @returns the VertexData of the Ground
   * @deprecated Please use CreateGroundVertexData instead
   */
  static CreateGround(e) {
    throw qn("groundBuilder");
  }
  /**
   * Creates the VertexData for a TiledGround by subdividing the ground into tiles
   * @param options an object used to set the following optional parameters for the Ground, required but can be empty
   * * xmin the ground minimum X coordinate, optional, default -1
   * * zmin the ground minimum Z coordinate, optional, default -1
   * * xmax the ground maximum X coordinate, optional, default 1
   * * zmax the ground maximum Z coordinate, optional, default 1
   * * subdivisions a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the ground width and height creating 'tiles', default {w: 6, h: 6}
   * * precision a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the tile width and height, default {w: 2, h: 2}
   * @param options.xmin
   * @param options.zmin
   * @param options.xmax
   * @param options.zmax
   * @param options.subdivisions
   * @param options.subdivisions.w
   * @param options.subdivisions.h
   * @param options.precision
   * @param options.precision.w
   * @param options.precision.h
   * @returns the VertexData of the TiledGround
   * @deprecated use CreateTiledGroundVertexData instead
   */
  static CreateTiledGround(e) {
    throw qn("groundBuilder");
  }
  /**
   * Creates the VertexData of the Ground designed from a heightmap
   * @param options an object used to set the following parameters for the Ground, required and provided by CreateGroundFromHeightMap
   * * width the width (x direction) of the ground
   * * height the height (z direction) of the ground
   * * subdivisions the number of subdivisions per side
   * * minHeight the minimum altitude on the ground, optional, default 0
   * * maxHeight the maximum altitude on the ground, optional default 1
   * * colorFilter the filter to apply to the image pixel colors to compute the height, optional Color3, default (0.3, 0.59, 0.11)
   * * buffer the array holding the image color data
   * * bufferWidth the width of image
   * * bufferHeight the height of image
   * * alphaFilter Remove any data where the alpha channel is below this value, defaults 0 (all data visible)
   * @param options.width
   * @param options.height
   * @param options.subdivisions
   * @param options.minHeight
   * @param options.maxHeight
   * @param options.colorFilter
   * @param options.buffer
   * @param options.bufferWidth
   * @param options.bufferHeight
   * @param options.alphaFilter
   * @returns the VertexData of the Ground designed from a heightmap
   * @deprecated use CreateGroundFromHeightMapVertexData instead
   */
  static CreateGroundFromHeightMap(e) {
    throw qn("groundBuilder");
  }
  /**
   * Creates the VertexData for a Plane
   * @param options an object used to set the following optional parameters for the plane, required but can be empty
   * * size sets the width and height of the plane to the value of size, optional default 1
   * * width sets the width (x direction) of the plane, overwrites the width set by size, optional, default size
   * * height sets the height (y direction) of the plane, overwrites the height set by size, optional, default size
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param options.size
   * @param options.width
   * @param options.height
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @returns the VertexData of the box
   * @deprecated use CreatePlaneVertexData instead
   */
  static CreatePlane(e) {
    throw qn("planeBuilder");
  }
  /**
   * Creates the VertexData of the Disc or regular Polygon
   * @param options an object used to set the following optional parameters for the disc, required but can be empty
   * * radius the radius of the disc, optional default 0.5
   * * tessellation the number of polygon sides, optional, default 64
   * * arc a number from 0 to 1, to create an unclosed polygon based on the fraction of the circumference given by the arc value, optional, default 1
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param options.radius
   * @param options.tessellation
   * @param options.arc
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @returns the VertexData of the box
   * @deprecated use CreateDiscVertexData instead
   */
  static CreateDisc(e) {
    throw qn("discBuilder");
  }
  /**
   * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()
   * All parameters are provided by CreatePolygon as needed
   * @param polygon a mesh built from polygonTriangulation.build()
   * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
   * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
   * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param wrap a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side
   * @returns the VertexData of the Polygon
   * @deprecated use CreatePolygonVertexData instead
   */
  static CreatePolygon(e, t, r, n, i, s, a) {
    throw qn("polygonBuilder");
  }
  /**
   * Creates the VertexData of the IcoSphere
   * @param options an object used to set the following optional parameters for the IcoSphere, required but can be empty
   * * radius the radius of the IcoSphere, optional default 1
   * * radiusX allows stretching in the x direction, optional, default radius
   * * radiusY allows stretching in the y direction, optional, default radius
   * * radiusZ allows stretching in the z direction, optional, default radius
   * * flat when true creates a flat shaded mesh, optional, default true
   * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param options.radius
   * @param options.radiusX
   * @param options.radiusY
   * @param options.radiusZ
   * @param options.flat
   * @param options.subdivisions
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @returns the VertexData of the IcoSphere
   * @deprecated use CreateIcoSphereVertexData instead
   */
  static CreateIcoSphere(e) {
    throw qn("icoSphereBuilder");
  }
  // inspired from // http://stemkoski.github.io/Three.js/Polyhedra.html
  /**
   * Creates the VertexData for a Polyhedron
   * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
   * * type provided types are:
   *  * 0 : Tetrahedron, 1 : Octahedron, 2 : Dodecahedron, 3 : Icosahedron, 4 : Rhombicuboctahedron, 5 : Triangular Prism, 6 : Pentagonal Prism, 7 : Hexagonal Prism, 8 : Square Pyramid (J1)
   *  * 9 : Pentagonal Pyramid (J2), 10 : Triangular Dipyramid (J12), 11 : Pentagonal Dipyramid (J13), 12 : Elongated Square Dipyramid (J15), 13 : Elongated Pentagonal Dipyramid (J16), 14 : Elongated Pentagonal Cupola (J20)
   * * size the size of the IcoSphere, optional default 1
   * * sizeX allows stretching in the x direction, optional, default size
   * * sizeY allows stretching in the y direction, optional, default size
   * * sizeZ allows stretching in the z direction, optional, default size
   * * custom a number that overwrites the type to create from an extended set of polyhedron from https://www.babylonjs-playground.com/#21QRSK#15 with minimised editor
   * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
   * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
   * * flat when true creates a flat shaded mesh, optional, default true
   * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param options.type
   * @param options.size
   * @param options.sizeX
   * @param options.sizeY
   * @param options.sizeZ
   * @param options.custom
   * @param options.faceUV
   * @param options.faceColors
   * @param options.flat
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @returns the VertexData of the Polyhedron
   * @deprecated use CreatePolyhedronVertexData instead
   */
  static CreatePolyhedron(e) {
    throw qn("polyhedronBuilder");
  }
  /**
   * Creates the VertexData for a Capsule, inspired from https://github.com/maximeq/three-js-capsule-geometry/blob/master/src/CapsuleBufferGeometry.js
   * @param options an object used to set the following optional parameters for the capsule, required but can be empty
   * @returns the VertexData of the Capsule
   * @deprecated Please use CreateCapsuleVertexData from the capsuleBuilder file instead
   */
  static CreateCapsule(e = {
    orientation: S.Up(),
    subdivisions: 2,
    tessellation: 16,
    height: 1,
    radius: 0.25,
    capSubdivisions: 6
  }) {
    throw qn("capsuleBuilder");
  }
  // based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3D/src/away3d/primitives/TorusKnot.as?spec=svn2473&r=2473
  /**
   * Creates the VertexData for a TorusKnot
   * @param options an object used to set the following optional parameters for the TorusKnot, required but can be empty
   * * radius the radius of the torus knot, optional, default 2
   * * tube the thickness of the tube, optional, default 0.5
   * * radialSegments the number of sides on each tube segments, optional, default 32
   * * tubularSegments the number of tubes to decompose the knot into, optional, default 32
   * * p the number of windings around the z axis, optional,  default 2
   * * q the number of windings around the x axis, optional,  default 3
   * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
   * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
   * @param options.radius
   * @param options.tube
   * @param options.radialSegments
   * @param options.tubularSegments
   * @param options.p
   * @param options.q
   * @param options.sideOrientation
   * @param options.frontUVs
   * @param options.backUVs
   * @returns the VertexData of the Torus Knot
   * @deprecated use CreateTorusKnotVertexData instead
   */
  static CreateTorusKnot(e) {
    throw qn("torusKnotBuilder");
  }
  // Tools
  /**
   * Compute normals for given positions and indices
   * @param positions an array of vertex positions, [...., x, y, z, ......]
   * @param indices an array of indices in groups of three for each triangular facet, [...., i, j, k, ......]
   * @param normals an array of vertex normals, [...., x, y, z, ......]
   * @param options an object used to set the following optional parameters for the TorusKnot, optional
   * * facetNormals : optional array of facet normals (vector3)
   * * facetPositions : optional array of facet positions (vector3)
   * * facetPartitioning : optional partitioning array. facetPositions is required for facetPartitioning computation
   * * ratio : optional partitioning ratio / bounding box, required for facetPartitioning computation
   * * bInfo : optional bounding info, required for facetPartitioning computation
   * * bbSize : optional bounding box size data, required for facetPartitioning computation
   * * subDiv : optional partitioning data about subdivisions on  each axis (int), required for facetPartitioning computation
   * * useRightHandedSystem: optional boolean to for right handed system computation
   * * depthSort : optional boolean to enable the facet depth sort computation
   * * distanceTo : optional Vector3 to compute the facet depth from this location
   * * depthSortedFacets : optional array of depthSortedFacets to store the facet distances from the reference location
   * @param options.facetNormals
   * @param options.facetPositions
   * @param options.facetPartitioning
   * @param options.ratio
   * @param options.bInfo
   * @param options.bbSize
   * @param options.subDiv
   * @param options.useRightHandedSystem
   * @param options.depthSort
   * @param options.distanceTo
   * @param options.depthSortedFacets
   */
  static ComputeNormals(e, t, r, n) {
    let i = 0, s = 0, a = 0, f = 0, o = 0, d = 0, v = 0, u = 0, l = 0, P = 0, p = 0, c = 0, H = 0, T = 0, q = 0, b = 0, j = 0, w = 0, m = 0, I = 0, N = !1, k = !1, R = !1, y = !1, O = 1, Y = 0, ee = null;
    n && (N = !!n.facetNormals, k = !!n.facetPositions, R = !!n.facetPartitioning, O = n.useRightHandedSystem === !0 ? -1 : 1, Y = n.ratio || 0, y = !!n.depthSort, ee = n.distanceTo, y && ee === void 0 && (ee = S.Zero()));
    let Z = 0, te = 0, fe = 0, _ = 0;
    for (R && n && n.bbSize && (Z = n.subDiv.X * Y / n.bbSize.x, te = n.subDiv.Y * Y / n.bbSize.y, fe = n.subDiv.Z * Y / n.bbSize.z, _ = n.subDiv.max * n.subDiv.max, n.facetPartitioning.length = 0), i = 0; i < e.length; i++)
      r[i] = 0;
    const G = t.length / 3 | 0;
    for (i = 0; i < G; i++) {
      if (c = t[i * 3] * 3, H = c + 1, T = c + 2, q = t[i * 3 + 1] * 3, b = q + 1, j = q + 2, w = t[i * 3 + 2] * 3, m = w + 1, I = w + 2, s = e[c] - e[q], a = e[H] - e[b], f = e[T] - e[j], o = e[w] - e[q], d = e[m] - e[b], v = e[I] - e[j], u = O * (a * v - f * d), l = O * (f * o - s * v), P = O * (s * d - a * o), p = Math.sqrt(u * u + l * l + P * P), p = p === 0 ? 1 : p, u /= p, l /= p, P /= p, N && n && (n.facetNormals[i].x = u, n.facetNormals[i].y = l, n.facetNormals[i].z = P), k && n && (n.facetPositions[i].x = (e[c] + e[q] + e[w]) / 3, n.facetPositions[i].y = (e[H] + e[b] + e[m]) / 3, n.facetPositions[i].z = (e[T] + e[j] + e[I]) / 3), R && n) {
        const L = Math.floor((n.facetPositions[i].x - n.bInfo.minimum.x * Y) * Z), $ = Math.floor((n.facetPositions[i].y - n.bInfo.minimum.y * Y) * te), ae = Math.floor((n.facetPositions[i].z - n.bInfo.minimum.z * Y) * fe), Pe = Math.floor((e[c] - n.bInfo.minimum.x * Y) * Z), ge = Math.floor((e[H] - n.bInfo.minimum.y * Y) * te), me = Math.floor((e[T] - n.bInfo.minimum.z * Y) * fe), Xe = Math.floor((e[q] - n.bInfo.minimum.x * Y) * Z), De = Math.floor((e[b] - n.bInfo.minimum.y * Y) * te), ne = Math.floor((e[j] - n.bInfo.minimum.z * Y) * fe), re = Math.floor((e[w] - n.bInfo.minimum.x * Y) * Z), ve = Math.floor((e[m] - n.bInfo.minimum.y * Y) * te), qe = Math.floor((e[I] - n.bInfo.minimum.z * Y) * fe), ke = Pe + n.subDiv.max * ge + _ * me, be = Xe + n.subDiv.max * De + _ * ne, Fe = re + n.subDiv.max * ve + _ * qe, Ke = L + n.subDiv.max * $ + _ * ae;
        n.facetPartitioning[Ke] = n.facetPartitioning[Ke] ? n.facetPartitioning[Ke] : new Array(), n.facetPartitioning[ke] = n.facetPartitioning[ke] ? n.facetPartitioning[ke] : new Array(), n.facetPartitioning[be] = n.facetPartitioning[be] ? n.facetPartitioning[be] : new Array(), n.facetPartitioning[Fe] = n.facetPartitioning[Fe] ? n.facetPartitioning[Fe] : new Array(), n.facetPartitioning[ke].push(i), be != ke && n.facetPartitioning[be].push(i), Fe == be || Fe == ke || n.facetPartitioning[Fe].push(i), Ke == ke || Ke == be || Ke == Fe || n.facetPartitioning[Ke].push(i);
      }
      if (y && n && n.facetPositions) {
        const L = n.depthSortedFacets[i];
        L.ind = i * 3, L.sqDistance = S.DistanceSquared(n.facetPositions[i], ee);
      }
      r[c] += u, r[H] += l, r[T] += P, r[q] += u, r[b] += l, r[j] += P, r[w] += u, r[m] += l, r[I] += P;
    }
    for (i = 0; i < r.length / 3; i++)
      u = r[i * 3], l = r[i * 3 + 1], P = r[i * 3 + 2], p = Math.sqrt(u * u + l * l + P * P), p = p === 0 ? 1 : p, u /= p, l /= p, P /= p, r[i * 3] = u, r[i * 3 + 1] = l, r[i * 3 + 2] = P;
  }
  /**
   * @internal
   */
  static _ComputeSides(e, t, r, n, i, s, a) {
    const f = r.length, o = n.length;
    let d, v;
    switch (e = e || Ut.DEFAULTSIDE, e) {
      case Ut.FRONTSIDE:
        break;
      case Ut.BACKSIDE:
        for (d = 0; d < f; d += 3) {
          const u = r[d];
          r[d] = r[d + 2], r[d + 2] = u;
        }
        for (v = 0; v < o; v++)
          n[v] = -n[v];
        break;
      case Ut.DOUBLESIDE: {
        const u = t.length, l = u / 3;
        for (let c = 0; c < u; c++)
          t[u + c] = t[c];
        for (d = 0; d < f; d += 3)
          r[d + f] = r[d + 2] + l, r[d + 1 + f] = r[d + 1] + l, r[d + 2 + f] = r[d] + l;
        for (v = 0; v < o; v++)
          n[o + v] = -n[v];
        const P = i.length;
        let p = 0;
        for (p = 0; p < P; p++)
          i[p + P] = i[p];
        for (s = s || new Ir(0, 0, 1, 1), a = a || new Ir(0, 0, 1, 1), p = 0, d = 0; d < P / 2; d++)
          i[p] = s.x + (s.z - s.x) * i[p], i[p + 1] = s.y + (s.w - s.y) * i[p + 1], i[p + P] = a.x + (a.z - a.x) * i[p + P], i[p + P + 1] = a.y + (a.w - a.y) * i[p + P + 1], p += 2;
        break;
      }
    }
  }
  /**
   * Creates a VertexData from serialized data
   * @param parsedVertexData the parsed data from an imported file
   * @returns a VertexData
   */
  static Parse(e) {
    const t = new Ut(), r = e.positions;
    r && t.set(r, J.PositionKind);
    const n = e.normals;
    n && t.set(n, J.NormalKind);
    const i = e.tangents;
    i && t.set(i, J.TangentKind);
    const s = e.uvs;
    s && t.set(s, J.UVKind);
    const a = e.uvs2;
    a && t.set(a, J.UV2Kind);
    const f = e.uvs3;
    f && t.set(f, J.UV3Kind);
    const o = e.uvs4;
    o && t.set(o, J.UV4Kind);
    const d = e.uvs5;
    d && t.set(d, J.UV5Kind);
    const v = e.uvs6;
    v && t.set(v, J.UV6Kind);
    const u = e.colors;
    u && t.set(xt.CheckColors4(u, r.length / 3), J.ColorKind);
    const l = e.matricesIndices;
    l && t.set(l, J.MatricesIndicesKind);
    const P = e.matricesWeights;
    P && t.set(P, J.MatricesWeightsKind);
    const p = e.indices;
    p && (t.indices = p);
    const c = e.materialInfos;
    if (c) {
      t.materialInfos = [];
      for (const H of c) {
        const T = new wI();
        T.indexCount = H.indexCount, T.indexStart = H.indexStart, T.verticesCount = H.verticesCount, T.verticesStart = H.verticesStart, T.materialIndex = H.materialIndex, t.materialInfos.push(T);
      }
    }
    return t;
  }
  /**
   * Applies VertexData created from the imported parameters to the geometry
   * @param parsedVertexData the parsed data from an imported file
   * @param geometry the geometry to apply the VertexData to
   */
  static ImportVertexData(e, t) {
    const r = Ut.Parse(e);
    t.setAllVerticesData(r, e.updatable);
  }
}
Ut.FRONTSIDE = 0;
Ut.BACKSIDE = 1;
Ut.DOUBLESIDE = 2;
Ut.DEFAULTSIDE = 0;
Ut._UniqueIDGenerator = 0;
C([
  Hq.filter((...[A]) => !Array.isArray(A))
], Ut, "_TransformVector3Coordinates", null);
C([
  Hq.filter((...[A]) => !Array.isArray(A))
], Ut, "_TransformVector3Normals", null);
C([
  Hq.filter((...[A]) => !Array.isArray(A))
], Ut, "_TransformVector4Normals", null);
C([
  Hq.filter((...[A]) => !Array.isArray(A))
], Ut, "_FlipFaces", null);
class l9 {
  /**
   * Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data
   */
  static get ForceFullSceneLoadingForIncremental() {
    return l9._ForceFullSceneLoadingForIncremental;
  }
  static set ForceFullSceneLoadingForIncremental(e) {
    l9._ForceFullSceneLoadingForIncremental = e;
  }
  /**
   * Gets or sets a boolean indicating if loading screen must be displayed while loading a scene
   */
  static get ShowLoadingScreen() {
    return l9._ShowLoadingScreen;
  }
  static set ShowLoadingScreen(e) {
    l9._ShowLoadingScreen = e;
  }
  /**
   * Defines the current logging level (while loading the scene)
   * @ignorenaming
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static get loggingLevel() {
    return l9._LoggingLevel;
  }
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static set loggingLevel(e) {
    l9._LoggingLevel = e;
  }
  /**
   * Gets or set a boolean indicating if matrix weights must be cleaned upon loading
   */
  static get CleanBoneMatrixWeights() {
    return l9._CleanBoneMatrixWeights;
  }
  static set CleanBoneMatrixWeights(e) {
    l9._CleanBoneMatrixWeights = e;
  }
}
l9._ForceFullSceneLoadingForIncremental = !1;
l9._ShowLoadingScreen = !0;
l9._CleanBoneMatrixWeights = !1;
l9._LoggingLevel = 0;
class us {
}
us.UseOpenGLOrientationForUV = !1;
class Tf {
  /**
   *  Gets or sets the Bias Vector to apply on the bounding elements (box/sphere), the max extend is computed as v += v * bias.x + bias.y, the min is computed as v -= v * bias.x + bias.y
   */
  get boundingBias() {
    return this._boundingBias;
  }
  /**
   *  Gets or sets the Bias Vector to apply on the bounding elements (box/sphere), the max extend is computed as v += v * bias.x + bias.y, the min is computed as v -= v * bias.x + bias.y
   */
  set boundingBias(e) {
    this._boundingBias ? this._boundingBias.copyFrom(e) : this._boundingBias = e.clone(), this._updateBoundingInfo(!0, null);
  }
  /**
   * Static function used to attach a new empty geometry to a mesh
   * @param mesh defines the mesh to attach the geometry to
   * @returns the new Geometry
   */
  static CreateGeometryForMesh(e) {
    const t = new Tf(Tf.RandomId(), e.getScene());
    return t.applyToMesh(e), t;
  }
  /** Get the list of meshes using this geometry */
  get meshes() {
    return this._meshes;
  }
  /**
   * Creates a new geometry
   * @param id defines the unique ID
   * @param scene defines the hosting scene
   * @param vertexData defines the VertexData used to get geometry data
   * @param updatable defines if geometry must be updatable (false by default)
   * @param mesh defines the mesh that will be associated with the geometry
   */
  constructor(e, t, r, n = !1, i = null) {
    this.delayLoadState = 0, this._totalVertices = 0, this._isDisposed = !1, this._indexBufferIsUpdatable = !1, this._positionsCache = [], this._parentContainer = null, this.useBoundingInfoFromGeometry = !1, this._scene = t || gr.LastCreatedScene, this._scene && (this.id = e, this.uniqueId = this._scene.getUniqueId(), this._engine = this._scene.getEngine(), this._meshes = [], this._vertexBuffers = {}, this._indices = [], this._updatable = n, r ? this.setAllVerticesData(r, n) : this._totalVertices = 0, this._engine.getCaps().vertexArrayObject && (this._vertexArrayObjects = {}), i && (this.applyToMesh(i), i.computeWorldMatrix(!0)));
  }
  /**
   * Gets the current extend of the geometry
   */
  get extend() {
    return this._extend;
  }
  /**
   * Gets the hosting scene
   * @returns the hosting Scene
   */
  getScene() {
    return this._scene;
  }
  /**
   * Gets the hosting engine
   * @returns the hosting Engine
   */
  getEngine() {
    return this._engine;
  }
  /**
   * Defines if the geometry is ready to use
   * @returns true if the geometry is ready to be used
   */
  isReady() {
    return this.delayLoadState === 1 || this.delayLoadState === 0;
  }
  /**
   * Gets a value indicating that the geometry should not be serialized
   */
  get doNotSerialize() {
    for (let e = 0; e < this._meshes.length; e++)
      if (!this._meshes[e].doNotSerialize)
        return !1;
    return !0;
  }
  /** @internal */
  _rebuild() {
    this._vertexArrayObjects && (this._vertexArrayObjects = {}), this._meshes.length !== 0 && this._indices && (this._indexBuffer = this._engine.createIndexBuffer(this._indices, this._updatable));
    for (const e in this._vertexBuffers)
      this._vertexBuffers[e]._rebuild();
  }
  /**
   * Affects all geometry data in one call
   * @param vertexData defines the geometry data
   * @param updatable defines if the geometry must be flagged as updatable (false as default)
   */
  setAllVerticesData(e, t) {
    e.applyToGeometry(this, t), this._notifyUpdate();
  }
  /**
   * Set specific vertex data
   * @param kind defines the data kind (Position, normal, etc...)
   * @param data defines the vertex data to use
   * @param updatable defines if the vertex must be flagged as updatable (false as default)
   * @param stride defines the stride to use (0 by default). This value is deduced from the kind value if not specified
   */
  setVerticesData(e, t, r = !1, n) {
    r && Array.isArray(t) && (t = new Float32Array(t));
    const i = new J(this._engine, t, e, {
      updatable: r,
      postponeInternalCreation: this._meshes.length === 0,
      stride: n,
      label: "Geometry_" + this.id + "_" + e
    });
    this.setVerticesBuffer(i);
  }
  /**
   * Removes a specific vertex data
   * @param kind defines the data kind (Position, normal, etc...)
   */
  removeVerticesData(e) {
    this._vertexBuffers[e] && (this._vertexBuffers[e].dispose(), delete this._vertexBuffers[e]), this._vertexArrayObjects && this._disposeVertexArrayObjects();
  }
  /**
   * Affect a vertex buffer to the geometry. the vertexBuffer.getKind() function is used to determine where to store the data
   * @param buffer defines the vertex buffer to use
   * @param totalVertices defines the total number of vertices for position kind (could be null)
   * @param disposeExistingBuffer disposes the existing buffer, if any (default: true)
   */
  setVerticesBuffer(e, t = null, r = !0) {
    const n = e.getKind();
    this._vertexBuffers[n] && r && this._vertexBuffers[n].dispose(), e._buffer && e._buffer._increaseReferences(), this._vertexBuffers[n] = e;
    const i = this._meshes, s = i.length;
    if (n === J.PositionKind) {
      this._totalVertices = t ?? e.totalVertices, this._updateExtend(e.getFloatData()), this._resetPointsArrayCache();
      const a = this._extend && this._extend.minimum || new S(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE), f = this._extend && this._extend.maximum || new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
      for (let o = 0; o < s; o++) {
        const d = i[o];
        d.buildBoundingInfo(a, f), d._createGlobalSubMesh(d.isUnIndexed), d.computeWorldMatrix(!0), d.synchronizeInstances();
      }
    }
    this._notifyUpdate(n);
  }
  /**
   * Update a specific vertex buffer
   * This function will directly update the underlying DataBuffer according to the passed numeric array or Float32Array
   * It will do nothing if the buffer is not updatable
   * @param kind defines the data kind (Position, normal, etc...)
   * @param data defines the data to use
   * @param offset defines the offset in the target buffer where to store the data
   * @param useBytes set to true if the offset is in bytes
   */
  updateVerticesDataDirectly(e, t, r, n = !1) {
    const i = this.getVertexBuffer(e);
    i && (i.updateDirectly(t, r, n), this._notifyUpdate(e));
  }
  /**
   * Update a specific vertex buffer
   * This function will create a new buffer if the current one is not updatable
   * @param kind defines the data kind (Position, normal, etc...)
   * @param data defines the data to use
   * @param updateExtends defines if the geometry extends must be recomputed (false by default)
   */
  updateVerticesData(e, t, r = !1) {
    const n = this.getVertexBuffer(e);
    n && (n.update(t), e === J.PositionKind && this._updateBoundingInfo(r, t), this._notifyUpdate(e));
  }
  _updateBoundingInfo(e, t) {
    if (e && this._updateExtend(t), this._resetPointsArrayCache(), e) {
      const r = this._meshes;
      for (const n of r) {
        n.hasBoundingInfo ? n.getBoundingInfo().reConstruct(this._extend.minimum, this._extend.maximum) : n.buildBoundingInfo(this._extend.minimum, this._extend.maximum);
        const i = n.subMeshes;
        for (const s of i)
          s.refreshBoundingInfo();
      }
    }
  }
  /**
   * @internal
   */
  _bind(e, t, r, n) {
    if (!e)
      return;
    t === void 0 && (t = this._indexBuffer);
    const i = this.getVertexBuffers();
    if (!i)
      return;
    if (t != this._indexBuffer || !this._vertexArrayObjects && !n) {
      this._engine.bindBuffers(i, t, e, r);
      return;
    }
    const s = n || this._vertexArrayObjects;
    s[e.key] || (s[e.key] = this._engine.recordVertexArrayObject(i, t, e, r)), this._engine.bindVertexArrayObject(s[e.key], t);
  }
  /**
   * Gets total number of vertices
   * @returns the total number of vertices
   */
  getTotalVertices() {
    return this.isReady() ? this._totalVertices : 0;
  }
  /**
   * Gets a specific vertex data attached to this geometry. Float data is constructed if the vertex buffer data cannot be returned directly.
   * @param kind defines the data kind (Position, normal, etc...)
   * @param copyWhenShared defines if the returned array must be cloned upon returning it if the current geometry is shared between multiple meshes
   * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
   * @returns a float array containing vertex data
   */
  getVerticesData(e, t, r) {
    const n = this.getVertexBuffer(e);
    return n ? n.getFloatData(this._totalVertices, r || t && this._meshes.length !== 1) : null;
  }
  /**
   * Returns a boolean defining if the vertex data for the requested `kind` is updatable
   * @param kind defines the data kind (Position, normal, etc...)
   * @returns true if the vertex buffer with the specified kind is updatable
   */
  isVertexBufferUpdatable(e) {
    const t = this._vertexBuffers[e];
    return t ? t.isUpdatable() : !1;
  }
  /**
   * Gets a specific vertex buffer
   * @param kind defines the data kind (Position, normal, etc...)
   * @returns a VertexBuffer
   */
  getVertexBuffer(e) {
    return this.isReady() ? this._vertexBuffers[e] : null;
  }
  /**
   * Returns all vertex buffers
   * @returns an object holding all vertex buffers indexed by kind
   */
  getVertexBuffers() {
    return this.isReady() ? this._vertexBuffers : null;
  }
  /**
   * Gets a boolean indicating if specific vertex buffer is present
   * @param kind defines the data kind (Position, normal, etc...)
   * @returns true if data is present
   */
  isVerticesDataPresent(e) {
    return this._vertexBuffers ? this._vertexBuffers[e] !== void 0 : this._delayInfo ? this._delayInfo.indexOf(e) !== -1 : !1;
  }
  /**
   * Gets a list of all attached data kinds (Position, normal, etc...)
   * @returns a list of string containing all kinds
   */
  getVerticesDataKinds() {
    const e = [];
    let t;
    if (!this._vertexBuffers && this._delayInfo)
      for (t in this._delayInfo)
        e.push(t);
    else
      for (t in this._vertexBuffers)
        e.push(t);
    return e;
  }
  /**
   * Update index buffer
   * @param indices defines the indices to store in the index buffer
   * @param offset defines the offset in the target buffer where to store the data
   * @param gpuMemoryOnly defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
   */
  updateIndices(e, t, r = !1) {
    if (this._indexBuffer)
      if (!this._indexBufferIsUpdatable)
        this.setIndices(e, null, !0);
      else {
        const n = e.length !== this._indices.length;
        if (r || (this._indices = e.slice()), this._engine.updateDynamicIndexBuffer(this._indexBuffer, e, t), n)
          for (const i of this._meshes)
            i._createGlobalSubMesh(!0);
      }
  }
  /**
   * Sets the index buffer for this geometry.
   * @param indexBuffer Defines the index buffer to use for this geometry
   * @param totalVertices Defines the total number of vertices used by the buffer
   * @param totalIndices Defines the total number of indices in the index buffer
   */
  setIndexBuffer(e, t, r) {
    this._indices = [], this._indexBufferIsUpdatable = !1, this._indexBuffer = e, this._totalVertices = t, this._totalIndices = r, e.is32Bits || (e.is32Bits = this._totalIndices > 65535);
    for (const n of this._meshes)
      n._createGlobalSubMesh(!0), n.synchronizeInstances();
    this._notifyUpdate();
  }
  /**
   * Creates a new index buffer
   * @param indices defines the indices to store in the index buffer
   * @param totalVertices defines the total number of vertices (could be null)
   * @param updatable defines if the index buffer must be flagged as updatable (false by default)
   */
  setIndices(e, t = null, r = !1) {
    this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer), this._indices = e, this._indexBufferIsUpdatable = r, this._meshes.length !== 0 && this._indices && (this._indexBuffer = this._engine.createIndexBuffer(this._indices, r)), t != null && (this._totalVertices = t);
    for (const n of this._meshes)
      n._createGlobalSubMesh(!0), n.synchronizeInstances();
    this._notifyUpdate();
  }
  /**
   * Return the total number of indices
   * @returns the total number of indices
   */
  getTotalIndices() {
    return this.isReady() ? this._totalIndices !== void 0 ? this._totalIndices : this._indices.length : 0;
  }
  /**
   * Gets the index buffer array
   * @param copyWhenShared defines if the returned array must be cloned upon returning it if the current geometry is shared between multiple meshes
   * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
   * @returns the index buffer array
   */
  getIndices(e, t) {
    if (!this.isReady())
      return null;
    const r = this._indices;
    return !t && (!e || this._meshes.length === 1) ? r : r.slice();
  }
  /**
   * Gets the index buffer
   * @returns the index buffer
   */
  getIndexBuffer() {
    return this.isReady() ? this._indexBuffer : null;
  }
  /**
   * @internal
   */
  _releaseVertexArrayObject(e = null) {
    !e || !this._vertexArrayObjects || this._vertexArrayObjects[e.key] && (this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]), delete this._vertexArrayObjects[e.key]);
  }
  /**
   * Release the associated resources for a specific mesh
   * @param mesh defines the source mesh
   * @param shouldDispose defines if the geometry must be disposed if there is no more mesh pointing to it
   */
  releaseForMesh(e, t) {
    const r = this._meshes, n = r.indexOf(e);
    n !== -1 && (r.splice(n, 1), this._vertexArrayObjects && e._invalidateInstanceVertexArrayObject(), e._geometry = null, r.length === 0 && t && this.dispose());
  }
  /**
   * Apply current geometry to a given mesh
   * @param mesh defines the mesh to apply geometry to
   */
  applyToMesh(e) {
    if (e._geometry === this)
      return;
    const t = e._geometry;
    t && t.releaseForMesh(e), this._vertexArrayObjects && e._invalidateInstanceVertexArrayObject();
    const r = this._meshes;
    e._geometry = this, e._internalAbstractMeshDataInfo._positions = null, this._scene.pushGeometry(this), r.push(e), this.isReady() ? this._applyToMesh(e) : this._boundingInfo && e.setBoundingInfo(this._boundingInfo);
  }
  _updateExtend(e = null) {
    if (this.useBoundingInfoFromGeometry && this._boundingInfo)
      this._extend = {
        minimum: this._boundingInfo.minimum.clone(),
        maximum: this._boundingInfo.maximum.clone()
      };
    else {
      if (!e && (e = this.getVerticesData(J.PositionKind), !e))
        return;
      this._extend = WS(e, 0, this._totalVertices, this.boundingBias, 3);
    }
  }
  _applyToMesh(e) {
    const t = this._meshes.length;
    for (const r in this._vertexBuffers)
      t === 1 && this._vertexBuffers[r].create(), r === J.PositionKind && (this._extend || this._updateExtend(), e.buildBoundingInfo(this._extend.minimum, this._extend.maximum), e._createGlobalSubMesh(e.isUnIndexed), e._updateBoundingInfo());
    t === 1 && this._indices && this._indices.length > 0 && (this._indexBuffer = this._engine.createIndexBuffer(this._indices, this._updatable)), e._syncGeometryWithMorphTargetManager(), e.synchronizeInstances();
  }
  _notifyUpdate(e) {
    this.onGeometryUpdated && this.onGeometryUpdated(this, e), this._vertexArrayObjects && this._disposeVertexArrayObjects();
    for (const t of this._meshes)
      t._markSubMeshesAsAttributesDirty();
  }
  /**
   * Load the geometry if it was flagged as delay loaded
   * @param scene defines the hosting scene
   * @param onLoaded defines a callback called when the geometry is loaded
   */
  load(e, t) {
    if (this.delayLoadState !== 2) {
      if (this.isReady()) {
        t && t();
        return;
      }
      this.delayLoadState = 2, this._queueLoad(e, t);
    }
  }
  _queueLoad(e, t) {
    this.delayLoadingFile && (e.addPendingData(this), e._loadFile(this.delayLoadingFile, (r) => {
      if (!this._delayLoadingFunction)
        return;
      this._delayLoadingFunction(JSON.parse(r), this), this.delayLoadState = 1, this._delayInfo = [], e.removePendingData(this);
      const n = this._meshes, i = n.length;
      for (let s = 0; s < i; s++)
        this._applyToMesh(n[s]);
      t && t();
    }, void 0, !0));
  }
  /**
   * Invert the geometry to move from a right handed system to a left handed one.
   */
  toLeftHanded() {
    const e = this.getIndices(!1);
    if (e != null && e.length > 0) {
      for (let n = 0; n < e.length; n += 3) {
        const i = e[n + 0];
        e[n + 0] = e[n + 2], e[n + 2] = i;
      }
      this.setIndices(e);
    }
    const t = this.getVerticesData(J.PositionKind, !1);
    if (t != null && t.length > 0) {
      for (let n = 0; n < t.length; n += 3)
        t[n + 2] = -t[n + 2];
      this.setVerticesData(J.PositionKind, t, !1);
    }
    const r = this.getVerticesData(J.NormalKind, !1);
    if (r != null && r.length > 0) {
      for (let n = 0; n < r.length; n += 3)
        r[n + 2] = -r[n + 2];
      this.setVerticesData(J.NormalKind, r, !1);
    }
  }
  // Cache
  /** @internal */
  _resetPointsArrayCache() {
    this._positions = null;
  }
  /** @internal */
  _generatePointsArray() {
    if (this._positions)
      return !0;
    const e = this.getVerticesData(J.PositionKind);
    if (!e || e.length === 0)
      return !1;
    for (let t = this._positionsCache.length * 3, r = this._positionsCache.length; t < e.length; t += 3, ++r)
      this._positionsCache[r] = S.FromArray(e, t);
    for (let t = 0, r = 0; t < e.length; t += 3, ++r)
      this._positionsCache[r].set(e[0 + t], e[1 + t], e[2 + t]);
    return this._positionsCache.length = e.length / 3, this._positions = this._positionsCache, !0;
  }
  /**
   * Gets a value indicating if the geometry is disposed
   * @returns true if the geometry was disposed
   */
  isDisposed() {
    return this._isDisposed;
  }
  _disposeVertexArrayObjects() {
    if (this._vertexArrayObjects) {
      for (const r in this._vertexArrayObjects)
        this._engine.releaseVertexArrayObject(this._vertexArrayObjects[r]);
      this._vertexArrayObjects = {};
      const e = this._meshes, t = e.length;
      for (let r = 0; r < t; r++)
        e[r]._invalidateInstanceVertexArrayObject();
    }
  }
  /**
   * Free all associated resources
   */
  dispose() {
    const e = this._meshes, t = e.length;
    let r;
    for (r = 0; r < t; r++)
      this.releaseForMesh(e[r]);
    this._meshes.length = 0, this._disposeVertexArrayObjects();
    for (const n in this._vertexBuffers)
      this._vertexBuffers[n].dispose();
    if (this._vertexBuffers = {}, this._totalVertices = 0, this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null, this._indices = [], this.delayLoadState = 0, this.delayLoadingFile = null, this._delayLoadingFunction = null, this._delayInfo = [], this._boundingInfo = null, this._scene.removeGeometry(this), this._parentContainer) {
      const n = this._parentContainer.geometries.indexOf(this);
      n > -1 && this._parentContainer.geometries.splice(n, 1), this._parentContainer = null;
    }
    this._isDisposed = !0;
  }
  /**
   * Clone the current geometry into a new geometry
   * @param id defines the unique ID of the new geometry
   * @returns a new geometry object
   */
  copy(e) {
    const t = new Ut();
    t.indices = [];
    const r = this.getIndices();
    if (r)
      for (let f = 0; f < r.length; f++)
        t.indices.push(r[f]);
    let n = !1, i = !1, s;
    for (s in this._vertexBuffers) {
      const f = this.getVerticesData(s);
      if (f && (f instanceof Float32Array ? t.set(new Float32Array(f), s) : t.set(f.slice(0), s), !i)) {
        const o = this.getVertexBuffer(s);
        o && (n = o.isUpdatable(), i = !n);
      }
    }
    const a = new Tf(e, this._scene, t, n);
    a.delayLoadState = this.delayLoadState, a.delayLoadingFile = this.delayLoadingFile, a._delayLoadingFunction = this._delayLoadingFunction;
    for (s in this._delayInfo)
      a._delayInfo = a._delayInfo || [], a._delayInfo.push(s);
    return a._boundingInfo = new Md(this._extend.minimum, this._extend.maximum), a;
  }
  /**
   * Serialize the current geometry info (and not the vertices data) into a JSON object
   * @returns a JSON representation of the current geometry data (without the vertices data)
   */
  serialize() {
    const e = {};
    return e.id = this.id, e.uniqueId = this.uniqueId, e.updatable = this._updatable, Zi && Zi.HasTags(this) && (e.tags = Zi.GetTags(this)), e;
  }
  _toNumberArray(e) {
    return Array.isArray(e) ? e : Array.prototype.slice.call(e);
  }
  /**
   * Release any memory retained by the cached data on the Geometry.
   *
   * Call this function to reduce memory footprint of the mesh.
   * Vertex buffers will not store CPU data anymore (this will prevent picking, collisions or physics to work correctly)
   */
  clearCachedData() {
    this._indices = [], this._resetPointsArrayCache();
    for (const e in this._vertexBuffers)
      Object.prototype.hasOwnProperty.call(this._vertexBuffers, e) && (this._vertexBuffers[e]._buffer._data = null);
  }
  /**
   * Serialize all vertices data into a JSON object
   * @returns a JSON representation of the current geometry data
   */
  serializeVerticeData() {
    const e = this.serialize();
    return this.isVerticesDataPresent(J.PositionKind) && (e.positions = this._toNumberArray(this.getVerticesData(J.PositionKind)), this.isVertexBufferUpdatable(J.PositionKind) && (e.positions._updatable = !0)), this.isVerticesDataPresent(J.NormalKind) && (e.normals = this._toNumberArray(this.getVerticesData(J.NormalKind)), this.isVertexBufferUpdatable(J.NormalKind) && (e.normals._updatable = !0)), this.isVerticesDataPresent(J.TangentKind) && (e.tangents = this._toNumberArray(this.getVerticesData(J.TangentKind)), this.isVertexBufferUpdatable(J.TangentKind) && (e.tangents._updatable = !0)), this.isVerticesDataPresent(J.UVKind) && (e.uvs = this._toNumberArray(this.getVerticesData(J.UVKind)), this.isVertexBufferUpdatable(J.UVKind) && (e.uvs._updatable = !0)), this.isVerticesDataPresent(J.UV2Kind) && (e.uvs2 = this._toNumberArray(this.getVerticesData(J.UV2Kind)), this.isVertexBufferUpdatable(J.UV2Kind) && (e.uvs2._updatable = !0)), this.isVerticesDataPresent(J.UV3Kind) && (e.uvs3 = this._toNumberArray(this.getVerticesData(J.UV3Kind)), this.isVertexBufferUpdatable(J.UV3Kind) && (e.uvs3._updatable = !0)), this.isVerticesDataPresent(J.UV4Kind) && (e.uvs4 = this._toNumberArray(this.getVerticesData(J.UV4Kind)), this.isVertexBufferUpdatable(J.UV4Kind) && (e.uvs4._updatable = !0)), this.isVerticesDataPresent(J.UV5Kind) && (e.uvs5 = this._toNumberArray(this.getVerticesData(J.UV5Kind)), this.isVertexBufferUpdatable(J.UV5Kind) && (e.uvs5._updatable = !0)), this.isVerticesDataPresent(J.UV6Kind) && (e.uvs6 = this._toNumberArray(this.getVerticesData(J.UV6Kind)), this.isVertexBufferUpdatable(J.UV6Kind) && (e.uvs6._updatable = !0)), this.isVerticesDataPresent(J.ColorKind) && (e.colors = this._toNumberArray(this.getVerticesData(J.ColorKind)), this.isVertexBufferUpdatable(J.ColorKind) && (e.colors._updatable = !0)), this.isVerticesDataPresent(J.MatricesIndicesKind) && (e.matricesIndices = this._toNumberArray(this.getVerticesData(J.MatricesIndicesKind)), e.matricesIndices._isExpanded = !0, this.isVertexBufferUpdatable(J.MatricesIndicesKind) && (e.matricesIndices._updatable = !0)), this.isVerticesDataPresent(J.MatricesWeightsKind) && (e.matricesWeights = this._toNumberArray(this.getVerticesData(J.MatricesWeightsKind)), this.isVertexBufferUpdatable(J.MatricesWeightsKind) && (e.matricesWeights._updatable = !0)), e.indices = this._toNumberArray(this.getIndices()), e;
  }
  // Statics
  /**
   * Extracts a clone of a mesh geometry
   * @param mesh defines the source mesh
   * @param id defines the unique ID of the new geometry object
   * @returns the new geometry object
   */
  static ExtractFromMesh(e, t) {
    const r = e._geometry;
    return r ? r.copy(t) : null;
  }
  /**
   * You should now use Tools.RandomId(), this method is still here for legacy reasons.
   * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523
   * Be aware Math.random() could cause collisions, but:
   * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide"
   * @returns a string containing a new GUID
   */
  static RandomId() {
    return ye.RandomId();
  }
  static _GetGeometryByLoadedUniqueId(e, t) {
    for (let r = 0; r < t.geometries.length; r++)
      if (t.geometries[r]._loadedUniqueId === e)
        return t.geometries[r];
    return null;
  }
  /**
   * @internal
   */
  static _ImportGeometry(e, t) {
    const r = t.getScene(), n = e.geometryUniqueId, i = e.geometryId;
    if (n || i) {
      const s = n ? this._GetGeometryByLoadedUniqueId(n, r) : r.getGeometryById(i);
      s && s.applyToMesh(t);
    } else if (e instanceof ArrayBuffer) {
      const s = t._binaryInfo;
      if (s.positionsAttrDesc && s.positionsAttrDesc.count > 0) {
        const a = new Float32Array(e, s.positionsAttrDesc.offset, s.positionsAttrDesc.count);
        t.setVerticesData(J.PositionKind, a, !1);
      }
      if (s.normalsAttrDesc && s.normalsAttrDesc.count > 0) {
        const a = new Float32Array(e, s.normalsAttrDesc.offset, s.normalsAttrDesc.count);
        t.setVerticesData(J.NormalKind, a, !1);
      }
      if (s.tangetsAttrDesc && s.tangetsAttrDesc.count > 0) {
        const a = new Float32Array(e, s.tangetsAttrDesc.offset, s.tangetsAttrDesc.count);
        t.setVerticesData(J.TangentKind, a, !1);
      }
      if (s.uvsAttrDesc && s.uvsAttrDesc.count > 0) {
        const a = new Float32Array(e, s.uvsAttrDesc.offset, s.uvsAttrDesc.count);
        if (us.UseOpenGLOrientationForUV)
          for (let f = 1; f < a.length; f += 2)
            a[f] = 1 - a[f];
        t.setVerticesData(J.UVKind, a, !1);
      }
      if (s.uvs2AttrDesc && s.uvs2AttrDesc.count > 0) {
        const a = new Float32Array(e, s.uvs2AttrDesc.offset, s.uvs2AttrDesc.count);
        if (us.UseOpenGLOrientationForUV)
          for (let f = 1; f < a.length; f += 2)
            a[f] = 1 - a[f];
        t.setVerticesData(J.UV2Kind, a, !1);
      }
      if (s.uvs3AttrDesc && s.uvs3AttrDesc.count > 0) {
        const a = new Float32Array(e, s.uvs3AttrDesc.offset, s.uvs3AttrDesc.count);
        if (us.UseOpenGLOrientationForUV)
          for (let f = 1; f < a.length; f += 2)
            a[f] = 1 - a[f];
        t.setVerticesData(J.UV3Kind, a, !1);
      }
      if (s.uvs4AttrDesc && s.uvs4AttrDesc.count > 0) {
        const a = new Float32Array(e, s.uvs4AttrDesc.offset, s.uvs4AttrDesc.count);
        if (us.UseOpenGLOrientationForUV)
          for (let f = 1; f < a.length; f += 2)
            a[f] = 1 - a[f];
        t.setVerticesData(J.UV4Kind, a, !1);
      }
      if (s.uvs5AttrDesc && s.uvs5AttrDesc.count > 0) {
        const a = new Float32Array(e, s.uvs5AttrDesc.offset, s.uvs5AttrDesc.count);
        if (us.UseOpenGLOrientationForUV)
          for (let f = 1; f < a.length; f += 2)
            a[f] = 1 - a[f];
        t.setVerticesData(J.UV5Kind, a, !1);
      }
      if (s.uvs6AttrDesc && s.uvs6AttrDesc.count > 0) {
        const a = new Float32Array(e, s.uvs6AttrDesc.offset, s.uvs6AttrDesc.count);
        if (us.UseOpenGLOrientationForUV)
          for (let f = 1; f < a.length; f += 2)
            a[f] = 1 - a[f];
        t.setVerticesData(J.UV6Kind, a, !1);
      }
      if (s.colorsAttrDesc && s.colorsAttrDesc.count > 0) {
        const a = new Float32Array(e, s.colorsAttrDesc.offset, s.colorsAttrDesc.count);
        t.setVerticesData(J.ColorKind, a, !1, s.colorsAttrDesc.stride);
      }
      if (s.matricesIndicesAttrDesc && s.matricesIndicesAttrDesc.count > 0) {
        const a = new Int32Array(e, s.matricesIndicesAttrDesc.offset, s.matricesIndicesAttrDesc.count), f = [];
        for (let o = 0; o < a.length; o++) {
          const d = a[o];
          f.push(d & 255), f.push((d & 65280) >> 8), f.push((d & 16711680) >> 16), f.push(d >> 24 & 255);
        }
        t.setVerticesData(J.MatricesIndicesKind, f, !1);
      }
      if (s.matricesIndicesExtraAttrDesc && s.matricesIndicesExtraAttrDesc.count > 0) {
        const a = new Int32Array(e, s.matricesIndicesExtraAttrDesc.offset, s.matricesIndicesExtraAttrDesc.count), f = [];
        for (let o = 0; o < a.length; o++) {
          const d = a[o];
          f.push(d & 255), f.push((d & 65280) >> 8), f.push((d & 16711680) >> 16), f.push(d >> 24 & 255);
        }
        t.setVerticesData(J.MatricesIndicesExtraKind, f, !1);
      }
      if (s.matricesWeightsAttrDesc && s.matricesWeightsAttrDesc.count > 0) {
        const a = new Float32Array(e, s.matricesWeightsAttrDesc.offset, s.matricesWeightsAttrDesc.count);
        t.setVerticesData(J.MatricesWeightsKind, a, !1);
      }
      if (s.indicesAttrDesc && s.indicesAttrDesc.count > 0) {
        const a = new Int32Array(e, s.indicesAttrDesc.offset, s.indicesAttrDesc.count);
        t.setIndices(a, null);
      }
      if (s.subMeshesAttrDesc && s.subMeshesAttrDesc.count > 0) {
        const a = new Int32Array(e, s.subMeshesAttrDesc.offset, s.subMeshesAttrDesc.count * 5);
        t.subMeshes = [];
        for (let f = 0; f < s.subMeshesAttrDesc.count; f++) {
          const o = a[f * 5 + 0], d = a[f * 5 + 1], v = a[f * 5 + 2], u = a[f * 5 + 3], l = a[f * 5 + 4];
          rA.AddToMesh(o, d, v, u, l, t);
        }
      }
    } else if (e.positions && e.normals && e.indices) {
      if (t.setVerticesData(J.PositionKind, e.positions, e.positions._updatable), t.setVerticesData(J.NormalKind, e.normals, e.normals._updatable), e.tangents && t.setVerticesData(J.TangentKind, e.tangents, e.tangents._updatable), e.uvs && t.setVerticesData(J.UVKind, e.uvs, e.uvs._updatable), e.uvs2 && t.setVerticesData(J.UV2Kind, e.uvs2, e.uvs2._updatable), e.uvs3 && t.setVerticesData(J.UV3Kind, e.uvs3, e.uvs3._updatable), e.uvs4 && t.setVerticesData(J.UV4Kind, e.uvs4, e.uvs4._updatable), e.uvs5 && t.setVerticesData(J.UV5Kind, e.uvs5, e.uvs5._updatable), e.uvs6 && t.setVerticesData(J.UV6Kind, e.uvs6, e.uvs6._updatable), e.colors && t.setVerticesData(J.ColorKind, xt.CheckColors4(e.colors, e.positions.length / 3), e.colors._updatable), e.matricesIndices)
        if (e.matricesIndices._isExpanded)
          delete e.matricesIndices._isExpanded, t.setVerticesData(J.MatricesIndicesKind, e.matricesIndices, e.matricesIndices._updatable);
        else {
          const s = [];
          for (let a = 0; a < e.matricesIndices.length; a++) {
            const f = e.matricesIndices[a];
            s.push(f & 255), s.push((f & 65280) >> 8), s.push((f & 16711680) >> 16), s.push(f >> 24 & 255);
          }
          t.setVerticesData(J.MatricesIndicesKind, s, e.matricesIndices._updatable);
        }
      if (e.matricesIndicesExtra)
        if (e.matricesIndicesExtra._isExpanded)
          delete e.matricesIndices._isExpanded, t.setVerticesData(J.MatricesIndicesExtraKind, e.matricesIndicesExtra, e.matricesIndicesExtra._updatable);
        else {
          const s = [];
          for (let a = 0; a < e.matricesIndicesExtra.length; a++) {
            const f = e.matricesIndicesExtra[a];
            s.push(f & 255), s.push((f & 65280) >> 8), s.push((f & 16711680) >> 16), s.push(f >> 24 & 255);
          }
          t.setVerticesData(J.MatricesIndicesExtraKind, s, e.matricesIndicesExtra._updatable);
        }
      e.matricesWeights && (Tf._CleanMatricesWeights(e, t), t.setVerticesData(J.MatricesWeightsKind, e.matricesWeights, e.matricesWeights._updatable)), e.matricesWeightsExtra && t.setVerticesData(J.MatricesWeightsExtraKind, e.matricesWeightsExtra, e.matricesWeights._updatable), t.setIndices(e.indices, null);
    }
    if (e.subMeshes) {
      t.subMeshes = [];
      for (let s = 0; s < e.subMeshes.length; s++) {
        const a = e.subMeshes[s];
        rA.AddToMesh(a.materialIndex, a.verticesStart, a.verticesCount, a.indexStart, a.indexCount, t);
      }
    }
    t._shouldGenerateFlatShading && (t.convertToFlatShadedMesh(), t._shouldGenerateFlatShading = !1), t.computeWorldMatrix(!0), r.onMeshImportedObservable.notifyObservers(t);
  }
  static _CleanMatricesWeights(e, t) {
    if (!l9.CleanBoneMatrixWeights)
      return;
    let n = 0;
    if (e.skeletonId > -1) {
      const v = t.getScene().getLastSkeletonById(e.skeletonId);
      if (!v)
        return;
      n = v.bones.length;
    } else
      return;
    const i = t.getVerticesData(J.MatricesIndicesKind), s = t.getVerticesData(J.MatricesIndicesExtraKind), a = e.matricesWeights, f = e.matricesWeightsExtra, o = e.numBoneInfluencer, d = a.length;
    for (let v = 0; v < d; v += 4) {
      let u = 0, l = -1;
      for (let P = 0; P < 4; P++) {
        const p = a[v + P];
        u += p, p < 1e-3 && l < 0 && (l = P);
      }
      if (f)
        for (let P = 0; P < 4; P++) {
          const p = f[v + P];
          u += p, p < 1e-3 && l < 0 && (l = P + 4);
        }
      if ((l < 0 || l > o - 1) && (l = o - 1), u > 1e-3) {
        const P = 1 / u;
        for (let p = 0; p < 4; p++)
          a[v + p] *= P;
        if (f)
          for (let p = 0; p < 4; p++)
            f[v + p] *= P;
      } else
        l >= 4 ? (f[v + l - 4] = 1 - u, s[v + l - 4] = n) : (a[v + l] = 1 - u, i[v + l] = n);
    }
    t.setVerticesData(J.MatricesIndicesKind, i), e.matricesWeightsExtra && t.setVerticesData(J.MatricesIndicesExtraKind, s);
  }
  /**
   * Create a new geometry from persisted data (Using .babylon file format)
   * @param parsedVertexData defines the persisted data
   * @param scene defines the hosting scene
   * @param rootUrl defines the root url to use to load assets (like delayed data)
   * @returns the new geometry object
   */
  static Parse(e, t, r) {
    const n = new Tf(e.id, t, void 0, e.updatable);
    return n._loadedUniqueId = e.uniqueId, Zi && Zi.AddTagsTo(n, e.tags), e.delayLoadingFile ? (n.delayLoadState = 4, n.delayLoadingFile = r + e.delayLoadingFile, n._boundingInfo = new Md(S.FromArray(e.boundingBoxMinimum), S.FromArray(e.boundingBoxMaximum)), n._delayInfo = [], e.hasUVs && n._delayInfo.push(J.UVKind), e.hasUVs2 && n._delayInfo.push(J.UV2Kind), e.hasUVs3 && n._delayInfo.push(J.UV3Kind), e.hasUVs4 && n._delayInfo.push(J.UV4Kind), e.hasUVs5 && n._delayInfo.push(J.UV5Kind), e.hasUVs6 && n._delayInfo.push(J.UV6Kind), e.hasColors && n._delayInfo.push(J.ColorKind), e.hasMatricesIndices && n._delayInfo.push(J.MatricesIndicesKind), e.hasMatricesWeights && n._delayInfo.push(J.MatricesWeightsKind), n._delayLoadingFunction = Ut.ImportVertexData) : Ut.ImportVertexData(e, n), t.pushGeometry(n, !0), n;
  }
}
class iee {
  /**
   * constructor
   * @param frameSampleSize The number of samples required to saturate the sliding window
   */
  constructor(e = 30) {
    this._enabled = !0, this._rollingFrameTime = new see(e);
  }
  /**
   * Samples current frame
   * @param timeMs A timestamp in milliseconds of the current frame to compare with other frames
   */
  sampleFrame(e = Yi.Now) {
    if (this._enabled) {
      if (this._lastFrameTimeMs != null) {
        const t = e - this._lastFrameTimeMs;
        this._rollingFrameTime.add(t);
      }
      this._lastFrameTimeMs = e;
    }
  }
  /**
   * Returns the average frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
   */
  get averageFrameTime() {
    return this._rollingFrameTime.average;
  }
  /**
   * Returns the variance frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
   */
  get averageFrameTimeVariance() {
    return this._rollingFrameTime.variance;
  }
  /**
   * Returns the frame time of the most recent frame
   */
  get instantaneousFrameTime() {
    return this._rollingFrameTime.history(0);
  }
  /**
   * Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far)
   */
  get averageFPS() {
    return 1e3 / this._rollingFrameTime.average;
  }
  /**
   * Returns the average framerate in frames per second using the most recent frame time
   */
  get instantaneousFPS() {
    const e = this._rollingFrameTime.history(0);
    return e === 0 ? 0 : 1e3 / e;
  }
  /**
   * Returns true if enough samples have been taken to completely fill the sliding window
   */
  get isSaturated() {
    return this._rollingFrameTime.isSaturated();
  }
  /**
   * Enables contributions to the sliding window sample set
   */
  enable() {
    this._enabled = !0;
  }
  /**
   * Disables contributions to the sliding window sample set
   * Samples will not be interpolated over the disabled period
   */
  disable() {
    this._enabled = !1, this._lastFrameTimeMs = null;
  }
  /**
   * Returns true if sampling is enabled
   */
  get isEnabled() {
    return this._enabled;
  }
  /**
   * Resets performance monitor
   */
  reset() {
    this._lastFrameTimeMs = null, this._rollingFrameTime.reset();
  }
}
class see {
  /**
   * constructor
   * @param length The number of samples required to saturate the sliding window
   */
  constructor(e) {
    this._samples = new Array(e), this.reset();
  }
  /**
   * Adds a sample to the sample set
   * @param v The sample value
   */
  add(e) {
    let t;
    if (this.isSaturated()) {
      const r = this._samples[this._pos];
      t = r - this.average, this.average -= t / (this._sampleCount - 1), this._m2 -= t * (r - this.average);
    } else
      this._sampleCount++;
    t = e - this.average, this.average += t / this._sampleCount, this._m2 += t * (e - this.average), this.variance = this._m2 / (this._sampleCount - 1), this._samples[this._pos] = e, this._pos++, this._pos %= this._samples.length;
  }
  /**
   * Returns previously added values or null if outside of history or outside the sliding window domain
   * @param i Index in history. For example, pass 0 for the most recent value and 1 for the value before that
   * @returns Value previously recorded with add() or null if outside of range
   */
  history(e) {
    if (e >= this._sampleCount || e >= this._samples.length)
      return 0;
    const t = this._wrapPosition(this._pos - 1);
    return this._samples[this._wrapPosition(t - e)];
  }
  /**
   * Returns true if enough samples have been taken to completely fill the sliding window
   * @returns true if sample-set saturated
   */
  isSaturated() {
    return this._sampleCount >= this._samples.length;
  }
  /**
   * Resets the rolling average (equivalent to 0 samples taken so far)
   */
  reset() {
    this.average = 0, this.variance = 0, this._sampleCount = 0, this._pos = 0, this._m2 = 0;
  }
  /**
   * Wraps a value around the sample range boundaries
   * @param i Position in sample range, for example if the sample length is 5, and i is -3, then 2 will be returned.
   * @returns Wrapped position in sample range
   */
  _wrapPosition(e) {
    const t = this._samples.length;
    return (e % t + t) % t;
  }
}
hr.prototype.setAlphaConstants = function(A, e, t, r) {
  this._alphaState.setAlphaBlendConstants(A, e, t, r);
};
hr.prototype.setAlphaMode = function(A, e = !1) {
  if (this._alphaMode === A) {
    if (!e) {
      const t = A === 0;
      this.depthCullingState.depthMask !== t && (this.depthCullingState.depthMask = t);
    }
    return;
  }
  switch (A) {
    case 0:
      this._alphaState.alphaBlend = !1;
      break;
    case 7:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
      break;
    case 8:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;
      break;
    case 2:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
      break;
    case 6:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;
      break;
    case 1:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;
      break;
    case 3:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
      break;
    case 4:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
      break;
    case 5:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
      break;
    case 9:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA), this._alphaState.alphaBlend = !0;
      break;
    case 10:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;
      break;
    case 11:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
      break;
    case 12:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ZERO), this._alphaState.alphaBlend = !0;
      break;
    case 13:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE_MINUS_DST_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;
      break;
    case 14:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;
      break;
    case 15:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ZERO), this._alphaState.alphaBlend = !0;
      break;
    case 16:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;
      break;
    case 17:
      this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;
      break;
  }
  e || (this.depthCullingState.depthMask = A === 0), this._alphaMode = A;
};
hr.prototype.getAlphaMode = function() {
  return this._alphaMode;
};
hr.prototype.setAlphaEquation = function(A) {
  if (this._alphaEquation !== A) {
    switch (A) {
      case 0:
        this._alphaState.setAlphaEquationParameters(32774, 32774);
        break;
      case 1:
        this._alphaState.setAlphaEquationParameters(32778, 32778);
        break;
      case 2:
        this._alphaState.setAlphaEquationParameters(32779, 32779);
        break;
      case 3:
        this._alphaState.setAlphaEquationParameters(32776, 32776);
        break;
      case 4:
        this._alphaState.setAlphaEquationParameters(32775, 32775);
        break;
      case 5:
        this._alphaState.setAlphaEquationParameters(32775, 32774);
        break;
    }
    this._alphaEquation = A;
  }
};
hr.prototype.getAlphaEquation = function() {
  return this._alphaEquation;
};
function KC(A, e, t = !1, r) {
  switch (A) {
    case 3: {
      const i = e instanceof ArrayBuffer ? new Int8Array(e) : new Int8Array(e);
      return r && i.set(new Int8Array(r)), i;
    }
    case 0: {
      const i = e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(e);
      return r && i.set(new Uint8Array(r)), i;
    }
    case 4: {
      const i = e instanceof ArrayBuffer ? new Int16Array(e) : new Int16Array(t ? e / 2 : e);
      return r && i.set(new Int16Array(r)), i;
    }
    case 5:
    case 8:
    case 9:
    case 10:
    case 2: {
      const i = e instanceof ArrayBuffer ? new Uint16Array(e) : new Uint16Array(t ? e / 2 : e);
      return r && i.set(new Uint16Array(r)), i;
    }
    case 6: {
      const i = e instanceof ArrayBuffer ? new Int32Array(e) : new Int32Array(t ? e / 4 : e);
      return r && i.set(new Int32Array(r)), i;
    }
    case 7:
    case 11:
    case 12:
    case 13:
    case 14:
    case 15: {
      const i = e instanceof ArrayBuffer ? new Uint32Array(e) : new Uint32Array(t ? e / 4 : e);
      return r && i.set(new Uint32Array(r)), i;
    }
    case 1: {
      const i = e instanceof ArrayBuffer ? new Float32Array(e) : new Float32Array(t ? e / 4 : e);
      return r && i.set(new Float32Array(r)), i;
    }
  }
  const n = e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(e);
  return r && n.set(new Uint8Array(r)), n;
}
hr.prototype._readTexturePixelsSync = function(A, e, t, r = -1, n = 0, i = null, s = !0, a = !1, f = 0, o = 0) {
  var d, v;
  const u = this._gl;
  if (!u)
    throw new Error("Engine does not have gl rendering context.");
  if (!this._dummyFramebuffer) {
    const P = u.createFramebuffer();
    if (!P)
      throw new Error("Unable to create dummy framebuffer");
    this._dummyFramebuffer = P;
  }
  u.bindFramebuffer(u.FRAMEBUFFER, this._dummyFramebuffer), r > -1 ? u.framebufferTexture2D(u.FRAMEBUFFER, u.COLOR_ATTACHMENT0, u.TEXTURE_CUBE_MAP_POSITIVE_X + r, (d = A._hardwareTexture) === null || d === void 0 ? void 0 : d.underlyingResource, n) : u.framebufferTexture2D(u.FRAMEBUFFER, u.COLOR_ATTACHMENT0, u.TEXTURE_2D, (v = A._hardwareTexture) === null || v === void 0 ? void 0 : v.underlyingResource, n);
  let l = A.type !== void 0 ? this._getWebGLTextureType(A.type) : u.UNSIGNED_BYTE;
  if (a)
    i || (i = KC(A.type, 4 * e * t));
  else
    switch (l) {
      case u.UNSIGNED_BYTE:
        i || (i = new Uint8Array(4 * e * t)), l = u.UNSIGNED_BYTE;
        break;
      default:
        i || (i = new Float32Array(4 * e * t)), l = u.FLOAT;
        break;
    }
  return s && this.flushFramebuffer(), u.readPixels(f, o, e, t, u.RGBA, l, i), u.bindFramebuffer(u.FRAMEBUFFER, this._currentFramebuffer), i;
};
hr.prototype._readTexturePixels = function(A, e, t, r = -1, n = 0, i = null, s = !0, a = !1, f = 0, o = 0) {
  return Promise.resolve(this._readTexturePixelsSync(A, e, t, r, n, i, s, a, f, o));
};
hr.prototype.updateDynamicIndexBuffer = function(A, e, t = 0) {
  this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null, this.bindIndexBuffer(A);
  let r;
  A.is32Bits ? r = e instanceof Uint32Array ? e : new Uint32Array(e) : r = e instanceof Uint16Array ? e : new Uint16Array(e), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, r, this._gl.DYNAMIC_DRAW), this._resetIndexBufferBinding();
};
hr.prototype.updateDynamicVertexBuffer = function(A, e, t, r) {
  this.bindArrayBuffer(A), t === void 0 && (t = 0);
  const n = e.byteLength || e.length;
  r === void 0 || r >= n && t === 0 ? e instanceof Array ? this._gl.bufferSubData(this._gl.ARRAY_BUFFER, t, new Float32Array(e)) : this._gl.bufferSubData(this._gl.ARRAY_BUFFER, t, e) : e instanceof Array ? this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, new Float32Array(e).subarray(t, t + r)) : (e instanceof ArrayBuffer ? e = new Uint8Array(e, t, r) : e = new Uint8Array(e.buffer, e.byteOffset + t, r), this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, e)), this._resetVertexBufferBinding();
};
class Ge extends hr {
  /**
   * Returns the current npm package of the sdk
   */
  // Not mixed with Version for tooling purpose.
  static get NpmPackage() {
    return hr.NpmPackage;
  }
  /**
   * Returns the current version of the framework
   */
  static get Version() {
    return hr.Version;
  }
  /** Gets the list of created engines */
  static get Instances() {
    return gr.Instances;
  }
  /**
   * Gets the latest created engine
   */
  static get LastCreatedEngine() {
    return gr.LastCreatedEngine;
  }
  /**
   * Gets the latest created scene
   */
  static get LastCreatedScene() {
    return gr.LastCreatedScene;
  }
  /** @internal */
  /**
   * Engine abstraction for loading and creating an image bitmap from a given source string.
   * @param imageSource source to load the image from.
   * @param options An object that sets options for the image's extraction.
   * @returns ImageBitmap.
   */
  _createImageBitmapFromSource(e, t) {
    return new Promise((n, i) => {
      const s = new Image();
      s.onload = () => {
        s.decode().then(() => {
          this.createImageBitmap(s, t).then((a) => {
            n(a);
          });
        });
      }, s.onerror = () => {
        i(`Error loading image ${s.src}`);
      }, s.src = e;
    });
  }
  /**
   * Engine abstraction for createImageBitmap
   * @param image source for image
   * @param options An object that sets options for the image's extraction.
   * @returns ImageBitmap
   */
  createImageBitmap(e, t) {
    return createImageBitmap(e, t);
  }
  /**
   * Resize an image and returns the image data as an uint8array
   * @param image image to resize
   * @param bufferWidth destination buffer width
   * @param bufferHeight destination buffer height
   * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size
   */
  resizeImageBitmap(e, t, r) {
    const i = this.createCanvas(t, r).getContext("2d");
    if (!i)
      throw new Error("Unable to get 2d context for resizeImageBitmap");
    return i.drawImage(e, 0, 0), i.getImageData(0, 0, t, r).data;
  }
  /**
   * Will flag all materials in all scenes in all engines as dirty to trigger new shader compilation
   * @param flag defines which part of the materials must be marked as dirty
   * @param predicate defines a predicate used to filter which materials should be affected
   */
  static MarkAllMaterialsAsDirty(e, t) {
    for (let r = 0; r < Ge.Instances.length; r++) {
      const n = Ge.Instances[r];
      for (let i = 0; i < n.scenes.length; i++)
        n.scenes[i].markAllMaterialsAsDirty(e, t);
    }
  }
  /**
   * Method called to create the default loading screen.
   * This can be overridden in your own app.
   * @param canvas The rendering canvas element
   * @returns The loading screen
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static DefaultLoadingScreenFactory(e) {
    throw qn("LoadingScreen");
  }
  get _supportsHardwareTextureRescaling() {
    return !!Ge._RescalePostProcessFactory;
  }
  /**
   * Gets the performance monitor attached to this engine
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
   */
  get performanceMonitor() {
    return this._performanceMonitor;
  }
  /**
   * (WebGPU only) True (default) to be in compatibility mode, meaning rendering all existing scenes without artifacts (same rendering than WebGL).
   * Setting the property to false will improve performances but may not work in some scenes if some precautions are not taken.
   * See https://doc.babylonjs.com/setup/support/webGPU/webGPUOptimization/webGPUNonCompatibilityMode for more details
   */
  get compatibilityMode() {
    return this._compatibilityMode;
  }
  set compatibilityMode(e) {
    this._compatibilityMode = !0;
  }
  // Events
  /**
   * Gets the HTML element used to attach event listeners
   * @returns a HTML element
   */
  getInputElement() {
    return this._renderingCanvas;
  }
  /**
   * Creates a new engine
   * @param canvasOrContext defines the canvas or WebGL context to use for rendering. If you provide a WebGL context, Babylon.js will not hook events on the canvas (like pointers, keyboards, etc...) so no event observables will be available. This is mostly used when Babylon.js is used as a plugin on a system which already used the WebGL context
   * @param antialias defines enable antialiasing (default: false)
   * @param options defines further options to be sent to the getContext() function
   * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
   */
  constructor(e, t, r, n = !1) {
    if (super(e, t, r, n), this.enableOfflineSupport = !1, this.disableManifestCheck = !1, this.disableContextMenu = !0, this.scenes = [], this._virtualScenes = new Array(), this.onNewSceneAddedObservable = new Oe(), this.postProcesses = [], this.isPointerLock = !1, this.onResizeObservable = new Oe(), this.onCanvasBlurObservable = new Oe(), this.onCanvasFocusObservable = new Oe(), this.onCanvasPointerOutObservable = new Oe(), this.onBeginFrameObservable = new Oe(), this.customAnimationFrameRequester = null, this.onEndFrameObservable = new Oe(), this.onBeforeShaderCompilationObservable = new Oe(), this.onAfterShaderCompilationObservable = new Oe(), this._deterministicLockstep = !1, this._lockstepMaxSteps = 4, this._timeStep = 1 / 60, this._fps = 60, this._deltaTime = 0, this._drawCalls = new v9(), this.canvasTabIndex = 1, this.disablePerformanceMonitorInBackground = !1, this._performanceMonitor = new iee(), this._compatibilityMode = !0, this.currentRenderPassId = 0, this._renderPassNames = ["main"], Ge.Instances.push(this), !!e && (this._features.supportRenderPasses = !0, r = this._creationOptions, e.getContext)) {
      const i = e;
      this._sharedInit(i);
    }
  }
  _initGLContext() {
    super._initGLContext(), this._rescalePostProcess = null;
  }
  /**
   * Shared initialization across engines types.
   * @param canvas The canvas associated with this instance of the engine.
   */
  _sharedInit(e) {
    super._sharedInit(e), this._onCanvasFocus = () => {
      this.onCanvasFocusObservable.notifyObservers(this);
    }, this._onCanvasBlur = () => {
      this.onCanvasBlurObservable.notifyObservers(this);
    }, this._onCanvasContextMenu = (r) => {
      this.disableContextMenu && r.preventDefault();
    }, e.addEventListener("focus", this._onCanvasFocus), e.addEventListener("blur", this._onCanvasBlur), e.addEventListener("contextmenu", this._onCanvasContextMenu), this._onBlur = () => {
      this.disablePerformanceMonitorInBackground && this._performanceMonitor.disable(), this._windowIsBackground = !0;
    }, this._onFocus = () => {
      this.disablePerformanceMonitorInBackground && this._performanceMonitor.enable(), this._windowIsBackground = !1;
    }, this._onCanvasPointerOut = (r) => {
      document.elementFromPoint(r.clientX, r.clientY) !== e && this.onCanvasPointerOutObservable.notifyObservers(r);
    };
    const t = this.getHostWindow();
    t && typeof t.addEventListener == "function" && (t.addEventListener("blur", this._onBlur), t.addEventListener("focus", this._onFocus)), e.addEventListener("pointerout", this._onCanvasPointerOut), this._creationOptions.doNotHandleTouchAction || this._disableTouchAction(), !Ge.audioEngine && this._creationOptions.audioEngine && Ge.AudioEngineFactory && (Ge.audioEngine = Ge.AudioEngineFactory(this.getRenderingCanvas(), this.getAudioContext(), this.getAudioDestination())), $w() && (this._onFullscreenChange = () => {
      this.isFullscreen = !!document.fullscreenElement, this.isFullscreen && this._pointerLockRequested && e && Ge._RequestPointerlock(e);
    }, document.addEventListener("fullscreenchange", this._onFullscreenChange, !1), document.addEventListener("webkitfullscreenchange", this._onFullscreenChange, !1), this._onPointerLockChange = () => {
      this.isPointerLock = document.pointerLockElement === e;
    }, document.addEventListener("pointerlockchange", this._onPointerLockChange, !1), document.addEventListener("webkitpointerlockchange", this._onPointerLockChange, !1)), this.enableOfflineSupport = Ge.OfflineProviderFactory !== void 0, this._deterministicLockstep = !!this._creationOptions.deterministicLockstep, this._lockstepMaxSteps = this._creationOptions.lockstepMaxSteps || 0, this._timeStep = this._creationOptions.timeStep || 1 / 60;
  }
  /** @internal */
  _verifyPointerLock() {
    var e;
    (e = this._onPointerLockChange) === null || e === void 0 || e.call(this);
  }
  /**
   * Gets current aspect ratio
   * @param viewportOwner defines the camera to use to get the aspect ratio
   * @param useScreen defines if screen size must be used (or the current render target if any)
   * @returns a number defining the aspect ratio
   */
  getAspectRatio(e, t = !1) {
    const r = e.viewport;
    return this.getRenderWidth(t) * r.width / (this.getRenderHeight(t) * r.height);
  }
  /**
   * Gets current screen aspect ratio
   * @returns a number defining the aspect ratio
   */
  getScreenAspectRatio() {
    return this.getRenderWidth(!0) / this.getRenderHeight(!0);
  }
  /**
   * Gets the client rect of the HTML canvas attached with the current webGL context
   * @returns a client rectangle
   */
  getRenderingCanvasClientRect() {
    return this._renderingCanvas ? this._renderingCanvas.getBoundingClientRect() : null;
  }
  /**
   * Gets the client rect of the HTML element used for events
   * @returns a client rectangle
   */
  getInputElementClientRect() {
    return this._renderingCanvas ? this.getInputElement().getBoundingClientRect() : null;
  }
  /**
   * Gets a boolean indicating that the engine is running in deterministic lock step mode
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
   * @returns true if engine is in deterministic lock step mode
   */
  isDeterministicLockStep() {
    return this._deterministicLockstep;
  }
  /**
   * Gets the max steps when engine is running in deterministic lock step
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
   * @returns the max steps
   */
  getLockstepMaxSteps() {
    return this._lockstepMaxSteps;
  }
  /**
   * Returns the time in ms between steps when using deterministic lock step.
   * @returns time step in (ms)
   */
  getTimeStep() {
    return this._timeStep * 1e3;
  }
  /**
   * Force the mipmap generation for the given render target texture
   * @param texture defines the render target texture to use
   * @param unbind defines whether or not to unbind the texture after generation. Defaults to true.
   */
  generateMipMapsForCubemap(e, t = !0) {
    if (e.generateMipMaps) {
      const r = this._gl;
      this._bindTextureDirectly(r.TEXTURE_CUBE_MAP, e, !0), r.generateMipmap(r.TEXTURE_CUBE_MAP), t && this._bindTextureDirectly(r.TEXTURE_CUBE_MAP, null);
    }
  }
  /** States */
  /**
   * Gets a boolean indicating if depth writing is enabled
   * @returns the current depth writing state
   */
  getDepthWrite() {
    return this._depthCullingState.depthMask;
  }
  /**
   * Enable or disable depth writing
   * @param enable defines the state to set
   */
  setDepthWrite(e) {
    this._depthCullingState.depthMask = e;
  }
  /**
   * Gets a boolean indicating if stencil buffer is enabled
   * @returns the current stencil buffer state
   */
  getStencilBuffer() {
    return this._stencilState.stencilTest;
  }
  /**
   * Enable or disable the stencil buffer
   * @param enable defines if the stencil buffer must be enabled or disabled
   */
  setStencilBuffer(e) {
    this._stencilState.stencilTest = e;
  }
  /**
   * Gets the current stencil mask
   * @returns a number defining the new stencil mask to use
   */
  getStencilMask() {
    return this._stencilState.stencilMask;
  }
  /**
   * Sets the current stencil mask
   * @param mask defines the new stencil mask to use
   */
  setStencilMask(e) {
    this._stencilState.stencilMask = e;
  }
  /**
   * Gets the current stencil function
   * @returns a number defining the stencil function to use
   */
  getStencilFunction() {
    return this._stencilState.stencilFunc;
  }
  /**
   * Gets the current stencil reference value
   * @returns a number defining the stencil reference value to use
   */
  getStencilFunctionReference() {
    return this._stencilState.stencilFuncRef;
  }
  /**
   * Gets the current stencil mask
   * @returns a number defining the stencil mask to use
   */
  getStencilFunctionMask() {
    return this._stencilState.stencilFuncMask;
  }
  /**
   * Sets the current stencil function
   * @param stencilFunc defines the new stencil function to use
   */
  setStencilFunction(e) {
    this._stencilState.stencilFunc = e;
  }
  /**
   * Sets the current stencil reference
   * @param reference defines the new stencil reference to use
   */
  setStencilFunctionReference(e) {
    this._stencilState.stencilFuncRef = e;
  }
  /**
   * Sets the current stencil mask
   * @param mask defines the new stencil mask to use
   */
  setStencilFunctionMask(e) {
    this._stencilState.stencilFuncMask = e;
  }
  /**
   * Gets the current stencil operation when stencil fails
   * @returns a number defining stencil operation to use when stencil fails
   */
  getStencilOperationFail() {
    return this._stencilState.stencilOpStencilFail;
  }
  /**
   * Gets the current stencil operation when depth fails
   * @returns a number defining stencil operation to use when depth fails
   */
  getStencilOperationDepthFail() {
    return this._stencilState.stencilOpDepthFail;
  }
  /**
   * Gets the current stencil operation when stencil passes
   * @returns a number defining stencil operation to use when stencil passes
   */
  getStencilOperationPass() {
    return this._stencilState.stencilOpStencilDepthPass;
  }
  /**
   * Sets the stencil operation to use when stencil fails
   * @param operation defines the stencil operation to use when stencil fails
   */
  setStencilOperationFail(e) {
    this._stencilState.stencilOpStencilFail = e;
  }
  /**
   * Sets the stencil operation to use when depth fails
   * @param operation defines the stencil operation to use when depth fails
   */
  setStencilOperationDepthFail(e) {
    this._stencilState.stencilOpDepthFail = e;
  }
  /**
   * Sets the stencil operation to use when stencil passes
   * @param operation defines the stencil operation to use when stencil passes
   */
  setStencilOperationPass(e) {
    this._stencilState.stencilOpStencilDepthPass = e;
  }
  /**
   * Sets a boolean indicating if the dithering state is enabled or disabled
   * @param value defines the dithering state
   */
  setDitheringState(e) {
    e ? this._gl.enable(this._gl.DITHER) : this._gl.disable(this._gl.DITHER);
  }
  /**
   * Sets a boolean indicating if the rasterizer state is enabled or disabled
   * @param value defines the rasterizer state
   */
  setRasterizerState(e) {
    e ? this._gl.disable(this._gl.RASTERIZER_DISCARD) : this._gl.enable(this._gl.RASTERIZER_DISCARD);
  }
  /**
   * Gets the current depth function
   * @returns a number defining the depth function
   */
  getDepthFunction() {
    return this._depthCullingState.depthFunc;
  }
  /**
   * Sets the current depth function
   * @param depthFunc defines the function to use
   */
  setDepthFunction(e) {
    this._depthCullingState.depthFunc = e;
  }
  /**
   * Sets the current depth function to GREATER
   */
  setDepthFunctionToGreater() {
    this.setDepthFunction(516);
  }
  /**
   * Sets the current depth function to GEQUAL
   */
  setDepthFunctionToGreaterOrEqual() {
    this.setDepthFunction(518);
  }
  /**
   * Sets the current depth function to LESS
   */
  setDepthFunctionToLess() {
    this.setDepthFunction(513);
  }
  /**
   * Sets the current depth function to LEQUAL
   */
  setDepthFunctionToLessOrEqual() {
    this.setDepthFunction(515);
  }
  /**
   * Caches the state of the stencil buffer
   */
  cacheStencilState() {
    this._cachedStencilBuffer = this.getStencilBuffer(), this._cachedStencilFunction = this.getStencilFunction(), this._cachedStencilMask = this.getStencilMask(), this._cachedStencilOperationPass = this.getStencilOperationPass(), this._cachedStencilOperationFail = this.getStencilOperationFail(), this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail(), this._cachedStencilReference = this.getStencilFunctionReference();
  }
  /**
   * Restores the state of the stencil buffer
   */
  restoreStencilState() {
    this.setStencilFunction(this._cachedStencilFunction), this.setStencilMask(this._cachedStencilMask), this.setStencilBuffer(this._cachedStencilBuffer), this.setStencilOperationPass(this._cachedStencilOperationPass), this.setStencilOperationFail(this._cachedStencilOperationFail), this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail), this.setStencilFunctionReference(this._cachedStencilReference);
  }
  /**
   * Directly set the WebGL Viewport
   * @param x defines the x coordinate of the viewport (in screen space)
   * @param y defines the y coordinate of the viewport (in screen space)
   * @param width defines the width of the viewport (in screen space)
   * @param height defines the height of the viewport (in screen space)
   * @returns the current viewport Object (if any) that is being replaced by this call. You can restore this viewport later on to go back to the original state
   */
  setDirectViewport(e, t, r, n) {
    const i = this._cachedViewport;
    return this._cachedViewport = null, this._viewport(e, t, r, n), i;
  }
  /**
   * Executes a scissor clear (ie. a clear on a specific portion of the screen)
   * @param x defines the x-coordinate of the bottom left corner of the clear rectangle
   * @param y defines the y-coordinate of the corner of the clear rectangle
   * @param width defines the width of the clear rectangle
   * @param height defines the height of the clear rectangle
   * @param clearColor defines the clear color
   */
  scissorClear(e, t, r, n, i) {
    this.enableScissor(e, t, r, n), this.clear(i, !0, !0, !0), this.disableScissor();
  }
  /**
   * Enable scissor test on a specific rectangle (ie. render will only be executed on a specific portion of the screen)
   * @param x defines the x-coordinate of the bottom left corner of the clear rectangle
   * @param y defines the y-coordinate of the corner of the clear rectangle
   * @param width defines the width of the clear rectangle
   * @param height defines the height of the clear rectangle
   */
  enableScissor(e, t, r, n) {
    const i = this._gl;
    i.enable(i.SCISSOR_TEST), i.scissor(e, t, r, n);
  }
  /**
   * Disable previously set scissor test rectangle
   */
  disableScissor() {
    const e = this._gl;
    e.disable(e.SCISSOR_TEST);
  }
  /**
   * @internal
   */
  _reportDrawCall(e = 1) {
    this._drawCalls.addCount(e, !1);
  }
  /**
   * @internal
   */
  _loadFileAsync(e, t, r) {
    return new Promise((n, i) => {
      this._loadFile(e, (s) => {
        n(s);
      }, void 0, t, r, (s, a) => {
        i(a);
      });
    });
  }
  /**
   * Gets the source code of the vertex shader associated with a specific webGL program
   * @param program defines the program to use
   * @returns a string containing the source code of the vertex shader associated with the program
   */
  getVertexShaderSource(e) {
    const t = this._gl.getAttachedShaders(e);
    return t ? this._gl.getShaderSource(t[0]) : null;
  }
  /**
   * Gets the source code of the fragment shader associated with a specific webGL program
   * @param program defines the program to use
   * @returns a string containing the source code of the fragment shader associated with the program
   */
  getFragmentShaderSource(e) {
    const t = this._gl.getAttachedShaders(e);
    return t ? this._gl.getShaderSource(t[1]) : null;
  }
  /**
   * Sets a depth stencil texture from a render target to the according uniform.
   * @param channel The texture channel
   * @param uniform The uniform to set
   * @param texture The render target texture containing the depth stencil texture to apply
   * @param name The texture name
   */
  setDepthStencilTexture(e, t, r, n) {
    e !== void 0 && (t && (this._boundUniforms[e] = t), !r || !r.depthStencilTexture ? this._setTexture(e, null, void 0, void 0, n) : this._setTexture(e, r, !1, !0, n));
  }
  /**
   * Sets a texture to the webGL context from a postprocess
   * @param channel defines the channel to use
   * @param postProcess defines the source postprocess
   * @param name name of the channel
   */
  setTextureFromPostProcess(e, t, r) {
    var n;
    let i = null;
    t && (t._forcedOutputTexture ? i = t._forcedOutputTexture : t._textures.data[t._currentRenderTextureInd] && (i = t._textures.data[t._currentRenderTextureInd])), this._bindTexture(e, (n = i == null ? void 0 : i.texture) !== null && n !== void 0 ? n : null, r);
  }
  /**
   * Binds the output of the passed in post process to the texture channel specified
   * @param channel The channel the texture should be bound to
   * @param postProcess The post process which's output should be bound
   * @param name name of the channel
   */
  setTextureFromPostProcessOutput(e, t, r) {
    var n, i;
    this._bindTexture(e, (i = (n = t == null ? void 0 : t._outputTexture) === null || n === void 0 ? void 0 : n.texture) !== null && i !== void 0 ? i : null, r);
  }
  _rebuildBuffers() {
    for (const e of this.scenes)
      e.resetCachedMaterial(), e._rebuildGeometries(), e._rebuildTextures();
    for (const e of this._virtualScenes)
      e.resetCachedMaterial(), e._rebuildGeometries(), e._rebuildTextures();
    super._rebuildBuffers();
  }
  /** @internal */
  _renderFrame() {
    for (let e = 0; e < this._activeRenderLoops.length; e++) {
      const t = this._activeRenderLoops[e];
      t();
    }
  }
  _cancelFrame() {
    if (this._renderingQueueLaunched && this.customAnimationFrameRequester) {
      this._renderingQueueLaunched = !1;
      const { cancelAnimationFrame: e } = this.customAnimationFrameRequester;
      e && e(this.customAnimationFrameRequester.requestID);
    } else
      super._cancelFrame();
  }
  _renderLoop() {
    if (!this._contextWasLost) {
      let e = !0;
      (this.isDisposed || !this.renderEvenInBackground && this._windowIsBackground) && (e = !1), e && (this.beginFrame(), this._renderViews() || this._renderFrame(), this.endFrame());
    }
    this._activeRenderLoops.length > 0 ? this.customAnimationFrameRequester ? (this.customAnimationFrameRequester.requestID = this._queueNewFrame(this.customAnimationFrameRequester.renderFunction || this._boundRenderFunction, this.customAnimationFrameRequester), this._frameHandler = this.customAnimationFrameRequester.requestID) : this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow()) : this._renderingQueueLaunched = !1;
  }
  /** @internal */
  _renderViews() {
    return !1;
  }
  /**
   * Toggle full screen mode
   * @param requestPointerLock defines if a pointer lock should be requested from the user
   */
  switchFullscreen(e) {
    this.isFullscreen ? this.exitFullscreen() : this.enterFullscreen(e);
  }
  /**
   * Enters full screen mode
   * @param requestPointerLock defines if a pointer lock should be requested from the user
   */
  enterFullscreen(e) {
    this.isFullscreen || (this._pointerLockRequested = e, this._renderingCanvas && Ge._RequestFullscreen(this._renderingCanvas));
  }
  /**
   * Exits full screen mode
   */
  exitFullscreen() {
    this.isFullscreen && Ge._ExitFullscreen();
  }
  /**
   * Enters Pointerlock mode
   */
  enterPointerlock() {
    this._renderingCanvas && Ge._RequestPointerlock(this._renderingCanvas);
  }
  /**
   * Exits Pointerlock mode
   */
  exitPointerlock() {
    Ge._ExitPointerlock();
  }
  /**
   * Begin a new frame
   */
  beginFrame() {
    this._measureFps(), this.onBeginFrameObservable.notifyObservers(this), super.beginFrame();
  }
  /**
   * End the current frame
   */
  endFrame() {
    super.endFrame(), this.onEndFrameObservable.notifyObservers(this);
  }
  /**
   * Force a specific size of the canvas
   * @param width defines the new canvas' width
   * @param height defines the new canvas' height
   * @param forceSetSize true to force setting the sizes of the underlying canvas
   * @returns true if the size was changed
   */
  setSize(e, t, r = !1) {
    if (!this._renderingCanvas || !super.setSize(e, t, r))
      return !1;
    if (this.scenes) {
      for (let n = 0; n < this.scenes.length; n++) {
        const i = this.scenes[n];
        for (let s = 0; s < i.cameras.length; s++) {
          const a = i.cameras[s];
          a._currentRenderId = 0;
        }
      }
      this.onResizeObservable.hasObservers() && this.onResizeObservable.notifyObservers(this);
    }
    return !0;
  }
  _deletePipelineContext(e) {
    const t = e;
    t && t.program && t.transformFeedback && (this.deleteTransformFeedback(t.transformFeedback), t.transformFeedback = null), super._deletePipelineContext(e);
  }
  createShaderProgram(e, t, r, n, i, s = null) {
    i = i || this._gl, this.onBeforeShaderCompilationObservable.notifyObservers(this);
    const a = super.createShaderProgram(e, t, r, n, i, s);
    return this.onAfterShaderCompilationObservable.notifyObservers(this), a;
  }
  _createShaderProgram(e, t, r, n, i = null) {
    const s = n.createProgram();
    if (e.program = s, !s)
      throw new Error("Unable to create program");
    if (n.attachShader(s, t), n.attachShader(s, r), this.webGLVersion > 1 && i) {
      const a = this.createTransformFeedback();
      this.bindTransformFeedback(a), this.setTranformFeedbackVaryings(s, i), e.transformFeedback = a;
    }
    return n.linkProgram(s), this.webGLVersion > 1 && i && this.bindTransformFeedback(null), e.context = n, e.vertexShader = t, e.fragmentShader = r, e.isParallelCompiled || this._finalizePipelineContext(e), s;
  }
  /**
   * @internal
   */
  _releaseTexture(e) {
    super._releaseTexture(e);
  }
  /**
   * @internal
   */
  _releaseRenderTargetWrapper(e) {
    super._releaseRenderTargetWrapper(e), this.scenes.forEach((t) => {
      t.postProcesses.forEach((r) => {
        r._outputTexture === e && (r._outputTexture = null);
      }), t.cameras.forEach((r) => {
        r._postProcesses.forEach((n) => {
          n && n._outputTexture === e && (n._outputTexture = null);
        });
      });
    });
  }
  /**
   * Gets the names of the render passes that are currently created
   * @returns list of the render pass names
   */
  getRenderPassNames() {
    return this._renderPassNames;
  }
  /**
   * Gets the name of the current render pass
   * @returns name of the current render pass
   */
  getCurrentRenderPassName() {
    return this._renderPassNames[this.currentRenderPassId];
  }
  /**
   * Creates a render pass id
   * @param name Name of the render pass (for debug purpose only)
   * @returns the id of the new render pass
   */
  createRenderPassId(e) {
    const t = ++Ge._RenderPassIdCounter;
    return this._renderPassNames[t] = e ?? "NONAME", t;
  }
  /**
   * Releases a render pass id
   * @param id id of the render pass to release
   */
  releaseRenderPassId(e) {
    this._renderPassNames[e] = void 0;
    for (let t = 0; t < this.scenes.length; ++t) {
      const r = this.scenes[t];
      for (let n = 0; n < r.meshes.length; ++n) {
        const i = r.meshes[n];
        if (i.subMeshes)
          for (let s = 0; s < i.subMeshes.length; ++s)
            i.subMeshes[s]._removeDrawWrapper(e);
      }
    }
  }
  /**
   * @internal
   * Rescales a texture
   * @param source input texture
   * @param destination destination texture
   * @param scene scene to use to render the resize
   * @param internalFormat format to use when resizing
   * @param onComplete callback to be called when resize has completed
   */
  _rescaleTexture(e, t, r, n, i) {
    this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE);
    const s = this.createRenderTargetTexture({
      width: t.width,
      height: t.height
    }, {
      generateMipMaps: !1,
      type: 0,
      samplingMode: 2,
      generateDepthBuffer: !1,
      generateStencilBuffer: !1
    });
    !this._rescalePostProcess && Ge._RescalePostProcessFactory && (this._rescalePostProcess = Ge._RescalePostProcessFactory(this)), this._rescalePostProcess && (this._rescalePostProcess.externalTextureSamplerBinding = !0, this._rescalePostProcess.getEffect().executeWhenCompiled(() => {
      this._rescalePostProcess.onApply = function(f) {
        f._bindTexture("textureSampler", e);
      };
      let a = r;
      a || (a = this.scenes[this.scenes.length - 1]), a.postProcessManager.directRender([this._rescalePostProcess], s, !0), this._bindTextureDirectly(this._gl.TEXTURE_2D, t, !0), this._gl.copyTexImage2D(this._gl.TEXTURE_2D, 0, n, 0, 0, t.width, t.height, 0), this.unBindFramebuffer(s), s.dispose(), i && i();
    }));
  }
  // FPS
  /**
   * Gets the current framerate
   * @returns a number representing the framerate
   */
  getFps() {
    return this._fps;
  }
  /**
   * Gets the time spent between current and previous frame
   * @returns a number representing the delta time in ms
   */
  getDeltaTime() {
    return this._deltaTime;
  }
  _measureFps() {
    this._performanceMonitor.sampleFrame(), this._fps = this._performanceMonitor.averageFPS, this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;
  }
  /**
   * Wraps an external web gl texture in a Babylon texture.
   * @param texture defines the external texture
   * @param hasMipMaps defines whether the external texture has mip maps (default: false)
   * @param samplingMode defines the sampling mode for the external texture (default: 3)
   * @param width defines the width for the external texture (default: 0)
   * @param height defines the height for the external texture (default: 0)
   * @returns the babylon internal texture
   */
  wrapWebGLTexture(e, t = !1, r = 3, n = 0, i = 0) {
    const s = new jm(e, this._gl), a = new As(this, ri.Unknown, !0);
    return a._hardwareTexture = s, a.baseWidth = n, a.baseHeight = i, a.width = n, a.height = i, a.isReady = !0, a.useMipMaps = t, this.updateTextureSamplingMode(r, a), a;
  }
  /**
   * @internal
   */
  _uploadImageToTexture(e, t, r = 0, n = 0) {
    const i = this._gl, s = this._getWebGLTextureType(e.type), a = this._getInternalFormat(e.format), f = this._getRGBABufferInternalSizedFormat(e.type, a), o = e.isCube ? i.TEXTURE_CUBE_MAP : i.TEXTURE_2D;
    this._bindTextureDirectly(o, e, !0), this._unpackFlipY(e.invertY);
    let d = i.TEXTURE_2D;
    e.isCube && (d = i.TEXTURE_CUBE_MAP_POSITIVE_X + r), i.texImage2D(d, n, f, a, s, t), this._bindTextureDirectly(o, null, !0);
  }
  /**
   * Updates a depth texture Comparison Mode and Function.
   * If the comparison Function is equal to 0, the mode will be set to none.
   * Otherwise, this only works in webgl 2 and requires a shadow sampler in the shader.
   * @param texture The texture to set the comparison function for
   * @param comparisonFunction The comparison function to set, 0 if no comparison required
   */
  updateTextureComparisonFunction(e, t) {
    if (this.webGLVersion === 1) {
      Se.Error("WebGL 1 does not support texture comparison.");
      return;
    }
    const r = this._gl;
    e.isCube ? (this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, e, !0), t === 0 ? (r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_COMPARE_FUNC, 515), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_COMPARE_MODE, r.NONE)) : (r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_COMPARE_FUNC, t), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_COMPARE_MODE, r.COMPARE_REF_TO_TEXTURE)), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null)) : (this._bindTextureDirectly(this._gl.TEXTURE_2D, e, !0), t === 0 ? (r.texParameteri(r.TEXTURE_2D, r.TEXTURE_COMPARE_FUNC, 515), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_COMPARE_MODE, r.NONE)) : (r.texParameteri(r.TEXTURE_2D, r.TEXTURE_COMPARE_FUNC, t), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_COMPARE_MODE, r.COMPARE_REF_TO_TEXTURE)), this._bindTextureDirectly(this._gl.TEXTURE_2D, null)), e._comparisonFunction = t;
  }
  /**
   * Creates a webGL buffer to use with instantiation
   * @param capacity defines the size of the buffer
   * @returns the webGL buffer
   */
  createInstancesBuffer(e) {
    const t = this._gl.createBuffer();
    if (!t)
      throw new Error("Unable to create instance buffer");
    const r = new jS(t);
    return r.capacity = e, this.bindArrayBuffer(r), this._gl.bufferData(this._gl.ARRAY_BUFFER, e, this._gl.DYNAMIC_DRAW), r.references = 1, r;
  }
  /**
   * Delete a webGL buffer used with instantiation
   * @param buffer defines the webGL buffer to delete
   */
  deleteInstancesBuffer(e) {
    this._gl.deleteBuffer(e);
  }
  _clientWaitAsync(e, t = 0, r = 10) {
    const n = this._gl;
    return new Promise((i, s) => {
      const a = () => {
        const f = n.clientWaitSync(e, t, 0);
        if (f == n.WAIT_FAILED) {
          s();
          return;
        }
        if (f == n.TIMEOUT_EXPIRED) {
          setTimeout(a, r);
          return;
        }
        i();
      };
      a();
    });
  }
  /**
   * @internal
   */
  _readPixelsAsync(e, t, r, n, i, s, a) {
    if (this._webGLVersion < 2)
      throw new Error("_readPixelsAsync only work on WebGL2+");
    const f = this._gl, o = f.createBuffer();
    f.bindBuffer(f.PIXEL_PACK_BUFFER, o), f.bufferData(f.PIXEL_PACK_BUFFER, a.byteLength, f.STREAM_READ), f.readPixels(e, t, r, n, i, s, 0), f.bindBuffer(f.PIXEL_PACK_BUFFER, null);
    const d = f.fenceSync(f.SYNC_GPU_COMMANDS_COMPLETE, 0);
    return d ? (f.flush(), this._clientWaitAsync(d, 0, 10).then(() => (f.deleteSync(d), f.bindBuffer(f.PIXEL_PACK_BUFFER, o), f.getBufferSubData(f.PIXEL_PACK_BUFFER, 0, a), f.bindBuffer(f.PIXEL_PACK_BUFFER, null), f.deleteBuffer(o), a))) : null;
  }
  dispose() {
    for (this.hideLoadingUI(), this.onNewSceneAddedObservable.clear(); this.postProcesses.length; )
      this.postProcesses[0].dispose();
    for (this._rescalePostProcess && this._rescalePostProcess.dispose(); this.scenes.length; )
      this.scenes[0].dispose();
    for (; this._virtualScenes.length; )
      this._virtualScenes[0].dispose();
    gr.Instances.length === 1 && Ge.audioEngine && (Ge.audioEngine.dispose(), Ge.audioEngine = null);
    const e = this.getHostWindow();
    e && typeof e.removeEventListener == "function" && (e.removeEventListener("blur", this._onBlur), e.removeEventListener("focus", this._onFocus)), this._renderingCanvas && (this._renderingCanvas.removeEventListener("focus", this._onCanvasFocus), this._renderingCanvas.removeEventListener("blur", this._onCanvasBlur), this._renderingCanvas.removeEventListener("pointerout", this._onCanvasPointerOut), this._renderingCanvas.removeEventListener("contextmenu", this._onCanvasContextMenu)), $w() && (document.removeEventListener("fullscreenchange", this._onFullscreenChange), document.removeEventListener("mozfullscreenchange", this._onFullscreenChange), document.removeEventListener("webkitfullscreenchange", this._onFullscreenChange), document.removeEventListener("msfullscreenchange", this._onFullscreenChange), document.removeEventListener("pointerlockchange", this._onPointerLockChange), document.removeEventListener("mspointerlockchange", this._onPointerLockChange), document.removeEventListener("mozpointerlockchange", this._onPointerLockChange), document.removeEventListener("webkitpointerlockchange", this._onPointerLockChange)), super.dispose();
    const t = gr.Instances.indexOf(this);
    t >= 0 && gr.Instances.splice(t, 1), Ge.Instances.length || gr.OnEnginesDisposedObservable.notifyObservers(this), this.onResizeObservable.clear(), this.onCanvasBlurObservable.clear(), this.onCanvasFocusObservable.clear(), this.onCanvasPointerOutObservable.clear(), this.onBeginFrameObservable.clear(), this.onEndFrameObservable.clear();
  }
  _disableTouchAction() {
    !this._renderingCanvas || !this._renderingCanvas.setAttribute || (this._renderingCanvas.setAttribute("touch-action", "none"), this._renderingCanvas.style.touchAction = "none", this._renderingCanvas.style.webkitTapHighlightColor = "transparent");
  }
  // Loading screen
  /**
   * Display the loading screen
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen
   */
  displayLoadingUI() {
    if (!u9())
      return;
    const e = this.loadingScreen;
    e && e.displayLoadingUI();
  }
  /**
   * Hide the loading screen
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen
   */
  hideLoadingUI() {
    if (!u9())
      return;
    const e = this._loadingScreen;
    e && e.hideLoadingUI();
  }
  /**
   * Gets the current loading screen object
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen
   */
  get loadingScreen() {
    return !this._loadingScreen && this._renderingCanvas && (this._loadingScreen = Ge.DefaultLoadingScreenFactory(this._renderingCanvas)), this._loadingScreen;
  }
  /**
   * Sets the current loading screen object
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen
   */
  set loadingScreen(e) {
    this._loadingScreen = e;
  }
  /**
   * Sets the current loading screen text
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen
   */
  set loadingUIText(e) {
    this.loadingScreen.loadingUIText = e;
  }
  /**
   * Sets the current loading screen background color
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen
   */
  set loadingUIBackgroundColor(e) {
    this.loadingScreen.loadingUIBackgroundColor = e;
  }
  /**
   * creates and returns a new video element
   * @param constraints video constraints
   * @returns video element
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  createVideoElement(e) {
    return document.createElement("video");
  }
  /** Pointerlock and fullscreen */
  /**
   * Ask the browser to promote the current element to pointerlock mode
   * @param element defines the DOM element to promote
   */
  static _RequestPointerlock(e) {
    if (e.requestPointerLock) {
      const t = e.requestPointerLock();
      t instanceof Promise ? t.then(() => {
        e.focus();
      }).catch(() => {
      }) : e.focus();
    }
  }
  /**
   * Asks the browser to exit pointerlock mode
   */
  static _ExitPointerlock() {
    document.exitPointerLock && document.exitPointerLock();
  }
  /**
   * Ask the browser to promote the current element to fullscreen rendering mode
   * @param element defines the DOM element to promote
   */
  static _RequestFullscreen(e) {
    const t = e.requestFullscreen || e.webkitRequestFullscreen;
    t && t.call(e);
  }
  /**
   * Asks the browser to exit fullscreen mode
   */
  static _ExitFullscreen() {
    const e = document;
    document.exitFullscreen ? document.exitFullscreen() : e.webkitCancelFullScreen && e.webkitCancelFullScreen();
  }
  /**
   * Get Font size information
   * @param font font name
   * @returns an object containing ascent, height and descent
   */
  getFontOffset(e) {
    const t = document.createElement("span");
    t.innerHTML = "Hg", t.setAttribute("style", `font: ${e} !important`);
    const r = document.createElement("div");
    r.style.display = "inline-block", r.style.width = "1px", r.style.height = "0px", r.style.verticalAlign = "bottom";
    const n = document.createElement("div");
    n.style.whiteSpace = "nowrap", n.appendChild(t), n.appendChild(r), document.body.appendChild(n);
    let i = 0, s = 0;
    try {
      s = r.getBoundingClientRect().top - t.getBoundingClientRect().top, r.style.verticalAlign = "baseline", i = r.getBoundingClientRect().top - t.getBoundingClientRect().top;
    } finally {
      document.body.removeChild(n);
    }
    return { ascent: i, height: s, descent: s - i };
  }
}
Ge.ALPHA_DISABLE = 0;
Ge.ALPHA_ADD = 1;
Ge.ALPHA_COMBINE = 2;
Ge.ALPHA_SUBTRACT = 3;
Ge.ALPHA_MULTIPLY = 4;
Ge.ALPHA_MAXIMIZED = 5;
Ge.ALPHA_ONEONE = 6;
Ge.ALPHA_PREMULTIPLIED = 7;
Ge.ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
Ge.ALPHA_INTERPOLATE = 9;
Ge.ALPHA_SCREENMODE = 10;
Ge.DELAYLOADSTATE_NONE = 0;
Ge.DELAYLOADSTATE_LOADED = 1;
Ge.DELAYLOADSTATE_LOADING = 2;
Ge.DELAYLOADSTATE_NOTLOADED = 4;
Ge.NEVER = 512;
Ge.ALWAYS = 519;
Ge.LESS = 513;
Ge.EQUAL = 514;
Ge.LEQUAL = 515;
Ge.GREATER = 516;
Ge.GEQUAL = 518;
Ge.NOTEQUAL = 517;
Ge.KEEP = 7680;
Ge.REPLACE = 7681;
Ge.INCR = 7682;
Ge.DECR = 7683;
Ge.INVERT = 5386;
Ge.INCR_WRAP = 34055;
Ge.DECR_WRAP = 34056;
Ge.TEXTURE_CLAMP_ADDRESSMODE = 0;
Ge.TEXTURE_WRAP_ADDRESSMODE = 1;
Ge.TEXTURE_MIRROR_ADDRESSMODE = 2;
Ge.TEXTUREFORMAT_ALPHA = 0;
Ge.TEXTUREFORMAT_LUMINANCE = 1;
Ge.TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
Ge.TEXTUREFORMAT_RGB = 4;
Ge.TEXTUREFORMAT_RGBA = 5;
Ge.TEXTUREFORMAT_RED = 6;
Ge.TEXTUREFORMAT_R = 6;
Ge.TEXTUREFORMAT_RG = 7;
Ge.TEXTUREFORMAT_RED_INTEGER = 8;
Ge.TEXTUREFORMAT_R_INTEGER = 8;
Ge.TEXTUREFORMAT_RG_INTEGER = 9;
Ge.TEXTUREFORMAT_RGB_INTEGER = 10;
Ge.TEXTUREFORMAT_RGBA_INTEGER = 11;
Ge.TEXTURETYPE_UNSIGNED_BYTE = 0;
Ge.TEXTURETYPE_UNSIGNED_INT = 0;
Ge.TEXTURETYPE_FLOAT = 1;
Ge.TEXTURETYPE_HALF_FLOAT = 2;
Ge.TEXTURETYPE_BYTE = 3;
Ge.TEXTURETYPE_SHORT = 4;
Ge.TEXTURETYPE_UNSIGNED_SHORT = 5;
Ge.TEXTURETYPE_INT = 6;
Ge.TEXTURETYPE_UNSIGNED_INTEGER = 7;
Ge.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8;
Ge.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9;
Ge.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10;
Ge.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11;
Ge.TEXTURETYPE_UNSIGNED_INT_24_8 = 12;
Ge.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13;
Ge.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14;
Ge.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15;
Ge.TEXTURE_NEAREST_SAMPLINGMODE = 1;
Ge.TEXTURE_BILINEAR_SAMPLINGMODE = 2;
Ge.TEXTURE_TRILINEAR_SAMPLINGMODE = 3;
Ge.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8;
Ge.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11;
Ge.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;
Ge.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;
Ge.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;
Ge.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;
Ge.TEXTURE_NEAREST_LINEAR = 7;
Ge.TEXTURE_NEAREST_NEAREST = 1;
Ge.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;
Ge.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;
Ge.TEXTURE_LINEAR_LINEAR = 2;
Ge.TEXTURE_LINEAR_NEAREST = 12;
Ge.TEXTURE_EXPLICIT_MODE = 0;
Ge.TEXTURE_SPHERICAL_MODE = 1;
Ge.TEXTURE_PLANAR_MODE = 2;
Ge.TEXTURE_CUBIC_MODE = 3;
Ge.TEXTURE_PROJECTION_MODE = 4;
Ge.TEXTURE_SKYBOX_MODE = 5;
Ge.TEXTURE_INVCUBIC_MODE = 6;
Ge.TEXTURE_EQUIRECTANGULAR_MODE = 7;
Ge.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;
Ge.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
Ge.SCALEMODE_FLOOR = 1;
Ge.SCALEMODE_NEAREST = 2;
Ge.SCALEMODE_CEILING = 3;
Ge._RescalePostProcessFactory = null;
Ge._RenderPassIdCounter = 0;
const u6e = he.Compose(S.One(), Ze.FromEulerAngles(0, Math.PI, 0), S.Zero());
class Hr extends Cs {
  /**
   * Gets or sets the billboard mode. Default is 0.
   *
   * | Value | Type | Description |
   * | --- | --- | --- |
   * | 0 | BILLBOARDMODE_NONE |  |
   * | 1 | BILLBOARDMODE_X |  |
   * | 2 | BILLBOARDMODE_Y |  |
   * | 4 | BILLBOARDMODE_Z |  |
   * | 7 | BILLBOARDMODE_ALL |  |
   *
   */
  get billboardMode() {
    return this._billboardMode;
  }
  set billboardMode(e) {
    this._billboardMode !== e && (this._billboardMode = e, this._cache.useBillboardPosition = (this._billboardMode & Hr.BILLBOARDMODE_USE_POSITION) !== 0, this._computeUseBillboardPath());
  }
  /**
   * Gets or sets a boolean indicating that parent rotation should be preserved when using billboards.
   * This could be useful for glTF objects where parent rotation helps converting from right handed to left handed
   */
  get preserveParentRotationForBillboard() {
    return this._preserveParentRotationForBillboard;
  }
  set preserveParentRotationForBillboard(e) {
    e !== this._preserveParentRotationForBillboard && (this._preserveParentRotationForBillboard = e, this._computeUseBillboardPath());
  }
  _computeUseBillboardPath() {
    this._cache.useBillboardPath = this._billboardMode !== Hr.BILLBOARDMODE_NONE && !this.preserveParentRotationForBillboard;
  }
  /**
   * Gets or sets the distance of the object to max, often used by skybox
   */
  get infiniteDistance() {
    return this._infiniteDistance;
  }
  set infiniteDistance(e) {
    this._infiniteDistance !== e && (this._infiniteDistance = e);
  }
  constructor(e, t = null, r = !0) {
    super(e, t), this._forward = new S(0, 0, 1), this._up = new S(0, 1, 0), this._right = new S(1, 0, 0), this._position = S.Zero(), this._rotation = S.Zero(), this._rotationQuaternion = null, this._scaling = S.One(), this._transformToBoneReferal = null, this._isAbsoluteSynced = !1, this._billboardMode = Hr.BILLBOARDMODE_NONE, this._preserveParentRotationForBillboard = !1, this.scalingDeterminant = 1, this._infiniteDistance = !1, this.ignoreNonUniformScaling = !1, this.reIntegrateRotationIntoRotationQuaternion = !1, this._poseMatrix = null, this._localMatrix = he.Zero(), this._usePivotMatrix = !1, this._absolutePosition = S.Zero(), this._absoluteScaling = S.Zero(), this._absoluteRotationQuaternion = Ze.Identity(), this._pivotMatrix = he.Identity(), this._postMultiplyPivotMatrix = !1, this._isWorldMatrixFrozen = !1, this._indexInSceneTransformNodesArray = -1, this.onAfterWorldMatrixUpdateObservable = new Oe(), this._nonUniformScaling = !1, r && this.getScene().addTransformNode(this);
  }
  /**
   * Gets a string identifying the name of the class
   * @returns "TransformNode" string
   */
  getClassName() {
    return "TransformNode";
  }
  /**
   * Gets or set the node position (default is (0.0, 0.0, 0.0))
   */
  get position() {
    return this._position;
  }
  set position(e) {
    this._position = e, this._isDirty = !0;
  }
  /**
   * return true if a pivot has been set
   * @returns true if a pivot matrix is used
   */
  isUsingPivotMatrix() {
    return this._usePivotMatrix;
  }
  /**
   * return true if pivot matrix must be cancelled in the world matrix. When this parameter is set to true (default), the inverse of the pivot matrix is also applied at the end to cancel the transformation effect.
   */
  isUsingPostMultiplyPivotMatrix() {
    return this._postMultiplyPivotMatrix;
  }
  /**
   * Gets or sets the rotation property : a Vector3 defining the rotation value in radians around each local axis X, Y, Z  (default is (0.0, 0.0, 0.0)).
   * If rotation quaternion is set, this Vector3 will be ignored and copy from the quaternion
   */
  get rotation() {
    return this._rotation;
  }
  set rotation(e) {
    this._rotation = e, this._rotationQuaternion = null, this._isDirty = !0;
  }
  /**
   * Gets or sets the scaling property : a Vector3 defining the node scaling along each local axis X, Y, Z (default is (1.0, 1.0, 1.0)).
   */
  get scaling() {
    return this._scaling;
  }
  set scaling(e) {
    this._scaling = e, this._isDirty = !0;
  }
  /**
   * Gets or sets the rotation Quaternion property : this a Quaternion object defining the node rotation by using a unit quaternion (undefined by default, but can be null).
   * If set, only the rotationQuaternion is then used to compute the node rotation (ie. node.rotation will be ignored)
   */
  get rotationQuaternion() {
    return this._rotationQuaternion;
  }
  set rotationQuaternion(e) {
    this._rotationQuaternion = e, e && this._rotation.setAll(0), this._isDirty = !0;
  }
  /**
   * The forward direction of that transform in world space.
   */
  get forward() {
    return S.TransformNormalFromFloatsToRef(0, 0, this.getScene().useRightHandedSystem ? -1 : 1, this.getWorldMatrix(), this._forward), this._forward.normalize();
  }
  /**
   * The up direction of that transform in world space.
   */
  get up() {
    return S.TransformNormalFromFloatsToRef(0, 1, 0, this.getWorldMatrix(), this._up), this._up.normalize();
  }
  /**
   * The right direction of that transform in world space.
   */
  get right() {
    return S.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem ? -1 : 1, 0, 0, this.getWorldMatrix(), this._right), this._right.normalize();
  }
  /**
   * Copies the parameter passed Matrix into the mesh Pose matrix.
   * @param matrix the matrix to copy the pose from
   * @returns this TransformNode.
   */
  updatePoseMatrix(e) {
    return this._poseMatrix ? (this._poseMatrix.copyFrom(e), this) : (this._poseMatrix = e.clone(), this);
  }
  /**
   * Returns the mesh Pose matrix.
   * @returns the pose matrix
   */
  getPoseMatrix() {
    return this._poseMatrix || (this._poseMatrix = he.Identity()), this._poseMatrix;
  }
  /** @internal */
  _isSynchronized() {
    const e = this._cache;
    return !(this._billboardMode !== e.billboardMode || this._billboardMode !== Hr.BILLBOARDMODE_NONE || e.pivotMatrixUpdated || this._infiniteDistance || this._position._isDirty || this._scaling._isDirty || this._rotationQuaternion && this._rotationQuaternion._isDirty || this._rotation._isDirty);
  }
  /** @internal */
  _initCache() {
    super._initCache();
    const e = this._cache;
    e.localMatrixUpdated = !1, e.billboardMode = -1, e.infiniteDistance = !1, e.useBillboardPosition = !1, e.useBillboardPath = !1;
  }
  /**
   * Returns the current mesh absolute position.
   * Returns a Vector3.
   */
  get absolutePosition() {
    return this.getAbsolutePosition();
  }
  /**
   * Returns the current mesh absolute scaling.
   * Returns a Vector3.
   */
  get absoluteScaling() {
    return this._syncAbsoluteScalingAndRotation(), this._absoluteScaling;
  }
  /**
   * Returns the current mesh absolute rotation.
   * Returns a Quaternion.
   */
  get absoluteRotationQuaternion() {
    return this._syncAbsoluteScalingAndRotation(), this._absoluteRotationQuaternion;
  }
  /**
   * Sets a new matrix to apply before all other transformation
   * @param matrix defines the transform matrix
   * @returns the current TransformNode
   */
  setPreTransformMatrix(e) {
    return this.setPivotMatrix(e, !1);
  }
  /**
   * Sets a new pivot matrix to the current node
   * @param matrix defines the new pivot matrix to use
   * @param postMultiplyPivotMatrix defines if the pivot matrix must be cancelled in the world matrix. When this parameter is set to true (default), the inverse of the pivot matrix is also applied at the end to cancel the transformation effect
   * @returns the current TransformNode
   */
  setPivotMatrix(e, t = !0) {
    return this._pivotMatrix.copyFrom(e), this._usePivotMatrix = !this._pivotMatrix.isIdentity(), this._cache.pivotMatrixUpdated = !0, this._postMultiplyPivotMatrix = t, this._postMultiplyPivotMatrix && (this._pivotMatrixInverse ? this._pivotMatrix.invertToRef(this._pivotMatrixInverse) : this._pivotMatrixInverse = he.Invert(this._pivotMatrix)), this;
  }
  /**
   * Returns the mesh pivot matrix.
   * Default : Identity.
   * @returns the matrix
   */
  getPivotMatrix() {
    return this._pivotMatrix;
  }
  /**
   * Instantiate (when possible) or clone that node with its hierarchy
   * @param newParent defines the new parent to use for the instance (or clone)
   * @param options defines options to configure how copy is done
   * @param options.doNotInstantiate defines if the model must be instantiated or just cloned
   * @param onNewNodeCreated defines an option callback to call when a clone or an instance is created
   * @returns an instance (or a clone) of the current node with its hierarchy
   */
  instantiateHierarchy(e = null, t, r) {
    const n = this.clone("Clone of " + (this.name || this.id), e || this.parent, !0);
    n && r && r(this, n);
    for (const i of this.getChildTransformNodes(!0))
      i.instantiateHierarchy(n, t, r);
    return n;
  }
  /**
   * Prevents the World matrix to be computed any longer
   * @param newWorldMatrix defines an optional matrix to use as world matrix
   * @param decompose defines whether to decompose the given newWorldMatrix or directly assign
   * @returns the TransformNode.
   */
  freezeWorldMatrix(e = null, t = !1) {
    return e ? t ? (this._rotation.setAll(0), this._rotationQuaternion = this._rotationQuaternion || Ze.Identity(), e.decompose(this._scaling, this._rotationQuaternion, this._position), this.computeWorldMatrix(!0)) : (this._worldMatrix = e, this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]), this._afterComputeWorldMatrix()) : (this._isWorldMatrixFrozen = !1, this.computeWorldMatrix(!0)), this._isDirty = !1, this._isWorldMatrixFrozen = !0, this;
  }
  /**
   * Allows back the World matrix computation.
   * @returns the TransformNode.
   */
  unfreezeWorldMatrix() {
    return this._isWorldMatrixFrozen = !1, this.computeWorldMatrix(!0), this;
  }
  /**
   * True if the World matrix has been frozen.
   */
  get isWorldMatrixFrozen() {
    return this._isWorldMatrixFrozen;
  }
  /**
   * Returns the mesh absolute position in the World.
   * @returns a Vector3.
   */
  getAbsolutePosition() {
    return this.computeWorldMatrix(), this._absolutePosition;
  }
  /**
   * Sets the mesh absolute position in the World from a Vector3 or an Array(3).
   * @param absolutePosition the absolute position to set
   * @returns the TransformNode.
   */
  setAbsolutePosition(e) {
    if (!e)
      return this;
    let t, r, n;
    if (e.x === void 0) {
      if (arguments.length < 3)
        return this;
      t = arguments[0], r = arguments[1], n = arguments[2];
    } else
      t = e.x, r = e.y, n = e.z;
    if (this.parent) {
      const i = ue.Matrix[0];
      this.parent.getWorldMatrix().invertToRef(i), S.TransformCoordinatesFromFloatsToRef(t, r, n, i, this.position);
    } else
      this.position.x = t, this.position.y = r, this.position.z = n;
    return this._absolutePosition.copyFrom(e), this;
  }
  /**
   * Sets the mesh position in its local space.
   * @param vector3 the position to set in localspace
   * @returns the TransformNode.
   */
  setPositionWithLocalVector(e) {
    return this.computeWorldMatrix(), this.position = S.TransformNormal(e, this._localMatrix), this;
  }
  /**
   * Returns the mesh position in the local space from the current World matrix values.
   * @returns a new Vector3.
   */
  getPositionExpressedInLocalSpace() {
    this.computeWorldMatrix();
    const e = ue.Matrix[0];
    return this._localMatrix.invertToRef(e), S.TransformNormal(this.position, e);
  }
  /**
   * Translates the mesh along the passed Vector3 in its local space.
   * @param vector3 the distance to translate in localspace
   * @returns the TransformNode.
   */
  locallyTranslate(e) {
    return this.computeWorldMatrix(!0), this.position = S.TransformCoordinates(e, this._localMatrix), this;
  }
  /**
   * Orients a mesh towards a target point. Mesh must be drawn facing user.
   * @param targetPoint the position (must be in same space as current mesh) to look at
   * @param yawCor optional yaw (y-axis) correction in radians
   * @param pitchCor optional pitch (x-axis) correction in radians
   * @param rollCor optional roll (z-axis) correction in radians
   * @param space the chosen space of the target
   * @returns the TransformNode.
   */
  lookAt(e, t = 0, r = 0, n = 0, i = ai.LOCAL) {
    const s = Hr._LookAtVectorCache, a = i === ai.LOCAL ? this.position : this.getAbsolutePosition();
    if (e.subtractToRef(a, s), this.setDirection(s, t, r, n), i === ai.WORLD && this.parent)
      if (this.rotationQuaternion) {
        const f = ue.Matrix[0];
        this.rotationQuaternion.toRotationMatrix(f);
        const o = ue.Matrix[1];
        this.parent.getWorldMatrix().getRotationMatrixToRef(o), o.invert(), f.multiplyToRef(o, f), this.rotationQuaternion.fromRotationMatrix(f);
      } else {
        const f = ue.Quaternion[0];
        Ze.FromEulerVectorToRef(this.rotation, f);
        const o = ue.Matrix[0];
        f.toRotationMatrix(o);
        const d = ue.Matrix[1];
        this.parent.getWorldMatrix().getRotationMatrixToRef(d), d.invert(), o.multiplyToRef(d, o), f.fromRotationMatrix(o), f.toEulerAnglesToRef(this.rotation);
      }
    return this;
  }
  /**
   * Returns a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh.
   * This Vector3 is expressed in the World space.
   * @param localAxis axis to rotate
   * @returns a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh.
   */
  getDirection(e) {
    const t = S.Zero();
    return this.getDirectionToRef(e, t), t;
  }
  /**
   * Sets the Vector3 "result" as the rotated Vector3 "localAxis" in the same rotation than the mesh.
   * localAxis is expressed in the mesh local space.
   * result is computed in the World space from the mesh World matrix.
   * @param localAxis axis to rotate
   * @param result the resulting transformnode
   * @returns this TransformNode.
   */
  getDirectionToRef(e, t) {
    return S.TransformNormalToRef(e, this.getWorldMatrix(), t), this;
  }
  /**
   * Sets this transform node rotation to the given local axis.
   * @param localAxis the axis in local space
   * @param yawCor optional yaw (y-axis) correction in radians
   * @param pitchCor optional pitch (x-axis) correction in radians
   * @param rollCor optional roll (z-axis) correction in radians
   * @returns this TransformNode
   */
  setDirection(e, t = 0, r = 0, n = 0) {
    const i = -Math.atan2(e.z, e.x) + Math.PI / 2, s = Math.sqrt(e.x * e.x + e.z * e.z), a = -Math.atan2(e.y, s);
    return this.rotationQuaternion ? Ze.RotationYawPitchRollToRef(i + t, a + r, n, this.rotationQuaternion) : (this.rotation.x = a + r, this.rotation.y = i + t, this.rotation.z = n), this;
  }
  /**
   * Sets a new pivot point to the current node
   * @param point defines the new pivot point to use
   * @param space defines if the point is in world or local space (local by default)
   * @returns the current TransformNode
   */
  setPivotPoint(e, t = ai.LOCAL) {
    this.getScene().getRenderId() == 0 && this.computeWorldMatrix(!0);
    const r = this.getWorldMatrix();
    if (t == ai.WORLD) {
      const n = ue.Matrix[0];
      r.invertToRef(n), e = S.TransformCoordinates(e, n);
    }
    return this.setPivotMatrix(he.Translation(-e.x, -e.y, -e.z), !0);
  }
  /**
   * Returns a new Vector3 set with the mesh pivot point coordinates in the local space.
   * @returns the pivot point
   */
  getPivotPoint() {
    const e = S.Zero();
    return this.getPivotPointToRef(e), e;
  }
  /**
   * Sets the passed Vector3 "result" with the coordinates of the mesh pivot point in the local space.
   * @param result the vector3 to store the result
   * @returns this TransformNode.
   */
  getPivotPointToRef(e) {
    return e.x = -this._pivotMatrix.m[12], e.y = -this._pivotMatrix.m[13], e.z = -this._pivotMatrix.m[14], this;
  }
  /**
   * Returns a new Vector3 set with the mesh pivot point World coordinates.
   * @returns a new Vector3 set with the mesh pivot point World coordinates.
   */
  getAbsolutePivotPoint() {
    const e = S.Zero();
    return this.getAbsolutePivotPointToRef(e), e;
  }
  /**
   * Sets the Vector3 "result" coordinates with the mesh pivot point World coordinates.
   * @param result vector3 to store the result
   * @returns this TransformNode.
   */
  getAbsolutePivotPointToRef(e) {
    return this.getPivotPointToRef(e), S.TransformCoordinatesToRef(e, this.getWorldMatrix(), e), this;
  }
  /**
   * Flag the transform node as dirty (Forcing it to update everything)
   * @param property if set to "rotation" the objects rotationQuaternion will be set to null
   * @returns this  node
   */
  markAsDirty(e) {
    if (this._isDirty)
      return this;
    if (this._children)
      for (const t of this._children)
        t.markAsDirty(e);
    return super.markAsDirty(e);
  }
  /**
   * Defines the passed node as the parent of the current node.
   * The node will remain exactly where it is and its position / rotation will be updated accordingly.
   * Note that if the mesh has a pivot matrix / point defined it will be applied after the parent was updated.
   * In that case the node will not remain in the same space as it is, as the pivot will be applied.
   * To avoid this, you can set updatePivot to true and the pivot will be updated to identity
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/parent
   * @param node the node ot set as the parent
   * @param preserveScalingSign if true, keep scaling sign of child. Otherwise, scaling sign might change.
   * @param updatePivot if true, update the pivot matrix to keep the node in the same space as before
   * @returns this TransformNode.
   */
  setParent(e, t = !1, r = !1) {
    if (!e && !this.parent)
      return this;
    const n = ue.Quaternion[0], i = ue.Vector3[0], s = ue.Vector3[1], a = ue.Matrix[1];
    he.IdentityToRef(a);
    const f = ue.Matrix[0];
    this.computeWorldMatrix(!0);
    let o = this.rotationQuaternion;
    return o || (o = Hr._TmpRotation, Ze.RotationYawPitchRollToRef(this._rotation.y, this._rotation.x, this._rotation.z, o)), he.ComposeToRef(this.scaling, o, this.position, f), this.parent && f.multiplyToRef(this.parent.computeWorldMatrix(!0), f), e && (e.computeWorldMatrix(!0).invertToRef(a), f.multiplyToRef(a, f)), f.decompose(s, n, i, t ? this : void 0), this.rotationQuaternion ? this.rotationQuaternion.copyFrom(n) : n.toEulerAnglesToRef(this.rotation), this.scaling.copyFrom(s), this.position.copyFrom(i), this.parent = e, r && this.setPivotMatrix(he.Identity()), this;
  }
  /**
   * True if the scaling property of this object is non uniform eg. (1,2,1)
   */
  get nonUniformScaling() {
    return this._nonUniformScaling;
  }
  /**
   * @internal
   */
  _updateNonUniformScalingState(e) {
    return this._nonUniformScaling === e ? !1 : (this._nonUniformScaling = e, !0);
  }
  /**
   * Attach the current TransformNode to another TransformNode associated with a bone
   * @param bone Bone affecting the TransformNode
   * @param affectedTransformNode TransformNode associated with the bone
   * @returns this object
   */
  attachToBone(e, t) {
    return this._currentParentWhenAttachingToBone = this.parent, this._transformToBoneReferal = t, this.parent = e, e.getSkeleton().prepare(!0), e.getFinalMatrix().determinant() < 0 && (this.scalingDeterminant *= -1), this;
  }
  /**
   * Detach the transform node if its associated with a bone
   * @param resetToPreviousParent Indicates if the parent that was in effect when attachToBone was called should be set back or if we should set parent to null instead (defaults to the latter)
   * @returns this object
   */
  detachFromBone(e = !1) {
    return this.parent ? (this.parent.getWorldMatrix().determinant() < 0 && (this.scalingDeterminant *= -1), this._transformToBoneReferal = null, e ? this.parent = this._currentParentWhenAttachingToBone : this.parent = null, this) : (e && (this.parent = this._currentParentWhenAttachingToBone), this);
  }
  /**
   * Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in the given space.
   * space (default LOCAL) can be either Space.LOCAL, either Space.WORLD.
   * Note that the property `rotationQuaternion` is then automatically updated and the property `rotation` is set to (0,0,0) and no longer used.
   * The passed axis is also normalized.
   * @param axis the axis to rotate around
   * @param amount the amount to rotate in radians
   * @param space Space to rotate in (Default: local)
   * @returns the TransformNode.
   */
  rotate(e, t, r) {
    e.normalize(), this.rotationQuaternion || (this.rotationQuaternion = this.rotation.toQuaternion(), this.rotation.setAll(0));
    let n;
    if (!r || r === ai.LOCAL)
      n = Ze.RotationAxisToRef(e, t, Hr._RotationAxisCache), this.rotationQuaternion.multiplyToRef(n, this.rotationQuaternion);
    else {
      if (this.parent) {
        const i = this.parent.getWorldMatrix(), s = ue.Matrix[0];
        i.invertToRef(s), e = S.TransformNormal(e, s), i.determinant() < 0 && (t *= -1);
      }
      n = Ze.RotationAxisToRef(e, t, Hr._RotationAxisCache), n.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);
    }
    return this;
  }
  /**
   * Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in world space.
   * Note that the property `rotationQuaternion` is then automatically updated and the property `rotation` is set to (0,0,0) and no longer used.
   * The passed axis is also normalized. .
   * Method is based on http://www.euclideanspace.com/maths/geometry/affine/aroundPoint/index.htm
   * @param point the point to rotate around
   * @param axis the axis to rotate around
   * @param amount the amount to rotate in radians
   * @returns the TransformNode
   */
  rotateAround(e, t, r) {
    t.normalize(), this.rotationQuaternion || (this.rotationQuaternion = Ze.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z), this.rotation.setAll(0));
    const n = ue.Vector3[0], i = ue.Vector3[1], s = ue.Vector3[2], a = ue.Quaternion[0], f = ue.Matrix[0], o = ue.Matrix[1], d = ue.Matrix[2], v = ue.Matrix[3];
    return e.subtractToRef(this.position, n), he.TranslationToRef(n.x, n.y, n.z, f), he.TranslationToRef(-n.x, -n.y, -n.z, o), he.RotationAxisToRef(t, r, d), o.multiplyToRef(d, v), v.multiplyToRef(f, v), v.decompose(i, a, s), this.position.addInPlace(s), a.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion), this;
  }
  /**
   * Translates the mesh along the axis vector for the passed distance in the given space.
   * space (default LOCAL) can be either Space.LOCAL, either Space.WORLD.
   * @param axis the axis to translate in
   * @param distance the distance to translate
   * @param space Space to rotate in (Default: local)
   * @returns the TransformNode.
   */
  translate(e, t, r) {
    const n = e.scale(t);
    if (!r || r === ai.LOCAL) {
      const i = this.getPositionExpressedInLocalSpace().add(n);
      this.setPositionWithLocalVector(i);
    } else
      this.setAbsolutePosition(this.getAbsolutePosition().add(n));
    return this;
  }
  /**
   * Adds a rotation step to the mesh current rotation.
   * x, y, z are Euler angles expressed in radians.
   * This methods updates the current mesh rotation, either mesh.rotation, either mesh.rotationQuaternion if it's set.
   * This means this rotation is made in the mesh local space only.
   * It's useful to set a custom rotation order different from the BJS standard one YXZ.
   * Example : this rotates the mesh first around its local X axis, then around its local Z axis, finally around its local Y axis.
   * ```javascript
   * mesh.addRotation(x1, 0, 0).addRotation(0, 0, z2).addRotation(0, 0, y3);
   * ```
   * Note that `addRotation()` accumulates the passed rotation values to the current ones and computes the .rotation or .rotationQuaternion updated values.
   * Under the hood, only quaternions are used. So it's a little faster is you use .rotationQuaternion because it doesn't need to translate them back to Euler angles.
   * @param x Rotation to add
   * @param y Rotation to add
   * @param z Rotation to add
   * @returns the TransformNode.
   */
  addRotation(e, t, r) {
    let n;
    this.rotationQuaternion ? n = this.rotationQuaternion : (n = ue.Quaternion[1], Ze.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, n));
    const i = ue.Quaternion[0];
    return Ze.RotationYawPitchRollToRef(t, e, r, i), n.multiplyInPlace(i), this.rotationQuaternion || n.toEulerAnglesToRef(this.rotation), this;
  }
  /**
   * @internal
   */
  _getEffectiveParent() {
    return this.parent;
  }
  /**
   * Returns whether the transform node world matrix computation needs the camera information to be computed.
   * This is the case when the node is a billboard or has an infinite distance for instance.
   * @returns true if the world matrix computation needs the camera information to be computed
   */
  isWorldMatrixCameraDependent() {
    return this._infiniteDistance && !this.parent || this._billboardMode !== Hr.BILLBOARDMODE_NONE && !this.preserveParentRotationForBillboard;
  }
  /**
   * Computes the world matrix of the node
   * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch
   * @param camera defines the camera used if different from the scene active camera (This is used with modes like Billboard or infinite distance)
   * @returns the world matrix
   */
  computeWorldMatrix(e = !1, t = null) {
    if (this._isWorldMatrixFrozen && !this._isDirty)
      return this._worldMatrix;
    const r = this.getScene().getRenderId();
    if (!this._isDirty && !e && (this._currentRenderId === r || this.isSynchronized()))
      return this._currentRenderId = r, this._worldMatrix;
    t = t || this.getScene().activeCamera, this._updateCache();
    const n = this._cache;
    n.pivotMatrixUpdated = !1, n.billboardMode = this.billboardMode, n.infiniteDistance = this.infiniteDistance, n.parent = this._parentNode, this._currentRenderId = r, this._childUpdateId += 1, this._isDirty = !1, this._position._isDirty = !1, this._rotation._isDirty = !1, this._scaling._isDirty = !1;
    const i = this._getEffectiveParent(), s = Hr._TmpScaling;
    let a = this._position;
    if (this._infiniteDistance && !this.parent && t) {
      const o = t.getWorldMatrix(), d = new S(o.m[12], o.m[13], o.m[14]);
      a = Hr._TmpTranslation, a.copyFromFloats(this._position.x + d.x, this._position.y + d.y, this._position.z + d.z);
    }
    s.copyFromFloats(this._scaling.x * this.scalingDeterminant, this._scaling.y * this.scalingDeterminant, this._scaling.z * this.scalingDeterminant);
    let f;
    if (this._rotationQuaternion ? (this._rotationQuaternion._isDirty = !1, f = this._rotationQuaternion, this.reIntegrateRotationIntoRotationQuaternion && this.rotation.lengthSquared() && (this._rotationQuaternion.multiplyInPlace(Ze.RotationYawPitchRoll(this._rotation.y, this._rotation.x, this._rotation.z)), this._rotation.copyFromFloats(0, 0, 0))) : (f = Hr._TmpRotation, Ze.RotationYawPitchRollToRef(this._rotation.y, this._rotation.x, this._rotation.z, f)), this._usePivotMatrix) {
      const o = ue.Matrix[1];
      he.ScalingToRef(s.x, s.y, s.z, o);
      const d = ue.Matrix[0];
      f.toRotationMatrix(d), this._pivotMatrix.multiplyToRef(o, ue.Matrix[4]), ue.Matrix[4].multiplyToRef(d, this._localMatrix), this._postMultiplyPivotMatrix && this._localMatrix.multiplyToRef(this._pivotMatrixInverse, this._localMatrix), this._localMatrix.addTranslationFromFloats(a.x, a.y, a.z);
    } else
      he.ComposeToRef(s, f, a, this._localMatrix);
    if (i && i.getWorldMatrix) {
      if (e && i.computeWorldMatrix(e), n.useBillboardPath) {
        if (this._transformToBoneReferal) {
          const u = this.parent;
          u.getSkeleton().prepare(), u.getFinalMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), ue.Matrix[7]);
        } else
          ue.Matrix[7].copyFrom(i.getWorldMatrix());
        const o = ue.Vector3[5], d = ue.Vector3[6], v = ue.Quaternion[0];
        ue.Matrix[7].decompose(d, v, o), he.ScalingToRef(d.x, d.y, d.z, ue.Matrix[7]), ue.Matrix[7].setTranslation(o), Hr.BillboardUseParentOrientation && (this._position.applyRotationQuaternionToRef(v, o), this._localMatrix.setTranslation(o)), this._localMatrix.multiplyToRef(ue.Matrix[7], this._worldMatrix);
      } else if (this._transformToBoneReferal) {
        const o = this.parent;
        o.getSkeleton().prepare(), this._localMatrix.multiplyToRef(o.getFinalMatrix(), ue.Matrix[6]), ue.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), this._worldMatrix);
      } else
        this._localMatrix.multiplyToRef(i.getWorldMatrix(), this._worldMatrix);
      this._markSyncedWithParent();
    } else
      this._worldMatrix.copyFrom(this._localMatrix);
    if (n.useBillboardPath && t && this.billboardMode && !n.useBillboardPosition) {
      const o = ue.Vector3[0];
      if (this._worldMatrix.getTranslationToRef(o), ue.Matrix[1].copyFrom(t.getViewMatrix()), this._scene.useRightHandedSystem && ue.Matrix[1].multiplyToRef(u6e, ue.Matrix[1]), ue.Matrix[1].setTranslationFromFloats(0, 0, 0), ue.Matrix[1].invertToRef(ue.Matrix[0]), (this.billboardMode & Hr.BILLBOARDMODE_ALL) !== Hr.BILLBOARDMODE_ALL) {
        ue.Matrix[0].decompose(void 0, ue.Quaternion[0], void 0);
        const d = ue.Vector3[1];
        ue.Quaternion[0].toEulerAnglesToRef(d), (this.billboardMode & Hr.BILLBOARDMODE_X) !== Hr.BILLBOARDMODE_X && (d.x = 0), (this.billboardMode & Hr.BILLBOARDMODE_Y) !== Hr.BILLBOARDMODE_Y && (d.y = 0), (this.billboardMode & Hr.BILLBOARDMODE_Z) !== Hr.BILLBOARDMODE_Z && (d.z = 0), he.RotationYawPitchRollToRef(d.y, d.x, d.z, ue.Matrix[0]);
      }
      this._worldMatrix.setTranslationFromFloats(0, 0, 0), this._worldMatrix.multiplyToRef(ue.Matrix[0], this._worldMatrix), this._worldMatrix.setTranslation(ue.Vector3[0]);
    } else if (n.useBillboardPath && t && n.useBillboardPosition) {
      const o = ue.Vector3[0];
      this._worldMatrix.getTranslationToRef(o);
      const d = t.globalPosition;
      this._worldMatrix.invertToRef(ue.Matrix[1]);
      const v = ue.Vector3[1];
      S.TransformCoordinatesToRef(d, ue.Matrix[1], v), v.normalize();
      const u = -Math.atan2(v.z, v.x) + Math.PI / 2, l = Math.sqrt(v.x * v.x + v.z * v.z), P = -Math.atan2(v.y, l);
      if (Ze.RotationYawPitchRollToRef(u, P, 0, ue.Quaternion[0]), (this.billboardMode & Hr.BILLBOARDMODE_ALL) !== Hr.BILLBOARDMODE_ALL) {
        const p = ue.Vector3[1];
        ue.Quaternion[0].toEulerAnglesToRef(p), (this.billboardMode & Hr.BILLBOARDMODE_X) !== Hr.BILLBOARDMODE_X && (p.x = 0), (this.billboardMode & Hr.BILLBOARDMODE_Y) !== Hr.BILLBOARDMODE_Y && (p.y = 0), (this.billboardMode & Hr.BILLBOARDMODE_Z) !== Hr.BILLBOARDMODE_Z && (p.z = 0), he.RotationYawPitchRollToRef(p.y, p.x, p.z, ue.Matrix[0]);
      } else
        he.FromQuaternionToRef(ue.Quaternion[0], ue.Matrix[0]);
      this._worldMatrix.setTranslationFromFloats(0, 0, 0), this._worldMatrix.multiplyToRef(ue.Matrix[0], this._worldMatrix), this._worldMatrix.setTranslation(ue.Vector3[0]);
    }
    return this.ignoreNonUniformScaling ? this._updateNonUniformScalingState(!1) : this._scaling.isNonUniformWithinEpsilon(1e-6) ? this._updateNonUniformScalingState(!0) : i && i._nonUniformScaling ? this._updateNonUniformScalingState(i._nonUniformScaling) : this._updateNonUniformScalingState(!1), this._afterComputeWorldMatrix(), this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]), this._isAbsoluteSynced = !1, this.onAfterWorldMatrixUpdateObservable.notifyObservers(this), this._poseMatrix || (this._poseMatrix = he.Invert(this._worldMatrix)), this._worldMatrixDeterminantIsDirty = !0, this._worldMatrix;
  }
  /**
   * Resets this nodeTransform's local matrix to Matrix.Identity().
   * @param independentOfChildren indicates if all child nodeTransform's world-space transform should be preserved.
   */
  resetLocalMatrix(e = !0) {
    if (this.computeWorldMatrix(), e) {
      const t = this.getChildren();
      for (let r = 0; r < t.length; ++r) {
        const n = t[r];
        if (n) {
          n.computeWorldMatrix();
          const i = ue.Matrix[0];
          n._localMatrix.multiplyToRef(this._localMatrix, i);
          const s = ue.Quaternion[0];
          i.decompose(n.scaling, s, n.position), n.rotationQuaternion ? n.rotationQuaternion.copyFrom(s) : s.toEulerAnglesToRef(n.rotation);
        }
      }
    }
    this.scaling.copyFromFloats(1, 1, 1), this.position.copyFromFloats(0, 0, 0), this.rotation.copyFromFloats(0, 0, 0), this.rotationQuaternion && (this.rotationQuaternion = Ze.Identity()), this._worldMatrix = he.Identity();
  }
  _afterComputeWorldMatrix() {
  }
  /**
   * If you'd like to be called back after the mesh position, rotation or scaling has been updated.
   * @param func callback function to add
   *
   * @returns the TransformNode.
   */
  registerAfterWorldMatrixUpdate(e) {
    return this.onAfterWorldMatrixUpdateObservable.add(e), this;
  }
  /**
   * Removes a registered callback function.
   * @param func callback function to remove
   * @returns the TransformNode.
   */
  unregisterAfterWorldMatrixUpdate(e) {
    return this.onAfterWorldMatrixUpdateObservable.removeCallback(e), this;
  }
  /**
   * Gets the position of the current mesh in camera space
   * @param camera defines the camera to use
   * @returns a position
   */
  getPositionInCameraSpace(e = null) {
    return e || (e = this.getScene().activeCamera), S.TransformCoordinates(this.getAbsolutePosition(), e.getViewMatrix());
  }
  /**
   * Returns the distance from the mesh to the active camera
   * @param camera defines the camera to use
   * @returns the distance
   */
  getDistanceToCamera(e = null) {
    return e || (e = this.getScene().activeCamera), this.getAbsolutePosition().subtract(e.globalPosition).length();
  }
  /**
   * Clone the current transform node
   * @param name Name of the new clone
   * @param newParent New parent for the clone
   * @param doNotCloneChildren Do not clone children hierarchy
   * @returns the new transform node
   */
  clone(e, t, r) {
    const n = jt.Clone(() => new Hr(e, this.getScene()), this);
    if (n.name = e, n.id = e, t && (n.parent = t), !r) {
      const i = this.getDescendants(!0);
      for (let s = 0; s < i.length; s++) {
        const a = i[s];
        a.clone && a.clone(e + "." + a.name, n);
      }
    }
    return n;
  }
  /**
   * Serializes the objects information.
   * @param currentSerializationObject defines the object to serialize in
   * @returns the serialized object
   */
  serialize(e) {
    const t = jt.Serialize(this, e);
    return t.type = this.getClassName(), t.uniqueId = this.uniqueId, this.parent && this.parent._serializeAsParent(t), t.localMatrix = this.getPivotMatrix().asArray(), t.isEnabled = this.isEnabled(), t;
  }
  // Statics
  /**
   * Returns a new TransformNode object parsed from the source provided.
   * @param parsedTransformNode is the source.
   * @param scene the scene the object belongs to
   * @param rootUrl is a string, it's the root URL to prefix the `delayLoadingFile` property with
   * @returns a new TransformNode object parsed from the source provided.
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => new Hr(e.name, t), e, t, r);
    return e.localMatrix ? n.setPreTransformMatrix(he.FromArray(e.localMatrix)) : e.pivotMatrix && n.setPivotMatrix(he.FromArray(e.pivotMatrix)), n.setEnabled(e.isEnabled), n._waitingParsedUniqueId = e.uniqueId, e.parentId !== void 0 && (n._waitingParentId = e.parentId), e.parentInstanceIndex !== void 0 && (n._waitingParentInstanceIndex = e.parentInstanceIndex), n;
  }
  /**
   * Get all child-transformNodes of this node
   * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
   * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
   * @returns an array of TransformNode
   */
  getChildTransformNodes(e, t) {
    const r = [];
    return this._getDescendants(r, e, (n) => (!t || t(n)) && n instanceof Hr), r;
  }
  /**
   * Releases resources associated with this transform node.
   * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
   * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
   */
  dispose(e, t = !1) {
    if (this.getScene().stopAnimation(this), this.getScene().removeTransformNode(this), this._parentContainer) {
      const r = this._parentContainer.transformNodes.indexOf(this);
      r > -1 && this._parentContainer.transformNodes.splice(r, 1), this._parentContainer = null;
    }
    if (this.onAfterWorldMatrixUpdateObservable.clear(), e) {
      const r = this.getChildTransformNodes(!0);
      for (const n of r)
        n.parent = null, n.computeWorldMatrix(!0);
    }
    super.dispose(e, t);
  }
  /**
   * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
   * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
   * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
   * @param predicate predicate that is passed in to getHierarchyBoundingVectors when selecting which object should be included when scaling
   * @returns the current mesh
   */
  normalizeToUnitCube(e = !0, t = !1, r) {
    let n = null, i = null;
    t && (this.rotationQuaternion ? (i = this.rotationQuaternion.clone(), this.rotationQuaternion.copyFromFloats(0, 0, 0, 1)) : this.rotation && (n = this.rotation.clone(), this.rotation.copyFromFloats(0, 0, 0)));
    const s = this.getHierarchyBoundingVectors(e, r), a = s.max.subtract(s.min), f = Math.max(a.x, a.y, a.z);
    if (f === 0)
      return this;
    const o = 1 / f;
    return this.scaling.scaleInPlace(o), t && (this.rotationQuaternion && i ? this.rotationQuaternion.copyFrom(i) : this.rotation && n && this.rotation.copyFrom(n)), this;
  }
  _syncAbsoluteScalingAndRotation() {
    this._isAbsoluteSynced || (this._worldMatrix.decompose(this._absoluteScaling, this._absoluteRotationQuaternion), this._isAbsoluteSynced = !0);
  }
}
Hr.BILLBOARDMODE_NONE = 0;
Hr.BILLBOARDMODE_X = 1;
Hr.BILLBOARDMODE_Y = 2;
Hr.BILLBOARDMODE_Z = 4;
Hr.BILLBOARDMODE_ALL = 7;
Hr.BILLBOARDMODE_USE_POSITION = 128;
Hr.BillboardUseParentOrientation = !1;
Hr._TmpRotation = Ze.Zero();
Hr._TmpScaling = S.Zero();
Hr._TmpTranslation = S.Zero();
Hr._LookAtVectorCache = new S(0, 0, 0);
Hr._RotationAxisCache = new Ze();
C([
  fo("position")
], Hr.prototype, "_position", void 0);
C([
  fo("rotation")
], Hr.prototype, "_rotation", void 0);
C([
  S$("rotationQuaternion")
], Hr.prototype, "_rotationQuaternion", void 0);
C([
  fo("scaling")
], Hr.prototype, "_scaling", void 0);
C([
  M("billboardMode")
], Hr.prototype, "_billboardMode", void 0);
C([
  M()
], Hr.prototype, "scalingDeterminant", void 0);
C([
  M("infiniteDistance")
], Hr.prototype, "_infiniteDistance", void 0);
C([
  M()
], Hr.prototype, "ignoreNonUniformScaling", void 0);
C([
  M()
], Hr.prototype, "reIntegrateRotationIntoRotationQuaternion", void 0);
class aee {
  constructor() {
    this._checkCollisions = !1, this._collisionMask = -1, this._collisionGroup = -1, this._surroundingMeshes = null, this._collider = null, this._oldPositionForCollisions = new S(0, 0, 0), this._diffPositionForCollisions = new S(0, 0, 0), this._collisionResponse = !0;
  }
}
class l6e {
  constructor() {
    this.facetNb = 0, this.partitioningSubdivisions = 10, this.partitioningBBoxRatio = 1.01, this.facetDataEnabled = !1, this.facetParameters = {}, this.bbSize = S.Zero(), this.subDiv = {
      // actual number of subdivisions per axis for ComputeNormals()
      max: 1,
      // eslint-disable-next-line @typescript-eslint/naming-convention
      X: 1,
      // eslint-disable-next-line @typescript-eslint/naming-convention
      Y: 1,
      // eslint-disable-next-line @typescript-eslint/naming-convention
      Z: 1
    }, this.facetDepthSort = !1, this.facetDepthSortEnabled = !1;
  }
}
class P6e {
  constructor() {
    this._hasVertexAlpha = !1, this._useVertexColors = !0, this._numBoneInfluencers = 4, this._applyFog = !0, this._receiveShadows = !1, this._facetData = new l6e(), this._visibility = 1, this._skeleton = null, this._layerMask = 268435455, this._computeBonesUsingShaders = !0, this._isActive = !1, this._onlyForInstances = !1, this._isActiveIntermediate = !1, this._onlyForInstancesIntermediate = !1, this._actAsRegularMesh = !1, this._currentLOD = null, this._currentLODIsUpToDate = !1, this._collisionRetryCount = 3, this._morphTargetManager = null, this._renderingGroupId = 0, this._bakedVertexAnimationManager = null, this._material = null, this._positions = null, this._pointerOverDisableMeshTesting = !1, this._meshCollisionData = new aee(), this._enableDistantPicking = !1, this._rawBoundingInfo = null;
  }
}
class jn extends Hr {
  /**
   * No billboard
   */
  static get BILLBOARDMODE_NONE() {
    return Hr.BILLBOARDMODE_NONE;
  }
  /** Billboard on X axis */
  static get BILLBOARDMODE_X() {
    return Hr.BILLBOARDMODE_X;
  }
  /** Billboard on Y axis */
  static get BILLBOARDMODE_Y() {
    return Hr.BILLBOARDMODE_Y;
  }
  /** Billboard on Z axis */
  static get BILLBOARDMODE_Z() {
    return Hr.BILLBOARDMODE_Z;
  }
  /** Billboard on all axes */
  static get BILLBOARDMODE_ALL() {
    return Hr.BILLBOARDMODE_ALL;
  }
  /** Billboard on using position instead of orientation */
  static get BILLBOARDMODE_USE_POSITION() {
    return Hr.BILLBOARDMODE_USE_POSITION;
  }
  /**
   * Gets the number of facets in the mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet
   */
  get facetNb() {
    return this._internalAbstractMeshDataInfo._facetData.facetNb;
  }
  /**
   * Gets or set the number (integer) of subdivisions per axis in the partitioning space
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning
   */
  get partitioningSubdivisions() {
    return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions;
  }
  set partitioningSubdivisions(e) {
    this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions = e;
  }
  /**
   * The ratio (float) to apply to the bounding box size to set to the partitioning space.
   * Ex : 1.01 (default) the partitioning space is 1% bigger than the bounding box
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning
   */
  get partitioningBBoxRatio() {
    return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio;
  }
  set partitioningBBoxRatio(e) {
    this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio = e;
  }
  /**
   * Gets or sets a boolean indicating that the facets must be depth sorted on next call to `updateFacetData()`.
   * Works only for updatable meshes.
   * Doesn't work with multi-materials
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort
   */
  get mustDepthSortFacets() {
    return this._internalAbstractMeshDataInfo._facetData.facetDepthSort;
  }
  set mustDepthSortFacets(e) {
    this._internalAbstractMeshDataInfo._facetData.facetDepthSort = e;
  }
  /**
   * The location (Vector3) where the facet depth sort must be computed from.
   * By default, the active camera position.
   * Used only when facet depth sort is enabled
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort
   */
  get facetDepthSortFrom() {
    return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom;
  }
  set facetDepthSortFrom(e) {
    this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom = e;
  }
  /** number of collision detection tries. Change this value if not all collisions are detected and handled properly */
  get collisionRetryCount() {
    return this._internalAbstractMeshDataInfo._collisionRetryCount;
  }
  set collisionRetryCount(e) {
    this._internalAbstractMeshDataInfo._collisionRetryCount = e;
  }
  /**
   * gets a boolean indicating if facetData is enabled
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet
   */
  get isFacetDataEnabled() {
    return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled;
  }
  /**
   * Gets or sets the morph target manager
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/morphTargets
   */
  get morphTargetManager() {
    return this._internalAbstractMeshDataInfo._morphTargetManager;
  }
  set morphTargetManager(e) {
    this._internalAbstractMeshDataInfo._morphTargetManager !== e && (this._internalAbstractMeshDataInfo._morphTargetManager = e, this._syncGeometryWithMorphTargetManager());
  }
  /**
   * Gets or sets the baked vertex animation manager
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/baked_texture_animations
   */
  get bakedVertexAnimationManager() {
    return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager;
  }
  set bakedVertexAnimationManager(e) {
    this._internalAbstractMeshDataInfo._bakedVertexAnimationManager !== e && (this._internalAbstractMeshDataInfo._bakedVertexAnimationManager = e, this._markSubMeshesAsAttributesDirty());
  }
  /** @internal */
  _syncGeometryWithMorphTargetManager() {
  }
  /**
   * @internal
   */
  _updateNonUniformScalingState(e) {
    return super._updateNonUniformScalingState(e) ? (this._markSubMeshesAsMiscDirty(), !0) : !1;
  }
  /** @internal */
  get rawBoundingInfo() {
    return this._internalAbstractMeshDataInfo._rawBoundingInfo;
  }
  set rawBoundingInfo(e) {
    this._internalAbstractMeshDataInfo._rawBoundingInfo = e;
  }
  /** Set a function to call when this mesh collides with another one */
  set onCollide(e) {
    this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver && this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver), this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver = this.onCollideObservable.add(e);
  }
  /** Set a function to call when the collision's position changes */
  set onCollisionPositionChange(e) {
    this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver && this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver), this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(e);
  }
  /**
   * Gets or sets mesh visibility between 0 and 1 (default is 1)
   */
  get visibility() {
    return this._internalAbstractMeshDataInfo._visibility;
  }
  /**
   * Gets or sets mesh visibility between 0 and 1 (default is 1)
   */
  set visibility(e) {
    if (this._internalAbstractMeshDataInfo._visibility === e)
      return;
    const t = this._internalAbstractMeshDataInfo._visibility;
    this._internalAbstractMeshDataInfo._visibility = e, (t === 1 && e !== 1 || t !== 1 && e === 1) && this._markSubMeshesAsDirty((r) => {
      r.markAsMiscDirty(), r.markAsPrePassDirty();
    });
  }
  /**
   * Gets or sets the property which disables the test that is checking that the mesh under the pointer is the same than the previous time we tested for it (default: false).
   * Set this property to true if you want thin instances picking to be reported accurately when moving over the mesh.
   * Note that setting this property to true will incur some performance penalties when dealing with pointer events for this mesh so use it sparingly.
   */
  get pointerOverDisableMeshTesting() {
    return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting;
  }
  set pointerOverDisableMeshTesting(e) {
    this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting = e;
  }
  /**
   * Specifies the rendering group id for this mesh (0 by default)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering#rendering-groups
   */
  get renderingGroupId() {
    return this._internalAbstractMeshDataInfo._renderingGroupId;
  }
  set renderingGroupId(e) {
    this._internalAbstractMeshDataInfo._renderingGroupId = e;
  }
  /** Gets or sets current material */
  get material() {
    return this._internalAbstractMeshDataInfo._material;
  }
  set material(e) {
    this._internalAbstractMeshDataInfo._material !== e && (this._internalAbstractMeshDataInfo._material && this._internalAbstractMeshDataInfo._material.meshMap && (this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId] = void 0), this._internalAbstractMeshDataInfo._material = e, e && e.meshMap && (e.meshMap[this.uniqueId] = this), this.onMaterialChangedObservable.hasObservers() && this.onMaterialChangedObservable.notifyObservers(this), this.subMeshes && (this.resetDrawCache(), this._unBindEffect()));
  }
  /**
   * Gets the material used to render the mesh in a specific render pass
   * @param renderPassId render pass id
   * @returns material used for the render pass. If no specific material is used for this render pass, undefined is returned (meaning mesh.material is used for this pass)
   */
  getMaterialForRenderPass(e) {
    var t;
    return (t = this._internalAbstractMeshDataInfo._materialForRenderPass) === null || t === void 0 ? void 0 : t[e];
  }
  /**
   * Sets the material to be used to render the mesh in a specific render pass
   * @param renderPassId render pass id
   * @param material material to use for this render pass. If undefined is passed, no specific material will be used for this render pass but the regular material will be used instead (mesh.material)
   */
  setMaterialForRenderPass(e, t) {
    this.resetDrawCache(e), this._internalAbstractMeshDataInfo._materialForRenderPass || (this._internalAbstractMeshDataInfo._materialForRenderPass = []), this._internalAbstractMeshDataInfo._materialForRenderPass[e] = t;
  }
  /**
   * Gets or sets a boolean indicating that this mesh can receive realtime shadows
   * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
   */
  get receiveShadows() {
    return this._internalAbstractMeshDataInfo._receiveShadows;
  }
  set receiveShadows(e) {
    this._internalAbstractMeshDataInfo._receiveShadows !== e && (this._internalAbstractMeshDataInfo._receiveShadows = e, this._markSubMeshesAsLightDirty());
  }
  /** Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values */
  get hasVertexAlpha() {
    return this._internalAbstractMeshDataInfo._hasVertexAlpha;
  }
  set hasVertexAlpha(e) {
    this._internalAbstractMeshDataInfo._hasVertexAlpha !== e && (this._internalAbstractMeshDataInfo._hasVertexAlpha = e, this._markSubMeshesAsAttributesDirty(), this._markSubMeshesAsMiscDirty());
  }
  /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */
  get useVertexColors() {
    return this._internalAbstractMeshDataInfo._useVertexColors;
  }
  set useVertexColors(e) {
    this._internalAbstractMeshDataInfo._useVertexColors !== e && (this._internalAbstractMeshDataInfo._useVertexColors = e, this._markSubMeshesAsAttributesDirty());
  }
  /**
   * Gets or sets a boolean indicating that bone animations must be computed by the GPU (true by default)
   */
  get computeBonesUsingShaders() {
    return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;
  }
  set computeBonesUsingShaders(e) {
    this._internalAbstractMeshDataInfo._computeBonesUsingShaders !== e && (this._internalAbstractMeshDataInfo._computeBonesUsingShaders = e, this._markSubMeshesAsAttributesDirty());
  }
  /** Gets or sets the number of allowed bone influences per vertex (4 by default) */
  get numBoneInfluencers() {
    return this._internalAbstractMeshDataInfo._numBoneInfluencers;
  }
  set numBoneInfluencers(e) {
    this._internalAbstractMeshDataInfo._numBoneInfluencers !== e && (this._internalAbstractMeshDataInfo._numBoneInfluencers = e, this._markSubMeshesAsAttributesDirty());
  }
  /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */
  get applyFog() {
    return this._internalAbstractMeshDataInfo._applyFog;
  }
  set applyFog(e) {
    this._internalAbstractMeshDataInfo._applyFog !== e && (this._internalAbstractMeshDataInfo._applyFog = e, this._markSubMeshesAsMiscDirty());
  }
  /** When enabled, decompose picking matrices for better precision with large values for mesh position and scling */
  get enableDistantPicking() {
    return this._internalAbstractMeshDataInfo._enableDistantPicking;
  }
  set enableDistantPicking(e) {
    this._internalAbstractMeshDataInfo._enableDistantPicking = e;
  }
  /**
   * Gets or sets the current layer mask (default is 0x0FFFFFFF)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/layerMasksAndMultiCam
   */
  get layerMask() {
    return this._internalAbstractMeshDataInfo._layerMask;
  }
  set layerMask(e) {
    e !== this._internalAbstractMeshDataInfo._layerMask && (this._internalAbstractMeshDataInfo._layerMask = e, this._resyncLightSources());
  }
  /**
   * Gets or sets a collision mask used to mask collisions (default is -1).
   * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
   */
  get collisionMask() {
    return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask;
  }
  set collisionMask(e) {
    this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask = isNaN(e) ? -1 : e;
  }
  /**
   * Gets or sets a collision response flag (default is true).
   * when collisionResponse is false, events are still triggered but colliding entity has no response
   * This helps creating trigger volume when user wants collision feedback events but not position/velocity
   * to respond to the collision.
   */
  get collisionResponse() {
    return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse;
  }
  set collisionResponse(e) {
    this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse = e;
  }
  /**
   * Gets or sets the current collision group mask (-1 by default).
   * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
   */
  get collisionGroup() {
    return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup;
  }
  set collisionGroup(e) {
    this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup = isNaN(e) ? -1 : e;
  }
  /**
   * Gets or sets current surrounding meshes (null by default).
   *
   * By default collision detection is tested against every mesh in the scene.
   * It is possible to set surroundingMeshes to a defined list of meshes and then only these specified
   * meshes will be tested for the collision.
   *
   * Note: if set to an empty array no collision will happen when this mesh is moved.
   */
  get surroundingMeshes() {
    return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes;
  }
  set surroundingMeshes(e) {
    this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes = e;
  }
  /** Gets the list of lights affecting that mesh */
  get lightSources() {
    return this._lightSources;
  }
  /** @internal */
  get _positions() {
    return null;
  }
  /**
   * Gets or sets a skeleton to apply skinning transformations
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
   */
  set skeleton(e) {
    const t = this._internalAbstractMeshDataInfo._skeleton;
    t && t.needInitialSkinMatrix && t._unregisterMeshWithPoseMatrix(this), e && e.needInitialSkinMatrix && e._registerMeshWithPoseMatrix(this), this._internalAbstractMeshDataInfo._skeleton = e, this._internalAbstractMeshDataInfo._skeleton || (this._bonesTransformMatrices = null), this._markSubMeshesAsAttributesDirty();
  }
  get skeleton() {
    return this._internalAbstractMeshDataInfo._skeleton;
  }
  // Constructor
  /**
   * Creates a new AbstractMesh
   * @param name defines the name of the mesh
   * @param scene defines the hosting scene
   */
  constructor(e, t = null) {
    switch (super(e, t, !1), this._internalAbstractMeshDataInfo = new P6e(), this._waitingMaterialId = null, this.cullingStrategy = jn.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY, this.onCollideObservable = new Oe(), this.onCollisionPositionChangeObservable = new Oe(), this.onMaterialChangedObservable = new Oe(), this.definedFacingForward = !0, this._occlusionQuery = null, this._renderingGroup = null, this.alphaIndex = Number.MAX_VALUE, this.isVisible = !0, this.isPickable = !0, this.isNearPickable = !1, this.isNearGrabbable = !1, this.showSubMeshesBoundingBox = !1, this.isBlocker = !1, this.enablePointerMoveEvents = !1, this.outlineColor = Ne.Red(), this.outlineWidth = 0.02, this.overlayColor = Ne.Red(), this.overlayAlpha = 0.5, this.useOctreeForRenderingSelection = !0, this.useOctreeForPicking = !0, this.useOctreeForCollisions = !0, this.alwaysSelectAsActiveMesh = !1, this.doNotSyncBoundingInfo = !1, this.actionManager = null, this.ellipsoid = new S(0.5, 1, 0.5), this.ellipsoidOffset = new S(0, 0, 0), this.edgesWidth = 1, this.edgesColor = new xt(1, 0, 0, 1), this._edgesRenderer = null, this._masterMesh = null, this._boundingInfo = null, this._boundingInfoIsDirty = !0, this._renderId = 0, this._intersectionsInProgress = new Array(), this._unIndexed = !1, this._lightSources = new Array(), this._waitingData = {
      lods: null,
      actions: null,
      freezeWorldMatrix: null
    }, this._bonesTransformMatrices = null, this._transformMatrixTexture = null, this.onRebuildObservable = new Oe(), this._onCollisionPositionChange = (r, n, i = null) => {
      n.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions, this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions), this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length() > Ge.CollisionsEpsilon && this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions), i && this.onCollideObservable.notifyObservers(i), this.onCollisionPositionChangeObservable.notifyObservers(this.position);
    }, t = this.getScene(), t.addMesh(this), this._resyncLightSources(), this._uniformBuffer = new yr(this.getScene().getEngine(), void 0, void 0, e, !this.getScene().getEngine().isWebGPU), this._buildUniformLayout(), t.performancePriority) {
      case $H.Aggressive:
        this.doNotSyncBoundingInfo = !0;
      case $H.Intermediate:
        this.alwaysSelectAsActiveMesh = !0, this.isPickable = !1;
        break;
    }
  }
  _buildUniformLayout() {
    this._uniformBuffer.addUniform("world", 16), this._uniformBuffer.addUniform("visibility", 1), this._uniformBuffer.create();
  }
  /**
   * Transfer the mesh values to its UBO.
   * @param world The world matrix associated with the mesh
   */
  transferToEffect(e) {
    const t = this._uniformBuffer;
    t.updateMatrix("world", e), t.updateFloat("visibility", this._internalAbstractMeshDataInfo._visibility), t.update();
  }
  /**
   * Gets the mesh uniform buffer.
   * @returns the uniform buffer of the mesh.
   */
  getMeshUniformBuffer() {
    return this._uniformBuffer;
  }
  /**
   * Returns the string "AbstractMesh"
   * @returns "AbstractMesh"
   */
  getClassName() {
    return "AbstractMesh";
  }
  /**
   * Gets a string representation of the current mesh
   * @param fullDetails defines a boolean indicating if full details must be included
   * @returns a string representation of the current mesh
   */
  toString(e) {
    let t = "Name: " + this.name + ", isInstance: " + (this.getClassName() !== "InstancedMesh" ? "YES" : "NO");
    t += ", # of submeshes: " + (this.subMeshes ? this.subMeshes.length : 0);
    const r = this._internalAbstractMeshDataInfo._skeleton;
    return r && (t += ", skeleton: " + r.name), e && (t += ", billboard mode: " + ["NONE", "X", "Y", null, "Z", null, null, "ALL"][this.billboardMode], t += ", freeze wrld mat: " + (this._isWorldMatrixFrozen || this._waitingData.freezeWorldMatrix ? "YES" : "NO")), t;
  }
  /**
   * @internal
   */
  _getEffectiveParent() {
    return this._masterMesh && this.billboardMode !== Hr.BILLBOARDMODE_NONE ? this._masterMesh : super._getEffectiveParent();
  }
  /**
   * @internal
   */
  _getActionManagerForTrigger(e, t = !0) {
    if (this.actionManager && (t || this.actionManager.isRecursive))
      if (e) {
        if (this.actionManager.hasSpecificTrigger(e))
          return this.actionManager;
      } else
        return this.actionManager;
    return this.parent ? this.parent._getActionManagerForTrigger(e, !1) : null;
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _rebuild(e = !1) {
    if (this.onRebuildObservable.notifyObservers(this), this._occlusionQuery !== null && (this._occlusionQuery = null), !!this.subMeshes)
      for (const t of this.subMeshes)
        t._rebuild();
  }
  /** @internal */
  _resyncLightSources() {
    this._lightSources.length = 0;
    for (const e of this.getScene().lights)
      e.isEnabled() && e.canAffectMesh(this) && this._lightSources.push(e);
    this._markSubMeshesAsLightDirty();
  }
  /**
   * @internal
   */
  _resyncLightSource(e) {
    const t = e.isEnabled() && e.canAffectMesh(this), r = this._lightSources.indexOf(e);
    let n = !1;
    if (r === -1) {
      if (!t)
        return;
      this._lightSources.push(e);
    } else {
      if (t)
        return;
      n = !0, this._lightSources.splice(r, 1);
    }
    this._markSubMeshesAsLightDirty(n);
  }
  /** @internal */
  _unBindEffect() {
    for (const e of this.subMeshes)
      e.setEffect(null);
  }
  /**
   * @internal
   */
  _removeLightSource(e, t) {
    const r = this._lightSources.indexOf(e);
    r !== -1 && (this._lightSources.splice(r, 1), this._markSubMeshesAsLightDirty(t));
  }
  _markSubMeshesAsDirty(e) {
    if (this.subMeshes)
      for (const t of this.subMeshes)
        for (let r = 0; r < t._drawWrappers.length; ++r) {
          const n = t._drawWrappers[r];
          !n || !n.defines || !n.defines.markAllAsDirty || e(n.defines);
        }
  }
  /**
   * @internal
   */
  _markSubMeshesAsLightDirty(e = !1) {
    this._markSubMeshesAsDirty((t) => t.markAsLightDirty(e));
  }
  /** @internal */
  _markSubMeshesAsAttributesDirty() {
    this._markSubMeshesAsDirty((e) => e.markAsAttributesDirty());
  }
  /** @internal */
  _markSubMeshesAsMiscDirty() {
    this._markSubMeshesAsDirty((e) => e.markAsMiscDirty());
  }
  /**
   * Flag the AbstractMesh as dirty (Forcing it to update everything)
   * @param property if set to "rotation" the objects rotationQuaternion will be set to null
   * @returns this AbstractMesh
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  markAsDirty(e) {
    return this._currentRenderId = Number.MAX_VALUE, this._isDirty = !0, this;
  }
  /**
   * Resets the draw wrappers cache for all submeshes of this abstract mesh
   * @param passId If provided, releases only the draw wrapper corresponding to this render pass id
   */
  resetDrawCache(e) {
    if (this.subMeshes)
      for (const t of this.subMeshes)
        t.resetDrawCache(e);
  }
  // Methods
  /**
   * Returns true if the mesh is blocked. Implemented by child classes
   */
  get isBlocked() {
    return !1;
  }
  /**
   * Returns the mesh itself by default. Implemented by child classes
   * @param camera defines the camera to use to pick the right LOD level
   * @returns the currentAbstractMesh
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getLOD(e) {
    return this;
  }
  /**
   * Returns 0 by default. Implemented by child classes
   * @returns an integer
   */
  getTotalVertices() {
    return 0;
  }
  /**
   * Returns a positive integer : the total number of indices in this mesh geometry.
   * @returns the number of indices or zero if the mesh has no geometry.
   */
  getTotalIndices() {
    return 0;
  }
  /**
   * Returns null by default. Implemented by child classes
   * @returns null
   */
  getIndices() {
    return null;
  }
  /**
   * Returns the array of the requested vertex data kind. Implemented by child classes
   * @param kind defines the vertex data kind to use
   * @returns null
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getVerticesData(e) {
    return null;
  }
  /**
   * Sets the vertex data of the mesh geometry for the requested `kind`.
   * If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data.
   * Note that a new underlying VertexBuffer object is created each call.
   * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
   * @param kind defines vertex data kind:
   * * VertexBuffer.PositionKind
   * * VertexBuffer.UVKind
   * * VertexBuffer.UV2Kind
   * * VertexBuffer.UV3Kind
   * * VertexBuffer.UV4Kind
   * * VertexBuffer.UV5Kind
   * * VertexBuffer.UV6Kind
   * * VertexBuffer.ColorKind
   * * VertexBuffer.MatricesIndicesKind
   * * VertexBuffer.MatricesIndicesExtraKind
   * * VertexBuffer.MatricesWeightsKind
   * * VertexBuffer.MatricesWeightsExtraKind
   * @param data defines the data source
   * @param updatable defines if the data must be flagged as updatable (or static)
   * @param stride defines the vertex stride (size of an entire vertex). Can be null and in this case will be deduced from vertex data kind
   * @returns the current mesh
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  setVerticesData(e, t, r, n) {
    return this;
  }
  /**
   * Updates the existing vertex data of the mesh geometry for the requested `kind`.
   * If the mesh has no geometry, it is simply returned as it is.
   * @param kind defines vertex data kind:
   * * VertexBuffer.PositionKind
   * * VertexBuffer.UVKind
   * * VertexBuffer.UV2Kind
   * * VertexBuffer.UV3Kind
   * * VertexBuffer.UV4Kind
   * * VertexBuffer.UV5Kind
   * * VertexBuffer.UV6Kind
   * * VertexBuffer.ColorKind
   * * VertexBuffer.MatricesIndicesKind
   * * VertexBuffer.MatricesIndicesExtraKind
   * * VertexBuffer.MatricesWeightsKind
   * * VertexBuffer.MatricesWeightsExtraKind
   * @param data defines the data source
   * @param updateExtends If `kind` is `PositionKind` and if `updateExtends` is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed
   * @param makeItUnique If true, a new global geometry is created from this data and is set to the mesh
   * @returns the current mesh
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  updateVerticesData(e, t, r, n) {
    return this;
  }
  /**
   * Sets the mesh indices,
   * If the mesh has no geometry, a new Geometry object is created and set to the mesh.
   * @param indices Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array)
   * @param totalVertices Defines the total number of vertices
   * @returns the current mesh
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  setIndices(e, t) {
    return this;
  }
  /**
   * Gets a boolean indicating if specific vertex data is present
   * @param kind defines the vertex data kind to use
   * @returns true is data kind is present
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  isVerticesDataPresent(e) {
    return !1;
  }
  /**
   * Returns the mesh BoundingInfo object or creates a new one and returns if it was undefined.
   * Note that it returns a shallow bounding of the mesh (i.e. it does not include children).
   * However, if the mesh contains thin instances, it will be expanded to include them. If you want the "raw" bounding data instead, then use `getRawBoundingInfo()`.
   * To get the full bounding of all children, call `getHierarchyBoundingVectors` instead.
   * @returns a BoundingInfo
   */
  getBoundingInfo() {
    return this._masterMesh ? this._masterMesh.getBoundingInfo() : (this._boundingInfoIsDirty && (this._boundingInfoIsDirty = !1, this._updateBoundingInfo()), this._boundingInfo);
  }
  /**
   * Returns the bounding info unnafected by instance data.
   * @returns the bounding info of the mesh unaffected by instance data.
   */
  getRawBoundingInfo() {
    var e;
    return (e = this.rawBoundingInfo) !== null && e !== void 0 ? e : this.getBoundingInfo();
  }
  /**
   * Overwrite the current bounding info
   * @param boundingInfo defines the new bounding info
   * @returns the current mesh
   */
  setBoundingInfo(e) {
    return this._boundingInfo = e, this;
  }
  /**
   * Returns true if there is already a bounding info
   */
  get hasBoundingInfo() {
    return this._boundingInfo !== null;
  }
  /**
   * Creates a new bounding info for the mesh
   * @param minimum min vector of the bounding box/sphere
   * @param maximum max vector of the bounding box/sphere
   * @param worldMatrix defines the new world matrix
   * @returns the new bounding info
   */
  buildBoundingInfo(e, t, r) {
    return this._boundingInfo = new Md(e, t, r), this._boundingInfo;
  }
  /**
   * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
   * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
   * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
   * @param predicate predicate that is passed in to getHierarchyBoundingVectors when selecting which object should be included when scaling
   * @returns the current mesh
   */
  normalizeToUnitCube(e = !0, t = !1, r) {
    return super.normalizeToUnitCube(e, t, r);
  }
  /** Gets a boolean indicating if this mesh has skinning data and an attached skeleton */
  get useBones() {
    return this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(J.MatricesIndicesKind) && this.isVerticesDataPresent(J.MatricesWeightsKind);
  }
  /** @internal */
  _preActivate() {
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _preActivateForIntermediateRendering(e) {
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _activate(e, t) {
    return this._renderId = e, !0;
  }
  /** @internal */
  _postActivate() {
  }
  /** @internal */
  _freeze() {
  }
  /** @internal */
  _unFreeze() {
  }
  /**
   * Gets the current world matrix
   * @returns a Matrix
   */
  getWorldMatrix() {
    return this._masterMesh && this.billboardMode === Hr.BILLBOARDMODE_NONE ? this._masterMesh.getWorldMatrix() : super.getWorldMatrix();
  }
  /** @internal */
  _getWorldMatrixDeterminant() {
    return this._masterMesh ? this._masterMesh._getWorldMatrixDeterminant() : super._getWorldMatrixDeterminant();
  }
  /**
   * Gets a boolean indicating if this mesh is an instance or a regular mesh
   */
  get isAnInstance() {
    return !1;
  }
  /**
   * Gets a boolean indicating if this mesh has instances
   */
  get hasInstances() {
    return !1;
  }
  /**
   * Gets a boolean indicating if this mesh has thin instances
   */
  get hasThinInstances() {
    return !1;
  }
  // ================================== Point of View Movement =================================
  /**
   * Perform relative position change from the point of view of behind the front of the mesh.
   * This is performed taking into account the meshes current rotation, so you do not have to care.
   * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
   * @param amountRight defines the distance on the right axis
   * @param amountUp defines the distance on the up axis
   * @param amountForward defines the distance on the forward axis
   * @returns the current mesh
   */
  movePOV(e, t, r) {
    return this.position.addInPlace(this.calcMovePOV(e, t, r)), this;
  }
  /**
   * Calculate relative position change from the point of view of behind the front of the mesh.
   * This is performed taking into account the meshes current rotation, so you do not have to care.
   * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
   * @param amountRight defines the distance on the right axis
   * @param amountUp defines the distance on the up axis
   * @param amountForward defines the distance on the forward axis
   * @returns the new displacement vector
   */
  calcMovePOV(e, t, r) {
    const n = new he();
    (this.rotationQuaternion ? this.rotationQuaternion : Ze.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z)).toRotationMatrix(n);
    const s = S.Zero(), a = this.definedFacingForward ? -1 : 1;
    return S.TransformCoordinatesFromFloatsToRef(e * a, t, r * a, n, s), s;
  }
  // ================================== Point of View Rotation =================================
  /**
   * Perform relative rotation change from the point of view of behind the front of the mesh.
   * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
   * @param flipBack defines the flip
   * @param twirlClockwise defines the twirl
   * @param tiltRight defines the tilt
   * @returns the current mesh
   */
  rotatePOV(e, t, r) {
    return this.rotation.addInPlace(this.calcRotatePOV(e, t, r)), this;
  }
  /**
   * Calculate relative rotation change from the point of view of behind the front of the mesh.
   * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
   * @param flipBack defines the flip
   * @param twirlClockwise defines the twirl
   * @param tiltRight defines the tilt
   * @returns the new rotation vector
   */
  calcRotatePOV(e, t, r) {
    const n = this.definedFacingForward ? 1 : -1;
    return new S(e * n, t, r * n);
  }
  /**
   * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
   * This means the mesh underlying bounding box and sphere are recomputed.
   * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
   * @param applyMorph  defines whether to apply the morph target before computing the bounding info
   * @returns the current mesh
   */
  refreshBoundingInfo(e = !1, t = !1) {
    return this._boundingInfo && this._boundingInfo.isLocked ? this : (this._refreshBoundingInfo(this._getPositionData(e, t), null), this);
  }
  /**
   * @internal
   */
  _refreshBoundingInfo(e, t) {
    if (e) {
      const r = WS(e, 0, this.getTotalVertices(), t);
      this._boundingInfo ? this._boundingInfo.reConstruct(r.minimum, r.maximum) : this._boundingInfo = new Md(r.minimum, r.maximum);
    }
    if (this.subMeshes)
      for (let r = 0; r < this.subMeshes.length; r++)
        this.subMeshes[r].refreshBoundingInfo(e);
    this._updateBoundingInfo();
  }
  /**
   * Internal function to get buffer data and possibly apply morphs and normals
   * @param applySkeleton
   * @param applyMorph
   * @param data
   * @param kind the kind of data you want. Can be Normal or Position
   */
  _getData(e = !1, t = !1, r, n = J.PositionKind) {
    if (r = r ?? this.getVerticesData(n).slice(), r && t && this.morphTargetManager) {
      let i = 0, s = 0;
      for (let a = 0; a < r.length; a++) {
        for (let f = 0; f < this.morphTargetManager.numTargets; f++) {
          const o = this.morphTargetManager.getTarget(f), d = o.influence;
          if (d > 0) {
            const v = o.getPositions();
            v && (r[a] += (v[a] - r[a]) * d);
          }
        }
        if (i++, n === J.PositionKind && this._positions && i === 3) {
          i = 0;
          const f = s * 3;
          this._positions[s++].copyFromFloats(r[f], r[f + 1], r[f + 2]);
        }
      }
    }
    if (r && e && this.skeleton) {
      const i = this.getVerticesData(J.MatricesIndicesKind), s = this.getVerticesData(J.MatricesWeightsKind);
      if (s && i) {
        const a = this.numBoneInfluencers > 4, f = a ? this.getVerticesData(J.MatricesIndicesExtraKind) : null, o = a ? this.getVerticesData(J.MatricesWeightsExtraKind) : null, d = this.skeleton.getTransformMatrices(this), v = ue.Vector3[0], u = ue.Matrix[0], l = ue.Matrix[1];
        let P = 0;
        for (let p = 0; p < r.length; p += 3, P += 4) {
          u.reset();
          let c, H;
          for (c = 0; c < 4; c++)
            H = s[P + c], H > 0 && (he.FromFloat32ArrayToRefScaled(d, Math.floor(i[P + c] * 16), H, l), u.addToSelf(l));
          if (a)
            for (c = 0; c < 4; c++)
              H = o[P + c], H > 0 && (he.FromFloat32ArrayToRefScaled(d, Math.floor(f[P + c] * 16), H, l), u.addToSelf(l));
          n === J.NormalKind ? S.TransformNormalFromFloatsToRef(r[p], r[p + 1], r[p + 2], u, v) : S.TransformCoordinatesFromFloatsToRef(r[p], r[p + 1], r[p + 2], u, v), v.toArray(r, p), n === J.PositionKind && this._positions && this._positions[p / 3].copyFrom(v);
        }
      }
    }
    return r;
  }
  /**
   * Get the normals vertex data and optionally apply skeleton and morphing.
   * @param applySkeleton defines whether to apply the skeleton
   * @param applyMorph  defines whether to apply the morph target
   * @returns the normals data
   */
  getNormalsData(e = !1, t = !1) {
    return this._getData(e, t, null, J.NormalKind);
  }
  /**
   * Get the position vertex data and optionally apply skeleton and morphing.
   * @param applySkeleton defines whether to apply the skeleton
   * @param applyMorph  defines whether to apply the morph target
   * @param data defines the position data to apply the skeleton and morph to
   * @returns the position data
   */
  getPositionData(e = !1, t = !1, r) {
    return this._getData(e, t, r, J.PositionKind);
  }
  /**
   * @internal
   */
  _getPositionData(e, t) {
    var r;
    let n = this.getVerticesData(J.PositionKind);
    if (this._internalAbstractMeshDataInfo._positions && (this._internalAbstractMeshDataInfo._positions = null), n && (e && this.skeleton || t && this.morphTargetManager)) {
      if (n = n.slice(), this._generatePointsArray(), this._positions) {
        const i = this._positions;
        this._internalAbstractMeshDataInfo._positions = new Array(i.length);
        for (let s = 0; s < i.length; s++)
          this._internalAbstractMeshDataInfo._positions[s] = ((r = i[s]) === null || r === void 0 ? void 0 : r.clone()) || new S();
      }
      return this.getPositionData(e, t, n);
    }
    return n;
  }
  /** @internal */
  _updateBoundingInfo() {
    return this._boundingInfo ? this._boundingInfo.update(this.worldMatrixFromCache) : this._boundingInfo = new Md(S.Zero(), S.Zero(), this.worldMatrixFromCache), this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache), this;
  }
  /**
   * @internal
   */
  _updateSubMeshesBoundingInfo(e) {
    if (!this.subMeshes)
      return this;
    const t = this.subMeshes.length;
    for (let r = 0; r < t; r++) {
      const n = this.subMeshes[r];
      (t > 1 || !n.IsGlobal) && n.updateBoundingInfo(e);
    }
    return this;
  }
  /** @internal */
  _afterComputeWorldMatrix() {
    this.doNotSyncBoundingInfo || (this._boundingInfoIsDirty = !0);
  }
  /**
   * Returns `true` if the mesh is within the frustum defined by the passed array of planes.
   * A mesh is in the frustum if its bounding box intersects the frustum
   * @param frustumPlanes defines the frustum to test
   * @returns true if the mesh is in the frustum planes
   */
  isInFrustum(e) {
    return this.getBoundingInfo().isInFrustum(e, this.cullingStrategy);
  }
  /**
   * Returns `true` if the mesh is completely in the frustum defined be the passed array of planes.
   * A mesh is completely in the frustum if its bounding box it completely inside the frustum.
   * @param frustumPlanes defines the frustum to test
   * @returns true if the mesh is completely in the frustum planes
   */
  isCompletelyInFrustum(e) {
    return this.getBoundingInfo().isCompletelyInFrustum(e);
  }
  /**
   * True if the mesh intersects another mesh or a SolidParticle object
   * @param mesh defines a target mesh or SolidParticle to test
   * @param precise Unless the parameter `precise` is set to `true` the intersection is computed according to Axis Aligned Bounding Boxes (AABB), else according to OBB (Oriented BBoxes)
   * @param includeDescendants Can be set to true to test if the mesh defined in parameters intersects with the current mesh or any child meshes
   * @returns true if there is an intersection
   */
  intersectsMesh(e, t = !1, r) {
    const n = this.getBoundingInfo(), i = e.getBoundingInfo();
    if (n.intersects(i, t))
      return !0;
    if (r) {
      for (const s of this.getChildMeshes())
        if (s.intersectsMesh(e, t, !0))
          return !0;
    }
    return !1;
  }
  /**
   * Returns true if the passed point (Vector3) is inside the mesh bounding box
   * @param point defines the point to test
   * @returns true if there is an intersection
   */
  intersectsPoint(e) {
    return this.getBoundingInfo().intersectsPoint(e);
  }
  // Collisions
  /**
   * Gets or sets a boolean indicating that this mesh can be used in the collision engine
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
   */
  get checkCollisions() {
    return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions;
  }
  set checkCollisions(e) {
    this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions = e;
  }
  /**
   * Gets Collider object used to compute collisions (not physics)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
   */
  get collider() {
    return this._internalAbstractMeshDataInfo._meshCollisionData._collider;
  }
  /**
   * Move the mesh using collision engine
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
   * @param displacement defines the requested displacement vector
   * @returns the current mesh
   */
  moveWithCollisions(e) {
    this.getAbsolutePosition().addToRef(this.ellipsoidOffset, this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);
    const r = this.getScene().collisionCoordinator;
    return this._internalAbstractMeshDataInfo._meshCollisionData._collider || (this._internalAbstractMeshDataInfo._meshCollisionData._collider = r.createCollider()), this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius = this.ellipsoid, r.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions, e, this._internalAbstractMeshDataInfo._meshCollisionData._collider, this.collisionRetryCount, this, this._onCollisionPositionChange, this.uniqueId), this;
  }
  // Collisions
  /**
   * @internal
   */
  _collideForSubMesh(e, t, r) {
    var n;
    if (this._generatePointsArray(), !this._positions)
      return this;
    if (!e._lastColliderWorldVertices || !e._lastColliderTransformMatrix.equals(t)) {
      e._lastColliderTransformMatrix = t.clone(), e._lastColliderWorldVertices = [], e._trianglePlanes = [];
      const i = e.verticesStart, s = e.verticesStart + e.verticesCount;
      for (let a = i; a < s; a++)
        e._lastColliderWorldVertices.push(S.TransformCoordinates(this._positions[a], t));
    }
    return r._collide(e._trianglePlanes, e._lastColliderWorldVertices, this.getIndices(), e.indexStart, e.indexStart + e.indexCount, e.verticesStart, !!e.getMaterial(), this, this._shouldConvertRHS(), ((n = e.getMaterial()) === null || n === void 0 ? void 0 : n.fillMode) === 7), this;
  }
  /**
   * @internal
   */
  _processCollisionsForSubMeshes(e, t) {
    const r = this._scene.getCollidingSubMeshCandidates(this, e), n = r.length;
    for (let i = 0; i < n; i++) {
      const s = r.data[i];
      n > 1 && !s._checkCollision(e) || this._collideForSubMesh(s, t, e);
    }
    return this;
  }
  /** @internal */
  _shouldConvertRHS() {
    return !1;
  }
  /**
   * @internal
   */
  _checkCollision(e) {
    if (!this.getBoundingInfo()._checkCollision(e))
      return this;
    const t = ue.Matrix[0], r = ue.Matrix[1];
    return he.ScalingToRef(1 / e._radius.x, 1 / e._radius.y, 1 / e._radius.z, t), this.worldMatrixFromCache.multiplyToRef(t, r), this._processCollisionsForSubMeshes(e, r), this;
  }
  // Picking
  /** @internal */
  _generatePointsArray() {
    return !1;
  }
  /**
   * Checks if the passed Ray intersects with the mesh. A mesh triangle can be picked both from its front and back sides,
   * irrespective of orientation.
   * @param ray defines the ray to use. It should be in the mesh's LOCAL coordinate space.
   * @param fastCheck defines if fast mode (but less precise) must be used (false by default)
   * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
   * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
   * @param worldToUse defines the world matrix to use to get the world coordinate of the intersection point
   * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
   * @returns the picking info
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect
   */
  intersects(e, t, r, n = !1, i, s = !1) {
    const a = new F9(), f = this.getClassName(), o = f === "InstancedLinesMesh" || f === "LinesMesh" || f === "GreasedLineMesh" ? this.intersectionThreshold : 0, d = this.getBoundingInfo();
    if (!this.subMeshes || !s && (!e.intersectsSphere(d.boundingSphere, o) || !e.intersectsBox(d.boundingBox, o)))
      return a;
    if (n)
      return a.hit = !s, a.pickedMesh = s ? null : this, a.distance = s ? 0 : S.Distance(e.origin, d.boundingSphere.center), a.subMeshId = 0, a;
    if (!this._generatePointsArray())
      return a;
    let v = null;
    const u = this._scene.getIntersectingSubMeshCandidates(this, e), l = u.length;
    let P = !1;
    for (let p = 0; p < l; p++) {
      const H = u.data[p].getMaterial();
      if (H && (H.fillMode == 7 || H.fillMode == 0 || H.fillMode == 1 || H.fillMode == 2 || H.fillMode == 4)) {
        P = !0;
        break;
      }
    }
    if (!P)
      return a.hit = !0, a.pickedMesh = this, a.distance = S.Distance(e.origin, d.boundingSphere.center), a.subMeshId = -1, a;
    for (let p = 0; p < l; p++) {
      const c = u.data[p];
      if (l > 1 && !s && !c.canIntersects(e))
        continue;
      const H = c.intersects(e, this._positions, this.getIndices(), t, r);
      if (H && (t || !v || H.distance < v.distance) && (v = H, v.subMeshId = p, t))
        break;
    }
    if (v) {
      const p = i ?? this.getWorldMatrix(), c = ue.Vector3[0], H = ue.Vector3[1];
      S.TransformCoordinatesToRef(e.origin, p, c), e.direction.scaleToRef(v.distance, H);
      const q = S.TransformNormal(H, p).addInPlace(c);
      return a.hit = !0, a.distance = S.Distance(c, q), a.pickedPoint = q, a.pickedMesh = this, a.bu = v.bu || 0, a.bv = v.bv || 0, a.subMeshFaceId = v.faceId, a.faceId = v.faceId + u.data[v.subMeshId].indexStart / (this.getClassName().indexOf("LinesMesh") !== -1 ? 2 : 3), a.subMeshId = v.subMeshId, a;
    }
    return a;
  }
  /**
   * Clones the current mesh
   * @param name defines the mesh name
   * @param newParent defines the new mesh parent
   * @param doNotCloneChildren defines a boolean indicating that children must not be cloned (false by default)
   * @returns the new mesh
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  clone(e, t, r) {
    return null;
  }
  /**
   * Disposes all the submeshes of the current meshnp
   * @returns the current mesh
   */
  releaseSubMeshes() {
    if (this.subMeshes)
      for (; this.subMeshes.length; )
        this.subMeshes[0].dispose();
    else
      this.subMeshes = [];
    return this;
  }
  /**
   * Releases resources associated with this abstract mesh.
   * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
   * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
   */
  dispose(e, t = !1) {
    let r;
    const n = this.getScene();
    for (this._scene.useMaterialMeshMap && this._internalAbstractMeshDataInfo._material && this._internalAbstractMeshDataInfo._material.meshMap && (this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId] = void 0), n.freeActiveMeshes(), n.freeRenderingGroups(), n.renderingManager.maintainStateBetweenFrames && n.renderingManager.restoreDispachedFlags(), this.actionManager !== void 0 && this.actionManager !== null && (this._scene.meshes.some((a) => a !== this && a.actionManager === this.actionManager) || this.actionManager.dispose(), this.actionManager = null), this._internalAbstractMeshDataInfo._skeleton = null, this._transformMatrixTexture && (this._transformMatrixTexture.dispose(), this._transformMatrixTexture = null), r = 0; r < this._intersectionsInProgress.length; r++) {
      const a = this._intersectionsInProgress[r], f = a._intersectionsInProgress.indexOf(this);
      a._intersectionsInProgress.splice(f, 1);
    }
    this._intersectionsInProgress.length = 0, n.lights.forEach((a) => {
      let f = a.includedOnlyMeshes.indexOf(this);
      f !== -1 && a.includedOnlyMeshes.splice(f, 1), f = a.excludedMeshes.indexOf(this), f !== -1 && a.excludedMeshes.splice(f, 1);
      const o = a.getShadowGenerators();
      if (o) {
        const d = o.values();
        for (let v = d.next(); v.done !== !0; v = d.next()) {
          const l = v.value.getShadowMap();
          l && l.renderList && (f = l.renderList.indexOf(this), f !== -1 && l.renderList.splice(f, 1));
        }
      }
    }), (this.getClassName() !== "InstancedMesh" || this.getClassName() !== "InstancedLinesMesh") && this.releaseSubMeshes();
    const s = n.getEngine();
    if (this._occlusionQuery !== null && (this.isOcclusionQueryInProgress = !1, s.deleteQuery(this._occlusionQuery), this._occlusionQuery = null), s.wipeCaches(), n.removeMesh(this), this._parentContainer) {
      const a = this._parentContainer.meshes.indexOf(this);
      a > -1 && this._parentContainer.meshes.splice(a, 1), this._parentContainer = null;
    }
    if (t && this.material && (this.material.getClassName() === "MultiMaterial" ? this.material.dispose(!1, !0, !0) : this.material.dispose(!1, !0)), !e)
      for (r = 0; r < n.particleSystems.length; r++)
        n.particleSystems[r].emitter === this && (n.particleSystems[r].dispose(), r--);
    this._internalAbstractMeshDataInfo._facetData.facetDataEnabled && this.disableFacetData(), this._uniformBuffer.dispose(), this.onAfterWorldMatrixUpdateObservable.clear(), this.onCollideObservable.clear(), this.onCollisionPositionChangeObservable.clear(), this.onRebuildObservable.clear(), super.dispose(e, t);
  }
  /**
   * Adds the passed mesh as a child to the current mesh
   * @param mesh defines the child mesh
   * @param preserveScalingSign if true, keep scaling sign of child. Otherwise, scaling sign might change.
   * @returns the current mesh
   */
  addChild(e, t = !1) {
    return e.setParent(this, t), this;
  }
  /**
   * Removes the passed mesh from the current mesh children list
   * @param mesh defines the child mesh
   * @param preserveScalingSign if true, keep scaling sign of child. Otherwise, scaling sign might change.
   * @returns the current mesh
   */
  removeChild(e, t = !1) {
    return e.setParent(null, t), this;
  }
  // Facet data
  /** @internal */
  _initFacetData() {
    const e = this._internalAbstractMeshDataInfo._facetData;
    e.facetNormals || (e.facetNormals = []), e.facetPositions || (e.facetPositions = []), e.facetPartitioning || (e.facetPartitioning = new Array()), e.facetNb = this.getIndices().length / 3 | 0, e.partitioningSubdivisions = e.partitioningSubdivisions ? e.partitioningSubdivisions : 10, e.partitioningBBoxRatio = e.partitioningBBoxRatio ? e.partitioningBBoxRatio : 1.01;
    for (let t = 0; t < e.facetNb; t++)
      e.facetNormals[t] = S.Zero(), e.facetPositions[t] = S.Zero();
    return e.facetDataEnabled = !0, this;
  }
  /**
   * Updates the mesh facetData arrays and the internal partitioning when the mesh is morphed or updated.
   * This method can be called within the render loop.
   * You don't need to call this method by yourself in the render loop when you update/morph a mesh with the methods CreateXXX() as they automatically manage this computation
   * @returns the current mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  updateFacetData() {
    const e = this._internalAbstractMeshDataInfo._facetData;
    e.facetDataEnabled || this._initFacetData();
    const t = this.getVerticesData(J.PositionKind), r = this.getIndices(), n = this.getVerticesData(J.NormalKind), i = this.getBoundingInfo();
    if (e.facetDepthSort && !e.facetDepthSortEnabled) {
      if (e.facetDepthSortEnabled = !0, r instanceof Uint16Array)
        e.depthSortedIndices = new Uint16Array(r);
      else if (r instanceof Uint32Array)
        e.depthSortedIndices = new Uint32Array(r);
      else {
        let a = !1;
        for (let f = 0; f < r.length; f++)
          if (r[f] > 65535) {
            a = !0;
            break;
          }
        a ? e.depthSortedIndices = new Uint32Array(r) : e.depthSortedIndices = new Uint16Array(r);
      }
      if (e.facetDepthSortFunction = function(a, f) {
        return f.sqDistance - a.sqDistance;
      }, !e.facetDepthSortFrom) {
        const a = this.getScene().activeCamera;
        e.facetDepthSortFrom = a ? a.position : S.Zero();
      }
      e.depthSortedFacets = [];
      for (let a = 0; a < e.facetNb; a++) {
        const f = { ind: a * 3, sqDistance: 0 };
        e.depthSortedFacets.push(f);
      }
      e.invertedMatrix = he.Identity(), e.facetDepthSortOrigin = S.Zero();
    }
    e.bbSize.x = i.maximum.x - i.minimum.x > Dn ? i.maximum.x - i.minimum.x : Dn, e.bbSize.y = i.maximum.y - i.minimum.y > Dn ? i.maximum.y - i.minimum.y : Dn, e.bbSize.z = i.maximum.z - i.minimum.z > Dn ? i.maximum.z - i.minimum.z : Dn;
    let s = e.bbSize.x > e.bbSize.y ? e.bbSize.x : e.bbSize.y;
    if (s = s > e.bbSize.z ? s : e.bbSize.z, e.subDiv.max = e.partitioningSubdivisions, e.subDiv.X = Math.floor(e.subDiv.max * e.bbSize.x / s), e.subDiv.Y = Math.floor(e.subDiv.max * e.bbSize.y / s), e.subDiv.Z = Math.floor(e.subDiv.max * e.bbSize.z / s), e.subDiv.X = e.subDiv.X < 1 ? 1 : e.subDiv.X, e.subDiv.Y = e.subDiv.Y < 1 ? 1 : e.subDiv.Y, e.subDiv.Z = e.subDiv.Z < 1 ? 1 : e.subDiv.Z, e.facetParameters.facetNormals = this.getFacetLocalNormals(), e.facetParameters.facetPositions = this.getFacetLocalPositions(), e.facetParameters.facetPartitioning = this.getFacetLocalPartitioning(), e.facetParameters.bInfo = i, e.facetParameters.bbSize = e.bbSize, e.facetParameters.subDiv = e.subDiv, e.facetParameters.ratio = this.partitioningBBoxRatio, e.facetParameters.depthSort = e.facetDepthSort, e.facetDepthSort && e.facetDepthSortEnabled && (this.computeWorldMatrix(!0), this._worldMatrix.invertToRef(e.invertedMatrix), S.TransformCoordinatesToRef(e.facetDepthSortFrom, e.invertedMatrix, e.facetDepthSortOrigin), e.facetParameters.distanceTo = e.facetDepthSortOrigin), e.facetParameters.depthSortedFacets = e.depthSortedFacets, n && Ut.ComputeNormals(t, r, n, e.facetParameters), e.facetDepthSort && e.facetDepthSortEnabled) {
      e.depthSortedFacets.sort(e.facetDepthSortFunction);
      const a = e.depthSortedIndices.length / 3 | 0;
      for (let f = 0; f < a; f++) {
        const o = e.depthSortedFacets[f].ind;
        e.depthSortedIndices[f * 3] = r[o], e.depthSortedIndices[f * 3 + 1] = r[o + 1], e.depthSortedIndices[f * 3 + 2] = r[o + 2];
      }
      this.updateIndices(e.depthSortedIndices, void 0, !0);
    }
    return this;
  }
  /**
   * Returns the facetLocalNormals array.
   * The normals are expressed in the mesh local spac
   * @returns an array of Vector3
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getFacetLocalNormals() {
    const e = this._internalAbstractMeshDataInfo._facetData;
    return e.facetNormals || this.updateFacetData(), e.facetNormals;
  }
  /**
   * Returns the facetLocalPositions array.
   * The facet positions are expressed in the mesh local space
   * @returns an array of Vector3
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getFacetLocalPositions() {
    const e = this._internalAbstractMeshDataInfo._facetData;
    return e.facetPositions || this.updateFacetData(), e.facetPositions;
  }
  /**
   * Returns the facetLocalPartitioning array
   * @returns an array of array of numbers
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getFacetLocalPartitioning() {
    const e = this._internalAbstractMeshDataInfo._facetData;
    return e.facetPartitioning || this.updateFacetData(), e.facetPartitioning;
  }
  /**
   * Returns the i-th facet position in the world system.
   * This method allocates a new Vector3 per call
   * @param i defines the facet index
   * @returns a new Vector3
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getFacetPosition(e) {
    const t = S.Zero();
    return this.getFacetPositionToRef(e, t), t;
  }
  /**
   * Sets the reference Vector3 with the i-th facet position in the world system
   * @param i defines the facet index
   * @param ref defines the target vector
   * @returns the current mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getFacetPositionToRef(e, t) {
    const r = this.getFacetLocalPositions()[e], n = this.getWorldMatrix();
    return S.TransformCoordinatesToRef(r, n, t), this;
  }
  /**
   * Returns the i-th facet normal in the world system.
   * This method allocates a new Vector3 per call
   * @param i defines the facet index
   * @returns a new Vector3
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getFacetNormal(e) {
    const t = S.Zero();
    return this.getFacetNormalToRef(e, t), t;
  }
  /**
   * Sets the reference Vector3 with the i-th facet normal in the world system
   * @param i defines the facet index
   * @param ref defines the target vector
   * @returns the current mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getFacetNormalToRef(e, t) {
    const r = this.getFacetLocalNormals()[e];
    return S.TransformNormalToRef(r, this.getWorldMatrix(), t), this;
  }
  /**
   * Returns the facets (in an array) in the same partitioning block than the one the passed coordinates are located (expressed in the mesh local system)
   * @param x defines x coordinate
   * @param y defines y coordinate
   * @param z defines z coordinate
   * @returns the array of facet indexes
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getFacetsAtLocalCoordinates(e, t, r) {
    const n = this.getBoundingInfo(), i = this._internalAbstractMeshDataInfo._facetData, s = Math.floor((e - n.minimum.x * i.partitioningBBoxRatio) * i.subDiv.X * i.partitioningBBoxRatio / i.bbSize.x), a = Math.floor((t - n.minimum.y * i.partitioningBBoxRatio) * i.subDiv.Y * i.partitioningBBoxRatio / i.bbSize.y), f = Math.floor((r - n.minimum.z * i.partitioningBBoxRatio) * i.subDiv.Z * i.partitioningBBoxRatio / i.bbSize.z);
    return s < 0 || s > i.subDiv.max || a < 0 || a > i.subDiv.max || f < 0 || f > i.subDiv.max ? null : i.facetPartitioning[s + i.subDiv.max * a + i.subDiv.max * i.subDiv.max * f];
  }
  /**
   * Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found
   * @param x defines x coordinate
   * @param y defines y coordinate
   * @param z defines z coordinate
   * @param projected sets as the (x,y,z) world projection on the facet
   * @param checkFace if true (default false), only the facet "facing" to (x,y,z) or only the ones "turning their backs", according to the parameter "facing" are returned
   * @param facing if facing and checkFace are true, only the facet "facing" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet "turning their backs" to (x, y, z) are returned : negative dot (x, y, z) * facet position
   * @returns the face index if found (or null instead)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getClosestFacetAtCoordinates(e, t, r, n, i = !1, s = !0) {
    const a = this.getWorldMatrix(), f = ue.Matrix[5];
    a.invertToRef(f);
    const o = ue.Vector3[8];
    S.TransformCoordinatesFromFloatsToRef(e, t, r, f, o);
    const d = this.getClosestFacetAtLocalCoordinates(o.x, o.y, o.z, n, i, s);
    return n && S.TransformCoordinatesFromFloatsToRef(n.x, n.y, n.z, a, n), d;
  }
  /**
   * Returns the closest mesh facet index at (x,y,z) local coordinates, null if not found
   * @param x defines x coordinate
   * @param y defines y coordinate
   * @param z defines z coordinate
   * @param projected sets as the (x,y,z) local projection on the facet
   * @param checkFace if true (default false), only the facet "facing" to (x,y,z) or only the ones "turning their backs", according to the parameter "facing" are returned
   * @param facing if facing and checkFace are true, only the facet "facing" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet "turning their backs" to (x, y, z) are returned : negative dot (x, y, z) * facet position
   * @returns the face index if found (or null instead)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getClosestFacetAtLocalCoordinates(e, t, r, n, i = !1, s = !0) {
    let a = null, f = 0, o = 0, d = 0, v = 0, u = 0, l = 0, P = 0, p = 0;
    const c = this.getFacetLocalPositions(), H = this.getFacetLocalNormals(), T = this.getFacetsAtLocalCoordinates(e, t, r);
    if (!T)
      return null;
    let q = Number.MAX_VALUE, b = q, j, w, m;
    for (let I = 0; I < T.length; I++)
      j = T[I], w = H[j], m = c[j], v = (e - m.x) * w.x + (t - m.y) * w.y + (r - m.z) * w.z, (!i || i && s && v >= 0 || i && !s && v <= 0) && (v = w.x * m.x + w.y * m.y + w.z * m.z, u = -(w.x * e + w.y * t + w.z * r - v) / (w.x * w.x + w.y * w.y + w.z * w.z), l = e + w.x * u, P = t + w.y * u, p = r + w.z * u, f = l - e, o = P - t, d = p - r, b = f * f + o * o + d * d, b < q && (q = b, a = j, n && (n.x = l, n.y = P, n.z = p)));
    return a;
  }
  /**
   * Returns the object "parameter" set with all the expected parameters for facetData computation by ComputeNormals()
   * @returns the parameters
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  getFacetDataParameters() {
    return this._internalAbstractMeshDataInfo._facetData.facetParameters;
  }
  /**
   * Disables the feature FacetData and frees the related memory
   * @returns the current mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
   */
  disableFacetData() {
    const e = this._internalAbstractMeshDataInfo._facetData;
    return e.facetDataEnabled && (e.facetDataEnabled = !1, e.facetPositions = [], e.facetNormals = [], e.facetPartitioning = new Array(), e.facetParameters = null, e.depthSortedIndices = new Uint32Array(0)), this;
  }
  /**
   * Updates the AbstractMesh indices array
   * @param indices defines the data source
   * @param offset defines the offset in the index buffer where to store the new data (can be null)
   * @param gpuMemoryOnly defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
   * @returns the current mesh
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  updateIndices(e, t, r = !1) {
    return this;
  }
  /**
   * Creates new normals data for the mesh
   * @param updatable defines if the normal vertex buffer must be flagged as updatable
   * @returns the current mesh
   */
  createNormals(e) {
    const t = this.getVerticesData(J.PositionKind), r = this.getIndices();
    let n;
    return this.isVerticesDataPresent(J.NormalKind) ? n = this.getVerticesData(J.NormalKind) : n = [], Ut.ComputeNormals(t, r, n, { useRightHandedSystem: this.getScene().useRightHandedSystem }), this.setVerticesData(J.NormalKind, n, e), this;
  }
  /**
   * Align the mesh with a normal
   * @param normal defines the normal to use
   * @param upDirection can be used to redefined the up vector to use (will use the (0, 1, 0) by default)
   * @returns the current mesh
   */
  alignWithNormal(e, t) {
    t || (t = bf.Y);
    const r = ue.Vector3[0], n = ue.Vector3[1];
    return S.CrossToRef(t, e, n), S.CrossToRef(e, n, r), this.rotationQuaternion ? Ze.RotationQuaternionFromAxisToRef(r, e, n, this.rotationQuaternion) : S.RotationFromAxisToRef(r, e, n, this.rotation), this;
  }
  /** @internal */
  _checkOcclusionQuery() {
    return !1;
  }
  /**
   * Disables the mesh edge rendering mode
   * @returns the currentAbstractMesh
   */
  disableEdgesRendering() {
    throw qn("EdgesRenderer");
  }
  /**
   * Enables the edge rendering mode on the mesh.
   * This mode makes the mesh edges visible
   * @param epsilon defines the maximal distance between two angles to detect a face
   * @param checkVerticesInsteadOfIndices indicates that we should check vertex list directly instead of faces
   * @param options options to the edge renderer
   * @returns the currentAbstractMesh
   * @see https://www.babylonjs-playground.com/#19O9TU#0
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  enableEdgesRendering(e, t, r) {
    throw qn("EdgesRenderer");
  }
  /**
   * This function returns all of the particle systems in the scene that use the mesh as an emitter.
   * @returns an array of particle systems in the scene that use the mesh as an emitter
   */
  getConnectedParticleSystems() {
    return this._scene.particleSystems.filter((e) => e.emitter === this);
  }
}
jn.OCCLUSION_TYPE_NONE = 0;
jn.OCCLUSION_TYPE_OPTIMISTIC = 1;
jn.OCCLUSION_TYPE_STRICT = 2;
jn.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0;
jn.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1;
jn.CULLINGSTRATEGY_STANDARD = 0;
jn.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1;
jn.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2;
jn.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3;
Ue("BABYLON.AbstractMesh", jn);
function Mf(A) {
  A.indexOf("vClipPlane") === -1 && A.push("vClipPlane"), A.indexOf("vClipPlane2") === -1 && A.push("vClipPlane2"), A.indexOf("vClipPlane3") === -1 && A.push("vClipPlane3"), A.indexOf("vClipPlane4") === -1 && A.push("vClipPlane4"), A.indexOf("vClipPlane5") === -1 && A.push("vClipPlane5"), A.indexOf("vClipPlane6") === -1 && A.push("vClipPlane6");
}
function xq(A, e, t) {
  var r, n, i, s, a, f;
  const o = !!((r = A.clipPlane) !== null && r !== void 0 ? r : e.clipPlane), d = !!((n = A.clipPlane2) !== null && n !== void 0 ? n : e.clipPlane2), v = !!((i = A.clipPlane3) !== null && i !== void 0 ? i : e.clipPlane3), u = !!((s = A.clipPlane4) !== null && s !== void 0 ? s : e.clipPlane4), l = !!((a = A.clipPlane5) !== null && a !== void 0 ? a : e.clipPlane5), P = !!((f = A.clipPlane6) !== null && f !== void 0 ? f : e.clipPlane6);
  o && t.push("#define CLIPPLANE"), d && t.push("#define CLIPPLANE2"), v && t.push("#define CLIPPLANE3"), u && t.push("#define CLIPPLANE4"), l && t.push("#define CLIPPLANE5"), P && t.push("#define CLIPPLANE6");
}
function oee(A, e, t) {
  var r, n, i, s, a, f;
  let o = !1;
  const d = !!((r = A.clipPlane) !== null && r !== void 0 ? r : e.clipPlane), v = !!((n = A.clipPlane2) !== null && n !== void 0 ? n : e.clipPlane2), u = !!((i = A.clipPlane3) !== null && i !== void 0 ? i : e.clipPlane3), l = !!((s = A.clipPlane4) !== null && s !== void 0 ? s : e.clipPlane4), P = !!((a = A.clipPlane5) !== null && a !== void 0 ? a : e.clipPlane5), p = !!((f = A.clipPlane6) !== null && f !== void 0 ? f : e.clipPlane6);
  return t.CLIPPLANE !== d && (t.CLIPPLANE = d, o = !0), t.CLIPPLANE2 !== v && (t.CLIPPLANE2 = v, o = !0), t.CLIPPLANE3 !== u && (t.CLIPPLANE3 = u, o = !0), t.CLIPPLANE4 !== l && (t.CLIPPLANE4 = l, o = !0), t.CLIPPLANE5 !== P && (t.CLIPPLANE5 = P, o = !0), t.CLIPPLANE6 !== p && (t.CLIPPLANE6 = p, o = !0), o;
}
function Df(A, e, t) {
  var r, n, i, s, a, f;
  let o = (r = e.clipPlane) !== null && r !== void 0 ? r : t.clipPlane;
  wW(A, "vClipPlane", o), o = (n = e.clipPlane2) !== null && n !== void 0 ? n : t.clipPlane2, wW(A, "vClipPlane2", o), o = (i = e.clipPlane3) !== null && i !== void 0 ? i : t.clipPlane3, wW(A, "vClipPlane3", o), o = (s = e.clipPlane4) !== null && s !== void 0 ? s : t.clipPlane4, wW(A, "vClipPlane4", o), o = (a = e.clipPlane5) !== null && a !== void 0 ? a : t.clipPlane5, wW(A, "vClipPlane5", o), o = (f = e.clipPlane6) !== null && f !== void 0 ? f : t.clipPlane6, wW(A, "vClipPlane6", o);
}
function wW(A, e, t) {
  t && A.setFloat4(e, t.normal.x, t.normal.y, t.normal.z, t.d);
}
class Ye {
  /**
   * Binds the scene's uniform buffer to the effect.
   * @param effect defines the effect to bind to the scene uniform buffer
   * @param sceneUbo defines the uniform buffer storing scene data
   */
  static BindSceneUniformBuffer(e, t) {
    t.bindToEffect(e, "Scene");
  }
  /**
   * Helps preparing the defines values about the UVs in used in the effect.
   * UVs are shared as much as we can across channels in the shaders.
   * @param texture The texture we are preparing the UVs for
   * @param defines The defines to update
   * @param key The channel key "diffuse", "specular"... used in the shader
   */
  static PrepareDefinesForMergedUV(e, t, r) {
    t._needUVs = !0, t[r] = !0, e.optimizeUVAllocation && e.getTextureMatrix().isIdentityAs3x2() ? (t[r + "DIRECTUV"] = e.coordinatesIndex + 1, t["MAINUV" + (e.coordinatesIndex + 1)] = !0) : t[r + "DIRECTUV"] = 0;
  }
  /**
   * Binds a texture matrix value to its corresponding uniform
   * @param texture The texture to bind the matrix for
   * @param uniformBuffer The uniform buffer receiving the data
   * @param key The channel key "diffuse", "specular"... used in the shader
   */
  static BindTextureMatrix(e, t, r) {
    const n = e.getTextureMatrix();
    t.updateMatrix(r + "Matrix", n);
  }
  /**
   * Gets the current status of the fog (should it be enabled?)
   * @param mesh defines the mesh to evaluate for fog support
   * @param scene defines the hosting scene
   * @returns true if fog must be enabled
   */
  static GetFogState(e, t) {
    return t.fogEnabled && e.applyFog && t.fogMode !== sr.FOGMODE_NONE;
  }
  /**
   * Helper used to prepare the list of defines associated with misc. values for shader compilation
   * @param mesh defines the current mesh
   * @param scene defines the current scene
   * @param useLogarithmicDepth defines if logarithmic depth has to be turned on
   * @param pointsCloud defines if point cloud rendering has to be turned on
   * @param fogEnabled defines if fog has to be turned on
   * @param alphaTest defines if alpha testing has to be turned on
   * @param defines defines the current list of defines
   * @param applyDecalAfterDetail Defines if the decal is applied after or before the detail
   */
  static PrepareDefinesForMisc(e, t, r, n, i, s, a, f = !1) {
    a._areMiscDirty && (a.LOGARITHMICDEPTH = r, a.POINTSIZE = n, a.FOG = i && this.GetFogState(e, t), a.NONUNIFORMSCALING = e.nonUniformScaling, a.ALPHATEST = s, a.DECAL_AFTER_DETAIL = f);
  }
  /**
   * Helper used to prepare the defines relative to the active camera
   * @param scene defines the current scene
   * @param defines specifies the list of active defines
   * @returns true if the defines have been updated, else false
   */
  static PrepareDefinesForCamera(e, t) {
    let r = !1;
    if (e.activeCamera) {
      const n = t.CAMERA_ORTHOGRAPHIC ? 1 : 0, i = t.CAMERA_PERSPECTIVE ? 1 : 0, s = e.activeCamera.mode === Tr.ORTHOGRAPHIC_CAMERA ? 1 : 0, a = e.activeCamera.mode === Tr.PERSPECTIVE_CAMERA ? 1 : 0;
      (n ^ s || i ^ a) && (t.CAMERA_ORTHOGRAPHIC = s === 1, t.CAMERA_PERSPECTIVE = a === 1, r = !0);
    }
    return r;
  }
  /**
   * Helper used to prepare the list of defines associated with frame values for shader compilation
   * @param scene defines the current scene
   * @param engine defines the current engine
   * @param material defines the material we are compiling the shader for
   * @param defines specifies the list of active defines
   * @param useInstances defines if instances have to be turned on
   * @param useClipPlane defines if clip plane have to be turned on
   * @param useThinInstances defines if thin instances have to be turned on
   */
  static PrepareDefinesForFrameBoundValues(e, t, r, n, i, s = null, a = !1) {
    let f = Ye.PrepareDefinesForCamera(e, n);
    s !== !1 && (f = oee(r, e, n)), n.DEPTHPREPASS !== !t.getColorWrite() && (n.DEPTHPREPASS = !n.DEPTHPREPASS, f = !0), n.INSTANCES !== i && (n.INSTANCES = i, f = !0), n.THIN_INSTANCES !== a && (n.THIN_INSTANCES = a, f = !0), f && n.markAsUnprocessed();
  }
  /**
   * Prepares the defines for bones
   * @param mesh The mesh containing the geometry data we will draw
   * @param defines The defines to update
   */
  static PrepareDefinesForBones(e, t) {
    if (e.useBones && e.computeBonesUsingShaders && e.skeleton) {
      t.NUM_BONE_INFLUENCERS = e.numBoneInfluencers;
      const r = t.BONETEXTURE !== void 0;
      if (e.skeleton.isUsingTextureForMatrices && r)
        t.BONETEXTURE = !0;
      else {
        t.BonesPerMesh = e.skeleton.bones.length + 1, t.BONETEXTURE = r ? !1 : void 0;
        const n = e.getScene().prePassRenderer;
        if (n && n.enabled) {
          const i = n.excludedSkinnedMesh.indexOf(e) === -1;
          t.BONES_VELOCITY_ENABLED = i;
        }
      }
    } else
      t.NUM_BONE_INFLUENCERS = 0, t.BonesPerMesh = 0, t.BONETEXTURE !== void 0 && (t.BONETEXTURE = !1);
  }
  /**
   * Prepares the defines for morph targets
   * @param mesh The mesh containing the geometry data we will draw
   * @param defines The defines to update
   */
  static PrepareDefinesForMorphTargets(e, t) {
    const r = e.morphTargetManager;
    r ? (t.MORPHTARGETS_UV = r.supportsUVs && t.UV1, t.MORPHTARGETS_TANGENT = r.supportsTangents && t.TANGENT, t.MORPHTARGETS_NORMAL = r.supportsNormals && t.NORMAL, t.MORPHTARGETS = r.numInfluencers > 0, t.NUM_MORPH_INFLUENCERS = r.numInfluencers, t.MORPHTARGETS_TEXTURE = r.isUsingTextureForTargets) : (t.MORPHTARGETS_UV = !1, t.MORPHTARGETS_TANGENT = !1, t.MORPHTARGETS_NORMAL = !1, t.MORPHTARGETS = !1, t.NUM_MORPH_INFLUENCERS = 0);
  }
  /**
   * Prepares the defines for baked vertex animation
   * @param mesh The mesh containing the geometry data we will draw
   * @param defines The defines to update
   */
  static PrepareDefinesForBakedVertexAnimation(e, t) {
    const r = e.bakedVertexAnimationManager;
    t.BAKED_VERTEX_ANIMATION_TEXTURE = !!(r && r.isEnabled);
  }
  /**
   * Prepares the defines used in the shader depending on the attributes data available in the mesh
   * @param mesh The mesh containing the geometry data we will draw
   * @param defines The defines to update
   * @param useVertexColor Precise whether vertex colors should be used or not (override mesh info)
   * @param useBones Precise whether bones should be used or not (override mesh info)
   * @param useMorphTargets Precise whether morph targets should be used or not (override mesh info)
   * @param useVertexAlpha Precise whether vertex alpha should be used or not (override mesh info)
   * @param useBakedVertexAnimation Precise whether baked vertex animation should be used or not (override mesh info)
   * @returns false if defines are considered not dirty and have not been checked
   */
  static PrepareDefinesForAttributes(e, t, r, n, i = !1, s = !0, a = !0) {
    if (!t._areAttributesDirty && t._needNormals === t._normals && t._needUVs === t._uvs)
      return !1;
    t._normals = t._needNormals, t._uvs = t._needUVs, t.NORMAL = t._needNormals && e.isVerticesDataPresent(J.NormalKind), t._needNormals && e.isVerticesDataPresent(J.TangentKind) && (t.TANGENT = !0);
    for (let f = 1; f <= 6; ++f)
      t["UV" + f] = t._needUVs ? e.isVerticesDataPresent(`uv${f === 1 ? "" : f}`) : !1;
    if (r) {
      const f = e.useVertexColors && e.isVerticesDataPresent(J.ColorKind);
      t.VERTEXCOLOR = f, t.VERTEXALPHA = e.hasVertexAlpha && f && s;
    }
    return e.isVerticesDataPresent(J.ColorInstanceKind) && (e.hasInstances || e.hasThinInstances) && (t.INSTANCESCOLOR = !0), n && this.PrepareDefinesForBones(e, t), i && this.PrepareDefinesForMorphTargets(e, t), a && this.PrepareDefinesForBakedVertexAnimation(e, t), !0;
  }
  /**
   * Prepares the defines related to multiview
   * @param scene The scene we are intending to draw
   * @param defines The defines to update
   */
  static PrepareDefinesForMultiview(e, t) {
    if (e.activeCamera) {
      const r = t.MULTIVIEW;
      t.MULTIVIEW = e.activeCamera.outputRenderTarget !== null && e.activeCamera.outputRenderTarget.getViewCount() > 1, t.MULTIVIEW != r && t.markAsUnprocessed();
    }
  }
  /**
   * Prepares the defines related to order independant transparency
   * @param scene The scene we are intending to draw
   * @param defines The defines to update
   * @param needAlphaBlending Determines if the material needs alpha blending
   */
  static PrepareDefinesForOIT(e, t, r) {
    const n = t.ORDER_INDEPENDENT_TRANSPARENCY, i = t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS;
    t.ORDER_INDEPENDENT_TRANSPARENCY = e.useOrderIndependentTransparency && r, t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = !e.getEngine().getCaps().textureFloatLinearFiltering, (n !== t.ORDER_INDEPENDENT_TRANSPARENCY || i !== t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS) && t.markAsUnprocessed();
  }
  /**
   * Prepares the defines related to the prepass
   * @param scene The scene we are intending to draw
   * @param defines The defines to update
   * @param canRenderToMRT Indicates if this material renders to several textures in the prepass
   */
  static PrepareDefinesForPrePass(e, t, r) {
    const n = t.PREPASS;
    if (!t._arePrePassDirty)
      return;
    const i = [
      {
        type: 1,
        define: "PREPASS_POSITION",
        index: "PREPASS_POSITION_INDEX"
      },
      {
        type: 2,
        define: "PREPASS_VELOCITY",
        index: "PREPASS_VELOCITY_INDEX"
      },
      {
        type: 3,
        define: "PREPASS_REFLECTIVITY",
        index: "PREPASS_REFLECTIVITY_INDEX"
      },
      {
        type: 0,
        define: "PREPASS_IRRADIANCE",
        index: "PREPASS_IRRADIANCE_INDEX"
      },
      {
        type: 7,
        define: "PREPASS_ALBEDO_SQRT",
        index: "PREPASS_ALBEDO_SQRT_INDEX"
      },
      {
        type: 5,
        define: "PREPASS_DEPTH",
        index: "PREPASS_DEPTH_INDEX"
      },
      {
        type: 6,
        define: "PREPASS_NORMAL",
        index: "PREPASS_NORMAL_INDEX"
      }
    ];
    if (e.prePassRenderer && e.prePassRenderer.enabled && r) {
      t.PREPASS = !0, t.SCENE_MRT_COUNT = e.prePassRenderer.mrtCount, t.PREPASS_NORMAL_WORLDSPACE = e.prePassRenderer.generateNormalsInWorldSpace;
      for (let s = 0; s < i.length; s++) {
        const a = e.prePassRenderer.getIndex(i[s].type);
        a !== -1 ? (t[i[s].define] = !0, t[i[s].index] = a) : t[i[s].define] = !1;
      }
    } else {
      t.PREPASS = !1;
      for (let s = 0; s < i.length; s++)
        t[i[s].define] = !1;
    }
    t.PREPASS != n && (t.markAsUnprocessed(), t.markAsImageProcessingDirty());
  }
  /**
   * Prepares the defines related to the light information passed in parameter
   * @param scene The scene we are intending to draw
   * @param mesh The mesh the effect is compiling for
   * @param light The light the effect is compiling for
   * @param lightIndex The index of the light
   * @param defines The defines to update
   * @param specularSupported Specifies whether specular is supported or not (override lights data)
   * @param state Defines the current state regarding what is needed (normals, etc...)
   * @param state.needNormals
   * @param state.needRebuild
   * @param state.shadowEnabled
   * @param state.specularEnabled
   * @param state.lightmapMode
   */
  static PrepareDefinesForLight(e, t, r, n, i, s, a) {
    var f;
    switch (a.needNormals = !0, i["LIGHT" + n] === void 0 && (a.needRebuild = !0), i["LIGHT" + n] = !0, i["SPOTLIGHT" + n] = !1, i["HEMILIGHT" + n] = !1, i["POINTLIGHT" + n] = !1, i["DIRLIGHT" + n] = !1, r.prepareLightSpecificDefines(i, n), i["LIGHT_FALLOFF_PHYSICAL" + n] = !1, i["LIGHT_FALLOFF_GLTF" + n] = !1, i["LIGHT_FALLOFF_STANDARD" + n] = !1, r.falloffType) {
      case ra.FALLOFF_GLTF:
        i["LIGHT_FALLOFF_GLTF" + n] = !0;
        break;
      case ra.FALLOFF_PHYSICAL:
        i["LIGHT_FALLOFF_PHYSICAL" + n] = !0;
        break;
      case ra.FALLOFF_STANDARD:
        i["LIGHT_FALLOFF_STANDARD" + n] = !0;
        break;
    }
    if (s && !r.specular.equalsFloats(0, 0, 0) && (a.specularEnabled = !0), i["SHADOW" + n] = !1, i["SHADOWCSM" + n] = !1, i["SHADOWCSMDEBUG" + n] = !1, i["SHADOWCSMNUM_CASCADES" + n] = !1, i["SHADOWCSMUSESHADOWMAXZ" + n] = !1, i["SHADOWCSMNOBLEND" + n] = !1, i["SHADOWCSM_RIGHTHANDED" + n] = !1, i["SHADOWPCF" + n] = !1, i["SHADOWPCSS" + n] = !1, i["SHADOWPOISSON" + n] = !1, i["SHADOWESM" + n] = !1, i["SHADOWCLOSEESM" + n] = !1, i["SHADOWCUBE" + n] = !1, i["SHADOWLOWQUALITY" + n] = !1, i["SHADOWMEDIUMQUALITY" + n] = !1, t && t.receiveShadows && e.shadowsEnabled && r.shadowEnabled) {
      const o = (f = r.getShadowGenerator(e.activeCamera)) !== null && f !== void 0 ? f : r.getShadowGenerator();
      if (o) {
        const d = o.getShadowMap();
        d && d.renderList && d.renderList.length > 0 && (a.shadowEnabled = !0, o.prepareDefines(i, n));
      }
    }
    r.lightmapMode != ra.LIGHTMAP_DEFAULT ? (a.lightmapMode = !0, i["LIGHTMAPEXCLUDED" + n] = !0, i["LIGHTMAPNOSPECULAR" + n] = r.lightmapMode == ra.LIGHTMAP_SHADOWSONLY) : (i["LIGHTMAPEXCLUDED" + n] = !1, i["LIGHTMAPNOSPECULAR" + n] = !1);
  }
  /**
   * Prepares the defines related to the light information passed in parameter
   * @param scene The scene we are intending to draw
   * @param mesh The mesh the effect is compiling for
   * @param defines The defines to update
   * @param specularSupported Specifies whether specular is supported or not (override lights data)
   * @param maxSimultaneousLights Specifies how manuy lights can be added to the effect at max
   * @param disableLighting Specifies whether the lighting is disabled (override scene and light)
   * @returns true if normals will be required for the rest of the effect
   */
  static PrepareDefinesForLights(e, t, r, n, i = 4, s = !1) {
    if (!r._areLightsDirty)
      return r._needNormals;
    let a = 0;
    const f = {
      needNormals: r._needNormals,
      needRebuild: !1,
      lightmapMode: !1,
      shadowEnabled: !1,
      specularEnabled: !1
    };
    if (e.lightsEnabled && !s) {
      for (const d of t.lightSources)
        if (this.PrepareDefinesForLight(e, t, d, a, r, n, f), a++, a === i)
          break;
    }
    r.SPECULARTERM = f.specularEnabled, r.SHADOWS = f.shadowEnabled;
    for (let d = a; d < i; d++)
      r["LIGHT" + d] !== void 0 && (r["LIGHT" + d] = !1, r["HEMILIGHT" + d] = !1, r["POINTLIGHT" + d] = !1, r["DIRLIGHT" + d] = !1, r["SPOTLIGHT" + d] = !1, r["SHADOW" + d] = !1, r["SHADOWCSM" + d] = !1, r["SHADOWCSMDEBUG" + d] = !1, r["SHADOWCSMNUM_CASCADES" + d] = !1, r["SHADOWCSMUSESHADOWMAXZ" + d] = !1, r["SHADOWCSMNOBLEND" + d] = !1, r["SHADOWCSM_RIGHTHANDED" + d] = !1, r["SHADOWPCF" + d] = !1, r["SHADOWPCSS" + d] = !1, r["SHADOWPOISSON" + d] = !1, r["SHADOWESM" + d] = !1, r["SHADOWCLOSEESM" + d] = !1, r["SHADOWCUBE" + d] = !1, r["SHADOWLOWQUALITY" + d] = !1, r["SHADOWMEDIUMQUALITY" + d] = !1);
    const o = e.getEngine().getCaps();
    return r.SHADOWFLOAT === void 0 && (f.needRebuild = !0), r.SHADOWFLOAT = f.shadowEnabled && (o.textureFloatRender && o.textureFloatLinearFiltering || o.textureHalfFloatRender && o.textureHalfFloatLinearFiltering), r.LIGHTMAPEXCLUDED = f.lightmapMode, f.needRebuild && r.rebuild(), f.needNormals;
  }
  /**
   * Prepares the uniforms and samplers list to be used in the effect (for a specific light)
   * @param lightIndex defines the light index
   * @param uniformsList The uniform list
   * @param samplersList The sampler list
   * @param projectedLightTexture defines if projected texture must be used
   * @param uniformBuffersList defines an optional list of uniform buffers
   * @param updateOnlyBuffersList True to only update the uniformBuffersList array
   */
  static PrepareUniformsAndSamplersForLight(e, t, r, n, i = null, s = !1) {
    i && i.push("Light" + e), !s && (t.push("vLightData" + e, "vLightDiffuse" + e, "vLightSpecular" + e, "vLightDirection" + e, "vLightFalloff" + e, "vLightGround" + e, "lightMatrix" + e, "shadowsInfo" + e, "depthValues" + e), r.push("shadowSampler" + e), r.push("depthSampler" + e), t.push("viewFrustumZ" + e, "cascadeBlendFactor" + e, "lightSizeUVCorrection" + e, "depthCorrection" + e, "penumbraDarkness" + e, "frustumLengths" + e), n && (r.push("projectionLightSampler" + e), t.push("textureProjectionMatrix" + e)));
  }
  /**
   * Prepares the uniforms and samplers list to be used in the effect
   * @param uniformsListOrOptions The uniform names to prepare or an EffectCreationOptions containing the list and extra information
   * @param samplersList The sampler list
   * @param defines The defines helping in the list generation
   * @param maxSimultaneousLights The maximum number of simultaneous light allowed in the effect
   */
  static PrepareUniformsAndSamplersList(e, t, r, n = 4) {
    let i, s = null;
    if (e.uniformsNames) {
      const a = e;
      i = a.uniformsNames, s = a.uniformBuffersNames, t = a.samplers, r = a.defines, n = a.maxSimultaneousLights || 0;
    } else
      i = e, t || (t = []);
    for (let a = 0; a < n && r["LIGHT" + a]; a++)
      this.PrepareUniformsAndSamplersForLight(a, i, t, r["PROJECTEDLIGHTTEXTURE" + a], s);
    r.NUM_MORPH_INFLUENCERS && i.push("morphTargetInfluences"), r.BAKED_VERTEX_ANIMATION_TEXTURE && (i.push("bakedVertexAnimationSettings"), i.push("bakedVertexAnimationTextureSizeInverted"), i.push("bakedVertexAnimationTime"), t.push("bakedVertexAnimationTexture"));
  }
  /**
   * This helps decreasing rank by rank the shadow quality (0 being the highest rank and quality)
   * @param defines The defines to update while falling back
   * @param fallbacks The authorized effect fallbacks
   * @param maxSimultaneousLights The maximum number of lights allowed
   * @param rank the current rank of the Effect
   * @returns The newly affected rank
   */
  static HandleFallbacksForShadows(e, t, r = 4, n = 0) {
    let i = 0;
    for (let s = 0; s < r && e["LIGHT" + s]; s++)
      s > 0 && (i = n + s, t.addFallback(i, "LIGHT" + s)), e.SHADOWS || (e["SHADOW" + s] && t.addFallback(n, "SHADOW" + s), e["SHADOWPCF" + s] && t.addFallback(n, "SHADOWPCF" + s), e["SHADOWPCSS" + s] && t.addFallback(n, "SHADOWPCSS" + s), e["SHADOWPOISSON" + s] && t.addFallback(n, "SHADOWPOISSON" + s), e["SHADOWESM" + s] && t.addFallback(n, "SHADOWESM" + s), e["SHADOWCLOSEESM" + s] && t.addFallback(n, "SHADOWCLOSEESM" + s));
    return i++;
  }
  /**
   * Prepares the list of attributes required for morph targets according to the effect defines.
   * @param attribs The current list of supported attribs
   * @param mesh The mesh to prepare the morph targets attributes for
   * @param influencers The number of influencers
   */
  static PrepareAttributesForMorphTargetsInfluencers(e, t, r) {
    this._TmpMorphInfluencers.NUM_MORPH_INFLUENCERS = r, this.PrepareAttributesForMorphTargets(e, t, this._TmpMorphInfluencers);
  }
  /**
   * Prepares the list of attributes required for morph targets according to the effect defines.
   * @param attribs The current list of supported attribs
   * @param mesh The mesh to prepare the morph targets attributes for
   * @param defines The current Defines of the effect
   */
  static PrepareAttributesForMorphTargets(e, t, r) {
    const n = r.NUM_MORPH_INFLUENCERS;
    if (n > 0 && gr.LastCreatedEngine) {
      const i = gr.LastCreatedEngine.getCaps().maxVertexAttribs, s = t.morphTargetManager;
      if (s != null && s.isUsingTextureForTargets)
        return;
      const a = s && s.supportsNormals && r.NORMAL, f = s && s.supportsTangents && r.TANGENT, o = s && s.supportsUVs && r.UV1;
      for (let d = 0; d < n; d++)
        e.push(J.PositionKind + d), a && e.push(J.NormalKind + d), f && e.push(J.TangentKind + d), o && e.push(J.UVKind + "_" + d), e.length > i && Se.Error("Cannot add more vertex attributes for mesh " + t.name);
    }
  }
  /**
   * Prepares the list of attributes required for baked vertex animations according to the effect defines.
   * @param attribs The current list of supported attribs
   * @param mesh The mesh to prepare the morph targets attributes for
   * @param defines The current Defines of the effect
   */
  static PrepareAttributesForBakedVertexAnimation(e, t, r) {
    r.BAKED_VERTEX_ANIMATION_TEXTURE && r.INSTANCES && e.push("bakedVertexAnimationSettingsInstanced");
  }
  /**
   * Prepares the list of attributes required for bones according to the effect defines.
   * @param attribs The current list of supported attribs
   * @param mesh The mesh to prepare the bones attributes for
   * @param defines The current Defines of the effect
   * @param fallbacks The current effect fallback strategy
   */
  static PrepareAttributesForBones(e, t, r, n) {
    r.NUM_BONE_INFLUENCERS > 0 && (n.addCPUSkinningFallback(0, t), e.push(J.MatricesIndicesKind), e.push(J.MatricesWeightsKind), r.NUM_BONE_INFLUENCERS > 4 && (e.push(J.MatricesIndicesExtraKind), e.push(J.MatricesWeightsExtraKind)));
  }
  /**
   * Check and prepare the list of attributes required for instances according to the effect defines.
   * @param attribs The current list of supported attribs
   * @param defines The current MaterialDefines of the effect
   */
  static PrepareAttributesForInstances(e, t) {
    (t.INSTANCES || t.THIN_INSTANCES) && this.PushAttributesForInstances(e, !!t.PREPASS_VELOCITY), t.INSTANCESCOLOR && e.push(J.ColorInstanceKind);
  }
  /**
   * Add the list of attributes required for instances to the attribs array.
   * @param attribs The current list of supported attribs
   * @param needsPreviousMatrices If the shader needs previous matrices
   */
  static PushAttributesForInstances(e, t = !1) {
    e.push("world0"), e.push("world1"), e.push("world2"), e.push("world3"), t && (e.push("previousWorld0"), e.push("previousWorld1"), e.push("previousWorld2"), e.push("previousWorld3"));
  }
  /**
   * Binds the light information to the effect.
   * @param light The light containing the generator
   * @param effect The effect we are binding the data to
   * @param lightIndex The light index in the effect used to render
   */
  static BindLightProperties(e, t, r) {
    e.transferToEffect(t, r + "");
  }
  /**
   * Binds the lights information from the scene to the effect for the given mesh.
   * @param light Light to bind
   * @param lightIndex Light index
   * @param scene The scene where the light belongs to
   * @param effect The effect we are binding the data to
   * @param useSpecular Defines if specular is supported
   * @param receiveShadows Defines if the effect (mesh) we bind the light for receives shadows
   */
  static BindLight(e, t, r, n, i, s = !0) {
    e._bindLight(t, r, n, i, s);
  }
  /**
   * Binds the lights information from the scene to the effect for the given mesh.
   * @param scene The scene the lights belongs to
   * @param mesh The mesh we are binding the information to render
   * @param effect The effect we are binding the data to
   * @param defines The generated defines for the effect
   * @param maxSimultaneousLights The maximum number of light that can be bound to the effect
   */
  static BindLights(e, t, r, n, i = 4) {
    const s = Math.min(t.lightSources.length, i);
    for (let a = 0; a < s; a++) {
      const f = t.lightSources[a];
      this.BindLight(f, a, e, r, typeof n == "boolean" ? n : n.SPECULARTERM, t.receiveShadows);
    }
  }
  /**
   * Binds the fog information from the scene to the effect for the given mesh.
   * @param scene The scene the lights belongs to
   * @param mesh The mesh we are binding the information to render
   * @param effect The effect we are binding the data to
   * @param linearSpace Defines if the fog effect is applied in linear space
   */
  static BindFogParameters(e, t, r, n = !1) {
    e.fogEnabled && t.applyFog && e.fogMode !== sr.FOGMODE_NONE && (r.setFloat4("vFogInfos", e.fogMode, e.fogStart, e.fogEnd, e.fogDensity), n ? (e.fogColor.toLinearSpaceToRef(this._TempFogColor, e.getEngine().useExactSrgbConversions), r.setColor3("vFogColor", this._TempFogColor)) : r.setColor3("vFogColor", e.fogColor));
  }
  /**
   * Binds the bones information from the mesh to the effect.
   * @param mesh The mesh we are binding the information to render
   * @param effect The effect we are binding the data to
   * @param prePassConfiguration Configuration for the prepass, in case prepass is activated
   */
  static BindBonesParameters(e, t, r) {
    if (!(!t || !e) && (e.computeBonesUsingShaders && t._bonesComputationForcedToCPU && (e.computeBonesUsingShaders = !1), e.useBones && e.computeBonesUsingShaders && e.skeleton)) {
      const n = e.skeleton;
      if (n.isUsingTextureForMatrices && t.getUniformIndex("boneTextureWidth") > -1) {
        const i = n.getTransformMatrixTexture(e);
        t.setTexture("boneSampler", i), t.setFloat("boneTextureWidth", 4 * (n.bones.length + 1));
      } else {
        const i = n.getTransformMatrices(e);
        i && (t.setMatrices("mBones", i), r && e.getScene().prePassRenderer && e.getScene().prePassRenderer.getIndex(2) && (r.previousBones[e.uniqueId] || (r.previousBones[e.uniqueId] = i.slice()), t.setMatrices("mPreviousBones", r.previousBones[e.uniqueId]), Ye._CopyBonesTransformationMatrices(i, r.previousBones[e.uniqueId])));
      }
    }
  }
  // Copies the bones transformation matrices into the target array and returns the target's reference
  static _CopyBonesTransformationMatrices(e, t) {
    return t.set(e), t;
  }
  /**
   * Binds the morph targets information from the mesh to the effect.
   * @param abstractMesh The mesh we are binding the information to render
   * @param effect The effect we are binding the data to
   */
  static BindMorphTargetParameters(e, t) {
    const r = e.morphTargetManager;
    !e || !r || t.setFloatArray("morphTargetInfluences", r.influences);
  }
  /**
   * Binds the logarithmic depth information from the scene to the effect for the given defines.
   * @param defines The generated defines used in the effect
   * @param effect The effect we are binding the data to
   * @param scene The scene we are willing to render with logarithmic scale for
   */
  static BindLogDepth(e, t, r) {
    if (!e || e.LOGARITHMICDEPTH || e.indexOf && e.indexOf("LOGARITHMICDEPTH") >= 0) {
      const n = r.activeCamera;
      n.mode === Tr.ORTHOGRAPHIC_CAMERA && Se.Error("Logarithmic depth is not compatible with orthographic cameras!", 20), t.setFloat("logarithmicDepthConstant", 2 / (Math.log(n.maxZ + 1) / Math.LN2));
    }
  }
}
Ye._TmpMorphInfluencers = { NUM_MORPH_INFLUENCERS: 0 };
Ye._TempFogColor = Ne.Black();
class Dq {
  /**
   * Creates a material stencil state instance
   */
  constructor() {
    this.reset();
  }
  /**
   * Resets all the stencil states to default values
   */
  reset() {
    this.enabled = !1, this.mask = 255, this.func = 519, this.funcRef = 1, this.funcMask = 255, this.opStencilFail = 7680, this.opDepthFail = 7680, this.opStencilDepthPass = 7681;
  }
  /**
   * Gets or sets the stencil function
   */
  get func() {
    return this._func;
  }
  set func(e) {
    this._func = e;
  }
  /**
   * Gets or sets the stencil function reference
   */
  get funcRef() {
    return this._funcRef;
  }
  set funcRef(e) {
    this._funcRef = e;
  }
  /**
   * Gets or sets the stencil function mask
   */
  get funcMask() {
    return this._funcMask;
  }
  set funcMask(e) {
    this._funcMask = e;
  }
  /**
   * Gets or sets the operation when the stencil test fails
   */
  get opStencilFail() {
    return this._opStencilFail;
  }
  set opStencilFail(e) {
    this._opStencilFail = e;
  }
  /**
   * Gets or sets the operation when the depth test fails
   */
  get opDepthFail() {
    return this._opDepthFail;
  }
  set opDepthFail(e) {
    this._opDepthFail = e;
  }
  /**
   * Gets or sets the operation when the stencil+depth test succeeds
   */
  get opStencilDepthPass() {
    return this._opStencilDepthPass;
  }
  set opStencilDepthPass(e) {
    this._opStencilDepthPass = e;
  }
  /**
   * Gets or sets the stencil mask
   */
  get mask() {
    return this._mask;
  }
  set mask(e) {
    this._mask = e;
  }
  /**
   * Enables or disables the stencil test
   */
  get enabled() {
    return this._enabled;
  }
  set enabled(e) {
    this._enabled = e;
  }
  /**
   * Get the current class name, useful for serialization or dynamic coding.
   * @returns "MaterialStencilState"
   */
  getClassName() {
    return "MaterialStencilState";
  }
  /**
   * Makes a duplicate of the current configuration into another one.
   * @param stencilState defines stencil state where to copy the info
   */
  copyTo(e) {
    jt.Clone(() => e, this);
  }
  /**
   * Serializes this stencil configuration.
   * @returns - An object with the serialized config.
   */
  serialize() {
    return jt.Serialize(this);
  }
  /**
   * Parses a stencil state configuration from a serialized object.
   * @param source - Serialized object.
   * @param scene Defines the scene we are parsing for
   * @param rootUrl Defines the rootUrl to load from
   */
  parse(e, t, r) {
    jt.Parse(() => this, e, t, r);
  }
}
C([
  M()
], Dq.prototype, "func", null);
C([
  M()
], Dq.prototype, "funcRef", null);
C([
  M()
], Dq.prototype, "funcMask", null);
C([
  M()
], Dq.prototype, "opStencilFail", null);
C([
  M()
], Dq.prototype, "opDepthFail", null);
C([
  M()
], Dq.prototype, "opStencilDepthPass", null);
C([
  M()
], Dq.prototype, "mask", null);
C([
  M()
], Dq.prototype, "enabled", null);
var x6;
(function(A) {
  A[A.Created = 1] = "Created", A[A.Disposed = 2] = "Disposed", A[A.GetDefineNames = 4] = "GetDefineNames", A[A.PrepareUniformBuffer = 8] = "PrepareUniformBuffer", A[A.IsReadyForSubMesh = 16] = "IsReadyForSubMesh", A[A.PrepareDefines = 32] = "PrepareDefines", A[A.BindForSubMesh = 64] = "BindForSubMesh", A[A.PrepareEffect = 128] = "PrepareEffect", A[A.GetAnimatables = 256] = "GetAnimatables", A[A.GetActiveTextures = 512] = "GetActiveTextures", A[A.HasTexture = 1024] = "HasTexture", A[A.FillRenderTargetTextures = 2048] = "FillRenderTargetTextures", A[A.HasRenderTargetTextures = 4096] = "HasRenderTargetTextures", A[A.HardBindForSubMesh = 8192] = "HardBindForSubMesh";
})(x6 || (x6 = {}));
class gt {
  /**
   * If the material can be rendered to several textures with MRT extension
   */
  get canRenderToMRT() {
    return !1;
  }
  /**
   * Sets the alpha value of the material
   */
  set alpha(e) {
    if (this._alpha === e)
      return;
    const t = this._alpha;
    this._alpha = e, (t === 1 || e === 1) && this.markAsDirty(gt.MiscDirtyFlag + gt.PrePassDirtyFlag);
  }
  /**
   * Gets the alpha value of the material
   */
  get alpha() {
    return this._alpha;
  }
  /**
   * Sets the culling state (true to enable culling, false to disable)
   */
  set backFaceCulling(e) {
    this._backFaceCulling !== e && (this._backFaceCulling = e, this.markAsDirty(gt.TextureDirtyFlag));
  }
  /**
   * Gets the culling state
   */
  get backFaceCulling() {
    return this._backFaceCulling;
  }
  /**
   * Sets the type of faces that should be culled (true for back faces, false for front faces)
   */
  set cullBackFaces(e) {
    this._cullBackFaces !== e && (this._cullBackFaces = e, this.markAsDirty(gt.TextureDirtyFlag));
  }
  /**
   * Gets the type of faces that should be culled
   */
  get cullBackFaces() {
    return this._cullBackFaces;
  }
  /**
   * Block the dirty-mechanism for this specific material
   * When set to false after being true the material will be marked as dirty.
   */
  get blockDirtyMechanism() {
    return this._blockDirtyMechanism;
  }
  set blockDirtyMechanism(e) {
    this._blockDirtyMechanism !== e && (this._blockDirtyMechanism = e, e || this.markDirty());
  }
  /**
   * This allows you to modify the material without marking it as dirty after every change.
   * This function should be used if you need to make more than one dirty-enabling change to the material - adding a texture, setting a new fill mode and so on.
   * The callback will pass the material as an argument, so you can make your changes to it.
   * @param callback the callback to be executed that will update the material
   */
  atomicMaterialsUpdate(e) {
    this.blockDirtyMechanism = !0;
    try {
      e(this);
    } finally {
      this.blockDirtyMechanism = !1;
    }
  }
  /**
   * Gets a boolean indicating that current material needs to register RTT
   */
  get hasRenderTargetTextures() {
    return this._eventInfo.hasRenderTargetTextures = !1, this._callbackPluginEventHasRenderTargetTextures(this._eventInfo), this._eventInfo.hasRenderTargetTextures;
  }
  /**
   * Called during a dispose event
   */
  set onDispose(e) {
    this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);
  }
  /**
   * An event triggered when the material is bound
   */
  get onBindObservable() {
    return this._onBindObservable || (this._onBindObservable = new Oe()), this._onBindObservable;
  }
  /**
   * Called during a bind event
   */
  set onBind(e) {
    this._onBindObserver && this.onBindObservable.remove(this._onBindObserver), this._onBindObserver = this.onBindObservable.add(e);
  }
  /**
   * An event triggered when the material is unbound
   */
  get onUnBindObservable() {
    return this._onUnBindObservable || (this._onUnBindObservable = new Oe()), this._onUnBindObservable;
  }
  /**
   * An event triggered when the effect is (re)created
   */
  get onEffectCreatedObservable() {
    return this._onEffectCreatedObservable || (this._onEffectCreatedObservable = new Oe()), this._onEffectCreatedObservable;
  }
  /**
   * Sets the value of the alpha mode.
   *
   * | Value | Type | Description |
   * | --- | --- | --- |
   * | 0 | ALPHA_DISABLE |   |
   * | 1 | ALPHA_ADD |   |
   * | 2 | ALPHA_COMBINE |   |
   * | 3 | ALPHA_SUBTRACT |   |
   * | 4 | ALPHA_MULTIPLY |   |
   * | 5 | ALPHA_MAXIMIZED |   |
   * | 6 | ALPHA_ONEONE |   |
   * | 7 | ALPHA_PREMULTIPLIED |   |
   * | 8 | ALPHA_PREMULTIPLIED_PORTERDUFF |   |
   * | 9 | ALPHA_INTERPOLATE |   |
   * | 10 | ALPHA_SCREENMODE |   |
   *
   */
  set alphaMode(e) {
    this._alphaMode !== e && (this._alphaMode = e, this.markAsDirty(gt.TextureDirtyFlag));
  }
  /**
   * Gets the value of the alpha mode
   */
  get alphaMode() {
    return this._alphaMode;
  }
  /**
   * Sets the need depth pre-pass value
   */
  set needDepthPrePass(e) {
    this._needDepthPrePass !== e && (this._needDepthPrePass = e, this._needDepthPrePass && (this.checkReadyOnEveryCall = !0));
  }
  /**
   * Gets the depth pre-pass value
   */
  get needDepthPrePass() {
    return this._needDepthPrePass;
  }
  /**
   * Can this material render to prepass
   */
  get isPrePassCapable() {
    return !1;
  }
  /**
   * Sets the state for enabling fog
   */
  set fogEnabled(e) {
    this._fogEnabled !== e && (this._fogEnabled = e, this.markAsDirty(gt.MiscDirtyFlag));
  }
  /**
   * Gets the value of the fog enabled state
   */
  get fogEnabled() {
    return this._fogEnabled;
  }
  get wireframe() {
    switch (this._fillMode) {
      case gt.WireFrameFillMode:
      case gt.LineListDrawMode:
      case gt.LineLoopDrawMode:
      case gt.LineStripDrawMode:
        return !0;
    }
    return this._scene.forceWireframe;
  }
  /**
   * Sets the state of wireframe mode
   */
  set wireframe(e) {
    this.fillMode = e ? gt.WireFrameFillMode : gt.TriangleFillMode;
  }
  /**
   * Gets the value specifying if point clouds are enabled
   */
  get pointsCloud() {
    switch (this._fillMode) {
      case gt.PointFillMode:
      case gt.PointListDrawMode:
        return !0;
    }
    return this._scene.forcePointsCloud;
  }
  /**
   * Sets the state of point cloud mode
   */
  set pointsCloud(e) {
    this.fillMode = e ? gt.PointFillMode : gt.TriangleFillMode;
  }
  /**
   * Gets the material fill mode
   */
  get fillMode() {
    return this._fillMode;
  }
  /**
   * Sets the material fill mode
   */
  set fillMode(e) {
    this._fillMode !== e && (this._fillMode = e, this.markAsDirty(gt.MiscDirtyFlag));
  }
  /**
   * In case the depth buffer does not allow enough depth precision for your scene (might be the case in large scenes)
   * You can try switching to logarithmic depth.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/logarithmicDepthBuffer
   */
  get useLogarithmicDepth() {
    return this._useLogarithmicDepth;
  }
  set useLogarithmicDepth(e) {
    const t = this.getScene().getEngine().getCaps().fragmentDepthSupported;
    e && !t && Se.Warn("Logarithmic depth has been requested for a material on a device that doesn't support it."), this._useLogarithmicDepth = e && t, this._markAllSubMeshesAsMiscDirty();
  }
  /** @internal */
  _getDrawWrapper() {
    return this._drawWrapper;
  }
  /**
   * @internal
   */
  _setDrawWrapper(e) {
    this._drawWrapper = e;
  }
  /**
   * Creates a material instance
   * @param name defines the name of the material
   * @param scene defines the scene to reference
   * @param doNotAdd specifies if the material should be added to the scene
   */
  constructor(e, t, r) {
    this.shadowDepthWrapper = null, this.allowShaderHotSwapping = !0, this.metadata = null, this.reservedDataStore = null, this.checkReadyOnEveryCall = !1, this.checkReadyOnlyOnce = !1, this.state = "", this._alpha = 1, this._backFaceCulling = !0, this._cullBackFaces = !0, this._blockDirtyMechanism = !1, this.onCompiled = null, this.onError = null, this.getRenderTargetTextures = null, this.doNotSerialize = !1, this._storeEffectOnSubMeshes = !1, this.animations = null, this.onDisposeObservable = new Oe(), this._onDisposeObserver = null, this._onUnBindObservable = null, this._onBindObserver = null, this._alphaMode = 2, this._needDepthPrePass = !1, this.disableDepthWrite = !1, this.disableColorWrite = !1, this.forceDepthWrite = !1, this.depthFunction = 0, this.separateCullingPass = !1, this._fogEnabled = !0, this.pointSize = 1, this.zOffset = 0, this.zOffsetUnits = 0, this.stencil = new Dq(), this._useUBO = !1, this._fillMode = gt.TriangleFillMode, this._cachedDepthWriteState = !1, this._cachedColorWriteState = !1, this._cachedDepthFunctionState = 0, this._indexInSceneMaterialArray = -1, this.meshMap = null, this._parentContainer = null, this._uniformBufferLayoutBuilt = !1, this._eventInfo = {}, this._callbackPluginEventGeneric = () => {
    }, this._callbackPluginEventIsReadyForSubMesh = () => {
    }, this._callbackPluginEventPrepareDefines = () => {
    }, this._callbackPluginEventPrepareDefinesBeforeAttributes = () => {
    }, this._callbackPluginEventHardBindForSubMesh = () => {
    }, this._callbackPluginEventBindForSubMesh = () => {
    }, this._callbackPluginEventHasRenderTargetTextures = () => {
    }, this._callbackPluginEventFillRenderTargetTextures = () => {
    }, this._forceAlphaTest = !1, this._transparencyMode = null, this.name = e;
    const n = t || gr.LastCreatedScene;
    n && (this._scene = n, this._dirtyCallbacks = {}, this._dirtyCallbacks[1] = this._markAllSubMeshesAsTexturesDirty.bind(this), this._dirtyCallbacks[2] = this._markAllSubMeshesAsLightsDirty.bind(this), this._dirtyCallbacks[4] = this._markAllSubMeshesAsFresnelDirty.bind(this), this._dirtyCallbacks[8] = this._markAllSubMeshesAsAttributesDirty.bind(this), this._dirtyCallbacks[16] = this._markAllSubMeshesAsMiscDirty.bind(this), this._dirtyCallbacks[32] = this._markAllSubMeshesAsPrePassDirty.bind(this), this._dirtyCallbacks[63] = this._markAllSubMeshesAsAllDirty.bind(this), this.id = e || ye.RandomId(), this.uniqueId = this._scene.getUniqueId(), this._materialContext = this._scene.getEngine().createMaterialContext(), this._drawWrapper = new zo(this._scene.getEngine(), !1), this._drawWrapper.materialContext = this._materialContext, this._scene.useRightHandedSystem ? this.sideOrientation = gt.ClockWiseSideOrientation : this.sideOrientation = gt.CounterClockWiseSideOrientation, this._uniformBuffer = new yr(this._scene.getEngine(), void 0, void 0, e), this._useUBO = this.getScene().getEngine().supportsUniformBuffers, r || this._scene.addMaterial(this), this._scene.useMaterialMeshMap && (this.meshMap = {}), gt.OnEventObservable.notifyObservers(this, x6.Created));
  }
  /**
   * Returns a string representation of the current material
   * @param fullDetails defines a boolean indicating which levels of logging is desired
   * @returns a string with material information
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  toString(e) {
    return "Name: " + this.name;
  }
  /**
   * Gets the class name of the material
   * @returns a string with the class name of the material
   */
  getClassName() {
    return "Material";
  }
  /** @internal */
  get _isMaterial() {
    return !0;
  }
  /**
   * Specifies if updates for the material been locked
   */
  get isFrozen() {
    return this.checkReadyOnlyOnce;
  }
  /**
   * Locks updates for the material
   */
  freeze() {
    this.markDirty(), this.checkReadyOnlyOnce = !0;
  }
  /**
   * Unlocks updates for the material
   */
  unfreeze() {
    this.markDirty(), this.checkReadyOnlyOnce = !1;
  }
  /**
   * Specifies if the material is ready to be used
   * @param mesh defines the mesh to check
   * @param useInstances specifies if instances should be used
   * @returns a boolean indicating if the material is ready to be used
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  isReady(e, t) {
    return !0;
  }
  /**
   * Specifies that the submesh is ready to be used
   * @param mesh defines the mesh to check
   * @param subMesh defines which submesh to check
   * @param useInstances specifies that instances should be used
   * @returns a boolean indicating that the submesh is ready or not
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  isReadyForSubMesh(e, t, r) {
    const n = t.materialDefines;
    return n ? (this._eventInfo.isReadyForSubMesh = !0, this._eventInfo.defines = n, this._callbackPluginEventIsReadyForSubMesh(this._eventInfo), this._eventInfo.isReadyForSubMesh) : !1;
  }
  /**
   * Returns the material effect
   * @returns the effect associated with the material
   */
  getEffect() {
    return this._drawWrapper.effect;
  }
  /**
   * Returns the current scene
   * @returns a Scene
   */
  getScene() {
    return this._scene;
  }
  /**
   * Gets the current transparency mode.
   */
  get transparencyMode() {
    return this._transparencyMode;
  }
  /**
   * Sets the transparency mode of the material.
   *
   * | Value | Type                                | Description |
   * | ----- | ----------------------------------- | ----------- |
   * | 0     | OPAQUE                              |             |
   * | 1     | ALPHATEST                           |             |
   * | 2     | ALPHABLEND                          |             |
   * | 3     | ALPHATESTANDBLEND                   |             |
   *
   */
  set transparencyMode(e) {
    this._transparencyMode !== e && (this._transparencyMode = e, this._forceAlphaTest = e === gt.MATERIAL_ALPHATESTANDBLEND, this._markAllSubMeshesAsTexturesAndMiscDirty());
  }
  /**
   * Returns true if alpha blending should be disabled.
   */
  get _disableAlphaBlending() {
    return this._transparencyMode === gt.MATERIAL_OPAQUE || this._transparencyMode === gt.MATERIAL_ALPHATEST;
  }
  /**
   * Specifies whether or not this material should be rendered in alpha blend mode.
   * @returns a boolean specifying if alpha blending is needed
   */
  needAlphaBlending() {
    return this._disableAlphaBlending ? !1 : this.alpha < 1;
  }
  /**
   * Specifies if the mesh will require alpha blending
   * @param mesh defines the mesh to check
   * @returns a boolean specifying if alpha blending is needed for the mesh
   */
  needAlphaBlendingForMesh(e) {
    return e.visibility < 1 ? !0 : this._disableAlphaBlending ? !1 : e.hasVertexAlpha || this.needAlphaBlending();
  }
  /**
   * Specifies whether or not this material should be rendered in alpha test mode.
   * @returns a boolean specifying if an alpha test is needed.
   */
  needAlphaTesting() {
    return !!this._forceAlphaTest;
  }
  /**
   * Specifies if material alpha testing should be turned on for the mesh
   * @param mesh defines the mesh to check
   */
  _shouldTurnAlphaTestOn(e) {
    return !this.needAlphaBlendingForMesh(e) && this.needAlphaTesting();
  }
  /**
   * Gets the texture used for the alpha test
   * @returns the texture to use for alpha testing
   */
  getAlphaTestTexture() {
    return null;
  }
  /**
   * Marks the material to indicate that it needs to be re-calculated
   * @param forceMaterialDirty - Forces the material to be marked as dirty for all components (same as this.markAsDirty(Material.AllDirtyFlag)). You should use this flag if the material is frozen and you want to force a recompilation.
   */
  markDirty(e = !1) {
    const t = this.getScene().meshes;
    for (const r of t)
      if (r.subMeshes)
        for (const n of r.subMeshes)
          n.getMaterial() === this && n.effect && (n.effect._wasPreviouslyReady = !1, n.effect._wasPreviouslyUsingInstances = null, n.effect._forceRebindOnNextCall = e);
    e && this.markAsDirty(gt.AllDirtyFlag);
  }
  /**
   * @internal
   */
  _preBind(e, t = null) {
    const r = this._scene.getEngine(), i = (t ?? this.sideOrientation) === gt.ClockWiseSideOrientation;
    return r.enableEffect(e || this._getDrawWrapper()), r.setState(this.backFaceCulling, this.zOffset, !1, i, this._scene._mirroredCameraPosition ? !this.cullBackFaces : this.cullBackFaces, this.stencil, this.zOffsetUnits), i;
  }
  /**
   * Binds the material to the mesh
   * @param world defines the world transformation matrix
   * @param mesh defines the mesh to bind the material to
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  bind(e, t) {
  }
  /**
   * Initializes the uniform buffer layout for the shader.
   */
  buildUniformLayout() {
    const e = this._uniformBuffer;
    this._eventInfo.ubo = e, this._callbackPluginEventGeneric(x6.PrepareUniformBuffer, this._eventInfo), e.create(), this._uniformBufferLayoutBuilt = !0;
  }
  /**
   * Binds the submesh to the material
   * @param world defines the world transformation matrix
   * @param mesh defines the mesh containing the submesh
   * @param subMesh defines the submesh to bind the material to
   */
  bindForSubMesh(e, t, r) {
    const n = r.effect;
    n && (this._eventInfo.subMesh = r, this._callbackPluginEventBindForSubMesh(this._eventInfo), n._forceRebindOnNextCall = !1);
  }
  /**
   * Binds the world matrix to the material
   * @param world defines the world transformation matrix
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  bindOnlyWorldMatrix(e) {
  }
  /**
   * Binds the view matrix to the effect
   * @param effect defines the effect to bind the view matrix to
   */
  bindView(e) {
    this._useUBO ? this._needToBindSceneUbo = !0 : e.setMatrix("view", this.getScene().getViewMatrix());
  }
  /**
   * Binds the view projection and projection matrices to the effect
   * @param effect defines the effect to bind the view projection and projection matrices to
   */
  bindViewProjection(e) {
    this._useUBO ? this._needToBindSceneUbo = !0 : (e.setMatrix("viewProjection", this.getScene().getTransformMatrix()), e.setMatrix("projection", this.getScene().getProjectionMatrix()));
  }
  /**
   * Binds the view matrix to the effect
   * @param effect defines the effect to bind the view matrix to
   * @param variableName name of the shader variable that will hold the eye position
   */
  bindEyePosition(e, t) {
    this._useUBO ? this._needToBindSceneUbo = !0 : this._scene.bindEyePosition(e, t);
  }
  /**
   * Processes to execute after binding the material to a mesh
   * @param mesh defines the rendered mesh
   * @param effect
   */
  _afterBind(e, t = null) {
    if (this._scene._cachedMaterial = this, this._needToBindSceneUbo && t && (this._needToBindSceneUbo = !1, Ye.BindSceneUniformBuffer(t, this.getScene().getSceneUniformBuffer()), this._scene.finalizeSceneUbo()), e ? this._scene._cachedVisibility = e.visibility : this._scene._cachedVisibility = 1, this._onBindObservable && e && this._onBindObservable.notifyObservers(e), this.disableDepthWrite) {
      const r = this._scene.getEngine();
      this._cachedDepthWriteState = r.getDepthWrite(), r.setDepthWrite(!1);
    }
    if (this.disableColorWrite) {
      const r = this._scene.getEngine();
      this._cachedColorWriteState = r.getColorWrite(), r.setColorWrite(!1);
    }
    if (this.depthFunction !== 0) {
      const r = this._scene.getEngine();
      this._cachedDepthFunctionState = r.getDepthFunction() || 0, r.setDepthFunction(this.depthFunction);
    }
  }
  /**
   * Unbinds the material from the mesh
   */
  unbind() {
    this._onUnBindObservable && this._onUnBindObservable.notifyObservers(this), this.depthFunction !== 0 && this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState), this.disableDepthWrite && this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState), this.disableColorWrite && this._scene.getEngine().setColorWrite(this._cachedColorWriteState);
  }
  /**
   * Returns the animatable textures.
   * @returns - Array of animatable textures.
   */
  getAnimatables() {
    return this._eventInfo.animatables = [], this._callbackPluginEventGeneric(x6.GetAnimatables, this._eventInfo), this._eventInfo.animatables;
  }
  /**
   * Gets the active textures from the material
   * @returns an array of textures
   */
  getActiveTextures() {
    return this._eventInfo.activeTextures = [], this._callbackPluginEventGeneric(x6.GetActiveTextures, this._eventInfo), this._eventInfo.activeTextures;
  }
  /**
   * Specifies if the material uses a texture
   * @param texture defines the texture to check against the material
   * @returns a boolean specifying if the material uses the texture
   */
  hasTexture(e) {
    return this._eventInfo.hasTexture = !1, this._eventInfo.texture = e, this._callbackPluginEventGeneric(x6.HasTexture, this._eventInfo), this._eventInfo.hasTexture;
  }
  /**
   * Makes a duplicate of the material, and gives it a new name
   * @param name defines the new name for the duplicated material
   * @returns the cloned material
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  clone(e) {
    return null;
  }
  _clonePlugins(e, t) {
    const r = {};
    if (this._serializePlugins(r), gt._parsePlugins(r, e, this._scene, t), this.pluginManager)
      for (const n of this.pluginManager._plugins) {
        const i = e.pluginManager.getPlugin(n.name);
        n.copyTo(i);
      }
  }
  /**
   * Gets the meshes bound to the material
   * @returns an array of meshes bound to the material
   */
  getBindedMeshes() {
    if (this.meshMap) {
      const e = [];
      for (const t in this.meshMap) {
        const r = this.meshMap[t];
        r && e.push(r);
      }
      return e;
    } else
      return this._scene.meshes.filter((t) => t.material === this);
  }
  /**
   * Force shader compilation
   * @param mesh defines the mesh associated with this material
   * @param onCompiled defines a function to execute once the material is compiled
   * @param options defines the options to configure the compilation
   * @param onError defines a function to execute if the material fails compiling
   */
  forceCompilation(e, t, r, n) {
    const i = Object.assign({ clipPlane: !1, useInstances: !1 }, r), s = this.getScene(), a = this.allowShaderHotSwapping;
    this.allowShaderHotSwapping = !1;
    const f = () => {
      if (!this._scene || !this._scene.getEngine())
        return;
      const o = s.clipPlane;
      if (i.clipPlane && (s.clipPlane = new BA(0, 0, 0, 1)), this._storeEffectOnSubMeshes) {
        let d = !0, v = null;
        if (e.subMeshes) {
          const u = new rA(0, 0, 0, 0, 0, e, void 0, !1, !1);
          u.materialDefines && (u.materialDefines._renderId = -1), this.isReadyForSubMesh(e, u, i.useInstances) || (u.effect && u.effect.getCompilationError() && u.effect.allFallbacksProcessed() ? v = u.effect.getCompilationError() : (d = !1, setTimeout(f, 16)));
        }
        d && (this.allowShaderHotSwapping = a, v && n && n(v), t && t(this));
      } else
        this.isReady() ? (this.allowShaderHotSwapping = a, t && t(this)) : setTimeout(f, 16);
      i.clipPlane && (s.clipPlane = o);
    };
    f();
  }
  /**
   * Force shader compilation
   * @param mesh defines the mesh that will use this material
   * @param options defines additional options for compiling the shaders
   * @returns a promise that resolves when the compilation completes
   */
  forceCompilationAsync(e, t) {
    return new Promise((r, n) => {
      this.forceCompilation(e, () => {
        r();
      }, t, (i) => {
        n(i);
      });
    });
  }
  /**
   * Marks a define in the material to indicate that it needs to be re-computed
   * @param flag defines a flag used to determine which parts of the material have to be marked as dirty
   */
  markAsDirty(e) {
    this.getScene().blockMaterialDirtyMechanism || this._blockDirtyMechanism || (gt._DirtyCallbackArray.length = 0, e & gt.TextureDirtyFlag && gt._DirtyCallbackArray.push(gt._TextureDirtyCallBack), e & gt.LightDirtyFlag && gt._DirtyCallbackArray.push(gt._LightsDirtyCallBack), e & gt.FresnelDirtyFlag && gt._DirtyCallbackArray.push(gt._FresnelDirtyCallBack), e & gt.AttributesDirtyFlag && gt._DirtyCallbackArray.push(gt._AttributeDirtyCallBack), e & gt.MiscDirtyFlag && gt._DirtyCallbackArray.push(gt._MiscDirtyCallBack), e & gt.PrePassDirtyFlag && gt._DirtyCallbackArray.push(gt._PrePassDirtyCallBack), gt._DirtyCallbackArray.length && this._markAllSubMeshesAsDirty(gt._RunDirtyCallBacks), this.getScene().resetCachedMaterial());
  }
  /**
   * Resets the draw wrappers cache for all submeshes that are using this material
   */
  resetDrawCache() {
    const e = this.getScene().meshes;
    for (const t of e)
      if (t.subMeshes)
        for (const r of t.subMeshes)
          r.getMaterial() === this && r.resetDrawCache();
  }
  /**
   * Marks all submeshes of a material to indicate that their material defines need to be re-calculated
   * @param func defines a function which checks material defines against the submeshes
   */
  _markAllSubMeshesAsDirty(e) {
    if (this.getScene().blockMaterialDirtyMechanism || this._blockDirtyMechanism)
      return;
    const t = this.getScene().meshes;
    for (const r of t)
      if (r.subMeshes) {
        for (const n of r.subMeshes)
          if (n.getMaterial(!1) === this)
            for (const i of n._drawWrappers)
              !i || !i.defines || !i.defines.markAllAsDirty || this._materialContext === i.materialContext && e(i.defines);
      }
  }
  /**
   * Indicates that the scene should check if the rendering now needs a prepass
   */
  _markScenePrePassDirty() {
    if (this.getScene().blockMaterialDirtyMechanism || this._blockDirtyMechanism)
      return;
    const e = this.getScene().enablePrePassRenderer();
    e && e.markAsDirty();
  }
  /**
   * Indicates that we need to re-calculated for all submeshes
   */
  _markAllSubMeshesAsAllDirty() {
    this._markAllSubMeshesAsDirty(gt._AllDirtyCallBack);
  }
  /**
   * Indicates that image processing needs to be re-calculated for all submeshes
   */
  _markAllSubMeshesAsImageProcessingDirty() {
    this._markAllSubMeshesAsDirty(gt._ImageProcessingDirtyCallBack);
  }
  /**
   * Indicates that textures need to be re-calculated for all submeshes
   */
  _markAllSubMeshesAsTexturesDirty() {
    this._markAllSubMeshesAsDirty(gt._TextureDirtyCallBack);
  }
  /**
   * Indicates that fresnel needs to be re-calculated for all submeshes
   */
  _markAllSubMeshesAsFresnelDirty() {
    this._markAllSubMeshesAsDirty(gt._FresnelDirtyCallBack);
  }
  /**
   * Indicates that fresnel and misc need to be re-calculated for all submeshes
   */
  _markAllSubMeshesAsFresnelAndMiscDirty() {
    this._markAllSubMeshesAsDirty(gt._FresnelAndMiscDirtyCallBack);
  }
  /**
   * Indicates that lights need to be re-calculated for all submeshes
   */
  _markAllSubMeshesAsLightsDirty() {
    this._markAllSubMeshesAsDirty(gt._LightsDirtyCallBack);
  }
  /**
   * Indicates that attributes need to be re-calculated for all submeshes
   */
  _markAllSubMeshesAsAttributesDirty() {
    this._markAllSubMeshesAsDirty(gt._AttributeDirtyCallBack);
  }
  /**
   * Indicates that misc needs to be re-calculated for all submeshes
   */
  _markAllSubMeshesAsMiscDirty() {
    this._markAllSubMeshesAsDirty(gt._MiscDirtyCallBack);
  }
  /**
   * Indicates that prepass needs to be re-calculated for all submeshes
   */
  _markAllSubMeshesAsPrePassDirty() {
    this._markAllSubMeshesAsDirty(gt._MiscDirtyCallBack);
  }
  /**
   * Indicates that textures and misc need to be re-calculated for all submeshes
   */
  _markAllSubMeshesAsTexturesAndMiscDirty() {
    this._markAllSubMeshesAsDirty(gt._TextureAndMiscDirtyCallBack);
  }
  _checkScenePerformancePriority() {
    if (this._scene.performancePriority !== $H.BackwardCompatible) {
      this.checkReadyOnlyOnce = !0;
      const e = this._scene.onScenePerformancePriorityChangedObservable.addOnce(() => {
        this.checkReadyOnlyOnce = !1;
      });
      this.onDisposeObservable.add(() => {
        this._scene.onScenePerformancePriorityChangedObservable.remove(e);
      });
    }
  }
  /**
   * Sets the required values to the prepass renderer.
   * @param prePassRenderer defines the prepass renderer to setup.
   * @returns true if the pre pass is needed.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  setPrePassRenderer(e) {
    return !1;
  }
  /**
   * Disposes the material
   * @param forceDisposeEffect specifies if effects should be forcefully disposed
   * @param forceDisposeTextures specifies if textures should be forcefully disposed
   * @param notBoundToMesh specifies if the material that is being disposed is known to be not bound to any mesh
   */
  dispose(e, t, r) {
    const n = this.getScene();
    if (n.stopAnimation(this), n.freeProcessedMaterials(), n.removeMaterial(this), this._eventInfo.forceDisposeTextures = t, this._callbackPluginEventGeneric(x6.Disposed, this._eventInfo), this._parentContainer) {
      const i = this._parentContainer.materials.indexOf(this);
      i > -1 && this._parentContainer.materials.splice(i, 1), this._parentContainer = null;
    }
    if (r !== !0)
      if (this.meshMap)
        for (const i in this.meshMap) {
          const s = this.meshMap[i];
          s && (s.material = null, this.releaseVertexArrayObject(s, e));
        }
      else {
        const i = n.meshes;
        for (const s of i)
          s.material === this && !s.sourceMesh && (s.material = null, this.releaseVertexArrayObject(s, e));
      }
    this._uniformBuffer.dispose(), e && this._drawWrapper.effect && (this._storeEffectOnSubMeshes || this._drawWrapper.effect.dispose(), this._drawWrapper.effect = null), this.metadata = null, this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this._onBindObservable && this._onBindObservable.clear(), this._onUnBindObservable && this._onUnBindObservable.clear(), this._onEffectCreatedObservable && this._onEffectCreatedObservable.clear(), this._eventInfo && (this._eventInfo = {});
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  releaseVertexArrayObject(e, t) {
    const r = e.geometry;
    if (r)
      if (this._storeEffectOnSubMeshes) {
        if (e.subMeshes)
          for (const n of e.subMeshes)
            r._releaseVertexArrayObject(n.effect), t && n.effect && n.effect.dispose();
      } else
        r._releaseVertexArrayObject(this._drawWrapper.effect);
  }
  /**
   * Serializes this material
   * @returns the serialized material object
   */
  serialize() {
    const e = jt.Serialize(this);
    return e.stencil = this.stencil.serialize(), e.uniqueId = this.uniqueId, this._serializePlugins(e), e;
  }
  _serializePlugins(e) {
    if (e.plugins = {}, this.pluginManager)
      for (const t of this.pluginManager._plugins)
        e.plugins[t.getClassName()] = t.serialize();
  }
  /**
   * Creates a material from parsed material data
   * @param parsedMaterial defines parsed material data
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures
   * @returns a new material
   */
  static Parse(e, t, r) {
    if (!e.customType)
      e.customType = "BABYLON.StandardMaterial";
    else if (e.customType === "BABYLON.PBRMaterial" && e.overloadedAlbedo && (e.customType = "BABYLON.LegacyPBRMaterial", !BABYLON.LegacyPBRMaterial))
      return Se.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."), null;
    const i = ye.Instantiate(e.customType).Parse(e, t, r);
    return i._loadedUniqueId = e.uniqueId, i;
  }
  static _parsePlugins(e, t, r, n) {
    var i;
    if (e.plugins)
      for (const s in e.plugins) {
        const a = e.plugins[s];
        let f = (i = t.pluginManager) === null || i === void 0 ? void 0 : i.getPlugin(a.name);
        if (!f) {
          const o = ye.Instantiate("BABYLON." + s);
          o && (f = new o(t));
        }
        f == null || f.parse(a, r, n);
      }
  }
}
gt.TriangleFillMode = 0;
gt.WireFrameFillMode = 1;
gt.PointFillMode = 2;
gt.PointListDrawMode = 3;
gt.LineListDrawMode = 4;
gt.LineLoopDrawMode = 5;
gt.LineStripDrawMode = 6;
gt.TriangleStripDrawMode = 7;
gt.TriangleFanDrawMode = 8;
gt.ClockWiseSideOrientation = 0;
gt.CounterClockWiseSideOrientation = 1;
gt.TextureDirtyFlag = 1;
gt.LightDirtyFlag = 2;
gt.FresnelDirtyFlag = 4;
gt.AttributesDirtyFlag = 8;
gt.MiscDirtyFlag = 16;
gt.PrePassDirtyFlag = 32;
gt.AllDirtyFlag = 63;
gt.MATERIAL_OPAQUE = 0;
gt.MATERIAL_ALPHATEST = 1;
gt.MATERIAL_ALPHABLEND = 2;
gt.MATERIAL_ALPHATESTANDBLEND = 3;
gt.MATERIAL_NORMALBLENDMETHOD_WHITEOUT = 0;
gt.MATERIAL_NORMALBLENDMETHOD_RNM = 1;
gt.OnEventObservable = new Oe();
gt._AllDirtyCallBack = (A) => A.markAllAsDirty();
gt._ImageProcessingDirtyCallBack = (A) => A.markAsImageProcessingDirty();
gt._TextureDirtyCallBack = (A) => A.markAsTexturesDirty();
gt._FresnelDirtyCallBack = (A) => A.markAsFresnelDirty();
gt._MiscDirtyCallBack = (A) => A.markAsMiscDirty();
gt._PrePassDirtyCallBack = (A) => A.markAsPrePassDirty();
gt._LightsDirtyCallBack = (A) => A.markAsLightDirty();
gt._AttributeDirtyCallBack = (A) => A.markAsAttributesDirty();
gt._FresnelAndMiscDirtyCallBack = (A) => {
  gt._FresnelDirtyCallBack(A), gt._MiscDirtyCallBack(A);
};
gt._TextureAndMiscDirtyCallBack = (A) => {
  gt._TextureDirtyCallBack(A), gt._MiscDirtyCallBack(A);
};
gt._DirtyCallbackArray = [];
gt._RunDirtyCallBacks = (A) => {
  for (const e of gt._DirtyCallbackArray)
    e(A);
};
C([
  M()
], gt.prototype, "id", void 0);
C([
  M()
], gt.prototype, "uniqueId", void 0);
C([
  M()
], gt.prototype, "name", void 0);
C([
  M()
], gt.prototype, "metadata", void 0);
C([
  M()
], gt.prototype, "checkReadyOnEveryCall", void 0);
C([
  M()
], gt.prototype, "checkReadyOnlyOnce", void 0);
C([
  M()
], gt.prototype, "state", void 0);
C([
  M("alpha")
], gt.prototype, "_alpha", void 0);
C([
  M("backFaceCulling")
], gt.prototype, "_backFaceCulling", void 0);
C([
  M("cullBackFaces")
], gt.prototype, "_cullBackFaces", void 0);
C([
  M()
], gt.prototype, "sideOrientation", void 0);
C([
  M("alphaMode")
], gt.prototype, "_alphaMode", void 0);
C([
  M()
], gt.prototype, "_needDepthPrePass", void 0);
C([
  M()
], gt.prototype, "disableDepthWrite", void 0);
C([
  M()
], gt.prototype, "disableColorWrite", void 0);
C([
  M()
], gt.prototype, "forceDepthWrite", void 0);
C([
  M()
], gt.prototype, "depthFunction", void 0);
C([
  M()
], gt.prototype, "separateCullingPass", void 0);
C([
  M("fogEnabled")
], gt.prototype, "_fogEnabled", void 0);
C([
  M()
], gt.prototype, "pointSize", void 0);
C([
  M()
], gt.prototype, "zOffset", void 0);
C([
  M()
], gt.prototype, "zOffsetUnits", void 0);
C([
  M()
], gt.prototype, "pointsCloud", null);
C([
  M()
], gt.prototype, "fillMode", null);
C([
  M()
], gt.prototype, "useLogarithmicDepth", null);
C([
  M()
], gt.prototype, "transparencyMode", null);
class Dc extends gt {
  /**
   * Gets or Sets the list of Materials used within the multi material.
   * They need to be ordered according to the submeshes order in the associated mesh
   */
  get subMaterials() {
    return this._subMaterials;
  }
  set subMaterials(e) {
    this._subMaterials = e, this._hookArray(e);
  }
  /**
   * Function used to align with Node.getChildren()
   * @returns the list of Materials used within the multi material
   */
  getChildren() {
    return this.subMaterials;
  }
  /**
   * Instantiates a new Multi Material
   * A multi-material is used to apply different materials to different parts of the same object without the need of
   * separate meshes. This can be use to improve performances.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials
   * @param name Define the name in the scene
   * @param scene Define the scene the material belongs to
   */
  constructor(e, t) {
    super(e, t, !0), this._waitingSubMaterialsUniqueIds = [], this.getScene().addMultiMaterial(this), this.subMaterials = [], this._storeEffectOnSubMeshes = !0;
  }
  _hookArray(e) {
    const t = e.push;
    e.push = (...n) => {
      const i = t.apply(e, n);
      return this._markAllSubMeshesAsTexturesDirty(), i;
    };
    const r = e.splice;
    e.splice = (n, i) => {
      const s = r.apply(e, [n, i]);
      return this._markAllSubMeshesAsTexturesDirty(), s;
    };
  }
  /**
   * Get one of the submaterial by its index in the submaterials array
   * @param index The index to look the sub material at
   * @returns The Material if the index has been defined
   */
  getSubMaterial(e) {
    return e < 0 || e >= this.subMaterials.length ? this.getScene().defaultMaterial : this.subMaterials[e];
  }
  /**
   * Get the list of active textures for the whole sub materials list.
   * @returns All the textures that will be used during the rendering
   */
  getActiveTextures() {
    return super.getActiveTextures().concat(...this.subMaterials.map((e) => e ? e.getActiveTextures() : []));
  }
  /**
   * Specifies if any sub-materials of this multi-material use a given texture.
   * @param texture Defines the texture to check against this multi-material's sub-materials.
   * @returns A boolean specifying if any sub-material of this multi-material uses the texture.
   */
  hasTexture(e) {
    var t;
    if (super.hasTexture(e))
      return !0;
    for (let r = 0; r < this.subMaterials.length; r++)
      if (!((t = this.subMaterials[r]) === null || t === void 0) && t.hasTexture(e))
        return !0;
    return !1;
  }
  /**
   * Gets the current class name of the material e.g. "MultiMaterial"
   * Mainly use in serialization.
   * @returns the class name
   */
  getClassName() {
    return "MultiMaterial";
  }
  /**
   * Checks if the material is ready to render the requested sub mesh
   * @param mesh Define the mesh the submesh belongs to
   * @param subMesh Define the sub mesh to look readiness for
   * @param useInstances Define whether or not the material is used with instances
   * @returns true if ready, otherwise false
   */
  isReadyForSubMesh(e, t, r) {
    for (let n = 0; n < this.subMaterials.length; n++) {
      const i = this.subMaterials[n];
      if (i) {
        if (i._storeEffectOnSubMeshes) {
          if (!i.isReadyForSubMesh(e, t, r))
            return !1;
          continue;
        }
        if (!i.isReady(e))
          return !1;
      }
    }
    return !0;
  }
  /**
   * Clones the current material and its related sub materials
   * @param name Define the name of the newly cloned material
   * @param cloneChildren Define if submaterial will be cloned or shared with the parent instance
   * @returns the cloned material
   */
  clone(e, t) {
    const r = new Dc(e, this.getScene());
    for (let n = 0; n < this.subMaterials.length; n++) {
      let i = null;
      const s = this.subMaterials[n];
      t && s ? i = s.clone(e + "-" + s.name) : i = this.subMaterials[n], r.subMaterials.push(i);
    }
    return r;
  }
  /**
   * Serializes the materials into a JSON representation.
   * @returns the JSON representation
   */
  serialize() {
    const e = {};
    e.name = this.name, e.id = this.id, e.uniqueId = this.uniqueId, Zi && (e.tags = Zi.GetTags(this)), e.materialsUniqueIds = [], e.materials = [];
    for (let t = 0; t < this.subMaterials.length; t++) {
      const r = this.subMaterials[t];
      r ? (e.materialsUniqueIds.push(r.uniqueId), e.materials.push(r.id)) : (e.materialsUniqueIds.push(null), e.materials.push(null));
    }
    return e;
  }
  /**
   * Dispose the material and release its associated resources
   * @param forceDisposeEffect Define if we want to force disposing the associated effect (if false the shader is not released and could be reuse later on)
   * @param forceDisposeTextures Define if we want to force disposing the associated textures (if false, they will not be disposed and can still be use elsewhere in the app)
   * @param forceDisposeChildren Define if we want to force disposing the associated submaterials (if false, they will not be disposed and can still be use elsewhere in the app)
   */
  dispose(e, t, r) {
    const n = this.getScene();
    if (!n)
      return;
    if (r)
      for (let s = 0; s < this.subMaterials.length; s++) {
        const a = this.subMaterials[s];
        a && a.dispose(e, t);
      }
    const i = n.multiMaterials.indexOf(this);
    i >= 0 && n.multiMaterials.splice(i, 1), super.dispose(e, t);
  }
  /**
   * Creates a MultiMaterial from parsed MultiMaterial data.
   * @param parsedMultiMaterial defines parsed MultiMaterial data.
   * @param scene defines the hosting scene
   * @returns a new MultiMaterial
   */
  static ParseMultiMaterial(e, t) {
    const r = new Dc(e.name, t);
    return r.id = e.id, r._loadedUniqueId = e.uniqueId, Zi && Zi.AddTagsTo(r, e.tags), e.materialsUniqueIds ? r._waitingSubMaterialsUniqueIds = e.materialsUniqueIds : e.materials.forEach((n) => r.subMaterials.push(t.getLastMaterialById(n))), r;
  }
}
Ue("BABYLON.MultiMaterial", Dc);
class fee {
  /**
   * Creates a new LOD level
   * @param distanceOrScreenCoverage defines either the distance or the screen coverage where this level should start being displayed
   * @param mesh defines the mesh to use to render this level
   */
  constructor(e, t) {
    this.distanceOrScreenCoverage = e, this.mesh = t;
  }
}
class tQ {
}
class c6e {
  constructor() {
    this.visibleInstances = {}, this.batchCache = new Z5(), this.batchCacheReplacementModeInFrozenMode = new Z5(), this.instancesBufferSize = 32 * 16 * 4;
  }
}
class Z5 {
  constructor() {
    this.mustReturn = !1, this.visibleInstances = new Array(), this.renderSelf = [], this.hardwareInstancedRendering = [];
  }
}
class p6e {
  constructor() {
    this.instancesCount = 0, this.matrixBuffer = null, this.previousMatrixBuffer = null, this.matrixBufferSize = 32 * 16, this.matrixData = null, this.boundingVectors = [], this.worldMatrices = null;
  }
}
class h6e {
  constructor() {
    this._areNormalsFrozen = !1, this._source = null, this.meshMap = null, this._preActivateId = -1, this._LODLevels = new Array(), this._useLODScreenCoverage = !1, this._effectiveMaterial = null, this._forcedInstanceCount = 0, this._overrideRenderingFillMode = null;
  }
}
class Ee extends jn {
  /**
   * Gets the default side orientation.
   * @param orientation the orientation to value to attempt to get
   * @returns the default orientation
   * @internal
   */
  static _GetDefaultSideOrientation(e) {
    return e || Ee.FRONTSIDE;
  }
  /**
   * Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance.
   */
  get useLODScreenCoverage() {
    return this._internalMeshDataInfo._useLODScreenCoverage;
  }
  set useLODScreenCoverage(e) {
    this._internalMeshDataInfo._useLODScreenCoverage = e, this._sortLODLevels();
  }
  get computeBonesUsingShaders() {
    return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;
  }
  set computeBonesUsingShaders(e) {
    this._internalAbstractMeshDataInfo._computeBonesUsingShaders !== e && (e && this._internalMeshDataInfo._sourcePositions && (this.setVerticesData(J.PositionKind, this._internalMeshDataInfo._sourcePositions, !0), this._internalMeshDataInfo._sourceNormals && this.setVerticesData(J.NormalKind, this._internalMeshDataInfo._sourceNormals, !0), this._internalMeshDataInfo._sourcePositions = null, this._internalMeshDataInfo._sourceNormals = null), this._internalAbstractMeshDataInfo._computeBonesUsingShaders = e, this._markSubMeshesAsAttributesDirty());
  }
  /**
   * An event triggered before rendering the mesh
   */
  get onBeforeRenderObservable() {
    return this._internalMeshDataInfo._onBeforeRenderObservable || (this._internalMeshDataInfo._onBeforeRenderObservable = new Oe()), this._internalMeshDataInfo._onBeforeRenderObservable;
  }
  /**
   * An event triggered before binding the mesh
   */
  get onBeforeBindObservable() {
    return this._internalMeshDataInfo._onBeforeBindObservable || (this._internalMeshDataInfo._onBeforeBindObservable = new Oe()), this._internalMeshDataInfo._onBeforeBindObservable;
  }
  /**
   * An event triggered after rendering the mesh
   */
  get onAfterRenderObservable() {
    return this._internalMeshDataInfo._onAfterRenderObservable || (this._internalMeshDataInfo._onAfterRenderObservable = new Oe()), this._internalMeshDataInfo._onAfterRenderObservable;
  }
  /**
   * An event triggeredbetween rendering pass when using separateCullingPass = true
   */
  get onBetweenPassObservable() {
    return this._internalMeshDataInfo._onBetweenPassObservable || (this._internalMeshDataInfo._onBetweenPassObservable = new Oe()), this._internalMeshDataInfo._onBetweenPassObservable;
  }
  /**
   * An event triggered before drawing the mesh
   */
  get onBeforeDrawObservable() {
    return this._internalMeshDataInfo._onBeforeDrawObservable || (this._internalMeshDataInfo._onBeforeDrawObservable = new Oe()), this._internalMeshDataInfo._onBeforeDrawObservable;
  }
  /**
   * Sets a callback to call before drawing the mesh. It is recommended to use onBeforeDrawObservable instead
   */
  set onBeforeDraw(e) {
    this._onBeforeDrawObserver && this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver), this._onBeforeDrawObserver = this.onBeforeDrawObservable.add(e);
  }
  get hasInstances() {
    return this.instances.length > 0;
  }
  get hasThinInstances() {
    return (this.forcedInstanceCount || this._thinInstanceDataStorage.instancesCount || 0) > 0;
  }
  /**
   * Gets or sets the forced number of instances to display.
   * If 0 (default value), the number of instances is not forced and depends on the draw type
   * (regular / instance / thin instances mesh)
   */
  get forcedInstanceCount() {
    return this._internalMeshDataInfo._forcedInstanceCount;
  }
  set forcedInstanceCount(e) {
    this._internalMeshDataInfo._forcedInstanceCount = e;
  }
  /**
   * Use this property to override the Material's fillMode value
   */
  get overrideRenderingFillMode() {
    return this._internalMeshDataInfo._overrideRenderingFillMode;
  }
  set overrideRenderingFillMode(e) {
    this._internalMeshDataInfo._overrideRenderingFillMode = e;
  }
  /**
   * Gets the source mesh (the one used to clone this one from)
   */
  get source() {
    return this._internalMeshDataInfo._source;
  }
  /**
   * Gets the list of clones of this mesh
   * The scene must have been constructed with useClonedMeshMap=true for this to work!
   * Note that useClonedMeshMap=true is the default setting
   */
  get cloneMeshMap() {
    return this._internalMeshDataInfo.meshMap;
  }
  /**
   * Gets or sets a boolean indicating that this mesh does not use index buffer
   */
  get isUnIndexed() {
    return this._unIndexed;
  }
  set isUnIndexed(e) {
    this._unIndexed !== e && (this._unIndexed = e, this._markSubMeshesAsAttributesDirty());
  }
  /** Gets the array buffer used to store the instanced buffer used for instances' world matrices */
  get worldMatrixInstancedBuffer() {
    return this._instanceDataStorage.instancesData;
  }
  /** Gets the array buffer used to store the instanced buffer used for instances' previous world matrices */
  get previousWorldMatrixInstancedBuffer() {
    return this._instanceDataStorage.instancesPreviousData;
  }
  /** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual */
  get manualUpdateOfWorldMatrixInstancedBuffer() {
    return this._instanceDataStorage.manualUpdate;
  }
  set manualUpdateOfWorldMatrixInstancedBuffer(e) {
    this._instanceDataStorage.manualUpdate = e;
  }
  /** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual */
  get manualUpdateOfPreviousWorldMatrixInstancedBuffer() {
    return this._instanceDataStorage.previousManualUpdate;
  }
  set manualUpdateOfPreviousWorldMatrixInstancedBuffer(e) {
    this._instanceDataStorage.previousManualUpdate = e;
  }
  /** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices must be performed in all cases (and notably even in frozen mode) */
  get forceWorldMatrixInstancedBufferUpdate() {
    return this._instanceDataStorage.forceMatrixUpdates;
  }
  set forceWorldMatrixInstancedBufferUpdate(e) {
    this._instanceDataStorage.forceMatrixUpdates = e;
  }
  /**
   * @constructor
   * @param name The value used by scene.getMeshByName() to do a lookup.
   * @param scene The scene to add this mesh to.
   * @param parent The parent of this mesh, if it has one
   * @param source An optional Mesh from which geometry is shared, cloned.
   * @param doNotCloneChildren When cloning, skip cloning child meshes of source, default False.
   *                  When false, achieved by calling a clone(), also passing False.
   *                  This will make creation of children, recursive.
   * @param clonePhysicsImpostor When cloning, include cloning mesh physics impostor, default True.
   */
  constructor(e, t = null, r = null, n = null, i, s = !0) {
    if (super(e, t), this._internalMeshDataInfo = new h6e(), this.delayLoadState = 0, this.instances = [], this._creationDataStorage = null, this._geometry = null, this._instanceDataStorage = new c6e(), this._thinInstanceDataStorage = new p6e(), this._shouldGenerateFlatShading = !1, this._originalBuilderSideOrientation = Ee.DEFAULTSIDE, this.overrideMaterialSideOrientation = null, this.ignoreCameraMaxZ = !1, t = this.getScene(), this._onBeforeDraw = (a, f, o) => {
      a && o && (this._uniformBuffer ? this.transferToEffect(f) : o.bindOnlyWorldMatrix(f));
    }, n) {
      if (n._geometry && n._geometry.applyToMesh(this), sA.DeepCopy(n, this, [
        "name",
        "material",
        "skeleton",
        "instances",
        "parent",
        "uniqueId",
        "source",
        "metadata",
        "morphTargetManager",
        "hasInstances",
        "worldMatrixInstancedBuffer",
        "previousWorldMatrixInstancedBuffer",
        "hasLODLevels",
        "geometry",
        "isBlocked",
        "areNormalsFrozen",
        "facetNb",
        "isFacetDataEnabled",
        "lightSources",
        "useBones",
        "isAnInstance",
        "collider",
        "edgesRenderer",
        "forward",
        "up",
        "right",
        "absolutePosition",
        "absoluteScaling",
        "absoluteRotationQuaternion",
        "isWorldMatrixFrozen",
        "nonUniformScaling",
        "behaviors",
        "worldMatrixFromCache",
        "hasThinInstances",
        "cloneMeshMap",
        "hasBoundingInfo",
        "physicsBody",
        "physicsImpostor"
      ], ["_poseMatrix"]), this._internalMeshDataInfo._source = n, t.useClonedMeshMap && (n._internalMeshDataInfo.meshMap || (n._internalMeshDataInfo.meshMap = {}), n._internalMeshDataInfo.meshMap[this.uniqueId] = this), this._originalBuilderSideOrientation = n._originalBuilderSideOrientation, this._creationDataStorage = n._creationDataStorage, n._ranges) {
        const a = n._ranges;
        for (const f in a)
          Object.prototype.hasOwnProperty.call(a, f) && a[f] && this.createAnimationRange(f, a[f].from, a[f].to);
      }
      if (n.metadata && n.metadata.clone ? this.metadata = n.metadata.clone() : this.metadata = n.metadata, this._internalMetadata = n._internalMetadata, Zi && Zi.HasTags(n) && Zi.AddTagsTo(this, Zi.GetTags(n, !0)), this.setEnabled(n.isEnabled(!1)), this.parent = n.parent, this.setPivotMatrix(n.getPivotMatrix()), this.id = e + "." + n.id, this.material = n.material, !i) {
        const a = n.getDescendants(!0);
        for (let f = 0; f < a.length; f++) {
          const o = a[f];
          o.clone && o.clone(e + "." + o.name, this);
        }
      }
      if (n.morphTargetManager && (this.morphTargetManager = n.morphTargetManager), t.getPhysicsEngine) {
        const a = t.getPhysicsEngine();
        if (s && a)
          if (a.getPluginVersion() === 1) {
            const f = a.getImpostorForPhysicsObject(n);
            f && (this.physicsImpostor = f.clone(this));
          } else
            a.getPluginVersion() === 2 && n.physicsBody && n.physicsBody.clone(this);
      }
      for (let a = 0; a < t.particleSystems.length; a++) {
        const f = t.particleSystems[a];
        f.emitter === n && f.clone(f.name, this);
      }
      this.skeleton = n.skeleton, this.refreshBoundingInfo(!0, !0), this.computeWorldMatrix(!0);
    }
    r !== null && (this.parent = r), this._instanceDataStorage.hardwareInstancedRendering = this.getEngine().getCaps().instancedArrays, this._internalMeshDataInfo._onMeshReadyObserverAdded = (a) => {
      a.unregisterOnNextCall = !0, this.isReady(!0) ? this.onMeshReadyObservable.notifyObservers(this) : this._internalMeshDataInfo._checkReadinessObserver || (this._internalMeshDataInfo._checkReadinessObserver = this._scene.onBeforeRenderObservable.add(() => {
        this.isReady(!0) && (this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver), this._internalMeshDataInfo._checkReadinessObserver = null, this.onMeshReadyObservable.notifyObservers(this));
      }));
    }, this.onMeshReadyObservable = new Oe(this._internalMeshDataInfo._onMeshReadyObserverAdded), n && n.onClonedObservable.notifyObservers(this);
  }
  instantiateHierarchy(e = null, t, r) {
    const n = this.getTotalVertices() === 0 || t && t.doNotInstantiate && (t.doNotInstantiate === !0 || t.doNotInstantiate(this)) ? this.clone("Clone of " + (this.name || this.id), e || this.parent, !0) : this.createInstance("instance of " + (this.name || this.id));
    n.parent = e || this.parent, n.position = this.position.clone(), n.scaling = this.scaling.clone(), this.rotationQuaternion ? n.rotationQuaternion = this.rotationQuaternion.clone() : n.rotation = this.rotation.clone(), r && r(this, n);
    for (const i of this.getChildTransformNodes(!0))
      i.getClassName() === "InstancedMesh" && n.getClassName() === "Mesh" && i.sourceMesh === this ? i.instantiateHierarchy(n, {
        doNotInstantiate: t && t.doNotInstantiate || !1,
        newSourcedMesh: n
      }, r) : i.instantiateHierarchy(n, t, r);
    return n;
  }
  /**
   * Gets the class name
   * @returns the string "Mesh".
   */
  getClassName() {
    return "Mesh";
  }
  /** @internal */
  get _isMesh() {
    return !0;
  }
  /**
   * Returns a description of this mesh
   * @param fullDetails define if full details about this mesh must be used
   * @returns a descriptive string representing this mesh
   */
  toString(e) {
    let t = super.toString(e);
    if (t += ", n vertices: " + this.getTotalVertices(), t += ", parent: " + (this._waitingParentId ? this._waitingParentId : this.parent ? this.parent.name : "NONE"), this.animations)
      for (let r = 0; r < this.animations.length; r++)
        t += ", animation[0]: " + this.animations[r].toString(e);
    if (e)
      if (this._geometry) {
        const r = this.getIndices(), n = this.getVerticesData(J.PositionKind);
        n && r && (t += ", flat shading: " + (n.length / 3 === r.length ? "YES" : "NO"));
      } else
        t += ", flat shading: UNKNOWN";
    return t;
  }
  /** @internal */
  _unBindEffect() {
    super._unBindEffect();
    for (const e of this.instances)
      e._unBindEffect();
  }
  /**
   * Gets a boolean indicating if this mesh has LOD
   */
  get hasLODLevels() {
    return this._internalMeshDataInfo._LODLevels.length > 0;
  }
  /**
   * Gets the list of MeshLODLevel associated with the current mesh
   * @returns an array of MeshLODLevel
   */
  getLODLevels() {
    return this._internalMeshDataInfo._LODLevels;
  }
  _sortLODLevels() {
    const e = this._internalMeshDataInfo._useLODScreenCoverage ? -1 : 1;
    this._internalMeshDataInfo._LODLevels.sort((t, r) => t.distanceOrScreenCoverage < r.distanceOrScreenCoverage ? e : t.distanceOrScreenCoverage > r.distanceOrScreenCoverage ? -e : 0);
  }
  /**
   * Add a mesh as LOD level triggered at the given distance.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
   * @param distanceOrScreenCoverage Either distance from the center of the object to show this level or the screen coverage if `useScreenCoverage` is set to `true`.
   * If screen coverage, value is a fraction of the screen's total surface, between 0 and 1.
   * Example Playground for distance https://playground.babylonjs.com/#QE7KM#197
   * Example Playground for screen coverage https://playground.babylonjs.com/#QE7KM#196
   * @param mesh The mesh to be added as LOD level (can be null)
   * @returns This mesh (for chaining)
   */
  addLODLevel(e, t) {
    if (t && t._masterMesh)
      return Se.Warn("You cannot use a mesh as LOD level twice"), this;
    const r = new fee(e, t);
    return this._internalMeshDataInfo._LODLevels.push(r), t && (t._masterMesh = this), this._sortLODLevels(), this;
  }
  /**
   * Returns the LOD level mesh at the passed distance or null if not found.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
   * @param distance The distance from the center of the object to show this level
   * @returns a Mesh or `null`
   */
  getLODLevelAtDistance(e) {
    const t = this._internalMeshDataInfo;
    for (let r = 0; r < t._LODLevels.length; r++) {
      const n = t._LODLevels[r];
      if (n.distanceOrScreenCoverage === e)
        return n.mesh;
    }
    return null;
  }
  /**
   * Remove a mesh from the LOD array
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
   * @param mesh defines the mesh to be removed
   * @returns This mesh (for chaining)
   */
  removeLODLevel(e) {
    const t = this._internalMeshDataInfo;
    for (let r = 0; r < t._LODLevels.length; r++)
      t._LODLevels[r].mesh === e && (t._LODLevels.splice(r, 1), e && (e._masterMesh = null));
    return this._sortLODLevels(), this;
  }
  /**
   * Returns the registered LOD mesh distant from the parameter `camera` position if any, else returns the current mesh.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
   * @param camera defines the camera to use to compute distance
   * @param boundingSphere defines a custom bounding sphere to use instead of the one from this mesh
   * @returns This mesh (for chaining)
   */
  getLOD(e, t) {
    const r = this._internalMeshDataInfo;
    if (!r._LODLevels || r._LODLevels.length === 0)
      return this;
    const n = t || this.getBoundingInfo().boundingSphere, i = e.mode === Tr.ORTHOGRAPHIC_CAMERA ? e.minZ : n.centerWorld.subtract(e.globalPosition).length();
    let s = i, a = 1;
    if (r._useLODScreenCoverage) {
      const f = e.screenArea;
      let o = n.radiusWorld * e.minZ / i;
      o = o * o * Math.PI, s = o / f, a = -1;
    }
    if (a * r._LODLevels[r._LODLevels.length - 1].distanceOrScreenCoverage > a * s)
      return this.onLODLevelSelection && this.onLODLevelSelection(s, this, this), this;
    for (let f = 0; f < r._LODLevels.length; f++) {
      const o = r._LODLevels[f];
      if (a * o.distanceOrScreenCoverage < a * s) {
        if (o.mesh) {
          if (o.mesh.delayLoadState === 4)
            return o.mesh._checkDelayState(), this;
          if (o.mesh.delayLoadState === 2)
            return this;
          o.mesh._preActivate(), o.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache);
        }
        return this.onLODLevelSelection && this.onLODLevelSelection(s, this, o.mesh), o.mesh;
      }
    }
    return this.onLODLevelSelection && this.onLODLevelSelection(s, this, this), this;
  }
  /**
   * Gets the mesh internal Geometry object
   */
  get geometry() {
    return this._geometry;
  }
  /**
   * Returns the total number of vertices within the mesh geometry or zero if the mesh has no geometry.
   * @returns the total number of vertices
   */
  getTotalVertices() {
    return this._geometry === null || this._geometry === void 0 ? 0 : this._geometry.getTotalVertices();
  }
  /**
   * Returns the content of an associated vertex buffer
   * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values :
   * - VertexBuffer.PositionKind
   * - VertexBuffer.UVKind
   * - VertexBuffer.UV2Kind
   * - VertexBuffer.UV3Kind
   * - VertexBuffer.UV4Kind
   * - VertexBuffer.UV5Kind
   * - VertexBuffer.UV6Kind
   * - VertexBuffer.ColorKind
   * - VertexBuffer.MatricesIndicesKind
   * - VertexBuffer.MatricesIndicesExtraKind
   * - VertexBuffer.MatricesWeightsKind
   * - VertexBuffer.MatricesWeightsExtraKind
   * @param copyWhenShared defines a boolean indicating that if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one
   * @param forceCopy defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
   * @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
   * @returns a FloatArray or null if the mesh has no geometry or no vertex buffer for this kind.
   */
  getVerticesData(e, t, r, n) {
    var i, s;
    if (!this._geometry)
      return null;
    let a = n || (s = (i = this._userInstancedBuffersStorage) === null || i === void 0 ? void 0 : i.vertexBuffers[e]) === null || s === void 0 ? void 0 : s.getFloatData(
      this.instances.length + 1,
      // +1 because the master mesh is not included in the instances array
      r || t && this._geometry.meshes.length !== 1
    );
    return a || (a = this._geometry.getVerticesData(e, t, r)), a;
  }
  /**
   * Returns the mesh VertexBuffer object from the requested `kind`
   * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values :
   * - VertexBuffer.PositionKind
   * - VertexBuffer.NormalKind
   * - VertexBuffer.UVKind
   * - VertexBuffer.UV2Kind
   * - VertexBuffer.UV3Kind
   * - VertexBuffer.UV4Kind
   * - VertexBuffer.UV5Kind
   * - VertexBuffer.UV6Kind
   * - VertexBuffer.ColorKind
   * - VertexBuffer.MatricesIndicesKind
   * - VertexBuffer.MatricesIndicesExtraKind
   * - VertexBuffer.MatricesWeightsKind
   * - VertexBuffer.MatricesWeightsExtraKind
   * @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
   * @returns a FloatArray or null if the mesh has no vertex buffer for this kind.
   */
  getVertexBuffer(e, t) {
    var r, n;
    return this._geometry ? (n = t || (r = this._userInstancedBuffersStorage) === null || r === void 0 ? void 0 : r.vertexBuffers[e]) !== null && n !== void 0 ? n : this._geometry.getVertexBuffer(e) : null;
  }
  /**
   * Tests if a specific vertex buffer is associated with this mesh
   * @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values :
   * - VertexBuffer.PositionKind
   * - VertexBuffer.NormalKind
   * - VertexBuffer.UVKind
   * - VertexBuffer.UV2Kind
   * - VertexBuffer.UV3Kind
   * - VertexBuffer.UV4Kind
   * - VertexBuffer.UV5Kind
   * - VertexBuffer.UV6Kind
   * - VertexBuffer.ColorKind
   * - VertexBuffer.MatricesIndicesKind
   * - VertexBuffer.MatricesIndicesExtraKind
   * - VertexBuffer.MatricesWeightsKind
   * - VertexBuffer.MatricesWeightsExtraKind
   * @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
   * @returns a boolean
   */
  isVerticesDataPresent(e, t) {
    var r;
    return this._geometry ? !t && ((r = this._userInstancedBuffersStorage) === null || r === void 0 ? void 0 : r.vertexBuffers[e]) !== void 0 || this._geometry.isVerticesDataPresent(e) : this._delayInfo ? this._delayInfo.indexOf(e) !== -1 : !1;
  }
  /**
   * Returns a boolean defining if the vertex data for the requested `kind` is updatable.
   * @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values :
   * - VertexBuffer.PositionKind
   * - VertexBuffer.UVKind
   * - VertexBuffer.UV2Kind
   * - VertexBuffer.UV3Kind
   * - VertexBuffer.UV4Kind
   * - VertexBuffer.UV5Kind
   * - VertexBuffer.UV6Kind
   * - VertexBuffer.ColorKind
   * - VertexBuffer.MatricesIndicesKind
   * - VertexBuffer.MatricesIndicesExtraKind
   * - VertexBuffer.MatricesWeightsKind
   * - VertexBuffer.MatricesWeightsExtraKind
   * @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
   * @returns a boolean
   */
  isVertexBufferUpdatable(e, t) {
    var r;
    if (!this._geometry)
      return this._delayInfo ? this._delayInfo.indexOf(e) !== -1 : !1;
    if (!t) {
      const n = (r = this._userInstancedBuffersStorage) === null || r === void 0 ? void 0 : r.vertexBuffers[e];
      if (n)
        return n.isUpdatable();
    }
    return this._geometry.isVertexBufferUpdatable(e);
  }
  /**
   * Returns a string which contains the list of existing `kinds` of Vertex Data associated with this mesh.
   * @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
   * @returns an array of strings
   */
  getVerticesDataKinds(e) {
    if (!this._geometry) {
      const r = [];
      return this._delayInfo && this._delayInfo.forEach(function(n) {
        r.push(n);
      }), r;
    }
    const t = this._geometry.getVerticesDataKinds();
    if (!e && this._userInstancedBuffersStorage)
      for (const r in this._userInstancedBuffersStorage.vertexBuffers)
        t.indexOf(r) === -1 && t.push(r);
    return t;
  }
  /**
   * Returns a positive integer : the total number of indices in this mesh geometry.
   * @returns the numner of indices or zero if the mesh has no geometry.
   */
  getTotalIndices() {
    return this._geometry ? this._geometry.getTotalIndices() : 0;
  }
  /**
   * Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
   * @param copyWhenShared If true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one.
   * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
   * @returns the indices array or an empty array if the mesh has no geometry
   */
  getIndices(e, t) {
    return this._geometry ? this._geometry.getIndices(e, t) : [];
  }
  get isBlocked() {
    return this._masterMesh !== null && this._masterMesh !== void 0;
  }
  /**
   * Determine if the current mesh is ready to be rendered
   * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
   * @param forceInstanceSupport will check if the mesh will be ready when used with instances (false by default)
   * @returns true if all associated assets are ready (material, textures, shaders)
   */
  isReady(e = !1, t = !1) {
    var r, n, i, s, a, f, o;
    if (this.delayLoadState === 2 || !super.isReady(e))
      return !1;
    if (!this.subMeshes || this.subMeshes.length === 0 || !e)
      return !0;
    const d = this.getEngine(), v = this.getScene(), u = t || d.getCaps().instancedArrays && (this.instances.length > 0 || this.hasThinInstances);
    this.computeWorldMatrix();
    const l = this.material || v.defaultMaterial;
    if (l) {
      if (l._storeEffectOnSubMeshes)
        for (const p of this.subMeshes) {
          const c = p.getMaterial();
          if (c) {
            if (c._storeEffectOnSubMeshes) {
              if (!c.isReadyForSubMesh(this, p, u))
                return !1;
            } else if (!c.isReady(this, u))
              return !1;
          }
        }
      else if (!l.isReady(this, u))
        return !1;
    }
    const P = d.currentRenderPassId;
    for (const p of this.lightSources) {
      const c = p.getShadowGenerators();
      if (!c)
        continue;
      const H = c.values();
      for (let T = H.next(); T.done !== !0; T = H.next()) {
        const q = T.value;
        if (q && (!(!((r = q.getShadowMap()) === null || r === void 0) && r.renderList) || !((n = q.getShadowMap()) === null || n === void 0) && n.renderList && ((s = (i = q.getShadowMap()) === null || i === void 0 ? void 0 : i.renderList) === null || s === void 0 ? void 0 : s.indexOf(this)) !== -1)) {
          const j = (a = q.getShadowMap().renderPassIds) !== null && a !== void 0 ? a : [d.currentRenderPassId];
          for (let w = 0; w < j.length; ++w) {
            d.currentRenderPassId = j[w];
            for (const m of this.subMeshes)
              if (!q.isReady(m, u, (o = (f = m.getMaterial()) === null || f === void 0 ? void 0 : f.needAlphaBlendingForMesh(this)) !== null && o !== void 0 ? o : !1))
                return d.currentRenderPassId = P, !1;
          }
          d.currentRenderPassId = P;
        }
      }
    }
    for (const p of this._internalMeshDataInfo._LODLevels)
      if (p.mesh && !p.mesh.isReady(u))
        return !1;
    return !0;
  }
  /**
   * Gets a boolean indicating if the normals aren't to be recomputed on next mesh `positions` array update. This property is pertinent only for updatable parametric shapes.
   */
  get areNormalsFrozen() {
    return this._internalMeshDataInfo._areNormalsFrozen;
  }
  /**
   * This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It prevents the mesh normals from being recomputed on next `positions` array update.
   * @returns the current mesh
   */
  freezeNormals() {
    return this._internalMeshDataInfo._areNormalsFrozen = !0, this;
  }
  /**
   * This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It reactivates the mesh normals computation if it was previously frozen
   * @returns the current mesh
   */
  unfreezeNormals() {
    return this._internalMeshDataInfo._areNormalsFrozen = !1, this;
  }
  /**
   * Sets a value overriding the instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs
   */
  set overridenInstanceCount(e) {
    this._instanceDataStorage.overridenInstanceCount = e;
  }
  // Methods
  /** @internal */
  _preActivate() {
    const e = this._internalMeshDataInfo, t = this.getScene().getRenderId();
    return e._preActivateId === t ? this : (e._preActivateId = t, this._instanceDataStorage.visibleInstances = null, this);
  }
  /**
   * @internal
   */
  _preActivateForIntermediateRendering(e) {
    return this._instanceDataStorage.visibleInstances && (this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId = e), this;
  }
  /**
   * @internal
   */
  _registerInstanceForRenderId(e, t) {
    return this._instanceDataStorage.visibleInstances || (this._instanceDataStorage.visibleInstances = {
      defaultRenderId: t,
      selfDefaultRenderId: this._renderId
    }), this._instanceDataStorage.visibleInstances[t] || (this._instanceDataStorage.previousRenderId !== void 0 && this._instanceDataStorage.isFrozen && (this._instanceDataStorage.visibleInstances[this._instanceDataStorage.previousRenderId] = null), this._instanceDataStorage.previousRenderId = t, this._instanceDataStorage.visibleInstances[t] = new Array()), this._instanceDataStorage.visibleInstances[t].push(e), this;
  }
  _afterComputeWorldMatrix() {
    super._afterComputeWorldMatrix(), this.hasThinInstances && (this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1));
  }
  /** @internal */
  _postActivate() {
    this.edgesShareWithInstances && this.edgesRenderer && this.edgesRenderer.isEnabled && this._renderingGroup && (this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer), this.edgesRenderer.customInstances.push(this.getWorldMatrix()));
  }
  /**
   * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
   * This means the mesh underlying bounding box and sphere are recomputed.
   * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
   * @param applyMorph  defines whether to apply the morph target before computing the bounding info
   * @returns the current mesh
   */
  refreshBoundingInfo(e = !1, t = !1) {
    if (this.hasBoundingInfo && this.getBoundingInfo().isLocked)
      return this;
    const r = this.geometry ? this.geometry.boundingBias : null;
    return this._refreshBoundingInfo(this._getPositionData(e, t), r), this;
  }
  /**
   * @internal
   */
  _createGlobalSubMesh(e) {
    const t = this.getTotalVertices();
    if (!t || !this.getIndices())
      return null;
    if (this.subMeshes && this.subMeshes.length > 0) {
      const r = this.getIndices();
      if (!r)
        return null;
      const n = r.length;
      let i = !1;
      if (e)
        i = !0;
      else
        for (const s of this.subMeshes) {
          if (s.indexStart + s.indexCount > n) {
            i = !0;
            break;
          }
          if (s.verticesStart + s.verticesCount > t) {
            i = !0;
            break;
          }
        }
      if (!i)
        return this.subMeshes[0];
    }
    return this.releaseSubMeshes(), new rA(0, 0, t, 0, this.getTotalIndices(), this);
  }
  /**
   * This function will subdivide the mesh into multiple submeshes
   * @param count defines the expected number of submeshes
   */
  subdivide(e) {
    if (e < 1)
      return;
    const t = this.getTotalIndices();
    let r = t / e | 0, n = 0;
    for (; r % 3 !== 0; )
      r++;
    this.releaseSubMeshes();
    for (let i = 0; i < e && !(n >= t); i++)
      rA.CreateFromIndices(0, n, i === e - 1 ? t - n : r, this, void 0, !1), n += r;
    this.refreshBoundingInfo(), this.synchronizeInstances();
  }
  /**
   * Copy a FloatArray into a specific associated vertex buffer
   * @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values :
   * - VertexBuffer.PositionKind
   * - VertexBuffer.UVKind
   * - VertexBuffer.UV2Kind
   * - VertexBuffer.UV3Kind
   * - VertexBuffer.UV4Kind
   * - VertexBuffer.UV5Kind
   * - VertexBuffer.UV6Kind
   * - VertexBuffer.ColorKind
   * - VertexBuffer.MatricesIndicesKind
   * - VertexBuffer.MatricesIndicesExtraKind
   * - VertexBuffer.MatricesWeightsKind
   * - VertexBuffer.MatricesWeightsExtraKind
   * @param data defines the data source
   * @param updatable defines if the updated vertex buffer must be flagged as updatable
   * @param stride defines the data stride size (can be null)
   * @returns the current mesh
   */
  setVerticesData(e, t, r = !1, n) {
    if (this._geometry)
      this._geometry.setVerticesData(e, t, r, n);
    else {
      const i = new Ut();
      i.set(t, e);
      const s = this.getScene();
      new Tf(Tf.RandomId(), s, i, r, this);
    }
    return this;
  }
  /**
   * Delete a vertex buffer associated with this mesh
   * @param kind defines which buffer to delete (positions, indices, normals, etc). Possible `kind` values :
   * - VertexBuffer.PositionKind
   * - VertexBuffer.UVKind
   * - VertexBuffer.UV2Kind
   * - VertexBuffer.UV3Kind
   * - VertexBuffer.UV4Kind
   * - VertexBuffer.UV5Kind
   * - VertexBuffer.UV6Kind
   * - VertexBuffer.ColorKind
   * - VertexBuffer.MatricesIndicesKind
   * - VertexBuffer.MatricesIndicesExtraKind
   * - VertexBuffer.MatricesWeightsKind
   * - VertexBuffer.MatricesWeightsExtraKind
   */
  removeVerticesData(e) {
    this._geometry && this._geometry.removeVerticesData(e);
  }
  /**
   * Flags an associated vertex buffer as updatable
   * @param kind defines which buffer to use (positions, indices, normals, etc). Possible `kind` values :
   * - VertexBuffer.PositionKind
   * - VertexBuffer.UVKind
   * - VertexBuffer.UV2Kind
   * - VertexBuffer.UV3Kind
   * - VertexBuffer.UV4Kind
   * - VertexBuffer.UV5Kind
   * - VertexBuffer.UV6Kind
   * - VertexBuffer.ColorKind
   * - VertexBuffer.MatricesIndicesKind
   * - VertexBuffer.MatricesIndicesExtraKind
   * - VertexBuffer.MatricesWeightsKind
   * - VertexBuffer.MatricesWeightsExtraKind
   * @param updatable defines if the updated vertex buffer must be flagged as updatable
   */
  markVerticesDataAsUpdatable(e, t = !0) {
    const r = this.getVertexBuffer(e);
    !r || r.isUpdatable() === t || this.setVerticesData(e, this.getVerticesData(e), t);
  }
  /**
   * Sets the mesh global Vertex Buffer
   * @param buffer defines the buffer to use
   * @param disposeExistingBuffer disposes the existing buffer, if any (default: true)
   * @returns the current mesh
   */
  setVerticesBuffer(e, t = !0) {
    return this._geometry || (this._geometry = Tf.CreateGeometryForMesh(this)), this._geometry.setVerticesBuffer(e, null, t), this;
  }
  /**
   * Update a specific associated vertex buffer
   * @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values :
   * - VertexBuffer.PositionKind
   * - VertexBuffer.UVKind
   * - VertexBuffer.UV2Kind
   * - VertexBuffer.UV3Kind
   * - VertexBuffer.UV4Kind
   * - VertexBuffer.UV5Kind
   * - VertexBuffer.UV6Kind
   * - VertexBuffer.ColorKind
   * - VertexBuffer.MatricesIndicesKind
   * - VertexBuffer.MatricesIndicesExtraKind
   * - VertexBuffer.MatricesWeightsKind
   * - VertexBuffer.MatricesWeightsExtraKind
   * @param data defines the data source
   * @param updateExtends defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
   * @param makeItUnique defines if the geometry associated with the mesh must be cloned to make the change only for this mesh (and not all meshes associated with the same geometry)
   * @returns the current mesh
   */
  updateVerticesData(e, t, r, n) {
    return this._geometry ? (n ? (this.makeGeometryUnique(), this.updateVerticesData(e, t, r, !1)) : this._geometry.updateVerticesData(e, t, r), this) : this;
  }
  /**
   * This method updates the vertex positions of an updatable mesh according to the `positionFunction` returned values.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#other-shapes-updatemeshpositions
   * @param positionFunction is a simple JS function what is passed the mesh `positions` array. It doesn't need to return anything
   * @param computeNormals is a boolean (default true) to enable/disable the mesh normal recomputation after the vertex position update
   * @returns the current mesh
   */
  updateMeshPositions(e, t = !0) {
    const r = this.getVerticesData(J.PositionKind);
    if (!r)
      return this;
    if (e(r), this.updateVerticesData(J.PositionKind, r, !1, !1), t) {
      const n = this.getIndices(), i = this.getVerticesData(J.NormalKind);
      if (!i)
        return this;
      Ut.ComputeNormals(r, n, i), this.updateVerticesData(J.NormalKind, i, !1, !1);
    }
    return this;
  }
  /**
   * Creates a un-shared specific occurence of the geometry for the mesh.
   * @returns the current mesh
   */
  makeGeometryUnique() {
    if (!this._geometry)
      return this;
    if (this._geometry.meshes.length === 1)
      return this;
    const e = this._geometry, t = this._geometry.copy(Tf.RandomId());
    return e.releaseForMesh(this, !0), t.applyToMesh(this), this;
  }
  /**
   * Sets the index buffer of this mesh.
   * @param indexBuffer Defines the index buffer to use for this mesh
   * @param totalVertices Defines the total number of vertices used by the buffer
   * @param totalIndices Defines the total number of indices in the index buffer
   */
  setIndexBuffer(e, t, r) {
    let n = this._geometry;
    n || (n = new Tf(Tf.RandomId(), this.getScene(), void 0, void 0, this)), n.setIndexBuffer(e, t, r);
  }
  /**
   * Set the index buffer of this mesh
   * @param indices defines the source data
   * @param totalVertices defines the total number of vertices referenced by this index data (can be null)
   * @param updatable defines if the updated index buffer must be flagged as updatable (default is false)
   * @returns the current mesh
   */
  setIndices(e, t = null, r = !1) {
    if (this._geometry)
      this._geometry.setIndices(e, t, r);
    else {
      const n = new Ut();
      n.indices = e;
      const i = this.getScene();
      new Tf(Tf.RandomId(), i, n, r, this);
    }
    return this;
  }
  /**
   * Update the current index buffer
   * @param indices defines the source data
   * @param offset defines the offset in the index buffer where to store the new data (can be null)
   * @param gpuMemoryOnly defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
   * @returns the current mesh
   */
  updateIndices(e, t, r = !1) {
    return this._geometry ? (this._geometry.updateIndices(e, t, r), this) : this;
  }
  /**
   * Invert the geometry to move from a right handed system to a left handed one.
   * @returns the current mesh
   */
  toLeftHanded() {
    return this._geometry ? (this._geometry.toLeftHanded(), this) : this;
  }
  /**
   * @internal
   */
  _bind(e, t, r, n = !0) {
    if (!this._geometry)
      return this;
    const i = this.getScene().getEngine();
    this.morphTargetManager && this.morphTargetManager.isUsingTextureForTargets && this.morphTargetManager._bind(t);
    let s;
    if (this._unIndexed)
      s = null;
    else
      switch (this._getRenderingFillMode(r)) {
        case gt.PointFillMode:
          s = null;
          break;
        case gt.WireFrameFillMode:
          s = e._getLinesIndexBuffer(this.getIndices(), i);
          break;
        default:
        case gt.TriangleFillMode:
          s = this._geometry.getIndexBuffer();
          break;
      }
    return !n || !this._userInstancedBuffersStorage || this.hasThinInstances ? this._geometry._bind(t, s) : this._geometry._bind(t, s, this._userInstancedBuffersStorage.vertexBuffers, this._userInstancedBuffersStorage.vertexArrayObjects), this;
  }
  /**
   * @internal
   */
  _draw(e, t, r) {
    if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())
      return this;
    this._internalMeshDataInfo._onBeforeDrawObservable && this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);
    const i = this.getScene().getEngine();
    return this._unIndexed || t == gt.PointFillMode ? i.drawArraysType(t, e.verticesStart, e.verticesCount, this.forcedInstanceCount || r) : t == gt.WireFrameFillMode ? i.drawElementsType(t, 0, e._linesIndexCount, this.forcedInstanceCount || r) : i.drawElementsType(t, e.indexStart, e.indexCount, this.forcedInstanceCount || r), this;
  }
  /**
   * Registers for this mesh a javascript function called just before the rendering process
   * @param func defines the function to call before rendering this mesh
   * @returns the current mesh
   */
  registerBeforeRender(e) {
    return this.onBeforeRenderObservable.add(e), this;
  }
  /**
   * Disposes a previously registered javascript function called before the rendering
   * @param func defines the function to remove
   * @returns the current mesh
   */
  unregisterBeforeRender(e) {
    return this.onBeforeRenderObservable.removeCallback(e), this;
  }
  /**
   * Registers for this mesh a javascript function called just after the rendering is complete
   * @param func defines the function to call after rendering this mesh
   * @returns the current mesh
   */
  registerAfterRender(e) {
    return this.onAfterRenderObservable.add(e), this;
  }
  /**
   * Disposes a previously registered javascript function called after the rendering.
   * @param func defines the function to remove
   * @returns the current mesh
   */
  unregisterAfterRender(e) {
    return this.onAfterRenderObservable.removeCallback(e), this;
  }
  /**
   * @internal
   */
  _getInstancesRenderList(e, t = !1) {
    if (this._instanceDataStorage.isFrozen) {
      if (t)
        return this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[e] = !1, this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.renderSelf[e] = !0, this._instanceDataStorage.batchCacheReplacementModeInFrozenMode;
      if (this._instanceDataStorage.previousBatch)
        return this._instanceDataStorage.previousBatch;
    }
    const r = this.getScene(), n = r._isInIntermediateRendering(), i = n ? this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate : this._internalAbstractMeshDataInfo._onlyForInstances, s = this._instanceDataStorage.batchCache;
    if (s.mustReturn = !1, s.renderSelf[e] = t || !i && this.isEnabled() && this.isVisible, s.visibleInstances[e] = null, this._instanceDataStorage.visibleInstances && !t) {
      const a = this._instanceDataStorage.visibleInstances, f = r.getRenderId(), o = n ? a.intermediateDefaultRenderId : a.defaultRenderId;
      s.visibleInstances[e] = a[f], !s.visibleInstances[e] && o && (s.visibleInstances[e] = a[o]);
    }
    return s.hardwareInstancedRendering[e] = !t && this._instanceDataStorage.hardwareInstancedRendering && s.visibleInstances[e] !== null && s.visibleInstances[e] !== void 0, this._instanceDataStorage.previousBatch = s, s;
  }
  /**
   * @internal
   */
  _renderWithInstances(e, t, r, n, i) {
    var s;
    const a = r.visibleInstances[e._id], f = a ? a.length : 0, o = this._instanceDataStorage, d = o.instancesBufferSize;
    let v = o.instancesBuffer, u = o.instancesPreviousBuffer;
    const P = (f + 1) * 16 * 4;
    for (; o.instancesBufferSize < P; )
      o.instancesBufferSize *= 2;
    (!o.instancesData || d != o.instancesBufferSize) && (o.instancesData = new Float32Array(o.instancesBufferSize / 4)), (this._scene.needsPreviousWorldMatrices && !o.instancesPreviousData || d != o.instancesBufferSize) && (o.instancesPreviousData = new Float32Array(o.instancesBufferSize / 4));
    let p = 0, c = 0;
    const H = r.renderSelf[e._id], T = !v || d !== o.instancesBufferSize || this._scene.needsPreviousWorldMatrices && !o.instancesPreviousBuffer;
    if (!this._instanceDataStorage.manualUpdate && (!o.isFrozen || T)) {
      const q = this.getWorldMatrix();
      if (H && (this._scene.needsPreviousWorldMatrices && (o.masterMeshPreviousWorldMatrix ? (o.masterMeshPreviousWorldMatrix.copyToArray(o.instancesPreviousData, p), o.masterMeshPreviousWorldMatrix.copyFrom(q)) : (o.masterMeshPreviousWorldMatrix = q.clone(), o.masterMeshPreviousWorldMatrix.copyToArray(o.instancesPreviousData, p))), q.copyToArray(o.instancesData, p), p += 16, c++), a) {
        if (Ee.INSTANCEDMESH_SORT_TRANSPARENT && this._scene.activeCamera && (!((s = e.getMaterial()) === null || s === void 0) && s.needAlphaBlendingForMesh(e.getRenderingMesh()))) {
          const b = this._scene.activeCamera.globalPosition;
          for (let j = 0; j < a.length; j++) {
            const w = a[j];
            w._distanceToCamera = S.Distance(w.getBoundingInfo().boundingSphere.centerWorld, b);
          }
          a.sort((j, w) => j._distanceToCamera > w._distanceToCamera ? -1 : j._distanceToCamera < w._distanceToCamera ? 1 : 0);
        }
        for (let b = 0; b < a.length; b++) {
          const j = a[b], w = j.getWorldMatrix();
          w.copyToArray(o.instancesData, p), this._scene.needsPreviousWorldMatrices && (j._previousWorldMatrix ? (j._previousWorldMatrix.copyToArray(o.instancesPreviousData, p), j._previousWorldMatrix.copyFrom(w)) : (j._previousWorldMatrix = w.clone(), j._previousWorldMatrix.copyToArray(o.instancesPreviousData, p))), p += 16, c++;
        }
      }
    } else
      c = (H ? 1 : 0) + f;
    return T ? (v && v.dispose(), u && u.dispose(), v = new P9(i, o.instancesData, !0, 16, !1, !0), o.instancesBuffer = v, this._userInstancedBuffersStorage || (this._userInstancedBuffersStorage = {
      data: {},
      vertexBuffers: {},
      strides: {},
      sizes: {},
      vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : void 0
    }), this._userInstancedBuffersStorage.vertexBuffers.world0 = v.createVertexBuffer("world0", 0, 4), this._userInstancedBuffersStorage.vertexBuffers.world1 = v.createVertexBuffer("world1", 4, 4), this._userInstancedBuffersStorage.vertexBuffers.world2 = v.createVertexBuffer("world2", 8, 4), this._userInstancedBuffersStorage.vertexBuffers.world3 = v.createVertexBuffer("world3", 12, 4), this._scene.needsPreviousWorldMatrices && (u = new P9(i, o.instancesPreviousData, !0, 16, !1, !0), o.instancesPreviousBuffer = u, this._userInstancedBuffersStorage.vertexBuffers.previousWorld0 = u.createVertexBuffer("previousWorld0", 0, 4), this._userInstancedBuffersStorage.vertexBuffers.previousWorld1 = u.createVertexBuffer("previousWorld1", 4, 4), this._userInstancedBuffersStorage.vertexBuffers.previousWorld2 = u.createVertexBuffer("previousWorld2", 8, 4), this._userInstancedBuffersStorage.vertexBuffers.previousWorld3 = u.createVertexBuffer("previousWorld3", 12, 4)), this._invalidateInstanceVertexArrayObject()) : (!this._instanceDataStorage.isFrozen || this._instanceDataStorage.forceMatrixUpdates) && (v.updateDirectly(o.instancesData, 0, c), this._scene.needsPreviousWorldMatrices && (!this._instanceDataStorage.manualUpdate || this._instanceDataStorage.previousManualUpdate) && u.updateDirectly(o.instancesPreviousData, 0, c)), this._processInstancedBuffers(a, H), this.getScene()._activeIndices.addCount(e.indexCount * c, !1), i._currentDrawContext && (i._currentDrawContext.useInstancing = !0), this._bind(e, n, t), this._draw(e, t, c), this._scene.needsPreviousWorldMatrices && !T && this._instanceDataStorage.manualUpdate && (!this._instanceDataStorage.isFrozen || this._instanceDataStorage.forceMatrixUpdates) && !this._instanceDataStorage.previousManualUpdate && u.updateDirectly(o.instancesData, 0, c), i.unbindInstanceAttributes(), this;
  }
  /**
   * @internal
   */
  _renderWithThinInstances(e, t, r, n) {
    var i, s;
    const a = (s = (i = this._thinInstanceDataStorage) === null || i === void 0 ? void 0 : i.instancesCount) !== null && s !== void 0 ? s : 0;
    this.getScene()._activeIndices.addCount(e.indexCount * a, !1), n._currentDrawContext && (n._currentDrawContext.useInstancing = !0), this._bind(e, r, t), this._draw(e, t, a), this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData && this._thinInstanceDataStorage.matrixData && (this._thinInstanceDataStorage.previousMatrixBuffer ? this._thinInstanceDataStorage.previousMatrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, a) : this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", this._thinInstanceDataStorage.matrixData, !1)), n.unbindInstanceAttributes();
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _processInstancedBuffers(e, t) {
  }
  /**
   * @internal
   */
  _processRendering(e, t, r, n, i, s, a, f) {
    const o = this.getScene(), d = o.getEngine();
    if (n = this._getRenderingFillMode(n), s && t.getRenderingMesh().hasThinInstances)
      return this._renderWithThinInstances(t, n, r, d), this;
    if (s)
      this._renderWithInstances(t, n, i, r, d);
    else {
      d._currentDrawContext && (d._currentDrawContext.useInstancing = !1);
      let v = 0;
      i.renderSelf[t._id] && (a && a(!1, e.getWorldMatrix(), f), v++, this._draw(t, n, this._instanceDataStorage.overridenInstanceCount));
      const u = i.visibleInstances[t._id];
      if (u) {
        const l = u.length;
        v += l;
        for (let P = 0; P < l; P++) {
          const c = u[P].getWorldMatrix();
          a && a(!0, c, f), this._draw(t, n);
        }
      }
      o._activeIndices.addCount(t.indexCount * v, !1);
    }
    return this;
  }
  /**
   * @internal
   */
  _rebuild(e = !1) {
    if (this._instanceDataStorage.instancesBuffer && (e && this._instanceDataStorage.instancesBuffer.dispose(), this._instanceDataStorage.instancesBuffer = null), this._userInstancedBuffersStorage) {
      for (const t in this._userInstancedBuffersStorage.vertexBuffers) {
        const r = this._userInstancedBuffersStorage.vertexBuffers[t];
        r && (e && r.dispose(), this._userInstancedBuffersStorage.vertexBuffers[t] = null);
      }
      this._userInstancedBuffersStorage.vertexArrayObjects && (this._userInstancedBuffersStorage.vertexArrayObjects = {});
    }
    this._internalMeshDataInfo._effectiveMaterial = null, super._rebuild(e);
  }
  /** @internal */
  _freeze() {
    if (this.subMeshes) {
      for (let e = 0; e < this.subMeshes.length; e++)
        this._getInstancesRenderList(e);
      this._internalMeshDataInfo._effectiveMaterial = null, this._instanceDataStorage.isFrozen = !0;
    }
  }
  /** @internal */
  _unFreeze() {
    this._instanceDataStorage.isFrozen = !1, this._instanceDataStorage.previousBatch = null;
  }
  /**
   * Triggers the draw call for the mesh (or a submesh), for a specific render pass id
   * @param renderPassId defines the render pass id to use to draw the mesh / submesh. If not provided, use the current renderPassId of the engine.
   * @param enableAlphaMode defines if alpha mode can be changed (default: false)
   * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering (default: undefined)
   * @param subMesh defines the subMesh to render. If not provided, draw all mesh submeshes (default: undefined)
   * @param checkFrustumCulling defines if frustum culling must be checked (default: true). If you know the mesh is in the frustum (or if you don't care!), you can pass false to optimize.
   * @returns the current mesh
   */
  renderWithRenderPassId(e, t, r, n, i = !0) {
    const s = this._scene.getEngine(), a = s.currentRenderPassId;
    if (e !== void 0 && (s.currentRenderPassId = e), n)
      (!i || i && n.isInFrustum(this._scene._frustumPlanes)) && this.render(n, !!t, r);
    else
      for (let f = 0; f < this.subMeshes.length; f++) {
        const o = this.subMeshes[f];
        (!i || i && o.isInFrustum(this._scene._frustumPlanes)) && this.render(o, !!t, r);
      }
    return e !== void 0 && (s.currentRenderPassId = a), this;
  }
  /**
   * Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager
   * @param subMesh defines the subMesh to render
   * @param enableAlphaMode defines if alpha mode can be changed
   * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering
   * @returns the current mesh
   */
  render(e, t, r) {
    var n, i, s, a, f;
    const o = this.getScene();
    this._internalAbstractMeshDataInfo._isActiveIntermediate ? this._internalAbstractMeshDataInfo._isActiveIntermediate = !1 : this._internalAbstractMeshDataInfo._isActive = !1;
    const d = (i = (n = o.activeCameras) === null || n === void 0 ? void 0 : n.length) !== null && i !== void 0 ? i : 0;
    if ((d > 1 && o.activeCamera === o.activeCameras[0] || d <= 1) && this._checkOcclusionQuery() && !this._occlusionDataStorage.forceRenderingWhenOccluded)
      return this;
    const u = this._getInstancesRenderList(e._id, !!r);
    if (u.mustReturn)
      return this;
    if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())
      return this;
    const l = o.getEngine();
    let P = 0, p = null;
    this.ignoreCameraMaxZ && o.activeCamera && !o._isInIntermediateRendering() && (P = o.activeCamera.maxZ, p = o.activeCamera, o.activeCamera.maxZ = 0, o.updateTransformMatrix(!0)), this._internalMeshDataInfo._onBeforeRenderObservable && this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);
    const c = e.getRenderingMesh(), H = u.hardwareInstancedRendering[e._id] || c.hasThinInstances || !!this._userInstancedBuffersStorage && !e.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh, T = this._instanceDataStorage, q = e.getMaterial();
    if (!q)
      return p && (p.maxZ = P, o.updateTransformMatrix(!0)), this;
    if (!T.isFrozen || !this._internalMeshDataInfo._effectiveMaterial || this._internalMeshDataInfo._effectiveMaterial !== q) {
      if (q._storeEffectOnSubMeshes) {
        if (!q.isReadyForSubMesh(this, e, H))
          return p && (p.maxZ = P, o.updateTransformMatrix(!0)), this;
      } else if (!q.isReady(this, H))
        return p && (p.maxZ = P, o.updateTransformMatrix(!0)), this;
      this._internalMeshDataInfo._effectiveMaterial = q;
    } else if (q._storeEffectOnSubMeshes && !(!((s = e.effect) === null || s === void 0) && s._wasPreviouslyReady) || !q._storeEffectOnSubMeshes && !(!((a = q.getEffect()) === null || a === void 0) && a._wasPreviouslyReady))
      return p && (p.maxZ = P, o.updateTransformMatrix(!0)), this;
    t && l.setAlphaMode(this._internalMeshDataInfo._effectiveMaterial.alphaMode);
    let b;
    this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes ? b = e._drawWrapper : b = this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();
    const j = (f = b == null ? void 0 : b.effect) !== null && f !== void 0 ? f : null;
    for (const y of o._beforeRenderingMeshStage)
      y.action(this, e, u, j);
    if (!b || !j)
      return p && (p.maxZ = P, o.updateTransformMatrix(!0)), this;
    const w = r || this;
    let m;
    if (!T.isFrozen && (this._internalMeshDataInfo._effectiveMaterial.backFaceCulling || this.overrideMaterialSideOrientation !== null || this._internalMeshDataInfo._effectiveMaterial.twoSidedLighting)) {
      const y = w._getWorldMatrixDeterminant();
      m = this.overrideMaterialSideOrientation, m == null && (m = this._internalMeshDataInfo._effectiveMaterial.sideOrientation), y < 0 && (m = m === gt.ClockWiseSideOrientation ? gt.CounterClockWiseSideOrientation : gt.ClockWiseSideOrientation), T.sideOrientation = m;
    } else
      m = T.sideOrientation;
    const I = this._internalMeshDataInfo._effectiveMaterial._preBind(b, m);
    this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite && l.setDepthWrite(!0);
    const N = this._internalMeshDataInfo._effectiveMaterial, k = N.fillMode;
    this._internalMeshDataInfo._onBeforeBindObservable && this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this), H || this._bind(e, j, k, !1);
    const R = w.getWorldMatrix();
    N._storeEffectOnSubMeshes ? N.bindForSubMesh(R, this, e) : N.bind(R, this), !N.backFaceCulling && N.separateCullingPass && (l.setState(!0, N.zOffset, !1, !I, N.cullBackFaces, N.stencil, N.zOffsetUnits), this._processRendering(this, e, j, k, u, H, this._onBeforeDraw, this._internalMeshDataInfo._effectiveMaterial), l.setState(!0, N.zOffset, !1, I, N.cullBackFaces, N.stencil, N.zOffsetUnits), this._internalMeshDataInfo._onBetweenPassObservable && this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(e)), this._processRendering(this, e, j, k, u, H, this._onBeforeDraw, this._internalMeshDataInfo._effectiveMaterial), this._internalMeshDataInfo._effectiveMaterial.unbind();
    for (const y of o._afterRenderingMeshStage)
      y.action(this, e, u, j);
    return this._internalMeshDataInfo._onAfterRenderObservable && this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this), p && (p.maxZ = P, o.updateTransformMatrix(!0)), o.performancePriority === $H.Aggressive && !T.isFrozen && this._freeze(), this;
  }
  /**
   *   Renormalize the mesh and patch it up if there are no weights
   *   Similar to normalization by adding the weights compute the reciprocal and multiply all elements, this wil ensure that everything adds to 1.
   *   However in the case of zero weights then we set just a single influence to 1.
   *   We check in the function for extra's present and if so we use the normalizeSkinWeightsWithExtras rather than the FourWeights version.
   */
  cleanMatrixWeights() {
    this.isVerticesDataPresent(J.MatricesWeightsKind) && (this.isVerticesDataPresent(J.MatricesWeightsExtraKind) ? this._normalizeSkinWeightsAndExtra() : this._normalizeSkinFourWeights());
  }
  // faster 4 weight version.
  _normalizeSkinFourWeights() {
    const e = this.getVerticesData(J.MatricesWeightsKind), t = e.length;
    for (let r = 0; r < t; r += 4) {
      const n = e[r] + e[r + 1] + e[r + 2] + e[r + 3];
      if (n === 0)
        e[r] = 1;
      else {
        const i = 1 / n;
        e[r] *= i, e[r + 1] *= i, e[r + 2] *= i, e[r + 3] *= i;
      }
    }
    this.setVerticesData(J.MatricesWeightsKind, e);
  }
  // handle special case of extra verts.  (in theory gltf can handle 12 influences)
  _normalizeSkinWeightsAndExtra() {
    const e = this.getVerticesData(J.MatricesWeightsExtraKind), t = this.getVerticesData(J.MatricesWeightsKind), r = t.length;
    for (let n = 0; n < r; n += 4) {
      let i = t[n] + t[n + 1] + t[n + 2] + t[n + 3];
      if (i += e[n] + e[n + 1] + e[n + 2] + e[n + 3], i === 0)
        t[n] = 1;
      else {
        const s = 1 / i;
        t[n] *= s, t[n + 1] *= s, t[n + 2] *= s, t[n + 3] *= s, e[n] *= s, e[n + 1] *= s, e[n + 2] *= s, e[n + 3] *= s;
      }
    }
    this.setVerticesData(J.MatricesWeightsKind, t), this.setVerticesData(J.MatricesWeightsKind, e);
  }
  /**
   * ValidateSkinning is used to determine that a mesh has valid skinning data along with skin metrics, if missing weights,
   * or not normalized it is returned as invalid mesh the string can be used for console logs, or on screen messages to let
   * the user know there was an issue with importing the mesh
   * @returns a validation object with skinned, valid and report string
   */
  validateSkinning() {
    const e = this.getVerticesData(J.MatricesWeightsExtraKind), t = this.getVerticesData(J.MatricesWeightsKind);
    if (t === null || this.skeleton == null)
      return { skinned: !1, valid: !0, report: "not skinned" };
    const r = t.length;
    let n = 0, i = 0, s = 0, a = 0;
    const f = e === null ? 4 : 8, o = [];
    for (let c = 0; c <= f; c++)
      o[c] = 0;
    const d = 1e-3;
    for (let c = 0; c < r; c += 4) {
      let H = t[c], T = H, q = T === 0 ? 0 : 1;
      for (let b = 1; b < f; b++) {
        const j = b < 4 ? t[c + b] : e[c + b - 4];
        j > H && n++, j !== 0 && q++, T += j, H = j;
      }
      if (o[q]++, q > s && (s = q), T === 0)
        i++;
      else {
        const b = 1 / T;
        let j = 0;
        for (let w = 0; w < f; w++)
          w < 4 ? j += Math.abs(t[c + w] - t[c + w] * b) : j += Math.abs(e[c + w - 4] - e[c + w - 4] * b);
        j > d && a++;
      }
    }
    const v = this.skeleton.bones.length, u = this.getVerticesData(J.MatricesIndicesKind), l = this.getVerticesData(J.MatricesIndicesExtraKind);
    let P = 0;
    for (let c = 0; c < r; c += 4)
      for (let H = 0; H < f; H++) {
        const T = H < 4 ? u[c + H] : l[c + H - 4];
        (T >= v || T < 0) && P++;
      }
    const p = "Number of Weights = " + r / 4 + `
Maximum influences = ` + s + `
Missing Weights = ` + i + `
Not Sorted = ` + n + `
Not Normalized = ` + a + `
WeightCounts = [` + o + `]
Number of bones = ` + v + `
Bad Bone Indices = ` + P;
    return { skinned: !0, valid: i === 0 && a === 0 && P === 0, report: p };
  }
  /** @internal */
  _checkDelayState() {
    const e = this.getScene();
    return this._geometry ? this._geometry.load(e) : this.delayLoadState === 4 && (this.delayLoadState = 2, this._queueLoad(e)), this;
  }
  _queueLoad(e) {
    e.addPendingData(this);
    const t = this.delayLoadingFile.indexOf(".babylonbinarymeshdata") !== -1;
    return ye.LoadFile(this.delayLoadingFile, (r) => {
      r instanceof ArrayBuffer ? this._delayLoadingFunction(r, this) : this._delayLoadingFunction(JSON.parse(r), this), this.instances.forEach((n) => {
        n.refreshBoundingInfo(), n._syncSubMeshes();
      }), this.delayLoadState = 1, e.removePendingData(this);
    }, () => {
    }, e.offlineProvider, t), this;
  }
  /**
   * Returns `true` if the mesh is within the frustum defined by the passed array of planes.
   * A mesh is in the frustum if its bounding box intersects the frustum
   * @param frustumPlanes defines the frustum to test
   * @returns true if the mesh is in the frustum planes
   */
  isInFrustum(e) {
    return this.delayLoadState === 2 || !super.isInFrustum(e) ? !1 : (this._checkDelayState(), !0);
  }
  /**
   * Sets the mesh material by the material or multiMaterial `id` property
   * @param id is a string identifying the material or the multiMaterial
   * @returns the current mesh
   */
  setMaterialById(e) {
    const t = this.getScene().materials;
    let r;
    for (r = t.length - 1; r > -1; r--)
      if (t[r].id === e)
        return this.material = t[r], this;
    const n = this.getScene().multiMaterials;
    for (r = n.length - 1; r > -1; r--)
      if (n[r].id === e)
        return this.material = n[r], this;
    return this;
  }
  /**
   * Returns as a new array populated with the mesh material and/or skeleton, if any.
   * @returns an array of IAnimatable
   */
  getAnimatables() {
    const e = [];
    return this.material && e.push(this.material), this.skeleton && e.push(this.skeleton), e;
  }
  /**
   * Modifies the mesh geometry according to the passed transformation matrix.
   * This method returns nothing, but it really modifies the mesh even if it's originally not set as updatable.
   * The mesh normals are modified using the same transformation.
   * Note that, under the hood, this method sets a new VertexBuffer each call.
   * @param transform defines the transform matrix to use
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
   * @returns the current mesh
   */
  bakeTransformIntoVertices(e) {
    if (!this.isVerticesDataPresent(J.PositionKind))
      return this;
    const t = this.subMeshes.splice(0);
    this._resetPointsArrayCache();
    let r = this.getVerticesData(J.PositionKind);
    const n = S.Zero();
    let i;
    for (i = 0; i < r.length; i += 3)
      S.TransformCoordinatesFromFloatsToRef(r[i], r[i + 1], r[i + 2], e, n).toArray(r, i);
    if (this.setVerticesData(J.PositionKind, r, this.getVertexBuffer(J.PositionKind).isUpdatable()), this.isVerticesDataPresent(J.NormalKind)) {
      for (r = this.getVerticesData(J.NormalKind), i = 0; i < r.length; i += 3)
        S.TransformNormalFromFloatsToRef(r[i], r[i + 1], r[i + 2], e, n).normalize().toArray(r, i);
      this.setVerticesData(J.NormalKind, r, this.getVertexBuffer(J.NormalKind).isUpdatable());
    }
    return e.determinant() < 0 && this.flipFaces(), this.releaseSubMeshes(), this.subMeshes = t, this;
  }
  /**
   * Modifies the mesh geometry according to its own current World Matrix.
   * The mesh World Matrix is then reset.
   * This method returns nothing but really modifies the mesh even if it's originally not set as updatable.
   * Note that, under the hood, this method sets a new VertexBuffer each call.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
   * @param bakeIndependentlyOfChildren indicates whether to preserve all child nodes' World Matrix during baking
   * @returns the current mesh
   */
  bakeCurrentTransformIntoVertices(e = !0) {
    return this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)), this.resetLocalMatrix(e), this;
  }
  // Cache
  /** @internal */
  get _positions() {
    return this._internalAbstractMeshDataInfo._positions ? this._internalAbstractMeshDataInfo._positions : this._geometry ? this._geometry._positions : null;
  }
  /** @internal */
  _resetPointsArrayCache() {
    return this._geometry && this._geometry._resetPointsArrayCache(), this;
  }
  /** @internal */
  _generatePointsArray() {
    return this._geometry ? this._geometry._generatePointsArray() : !1;
  }
  /**
   * Returns a new Mesh object generated from the current mesh properties.
   * This method must not get confused with createInstance()
   * @param name is a string, the name given to the new mesh
   * @param newParent can be any Node object (default `null`)
   * @param doNotCloneChildren allows/denies the recursive cloning of the original mesh children if any (default `false`)
   * @param clonePhysicsImpostor allows/denies the cloning in the same time of the original mesh `body` used by the physics engine, if any (default `true`)
   * @returns a new mesh
   */
  clone(e = "", t = null, r, n = !0) {
    return new Ee(e, this.getScene(), t, this, r, n);
  }
  /**
   * Releases resources associated with this mesh.
   * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
   * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
   */
  dispose(e, t = !1) {
    this.morphTargetManager = null, this._geometry && this._geometry.releaseForMesh(this, !0);
    const r = this._internalMeshDataInfo;
    if (r._onBeforeDrawObservable && r._onBeforeDrawObservable.clear(), r._onBeforeBindObservable && r._onBeforeBindObservable.clear(), r._onBeforeRenderObservable && r._onBeforeRenderObservable.clear(), r._onAfterRenderObservable && r._onAfterRenderObservable.clear(), r._onBetweenPassObservable && r._onBetweenPassObservable.clear(), this._scene.useClonedMeshMap) {
      if (r.meshMap)
        for (const n in r.meshMap) {
          const i = r.meshMap[n];
          i && (i._internalMeshDataInfo._source = null, r.meshMap[n] = void 0);
        }
      r._source && r._source._internalMeshDataInfo.meshMap && (r._source._internalMeshDataInfo.meshMap[this.uniqueId] = void 0);
    } else {
      const n = this.getScene().meshes;
      for (const i of n) {
        const s = i;
        s._internalMeshDataInfo && s._internalMeshDataInfo._source && s._internalMeshDataInfo._source === this && (s._internalMeshDataInfo._source = null);
      }
    }
    r._source = null, this._instanceDataStorage.visibleInstances = {}, this._disposeInstanceSpecificData(), this._disposeThinInstanceSpecificData(), this._internalMeshDataInfo._checkReadinessObserver && this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver), super.dispose(e, t);
  }
  /** @internal */
  _disposeInstanceSpecificData() {
  }
  /** @internal */
  _disposeThinInstanceSpecificData() {
  }
  /** @internal */
  _invalidateInstanceVertexArrayObject() {
  }
  /**
   * Modifies the mesh geometry according to a displacement map.
   * A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex.
   * The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.
   * @param url is a string, the URL from the image file is to be downloaded.
   * @param minHeight is the lower limit of the displacement.
   * @param maxHeight is the upper limit of the displacement.
   * @param onSuccess is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing.
   * @param uvOffset is an optional vector2 used to offset UV.
   * @param uvScale is an optional vector2 used to scale UV.
   * @param forceUpdate defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
   * @returns the Mesh.
   */
  applyDisplacementMap(e, t, r, n, i, s, a = !1) {
    const f = this.getScene(), o = (d) => {
      const v = d.width, u = d.height, P = this.getEngine().createCanvas(v, u).getContext("2d");
      P.drawImage(d, 0, 0);
      const p = P.getImageData(0, 0, v, u).data;
      this.applyDisplacementMapFromBuffer(p, v, u, t, r, i, s, a), n && n(this);
    };
    return ye.LoadImage(e, o, () => {
    }, f.offlineProvider), this;
  }
  /**
   * Modifies the mesh geometry according to a displacementMap buffer.
   * A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex.
   * The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.
   * @param buffer is a `Uint8Array` buffer containing series of `Uint8` lower than 255, the red, green, blue and alpha values of each successive pixel.
   * @param heightMapWidth is the width of the buffer image.
   * @param heightMapHeight is the height of the buffer image.
   * @param minHeight is the lower limit of the displacement.
   * @param maxHeight is the upper limit of the displacement.
   * @param uvOffset is an optional vector2 used to offset UV.
   * @param uvScale is an optional vector2 used to scale UV.
   * @param forceUpdate defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
   * @returns the Mesh.
   */
  applyDisplacementMapFromBuffer(e, t, r, n, i, s, a, f = !1) {
    if (!this.isVerticesDataPresent(J.PositionKind) || !this.isVerticesDataPresent(J.NormalKind) || !this.isVerticesDataPresent(J.UVKind))
      return Se.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"), this;
    const o = this.getVerticesData(J.PositionKind, !0, !0), d = this.getVerticesData(J.NormalKind), v = this.getVerticesData(J.UVKind);
    let u = S.Zero();
    const l = S.Zero(), P = at.Zero();
    s = s || at.Zero(), a = a || new at(1, 1);
    for (let p = 0; p < o.length; p += 3) {
      S.FromArrayToRef(o, p, u), S.FromArrayToRef(d, p, l), at.FromArrayToRef(v, p / 3 * 2, P);
      const c = Math.abs(P.x * a.x + s.x % 1) * (t - 1) % t | 0, H = Math.abs(P.y * a.y + s.y % 1) * (r - 1) % r | 0, T = (c + H * t) * 4, q = e[T] / 255, b = e[T + 1] / 255, j = e[T + 2] / 255, w = q * 0.3 + b * 0.59 + j * 0.11;
      l.normalize(), l.scaleInPlace(n + (i - n) * w), u = u.add(l), u.toArray(o, p);
    }
    return Ut.ComputeNormals(o, this.getIndices(), d), f ? (this.setVerticesData(J.PositionKind, o), this.setVerticesData(J.NormalKind, d), this.setVerticesData(J.UVKind, v)) : (this.updateVerticesData(J.PositionKind, o), this.updateVerticesData(J.NormalKind, d)), this;
  }
  _getFlattenedNormals(e, t) {
    const r = new Float32Array(e.length * 3);
    let n = 0;
    const i = this.overrideMaterialSideOrientation === (this._scene.useRightHandedSystem ? 1 : 0);
    for (let s = 0; s < e.length; s += 3) {
      const a = S.FromArray(t, e[s] * 3), f = S.FromArray(t, e[s + 1] * 3), o = S.FromArray(t, e[s + 2] * 3), d = a.subtract(f), v = o.subtract(f), u = S.Normalize(S.Cross(d, v));
      i && u.scaleInPlace(-1);
      for (let l = 0; l < 3; l++)
        r[n++] = u.x, r[n++] = u.y, r[n++] = u.z;
    }
    return r;
  }
  _convertToUnIndexedMesh(e = !1) {
    const t = this.getVerticesDataKinds(), r = this.getIndices(), n = {}, i = (a, f) => {
      const o = new Float32Array(r.length * f);
      let d = 0;
      for (let v = 0; v < r.length; v++)
        for (let u = 0; u < f; u++)
          o[d++] = a[r[v] * f + u];
      return o;
    }, s = this.geometry ? this.subMeshes.slice(0) : [];
    for (const a of t)
      n[a] = this.getVerticesData(a);
    for (const a of t) {
      const f = this.getVertexBuffer(a), o = f.getStrideSize();
      if (e && a === J.NormalKind) {
        const d = this._getFlattenedNormals(r, n[J.PositionKind]);
        this.setVerticesData(J.NormalKind, d, f.isUpdatable(), o);
      } else
        this.setVerticesData(a, i(n[a], o), f.isUpdatable(), o);
    }
    if (this.morphTargetManager) {
      for (let a = 0; a < this.morphTargetManager.numTargets; a++) {
        const f = this.morphTargetManager.getTarget(a), o = f.getPositions();
        f.setPositions(i(o, 3));
        const d = f.getNormals();
        d && f.setNormals(e ? this._getFlattenedNormals(r, o) : i(d, 3));
        const v = f.getTangents();
        v && f.setTangents(i(v, 3));
        const u = f.getUVs();
        u && f.setUVs(i(u, 2));
      }
      this.morphTargetManager.synchronize();
    }
    for (let a = 0; a < r.length; a++)
      r[a] = a;
    this.setIndices(r), this._unIndexed = !0, this.releaseSubMeshes();
    for (const a of s)
      rA.AddToMesh(a.materialIndex, a.indexStart, a.indexCount, a.indexStart, a.indexCount, this);
    return this.synchronizeInstances(), this;
  }
  /**
   * Modify the mesh to get a flat shading rendering.
   * This means each mesh facet will then have its own normals. Usually new vertices are added in the mesh geometry to get this result.
   * Warning : the mesh is really modified even if not set originally as updatable and, under the hood, a new VertexBuffer is allocated.
   * @returns current mesh
   */
  convertToFlatShadedMesh() {
    return this._convertToUnIndexedMesh(!0);
  }
  /**
   * This method removes all the mesh indices and add new vertices (duplication) in order to unfold facets into buffers.
   * In other words, more vertices, no more indices and a single bigger VBO.
   * The mesh is really modified even if not set originally as updatable. Under the hood, a new VertexBuffer is allocated.
   * @returns current mesh
   */
  convertToUnIndexedMesh() {
    return this._convertToUnIndexedMesh();
  }
  /**
   * Inverses facet orientations.
   * Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
   * @param flipNormals will also inverts the normals
   * @returns current mesh
   */
  flipFaces(e = !1) {
    const t = Ut.ExtractFromMesh(this);
    let r;
    if (e && this.isVerticesDataPresent(J.NormalKind) && t.normals)
      for (r = 0; r < t.normals.length; r++)
        t.normals[r] *= -1;
    if (t.indices) {
      let n;
      for (r = 0; r < t.indices.length; r += 3)
        n = t.indices[r + 1], t.indices[r + 1] = t.indices[r + 2], t.indices[r + 2] = n;
    }
    return t.applyToMesh(this, this.isVertexBufferUpdatable(J.PositionKind)), this;
  }
  /**
   * Increase the number of facets and hence vertices in a mesh
   * Vertex normals are interpolated from existing vertex normals
   * Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
   * @param numberPerEdge the number of new vertices to add to each edge of a facet, optional default 1
   */
  increaseVertices(e = 1) {
    const t = Ut.ExtractFromMesh(this), r = t.indices && !Array.isArray(t.indices) && Array.from ? Array.from(t.indices) : t.indices, n = t.positions && !Array.isArray(t.positions) && Array.from ? Array.from(t.positions) : t.positions, i = t.uvs && !Array.isArray(t.uvs) && Array.from ? Array.from(t.uvs) : t.uvs, s = t.normals && !Array.isArray(t.normals) && Array.from ? Array.from(t.normals) : t.normals;
    if (!r || !n)
      Se.Warn("Couldn't increase number of vertices : VertexData must contain at least indices and positions");
    else {
      t.indices = r, t.positions = n, i && (t.uvs = i), s && (t.normals = s);
      const a = e + 1, f = new Array();
      for (let j = 0; j < a + 1; j++)
        f[j] = new Array();
      let o, d;
      const v = new S(0, 0, 0), u = new S(0, 0, 0), l = new at(0, 0), P = new Array(), p = new Array(), c = new Array();
      let H, T = n.length, q;
      i && (q = i.length);
      let b;
      s && (b = s.length);
      for (let j = 0; j < r.length; j += 3) {
        p[0] = r[j], p[1] = r[j + 1], p[2] = r[j + 2];
        for (let w = 0; w < 3; w++)
          if (o = p[w], d = p[(w + 1) % 3], c[o] === void 0 && c[d] === void 0 ? (c[o] = new Array(), c[d] = new Array()) : (c[o] === void 0 && (c[o] = new Array()), c[d] === void 0 && (c[d] = new Array())), c[o][d] === void 0 && c[d][o] === void 0) {
            c[o][d] = [], v.x = (n[3 * d] - n[3 * o]) / a, v.y = (n[3 * d + 1] - n[3 * o + 1]) / a, v.z = (n[3 * d + 2] - n[3 * o + 2]) / a, s && (u.x = (s[3 * d] - s[3 * o]) / a, u.y = (s[3 * d + 1] - s[3 * o + 1]) / a, u.z = (s[3 * d + 2] - s[3 * o + 2]) / a), i && (l.x = (i[2 * d] - i[2 * o]) / a, l.y = (i[2 * d + 1] - i[2 * o + 1]) / a), c[o][d].push(o);
            for (let m = 1; m < a; m++)
              c[o][d].push(n.length / 3), n[T++] = n[3 * o] + m * v.x, n[T++] = n[3 * o + 1] + m * v.y, n[T++] = n[3 * o + 2] + m * v.z, s && (s[b++] = s[3 * o] + m * u.x, s[b++] = s[3 * o + 1] + m * u.y, s[b++] = s[3 * o + 2] + m * u.z), i && (i[q++] = i[2 * o] + m * l.x, i[q++] = i[2 * o + 1] + m * l.y);
            c[o][d].push(d), c[d][o] = new Array(), H = c[o][d].length;
            for (let m = 0; m < H; m++)
              c[d][o][m] = c[o][d][H - 1 - m];
          }
        f[0][0] = r[j], f[1][0] = c[r[j]][r[j + 1]][1], f[1][1] = c[r[j]][r[j + 2]][1];
        for (let w = 2; w < a; w++) {
          f[w][0] = c[r[j]][r[j + 1]][w], f[w][w] = c[r[j]][r[j + 2]][w], v.x = (n[3 * f[w][w]] - n[3 * f[w][0]]) / w, v.y = (n[3 * f[w][w] + 1] - n[3 * f[w][0] + 1]) / w, v.z = (n[3 * f[w][w] + 2] - n[3 * f[w][0] + 2]) / w, s && (u.x = (s[3 * f[w][w]] - s[3 * f[w][0]]) / w, u.y = (s[3 * f[w][w] + 1] - s[3 * f[w][0] + 1]) / w, u.z = (s[3 * f[w][w] + 2] - s[3 * f[w][0] + 2]) / w), i && (l.x = (i[2 * f[w][w]] - i[2 * f[w][0]]) / w, l.y = (i[2 * f[w][w] + 1] - i[2 * f[w][0] + 1]) / w);
          for (let m = 1; m < w; m++)
            f[w][m] = n.length / 3, n[T++] = n[3 * f[w][0]] + m * v.x, n[T++] = n[3 * f[w][0] + 1] + m * v.y, n[T++] = n[3 * f[w][0] + 2] + m * v.z, s && (s[b++] = s[3 * f[w][0]] + m * u.x, s[b++] = s[3 * f[w][0] + 1] + m * u.y, s[b++] = s[3 * f[w][0] + 2] + m * u.z), i && (i[q++] = i[2 * f[w][0]] + m * l.x, i[q++] = i[2 * f[w][0] + 1] + m * l.y);
        }
        f[a] = c[r[j + 1]][r[j + 2]], P.push(f[0][0], f[1][0], f[1][1]);
        for (let w = 1; w < a; w++) {
          let m;
          for (m = 0; m < w; m++)
            P.push(f[w][m], f[w + 1][m], f[w + 1][m + 1]), P.push(f[w][m], f[w + 1][m + 1], f[w][m + 1]);
          P.push(f[w][m], f[w + 1][m], f[w + 1][m + 1]);
        }
      }
      t.indices = P, t.applyToMesh(this, this.isVertexBufferUpdatable(J.PositionKind));
    }
  }
  /**
   * Force adjacent facets to share vertices and remove any facets that have all vertices in a line
   * This will undo any application of covertToFlatShadedMesh
   * Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
   */
  forceSharedVertices() {
    const e = Ut.ExtractFromMesh(this), t = e.uvs, r = e.indices, n = e.positions, i = e.colors, s = e.matricesIndices, a = e.matricesWeights, f = e.matricesIndicesExtra, o = e.matricesWeightsExtra;
    if (r === void 0 || n === void 0 || r === null || n === null)
      Se.Warn("VertexData contains empty entries");
    else {
      const d = new Array(), v = new Array(), u = new Array(), l = new Array(), P = new Array(), p = new Array(), c = new Array(), H = new Array();
      let T = new Array(), q = 0;
      const b = {};
      let j, w;
      for (let I = 0; I < r.length; I += 3) {
        w = [r[I], r[I + 1], r[I + 2]], T = [];
        for (let N = 0; N < 3; N++) {
          T[N] = "";
          for (let k = 0; k < 3; k++)
            Math.abs(n[3 * w[N] + k]) < 1e-8 && (n[3 * w[N] + k] = 0), T[N] += n[3 * w[N] + k] + "|";
        }
        if (!(T[0] == T[1] || T[0] == T[2] || T[1] == T[2]))
          for (let N = 0; N < 3; N++) {
            if (j = b[T[N]], j === void 0) {
              b[T[N]] = q, j = q++;
              for (let k = 0; k < 3; k++)
                d.push(n[3 * w[N] + k]);
              if (i != null)
                for (let k = 0; k < 4; k++)
                  l.push(i[4 * w[N] + k]);
              if (t != null)
                for (let k = 0; k < 2; k++)
                  u.push(t[2 * w[N] + k]);
              if (s != null)
                for (let k = 0; k < 4; k++)
                  P.push(s[4 * w[N] + k]);
              if (a != null)
                for (let k = 0; k < 4; k++)
                  p.push(a[4 * w[N] + k]);
              if (f != null)
                for (let k = 0; k < 4; k++)
                  c.push(f[4 * w[N] + k]);
              if (o != null)
                for (let k = 0; k < 4; k++)
                  H.push(o[4 * w[N] + k]);
            }
            v.push(j);
          }
      }
      const m = new Array();
      Ut.ComputeNormals(d, v, m), e.positions = d, e.indices = v, e.normals = m, t != null && (e.uvs = u), i != null && (e.colors = l), s != null && (e.matricesIndices = P), a != null && (e.matricesWeights = p), f != null && (e.matricesIndicesExtra = c), a != null && (e.matricesWeightsExtra = H), e.applyToMesh(this, this.isVertexBufferUpdatable(J.PositionKind));
    }
  }
  // Instances
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/naming-convention
  static _instancedMeshFactory(e, t) {
    throw qn("InstancedMesh");
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static _PhysicsImpostorParser(e, t, r) {
    throw qn("PhysicsImpostor");
  }
  /**
   * Creates a new InstancedMesh object from the mesh model.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
   * @param name defines the name of the new instance
   * @returns a new InstancedMesh
   */
  createInstance(e) {
    return Ee._instancedMeshFactory(e, this);
  }
  /**
   * Synchronises all the mesh instance submeshes to the current mesh submeshes, if any.
   * After this call, all the mesh instances have the same submeshes than the current mesh.
   * @returns the current mesh
   */
  synchronizeInstances() {
    for (let e = 0; e < this.instances.length; e++)
      this.instances[e]._syncSubMeshes();
    return this;
  }
  /**
   * Optimization of the mesh's indices, in case a mesh has duplicated vertices.
   * The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes.
   * This should be used together with the simplification to avoid disappearing triangles.
   * @param successCallback an optional success callback to be called after the optimization finished.
   * @returns the current mesh
   */
  optimizeIndices(e) {
    const t = this.getIndices(), r = this.getVerticesData(J.PositionKind);
    if (!r || !t)
      return this;
    const n = [];
    for (let s = 0; s < r.length; s = s + 3)
      n.push(S.FromArray(r, s));
    const i = [];
    return up.SyncAsyncForLoop(n.length, 40, (s) => {
      const a = n.length - 1 - s, f = n[a];
      for (let o = 0; o < a; ++o) {
        const d = n[o];
        if (f.equals(d)) {
          i[a] = o;
          break;
        }
      }
    }, () => {
      for (let a = 0; a < t.length; ++a)
        t[a] = i[t[a]] || t[a];
      const s = this.subMeshes.slice(0);
      this.setIndices(t), this.subMeshes = s, e && e(this);
    }), this;
  }
  /**
   * Serialize current mesh
   * @param serializationObject defines the object which will receive the serialization data
   */
  serialize(e = {}) {
    e.name = this.name, e.id = this.id, e.uniqueId = this.uniqueId, e.type = this.getClassName(), Zi && Zi.HasTags(this) && (e.tags = Zi.GetTags(this)), e.position = this.position.asArray(), this.rotationQuaternion ? e.rotationQuaternion = this.rotationQuaternion.asArray() : this.rotation && (e.rotation = this.rotation.asArray()), e.scaling = this.scaling.asArray(), this._postMultiplyPivotMatrix ? e.pivotMatrix = this.getPivotMatrix().asArray() : e.localMatrix = this.getPivotMatrix().asArray(), e.isEnabled = this.isEnabled(!1), e.isVisible = this.isVisible, e.infiniteDistance = this.infiniteDistance, e.pickable = this.isPickable, e.receiveShadows = this.receiveShadows, e.billboardMode = this.billboardMode, e.visibility = this.visibility, e.checkCollisions = this.checkCollisions, e.isBlocker = this.isBlocker, e.overrideMaterialSideOrientation = this.overrideMaterialSideOrientation, this.parent && this.parent._serializeAsParent(e), e.isUnIndexed = this.isUnIndexed;
    const t = this._geometry;
    if (t && this.subMeshes) {
      e.geometryUniqueId = t.uniqueId, e.geometryId = t.id, e.subMeshes = [];
      for (let r = 0; r < this.subMeshes.length; r++) {
        const n = this.subMeshes[r];
        e.subMeshes.push({
          materialIndex: n.materialIndex,
          verticesStart: n.verticesStart,
          verticesCount: n.verticesCount,
          indexStart: n.indexStart,
          indexCount: n.indexCount
        });
      }
    }
    if (this.material ? this.material.doNotSerialize || (e.materialUniqueId = this.material.uniqueId, e.materialId = this.material.id) : (this.material = null, e.materialUniqueId = this._scene.defaultMaterial.uniqueId, e.materialId = this._scene.defaultMaterial.id), this.morphTargetManager && (e.morphTargetManagerId = this.morphTargetManager.uniqueId), this.skeleton && (e.skeletonId = this.skeleton.id, e.numBoneInfluencers = this.numBoneInfluencers), this.getScene()._getComponent(Ot.NAME_PHYSICSENGINE)) {
      const r = this.getPhysicsImpostor();
      r && (e.physicsMass = r.getParam("mass"), e.physicsFriction = r.getParam("friction"), e.physicsRestitution = r.getParam("mass"), e.physicsImpostor = r.type);
    }
    this.metadata && (e.metadata = this.metadata), e.instances = [];
    for (let r = 0; r < this.instances.length; r++) {
      const n = this.instances[r];
      if (n.doNotSerialize)
        continue;
      const i = {
        name: n.name,
        id: n.id,
        isEnabled: n.isEnabled(!1),
        isVisible: n.isVisible,
        isPickable: n.isPickable,
        checkCollisions: n.checkCollisions,
        position: n.position.asArray(),
        scaling: n.scaling.asArray()
      };
      if (n.parent && n.parent._serializeAsParent(i), n.rotationQuaternion ? i.rotationQuaternion = n.rotationQuaternion.asArray() : n.rotation && (i.rotation = n.rotation.asArray()), this.getScene()._getComponent(Ot.NAME_PHYSICSENGINE)) {
        const s = n.getPhysicsImpostor();
        s && (i.physicsMass = s.getParam("mass"), i.physicsFriction = s.getParam("friction"), i.physicsRestitution = s.getParam("mass"), i.physicsImpostor = s.type);
      }
      n.metadata && (i.metadata = n.metadata), n.actionManager && (i.actions = n.actionManager.serialize(n.name)), e.instances.push(i), jt.AppendSerializedAnimations(n, i), i.ranges = n.serializeAnimationRanges();
    }
    if (this._thinInstanceDataStorage.instancesCount && this._thinInstanceDataStorage.matrixData && (e.thinInstances = {
      instancesCount: this._thinInstanceDataStorage.instancesCount,
      matrixData: Array.from(this._thinInstanceDataStorage.matrixData),
      matrixBufferSize: this._thinInstanceDataStorage.matrixBufferSize,
      enablePicking: this.thinInstanceEnablePicking
    }, this._userThinInstanceBuffersStorage)) {
      const r = {
        data: {},
        sizes: {},
        strides: {}
      };
      for (const n in this._userThinInstanceBuffersStorage.data)
        r.data[n] = Array.from(this._userThinInstanceBuffersStorage.data[n]), r.sizes[n] = this._userThinInstanceBuffersStorage.sizes[n], r.strides[n] = this._userThinInstanceBuffersStorage.strides[n];
      e.thinInstances.userThinInstance = r;
    }
    return jt.AppendSerializedAnimations(this, e), e.ranges = this.serializeAnimationRanges(), e.layerMask = this.layerMask, e.alphaIndex = this.alphaIndex, e.hasVertexAlpha = this.hasVertexAlpha, e.overlayAlpha = this.overlayAlpha, e.overlayColor = this.overlayColor.asArray(), e.renderOverlay = this.renderOverlay, e.applyFog = this.applyFog, this.actionManager && (e.actions = this.actionManager.serialize(this.name)), e;
  }
  /** @internal */
  _syncGeometryWithMorphTargetManager() {
    if (!this.geometry)
      return;
    this._markSubMeshesAsAttributesDirty();
    const e = this._internalAbstractMeshDataInfo._morphTargetManager;
    if (e && e.vertexCount) {
      if (e.vertexCount !== this.getTotalVertices()) {
        Se.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."), this.morphTargetManager = null;
        return;
      }
      if (e.isUsingTextureForTargets)
        return;
      for (let t = 0; t < e.numInfluencers; t++) {
        const r = e.getActiveTarget(t), n = r.getPositions();
        if (!n) {
          Se.Error("Invalid morph target. Target must have positions.");
          return;
        }
        this.geometry.setVerticesData(J.PositionKind + t, n, !1, 3);
        const i = r.getNormals();
        i && this.geometry.setVerticesData(J.NormalKind + t, i, !1, 3);
        const s = r.getTangents();
        s && this.geometry.setVerticesData(J.TangentKind + t, s, !1, 3);
        const a = r.getUVs();
        a && this.geometry.setVerticesData(J.UVKind + "_" + t, a, !1, 2);
      }
    } else {
      let t = 0;
      for (; this.geometry.isVerticesDataPresent(J.PositionKind + t); )
        this.geometry.removeVerticesData(J.PositionKind + t), this.geometry.isVerticesDataPresent(J.NormalKind + t) && this.geometry.removeVerticesData(J.NormalKind + t), this.geometry.isVerticesDataPresent(J.TangentKind + t) && this.geometry.removeVerticesData(J.TangentKind + t), this.geometry.isVerticesDataPresent(J.UVKind + t) && this.geometry.removeVerticesData(J.UVKind + "_" + t), t++;
    }
  }
  /**
   * Returns a new Mesh object parsed from the source provided.
   * @param parsedMesh is the source
   * @param scene defines the hosting scene
   * @param rootUrl is the root URL to prefix the `delayLoadingFile` property with
   * @returns a new Mesh
   */
  static Parse(e, t, r) {
    let n;
    if (e.type && e.type === "LinesMesh" ? n = Ee._LinesMeshParser(e, t) : e.type && e.type === "GroundMesh" ? n = Ee._GroundMeshParser(e, t) : e.type && e.type === "GoldbergMesh" ? n = Ee._GoldbergMeshParser(e, t) : e.type && e.type === "GreasedLineMesh" ? n = Ee._GreasedLineMeshParser(e, t) : e.type && e.type === "TrailMesh" ? n = Ee._TrailMeshParser(e, t) : n = new Ee(e.name, t), n.id = e.id, n._waitingParsedUniqueId = e.uniqueId, Zi && Zi.AddTagsTo(n, e.tags), n.position = S.FromArray(e.position), e.metadata !== void 0 && (n.metadata = e.metadata), e.rotationQuaternion ? n.rotationQuaternion = Ze.FromArray(e.rotationQuaternion) : e.rotation && (n.rotation = S.FromArray(e.rotation)), n.scaling = S.FromArray(e.scaling), e.localMatrix ? n.setPreTransformMatrix(he.FromArray(e.localMatrix)) : e.pivotMatrix && n.setPivotMatrix(he.FromArray(e.pivotMatrix)), n.setEnabled(e.isEnabled), n.isVisible = e.isVisible, n.infiniteDistance = e.infiniteDistance, n.showBoundingBox = e.showBoundingBox, n.showSubMeshesBoundingBox = e.showSubMeshesBoundingBox, e.applyFog !== void 0 && (n.applyFog = e.applyFog), e.pickable !== void 0 && (n.isPickable = e.pickable), e.alphaIndex !== void 0 && (n.alphaIndex = e.alphaIndex), n.receiveShadows = e.receiveShadows, e.billboardMode !== void 0 && (n.billboardMode = e.billboardMode), e.visibility !== void 0 && (n.visibility = e.visibility), n.checkCollisions = e.checkCollisions, e.overrideMaterialSideOrientation !== void 0 && (n.overrideMaterialSideOrientation = e.overrideMaterialSideOrientation), e.isBlocker !== void 0 && (n.isBlocker = e.isBlocker), n._shouldGenerateFlatShading = e.useFlatShading, e.freezeWorldMatrix && (n._waitingData.freezeWorldMatrix = e.freezeWorldMatrix), e.parentId !== void 0 && (n._waitingParentId = e.parentId), e.parentInstanceIndex !== void 0 && (n._waitingParentInstanceIndex = e.parentInstanceIndex), e.actions !== void 0 && (n._waitingData.actions = e.actions), e.overlayAlpha !== void 0 && (n.overlayAlpha = e.overlayAlpha), e.overlayColor !== void 0 && (n.overlayColor = Ne.FromArray(e.overlayColor)), e.renderOverlay !== void 0 && (n.renderOverlay = e.renderOverlay), n.isUnIndexed = !!e.isUnIndexed, n.hasVertexAlpha = e.hasVertexAlpha, e.delayLoadingFile ? (n.delayLoadState = 4, n.delayLoadingFile = r + e.delayLoadingFile, n.buildBoundingInfo(S.FromArray(e.boundingBoxMinimum), S.FromArray(e.boundingBoxMaximum)), e._binaryInfo && (n._binaryInfo = e._binaryInfo), n._delayInfo = [], e.hasUVs && n._delayInfo.push(J.UVKind), e.hasUVs2 && n._delayInfo.push(J.UV2Kind), e.hasUVs3 && n._delayInfo.push(J.UV3Kind), e.hasUVs4 && n._delayInfo.push(J.UV4Kind), e.hasUVs5 && n._delayInfo.push(J.UV5Kind), e.hasUVs6 && n._delayInfo.push(J.UV6Kind), e.hasColors && n._delayInfo.push(J.ColorKind), e.hasMatricesIndices && n._delayInfo.push(J.MatricesIndicesKind), e.hasMatricesWeights && n._delayInfo.push(J.MatricesWeightsKind), n._delayLoadingFunction = Tf._ImportGeometry, l9.ForceFullSceneLoadingForIncremental && n._checkDelayState()) : Tf._ImportGeometry(e, n), e.materialUniqueId ? n._waitingMaterialId = e.materialUniqueId : e.materialId && (n._waitingMaterialId = e.materialId), e.morphTargetManagerId > -1 && (n.morphTargetManager = t.getMorphTargetManagerById(e.morphTargetManagerId)), e.skeletonId !== void 0 && e.skeletonId !== null && (n.skeleton = t.getLastSkeletonById(e.skeletonId), e.numBoneInfluencers && (n.numBoneInfluencers = e.numBoneInfluencers)), e.animations) {
      for (let i = 0; i < e.animations.length; i++) {
        const s = e.animations[i], a = Jo("BABYLON.Animation");
        a && n.animations.push(a.Parse(s));
      }
      Cs.ParseAnimationRanges(n, e, t);
    }
    if (e.autoAnimate && t.beginAnimation(n, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1), e.layerMask && !isNaN(e.layerMask) ? n.layerMask = Math.abs(parseInt(e.layerMask)) : n.layerMask = 268435455, e.physicsImpostor && Ee._PhysicsImpostorParser(t, n, e), e.lodMeshIds && (n._waitingData.lods = {
      ids: e.lodMeshIds,
      distances: e.lodDistances ? e.lodDistances : null,
      coverages: e.lodCoverages ? e.lodCoverages : null
    }), e.instances)
      for (let i = 0; i < e.instances.length; i++) {
        const s = e.instances[i], a = n.createInstance(s.name);
        if (s.id && (a.id = s.id), Zi && (s.tags ? Zi.AddTagsTo(a, s.tags) : Zi.AddTagsTo(a, e.tags)), a.position = S.FromArray(s.position), s.metadata !== void 0 && (a.metadata = s.metadata), s.parentId !== void 0 && (a._waitingParentId = s.parentId), s.parentInstanceIndex !== void 0 && (a._waitingParentInstanceIndex = s.parentInstanceIndex), s.isEnabled !== void 0 && s.isEnabled !== null && a.setEnabled(s.isEnabled), s.isVisible !== void 0 && s.isVisible !== null && (a.isVisible = s.isVisible), s.isPickable !== void 0 && s.isPickable !== null && (a.isPickable = s.isPickable), s.rotationQuaternion ? a.rotationQuaternion = Ze.FromArray(s.rotationQuaternion) : s.rotation && (a.rotation = S.FromArray(s.rotation)), a.scaling = S.FromArray(s.scaling), s.checkCollisions != null && s.checkCollisions != null && (a.checkCollisions = s.checkCollisions), s.pickable != null && s.pickable != null && (a.isPickable = s.pickable), s.showBoundingBox != null && s.showBoundingBox != null && (a.showBoundingBox = s.showBoundingBox), s.showSubMeshesBoundingBox != null && s.showSubMeshesBoundingBox != null && (a.showSubMeshesBoundingBox = s.showSubMeshesBoundingBox), s.alphaIndex != null && s.showSubMeshesBoundingBox != null && (a.alphaIndex = s.alphaIndex), s.physicsImpostor && Ee._PhysicsImpostorParser(t, a, s), s.actions !== void 0 && (a._waitingData.actions = s.actions), s.animations) {
          for (let f = 0; f < s.animations.length; f++) {
            const o = s.animations[f], d = Jo("BABYLON.Animation");
            d && a.animations.push(d.Parse(o));
          }
          Cs.ParseAnimationRanges(a, s, t), s.autoAnimate && t.beginAnimation(a, s.autoAnimateFrom, s.autoAnimateTo, s.autoAnimateLoop, s.autoAnimateSpeed || 1);
        }
      }
    if (e.thinInstances) {
      const i = e.thinInstances;
      if (n.thinInstanceEnablePicking = !!i.enablePicking, i.matrixData ? (n.thinInstanceSetBuffer("matrix", new Float32Array(i.matrixData), 16, !1), n._thinInstanceDataStorage.matrixBufferSize = i.matrixBufferSize, n._thinInstanceDataStorage.instancesCount = i.instancesCount) : n._thinInstanceDataStorage.matrixBufferSize = i.matrixBufferSize, e.thinInstances.userThinInstance) {
        const s = e.thinInstances.userThinInstance;
        for (const a in s.data)
          n.thinInstanceSetBuffer(a, new Float32Array(s.data[a]), s.strides[a], !1), n._userThinInstanceBuffersStorage.sizes[a] = s.sizes[a];
      }
    }
    return n;
  }
  // Skeletons
  /**
   * Prepare internal position array for software CPU skinning
   * @returns original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh
   */
  setPositionsForCPUSkinning() {
    const e = this._internalMeshDataInfo;
    if (!e._sourcePositions) {
      const t = this.getVerticesData(J.PositionKind);
      if (!t)
        return e._sourcePositions;
      e._sourcePositions = new Float32Array(t), this.isVertexBufferUpdatable(J.PositionKind) || this.setVerticesData(J.PositionKind, t, !0);
    }
    return e._sourcePositions;
  }
  /**
   * Prepare internal normal array for software CPU skinning
   * @returns original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
   */
  setNormalsForCPUSkinning() {
    const e = this._internalMeshDataInfo;
    if (!e._sourceNormals) {
      const t = this.getVerticesData(J.NormalKind);
      if (!t)
        return e._sourceNormals;
      e._sourceNormals = new Float32Array(t), this.isVertexBufferUpdatable(J.NormalKind) || this.setVerticesData(J.NormalKind, t, !0);
    }
    return e._sourceNormals;
  }
  /**
   * Updates the vertex buffer by applying transformation from the bones
   * @param skeleton defines the skeleton to apply to current mesh
   * @returns the current mesh
   */
  applySkeleton(e) {
    if (!this.geometry)
      return this;
    if (this.geometry._softwareSkinningFrameId == this.getScene().getFrameId())
      return this;
    if (this.geometry._softwareSkinningFrameId = this.getScene().getFrameId(), !this.isVerticesDataPresent(J.PositionKind))
      return this;
    if (!this.isVerticesDataPresent(J.MatricesIndicesKind))
      return this;
    if (!this.isVerticesDataPresent(J.MatricesWeightsKind))
      return this;
    const t = this.isVerticesDataPresent(J.NormalKind), r = this._internalMeshDataInfo;
    if (!r._sourcePositions) {
      const H = this.subMeshes.slice();
      this.setPositionsForCPUSkinning(), this.subMeshes = H;
    }
    t && !r._sourceNormals && this.setNormalsForCPUSkinning();
    let n = this.getVerticesData(J.PositionKind);
    if (!n)
      return this;
    n instanceof Float32Array || (n = new Float32Array(n));
    let i = this.getVerticesData(J.NormalKind);
    if (t) {
      if (!i)
        return this;
      i instanceof Float32Array || (i = new Float32Array(i));
    }
    const s = this.getVerticesData(J.MatricesIndicesKind), a = this.getVerticesData(J.MatricesWeightsKind);
    if (!a || !s)
      return this;
    const f = this.numBoneInfluencers > 4, o = f ? this.getVerticesData(J.MatricesIndicesExtraKind) : null, d = f ? this.getVerticesData(J.MatricesWeightsExtraKind) : null, v = e.getTransformMatrices(this), u = S.Zero(), l = new he(), P = new he();
    let p = 0, c;
    for (let H = 0; H < n.length; H += 3, p += 4) {
      let T;
      for (c = 0; c < 4; c++)
        T = a[p + c], T > 0 && (he.FromFloat32ArrayToRefScaled(v, Math.floor(s[p + c] * 16), T, P), l.addToSelf(P));
      if (f)
        for (c = 0; c < 4; c++)
          T = d[p + c], T > 0 && (he.FromFloat32ArrayToRefScaled(v, Math.floor(o[p + c] * 16), T, P), l.addToSelf(P));
      S.TransformCoordinatesFromFloatsToRef(r._sourcePositions[H], r._sourcePositions[H + 1], r._sourcePositions[H + 2], l, u), u.toArray(n, H), t && (S.TransformNormalFromFloatsToRef(r._sourceNormals[H], r._sourceNormals[H + 1], r._sourceNormals[H + 2], l, u), u.toArray(i, H)), l.reset();
    }
    return this.updateVerticesData(J.PositionKind, n), t && this.updateVerticesData(J.NormalKind, i), this;
  }
  // Tools
  /**
   * Returns an object containing a min and max Vector3 which are the minimum and maximum vectors of each mesh bounding box from the passed array, in the world coordinates
   * @param meshes defines the list of meshes to scan
   * @returns an object `{min:` Vector3`, max:` Vector3`}`
   */
  static MinMax(e) {
    let t = null, r = null;
    return e.forEach(function(n) {
      const s = n.getBoundingInfo().boundingBox;
      !t || !r ? (t = s.minimumWorld, r = s.maximumWorld) : (t.minimizeInPlace(s.minimumWorld), r.maximizeInPlace(s.maximumWorld));
    }), !t || !r ? {
      min: S.Zero(),
      max: S.Zero()
    } : {
      min: t,
      max: r
    };
  }
  /**
   * Returns the center of the `{min:` Vector3`, max:` Vector3`}` or the center of MinMax vector3 computed from a mesh array
   * @param meshesOrMinMaxVector could be an array of meshes or a `{min:` Vector3`, max:` Vector3`}` object
   * @returns a vector3
   */
  static Center(e) {
    const t = e instanceof Array ? Ee.MinMax(e) : e;
    return S.Center(t.min, t.max);
  }
  /**
   * Merge the array of meshes into a single mesh for performance reasons.
   * @param meshes array of meshes with the vertices to merge. Entries cannot be empty meshes.
   * @param disposeSource when true (default), dispose of the vertices from the source meshes.
   * @param allow32BitsIndices when the sum of the vertices > 64k, this must be set to true.
   * @param meshSubclass (optional) can be set to a Mesh where the merged vertices will be inserted.
   * @param subdivideWithSubMeshes when true (false default), subdivide mesh into subMeshes.
   * @param multiMultiMaterials when true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.
   * @returns a new mesh
   */
  static MergeMeshes(e, t = !0, r, n, i, s) {
    return mO(Ee._MergeMeshesCoroutine(e, t, r, n, i, s, !1));
  }
  /**
   * Merge the array of meshes into a single mesh for performance reasons.
   * @param meshes array of meshes with the vertices to merge. Entries cannot be empty meshes.
   * @param disposeSource when true (default), dispose of the vertices from the source meshes.
   * @param allow32BitsIndices when the sum of the vertices > 64k, this must be set to true.
   * @param meshSubclass (optional) can be set to a Mesh where the merged vertices will be inserted.
   * @param subdivideWithSubMeshes when true (false default), subdivide mesh into subMeshes.
   * @param multiMultiMaterials when true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.
   * @returns a new mesh
   */
  static MergeMeshesAsync(e, t = !0, r, n, i, s) {
    return BO(Ee._MergeMeshesCoroutine(e, t, r, n, i, s, !0), tee());
  }
  static *_MergeMeshesCoroutine(e, t = !0, r, n, i, s, a) {
    if (e = e.filter(Boolean), e.length === 0)
      return null;
    let f;
    if (!r) {
      let m = 0;
      for (f = 0; f < e.length; f++)
        if (m += e[f].getTotalVertices(), m >= 65536)
          return Se.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"), null;
    }
    s && (i = !1);
    const o = new Array(), d = new Array(), v = new Array(), u = e[0].overrideMaterialSideOrientation;
    for (f = 0; f < e.length; f++) {
      const m = e[f];
      if (m.isAnInstance)
        return Se.Warn("Cannot merge instance meshes."), null;
      if (u !== m.overrideMaterialSideOrientation)
        return Se.Warn("Cannot merge meshes with different overrideMaterialSideOrientation values."), null;
      if (i && v.push(m.getTotalIndices()), s)
        if (m.material) {
          const I = m.material;
          if (I instanceof Dc) {
            for (let N = 0; N < I.subMaterials.length; N++)
              o.indexOf(I.subMaterials[N]) < 0 && o.push(I.subMaterials[N]);
            for (let N = 0; N < m.subMeshes.length; N++)
              d.push(o.indexOf(I.subMaterials[m.subMeshes[N].materialIndex])), v.push(m.subMeshes[N].indexCount);
          } else {
            o.indexOf(I) < 0 && o.push(I);
            for (let N = 0; N < m.subMeshes.length; N++)
              d.push(o.indexOf(I)), v.push(m.subMeshes[N].indexCount);
          }
        } else
          for (let I = 0; I < m.subMeshes.length; I++)
            d.push(0), v.push(m.subMeshes[I].indexCount);
    }
    const l = e[0], P = (m) => {
      const I = m.computeWorldMatrix(!0);
      return { vertexData: Ut.ExtractFromMesh(m, !1, !1), transform: I };
    }, { vertexData: p, transform: c } = P(l);
    a && (yield);
    const H = new Array(e.length - 1);
    for (let m = 1; m < e.length; m++)
      H[m - 1] = P(e[m]), a && (yield);
    const T = p._mergeCoroutine(c, H, r, a, !t);
    let q = T.next();
    for (; !q.done; )
      a && (yield), q = T.next();
    const b = q.value;
    n || (n = new Ee(l.name + "_merged", l.getScene()));
    const j = b._applyToCoroutine(n, void 0, a);
    let w = j.next();
    for (; !w.done; )
      a && (yield), w = j.next();
    if (n.checkCollisions = l.checkCollisions, n.overrideMaterialSideOrientation = l.overrideMaterialSideOrientation, t)
      for (f = 0; f < e.length; f++)
        e[f].dispose();
    if (i || s) {
      n.releaseSubMeshes(), f = 0;
      let m = 0;
      for (; f < v.length; )
        rA.CreateFromIndices(0, m, v[f], n, void 0, !1), m += v[f], f++;
      for (const I of n.subMeshes)
        I.refreshBoundingInfo();
      n.computeWorldMatrix(!0);
    }
    if (s) {
      const m = new Dc(l.name + "_merged", l.getScene());
      m.subMaterials = o;
      for (let I = 0; I < n.subMeshes.length; I++)
        n.subMeshes[I].materialIndex = d[I];
      n.material = m;
    } else
      n.material = l.material;
    return n;
  }
  /**
   * @internal
   */
  addInstance(e) {
    e._indexInSourceMeshInstanceArray = this.instances.length, this.instances.push(e);
  }
  /**
   * @internal
   */
  removeInstance(e) {
    const t = e._indexInSourceMeshInstanceArray;
    if (t != -1) {
      if (t !== this.instances.length - 1) {
        const r = this.instances[this.instances.length - 1];
        this.instances[t] = r, r._indexInSourceMeshInstanceArray = t;
      }
      e._indexInSourceMeshInstanceArray = -1, this.instances.pop();
    }
  }
  /** @internal */
  _shouldConvertRHS() {
    return this.overrideMaterialSideOrientation === gt.CounterClockWiseSideOrientation;
  }
  /** @internal */
  _getRenderingFillMode(e) {
    var t;
    const r = this.getScene();
    return r.forcePointsCloud ? gt.PointFillMode : r.forceWireframe ? gt.WireFrameFillMode : (t = this.overrideRenderingFillMode) !== null && t !== void 0 ? t : e;
  }
  // deprecated methods
  /**
   * Sets the mesh material by the material or multiMaterial `id` property
   * @param id is a string identifying the material or the multiMaterial
   * @returns the current mesh
   * @deprecated Please use MeshBuilder instead Please use setMaterialById instead
   */
  setMaterialByID(e) {
    return this.setMaterialById(e);
  }
  /**
   * Creates a ribbon mesh.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
   * @param name defines the name of the mesh to create
   * @param pathArray is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry.
   * @param closeArray creates a seam between the first and the last paths of the path array (default is false)
   * @param closePath creates a seam between the first and the last points of each path of the path array
   * @param offset is taken in account only if the `pathArray` is containing a single path
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @param instance defines an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#ribbon)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateRibbon(e, t, r, n, i, s, a, f, o) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a plane polygonal mesh.  By default, this is a disc.
   * @param name defines the name of the mesh to create
   * @param radius sets the radius size (float) of the polygon (default 0.5)
   * @param tessellation sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateDisc(e, t, r, n, i, s) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a box mesh.
   * @param name defines the name of the mesh to create
   * @param size sets the size (float) of each box side (default 1)
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateBox(e, t, r, n, i) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a sphere mesh.
   * @param name defines the name of the mesh to create
   * @param segments sets the sphere number of horizontal stripes (positive integer, default 32)
   * @param diameter sets the diameter size (float) of the sphere (default 1)
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateSphere(e, t, r, n, i, s) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a hemisphere mesh.
   * @param name defines the name of the mesh to create
   * @param segments sets the sphere number of horizontal stripes (positive integer, default 32)
   * @param diameter sets the diameter size (float) of the sphere (default 1)
   * @param scene defines the hosting scene
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateHemisphere(e, t, r, n) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a cylinder or a cone mesh.
   * @param name defines the name of the mesh to create
   * @param height sets the height size (float) of the cylinder/cone (float, default 2)
   * @param diameterTop set the top cap diameter (floats, default 1)
   * @param diameterBottom set the bottom cap diameter (floats, default 1). This value can't be zero
   * @param tessellation sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance
   * @param subdivisions sets the number of rings along the cylinder height (positive integer, default 1)
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateCylinder(e, t, r, n, i, s, a, f, o) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  // Torus  (Code from SharpDX.org)
  /**
   * Creates a torus mesh.
   * @param name defines the name of the mesh to create
   * @param diameter sets the diameter size (float) of the torus (default 1)
   * @param thickness sets the diameter size of the tube of the torus (float, default 0.5)
   * @param tessellation sets the number of torus sides (positive integer, default 16)
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateTorus(e, t, r, n, i, s, a) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a torus knot mesh.
   * @param name defines the name of the mesh to create
   * @param radius sets the global radius size (float) of the torus knot (default 2)
   * @param tube sets the diameter size of the tube of the torus (float, default 0.5)
   * @param radialSegments sets the number of sides on each tube segments (positive integer, default 32)
   * @param tubularSegments sets the number of tubes to decompose the knot into (positive integer, default 32)
   * @param p the number of windings on X axis (positive integers, default 2)
   * @param q the number of windings on Y axis (positive integers, default 3)
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateTorusKnot(e, t, r, n, i, s, a, f, o, d) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a line mesh..
   * @param name defines the name of the mesh to create
   * @param points is an array successive Vector3
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param instance is an instance of an existing LineMesh object to be updated with the passed `points` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines).
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateLines(e, t, r, n, i) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a dashed line mesh.
   * @param name defines the name of the mesh to create
   * @param points is an array successive Vector3
   * @param dashSize is the size of the dashes relatively the dash number (positive float, default 3)
   * @param gapSize is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)
   * @param dashNb is the intended total number of dashes (positive integer, default 200)
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param instance is an instance of an existing LineMesh object to be updated with the passed `points` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateDashedLines(e, t, r, n, i, s, a, f) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a polygon mesh.Please consider using the same method from the MeshBuilder class instead
   * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh.
   * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors.
   * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
   * Remember you can only change the shape positions, not their number when updating a polygon.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#non-regular-polygon
   * @param name defines the name of the mesh to create
   * @param shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
   * @param scene defines the hosting scene
   * @param holes is a required array of arrays of successive Vector3 used to defines holes in the polygon
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @param earcutInjection can be used to inject your own earcut reference
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreatePolygon(e, t, r, n, i, s, a) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates an extruded polygon mesh, with depth in the Y direction..
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-non-regular-polygon
   * @param name defines the name of the mesh to create
   * @param shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
   * @param depth defines the height of extrusion
   * @param scene defines the hosting scene
   * @param holes is a required array of arrays of successive Vector3 used to defines holes in the polygon
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @param earcutInjection can be used to inject your own earcut reference
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static ExtrudePolygon(e, t, r, n, i, s, a, f) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates an extruded shape mesh.
   * The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes
   * @param name defines the name of the mesh to create
   * @param shape is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis
   * @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along
   * @param scale is the value to scale the shape
   * @param rotation is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve
   * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @param instance is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#extruded-shape)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static ExtrudeShape(e, t, r, n, i, s, a, f, o, d) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates an custom extruded shape mesh.
   * The custom extrusion is a parametric shape.
   * It has no predefined shape. Its final shape will depend on the input parameters.
   *
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes
   * @param name defines the name of the mesh to create
   * @param shape is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis
   * @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along
   * @param scaleFunction is a custom Javascript function called on each path point
   * @param rotationFunction is a custom Javascript function called on each path point
   * @param ribbonCloseArray forces the extrusion underlying ribbon to close all the paths in its `pathArray`
   * @param ribbonClosePath forces the extrusion underlying ribbon to close its `pathArray`
   * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @param instance is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters (https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shape)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static ExtrudeShapeCustom(e, t, r, n, i, s, a, f, o, d, v, u) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates lathe mesh.
   * The lathe is a shape with a symmetry axis : a 2D model shape is rotated around this axis to design the lathe.
   * @param name defines the name of the mesh to create
   * @param shape is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero
   * @param radius is the radius value of the lathe
   * @param tessellation is the side number of the lathe.
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateLathe(e, t, r, n, i, s, a) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a plane mesh.
   * @param name defines the name of the mesh to create
   * @param size sets the size (float) of both sides of the plane at once (default 1)
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreatePlane(e, t, r, n, i) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a ground mesh.
   * @param name defines the name of the mesh to create
   * @param width set the width of the ground
   * @param height set the height of the ground
   * @param subdivisions sets the number of subdivisions per side
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateGround(e, t, r, n, i, s) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a tiled ground mesh.
   * @param name defines the name of the mesh to create
   * @param xmin set the ground minimum X coordinate
   * @param zmin set the ground minimum Y coordinate
   * @param xmax set the ground maximum X coordinate
   * @param zmax set the ground maximum Z coordinate
   * @param subdivisions is an object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile
   * @param precision is an object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the numbers of subdivisions on the ground width and height of each tile
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateTiledGround(e, t, r, n, i, s, a, f, o) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a ground mesh from a height map.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/height_map
   * @param name defines the name of the mesh to create
   * @param url sets the URL of the height map image resource
   * @param width set the ground width size
   * @param height set the ground height size
   * @param subdivisions sets the number of subdivision per side
   * @param minHeight is the minimum altitude on the ground
   * @param maxHeight is the maximum altitude on the ground
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param onReady  is a callback function that will be called  once the mesh is built (the height map download can last some time)
   * @param alphaFilter will filter any data where the alpha channel is below this value, defaults 0 (all data visible)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateGroundFromHeightMap(e, t, r, n, i, s, a, f, o, d, v) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a tube mesh.
   * The tube is a parametric shape.
   * It has no predefined shape. Its final shape will depend on the input parameters.
   *
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
   * @param name defines the name of the mesh to create
   * @param path is a required array of successive Vector3. It is the curve used as the axis of the tube
   * @param radius sets the tube radius size
   * @param tessellation is the number of sides on the tubular surface
   * @param radiusFunction is a custom function. If it is not null, it overrides the parameter `radius`. This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path
   * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
   * @param scene defines the hosting scene
   * @param updatable defines if the mesh must be flagged as updatable
   * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
   * @param instance is an instance of an existing Tube object to be updated with the passed `pathArray` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#tube)
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateTube(e, t, r, n, i, s, a, f, o, d) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a polyhedron mesh.
   *.
   * * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embedded types. Please refer to the type sheet in the tutorial to choose the wanted type
   * * The parameter `size` (positive float, default 1) sets the polygon size
   * * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value)
   * * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`
   * * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
   * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
   * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
   * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
   * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
   * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
   * @param name defines the name of the mesh to create
   * @param options defines the options used to create the mesh
   * @param scene defines the hosting scene
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreatePolyhedron(e, t, r) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided
   * * The parameter `radius` sets the radius size (float) of the icosphere (default 1)
   * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value than `radius`)
   * * The parameter `subdivisions` sets the number of subdivisions (positive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
   * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
   * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
   * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
   * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra#icosphere
   * @param name defines the name of the mesh
   * @param options defines the options used to create the mesh
   * @param scene defines the hosting scene
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateIcoSphere(e, t, r) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Creates a decal mesh.
   *.
   * A decal is a mesh usually applied as a model onto the surface of another mesh
   * @param name  defines the name of the mesh
   * @param sourceMesh defines the mesh receiving the decal
   * @param position sets the position of the decal in world coordinates
   * @param normal sets the normal of the mesh where the decal is applied onto in world coordinates
   * @param size sets the decal scaling
   * @param angle sets the angle to rotate the decal
   * @returns a new Mesh
   * @deprecated Please use MeshBuilder instead
   */
  static CreateDecal(e, t, r, n, i, s) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /** Creates a Capsule Mesh
   * @param name defines the name of the mesh.
   * @param options the constructors options used to shape the mesh.
   * @param scene defines the scene the mesh is scoped to.
   * @returns the capsule mesh
   * @see https://doc.babylonjs.com/how_to/capsule_shape
   * @deprecated Please use MeshBuilder instead
   */
  static CreateCapsule(e, t, r) {
    throw new Error("Import MeshBuilder to populate this function");
  }
  /**
   * Extends a mesh to a Goldberg mesh
   * Warning  the mesh to convert MUST be an import of a perviously exported Goldberg mesh
   * @param mesh the mesh to convert
   * @returns the extended mesh
   * @deprecated Please use ExtendMeshToGoldberg instead
   */
  static ExtendToGoldberg(e) {
    throw new Error("Import MeshBuilder to populate this function");
  }
}
Ee.FRONTSIDE = Ut.FRONTSIDE;
Ee.BACKSIDE = Ut.BACKSIDE;
Ee.DOUBLESIDE = Ut.DOUBLESIDE;
Ee.DEFAULTSIDE = Ut.DEFAULTSIDE;
Ee.NO_CAP = 0;
Ee.CAP_START = 1;
Ee.CAP_END = 2;
Ee.CAP_ALL = 3;
Ee.NO_FLIP = 0;
Ee.FLIP_TILE = 1;
Ee.ROTATE_TILE = 2;
Ee.FLIP_ROW = 3;
Ee.ROTATE_ROW = 4;
Ee.FLIP_N_ROTATE_TILE = 5;
Ee.FLIP_N_ROTATE_ROW = 6;
Ee.CENTER = 0;
Ee.LEFT = 1;
Ee.RIGHT = 2;
Ee.TOP = 3;
Ee.BOTTOM = 4;
Ee.INSTANCEDMESH_SORT_TRANSPARENT = !1;
Ee._GroundMeshParser = (A, e) => {
  throw qn("GroundMesh");
};
Ee._GoldbergMeshParser = (A, e) => {
  throw qn("GoldbergMesh");
};
Ee._LinesMeshParser = (A, e) => {
  throw qn("LinesMesh");
};
Ee._GreasedLineMeshParser = (A, e) => {
  throw qn("GreasedLineMesh");
};
Ee._GreasedLineRibbonMeshParser = (A, e) => {
  throw qn("GreasedLineRibbonMesh");
};
Ee._TrailMeshParser = (A, e) => {
  throw qn("TrailMesh");
};
Ue("BABYLON.Mesh", Ee);
Ee._instancedMeshFactory = (A, e) => {
  const t = new bp(A, e);
  if (e.instancedBuffers) {
    t.instancedBuffers = {};
    for (const r in e.instancedBuffers)
      t.instancedBuffers[r] = e.instancedBuffers[r];
  }
  return t;
};
class bp extends jn {
  /**
   * Creates a new InstancedMesh object from the mesh source.
   * @param name defines the name of the instance
   * @param source the mesh to create the instance from
   */
  constructor(e, t) {
    super(e, t.getScene()), this._indexInSourceMeshInstanceArray = -1, this._distanceToCamera = 0, t.addInstance(this), this._sourceMesh = t, this._unIndexed = t._unIndexed, this.position.copyFrom(t.position), this.rotation.copyFrom(t.rotation), this.scaling.copyFrom(t.scaling), t.rotationQuaternion && (this.rotationQuaternion = t.rotationQuaternion.clone()), this.animations = t.animations.slice();
    for (const r of t.getAnimationRanges())
      r != null && this.createAnimationRange(r.name, r.from, r.to);
    this.infiniteDistance = t.infiniteDistance, this.setPivotMatrix(t.getPivotMatrix()), this.refreshBoundingInfo(!0, !0), this._syncSubMeshes();
  }
  /**
   * Returns the string "InstancedMesh".
   */
  getClassName() {
    return "InstancedMesh";
  }
  /** Gets the list of lights affecting that mesh */
  get lightSources() {
    return this._sourceMesh._lightSources;
  }
  _resyncLightSources() {
  }
  _resyncLightSource() {
  }
  _removeLightSource() {
  }
  // Methods
  /**
   * If the source mesh receives shadows
   */
  get receiveShadows() {
    return this._sourceMesh.receiveShadows;
  }
  set receiveShadows(e) {
    var t;
    ((t = this._sourceMesh) === null || t === void 0 ? void 0 : t.receiveShadows) !== e && ye.Warn("Setting receiveShadows on an instanced mesh has no effect");
  }
  /**
   * The material of the source mesh
   */
  get material() {
    return this._sourceMesh.material;
  }
  set material(e) {
    var t;
    ((t = this._sourceMesh) === null || t === void 0 ? void 0 : t.material) !== e && ye.Warn("Setting material on an instanced mesh has no effect");
  }
  /**
   * Visibility of the source mesh
   */
  get visibility() {
    return this._sourceMesh.visibility;
  }
  set visibility(e) {
    var t;
    ((t = this._sourceMesh) === null || t === void 0 ? void 0 : t.visibility) !== e && ye.Warn("Setting visibility on an instanced mesh has no effect");
  }
  /**
   * Skeleton of the source mesh
   */
  get skeleton() {
    return this._sourceMesh.skeleton;
  }
  set skeleton(e) {
    var t;
    ((t = this._sourceMesh) === null || t === void 0 ? void 0 : t.skeleton) !== e && ye.Warn("Setting skeleton on an instanced mesh has no effect");
  }
  /**
   * Rendering ground id of the source mesh
   */
  get renderingGroupId() {
    return this._sourceMesh.renderingGroupId;
  }
  set renderingGroupId(e) {
    !this._sourceMesh || e === this._sourceMesh.renderingGroupId || Se.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene");
  }
  /**
   * Returns the total number of vertices (integer).
   */
  getTotalVertices() {
    return this._sourceMesh ? this._sourceMesh.getTotalVertices() : 0;
  }
  /**
   * Returns a positive integer : the total number of indices in this mesh geometry.
   * @returns the number of indices or zero if the mesh has no geometry.
   */
  getTotalIndices() {
    return this._sourceMesh.getTotalIndices();
  }
  /**
   * The source mesh of the instance
   */
  get sourceMesh() {
    return this._sourceMesh;
  }
  /**
   * Creates a new InstancedMesh object from the mesh model.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
   * @param name defines the name of the new instance
   * @returns a new InstancedMesh
   */
  createInstance(e) {
    return this._sourceMesh.createInstance(e);
  }
  /**
   * Is this node ready to be used/rendered
   * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
   * @returns {boolean} is it ready
   */
  isReady(e = !1) {
    return this._sourceMesh.isReady(e, !0);
  }
  /**
   * Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
   * @param kind kind of verticies to retrieve (eg. positions, normals, uvs, etc.)
   * @param copyWhenShared If true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one.
   * @param forceCopy defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
   * @returns a float array or a Float32Array of the requested kind of data : positions, normals, uvs, etc.
   */
  getVerticesData(e, t, r) {
    return this._sourceMesh.getVerticesData(e, t, r);
  }
  /**
   * Sets the vertex data of the mesh geometry for the requested `kind`.
   * If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data.
   * The `data` are either a numeric array either a Float32Array.
   * The parameter `updatable` is passed as is to the underlying Geometry object constructor (if initially none) or updater.
   * The parameter `stride` is an optional positive integer, it is usually automatically deducted from the `kind` (3 for positions or normals, 2 for UV, etc).
   * Note that a new underlying VertexBuffer object is created each call.
   * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
   *
   * Possible `kind` values :
   * - VertexBuffer.PositionKind
   * - VertexBuffer.UVKind
   * - VertexBuffer.UV2Kind
   * - VertexBuffer.UV3Kind
   * - VertexBuffer.UV4Kind
   * - VertexBuffer.UV5Kind
   * - VertexBuffer.UV6Kind
   * - VertexBuffer.ColorKind
   * - VertexBuffer.MatricesIndicesKind
   * - VertexBuffer.MatricesIndicesExtraKind
   * - VertexBuffer.MatricesWeightsKind
   * - VertexBuffer.MatricesWeightsExtraKind
   *
   * Returns the Mesh.
   * @param kind
   * @param data
   * @param updatable
   * @param stride
   */
  setVerticesData(e, t, r, n) {
    return this.sourceMesh && this.sourceMesh.setVerticesData(e, t, r, n), this.sourceMesh;
  }
  /**
   * Updates the existing vertex data of the mesh geometry for the requested `kind`.
   * If the mesh has no geometry, it is simply returned as it is.
   * The `data` are either a numeric array either a Float32Array.
   * No new underlying VertexBuffer object is created.
   * If the `kind` is the `PositionKind` and if `updateExtends` is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
   * If the parameter `makeItUnique` is true, a new global geometry is created from this positions and is set to the mesh.
   *
   * Possible `kind` values :
   * - VertexBuffer.PositionKind
   * - VertexBuffer.UVKind
   * - VertexBuffer.UV2Kind
   * - VertexBuffer.UV3Kind
   * - VertexBuffer.UV4Kind
   * - VertexBuffer.UV5Kind
   * - VertexBuffer.UV6Kind
   * - VertexBuffer.ColorKind
   * - VertexBuffer.MatricesIndicesKind
   * - VertexBuffer.MatricesIndicesExtraKind
   * - VertexBuffer.MatricesWeightsKind
   * - VertexBuffer.MatricesWeightsExtraKind
   *
   * Returns the Mesh.
   * @param kind
   * @param data
   * @param updateExtends
   * @param makeItUnique
   */
  updateVerticesData(e, t, r, n) {
    return this.sourceMesh && this.sourceMesh.updateVerticesData(e, t, r, n), this.sourceMesh;
  }
  /**
   * Sets the mesh indices.
   * Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array).
   * If the mesh has no geometry, a new Geometry object is created and set to the mesh.
   * This method creates a new index buffer each call.
   * Returns the Mesh.
   * @param indices
   * @param totalVertices
   */
  setIndices(e, t = null) {
    return this.sourceMesh && this.sourceMesh.setIndices(e, t), this.sourceMesh;
  }
  /**
   * Boolean : True if the mesh owns the requested kind of data.
   * @param kind
   */
  isVerticesDataPresent(e) {
    return this._sourceMesh.isVerticesDataPresent(e);
  }
  /**
   * Returns an array of indices (IndicesArray).
   */
  getIndices() {
    return this._sourceMesh.getIndices();
  }
  get _positions() {
    return this._sourceMesh._positions;
  }
  /**
   * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
   * This means the mesh underlying bounding box and sphere are recomputed.
   * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
   * @param applyMorph  defines whether to apply the morph target before computing the bounding info
   * @returns the current mesh
   */
  refreshBoundingInfo(e = !1, t = !1) {
    if (this.hasBoundingInfo && this.getBoundingInfo().isLocked)
      return this;
    const r = this._sourceMesh.geometry ? this._sourceMesh.geometry.boundingBias : null;
    return this._refreshBoundingInfo(this._sourceMesh._getPositionData(e, t), r), this;
  }
  /** @internal */
  _preActivate() {
    return this._currentLOD && this._currentLOD._preActivate(), this;
  }
  /**
   * @internal
   */
  _activate(e, t) {
    if (super._activate(e, t), this._sourceMesh.subMeshes || Se.Warn("Instances should only be created for meshes with geometry."), this._currentLOD) {
      if (this._currentLOD._getWorldMatrixDeterminant() >= 0 != this._getWorldMatrixDeterminant() >= 0)
        return this._internalAbstractMeshDataInfo._actAsRegularMesh = !0, !0;
      if (this._internalAbstractMeshDataInfo._actAsRegularMesh = !1, this._currentLOD._registerInstanceForRenderId(this, e), t) {
        if (!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)
          return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = !0, !0;
      } else if (!this._currentLOD._internalAbstractMeshDataInfo._isActive)
        return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances = !0, !0;
    }
    return !1;
  }
  /** @internal */
  _postActivate() {
    this._sourceMesh.edgesShareWithInstances && this._sourceMesh._edgesRenderer && this._sourceMesh._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup ? (this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer), this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())) : this._edgesRenderer && this._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup && this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer);
  }
  getWorldMatrix() {
    if (this._currentLOD && this._currentLOD.billboardMode !== Hr.BILLBOARDMODE_NONE && this._currentLOD._masterMesh !== this) {
      this._billboardWorldMatrix || (this._billboardWorldMatrix = new he());
      const e = this._currentLOD._masterMesh;
      return this._currentLOD._masterMesh = this, ue.Vector3[7].copyFrom(this._currentLOD.position), this._currentLOD.position.set(0, 0, 0), this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)), this._currentLOD.position.copyFrom(ue.Vector3[7]), this._currentLOD._masterMesh = e, this._billboardWorldMatrix;
    }
    return super.getWorldMatrix();
  }
  get isAnInstance() {
    return !0;
  }
  /**
   * Returns the current associated LOD AbstractMesh.
   * @param camera
   */
  getLOD(e) {
    if (!e)
      return this;
    const t = this.sourceMesh.getLODLevels();
    if (!t || t.length === 0)
      this._currentLOD = this.sourceMesh;
    else {
      const r = this.getBoundingInfo();
      this._currentLOD = this.sourceMesh.getLOD(e, r.boundingSphere);
    }
    return this._currentLOD;
  }
  /**
   * @internal
   */
  _preActivateForIntermediateRendering(e) {
    return this.sourceMesh._preActivateForIntermediateRendering(e);
  }
  /** @internal */
  _syncSubMeshes() {
    if (this.releaseSubMeshes(), this._sourceMesh.subMeshes)
      for (let e = 0; e < this._sourceMesh.subMeshes.length; e++)
        this._sourceMesh.subMeshes[e].clone(this, this._sourceMesh);
    return this;
  }
  /** @internal */
  _generatePointsArray() {
    return this._sourceMesh._generatePointsArray();
  }
  /** @internal */
  _updateBoundingInfo() {
    return this.hasBoundingInfo ? this.getBoundingInfo().update(this.worldMatrixFromCache) : this.buildBoundingInfo(this.absolutePosition, this.absolutePosition, this.worldMatrixFromCache), this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache), this;
  }
  /**
   * Creates a new InstancedMesh from the current mesh.
   *
   * Returns the clone.
   * @param name the cloned mesh name
   * @param newParent the optional Node to parent the clone to.
   * @param doNotCloneChildren if `true` the model children aren't cloned.
   * @param newSourceMesh if set this mesh will be used as the source mesh instead of ths instance's one
   * @returns the clone
   */
  clone(e, t = null, r, n) {
    const i = (n || this._sourceMesh).createInstance(e);
    if (sA.DeepCopy(this, i, [
      "name",
      "subMeshes",
      "uniqueId",
      "parent",
      "lightSources",
      "receiveShadows",
      "material",
      "visibility",
      "skeleton",
      "sourceMesh",
      "isAnInstance",
      "facetNb",
      "isFacetDataEnabled",
      "isBlocked",
      "useBones",
      "hasInstances",
      "collider",
      "edgesRenderer",
      "forward",
      "up",
      "right",
      "absolutePosition",
      "absoluteScaling",
      "absoluteRotationQuaternion",
      "isWorldMatrixFrozen",
      "nonUniformScaling",
      "behaviors",
      "worldMatrixFromCache",
      "hasThinInstances",
      "hasBoundingInfo"
    ], []), this.refreshBoundingInfo(), t && (i.parent = t), !r)
      for (let s = 0; s < this.getScene().meshes.length; s++) {
        const a = this.getScene().meshes[s];
        a.parent === this && a.clone(a.name, i);
      }
    return i.computeWorldMatrix(!0), this.onClonedObservable.notifyObservers(i), i;
  }
  /**
   * Disposes the InstancedMesh.
   * Returns nothing.
   * @param doNotRecurse
   * @param disposeMaterialAndTextures
   */
  dispose(e, t = !1) {
    this._sourceMesh.removeInstance(this), super.dispose(e, t);
  }
  /**
   * @internal
   */
  _serializeAsParent(e) {
    super._serializeAsParent(e), e.parentId = this._sourceMesh.uniqueId, e.parentInstanceIndex = this._indexInSourceMeshInstanceArray;
  }
  /**
   * Instantiate (when possible) or clone that node with its hierarchy
   * @param newParent defines the new parent to use for the instance (or clone)
   * @param options defines options to configure how copy is done
   * @param options.doNotInstantiate defines if the model must be instantiated or just cloned
   * @param options.newSourcedMesh newSourcedMesh the new source mesh for the instance (or clone)
   * @param onNewNodeCreated defines an option callback to call when a clone or an instance is created
   * @returns an instance (or a clone) of the current node with its hierarchy
   */
  instantiateHierarchy(e = null, t, r) {
    const n = this.clone("Clone of " + (this.name || this.id), e || this.parent, !0, t && t.newSourcedMesh);
    n && r && r(this, n);
    for (const i of this.getChildTransformNodes(!0))
      i.instantiateHierarchy(n, t, r);
    return n;
  }
}
Ee.prototype.registerInstancedBuffer = function(A, e) {
  var t, r;
  if ((r = (t = this._userInstancedBuffersStorage) === null || t === void 0 ? void 0 : t.vertexBuffers[A]) === null || r === void 0 || r.dispose(), !this.instancedBuffers) {
    this.instancedBuffers = {};
    for (const n of this.instances)
      n.instancedBuffers = {};
  }
  this._userInstancedBuffersStorage || (this._userInstancedBuffersStorage = {
    data: {},
    vertexBuffers: {},
    strides: {},
    sizes: {},
    vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : void 0
  }), this.instancedBuffers[A] = null, this._userInstancedBuffersStorage.strides[A] = e, this._userInstancedBuffersStorage.sizes[A] = e * 32, this._userInstancedBuffersStorage.data[A] = new Float32Array(this._userInstancedBuffersStorage.sizes[A]), this._userInstancedBuffersStorage.vertexBuffers[A] = new J(this.getEngine(), this._userInstancedBuffersStorage.data[A], A, !0, !1, e, !0);
  for (const n of this.instances)
    n.instancedBuffers[A] = null;
  this._invalidateInstanceVertexArrayObject(), this._markSubMeshesAsAttributesDirty();
};
Ee.prototype._processInstancedBuffers = function(A, e) {
  const t = A ? A.length : 0;
  for (const r in this.instancedBuffers) {
    let n = this._userInstancedBuffersStorage.sizes[r];
    const i = this._userInstancedBuffersStorage.strides[r], s = (t + 1) * i;
    for (; n < s; )
      n *= 2;
    this._userInstancedBuffersStorage.data[r].length != n && (this._userInstancedBuffersStorage.data[r] = new Float32Array(n), this._userInstancedBuffersStorage.sizes[r] = n, this._userInstancedBuffersStorage.vertexBuffers[r] && (this._userInstancedBuffersStorage.vertexBuffers[r].dispose(), this._userInstancedBuffersStorage.vertexBuffers[r] = null));
    const a = this._userInstancedBuffersStorage.data[r];
    let f = 0;
    if (e) {
      const o = this.instancedBuffers[r];
      o.toArray ? o.toArray(a, f) : o.copyToArray ? o.copyToArray(a, f) : a[f] = o, f += i;
    }
    for (let o = 0; o < t; o++) {
      const v = A[o].instancedBuffers[r];
      v.toArray ? v.toArray(a, f) : v.copyToArray ? v.copyToArray(a, f) : a[f] = v, f += i;
    }
    this._userInstancedBuffersStorage.vertexBuffers[r] ? this._userInstancedBuffersStorage.vertexBuffers[r].updateDirectly(a, 0) : (this._userInstancedBuffersStorage.vertexBuffers[r] = new J(this.getEngine(), this._userInstancedBuffersStorage.data[r], r, !0, !1, i, !0), this._invalidateInstanceVertexArrayObject());
  }
};
Ee.prototype._invalidateInstanceVertexArrayObject = function() {
  if (!(!this._userInstancedBuffersStorage || this._userInstancedBuffersStorage.vertexArrayObjects === void 0)) {
    for (const A in this._userInstancedBuffersStorage.vertexArrayObjects)
      this.getEngine().releaseVertexArrayObject(this._userInstancedBuffersStorage.vertexArrayObjects[A]);
    this._userInstancedBuffersStorage.vertexArrayObjects = {};
  }
};
Ee.prototype._disposeInstanceSpecificData = function() {
  for (this._instanceDataStorage.instancesBuffer && (this._instanceDataStorage.instancesBuffer.dispose(), this._instanceDataStorage.instancesBuffer = null); this.instances.length; )
    this.instances[0].dispose();
  for (const A in this.instancedBuffers)
    this._userInstancedBuffersStorage.vertexBuffers[A] && this._userInstancedBuffersStorage.vertexBuffers[A].dispose();
  this._invalidateInstanceVertexArrayObject(), this.instancedBuffers = {};
};
class ci extends Cs {
  /**
   * Defines how far from the source the light is impacting in scene units.
   * Note: Unused in PBR material as the distance light falloff is defined following the inverse squared falloff.
   */
  get range() {
    return this._range;
  }
  /**
   * Defines how far from the source the light is impacting in scene units.
   * Note: Unused in PBR material as the distance light falloff is defined following the inverse squared falloff.
   */
  set range(e) {
    this._range = e, this._inverseSquaredRange = 1 / (this.range * this.range);
  }
  /**
   * Gets the photometric scale used to interpret the intensity.
   * This is only relevant with PBR Materials where the light intensity can be defined in a physical way.
   */
  get intensityMode() {
    return this._intensityMode;
  }
  /**
   * Sets the photometric scale used to interpret the intensity.
   * This is only relevant with PBR Materials where the light intensity can be defined in a physical way.
   */
  set intensityMode(e) {
    this._intensityMode = e, this._computePhotometricScale();
  }
  /**
   * Gets the light radius used by PBR Materials to simulate soft area lights.
   */
  get radius() {
    return this._radius;
  }
  /**
   * sets the light radius used by PBR Materials to simulate soft area lights.
   */
  set radius(e) {
    this._radius = e, this._computePhotometricScale();
  }
  /**
   * Gets whether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching
   * the current shadow generator.
   */
  get shadowEnabled() {
    return this._shadowEnabled;
  }
  /**
   * Sets whether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching
   * the current shadow generator.
   */
  set shadowEnabled(e) {
    this._shadowEnabled !== e && (this._shadowEnabled = e, this._markMeshesAsLightDirty());
  }
  /**
   * Gets the only meshes impacted by this light.
   */
  get includedOnlyMeshes() {
    return this._includedOnlyMeshes;
  }
  /**
   * Sets the only meshes impacted by this light.
   */
  set includedOnlyMeshes(e) {
    this._includedOnlyMeshes = e, this._hookArrayForIncludedOnly(e);
  }
  /**
   * Gets the meshes not impacted by this light.
   */
  get excludedMeshes() {
    return this._excludedMeshes;
  }
  /**
   * Sets the meshes not impacted by this light.
   */
  set excludedMeshes(e) {
    this._excludedMeshes = e, this._hookArrayForExcluded(e);
  }
  /**
   * Gets the layer id use to find what meshes are not impacted by the light.
   * Inactive if 0
   */
  get excludeWithLayerMask() {
    return this._excludeWithLayerMask;
  }
  /**
   * Sets the layer id use to find what meshes are not impacted by the light.
   * Inactive if 0
   */
  set excludeWithLayerMask(e) {
    this._excludeWithLayerMask = e, this._resyncMeshes();
  }
  /**
   * Gets the layer id use to find what meshes are impacted by the light.
   * Inactive if 0
   */
  get includeOnlyWithLayerMask() {
    return this._includeOnlyWithLayerMask;
  }
  /**
   * Sets the layer id use to find what meshes are impacted by the light.
   * Inactive if 0
   */
  set includeOnlyWithLayerMask(e) {
    this._includeOnlyWithLayerMask = e, this._resyncMeshes();
  }
  /**
   * Gets the lightmap mode of this light (should be one of the constants defined by Light.LIGHTMAP_x)
   */
  get lightmapMode() {
    return this._lightmapMode;
  }
  /**
   * Sets the lightmap mode of this light (should be one of the constants defined by Light.LIGHTMAP_x)
   */
  set lightmapMode(e) {
    this._lightmapMode !== e && (this._lightmapMode = e, this._markMeshesAsLightDirty());
  }
  /**
   * Creates a Light object in the scene.
   * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
   * @param name The friendly name of the light
   * @param scene The scene the light belongs too
   */
  constructor(e, t) {
    super(e, t), this.diffuse = new Ne(1, 1, 1), this.specular = new Ne(1, 1, 1), this.falloffType = ci.FALLOFF_DEFAULT, this.intensity = 1, this._range = Number.MAX_VALUE, this._inverseSquaredRange = 0, this._photometricScale = 1, this._intensityMode = ci.INTENSITYMODE_AUTOMATIC, this._radius = 1e-5, this.renderPriority = 0, this._shadowEnabled = !0, this._excludeWithLayerMask = 0, this._includeOnlyWithLayerMask = 0, this._lightmapMode = 0, this._shadowGenerators = null, this._excludedMeshesIds = new Array(), this._includedOnlyMeshesIds = new Array(), this._isLight = !0, this.getScene().addLight(this), this._uniformBuffer = new yr(this.getScene().getEngine(), void 0, void 0, e), this._buildUniformLayout(), this.includedOnlyMeshes = [], this.excludedMeshes = [], this._resyncMeshes();
  }
  /**
   * Sets the passed Effect "effect" with the Light textures.
   * @param effect The effect to update
   * @param lightIndex The index of the light in the effect to update
   * @returns The light
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  transferTexturesToEffect(e, t) {
    return this;
  }
  /**
   * Binds the lights information from the scene to the effect for the given mesh.
   * @param lightIndex Light index
   * @param scene The scene where the light belongs to
   * @param effect The effect we are binding the data to
   * @param useSpecular Defines if specular is supported
   * @param receiveShadows Defines if the effect (mesh) we bind the light for receives shadows
   */
  _bindLight(e, t, r, n, i = !0) {
    var s;
    const a = e.toString();
    let f = !1;
    if (this._uniformBuffer.bindToEffect(r, "Light" + a), this._renderId !== t.getRenderId() || this._lastUseSpecular !== n || !this._uniformBuffer.useUbo) {
      this._renderId = t.getRenderId(), this._lastUseSpecular = n;
      const o = this.getScaledIntensity();
      this.transferToEffect(r, a), this.diffuse.scaleToRef(o, Hs.Color3[0]), this._uniformBuffer.updateColor4("vLightDiffuse", Hs.Color3[0], this.range, a), n && (this.specular.scaleToRef(o, Hs.Color3[1]), this._uniformBuffer.updateColor4("vLightSpecular", Hs.Color3[1], this.radius, a)), f = !0;
    }
    if (this.transferTexturesToEffect(r, a), t.shadowsEnabled && this.shadowEnabled && i) {
      const o = (s = this.getShadowGenerator(t.activeCamera)) !== null && s !== void 0 ? s : this.getShadowGenerator();
      o && (o.bindShadowLight(a, r), f = !0);
    }
    f ? this._uniformBuffer.update() : this._uniformBuffer.bindUniformBuffer();
  }
  /**
   * Returns the string "Light".
   * @returns the class name
   */
  getClassName() {
    return "Light";
  }
  /**
   * Converts the light information to a readable string for debug purpose.
   * @param fullDetails Supports for multiple levels of logging within scene loading
   * @returns the human readable light info
   */
  toString(e) {
    let t = "Name: " + this.name;
    if (t += ", type: " + ["Point", "Directional", "Spot", "Hemispheric"][this.getTypeID()], this.animations)
      for (let r = 0; r < this.animations.length; r++)
        t += ", animation[0]: " + this.animations[r].toString(e);
    return t;
  }
  /** @internal */
  _syncParentEnabledState() {
    super._syncParentEnabledState(), this.isDisposed() || this._resyncMeshes();
  }
  /**
   * Set the enabled state of this node.
   * @param value - the new enabled state
   */
  setEnabled(e) {
    super.setEnabled(e), this._resyncMeshes();
  }
  /**
   * Returns the Light associated shadow generator if any.
   * @param camera Camera for which the shadow generator should be retrieved (default: null). If null, retrieves the default shadow generator
   * @returns the associated shadow generator.
   */
  getShadowGenerator(e = null) {
    var t;
    return this._shadowGenerators === null ? null : (t = this._shadowGenerators.get(e)) !== null && t !== void 0 ? t : null;
  }
  /**
   * Returns all the shadow generators associated to this light
   * @returns
   */
  getShadowGenerators() {
    return this._shadowGenerators;
  }
  /**
   * Returns a Vector3, the absolute light position in the World.
   * @returns the world space position of the light
   */
  getAbsolutePosition() {
    return S.Zero();
  }
  /**
   * Specifies if the light will affect the passed mesh.
   * @param mesh The mesh to test against the light
   * @returns true the mesh is affected otherwise, false.
   */
  canAffectMesh(e) {
    return e ? !(this.includedOnlyMeshes && this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(e) === -1 || this.excludedMeshes && this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(e) !== -1 || this.includeOnlyWithLayerMask !== 0 && !(this.includeOnlyWithLayerMask & e.layerMask) || this.excludeWithLayerMask !== 0 && this.excludeWithLayerMask & e.layerMask) : !0;
  }
  /**
   * Releases resources associated with this node.
   * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
   * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
   */
  dispose(e, t = !1) {
    if (this._shadowGenerators) {
      const r = this._shadowGenerators.values();
      for (let n = r.next(); n.done !== !0; n = r.next())
        n.value.dispose();
      this._shadowGenerators = null;
    }
    if (this.getScene().stopAnimation(this), this._parentContainer) {
      const r = this._parentContainer.lights.indexOf(this);
      r > -1 && this._parentContainer.lights.splice(r, 1), this._parentContainer = null;
    }
    for (const r of this.getScene().meshes)
      r._removeLightSource(this, !0);
    this._uniformBuffer.dispose(), this.getScene().removeLight(this), super.dispose(e, t);
  }
  /**
   * Returns the light type ID (integer).
   * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
   */
  getTypeID() {
    return 0;
  }
  /**
   * Returns the intensity scaled by the Photometric Scale according to the light type and intensity mode.
   * @returns the scaled intensity in intensity mode unit
   */
  getScaledIntensity() {
    return this._photometricScale * this.intensity;
  }
  /**
   * Returns a new Light object, named "name", from the current one.
   * @param name The name of the cloned light
   * @param newParent The parent of this light, if it has one
   * @returns the new created light
   */
  clone(e, t = null) {
    const r = ci.GetConstructorFromName(this.getTypeID(), e, this.getScene());
    if (!r)
      return null;
    const n = jt.Clone(r, this);
    return e && (n.name = e), t && (n.parent = t), n.setEnabled(this.isEnabled()), this.onClonedObservable.notifyObservers(n), n;
  }
  /**
   * Serializes the current light into a Serialization object.
   * @returns the serialized object.
   */
  serialize() {
    const e = jt.Serialize(this);
    return e.uniqueId = this.uniqueId, e.type = this.getTypeID(), this.parent && this.parent._serializeAsParent(e), this.excludedMeshes.length > 0 && (e.excludedMeshesIds = [], this.excludedMeshes.forEach((t) => {
      e.excludedMeshesIds.push(t.id);
    })), this.includedOnlyMeshes.length > 0 && (e.includedOnlyMeshesIds = [], this.includedOnlyMeshes.forEach((t) => {
      e.includedOnlyMeshesIds.push(t.id);
    })), jt.AppendSerializedAnimations(this, e), e.ranges = this.serializeAnimationRanges(), e.isEnabled = this.isEnabled(), e;
  }
  /**
   * Creates a new typed light from the passed type (integer) : point light = 0, directional light = 1, spot light = 2, hemispheric light = 3.
   * This new light is named "name" and added to the passed scene.
   * @param type Type according to the types available in Light.LIGHTTYPEID_x
   * @param name The friendly name of the light
   * @param scene The scene the new light will belong to
   * @returns the constructor function
   */
  static GetConstructorFromName(e, t, r) {
    const n = Cs.Construct("Light_Type_" + e, t, r);
    return n || null;
  }
  /**
   * Parses the passed "parsedLight" and returns a new instanced Light from this parsing.
   * @param parsedLight The JSON representation of the light
   * @param scene The scene to create the parsed light in
   * @returns the created light after parsing
   */
  static Parse(e, t) {
    const r = ci.GetConstructorFromName(e.type, e.name, t);
    if (!r)
      return null;
    const n = jt.Parse(r, e, t);
    if (e.excludedMeshesIds && (n._excludedMeshesIds = e.excludedMeshesIds), e.includedOnlyMeshesIds && (n._includedOnlyMeshesIds = e.includedOnlyMeshesIds), e.parentId !== void 0 && (n._waitingParentId = e.parentId), e.parentInstanceIndex !== void 0 && (n._waitingParentInstanceIndex = e.parentInstanceIndex), e.falloffType !== void 0 && (n.falloffType = e.falloffType), e.lightmapMode !== void 0 && (n.lightmapMode = e.lightmapMode), e.animations) {
      for (let i = 0; i < e.animations.length; i++) {
        const s = e.animations[i], a = Jo("BABYLON.Animation");
        a && n.animations.push(a.Parse(s));
      }
      Cs.ParseAnimationRanges(n, e, t);
    }
    return e.autoAnimate && t.beginAnimation(n, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1), e.isEnabled !== void 0 && n.setEnabled(e.isEnabled), n;
  }
  _hookArrayForExcluded(e) {
    const t = e.push;
    e.push = (...n) => {
      const i = t.apply(e, n);
      for (const s of n)
        s._resyncLightSource(this);
      return i;
    };
    const r = e.splice;
    e.splice = (n, i) => {
      const s = r.apply(e, [n, i]);
      for (const a of s)
        a._resyncLightSource(this);
      return s;
    };
    for (const n of e)
      n._resyncLightSource(this);
  }
  _hookArrayForIncludedOnly(e) {
    const t = e.push;
    e.push = (...n) => {
      const i = t.apply(e, n);
      return this._resyncMeshes(), i;
    };
    const r = e.splice;
    e.splice = (n, i) => {
      const s = r.apply(e, [n, i]);
      return this._resyncMeshes(), s;
    }, this._resyncMeshes();
  }
  _resyncMeshes() {
    for (const e of this.getScene().meshes)
      e._resyncLightSource(this);
  }
  /**
   * Forces the meshes to update their light related information in their rendering used effects
   * @internal Internal Use Only
   */
  _markMeshesAsLightDirty() {
    for (const e of this.getScene().meshes)
      e.lightSources.indexOf(this) !== -1 && e._markSubMeshesAsLightDirty();
  }
  /**
   * Recomputes the cached photometric scale if needed.
   */
  _computePhotometricScale() {
    this._photometricScale = this._getPhotometricScale(), this.getScene().resetCachedMaterial();
  }
  /**
   * Returns the Photometric Scale according to the light type and intensity mode.
   */
  _getPhotometricScale() {
    let e = 0;
    const t = this.getTypeID();
    let r = this.intensityMode;
    switch (r === ci.INTENSITYMODE_AUTOMATIC && (t === ci.LIGHTTYPEID_DIRECTIONALLIGHT ? r = ci.INTENSITYMODE_ILLUMINANCE : r = ci.INTENSITYMODE_LUMINOUSINTENSITY), t) {
      case ci.LIGHTTYPEID_POINTLIGHT:
      case ci.LIGHTTYPEID_SPOTLIGHT:
        switch (r) {
          case ci.INTENSITYMODE_LUMINOUSPOWER:
            e = 1 / (4 * Math.PI);
            break;
          case ci.INTENSITYMODE_LUMINOUSINTENSITY:
            e = 1;
            break;
          case ci.INTENSITYMODE_LUMINANCE:
            e = this.radius * this.radius;
            break;
        }
        break;
      case ci.LIGHTTYPEID_DIRECTIONALLIGHT:
        switch (r) {
          case ci.INTENSITYMODE_ILLUMINANCE:
            e = 1;
            break;
          case ci.INTENSITYMODE_LUMINANCE: {
            let n = this.radius;
            n = Math.max(n, 1e-3), e = 2 * Math.PI * (1 - Math.cos(n));
            break;
          }
        }
        break;
      case ci.LIGHTTYPEID_HEMISPHERICLIGHT:
        e = 1;
        break;
    }
    return e;
  }
  /**
   * Reorder the light in the scene according to their defined priority.
   * @internal Internal Use Only
   */
  _reorderLightsInScene() {
    const e = this.getScene();
    this._renderPriority != 0 && (e.requireLightSorting = !0), this.getScene().sortLightsByPriority();
  }
}
ci.FALLOFF_DEFAULT = ra.FALLOFF_DEFAULT;
ci.FALLOFF_PHYSICAL = ra.FALLOFF_PHYSICAL;
ci.FALLOFF_GLTF = ra.FALLOFF_GLTF;
ci.FALLOFF_STANDARD = ra.FALLOFF_STANDARD;
ci.LIGHTMAP_DEFAULT = ra.LIGHTMAP_DEFAULT;
ci.LIGHTMAP_SPECULAR = ra.LIGHTMAP_SPECULAR;
ci.LIGHTMAP_SHADOWSONLY = ra.LIGHTMAP_SHADOWSONLY;
ci.INTENSITYMODE_AUTOMATIC = ra.INTENSITYMODE_AUTOMATIC;
ci.INTENSITYMODE_LUMINOUSPOWER = ra.INTENSITYMODE_LUMINOUSPOWER;
ci.INTENSITYMODE_LUMINOUSINTENSITY = ra.INTENSITYMODE_LUMINOUSINTENSITY;
ci.INTENSITYMODE_ILLUMINANCE = ra.INTENSITYMODE_ILLUMINANCE;
ci.INTENSITYMODE_LUMINANCE = ra.INTENSITYMODE_LUMINANCE;
ci.LIGHTTYPEID_POINTLIGHT = ra.LIGHTTYPEID_POINTLIGHT;
ci.LIGHTTYPEID_DIRECTIONALLIGHT = ra.LIGHTTYPEID_DIRECTIONALLIGHT;
ci.LIGHTTYPEID_SPOTLIGHT = ra.LIGHTTYPEID_SPOTLIGHT;
ci.LIGHTTYPEID_HEMISPHERICLIGHT = ra.LIGHTTYPEID_HEMISPHERICLIGHT;
C([
  Oi()
], ci.prototype, "diffuse", void 0);
C([
  Oi()
], ci.prototype, "specular", void 0);
C([
  M()
], ci.prototype, "falloffType", void 0);
C([
  M()
], ci.prototype, "intensity", void 0);
C([
  M()
], ci.prototype, "range", null);
C([
  M()
], ci.prototype, "intensityMode", null);
C([
  M()
], ci.prototype, "radius", null);
C([
  M()
], ci.prototype, "_renderPriority", void 0);
C([
  At("_reorderLightsInScene")
], ci.prototype, "renderPriority", void 0);
C([
  M("shadowEnabled")
], ci.prototype, "_shadowEnabled", void 0);
C([
  M("excludeWithLayerMask")
], ci.prototype, "_excludeWithLayerMask", void 0);
C([
  M("includeOnlyWithLayerMask")
], ci.prototype, "_includeOnlyWithLayerMask", void 0);
C([
  M("lightmapMode")
], ci.prototype, "_lightmapMode", void 0);
class Aee extends J1 {
}
class dee {
  constructor() {
    this.rootNodes = [], this.skeletons = [], this.animationGroups = [];
  }
  /**
   * Disposes the instantiated entries from the scene
   */
  dispose() {
    this.rootNodes.slice(0).forEach((e) => {
      e.dispose();
    }), this.rootNodes.length = 0, this.skeletons.slice(0).forEach((e) => {
      e.dispose();
    }), this.skeletons.length = 0, this.animationGroups.slice(0).forEach((e) => {
      e.dispose();
    }), this.animationGroups.length = 0;
  }
}
class xR extends J1 {
  /**
   * Instantiates an AssetContainer.
   * @param scene The scene the AssetContainer belongs to.
   */
  constructor(e) {
    super(), this._wasAddedToScene = !1, e = e || gr.LastCreatedScene, e && (this.scene = e, this.sounds = [], this.effectLayers = [], this.layers = [], this.lensFlareSystems = [], this.proceduralTextures = [], this.reflectionProbes = [], e.onDisposeObservable.add(() => {
      this._wasAddedToScene || this.dispose();
    }), this._onContextRestoredObserver = e.getEngine().onContextRestoredObservable.add(() => {
      for (const t of this.geometries)
        t._rebuild();
      for (const t of this.meshes)
        t._rebuild();
      for (const t of this.particleSystems)
        t.rebuild();
      for (const t of this.textures)
        t._rebuild();
    }));
  }
  /**
   * Given a list of nodes, return a topological sorting of them.
   * @param nodes
   */
  _topologicalSort(e) {
    const t = /* @__PURE__ */ new Map();
    for (const a of e)
      t.set(a.uniqueId, a);
    const r = {
      dependsOn: /* @__PURE__ */ new Map(),
      dependedBy: /* @__PURE__ */ new Map()
      // given a node id, what are the ids of the nodes that depend on it
    };
    for (const a of e) {
      const f = a.uniqueId;
      r.dependsOn.set(f, /* @__PURE__ */ new Set()), r.dependedBy.set(f, /* @__PURE__ */ new Set());
    }
    for (const a of e) {
      const f = a.uniqueId, o = r.dependsOn.get(f);
      if (a instanceof bp) {
        const v = a.sourceMesh;
        t.has(v.uniqueId) && (o.add(v.uniqueId), r.dependedBy.get(v.uniqueId).add(f));
      }
      const d = r.dependedBy.get(f);
      for (const v of a.getDescendants()) {
        const u = v.uniqueId;
        t.has(u) && (d.add(u), r.dependsOn.get(u).add(f));
      }
    }
    const n = [], i = [];
    for (const a of e) {
      const f = a.uniqueId;
      r.dependsOn.get(f).size === 0 && (i.push(a), t.delete(f));
    }
    const s = i;
    for (; s.length > 0; ) {
      const a = s.shift();
      n.push(a);
      const f = r.dependedBy.get(a.uniqueId);
      for (const o of Array.from(f.values())) {
        const d = r.dependsOn.get(o);
        d.delete(a.uniqueId), d.size === 0 && t.get(o) && (s.push(t.get(o)), t.delete(o));
      }
    }
    return t.size > 0 && (console.error("SceneSerializer._topologicalSort: There were unvisited nodes:"), t.forEach((a) => console.error(a.name))), n;
  }
  _addNodeAndDescendantsToList(e, t, r, n) {
    if (!(!r || n && !n(r) || t.has(r.uniqueId))) {
      e.push(r), t.add(r.uniqueId);
      for (const i of r.getDescendants(!0))
        this._addNodeAndDescendantsToList(e, t, i, n);
    }
  }
  /**
   * Check if a specific node is contained in this asset container.
   * @param node
   */
  _isNodeInContainer(e) {
    return e instanceof Ee && this.meshes.indexOf(e) !== -1 || e instanceof Hr && this.transformNodes.indexOf(e) !== -1 || e instanceof ci && this.lights.indexOf(e) !== -1 || e instanceof Tr && this.cameras.indexOf(e) !== -1;
  }
  /**
   * For every node in the scene, check if its parent node is also in the scene.
   */
  _isValidHierarchy() {
    for (const e of this.meshes)
      if (e.parent && !this._isNodeInContainer(e.parent))
        return Se.Warn(`Node ${e.name} has a parent that is not in the container.`), !1;
    for (const e of this.transformNodes)
      if (e.parent && !this._isNodeInContainer(e.parent))
        return Se.Warn(`Node ${e.name} has a parent that is not in the container.`), !1;
    for (const e of this.lights)
      if (e.parent && !this._isNodeInContainer(e.parent))
        return Se.Warn(`Node ${e.name} has a parent that is not in the container.`), !1;
    for (const e of this.cameras)
      if (e.parent && !this._isNodeInContainer(e.parent))
        return Se.Warn(`Node ${e.name} has a parent that is not in the container.`), !1;
    return !0;
  }
  /**
   * Instantiate or clone all meshes and add the new ones to the scene.
   * Skeletons and animation groups will all be cloned
   * @param nameFunction defines an optional function used to get new names for clones
   * @param cloneMaterials defines an optional boolean that defines if materials must be cloned as well (false by default)
   * @param options defines an optional list of options to control how to instantiate / clone models
   * @param options.doNotInstantiate defines if the model must be instantiated or just cloned
   * @param options.predicate defines a predicate used to filter whih mesh to instantiate/clone
   * @returns a list of rootNodes, skeletons and animation groups that were duplicated
   */
  instantiateModelsToScene(e, t = !1, r) {
    this._isValidHierarchy() || ye.Warn("SceneSerializer.InstantiateModelsToScene: The Asset Container hierarchy is not valid.");
    const n = {}, i = {}, s = new dee(), a = [], f = [], o = Object.assign({ doNotInstantiate: !0 }, r), d = (p, c) => {
      if (n[p.uniqueId] = c.uniqueId, i[c.uniqueId] = c, e && (c.name = e(p.name)), c instanceof Ee) {
        const H = c;
        if (H.morphTargetManager) {
          const T = p.morphTargetManager;
          H.morphTargetManager = T.clone();
          for (let q = 0; q < T.numTargets; q++) {
            const b = T.getTarget(q), j = H.morphTargetManager.getTarget(q);
            n[b.uniqueId] = j.uniqueId, i[j.uniqueId] = j;
          }
        }
      }
    }, v = [], u = /* @__PURE__ */ new Set();
    for (const p of this.transformNodes)
      p.parent === null && this._addNodeAndDescendantsToList(v, u, p, o.predicate);
    for (const p of this.meshes)
      p.parent === null && this._addNodeAndDescendantsToList(v, u, p, o.predicate);
    const l = this._topologicalSort(v), P = (p, c) => {
      if (d(p, c), p.parent) {
        const H = n[p.parent.uniqueId], T = i[H];
        T ? c.parent = T : c.parent = p.parent;
      }
      if (c.position && p.position && c.position.copyFrom(p.position), c.rotationQuaternion && p.rotationQuaternion && c.rotationQuaternion.copyFrom(p.rotationQuaternion), c.rotation && p.rotation && c.rotation.copyFrom(p.rotation), c.scaling && p.scaling && c.scaling.copyFrom(p.scaling), c.material) {
        const H = c;
        if (H.material)
          if (t) {
            const T = p.material;
            if (f.indexOf(T) === -1) {
              let q = T.clone(e ? e(T.name) : "Clone of " + T.name);
              if (f.push(T), n[T.uniqueId] = q.uniqueId, i[q.uniqueId] = q, T.getClassName() === "MultiMaterial") {
                const b = T;
                for (const j of b.subMaterials)
                  j && (q = j.clone(e ? e(j.name) : "Clone of " + j.name), f.push(j), n[j.uniqueId] = q.uniqueId, i[q.uniqueId] = q);
                b.subMaterials = b.subMaterials.map((j) => j && i[n[j.uniqueId]]);
              }
            }
            H.getClassName() !== "InstancedMesh" && (H.material = i[n[T.uniqueId]]);
          } else
            H.material.getClassName() === "MultiMaterial" ? this.scene.multiMaterials.indexOf(H.material) === -1 && this.scene.addMultiMaterial(H.material) : this.scene.materials.indexOf(H.material) === -1 && this.scene.addMaterial(H.material);
      }
      c.parent === null && s.rootNodes.push(c);
    };
    return l.forEach((p) => {
      if (p.getClassName() === "InstancedMesh") {
        const c = p, H = c.sourceMesh, T = n[H.uniqueId], b = (typeof T == "number" ? i[T] : H).createInstance(c.name);
        P(c, b);
      } else {
        let c = !0;
        p.getClassName() === "TransformNode" || p.getClassName() === "Node" || p.skeleton || !p.getTotalVertices || p.getTotalVertices() === 0 ? c = !1 : o.doNotInstantiate && (typeof o.doNotInstantiate == "function" ? c = !o.doNotInstantiate(p) : c = !o.doNotInstantiate);
        const H = c ? p.createInstance(`instance of ${p.name}`) : p.clone(`Clone of ${p.name}`, null, !0);
        if (!H)
          throw new Error(`Could not clone or instantiate node on Asset Container ${p.name}`);
        P(p, H);
      }
    }), this.skeletons.forEach((p) => {
      if (o.predicate && !o.predicate(p))
        return;
      const c = p.clone(e ? e(p.name) : "Clone of " + p.name);
      for (const H of this.meshes)
        if (H.skeleton === p && !H.isAnInstance) {
          const T = i[n[H.uniqueId]];
          if (!T || T.isAnInstance || (T.skeleton = c, a.indexOf(c) !== -1))
            continue;
          a.push(c);
          for (const q of c.bones)
            q._linkedTransformNode && (q._linkedTransformNode = i[n[q._linkedTransformNode.uniqueId]]);
        }
      s.skeletons.push(c);
    }), this.animationGroups.forEach((p) => {
      if (o.predicate && !o.predicate(p))
        return;
      const c = p.clone(e ? e(p.name) : "Clone of " + p.name, (H) => i[n[H.uniqueId]] || H);
      s.animationGroups.push(c);
    }), s;
  }
  /**
   * Adds all the assets from the container to the scene.
   */
  addAllToScene() {
    if (!this._wasAddedToScene) {
      this._isValidHierarchy() || ye.Warn("SceneSerializer.addAllToScene: The Asset Container hierarchy is not valid."), this._wasAddedToScene = !0, this.addToScene(null), this.environmentTexture && (this.scene.environmentTexture = this.environmentTexture);
      for (const e of this.scene._serializableComponents)
        e.addFromContainer(this);
      this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver), this._onContextRestoredObserver = null;
    }
  }
  /**
   * Adds assets from the container to the scene.
   * @param predicate defines a predicate used to select which entity will be added (can be null)
   */
  addToScene(e = null) {
    const t = [];
    this.cameras.forEach((r) => {
      e && !e(r) || (this.scene.addCamera(r), t.push(r));
    }), this.lights.forEach((r) => {
      e && !e(r) || (this.scene.addLight(r), t.push(r));
    }), this.meshes.forEach((r) => {
      e && !e(r) || (this.scene.addMesh(r), t.push(r));
    }), this.skeletons.forEach((r) => {
      e && !e(r) || this.scene.addSkeleton(r);
    }), this.animations.forEach((r) => {
      e && !e(r) || this.scene.addAnimation(r);
    }), this.animationGroups.forEach((r) => {
      e && !e(r) || this.scene.addAnimationGroup(r);
    }), this.multiMaterials.forEach((r) => {
      e && !e(r) || this.scene.addMultiMaterial(r);
    }), this.materials.forEach((r) => {
      e && !e(r) || this.scene.addMaterial(r);
    }), this.morphTargetManagers.forEach((r) => {
      e && !e(r) || this.scene.addMorphTargetManager(r);
    }), this.geometries.forEach((r) => {
      e && !e(r) || this.scene.addGeometry(r);
    }), this.transformNodes.forEach((r) => {
      e && !e(r) || (this.scene.addTransformNode(r), t.push(r));
    }), this.actionManagers.forEach((r) => {
      e && !e(r) || this.scene.addActionManager(r);
    }), this.textures.forEach((r) => {
      e && !e(r) || this.scene.addTexture(r);
    }), this.reflectionProbes.forEach((r) => {
      e && !e(r) || this.scene.addReflectionProbe(r);
    });
    for (const r of t)
      r.parent && this.scene.getNodes().indexOf(r.parent) === -1 && (r.setParent ? r.setParent(null) : r.parent = null);
  }
  /**
   * Removes all the assets in the container from the scene
   */
  removeAllFromScene() {
    this._isValidHierarchy() || ye.Warn("SceneSerializer.removeAllFromScene: The Asset Container hierarchy is not valid."), this._wasAddedToScene = !1, this.removeFromScene(null), this.environmentTexture === this.scene.environmentTexture && (this.scene.environmentTexture = null);
    for (const e of this.scene._serializableComponents)
      e.removeFromContainer(this);
  }
  /**
   * Removes assets in the container from the scene
   * @param predicate defines a predicate used to select which entity will be added (can be null)
   */
  removeFromScene(e = null) {
    this.cameras.forEach((t) => {
      e && !e(t) || this.scene.removeCamera(t);
    }), this.lights.forEach((t) => {
      e && !e(t) || this.scene.removeLight(t);
    }), this.meshes.forEach((t) => {
      e && !e(t) || this.scene.removeMesh(t, !0);
    }), this.skeletons.forEach((t) => {
      e && !e(t) || this.scene.removeSkeleton(t);
    }), this.animations.forEach((t) => {
      e && !e(t) || this.scene.removeAnimation(t);
    }), this.animationGroups.forEach((t) => {
      e && !e(t) || this.scene.removeAnimationGroup(t);
    }), this.multiMaterials.forEach((t) => {
      e && !e(t) || this.scene.removeMultiMaterial(t);
    }), this.materials.forEach((t) => {
      e && !e(t) || this.scene.removeMaterial(t);
    }), this.morphTargetManagers.forEach((t) => {
      e && !e(t) || this.scene.removeMorphTargetManager(t);
    }), this.geometries.forEach((t) => {
      e && !e(t) || this.scene.removeGeometry(t);
    }), this.transformNodes.forEach((t) => {
      e && !e(t) || this.scene.removeTransformNode(t);
    }), this.actionManagers.forEach((t) => {
      e && !e(t) || this.scene.removeActionManager(t);
    }), this.textures.forEach((t) => {
      e && !e(t) || this.scene.removeTexture(t);
    }), this.reflectionProbes.forEach((t) => {
      e && !e(t) || this.scene.removeReflectionProbe(t);
    });
  }
  /**
   * Disposes all the assets in the container
   */
  dispose() {
    this.cameras.slice(0).forEach((e) => {
      e.dispose();
    }), this.cameras.length = 0, this.lights.slice(0).forEach((e) => {
      e.dispose();
    }), this.lights.length = 0, this.meshes.slice(0).forEach((e) => {
      e.dispose();
    }), this.meshes.length = 0, this.skeletons.slice(0).forEach((e) => {
      e.dispose();
    }), this.skeletons.length = 0, this.animationGroups.slice(0).forEach((e) => {
      e.dispose();
    }), this.animationGroups.length = 0, this.multiMaterials.slice(0).forEach((e) => {
      e.dispose();
    }), this.multiMaterials.length = 0, this.materials.slice(0).forEach((e) => {
      e.dispose();
    }), this.materials.length = 0, this.geometries.slice(0).forEach((e) => {
      e.dispose();
    }), this.geometries.length = 0, this.transformNodes.slice(0).forEach((e) => {
      e.dispose();
    }), this.transformNodes.length = 0, this.actionManagers.slice(0).forEach((e) => {
      e.dispose();
    }), this.actionManagers.length = 0, this.textures.slice(0).forEach((e) => {
      e.dispose();
    }), this.textures.length = 0, this.reflectionProbes.slice(0).forEach((e) => {
      e.dispose();
    }), this.reflectionProbes.length = 0, this.morphTargetManagers.slice(0).forEach((e) => {
      e.dispose();
    }), this.morphTargetManagers.length = 0, this.environmentTexture && (this.environmentTexture.dispose(), this.environmentTexture = null);
    for (const e of this.scene._serializableComponents)
      e.removeFromContainer(this, !0);
    this._onContextRestoredObserver && (this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver), this._onContextRestoredObserver = null);
  }
  _moveAssets(e, t, r) {
    if (!(!e || !t))
      for (const n of e) {
        let i = !0;
        if (r) {
          for (const s of r)
            if (n === s) {
              i = !1;
              break;
            }
        }
        i && (t.push(n), n._parentContainer = this);
      }
  }
  /**
   * Removes all the assets contained in the scene and adds them to the container.
   * @param keepAssets Set of assets to keep in the scene. (default: empty)
   */
  moveAllFromScene(e) {
    this._wasAddedToScene = !1, e === void 0 && (e = new Aee());
    for (const t in this)
      Object.prototype.hasOwnProperty.call(this, t) && (this[t] = this[t] || (t === "_environmentTexture" ? null : []), this._moveAssets(this.scene[t], this[t], e[t]));
    this.environmentTexture = this.scene.environmentTexture, this.removeAllFromScene();
  }
  /**
   * Adds all meshes in the asset container to a root mesh that can be used to position all the contained meshes. The root mesh is then added to the front of the meshes in the assetContainer.
   * @returns the root mesh
   */
  createRootMesh() {
    const e = new Ee("assetContainerRootMesh", this.scene);
    return this.meshes.forEach((t) => {
      t.parent || e.addChild(t);
    }), this.meshes.unshift(e), e;
  }
  /**
   * Merge animations (direct and animation groups) from this asset container into a scene
   * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
   * @param animatables set of animatables to retarget to a node from the scene
   * @param targetConverter defines a function used to convert animation targets from the asset container to the scene (default: search node by name)
   * @returns an array of the new AnimationGroup added to the scene (empty array if none)
   */
  mergeAnimationsTo(e = gr.LastCreatedScene, t, r = null) {
    if (!e)
      return Se.Error("No scene available to merge animations to"), [];
    const n = r || ((a) => {
      let f = null;
      const o = a.animations.length ? a.animations[0].targetProperty : "", d = a.name.split(".").join("").split("_primitive")[0];
      switch (o) {
        case "position":
        case "rotationQuaternion":
          f = e.getTransformNodeByName(a.name) || e.getTransformNodeByName(d);
          break;
        case "influence":
          f = e.getMorphTargetByName(a.name) || e.getMorphTargetByName(d);
          break;
        default:
          f = e.getNodeByName(a.name) || e.getNodeByName(d);
      }
      return f;
    });
    this.getNodes().forEach((a) => {
      const f = n(a);
      if (f !== null) {
        for (const o of a.animations) {
          const d = f.animations.filter((v) => v.targetProperty === o.targetProperty);
          for (const v of d) {
            const u = f.animations.indexOf(v, 0);
            u > -1 && f.animations.splice(u, 1);
          }
        }
        f.animations = f.animations.concat(a.animations);
      }
    });
    const s = [];
    return this.animationGroups.slice().forEach((a) => {
      s.push(a.clone(a.name, n)), a.animatables.forEach((f) => {
        f.stop();
      });
    }), t.forEach((a) => {
      const f = n(a.target);
      f && (e.beginAnimation(f, a.fromFrame, a.toFrame, a.loopAnimation, a.speedRatio, a.onAnimationEnd ? a.onAnimationEnd : void 0, void 0, !0, void 0, a.onAnimationLoop ? a.onAnimationLoop : void 0), e.stopAnimation(a.target));
    }), s;
  }
  /**
   * @since 6.15.0
   * This method checks for any node that has no parent
   * and is not in the rootNodes array, and adds the node
   * there, if so.
   */
  populateRootNodes() {
    this.rootNodes.length = 0, this.meshes.forEach((e) => {
      !e.parent && this.rootNodes.indexOf(e) === -1 && this.rootNodes.push(e);
    }), this.transformNodes.forEach((e) => {
      !e.parent && this.rootNodes.indexOf(e) === -1 && this.rootNodes.push(e);
    }), this.lights.forEach((e) => {
      !e.parent && this.rootNodes.indexOf(e) === -1 && this.rootNodes.push(e);
    }), this.cameras.forEach((e) => {
      !e.parent && this.rootNodes.indexOf(e) === -1 && this.rootNodes.push(e);
    });
  }
  /**
   * @since 6.26.0
   * Given a root asset, this method will traverse its hierarchy and add it, its children and any materials/skeletons/animation groups to the container.
   * @param root
   */
  addAllAssetsToContainer(e) {
    if (!e)
      return;
    const t = [], r = /* @__PURE__ */ new Set();
    for (t.push(e); t.length > 0; ) {
      const n = t.pop();
      if (n instanceof Ee ? (n.geometry && this.geometries.indexOf(n.geometry) === -1 && this.geometries.push(n.geometry), this.meshes.push(n)) : n instanceof Hr ? this.transformNodes.push(n) : n instanceof ci ? this.lights.push(n) : n instanceof Tr && this.cameras.push(n), n instanceof jn) {
        if (n.material && this.materials.indexOf(n.material) === -1) {
          this.materials.push(n.material);
          for (const i of n.material.getActiveTextures())
            this.textures.indexOf(i) === -1 && this.textures.push(i);
        }
        n.skeleton && this.skeletons.indexOf(n.skeleton) === -1 && this.skeletons.push(n.skeleton), n.morphTargetManager && this.morphTargetManagers.indexOf(n.morphTargetManager) === -1 && this.morphTargetManagers.push(n.morphTargetManager);
      }
      for (const i of n.getChildren())
        r.has(i) || t.push(i);
      r.add(n);
    }
    this.populateRootNodes();
  }
}
class H6e {
  /**
   * Creates a new analyser
   * @param scene defines hosting scene
   */
  constructor(e) {
    if (this.SMOOTHING = 0.75, this.FFT_SIZE = 512, this.BARGRAPHAMPLITUDE = 256, this.DEBUGCANVASPOS = { x: 20, y: 20 }, this.DEBUGCANVASSIZE = { width: 320, height: 200 }, e = e || gr.LastCreatedScene, !!e) {
      if (this._scene = e, !Ge.audioEngine) {
        ye.Warn("No audio engine initialized, failed to create an audio analyser");
        return;
      }
      this._audioEngine = Ge.audioEngine, this._audioEngine.canUseWebAudio && this._audioEngine.audioContext && (this._webAudioAnalyser = this._audioEngine.audioContext.createAnalyser(), this._webAudioAnalyser.minDecibels = -140, this._webAudioAnalyser.maxDecibels = 0, this._byteFreqs = new Uint8Array(this._webAudioAnalyser.frequencyBinCount), this._byteTime = new Uint8Array(this._webAudioAnalyser.frequencyBinCount), this._floatFreqs = new Float32Array(this._webAudioAnalyser.frequencyBinCount));
    }
  }
  /**
   * Get the number of data values you will have to play with for the visualization
   * @see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/frequencyBinCount
   * @returns a number
   */
  getFrequencyBinCount() {
    return this._audioEngine.canUseWebAudio ? this._webAudioAnalyser.frequencyBinCount : 0;
  }
  /**
   * Gets the current frequency data as a byte array
   * @see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData
   * @returns a Uint8Array
   */
  getByteFrequencyData() {
    return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs)), this._byteFreqs;
  }
  /**
   * Gets the current waveform as a byte array
   * @see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteTimeDomainData
   * @returns a Uint8Array
   */
  getByteTimeDomainData() {
    return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getByteTimeDomainData(this._byteTime)), this._byteTime;
  }
  /**
   * Gets the current frequency data as a float array
   * @see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData
   * @returns a Float32Array
   */
  getFloatFrequencyData() {
    return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs)), this._floatFreqs;
  }
  /**
   * Renders the debug canvas
   */
  drawDebugCanvas() {
    if (this._audioEngine.canUseWebAudio && (this._debugCanvas || (this._debugCanvas = document.createElement("canvas"), this._debugCanvas.width = this.DEBUGCANVASSIZE.width, this._debugCanvas.height = this.DEBUGCANVASSIZE.height, this._debugCanvas.style.position = "absolute", this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + "px", this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + "px", this._debugCanvasContext = this._debugCanvas.getContext("2d"), document.body.appendChild(this._debugCanvas), this._registerFunc = () => {
      this.drawDebugCanvas();
    }, this._scene.registerBeforeRender(this._registerFunc)), this._registerFunc && this._debugCanvasContext)) {
      const e = this.getByteFrequencyData();
      this._debugCanvasContext.fillStyle = "rgb(0, 0, 0)", this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);
      for (let t = 0; t < this.getFrequencyBinCount(); t++) {
        const n = e[t] / this.BARGRAPHAMPLITUDE, i = this.DEBUGCANVASSIZE.height * n, s = this.DEBUGCANVASSIZE.height - i - 1, a = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount(), f = t / this.getFrequencyBinCount() * 360;
        this._debugCanvasContext.fillStyle = "hsl(" + f + ", 100%, 50%)", this._debugCanvasContext.fillRect(t * a, s, a, i);
      }
    }
  }
  /**
   * Stops rendering the debug canvas and removes it
   */
  stopDebugCanvas() {
    this._debugCanvas && (this._registerFunc && (this._scene.unregisterBeforeRender(this._registerFunc), this._registerFunc = null), document.body.removeChild(this._debugCanvas), this._debugCanvas = null, this._debugCanvasContext = null);
  }
  /**
   * Connects two audio nodes
   * @param inputAudioNode defines first node to connect
   * @param outputAudioNode defines second node to connect
   */
  connectAudioNodes(e, t) {
    this._audioEngine.canUseWebAudio && (e.connect(this._webAudioAnalyser), this._webAudioAnalyser.connect(t));
  }
  /**
   * Releases all associated resources
   */
  dispose() {
    this._audioEngine.canUseWebAudio && this._webAudioAnalyser.disconnect();
  }
}
Ge.AudioEngineFactory = (A, e, t) => new vee(A, e, t);
class vee {
  /**
   * Gets the current AudioContext if available.
   */
  get audioContext() {
    return this._audioContextInitialized || this._initializeAudioContext(), this._audioContext;
  }
  /**
   * Instantiates a new audio engine.
   *
   * There should be only one per page as some browsers restrict the number
   * of audio contexts you can create.
   * @param hostElement defines the host element where to display the mute icon if necessary
   * @param audioContext defines the audio context to be used by the audio engine
   * @param audioDestination defines the audio destination node to be used by audio engine
   */
  constructor(e = null, t = null, r = null) {
    if (this._audioContext = null, this._audioContextInitialized = !1, this._muteButton = null, this._audioDestination = null, this.canUseWebAudio = !1, this.WarnedWebAudioUnsupported = !1, this.isMP3supported = !1, this.isOGGsupported = !1, this.unlocked = !1, this.useCustomUnlockedButton = !1, this.onAudioUnlockedObservable = new Oe(), this.onAudioLockedObservable = new Oe(), this._tryToRun = !1, this._onResize = () => {
      this._moveButtonToTopLeft();
    }, !u9())
      return;
    typeof window.AudioContext < "u" && (this.canUseWebAudio = !0);
    const n = document.createElement("audio");
    this._hostElement = e, this._audioContext = t, this._audioDestination = r;
    try {
      n && n.canPlayType && (n.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/, "") || n.canPlayType("audio/mp3").replace(/^no$/, "")) && (this.isMP3supported = !0);
    } catch {
    }
    try {
      n && n.canPlayType && n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, "") && (this.isOGGsupported = !0);
    } catch {
    }
  }
  /**
   * Flags the audio engine in Locked state.
   * This happens due to new browser policies preventing audio to autoplay.
   */
  lock() {
    this._triggerSuspendedState();
  }
  /**
   * Unlocks the audio engine once a user action has been done on the dom.
   * This is helpful to resume play once browser policies have been satisfied.
   */
  unlock() {
    var e, t;
    if (((e = this._audioContext) === null || e === void 0 ? void 0 : e.state) === "running") {
      this._hideMuteButton();
      return;
    }
    this._tryToRun ? (t = this._audioContext) === null || t === void 0 || t.suspend().then(() => {
      this._tryToRun = !1, this._triggerRunningState();
    }) : this._triggerRunningState();
  }
  _resumeAudioContext() {
    var e;
    return !((e = this._audioContext) === null || e === void 0) && e.resume ? this._audioContext.resume() : Promise.resolve();
  }
  _initializeAudioContext() {
    try {
      this.canUseWebAudio && (this._audioContext || (this._audioContext = new AudioContext()), this.masterGain = this._audioContext.createGain(), this.masterGain.gain.value = 1, this._audioDestination || (this._audioDestination = this._audioContext.destination), this.masterGain.connect(this._audioDestination), this._audioContextInitialized = !0, this._audioContext.state === "running" && this._triggerRunningState());
    } catch (e) {
      this.canUseWebAudio = !1, Se.Error("Web Audio: " + e.message);
    }
  }
  _triggerRunningState() {
    this._tryToRun || (this._tryToRun = !0, this._resumeAudioContext().then(() => {
      this._tryToRun = !1, this._muteButton && this._hideMuteButton(), this.unlocked = !0, this.onAudioUnlockedObservable.notifyObservers(this);
    }).catch(() => {
      this._tryToRun = !1, this.unlocked = !1;
    }));
  }
  _triggerSuspendedState() {
    this.unlocked = !1, this.onAudioLockedObservable.notifyObservers(this), this._displayMuteButton();
  }
  _displayMuteButton() {
    if (this.useCustomUnlockedButton || this._muteButton)
      return;
    this._muteButton = document.createElement("BUTTON"), this._muteButton.className = "babylonUnmuteIcon", this._muteButton.id = "babylonUnmuteIconBtn", this._muteButton.title = "Unmute";
    const t = ".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url(" + (window.SVGSVGElement ? "data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E" : "https://cdn.babylonjs.com/Assets/audio.png") + ");  background-size: 80%; background-repeat:no-repeat; background-position: center; background-position-y: 4px; border: none; outline: none; transition: transform 0.125s ease-out; cursor: pointer; z-index: 9999; } .babylonUnmuteIcon:hover { transform: scale(1.05) } .babylonUnmuteIcon:active { background-color: rgba(51,51,51,1) }", r = document.createElement("style");
    r.appendChild(document.createTextNode(t)), document.getElementsByTagName("head")[0].appendChild(r), document.body.appendChild(this._muteButton), this._moveButtonToTopLeft(), this._muteButton.addEventListener("touchend", () => {
      this._triggerRunningState();
    }, !0), this._muteButton.addEventListener("click", () => {
      this.unlock();
    }, !0), window.addEventListener("resize", this._onResize);
  }
  _moveButtonToTopLeft() {
    this._hostElement && this._muteButton && (this._muteButton.style.top = this._hostElement.offsetTop + 20 + "px", this._muteButton.style.left = this._hostElement.offsetLeft + 20 + "px");
  }
  _hideMuteButton() {
    this._muteButton && (document.body.removeChild(this._muteButton), this._muteButton = null);
  }
  /**
   * Destroy and release the resources associated with the audio context.
   */
  dispose() {
    this.canUseWebAudio && this._audioContextInitialized && (this._connectedAnalyser && this._audioContext && (this._connectedAnalyser.stopDebugCanvas(), this._connectedAnalyser.dispose(), this.masterGain.disconnect(), this.masterGain.connect(this._audioContext.destination), this._connectedAnalyser = null), this.masterGain.gain.value = 1), this.WarnedWebAudioUnsupported = !1, this._hideMuteButton(), window.removeEventListener("resize", this._onResize), this.onAudioUnlockedObservable.clear(), this.onAudioLockedObservable.clear();
  }
  /**
   * Gets the global volume sets on the master gain.
   * @returns the global volume if set or -1 otherwise
   */
  getGlobalVolume() {
    return this.canUseWebAudio && this._audioContextInitialized ? this.masterGain.gain.value : -1;
  }
  /**
   * Sets the global volume of your experience (sets on the master gain).
   * @param newVolume Defines the new global volume of the application
   */
  setGlobalVolume(e) {
    this.canUseWebAudio && this._audioContextInitialized && (this.masterGain.gain.value = e);
  }
  /**
   * Connect the audio engine to an audio analyser allowing some amazing
   * synchronization between the sounds/music and your visualization (VuMeter for instance).
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-the-analyser
   * @param analyser The analyser to connect to the engine
   */
  connectToAnalyser(e) {
    this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(), this.canUseWebAudio && this._audioContextInitialized && this._audioContext && (this._connectedAnalyser = e, this.masterGain.disconnect(), this._connectedAnalyser.connectAudioNodes(this.masterGain, this._audioContext.destination));
  }
}
class qc {
  /**
   * Does the sound loop after it finishes playing once.
   */
  get loop() {
    return this._loop;
  }
  set loop(e) {
    e !== this._loop && (this._loop = e, this.updateOptions({ loop: e }));
  }
  /**
   * Gets the current time for the sound.
   */
  get currentTime() {
    var e;
    if (this._htmlAudioElement)
      return this._htmlAudioElement.currentTime;
    if (!((e = Ge.audioEngine) === null || e === void 0) && e.audioContext && (this.isPlaying || this.isPaused)) {
      const t = this.isPaused ? 0 : Ge.audioEngine.audioContext.currentTime - this._startTime;
      return this._currentTime + t;
    }
    return 0;
  }
  /**
   * Does this sound enables spatial sound.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
   */
  get spatialSound() {
    return this._spatialSound;
  }
  /**
   * Does this sound enables spatial sound.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
   */
  set spatialSound(e) {
    if (e == this._spatialSound)
      return;
    const t = this.isPlaying;
    this.pause(), e ? (this._spatialSound = e, this._updateSpatialParameters()) : this._disableSpatialSound(), t && this.play();
  }
  /**
   * Create a sound and attach it to a scene
   * @param name Name of your sound
   * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer, it also works with MediaStreams and AudioBuffers
   * @param scene defines the scene the sound belongs to
   * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played
   * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel, streaming
   */
  constructor(e, t, r, n = null, i) {
    var s, a, f, o, d;
    if (this.autoplay = !1, this._loop = !1, this.useCustomAttenuation = !1, this.isPlaying = !1, this.isPaused = !1, this.refDistance = 1, this.rolloffFactor = 1, this.maxDistance = 100, this.distanceModel = "linear", this.metadata = null, this.onEndedObservable = new Oe(), this._spatialSound = !1, this._panningModel = "equalpower", this._playbackRate = 1, this._streaming = !1, this._startTime = 0, this._currentTime = 0, this._position = S.Zero(), this._localDirection = new S(1, 0, 0), this._volume = 1, this._isReadyToPlay = !1, this._isDirectional = !1, this._coneInnerAngle = 360, this._coneOuterAngle = 360, this._coneOuterGain = 0, this._isOutputConnected = !1, this._urlType = "Unknown", this.name = e, r = r || gr.LastCreatedScene, !!r)
      if (this._scene = r, qc._SceneComponentInitialization(r), this._readyToPlayCallback = n, this._customAttenuationFunction = (v, u, l, P, p) => u < l ? v * (1 - u / l) : 0, i && (this.autoplay = i.autoplay || !1, this._loop = i.loop || !1, i.volume !== void 0 && (this._volume = i.volume), this._spatialSound = (s = i.spatialSound) !== null && s !== void 0 ? s : !1, this.maxDistance = (a = i.maxDistance) !== null && a !== void 0 ? a : 100, this.useCustomAttenuation = (f = i.useCustomAttenuation) !== null && f !== void 0 ? f : !1, this.rolloffFactor = i.rolloffFactor || 1, this.refDistance = i.refDistance || 1, this.distanceModel = i.distanceModel || "linear", this._playbackRate = i.playbackRate || 1, this._streaming = (o = i.streaming) !== null && o !== void 0 ? o : !1, this._length = i.length, this._offset = i.offset), !((d = Ge.audioEngine) === null || d === void 0) && d.canUseWebAudio && Ge.audioEngine.audioContext) {
        this._soundGain = Ge.audioEngine.audioContext.createGain(), this._soundGain.gain.value = this._volume, this._inputAudioNode = this._soundGain, this._outputAudioNode = this._soundGain, this._spatialSound && this._createSpatialParameters(), this._scene.mainSoundTrack.addSound(this);
        let v = !0;
        if (t)
          try {
            typeof t == "string" ? (this._urlType = "String", this._url = t) : t instanceof ArrayBuffer ? this._urlType = "ArrayBuffer" : t instanceof HTMLMediaElement ? this._urlType = "MediaElement" : t instanceof MediaStream ? this._urlType = "MediaStream" : t instanceof AudioBuffer ? this._urlType = "AudioBuffer" : Array.isArray(t) && (this._urlType = "Array");
            let u = [], l = !1;
            switch (this._urlType) {
              case "MediaElement":
                this._streaming = !0, this._isReadyToPlay = !0, this._streamingSource = Ge.audioEngine.audioContext.createMediaElementSource(t), this.autoplay && this.play(0, this._offset, this._length), this._readyToPlayCallback && this._readyToPlayCallback();
                break;
              case "MediaStream":
                this._streaming = !0, this._isReadyToPlay = !0, this._streamingSource = Ge.audioEngine.audioContext.createMediaStreamSource(t), this.autoplay && this.play(0, this._offset, this._length), this._readyToPlayCallback && this._readyToPlayCallback();
                break;
              case "ArrayBuffer":
                t.byteLength > 0 && (l = !0, this._soundLoaded(t));
                break;
              case "AudioBuffer":
                this._audioBufferLoaded(t);
                break;
              case "String":
                u.push(t);
              case "Array":
                u.length === 0 && (u = t);
                for (let P = 0; P < u.length; P++) {
                  const p = u[P];
                  if (l = i && i.skipCodecCheck || p.indexOf(".mp3", p.length - 4) !== -1 && Ge.audioEngine.isMP3supported || p.indexOf(".ogg", p.length - 4) !== -1 && Ge.audioEngine.isOGGsupported || p.indexOf(".wav", p.length - 4) !== -1 || p.indexOf(".m4a", p.length - 4) !== -1 || p.indexOf(".mp4", p.length - 4) !== -1 || p.indexOf("blob:") !== -1, l) {
                    this._streaming ? (this._htmlAudioElement = new Audio(p), this._htmlAudioElement.controls = !1, this._htmlAudioElement.loop = this.loop, ye.SetCorsBehavior(p, this._htmlAudioElement), this._htmlAudioElement.preload = "auto", this._htmlAudioElement.addEventListener("canplaythrough", () => {
                      this._isReadyToPlay = !0, this.autoplay && this.play(0, this._offset, this._length), this._readyToPlayCallback && this._readyToPlayCallback();
                    }), document.body.appendChild(this._htmlAudioElement), this._htmlAudioElement.load()) : this._scene._loadFile(p, (c) => {
                      this._soundLoaded(c);
                    }, void 0, !0, !0, (c) => {
                      c && Se.Error("XHR " + c.status + " error on: " + p + "."), Se.Error("Sound creation aborted."), this._scene.mainSoundTrack.removeSound(this);
                    });
                    break;
                  }
                }
                break;
              default:
                v = !1;
                break;
            }
            v ? l || (this._isReadyToPlay = !0, this._readyToPlayCallback && setTimeout(() => {
              this._readyToPlayCallback && this._readyToPlayCallback();
            }, 1e3)) : Se.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.");
          } catch {
            Se.Error("Unexpected error. Sound creation aborted."), this._scene.mainSoundTrack.removeSound(this);
          }
      } else
        this._scene.mainSoundTrack.addSound(this), Ge.audioEngine && !Ge.audioEngine.WarnedWebAudioUnsupported && (Se.Error("Web Audio is not supported by your browser."), Ge.audioEngine.WarnedWebAudioUnsupported = !0), this._readyToPlayCallback && setTimeout(() => {
          this._readyToPlayCallback && this._readyToPlayCallback();
        }, 1e3);
  }
  /**
   * Release the sound and its associated resources
   */
  dispose() {
    var e;
    !((e = Ge.audioEngine) === null || e === void 0) && e.canUseWebAudio && (this.isPlaying && this.stop(), this._isReadyToPlay = !1, this.soundTrackId === -1 ? this._scene.mainSoundTrack.removeSound(this) : this._scene.soundTracks && this._scene.soundTracks[this.soundTrackId].removeSound(this), this._soundGain && (this._soundGain.disconnect(), this._soundGain = null), this._soundPanner && (this._soundPanner.disconnect(), this._soundPanner = null), this._soundSource && (this._soundSource.disconnect(), this._soundSource = null), this._audioBuffer = null, this._htmlAudioElement && (this._htmlAudioElement.pause(), this._htmlAudioElement.src = "", document.body.removeChild(this._htmlAudioElement)), this._streamingSource && this._streamingSource.disconnect(), this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._connectedTransformNode = null), this._clearTimeoutsAndObservers());
  }
  /**
   * Gets if the sounds is ready to be played or not.
   * @returns true if ready, otherwise false
   */
  isReady() {
    return this._isReadyToPlay;
  }
  /**
   * Get the current class name.
   * @returns current class name
   */
  getClassName() {
    return "Sound";
  }
  _audioBufferLoaded(e) {
    var t;
    !((t = Ge.audioEngine) === null || t === void 0) && t.audioContext && (this._audioBuffer = e, this._isReadyToPlay = !0, this.autoplay && this.play(0, this._offset, this._length), this._readyToPlayCallback && this._readyToPlayCallback());
  }
  _soundLoaded(e) {
    var t;
    !((t = Ge.audioEngine) === null || t === void 0) && t.audioContext && Ge.audioEngine.audioContext.decodeAudioData(e, (r) => {
      this._audioBufferLoaded(r);
    }, (r) => {
      Se.Error("Error while decoding audio data for: " + this.name + " / Error: " + r);
    });
  }
  /**
   * Sets the data of the sound from an audiobuffer
   * @param audioBuffer The audioBuffer containing the data
   */
  setAudioBuffer(e) {
    var t;
    !((t = Ge.audioEngine) === null || t === void 0) && t.canUseWebAudio && (this._audioBuffer = e, this._isReadyToPlay = !0);
  }
  /**
   * Updates the current sounds options such as maxdistance, loop...
   * @param options A JSON object containing values named as the object properties
   */
  updateOptions(e) {
    var t, r, n, i, s, a, f, o, d, v, u;
    e && (this.loop = (t = e.loop) !== null && t !== void 0 ? t : this.loop, this.maxDistance = (r = e.maxDistance) !== null && r !== void 0 ? r : this.maxDistance, this.useCustomAttenuation = (n = e.useCustomAttenuation) !== null && n !== void 0 ? n : this.useCustomAttenuation, this.rolloffFactor = (i = e.rolloffFactor) !== null && i !== void 0 ? i : this.rolloffFactor, this.refDistance = (s = e.refDistance) !== null && s !== void 0 ? s : this.refDistance, this.distanceModel = (a = e.distanceModel) !== null && a !== void 0 ? a : this.distanceModel, this._playbackRate = (f = e.playbackRate) !== null && f !== void 0 ? f : this._playbackRate, this._length = (o = e.length) !== null && o !== void 0 ? o : void 0, this.spatialSound = (d = e.spatialSound) !== null && d !== void 0 ? d : this._spatialSound, this._setOffset((v = e.offset) !== null && v !== void 0 ? v : void 0), this.setVolume((u = e.volume) !== null && u !== void 0 ? u : this._volume), this._updateSpatialParameters(), this.isPlaying && (this._streaming && this._htmlAudioElement ? (this._htmlAudioElement.playbackRate = this._playbackRate, this._htmlAudioElement.loop !== this.loop && (this._htmlAudioElement.loop = this.loop)) : this._soundSource && (this._soundSource.playbackRate.value = this._playbackRate, this._soundSource.loop !== this.loop && (this._soundSource.loop = this.loop), this._offset !== void 0 && this._soundSource.loopStart !== this._offset && (this._soundSource.loopStart = this._offset), this._length !== void 0 && this._length !== this._soundSource.loopEnd && (this._soundSource.loopEnd = (this._offset | 0) + this._length))));
  }
  _createSpatialParameters() {
    var e, t;
    !((e = Ge.audioEngine) === null || e === void 0) && e.canUseWebAudio && Ge.audioEngine.audioContext && (this._scene.headphone && (this._panningModel = "HRTF"), this._soundPanner = (t = this._soundPanner) !== null && t !== void 0 ? t : Ge.audioEngine.audioContext.createPanner(), this._soundPanner && this._outputAudioNode && (this._updateSpatialParameters(), this._soundPanner.connect(this._outputAudioNode), this._inputAudioNode = this._soundPanner));
  }
  _disableSpatialSound() {
    var e;
    this._spatialSound && (this._inputAudioNode = this._soundGain, (e = this._soundPanner) === null || e === void 0 || e.disconnect(), this._soundPanner = null, this._spatialSound = !1);
  }
  _updateSpatialParameters() {
    this._spatialSound && (this._soundPanner ? this.useCustomAttenuation ? (this._soundPanner.distanceModel = "linear", this._soundPanner.maxDistance = Number.MAX_VALUE, this._soundPanner.refDistance = 1, this._soundPanner.rolloffFactor = 1, this._soundPanner.panningModel = this._panningModel) : (this._soundPanner.distanceModel = this.distanceModel, this._soundPanner.maxDistance = this.maxDistance, this._soundPanner.refDistance = this.refDistance, this._soundPanner.rolloffFactor = this.rolloffFactor, this._soundPanner.panningModel = this._panningModel) : this._createSpatialParameters());
  }
  /**
   * Switch the panning model to HRTF:
   * Renders a stereo output of higher quality than equalpower — it uses a convolution with measured impulse responses from human subjects.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
   */
  switchPanningModelToHRTF() {
    this._panningModel = "HRTF", this._switchPanningModel();
  }
  /**
   * Switch the panning model to Equal Power:
   * Represents the equal-power panning algorithm, generally regarded as simple and efficient. equalpower is the default value.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
   */
  switchPanningModelToEqualPower() {
    this._panningModel = "equalpower", this._switchPanningModel();
  }
  _switchPanningModel() {
    var e;
    !((e = Ge.audioEngine) === null || e === void 0) && e.canUseWebAudio && this._spatialSound && this._soundPanner && (this._soundPanner.panningModel = this._panningModel);
  }
  /**
   * Connect this sound to a sound track audio node like gain...
   * @param soundTrackAudioNode the sound track audio node to connect to
   */
  connectToSoundTrackAudioNode(e) {
    var t;
    !((t = Ge.audioEngine) === null || t === void 0) && t.canUseWebAudio && this._outputAudioNode && (this._isOutputConnected && this._outputAudioNode.disconnect(), this._outputAudioNode.connect(e), this._isOutputConnected = !0);
  }
  /**
   * Transform this sound into a directional source
   * @param coneInnerAngle Size of the inner cone in degree
   * @param coneOuterAngle Size of the outer cone in degree
   * @param coneOuterGain Volume of the sound outside the outer cone (between 0.0 and 1.0)
   */
  setDirectionalCone(e, t, r) {
    if (t < e) {
      Se.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.");
      return;
    }
    this._coneInnerAngle = e, this._coneOuterAngle = t, this._coneOuterGain = r, this._isDirectional = !0, this.isPlaying && this.loop && (this.stop(), this.play(0, this._offset, this._length));
  }
  /**
   * Gets or sets the inner angle for the directional cone.
   */
  get directionalConeInnerAngle() {
    return this._coneInnerAngle;
  }
  /**
   * Gets or sets the inner angle for the directional cone.
   */
  set directionalConeInnerAngle(e) {
    var t;
    if (e != this._coneInnerAngle) {
      if (this._coneOuterAngle < e) {
        Se.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");
        return;
      }
      this._coneInnerAngle = e, !((t = Ge.audioEngine) === null || t === void 0) && t.canUseWebAudio && this._spatialSound && this._soundPanner && (this._soundPanner.coneInnerAngle = this._coneInnerAngle);
    }
  }
  /**
   * Gets or sets the outer angle for the directional cone.
   */
  get directionalConeOuterAngle() {
    return this._coneOuterAngle;
  }
  /**
   * Gets or sets the outer angle for the directional cone.
   */
  set directionalConeOuterAngle(e) {
    var t;
    if (e != this._coneOuterAngle) {
      if (e < this._coneInnerAngle) {
        Se.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");
        return;
      }
      this._coneOuterAngle = e, !((t = Ge.audioEngine) === null || t === void 0) && t.canUseWebAudio && this._spatialSound && this._soundPanner && (this._soundPanner.coneOuterAngle = this._coneOuterAngle);
    }
  }
  /**
   * Sets the position of the emitter if spatial sound is enabled
   * @param newPosition Defines the new position
   */
  setPosition(e) {
    var t;
    e.equals(this._position) || (this._position.copyFrom(e), !((t = Ge.audioEngine) === null || t === void 0) && t.canUseWebAudio && this._spatialSound && this._soundPanner && !isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z) && (this._soundPanner.positionX.value = this._position.x, this._soundPanner.positionY.value = this._position.y, this._soundPanner.positionZ.value = this._position.z));
  }
  /**
   * Sets the local direction of the emitter if spatial sound is enabled
   * @param newLocalDirection Defines the new local direction
   */
  setLocalDirectionToMesh(e) {
    var t;
    this._localDirection = e, !((t = Ge.audioEngine) === null || t === void 0) && t.canUseWebAudio && this._connectedTransformNode && this.isPlaying && this._updateDirection();
  }
  _updateDirection() {
    if (!this._connectedTransformNode || !this._soundPanner)
      return;
    const e = this._connectedTransformNode.getWorldMatrix(), t = S.TransformNormal(this._localDirection, e);
    t.normalize(), this._soundPanner.orientationX.value = t.x, this._soundPanner.orientationY.value = t.y, this._soundPanner.orientationZ.value = t.z;
  }
  /** @internal */
  updateDistanceFromListener() {
    var e;
    if (!((e = Ge.audioEngine) === null || e === void 0) && e.canUseWebAudio && this._connectedTransformNode && this.useCustomAttenuation && this._soundGain && this._scene.activeCamera) {
      const t = this._scene.audioListenerPositionProvider ? this._connectedTransformNode.position.subtract(this._scene.audioListenerPositionProvider()).length() : this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);
      this._soundGain.gain.value = this._customAttenuationFunction(this._volume, t, this.maxDistance, this.refDistance, this.rolloffFactor);
    }
  }
  /**
   * Sets a new custom attenuation function for the sound.
   * @param callback Defines the function used for the attenuation
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-your-own-custom-attenuation-function
   */
  setAttenuationFunction(e) {
    this._customAttenuationFunction = e;
  }
  /**
   * Play the sound
   * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
   * @param offset (optional) Start the sound at a specific time in seconds
   * @param length (optional) Sound duration (in seconds)
   */
  play(e, t, r) {
    var n, i, s, a;
    if (this._isReadyToPlay && this._scene.audioEnabled && (!((n = Ge.audioEngine) === null || n === void 0) && n.audioContext))
      try {
        this._clearTimeoutsAndObservers();
        let f = e ? ((i = Ge.audioEngine) === null || i === void 0 ? void 0 : i.audioContext.currentTime) + e : (s = Ge.audioEngine) === null || s === void 0 ? void 0 : s.audioContext.currentTime;
        if ((!this._soundSource || !this._streamingSource) && this._spatialSound && this._soundPanner && (!isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z) && (this._soundPanner.positionX.value = this._position.x, this._soundPanner.positionY.value = this._position.y, this._soundPanner.positionZ.value = this._position.z), this._isDirectional && (this._soundPanner.coneInnerAngle = this._coneInnerAngle, this._soundPanner.coneOuterAngle = this._coneOuterAngle, this._soundPanner.coneOuterGain = this._coneOuterGain, this._connectedTransformNode ? this._updateDirection() : this._soundPanner.setOrientation(this._localDirection.x, this._localDirection.y, this._localDirection.z))), this._streaming) {
          if (this._streamingSource || (this._streamingSource = Ge.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement), this._htmlAudioElement.onended = () => {
            this._onended();
          }, this._htmlAudioElement.playbackRate = this._playbackRate), this._streamingSource.disconnect(), this._inputAudioNode && this._streamingSource.connect(this._inputAudioNode), this._htmlAudioElement) {
            const o = () => {
              var d, v;
              if (!((d = Ge.audioEngine) === null || d === void 0) && d.unlocked) {
                const u = this._htmlAudioElement.play();
                u !== void 0 && u.catch(() => {
                  var l, P;
                  (l = Ge.audioEngine) === null || l === void 0 || l.lock(), (this.loop || this.autoplay) && (this._audioUnlockedObserver = (P = Ge.audioEngine) === null || P === void 0 ? void 0 : P.onAudioUnlockedObservable.addOnce(() => {
                    o();
                  }));
                });
              } else
                (this.loop || this.autoplay) && (this._audioUnlockedObserver = (v = Ge.audioEngine) === null || v === void 0 ? void 0 : v.onAudioUnlockedObservable.addOnce(() => {
                  o();
                }));
            };
            o();
          }
        } else {
          const o = () => {
            var d, v, u, l;
            if (!((d = Ge.audioEngine) === null || d === void 0) && d.audioContext) {
              if (r = r || this._length, t !== void 0 && this._setOffset(t), this._soundSource) {
                const P = this._soundSource;
                P.onended = () => {
                  P.disconnect();
                };
              }
              if (this._soundSource = (v = Ge.audioEngine) === null || v === void 0 ? void 0 : v.audioContext.createBufferSource(), this._soundSource && this._inputAudioNode) {
                this._soundSource.buffer = this._audioBuffer, this._soundSource.connect(this._inputAudioNode), this._soundSource.loop = this.loop, t !== void 0 && (this._soundSource.loopStart = t), r !== void 0 && (this._soundSource.loopEnd = (t | 0) + r), this._soundSource.playbackRate.value = this._playbackRate, this._soundSource.onended = () => {
                  this._onended();
                }, f = e ? ((u = Ge.audioEngine) === null || u === void 0 ? void 0 : u.audioContext.currentTime) + e : Ge.audioEngine.audioContext.currentTime;
                const P = ((this.isPaused ? this.currentTime : 0) + ((l = this._offset) !== null && l !== void 0 ? l : 0)) % this._soundSource.buffer.duration;
                this._soundSource.start(f, P, this.loop ? void 0 : r);
              }
            }
          };
          ((a = Ge.audioEngine) === null || a === void 0 ? void 0 : a.audioContext.state) === "suspended" ? this._tryToPlayTimeout = setTimeout(() => {
            var d;
            ((d = Ge.audioEngine) === null || d === void 0 ? void 0 : d.audioContext.state) === "suspended" ? (Ge.audioEngine.lock(), (this.loop || this.autoplay) && (this._audioUnlockedObserver = Ge.audioEngine.onAudioUnlockedObservable.addOnce(() => {
              o();
            }))) : o();
          }, 500) : o();
        }
        this._startTime = f, this.isPlaying = !0, this.isPaused = !1;
      } catch (f) {
        Se.Error("Error while trying to play audio: " + this.name + ", " + f.message);
      }
  }
  _onended() {
    this.isPlaying = !1, this._startTime = 0, this._currentTime = 0, this.onended && this.onended(), this.onEndedObservable.notifyObservers(this);
  }
  /**
   * Stop the sound
   * @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default.
   */
  stop(e) {
    var t;
    if (this.isPlaying)
      if (this._clearTimeoutsAndObservers(), this._streaming)
        this._htmlAudioElement ? (this._htmlAudioElement.pause(), this._htmlAudioElement.currentTime > 0 && (this._htmlAudioElement.currentTime = 0)) : this._streamingSource.disconnect(), this.isPlaying = !1;
      else if (!((t = Ge.audioEngine) === null || t === void 0) && t.audioContext && this._soundSource) {
        const r = e ? Ge.audioEngine.audioContext.currentTime + e : void 0;
        this._soundSource.onended = () => {
          this.isPlaying = !1, this.isPaused = !1, this._startTime = 0, this._currentTime = 0, this._soundSource && (this._soundSource.onended = () => {
          }), this._onended();
        }, this._soundSource.stop(r);
      } else
        this.isPlaying = !1;
    else
      this.isPaused && (this.isPaused = !1, this._startTime = 0, this._currentTime = 0);
  }
  /**
   * Put the sound in pause
   */
  pause() {
    var e;
    this.isPlaying && (this._clearTimeoutsAndObservers(), this._streaming ? (this._htmlAudioElement ? this._htmlAudioElement.pause() : this._streamingSource.disconnect(), this.isPlaying = !1, this.isPaused = !0) : !((e = Ge.audioEngine) === null || e === void 0) && e.audioContext && this._soundSource && (this._soundSource.onended = () => {
    }, this._soundSource.stop(), this.isPlaying = !1, this.isPaused = !0, this._currentTime += Ge.audioEngine.audioContext.currentTime - this._startTime));
  }
  /**
   * Sets a dedicated volume for this sounds
   * @param newVolume Define the new volume of the sound
   * @param time Define time for gradual change to new volume
   */
  setVolume(e, t) {
    var r;
    !((r = Ge.audioEngine) === null || r === void 0) && r.canUseWebAudio && this._soundGain && (t && Ge.audioEngine.audioContext ? (this._soundGain.gain.cancelScheduledValues(Ge.audioEngine.audioContext.currentTime), this._soundGain.gain.setValueAtTime(this._soundGain.gain.value, Ge.audioEngine.audioContext.currentTime), this._soundGain.gain.linearRampToValueAtTime(e, Ge.audioEngine.audioContext.currentTime + t)) : this._soundGain.gain.value = e), this._volume = e;
  }
  /**
   * Set the sound play back rate
   * @param newPlaybackRate Define the playback rate the sound should be played at
   */
  setPlaybackRate(e) {
    this._playbackRate = e, this.isPlaying && (this._streaming && this._htmlAudioElement ? this._htmlAudioElement.playbackRate = this._playbackRate : this._soundSource && (this._soundSource.playbackRate.value = this._playbackRate));
  }
  /**
   * Gets the sound play back rate.
   * @returns the  play back rate of the sound
   */
  getPlaybackRate() {
    return this._playbackRate;
  }
  /**
   * Gets the volume of the sound.
   * @returns the volume of the sound
   */
  getVolume() {
    return this._volume;
  }
  /**
   * Attach the sound to a dedicated mesh
   * @param transformNode The transform node to connect the sound with
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#attaching-a-sound-to-a-mesh
   */
  attachToMesh(e) {
    this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._registerFunc = null), this._connectedTransformNode = e, this._spatialSound || (this._spatialSound = !0, this._createSpatialParameters(), this.isPlaying && this.loop && (this.stop(), this.play(0, this._offset, this._length))), this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode), this._registerFunc = (t) => this._onRegisterAfterWorldMatrixUpdate(t), this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc);
  }
  /**
   * Detach the sound from the previously attached mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#attaching-a-sound-to-a-mesh
   */
  detachFromMesh() {
    this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._registerFunc = null, this._connectedTransformNode = null);
  }
  _onRegisterAfterWorldMatrixUpdate(e) {
    var t;
    if (!e.getBoundingInfo)
      this.setPosition(e.absolutePosition);
    else {
      const n = e.getBoundingInfo();
      this.setPosition(n.boundingSphere.centerWorld);
    }
    !((t = Ge.audioEngine) === null || t === void 0) && t.canUseWebAudio && this._isDirectional && this.isPlaying && this._updateDirection();
  }
  /**
   * Clone the current sound in the scene.
   * @returns the new sound clone
   */
  clone() {
    if (this._streaming)
      return null;
    {
      const e = () => {
        this._isReadyToPlay ? (r._audioBuffer = this.getAudioBuffer(), r._isReadyToPlay = !0, r.autoplay && r.play(0, this._offset, this._length)) : setTimeout(e, 300);
      }, t = {
        autoplay: this.autoplay,
        loop: this.loop,
        volume: this._volume,
        spatialSound: this._spatialSound,
        maxDistance: this.maxDistance,
        useCustomAttenuation: this.useCustomAttenuation,
        rolloffFactor: this.rolloffFactor,
        refDistance: this.refDistance,
        distanceModel: this.distanceModel
      }, r = new qc(this.name + "_cloned", new ArrayBuffer(0), this._scene, null, t);
      return this.useCustomAttenuation && r.setAttenuationFunction(this._customAttenuationFunction), r.setPosition(this._position), r.setPlaybackRate(this._playbackRate), e(), r;
    }
  }
  /**
   * Gets the current underlying audio buffer containing the data
   * @returns the audio buffer
   */
  getAudioBuffer() {
    return this._audioBuffer;
  }
  /**
   * Gets the WebAudio AudioBufferSourceNode, lets you keep track of and stop instances of this Sound.
   * @returns the source node
   */
  getSoundSource() {
    return this._soundSource;
  }
  /**
   * Gets the WebAudio GainNode, gives you precise control over the gain of instances of this Sound.
   * @returns the gain node
   */
  getSoundGain() {
    return this._soundGain;
  }
  /**
   * Serializes the Sound in a JSON representation
   * @returns the JSON representation of the sound
   */
  serialize() {
    const e = {
      name: this.name,
      url: this._url,
      autoplay: this.autoplay,
      loop: this.loop,
      volume: this._volume,
      spatialSound: this._spatialSound,
      maxDistance: this.maxDistance,
      rolloffFactor: this.rolloffFactor,
      refDistance: this.refDistance,
      distanceModel: this.distanceModel,
      playbackRate: this._playbackRate,
      panningModel: this._panningModel,
      soundTrackId: this.soundTrackId,
      metadata: this.metadata
    };
    return this._spatialSound && (this._connectedTransformNode && (e.connectedMeshId = this._connectedTransformNode.id), e.position = this._position.asArray(), e.refDistance = this.refDistance, e.distanceModel = this.distanceModel, e.isDirectional = this._isDirectional, e.localDirectionToMesh = this._localDirection.asArray(), e.coneInnerAngle = this._coneInnerAngle, e.coneOuterAngle = this._coneOuterAngle, e.coneOuterGain = this._coneOuterGain), e;
  }
  /**
   * Parse a JSON representation of a sound to instantiate in a given scene
   * @param parsedSound Define the JSON representation of the sound (usually coming from the serialize method)
   * @param scene Define the scene the new parsed sound should be created in
   * @param rootUrl Define the rooturl of the load in case we need to fetch relative dependencies
   * @param sourceSound Define a sound place holder if do not need to instantiate a new one
   * @returns the newly parsed sound
   */
  static Parse(e, t, r, n) {
    const i = e.name;
    let s;
    e.url ? s = r + e.url : s = r + i;
    const a = {
      autoplay: e.autoplay,
      loop: e.loop,
      volume: e.volume,
      spatialSound: e.spatialSound,
      maxDistance: e.maxDistance,
      rolloffFactor: e.rolloffFactor,
      refDistance: e.refDistance,
      distanceModel: e.distanceModel,
      playbackRate: e.playbackRate
    };
    let f;
    if (!n)
      f = new qc(i, s, t, () => {
        t.removePendingData(f);
      }, a), t.addPendingData(f);
    else {
      const o = () => {
        n._isReadyToPlay ? (f._audioBuffer = n.getAudioBuffer(), f._isReadyToPlay = !0, f.autoplay && f.play(0, f._offset, f._length)) : setTimeout(o, 300);
      };
      f = new qc(i, new ArrayBuffer(0), t, null, a), o();
    }
    if (e.position) {
      const o = S.FromArray(e.position);
      f.setPosition(o);
    }
    if (e.isDirectional && (f.setDirectionalCone(e.coneInnerAngle || 360, e.coneOuterAngle || 360, e.coneOuterGain || 0), e.localDirectionToMesh)) {
      const o = S.FromArray(e.localDirectionToMesh);
      f.setLocalDirectionToMesh(o);
    }
    if (e.connectedMeshId) {
      const o = t.getMeshById(e.connectedMeshId);
      o && f.attachToMesh(o);
    }
    return e.metadata && (f.metadata = e.metadata), f;
  }
  _setOffset(e) {
    this._offset !== e && (this.isPaused && (this.stop(), this.isPaused = !1), this._offset = e);
  }
  _clearTimeoutsAndObservers() {
    var e;
    this._tryToPlayTimeout && (clearTimeout(this._tryToPlayTimeout), this._tryToPlayTimeout = null), this._audioUnlockedObserver && ((e = Ge.audioEngine) === null || e === void 0 || e.onAudioUnlockedObservable.remove(this._audioUnlockedObserver), this._audioUnlockedObserver = null);
  }
}
qc._SceneComponentInitialization = (A) => {
  throw qn("AudioSceneComponent");
};
class uee {
  /**
   * Creates a new sound track.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-sound-tracks
   * @param scene Define the scene the sound track belongs to
   * @param options
   */
  constructor(e, t = {}) {
    this.id = -1, this._isInitialized = !1, e = e || gr.LastCreatedScene, e && (this._scene = e, this.soundCollection = [], this._options = t, !this._options.mainTrack && this._scene.soundTracks && (this._scene.soundTracks.push(this), this.id = this._scene.soundTracks.length - 1));
  }
  _initializeSoundTrackAudioGraph() {
    var e;
    !((e = Ge.audioEngine) === null || e === void 0) && e.canUseWebAudio && Ge.audioEngine.audioContext && (this._outputAudioNode = Ge.audioEngine.audioContext.createGain(), this._outputAudioNode.connect(Ge.audioEngine.masterGain), this._options && this._options.volume && (this._outputAudioNode.gain.value = this._options.volume), this._isInitialized = !0);
  }
  /**
   * Release the sound track and its associated resources
   */
  dispose() {
    if (Ge.audioEngine && Ge.audioEngine.canUseWebAudio) {
      for (this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(); this.soundCollection.length; )
        this.soundCollection[0].dispose();
      this._outputAudioNode && this._outputAudioNode.disconnect(), this._outputAudioNode = null;
    }
  }
  /**
   * Adds a sound to this sound track
   * @param sound define the sound to add
   * @ignoreNaming
   */
  addSound(e) {
    var t;
    this._isInitialized || this._initializeSoundTrackAudioGraph(), !((t = Ge.audioEngine) === null || t === void 0) && t.canUseWebAudio && this._outputAudioNode && e.connectToSoundTrackAudioNode(this._outputAudioNode), e.soundTrackId !== void 0 && (e.soundTrackId === -1 ? this._scene.mainSoundTrack.removeSound(e) : this._scene.soundTracks && this._scene.soundTracks[e.soundTrackId].removeSound(e)), this.soundCollection.push(e), e.soundTrackId = this.id;
  }
  /**
   * Removes a sound to this sound track
   * @param sound define the sound to remove
   * @ignoreNaming
   */
  removeSound(e) {
    const t = this.soundCollection.indexOf(e);
    t !== -1 && this.soundCollection.splice(t, 1);
  }
  /**
   * Set a global volume for the full sound track.
   * @param newVolume Define the new volume of the sound track
   */
  setVolume(e) {
    var t;
    !((t = Ge.audioEngine) === null || t === void 0) && t.canUseWebAudio && this._outputAudioNode && (this._outputAudioNode.gain.value = e);
  }
  /**
   * Switch the panning model to HRTF:
   * Renders a stereo output of higher quality than equalpower — it uses a convolution with measured impulse responses from human subjects.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
   */
  switchPanningModelToHRTF() {
    var e;
    if (!((e = Ge.audioEngine) === null || e === void 0) && e.canUseWebAudio)
      for (let t = 0; t < this.soundCollection.length; t++)
        this.soundCollection[t].switchPanningModelToHRTF();
  }
  /**
   * Switch the panning model to Equal Power:
   * Represents the equal-power panning algorithm, generally regarded as simple and efficient. equalpower is the default value.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
   */
  switchPanningModelToEqualPower() {
    var e;
    if (!((e = Ge.audioEngine) === null || e === void 0) && e.canUseWebAudio)
      for (let t = 0; t < this.soundCollection.length; t++)
        this.soundCollection[t].switchPanningModelToEqualPower();
  }
  /**
   * Connect the sound track to an audio analyser allowing some amazing
   * synchronization between the sounds/music and your visualization (VuMeter for instance).
   * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-the-analyser
   * @param analyser The analyser to connect to the engine
   */
  connectToAnalyser(e) {
    var t;
    this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(), this._connectedAnalyser = e, !((t = Ge.audioEngine) === null || t === void 0) && t.canUseWebAudio && this._outputAudioNode && (this._outputAudioNode.disconnect(), this._connectedAnalyser.connectAudioNodes(this._outputAudioNode, Ge.audioEngine.masterGain));
  }
}
J1.AddParser(Ot.NAME_AUDIO, (A, e, t, r) => {
  var n;
  let i = [], s;
  if (t.sounds = t.sounds || [], A.sounds !== void 0 && A.sounds !== null)
    for (let a = 0, f = A.sounds.length; a < f; a++) {
      const o = A.sounds[a];
      !((n = Ge.audioEngine) === null || n === void 0) && n.canUseWebAudio ? (o.url || (o.url = o.name), i[o.url] ? t.sounds.push(qc.Parse(o, e, r, i[o.url])) : (s = qc.Parse(o, e, r), i[o.url] = s, t.sounds.push(s))) : t.sounds.push(new qc(o.name, null, e));
    }
  i = [];
});
Object.defineProperty(sr.prototype, "mainSoundTrack", {
  get: function() {
    let A = this._getComponent(Ot.NAME_AUDIO);
    return A || (A = new yu(this), this._addComponent(A)), this._mainSoundTrack || (this._mainSoundTrack = new uee(this, { mainTrack: !0 })), this._mainSoundTrack;
  },
  enumerable: !0,
  configurable: !0
});
sr.prototype.getSoundByName = function(A) {
  let e;
  for (e = 0; e < this.mainSoundTrack.soundCollection.length; e++)
    if (this.mainSoundTrack.soundCollection[e].name === A)
      return this.mainSoundTrack.soundCollection[e];
  if (this.soundTracks) {
    for (let t = 0; t < this.soundTracks.length; t++)
      for (e = 0; e < this.soundTracks[t].soundCollection.length; e++)
        if (this.soundTracks[t].soundCollection[e].name === A)
          return this.soundTracks[t].soundCollection[e];
  }
  return null;
};
Object.defineProperty(sr.prototype, "audioEnabled", {
  get: function() {
    let A = this._getComponent(Ot.NAME_AUDIO);
    return A || (A = new yu(this), this._addComponent(A)), A.audioEnabled;
  },
  set: function(A) {
    let e = this._getComponent(Ot.NAME_AUDIO);
    e || (e = new yu(this), this._addComponent(e)), A ? e.enableAudio() : e.disableAudio();
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(sr.prototype, "headphone", {
  get: function() {
    let A = this._getComponent(Ot.NAME_AUDIO);
    return A || (A = new yu(this), this._addComponent(A)), A.headphone;
  },
  set: function(A) {
    let e = this._getComponent(Ot.NAME_AUDIO);
    e || (e = new yu(this), this._addComponent(e)), A ? e.switchAudioModeForHeadphones() : e.switchAudioModeForNormalSpeakers();
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(sr.prototype, "audioListenerPositionProvider", {
  get: function() {
    let A = this._getComponent(Ot.NAME_AUDIO);
    return A || (A = new yu(this), this._addComponent(A)), A.audioListenerPositionProvider;
  },
  set: function(A) {
    let e = this._getComponent(Ot.NAME_AUDIO);
    if (e || (e = new yu(this), this._addComponent(e)), A && typeof A != "function")
      throw new Error("The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3");
    e.audioListenerPositionProvider = A;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(sr.prototype, "audioListenerRotationProvider", {
  get: function() {
    let A = this._getComponent(Ot.NAME_AUDIO);
    return A || (A = new yu(this), this._addComponent(A)), A.audioListenerRotationProvider;
  },
  set: function(A) {
    let e = this._getComponent(Ot.NAME_AUDIO);
    if (e || (e = new yu(this), this._addComponent(e)), A && typeof A != "function")
      throw new Error("The value passed to [Scene.audioListenerRotationProvider] must be a function that returns a Vector3");
    e.audioListenerRotationProvider = A;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(sr.prototype, "audioPositioningRefreshRate", {
  get: function() {
    let A = this._getComponent(Ot.NAME_AUDIO);
    return A || (A = new yu(this), this._addComponent(A)), A.audioPositioningRefreshRate;
  },
  set: function(A) {
    let e = this._getComponent(Ot.NAME_AUDIO);
    e || (e = new yu(this), this._addComponent(e)), e.audioPositioningRefreshRate = A;
  },
  enumerable: !0,
  configurable: !0
});
class yu {
  /**
   * Gets whether audio is enabled or not.
   * Please use related enable/disable method to switch state.
   */
  get audioEnabled() {
    return this._audioEnabled;
  }
  /**
   * Gets whether audio is outputting to headphone or not.
   * Please use the according Switch methods to change output.
   */
  get headphone() {
    return this._headphone;
  }
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_AUDIO, this._audioEnabled = !0, this._headphone = !1, this.audioPositioningRefreshRate = 500, this.audioListenerPositionProvider = null, this.audioListenerRotationProvider = null, this._cachedCameraDirection = new S(), this._cachedCameraPosition = new S(), this._lastCheck = 0, this._invertMatrixTemp = new he(), this._cameraDirectionTemp = new S(), e = e || gr.LastCreatedScene, e && (this.scene = e, e.soundTracks = [], e.sounds = []);
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._afterRenderStage.registerStep(Ot.STEP_AFTERRENDER_AUDIO, this, this._afterRender);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Serializes the component data to the specified json object
   * @param serializationObject The object to serialize to
   */
  serialize(e) {
    if (e.sounds = [], this.scene.soundTracks)
      for (let t = 0; t < this.scene.soundTracks.length; t++) {
        const r = this.scene.soundTracks[t];
        for (let n = 0; n < r.soundCollection.length; n++)
          e.sounds.push(r.soundCollection[n].serialize());
      }
  }
  /**
   * Adds all the elements from the container to the scene
   * @param container the container holding the elements
   */
  addFromContainer(e) {
    e.sounds && e.sounds.forEach((t) => {
      t.play(), t.autoplay = !0, this.scene.mainSoundTrack.addSound(t);
    });
  }
  /**
   * Removes all the elements in the container from the scene
   * @param container contains the elements to remove
   * @param dispose if the removed element should be disposed (default: false)
   */
  removeFromContainer(e, t = !1) {
    e.sounds && e.sounds.forEach((r) => {
      r.stop(), r.autoplay = !1, this.scene.mainSoundTrack.removeSound(r), t && r.dispose();
    });
  }
  /**
   * Disposes the component and the associated resources.
   */
  dispose() {
    const e = this.scene;
    if (e._mainSoundTrack && e.mainSoundTrack.dispose(), e.soundTracks)
      for (let t = 0; t < e.soundTracks.length; t++)
        e.soundTracks[t].dispose();
  }
  /**
   * Disables audio in the associated scene.
   */
  disableAudio() {
    const e = this.scene;
    this._audioEnabled = !1, Ge.audioEngine && Ge.audioEngine.audioContext && Ge.audioEngine.audioContext.suspend();
    let t;
    for (t = 0; t < e.mainSoundTrack.soundCollection.length; t++)
      e.mainSoundTrack.soundCollection[t].pause();
    if (e.soundTracks)
      for (t = 0; t < e.soundTracks.length; t++)
        for (let r = 0; r < e.soundTracks[t].soundCollection.length; r++)
          e.soundTracks[t].soundCollection[r].pause();
  }
  /**
   * Enables audio in the associated scene.
   */
  enableAudio() {
    const e = this.scene;
    this._audioEnabled = !0, Ge.audioEngine && Ge.audioEngine.audioContext && Ge.audioEngine.audioContext.resume();
    let t;
    for (t = 0; t < e.mainSoundTrack.soundCollection.length; t++)
      e.mainSoundTrack.soundCollection[t].isPaused && e.mainSoundTrack.soundCollection[t].play();
    if (e.soundTracks)
      for (t = 0; t < e.soundTracks.length; t++)
        for (let r = 0; r < e.soundTracks[t].soundCollection.length; r++)
          e.soundTracks[t].soundCollection[r].isPaused && e.soundTracks[t].soundCollection[r].play();
  }
  /**
   * Switch audio to headphone output.
   */
  switchAudioModeForHeadphones() {
    const e = this.scene;
    if (this._headphone = !0, e.mainSoundTrack.switchPanningModelToHRTF(), e.soundTracks)
      for (let t = 0; t < e.soundTracks.length; t++)
        e.soundTracks[t].switchPanningModelToHRTF();
  }
  /**
   * Switch audio to normal speakers.
   */
  switchAudioModeForNormalSpeakers() {
    const e = this.scene;
    if (this._headphone = !1, e.mainSoundTrack.switchPanningModelToEqualPower(), e.soundTracks)
      for (let t = 0; t < e.soundTracks.length; t++)
        e.soundTracks[t].switchPanningModelToEqualPower();
  }
  _afterRender() {
    const e = Yi.Now;
    if (this._lastCheck && e - this._lastCheck < this.audioPositioningRefreshRate)
      return;
    this._lastCheck = e;
    const t = this.scene;
    if (!this._audioEnabled || !t._mainSoundTrack || !t.soundTracks || t._mainSoundTrack.soundCollection.length === 0 && t.soundTracks.length === 1)
      return;
    const r = Ge.audioEngine;
    if (r && r.audioContext) {
      let n = t.activeCamera;
      if (t.activeCameras && t.activeCameras.length > 0 && (n = t.activeCameras[0]), this.audioListenerPositionProvider) {
        const s = this.audioListenerPositionProvider();
        r.audioContext.listener.setPosition(s.x || 0, s.y || 0, s.z || 0);
      } else
        n ? this._cachedCameraPosition.equals(n.globalPosition) || (this._cachedCameraPosition.copyFrom(n.globalPosition), r.audioContext.listener.setPosition(n.globalPosition.x, n.globalPosition.y, n.globalPosition.z)) : r.audioContext.listener.setPosition(0, 0, 0);
      if (this.audioListenerRotationProvider) {
        const s = this.audioListenerRotationProvider();
        r.audioContext.listener.setOrientation(s.x || 0, s.y || 0, s.z || 0, 0, 1, 0);
      } else
        n ? (n.rigCameras && n.rigCameras.length > 0 && (n = n.rigCameras[0]), n.getViewMatrix().invertToRef(this._invertMatrixTemp), S.TransformNormalToRef(yu._CameraDirection, this._invertMatrixTemp, this._cameraDirectionTemp), this._cameraDirectionTemp.normalize(), !isNaN(this._cameraDirectionTemp.x) && !isNaN(this._cameraDirectionTemp.y) && !isNaN(this._cameraDirectionTemp.z) && (this._cachedCameraDirection.equals(this._cameraDirectionTemp) || (this._cachedCameraDirection.copyFrom(this._cameraDirectionTemp), r.audioContext.listener.setOrientation(this._cameraDirectionTemp.x, this._cameraDirectionTemp.y, this._cameraDirectionTemp.z, 0, 1, 0)))) : r.audioContext.listener.setOrientation(0, 0, 0, 0, 1, 0);
      let i;
      for (i = 0; i < t.mainSoundTrack.soundCollection.length; i++) {
        const s = t.mainSoundTrack.soundCollection[i];
        s.useCustomAttenuation && s.updateDistanceFromListener();
      }
      if (t.soundTracks)
        for (i = 0; i < t.soundTracks.length; i++)
          for (let s = 0; s < t.soundTracks[i].soundCollection.length; s++) {
            const a = t.soundTracks[i].soundCollection[s];
            a.useCustomAttenuation && a.updateDistanceFromListener();
          }
    }
  }
}
yu._CameraDirection = new S(0, 0, -1);
qc._SceneComponentInitialization = (A) => {
  let e = A._getComponent(Ot.NAME_AUDIO);
  e || (e = new yu(A), A._addComponent(e));
};
class lee {
  /**
   * Creates a new WeightedSound from the list of sounds given.
   * @param loop When true a Sound will be selected and played when the current playing Sound completes.
   * @param sounds Array of Sounds that will be selected from.
   * @param weights Array of number values for selection weights; length must equal sounds, values will be normalized to 1
   */
  constructor(e, t, r) {
    if (this.loop = !1, this._coneInnerAngle = 360, this._coneOuterAngle = 360, this._volume = 1, this.isPlaying = !1, this.isPaused = !1, this._sounds = [], this._weights = [], t.length !== r.length)
      throw new Error("Sounds length does not equal weights length");
    this.loop = e, this._weights = r;
    let n = 0;
    for (const s of r)
      n += s;
    const i = n > 0 ? 1 / n : 0;
    for (let s = 0; s < this._weights.length; s++)
      this._weights[s] *= i;
    this._sounds = t;
    for (const s of this._sounds)
      s.onEndedObservable.add(() => {
        this._onended();
      });
  }
  /**
   * The size of cone in degrees for a directional sound in which there will be no attenuation.
   */
  get directionalConeInnerAngle() {
    return this._coneInnerAngle;
  }
  /**
   * The size of cone in degrees for a directional sound in which there will be no attenuation.
   */
  set directionalConeInnerAngle(e) {
    if (e !== this._coneInnerAngle) {
      if (this._coneOuterAngle < e) {
        Se.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");
        return;
      }
      this._coneInnerAngle = e;
      for (const t of this._sounds)
        t.directionalConeInnerAngle = e;
    }
  }
  /**
   * Size of cone in degrees for a directional sound outside of which there will be no sound.
   * Listener angles between innerAngle and outerAngle will falloff linearly.
   */
  get directionalConeOuterAngle() {
    return this._coneOuterAngle;
  }
  /**
   * Size of cone in degrees for a directional sound outside of which there will be no sound.
   * Listener angles between innerAngle and outerAngle will falloff linearly.
   */
  set directionalConeOuterAngle(e) {
    if (e !== this._coneOuterAngle) {
      if (e < this._coneInnerAngle) {
        Se.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");
        return;
      }
      this._coneOuterAngle = e;
      for (const t of this._sounds)
        t.directionalConeOuterAngle = e;
    }
  }
  /**
   * Playback volume.
   */
  get volume() {
    return this._volume;
  }
  /**
   * Playback volume.
   */
  set volume(e) {
    if (e !== this._volume)
      for (const t of this._sounds)
        t.setVolume(e);
  }
  _onended() {
    this._currentIndex !== void 0 && (this._sounds[this._currentIndex].autoplay = !1), this.loop && this.isPlaying ? this.play() : this.isPlaying = !1;
  }
  /**
   * Suspend playback
   */
  pause() {
    this.isPaused = !0, this._currentIndex !== void 0 && this._sounds[this._currentIndex].pause();
  }
  /**
   * Stop playback
   */
  stop() {
    this.isPlaying = !1, this._currentIndex !== void 0 && this._sounds[this._currentIndex].stop();
  }
  /**
   * Start playback.
   * @param startOffset Position the clip head at a specific time in seconds.
   */
  play(e) {
    if (!this.isPaused) {
      this.stop();
      const r = Math.random();
      let n = 0;
      for (let i = 0; i < this._weights.length; i++)
        if (n += this._weights[i], r <= n) {
          this._currentIndex = i;
          break;
        }
    }
    const t = this._sounds[this._currentIndex];
    t.isReady() ? t.play(0, this.isPaused ? void 0 : e) : t.autoplay = !0, this.isPlaying = !0, this.isPaused = !1;
  }
}
class mm {
  /**
   * Creates a new BakedVertexAnimationManager
   * @param scene defines the current scene
   */
  constructor(e) {
    this._texture = null, this._isEnabled = !0, this.isEnabled = !0, this.time = 0, e = e || gr.LastCreatedScene, e && (this._scene = e, this.animationParameters = new Ir(0, 0, 0, 30));
  }
  /** @internal */
  _markSubMeshesAsAttributesDirty() {
    for (const e of this._scene.meshes)
      e.bakedVertexAnimationManager === this && e._markSubMeshesAsAttributesDirty();
  }
  /**
   * Binds to the effect.
   * @param effect The effect to bind to.
   * @param useInstances True when it's an instance.
   */
  bind(e, t = !1) {
    if (!this._texture || !this._isEnabled)
      return;
    const r = this._texture.getSize();
    e.setFloat2("bakedVertexAnimationTextureSizeInverted", 1 / r.width, 1 / r.height), e.setFloat("bakedVertexAnimationTime", this.time), t || e.setVector4("bakedVertexAnimationSettings", this.animationParameters), e.setTexture("bakedVertexAnimationTexture", this._texture);
  }
  /**
   * Clone the current manager
   * @returns a new BakedVertexAnimationManager
   */
  clone() {
    const e = new mm(this._scene);
    return this.copyTo(e), e;
  }
  /**
   * Sets animation parameters.
   * @param startFrame The first frame of the animation.
   * @param endFrame The last frame of the animation.
   * @param offset The offset when starting the animation.
   * @param speedFramesPerSecond The frame rate.
   */
  setAnimationParameters(e, t, r = 0, n = 30) {
    this.animationParameters = new Ir(e, t, r, n);
  }
  /**
   * Disposes the resources of the manager.
   * @param forceDisposeTextures - Forces the disposal of all textures.
   */
  dispose(e) {
    var t;
    e && ((t = this._texture) === null || t === void 0 || t.dispose());
  }
  /**
   * Get the current class name useful for serialization or dynamic coding.
   * @returns "BakedVertexAnimationManager"
   */
  getClassName() {
    return "BakedVertexAnimationManager";
  }
  /**
   * Makes a duplicate of the current instance into another one.
   * @param vatMap define the instance where to copy the info
   */
  copyTo(e) {
    jt.Clone(() => e, this);
  }
  /**
   * Serializes this vertex animation instance
   * @returns - An object with the serialized instance.
   */
  serialize() {
    return jt.Serialize(this);
  }
  /**
   * Parses a vertex animation setting from a serialized object.
   * @param source - Serialized object.
   * @param scene Defines the scene we are parsing for
   * @param rootUrl Defines the rootUrl to load from
   */
  parse(e, t, r) {
    jt.Parse(() => this, e, t, r);
  }
}
C([
  en(),
  At("_markSubMeshesAsAttributesDirty")
], mm.prototype, "texture", void 0);
C([
  M(),
  At("_markSubMeshesAsAttributesDirty")
], mm.prototype, "isEnabled", void 0);
C([
  M()
], mm.prototype, "animationParameters", void 0);
C([
  M()
], mm.prototype, "time", void 0);
class nq {
  /**
   * | Value | Type               | Description |
   * | ----- | ------------------ | ----------- |
   * | 0     | CLAMP_ADDRESSMODE  |             |
   * | 1     | WRAP_ADDRESSMODE   |             |
   * | 2     | MIRROR_ADDRESSMODE |             |
   */
  get wrapU() {
    return this._wrapU;
  }
  set wrapU(e) {
    this._wrapU = e;
  }
  /**
   * | Value | Type               | Description |
   * | ----- | ------------------ | ----------- |
   * | 0     | CLAMP_ADDRESSMODE  |             |
   * | 1     | WRAP_ADDRESSMODE   |             |
   * | 2     | MIRROR_ADDRESSMODE |             |
   */
  get wrapV() {
    return this._wrapV;
  }
  set wrapV(e) {
    this._wrapV = e;
  }
  /**
   * How a texture is mapped.
   * Unused in thin texture mode.
   */
  get coordinatesMode() {
    return 0;
  }
  /**
   * Define if the texture is a cube texture or if false a 2d texture.
   */
  get isCube() {
    return this._texture ? this._texture.isCube : !1;
  }
  set isCube(e) {
    this._texture && (this._texture.isCube = e);
  }
  /**
   * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
   */
  get is3D() {
    return this._texture ? this._texture.is3D : !1;
  }
  set is3D(e) {
    this._texture && (this._texture.is3D = e);
  }
  /**
   * Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.
   */
  get is2DArray() {
    return this._texture ? this._texture.is2DArray : !1;
  }
  set is2DArray(e) {
    this._texture && (this._texture.is2DArray = e);
  }
  /**
   * Get the class name of the texture.
   * @returns "ThinTexture"
   */
  getClassName() {
    return "ThinTexture";
  }
  static _IsRenderTargetWrapper(e) {
    return (e == null ? void 0 : e._shareDepth) !== void 0;
  }
  /**
   * Instantiates a new ThinTexture.
   * Base class of all the textures in babylon.
   * This can be used as an internal texture wrapper in ThinEngine to benefit from the cache
   * @param internalTexture Define the internalTexture to wrap. You can also pass a RenderTargetWrapper, in which case the texture will be the render target's texture
   */
  constructor(e) {
    this._wrapU = 1, this._wrapV = 1, this.wrapR = 1, this.anisotropicFilteringLevel = 4, this.delayLoadState = 0, this._texture = null, this._engine = null, this._cachedSize = Qd.Zero(), this._cachedBaseSize = Qd.Zero(), this._initialSamplingMode = 2, this._texture = nq._IsRenderTargetWrapper(e) ? e.texture : e, this._texture && (this._engine = this._texture.getEngine());
  }
  /**
   * Get if the texture is ready to be used (downloaded, converted, mip mapped...).
   * @returns true if fully ready
   */
  isReady() {
    return this.delayLoadState === 4 ? (this.delayLoad(), !1) : this._texture ? this._texture.isReady : !1;
  }
  /**
   * Triggers the load sequence in delayed load mode.
   */
  delayLoad() {
  }
  /**
   * Get the underlying lower level texture from Babylon.
   * @returns the internal texture
   */
  getInternalTexture() {
    return this._texture;
  }
  /**
   * Get the size of the texture.
   * @returns the texture size.
   */
  getSize() {
    if (this._texture) {
      if (this._texture.width)
        return this._cachedSize.width = this._texture.width, this._cachedSize.height = this._texture.height, this._cachedSize;
      if (this._texture._size)
        return this._cachedSize.width = this._texture._size, this._cachedSize.height = this._texture._size, this._cachedSize;
    }
    return this._cachedSize;
  }
  /**
   * Get the base size of the texture.
   * It can be different from the size if the texture has been resized for POT for instance
   * @returns the base size
   */
  getBaseSize() {
    return !this.isReady() || !this._texture ? (this._cachedBaseSize.width = 0, this._cachedBaseSize.height = 0, this._cachedBaseSize) : this._texture._size ? (this._cachedBaseSize.width = this._texture._size, this._cachedBaseSize.height = this._texture._size, this._cachedBaseSize) : (this._cachedBaseSize.width = this._texture.baseWidth, this._cachedBaseSize.height = this._texture.baseHeight, this._cachedBaseSize);
  }
  /**
   * Get the current sampling mode associated with the texture.
   */
  get samplingMode() {
    return this._texture ? this._texture.samplingMode : this._initialSamplingMode;
  }
  /**
   * Update the sampling mode of the texture.
   * Default is Trilinear mode.
   *
   * | Value | Type               | Description |
   * | ----- | ------------------ | ----------- |
   * | 1     | NEAREST_SAMPLINGMODE or NEAREST_NEAREST_MIPLINEAR  | Nearest is: mag = nearest, min = nearest, mip = linear |
   * | 2     | BILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPNEAREST | Bilinear is: mag = linear, min = linear, mip = nearest |
   * | 3     | TRILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPLINEAR | Trilinear is: mag = linear, min = linear, mip = linear |
   * | 4     | NEAREST_NEAREST_MIPNEAREST |             |
   * | 5    | NEAREST_LINEAR_MIPNEAREST |             |
   * | 6    | NEAREST_LINEAR_MIPLINEAR |             |
   * | 7    | NEAREST_LINEAR |             |
   * | 8    | NEAREST_NEAREST |             |
   * | 9   | LINEAR_NEAREST_MIPNEAREST |             |
   * | 10   | LINEAR_NEAREST_MIPLINEAR |             |
   * | 11   | LINEAR_LINEAR |             |
   * | 12   | LINEAR_NEAREST |             |
   *
   *    > _mag_: magnification filter (close to the viewer)
   *    > _min_: minification filter (far from the viewer)
   *    > _mip_: filter used between mip map levels
   *@param samplingMode Define the new sampling mode of the texture
   */
  updateSamplingMode(e) {
    this._texture && this._engine && this._engine.updateTextureSamplingMode(e, this._texture);
  }
  /**
   * Release and destroy the underlying lower level texture aka internalTexture.
   */
  releaseInternalTexture() {
    this._texture && (this._texture.dispose(), this._texture = null);
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
    this._texture && (this.releaseInternalTexture(), this._engine = null);
  }
}
class ls extends nq {
  /**
   * Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance).
   */
  set hasAlpha(e) {
    this._hasAlpha !== e && (this._hasAlpha = e, this._scene && this._scene.markAllMaterialsAsDirty(1, (t) => t.hasTexture(this)));
  }
  get hasAlpha() {
    return this._hasAlpha;
  }
  /**
   * Defines if the alpha value should be determined via the rgb values.
   * If true the luminance of the pixel might be used to find the corresponding alpha value.
   */
  set getAlphaFromRGB(e) {
    this._getAlphaFromRGB !== e && (this._getAlphaFromRGB = e, this._scene && this._scene.markAllMaterialsAsDirty(1, (t) => t.hasTexture(this)));
  }
  get getAlphaFromRGB() {
    return this._getAlphaFromRGB;
  }
  /**
   * Define the UV channel to use starting from 0 and defaulting to 0.
   * This is part of the texture as textures usually maps to one uv set.
   */
  set coordinatesIndex(e) {
    this._coordinatesIndex !== e && (this._coordinatesIndex = e, this._scene && this._scene.markAllMaterialsAsDirty(1, (t) => t.hasTexture(this)));
  }
  get coordinatesIndex() {
    return this._coordinatesIndex;
  }
  /**
   * How a texture is mapped.
   *
   * | Value | Type                                | Description |
   * | ----- | ----------------------------------- | ----------- |
   * | 0     | EXPLICIT_MODE                       |             |
   * | 1     | SPHERICAL_MODE                      |             |
   * | 2     | PLANAR_MODE                         |             |
   * | 3     | CUBIC_MODE                          |             |
   * | 4     | PROJECTION_MODE                     |             |
   * | 5     | SKYBOX_MODE                         |             |
   * | 6     | INVCUBIC_MODE                       |             |
   * | 7     | EQUIRECTANGULAR_MODE                |             |
   * | 8     | FIXED_EQUIRECTANGULAR_MODE          |             |
   * | 9     | FIXED_EQUIRECTANGULAR_MIRRORED_MODE |             |
   */
  set coordinatesMode(e) {
    this._coordinatesMode !== e && (this._coordinatesMode = e, this._scene && this._scene.markAllMaterialsAsDirty(1, (t) => t.hasTexture(this)));
  }
  get coordinatesMode() {
    return this._coordinatesMode;
  }
  /**
   * | Value | Type               | Description |
   * | ----- | ------------------ | ----------- |
   * | 0     | CLAMP_ADDRESSMODE  |             |
   * | 1     | WRAP_ADDRESSMODE   |             |
   * | 2     | MIRROR_ADDRESSMODE |             |
   */
  get wrapU() {
    return this._wrapU;
  }
  set wrapU(e) {
    this._wrapU = e;
  }
  /**
   * | Value | Type               | Description |
   * | ----- | ------------------ | ----------- |
   * | 0     | CLAMP_ADDRESSMODE  |             |
   * | 1     | WRAP_ADDRESSMODE   |             |
   * | 2     | MIRROR_ADDRESSMODE |             |
   */
  get wrapV() {
    return this._wrapV;
  }
  set wrapV(e) {
    this._wrapV = e;
  }
  /**
   * Define if the texture is a cube texture or if false a 2d texture.
   */
  get isCube() {
    return this._texture ? this._texture.isCube : this._isCube;
  }
  set isCube(e) {
    this._texture ? this._texture.isCube = e : this._isCube = e;
  }
  /**
   * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
   */
  get is3D() {
    return this._texture ? this._texture.is3D : !1;
  }
  set is3D(e) {
    this._texture && (this._texture.is3D = e);
  }
  /**
   * Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.
   */
  get is2DArray() {
    return this._texture ? this._texture.is2DArray : !1;
  }
  set is2DArray(e) {
    this._texture && (this._texture.is2DArray = e);
  }
  /**
   * Define if the texture contains data in gamma space (most of the png/jpg aside bump).
   * HDR texture are usually stored in linear space.
   * This only impacts the PBR and Background materials
   */
  get gammaSpace() {
    if (this._texture)
      this._texture._gammaSpace === null && (this._texture._gammaSpace = this._gammaSpace);
    else
      return this._gammaSpace;
    return this._texture._gammaSpace && !this._texture._useSRGBBuffer;
  }
  set gammaSpace(e) {
    var t;
    if (this._texture) {
      if (this._texture._gammaSpace === e)
        return;
      this._texture._gammaSpace = e;
    } else {
      if (this._gammaSpace === e)
        return;
      this._gammaSpace = e;
    }
    (t = this.getScene()) === null || t === void 0 || t.markAllMaterialsAsDirty(1, (r) => r.hasTexture(this));
  }
  /**
   * Gets or sets whether or not the texture contains RGBD data.
   */
  get isRGBD() {
    return this._texture != null && this._texture._isRGBD;
  }
  set isRGBD(e) {
    var t;
    e !== this.isRGBD && (this._texture && (this._texture._isRGBD = e), (t = this.getScene()) === null || t === void 0 || t.markAllMaterialsAsDirty(1, (r) => r.hasTexture(this)));
  }
  /**
   * Are mip maps generated for this texture or not.
   */
  get noMipmap() {
    return !1;
  }
  /**
   * With prefiltered texture, defined the offset used during the prefiltering steps.
   */
  get lodGenerationOffset() {
    return this._texture ? this._texture._lodGenerationOffset : 0;
  }
  set lodGenerationOffset(e) {
    this._texture && (this._texture._lodGenerationOffset = e);
  }
  /**
   * With prefiltered texture, defined the scale used during the prefiltering steps.
   */
  get lodGenerationScale() {
    return this._texture ? this._texture._lodGenerationScale : 0;
  }
  set lodGenerationScale(e) {
    this._texture && (this._texture._lodGenerationScale = e);
  }
  /**
   * With prefiltered texture, defined if the specular generation is based on a linear ramp.
   * By default we are using a log2 of the linear roughness helping to keep a better resolution for
   * average roughness values.
   */
  get linearSpecularLOD() {
    return this._texture ? this._texture._linearSpecularLOD : !1;
  }
  set linearSpecularLOD(e) {
    this._texture && (this._texture._linearSpecularLOD = e);
  }
  /**
   * In case a better definition than spherical harmonics is required for the diffuse part of the environment.
   * You can set the irradiance texture to rely on a texture instead of the spherical approach.
   * This texture need to have the same characteristics than its parent (Cube vs 2d, coordinates mode, Gamma/Linear, RGBD).
   */
  get irradianceTexture() {
    return this._texture ? this._texture._irradianceTexture : null;
  }
  set irradianceTexture(e) {
    this._texture && (this._texture._irradianceTexture = e);
  }
  /**
   * Define the unique id of the texture in the scene.
   */
  get uid() {
    return this._uid || (this._uid = v4()), this._uid;
  }
  /**
   * Return a string representation of the texture.
   * @returns the texture as a string
   */
  toString() {
    return this.name;
  }
  /**
   * Get the class name of the texture.
   * @returns "BaseTexture"
   */
  getClassName() {
    return "BaseTexture";
  }
  /**
   * Callback triggered when the texture has been disposed.
   * Kept for back compatibility, you can use the onDisposeObservable instead.
   */
  set onDispose(e) {
    this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);
  }
  /**
   * Define if the texture is preventing a material to render or not.
   * If not and the texture is not ready, the engine will use a default black texture instead.
   */
  get isBlocking() {
    return !0;
  }
  /**
   * Was there any loading error?
   */
  get loadingError() {
    return this._loadingError;
  }
  /**
   * If a loading error occurred this object will be populated with information about the error.
   */
  get errorObject() {
    return this._errorObject;
  }
  /**
   * Instantiates a new BaseTexture.
   * Base class of all the textures in babylon.
   * It groups all the common properties the materials, post process, lights... might need
   * in order to make a correct use of the texture.
   * @param sceneOrEngine Define the scene or engine the texture belongs to
   * @param internalTexture Define the internal texture associated with the texture
   */
  constructor(e, t = null) {
    super(null), this.metadata = null, this.reservedDataStore = null, this._hasAlpha = !1, this._getAlphaFromRGB = !1, this.level = 1, this._coordinatesIndex = 0, this.optimizeUVAllocation = !0, this._coordinatesMode = 0, this.wrapR = 1, this.anisotropicFilteringLevel = ls.DEFAULT_ANISOTROPIC_FILTERING_LEVEL, this._isCube = !1, this._gammaSpace = !0, this.invertZ = !1, this.lodLevelInAlpha = !1, this.isRenderTarget = !1, this._prefiltered = !1, this._forceSerialize = !1, this.animations = [], this.onDisposeObservable = new Oe(), this._onDisposeObserver = null, this._scene = null, this._uid = null, this._parentContainer = null, this._loadingError = !1, e ? ls._IsScene(e) ? this._scene = e : this._engine = e : this._scene = gr.LastCreatedScene, this._scene && (this.uniqueId = this._scene.getUniqueId(), this._scene.addTexture(this), this._engine = this._scene.getEngine()), this._texture = t, this._uid = null;
  }
  /**
   * Get the scene the texture belongs to.
   * @returns the scene or null if undefined
   */
  getScene() {
    return this._scene;
  }
  /** @internal */
  _getEngine() {
    return this._engine;
  }
  /**
   * Checks if the texture has the same transform matrix than another texture
   * @param texture texture to check against
   * @returns true if the transforms are the same, else false
   */
  checkTransformsAreIdentical(e) {
    return e !== null;
  }
  /**
   * Get the texture transform matrix used to offset tile the texture for instance.
   * @returns the transformation matrix
   */
  getTextureMatrix() {
    return he.IdentityReadOnly;
  }
  /**
   * Get the texture reflection matrix used to rotate/transform the reflection.
   * @returns the reflection matrix
   */
  getReflectionTextureMatrix() {
    return he.IdentityReadOnly;
  }
  /**
   * Gets a suitable rotate/transform matrix when the texture is used for refraction.
   * There's a separate function from getReflectionTextureMatrix because refraction requires a special configuration of the matrix in right-handed mode.
   * @returns The refraction matrix
   */
  getRefractionTextureMatrix() {
    return this.getReflectionTextureMatrix();
  }
  /**
   * Get if the texture is ready to be consumed (either it is ready or it is not blocking)
   * @returns true if ready, not blocking or if there was an error loading the texture
   */
  isReadyOrNotBlocking() {
    return !this.isBlocking || this.isReady() || this.loadingError;
  }
  /**
   * Scales the texture if is `canRescale()`
   * @param ratio the resize factor we want to use to rescale
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  scale(e) {
  }
  /**
   * Get if the texture can rescale.
   */
  get canRescale() {
    return !1;
  }
  /**
   * @internal
   */
  _getFromCache(e, t, r, n, i, s) {
    const a = this._getEngine();
    if (!a)
      return null;
    const f = a._getUseSRGBBuffer(!!i, t), o = a.getLoadedTexturesCache();
    for (let d = 0; d < o.length; d++) {
      const v = o[d];
      if ((i === void 0 || f === v._useSRGBBuffer) && (n === void 0 || n === v.invertY) && v.url === e && v.generateMipMaps === !t && (!r || r === v.samplingMode) && (s === void 0 || s === v.isCube))
        return v.incrementReferences(), v;
    }
    return null;
  }
  /** @internal */
  _rebuild() {
  }
  /**
   * Clones the texture.
   * @returns the cloned texture
   */
  clone() {
    return null;
  }
  /**
   * Get the texture underlying type (INT, FLOAT...)
   */
  get textureType() {
    return this._texture && this._texture.type !== void 0 ? this._texture.type : 0;
  }
  /**
   * Get the texture underlying format (RGB, RGBA...)
   */
  get textureFormat() {
    return this._texture && this._texture.format !== void 0 ? this._texture.format : 5;
  }
  /**
   * Indicates that textures need to be re-calculated for all materials
   */
  _markAllSubMeshesAsTexturesDirty() {
    const e = this.getScene();
    e && e.markAllMaterialsAsDirty(1);
  }
  /**
   * Reads the pixels stored in the webgl texture and returns them as an ArrayBuffer.
   * This will returns an RGBA array buffer containing either in values (0-255) or
   * float values (0-1) depending of the underlying buffer type.
   * @param faceIndex defines the face of the texture to read (in case of cube texture)
   * @param level defines the LOD level of the texture to read (in case of Mip Maps)
   * @param buffer defines a user defined buffer to fill with data (can be null)
   * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
   * @param noDataConversion false to convert the data to Uint8Array (if texture type is UNSIGNED_BYTE) or to Float32Array (if texture type is anything but UNSIGNED_BYTE). If true, the type of the generated buffer (if buffer==null) will depend on the type of the texture
   * @param x defines the region x coordinates to start reading from (default to 0)
   * @param y defines the region y coordinates to start reading from (default to 0)
   * @param width defines the region width to read from (default to the texture size at level)
   * @param height defines the region width to read from (default to the texture size at level)
   * @returns The Array buffer promise containing the pixels data.
   */
  readPixels(e = 0, t = 0, r = null, n = !0, i = !1, s = 0, a = 0, f = Number.MAX_VALUE, o = Number.MAX_VALUE) {
    if (!this._texture)
      return null;
    const d = this._getEngine();
    if (!d)
      return null;
    const v = this.getSize();
    let u = v.width, l = v.height;
    t !== 0 && (u = u / Math.pow(2, t), l = l / Math.pow(2, t), u = Math.round(u), l = Math.round(l)), f = Math.min(u, f), o = Math.min(l, o);
    try {
      return this._texture.isCube ? d._readTexturePixels(this._texture, f, o, e, t, r, n, i, s, a) : d._readTexturePixels(this._texture, f, o, -1, t, r, n, i, s, a);
    } catch {
      return null;
    }
  }
  /**
   * @internal
   */
  _readPixelsSync(e = 0, t = 0, r = null, n = !0, i = !1) {
    if (!this._texture)
      return null;
    const s = this.getSize();
    let a = s.width, f = s.height;
    const o = this._getEngine();
    if (!o)
      return null;
    t != 0 && (a = a / Math.pow(2, t), f = f / Math.pow(2, t), a = Math.round(a), f = Math.round(f));
    try {
      return this._texture.isCube ? o._readTexturePixelsSync(this._texture, a, f, e, t, r, n, i) : o._readTexturePixelsSync(this._texture, a, f, -1, t, r, n, i);
    } catch {
      return null;
    }
  }
  /** @internal */
  get _lodTextureHigh() {
    return this._texture ? this._texture._lodTextureHigh : null;
  }
  /** @internal */
  get _lodTextureMid() {
    return this._texture ? this._texture._lodTextureMid : null;
  }
  /** @internal */
  get _lodTextureLow() {
    return this._texture ? this._texture._lodTextureLow : null;
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
    if (this._scene) {
      this._scene.stopAnimation && this._scene.stopAnimation(this), this._scene.removePendingData(this);
      const e = this._scene.textures.indexOf(this);
      if (e >= 0 && this._scene.textures.splice(e, 1), this._scene.onTextureRemovedObservable.notifyObservers(this), this._scene = null, this._parentContainer) {
        const t = this._parentContainer.textures.indexOf(this);
        t > -1 && this._parentContainer.textures.splice(t, 1), this._parentContainer = null;
      }
    }
    this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.metadata = null, super.dispose();
  }
  /**
   * Serialize the texture into a JSON representation that can be parsed later on.
   * @param allowEmptyName True to force serialization even if name is empty. Default: false
   * @returns the JSON representation of the texture
   */
  serialize(e = !1) {
    if (!this.name && !e)
      return null;
    const t = jt.Serialize(this);
    return jt.AppendSerializedAnimations(this, t), t;
  }
  /**
   * Helper function to be called back once a list of texture contains only ready textures.
   * @param textures Define the list of textures to wait for
   * @param callback Define the callback triggered once the entire list will be ready
   */
  static WhenAllReady(e, t) {
    let r = e.length;
    if (r === 0) {
      t();
      return;
    }
    for (let n = 0; n < e.length; n++) {
      const i = e[n];
      if (i.isReady())
        --r === 0 && t();
      else {
        const s = i.onLoadObservable;
        s ? s.addOnce(() => {
          --r === 0 && t();
        }) : --r === 0 && t();
      }
    }
  }
  static _IsScene(e) {
    return e.getClassName() === "Scene";
  }
}
ls.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4;
C([
  M()
], ls.prototype, "uniqueId", void 0);
C([
  M()
], ls.prototype, "name", void 0);
C([
  M()
], ls.prototype, "metadata", void 0);
C([
  M("hasAlpha")
], ls.prototype, "_hasAlpha", void 0);
C([
  M("getAlphaFromRGB")
], ls.prototype, "_getAlphaFromRGB", void 0);
C([
  M()
], ls.prototype, "level", void 0);
C([
  M("coordinatesIndex")
], ls.prototype, "_coordinatesIndex", void 0);
C([
  M()
], ls.prototype, "optimizeUVAllocation", void 0);
C([
  M("coordinatesMode")
], ls.prototype, "_coordinatesMode", void 0);
C([
  M()
], ls.prototype, "wrapU", null);
C([
  M()
], ls.prototype, "wrapV", null);
C([
  M()
], ls.prototype, "wrapR", void 0);
C([
  M()
], ls.prototype, "anisotropicFilteringLevel", void 0);
C([
  M()
], ls.prototype, "isCube", null);
C([
  M()
], ls.prototype, "is3D", null);
C([
  M()
], ls.prototype, "is2DArray", null);
C([
  M()
], ls.prototype, "gammaSpace", null);
C([
  M()
], ls.prototype, "invertZ", void 0);
C([
  M()
], ls.prototype, "lodLevelInAlpha", void 0);
C([
  M()
], ls.prototype, "lodGenerationOffset", null);
C([
  M()
], ls.prototype, "lodGenerationScale", null);
C([
  M()
], ls.prototype, "linearSpecularLOD", null);
C([
  en()
], ls.prototype, "irradianceTexture", null);
C([
  M()
], ls.prototype, "isRenderTarget", void 0);
function SO(A, e, t = !1) {
  const r = e.width, n = e.height;
  if (A instanceof Float32Array) {
    let o = A.byteLength / A.BYTES_PER_ELEMENT;
    const d = new Uint8Array(o);
    for (; --o >= 0; ) {
      let v = A[o];
      v < 0 ? v = 0 : v > 1 && (v = 1), d[o] = v * 255;
    }
    A = d;
  }
  const i = document.createElement("canvas");
  i.width = r, i.height = n;
  const s = i.getContext("2d");
  if (!s)
    return null;
  const a = s.createImageData(r, n);
  if (a.data.set(A), s.putImageData(a, 0, 0), t) {
    const o = document.createElement("canvas");
    o.width = r, o.height = n;
    const d = o.getContext("2d");
    return d ? (d.translate(0, n), d.scale(1, -1), d.drawImage(i, 0, 0), o.toDataURL("image/png")) : null;
  }
  return i.toDataURL("image/png");
}
function rQ(A, e = 0, t = 0) {
  const r = A.getInternalTexture();
  if (!r)
    return null;
  const n = A._readPixelsSync(e, t);
  return n ? SO(n, A.getSize(), r.invertY) : null;
}
async function nQ(A, e = 0, t = 0) {
  const r = A.getInternalTexture();
  if (!r)
    return null;
  const n = await A.readPixels(e, t);
  return n ? SO(n, A.getSize(), r.invertY) : null;
}
const g6e = {
  /**
   * Transform some pixel data to a base64 string
   * @param pixels defines the pixel data to transform to base64
   * @param size defines the width and height of the (texture) data
   * @param invertY true if the data must be inverted for the Y coordinate during the conversion
   * @returns The base64 encoded string or null
   */
  GenerateBase64StringFromPixelData: SO,
  /**
   * Reads the pixels stored in the webgl texture and returns them as a base64 string
   * @param texture defines the texture to read pixels from
   * @param faceIndex defines the face of the texture to read (in case of cube texture)
   * @param level defines the LOD level of the texture to read (in case of Mip Maps)
   * @returns The base64 encoded string or null
   */
  GenerateBase64StringFromTexture: rQ,
  /**
   * Reads the pixels stored in the webgl texture and returns them as a base64 string
   * @param texture defines the texture to read pixels from
   * @param faceIndex defines the face of the texture to read (in case of cube texture)
   * @param level defines the LOD level of the texture to read (in case of Mip Maps)
   * @returns The base64 encoded string or null wrapped in a promise
   */
  GenerateBase64StringFromTextureAsync: nQ
};
class We extends ls {
  static _CreateVideoTexture(e, t, r, n = !1, i = !1, s = We.TRILINEAR_SAMPLINGMODE, a = {}, f, o = 5) {
    throw qn("VideoTexture");
  }
  /**
   * Are mip maps generated for this texture or not.
   */
  get noMipmap() {
    return this._noMipmap;
  }
  /** Returns the texture mime type if it was defined by a loader (undefined else) */
  get mimeType() {
    return this._mimeType;
  }
  /**
   * Is the texture preventing material to render while loading.
   * If false, a default texture will be used instead of the loading one during the preparation step.
   */
  set isBlocking(e) {
    this._isBlocking = e;
  }
  get isBlocking() {
    return this._isBlocking;
  }
  /**
   * Gets a boolean indicating if the texture needs to be inverted on the y axis during loading
   */
  get invertY() {
    return this._invertY;
  }
  /**
   * Instantiates a new texture.
   * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture
   * @param url defines the url of the picture to load as a texture
   * @param sceneOrEngine defines the scene or engine the texture will belong to
   * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
   * @param invertY defines if the texture needs to be inverted on the y axis during loading
   * @param samplingMode defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
   * @param onLoad defines a callback triggered when the texture has been loaded
   * @param onError defines a callback triggered when an error occurred during the loading session
   * @param buffer defines the buffer to load the texture from in case the texture is loaded from a buffer representation
   * @param deleteBuffer defines if the buffer we are loading the texture from should be deleted after load
   * @param format defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
   * @param mimeType defines an optional mime type information
   * @param loaderOptions options to be passed to the loader
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @param forcedExtension defines the extension to use to pick the right loader
   */
  constructor(e, t, r, n, i = We.TRILINEAR_SAMPLINGMODE, s = null, a = null, f = null, o = !1, d, v, u, l, P) {
    var p, c, H, T, q, b, j, w, m, I;
    super(t), this.url = null, this.uOffset = 0, this.vOffset = 0, this.uScale = 1, this.vScale = 1, this.uAng = 0, this.vAng = 0, this.wAng = 0, this.uRotationCenter = 0.5, this.vRotationCenter = 0.5, this.wRotationCenter = 0.5, this.homogeneousRotationInUVTransform = !1, this.inspectableCustomProperties = null, this._noMipmap = !1, this._invertY = !1, this._rowGenerationMatrix = null, this._cachedTextureMatrix = null, this._projectionModeMatrix = null, this._t0 = null, this._t1 = null, this._t2 = null, this._cachedUOffset = -1, this._cachedVOffset = -1, this._cachedUScale = 0, this._cachedVScale = 0, this._cachedUAng = -1, this._cachedVAng = -1, this._cachedWAng = -1, this._cachedReflectionProjectionMatrixId = -1, this._cachedURotationCenter = -1, this._cachedVRotationCenter = -1, this._cachedWRotationCenter = -1, this._cachedHomogeneousRotationInUVTransform = !1, this._cachedReflectionTextureMatrix = null, this._cachedReflectionUOffset = -1, this._cachedReflectionVOffset = -1, this._cachedReflectionUScale = 0, this._cachedReflectionVScale = 0, this._cachedReflectionCoordinatesMode = -1, this._buffer = null, this._deleteBuffer = !1, this._format = null, this._delayedOnLoad = null, this._delayedOnError = null, this.onLoadObservable = new Oe(), this._isBlocking = !0, this.name = e || "", this.url = e;
    let N, k = !1, R = null, y = !0;
    typeof r == "object" && r !== null ? (N = (p = r.noMipmap) !== null && p !== void 0 ? p : !1, n = (c = r.invertY) !== null && c !== void 0 ? c : !us.UseOpenGLOrientationForUV, i = (H = r.samplingMode) !== null && H !== void 0 ? H : We.TRILINEAR_SAMPLINGMODE, s = (T = r.onLoad) !== null && T !== void 0 ? T : null, a = (q = r.onError) !== null && q !== void 0 ? q : null, f = (b = r.buffer) !== null && b !== void 0 ? b : null, o = (j = r.deleteBuffer) !== null && j !== void 0 ? j : !1, d = r.format, v = r.mimeType, u = r.loaderOptions, l = r.creationFlags, k = (w = r.useSRGBBuffer) !== null && w !== void 0 ? w : !1, R = (m = r.internalTexture) !== null && m !== void 0 ? m : null, y = (I = r.gammaSpace) !== null && I !== void 0 ? I : y) : N = !!r, this._gammaSpace = y, this._noMipmap = N, this._invertY = n === void 0 ? !us.UseOpenGLOrientationForUV : n, this._initialSamplingMode = i, this._buffer = f, this._deleteBuffer = o, this._mimeType = v, this._loaderOptions = u, this._creationFlags = l, this._useSRGBBuffer = k, this._forcedExtension = P, d && (this._format = d);
    const O = this.getScene(), Y = this._getEngine();
    if (!Y)
      return;
    Y.onBeforeTextureInitObservable.notifyObservers(this);
    const ee = () => {
      this._texture && (this._texture._invertVScale && (this.vScale *= -1, this.vOffset += 1), this._texture._cachedWrapU !== null && (this.wrapU = this._texture._cachedWrapU, this._texture._cachedWrapU = null), this._texture._cachedWrapV !== null && (this.wrapV = this._texture._cachedWrapV, this._texture._cachedWrapV = null), this._texture._cachedWrapR !== null && (this.wrapR = this._texture._cachedWrapR, this._texture._cachedWrapR = null)), this.onLoadObservable.hasObservers() && this.onLoadObservable.notifyObservers(this), s && s(), !this.isBlocking && O && O.resetCachedMaterial();
    }, Z = (te, fe) => {
      this._loadingError = !0, this._errorObject = { message: te, exception: fe }, a && a(te, fe), We.OnTextureLoadErrorObservable.notifyObservers(this);
    };
    if (!this.url && !R) {
      this._delayedOnLoad = ee, this._delayedOnError = Z;
      return;
    }
    if (this._texture = R ?? this._getFromCache(this.url, N, i, this._invertY, k, this.isCube), this._texture)
      if (this._texture.isReady)
        wS.SetImmediate(() => ee());
      else {
        const te = this._texture.onLoadedObservable.add(ee);
        this._texture.onErrorObservable.add((fe) => {
          var _;
          Z(fe.message, fe.exception), (_ = this._texture) === null || _ === void 0 || _.onLoadedObservable.remove(te);
        });
      }
    else if (!O || !O.useDelayedTextureLoading) {
      try {
        this._texture = Y.createTexture(this.url, N, this._invertY, O, i, ee, Z, this._buffer, void 0, this._format, this._forcedExtension, v, u, l, k);
      } catch (te) {
        throw Z("error loading", te), te;
      }
      o && (this._buffer = null);
    } else
      this.delayLoadState = 4, this._delayedOnLoad = ee, this._delayedOnError = Z;
  }
  /**
   * Update the url (and optional buffer) of this texture if url was null during construction.
   * @param url the url of the texture
   * @param buffer the buffer of the texture (defaults to null)
   * @param onLoad callback called when the texture is loaded  (defaults to null)
   * @param forcedExtension defines the extension to use to pick the right loader
   */
  updateURL(e, t = null, r, n) {
    this.url && (this.releaseInternalTexture(), this.getScene().markAllMaterialsAsDirty(1, (i) => i.hasTexture(this))), (!this.name || this.name.startsWith("data:")) && (this.name = e), this.url = e, this._buffer = t, this._forcedExtension = n, this.delayLoadState = 4, r && (this._delayedOnLoad = r), this.delayLoad();
  }
  /**
   * Finish the loading sequence of a texture flagged as delayed load.
   * @internal
   */
  delayLoad() {
    if (this.delayLoadState !== 4)
      return;
    const e = this.getScene();
    e && (this.delayLoadState = 1, this._texture = this._getFromCache(this.url, this._noMipmap, this.samplingMode, this._invertY, this._useSRGBBuffer, this.isCube), this._texture ? this._delayedOnLoad && (this._texture.isReady ? wS.SetImmediate(this._delayedOnLoad) : this._texture.onLoadedObservable.add(this._delayedOnLoad)) : (this._texture = e.getEngine().createTexture(this.url, this._noMipmap, this._invertY, e, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format, this._forcedExtension, this._mimeType, this._loaderOptions, this._creationFlags, this._useSRGBBuffer), this._deleteBuffer && (this._buffer = null)), this._delayedOnLoad = null, this._delayedOnError = null);
  }
  _prepareRowForTextureGeneration(e, t, r, n) {
    e *= this._cachedUScale, t *= this._cachedVScale, e -= this.uRotationCenter * this._cachedUScale, t -= this.vRotationCenter * this._cachedVScale, r -= this.wRotationCenter, S.TransformCoordinatesFromFloatsToRef(e, t, r, this._rowGenerationMatrix, n), n.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset, n.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset, n.z += this.wRotationCenter;
  }
  /**
   * Checks if the texture has the same transform matrix than another texture
   * @param texture texture to check against
   * @returns true if the transforms are the same, else false
   */
  checkTransformsAreIdentical(e) {
    return e !== null && this.uOffset === e.uOffset && this.vOffset === e.vOffset && this.uScale === e.uScale && this.vScale === e.vScale && this.uAng === e.uAng && this.vAng === e.vAng && this.wAng === e.wAng;
  }
  /**
   * Get the current texture matrix which includes the requested offsetting, tiling and rotation components.
   * @param uBase
   * @returns the transform matrix of the texture.
   */
  getTextureMatrix(e = 1) {
    if (this.uOffset === this._cachedUOffset && this.vOffset === this._cachedVOffset && this.uScale * e === this._cachedUScale && this.vScale === this._cachedVScale && this.uAng === this._cachedUAng && this.vAng === this._cachedVAng && this.wAng === this._cachedWAng && this.uRotationCenter === this._cachedURotationCenter && this.vRotationCenter === this._cachedVRotationCenter && this.wRotationCenter === this._cachedWRotationCenter && this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform)
      return this._cachedTextureMatrix;
    this._cachedUOffset = this.uOffset, this._cachedVOffset = this.vOffset, this._cachedUScale = this.uScale * e, this._cachedVScale = this.vScale, this._cachedUAng = this.uAng, this._cachedVAng = this.vAng, this._cachedWAng = this.wAng, this._cachedURotationCenter = this.uRotationCenter, this._cachedVRotationCenter = this.vRotationCenter, this._cachedWRotationCenter = this.wRotationCenter, this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform, (!this._cachedTextureMatrix || !this._rowGenerationMatrix) && (this._cachedTextureMatrix = he.Zero(), this._rowGenerationMatrix = new he(), this._t0 = S.Zero(), this._t1 = S.Zero(), this._t2 = S.Zero()), he.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix), this.homogeneousRotationInUVTransform ? (he.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, ue.Matrix[0]), he.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, ue.Matrix[1]), he.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, ue.Matrix[2]), he.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, ue.Matrix[3]), ue.Matrix[0].multiplyToRef(this._rowGenerationMatrix, this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(ue.Matrix[1], this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(ue.Matrix[2], this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(ue.Matrix[3], this._cachedTextureMatrix), this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1)) : (this._prepareRowForTextureGeneration(0, 0, 0, this._t0), this._prepareRowForTextureGeneration(1, 0, 0, this._t1), this._prepareRowForTextureGeneration(0, 1, 0, this._t2), this._t1.subtractInPlace(this._t0), this._t2.subtractInPlace(this._t0), he.FromValuesToRef(this._t1.x, this._t1.y, this._t1.z, 0, this._t2.x, this._t2.y, this._t2.z, 0, this._t0.x, this._t0.y, this._t0.z, 0, 0, 0, 0, 1, this._cachedTextureMatrix));
    const t = this.getScene();
    return t ? (this.optimizeUVAllocation && t.markAllMaterialsAsDirty(1, (r) => r.hasTexture(this)), this._cachedTextureMatrix) : this._cachedTextureMatrix;
  }
  /**
   * Get the current matrix used to apply reflection. This is useful to rotate an environment texture for instance.
   * @returns The reflection texture transform
   */
  getReflectionTextureMatrix() {
    const e = this.getScene();
    if (!e)
      return this._cachedReflectionTextureMatrix;
    if (this.uOffset === this._cachedReflectionUOffset && this.vOffset === this._cachedReflectionVOffset && this.uScale === this._cachedReflectionUScale && this.vScale === this._cachedReflectionVScale && this.coordinatesMode === this._cachedReflectionCoordinatesMode)
      if (this.coordinatesMode === We.PROJECTION_MODE) {
        if (this._cachedReflectionProjectionMatrixId === e.getProjectionMatrix().updateFlag)
          return this._cachedReflectionTextureMatrix;
      } else
        return this._cachedReflectionTextureMatrix;
    this._cachedReflectionTextureMatrix || (this._cachedReflectionTextureMatrix = he.Zero()), this._projectionModeMatrix || (this._projectionModeMatrix = he.Zero());
    const t = this._cachedReflectionCoordinatesMode !== this.coordinatesMode;
    switch (this._cachedReflectionUOffset = this.uOffset, this._cachedReflectionVOffset = this.vOffset, this._cachedReflectionUScale = this.uScale, this._cachedReflectionVScale = this.vScale, this._cachedReflectionCoordinatesMode = this.coordinatesMode, this.coordinatesMode) {
      case We.PLANAR_MODE: {
        he.IdentityToRef(this._cachedReflectionTextureMatrix), this._cachedReflectionTextureMatrix[0] = this.uScale, this._cachedReflectionTextureMatrix[5] = this.vScale, this._cachedReflectionTextureMatrix[12] = this.uOffset, this._cachedReflectionTextureMatrix[13] = this.vOffset;
        break;
      }
      case We.PROJECTION_MODE: {
        he.FromValuesToRef(0.5, 0, 0, 0, 0, -0.5, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, this._projectionModeMatrix);
        const r = e.getProjectionMatrix();
        this._cachedReflectionProjectionMatrixId = r.updateFlag, r.multiplyToRef(this._projectionModeMatrix, this._cachedReflectionTextureMatrix);
        break;
      }
      default:
        he.IdentityToRef(this._cachedReflectionTextureMatrix);
        break;
    }
    return t && e.markAllMaterialsAsDirty(1, (r) => r.hasTexture(this)), this._cachedReflectionTextureMatrix;
  }
  /**
   * Clones the texture.
   * @returns the cloned texture
   */
  clone() {
    const e = {
      noMipmap: this._noMipmap,
      invertY: this._invertY,
      samplingMode: this.samplingMode,
      onLoad: void 0,
      onError: void 0,
      buffer: this._texture ? this._texture._buffer : void 0,
      deleteBuffer: this._deleteBuffer,
      format: this.textureFormat,
      mimeType: this.mimeType,
      loaderOptions: this._loaderOptions,
      creationFlags: this._creationFlags,
      useSRGBBuffer: this._useSRGBBuffer
    };
    return jt.Clone(() => new We(this._texture ? this._texture.url : null, this.getScene(), e), this);
  }
  /**
   * Serialize the texture to a JSON representation we can easily use in the respective Parse function.
   * @returns The JSON representation of the texture
   */
  serialize() {
    var e, t;
    const r = this.name;
    We.SerializeBuffers || this.name.startsWith("data:") && (this.name = ""), this.name.startsWith("data:") && this.url === this.name && (this.url = "");
    const n = super.serialize(We._SerializeInternalTextureUniqueId);
    return n ? ((We.SerializeBuffers || We.ForceSerializeBuffers) && (typeof this._buffer == "string" && this._buffer.substr(0, 5) === "data:" ? (n.base64String = this._buffer, n.name = n.name.replace("data:", "")) : this.url && this.url.startsWith("data:") && this._buffer instanceof Uint8Array ? n.base64String = "data:image/png;base64," + XR(this._buffer) : (We.ForceSerializeBuffers || this.url && this.url.startsWith("blob:") || this._forceSerialize) && (n.base64String = !this._engine || this._engine._features.supportSyncTextureRead ? rQ(this) : nQ(this))), n.invertY = this._invertY, n.samplingMode = this.samplingMode, n._creationFlags = this._creationFlags, n._useSRGBBuffer = this._useSRGBBuffer, We._SerializeInternalTextureUniqueId && (n.internalTextureUniqueId = (t = (e = this._texture) === null || e === void 0 ? void 0 : e.uniqueId) !== null && t !== void 0 ? t : void 0), n.noMipmap = this._noMipmap, this.name = r, n) : null;
  }
  /**
   * Get the current class name of the texture useful for serialization or dynamic coding.
   * @returns "Texture"
   */
  getClassName() {
    return "Texture";
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
    super.dispose(), this.onLoadObservable.clear(), this._delayedOnLoad = null, this._delayedOnError = null, this._buffer = null;
  }
  /**
   * Parse the JSON representation of a texture in order to recreate the texture in the given scene.
   * @param parsedTexture Define the JSON representation of the texture
   * @param scene Define the scene the parsed texture should be instantiated in
   * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies
   * @returns The parsed texture if successful
   */
  static Parse(e, t, r) {
    if (e.customType) {
      const o = jI.Instantiate(e.customType).Parse(e, t, r);
      return e.samplingMode && o.updateSamplingMode && o._samplingMode && o._samplingMode !== e.samplingMode && o.updateSamplingMode(e.samplingMode), o;
    }
    if (e.isCube && !e.isRenderTarget)
      return We._CubeTextureParser(e, t, r);
    const n = e.internalTextureUniqueId !== void 0;
    if (!e.name && !e.isRenderTarget && !n)
      return null;
    let i;
    if (n) {
      const f = t.getEngine().getLoadedTexturesCache();
      for (const o of f)
        if (o.uniqueId === e.internalTextureUniqueId) {
          i = o;
          break;
        }
    }
    const s = (f) => {
      var o;
      if (f && f._texture && (f._texture._cachedWrapU = null, f._texture._cachedWrapV = null, f._texture._cachedWrapR = null), e.samplingMode) {
        const d = e.samplingMode;
        f && f.samplingMode !== d && f.updateSamplingMode(d);
      }
      if (f && e.animations)
        for (let d = 0; d < e.animations.length; d++) {
          const v = e.animations[d], u = Jo("BABYLON.Animation");
          u && f.animations.push(u.Parse(v));
        }
      n && !i && ((o = f == null ? void 0 : f._texture) === null || o === void 0 || o._setUniqueId(e.internalTextureUniqueId));
    };
    return jt.Parse(() => {
      var f, o, d;
      let v = !0;
      if (e.noMipmap && (v = !1), e.mirrorPlane) {
        const u = We._CreateMirror(e.name, e.renderTargetSize, t, v);
        return u._waitingRenderList = e.renderList, u.mirrorPlane = BA.FromArray(e.mirrorPlane), s(u), u;
      } else if (e.isRenderTarget) {
        let u = null;
        if (e.isCube) {
          if (t.reflectionProbes)
            for (let l = 0; l < t.reflectionProbes.length; l++) {
              const P = t.reflectionProbes[l];
              if (P.name === e.name)
                return P.cubeTexture;
            }
        } else
          u = We._CreateRenderTargetTexture(e.name, e.renderTargetSize, t, v, (f = e._creationFlags) !== null && f !== void 0 ? f : 0), u._waitingRenderList = e.renderList;
        return s(u), u;
      } else if (e.isVideo) {
        const u = We._CreateVideoTexture(r + (e.url || e.name), r + (e.src || e.url), t, v, e.invertY, e.samplingMode, e.settings || {});
        return s(u), u;
      } else {
        let u;
        if (e.base64String && !i)
          u = We.CreateFromBase64String(e.base64String, e.base64String, t, !v, e.invertY, e.samplingMode, () => {
            s(u);
          }, (o = e._creationFlags) !== null && o !== void 0 ? o : 0, (d = e._useSRGBBuffer) !== null && d !== void 0 ? d : !1), u.name = e.name;
        else {
          let l;
          e.name && (e.name.indexOf("://") > 0 || e.name.startsWith("data:")) ? l = e.name : l = r + e.name, e.url && (e.url.startsWith("data:") || We.UseSerializedUrlIfAny) && (l = e.url);
          const P = {
            noMipmap: !v,
            invertY: e.invertY,
            samplingMode: e.samplingMode,
            onLoad: () => {
              s(u);
            },
            internalTexture: i
          };
          u = new We(l, t, P);
        }
        return u;
      }
    }, e, t);
  }
  /**
   * Creates a texture from its base 64 representation.
   * @param data Define the base64 payload without the data: prefix
   * @param name Define the name of the texture in the scene useful fo caching purpose for instance
   * @param scene Define the scene the texture should belong to
   * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
   * @param invertY define if the texture needs to be inverted on the y axis during loading
   * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
   * @param onLoad define a callback triggered when the texture has been loaded
   * @param onError define a callback triggered when an error occurred during the loading session
   * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @returns the created texture
   */
  static CreateFromBase64String(e, t, r, n, i, s = We.TRILINEAR_SAMPLINGMODE, a = null, f = null, o = 5, d) {
    return new We("data:" + t, r, n, i, s, a, f, e, !1, o, void 0, void 0, d);
  }
  /**
   * Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in)
   * @param name Define the name of the texture in the scene useful fo caching purpose for instance
   * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation
   * @param scene Define the scene the texture should belong to
   * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load
   * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
   * @param invertY define if the texture needs to be inverted on the y axis during loading
   * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
   * @param onLoad define a callback triggered when the texture has been loaded
   * @param onError define a callback triggered when an error occurred during the loading session
   * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @returns the created texture
   */
  static LoadFromDataString(e, t, r, n = !1, i, s = !0, a = We.TRILINEAR_SAMPLINGMODE, f = null, o = null, d = 5, v) {
    return e.substr(0, 5) !== "data:" && (e = "data:" + e), new We(e, r, i, s, a, f, o, t, n, d, void 0, void 0, v);
  }
}
We.SerializeBuffers = !0;
We.ForceSerializeBuffers = !1;
We.OnTextureLoadErrorObservable = new Oe();
We._SerializeInternalTextureUniqueId = !1;
We._CubeTextureParser = (A, e, t) => {
  throw qn("CubeTexture");
};
We._CreateMirror = (A, e, t, r) => {
  throw qn("MirrorTexture");
};
We._CreateRenderTargetTexture = (A, e, t, r, n) => {
  throw qn("RenderTargetTexture");
};
We.NEAREST_SAMPLINGMODE = 1;
We.NEAREST_NEAREST_MIPLINEAR = 8;
We.BILINEAR_SAMPLINGMODE = 2;
We.LINEAR_LINEAR_MIPNEAREST = 11;
We.TRILINEAR_SAMPLINGMODE = 3;
We.LINEAR_LINEAR_MIPLINEAR = 3;
We.NEAREST_NEAREST_MIPNEAREST = 4;
We.NEAREST_LINEAR_MIPNEAREST = 5;
We.NEAREST_LINEAR_MIPLINEAR = 6;
We.NEAREST_LINEAR = 7;
We.NEAREST_NEAREST = 1;
We.LINEAR_NEAREST_MIPNEAREST = 9;
We.LINEAR_NEAREST_MIPLINEAR = 10;
We.LINEAR_LINEAR = 2;
We.LINEAR_NEAREST = 12;
We.EXPLICIT_MODE = 0;
We.SPHERICAL_MODE = 1;
We.PLANAR_MODE = 2;
We.CUBIC_MODE = 3;
We.PROJECTION_MODE = 4;
We.SKYBOX_MODE = 5;
We.INVCUBIC_MODE = 6;
We.EQUIRECTANGULAR_MODE = 7;
We.FIXED_EQUIRECTANGULAR_MODE = 8;
We.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
We.CLAMP_ADDRESSMODE = 0;
We.WRAP_ADDRESSMODE = 1;
We.MIRROR_ADDRESSMODE = 2;
We.UseSerializedUrlIfAny = !1;
C([
  M()
], We.prototype, "url", void 0);
C([
  M()
], We.prototype, "uOffset", void 0);
C([
  M()
], We.prototype, "vOffset", void 0);
C([
  M()
], We.prototype, "uScale", void 0);
C([
  M()
], We.prototype, "vScale", void 0);
C([
  M()
], We.prototype, "uAng", void 0);
C([
  M()
], We.prototype, "vAng", void 0);
C([
  M()
], We.prototype, "wAng", void 0);
C([
  M()
], We.prototype, "uRotationCenter", void 0);
C([
  M()
], We.prototype, "vRotationCenter", void 0);
C([
  M()
], We.prototype, "wRotationCenter", void 0);
C([
  M()
], We.prototype, "homogeneousRotationInUVTransform", void 0);
C([
  M()
], We.prototype, "isBlocking", null);
Ue("BABYLON.Texture", We);
jt._TextureParser = We.Parse;
hr.prototype.updateRawTexture = function(A, e, t, r, n = null, i = 0, s = !1) {
  if (!A)
    return;
  const a = this._getRGBABufferInternalSizedFormat(i, t, s), f = this._getInternalFormat(t), o = this._getWebGLTextureType(i);
  this._bindTextureDirectly(this._gl.TEXTURE_2D, A, !0), this._unpackFlipY(r === void 0 ? !0 : !!r), this._doNotHandleContextLost || (A._bufferView = e, A.format = t, A.type = i, A.invertY = r, A._compression = n), A.width % 4 !== 0 && this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1), n && e ? this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[n], A.width, A.height, 0, e) : this._gl.texImage2D(this._gl.TEXTURE_2D, 0, a, A.width, A.height, 0, f, o, e), A.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), A.isReady = !0;
};
hr.prototype.createRawTexture = function(A, e, t, r, n, i, s, a = null, f = 0, o = 0, d = !1) {
  const v = new As(this, ri.Raw);
  v.baseWidth = e, v.baseHeight = t, v.width = e, v.height = t, v.format = r, v.generateMipMaps = n, v.samplingMode = s, v.invertY = i, v._compression = a, v.type = f, v._useSRGBBuffer = this._getUseSRGBBuffer(d, !n), this._doNotHandleContextLost || (v._bufferView = A), this.updateRawTexture(v, A, r, i, a, f, v._useSRGBBuffer), this._bindTextureDirectly(this._gl.TEXTURE_2D, v, !0);
  const u = this._getSamplingParameters(s, n);
  return this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, u.mag), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, u.min), n && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._internalTexturesCache.push(v), v;
};
hr.prototype.createRawCubeTexture = function(A, e, t, r, n, i, s, a = null) {
  const f = this._gl, o = new As(this, ri.CubeRaw);
  o.isCube = !0, o.format = t, o.type = r, this._doNotHandleContextLost || (o._bufferViewArray = A);
  const d = this._getWebGLTextureType(r);
  let v = this._getInternalFormat(t);
  v === f.RGB && (v = f.RGBA), d === f.FLOAT && !this._caps.textureFloatLinearFiltering ? (n = !1, s = 1, Se.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")) : d === this._gl.HALF_FLOAT_OES && !this._caps.textureHalfFloatLinearFiltering ? (n = !1, s = 1, Se.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")) : d === f.FLOAT && !this._caps.textureFloatRender ? (n = !1, Se.Warn("Render to float textures is not supported. Mipmap generation forced to false.")) : d === f.HALF_FLOAT && !this._caps.colorBufferFloat && (n = !1, Se.Warn("Render to half float textures is not supported. Mipmap generation forced to false."));
  const u = e, l = u;
  if (o.width = u, o.height = l, o.invertY = i, o._compression = a, !this.needPOTTextures || ye.IsExponentOfTwo(o.width) && ye.IsExponentOfTwo(o.height) || (n = !1), A)
    this.updateRawCubeTexture(o, A, t, r, i, a);
  else {
    const c = this._getRGBABufferInternalSizedFormat(r), H = 0;
    this._bindTextureDirectly(f.TEXTURE_CUBE_MAP, o, !0);
    for (let T = 0; T < 6; T++)
      a ? f.compressedTexImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X + T, H, this.getCaps().s3tc[a], o.width, o.height, 0, void 0) : f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X + T, H, c, o.width, o.height, 0, v, d, null);
    this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
  }
  this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, o, !0), A && n && this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);
  const p = this._getSamplingParameters(s, n);
  return f.texParameteri(f.TEXTURE_CUBE_MAP, f.TEXTURE_MAG_FILTER, p.mag), f.texParameteri(f.TEXTURE_CUBE_MAP, f.TEXTURE_MIN_FILTER, p.min), f.texParameteri(f.TEXTURE_CUBE_MAP, f.TEXTURE_WRAP_S, f.CLAMP_TO_EDGE), f.texParameteri(f.TEXTURE_CUBE_MAP, f.TEXTURE_WRAP_T, f.CLAMP_TO_EDGE), this._bindTextureDirectly(f.TEXTURE_CUBE_MAP, null), o.generateMipMaps = n, o.samplingMode = s, o.isReady = !0, o;
};
hr.prototype.updateRawCubeTexture = function(A, e, t, r, n, i = null, s = 0) {
  A._bufferViewArray = e, A.format = t, A.type = r, A.invertY = n, A._compression = i;
  const a = this._gl, f = this._getWebGLTextureType(r);
  let o = this._getInternalFormat(t);
  const d = this._getRGBABufferInternalSizedFormat(r);
  let v = !1;
  o === a.RGB && (o = a.RGBA, v = !0), this._bindTextureDirectly(a.TEXTURE_CUBE_MAP, A, !0), this._unpackFlipY(n === void 0 ? !0 : !!n), A.width % 4 !== 0 && a.pixelStorei(a.UNPACK_ALIGNMENT, 1);
  for (let l = 0; l < 6; l++) {
    let P = e[l];
    i ? a.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X + l, s, this.getCaps().s3tc[i], A.width, A.height, 0, P) : (v && (P = Pee(P, A.width, A.height, r)), a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X + l, s, d, A.width, A.height, 0, o, f, P));
  }
  (!this.needPOTTextures || ye.IsExponentOfTwo(A.width) && ye.IsExponentOfTwo(A.height)) && A.generateMipMaps && s === 0 && this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), A.isReady = !0;
};
hr.prototype.createRawCubeTextureFromUrl = function(A, e, t, r, n, i, s, a, f = null, o = null, d = 3, v = !1) {
  const u = this._gl, l = this.createRawCubeTexture(null, t, r, n, !i, v, d, null);
  e == null || e.addPendingData(l), l.url = A, l.isReady = !1, this._internalTexturesCache.push(l);
  const P = (c, H) => {
    e == null || e.removePendingData(l), o && c && o(c.status + " " + c.statusText, H);
  }, p = (c) => {
    const H = l.width, T = s(c);
    if (T) {
      if (a) {
        const q = this._getWebGLTextureType(n);
        let b = this._getInternalFormat(r);
        const j = this._getRGBABufferInternalSizedFormat(n);
        let w = !1;
        b === u.RGB && (b = u.RGBA, w = !0), this._bindTextureDirectly(u.TEXTURE_CUBE_MAP, l, !0), this._unpackFlipY(!1);
        const m = a(T);
        for (let I = 0; I < m.length; I++) {
          const N = H >> I;
          for (let k = 0; k < 6; k++) {
            let R = m[I][k];
            w && (R = Pee(R, N, N, n)), u.texImage2D(k, I, j, N, N, 0, b, q, R);
          }
        }
        this._bindTextureDirectly(u.TEXTURE_CUBE_MAP, null);
      } else
        this.updateRawCubeTexture(l, T, r, n, v);
      l.isReady = !0, e == null || e.removePendingData(l), l.onLoadedObservable.notifyObservers(l), l.onLoadedObservable.clear(), f && f();
    }
  };
  return this._loadFile(A, (c) => {
    p(c);
  }, void 0, e == null ? void 0 : e.offlineProvider, !0, P), l;
};
function Pee(A, e, t, r) {
  let n, i = 1;
  r === 1 ? n = new Float32Array(e * t * 4) : r === 2 ? (n = new Uint16Array(e * t * 4), i = 15360) : r === 7 ? n = new Uint32Array(e * t * 4) : n = new Uint8Array(e * t * 4);
  for (let s = 0; s < e; s++)
    for (let a = 0; a < t; a++) {
      const f = (a * e + s) * 3, o = (a * e + s) * 4;
      n[o + 0] = A[f + 0], n[o + 1] = A[f + 1], n[o + 2] = A[f + 2], n[o + 3] = i;
    }
  return n;
}
function cee(A) {
  return function(e, t, r, n, i, s, a, f, o = null, d = 0) {
    const v = A ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY, u = A ? ri.Raw3D : ri.Raw2DArray, l = new As(this, u);
    l.baseWidth = t, l.baseHeight = r, l.baseDepth = n, l.width = t, l.height = r, l.depth = n, l.format = i, l.type = d, l.generateMipMaps = s, l.samplingMode = f, A ? l.is3D = !0 : l.is2DArray = !0, this._doNotHandleContextLost || (l._bufferView = e), A ? this.updateRawTexture3D(l, e, i, a, o, d) : this.updateRawTexture2DArray(l, e, i, a, o, d), this._bindTextureDirectly(v, l, !0);
    const P = this._getSamplingParameters(f, s);
    return this._gl.texParameteri(v, this._gl.TEXTURE_MAG_FILTER, P.mag), this._gl.texParameteri(v, this._gl.TEXTURE_MIN_FILTER, P.min), s && this._gl.generateMipmap(v), this._bindTextureDirectly(v, null), this._internalTexturesCache.push(l), l;
  };
}
hr.prototype.createRawTexture2DArray = cee(!1);
hr.prototype.createRawTexture3D = cee(!0);
function pee(A) {
  return function(e, t, r, n, i = null, s = 0) {
    const a = A ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY, f = this._getWebGLTextureType(s), o = this._getInternalFormat(r), d = this._getRGBABufferInternalSizedFormat(s, r);
    this._bindTextureDirectly(a, e, !0), this._unpackFlipY(n === void 0 ? !0 : !!n), this._doNotHandleContextLost || (e._bufferView = t, e.format = r, e.invertY = n, e._compression = i), e.width % 4 !== 0 && this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1), i && t ? this._gl.compressedTexImage3D(a, 0, this.getCaps().s3tc[i], e.width, e.height, e.depth, 0, t) : this._gl.texImage3D(a, 0, d, e.width, e.height, e.depth, 0, o, f, t), e.generateMipMaps && this._gl.generateMipmap(a), this._bindTextureDirectly(a, null), e.isReady = !0;
  };
}
hr.prototype.updateRawTexture2DArray = pee(!1);
hr.prototype.updateRawTexture3D = pee(!0);
class Bo extends We {
  /**
   * Instantiates a new RawTexture.
   * Raw texture can help creating a texture directly from an array of data.
   * This can be super useful if you either get the data from an uncompressed source or
   * if you wish to create your texture pixel by pixel.
   * @param data define the array of data to use to create the texture (null to create an empty texture)
   * @param width define the width of the texture
   * @param height define the height of the texture
   * @param format define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)
   * @param sceneOrEngine defines the scene or engine the texture will belong to
   * @param generateMipMaps define whether mip maps should be generated or not
   * @param invertY define if the data should be flipped on Y when uploaded to the GPU
   * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
   * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   */
  constructor(e, t, r, n, i, s = !0, a = !1, f = 3, o = 0, d, v) {
    super(null, i, !s, a, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, d), this.format = n, this._engine && (!this._engine._caps.textureFloatLinearFiltering && o === 1 && (f = 1), !this._engine._caps.textureHalfFloatLinearFiltering && o === 2 && (f = 1), this._texture = this._engine.createRawTexture(e, t, r, n, s, a, f, null, o, d ?? 0, v ?? !1), this.wrapU = We.CLAMP_ADDRESSMODE, this.wrapV = We.CLAMP_ADDRESSMODE);
  }
  /**
   * Updates the texture underlying data.
   * @param data Define the new data of the texture
   */
  update(e) {
    this._getEngine().updateRawTexture(this._texture, e, this._texture.format, this._texture.invertY, null, this._texture.type, this._texture._useSRGBBuffer);
  }
  /**
   * Creates a luminance texture from some data.
   * @param data Define the texture data
   * @param width Define the width of the texture
   * @param height Define the height of the texture
   * @param sceneOrEngine defines the scene or engine the texture will belong to
   * @param generateMipMaps Define whether or not to create mip maps for the texture
   * @param invertY define if the data should be flipped on Y when uploaded to the GPU
   * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
   * @returns the luminance texture
   */
  static CreateLuminanceTexture(e, t, r, n, i = !0, s = !1, a = 3) {
    return new Bo(e, t, r, 1, n, i, s, a);
  }
  /**
   * Creates a luminance alpha texture from some data.
   * @param data Define the texture data
   * @param width Define the width of the texture
   * @param height Define the height of the texture
   * @param sceneOrEngine defines the scene or engine the texture will belong to
   * @param generateMipMaps Define whether or not to create mip maps for the texture
   * @param invertY define if the data should be flipped on Y when uploaded to the GPU
   * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
   * @returns the luminance alpha texture
   */
  static CreateLuminanceAlphaTexture(e, t, r, n, i = !0, s = !1, a = 3) {
    return new Bo(e, t, r, 2, n, i, s, a);
  }
  /**
   * Creates an alpha texture from some data.
   * @param data Define the texture data
   * @param width Define the width of the texture
   * @param height Define the height of the texture
   * @param sceneOrEngine defines the scene or engine the texture will belong to
   * @param generateMipMaps Define whether or not to create mip maps for the texture
   * @param invertY define if the data should be flipped on Y when uploaded to the GPU
   * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
   * @returns the alpha texture
   */
  static CreateAlphaTexture(e, t, r, n, i = !0, s = !1, a = 3) {
    return new Bo(e, t, r, 0, n, i, s, a);
  }
  /**
   * Creates a RGB texture from some data.
   * @param data Define the texture data
   * @param width Define the width of the texture
   * @param height Define the height of the texture
   * @param sceneOrEngine defines the scene or engine the texture will belong to
   * @param generateMipMaps Define whether or not to create mip maps for the texture
   * @param invertY define if the data should be flipped on Y when uploaded to the GPU
   * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
   * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   * @returns the RGB alpha texture
   */
  static CreateRGBTexture(e, t, r, n, i = !0, s = !1, a = 3, f = 0, o = 0, d = !1) {
    return new Bo(e, t, r, 4, n, i, s, a, f, o, d);
  }
  /**
   * Creates a RGBA texture from some data.
   * @param data Define the texture data
   * @param width Define the width of the texture
   * @param height Define the height of the texture
   * @param sceneOrEngine defines the scene or engine the texture will belong to
   * @param generateMipMaps Define whether or not to create mip maps for the texture
   * @param invertY define if the data should be flipped on Y when uploaded to the GPU
   * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
   * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   * @returns the RGBA texture
   */
  static CreateRGBATexture(e, t, r, n, i = !0, s = !1, a = 3, f = 0, o = 0, d = !1) {
    return new Bo(e, t, r, 5, n, i, s, a, f, o, d);
  }
  /**
   * Creates a RGBA storage texture from some data.
   * @param data Define the texture data
   * @param width Define the width of the texture
   * @param height Define the height of the texture
   * @param sceneOrEngine defines the scene or engine the texture will belong to
   * @param generateMipMaps Define whether or not to create mip maps for the texture
   * @param invertY define if the data should be flipped on Y when uploaded to the GPU
   * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
   * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   * @returns the RGBA texture
   */
  static CreateRGBAStorageTexture(e, t, r, n, i = !0, s = !1, a = 3, f = 0, o = !1) {
    return new Bo(e, t, r, 5, n, i, s, a, f, 1, o);
  }
  /**
   * Creates a R texture from some data.
   * @param data Define the texture data
   * @param width Define the width of the texture
   * @param height Define the height of the texture
   * @param sceneOrEngine defines the scene or engine the texture will belong to
   * @param generateMipMaps Define whether or not to create mip maps for the texture
   * @param invertY define if the data should be flipped on Y when uploaded to the GPU
   * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
   * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
   * @returns the R texture
   */
  static CreateRTexture(e, t, r, n, i = !0, s = !1, a = We.TRILINEAR_SAMPLINGMODE, f = 1) {
    return new Bo(e, t, r, 6, n, i, s, a, f);
  }
  /**
   * Creates a R storage texture from some data.
   * @param data Define the texture data
   * @param width Define the width of the texture
   * @param height Define the height of the texture
   * @param sceneOrEngine defines the scene or engine the texture will belong to
   * @param generateMipMaps Define whether or not to create mip maps for the texture
   * @param invertY define if the data should be flipped on Y when uploaded to the GPU
   * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
   * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
   * @returns the R texture
   */
  static CreateRStorageTexture(e, t, r, n, i = !0, s = !1, a = We.TRILINEAR_SAMPLINGMODE, f = 1) {
    return new Bo(e, t, r, 6, n, i, s, a, f, 1);
  }
}
class X6e {
  /**
   * Create a new VertexAnimationBaker object which can help baking animations into a texture.
   * @param scene Defines the scene the VAT belongs to
   * @param mesh Defines the mesh the VAT belongs to
   */
  constructor(e, t) {
    this._scene = e, this._mesh = t;
  }
  /**
   * Bakes the animation into the texture. This should be called once, when the
   * scene starts, so the VAT is generated and associated to the mesh.
   * @param ranges Defines the ranges in the animation that will be baked.
   * @returns The array of matrix transforms for each vertex (columns) and frame (rows), as a Float32Array.
   */
  async bakeVertexData(e) {
    if (!this._mesh.skeleton)
      throw new Error("No skeleton in this mesh.");
    const t = this._mesh.skeleton.bones.length, r = e.reduce((a, f) => a + f.to - f.from + 1, 0);
    if (isNaN(r))
      throw new Error("Invalid animation ranges.");
    let n = 0;
    const i = (t + 1) * 4 * 4 * r, s = new Float32Array(i);
    this._scene.stopAnimation(this._mesh), this._mesh.skeleton.returnToRest();
    for (const a of e)
      for (let f = a.from; f <= a.to; f++)
        await this._executeAnimationFrame(s, f, n++);
    return s;
  }
  /**
   * Runs an animation frame and stores its vertex data
   *
   * @param vertexData The array to save data to.
   * @param frameIndex Current frame in the skeleton animation to render.
   * @param textureIndex Current index of the texture data.
   */
  async _executeAnimationFrame(e, t, r) {
    return new Promise((n, i) => {
      this._scene.beginAnimation(this._mesh.skeleton, t, t, !1, 1, () => {
        const s = this._mesh.skeleton.getTransformMatrices(this._mesh);
        e.set(s, r * s.length), n();
      });
    });
  }
  /**
   * Builds a vertex animation texture given the vertexData in an array.
   * @param vertexData The vertex animation data. You can generate it with bakeVertexData().
   * @returns The vertex animation texture to be used with BakedVertexAnimationManager.
   */
  textureFromBakedVertexData(e) {
    if (!this._mesh.skeleton)
      throw new Error("No skeleton in this mesh.");
    const t = this._mesh.skeleton.bones.length, r = Bo.CreateRGBATexture(e, (t + 1) * 4, e.length / ((t + 1) * 4 * 4), this._scene, !1, !1, We.NEAREST_NEAREST, 1);
    return r.name = "VAT" + this._mesh.skeleton.name, r;
  }
  /**
   * Serializes our vertexData to an object, with a nice string for the vertexData.
   * @param vertexData The vertex array data.
   * @returns This object serialized to a JS dict.
   */
  serializeBakedVertexDataToObject(e) {
    if (!this._mesh.skeleton)
      throw new Error("No skeleton in this mesh.");
    const t = this._mesh.skeleton.bones.length, r = (t + 1) * 4, n = e.length / ((t + 1) * 4 * 4);
    return {
      vertexData: XR(e),
      width: r,
      height: n
    };
  }
  /**
   * Loads previously baked data.
   * @param data The object as serialized by serializeBakedVertexDataToObject()
   * @returns The array of matrix transforms for each vertex (columns) and frame (rows), as a Float32Array.
   */
  loadBakedVertexDataFromObject(e) {
    return new Float32Array(TR(e.vertexData));
  }
  /**
   * Serializes our vertexData to a JSON string, with a nice string for the vertexData.
   * Should be called right after bakeVertexData().
   * @param vertexData The vertex array data.
   * @returns This object serialized to a safe string.
   */
  serializeBakedVertexDataToJSON(e) {
    return JSON.stringify(this.serializeBakedVertexDataToObject(e));
  }
  /**
   * Loads previously baked data in string format.
   * @param json The json string as serialized by serializeBakedVertexDataToJSON().
   * @returns The array of matrix transforms for each vertex (columns) and frame (rows), as a Float32Array.
   */
  loadBakedVertexDataFromJSON(e) {
    return this.loadBakedVertexDataFromObject(JSON.parse(e));
  }
}
class hee {
  constructor() {
    this._zoomStopsAnimation = !1, this._idleRotationSpeed = 0.05, this._idleRotationWaitTime = 2e3, this._idleRotationSpinupTime = 2e3, this.targetAlpha = null, this._isPointerDown = !1, this._lastFrameTime = null, this._lastInteractionTime = -1 / 0, this._cameraRotationSpeed = 0, this._lastFrameRadius = 0;
  }
  /**
   * Gets the name of the behavior.
   */
  get name() {
    return "AutoRotation";
  }
  /**
   * Sets the flag that indicates if user zooming should stop animation.
   */
  set zoomStopsAnimation(e) {
    this._zoomStopsAnimation = e;
  }
  /**
   * Gets the flag that indicates if user zooming should stop animation.
   */
  get zoomStopsAnimation() {
    return this._zoomStopsAnimation;
  }
  /**
   * Sets the default speed at which the camera rotates around the model.
   */
  set idleRotationSpeed(e) {
    this._idleRotationSpeed = e;
  }
  /**
   * Gets the default speed at which the camera rotates around the model.
   */
  get idleRotationSpeed() {
    return this._idleRotationSpeed;
  }
  /**
   * Sets the time (in milliseconds) to wait after user interaction before the camera starts rotating.
   */
  set idleRotationWaitTime(e) {
    this._idleRotationWaitTime = e;
  }
  /**
   * Gets the time (milliseconds) to wait after user interaction before the camera starts rotating.
   */
  get idleRotationWaitTime() {
    return this._idleRotationWaitTime;
  }
  /**
   * Sets the time (milliseconds) to take to spin up to the full idle rotation speed.
   */
  set idleRotationSpinupTime(e) {
    this._idleRotationSpinupTime = e;
  }
  /**
   * Gets the time (milliseconds) to take to spin up to the full idle rotation speed.
   */
  get idleRotationSpinupTime() {
    return this._idleRotationSpinupTime;
  }
  /**
   * Gets a value indicating if the camera is currently rotating because of this behavior
   */
  get rotationInProgress() {
    return Math.abs(this._cameraRotationSpeed) > 0;
  }
  /**
   * Initializes the behavior.
   */
  init() {
  }
  /**
   * Attaches the behavior to its arc rotate camera.
   * @param camera Defines the camera to attach the behavior to
   */
  attach(e) {
    this._attachedCamera = e;
    const t = this._attachedCamera.getScene();
    this._onPrePointerObservableObserver = t.onPrePointerObservable.add((r) => {
      if (r.type === ir.POINTERDOWN) {
        this._isPointerDown = !0;
        return;
      }
      r.type === ir.POINTERUP && (this._isPointerDown = !1);
    }), this._onAfterCheckInputsObserver = e.onAfterCheckInputsObservable.add(() => {
      if (this._reachTargetAlpha())
        return;
      const r = Yi.Now;
      let n = 0;
      this._lastFrameTime != null && (n = r - this._lastFrameTime), this._lastFrameTime = r, this._applyUserInteraction();
      const i = r - this._lastInteractionTime - this._idleRotationWaitTime, s = Math.max(Math.min(i / this._idleRotationSpinupTime, 1), 0);
      this._cameraRotationSpeed = this._idleRotationSpeed * s, this._attachedCamera && (this._attachedCamera.alpha -= this._cameraRotationSpeed * (n / 1e3));
    });
  }
  /**
   * Detaches the behavior from its current arc rotate camera.
   */
  detach() {
    if (!this._attachedCamera)
      return;
    const e = this._attachedCamera.getScene();
    this._onPrePointerObservableObserver && e.onPrePointerObservable.remove(this._onPrePointerObservableObserver), this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._attachedCamera = null;
  }
  /**
   * Force-reset the last interaction time
   * @param customTime an optional time that will be used instead of the current last interaction time. For example `Date.now()`
   */
  resetLastInteractionTime(e) {
    this._lastInteractionTime = e ?? Yi.Now;
  }
  /**
   * Returns true if camera alpha reaches the target alpha
   * @returns true if camera alpha reaches the target alpha
   */
  _reachTargetAlpha() {
    return this._attachedCamera && this.targetAlpha ? Math.abs(this._attachedCamera.alpha - this.targetAlpha) < Dn : !1;
  }
  /**
   * Returns true if user is scrolling.
   * @returns true if user is scrolling.
   */
  _userIsZooming() {
    return this._attachedCamera ? this._attachedCamera.inertialRadiusOffset !== 0 : !1;
  }
  _shouldAnimationStopForInteraction() {
    if (!this._attachedCamera)
      return !1;
    let e = !1;
    return this._lastFrameRadius === this._attachedCamera.radius && this._attachedCamera.inertialRadiusOffset !== 0 && (e = !0), this._lastFrameRadius = this._attachedCamera.radius, this._zoomStopsAnimation ? e : this._userIsZooming();
  }
  /**
   *  Applies any current user interaction to the camera. Takes into account maximum alpha rotation.
   */
  _applyUserInteraction() {
    this._userIsMoving() && !this._shouldAnimationStopForInteraction() && (this._lastInteractionTime = Yi.Now);
  }
  // Tools
  _userIsMoving() {
    return this._attachedCamera ? this._attachedCamera.inertialAlphaOffset !== 0 || this._attachedCamera.inertialBetaOffset !== 0 || this._attachedCamera.inertialRadiusOffset !== 0 || this._attachedCamera.inertialPanningX !== 0 || this._attachedCamera.inertialPanningY !== 0 || this._isPointerDown : !1;
  }
}
class fD {
  constructor() {
    this.transitionDuration = 450, this.lowerRadiusTransitionRange = 2, this.upperRadiusTransitionRange = -2, this._autoTransitionRange = !1, this._radiusIsAnimating = !1, this._radiusBounceTransition = null, this._animatables = new Array();
  }
  /**
   * Gets the name of the behavior.
   */
  get name() {
    return "Bouncing";
  }
  /**
   * Gets a value indicating if the lowerRadiusTransitionRange and upperRadiusTransitionRange are defined automatically
   */
  get autoTransitionRange() {
    return this._autoTransitionRange;
  }
  /**
   * Sets a value indicating if the lowerRadiusTransitionRange and upperRadiusTransitionRange are defined automatically
   * Transition ranges will be set to 5% of the bounding box diagonal in world space
   */
  set autoTransitionRange(e) {
    if (this._autoTransitionRange === e)
      return;
    this._autoTransitionRange = e;
    const t = this._attachedCamera;
    t && (e ? this._onMeshTargetChangedObserver = t.onMeshTargetChangedObservable.add((r) => {
      if (!r)
        return;
      r.computeWorldMatrix(!0);
      const n = r.getBoundingInfo().diagonalLength;
      this.lowerRadiusTransitionRange = n * 0.05, this.upperRadiusTransitionRange = n * 0.05;
    }) : this._onMeshTargetChangedObserver && t.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver));
  }
  /**
   * Initializes the behavior.
   */
  init() {
  }
  /**
   * Attaches the behavior to its arc rotate camera.
   * @param camera Defines the camera to attach the behavior to
   */
  attach(e) {
    this._attachedCamera = e, this._onAfterCheckInputsObserver = e.onAfterCheckInputsObservable.add(() => {
      this._attachedCamera && (this._isRadiusAtLimit(this._attachedCamera.lowerRadiusLimit) && this._applyBoundRadiusAnimation(this.lowerRadiusTransitionRange), this._isRadiusAtLimit(this._attachedCamera.upperRadiusLimit) && this._applyBoundRadiusAnimation(this.upperRadiusTransitionRange));
    });
  }
  /**
   * Detaches the behavior from its current arc rotate camera.
   */
  detach() {
    this._attachedCamera && (this._onAfterCheckInputsObserver && this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._onMeshTargetChangedObserver && this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver), this._attachedCamera = null);
  }
  /**
   * Checks if the camera radius is at the specified limit. Takes into account animation locks.
   * @param radiusLimit The limit to check against.
   * @returns Bool to indicate if at limit.
   */
  _isRadiusAtLimit(e) {
    return this._attachedCamera ? this._attachedCamera.radius === e && !this._radiusIsAnimating : !1;
  }
  /**
   * Applies an animation to the radius of the camera, extending by the radiusDelta.
   * @param radiusDelta The delta by which to animate to. Can be negative.
   */
  _applyBoundRadiusAnimation(e) {
    if (!this._attachedCamera)
      return;
    this._radiusBounceTransition || (fD.EasingFunction.setEasingMode(fD.EasingMode), this._radiusBounceTransition = st.CreateAnimation("radius", st.ANIMATIONTYPE_FLOAT, 60, fD.EasingFunction)), this._cachedWheelPrecision = this._attachedCamera.wheelPrecision, this._attachedCamera.wheelPrecision = 1 / 0, this._attachedCamera.inertialRadiusOffset = 0, this.stopAllAnimations(), this._radiusIsAnimating = !0;
    const t = st.TransitionTo("radius", this._attachedCamera.radius + e, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusBounceTransition, this.transitionDuration, () => this._clearAnimationLocks());
    t && this._animatables.push(t);
  }
  /**
   * Removes all animation locks. Allows new animations to be added to any of the camera properties.
   */
  _clearAnimationLocks() {
    this._radiusIsAnimating = !1, this._attachedCamera && (this._attachedCamera.wheelPrecision = this._cachedWheelPrecision);
  }
  /**
   * Stops and removes all animations that have been applied to the camera
   */
  stopAllAnimations() {
    for (this._attachedCamera && (this._attachedCamera.animations = []); this._animatables.length; )
      this._animatables[0].onAnimationEnd = null, this._animatables[0].stop(), this._animatables.shift();
  }
}
fD.EasingFunction = new _$(0.3);
fD.EasingMode = u1.EASINGMODE_EASEOUT;
class Vu {
  constructor() {
    this.onTargetFramingAnimationEndObservable = new Oe(), this._mode = Vu.FitFrustumSidesMode, this._radiusScale = 1, this._positionScale = 0.5, this._defaultElevation = 0.3, this._elevationReturnTime = 1500, this._elevationReturnWaitTime = 1e3, this._zoomStopsAnimation = !1, this._framingTime = 1500, this.autoCorrectCameraLimitsAndSensibility = !0, this._isPointerDown = !1, this._lastInteractionTime = -1 / 0, this._animatables = new Array(), this._betaIsAnimating = !1;
  }
  /**
   * Gets the name of the behavior.
   */
  get name() {
    return "Framing";
  }
  /**
   * Sets the current mode used by the behavior
   */
  set mode(e) {
    this._mode = e;
  }
  /**
   * Gets current mode used by the behavior.
   */
  get mode() {
    return this._mode;
  }
  /**
   * Sets the scale applied to the radius (1 by default)
   */
  set radiusScale(e) {
    this._radiusScale = e;
  }
  /**
   * Gets the scale applied to the radius
   */
  get radiusScale() {
    return this._radiusScale;
  }
  /**
   * Sets the scale to apply on Y axis to position camera focus. 0.5 by default which means the center of the bounding box.
   */
  set positionScale(e) {
    this._positionScale = e;
  }
  /**
   * Gets the scale to apply on Y axis to position camera focus. 0.5 by default which means the center of the bounding box.
   */
  get positionScale() {
    return this._positionScale;
  }
  /**
   * Sets the angle above/below the horizontal plane to return to when the return to default elevation idle
   * behaviour is triggered, in radians.
   */
  set defaultElevation(e) {
    this._defaultElevation = e;
  }
  /**
   * Gets the angle above/below the horizontal plane to return to when the return to default elevation idle
   * behaviour is triggered, in radians.
   */
  get defaultElevation() {
    return this._defaultElevation;
  }
  /**
   * Sets the time (in milliseconds) taken to return to the default beta position.
   * Negative value indicates camera should not return to default.
   */
  set elevationReturnTime(e) {
    this._elevationReturnTime = e;
  }
  /**
   * Gets the time (in milliseconds) taken to return to the default beta position.
   * Negative value indicates camera should not return to default.
   */
  get elevationReturnTime() {
    return this._elevationReturnTime;
  }
  /**
   * Sets the delay (in milliseconds) taken before the camera returns to the default beta position.
   */
  set elevationReturnWaitTime(e) {
    this._elevationReturnWaitTime = e;
  }
  /**
   * Gets the delay (in milliseconds) taken before the camera returns to the default beta position.
   */
  get elevationReturnWaitTime() {
    return this._elevationReturnWaitTime;
  }
  /**
   * Sets the flag that indicates if user zooming should stop animation.
   */
  set zoomStopsAnimation(e) {
    this._zoomStopsAnimation = e;
  }
  /**
   * Gets the flag that indicates if user zooming should stop animation.
   */
  get zoomStopsAnimation() {
    return this._zoomStopsAnimation;
  }
  /**
   * Sets the transition time when framing the mesh, in milliseconds
   */
  set framingTime(e) {
    this._framingTime = e;
  }
  /**
   * Gets the transition time when framing the mesh, in milliseconds
   */
  get framingTime() {
    return this._framingTime;
  }
  /**
   * Initializes the behavior.
   */
  init() {
  }
  /**
   * Attaches the behavior to its arc rotate camera.
   * @param camera Defines the camera to attach the behavior to
   */
  attach(e) {
    this._attachedCamera = e;
    const t = this._attachedCamera.getScene();
    Vu.EasingFunction.setEasingMode(Vu.EasingMode), this._onPrePointerObservableObserver = t.onPrePointerObservable.add((r) => {
      if (r.type === ir.POINTERDOWN) {
        this._isPointerDown = !0;
        return;
      }
      r.type === ir.POINTERUP && (this._isPointerDown = !1);
    }), this._onMeshTargetChangedObserver = e.onMeshTargetChangedObservable.add((r) => {
      r && this.zoomOnMesh(r, void 0, () => {
        this.onTargetFramingAnimationEndObservable.notifyObservers();
      });
    }), this._onAfterCheckInputsObserver = e.onAfterCheckInputsObservable.add(() => {
      this._applyUserInteraction(), this._maintainCameraAboveGround();
    });
  }
  /**
   * Detaches the behavior from its current arc rotate camera.
   */
  detach() {
    if (!this._attachedCamera)
      return;
    const e = this._attachedCamera.getScene();
    this._onPrePointerObservableObserver && e.onPrePointerObservable.remove(this._onPrePointerObservableObserver), this._onAfterCheckInputsObserver && this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._onMeshTargetChangedObserver && this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver), this._attachedCamera = null;
  }
  /**
   * Targets the given mesh and updates zoom level accordingly.
   * @param mesh  The mesh to target.
   * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
   * @param onAnimationEnd Callback triggered at the end of the framing animation
   */
  zoomOnMesh(e, t = !1, r = null) {
    e.computeWorldMatrix(!0);
    const n = e.getBoundingInfo().boundingBox;
    this.zoomOnBoundingInfo(n.minimumWorld, n.maximumWorld, t, r);
  }
  /**
   * Targets the given mesh with its children and updates zoom level accordingly.
   * @param mesh  The mesh to target.
   * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
   * @param onAnimationEnd Callback triggered at the end of the framing animation
   */
  zoomOnMeshHierarchy(e, t = !1, r = null) {
    e.computeWorldMatrix(!0);
    const n = e.getHierarchyBoundingVectors(!0);
    this.zoomOnBoundingInfo(n.min, n.max, t, r);
  }
  /**
   * Targets the given meshes with their children and updates zoom level accordingly.
   * @param meshes  The mesh to target.
   * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
   * @param onAnimationEnd Callback triggered at the end of the framing animation
   */
  zoomOnMeshesHierarchy(e, t = !1, r = null) {
    const n = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), i = new S(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
    for (let s = 0; s < e.length; s++) {
      const a = e[s].getHierarchyBoundingVectors(!0);
      S.CheckExtends(a.min, n, i), S.CheckExtends(a.max, n, i);
    }
    this.zoomOnBoundingInfo(n, i, t, r);
  }
  /**
   * Targets the bounding box info defined by its extends and updates zoom level accordingly.
   * @param minimumWorld Determines the smaller position of the bounding box extend
   * @param maximumWorld Determines the bigger position of the bounding box extend
   * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
   * @param onAnimationEnd Callback triggered at the end of the framing animation
   * @returns true if the zoom was done
   */
  zoomOnBoundingInfo(e, t, r = !1, n = null) {
    let i;
    if (!this._attachedCamera)
      return !1;
    const s = e.y, a = t.y, f = s + (a - s) * this._positionScale, o = t.subtract(e).scale(0.5);
    if (r)
      i = new S(0, f, 0);
    else {
      const u = e.add(o);
      i = new S(u.x, f, u.z);
    }
    this._vectorTransition || (this._vectorTransition = st.CreateAnimation("target", st.ANIMATIONTYPE_VECTOR3, 60, Vu.EasingFunction)), this._betaIsAnimating = !0;
    let d = st.TransitionTo("target", i, this._attachedCamera, this._attachedCamera.getScene(), 60, this._vectorTransition, this._framingTime);
    d && this._animatables.push(d);
    let v = 0;
    if (this._mode === Vu.FitFrustumSidesMode) {
      const u = this._calculateLowerRadiusFromModelBoundingSphere(e, t);
      this.autoCorrectCameraLimitsAndSensibility && (this._attachedCamera.lowerRadiusLimit = o.length() + this._attachedCamera.minZ), v = u;
    } else
      this._mode === Vu.IgnoreBoundsSizeMode && (v = this._calculateLowerRadiusFromModelBoundingSphere(e, t), this.autoCorrectCameraLimitsAndSensibility && this._attachedCamera.lowerRadiusLimit === null && (this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ));
    if (this.autoCorrectCameraLimitsAndSensibility) {
      const u = t.subtract(e).length();
      this._attachedCamera.panningSensibility = 5e3 / u, this._attachedCamera.wheelPrecision = 100 / v;
    }
    return this._radiusTransition || (this._radiusTransition = st.CreateAnimation("radius", st.ANIMATIONTYPE_FLOAT, 60, Vu.EasingFunction)), d = st.TransitionTo("radius", v, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusTransition, this._framingTime, () => {
      this.stopAllAnimations(), n && n(), this._attachedCamera && this._attachedCamera.useInputToRestoreState && this._attachedCamera.storeState();
    }), d && this._animatables.push(d), !0;
  }
  /**
   * Calculates the lowest radius for the camera based on the bounding box of the mesh.
   * @param minimumWorld
   * @param maximumWorld
   * @returns The minimum distance from the primary mesh's center point at which the camera must be kept in order
   *		 to fully enclose the mesh in the viewing frustum.
   */
  _calculateLowerRadiusFromModelBoundingSphere(e, t) {
    const r = this._attachedCamera;
    if (!r)
      return 0;
    let n = r._calculateLowerRadiusFromModelBoundingSphere(e, t, this._radiusScale);
    return r.lowerRadiusLimit && this._mode === Vu.IgnoreBoundsSizeMode && (n = n < r.lowerRadiusLimit ? r.lowerRadiusLimit : n), r.upperRadiusLimit && (n = n > r.upperRadiusLimit ? r.upperRadiusLimit : n), n;
  }
  /**
   * Keeps the camera above the ground plane. If the user pulls the camera below the ground plane, the camera
   * is automatically returned to its default position (expected to be above ground plane).
   */
  _maintainCameraAboveGround() {
    if (this._elevationReturnTime < 0)
      return;
    const e = Yi.Now - this._lastInteractionTime, t = Math.PI * 0.5 - this._defaultElevation, r = Math.PI * 0.5;
    if (this._attachedCamera && !this._betaIsAnimating && this._attachedCamera.beta > r && e >= this._elevationReturnWaitTime) {
      this._betaIsAnimating = !0, this.stopAllAnimations(), this._betaTransition || (this._betaTransition = st.CreateAnimation("beta", st.ANIMATIONTYPE_FLOAT, 60, Vu.EasingFunction));
      const n = st.TransitionTo("beta", t, this._attachedCamera, this._attachedCamera.getScene(), 60, this._betaTransition, this._elevationReturnTime, () => {
        this._clearAnimationLocks(), this.stopAllAnimations();
      });
      n && this._animatables.push(n);
    }
  }
  /**
   * Removes all animation locks. Allows new animations to be added to any of the arcCamera properties.
   */
  _clearAnimationLocks() {
    this._betaIsAnimating = !1;
  }
  /**
   *  Applies any current user interaction to the camera. Takes into account maximum alpha rotation.
   */
  _applyUserInteraction() {
    this.isUserIsMoving && (this._lastInteractionTime = Yi.Now, this.stopAllAnimations(), this._clearAnimationLocks());
  }
  /**
   * Stops and removes all animations that have been applied to the camera
   */
  stopAllAnimations() {
    for (this._attachedCamera && (this._attachedCamera.animations = []); this._animatables.length; )
      this._animatables[0] && (this._animatables[0].onAnimationEnd = null, this._animatables[0].stop()), this._animatables.shift();
  }
  /**
   * Gets a value indicating if the user is moving the camera
   */
  get isUserIsMoving() {
    return this._attachedCamera ? this._attachedCamera.inertialAlphaOffset !== 0 || this._attachedCamera.inertialBetaOffset !== 0 || this._attachedCamera.inertialRadiusOffset !== 0 || this._attachedCamera.inertialPanningX !== 0 || this._attachedCamera.inertialPanningY !== 0 || this._isPointerDown : !1;
  }
}
Vu.EasingFunction = new $$();
Vu.EasingMode = u1.EASINGMODE_EASEINOUT;
Vu.IgnoreBoundsSizeMode = 0;
Vu.FitFrustumSidesMode = 1;
class mW {
  constructor(e, t = new S(), r = 0, n = !1) {
    this.direction = e, this.rotatedDirection = t, this.diff = r, this.ignore = n;
  }
}
class T6e {
  /**
   * Creates the AttachToBoxBehavior, used to attach UI to the closest face of the box to a camera
   * @param _ui The transform node that should be attached to the mesh
   */
  constructor(e) {
    this._ui = e, this.name = "AttachToBoxBehavior", this.distanceAwayFromFace = 0.15, this.distanceAwayFromBottomOfFace = 0.15, this._faceVectors = [
      new mW(S.Up()),
      new mW(S.Down()),
      new mW(S.Left()),
      new mW(S.Right()),
      new mW(S.Forward()),
      new mW(S.Forward().scaleInPlace(-1))
    ], this._tmpMatrix = new he(), this._tmpVector = new S(), this._zeroVector = S.Zero(), this._lookAtTmpMatrix = new he();
  }
  /**
   *  Initializes the behavior
   */
  init() {
  }
  _closestFace(e) {
    return this._faceVectors.forEach((t) => {
      this._target.rotationQuaternion || (this._target.rotationQuaternion = Ze.RotationYawPitchRoll(this._target.rotation.y, this._target.rotation.x, this._target.rotation.z)), this._target.rotationQuaternion.toRotationMatrix(this._tmpMatrix), S.TransformCoordinatesToRef(t.direction, this._tmpMatrix, t.rotatedDirection), t.diff = S.GetAngleBetweenVectors(t.rotatedDirection, e, S.Cross(t.rotatedDirection, e));
    }), this._faceVectors.reduce((t, r) => t.ignore ? r : r.ignore || t.diff < r.diff ? t : r, this._faceVectors[0]);
  }
  _lookAtToRef(e, t = new S(0, 1, 0), r) {
    he.LookAtLHToRef(this._zeroVector, e, t, this._lookAtTmpMatrix), this._lookAtTmpMatrix.invert(), Ze.FromRotationMatrixToRef(this._lookAtTmpMatrix, r);
  }
  /**
   * Attaches the AttachToBoxBehavior to the passed in mesh
   * @param target The mesh that the specified node will be attached to
   */
  attach(e) {
    this._target = e, this._scene = this._target.getScene(), this._onRenderObserver = this._scene.onBeforeRenderObservable.add(() => {
      if (!this._scene.activeCamera)
        return;
      let t = this._scene.activeCamera.position;
      this._scene.activeCamera.devicePosition && (t = this._scene.activeCamera.devicePosition);
      const r = this._closestFace(t.subtract(e.position));
      this._scene.activeCamera.leftCamera ? this._scene.activeCamera.leftCamera.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix) : this._scene.activeCamera.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix), S.TransformCoordinatesToRef(S.Up(), this._tmpMatrix, this._tmpVector), this._faceVectors.forEach((i) => {
        r.direction.x && i.direction.x && (i.ignore = !0), r.direction.y && i.direction.y && (i.ignore = !0), r.direction.z && i.direction.z && (i.ignore = !0);
      });
      const n = this._closestFace(this._tmpVector);
      this._faceVectors.forEach((i) => {
        i.ignore = !1;
      }), this._ui.position.copyFrom(e.position), r.direction.x && (r.rotatedDirection.scaleToRef(e.scaling.x / 2 + this.distanceAwayFromFace, this._tmpVector), this._ui.position.addInPlace(this._tmpVector)), r.direction.y && (r.rotatedDirection.scaleToRef(e.scaling.y / 2 + this.distanceAwayFromFace, this._tmpVector), this._ui.position.addInPlace(this._tmpVector)), r.direction.z && (r.rotatedDirection.scaleToRef(e.scaling.z / 2 + this.distanceAwayFromFace, this._tmpVector), this._ui.position.addInPlace(this._tmpVector)), this._ui.rotationQuaternion || (this._ui.rotationQuaternion = Ze.RotationYawPitchRoll(this._ui.rotation.y, this._ui.rotation.x, this._ui.rotation.z)), r.rotatedDirection.scaleToRef(-1, this._tmpVector), this._lookAtToRef(this._tmpVector, n.rotatedDirection, this._ui.rotationQuaternion), n.direction.x && this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - e.scaling.x / 2, this._tmpVector), n.direction.y && this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - e.scaling.y / 2, this._tmpVector), n.direction.z && this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - e.scaling.z / 2, this._tmpVector), this._ui.position.addInPlace(this._tmpVector);
    });
  }
  /**
   *  Detaches the behavior from the mesh
   */
  detach() {
    this._scene.onBeforeRenderObservable.remove(this._onRenderObserver);
  }
}
class q6e {
  /**
   * Time in milliseconds to delay before fading in (Default: 0)
   * Will set both fade in and out delay to the same value
   */
  get delay() {
    return this.fadeInDelay;
  }
  set delay(e) {
    this.fadeInDelay = e, this.fadeOutDelay = e;
  }
  /**
   * Instantiates the FadeInOutBehavior
   */
  constructor() {
    this.fadeInDelay = 0, this.fadeOutDelay = 0, this.fadeInTime = 300, this.fadeOutTime = 300, this._millisecondsPerFrame = 1e3 / 60, this._hovered = !1, this._hoverValue = 0, this._ownerNode = null, this._delay = 0, this._time = 300, this._update = () => {
      if (this._ownerNode) {
        if (this._hoverValue += this._hovered ? this._millisecondsPerFrame : -this._millisecondsPerFrame, this._setAllVisibility(this._ownerNode, (this._hoverValue - this._delay) / this._time), this._ownerNode.visibility > 1) {
          if (this._setAllVisibility(this._ownerNode, 1), this._hoverValue > this._time) {
            this._hoverValue = this._time, this._detachObserver();
            return;
          }
        } else if (this._ownerNode.visibility < 0 && (this._setAllVisibility(this._ownerNode, 0), this._hoverValue < 0)) {
          this._hoverValue = 0, this._detachObserver();
          return;
        }
        this._attachObserver();
      }
    };
  }
  /**
   *  The name of the behavior
   */
  get name() {
    return "FadeInOut";
  }
  /**
   *  Initializes the behavior
   */
  init() {
  }
  /**
   * Attaches the fade behavior on the passed in mesh
   * @param ownerNode The mesh that will be faded in/out once attached
   */
  attach(e) {
    this._ownerNode = e, this._setAllVisibility(this._ownerNode, 0);
  }
  /**
   *  Detaches the behavior from the mesh
   */
  detach() {
    this._ownerNode = null;
  }
  /**
   * Triggers the mesh to begin fading in (or out)
   * @param fadeIn if the object should fade in or out (true to fade in)
   */
  fadeIn(e = !0) {
    this._delay = e ? this.fadeInDelay : this.fadeOutDelay, this._time = e ? this.fadeInTime : this.fadeOutTime, this._detachObserver(), !(this._ownerNode && (e && this._ownerNode.visibility >= 1 || !e && this._ownerNode.visibility <= 0)) && (this._hovered = e, this._hovered || (this._delay *= -1), this._ownerNode.visibility >= 1 ? this._hoverValue = this._time : this._ownerNode.visibility <= 0 && (this._hoverValue = 0), this._update());
  }
  /**
   * Triggers the mesh to begin fading out
   */
  fadeOut() {
    this.fadeIn(!1);
  }
  _setAllVisibility(e, t) {
    e.visibility = t, e.getChildMeshes().forEach((r) => {
      this._setAllVisibility(r, t);
    });
  }
  _attachObserver() {
    var e;
    this._onBeforeRenderObserver || (this._onBeforeRenderObserver = (e = this._ownerNode) === null || e === void 0 ? void 0 : e.getScene().onBeforeRenderObservable.add(this._update));
  }
  _detachObserver() {
    var e;
    this._onBeforeRenderObserver && ((e = this._ownerNode) === null || e === void 0 || e.getScene().onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = null);
  }
}
class Hi {
  /**
   * Creates a new ray
   * @param origin origin point
   * @param direction direction
   * @param length length of the ray
   */
  constructor(e, t, r = Number.MAX_VALUE) {
    this.origin = e, this.direction = t, this.length = r;
  }
  // Methods
  /**
   * Clone the current ray
   * @returns a new ray
   */
  clone() {
    return new Hi(this.origin.clone(), this.direction.clone(), this.length);
  }
  /**
   * Checks if the ray intersects a box
   * This does not account for the ray length by design to improve perfs.
   * @param minimum bound of the box
   * @param maximum bound of the box
   * @param intersectionTreshold extra extend to be added to the box in all direction
   * @returns if the box was hit
   */
  intersectsBoxMinMax(e, t, r = 0) {
    const n = Hi._TmpVector3[0].copyFromFloats(e.x - r, e.y - r, e.z - r), i = Hi._TmpVector3[1].copyFromFloats(t.x + r, t.y + r, t.z + r);
    let s = 0, a = Number.MAX_VALUE, f, o, d, v;
    if (Math.abs(this.direction.x) < 1e-7) {
      if (this.origin.x < n.x || this.origin.x > i.x)
        return !1;
    } else if (f = 1 / this.direction.x, o = (n.x - this.origin.x) * f, d = (i.x - this.origin.x) * f, d === -1 / 0 && (d = 1 / 0), o > d && (v = o, o = d, d = v), s = Math.max(o, s), a = Math.min(d, a), s > a)
      return !1;
    if (Math.abs(this.direction.y) < 1e-7) {
      if (this.origin.y < n.y || this.origin.y > i.y)
        return !1;
    } else if (f = 1 / this.direction.y, o = (n.y - this.origin.y) * f, d = (i.y - this.origin.y) * f, d === -1 / 0 && (d = 1 / 0), o > d && (v = o, o = d, d = v), s = Math.max(o, s), a = Math.min(d, a), s > a)
      return !1;
    if (Math.abs(this.direction.z) < 1e-7) {
      if (this.origin.z < n.z || this.origin.z > i.z)
        return !1;
    } else if (f = 1 / this.direction.z, o = (n.z - this.origin.z) * f, d = (i.z - this.origin.z) * f, d === -1 / 0 && (d = 1 / 0), o > d && (v = o, o = d, d = v), s = Math.max(o, s), a = Math.min(d, a), s > a)
      return !1;
    return !0;
  }
  /**
   * Checks if the ray intersects a box
   * This does not account for the ray lenght by design to improve perfs.
   * @param box the bounding box to check
   * @param intersectionTreshold extra extend to be added to the BoundingBox in all direction
   * @returns if the box was hit
   */
  intersectsBox(e, t = 0) {
    return this.intersectsBoxMinMax(e.minimum, e.maximum, t);
  }
  /**
   * If the ray hits a sphere
   * @param sphere the bounding sphere to check
   * @param intersectionTreshold extra extend to be added to the BoundingSphere in all direction
   * @returns true if it hits the sphere
   */
  intersectsSphere(e, t = 0) {
    const r = e.center.x - this.origin.x, n = e.center.y - this.origin.y, i = e.center.z - this.origin.z, s = r * r + n * n + i * i, a = e.radius + t, f = a * a;
    if (s <= f)
      return !0;
    const o = r * this.direction.x + n * this.direction.y + i * this.direction.z;
    return o < 0 ? !1 : s - o * o <= f;
  }
  /**
   * If the ray hits a triange
   * @param vertex0 triangle vertex
   * @param vertex1 triangle vertex
   * @param vertex2 triangle vertex
   * @returns intersection information if hit
   */
  intersectsTriangle(e, t, r) {
    const n = Hi._TmpVector3[0], i = Hi._TmpVector3[1], s = Hi._TmpVector3[2], a = Hi._TmpVector3[3], f = Hi._TmpVector3[4];
    t.subtractToRef(e, n), r.subtractToRef(e, i), S.CrossToRef(this.direction, i, s);
    const o = S.Dot(n, s);
    if (o === 0)
      return null;
    const d = 1 / o;
    this.origin.subtractToRef(e, a);
    const v = S.Dot(a, s) * d;
    if (v < 0 || v > 1)
      return null;
    S.CrossToRef(a, n, f);
    const u = S.Dot(this.direction, f) * d;
    if (u < 0 || v + u > 1)
      return null;
    const l = S.Dot(i, f) * d;
    return l > this.length ? null : new LC(1 - v - u, v, l);
  }
  /**
   * Checks if ray intersects a plane
   * @param plane the plane to check
   * @returns the distance away it was hit
   */
  intersectsPlane(e) {
    let t;
    const r = S.Dot(e.normal, this.direction);
    if (Math.abs(r) < 999999997475243e-21)
      return null;
    {
      const n = S.Dot(e.normal, this.origin);
      return t = (-e.d - n) / r, t < 0 ? t < -999999997475243e-21 ? null : 0 : t;
    }
  }
  /**
   * Calculate the intercept of a ray on a given axis
   * @param axis to check 'x' | 'y' | 'z'
   * @param offset from axis interception (i.e. an offset of 1y is intercepted above ground)
   * @returns a vector containing the coordinates where 'axis' is equal to zero (else offset), or null if there is no intercept.
   */
  intersectsAxis(e, t = 0) {
    switch (e) {
      case "y": {
        const r = (this.origin.y - t) / this.direction.y;
        return r > 0 ? null : new S(this.origin.x + this.direction.x * -r, t, this.origin.z + this.direction.z * -r);
      }
      case "x": {
        const r = (this.origin.x - t) / this.direction.x;
        return r > 0 ? null : new S(t, this.origin.y + this.direction.y * -r, this.origin.z + this.direction.z * -r);
      }
      case "z": {
        const r = (this.origin.z - t) / this.direction.z;
        return r > 0 ? null : new S(this.origin.x + this.direction.x * -r, this.origin.y + this.direction.y * -r, t);
      }
      default:
        return null;
    }
  }
  /**
   * Checks if ray intersects a mesh. The ray is defined in WORLD space. A mesh triangle can be picked both from its front and back sides,
   * irrespective of orientation.
   * @param mesh the mesh to check
   * @param fastCheck defines if the first intersection will be used (and not the closest)
   * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
   * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
   * @param worldToUse defines the world matrix to use to get the world coordinate of the intersection point
   * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
   * @returns picking info of the intersection
   */
  intersectsMesh(e, t, r, n = !1, i, s = !1) {
    const a = ue.Matrix[0];
    return e.getWorldMatrix().invertToRef(a), this._tmpRay ? Hi.TransformToRef(this, a, this._tmpRay) : this._tmpRay = Hi.Transform(this, a), e.intersects(this._tmpRay, t, r, n, i, s);
  }
  /**
   * Checks if ray intersects a mesh
   * @param meshes the meshes to check
   * @param fastCheck defines if the first intersection will be used (and not the closest)
   * @param results array to store result in
   * @returns Array of picking infos
   */
  intersectsMeshes(e, t, r) {
    r ? r.length = 0 : r = [];
    for (let n = 0; n < e.length; n++) {
      const i = this.intersectsMesh(e[n], t);
      i.hit && r.push(i);
    }
    return r.sort(this._comparePickingInfo), r;
  }
  _comparePickingInfo(e, t) {
    return e.distance < t.distance ? -1 : e.distance > t.distance ? 1 : 0;
  }
  /**
   * Intersection test between the ray and a given segment within a given tolerance (threshold)
   * @param sega the first point of the segment to test the intersection against
   * @param segb the second point of the segment to test the intersection against
   * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
   * @returns the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
   */
  intersectionSegment(e, t, r) {
    const n = this.origin, i = ue.Vector3[0], s = ue.Vector3[1], a = ue.Vector3[2], f = ue.Vector3[3];
    t.subtractToRef(e, i), this.direction.scaleToRef(Hi._Rayl, a), n.addToRef(a, s), e.subtractToRef(n, f);
    const o = S.Dot(i, i), d = S.Dot(i, a), v = S.Dot(a, a), u = S.Dot(i, f), l = S.Dot(a, f), P = o * v - d * d;
    let p, c = P, H, T = P;
    P < Hi._Smallnum ? (p = 0, c = 1, H = l, T = v) : (p = d * l - v * u, H = o * l - d * u, p < 0 ? (p = 0, H = l, T = v) : p > c && (p = c, H = l + d, T = v)), H < 0 ? (H = 0, -u < 0 ? p = 0 : -u > o ? p = c : (p = -u, c = o)) : H > T && (H = T, -u + d < 0 ? p = 0 : -u + d > o ? p = c : (p = -u + d, c = o));
    const q = Math.abs(p) < Hi._Smallnum ? 0 : p / c, b = Math.abs(H) < Hi._Smallnum ? 0 : H / T, j = ue.Vector3[4];
    a.scaleToRef(b, j);
    const w = ue.Vector3[5];
    i.scaleToRef(q, w), w.addInPlace(f);
    const m = ue.Vector3[6];
    return w.subtractToRef(j, m), b > 0 && b <= this.length && m.lengthSquared() < r * r ? w.length() : -1;
  }
  /**
   * Update the ray from viewport position
   * @param x position
   * @param y y position
   * @param viewportWidth viewport width
   * @param viewportHeight viewport height
   * @param world world matrix
   * @param view view matrix
   * @param projection projection matrix
   * @param enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)
   * @returns this ray updated
   */
  update(e, t, r, n, i, s, a, f = !1) {
    if (f) {
      Hi._RayDistant || (Hi._RayDistant = Hi.Zero()), Hi._RayDistant.unprojectRayToRef(e, t, r, n, he.IdentityReadOnly, s, a);
      const o = ue.Matrix[0];
      i.invertToRef(o), Hi.TransformToRef(Hi._RayDistant, o, this);
    } else
      this.unprojectRayToRef(e, t, r, n, i, s, a);
    return this;
  }
  // Statics
  /**
   * Creates a ray with origin and direction of 0,0,0
   * @returns the new ray
   */
  static Zero() {
    return new Hi(S.Zero(), S.Zero());
  }
  /**
   * Creates a new ray from screen space and viewport
   * @param x position
   * @param y y position
   * @param viewportWidth viewport width
   * @param viewportHeight viewport height
   * @param world world matrix
   * @param view view matrix
   * @param projection projection matrix
   * @returns new ray
   */
  static CreateNew(e, t, r, n, i, s, a) {
    return Hi.Zero().update(e, t, r, n, i, s, a);
  }
  /**
   * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
   * transformed to the given world matrix.
   * @param origin The origin point
   * @param end The end point
   * @param world a matrix to transform the ray to. Default is the identity matrix.
   * @returns the new ray
   */
  static CreateNewFromTo(e, t, r = he.IdentityReadOnly) {
    const n = t.subtract(e), i = Math.sqrt(n.x * n.x + n.y * n.y + n.z * n.z);
    return n.normalize(), Hi.Transform(new Hi(e, n, i), r);
  }
  /**
   * Transforms a ray by a matrix
   * @param ray ray to transform
   * @param matrix matrix to apply
   * @returns the resulting new ray
   */
  static Transform(e, t) {
    const r = new Hi(new S(0, 0, 0), new S(0, 0, 0));
    return Hi.TransformToRef(e, t, r), r;
  }
  /**
   * Transforms a ray by a matrix
   * @param ray ray to transform
   * @param matrix matrix to apply
   * @param result ray to store result in
   */
  static TransformToRef(e, t, r) {
    S.TransformCoordinatesToRef(e.origin, t, r.origin), S.TransformNormalToRef(e.direction, t, r.direction), r.length = e.length;
    const n = r.direction, i = n.length();
    if (!(i === 0 || i === 1)) {
      const s = 1 / i;
      n.x *= s, n.y *= s, n.z *= s, r.length *= i;
    }
  }
  /**
   * Unproject a ray from screen space to object space
   * @param sourceX defines the screen space x coordinate to use
   * @param sourceY defines the screen space y coordinate to use
   * @param viewportWidth defines the current width of the viewport
   * @param viewportHeight defines the current height of the viewport
   * @param world defines the world matrix to use (can be set to Identity to go to world space)
   * @param view defines the view matrix to use
   * @param projection defines the projection matrix to use
   */
  unprojectRayToRef(e, t, r, n, i, s, a) {
    const f = ue.Matrix[0];
    i.multiplyToRef(s, f), f.multiplyToRef(a, f), f.invert();
    const o = gr.LastCreatedEngine, d = ue.Vector3[0];
    d.x = e / r * 2 - 1, d.y = -(t / n * 2 - 1), d.z = o != null && o.useReverseDepthBuffer ? 1 : o != null && o.isNDCHalfZRange ? 0 : -1;
    const v = ue.Vector3[1].copyFromFloats(d.x, d.y, 1 - 1e-8), u = ue.Vector3[2], l = ue.Vector3[3];
    S._UnprojectFromInvertedMatrixToRef(d, f, u), S._UnprojectFromInvertedMatrixToRef(v, f, l), this.origin.copyFrom(u), l.subtractToRef(u, this.direction), this.direction.normalize();
  }
}
Hi._TmpVector3 = Nf.BuildArray(6, S.Zero);
Hi._RayDistant = Hi.Zero();
Hi._Smallnum = 1e-8;
Hi._Rayl = 1e9;
sr.prototype.createPickingRay = function(A, e, t, r, n = !1) {
  const i = Hi.Zero();
  return this.createPickingRayToRef(A, e, t, i, r, n), i;
};
sr.prototype.createPickingRayToRef = function(A, e, t, r, n, i = !1, s = !1) {
  const a = this.getEngine();
  if (!n && !(n = this.activeCamera))
    return this;
  const f = n.viewport, o = a.getRenderHeight(), { x: d, y: v, width: u, height: l } = f.toGlobal(a.getRenderWidth(), o), P = 1 / a.getHardwareScalingLevel();
  return A = A * P - d, e = e * P - (o - v - l), r.update(A, e, u, l, t || he.IdentityReadOnly, i ? he.IdentityReadOnly : n.getViewMatrix(), n.getProjectionMatrix(), s), this;
};
sr.prototype.createPickingRayInCameraSpace = function(A, e, t) {
  const r = Hi.Zero();
  return this.createPickingRayInCameraSpaceToRef(A, e, r, t), r;
};
sr.prototype.createPickingRayInCameraSpaceToRef = function(A, e, t, r) {
  if (!F9)
    return this;
  const n = this.getEngine();
  if (!r && !(r = this.activeCamera))
    throw new Error("Active camera not set");
  const i = r.viewport, s = n.getRenderHeight(), { x: a, y: f, width: o, height: d } = i.toGlobal(n.getRenderWidth(), s), v = he.Identity(), u = 1 / n.getHardwareScalingLevel();
  return A = A * u - a, e = e * u - (s - f - d), t.update(A, e, o, d, v, v, r.getProjectionMatrix()), this;
};
sr.prototype._internalPickForMesh = function(A, e, t, r, n, i, s, a) {
  const f = e(r, t.enableDistantPicking), o = t.intersects(f, n, s, i, r, a);
  return !o || !o.hit || !n && A != null && o.distance >= A.distance ? null : o;
};
sr.prototype._internalPick = function(A, e, t, r, n) {
  let i = null;
  const s = !!(this.activeCameras && this.activeCameras.length > 1 && this.cameraToUseForPointers !== this.activeCamera), a = this.cameraToUseForPointers || this.activeCamera;
  for (let f = 0; f < this.meshes.length; f++) {
    const o = this.meshes[f];
    if (e) {
      if (!e(o))
        continue;
    } else if (!o.isEnabled() || !o.isVisible || !o.isPickable)
      continue;
    const d = s && o.isWorldMatrixCameraDependent(), v = o.computeWorldMatrix(d, a);
    if (o.hasThinInstances && o.thinInstanceEnablePicking) {
      const u = this._internalPickForMesh(i, A, o, v, !0, !0, n);
      if (u) {
        if (r)
          return u;
        const l = ue.Matrix[1], P = o.thinInstanceGetWorldMatrices();
        for (let p = 0; p < P.length; p++) {
          P[p].multiplyToRef(v, l);
          const H = this._internalPickForMesh(i, A, o, l, t, r, n, !0);
          if (H && (i = H, i.thinInstanceIndex = p, t))
            return i;
        }
      }
    } else {
      const u = this._internalPickForMesh(i, A, o, v, t, r, n);
      if (u && (i = u, t))
        return i;
    }
  }
  return i || new F9();
};
sr.prototype._internalMultiPick = function(A, e, t) {
  if (!F9)
    return null;
  const r = [], n = !!(this.activeCameras && this.activeCameras.length > 1 && this.cameraToUseForPointers !== this.activeCamera), i = this.cameraToUseForPointers || this.activeCamera;
  for (let s = 0; s < this.meshes.length; s++) {
    const a = this.meshes[s];
    if (e) {
      if (!e(a))
        continue;
    } else if (!a.isEnabled() || !a.isVisible || !a.isPickable)
      continue;
    const f = n && a.isWorldMatrixCameraDependent(), o = a.computeWorldMatrix(f, i);
    if (a.hasThinInstances && a.thinInstanceEnablePicking) {
      if (this._internalPickForMesh(null, A, a, o, !0, !0, t)) {
        const v = ue.Matrix[1], u = a.thinInstanceGetWorldMatrices();
        for (let l = 0; l < u.length; l++) {
          u[l].multiplyToRef(o, v);
          const p = this._internalPickForMesh(null, A, a, v, !1, !1, t, !0);
          p && (p.thinInstanceIndex = l, r.push(p));
        }
      }
    } else {
      const d = this._internalPickForMesh(null, A, a, o, !1, !1, t);
      d && r.push(d);
    }
  }
  return r;
};
sr.prototype.pickWithBoundingInfo = function(A, e, t, r, n) {
  if (!F9)
    return null;
  const i = this._internalPick((s) => (this._tempPickingRay || (this._tempPickingRay = Hi.Zero()), this.createPickingRayToRef(A, e, s, this._tempPickingRay, n || null), this._tempPickingRay), t, r, !0);
  return i && (i.ray = this.createPickingRay(A, e, he.Identity(), n || null)), i;
};
Object.defineProperty(sr.prototype, "_pickingAvailable", {
  get: () => !0,
  enumerable: !1,
  configurable: !1
});
sr.prototype.pick = function(A, e, t, r, n, i, s = !1) {
  const a = this._internalPick((f, o) => (this._tempPickingRay || (this._tempPickingRay = Hi.Zero()), this.createPickingRayToRef(A, e, f, this._tempPickingRay, n || null, !1, o), this._tempPickingRay), t, r, !1, i);
  return a && (a.ray = this.createPickingRay(A, e, he.Identity(), n || null)), a;
};
sr.prototype.pickWithRay = function(A, e, t, r) {
  const n = this._internalPick((i) => (this._pickWithRayInverseMatrix || (this._pickWithRayInverseMatrix = he.Identity()), i.invertToRef(this._pickWithRayInverseMatrix), this._cachedRayForTransform || (this._cachedRayForTransform = Hi.Zero()), Hi.TransformToRef(A, this._pickWithRayInverseMatrix, this._cachedRayForTransform), this._cachedRayForTransform), e, t, !1, r);
  return n && (n.ray = A), n;
};
sr.prototype.multiPick = function(A, e, t, r, n) {
  return this._internalMultiPick((i) => this.createPickingRay(A, e, i, r || null), t, n);
};
sr.prototype.multiPickWithRay = function(A, e, t) {
  return this._internalMultiPick((r) => (this._pickWithRayInverseMatrix || (this._pickWithRayInverseMatrix = he.Identity()), r.invertToRef(this._pickWithRayInverseMatrix), this._cachedRayForTransform || (this._cachedRayForTransform = Hi.Zero()), Hi.TransformToRef(A, this._pickWithRayInverseMatrix, this._cachedRayForTransform), this._cachedRayForTransform), e, t);
};
Tr.prototype.getForwardRay = function(A = 100, e, t) {
  return this.getForwardRayToRef(new Hi(S.Zero(), S.Zero(), A), A, e, t);
};
Tr.prototype.getForwardRayToRef = function(A, e = 100, t, r) {
  t || (t = this.getWorldMatrix()), A.length = e, r ? A.origin.copyFrom(r) : A.origin.copyFrom(this.position);
  const n = ue.Vector3[2];
  n.set(0, 0, this._scene.useRightHandedSystem ? -1 : 1);
  const i = ue.Vector3[3];
  return S.TransformNormalToRef(n, t, i), S.NormalizeToRef(i, A.direction), A;
};
class Vs {
  /**
   * @internal
   */
  static _RemoveAndStorePivotPoint(e) {
    e && Vs._PivotCached === 0 && (e.getPivotPointToRef(Vs._OldPivotPoint), Vs._PivotPostMultiplyPivotMatrix = e._postMultiplyPivotMatrix, Vs._OldPivotPoint.equalsToFloats(0, 0, 0) || (e.setPivotMatrix(he.IdentityReadOnly), Vs._OldPivotPoint.subtractToRef(e.getPivotPoint(), Vs._PivotTranslation), Vs._PivotTmpVector.copyFromFloats(1, 1, 1), Vs._PivotTmpVector.subtractInPlace(e.scaling), Vs._PivotTmpVector.multiplyInPlace(Vs._PivotTranslation), e.position.addInPlace(Vs._PivotTmpVector))), Vs._PivotCached++;
  }
  /**
   * @internal
   */
  static _RestorePivotPoint(e) {
    e && !Vs._OldPivotPoint.equalsToFloats(0, 0, 0) && Vs._PivotCached === 1 && (e.setPivotPoint(Vs._OldPivotPoint), e._postMultiplyPivotMatrix = Vs._PivotPostMultiplyPivotMatrix, Vs._PivotTmpVector.copyFromFloats(1, 1, 1), Vs._PivotTmpVector.subtractInPlace(e.scaling), Vs._PivotTmpVector.multiplyInPlace(Vs._PivotTranslation), e.position.subtractInPlace(Vs._PivotTmpVector)), this._PivotCached--;
  }
}
Vs._PivotCached = 0;
Vs._OldPivotPoint = new S();
Vs._PivotTranslation = new S();
Vs._PivotTmpVector = new S();
Vs._PivotPostMultiplyPivotMatrix = !1;
function UO(A) {
  const e = [], t = [], r = [], n = [], i = A.width || A.size || 1, s = A.height || A.size || 1, a = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE, f = i / 2, o = s / 2;
  t.push(-f, -o, 0), r.push(0, 0, -1), n.push(0, us.UseOpenGLOrientationForUV ? 1 : 0), t.push(f, -o, 0), r.push(0, 0, -1), n.push(1, us.UseOpenGLOrientationForUV ? 1 : 0), t.push(f, o, 0), r.push(0, 0, -1), n.push(1, us.UseOpenGLOrientationForUV ? 0 : 1), t.push(-f, o, 0), r.push(0, 0, -1), n.push(0, us.UseOpenGLOrientationForUV ? 0 : 1), e.push(0), e.push(1), e.push(2), e.push(0), e.push(2), e.push(3), Ut._ComputeSides(a, t, e, r, n, A.frontUVs, A.backUVs);
  const d = new Ut();
  return d.indices = e, d.positions = t, d.normals = r, d.uvs = n, d;
}
function u4(A, e = {}, t = null) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, UO(e).applyToMesh(r, e.updatable), e.sourcePlane && (r.translate(e.sourcePlane.normal, -e.sourcePlane.d), r.setDirection(e.sourcePlane.normal.scale(-1))), r;
}
const b6e = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreatePlane: u4
};
Ut.CreatePlane = UO;
Ee.CreatePlane = (A, e, t, r, n) => u4(A, {
  size: e,
  width: e,
  height: e,
  sideOrientation: n,
  updatable: r
}, t);
class O9 {
  /**
   * Get or set the currentDraggingPointerId
   * @deprecated Please use currentDraggingPointerId instead
   */
  get currentDraggingPointerID() {
    return this.currentDraggingPointerId;
  }
  set currentDraggingPointerID(e) {
    this.currentDraggingPointerId = e;
  }
  /**
   *  If the drag behavior will react to drag events (Default: true)
   */
  set enabled(e) {
    e != this._enabled && this.onEnabledObservable.notifyObservers(e), this._enabled = e;
  }
  get enabled() {
    return this._enabled;
  }
  /**
   * Gets the options used by the behavior
   */
  get options() {
    return this._options;
  }
  /**
   * Sets the options used by the behavior
   */
  set options(e) {
    this._options = e;
  }
  /**
   * Creates a pointer drag behavior that can be attached to a mesh
   * @param options The drag axis or normal of the plane that will be dragged across. If no options are specified the drag plane will always face the ray's origin (eg. camera)
   * @param options.dragAxis
   * @param options.dragPlaneNormal
   */
  constructor(e) {
    this._useAlternatePickedPointAboveMaxDragAngleDragSpeed = -1.1, this._activeDragButton = -1, this.maxDragAngle = 0, this.dragButtons = [0, 1, 2], this._useAlternatePickedPointAboveMaxDragAngle = !1, this.currentDraggingPointerId = -1, this.dragging = !1, this.dragDeltaRatio = 0.2, this.updateDragPlane = !0, this._debugMode = !1, this._moving = !1, this.onDragObservable = new Oe(), this.onDragStartObservable = new Oe(), this.onDragEndObservable = new Oe(), this.onEnabledObservable = new Oe(), this.moveAttached = !0, this._enabled = !0, this.startAndReleaseDragOnPointerEvents = !0, this.detachCameraControls = !0, this.useObjectOrientationForDragging = !0, this.validateDrag = (r) => !0, this._tmpVector = new S(0, 0, 0), this._alternatePickedPoint = new S(0, 0, 0), this._worldDragAxis = new S(0, 0, 0), this._targetPosition = new S(0, 0, 0), this._attachedToElement = !1, this._startDragRay = new Hi(new S(), new S()), this._lastPointerRay = {}, this._dragDelta = new S(), this._pointA = new S(0, 0, 0), this._pointC = new S(0, 0, 0), this._localAxis = new S(0, 0, 0), this._lookAt = new S(0, 0, 0), this._options = e || {};
    let t = 0;
    if (this._options.dragAxis && t++, this._options.dragPlaneNormal && t++, t > 1)
      throw "Multiple drag modes specified in dragBehavior options. Only one expected";
  }
  /**
   *  The name of the behavior
   */
  get name() {
    return "PointerDrag";
  }
  /**
   *  Initializes the behavior
   */
  init() {
  }
  /**
   * Attaches the drag behavior the passed in mesh
   * @param ownerNode The mesh that will be dragged around once attached
   * @param predicate Predicate to use for pick filtering
   */
  attach(e, t) {
    this._scene = e.getScene(), e.isNearGrabbable = !0, this.attachedNode = e, O9._PlaneScene || (this._debugMode ? O9._PlaneScene = this._scene : (O9._PlaneScene = new sr(this._scene.getEngine(), { virtual: !0 }), O9._PlaneScene.detachControl(), this._scene.onDisposeObservable.addOnce(() => {
      O9._PlaneScene.dispose(), O9._PlaneScene = null;
    }))), this._dragPlane = u4("pointerDragPlane", { size: this._debugMode ? 1 : 1e4, updatable: !1, sideOrientation: Ee.DOUBLESIDE }, O9._PlaneScene), this.lastDragPosition = new S(0, 0, 0);
    const r = t || ((n) => this.attachedNode == n || n.isDescendantOf(this.attachedNode));
    this._pointerObserver = this._scene.onPointerObservable.add((n) => {
      if (!this.enabled) {
        this._attachedToElement && this.releaseDrag();
        return;
      }
      if (n.type == ir.POINTERDOWN)
        this.startAndReleaseDragOnPointerEvents && !this.dragging && n.pickInfo && n.pickInfo.hit && n.pickInfo.pickedMesh && n.pickInfo.pickedPoint && n.pickInfo.ray && r(n.pickInfo.pickedMesh) && this._activeDragButton === -1 && this.dragButtons.indexOf(n.event.button) !== -1 && (this._activeDragButton = n.event.button, this._activePointerInfo = n, this._startDrag(n.event.pointerId, n.pickInfo.ray, n.pickInfo.pickedPoint));
      else if (n.type == ir.POINTERUP)
        this.startAndReleaseDragOnPointerEvents && this.currentDraggingPointerId == n.event.pointerId && (this._activeDragButton === n.event.button || this._activeDragButton === -1) && this.releaseDrag();
      else if (n.type == ir.POINTERMOVE) {
        const i = n.event.pointerId;
        if (this.currentDraggingPointerId === O9._AnyMouseId && i !== O9._AnyMouseId) {
          const s = n.event;
          (s.pointerType === "mouse" || !this._scene.getEngine().hostInformation.isMobile && s instanceof MouseEvent) && (this._lastPointerRay[this.currentDraggingPointerId] && (this._lastPointerRay[i] = this._lastPointerRay[this.currentDraggingPointerId], delete this._lastPointerRay[this.currentDraggingPointerId]), this.currentDraggingPointerId = i);
        }
        this._lastPointerRay[i] || (this._lastPointerRay[i] = new Hi(new S(), new S())), n.pickInfo && n.pickInfo.ray && (this._lastPointerRay[i].origin.copyFrom(n.pickInfo.ray.origin), this._lastPointerRay[i].direction.copyFrom(n.pickInfo.ray.direction), this.currentDraggingPointerId == i && this.dragging && this._moveDrag(n.pickInfo.ray));
      }
    }), this._beforeRenderObserver = this._scene.onBeforeRenderObservable.add(() => {
      if (this._moving && this.moveAttached) {
        let n = !1;
        Vs._RemoveAndStorePivotPoint(this.attachedNode), this._targetPosition.subtractToRef(this.attachedNode.absolutePosition, this._tmpVector), this._tmpVector.scaleInPlace(this.dragDeltaRatio), this.attachedNode.getAbsolutePosition().addToRef(this._tmpVector, this._tmpVector), this.validateDrag(this._tmpVector) && (this.attachedNode.setAbsolutePosition(this._tmpVector), n = !0), Vs._RestorePivotPoint(this.attachedNode), n && this.attachedNode.computeWorldMatrix();
      }
    });
  }
  /**
   * Force release the drag action by code.
   */
  releaseDrag() {
    if (this.dragging && (this.dragging = !1, this.onDragEndObservable.notifyObservers({ dragPlanePoint: this.lastDragPosition, pointerId: this.currentDraggingPointerId, pointerInfo: this._activePointerInfo })), this.currentDraggingPointerId = -1, this._activeDragButton = -1, this._activePointerInfo = null, this._moving = !1, this.detachCameraControls && this._attachedToElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera) {
      if (this._scene.activeCamera.getClassName() === "ArcRotateCamera") {
        const e = this._scene.activeCamera;
        e.attachControl(e.inputs ? e.inputs.noPreventDefault : !0, e._useCtrlForPanning, e._panningMouseButton);
      } else
        this._scene.activeCamera.attachControl(this._scene.activeCamera.inputs ? this._scene.activeCamera.inputs.noPreventDefault : !0);
      this._attachedToElement = !1;
    }
  }
  /**
   * Simulates the start of a pointer drag event on the behavior
   * @param pointerId pointerID of the pointer that should be simulated (Default: Any mouse pointer ID)
   * @param fromRay initial ray of the pointer to be simulated (Default: Ray from camera to attached mesh)
   * @param startPickedPoint picked point of the pointer to be simulated (Default: attached mesh position)
   */
  startDrag(e = O9._AnyMouseId, t, r) {
    this._startDrag(e, t, r);
    let n = this._lastPointerRay[e];
    e === O9._AnyMouseId && (n = this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]), n && this._moveDrag(n);
  }
  _startDrag(e, t, r) {
    if (!this._scene.activeCamera || this.dragging || !this.attachedNode)
      return;
    Vs._RemoveAndStorePivotPoint(this.attachedNode), t ? (this._startDragRay.direction.copyFrom(t.direction), this._startDragRay.origin.copyFrom(t.origin)) : (this._startDragRay.origin.copyFrom(this._scene.activeCamera.position), this.attachedNode.getWorldMatrix().getTranslationToRef(this._tmpVector), this._tmpVector.subtractToRef(this._scene.activeCamera.position, this._startDragRay.direction)), this._updateDragPlanePosition(this._startDragRay, r || this._tmpVector);
    const n = this._pickWithRayOnDragPlane(this._startDragRay);
    n ? (this.dragging = !0, this.currentDraggingPointerId = e, this.lastDragPosition.copyFrom(n), this.onDragStartObservable.notifyObservers({ dragPlanePoint: n, pointerId: this.currentDraggingPointerId, pointerInfo: this._activePointerInfo }), this._targetPosition.copyFrom(this.attachedNode.getAbsolutePosition()), this.detachCameraControls && this._scene.activeCamera && this._scene.activeCamera.inputs && !this._scene.activeCamera.leftCamera && (this._scene.activeCamera.inputs.attachedToElement ? (this._scene.activeCamera.detachControl(), this._attachedToElement = !0) : this._attachedToElement = !1)) : this.releaseDrag(), Vs._RestorePivotPoint(this.attachedNode);
  }
  _moveDrag(e) {
    this._moving = !0;
    const t = this._pickWithRayOnDragPlane(e);
    if (t) {
      Vs._RemoveAndStorePivotPoint(this.attachedNode), this.updateDragPlane && this._updateDragPlanePosition(e, t);
      let r = 0;
      this._options.dragAxis ? (this.useObjectOrientationForDragging ? S.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._worldDragAxis) : this._worldDragAxis.copyFrom(this._options.dragAxis), t.subtractToRef(this.lastDragPosition, this._tmpVector), r = S.Dot(this._tmpVector, this._worldDragAxis), this._worldDragAxis.scaleToRef(r, this._dragDelta)) : (r = this._dragDelta.length(), t.subtractToRef(this.lastDragPosition, this._dragDelta)), this._targetPosition.addInPlace(this._dragDelta), this.onDragObservable.notifyObservers({
        dragDistance: r,
        delta: this._dragDelta,
        dragPlanePoint: t,
        dragPlaneNormal: this._dragPlane.forward,
        pointerId: this.currentDraggingPointerId,
        pointerInfo: this._activePointerInfo
      }), this.lastDragPosition.copyFrom(t), Vs._RestorePivotPoint(this.attachedNode);
    }
  }
  _pickWithRayOnDragPlane(e) {
    if (!e)
      return null;
    let t = Math.acos(S.Dot(this._dragPlane.forward, e.direction));
    if (t > Math.PI / 2 && (t = Math.PI - t), this.maxDragAngle > 0 && t > this.maxDragAngle)
      if (this._useAlternatePickedPointAboveMaxDragAngle) {
        this._tmpVector.copyFrom(e.direction), this.attachedNode.absolutePosition.subtractToRef(e.origin, this._alternatePickedPoint), this._alternatePickedPoint.normalize(), this._alternatePickedPoint.scaleInPlace(this._useAlternatePickedPointAboveMaxDragAngleDragSpeed * S.Dot(this._alternatePickedPoint, this._tmpVector)), this._tmpVector.addInPlace(this._alternatePickedPoint);
        const f = S.Dot(this._dragPlane.forward, this._tmpVector);
        return this._dragPlane.forward.scaleToRef(-f, this._alternatePickedPoint), this._alternatePickedPoint.addInPlace(this._tmpVector), this._alternatePickedPoint.addInPlace(this.attachedNode.absolutePosition), this._alternatePickedPoint;
      } else
        return null;
    const r = this._dragPlane.forward, n = this._dragPlane.position, i = e.direction.dot(r);
    if (Math.abs(i) < Dn)
      return null;
    n.subtractToRef(e.origin, ue.Vector3[0]);
    const s = ue.Vector3[0].dot(r) / i;
    return s < 0 ? null : (e.direction.scaleToRef(s, ue.Vector3[0]), e.origin.add(ue.Vector3[0]));
  }
  // Position the drag plane based on the attached mesh position, for single axis rotate the plane along the axis to face the camera
  _updateDragPlanePosition(e, t) {
    this._pointA.copyFrom(t), this._options.dragAxis ? (this.useObjectOrientationForDragging ? S.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragAxis), e.origin.subtractToRef(this._pointA, this._pointC), this._pointC.normalize(), Math.abs(S.Dot(this._localAxis, this._pointC)) > 0.999 ? Math.abs(S.Dot(S.UpReadOnly, this._pointC)) > 0.999 ? this._lookAt.copyFrom(S.Right()) : this._lookAt.copyFrom(S.UpReadOnly) : (S.CrossToRef(this._localAxis, this._pointC, this._lookAt), S.CrossToRef(this._localAxis, this._lookAt, this._lookAt), this._lookAt.normalize()), this._dragPlane.position.copyFrom(this._pointA), this._pointA.addToRef(this._lookAt, this._lookAt), this._dragPlane.lookAt(this._lookAt)) : this._options.dragPlaneNormal ? (this.useObjectOrientationForDragging ? S.TransformCoordinatesToRef(this._options.dragPlaneNormal, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragPlaneNormal), this._dragPlane.position.copyFrom(this._pointA), this._pointA.addToRef(this._localAxis, this._lookAt), this._dragPlane.lookAt(this._lookAt)) : (this._dragPlane.position.copyFrom(this._pointA), this._dragPlane.lookAt(e.origin)), this._dragPlane.position.copyFrom(this.attachedNode.getAbsolutePosition()), this._dragPlane.computeWorldMatrix(!0);
  }
  /**
   *  Detaches the behavior from the mesh
   */
  detach() {
    this._lastPointerRay = {}, this.attachedNode && (this.attachedNode.isNearGrabbable = !1), this._pointerObserver && this._scene.onPointerObservable.remove(this._pointerObserver), this._beforeRenderObserver && this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver), this._dragPlane && this._dragPlane.dispose(), this.releaseDrag();
  }
}
O9._AnyMouseId = -2;
class x6e {
  /**
   * Instantiate a new behavior that when attached to a mesh will allow the mesh to be scaled
   */
  constructor() {
    this._startDistance = 0, this._initialScale = new S(0, 0, 0), this._targetScale = new S(0, 0, 0), this._sceneRenderObserver = null, this._dragBehaviorA = new O9({}), this._dragBehaviorA.moveAttached = !1, this._dragBehaviorB = new O9({}), this._dragBehaviorB.moveAttached = !1;
  }
  /**
   *  The name of the behavior
   */
  get name() {
    return "MultiPointerScale";
  }
  /**
   *  Initializes the behavior
   */
  init() {
  }
  _getCurrentDistance() {
    return this._dragBehaviorA.lastDragPosition.subtract(this._dragBehaviorB.lastDragPosition).length();
  }
  /**
   * Attaches the scale behavior the passed in mesh
   * @param ownerNode The mesh that will be scaled around once attached
   */
  attach(e) {
    this._ownerNode = e, this._dragBehaviorA.onDragStartObservable.add(() => {
      this._dragBehaviorA.dragging && this._dragBehaviorB.dragging && (this._dragBehaviorA.currentDraggingPointerId == this._dragBehaviorB.currentDraggingPointerId ? this._dragBehaviorA.releaseDrag() : (this._initialScale.copyFrom(e.scaling), this._startDistance = this._getCurrentDistance()));
    }), this._dragBehaviorB.onDragStartObservable.add(() => {
      this._dragBehaviorA.dragging && this._dragBehaviorB.dragging && (this._dragBehaviorA.currentDraggingPointerId == this._dragBehaviorB.currentDraggingPointerId ? this._dragBehaviorB.releaseDrag() : (this._initialScale.copyFrom(e.scaling), this._startDistance = this._getCurrentDistance()));
    }), [this._dragBehaviorA, this._dragBehaviorB].forEach((t) => {
      t.onDragObservable.add(() => {
        if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) {
          const r = this._getCurrentDistance() / this._startDistance;
          this._initialScale.scaleToRef(r, this._targetScale);
        }
      });
    }), e.addBehavior(this._dragBehaviorA), e.addBehavior(this._dragBehaviorB), this._sceneRenderObserver = e.getScene().onBeforeRenderObservable.add(() => {
      if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) {
        const t = this._targetScale.subtract(e.scaling).scaleInPlace(0.1);
        t.length() > 0.01 && e.scaling.addInPlace(t);
      }
    });
  }
  /**
   *  Detaches the behavior from the mesh
   */
  detach() {
    this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver), [this._dragBehaviorA, this._dragBehaviorB].forEach((e) => {
      e.onDragStartObservable.clear(), e.onDragObservable.clear(), this._ownerNode.removeBehavior(e);
    });
  }
}
class C2 {
  constructor() {
    this._attachedToElement = !1, this._virtualMeshesInfo = {}, this._tmpVector = new S(), this._tmpQuaternion = new Ze(), this._dragType = {
      NONE: 0,
      DRAG: 1,
      DRAG_WITH_CONTROLLER: 2,
      NEAR_DRAG: 3
    }, this._moving = !1, this._dragging = this._dragType.NONE, this.draggableMeshes = null, this.zDragFactor = 3, this.currentDraggingPointerIds = [], this.detachCameraControls = !0, this.onDragStartObservable = new Oe(), this.onDragObservable = new Oe(), this.onDragEndObservable = new Oe(), this.allowMultiPointer = !0;
  }
  /**
   * The id of the pointer that is currently interacting with the behavior (-1 when no pointer is active)
   */
  get currentDraggingPointerId() {
    return this.currentDraggingPointerIds[0] !== void 0 ? this.currentDraggingPointerIds[0] : -1;
  }
  set currentDraggingPointerId(e) {
    this.currentDraggingPointerIds[0] = e;
  }
  /**
   * Get or set the currentDraggingPointerId
   * @deprecated Please use currentDraggingPointerId instead
   */
  get currentDraggingPointerID() {
    return this.currentDraggingPointerId;
  }
  set currentDraggingPointerID(e) {
    this.currentDraggingPointerId = e;
  }
  /**
   *  The name of the behavior
   */
  get name() {
    return "BaseSixDofDrag";
  }
  /**
   *  Returns true if the attached mesh is currently moving with this behavior
   */
  get isMoving() {
    return this._moving;
  }
  /**
   *  Initializes the behavior
   */
  init() {
  }
  /**
   * In the case of multiple active cameras, the cameraToUseForPointers should be used if set instead of active camera
   */
  get _pointerCamera() {
    return this._scene.cameraToUseForPointers ? this._scene.cameraToUseForPointers : this._scene.activeCamera;
  }
  _createVirtualMeshInfo() {
    const e = new jn("", C2._virtualScene);
    e.rotationQuaternion = new Ze();
    const t = new jn("", C2._virtualScene);
    t.rotationQuaternion = new Ze();
    const r = new jn("", C2._virtualScene);
    return r.rotationQuaternion = new Ze(), {
      dragging: !1,
      moving: !1,
      dragMesh: e,
      originMesh: t,
      pivotMesh: r,
      startingPivotPosition: new S(),
      startingPivotOrientation: new Ze(),
      startingPosition: new S(),
      startingOrientation: new Ze(),
      lastOriginPosition: new S(),
      lastDragPosition: new S()
    };
  }
  _resetVirtualMeshesPosition() {
    for (let e = 0; e < this.currentDraggingPointerIds.length; e++)
      this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].pivotMesh.position.copyFrom(this._ownerNode.getAbsolutePivotPoint()), this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].pivotMesh.rotationQuaternion.copyFrom(this._ownerNode.rotationQuaternion), this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].startingPivotPosition.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].pivotMesh.position), this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].startingPivotOrientation.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].pivotMesh.rotationQuaternion), this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].startingPosition.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].dragMesh.position), this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].startingOrientation.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].dragMesh.rotationQuaternion);
  }
  _pointerUpdate2D(e, t, r) {
    this._pointerCamera && this._pointerCamera.cameraRigMode == Tr.RIG_MODE_NONE && !this._pointerCamera._isLeftCamera && !this._pointerCamera._isRightCamera && (e.origin.copyFrom(this._pointerCamera.globalPosition), r = 0);
    const n = this._virtualMeshesInfo[t], i = ue.Vector3[0];
    e.origin.subtractToRef(n.lastOriginPosition, i), n.lastOriginPosition.copyFrom(e.origin);
    const s = -S.Dot(i, e.direction);
    n.originMesh.addChild(n.dragMesh), n.originMesh.addChild(n.pivotMesh), this._applyZOffset(n.dragMesh, s, r), this._applyZOffset(n.pivotMesh, s, r), n.originMesh.position.copyFrom(e.origin);
    const a = ue.Vector3[0];
    e.origin.addToRef(e.direction, a), n.originMesh.lookAt(a), n.originMesh.removeChild(n.dragMesh), n.originMesh.removeChild(n.pivotMesh);
  }
  _pointerUpdateXR(e, t, r, n) {
    const i = this._virtualMeshesInfo[r];
    if (i.originMesh.position.copyFrom(e.position), this._dragging === this._dragType.NEAR_DRAG && t ? i.originMesh.rotationQuaternion.copyFrom(t.rotationQuaternion) : i.originMesh.rotationQuaternion.copyFrom(e.rotationQuaternion), i.pivotMesh.computeWorldMatrix(!0), i.dragMesh.computeWorldMatrix(!0), n !== 0) {
      const s = ue.Vector3[0], a = ue.Vector3[1];
      s.copyFrom(this._pointerCamera.getForwardRay().direction), i.originMesh.position.subtractToRef(i.lastOriginPosition, a), i.lastOriginPosition.copyFrom(i.originMesh.position);
      const f = a.length();
      a.normalize();
      const o = ue.Vector3[2], d = ue.Vector3[3];
      i.dragMesh.absolutePosition.subtractToRef(this._pointerCamera.globalPosition, o), i.dragMesh.absolutePosition.subtractToRef(i.originMesh.position, d);
      const v = d.length();
      o.normalize(), d.normalize();
      let l = Math.abs(S.Dot(a, d)) * S.Dot(a, s) * n * f * v;
      const P = 0.01;
      l < 0 && P - v > l && (l = Math.min(P - v, 0)), d.scaleInPlace(l), d.addToRef(i.pivotMesh.absolutePosition, this._tmpVector), i.pivotMesh.setAbsolutePosition(this._tmpVector), d.addToRef(i.dragMesh.absolutePosition, this._tmpVector), i.dragMesh.setAbsolutePosition(this._tmpVector);
    }
  }
  /**
   * Attaches the scale behavior the passed in mesh
   * @param ownerNode The mesh that will be scaled around once attached
   */
  attach(e) {
    this._ownerNode = e, this._scene = this._ownerNode.getScene(), C2._virtualScene || (C2._virtualScene = new sr(this._scene.getEngine(), { virtual: !0 }), C2._virtualScene.detachControl());
    const t = (r) => this._ownerNode === r || r.isDescendantOf(this._ownerNode) && (!this.draggableMeshes || this.draggableMeshes.indexOf(r) !== -1);
    this._pointerObserver = this._scene.onPointerObservable.add((r) => {
      const n = r.event.pointerId;
      this._virtualMeshesInfo[n] || (this._virtualMeshesInfo[n] = this._createVirtualMeshInfo());
      const i = this._virtualMeshesInfo[n], s = r.event.pointerType === "xr-near";
      if (r.type == ir.POINTERDOWN) {
        if (!i.dragging && r.pickInfo && r.pickInfo.hit && r.pickInfo.pickedMesh && r.pickInfo.pickedPoint && r.pickInfo.ray && (!s || r.pickInfo.aimTransform) && t(r.pickInfo.pickedMesh)) {
          if (!this.allowMultiPointer && this.currentDraggingPointerIds.length > 0)
            return;
          this._pointerCamera && this._pointerCamera.cameraRigMode === Tr.RIG_MODE_NONE && !this._pointerCamera._isLeftCamera && !this._pointerCamera._isRightCamera && r.pickInfo.ray.origin.copyFrom(this._pointerCamera.globalPosition), this._ownerNode.computeWorldMatrix(!0);
          const a = this._virtualMeshesInfo[n];
          s ? (this._dragging = r.pickInfo.originMesh ? this._dragType.NEAR_DRAG : this._dragType.DRAG_WITH_CONTROLLER, a.originMesh.position.copyFrom(r.pickInfo.aimTransform.position), this._dragging === this._dragType.NEAR_DRAG && r.pickInfo.gripTransform ? a.originMesh.rotationQuaternion.copyFrom(r.pickInfo.gripTransform.rotationQuaternion) : a.originMesh.rotationQuaternion.copyFrom(r.pickInfo.aimTransform.rotationQuaternion)) : (this._dragging = this._dragType.DRAG, a.originMesh.position.copyFrom(r.pickInfo.ray.origin)), a.lastOriginPosition.copyFrom(a.originMesh.position), a.dragMesh.position.copyFrom(r.pickInfo.pickedPoint), a.lastDragPosition.copyFrom(r.pickInfo.pickedPoint), a.pivotMesh.position.copyFrom(this._ownerNode.getAbsolutePivotPoint()), a.pivotMesh.rotationQuaternion.copyFrom(this._ownerNode.absoluteRotationQuaternion), a.startingPosition.copyFrom(a.dragMesh.position), a.startingPivotPosition.copyFrom(a.pivotMesh.position), a.startingOrientation.copyFrom(a.dragMesh.rotationQuaternion), a.startingPivotOrientation.copyFrom(a.pivotMesh.rotationQuaternion), s ? (a.originMesh.addChild(a.dragMesh), a.originMesh.addChild(a.pivotMesh)) : a.originMesh.lookAt(a.dragMesh.position), a.dragging = !0, this.currentDraggingPointerIds.indexOf(n) === -1 && this.currentDraggingPointerIds.push(n), this.detachCameraControls && this._pointerCamera && !this._pointerCamera.leftCamera && (this._pointerCamera.inputs && this._pointerCamera.inputs.attachedToElement ? (this._pointerCamera.detachControl(), this._attachedToElement = !0) : this._attachedToElement = !1), this._targetDragStart(a.pivotMesh.position, a.pivotMesh.rotationQuaternion, n), this.onDragStartObservable.notifyObservers({ position: a.pivotMesh.position });
        }
      } else if (r.type == ir.POINTERUP || r.type == ir.POINTERDOUBLETAP) {
        const a = this.currentDraggingPointerIds.indexOf(n);
        i.dragging = !1, a !== -1 && (this.currentDraggingPointerIds.splice(a, 1), this.currentDraggingPointerIds.length === 0 && (this._moving = !1, this._dragging = this._dragType.NONE, this.detachCameraControls && this._attachedToElement && this._pointerCamera && !this._pointerCamera.leftCamera && (this._reattachCameraControls(), this._attachedToElement = !1)), i.originMesh.removeChild(i.dragMesh), i.originMesh.removeChild(i.pivotMesh), this._targetDragEnd(n), this.onDragEndObservable.notifyObservers({}));
      } else if (r.type == ir.POINTERMOVE && this.currentDraggingPointerIds.indexOf(n) !== -1 && i.dragging && r.pickInfo && (r.pickInfo.ray || r.pickInfo.aimTransform)) {
        let f = this.zDragFactor;
        (this.currentDraggingPointerIds.length > 1 || r.pickInfo.originMesh) && (f = 0), this._ownerNode.computeWorldMatrix(!0), s ? this._pointerUpdateXR(r.pickInfo.aimTransform, r.pickInfo.gripTransform, n, f) : this._pointerUpdate2D(r.pickInfo.ray, n, f), this._tmpQuaternion.copyFrom(i.startingPivotOrientation), this._tmpQuaternion.x = -this._tmpQuaternion.x, this._tmpQuaternion.y = -this._tmpQuaternion.y, this._tmpQuaternion.z = -this._tmpQuaternion.z, i.pivotMesh.absoluteRotationQuaternion.multiplyToRef(this._tmpQuaternion, this._tmpQuaternion), i.pivotMesh.absolutePosition.subtractToRef(i.startingPivotPosition, this._tmpVector), this.onDragObservable.notifyObservers({ delta: this._tmpVector, position: i.pivotMesh.position, pickInfo: r.pickInfo }), this._targetDrag(this._tmpVector, this._tmpQuaternion, n), i.lastDragPosition.copyFrom(i.dragMesh.absolutePosition), this._moving = !0;
      }
    });
  }
  _applyZOffset(e, t, r) {
    e.position.z -= e.position.z < 1 ? t * r : t * r * e.position.z, e.position.z < 0 && (e.position.z = 0);
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _targetDragStart(e, t, r) {
  }
  _targetDrag(e, t, r) {
  }
  _targetDragEnd(e) {
  }
  _reattachCameraControls() {
    if (this._pointerCamera)
      if (this._pointerCamera.getClassName() === "ArcRotateCamera") {
        const e = this._pointerCamera;
        e.attachControl(e.inputs ? e.inputs.noPreventDefault : !0, e._useCtrlForPanning, e._panningMouseButton);
      } else
        this._pointerCamera.attachControl(this._pointerCamera.inputs ? this._pointerCamera.inputs.noPreventDefault : !0);
  }
  /**
   * Detaches the behavior from the mesh
   */
  detach() {
    this._scene && (this.detachCameraControls && this._attachedToElement && this._pointerCamera && !this._pointerCamera.leftCamera && (this._reattachCameraControls(), this._attachedToElement = !1), this._scene.onPointerObservable.remove(this._pointerObserver));
    for (const e in this._virtualMeshesInfo)
      this._virtualMeshesInfo[e].originMesh.dispose(), this._virtualMeshesInfo[e].dragMesh.dispose();
    this.onDragEndObservable.clear(), this.onDragObservable.clear(), this.onDragStartObservable.clear();
  }
}
class Hee extends C2 {
  constructor() {
    super(...arguments), this._sceneRenderObserver = null, this._targetPosition = new S(0, 0, 0), this._targetOrientation = new Ze(), this._targetScaling = new S(1, 1, 1), this._startingPosition = new S(0, 0, 0), this._startingOrientation = new Ze(), this._startingScaling = new S(1, 1, 1), this.onPositionChangedObservable = new Oe(), this.dragDeltaRatio = 0.2, this.rotateDraggedObject = !0, this.rotateAroundYOnly = !1, this.rotateWithMotionController = !0, this.disableMovement = !1, this.faceCameraOnDragStart = !1;
  }
  /**
   *  The name of the behavior
   */
  get name() {
    return "SixDofDrag";
  }
  /**
   * Attaches the six DoF drag behavior
   * @param ownerNode The mesh that will be dragged around once attached
   */
  attach(e) {
    super.attach(e), e.isNearGrabbable = !0, this._virtualTransformNode = new Hr("virtual_sixDof", C2._virtualScene), this._virtualTransformNode.rotationQuaternion = Ze.Identity(), this._sceneRenderObserver = e.getScene().onBeforeRenderObservable.add(() => {
      if (this.currentDraggingPointerIds.length === 1 && this._moving && !this.disableMovement) {
        const t = e.parent;
        e.setParent(null), e.position.addInPlace(this._targetPosition.subtract(e.position).scale(this.dragDeltaRatio)), this.onPositionChangedObservable.notifyObservers({ position: e.absolutePosition }), (!t || t.scaling && !t.scaling.isNonUniformWithinEpsilon(1e-3)) && Ze.SlerpToRef(e.rotationQuaternion, this._targetOrientation, this.dragDeltaRatio, e.rotationQuaternion), e.setParent(t);
      }
    });
  }
  _getPositionOffsetAround(e, t, r) {
    const n = ue.Matrix[0], i = ue.Matrix[1], s = ue.Matrix[2], a = ue.Matrix[3], f = ue.Matrix[4];
    return he.TranslationToRef(e.x, e.y, e.z, n), he.TranslationToRef(-e.x, -e.y, -e.z, i), he.FromQuaternionToRef(r, s), he.ScalingToRef(t, t, t, a), i.multiplyToRef(s, f), f.multiplyToRef(a, f), f.multiplyToRef(n, f), f.getTranslation();
  }
  _onePointerPositionUpdated(e, t) {
    ue.Vector3[0].setAll(0), this._dragging === this._dragType.DRAG ? this.rotateDraggedObject && (this.rotateAroundYOnly ? Ze.RotationYawPitchRollToRef(t.toEulerAngles().y, 0, 0, ue.Quaternion[0]) : ue.Quaternion[0].copyFrom(t), ue.Quaternion[0].multiplyToRef(this._startingOrientation, this._targetOrientation)) : (this._dragging === this._dragType.NEAR_DRAG || this._dragging === this._dragType.DRAG_WITH_CONTROLLER && this.rotateWithMotionController) && t.multiplyToRef(this._startingOrientation, this._targetOrientation), this._targetPosition.copyFrom(this._startingPosition).addInPlace(e);
  }
  _twoPointersPositionUpdated() {
    const e = this._virtualMeshesInfo[this.currentDraggingPointerIds[0]].startingPosition, t = this._virtualMeshesInfo[this.currentDraggingPointerIds[1]].startingPosition, r = ue.Vector3[0];
    e.addToRef(t, r), r.scaleInPlace(0.5);
    const n = ue.Vector3[1];
    t.subtractToRef(e, n);
    const i = this._virtualMeshesInfo[this.currentDraggingPointerIds[0]].dragMesh.absolutePosition, s = this._virtualMeshesInfo[this.currentDraggingPointerIds[1]].dragMesh.absolutePosition, a = ue.Vector3[2];
    i.addToRef(s, a), a.scaleInPlace(0.5);
    const f = ue.Vector3[3];
    s.subtractToRef(i, f);
    const o = f.length() / n.length(), d = a.subtract(r), v = Ze.FromEulerAngles(0, S.GetAngleBetweenVectorsOnPlane(n.normalize(), f.normalize(), S.UpReadOnly), 0), u = this._ownerNode.parent;
    this._ownerNode.setParent(null);
    const l = this._getPositionOffsetAround(r.subtract(this._virtualTransformNode.getAbsolutePivotPoint()), o, v);
    this._virtualTransformNode.rotationQuaternion.multiplyToRef(v, this._ownerNode.rotationQuaternion), this._virtualTransformNode.scaling.scaleToRef(o, this._ownerNode.scaling), this._virtualTransformNode.position.addToRef(d.addInPlace(l), this._ownerNode.position), this.onPositionChangedObservable.notifyObservers({ position: this._ownerNode.position }), this._ownerNode.setParent(u);
  }
  _targetDragStart() {
    const e = this.currentDraggingPointerIds.length, t = this._ownerNode.parent;
    this._ownerNode.rotationQuaternion || (this._ownerNode.rotationQuaternion = Ze.RotationYawPitchRoll(this._ownerNode.rotation.y, this._ownerNode.rotation.x, this._ownerNode.rotation.z));
    const r = this._ownerNode.getAbsolutePivotPoint();
    if (this._ownerNode.setParent(null), e === 1) {
      if (this._targetPosition.copyFrom(this._ownerNode.position), this._targetOrientation.copyFrom(this._ownerNode.rotationQuaternion), this._targetScaling.copyFrom(this._ownerNode.scaling), this.faceCameraOnDragStart && this._scene.activeCamera) {
        const n = ue.Vector3[0];
        this._scene.activeCamera.position.subtractToRef(r, n), n.normalize();
        const i = ue.Quaternion[0];
        this._scene.useRightHandedSystem ? Ze.FromLookDirectionRHToRef(n, new S(0, 1, 0), i) : Ze.FromLookDirectionLHToRef(n, new S(0, 1, 0), i), i.normalize(), Ze.RotationYawPitchRollToRef(i.toEulerAngles().y, 0, 0, ue.Quaternion[0]), this._targetOrientation.copyFrom(ue.Quaternion[0]);
      }
      this._startingPosition.copyFrom(this._targetPosition), this._startingOrientation.copyFrom(this._targetOrientation), this._startingScaling.copyFrom(this._targetScaling);
    } else
      e === 2 && (this._virtualTransformNode.setPivotPoint(new S(0, 0, 0), ai.LOCAL), this._virtualTransformNode.position.copyFrom(this._ownerNode.position), this._virtualTransformNode.scaling.copyFrom(this._ownerNode.scaling), this._virtualTransformNode.rotationQuaternion.copyFrom(this._ownerNode.rotationQuaternion), this._virtualTransformNode.setPivotPoint(r, ai.WORLD), this._resetVirtualMeshesPosition());
    this._ownerNode.setParent(t);
  }
  _targetDrag(e, t) {
    this.currentDraggingPointerIds.length === 1 ? this._onePointerPositionUpdated(e, t) : this.currentDraggingPointerIds.length === 2 && this._twoPointersPositionUpdated();
  }
  _targetDragEnd() {
    if (this.currentDraggingPointerIds.length === 1) {
      this._resetVirtualMeshesPosition();
      const e = this.faceCameraOnDragStart;
      this.faceCameraOnDragStart = !1, this._targetDragStart(), this.faceCameraOnDragStart = e;
    }
  }
  /**
   *  Detaches the behavior from the mesh
   */
  detach() {
    super.detach(), this._ownerNode && (this._ownerNode.isNearGrabbable = !1, this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver)), this._virtualTransformNode && this._virtualTransformNode.dispose();
  }
}
class D6e {
  constructor() {
    this._attachPointLocalOffset = new S(), this._workingPosition = new S(), this._workingQuaternion = new Ze(), this._lastTick = -1, this._hit = !1, this.hitNormalOffset = 0.05, this.meshes = [], this.interpolatePose = !0, this.lerpTime = 250, this.keepOrientationVertical = !0, this.enabled = !0, this.maxStickingDistance = 0.8;
  }
  /**
   * Name of the behavior
   */
  get name() {
    return "SurfaceMagnetism";
  }
  /**
   * Function called when the behavior needs to be initialized (after attaching it to a target)
   */
  init() {
  }
  /**
   * Attaches the behavior to a transform node
   * @param target defines the target where the behavior is attached to
   * @param scene the scene
   */
  attach(e, t) {
    this._attachedMesh = e, this._scene = t || e.getScene(), this._attachedMesh.rotationQuaternion || (this._attachedMesh.rotationQuaternion = Ze.RotationYawPitchRoll(this._attachedMesh.rotation.y, this._attachedMesh.rotation.x, this._attachedMesh.rotation.z)), this.updateAttachPoint(), this._workingPosition.copyFrom(this._attachedMesh.position), this._workingQuaternion.copyFrom(this._attachedMesh.rotationQuaternion), this._addObservables();
  }
  /**
   * Detaches the behavior
   */
  detach() {
    this._attachedMesh = null, this._removeObservables();
  }
  _getTargetPose(e) {
    if (!this._attachedMesh)
      return null;
    if (e && e.hit) {
      const t = e.getNormal(!0, !0), r = e.pickedPoint;
      if (!t || !r)
        return null;
      t.normalize();
      const n = ue.Vector3[0];
      return n.copyFrom(t), n.scaleInPlace(this.hitNormalOffset), n.addInPlace(r), this._attachedMesh.parent && (ue.Matrix[0].copyFrom(this._attachedMesh.parent.getWorldMatrix()).invert(), S.TransformNormalToRef(n, ue.Matrix[0], n)), {
        position: n,
        quaternion: Ze.RotationYawPitchRoll(-Math.atan2(t.x, -t.z), this.keepOrientationVertical ? 0 : Math.atan2(t.y, Math.sqrt(t.z * t.z + t.x * t.x)), 0)
      };
    }
    return null;
  }
  /**
   * Updates the attach point with the current geometry extents of the attached mesh
   */
  updateAttachPoint() {
    this._getAttachPointOffsetToRef(this._attachPointLocalOffset);
  }
  /**
   * Finds the intersection point of the given ray onto the meshes and updates the target.
   * Transformation will be interpolated according to `interpolatePose` and `lerpTime` properties.
   * If no mesh of `meshes` are hit, this does nothing.
   * @param pickInfo The input pickingInfo that will be used to intersect the meshes
   * @returns a boolean indicating if we found a hit to stick to
   */
  findAndUpdateTarget(e) {
    if (this._hit = !1, !e.ray)
      return !1;
    const t = e.ray.intersectsMeshes(this.meshes)[0];
    if (this._attachedMesh && t && t.hit && t.pickedMesh) {
      const r = this._getTargetPose(t);
      r && S.Distance(this._attachedMesh.position, r.position) < this.maxStickingDistance && (this._workingPosition.copyFrom(r.position), this._workingQuaternion.copyFrom(r.quaternion), this._hit = !0);
    }
    return this._hit;
  }
  _getAttachPointOffsetToRef(e) {
    if (!this._attachedMesh) {
      e.setAll(0);
      return;
    }
    const t = ue.Quaternion[0];
    t.copyFrom(this._attachedMesh.rotationQuaternion), this._attachedMesh.rotationQuaternion.copyFromFloats(0, 0, 0, 1), this._attachedMesh.computeWorldMatrix();
    const r = this._attachedMesh.getHierarchyBoundingVectors(), n = ue.Vector3[0];
    r.max.addToRef(r.min, n), n.scaleInPlace(0.5), n.z = r.max.z;
    const i = ue.Matrix[0];
    this._attachedMesh.getWorldMatrix().invertToRef(i), S.TransformCoordinatesToRef(n, i, e), this._attachedMesh.rotationQuaternion.copyFrom(t);
  }
  _updateTransformToGoal(e) {
    if (!this._attachedMesh || !this._hit)
      return;
    const t = this._attachedMesh.parent;
    this._attachedMesh.setParent(null);
    const r = ue.Vector3[0];
    if (S.TransformNormalToRef(this._attachPointLocalOffset, this._attachedMesh.getWorldMatrix(), r), !this.interpolatePose) {
      this._attachedMesh.position.copyFrom(this._workingPosition).subtractInPlace(r), this._attachedMesh.rotationQuaternion.copyFrom(this._workingQuaternion);
      return;
    }
    const n = new S();
    S.SmoothToRef(this._attachedMesh.position, this._workingPosition, e, this.lerpTime, n), this._attachedMesh.position.copyFrom(n);
    const i = new Ze();
    i.copyFrom(this._attachedMesh.rotationQuaternion), Ze.SmoothToRef(i, this._workingQuaternion, e, this.lerpTime, this._attachedMesh.rotationQuaternion), this._attachedMesh.setParent(t);
  }
  _addObservables() {
    this._pointerObserver = this._scene.onPointerObservable.add((e) => {
      this.enabled && e.type == ir.POINTERMOVE && e.pickInfo && this.findAndUpdateTarget(e.pickInfo);
    }), this._lastTick = Date.now(), this._onBeforeRender = this._scene.onBeforeRenderObservable.add(() => {
      const e = Date.now();
      this._updateTransformToGoal(e - this._lastTick), this._lastTick = e;
    });
  }
  _removeObservables() {
    this._scene.onPointerObservable.remove(this._pointerObserver), this._scene.onBeforeRenderObservable.remove(this._onBeforeRender), this._pointerObserver = null, this._onBeforeRender = null;
  }
}
class j6e {
  constructor() {
    this._tmpQuaternion = new Ze(), this._tmpVectors = [new S(), new S(), new S(), new S(), new S(), new S(), new S()], this._tmpMatrix = new he(), this._tmpInvertView = new he(), this._tmpForward = new S(), this._tmpNodeForward = new S(), this._tmpPosition = new S(), this._workingPosition = new S(), this._workingQuaternion = new Ze(), this._lastTick = -1, this._recenterNextUpdate = !0, this.interpolatePose = !0, this.lerpTime = 500, this.ignoreCameraPitchAndRoll = !1, this.pitchOffset = 15, this.maxViewVerticalDegrees = 30, this.maxViewHorizontalDegrees = 30, this.orientToCameraDeadzoneDegrees = 60, this.ignoreDistanceClamp = !1, this.ignoreAngleClamp = !1, this.verticalMaxDistance = 0, this.defaultDistance = 0.8, this.maximumDistance = 2, this.minimumDistance = 0.3, this.useFixedVerticalOffset = !1, this.fixedVerticalOffset = 0, this._enabled = !0;
  }
  /**
   * The camera that should be followed by this behavior
   */
  get followedCamera() {
    return this._followedCamera || this._scene.activeCamera;
  }
  set followedCamera(e) {
    this._followedCamera = e;
  }
  /**
   *  The name of the behavior
   */
  get name() {
    return "Follow";
  }
  /**
   *  Initializes the behavior
   */
  init() {
  }
  /**
   * Attaches the follow behavior
   * @param ownerNode The mesh that will be following once attached
   * @param followedCamera The camera that should be followed by the node
   */
  attach(e, t) {
    this._scene = e.getScene(), this.attachedNode = e, t && (this.followedCamera = t), this._addObservables();
  }
  /**
   *  Detaches the behavior from the mesh
   */
  detach() {
    this.attachedNode = null, this._removeObservables();
  }
  /**
   * Recenters the attached node in front of the camera on the next update
   */
  recenter() {
    this._recenterNextUpdate = !0;
  }
  _angleBetweenVectorAndPlane(e, t) {
    return this._tmpVectors[0].copyFrom(e), e = this._tmpVectors[0], this._tmpVectors[1].copyFrom(t), t = this._tmpVectors[1], e.normalize(), t.normalize(), Math.PI / 2 - Math.acos(S.Dot(e, t));
  }
  _length2D(e) {
    return Math.sqrt(e.x * e.x + e.z * e.z);
  }
  _distanceClamp(e, t = !1) {
    let r = this.minimumDistance, n = this.maximumDistance;
    const i = this.defaultDistance, s = this._tmpVectors[0];
    s.copyFrom(e);
    let a = s.length();
    if (s.normalizeFromLength(a), this.ignoreCameraPitchAndRoll) {
      r = this._length2D(s) * r, n = this._length2D(s) * n;
      const o = this._length2D(e);
      s.scaleInPlace(a / o), a = o;
    }
    let f = a;
    return t ? f = i : f = Xt.Clamp(a, r, n), e.copyFrom(s).scaleInPlace(f), a !== f;
  }
  _applyVerticalClamp(e) {
    this.verticalMaxDistance !== 0 && (e.y = Xt.Clamp(e.y, -this.verticalMaxDistance, this.verticalMaxDistance));
  }
  _toOrientationQuatToRef(e, t) {
    Ze.RotationYawPitchRollToRef(Math.atan2(e.x, e.z), Math.atan2(e.y, Math.sqrt(e.z * e.z + e.x * e.x)), 0, t);
  }
  _applyPitchOffset(e) {
    const t = this._tmpVectors[0], r = this._tmpVectors[1];
    t.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1), r.copyFromFloats(1, 0, 0), S.TransformNormalToRef(t, e, t), t.y = 0, t.normalize(), S.TransformNormalToRef(r, e, r), Ze.RotationAxisToRef(r, this.pitchOffset * Math.PI / 180, this._tmpQuaternion), t.rotateByQuaternionToRef(this._tmpQuaternion, t), this._toOrientationQuatToRef(t, this._tmpQuaternion), this._tmpQuaternion.toRotationMatrix(this._tmpMatrix), e.copyFrom(this._tmpMatrix);
  }
  _angularClamp(e, t) {
    const r = this._tmpVectors[5];
    r.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1);
    const n = this._tmpVectors[6];
    n.copyFromFloats(1, 0, 0), S.TransformNormalToRef(r, e, r), S.TransformNormalToRef(n, e, n);
    const i = S.UpReadOnly;
    if (t.length() < Dn)
      return !1;
    let a = !1;
    const f = this._tmpQuaternion;
    if (this.ignoreCameraPitchAndRoll) {
      const v = S.GetAngleBetweenVectorsOnPlane(t, r, n);
      Ze.RotationAxisToRef(n, v, f), t.rotateByQuaternionToRef(f, t);
    } else {
      const v = -S.GetAngleBetweenVectorsOnPlane(t, r, n), u = this.maxViewVerticalDegrees * Math.PI / 180 * 0.5;
      v < -u ? (Ze.RotationAxisToRef(n, -v - u, f), t.rotateByQuaternionToRef(f, t), a = !0) : v > u && (Ze.RotationAxisToRef(n, -v + u, f), t.rotateByQuaternionToRef(f, t), a = !0);
    }
    const o = this._angleBetweenVectorAndPlane(t, n) * (this._scene.useRightHandedSystem ? -1 : 1), d = this.maxViewHorizontalDegrees * Math.PI / 180 * 0.5;
    return o < -d ? (Ze.RotationAxisToRef(i, -o - d, f), t.rotateByQuaternionToRef(f, t), a = !0) : o > d && (Ze.RotationAxisToRef(i, -o + d, f), t.rotateByQuaternionToRef(f, t), a = !0), a;
  }
  _orientationClamp(e, t) {
    var r;
    const n = this._tmpVectors[0];
    n.copyFrom(e).scaleInPlace(-1).normalize();
    const i = this._tmpVectors[1], s = this._tmpVectors[2];
    i.copyFromFloats(0, 1, 0), S.CrossToRef(n, i, s);
    const a = s.length();
    a < Dn || (s.normalizeFromLength(a), S.CrossToRef(s, n, i), !((r = this.attachedNode) === null || r === void 0) && r.getScene().useRightHandedSystem ? Ze.FromLookDirectionRHToRef(n, i, t) : Ze.FromLookDirectionLHToRef(n, i, t));
  }
  _passedOrientationDeadzone(e, t) {
    const r = this._tmpVectors[5];
    return r.copyFrom(e), r.normalize(), Math.abs(S.GetAngleBetweenVectorsOnPlane(t, r, S.UpReadOnly)) * 180 / Math.PI > this.orientToCameraDeadzoneDegrees;
  }
  _updateLeashing(e) {
    if (this.attachedNode && this._enabled) {
      const t = this.attachedNode.parent;
      this.attachedNode.setParent(null);
      const r = this.attachedNode.getWorldMatrix(), n = this._workingPosition, i = this._workingQuaternion, s = this.attachedNode.getPivotPoint(), a = this._tmpInvertView;
      a.copyFrom(e.getViewMatrix()), a.invert(), S.TransformCoordinatesToRef(s, r, n);
      const f = this._tmpPosition;
      f.copyFromFloats(0, 0, 0), S.TransformCoordinatesToRef(f, r, f), f.scaleInPlace(-1).subtractInPlace(s), n.subtractInPlace(e.globalPosition), this.ignoreCameraPitchAndRoll && this._applyPitchOffset(a);
      let o = !1;
      const d = this._tmpForward;
      d.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1), S.TransformNormalToRef(d, a, d);
      const v = this._tmpNodeForward;
      if (v.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1), S.TransformNormalToRef(v, r, v), this._recenterNextUpdate)
        n.copyFrom(d).scaleInPlace(this.defaultDistance);
      else if (this.ignoreAngleClamp) {
        const l = n.length();
        n.copyFrom(d).scaleInPlace(l);
      } else
        o = this._angularClamp(a, n);
      let u = !1;
      this.ignoreDistanceClamp || (u = this._distanceClamp(n, o), this._applyVerticalClamp(n)), this.useFixedVerticalOffset && (n.y = f.y - e.globalPosition.y + this.fixedVerticalOffset), (o || u || this._passedOrientationDeadzone(n, v) || this._recenterNextUpdate) && this._orientationClamp(n, i), this._workingPosition.subtractInPlace(s), this._recenterNextUpdate = !1, this.attachedNode.setParent(t);
    }
  }
  _updateTransformToGoal(e) {
    if (!this.attachedNode || !this.followedCamera || !this._enabled)
      return;
    this.attachedNode.rotationQuaternion || (this.attachedNode.rotationQuaternion = Ze.Identity());
    const t = this.attachedNode.parent;
    if (this.attachedNode.setParent(null), !this.interpolatePose) {
      this.attachedNode.position.copyFrom(this.followedCamera.globalPosition).addInPlace(this._workingPosition), this.attachedNode.rotationQuaternion.copyFrom(this._workingQuaternion);
      return;
    }
    const r = new S();
    r.copyFrom(this.attachedNode.position).subtractInPlace(this.followedCamera.globalPosition), S.SmoothToRef(r, this._workingPosition, e, this.lerpTime, r), r.addInPlace(this.followedCamera.globalPosition), this.attachedNode.position.copyFrom(r);
    const n = new Ze();
    n.copyFrom(this.attachedNode.rotationQuaternion), Ze.SmoothToRef(n, this._workingQuaternion, e, this.lerpTime, this.attachedNode.rotationQuaternion), this.attachedNode.setParent(t);
  }
  _addObservables() {
    this._lastTick = Date.now(), this._onBeforeRender = this._scene.onBeforeRenderObservable.add(() => {
      if (!this.followedCamera)
        return;
      const e = Date.now();
      this._updateLeashing(this.followedCamera), this._updateTransformToGoal(e - this._lastTick), this._lastTick = e;
    });
  }
  _removeObservables() {
    this._onBeforeRender && this._scene.onBeforeRenderObservable.remove(this._onBeforeRender);
  }
}
class Gi {
}
Gi.ANCHOR_SYSTEM = "xr-anchor-system";
Gi.BACKGROUND_REMOVER = "xr-background-remover";
Gi.HIT_TEST = "xr-hit-test";
Gi.MESH_DETECTION = "xr-mesh-detection";
Gi.PHYSICS_CONTROLLERS = "xr-physics-controller";
Gi.PLANE_DETECTION = "xr-plane-detection";
Gi.POINTER_SELECTION = "xr-controller-pointer-selection";
Gi.TELEPORTATION = "xr-controller-teleportation";
Gi.FEATURE_POINTS = "xr-feature-points";
Gi.HAND_TRACKING = "xr-hand-tracking";
Gi.IMAGE_TRACKING = "xr-image-tracking";
Gi.NEAR_INTERACTION = "xr-near-interaction";
Gi.DOM_OVERLAY = "xr-dom-overlay";
Gi.MOVEMENT = "xr-controller-movement";
Gi.LIGHT_ESTIMATION = "xr-light-estimation";
Gi.EYE_TRACKING = "xr-eye-tracking";
Gi.WALKING_LOCOMOTION = "xr-walking-locomotion";
Gi.LAYERS = "xr-layers";
Gi.DEPTH_SENSING = "xr-depth-sensing";
Gi.SPACE_WARP = "xr-space-warp";
Gi.RAW_CAMERA_ACCESS = "xr-raw-camera-access";
class So {
  /**
   * constructs a new features manages.
   *
   * @param _xrSessionManager an instance of WebXRSessionManager
   */
  constructor(e) {
    this._xrSessionManager = e, this._features = {}, this._xrSessionManager.onXRSessionInit.add(() => {
      this.getEnabledFeatures().forEach((t) => {
        const r = this._features[t];
        r.enabled && !r.featureImplementation.attached && !r.featureImplementation.disableAutoAttach && this.attachFeature(t);
      });
    }), this._xrSessionManager.onXRSessionEnded.add(() => {
      this.getEnabledFeatures().forEach((t) => {
        const r = this._features[t];
        r.enabled && r.featureImplementation.attached && this.detachFeature(t);
      });
    });
  }
  /**
   * Used to register a module. After calling this function a developer can use this feature in the scene.
   * Mainly used internally.
   *
   * @param featureName the name of the feature to register
   * @param constructorFunction the function used to construct the module
   * @param version the (babylon) version of the module
   * @param stable is that a stable version of this module
   */
  static AddWebXRFeature(e, t, r = 1, n = !1) {
    this._AvailableFeatures[e] = this._AvailableFeatures[e] || { latest: r }, r > this._AvailableFeatures[e].latest && (this._AvailableFeatures[e].latest = r), n && (this._AvailableFeatures[e].stable = r), this._AvailableFeatures[e][r] = t;
  }
  /**
   * Returns a constructor of a specific feature.
   *
   * @param featureName the name of the feature to construct
   * @param version the version of the feature to load
   * @param xrSessionManager the xrSessionManager. Used to construct the module
   * @param options optional options provided to the module.
   * @returns a function that, when called, will return a new instance of this feature
   */
  static ConstructFeature(e, t = 1, r, n) {
    const i = this._AvailableFeatures[e][t];
    if (!i)
      throw new Error("feature not found");
    return i(r, n);
  }
  /**
   * Can be used to return the list of features currently registered
   *
   * @returns an Array of available features
   */
  static GetAvailableFeatures() {
    return Object.keys(this._AvailableFeatures);
  }
  /**
   * Gets the versions available for a specific feature
   * @param featureName the name of the feature
   * @returns an array with the available versions
   */
  static GetAvailableVersions(e) {
    return Object.keys(this._AvailableFeatures[e]);
  }
  /**
   * Return the latest unstable version of this feature
   * @param featureName the name of the feature to search
   * @returns the version number. if not found will return -1
   */
  static GetLatestVersionOfFeature(e) {
    return this._AvailableFeatures[e] && this._AvailableFeatures[e].latest || -1;
  }
  /**
   * Return the latest stable version of this feature
   * @param featureName the name of the feature to search
   * @returns the version number. if not found will return -1
   */
  static GetStableVersionOfFeature(e) {
    return this._AvailableFeatures[e] && this._AvailableFeatures[e].stable || -1;
  }
  /**
   * Attach a feature to the current session. Mainly used when session started to start the feature effect.
   * Can be used during a session to start a feature
   * @param featureName the name of feature to attach
   */
  attachFeature(e) {
    const t = this._features[e];
    t && t.enabled && !t.featureImplementation.attached && t.featureImplementation.attach();
  }
  /**
   * Can be used inside a session or when the session ends to detach a specific feature
   * @param featureName the name of the feature to detach
   */
  detachFeature(e) {
    const t = this._features[e];
    t && t.featureImplementation.attached && t.featureImplementation.detach();
  }
  /**
   * Used to disable an already-enabled feature
   * The feature will be disposed and will be recreated once enabled.
   * @param featureName the feature to disable
   * @returns true if disable was successful
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  disableFeature(e) {
    const t = typeof e == "string" ? e : e.Name, r = this._features[t];
    return r && r.enabled ? (r.enabled = !1, this.detachFeature(t), r.featureImplementation.dispose(), delete this._features[t], !0) : !1;
  }
  /**
   * dispose this features manager
   */
  dispose() {
    this.getEnabledFeatures().forEach((e) => {
      this.disableFeature(e);
    });
  }
  /**
   * Enable a feature using its name and a version. This will enable it in the scene, and will be responsible to attach it when the session starts.
   * If used twice, the old version will be disposed and a new one will be constructed. This way you can re-enable with different configuration.
   *
   * @param featureName the name of the feature to load or the class of the feature
   * @param version optional version to load. if not provided the latest version will be enabled
   * @param moduleOptions options provided to the module. Ses the module documentation / constructor
   * @param attachIfPossible if set to true (default) the feature will be automatically attached, if it is currently possible
   * @param required is this feature required to the app. If set to true the session init will fail if the feature is not available.
   * @returns a new constructed feature or throws an error if feature not found or conflicts with another enabled feature.
   */
  enableFeature(e, t = "latest", r = {}, n = !0, i = !0) {
    const s = typeof e == "string" ? e : e.Name;
    let a = 0;
    if (typeof t == "string") {
      if (!t)
        throw new Error(`Error in provided version - ${s} (${t})`);
      if (t === "stable" ? a = So.GetStableVersionOfFeature(s) : t === "latest" ? a = So.GetLatestVersionOfFeature(s) : a = +t, a === -1 || isNaN(a))
        throw new Error(`feature not found - ${s} (${t})`);
    } else
      a = t;
    const f = So._ConflictingFeatures[s];
    if (f !== void 0 && this.getEnabledFeatures().indexOf(f) !== -1)
      throw new Error(`Feature ${s} cannot be enabled while ${f} is enabled.`);
    const o = this._features[s], d = So.ConstructFeature(s, a, this._xrSessionManager, r);
    if (!d)
      throw new Error(`feature not found - ${s}`);
    o && this.disableFeature(s);
    const v = d();
    if (v.dependsOn && !v.dependsOn.every((l) => !!this._features[l]))
      throw new Error(`Dependant features missing. Make sure the following features are enabled - ${v.dependsOn.join(", ")}`);
    if (v.isCompatible())
      return this._features[s] = {
        featureImplementation: v,
        enabled: !0,
        version: a,
        required: i
      }, n ? this._xrSessionManager.session && !this._features[s].featureImplementation.attached && this.attachFeature(s) : this._features[s].featureImplementation.disableAutoAttach = !0, this._features[s].featureImplementation;
    if (i)
      throw new Error("required feature not compatible");
    return ye.Warn(`Feature ${s} not compatible with the current environment/browser and was not enabled.`), v;
  }
  /**
   * get the implementation of an enabled feature.
   * @param featureName the name of the feature to load
   * @returns the feature class, if found
   */
  getEnabledFeature(e) {
    return this._features[e] && this._features[e].featureImplementation;
  }
  /**
   * Get the list of enabled features
   * @returns an array of enabled features
   */
  getEnabledFeatures() {
    return Object.keys(this._features);
  }
  /**
   * This function will extend the session creation configuration object with enabled features.
   * If, for example, the anchors feature is enabled, it will be automatically added to the optional or required features list,
   * according to the defined "required" variable, provided during enableFeature call
   * @param xrSessionInit the xr Session init object to extend
   *
   * @returns an extended XRSessionInit object
   */
  async _extendXRSessionInitObject(e) {
    const t = this.getEnabledFeatures();
    for (const r of t) {
      const n = this._features[r], i = n.featureImplementation.xrNativeFeatureName;
      if (i && (n.required ? (e.requiredFeatures = e.requiredFeatures || [], e.requiredFeatures.indexOf(i) === -1 && e.requiredFeatures.push(i)) : (e.optionalFeatures = e.optionalFeatures || [], e.optionalFeatures.indexOf(i) === -1 && e.optionalFeatures.push(i))), n.featureImplementation.getXRSessionInitExtension) {
        const s = await n.featureImplementation.getXRSessionInitExtension();
        e = Object.assign(Object.assign({}, e), s);
      }
    }
    return e;
  }
}
So._AvailableFeatures = {};
So._ConflictingFeatures = {
  [Gi.TELEPORTATION]: Gi.MOVEMENT,
  [Gi.MOVEMENT]: Gi.TELEPORTATION
};
class L9 {
  /**
   * Construct a new (abstract) WebXR feature
   * @param _xrSessionManager the xr session manager for this feature
   */
  constructor(e) {
    this._xrSessionManager = e, this._attached = !1, this._removeOnDetach = [], this.isDisposed = !1, this.disableAutoAttach = !1, this.xrNativeFeatureName = "", this.onFeatureAttachObservable = new Oe(), this.onFeatureDetachObservable = new Oe();
  }
  /**
   * Is this feature attached
   */
  get attached() {
    return this._attached;
  }
  /**
   * attach this feature
   *
   * @param force should attachment be forced (even when already attached)
   * @returns true if successful, false is failed or already attached
   */
  attach(e) {
    if (this.isDisposed)
      return !1;
    if (e)
      this.attached && this.detach();
    else if (this.attached)
      return !1;
    return this._attached = !0, this._addNewAttachObserver(this._xrSessionManager.onXRFrameObservable, (t) => this._onXRFrame(t)), this.onFeatureAttachObservable.notifyObservers(this), !0;
  }
  /**
   * detach this feature.
   *
   * @returns true if successful, false if failed or already detached
   */
  detach() {
    return this._attached ? (this._attached = !1, this._removeOnDetach.forEach((e) => {
      e.observable.remove(e.observer);
    }), this.onFeatureDetachObservable.notifyObservers(this), !0) : (this.disableAutoAttach = !0, !1);
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    this.detach(), this.isDisposed = !0, this.onFeatureAttachObservable.clear(), this.onFeatureDetachObservable.clear();
  }
  /**
   * This function will be executed during before enabling the feature and can be used to not-allow enabling it.
   * Note that at this point the session has NOT started, so this is purely checking if the browser supports it
   *
   * @returns whether or not the feature is compatible in this environment
   */
  isCompatible() {
    return !0;
  }
  /**
   * This is used to register callbacks that will automatically be removed when detach is called.
   * @param observable the observable to which the observer will be attached
   * @param callback the callback to register
   */
  _addNewAttachObserver(e, t) {
    this._removeOnDetach.push({
      observable: e,
      observer: e.add(t)
    });
  }
}
class ta {
  /**
   * Initializes the physics joint
   * @param type The type of the physics joint
   * @param jointData The data for the physics joint
   */
  constructor(e, t) {
    this.type = e, this.jointData = t, t.nativeParams = t.nativeParams || {};
  }
  /**
   * Gets the physics joint
   */
  get physicsJoint() {
    return this._physicsJoint;
  }
  /**
   * Sets the physics joint
   */
  set physicsJoint(e) {
    this._physicsJoint, this._physicsJoint = e;
  }
  /**
   * Sets the physics plugin
   */
  set physicsPlugin(e) {
    this._physicsPlugin = e;
  }
  /**
   * Execute a function that is physics-plugin specific.
   * @param {Function} func the function that will be executed.
   *                        It accepts two parameters: the physics world and the physics joint
   */
  executeNativeFunction(e) {
    e(this._physicsPlugin.world, this._physicsJoint);
  }
}
ta.DistanceJoint = 0;
ta.HingeJoint = 1;
ta.BallAndSocketJoint = 2;
ta.WheelJoint = 3;
ta.SliderJoint = 4;
ta.PrismaticJoint = 5;
ta.UniversalJoint = 6;
ta.Hinge2Joint = ta.WheelJoint;
ta.PointToPointJoint = 8;
ta.SpringJoint = 9;
ta.LockJoint = 10;
class w6e extends ta {
  /**
   *
   * @param jointData The data for the Distance-Joint
   */
  constructor(e) {
    super(ta.DistanceJoint, e);
  }
  /**
   * Update the predefined distance.
   * @param maxDistance The maximum preferred distance
   * @param minDistance The minimum preferred distance
   */
  updateDistance(e, t) {
    this._physicsPlugin.updateDistanceJoint(this, e, t);
  }
}
class iQ extends ta {
  /**
   * Initializes the Motor-Enabled Joint
   * @param type The type of the joint
   * @param jointData The physical joint data for the joint
   */
  constructor(e, t) {
    super(e, t);
  }
  /**
   * Set the motor values.
   * Attention, this function is plugin specific. Engines won't react 100% the same.
   * @param force the force to apply
   * @param maxForce max force for this motor.
   */
  setMotor(e, t) {
    this._physicsPlugin.setMotor(this, e || 0, t);
  }
  /**
   * Set the motor's limits.
   * Attention, this function is plugin specific. Engines won't react 100% the same.
   * @param upperLimit The upper limit of the motor
   * @param lowerLimit The lower limit of the motor
   */
  setLimit(e, t) {
    this._physicsPlugin.setLimit(this, e, t);
  }
}
class m6e extends iQ {
  /**
   * Initializes the Hinge-Joint
   * @param jointData The joint data for the Hinge-Joint
   */
  constructor(e) {
    super(ta.HingeJoint, e);
  }
  /**
   * Set the motor values.
   * Attention, this function is plugin specific. Engines won't react 100% the same.
   * @param {number} force the force to apply
   * @param {number} maxForce max force for this motor.
   */
  setMotor(e, t) {
    this._physicsPlugin.setMotor(this, e || 0, t);
  }
  /**
   * Set the motor's limits.
   * Attention, this function is plugin specific. Engines won't react 100% the same.
   * @param upperLimit The upper limit of the motor
   * @param lowerLimit The lower limit of the motor
   */
  setLimit(e, t) {
    this._physicsPlugin.setLimit(this, e, t);
  }
}
class B6e extends iQ {
  /**
   * Initializes the Hinge2-Joint
   * @param jointData The joint data for the Hinge2-Joint
   */
  constructor(e) {
    super(ta.Hinge2Joint, e);
  }
  /**
   * Set the motor values.
   * Attention, this function is plugin specific. Engines won't react 100% the same.
   * @param targetSpeed the speed the motor is to reach
   * @param maxForce max force for this motor.
   * @param motorIndex motor's index, 0 or 1.
   */
  setMotor(e, t, r = 0) {
    this._physicsPlugin.setMotor(this, e || 0, t, r);
  }
  /**
   * Set the motor limits.
   * Attention, this function is plugin specific. Engines won't react 100% the same.
   * @param upperLimit the upper limit
   * @param lowerLimit lower limit
   * @param motorIndex the motor's index, 0 or 1.
   */
  setLimit(e, t, r = 0) {
    this._physicsPlugin.setLimit(this, e, t, r);
  }
}
Ee._PhysicsImpostorParser = function(A, e, t) {
  return new tn(e, t.physicsImpostor, {
    mass: t.physicsMass,
    friction: t.physicsFriction,
    restitution: t.physicsRestitution
  }, A);
};
class tn {
  /**
   * Specifies if the physics imposter is disposed
   */
  get isDisposed() {
    return this._isDisposed;
  }
  /**
   * Gets the mass of the physics imposter
   */
  get mass() {
    return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyMass(this) : 0;
  }
  set mass(e) {
    this.setMass(e);
  }
  /**
   * Gets the coefficient of friction
   */
  get friction() {
    return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyFriction(this) : 0;
  }
  /**
   * Sets the coefficient of friction
   */
  set friction(e) {
    this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyFriction(this, e);
  }
  /**
   * Gets the coefficient of restitution
   */
  get restitution() {
    return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this) : 0;
  }
  /**
   * Sets the coefficient of restitution
   */
  set restitution(e) {
    this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this, e);
  }
  /**
   * Gets the pressure of a soft body; only supported by the AmmoJSPlugin
   */
  get pressure() {
    if (!this._physicsEngine)
      return 0;
    const e = this._physicsEngine.getPhysicsPlugin();
    return e.setBodyPressure ? e.getBodyPressure(this) : 0;
  }
  /**
   * Sets the pressure of a soft body; only supported by the AmmoJSPlugin
   */
  set pressure(e) {
    if (!this._physicsEngine)
      return;
    const t = this._physicsEngine.getPhysicsPlugin();
    t.setBodyPressure && t.setBodyPressure(this, e);
  }
  /**
   * Gets the stiffness of a soft body; only supported by the AmmoJSPlugin
   */
  get stiffness() {
    if (!this._physicsEngine)
      return 0;
    const e = this._physicsEngine.getPhysicsPlugin();
    return e.getBodyStiffness ? e.getBodyStiffness(this) : 0;
  }
  /**
   * Sets the stiffness of a soft body; only supported by the AmmoJSPlugin
   */
  set stiffness(e) {
    if (!this._physicsEngine)
      return;
    const t = this._physicsEngine.getPhysicsPlugin();
    t.setBodyStiffness && t.setBodyStiffness(this, e);
  }
  /**
   * Gets the velocityIterations of a soft body; only supported by the AmmoJSPlugin
   */
  get velocityIterations() {
    if (!this._physicsEngine)
      return 0;
    const e = this._physicsEngine.getPhysicsPlugin();
    return e.getBodyVelocityIterations ? e.getBodyVelocityIterations(this) : 0;
  }
  /**
   * Sets the velocityIterations of a soft body; only supported by the AmmoJSPlugin
   */
  set velocityIterations(e) {
    if (!this._physicsEngine)
      return;
    const t = this._physicsEngine.getPhysicsPlugin();
    t.setBodyVelocityIterations && t.setBodyVelocityIterations(this, e);
  }
  /**
   * Gets the positionIterations of a soft body; only supported by the AmmoJSPlugin
   */
  get positionIterations() {
    if (!this._physicsEngine)
      return 0;
    const e = this._physicsEngine.getPhysicsPlugin();
    return e.getBodyPositionIterations ? e.getBodyPositionIterations(this) : 0;
  }
  /**
   * Sets the positionIterations of a soft body; only supported by the AmmoJSPlugin
   */
  set positionIterations(e) {
    if (!this._physicsEngine)
      return;
    const t = this._physicsEngine.getPhysicsPlugin();
    t.setBodyPositionIterations && t.setBodyPositionIterations(this, e);
  }
  /**
   * Initializes the physics imposter
   * @param object The physics-enabled object used as the physics imposter
   * @param type The type of the physics imposter. Types are available as static members of this class.
   * @param _options The options for the physics imposter
   * @param _scene The Babylon scene
   */
  constructor(e, t, r = { mass: 0 }, n) {
    if (this.object = e, this.type = t, this._options = r, this._scene = n, this._pluginData = {}, this._bodyUpdateRequired = !1, this._onBeforePhysicsStepCallbacks = new Array(), this._onAfterPhysicsStepCallbacks = new Array(), this._onPhysicsCollideCallbacks = [], this._deltaPosition = S.Zero(), this._isDisposed = !1, this.soft = !1, this.segments = 0, this._tmpQuat = new Ze(), this._tmpQuat2 = new Ze(), this.beforeStep = () => {
      this._physicsEngine && (this.object.translate(this._deltaPosition, -1), this._deltaRotationConjugated && this.object.rotationQuaternion && this.object.rotationQuaternion.multiplyToRef(this._deltaRotationConjugated, this.object.rotationQuaternion), this.object.computeWorldMatrix(!1), this.object.parent && this.object.rotationQuaternion ? (this.getParentsRotation(), this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this._tmpQuat)) : this._tmpQuat.copyFrom(this.object.rotationQuaternion || new Ze()), this._options.disableBidirectionalTransformation || this.object.rotationQuaternion && this._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(
        this,
        /*bInfo.boundingBox.centerWorld*/
        this.object.getAbsolutePosition(),
        this._tmpQuat
      ), this._onBeforePhysicsStepCallbacks.forEach((i) => {
        i(this);
      }));
    }, this.afterStep = () => {
      this._physicsEngine && (this._onAfterPhysicsStepCallbacks.forEach((i) => {
        i(this);
      }), this._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(this), this.object.parent && this.object.rotationQuaternion && (this.getParentsRotation(), this._tmpQuat.conjugateInPlace(), this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this.object.rotationQuaternion)), this.object.setAbsolutePosition(this.object.position), this._deltaRotation ? (this.object.rotationQuaternion && this.object.rotationQuaternion.multiplyToRef(this._deltaRotation, this.object.rotationQuaternion), this._deltaPosition.applyRotationQuaternionToRef(this._deltaRotation, tn._TmpVecs[0]), this.object.translate(tn._TmpVecs[0], 1)) : this.object.translate(this._deltaPosition, 1), this.object.computeWorldMatrix(!0));
    }, this.onCollideEvent = null, this.onCollide = (i) => {
      if (!this._onPhysicsCollideCallbacks.length && !this.onCollideEvent || !this._physicsEngine)
        return;
      const s = this._physicsEngine.getImpostorWithPhysicsBody(i.body);
      s && (this.onCollideEvent && this.onCollideEvent(this, s), this._onPhysicsCollideCallbacks.filter((a) => a.otherImpostors.indexOf(s) !== -1).forEach((a) => {
        a.callback(this, s, i.point, i.distance, i.impulse, i.normal);
      }));
    }, !this.object) {
      Se.Error("No object was provided. A physics object is obligatory");
      return;
    }
    this.object.parent && r.mass !== 0 && Se.Warn("A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur."), !this._scene && e.getScene && (this._scene = e.getScene()), this._scene && (this.type > 100 && (this.soft = !0), this._physicsEngine = this._scene.getPhysicsEngine(), this._physicsEngine ? (this.object.rotationQuaternion || (this.object.rotation ? this.object.rotationQuaternion = Ze.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z) : this.object.rotationQuaternion = new Ze()), this._options.mass = r.mass === void 0 ? 0 : r.mass, this._options.friction = r.friction === void 0 ? 0.2 : r.friction, this._options.restitution = r.restitution === void 0 ? 0.2 : r.restitution, this.soft && (this._options.mass = this._options.mass > 0 ? this._options.mass : 1, this._options.pressure = r.pressure === void 0 ? 200 : r.pressure, this._options.stiffness = r.stiffness === void 0 ? 1 : r.stiffness, this._options.velocityIterations = r.velocityIterations === void 0 ? 20 : r.velocityIterations, this._options.positionIterations = r.positionIterations === void 0 ? 20 : r.positionIterations, this._options.fixedPoints = r.fixedPoints === void 0 ? 0 : r.fixedPoints, this._options.margin = r.margin === void 0 ? 0 : r.margin, this._options.damping = r.damping === void 0 ? 0 : r.damping, this._options.path = r.path === void 0 ? null : r.path, this._options.shape = r.shape === void 0 ? null : r.shape), this._joints = [], !this.object.parent || this._options.ignoreParent ? this._init() : this.object.parent.physicsImpostor && Se.Warn("You must affect impostors to children before affecting impostor to parent.")) : Se.Error("Physics not enabled. Please use scene.enablePhysics(...) before creating impostors."));
  }
  /**
   * This function will completely initialize this impostor.
   * It will create a new body - but only if this mesh has no parent.
   * If it has, this impostor will not be used other than to define the impostor
   * of the child mesh.
   * @internal
   */
  _init() {
    this._physicsEngine && (this._physicsEngine.removeImpostor(this), this.physicsBody = null, this._parent = this._parent || this._getPhysicsParent(), !this._isDisposed && (!this.parent || this._options.ignoreParent) && this._physicsEngine.addImpostor(this));
  }
  _getPhysicsParent() {
    return this.object.parent instanceof jn ? this.object.parent.physicsImpostor : null;
  }
  /**
   * Should a new body be generated.
   * @returns boolean specifying if body initialization is required
   */
  isBodyInitRequired() {
    return this._bodyUpdateRequired || !this._physicsBody && (!this._parent || !!this._options.ignoreParent);
  }
  /**
   * Sets the updated scaling
   */
  setScalingUpdated() {
    this.forceUpdate();
  }
  /**
   * Force a regeneration of this or the parent's impostor's body.
   * Use with caution - This will remove all previously-instantiated joints.
   */
  forceUpdate() {
    this._init(), this.parent && !this._options.ignoreParent && this.parent.forceUpdate();
  }
  /*public get mesh(): AbstractMesh {
      return this._mesh;
  }*/
  /**
   * Gets the body that holds this impostor. Either its own, or its parent.
   */
  get physicsBody() {
    return this._parent && !this._options.ignoreParent ? this._parent.physicsBody : this._physicsBody;
  }
  /**
   * Get the parent of the physics imposter
   * @returns Physics imposter or null
   */
  get parent() {
    return !this._options.ignoreParent && this._parent ? this._parent : null;
  }
  /**
   * Sets the parent of the physics imposter
   */
  set parent(e) {
    this._parent = e;
  }
  /**
   * Set the physics body. Used mainly by the physics engine/plugin
   */
  set physicsBody(e) {
    this._physicsBody && this._physicsEngine && this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this), this._physicsBody = e, this.resetUpdateFlags();
  }
  /**
   * Resets the update flags
   */
  resetUpdateFlags() {
    this._bodyUpdateRequired = !1;
  }
  /**
   * Gets the object extents
   * @returns the object extents
   */
  getObjectExtents() {
    if (this.object.getBoundingInfo) {
      const e = this.object.rotationQuaternion, t = this.object.scaling.clone();
      this.object.rotationQuaternion = tn.IDENTITY_QUATERNION;
      const r = this.object.computeWorldMatrix && this.object.computeWorldMatrix(!0);
      r && r.decompose(t, void 0, void 0);
      const i = this.object.getBoundingInfo().boundingBox.extendSize.scale(2).multiplyInPlace(t);
      return i.x = Math.abs(i.x), i.y = Math.abs(i.y), i.z = Math.abs(i.z), this.object.rotationQuaternion = e, this.object.computeWorldMatrix && this.object.computeWorldMatrix(!0), i;
    } else
      return tn.DEFAULT_OBJECT_SIZE;
  }
  /**
   * Gets the object center
   * @returns The object center
   */
  getObjectCenter() {
    return this.object.getBoundingInfo ? this.object.getBoundingInfo().boundingBox.centerWorld : this.object.position;
  }
  /**
   * Get a specific parameter from the options parameters
   * @param paramName The object parameter name
   * @returns The object parameter
   */
  getParam(e) {
    return this._options[e];
  }
  /**
   * Sets a specific parameter in the options given to the physics plugin
   * @param paramName The parameter name
   * @param value The value of the parameter
   */
  setParam(e, t) {
    this._options[e] = t, this._bodyUpdateRequired = !0;
  }
  /**
   * Specifically change the body's mass. Won't recreate the physics body object
   * @param mass The mass of the physics imposter
   */
  setMass(e) {
    this.getParam("mass") !== e && this.setParam("mass", e), this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyMass(this, e);
  }
  /**
   * Gets the linear velocity
   * @returns  linear velocity or null
   */
  getLinearVelocity() {
    return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this) : S.Zero();
  }
  /**
   * Sets the linear velocity
   * @param velocity  linear velocity or null
   */
  setLinearVelocity(e) {
    this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, e);
  }
  /**
   * Gets the angular velocity
   * @returns angular velocity or null
   */
  getAngularVelocity() {
    return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this) : S.Zero();
  }
  /**
   * Sets the angular velocity
   * @param velocity The velocity or null
   */
  setAngularVelocity(e) {
    this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, e);
  }
  /**
   * Execute a function with the physics plugin native code
   * Provide a function the will have two variables - the world object and the physics body object
   * @param func The function to execute with the physics plugin native code
   */
  executeNativeFunction(e) {
    this._physicsEngine && e(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody);
  }
  /**
   * Register a function that will be executed before the physics world is stepping forward
   * @param func The function to execute before the physics world is stepped forward
   */
  registerBeforePhysicsStep(e) {
    this._onBeforePhysicsStepCallbacks.push(e);
  }
  /**
   * Unregister a function that will be executed before the physics world is stepping forward
   * @param func The function to execute before the physics world is stepped forward
   */
  unregisterBeforePhysicsStep(e) {
    const t = this._onBeforePhysicsStepCallbacks.indexOf(e);
    t > -1 ? this._onBeforePhysicsStepCallbacks.splice(t, 1) : Se.Warn("Function to remove was not found");
  }
  /**
   * Register a function that will be executed after the physics step
   * @param func The function to execute after physics step
   */
  registerAfterPhysicsStep(e) {
    this._onAfterPhysicsStepCallbacks.push(e);
  }
  /**
   * Unregisters a function that will be executed after the physics step
   * @param func The function to execute after physics step
   */
  unregisterAfterPhysicsStep(e) {
    const t = this._onAfterPhysicsStepCallbacks.indexOf(e);
    t > -1 ? this._onAfterPhysicsStepCallbacks.splice(t, 1) : Se.Warn("Function to remove was not found");
  }
  /**
   * register a function that will be executed when this impostor collides against a different body
   * @param collideAgainst Physics imposter, or array of physics imposters to collide against
   * @param func Callback that is executed on collision
   */
  registerOnPhysicsCollide(e, t) {
    const r = e instanceof Array ? e : [e];
    this._onPhysicsCollideCallbacks.push({ callback: t, otherImpostors: r });
  }
  /**
   * Unregisters the physics imposter's collision callback
   * @param collideAgainst The physics object to collide against
   * @param func Callback to execute on collision
   */
  unregisterOnPhysicsCollide(e, t) {
    const r = e instanceof Array ? e : [e];
    let n = -1;
    this._onPhysicsCollideCallbacks.some((s, a) => {
      if (s.callback === t && s.otherImpostors.length === r.length) {
        const f = s.otherImpostors.every((o) => r.indexOf(o) > -1);
        return f && (n = a), f;
      }
      return !1;
    }) ? this._onPhysicsCollideCallbacks.splice(n, 1) : Se.Warn("Function to remove was not found");
  }
  /**
   * Get the parent rotation
   * @returns The parent rotation
   */
  getParentsRotation() {
    let e = this.object.parent;
    for (this._tmpQuat.copyFromFloats(0, 0, 0, 1); e; )
      e.rotationQuaternion ? this._tmpQuat2.copyFrom(e.rotationQuaternion) : Ze.RotationYawPitchRollToRef(e.rotation.y, e.rotation.x, e.rotation.z, this._tmpQuat2), this._tmpQuat.multiplyToRef(this._tmpQuat2, this._tmpQuat), e = e.parent;
    return this._tmpQuat;
  }
  /**
   * Apply a force
   * @param force The force to apply
   * @param contactPoint The contact point for the force
   * @returns The physics imposter
   */
  applyForce(e, t) {
    return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().applyForce(this, e, t), this;
  }
  /**
   * Apply an impulse
   * @param force The impulse force
   * @param contactPoint The contact point for the impulse force
   * @returns The physics imposter
   */
  applyImpulse(e, t) {
    return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().applyImpulse(this, e, t), this;
  }
  /**
   * A help function to create a joint
   * @param otherImpostor A physics imposter used to create a joint
   * @param jointType The type of joint
   * @param jointData The data for the joint
   * @returns The physics imposter
   */
  createJoint(e, t, r) {
    const n = new ta(t, r);
    return this.addJoint(e, n), this;
  }
  /**
   * Add a joint to this impostor with a different impostor
   * @param otherImpostor A physics imposter used to add a joint
   * @param joint The joint to add
   * @returns The physics imposter
   */
  addJoint(e, t) {
    return this._joints.push({
      otherImpostor: e,
      joint: t
    }), this._physicsEngine && this._physicsEngine.addJoint(this, e, t), this;
  }
  /**
   * Add an anchor to a cloth impostor
   * @param otherImpostor rigid impostor to anchor to
   * @param width ratio across width from 0 to 1
   * @param height ratio up height from 0 to 1
   * @param influence the elasticity between cloth impostor and anchor from 0, very stretchy to 1, little stretch
   * @param noCollisionBetweenLinkedBodies when true collisions between cloth impostor and anchor are ignored; default false
   * @returns impostor the soft imposter
   */
  addAnchor(e, t, r, n, i) {
    if (!this._physicsEngine)
      return this;
    const s = this._physicsEngine.getPhysicsPlugin();
    return s.appendAnchor ? (this._physicsEngine && s.appendAnchor(this, e, t, r, n, i), this) : this;
  }
  /**
   * Add a hook to a rope impostor
   * @param otherImpostor rigid impostor to anchor to
   * @param length ratio across rope from 0 to 1
   * @param influence the elasticity between rope impostor and anchor from 0, very stretchy to 1, little stretch
   * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
   * @returns impostor the rope imposter
   */
  addHook(e, t, r, n) {
    if (!this._physicsEngine)
      return this;
    const i = this._physicsEngine.getPhysicsPlugin();
    return i.appendAnchor ? (this._physicsEngine && i.appendHook(this, e, t, r, n), this) : this;
  }
  /**
   * Will keep this body still, in a sleep mode.
   * @returns the physics imposter
   */
  sleep() {
    return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().sleepBody(this), this;
  }
  /**
   * Wake the body up.
   * @returns The physics imposter
   */
  wakeUp() {
    return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().wakeUpBody(this), this;
  }
  /**
   * Clones the physics imposter
   * @param newObject The physics imposter clones to this physics-enabled object
   * @returns A nullable physics imposter
   */
  clone(e) {
    return e ? new tn(e, this.type, this._options, this._scene) : null;
  }
  /**
   * Disposes the physics imposter
   */
  dispose() {
    this._physicsEngine && (this._joints.forEach((e) => {
      this._physicsEngine && this._physicsEngine.removeJoint(this, e.otherImpostor, e.joint);
    }), this._physicsEngine.removeImpostor(this), this.parent && this.parent.forceUpdate(), this._isDisposed = !0);
  }
  /**
   * Sets the delta position
   * @param position The delta position amount
   */
  setDeltaPosition(e) {
    this._deltaPosition.copyFrom(e);
  }
  /**
   * Sets the delta rotation
   * @param rotation The delta rotation amount
   */
  setDeltaRotation(e) {
    this._deltaRotation || (this._deltaRotation = new Ze()), this._deltaRotation.copyFrom(e), this._deltaRotationConjugated = this._deltaRotation.conjugate();
  }
  /**
   * Gets the box size of the physics imposter and stores the result in the input parameter
   * @param result Stores the box size
   * @returns The physics imposter
   */
  getBoxSizeToRef(e) {
    return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this, e), this;
  }
  /**
   * Gets the radius of the physics imposter
   * @returns Radius of the physics imposter
   */
  getRadius() {
    return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getRadius(this) : 0;
  }
  /**
   * Sync a bone with this impostor
   * @param bone The bone to sync to the impostor.
   * @param boneMesh The mesh that the bone is influencing.
   * @param jointPivot The pivot of the joint / bone in local space.
   * @param distToJoint Optional distance from the impostor to the joint.
   * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.
   */
  syncBoneWithImpostor(e, t, r, n, i) {
    const s = tn._TmpVecs[0], a = this.object;
    if (a.rotationQuaternion)
      if (i) {
        const f = tn._TmpQuat;
        a.rotationQuaternion.multiplyToRef(i, f), e.setRotationQuaternion(f, ai.WORLD, t);
      } else
        e.setRotationQuaternion(a.rotationQuaternion, ai.WORLD, t);
    s.x = 0, s.y = 0, s.z = 0, r && (s.x = r.x, s.y = r.y, s.z = r.z, e.getDirectionToRef(s, t, s), n == null && (n = r.length()), s.x *= n, s.y *= n, s.z *= n), e.getParent() ? (s.addInPlace(a.getAbsolutePosition()), e.setAbsolutePosition(s, t)) : (t.setAbsolutePosition(a.getAbsolutePosition()), t.position.x -= s.x, t.position.y -= s.y, t.position.z -= s.z);
  }
  /**
   * Sync impostor to a bone
   * @param bone The bone that the impostor will be synced to.
   * @param boneMesh The mesh that the bone is influencing.
   * @param jointPivot The pivot of the joint / bone in local space.
   * @param distToJoint Optional distance from the impostor to the joint.
   * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.
   * @param boneAxis Optional vector3 axis the bone is aligned with
   */
  syncImpostorWithBone(e, t, r, n, i, s) {
    const a = this.object;
    if (a.rotationQuaternion)
      if (i) {
        const d = tn._TmpQuat;
        e.getRotationQuaternionToRef(ai.WORLD, t, d), d.multiplyToRef(i, a.rotationQuaternion);
      } else
        e.getRotationQuaternionToRef(ai.WORLD, t, a.rotationQuaternion);
    const f = tn._TmpVecs[0], o = tn._TmpVecs[1];
    s || (s = tn._TmpVecs[2], s.x = 0, s.y = 1, s.z = 0), e.getDirectionToRef(s, t, o), e.getAbsolutePositionToRef(t, f), n == null && r && (n = r.length()), n != null && (f.x += o.x * n, f.y += o.y * n, f.z += o.z * n), a.setAbsolutePosition(f);
  }
}
tn.DEFAULT_OBJECT_SIZE = new S(1, 1, 1);
tn.IDENTITY_QUATERNION = Ze.Identity();
tn._TmpVecs = Nf.BuildArray(3, S.Zero);
tn._TmpQuat = Ze.Identity();
tn.NoImpostor = 0;
tn.SphereImpostor = 1;
tn.BoxImpostor = 2;
tn.PlaneImpostor = 3;
tn.MeshImpostor = 4;
tn.CapsuleImpostor = 6;
tn.CylinderImpostor = 7;
tn.ParticleImpostor = 8;
tn.HeightmapImpostor = 9;
tn.ConvexHullImpostor = 10;
tn.CustomImpostor = 100;
tn.RopeImpostor = 101;
tn.ClothImpostor = 102;
tn.SoftbodyImpostor = 103;
var O2;
(function(A) {
  A[A.Clean = 0] = "Clean", A[A.Stop = 1] = "Stop", A[A.Sync = 2] = "Sync", A[A.NoSync = 3] = "NoSync";
})(O2 || (O2 = {}));
class Hn {
  /**
   * Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data
   */
  static get ForceFullSceneLoadingForIncremental() {
    return l9.ForceFullSceneLoadingForIncremental;
  }
  static set ForceFullSceneLoadingForIncremental(e) {
    l9.ForceFullSceneLoadingForIncremental = e;
  }
  /**
   * Gets or sets a boolean indicating if loading screen must be displayed while loading a scene
   */
  static get ShowLoadingScreen() {
    return l9.ShowLoadingScreen;
  }
  static set ShowLoadingScreen(e) {
    l9.ShowLoadingScreen = e;
  }
  /**
   * Defines the current logging level (while loading the scene)
   * @ignorenaming
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static get loggingLevel() {
    return l9.loggingLevel;
  }
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static set loggingLevel(e) {
    l9.loggingLevel = e;
  }
  /**
   * Gets or set a boolean indicating if matrix weights must be cleaned upon loading
   */
  static get CleanBoneMatrixWeights() {
    return l9.CleanBoneMatrixWeights;
  }
  static set CleanBoneMatrixWeights(e) {
    l9.CleanBoneMatrixWeights = e;
  }
  /**
   * Gets the default plugin (used to load Babylon files)
   * @returns the .babylon plugin
   */
  static GetDefaultPlugin() {
    return Hn._RegisteredPlugins[".babylon"];
  }
  static _GetPluginForExtension(e) {
    const t = Hn._RegisteredPlugins[e];
    return t || (Se.Warn("Unable to find a plugin to load " + e + " files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes"), Hn.GetDefaultPlugin());
  }
  static _GetPluginForDirectLoad(e) {
    for (const t in Hn._RegisteredPlugins) {
      const r = Hn._RegisteredPlugins[t].plugin;
      if (r.canDirectLoad && r.canDirectLoad(e))
        return Hn._RegisteredPlugins[t];
    }
    return Hn.GetDefaultPlugin();
  }
  static _GetPluginForFilename(e) {
    const t = e.indexOf("?");
    t !== -1 && (e = e.substring(0, t));
    const r = e.lastIndexOf("."), n = e.substring(r, e.length).toLowerCase();
    return Hn._GetPluginForExtension(n);
  }
  static _GetDirectLoad(e) {
    return e.substr(0, 5) === "data:" ? e.substr(5) : null;
  }
  static _FormatErrorMessage(e, t, r) {
    let i = "Unable to load from " + (e.rawData ? "binary data" : e.url);
    return t ? i += `: ${t}` : r && (i += `: ${r}`), i;
  }
  static _LoadData(e, t, r, n, i, s, a, f) {
    const o = Hn._GetDirectLoad(e.url);
    if (e.rawData && !a)
      throw "When using ArrayBufferView to load data the file extension must be provided.";
    const d = a ? Hn._GetPluginForExtension(a) : o ? Hn._GetPluginForDirectLoad(e.url) : Hn._GetPluginForFilename(e.url);
    if (e.rawData && !d.isBinary)
      throw "Loading from ArrayBufferView can not be used with plugins that don't support binary loading.";
    let v;
    if (d.plugin.createPlugin !== void 0 ? v = d.plugin.createPlugin() : v = d.plugin, !v)
      throw "The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.";
    if (Hn.OnPluginActivatedObservable.notifyObservers(v), o && (v.canDirectLoad && v.canDirectLoad(e.url) || !qR(e.url))) {
      if (v.directLoad) {
        const b = v.directLoad(t, o);
        b.then ? b.then((j) => {
          r(v, j);
        }).catch((j) => {
          i("Error in directLoad of _loadData: " + j, j);
        }) : r(v, b);
      } else
        r(v, o);
      return v;
    }
    const u = d.isBinary, l = (b, j) => {
      if (t.isDisposed) {
        i("Scene has been disposed");
        return;
      }
      r(v, b, j);
    };
    let P = null, p = !1;
    const c = v.onDisposeObservable;
    c && c.add(() => {
      p = !0, P && (P.abort(), P = null), s();
    });
    const H = () => {
      if (p)
        return;
      const b = (j, w) => {
        i(j == null ? void 0 : j.statusText, w);
      };
      if (!v.loadFile && e.rawData)
        throw "Plugin does not support loading ArrayBufferView.";
      P = v.loadFile ? v.loadFile(t, e.rawData || e.file || e.url, e.rootUrl, l, n, u, b, f) : t._loadFile(e.file || e.url, l, n, !0, u, b);
    }, T = t.getEngine();
    let q = T.enableOfflineSupport;
    if (q) {
      let b = !1;
      for (const j of t.disableOfflineSupportExceptionRules)
        if (j.test(e.url)) {
          b = !0;
          break;
        }
      q = !b;
    }
    return q && Ge.OfflineProviderFactory ? t.offlineProvider = Ge.OfflineProviderFactory(e.url, H, T.disableManifestCheck) : H(), v;
  }
  static _GetFileInfo(e, t) {
    let r, n, i = null, s = null;
    if (!t)
      r = e, n = ye.GetFilename(e), e = ye.GetFolderPath(e);
    else if (t.name) {
      const a = t;
      r = `file:${a.name}`, n = a.name, i = a;
    } else if (ArrayBuffer.isView(t))
      r = "", n = "arrayBuffer", s = t;
    else if (typeof t == "string" && t.startsWith("data:"))
      r = t, n = "";
    else {
      const a = t;
      if (a.substr(0, 1) === "/")
        return ye.Error("Wrong sceneFilename parameter"), null;
      r = e + a, n = a;
    }
    return {
      url: r,
      rootUrl: e,
      name: n,
      file: i,
      rawData: s
    };
  }
  // Public functions
  /**
   * Gets a plugin that can load the given extension
   * @param extension defines the extension to load
   * @returns a plugin or null if none works
   */
  static GetPluginForExtension(e) {
    return Hn._GetPluginForExtension(e).plugin;
  }
  /**
   * Gets a boolean indicating that the given extension can be loaded
   * @param extension defines the extension to load
   * @returns true if the extension is supported
   */
  static IsPluginForExtensionAvailable(e) {
    return !!Hn._RegisteredPlugins[e];
  }
  /**
   * Adds a new plugin to the list of registered plugins
   * @param plugin defines the plugin to add
   */
  static RegisterPlugin(e) {
    if (typeof e.extensions == "string") {
      const t = e.extensions;
      Hn._RegisteredPlugins[t.toLowerCase()] = {
        plugin: e,
        isBinary: !1
      };
    } else {
      const t = e.extensions;
      Object.keys(t).forEach((r) => {
        Hn._RegisteredPlugins[r.toLowerCase()] = {
          plugin: e,
          isBinary: t[r].isBinary
        };
      });
    }
  }
  /**
   * Import meshes into a scene
   * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
   * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
   * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
   * @param scene the instance of BABYLON.Scene to append to
   * @param onSuccess a callback with a list of imported meshes, particleSystems, skeletons, and animationGroups when import succeeds
   * @param onProgress a callback with a progress event for each file being loaded
   * @param onError a callback with the scene, a message, and possibly an exception when import fails
   * @param pluginExtension the extension used to determine the plugin
   * @returns The loaded plugin
   */
  static ImportMesh(e, t, r = "", n = gr.LastCreatedScene, i = null, s = null, a = null, f = null, o = "") {
    if (!n)
      return Se.Error("No scene available to import mesh to"), null;
    const d = Hn._GetFileInfo(t, r);
    if (!d)
      return null;
    const v = {};
    n.addPendingData(v);
    const u = () => {
      n.removePendingData(v);
    }, l = (c, H) => {
      const T = Hn._FormatErrorMessage(d, c, H);
      a ? a(n, T, new O0(T, Z2.SceneLoaderError, H)) : Se.Error(T), u();
    }, P = s ? (c) => {
      try {
        s(c);
      } catch (H) {
        l("Error in onProgress callback: " + H, H);
      }
    } : void 0, p = (c, H, T, q, b, j, w) => {
      if (n.importedMeshesFiles.push(d.url), i)
        try {
          i(c, H, T, q, b, j, w);
        } catch (m) {
          l("Error in onSuccess callback: " + m, m);
        }
      n.removePendingData(v);
    };
    return Hn._LoadData(d, n, (c, H, T) => {
      if (c.rewriteRootURL && (d.rootUrl = c.rewriteRootURL(d.rootUrl, T)), c.importMesh) {
        const q = c, b = [], j = [], w = [];
        if (!q.importMesh(e, n, H, d.rootUrl, b, j, w, l))
          return;
        n.loadingPluginName = c.name, p(b, j, w, [], [], [], []);
      } else
        c.importMeshAsync(e, n, H, d.rootUrl, P, d.name).then((b) => {
          n.loadingPluginName = c.name, p(b.meshes, b.particleSystems, b.skeletons, b.animationGroups, b.transformNodes, b.geometries, b.lights);
        }).catch((b) => {
          l(b.message, b);
        });
    }, P, l, u, f, o);
  }
  /**
   * Import meshes into a scene
   * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
   * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
   * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
   * @param scene the instance of BABYLON.Scene to append to
   * @param onProgress a callback with a progress event for each file being loaded
   * @param pluginExtension the extension used to determine the plugin
   * @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups
   */
  static ImportMeshAsync(e, t, r = "", n = gr.LastCreatedScene, i = null, s = null, a = "") {
    return new Promise((f, o) => {
      Hn.ImportMesh(e, t, r, n, (d, v, u, l, P, p, c) => {
        f({
          meshes: d,
          particleSystems: v,
          skeletons: u,
          animationGroups: l,
          transformNodes: P,
          geometries: p,
          lights: c
        });
      }, i, (d, v, u) => {
        o(u || new Error(v));
      }, s, a);
    });
  }
  /**
   * Load a scene
   * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
   * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
   * @param engine is the instance of BABYLON.Engine to use to create the scene
   * @param onSuccess a callback with the scene when import succeeds
   * @param onProgress a callback with a progress event for each file being loaded
   * @param onError a callback with the scene, a message, and possibly an exception when import fails
   * @param pluginExtension the extension used to determine the plugin
   * @returns The loaded plugin
   */
  static Load(e, t = "", r = gr.LastCreatedEngine, n = null, i = null, s = null, a = null, f = "") {
    return r ? Hn.Append(e, t, new sr(r), n, i, s, a, f) : (ye.Error("No engine available"), null);
  }
  /**
   * Load a scene
   * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
   * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
   * @param engine is the instance of BABYLON.Engine to use to create the scene
   * @param onProgress a callback with a progress event for each file being loaded
   * @param pluginExtension the extension used to determine the plugin
   * @returns The loaded scene
   */
  static LoadAsync(e, t = "", r = gr.LastCreatedEngine, n = null, i = null, s = "") {
    return new Promise((a, f) => {
      Hn.Load(e, t, r, (o) => {
        a(o);
      }, n, (o, d, v) => {
        f(v || new Error(d));
      }, i, s);
    });
  }
  /**
   * Append a scene
   * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
   * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
   * @param scene is the instance of BABYLON.Scene to append to
   * @param onSuccess a callback with the scene when import succeeds
   * @param onProgress a callback with a progress event for each file being loaded
   * @param onError a callback with the scene, a message, and possibly an exception when import fails
   * @param pluginExtension the extension used to determine the plugin
   * @returns The loaded plugin
   */
  static Append(e, t = "", r = gr.LastCreatedScene, n = null, i = null, s = null, a = null, f = "") {
    if (!r)
      return Se.Error("No scene available to append to"), null;
    const o = Hn._GetFileInfo(e, t);
    if (!o)
      return null;
    const d = {};
    r.addPendingData(d);
    const v = () => {
      r.removePendingData(d);
    };
    Hn.ShowLoadingScreen && !this._ShowingLoadingScreen && (this._ShowingLoadingScreen = !0, r.getEngine().displayLoadingUI(), r.executeWhenReady(() => {
      r.getEngine().hideLoadingUI(), this._ShowingLoadingScreen = !1;
    }));
    const u = (p, c) => {
      const H = Hn._FormatErrorMessage(o, p, c);
      s ? s(r, H, new O0(H, Z2.SceneLoaderError, c)) : Se.Error(H), v();
    }, l = i ? (p) => {
      try {
        i(p);
      } catch (c) {
        u("Error in onProgress callback", c);
      }
    } : void 0, P = () => {
      if (n)
        try {
          n(r);
        } catch (p) {
          u("Error in onSuccess callback", p);
        }
      r.removePendingData(d);
    };
    return Hn._LoadData(o, r, (p, c) => {
      if (p.load) {
        if (!p.load(r, c, o.rootUrl, u))
          return;
        r.loadingPluginName = p.name, P();
      } else
        p.loadAsync(r, c, o.rootUrl, l, o.name).then(() => {
          r.loadingPluginName = p.name, P();
        }).catch((T) => {
          u(T.message, T);
        });
    }, l, u, v, a, f);
  }
  /**
   * Append a scene
   * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
   * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
   * @param scene is the instance of BABYLON.Scene to append to
   * @param onProgress a callback with a progress event for each file being loaded
   * @param pluginExtension the extension used to determine the plugin
   * @returns The given scene
   */
  static AppendAsync(e, t = "", r = gr.LastCreatedScene, n = null, i = null, s = "") {
    return new Promise((a, f) => {
      Hn.Append(e, t, r, (o) => {
        a(o);
      }, n, (o, d, v) => {
        f(v || new Error(d));
      }, i, s);
    });
  }
  /**
   * Load a scene into an asset container
   * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
   * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
   * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
   * @param onSuccess a callback with the scene when import succeeds
   * @param onProgress a callback with a progress event for each file being loaded
   * @param onError a callback with the scene, a message, and possibly an exception when import fails
   * @param pluginExtension the extension used to determine the plugin
   * @returns The loaded plugin
   */
  static LoadAssetContainer(e, t = "", r = gr.LastCreatedScene, n = null, i = null, s = null, a = null, f = "") {
    if (!r)
      return Se.Error("No scene available to load asset container to"), null;
    const o = Hn._GetFileInfo(e, t);
    if (!o)
      return null;
    const d = {};
    r.addPendingData(d);
    const v = () => {
      r.removePendingData(d);
    }, u = (p, c) => {
      const H = Hn._FormatErrorMessage(o, p, c);
      s ? s(r, H, new O0(H, Z2.SceneLoaderError, c)) : Se.Error(H), v();
    }, l = i ? (p) => {
      try {
        i(p);
      } catch (c) {
        u("Error in onProgress callback", c);
      }
    } : void 0, P = (p) => {
      if (n)
        try {
          n(p);
        } catch (c) {
          u("Error in onSuccess callback", c);
        }
      r.removePendingData(d);
    };
    return Hn._LoadData(o, r, (p, c) => {
      if (p.loadAssetContainer) {
        const T = p.loadAssetContainer(r, c, o.rootUrl, u);
        if (!T)
          return;
        T.populateRootNodes(), r.loadingPluginName = p.name, P(T);
      } else
        p.loadAssetContainerAsync ? p.loadAssetContainerAsync(r, c, o.rootUrl, l, o.name).then((T) => {
          T.populateRootNodes(), r.loadingPluginName = p.name, P(T);
        }).catch((T) => {
          u(T.message, T);
        }) : u("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.");
    }, l, u, v, a, f);
  }
  /**
   * Load a scene into an asset container
   * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
   * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
   * @param scene is the instance of Scene to append to
   * @param onProgress a callback with a progress event for each file being loaded
   * @param pluginExtension the extension used to determine the plugin
   * @returns The loaded asset container
   */
  static LoadAssetContainerAsync(e, t = "", r = gr.LastCreatedScene, n = null, i = null) {
    return new Promise((s, a) => {
      Hn.LoadAssetContainer(e, t, r, (f) => {
        s(f);
      }, n, (f, o, d) => {
        a(d || new Error(o));
      }, i);
    });
  }
  /**
   * Import animations from a file into a scene
   * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
   * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
   * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
   * @param overwriteAnimations when true, animations are cleaned before importing new ones. Animations are appended otherwise
   * @param animationGroupLoadingMode defines how to handle old animations groups before importing new ones
   * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
   * @param onSuccess a callback with the scene when import succeeds
   * @param onProgress a callback with a progress event for each file being loaded
   * @param onError a callback with the scene, a message, and possibly an exception when import fails
   * @param pluginExtension the extension used to determine the plugin
   */
  static ImportAnimations(e, t = "", r = gr.LastCreatedScene, n = !0, i = O2.Clean, s = null, a = null, f = null, o = null, d = null) {
    if (!r) {
      Se.Error("No scene available to load animations to");
      return;
    }
    if (n) {
      for (const P of r.animatables)
        P.reset();
      r.stopAllAnimations(), r.animationGroups.slice().forEach((P) => {
        P.dispose();
      }), r.getNodes().forEach((P) => {
        P.animations && (P.animations = []);
      });
    } else
      switch (i) {
        case O2.Clean:
          r.animationGroups.slice().forEach((l) => {
            l.dispose();
          });
          break;
        case O2.Stop:
          r.animationGroups.forEach((l) => {
            l.stop();
          });
          break;
        case O2.Sync:
          r.animationGroups.forEach((l) => {
            l.reset(), l.restart();
          });
          break;
        case O2.NoSync:
          break;
        default:
          Se.Error("Unknown animation group loading mode value '" + i + "'");
          return;
      }
    const v = r.animatables.length, u = (l) => {
      l.mergeAnimationsTo(r, r.animatables.slice(v), s), l.dispose(), r.onAnimationFileImportedObservable.notifyObservers(r), a && a(r);
    };
    this.LoadAssetContainer(e, t, r, u, f, o, d);
  }
  /**
   * Import animations from a file into a scene
   * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
   * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
   * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
   * @param overwriteAnimations when true, animations are cleaned before importing new ones. Animations are appended otherwise
   * @param animationGroupLoadingMode defines how to handle old animations groups before importing new ones
   * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
   * @param onSuccess a callback with the scene when import succeeds
   * @param onProgress a callback with a progress event for each file being loaded
   * @param onError a callback with the scene, a message, and possibly an exception when import fails
   * @param pluginExtension the extension used to determine the plugin
   * @returns the updated scene with imported animations
   */
  static ImportAnimationsAsync(e, t = "", r = gr.LastCreatedScene, n = !0, i = O2.Clean, s = null, a = null, f = null, o = null, d = null) {
    return new Promise((v, u) => {
      Hn.ImportAnimations(e, t, r, n, i, s, (l) => {
        v(l);
      }, f, (l, P, p) => {
        u(p || new Error(P));
      }, d);
    });
  }
}
Hn.NO_LOGGING = 0;
Hn.MINIMAL_LOGGING = 1;
Hn.SUMMARY_LOGGING = 2;
Hn.DETAILED_LOGGING = 3;
Hn.OnPluginActivatedObservable = new Oe();
Hn._RegisteredPlugins = {};
Hn._ShowingLoadingScreen = !1;
class P1 extends gt {
  constructor(e, t, r = !0) {
    super(e, t), this._normalMatrix = new he(), this._storeEffectOnSubMeshes = r;
  }
  getEffect() {
    return this._storeEffectOnSubMeshes ? this._activeEffect : super.getEffect();
  }
  isReady(e, t) {
    return e ? !this._storeEffectOnSubMeshes || !e.subMeshes || e.subMeshes.length === 0 ? !0 : this.isReadyForSubMesh(e, e.subMeshes[0], t) : !1;
  }
  _isReadyForSubMesh(e) {
    const t = e.materialDefines;
    return !!(!this.checkReadyOnEveryCall && e.effect && t && t._renderId === this.getScene().getRenderId());
  }
  /**
   * Binds the given world matrix to the active effect
   *
   * @param world the matrix to bind
   */
  bindOnlyWorldMatrix(e) {
    this._activeEffect.setMatrix("world", e);
  }
  /**
   * Binds the given normal matrix to the active effect
   *
   * @param normalMatrix the matrix to bind
   */
  bindOnlyNormalMatrix(e) {
    this._activeEffect.setMatrix("normalMatrix", e);
  }
  bind(e, t) {
    t && this.bindForSubMesh(e, t, t.subMeshes[0]);
  }
  _afterBind(e, t = null) {
    super._afterBind(e, t), this.getScene()._cachedEffect = t, t && (t._forceRebindOnNextCall = !1);
  }
  _mustRebind(e, t, r = 1) {
    return e.isCachedMaterialInvalid(this, t, r);
  }
  dispose(e, t, r) {
    this._activeEffect = void 0, super.dispose(e, t, r);
  }
}
var de;
(function(A) {
  A[A.Float = 1] = "Float", A[A.Int = 2] = "Int", A[A.Vector2 = 4] = "Vector2", A[A.Vector3 = 8] = "Vector3", A[A.Vector4 = 16] = "Vector4", A[A.Color3 = 32] = "Color3", A[A.Color4 = 64] = "Color4", A[A.Matrix = 128] = "Matrix", A[A.Object = 256] = "Object", A[A.AutoDetect = 1024] = "AutoDetect", A[A.BasedOnInput = 2048] = "BasedOnInput", A[A.All = 4095] = "All";
})(de || (de = {}));
var Ve;
(function(A) {
  A[A.Vertex = 1] = "Vertex", A[A.Fragment = 2] = "Fragment", A[A.Neutral = 4] = "Neutral", A[A.VertexAndFragment = 3] = "VertexAndFragment";
})(Ve || (Ve = {}));
class lG {
  constructor() {
    this.supportUniformBuffers = !1, this.attributes = [], this.uniforms = [], this.constants = [], this.samplers = [], this.functions = {}, this.extensions = {}, this.prePassOutput = {}, this.counters = {}, this._attributeDeclaration = "", this._uniformDeclaration = "", this._constantDeclaration = "", this._samplerDeclaration = "", this._varyingTransfer = "", this._injectAtEnd = "", this._repeatableContentAnchorIndex = 0, this._builtCompilationString = "", this.compilationString = "";
  }
  /**
   * Finalize the compilation strings
   * @param state defines the current compilation state
   */
  finalize(e) {
    const t = e.sharedData.emitComments, r = this.target === Ve.Fragment;
    this.compilationString = `
${t ? `//Entry point
` : ""}void main(void) {
${this.compilationString}`, this._constantDeclaration && (this.compilationString = `
${t ? `//Constants
` : ""}${this._constantDeclaration}
${this.compilationString}`);
    let n = "";
    for (const i in this.functions)
      n += this.functions[i] + `
`;
    this.compilationString = `
${n}
${this.compilationString}`, !r && this._varyingTransfer && (this.compilationString = `${this.compilationString}
${this._varyingTransfer}`), this._injectAtEnd && (this.compilationString = `${this.compilationString}
${this._injectAtEnd}`), this.compilationString = `${this.compilationString}
}`, this.sharedData.varyingDeclaration && (this.compilationString = `
${t ? `//Varyings
` : ""}${this.sharedData.varyingDeclaration}
${this.compilationString}`), this._samplerDeclaration && (this.compilationString = `
${t ? `//Samplers
` : ""}${this._samplerDeclaration}
${this.compilationString}`), this._uniformDeclaration && (this.compilationString = `
${t ? `//Uniforms
` : ""}${this._uniformDeclaration}
${this.compilationString}`), this._attributeDeclaration && !r && (this.compilationString = `
${t ? `//Attributes
` : ""}${this._attributeDeclaration}
${this.compilationString}`), this.compilationString = `precision highp float;
` + this.compilationString, this.compilationString = `#if defined(WEBGL2) || defines(WEBGPU)
precision highp sampler2DArray;
#endif
` + this.compilationString, r && (this.compilationString = `#if defined(PREPASS)\r
#extension GL_EXT_draw_buffers : require\r
layout(location = 0) out highp vec4 glFragData[SCENE_MRT_COUNT];\r
highp vec4 gl_FragColor;\r
#endif\r
` + this.compilationString);
    for (const i in this.extensions) {
      const s = this.extensions[i];
      this.compilationString = `
${s}
${this.compilationString}`;
    }
    this._builtCompilationString = this.compilationString;
  }
  /** @internal */
  get _repeatableContentAnchor() {
    return `###___ANCHOR${this._repeatableContentAnchorIndex++}___###`;
  }
  /**
   * @internal
   */
  _getFreeVariableName(e) {
    return e = e.replace(/[^a-zA-Z_]+/g, ""), this.sharedData.variableNames[e] === void 0 ? (this.sharedData.variableNames[e] = 0, e === "output" || e === "texture" ? e + this.sharedData.variableNames[e] : e) : (this.sharedData.variableNames[e]++, e + this.sharedData.variableNames[e]);
  }
  /**
   * @internal
   */
  _getFreeDefineName(e) {
    return this.sharedData.defineNames[e] === void 0 ? this.sharedData.defineNames[e] = 0 : this.sharedData.defineNames[e]++, e + this.sharedData.defineNames[e];
  }
  /**
   * @internal
   */
  _excludeVariableName(e) {
    this.sharedData.variableNames[e] = 0;
  }
  /**
   * @internal
   */
  _emit2DSampler(e) {
    this.samplers.indexOf(e) < 0 && (this._samplerDeclaration += `uniform sampler2D ${e};
`, this.samplers.push(e));
  }
  /**
   * @internal
   */
  _emit2DArraySampler(e) {
    this.samplers.indexOf(e) < 0 && (this._samplerDeclaration += `uniform sampler2DArray ${e};
`, this.samplers.push(e));
  }
  /**
   * @internal
   */
  _getGLType(e) {
    switch (e) {
      case de.Float:
        return "float";
      case de.Int:
        return "int";
      case de.Vector2:
        return "vec2";
      case de.Color3:
      case de.Vector3:
        return "vec3";
      case de.Color4:
      case de.Vector4:
        return "vec4";
      case de.Matrix:
        return "mat4";
    }
    return "";
  }
  /**
   * @internal
   */
  _emitExtension(e, t, r = "") {
    this.extensions[e] || (r && (t = `#if ${r}
${t}
#endif`), this.extensions[e] = t);
  }
  /**
   * @internal
   */
  _emitFunction(e, t, r) {
    this.functions[e] || (this.sharedData.emitComments && (t = r + `
` + t), this.functions[e] = t);
  }
  /**
   * @internal
   */
  _emitCodeFromInclude(e, t, r) {
    if (r && r.repeatKey)
      return `#include<${e}>${r.substitutionVars ? "(" + r.substitutionVars + ")" : ""}[0..${r.repeatKey}]
`;
    let n = An.IncludesShadersStore[e] + `
`;
    if (this.sharedData.emitComments && (n = t + `
` + n), !r)
      return n;
    if (r.replaceStrings)
      for (let i = 0; i < r.replaceStrings.length; i++) {
        const s = r.replaceStrings[i];
        n = n.replace(s.search, s.replace);
      }
    return n;
  }
  /**
   * @internal
   */
  _emitFunctionFromInclude(e, t, r, n = "") {
    const i = e + n;
    if (!this.functions[i]) {
      if (!r || !r.removeAttributes && !r.removeUniforms && !r.removeVaryings && !r.removeIfDef && !r.replaceStrings) {
        r && r.repeatKey ? this.functions[i] = `#include<${e}>${r.substitutionVars ? "(" + r.substitutionVars + ")" : ""}[0..${r.repeatKey}]
` : this.functions[i] = `#include<${e}>${r != null && r.substitutionVars ? "(" + (r == null ? void 0 : r.substitutionVars) + ")" : ""}
`, this.sharedData.emitComments && (this.functions[i] = t + `
` + this.functions[i]);
        return;
      }
      if (this.functions[i] = An.IncludesShadersStore[e], this.sharedData.emitComments && (this.functions[i] = t + `
` + this.functions[i]), r.removeIfDef && (this.functions[i] = this.functions[i].replace(/^\s*?#ifdef.+$/gm, ""), this.functions[i] = this.functions[i].replace(/^\s*?#endif.*$/gm, ""), this.functions[i] = this.functions[i].replace(/^\s*?#else.*$/gm, ""), this.functions[i] = this.functions[i].replace(/^\s*?#elif.*$/gm, "")), r.removeAttributes && (this.functions[i] = this.functions[i].replace(/\s*?attribute .+?;/g, `
`)), r.removeUniforms && (this.functions[i] = this.functions[i].replace(/\s*?uniform .*?;/g, `
`)), r.removeVaryings && (this.functions[i] = this.functions[i].replace(/\s*?(varying|in) .+?;/g, `
`)), r.replaceStrings)
        for (let s = 0; s < r.replaceStrings.length; s++) {
          const a = r.replaceStrings[s];
          this.functions[i] = this.functions[i].replace(a.search, a.replace);
        }
    }
  }
  /**
   * @internal
   */
  _registerTempVariable(e) {
    return this.sharedData.temps.indexOf(e) !== -1 ? !1 : (this.sharedData.temps.push(e), !0);
  }
  /**
   * @internal
   */
  _emitVaryingFromString(e, t, r = "", n = !1) {
    return this.sharedData.varyings.indexOf(e) !== -1 ? !1 : (this.sharedData.varyings.push(e), r && (r.startsWith("defined(") ? this.sharedData.varyingDeclaration += `#if ${r}
` : this.sharedData.varyingDeclaration += `${n ? "#ifndef" : "#ifdef"} ${r}
`), this.sharedData.varyingDeclaration += `varying ${t} ${e};
`, r && (this.sharedData.varyingDeclaration += `#endif
`), !0);
  }
  /**
   * @internal
   */
  _emitUniformFromString(e, t, r = "", n = !1) {
    this.uniforms.indexOf(e) === -1 && (this.uniforms.push(e), r && (r.startsWith("defined(") ? this._uniformDeclaration += `#if ${r}
` : this._uniformDeclaration += `${n ? "#ifndef" : "#ifdef"} ${r}
`), this._uniformDeclaration += `uniform ${t} ${e};
`, r && (this._uniformDeclaration += `#endif
`));
  }
  /**
   * @internal
   */
  _emitFloat(e) {
    return e.toString() === e.toFixed(0) ? `${e}.0` : e.toString();
  }
}
class W6e {
  /** Creates a new shared data */
  constructor() {
    this.temps = [], this.varyings = [], this.varyingDeclaration = "", this.inputBlocks = [], this.textureBlocks = [], this.bindableBlocks = [], this.forcedBindableBlocks = [], this.blocksWithFallbacks = [], this.blocksWithDefines = [], this.repeatableContentBlocks = [], this.dynamicUniformBlocks = [], this.blockingBlocks = [], this.animatedInputs = [], this.variableNames = {}, this.defineNames = {}, this.hints = {
      needWorldViewMatrix: !1,
      needWorldViewProjectionMatrix: !1,
      needAlphaBlending: !1,
      needAlphaTesting: !1
    }, this.checks = {
      emitVertex: !1,
      emitFragment: !1,
      notConnectedNonOptionalInputs: new Array()
    }, this.allowEmptyVertexProgram = !1, this.variableNames.position = 0, this.variableNames.normal = 0, this.variableNames.tangent = 0, this.variableNames.uv = 0, this.variableNames.uv2 = 0, this.variableNames.uv3 = 0, this.variableNames.uv4 = 0, this.variableNames.uv5 = 0, this.variableNames.uv6 = 0, this.variableNames.color = 0, this.variableNames.matricesIndices = 0, this.variableNames.matricesWeights = 0, this.variableNames.matricesIndicesExtra = 0, this.variableNames.matricesWeightsExtra = 0, this.variableNames.diffuseBase = 0, this.variableNames.specularBase = 0, this.variableNames.worldPos = 0, this.variableNames.shadow = 0, this.variableNames.view = 0, this.variableNames.vTBN = 0, this.defineNames.MAINUV0 = 0, this.defineNames.MAINUV1 = 0, this.defineNames.MAINUV2 = 0, this.defineNames.MAINUV3 = 0, this.defineNames.MAINUV4 = 0, this.defineNames.MAINUV5 = 0, this.defineNames.MAINUV6 = 0, this.defineNames.MAINUV7 = 0;
  }
  /**
   * Emits console errors and exceptions if there is a failing check
   */
  emitErrors() {
    let e = "";
    !this.checks.emitVertex && !this.allowEmptyVertexProgram && (e += `NodeMaterial does not have a vertex output. You need to at least add a block that generates a glPosition value.
`), this.checks.emitFragment || (e += `NodeMaterial does not have a fragment output. You need to at least add a block that generates a glFragColor value.
`);
    for (const t of this.checks.notConnectedNonOptionalInputs)
      e += `input ${t.name} from block ${t.ownerBlock.name}[${t.ownerBlock.getClassName()}] is not connected and is not optional.
`;
    if (e)
      throw `Build of NodeMaterial failed:
` + e;
  }
}
var pc;
(function(A) {
  A[A.Compatible = 0] = "Compatible", A[A.TypeIncompatible = 1] = "TypeIncompatible", A[A.TargetIncompatible = 2] = "TargetIncompatible", A[A.HierarchyIssue = 3] = "HierarchyIssue";
})(pc || (pc = {}));
var ao;
(function(A) {
  A[A.Input = 0] = "Input", A[A.Output = 1] = "Output";
})(ao || (ao = {}));
class um {
  /**
   * Checks if two types are equivalent
   * @param type1 type 1 to check
   * @param type2 type 2 to check
   * @returns true if both types are equivalent, else false
   */
  static AreEquivalentTypes(e, t) {
    switch (e) {
      case de.Vector3: {
        if (t === de.Color3)
          return !0;
        break;
      }
      case de.Vector4: {
        if (t === de.Color4)
          return !0;
        break;
      }
      case de.Color3: {
        if (t === de.Vector3)
          return !0;
        break;
      }
      case de.Color4: {
        if (t === de.Vector4)
          return !0;
        break;
      }
    }
    return !1;
  }
  /** Gets the direction of the point */
  get direction() {
    return this._direction;
  }
  /**
   * Gets or sets the associated variable name in the shader
   */
  get associatedVariableName() {
    return this._ownerBlock.isInput ? this._ownerBlock.associatedVariableName : (!this._enforceAssociatedVariableName || !this._associatedVariableName) && this._connectedPoint ? this._connectedPoint.associatedVariableName : this._associatedVariableName;
  }
  set associatedVariableName(e) {
    this._associatedVariableName = e;
  }
  /** Get the inner type (ie AutoDetect for instance instead of the inferred one) */
  get innerType() {
    return this._linkedConnectionSource && this._linkedConnectionSource.isConnected ? this.type : this._type;
  }
  /**
   * Gets or sets the connection point type (default is float)
   */
  get type() {
    if (this._type === de.AutoDetect) {
      if (this._ownerBlock.isInput)
        return this._ownerBlock.type;
      if (this._connectedPoint)
        return this._connectedPoint.type;
      if (this._linkedConnectionSource && this._linkedConnectionSource.isConnected)
        return this._linkedConnectionSource.type;
    }
    if (this._type === de.BasedOnInput) {
      if (this._typeConnectionSource)
        return !this._typeConnectionSource.isConnected && this._defaultConnectionPointType ? this._defaultConnectionPointType : this._typeConnectionSource.type;
      if (this._defaultConnectionPointType)
        return this._defaultConnectionPointType;
    }
    return this._type;
  }
  set type(e) {
    this._type = e;
  }
  /** Gets or sets the target of that connection point */
  get target() {
    return !this._prioritizeVertex || !this._ownerBlock ? this._target : this._target !== Ve.VertexAndFragment ? this._target : this._ownerBlock.target === Ve.Fragment ? Ve.Fragment : Ve.Vertex;
  }
  set target(e) {
    this._target = e;
  }
  /**
   * Gets a boolean indicating that the current point is connected to another NodeMaterialBlock
   */
  get isConnected() {
    return this.connectedPoint !== null || this.hasEndpoints;
  }
  /**
   * Gets a boolean indicating that the current point is connected to an input block
   */
  get isConnectedToInputBlock() {
    return this.connectedPoint !== null && this.connectedPoint.ownerBlock.isInput;
  }
  /**
   * Gets a the connected input block (if any)
   */
  get connectInputBlock() {
    return this.isConnectedToInputBlock ? this.connectedPoint.ownerBlock : null;
  }
  /** Get the other side of the connection (if any) */
  get connectedPoint() {
    return this._connectedPoint;
  }
  /** Get the block that owns this connection point */
  get ownerBlock() {
    return this._ownerBlock;
  }
  /** Get the block connected on the other side of this connection (if any) */
  get sourceBlock() {
    return this._connectedPoint ? this._connectedPoint.ownerBlock : null;
  }
  /** Get the block connected on the endpoints of this connection (if any) */
  get connectedBlocks() {
    return this._endpoints.length === 0 ? [] : this._endpoints.map((e) => e.ownerBlock);
  }
  /** Gets the list of connected endpoints */
  get endpoints() {
    return this._endpoints;
  }
  /** Gets a boolean indicating if that output point is connected to at least one input */
  get hasEndpoints() {
    return this._endpoints && this._endpoints.length > 0;
  }
  /** Gets a boolean indicating that this connection has a path to the vertex output*/
  get isDirectlyConnectedToVertexOutput() {
    if (!this.hasEndpoints)
      return !1;
    for (const e of this._endpoints)
      if (e.ownerBlock.target === Ve.Vertex || (e.ownerBlock.target === Ve.Neutral || e.ownerBlock.target === Ve.VertexAndFragment) && e.ownerBlock.outputs.some((t) => t.isDirectlyConnectedToVertexOutput))
        return !0;
    return !1;
  }
  /** Gets a boolean indicating that this connection will be used in the vertex shader */
  get isConnectedInVertexShader() {
    if (this.target === Ve.Vertex)
      return !0;
    if (!this.hasEndpoints)
      return !1;
    for (const e of this._endpoints)
      if (e.ownerBlock.target === Ve.Vertex || e.target === Ve.Vertex || (e.ownerBlock.target === Ve.Neutral || e.ownerBlock.target === Ve.VertexAndFragment) && e.ownerBlock.outputs.some((t) => t.isConnectedInVertexShader))
        return !0;
    return !1;
  }
  /** Gets a boolean indicating that this connection will be used in the fragment shader */
  get isConnectedInFragmentShader() {
    if (this.target === Ve.Fragment)
      return !0;
    if (!this.hasEndpoints)
      return !1;
    for (const e of this._endpoints)
      if (e.ownerBlock.target === Ve.Fragment || (e.ownerBlock.target === Ve.Neutral || e.ownerBlock.target === Ve.VertexAndFragment) && e.ownerBlock.isConnectedInFragmentShader())
        return !0;
    return !1;
  }
  /**
   * Creates a block suitable to be used as an input for this input point.
   * If null is returned, a block based on the point type will be created.
   * @returns The returned string parameter is the name of the output point of NodeMaterialBlock (first parameter of the returned array) that can be connected to the input
   */
  createCustomInputBlock() {
    return null;
  }
  /**
   * Creates a new connection point
   * @param name defines the connection point name
   * @param ownerBlock defines the block hosting this connection point
   * @param direction defines the direction of the connection point
   */
  constructor(e, t, r) {
    this._connectedPoint = null, this._endpoints = new Array(), this._typeConnectionSource = null, this._defaultConnectionPointType = null, this._linkedConnectionSource = null, this._acceptedConnectionPointType = null, this._type = de.Float, this._enforceAssociatedVariableName = !1, this.needDualDirectionValidation = !1, this.acceptedConnectionPointTypes = [], this.excludedConnectionPointTypes = [], this.onConnectionObservable = new Oe(), this.isExposedOnFrame = !1, this.exposedPortPosition = -1, this._prioritizeVertex = !1, this._target = Ve.VertexAndFragment, this._ownerBlock = t, this.name = e, this._direction = r;
  }
  /**
   * Gets the current class name e.g. "NodeMaterialConnectionPoint"
   * @returns the class name
   */
  getClassName() {
    return "NodeMaterialConnectionPoint";
  }
  /**
   * Gets a boolean indicating if the current point can be connected to another point
   * @param connectionPoint defines the other connection point
   * @returns a boolean
   */
  canConnectTo(e) {
    return this.checkCompatibilityState(e) === pc.Compatible;
  }
  /**
   * Gets a number indicating if the current point can be connected to another point
   * @param connectionPoint defines the other connection point
   * @returns a number defining the compatibility state
   */
  checkCompatibilityState(e) {
    const t = this._ownerBlock, r = e.ownerBlock;
    if (t.target === Ve.Fragment) {
      if (r.target === Ve.Vertex)
        return pc.TargetIncompatible;
      for (const s of r.outputs)
        if (s.ownerBlock.target != Ve.Neutral && s.isConnectedInVertexShader)
          return pc.TargetIncompatible;
    }
    if (this.type !== e.type && e.innerType !== de.AutoDetect)
      return um.AreEquivalentTypes(this.type, e.type) || e.acceptedConnectionPointTypes && e.acceptedConnectionPointTypes.indexOf(this.type) !== -1 || e._acceptedConnectionPointType && um.AreEquivalentTypes(e._acceptedConnectionPointType.type, this.type) ? pc.Compatible : pc.TypeIncompatible;
    if (e.excludedConnectionPointTypes && e.excludedConnectionPointTypes.indexOf(this.type) !== -1)
      return pc.TypeIncompatible;
    let n = r, i = t;
    return this.direction === ao.Input && (n = t, i = r), n.isAnAncestorOf(i) ? pc.HierarchyIssue : pc.Compatible;
  }
  /**
   * Connect this point to another connection point
   * @param connectionPoint defines the other connection point
   * @param ignoreConstraints defines if the system will ignore connection type constraints (default is false)
   * @returns the current connection point
   */
  connectTo(e, t = !1) {
    if (!t && !this.canConnectTo(e))
      throw "Cannot connect these two connectors.";
    return this._endpoints.push(e), e._connectedPoint = this, this._enforceAssociatedVariableName = !1, this.onConnectionObservable.notifyObservers(e), e.onConnectionObservable.notifyObservers(this), this;
  }
  /**
   * Disconnect this point from one of his endpoint
   * @param endpoint defines the other connection point
   * @returns the current connection point
   */
  disconnectFrom(e) {
    const t = this._endpoints.indexOf(e);
    return t === -1 ? this : (this._endpoints.splice(t, 1), e._connectedPoint = null, this._enforceAssociatedVariableName = !1, e._enforceAssociatedVariableName = !1, this);
  }
  /**
   * Fill the list of excluded connection point types with all types other than those passed in the parameter
   * @param mask Types (ORed values of NodeMaterialBlockConnectionPointTypes) that are allowed, and thus will not be pushed to the excluded list
   */
  addExcludedConnectionPointFromAllowedTypes(e) {
    let t = 1;
    for (; t < de.All; )
      e & t || this.excludedConnectionPointTypes.push(t), t = t << 1;
  }
  /**
   * Serializes this point in a JSON representation
   * @param isInput defines if the connection point is an input (default is true)
   * @returns the serialized point object
   */
  serialize(e = !0) {
    const t = {};
    return t.name = this.name, t.displayName = this.displayName, e && this.connectedPoint && (t.inputName = this.name, t.targetBlockId = this.connectedPoint.ownerBlock.uniqueId, t.targetConnectionName = this.connectedPoint.name, t.isExposedOnFrame = !0, t.exposedPortPosition = this.exposedPortPosition), (this.isExposedOnFrame || this.exposedPortPosition >= 0) && (t.isExposedOnFrame = !0, t.exposedPortPosition = this.exposedPortPosition), t;
  }
  /**
   * Release resources
   */
  dispose() {
    this.onConnectionObservable.clear();
  }
}
class Mr {
  /**
   * Gets the name of the block
   */
  get name() {
    return this._name;
  }
  /**
   * Sets the name of the block. Will check if the name is valid.
   */
  set name(e) {
    this.validateBlockName(e) && (this._name = e);
  }
  /**
   * Gets a boolean indicating that this block can only be used once per NodeMaterial
   */
  get isUnique() {
    return this._isUnique;
  }
  /**
   * Gets a boolean indicating that this block is an end block (e.g. it is generating a system value)
   */
  get isFinalMerger() {
    return this._isFinalMerger;
  }
  /**
   * Gets a boolean indicating that this block is an input (e.g. it sends data to the shader)
   */
  get isInput() {
    return this._isInput;
  }
  /**
   * Gets a boolean indicating if this block is a teleport out
   */
  get isTeleportOut() {
    return this._isTeleportOut;
  }
  /**
   * Gets a boolean indicating if this block is a teleport in
   */
  get isTeleportIn() {
    return this._isTeleportIn;
  }
  /**
   * Gets or sets the build Id
   */
  get buildId() {
    return this._buildId;
  }
  set buildId(e) {
    this._buildId = e;
  }
  /**
   * Gets or sets the target of the block
   */
  get target() {
    return this._target;
  }
  set target(e) {
    this._target & e || (this._target = e);
  }
  /**
   * Gets the list of input points
   */
  get inputs() {
    return this._inputs;
  }
  /** Gets the list of output points */
  get outputs() {
    return this._outputs;
  }
  /**
   * Find an input by its name
   * @param name defines the name of the input to look for
   * @returns the input or null if not found
   */
  getInputByName(e) {
    const t = this._inputs.filter((r) => r.name === e);
    return t.length ? t[0] : null;
  }
  /**
   * Find an output by its name
   * @param name defines the name of the output to look for
   * @returns the output or null if not found
   */
  getOutputByName(e) {
    const t = this._outputs.filter((r) => r.name === e);
    return t.length ? t[0] : null;
  }
  /**
   * Creates a new NodeMaterialBlock
   * @param name defines the block name
   * @param target defines the target of that block (Vertex by default)
   * @param isFinalMerger defines a boolean indicating that this block is an end block (e.g. it is generating a system value). Default is false
   */
  constructor(e, t = Ve.Vertex, r = !1) {
    this._isFinalMerger = !1, this._isInput = !1, this._isTeleportOut = !1, this._isTeleportIn = !1, this._name = "", this._isUnique = !1, this.inputsAreExclusive = !1, this._codeVariableName = "", this._inputs = new Array(), this._outputs = new Array(), this.comments = "", this.visibleInInspector = !1, this.visibleOnFrame = !1, this._target = t, this._originalTargetIsNeutral = t === Ve.Neutral, this._isFinalMerger = r, this._isInput = this.getClassName() === "InputBlock", this._isTeleportOut = this.getClassName() === "NodeMaterialTeleportOutBlock", this._isTeleportIn = this.getClassName() === "NodeMaterialTeleportInBlock", this._name = e, this.uniqueId = bR.UniqueId;
  }
  /** @internal */
  _setInitialTarget(e) {
    this._target = e, this._originalTargetIsNeutral = e === Ve.Neutral;
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  initialize(e) {
  }
  /**
   * Bind data to effect. Will only be called for blocks with isBindable === true
   * @param effect defines the effect to bind data to
   * @param nodeMaterial defines the hosting NodeMaterial
   * @param mesh defines the mesh that will be rendered
   * @param subMesh defines the submesh that will be rendered
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  bind(e, t, r, n) {
  }
  _declareOutput(e, t) {
    return `${t._getGLType(e.type)} ${e.associatedVariableName}`;
  }
  _writeVariable(e) {
    return e.connectedPoint ? `${e.associatedVariableName}` : "0.";
  }
  _writeFloat(e) {
    let t = e.toString();
    return t.indexOf(".") === -1 && (t += ".0"), `${t}`;
  }
  /**
   * Gets the current class name e.g. "NodeMaterialBlock"
   * @returns the class name
   */
  getClassName() {
    return "NodeMaterialBlock";
  }
  /** Gets a boolean indicating that this connection will be used in the fragment shader */
  isConnectedInFragmentShader() {
    return this.outputs.some((e) => e.isConnectedInFragmentShader);
  }
  /**
   * Register a new input. Must be called inside a block constructor
   * @param name defines the connection point name
   * @param type defines the connection point type
   * @param isOptional defines a boolean indicating that this input can be omitted
   * @param target defines the target to use to limit the connection point (will be VertexAndFragment by default)
   * @param point an already created connection point. If not provided, create a new one
   * @returns the current block
   */
  registerInput(e, t, r = !1, n, i) {
    return i = i ?? new um(e, this, ao.Input), i.type = t, i.isOptional = r, n && (i.target = n), this._inputs.push(i), this;
  }
  /**
   * Register a new output. Must be called inside a block constructor
   * @param name defines the connection point name
   * @param type defines the connection point type
   * @param target defines the target to use to limit the connection point (will be VertexAndFragment by default)
   * @param point an already created connection point. If not provided, create a new one
   * @returns the current block
   */
  registerOutput(e, t, r, n) {
    return n = n ?? new um(e, this, ao.Output), n.type = t, r && (n.target = r), this._outputs.push(n), this;
  }
  /**
   * Will return the first available input e.g. the first one which is not an uniform or an attribute
   * @param forOutput defines an optional connection point to check compatibility with
   * @returns the first available input or null
   */
  getFirstAvailableInput(e = null) {
    for (const t of this._inputs)
      if (!t.connectedPoint && (!e || e.type === t.type || t.type === de.AutoDetect))
        return t;
    return null;
  }
  /**
   * Will return the first available output e.g. the first one which is not yet connected and not a varying
   * @param forBlock defines an optional block to check compatibility with
   * @returns the first available input or null
   */
  getFirstAvailableOutput(e = null) {
    for (const t of this._outputs)
      if (!e || !e.target || e.target === Ve.Neutral || e.target & t.target)
        return t;
    return null;
  }
  /**
   * Gets the sibling of the given output
   * @param current defines the current output
   * @returns the next output in the list or null
   */
  getSiblingOutput(e) {
    const t = this._outputs.indexOf(e);
    return t === -1 || t >= this._outputs.length ? null : this._outputs[t + 1];
  }
  /**
   * Checks if the current block is an ancestor of a given block
   * @param block defines the potential descendant block to check
   * @returns true if block is a descendant
   */
  isAnAncestorOf(e) {
    for (const t of this._outputs)
      if (t.hasEndpoints) {
        for (const r of t.endpoints)
          if (r.ownerBlock === e || r.ownerBlock.isAnAncestorOf(e))
            return !0;
      }
    return !1;
  }
  /**
   * Connect current block with another block
   * @param other defines the block to connect with
   * @param options define the various options to help pick the right connections
   * @param options.input
   * @param options.output
   * @param options.outputSwizzle
   * @returns the current block
   */
  connectTo(e, t) {
    if (this._outputs.length === 0)
      return;
    let r = t && t.output ? this.getOutputByName(t.output) : this.getFirstAvailableOutput(e), n = !0;
    for (; n; ) {
      const i = t && t.input ? e.getInputByName(t.input) : e.getFirstAvailableInput(r);
      if (r && i && r.canConnectTo(i))
        r.connectTo(i), n = !1;
      else if (r)
        r = this.getSiblingOutput(r);
      else
        throw "Unable to find a compatible match";
    }
    return this;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _buildBlock(e) {
  }
  /**
   * Add uniforms, samplers and uniform buffers at compilation time
   * @param state defines the state to update
   * @param nodeMaterial defines the node material requesting the update
   * @param defines defines the material defines to update
   * @param uniformBuffers defines the list of uniform buffer names
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  updateUniformsAndSamples(e, t, r, n) {
  }
  /**
   * Add potential fallbacks if shader compilation fails
   * @param mesh defines the mesh to be rendered
   * @param fallbacks defines the current prioritized list of fallbacks
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  provideFallbacks(e, t) {
  }
  /**
   * Initialize defines for shader compilation
   * @param mesh defines the mesh to be rendered
   * @param nodeMaterial defines the node material requesting the update
   * @param defines defines the material defines to update
   * @param useInstances specifies that instances should be used
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  initializeDefines(e, t, r, n = !1) {
  }
  /**
   * Update defines for shader compilation
   * @param mesh defines the mesh to be rendered
   * @param nodeMaterial defines the node material requesting the update
   * @param defines defines the material defines to update
   * @param useInstances specifies that instances should be used
   * @param subMesh defines which submesh to render
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  prepareDefines(e, t, r, n = !1, i) {
  }
  /**
   * Lets the block try to connect some inputs automatically
   * @param material defines the hosting NodeMaterial
   * @param additionalFilteringInfo optional additional filtering condition when looking for compatible blocks
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  autoConfigure(e, t = () => !0) {
  }
  /**
   * Function called when a block is declared as repeatable content generator
   * @param vertexShaderState defines the current compilation state for the vertex shader
   * @param fragmentShaderState defines the current compilation state for the fragment shader
   * @param mesh defines the mesh to be rendered
   * @param defines defines the material defines to update
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  replaceRepeatableContent(e, t, r, n) {
  }
  /** Gets a boolean indicating that the code of this block will be promoted to vertex shader even if connected to fragment output */
  get willBeGeneratedIntoVertexShaderFromFragmentShader() {
    return this.isInput || this.isFinalMerger || this._outputs.some((e) => e.isDirectlyConnectedToVertexOutput) || this.target === Ve.Vertex ? !1 : !!((this.target === Ve.VertexAndFragment || this.target === Ve.Neutral) && this._outputs.some((e) => e.isConnectedInVertexShader));
  }
  /**
   * Checks if the block is ready
   * @param mesh defines the mesh to be rendered
   * @param nodeMaterial defines the node material requesting the update
   * @param defines defines the material defines to update
   * @param useInstances specifies that instances should be used
   * @returns true if the block is ready
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  isReady(e, t, r, n = !1) {
    return !0;
  }
  _linkConnectionTypes(e, t, r = !1) {
    r ? this._inputs[t]._acceptedConnectionPointType = this._inputs[e] : this._inputs[e]._linkedConnectionSource = this._inputs[t], this._inputs[t]._linkedConnectionSource = this._inputs[e];
  }
  _processBuild(e, t, r, n) {
    e.build(t, n);
    const i = t._vertexState != null, s = e._buildTarget === Ve.Vertex && e.target !== Ve.VertexAndFragment;
    if (i && (!(e.target & e._buildTarget) || !(e.target & r.target) || this.target !== Ve.VertexAndFragment && s) && (!e.isInput && t.target !== e._buildTarget || // block was already emitted by vertex shader
    e.isInput && e.isAttribute && !e._noContextSwitch)) {
      const a = r.connectedPoint;
      t._vertexState._emitVaryingFromString("v_" + a.associatedVariableName, t._getGLType(a.type)) && (t._vertexState.compilationString += `${"v_" + a.associatedVariableName} = ${a.associatedVariableName};
`), r.associatedVariableName = "v_" + a.associatedVariableName, r._enforceAssociatedVariableName = !0;
    }
  }
  /**
   * Validates the new name for the block node.
   * @param newName the new name to be given to the node.
   * @returns false if the name is a reserve word, else true.
   */
  validateBlockName(e) {
    const t = [
      "position",
      "normal",
      "tangent",
      "particle_positionw",
      "uv",
      "uv2",
      "uv3",
      "uv4",
      "uv5",
      "uv6",
      "position2d",
      "particle_uv",
      "matricesIndices",
      "matricesWeights",
      "world0",
      "world1",
      "world2",
      "world3",
      "particle_color",
      "particle_texturemask"
    ];
    for (const r of t)
      if (e === r)
        return !1;
    return !0;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _customBuildStep(e, t) {
  }
  /**
   * Compile the current node and generate the shader code
   * @param state defines the current compilation state (uniforms, samplers, current string)
   * @param activeBlocks defines the list of active blocks (i.e. blocks to compile)
   * @returns true if already built
   */
  build(e, t) {
    if (this._buildId === e.sharedData.buildId)
      return !0;
    if (!this.isInput)
      for (const r of this._outputs)
        r.associatedVariableName || (r.associatedVariableName = e._getFreeVariableName(r.name));
    for (const r of this._inputs) {
      if (!r.connectedPoint) {
        r.isOptional || e.sharedData.checks.notConnectedNonOptionalInputs.push(r);
        continue;
      }
      if (this.target !== Ve.Neutral && (!(r.target & this.target) || !(r.target & e.target)))
        continue;
      const n = r.connectedPoint.ownerBlock;
      n && n !== this && this._processBuild(n, e, r, t);
    }
    if (this._customBuildStep(e, t), this._buildId === e.sharedData.buildId)
      return !0;
    if (e.sharedData.verbose && console.log(`${e.target === Ve.Vertex ? "Vertex shader" : "Fragment shader"}: Building ${this.name} [${this.getClassName()}]`), this.isFinalMerger)
      switch (e.target) {
        case Ve.Vertex:
          e.sharedData.checks.emitVertex = !0;
          break;
        case Ve.Fragment:
          e.sharedData.checks.emitFragment = !0;
          break;
      }
    !this.isInput && e.sharedData.emitComments && (e.compilationString += `
//${this.name}
`), this._buildBlock(e), this._buildId = e.sharedData.buildId, this._buildTarget = e.target;
    for (const r of this._outputs)
      if (r.target & e.target)
        for (const n of r.endpoints) {
          const i = n.ownerBlock;
          i && i.target & e.target && t.indexOf(i) !== -1 && this._processBuild(i, e, n, t);
        }
    return !1;
  }
  _inputRename(e) {
    return e;
  }
  _outputRename(e) {
    return e;
  }
  _dumpPropertiesCode() {
    const e = this._codeVariableName;
    return `${e}.visibleInInspector = ${this.visibleInInspector};
${e}.visibleOnFrame = ${this.visibleOnFrame};
${e}.target = ${this.target};
`;
  }
  /**
   * @internal
   */
  _dumpCode(e, t) {
    t.push(this);
    const r = this.name.replace(/[^A-Za-z_]+/g, "");
    if (this._codeVariableName = r || `${this.getClassName()}_${this.uniqueId}`, e.indexOf(this._codeVariableName) !== -1) {
      let i = 0;
      do
        i++, this._codeVariableName = r + i;
      while (e.indexOf(this._codeVariableName) !== -1);
    }
    e.push(this._codeVariableName);
    let n = `
// ${this.getClassName()}
`;
    this.comments && (n += `// ${this.comments}
`), n += `var ${this._codeVariableName} = new BABYLON.${this.getClassName()}("${this.name}");
`, n += this._dumpPropertiesCode();
    for (const i of this.inputs) {
      if (!i.isConnected)
        continue;
      const a = i.connectedPoint.ownerBlock;
      t.indexOf(a) === -1 && (n += a._dumpCode(e, t));
    }
    for (const i of this.outputs)
      if (i.hasEndpoints)
        for (const s of i.endpoints) {
          const a = s.ownerBlock;
          a && t.indexOf(a) === -1 && (n += a._dumpCode(e, t));
        }
    return n;
  }
  /**
   * @internal
   */
  _dumpCodeForOutputConnections(e) {
    let t = "";
    if (e.indexOf(this) !== -1)
      return t;
    e.push(this);
    for (const r of this.inputs) {
      if (!r.isConnected)
        continue;
      const n = r.connectedPoint, i = n.ownerBlock;
      t += i._dumpCodeForOutputConnections(e), t += `${i._codeVariableName}.${i._outputRename(n.name)}.connectTo(${this._codeVariableName}.${this._inputRename(r.name)});
`;
    }
    return t;
  }
  /**
   * Clone the current block to a new identical block
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a copy of the current block
   */
  clone(e, t = "") {
    const r = this.serialize(), n = Jo(r.customType);
    if (n) {
      const i = new n();
      return i._deserialize(r, e, t), i;
    }
    return null;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = {};
    e.customType = "BABYLON." + this.getClassName(), e.id = this.uniqueId, e.name = this.name, e.comments = this.comments, e.visibleInInspector = this.visibleInInspector, e.visibleOnFrame = this.visibleOnFrame, e.target = this.target, e.inputs = [], e.outputs = [];
    for (const t of this.inputs)
      e.inputs.push(t.serialize());
    for (const t of this.outputs)
      e.outputs.push(t.serialize(!1));
    return e;
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _deserialize(e, t, r) {
    var n;
    this.name = e.name, this.comments = e.comments, this.visibleInInspector = !!e.visibleInInspector, this.visibleOnFrame = !!e.visibleOnFrame, this._target = (n = e.target) !== null && n !== void 0 ? n : this.target, this._deserializePortDisplayNamesAndExposedOnFrame(e);
  }
  _deserializePortDisplayNamesAndExposedOnFrame(e) {
    const t = e.inputs, r = e.outputs;
    t && t.forEach((n, i) => {
      n.displayName && (this.inputs[i].displayName = n.displayName), n.isExposedOnFrame && (this.inputs[i].isExposedOnFrame = n.isExposedOnFrame, this.inputs[i].exposedPortPosition = n.exposedPortPosition);
    }), r && r.forEach((n, i) => {
      n.displayName && (this.outputs[i].displayName = n.displayName), n.isExposedOnFrame && (this.outputs[i].isExposedOnFrame = n.isExposedOnFrame, this.outputs[i].exposedPortPosition = n.exposedPortPosition);
    });
  }
  /**
   * Release resources
   */
  dispose() {
    for (const e of this.inputs)
      e.dispose();
    for (const e of this.outputs)
      e.dispose();
  }
}
class JC extends Mr {
  /**
   * Creates a new TransformBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.complementW = 1, this.complementZ = 0, this.target = Ve.Vertex, this.registerInput("vector", de.AutoDetect), this.registerInput("transform", de.Matrix), this.registerOutput("output", de.Vector4), this.registerOutput("xyz", de.Vector3), this._inputs[0].onConnectionObservable.add((t) => {
      if (t.ownerBlock.isInput) {
        const r = t.ownerBlock;
        (r.name === "normal" || r.name === "tangent") && (this.complementW = 0);
      }
    });
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "TransformBlock";
  }
  /**
   * Gets the vector input
   */
  get vector() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets the xyz output component
   */
  get xyz() {
    return this._outputs[1];
  }
  /**
   * Gets the matrix transform input
   */
  get transform() {
    return this._inputs[1];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.vector, r = this.transform;
    if (t.connectedPoint) {
      if (this.complementW === 0) {
        const n = `//${this.name}`;
        e._emitFunctionFromInclude("helperFunctions", n), e.sharedData.blocksWithDefines.push(this);
        const i = e._getFreeVariableName(`${r.associatedVariableName}_NUS`);
        switch (e.compilationString += `mat3 ${i} = mat3(${r.associatedVariableName});
`, e.compilationString += `#ifdef NONUNIFORMSCALING
`, e.compilationString += `${i} = transposeMat3(inverseMat3(${i}));
`, e.compilationString += `#endif
`, t.connectedPoint.type) {
          case de.Vector2:
            e.compilationString += this._declareOutput(this.output, e) + ` = vec4(${i} * vec3(${t.associatedVariableName}, ${this._writeFloat(this.complementZ)}), ${this._writeFloat(this.complementW)});
`;
            break;
          case de.Vector3:
          case de.Color3:
            e.compilationString += this._declareOutput(this.output, e) + ` = vec4(${i} * ${t.associatedVariableName}, ${this._writeFloat(this.complementW)});
`;
            break;
          default:
            e.compilationString += this._declareOutput(this.output, e) + ` = vec4(${i} * ${t.associatedVariableName}.xyz, ${this._writeFloat(this.complementW)});
`;
            break;
        }
      } else {
        const n = r.associatedVariableName;
        switch (t.connectedPoint.type) {
          case de.Vector2:
            e.compilationString += this._declareOutput(this.output, e) + ` = ${n} * vec4(${t.associatedVariableName}, ${this._writeFloat(this.complementZ)}, ${this._writeFloat(this.complementW)});
`;
            break;
          case de.Vector3:
          case de.Color3:
            e.compilationString += this._declareOutput(this.output, e) + ` = ${n} * vec4(${t.associatedVariableName}, ${this._writeFloat(this.complementW)});
`;
            break;
          default:
            e.compilationString += this._declareOutput(this.output, e) + ` = ${n} * ${t.associatedVariableName};
`;
            break;
        }
      }
      this.xyz.hasEndpoints && (e.compilationString += this._declareOutput(this.xyz, e) + ` = ${this.output.associatedVariableName}.xyz;
`);
    }
    return this;
  }
  /**
   * Update defines for shader compilation
   * @param mesh defines the mesh to be rendered
   * @param nodeMaterial defines the node material requesting the update
   * @param defines defines the material defines to update
   */
  prepareDefines(e, t, r) {
    e.nonUniformScaling && r.setValue("NONUNIFORMSCALING", !0);
  }
  serialize() {
    const e = super.serialize();
    return e.complementZ = this.complementZ, e.complementW = this.complementW, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.complementZ = e.complementZ !== void 0 ? e.complementZ : 0, this.complementW = e.complementW !== void 0 ? e.complementW : 1;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode() + `${this._codeVariableName}.complementZ = ${this.complementZ};
`;
    return e += `${this._codeVariableName}.complementW = ${this.complementW};
`, e;
  }
}
Ue("BABYLON.TransformBlock", JC);
class mI extends Mr {
  /**
   * Creates a new VertexOutputBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Vertex, !0), this.registerInput("vector", de.Vector4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "VertexOutputBlock";
  }
  /**
   * Gets the vector input component
   */
  get vector() {
    return this._inputs[0];
  }
  _isLogarithmicDepthEnabled(e, t) {
    if (t)
      return !0;
    for (const r of e)
      if (r.useLogarithmicDepth)
        return !0;
    return !1;
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.vector;
    return e.compilationString += `gl_Position = ${t.associatedVariableName};
`, this._isLogarithmicDepthEnabled(e.sharedData.fragmentOutputNodes, e.sharedData.nodeMaterial.useLogarithmicDepth) && (e._emitUniformFromString("logarithmicDepthConstant", "float"), e._emitVaryingFromString("vFragmentDepth", "float"), e.compilationString += `vFragmentDepth = 1.0 + gl_Position.w;
`, e.compilationString += `gl_Position.z = log2(max(0.000001, vFragmentDepth)) * logarithmicDepthConstant;
`), this;
  }
}
Ue("BABYLON.VertexOutputBlock", mI);
var Gr;
(function(A) {
  A[A.Boolean = 0] = "Boolean", A[A.Float = 1] = "Float", A[A.Int = 2] = "Int", A[A.Vector2 = 3] = "Vector2", A[A.List = 4] = "List";
})(Gr || (Gr = {}));
function rn(A, e = Gr.Boolean, t = "PROPERTIES", r) {
  return (n, i) => {
    let s = n._propStore;
    s || (s = [], n._propStore = s), s.push({
      propertyName: i,
      displayName: A,
      type: e,
      groupName: t,
      options: r ?? {}
    });
  };
}
class iq extends Mr {
  /**
   * Create a new FragmentOutputBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment, !0), this.convertToGammaSpace = !1, this.convertToLinearSpace = !1, this.useLogarithmicDepth = !1, this.registerInput("rgba", de.Color4, !0), this.registerInput("rgb", de.AutoDetect, !0), this.registerInput("a", de.Float, !0), this.rgb.addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Vector3 | de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "FragmentOutputBlock";
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("logarithmicDepthConstant"), e._excludeVariableName("vFragmentDepth");
  }
  /**
   * Gets the rgba input component
   */
  get rgba() {
    return this._inputs[0];
  }
  /**
   * Gets the rgb input component
   */
  get rgb() {
    return this._inputs[1];
  }
  /**
   * Gets the a input component
   */
  get a() {
    return this._inputs[2];
  }
  prepareDefines(e, t, r) {
    r.setValue(this._linearDefineName, this.convertToLinearSpace, !0), r.setValue(this._gammaDefineName, this.convertToGammaSpace, !0);
  }
  bind(e, t, r) {
    (this.useLogarithmicDepth || t.useLogarithmicDepth) && r && Ye.BindLogDepth(void 0, e, r.getScene());
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.rgba, r = this.rgb, n = this.a;
    e.sharedData.hints.needAlphaBlending = t.isConnected || n.isConnected, e.sharedData.blocksWithDefines.push(this), (this.useLogarithmicDepth || e.sharedData.nodeMaterial.useLogarithmicDepth) && (e._emitUniformFromString("logarithmicDepthConstant", "float"), e._emitVaryingFromString("vFragmentDepth", "float"), e.sharedData.bindableBlocks.push(this)), this._linearDefineName = e._getFreeDefineName("CONVERTTOLINEAR"), this._gammaDefineName = e._getFreeDefineName("CONVERTTOGAMMA");
    const i = `//${this.name}`;
    if (e._emitFunctionFromInclude("helperFunctions", i), t.connectedPoint)
      n.isConnected ? e.compilationString += `gl_FragColor = vec4(${t.associatedVariableName}.rgb, ${n.associatedVariableName});
` : e.compilationString += `gl_FragColor = ${t.associatedVariableName};
`;
    else if (r.connectedPoint) {
      let s = "1.0";
      n.connectedPoint && (s = n.associatedVariableName), r.connectedPoint.type === de.Float ? e.compilationString += `gl_FragColor = vec4(${r.associatedVariableName}, ${r.associatedVariableName}, ${r.associatedVariableName}, ${s});
` : e.compilationString += `gl_FragColor = vec4(${r.associatedVariableName}, ${s});
`;
    } else
      e.sharedData.checks.notConnectedNonOptionalInputs.push(t);
    return e.compilationString += `#ifdef ${this._linearDefineName}
`, e.compilationString += `gl_FragColor = toLinearSpace(gl_FragColor);
`, e.compilationString += `#endif
`, e.compilationString += `#ifdef ${this._gammaDefineName}
`, e.compilationString += `gl_FragColor = toGammaSpace(gl_FragColor);
`, e.compilationString += `#endif
`, (this.useLogarithmicDepth || e.sharedData.nodeMaterial.useLogarithmicDepth) && (e.compilationString += `gl_FragDepthEXT = log2(vFragmentDepth) * logarithmicDepthConstant * 0.5;
`), e.compilationString += `#if defined(PREPASS)\r
`, e.compilationString += `gl_FragData[0] = gl_FragColor;\r
`, e.compilationString += `#endif\r
`, this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};
`, e += `${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};
`, e += `${this._codeVariableName}.useLogarithmicDepth = ${this.useLogarithmicDepth};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, e.useLogarithmicDepth = this.useLogarithmicDepth, e;
  }
  _deserialize(e, t, r) {
    var n;
    super._deserialize(e, t, r), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = e.convertToLinearSpace, this.useLogarithmicDepth = (n = e.useLogarithmicDepth) !== null && n !== void 0 ? n : !1;
  }
}
C([
  rn("Convert to gamma space", Gr.Boolean, "PROPERTIES", { notifiers: { update: !0 } })
], iq.prototype, "convertToGammaSpace", void 0);
C([
  rn("Convert to linear space", Gr.Boolean, "PROPERTIES", { notifiers: { update: !0 } })
], iq.prototype, "convertToLinearSpace", void 0);
C([
  rn("Use logarithmic depth", Gr.Boolean, "PROPERTIES")
], iq.prototype, "useLogarithmicDepth", void 0);
Ue("BABYLON.FragmentOutputBlock", iq);
var jA;
(function(A) {
  A[A.Uniform = 0] = "Uniform", A[A.Attribute = 1] = "Attribute", A[A.Varying = 2] = "Varying", A[A.Undefined = 3] = "Undefined";
})(jA || (jA = {}));
var Bi;
(function(A) {
  A[A.World = 1] = "World", A[A.View = 2] = "View", A[A.Projection = 3] = "Projection", A[A.ViewProjection = 4] = "ViewProjection", A[A.WorldView = 5] = "WorldView", A[A.WorldViewProjection = 6] = "WorldViewProjection", A[A.CameraPosition = 7] = "CameraPosition", A[A.FogColor = 8] = "FogColor", A[A.DeltaTime = 9] = "DeltaTime", A[A.CameraParameters = 10] = "CameraParameters", A[A.MaterialAlpha = 11] = "MaterialAlpha";
})(Bi || (Bi = {}));
class sQ {
  /**
   * Creates a PositionNormalVertex
   * @param position the position of the vertex (defaut: 0,0,0)
   * @param normal the normal of the vertex (defaut: 0,1,0)
   */
  constructor(e = S.Zero(), t = S.Up()) {
    this.position = e, this.normal = t;
  }
  /**
   * Clones the PositionNormalVertex
   * @returns the cloned PositionNormalVertex
   */
  clone() {
    return new sQ(this.position.clone(), this.normal.clone());
  }
}
class aQ {
  /**
   * Creates a PositionNormalTextureVertex
   * @param position the position of the vertex (defaut: 0,0,0)
   * @param normal the normal of the vertex (defaut: 0,1,0)
   * @param uv the uv of the vertex (default: 0,0)
   */
  constructor(e = S.Zero(), t = S.Up(), r = at.Zero()) {
    this.position = e, this.normal = t, this.uv = r;
  }
  /**
   * Clones the PositionNormalTextureVertex
   * @returns the cloned PositionNormalTextureVertex
   */
  clone() {
    return new aQ(this.position.clone(), this.normal.clone(), this.uv.clone());
  }
}
var tq;
(function(A) {
  A[A.None = 0] = "None", A[A.Time = 1] = "Time", A[A.RealTime = 2] = "RealTime";
})(tq || (tq = {}));
const S6e = {
  position2d: "position",
  particle_uv: "vUV",
  particle_color: "vColor",
  particle_texturemask: "textureMask",
  particle_positionw: "vPositionW"
}, HE = {
  particle_uv: !0,
  particle_color: !0,
  particle_texturemask: !0,
  particle_positionw: !0
}, PG = {
  particle_texturemask: !0
};
class gi extends Mr {
  /**
   * Gets or sets the connection point type (default is float)
   */
  get type() {
    if (this._type === de.AutoDetect) {
      if (this.isUniform && this.value != null) {
        if (!isNaN(this.value))
          return this._type = de.Float, this._type;
        switch (this.value.getClassName()) {
          case "Vector2":
            return this._type = de.Vector2, this._type;
          case "Vector3":
            return this._type = de.Vector3, this._type;
          case "Vector4":
            return this._type = de.Vector4, this._type;
          case "Color3":
            return this._type = de.Color3, this._type;
          case "Color4":
            return this._type = de.Color4, this._type;
          case "Matrix":
            return this._type = de.Matrix, this._type;
        }
      }
      if (this.isAttribute)
        switch (this.name) {
          case "position":
          case "normal":
          case "particle_positionw":
            return this._type = de.Vector3, this._type;
          case "uv":
          case "uv2":
          case "uv3":
          case "uv4":
          case "uv5":
          case "uv6":
          case "position2d":
          case "particle_uv":
            return this._type = de.Vector2, this._type;
          case "matricesIndices":
          case "matricesWeights":
          case "matricesIndicesExtra":
          case "matricesWeightsExtra":
          case "world0":
          case "world1":
          case "world2":
          case "world3":
          case "tangent":
            return this._type = de.Vector4, this._type;
          case "color":
          case "instanceColor":
          case "particle_color":
          case "particle_texturemask":
            return this._type = de.Color4, this._type;
        }
      if (this.isSystemValue)
        switch (this._systemValue) {
          case Bi.World:
          case Bi.WorldView:
          case Bi.WorldViewProjection:
          case Bi.View:
          case Bi.ViewProjection:
          case Bi.Projection:
            return this._type = de.Matrix, this._type;
          case Bi.CameraPosition:
            return this._type = de.Vector3, this._type;
          case Bi.FogColor:
            return this._type = de.Color3, this._type;
          case Bi.DeltaTime:
          case Bi.MaterialAlpha:
            return this._type = de.Float, this._type;
          case Bi.CameraParameters:
            return this._type = de.Vector4, this._type;
        }
    }
    return this._type;
  }
  /**
   * Creates a new InputBlock
   * @param name defines the block name
   * @param target defines the target of that block (Vertex by default)
   * @param type defines the type of the input (can be set to NodeMaterialBlockConnectionPointTypes.AutoDetect)
   */
  constructor(e, t = Ve.Vertex, r = de.AutoDetect) {
    super(e, t, !1), this._mode = jA.Undefined, this._animationType = tq.None, this.min = 0, this.max = 0, this.isBoolean = !1, this.matrixMode = 0, this._systemValue = null, this.isConstant = !1, this.groupInInspector = "", this.onValueChangedObservable = new Oe(), this.convertToGammaSpace = !1, this.convertToLinearSpace = !1, this._type = r, this.setDefaultValue(), this.registerOutput("output", r);
  }
  /**
   * Validates if a name is a reserve word.
   * @param newName the new name to be given to the node.
   * @returns false if the name is a reserve word, else true.
   */
  validateBlockName(e) {
    return this.isAttribute ? !0 : super.validateBlockName(e);
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Set the source of this connection point to a vertex attribute
   * @param attributeName defines the attribute name (position, uv, normal, etc...). If not specified it will take the connection point name
   * @returns the current connection point
   */
  setAsAttribute(e) {
    return this._mode = jA.Attribute, e && (this.name = e), this;
  }
  /**
   * Set the source of this connection point to a system value
   * @param value define the system value to use (world, view, etc...) or null to switch to manual value
   * @returns the current connection point
   */
  setAsSystemValue(e) {
    return this.systemValue = e, this;
  }
  /**
   * Gets or sets the value of that point.
   * Please note that this value will be ignored if valueCallback is defined
   */
  get value() {
    return this._storedValue;
  }
  set value(e) {
    this.type === de.Float && (this.isBoolean ? e = e ? 1 : 0 : this.min !== this.max && (e = Math.max(this.min, e), e = Math.min(this.max, e))), this._storedValue = e, this._mode = jA.Uniform, this.onValueChangedObservable.notifyObservers(this);
  }
  /**
   * Gets or sets a callback used to get the value of that point.
   * Please note that setting this value will force the connection point to ignore the value property
   */
  get valueCallback() {
    return this._valueCallback;
  }
  set valueCallback(e) {
    this._valueCallback = e, this._mode = jA.Uniform;
  }
  /**
   * Gets or sets the associated variable name in the shader
   */
  get associatedVariableName() {
    return this._associatedVariableName;
  }
  set associatedVariableName(e) {
    this._associatedVariableName = e;
  }
  /** Gets or sets the type of animation applied to the input */
  get animationType() {
    return this._animationType;
  }
  set animationType(e) {
    this._animationType = e;
  }
  /**
   * Gets a boolean indicating that this connection point not defined yet
   */
  get isUndefined() {
    return this._mode === jA.Undefined;
  }
  /**
   * Gets or sets a boolean indicating that this connection point is coming from an uniform.
   * In this case the connection point name must be the name of the uniform to use.
   * Can only be set on inputs
   */
  get isUniform() {
    return this._mode === jA.Uniform;
  }
  set isUniform(e) {
    this._mode = e ? jA.Uniform : jA.Undefined, this.associatedVariableName = "";
  }
  /**
   * Gets or sets a boolean indicating that this connection point is coming from an attribute.
   * In this case the connection point name must be the name of the attribute to use
   * Can only be set on inputs
   */
  get isAttribute() {
    return this._mode === jA.Attribute;
  }
  set isAttribute(e) {
    this._mode = e ? jA.Attribute : jA.Undefined, this.associatedVariableName = "";
  }
  /**
   * Gets or sets a boolean indicating that this connection point is generating a varying variable.
   * Can only be set on exit points
   */
  get isVarying() {
    return this._mode === jA.Varying;
  }
  set isVarying(e) {
    this._mode = e ? jA.Varying : jA.Undefined, this.associatedVariableName = "";
  }
  /**
   * Gets a boolean indicating that the current connection point is a system value
   */
  get isSystemValue() {
    return this._systemValue != null;
  }
  /**
   * Gets or sets the current well known value or null if not defined as a system value
   */
  get systemValue() {
    return this._systemValue;
  }
  set systemValue(e) {
    this._mode = jA.Uniform, this.associatedVariableName = "", this._systemValue = e;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "InputBlock";
  }
  /**
   * Animate the input if animationType !== None
   * @param scene defines the rendering scene
   */
  animate(e) {
    switch (this._animationType) {
      case tq.Time: {
        this.type === de.Float && (this.value += e.getAnimationRatio() * 0.01);
        break;
      }
      case tq.RealTime: {
        this.type === de.Float && (this.value = (Yi.Now - e.getEngine().startTime) / 1e3);
        break;
      }
    }
  }
  _emitDefine(e) {
    return e[0] === "!" ? `#ifndef ${e.substring(1)}
` : `#ifdef ${e}
`;
  }
  initialize() {
    this.associatedVariableName = "";
  }
  /**
   * Set the input block to its default value (based on its type)
   */
  setDefaultValue() {
    switch (this.type) {
      case de.Float:
        this.value = 0;
        break;
      case de.Vector2:
        this.value = at.Zero();
        break;
      case de.Vector3:
        this.value = S.Zero();
        break;
      case de.Vector4:
        this.value = Ir.Zero();
        break;
      case de.Color3:
        this.value = Ne.White();
        break;
      case de.Color4:
        this.value = new xt(1, 1, 1, 1);
        break;
      case de.Matrix:
        this.value = he.Identity();
        break;
    }
  }
  _emitConstant(e) {
    switch (this.type) {
      case de.Float:
        return `${e._emitFloat(this.value)}`;
      case de.Vector2:
        return `vec2(${this.value.x}, ${this.value.y})`;
      case de.Vector3:
        return `vec3(${this.value.x}, ${this.value.y}, ${this.value.z})`;
      case de.Vector4:
        return `vec4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;
      case de.Color3:
        return Hs.Color3[0].set(this.value.r, this.value.g, this.value.b), this.convertToGammaSpace && Hs.Color3[0].toGammaSpaceToRef(Hs.Color3[0], e.sharedData.scene.getEngine().useExactSrgbConversions), this.convertToLinearSpace && Hs.Color3[0].toLinearSpaceToRef(Hs.Color3[0], e.sharedData.scene.getEngine().useExactSrgbConversions), `vec3(${Hs.Color3[0].r}, ${Hs.Color3[0].g}, ${Hs.Color3[0].b})`;
      case de.Color4:
        return Hs.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a), this.convertToGammaSpace && Hs.Color4[0].toGammaSpaceToRef(Hs.Color4[0], e.sharedData.scene.getEngine().useExactSrgbConversions), this.convertToLinearSpace && Hs.Color4[0].toLinearSpaceToRef(Hs.Color4[0], e.sharedData.scene.getEngine().useExactSrgbConversions), `vec4(${Hs.Color4[0].r}, ${Hs.Color4[0].g}, ${Hs.Color4[0].b}, ${Hs.Color4[0].a})`;
    }
    return "";
  }
  /** @internal */
  get _noContextSwitch() {
    return HE[this.name];
  }
  _emit(e, t) {
    var r;
    if (this.isUniform) {
      if (this.associatedVariableName || (this.associatedVariableName = e._getFreeVariableName("u_" + this.name)), this.isConstant) {
        if (e.constants.indexOf(this.associatedVariableName) !== -1)
          return;
        e.constants.push(this.associatedVariableName), e._constantDeclaration += this._declareOutput(this.output, e) + ` = ${this._emitConstant(e)};
`;
        return;
      }
      if (e.uniforms.indexOf(this.associatedVariableName) !== -1)
        return;
      e.uniforms.push(this.associatedVariableName), t && (e._uniformDeclaration += this._emitDefine(t)), e._uniformDeclaration += `uniform ${e._getGLType(this.type)} ${this.associatedVariableName};
`, t && (e._uniformDeclaration += `#endif
`);
      const n = e.sharedData.hints;
      if (this._systemValue !== null && this._systemValue !== void 0)
        switch (this._systemValue) {
          case Bi.WorldView:
            n.needWorldViewMatrix = !0;
            break;
          case Bi.WorldViewProjection:
            n.needWorldViewProjectionMatrix = !0;
            break;
        }
      else
        this._animationType !== tq.None && e.sharedData.animatedInputs.push(this);
      return;
    }
    if (this.isAttribute) {
      if (this.associatedVariableName = (r = S6e[this.name]) !== null && r !== void 0 ? r : this.name, this.target === Ve.Vertex && e._vertexState) {
        HE[this.name] ? PG[this.name] ? e._emitUniformFromString(this.associatedVariableName, e._getGLType(this.type), t) : e._emitVaryingFromString(this.associatedVariableName, e._getGLType(this.type), t) : this._emit(e._vertexState, t);
        return;
      }
      if (e.attributes.indexOf(this.associatedVariableName) !== -1)
        return;
      e.attributes.push(this.associatedVariableName), HE[this.name] ? PG[this.name] ? e._emitUniformFromString(this.associatedVariableName, e._getGLType(this.type), t) : e._emitVaryingFromString(this.associatedVariableName, e._getGLType(this.type), t) : (t && (e._attributeDeclaration += this._emitDefine(t)), e._attributeDeclaration += `attribute ${e._getGLType(this.type)} ${this.associatedVariableName};
`, t && (e._attributeDeclaration += `#endif
`));
    }
  }
  /**
   * @internal
   */
  _transmitWorld(e, t, r, n) {
    if (!this._systemValue)
      return;
    const i = this.associatedVariableName;
    switch (this._systemValue) {
      case Bi.World:
        e.setMatrix(i, t);
        break;
      case Bi.WorldView:
        e.setMatrix(i, r);
        break;
      case Bi.WorldViewProjection:
        e.setMatrix(i, n);
        break;
    }
  }
  /**
   * @internal
   */
  _transmit(e, t, r) {
    if (this.isAttribute)
      return;
    const n = this.associatedVariableName;
    if (this._systemValue) {
      switch (this._systemValue) {
        case Bi.World:
        case Bi.WorldView:
        case Bi.WorldViewProjection:
          return;
        case Bi.View:
          e.setMatrix(n, t.getViewMatrix());
          break;
        case Bi.Projection:
          e.setMatrix(n, t.getProjectionMatrix());
          break;
        case Bi.ViewProjection:
          e.setMatrix(n, t.getTransformMatrix());
          break;
        case Bi.CameraPosition:
          t.bindEyePosition(e, n, !0);
          break;
        case Bi.FogColor:
          e.setColor3(n, t.fogColor);
          break;
        case Bi.DeltaTime:
          e.setFloat(n, t.deltaTime / 1e3);
          break;
        case Bi.CameraParameters:
          t.activeCamera && e.setFloat4(n, t.getEngine().hasOriginBottomLeft ? -1 : 1, t.activeCamera.minZ, t.activeCamera.maxZ, 1 / t.activeCamera.maxZ);
          break;
        case Bi.MaterialAlpha:
          e.setFloat(n, r.alpha);
          break;
      }
      return;
    }
    const i = this._valueCallback ? this._valueCallback() : this._storedValue;
    if (i !== null)
      switch (this.type) {
        case de.Float:
          e.setFloat(n, i);
          break;
        case de.Int:
          e.setInt(n, i);
          break;
        case de.Color3:
          Hs.Color3[0].set(this.value.r, this.value.g, this.value.b), this.convertToGammaSpace && Hs.Color3[0].toGammaSpaceToRef(Hs.Color3[0], t.getEngine().useExactSrgbConversions), this.convertToLinearSpace && Hs.Color3[0].toLinearSpaceToRef(Hs.Color3[0], t.getEngine().useExactSrgbConversions), e.setColor3(n, Hs.Color3[0]);
          break;
        case de.Color4:
          Hs.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a), this.convertToGammaSpace && Hs.Color4[0].toGammaSpaceToRef(Hs.Color4[0], t.getEngine().useExactSrgbConversions), this.convertToLinearSpace && Hs.Color4[0].toLinearSpaceToRef(Hs.Color4[0], t.getEngine().useExactSrgbConversions), e.setDirectColor4(n, Hs.Color4[0]);
          break;
        case de.Vector2:
          e.setVector2(n, i);
          break;
        case de.Vector3:
          e.setVector3(n, i);
          break;
        case de.Vector4:
          e.setVector4(n, i);
          break;
        case de.Matrix:
          e.setMatrix(n, i);
          break;
      }
  }
  _buildBlock(e) {
    super._buildBlock(e), (this.isUniform || this.isSystemValue) && e.sharedData.inputBlocks.push(this), this._emit(e);
  }
  _dumpPropertiesCode() {
    const e = this._codeVariableName;
    if (this.isAttribute)
      return super._dumpPropertiesCode() + `${e}.setAsAttribute("${this.name}");
`;
    if (this.isSystemValue)
      return super._dumpPropertiesCode() + `${e}.setAsSystemValue(BABYLON.NodeMaterialSystemValues.${Bi[this._systemValue]});
`;
    if (this.isUniform) {
      const t = [];
      let r = "";
      switch (this.type) {
        case de.Float:
          r = `${this.value}`;
          break;
        case de.Vector2:
          r = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;
          break;
        case de.Vector3:
          r = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;
          break;
        case de.Vector4:
          r = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;
          break;
        case de.Color3:
          r = `new BABYLON.Color3(${this.value.r}, ${this.value.g}, ${this.value.b})`, this.convertToGammaSpace && (r += ".toGammaSpace()"), this.convertToLinearSpace && (r += ".toLinearSpace()");
          break;
        case de.Color4:
          r = `new BABYLON.Color4(${this.value.r}, ${this.value.g}, ${this.value.b}, ${this.value.a})`, this.convertToGammaSpace && (r += ".toGammaSpace()"), this.convertToLinearSpace && (r += ".toLinearSpace()");
          break;
        case de.Matrix:
          r = `BABYLON.Matrix.FromArray([${this.value.m}])`;
          break;
      }
      return t.push(`${e}.value = ${r}`), this.type === de.Float && t.push(`${e}.min = ${this.min}`, `${e}.max = ${this.max}`, `${e}.isBoolean = ${this.isBoolean}`, `${e}.matrixMode = ${this.matrixMode}`, `${e}.animationType = BABYLON.AnimatedInputBlockTypes.${tq[this.animationType]}`), t.push(`${e}.isConstant = ${this.isConstant}`), t.push(""), super._dumpPropertiesCode() + t.join(`;
`);
    }
    return super._dumpPropertiesCode();
  }
  dispose() {
    this.onValueChangedObservable.clear(), super.dispose();
  }
  serialize() {
    const e = super.serialize();
    return e.type = this.type, e.mode = this._mode, e.systemValue = this._systemValue, e.animationType = this._animationType, e.min = this.min, e.max = this.max, e.isBoolean = this.isBoolean, e.matrixMode = this.matrixMode, e.isConstant = this.isConstant, e.groupInInspector = this.groupInInspector, e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, this._storedValue != null && this._mode === jA.Uniform && (this._storedValue.asArray ? (e.valueType = "BABYLON." + this._storedValue.getClassName(), e.value = this._storedValue.asArray()) : (e.valueType = "number", e.value = this._storedValue)), e;
  }
  _deserialize(e, t, r) {
    if (this._mode = e.mode, super._deserialize(e, t, r), this._type = e.type, this._systemValue = e.systemValue || e.wellKnownValue, this._animationType = e.animationType, this.min = e.min || 0, this.max = e.max || 0, this.isBoolean = !!e.isBoolean, this.matrixMode = e.matrixMode || 0, this.isConstant = !!e.isConstant, this.groupInInspector = e.groupInInspector || "", this.convertToGammaSpace = !!e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, e.name === "tangent" && e.mode === jA.Attribute && e.type === de.Vector3 && (this._type = de.Vector4), !!e.valueType)
      if (e.valueType === "number")
        this._storedValue = e.value;
      else {
        const n = Jo(e.valueType);
        n && (this._storedValue = n.FromArray(e.value));
      }
  }
}
Ue("BABYLON.InputBlock", gi);
class oQ extends Mr {
  /**
   * Create a new CurrentScreenBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.VertexAndFragment), this._samplerName = "textureSampler", this.convertToGammaSpace = !1, this.convertToLinearSpace = !1, this._isUnique = !1, this.registerInput("uv", de.AutoDetect, !1, Ve.VertexAndFragment), this.registerOutput("rgba", de.Color4, Ve.Neutral), this.registerOutput("rgb", de.Color3, Ve.Neutral), this.registerOutput("r", de.Float, Ve.Neutral), this.registerOutput("g", de.Float, Ve.Neutral), this.registerOutput("b", de.Float, Ve.Neutral), this.registerOutput("a", de.Float, Ve.Neutral), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Vector2 | de.Vector3 | de.Vector4), this._inputs[0]._prioritizeVertex = !1;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "CurrentScreenBlock";
  }
  /**
   * Gets the uv input component
   */
  get uv() {
    return this._inputs[0];
  }
  /**
   * Gets the rgba output component
   */
  get rgba() {
    return this._outputs[0];
  }
  /**
   * Gets the rgb output component
   */
  get rgb() {
    return this._outputs[1];
  }
  /**
   * Gets the r output component
   */
  get r() {
    return this._outputs[2];
  }
  /**
   * Gets the g output component
   */
  get g() {
    return this._outputs[3];
  }
  /**
   * Gets the b output component
   */
  get b() {
    return this._outputs[4];
  }
  /**
   * Gets the a output component
   */
  get a() {
    return this._outputs[5];
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("textureSampler");
  }
  get target() {
    return !this.uv.isConnected || this.uv.sourceBlock.isInput ? Ve.VertexAndFragment : Ve.Fragment;
  }
  prepareDefines(e, t, r) {
    r.setValue(this._linearDefineName, this.convertToGammaSpace, !0), r.setValue(this._gammaDefineName, this.convertToLinearSpace, !0);
  }
  isReady() {
    return !(this.texture && !this.texture.isReadyOrNotBlocking());
  }
  _injectVertexCode(e) {
    const t = this.uv;
    if (t.connectedPoint.ownerBlock.isInput && (t.connectedPoint.ownerBlock.isAttribute || e._emitUniformFromString(t.associatedVariableName, "vec2")), this._mainUVName = "vMain" + t.associatedVariableName, e._emitVaryingFromString(this._mainUVName, "vec2"), e.compilationString += `${this._mainUVName} = ${t.associatedVariableName}.xy;
`, !!this._outputs.some((r) => r.isConnectedInVertexShader)) {
      this._writeTextureRead(e, !0);
      for (const r of this._outputs)
        r.hasEndpoints && this._writeOutput(e, r, r.name, !0);
    }
  }
  _writeTextureRead(e, t = !1) {
    const r = this.uv;
    if (t) {
      if (e.target === Ve.Fragment)
        return;
      e.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${r.associatedVariableName});
`;
      return;
    }
    if (this.uv.ownerBlock.target === Ve.Fragment) {
      e.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${r.associatedVariableName});
`;
      return;
    }
    e.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${this._mainUVName});
`;
  }
  _writeOutput(e, t, r, n = !1) {
    if (n) {
      if (e.target === Ve.Fragment)
        return;
      e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r};
`;
      return;
    }
    if (this.uv.ownerBlock.target === Ve.Fragment) {
      e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r};
`;
      return;
    }
    e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r};
`, e.compilationString += `#ifdef ${this._linearDefineName}
`, e.compilationString += `${t.associatedVariableName} = toGammaSpace(${t.associatedVariableName});
`, e.compilationString += `#endif
`, e.compilationString += `#ifdef ${this._gammaDefineName}
`, e.compilationString += `${t.associatedVariableName} = toLinearSpace(${t.associatedVariableName});
`, e.compilationString += `#endif
`;
  }
  _buildBlock(e) {
    if (super._buildBlock(e), this._tempTextureRead = e._getFreeVariableName("tempTextureRead"), e.sharedData.blockingBlocks.indexOf(this) < 0 && e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.indexOf(this) < 0 && e.sharedData.textureBlocks.push(this), e.sharedData.blocksWithDefines.indexOf(this) < 0 && e.sharedData.blocksWithDefines.push(this), e.target !== Ve.Fragment) {
      e._emit2DSampler(this._samplerName), this._injectVertexCode(e);
      return;
    }
    if (!this._outputs.some((r) => r.isConnectedInFragmentShader))
      return;
    e._emit2DSampler(this._samplerName), this._linearDefineName = e._getFreeDefineName("ISLINEAR"), this._gammaDefineName = e._getFreeDefineName("ISGAMMA");
    const t = `//${this.name}`;
    e._emitFunctionFromInclude("helperFunctions", t), this._writeTextureRead(e);
    for (const r of this._outputs)
      r.hasEndpoints && this._writeOutput(e, r, r.name);
    return this;
  }
  serialize() {
    const e = super.serialize();
    return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, this.texture && !this.texture.isRenderTarget && (e.texture = this.texture.serialize()), e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, e.texture && (r = e.texture.url.indexOf("data:") === 0 ? "" : r, this.texture = We.Parse(e.texture, t, r));
  }
}
Ue("BABYLON.CurrentScreenBlock", oQ);
class fQ extends Mr {
  /**
   * Create a new ParticleTextureBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this._samplerName = "diffuseSampler", this.convertToGammaSpace = !1, this.convertToLinearSpace = !1, this._isUnique = !1, this.registerInput("uv", de.AutoDetect, !1, Ve.VertexAndFragment), this.registerOutput("rgba", de.Color4, Ve.Neutral), this.registerOutput("rgb", de.Color3, Ve.Neutral), this.registerOutput("r", de.Float, Ve.Neutral), this.registerOutput("g", de.Float, Ve.Neutral), this.registerOutput("b", de.Float, Ve.Neutral), this.registerOutput("a", de.Float, Ve.Neutral), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Vector2 | de.Vector3 | de.Vector4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ParticleTextureBlock";
  }
  /**
   * Gets the uv input component
   */
  get uv() {
    return this._inputs[0];
  }
  /**
   * Gets the rgba output component
   */
  get rgba() {
    return this._outputs[0];
  }
  /**
   * Gets the rgb output component
   */
  get rgb() {
    return this._outputs[1];
  }
  /**
   * Gets the r output component
   */
  get r() {
    return this._outputs[2];
  }
  /**
   * Gets the g output component
   */
  get g() {
    return this._outputs[3];
  }
  /**
   * Gets the b output component
   */
  get b() {
    return this._outputs[4];
  }
  /**
   * Gets the a output component
   */
  get a() {
    return this._outputs[5];
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("diffuseSampler");
  }
  autoConfigure(e, t = () => !0) {
    if (!this.uv.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "particle_uv" && t(n));
      r || (r = new gi("uv"), r.setAsAttribute("particle_uv")), r.output.connectTo(this.uv);
    }
  }
  prepareDefines(e, t, r) {
    r.setValue(this._linearDefineName, this.convertToGammaSpace, !0), r.setValue(this._gammaDefineName, this.convertToLinearSpace, !0);
  }
  isReady() {
    return !(this.texture && !this.texture.isReadyOrNotBlocking());
  }
  _writeOutput(e, t, r) {
    e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r};
`, e.compilationString += `#ifdef ${this._linearDefineName}
`, e.compilationString += `${t.associatedVariableName} = toGammaSpace(${t.associatedVariableName});
`, e.compilationString += `#endif
`, e.compilationString += `#ifdef ${this._gammaDefineName}
`, e.compilationString += `${t.associatedVariableName} = toLinearSpace(${t.associatedVariableName});
`, e.compilationString += `#endif
`;
  }
  _buildBlock(e) {
    if (super._buildBlock(e), e.target === Ve.Vertex)
      return;
    this._tempTextureRead = e._getFreeVariableName("tempTextureRead"), e._emit2DSampler(this._samplerName), e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), e.sharedData.blocksWithDefines.push(this), this._linearDefineName = e._getFreeDefineName("ISLINEAR"), this._gammaDefineName = e._getFreeDefineName("ISGAMMA");
    const t = `//${this.name}`;
    e._emitFunctionFromInclude("helperFunctions", t), e.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${this.uv.associatedVariableName});
`;
    for (const r of this._outputs)
      r.hasEndpoints && this._writeOutput(e, r, r.name);
    return this;
  }
  serialize() {
    const e = super.serialize();
    return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, this.texture && !this.texture.isRenderTarget && (e.texture = this.texture.serialize()), e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, e.texture && (r = e.texture.url.indexOf("data:") === 0 ? "" : r, this.texture = We.Parse(e.texture, t, r));
  }
}
Ue("BABYLON.ParticleTextureBlock", fQ);
class AQ extends Mr {
  /**
   * Create a new ParticleRampGradientBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this._isUnique = !0, this.registerInput("color", de.Color4, !1, Ve.Fragment), this.registerOutput("rampColor", de.Color4, Ve.Fragment);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ParticleRampGradientBlock";
  }
  /**
   * Gets the color input component
   */
  get color() {
    return this._inputs[0];
  }
  /**
   * Gets the rampColor output component
   */
  get rampColor() {
    return this._outputs[0];
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("remapRanges"), e._excludeVariableName("rampSampler"), e._excludeVariableName("baseColor"), e._excludeVariableName("alpha"), e._excludeVariableName("remappedColorIndex"), e._excludeVariableName("rampColor"), e._excludeVariableName("finalAlpha");
  }
  _buildBlock(e) {
    if (super._buildBlock(e), e.target !== Ve.Vertex)
      return e._emit2DSampler("rampSampler"), e._emitVaryingFromString("remapRanges", "vec4", "RAMPGRADIENT"), e.compilationString += `
            #ifdef RAMPGRADIENT
                vec4 baseColor = ${this.color.associatedVariableName};
                float alpha = ${this.color.associatedVariableName}.a;

                float remappedColorIndex = clamp((alpha - remapRanges.x) / remapRanges.y, 0.0, 1.0);

                vec4 rampColor = texture2D(rampSampler, vec2(1.0 - remappedColorIndex, 0.));
                baseColor.rgb *= rampColor.rgb;

                // Remapped alpha
                float finalAlpha = baseColor.a;
                baseColor.a = clamp((alpha * rampColor.a - remapRanges.z) / remapRanges.w, 0.0, 1.0);

                ${this._declareOutput(this.rampColor, e)} = baseColor;
            #else
                ${this._declareOutput(this.rampColor, e)} = ${this.color.associatedVariableName};
            #endif
        `, this;
  }
}
Ue("BABYLON.ParticleRampGradientBlock", AQ);
class dQ extends Mr {
  /**
   * Create a new ParticleBlendMultiplyBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this._isUnique = !0, this.registerInput("color", de.Color4, !1, Ve.Fragment), this.registerInput("alphaTexture", de.Float, !1, Ve.Fragment), this.registerInput("alphaColor", de.Float, !1, Ve.Fragment), this.registerOutput("blendColor", de.Color4, Ve.Fragment);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ParticleBlendMultiplyBlock";
  }
  /**
   * Gets the color input component
   */
  get color() {
    return this._inputs[0];
  }
  /**
   * Gets the alphaTexture input component
   */
  get alphaTexture() {
    return this._inputs[1];
  }
  /**
   * Gets the alphaColor input component
   */
  get alphaColor() {
    return this._inputs[2];
  }
  /**
   * Gets the blendColor output component
   */
  get blendColor() {
    return this._outputs[0];
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("sourceAlpha");
  }
  _buildBlock(e) {
    if (super._buildBlock(e), e.target !== Ve.Vertex)
      return e.compilationString += `
            #ifdef BLENDMULTIPLYMODE
                ${this._declareOutput(this.blendColor, e)};
                float sourceAlpha = ${this.alphaColor.associatedVariableName} * ${this.alphaTexture.associatedVariableName};
                ${this.blendColor.associatedVariableName}.rgb = ${this.color.associatedVariableName}.rgb * sourceAlpha + vec3(1.0) * (1.0 - sourceAlpha);
                ${this.blendColor.associatedVariableName}.a = ${this.color.associatedVariableName}.a;
            #else
                ${this._declareOutput(this.blendColor, e)} = ${this.color.associatedVariableName};
            #endif
        `, this;
  }
}
Ue("BABYLON.ParticleBlendMultiplyBlock", dQ);
class c1 {
  constructor() {
    this._defines = {}, this._currentRank = 32, this._maxRank = -1, this._mesh = null;
  }
  /**
   * Removes the fallback from the bound mesh.
   */
  unBindMesh() {
    this._mesh = null;
  }
  /**
   * Adds a fallback on the specified property.
   * @param rank The rank of the fallback (Lower ranks will be fallbacked to first)
   * @param define The name of the define in the shader
   */
  addFallback(e, t) {
    this._defines[e] || (e < this._currentRank && (this._currentRank = e), e > this._maxRank && (this._maxRank = e), this._defines[e] = new Array()), this._defines[e].push(t);
  }
  /**
   * Sets the mesh to use CPU skinning when needing to fallback.
   * @param rank The rank of the fallback (Lower ranks will be fallbacked to first)
   * @param mesh The mesh to use the fallbacks.
   */
  addCPUSkinningFallback(e, t) {
    this._mesh = t, e < this._currentRank && (this._currentRank = e), e > this._maxRank && (this._maxRank = e);
  }
  /**
   * Checks to see if more fallbacks are still available.
   */
  get hasMoreFallbacks() {
    return this._currentRank <= this._maxRank;
  }
  /**
   * Removes the defines that should be removed when falling back.
   * @param currentDefines defines the current define statements for the shader.
   * @param effect defines the current effect we try to compile
   * @returns The resulting defines with defines of the current rank removed.
   */
  reduce(e, t) {
    if (this._mesh && this._mesh.computeBonesUsingShaders && this._mesh.numBoneInfluencers > 0) {
      this._mesh.computeBonesUsingShaders = !1, e = e.replace("#define NUM_BONE_INFLUENCERS " + this._mesh.numBoneInfluencers, "#define NUM_BONE_INFLUENCERS 0"), t._bonesComputationForcedToCPU = !0;
      const r = this._mesh.getScene();
      for (let n = 0; n < r.meshes.length; n++) {
        const i = r.meshes[n];
        if (!i.material) {
          !this._mesh.material && i.computeBonesUsingShaders && i.numBoneInfluencers > 0 && (i.computeBonesUsingShaders = !1);
          continue;
        }
        if (!(!i.computeBonesUsingShaders || i.numBoneInfluencers === 0)) {
          if (i.material.getEffect() === t)
            i.computeBonesUsingShaders = !1;
          else if (i.subMeshes) {
            for (const s of i.subMeshes)
              if (s.effect === t) {
                i.computeBonesUsingShaders = !1;
                break;
              }
          }
        }
      }
    } else {
      const r = this._defines[this._currentRank];
      if (r)
        for (let n = 0; n < r.length; n++)
          e = e.replace("#define " + r[n], "");
      this._currentRank++;
    }
    return e;
  }
}
const U6e = "postprocessVertexShader", I6e = `attribute vec2 position;uniform vec2 scale;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=(position*madd+madd)*scale;gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[U6e] = I6e;
class DR {
  /**
   * Gets the depth/stencil texture (if created by a createDepthStencilTexture() call)
   */
  get depthStencilTexture() {
    return this._depthStencilTexture;
  }
  /**
   * Indicates if the depth/stencil texture has a stencil aspect
   */
  get depthStencilTextureWithStencil() {
    return this._depthStencilTextureWithStencil;
  }
  /**
   * Defines if the render target wrapper is for a cube texture or if false a 2d texture
   */
  get isCube() {
    return this._isCube;
  }
  /**
   * Defines if the render target wrapper is for a single or multi target render wrapper
   */
  get isMulti() {
    return this._isMulti;
  }
  /**
   * Defines if the render target wrapper is for a single or an array of textures
   */
  get is2DArray() {
    return this.layers > 0;
  }
  /**
   * Gets the size of the render target wrapper (used for cubes, as width=height in this case)
   */
  get size() {
    return this.width;
  }
  /**
   * Gets the width of the render target wrapper
   */
  get width() {
    return this._size.width || this._size;
  }
  /**
   * Gets the height of the render target wrapper
   */
  get height() {
    return this._size.height || this._size;
  }
  /**
   * Gets the number of layers of the render target wrapper (only used if is2DArray is true and wrapper is not a multi render target)
   */
  get layers() {
    return this._size.layers || 0;
  }
  /**
   * Gets the render texture. If this is a multi render target, gets the first texture
   */
  get texture() {
    var e, t;
    return (t = (e = this._textures) === null || e === void 0 ? void 0 : e[0]) !== null && t !== void 0 ? t : null;
  }
  /**
   * Gets the list of render textures. If we are not in a multi render target, the list will be null (use the texture getter instead)
   */
  get textures() {
    return this._textures;
  }
  /**
   * Gets the face indices that correspond to the list of render textures. If we are not in a multi render target, the list will be null
   */
  get faceIndices() {
    return this._faceIndices;
  }
  /**
   * Gets the layer indices that correspond to the list of render textures. If we are not in a multi render target, the list will be null
   */
  get layerIndices() {
    return this._layerIndices;
  }
  /**
   * Gets the sample count of the render target
   */
  get samples() {
    return this._samples;
  }
  /**
   * Sets the sample count of the render target
   * @param value sample count
   * @param initializeBuffers If set to true, the engine will make an initializing call to drawBuffers (only used when isMulti=true).
   * @param force true to force calling the update sample count engine function even if the current sample count is equal to value
   * @returns the sample count that has been set
   */
  setSamples(e, t = !0, r = !1) {
    if (this.samples === e && !r)
      return e;
    const n = this._isMulti ? this._engine.updateMultipleRenderTargetTextureSampleCount(this, e, t) : this._engine.updateRenderTargetTextureSampleCount(this, e);
    return this._samples = e, n;
  }
  /**
   * Initializes the render target wrapper
   * @param isMulti true if the wrapper is a multi render target
   * @param isCube true if the wrapper should render to a cube texture
   * @param size size of the render target (width/height/layers)
   * @param engine engine used to create the render target
   * @param label defines the label to use for the wrapper (for debugging purpose only)
   */
  constructor(e, t, r, n, i) {
    this._textures = null, this._faceIndices = null, this._layerIndices = null, this._samples = 1, this._attachments = null, this._generateStencilBuffer = !1, this._generateDepthBuffer = !1, this._depthStencilTextureWithStencil = !1, this._isMulti = e, this._isCube = t, this._size = r, this._engine = n, this._depthStencilTexture = null, this.label = i;
  }
  /**
   * Sets the render target texture(s)
   * @param textures texture(s) to set
   */
  setTextures(e) {
    Array.isArray(e) ? this._textures = e : e ? this._textures = [e] : this._textures = null;
  }
  /**
   * Set a texture in the textures array
   * @param texture The texture to set
   * @param index The index in the textures array to set
   * @param disposePrevious If this function should dispose the previous texture
   */
  setTexture(e, t = 0, r = !0) {
    this._textures || (this._textures = []), this._textures[t] !== e && (this._textures[t] && r && this._textures[t].dispose(), this._textures[t] = e);
  }
  /**
   * Sets the layer and face indices of every render target texture bound to each color attachment
   * @param layers The layers of each texture to be set
   * @param faces The faces of each texture to be set
   */
  setLayerAndFaceIndices(e, t) {
    this._layerIndices = e, this._faceIndices = t;
  }
  /**
   * Sets the layer and face indices of a texture in the textures array that should be bound to each color attachment
   * @param index The index of the texture in the textures array to modify
   * @param layer The layer of the texture to be set
   * @param face The face of the texture to be set
   */
  setLayerAndFaceIndex(e = 0, t, r) {
    this._layerIndices || (this._layerIndices = []), this._faceIndices || (this._faceIndices = []), t !== void 0 && t >= 0 && (this._layerIndices[e] = t), r !== void 0 && r >= 0 && (this._faceIndices[e] = r);
  }
  /**
   * Creates the depth/stencil texture
   * @param comparisonFunction Comparison function to use for the texture
   * @param bilinearFiltering true if bilinear filtering should be used when sampling the texture
   * @param generateStencil true if the stencil aspect should also be created
   * @param samples sample count to use when creating the texture
   * @param format format of the depth texture
   * @param label defines the label to use for the texture (for debugging purpose only)
   * @returns the depth/stencil created texture
   */
  createDepthStencilTexture(e = 0, t = !0, r = !1, n = 1, i = 14, s) {
    var a;
    return (a = this._depthStencilTexture) === null || a === void 0 || a.dispose(), this._depthStencilTextureWithStencil = r, this._depthStencilTexture = this._engine.createDepthStencilTexture(this._size, {
      bilinearFiltering: t,
      comparisonFunction: e,
      generateStencil: r,
      isCube: this._isCube,
      samples: n,
      depthTextureFormat: i,
      label: s
    }, this), this._depthStencilTexture;
  }
  /**
   * Shares the depth buffer of this render target with another render target.
   * @internal
   * @param renderTarget Destination renderTarget
   */
  _shareDepth(e) {
    this._depthStencilTexture && (e._depthStencilTexture && e._depthStencilTexture.dispose(), e._depthStencilTexture = this._depthStencilTexture, this._depthStencilTexture.incrementReferences());
  }
  /**
   * @internal
   */
  _swapAndDie(e) {
    this.texture && this.texture._swapAndDie(e), this._textures = null, this.dispose(!0);
  }
  _cloneRenderTargetWrapper() {
    var e, t, r, n, i, s, a, f;
    let o = null;
    if (this._isMulti) {
      const d = this.textures;
      if (d && d.length > 0) {
        let v = !1, u = d.length;
        const l = d[d.length - 1]._source;
        (l === ri.Depth || l === ri.DepthStencil) && (v = !0, u--);
        const P = [], p = [], c = [], H = [], T = [], q = [], b = [], j = {};
        for (let I = 0; I < u; ++I) {
          const N = d[I];
          P.push(N.samplingMode), p.push(N.type), c.push(N.format), j[N.uniqueId] !== void 0 ? (H.push(-1), b.push(0)) : (j[N.uniqueId] = I, N.is2DArray ? (H.push(35866), b.push(N.depth)) : N.isCube ? (H.push(34067), b.push(0)) : N.is3D ? (H.push(32879), b.push(N.depth)) : (H.push(3553), b.push(0))), this._faceIndices && T.push((e = this._faceIndices[I]) !== null && e !== void 0 ? e : 0), this._layerIndices && q.push((t = this._layerIndices[I]) !== null && t !== void 0 ? t : 0);
        }
        const w = {
          samplingModes: P,
          generateMipMaps: d[0].generateMipMaps,
          generateDepthBuffer: this._generateDepthBuffer,
          generateStencilBuffer: this._generateStencilBuffer,
          generateDepthTexture: v,
          types: p,
          formats: c,
          textureCount: u,
          targetTypes: H,
          faceIndex: T,
          layerIndex: q,
          layerCounts: b
        }, m = {
          width: this.width,
          height: this.height
        };
        o = this._engine.createMultipleRenderTarget(m, w);
        for (let I = 0; I < u; ++I) {
          if (H[I] !== -1)
            continue;
          const N = j[d[I].uniqueId];
          o.setTexture(o.textures[N], I);
        }
      }
    } else {
      const d = {};
      if (d.generateDepthBuffer = this._generateDepthBuffer, d.generateMipMaps = (n = (r = this.texture) === null || r === void 0 ? void 0 : r.generateMipMaps) !== null && n !== void 0 ? n : !1, d.generateStencilBuffer = this._generateStencilBuffer, d.samplingMode = (i = this.texture) === null || i === void 0 ? void 0 : i.samplingMode, d.type = (s = this.texture) === null || s === void 0 ? void 0 : s.type, d.format = (a = this.texture) === null || a === void 0 ? void 0 : a.format, this.isCube)
        o = this._engine.createRenderTargetCubeTexture(this.width, d);
      else {
        const v = {
          width: this.width,
          height: this.height,
          layers: this.is2DArray ? (f = this.texture) === null || f === void 0 ? void 0 : f.depth : void 0
        };
        o = this._engine.createRenderTargetTexture(v, d);
      }
      o.texture.isReady = !0;
    }
    return o;
  }
  _swapRenderTargetWrapper(e) {
    if (this._textures && e._textures)
      for (let t = 0; t < this._textures.length; ++t)
        this._textures[t]._swapAndDie(e._textures[t], !1), e._textures[t].isReady = !0;
    this._depthStencilTexture && e._depthStencilTexture && (this._depthStencilTexture._swapAndDie(e._depthStencilTexture), e._depthStencilTexture.isReady = !0), this._textures = null, this._depthStencilTexture = null;
  }
  /** @internal */
  _rebuild() {
    const e = this._cloneRenderTargetWrapper();
    if (e) {
      if (this._depthStencilTexture) {
        const t = this._depthStencilTexture.samplingMode, r = t === 2 || t === 3 || t === 11;
        e.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction, r, this._depthStencilTextureWithStencil, this._depthStencilTexture.samples);
      }
      this.samples > 1 && e.setSamples(this.samples), e._swapRenderTargetWrapper(this), e.dispose();
    }
  }
  /**
   * Releases the internal render textures
   */
  releaseTextures() {
    var e, t;
    if (this._textures)
      for (let r = 0; (t = r < ((e = this._textures) === null || e === void 0 ? void 0 : e.length)) !== null && t !== void 0 && t; ++r)
        this._textures[r].dispose();
    this._textures = null;
  }
  /**
   * Disposes the whole render target wrapper
   * @param disposeOnlyFramebuffers true if only the frame buffers should be released (used for the WebGL engine). If false, all the textures will also be released
   */
  dispose(e = !1) {
    var t;
    e || ((t = this._depthStencilTexture) === null || t === void 0 || t.dispose(), this._depthStencilTexture = null, this.releaseTextures()), this._engine._releaseRenderTargetWrapper(this);
  }
}
class R6e extends DR {
  constructor(e, t, r, n, i) {
    super(e, t, r, n), this._framebuffer = null, this._depthStencilBuffer = null, this._MSAAFramebuffer = null, this._colorTextureArray = null, this._depthStencilTextureArray = null, this._disposeOnlyFramebuffers = !1, this._currentLOD = 0, this._context = i;
  }
  _cloneRenderTargetWrapper() {
    let e = null;
    return this._colorTextureArray && this._depthStencilTextureArray ? (e = this._engine.createMultiviewRenderTargetTexture(this.width, this.height), e.texture.isReady = !0) : e = super._cloneRenderTargetWrapper(), e;
  }
  _swapRenderTargetWrapper(e) {
    super._swapRenderTargetWrapper(e), e._framebuffer = this._framebuffer, e._depthStencilBuffer = this._depthStencilBuffer, e._MSAAFramebuffer = this._MSAAFramebuffer, e._colorTextureArray = this._colorTextureArray, e._depthStencilTextureArray = this._depthStencilTextureArray, this._framebuffer = this._depthStencilBuffer = this._MSAAFramebuffer = this._colorTextureArray = this._depthStencilTextureArray = null;
  }
  /**
   * Shares the depth buffer of this render target with another render target.
   * @internal
   * @param renderTarget Destination renderTarget
   */
  _shareDepth(e) {
    super._shareDepth(e);
    const t = this._context, r = this._depthStencilBuffer, n = e._MSAAFramebuffer || e._framebuffer;
    e._depthStencilBuffer && e._depthStencilBuffer !== r && t.deleteRenderbuffer(e._depthStencilBuffer), e._depthStencilBuffer = r;
    const i = e._generateStencilBuffer ? t.DEPTH_STENCIL_ATTACHMENT : t.DEPTH_ATTACHMENT;
    this._engine._bindUnboundFramebuffer(n), t.framebufferRenderbuffer(t.FRAMEBUFFER, i, t.RENDERBUFFER, r), this._engine._bindUnboundFramebuffer(null);
  }
  /**
   * Binds a texture to this render target on a specific attachment
   * @param texture The texture to bind to the framebuffer
   * @param attachmentIndex Index of the attachment
   * @param faceIndexOrLayer The face or layer of the texture to render to in case of cube texture or array texture
   * @param lodLevel defines the lod level to bind to the frame buffer
   */
  _bindTextureRenderTarget(e, t = 0, r, n = 0) {
    var i, s, a, f;
    if (!e._hardwareTexture)
      return;
    const o = this._framebuffer, d = this._engine._currentFramebuffer;
    if (this._engine._bindUnboundFramebuffer(o), this._engine.webGLVersion > 1) {
      const v = this._context, u = v["COLOR_ATTACHMENT" + t];
      e.is2DArray || e.is3D ? (r = (s = r ?? ((i = this.layerIndices) === null || i === void 0 ? void 0 : i[t])) !== null && s !== void 0 ? s : 0, v.framebufferTextureLayer(v.FRAMEBUFFER, u, e._hardwareTexture.underlyingResource, n, r)) : e.isCube ? (r = (f = r ?? ((a = this.faceIndices) === null || a === void 0 ? void 0 : a[t])) !== null && f !== void 0 ? f : 0, v.framebufferTexture2D(v.FRAMEBUFFER, u, v.TEXTURE_CUBE_MAP_POSITIVE_X + r, e._hardwareTexture.underlyingResource, n)) : v.framebufferTexture2D(v.FRAMEBUFFER, u, v.TEXTURE_2D, e._hardwareTexture.underlyingResource, n);
    } else {
      const v = this._context, u = v["COLOR_ATTACHMENT" + t + "_WEBGL"], l = r !== void 0 ? v.TEXTURE_CUBE_MAP_POSITIVE_X + r : v.TEXTURE_2D;
      v.framebufferTexture2D(v.FRAMEBUFFER, u, l, e._hardwareTexture.underlyingResource, n);
    }
    this._engine._bindUnboundFramebuffer(d);
  }
  /**
   * Set a texture in the textures array
   * @param texture the texture to set
   * @param index the index in the textures array to set
   * @param disposePrevious If this function should dispose the previous texture
   */
  setTexture(e, t = 0, r = !0) {
    super.setTexture(e, t, r), this._bindTextureRenderTarget(e, t);
  }
  /**
   * Sets the layer and face indices of every render target texture
   * @param layers The layer of the texture to be set (make negative to not modify)
   * @param faces The face of the texture to be set (make negative to not modify)
   */
  setLayerAndFaceIndices(e, t) {
    var r, n;
    if (super.setLayerAndFaceIndices(e, t), !this.textures || !this.layerIndices || !this.faceIndices)
      return;
    const i = (n = (r = this._attachments) === null || r === void 0 ? void 0 : r.length) !== null && n !== void 0 ? n : this.textures.length;
    for (let s = 0; s < i; s++) {
      const a = this.textures[s];
      a && (a.is2DArray || a.is3D ? this._bindTextureRenderTarget(a, s, this.layerIndices[s]) : a.isCube ? this._bindTextureRenderTarget(a, s, this.faceIndices[s]) : this._bindTextureRenderTarget(a, s));
    }
  }
  /**
   * Set the face and layer indices of a texture in the textures array
   * @param index The index of the texture in the textures array to modify
   * @param layer The layer of the texture to be set
   * @param face The face of the texture to be set
   */
  setLayerAndFaceIndex(e = 0, t, r) {
    if (super.setLayerAndFaceIndex(e, t, r), !this.textures || !this.layerIndices || !this.faceIndices)
      return;
    const n = this.textures[e];
    n.is2DArray || n.is3D ? this._bindTextureRenderTarget(this.textures[e], e, this.layerIndices[e]) : n.isCube && this._bindTextureRenderTarget(this.textures[e], e, this.faceIndices[e]);
  }
  dispose(e = this._disposeOnlyFramebuffers) {
    const t = this._context;
    e || (this._colorTextureArray && (this._context.deleteTexture(this._colorTextureArray), this._colorTextureArray = null), this._depthStencilTextureArray && (this._context.deleteTexture(this._depthStencilTextureArray), this._depthStencilTextureArray = null)), this._framebuffer && (t.deleteFramebuffer(this._framebuffer), this._framebuffer = null), this._depthStencilBuffer && (t.deleteRenderbuffer(this._depthStencilBuffer), this._depthStencilBuffer = null), this._MSAAFramebuffer && (t.deleteFramebuffer(this._MSAAFramebuffer), this._MSAAFramebuffer = null), super.dispose(e);
  }
}
hr.prototype._createHardwareRenderTargetWrapper = function(A, e, t) {
  const r = new R6e(A, e, t, this, this._gl);
  return this._renderTargetWrapperCache.push(r), r;
};
hr.prototype.createRenderTargetTexture = function(A, e) {
  var t, r;
  const n = this._createHardwareRenderTargetWrapper(!1, !1, A);
  let i = !0, s = !1, a = !1, f, o = 1;
  e !== void 0 && typeof e == "object" && (i = (t = e.generateDepthBuffer) !== null && t !== void 0 ? t : !0, s = !!e.generateStencilBuffer, a = !!e.noColorAttachment, f = e.colorAttachment, o = (r = e.samples) !== null && r !== void 0 ? r : 1);
  const d = f || (a ? null : this._createInternalTexture(A, e, !0, ri.RenderTarget)), v = A.width || A, u = A.height || A, l = this._currentFramebuffer, P = this._gl, p = P.createFramebuffer();
  return this._bindUnboundFramebuffer(p), n._depthStencilBuffer = this._setupFramebufferDepthAttachments(s, i, v, u), d && !d.is2DArray && P.framebufferTexture2D(P.FRAMEBUFFER, P.COLOR_ATTACHMENT0, P.TEXTURE_2D, d._hardwareTexture.underlyingResource, 0), this._bindUnboundFramebuffer(l), n._framebuffer = p, n._generateDepthBuffer = i, n._generateStencilBuffer = s, n.setTextures(d), this.updateRenderTargetTextureSampleCount(n, o), n;
};
hr.prototype.createDepthStencilTexture = function(A, e, t) {
  if (e.isCube) {
    const r = A.width || A;
    return this._createDepthStencilCubeTexture(r, e, t);
  } else
    return this._createDepthStencilTexture(A, e, t);
};
hr.prototype._createDepthStencilTexture = function(A, e, t) {
  const r = this._gl, n = A.layers || 0, i = n !== 0 ? r.TEXTURE_2D_ARRAY : r.TEXTURE_2D, s = new As(this, ri.DepthStencil);
  if (!this._caps.depthTextureExtension)
    return Se.Error("Depth texture is not supported by your browser or hardware."), s;
  const a = Object.assign({ bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1 }, e);
  if (this._bindTextureDirectly(i, s, !0), this._setupDepthStencilTexture(s, A, a.generateStencil, a.comparisonFunction === 0 ? !1 : a.bilinearFiltering, a.comparisonFunction, a.samples), a.depthTextureFormat !== void 0) {
    if (a.depthTextureFormat !== 15 && a.depthTextureFormat !== 16 && a.depthTextureFormat !== 17 && a.depthTextureFormat !== 13 && a.depthTextureFormat !== 14 && a.depthTextureFormat !== 18)
      return Se.Error("Depth texture format is not supported."), s;
    s.format = a.depthTextureFormat;
  } else
    s.format = a.generateStencil ? 13 : 16;
  const f = s.format === 17 || s.format === 13 || s.format === 18;
  t._depthStencilTexture = s, t._depthStencilTextureWithStencil = f;
  let o = r.UNSIGNED_INT;
  s.format === 15 ? o = r.UNSIGNED_SHORT : s.format === 17 || s.format === 13 ? o = r.UNSIGNED_INT_24_8 : s.format === 14 ? o = r.FLOAT : s.format === 18 && (o = r.FLOAT_32_UNSIGNED_INT_24_8_REV);
  const d = f ? r.DEPTH_STENCIL : r.DEPTH_COMPONENT;
  let v = d;
  this.webGLVersion > 1 && (s.format === 15 ? v = r.DEPTH_COMPONENT16 : s.format === 16 ? v = r.DEPTH_COMPONENT24 : s.format === 17 || s.format === 13 ? v = r.DEPTH24_STENCIL8 : s.format === 14 ? v = r.DEPTH_COMPONENT32F : s.format === 18 && (v = r.DEPTH32F_STENCIL8)), s.is2DArray ? r.texImage3D(i, 0, v, s.width, s.height, n, 0, d, o, null) : r.texImage2D(i, 0, v, s.width, s.height, 0, d, o, null), this._bindTextureDirectly(i, null), this._internalTexturesCache.push(s);
  const u = t;
  if (u._depthStencilBuffer) {
    const l = this._currentFramebuffer;
    this._bindUnboundFramebuffer(u._framebuffer), r.framebufferRenderbuffer(r.FRAMEBUFFER, r.DEPTH_STENCIL_ATTACHMENT, r.RENDERBUFFER, null), r.framebufferRenderbuffer(r.FRAMEBUFFER, r.DEPTH_ATTACHMENT, r.RENDERBUFFER, null), r.framebufferRenderbuffer(r.FRAMEBUFFER, r.STENCIL_ATTACHMENT, r.RENDERBUFFER, null), this._bindUnboundFramebuffer(l), r.deleteRenderbuffer(u._depthStencilBuffer), u._depthStencilBuffer = null;
  }
  return s;
};
hr.prototype.updateRenderTargetTextureSampleCount = function(A, e) {
  if (this.webGLVersion < 2 || !A || !A.texture)
    return 1;
  if (A.samples === e)
    return e;
  const t = this._gl;
  e = Math.min(e, this.getCaps().maxMSAASamples), A._depthStencilBuffer && (t.deleteRenderbuffer(A._depthStencilBuffer), A._depthStencilBuffer = null), A._MSAAFramebuffer && (t.deleteFramebuffer(A._MSAAFramebuffer), A._MSAAFramebuffer = null);
  const r = A.texture._hardwareTexture;
  if (r.releaseMSAARenderBuffers(), e > 1 && typeof t.renderbufferStorageMultisample == "function") {
    const n = t.createFramebuffer();
    if (!n)
      throw new Error("Unable to create multi sampled framebuffer");
    A._MSAAFramebuffer = n, this._bindUnboundFramebuffer(A._MSAAFramebuffer);
    const i = this._createRenderBuffer(A.texture.width, A.texture.height, e, -1, this._getRGBABufferInternalSizedFormat(A.texture.type, A.texture.format, A.texture._useSRGBBuffer), t.COLOR_ATTACHMENT0, !1);
    if (!i)
      throw new Error("Unable to create multi sampled framebuffer");
    r.addMSAARenderBuffer(i);
  } else
    this._bindUnboundFramebuffer(A._framebuffer);
  return A.texture.samples = e, A._samples = e, A._depthStencilBuffer = this._setupFramebufferDepthAttachments(A._generateStencilBuffer, A._generateDepthBuffer, A.texture.width, A.texture.height, e), this._bindUnboundFramebuffer(null), e;
};
class kr {
  /**
   * Registers a shader code processing with a post process name.
   * @param postProcessName name of the post process. Use null for the fallback shader code processing. This is the shader code processing that will be used in case no specific shader code processing has been associated to a post process name
   * @param customShaderCodeProcessing shader code processing to associate to the post process name
   * @returns
   */
  static RegisterShaderCodeProcessing(e, t) {
    if (!t) {
      delete kr._CustomShaderCodeProcessing[e ?? ""];
      return;
    }
    kr._CustomShaderCodeProcessing[e ?? ""] = t;
  }
  static _GetShaderCodeProcessing(e) {
    var t;
    return (t = kr._CustomShaderCodeProcessing[e]) !== null && t !== void 0 ? t : kr._CustomShaderCodeProcessing[""];
  }
  /**
   * Number of sample textures (default: 1)
   */
  get samples() {
    return this._samples;
  }
  set samples(e) {
    this._samples = Math.min(e, this._engine.getCaps().maxMSAASamples), this._textures.forEach((t) => {
      t.setSamples(this._samples);
    });
  }
  /**
   * Returns the fragment url or shader name used in the post process.
   * @returns the fragment url or name in the shader store.
   */
  getEffectName() {
    return this._fragmentUrl;
  }
  /**
   * A function that is added to the onActivateObservable
   */
  set onActivate(e) {
    this._onActivateObserver && this.onActivateObservable.remove(this._onActivateObserver), e && (this._onActivateObserver = this.onActivateObservable.add(e));
  }
  /**
   * A function that is added to the onSizeChangedObservable
   */
  set onSizeChanged(e) {
    this._onSizeChangedObserver && this.onSizeChangedObservable.remove(this._onSizeChangedObserver), this._onSizeChangedObserver = this.onSizeChangedObservable.add(e);
  }
  /**
   * A function that is added to the onApplyObservable
   */
  set onApply(e) {
    this._onApplyObserver && this.onApplyObservable.remove(this._onApplyObserver), this._onApplyObserver = this.onApplyObservable.add(e);
  }
  /**
   * A function that is added to the onBeforeRenderObservable
   */
  set onBeforeRender(e) {
    this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e);
  }
  /**
   * A function that is added to the onAfterRenderObservable
   */
  set onAfterRender(e) {
    this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(e);
  }
  /**
   * The input texture for this post process and the output texture of the previous post process. When added to a pipeline the previous post process will
   * render it's output into this texture and this texture will be used as textureSampler in the fragment shader of this post process.
   */
  get inputTexture() {
    return this._textures.data[this._currentRenderTextureInd];
  }
  set inputTexture(e) {
    this._forcedOutputTexture = e;
  }
  /**
   * Since inputTexture should always be defined, if we previously manually set `inputTexture`,
   * the only way to unset it is to use this function to restore its internal state
   */
  restoreDefaultInputTexture() {
    this._forcedOutputTexture && (this._forcedOutputTexture = null, this.markTextureDirty());
  }
  /**
   * Gets the camera which post process is applied to.
   * @returns The camera the post process is applied to.
   */
  getCamera() {
    return this._camera;
  }
  /**
   * Gets the texel size of the postprocess.
   * See https://en.wikipedia.org/wiki/Texel_(graphics)
   */
  get texelSize() {
    return this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.texelSize : (this._forcedOutputTexture && this._texelSize.copyFromFloats(1 / this._forcedOutputTexture.width, 1 / this._forcedOutputTexture.height), this._texelSize);
  }
  /** @internal */
  constructor(e, t, r, n, i, s, a = 1, f, o, d = null, v = 0, u = "postprocess", l, P = !1, p = 5, c = za.GLSL) {
    var H, T, q, b, j, w, m, I, N, k, R, y;
    this._parentContainer = null, this.width = -1, this.height = -1, this.nodeMaterialSource = null, this._outputTexture = null, this.autoClear = !0, this.forceAutoClearInAlphaMode = !1, this.alphaMode = 0, this.animations = [], this.enablePixelPerfectMode = !1, this.forceFullscreenViewport = !0, this.scaleMode = 1, this.alwaysForcePOT = !1, this._samples = 1, this.adaptScaleToCurrentViewport = !1, this._reusable = !1, this._renderId = 0, this.externalTextureSamplerBinding = !1, this._textures = new qf(2), this._textureCache = [], this._currentRenderTextureInd = 0, this._scaleRatio = new at(1, 1), this._texelSize = at.Zero(), this.onActivateObservable = new Oe(), this.onSizeChangedObservable = new Oe(), this.onApplyObservable = new Oe(), this.onBeforeRenderObservable = new Oe(), this.onAfterRenderObservable = new Oe(), this.name = e;
    let O = 1, Y = null;
    if (r && !Array.isArray(r)) {
      const ee = r;
      r = (H = ee.uniforms) !== null && H !== void 0 ? H : null, n = (T = ee.samplers) !== null && T !== void 0 ? T : null, O = (q = ee.size) !== null && q !== void 0 ? q : 1, s = (b = ee.camera) !== null && b !== void 0 ? b : null, a = (j = ee.samplingMode) !== null && j !== void 0 ? j : 1, f = ee.engine, o = ee.reusable, d = (w = ee.defines) !== null && w !== void 0 ? w : null, v = (m = ee.textureType) !== null && m !== void 0 ? m : 0, u = (I = ee.vertexUrl) !== null && I !== void 0 ? I : "postprocess", l = ee.indexParameters, P = (N = ee.blockCompilation) !== null && N !== void 0 ? N : !1, p = (k = ee.textureFormat) !== null && k !== void 0 ? k : 5, c = (R = ee.shaderLanguage) !== null && R !== void 0 ? R : za.GLSL, Y = (y = ee.uniformBuffers) !== null && y !== void 0 ? y : null;
    } else
      i && (typeof i == "number" ? O = i : O = { width: i.width, height: i.height });
    s != null ? (this._camera = s, this._scene = s.getScene(), s.attachPostProcess(this), this._engine = this._scene.getEngine(), this._scene.postProcesses.push(this), this.uniqueId = this._scene.getUniqueId()) : f && (this._engine = f, this._engine.postProcesses.push(this)), this._options = O, this.renderTargetSamplingMode = a || 1, this._reusable = o || !1, this._textureType = v, this._textureFormat = p, this._shaderLanguage = c, this._samplers = n || [], this._samplers.push("textureSampler"), this._fragmentUrl = t, this._vertexUrl = u, this._parameters = r || [], this._parameters.push("scale"), this._uniformBuffers = Y || [], this._indexParameters = l, this._drawWrapper = new zo(this._engine), P || this.updateEffect(d);
  }
  /**
   * Gets a string identifying the name of the class
   * @returns "PostProcess" string
   */
  getClassName() {
    return "PostProcess";
  }
  /**
   * Gets the engine which this post process belongs to.
   * @returns The engine the post process was enabled with.
   */
  getEngine() {
    return this._engine;
  }
  /**
   * The effect that is created when initializing the post process.
   * @returns The created effect corresponding the postprocess.
   */
  getEffect() {
    return this._drawWrapper.effect;
  }
  /**
   * To avoid multiple redundant textures for multiple post process, the output the output texture for this post process can be shared with another.
   * @param postProcess The post process to share the output with.
   * @returns This post process.
   */
  shareOutputWith(e) {
    return this._disposeTextures(), this._shareOutputWithPostProcess = e, this;
  }
  /**
   * Reverses the effect of calling shareOutputWith and returns the post process back to its original state.
   * This should be called if the post process that shares output with this post process is disabled/disposed.
   */
  useOwnOutput() {
    this._textures.length == 0 && (this._textures = new qf(2)), this._shareOutputWithPostProcess = null;
  }
  /**
   * Updates the effect with the current post process compile time values and recompiles the shader.
   * @param defines Define statements that should be added at the beginning of the shader. (default: null)
   * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)
   * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)
   * @param indexParameters The index parameters to be used for babylons include syntax "#include<kernelBlurVaryingDeclaration>[0..varyingCount]". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx
   * @param onCompiled Called when the shader has been compiled.
   * @param onError Called if there is an error when compiling a shader.
   * @param vertexUrl The url of the vertex shader to be used (default: the one given at construction time)
   * @param fragmentUrl The url of the fragment shader to be used (default: the one given at construction time)
   */
  updateEffect(e = null, t = null, r = null, n, i, s, a, f) {
    var o, d;
    const v = kr._GetShaderCodeProcessing(this.name);
    if (v != null && v.defineCustomBindings) {
      const u = (o = t == null ? void 0 : t.slice()) !== null && o !== void 0 ? o : [];
      u.push(...this._parameters);
      const l = (d = r == null ? void 0 : r.slice()) !== null && d !== void 0 ? d : [];
      l.push(...this._samplers), e = v.defineCustomBindings(this.name, e, u, l), t = u, r = l;
    }
    this._postProcessDefines = e, this._drawWrapper.effect = this._engine.createEffect({ vertex: a ?? this._vertexUrl, fragment: f ?? this._fragmentUrl }, {
      attributes: ["position"],
      uniformsNames: t || this._parameters,
      uniformBuffersNames: this._uniformBuffers,
      samplers: r || this._samplers,
      defines: e !== null ? e : "",
      fallbacks: null,
      onCompiled: i ?? null,
      onError: s ?? null,
      indexParameters: n || this._indexParameters,
      processCodeAfterIncludes: v != null && v.processCodeAfterIncludes ? (u, l) => v.processCodeAfterIncludes(this.name, u, l) : null,
      processFinalCode: v != null && v.processFinalCode ? (u, l) => v.processFinalCode(this.name, u, l) : null,
      shaderLanguage: this._shaderLanguage
    }, this._engine);
  }
  /**
   * The post process is reusable if it can be used multiple times within one frame.
   * @returns If the post process is reusable
   */
  isReusable() {
    return this._reusable;
  }
  /** invalidate frameBuffer to hint the postprocess to create a depth buffer */
  markTextureDirty() {
    this.width = -1;
  }
  _createRenderTargetTexture(e, t, r = 0) {
    for (let i = 0; i < this._textureCache.length; i++)
      if (this._textureCache[i].texture.width === e.width && this._textureCache[i].texture.height === e.height && this._textureCache[i].postProcessChannel === r && this._textureCache[i].texture._generateDepthBuffer === t.generateDepthBuffer && this._textureCache[i].texture.samples === t.samples)
        return this._textureCache[i].texture;
    const n = this._engine.createRenderTargetTexture(e, t);
    return this._textureCache.push({ texture: n, postProcessChannel: r, lastUsedRenderId: -1 }), n;
  }
  _flushTextureCache() {
    const e = this._renderId;
    for (let t = this._textureCache.length - 1; t >= 0; t--)
      if (e - this._textureCache[t].lastUsedRenderId > 100) {
        let r = !1;
        for (let n = 0; n < this._textures.length; n++)
          if (this._textures.data[n] === this._textureCache[t].texture) {
            r = !0;
            break;
          }
        r || (this._textureCache[t].texture.dispose(), this._textureCache.splice(t, 1));
      }
  }
  /**
   * Resizes the post-process texture
   * @param width Width of the texture
   * @param height Height of the texture
   * @param camera The camera this post-process is applied to. Pass null if the post-process is used outside the context of a camera post-process chain (default: null)
   * @param needMipMaps True if mip maps need to be generated after render (default: false)
   * @param forceDepthStencil True to force post-process texture creation with stencil depth and buffer (default: false)
   */
  resize(e, t, r = null, n = !1, i = !1) {
    this._textures.length > 0 && this._textures.reset(), this.width = e, this.height = t;
    let s = null;
    if (r) {
      for (let o = 0; o < r._postProcesses.length; o++)
        if (r._postProcesses[o] !== null) {
          s = r._postProcesses[o];
          break;
        }
    }
    const a = { width: this.width, height: this.height }, f = {
      generateMipMaps: n,
      generateDepthBuffer: i || s === this,
      generateStencilBuffer: (i || s === this) && this._engine.isStencilEnable,
      samplingMode: this.renderTargetSamplingMode,
      type: this._textureType,
      format: this._textureFormat,
      samples: this._samples,
      label: "PostProcessRTT-" + this.name
    };
    this._textures.push(this._createRenderTargetTexture(a, f, 0)), this._reusable && this._textures.push(this._createRenderTargetTexture(a, f, 1)), this._texelSize.copyFromFloats(1 / this.width, 1 / this.height), this.onSizeChangedObservable.notifyObservers(this);
  }
  _getTarget() {
    let e;
    if (this._shareOutputWithPostProcess)
      e = this._shareOutputWithPostProcess.inputTexture;
    else if (this._forcedOutputTexture)
      e = this._forcedOutputTexture, this.width = this._forcedOutputTexture.width, this.height = this._forcedOutputTexture.height;
    else {
      e = this.inputTexture;
      let t;
      for (let r = 0; r < this._textureCache.length; r++)
        if (this._textureCache[r].texture === e) {
          t = this._textureCache[r];
          break;
        }
      t && (t.lastUsedRenderId = this._renderId);
    }
    return e;
  }
  /**
   * Activates the post process by intializing the textures to be used when executed. Notifies onActivateObservable.
   * When this post process is used in a pipeline, this is call will bind the input texture of this post process to the output of the previous.
   * @param camera The camera that will be used in the post process. This camera will be used when calling onActivateObservable.
   * @param sourceTexture The source texture to be inspected to get the width and height if not specified in the post process constructor. (default: null)
   * @param forceDepthStencil If true, a depth and stencil buffer will be generated. (default: false)
   * @returns The render target wrapper that was bound to be written to.
   */
  activate(e, t = null, r) {
    var n, i;
    e = e || this._camera;
    const s = e.getScene(), a = s.getEngine(), f = a.getCaps().maxTextureSize, o = (t ? t.width : this._engine.getRenderWidth(!0)) * this._options | 0, d = (t ? t.height : this._engine.getRenderHeight(!0)) * this._options | 0;
    let v = this._options.width || o, u = this._options.height || d;
    const l = this.renderTargetSamplingMode !== 7 && this.renderTargetSamplingMode !== 1 && this.renderTargetSamplingMode !== 2;
    let P = null;
    if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {
      if (this.adaptScaleToCurrentViewport) {
        const p = a.currentViewport;
        p && (v *= p.width, u *= p.height);
      }
      (l || this.alwaysForcePOT) && (this._options.width || (v = a.needPOTTextures ? Ge.GetExponentOfTwo(v, f, this.scaleMode) : v), this._options.height || (u = a.needPOTTextures ? Ge.GetExponentOfTwo(u, f, this.scaleMode) : u)), (this.width !== v || this.height !== u || !(P = this._getTarget())) && this.resize(v, u, e, l, r), this._textures.forEach((p) => {
        p.samples !== this.samples && this._engine.updateRenderTargetTextureSampleCount(p, this.samples);
      }), this._flushTextureCache(), this._renderId++;
    }
    return P || (P = this._getTarget()), this.enablePixelPerfectMode ? (this._scaleRatio.copyFromFloats(o / v, d / u), this._engine.bindFramebuffer(P, 0, o, d, this.forceFullscreenViewport)) : (this._scaleRatio.copyFromFloats(1, 1), this._engine.bindFramebuffer(P, 0, void 0, void 0, this.forceFullscreenViewport)), (i = (n = this._engine)._debugInsertMarker) === null || i === void 0 || i.call(n, `post process ${this.name} input`), this.onActivateObservable.notifyObservers(e), this.autoClear && (this.alphaMode === 0 || this.forceAutoClearInAlphaMode) && this._engine.clear(this.clearColor ? this.clearColor : s.clearColor, s._allowPostProcessClearColor, !0, !0), this._reusable && (this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2), P;
  }
  /**
   * If the post process is supported.
   */
  get isSupported() {
    return this._drawWrapper.effect.isSupported;
  }
  /**
   * The aspect ratio of the output texture.
   */
  get aspectRatio() {
    return this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.aspectRatio : this._forcedOutputTexture ? this._forcedOutputTexture.width / this._forcedOutputTexture.height : this.width / this.height;
  }
  /**
   * Get a value indicating if the post-process is ready to be used
   * @returns true if the post-process is ready (shader is compiled)
   */
  isReady() {
    var e, t;
    return (t = (e = this._drawWrapper.effect) === null || e === void 0 ? void 0 : e.isReady()) !== null && t !== void 0 ? t : !1;
  }
  /**
   * Binds all textures and uniforms to the shader, this will be run on every pass.
   * @returns the effect corresponding to this post process. Null if not compiled or not ready.
   */
  apply() {
    var e, t, r;
    if (!(!((e = this._drawWrapper.effect) === null || e === void 0) && e.isReady()))
      return null;
    this._engine.enableEffect(this._drawWrapper), this._engine.setState(!1), this._engine.setDepthBuffer(!1), this._engine.setDepthWrite(!1), this._engine.setAlphaMode(this.alphaMode), this.alphaConstants && this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a);
    let n;
    return this._shareOutputWithPostProcess ? n = this._shareOutputWithPostProcess.inputTexture : this._forcedOutputTexture ? n = this._forcedOutputTexture : n = this.inputTexture, this.externalTextureSamplerBinding || this._drawWrapper.effect._bindTexture("textureSampler", n == null ? void 0 : n.texture), this._drawWrapper.effect.setVector2("scale", this._scaleRatio), this.onApplyObservable.notifyObservers(this._drawWrapper.effect), (r = (t = kr._GetShaderCodeProcessing(this.name)) === null || t === void 0 ? void 0 : t.bindCustomBindings) === null || r === void 0 || r.call(t, this.name, this._drawWrapper.effect), this._drawWrapper.effect;
  }
  _disposeTextures() {
    if (this._shareOutputWithPostProcess || this._forcedOutputTexture) {
      this._disposeTextureCache();
      return;
    }
    this._disposeTextureCache(), this._textures.dispose();
  }
  _disposeTextureCache() {
    for (let e = this._textureCache.length - 1; e >= 0; e--)
      this._textureCache[e].texture.dispose();
    this._textureCache.length = 0;
  }
  /**
   * Sets the required values to the prepass renderer.
   * @param prePassRenderer defines the prepass renderer to setup.
   * @returns true if the pre pass is needed.
   */
  setPrePassRenderer(e) {
    return this._prePassEffectConfiguration ? (this._prePassEffectConfiguration = e.addEffectConfiguration(this._prePassEffectConfiguration), this._prePassEffectConfiguration.enabled = !0, !0) : !1;
  }
  /**
   * Disposes the post process.
   * @param camera The camera to dispose the post process on.
   */
  dispose(e) {
    e = e || this._camera, this._disposeTextures();
    let t;
    if (this._scene && (t = this._scene.postProcesses.indexOf(this), t !== -1 && this._scene.postProcesses.splice(t, 1)), this._parentContainer) {
      const r = this._parentContainer.postProcesses.indexOf(this);
      r > -1 && this._parentContainer.postProcesses.splice(r, 1), this._parentContainer = null;
    }
    if (t = this._engine.postProcesses.indexOf(this), t !== -1 && this._engine.postProcesses.splice(t, 1), !!e) {
      if (e.detachPostProcess(this), t = e._postProcesses.indexOf(this), t === 0 && e._postProcesses.length > 0) {
        const r = this._camera._getFirstPostProcess();
        r && r.markTextureDirty();
      }
      this.onActivateObservable.clear(), this.onAfterRenderObservable.clear(), this.onApplyObservable.clear(), this.onBeforeRenderObservable.clear(), this.onSizeChangedObservable.clear();
    }
  }
  /**
   * Serializes the post process to a JSON object
   * @returns the JSON object
   */
  serialize() {
    const e = jt.Serialize(this), t = this.getCamera() || this._scene && this._scene.activeCamera;
    return e.customType = "BABYLON." + this.getClassName(), e.cameraId = t ? t.id : null, e.reusable = this._reusable, e.textureType = this._textureType, e.fragmentUrl = this._fragmentUrl, e.parameters = this._parameters, e.samplers = this._samplers, e.options = this._options, e.defines = this._postProcessDefines, e.textureFormat = this._textureFormat, e.vertexUrl = this._vertexUrl, e.indexParameters = this._indexParameters, e;
  }
  /**
   * Clones this post process
   * @returns a new post process similar to this one
   */
  clone() {
    const e = this.serialize();
    e._engine = this._engine, e.cameraId = null;
    const t = kr.Parse(e, this._scene, "");
    return t ? (t.onActivateObservable = this.onActivateObservable.clone(), t.onSizeChangedObservable = this.onSizeChangedObservable.clone(), t.onApplyObservable = this.onApplyObservable.clone(), t.onBeforeRenderObservable = this.onBeforeRenderObservable.clone(), t.onAfterRenderObservable = this.onAfterRenderObservable.clone(), t._prePassEffectConfiguration = this._prePassEffectConfiguration, t) : null;
  }
  /**
   * Creates a material from parsed material data
   * @param parsedPostProcess defines parsed post process data
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures
   * @returns a new post process
   */
  static Parse(e, t, r) {
    const n = Jo(e.customType);
    if (!n || !n._Parse)
      return null;
    const i = t ? t.getCameraById(e.cameraId) : null;
    return n._Parse(e, i, t, r);
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new kr(e.name, e.fragmentUrl, e.parameters, e.samplers, e.options, t, e.renderTargetSamplingMode, e._engine, e.reusable, e.defines, e.textureType, e.vertexUrl, e.indexParameters, !1, e.textureFormat), e, r, n);
  }
}
kr._CustomShaderCodeProcessing = {};
C([
  M()
], kr.prototype, "uniqueId", void 0);
C([
  M()
], kr.prototype, "name", void 0);
C([
  M()
], kr.prototype, "width", void 0);
C([
  M()
], kr.prototype, "height", void 0);
C([
  M()
], kr.prototype, "renderTargetSamplingMode", void 0);
C([
  rU()
], kr.prototype, "clearColor", void 0);
C([
  M()
], kr.prototype, "autoClear", void 0);
C([
  M()
], kr.prototype, "forceAutoClearInAlphaMode", void 0);
C([
  M()
], kr.prototype, "alphaMode", void 0);
C([
  M()
], kr.prototype, "alphaConstants", void 0);
C([
  M()
], kr.prototype, "enablePixelPerfectMode", void 0);
C([
  M()
], kr.prototype, "forceFullscreenViewport", void 0);
C([
  M()
], kr.prototype, "scaleMode", void 0);
C([
  M()
], kr.prototype, "alwaysForcePOT", void 0);
C([
  M("samples")
], kr.prototype, "_samples", void 0);
C([
  M()
], kr.prototype, "adaptScaleToCurrentViewport", void 0);
Ue("BABYLON.PostProcess", kr);
class BI extends Mr {
  /**
   * Create a new VectorMergerBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.xSwizzle = "x", this.ySwizzle = "y", this.zSwizzle = "z", this.wSwizzle = "w", this.registerInput("xyzw ", de.Vector4, !0), this.registerInput("xyz ", de.Vector3, !0), this.registerInput("xy ", de.Vector2, !0), this.registerInput("zw ", de.Vector2, !0), this.registerInput("x", de.Float, !0), this.registerInput("y", de.Float, !0), this.registerInput("z", de.Float, !0), this.registerInput("w", de.Float, !0), this.registerOutput("xyzw", de.Vector4), this.registerOutput("xyz", de.Vector3), this.registerOutput("xy", de.Vector2), this.registerOutput("zw", de.Vector2);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "VectorMergerBlock";
  }
  /**
   * Gets the xyzw component (input)
   */
  get xyzwIn() {
    return this._inputs[0];
  }
  /**
   * Gets the xyz component (input)
   */
  get xyzIn() {
    return this._inputs[1];
  }
  /**
   * Gets the xy component (input)
   */
  get xyIn() {
    return this._inputs[2];
  }
  /**
   * Gets the zw component (input)
   */
  get zwIn() {
    return this._inputs[3];
  }
  /**
   * Gets the x component (input)
   */
  get x() {
    return this._inputs[4];
  }
  /**
   * Gets the y component (input)
   */
  get y() {
    return this._inputs[5];
  }
  /**
   * Gets the z component (input)
   */
  get z() {
    return this._inputs[6];
  }
  /**
   * Gets the w component (input)
   */
  get w() {
    return this._inputs[7];
  }
  /**
   * Gets the xyzw component (output)
   */
  get xyzw() {
    return this._outputs[0];
  }
  /**
   * Gets the xyz component (output)
   */
  get xyzOut() {
    return this._outputs[1];
  }
  /**
   * Gets the xy component (output)
   */
  get xyOut() {
    return this._outputs[2];
  }
  /**
   * Gets the zw component (output)
   */
  get zwOut() {
    return this._outputs[3];
  }
  /**
   * Gets the xy component (output)
   * @deprecated Please use xyOut instead.
   */
  get xy() {
    return this.xyOut;
  }
  /**
   * Gets the xyz component (output)
   * @deprecated Please use xyzOut instead.
   */
  get xyz() {
    return this.xyzOut;
  }
  _inputRename(e) {
    return e === "xyzw " ? "xyzwIn" : e === "xyz " ? "xyzIn" : e === "xy " ? "xyIn" : e === "zw " ? "zwIn" : e;
  }
  _buildSwizzle(e) {
    return "." + (this.xSwizzle + this.ySwizzle + this.zSwizzle + this.wSwizzle).substr(0, e);
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.x, r = this.y, n = this.z, i = this.w, s = this.xyIn, a = this.zwIn, f = this.xyzIn, o = this.xyzwIn, d = this._outputs[0], v = this._outputs[1], u = this._outputs[2], l = this._outputs[3];
    return o.isConnected ? (d.hasEndpoints && (e.compilationString += this._declareOutput(d, e) + ` = ${o.associatedVariableName}${this._buildSwizzle(4)};
`), v.hasEndpoints && (e.compilationString += this._declareOutput(v, e) + ` = ${o.associatedVariableName}${this._buildSwizzle(3)};
`), u.hasEndpoints && (e.compilationString += this._declareOutput(u, e) + ` = ${o.associatedVariableName}${this._buildSwizzle(2)};
`)) : f.isConnected ? (d.hasEndpoints && (e.compilationString += this._declareOutput(d, e) + ` = vec4(${f.associatedVariableName}, ${i.isConnected ? this._writeVariable(i) : "0.0"})${this._buildSwizzle(4)};
`), v.hasEndpoints && (e.compilationString += this._declareOutput(v, e) + ` = ${f.associatedVariableName}${this._buildSwizzle(3)};
`), u.hasEndpoints && (e.compilationString += this._declareOutput(u, e) + ` = ${f.associatedVariableName}${this._buildSwizzle(2)};
`)) : s.isConnected ? (d.hasEndpoints && (a.isConnected ? e.compilationString += this._declareOutput(d, e) + ` = vec4(${s.associatedVariableName}, ${a.associatedVariableName})${this._buildSwizzle(4)};
` : e.compilationString += this._declareOutput(d, e) + ` = vec4(${s.associatedVariableName}, ${n.isConnected ? this._writeVariable(n) : "0.0"}, ${i.isConnected ? this._writeVariable(i) : "0.0"})${this._buildSwizzle(4)};
`), v.hasEndpoints && (e.compilationString += this._declareOutput(v, e) + ` = vec3(${s.associatedVariableName}, ${n.isConnected ? this._writeVariable(n) : "0.0"})${this._buildSwizzle(3)};
`), u.hasEndpoints && (e.compilationString += this._declareOutput(u, e) + ` = ${s.associatedVariableName}${this._buildSwizzle(2)};
`), l.hasEndpoints && (a.isConnected ? e.compilationString += this._declareOutput(l, e) + ` = ${a.associatedVariableName}${this._buildSwizzle(2)};
` : e.compilationString += this._declareOutput(l, e) + ` = vec2(${n.isConnected ? this._writeVariable(n) : "0.0"}, ${i.isConnected ? this._writeVariable(i) : "0.0"})${this._buildSwizzle(2)};
`)) : (d.hasEndpoints && (a.isConnected ? e.compilationString += this._declareOutput(d, e) + ` = vec4(${t.isConnected ? this._writeVariable(t) : "0.0"}, ${r.isConnected ? this._writeVariable(r) : "0.0"}, ${a.associatedVariableName})${this._buildSwizzle(4)};
` : e.compilationString += this._declareOutput(d, e) + ` = vec4(${t.isConnected ? this._writeVariable(t) : "0.0"}, ${r.isConnected ? this._writeVariable(r) : "0.0"}, ${n.isConnected ? this._writeVariable(n) : "0.0"}, ${i.isConnected ? this._writeVariable(i) : "0.0"})${this._buildSwizzle(4)};
`), v.hasEndpoints && (e.compilationString += this._declareOutput(v, e) + ` = vec3(${t.isConnected ? this._writeVariable(t) : "0.0"}, ${r.isConnected ? this._writeVariable(r) : "0.0"}, ${n.isConnected ? this._writeVariable(n) : "0.0"})${this._buildSwizzle(3)};
`), u.hasEndpoints && (e.compilationString += this._declareOutput(u, e) + ` = vec2(${t.isConnected ? this._writeVariable(t) : "0.0"}, ${r.isConnected ? this._writeVariable(r) : "0.0"})${this._buildSwizzle(2)};
`), l.hasEndpoints && (a.isConnected ? e.compilationString += this._declareOutput(l, e) + ` = ${a.associatedVariableName}${this._buildSwizzle(2)};
` : e.compilationString += this._declareOutput(l, e) + ` = vec2(${n.isConnected ? this._writeVariable(n) : "0.0"}, ${i.isConnected ? this._writeVariable(i) : "0.0"})${this._buildSwizzle(2)};
`)), this;
  }
  serialize() {
    const e = super.serialize();
    return e.xSwizzle = this.xSwizzle, e.ySwizzle = this.ySwizzle, e.zSwizzle = this.zSwizzle, e.wSwizzle = this.wSwizzle, e;
  }
  _deserialize(e, t, r) {
    var n, i, s, a;
    super._deserialize(e, t, r), this.xSwizzle = (n = e.xSwizzle) !== null && n !== void 0 ? n : "x", this.ySwizzle = (i = e.ySwizzle) !== null && i !== void 0 ? i : "y", this.zSwizzle = (s = e.zSwizzle) !== null && s !== void 0 ? s : "z", this.wSwizzle = (a = e.wSwizzle) !== null && a !== void 0 ? a : "w";
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.xSwizzle = "${this.xSwizzle}";
`, e += `${this._codeVariableName}.ySwizzle = "${this.ySwizzle}";
`, e += `${this._codeVariableName}.zSwizzle = "${this.zSwizzle}";
`, e += `${this._codeVariableName}.wSwizzle = "${this.wSwizzle}";
`, e;
  }
}
Ue("BABYLON.VectorMergerBlock", BI);
class jR extends Mr {
  /**
   * Creates a new RemapBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.sourceRange = new at(-1, 1), this.targetRange = new at(0, 1), this.registerInput("input", de.AutoDetect), this.registerInput("sourceMin", de.Float, !0), this.registerInput("sourceMax", de.Float, !0), this.registerInput("targetMin", de.Float, !0), this.registerInput("targetMax", de.Float, !0), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "RemapBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the source min input component
   */
  get sourceMin() {
    return this._inputs[1];
  }
  /**
   * Gets the source max input component
   */
  get sourceMax() {
    return this._inputs[2];
  }
  /**
   * Gets the target min input component
   */
  get targetMin() {
    return this._inputs[3];
  }
  /**
   * Gets the target max input component
   */
  get targetMax() {
    return this._inputs[4];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], r = this.sourceMin.isConnected ? this.sourceMin.associatedVariableName : this._writeFloat(this.sourceRange.x), n = this.sourceMax.isConnected ? this.sourceMax.associatedVariableName : this._writeFloat(this.sourceRange.y), i = this.targetMin.isConnected ? this.targetMin.associatedVariableName : this._writeFloat(this.targetRange.x), s = this.targetMax.isConnected ? this.targetMax.associatedVariableName : this._writeFloat(this.targetRange.y);
    return e.compilationString += this._declareOutput(t, e) + ` = ${i} + (${this._inputs[0].associatedVariableName} - ${r}) * (${s} - ${i}) / (${n} - ${r});
`, this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode() + `${this._codeVariableName}.sourceRange = new BABYLON.Vector2(${this.sourceRange.x}, ${this.sourceRange.y});
`;
    return e += `${this._codeVariableName}.targetRange = new BABYLON.Vector2(${this.targetRange.x}, ${this.targetRange.y});
`, e;
  }
  serialize() {
    const e = super.serialize();
    return e.sourceRange = this.sourceRange.asArray(), e.targetRange = this.targetRange.asArray(), e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.sourceRange = at.FromArray(e.sourceRange), this.targetRange = at.FromArray(e.targetRange);
  }
}
C([
  rn("From", Gr.Vector2)
], jR.prototype, "sourceRange", void 0);
C([
  rn("To", Gr.Vector2)
], jR.prototype, "targetRange", void 0);
Ue("BABYLON.RemapBlock", jR);
class zC extends Mr {
  /**
   * Creates a new MultiplyBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._inputs[0].acceptedConnectionPointTypes.push(de.Float), this._inputs[1].acceptedConnectionPointTypes.push(de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MultiplyBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};
`, this;
  }
}
Ue("BABYLON.MultiplyBlock", zC);
var Vv;
(function(A) {
  A[A.Material = 0] = "Material", A[A.PostProcess = 1] = "PostProcess", A[A.Particle = 2] = "Particle", A[A.ProceduralTexture = 3] = "ProceduralTexture";
})(Vv || (Vv = {}));
class AD {
  /**
   * Creates a new instance BoxParticleEmitter
   */
  constructor() {
    this.direction1 = new S(0, 1, 0), this.direction2 = new S(0, 1, 0), this.minEmitBox = new S(-0.5, -0.5, -0.5), this.maxEmitBox = new S(0.5, 0.5, 0.5);
  }
  /**
   * Called by the particle System when the direction is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param directionToUpdate is the direction vector to update with the result
   * @param particle is the particle we are computed the direction for
   * @param isLocal defines if the direction should be set in local space
   */
  startDirectionFunction(e, t, r, n) {
    const i = Xt.RandomRange(this.direction1.x, this.direction2.x), s = Xt.RandomRange(this.direction1.y, this.direction2.y), a = Xt.RandomRange(this.direction1.z, this.direction2.z);
    if (n) {
      t.x = i, t.y = s, t.z = a;
      return;
    }
    S.TransformNormalFromFloatsToRef(i, s, a, e, t);
  }
  /**
   * Called by the particle System when the position is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param positionToUpdate is the position vector to update with the result
   * @param particle is the particle we are computed the position for
   * @param isLocal defines if the position should be set in local space
   */
  startPositionFunction(e, t, r, n) {
    const i = Xt.RandomRange(this.minEmitBox.x, this.maxEmitBox.x), s = Xt.RandomRange(this.minEmitBox.y, this.maxEmitBox.y), a = Xt.RandomRange(this.minEmitBox.z, this.maxEmitBox.z);
    if (n) {
      t.x = i, t.y = s, t.z = a;
      return;
    }
    S.TransformCoordinatesFromFloatsToRef(i, s, a, e, t);
  }
  /**
   * Clones the current emitter and returns a copy of it
   * @returns the new emitter
   */
  clone() {
    const e = new AD();
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Called by the GPUParticleSystem to setup the update shader
   * @param uboOrEffect defines the update shader
   */
  applyToShader(e) {
    e.setVector3("direction1", this.direction1), e.setVector3("direction2", this.direction2), e.setVector3("minEmitBox", this.minEmitBox), e.setVector3("maxEmitBox", this.maxEmitBox);
  }
  /**
   * Creates the structure of the ubo for this particle emitter
   * @param ubo ubo to create the structure for
   */
  buildUniformLayout(e) {
    e.addUniform("direction1", 3), e.addUniform("direction2", 3), e.addUniform("minEmitBox", 3), e.addUniform("maxEmitBox", 3);
  }
  /**
   * Returns a string to use to update the GPU particles update shader
   * @returns a string containing the defines string
   */
  getEffectDefines() {
    return "#define BOXEMITTER";
  }
  /**
   * Returns the string "BoxParticleEmitter"
   * @returns a string containing the class name
   */
  getClassName() {
    return "BoxParticleEmitter";
  }
  /**
   * Serializes the particle system to a JSON object.
   * @returns the JSON object
   */
  serialize() {
    const e = {};
    return e.type = this.getClassName(), e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e.minEmitBox = this.minEmitBox.asArray(), e.maxEmitBox = this.maxEmitBox.asArray(), e;
  }
  /**
   * Parse properties from a JSON object
   * @param serializationObject defines the JSON object
   */
  parse(e) {
    S.FromArrayToRef(e.direction1, 0, this.direction1), S.FromArrayToRef(e.direction2, 0, this.direction2), S.FromArrayToRef(e.minEmitBox, 0, this.minEmitBox), S.FromArrayToRef(e.maxEmitBox, 0, this.maxEmitBox);
  }
}
class wR {
  /**
   * Gets or sets the radius of the emission cone
   */
  get radius() {
    return this._radius;
  }
  set radius(e) {
    this._radius = e, this._buildHeight();
  }
  /**
   * Gets or sets the angle of the emission cone
   */
  get angle() {
    return this._angle;
  }
  set angle(e) {
    this._angle = e, this._buildHeight();
  }
  _buildHeight() {
    this._angle !== 0 ? this._height = this._radius / Math.tan(this._angle / 2) : this._height = 1;
  }
  /**
   * Creates a new instance ConeParticleEmitter
   * @param radius the radius of the emission cone (1 by default)
   * @param angle the cone base angle (PI by default)
   * @param directionRandomizer defines how much to randomize the particle direction [0-1] (default is 0)
   */
  constructor(e = 1, t = Math.PI, r = 0) {
    this.directionRandomizer = r, this.radiusRange = 1, this.heightRange = 1, this.emitFromSpawnPointOnly = !1, this.angle = t, this.radius = e;
  }
  /**
   * Called by the particle System when the direction is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param directionToUpdate is the direction vector to update with the result
   * @param particle is the particle we are computed the direction for
   * @param isLocal defines if the direction should be set in local space
   */
  startDirectionFunction(e, t, r, n) {
    n ? ue.Vector3[0].copyFrom(r._localPosition).normalize() : r.position.subtractToRef(e.getTranslation(), ue.Vector3[0]).normalize();
    const i = Xt.RandomRange(0, this.directionRandomizer), s = Xt.RandomRange(0, this.directionRandomizer), a = Xt.RandomRange(0, this.directionRandomizer);
    t.x = ue.Vector3[0].x + i, t.y = ue.Vector3[0].y + s, t.z = ue.Vector3[0].z + a, t.normalize();
  }
  /**
   * Called by the particle System when the position is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param positionToUpdate is the position vector to update with the result
   * @param particle is the particle we are computed the position for
   * @param isLocal defines if the position should be set in local space
   */
  startPositionFunction(e, t, r, n) {
    const i = Xt.RandomRange(0, Math.PI * 2);
    let s;
    this.emitFromSpawnPointOnly ? s = 1e-4 : (s = Xt.RandomRange(0, this.heightRange), s = 1 - s * s);
    let a = this._radius - Xt.RandomRange(0, this._radius * this.radiusRange);
    a = a * s;
    const f = a * Math.sin(i), o = a * Math.cos(i), d = s * this._height;
    if (n) {
      t.x = f, t.y = d, t.z = o;
      return;
    }
    S.TransformCoordinatesFromFloatsToRef(f, d, o, e, t);
  }
  /**
   * Clones the current emitter and returns a copy of it
   * @returns the new emitter
   */
  clone() {
    const e = new wR(this._radius, this._angle, this.directionRandomizer);
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Called by the GPUParticleSystem to setup the update shader
   * @param uboOrEffect defines the update shader
   */
  applyToShader(e) {
    e.setFloat2("radius", this._radius, this.radiusRange), e.setFloat("coneAngle", this._angle), e.setFloat2("height", this._height, this.heightRange), e.setFloat("directionRandomizer", this.directionRandomizer);
  }
  /**
   * Creates the structure of the ubo for this particle emitter
   * @param ubo ubo to create the structure for
   */
  buildUniformLayout(e) {
    e.addUniform("radius", 2), e.addUniform("coneAngle", 1), e.addUniform("height", 2), e.addUniform("directionRandomizer", 1);
  }
  /**
   * Returns a string to use to update the GPU particles update shader
   * @returns a string containing the defines string
   */
  getEffectDefines() {
    let e = "#define CONEEMITTER";
    return this.emitFromSpawnPointOnly && (e += `
#define CONEEMITTERSPAWNPOINT`), e;
  }
  /**
   * Returns the string "ConeParticleEmitter"
   * @returns a string containing the class name
   */
  getClassName() {
    return "ConeParticleEmitter";
  }
  /**
   * Serializes the particle system to a JSON object.
   * @returns the JSON object
   */
  serialize() {
    const e = {};
    return e.type = this.getClassName(), e.radius = this._radius, e.angle = this._angle, e.directionRandomizer = this.directionRandomizer, e.radiusRange = this.radiusRange, e.heightRange = this.heightRange, e.emitFromSpawnPointOnly = this.emitFromSpawnPointOnly, e;
  }
  /**
   * Parse properties from a JSON object
   * @param serializationObject defines the JSON object
   */
  parse(e) {
    this.radius = e.radius, this.angle = e.angle, this.directionRandomizer = e.directionRandomizer, this.radiusRange = e.radiusRange !== void 0 ? e.radiusRange : 1, this.heightRange = e.radiusRange !== void 0 ? e.heightRange : 1, this.emitFromSpawnPointOnly = e.emitFromSpawnPointOnly !== void 0 ? e.emitFromSpawnPointOnly : !1;
  }
}
class aU {
  /**
   * Creates a new instance CylinderParticleEmitter
   * @param radius the radius of the emission cylinder (1 by default)
   * @param height the height of the emission cylinder (1 by default)
   * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
   * @param directionRandomizer defines how much to randomize the particle direction [0-1]
   */
  constructor(e = 1, t = 1, r = 1, n = 0) {
    this.radius = e, this.height = t, this.radiusRange = r, this.directionRandomizer = n, this._tempVector = S.Zero();
  }
  /**
   * Called by the particle System when the direction is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param directionToUpdate is the direction vector to update with the result
   * @param particle is the particle we are computed the direction for
   * @param isLocal defines if the direction should be set in local space
   * @param inverseWorldMatrix defines the inverted world matrix to use if isLocal is false
   */
  startDirectionFunction(e, t, r, n, i) {
    r.position.subtractToRef(e.getTranslation(), this._tempVector), this._tempVector.normalize(), S.TransformNormalToRef(this._tempVector, i, this._tempVector);
    const s = Xt.RandomRange(-this.directionRandomizer / 2, this.directionRandomizer / 2);
    let a = Math.atan2(this._tempVector.x, this._tempVector.z);
    if (a += Xt.RandomRange(-Math.PI / 2, Math.PI / 2) * this.directionRandomizer, this._tempVector.y = s, this._tempVector.x = Math.sin(a), this._tempVector.z = Math.cos(a), this._tempVector.normalize(), n) {
      t.copyFrom(this._tempVector);
      return;
    }
    S.TransformNormalFromFloatsToRef(this._tempVector.x, this._tempVector.y, this._tempVector.z, e, t);
  }
  /**
   * Called by the particle System when the position is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param positionToUpdate is the position vector to update with the result
   * @param particle is the particle we are computed the position for
   * @param isLocal defines if the position should be set in local space
   */
  startPositionFunction(e, t, r, n) {
    const i = Xt.RandomRange(-this.height / 2, this.height / 2), s = Xt.RandomRange(0, 2 * Math.PI), a = Xt.RandomRange((1 - this.radiusRange) * (1 - this.radiusRange), 1), f = Math.sqrt(a) * this.radius, o = f * Math.cos(s), d = f * Math.sin(s);
    if (n) {
      t.copyFromFloats(o, i, d);
      return;
    }
    S.TransformCoordinatesFromFloatsToRef(o, i, d, e, t);
  }
  /**
   * Clones the current emitter and returns a copy of it
   * @returns the new emitter
   */
  clone() {
    const e = new aU(this.radius, this.directionRandomizer);
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Called by the GPUParticleSystem to setup the update shader
   * @param uboOrEffect defines the update shader
   */
  applyToShader(e) {
    e.setFloat("radius", this.radius), e.setFloat("height", this.height), e.setFloat("radiusRange", this.radiusRange), e.setFloat("directionRandomizer", this.directionRandomizer);
  }
  /**
   * Creates the structure of the ubo for this particle emitter
   * @param ubo ubo to create the structure for
   */
  buildUniformLayout(e) {
    e.addUniform("radius", 1), e.addUniform("height", 1), e.addUniform("radiusRange", 1), e.addUniform("directionRandomizer", 1);
  }
  /**
   * Returns a string to use to update the GPU particles update shader
   * @returns a string containing the defines string
   */
  getEffectDefines() {
    return "#define CYLINDEREMITTER";
  }
  /**
   * Returns the string "CylinderParticleEmitter"
   * @returns a string containing the class name
   */
  getClassName() {
    return "CylinderParticleEmitter";
  }
  /**
   * Serializes the particle system to a JSON object.
   * @returns the JSON object
   */
  serialize() {
    const e = {};
    return e.type = this.getClassName(), e.radius = this.radius, e.height = this.height, e.radiusRange = this.radiusRange, e.directionRandomizer = this.directionRandomizer, e;
  }
  /**
   * Parse properties from a JSON object
   * @param serializationObject defines the JSON object
   */
  parse(e) {
    this.radius = e.radius, this.height = e.height, this.radiusRange = e.radiusRange, this.directionRandomizer = e.directionRandomizer;
  }
}
class mR extends aU {
  /**
   * Creates a new instance CylinderDirectedParticleEmitter
   * @param radius the radius of the emission cylinder (1 by default)
   * @param height the height of the emission cylinder (1 by default)
   * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
   * @param direction1 the min limit of the emission direction (up vector by default)
   * @param direction2 the max limit of the emission direction (up vector by default)
   */
  constructor(e = 1, t = 1, r = 1, n = new S(0, 1, 0), i = new S(0, 1, 0)) {
    super(e, t, r), this.direction1 = n, this.direction2 = i;
  }
  /**
   * Called by the particle System when the direction is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param directionToUpdate is the direction vector to update with the result
   */
  startDirectionFunction(e, t) {
    const r = Xt.RandomRange(this.direction1.x, this.direction2.x), n = Xt.RandomRange(this.direction1.y, this.direction2.y), i = Xt.RandomRange(this.direction1.z, this.direction2.z);
    S.TransformNormalFromFloatsToRef(r, n, i, e, t);
  }
  /**
   * Clones the current emitter and returns a copy of it
   * @returns the new emitter
   */
  clone() {
    const e = new mR(this.radius, this.height, this.radiusRange, this.direction1, this.direction2);
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Called by the GPUParticleSystem to setup the update shader
   * @param uboOrEffect defines the update shader
   */
  applyToShader(e) {
    e.setFloat("radius", this.radius), e.setFloat("height", this.height), e.setFloat("radiusRange", this.radiusRange), e.setVector3("direction1", this.direction1), e.setVector3("direction2", this.direction2);
  }
  /**
   * Creates the structure of the ubo for this particle emitter
   * @param ubo ubo to create the structure for
   */
  buildUniformLayout(e) {
    e.addUniform("radius", 1), e.addUniform("height", 1), e.addUniform("radiusRange", 1), e.addUniform("direction1", 3), e.addUniform("direction2", 3);
  }
  /**
   * Returns a string to use to update the GPU particles update shader
   * @returns a string containing the defines string
   */
  getEffectDefines() {
    return `#define CYLINDEREMITTER
#define DIRECTEDCYLINDEREMITTER`;
  }
  /**
   * Returns the string "CylinderDirectedParticleEmitter"
   * @returns a string containing the class name
   */
  getClassName() {
    return "CylinderDirectedParticleEmitter";
  }
  /**
   * Serializes the particle system to a JSON object.
   * @returns the JSON object
   */
  serialize() {
    const e = super.serialize();
    return e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e;
  }
  /**
   * Parse properties from a JSON object
   * @param serializationObject defines the JSON object
   */
  parse(e) {
    super.parse(e), this.direction1.copyFrom(e.direction1), this.direction2.copyFrom(e.direction2);
  }
}
class BR {
  /**
   * Creates a new instance HemisphericParticleEmitter
   * @param radius the radius of the emission hemisphere (1 by default)
   * @param radiusRange the range of the emission hemisphere [0-1] 0 Surface only, 1 Entire Radius (1 by default)
   * @param directionRandomizer defines how much to randomize the particle direction [0-1]
   */
  constructor(e = 1, t = 1, r = 0) {
    this.radius = e, this.radiusRange = t, this.directionRandomizer = r;
  }
  /**
   * Called by the particle System when the direction is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param directionToUpdate is the direction vector to update with the result
   * @param particle is the particle we are computed the direction for
   * @param isLocal defines if the direction should be set in local space
   */
  startDirectionFunction(e, t, r, n) {
    const i = r.position.subtract(e.getTranslation()).normalize(), s = Xt.RandomRange(0, this.directionRandomizer), a = Xt.RandomRange(0, this.directionRandomizer), f = Xt.RandomRange(0, this.directionRandomizer);
    if (i.x += s, i.y += a, i.z += f, i.normalize(), n) {
      t.copyFrom(i);
      return;
    }
    S.TransformNormalFromFloatsToRef(i.x, i.y, i.z, e, t);
  }
  /**
   * Called by the particle System when the position is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param positionToUpdate is the position vector to update with the result
   * @param particle is the particle we are computed the position for
   * @param isLocal defines if the position should be set in local space
   */
  startPositionFunction(e, t, r, n) {
    const i = this.radius - Xt.RandomRange(0, this.radius * this.radiusRange), s = Xt.RandomRange(0, 1), a = Xt.RandomRange(0, 2 * Math.PI), f = Math.acos(2 * s - 1), o = i * Math.cos(a) * Math.sin(f), d = i * Math.cos(f), v = i * Math.sin(a) * Math.sin(f);
    if (n) {
      t.copyFromFloats(o, Math.abs(d), v);
      return;
    }
    S.TransformCoordinatesFromFloatsToRef(o, Math.abs(d), v, e, t);
  }
  /**
   * Clones the current emitter and returns a copy of it
   * @returns the new emitter
   */
  clone() {
    const e = new BR(this.radius, this.directionRandomizer);
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Called by the GPUParticleSystem to setup the update shader
   * @param uboOrEffect defines the update shader
   */
  applyToShader(e) {
    e.setFloat("radius", this.radius), e.setFloat("radiusRange", this.radiusRange), e.setFloat("directionRandomizer", this.directionRandomizer);
  }
  /**
   * Creates the structure of the ubo for this particle emitter
   * @param ubo ubo to create the structure for
   */
  buildUniformLayout(e) {
    e.addUniform("radius", 1), e.addUniform("radiusRange", 1), e.addUniform("directionRandomizer", 1);
  }
  /**
   * Returns a string to use to update the GPU particles update shader
   * @returns a string containing the defines string
   */
  getEffectDefines() {
    return "#define HEMISPHERICEMITTER";
  }
  /**
   * Returns the string "HemisphericParticleEmitter"
   * @returns a string containing the class name
   */
  getClassName() {
    return "HemisphericParticleEmitter";
  }
  /**
   * Serializes the particle system to a JSON object.
   * @returns the JSON object
   */
  serialize() {
    const e = {};
    return e.type = this.getClassName(), e.radius = this.radius, e.radiusRange = this.radiusRange, e.directionRandomizer = this.directionRandomizer, e;
  }
  /**
   * Parse properties from a JSON object
   * @param serializationObject defines the JSON object
   */
  parse(e) {
    this.radius = e.radius, this.radiusRange = e.radiusRange, this.directionRandomizer = e.directionRandomizer;
  }
}
class WR {
  /**
   * Creates a new instance PointParticleEmitter
   */
  constructor() {
    this.direction1 = new S(0, 1, 0), this.direction2 = new S(0, 1, 0);
  }
  /**
   * Called by the particle System when the direction is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param directionToUpdate is the direction vector to update with the result
   * @param particle is the particle we are computed the direction for
   * @param isLocal defines if the direction should be set in local space
   */
  startDirectionFunction(e, t, r, n) {
    const i = Xt.RandomRange(this.direction1.x, this.direction2.x), s = Xt.RandomRange(this.direction1.y, this.direction2.y), a = Xt.RandomRange(this.direction1.z, this.direction2.z);
    if (n) {
      t.copyFromFloats(i, s, a);
      return;
    }
    S.TransformNormalFromFloatsToRef(i, s, a, e, t);
  }
  /**
   * Called by the particle System when the position is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param positionToUpdate is the position vector to update with the result
   * @param particle is the particle we are computed the position for
   * @param isLocal defines if the position should be set in local space
   */
  startPositionFunction(e, t, r, n) {
    if (n) {
      t.copyFromFloats(0, 0, 0);
      return;
    }
    S.TransformCoordinatesFromFloatsToRef(0, 0, 0, e, t);
  }
  /**
   * Clones the current emitter and returns a copy of it
   * @returns the new emitter
   */
  clone() {
    const e = new WR();
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Called by the GPUParticleSystem to setup the update shader
   * @param uboOrEffect defines the update shader
   */
  applyToShader(e) {
    e.setVector3("direction1", this.direction1), e.setVector3("direction2", this.direction2);
  }
  /**
   * Creates the structure of the ubo for this particle emitter
   * @param ubo ubo to create the structure for
   */
  buildUniformLayout(e) {
    e.addUniform("direction1", 3), e.addUniform("direction2", 3);
  }
  /**
   * Returns a string to use to update the GPU particles update shader
   * @returns a string containing the defines string
   */
  getEffectDefines() {
    return "#define POINTEMITTER";
  }
  /**
   * Returns the string "PointParticleEmitter"
   * @returns a string containing the class name
   */
  getClassName() {
    return "PointParticleEmitter";
  }
  /**
   * Serializes the particle system to a JSON object.
   * @returns the JSON object
   */
  serialize() {
    const e = {};
    return e.type = this.getClassName(), e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e;
  }
  /**
   * Parse properties from a JSON object
   * @param serializationObject defines the JSON object
   */
  parse(e) {
    S.FromArrayToRef(e.direction1, 0, this.direction1), S.FromArrayToRef(e.direction2, 0, this.direction2);
  }
}
class oU {
  /**
   * Creates a new instance SphereParticleEmitter
   * @param radius the radius of the emission sphere (1 by default)
   * @param radiusRange the range of the emission sphere [0-1] 0 Surface only, 1 Entire Radius (1 by default)
   * @param directionRandomizer defines how much to randomize the particle direction [0-1]
   */
  constructor(e = 1, t = 1, r = 0) {
    this.radius = e, this.radiusRange = t, this.directionRandomizer = r;
  }
  /**
   * Called by the particle System when the direction is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param directionToUpdate is the direction vector to update with the result
   * @param particle is the particle we are computed the direction for
   * @param isLocal defines if the direction should be set in local space
   */
  startDirectionFunction(e, t, r, n) {
    const i = r.position.subtract(e.getTranslation()).normalize(), s = Xt.RandomRange(0, this.directionRandomizer), a = Xt.RandomRange(0, this.directionRandomizer), f = Xt.RandomRange(0, this.directionRandomizer);
    if (i.x += s, i.y += a, i.z += f, i.normalize(), n) {
      t.copyFrom(i);
      return;
    }
    S.TransformNormalFromFloatsToRef(i.x, i.y, i.z, e, t);
  }
  /**
   * Called by the particle System when the position is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param positionToUpdate is the position vector to update with the result
   * @param particle is the particle we are computed the position for
   * @param isLocal defines if the position should be set in local space
   */
  startPositionFunction(e, t, r, n) {
    const i = this.radius - Xt.RandomRange(0, this.radius * this.radiusRange), s = Xt.RandomRange(0, 1), a = Xt.RandomRange(0, 2 * Math.PI), f = Math.acos(2 * s - 1), o = i * Math.cos(a) * Math.sin(f), d = i * Math.cos(f), v = i * Math.sin(a) * Math.sin(f);
    if (n) {
      t.copyFromFloats(o, d, v);
      return;
    }
    S.TransformCoordinatesFromFloatsToRef(o, d, v, e, t);
  }
  /**
   * Clones the current emitter and returns a copy of it
   * @returns the new emitter
   */
  clone() {
    const e = new oU(this.radius, this.directionRandomizer);
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Called by the GPUParticleSystem to setup the update shader
   * @param uboOrEffect defines the update shader
   */
  applyToShader(e) {
    e.setFloat("radius", this.radius), e.setFloat("radiusRange", this.radiusRange), e.setFloat("directionRandomizer", this.directionRandomizer);
  }
  /**
   * Creates the structure of the ubo for this particle emitter
   * @param ubo ubo to create the structure for
   */
  buildUniformLayout(e) {
    e.addUniform("radius", 1), e.addUniform("radiusRange", 1), e.addUniform("directionRandomizer", 1);
  }
  /**
   * Returns a string to use to update the GPU particles update shader
   * @returns a string containing the defines string
   */
  getEffectDefines() {
    return "#define SPHEREEMITTER";
  }
  /**
   * Returns the string "SphereParticleEmitter"
   * @returns a string containing the class name
   */
  getClassName() {
    return "SphereParticleEmitter";
  }
  /**
   * Serializes the particle system to a JSON object.
   * @returns the JSON object
   */
  serialize() {
    const e = {};
    return e.type = this.getClassName(), e.radius = this.radius, e.radiusRange = this.radiusRange, e.directionRandomizer = this.directionRandomizer, e;
  }
  /**
   * Parse properties from a JSON object
   * @param serializationObject defines the JSON object
   */
  parse(e) {
    this.radius = e.radius, this.radiusRange = e.radiusRange, this.directionRandomizer = e.directionRandomizer;
  }
}
class SR extends oU {
  /**
   * Creates a new instance SphereDirectedParticleEmitter
   * @param radius the radius of the emission sphere (1 by default)
   * @param direction1 the min limit of the emission direction (up vector by default)
   * @param direction2 the max limit of the emission direction (up vector by default)
   */
  constructor(e = 1, t = new S(0, 1, 0), r = new S(0, 1, 0)) {
    super(e), this.direction1 = t, this.direction2 = r;
  }
  /**
   * Called by the particle System when the direction is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param directionToUpdate is the direction vector to update with the result
   */
  startDirectionFunction(e, t) {
    const r = Xt.RandomRange(this.direction1.x, this.direction2.x), n = Xt.RandomRange(this.direction1.y, this.direction2.y), i = Xt.RandomRange(this.direction1.z, this.direction2.z);
    S.TransformNormalFromFloatsToRef(r, n, i, e, t);
  }
  /**
   * Clones the current emitter and returns a copy of it
   * @returns the new emitter
   */
  clone() {
    const e = new SR(this.radius, this.direction1, this.direction2);
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Called by the GPUParticleSystem to setup the update shader
   * @param uboOrEffect defines the update shader
   */
  applyToShader(e) {
    e.setFloat("radius", this.radius), e.setFloat("radiusRange", this.radiusRange), e.setVector3("direction1", this.direction1), e.setVector3("direction2", this.direction2);
  }
  /**
   * Creates the structure of the ubo for this particle emitter
   * @param ubo ubo to create the structure for
   */
  buildUniformLayout(e) {
    e.addUniform("radius", 1), e.addUniform("radiusRange", 1), e.addUniform("direction1", 3), e.addUniform("direction2", 3);
  }
  /**
   * Returns a string to use to update the GPU particles update shader
   * @returns a string containing the defines string
   */
  getEffectDefines() {
    return `#define SPHEREEMITTER
#define DIRECTEDSPHEREEMITTER`;
  }
  /**
   * Returns the string "SphereDirectedParticleEmitter"
   * @returns a string containing the class name
   */
  getClassName() {
    return "SphereDirectedParticleEmitter";
  }
  /**
   * Serializes the particle system to a JSON object.
   * @returns the JSON object
   */
  serialize() {
    const e = super.serialize();
    return e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e;
  }
  /**
   * Parse properties from a JSON object
   * @param serializationObject defines the JSON object
   */
  parse(e) {
    super.parse(e), this.direction1.copyFrom(e.direction1), this.direction2.copyFrom(e.direction2);
  }
}
class dD {
  /**
   * Creates a new instance CustomParticleEmitter
   */
  constructor() {
    this.particlePositionGenerator = () => {
    }, this.particleDestinationGenerator = () => {
    };
  }
  /**
   * Called by the particle System when the direction is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param directionToUpdate is the direction vector to update with the result
   * @param particle is the particle we are computed the direction for
   * @param isLocal defines if the direction should be set in local space
   */
  startDirectionFunction(e, t, r, n) {
    const i = ue.Vector3[0];
    if (this.particleDestinationGenerator) {
      this.particleDestinationGenerator(-1, r, i);
      const s = ue.Vector3[1];
      i.subtractToRef(r.position, s), s.scaleToRef(1 / r.lifeTime, i);
    } else
      i.set(0, 0, 0);
    if (n) {
      t.copyFrom(i);
      return;
    }
    S.TransformNormalToRef(i, e, t);
  }
  /**
   * Called by the particle System when the position is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param positionToUpdate is the position vector to update with the result
   * @param particle is the particle we are computed the position for
   * @param isLocal defines if the position should be set in local space
   */
  startPositionFunction(e, t, r, n) {
    const i = ue.Vector3[0];
    if (this.particlePositionGenerator ? this.particlePositionGenerator(-1, r, i) : i.set(0, 0, 0), n) {
      t.copyFrom(i);
      return;
    }
    S.TransformCoordinatesToRef(i, e, t);
  }
  /**
   * Clones the current emitter and returns a copy of it
   * @returns the new emitter
   */
  clone() {
    const e = new dD();
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Called by the GPUParticleSystem to setup the update shader
   * @param uboOrEffect defines the update shader
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  applyToShader(e) {
  }
  /**
   * Creates the structure of the ubo for this particle emitter
   * @param ubo ubo to create the structure for
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  buildUniformLayout(e) {
  }
  /**
   * Returns a string to use to update the GPU particles update shader
   * @returns a string containing the defines string
   */
  getEffectDefines() {
    return "#define CUSTOMEMITTER";
  }
  /**
   * Returns the string "PointParticleEmitter"
   * @returns a string containing the class name
   */
  getClassName() {
    return "CustomParticleEmitter";
  }
  /**
   * Serializes the particle system to a JSON object.
   * @returns the JSON object
   */
  serialize() {
    const e = {};
    return e.type = this.getClassName(), e;
  }
  /**
   * Parse properties from a JSON object
   * @param serializationObject defines the JSON object
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  parse(e) {
  }
}
class IO {
  /** Defines the mesh to use as source */
  get mesh() {
    return this._mesh;
  }
  set mesh(e) {
    this._mesh !== e && (this._mesh = e, e ? (this._indices = e.getIndices(), this._positions = e.getVerticesData(J.PositionKind), this._normals = e.getVerticesData(J.NormalKind)) : (this._indices = null, this._positions = null, this._normals = null));
  }
  /**
   * Creates a new instance MeshParticleEmitter
   * @param mesh defines the mesh to use as source
   */
  constructor(e = null) {
    this._indices = null, this._positions = null, this._normals = null, this._storedNormal = S.Zero(), this._mesh = null, this.direction1 = new S(0, 1, 0), this.direction2 = new S(0, 1, 0), this.useMeshNormalsForDirection = !0, this.mesh = e;
  }
  /**
   * Called by the particle System when the direction is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param directionToUpdate is the direction vector to update with the result
   * @param particle is the particle we are computed the direction for
   * @param isLocal defines if the direction should be set in local space
   */
  startDirectionFunction(e, t, r, n) {
    if (this.useMeshNormalsForDirection && this._normals) {
      S.TransformNormalToRef(this._storedNormal, e, t);
      return;
    }
    const i = Xt.RandomRange(this.direction1.x, this.direction2.x), s = Xt.RandomRange(this.direction1.y, this.direction2.y), a = Xt.RandomRange(this.direction1.z, this.direction2.z);
    if (n) {
      t.copyFromFloats(i, s, a);
      return;
    }
    S.TransformNormalFromFloatsToRef(i, s, a, e, t);
  }
  /**
   * Called by the particle System when the position is computed for the created particle.
   * @param worldMatrix is the world matrix of the particle system
   * @param positionToUpdate is the position vector to update with the result
   * @param particle is the particle we are computed the position for
   * @param isLocal defines if the position should be set in local space
   */
  startPositionFunction(e, t, r, n) {
    if (!this._indices || !this._positions)
      return;
    const i = 3 * Math.random() * (this._indices.length / 3) | 0, s = Math.random(), a = Math.random() * (1 - s), f = 1 - s - a, o = this._indices[i], d = this._indices[i + 1], v = this._indices[i + 2], u = ue.Vector3[0], l = ue.Vector3[1], P = ue.Vector3[2], p = ue.Vector3[3];
    S.FromArrayToRef(this._positions, o * 3, u), S.FromArrayToRef(this._positions, d * 3, l), S.FromArrayToRef(this._positions, v * 3, P), p.x = s * u.x + a * l.x + f * P.x, p.y = s * u.y + a * l.y + f * P.y, p.z = s * u.z + a * l.z + f * P.z, n ? t.copyFromFloats(p.x, p.y, p.z) : S.TransformCoordinatesFromFloatsToRef(p.x, p.y, p.z, e, t), this.useMeshNormalsForDirection && this._normals && (S.FromArrayToRef(this._normals, o * 3, u), S.FromArrayToRef(this._normals, d * 3, l), S.FromArrayToRef(this._normals, v * 3, P), this._storedNormal.x = s * u.x + a * l.x + f * P.x, this._storedNormal.y = s * u.y + a * l.y + f * P.y, this._storedNormal.z = s * u.z + a * l.z + f * P.z);
  }
  /**
   * Clones the current emitter and returns a copy of it
   * @returns the new emitter
   */
  clone() {
    const e = new IO(this.mesh);
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Called by the GPUParticleSystem to setup the update shader
   * @param uboOrEffect defines the update shader
   */
  applyToShader(e) {
    e.setVector3("direction1", this.direction1), e.setVector3("direction2", this.direction2);
  }
  /**
   * Creates the structure of the ubo for this particle emitter
   * @param ubo ubo to create the structure for
   */
  buildUniformLayout(e) {
    e.addUniform("direction1", 3), e.addUniform("direction2", 3);
  }
  /**
   * Returns a string to use to update the GPU particles update shader
   * @returns a string containing the defines string
   */
  getEffectDefines() {
    return "";
  }
  /**
   * Returns the string "BoxParticleEmitter"
   * @returns a string containing the class name
   */
  getClassName() {
    return "MeshParticleEmitter";
  }
  /**
   * Serializes the particle system to a JSON object.
   * @returns the JSON object
   */
  serialize() {
    var e;
    const t = {};
    return t.type = this.getClassName(), t.direction1 = this.direction1.asArray(), t.direction2 = this.direction2.asArray(), t.meshId = (e = this.mesh) === null || e === void 0 ? void 0 : e.id, t.useMeshNormalsForDirection = this.useMeshNormalsForDirection, t;
  }
  /**
   * Parse properties from a JSON object
   * @param serializationObject defines the JSON object
   * @param scene defines the hosting scene
   */
  parse(e, t) {
    S.FromArrayToRef(e.direction1, 0, this.direction1), S.FromArrayToRef(e.direction2, 0, this.direction2), e.meshId && t && (this.mesh = t.getLastMeshById(e.meshId)), this.useMeshNormalsForDirection = e.useMeshNormalsForDirection;
  }
}
class N0 {
  /**
   * Gets or sets a texture used to add random noise to particle positions
   */
  get noiseTexture() {
    return this._noiseTexture;
  }
  set noiseTexture(e) {
    this._noiseTexture !== e && (this._noiseTexture = e, this._reset());
  }
  /**
   * Gets or sets whether an animation sprite sheet is enabled or not on the particle system
   */
  get isAnimationSheetEnabled() {
    return this._isAnimationSheetEnabled;
  }
  set isAnimationSheetEnabled(e) {
    this._isAnimationSheetEnabled != e && (this._isAnimationSheetEnabled = e, this._reset());
  }
  /**
   * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.
   */
  get useLogarithmicDepth() {
    return this._useLogarithmicDepth;
  }
  set useLogarithmicDepth(e) {
    this._useLogarithmicDepth = e && this.getScene().getEngine().getCaps().fragmentDepthSupported;
  }
  /**
   * Get hosting scene
   * @returns the scene
   */
  getScene() {
    return this._scene;
  }
  _hasTargetStopDurationDependantGradient() {
    return this._startSizeGradients && this._startSizeGradients.length > 0 || this._emitRateGradients && this._emitRateGradients.length > 0 || this._lifeTimeGradients && this._lifeTimeGradients.length > 0;
  }
  /**
   * Gets the current list of drag gradients.
   * You must use addDragGradient and removeDragGradient to update this list
   * @returns the list of drag gradients
   */
  getDragGradients() {
    return this._dragGradients;
  }
  /**
   * Gets the current list of limit velocity gradients.
   * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list
   * @returns the list of limit velocity gradients
   */
  getLimitVelocityGradients() {
    return this._limitVelocityGradients;
  }
  /**
   * Gets the current list of color gradients.
   * You must use addColorGradient and removeColorGradient to update this list
   * @returns the list of color gradients
   */
  getColorGradients() {
    return this._colorGradients;
  }
  /**
   * Gets the current list of size gradients.
   * You must use addSizeGradient and removeSizeGradient to update this list
   * @returns the list of size gradients
   */
  getSizeGradients() {
    return this._sizeGradients;
  }
  /**
   * Gets the current list of color remap gradients.
   * You must use addColorRemapGradient and removeColorRemapGradient to update this list
   * @returns the list of color remap gradients
   */
  getColorRemapGradients() {
    return this._colorRemapGradients;
  }
  /**
   * Gets the current list of alpha remap gradients.
   * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list
   * @returns the list of alpha remap gradients
   */
  getAlphaRemapGradients() {
    return this._alphaRemapGradients;
  }
  /**
   * Gets the current list of life time gradients.
   * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list
   * @returns the list of life time gradients
   */
  getLifeTimeGradients() {
    return this._lifeTimeGradients;
  }
  /**
   * Gets the current list of angular speed gradients.
   * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list
   * @returns the list of angular speed gradients
   */
  getAngularSpeedGradients() {
    return this._angularSpeedGradients;
  }
  /**
   * Gets the current list of velocity gradients.
   * You must use addVelocityGradient and removeVelocityGradient to update this list
   * @returns the list of velocity gradients
   */
  getVelocityGradients() {
    return this._velocityGradients;
  }
  /**
   * Gets the current list of start size gradients.
   * You must use addStartSizeGradient and removeStartSizeGradient to update this list
   * @returns the list of start size gradients
   */
  getStartSizeGradients() {
    return this._startSizeGradients;
  }
  /**
   * Gets the current list of emit rate gradients.
   * You must use addEmitRateGradient and removeEmitRateGradient to update this list
   * @returns the list of emit rate gradients
   */
  getEmitRateGradients() {
    return this._emitRateGradients;
  }
  /**
   * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
   * This only works when particleEmitterTyps is a BoxParticleEmitter
   */
  get direction1() {
    return this.particleEmitterType.direction1 ? this.particleEmitterType.direction1 : S.Zero();
  }
  set direction1(e) {
    this.particleEmitterType.direction1 && (this.particleEmitterType.direction1 = e);
  }
  /**
   * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
   * This only works when particleEmitterTyps is a BoxParticleEmitter
   */
  get direction2() {
    return this.particleEmitterType.direction2 ? this.particleEmitterType.direction2 : S.Zero();
  }
  set direction2(e) {
    this.particleEmitterType.direction2 && (this.particleEmitterType.direction2 = e);
  }
  /**
   * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
   * This only works when particleEmitterTyps is a BoxParticleEmitter
   */
  get minEmitBox() {
    return this.particleEmitterType.minEmitBox ? this.particleEmitterType.minEmitBox : S.Zero();
  }
  set minEmitBox(e) {
    this.particleEmitterType.minEmitBox && (this.particleEmitterType.minEmitBox = e);
  }
  /**
   * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
   * This only works when particleEmitterTyps is a BoxParticleEmitter
   */
  get maxEmitBox() {
    return this.particleEmitterType.maxEmitBox ? this.particleEmitterType.maxEmitBox : S.Zero();
  }
  set maxEmitBox(e) {
    this.particleEmitterType.maxEmitBox && (this.particleEmitterType.maxEmitBox = e);
  }
  /**
   * Gets or sets the billboard mode to use when isBillboardBased = true.
   * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED
   */
  get billboardMode() {
    return this._billboardMode;
  }
  set billboardMode(e) {
    this._billboardMode !== e && (this._billboardMode = e, this._reset());
  }
  /**
   * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction
   */
  get isBillboardBased() {
    return this._isBillboardBased;
  }
  set isBillboardBased(e) {
    this._isBillboardBased !== e && (this._isBillboardBased = e, this._reset());
  }
  /**
   * Gets the image processing configuration used either in this material.
   */
  get imageProcessingConfiguration() {
    return this._imageProcessingConfiguration;
  }
  /**
   * Sets the Default image processing configuration used either in the this material.
   *
   * If sets to null, the scene one is in use.
   */
  set imageProcessingConfiguration(e) {
    this._attachImageProcessingConfiguration(e);
  }
  /**
   * Attaches a new image processing configuration to the Standard Material.
   * @param configuration
   */
  _attachImageProcessingConfiguration(e) {
    e !== this._imageProcessingConfiguration && (!e && this._scene ? this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration : this._imageProcessingConfiguration = e);
  }
  /** @internal */
  _reset() {
  }
  /**
   * @internal
   */
  _removeGradientAndTexture(e, t, r) {
    if (!t)
      return this;
    let n = 0;
    for (const i of t) {
      if (i.gradient === e) {
        t.splice(n, 1);
        break;
      }
      n++;
    }
    return r && r.dispose(), this;
  }
  /**
   * Instantiates a particle system.
   * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
   * @param name The name of the particle system
   */
  constructor(e) {
    this.animations = [], this.renderingGroupId = 0, this.emitter = S.Zero(), this.emitRate = 10, this.manualEmitCount = -1, this.updateSpeed = 0.01, this.targetStopDuration = 0, this.disposeOnStop = !1, this.minEmitPower = 1, this.maxEmitPower = 1, this.minLifeTime = 1, this.maxLifeTime = 1, this.minSize = 1, this.maxSize = 1, this.minScaleX = 1, this.maxScaleX = 1, this.minScaleY = 1, this.maxScaleY = 1, this.minInitialRotation = 0, this.maxInitialRotation = 0, this.minAngularSpeed = 0, this.maxAngularSpeed = 0, this.layerMask = 268435455, this.customShader = null, this.preventAutoStart = !1, this._wasDispatched = !1, this._rootUrl = "", this.noiseStrength = new S(10, 10, 10), this.onAnimationEnd = null, this.blendMode = N0.BLENDMODE_ONEONE, this.forceDepthWrite = !1, this.preWarmCycles = 0, this.preWarmStepOffset = 1, this.spriteCellChangeSpeed = 1, this.startSpriteCellID = 0, this.endSpriteCellID = 0, this.spriteCellWidth = 0, this.spriteCellHeight = 0, this.spriteCellLoop = !0, this.spriteRandomStartCell = !1, this.translationPivot = new at(0, 0), this.beginAnimationOnStart = !1, this.beginAnimationFrom = 0, this.beginAnimationTo = 60, this.beginAnimationLoop = !1, this.worldOffset = new S(0, 0, 0), this._useLogarithmicDepth = !1, this.gravity = S.Zero(), this._colorGradients = null, this._sizeGradients = null, this._lifeTimeGradients = null, this._angularSpeedGradients = null, this._velocityGradients = null, this._limitVelocityGradients = null, this._dragGradients = null, this._emitRateGradients = null, this._startSizeGradients = null, this._rampGradients = null, this._colorRemapGradients = null, this._alphaRemapGradients = null, this.startDelay = 0, this.limitVelocityDamping = 0.4, this.color1 = new xt(1, 1, 1, 1), this.color2 = new xt(1, 1, 1, 1), this.colorDead = new xt(0, 0, 0, 1), this.textureMask = new xt(1, 1, 1, 1), this._isSubEmitter = !1, this._billboardMode = 7, this._isBillboardBased = !0, this._imageProcessingConfigurationDefines = new M$(), this.id = e, this.name = e;
  }
  /**
   * Creates a Point Emitter for the particle system (emits directly from the emitter position)
   * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
   * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
   * @returns the emitter
   */
  createPointEmitter(e, t) {
    const r = new WR();
    return r.direction1 = e, r.direction2 = t, this.particleEmitterType = r, r;
  }
  /**
   * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)
   * @param radius The radius of the hemisphere to emit from
   * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
   * @returns the emitter
   */
  createHemisphericEmitter(e = 1, t = 1) {
    const r = new BR(e, t);
    return this.particleEmitterType = r, r;
  }
  /**
   * Creates a Sphere Emitter for the particle system (emits along the sphere radius)
   * @param radius The radius of the sphere to emit from
   * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
   * @returns the emitter
   */
  createSphereEmitter(e = 1, t = 1) {
    const r = new oU(e, t);
    return this.particleEmitterType = r, r;
  }
  /**
   * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)
   * @param radius The radius of the sphere to emit from
   * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere
   * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere
   * @returns the emitter
   */
  createDirectedSphereEmitter(e = 1, t = new S(0, 1, 0), r = new S(0, 1, 0)) {
    const n = new SR(e, t, r);
    return this.particleEmitterType = n, n;
  }
  /**
   * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)
   * @param radius The radius of the emission cylinder
   * @param height The height of the emission cylinder
   * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius
   * @param directionRandomizer How much to randomize the particle direction [0-1]
   * @returns the emitter
   */
  createCylinderEmitter(e = 1, t = 1, r = 1, n = 0) {
    const i = new aU(e, t, r, n);
    return this.particleEmitterType = i, i;
  }
  /**
   * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)
   * @param radius The radius of the cylinder to emit from
   * @param height The height of the emission cylinder
   * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
   * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder
   * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder
   * @returns the emitter
   */
  createDirectedCylinderEmitter(e = 1, t = 1, r = 1, n = new S(0, 1, 0), i = new S(0, 1, 0)) {
    const s = new mR(e, t, r, n, i);
    return this.particleEmitterType = s, s;
  }
  /**
   * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)
   * @param radius The radius of the cone to emit from
   * @param angle The base angle of the cone
   * @returns the emitter
   */
  createConeEmitter(e = 1, t = Math.PI / 4) {
    const r = new wR(e, t);
    return this.particleEmitterType = r, r;
  }
  /**
   * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)
   * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
   * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
   * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox
   * @param maxEmitBox  Particles are emitted from the box between minEmitBox and maxEmitBox
   * @returns the emitter
   */
  createBoxEmitter(e, t, r, n) {
    const i = new AD();
    return this.particleEmitterType = i, this.direction1 = e, this.direction2 = t, this.minEmitBox = r, this.maxEmitBox = n, i;
  }
}
N0.BLENDMODE_ONEONE = 0;
N0.BLENDMODE_STANDARD = 1;
N0.BLENDMODE_ADD = 2;
N0.BLENDMODE_MULTIPLY = 3;
N0.BLENDMODE_MULTIPLYADD = 4;
class vQ extends Mr {
  /**
   * Create a new ColorSplitterBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("rgba", de.Color4, !0), this.registerInput("rgb ", de.Color3, !0), this.registerOutput("rgb", de.Color3), this.registerOutput("r", de.Float), this.registerOutput("g", de.Float), this.registerOutput("b", de.Float), this.registerOutput("a", de.Float), this.inputsAreExclusive = !0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ColorSplitterBlock";
  }
  /**
   * Gets the rgba component (input)
   */
  get rgba() {
    return this._inputs[0];
  }
  /**
   * Gets the rgb component (input)
   */
  get rgbIn() {
    return this._inputs[1];
  }
  /**
   * Gets the rgb component (output)
   */
  get rgbOut() {
    return this._outputs[0];
  }
  /**
   * Gets the r component (output)
   */
  get r() {
    return this._outputs[1];
  }
  /**
   * Gets the g component (output)
   */
  get g() {
    return this._outputs[2];
  }
  /**
   * Gets the b component (output)
   */
  get b() {
    return this._outputs[3];
  }
  /**
   * Gets the a component (output)
   */
  get a() {
    return this._outputs[4];
  }
  _inputRename(e) {
    return e === "rgb " ? "rgbIn" : e;
  }
  _outputRename(e) {
    return e === "rgb" ? "rgbOut" : e;
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.rgba.isConnected ? this.rgba : this.rgbIn;
    if (!t.isConnected)
      return;
    const r = this._outputs[0], n = this._outputs[1], i = this._outputs[2], s = this._outputs[3], a = this._outputs[4];
    return r.hasEndpoints && (e.compilationString += this._declareOutput(r, e) + ` = ${t.associatedVariableName}.rgb;
`), n.hasEndpoints && (e.compilationString += this._declareOutput(n, e) + ` = ${t.associatedVariableName}.r;
`), i.hasEndpoints && (e.compilationString += this._declareOutput(i, e) + ` = ${t.associatedVariableName}.g;
`), s.hasEndpoints && (e.compilationString += this._declareOutput(s, e) + ` = ${t.associatedVariableName}.b;
`), a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + ` = ${t.associatedVariableName}.a;
`), this;
  }
}
Ue("BABYLON.ColorSplitterBlock", vQ);
hr.prototype.createRenderTargetCubeTexture = function(A, e) {
  const t = this._createHardwareRenderTargetWrapper(!1, !0, A), r = Object.assign({ generateMipMaps: !0, generateDepthBuffer: !0, generateStencilBuffer: !1, type: 0, samplingMode: 3, format: 5 }, e);
  r.generateStencilBuffer = r.generateDepthBuffer && r.generateStencilBuffer, (r.type === 1 && !this._caps.textureFloatLinearFiltering || r.type === 2 && !this._caps.textureHalfFloatLinearFiltering) && (r.samplingMode = 1);
  const n = this._gl, i = new As(this, ri.RenderTarget);
  this._bindTextureDirectly(n.TEXTURE_CUBE_MAP, i, !0);
  const s = this._getSamplingParameters(r.samplingMode, r.generateMipMaps);
  r.type === 1 && !this._caps.textureFloat && (r.type = 0, Se.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, s.mag), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, s.min), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE);
  for (let f = 0; f < 6; f++)
    n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + f, 0, this._getRGBABufferInternalSizedFormat(r.type, r.format), A, A, 0, this._getInternalFormat(r.format), this._getWebGLTextureType(r.type), null);
  const a = n.createFramebuffer();
  return this._bindUnboundFramebuffer(a), t._depthStencilBuffer = this._setupFramebufferDepthAttachments(r.generateStencilBuffer, r.generateDepthBuffer, A, A), r.generateMipMaps && n.generateMipmap(n.TEXTURE_CUBE_MAP), this._bindTextureDirectly(n.TEXTURE_CUBE_MAP, null), this._bindUnboundFramebuffer(null), t._framebuffer = a, t._generateDepthBuffer = r.generateDepthBuffer, t._generateStencilBuffer = r.generateStencilBuffer, i.width = A, i.height = A, i.isReady = !0, i.isCube = !0, i.samples = 1, i.generateMipMaps = r.generateMipMaps, i.samplingMode = r.samplingMode, i.type = r.type, i.format = r.format, this._internalTexturesCache.push(i), t.setTextures(i), t;
};
const gE = {
  positions: [1, 1, -1, 1, -1, -1, 1, -1],
  indices: [0, 1, 2, 0, 2, 3]
};
class fU {
  /**
   * Creates an effect renderer
   * @param engine the engine to use for rendering
   * @param options defines the options of the effect renderer
   */
  constructor(e, t = gE) {
    var r, n;
    this._fullscreenViewport = new WA(0, 0, 1, 1);
    const i = (r = t.positions) !== null && r !== void 0 ? r : gE.positions, s = (n = t.indices) !== null && n !== void 0 ? n : gE.indices;
    this.engine = e, this._vertexBuffers = {
      [J.PositionKind]: new J(e, i, J.PositionKind, !1, !1, 2)
    }, this._indexBuffer = e.createIndexBuffer(s), this._onContextRestoredObserver = e.onContextRestoredObservable.add(() => {
      this._indexBuffer = e.createIndexBuffer(s);
      for (const a in this._vertexBuffers)
        this._vertexBuffers[a]._rebuild();
    });
  }
  /**
   * Sets the current viewport in normalized coordinates 0-1
   * @param viewport Defines the viewport to set (defaults to 0 0 1 1)
   */
  setViewport(e = this._fullscreenViewport) {
    this.engine.setViewport(e);
  }
  /**
   * Binds the embedded attributes buffer to the effect.
   * @param effect Defines the effect to bind the attributes for
   */
  bindBuffers(e) {
    this.engine.bindBuffers(this._vertexBuffers, this._indexBuffer, e);
  }
  /**
   * Sets the current effect wrapper to use during draw.
   * The effect needs to be ready before calling this api.
   * This also sets the default full screen position attribute.
   * @param effectWrapper Defines the effect to draw with
   */
  applyEffectWrapper(e) {
    this.engine.setState(!0), this.engine.depthCullingState.depthTest = !1, this.engine.stencilState.stencilTest = !1, this.engine.enableEffect(e._drawWrapper), this.bindBuffers(e.effect), e.onApplyObservable.notifyObservers({});
  }
  /**
   * Saves engine states
   */
  saveStates() {
    this._savedStateDepthTest = this.engine.depthCullingState.depthTest, this._savedStateStencilTest = this.engine.stencilState.stencilTest;
  }
  /**
   * Restores engine states
   */
  restoreStates() {
    this.engine.depthCullingState.depthTest = this._savedStateDepthTest, this.engine.stencilState.stencilTest = this._savedStateStencilTest;
  }
  /**
   * Draws a full screen quad.
   */
  draw() {
    this.engine.drawElementsType(0, 0, 6);
  }
  _isRenderTargetTexture(e) {
    return e.renderTarget !== void 0;
  }
  /**
   * renders one or more effects to a specified texture
   * @param effectWrapper the effect to renderer
   * @param outputTexture texture to draw to, if null it will render to the screen.
   */
  render(e, t = null) {
    if (!e.effect.isReady())
      return;
    this.saveStates(), this.setViewport();
    const r = t === null ? null : this._isRenderTargetTexture(t) ? t.renderTarget : t;
    r && this.engine.bindFramebuffer(r), this.applyEffectWrapper(e), this.draw(), r && this.engine.unBindFramebuffer(r), this.restoreStates();
  }
  /**
   * Disposes of the effect renderer
   */
  dispose() {
    const e = this._vertexBuffers[J.PositionKind];
    e && (e.dispose(), delete this._vertexBuffers[J.PositionKind]), this._indexBuffer && this.engine._releaseBuffer(this._indexBuffer), this._onContextRestoredObserver && (this.engine.onContextRestoredObservable.remove(this._onContextRestoredObserver), this._onContextRestoredObserver = null);
  }
}
class ng {
  /**
   * The underlying effect
   */
  get effect() {
    return this._drawWrapper.effect;
  }
  set effect(e) {
    this._drawWrapper.effect = e;
  }
  /**
   * Creates an effect to be renderer
   * @param creationOptions options to create the effect
   */
  constructor(e) {
    this.onApplyObservable = new Oe();
    let t;
    const r = e.uniformNames || [];
    e.vertexShader ? t = {
      fragmentSource: e.fragmentShader,
      vertexSource: e.vertexShader,
      spectorName: e.name || "effectWrapper"
    } : (r.push("scale"), t = {
      fragmentSource: e.fragmentShader,
      vertex: "postprocess",
      spectorName: e.name || "effectWrapper"
    }, this.onApplyObservable.add(() => {
      this.effect.setFloat2("scale", 1, 1);
    }));
    const n = e.defines ? e.defines.join(`
`) : "";
    this._drawWrapper = new zo(e.engine), e.useShaderStore ? (t.fragment = t.fragmentSource, t.vertex || (t.vertex = t.vertexSource), delete t.fragmentSource, delete t.vertexSource, this.effect = e.engine.createEffect(t, e.attributeNames || ["position"], r, e.samplerNames, n, void 0, e.onCompiled, void 0, void 0, e.shaderLanguage)) : (this.effect = new An(t, e.attributeNames || ["position"], r, e.samplerNames, e.engine, n, void 0, e.onCompiled, void 0, void 0, void 0, e.shaderLanguage), this._onContextRestoredObserver = e.engine.onContextRestoredObservable.add(() => {
      this.effect._pipelineContext = null, this.effect._wasPreviouslyReady = !1, this.effect._prepareEffect();
    }));
  }
  /**
   * Disposes of the effect wrapper
   */
  dispose() {
    this._onContextRestoredObserver && (this.effect.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver), this._onContextRestoredObserver = null), this.effect.dispose();
  }
}
const gee = "passPixelShader", Xee = `varying vec2 vUV;uniform sampler2D textureSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{gl_FragColor=texture2D(textureSampler,vUV);}`;
Le.ShadersStore[gee] = Xee;
const cG = { name: gee, shader: Xee };
class eA {
  static _CreateDumpRenderer() {
    if (!eA._DumpToolsEngine) {
      let e, t = null;
      const r = {
        preserveDrawingBuffer: !0,
        depth: !1,
        stencil: !1,
        alpha: !0,
        premultipliedAlpha: !1,
        antialias: !1,
        failIfMajorPerformanceCaveat: !1
      };
      try {
        e = new OffscreenCanvas(100, 100), t = new hr(e, !1, r);
      } catch {
        e = document.createElement("canvas"), t = new hr(e, !1, r);
      }
      t.getCaps().parallelShaderCompile = void 0;
      const n = new fU(t), i = new ng({
        engine: t,
        name: cG.name,
        fragmentShader: cG.shader,
        samplerNames: ["textureSampler"]
      });
      eA._DumpToolsEngine = {
        canvas: e,
        engine: t,
        renderer: n,
        wrapper: i
      };
    }
    return eA._DumpToolsEngine;
  }
  /**
   * Dumps the current bound framebuffer
   * @param width defines the rendering width
   * @param height defines the rendering height
   * @param engine defines the hosting engine
   * @param successCallback defines the callback triggered once the data are available
   * @param mimeType defines the mime type of the result
   * @param fileName defines the filename to download. If present, the result will automatically be downloaded
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   * @returns a void promise
   */
  static async DumpFramebuffer(e, t, r, n, i = "image/png", s, a) {
    const f = await r.readPixels(0, 0, e, t), o = new Uint8Array(f.buffer);
    eA.DumpData(e, t, o, n, i, s, !0, void 0, a);
  }
  /**
   * Dumps an array buffer
   * @param width defines the rendering width
   * @param height defines the rendering height
   * @param data the data array
   * @param mimeType defines the mime type of the result
   * @param fileName defines the filename to download. If present, the result will automatically be downloaded
   * @param invertY true to invert the picture in the Y dimension
   * @param toArrayBuffer true to convert the data to an ArrayBuffer (encoded as `mimeType`) instead of a base64 string
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   * @returns a promise that resolve to the final data
   */
  static DumpDataAsync(e, t, r, n = "image/png", i, s = !1, a = !1, f) {
    return new Promise((o) => {
      eA.DumpData(e, t, r, (d) => o(d), n, i, s, a, f);
    });
  }
  /**
   * Dumps an array buffer
   * @param width defines the rendering width
   * @param height defines the rendering height
   * @param data the data array
   * @param successCallback defines the callback triggered once the data are available
   * @param mimeType defines the mime type of the result
   * @param fileName defines the filename to download. If present, the result will automatically be downloaded
   * @param invertY true to invert the picture in the Y dimension
   * @param toArrayBuffer true to convert the data to an ArrayBuffer (encoded as `mimeType`) instead of a base64 string
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   */
  static DumpData(e, t, r, n, i = "image/png", s, a = !1, f = !1, o) {
    const d = eA._CreateDumpRenderer();
    if (d.engine.setSize(e, t, !0), r instanceof Float32Array) {
      const u = new Uint8Array(r.length);
      let l = r.length;
      for (; l--; ) {
        const P = r[l];
        u[l] = Math.round(Xt.Clamp(P) * 255);
      }
      r = u;
    }
    const v = d.engine.createRawTexture(r, e, t, 5, !1, !a, 1);
    d.renderer.setViewport(), d.renderer.applyEffectWrapper(d.wrapper), d.wrapper.effect._bindTexture("textureSampler", v), d.renderer.draw(), f ? ye.ToBlob(d.canvas, (u) => {
      const l = new FileReader();
      l.onload = (P) => {
        const p = P.target.result;
        n && n(p);
      }, l.readAsArrayBuffer(u);
    }, i, o) : ye.EncodeScreenshotCanvasData(d.canvas, n, i, s, o), v.dispose();
  }
  /**
   * Dispose the dump tools associated resources
   */
  static Dispose() {
    eA._DumpToolsEngine && (eA._DumpToolsEngine.wrapper.dispose(), eA._DumpToolsEngine.renderer.dispose(), eA._DumpToolsEngine.engine.dispose()), eA._DumpToolsEngine = null;
  }
}
const V6e = () => {
  ye.DumpData = eA.DumpData, ye.DumpDataAsync = eA.DumpDataAsync, ye.DumpFramebuffer = eA.DumpFramebuffer;
};
V6e();
class Ta extends We {
  /**
   * Use this list to define the list of mesh you want to render.
   */
  get renderList() {
    return this._renderList;
  }
  set renderList(e) {
    this._unObserveRenderList && (this._unObserveRenderList(), this._unObserveRenderList = null), e && (this._unObserveRenderList = p$(e, this._renderListHasChanged)), this._renderList = e;
  }
  /**
   * Post-processes for this render target
   */
  get postProcesses() {
    return this._postProcesses;
  }
  get _prePassEnabled() {
    return !!this._prePassRenderTarget && this._prePassRenderTarget.enabled;
  }
  /**
   * Set a after unbind callback in the texture.
   * This has been kept for backward compatibility and use of onAfterUnbindObservable is recommended.
   */
  set onAfterUnbind(e) {
    this._onAfterUnbindObserver && this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver), this._onAfterUnbindObserver = this.onAfterUnbindObservable.add(e);
  }
  /**
   * Set a before render callback in the texture.
   * This has been kept for backward compatibility and use of onBeforeRenderObservable is recommended.
   */
  set onBeforeRender(e) {
    this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e);
  }
  /**
   * Set a after render callback in the texture.
   * This has been kept for backward compatibility and use of onAfterRenderObservable is recommended.
   */
  set onAfterRender(e) {
    this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(e);
  }
  /**
   * Set a clear callback in the texture.
   * This has been kept for backward compatibility and use of onClearObservable is recommended.
   */
  set onClear(e) {
    this._onClearObserver && this.onClearObservable.remove(this._onClearObserver), this._onClearObserver = this.onClearObservable.add(e);
  }
  /**
   * Gets the render pass ids used by the render target texture. For a single render target the array length will be 1, for a cube texture it will be 6 and for
   * a 2D texture array it will return an array of ids the size of the 2D texture array
   */
  get renderPassIds() {
    return this._renderPassIds;
  }
  /**
   * Gets the current value of the refreshId counter
   */
  get currentRefreshId() {
    return this._currentRefreshId;
  }
  /**
   * Sets a specific material to be used to render a mesh/a list of meshes in this render target texture
   * @param mesh mesh or array of meshes
   * @param material material or array of materials to use for this render pass. If undefined is passed, no specific material will be used but the regular material instead (mesh.material). It's possible to provide an array of materials to use a different material for each rendering in the case of a cube texture (6 rendering) and a 2D texture array (as many rendering as the length of the array)
   */
  setMaterialForRendering(e, t) {
    let r;
    Array.isArray(e) ? r = e : r = [e];
    for (let n = 0; n < r.length; ++n)
      for (let i = 0; i < this._renderPassIds.length; ++i)
        r[n].setMaterialForRenderPass(this._renderPassIds[i], t !== void 0 ? Array.isArray(t) ? t[i] : t : void 0);
  }
  /**
   * Define if the texture has multiple draw buffers or if false a single draw buffer.
   */
  get isMulti() {
    var e, t;
    return (t = (e = this._renderTarget) === null || e === void 0 ? void 0 : e.isMulti) !== null && t !== void 0 ? t : !1;
  }
  /**
   * Gets render target creation options that were used.
   */
  get renderTargetOptions() {
    return this._renderTargetOptions;
  }
  /**
   * Gets the render target wrapper associated with this render target
   */
  get renderTarget() {
    return this._renderTarget;
  }
  _onRatioRescale() {
    this._sizeRatio && this.resize(this._initialSizeParameter);
  }
  /**
   * Gets or sets the size of the bounding box associated with the texture (when in cube mode)
   * When defined, the cubemap will switch to local mode
   * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity
   * @example https://www.babylonjs-playground.com/#RNASML
   */
  set boundingBoxSize(e) {
    if (this._boundingBoxSize && this._boundingBoxSize.equals(e))
      return;
    this._boundingBoxSize = e;
    const t = this.getScene();
    t && t.markAllMaterialsAsDirty(1);
  }
  get boundingBoxSize() {
    return this._boundingBoxSize;
  }
  /**
   * In case the RTT has been created with a depth texture, get the associated
   * depth texture.
   * Otherwise, return null.
   */
  get depthStencilTexture() {
    var e, t;
    return (t = (e = this._renderTarget) === null || e === void 0 ? void 0 : e._depthStencilTexture) !== null && t !== void 0 ? t : null;
  }
  /** @internal */
  constructor(e, t, r, n = !1, i = !0, s = 0, a = !1, f = We.TRILINEAR_SAMPLINGMODE, o = !0, d = !1, v = !1, u = 5, l = !1, P, p, c = !1, H = !1) {
    var T, q, b, j, w, m, I;
    let N, k = !0;
    if (typeof n == "object") {
      const y = n;
      n = !!y.generateMipMaps, i = (T = y.doNotChangeAspectRatio) !== null && T !== void 0 ? T : !0, s = (q = y.type) !== null && q !== void 0 ? q : 0, a = !!y.isCube, f = (b = y.samplingMode) !== null && b !== void 0 ? b : We.TRILINEAR_SAMPLINGMODE, o = (j = y.generateDepthBuffer) !== null && j !== void 0 ? j : !0, d = !!y.generateStencilBuffer, v = !!y.isMulti, u = (w = y.format) !== null && w !== void 0 ? w : 5, l = !!y.delayAllocation, P = y.samples, p = y.creationFlags, c = !!y.noColorAttachment, H = !!y.useSRGBBuffer, N = y.colorAttachment, k = (m = y.gammaSpace) !== null && m !== void 0 ? m : k;
    }
    if (super(null, r, !n, void 0, f, void 0, void 0, void 0, void 0, u), this._unObserveRenderList = null, this._renderListHasChanged = (y, O) => {
      var Y;
      const ee = this._renderList ? this._renderList.length : 0;
      (O === 0 && ee > 0 || ee === 0) && ((Y = this.getScene()) === null || Y === void 0 || Y.meshes.forEach((Z) => {
        Z._markSubMeshesAsLightDirty();
      }));
    }, this.renderParticles = !0, this.renderSprites = !1, this.forceLayerMaskCheck = !1, this.ignoreCameraViewport = !1, this.onBeforeBindObservable = new Oe(), this.onAfterUnbindObservable = new Oe(), this.onBeforeRenderObservable = new Oe(), this.onAfterRenderObservable = new Oe(), this.onClearObservable = new Oe(), this.onResizeObservable = new Oe(), this._cleared = !1, this.skipInitialClear = !1, this._currentRefreshId = -1, this._refreshRate = 1, this._samples = 1, this._canRescale = !0, this._renderTarget = null, this.boundingBoxPosition = S.Zero(), r = this.getScene(), !r)
      return;
    const R = this.getScene().getEngine();
    this._gammaSpace = k, this._coordinatesMode = We.PROJECTION_MODE, this.renderList = [], this.name = e, this.isRenderTarget = !0, this._initialSizeParameter = t, this._renderPassIds = [], this._isCubeData = a, this._processSizeParameter(t), this.renderPassId = this._renderPassIds[0], this._resizeObserver = R.onResizeObservable.add(() => {
    }), this._generateMipMaps = !!n, this._doNotChangeAspectRatio = i, this._renderingManager = new $6(r), this._renderingManager._useSceneAutoClearSetup = !0, !v && (this._renderTargetOptions = {
      generateMipMaps: n,
      type: s,
      format: (I = this._format) !== null && I !== void 0 ? I : void 0,
      samplingMode: this.samplingMode,
      generateDepthBuffer: o,
      generateStencilBuffer: d,
      samples: P,
      creationFlags: p,
      noColorAttachment: c,
      useSRGBBuffer: H,
      colorAttachment: N,
      label: this.name
    }, this.samplingMode === We.NEAREST_SAMPLINGMODE && (this.wrapU = We.CLAMP_ADDRESSMODE, this.wrapV = We.CLAMP_ADDRESSMODE), l || (a ? (this._renderTarget = r.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions), this.coordinatesMode = We.INVCUBIC_MODE, this._textureMatrix = he.Identity()) : this._renderTarget = r.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions), this._texture = this._renderTarget.texture, P !== void 0 && (this.samples = P)));
  }
  /**
   * Creates a depth stencil texture.
   * This is only available in WebGL 2 or with the depth texture extension available.
   * @param comparisonFunction Specifies the comparison function to set on the texture. If 0 or undefined, the texture is not in comparison mode (default: 0)
   * @param bilinearFiltering Specifies whether or not bilinear filtering is enable on the texture (default: true)
   * @param generateStencil Specifies whether or not a stencil should be allocated in the texture (default: false)
   * @param samples sample count of the depth/stencil texture (default: 1)
   * @param format format of the depth texture (default: 14)
   */
  createDepthStencilTexture(e = 0, t = !0, r = !1, n = 1, i = 14) {
    var s;
    (s = this._renderTarget) === null || s === void 0 || s.createDepthStencilTexture(e, t, r, n, i);
  }
  _releaseRenderPassId() {
    if (this._scene) {
      const e = this._scene.getEngine();
      for (let t = 0; t < this._renderPassIds.length; ++t)
        e.releaseRenderPassId(this._renderPassIds[t]);
    }
    this._renderPassIds = [];
  }
  _createRenderPassId() {
    this._releaseRenderPassId();
    const e = this._scene.getEngine(), t = this._isCubeData ? 6 : this.getRenderLayers() || 1;
    for (let r = 0; r < t; ++r)
      this._renderPassIds[r] = e.createRenderPassId(`RenderTargetTexture - ${this.name}#${r}`);
  }
  _processSizeParameter(e, t = !0) {
    if (e.ratio) {
      this._sizeRatio = e.ratio;
      const r = this._getEngine();
      this._size = {
        width: this._bestReflectionRenderTargetDimension(r.getRenderWidth(), this._sizeRatio),
        height: this._bestReflectionRenderTargetDimension(r.getRenderHeight(), this._sizeRatio)
      };
    } else
      this._size = e;
    t && this._createRenderPassId();
  }
  /**
   * Define the number of samples to use in case of MSAA.
   * It defaults to one meaning no MSAA has been enabled.
   */
  get samples() {
    var e, t;
    return (t = (e = this._renderTarget) === null || e === void 0 ? void 0 : e.samples) !== null && t !== void 0 ? t : this._samples;
  }
  set samples(e) {
    this._renderTarget && (this._samples = this._renderTarget.setSamples(e));
  }
  /**
   * Resets the refresh counter of the texture and start bak from scratch.
   * Could be useful to regenerate the texture if it is setup to render only once.
   */
  resetRefreshCounter() {
    this._currentRefreshId = -1;
  }
  /**
   * Define the refresh rate of the texture or the rendering frequency.
   * Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...
   */
  get refreshRate() {
    return this._refreshRate;
  }
  set refreshRate(e) {
    this._refreshRate = e, this.resetRefreshCounter();
  }
  /**
   * Adds a post process to the render target rendering passes.
   * @param postProcess define the post process to add
   */
  addPostProcess(e) {
    if (!this._postProcessManager) {
      const t = this.getScene();
      if (!t)
        return;
      this._postProcessManager = new yI(t), this._postProcesses = new Array();
    }
    this._postProcesses.push(e), this._postProcesses[0].autoClear = !1;
  }
  /**
   * Clear all the post processes attached to the render target
   * @param dispose define if the cleared post processes should also be disposed (false by default)
   */
  clearPostProcesses(e = !1) {
    if (this._postProcesses) {
      if (e)
        for (const t of this._postProcesses)
          t.dispose();
      this._postProcesses = [];
    }
  }
  /**
   * Remove one of the post process from the list of attached post processes to the texture
   * @param postProcess define the post process to remove from the list
   */
  removePostProcess(e) {
    if (!this._postProcesses)
      return;
    const t = this._postProcesses.indexOf(e);
    t !== -1 && (this._postProcesses.splice(t, 1), this._postProcesses.length > 0 && (this._postProcesses[0].autoClear = !1));
  }
  /** @internal */
  _shouldRender() {
    return this._currentRefreshId === -1 ? (this._currentRefreshId = 1, !0) : this.refreshRate === this._currentRefreshId ? (this._currentRefreshId = 1, !0) : (this._currentRefreshId++, !1);
  }
  /**
   * Gets the actual render size of the texture.
   * @returns the width of the render size
   */
  getRenderSize() {
    return this.getRenderWidth();
  }
  /**
   * Gets the actual render width of the texture.
   * @returns the width of the render size
   */
  getRenderWidth() {
    return this._size.width ? this._size.width : this._size;
  }
  /**
   * Gets the actual render height of the texture.
   * @returns the height of the render size
   */
  getRenderHeight() {
    return this._size.width ? this._size.height : this._size;
  }
  /**
   * Gets the actual number of layers of the texture.
   * @returns the number of layers
   */
  getRenderLayers() {
    const e = this._size.layers;
    return e || 0;
  }
  /**
   * Don't allow this render target texture to rescale. Mainly used to prevent rescaling by the scene optimizer.
   */
  disableRescaling() {
    this._canRescale = !1;
  }
  /**
   * Get if the texture can be rescaled or not.
   */
  get canRescale() {
    return this._canRescale;
  }
  /**
   * Resize the texture using a ratio.
   * @param ratio the ratio to apply to the texture size in order to compute the new target size
   */
  scale(e) {
    const t = Math.max(1, this.getRenderSize() * e);
    this.resize(t);
  }
  /**
   * Get the texture reflection matrix used to rotate/transform the reflection.
   * @returns the reflection matrix
   */
  getReflectionTextureMatrix() {
    return this.isCube ? this._textureMatrix : super.getReflectionTextureMatrix();
  }
  /**
   * Resize the texture to a new desired size.
   * Be careful as it will recreate all the data in the new texture.
   * @param size Define the new size. It can be:
   *   - a number for squared texture,
   *   - an object containing { width: number, height: number }
   *   - or an object containing a ratio { ratio: number }
   */
  resize(e) {
    var t;
    const r = this.isCube;
    (t = this._renderTarget) === null || t === void 0 || t.dispose(), this._renderTarget = null;
    const n = this.getScene();
    n && (this._processSizeParameter(e, !1), r ? this._renderTarget = n.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions) : this._renderTarget = n.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions), this._texture = this._renderTarget.texture, this._renderTargetOptions.samples !== void 0 && (this.samples = this._renderTargetOptions.samples), this.onResizeObservable.hasObservers() && this.onResizeObservable.notifyObservers(this));
  }
  /**
   * Renders all the objects from the render list into the texture.
   * @param useCameraPostProcess Define if camera post processes should be used during the rendering
   * @param dumpForDebug Define if the rendering result should be dumped (copied) for debugging purpose
   */
  render(e = !1, t = !1) {
    this._render(e, t);
  }
  /**
   * This function will check if the render target texture can be rendered (textures are loaded, shaders are compiled)
   * @returns true if all required resources are ready
   */
  isReadyForRendering() {
    return this._render(!1, !1, !0);
  }
  _render(e = !1, t = !1, r = !1) {
    var n;
    const i = this.getScene();
    if (!i)
      return r;
    const s = i.getEngine();
    if (this.useCameraPostProcesses !== void 0 && (e = this.useCameraPostProcesses), this._waitingRenderList) {
      this.renderList = [];
      for (let v = 0; v < this._waitingRenderList.length; v++) {
        const u = this._waitingRenderList[v], l = i.getMeshById(u);
        l && this.renderList.push(l);
      }
      this._waitingRenderList = void 0;
    }
    if (this.renderListPredicate) {
      this.renderList ? this.renderList.length = 0 : this.renderList = [];
      const v = this.getScene();
      if (!v)
        return r;
      const u = v.meshes;
      for (let l = 0; l < u.length; l++) {
        const P = u[l];
        this.renderListPredicate(P) && this.renderList.push(P);
      }
    }
    const a = s.currentRenderPassId;
    this.onBeforeBindObservable.notifyObservers(this);
    const f = (n = this.activeCamera) !== null && n !== void 0 ? n : i.activeCamera, o = i.activeCamera;
    f && (f !== i.activeCamera && (i.setTransformMatrix(f.getViewMatrix(), f.getProjectionMatrix(!0)), i.activeCamera = f), s.setViewport(f.rigParent ? f.rigParent.viewport : f.viewport, this.getRenderWidth(), this.getRenderHeight())), this._defaultRenderListPrepared = !1;
    let d = r;
    if (r) {
      i.getViewMatrix() || i.updateTransformMatrix();
      const v = this.is2DArray ? this.getRenderLayers() : this.isCube ? 6 : 1;
      for (let u = 0; u < v && d; u++) {
        let l = null;
        const P = this.renderList ? this.renderList : i.getActiveMeshes().data, p = this.renderList ? this.renderList.length : i.getActiveMeshes().length;
        s.currentRenderPassId = this._renderPassIds[u], this.onBeforeRenderObservable.notifyObservers(u), this.getCustomRenderList && (l = this.getCustomRenderList(u, P, p)), l || (l = P), this._doNotChangeAspectRatio || i.updateTransformMatrix(!0);
        for (let c = 0; c < l.length && d; ++c) {
          const H = l[c];
          if (!(!H.isEnabled() || H.isBlocked || !H.isVisible || !H.subMeshes)) {
            if (this.customIsReadyFunction) {
              if (!this.customIsReadyFunction(H, this.refreshRate, r)) {
                d = !1;
                continue;
              }
            } else if (!H.isReady(!0)) {
              d = !1;
              continue;
            }
          }
        }
        this.onAfterRenderObservable.notifyObservers(u), (this.is2DArray || this.isCube) && (i.incrementRenderId(), i.resetCachedMaterial());
      }
    } else if (this.is2DArray && !this.isMulti)
      for (let v = 0; v < this.getRenderLayers(); v++)
        this._renderToTarget(0, e, t, v, f), i.incrementRenderId(), i.resetCachedMaterial();
    else if (this.isCube && !this.isMulti)
      for (let v = 0; v < 6; v++)
        this._renderToTarget(v, e, t, void 0, f), i.incrementRenderId(), i.resetCachedMaterial();
    else
      this._renderToTarget(0, e, t, void 0, f);
    return this.onAfterUnbindObservable.notifyObservers(this), s.currentRenderPassId = a, o && (i.activeCamera = o, (i.getEngine().scenes.length > 1 || this.activeCamera && this.activeCamera !== i.activeCamera) && i.setTransformMatrix(i.activeCamera.getViewMatrix(), i.activeCamera.getProjectionMatrix(!0)), s.setViewport(i.activeCamera.viewport)), i.resetCachedMaterial(), d;
  }
  _bestReflectionRenderTargetDimension(e, t) {
    const n = e * t, i = Ge.NearestPOT(n + 128 * 128 / (128 + n));
    return Math.min(Ge.FloorPOT(e), i);
  }
  _prepareRenderingManager(e, t, r, n) {
    const i = this.getScene();
    if (!i)
      return;
    this._renderingManager.reset();
    const s = i.getRenderId();
    for (let a = 0; a < t; a++) {
      const f = e[a];
      if (f && !f.isBlocked) {
        if (this.customIsReadyFunction) {
          if (!this.customIsReadyFunction(f, this.refreshRate, !1)) {
            this.resetRefreshCounter();
            continue;
          }
        } else if (!f.isReady(this.refreshRate === 0)) {
          this.resetRefreshCounter();
          continue;
        }
        if (!f._internalAbstractMeshDataInfo._currentLODIsUpToDate && i.activeCamera && (f._internalAbstractMeshDataInfo._currentLOD = i.customLODSelector ? i.customLODSelector(f, this.activeCamera || i.activeCamera) : f.getLOD(this.activeCamera || i.activeCamera), f._internalAbstractMeshDataInfo._currentLODIsUpToDate = !0), !f._internalAbstractMeshDataInfo._currentLOD)
          continue;
        let o = f._internalAbstractMeshDataInfo._currentLOD;
        o._preActivateForIntermediateRendering(s);
        let d;
        if (n && r ? d = (f.layerMask & r.layerMask) === 0 : d = !1, f.isEnabled() && f.isVisible && f.subMeshes && !d && (o !== f && o._activate(s, !0), f._activate(s, !0) && f.subMeshes.length)) {
          f.isAnInstance ? f._internalAbstractMeshDataInfo._actAsRegularMesh && (o = f) : o._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = !1, o._internalAbstractMeshDataInfo._isActiveIntermediate = !0;
          for (let v = 0; v < o.subMeshes.length; v++) {
            const u = o.subMeshes[v];
            this._renderingManager.dispatch(u, o);
          }
        }
      }
    }
    for (let a = 0; a < i.particleSystems.length; a++) {
      const f = i.particleSystems[a], o = f.emitter;
      !f.isStarted() || !o || o.position && !o.isEnabled() || this._renderingManager.dispatchParticles(f);
    }
  }
  /**
   * @internal
   * @param faceIndex face index to bind to if this is a cubetexture
   * @param layer defines the index of the texture to bind in the array
   */
  _bindFrameBuffer(e = 0, t = 0) {
    const r = this.getScene();
    if (!r)
      return;
    const n = r.getEngine();
    this._renderTarget && n.bindFramebuffer(this._renderTarget, this.isCube ? e : void 0, void 0, void 0, this.ignoreCameraViewport, 0, t);
  }
  _unbindFrameBuffer(e, t) {
    this._renderTarget && e.unBindFramebuffer(this._renderTarget, this.isCube, () => {
      this.onAfterRenderObservable.notifyObservers(t);
    });
  }
  /**
   * @internal
   */
  _prepareFrame(e, t, r, n) {
    this._postProcessManager ? this._prePassEnabled || this._postProcessManager._prepareFrame(this._texture, this._postProcesses) : (!n || !e.postProcessManager._prepareFrame(this._texture)) && this._bindFrameBuffer(t, r);
  }
  _renderToTarget(e, t, r, n = 0, i = null) {
    var s, a, f, o, d, v;
    const u = this.getScene();
    if (!u)
      return;
    const l = u.getEngine();
    if ((s = l._debugPushGroup) === null || s === void 0 || s.call(l, `render to face #${e} layer #${n}`, 1), this._prepareFrame(u, e, n, t), this.is2DArray ? (l.currentRenderPassId = this._renderPassIds[n], this.onBeforeRenderObservable.notifyObservers(n)) : (l.currentRenderPassId = this._renderPassIds[e], this.onBeforeRenderObservable.notifyObservers(e)), l.snapshotRendering && l.snapshotRenderingMode === 1)
      this.onClearObservable.hasObservers() ? this.onClearObservable.notifyObservers(l) : this.skipInitialClear || l.clear(this.clearColor || u.clearColor, !0, !0, !0);
    else {
      let p = null;
      const c = this.renderList ? this.renderList : u.getActiveMeshes().data, H = this.renderList ? this.renderList.length : u.getActiveMeshes().length;
      this.getCustomRenderList && (p = this.getCustomRenderList(this.is2DArray ? n : e, c, H)), p ? this._prepareRenderingManager(p, p.length, i, this.forceLayerMaskCheck) : (this._defaultRenderListPrepared || (this._prepareRenderingManager(c, H, i, !this.renderList || this.forceLayerMaskCheck), this._defaultRenderListPrepared = !0), p = c);
      for (const q of u._beforeRenderTargetClearStage)
        q.action(this, e, n);
      this.onClearObservable.hasObservers() ? this.onClearObservable.notifyObservers(l) : this.skipInitialClear || l.clear(this.clearColor || u.clearColor, !0, !0, !0), this._doNotChangeAspectRatio || u.updateTransformMatrix(!0);
      for (const q of u._beforeRenderTargetDrawStage)
        q.action(this, e, n);
      this._renderingManager.render(this.customRenderFunction, p, this.renderParticles, this.renderSprites);
      for (const q of u._afterRenderTargetDrawStage)
        q.action(this, e, n);
      const T = (f = (a = this._texture) === null || a === void 0 ? void 0 : a.generateMipMaps) !== null && f !== void 0 ? f : !1;
      this._texture && (this._texture.generateMipMaps = !1), this._postProcessManager ? this._postProcessManager._finalizeFrame(!1, (o = this._renderTarget) !== null && o !== void 0 ? o : void 0, e, this._postProcesses, this.ignoreCameraViewport) : t && u.postProcessManager._finalizeFrame(!1, (d = this._renderTarget) !== null && d !== void 0 ? d : void 0, e);
      for (const q of u._afterRenderTargetPostProcessStage)
        q.action(this, e, n);
      this._texture && (this._texture.generateMipMaps = T), this._doNotChangeAspectRatio || u.updateTransformMatrix(!0), r && eA.DumpFramebuffer(this.getRenderWidth(), this.getRenderHeight(), l);
    }
    this._unbindFrameBuffer(l, e), this._texture && this.isCube && e === 5 && l.generateMipMapsForCubemap(this._texture), (v = l._debugPopGroup) === null || v === void 0 || v.call(l, 1);
  }
  /**
   * Overrides the default sort function applied in the rendering group to prepare the meshes.
   * This allowed control for front to back rendering or reversely depending of the special needs.
   *
   * @param renderingGroupId The rendering group id corresponding to its index
   * @param opaqueSortCompareFn The opaque queue comparison function use to sort.
   * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.
   * @param transparentSortCompareFn The transparent queue comparison function use to sort.
   */
  setRenderingOrder(e, t = null, r = null, n = null) {
    this._renderingManager.setRenderingOrder(e, t, r, n);
  }
  /**
   * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
   *
   * @param renderingGroupId The rendering group id corresponding to its index
   * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
   */
  setRenderingAutoClearDepthStencil(e, t) {
    this._renderingManager.setRenderingAutoClearDepthStencil(e, t), this._renderingManager._useSceneAutoClearSetup = !1;
  }
  /**
   * Clones the texture.
   * @returns the cloned texture
   */
  clone() {
    const e = this.getSize(), t = new Ta(this.name, e, this.getScene(), this._renderTargetOptions.generateMipMaps, this._doNotChangeAspectRatio, this._renderTargetOptions.type, this.isCube, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer, this._renderTargetOptions.generateStencilBuffer, void 0, this._renderTargetOptions.format, void 0, this._renderTargetOptions.samples);
    return t.hasAlpha = this.hasAlpha, t.level = this.level, t.coordinatesMode = this.coordinatesMode, this.renderList && (t.renderList = this.renderList.slice(0)), t;
  }
  /**
   * Serialize the texture to a JSON representation we can easily use in the respective Parse function.
   * @returns The JSON representation of the texture
   */
  serialize() {
    if (!this.name)
      return null;
    const e = super.serialize();
    if (e.renderTargetSize = this.getRenderSize(), e.renderList = [], this.renderList)
      for (let t = 0; t < this.renderList.length; t++)
        e.renderList.push(this.renderList[t].id);
    return e;
  }
  /**
   *  This will remove the attached framebuffer objects. The texture will not be able to be used as render target anymore
   */
  disposeFramebufferObjects() {
    var e;
    (e = this._renderTarget) === null || e === void 0 || e.dispose(!0);
  }
  /**
   * Release and destroy the underlying lower level texture aka internalTexture.
   */
  releaseInternalTexture() {
    var e;
    (e = this._renderTarget) === null || e === void 0 || e.releaseTextures(), this._texture = null;
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
    var e;
    this.onResizeObservable.clear(), this.onClearObservable.clear(), this.onAfterRenderObservable.clear(), this.onAfterUnbindObservable.clear(), this.onBeforeBindObservable.clear(), this.onBeforeRenderObservable.clear(), this._postProcessManager && (this._postProcessManager.dispose(), this._postProcessManager = null), this._prePassRenderTarget && this._prePassRenderTarget.dispose(), this._releaseRenderPassId(), this.clearPostProcesses(!0), this._resizeObserver && (this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this.renderList = null;
    const t = this.getScene();
    if (!t)
      return;
    let r = t.customRenderTargets.indexOf(this);
    r >= 0 && t.customRenderTargets.splice(r, 1);
    for (const n of t.cameras)
      r = n.customRenderTargets.indexOf(this), r >= 0 && n.customRenderTargets.splice(r, 1);
    (e = this._renderTarget) === null || e === void 0 || e.dispose(), this._renderTarget = null, this._texture = null, super.dispose();
  }
  /** @internal */
  _rebuild() {
    this.refreshRate === Ta.REFRESHRATE_RENDER_ONCE && (this.refreshRate = Ta.REFRESHRATE_RENDER_ONCE), this._postProcessManager && this._postProcessManager._rebuild();
  }
  /**
   * Clear the info related to rendering groups preventing retention point in material dispose.
   */
  freeRenderingGroups() {
    this._renderingManager && this._renderingManager.freeRenderingGroups();
  }
  /**
   * Gets the number of views the corresponding to the texture (eg. a MultiviewRenderTarget will have > 1)
   * @returns the view count
   */
  getViewCount() {
    return 1;
  }
}
Ta.REFRESHRATE_RENDER_ONCE = 0;
Ta.REFRESHRATE_RENDER_ONEVERYFRAME = 1;
Ta.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = 2;
We._CreateRenderTargetTexture = (A, e, t, r, n) => new Ta(A, e, t, r);
class Tee {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_PROCEDURALTEXTURE, this.scene = e, this.scene.proceduralTextures = [];
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._beforeClearStage.registerStep(Ot.STEP_BEFORECLEAR_PROCEDURALTEXTURE, this, this._beforeClear);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources.
   */
  dispose() {
  }
  _beforeClear() {
    if (this.scene.proceduralTexturesEnabled) {
      ye.StartPerformanceCounter("Procedural textures", this.scene.proceduralTextures.length > 0);
      for (let e = 0; e < this.scene.proceduralTextures.length; e++) {
        const t = this.scene.proceduralTextures[e];
        t._shouldRender() && t.render();
      }
      ye.EndPerformanceCounter("Procedural textures", this.scene.proceduralTextures.length > 0);
    }
  }
}
const C6e = "proceduralVertexShader", O6e = `attribute vec2 position;varying vec2 vPosition;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vPosition=position;vUV=position*madd+madd;gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[C6e] = O6e;
class Y0 extends We {
  /**
   * Instantiates a new procedural texture.
   * Procedural texturing is a way to programmatically create a texture. There are 2 types of procedural textures: code-only, and code that references some classic 2D images, sometimes called 'refMaps' or 'sampler' images.
   * This is the base class of any Procedural texture and contains most of the shareable code.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/proceduralTextures
   * @param name  Define the name of the texture
   * @param size Define the size of the texture to create
   * @param fragment Define the fragment shader to use to generate the texture or null if it is defined later:
   *  * object: \{ fragmentElement: "fragmentShaderCode" \}, used with shader code in script tags
   *  * object: \{ fragmentSource: "fragment shader code string" \}, the string contains the shader code
   *  * string: the string contains a name "XXX" to lookup in Effect.ShadersStore["XXXFragmentShader"]
   * @param scene Define the scene the texture belongs to
   * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
   * @param generateMipMaps Define if the texture should creates mip maps or not
   * @param isCube Define if the texture is a cube texture or not (this will render each faces of the cube)
   * @param textureType The FBO internal texture type
   */
  constructor(e, t, r, n, i = null, s = !0, a = !1, f = 0) {
    super(null, n, !s), this.isEnabled = !0, this.autoClear = !0, this.onGeneratedObservable = new Oe(), this.onBeforeGenerationObservable = new Oe(), this.nodeMaterialSource = null, this._textures = {}, this._currentRefreshId = -1, this._frameId = -1, this._refreshRate = 1, this._vertexBuffers = {}, this._uniforms = new Array(), this._samplers = new Array(), this._floats = {}, this._ints = {}, this._floatsArrays = {}, this._colors3 = {}, this._colors4 = {}, this._vectors2 = {}, this._vectors3 = {}, this._matrices = {}, this._fallbackTextureUsed = !1, this._cachedDefines = null, this._contentUpdateId = -1, this._rtWrapper = null, n = this.getScene() || gr.LastCreatedScene;
    let o = n._getComponent(Ot.NAME_PROCEDURALTEXTURE);
    o || (o = new Tee(n), n._addComponent(o)), n.proceduralTextures.push(this), this._fullEngine = n.getEngine(), this.name = e, this.isRenderTarget = !0, this._size = t, this._textureType = f, this._generateMipMaps = s, this._drawWrapper = new zo(this._fullEngine), this.setFragment(r), this._fallbackTexture = i;
    const d = this._createRtWrapper(a, t, s, f);
    this._texture = d.texture;
    const v = [];
    v.push(1, 1), v.push(-1, 1), v.push(-1, -1), v.push(1, -1), this._vertexBuffers[J.PositionKind] = new J(this._fullEngine, v, J.PositionKind, !1, !1, 2), this._createIndexBuffer();
  }
  _createRtWrapper(e, t, r, n) {
    return e ? (this._rtWrapper = this._fullEngine.createRenderTargetCubeTexture(t, {
      generateMipMaps: r,
      generateDepthBuffer: !1,
      generateStencilBuffer: !1,
      type: n
    }), this.setFloat("face", 0)) : this._rtWrapper = this._fullEngine.createRenderTargetTexture(t, {
      generateMipMaps: r,
      generateDepthBuffer: !1,
      generateStencilBuffer: !1,
      type: n
    }), this._rtWrapper;
  }
  /**
   * The effect that is created when initializing the post process.
   * @returns The created effect corresponding the postprocess.
   */
  getEffect() {
    return this._drawWrapper.effect;
  }
  /**
   * @internal*
   */
  _setEffect(e) {
    this._drawWrapper.effect = e;
  }
  /**
   * Gets texture content (Use this function wisely as reading from a texture can be slow)
   * @returns an ArrayBufferView promise (Uint8Array or Float32Array)
   */
  getContent() {
    return this._contentData && this._frameId === this._contentUpdateId ? this._contentData : (this._contentData ? this._contentData.then((e) => {
      this._contentData = this.readPixels(0, 0, e), this._contentUpdateId = this._frameId;
    }) : (this._contentData = this.readPixels(0, 0), this._contentUpdateId = this._frameId), this._contentData);
  }
  _createIndexBuffer() {
    const e = this._fullEngine, t = [];
    t.push(0), t.push(1), t.push(2), t.push(0), t.push(2), t.push(3), this._indexBuffer = e.createIndexBuffer(t);
  }
  /** @internal */
  _rebuild() {
    const e = this._vertexBuffers[J.PositionKind];
    e && e._rebuild(), this._createIndexBuffer(), this.refreshRate === Ta.REFRESHRATE_RENDER_ONCE && (this.refreshRate = Ta.REFRESHRATE_RENDER_ONCE);
  }
  /**
   * Resets the texture in order to recreate its associated resources.
   * This can be called in case of context loss or if you change the shader code and need to regenerate the texture with the new code
   */
  reset() {
    var e;
    (e = this._drawWrapper.effect) === null || e === void 0 || e.dispose(), this._drawWrapper.effect = null, this._cachedDefines = null;
  }
  _getDefines() {
    return "";
  }
  /**
   * Executes a function when the texture will be ready to be drawn.
   * @param func The callback to be used.
   */
  executeWhenReady(e) {
    if (this.isReady()) {
      e(this);
      return;
    }
    const t = this.getEffect();
    t && t.executeWhenCompiled(() => {
      e(this);
    });
  }
  /**
   * Is the texture ready to be used ? (rendered at least once)
   * @returns true if ready, otherwise, false.
   */
  isReady() {
    const e = this._fullEngine;
    if (this.nodeMaterialSource)
      return this._drawWrapper.effect.isReady();
    if (!this._fragment)
      return !1;
    if (this._fallbackTextureUsed)
      return !0;
    if (!this._texture)
      return !1;
    const t = this._getDefines();
    if (this._drawWrapper.effect && t === this._cachedDefines && this._drawWrapper.effect.isReady())
      return !0;
    const r = {
      vertex: "procedural",
      fragmentElement: this._fragment.fragmentElement,
      fragmentSource: this._fragment.fragmentSource,
      fragment: typeof this._fragment == "string" ? this._fragment : void 0
    };
    return this._cachedDefines !== t && (this._cachedDefines = t, this._drawWrapper.effect = e.createEffect(r, [J.PositionKind], this._uniforms, this._samplers, t, void 0, void 0, () => {
      var n;
      (n = this._rtWrapper) === null || n === void 0 || n.dispose(), this._rtWrapper = this._texture = null, this._fallbackTexture && (this._texture = this._fallbackTexture._texture, this._texture && this._texture.incrementReferences()), this._fallbackTextureUsed = !0;
    })), this._drawWrapper.effect.isReady();
  }
  /**
   * Resets the refresh counter of the texture and start bak from scratch.
   * Could be useful to regenerate the texture if it is setup to render only once.
   */
  resetRefreshCounter() {
    this._currentRefreshId = -1;
  }
  /**
   * Set the fragment shader to use in order to render the texture.
   * @param fragment This can be set to a path (into the shader store) or to a json object containing a fragmentElement property.
   */
  setFragment(e) {
    this._fragment = e;
  }
  /**
   * Define the refresh rate of the texture or the rendering frequency.
   * Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...
   */
  get refreshRate() {
    return this._refreshRate;
  }
  set refreshRate(e) {
    this._refreshRate = e, this.resetRefreshCounter();
  }
  /** @internal */
  _shouldRender() {
    return !this.isEnabled || !this.isReady() || !this._texture ? (this._texture && (this._texture.isReady = !1), !1) : this._fallbackTextureUsed ? !1 : this._currentRefreshId === -1 ? (this._currentRefreshId = 1, this._frameId++, !0) : this.refreshRate === this._currentRefreshId ? (this._currentRefreshId = 1, this._frameId++, !0) : (this._currentRefreshId++, !1);
  }
  /**
   * Get the size the texture is rendering at.
   * @returns the size (on cube texture it is always squared)
   */
  getRenderSize() {
    return this._size;
  }
  /**
   * Resize the texture to new value.
   * @param size Define the new size the texture should have
   * @param generateMipMaps Define whether the new texture should create mip maps
   */
  resize(e, t) {
    if (this._fallbackTextureUsed || !this._rtWrapper || !this._texture)
      return;
    const r = this._texture.isCube;
    this._rtWrapper.dispose();
    const n = this._createRtWrapper(r, e, t, this._textureType);
    this._texture = n.texture, this._size = e, this._generateMipMaps = t;
  }
  _checkUniform(e) {
    this._uniforms.indexOf(e) === -1 && this._uniforms.push(e);
  }
  /**
   * Set a texture in the shader program used to render.
   * @param name Define the name of the uniform samplers as defined in the shader
   * @param texture Define the texture to bind to this sampler
   * @returns the texture itself allowing "fluent" like uniform updates
   */
  setTexture(e, t) {
    return this._samplers.indexOf(e) === -1 && this._samplers.push(e), this._textures[e] = t, this;
  }
  /**
   * Set a float in the shader.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the texture itself allowing "fluent" like uniform updates
   */
  setFloat(e, t) {
    return this._checkUniform(e), this._floats[e] = t, this;
  }
  /**
   * Set a int in the shader.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the texture itself allowing "fluent" like uniform updates
   */
  setInt(e, t) {
    return this._checkUniform(e), this._ints[e] = t, this;
  }
  /**
   * Set an array of floats in the shader.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the texture itself allowing "fluent" like uniform updates
   */
  setFloats(e, t) {
    return this._checkUniform(e), this._floatsArrays[e] = t, this;
  }
  /**
   * Set a vec3 in the shader from a Color3.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the texture itself allowing "fluent" like uniform updates
   */
  setColor3(e, t) {
    return this._checkUniform(e), this._colors3[e] = t, this;
  }
  /**
   * Set a vec4 in the shader from a Color4.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the texture itself allowing "fluent" like uniform updates
   */
  setColor4(e, t) {
    return this._checkUniform(e), this._colors4[e] = t, this;
  }
  /**
   * Set a vec2 in the shader from a Vector2.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the texture itself allowing "fluent" like uniform updates
   */
  setVector2(e, t) {
    return this._checkUniform(e), this._vectors2[e] = t, this;
  }
  /**
   * Set a vec3 in the shader from a Vector3.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the texture itself allowing "fluent" like uniform updates
   */
  setVector3(e, t) {
    return this._checkUniform(e), this._vectors3[e] = t, this;
  }
  /**
   * Set a mat4 in the shader from a MAtrix.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the texture itself allowing "fluent" like uniform updates
   */
  setMatrix(e, t) {
    return this._checkUniform(e), this._matrices[e] = t, this;
  }
  /**
   * Render the texture to its associated render target.
   * @param useCameraPostProcess Define if camera post process should be applied to the texture
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  render(e) {
    var t, r;
    const n = this.getScene();
    if (!n)
      return;
    const i = this._fullEngine;
    if (i.enableEffect(this._drawWrapper), this.onBeforeGenerationObservable.notifyObservers(this), i.setState(!1), !this.nodeMaterialSource) {
      for (const a in this._textures)
        this._drawWrapper.effect.setTexture(a, this._textures[a]);
      for (const a in this._ints)
        this._drawWrapper.effect.setInt(a, this._ints[a]);
      for (const a in this._floats)
        this._drawWrapper.effect.setFloat(a, this._floats[a]);
      for (const a in this._floatsArrays)
        this._drawWrapper.effect.setArray(a, this._floatsArrays[a]);
      for (const a in this._colors3)
        this._drawWrapper.effect.setColor3(a, this._colors3[a]);
      for (const a in this._colors4) {
        const f = this._colors4[a];
        this._drawWrapper.effect.setFloat4(a, f.r, f.g, f.b, f.a);
      }
      for (const a in this._vectors2)
        this._drawWrapper.effect.setVector2(a, this._vectors2[a]);
      for (const a in this._vectors3)
        this._drawWrapper.effect.setVector3(a, this._vectors3[a]);
      for (const a in this._matrices)
        this._drawWrapper.effect.setMatrix(a, this._matrices[a]);
    }
    if (!this._texture || !this._rtWrapper)
      return;
    (t = i._debugPushGroup) === null || t === void 0 || t.call(i, `procedural texture generation for ${this.name}`, 1);
    const s = i.currentViewport;
    if (this.isCube)
      for (let a = 0; a < 6; a++)
        i.bindFramebuffer(this._rtWrapper, a, void 0, void 0, !0), i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._drawWrapper.effect), this._drawWrapper.effect.setFloat("face", a), this.autoClear && i.clear(n.clearColor, !0, !1, !1), i.drawElementsType(gt.TriangleFillMode, 0, 6);
    else
      i.bindFramebuffer(this._rtWrapper, 0, void 0, void 0, !0), i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._drawWrapper.effect), this.autoClear && i.clear(n.clearColor, !0, !1, !1), i.drawElementsType(gt.TriangleFillMode, 0, 6);
    i.unBindFramebuffer(this._rtWrapper, this.isCube), s && i.setViewport(s), this.isCube && i.generateMipMapsForCubemap(this._texture), (r = i._debugPopGroup) === null || r === void 0 || r.call(i, 1), this.onGenerated && this.onGenerated(), this.onGeneratedObservable.notifyObservers(this);
  }
  /**
   * Clone the texture.
   * @returns the cloned texture
   */
  clone() {
    const e = this.getSize(), t = new Y0(this.name, e.width, this._fragment, this.getScene(), this._fallbackTexture, this._generateMipMaps);
    return t.hasAlpha = this.hasAlpha, t.level = this.level, t.coordinatesMode = this.coordinatesMode, t;
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
    const e = this.getScene();
    if (!e)
      return;
    const t = e.proceduralTextures.indexOf(this);
    t >= 0 && e.proceduralTextures.splice(t, 1);
    const r = this._vertexBuffers[J.PositionKind];
    r && (r.dispose(), this._vertexBuffers[J.PositionKind] = null), this._indexBuffer && this._fullEngine._releaseBuffer(this._indexBuffer) && (this._indexBuffer = null), this.onGeneratedObservable.clear(), this.onBeforeGenerationObservable.clear(), super.dispose();
  }
}
C([
  M()
], Y0.prototype, "isEnabled", void 0);
C([
  M()
], Y0.prototype, "autoClear", void 0);
C([
  M()
], Y0.prototype, "_generateMipMaps", void 0);
C([
  M()
], Y0.prototype, "_size", void 0);
C([
  M()
], Y0.prototype, "refreshRate", null);
Ue("BABYLON.ProceduralTexture", Y0);
var o9;
(function(A) {
  A[A.Cos = 0] = "Cos", A[A.Sin = 1] = "Sin", A[A.Abs = 2] = "Abs", A[A.Exp = 3] = "Exp", A[A.Exp2 = 4] = "Exp2", A[A.Round = 5] = "Round", A[A.Floor = 6] = "Floor", A[A.Ceiling = 7] = "Ceiling", A[A.Sqrt = 8] = "Sqrt", A[A.Log = 9] = "Log", A[A.Tan = 10] = "Tan", A[A.ArcTan = 11] = "ArcTan", A[A.ArcCos = 12] = "ArcCos", A[A.ArcSin = 13] = "ArcSin", A[A.Fract = 14] = "Fract", A[A.Sign = 15] = "Sign", A[A.Radians = 16] = "Radians", A[A.Degrees = 17] = "Degrees";
})(o9 || (o9 = {}));
class uQ extends Mr {
  /**
   * Creates a new TrigonometryBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.operation = o9.Cos, this.registerInput("input", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "TrigonometryBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    let r = "";
    switch (this.operation) {
      case o9.Cos: {
        r = "cos";
        break;
      }
      case o9.Sin: {
        r = "sin";
        break;
      }
      case o9.Abs: {
        r = "abs";
        break;
      }
      case o9.Exp: {
        r = "exp";
        break;
      }
      case o9.Exp2: {
        r = "exp2";
        break;
      }
      case o9.Round: {
        r = "round";
        break;
      }
      case o9.Floor: {
        r = "floor";
        break;
      }
      case o9.Ceiling: {
        r = "ceil";
        break;
      }
      case o9.Sqrt: {
        r = "sqrt";
        break;
      }
      case o9.Log: {
        r = "log";
        break;
      }
      case o9.Tan: {
        r = "tan";
        break;
      }
      case o9.ArcTan: {
        r = "atan";
        break;
      }
      case o9.ArcCos: {
        r = "acos";
        break;
      }
      case o9.ArcSin: {
        r = "asin";
        break;
      }
      case o9.Fract: {
        r = "fract";
        break;
      }
      case o9.Sign: {
        r = "sign";
        break;
      }
      case o9.Radians: {
        r = "radians";
        break;
      }
      case o9.Degrees: {
        r = "degrees";
        break;
      }
    }
    return e.compilationString += this._declareOutput(t, e) + ` = ${r}(${this.input.associatedVariableName});
`, this;
  }
  serialize() {
    const e = super.serialize();
    return e.operation = this.operation, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.operation = e.operation;
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.operation = BABYLON.TrigonometryBlockOperations.${o9[this.operation]};
`;
  }
}
Ue("BABYLON.TrigonometryBlock", uQ);
const XE = { effect: null, subMesh: null };
class HI extends na {
  constructor() {
    super(), this.NORMAL = !1, this.TANGENT = !1, this.VERTEXCOLOR_NME = !1, this.UV1 = !1, this.UV2 = !1, this.UV3 = !1, this.UV4 = !1, this.UV5 = !1, this.UV6 = !1, this.PREPASS = !1, this.PREPASS_NORMAL = !1, this.PREPASS_NORMAL_INDEX = -1, this.PREPASS_POSITION = !1, this.PREPASS_POSITION_INDEX = -1, this.PREPASS_DEPTH = !1, this.PREPASS_DEPTH_INDEX = -1, this.SCENE_MRT_COUNT = 0, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.BONETEXTURE = !1, this.MORPHTARGETS = !1, this.MORPHTARGETS_NORMAL = !1, this.MORPHTARGETS_TANGENT = !1, this.MORPHTARGETS_UV = !1, this.NUM_MORPH_INFLUENCERS = 0, this.MORPHTARGETS_TEXTURE = !1, this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.EXPOSURE = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.BUMPDIRECTUV = 0, this.CAMERA_ORTHOGRAPHIC = !1, this.CAMERA_PERSPECTIVE = !1, this.rebuild();
  }
  setValue(e, t, r = !1) {
    this[e] === void 0 && this._keys.push(e), r && this[e] !== t && this.markAsUnprocessed(), this[e] = t;
  }
}
class ja extends P1 {
  /**
   * Checks if a block is a texture block
   * @param block The block to check
   * @returns True if the block is a texture block
   */
  static _BlockIsTextureBlock(e) {
    return e.getClassName() === "TextureBlock" || e.getClassName() === "ReflectionTextureBaseBlock" || e.getClassName() === "RefractionBlock" || e.getClassName() === "CurrentScreenBlock" || e.getClassName() === "ParticleTextureBlock" || e.getClassName() === "ImageSourceBlock" || e.getClassName() === "TriPlanarBlock" || e.getClassName() === "BiPlanarBlock" || e.getClassName() === "PrePassTextureBlock";
  }
  /** Get the inspector from bundle or global */
  _getGlobalNodeMaterialEditor() {
    if (typeof NODEEDITOR < "u")
      return NODEEDITOR;
    if (typeof BABYLON < "u" && typeof BABYLON.NodeEditor < "u")
      return BABYLON;
  }
  /** Gets or sets options to control the node material overall behavior */
  get options() {
    return this._options;
  }
  set options(e) {
    this._options = e;
  }
  /**
   * Gets the image processing configuration used either in this material.
   */
  get imageProcessingConfiguration() {
    return this._imageProcessingConfiguration;
  }
  /**
   * Sets the Default image processing configuration used either in the this material.
   *
   * If sets to null, the scene one is in use.
   */
  set imageProcessingConfiguration(e) {
    this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty();
  }
  /**
   * Gets or sets the mode property
   */
  get mode() {
    return this._mode;
  }
  set mode(e) {
    this._mode = e;
  }
  /** Gets or sets the unique identifier used to identified the effect associated with the material */
  get buildId() {
    return this._buildId;
  }
  set buildId(e) {
    this._buildId = e;
  }
  /**
   * Create a new node based material
   * @param name defines the material name
   * @param scene defines the hosting scene
   * @param options defines creation option
   */
  constructor(e, t, r = {}) {
    super(e, t || gr.LastCreatedScene), this._buildId = ja._BuildIdGenerator++, this._buildWasSuccessful = !1, this._cachedWorldViewMatrix = new he(), this._cachedWorldViewProjectionMatrix = new he(), this._optimizers = new Array(), this._animationFrame = -1, this.BJSNODEMATERIALEDITOR = this._getGlobalNodeMaterialEditor(), this.editorData = null, this.ignoreAlpha = !1, this.maxSimultaneousLights = 4, this.onBuildObservable = new Oe(), this._vertexOutputNodes = new Array(), this._fragmentOutputNodes = new Array(), this.attachedBlocks = [], this._mode = Vv.Material, this.forceAlphaBlending = !1, this._options = Object.assign({ emitComments: !1 }, r), this._attachImageProcessingConfiguration(null);
  }
  /**
   * Gets the current class name of the material e.g. "NodeMaterial"
   * @returns the class name
   */
  getClassName() {
    return "NodeMaterial";
  }
  /**
   * Attaches a new image processing configuration to the Standard Material.
   * @param configuration
   */
  _attachImageProcessingConfiguration(e) {
    e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), e ? this._imageProcessingConfiguration = e : this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
      this._markAllSubMeshesAsImageProcessingDirty();
    })));
  }
  /**
   * Get a block by its name
   * @param name defines the name of the block to retrieve
   * @returns the required block or null if not found
   */
  getBlockByName(e) {
    let t = null;
    for (const r of this.attachedBlocks)
      if (r.name === e)
        if (!t)
          t = r;
        else
          return ye.Warn("More than one block was found with the name `" + e + "`"), t;
    return t;
  }
  /**
   * Get a block by its name
   * @param predicate defines the predicate used to find the good candidate
   * @returns the required block or null if not found
   */
  getBlockByPredicate(e) {
    for (const t of this.attachedBlocks)
      if (e(t))
        return t;
    return null;
  }
  /**
   * Get an input block by its name
   * @param predicate defines the predicate used to find the good candidate
   * @returns the required input block or null if not found
   */
  getInputBlockByPredicate(e) {
    for (const t of this.attachedBlocks)
      if (t.isInput && e(t))
        return t;
    return null;
  }
  /**
   * Gets the list of input blocks attached to this material
   * @returns an array of InputBlocks
   */
  getInputBlocks() {
    const e = [];
    for (const t of this.attachedBlocks)
      t.isInput && e.push(t);
    return e;
  }
  /**
   * Adds a new optimizer to the list of optimizers
   * @param optimizer defines the optimizers to add
   * @returns the current material
   */
  registerOptimizer(e) {
    if (!(this._optimizers.indexOf(e) > -1))
      return this._optimizers.push(e), this;
  }
  /**
   * Remove an optimizer from the list of optimizers
   * @param optimizer defines the optimizers to remove
   * @returns the current material
   */
  unregisterOptimizer(e) {
    const t = this._optimizers.indexOf(e);
    if (t !== -1)
      return this._optimizers.splice(t, 1), this;
  }
  /**
   * Add a new block to the list of output nodes
   * @param node defines the node to add
   * @returns the current material
   */
  addOutputNode(e) {
    if (e.target === null)
      throw "This node is not meant to be an output node. You may want to explicitly set its target value.";
    return e.target & Ve.Vertex && this._addVertexOutputNode(e), e.target & Ve.Fragment && this._addFragmentOutputNode(e), this;
  }
  /**
   * Remove a block from the list of root nodes
   * @param node defines the node to remove
   * @returns the current material
   */
  removeOutputNode(e) {
    return e.target === null ? this : (e.target & Ve.Vertex && this._removeVertexOutputNode(e), e.target & Ve.Fragment && this._removeFragmentOutputNode(e), this);
  }
  _addVertexOutputNode(e) {
    if (this._vertexOutputNodes.indexOf(e) === -1)
      return e.target = Ve.Vertex, this._vertexOutputNodes.push(e), this;
  }
  _removeVertexOutputNode(e) {
    const t = this._vertexOutputNodes.indexOf(e);
    if (t !== -1)
      return this._vertexOutputNodes.splice(t, 1), this;
  }
  _addFragmentOutputNode(e) {
    if (this._fragmentOutputNodes.indexOf(e) === -1)
      return e.target = Ve.Fragment, this._fragmentOutputNodes.push(e), this;
  }
  _removeFragmentOutputNode(e) {
    const t = this._fragmentOutputNodes.indexOf(e);
    if (t !== -1)
      return this._fragmentOutputNodes.splice(t, 1), this;
  }
  /**
   * Specifies if the material will require alpha blending
   * @returns a boolean specifying if alpha blending is needed
   */
  needAlphaBlending() {
    return this.ignoreAlpha ? !1 : this.forceAlphaBlending || this.alpha < 1 || this._sharedData && this._sharedData.hints.needAlphaBlending;
  }
  /**
   * Specifies if this material should be rendered in alpha test mode
   * @returns a boolean specifying if an alpha test is needed.
   */
  needAlphaTesting() {
    return this._sharedData && this._sharedData.hints.needAlphaTesting;
  }
  _processInitializeOnLink(e, t, r, n = !0) {
    (e.target === Ve.VertexAndFragment || t.target === Ve.Fragment && e.target === Ve.Vertex && e._preparationId !== this._buildId) && r.push(e), this._initializeBlock(e, t, r, n);
  }
  _initializeBlock(e, t, r, n = !0) {
    if (e.initialize(t), n && e.autoConfigure(this), e._preparationId = this._buildId, this.attachedBlocks.indexOf(e) === -1) {
      if (e.isUnique) {
        const i = e.getClassName();
        for (const s of this.attachedBlocks)
          if (s.getClassName() === i)
            throw `Cannot have multiple blocks of type ${i} in the same NodeMaterial`;
      }
      this.attachedBlocks.push(e);
    }
    for (const i of e.inputs) {
      i.associatedVariableName = "";
      const s = i.connectedPoint;
      if (s) {
        const a = s.ownerBlock;
        a !== e && this._processInitializeOnLink(a, t, r, n);
      }
    }
    if (e.isTeleportOut) {
      const i = e;
      i.entryPoint && this._processInitializeOnLink(i.entryPoint, t, r, n);
    }
    for (const i of e.outputs)
      i.associatedVariableName = "";
  }
  _resetDualBlocks(e, t) {
    e.target === Ve.VertexAndFragment && (e.buildId = t);
    for (const r of e.inputs) {
      const n = r.connectedPoint;
      if (n) {
        const i = n.ownerBlock;
        i !== e && this._resetDualBlocks(i, t);
      }
    }
    if (e.isTeleportOut) {
      const r = e;
      r.entryPoint && this._resetDualBlocks(r.entryPoint, t);
    }
  }
  /**
   * Remove a block from the current node material
   * @param block defines the block to remove
   */
  removeBlock(e) {
    const t = this.attachedBlocks.indexOf(e);
    t > -1 && this.attachedBlocks.splice(t, 1), e.isFinalMerger && this.removeOutputNode(e);
  }
  /**
   * Build the material and generates the inner effect
   * @param verbose defines if the build should log activity
   * @param updateBuildId defines if the internal build Id should be updated (default is true)
   * @param autoConfigure defines if the autoConfigure method should be called when initializing blocks (default is false)
   */
  build(e = !1, t = !0, r = !1) {
    !this._vertexCompilationState && !r && (r = !0), this._buildWasSuccessful = !1;
    const n = this.getScene().getEngine(), i = this._mode === Vv.Particle;
    if (this._vertexOutputNodes.length === 0 && !i)
      throw "You must define at least one vertexOutputNode";
    if (this._fragmentOutputNodes.length === 0)
      throw "You must define at least one fragmentOutputNode";
    this._vertexCompilationState = new lG(), this._vertexCompilationState.supportUniformBuffers = n.supportsUniformBuffers, this._vertexCompilationState.target = Ve.Vertex, this._fragmentCompilationState = new lG(), this._fragmentCompilationState.supportUniformBuffers = n.supportsUniformBuffers, this._fragmentCompilationState.target = Ve.Fragment, this._sharedData = new W6e(), this._sharedData.nodeMaterial = this, this._sharedData.fragmentOutputNodes = this._fragmentOutputNodes, this._vertexCompilationState.sharedData = this._sharedData, this._fragmentCompilationState.sharedData = this._sharedData, this._sharedData.buildId = this._buildId, this._sharedData.emitComments = this._options.emitComments, this._sharedData.verbose = e, this._sharedData.scene = this.getScene(), this._sharedData.allowEmptyVertexProgram = i;
    const s = [], a = [];
    for (const d of this._vertexOutputNodes)
      s.push(d), this._initializeBlock(d, this._vertexCompilationState, a, r);
    for (const d of this._fragmentOutputNodes)
      a.push(d), this._initializeBlock(d, this._fragmentCompilationState, s, r);
    this.optimize();
    for (const d of s)
      d.build(this._vertexCompilationState, s);
    this._fragmentCompilationState.uniforms = this._vertexCompilationState.uniforms.slice(0), this._fragmentCompilationState._uniformDeclaration = this._vertexCompilationState._uniformDeclaration, this._fragmentCompilationState._constantDeclaration = this._vertexCompilationState._constantDeclaration, this._fragmentCompilationState._vertexState = this._vertexCompilationState;
    for (const d of a)
      this._resetDualBlocks(d, this._buildId - 1);
    for (const d of a)
      d.build(this._fragmentCompilationState, a);
    this._vertexCompilationState.finalize(this._vertexCompilationState), this._fragmentCompilationState.finalize(this._fragmentCompilationState), t && (this._buildId = ja._BuildIdGenerator++), this._sharedData.emitErrors(), e && (console.log("Vertex shader:"), console.log(this._vertexCompilationState.compilationString), console.log("Fragment shader:"), console.log(this._fragmentCompilationState.compilationString)), this._buildWasSuccessful = !0, this.onBuildObservable.notifyObservers(this);
    const f = this.getScene().meshes;
    for (const d of f)
      if (d.subMeshes)
        for (const v of d.subMeshes) {
          if (v.getMaterial() !== this || !v.materialDefines)
            continue;
          const u = v.materialDefines;
          u.markAllAsDirty(), u.reset();
        }
    this.prePassTextureInputs.length && this.getScene().enablePrePassRenderer();
    const o = this.getScene().prePassRenderer;
    o && o.markAsDirty();
  }
  /**
   * Runs an otpimization phase to try to improve the shader code
   */
  optimize() {
    for (const e of this._optimizers)
      e.optimize(this._vertexOutputNodes, this._fragmentOutputNodes);
  }
  _prepareDefinesForAttributes(e, t) {
    const r = t.NORMAL, n = t.TANGENT, i = t.VERTEXCOLOR_NME;
    t.NORMAL = e.isVerticesDataPresent(J.NormalKind), t.TANGENT = e.isVerticesDataPresent(J.TangentKind);
    const s = e.useVertexColors && e.isVerticesDataPresent(J.ColorKind);
    t.VERTEXCOLOR_NME = s;
    let a = !1;
    for (let o = 1; o <= 6; ++o) {
      const d = t["UV" + o];
      t["UV" + o] = e.isVerticesDataPresent(`uv${o === 1 ? "" : o}`), a = a || t["UV" + o] !== d;
    }
    const f = this.needAlphaBlendingForMesh(e) && this.getScene().useOrderIndependentTransparency;
    Ye.PrepareDefinesForPrePass(this.getScene(), t, !f), (r !== t.NORMAL || n !== t.TANGENT || i !== t.VERTEXCOLOR_NME || a) && t.markAsAttributesDirty();
  }
  /**
   * Can this material render to prepass
   */
  get isPrePassCapable() {
    return !0;
  }
  /**
   * Outputs written to the prepass
   */
  get prePassTextureOutputs() {
    const e = this.getBlockByPredicate((r) => r.getClassName() === "PrePassOutputBlock"), t = [4];
    return !e || this.prePassTextureInputs.length || (e.viewDepth.isConnected && t.push(5), e.viewNormal.isConnected && t.push(6), e.worldPosition.isConnected && t.push(1)), t;
  }
  /**
   * Gets the list of prepass texture required
   */
  get prePassTextureInputs() {
    const e = this.getAllTextureBlocks().filter((r) => r.getClassName() === "PrePassTextureBlock"), t = [];
    for (const r of e)
      r.position.isConnected && !t.includes(1) && t.push(1), r.depth.isConnected && !t.includes(5) && t.push(5), r.normal.isConnected && !t.includes(6) && t.push(6);
    return t;
  }
  /**
   * Sets the required values to the prepass renderer.
   */
  setPrePassRenderer(e) {
    const t = this.prePassTextureInputs.concat(this.prePassTextureOutputs);
    if (e && t.length > 1) {
      let r = e.getEffectConfiguration("nodeMaterial");
      r || (r = e.addEffectConfiguration({
        enabled: !0,
        needsImageProcessing: !1,
        name: "nodeMaterial",
        texturesRequired: []
      }));
      for (const n of t)
        r.texturesRequired.includes(n) || r.texturesRequired.push(n);
      r.enabled = !0;
    }
    return t.length > 1;
  }
  /**
   * Create a post process from the material
   * @param camera The camera to apply the render pass to.
   * @param options The required width/height ratio to downsize to before computing the render pass. (Use 1.0 for full size)
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)
   * @returns the post process created
   */
  createPostProcess(e, t = 1, r = 1, n, i, s = 0, a = 5) {
    return this.mode !== Vv.PostProcess ? (console.log("Incompatible material mode"), null) : this._createEffectForPostProcess(null, e, t, r, n, i, s, a);
  }
  /**
   * Create the post process effect from the material
   * @param postProcess The post process to create the effect for
   */
  createEffectForPostProcess(e) {
    this._createEffectForPostProcess(e);
  }
  _createEffectForPostProcess(e, t, r = 1, n = 1, i, s, a = 0, f = 5) {
    let o = this.name + this._buildId;
    const d = new HI(), v = new jn(o + "PostProcess", this.getScene());
    let u = this._buildId;
    return this._processDefines(v, d), An.RegisterShader(o, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString), e ? e.updateEffect(d.toString(), this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, { maxSimultaneousLights: this.maxSimultaneousLights }, void 0, void 0, o, o) : e = new kr(this.name + "PostProcess", o, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, r, t, n, i, s, d.toString(), a, o, { maxSimultaneousLights: this.maxSimultaneousLights }, !1, f), e.nodeMaterialSource = this, e.onApplyObservable.add((l) => {
      u !== this._buildId && (delete An.ShadersStore[o + "VertexShader"], delete An.ShadersStore[o + "PixelShader"], o = this.name + this._buildId, d.markAllAsDirty(), u = this._buildId), this._processDefines(v, d) && (An.RegisterShader(o, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString), wS.SetImmediate(() => e.updateEffect(d.toString(), this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, { maxSimultaneousLights: this.maxSimultaneousLights }, void 0, void 0, o, o))), this._checkInternals(l);
    }), e;
  }
  /**
   * Create a new procedural texture based on this node material
   * @param size defines the size of the texture
   * @param scene defines the hosting scene
   * @returns the new procedural texture attached to this node material
   */
  createProceduralTexture(e, t) {
    if (this.mode !== Vv.ProceduralTexture)
      return console.log("Incompatible material mode"), null;
    let r = this.name + this._buildId;
    const n = new Y0(r, e, null, t), i = new jn(r + "Procedural", this.getScene());
    i.reservedDataStore = {
      hidden: !0
    };
    const s = new HI(), a = this._processDefines(i, s);
    An.RegisterShader(r, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString);
    let f = this.getScene().getEngine().createEffect({
      vertexElement: r,
      fragmentElement: r
    }, [J.PositionKind], this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, s.toString(), a == null ? void 0 : a.fallbacks, void 0);
    n.nodeMaterialSource = this, n._setEffect(f);
    let o = this._buildId;
    return n.onBeforeGenerationObservable.add(() => {
      o !== this._buildId && (delete An.ShadersStore[r + "VertexShader"], delete An.ShadersStore[r + "PixelShader"], r = this.name + this._buildId, s.markAllAsDirty(), o = this._buildId);
      const d = this._processDefines(i, s);
      d && (An.RegisterShader(r, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString), wS.SetImmediate(() => {
        f = this.getScene().getEngine().createEffect({
          vertexElement: r,
          fragmentElement: r
        }, [J.PositionKind], this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, s.toString(), d == null ? void 0 : d.fallbacks, void 0), n._setEffect(f);
      })), this._checkInternals(f);
    }), n;
  }
  _createEffectForParticles(e, t, r, n, i, s, a, f = "") {
    let o = this.name + this._buildId + "_" + t;
    s || (s = new HI()), a || (a = this.getScene().getMeshByName(this.name + "Particle"), a || (a = new jn(this.name + "Particle", this.getScene()), a.reservedDataStore = {
      hidden: !0
    }));
    let d = this._buildId;
    const v = [];
    let u = f;
    if (!i) {
      const l = this._processDefines(a, s);
      An.RegisterShader(o, this._fragmentCompilationState._builtCompilationString), e.fillDefines(v, t), u = v.join(`
`), i = this.getScene().getEngine().createEffectForParticles(o, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, s.toString() + `
` + u, l == null ? void 0 : l.fallbacks, r, n, e), e.setCustomEffect(i, t);
    }
    i.onBindObservable.add((l) => {
      d !== this._buildId && (delete An.ShadersStore[o + "PixelShader"], o = this.name + this._buildId + "_" + t, s.markAllAsDirty(), d = this._buildId), v.length = 0, e.fillDefines(v, t);
      const P = v.join(`
`);
      P !== u && (s.markAllAsDirty(), u = P);
      const p = this._processDefines(a, s);
      if (p) {
        An.RegisterShader(o, this._fragmentCompilationState._builtCompilationString), l = this.getScene().getEngine().createEffectForParticles(o, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, s.toString() + `
` + u, p == null ? void 0 : p.fallbacks, r, n, e), e.setCustomEffect(l, t), this._createEffectForParticles(e, t, r, n, l, s, a, f);
        return;
      }
      this._checkInternals(l);
    });
  }
  _checkInternals(e) {
    if (this._sharedData.animatedInputs) {
      const t = this.getScene(), r = t.getFrameId();
      if (this._animationFrame !== r) {
        for (const n of this._sharedData.animatedInputs)
          n.animate(t);
        this._animationFrame = r;
      }
    }
    for (const t of this._sharedData.bindableBlocks)
      t.bind(e, this);
    for (const t of this._sharedData.inputBlocks)
      t._transmit(e, this.getScene(), this);
  }
  /**
   * Create the effect to be used as the custom effect for a particle system
   * @param particleSystem Particle system to create the effect for
   * @param onCompiled defines a function to call when the effect creation is successful
   * @param onError defines a function to call when the effect creation has failed
   */
  createEffectForParticles(e, t, r) {
    if (this.mode !== Vv.Particle) {
      console.log("Incompatible material mode");
      return;
    }
    this._createEffectForParticles(e, N0.BLENDMODE_ONEONE, t, r), this._createEffectForParticles(e, N0.BLENDMODE_MULTIPLY, t, r);
  }
  /**
   * Use this material as the shadow depth wrapper of a target material
   * @param targetMaterial defines the target material
   */
  createAsShadowDepthWrapper(e) {
    if (this.mode !== Vv.Material) {
      console.log("Incompatible material mode");
      return;
    }
    e.shadowDepthWrapper = new BABYLON.ShadowDepthWrapper(this, this.getScene());
  }
  _processDefines(e, t, r = !1, n) {
    let i = null;
    const s = this.getScene();
    if (Ye.PrepareDefinesForCamera(s, t) && t.markAsMiscDirty(), this._sharedData.blocksWithDefines.forEach((a) => {
      a.initializeDefines(e, this, t, r);
    }), this._sharedData.blocksWithDefines.forEach((a) => {
      a.prepareDefines(e, this, t, r, n);
    }), t.isDirty) {
      const a = t._areLightsDisposed;
      t.markAsProcessed(), this._vertexCompilationState.compilationString = this._vertexCompilationState._builtCompilationString, this._fragmentCompilationState.compilationString = this._fragmentCompilationState._builtCompilationString, this._sharedData.repeatableContentBlocks.forEach((u) => {
        u.replaceRepeatableContent(this._vertexCompilationState, this._fragmentCompilationState, e, t);
      });
      const f = [];
      this._sharedData.dynamicUniformBlocks.forEach((u) => {
        u.updateUniformsAndSamples(this._vertexCompilationState, this, t, f);
      });
      const o = this._vertexCompilationState.uniforms;
      this._fragmentCompilationState.uniforms.forEach((u) => {
        o.indexOf(u) === -1 && o.push(u);
      });
      const d = this._vertexCompilationState.samplers;
      this._fragmentCompilationState.samplers.forEach((u) => {
        d.indexOf(u) === -1 && d.push(u);
      });
      const v = new c1();
      this._sharedData.blocksWithFallbacks.forEach((u) => {
        u.provideFallbacks(e, v);
      }), i = {
        lightDisposed: a,
        uniformBuffers: f,
        mergedUniforms: o,
        mergedSamplers: d,
        fallbacks: v
      };
    }
    return i;
  }
  /**
   * Get if the submesh is ready to be used and all its information available.
   * Child classes can use it to update shaders
   * @param mesh defines the mesh to check
   * @param subMesh defines which submesh to check
   * @param useInstances specifies that instances should be used
   * @returns a boolean indicating that the submesh is ready or not
   */
  isReadyForSubMesh(e, t, r = !1) {
    if (!this._buildWasSuccessful)
      return !1;
    const n = this.getScene();
    if (this._sharedData.animatedInputs) {
      const f = n.getFrameId();
      if (this._animationFrame !== f) {
        for (const o of this._sharedData.animatedInputs)
          o.animate(n);
        this._animationFrame = f;
      }
    }
    if (t.effect && this.isFrozen && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new HI());
    const i = t.materialDefines;
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = n.getEngine();
    if (this._prepareDefinesForAttributes(e, i), this._sharedData.blockingBlocks.some((f) => !f.isReady(e, this, i, r)))
      return !1;
    const a = this._processDefines(e, i, r, t);
    if (a) {
      const f = t.effect, o = i.toString();
      let d = s.createEffect({
        vertex: "nodeMaterial" + this._buildId,
        fragment: "nodeMaterial" + this._buildId,
        vertexSource: this._vertexCompilationState.compilationString,
        fragmentSource: this._fragmentCompilationState.compilationString
      }, {
        attributes: this._vertexCompilationState.attributes,
        uniformsNames: a.mergedUniforms,
        uniformBuffersNames: a.uniformBuffers,
        samplers: a.mergedSamplers,
        defines: o,
        fallbacks: a.fallbacks,
        onCompiled: this.onCompiled,
        onError: this.onError,
        multiTarget: i.PREPASS,
        indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights, maxSimultaneousMorphTargets: i.NUM_MORPH_INFLUENCERS }
      }, s);
      if (d)
        if (this._onEffectCreatedObservable && (XE.effect = d, XE.subMesh = t, this._onEffectCreatedObservable.notifyObservers(XE)), this.allowShaderHotSwapping && f && !d.isReady()) {
          if (d = f, i.markAsUnprocessed(), a.lightDisposed)
            return i._areLightsDisposed = !0, !1;
        } else
          n.resetCachedMaterial(), t.setEffect(d, i, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (i._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = r, this._checkScenePerformancePriority(), !0);
  }
  /**
   * Get a string representing the shaders built by the current node graph
   */
  get compiledShaders() {
    return `// Vertex shader
${this._vertexCompilationState.compilationString}

// Fragment shader
${this._fragmentCompilationState.compilationString}`;
  }
  /**
   * Binds the world matrix to the material
   * @param world defines the world transformation matrix
   */
  bindOnlyWorldMatrix(e) {
    const t = this.getScene();
    if (!this._activeEffect)
      return;
    const r = this._sharedData.hints;
    r.needWorldViewMatrix && e.multiplyToRef(t.getViewMatrix(), this._cachedWorldViewMatrix), r.needWorldViewProjectionMatrix && e.multiplyToRef(t.getTransformMatrix(), this._cachedWorldViewProjectionMatrix);
    for (const n of this._sharedData.inputBlocks)
      n._transmitWorld(this._activeEffect, e, this._cachedWorldViewMatrix, this._cachedWorldViewProjectionMatrix);
  }
  /**
   * Binds the submesh to this material by preparing the effect and shader to draw
   * @param world defines the world transformation matrix
   * @param mesh defines the mesh containing the submesh
   * @param subMesh defines the submesh to bind the material to
   */
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.effect;
    if (!i)
      return;
    this._activeEffect = i, this.bindOnlyWorldMatrix(e);
    const s = this._mustRebind(n, i, t.visibility), a = this._sharedData;
    if (s) {
      for (const f of a.bindableBlocks)
        f.bind(i, this, t, r);
      for (const f of a.forcedBindableBlocks)
        f.bind(i, this, t, r);
      for (const f of a.inputBlocks)
        f._transmit(i, n, this);
    } else if (!this.isFrozen)
      for (const f of a.forcedBindableBlocks)
        f.bind(i, this, t, r);
    this._afterBind(t, this._activeEffect);
  }
  /**
   * Gets the active textures from the material
   * @returns an array of textures
   */
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._sharedData && e.push(...this._sharedData.textureBlocks.filter((t) => t.texture).map((t) => t.texture)), e;
  }
  /**
   * Gets the list of texture blocks
   * Note that this method will only return blocks that are reachable from the final block(s) and only after the material has been built!
   * @returns an array of texture blocks
   */
  getTextureBlocks() {
    return this._sharedData ? this._sharedData.textureBlocks : [];
  }
  /**
   * Gets the list of all texture blocks
   * Note that this method will scan all attachedBlocks and return blocks that are texture blocks
   * @returns
   */
  getAllTextureBlocks() {
    const e = [];
    for (const t of this.attachedBlocks)
      ja._BlockIsTextureBlock(t) && e.push(t);
    return e;
  }
  /**
   * Specifies if the material uses a texture
   * @param texture defines the texture to check against the material
   * @returns a boolean specifying if the material uses the texture
   */
  hasTexture(e) {
    if (super.hasTexture(e))
      return !0;
    if (!this._sharedData)
      return !1;
    for (const t of this._sharedData.textureBlocks)
      if (t.texture === e)
        return !0;
    return !1;
  }
  /**
   * Disposes the material
   * @param forceDisposeEffect specifies if effects should be forcefully disposed
   * @param forceDisposeTextures specifies if textures should be forcefully disposed
   * @param notBoundToMesh specifies if the material that is being disposed is known to be not bound to any mesh
   */
  dispose(e, t, r) {
    if (t)
      for (const n of this.getTextureBlocks().filter((i) => i.texture).map((i) => i.texture))
        n.dispose();
    for (const n of this.attachedBlocks)
      n.dispose();
    this.attachedBlocks.length = 0, this._sharedData = null, this._vertexCompilationState = null, this._fragmentCompilationState = null, this.onBuildObservable.clear(), this._imageProcessingObserver && (this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingObserver = null), super.dispose(e, t, r);
  }
  /** Creates the node editor window. */
  _createNodeEditor(e) {
    const t = Object.assign({ nodeMaterial: this }, e);
    this.BJSNODEMATERIALEDITOR.NodeEditor.Show(t);
  }
  /**
   * Launch the node material editor
   * @param config Define the configuration of the editor
   * @returns a promise fulfilled when the node editor is visible
   */
  edit(e) {
    return new Promise((t) => {
      if (this.BJSNODEMATERIALEDITOR = this.BJSNODEMATERIALEDITOR || this._getGlobalNodeMaterialEditor(), typeof this.BJSNODEMATERIALEDITOR > "u") {
        const r = e && e.editorURL ? e.editorURL : ja.EditorURL;
        ye.LoadBabylonScript(r, () => {
          this.BJSNODEMATERIALEDITOR = this.BJSNODEMATERIALEDITOR || this._getGlobalNodeMaterialEditor(), this._createNodeEditor(e == null ? void 0 : e.nodeEditorConfig), t();
        });
      } else
        this._createNodeEditor(e == null ? void 0 : e.nodeEditorConfig), t();
    });
  }
  /**
   * Clear the current material
   */
  clear() {
    this._vertexOutputNodes.length = 0, this._fragmentOutputNodes.length = 0, this.attachedBlocks.length = 0;
  }
  /**
   * Clear the current material and set it to a default state
   */
  setToDefault() {
    this.clear(), this.editorData = null;
    const e = new gi("Position");
    e.setAsAttribute("position");
    const t = new gi("World");
    t.setAsSystemValue(Bi.World);
    const r = new JC("WorldPos");
    e.connectTo(r), t.connectTo(r);
    const n = new gi("ViewProjection");
    n.setAsSystemValue(Bi.ViewProjection);
    const i = new JC("WorldPos * ViewProjectionTransform");
    r.connectTo(i), n.connectTo(i);
    const s = new mI("VertexOutput");
    i.connectTo(s);
    const a = new gi("color");
    a.value = new xt(0.8, 0.8, 0.8, 1);
    const f = new iq("FragmentOutput");
    a.connectTo(f), this.addOutputNode(s), this.addOutputNode(f), this._mode = Vv.Material;
  }
  /**
   * Clear the current material and set it to a default state for post process
   */
  setToDefaultPostProcess() {
    this.clear(), this.editorData = null;
    const e = new gi("Position");
    e.setAsAttribute("position2d");
    const t = new gi("Constant1");
    t.isConstant = !0, t.value = 1;
    const r = new BI("Position3D");
    e.connectTo(r), t.connectTo(r, { input: "w" });
    const n = new mI("VertexOutput");
    r.connectTo(n);
    const i = new gi("Scale");
    i.visibleInInspector = !0, i.value = new at(1, 1);
    const s = new jR("uv0");
    e.connectTo(s);
    const a = new zC("UV scale");
    s.connectTo(a), i.connectTo(a);
    const f = new oQ("CurrentScreen");
    a.connectTo(f), f.texture = new We("https://assets.babylonjs.com/nme/currentScreenPostProcess.png", this.getScene());
    const o = new iq("FragmentOutput");
    f.connectTo(o, { output: "rgba" }), this.addOutputNode(n), this.addOutputNode(o), this._mode = Vv.PostProcess;
  }
  /**
   * Clear the current material and set it to a default state for procedural texture
   */
  setToDefaultProceduralTexture() {
    this.clear(), this.editorData = null;
    const e = new gi("Position");
    e.setAsAttribute("position2d");
    const t = new gi("Constant1");
    t.isConstant = !0, t.value = 1;
    const r = new BI("Position3D");
    e.connectTo(r), t.connectTo(r, { input: "w" });
    const n = new mI("VertexOutput");
    r.connectTo(n);
    const i = new gi("Time");
    i.value = 0, i.min = 0, i.max = 0, i.isBoolean = !1, i.matrixMode = 0, i.animationType = tq.Time, i.isConstant = !1;
    const s = new gi("Color3");
    s.value = new Ne(1, 1, 1), s.isConstant = !1;
    const a = new iq("FragmentOutput"), f = new BI("VectorMerger");
    f.visibleInInspector = !1;
    const o = new uQ("Cos");
    o.operation = o9.Cos, e.connectTo(f), i.output.connectTo(o.input), o.output.connectTo(f.z), f.xyzOut.connectTo(a.rgb), this.addOutputNode(n), this.addOutputNode(a), this._mode = Vv.ProceduralTexture;
  }
  /**
   * Clear the current material and set it to a default state for particle
   */
  setToDefaultParticle() {
    this.clear(), this.editorData = null;
    const e = new gi("uv");
    e.setAsAttribute("particle_uv");
    const t = new fQ("ParticleTexture");
    e.connectTo(t);
    const r = new gi("Color");
    r.setAsAttribute("particle_color");
    const n = new zC("Texture * Color");
    t.connectTo(n), r.connectTo(n);
    const i = new AQ("ParticleRampGradient");
    n.connectTo(i);
    const s = new vQ("ColorSplitter");
    r.connectTo(s);
    const a = new dQ("ParticleBlendMultiply");
    i.connectTo(a), t.connectTo(a, { output: "a" }), s.connectTo(a, { output: "a" });
    const f = new iq("FragmentOutput");
    a.connectTo(f), this.addOutputNode(f), this._mode = Vv.Particle;
  }
  /**
   * Loads the current Node Material from a url pointing to a file save by the Node Material Editor
   * @deprecated Please use NodeMaterial.ParseFromFileAsync instead
   * @param url defines the url to load from
   * @param rootUrl defines the root URL for nested url in the node material
   * @returns a promise that will fulfil when the material is fully loaded
   */
  async loadAsync(e, t = "") {
    return ja.ParseFromFileAsync("", e, this.getScene(), t, !0, this);
  }
  _gatherBlocks(e, t) {
    if (t.indexOf(e) === -1) {
      t.push(e);
      for (const r of e.inputs) {
        const n = r.connectedPoint;
        if (n) {
          const i = n.ownerBlock;
          i !== e && this._gatherBlocks(i, t);
        }
      }
      if (e.isTeleportOut) {
        const r = e;
        r.entryPoint && this._gatherBlocks(r.entryPoint, t);
      }
    }
  }
  /**
   * Generate a string containing the code declaration required to create an equivalent of this material
   * @returns a string
   */
  generateCode() {
    let e = [];
    const t = [], r = ["const", "var", "let"];
    for (const s of this._vertexOutputNodes)
      this._gatherBlocks(s, t);
    const n = [];
    for (const s of this._fragmentOutputNodes)
      this._gatherBlocks(s, n);
    let i = `var nodeMaterial = new BABYLON.NodeMaterial("${this.name || "node material"}");
`;
    i += `nodeMaterial.mode = BABYLON.NodeMaterialModes.${Vv[this.mode]};
`;
    for (const s of t)
      s.isInput && e.indexOf(s) === -1 && (i += s._dumpCode(r, e));
    for (const s of n)
      s.isInput && e.indexOf(s) === -1 && (i += s._dumpCode(r, e));
    e = [], i += `
// Connections
`;
    for (const s of this._vertexOutputNodes)
      i += s._dumpCodeForOutputConnections(e);
    for (const s of this._fragmentOutputNodes)
      i += s._dumpCodeForOutputConnections(e);
    i += `
// Output nodes
`;
    for (const s of this._vertexOutputNodes)
      i += `nodeMaterial.addOutputNode(${s._codeVariableName});
`;
    for (const s of this._fragmentOutputNodes)
      i += `nodeMaterial.addOutputNode(${s._codeVariableName});
`;
    return i += `nodeMaterial.build();
`, i;
  }
  /**
   * Serializes this material in a JSON representation
   * @param selectedBlocks
   * @returns the serialized material object
   */
  serialize(e) {
    const t = e ? {} : jt.Serialize(this);
    t.editorData = JSON.parse(JSON.stringify(this.editorData));
    let r = [];
    if (e)
      r = e;
    else {
      t.customType = "BABYLON.NodeMaterial", t.outputNodes = [];
      for (const n of this._vertexOutputNodes)
        this._gatherBlocks(n, r), t.outputNodes.push(n.uniqueId);
      for (const n of this._fragmentOutputNodes)
        this._gatherBlocks(n, r), t.outputNodes.indexOf(n.uniqueId) === -1 && t.outputNodes.push(n.uniqueId);
    }
    t.blocks = [];
    for (const n of r)
      t.blocks.push(n.serialize());
    if (!e)
      for (const n of this.attachedBlocks)
        r.indexOf(n) === -1 && t.blocks.push(n.serialize());
    return t;
  }
  _restoreConnections(e, t, r) {
    for (const n of e.outputs)
      for (const i of t.blocks) {
        const s = r[i.id];
        if (s) {
          for (const a of i.inputs)
            if (r[a.targetBlockId] === e && a.targetConnectionName === n.name) {
              const f = s.getInputByName(a.inputName);
              if (!f || f.isConnected)
                continue;
              n.connectTo(f, !0), this._restoreConnections(s, t, r);
              continue;
            }
        }
      }
  }
  /**
   * Clear the current graph and load a new one from a serialization object
   * @param source defines the JSON representation of the material
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @param merge defines whether or not the source must be merged or replace the current content
   */
  parseSerializedObject(e, t = "", r = !1) {
    var n;
    r || this.clear();
    const i = {};
    for (const s of e.blocks) {
      const a = Jo(s.customType);
      if (a) {
        const f = new a();
        f._deserialize(s, this.getScene(), t), i[s.id] = f, this.attachedBlocks.push(f);
      }
    }
    for (const s of this.attachedBlocks)
      if (s.isTeleportOut) {
        const a = s, f = a._tempEntryPointUniqueId;
        f && i[f].attachToEndpoint(a);
      }
    for (let s = 0; s < e.blocks.length; s++) {
      const a = e.blocks[s], f = i[a.id];
      f && (f.inputs.length && !r || this._restoreConnections(f, e, i));
    }
    if (e.outputNodes)
      for (const s of e.outputNodes)
        this.addOutputNode(i[s]);
    if (e.locations || e.editorData && e.editorData.locations) {
      const s = e.locations || e.editorData.locations;
      for (const f of s)
        i[f.blockId] && (f.blockId = i[f.blockId].uniqueId);
      r && this.editorData && this.editorData.locations && s.concat(this.editorData.locations), e.locations ? this.editorData = {
        locations: s
      } : (this.editorData = e.editorData, this.editorData.locations = s);
      const a = [];
      for (const f in i)
        a[f] = i[f].uniqueId;
      this.editorData.map = a;
    }
    this.comment = e.comment, e.forceAlphaBlending !== void 0 && (this.forceAlphaBlending = e.forceAlphaBlending), r || (this._mode = (n = e.mode) !== null && n !== void 0 ? n : Vv.Material);
  }
  /**
   * Clear the current graph and load a new one from a serialization object
   * @param source defines the JSON representation of the material
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @param merge defines whether or not the source must be merged or replace the current content
   * @deprecated Please use the parseSerializedObject method instead
   */
  loadFromSerialization(e, t = "", r = !1) {
    this.parseSerializedObject(e, t, r);
  }
  /**
   * Makes a duplicate of the current material.
   * @param name defines the name to use for the new material
   * @param shareEffect defines if the clone material should share the same effect (default is false)
   */
  clone(e, t = !1) {
    const r = this.serialize(), n = jt.Clone(() => new ja(e, this.getScene(), this.options), this);
    return n.id = e, n.name = e, n.parseSerializedObject(r), n._buildId = this._buildId, n.build(!1, !t), n;
  }
  /**
   * Awaits for all the material textures to be ready before resolving the returned promise.
   */
  whenTexturesReadyAsync() {
    const e = [];
    return this.getActiveTextures().forEach((t) => {
      const r = t.getInternalTexture();
      r && !r.isReady && e.push(new Promise((n, i) => {
        r.onLoadedObservable.addOnce(() => {
          n();
        }), r.onErrorObservable.addOnce((s) => {
          i(s);
        });
      }));
    }), Promise.all(e);
  }
  /**
   * Creates a node material from parsed material data
   * @param source defines the JSON representation of the material
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a new node material
   */
  static Parse(e, t, r = "") {
    const n = jt.Parse(() => new ja(e.name, t), e, t, r);
    return n.parseSerializedObject(e, r), n.build(), n;
  }
  /**
   * Creates a node material from a snippet saved in a remote file
   * @param name defines the name of the material to create
   * @param url defines the url to load from
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL for nested url in the node material
   * @param skipBuild defines whether to build the node material
   * @param targetMaterial defines a material to use instead of creating a new one
   * @returns a promise that will resolve to the new node material
   */
  static async ParseFromFileAsync(e, t, r, n = "", i = !1, s) {
    const a = s ?? new ja(e, r), f = await r._loadFileAsync(t), o = JSON.parse(f);
    return a.parseSerializedObject(o, n), i || a.build(), a;
  }
  /**
   * Creates a node material from a snippet saved by the node material editor
   * @param snippetId defines the snippet to load
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @param nodeMaterial defines a node material to update (instead of creating a new one)
   * @param skipBuild defines whether to build the node material
   * @param waitForTextureReadyness defines whether to wait for texture readiness resolving the promise (default: false)
   * @returns a promise that will resolve to the new node material
   */
  static ParseFromSnippetAsync(e, t = gr.LastCreatedScene, r = "", n, i = !1, s = !1) {
    return e === "_BLANK" ? Promise.resolve(ja.CreateDefault("blank", t)) : new Promise((a, f) => {
      const o = new ho();
      o.addEventListener("readystatechange", () => {
        if (o.readyState == 4)
          if (o.status == 200) {
            const d = JSON.parse(JSON.parse(o.responseText).jsonPayload), v = JSON.parse(d.nodeMaterial);
            n || (n = jt.Parse(() => new ja(e, t), v, t, r), n.uniqueId = t.getUniqueId()), n.parseSerializedObject(v), n.snippetId = e;
            try {
              i || n.build();
            } catch (u) {
              f(u);
            }
            s ? n.whenTexturesReadyAsync().then(() => {
              a(n);
            }).catch((u) => {
              f(u);
            }) : a(n);
          } else
            f("Unable to load the snippet " + e);
      }), o.open("GET", this.SnippetUrl + "/" + e.replace(/#/g, "/")), o.send();
    });
  }
  /**
   * Creates a new node material set to default basic configuration
   * @param name defines the name of the material
   * @param scene defines the hosting scene
   * @returns a new NodeMaterial
   */
  static CreateDefault(e, t) {
    const r = new ja(e, t);
    return r.setToDefault(), r.build(), r;
  }
}
ja._BuildIdGenerator = 0;
ja.EditorURL = `${ye._DefaultCdnUrl}/v${Ge.Version}/nodeEditor/babylon.nodeEditor.js`;
ja.SnippetUrl = "https://snippet.babylonjs.com";
ja.IgnoreTexturesAtLoadTime = !1;
C([
  M()
], ja.prototype, "ignoreAlpha", void 0);
C([
  M()
], ja.prototype, "maxSimultaneousLights", void 0);
C([
  M("mode")
], ja.prototype, "_mode", void 0);
C([
  M("comment")
], ja.prototype, "comment", void 0);
C([
  M()
], ja.prototype, "forceAlphaBlending", void 0);
Ue("BABYLON.NodeMaterial", ja);
function RO(A) {
  const e = A.sideOrientation || Ut.DEFAULTSIDE, t = A.radius || 1, r = A.flat === void 0 ? !0 : A.flat, n = (A.subdivisions || 4) | 0, i = A.radiusX || t, s = A.radiusY || t, a = A.radiusZ || t, f = (1 + Math.sqrt(5)) / 2, o = [
    -1,
    f,
    -0,
    1,
    f,
    0,
    -1,
    -f,
    0,
    1,
    -f,
    0,
    0,
    -1,
    -f,
    0,
    1,
    -f,
    0,
    -1,
    f,
    0,
    1,
    f,
    f,
    0,
    1,
    f,
    0,
    -1,
    -f,
    0,
    1,
    -f,
    0,
    -1
    // v8-11
  ], d = [
    0,
    11,
    5,
    0,
    5,
    1,
    0,
    1,
    7,
    0,
    7,
    10,
    12,
    22,
    23,
    1,
    5,
    20,
    5,
    11,
    4,
    23,
    22,
    13,
    22,
    18,
    6,
    7,
    1,
    8,
    14,
    21,
    4,
    14,
    4,
    2,
    16,
    13,
    6,
    15,
    6,
    19,
    3,
    8,
    9,
    4,
    21,
    5,
    13,
    17,
    23,
    6,
    13,
    22,
    19,
    6,
    18,
    9,
    8,
    1
  ], v = [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    // vertex alias
    0,
    2,
    3,
    3,
    3,
    4,
    7,
    8,
    9,
    9,
    10,
    11
    // 23: B + 12
  ], u = [
    5,
    1,
    3,
    1,
    6,
    4,
    0,
    0,
    5,
    3,
    4,
    2,
    2,
    2,
    4,
    0,
    2,
    0,
    1,
    1,
    6,
    0,
    6,
    2,
    // vertex alias (for same vertex on different faces)
    0,
    4,
    3,
    3,
    4,
    4,
    3,
    1,
    4,
    2,
    4,
    4,
    0,
    2,
    1,
    1,
    2,
    2,
    3,
    3,
    1,
    3,
    2,
    4
    // 23: B + 12
  ], l = 138 / 1024, P = 239 / 1024, p = 60 / 1024, c = 26 / 1024, H = -40 / 1024, T = 20 / 1024, q = [
    0,
    0,
    0,
    0,
    1,
    0,
    0,
    1,
    1,
    0,
    0,
    0,
    1,
    1,
    0,
    0,
    1,
    1,
    1,
    0
    //  15 - 19
  ], b = [], j = [], w = [], m = [];
  let I = 0;
  const N = new Array(3), k = new Array(3);
  let R;
  for (R = 0; R < 3; R++)
    N[R] = S.Zero(), k[R] = at.Zero();
  for (let O = 0; O < 20; O++) {
    for (R = 0; R < 3; R++) {
      const ee = d[3 * O + R];
      N[R].copyFromFloats(o[3 * v[ee]], o[3 * v[ee] + 1], o[3 * v[ee] + 2]), N[R].normalize(), k[R].copyFromFloats(u[2 * ee] * l + p + q[O] * H, u[2 * ee + 1] * P + c + q[O] * T);
    }
    const Y = (ee, Z, te, fe) => {
      const _ = S.Lerp(N[0], N[2], Z / n), G = S.Lerp(N[1], N[2], Z / n), L = n === Z ? N[2] : S.Lerp(_, G, ee / (n - Z));
      L.normalize();
      let $;
      if (r) {
        const me = S.Lerp(N[0], N[2], fe / n), Xe = S.Lerp(N[1], N[2], fe / n);
        $ = S.Lerp(me, Xe, te / (n - fe));
      } else
        $ = new S(L.x, L.y, L.z);
      $.x /= i, $.y /= s, $.z /= a, $.normalize();
      const ae = at.Lerp(k[0], k[2], Z / n), Pe = at.Lerp(k[1], k[2], Z / n), ge = n === Z ? k[2] : at.Lerp(ae, Pe, ee / (n - Z));
      j.push(L.x * i, L.y * s, L.z * a), w.push($.x, $.y, $.z), m.push(ge.x, us.UseOpenGLOrientationForUV ? 1 - ge.y : ge.y), b.push(I), I++;
    };
    for (let ee = 0; ee < n; ee++)
      for (let Z = 0; Z + ee < n; Z++)
        Y(Z, ee, Z + 1 / 3, ee + 1 / 3), Y(Z + 1, ee, Z + 1 / 3, ee + 1 / 3), Y(Z, ee + 1, Z + 1 / 3, ee + 1 / 3), Z + ee + 1 < n && (Y(Z + 1, ee, Z + 2 / 3, ee + 2 / 3), Y(Z + 1, ee + 1, Z + 2 / 3, ee + 2 / 3), Y(Z, ee + 1, Z + 2 / 3, ee + 2 / 3));
  }
  Ut._ComputeSides(e, j, b, w, m, A.frontUVs, A.backUVs);
  const y = new Ut();
  return y.indices = b, y.positions = j, y.normals = w, y.uvs = m, y;
}
function UR(A, e = {}, t = null) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, RO(e).applyToMesh(r, e.updatable), r;
}
const y6e = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateIcoSphere: UR
};
Ut.CreateIcoSphere = RO;
Ee.CreateIcoSphere = (A, e, t) => UR(A, e, t);
var J8;
(function(A) {
  A.WRIST = "wrist", A.THUMB = "thumb", A.INDEX = "index", A.MIDDLE = "middle", A.RING = "ring", A.LITTLE = "little";
})(J8 || (J8 = {}));
var gn;
(function(A) {
  A.WRIST = "wrist", A.THUMB_METACARPAL = "thumb-metacarpal", A.THUMB_PHALANX_PROXIMAL = "thumb-phalanx-proximal", A.THUMB_PHALANX_DISTAL = "thumb-phalanx-distal", A.THUMB_TIP = "thumb-tip", A.INDEX_FINGER_METACARPAL = "index-finger-metacarpal", A.INDEX_FINGER_PHALANX_PROXIMAL = "index-finger-phalanx-proximal", A.INDEX_FINGER_PHALANX_INTERMEDIATE = "index-finger-phalanx-intermediate", A.INDEX_FINGER_PHALANX_DISTAL = "index-finger-phalanx-distal", A.INDEX_FINGER_TIP = "index-finger-tip", A.MIDDLE_FINGER_METACARPAL = "middle-finger-metacarpal", A.MIDDLE_FINGER_PHALANX_PROXIMAL = "middle-finger-phalanx-proximal", A.MIDDLE_FINGER_PHALANX_INTERMEDIATE = "middle-finger-phalanx-intermediate", A.MIDDLE_FINGER_PHALANX_DISTAL = "middle-finger-phalanx-distal", A.MIDDLE_FINGER_TIP = "middle-finger-tip", A.RING_FINGER_METACARPAL = "ring-finger-metacarpal", A.RING_FINGER_PHALANX_PROXIMAL = "ring-finger-phalanx-proximal", A.RING_FINGER_PHALANX_INTERMEDIATE = "ring-finger-phalanx-intermediate", A.RING_FINGER_PHALANX_DISTAL = "ring-finger-phalanx-distal", A.RING_FINGER_TIP = "ring-finger-tip", A.PINKY_FINGER_METACARPAL = "pinky-finger-metacarpal", A.PINKY_FINGER_PHALANX_PROXIMAL = "pinky-finger-phalanx-proximal", A.PINKY_FINGER_PHALANX_INTERMEDIATE = "pinky-finger-phalanx-intermediate", A.PINKY_FINGER_PHALANX_DISTAL = "pinky-finger-phalanx-distal", A.PINKY_FINGER_TIP = "pinky-finger-tip";
})(gn || (gn = {}));
const NH = [
  gn.WRIST,
  gn.THUMB_METACARPAL,
  gn.THUMB_PHALANX_PROXIMAL,
  gn.THUMB_PHALANX_DISTAL,
  gn.THUMB_TIP,
  gn.INDEX_FINGER_METACARPAL,
  gn.INDEX_FINGER_PHALANX_PROXIMAL,
  gn.INDEX_FINGER_PHALANX_INTERMEDIATE,
  gn.INDEX_FINGER_PHALANX_DISTAL,
  gn.INDEX_FINGER_TIP,
  gn.MIDDLE_FINGER_METACARPAL,
  gn.MIDDLE_FINGER_PHALANX_PROXIMAL,
  gn.MIDDLE_FINGER_PHALANX_INTERMEDIATE,
  gn.MIDDLE_FINGER_PHALANX_DISTAL,
  gn.MIDDLE_FINGER_TIP,
  gn.RING_FINGER_METACARPAL,
  gn.RING_FINGER_PHALANX_PROXIMAL,
  gn.RING_FINGER_PHALANX_INTERMEDIATE,
  gn.RING_FINGER_PHALANX_DISTAL,
  gn.RING_FINGER_TIP,
  gn.PINKY_FINGER_METACARPAL,
  gn.PINKY_FINGER_PHALANX_PROXIMAL,
  gn.PINKY_FINGER_PHALANX_INTERMEDIATE,
  gn.PINKY_FINGER_PHALANX_DISTAL,
  gn.PINKY_FINGER_TIP
], k6e = {
  [J8.WRIST]: [gn.WRIST],
  [J8.THUMB]: [gn.THUMB_METACARPAL, gn.THUMB_PHALANX_PROXIMAL, gn.THUMB_PHALANX_DISTAL, gn.THUMB_TIP],
  [J8.INDEX]: [
    gn.INDEX_FINGER_METACARPAL,
    gn.INDEX_FINGER_PHALANX_PROXIMAL,
    gn.INDEX_FINGER_PHALANX_INTERMEDIATE,
    gn.INDEX_FINGER_PHALANX_DISTAL,
    gn.INDEX_FINGER_TIP
  ],
  [J8.MIDDLE]: [
    gn.MIDDLE_FINGER_METACARPAL,
    gn.MIDDLE_FINGER_PHALANX_PROXIMAL,
    gn.MIDDLE_FINGER_PHALANX_INTERMEDIATE,
    gn.MIDDLE_FINGER_PHALANX_DISTAL,
    gn.MIDDLE_FINGER_TIP
  ],
  [J8.RING]: [
    gn.RING_FINGER_METACARPAL,
    gn.RING_FINGER_PHALANX_PROXIMAL,
    gn.RING_FINGER_PHALANX_INTERMEDIATE,
    gn.RING_FINGER_PHALANX_DISTAL,
    gn.RING_FINGER_TIP
  ],
  [J8.LITTLE]: [
    gn.PINKY_FINGER_METACARPAL,
    gn.PINKY_FINGER_PHALANX_PROXIMAL,
    gn.PINKY_FINGER_PHALANX_INTERMEDIATE,
    gn.PINKY_FINGER_PHALANX_DISTAL,
    gn.PINKY_FINGER_TIP
  ]
};
class qee {
  /**
   * Get the hand mesh.
   */
  get handMesh() {
    return this._handMesh;
  }
  /**
   * Get meshes of part of the hand.
   * @param part The part of hand to get.
   * @returns An array of meshes that correlate to the hand part requested.
   */
  getHandPartMeshes(e) {
    return k6e[e].map((t) => this._jointMeshes[NH.indexOf(t)]);
  }
  /**
   * Retrieves a mesh linked to a named joint in the hand.
   * @param jointName The name of the joint.
   * @returns An AbstractMesh whose position corresponds with the joint position.
   */
  getJointMesh(e) {
    return this._jointMeshes[NH.indexOf(e)];
  }
  /**
   * Construct a new hand object
   * @param xrController The controller to which the hand correlates.
   * @param _jointMeshes The meshes to be used to track the hand joints.
   * @param _handMesh An optional hand mesh.
   * @param rigMapping An optional rig mapping for the hand mesh.
   *                   If not provided (but a hand mesh is provided),
   *                   it will be assumed that the hand mesh's bones are named
   *                   directly after the WebXR bone names.
   * @param _leftHandedMeshes Are the hand meshes left-handed-system meshes
   * @param _jointsInvisible Are the tracked joint meshes visible
   * @param _jointScaleFactor Scale factor for all joint meshes
   */
  constructor(e, t, r, n, i = !1, s = !1, a = 1) {
    this.xrController = e, this._jointMeshes = t, this._handMesh = r, this.rigMapping = n, this._leftHandedMeshes = i, this._jointsInvisible = s, this._jointScaleFactor = a, this._jointTransforms = new Array(NH.length), this._jointTransformMatrices = new Float32Array(NH.length * 16), this._tempJointMatrix = new he(), this._jointRadii = new Float32Array(NH.length), this._scene = t[0].getScene();
    for (let f = 0; f < this._jointTransforms.length; f++) {
      const o = this._jointTransforms[f] = new Hr(NH[f], this._scene);
      o.rotationQuaternion = new Ze(), t[f].rotationQuaternion = new Ze();
    }
    r && this.setHandMesh(r, n), this.xrController.motionController && (this.xrController.motionController.rootMesh ? this.xrController.motionController.rootMesh.setEnabled(!1) : this.xrController.motionController.onModelLoadedObservable.add((f) => {
      f.rootMesh && f.rootMesh.setEnabled(!1);
    })), this.xrController.onMotionControllerInitObservable.add((f) => {
      f.onModelLoadedObservable.add((o) => {
        o.rootMesh && o.rootMesh.setEnabled(!1);
      }), f.rootMesh && f.rootMesh.setEnabled(!1);
    });
  }
  /**
   * Sets the current hand mesh to render for the WebXRHand.
   * @param handMesh The rigged hand mesh that will be tracked to the user's hand.
   * @param rigMapping The mapping from XRHandJoint to bone names to use with the mesh.
   */
  setHandMesh(e, t) {
    if (this._handMesh = e, e.alwaysSelectAsActiveMesh = !0, e.getChildMeshes().forEach((r) => r.alwaysSelectAsActiveMesh = !0), this._handMesh.skeleton) {
      const r = this._handMesh.skeleton;
      NH.forEach((n, i) => {
        const s = r.getBoneIndexByName(t ? t[n] : n);
        s !== -1 && r.bones[s].linkTransformNode(this._jointTransforms[i]);
      });
    }
  }
  /**
   * Update this hand from the latest xr frame.
   * @param xrFrame The latest frame received from WebXR.
   * @param referenceSpace The current viewer reference space.
   */
  updateFromXRFrame(e, t) {
    const r = this.xrController.inputSource.hand;
    if (!r)
      return;
    const n = r, i = NH.map((a) => n[a] || r.get(a));
    let s = !1;
    if (e.fillPoses && e.fillJointRadii)
      s = e.fillPoses(i, t, this._jointTransformMatrices) && e.fillJointRadii(i, this._jointRadii);
    else if (e.getJointPose) {
      s = !0;
      for (let a = 0; a < i.length; a++) {
        const f = e.getJointPose(i[a], t);
        if (f)
          this._jointTransformMatrices.set(f.transform.matrix, a * 16), this._jointRadii[a] = f.radius || 8e-3;
        else {
          s = !1;
          break;
        }
      }
    }
    s && (NH.forEach((a, f) => {
      const o = this._jointTransforms[f];
      he.FromArrayToRef(this._jointTransformMatrices, f * 16, this._tempJointMatrix), this._tempJointMatrix.decompose(void 0, o.rotationQuaternion, o.position);
      const d = this._jointRadii[f] * this._jointScaleFactor, v = this._jointMeshes[f];
      v.isVisible = !this._handMesh && !this._jointsInvisible, v.position.copyFrom(o.position), v.rotationQuaternion.copyFrom(o.rotationQuaternion), v.scaling.setAll(d), this._scene.useRightHandedSystem || (v.position.z *= -1, v.rotationQuaternion.z *= -1, v.rotationQuaternion.w *= -1, this._leftHandedMeshes && this._handMesh && (o.position.z *= -1, o.rotationQuaternion.z *= -1, o.rotationQuaternion.w *= -1));
    }), this._handMesh && (this._handMesh.isVisible = !0));
  }
  /**
   * Dispose this Hand object
   */
  dispose() {
    this._handMesh && (this._handMesh.isVisible = !1);
  }
}
class va extends L9 {
  static _GenerateTrackedJointMeshes(e) {
    const t = {};
    return ["left", "right"].map((r) => {
      var n, i, s, a, f;
      const o = [], d = ((n = e.jointMeshes) === null || n === void 0 ? void 0 : n.sourceMesh) || UR("jointParent", va._ICOSPHERE_PARAMS);
      d.isVisible = !!(!((i = e.jointMeshes) === null || i === void 0) && i.keepOriginalVisible);
      for (let v = 0; v < NH.length; ++v) {
        let u = d.createInstance(`${r}-handJoint-${v}`);
        if (!((s = e.jointMeshes) === null || s === void 0) && s.onHandJointMeshGenerated) {
          const l = e.jointMeshes.onHandJointMeshGenerated(u, v, r);
          l && l !== u && (u.dispose(), u = l);
        }
        if (u.isPickable = !1, !((a = e.jointMeshes) === null || a === void 0) && a.enablePhysics) {
          const l = ((f = e.jointMeshes) === null || f === void 0 ? void 0 : f.physicsProps) || {};
          u.scaling.setAll(0.02);
          const P = l.impostorType !== void 0 ? l.impostorType : tn.SphereImpostor;
          u.physicsImpostor = new tn(u, P, Object.assign({ mass: 0 }, l));
        }
        u.rotationQuaternion = new Ze(), u.isVisible = !1, o.push(u);
      }
      t[r] = o;
    }), { left: t.left, right: t.right };
  }
  static _GenerateDefaultHandMeshesAsync(e, t) {
    return new Promise(async (r) => {
      var n, i, s, a, f;
      const o = {};
      !((i = (n = va._RightHandGLB) === null || n === void 0 ? void 0 : n.meshes[1]) === null || i === void 0) && i.isDisposed() && (va._RightHandGLB = null), !((a = (s = va._LeftHandGLB) === null || s === void 0 ? void 0 : s.meshes[1]) === null || a === void 0) && a.isDisposed() && (va._LeftHandGLB = null);
      const d = !!(va._RightHandGLB && va._LeftHandGLB), v = await Promise.all([
        va._RightHandGLB || Hn.ImportMeshAsync("", va.DEFAULT_HAND_MODEL_BASE_URL, va.DEFAULT_HAND_MODEL_RIGHT_FILENAME, e),
        va._LeftHandGLB || Hn.ImportMeshAsync("", va.DEFAULT_HAND_MODEL_BASE_URL, va.DEFAULT_HAND_MODEL_LEFT_FILENAME, e)
      ]);
      va._RightHandGLB = v[0], va._LeftHandGLB = v[1];
      const u = new ja("handShader", e, { emitComments: !1 });
      await u.loadAsync(va.DEFAULT_HAND_MODEL_SHADER_URL), u.needDepthPrePass = !0, u.transparencyMode = gt.MATERIAL_ALPHABLEND, u.alphaMode = 2, u.build(!1);
      const l = Object.assign({ base: Ne.FromInts(116, 63, 203), fresnel: Ne.FromInts(149, 102, 229), fingerColor: Ne.FromInts(177, 130, 255), tipFresnel: Ne.FromInts(220, 200, 255) }, (f = t == null ? void 0 : t.handMeshes) === null || f === void 0 ? void 0 : f.customColors), P = {
        base: u.getBlockByName("baseColor"),
        fresnel: u.getBlockByName("fresnelColor"),
        fingerColor: u.getBlockByName("fingerColor"),
        tipFresnel: u.getBlockByName("tipFresnelColor")
      };
      P.base.value = l.base, P.fresnel.value = l.fresnel, P.fingerColor.value = l.fingerColor, P.tipFresnel.value = l.tipFresnel, ["left", "right"].forEach((p) => {
        const c = p == "left" ? va._LeftHandGLB : va._RightHandGLB;
        if (!c)
          throw new Error("Could not load hand model");
        const H = c.meshes[1];
        H._internalAbstractMeshDataInfo._computeBonesUsingShaders = !0, H.material = u.clone(`${p}HandShaderClone`, !0), H.isVisible = !1, o[p] = H, !d && !e.useRightHandedSystem && c.meshes[1].rotate(bf.Y, Math.PI);
      }), u.dispose(), r({ left: o.left, right: o.right });
    });
  }
  /**
   * Generates a mapping from XRHandJoint to bone name for the default hand mesh.
   * @param handedness The handedness being mapped for.
   */
  static _GenerateDefaultHandMeshRigMapping(e) {
    const t = e == "right" ? "R" : "L";
    return {
      [gn.WRIST]: `wrist_${t}`,
      [gn.THUMB_METACARPAL]: `thumb_metacarpal_${t}`,
      [gn.THUMB_PHALANX_PROXIMAL]: `thumb_proxPhalanx_${t}`,
      [gn.THUMB_PHALANX_DISTAL]: `thumb_distPhalanx_${t}`,
      [gn.THUMB_TIP]: `thumb_tip_${t}`,
      [gn.INDEX_FINGER_METACARPAL]: `index_metacarpal_${t}`,
      [gn.INDEX_FINGER_PHALANX_PROXIMAL]: `index_proxPhalanx_${t}`,
      [gn.INDEX_FINGER_PHALANX_INTERMEDIATE]: `index_intPhalanx_${t}`,
      [gn.INDEX_FINGER_PHALANX_DISTAL]: `index_distPhalanx_${t}`,
      [gn.INDEX_FINGER_TIP]: `index_tip_${t}`,
      [gn.MIDDLE_FINGER_METACARPAL]: `middle_metacarpal_${t}`,
      [gn.MIDDLE_FINGER_PHALANX_PROXIMAL]: `middle_proxPhalanx_${t}`,
      [gn.MIDDLE_FINGER_PHALANX_INTERMEDIATE]: `middle_intPhalanx_${t}`,
      [gn.MIDDLE_FINGER_PHALANX_DISTAL]: `middle_distPhalanx_${t}`,
      [gn.MIDDLE_FINGER_TIP]: `middle_tip_${t}`,
      [gn.RING_FINGER_METACARPAL]: `ring_metacarpal_${t}`,
      [gn.RING_FINGER_PHALANX_PROXIMAL]: `ring_proxPhalanx_${t}`,
      [gn.RING_FINGER_PHALANX_INTERMEDIATE]: `ring_intPhalanx_${t}`,
      [gn.RING_FINGER_PHALANX_DISTAL]: `ring_distPhalanx_${t}`,
      [gn.RING_FINGER_TIP]: `ring_tip_${t}`,
      [gn.PINKY_FINGER_METACARPAL]: `little_metacarpal_${t}`,
      [gn.PINKY_FINGER_PHALANX_PROXIMAL]: `little_proxPhalanx_${t}`,
      [gn.PINKY_FINGER_PHALANX_INTERMEDIATE]: `little_intPhalanx_${t}`,
      [gn.PINKY_FINGER_PHALANX_DISTAL]: `little_distPhalanx_${t}`,
      [gn.PINKY_FINGER_TIP]: `little_tip_${t}`
    };
  }
  /**
   * Check if the needed objects are defined.
   * This does not mean that the feature is enabled, but that the objects needed are well defined.
   */
  isCompatible() {
    return typeof XRHand < "u";
  }
  /**
   * Get the hand object according to the controller id
   * @param controllerId the controller id to which we want to get the hand
   * @returns null if not found or the WebXRHand object if found
   */
  getHandByControllerId(e) {
    return this._attachedHands[e];
  }
  /**
   * Get a hand object according to the requested handedness
   * @param handedness the handedness to request
   * @returns null if not found or the WebXRHand object if found
   */
  getHandByHandedness(e) {
    return e == "none" ? null : this._trackingHands[e];
  }
  /**
   * Creates a new instance of the XR hand tracking feature.
   * @param _xrSessionManager An instance of WebXRSessionManager.
   * @param options Options to use when constructing this feature.
   */
  constructor(e, t) {
    super(e), this.options = t, this._attachedHands = {}, this._trackingHands = { left: null, right: null }, this._handResources = { jointMeshes: null, handMeshes: null, rigMappings: null }, this.onHandAddedObservable = new Oe(), this.onHandRemovedObservable = new Oe(), this._attachHand = (i) => {
      var s, a, f;
      if (!i.inputSource.hand || i.inputSource.handedness == "none" || !this._handResources.jointMeshes)
        return;
      const o = i.inputSource.handedness, d = new qee(i, this._handResources.jointMeshes[o], this._handResources.handMeshes && this._handResources.handMeshes[o], this._handResources.rigMappings && this._handResources.rigMappings[o], (s = this.options.handMeshes) === null || s === void 0 ? void 0 : s.meshesUseLeftHandedCoordinates, (a = this.options.jointMeshes) === null || a === void 0 ? void 0 : a.invisible, (f = this.options.jointMeshes) === null || f === void 0 ? void 0 : f.scaleFactor);
      this._attachedHands[i.uniqueId] = d, this._trackingHands[o] = d, this.onHandAddedObservable.notifyObservers(d);
    }, this._detachHand = (i) => {
      this._detachHandById(i.uniqueId);
    }, this.xrNativeFeatureName = "hand-tracking";
    const n = t.jointMeshes;
    if (n && (typeof n.disableDefaultHandMesh < "u" && (t.handMeshes = t.handMeshes || {}, t.handMeshes.disableDefaultMeshes = n.disableDefaultHandMesh), typeof n.handMeshes < "u" && (t.handMeshes = t.handMeshes || {}, t.handMeshes.customMeshes = n.handMeshes), typeof n.leftHandedSystemMeshes < "u" && (t.handMeshes = t.handMeshes || {}, t.handMeshes.meshesUseLeftHandedCoordinates = n.leftHandedSystemMeshes), typeof n.rigMapping < "u")) {
      t.handMeshes = t.handMeshes || {};
      const i = {}, s = {};
      [
        [n.rigMapping.left, i],
        [n.rigMapping.right, s]
      ].forEach((a) => {
        const f = a[0], o = a[1];
        f.forEach((d, v) => {
          o[NH[v]] = d;
        });
      }), t.handMeshes.customRigMappings = {
        left: i,
        right: s
      };
    }
  }
  /**
   * Attach this feature.
   * Will usually be called by the features manager.
   *
   * @returns true if successful.
   */
  attach() {
    var e, t, r, n;
    return super.attach() ? (this._handResources = {
      jointMeshes: va._GenerateTrackedJointMeshes(this.options),
      handMeshes: ((e = this.options.handMeshes) === null || e === void 0 ? void 0 : e.customMeshes) || null,
      rigMappings: ((t = this.options.handMeshes) === null || t === void 0 ? void 0 : t.customRigMappings) || null
    }, !(!((r = this.options.handMeshes) === null || r === void 0) && r.customMeshes) && !(!((n = this.options.handMeshes) === null || n === void 0) && n.disableDefaultMeshes) && va._GenerateDefaultHandMeshesAsync(gr.LastCreatedScene, this.options).then((i) => {
      var s, a;
      this._handResources.handMeshes = i, this._handResources.rigMappings = {
        left: va._GenerateDefaultHandMeshRigMapping("left"),
        right: va._GenerateDefaultHandMeshRigMapping("right")
      }, (s = this._trackingHands.left) === null || s === void 0 || s.setHandMesh(this._handResources.handMeshes.left, this._handResources.rigMappings.left), (a = this._trackingHands.right) === null || a === void 0 || a.setHandMesh(this._handResources.handMeshes.right, this._handResources.rigMappings.right);
    }), this.options.xrInput.controllers.forEach(this._attachHand), this._addNewAttachObserver(this.options.xrInput.onControllerAddedObservable, this._attachHand), this._addNewAttachObserver(this.options.xrInput.onControllerRemovedObservable, this._detachHand), !0) : !1;
  }
  _onXRFrame(e) {
    var t, r;
    (t = this._trackingHands.left) === null || t === void 0 || t.updateFromXRFrame(e, this._xrSessionManager.referenceSpace), (r = this._trackingHands.right) === null || r === void 0 || r.updateFromXRFrame(e, this._xrSessionManager.referenceSpace);
  }
  _detachHandById(e) {
    var t;
    const r = this.getHandByControllerId(e);
    if (r) {
      const n = r.xrController.inputSource.handedness == "left" ? "left" : "right";
      ((t = this._trackingHands[n]) === null || t === void 0 ? void 0 : t.xrController.uniqueId) === e && (this._trackingHands[n] = null), this.onHandRemovedObservable.notifyObservers(r), r.dispose(), delete this._attachedHands[e];
    }
  }
  /**
   * Detach this feature.
   * Will usually be called by the features manager.
   *
   * @returns true if successful.
   */
  detach() {
    return super.detach() ? (Object.keys(this._attachedHands).forEach((e) => this._detachHandById(e)), !0) : !1;
  }
  /**
   * Dispose this feature and all of the resources attached.
   */
  dispose() {
    var e;
    super.dispose(), this.onHandAddedObservable.clear(), this.onHandRemovedObservable.clear(), this._handResources.handMeshes && !(!((e = this.options.handMeshes) === null || e === void 0) && e.customMeshes) && (this._handResources.handMeshes.left.dispose(), this._handResources.handMeshes.right.dispose(), va._RightHandGLB = null, va._LeftHandGLB = null), this._handResources.jointMeshes && (this._handResources.jointMeshes.left.forEach((t) => t.dispose()), this._handResources.jointMeshes.right.forEach((t) => t.dispose()));
  }
}
va.Name = Gi.HAND_TRACKING;
va.Version = 1;
va.DEFAULT_HAND_MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/HandMeshes/";
va.DEFAULT_HAND_MODEL_RIGHT_FILENAME = "r_hand_rhs.glb";
va.DEFAULT_HAND_MODEL_LEFT_FILENAME = "l_hand_rhs.glb";
va.DEFAULT_HAND_MODEL_SHADER_URL = "https://assets.babylonjs.com/meshes/HandMeshes/handsShader.json";
va._ICOSPHERE_PARAMS = { radius: 0.5, flat: !1, subdivisions: 2 };
va._RightHandGLB = null;
va._LeftHandGLB = null;
So.AddWebXRFeature(va.Name, (A, e) => () => new va(A, e), va.Version, !1);
var Kx;
(function(A) {
  A[A.ABOVE_FINGER_TIPS = 0] = "ABOVE_FINGER_TIPS", A[A.RADIAL_SIDE = 1] = "RADIAL_SIDE", A[A.ULNAR_SIDE = 2] = "ULNAR_SIDE", A[A.BELOW_WRIST = 3] = "BELOW_WRIST";
})(Kx || (Kx = {}));
var z8;
(function(A) {
  A[A.LOOK_AT_CAMERA = 0] = "LOOK_AT_CAMERA", A[A.HAND_ROTATION = 1] = "HAND_ROTATION";
})(z8 || (z8 = {}));
var Jx;
(function(A) {
  A[A.ALWAYS_VISIBLE = 0] = "ALWAYS_VISIBLE", A[A.PALM_UP = 1] = "PALM_UP", A[A.GAZE_FOCUS = 2] = "GAZE_FOCUS", A[A.PALM_AND_GAZE = 3] = "PALM_AND_GAZE";
})(Jx || (Jx = {}));
class E6e {
  /**
   * Builds a hand constraint behavior
   */
  constructor() {
    this._sceneRenderObserver = null, this._zoneAxis = {}, this.handConstraintVisibility = Jx.PALM_AND_GAZE, this.palmUpStrictness = 0.95, this.gazeProximityRadius = 0.15, this.targetOffset = 0.1, this.targetZone = Kx.ULNAR_SIDE, this.zoneOrientationMode = z8.HAND_ROTATION, this.nodeOrientationMode = z8.HAND_ROTATION, this.handedness = "none", this.lerpTime = 100, this._zoneAxis[Kx.ABOVE_FINGER_TIPS] = new S(0, 1, 0), this._zoneAxis[Kx.RADIAL_SIDE] = new S(-1, 0, 0), this._zoneAxis[Kx.ULNAR_SIDE] = new S(1, 0, 0), this._zoneAxis[Kx.BELOW_WRIST] = new S(0, -1, 0);
  }
  /** gets or sets behavior's name */
  get name() {
    return "HandConstraint";
  }
  /** Enable the behavior */
  enable() {
    this._node.setEnabled(!0);
  }
  /** Disable the behavior */
  disable() {
    this._node.setEnabled(!1);
  }
  _getHandPose() {
    if (!this._handTracking)
      return null;
    let e;
    if (this.handedness === "none" ? e = this._handTracking.getHandByHandedness("left") || this._handTracking.getHandByHandedness("right") : e = this._handTracking.getHandByHandedness(this.handedness), e) {
      const t = e.getJointMesh(gn.PINKY_FINGER_METACARPAL), r = e.getJointMesh(gn.MIDDLE_FINGER_METACARPAL), n = e.getJointMesh(gn.WRIST);
      if (n && r && t) {
        const i = { position: r.absolutePosition, quaternion: new Ze(), id: e.xrController.uniqueId }, s = ue.Vector3[0], a = ue.Vector3[1], f = ue.Vector3[2];
        return s.copyFrom(r.absolutePosition).subtractInPlace(n.absolutePosition).normalize(), a.copyFrom(t.absolutePosition).subtractInPlace(r.absolutePosition).normalize(), S.CrossToRef(s, a, a), S.CrossToRef(a, s, f), Ze.FromLookDirectionLHToRef(a, s, i.quaternion), i;
      }
    }
    return null;
  }
  /**
   * Initializes the hand constraint behavior
   */
  init() {
  }
  /**
   * Attaches the hand constraint to a `TransformNode`
   * @param node defines the node to attach the behavior to
   */
  attach(e) {
    this._node = e, this._scene = e.getScene(), this._node.rotationQuaternion || (this._node.rotationQuaternion = Ze.RotationYawPitchRoll(this._node.rotation.y, this._node.rotation.x, this._node.rotation.z));
    let t = Date.now();
    this._sceneRenderObserver = this._scene.onBeforeRenderObservable.add(() => {
      const r = this._getHandPose();
      if (this._node.reservedDataStore = this._node.reservedDataStore || {}, this._node.reservedDataStore.nearInteraction = this._node.reservedDataStore.nearInteraction || {}, this._node.reservedDataStore.nearInteraction.excludedControllerId = null, r) {
        const n = ue.Vector3[0], i = this._scene.activeCamera;
        n.copyFrom(this._zoneAxis[this.targetZone]);
        const s = ue.Quaternion[0];
        if (i && (this.zoneOrientationMode === z8.LOOK_AT_CAMERA || this.nodeOrientationMode === z8.LOOK_AT_CAMERA)) {
          const d = ue.Vector3[1];
          d.copyFrom(i.position).subtractInPlace(r.position).normalize(), this._scene.useRightHandedSystem ? Ze.FromLookDirectionRHToRef(d, S.UpReadOnly, s) : Ze.FromLookDirectionLHToRef(d, S.UpReadOnly, s);
        }
        this.zoneOrientationMode === z8.HAND_ROTATION ? r.quaternion.toRotationMatrix(ue.Matrix[0]) : s.toRotationMatrix(ue.Matrix[0]), S.TransformNormalToRef(n, ue.Matrix[0], n), n.scaleInPlace(this.targetOffset);
        const a = ue.Vector3[2], f = ue.Quaternion[1];
        a.copyFrom(r.position).addInPlace(n), this.nodeOrientationMode === z8.HAND_ROTATION ? f.copyFrom(r.quaternion) : f.copyFrom(s);
        const o = Date.now() - t;
        S.SmoothToRef(this._node.position, a, o, this.lerpTime, this._node.position), Ze.SmoothToRef(this._node.rotationQuaternion, f, o, this.lerpTime, this._node.rotationQuaternion), this._node.reservedDataStore.nearInteraction.excludedControllerId = r.id;
      }
      this._setVisibility(r), t = Date.now();
    });
  }
  _setVisibility(e) {
    let t = !0, r = !0;
    const n = this._scene.activeCamera;
    if (n) {
      const i = n.getForwardRay();
      if (this.handConstraintVisibility === Jx.GAZE_FOCUS || this.handConstraintVisibility === Jx.PALM_AND_GAZE) {
        r = !1;
        let s;
        this._eyeTracking && (s = this._eyeTracking.getEyeGaze()), s = s || i;
        const a = ue.Vector3[0];
        e ? e.position.subtractToRef(s.origin, a) : this._node.getAbsolutePosition().subtractToRef(s.origin, a);
        const f = S.Dot(a, s.direction), o = f * f;
        f > 0 && a.lengthSquared() - o < this.gazeProximityRadius * this.gazeProximityRadius && (r = !0);
      }
      if ((this.handConstraintVisibility === Jx.PALM_UP || this.handConstraintVisibility === Jx.PALM_AND_GAZE) && (t = !1, e)) {
        const s = ue.Vector3[0];
        S.LeftHandedForwardReadOnly.rotateByQuaternionToRef(e.quaternion, s), S.Dot(s, i.direction) > this.palmUpStrictness * 2 - 1 && (t = !0);
      }
    }
    this._node.setEnabled(t && r);
  }
  /**
   * Detaches the behavior from the `TransformNode`
   */
  detach() {
    this._scene.onBeforeRenderObservable.remove(this._sceneRenderObserver);
  }
  /**
   * Links the behavior to the XR experience in which to retrieve hand transform information.
   * @param xr xr experience
   */
  linkToXRExperience(e) {
    const t = e.featuresManager ? e.featuresManager : e;
    if (!t)
      ye.Error("XR features manager must be available or provided directly for the Hand Menu to work");
    else {
      try {
        this._eyeTracking = t.getEnabledFeature(Gi.EYE_TRACKING);
      } catch {
      }
      try {
        this._handTracking = t.getEnabledFeature(Gi.HAND_TRACKING);
      } catch {
        ye.Error("Hand tracking must be enabled for the Hand Menu to work");
      }
    }
  }
}
class hc {
  /**
   * Gets or sets maximum allowed angle
   */
  get maxAngle() {
    return this._maxAngle;
  }
  set maxAngle(e) {
    this._setMaxAngle(e);
  }
  /**
   * Creates a new BoneIKController
   * @param mesh defines the TransformNode to control
   * @param bone defines the bone to control. The bone needs to have a parent bone. It also needs to have a length greater than 0 or a children we can use to infer its length.
   * @param options defines options to set up the controller
   * @param options.targetMesh
   * @param options.poleTargetMesh
   * @param options.poleTargetBone
   * @param options.poleTargetLocalOffset
   * @param options.poleAngle
   * @param options.bendAxis
   * @param options.maxAngle
   * @param options.slerpAmount
   */
  constructor(e, t, r) {
    this.targetPosition = S.Zero(), this.poleTargetPosition = S.Zero(), this.poleTargetLocalOffset = S.Zero(), this.poleAngle = 0, this.slerpAmount = 1, this._bone1Quat = Ze.Identity(), this._bone1Mat = he.Identity(), this._bone2Ang = Math.PI, this._maxAngle = Math.PI, this._rightHandedSystem = !1, this._bendAxis = S.Right(), this._slerping = !1, this._adjustRoll = 0, this._notEnoughInformation = !1, this._bone2 = t;
    const n = t.getParent();
    if (!n) {
      this._notEnoughInformation = !0, Se.Error("BoneIKController: bone must have a parent for IK to work.");
      return;
    }
    if (this._bone1 = n, this._bone2.children.length === 0 && !this._bone2.length) {
      this._notEnoughInformation = !0, Se.Error("BoneIKController: bone must not be a leaf or it should have a length for IK to work.");
      return;
    }
    this.mesh = e, t.getSkeleton().computeAbsoluteMatrices();
    const i = t.getPosition();
    if (t.getAbsoluteMatrix().determinant() > 0 && (this._rightHandedSystem = !0, this._bendAxis.x = 0, this._bendAxis.y = 0, this._bendAxis.z = -1, i.x > i.y && i.x > i.z && (this._adjustRoll = Math.PI * 0.5, this._bendAxis.z = 1)), this._bone1.length && this._bone2.length) {
      const s = this._bone1.getScale(), a = this._bone2.getScale();
      this._bone1Length = this._bone1.length * s.y * this.mesh.scaling.y, this._bone2Length = this._bone2.length * a.y * this.mesh.scaling.y;
    } else if (this._bone2.children[0]) {
      e.computeWorldMatrix(!0);
      const s = this._bone2.children[0].getAbsolutePosition(e), a = this._bone2.getAbsolutePosition(e), f = this._bone1.getAbsolutePosition(e);
      this._bone2Length = S.Distance(s, a), this._bone1Length = S.Distance(a, f);
    } else {
      e.computeWorldMatrix(!0);
      const s = this._bone2.getScale();
      this._bone2Length = this._bone2.length * s.y * this.mesh.scaling.y;
      const a = this._bone2.getAbsolutePosition(e), f = this._bone1.getAbsolutePosition(e);
      this._bone1Length = S.Distance(a, f);
    }
    this._bone1.getRotationMatrixToRef(ai.WORLD, e, this._bone1Mat), this.maxAngle = Math.PI, r && (r.targetMesh && (this.targetMesh = r.targetMesh, this.targetMesh.computeWorldMatrix(!0)), r.poleTargetMesh ? (this.poleTargetMesh = r.poleTargetMesh, this.poleTargetMesh.computeWorldMatrix(!0)) : r.poleTargetBone ? this.poleTargetBone = r.poleTargetBone : this._bone1.getParent() && (this.poleTargetBone = this._bone1.getParent()), r.poleTargetLocalOffset && this.poleTargetLocalOffset.copyFrom(r.poleTargetLocalOffset), r.poleAngle && (this.poleAngle = r.poleAngle), r.bendAxis && this._bendAxis.copyFrom(r.bendAxis), r.maxAngle && (this.maxAngle = r.maxAngle), r.slerpAmount && (this.slerpAmount = r.slerpAmount));
  }
  _setMaxAngle(e) {
    e < 0 && (e = 0), (e > Math.PI || e == null) && (e = Math.PI), this._maxAngle = e;
    const t = this._bone1Length, r = this._bone2Length;
    this._maxReach = Math.sqrt(t * t + r * r - 2 * t * r * Math.cos(e));
  }
  /**
   * Force the controller to update the bones
   */
  update() {
    if (this._notEnoughInformation)
      return;
    const e = this.targetPosition, t = this.poleTargetPosition, r = hc._TmpMats[0], n = hc._TmpMats[1];
    this.targetMesh && e.copyFrom(this.targetMesh.getAbsolutePosition()), this.poleTargetBone ? this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset, this.mesh, t) : this.poleTargetMesh && S.TransformCoordinatesToRef(this.poleTargetLocalOffset, this.poleTargetMesh.getWorldMatrix(), t);
    const i = hc._TmpVecs[0], s = hc._TmpVecs[1], a = hc._TmpVecs[2], f = hc._TmpVecs[3], o = hc._TmpVecs[4], d = hc._TmpQuat;
    this._bone1.getAbsolutePositionToRef(this.mesh, i), t.subtractToRef(i, o), o.x == 0 && o.y == 0 && o.z == 0 ? o.y = 1 : o.normalize(), e.subtractToRef(i, f), f.normalize(), S.CrossToRef(f, o, s), s.normalize(), S.CrossToRef(f, s, a), a.normalize(), he.FromXYZAxesToRef(a, f, s, r);
    const v = this._bone1Length, u = this._bone2Length;
    let l = S.Distance(i, e);
    this._maxReach > 0 && (l = Math.min(this._maxReach, l));
    let P = (u * u + l * l - v * v) / (2 * u * l), p = (l * l + v * v - u * u) / (2 * l * v);
    P > 1 && (P = 1), p > 1 && (p = 1), P < -1 && (P = -1), p < -1 && (p = -1);
    const c = Math.acos(P), H = Math.acos(p);
    let T = -c - H;
    if (this._rightHandedSystem)
      he.RotationYawPitchRollToRef(0, 0, this._adjustRoll, n), n.multiplyToRef(r, r), he.RotationAxisToRef(this._bendAxis, H, n), n.multiplyToRef(r, r);
    else {
      const q = hc._TmpVecs[5];
      q.copyFrom(this._bendAxis), q.x *= -1, he.RotationAxisToRef(q, -H, n), n.multiplyToRef(r, r);
    }
    this.poleAngle && (he.RotationAxisToRef(f, this.poleAngle, n), r.multiplyToRef(n, r)), this._bone1 && (this.slerpAmount < 1 ? (this._slerping || Ze.FromRotationMatrixToRef(this._bone1Mat, this._bone1Quat), Ze.FromRotationMatrixToRef(r, d), Ze.SlerpToRef(this._bone1Quat, d, this.slerpAmount, this._bone1Quat), T = this._bone2Ang * (1 - this.slerpAmount) + T * this.slerpAmount, this._bone1.setRotationQuaternion(this._bone1Quat, ai.WORLD, this.mesh), this._slerping = !0) : (this._bone1.setRotationMatrix(r, ai.WORLD, this.mesh), this._bone1Mat.copyFrom(r), this._slerping = !1), this._updateLinkedTransformRotation(this._bone1)), this._bone2.setAxisAngle(this._bendAxis, T, ai.LOCAL), this._updateLinkedTransformRotation(this._bone2), this._bone2Ang = T;
  }
  _updateLinkedTransformRotation(e) {
    e._linkedTransformNode && (e._linkedTransformNode.rotationQuaternion || (e._linkedTransformNode.rotationQuaternion = new Ze()), e.getRotationQuaternionToRef(ai.LOCAL, null, e._linkedTransformNode.rotationQuaternion));
  }
}
hc._TmpVecs = [S.Zero(), S.Zero(), S.Zero(), S.Zero(), S.Zero(), S.Zero()];
hc._TmpQuat = Ze.Identity();
hc._TmpMats = [he.Identity(), he.Identity()];
class wA {
  /**
   * Gets or sets the minimum yaw angle that the bone can look to
   */
  get minYaw() {
    return this._minYaw;
  }
  set minYaw(e) {
    this._minYaw = e, this._minYawSin = Math.sin(e), this._minYawCos = Math.cos(e), this._maxYaw != null && (this._midYawConstraint = this._getAngleDiff(this._minYaw, this._maxYaw) * 0.5 + this._minYaw, this._yawRange = this._maxYaw - this._minYaw);
  }
  /**
   * Gets or sets the maximum yaw angle that the bone can look to
   */
  get maxYaw() {
    return this._maxYaw;
  }
  set maxYaw(e) {
    this._maxYaw = e, this._maxYawSin = Math.sin(e), this._maxYawCos = Math.cos(e), this._minYaw != null && (this._midYawConstraint = this._getAngleDiff(this._minYaw, this._maxYaw) * 0.5 + this._minYaw, this._yawRange = this._maxYaw - this._minYaw);
  }
  /**
   * Gets or sets the minimum pitch angle that the bone can look to
   */
  get minPitch() {
    return this._minPitch;
  }
  set minPitch(e) {
    this._minPitch = e, this._minPitchTan = Math.tan(e);
  }
  /**
   * Gets or sets the maximum pitch angle that the bone can look to
   */
  get maxPitch() {
    return this._maxPitch;
  }
  set maxPitch(e) {
    this._maxPitch = e, this._maxPitchTan = Math.tan(e);
  }
  /**
   * Create a BoneLookController
   * @param mesh the TransformNode that the bone belongs to
   * @param bone the bone that will be looking to the target
   * @param target the target Vector3 to look at
   * @param options optional settings:
   * * maxYaw: the maximum angle the bone will yaw to
   * * minYaw: the minimum angle the bone will yaw to
   * * maxPitch: the maximum angle the bone will pitch to
   * * minPitch: the minimum angle the bone will yaw to
   * * slerpAmount: set the between 0 and 1 to make the bone slerp to the target.
   * * upAxis: the up axis of the coordinate system
   * * upAxisSpace: the space that the up axis is in - Space.BONE, Space.LOCAL (default), or Space.WORLD.
   * * yawAxis: set yawAxis if the bone does not yaw on the y axis
   * * pitchAxis: set pitchAxis if the bone does not pitch on the x axis
   * * adjustYaw: used to make an adjustment to the yaw of the bone
   * * adjustPitch: used to make an adjustment to the pitch of the bone
   * * adjustRoll: used to make an adjustment to the roll of the bone
   * @param options.maxYaw
   * @param options.minYaw
   * @param options.maxPitch
   * @param options.minPitch
   * @param options.slerpAmount
   * @param options.upAxis
   * @param options.upAxisSpace
   * @param options.yawAxis
   * @param options.pitchAxis
   * @param options.adjustYaw
   * @param options.adjustPitch
   * @param options.adjustRoll
   **/
  constructor(e, t, r, n) {
    if (this.upAxis = S.Up(), this.upAxisSpace = ai.LOCAL, this.adjustYaw = 0, this.adjustPitch = 0, this.adjustRoll = 0, this.slerpAmount = 1, this._boneQuat = Ze.Identity(), this._slerping = !1, this._firstFrameSkipped = !1, this._fowardAxis = S.Forward(), this.useAbsoluteValueForYaw = !1, this.mesh = e, this.bone = t, this.target = r, n) {
      if (n.adjustYaw && (this.adjustYaw = n.adjustYaw), n.adjustPitch && (this.adjustPitch = n.adjustPitch), n.adjustRoll && (this.adjustRoll = n.adjustRoll), n.maxYaw != null ? this.maxYaw = n.maxYaw : this.maxYaw = Math.PI, n.minYaw != null ? this.minYaw = n.minYaw : this.minYaw = -Math.PI, n.maxPitch != null ? this.maxPitch = n.maxPitch : this.maxPitch = Math.PI, n.minPitch != null ? this.minPitch = n.minPitch : this.minPitch = -Math.PI, n.slerpAmount != null && (this.slerpAmount = n.slerpAmount), n.upAxis != null && (this.upAxis = n.upAxis), n.upAxisSpace != null && (this.upAxisSpace = n.upAxisSpace), n.yawAxis != null || n.pitchAxis != null) {
        let i = bf.Y, s = bf.X;
        n.yawAxis != null && (i = n.yawAxis.clone(), i.normalize()), n.pitchAxis != null && (s = n.pitchAxis.clone(), s.normalize());
        const a = S.Cross(s, i);
        this._transformYawPitch = he.Identity(), he.FromXYZAxesToRef(s, i, a, this._transformYawPitch), this._transformYawPitchInv = this._transformYawPitch.clone(), this._transformYawPitch.invert();
      }
      n.useAbsoluteValueForYaw !== void 0 && (this.useAbsoluteValueForYaw = n.useAbsoluteValueForYaw);
    }
    !t.getParent() && this.upAxisSpace == ai.BONE && (this.upAxisSpace = ai.LOCAL);
  }
  /**
   * Update the bone to look at the target.  This should be called before the scene is rendered (use scene.registerBeforeRender())
   */
  update() {
    if (this.slerpAmount < 1 && !this._firstFrameSkipped) {
      this._firstFrameSkipped = !0;
      return;
    }
    const e = this.bone, t = wA._TmpVecs[0];
    e.getAbsolutePositionToRef(this.mesh, t);
    let r = this.target;
    const n = wA._TmpMats[0], i = wA._TmpMats[1], s = this.mesh, a = e.getParent(), f = wA._TmpVecs[1];
    f.copyFrom(this.upAxis), this.upAxisSpace == ai.BONE && a ? (this._transformYawPitch && S.TransformCoordinatesToRef(f, this._transformYawPitchInv, f), a.getDirectionToRef(f, this.mesh, f)) : this.upAxisSpace == ai.LOCAL && (s.getDirectionToRef(f, f), (s.scaling.x != 1 || s.scaling.y != 1 || s.scaling.z != 1) && f.normalize());
    let o = !1, d = !1;
    if ((this._maxYaw != Math.PI || this._minYaw != -Math.PI) && (o = !0), (this._maxPitch != Math.PI || this._minPitch != -Math.PI) && (d = !0), o || d) {
      const p = wA._TmpMats[2], c = wA._TmpMats[3];
      if (this.upAxisSpace == ai.BONE && f.y == 1 && a)
        a.getRotationMatrixToRef(ai.WORLD, this.mesh, p);
      else if (this.upAxisSpace == ai.LOCAL && f.y == 1 && !a)
        p.copyFrom(s.getWorldMatrix());
      else {
        let T = wA._TmpVecs[2];
        T.copyFrom(this._fowardAxis), this._transformYawPitch && S.TransformCoordinatesToRef(T, this._transformYawPitchInv, T), a ? a.getDirectionToRef(T, this.mesh, T) : s.getDirectionToRef(T, T);
        const q = S.Cross(f, T);
        q.normalize(), T = S.Cross(q, f), he.FromXYZAxesToRef(q, f, T, p);
      }
      p.invertToRef(c);
      let H = null;
      if (d) {
        const T = wA._TmpVecs[3];
        r.subtractToRef(t, T), S.TransformCoordinatesToRef(T, c, T), H = Math.sqrt(T.x * T.x + T.z * T.z);
        const q = Math.atan2(T.y, H);
        let b = q;
        q > this._maxPitch ? (T.y = this._maxPitchTan * H, b = this._maxPitch) : q < this._minPitch && (T.y = this._minPitchTan * H, b = this._minPitch), q != b && (S.TransformCoordinatesToRef(T, p, T), T.addInPlace(t), r = T);
      }
      if (o) {
        const T = wA._TmpVecs[4];
        r.subtractToRef(t, T), S.TransformCoordinatesToRef(T, c, T);
        const q = Math.atan2(T.x, T.z), b = this.useAbsoluteValueForYaw ? Math.abs(q) : q;
        let j = q;
        if ((b > this._maxYaw || b < this._minYaw) && (H == null && (H = Math.sqrt(T.x * T.x + T.z * T.z)), this._yawRange > Math.PI ? this._isAngleBetween(q, this._maxYaw, this._midYawConstraint) ? (T.z = this._maxYawCos * H, T.x = this._maxYawSin * H, j = this._maxYaw) : this._isAngleBetween(q, this._midYawConstraint, this._minYaw) && (T.z = this._minYawCos * H, T.x = this._minYawSin * H, j = this._minYaw) : b > this._maxYaw ? (T.z = this._maxYawCos * H, T.x = this._maxYawSin * H, q < 0 && this.useAbsoluteValueForYaw && (T.x *= -1), j = this._maxYaw) : b < this._minYaw && (T.z = this._minYawCos * H, T.x = this._minYawSin * H, q < 0 && this.useAbsoluteValueForYaw && (T.x *= -1), j = this._minYaw)), this._slerping && this._yawRange > Math.PI) {
          const w = wA._TmpVecs[8];
          w.copyFrom(bf.Z), this._transformYawPitch && S.TransformCoordinatesToRef(w, this._transformYawPitchInv, w);
          const m = wA._TmpMats[4];
          this._boneQuat.toRotationMatrix(m), this.mesh.getWorldMatrix().multiplyToRef(m, m), S.TransformCoordinatesToRef(w, m, w), S.TransformCoordinatesToRef(w, c, w);
          const I = Math.atan2(w.x, w.z), N = this._getAngleBetween(I, q), k = this._getAngleBetween(I, this._midYawConstraint);
          if (N > k) {
            H == null && (H = Math.sqrt(T.x * T.x + T.z * T.z));
            const R = this._getAngleBetween(I, this._maxYaw);
            this._getAngleBetween(I, this._minYaw) < R ? (j = I + Math.PI * 0.75, T.z = Math.cos(j) * H, T.x = Math.sin(j) * H) : (j = I - Math.PI * 0.75, T.z = Math.cos(j) * H, T.x = Math.sin(j) * H);
          }
        }
        q != j && (S.TransformCoordinatesToRef(T, p, T), T.addInPlace(t), r = T);
      }
    }
    const v = wA._TmpVecs[5], u = wA._TmpVecs[6], l = wA._TmpVecs[7], P = wA._TmpQuat;
    r.subtractToRef(t, v), v.normalize(), S.CrossToRef(f, v, u), u.normalize(), S.CrossToRef(v, u, l), l.normalize(), he.FromXYZAxesToRef(u, l, v, n), !(u.x === 0 && u.y === 0 && u.z === 0) && (l.x === 0 && l.y === 0 && l.z === 0 || v.x === 0 && v.y === 0 && v.z === 0 || ((this.adjustYaw || this.adjustPitch || this.adjustRoll) && (he.RotationYawPitchRollToRef(this.adjustYaw, this.adjustPitch, this.adjustRoll, i), i.multiplyToRef(n, n)), this.slerpAmount < 1 ? (this._slerping || this.bone.getRotationQuaternionToRef(ai.WORLD, this.mesh, this._boneQuat), this._transformYawPitch && this._transformYawPitch.multiplyToRef(n, n), Ze.FromRotationMatrixToRef(n, P), Ze.SlerpToRef(this._boneQuat, P, this.slerpAmount, this._boneQuat), this.bone.setRotationQuaternion(this._boneQuat, ai.WORLD, this.mesh), this._slerping = !0) : (this._transformYawPitch && this._transformYawPitch.multiplyToRef(n, n), this.bone.setRotationMatrix(n, ai.WORLD, this.mesh), this._slerping = !1), this._updateLinkedTransformRotation()));
  }
  _getAngleDiff(e, t) {
    let r = t - e;
    return r %= Math.PI * 2, r > Math.PI ? r -= Math.PI * 2 : r < -Math.PI && (r += Math.PI * 2), r;
  }
  _getAngleBetween(e, t) {
    e %= 2 * Math.PI, e = e < 0 ? e + 2 * Math.PI : e, t %= 2 * Math.PI, t = t < 0 ? t + 2 * Math.PI : t;
    let r = 0;
    return e < t ? r = t - e : r = e - t, r > Math.PI && (r = Math.PI * 2 - r), r;
  }
  _isAngleBetween(e, t, r) {
    if (e %= 2 * Math.PI, e = e < 0 ? e + 2 * Math.PI : e, t %= 2 * Math.PI, t = t < 0 ? t + 2 * Math.PI : t, r %= 2 * Math.PI, r = r < 0 ? r + 2 * Math.PI : r, t < r) {
      if (e > t && e < r)
        return !0;
    } else if (e > r && e < t)
      return !0;
    return !1;
  }
  _updateLinkedTransformRotation() {
    const e = this.bone;
    e._linkedTransformNode && (e._linkedTransformNode.rotationQuaternion || (e._linkedTransformNode.rotationQuaternion = new Ze()), e.getRotationQuaternionToRef(ai.LOCAL, null, e._linkedTransformNode.rotationQuaternion));
  }
}
wA._TmpVecs = Nf.BuildArray(10, S.Zero);
wA._TmpQuat = Ze.Identity();
wA._TmpMats = Nf.BuildArray(5, he.Identity);
class r4 {
  /**
   * Gets or sets a boolean indicating that bone matrices should be stored as a texture instead of using shader uniforms (default is true).
   * Please note that this option is not available if the hardware does not support it
   */
  get useTextureToStoreBoneMatrices() {
    return this._useTextureToStoreBoneMatrices;
  }
  set useTextureToStoreBoneMatrices(e) {
    this._useTextureToStoreBoneMatrices = e, this._markAsDirty();
  }
  /**
   * Gets or sets the animation properties override
   */
  get animationPropertiesOverride() {
    return this._animationPropertiesOverride ? this._animationPropertiesOverride : this._scene.animationPropertiesOverride;
  }
  set animationPropertiesOverride(e) {
    this._animationPropertiesOverride = e;
  }
  /**
   * Gets a boolean indicating that the skeleton effectively stores matrices into a texture
   */
  get isUsingTextureForMatrices() {
    return this.useTextureToStoreBoneMatrices && this._canUseTextureForBones;
  }
  /**
   * Gets the unique ID of this skeleton
   */
  get uniqueId() {
    return this._uniqueId;
  }
  /**
   * Creates a new skeleton
   * @param name defines the skeleton name
   * @param id defines the skeleton Id
   * @param scene defines the hosting scene
   */
  constructor(e, t, r) {
    this.name = e, this.id = t, this.bones = [], this.needInitialSkinMatrix = !1, this._isDirty = !0, this._meshesWithPoseMatrix = new Array(), this._identity = he.Identity(), this._currentRenderId = -1, this._ranges = {}, this._absoluteTransformIsDirty = !0, this._canUseTextureForBones = !1, this._uniqueId = 0, this._numBonesWithLinkedTransformNode = 0, this._hasWaitingData = null, this._parentContainer = null, this.doNotSerialize = !1, this._useTextureToStoreBoneMatrices = !0, this._animationPropertiesOverride = null, this.onBeforeComputeObservable = new Oe(), this.bones = [], this._scene = r || gr.LastCreatedScene, this._uniqueId = this._scene.getUniqueId(), this._scene.addSkeleton(this), this._isDirty = !0;
    const n = this._scene.getEngine().getCaps();
    this._canUseTextureForBones = n.textureFloat && n.maxVertexTextureImageUnits > 0;
  }
  /**
   * Gets the current object class name.
   * @returns the class name
   */
  getClassName() {
    return "Skeleton";
  }
  /**
   * Returns an array containing the root bones
   * @returns an array containing the root bones
   */
  getChildren() {
    return this.bones.filter((e) => !e.getParent());
  }
  // Members
  /**
   * Gets the list of transform matrices to send to shaders (one matrix per bone)
   * @param mesh defines the mesh to use to get the root matrix (if needInitialSkinMatrix === true)
   * @returns a Float32Array containing matrices data
   */
  getTransformMatrices(e) {
    return this.needInitialSkinMatrix ? (e._bonesTransformMatrices || this.prepare(), e._bonesTransformMatrices) : ((!this._transformMatrices || this._isDirty) && this.prepare(), this._transformMatrices);
  }
  /**
   * Gets the list of transform matrices to send to shaders inside a texture (one matrix per bone)
   * @param mesh defines the mesh to use to get the root matrix (if needInitialSkinMatrix === true)
   * @returns a raw texture containing the data
   */
  getTransformMatrixTexture(e) {
    return this.needInitialSkinMatrix && e._transformMatrixTexture ? e._transformMatrixTexture : this._transformMatrixTexture;
  }
  /**
   * Gets the current hosting scene
   * @returns a scene object
   */
  getScene() {
    return this._scene;
  }
  // Methods
  /**
   * Gets a string representing the current skeleton data
   * @param fullDetails defines a boolean indicating if we want a verbose version
   * @returns a string representing the current skeleton data
   */
  toString(e) {
    let t = `Name: ${this.name}, nBones: ${this.bones.length}`;
    if (t += `, nAnimationRanges: ${this._ranges ? Object.keys(this._ranges).length : "none"}`, e) {
      t += ", Ranges: {";
      let r = !0;
      for (const n in this._ranges)
        r && (t += ", ", r = !1), t += n;
      t += "}";
    }
    return t;
  }
  /**
   * Get bone's index searching by name
   * @param name defines bone's name to search for
   * @returns the indice of the bone. Returns -1 if not found
   */
  getBoneIndexByName(e) {
    for (let t = 0, r = this.bones.length; t < r; t++)
      if (this.bones[t].name === e)
        return t;
    return -1;
  }
  /**
   * Create a new animation range
   * @param name defines the name of the range
   * @param from defines the start key
   * @param to defines the end key
   */
  createAnimationRange(e, t, r) {
    if (!this._ranges[e]) {
      this._ranges[e] = new Am(e, t, r);
      for (let n = 0, i = this.bones.length; n < i; n++)
        this.bones[n].animations[0] && this.bones[n].animations[0].createRange(e, t, r);
    }
  }
  /**
   * Delete a specific animation range
   * @param name defines the name of the range
   * @param deleteFrames defines if frames must be removed as well
   */
  deleteAnimationRange(e, t = !0) {
    for (let r = 0, n = this.bones.length; r < n; r++)
      this.bones[r].animations[0] && this.bones[r].animations[0].deleteRange(e, t);
    this._ranges[e] = null;
  }
  /**
   * Gets a specific animation range
   * @param name defines the name of the range to look for
   * @returns the requested animation range or null if not found
   */
  getAnimationRange(e) {
    return this._ranges[e] || null;
  }
  /**
   * Gets the list of all animation ranges defined on this skeleton
   * @returns an array
   */
  getAnimationRanges() {
    const e = [];
    let t;
    for (t in this._ranges)
      e.push(this._ranges[t]);
    return e;
  }
  /**
   * Copy animation range from a source skeleton.
   * This is not for a complete retargeting, only between very similar skeleton's with only possible bone length differences
   * @param source defines the source skeleton
   * @param name defines the name of the range to copy
   * @param rescaleAsRequired defines if rescaling must be applied if required
   * @returns true if operation was successful
   */
  copyAnimationRange(e, t, r = !1) {
    if (this._ranges[t] || !e.getAnimationRange(t))
      return !1;
    let n = !0;
    const i = this._getHighestAnimationFrame() + 1, s = {}, a = e.bones;
    let f, o;
    for (o = 0, f = a.length; o < f; o++)
      s[a[o].name] = a[o];
    this.bones.length !== a.length && (Se.Warn(`copyAnimationRange: this rig has ${this.bones.length} bones, while source as ${a.length}`), n = !1);
    const d = r && this.dimensionsAtRest && e.dimensionsAtRest ? this.dimensionsAtRest.divide(e.dimensionsAtRest) : null;
    for (o = 0, f = this.bones.length; o < f; o++) {
      const u = this.bones[o].name, l = s[u];
      l ? n = n && this.bones[o].copyAnimationRange(l, t, i, r, d) : (Se.Warn("copyAnimationRange: not same rig, missing source bone " + u), n = !1);
    }
    const v = e.getAnimationRange(t);
    return v && (this._ranges[t] = new Am(t, v.from + i, v.to + i)), n;
  }
  /**
   * Forces the skeleton to go to rest pose
   */
  returnToRest() {
    for (const e of this.bones)
      e._index !== -1 && e.returnToRest();
  }
  _getHighestAnimationFrame() {
    let e = 0;
    for (let t = 0, r = this.bones.length; t < r; t++)
      if (this.bones[t].animations[0]) {
        const n = this.bones[t].animations[0].getHighestFrame();
        e < n && (e = n);
      }
    return e;
  }
  /**
   * Begin a specific animation range
   * @param name defines the name of the range to start
   * @param loop defines if looping must be turned on (false by default)
   * @param speedRatio defines the speed ratio to apply (1 by default)
   * @param onAnimationEnd defines a callback which will be called when animation will end
   * @returns a new animatable
   */
  beginAnimation(e, t, r, n) {
    const i = this.getAnimationRange(e);
    return i ? this._scene.beginAnimation(this, i.from, i.to, t, r, n) : null;
  }
  /**
   * Convert the keyframes for a range of animation on a skeleton to be relative to a given reference frame.
   * @param skeleton defines the Skeleton containing the animation range to convert
   * @param referenceFrame defines the frame that keyframes in the range will be relative to
   * @param range defines the name of the AnimationRange belonging to the Skeleton to convert
   * @returns the original skeleton
   */
  static MakeAnimationAdditive(e, t = 0, r) {
    const n = e.getAnimationRange(r);
    if (!n)
      return null;
    const i = e._scene.getAllAnimatablesByTarget(e);
    let s = null;
    for (let f = 0; f < i.length; f++) {
      const o = i[f];
      if (o.fromFrame === (n == null ? void 0 : n.from) && o.toFrame === (n == null ? void 0 : n.to)) {
        s = o;
        break;
      }
    }
    const a = e.getAnimatables();
    for (let f = 0; f < a.length; f++) {
      const d = a[f].animations;
      if (d)
        for (let v = 0; v < d.length; v++)
          st.MakeAnimationAdditive(d[v], t, r);
    }
    return s && (s.isAdditive = !0), e;
  }
  /** @internal */
  _markAsDirty() {
    this._isDirty = !0, this._absoluteTransformIsDirty = !0;
  }
  /**
   * @internal
   */
  _registerMeshWithPoseMatrix(e) {
    this._meshesWithPoseMatrix.push(e);
  }
  /**
   * @internal
   */
  _unregisterMeshWithPoseMatrix(e) {
    const t = this._meshesWithPoseMatrix.indexOf(e);
    t > -1 && this._meshesWithPoseMatrix.splice(t, 1);
  }
  _computeTransformMatrices(e, t) {
    this.onBeforeComputeObservable.notifyObservers(this);
    for (let r = 0; r < this.bones.length; r++) {
      const n = this.bones[r];
      n._childUpdateId++;
      const i = n.getParent();
      if (i ? n.getLocalMatrix().multiplyToRef(i.getFinalMatrix(), n.getFinalMatrix()) : t ? n.getLocalMatrix().multiplyToRef(t, n.getFinalMatrix()) : n.getFinalMatrix().copyFrom(n.getLocalMatrix()), n._index !== -1) {
        const s = n._index === null ? r : n._index;
        n.getAbsoluteInverseBindMatrix().multiplyToArray(n.getFinalMatrix(), e, s * 16);
      }
    }
    this._identity.copyToArray(e, this.bones.length * 16);
  }
  /**
   * Build all resources required to render a skeleton
   * @param dontCheckFrameId defines a boolean indicating if prepare should be run without checking first the current frame id (default: false)
   */
  prepare(e = !1) {
    if (!e) {
      const t = this.getScene().getRenderId();
      if (this._currentRenderId === t)
        return;
      this._currentRenderId = t;
    }
    if (this._numBonesWithLinkedTransformNode > 0) {
      for (const t of this.bones)
        if (t._linkedTransformNode) {
          const r = t._linkedTransformNode;
          t.position = r.position, r.rotationQuaternion ? t.rotationQuaternion = r.rotationQuaternion : t.rotation = r.rotation, t.scaling = r.scaling;
        }
    }
    if (this.needInitialSkinMatrix)
      for (const t of this._meshesWithPoseMatrix) {
        const r = t.getPoseMatrix();
        let n = this._isDirty;
        if ((!t._bonesTransformMatrices || t._bonesTransformMatrices.length !== 16 * (this.bones.length + 1)) && (t._bonesTransformMatrices = new Float32Array(16 * (this.bones.length + 1)), n = !0), !!n) {
          if (this._synchronizedWithMesh !== t) {
            this._synchronizedWithMesh = t;
            for (const i of this.bones)
              i.getParent() || (i.getBindMatrix().multiplyToRef(r, ue.Matrix[1]), i._updateAbsoluteBindMatrices(ue.Matrix[1]));
            if (this.isUsingTextureForMatrices) {
              const i = (this.bones.length + 1) * 4;
              (!t._transformMatrixTexture || t._transformMatrixTexture.getSize().width !== i) && (t._transformMatrixTexture && t._transformMatrixTexture.dispose(), t._transformMatrixTexture = Bo.CreateRGBATexture(t._bonesTransformMatrices, (this.bones.length + 1) * 4, 1, this._scene, !1, !1, 1, 1));
            }
          }
          this._computeTransformMatrices(t._bonesTransformMatrices, r), this.isUsingTextureForMatrices && t._transformMatrixTexture && t._transformMatrixTexture.update(t._bonesTransformMatrices);
        }
      }
    else {
      if (!this._isDirty)
        return;
      (!this._transformMatrices || this._transformMatrices.length !== 16 * (this.bones.length + 1)) && (this._transformMatrices = new Float32Array(16 * (this.bones.length + 1)), this.isUsingTextureForMatrices && (this._transformMatrixTexture && this._transformMatrixTexture.dispose(), this._transformMatrixTexture = Bo.CreateRGBATexture(this._transformMatrices, (this.bones.length + 1) * 4, 1, this._scene, !1, !1, 1, 1))), this._computeTransformMatrices(this._transformMatrices, null), this.isUsingTextureForMatrices && this._transformMatrixTexture && this._transformMatrixTexture.update(this._transformMatrices);
    }
    this._isDirty = !1;
  }
  /**
   * Gets the list of animatables currently running for this skeleton
   * @returns an array of animatables
   */
  getAnimatables() {
    if (!this._animatables || this._animatables.length !== this.bones.length) {
      this._animatables = [];
      for (let e = 0; e < this.bones.length; e++)
        this._animatables.push(this.bones[e]);
    }
    return this._animatables;
  }
  /**
   * Clone the current skeleton
   * @param name defines the name of the new skeleton
   * @param id defines the id of the new skeleton
   * @returns the new skeleton
   */
  clone(e, t) {
    const r = new r4(e, t || e, this._scene);
    r.needInitialSkinMatrix = this.needInitialSkinMatrix;
    for (let n = 0; n < this.bones.length; n++) {
      const i = this.bones[n];
      let s = null;
      const a = i.getParent();
      if (a) {
        const o = this.bones.indexOf(a);
        s = r.bones[o];
      }
      const f = new da(i.name, r, s, i.getBindMatrix().clone(), i.getRestMatrix().clone());
      f._index = i._index, i._linkedTransformNode && f.linkTransformNode(i._linkedTransformNode), sA.DeepCopy(i.animations, f.animations);
    }
    if (this._ranges) {
      r._ranges = {};
      for (const n in this._ranges) {
        const i = this._ranges[n];
        i && (r._ranges[n] = i.clone());
      }
    }
    return this._isDirty = !0, r.prepare(!0), r;
  }
  /**
   * Enable animation blending for this skeleton
   * @param blendingSpeed defines the blending speed to apply
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-blending
   */
  enableBlending(e = 0.01) {
    this.bones.forEach((t) => {
      t.animations.forEach((r) => {
        r.enableBlending = !0, r.blendingSpeed = e;
      });
    });
  }
  /**
   * Releases all resources associated with the current skeleton
   */
  dispose() {
    if (this._meshesWithPoseMatrix.length = 0, this.getScene().stopAnimation(this), this.getScene().removeSkeleton(this), this._parentContainer) {
      const e = this._parentContainer.skeletons.indexOf(this);
      e > -1 && this._parentContainer.skeletons.splice(e, 1), this._parentContainer = null;
    }
    this._transformMatrixTexture && (this._transformMatrixTexture.dispose(), this._transformMatrixTexture = null);
  }
  /**
   * Serialize the skeleton in a JSON object
   * @returns a JSON object
   */
  serialize() {
    var e;
    const t = {};
    t.name = this.name, t.id = this.id, this.dimensionsAtRest && (t.dimensionsAtRest = this.dimensionsAtRest.asArray()), t.bones = [], t.needInitialSkinMatrix = this.needInitialSkinMatrix;
    for (let r = 0; r < this.bones.length; r++) {
      const n = this.bones[r], i = n.getParent(), s = {
        parentBoneIndex: i ? this.bones.indexOf(i) : -1,
        index: n.getIndex(),
        name: n.name,
        id: n.id,
        matrix: n.getBindMatrix().toArray(),
        rest: n.getRestMatrix().toArray(),
        linkedTransformNodeId: (e = n.getTransformNode()) === null || e === void 0 ? void 0 : e.id
      };
      t.bones.push(s), n.length && (s.length = n.length), n.metadata && (s.metadata = n.metadata), n.animations && n.animations.length > 0 && (s.animation = n.animations[0].serialize()), t.ranges = [];
      for (const a in this._ranges) {
        const f = this._ranges[a];
        if (!f)
          continue;
        const o = {};
        o.name = a, o.from = f.from, o.to = f.to, t.ranges.push(o);
      }
    }
    return t;
  }
  /**
   * Creates a new skeleton from serialized data
   * @param parsedSkeleton defines the serialized data
   * @param scene defines the hosting scene
   * @returns a new skeleton
   */
  static Parse(e, t) {
    const r = new r4(e.name, e.id, t);
    e.dimensionsAtRest && (r.dimensionsAtRest = S.FromArray(e.dimensionsAtRest)), r.needInitialSkinMatrix = e.needInitialSkinMatrix;
    let n;
    for (n = 0; n < e.bones.length; n++) {
      const i = e.bones[n], s = e.bones[n].index;
      let a = null;
      i.parentBoneIndex > -1 && (a = r.bones[i.parentBoneIndex]);
      const f = i.rest ? he.FromArray(i.rest) : null, o = new da(i.name, r, a, he.FromArray(i.matrix), f, null, s);
      i.id !== void 0 && i.id !== null && (o.id = i.id), i.length && (o.length = i.length), i.metadata && (o.metadata = i.metadata), i.animation && o.animations.push(st.Parse(i.animation)), i.linkedTransformNodeId !== void 0 && i.linkedTransformNodeId !== null && (r._hasWaitingData = !0, o._waitingTransformNodeId = i.linkedTransformNodeId);
    }
    if (e.ranges)
      for (n = 0; n < e.ranges.length; n++) {
        const i = e.ranges[n];
        r.createAnimationRange(i.name, i.from, i.to);
      }
    return r;
  }
  /**
   * Compute all node absolute matrices
   * @param forceUpdate defines if computation must be done even if cache is up to date
   */
  computeAbsoluteMatrices(e = !1) {
    (this._absoluteTransformIsDirty || e) && (this.bones[0].computeAbsoluteMatrices(), this._absoluteTransformIsDirty = !1);
  }
  /**
   * Compute all node absolute matrices
   * @param forceUpdate defines if computation must be done even if cache is up to date
   * @deprecated Please use computeAbsoluteMatrices instead
   */
  computeAbsoluteTransforms(e = !1) {
    this.computeAbsoluteMatrices(e);
  }
  /**
   * Gets the root pose matrix
   * @returns a matrix
   */
  getPoseMatrix() {
    let e = null;
    return this._meshesWithPoseMatrix.length > 0 && (e = this._meshesWithPoseMatrix[0].getPoseMatrix()), e;
  }
  /**
   * Sorts bones per internal index
   */
  sortBones() {
    const e = [], t = new Array(this.bones.length);
    for (let r = 0; r < this.bones.length; r++)
      this._sortBones(r, e, t);
    this.bones = e;
  }
  _sortBones(e, t, r) {
    if (r[e])
      return;
    r[e] = !0;
    const n = this.bones[e];
    if (!n)
      return;
    n._index === void 0 && (n._index = e);
    const i = n.getParent();
    i && this._sortBones(this.bones.indexOf(i), t, r), t.push(n);
  }
  /**
   * Set the current local matrix as the restPose for all bones in the skeleton.
   */
  setCurrentPoseAsRest() {
    this.bones.forEach((e) => {
      e.setCurrentPoseAsRest();
    });
  }
}
class bee {
  /**
   * Creates a new storage buffer instance
   * @param engine The engine the buffer will be created inside
   * @param size The size of the buffer in bytes
   * @param creationFlags flags to use when creating the buffer (see undefined). The BUFFER_CREATIONFLAG_STORAGE flag will be automatically added.
   * @param label defines the label of the buffer (for debug purpose)
   */
  constructor(e, t, r = 3, n) {
    this._engine = e, this._label = n, this._engine._storageBuffers.push(this), this._create(t, r);
  }
  _create(e, t) {
    this._bufferSize = e, this._creationFlags = t, this._buffer = this._engine.createStorageBuffer(e, t, this._label);
  }
  /** @internal */
  _rebuild() {
    this._create(this._bufferSize, this._creationFlags);
  }
  /**
   * Gets underlying native buffer
   * @returns underlying native buffer
   */
  getBuffer() {
    return this._buffer;
  }
  /**
   * Updates the storage buffer
   * @param data the data used to update the storage buffer
   * @param byteOffset the byte offset of the data (optional)
   * @param byteLength the byte length of the data (optional)
   */
  update(e, t, r) {
    this._buffer && this._engine.updateStorageBuffer(this._buffer, e, t, r);
  }
  /**
   * Reads data from the storage buffer
   * @param offset The offset in the storage buffer to start reading from (default: 0)
   * @param size  The number of bytes to read from the storage buffer (default: capacity of the buffer)
   * @param buffer The buffer to write the data we have read from the storage buffer to (optional)
   * @returns If not undefined, returns the (promise) buffer (as provided by the 4th parameter) filled with the data, else it returns a (promise) Uint8Array with the data read from the storage buffer
   */
  read(e, t, r) {
    return this._engine.readFromStorageBuffer(this._buffer, e, t, r);
  }
  /**
   * Disposes the storage buffer
   */
  dispose() {
    const e = this._engine._storageBuffers, t = e.indexOf(this);
    t !== -1 && (e[t] = e[e.length - 1], e.pop()), this._engine._releaseBuffer(this._buffer), this._buffer = null;
  }
}
const fI = (() => {
  const A = new Uint8Array(4), e = new Uint32Array(A.buffer);
  return !!((e[0] = 1) & A[0]);
})();
Object.defineProperty(J.prototype, "effectiveByteStride", {
  get: function() {
    return this._alignedBuffer && this._alignedBuffer.byteStride || this.byteStride;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(J.prototype, "effectiveByteOffset", {
  get: function() {
    return this._alignedBuffer ? 0 : this.byteOffset;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(J.prototype, "effectiveBuffer", {
  get: function() {
    return this._alignedBuffer && this._alignedBuffer.getBuffer() || this._buffer.getBuffer();
  },
  enumerable: !0,
  configurable: !0
});
J.prototype._rebuild = function() {
  var A, e;
  (A = this._buffer) === null || A === void 0 || A._rebuild(), (e = this._alignedBuffer) === null || e === void 0 || e._rebuild();
};
J.prototype.dispose = function() {
  var A;
  this._ownsBuffer && this._buffer.dispose(), (A = this._alignedBuffer) === null || A === void 0 || A.dispose(), this._alignedBuffer = void 0, this._isDisposed = !0;
};
J.prototype._alignBuffer = function() {
  var A, e;
  const t = this._buffer.getData();
  if (!this.engine._features.forceVertexBufferStrideMultiple4Bytes || this.byteStride % 4 === 0 || !t)
    return;
  const r = J.GetTypeByteLength(this.type), n = this.byteStride + 3 & -4, i = n / r, s = this.totalVertices, f = s * n / r;
  let o;
  if (Array.isArray(t)) {
    const l = new Float32Array(t);
    o = new DataView(l.buffer, l.byteOffset, l.byteLength);
  } else
    t instanceof ArrayBuffer ? o = new DataView(t, 0, t.byteLength) : o = new DataView(t.buffer, t.byteOffset, t.byteLength);
  let d;
  this.type === J.BYTE ? d = new Int8Array(f) : this.type === J.UNSIGNED_BYTE ? d = new Uint8Array(f) : this.type === J.SHORT ? d = new Int16Array(f) : this.type === J.UNSIGNED_SHORT ? d = new Uint16Array(f) : this.type === J.INT ? d = new Int32Array(f) : this.type === J.UNSIGNED_INT ? d = new Uint32Array(f) : d = new Float32Array(f);
  const v = this.getSize();
  let u = this.byteOffset;
  for (let l = 0; l < s; ++l) {
    for (let P = 0; P < v; ++P)
      switch (this.type) {
        case J.BYTE:
          d[l * i + P] = o.getInt8(u + P);
          break;
        case J.UNSIGNED_BYTE:
          d[l * i + P] = o.getUint8(u + P);
          break;
        case J.SHORT:
          d[l * i + P] = o.getInt16(u + P * 2, fI);
          break;
        case J.UNSIGNED_SHORT:
          d[l * i + P] = o.getUint16(u + P * 2, fI);
          break;
        case J.INT:
          d[l * i + P] = o.getInt32(u + P * 4, fI);
          break;
        case J.UNSIGNED_INT:
          d[l * i + P] = o.getUint32(u + P * 4, fI);
          break;
        case J.FLOAT:
          d[l * i + P] = o.getFloat32(u + P * 4, fI);
          break;
      }
    u += this.byteStride;
  }
  (A = this._alignedBuffer) === null || A === void 0 || A.dispose(), this._alignedBuffer = new P9(this.engine, d, !1, n, !1, this.getIsInstanced(), !0, this.instanceDivisor, ((e = this._label) !== null && e !== void 0 ? e : "VertexBuffer") + "_aligned");
};
class IR {
  constructor() {
    this.wheelPrecisionX = 3, this.wheelPrecisionY = 3, this.wheelPrecisionZ = 3, this.onChangedObservable = new Oe(), this._wheelDeltaX = 0, this._wheelDeltaY = 0, this._wheelDeltaZ = 0, this._ffMultiplier = 12, this._normalize = 120;
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls
   *   should call preventdefault().
   *   (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments), this._wheel = (t) => {
      if (t.type !== ir.POINTERWHEEL)
        return;
      const r = t.event, n = r.deltaMode === wm.DOM_DELTA_LINE ? this._ffMultiplier : 1;
      this._wheelDeltaX += this.wheelPrecisionX * n * r.deltaX / this._normalize, this._wheelDeltaY -= this.wheelPrecisionY * n * r.deltaY / this._normalize, this._wheelDeltaZ += this.wheelPrecisionZ * n * r.deltaZ / this._normalize, r.preventDefault && (e || r.preventDefault());
    }, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel, ir.POINTERWHEEL);
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this._observer && (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._observer = null, this._wheel = null), this.onChangedObservable && this.onChangedObservable.clear();
  }
  /**
   * Called for each rendered frame.
   */
  checkInputs() {
    this.onChangedObservable.notifyObservers({
      wheelDeltaX: this._wheelDeltaX,
      wheelDeltaY: this._wheelDeltaY,
      wheelDeltaZ: this._wheelDeltaZ
    }), this._wheelDeltaX = 0, this._wheelDeltaY = 0, this._wheelDeltaZ = 0;
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "BaseCameraMouseWheelInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "mousewheel";
  }
}
C([
  M()
], IR.prototype, "wheelPrecisionX", void 0);
C([
  M()
], IR.prototype, "wheelPrecisionY", void 0);
C([
  M()
], IR.prototype, "wheelPrecisionZ", void 0);
class VO {
  constructor() {
    this._currentActiveButton = -1, this.buttons = [0, 1, 2];
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments);
    const t = this.camera.getEngine(), r = t.getInputElement();
    let n = 0, i = null;
    this._pointA = null, this._pointB = null, this._altKey = !1, this._ctrlKey = !1, this._metaKey = !1, this._shiftKey = !1, this._buttonsPressed = 0, this._pointerInput = (a) => {
      var f, o;
      const d = a.event, v = d.pointerType === "touch";
      if (a.type !== ir.POINTERMOVE && this.buttons.indexOf(d.button) === -1)
        return;
      const u = d.target;
      if (this._altKey = d.altKey, this._ctrlKey = d.ctrlKey, this._metaKey = d.metaKey, this._shiftKey = d.shiftKey, this._buttonsPressed = d.buttons, t.isPointerLock) {
        const l = d.movementX, P = d.movementY;
        this.onTouch(null, l, P), this._pointA = null, this._pointB = null;
      } else {
        if (a.type !== ir.POINTERDOWN && v && ((f = this._pointA) === null || f === void 0 ? void 0 : f.pointerId) !== d.pointerId && ((o = this._pointB) === null || o === void 0 ? void 0 : o.pointerId) !== d.pointerId)
          return;
        if (a.type === ir.POINTERDOWN && (this._currentActiveButton === -1 || v)) {
          try {
            u == null || u.setPointerCapture(d.pointerId);
          } catch {
          }
          if (this._pointA === null)
            this._pointA = {
              x: d.clientX,
              y: d.clientY,
              pointerId: d.pointerId,
              type: d.pointerType
            };
          else if (this._pointB === null)
            this._pointB = {
              x: d.clientX,
              y: d.clientY,
              pointerId: d.pointerId,
              type: d.pointerType
            };
          else
            return;
          this._currentActiveButton === -1 && !v && (this._currentActiveButton = d.button), this.onButtonDown(d), e || (d.preventDefault(), r && r.focus());
        } else if (a.type === ir.POINTERDOUBLETAP)
          this.onDoubleTap(d.pointerType);
        else if (a.type === ir.POINTERUP && (this._currentActiveButton === d.button || v)) {
          try {
            u == null || u.releasePointerCapture(d.pointerId);
          } catch {
          }
          v || (this._pointB = null), t._badOS ? this._pointA = this._pointB = null : this._pointB && this._pointA && this._pointA.pointerId == d.pointerId ? (this._pointA = this._pointB, this._pointB = null) : this._pointA && this._pointB && this._pointB.pointerId == d.pointerId ? this._pointB = null : this._pointA = this._pointB = null, (n !== 0 || i) && (this.onMultiTouch(
            this._pointA,
            this._pointB,
            n,
            0,
            // pinchSquaredDistance
            i,
            null
            // multiTouchPanPosition
          ), n = 0, i = null), this._currentActiveButton = -1, this.onButtonUp(d), e || d.preventDefault();
        } else if (a.type === ir.POINTERMOVE) {
          if (e || d.preventDefault(), this._pointA && this._pointB === null) {
            const l = d.clientX - this._pointA.x, P = d.clientY - this._pointA.y;
            this.onTouch(this._pointA, l, P), this._pointA.x = d.clientX, this._pointA.y = d.clientY;
          } else if (this._pointA && this._pointB) {
            const l = this._pointA.pointerId === d.pointerId ? this._pointA : this._pointB;
            l.x = d.clientX, l.y = d.clientY;
            const P = this._pointA.x - this._pointB.x, p = this._pointA.y - this._pointB.y, c = P * P + p * p, H = {
              x: (this._pointA.x + this._pointB.x) / 2,
              y: (this._pointA.y + this._pointB.y) / 2,
              pointerId: d.pointerId,
              type: a.type
            };
            this.onMultiTouch(this._pointA, this._pointB, n, c, i, H), i = H, n = c;
          }
        }
      }
    }, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput, ir.POINTERDOWN | ir.POINTERUP | ir.POINTERMOVE | ir.POINTERDOUBLETAP), this._onLostFocus = () => {
      this._pointA = this._pointB = null, n = 0, i = null, this.onLostFocus();
    }, this._contextMenuBind = (a) => this.onContextMenu(a), r && r.addEventListener("contextmenu", this._contextMenuBind, !1);
    const s = this.camera.getScene().getEngine().getHostWindow();
    s && ye.RegisterTopRootEvents(s, [{ name: "blur", handler: this._onLostFocus }]);
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    if (this._onLostFocus) {
      const e = this.camera.getScene().getEngine().getHostWindow();
      e && ye.UnregisterTopRootEvents(e, [{ name: "blur", handler: this._onLostFocus }]);
    }
    if (this._observer) {
      if (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._observer = null, this._contextMenuBind) {
        const e = this.camera.getScene().getEngine().getInputElement();
        e && e.removeEventListener("contextmenu", this._contextMenuBind);
      }
      this._onLostFocus = null;
    }
    this._altKey = !1, this._ctrlKey = !1, this._metaKey = !1, this._shiftKey = !1, this._buttonsPressed = 0, this._currentActiveButton = -1;
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "BaseCameraPointersInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "pointers";
  }
  /**
   * Called on pointer POINTERDOUBLETAP event.
   * Override this method to provide functionality on POINTERDOUBLETAP event.
   * @param type
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  onDoubleTap(e) {
  }
  /**
   * Called on pointer POINTERMOVE event if only a single touch is active.
   * Override this method to provide functionality.
   * @param point
   * @param offsetX
   * @param offsetY
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  onTouch(e, t, r) {
  }
  /**
   * Called on pointer POINTERMOVE event if multiple touches are active.
   * Override this method to provide functionality.
   * @param _pointA
   * @param _pointB
   * @param previousPinchSquaredDistance
   * @param pinchSquaredDistance
   * @param previousMultiTouchPanPosition
   * @param multiTouchPanPosition
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  onMultiTouch(e, t, r, n, i, s) {
  }
  /**
   * Called on JS contextmenu event.
   * Override this method to provide functionality.
   * @param evt
   */
  onContextMenu(e) {
    e.preventDefault();
  }
  /**
   * Called each time a new POINTERDOWN event occurs. Ie, for each button
   * press.
   * Override this method to provide functionality.
   * @param _evt Defines the event to track
   */
  onButtonDown(e) {
  }
  /**
   * Called each time a new POINTERUP event occurs. Ie, for each button
   * release.
   * Override this method to provide functionality.
   * @param _evt Defines the event to track
   */
  onButtonUp(e) {
  }
  /**
   * Called when window becomes inactive.
   * Override this method to provide functionality.
   */
  onLostFocus() {
  }
}
C([
  M()
], VO.prototype, "buttons", void 0);
var VA = {};
class RR {
  /**
   * Instantiate a new Camera Input Manager.
   * @param camera Defines the camera the input manager belongs to
   */
  constructor(e) {
    this.attachedToElement = !1, this.attached = {}, this.camera = e, this.checkInputs = () => {
    };
  }
  /**
   * Add an input method to a camera
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
   * @param input Camera input method
   */
  add(e) {
    const t = e.getSimpleName();
    if (this.attached[t]) {
      Se.Warn("camera input of type " + t + " already exists on camera");
      return;
    }
    this.attached[t] = e, e.camera = this.camera, e.checkInputs && (this.checkInputs = this._addCheckInputs(e.checkInputs.bind(e))), this.attachedToElement && e.attachControl(this.noPreventDefault);
  }
  /**
   * Remove a specific input method from a camera
   * example: camera.inputs.remove(camera.inputs.attached.mouse);
   * @param inputToRemove camera input method
   */
  remove(e) {
    for (const t in this.attached) {
      const r = this.attached[t];
      if (r === e) {
        r.detachControl(), r.camera = null, delete this.attached[t], this.rebuildInputCheck();
        return;
      }
    }
  }
  /**
   * Remove a specific input type from a camera
   * example: camera.inputs.remove("ArcRotateCameraGamepadInput");
   * @param inputType the type of the input to remove
   */
  removeByType(e) {
    for (const t in this.attached) {
      const r = this.attached[t];
      r.getClassName() === e && (r.detachControl(), r.camera = null, delete this.attached[t], this.rebuildInputCheck());
    }
  }
  _addCheckInputs(e) {
    const t = this.checkInputs;
    return () => {
      t(), e();
    };
  }
  /**
   * Attach the input controls to the currently attached dom element to listen the events from.
   * @param input Defines the input to attach
   */
  attachInput(e) {
    this.attachedToElement && e.attachControl(this.noPreventDefault);
  }
  /**
   * Attach the current manager inputs controls to a specific dom element to listen the events from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachElement(e = !1) {
    if (!this.attachedToElement) {
      e = Tr.ForceAttachControlToAlwaysPreventDefault ? !1 : e, this.attachedToElement = !0, this.noPreventDefault = e;
      for (const t in this.attached)
        this.attached[t].attachControl(e);
    }
  }
  /**
   * Detach the current manager inputs controls from a specific dom element.
   * @param disconnect Defines whether the input should be removed from the current list of attached inputs
   */
  detachElement(e = !1) {
    for (const t in this.attached)
      this.attached[t].detachControl(), e && (this.attached[t].camera = null);
    this.attachedToElement = !1;
  }
  /**
   * Rebuild the dynamic inputCheck function from the current list of
   * defined inputs in the manager.
   */
  rebuildInputCheck() {
    this.checkInputs = () => {
    };
    for (const e in this.attached) {
      const t = this.attached[e];
      t.checkInputs && (this.checkInputs = this._addCheckInputs(t.checkInputs.bind(t)));
    }
  }
  /**
   * Remove all attached input methods from a camera
   */
  clear() {
    this.attachedToElement && this.detachElement(!0), this.attached = {}, this.attachedToElement = !1, this.checkInputs = () => {
    };
  }
  /**
   * Serialize the current input manager attached to a camera.
   * This ensures than once parsed,
   * the input associated to the camera will be identical to the current ones
   * @param serializedCamera Defines the camera serialization JSON the input serialization should write to
   */
  serialize(e) {
    const t = {};
    for (const r in this.attached) {
      const n = this.attached[r], i = jt.Serialize(n);
      t[n.getClassName()] = i;
    }
    e.inputsmgr = t;
  }
  /**
   * Parses an input manager serialized JSON to restore the previous list of inputs
   * and states associated to a camera.
   * @param parsedCamera Defines the JSON to parse
   */
  parse(e) {
    const t = e.inputsmgr;
    if (t) {
      this.clear();
      for (const r in t) {
        const n = VA[r];
        if (n) {
          const i = t[r], s = jt.Parse(() => new n(), i, null);
          this.add(s);
        }
      }
    } else
      for (const r in this.attached) {
        const n = VA[this.attached[r].getClassName()];
        if (n) {
          const i = jt.Parse(() => new n(), e, null);
          this.remove(this.attached[r]), this.add(i);
        }
      }
  }
}
class F6e {
  /**
   * Initializes the gamepad x and y control stick values
   * @param x The x component of the gamepad control stick value
   * @param y The y component of the gamepad control stick value
   */
  constructor(e, t) {
    this.x = e, this.y = t;
  }
}
class N9 {
  /**
   * Specifies if the gamepad has been connected
   */
  get isConnected() {
    return this._isConnected;
  }
  /**
   * Initializes the gamepad
   * @param id The id of the gamepad
   * @param index The index of the gamepad
   * @param browserGamepad The browser gamepad
   * @param leftStickX The x component of the left joystick
   * @param leftStickY The y component of the left joystick
   * @param rightStickX The x component of the right joystick
   * @param rightStickY The y component of the right joystick
   */
  constructor(e, t, r, n = 0, i = 1, s = 2, a = 3) {
    this.id = e, this.index = t, this.browserGamepad = r, this._leftStick = { x: 0, y: 0 }, this._rightStick = { x: 0, y: 0 }, this._isConnected = !0, this._invertLeftStickY = !1, this.type = N9.GAMEPAD, this._leftStickAxisX = n, this._leftStickAxisY = i, this._rightStickAxisX = s, this._rightStickAxisY = a, this.browserGamepad.axes.length >= 2 && (this._leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] }), this.browserGamepad.axes.length >= 4 && (this._rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] });
  }
  /**
   * Callback triggered when the left joystick has changed
   * @param callback
   */
  onleftstickchanged(e) {
    this._onleftstickchanged = e;
  }
  /**
   * Callback triggered when the right joystick has changed
   * @param callback
   */
  onrightstickchanged(e) {
    this._onrightstickchanged = e;
  }
  /**
   * Gets the left joystick
   */
  get leftStick() {
    return this._leftStick;
  }
  /**
   * Sets the left joystick values
   */
  set leftStick(e) {
    this._onleftstickchanged && (this._leftStick.x !== e.x || this._leftStick.y !== e.y) && this._onleftstickchanged(e), this._leftStick = e;
  }
  /**
   * Gets the right joystick
   */
  get rightStick() {
    return this._rightStick;
  }
  /**
   * Sets the right joystick value
   */
  set rightStick(e) {
    this._onrightstickchanged && (this._rightStick.x !== e.x || this._rightStick.y !== e.y) && this._onrightstickchanged(e), this._rightStick = e;
  }
  /**
   * Updates the gamepad joystick positions
   */
  update() {
    this._leftStick && (this.leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] }, this._invertLeftStickY && (this.leftStick.y *= -1)), this._rightStick && (this.rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] });
  }
  /**
   * Disposes the gamepad
   */
  dispose() {
  }
}
N9.GAMEPAD = 0;
N9.GENERIC = 1;
N9.XBOX = 2;
N9.POSE_ENABLED = 3;
N9.DUALSHOCK = 4;
class xee extends N9 {
  /**
   * Callback triggered when a button has been pressed
   * @param callback Called when a button has been pressed
   */
  onbuttondown(e) {
    this._onbuttondown = e;
  }
  /**
   * Callback triggered when a button has been released
   * @param callback Called when a button has been released
   */
  onbuttonup(e) {
    this._onbuttonup = e;
  }
  /**
   * Initializes the generic gamepad
   * @param id The id of the generic gamepad
   * @param index The index of the generic gamepad
   * @param browserGamepad The browser gamepad
   */
  constructor(e, t, r) {
    super(e, t, r), this.onButtonDownObservable = new Oe(), this.onButtonUpObservable = new Oe(), this.type = N9.GENERIC, this._buttons = new Array(r.buttons.length);
  }
  _setButtonValue(e, t, r) {
    return e !== t && (e === 1 && (this._onbuttondown && this._onbuttondown(r), this.onButtonDownObservable.notifyObservers(r)), e === 0 && (this._onbuttonup && this._onbuttonup(r), this.onButtonUpObservable.notifyObservers(r))), e;
  }
  /**
   * Updates the generic gamepad
   */
  update() {
    super.update();
    for (let e = 0; e < this._buttons.length; e++)
      this._buttons[e] = this._setButtonValue(this.browserGamepad.buttons[e].value, this._buttons[e], e);
  }
  /**
   * Disposes the generic gamepad
   */
  dispose() {
    super.dispose(), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear();
  }
}
class VR {
  constructor() {
    this.gamepadRotationSensibility = 80, this.gamepadMoveSensibility = 40, this._yAxisScale = 1;
  }
  /**
   * Gets or sets a boolean indicating that Yaxis (for right stick) should be inverted
   */
  get invertYAxis() {
    return this._yAxisScale !== 1;
  }
  set invertYAxis(e) {
    this._yAxisScale = e ? -1 : 1;
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   */
  attachControl() {
    const e = this.camera.getScene().gamepadManager;
    this._onGamepadConnectedObserver = e.onGamepadConnectedObservable.add((t) => {
      t.type !== N9.POSE_ENABLED && (!this.gamepad || t.type === N9.XBOX) && (this.gamepad = t);
    }), this._onGamepadDisconnectedObserver = e.onGamepadDisconnectedObservable.add((t) => {
      this.gamepad === t && (this.gamepad = null);
    }), this.gamepad = e.getGamepadByType(N9.XBOX);
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), this.gamepad = null;
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    if (this.gamepad) {
      const e = this.camera, t = this.gamepad.rightStick;
      if (t) {
        if (t.x != 0) {
          const n = t.x / this.gamepadRotationSensibility;
          n != 0 && Math.abs(n) > 5e-3 && (e.inertialAlphaOffset += n);
        }
        if (t.y != 0) {
          const n = t.y / this.gamepadRotationSensibility * this._yAxisScale;
          n != 0 && Math.abs(n) > 5e-3 && (e.inertialBetaOffset += n);
        }
      }
      const r = this.gamepad.leftStick;
      if (r && r.y != 0) {
        const n = r.y / this.gamepadMoveSensibility;
        n != 0 && Math.abs(n) > 5e-3 && (this.camera.inertialRadiusOffset -= n);
      }
    }
  }
  /**
   * Gets the class name of the current intput.
   * @returns the class name
   */
  getClassName() {
    return "ArcRotateCameraGamepadInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "gamepad";
  }
}
C([
  M()
], VR.prototype, "gamepadRotationSensibility", void 0);
C([
  M()
], VR.prototype, "gamepadMoveSensibility", void 0);
VA.ArcRotateCameraGamepadInput = VR;
class M0 {
  constructor() {
    this.keysUp = [38], this.keysDown = [40], this.keysLeft = [37], this.keysRight = [39], this.keysReset = [220], this.panningSensibility = 50, this.zoomingSensibility = 25, this.useAltToZoom = !0, this.angularSpeed = 0.01, this._keys = new Array();
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments), !this._onCanvasBlurObserver && (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {
      this._keys.length = 0;
    }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add((t) => {
      const r = t.event;
      if (!r.metaKey) {
        if (t.type === t4.KEYDOWN)
          this._ctrlPressed = r.ctrlKey, this._altPressed = r.altKey, (this.keysUp.indexOf(r.keyCode) !== -1 || this.keysDown.indexOf(r.keyCode) !== -1 || this.keysLeft.indexOf(r.keyCode) !== -1 || this.keysRight.indexOf(r.keyCode) !== -1 || this.keysReset.indexOf(r.keyCode) !== -1) && (this._keys.indexOf(r.keyCode) === -1 && this._keys.push(r.keyCode), r.preventDefault && (e || r.preventDefault()));
        else if (this.keysUp.indexOf(r.keyCode) !== -1 || this.keysDown.indexOf(r.keyCode) !== -1 || this.keysLeft.indexOf(r.keyCode) !== -1 || this.keysRight.indexOf(r.keyCode) !== -1 || this.keysReset.indexOf(r.keyCode) !== -1) {
          const n = this._keys.indexOf(r.keyCode);
          n >= 0 && this._keys.splice(n, 1), r.preventDefault && (e || r.preventDefault());
        }
      }
    }));
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this._scene && (this._onKeyboardObserver && this._scene.onKeyboardObservable.remove(this._onKeyboardObserver), this._onCanvasBlurObserver && this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onKeyboardObserver = null, this._onCanvasBlurObserver = null), this._keys.length = 0;
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    if (this._onKeyboardObserver) {
      const e = this.camera;
      for (let t = 0; t < this._keys.length; t++) {
        const r = this._keys[t];
        this.keysLeft.indexOf(r) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? e.inertialPanningX -= 1 / this.panningSensibility : e.inertialAlphaOffset -= this.angularSpeed : this.keysUp.indexOf(r) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? e.inertialPanningY += 1 / this.panningSensibility : this._altPressed && this.useAltToZoom ? e.inertialRadiusOffset += 1 / this.zoomingSensibility : e.inertialBetaOffset -= this.angularSpeed : this.keysRight.indexOf(r) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? e.inertialPanningX += 1 / this.panningSensibility : e.inertialAlphaOffset += this.angularSpeed : this.keysDown.indexOf(r) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? e.inertialPanningY -= 1 / this.panningSensibility : this._altPressed && this.useAltToZoom ? e.inertialRadiusOffset -= 1 / this.zoomingSensibility : e.inertialBetaOffset += this.angularSpeed : this.keysReset.indexOf(r) !== -1 && e.useInputToRestoreState && e.restoreState();
      }
    }
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "ArcRotateCameraKeyboardMoveInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "keyboard";
  }
}
C([
  M()
], M0.prototype, "keysUp", void 0);
C([
  M()
], M0.prototype, "keysDown", void 0);
C([
  M()
], M0.prototype, "keysLeft", void 0);
C([
  M()
], M0.prototype, "keysRight", void 0);
C([
  M()
], M0.prototype, "keysReset", void 0);
C([
  M()
], M0.prototype, "panningSensibility", void 0);
C([
  M()
], M0.prototype, "zoomingSensibility", void 0);
C([
  M()
], M0.prototype, "useAltToZoom", void 0);
C([
  M()
], M0.prototype, "angularSpeed", void 0);
VA.ArcRotateCameraKeyboardMoveInput = M0;
const N6e = 40;
class AU {
  constructor() {
    this.wheelPrecision = 3, this.zoomToMouseLocation = !1, this.wheelDeltaPercentage = 0, this.customComputeDeltaFromMouseWheel = null, this._viewOffset = new S(0, 0, 0), this._globalOffset = new S(0, 0, 0), this._inertialPanning = S.Zero();
  }
  _computeDeltaFromMouseWheelLegacyEvent(e, t) {
    let r = 0;
    const n = e * 0.01 * this.wheelDeltaPercentage * t;
    return e > 0 ? r = n / (1 + this.wheelDeltaPercentage) : r = n * (1 + this.wheelDeltaPercentage), r;
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments), this._wheel = (t) => {
      if (t.type !== ir.POINTERWHEEL)
        return;
      const r = t.event;
      let n = 0;
      const i = r.deltaMode === wm.DOM_DELTA_LINE ? N6e : 1, s = -(r.deltaY * i);
      if (this.customComputeDeltaFromMouseWheel)
        n = this.customComputeDeltaFromMouseWheel(s, this, r);
      else if (this.wheelDeltaPercentage) {
        if (n = this._computeDeltaFromMouseWheelLegacyEvent(s, this.camera.radius), n > 0) {
          let a = this.camera.radius, f = this.camera.inertialRadiusOffset + n;
          for (let o = 0; o < 20 && Math.abs(f) > 1e-3; o++)
            a -= f, f *= this.camera.inertia;
          a = Xt.Clamp(a, 0, Number.MAX_VALUE), n = this._computeDeltaFromMouseWheelLegacyEvent(s, a);
        }
      } else
        n = s / (this.wheelPrecision * 40);
      n && (this.zoomToMouseLocation ? (this._hitPlane || this._updateHitPlane(), this._zoomToMouse(n)) : this.camera.inertialRadiusOffset += n), r.preventDefault && (e || r.preventDefault());
    }, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel, ir.POINTERWHEEL), this.zoomToMouseLocation && this._inertialPanning.setAll(0);
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this._observer && (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._observer = null, this._wheel = null);
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    if (!this.zoomToMouseLocation)
      return;
    const e = this.camera;
    0 + e.inertialAlphaOffset + e.inertialBetaOffset + e.inertialRadiusOffset && (this._updateHitPlane(), e.target.addInPlace(this._inertialPanning), this._inertialPanning.scaleInPlace(e.inertia), this._zeroIfClose(this._inertialPanning));
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "ArcRotateCameraMouseWheelInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "mousewheel";
  }
  _updateHitPlane() {
    const e = this.camera, t = e.target.subtract(e.position);
    this._hitPlane = BA.FromPositionAndNormal(e.target, t);
  }
  // Get position on the hit plane
  _getPosition() {
    var e;
    const t = this.camera, r = t.getScene(), n = r.createPickingRay(r.pointerX, r.pointerY, he.Identity(), t, !1);
    (t.targetScreenOffset.x !== 0 || t.targetScreenOffset.y !== 0) && (this._viewOffset.set(t.targetScreenOffset.x, t.targetScreenOffset.y, 0), t.getViewMatrix().invertToRef(t._cameraTransformMatrix), this._globalOffset = S.TransformNormal(this._viewOffset, t._cameraTransformMatrix), n.origin.addInPlace(this._globalOffset));
    let i = 0;
    return this._hitPlane && (i = (e = n.intersectsPlane(this._hitPlane)) !== null && e !== void 0 ? e : 0), n.origin.addInPlace(n.direction.scaleInPlace(i));
  }
  _zoomToMouse(e) {
    var t, r;
    const n = this.camera, i = 1 - n.inertia;
    if (n.lowerRadiusLimit) {
      const d = (t = n.lowerRadiusLimit) !== null && t !== void 0 ? t : 0;
      n.radius - (n.inertialRadiusOffset + e) / i < d && (e = (n.radius - d) * i - n.inertialRadiusOffset);
    }
    if (n.upperRadiusLimit) {
      const d = (r = n.upperRadiusLimit) !== null && r !== void 0 ? r : 0;
      n.radius - (n.inertialRadiusOffset + e) / i > d && (e = (n.radius - d) * i - n.inertialRadiusOffset);
    }
    const a = e / i / n.radius, f = this._getPosition(), o = ue.Vector3[6];
    f.subtractToRef(n.target, o), o.scaleInPlace(a), o.scaleInPlace(i), this._inertialPanning.addInPlace(o), n.inertialRadiusOffset += e;
  }
  // Sets x y or z of passed in vector to zero if less than Epsilon.
  _zeroIfClose(e) {
    Math.abs(e.x) < Dn && (e.x = 0), Math.abs(e.y) < Dn && (e.y = 0), Math.abs(e.z) < Dn && (e.z = 0);
  }
}
C([
  M()
], AU.prototype, "wheelPrecision", void 0);
C([
  M()
], AU.prototype, "zoomToMouseLocation", void 0);
C([
  M()
], AU.prototype, "wheelDeltaPercentage", void 0);
VA.ArcRotateCameraMouseWheelInput = AU;
class ku extends VO {
  constructor() {
    super(...arguments), this.buttons = [0, 1, 2], this.angularSensibilityX = 1e3, this.angularSensibilityY = 1e3, this.pinchPrecision = 12, this.pinchDeltaPercentage = 0, this.useNaturalPinchZoom = !1, this.pinchZoom = !0, this.panningSensibility = 1e3, this.multiTouchPanning = !0, this.multiTouchPanAndZoom = !0, this.pinchInwards = !0, this._isPanClick = !1, this._twoFingerActivityCount = 0, this._isPinching = !1;
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "ArcRotateCameraPointersInput";
  }
  /**
   * Move camera from multi touch panning positions.
   * @param previousMultiTouchPanPosition
   * @param multiTouchPanPosition
   */
  _computeMultiTouchPanning(e, t) {
    if (this.panningSensibility !== 0 && e && t) {
      const r = t.x - e.x, n = t.y - e.y;
      this.camera.inertialPanningX += -r / this.panningSensibility, this.camera.inertialPanningY += n / this.panningSensibility;
    }
  }
  /**
   * Move camera from pinch zoom distances.
   * @param previousPinchSquaredDistance
   * @param pinchSquaredDistance
   */
  _computePinchZoom(e, t) {
    const r = this.camera.radius || ku.MinimumRadiusForPinch;
    this.useNaturalPinchZoom ? this.camera.radius = r * Math.sqrt(e) / Math.sqrt(t) : this.pinchDeltaPercentage ? this.camera.inertialRadiusOffset += (t - e) * 1e-3 * r * this.pinchDeltaPercentage : this.camera.inertialRadiusOffset += (t - e) / (this.pinchPrecision * (this.pinchInwards ? 1 : -1) * (this.angularSensibilityX + this.angularSensibilityY) / 2);
  }
  /**
   * Called on pointer POINTERMOVE event if only a single touch is active.
   * @param point
   * @param offsetX
   * @param offsetY
   */
  onTouch(e, t, r) {
    this.panningSensibility !== 0 && (this._ctrlKey && this.camera._useCtrlForPanning || this._isPanClick) ? (this.camera.inertialPanningX += -t / this.panningSensibility, this.camera.inertialPanningY += r / this.panningSensibility) : (this.camera.inertialAlphaOffset -= t / this.angularSensibilityX, this.camera.inertialBetaOffset -= r / this.angularSensibilityY);
  }
  /**
   * Called on pointer POINTERDOUBLETAP event.
   */
  onDoubleTap() {
    this.camera.useInputToRestoreState && this.camera.restoreState();
  }
  /**
   * Called on pointer POINTERMOVE event if multiple touches are active.
   * @param pointA
   * @param pointB
   * @param previousPinchSquaredDistance
   * @param pinchSquaredDistance
   * @param previousMultiTouchPanPosition
   * @param multiTouchPanPosition
   */
  onMultiTouch(e, t, r, n, i, s) {
    r === 0 && i === null || n === 0 && s === null || (this.multiTouchPanAndZoom ? (this._computePinchZoom(r, n), this._computeMultiTouchPanning(i, s)) : this.multiTouchPanning && this.pinchZoom ? (this._twoFingerActivityCount++, this._isPinching || this._twoFingerActivityCount < 20 && Math.abs(Math.sqrt(n) - Math.sqrt(r)) > this.camera.pinchToPanMaxDistance ? (this._computePinchZoom(r, n), this._isPinching = !0) : this._computeMultiTouchPanning(i, s)) : this.multiTouchPanning ? this._computeMultiTouchPanning(i, s) : this.pinchZoom && this._computePinchZoom(r, n));
  }
  /**
   * Called each time a new POINTERDOWN event occurs. Ie, for each button
   * press.
   * @param evt Defines the event to track
   */
  onButtonDown(e) {
    this._isPanClick = e.button === this.camera._panningMouseButton;
  }
  /**
   * Called each time a new POINTERUP event occurs. Ie, for each button
   * release.
   * @param _evt Defines the event to track
   */
  onButtonUp(e) {
    this._twoFingerActivityCount = 0, this._isPinching = !1;
  }
  /**
   * Called when window becomes inactive.
   */
  onLostFocus() {
    this._isPanClick = !1, this._twoFingerActivityCount = 0, this._isPinching = !1;
  }
}
ku.MinimumRadiusForPinch = 1e-3;
C([
  M()
], ku.prototype, "buttons", void 0);
C([
  M()
], ku.prototype, "angularSensibilityX", void 0);
C([
  M()
], ku.prototype, "angularSensibilityY", void 0);
C([
  M()
], ku.prototype, "pinchPrecision", void 0);
C([
  M()
], ku.prototype, "pinchDeltaPercentage", void 0);
C([
  M()
], ku.prototype, "useNaturalPinchZoom", void 0);
C([
  M()
], ku.prototype, "pinchZoom", void 0);
C([
  M()
], ku.prototype, "panningSensibility", void 0);
C([
  M()
], ku.prototype, "multiTouchPanning", void 0);
C([
  M()
], ku.prototype, "multiTouchPanAndZoom", void 0);
VA.ArcRotateCameraPointersInput = ku;
class CO extends RR {
  /**
   * Instantiates a new ArcRotateCameraInputsManager.
   * @param camera Defines the camera the inputs belong to
   */
  constructor(e) {
    super(e);
  }
  /**
   * Add mouse wheel input support to the input manager.
   * @returns the current input manager
   */
  addMouseWheel() {
    return this.add(new AU()), this;
  }
  /**
   * Add pointers input support to the input manager.
   * @returns the current input manager
   */
  addPointers() {
    return this.add(new ku()), this;
  }
  /**
   * Add keyboard input support to the input manager.
   * @returns the current input manager
   */
  addKeyboard() {
    return this.add(new M0()), this;
  }
}
CO.prototype.addVRDeviceOrientation = function() {
  return this.add(new lQ()), this;
};
class lQ {
  /**
   * Instantiate a new ArcRotateCameraVRDeviceOrientationInput.
   */
  constructor() {
    this.alphaCorrection = 1, this.gammaCorrection = 1, this._alpha = 0, this._gamma = 0, this._dirty = !1, this._deviceOrientationHandler = (e) => this._onOrientationEvent(e);
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments), this.camera.attachControl(e);
    const t = this.camera.getScene().getEngine().getHostWindow();
    t && (typeof DeviceOrientationEvent < "u" && typeof DeviceOrientationEvent.requestPermission == "function" ? DeviceOrientationEvent.requestPermission().then((r) => {
      r === "granted" ? t.addEventListener("deviceorientation", this._deviceOrientationHandler) : ye.Warn("Permission not granted.");
    }).catch((r) => {
      ye.Error(r);
    }) : t.addEventListener("deviceorientation", this._deviceOrientationHandler));
  }
  /**
   * @internal
   */
  _onOrientationEvent(e) {
    e.alpha !== null && (this._alpha = (+e.alpha | 0) * this.alphaCorrection), e.gamma !== null && (this._gamma = (+e.gamma | 0) * this.gammaCorrection), this._dirty = !0;
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    this._dirty && (this._dirty = !1, this._gamma < 0 && (this._gamma = 180 + this._gamma), this.camera.alpha = -this._alpha / 180 * Math.PI % Math.PI * 2, this.camera.beta = this._gamma / 180 * Math.PI);
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    window.removeEventListener("deviceorientation", this._deviceOrientationHandler);
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "ArcRotateCameraVRDeviceOrientationInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "VRDeviceOrientation";
  }
}
VA.ArcRotateCameraVRDeviceOrientationInput = lQ;
class jq {
  constructor() {
    this.keysForward = [87], this.keysBackward = [83], this.keysUp = [69], this.keysDown = [81], this.keysRight = [68], this.keysLeft = [65], this._keys = new Array();
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments), !this._onCanvasBlurObserver && (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {
      this._keys.length = 0;
    }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add((t) => {
      const r = t.event;
      if (t.type === t4.KEYDOWN)
        (this.keysForward.indexOf(r.keyCode) !== -1 || this.keysBackward.indexOf(r.keyCode) !== -1 || this.keysUp.indexOf(r.keyCode) !== -1 || this.keysDown.indexOf(r.keyCode) !== -1 || this.keysLeft.indexOf(r.keyCode) !== -1 || this.keysRight.indexOf(r.keyCode) !== -1) && (this._keys.indexOf(r.keyCode) === -1 && this._keys.push(r.keyCode), e || r.preventDefault());
      else if (this.keysForward.indexOf(r.keyCode) !== -1 || this.keysBackward.indexOf(r.keyCode) !== -1 || this.keysUp.indexOf(r.keyCode) !== -1 || this.keysDown.indexOf(r.keyCode) !== -1 || this.keysLeft.indexOf(r.keyCode) !== -1 || this.keysRight.indexOf(r.keyCode) !== -1) {
        const n = this._keys.indexOf(r.keyCode);
        n >= 0 && this._keys.splice(n, 1), e || r.preventDefault();
      }
    }));
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this._scene && (this._onKeyboardObserver && this._scene.onKeyboardObservable.remove(this._onKeyboardObserver), this._onCanvasBlurObserver && this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onKeyboardObserver = null, this._onCanvasBlurObserver = null), this._keys.length = 0;
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "FlyCameraKeyboardInput";
  }
  /**
   * @internal
   */
  _onLostFocus() {
    this._keys.length = 0;
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "keyboard";
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    if (this._onKeyboardObserver) {
      const e = this.camera;
      for (let t = 0; t < this._keys.length; t++) {
        const r = this._keys[t], n = e._computeLocalCameraSpeed();
        this.keysForward.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(0, 0, n) : this.keysBackward.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(0, 0, -n) : this.keysUp.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(0, n, 0) : this.keysDown.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(0, -n, 0) : this.keysRight.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(n, 0, 0) : this.keysLeft.indexOf(r) !== -1 && e._localDirection.copyFromFloats(-n, 0, 0), e.getScene().useRightHandedSystem && (e._localDirection.z *= -1), e.getViewMatrix().invertToRef(e._cameraTransformMatrix), S.TransformNormalToRef(e._localDirection, e._cameraTransformMatrix, e._transformedDirection), e.cameraDirection.addInPlace(e._transformedDirection);
      }
    }
  }
}
C([
  M()
], jq.prototype, "keysForward", void 0);
C([
  M()
], jq.prototype, "keysBackward", void 0);
C([
  M()
], jq.prototype, "keysUp", void 0);
C([
  M()
], jq.prototype, "keysDown", void 0);
C([
  M()
], jq.prototype, "keysRight", void 0);
C([
  M()
], jq.prototype, "keysLeft", void 0);
VA.FlyCameraKeyboardInput = jq;
class CR {
  /**
   * Listen to mouse events to control the camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
   */
  constructor() {
    this.buttons = [0, 1, 2], this.buttonsYaw = [-1, 0, 1], this.buttonsPitch = [-1, 0, 1], this.buttonsRoll = [2], this.activeButton = -1, this.angularSensibility = 1e3, this._previousPosition = null;
  }
  /**
   * Attach the mouse control to the HTML DOM element.
   * @param noPreventDefault Defines whether events caught by the controls should call preventdefault().
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments), this._noPreventDefault = e, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver((t) => {
      this._pointerInput(t);
    }, ir.POINTERDOWN | ir.POINTERUP | ir.POINTERMOVE), this._rollObserver = this.camera.getScene().onBeforeRenderObservable.add(() => {
      this.camera.rollCorrect && this.camera.restoreRoll(this.camera.rollCorrect);
    });
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this._observer && (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver), this._observer = null, this._rollObserver = null, this._previousPosition = null, this._noPreventDefault = void 0);
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name.
   */
  getClassName() {
    return "FlyCameraMouseInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input's friendly name.
   */
  getSimpleName() {
    return "mouse";
  }
  // Track mouse movement, when the pointer is not locked.
  _pointerInput(e) {
    const t = e.event, n = this.camera.getEngine();
    if (!this.touchEnabled && t.pointerType === "touch" || e.type !== ir.POINTERMOVE && this.buttons.indexOf(t.button) === -1)
      return;
    const i = t.target;
    if (e.type === ir.POINTERDOWN) {
      try {
        i == null || i.setPointerCapture(t.pointerId);
      } catch {
      }
      this._previousPosition = {
        x: t.clientX,
        y: t.clientY
      }, this.activeButton = t.button, this._noPreventDefault || (t.preventDefault(), this._element.focus()), n.isPointerLock && this._onMouseMove(e.event);
    } else if (e.type === ir.POINTERUP) {
      try {
        i == null || i.releasePointerCapture(t.pointerId);
      } catch {
      }
      this.activeButton = -1, this._previousPosition = null, this._noPreventDefault || t.preventDefault();
    } else if (e.type === ir.POINTERMOVE) {
      if (!this._previousPosition) {
        n.isPointerLock && this._onMouseMove(e.event);
        return;
      }
      const s = t.clientX - this._previousPosition.x, a = t.clientY - this._previousPosition.y;
      this._rotateCamera(s, a), this._previousPosition = {
        x: t.clientX,
        y: t.clientY
      }, this._noPreventDefault || t.preventDefault();
    }
  }
  // Track mouse movement, when pointer is locked.
  _onMouseMove(e) {
    if (!this.camera.getEngine().isPointerLock)
      return;
    const n = e.movementX, i = e.movementY;
    this._rotateCamera(n, i), this._previousPosition = null, this._noPreventDefault || e.preventDefault();
  }
  /**
   * Rotate camera by mouse offset.
   * @param offsetX
   * @param offsetY
   */
  _rotateCamera(e, t) {
    const r = this.camera, n = r._calculateHandednessMultiplier();
    e *= n;
    const i = e / this.angularSensibility, s = t / this.angularSensibility, a = Ze.RotationYawPitchRoll(r.rotation.y, r.rotation.x, r.rotation.z);
    let f;
    if (this.buttonsPitch.some((o) => o === this.activeButton) && (f = Ze.RotationAxis(bf.X, s), a.multiplyInPlace(f)), this.buttonsYaw.some((o) => o === this.activeButton)) {
      f = Ze.RotationAxis(bf.Y, i), a.multiplyInPlace(f);
      const o = r.bankedTurnLimit + r._trackRoll;
      if (r.bankedTurn && -o < r.rotation.z && r.rotation.z < o) {
        const d = r.bankedTurnMultiplier * -i;
        f = Ze.RotationAxis(bf.Z, d), a.multiplyInPlace(f);
      }
    }
    this.buttonsRoll.some((o) => o === this.activeButton) && (f = Ze.RotationAxis(bf.Z, -i), r._trackRoll -= i, a.multiplyInPlace(f)), a.toEulerAnglesToRef(r.rotation);
  }
}
C([
  M()
], CR.prototype, "buttons", void 0);
C([
  M()
], CR.prototype, "angularSensibility", void 0);
VA.FlyCameraMouseInput = CR;
class aA {
  constructor() {
    this.keysHeightOffsetIncr = [38], this.keysHeightOffsetDecr = [40], this.keysHeightOffsetModifierAlt = !1, this.keysHeightOffsetModifierCtrl = !1, this.keysHeightOffsetModifierShift = !1, this.keysRotationOffsetIncr = [37], this.keysRotationOffsetDecr = [39], this.keysRotationOffsetModifierAlt = !1, this.keysRotationOffsetModifierCtrl = !1, this.keysRotationOffsetModifierShift = !1, this.keysRadiusIncr = [40], this.keysRadiusDecr = [38], this.keysRadiusModifierAlt = !0, this.keysRadiusModifierCtrl = !1, this.keysRadiusModifierShift = !1, this.heightSensibility = 1, this.rotationSensibility = 1, this.radiusSensibility = 1, this._keys = new Array();
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments), !this._onCanvasBlurObserver && (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {
      this._keys.length = 0;
    }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add((t) => {
      const r = t.event;
      if (!r.metaKey) {
        if (t.type === t4.KEYDOWN)
          this._ctrlPressed = r.ctrlKey, this._altPressed = r.altKey, this._shiftPressed = r.shiftKey, (this.keysHeightOffsetIncr.indexOf(r.keyCode) !== -1 || this.keysHeightOffsetDecr.indexOf(r.keyCode) !== -1 || this.keysRotationOffsetIncr.indexOf(r.keyCode) !== -1 || this.keysRotationOffsetDecr.indexOf(r.keyCode) !== -1 || this.keysRadiusIncr.indexOf(r.keyCode) !== -1 || this.keysRadiusDecr.indexOf(r.keyCode) !== -1) && (this._keys.indexOf(r.keyCode) === -1 && this._keys.push(r.keyCode), r.preventDefault && (e || r.preventDefault()));
        else if (this.keysHeightOffsetIncr.indexOf(r.keyCode) !== -1 || this.keysHeightOffsetDecr.indexOf(r.keyCode) !== -1 || this.keysRotationOffsetIncr.indexOf(r.keyCode) !== -1 || this.keysRotationOffsetDecr.indexOf(r.keyCode) !== -1 || this.keysRadiusIncr.indexOf(r.keyCode) !== -1 || this.keysRadiusDecr.indexOf(r.keyCode) !== -1) {
          const n = this._keys.indexOf(r.keyCode);
          n >= 0 && this._keys.splice(n, 1), r.preventDefault && (e || r.preventDefault());
        }
      }
    }));
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this._scene && (this._onKeyboardObserver && this._scene.onKeyboardObservable.remove(this._onKeyboardObserver), this._onCanvasBlurObserver && this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onKeyboardObserver = null, this._onCanvasBlurObserver = null), this._keys.length = 0;
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    this._onKeyboardObserver && this._keys.forEach((e) => {
      this.keysHeightOffsetIncr.indexOf(e) !== -1 && this._modifierHeightOffset() ? this.camera.heightOffset += this.heightSensibility : this.keysHeightOffsetDecr.indexOf(e) !== -1 && this._modifierHeightOffset() ? this.camera.heightOffset -= this.heightSensibility : this.keysRotationOffsetIncr.indexOf(e) !== -1 && this._modifierRotationOffset() ? (this.camera.rotationOffset += this.rotationSensibility, this.camera.rotationOffset %= 360) : this.keysRotationOffsetDecr.indexOf(e) !== -1 && this._modifierRotationOffset() ? (this.camera.rotationOffset -= this.rotationSensibility, this.camera.rotationOffset %= 360) : this.keysRadiusIncr.indexOf(e) !== -1 && this._modifierRadius() ? this.camera.radius += this.radiusSensibility : this.keysRadiusDecr.indexOf(e) !== -1 && this._modifierRadius() && (this.camera.radius -= this.radiusSensibility);
    });
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "FollowCameraKeyboardMoveInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "keyboard";
  }
  /**
   * Check if the pressed modifier keys (Alt/Ctrl/Shift) match those configured to
   * allow modification of the heightOffset value.
   */
  _modifierHeightOffset() {
    return this.keysHeightOffsetModifierAlt === this._altPressed && this.keysHeightOffsetModifierCtrl === this._ctrlPressed && this.keysHeightOffsetModifierShift === this._shiftPressed;
  }
  /**
   * Check if the pressed modifier keys (Alt/Ctrl/Shift) match those configured to
   * allow modification of the rotationOffset value.
   */
  _modifierRotationOffset() {
    return this.keysRotationOffsetModifierAlt === this._altPressed && this.keysRotationOffsetModifierCtrl === this._ctrlPressed && this.keysRotationOffsetModifierShift === this._shiftPressed;
  }
  /**
   * Check if the pressed modifier keys (Alt/Ctrl/Shift) match those configured to
   * allow modification of the radius value.
   */
  _modifierRadius() {
    return this.keysRadiusModifierAlt === this._altPressed && this.keysRadiusModifierCtrl === this._ctrlPressed && this.keysRadiusModifierShift === this._shiftPressed;
  }
}
C([
  M()
], aA.prototype, "keysHeightOffsetIncr", void 0);
C([
  M()
], aA.prototype, "keysHeightOffsetDecr", void 0);
C([
  M()
], aA.prototype, "keysHeightOffsetModifierAlt", void 0);
C([
  M()
], aA.prototype, "keysHeightOffsetModifierCtrl", void 0);
C([
  M()
], aA.prototype, "keysHeightOffsetModifierShift", void 0);
C([
  M()
], aA.prototype, "keysRotationOffsetIncr", void 0);
C([
  M()
], aA.prototype, "keysRotationOffsetDecr", void 0);
C([
  M()
], aA.prototype, "keysRotationOffsetModifierAlt", void 0);
C([
  M()
], aA.prototype, "keysRotationOffsetModifierCtrl", void 0);
C([
  M()
], aA.prototype, "keysRotationOffsetModifierShift", void 0);
C([
  M()
], aA.prototype, "keysRadiusIncr", void 0);
C([
  M()
], aA.prototype, "keysRadiusDecr", void 0);
C([
  M()
], aA.prototype, "keysRadiusModifierAlt", void 0);
C([
  M()
], aA.prototype, "keysRadiusModifierCtrl", void 0);
C([
  M()
], aA.prototype, "keysRadiusModifierShift", void 0);
C([
  M()
], aA.prototype, "heightSensibility", void 0);
C([
  M()
], aA.prototype, "rotationSensibility", void 0);
C([
  M()
], aA.prototype, "radiusSensibility", void 0);
VA.FollowCameraKeyboardMoveInput = aA;
class qD {
  constructor() {
    this.axisControlRadius = !0, this.axisControlHeight = !1, this.axisControlRotation = !1, this.wheelPrecision = 3, this.wheelDeltaPercentage = 0;
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments), this._wheel = (t) => {
      if (t.type !== ir.POINTERWHEEL)
        return;
      const r = t.event;
      let n = 0;
      const i = Math.max(-1, Math.min(1, r.deltaY));
      this.wheelDeltaPercentage ? (console.assert(this.axisControlRadius + this.axisControlHeight + this.axisControlRotation <= 1, "wheelDeltaPercentage only usable when mouse wheel controls ONE axis. Currently enabled: axisControlRadius: " + this.axisControlRadius + ", axisControlHeightOffset: " + this.axisControlHeight + ", axisControlRotationOffset: " + this.axisControlRotation), this.axisControlRadius ? n = i * 0.01 * this.wheelDeltaPercentage * this.camera.radius : this.axisControlHeight ? n = i * 0.01 * this.wheelDeltaPercentage * this.camera.heightOffset : this.axisControlRotation && (n = i * 0.01 * this.wheelDeltaPercentage * this.camera.rotationOffset)) : n = i * this.wheelPrecision, n && (this.axisControlRadius ? this.camera.radius += n : this.axisControlHeight ? this.camera.heightOffset -= n : this.axisControlRotation && (this.camera.rotationOffset -= n)), r.preventDefault && (e || r.preventDefault());
    }, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel, ir.POINTERWHEEL);
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this._observer && (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._observer = null, this._wheel = null);
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "ArcRotateCameraMouseWheelInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "mousewheel";
  }
}
C([
  M()
], qD.prototype, "axisControlRadius", void 0);
C([
  M()
], qD.prototype, "axisControlHeight", void 0);
C([
  M()
], qD.prototype, "axisControlRotation", void 0);
C([
  M()
], qD.prototype, "wheelPrecision", void 0);
C([
  M()
], qD.prototype, "wheelDeltaPercentage", void 0);
VA.FollowCameraMouseWheelInput = qD;
class Eu extends VO {
  constructor() {
    super(...arguments), this.angularSensibilityX = 1, this.angularSensibilityY = 1, this.pinchPrecision = 1e4, this.pinchDeltaPercentage = 0, this.axisXControlRadius = !1, this.axisXControlHeight = !1, this.axisXControlRotation = !0, this.axisYControlRadius = !1, this.axisYControlHeight = !0, this.axisYControlRotation = !1, this.axisPinchControlRadius = !0, this.axisPinchControlHeight = !1, this.axisPinchControlRotation = !1, this.warningEnable = !0, this._warningCounter = 0;
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "FollowCameraPointersInput";
  }
  onTouch(e, t, r) {
    this._warning(), this.axisXControlRotation ? this.camera.rotationOffset += t / this.angularSensibilityX : this.axisYControlRotation && (this.camera.rotationOffset += r / this.angularSensibilityX), this.axisXControlHeight ? this.camera.heightOffset += t / this.angularSensibilityY : this.axisYControlHeight && (this.camera.heightOffset += r / this.angularSensibilityY), this.axisXControlRadius ? this.camera.radius -= t / this.angularSensibilityY : this.axisYControlRadius && (this.camera.radius -= r / this.angularSensibilityY);
  }
  onMultiTouch(e, t, r, n, i, s) {
    if (r === 0 && i === null || n === 0 && s === null)
      return;
    let a = (n - r) / (this.pinchPrecision * (this.angularSensibilityX + this.angularSensibilityY) / 2);
    this.pinchDeltaPercentage ? (a *= 0.01 * this.pinchDeltaPercentage, this.axisPinchControlRotation && (this.camera.rotationOffset += a * this.camera.rotationOffset), this.axisPinchControlHeight && (this.camera.heightOffset += a * this.camera.heightOffset), this.axisPinchControlRadius && (this.camera.radius -= a * this.camera.radius)) : (this.axisPinchControlRotation && (this.camera.rotationOffset += a), this.axisPinchControlHeight && (this.camera.heightOffset += a), this.axisPinchControlRadius && (this.camera.radius -= a));
  }
  _warning() {
    if (!this.warningEnable || this._warningCounter++ % 100 !== 0)
      return;
    const e = "It probably only makes sense to control ONE camera property with each pointer axis. Set 'warningEnable = false' if you are sure. Currently enabled: ";
    console.assert(this.axisXControlRotation + this.axisXControlHeight + this.axisXControlRadius <= 1, e + "axisXControlRotation: " + this.axisXControlRotation + ", axisXControlHeight: " + this.axisXControlHeight + ", axisXControlRadius: " + this.axisXControlRadius), console.assert(this.axisYControlRotation + this.axisYControlHeight + this.axisYControlRadius <= 1, e + "axisYControlRotation: " + this.axisYControlRotation + ", axisYControlHeight: " + this.axisYControlHeight + ", axisYControlRadius: " + this.axisYControlRadius), console.assert(this.axisPinchControlRotation + this.axisPinchControlHeight + this.axisPinchControlRadius <= 1, e + "axisPinchControlRotation: " + this.axisPinchControlRotation + ", axisPinchControlHeight: " + this.axisPinchControlHeight + ", axisPinchControlRadius: " + this.axisPinchControlRadius);
  }
}
C([
  M()
], Eu.prototype, "angularSensibilityX", void 0);
C([
  M()
], Eu.prototype, "angularSensibilityY", void 0);
C([
  M()
], Eu.prototype, "pinchPrecision", void 0);
C([
  M()
], Eu.prototype, "pinchDeltaPercentage", void 0);
C([
  M()
], Eu.prototype, "axisXControlRadius", void 0);
C([
  M()
], Eu.prototype, "axisXControlHeight", void 0);
C([
  M()
], Eu.prototype, "axisXControlRotation", void 0);
C([
  M()
], Eu.prototype, "axisYControlRadius", void 0);
C([
  M()
], Eu.prototype, "axisYControlHeight", void 0);
C([
  M()
], Eu.prototype, "axisYControlRotation", void 0);
C([
  M()
], Eu.prototype, "axisPinchControlRadius", void 0);
C([
  M()
], Eu.prototype, "axisPinchControlHeight", void 0);
C([
  M()
], Eu.prototype, "axisPinchControlRotation", void 0);
VA.FollowCameraPointersInput = Eu;
class wc {
  constructor() {
    this.keysUp = [38], this.keysUpward = [33], this.keysDown = [40], this.keysDownward = [34], this.keysLeft = [37], this.keysRight = [39], this.rotationSpeed = 0.5, this.keysRotateLeft = [], this.keysRotateRight = [], this.keysRotateUp = [], this.keysRotateDown = [], this._keys = new Array();
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments), !this._onCanvasBlurObserver && (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {
      this._keys.length = 0;
    }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add((t) => {
      const r = t.event;
      if (!r.metaKey) {
        if (t.type === t4.KEYDOWN)
          (this.keysUp.indexOf(r.keyCode) !== -1 || this.keysDown.indexOf(r.keyCode) !== -1 || this.keysLeft.indexOf(r.keyCode) !== -1 || this.keysRight.indexOf(r.keyCode) !== -1 || this.keysUpward.indexOf(r.keyCode) !== -1 || this.keysDownward.indexOf(r.keyCode) !== -1 || this.keysRotateLeft.indexOf(r.keyCode) !== -1 || this.keysRotateRight.indexOf(r.keyCode) !== -1 || this.keysRotateUp.indexOf(r.keyCode) !== -1 || this.keysRotateDown.indexOf(r.keyCode) !== -1) && (this._keys.indexOf(r.keyCode) === -1 && this._keys.push(r.keyCode), e || r.preventDefault());
        else if (this.keysUp.indexOf(r.keyCode) !== -1 || this.keysDown.indexOf(r.keyCode) !== -1 || this.keysLeft.indexOf(r.keyCode) !== -1 || this.keysRight.indexOf(r.keyCode) !== -1 || this.keysUpward.indexOf(r.keyCode) !== -1 || this.keysDownward.indexOf(r.keyCode) !== -1 || this.keysRotateLeft.indexOf(r.keyCode) !== -1 || this.keysRotateRight.indexOf(r.keyCode) !== -1 || this.keysRotateUp.indexOf(r.keyCode) !== -1 || this.keysRotateDown.indexOf(r.keyCode) !== -1) {
          const n = this._keys.indexOf(r.keyCode);
          n >= 0 && this._keys.splice(n, 1), e || r.preventDefault();
        }
      }
    }));
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this._scene && (this._onKeyboardObserver && this._scene.onKeyboardObservable.remove(this._onKeyboardObserver), this._onCanvasBlurObserver && this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onKeyboardObserver = null, this._onCanvasBlurObserver = null), this._keys.length = 0;
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    if (this._onKeyboardObserver) {
      const e = this.camera;
      for (let t = 0; t < this._keys.length; t++) {
        const r = this._keys[t], n = e._computeLocalCameraSpeed();
        this.keysLeft.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(-n, 0, 0) : this.keysUp.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(0, 0, n) : this.keysRight.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(n, 0, 0) : this.keysDown.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(0, 0, -n) : this.keysUpward.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(0, n, 0) : this.keysDownward.indexOf(r) !== -1 ? e._localDirection.copyFromFloats(0, -n, 0) : this.keysRotateLeft.indexOf(r) !== -1 ? (e._localDirection.copyFromFloats(0, 0, 0), e.cameraRotation.y -= this._getLocalRotation()) : this.keysRotateRight.indexOf(r) !== -1 ? (e._localDirection.copyFromFloats(0, 0, 0), e.cameraRotation.y += this._getLocalRotation()) : this.keysRotateUp.indexOf(r) !== -1 ? (e._localDirection.copyFromFloats(0, 0, 0), e.cameraRotation.x -= this._getLocalRotation()) : this.keysRotateDown.indexOf(r) !== -1 && (e._localDirection.copyFromFloats(0, 0, 0), e.cameraRotation.x += this._getLocalRotation()), e.getScene().useRightHandedSystem && (e._localDirection.z *= -1), e.getViewMatrix().invertToRef(e._cameraTransformMatrix), S.TransformNormalToRef(e._localDirection, e._cameraTransformMatrix, e._transformedDirection), e.cameraDirection.addInPlace(e._transformedDirection);
      }
    }
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "FreeCameraKeyboardMoveInput";
  }
  /** @internal */
  _onLostFocus() {
    this._keys.length = 0;
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "keyboard";
  }
  _getLocalRotation() {
    const e = this.camera._calculateHandednessMultiplier();
    return this.rotationSpeed * this._engine.getDeltaTime() / 1e3 * e;
  }
}
C([
  M()
], wc.prototype, "keysUp", void 0);
C([
  M()
], wc.prototype, "keysUpward", void 0);
C([
  M()
], wc.prototype, "keysDown", void 0);
C([
  M()
], wc.prototype, "keysDownward", void 0);
C([
  M()
], wc.prototype, "keysLeft", void 0);
C([
  M()
], wc.prototype, "keysRight", void 0);
C([
  M()
], wc.prototype, "rotationSpeed", void 0);
C([
  M()
], wc.prototype, "keysRotateLeft", void 0);
C([
  M()
], wc.prototype, "keysRotateRight", void 0);
C([
  M()
], wc.prototype, "keysRotateUp", void 0);
C([
  M()
], wc.prototype, "keysRotateDown", void 0);
VA.FreeCameraKeyboardMoveInput = wc;
class OR {
  /**
   * Manage the mouse inputs to control the movement of a free camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
   * @param touchEnabled Defines if touch is enabled or not
   */
  constructor(e = !0) {
    this.touchEnabled = e, this.buttons = [0, 1, 2], this.angularSensibility = 2e3, this._previousPosition = null, this.onPointerMovedObservable = new Oe(), this._allowCameraRotation = !0, this._currentActiveButton = -1, this._activePointerId = -1;
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments);
    const t = this.camera.getEngine(), r = t.getInputElement();
    this._pointerInput || (this._pointerInput = (n) => {
      const i = n.event, s = i.pointerType === "touch";
      if (!this.touchEnabled && s || n.type !== ir.POINTERMOVE && this.buttons.indexOf(i.button) === -1)
        return;
      const a = i.target;
      if (n.type === ir.POINTERDOWN) {
        if (s && this._activePointerId !== -1 || !s && this._currentActiveButton !== -1)
          return;
        this._activePointerId = i.pointerId;
        try {
          a == null || a.setPointerCapture(i.pointerId);
        } catch {
        }
        this._currentActiveButton === -1 && (this._currentActiveButton = i.button), this._previousPosition = {
          x: i.clientX,
          y: i.clientY
        }, e || (i.preventDefault(), r && r.focus()), t.isPointerLock && this._onMouseMove && this._onMouseMove(n.event);
      } else if (n.type === ir.POINTERUP) {
        if (s && this._activePointerId !== i.pointerId || !s && this._currentActiveButton !== i.button)
          return;
        try {
          a == null || a.releasePointerCapture(i.pointerId);
        } catch {
        }
        this._currentActiveButton = -1, this._previousPosition = null, e || i.preventDefault(), this._activePointerId = -1;
      } else if (n.type === ir.POINTERMOVE && (this._activePointerId === i.pointerId || !s)) {
        if (t.isPointerLock && this._onMouseMove)
          this._onMouseMove(n.event);
        else if (this._previousPosition) {
          const f = this.camera._calculateHandednessMultiplier(), o = (i.clientX - this._previousPosition.x) * f, d = i.clientY - this._previousPosition.y;
          this._allowCameraRotation && (this.camera.cameraRotation.y += o / this.angularSensibility, this.camera.cameraRotation.x += d / this.angularSensibility), this.onPointerMovedObservable.notifyObservers({ offsetX: o, offsetY: d }), this._previousPosition = {
            x: i.clientX,
            y: i.clientY
          }, e || i.preventDefault();
        }
      }
    }), this._onMouseMove = (n) => {
      if (!t.isPointerLock)
        return;
      const i = this.camera._calculateHandednessMultiplier(), s = n.movementX * i;
      this.camera.cameraRotation.y += s / this.angularSensibility;
      const a = n.movementY;
      this.camera.cameraRotation.x += a / this.angularSensibility, this._previousPosition = null, e || n.preventDefault();
    }, this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput, ir.POINTERDOWN | ir.POINTERUP | ir.POINTERMOVE), r && (this._contextMenuBind = (n) => this.onContextMenu(n), r.addEventListener("contextmenu", this._contextMenuBind, !1));
  }
  /**
   * Called on JS contextmenu event.
   * Override this method to provide functionality.
   * @param evt
   */
  onContextMenu(e) {
    e.preventDefault();
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    if (this._observer) {
      if (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._contextMenuBind) {
        const t = this.camera.getEngine().getInputElement();
        t && t.removeEventListener("contextmenu", this._contextMenuBind);
      }
      this.onPointerMovedObservable && this.onPointerMovedObservable.clear(), this._observer = null, this._onMouseMove = null, this._previousPosition = null;
    }
    this._activePointerId = -1, this._currentActiveButton = -1;
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "FreeCameraMouseInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "mouse";
  }
}
C([
  M()
], OR.prototype, "buttons", void 0);
C([
  M()
], OR.prototype, "angularSensibility", void 0);
VA.FreeCameraMouseInput = OR;
var Ja;
(function(A) {
  A[A.MoveRelative = 0] = "MoveRelative", A[A.RotateRelative = 1] = "RotateRelative", A[A.MoveScene = 2] = "MoveScene";
})(Ja || (Ja = {}));
class L0 extends IR {
  constructor() {
    super(...arguments), this._moveRelative = S.Zero(), this._rotateRelative = S.Zero(), this._moveScene = S.Zero(), this._wheelXAction = Ja.MoveRelative, this._wheelXActionCoordinate = Lx.X, this._wheelYAction = Ja.MoveRelative, this._wheelYActionCoordinate = Lx.Z, this._wheelZAction = null, this._wheelZActionCoordinate = null;
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "FreeCameraMouseWheelInput";
  }
  /**
   * Set which movement axis (relative to camera's orientation) the mouse
   * wheel's X axis controls.
   * @param axis The axis to be moved. Set null to clear.
   */
  set wheelXMoveRelative(e) {
    e === null && this._wheelXAction !== Ja.MoveRelative || (this._wheelXAction = Ja.MoveRelative, this._wheelXActionCoordinate = e);
  }
  /**
   * Get the configured movement axis (relative to camera's orientation) the
   * mouse wheel's X axis controls.
   * @returns The configured axis or null if none.
   */
  get wheelXMoveRelative() {
    return this._wheelXAction !== Ja.MoveRelative ? null : this._wheelXActionCoordinate;
  }
  /**
   * Set which movement axis (relative to camera's orientation) the mouse
   * wheel's Y axis controls.
   * @param axis The axis to be moved. Set null to clear.
   */
  set wheelYMoveRelative(e) {
    e === null && this._wheelYAction !== Ja.MoveRelative || (this._wheelYAction = Ja.MoveRelative, this._wheelYActionCoordinate = e);
  }
  /**
   * Get the configured movement axis (relative to camera's orientation) the
   * mouse wheel's Y axis controls.
   * @returns The configured axis or null if none.
   */
  get wheelYMoveRelative() {
    return this._wheelYAction !== Ja.MoveRelative ? null : this._wheelYActionCoordinate;
  }
  /**
   * Set which movement axis (relative to camera's orientation) the mouse
   * wheel's Z axis controls.
   * @param axis The axis to be moved. Set null to clear.
   */
  set wheelZMoveRelative(e) {
    e === null && this._wheelZAction !== Ja.MoveRelative || (this._wheelZAction = Ja.MoveRelative, this._wheelZActionCoordinate = e);
  }
  /**
   * Get the configured movement axis (relative to camera's orientation) the
   * mouse wheel's Z axis controls.
   * @returns The configured axis or null if none.
   */
  get wheelZMoveRelative() {
    return this._wheelZAction !== Ja.MoveRelative ? null : this._wheelZActionCoordinate;
  }
  /**
   * Set which rotation axis (relative to camera's orientation) the mouse
   * wheel's X axis controls.
   * @param axis The axis to be moved. Set null to clear.
   */
  set wheelXRotateRelative(e) {
    e === null && this._wheelXAction !== Ja.RotateRelative || (this._wheelXAction = Ja.RotateRelative, this._wheelXActionCoordinate = e);
  }
  /**
   * Get the configured rotation axis (relative to camera's orientation) the
   * mouse wheel's X axis controls.
   * @returns The configured axis or null if none.
   */
  get wheelXRotateRelative() {
    return this._wheelXAction !== Ja.RotateRelative ? null : this._wheelXActionCoordinate;
  }
  /**
   * Set which rotation axis (relative to camera's orientation) the mouse
   * wheel's Y axis controls.
   * @param axis The axis to be moved. Set null to clear.
   */
  set wheelYRotateRelative(e) {
    e === null && this._wheelYAction !== Ja.RotateRelative || (this._wheelYAction = Ja.RotateRelative, this._wheelYActionCoordinate = e);
  }
  /**
   * Get the configured rotation axis (relative to camera's orientation) the
   * mouse wheel's Y axis controls.
   * @returns The configured axis or null if none.
   */
  get wheelYRotateRelative() {
    return this._wheelYAction !== Ja.RotateRelative ? null : this._wheelYActionCoordinate;
  }
  /**
   * Set which rotation axis (relative to camera's orientation) the mouse
   * wheel's Z axis controls.
   * @param axis The axis to be moved. Set null to clear.
   */
  set wheelZRotateRelative(e) {
    e === null && this._wheelZAction !== Ja.RotateRelative || (this._wheelZAction = Ja.RotateRelative, this._wheelZActionCoordinate = e);
  }
  /**
   * Get the configured rotation axis (relative to camera's orientation) the
   * mouse wheel's Z axis controls.
   * @returns The configured axis or null if none.
   */
  get wheelZRotateRelative() {
    return this._wheelZAction !== Ja.RotateRelative ? null : this._wheelZActionCoordinate;
  }
  /**
   * Set which movement axis (relative to the scene) the mouse wheel's X axis
   * controls.
   * @param axis The axis to be moved. Set null to clear.
   */
  set wheelXMoveScene(e) {
    e === null && this._wheelXAction !== Ja.MoveScene || (this._wheelXAction = Ja.MoveScene, this._wheelXActionCoordinate = e);
  }
  /**
   * Get the configured movement axis (relative to the scene) the mouse wheel's
   * X axis controls.
   * @returns The configured axis or null if none.
   */
  get wheelXMoveScene() {
    return this._wheelXAction !== Ja.MoveScene ? null : this._wheelXActionCoordinate;
  }
  /**
   * Set which movement axis (relative to the scene) the mouse wheel's Y axis
   * controls.
   * @param axis The axis to be moved. Set null to clear.
   */
  set wheelYMoveScene(e) {
    e === null && this._wheelYAction !== Ja.MoveScene || (this._wheelYAction = Ja.MoveScene, this._wheelYActionCoordinate = e);
  }
  /**
   * Get the configured movement axis (relative to the scene) the mouse wheel's
   * Y axis controls.
   * @returns The configured axis or null if none.
   */
  get wheelYMoveScene() {
    return this._wheelYAction !== Ja.MoveScene ? null : this._wheelYActionCoordinate;
  }
  /**
   * Set which movement axis (relative to the scene) the mouse wheel's Z axis
   * controls.
   * @param axis The axis to be moved. Set null to clear.
   */
  set wheelZMoveScene(e) {
    e === null && this._wheelZAction !== Ja.MoveScene || (this._wheelZAction = Ja.MoveScene, this._wheelZActionCoordinate = e);
  }
  /**
   * Get the configured movement axis (relative to the scene) the mouse wheel's
   * Z axis controls.
   * @returns The configured axis or null if none.
   */
  get wheelZMoveScene() {
    return this._wheelZAction !== Ja.MoveScene ? null : this._wheelZActionCoordinate;
  }
  /**
   * Called for each rendered frame.
   */
  checkInputs() {
    if (this._wheelDeltaX === 0 && this._wheelDeltaY === 0 && this._wheelDeltaZ == 0)
      return;
    this._moveRelative.setAll(0), this._rotateRelative.setAll(0), this._moveScene.setAll(0), this._updateCamera(), this.camera.getScene().useRightHandedSystem && (this._moveRelative.z *= -1);
    const e = he.Zero();
    this.camera.getViewMatrix().invertToRef(e);
    const t = S.Zero();
    S.TransformNormalToRef(this._moveRelative, e, t), this.camera.cameraRotation.x += this._rotateRelative.x / 200, this.camera.cameraRotation.y += this._rotateRelative.y / 200, this.camera.cameraDirection.addInPlace(t), this.camera.cameraDirection.addInPlace(this._moveScene), super.checkInputs();
  }
  /**
   * Update the camera according to any configured properties for the 3
   * mouse-wheel axis.
   */
  _updateCamera() {
    this._updateCameraProperty(this._wheelDeltaX, this._wheelXAction, this._wheelXActionCoordinate), this._updateCameraProperty(this._wheelDeltaY, this._wheelYAction, this._wheelYActionCoordinate), this._updateCameraProperty(this._wheelDeltaZ, this._wheelZAction, this._wheelZActionCoordinate);
  }
  /**
   * Update one property of the camera.
   * @param value
   * @param cameraProperty
   * @param coordinate
   */
  _updateCameraProperty(e, t, r) {
    if (e === 0 || t === null || r === null)
      return;
    let n = null;
    switch (t) {
      case Ja.MoveRelative:
        n = this._moveRelative;
        break;
      case Ja.RotateRelative:
        n = this._rotateRelative;
        break;
      case Ja.MoveScene:
        n = this._moveScene;
        break;
    }
    switch (r) {
      case Lx.X:
        n.set(e, 0, 0);
        break;
      case Lx.Y:
        n.set(0, e, 0);
        break;
      case Lx.Z:
        n.set(0, 0, e);
        break;
    }
  }
}
C([
  M()
], L0.prototype, "wheelXMoveRelative", null);
C([
  M()
], L0.prototype, "wheelYMoveRelative", null);
C([
  M()
], L0.prototype, "wheelZMoveRelative", null);
C([
  M()
], L0.prototype, "wheelXRotateRelative", null);
C([
  M()
], L0.prototype, "wheelYRotateRelative", null);
C([
  M()
], L0.prototype, "wheelZRotateRelative", null);
C([
  M()
], L0.prototype, "wheelXMoveScene", null);
C([
  M()
], L0.prototype, "wheelYMoveScene", null);
C([
  M()
], L0.prototype, "wheelZMoveScene", null);
VA.FreeCameraMouseWheelInput = L0;
class yR {
  /**
   * Manage the touch inputs to control the movement of a free camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
   * @param allowMouse Defines if mouse events can be treated as touch events
   */
  constructor(e = !1) {
    this.allowMouse = e, this.touchAngularSensibility = 2e5, this.touchMoveSensibility = 250, this.singleFingerRotate = !1, this._offsetX = null, this._offsetY = null, this._pointerPressed = new Array(), this._isSafari = ye.IsSafari();
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e) {
    e = ye.BackCompatCameraNoPreventDefault(arguments);
    let t = null;
    if (this._pointerInput === void 0 && (this._onLostFocus = () => {
      this._offsetX = null, this._offsetY = null;
    }, this._pointerInput = (r) => {
      const n = r.event, i = n.pointerType === "mouse" || this._isSafari && typeof n.pointerType > "u";
      if (!(!this.allowMouse && i)) {
        if (r.type === ir.POINTERDOWN) {
          if (e || n.preventDefault(), this._pointerPressed.push(n.pointerId), this._pointerPressed.length !== 1)
            return;
          t = {
            x: n.clientX,
            y: n.clientY
          };
        } else if (r.type === ir.POINTERUP) {
          e || n.preventDefault();
          const s = this._pointerPressed.indexOf(n.pointerId);
          if (s === -1 || (this._pointerPressed.splice(s, 1), s != 0))
            return;
          t = null, this._offsetX = null, this._offsetY = null;
        } else if (r.type === ir.POINTERMOVE) {
          if (e || n.preventDefault(), !t || this._pointerPressed.indexOf(n.pointerId) != 0)
            return;
          this._offsetX = n.clientX - t.x, this._offsetY = -(n.clientY - t.y);
        }
      }
    }), this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput, ir.POINTERDOWN | ir.POINTERUP | ir.POINTERMOVE), this._onLostFocus) {
      const n = this.camera.getEngine().getInputElement();
      n && n.addEventListener("blur", this._onLostFocus);
    }
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    if (this._pointerInput) {
      if (this._observer && (this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer), this._observer = null), this._onLostFocus) {
        const t = this.camera.getEngine().getInputElement();
        t && t.removeEventListener("blur", this._onLostFocus), this._onLostFocus = null;
      }
      this._pointerPressed.length = 0, this._offsetX = null, this._offsetY = null;
    }
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    if (this._offsetX === null || this._offsetY === null || this._offsetX === 0 && this._offsetY === 0)
      return;
    const e = this.camera, t = e._calculateHandednessMultiplier();
    if (e.cameraRotation.y = t * this._offsetX / this.touchAngularSensibility, this.singleFingerRotate && this._pointerPressed.length === 1 || !this.singleFingerRotate && this._pointerPressed.length > 1)
      e.cameraRotation.x = -this._offsetY / this.touchAngularSensibility;
    else {
      const n = e._computeLocalCameraSpeed(), i = new S(0, 0, this.touchMoveSensibility !== 0 ? n * this._offsetY / this.touchMoveSensibility : 0);
      he.RotationYawPitchRollToRef(e.rotation.y, e.rotation.x, 0, e._cameraRotationMatrix), e.cameraDirection.addInPlace(S.TransformCoordinates(i, e._cameraRotationMatrix));
    }
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "FreeCameraTouchInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "touch";
  }
}
C([
  M()
], yR.prototype, "touchAngularSensibility", void 0);
C([
  M()
], yR.prototype, "touchMoveSensibility", void 0);
VA.FreeCameraTouchInput = yR;
class kR extends RR {
  /**
   * Instantiates a new FreeCameraInputsManager.
   * @param camera Defines the camera the inputs belong to
   */
  constructor(e) {
    super(e), this._mouseInput = null, this._mouseWheelInput = null;
  }
  /**
   * Add keyboard input support to the input manager.
   * @returns the current input manager
   */
  addKeyboard() {
    return this.add(new wc()), this;
  }
  /**
   * Add mouse input support to the input manager.
   * @param touchEnabled if the FreeCameraMouseInput should support touch (default: true)
   * @returns the current input manager
   */
  addMouse(e = !0) {
    return this._mouseInput || (this._mouseInput = new OR(e), this.add(this._mouseInput)), this;
  }
  /**
   * Removes the mouse input support from the manager
   * @returns the current input manager
   */
  removeMouse() {
    return this._mouseInput && this.remove(this._mouseInput), this;
  }
  /**
   * Add mouse wheel input support to the input manager.
   * @returns the current input manager
   */
  addMouseWheel() {
    return this._mouseWheelInput || (this._mouseWheelInput = new L0(), this.add(this._mouseWheelInput)), this;
  }
  /**
   * Removes the mouse wheel input support from the manager
   * @returns the current input manager
   */
  removeMouseWheel() {
    return this._mouseWheelInput && this.remove(this._mouseWheelInput), this;
  }
  /**
   * Add touch input support to the input manager.
   * @returns the current input manager
   */
  addTouch() {
    return this.add(new yR()), this;
  }
  /**
   * Remove all attached input methods from a camera
   */
  clear() {
    super.clear(), this._mouseInput = null;
  }
}
kR.prototype.addDeviceOrientation = function(A) {
  return this._deviceOrientationInput || (this._deviceOrientationInput = new PQ(), A && (this._deviceOrientationInput.smoothFactor = A), this.add(this._deviceOrientationInput)), this;
};
class PQ {
  /**
   * Can be used to detect if a device orientation sensor is available on a device
   * @param timeout amount of time in milliseconds to wait for a response from the sensor (default: infinite)
   * @returns a promise that will resolve on orientation change
   */
  static WaitForOrientationChangeAsync(e) {
    return new Promise((t, r) => {
      let n = !1;
      const i = () => {
        window.removeEventListener("deviceorientation", i), n = !0, t();
      };
      e && setTimeout(() => {
        n || (window.removeEventListener("deviceorientation", i), r("WaitForOrientationChangeAsync timed out"));
      }, e), typeof DeviceOrientationEvent < "u" && typeof DeviceOrientationEvent.requestPermission == "function" ? DeviceOrientationEvent.requestPermission().then((s) => {
        s == "granted" ? window.addEventListener("deviceorientation", i) : ye.Warn("Permission not granted.");
      }).catch((s) => {
        ye.Error(s);
      }) : window.addEventListener("deviceorientation", i);
    });
  }
  /**
   * Instantiates a new input
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
   */
  constructor() {
    this._screenOrientationAngle = 0, this._screenQuaternion = new Ze(), this._alpha = 0, this._beta = 0, this._gamma = 0, this.smoothFactor = 0, this._onDeviceOrientationChangedObservable = new Oe(), this._orientationChanged = () => {
      this._screenOrientationAngle = window.orientation !== void 0 ? +window.orientation : window.screen.orientation && window.screen.orientation.angle ? window.screen.orientation.angle : 0, this._screenOrientationAngle = -ye.ToRadians(this._screenOrientationAngle / 2), this._screenQuaternion.copyFromFloats(0, Math.sin(this._screenOrientationAngle), 0, Math.cos(this._screenOrientationAngle));
    }, this._deviceOrientation = (e) => {
      this.smoothFactor ? (this._alpha = e.alpha !== null ? ye.SmoothAngleChange(this._alpha, e.alpha, this.smoothFactor) : 0, this._beta = e.beta !== null ? ye.SmoothAngleChange(this._beta, e.beta, this.smoothFactor) : 0, this._gamma = e.gamma !== null ? ye.SmoothAngleChange(this._gamma, e.gamma, this.smoothFactor) : 0) : (this._alpha = e.alpha !== null ? e.alpha : 0, this._beta = e.beta !== null ? e.beta : 0, this._gamma = e.gamma !== null ? e.gamma : 0), e.alpha !== null && this._onDeviceOrientationChangedObservable.notifyObservers();
    }, this._constantTranform = new Ze(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)), this._orientationChanged();
  }
  /**
   * Define the camera controlled by the input.
   */
  get camera() {
    return this._camera;
  }
  set camera(e) {
    this._camera = e, this._camera != null && !this._camera.rotationQuaternion && (this._camera.rotationQuaternion = new Ze()), this._camera && this._camera.onDisposeObservable.add(() => {
      this._onDeviceOrientationChangedObservable.clear();
    });
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   */
  attachControl() {
    const e = this.camera.getScene().getEngine().getHostWindow();
    if (e) {
      const t = () => {
        e.addEventListener("orientationchange", this._orientationChanged), e.addEventListener("deviceorientation", this._deviceOrientation), this._orientationChanged();
      };
      typeof DeviceOrientationEvent < "u" && typeof DeviceOrientationEvent.requestPermission == "function" ? DeviceOrientationEvent.requestPermission().then((r) => {
        r === "granted" ? t() : ye.Warn("Permission not granted.");
      }).catch((r) => {
        ye.Error(r);
      }) : t();
    }
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    window.removeEventListener("orientationchange", this._orientationChanged), window.removeEventListener("deviceorientation", this._deviceOrientation), this._alpha = 0;
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    this._alpha && (Ze.RotationYawPitchRollToRef(ye.ToRadians(this._alpha), ye.ToRadians(this._beta), -ye.ToRadians(this._gamma), this.camera.rotationQuaternion), this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion), this._camera.rotationQuaternion.multiplyInPlace(this._constantTranform), this._camera.rotationQuaternion.z *= -1, this._camera.rotationQuaternion.w *= -1);
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "FreeCameraDeviceOrientationInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "deviceOrientation";
  }
}
VA.FreeCameraDeviceOrientationInput = PQ;
class ER {
  constructor() {
    this.gamepadAngularSensibility = 200, this.gamepadMoveSensibility = 40, this.deadzoneDelta = 0.1, this._yAxisScale = 1, this._cameraTransform = he.Identity(), this._deltaTransform = S.Zero(), this._vector3 = S.Zero(), this._vector2 = at.Zero();
  }
  /**
   * Gets or sets a boolean indicating that Yaxis (for right stick) should be inverted
   */
  get invertYAxis() {
    return this._yAxisScale !== 1;
  }
  set invertYAxis(e) {
    this._yAxisScale = e ? -1 : 1;
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   */
  attachControl() {
    const e = this.camera.getScene().gamepadManager;
    this._onGamepadConnectedObserver = e.onGamepadConnectedObservable.add((t) => {
      t.type !== N9.POSE_ENABLED && (!this.gamepad || t.type === N9.XBOX) && (this.gamepad = t);
    }), this._onGamepadDisconnectedObserver = e.onGamepadDisconnectedObservable.add((t) => {
      this.gamepad === t && (this.gamepad = null);
    }), this.gamepad = e.getGamepadByType(N9.XBOX), !this.gamepad && e.gamepads.length && (this.gamepad = e.gamepads[0]);
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), this.gamepad = null;
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    if (this.gamepad && this.gamepad.leftStick) {
      const e = this.camera, t = this.gamepad.leftStick;
      this.gamepadMoveSensibility !== 0 && (t.x = Math.abs(t.x) > this.deadzoneDelta ? t.x / this.gamepadMoveSensibility : 0, t.y = Math.abs(t.y) > this.deadzoneDelta ? t.y / this.gamepadMoveSensibility : 0);
      let r = this.gamepad.rightStick;
      r && this.gamepadAngularSensibility !== 0 ? (r.x = Math.abs(r.x) > this.deadzoneDelta ? r.x / this.gamepadAngularSensibility : 0, r.y = (Math.abs(r.y) > this.deadzoneDelta ? r.y / this.gamepadAngularSensibility : 0) * this._yAxisScale) : r = { x: 0, y: 0 }, e.rotationQuaternion ? e.rotationQuaternion.toRotationMatrix(this._cameraTransform) : he.RotationYawPitchRollToRef(e.rotation.y, e.rotation.x, 0, this._cameraTransform);
      const n = e._computeLocalCameraSpeed() * 50;
      this._vector3.copyFromFloats(t.x * n, 0, -t.y * n), S.TransformCoordinatesToRef(this._vector3, this._cameraTransform, this._deltaTransform), e.cameraDirection.addInPlace(this._deltaTransform), this._vector2.copyFromFloats(r.y, r.x), e.cameraRotation.addInPlace(this._vector2);
    }
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "FreeCameraGamepadInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "gamepad";
  }
}
C([
  M()
], ER.prototype, "gamepadAngularSensibility", void 0);
C([
  M()
], ER.prototype, "gamepadMoveSensibility", void 0);
VA.FreeCameraGamepadInput = ER;
var V9;
(function(A) {
  A[A.X = 0] = "X", A[A.Y = 1] = "Y", A[A.Z = 2] = "Z";
})(V9 || (V9 = {}));
class $r {
  static _GetDefaultOptions() {
    return {
      puckSize: 40,
      containerSize: 60,
      color: "cyan",
      puckImage: void 0,
      containerImage: void 0,
      position: void 0,
      alwaysVisible: !1,
      limitToContainer: !1
    };
  }
  /**
   * Creates a new virtual joystick
   * @param leftJoystick defines that the joystick is for left hand (false by default)
   * @param customizations Defines the options we want to customize the VirtualJoystick
   */
  constructor(e, t) {
    this._released = !1;
    const r = Object.assign(Object.assign({}, $r._GetDefaultOptions()), t);
    if (e ? this._leftJoystick = !0 : this._leftJoystick = !1, $r._GlobalJoystickIndex++, this._axisTargetedByLeftAndRight = V9.X, this._axisTargetedByUpAndDown = V9.Y, this.reverseLeftRight = !1, this.reverseUpDown = !1, this._touches = new YC(), this.deltaPosition = S.Zero(), this._joystickSensibility = 25, this._inversedSensibility = 1 / (this._joystickSensibility / 1e3), this._onResize = () => {
      $r._VJCanvasWidth = window.innerWidth, $r._VJCanvasHeight = window.innerHeight, $r.Canvas && ($r.Canvas.width = $r._VJCanvasWidth, $r.Canvas.height = $r._VJCanvasHeight), $r._HalfWidth = $r._VJCanvasWidth / 2;
    }, !$r.Canvas) {
      window.addEventListener("resize", this._onResize, !1), $r.Canvas = document.createElement("canvas"), $r._VJCanvasWidth = window.innerWidth, $r._VJCanvasHeight = window.innerHeight, $r.Canvas.width = window.innerWidth, $r.Canvas.height = window.innerHeight, $r.Canvas.style.width = "100%", $r.Canvas.style.height = "100%", $r.Canvas.style.position = "absolute", $r.Canvas.style.backgroundColor = "transparent", $r.Canvas.style.top = "0px", $r.Canvas.style.left = "0px", $r.Canvas.style.zIndex = "5", $r.Canvas.style.touchAction = "none", $r.Canvas.setAttribute("touch-action", "none");
      const n = $r.Canvas.getContext("2d");
      if (!n)
        throw new Error("Unable to create canvas for virtual joystick");
      $r._VJCanvasContext = n, $r._VJCanvasContext.strokeStyle = "#ffffff", $r._VJCanvasContext.lineWidth = 2, document.body.appendChild($r.Canvas);
    }
    $r._HalfWidth = $r.Canvas.width / 2, this.pressed = !1, this.limitToContainer = r.limitToContainer, this._joystickColor = r.color, this.containerSize = r.containerSize, this.puckSize = r.puckSize, r.position && this.setPosition(r.position.x, r.position.y), r.puckImage && this.setPuckImage(r.puckImage), r.containerImage && this.setContainerImage(r.containerImage), r.alwaysVisible && $r._AlwaysVisibleSticks++, this.alwaysVisible = r.alwaysVisible, this._joystickPointerId = -1, this._joystickPointerPos = new at(0, 0), this._joystickPreviousPointerPos = new at(0, 0), this._joystickPointerStartPos = new at(0, 0), this._deltaJoystickVector = new at(0, 0), this._onPointerDownHandlerRef = (n) => {
      this._onPointerDown(n);
    }, this._onPointerMoveHandlerRef = (n) => {
      this._onPointerMove(n);
    }, this._onPointerUpHandlerRef = (n) => {
      this._onPointerUp(n);
    }, $r.Canvas.addEventListener("pointerdown", this._onPointerDownHandlerRef, !1), $r.Canvas.addEventListener("pointermove", this._onPointerMoveHandlerRef, !1), $r.Canvas.addEventListener("pointerup", this._onPointerUpHandlerRef, !1), $r.Canvas.addEventListener("pointerout", this._onPointerUpHandlerRef, !1), $r.Canvas.addEventListener("contextmenu", (n) => {
      n.preventDefault();
    }, !1), requestAnimationFrame(() => {
      this._drawVirtualJoystick();
    });
  }
  /**
   * Defines joystick sensibility (ie. the ratio between a physical move and virtual joystick position change)
   * @param newJoystickSensibility defines the new sensibility
   */
  setJoystickSensibility(e) {
    this._joystickSensibility = e, this._inversedSensibility = 1 / (this._joystickSensibility / 1e3);
  }
  _onPointerDown(e) {
    let t;
    e.preventDefault(), this._leftJoystick === !0 ? t = e.clientX < $r._HalfWidth : t = e.clientX > $r._HalfWidth, t && this._joystickPointerId < 0 ? (this._joystickPointerId = e.pointerId, this._joystickPosition ? (this._joystickPointerStartPos = this._joystickPosition.clone(), this._joystickPointerPos = this._joystickPosition.clone(), this._joystickPreviousPointerPos = this._joystickPosition.clone(), this._onPointerMove(e)) : (this._joystickPointerStartPos.x = e.clientX, this._joystickPointerStartPos.y = e.clientY, this._joystickPointerPos = this._joystickPointerStartPos.clone(), this._joystickPreviousPointerPos = this._joystickPointerStartPos.clone()), this._deltaJoystickVector.x = 0, this._deltaJoystickVector.y = 0, this.pressed = !0, this._touches.add(e.pointerId.toString(), e)) : $r._GlobalJoystickIndex < 2 && this._action && (this._action(), this._touches.add(e.pointerId.toString(), { x: e.clientX, y: e.clientY, prevX: e.clientX, prevY: e.clientY }));
  }
  _onPointerMove(e) {
    if (this._joystickPointerId == e.pointerId) {
      if (this.limitToContainer) {
        const s = new at(e.clientX - this._joystickPointerStartPos.x, e.clientY - this._joystickPointerStartPos.y), a = s.length();
        a > this.containerSize && s.scaleInPlace(this.containerSize / a), this._joystickPointerPos.x = this._joystickPointerStartPos.x + s.x, this._joystickPointerPos.y = this._joystickPointerStartPos.y + s.y;
      } else
        this._joystickPointerPos.x = e.clientX, this._joystickPointerPos.y = e.clientY;
      this._deltaJoystickVector = this._joystickPointerPos.clone(), this._deltaJoystickVector = this._deltaJoystickVector.subtract(this._joystickPointerStartPos), 0 < $r._AlwaysVisibleSticks && (this._leftJoystick ? this._joystickPointerPos.x = Math.min($r._HalfWidth, this._joystickPointerPos.x) : this._joystickPointerPos.x = Math.max($r._HalfWidth, this._joystickPointerPos.x));
      const r = (this.reverseLeftRight ? -1 : 1) * this._deltaJoystickVector.x / this._inversedSensibility;
      switch (this._axisTargetedByLeftAndRight) {
        case V9.X:
          this.deltaPosition.x = Math.min(1, Math.max(-1, r));
          break;
        case V9.Y:
          this.deltaPosition.y = Math.min(1, Math.max(-1, r));
          break;
        case V9.Z:
          this.deltaPosition.z = Math.min(1, Math.max(-1, r));
          break;
      }
      const i = (this.reverseUpDown ? 1 : -1) * this._deltaJoystickVector.y / this._inversedSensibility;
      switch (this._axisTargetedByUpAndDown) {
        case V9.X:
          this.deltaPosition.x = Math.min(1, Math.max(-1, i));
          break;
        case V9.Y:
          this.deltaPosition.y = Math.min(1, Math.max(-1, i));
          break;
        case V9.Z:
          this.deltaPosition.z = Math.min(1, Math.max(-1, i));
          break;
      }
    } else {
      const t = this._touches.get(e.pointerId.toString());
      t && (t.x = e.clientX, t.y = e.clientY);
    }
  }
  _onPointerUp(e) {
    if (this._joystickPointerId == e.pointerId)
      this._clearPreviousDraw(), this._joystickPointerId = -1, this.pressed = !1;
    else {
      const t = this._touches.get(e.pointerId.toString());
      t && $r._VJCanvasContext.clearRect(t.prevX - 44, t.prevY - 44, 88, 88);
    }
    this._deltaJoystickVector.x = 0, this._deltaJoystickVector.y = 0, this._touches.remove(e.pointerId.toString());
  }
  /**
   * Change the color of the virtual joystick
   * @param newColor a string that must be a CSS color value (like "red") or the hexa value (like "#FF0000")
   */
  setJoystickColor(e) {
    this._joystickColor = e;
  }
  /**
   * Size of the joystick's container
   */
  set containerSize(e) {
    this._joystickContainerSize = e, this._clearContainerSize = ~~(this._joystickContainerSize * 2.1), this._clearContainerSizeOffset = ~~(this._clearContainerSize / 2);
  }
  get containerSize() {
    return this._joystickContainerSize;
  }
  /**
   * Size of the joystick's puck
   */
  set puckSize(e) {
    this._joystickPuckSize = e, this._clearPuckSize = ~~(this._joystickPuckSize * 2.1), this._clearPuckSizeOffset = ~~(this._clearPuckSize / 2);
  }
  get puckSize() {
    return this._joystickPuckSize;
  }
  /**
   * Clears the set position of the joystick
   */
  clearPosition() {
    this.alwaysVisible = !1, this._joystickPosition = null;
  }
  /**
   * Defines whether or not the joystick container is always visible
   */
  set alwaysVisible(e) {
    this._alwaysVisible !== e && (e && this._joystickPosition ? ($r._AlwaysVisibleSticks++, this._alwaysVisible = !0) : ($r._AlwaysVisibleSticks--, this._alwaysVisible = !1));
  }
  get alwaysVisible() {
    return this._alwaysVisible;
  }
  /**
   * Sets the constant position of the Joystick container
   * @param x X axis coordinate
   * @param y Y axis coordinate
   */
  setPosition(e, t) {
    this._joystickPointerStartPos && this._clearPreviousDraw(), this._joystickPosition = new at(e, t);
  }
  /**
   * Defines a callback to call when the joystick is touched
   * @param action defines the callback
   */
  setActionOnTouch(e) {
    this._action = e;
  }
  /**
   * Defines which axis you'd like to control for left & right
   * @param axis defines the axis to use
   */
  setAxisForLeftRight(e) {
    switch (e) {
      case V9.X:
      case V9.Y:
      case V9.Z:
        this._axisTargetedByLeftAndRight = e;
        break;
      default:
        this._axisTargetedByLeftAndRight = V9.X;
        break;
    }
  }
  /**
   * Defines which axis you'd like to control for up & down
   * @param axis defines the axis to use
   */
  setAxisForUpDown(e) {
    switch (e) {
      case V9.X:
      case V9.Y:
      case V9.Z:
        this._axisTargetedByUpAndDown = e;
        break;
      default:
        this._axisTargetedByUpAndDown = V9.Y;
        break;
    }
  }
  /**
   * Clears the canvas from the previous puck / container draw
   */
  _clearPreviousDraw() {
    const e = this._joystickPosition || this._joystickPointerStartPos;
    $r._VJCanvasContext.clearRect(e.x - this._clearContainerSizeOffset, e.y - this._clearContainerSizeOffset, this._clearContainerSize, this._clearContainerSize), $r._VJCanvasContext.clearRect(this._joystickPreviousPointerPos.x - this._clearPuckSizeOffset - 1, this._joystickPreviousPointerPos.y - this._clearPuckSizeOffset - 1, this._clearPuckSize + 2, this._clearPuckSize + 2);
  }
  /**
   * Loads `urlPath` to be used for the container's image
   * @param urlPath defines the urlPath of an image to use
   */
  setContainerImage(e) {
    const t = new Image();
    t.src = e, t.onload = () => this._containerImage = t;
  }
  /**
   * Loads `urlPath` to be used for the puck's image
   * @param urlPath defines the urlPath of an image to use
   */
  setPuckImage(e) {
    const t = new Image();
    t.src = e, t.onload = () => this._puckImage = t;
  }
  /**
   * Draws the Virtual Joystick's container
   */
  _drawContainer() {
    const e = this._joystickPosition || this._joystickPointerStartPos;
    this._clearPreviousDraw(), this._containerImage ? $r._VJCanvasContext.drawImage(this._containerImage, e.x - this.containerSize, e.y - this.containerSize, this.containerSize * 2, this.containerSize * 2) : ($r._VJCanvasContext.beginPath(), $r._VJCanvasContext.strokeStyle = this._joystickColor, $r._VJCanvasContext.lineWidth = 2, $r._VJCanvasContext.arc(e.x, e.y, this.containerSize, 0, Math.PI * 2, !0), $r._VJCanvasContext.stroke(), $r._VJCanvasContext.closePath(), $r._VJCanvasContext.beginPath(), $r._VJCanvasContext.lineWidth = 6, $r._VJCanvasContext.strokeStyle = this._joystickColor, $r._VJCanvasContext.arc(e.x, e.y, this.puckSize, 0, Math.PI * 2, !0), $r._VJCanvasContext.stroke(), $r._VJCanvasContext.closePath());
  }
  /**
   * Draws the Virtual Joystick's puck
   */
  _drawPuck() {
    this._puckImage ? $r._VJCanvasContext.drawImage(this._puckImage, this._joystickPointerPos.x - this.puckSize, this._joystickPointerPos.y - this.puckSize, this.puckSize * 2, this.puckSize * 2) : ($r._VJCanvasContext.beginPath(), $r._VJCanvasContext.strokeStyle = this._joystickColor, $r._VJCanvasContext.lineWidth = 2, $r._VJCanvasContext.arc(this._joystickPointerPos.x, this._joystickPointerPos.y, this.puckSize, 0, Math.PI * 2, !0), $r._VJCanvasContext.stroke(), $r._VJCanvasContext.closePath());
  }
  _drawVirtualJoystick() {
    this._released || (this.alwaysVisible && this._drawContainer(), this.pressed && this._touches.forEach((e, t) => {
      t.pointerId === this._joystickPointerId ? (this.alwaysVisible || this._drawContainer(), this._drawPuck(), this._joystickPreviousPointerPos = this._joystickPointerPos.clone()) : ($r._VJCanvasContext.clearRect(t.prevX - 44, t.prevY - 44, 88, 88), $r._VJCanvasContext.beginPath(), $r._VJCanvasContext.fillStyle = "white", $r._VJCanvasContext.beginPath(), $r._VJCanvasContext.strokeStyle = "red", $r._VJCanvasContext.lineWidth = 6, $r._VJCanvasContext.arc(t.x, t.y, 40, 0, Math.PI * 2, !0), $r._VJCanvasContext.stroke(), $r._VJCanvasContext.closePath(), t.prevX = t.x, t.prevY = t.y);
    }), requestAnimationFrame(() => {
      this._drawVirtualJoystick();
    }));
  }
  /**
   * Release internal HTML canvas
   */
  releaseCanvas() {
    $r.Canvas && ($r.Canvas.removeEventListener("pointerdown", this._onPointerDownHandlerRef), $r.Canvas.removeEventListener("pointermove", this._onPointerMoveHandlerRef), $r.Canvas.removeEventListener("pointerup", this._onPointerUpHandlerRef), $r.Canvas.removeEventListener("pointerout", this._onPointerUpHandlerRef), window.removeEventListener("resize", this._onResize), document.body.removeChild($r.Canvas), $r.Canvas = null), this._released = !0;
  }
}
$r._GlobalJoystickIndex = 0;
$r._AlwaysVisibleSticks = 0;
kR.prototype.addVirtualJoystick = function() {
  return this.add(new cQ()), this;
};
class cQ {
  /**
   * Gets the left stick of the virtual joystick.
   * @returns The virtual Joystick
   */
  getLeftJoystick() {
    return this._leftjoystick;
  }
  /**
   * Gets the right stick of the virtual joystick.
   * @returns The virtual Joystick
   */
  getRightJoystick() {
    return this._rightjoystick;
  }
  /**
   * Update the current camera state depending on the inputs that have been used this frame.
   * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
   */
  checkInputs() {
    if (this._leftjoystick) {
      const e = this.camera, t = e._computeLocalCameraSpeed() * 50, r = he.RotationYawPitchRoll(e.rotation.y, e.rotation.x, 0), n = S.TransformCoordinates(new S(this._leftjoystick.deltaPosition.x * t, this._leftjoystick.deltaPosition.y * t, this._leftjoystick.deltaPosition.z * t), r);
      e.cameraDirection = e.cameraDirection.add(n), e.cameraRotation = e.cameraRotation.addVector3(this._rightjoystick.deltaPosition), this._leftjoystick.pressed || (this._leftjoystick.deltaPosition = this._leftjoystick.deltaPosition.scale(0.9)), this._rightjoystick.pressed || (this._rightjoystick.deltaPosition = this._rightjoystick.deltaPosition.scale(0.9));
    }
  }
  /**
   * Attach the input controls to a specific dom element to get the input from.
   */
  attachControl() {
    this._leftjoystick = new $r(!0), this._leftjoystick.setAxisForUpDown(V9.Z), this._leftjoystick.setAxisForLeftRight(V9.X), this._leftjoystick.setJoystickSensibility(0.15), this._rightjoystick = new $r(!1), this._rightjoystick.setAxisForUpDown(V9.X), this._rightjoystick.setAxisForLeftRight(V9.Y), this._rightjoystick.reverseUpDown = !0, this._rightjoystick.setJoystickSensibility(0.05), this._rightjoystick.setJoystickColor("yellow");
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this._leftjoystick.releaseCanvas(), this._rightjoystick.releaseCanvas();
  }
  /**
   * Gets the class name of the current input.
   * @returns the class name
   */
  getClassName() {
    return "FreeCameraVirtualJoystickInput";
  }
  /**
   * Get the friendly name associated with the input class.
   * @returns the input friendly name
   */
  getSimpleName() {
    return "virtualJoystick";
  }
}
VA.FreeCameraVirtualJoystickInput = cQ;
class b1 extends Tr {
  /**
   * Instantiates a target camera that takes a mesh or position as a target and continues to look at it while it moves.
   * This is the base of the follow, arc rotate cameras and Free camera
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
   * @param name Defines the name of the camera in the scene
   * @param position Defines the start position of the camera in the scene
   * @param scene Defines the scene the camera belongs to
   * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
   */
  constructor(e, t, r, n = !0) {
    super(e, t, r, n), this._tmpUpVector = S.Zero(), this._tmpTargetVector = S.Zero(), this.cameraDirection = new S(0, 0, 0), this.cameraRotation = new at(0, 0), this.ignoreParentScaling = !1, this.updateUpVectorFromRotation = !1, this._tmpQuaternion = new Ze(), this.rotation = new S(0, 0, 0), this.speed = 2, this.noRotationConstraint = !1, this.invertRotation = !1, this.inverseRotationSpeed = 0.2, this.lockedTarget = null, this._currentTarget = S.Zero(), this._initialFocalDistance = 1, this._viewMatrix = he.Zero(), this._camMatrix = he.Zero(), this._cameraTransformMatrix = he.Zero(), this._cameraRotationMatrix = he.Zero(), this._referencePoint = new S(0, 0, 1), this._transformedReferencePoint = S.Zero(), this._deferredPositionUpdate = new S(), this._deferredRotationQuaternionUpdate = new Ze(), this._deferredRotationUpdate = new S(), this._deferredUpdated = !1, this._deferOnly = !1, this._defaultUp = S.Up(), this._cachedRotationZ = 0, this._cachedQuaternionRotationZ = 0;
  }
  /**
   * Gets the position in front of the camera at a given distance.
   * @param distance The distance from the camera we want the position to be
   * @returns the position
   */
  getFrontPosition(e) {
    this.getWorldMatrix();
    const t = this.getTarget().subtract(this.position);
    return t.normalize(), t.scaleInPlace(e), this.globalPosition.add(t);
  }
  /** @internal */
  _getLockedTargetPosition() {
    if (!this.lockedTarget)
      return null;
    if (this.lockedTarget.absolutePosition) {
      const e = this.lockedTarget;
      e.computeWorldMatrix().getTranslationToRef(e.absolutePosition);
    }
    return this.lockedTarget.absolutePosition || this.lockedTarget;
  }
  /**
   * Store current camera state of the camera (fov, position, rotation, etc..)
   * @returns the camera
   */
  storeState() {
    return this._storedPosition = this.position.clone(), this._storedRotation = this.rotation.clone(), this.rotationQuaternion && (this._storedRotationQuaternion = this.rotationQuaternion.clone()), super.storeState();
  }
  /**
   * Restored camera state. You must call storeState() first
   * @returns whether it was successful or not
   * @internal
   */
  _restoreStateValues() {
    return super._restoreStateValues() ? (this.position = this._storedPosition.clone(), this.rotation = this._storedRotation.clone(), this.rotationQuaternion && (this.rotationQuaternion = this._storedRotationQuaternion.clone()), this.cameraDirection.copyFromFloats(0, 0, 0), this.cameraRotation.copyFromFloats(0, 0), !0) : !1;
  }
  /** @internal */
  _initCache() {
    super._initCache(), this._cache.lockedTarget = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.rotation = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.rotationQuaternion = new Ze(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
  }
  /**
   * @internal
   */
  _updateCache(e) {
    e || super._updateCache();
    const t = this._getLockedTargetPosition();
    t ? this._cache.lockedTarget ? this._cache.lockedTarget.copyFrom(t) : this._cache.lockedTarget = t.clone() : this._cache.lockedTarget = null, this._cache.rotation.copyFrom(this.rotation), this.rotationQuaternion && this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion);
  }
  // Synchronized
  /** @internal */
  _isSynchronizedViewMatrix() {
    if (!super._isSynchronizedViewMatrix())
      return !1;
    const e = this._getLockedTargetPosition();
    return (this._cache.lockedTarget ? this._cache.lockedTarget.equals(e) : !e) && (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation));
  }
  // Methods
  /** @internal */
  _computeLocalCameraSpeed() {
    const e = this.getEngine();
    return this.speed * Math.sqrt(e.getDeltaTime() / (e.getFps() * 100));
  }
  // Target
  /**
   * Defines the target the camera should look at.
   * @param target Defines the new target as a Vector
   */
  setTarget(e) {
    this.upVector.normalize(), this._initialFocalDistance = e.subtract(this.position).length(), this.position.z === e.z && (this.position.z += Dn), this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance), he.LookAtLHToRef(this.position, e, this._defaultUp, this._camMatrix), this._camMatrix.invert(), this.rotation.x = Math.atan(this._camMatrix.m[6] / this._camMatrix.m[10]);
    const t = e.subtract(this.position);
    t.x >= 0 ? this.rotation.y = -Math.atan(t.z / t.x) + Math.PI / 2 : this.rotation.y = -Math.atan(t.z / t.x) - Math.PI / 2, this.rotation.z = 0, isNaN(this.rotation.x) && (this.rotation.x = 0), isNaN(this.rotation.y) && (this.rotation.y = 0), isNaN(this.rotation.z) && (this.rotation.z = 0), this.rotationQuaternion && Ze.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion);
  }
  /**
   * Defines the target point of the camera.
   * The camera looks towards it form the radius distance.
   */
  get target() {
    return this.getTarget();
  }
  set target(e) {
    this.setTarget(e);
  }
  /**
   * Return the current target position of the camera. This value is expressed in local space.
   * @returns the target position
   */
  getTarget() {
    return this._currentTarget;
  }
  /** @internal */
  _decideIfNeedsToMove() {
    return Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;
  }
  /** @internal */
  _updatePosition() {
    if (this.parent) {
      this.parent.getWorldMatrix().invertToRef(ue.Matrix[0]), S.TransformNormalToRef(this.cameraDirection, ue.Matrix[0], ue.Vector3[0]), this._deferredPositionUpdate.addInPlace(ue.Vector3[0]), this._deferOnly ? this._deferredUpdated = !0 : this.position.copyFrom(this._deferredPositionUpdate);
      return;
    }
    this._deferredPositionUpdate.addInPlace(this.cameraDirection), this._deferOnly ? this._deferredUpdated = !0 : this.position.copyFrom(this._deferredPositionUpdate);
  }
  /** @internal */
  _checkInputs() {
    const e = this.invertRotation ? -this.inverseRotationSpeed : 1, t = this._decideIfNeedsToMove(), r = this.cameraRotation.x || this.cameraRotation.y;
    this._deferredUpdated = !1, this._deferredRotationUpdate.copyFrom(this.rotation), this._deferredPositionUpdate.copyFrom(this.position), this.rotationQuaternion && this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion), t && this._updatePosition(), r && (this.rotationQuaternion && this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate), this._deferredRotationUpdate.x += this.cameraRotation.x * e, this._deferredRotationUpdate.y += this.cameraRotation.y * e, this.noRotationConstraint || (this._deferredRotationUpdate.x > 1.570796 && (this._deferredRotationUpdate.x = 1.570796), this._deferredRotationUpdate.x < -1.570796 && (this._deferredRotationUpdate.x = -1.570796)), this._deferOnly ? this._deferredUpdated = !0 : this.rotation.copyFrom(this._deferredRotationUpdate), this.rotationQuaternion && this._deferredRotationUpdate.lengthSquared() && (Ze.RotationYawPitchRollToRef(this._deferredRotationUpdate.y, this._deferredRotationUpdate.x, this._deferredRotationUpdate.z, this._deferredRotationQuaternionUpdate), this._deferOnly ? this._deferredUpdated = !0 : this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate))), t && (Math.abs(this.cameraDirection.x) < this.speed * Dn && (this.cameraDirection.x = 0), Math.abs(this.cameraDirection.y) < this.speed * Dn && (this.cameraDirection.y = 0), Math.abs(this.cameraDirection.z) < this.speed * Dn && (this.cameraDirection.z = 0), this.cameraDirection.scaleInPlace(this.inertia)), r && (Math.abs(this.cameraRotation.x) < this.speed * Dn && (this.cameraRotation.x = 0), Math.abs(this.cameraRotation.y) < this.speed * Dn && (this.cameraRotation.y = 0), this.cameraRotation.scaleInPlace(this.inertia)), super._checkInputs();
  }
  _updateCameraRotationMatrix() {
    this.rotationQuaternion ? this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix) : he.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix);
  }
  /**
   * Update the up vector to apply the rotation of the camera (So if you changed the camera rotation.z this will let you update the up vector as well)
   * @returns the current camera
   */
  _rotateUpVectorWithCameraRotationMatrix() {
    return S.TransformNormalToRef(this._defaultUp, this._cameraRotationMatrix, this.upVector), this;
  }
  /** @internal */
  _getViewMatrix() {
    return this.lockedTarget && this.setTarget(this._getLockedTargetPosition()), this._updateCameraRotationMatrix(), this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z ? (this._rotateUpVectorWithCameraRotationMatrix(), this._cachedQuaternionRotationZ = this.rotationQuaternion.z) : this._cachedRotationZ !== this.rotation.z && (this._rotateUpVectorWithCameraRotationMatrix(), this._cachedRotationZ = this.rotation.z), S.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint), this.position.addToRef(this._transformedReferencePoint, this._currentTarget), this.updateUpVectorFromRotation && (this.rotationQuaternion ? bf.Y.rotateByQuaternionToRef(this.rotationQuaternion, this.upVector) : (Ze.FromEulerVectorToRef(this.rotation, this._tmpQuaternion), bf.Y.rotateByQuaternionToRef(this._tmpQuaternion, this.upVector))), this._computeViewMatrix(this.position, this._currentTarget, this.upVector), this._viewMatrix;
  }
  _computeViewMatrix(e, t, r) {
    if (this.ignoreParentScaling) {
      if (this.parent) {
        const n = this.parent.getWorldMatrix();
        S.TransformCoordinatesToRef(e, n, this._globalPosition), S.TransformCoordinatesToRef(t, n, this._tmpTargetVector), S.TransformNormalToRef(r, n, this._tmpUpVector), this._markSyncedWithParent();
      } else
        this._globalPosition.copyFrom(e), this._tmpTargetVector.copyFrom(t), this._tmpUpVector.copyFrom(r);
      this.getScene().useRightHandedSystem ? he.LookAtRHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix) : he.LookAtLHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix);
      return;
    }
    if (this.getScene().useRightHandedSystem ? he.LookAtRHToRef(e, t, r, this._viewMatrix) : he.LookAtLHToRef(e, t, r, this._viewMatrix), this.parent) {
      const n = this.parent.getWorldMatrix();
      this._viewMatrix.invert(), this._viewMatrix.multiplyToRef(n, this._viewMatrix), this._viewMatrix.getTranslationToRef(this._globalPosition), this._viewMatrix.invert(), this._markSyncedWithParent();
    } else
      this._globalPosition.copyFrom(e);
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  createRigCamera(e, t) {
    if (this.cameraRigMode !== Tr.RIG_MODE_NONE) {
      const r = new b1(e, this.position.clone(), this.getScene());
      return r.isRigCamera = !0, r.rigParent = this, this.cameraRigMode === Tr.RIG_MODE_VR && (this.rotationQuaternion || (this.rotationQuaternion = new Ze()), r._cameraRigParams = {}, r.rotationQuaternion = new Ze()), r.mode = this.mode, r.orthoLeft = this.orthoLeft, r.orthoRight = this.orthoRight, r.orthoTop = this.orthoTop, r.orthoBottom = this.orthoBottom, r;
    }
    return null;
  }
  /**
   * @internal
   */
  _updateRigCameras() {
    const e = this._rigCameras[0], t = this._rigCameras[1];
    switch (this.computeWorldMatrix(), this.cameraRigMode) {
      case Tr.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
      case Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
      case Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
      case Tr.RIG_MODE_STEREOSCOPIC_OVERUNDER:
      case Tr.RIG_MODE_STEREOSCOPIC_INTERLACED: {
        const r = this.cameraRigMode === Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? 1 : -1, n = this.cameraRigMode === Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? -1 : 1;
        this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * r, e), this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * n, t);
        break;
      }
      case Tr.RIG_MODE_VR:
        e.rotationQuaternion ? (e.rotationQuaternion.copyFrom(this.rotationQuaternion), t.rotationQuaternion.copyFrom(this.rotationQuaternion)) : (e.rotation.copyFrom(this.rotation), t.rotation.copyFrom(this.rotation)), e.position.copyFrom(this.position), t.position.copyFrom(this.position);
        break;
    }
    super._updateRigCameras();
  }
  _getRigCamPositionAndTarget(e, t) {
    this.getTarget().subtractToRef(this.position, b1._TargetFocalPoint), b1._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);
    const n = b1._TargetFocalPoint.addInPlace(this.position);
    he.TranslationToRef(-n.x, -n.y, -n.z, b1._TargetTransformMatrix), b1._TargetTransformMatrix.multiplyToRef(he.RotationAxis(t.upVector, e), b1._RigCamTransformMatrix), he.TranslationToRef(n.x, n.y, n.z, b1._TargetTransformMatrix), b1._RigCamTransformMatrix.multiplyToRef(b1._TargetTransformMatrix, b1._RigCamTransformMatrix), S.TransformCoordinatesToRef(this.position, b1._RigCamTransformMatrix, t.position), t.setTarget(n);
  }
  /**
   * Gets the current object class name.
   * @returns the class name
   */
  getClassName() {
    return "TargetCamera";
  }
}
b1._RigCamTransformMatrix = new he();
b1._TargetTransformMatrix = new he();
b1._TargetFocalPoint = new S();
C([
  fo()
], b1.prototype, "rotation", void 0);
C([
  M()
], b1.prototype, "speed", void 0);
C([
  tU("lockedTargetId")
], b1.prototype, "lockedTarget", void 0);
class SA extends b1 {
  /**
   * Gets the input sensibility for a mouse input. (default is 2000.0)
   * Higher values reduce sensitivity.
   */
  get angularSensibility() {
    const e = this.inputs.attached.mouse;
    return e ? e.angularSensibility : 0;
  }
  /**
   * Sets the input sensibility for a mouse input. (default is 2000.0)
   * Higher values reduce sensitivity.
   */
  set angularSensibility(e) {
    const t = this.inputs.attached.mouse;
    t && (t.angularSensibility = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control the forward move of the camera.
   */
  get keysUp() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysUp : [];
  }
  set keysUp(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysUp = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control the upward move of the camera.
   */
  get keysUpward() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysUpward : [];
  }
  set keysUpward(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysUpward = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control the backward move of the camera.
   */
  get keysDown() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysDown : [];
  }
  set keysDown(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysDown = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control the downward move of the camera.
   */
  get keysDownward() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysDownward : [];
  }
  set keysDownward(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysDownward = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control the left strafe move of the camera.
   */
  get keysLeft() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysLeft : [];
  }
  set keysLeft(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysLeft = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control the right strafe move of the camera.
   */
  get keysRight() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysRight : [];
  }
  set keysRight(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysRight = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control the left rotation move of the camera.
   */
  get keysRotateLeft() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysRotateLeft : [];
  }
  set keysRotateLeft(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysRotateLeft = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control the right rotation move of the camera.
   */
  get keysRotateRight() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysRotateRight : [];
  }
  set keysRotateRight(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysRotateRight = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control the up rotation move of the camera.
   */
  get keysRotateUp() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysRotateUp : [];
  }
  set keysRotateUp(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysRotateUp = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control the down rotation move of the camera.
   */
  get keysRotateDown() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysRotateDown : [];
  }
  set keysRotateDown(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysRotateDown = e);
  }
  /**
   * Instantiates a Free Camera.
   * This represents a free type of camera. It can be useful in First Person Shooter game for instance.
   * Please consider using the new UniversalCamera instead as it adds more functionality like touch to this camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
   * @param name Define the name of the camera in the scene
   * @param position Define the start position of the camera in the scene
   * @param scene Define the scene the camera belongs to
   * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
   */
  constructor(e, t, r, n = !0) {
    super(e, t, r, n), this.ellipsoid = new S(0.5, 1, 0.5), this.ellipsoidOffset = new S(0, 0, 0), this.checkCollisions = !1, this.applyGravity = !1, this._needMoveForGravity = !1, this._oldPosition = S.Zero(), this._diffPosition = S.Zero(), this._newPosition = S.Zero(), this._collisionMask = -1, this._onCollisionPositionChange = (i, s, a = null) => {
      this._newPosition.copyFrom(s), this._newPosition.subtractToRef(this._oldPosition, this._diffPosition), this._diffPosition.length() > Ge.CollisionsEpsilon && (this.position.addToRef(this._diffPosition, this._deferredPositionUpdate), this._deferOnly ? this._deferredUpdated = !0 : this.position.copyFrom(this._deferredPositionUpdate), this.onCollide && a && this.onCollide(a));
    }, this.inputs = new kR(this), this.inputs.addKeyboard().addMouse();
  }
  /**
   * Attached controls to the current camera.
   * @param ignored defines an ignored parameter kept for backward compatibility.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e, t) {
    t = ye.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(t);
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this.inputs.detachElement(), this.cameraDirection = new S(0, 0, 0), this.cameraRotation = new at(0, 0);
  }
  /**
   * Define a collision mask to limit the list of object the camera can collide with
   */
  get collisionMask() {
    return this._collisionMask;
  }
  set collisionMask(e) {
    this._collisionMask = isNaN(e) ? -1 : e;
  }
  /**
   * @internal
   */
  _collideWithWorld(e) {
    let t;
    this.parent ? t = S.TransformCoordinates(this.position, this.parent.getWorldMatrix()) : t = this.position, t.subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition), this._oldPosition.addInPlace(this.ellipsoidOffset);
    const r = this.getScene().collisionCoordinator;
    this._collider || (this._collider = r.createCollider()), this._collider._radius = this.ellipsoid, this._collider.collisionMask = this._collisionMask;
    let n = e;
    this.applyGravity && (n = e.add(this.getScene().gravity)), r.getNewPosition(this._oldPosition, n, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
  }
  /** @internal */
  _checkInputs() {
    this._localDirection || (this._localDirection = S.Zero(), this._transformedDirection = S.Zero()), this.inputs.checkInputs(), super._checkInputs();
  }
  /**
   * Enable movement without a user input. This allows gravity to always be applied.
   */
  set needMoveForGravity(e) {
    this._needMoveForGravity = e;
  }
  /**
   * When true, gravity is applied whether there is user input or not.
   */
  get needMoveForGravity() {
    return this._needMoveForGravity;
  }
  /** @internal */
  _decideIfNeedsToMove() {
    return this._needMoveForGravity || Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;
  }
  /** @internal */
  _updatePosition() {
    this.checkCollisions && this.getScene().collisionsEnabled ? this._collideWithWorld(this.cameraDirection) : super._updatePosition();
  }
  /**
   * Destroy the camera and release the current resources hold by it.
   */
  dispose() {
    this.inputs.clear(), super.dispose();
  }
  /**
   * Gets the current object class name.
   * @returns the class name
   */
  getClassName() {
    return "FreeCamera";
  }
}
C([
  fo()
], SA.prototype, "ellipsoid", void 0);
C([
  fo()
], SA.prototype, "ellipsoidOffset", void 0);
C([
  M()
], SA.prototype, "checkCollisions", void 0);
C([
  M()
], SA.prototype, "applyGravity", void 0);
Cs.AddNodeConstructor("TouchCamera", (A, e) => () => new pQ(A, S.Zero(), e));
class pQ extends SA {
  /**
   * Defines the touch sensibility for rotation.
   * The higher the faster.
   */
  get touchAngularSensibility() {
    const e = this.inputs.attached.touch;
    return e ? e.touchAngularSensibility : 0;
  }
  set touchAngularSensibility(e) {
    const t = this.inputs.attached.touch;
    t && (t.touchAngularSensibility = e);
  }
  /**
   * Defines the touch sensibility for move.
   * The higher the faster.
   */
  get touchMoveSensibility() {
    const e = this.inputs.attached.touch;
    return e ? e.touchMoveSensibility : 0;
  }
  set touchMoveSensibility(e) {
    const t = this.inputs.attached.touch;
    t && (t.touchMoveSensibility = e);
  }
  /**
   * Instantiates a new touch camera.
   * This represents a FPS type of camera controlled by touch.
   * This is like a universal camera minus the Gamepad controls.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
   * @param name Define the name of the camera in the scene
   * @param position Define the start position of the camera in the scene
   * @param scene Define the scene the camera belongs to
   */
  constructor(e, t, r) {
    super(e, t, r), this.inputs.addTouch(), this._setupInputs();
  }
  /**
   * Gets the current object class name.
   * @returns the class name
   */
  getClassName() {
    return "TouchCamera";
  }
  /** @internal */
  _setupInputs() {
    const e = this.inputs.attached.touch, t = this.inputs.attached.mouse;
    t ? t.touchEnabled = !1 : e.allowMouse = !0;
  }
}
Cs.AddNodeConstructor("ArcRotateCamera", (A, e) => () => new ps(A, 0, 0, 1, S.Zero(), e));
class ps extends b1 {
  /**
   * Defines the target point of the camera.
   * The camera looks towards it from the radius distance.
   */
  get target() {
    return this._target;
  }
  set target(e) {
    this.setTarget(e);
  }
  /**
   * Defines the target mesh of the camera.
   * The camera looks towards it from the radius distance.
   * Please note that setting a target host will disable panning.
   */
  get targetHost() {
    return this._targetHost;
  }
  set targetHost(e) {
    e && this.setTarget(e);
  }
  /**
   * Return the current target position of the camera. This value is expressed in local space.
   * @returns the target position
   */
  getTarget() {
    return this.target;
  }
  /**
   * Define the current local position of the camera in the scene
   */
  get position() {
    return this._position;
  }
  set position(e) {
    this.setPosition(e);
  }
  /**
   * The vector the camera should consider as up. (default is Vector3(0, 1, 0) as returned by Vector3.Up())
   * Setting this will copy the given vector to the camera's upVector, and set rotation matrices to and from Y up.
   * DO NOT set the up vector using copyFrom or copyFromFloats, as this bypasses setting the above matrices.
   */
  set upVector(e) {
    this._upToYMatrix || (this._yToUpMatrix = new he(), this._upToYMatrix = new he(), this._upVector = S.Zero()), e.normalize(), this._upVector.copyFrom(e), this.setMatUp();
  }
  get upVector() {
    return this._upVector;
  }
  /**
   * Sets the Y-up to camera up-vector rotation matrix, and the up-vector to Y-up rotation matrix.
   */
  setMatUp() {
    he.RotationAlignToRef(S.UpReadOnly, this._upVector, this._yToUpMatrix), he.RotationAlignToRef(this._upVector, S.UpReadOnly, this._upToYMatrix);
  }
  //-- begin properties for backward compatibility for inputs
  /**
   * Gets or Set the pointer angular sensibility  along the X axis or how fast is the camera rotating.
   */
  get angularSensibilityX() {
    const e = this.inputs.attached.pointers;
    return e ? e.angularSensibilityX : 0;
  }
  set angularSensibilityX(e) {
    const t = this.inputs.attached.pointers;
    t && (t.angularSensibilityX = e);
  }
  /**
   * Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating.
   */
  get angularSensibilityY() {
    const e = this.inputs.attached.pointers;
    return e ? e.angularSensibilityY : 0;
  }
  set angularSensibilityY(e) {
    const t = this.inputs.attached.pointers;
    t && (t.angularSensibilityY = e);
  }
  /**
   * Gets or Set the pointer pinch precision or how fast is the camera zooming.
   */
  get pinchPrecision() {
    const e = this.inputs.attached.pointers;
    return e ? e.pinchPrecision : 0;
  }
  set pinchPrecision(e) {
    const t = this.inputs.attached.pointers;
    t && (t.pinchPrecision = e);
  }
  /**
   * Gets or Set the pointer pinch delta percentage or how fast is the camera zooming.
   * It will be used instead of pinchDeltaPrecision if different from 0.
   * It defines the percentage of current camera.radius to use as delta when pinch zoom is used.
   */
  get pinchDeltaPercentage() {
    const e = this.inputs.attached.pointers;
    return e ? e.pinchDeltaPercentage : 0;
  }
  set pinchDeltaPercentage(e) {
    const t = this.inputs.attached.pointers;
    t && (t.pinchDeltaPercentage = e);
  }
  /**
   * Gets or Set the pointer use natural pinch zoom to override the pinch precision
   * and pinch delta percentage.
   * When useNaturalPinchZoom is true, multi touch zoom will zoom in such
   * that any object in the plane at the camera's target point will scale
   * perfectly with finger motion.
   */
  get useNaturalPinchZoom() {
    const e = this.inputs.attached.pointers;
    return e ? e.useNaturalPinchZoom : !1;
  }
  set useNaturalPinchZoom(e) {
    const t = this.inputs.attached.pointers;
    t && (t.useNaturalPinchZoom = e);
  }
  /**
   * Gets or Set the pointer panning sensibility or how fast is the camera moving.
   */
  get panningSensibility() {
    const e = this.inputs.attached.pointers;
    return e ? e.panningSensibility : 0;
  }
  set panningSensibility(e) {
    const t = this.inputs.attached.pointers;
    t && (t.panningSensibility = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control beta angle in a positive direction.
   */
  get keysUp() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysUp : [];
  }
  set keysUp(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysUp = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control beta angle in a negative direction.
   */
  get keysDown() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysDown : [];
  }
  set keysDown(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysDown = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control alpha angle in a negative direction.
   */
  get keysLeft() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysLeft : [];
  }
  set keysLeft(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysLeft = e);
  }
  /**
   * Gets or Set the list of keyboard keys used to control alpha angle in a positive direction.
   */
  get keysRight() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysRight : [];
  }
  set keysRight(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysRight = e);
  }
  /**
   * Gets or Set the mouse wheel precision or how fast is the camera zooming.
   */
  get wheelPrecision() {
    const e = this.inputs.attached.mousewheel;
    return e ? e.wheelPrecision : 0;
  }
  set wheelPrecision(e) {
    const t = this.inputs.attached.mousewheel;
    t && (t.wheelPrecision = e);
  }
  /**
   * Gets or Set the boolean value that controls whether or not the mouse wheel
   * zooms to the location of the mouse pointer or not.  The default is false.
   */
  get zoomToMouseLocation() {
    const e = this.inputs.attached.mousewheel;
    return e ? e.zoomToMouseLocation : !1;
  }
  set zoomToMouseLocation(e) {
    const t = this.inputs.attached.mousewheel;
    t && (t.zoomToMouseLocation = e);
  }
  /**
   * Gets or Set the mouse wheel delta percentage or how fast is the camera zooming.
   * It will be used instead of pinchDeltaPrecision if different from 0.
   * It defines the percentage of current camera.radius to use as delta when pinch zoom is used.
   */
  get wheelDeltaPercentage() {
    const e = this.inputs.attached.mousewheel;
    return e ? e.wheelDeltaPercentage : 0;
  }
  set wheelDeltaPercentage(e) {
    const t = this.inputs.attached.mousewheel;
    t && (t.wheelDeltaPercentage = e);
  }
  /**
   * Gets the bouncing behavior of the camera if it has been enabled.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#bouncing-behavior
   */
  get bouncingBehavior() {
    return this._bouncingBehavior;
  }
  /**
   * Defines if the bouncing behavior of the camera is enabled on the camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#bouncing-behavior
   */
  get useBouncingBehavior() {
    return this._bouncingBehavior != null;
  }
  set useBouncingBehavior(e) {
    e !== this.useBouncingBehavior && (e ? (this._bouncingBehavior = new fD(), this.addBehavior(this._bouncingBehavior)) : this._bouncingBehavior && (this.removeBehavior(this._bouncingBehavior), this._bouncingBehavior = null));
  }
  /**
   * Gets the framing behavior of the camera if it has been enabled.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior
   */
  get framingBehavior() {
    return this._framingBehavior;
  }
  /**
   * Defines if the framing behavior of the camera is enabled on the camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior
   */
  get useFramingBehavior() {
    return this._framingBehavior != null;
  }
  set useFramingBehavior(e) {
    e !== this.useFramingBehavior && (e ? (this._framingBehavior = new Vu(), this.addBehavior(this._framingBehavior)) : this._framingBehavior && (this.removeBehavior(this._framingBehavior), this._framingBehavior = null));
  }
  /**
   * Gets the auto rotation behavior of the camera if it has been enabled.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#autorotation-behavior
   */
  get autoRotationBehavior() {
    return this._autoRotationBehavior;
  }
  /**
   * Defines if the auto rotation behavior of the camera is enabled on the camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#autorotation-behavior
   */
  get useAutoRotationBehavior() {
    return this._autoRotationBehavior != null;
  }
  set useAutoRotationBehavior(e) {
    e !== this.useAutoRotationBehavior && (e ? (this._autoRotationBehavior = new hee(), this.addBehavior(this._autoRotationBehavior)) : this._autoRotationBehavior && (this.removeBehavior(this._autoRotationBehavior), this._autoRotationBehavior = null));
  }
  /**
   * Instantiates a new ArcRotateCamera in a given scene
   * @param name Defines the name of the camera
   * @param alpha Defines the camera rotation along the longitudinal axis
   * @param beta Defines the camera rotation along the latitudinal axis
   * @param radius Defines the camera distance from its target
   * @param target Defines the camera target
   * @param scene Defines the scene the camera belongs to
   * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
   */
  constructor(e, t, r, n, i, s, a = !0) {
    super(e, S.Zero(), s, a), this.inertialAlphaOffset = 0, this.inertialBetaOffset = 0, this.inertialRadiusOffset = 0, this.lowerAlphaLimit = null, this.upperAlphaLimit = null, this.lowerBetaLimit = 0.01, this.upperBetaLimit = Math.PI - 0.01, this.lowerRadiusLimit = null, this.upperRadiusLimit = null, this.inertialPanningX = 0, this.inertialPanningY = 0, this.pinchToPanMaxDistance = 20, this.panningDistanceLimit = null, this.panningOriginTarget = S.Zero(), this.panningInertia = 0.9, this.zoomOnFactor = 1, this.targetScreenOffset = at.Zero(), this.allowUpsideDown = !0, this.useInputToRestoreState = !0, this._viewMatrix = new he(), this.panningAxis = new S(1, 1, 0), this._transformedDirection = new S(), this.mapPanning = !1, this.onMeshTargetChangedObservable = new Oe(), this.checkCollisions = !1, this.collisionRadius = new S(0.5, 0.5, 0.5), this._previousPosition = S.Zero(), this._collisionVelocity = S.Zero(), this._newPosition = S.Zero(), this._computationVector = S.Zero(), this._onCollisionPositionChange = (f, o, d = null) => {
      d ? (this.setPosition(o), this.onCollide && this.onCollide(d)) : this._previousPosition.copyFrom(this._position);
      const v = Math.cos(this.alpha), u = Math.sin(this.alpha), l = Math.cos(this.beta);
      let P = Math.sin(this.beta);
      P === 0 && (P = 1e-4);
      const p = this._getTargetPosition();
      this._computationVector.copyFromFloats(this.radius * v * P, this.radius * l, this.radius * u * P), p.addToRef(this._computationVector, this._newPosition), this._position.copyFrom(this._newPosition);
      let c = this.upVector;
      this.allowUpsideDown && this.beta < 0 && (c = c.clone(), c = c.negate()), this._computeViewMatrix(this._position, p, c), this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x), this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y), this._collisionTriggered = !1;
    }, this._target = S.Zero(), i && this.setTarget(i), this.alpha = t, this.beta = r, this.radius = n, this.getViewMatrix(), this.inputs = new CO(this), this.inputs.addKeyboard().addMouseWheel().addPointers();
  }
  // Cache
  /** @internal */
  _initCache() {
    super._initCache(), this._cache._target = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.alpha = void 0, this._cache.beta = void 0, this._cache.radius = void 0, this._cache.targetScreenOffset = at.Zero();
  }
  /**
   * @internal
   */
  _updateCache(e) {
    e || super._updateCache(), this._cache._target.copyFrom(this._getTargetPosition()), this._cache.alpha = this.alpha, this._cache.beta = this.beta, this._cache.radius = this.radius, this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset);
  }
  _getTargetPosition() {
    if (this._targetHost && this._targetHost.getAbsolutePosition) {
      const t = this._targetHost.getAbsolutePosition();
      this._targetBoundingCenter ? t.addToRef(this._targetBoundingCenter, this._target) : this._target.copyFrom(t);
    }
    const e = this._getLockedTargetPosition();
    return e || this._target;
  }
  /**
   * Stores the current state of the camera (alpha, beta, radius and target)
   * @returns the camera itself
   */
  storeState() {
    return this._storedAlpha = this.alpha, this._storedBeta = this.beta, this._storedRadius = this.radius, this._storedTarget = this._getTargetPosition().clone(), this._storedTargetScreenOffset = this.targetScreenOffset.clone(), super.storeState();
  }
  /**
   * @internal
   * Restored camera state. You must call storeState() first
   */
  _restoreStateValues() {
    return super._restoreStateValues() ? (this.setTarget(this._storedTarget.clone()), this.alpha = this._storedAlpha, this.beta = this._storedBeta, this.radius = this._storedRadius, this.targetScreenOffset = this._storedTargetScreenOffset.clone(), this.inertialAlphaOffset = 0, this.inertialBetaOffset = 0, this.inertialRadiusOffset = 0, this.inertialPanningX = 0, this.inertialPanningY = 0, !0) : !1;
  }
  // Synchronized
  /** @internal */
  _isSynchronizedViewMatrix() {
    return super._isSynchronizedViewMatrix() ? this._cache._target.equals(this._getTargetPosition()) && this._cache.alpha === this.alpha && this._cache.beta === this.beta && this._cache.radius === this.radius && this._cache.targetScreenOffset.equals(this.targetScreenOffset) : !1;
  }
  /**
   * Attached controls to the current camera.
   * @param ignored defines an ignored parameter kept for backward compatibility.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   * @param useCtrlForPanning  Defines whether ctrl is used for panning within the controls
   * @param panningMouseButton Defines whether panning is allowed through mouse click button
   */
  attachControl(e, t, r = !0, n = 2) {
    const i = arguments;
    t = ye.BackCompatCameraNoPreventDefault(i), this._useCtrlForPanning = r, this._panningMouseButton = n, typeof i[0] == "boolean" && (i.length > 1 && (this._useCtrlForPanning = i[1]), i.length > 2 && (this._panningMouseButton = i[2])), this.inputs.attachElement(t), this._reset = () => {
      this.inertialAlphaOffset = 0, this.inertialBetaOffset = 0, this.inertialRadiusOffset = 0, this.inertialPanningX = 0, this.inertialPanningY = 0;
    };
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this.inputs.detachElement(), this._reset && this._reset();
  }
  /** @internal */
  _checkInputs() {
    if (!this._collisionTriggered) {
      if (this.inputs.checkInputs(), this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) {
        const e = this.invertRotation ? -1 : 1, t = this._calculateHandednessMultiplier();
        let r = this.inertialAlphaOffset * t;
        this.beta <= 0 && (r *= -1), this.alpha += r * e, this.beta += this.inertialBetaOffset * e, this.radius -= this.inertialRadiusOffset, this.inertialAlphaOffset *= this.inertia, this.inertialBetaOffset *= this.inertia, this.inertialRadiusOffset *= this.inertia, Math.abs(this.inertialAlphaOffset) < Dn && (this.inertialAlphaOffset = 0), Math.abs(this.inertialBetaOffset) < Dn && (this.inertialBetaOffset = 0), Math.abs(this.inertialRadiusOffset) < this.speed * Dn && (this.inertialRadiusOffset = 0);
      }
      if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) {
        const e = new S(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY);
        if (this._viewMatrix.invertToRef(this._cameraTransformMatrix), e.multiplyInPlace(this.panningAxis), S.TransformNormalToRef(e, this._cameraTransformMatrix, this._transformedDirection), this.mapPanning) {
          const t = this.upVector, r = S.CrossToRef(this._transformedDirection, t, this._transformedDirection);
          S.CrossToRef(t, r, this._transformedDirection);
        } else
          this.panningAxis.y || (this._transformedDirection.y = 0);
        this._targetHost || (this.panningDistanceLimit ? (this._transformedDirection.addInPlace(this._target), S.DistanceSquared(this._transformedDirection, this.panningOriginTarget) <= this.panningDistanceLimit * this.panningDistanceLimit && this._target.copyFrom(this._transformedDirection)) : this._target.addInPlace(this._transformedDirection)), this.inertialPanningX *= this.panningInertia, this.inertialPanningY *= this.panningInertia, Math.abs(this.inertialPanningX) < this.speed * Dn && (this.inertialPanningX = 0), Math.abs(this.inertialPanningY) < this.speed * Dn && (this.inertialPanningY = 0);
      }
      this._checkLimits(), super._checkInputs();
    }
  }
  _checkLimits() {
    this.lowerBetaLimit === null || this.lowerBetaLimit === void 0 ? this.allowUpsideDown && this.beta > Math.PI && (this.beta = this.beta - 2 * Math.PI) : this.beta < this.lowerBetaLimit && (this.beta = this.lowerBetaLimit), this.upperBetaLimit === null || this.upperBetaLimit === void 0 ? this.allowUpsideDown && this.beta < -Math.PI && (this.beta = this.beta + 2 * Math.PI) : this.beta > this.upperBetaLimit && (this.beta = this.upperBetaLimit), this.lowerAlphaLimit !== null && this.alpha < this.lowerAlphaLimit && (this.alpha = this.lowerAlphaLimit), this.upperAlphaLimit !== null && this.alpha > this.upperAlphaLimit && (this.alpha = this.upperAlphaLimit), this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit && (this.radius = this.lowerRadiusLimit, this.inertialRadiusOffset = 0), this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit && (this.radius = this.upperRadiusLimit, this.inertialRadiusOffset = 0);
  }
  /**
   * Rebuilds angles (alpha, beta) and radius from the give position and target
   */
  rebuildAnglesAndRadius() {
    this._position.subtractToRef(this._getTargetPosition(), this._computationVector), (this._upVector.x !== 0 || this._upVector.y !== 1 || this._upVector.z !== 0) && S.TransformCoordinatesToRef(this._computationVector, this._upToYMatrix, this._computationVector), this.radius = this._computationVector.length(), this.radius === 0 && (this.radius = 1e-4);
    const e = this.alpha;
    this._computationVector.x === 0 && this._computationVector.z === 0 ? this.alpha = Math.PI / 2 : this.alpha = Math.acos(this._computationVector.x / Math.sqrt(Math.pow(this._computationVector.x, 2) + Math.pow(this._computationVector.z, 2))), this._computationVector.z < 0 && (this.alpha = 2 * Math.PI - this.alpha);
    const t = Math.round((e - this.alpha) / (2 * Math.PI));
    this.alpha += t * 2 * Math.PI, this.beta = Math.acos(this._computationVector.y / this.radius), this._checkLimits();
  }
  /**
   * Use a position to define the current camera related information like alpha, beta and radius
   * @param position Defines the position to set the camera at
   */
  setPosition(e) {
    this._position.equals(e) || (this._position.copyFrom(e), this.rebuildAnglesAndRadius());
  }
  /**
   * Defines the target the camera should look at.
   * This will automatically adapt alpha beta and radius to fit within the new target.
   * Please note that setting a target as a mesh will disable panning.
   * @param target Defines the new target as a Vector or a mesh
   * @param toBoundingCenter In case of a mesh target, defines whether to target the mesh position or its bounding information center
   * @param allowSamePosition If false, prevents reapplying the new computed position if it is identical to the current one (optim)
   * @param cloneAlphaBetaRadius If true, replicate the current setup (alpha, beta, radius) on the new target
   */
  setTarget(e, t = !1, r = !1, n = !1) {
    var i;
    if (n = (i = this.overrideCloneAlphaBetaRadius) !== null && i !== void 0 ? i : n, e.getBoundingInfo)
      t ? this._targetBoundingCenter = e.getBoundingInfo().boundingBox.centerWorld.clone() : this._targetBoundingCenter = null, e.computeWorldMatrix(), this._targetHost = e, this._target = this._getTargetPosition(), this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);
    else {
      const s = e, a = this._getTargetPosition();
      if (a && !r && a.equals(s))
        return;
      this._targetHost = null, this._target = s, this._targetBoundingCenter = null, this.onMeshTargetChangedObservable.notifyObservers(null);
    }
    n || this.rebuildAnglesAndRadius();
  }
  /** @internal */
  _getViewMatrix() {
    const e = Math.cos(this.alpha), t = Math.sin(this.alpha), r = Math.cos(this.beta);
    let n = Math.sin(this.beta);
    n === 0 && (n = 1e-4), this.radius === 0 && (this.radius = 1e-4);
    const i = this._getTargetPosition();
    if (this._computationVector.copyFromFloats(this.radius * e * n, this.radius * r, this.radius * t * n), (this._upVector.x !== 0 || this._upVector.y !== 1 || this._upVector.z !== 0) && S.TransformCoordinatesToRef(this._computationVector, this._yToUpMatrix, this._computationVector), i.addToRef(this._computationVector, this._newPosition), this.getScene().collisionsEnabled && this.checkCollisions) {
      const s = this.getScene().collisionCoordinator;
      this._collider || (this._collider = s.createCollider()), this._collider._radius = this.collisionRadius, this._newPosition.subtractToRef(this._position, this._collisionVelocity), this._collisionTriggered = !0, s.getNewPosition(this._position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
    } else {
      this._position.copyFrom(this._newPosition);
      let s = this.upVector;
      this.allowUpsideDown && n < 0 && (s = s.negate()), this._computeViewMatrix(this._position, i, s), this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x), this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y);
    }
    return this._currentTarget = i, this._viewMatrix;
  }
  /**
   * Zooms on a mesh to be at the min distance where we could see it fully in the current viewport.
   * @param meshes Defines the mesh to zoom on
   * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)
   */
  zoomOn(e, t = !1) {
    e = e || this.getScene().meshes;
    const r = Ee.MinMax(e);
    let n = this._calculateLowerRadiusFromModelBoundingSphere(r.min, r.max);
    n = Math.max(Math.min(n, this.upperRadiusLimit || Number.MAX_VALUE), this.lowerRadiusLimit || 0), this.radius = n * this.zoomOnFactor, this.focusOn({ min: r.min, max: r.max, distance: n }, t);
  }
  /**
   * Focus on a mesh or a bounding box. This adapts the target and maxRadius if necessary but does not update the current radius.
   * The target will be changed but the radius
   * @param meshesOrMinMaxVectorAndDistance Defines the mesh or bounding info to focus on
   * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)
   */
  focusOn(e, t = !1) {
    let r, n;
    if (e.min === void 0) {
      const i = e || this.getScene().meshes;
      r = Ee.MinMax(i), n = S.Distance(r.min, r.max);
    } else {
      const i = e;
      r = i, n = i.distance;
    }
    this._target = Ee.Center(r), t || (this.maxZ = n * 2);
  }
  /**
   * @override
   * Override Camera.createRigCamera
   */
  createRigCamera(e, t) {
    let r = 0;
    switch (this.cameraRigMode) {
      case Tr.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
      case Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
      case Tr.RIG_MODE_STEREOSCOPIC_OVERUNDER:
      case Tr.RIG_MODE_STEREOSCOPIC_INTERLACED:
      case Tr.RIG_MODE_VR:
        r = this._cameraRigParams.stereoHalfAngle * (t === 0 ? 1 : -1);
        break;
      case Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
        r = this._cameraRigParams.stereoHalfAngle * (t === 0 ? -1 : 1);
        break;
    }
    const n = new ps(e, this.alpha + r, this.beta, this.radius, this._target, this.getScene());
    return n._cameraRigParams = {}, n.isRigCamera = !0, n.rigParent = this, n.upVector = this.upVector, n.mode = this.mode, n.orthoLeft = this.orthoLeft, n.orthoRight = this.orthoRight, n.orthoBottom = this.orthoBottom, n.orthoTop = this.orthoTop, n;
  }
  /**
   * @internal
   * @override
   * Override Camera._updateRigCameras
   */
  _updateRigCameras() {
    const e = this._rigCameras[0], t = this._rigCameras[1];
    switch (e.beta = t.beta = this.beta, this.cameraRigMode) {
      case Tr.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
      case Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
      case Tr.RIG_MODE_STEREOSCOPIC_OVERUNDER:
      case Tr.RIG_MODE_STEREOSCOPIC_INTERLACED:
      case Tr.RIG_MODE_VR:
        e.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle, t.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;
        break;
      case Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
        e.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle, t.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle;
        break;
    }
    super._updateRigCameras();
  }
  /**
   * @internal
   */
  _calculateLowerRadiusFromModelBoundingSphere(e, t, r = 1) {
    const n = S.Distance(e, t), s = this.getScene().getEngine().getAspectRatio(this), a = Math.tan(this.fov / 2), f = a * s, d = n * 0.5 * r, v = d * Math.sqrt(1 + 1 / (f * f)), u = d * Math.sqrt(1 + 1 / (a * a));
    return Math.max(v, u);
  }
  /**
   * Destroy the camera and release the current resources hold by it.
   */
  dispose() {
    this.inputs.clear(), super.dispose();
  }
  /**
   * Gets the current object class name.
   * @returns the class name
   */
  getClassName() {
    return "ArcRotateCamera";
  }
}
C([
  M()
], ps.prototype, "alpha", void 0);
C([
  M()
], ps.prototype, "beta", void 0);
C([
  M()
], ps.prototype, "radius", void 0);
C([
  M()
], ps.prototype, "overrideCloneAlphaBetaRadius", void 0);
C([
  fo("target")
], ps.prototype, "_target", void 0);
C([
  tU("targetHost")
], ps.prototype, "_targetHost", void 0);
C([
  M()
], ps.prototype, "inertialAlphaOffset", void 0);
C([
  M()
], ps.prototype, "inertialBetaOffset", void 0);
C([
  M()
], ps.prototype, "inertialRadiusOffset", void 0);
C([
  M()
], ps.prototype, "lowerAlphaLimit", void 0);
C([
  M()
], ps.prototype, "upperAlphaLimit", void 0);
C([
  M()
], ps.prototype, "lowerBetaLimit", void 0);
C([
  M()
], ps.prototype, "upperBetaLimit", void 0);
C([
  M()
], ps.prototype, "lowerRadiusLimit", void 0);
C([
  M()
], ps.prototype, "upperRadiusLimit", void 0);
C([
  M()
], ps.prototype, "inertialPanningX", void 0);
C([
  M()
], ps.prototype, "inertialPanningY", void 0);
C([
  M()
], ps.prototype, "pinchToPanMaxDistance", void 0);
C([
  M()
], ps.prototype, "panningDistanceLimit", void 0);
C([
  fo()
], ps.prototype, "panningOriginTarget", void 0);
C([
  M()
], ps.prototype, "panningInertia", void 0);
C([
  M()
], ps.prototype, "zoomToMouseLocation", null);
C([
  M()
], ps.prototype, "zoomOnFactor", void 0);
C([
  HR()
], ps.prototype, "targetScreenOffset", void 0);
C([
  M()
], ps.prototype, "allowUpsideDown", void 0);
C([
  M()
], ps.prototype, "useInputToRestoreState", void 0);
Cs.AddNodeConstructor("DeviceOrientationCamera", (A, e) => () => new OO(A, S.Zero(), e));
class OO extends SA {
  /**
   * Creates a new device orientation camera
   * @param name The name of the camera
   * @param position The start position camera
   * @param scene The scene the camera belongs to
   */
  constructor(e, t, r) {
    super(e, t, r), this._tmpDragQuaternion = new Ze(), this._disablePointerInputWhenUsingDeviceOrientation = !0, this._dragFactor = 0, this._quaternionCache = new Ze(), this.inputs.addDeviceOrientation(), this.inputs._deviceOrientationInput && this.inputs._deviceOrientationInput._onDeviceOrientationChangedObservable.addOnce(() => {
      this._disablePointerInputWhenUsingDeviceOrientation && this.inputs._mouseInput && (this.inputs._mouseInput._allowCameraRotation = !1, this.inputs._mouseInput.onPointerMovedObservable.add((n) => {
        this._dragFactor != 0 && (this._initialQuaternion || (this._initialQuaternion = new Ze()), Ze.FromEulerAnglesToRef(0, n.offsetX * this._dragFactor, 0, this._tmpDragQuaternion), this._initialQuaternion.multiplyToRef(this._tmpDragQuaternion, this._initialQuaternion));
      }));
    });
  }
  /**
   * Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
   */
  get disablePointerInputWhenUsingDeviceOrientation() {
    return this._disablePointerInputWhenUsingDeviceOrientation;
  }
  set disablePointerInputWhenUsingDeviceOrientation(e) {
    this._disablePointerInputWhenUsingDeviceOrientation = e;
  }
  /**
   * Enabled turning on the y axis when the orientation sensor is active
   * @param dragFactor the factor that controls the turn speed (default: 1/300)
   */
  enableHorizontalDragging(e = 1 / 300) {
    this._dragFactor = e;
  }
  /**
   * Gets the current instance class name ("DeviceOrientationCamera").
   * This helps avoiding instanceof at run time.
   * @returns the class name
   */
  getClassName() {
    return "DeviceOrientationCamera";
  }
  /**
   * @internal
   * Checks and applies the current values of the inputs to the camera. (Internal use only)
   */
  _checkInputs() {
    super._checkInputs(), this._quaternionCache.copyFrom(this.rotationQuaternion), this._initialQuaternion && this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);
  }
  /**
   * Reset the camera to its default orientation on the specified axis only.
   * @param axis The axis to reset
   */
  resetToCurrentRotation(e = bf.Y) {
    this.rotationQuaternion && (this._initialQuaternion || (this._initialQuaternion = new Ze()), this._initialQuaternion.copyFrom(this._quaternionCache || this.rotationQuaternion), ["x", "y", "z"].forEach((t) => {
      e[t] ? this._initialQuaternion[t] *= -1 : this._initialQuaternion[t] = 0;
    }), this._initialQuaternion.normalize(), this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion));
  }
}
class Dee extends RR {
  /**
   * Instantiates a new FlyCameraInputsManager.
   * @param camera Defines the camera the inputs belong to.
   */
  constructor(e) {
    super(e);
  }
  /**
   * Add keyboard input support to the input manager.
   * @returns the new FlyCameraKeyboardMoveInput().
   */
  addKeyboard() {
    return this.add(new jq()), this;
  }
  /**
   * Add mouse input support to the input manager.
   * @returns the new FlyCameraMouseInput().
   */
  addMouse() {
    return this.add(new CR()), this;
  }
}
class FR extends b1 {
  /**
   * Gets the input sensibility for mouse input.
   * Higher values reduce sensitivity.
   */
  get angularSensibility() {
    const e = this.inputs.attached.mouse;
    return e ? e.angularSensibility : 0;
  }
  /**
   * Sets the input sensibility for a mouse input.
   * Higher values reduce sensitivity.
   */
  set angularSensibility(e) {
    const t = this.inputs.attached.mouse;
    t && (t.angularSensibility = e);
  }
  /**
   * Get the keys for camera movement forward.
   */
  get keysForward() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysForward : [];
  }
  /**
   * Set the keys for camera movement forward.
   */
  set keysForward(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysForward = e);
  }
  /**
   * Get the keys for camera movement backward.
   */
  get keysBackward() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysBackward : [];
  }
  set keysBackward(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysBackward = e);
  }
  /**
   * Get the keys for camera movement up.
   */
  get keysUp() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysUp : [];
  }
  /**
   * Set the keys for camera movement up.
   */
  set keysUp(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysUp = e);
  }
  /**
   * Get the keys for camera movement down.
   */
  get keysDown() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysDown : [];
  }
  /**
   * Set the keys for camera movement down.
   */
  set keysDown(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysDown = e);
  }
  /**
   * Get the keys for camera movement left.
   */
  get keysLeft() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysLeft : [];
  }
  /**
   * Set the keys for camera movement left.
   */
  set keysLeft(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysLeft = e);
  }
  /**
   * Set the keys for camera movement right.
   */
  get keysRight() {
    const e = this.inputs.attached.keyboard;
    return e ? e.keysRight : [];
  }
  /**
   * Set the keys for camera movement right.
   */
  set keysRight(e) {
    const t = this.inputs.attached.keyboard;
    t && (t.keysRight = e);
  }
  /**
   * Instantiates a FlyCamera.
   * This is a flying camera, designed for 3D movement and rotation in all directions,
   * such as in a 3D Space Shooter or a Flight Simulator.
   * @param name Define the name of the camera in the scene.
   * @param position Define the starting position of the camera in the scene.
   * @param scene Define the scene the camera belongs to.
   * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active, if no other camera has been defined as active.
   */
  constructor(e, t, r, n = !0) {
    super(e, t, r, n), this.ellipsoid = new S(1, 1, 1), this.ellipsoidOffset = new S(0, 0, 0), this.checkCollisions = !1, this.applyGravity = !1, this.cameraDirection = S.Zero(), this._trackRoll = 0, this.rollCorrect = 100, this.bankedTurn = !1, this.bankedTurnLimit = Math.PI / 2, this.bankedTurnMultiplier = 1, this._needMoveForGravity = !1, this._oldPosition = S.Zero(), this._diffPosition = S.Zero(), this._newPosition = S.Zero(), this._collisionMask = -1, this._onCollisionPositionChange = (i, s, a = null) => {
      ((o) => {
        this._newPosition.copyFrom(o), this._newPosition.subtractToRef(this._oldPosition, this._diffPosition), this._diffPosition.length() > Ge.CollisionsEpsilon && (this.position.addInPlace(this._diffPosition), this.onCollide && a && this.onCollide(a));
      })(s);
    }, this.inputs = new Dee(this), this.inputs.addKeyboard().addMouse();
  }
  /**
   * Attached controls to the current camera.
   * @param ignored defines an ignored parameter kept for backward compatibility.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e, t) {
    t = ye.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(t);
  }
  /**
   * Detach a control from the HTML DOM element.
   * The camera will stop reacting to that input.
   */
  detachControl() {
    this.inputs.detachElement(), this.cameraDirection = new S(0, 0, 0);
  }
  /**
   * Get the mask that the camera ignores in collision events.
   */
  get collisionMask() {
    return this._collisionMask;
  }
  /**
   * Set the mask that the camera ignores in collision events.
   */
  set collisionMask(e) {
    this._collisionMask = isNaN(e) ? -1 : e;
  }
  /**
   * @internal
   */
  _collideWithWorld(e) {
    let t;
    this.parent ? t = S.TransformCoordinates(this.position, this.parent.getWorldMatrix()) : t = this.position, t.subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition), this._oldPosition.addInPlace(this.ellipsoidOffset);
    const r = this.getScene().collisionCoordinator;
    this._collider || (this._collider = r.createCollider()), this._collider._radius = this.ellipsoid, this._collider.collisionMask = this._collisionMask;
    let n = e;
    this.applyGravity && (n = e.add(this.getScene().gravity)), r.getNewPosition(this._oldPosition, n, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
  }
  /** @internal */
  _checkInputs() {
    this._localDirection || (this._localDirection = S.Zero(), this._transformedDirection = S.Zero()), this.inputs.checkInputs(), super._checkInputs();
  }
  /**
   * Enable movement without a user input. This allows gravity to always be applied.
   */
  set needMoveForGravity(e) {
    this._needMoveForGravity = e;
  }
  /**
   * When true, gravity is applied whether there is user input or not.
   */
  get needMoveForGravity() {
    return this._needMoveForGravity;
  }
  /** @internal */
  _decideIfNeedsToMove() {
    return this._needMoveForGravity || Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;
  }
  /** @internal */
  _updatePosition() {
    this.checkCollisions && this.getScene().collisionsEnabled ? this._collideWithWorld(this.cameraDirection) : super._updatePosition();
  }
  /**
   * Restore the Roll to its target value at the rate specified.
   * @param rate - Higher means slower restoring.
   * @internal
   */
  restoreRoll(e) {
    const t = this._trackRoll, r = this.rotation.z, n = t - r, i = 1e-3;
    Math.abs(n) >= i && (this.rotation.z += n / e, Math.abs(t - this.rotation.z) <= i && (this.rotation.z = t));
  }
  /**
   * Destroy the camera and release the current resources held by it.
   */
  dispose() {
    this.inputs.clear(), super.dispose();
  }
  /**
   * Get the current object class name.
   * @returns the class name.
   */
  getClassName() {
    return "FlyCamera";
  }
}
C([
  fo()
], FR.prototype, "ellipsoid", void 0);
C([
  fo()
], FR.prototype, "ellipsoidOffset", void 0);
C([
  M()
], FR.prototype, "checkCollisions", void 0);
C([
  M()
], FR.prototype, "applyGravity", void 0);
class jee extends RR {
  /**
   * Instantiates a new FollowCameraInputsManager.
   * @param camera Defines the camera the inputs belong to
   */
  constructor(e) {
    super(e);
  }
  /**
   * Add keyboard input support to the input manager.
   * @returns the current input manager
   */
  addKeyboard() {
    return this.add(new aA()), this;
  }
  /**
   * Add mouse wheel input support to the input manager.
   * @returns the current input manager
   */
  addMouseWheel() {
    return this.add(new qD()), this;
  }
  /**
   * Add pointers input support to the input manager.
   * @returns the current input manager
   */
  addPointers() {
    return this.add(new Eu()), this;
  }
  /**
   * Add orientation input support to the input manager.
   * @returns the current input manager
   */
  addVRDeviceOrientation() {
    return console.warn("DeviceOrientation support not yet implemented for FollowCamera."), this;
  }
}
Cs.AddNodeConstructor("FollowCamera", (A, e) => () => new Fv(A, S.Zero(), e));
Cs.AddNodeConstructor("ArcFollowCamera", (A, e) => () => new wee(A, 0, 0, 1, null, e));
class Fv extends b1 {
  /**
   * Instantiates the follow camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#followcamera
   * @param name Define the name of the camera in the scene
   * @param position Define the position of the camera
   * @param scene Define the scene the camera belong to
   * @param lockedTarget Define the target of the camera
   */
  constructor(e, t, r, n = null) {
    super(e, t, r), this.radius = 12, this.lowerRadiusLimit = null, this.upperRadiusLimit = null, this.rotationOffset = 0, this.lowerRotationOffsetLimit = null, this.upperRotationOffsetLimit = null, this.heightOffset = 4, this.lowerHeightOffsetLimit = null, this.upperHeightOffsetLimit = null, this.cameraAcceleration = 0.05, this.maxCameraSpeed = 20, this.lockedTarget = n, this.inputs = new jee(this), this.inputs.addKeyboard().addMouseWheel().addPointers();
  }
  _follow(e) {
    if (!e)
      return;
    const t = ue.Matrix[0];
    e.absoluteRotationQuaternion.toRotationMatrix(t);
    const r = Math.atan2(t.m[8], t.m[10]), n = ye.ToRadians(this.rotationOffset) + r, i = e.getAbsolutePosition(), s = i.x + Math.sin(n) * this.radius, a = i.z + Math.cos(n) * this.radius, f = s - this.position.x, o = i.y + this.heightOffset - this.position.y, d = a - this.position.z;
    let v = f * this.cameraAcceleration * 2, u = o * this.cameraAcceleration, l = d * this.cameraAcceleration * 2;
    (v > this.maxCameraSpeed || v < -this.maxCameraSpeed) && (v = v < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), (u > this.maxCameraSpeed || u < -this.maxCameraSpeed) && (u = u < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), (l > this.maxCameraSpeed || l < -this.maxCameraSpeed) && (l = l < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), this.position = new S(this.position.x + v, this.position.y + u, this.position.z + l), this.setTarget(i);
  }
  /**
   * Attached controls to the current camera.
   * @param ignored defines an ignored parameter kept for backward compatibility.
   * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
   */
  attachControl(e, t) {
    t = ye.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(t), this._reset = () => {
    };
  }
  /**
   * Detach the current controls from the specified dom element.
   */
  detachControl() {
    this.inputs.detachElement(), this._reset && this._reset();
  }
  /** @internal */
  _checkInputs() {
    this.inputs.checkInputs(), this._checkLimits(), super._checkInputs(), this.lockedTarget && this._follow(this.lockedTarget);
  }
  _checkLimits() {
    this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit && (this.radius = this.lowerRadiusLimit), this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit && (this.radius = this.upperRadiusLimit), this.lowerHeightOffsetLimit !== null && this.heightOffset < this.lowerHeightOffsetLimit && (this.heightOffset = this.lowerHeightOffsetLimit), this.upperHeightOffsetLimit !== null && this.heightOffset > this.upperHeightOffsetLimit && (this.heightOffset = this.upperHeightOffsetLimit), this.lowerRotationOffsetLimit !== null && this.rotationOffset < this.lowerRotationOffsetLimit && (this.rotationOffset = this.lowerRotationOffsetLimit), this.upperRotationOffsetLimit !== null && this.rotationOffset > this.upperRotationOffsetLimit && (this.rotationOffset = this.upperRotationOffsetLimit);
  }
  /**
   * Gets the camera class name.
   * @returns the class name
   */
  getClassName() {
    return "FollowCamera";
  }
}
C([
  M()
], Fv.prototype, "radius", void 0);
C([
  M()
], Fv.prototype, "lowerRadiusLimit", void 0);
C([
  M()
], Fv.prototype, "upperRadiusLimit", void 0);
C([
  M()
], Fv.prototype, "rotationOffset", void 0);
C([
  M()
], Fv.prototype, "lowerRotationOffsetLimit", void 0);
C([
  M()
], Fv.prototype, "upperRotationOffsetLimit", void 0);
C([
  M()
], Fv.prototype, "heightOffset", void 0);
C([
  M()
], Fv.prototype, "lowerHeightOffsetLimit", void 0);
C([
  M()
], Fv.prototype, "upperHeightOffsetLimit", void 0);
C([
  M()
], Fv.prototype, "cameraAcceleration", void 0);
C([
  M()
], Fv.prototype, "maxCameraSpeed", void 0);
C([
  tU("lockedTargetId")
], Fv.prototype, "lockedTarget", void 0);
class wee extends b1 {
  /**
   * Instantiates a new ArcFollowCamera
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#followcamera
   * @param name Define the name of the camera
   * @param alpha Define the rotation angle of the camera around the longitudinal axis
   * @param beta Define the rotation angle of the camera around the elevation axis
   * @param radius Define the radius of the camera from its target point
   * @param target Define the target of the camera
   * @param scene Define the scene the camera belongs to
   */
  constructor(e, t, r, n, i, s) {
    super(e, S.Zero(), s), this.alpha = t, this.beta = r, this.radius = n, this._cartesianCoordinates = S.Zero(), this.setMeshTarget(i);
  }
  /**
   * Sets the mesh to follow with this camera.
   * @param target the target to follow
   */
  setMeshTarget(e) {
    this._meshTarget = e, this._follow();
  }
  _follow() {
    if (!this._meshTarget)
      return;
    this._cartesianCoordinates.x = this.radius * Math.cos(this.alpha) * Math.cos(this.beta), this._cartesianCoordinates.y = this.radius * Math.sin(this.beta), this._cartesianCoordinates.z = this.radius * Math.sin(this.alpha) * Math.cos(this.beta);
    const e = this._meshTarget.getAbsolutePosition();
    this.position = e.add(this._cartesianCoordinates), this.setTarget(e);
  }
  /** @internal */
  _checkInputs() {
    super._checkInputs(), this._follow();
  }
  /**
   * Returns the class name of the object.
   * It is mostly used internally for serialization purposes.
   */
  getClassName() {
    return "ArcFollowCamera";
  }
}
var El;
(function(A) {
  A[A.A = 0] = "A", A[A.B = 1] = "B", A[A.X = 2] = "X", A[A.Y = 3] = "Y", A[A.LB = 4] = "LB", A[A.RB = 5] = "RB", A[A.Back = 8] = "Back", A[A.Start = 9] = "Start", A[A.LeftStick = 10] = "LeftStick", A[A.RightStick = 11] = "RightStick";
})(El || (El = {}));
var Lw;
(function(A) {
  A[A.Up = 12] = "Up", A[A.Down = 13] = "Down", A[A.Left = 14] = "Left", A[A.Right = 15] = "Right";
})(Lw || (Lw = {}));
class mee extends N9 {
  /**
   * Creates a new XBox360 gamepad object
   * @param id defines the id of this gamepad
   * @param index defines its index
   * @param gamepad defines the internal HTML gamepad object
   * @param xboxOne defines if it is a XBox One gamepad
   */
  constructor(e, t, r, n = !1) {
    super(e, t, r, 0, 1, 2, 3), this._leftTrigger = 0, this._rightTrigger = 0, this.onButtonDownObservable = new Oe(), this.onButtonUpObservable = new Oe(), this.onPadDownObservable = new Oe(), this.onPadUpObservable = new Oe(), this._buttonA = 0, this._buttonB = 0, this._buttonX = 0, this._buttonY = 0, this._buttonBack = 0, this._buttonStart = 0, this._buttonLB = 0, this._buttonRB = 0, this._buttonLeftStick = 0, this._buttonRightStick = 0, this._dPadUp = 0, this._dPadDown = 0, this._dPadLeft = 0, this._dPadRight = 0, this._isXboxOnePad = !1, this.type = N9.XBOX, this._isXboxOnePad = n;
  }
  /**
   * Defines the callback to call when left trigger is pressed
   * @param callback defines the callback to use
   */
  onlefttriggerchanged(e) {
    this._onlefttriggerchanged = e;
  }
  /**
   * Defines the callback to call when right trigger is pressed
   * @param callback defines the callback to use
   */
  onrighttriggerchanged(e) {
    this._onrighttriggerchanged = e;
  }
  /**
   * Gets the left trigger value
   */
  get leftTrigger() {
    return this._leftTrigger;
  }
  /**
   * Sets the left trigger value
   */
  set leftTrigger(e) {
    this._onlefttriggerchanged && this._leftTrigger !== e && this._onlefttriggerchanged(e), this._leftTrigger = e;
  }
  /**
   * Gets the right trigger value
   */
  get rightTrigger() {
    return this._rightTrigger;
  }
  /**
   * Sets the right trigger value
   */
  set rightTrigger(e) {
    this._onrighttriggerchanged && this._rightTrigger !== e && this._onrighttriggerchanged(e), this._rightTrigger = e;
  }
  /**
   * Defines the callback to call when a button is pressed
   * @param callback defines the callback to use
   */
  onbuttondown(e) {
    this._onbuttondown = e;
  }
  /**
   * Defines the callback to call when a button is released
   * @param callback defines the callback to use
   */
  onbuttonup(e) {
    this._onbuttonup = e;
  }
  /**
   * Defines the callback to call when a pad is pressed
   * @param callback defines the callback to use
   */
  ondpaddown(e) {
    this._ondpaddown = e;
  }
  /**
   * Defines the callback to call when a pad is released
   * @param callback defines the callback to use
   */
  ondpadup(e) {
    this._ondpadup = e;
  }
  _setButtonValue(e, t, r) {
    return e !== t && (e === 1 && (this._onbuttondown && this._onbuttondown(r), this.onButtonDownObservable.notifyObservers(r)), e === 0 && (this._onbuttonup && this._onbuttonup(r), this.onButtonUpObservable.notifyObservers(r))), e;
  }
  _setDPadValue(e, t, r) {
    return e !== t && (e === 1 && (this._ondpaddown && this._ondpaddown(r), this.onPadDownObservable.notifyObservers(r)), e === 0 && (this._ondpadup && this._ondpadup(r), this.onPadUpObservable.notifyObservers(r))), e;
  }
  /**
   * Gets the value of the `A` button
   */
  get buttonA() {
    return this._buttonA;
  }
  /**
   * Sets the value of the `A` button
   */
  set buttonA(e) {
    this._buttonA = this._setButtonValue(e, this._buttonA, El.A);
  }
  /**
   * Gets the value of the `B` button
   */
  get buttonB() {
    return this._buttonB;
  }
  /**
   * Sets the value of the `B` button
   */
  set buttonB(e) {
    this._buttonB = this._setButtonValue(e, this._buttonB, El.B);
  }
  /**
   * Gets the value of the `X` button
   */
  get buttonX() {
    return this._buttonX;
  }
  /**
   * Sets the value of the `X` button
   */
  set buttonX(e) {
    this._buttonX = this._setButtonValue(e, this._buttonX, El.X);
  }
  /**
   * Gets the value of the `Y` button
   */
  get buttonY() {
    return this._buttonY;
  }
  /**
   * Sets the value of the `Y` button
   */
  set buttonY(e) {
    this._buttonY = this._setButtonValue(e, this._buttonY, El.Y);
  }
  /**
   * Gets the value of the `Start` button
   */
  get buttonStart() {
    return this._buttonStart;
  }
  /**
   * Sets the value of the `Start` button
   */
  set buttonStart(e) {
    this._buttonStart = this._setButtonValue(e, this._buttonStart, El.Start);
  }
  /**
   * Gets the value of the `Back` button
   */
  get buttonBack() {
    return this._buttonBack;
  }
  /**
   * Sets the value of the `Back` button
   */
  set buttonBack(e) {
    this._buttonBack = this._setButtonValue(e, this._buttonBack, El.Back);
  }
  /**
   * Gets the value of the `Left` button
   */
  get buttonLB() {
    return this._buttonLB;
  }
  /**
   * Sets the value of the `Left` button
   */
  set buttonLB(e) {
    this._buttonLB = this._setButtonValue(e, this._buttonLB, El.LB);
  }
  /**
   * Gets the value of the `Right` button
   */
  get buttonRB() {
    return this._buttonRB;
  }
  /**
   * Sets the value of the `Right` button
   */
  set buttonRB(e) {
    this._buttonRB = this._setButtonValue(e, this._buttonRB, El.RB);
  }
  /**
   * Gets the value of the Left joystick
   */
  get buttonLeftStick() {
    return this._buttonLeftStick;
  }
  /**
   * Sets the value of the Left joystick
   */
  set buttonLeftStick(e) {
    this._buttonLeftStick = this._setButtonValue(e, this._buttonLeftStick, El.LeftStick);
  }
  /**
   * Gets the value of the Right joystick
   */
  get buttonRightStick() {
    return this._buttonRightStick;
  }
  /**
   * Sets the value of the Right joystick
   */
  set buttonRightStick(e) {
    this._buttonRightStick = this._setButtonValue(e, this._buttonRightStick, El.RightStick);
  }
  /**
   * Gets the value of D-pad up
   */
  get dPadUp() {
    return this._dPadUp;
  }
  /**
   * Sets the value of D-pad up
   */
  set dPadUp(e) {
    this._dPadUp = this._setDPadValue(e, this._dPadUp, Lw.Up);
  }
  /**
   * Gets the value of D-pad down
   */
  get dPadDown() {
    return this._dPadDown;
  }
  /**
   * Sets the value of D-pad down
   */
  set dPadDown(e) {
    this._dPadDown = this._setDPadValue(e, this._dPadDown, Lw.Down);
  }
  /**
   * Gets the value of D-pad left
   */
  get dPadLeft() {
    return this._dPadLeft;
  }
  /**
   * Sets the value of D-pad left
   */
  set dPadLeft(e) {
    this._dPadLeft = this._setDPadValue(e, this._dPadLeft, Lw.Left);
  }
  /**
   * Gets the value of D-pad right
   */
  get dPadRight() {
    return this._dPadRight;
  }
  /**
   * Sets the value of D-pad right
   */
  set dPadRight(e) {
    this._dPadRight = this._setDPadValue(e, this._dPadRight, Lw.Right);
  }
  /**
   * Force the gamepad to synchronize with device values
   */
  update() {
    super.update(), this._isXboxOnePad ? (this.buttonA = this.browserGamepad.buttons[0].value, this.buttonB = this.browserGamepad.buttons[1].value, this.buttonX = this.browserGamepad.buttons[2].value, this.buttonY = this.browserGamepad.buttons[3].value, this.buttonLB = this.browserGamepad.buttons[4].value, this.buttonRB = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonBack = this.browserGamepad.buttons[8].value, this.buttonStart = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value) : (this.buttonA = this.browserGamepad.buttons[0].value, this.buttonB = this.browserGamepad.buttons[1].value, this.buttonX = this.browserGamepad.buttons[2].value, this.buttonY = this.browserGamepad.buttons[3].value, this.buttonLB = this.browserGamepad.buttons[4].value, this.buttonRB = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonBack = this.browserGamepad.buttons[8].value, this.buttonStart = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value);
  }
  /**
   * Disposes the gamepad
   */
  dispose() {
    super.dispose(), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear(), this.onPadDownObservable.clear(), this.onPadUpObservable.clear();
  }
}
var dp;
(function(A) {
  A[A.Cross = 0] = "Cross", A[A.Circle = 1] = "Circle", A[A.Square = 2] = "Square", A[A.Triangle = 3] = "Triangle", A[A.L1 = 4] = "L1", A[A.R1 = 5] = "R1", A[A.Share = 8] = "Share", A[A.Options = 9] = "Options", A[A.LeftStick = 10] = "LeftStick", A[A.RightStick = 11] = "RightStick";
})(dp || (dp = {}));
var Kw;
(function(A) {
  A[A.Up = 12] = "Up", A[A.Down = 13] = "Down", A[A.Left = 14] = "Left", A[A.Right = 15] = "Right";
})(Kw || (Kw = {}));
class Bee extends N9 {
  /**
   * Creates a new DualShock gamepad object
   * @param id defines the id of this gamepad
   * @param index defines its index
   * @param gamepad defines the internal HTML gamepad object
   */
  constructor(e, t, r) {
    super(e.replace("STANDARD GAMEPAD", "SONY PLAYSTATION DUALSHOCK"), t, r, 0, 1, 2, 3), this._leftTrigger = 0, this._rightTrigger = 0, this.onButtonDownObservable = new Oe(), this.onButtonUpObservable = new Oe(), this.onPadDownObservable = new Oe(), this.onPadUpObservable = new Oe(), this._buttonCross = 0, this._buttonCircle = 0, this._buttonSquare = 0, this._buttonTriangle = 0, this._buttonShare = 0, this._buttonOptions = 0, this._buttonL1 = 0, this._buttonR1 = 0, this._buttonLeftStick = 0, this._buttonRightStick = 0, this._dPadUp = 0, this._dPadDown = 0, this._dPadLeft = 0, this._dPadRight = 0, this.type = N9.DUALSHOCK;
  }
  /**
   * Defines the callback to call when left trigger is pressed
   * @param callback defines the callback to use
   */
  onlefttriggerchanged(e) {
    this._onlefttriggerchanged = e;
  }
  /**
   * Defines the callback to call when right trigger is pressed
   * @param callback defines the callback to use
   */
  onrighttriggerchanged(e) {
    this._onrighttriggerchanged = e;
  }
  /**
   * Gets the left trigger value
   */
  get leftTrigger() {
    return this._leftTrigger;
  }
  /**
   * Sets the left trigger value
   */
  set leftTrigger(e) {
    this._onlefttriggerchanged && this._leftTrigger !== e && this._onlefttriggerchanged(e), this._leftTrigger = e;
  }
  /**
   * Gets the right trigger value
   */
  get rightTrigger() {
    return this._rightTrigger;
  }
  /**
   * Sets the right trigger value
   */
  set rightTrigger(e) {
    this._onrighttriggerchanged && this._rightTrigger !== e && this._onrighttriggerchanged(e), this._rightTrigger = e;
  }
  /**
   * Defines the callback to call when a button is pressed
   * @param callback defines the callback to use
   */
  onbuttondown(e) {
    this._onbuttondown = e;
  }
  /**
   * Defines the callback to call when a button is released
   * @param callback defines the callback to use
   */
  onbuttonup(e) {
    this._onbuttonup = e;
  }
  /**
   * Defines the callback to call when a pad is pressed
   * @param callback defines the callback to use
   */
  ondpaddown(e) {
    this._ondpaddown = e;
  }
  /**
   * Defines the callback to call when a pad is released
   * @param callback defines the callback to use
   */
  ondpadup(e) {
    this._ondpadup = e;
  }
  _setButtonValue(e, t, r) {
    return e !== t && (e === 1 && (this._onbuttondown && this._onbuttondown(r), this.onButtonDownObservable.notifyObservers(r)), e === 0 && (this._onbuttonup && this._onbuttonup(r), this.onButtonUpObservable.notifyObservers(r))), e;
  }
  _setDPadValue(e, t, r) {
    return e !== t && (e === 1 && (this._ondpaddown && this._ondpaddown(r), this.onPadDownObservable.notifyObservers(r)), e === 0 && (this._ondpadup && this._ondpadup(r), this.onPadUpObservable.notifyObservers(r))), e;
  }
  /**
   * Gets the value of the `Cross` button
   */
  get buttonCross() {
    return this._buttonCross;
  }
  /**
   * Sets the value of the `Cross` button
   */
  set buttonCross(e) {
    this._buttonCross = this._setButtonValue(e, this._buttonCross, dp.Cross);
  }
  /**
   * Gets the value of the `Circle` button
   */
  get buttonCircle() {
    return this._buttonCircle;
  }
  /**
   * Sets the value of the `Circle` button
   */
  set buttonCircle(e) {
    this._buttonCircle = this._setButtonValue(e, this._buttonCircle, dp.Circle);
  }
  /**
   * Gets the value of the `Square` button
   */
  get buttonSquare() {
    return this._buttonSquare;
  }
  /**
   * Sets the value of the `Square` button
   */
  set buttonSquare(e) {
    this._buttonSquare = this._setButtonValue(e, this._buttonSquare, dp.Square);
  }
  /**
   * Gets the value of the `Triangle` button
   */
  get buttonTriangle() {
    return this._buttonTriangle;
  }
  /**
   * Sets the value of the `Triangle` button
   */
  set buttonTriangle(e) {
    this._buttonTriangle = this._setButtonValue(e, this._buttonTriangle, dp.Triangle);
  }
  /**
   * Gets the value of the `Options` button
   */
  get buttonOptions() {
    return this._buttonOptions;
  }
  /**
   * Sets the value of the `Options` button
   */
  set buttonOptions(e) {
    this._buttonOptions = this._setButtonValue(e, this._buttonOptions, dp.Options);
  }
  /**
   * Gets the value of the `Share` button
   */
  get buttonShare() {
    return this._buttonShare;
  }
  /**
   * Sets the value of the `Share` button
   */
  set buttonShare(e) {
    this._buttonShare = this._setButtonValue(e, this._buttonShare, dp.Share);
  }
  /**
   * Gets the value of the `L1` button
   */
  get buttonL1() {
    return this._buttonL1;
  }
  /**
   * Sets the value of the `L1` button
   */
  set buttonL1(e) {
    this._buttonL1 = this._setButtonValue(e, this._buttonL1, dp.L1);
  }
  /**
   * Gets the value of the `R1` button
   */
  get buttonR1() {
    return this._buttonR1;
  }
  /**
   * Sets the value of the `R1` button
   */
  set buttonR1(e) {
    this._buttonR1 = this._setButtonValue(e, this._buttonR1, dp.R1);
  }
  /**
   * Gets the value of the Left joystick
   */
  get buttonLeftStick() {
    return this._buttonLeftStick;
  }
  /**
   * Sets the value of the Left joystick
   */
  set buttonLeftStick(e) {
    this._buttonLeftStick = this._setButtonValue(e, this._buttonLeftStick, dp.LeftStick);
  }
  /**
   * Gets the value of the Right joystick
   */
  get buttonRightStick() {
    return this._buttonRightStick;
  }
  /**
   * Sets the value of the Right joystick
   */
  set buttonRightStick(e) {
    this._buttonRightStick = this._setButtonValue(e, this._buttonRightStick, dp.RightStick);
  }
  /**
   * Gets the value of D-pad up
   */
  get dPadUp() {
    return this._dPadUp;
  }
  /**
   * Sets the value of D-pad up
   */
  set dPadUp(e) {
    this._dPadUp = this._setDPadValue(e, this._dPadUp, Kw.Up);
  }
  /**
   * Gets the value of D-pad down
   */
  get dPadDown() {
    return this._dPadDown;
  }
  /**
   * Sets the value of D-pad down
   */
  set dPadDown(e) {
    this._dPadDown = this._setDPadValue(e, this._dPadDown, Kw.Down);
  }
  /**
   * Gets the value of D-pad left
   */
  get dPadLeft() {
    return this._dPadLeft;
  }
  /**
   * Sets the value of D-pad left
   */
  set dPadLeft(e) {
    this._dPadLeft = this._setDPadValue(e, this._dPadLeft, Kw.Left);
  }
  /**
   * Gets the value of D-pad right
   */
  get dPadRight() {
    return this._dPadRight;
  }
  /**
   * Sets the value of D-pad right
   */
  set dPadRight(e) {
    this._dPadRight = this._setDPadValue(e, this._dPadRight, Kw.Right);
  }
  /**
   * Force the gamepad to synchronize with device values
   */
  update() {
    super.update(), this.buttonCross = this.browserGamepad.buttons[0].value, this.buttonCircle = this.browserGamepad.buttons[1].value, this.buttonSquare = this.browserGamepad.buttons[2].value, this.buttonTriangle = this.browserGamepad.buttons[3].value, this.buttonL1 = this.browserGamepad.buttons[4].value, this.buttonR1 = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonShare = this.browserGamepad.buttons[8].value, this.buttonOptions = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value;
  }
  /**
   * Disposes the gamepad
   */
  dispose() {
    super.dispose(), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear(), this.onPadDownObservable.clear(), this.onPadUpObservable.clear();
  }
}
class Wee {
  /**
   * Initializes the gamepad manager
   * @param _scene BabylonJS scene
   */
  constructor(e) {
    if (this._scene = e, this._babylonGamepads = [], this._oneGamepadConnected = !1, this._isMonitoring = !1, this.onGamepadDisconnectedObservable = new Oe(), u9() ? (this._gamepadEventSupported = "GamepadEvent" in window, this._gamepadSupport = navigator && navigator.getGamepads) : this._gamepadEventSupported = !1, this.onGamepadConnectedObservable = new Oe((t) => {
      for (const r in this._babylonGamepads) {
        const n = this._babylonGamepads[r];
        n && n._isConnected && this.onGamepadConnectedObservable.notifyObserver(t, n);
      }
    }), this._onGamepadConnectedEvent = (t) => {
      const r = t.gamepad;
      if (r.index in this._babylonGamepads && this._babylonGamepads[r.index].isConnected)
        return;
      let n;
      this._babylonGamepads[r.index] ? (n = this._babylonGamepads[r.index], n.browserGamepad = r, n._isConnected = !0) : n = this._addNewGamepad(r), this.onGamepadConnectedObservable.notifyObservers(n), this._startMonitoringGamepads();
    }, this._onGamepadDisconnectedEvent = (t) => {
      const r = t.gamepad;
      for (const n in this._babylonGamepads)
        if (this._babylonGamepads[n].index === r.index) {
          const i = this._babylonGamepads[n];
          i._isConnected = !1, this.onGamepadDisconnectedObservable.notifyObservers(i), i.dispose && i.dispose();
          break;
        }
    }, this._gamepadSupport)
      if (this._updateGamepadObjects(), this._babylonGamepads.length && this._startMonitoringGamepads(), this._gamepadEventSupported) {
        const t = this._scene ? this._scene.getEngine().getHostWindow() : window;
        t && (t.addEventListener("gamepadconnected", this._onGamepadConnectedEvent, !1), t.addEventListener("gamepaddisconnected", this._onGamepadDisconnectedEvent, !1));
      } else
        this._startMonitoringGamepads();
  }
  /**
   * The gamepads in the game pad manager
   */
  get gamepads() {
    return this._babylonGamepads;
  }
  /**
   * Get the gamepad controllers based on type
   * @param type The type of gamepad controller
   * @returns Nullable gamepad
   */
  getGamepadByType(e = N9.XBOX) {
    for (const t of this._babylonGamepads)
      if (t && t.type === e)
        return t;
    return null;
  }
  /**
   * Disposes the gamepad manager
   */
  dispose() {
    this._gamepadEventSupported && (this._onGamepadConnectedEvent && window.removeEventListener("gamepadconnected", this._onGamepadConnectedEvent), this._onGamepadDisconnectedEvent && window.removeEventListener("gamepaddisconnected", this._onGamepadDisconnectedEvent), this._onGamepadConnectedEvent = null, this._onGamepadDisconnectedEvent = null), this._babylonGamepads.forEach((e) => {
      e.dispose();
    }), this.onGamepadConnectedObservable.clear(), this.onGamepadDisconnectedObservable.clear(), this._oneGamepadConnected = !1, this._stopMonitoringGamepads(), this._babylonGamepads = [];
  }
  _addNewGamepad(e) {
    this._oneGamepadConnected || (this._oneGamepadConnected = !0);
    let t;
    const r = e.id.search("054c") !== -1 && e.id.search("0ce6") === -1, n = e.id.search("Xbox One") !== -1;
    return n || e.id.search("Xbox 360") !== -1 || e.id.search("xinput") !== -1 || e.id.search("045e") !== -1 && e.id.search("Surface Dock") === -1 ? t = new mee(e.id, e.index, e, n) : r ? t = new Bee(e.id, e.index, e) : t = new xee(e.id, e.index, e), this._babylonGamepads[t.index] = t, t;
  }
  _startMonitoringGamepads() {
    this._isMonitoring || (this._isMonitoring = !0, this._checkGamepadsStatus());
  }
  _stopMonitoringGamepads() {
    this._isMonitoring = !1;
  }
  /** @internal */
  _checkGamepadsStatus() {
    this._updateGamepadObjects();
    for (const e in this._babylonGamepads) {
      const t = this._babylonGamepads[e];
      if (!(!t || !t.isConnected))
        try {
          t.update();
        } catch {
          this._loggedErrors.indexOf(t.index) === -1 && (ye.Warn(`Error updating gamepad ${t.id}`), this._loggedErrors.push(t.index));
        }
    }
    this._isMonitoring && Ge.QueueNewFrame(() => {
      this._checkGamepadsStatus();
    });
  }
  // This function is called only on Chrome, which does not properly support
  // connection/disconnection events and forces you to recopy again the gamepad object
  _updateGamepadObjects() {
    const e = navigator.getGamepads ? navigator.getGamepads() : [];
    for (let t = 0; t < e.length; t++) {
      const r = e[t];
      if (r)
        if (this._babylonGamepads[r.index])
          this._babylonGamepads[t].browserGamepad = r, this._babylonGamepads[t].isConnected || (this._babylonGamepads[t]._isConnected = !0, this.onGamepadConnectedObservable.notifyObservers(this._babylonGamepads[t]));
        else {
          const n = this._addNewGamepad(r);
          this.onGamepadConnectedObservable.notifyObservers(n);
        }
    }
  }
}
Object.defineProperty(sr.prototype, "gamepadManager", {
  get: function() {
    if (!this._gamepadManager) {
      this._gamepadManager = new Wee(this);
      let A = this._getComponent(Ot.NAME_GAMEPAD);
      A || (A = new See(this), this._addComponent(A));
    }
    return this._gamepadManager;
  },
  enumerable: !0,
  configurable: !0
});
kR.prototype.addGamepad = function() {
  return this.add(new ER()), this;
};
CO.prototype.addGamepad = function() {
  return this.add(new VR()), this;
};
class See {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_GAMEPAD, this.scene = e;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._beforeCameraUpdateStage.registerStep(Ot.STEP_BEFORECAMERAUPDATE_GAMEPAD, this, this._beforeCameraUpdate);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources
   */
  dispose() {
    const e = this.scene._gamepadManager;
    e && (e.dispose(), this.scene._gamepadManager = null);
  }
  _beforeCameraUpdate() {
    const e = this.scene._gamepadManager;
    e && e._isMonitoring && e._checkGamepadsStatus();
  }
}
Cs.AddNodeConstructor("FreeCamera", (A, e) => () => new bD(A, S.Zero(), e));
class bD extends pQ {
  /**
   * Defines the gamepad rotation sensibility.
   * This is the threshold from when rotation starts to be accounted for to prevent jittering.
   */
  get gamepadAngularSensibility() {
    const e = this.inputs.attached.gamepad;
    return e ? e.gamepadAngularSensibility : 0;
  }
  set gamepadAngularSensibility(e) {
    const t = this.inputs.attached.gamepad;
    t && (t.gamepadAngularSensibility = e);
  }
  /**
   * Defines the gamepad move sensibility.
   * This is the threshold from when moving starts to be accounted for to prevent jittering.
   */
  get gamepadMoveSensibility() {
    const e = this.inputs.attached.gamepad;
    return e ? e.gamepadMoveSensibility : 0;
  }
  set gamepadMoveSensibility(e) {
    const t = this.inputs.attached.gamepad;
    t && (t.gamepadMoveSensibility = e);
  }
  /**
   * The Universal Camera is the one to choose for first person shooter type games, and works with all the keyboard, mouse, touch and gamepads. This replaces the earlier Free Camera,
   * which still works and will still be found in many Playgrounds.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
   * @param name Define the name of the camera in the scene
   * @param position Define the start position of the camera in the scene
   * @param scene Define the scene the camera belongs to
   */
  constructor(e, t, r) {
    super(e, t, r), this.inputs.addGamepad();
  }
  /**
   * Gets the current object class name.
   * @returns the class name
   */
  getClassName() {
    return "UniversalCamera";
  }
}
Tr._CreateDefaultParsedCamera = (A, e) => new bD(A, S.Zero(), e);
Cs.AddNodeConstructor("GamepadCamera", (A, e) => () => new yO(A, S.Zero(), e));
class yO extends bD {
  /**
   * Instantiates a new Gamepad Camera
   * This represents a FPS type of camera. This is only here for back compat purpose.
   * Please use the UniversalCamera instead as both are identical.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
   * @param name Define the name of the camera in the scene
   * @param position Define the start position of the camera in the scene
   * @param scene Define the scene the camera belongs to
   */
  constructor(e, t, r) {
    super(e, t, r);
  }
  /**
   * Gets the current object class name.
   * @returns the class name
   */
  getClassName() {
    return "GamepadCamera";
  }
}
const Q6e = "passCubePixelShader", Y6e = `varying vec2 vUV;uniform samplerCube textureSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{vec2 uv=vUV*2.0-1.0;
#ifdef POSITIVEX
gl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));
#endif
#ifdef NEGATIVEX
gl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));
#endif
#ifdef POSITIVEY
gl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));
#endif
#ifdef NEGATIVEY
gl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));
#endif
#ifdef POSITIVEZ
gl_FragColor=textureCube(textureSampler,vec3(uv,1.001));
#endif
#ifdef NEGATIVEZ
gl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));
#endif
}`;
Le.ShadersStore[Q6e] = Y6e;
class lg extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "PassPostProcess" string
   */
  getClassName() {
    return "PassPostProcess";
  }
  /**
   * Creates the PassPostProcess
   * @param name The name of the effect.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType The type of texture to be used when performing the post processing.
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r = null, n, i, s, a = 0, f = !1) {
    super(e, "pass", null, null, t, r, n, i, s, void 0, a, void 0, null, f);
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new lg(e.name, e.options, t, e.renderTargetSamplingMode, e._engine, e.reusable), e, r, n);
  }
}
Ue("BABYLON.PassPostProcess", lg);
class hQ extends kr {
  /**
   * Gets or sets the cube face to display.
   *  * 0 is +X
   *  * 1 is -X
   *  * 2 is +Y
   *  * 3 is -Y
   *  * 4 is +Z
   *  * 5 is -Z
   */
  get face() {
    return this._face;
  }
  set face(e) {
    if (!(e < 0 || e > 5))
      switch (this._face = e, this._face) {
        case 0:
          this.updateEffect("#define POSITIVEX");
          break;
        case 1:
          this.updateEffect("#define NEGATIVEX");
          break;
        case 2:
          this.updateEffect("#define POSITIVEY");
          break;
        case 3:
          this.updateEffect("#define NEGATIVEY");
          break;
        case 4:
          this.updateEffect("#define POSITIVEZ");
          break;
        case 5:
          this.updateEffect("#define NEGATIVEZ");
          break;
      }
  }
  /**
   * Gets a string identifying the name of the class
   * @returns "PassCubePostProcess" string
   */
  getClassName() {
    return "PassCubePostProcess";
  }
  /**
   * Creates the PassCubePostProcess
   * @param name The name of the effect.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType The type of texture to be used when performing the post processing.
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r = null, n, i, s, a = 0, f = !1) {
    super(e, "passCube", null, null, t, r, n, i, s, "#define POSITIVEX", a, void 0, null, f), this._face = 0;
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new hQ(e.name, e.options, t, e.renderTargetSamplingMode, e._engine, e.reusable), e, r, n);
  }
}
Ge._RescalePostProcessFactory = (A) => new lg("rescale", 1, null, 2, A, !1, 0);
const M6e = "anaglyphPixelShader", L6e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D leftSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec4 leftFrag=texture2D(leftSampler,vUV);leftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);vec4 rightFrag=texture2D(textureSampler,vUV);rightFrag=vec4(rightFrag.r,1.0,1.0,1.0);gl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);}`;
Le.ShadersStore[M6e] = L6e;
class HQ extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "AnaglyphPostProcess" string
   */
  getClassName() {
    return "AnaglyphPostProcess";
  }
  /**
   * Creates a new AnaglyphPostProcess
   * @param name defines postprocess name
   * @param options defines creation options or target ratio scale
   * @param rigCameras defines cameras using this postprocess
   * @param samplingMode defines required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default)
   * @param engine defines hosting engine
   * @param reusable defines if the postprocess will be reused multiple times per frame
   */
  constructor(e, t, r, n, i, s) {
    super(e, "anaglyph", null, ["leftSampler"], t, r[1], n, i, s), this._passedProcess = r[0]._rigPostProcess, this.onApplyObservable.add((a) => {
      a.setTextureFromPostProcess("leftSampler", this._passedProcess);
    });
  }
}
Ue("BABYLON.AnaglyphPostProcess", HQ);
function NR(A) {
  A._rigCameras[0]._rigPostProcess = new lg(A.name + "_passthru", 1, A._rigCameras[0]), A._rigCameras[1]._rigPostProcess = new HQ(A.name + "_anaglyph", 1, A._rigCameras);
}
Cs.AddNodeConstructor("AnaglyphArcRotateCamera", (A, e, t) => () => new Uee(A, 0, 0, 1, S.Zero(), t.interaxial_distance, e));
class Uee extends ps {
  /**
   * Creates a new AnaglyphArcRotateCamera
   * @param name defines camera name
   * @param alpha defines alpha angle (in radians)
   * @param beta defines beta angle (in radians)
   * @param radius defines radius
   * @param target defines camera target
   * @param interaxialDistance defines distance between each color axis
   * @param scene defines the hosting scene
   */
  constructor(e, t, r, n, i, s, a) {
    super(e, t, r, n, i, a), this._setRigMode = () => NR(this), this.interaxialDistance = s, this.setCameraRigMode(Tr.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: s });
  }
  /**
   * Gets camera class name
   * @returns AnaglyphArcRotateCamera
   */
  getClassName() {
    return "AnaglyphArcRotateCamera";
  }
}
Cs.AddNodeConstructor("AnaglyphFreeCamera", (A, e, t) => () => new Iee(A, S.Zero(), t.interaxial_distance, e));
class Iee extends SA {
  /**
   * Creates a new AnaglyphFreeCamera
   * @param name defines camera name
   * @param position defines initial position
   * @param interaxialDistance defines distance between each color axis
   * @param scene defines the hosting scene
   */
  constructor(e, t, r, n) {
    super(e, t, n), this._setRigMode = () => NR(this), this.interaxialDistance = r, this.setCameraRigMode(Tr.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: r });
  }
  /**
   * Gets camera class name
   * @returns AnaglyphFreeCamera
   */
  getClassName() {
    return "AnaglyphFreeCamera";
  }
}
Cs.AddNodeConstructor("AnaglyphGamepadCamera", (A, e, t) => () => new Ree(A, S.Zero(), t.interaxial_distance, e));
class Ree extends yO {
  /**
   * Creates a new AnaglyphGamepadCamera
   * @param name defines camera name
   * @param position defines initial position
   * @param interaxialDistance defines distance between each color axis
   * @param scene defines the hosting scene
   */
  constructor(e, t, r, n) {
    super(e, t, n), this._setRigMode = () => NR(this), this.interaxialDistance = r, this.setCameraRigMode(Tr.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: r });
  }
  /**
   * Gets camera class name
   * @returns AnaglyphGamepadCamera
   */
  getClassName() {
    return "AnaglyphGamepadCamera";
  }
}
Cs.AddNodeConstructor("AnaglyphUniversalCamera", (A, e, t) => () => new Vee(A, S.Zero(), t.interaxial_distance, e));
class Vee extends bD {
  /**
   * Creates a new AnaglyphUniversalCamera
   * @param name defines camera name
   * @param position defines initial position
   * @param interaxialDistance defines distance between each color axis
   * @param scene defines the hosting scene
   */
  constructor(e, t, r, n) {
    super(e, t, n), this._setRigMode = () => NR(this), this.interaxialDistance = r, this.setCameraRigMode(Tr.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: r });
  }
  /**
   * Gets camera class name
   * @returns AnaglyphUniversalCamera
   */
  getClassName() {
    return "AnaglyphUniversalCamera";
  }
}
const K6e = "stereoscopicInterlacePixelShader", J6e = `const vec3 TWO=vec3(2.0,2.0,2.0);varying vec2 vUV;uniform sampler2D camASampler;uniform sampler2D textureSampler;uniform vec2 stepSize;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{bool useCamA;bool useCamB;vec2 texCoord1;vec2 texCoord2;vec3 frag1;vec3 frag2;
#ifdef IS_STEREOSCOPIC_HORIZ
useCamB=vUV.x>0.5;useCamA=!useCamB;texCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);texCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);
#else
#ifdef IS_STEREOSCOPIC_INTERLACED
float rowNum=floor(vUV.y/stepSize.y);useCamA=mod(rowNum,2.0)==1.0;useCamB=mod(rowNum,2.0)==0.0;texCoord1=vec2(vUV.x,vUV.y);texCoord2=vec2(vUV.x,vUV.y);
#else
useCamB=vUV.y>0.5;useCamA=!useCamB;texCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);texCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);
#endif
#endif
if (useCamB){frag1=texture2D(textureSampler,texCoord1).rgb;frag2=texture2D(textureSampler,texCoord2).rgb;}else if (useCamA){frag1=texture2D(camASampler ,texCoord1).rgb;frag2=texture2D(camASampler ,texCoord2).rgb;}else {discard;}
gl_FragColor=vec4((frag1+frag2)/TWO,1.0);}
`;
Le.ShadersStore[K6e] = J6e;
class Cee extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "StereoscopicInterlacePostProcessI" string
   */
  getClassName() {
    return "StereoscopicInterlacePostProcessI";
  }
  /**
   * Initializes a StereoscopicInterlacePostProcessI
   * @param name The name of the effect.
   * @param rigCameras The rig cameras to be applied to the post process
   * @param isStereoscopicHoriz If the rendered results are horizontal or vertical
   * @param isStereoscopicInterlaced If the rendered results are alternate line interlaced
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   */
  constructor(e, t, r, n, i, s, a) {
    super(e, "stereoscopicInterlace", ["stepSize"], ["camASampler"], 1, t[1], i, s, a, n ? "#define IS_STEREOSCOPIC_INTERLACED 1" : r ? "#define IS_STEREOSCOPIC_HORIZ 1" : void 0), this._passedProcess = t[0]._rigPostProcess, this._stepSize = new at(1 / this.width, 1 / this.height), this.onSizeChangedObservable.add(() => {
      this._stepSize = new at(1 / this.width, 1 / this.height);
    }), this.onApplyObservable.add((f) => {
      f.setTextureFromPostProcess("camASampler", this._passedProcess), f.setFloat2("stepSize", this._stepSize.x, this._stepSize.y);
    });
  }
}
class z6e extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "StereoscopicInterlacePostProcess" string
   */
  getClassName() {
    return "StereoscopicInterlacePostProcess";
  }
  /**
   * Initializes a StereoscopicInterlacePostProcess
   * @param name The name of the effect.
   * @param rigCameras The rig cameras to be applied to the post process
   * @param isStereoscopicHoriz If the rendered results are horizontal or vertical
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   */
  constructor(e, t, r, n, i, s) {
    super(e, "stereoscopicInterlace", ["stepSize"], ["camASampler"], 1, t[1], n, i, s, r ? "#define IS_STEREOSCOPIC_HORIZ 1" : void 0), this._passedProcess = t[0]._rigPostProcess, this._stepSize = new at(1 / this.width, 1 / this.height), this.onSizeChangedObservable.add(() => {
      this._stepSize = new at(1 / this.width, 1 / this.height);
    }), this.onApplyObservable.add((a) => {
      a.setTextureFromPostProcess("camASampler", this._passedProcess), a.setFloat2("stepSize", this._stepSize.x, this._stepSize.y);
    });
  }
}
function QR(A) {
  const e = A.cameraRigMode === Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || A.cameraRigMode === Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED, t = A.cameraRigMode === Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;
  A.cameraRigMode === Tr.RIG_MODE_STEREOSCOPIC_INTERLACED ? (A._rigCameras[0]._rigPostProcess = new lg(A.name + "_passthru", 1, A._rigCameras[0]), A._rigCameras[1]._rigPostProcess = new Cee(A.name + "_stereoInterlace", A._rigCameras, !1, !0)) : (A._rigCameras[t ? 1 : 0].viewport = new WA(0, 0, e ? 0.5 : 1, e ? 1 : 0.5), A._rigCameras[t ? 0 : 1].viewport = new WA(e ? 0.5 : 0, e ? 0 : 0.5, e ? 0.5 : 1, e ? 1 : 0.5));
}
Cs.AddNodeConstructor("StereoscopicArcRotateCamera", (A, e, t) => () => new Oee(A, 0, 0, 1, S.Zero(), t.interaxial_distance, t.isStereoscopicSideBySide, e));
class Oee extends ps {
  /**
   * Creates a new StereoscopicArcRotateCamera
   * @param name defines camera name
   * @param alpha defines alpha angle (in radians)
   * @param beta defines beta angle (in radians)
   * @param radius defines radius
   * @param target defines camera target
   * @param interaxialDistance defines distance between each color axis
   * @param isStereoscopicSideBySide defines is stereoscopic is done side by side or over under
   * @param scene defines the hosting scene
   */
  constructor(e, t, r, n, i, s, a, f) {
    super(e, t, r, n, i, f), this._setRigMode = () => QR(this), this.interaxialDistance = s, this.isStereoscopicSideBySide = a, this.setCameraRigMode(a ? Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Tr.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
      interaxialDistance: s
    });
  }
  /**
   * Gets camera class name
   * @returns StereoscopicArcRotateCamera
   */
  getClassName() {
    return "StereoscopicArcRotateCamera";
  }
}
Cs.AddNodeConstructor("StereoscopicFreeCamera", (A, e, t) => () => new yee(A, S.Zero(), t.interaxial_distance, t.isStereoscopicSideBySide, e));
class yee extends SA {
  /**
   * Creates a new StereoscopicFreeCamera
   * @param name defines camera name
   * @param position defines initial position
   * @param interaxialDistance defines distance between each color axis
   * @param isStereoscopicSideBySide defines is stereoscopic is done side by side or over under
   * @param scene defines the hosting scene
   */
  constructor(e, t, r, n, i) {
    super(e, t, i), this._setRigMode = () => QR(this), this.interaxialDistance = r, this.isStereoscopicSideBySide = n, this.setCameraRigMode(n ? Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Tr.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
      interaxialDistance: r
    });
  }
  /**
   * Gets camera class name
   * @returns StereoscopicFreeCamera
   */
  getClassName() {
    return "StereoscopicFreeCamera";
  }
}
Cs.AddNodeConstructor("StereoscopicGamepadCamera", (A, e, t) => () => new kee(A, S.Zero(), t.interaxial_distance, t.isStereoscopicSideBySide, e));
class kee extends yO {
  /**
   * Creates a new StereoscopicGamepadCamera
   * @param name defines camera name
   * @param position defines initial position
   * @param interaxialDistance defines distance between each color axis
   * @param isStereoscopicSideBySide defines is stereoscopic is done side by side or over under
   * @param scene defines the hosting scene
   */
  constructor(e, t, r, n, i) {
    super(e, t, i), this._setRigMode = () => QR(this), this.interaxialDistance = r, this.isStereoscopicSideBySide = n, this.setCameraRigMode(n ? Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Tr.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
      interaxialDistance: r
    });
  }
  /**
   * Gets camera class name
   * @returns StereoscopicGamepadCamera
   */
  getClassName() {
    return "StereoscopicGamepadCamera";
  }
}
Cs.AddNodeConstructor("StereoscopicFreeCamera", (A, e, t) => () => new Eee(A, S.Zero(), t.interaxial_distance, t.isStereoscopicSideBySide, e));
class Eee extends bD {
  /**
   * Creates a new StereoscopicUniversalCamera
   * @param name defines camera name
   * @param position defines initial position
   * @param interaxialDistance defines distance between each color axis
   * @param isStereoscopicSideBySide defines is stereoscopic is done side by side or over under
   * @param scene defines the hosting scene
   */
  constructor(e, t, r, n, i) {
    super(e, t, i), this._setRigMode = () => QR(this), this.interaxialDistance = r, this.isStereoscopicSideBySide = n, this.setCameraRigMode(n ? Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Tr.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
      interaxialDistance: r
    });
  }
  /**
   * Gets camera class name
   * @returns StereoscopicUniversalCamera
   */
  getClassName() {
    return "StereoscopicUniversalCamera";
  }
}
class G6e extends bD {
  set distanceBetweenEyes(e) {
    this._distanceBetweenEyes = e;
  }
  /**
   * distance between the eyes
   */
  get distanceBetweenEyes() {
    return this._distanceBetweenEyes;
  }
  set distanceToProjectionPlane(e) {
    this._distanceToProjectionPlane = e;
  }
  /**
   * Distance to projection plane (should be the same units the like distance between the eyes)
   */
  get distanceToProjectionPlane() {
    return this._distanceToProjectionPlane;
  }
  /**
   * Creates a new StereoscopicScreenUniversalCamera
   * @param name defines camera name
   * @param position defines initial position
   * @param scene defines the hosting scene
   * @param distanceToProjectionPlane defines distance between each color axis. The rig cameras will receive this as their negative z position!
   * @param distanceBetweenEyes defines is stereoscopic is done side by side or over under
   */
  constructor(e, t, r, n = 1, i = 0.065) {
    super(e, t, r), this._distanceBetweenEyes = i, this._distanceToProjectionPlane = n, this.setCameraRigMode(Tr.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL, {
      stereoHalfAngle: 0
    }), this._cameraRigParams.stereoHalfAngle = 0, this._cameraRigParams.interaxialDistance = i;
  }
  /**
   * Gets camera class name
   * @returns StereoscopicScreenUniversalCamera
   */
  getClassName() {
    return "StereoscopicUniversalCamera";
  }
  /**
   * @internal
   */
  createRigCamera(e) {
    const t = new b1(e, S.Zero(), this.getScene()), r = new Hr("tm_" + e, this.getScene());
    return t.parent = r, r.setPivotMatrix(he.Identity(), !1), t.isRigCamera = !0, t.rigParent = this, t;
  }
  /**
   * @internal
   */
  _updateRigCameras() {
    for (let e = 0; e < this._rigCameras.length; e++) {
      const t = this._rigCameras[e];
      t.minZ = this.minZ, t.maxZ = this.maxZ, t.fov = this.fov, t.upVector.copyFrom(this.upVector), t.rotationQuaternion ? t.rotationQuaternion.copyFrom(this.rotationQuaternion) : t.rotation.copyFrom(this.rotation), this._updateCamera(this._rigCameras[e], e);
    }
  }
  _updateCamera(e, t) {
    const r = this.distanceBetweenEyes / 2, n = r / this.distanceToProjectionPlane;
    e.position.copyFrom(this.position), e.position.addInPlaceFromFloats(t === 0 ? -r : r, 0, -this._distanceToProjectionPlane);
    const i = e.parent, s = i.getPivotMatrix();
    s.setTranslationFromFloats(t === 0 ? r : -r, 0, 0), s.setRowFromFloats(2, t === 0 ? n : -n, 0, 1, 0), i.setPivotMatrix(s, !1);
  }
  _setRigMode() {
    this._rigCameras[0].viewport = new WA(0, 0, 0.5, 1), this._rigCameras[1].viewport = new WA(0.5, 0, 0.5, 1);
    for (let e = 0; e < this._rigCameras.length; e++)
      this._updateCamera(this._rigCameras[e], e);
  }
}
Cs.AddNodeConstructor("VirtualJoysticksCamera", (A, e) => () => new Fee(A, S.Zero(), e));
class Fee extends SA {
  /**
   * Instantiates a VirtualJoysticksCamera. It can be useful in First Person Shooter game for instance.
   * It is identical to the Free Camera and simply adds by default a virtual joystick.
   * Virtual Joysticks are on-screen 2D graphics that are used to control the camera or other scene items.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#virtual-joysticks-camera
   * @param name Define the name of the camera in the scene
   * @param position Define the start position of the camera in the scene
   * @param scene Define the scene the camera belongs to
   */
  constructor(e, t, r) {
    super(e, t, r), this.inputs.addVirtualJoystick();
  }
  /**
   * Gets the current object class name.
   * @returns the class name
   */
  getClassName() {
    return "VirtualJoysticksCamera";
  }
}
class Bm {
  constructor() {
    this.compensateDistortion = !0, this.multiviewEnabled = !1;
  }
  /**
   * Gets the rendering aspect ratio based on the provided resolutions.
   */
  get aspectRatio() {
    return this.hResolution / (2 * this.vResolution);
  }
  /**
   * Gets the aspect ratio based on the FOV, scale factors, and real screen sizes.
   */
  get aspectRatioFov() {
    return 2 * Math.atan(this.postProcessScaleFactor * this.vScreenSize / (2 * this.eyeToScreenDistance));
  }
  /**
   * @internal
   */
  get leftHMatrix() {
    const t = 4 * (this.hScreenSize / 4 - this.lensSeparationDistance / 2) / this.hScreenSize;
    return he.Translation(t, 0, 0);
  }
  /**
   * @internal
   */
  get rightHMatrix() {
    const t = 4 * (this.hScreenSize / 4 - this.lensSeparationDistance / 2) / this.hScreenSize;
    return he.Translation(-t, 0, 0);
  }
  /**
   * @internal
   */
  get leftPreViewMatrix() {
    return he.Translation(0.5 * this.interpupillaryDistance, 0, 0);
  }
  /**
   * @internal
   */
  get rightPreViewMatrix() {
    return he.Translation(-0.5 * this.interpupillaryDistance, 0, 0);
  }
  /**
   * Get the default VRMetrics based on the most generic setup.
   * @returns the default vr metrics
   */
  static GetDefault() {
    const e = new Bm();
    return e.hResolution = 1280, e.vResolution = 800, e.hScreenSize = 0.149759993, e.vScreenSize = 0.0935999975, e.vScreenCenter = 0.0467999987, e.eyeToScreenDistance = 0.0410000011, e.lensSeparationDistance = 0.063500002, e.interpupillaryDistance = 0.064000003, e.distortionK = [1, 0.219999999, 0.239999995, 0], e.chromaAbCorrection = [0.995999992, -0.00400000019, 1.01400006, 0], e.postProcessScaleFactor = 1.714605507808412, e.lensCenterOffset = 0.151976421, e;
  }
}
const Z6e = "vrDistortionCorrectionPixelShader", _6e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 LensCenter;uniform vec2 Scale;uniform vec2 ScaleIn;uniform vec4 HmdWarpParam;vec2 HmdWarp(vec2 in01) {vec2 theta=(in01-LensCenter)*ScaleIn; 
float rSq=theta.x*theta.x+theta.y*theta.y;vec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);return LensCenter+Scale*rvector;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec2 tc=HmdWarp(vUV);if (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)
gl_FragColor=vec4(0.0,0.0,0.0,0.0);else{gl_FragColor=texture2D(textureSampler,tc);}}`;
Le.ShadersStore[Z6e] = _6e;
class _5 extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "VRDistortionCorrectionPostProcess" string
   */
  getClassName() {
    return "VRDistortionCorrectionPostProcess";
  }
  /**
   * Initializes the VRDistortionCorrectionPostProcess
   * @param name The name of the effect.
   * @param camera The camera to apply the render pass to.
   * @param isRightEye If this is for the right eye distortion
   * @param vrMetrics All the required metrics for the VR camera
   */
  constructor(e, t, r, n) {
    super(e, "vrDistortionCorrection", ["LensCenter", "Scale", "ScaleIn", "HmdWarpParam"], null, n.postProcessScaleFactor, t, We.BILINEAR_SAMPLINGMODE), this._isRightEye = r, this._distortionFactors = n.distortionK, this._postProcessScaleFactor = n.postProcessScaleFactor, this._lensCenterOffset = n.lensCenterOffset, this.adaptScaleToCurrentViewport = !0, this.onSizeChangedObservable.add(() => {
      this._scaleIn = new at(2, 2 / this.aspectRatio), this._scaleFactor = new at(0.5 * (1 / this._postProcessScaleFactor), 0.5 * (1 / this._postProcessScaleFactor) * this.aspectRatio), this._lensCenter = new at(this._isRightEye ? 0.5 - this._lensCenterOffset * 0.5 : 0.5 + this._lensCenterOffset * 0.5, 0.5);
    }), this.onApplyObservable.add((i) => {
      i.setFloat2("LensCenter", this._lensCenter.x, this._lensCenter.y), i.setFloat2("Scale", this._scaleFactor.x, this._scaleFactor.y), i.setFloat2("ScaleIn", this._scaleIn.x, this._scaleIn.y), i.setFloat4("HmdWarpParam", this._distortionFactors[0], this._distortionFactors[1], this._distortionFactors[2], this._distortionFactors[3]);
    });
  }
}
const $6e = "vrMultiviewToSingleviewPixelShader", eAe = `precision mediump sampler2DArray;varying vec2 vUV;uniform sampler2DArray multiviewSampler;uniform int imageIndex;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{gl_FragColor=texture2D(multiviewSampler,vec3(vUV,imageIndex));}`;
Le.ShadersStore[$6e] = eAe;
class $5 extends Ta {
  set samples(e) {
    this._samples = e;
  }
  get samples() {
    return this._samples;
  }
  /**
   * Creates a multiview render target
   * @param scene scene used with the render target
   * @param size the size of the render target (used for each view)
   */
  constructor(e, t = 512) {
    super("multiview rtt", t, e, !1, !0, 0, !1, void 0, !1, !1, !0, void 0, !0), this._renderTarget = this.getScene().getEngine().createMultiviewRenderTargetTexture(this.getRenderWidth(), this.getRenderHeight()), this._texture = this._renderTarget.texture, this._texture.isMultiview = !0, this._texture.format = 5, this.samples = this._getEngine().getCaps().maxSamples || this.samples, this._texture.samples = this._samples;
  }
  /**
   * @internal
   */
  _bindFrameBuffer() {
    this._renderTarget && this.getScene().getEngine().bindMultiviewFramebuffer(this._renderTarget);
  }
  /**
   * Gets the number of views the corresponding to the texture (eg. a MultiviewRenderTarget will have > 1)
   * @returns the view count
   */
  getViewCount() {
    return 2;
  }
}
Ge.prototype.createMultiviewRenderTargetTexture = function(A, e, t, r) {
  const n = this._gl;
  if (!this.getCaps().multiview)
    throw "Multiview is not supported";
  const i = this._createHardwareRenderTargetWrapper(!1, !1, { width: A, height: e });
  i._framebuffer = n.createFramebuffer();
  const s = new As(this, ri.Unknown, !0);
  return s.width = A, s.height = e, s.isMultiview = !0, t || (t = n.createTexture(), n.bindTexture(n.TEXTURE_2D_ARRAY, t), n.texStorage3D(n.TEXTURE_2D_ARRAY, 1, n.RGBA8, A, e, 2)), i._colorTextureArray = t, r || (r = n.createTexture(), n.bindTexture(n.TEXTURE_2D_ARRAY, r), n.texStorage3D(n.TEXTURE_2D_ARRAY, 1, n.DEPTH24_STENCIL8, A, e, 2)), i._depthStencilTextureArray = r, s.isReady = !0, i.setTextures(s), i._depthStencilTexture = s, i;
};
Ge.prototype.bindMultiviewFramebuffer = function(A) {
  const e = A, t = this._gl, r = this.getCaps().oculusMultiview || this.getCaps().multiview;
  if (this.bindFramebuffer(e, void 0, void 0, void 0, !0), t.bindFramebuffer(t.DRAW_FRAMEBUFFER, e._framebuffer), e._colorTextureArray && e._depthStencilTextureArray)
    this.getCaps().oculusMultiview ? (r.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0, e._colorTextureArray, 0, e.samples, 0, 2), r.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, e._depthStencilTextureArray, 0, e.samples, 0, 2)) : (r.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0, e._colorTextureArray, 0, 0, 2), r.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, e._depthStencilTextureArray, 0, 0, 2));
  else
    throw "Invalid multiview frame buffer";
};
Ge.prototype.bindSpaceWarpFramebuffer = function(A) {
  const e = A, t = this._gl, r = this.getCaps().oculusMultiview || this.getCaps().multiview;
  if (this.bindFramebuffer(e, void 0, void 0, void 0, !0), t.bindFramebuffer(t.DRAW_FRAMEBUFFER, e._framebuffer), e._colorTextureArray && e._depthStencilTextureArray)
    r.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0, e._colorTextureArray, 0, 0, 2), r.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER, t.DEPTH_ATTACHMENT, e._depthStencilTextureArray, 0, 0, 2);
  else
    throw new Error("Invalid Space Warp framebuffer");
};
Tr.prototype._useMultiviewToSingleView = !1;
Tr.prototype._multiviewTexture = null;
Tr.prototype._resizeOrCreateMultiviewTexture = function(A, e) {
  this._multiviewTexture ? (this._multiviewTexture.getRenderWidth() != A || this._multiviewTexture.getRenderHeight() != e) && (this._multiviewTexture.dispose(), this._multiviewTexture = new $5(this.getScene(), { width: A, height: e })) : this._multiviewTexture = new $5(this.getScene(), { width: A, height: e });
};
function Nee(A, e) {
  const t = new yr(A, void 0, !0, e);
  return t.addUniform("viewProjection", 16), t.addUniform("viewProjectionR", 16), t.addUniform("view", 16), t.addUniform("projection", 16), t.addUniform("vEyePosition", 4), t;
}
const tAe = sr.prototype.createSceneUniformBuffer;
sr.prototype._transformMatrixR = he.Zero();
sr.prototype._multiviewSceneUbo = null;
sr.prototype._createMultiviewUbo = function() {
  this._multiviewSceneUbo = Nee(this.getEngine(), "scene_multiview");
};
sr.prototype.createSceneUniformBuffer = function(A) {
  return this._multiviewSceneUbo ? Nee(this.getEngine(), A) : tAe.bind(this)(A);
};
sr.prototype._updateMultiviewUbo = function(A, e) {
  A && e && A.multiplyToRef(e, this._transformMatrixR), A && e && (A.multiplyToRef(e, ue.Matrix[0]), Xc.GetRightPlaneToRef(ue.Matrix[0], this._frustumPlanes[3])), this._multiviewSceneUbo && (this._multiviewSceneUbo.updateMatrix("viewProjection", this.getTransformMatrix()), this._multiviewSceneUbo.updateMatrix("viewProjectionR", this._transformMatrixR), this._multiviewSceneUbo.updateMatrix("view", this._viewMatrix), this._multiviewSceneUbo.updateMatrix("projection", this._projectionMatrix));
};
sr.prototype._renderMultiviewToSingleView = function(A) {
  A._resizeOrCreateMultiviewTexture(A._rigPostProcess && A._rigPostProcess && A._rigPostProcess.width > 0 ? A._rigPostProcess.width : this.getEngine().getRenderWidth(!0), A._rigPostProcess && A._rigPostProcess && A._rigPostProcess.height > 0 ? A._rigPostProcess.height : this.getEngine().getRenderHeight(!0)), this._multiviewSceneUbo || this._createMultiviewUbo(), A.outputRenderTarget = A._multiviewTexture, this._renderForCamera(A), A.outputRenderTarget = null;
  for (let e = 0; e < A._rigCameras.length; e++) {
    const t = this.getEngine();
    this._activeCamera = A._rigCameras[e], t.setViewport(this._activeCamera.viewport), this.postProcessManager && (this.postProcessManager._prepareFrame(), this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate));
  }
};
class Qee extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "VRMultiviewToSingleviewPostProcess" string
   */
  getClassName() {
    return "VRMultiviewToSingleviewPostProcess";
  }
  /**
   * Initializes a VRMultiviewToSingleview
   * @param name name of the post process
   * @param camera camera to be applied to
   * @param scaleFactor scaling factor to the size of the output texture
   */
  constructor(e, t, r) {
    super(e, "vrMultiviewToSingleview", ["imageIndex"], ["multiviewSampler"], r, t, We.BILINEAR_SAMPLINGMODE);
    const n = t ?? this.getCamera();
    this.onSizeChangedObservable.add(() => {
    }), this.onApplyObservable.add((i) => {
      n._scene.activeCamera && n._scene.activeCamera.isLeftCamera ? i.setInt("imageIndex", 0) : i.setInt("imageIndex", 1), i.setTexture("multiviewSampler", n._multiviewTexture);
    });
  }
}
function kO(A, e) {
  const t = e.vrCameraMetrics || Bm.GetDefault();
  A._rigCameras[0]._cameraRigParams.vrMetrics = t, A._rigCameras[0].viewport = new WA(0, 0, 0.5, 1), A._rigCameras[0]._cameraRigParams.vrWorkMatrix = new he(), A._rigCameras[0]._cameraRigParams.vrHMatrix = t.leftHMatrix, A._rigCameras[0]._cameraRigParams.vrPreViewMatrix = t.leftPreViewMatrix, A._rigCameras[0].getProjectionMatrix = A._rigCameras[0]._getVRProjectionMatrix, A._rigCameras[1]._cameraRigParams.vrMetrics = t, A._rigCameras[1].viewport = new WA(0.5, 0, 0.5, 1), A._rigCameras[1]._cameraRigParams.vrWorkMatrix = new he(), A._rigCameras[1]._cameraRigParams.vrHMatrix = t.rightHMatrix, A._rigCameras[1]._cameraRigParams.vrPreViewMatrix = t.rightPreViewMatrix, A._rigCameras[1].getProjectionMatrix = A._rigCameras[1]._getVRProjectionMatrix, t.multiviewEnabled && (A.getScene().getEngine().getCaps().multiview ? (A._useMultiviewToSingleView = !0, A._rigPostProcess = new Qee("VRMultiviewToSingleview", A, t.postProcessScaleFactor)) : (Se.Warn("Multiview is not supported, falling back to standard rendering"), t.multiviewEnabled = !1)), t.compensateDistortion && (A._rigCameras[0]._rigPostProcess = new _5("VR_Distort_Compensation_Left", A._rigCameras[0], !1, t), A._rigCameras[1]._rigPostProcess = new _5("VR_Distort_Compensation_Right", A._rigCameras[1], !0, t));
}
Cs.AddNodeConstructor("VRDeviceOrientationArcRotateCamera", (A, e) => () => new Yee(A, 0, 0, 1, S.Zero(), e));
class Yee extends ps {
  /**
   * Creates a new VRDeviceOrientationArcRotateCamera
   * @param name defines camera name
   * @param alpha defines the camera rotation along the longitudinal axis
   * @param beta defines the camera rotation along the latitudinal axis
   * @param radius defines the camera distance from its target
   * @param target defines the camera target
   * @param scene defines the scene the camera belongs to
   * @param compensateDistortion defines if the camera needs to compensate the lens distortion
   * @param vrCameraMetrics defines the vr metrics associated to the camera
   */
  constructor(e, t, r, n, i, s, a = !0, f = Bm.GetDefault()) {
    super(e, t, r, n, i, s), this._setRigMode = (o) => kO(this, o), f.compensateDistortion = a, this.setCameraRigMode(Tr.RIG_MODE_VR, { vrCameraMetrics: f }), this.inputs.addVRDeviceOrientation();
  }
  /**
   * Gets camera class name
   * @returns VRDeviceOrientationArcRotateCamera
   */
  getClassName() {
    return "VRDeviceOrientationArcRotateCamera";
  }
}
Cs.AddNodeConstructor("VRDeviceOrientationFreeCamera", (A, e) => () => new EO(A, S.Zero(), e));
class EO extends OO {
  /**
   * Creates a new VRDeviceOrientationFreeCamera
   * @param name defines camera name
   * @param position defines the start position of the camera
   * @param scene defines the scene the camera belongs to
   * @param compensateDistortion defines if the camera needs to compensate the lens distortion
   * @param vrCameraMetrics defines the vr metrics associated to the camera
   */
  constructor(e, t, r, n = !0, i = Bm.GetDefault()) {
    super(e, t, r), this._setRigMode = (s) => kO(this, s), i.compensateDistortion = n, this.setCameraRigMode(Tr.RIG_MODE_VR, { vrCameraMetrics: i });
  }
  /**
   * Gets camera class name
   * @returns VRDeviceOrientationFreeCamera
   */
  getClassName() {
    return "VRDeviceOrientationFreeCamera";
  }
}
Cs.AddNodeConstructor("VRDeviceOrientationGamepadCamera", (A, e) => () => new Mee(A, S.Zero(), e));
class Mee extends EO {
  /**
   * Creates a new VRDeviceOrientationGamepadCamera
   * @param name defines camera name
   * @param position defines the start position of the camera
   * @param scene defines the scene the camera belongs to
   * @param compensateDistortion defines if the camera needs to compensate the lens distortion
   * @param vrCameraMetrics defines the vr metrics associated to the camera
   */
  constructor(e, t, r, n = !0, i = Bm.GetDefault()) {
    super(e, t, r, n, i), this._setRigMode = (s) => kO(this, s), this.inputs.addGamepad();
  }
  /**
   * Gets camera class name
   * @returns VRDeviceOrientationGamepadCamera
   */
  getClassName() {
    return "VRDeviceOrientationGamepadCamera";
  }
}
class GC {
  constructor() {
    this.previousWorldMatrices = {}, this.previousBones = {};
  }
  /**
   * Add the required uniforms to the current list.
   * @param uniforms defines the current uniform list.
   */
  static AddUniforms(e) {
    e.push("previousWorld", "previousViewProjection", "mPreviousBones");
  }
  /**
   * Add the required samplers to the current list.
   * @param samplers defines the current sampler list.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static AddSamplers(e) {
  }
  /**
   * Binds the material data.
   * @param effect defines the effect to update
   * @param scene defines the scene the material belongs to.
   * @param mesh The mesh
   * @param world World matrix of this mesh
   * @param isFrozen Is the material frozen
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  bindForSubMesh(e, t, r, n, i) {
    if (t.prePassRenderer && t.prePassRenderer.enabled && t.prePassRenderer.currentRTisSceneRT && t.prePassRenderer.getIndex(2) !== -1) {
      this.previousWorldMatrices[r.uniqueId] || (this.previousWorldMatrices[r.uniqueId] = n.clone()), this.previousViewProjection || (this.previousViewProjection = t.getTransformMatrix().clone(), this.currentViewProjection = t.getTransformMatrix().clone());
      const s = t.getEngine();
      this.currentViewProjection.updateFlag !== t.getTransformMatrix().updateFlag ? (this._lastUpdateFrameId = s.frameId, this.previousViewProjection.copyFrom(this.currentViewProjection), this.currentViewProjection.copyFrom(t.getTransformMatrix())) : this._lastUpdateFrameId !== s.frameId && (this._lastUpdateFrameId = s.frameId, this.previousViewProjection.copyFrom(this.currentViewProjection)), e.setMatrix("previousWorld", this.previousWorldMatrices[r.uniqueId]), e.setMatrix("previousViewProjection", this.previousViewProjection), this.previousWorldMatrices[r.uniqueId] = n.clone();
    }
  }
}
class Dt {
  /**
   * Are diffuse textures enabled in the application.
   */
  static get DiffuseTextureEnabled() {
    return this._DiffuseTextureEnabled;
  }
  static set DiffuseTextureEnabled(e) {
    this._DiffuseTextureEnabled !== e && (this._DiffuseTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are detail textures enabled in the application.
   */
  static get DetailTextureEnabled() {
    return this._DetailTextureEnabled;
  }
  static set DetailTextureEnabled(e) {
    this._DetailTextureEnabled !== e && (this._DetailTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are decal maps enabled in the application.
   */
  static get DecalMapEnabled() {
    return this._DecalMapEnabled;
  }
  static set DecalMapEnabled(e) {
    this._DecalMapEnabled !== e && (this._DecalMapEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are ambient textures enabled in the application.
   */
  static get AmbientTextureEnabled() {
    return this._AmbientTextureEnabled;
  }
  static set AmbientTextureEnabled(e) {
    this._AmbientTextureEnabled !== e && (this._AmbientTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are opacity textures enabled in the application.
   */
  static get OpacityTextureEnabled() {
    return this._OpacityTextureEnabled;
  }
  static set OpacityTextureEnabled(e) {
    this._OpacityTextureEnabled !== e && (this._OpacityTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are reflection textures enabled in the application.
   */
  static get ReflectionTextureEnabled() {
    return this._ReflectionTextureEnabled;
  }
  static set ReflectionTextureEnabled(e) {
    this._ReflectionTextureEnabled !== e && (this._ReflectionTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are emissive textures enabled in the application.
   */
  static get EmissiveTextureEnabled() {
    return this._EmissiveTextureEnabled;
  }
  static set EmissiveTextureEnabled(e) {
    this._EmissiveTextureEnabled !== e && (this._EmissiveTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are specular textures enabled in the application.
   */
  static get SpecularTextureEnabled() {
    return this._SpecularTextureEnabled;
  }
  static set SpecularTextureEnabled(e) {
    this._SpecularTextureEnabled !== e && (this._SpecularTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are bump textures enabled in the application.
   */
  static get BumpTextureEnabled() {
    return this._BumpTextureEnabled;
  }
  static set BumpTextureEnabled(e) {
    this._BumpTextureEnabled !== e && (this._BumpTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are lightmap textures enabled in the application.
   */
  static get LightmapTextureEnabled() {
    return this._LightmapTextureEnabled;
  }
  static set LightmapTextureEnabled(e) {
    this._LightmapTextureEnabled !== e && (this._LightmapTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are refraction textures enabled in the application.
   */
  static get RefractionTextureEnabled() {
    return this._RefractionTextureEnabled;
  }
  static set RefractionTextureEnabled(e) {
    this._RefractionTextureEnabled !== e && (this._RefractionTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are color grading textures enabled in the application.
   */
  static get ColorGradingTextureEnabled() {
    return this._ColorGradingTextureEnabled;
  }
  static set ColorGradingTextureEnabled(e) {
    this._ColorGradingTextureEnabled !== e && (this._ColorGradingTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are fresnels enabled in the application.
   */
  static get FresnelEnabled() {
    return this._FresnelEnabled;
  }
  static set FresnelEnabled(e) {
    this._FresnelEnabled !== e && (this._FresnelEnabled = e, Ge.MarkAllMaterialsAsDirty(4));
  }
  /**
   * Are clear coat textures enabled in the application.
   */
  static get ClearCoatTextureEnabled() {
    return this._ClearCoatTextureEnabled;
  }
  static set ClearCoatTextureEnabled(e) {
    this._ClearCoatTextureEnabled !== e && (this._ClearCoatTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are clear coat bump textures enabled in the application.
   */
  static get ClearCoatBumpTextureEnabled() {
    return this._ClearCoatBumpTextureEnabled;
  }
  static set ClearCoatBumpTextureEnabled(e) {
    this._ClearCoatBumpTextureEnabled !== e && (this._ClearCoatBumpTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are clear coat tint textures enabled in the application.
   */
  static get ClearCoatTintTextureEnabled() {
    return this._ClearCoatTintTextureEnabled;
  }
  static set ClearCoatTintTextureEnabled(e) {
    this._ClearCoatTintTextureEnabled !== e && (this._ClearCoatTintTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are sheen textures enabled in the application.
   */
  static get SheenTextureEnabled() {
    return this._SheenTextureEnabled;
  }
  static set SheenTextureEnabled(e) {
    this._SheenTextureEnabled !== e && (this._SheenTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are anisotropic textures enabled in the application.
   */
  static get AnisotropicTextureEnabled() {
    return this._AnisotropicTextureEnabled;
  }
  static set AnisotropicTextureEnabled(e) {
    this._AnisotropicTextureEnabled !== e && (this._AnisotropicTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are thickness textures enabled in the application.
   */
  static get ThicknessTextureEnabled() {
    return this._ThicknessTextureEnabled;
  }
  static set ThicknessTextureEnabled(e) {
    this._ThicknessTextureEnabled !== e && (this._ThicknessTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are refraction intensity textures enabled in the application.
   */
  static get RefractionIntensityTextureEnabled() {
    return this._ThicknessTextureEnabled;
  }
  static set RefractionIntensityTextureEnabled(e) {
    this._RefractionIntensityTextureEnabled !== e && (this._RefractionIntensityTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are translucency intensity textures enabled in the application.
   */
  static get TranslucencyIntensityTextureEnabled() {
    return this._ThicknessTextureEnabled;
  }
  static set TranslucencyIntensityTextureEnabled(e) {
    this._TranslucencyIntensityTextureEnabled !== e && (this._TranslucencyIntensityTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
  /**
   * Are translucency intensity textures enabled in the application.
   */
  static get IridescenceTextureEnabled() {
    return this._IridescenceTextureEnabled;
  }
  static set IridescenceTextureEnabled(e) {
    this._IridescenceTextureEnabled !== e && (this._IridescenceTextureEnabled = e, Ge.MarkAllMaterialsAsDirty(1));
  }
}
Dt._DiffuseTextureEnabled = !0;
Dt._DetailTextureEnabled = !0;
Dt._DecalMapEnabled = !0;
Dt._AmbientTextureEnabled = !0;
Dt._OpacityTextureEnabled = !0;
Dt._ReflectionTextureEnabled = !0;
Dt._EmissiveTextureEnabled = !0;
Dt._SpecularTextureEnabled = !0;
Dt._BumpTextureEnabled = !0;
Dt._LightmapTextureEnabled = !0;
Dt._RefractionTextureEnabled = !0;
Dt._ColorGradingTextureEnabled = !0;
Dt._FresnelEnabled = !0;
Dt._ClearCoatTextureEnabled = !0;
Dt._ClearCoatBumpTextureEnabled = !0;
Dt._ClearCoatTintTextureEnabled = !0;
Dt._SheenTextureEnabled = !0;
Dt._AnisotropicTextureEnabled = !0;
Dt._ThicknessTextureEnabled = !0;
Dt._RefractionIntensityTextureEnabled = !0;
Dt._TranslucencyIntensityTextureEnabled = !0;
Dt._IridescenceTextureEnabled = !0;
const rAe = "decalFragmentDeclaration", nAe = `#ifdef DECAL
uniform vec4 vDecalInfos;
#endif
`;
Le.IncludesShadersStore[rAe] = nAe;
const iAe = "defaultFragmentDeclaration", sAe = `uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;
#ifdef SPECULARTERM
uniform vec4 vSpecularColor;
#endif
uniform vec3 vEmissiveColor;uniform vec3 vAmbientColor;uniform float visibility;
#ifdef DIFFUSE
uniform vec2 vDiffuseInfos;
#endif
#ifdef AMBIENT
uniform vec2 vAmbientInfos;
#endif
#ifdef OPACITY 
uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;
#endif
#ifdef ALPHATEST
uniform float alphaCutOff;
#endif
#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION) || defined(PREPASS)
uniform mat4 view;
#endif
#ifdef REFRACTION
uniform vec4 vRefractionInfos;
#ifndef REFRACTIONMAP_3D
uniform mat4 refractionMatrix;
#endif
#ifdef REFRACTIONFRESNEL
uniform vec4 refractionLeftColor;uniform vec4 refractionRightColor;
#endif
#if defined(USE_LOCAL_REFRACTIONMAP_CUBIC) && defined(REFRACTIONMAP_3D)
uniform vec3 vRefractionPosition;uniform vec3 vRefractionSize; 
#endif
#endif
#if defined(SPECULAR) && defined(SPECULARTERM)
uniform vec2 vSpecularInfos;
#endif
#ifdef DIFFUSEFRESNEL
uniform vec4 diffuseLeftColor;uniform vec4 diffuseRightColor;
#endif
#ifdef OPACITYFRESNEL
uniform vec4 opacityParts;
#endif
#ifdef EMISSIVEFRESNEL
uniform vec4 emissiveLeftColor;uniform vec4 emissiveRightColor;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;
#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)
uniform mat4 reflectionMatrix;
#endif
#ifndef REFLECTIONMAP_SKYBOX
#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)
uniform vec3 vReflectionPosition;uniform vec3 vReflectionSize; 
#endif
#endif
#ifdef REFLECTIONFRESNEL
uniform vec4 reflectionLeftColor;uniform vec4 reflectionRightColor;
#endif
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;
#endif
#include<decalFragmentDeclaration>
#define ADDITIONAL_FRAGMENT_DECLARATION
`;
Le.IncludesShadersStore[iAe] = sAe;
const aAe = "sceneUboDeclaration", oAe = `layout(std140,column_major) uniform;uniform Scene {mat4 viewProjection;
#ifdef MULTIVIEW
mat4 viewProjectionR;
#endif 
mat4 view;mat4 projection;vec4 vEyePosition;};
`;
Le.IncludesShadersStore[aAe] = oAe;
const fAe = "meshUboDeclaration", AAe = `#ifdef WEBGL2
uniform mat4 world;uniform float visibility;
#else
layout(std140,column_major) uniform;uniform Mesh
{mat4 world;float visibility;};
#endif
#define WORLD_UBO
`;
Le.IncludesShadersStore[fAe] = AAe;
const dAe = "defaultUboDeclaration", vAe = `layout(std140,column_major) uniform;uniform Material
{vec4 diffuseLeftColor;vec4 diffuseRightColor;vec4 opacityParts;vec4 reflectionLeftColor;vec4 reflectionRightColor;vec4 refractionLeftColor;vec4 refractionRightColor;vec4 emissiveLeftColor;vec4 emissiveRightColor;vec2 vDiffuseInfos;vec2 vAmbientInfos;vec2 vOpacityInfos;vec2 vReflectionInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec2 vSpecularInfos;vec3 vBumpInfos;mat4 diffuseMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 reflectionMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 specularMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;float pointSize;float alphaCutOff;mat4 refractionMatrix;vec4 vRefractionInfos;vec3 vRefractionPosition;vec3 vRefractionSize;vec4 vSpecularColor;vec3 vEmissiveColor;vec4 vDiffuseColor;vec3 vAmbientColor;
#define ADDITIONAL_UBO_DECLARATION
};
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;
Le.IncludesShadersStore[dAe] = vAe;
const uAe = "prePassDeclaration", lAe = `#ifdef PREPASS
#extension GL_EXT_draw_buffers : require
layout(location=0) out highp vec4 glFragData[{X}];highp vec4 gl_FragColor;
#ifdef PREPASS_DEPTH
varying highp vec3 vViewPos;
#endif
#ifdef PREPASS_VELOCITY
varying highp vec4 vCurrentPosition;varying highp vec4 vPreviousPosition;
#endif
#endif
`;
Le.IncludesShadersStore[uAe] = lAe;
const PAe = "oitDeclaration", cAe = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY
#extension GL_EXT_draw_buffers : require
layout(location=0) out vec2 depth; 
layout(location=1) out vec4 frontColor;layout(location=2) out vec4 backColor;
#define MAX_DEPTH 99999.0
highp vec4 gl_FragColor;uniform sampler2D oitDepthSampler;uniform sampler2D oitFrontColorSampler;
#endif
`;
Le.IncludesShadersStore[PAe] = cAe;
const pAe = "mainUVVaryingDeclaration", hAe = `#ifdef MAINUV{X}
varying vec2 vMainUV{X};
#endif
`;
Le.IncludesShadersStore[pAe] = hAe;
const HAe = "helperFunctions", gAe = `const float PI=3.1415926535897932384626433832795;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float HALF_MIN=5.96046448e-08; 
const float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001;
#define saturate(x) clamp(x,0.0,1.0)
#define absEps(x) abs(x)+Epsilon
#define maxEps(x) max(x,Epsilon)
#define saturateEps(x) clamp(x,Epsilon,1.0)
mat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3(
vec3(i0.x,i1.x,i2.x),
vec3(i0.y,i1.y,i2.y),
vec3(i0.z,i1.z,i2.z)
);return outMatrix;}
mat3 inverseMat3(mat3 inMatrix) {float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),
b11,(a22*a00-a02*a20),(-a12*a00+a02*a10),
b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}
#if USE_EXACT_SRGB_CONVERSIONS
vec3 toLinearSpaceExact(vec3 color)
{vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));
#else
return
vec3(
color.r<=0.04045 ? nearZeroSection.r : remainingSection.r,
color.g<=0.04045 ? nearZeroSection.g : remainingSection.g,
color.b<=0.04045 ? nearZeroSection.b : remainingSection.b);
#endif
}
vec3 toGammaSpaceExact(vec3 color)
{vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));
#else
return
vec3(
color.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,
color.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,
color.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);
#endif
}
#endif
float toLinearSpace(float color)
{
#if USE_EXACT_SRGB_CONVERSIONS
float nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection;
#else
return pow(color,LinearEncodePowerApprox);
#endif
}
vec3 toLinearSpace(vec3 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return toLinearSpaceExact(color);
#else
return pow(color,vec3(LinearEncodePowerApprox));
#endif
}
vec4 toLinearSpace(vec4 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return vec4(toLinearSpaceExact(color.rgb),color.a);
#else
return vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);
#endif
}
float toGammaSpace(float color)
{
#if USE_EXACT_SRGB_CONVERSIONS
float nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection;
#else
return pow(color,GammaEncodePowerApprox);
#endif
}
vec3 toGammaSpace(vec3 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return toGammaSpaceExact(color);
#else
return pow(color,vec3(GammaEncodePowerApprox));
#endif
}
vec4 toGammaSpace(vec4 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return vec4(toGammaSpaceExact(color.rgb),color.a);
#else
return vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);
#endif
}
float square(float value)
{return value*value;}
vec3 square(vec3 value)
{return value*value;}
float pow5(float value) {float sq=value*value;return sq*sq*value;}
float getLuminance(vec3 color)
{return clamp(dot(color,LuminanceEncodeApprox),0.,1.);}
float getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}
float dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;}
const float rgbdMaxRange=255.0;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max(color.r,max(color.g,color.b)));float D =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);vec3 rgb=color.rgb*D;rgb=toGammaSpace(rgb);return vec4(clamp(rgb,0.,1.),D); }
vec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;}
vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}
`;
Le.IncludesShadersStore[HAe] = gAe;
const XAe = "lightFragmentDeclaration", TAe = `#ifdef LIGHT{X}
uniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};
#ifdef SPECULARTERM
uniform vec4 vLightSpecular{X};
#else
vec4 vLightSpecular{X}=vec4(0.);
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];uniform float cascadeBlendFactor{X};varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DArrayShadow shadowSampler{X};uniform highp sampler2DArray depthSampler{X};uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float penumbraDarkness{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DArrayShadow shadowSampler{X};
#else
uniform highp sampler2DArray shadowSampler{X};
#endif
#ifdef SHADOWCSMDEBUG{X}
const vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]
(
vec3 ( 1.5,0.0,0.0 ),
vec3 ( 0.0,1.5,0.0 ),
vec3 ( 0.0,0.0,5.5 ),
vec3 ( 1.5,0.0,5.5 ),
vec3 ( 1.5,1.5,0.0 ),
vec3 ( 1.0,1.0,1.0 ),
vec3 ( 0.0,1.0,5.5 ),
vec3 ( 0.5,3.5,0.75 )
);vec3 shadowDebug{X};
#endif
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
int index{X}=-1;
#else
int index{X}=SHADOWCSMNUM_CASCADES{X}-1;
#endif
float diff{X}=0.;
#elif defined(SHADOWCUBE{X})
uniform samplerCube shadowSampler{X};
#else
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DShadow shadowSampler{X};uniform highp sampler2D depthSampler{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DShadow shadowSampler{X};
#else
uniform sampler2D shadowSampler{X};
#endif
uniform mat4 lightMatrix{X};
#endif
uniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};
#endif
#ifdef SPOTLIGHT{X}
uniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};
#elif defined(POINTLIGHT{X})
uniform vec4 vLightFalloff{X};
#elif defined(HEMILIGHT{X})
uniform vec3 vLightGround{X};
#endif
#ifdef PROJECTEDLIGHTTEXTURE{X}
uniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightSampler{X};
#endif
#endif
`;
Le.IncludesShadersStore[XAe] = TAe;
const qAe = "lightUboDeclaration", bAe = `#ifdef LIGHT{X}
uniform Light{X}
{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;
#ifdef SPOTLIGHT{X}
vec4 vLightDirection;vec4 vLightFalloff;
#elif defined(POINTLIGHT{X})
vec4 vLightFalloff;
#elif defined(HEMILIGHT{X})
vec3 vLightGround;
#endif
vec4 shadowsInfo;vec2 depthValues;} light{X};
#ifdef PROJECTEDLIGHTTEXTURE{X}
uniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightSampler{X};
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];uniform float cascadeBlendFactor{X};varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DArrayShadow shadowSampler{X};uniform highp sampler2DArray depthSampler{X};uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float penumbraDarkness{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DArrayShadow shadowSampler{X};
#else
uniform highp sampler2DArray shadowSampler{X};
#endif
#ifdef SHADOWCSMDEBUG{X}
const vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]
(
vec3 ( 1.5,0.0,0.0 ),
vec3 ( 0.0,1.5,0.0 ),
vec3 ( 0.0,0.0,5.5 ),
vec3 ( 1.5,0.0,5.5 ),
vec3 ( 1.5,1.5,0.0 ),
vec3 ( 1.0,1.0,1.0 ),
vec3 ( 0.0,1.0,5.5 ),
vec3 ( 0.5,3.5,0.75 )
);vec3 shadowDebug{X};
#endif
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
int index{X}=-1;
#else
int index{X}=SHADOWCSMNUM_CASCADES{X}-1;
#endif
float diff{X}=0.;
#elif defined(SHADOWCUBE{X})
uniform samplerCube shadowSampler{X}; 
#else
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DShadow shadowSampler{X};uniform highp sampler2D depthSampler{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DShadow shadowSampler{X};
#else
uniform sampler2D shadowSampler{X};
#endif
uniform mat4 lightMatrix{X};
#endif
#endif
#endif
`;
Le.IncludesShadersStore[qAe] = bAe;
const xAe = "lightsFragmentFunctions", DAe = `struct lightingInfo
{vec3 diffuse;
#ifdef SPECULARTERM
vec3 specular;
#endif
#ifdef NDOTL
float ndl;
#endif
};lightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 lightVectorW;float attenuation=1.0;if (lightData.w==0.)
{vec3 direction=lightData.xyz-vPositionW;attenuation=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}
else
{lightVectorW=normalize(-lightData.xyz);}
float ndl=max(0.,dot(vNormal,lightVectorW));
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=ndl*diffuseColor*attenuation;
#ifdef SPECULARTERM
vec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;
#endif
return result;}
lightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 direction=lightData.xyz-vPositionW;vec3 lightVectorW=normalize(direction);float attenuation=max(0.,1.0-length(direction)/range);float cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)
{cosAngle=max(0.,pow(cosAngle,lightData.w));attenuation*=cosAngle;float ndl=max(0.,dot(vNormal,lightVectorW));
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=ndl*diffuseColor*attenuation;
#ifdef SPECULARTERM
vec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;
#endif
return result;}
result.diffuse=vec3(0.);
#ifdef SPECULARTERM
result.specular=vec3(0.);
#endif
#ifdef NDOTL
result.ndl=0.;
#endif
return result;}
lightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {lightingInfo result;float ndl=dot(vNormal,lightData.xyz)*0.5+0.5;
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=mix(groundColor,diffuseColor,ndl);
#ifdef SPECULARTERM
vec3 angleW=normalize(viewDirectionW+lightData.xyz);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;
#endif
return result;}
#define inline
vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){vec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return textureColor;}`;
Le.IncludesShadersStore[xAe] = DAe;
const jAe = "shadowsFragmentFunctions", wAe = `#ifdef SHADOWS
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)
#else
#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)
#endif
#ifndef SHADOWFLOAT
float unpack(vec4 color)
{const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}
#endif
float computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)
{float mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));return mix(value,1.0,mask);}
#define inline
float computeShadowCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)
{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
float shadow=unpack(textureCube(shadowSampler,directionToLight));
#else
float shadow=textureCube(shadowSampler,directionToLight).x;
#endif
return depth>shadow ? darkness : 1.0;}
#define inline
float computeShadowWithPoissonSamplingCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)
{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;float visibility=1.;vec3 poissonDisk[4];poissonDisk[0]=vec3(-1.0,1.0,-1.0);poissonDisk[1]=vec3(1.0,-1.0,-1.0);poissonDisk[2]=vec3(-1.0,-1.0,-1.0);poissonDisk[3]=vec3(1.0,-1.0,1.0);
#ifndef SHADOWFLOAT
if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) visibility-=0.25;if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) visibility-=0.25;if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) visibility-=0.25;if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) visibility-=0.25;
#else
if (textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) visibility-=0.25;if (textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) visibility-=0.25;if (textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) visibility-=0.25;if (textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) visibility-=0.25;
#endif
return min(1.0,visibility+darkness);}
#define inline
float computeShadowWithESMCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)
{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);float shadowPixelDepth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));
#else
float shadowMapSample=textureCube(shadowSampler,directionToLight).x;
#endif
float esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return esm;}
#define inline
float computeShadowWithCloseESMCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)
{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);float shadowPixelDepth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));
#else
float shadowMapSample=textureCube(shadowSampler,directionToLight).x;
#endif
float esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return esm;}
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define inline
float computeShadowCSM(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray shadowSampler,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);vec3 uvLayer=vec3(uv.x,uv.y,layer);float shadowPixelDepth=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
float shadow=unpack(texture2D(shadowSampler,uvLayer));
#else
float shadow=texture2D(shadowSampler,uvLayer).x;
#endif
return shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;}
#endif
#define inline
float computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{float shadowPixelDepth=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
float shadow=unpack(TEXTUREFUNC(shadowSampler,uv,0.));
#else
float shadow=TEXTUREFUNC(shadowSampler,uv,0.).x;
#endif
return shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;}}
#define inline
float computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{float shadowPixelDepth=clamp(depthMetric,0.,1.0);float visibility=1.;vec2 poissonDisk[4];poissonDisk[0]=vec2(-0.94201624,-0.39906216);poissonDisk[1]=vec2(0.94558609,-0.76890725);poissonDisk[2]=vec2(-0.094184101,-0.92938870);poissonDisk[3]=vec2(0.34495938,0.29387760);
#ifndef SHADOWFLOAT
if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[1]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[2]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[3]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;
#else
if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[1]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[2]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[3]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;
#endif
return computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);}}
#define inline
float computeShadowWithESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{float shadowPixelDepth=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));
#else
float shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;
#endif
float esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}
#define inline
float computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{float shadowPixelDepth=clamp(depthMetric,0.,1.0); 
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));
#else
float shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;
#endif
float esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}
#ifdef IS_NDC_HALF_ZRANGE
#define ZINCLIP clipSpace.z
#else
#define ZINCLIP uvDepth.z
#endif
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define GREATEST_LESS_THAN_ONE 0.99999994
/* disable_uniformity_analysis */
#define inline
float computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);float shadow=texture2D(shadowSampler,uvDepthLayer);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
#define inline
float computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=3.-2.*st;vec2 uvw1=1.+2.*st;vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
#define inline
float computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=4.-3.*st;vec2 uvw1=vec2(7.);vec2 uvw2=1.+3.*st;vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));shadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));shadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));shadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));shadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));shadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
#define inline
float computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;float shadow=TEXTUREFUNC(shadowSampler,uvDepth,0.);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
#define inline
float computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=3.-2.*st;vec2 uvw1=1.+2.*st;vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
#define inline
float computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=4.-3.*st;vec2 uvw1=vec2(7.);vec2 uvw2=1.+3.*st;vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);shadow+=uvw2.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z),0.);shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);shadow+=uvw2.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z),0.);shadow+=uvw0.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z),0.);shadow+=uvw1.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z),0.);shadow+=uvw2.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z),0.);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
const vec3 PoissonSamplers32[64]=vec3[64](
vec3(0.06407013,0.05409927,0.),
vec3(0.7366577,0.5789394,0.),
vec3(-0.6270542,-0.5320278,0.),
vec3(-0.4096107,0.8411095,0.),
vec3(0.6849564,-0.4990818,0.),
vec3(-0.874181,-0.04579735,0.),
vec3(0.9989998,0.0009880066,0.),
vec3(-0.004920578,-0.9151649,0.),
vec3(0.1805763,0.9747483,0.),
vec3(-0.2138451,0.2635818,0.),
vec3(0.109845,0.3884785,0.),
vec3(0.06876755,-0.3581074,0.),
vec3(0.374073,-0.7661266,0.),
vec3(0.3079132,-0.1216763,0.),
vec3(-0.3794335,-0.8271583,0.),
vec3(-0.203878,-0.07715034,0.),
vec3(0.5912697,0.1469799,0.),
vec3(-0.88069,0.3031784,0.),
vec3(0.5040108,0.8283722,0.),
vec3(-0.5844124,0.5494877,0.),
vec3(0.6017799,-0.1726654,0.),
vec3(-0.5554981,0.1559997,0.),
vec3(-0.3016369,-0.3900928,0.),
vec3(-0.5550632,-0.1723762,0.),
vec3(0.925029,0.2995041,0.),
vec3(-0.2473137,0.5538505,0.),
vec3(0.9183037,-0.2862392,0.),
vec3(0.2469421,0.6718712,0.),
vec3(0.3916397,-0.4328209,0.),
vec3(-0.03576927,-0.6220032,0.),
vec3(-0.04661255,0.7995201,0.),
vec3(0.4402924,0.3640312,0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.)
);const vec3 PoissonSamplers64[64]=vec3[64](
vec3(-0.613392,0.617481,0.),
vec3(0.170019,-0.040254,0.),
vec3(-0.299417,0.791925,0.),
vec3(0.645680,0.493210,0.),
vec3(-0.651784,0.717887,0.),
vec3(0.421003,0.027070,0.),
vec3(-0.817194,-0.271096,0.),
vec3(-0.705374,-0.668203,0.),
vec3(0.977050,-0.108615,0.),
vec3(0.063326,0.142369,0.),
vec3(0.203528,0.214331,0.),
vec3(-0.667531,0.326090,0.),
vec3(-0.098422,-0.295755,0.),
vec3(-0.885922,0.215369,0.),
vec3(0.566637,0.605213,0.),
vec3(0.039766,-0.396100,0.),
vec3(0.751946,0.453352,0.),
vec3(0.078707,-0.715323,0.),
vec3(-0.075838,-0.529344,0.),
vec3(0.724479,-0.580798,0.),
vec3(0.222999,-0.215125,0.),
vec3(-0.467574,-0.405438,0.),
vec3(-0.248268,-0.814753,0.),
vec3(0.354411,-0.887570,0.),
vec3(0.175817,0.382366,0.),
vec3(0.487472,-0.063082,0.),
vec3(-0.084078,0.898312,0.),
vec3(0.488876,-0.783441,0.),
vec3(0.470016,0.217933,0.),
vec3(-0.696890,-0.549791,0.),
vec3(-0.149693,0.605762,0.),
vec3(0.034211,0.979980,0.),
vec3(0.503098,-0.308878,0.),
vec3(-0.016205,-0.872921,0.),
vec3(0.385784,-0.393902,0.),
vec3(-0.146886,-0.859249,0.),
vec3(0.643361,0.164098,0.),
vec3(0.634388,-0.049471,0.),
vec3(-0.688894,0.007843,0.),
vec3(0.464034,-0.188818,0.),
vec3(-0.440840,0.137486,0.),
vec3(0.364483,0.511704,0.),
vec3(0.034028,0.325968,0.),
vec3(0.099094,-0.308023,0.),
vec3(0.693960,-0.366253,0.),
vec3(0.678884,-0.204688,0.),
vec3(0.001801,0.780328,0.),
vec3(0.145177,-0.898984,0.),
vec3(0.062655,-0.611866,0.),
vec3(0.315226,-0.604297,0.),
vec3(-0.780145,0.486251,0.),
vec3(-0.371868,0.882138,0.),
vec3(0.200476,0.494430,0.),
vec3(-0.494552,-0.711051,0.),
vec3(0.612476,0.705252,0.),
vec3(-0.578845,-0.768792,0.),
vec3(-0.772454,-0.090976,0.),
vec3(0.504440,0.372295,0.),
vec3(0.155736,0.065157,0.),
vec3(0.391522,0.849605,0.),
vec3(-0.620106,-0.328104,0.),
vec3(0.789239,-0.419965,0.),
vec3(-0.545396,0.538133,0.),
vec3(-0.178564,-0.596057,0.)
);
#define inline
float computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);float blockerDepth=0.0;float sumBlockerDepth=0.0;float numBlocker=0.0;for (int i=0; i<searchTapCount; i ++) {blockerDepth=texture2D(depthSampler,vec3(uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer)).r;if (blockerDepth<depthMetric) {sumBlockerDepth+=blockerDepth;numBlocker++;}}
float avgBlockerDepth=sumBlockerDepth/numBlocker;float AAOffset=shadowMapSizeInverse*10.;float penumbraRatio=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);vec4 filterRadius=vec4(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);float random=getRand(vPositionFromLight.xy);float rotationAngle=random*3.1415926;vec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));float shadow=0.;for (int i=0; i<pcfTapCount; i++) {vec4 offset=vec4(poissonSamplers[i],0.);offset=vec4(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);shadow+=texture2D(shadowSampler,uvDepthLayer+offset*filterRadius);}
shadow/=float(pcfTapCount);shadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));shadow=mix(darkness,1.,shadow);if (numBlocker<1.0) {return 1.0;}
else
{return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
#define inline
float computeShadowWithPCSS(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers)
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;float blockerDepth=0.0;float sumBlockerDepth=0.0;float numBlocker=0.0;for (int i=0; i<searchTapCount; i ++) {blockerDepth=TEXTUREFUNC(depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy),0.).r;if (blockerDepth<depthMetric) {sumBlockerDepth+=blockerDepth;numBlocker++;}}
if (numBlocker<1.0) {return 1.0;}
else
{float avgBlockerDepth=sumBlockerDepth/numBlocker;float AAOffset=shadowMapSizeInverse*10.;float penumbraRatio=((depthMetric-avgBlockerDepth)+AAOffset);float filterRadius=penumbraRatio*lightSizeUV*shadowMapSizeInverse;float random=getRand(vPositionFromLight.xy);float rotationAngle=random*3.1415926;vec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));float shadow=0.;for (int i=0; i<pcfTapCount; i++) {vec3 offset=poissonSamplers[i];offset=vec3(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);shadow+=TEXTUREFUNC(shadowSampler,uvDepth+offset*filterRadius,0.);}
shadow/=float(pcfTapCount);shadow=mix(shadow,1.,depthMetric-avgBlockerDepth);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}}
#define inline
float computeShadowWithPCSS16(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)
{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);}
#define inline
float computeShadowWithPCSS32(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)
{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);}
#define inline
float computeShadowWithPCSS64(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)
{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);}
#define inline
float computeShadowWithCSMPCSS16(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
#define inline
float computeShadowWithCSMPCSS32(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
#define inline
float computeShadowWithCSMPCSS64(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
#endif
#endif
`;
Le.IncludesShadersStore[jAe] = wAe;
const mAe = "samplerFragmentDeclaration", BAe = `#ifdef _DEFINENAME_
#if _DEFINENAME_DIRECTUV==1
#define v_VARYINGNAME_UV vMainUV1
#elif _DEFINENAME_DIRECTUV==2
#define v_VARYINGNAME_UV vMainUV2
#elif _DEFINENAME_DIRECTUV==3
#define v_VARYINGNAME_UV vMainUV3
#elif _DEFINENAME_DIRECTUV==4
#define v_VARYINGNAME_UV vMainUV4
#elif _DEFINENAME_DIRECTUV==5
#define v_VARYINGNAME_UV vMainUV5
#elif _DEFINENAME_DIRECTUV==6
#define v_VARYINGNAME_UV vMainUV6
#else
varying vec2 v_VARYINGNAME_UV;
#endif
uniform sampler2D _SAMPLERNAME_Sampler;
#endif
`;
Le.IncludesShadersStore[mAe] = BAe;
const WAe = "fresnelFunction", SAe = `#ifdef FRESNEL
float computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)
{float fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);}
#endif
`;
Le.IncludesShadersStore[WAe] = SAe;
const UAe = "reflectionFunction", IAe = `vec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)
{float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0); }
vec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)
{float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(1.0-s,t,0); }
vec3 computeEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
{vec3 cameraToVertex=normalize(worldPos.xyz-eyePosition);vec3 r=normalize(reflect(cameraToVertex,worldNormal));r=vec3(reflectionMatrix*vec4(r,0));float lon=atan(r.z,r.x);float lat=acos(r.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0);}
vec3 computeSphericalCoords(vec4 worldPos,vec3 worldNormal,mat4 view,mat4 reflectionMatrix)
{vec3 viewDir=normalize(vec3(view*worldPos));vec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));vec3 r=reflect(viewDir,viewNormal);r=vec3(reflectionMatrix*vec4(r,0));r.z=r.z-1.0;float m=2.0*length(r);return vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);}
vec3 computePlanarCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
{vec3 viewDir=worldPos.xyz-eyePosition;vec3 coords=normalize(reflect(viewDir,worldNormal));return vec3(reflectionMatrix*vec4(coords,1));}
vec3 computeCubicCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
{vec3 viewDir=normalize(worldPos.xyz-eyePosition);vec3 coords=reflect(viewDir,worldNormal);coords=vec3(reflectionMatrix*vec4(coords,0));
#ifdef INVERTCUBICMAP
coords.y*=-1.0;
#endif
return coords;}
vec3 computeCubicLocalCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix,vec3 reflectionSize,vec3 reflectionPosition)
{vec3 viewDir=normalize(worldPos.xyz-eyePosition);vec3 coords=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=vec3(reflectionMatrix*vec4(coords,0));
#ifdef INVERTCUBICMAP
coords.y*=-1.0;
#endif
return coords;}
vec3 computeProjectionCoords(vec4 worldPos,mat4 view,mat4 reflectionMatrix)
{return vec3(reflectionMatrix*(view*worldPos));}
vec3 computeSkyBoxCoords(vec3 positionW,mat4 reflectionMatrix)
{return vec3(reflectionMatrix*vec4(positionW,1.));}
#ifdef REFLECTION
vec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)
{
#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED
vec3 direction=normalize(vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);
#endif
#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED
vec3 direction=normalize(vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);
#endif
#ifdef REFLECTIONMAP_EQUIRECTANGULAR
return computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_SPHERICAL
return computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_PLANAR
return computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_CUBIC
#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC
return computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition);
#else
return computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
#endif
#endif
#ifdef REFLECTIONMAP_PROJECTION
return computeProjectionCoords(worldPos,view,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_SKYBOX
return computeSkyBoxCoords(vPositionUVW,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_EXPLICIT
return vec3(0,0,0);
#endif
}
#endif
`;
Le.IncludesShadersStore[UAe] = IAe;
const RAe = "imageProcessingDeclaration", VAe = `#ifdef EXPOSURE
uniform float exposureLinear;
#endif
#ifdef CONTRAST
uniform float contrast;
#endif
#if defined(VIGNETTE) || defined(DITHER)
uniform vec2 vInverseScreenSize;
#endif
#ifdef VIGNETTE
uniform vec4 vignetteSettings1;uniform vec4 vignetteSettings2;
#endif
#ifdef COLORCURVES
uniform vec4 vCameraColorCurveNegative;uniform vec4 vCameraColorCurveNeutral;uniform vec4 vCameraColorCurvePositive;
#endif
#ifdef COLORGRADING
#ifdef COLORGRADING3D
uniform highp sampler3D txColorTransform;
#else
uniform sampler2D txColorTransform;
#endif
uniform vec4 colorTransformSettings;
#endif
#ifdef DITHER
uniform float ditherIntensity;
#endif
`;
Le.IncludesShadersStore[RAe] = VAe;
const CAe = "imageProcessingFunctions", OAe = `#if defined(COLORGRADING) && !defined(COLORGRADING3D)
/** 
* Polyfill for SAMPLE_TEXTURE_3D,which is unsupported in WebGL.
* sampler3dSetting.x=textureOffset (0.5/textureSize).
* sampler3dSetting.y=textureSize.
*/
#define inline
vec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)
{float sliceSize=2.0*sampler3dSetting.x; 
#ifdef SAMPLER3DGREENDEPTH
float sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;
#else
float sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;
#endif
float sliceInteger=floor(sliceContinuous);float sliceFraction=sliceContinuous-sliceInteger;
#ifdef SAMPLER3DGREENDEPTH
vec2 sliceUV=color.rb;
#else
vec2 sliceUV=color.rg;
#endif
sliceUV.x*=sliceSize;sliceUV.x+=sliceInteger*sliceSize;sliceUV=saturate(sliceUV);vec4 slice0Color=texture2D(colorTransform,sliceUV);sliceUV.x+=sliceSize;sliceUV=saturate(sliceUV);vec4 slice1Color=texture2D(colorTransform,sliceUV);vec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);
#ifdef SAMPLER3DBGRMAP
color.rgb=result.rgb;
#else
color.rgb=result.bgr;
#endif
return color;}
#endif
#ifdef TONEMAPPING_ACES
const mat3 ACESInputMat=mat3(
vec3(0.59719,0.07600,0.02840),
vec3(0.35458,0.90834,0.13383),
vec3(0.04823,0.01566,0.83777)
);const mat3 ACESOutputMat=mat3(
vec3( 1.60475,-0.10208,-0.00327),
vec3(-0.53108, 1.10813,-0.07276),
vec3(-0.07367,-0.00605, 1.07602)
);vec3 RRTAndODTFit(vec3 v)
{vec3 a=v*(v+0.0245786)-0.000090537;vec3 b=v*(0.983729*v+0.4329510)+0.238081;return a/b;}
vec3 ACESFitted(vec3 color)
{color=ACESInputMat*color;color=RRTAndODTFit(color);color=ACESOutputMat*color;color=saturate(color);return color;}
#endif
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS
vec4 applyImageProcessing(vec4 result) {
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART
#ifdef EXPOSURE
result.rgb*=exposureLinear;
#endif
#ifdef VIGNETTE
vec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;viewportXY=viewportXY*2.0-1.0;vec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);float vignetteTerm=dot(vignetteXY1,vignetteXY1);float vignette=pow(vignetteTerm,vignetteSettings2.w);vec3 vignetteColor=vignetteSettings2.rgb;
#ifdef VIGNETTEBLENDMODEMULTIPLY
vec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);result.rgb*=vignetteColorMultiplier;
#endif
#ifdef VIGNETTEBLENDMODEOPAQUE
result.rgb=mix(vignetteColor,result.rgb,vignette);
#endif
#endif
#ifdef TONEMAPPING
#ifdef TONEMAPPING_ACES
result.rgb=ACESFitted(result.rgb);
#else
const float tonemappingCalibration=1.590579;result.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);
#endif
#endif
result.rgb=toGammaSpace(result.rgb);result.rgb=saturate(result.rgb);
#ifdef CONTRAST
vec3 resultHighContrast=result.rgb*result.rgb*(3.0-2.0*result.rgb);if (contrast<1.0) {result.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);} else {result.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);}
#endif
#ifdef COLORGRADING
vec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;
#ifdef COLORGRADING3D
vec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;
#else
vec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;
#endif
result.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);
#endif
#ifdef COLORCURVES
float luma=getLuminance(result.rgb);vec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));vec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;result.rgb*=colorCurve.rgb;result.rgb=mix(vec3(luma),result.rgb,colorCurve.a);
#endif
#ifdef DITHER
float rand=getRand(gl_FragCoord.xy*vInverseScreenSize);float dither=mix(-ditherIntensity,ditherIntensity,rand);result.rgb=saturate(result.rgb+vec3(dither));
#endif
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND
return result;}`;
Le.IncludesShadersStore[CAe] = OAe;
const yAe = "bumpFragmentMainFunctions", kAe = `#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)
#if defined(TANGENT) && defined(NORMAL) 
varying mat3 vTBN;
#endif
#ifdef OBJECTSPACE_NORMALMAP
uniform mat4 normalMatrix;
#if defined(WEBGL2) || defined(WEBGPU)
mat4 toNormalMatrix(mat4 wMatrix)
{mat4 ret=inverse(wMatrix);ret=transpose(ret);ret[0][3]=0.;ret[1][3]=0.;ret[2][3]=0.;ret[3]=vec4(0.,0.,0.,1.);return ret;}
#else
mat4 toNormalMatrix(mat4 m)
{float
a00=m[0][0],a01=m[0][1],a02=m[0][2],a03=m[0][3],
a10=m[1][0],a11=m[1][1],a12=m[1][2],a13=m[1][3],
a20=m[2][0],a21=m[2][1],a22=m[2][2],a23=m[2][3],
a30=m[3][0],a31=m[3][1],a32=m[3][2],a33=m[3][3],
b00=a00*a11-a01*a10,
b01=a00*a12-a02*a10,
b02=a00*a13-a03*a10,
b03=a01*a12-a02*a11,
b04=a01*a13-a03*a11,
b05=a02*a13-a03*a12,
b06=a20*a31-a21*a30,
b07=a20*a32-a22*a30,
b08=a20*a33-a23*a30,
b09=a21*a32-a22*a31,
b10=a21*a33-a23*a31,
b11=a22*a33-a23*a32,
det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;mat4 mi=mat4(
a11*b11-a12*b10+a13*b09,
a02*b10-a01*b11-a03*b09,
a31*b05-a32*b04+a33*b03,
a22*b04-a21*b05-a23*b03,
a12*b08-a10*b11-a13*b07,
a00*b11-a02*b08+a03*b07,
a32*b02-a30*b05-a33*b01,
a20*b05-a22*b02+a23*b01,
a10*b10-a11*b08+a13*b06,
a01*b08-a00*b10-a03*b06,
a30*b04-a31*b02+a33*b00,
a21*b02-a20*b04-a23*b00,
a11*b07-a10*b09-a12*b06,
a00*b09-a01*b07+a02*b06,
a31*b01-a30*b03-a32*b00,
a20*b03-a21*b01+a22*b00)/det;return mat4(mi[0][0],mi[1][0],mi[2][0],mi[3][0],
mi[0][1],mi[1][1],mi[2][1],mi[3][1],
mi[0][2],mi[1][2],mi[2][2],mi[3][2],
mi[0][3],mi[1][3],mi[2][3],mi[3][3]);}
#endif
#endif
vec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale)
{
#ifdef NORMALXYSCALE
normal=normalize(normal*vec3(scale,scale,1.0));
#endif
return normalize(cotangentFrame*normal);}
vec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale)
{return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);}
mat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams)
{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;float det=max(dot(tangent,tangent),dot(bitangent,bitangent));float invmax=det==0.0 ? 0.0 : inversesqrt(det);return mat3(tangent*invmax,bitangent*invmax,normal);}
#endif
`;
Le.IncludesShadersStore[yAe] = kAe;
const EAe = "bumpFragmentFunctions", FAe = `#if defined(BUMP)
#include<samplerFragmentDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump)
#endif
#if defined(DETAIL)
#include<samplerFragmentDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail)
#endif
#if defined(BUMP) && defined(PARALLAX)
const float minSamples=4.;const float maxSamples=15.;const int iMaxSamples=15;vec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {float parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;vec2 vOffsetDir=normalize(vViewDirCoT.xy);vec2 vMaxOffset=vOffsetDir*parallaxLimit;float numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));float stepSize=1.0/numSamples;float currRayHeight=1.0;vec2 vCurrOffset=vec2(0,0);vec2 vLastOffset=vec2(0,0);float lastSampledHeight=1.0;float currSampledHeight=1.0;bool keepWorking=true;for (int i=0; i<iMaxSamples; i++)
{currSampledHeight=texture2D(bumpSampler,texCoord+vCurrOffset).w;if (!keepWorking)
{}
else if (currSampledHeight>currRayHeight)
{float delta1=currSampledHeight-currRayHeight;float delta2=(currRayHeight+stepSize)-lastSampledHeight;float ratio=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;}
else
{currRayHeight-=stepSize;vLastOffset=vCurrOffset;
#ifdef PARALLAX_RHS
vCurrOffset-=stepSize*vMaxOffset;
#else
vCurrOffset+=stepSize*vMaxOffset;
#endif
lastSampledHeight=currSampledHeight;}}
return vCurrOffset;}
vec2 parallaxOffset(vec3 viewDir,float heightScale)
{float height=texture2D(bumpSampler,vBumpUV).w;vec2 texCoordOffset=heightScale*viewDir.xy*height;
#ifdef PARALLAX_RHS
return texCoordOffset;
#else
return -texCoordOffset;
#endif
}
#endif
`;
Le.IncludesShadersStore[EAe] = FAe;
const NAe = "clipPlaneFragmentDeclaration", QAe = `#ifdef CLIPPLANE
varying float fClipDistance;
#endif
#ifdef CLIPPLANE2
varying float fClipDistance2;
#endif
#ifdef CLIPPLANE3
varying float fClipDistance3;
#endif
#ifdef CLIPPLANE4
varying float fClipDistance4;
#endif
#ifdef CLIPPLANE5
varying float fClipDistance5;
#endif
#ifdef CLIPPLANE6
varying float fClipDistance6;
#endif
`;
Le.IncludesShadersStore[NAe] = QAe;
const YAe = "logDepthDeclaration", MAe = `#ifdef LOGARITHMICDEPTH
uniform float logarithmicDepthConstant;varying float vFragmentDepth;
#endif
`;
Le.IncludesShadersStore[YAe] = MAe;
const LAe = "fogFragmentDeclaration", KAe = `#ifdef FOG
#define FOGMODE_NONE 0.
#define FOGMODE_EXP 1.
#define FOGMODE_EXP2 2.
#define FOGMODE_LINEAR 3.
#define E 2.71828
uniform vec4 vFogInfos;uniform vec3 vFogColor;varying vec3 vFogDistance;float CalcFogFactor()
{float fogCoeff=1.0;float fogStart=vFogInfos.y;float fogEnd=vFogInfos.z;float fogDensity=vFogInfos.w;float fogDistance=length(vFogDistance);if (FOGMODE_LINEAR==vFogInfos.x)
{fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);}
else if (FOGMODE_EXP==vFogInfos.x)
{fogCoeff=1.0/pow(E,fogDistance*fogDensity);}
else if (FOGMODE_EXP2==vFogInfos.x)
{fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);}
return clamp(fogCoeff,0.0,1.0);}
#endif
`;
Le.IncludesShadersStore[LAe] = KAe;
const JAe = "clipPlaneFragment", zAe = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
if (false) {}
#endif
#ifdef CLIPPLANE
else if (fClipDistance>0.0)
{discard;}
#endif
#ifdef CLIPPLANE2
else if (fClipDistance2>0.0)
{discard;}
#endif
#ifdef CLIPPLANE3
else if (fClipDistance3>0.0)
{discard;}
#endif
#ifdef CLIPPLANE4
else if (fClipDistance4>0.0)
{discard;}
#endif
#ifdef CLIPPLANE5
else if (fClipDistance5>0.0)
{discard;}
#endif
#ifdef CLIPPLANE6
else if (fClipDistance6>0.0)
{discard;}
#endif
`;
Le.IncludesShadersStore[JAe] = zAe;
const GAe = "bumpFragment", ZAe = `vec2 uvOffset=vec2(0.0,0.0);
#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)
#ifdef NORMALXYSCALE
float normalScale=1.0;
#elif defined(BUMP)
float normalScale=vBumpInfos.y;
#else
float normalScale=1.0;
#endif
#if defined(TANGENT) && defined(NORMAL)
mat3 TBN=vTBN;
#elif defined(BUMP)
vec2 TBNUV=gl_FrontFacing ? vBumpUV : -vBumpUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vTangentSpaceParams);
#else
vec2 TBNUV=gl_FrontFacing ? vDetailUV : -vDetailUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vec2(1.,1.));
#endif
#elif defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL)
mat3 TBN=vTBN;
#else
vec2 TBNUV=gl_FrontFacing ? vMainUV1 : -vMainUV1;mat3 TBN=cotangent_frame(normalW,vPositionW,TBNUV,vec2(1.,1.));
#endif
#endif
#ifdef PARALLAX
mat3 invTBN=transposeMat3(TBN);
#ifdef PARALLAXOCCLUSION
uvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);
#else
uvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);
#endif
#endif
#ifdef DETAIL
vec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);vec2 detailNormalRG=detailColor.wy*2.0-1.0;float detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));vec3 detailNormal=vec3(detailNormalRG,detailNormalB);
#endif
#ifdef BUMP
#ifdef OBJECTSPACE_NORMALMAP
#define CUSTOM_FRAGMENT_BUMP_FRAGMENT
normalW=normalize(texture2D(bumpSampler,vBumpUV).xyz *2.0-1.0);normalW=normalize(mat3(normalMatrix)*normalW);
#elif !defined(DETAIL)
normalW=perturbNormal(TBN,texture2D(bumpSampler,vBumpUV+uvOffset).xyz,vBumpInfos.y);
#else
vec3 bumpNormal=texture2D(bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;
#if DETAIL_NORMALBLENDMETHOD==0 
detailNormal.xy*=vDetailInfos.z;vec3 blendedNormal=normalize(vec3(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));
#elif DETAIL_NORMALBLENDMETHOD==1 
detailNormal.xy*=vDetailInfos.z;bumpNormal+=vec3(0.0,0.0,1.0);detailNormal*=vec3(-1.0,-1.0,1.0);vec3 blendedNormal=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;
#endif
normalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);
#endif
#elif defined(DETAIL)
detailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);
#endif
`;
Le.IncludesShadersStore[GAe] = ZAe;
const _Ae = "decalFragment", $Ae = `#ifdef DECAL
#ifdef GAMMADECAL
decalColor.rgb=toLinearSpace(decalColor.rgb);
#endif
#ifdef DECAL_SMOOTHALPHA
decalColor.a*=decalColor.a;
#endif
surfaceAlbedo.rgb=mix(surfaceAlbedo.rgb,decalColor.rgb,decalColor.a);
#endif
`;
Le.IncludesShadersStore[_Ae] = $Ae;
const ede = "depthPrePass", tde = `#ifdef DEPTHPREPASS
gl_FragColor=vec4(0.,0.,0.,1.0);return;
#endif
`;
Le.IncludesShadersStore[ede] = tde;
const rde = "lightFragment", nde = `#ifdef LIGHT{X}
#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})
#else
#ifdef PBR
#ifdef SPOTLIGHT{X}
preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#elif defined(POINTLIGHT{X})
preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#elif defined(HEMILIGHT{X})
preInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#elif defined(DIRLIGHT{X})
preInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#endif
preInfo.NdotV=NdotV;
#ifdef SPOTLIGHT{X}
#ifdef LIGHT_FALLOFF_GLTF{X}
preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);preInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
#elif defined(LIGHT_FALLOFF_PHYSICAL{X})
preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);preInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);
#elif defined(LIGHT_FALLOFF_STANDARD{X})
preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);preInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);
#else
preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);preInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
#endif
#elif defined(POINTLIGHT{X})
#ifdef LIGHT_FALLOFF_GLTF{X}
preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);
#elif defined(LIGHT_FALLOFF_PHYSICAL{X})
preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);
#elif defined(LIGHT_FALLOFF_STANDARD{X})
preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);
#else
preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);
#endif
#else
preInfo.attenuation=1.0;
#endif
#ifdef HEMILIGHT{X}
preInfo.roughness=roughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
#ifdef IRIDESCENCE
preInfo.iridescenceIntensity=iridescenceIntensity;
#endif
#ifdef HEMILIGHT{X}
info.diffuse=computeHemisphericDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb,light{X}.vLightGround);
#elif defined(SS_TRANSLUCENCY)
info.diffuse=computeDiffuseAndTransmittedLighting(preInfo,light{X}.vLightDiffuse.rgb,subSurfaceOut.transmittance);
#else
info.diffuse=computeDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb);
#endif
#ifdef SPECULARTERM
#ifdef ANISOTROPIC
info.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);
#else
info.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);
#endif
#endif
#ifdef SHEEN
#ifdef SHEEN_LINKWITHALBEDO
preInfo.roughness=sheenOut.sheenIntensity;
#else
#ifdef HEMILIGHT{X}
preInfo.roughness=sheenOut.sheenRoughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
#endif
info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);
#endif
#ifdef CLEARCOAT
#ifdef HEMILIGHT{X}
preInfo.roughness=clearcoatOut.clearCoatRoughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light{X}.vLightDiffuse.rgb);
#ifdef CLEARCOAT_TINT
absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;
#ifdef SPECULARTERM
info.specular*=absorption;
#endif
#endif
info.diffuse*=info.clearCoat.w;
#ifdef SPECULARTERM
info.specular*=info.clearCoat.w;
#endif
#ifdef SHEEN
info.sheen*=info.clearCoat.w;
#endif
#endif
#else
#ifdef SPOTLIGHT{X}
info=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);
#elif defined(HEMILIGHT{X})
info=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);
#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})
info=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);
#endif
#endif
#ifdef PROJECTEDLIGHTTEXTURE{X}
info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightSampler{X},textureProjectionMatrix{X});
#endif
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) 
{
#ifdef SHADOWCSM_RIGHTHANDED{X}
diff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z;
#else
diff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z;
#endif
if (diff{X}>=0.) {index{X}=i;break;}}
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
if (index{X}>=0)
#endif
{
#if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#else
shadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#endif
#else
shadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];
#endif
#ifndef SHADOWCSMNOBLEND{X}
float frustumLength=frustumLengths{X}[index{X}];float diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)
{index{X}+=1;float nextShadow=0.;
#if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
nextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
nextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
nextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
nextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#elif defined(SHADOWMEDIUMQUALITY{X})
nextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#else
nextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#endif
#else
nextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
shadow=mix(nextShadow,shadow,diffRatio);
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);
#endif
}
#endif
}
#elif defined(SHADOWCLOSEESM{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithCloseESMCube(vPositionW,light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
#else
shadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWESM{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithESMCube(vPositionW,light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
#else
shadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPOISSON{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithPoissonSamplingCube(vPositionW,light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);
#else
shadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#else
#if defined(SHADOWCUBE{X})
shadow=computeShadowCube(vPositionW,light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.depthValues);
#else
shadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#endif
#ifdef SHADOWONLY
#ifndef SHADOWINUSE
#define SHADOWINUSE
#endif
globalShadow+=shadow;shadowLightCount+=1.0;
#endif
#else
shadow=1.;
#endif
aggShadow+=shadow;numLights+=1.0;
#ifndef SHADOWONLY
#ifdef CUSTOMUSERLIGHTING
diffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);
#ifdef SPECULARTERM
specularBase+=computeCustomSpecularLighting(info,specularBase,shadow);
#endif
#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})
diffuseBase+=lightmapColor.rgb*shadow;
#ifdef SPECULARTERM
#ifndef LIGHTMAPNOSPECULAR{X}
specularBase+=info.specular*shadow*lightmapColor.rgb;
#endif
#endif
#ifdef CLEARCOAT
#ifndef LIGHTMAPNOSPECULAR{X}
clearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;
#endif
#endif
#ifdef SHEEN
#ifndef LIGHTMAPNOSPECULAR{X}
sheenBase+=info.sheen.rgb*shadow;
#endif
#endif
#else
#ifdef SHADOWCSMDEBUG{X}
diffuseBase+=info.diffuse*shadowDebug{X};
#else 
diffuseBase+=info.diffuse*shadow;
#endif
#ifdef SPECULARTERM
specularBase+=info.specular*shadow;
#endif
#ifdef CLEARCOAT
clearCoatBase+=info.clearCoat.rgb*shadow;
#endif
#ifdef SHEEN
sheenBase+=info.sheen.rgb*shadow;
#endif
#endif
#endif
#endif
`;
Le.IncludesShadersStore[rde] = nde;
const ide = "logDepthFragment", sde = `#ifdef LOGARITHMICDEPTH
gl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;
#endif
`;
Le.IncludesShadersStore[ide] = sde;
const ade = "fogFragment", ode = `#ifdef FOG
float fog=CalcFogFactor();
#ifdef PBR
fog=toLinearSpace(fog);
#endif
color.rgb=mix(vFogColor,color.rgb,fog);
#endif
`;
Le.IncludesShadersStore[ade] = ode;
const fde = "oitFragment", Ade = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY
float fragDepth=gl_FragCoord.z; 
#ifdef ORDER_INDEPENDENT_TRANSPARENCY_16BITS
uint halfFloat=packHalf2x16(vec2(fragDepth));vec2 full=unpackHalf2x16(halfFloat);fragDepth=full.x;
#endif
ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec2 lastDepth=texelFetch(oitDepthSampler,fragCoord,0).rg;vec4 lastFrontColor=texelFetch(oitFrontColorSampler,fragCoord,0);depth.rg=vec2(-MAX_DEPTH);frontColor=lastFrontColor;backColor=vec4(0.0);
#ifdef USE_REVERSE_DEPTHBUFFER
float furthestDepth=-lastDepth.x;float nearestDepth=lastDepth.y;
#else
float nearestDepth=-lastDepth.x;float furthestDepth=lastDepth.y;
#endif
float alphaMultiplier=1.0-lastFrontColor.a;
#ifdef USE_REVERSE_DEPTHBUFFER
if (fragDepth>nearestDepth || fragDepth<furthestDepth) {
#else
if (fragDepth<nearestDepth || fragDepth>furthestDepth) {
#endif
return;}
#ifdef USE_REVERSE_DEPTHBUFFER
if (fragDepth<nearestDepth && fragDepth>furthestDepth) {
#else
if (fragDepth>nearestDepth && fragDepth<furthestDepth) {
#endif
depth.rg=vec2(-fragDepth,fragDepth);return;}
#endif
`;
Le.IncludesShadersStore[fde] = Ade;
const dde = "defaultPixelShader", vde = `#include<__decl__defaultFragment>
#if defined(BUMP) || !defined(NORMAL)
#extension GL_OES_standard_derivatives : enable
#endif
#include<prePassDeclaration>[SCENE_MRT_COUNT]
#include<oitDeclaration>
#define CUSTOM_FRAGMENT_BEGIN
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<mainUVVaryingDeclaration>[1..7]
#include<helperFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)
#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)
#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)
#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)
#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)
#ifdef REFRACTION
#ifdef REFRACTIONMAP_3D
uniform samplerCube refractionCubeSampler;
#else
uniform sampler2D refraction2DSampler;
#endif
#endif
#if defined(SPECULARTERM)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)
#endif
#include<fresnelFunction>
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
uniform samplerCube reflectionCubeSampler;
#else
uniform sampler2D reflection2DSampler;
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#endif
#include<reflectionFunction>
#endif
#include<imageProcessingDeclaration>
#include<imageProcessingFunctions>
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));
#endif
#include<bumpFragment>
#ifdef TWOSIDEDLIGHTING
normalW=gl_FrontFacing ? normalW : -normalW;
#endif
#ifdef DIFFUSE
baseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);
#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)
if (baseColor.a<alphaCutOff)
discard;
#endif
#ifdef ALPHAFROMDIFFUSE
alpha*=baseColor.a;
#endif
#define CUSTOM_FRAGMENT_UPDATE_ALPHA
baseColor.rgb*=vDiffuseInfos.y;
#endif
#if defined(DECAL) && !defined(DECAL_AFTER_DETAIL)
vec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);
#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)
#endif
#include<depthPrePass>
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
baseColor.rgb*=vColor.rgb;
#endif
#ifdef DETAIL
baseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y);
#endif
#if defined(DECAL) && defined(DECAL_AFTER_DETAIL)
vec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);
#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)
#endif
#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE
vec3 baseAmbientColor=vec3(1.,1.,1.);
#ifdef AMBIENT
baseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;
#endif
#define CUSTOM_FRAGMENT_BEFORE_LIGHTS
#ifdef SPECULARTERM
float glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;
#ifdef SPECULAR
vec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);specularColor=specularMapColor.rgb;
#ifdef GLOSSINESS
glossiness=glossiness*specularMapColor.a;
#endif
#endif
#else
float glossiness=0.;
#endif
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
float shadow=1.;float aggShadow=0.;float numLights=0.;
#ifdef LIGHTMAP
vec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);
#ifdef RGBDLIGHTMAP
lightmapColor.rgb=fromRGBD(lightmapColor);
#endif
lightmapColor.rgb*=vLightmapInfos.y;
#endif
#include<lightFragment>[0..maxSimultaneousLights]
aggShadow=aggShadow/numLights;vec4 refractionColor=vec4(0.,0.,0.,1.);
#ifdef REFRACTION
vec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));
#ifdef REFRACTIONMAP_3D
#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC
refractionVector=parallaxCorrectNormal(vPositionW,refractionVector,vRefractionSize,vRefractionPosition);
#endif
refractionVector.y=refractionVector.y*vRefractionInfos.w;vec4 refractionLookup=textureCube(refractionCubeSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;}
#else
vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));vec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=texture2D(refraction2DSampler,refractionCoords);
#endif
#ifdef RGBDREFRACTION
refractionColor.rgb=fromRGBD(refractionColor);
#endif
#ifdef IS_REFRACTION_LINEAR
refractionColor.rgb=toGammaSpace(refractionColor.rgb);
#endif
refractionColor.rgb*=vRefractionInfos.x;
#endif
vec4 reflectionColor=vec4(0.,0.,0.,1.);
#ifdef REFLECTION
vec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);
#ifdef REFLECTIONMAP_OPPOSITEZ
vReflectionUVW.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
#ifdef ROUGHNESS
float bias=vReflectionInfos.y;
#ifdef SPECULARTERM
#ifdef SPECULAR
#ifdef GLOSSINESS
bias*=(1.0-specularMapColor.a);
#endif
#endif
#endif
reflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias);
#else
reflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW);
#endif
#else
vec2 coords=vReflectionUVW.xy;
#ifdef REFLECTIONMAP_PROJECTION
coords/=vReflectionUVW.z;
#endif
coords.y=1.0-coords.y;reflectionColor=texture2D(reflection2DSampler,coords);
#endif
#ifdef RGBDREFLECTION
reflectionColor.rgb=fromRGBD(reflectionColor);
#endif
#ifdef IS_REFLECTION_LINEAR
reflectionColor.rgb=toGammaSpace(reflectionColor.rgb);
#endif
reflectionColor.rgb*=vReflectionInfos.x;
#ifdef REFLECTIONFRESNEL
float reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);
#ifdef REFLECTIONFRESNELFROMSPECULAR
#ifdef SPECULARTERM
reflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;
#else
reflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;
#endif
#else
reflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;
#endif
#endif
#endif
#ifdef REFRACTIONFRESNEL
float refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);refractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;
#endif
#ifdef OPACITY
vec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);
#ifdef OPACITYRGB
opacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);alpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;
#else
alpha*=opacityMap.a*vOpacityInfos.y;
#endif
#endif
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#ifdef OPACITYFRESNEL
float opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);alpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;
#endif
#ifdef ALPHATEST
#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS
if (alpha<alphaCutOff)
discard;
#endif
#ifndef ALPHABLEND
alpha=1.0;
#endif
#endif
vec3 emissiveColor=vEmissiveColor;
#ifdef EMISSIVE
emissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;
#endif
#ifdef EMISSIVEFRESNEL
float emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);emissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;
#endif
#ifdef DIFFUSEFRESNEL
float diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);diffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;
#endif
#ifdef EMISSIVEASILLUMINATION
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;
#else
#ifdef LINKEMISSIVEWITHDIFFUSE
vec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;
#else
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;
#endif
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase*specularColor;
#ifdef SPECULAROVERALPHA
alpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);
#endif
#else
vec3 finalSpecular=vec3(0.0);
#endif
#ifdef REFLECTIONOVERALPHA
alpha=clamp(alpha+dot(reflectionColor.rgb,vec3(0.3,0.59,0.11)),0.,1.);
#endif
#ifdef EMISSIVEASILLUMINATION
vec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);
#else
vec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);
#endif
#ifdef LIGHTMAP
#ifndef LIGHTMAPEXCLUDED
#ifdef USELIGHTMAPASSHADOWMAP
color.rgb*=lightmapColor.rgb;
#else
color.rgb+=lightmapColor.rgb;
#endif
#endif
#endif
#define CUSTOM_FRAGMENT_BEFORE_FOG
color.rgb=max(color.rgb,0.);
#include<logDepthFragment>
#include<fogFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
color.rgb=toLinearSpace(color.rgb);
#else
#ifdef IMAGEPROCESSING
color.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color);
#endif
#endif
color.a*=visibility;
#ifdef PREMULTIPLYALPHA
color.rgb*=color.a;
#endif
#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
#ifdef PREPASS
float writeGeometryInfo=color.a>0.4 ? 1.0 : 0.0;gl_FragData[0]=color; 
#ifdef PREPASS_POSITION
gl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);
#endif
#ifdef PREPASS_VELOCITY
vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_IRRADIANCE
gl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_DEPTH
gl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_NORMAL
#ifdef PREPASS_NORMAL_WORLDSPACE
gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalW,writeGeometryInfo); 
#else
gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo); 
#endif
#endif
#ifdef PREPASS_ALBEDO_SQRT
gl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_REFLECTIVITY
#if defined(SPECULARTERM)
#if defined(SPECULAR)
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularMapColor))*writeGeometryInfo; 
#else
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularColor),1.0)*writeGeometryInfo;
#endif
#else
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(0.0,0.0,0.0,1.0)*writeGeometryInfo;
#endif
#endif
#endif
#if !defined(PREPASS) || defined(WEBGL2)
gl_FragColor=color;
#endif
#include<oitFragment>
#if ORDER_INDEPENDENT_TRANSPARENCY
if (fragDepth==nearestDepth) {frontColor.rgb+=color.rgb*color.a*alphaMultiplier;frontColor.a=1.0-alphaMultiplier*(1.0-color.a);} else {backColor+=color;}
#endif
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[dde] = vde;
const ude = "decalVertexDeclaration", lde = `#ifdef DECAL
uniform vec4 vDecalInfos;uniform mat4 decalMatrix;
#endif
`;
Le.IncludesShadersStore[ude] = lde;
const Pde = "defaultVertexDeclaration", cde = `uniform mat4 viewProjection;uniform mat4 view;
#ifdef DIFFUSE
uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;
#endif
#ifdef AMBIENT
uniform mat4 ambientMatrix;uniform vec2 vAmbientInfos;
#endif
#ifdef OPACITY
uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;uniform mat4 emissiveMatrix;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;uniform mat4 lightmapMatrix;
#endif
#if defined(SPECULAR) && defined(SPECULARTERM)
uniform vec2 vSpecularInfos;uniform mat4 specularMatrix;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;uniform mat4 bumpMatrix;
#endif
#ifdef REFLECTION
uniform mat4 reflectionMatrix;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;uniform mat4 detailMatrix;
#endif
#include<decalVertexDeclaration>
#define ADDITIONAL_VERTEX_DECLARATION
`;
Le.IncludesShadersStore[Pde] = cde;
const pde = "uvAttributeDeclaration", hde = `#ifdef UV{X}
attribute vec2 uv{X};
#endif
`;
Le.IncludesShadersStore[pde] = hde;
const Hde = "bonesDeclaration", gde = `#if NUM_BONE_INFLUENCERS>0
attribute vec4 matricesIndices;attribute vec4 matricesWeights;
#if NUM_BONE_INFLUENCERS>4
attribute vec4 matricesIndicesExtra;attribute vec4 matricesWeightsExtra;
#endif
#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#ifdef BONETEXTURE
uniform highp sampler2D boneSampler;uniform float boneTextureWidth;
#else
uniform mat4 mBones[BonesPerMesh];
#endif
#ifdef BONES_VELOCITY_ENABLED
uniform mat4 mPreviousBones[BonesPerMesh];
#endif
#ifdef BONETEXTURE
#define inline
mat4 readMatrixFromRawSampler(sampler2D smp,float index)
{float offset=index *4.0;float dx=1.0/boneTextureWidth;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));return mat4(m0,m1,m2,m3);}
#endif
#endif
#endif
`;
Le.IncludesShadersStore[Hde] = gde;
const Xde = "bakedVertexAnimationDeclaration", Tde = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
uniform float bakedVertexAnimationTime;uniform vec2 bakedVertexAnimationTextureSizeInverted;uniform vec4 bakedVertexAnimationSettings;uniform sampler2D bakedVertexAnimationTexture;
#ifdef INSTANCES
attribute vec4 bakedVertexAnimationSettingsInstanced;
#endif
#define inline
mat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame)
{float offset=index*4.0;float frameUV=(frame+0.5)*bakedVertexAnimationTextureSizeInverted.y;float dx=bakedVertexAnimationTextureSizeInverted.x;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),frameUV));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),frameUV));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),frameUV));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),frameUV));return mat4(m0,m1,m2,m3);}
#endif
`;
Le.IncludesShadersStore[Xde] = Tde;
const qde = "instancesDeclaration", bde = `#ifdef INSTANCES
attribute vec4 world0;attribute vec4 world1;attribute vec4 world2;attribute vec4 world3;
#ifdef INSTANCESCOLOR
attribute vec4 instanceColor;
#endif
#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)
uniform mat4 world;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY)
attribute vec4 previousWorld0;attribute vec4 previousWorld1;attribute vec4 previousWorld2;attribute vec4 previousWorld3;
#ifdef THIN_INSTANCES
uniform mat4 previousWorld;
#endif
#endif
#else
#if !defined(WORLD_UBO)
uniform mat4 world;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY)
uniform mat4 previousWorld;
#endif
#endif
`;
Le.IncludesShadersStore[qde] = bde;
const xde = "prePassVertexDeclaration", Dde = `#ifdef PREPASS
#ifdef PREPASS_DEPTH
varying vec3 vViewPos;
#endif
#ifdef PREPASS_VELOCITY
uniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;
#endif
#endif
`;
Le.IncludesShadersStore[xde] = Dde;
const jde = "samplerVertexDeclaration", wde = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
varying vec2 v_VARYINGNAME_UV;
#endif
`;
Le.IncludesShadersStore[jde] = wde;
const mde = "bumpVertexDeclaration", Bde = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL) 
varying mat3 vTBN;
#endif
#endif
`;
Le.IncludesShadersStore[mde] = Bde;
const Wde = "clipPlaneVertexDeclaration", Sde = `#ifdef CLIPPLANE
uniform vec4 vClipPlane;varying float fClipDistance;
#endif
#ifdef CLIPPLANE2
uniform vec4 vClipPlane2;varying float fClipDistance2;
#endif
#ifdef CLIPPLANE3
uniform vec4 vClipPlane3;varying float fClipDistance3;
#endif
#ifdef CLIPPLANE4
uniform vec4 vClipPlane4;varying float fClipDistance4;
#endif
#ifdef CLIPPLANE5
uniform vec4 vClipPlane5;varying float fClipDistance5;
#endif
#ifdef CLIPPLANE6
uniform vec4 vClipPlane6;varying float fClipDistance6;
#endif
`;
Le.IncludesShadersStore[Wde] = Sde;
const Ude = "fogVertexDeclaration", Ide = `#ifdef FOG
varying vec3 vFogDistance;
#endif
`;
Le.IncludesShadersStore[Ude] = Ide;
const Rde = "lightVxFragmentDeclaration", Vde = `#ifdef LIGHT{X}
uniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};
#ifdef SPECULARTERM
uniform vec4 vLightSpecular{X};
#else
vec4 vLightSpecular{X}=vec4(0.);
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
#elif defined(SHADOWCUBE{X})
#else
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};
#endif
uniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};
#endif
#ifdef SPOTLIGHT{X}
uniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};
#elif defined(POINTLIGHT{X})
uniform vec4 vLightFalloff{X};
#elif defined(HEMILIGHT{X})
uniform vec3 vLightGround{X};
#endif
#endif
`;
Le.IncludesShadersStore[Rde] = Vde;
const Cde = "lightVxUboDeclaration", Ode = `#ifdef LIGHT{X}
uniform Light{X}
{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;
#ifdef SPOTLIGHT{X}
vec4 vLightDirection;vec4 vLightFalloff;
#elif defined(POINTLIGHT{X})
vec4 vLightFalloff;
#elif defined(HEMILIGHT{X})
vec3 vLightGround;
#endif
vec4 shadowsInfo;vec2 depthValues;} light{X};
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
#elif defined(SHADOWCUBE{X})
#else
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};
#endif
#endif
#endif
`;
Le.IncludesShadersStore[Cde] = Ode;
const yde = "morphTargetsVertexGlobalDeclaration", kde = `#ifdef MORPHTARGETS
uniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];
#ifdef MORPHTARGETS_TEXTURE 
uniform float morphTargetTextureIndices[NUM_MORPH_INFLUENCERS];uniform vec3 morphTargetTextureInfo;uniform highp sampler2DArray morphTargets;vec3 readVector3FromRawSampler(int targetIndex,float vertexIndex)
{ 
float y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphTargetTextureInfo.y;vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);return texture(morphTargets,textureUV).xyz;}
#endif
#endif
`;
Le.IncludesShadersStore[yde] = kde;
const Ede = "morphTargetsVertexDeclaration", Fde = `#ifdef MORPHTARGETS
#ifndef MORPHTARGETS_TEXTURE
attribute vec3 position{X};
#ifdef MORPHTARGETS_NORMAL
attribute vec3 normal{X};
#endif
#ifdef MORPHTARGETS_TANGENT
attribute vec3 tangent{X};
#endif
#ifdef MORPHTARGETS_UV
attribute vec2 uv_{X};
#endif
#endif
#endif
`;
Le.IncludesShadersStore[Ede] = Fde;
const Nde = "morphTargetsVertexGlobal", Qde = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE
float vertexID;
#endif
#endif
`;
Le.IncludesShadersStore[Nde] = Qde;
const Yde = "morphTargetsVertex", Mde = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE 
vertexID=float(gl_VertexID)*morphTargetTextureInfo.x;positionUpdated+=(readVector3FromRawSampler({X},vertexID)-position)*morphTargetInfluences[{X}];vertexID+=1.0;
#ifdef MORPHTARGETS_NORMAL
normalUpdated+=(readVector3FromRawSampler({X},vertexID) -normal)*morphTargetInfluences[{X}];vertexID+=1.0;
#endif
#ifdef MORPHTARGETS_UV
uvUpdated+=(readVector3FromRawSampler({X},vertexID).xy-uv)*morphTargetInfluences[{X}];vertexID+=1.0;
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated.xyz+=(readVector3FromRawSampler({X},vertexID) -tangent.xyz)*morphTargetInfluences[{X}];
#endif
#else
positionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];
#ifdef MORPHTARGETS_NORMAL
normalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_UV
uvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];
#endif
#endif
#endif
`;
Le.IncludesShadersStore[Yde] = Mde;
const Lde = "instancesVertex", Kde = `#ifdef INSTANCES
mat4 finalWorld=mat4(world0,world1,world2,world3);
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
mat4 finalPreviousWorld=mat4(previousWorld0,previousWorld1,previousWorld2,previousWorld3);
#endif
#ifdef THIN_INSTANCES
finalWorld=world*finalWorld;
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
finalPreviousWorld=previousWorld*finalPreviousWorld;
#endif
#endif
#else
mat4 finalWorld=world;
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
mat4 finalPreviousWorld=previousWorld;
#endif
#endif
`;
Le.IncludesShadersStore[Lde] = Kde;
const Jde = "bonesVertex", zde = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#if NUM_BONE_INFLUENCERS>0
mat4 influence;
#ifdef BONETEXTURE
influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];
#endif
#else
influence=mBones[int(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence+=mBones[int(matricesIndices[1])]*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
influence+=mBones[int(matricesIndices[2])]*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
influence+=mBones[int(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
influence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
influence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
influence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
influence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
#endif
finalWorld=finalWorld*influence;
#endif
#endif
`;
Le.IncludesShadersStore[Jde] = zde;
const Gde = "bakedVertexAnimation", Zde = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
{
#ifdef INSTANCES
#define BVASNAME bakedVertexAnimationSettingsInstanced
#else
#define BVASNAME bakedVertexAnimationSettings
#endif
float VATStartFrame=BVASNAME.x;float VATEndFrame=BVASNAME.y;float VATOffsetFrame=BVASNAME.z;float VATSpeed=BVASNAME.w;float totalFrames=VATEndFrame-VATStartFrame+1.0;float time=bakedVertexAnimationTime*VATSpeed/totalFrames;float frameCorrection=time<1.0 ? 0.0 : 1.0;float numOfFrames=totalFrames-frameCorrection;float VATFrameNum=fract(time)*numOfFrames;VATFrameNum=mod(VATFrameNum+VATOffsetFrame,numOfFrames);VATFrameNum=floor(VATFrameNum);VATFrameNum+=VATStartFrame+frameCorrection;mat4 VATInfluence;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[0],VATFrameNum)*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];
#endif
finalWorld=finalWorld*VATInfluence;}
#endif
`;
Le.IncludesShadersStore[Gde] = Zde;
const _de = "prePassVertex", $de = `#ifdef PREPASS_DEPTH
vViewPos=(view*worldPos).rgb;
#endif
#if defined(PREPASS_VELOCITY) && defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*worldPos;
#if NUM_BONE_INFLUENCERS>0
mat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif 
#if NUM_BONE_INFLUENCERS>5
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif 
#if NUM_BONE_INFLUENCERS>6
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif 
#if NUM_BONE_INFLUENCERS>7
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);
#else
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#endif
`;
Le.IncludesShadersStore[_de] = $de;
const eve = "uvVariableDeclaration", tve = `#if !defined(UV{X}) && defined(MAINUV{X})
vec2 uv{X}=vec2(0.,0.);
#endif
#ifdef MAINUV{X}
vMainUV{X}=uv{X};
#endif
`;
Le.IncludesShadersStore[eve] = tve;
const rve = "samplerVertexImplementation", nve = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
if (v_INFONAME_==0.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uvUpdated,1.0,0.0));}
#ifdef UV2
else if (v_INFONAME_==1.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv2,1.0,0.0));}
#endif
#ifdef UV3
else if (v_INFONAME_==2.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv3,1.0,0.0));}
#endif
#ifdef UV4
else if (v_INFONAME_==3.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv4,1.0,0.0));}
#endif
#ifdef UV5
else if (v_INFONAME_==4.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv5,1.0,0.0));}
#endif
#ifdef UV6
else if (v_INFONAME_==5.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv6,1.0,0.0));}
#endif
#endif
`;
Le.IncludesShadersStore[rve] = nve;
const ive = "bumpVertex", sve = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL)
vec3 tbnNormal=normalize(normalUpdated);vec3 tbnTangent=normalize(tangentUpdated.xyz);vec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;vTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);
#endif
#endif
`;
Le.IncludesShadersStore[ive] = sve;
const ave = "clipPlaneVertex", ove = `#ifdef CLIPPLANE
fClipDistance=dot(worldPos,vClipPlane);
#endif
#ifdef CLIPPLANE2
fClipDistance2=dot(worldPos,vClipPlane2);
#endif
#ifdef CLIPPLANE3
fClipDistance3=dot(worldPos,vClipPlane3);
#endif
#ifdef CLIPPLANE4
fClipDistance4=dot(worldPos,vClipPlane4);
#endif
#ifdef CLIPPLANE5
fClipDistance5=dot(worldPos,vClipPlane5);
#endif
#ifdef CLIPPLANE6
fClipDistance6=dot(worldPos,vClipPlane6);
#endif
`;
Le.IncludesShadersStore[ave] = ove;
const fve = "fogVertex", Ave = `#ifdef FOG
vFogDistance=(view*worldPos).xyz;
#endif
`;
Le.IncludesShadersStore[fve] = Ave;
const dve = "shadowsVertex", vve = `#ifdef SHADOWS
#if defined(SHADOWCSM{X})
vPositionFromCamera{X}=view*worldPos;for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
}
#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})
vPositionFromLight{X}=lightMatrix{X}*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
#endif
#endif
`;
Le.IncludesShadersStore[dve] = vve;
const uve = "vertexColorMixing", lve = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
vColor=vec4(1.0);
#ifdef VERTEXCOLOR
#ifdef VERTEXALPHA
vColor*=color;
#else
vColor.rgb*=color.rgb;
#endif
#endif
#ifdef INSTANCESCOLOR
vColor*=instanceColor;
#endif
#endif
`;
Le.IncludesShadersStore[uve] = lve;
const Pve = "pointCloudVertex", cve = `#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
`;
Le.IncludesShadersStore[Pve] = cve;
const pve = "logDepthVertex", hve = `#ifdef LOGARITHMICDEPTH
vFragmentDepth=1.0+gl_Position.w;gl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;
#endif
`;
Le.IncludesShadersStore[pve] = hve;
const Hve = "defaultVertexShader", gve = `#include<__decl__defaultVertex>
#define CUSTOM_VERTEX_BEGIN
attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef TANGENT
attribute vec4 tangent;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#include<uvAttributeDeclaration>[2..7]
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<helperFunctions>
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
#include<prePassVertexDeclaration>
#include<mainUVVaryingDeclaration>[1..7]
#include<samplerVertexDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse)
#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
#if defined(SPECULARTERM)
#include<samplerVertexDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular)
#endif
#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<bumpVertexDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 positionUpdated=position;
#ifdef NORMAL
vec3 normalUpdated=normal;
#endif
#ifdef TANGENT
vec4 tangentUpdated=tangent;
#endif
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
vPositionUVW=positionUpdated;
#endif
#define CUSTOM_VERTEX_UPDATE_POSITION
#define CUSTOM_VERTEX_UPDATE_NORMAL
#include<instancesVertex>
#if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#ifdef NORMAL
mat3 normalWorld=mat3(finalWorld);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vNormalW=normalize(normalWorld*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vNormalW=normalize(normalWorld*normalUpdated);
#endif
#endif
#define CUSTOM_VERTEX_UPDATE_WORLDPOS
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}
#else
gl_Position=viewProjection*worldPos;
#endif
vPositionW=vec3(worldPos);
#include<prePassVertex>
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));
#endif
#ifndef UV1
vec2 uvUpdated=vec2(0.,0.);
#endif
#ifdef MAINUV1
vMainUV1=uvUpdated;
#endif
#include<uvVariableDeclaration>[2..7]
#include<samplerVertexImplementation>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
#if defined(SPECULARTERM)
#include<samplerVertexImplementation>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x)
#endif
#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)
#include<bumpVertex>
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#include<pointCloudVertex>
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[Hve] = gve;
const Xve = new RegExp("^([gimus]+)!");
class sq {
  /**
   * Creates a new instance of the plugin manager
   * @param material material that this manager will manage the plugins for
   */
  constructor(e) {
    this._plugins = [], this._activePlugins = [], this._activePluginsForExtraEvents = [], this._material = e, this._scene = e.getScene(), this._engine = this._scene.getEngine();
  }
  /**
   * @internal
   */
  _addPlugin(e) {
    for (let n = 0; n < this._plugins.length; ++n)
      if (this._plugins[n].name === e.name)
        return !1;
    if (this._material._uniformBufferLayoutBuilt)
      throw `The plugin "${e.name}" can't be added to the material "${this._material.name}" because this material has already been used for rendering! Please add plugins to materials before any rendering with this material occurs.`;
    const t = e.getClassName();
    sq._MaterialPluginClassToMainDefine[t] || (sq._MaterialPluginClassToMainDefine[t] = "MATERIALPLUGIN_" + ++sq._MaterialPluginCounter), this._material._callbackPluginEventGeneric = (n, i) => this._handlePluginEvent(n, i), this._plugins.push(e), this._plugins.sort((n, i) => n.priority - i.priority), this._codeInjectionPoints = {};
    const r = {};
    r[sq._MaterialPluginClassToMainDefine[t]] = {
      type: "boolean",
      default: !0
    };
    for (const n of this._plugins)
      n.collectDefines(r), this._collectPointNames("vertex", n.getCustomCode("vertex")), this._collectPointNames("fragment", n.getCustomCode("fragment"));
    return this._defineNamesFromPlugins = r, !0;
  }
  /**
   * @internal
   */
  _activatePlugin(e) {
    this._activePlugins.indexOf(e) === -1 && (this._activePlugins.push(e), this._activePlugins.sort((t, r) => t.priority - r.priority), this._material._callbackPluginEventIsReadyForSubMesh = this._handlePluginEventIsReadyForSubMesh.bind(this), this._material._callbackPluginEventPrepareDefinesBeforeAttributes = this._handlePluginEventPrepareDefinesBeforeAttributes.bind(this), this._material._callbackPluginEventPrepareDefines = this._handlePluginEventPrepareDefines.bind(this), this._material._callbackPluginEventBindForSubMesh = this._handlePluginEventBindForSubMesh.bind(this), e.registerForExtraEvents && (this._activePluginsForExtraEvents.push(e), this._activePluginsForExtraEvents.sort((t, r) => t.priority - r.priority), this._material._callbackPluginEventHasRenderTargetTextures = this._handlePluginEventHasRenderTargetTextures.bind(this), this._material._callbackPluginEventFillRenderTargetTextures = this._handlePluginEventFillRenderTargetTextures.bind(this), this._material._callbackPluginEventHardBindForSubMesh = this._handlePluginEventHardBindForSubMesh.bind(this)));
  }
  /**
   * Gets a plugin from the list of plugins managed by this manager
   * @param name name of the plugin
   * @returns the plugin if found, else null
   */
  getPlugin(e) {
    for (let t = 0; t < this._plugins.length; ++t)
      if (this._plugins[t].name === e)
        return this._plugins[t];
    return null;
  }
  _handlePluginEventIsReadyForSubMesh(e) {
    let t = !0;
    for (const r of this._activePlugins)
      t = t && r.isReadyForSubMesh(e.defines, this._scene, this._engine, e.subMesh);
    e.isReadyForSubMesh = t;
  }
  _handlePluginEventPrepareDefinesBeforeAttributes(e) {
    for (const t of this._activePlugins)
      t.prepareDefinesBeforeAttributes(e.defines, this._scene, e.mesh);
  }
  _handlePluginEventPrepareDefines(e) {
    for (const t of this._activePlugins)
      t.prepareDefines(e.defines, this._scene, e.mesh);
  }
  _handlePluginEventHardBindForSubMesh(e) {
    for (const t of this._activePluginsForExtraEvents)
      t.hardBindForSubMesh(this._material._uniformBuffer, this._scene, this._engine, e.subMesh);
  }
  _handlePluginEventBindForSubMesh(e) {
    for (const t of this._activePlugins)
      t.bindForSubMesh(this._material._uniformBuffer, this._scene, this._engine, e.subMesh);
  }
  _handlePluginEventHasRenderTargetTextures(e) {
    let t = !1;
    for (const r of this._activePluginsForExtraEvents)
      if (t = r.hasRenderTargetTextures(), t)
        break;
    e.hasRenderTargetTextures = t;
  }
  _handlePluginEventFillRenderTargetTextures(e) {
    for (const t of this._activePluginsForExtraEvents)
      t.fillRenderTargetTextures(e.renderTargets);
  }
  _handlePluginEvent(e, t) {
    var r;
    switch (e) {
      case x6.GetActiveTextures: {
        const n = t;
        for (const i of this._activePlugins)
          i.getActiveTextures(n.activeTextures);
        break;
      }
      case x6.GetAnimatables: {
        const n = t;
        for (const i of this._activePlugins)
          i.getAnimatables(n.animatables);
        break;
      }
      case x6.HasTexture: {
        const n = t;
        let i = !1;
        for (const s of this._activePlugins)
          if (i = s.hasTexture(n.texture), i)
            break;
        n.hasTexture = i;
        break;
      }
      case x6.Disposed: {
        const n = t;
        for (const i of this._plugins)
          i.dispose(n.forceDisposeTextures);
        break;
      }
      case x6.GetDefineNames: {
        const n = t;
        n.defineNames = this._defineNamesFromPlugins;
        break;
      }
      case x6.PrepareEffect: {
        const n = t;
        for (const i of this._activePlugins)
          n.fallbackRank = i.addFallbacks(n.defines, n.fallbacks, n.fallbackRank), i.getAttributes(n.attributes, this._scene, n.mesh);
        this._uniformList.length > 0 && n.uniforms.push(...this._uniformList), this._samplerList.length > 0 && n.samplers.push(...this._samplerList), this._uboList.length > 0 && n.uniformBuffersNames.push(...this._uboList), n.customCode = this._injectCustomCode(n, n.customCode);
        break;
      }
      case x6.PrepareUniformBuffer: {
        const n = t;
        this._uboDeclaration = "", this._vertexDeclaration = "", this._fragmentDeclaration = "", this._uniformList = [], this._samplerList = [], this._uboList = [];
        for (const i of this._plugins) {
          const s = i.getUniforms();
          if (s) {
            if (s.ubo)
              for (const a of s.ubo) {
                if (a.size && a.type) {
                  const f = (r = a.arraySize) !== null && r !== void 0 ? r : 0;
                  n.ubo.addUniform(a.name, a.size, f), this._uboDeclaration += `${a.type} ${a.name}${f > 0 ? `[${f}]` : ""};
`;
                }
                this._uniformList.push(a.name);
              }
            s.vertex && (this._vertexDeclaration += s.vertex + `
`), s.fragment && (this._fragmentDeclaration += s.fragment + `
`);
          }
          i.getSamplers(this._samplerList), i.getUniformBuffersNames(this._uboList);
        }
        break;
      }
    }
  }
  _collectPointNames(e, t) {
    if (t)
      for (const r in t)
        this._codeInjectionPoints[e] || (this._codeInjectionPoints[e] = {}), this._codeInjectionPoints[e][r] = !0;
  }
  _injectCustomCode(e, t) {
    return (r, n) => {
      var i, s;
      t && (n = t(r, n)), this._uboDeclaration && (n = n.replace("#define ADDITIONAL_UBO_DECLARATION", this._uboDeclaration)), this._vertexDeclaration && (n = n.replace("#define ADDITIONAL_VERTEX_DECLARATION", this._vertexDeclaration)), this._fragmentDeclaration && (n = n.replace("#define ADDITIONAL_FRAGMENT_DECLARATION", this._fragmentDeclaration));
      const a = (i = this._codeInjectionPoints) === null || i === void 0 ? void 0 : i[r];
      if (!a)
        return n;
      let f = null;
      for (let o in a) {
        let d = "";
        for (const v of this._activePlugins) {
          let u = (s = v.getCustomCode(r)) === null || s === void 0 ? void 0 : s[o];
          if (u) {
            if (v.resolveIncludes) {
              if (f === null) {
                const l = za.GLSL;
                f = {
                  defines: [],
                  indexParameters: e.indexParameters,
                  isFragment: !1,
                  shouldUseHighPrecisionShader: this._engine._shouldUseHighPrecisionShader,
                  processor: void 0,
                  supportsUniformBuffers: this._engine.supportsUniformBuffers,
                  shadersRepository: Le.GetShadersRepository(l),
                  includesShadersStore: Le.GetIncludesShadersStore(l),
                  version: void 0,
                  platformName: this._engine.shaderPlatformName,
                  processingContext: void 0,
                  isNDCHalfZRange: this._engine.isNDCHalfZRange,
                  useReverseDepthBuffer: this._engine.useReverseDepthBuffer,
                  processCodeAfterIncludes: void 0
                  // not used by _ProcessIncludes
                };
              }
              f.isFragment = r === "fragment", hp._ProcessIncludes(u, f, (l) => u = l);
            }
            d += u + `
`;
          }
        }
        if (d.length > 0)
          if (o.charAt(0) === "!") {
            o = o.substring(1);
            let v = "g";
            if (o.charAt(0) === "!")
              v = "", o = o.substring(1);
            else {
              const p = Xve.exec(o);
              p && p.length >= 2 && (v = p[1], o = o.substring(v.length + 1));
            }
            v.indexOf("g") < 0 && (v += "g");
            const u = n, l = new RegExp(o, v);
            let P = l.exec(u);
            for (; P !== null; ) {
              let p = d;
              for (let c = 0; c < P.length; ++c)
                p = p.replace("$" + c, P[c]);
              n = n.replace(P[0], p), P = l.exec(u);
            }
          } else {
            const v = "#define " + o;
            n = n.replace(v, `
` + d + `
` + v);
          }
      }
      return n;
    };
  }
}
sq._MaterialPluginClassToMainDefine = {};
sq._MaterialPluginCounter = 0;
gr.OnEnginesDisposedObservable.add(() => {
  gQ();
});
const tD = [];
let eF = !1, tF = null;
function Tve(A, e) {
  eF || (tF = gt.OnEventObservable.add((r) => {
    for (const [, n] of tD)
      n(r);
  }, x6.Created), eF = !0);
  const t = tD.filter(([r, n]) => r === A);
  t.length > 0 ? t[0][1] = e : tD.push([A, e]);
}
function qve(A) {
  for (let e = 0; e < tD.length; ++e)
    if (tD[e][0] === A)
      return tD.splice(e, 1), tD.length === 0 && gQ(), !0;
  return !1;
}
function gQ() {
  tD.length = 0, eF = !1, gt.OnEventObservable.remove(tF), tF = null;
}
class Gl {
  _enable(e) {
    e && this._pluginManager._activatePlugin(this);
  }
  /**
   * Creates a new material plugin
   * @param material parent material of the plugin
   * @param name name of the plugin
   * @param priority priority of the plugin
   * @param defines list of defines used by the plugin. The value of the property is the default value for this property
   * @param addToPluginList true to add the plugin to the list of plugins managed by the material plugin manager of the material (default: true)
   * @param enable true to enable the plugin (it is handy if the plugin does not handle properties to switch its current activation)
   * @param resolveIncludes Indicates that any #include directive in the plugin code must be replaced by the corresponding code (default: false)
   */
  constructor(e, t, r, n, i = !0, s = !1, a = !1) {
    this.priority = 500, this.resolveIncludes = !1, this.registerForExtraEvents = !1, this._material = e, this.name = t, this.priority = r, this.resolveIncludes = a, e.pluginManager || (e.pluginManager = new sq(e), e.onDisposeObservable.add(() => {
      e.pluginManager = void 0;
    })), this._pluginDefineNames = n, this._pluginManager = e.pluginManager, i && this._pluginManager._addPlugin(this), s && this._enable(!0), this.markAllDefinesAsDirty = e._dirtyCallbacks[63];
  }
  /**
   * Gets the current class name useful for serialization or dynamic coding.
   * @returns The class name.
   */
  getClassName() {
    return "MaterialPluginBase";
  }
  /**
   * Specifies that the submesh is ready to be used.
   * @param defines the list of "defines" to update.
   * @param scene defines the scene the material belongs to.
   * @param engine the engine this scene belongs to.
   * @param subMesh the submesh to check for readiness
   * @returns - boolean indicating that the submesh is ready or not.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  isReadyForSubMesh(e, t, r, n) {
    return !0;
  }
  /**
   * Binds the material data (this function is called even if mustRebind() returns false)
   * @param uniformBuffer defines the Uniform buffer to fill in.
   * @param scene defines the scene the material belongs to.
   * @param engine defines the engine the material belongs to.
   * @param subMesh the submesh to bind data for
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  hardBindForSubMesh(e, t, r, n) {
  }
  /**
   * Binds the material data.
   * @param uniformBuffer defines the Uniform buffer to fill in.
   * @param scene defines the scene the material belongs to.
   * @param engine the engine this scene belongs to.
   * @param subMesh the submesh to bind data for
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  bindForSubMesh(e, t, r, n) {
  }
  /**
   * Disposes the resources of the material.
   * @param forceDisposeTextures - Forces the disposal of all textures.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  dispose(e) {
  }
  /**
   * Returns a list of custom shader code fragments to customize the shader.
   * @param shaderType "vertex" or "fragment"
   * @returns null if no code to be added, or a list of pointName =\> code.
   * Note that `pointName` can also be a regular expression if it starts with a `!`.
   * In that case, the string found by the regular expression (if any) will be
   * replaced by the code provided.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getCustomCode(e) {
    return null;
  }
  /**
   * Collects all defines.
   * @param defines The object to append to.
   */
  collectDefines(e) {
    if (this._pluginDefineNames)
      for (const t of Object.keys(this._pluginDefineNames)) {
        if (t[0] === "_")
          continue;
        const r = typeof this._pluginDefineNames[t];
        e[t] = {
          type: r === "number" ? "number" : r === "string" ? "string" : r === "boolean" ? "boolean" : "object",
          default: this._pluginDefineNames[t]
        };
      }
  }
  /**
   * Sets the defines for the next rendering. Called before MaterialHelper.PrepareDefinesForAttributes is called.
   * @param defines the list of "defines" to update.
   * @param scene defines the scene to the material belongs to.
   * @param mesh the mesh being rendered
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  prepareDefinesBeforeAttributes(e, t, r) {
  }
  /**
   * Sets the defines for the next rendering
   * @param defines the list of "defines" to update.
   * @param scene defines the scene to the material belongs to.
   * @param mesh the mesh being rendered
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  prepareDefines(e, t, r) {
  }
  /**
   * Checks to see if a texture is used in the material.
   * @param texture - Base texture to use.
   * @returns - Boolean specifying if a texture is used in the material.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  hasTexture(e) {
    return !1;
  }
  /**
   * Gets a boolean indicating that current material needs to register RTT
   * @returns true if this uses a render target otherwise false.
   */
  hasRenderTargetTextures() {
    return !1;
  }
  /**
   * Fills the list of render target textures.
   * @param renderTargets the list of render targets to update
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  fillRenderTargetTextures(e) {
  }
  /**
   * Returns an array of the actively used textures.
   * @param activeTextures Array of BaseTextures
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getActiveTextures(e) {
  }
  /**
   * Returns the animatable textures.
   * @param animatables Array of animatable textures.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getAnimatables(e) {
  }
  /**
   * Add fallbacks to the effect fallbacks list.
   * @param defines defines the Base texture to use.
   * @param fallbacks defines the current fallback list.
   * @param currentRank defines the current fallback rank.
   * @returns the new fallback rank.
   */
  addFallbacks(e, t, r) {
    return r;
  }
  /**
   * Gets the samplers used by the plugin.
   * @param samplers list that the sampler names should be added to.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getSamplers(e) {
  }
  /**
   * Gets the attributes used by the plugin.
   * @param attributes list that the attribute names should be added to.
   * @param scene the scene that the material belongs to.
   * @param mesh the mesh being rendered.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getAttributes(e, t, r) {
  }
  /**
   * Gets the uniform buffers names added by the plugin.
   * @param ubos list that the ubo names should be added to.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getUniformBuffersNames(e) {
  }
  /**
   * Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)
   * @returns the description of the uniforms
   */
  getUniforms() {
    return {};
  }
  /**
   * Makes a duplicate of the current configuration into another one.
   * @param plugin define the config where to copy the info
   */
  copyTo(e) {
    jt.Clone(() => e, this);
  }
  /**
   * Serializes this plugin configuration.
   * @returns - An object with the serialized config.
   */
  serialize() {
    return jt.Serialize(this);
  }
  /**
   * Parses a plugin configuration from a serialized object.
   * @param source - Serialized object.
   * @param scene Defines the scene we are parsing for
   * @param rootUrl Defines the rootUrl to load from
   */
  parse(e, t, r) {
    jt.Parse(() => this, e, t, r);
  }
}
C([
  M()
], Gl.prototype, "name", void 0);
C([
  M()
], Gl.prototype, "priority", void 0);
C([
  M()
], Gl.prototype, "resolveIncludes", void 0);
C([
  M()
], Gl.prototype, "registerForExtraEvents", void 0);
class Lee extends na {
  constructor() {
    super(...arguments), this.DETAIL = !1, this.DETAILDIRECTUV = 0, this.DETAIL_NORMALBLENDMETHOD = 0;
  }
}
class l4 extends Gl {
  /** @internal */
  _markAllSubMeshesAsTexturesDirty() {
    this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();
  }
  constructor(e, t = !0) {
    super(e, "DetailMap", 140, new Lee(), t), this._texture = null, this.diffuseBlendLevel = 1, this.roughnessBlendLevel = 1, this.bumpLevel = 1, this._normalBlendMethod = gt.MATERIAL_NORMALBLENDMETHOD_WHITEOUT, this._isEnabled = !1, this.isEnabled = !1, this._internalMarkAllSubMeshesAsTexturesDirty = e._dirtyCallbacks[1];
  }
  isReadyForSubMesh(e, t, r) {
    return this._isEnabled ? !(e._areTexturesDirty && t.texturesEnabled && r.getCaps().standardDerivatives && this._texture && Dt.DetailTextureEnabled && !this._texture.isReady()) : !0;
  }
  prepareDefines(e, t) {
    if (this._isEnabled) {
      e.DETAIL_NORMALBLENDMETHOD = this._normalBlendMethod;
      const r = t.getEngine();
      e._areTexturesDirty && (r.getCaps().standardDerivatives && this._texture && Dt.DetailTextureEnabled && this._isEnabled ? (Ye.PrepareDefinesForMergedUV(this._texture, e, "DETAIL"), e.DETAIL_NORMALBLENDMETHOD = this._normalBlendMethod) : e.DETAIL = !1);
    } else
      e.DETAIL = !1;
  }
  bindForSubMesh(e, t) {
    if (!this._isEnabled)
      return;
    const r = this._material.isFrozen;
    (!e.useUbo || !r || !e.isSync) && this._texture && Dt.DetailTextureEnabled && (e.updateFloat4("vDetailInfos", this._texture.coordinatesIndex, this.diffuseBlendLevel, this.bumpLevel, this.roughnessBlendLevel), Ye.BindTextureMatrix(this._texture, e, "detail")), t.texturesEnabled && this._texture && Dt.DetailTextureEnabled && e.setTexture("detailSampler", this._texture);
  }
  hasTexture(e) {
    return this._texture === e;
  }
  getActiveTextures(e) {
    this._texture && e.push(this._texture);
  }
  getAnimatables(e) {
    this._texture && this._texture.animations && this._texture.animations.length > 0 && e.push(this._texture);
  }
  dispose(e) {
    var t;
    e && ((t = this._texture) === null || t === void 0 || t.dispose());
  }
  getClassName() {
    return "DetailMapConfiguration";
  }
  getSamplers(e) {
    e.push("detailSampler");
  }
  getUniforms() {
    return {
      ubo: [
        { name: "vDetailInfos", size: 4, type: "vec4" },
        { name: "detailMatrix", size: 16, type: "mat4" }
      ]
    };
  }
}
C([
  en("detailTexture"),
  At("_markAllSubMeshesAsTexturesDirty")
], l4.prototype, "texture", void 0);
C([
  M()
], l4.prototype, "diffuseBlendLevel", void 0);
C([
  M()
], l4.prototype, "roughnessBlendLevel", void 0);
C([
  M()
], l4.prototype, "bumpLevel", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], l4.prototype, "normalBlendMethod", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], l4.prototype, "isEnabled", void 0);
const TE = { effect: null, subMesh: null };
class Kee extends na {
  /**
   * Initializes the Standard Material defines.
   * @param externalProperties The external properties
   */
  constructor(e) {
    super(e), this.MAINUV1 = !1, this.MAINUV2 = !1, this.MAINUV3 = !1, this.MAINUV4 = !1, this.MAINUV5 = !1, this.MAINUV6 = !1, this.DIFFUSE = !1, this.DIFFUSEDIRECTUV = 0, this.BAKED_VERTEX_ANIMATION_TEXTURE = !1, this.AMBIENT = !1, this.AMBIENTDIRECTUV = 0, this.OPACITY = !1, this.OPACITYDIRECTUV = 0, this.OPACITYRGB = !1, this.REFLECTION = !1, this.EMISSIVE = !1, this.EMISSIVEDIRECTUV = 0, this.SPECULAR = !1, this.SPECULARDIRECTUV = 0, this.BUMP = !1, this.BUMPDIRECTUV = 0, this.PARALLAX = !1, this.PARALLAX_RHS = !1, this.PARALLAXOCCLUSION = !1, this.SPECULAROVERALPHA = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.ALPHAFROMDIFFUSE = !1, this.POINTSIZE = !1, this.FOG = !1, this.SPECULARTERM = !1, this.DIFFUSEFRESNEL = !1, this.OPACITYFRESNEL = !1, this.REFLECTIONFRESNEL = !1, this.REFRACTIONFRESNEL = !1, this.EMISSIVEFRESNEL = !1, this.FRESNEL = !1, this.NORMAL = !1, this.TANGENT = !1, this.UV1 = !1, this.UV2 = !1, this.UV3 = !1, this.UV4 = !1, this.UV5 = !1, this.UV6 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.BONETEXTURE = !1, this.BONES_VELOCITY_ENABLED = !1, this.INSTANCES = !1, this.THIN_INSTANCES = !1, this.INSTANCESCOLOR = !1, this.GLOSSINESS = !1, this.ROUGHNESS = !1, this.EMISSIVEASILLUMINATION = !1, this.LINKEMISSIVEWITHDIFFUSE = !1, this.REFLECTIONFRESNELFROMSPECULAR = !1, this.LIGHTMAP = !1, this.LIGHTMAPDIRECTUV = 0, this.OBJECTSPACE_NORMALMAP = !1, this.USELIGHTMAPASSHADOWMAP = !1, this.REFLECTIONMAP_3D = !1, this.REFLECTIONMAP_SPHERICAL = !1, this.REFLECTIONMAP_PLANAR = !1, this.REFLECTIONMAP_CUBIC = !1, this.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, this.USE_LOCAL_REFRACTIONMAP_CUBIC = !1, this.REFLECTIONMAP_PROJECTION = !1, this.REFLECTIONMAP_SKYBOX = !1, this.REFLECTIONMAP_EXPLICIT = !1, this.REFLECTIONMAP_EQUIRECTANGULAR = !1, this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, this.REFLECTIONMAP_OPPOSITEZ = !1, this.INVERTCUBICMAP = !1, this.LOGARITHMICDEPTH = !1, this.REFRACTION = !1, this.REFRACTIONMAP_3D = !1, this.REFLECTIONOVERALPHA = !1, this.TWOSIDEDLIGHTING = !1, this.SHADOWFLOAT = !1, this.MORPHTARGETS = !1, this.MORPHTARGETS_NORMAL = !1, this.MORPHTARGETS_TANGENT = !1, this.MORPHTARGETS_UV = !1, this.NUM_MORPH_INFLUENCERS = 0, this.MORPHTARGETS_TEXTURE = !1, this.NONUNIFORMSCALING = !1, this.PREMULTIPLYALPHA = !1, this.ALPHATEST_AFTERALLALPHACOMPUTATIONS = !1, this.ALPHABLEND = !0, this.PREPASS = !1, this.PREPASS_IRRADIANCE = !1, this.PREPASS_IRRADIANCE_INDEX = -1, this.PREPASS_ALBEDO_SQRT = !1, this.PREPASS_ALBEDO_SQRT_INDEX = -1, this.PREPASS_DEPTH = !1, this.PREPASS_DEPTH_INDEX = -1, this.PREPASS_NORMAL = !1, this.PREPASS_NORMAL_INDEX = -1, this.PREPASS_NORMAL_WORLDSPACE = !1, this.PREPASS_POSITION = !1, this.PREPASS_POSITION_INDEX = -1, this.PREPASS_VELOCITY = !1, this.PREPASS_VELOCITY_INDEX = -1, this.PREPASS_REFLECTIVITY = !1, this.PREPASS_REFLECTIVITY_INDEX = -1, this.SCENE_MRT_COUNT = 0, this.RGBDLIGHTMAP = !1, this.RGBDREFLECTION = !1, this.RGBDREFRACTION = !1, this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.MULTIVIEW = !1, this.ORDER_INDEPENDENT_TRANSPARENCY = !1, this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = !1, this.CAMERA_ORTHOGRAPHIC = !1, this.CAMERA_PERSPECTIVE = !1, this.IS_REFLECTION_LINEAR = !1, this.IS_REFRACTION_LINEAR = !1, this.EXPOSURE = !1, this.DECAL_AFTER_DETAIL = !1, this.rebuild();
  }
  setReflectionMode(e) {
    const t = [
      "REFLECTIONMAP_CUBIC",
      "REFLECTIONMAP_EXPLICIT",
      "REFLECTIONMAP_PLANAR",
      "REFLECTIONMAP_PROJECTION",
      "REFLECTIONMAP_PROJECTION",
      "REFLECTIONMAP_SKYBOX",
      "REFLECTIONMAP_SPHERICAL",
      "REFLECTIONMAP_EQUIRECTANGULAR",
      "REFLECTIONMAP_EQUIRECTANGULAR_FIXED",
      "REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"
    ];
    for (const r of t)
      this[r] = r === e;
  }
}
class Wt extends P1 {
  /**
   * Gets the image processing configuration used either in this material.
   */
  get imageProcessingConfiguration() {
    return this._imageProcessingConfiguration;
  }
  /**
   * Sets the Default image processing configuration used either in the this material.
   *
   * If sets to null, the scene one is in use.
   */
  set imageProcessingConfiguration(e) {
    this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty();
  }
  /**
   * Attaches a new image processing configuration to the Standard Material.
   * @param configuration
   */
  _attachImageProcessingConfiguration(e) {
    e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), e ? this._imageProcessingConfiguration = e : this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
      this._markAllSubMeshesAsImageProcessingDirty();
    })));
  }
  /**
   * Can this material render to prepass
   */
  get isPrePassCapable() {
    return !this.disableDepthWrite;
  }
  /**
   * Gets whether the color curves effect is enabled.
   */
  get cameraColorCurvesEnabled() {
    return this.imageProcessingConfiguration.colorCurvesEnabled;
  }
  /**
   * Sets whether the color curves effect is enabled.
   */
  set cameraColorCurvesEnabled(e) {
    this.imageProcessingConfiguration.colorCurvesEnabled = e;
  }
  /**
   * Gets whether the color grading effect is enabled.
   */
  get cameraColorGradingEnabled() {
    return this.imageProcessingConfiguration.colorGradingEnabled;
  }
  /**
   * Gets whether the color grading effect is enabled.
   */
  set cameraColorGradingEnabled(e) {
    this.imageProcessingConfiguration.colorGradingEnabled = e;
  }
  /**
   * Gets whether tonemapping is enabled or not.
   */
  get cameraToneMappingEnabled() {
    return this._imageProcessingConfiguration.toneMappingEnabled;
  }
  /**
   * Sets whether tonemapping is enabled or not
   */
  set cameraToneMappingEnabled(e) {
    this._imageProcessingConfiguration.toneMappingEnabled = e;
  }
  /**
   * The camera exposure used on this material.
   * This property is here and not in the camera to allow controlling exposure without full screen post process.
   * This corresponds to a photographic exposure.
   */
  get cameraExposure() {
    return this._imageProcessingConfiguration.exposure;
  }
  /**
   * The camera exposure used on this material.
   * This property is here and not in the camera to allow controlling exposure without full screen post process.
   * This corresponds to a photographic exposure.
   */
  set cameraExposure(e) {
    this._imageProcessingConfiguration.exposure = e;
  }
  /**
   * Gets The camera contrast used on this material.
   */
  get cameraContrast() {
    return this._imageProcessingConfiguration.contrast;
  }
  /**
   * Sets The camera contrast used on this material.
   */
  set cameraContrast(e) {
    this._imageProcessingConfiguration.contrast = e;
  }
  /**
   * Gets the Color Grading 2D Lookup Texture.
   */
  get cameraColorGradingTexture() {
    return this._imageProcessingConfiguration.colorGradingTexture;
  }
  /**
   * Sets the Color Grading 2D Lookup Texture.
   */
  set cameraColorGradingTexture(e) {
    this._imageProcessingConfiguration.colorGradingTexture = e;
  }
  /**
   * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT).
   * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
   * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
   * corresponding to low luminance, medium luminance, and high luminance areas respectively.
   */
  get cameraColorCurves() {
    return this._imageProcessingConfiguration.colorCurves;
  }
  /**
   * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
   * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
   * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
   * corresponding to low luminance, medium luminance, and high luminance areas respectively.
   */
  set cameraColorCurves(e) {
    this._imageProcessingConfiguration.colorCurves = e;
  }
  /**
   * Can this material render to several textures at once
   */
  get canRenderToMRT() {
    return !0;
  }
  /**
   * Instantiates a new standard material.
   * This is the default material used in Babylon. It is the best trade off between quality
   * and performances.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
   * @param name Define the name of the material in the scene
   * @param scene Define the scene the material belong to
   */
  constructor(e, t) {
    super(e, t), this._diffuseTexture = null, this._ambientTexture = null, this._opacityTexture = null, this._reflectionTexture = null, this._emissiveTexture = null, this._specularTexture = null, this._bumpTexture = null, this._lightmapTexture = null, this._refractionTexture = null, this.ambientColor = new Ne(0, 0, 0), this.diffuseColor = new Ne(1, 1, 1), this.specularColor = new Ne(1, 1, 1), this.emissiveColor = new Ne(0, 0, 0), this.specularPower = 64, this._useAlphaFromDiffuseTexture = !1, this._useEmissiveAsIllumination = !1, this._linkEmissiveWithDiffuse = !1, this._useSpecularOverAlpha = !1, this._useReflectionOverAlpha = !1, this._disableLighting = !1, this._useObjectSpaceNormalMap = !1, this._useParallax = !1, this._useParallaxOcclusion = !1, this.parallaxScaleBias = 0.05, this._roughness = 0, this.indexOfRefraction = 0.98, this.invertRefractionY = !0, this.alphaCutOff = 0.4, this._useLightmapAsShadowmap = !1, this._useReflectionFresnelFromSpecular = !1, this._useGlossinessFromSpecularMapAlpha = !1, this._maxSimultaneousLights = 4, this._invertNormalMapX = !1, this._invertNormalMapY = !1, this._twoSidedLighting = !1, this._applyDecalMapAfterDetailMap = !1, this._renderTargets = new qf(16), this._worldViewProjectionMatrix = he.Zero(), this._globalAmbientColor = new Ne(0, 0, 0), this._cacheHasRenderTargetTextures = !1, this.detailMap = new l4(this), this._attachImageProcessingConfiguration(null), this.prePassConfiguration = new GC(), this.getRenderTargetTextures = () => (this._renderTargets.reset(), Wt.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._renderTargets.push(this._reflectionTexture), Wt.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget && this._renderTargets.push(this._refractionTexture), this._eventInfo.renderTargets = this._renderTargets, this._callbackPluginEventFillRenderTargetTextures(this._eventInfo), this._renderTargets);
  }
  /**
   * Gets a boolean indicating that current material needs to register RTT
   */
  get hasRenderTargetTextures() {
    return Wt.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget || Wt.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget ? !0 : this._cacheHasRenderTargetTextures;
  }
  /**
   * Gets the current class name of the material e.g. "StandardMaterial"
   * Mainly use in serialization.
   * @returns the class name
   */
  getClassName() {
    return "StandardMaterial";
  }
  /**
   * Specifies if the material will require alpha blending
   * @returns a boolean specifying if alpha blending is needed
   */
  needAlphaBlending() {
    return this._disableAlphaBlending ? !1 : this.alpha < 1 || this._opacityTexture != null || this._shouldUseAlphaFromDiffuseTexture() || this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled;
  }
  /**
   * Specifies if this material should be rendered in alpha test mode
   * @returns a boolean specifying if an alpha test is needed.
   */
  needAlphaTesting() {
    return this._forceAlphaTest ? !0 : this._hasAlphaChannel() && (this._transparencyMode == null || this._transparencyMode === gt.MATERIAL_ALPHATEST);
  }
  /**
   * Specifies whether or not the alpha value of the diffuse texture should be used for alpha blending.
   */
  _shouldUseAlphaFromDiffuseTexture() {
    return this._diffuseTexture != null && this._diffuseTexture.hasAlpha && this._useAlphaFromDiffuseTexture && this._transparencyMode !== gt.MATERIAL_OPAQUE;
  }
  /**
   * Specifies whether or not there is a usable alpha channel for transparency.
   */
  _hasAlphaChannel() {
    return this._diffuseTexture != null && this._diffuseTexture.hasAlpha || this._opacityTexture != null;
  }
  /**
   * Get the texture used for alpha test purpose.
   * @returns the diffuse texture in case of the standard material.
   */
  getAlphaTestTexture() {
    return this._diffuseTexture;
  }
  /**
   * Get if the submesh is ready to be used and all its information available.
   * Child classes can use it to update shaders
   * @param mesh defines the mesh to check
   * @param subMesh defines which submesh to check
   * @param useInstances specifies that instances should be used
   * @returns a boolean indicating that the submesh is ready or not
   */
  isReadyForSubMesh(e, t, r = !1) {
    if (this._uniformBufferLayoutBuilt || this.buildUniformLayout(), t.effect && this.isFrozen && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (this._callbackPluginEventGeneric(x6.GetDefineNames, this._eventInfo), t.materialDefines = new Kee(this._eventInfo.defineNames));
    const n = this.getScene(), i = t.materialDefines;
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = n.getEngine();
    i._needNormals = Ye.PrepareDefinesForLights(n, e, i, !0, this._maxSimultaneousLights, this._disableLighting), Ye.PrepareDefinesForMultiview(n, i);
    const a = this.needAlphaBlendingForMesh(e) && this.getScene().useOrderIndependentTransparency;
    if (Ye.PrepareDefinesForPrePass(n, i, this.canRenderToMRT && !a), Ye.PrepareDefinesForOIT(n, i, a), i._areTexturesDirty) {
      this._eventInfo.hasRenderTargetTextures = !1, this._callbackPluginEventHasRenderTargetTextures(this._eventInfo), this._cacheHasRenderTargetTextures = this._eventInfo.hasRenderTargetTextures, i._needUVs = !1;
      for (let o = 1; o <= 6; ++o)
        i["MAINUV" + o] = !1;
      if (n.texturesEnabled) {
        if (i.DIFFUSEDIRECTUV = 0, i.BUMPDIRECTUV = 0, i.AMBIENTDIRECTUV = 0, i.OPACITYDIRECTUV = 0, i.EMISSIVEDIRECTUV = 0, i.SPECULARDIRECTUV = 0, i.LIGHTMAPDIRECTUV = 0, this._diffuseTexture && Wt.DiffuseTextureEnabled)
          if (this._diffuseTexture.isReadyOrNotBlocking())
            Ye.PrepareDefinesForMergedUV(this._diffuseTexture, i, "DIFFUSE");
          else
            return !1;
        else
          i.DIFFUSE = !1;
        if (this._ambientTexture && Wt.AmbientTextureEnabled)
          if (this._ambientTexture.isReadyOrNotBlocking())
            Ye.PrepareDefinesForMergedUV(this._ambientTexture, i, "AMBIENT");
          else
            return !1;
        else
          i.AMBIENT = !1;
        if (this._opacityTexture && Wt.OpacityTextureEnabled)
          if (this._opacityTexture.isReadyOrNotBlocking())
            Ye.PrepareDefinesForMergedUV(this._opacityTexture, i, "OPACITY"), i.OPACITYRGB = this._opacityTexture.getAlphaFromRGB;
          else
            return !1;
        else
          i.OPACITY = !1;
        if (this._reflectionTexture && Wt.ReflectionTextureEnabled)
          if (this._reflectionTexture.isReadyOrNotBlocking()) {
            switch (i._needNormals = !0, i.REFLECTION = !0, i.ROUGHNESS = this._roughness > 0, i.REFLECTIONOVERALPHA = this._useReflectionOverAlpha, i.INVERTCUBICMAP = this._reflectionTexture.coordinatesMode === We.INVCUBIC_MODE, i.REFLECTIONMAP_3D = this._reflectionTexture.isCube, i.REFLECTIONMAP_OPPOSITEZ = i.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !this._reflectionTexture.invertZ : this._reflectionTexture.invertZ, i.RGBDREFLECTION = this._reflectionTexture.isRGBD, this._reflectionTexture.coordinatesMode) {
              case We.EXPLICIT_MODE:
                i.setReflectionMode("REFLECTIONMAP_EXPLICIT");
                break;
              case We.PLANAR_MODE:
                i.setReflectionMode("REFLECTIONMAP_PLANAR");
                break;
              case We.PROJECTION_MODE:
                i.setReflectionMode("REFLECTIONMAP_PROJECTION");
                break;
              case We.SKYBOX_MODE:
                i.setReflectionMode("REFLECTIONMAP_SKYBOX");
                break;
              case We.SPHERICAL_MODE:
                i.setReflectionMode("REFLECTIONMAP_SPHERICAL");
                break;
              case We.EQUIRECTANGULAR_MODE:
                i.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");
                break;
              case We.FIXED_EQUIRECTANGULAR_MODE:
                i.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");
                break;
              case We.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
                i.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");
                break;
              case We.CUBIC_MODE:
              case We.INVCUBIC_MODE:
              default:
                i.setReflectionMode("REFLECTIONMAP_CUBIC");
                break;
            }
            i.USE_LOCAL_REFLECTIONMAP_CUBIC = !!this._reflectionTexture.boundingBoxSize;
          } else
            return !1;
        else
          i.REFLECTION = !1, i.REFLECTIONMAP_OPPOSITEZ = !1;
        if (this._emissiveTexture && Wt.EmissiveTextureEnabled)
          if (this._emissiveTexture.isReadyOrNotBlocking())
            Ye.PrepareDefinesForMergedUV(this._emissiveTexture, i, "EMISSIVE");
          else
            return !1;
        else
          i.EMISSIVE = !1;
        if (this._lightmapTexture && Wt.LightmapTextureEnabled)
          if (this._lightmapTexture.isReadyOrNotBlocking())
            Ye.PrepareDefinesForMergedUV(this._lightmapTexture, i, "LIGHTMAP"), i.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap, i.RGBDLIGHTMAP = this._lightmapTexture.isRGBD;
          else
            return !1;
        else
          i.LIGHTMAP = !1;
        if (this._specularTexture && Wt.SpecularTextureEnabled)
          if (this._specularTexture.isReadyOrNotBlocking())
            Ye.PrepareDefinesForMergedUV(this._specularTexture, i, "SPECULAR"), i.GLOSSINESS = this._useGlossinessFromSpecularMapAlpha;
          else
            return !1;
        else
          i.SPECULAR = !1;
        if (n.getEngine().getCaps().standardDerivatives && this._bumpTexture && Wt.BumpTextureEnabled) {
          if (this._bumpTexture.isReady())
            Ye.PrepareDefinesForMergedUV(this._bumpTexture, i, "BUMP"), i.PARALLAX = this._useParallax, i.PARALLAX_RHS = n.useRightHandedSystem, i.PARALLAXOCCLUSION = this._useParallaxOcclusion;
          else
            return !1;
          i.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap;
        } else
          i.BUMP = !1, i.PARALLAX = !1, i.PARALLAX_RHS = !1, i.PARALLAXOCCLUSION = !1;
        if (this._refractionTexture && Wt.RefractionTextureEnabled)
          if (this._refractionTexture.isReadyOrNotBlocking())
            i._needUVs = !0, i.REFRACTION = !0, i.REFRACTIONMAP_3D = this._refractionTexture.isCube, i.RGBDREFRACTION = this._refractionTexture.isRGBD, i.USE_LOCAL_REFRACTIONMAP_CUBIC = !!this._refractionTexture.boundingBoxSize;
          else
            return !1;
        else
          i.REFRACTION = !1;
        i.TWOSIDEDLIGHTING = !this._backFaceCulling && this._twoSidedLighting;
      } else
        i.DIFFUSE = !1, i.AMBIENT = !1, i.OPACITY = !1, i.REFLECTION = !1, i.EMISSIVE = !1, i.LIGHTMAP = !1, i.BUMP = !1, i.REFRACTION = !1;
      i.ALPHAFROMDIFFUSE = this._shouldUseAlphaFromDiffuseTexture(), i.EMISSIVEASILLUMINATION = this._useEmissiveAsIllumination, i.LINKEMISSIVEWITHDIFFUSE = this._linkEmissiveWithDiffuse, i.SPECULAROVERALPHA = this._useSpecularOverAlpha, i.PREMULTIPLYALPHA = this.alphaMode === 7 || this.alphaMode === 8, i.ALPHATEST_AFTERALLALPHACOMPUTATIONS = this.transparencyMode !== null, i.ALPHABLEND = this.transparencyMode === null || this.needAlphaBlendingForMesh(e);
    }
    if (this._eventInfo.isReadyForSubMesh = !0, this._eventInfo.defines = i, this._eventInfo.subMesh = t, this._callbackPluginEventIsReadyForSubMesh(this._eventInfo), !this._eventInfo.isReadyForSubMesh)
      return !1;
    if (i._areImageProcessingDirty && this._imageProcessingConfiguration) {
      if (!this._imageProcessingConfiguration.isReady())
        return !1;
      this._imageProcessingConfiguration.prepareDefines(i), i.IS_REFLECTION_LINEAR = this.reflectionTexture != null && !this.reflectionTexture.gammaSpace, i.IS_REFRACTION_LINEAR = this.refractionTexture != null && !this.refractionTexture.gammaSpace;
    }
    i._areFresnelDirty && (Wt.FresnelEnabled ? (this._diffuseFresnelParameters || this._opacityFresnelParameters || this._emissiveFresnelParameters || this._refractionFresnelParameters || this._reflectionFresnelParameters) && (i.DIFFUSEFRESNEL = this._diffuseFresnelParameters && this._diffuseFresnelParameters.isEnabled, i.OPACITYFRESNEL = this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled, i.REFLECTIONFRESNEL = this._reflectionFresnelParameters && this._reflectionFresnelParameters.isEnabled, i.REFLECTIONFRESNELFROMSPECULAR = this._useReflectionFresnelFromSpecular, i.REFRACTIONFRESNEL = this._refractionFresnelParameters && this._refractionFresnelParameters.isEnabled, i.EMISSIVEFRESNEL = this._emissiveFresnelParameters && this._emissiveFresnelParameters.isEnabled, i._needNormals = !0, i.FRESNEL = !0) : i.FRESNEL = !1), Ye.PrepareDefinesForMisc(e, n, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e) || this._forceAlphaTest, i, this._applyDecalMapAfterDetailMap), Ye.PrepareDefinesForFrameBoundValues(n, s, this, i, r, null, t.getRenderingMesh().hasThinInstances), this._eventInfo.defines = i, this._eventInfo.mesh = e, this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo), Ye.PrepareDefinesForAttributes(e, i, !0, !0, !0), this._callbackPluginEventPrepareDefines(this._eventInfo);
    let f = !1;
    if (i.isDirty) {
      const o = i._areLightsDisposed;
      i.markAsProcessed();
      const d = new c1();
      i.REFLECTION && d.addFallback(0, "REFLECTION"), i.SPECULAR && d.addFallback(0, "SPECULAR"), i.BUMP && d.addFallback(0, "BUMP"), i.PARALLAX && d.addFallback(1, "PARALLAX"), i.PARALLAX_RHS && d.addFallback(1, "PARALLAX_RHS"), i.PARALLAXOCCLUSION && d.addFallback(0, "PARALLAXOCCLUSION"), i.SPECULAROVERALPHA && d.addFallback(0, "SPECULAROVERALPHA"), i.FOG && d.addFallback(1, "FOG"), i.POINTSIZE && d.addFallback(0, "POINTSIZE"), i.LOGARITHMICDEPTH && d.addFallback(0, "LOGARITHMICDEPTH"), Ye.HandleFallbacksForShadows(i, d, this._maxSimultaneousLights), i.SPECULARTERM && d.addFallback(0, "SPECULARTERM"), i.DIFFUSEFRESNEL && d.addFallback(1, "DIFFUSEFRESNEL"), i.OPACITYFRESNEL && d.addFallback(2, "OPACITYFRESNEL"), i.REFLECTIONFRESNEL && d.addFallback(3, "REFLECTIONFRESNEL"), i.EMISSIVEFRESNEL && d.addFallback(4, "EMISSIVEFRESNEL"), i.FRESNEL && d.addFallback(4, "FRESNEL"), i.MULTIVIEW && d.addFallback(0, "MULTIVIEW");
      const v = [J.PositionKind];
      i.NORMAL && v.push(J.NormalKind), i.TANGENT && v.push(J.TangentKind);
      for (let j = 1; j <= 6; ++j)
        i["UV" + j] && v.push(`uv${j === 1 ? "" : j}`);
      i.VERTEXCOLOR && v.push(J.ColorKind), Ye.PrepareAttributesForBones(v, e, i, d), Ye.PrepareAttributesForInstances(v, i), Ye.PrepareAttributesForMorphTargets(v, e, i), Ye.PrepareAttributesForBakedVertexAnimation(v, e, i);
      let u = "default";
      const l = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vAmbientColor",
        "vDiffuseColor",
        "vSpecularColor",
        "vEmissiveColor",
        "visibility",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "vDiffuseInfos",
        "vAmbientInfos",
        "vOpacityInfos",
        "vReflectionInfos",
        "vEmissiveInfos",
        "vSpecularInfos",
        "vBumpInfos",
        "vLightmapInfos",
        "vRefractionInfos",
        "mBones",
        "diffuseMatrix",
        "ambientMatrix",
        "opacityMatrix",
        "reflectionMatrix",
        "emissiveMatrix",
        "specularMatrix",
        "bumpMatrix",
        "normalMatrix",
        "lightmapMatrix",
        "refractionMatrix",
        "diffuseLeftColor",
        "diffuseRightColor",
        "opacityParts",
        "reflectionLeftColor",
        "reflectionRightColor",
        "emissiveLeftColor",
        "emissiveRightColor",
        "refractionLeftColor",
        "refractionRightColor",
        "vReflectionPosition",
        "vReflectionSize",
        "vRefractionPosition",
        "vRefractionSize",
        "logarithmicDepthConstant",
        "vTangentSpaceParams",
        "alphaCutOff",
        "boneTextureWidth",
        "morphTargetTextureInfo",
        "morphTargetTextureIndices"
      ], P = [
        "diffuseSampler",
        "ambientSampler",
        "opacitySampler",
        "reflectionCubeSampler",
        "reflection2DSampler",
        "emissiveSampler",
        "specularSampler",
        "bumpSampler",
        "lightmapSampler",
        "refractionCubeSampler",
        "refraction2DSampler",
        "boneSampler",
        "morphTargets",
        "oitDepthSampler",
        "oitFrontColorSampler"
      ], p = ["Material", "Scene", "Mesh"], c = { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: i.NUM_MORPH_INFLUENCERS };
      this._eventInfo.fallbacks = d, this._eventInfo.fallbackRank = 0, this._eventInfo.defines = i, this._eventInfo.uniforms = l, this._eventInfo.attributes = v, this._eventInfo.samplers = P, this._eventInfo.uniformBuffersNames = p, this._eventInfo.customCode = void 0, this._eventInfo.mesh = e, this._eventInfo.indexParameters = c, this._callbackPluginEventGeneric(x6.PrepareEffect, this._eventInfo), GC.AddUniforms(l), Ui && (Ui.PrepareUniforms(l, i), Ui.PrepareSamplers(P, i)), Ye.PrepareUniformsAndSamplersList({
        uniformsNames: l,
        uniformBuffersNames: p,
        samplers: P,
        defines: i,
        maxSimultaneousLights: this._maxSimultaneousLights
      }), Mf(l);
      const H = {};
      this.customShaderNameResolve && (u = this.customShaderNameResolve(u, l, p, P, i, v, H));
      const T = i.toString(), q = t.effect;
      let b = n.getEngine().createEffect(u, {
        attributes: v,
        uniformsNames: l,
        uniformBuffersNames: p,
        samplers: P,
        defines: T,
        fallbacks: d,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: c,
        processFinalCode: H.processFinalCode,
        processCodeAfterIncludes: this._eventInfo.customCode,
        multiTarget: i.PREPASS
      }, s);
      if (this._eventInfo.customCode = void 0, b)
        if (this._onEffectCreatedObservable && (TE.effect = b, TE.subMesh = t, this._onEffectCreatedObservable.notifyObservers(TE)), this.allowShaderHotSwapping && q && !b.isReady()) {
          if (b = q, i.markAsUnprocessed(), f = this.isFrozen, o)
            return i._areLightsDisposed = !0, !1;
        } else
          n.resetCachedMaterial(), t.setEffect(b, i, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (i._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !f, t.effect._wasPreviouslyUsingInstances = r, this._checkScenePerformancePriority(), !0);
  }
  /**
   * Builds the material UBO layouts.
   * Used internally during the effect preparation.
   */
  buildUniformLayout() {
    const e = this._uniformBuffer;
    e.addUniform("diffuseLeftColor", 4), e.addUniform("diffuseRightColor", 4), e.addUniform("opacityParts", 4), e.addUniform("reflectionLeftColor", 4), e.addUniform("reflectionRightColor", 4), e.addUniform("refractionLeftColor", 4), e.addUniform("refractionRightColor", 4), e.addUniform("emissiveLeftColor", 4), e.addUniform("emissiveRightColor", 4), e.addUniform("vDiffuseInfos", 2), e.addUniform("vAmbientInfos", 2), e.addUniform("vOpacityInfos", 2), e.addUniform("vReflectionInfos", 2), e.addUniform("vReflectionPosition", 3), e.addUniform("vReflectionSize", 3), e.addUniform("vEmissiveInfos", 2), e.addUniform("vLightmapInfos", 2), e.addUniform("vSpecularInfos", 2), e.addUniform("vBumpInfos", 3), e.addUniform("diffuseMatrix", 16), e.addUniform("ambientMatrix", 16), e.addUniform("opacityMatrix", 16), e.addUniform("reflectionMatrix", 16), e.addUniform("emissiveMatrix", 16), e.addUniform("lightmapMatrix", 16), e.addUniform("specularMatrix", 16), e.addUniform("bumpMatrix", 16), e.addUniform("vTangentSpaceParams", 2), e.addUniform("pointSize", 1), e.addUniform("alphaCutOff", 1), e.addUniform("refractionMatrix", 16), e.addUniform("vRefractionInfos", 4), e.addUniform("vRefractionPosition", 3), e.addUniform("vRefractionSize", 3), e.addUniform("vSpecularColor", 4), e.addUniform("vEmissiveColor", 3), e.addUniform("vDiffuseColor", 4), e.addUniform("vAmbientColor", 3), super.buildUniformLayout();
  }
  /**
   * Binds the submesh to this material by preparing the effect and shader to draw
   * @param world defines the world transformation matrix
   * @param mesh defines the mesh containing the submesh
   * @param subMesh defines the submesh to bind the material to
   */
  bindForSubMesh(e, t, r) {
    var n;
    const i = this.getScene(), s = r.materialDefines;
    if (!s)
      return;
    const a = r.effect;
    if (!a)
      return;
    this._activeEffect = a, t.getMeshUniformBuffer().bindToEffect(a, "Mesh"), t.transferToEffect(e), this._uniformBuffer.bindToEffect(a, "Material"), this.prePassConfiguration.bindForSubMesh(this._activeEffect, i, t, e, this.isFrozen), this._eventInfo.subMesh = r, this._callbackPluginEventHardBindForSubMesh(this._eventInfo), s.OBJECTSPACE_NORMALMAP && (e.toNormalMatrix(this._normalMatrix), this.bindOnlyNormalMatrix(this._normalMatrix));
    const f = a._forceRebindOnNextCall || this._mustRebind(i, a, t.visibility);
    Ye.BindBonesParameters(t, a);
    const o = this._uniformBuffer;
    if (f) {
      if (this.bindViewProjection(a), !o.useUbo || !this.isFrozen || !o.isSync || a._forceRebindOnNextCall) {
        if (Wt.FresnelEnabled && s.FRESNEL && (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled && (o.updateColor4("diffuseLeftColor", this.diffuseFresnelParameters.leftColor, this.diffuseFresnelParameters.power), o.updateColor4("diffuseRightColor", this.diffuseFresnelParameters.rightColor, this.diffuseFresnelParameters.bias)), this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled && o.updateColor4("opacityParts", new Ne(this.opacityFresnelParameters.leftColor.toLuminance(), this.opacityFresnelParameters.rightColor.toLuminance(), this.opacityFresnelParameters.bias), this.opacityFresnelParameters.power), this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled && (o.updateColor4("reflectionLeftColor", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power), o.updateColor4("reflectionRightColor", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias)), this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled && (o.updateColor4("refractionLeftColor", this.refractionFresnelParameters.leftColor, this.refractionFresnelParameters.power), o.updateColor4("refractionRightColor", this.refractionFresnelParameters.rightColor, this.refractionFresnelParameters.bias)), this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled && (o.updateColor4("emissiveLeftColor", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power), o.updateColor4("emissiveRightColor", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias))), i.texturesEnabled) {
          if (this._diffuseTexture && Wt.DiffuseTextureEnabled && (o.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), Ye.BindTextureMatrix(this._diffuseTexture, o, "diffuse")), this._ambientTexture && Wt.AmbientTextureEnabled && (o.updateFloat2("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level), Ye.BindTextureMatrix(this._ambientTexture, o, "ambient")), this._opacityTexture && Wt.OpacityTextureEnabled && (o.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), Ye.BindTextureMatrix(this._opacityTexture, o, "opacity")), this._hasAlphaChannel() && o.updateFloat("alphaCutOff", this.alphaCutOff), this._reflectionTexture && Wt.ReflectionTextureEnabled && (o.updateFloat2("vReflectionInfos", this._reflectionTexture.level, this.roughness), o.updateMatrix("reflectionMatrix", this._reflectionTexture.getReflectionTextureMatrix()), this._reflectionTexture.boundingBoxSize)) {
            const d = this._reflectionTexture;
            o.updateVector3("vReflectionPosition", d.boundingBoxPosition), o.updateVector3("vReflectionSize", d.boundingBoxSize);
          }
          if (this._emissiveTexture && Wt.EmissiveTextureEnabled && (o.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level), Ye.BindTextureMatrix(this._emissiveTexture, o, "emissive")), this._lightmapTexture && Wt.LightmapTextureEnabled && (o.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level), Ye.BindTextureMatrix(this._lightmapTexture, o, "lightmap")), this._specularTexture && Wt.SpecularTextureEnabled && (o.updateFloat2("vSpecularInfos", this._specularTexture.coordinatesIndex, this._specularTexture.level), Ye.BindTextureMatrix(this._specularTexture, o, "specular")), this._bumpTexture && i.getEngine().getCaps().standardDerivatives && Wt.BumpTextureEnabled && (o.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, 1 / this._bumpTexture.level, this.parallaxScaleBias), Ye.BindTextureMatrix(this._bumpTexture, o, "bump"), i._mirroredCameraPosition ? o.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1 : -1, this._invertNormalMapY ? 1 : -1) : o.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1 : 1, this._invertNormalMapY ? -1 : 1)), this._refractionTexture && Wt.RefractionTextureEnabled) {
            let d = 1;
            if (this._refractionTexture.isCube || (o.updateMatrix("refractionMatrix", this._refractionTexture.getReflectionTextureMatrix()), this._refractionTexture.depth && (d = this._refractionTexture.depth)), o.updateFloat4("vRefractionInfos", this._refractionTexture.level, this.indexOfRefraction, d, this.invertRefractionY ? -1 : 1), this._refractionTexture.boundingBoxSize) {
              const v = this._refractionTexture;
              o.updateVector3("vRefractionPosition", v.boundingBoxPosition), o.updateVector3("vRefractionSize", v.boundingBoxSize);
            }
          }
        }
        this.pointsCloud && o.updateFloat("pointSize", this.pointSize), s.SPECULARTERM && o.updateColor4("vSpecularColor", this.specularColor, this.specularPower), o.updateColor3("vEmissiveColor", Wt.EmissiveTextureEnabled ? this.emissiveColor : Ne.BlackReadOnly), o.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha), i.ambientColor.multiplyToRef(this.ambientColor, this._globalAmbientColor), o.updateColor3("vAmbientColor", this._globalAmbientColor);
      }
      i.texturesEnabled && (this._diffuseTexture && Wt.DiffuseTextureEnabled && a.setTexture("diffuseSampler", this._diffuseTexture), this._ambientTexture && Wt.AmbientTextureEnabled && a.setTexture("ambientSampler", this._ambientTexture), this._opacityTexture && Wt.OpacityTextureEnabled && a.setTexture("opacitySampler", this._opacityTexture), this._reflectionTexture && Wt.ReflectionTextureEnabled && (this._reflectionTexture.isCube ? a.setTexture("reflectionCubeSampler", this._reflectionTexture) : a.setTexture("reflection2DSampler", this._reflectionTexture)), this._emissiveTexture && Wt.EmissiveTextureEnabled && a.setTexture("emissiveSampler", this._emissiveTexture), this._lightmapTexture && Wt.LightmapTextureEnabled && a.setTexture("lightmapSampler", this._lightmapTexture), this._specularTexture && Wt.SpecularTextureEnabled && a.setTexture("specularSampler", this._specularTexture), this._bumpTexture && i.getEngine().getCaps().standardDerivatives && Wt.BumpTextureEnabled && a.setTexture("bumpSampler", this._bumpTexture), this._refractionTexture && Wt.RefractionTextureEnabled && (this._refractionTexture.isCube ? a.setTexture("refractionCubeSampler", this._refractionTexture) : a.setTexture("refraction2DSampler", this._refractionTexture))), this.getScene().useOrderIndependentTransparency && this.needAlphaBlendingForMesh(t) && this.getScene().depthPeelingRenderer.bind(a), this._eventInfo.subMesh = r, this._callbackPluginEventBindForSubMesh(this._eventInfo), Df(a, this, i), this.bindEyePosition(a);
    } else
      i.getEngine()._features.needToAlwaysBindUniformBuffers && (this._needToBindSceneUbo = !0);
    (f || !this.isFrozen) && (i.lightsEnabled && !this._disableLighting && Ye.BindLights(i, t, a, s, this._maxSimultaneousLights), (i.fogEnabled && t.applyFog && i.fogMode !== sr.FOGMODE_NONE || this._reflectionTexture || this._refractionTexture || t.receiveShadows || s.PREPASS) && this.bindView(a), Ye.BindFogParameters(i, t, a), s.NUM_MORPH_INFLUENCERS && Ye.BindMorphTargetParameters(t, a), s.BAKED_VERTEX_ANIMATION_TEXTURE && ((n = t.bakedVertexAnimationManager) === null || n === void 0 || n.bind(a, s.INSTANCES)), this.useLogarithmicDepth && Ye.BindLogDepth(s, a, i), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(this._activeEffect)), this._afterBind(t, this._activeEffect), o.update();
  }
  /**
   * Get the list of animatables in the material.
   * @returns the list of animatables object used in the material
   */
  getAnimatables() {
    const e = super.getAnimatables();
    return this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0 && e.push(this._diffuseTexture), this._ambientTexture && this._ambientTexture.animations && this._ambientTexture.animations.length > 0 && e.push(this._ambientTexture), this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0 && e.push(this._opacityTexture), this._reflectionTexture && this._reflectionTexture.animations && this._reflectionTexture.animations.length > 0 && e.push(this._reflectionTexture), this._emissiveTexture && this._emissiveTexture.animations && this._emissiveTexture.animations.length > 0 && e.push(this._emissiveTexture), this._specularTexture && this._specularTexture.animations && this._specularTexture.animations.length > 0 && e.push(this._specularTexture), this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0 && e.push(this._bumpTexture), this._lightmapTexture && this._lightmapTexture.animations && this._lightmapTexture.animations.length > 0 && e.push(this._lightmapTexture), this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0 && e.push(this._refractionTexture), e;
  }
  /**
   * Gets the active textures from the material
   * @returns an array of textures
   */
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._diffuseTexture && e.push(this._diffuseTexture), this._ambientTexture && e.push(this._ambientTexture), this._opacityTexture && e.push(this._opacityTexture), this._reflectionTexture && e.push(this._reflectionTexture), this._emissiveTexture && e.push(this._emissiveTexture), this._specularTexture && e.push(this._specularTexture), this._bumpTexture && e.push(this._bumpTexture), this._lightmapTexture && e.push(this._lightmapTexture), this._refractionTexture && e.push(this._refractionTexture), e;
  }
  /**
   * Specifies if the material uses a texture
   * @param texture defines the texture to check against the material
   * @returns a boolean specifying if the material uses the texture
   */
  hasTexture(e) {
    return !!(super.hasTexture(e) || this._diffuseTexture === e || this._ambientTexture === e || this._opacityTexture === e || this._reflectionTexture === e || this._emissiveTexture === e || this._specularTexture === e || this._bumpTexture === e || this._lightmapTexture === e || this._refractionTexture === e);
  }
  /**
   * Disposes the material
   * @param forceDisposeEffect specifies if effects should be forcefully disposed
   * @param forceDisposeTextures specifies if textures should be forcefully disposed
   */
  dispose(e, t) {
    var r, n, i, s, a, f, o, d, v;
    t && ((r = this._diffuseTexture) === null || r === void 0 || r.dispose(), (n = this._ambientTexture) === null || n === void 0 || n.dispose(), (i = this._opacityTexture) === null || i === void 0 || i.dispose(), (s = this._reflectionTexture) === null || s === void 0 || s.dispose(), (a = this._emissiveTexture) === null || a === void 0 || a.dispose(), (f = this._specularTexture) === null || f === void 0 || f.dispose(), (o = this._bumpTexture) === null || o === void 0 || o.dispose(), (d = this._lightmapTexture) === null || d === void 0 || d.dispose(), (v = this._refractionTexture) === null || v === void 0 || v.dispose()), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), super.dispose(e, t);
  }
  /**
   * Makes a duplicate of the material, and gives it a new name
   * @param name defines the new name for the duplicated material
   * @param cloneTexturesOnlyOnce - if a texture is used in more than one channel (e.g diffuse and opacity), only clone it once and reuse it on the other channels. Default false.
   * @param rootUrl defines the root URL to use to load textures
   * @returns the cloned material
   */
  clone(e, t = !0, r = "") {
    const n = jt.Clone(() => new Wt(e, this.getScene()), this, { cloneTexturesOnlyOnce: t });
    return n.name = e, n.id = e, this.stencil.copyTo(n.stencil), this._clonePlugins(n, r), n;
  }
  /**
   * Creates a standard material from parsed material data
   * @param source defines the JSON representation of the material
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a new standard material
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => new Wt(e.name, t), e, t, r);
    return e.stencil && n.stencil.parse(e.stencil, t, r), gt._parsePlugins(e, n, t, r), n;
  }
  // Flags used to enable or disable a type of texture for all Standard Materials
  /**
   * Are diffuse textures enabled in the application.
   */
  static get DiffuseTextureEnabled() {
    return Dt.DiffuseTextureEnabled;
  }
  static set DiffuseTextureEnabled(e) {
    Dt.DiffuseTextureEnabled = e;
  }
  /**
   * Are detail textures enabled in the application.
   */
  static get DetailTextureEnabled() {
    return Dt.DetailTextureEnabled;
  }
  static set DetailTextureEnabled(e) {
    Dt.DetailTextureEnabled = e;
  }
  /**
   * Are ambient textures enabled in the application.
   */
  static get AmbientTextureEnabled() {
    return Dt.AmbientTextureEnabled;
  }
  static set AmbientTextureEnabled(e) {
    Dt.AmbientTextureEnabled = e;
  }
  /**
   * Are opacity textures enabled in the application.
   */
  static get OpacityTextureEnabled() {
    return Dt.OpacityTextureEnabled;
  }
  static set OpacityTextureEnabled(e) {
    Dt.OpacityTextureEnabled = e;
  }
  /**
   * Are reflection textures enabled in the application.
   */
  static get ReflectionTextureEnabled() {
    return Dt.ReflectionTextureEnabled;
  }
  static set ReflectionTextureEnabled(e) {
    Dt.ReflectionTextureEnabled = e;
  }
  /**
   * Are emissive textures enabled in the application.
   */
  static get EmissiveTextureEnabled() {
    return Dt.EmissiveTextureEnabled;
  }
  static set EmissiveTextureEnabled(e) {
    Dt.EmissiveTextureEnabled = e;
  }
  /**
   * Are specular textures enabled in the application.
   */
  static get SpecularTextureEnabled() {
    return Dt.SpecularTextureEnabled;
  }
  static set SpecularTextureEnabled(e) {
    Dt.SpecularTextureEnabled = e;
  }
  /**
   * Are bump textures enabled in the application.
   */
  static get BumpTextureEnabled() {
    return Dt.BumpTextureEnabled;
  }
  static set BumpTextureEnabled(e) {
    Dt.BumpTextureEnabled = e;
  }
  /**
   * Are lightmap textures enabled in the application.
   */
  static get LightmapTextureEnabled() {
    return Dt.LightmapTextureEnabled;
  }
  static set LightmapTextureEnabled(e) {
    Dt.LightmapTextureEnabled = e;
  }
  /**
   * Are refraction textures enabled in the application.
   */
  static get RefractionTextureEnabled() {
    return Dt.RefractionTextureEnabled;
  }
  static set RefractionTextureEnabled(e) {
    Dt.RefractionTextureEnabled = e;
  }
  /**
   * Are color grading textures enabled in the application.
   */
  static get ColorGradingTextureEnabled() {
    return Dt.ColorGradingTextureEnabled;
  }
  static set ColorGradingTextureEnabled(e) {
    Dt.ColorGradingTextureEnabled = e;
  }
  /**
   * Are fresnels enabled in the application.
   */
  static get FresnelEnabled() {
    return Dt.FresnelEnabled;
  }
  static set FresnelEnabled(e) {
    Dt.FresnelEnabled = e;
  }
}
C([
  en("diffuseTexture")
], Wt.prototype, "_diffuseTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesAndMiscDirty")
], Wt.prototype, "diffuseTexture", void 0);
C([
  en("ambientTexture")
], Wt.prototype, "_ambientTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "ambientTexture", void 0);
C([
  en("opacityTexture")
], Wt.prototype, "_opacityTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesAndMiscDirty")
], Wt.prototype, "opacityTexture", void 0);
C([
  en("reflectionTexture")
], Wt.prototype, "_reflectionTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "reflectionTexture", void 0);
C([
  en("emissiveTexture")
], Wt.prototype, "_emissiveTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "emissiveTexture", void 0);
C([
  en("specularTexture")
], Wt.prototype, "_specularTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "specularTexture", void 0);
C([
  en("bumpTexture")
], Wt.prototype, "_bumpTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "bumpTexture", void 0);
C([
  en("lightmapTexture")
], Wt.prototype, "_lightmapTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "lightmapTexture", void 0);
C([
  en("refractionTexture")
], Wt.prototype, "_refractionTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "refractionTexture", void 0);
C([
  Oi("ambient")
], Wt.prototype, "ambientColor", void 0);
C([
  Oi("diffuse")
], Wt.prototype, "diffuseColor", void 0);
C([
  Oi("specular")
], Wt.prototype, "specularColor", void 0);
C([
  Oi("emissive")
], Wt.prototype, "emissiveColor", void 0);
C([
  M()
], Wt.prototype, "specularPower", void 0);
C([
  M("useAlphaFromDiffuseTexture")
], Wt.prototype, "_useAlphaFromDiffuseTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesAndMiscDirty")
], Wt.prototype, "useAlphaFromDiffuseTexture", void 0);
C([
  M("useEmissiveAsIllumination")
], Wt.prototype, "_useEmissiveAsIllumination", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "useEmissiveAsIllumination", void 0);
C([
  M("linkEmissiveWithDiffuse")
], Wt.prototype, "_linkEmissiveWithDiffuse", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "linkEmissiveWithDiffuse", void 0);
C([
  M("useSpecularOverAlpha")
], Wt.prototype, "_useSpecularOverAlpha", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "useSpecularOverAlpha", void 0);
C([
  M("useReflectionOverAlpha")
], Wt.prototype, "_useReflectionOverAlpha", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "useReflectionOverAlpha", void 0);
C([
  M("disableLighting")
], Wt.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Wt.prototype, "disableLighting", void 0);
C([
  M("useObjectSpaceNormalMap")
], Wt.prototype, "_useObjectSpaceNormalMap", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "useObjectSpaceNormalMap", void 0);
C([
  M("useParallax")
], Wt.prototype, "_useParallax", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "useParallax", void 0);
C([
  M("useParallaxOcclusion")
], Wt.prototype, "_useParallaxOcclusion", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "useParallaxOcclusion", void 0);
C([
  M()
], Wt.prototype, "parallaxScaleBias", void 0);
C([
  M("roughness")
], Wt.prototype, "_roughness", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "roughness", void 0);
C([
  M()
], Wt.prototype, "indexOfRefraction", void 0);
C([
  M()
], Wt.prototype, "invertRefractionY", void 0);
C([
  M()
], Wt.prototype, "alphaCutOff", void 0);
C([
  M("useLightmapAsShadowmap")
], Wt.prototype, "_useLightmapAsShadowmap", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "useLightmapAsShadowmap", void 0);
C([
  eU("diffuseFresnelParameters")
], Wt.prototype, "_diffuseFresnelParameters", void 0);
C([
  At("_markAllSubMeshesAsFresnelDirty")
], Wt.prototype, "diffuseFresnelParameters", void 0);
C([
  eU("opacityFresnelParameters")
], Wt.prototype, "_opacityFresnelParameters", void 0);
C([
  At("_markAllSubMeshesAsFresnelAndMiscDirty")
], Wt.prototype, "opacityFresnelParameters", void 0);
C([
  eU("reflectionFresnelParameters")
], Wt.prototype, "_reflectionFresnelParameters", void 0);
C([
  At("_markAllSubMeshesAsFresnelDirty")
], Wt.prototype, "reflectionFresnelParameters", void 0);
C([
  eU("refractionFresnelParameters")
], Wt.prototype, "_refractionFresnelParameters", void 0);
C([
  At("_markAllSubMeshesAsFresnelDirty")
], Wt.prototype, "refractionFresnelParameters", void 0);
C([
  eU("emissiveFresnelParameters")
], Wt.prototype, "_emissiveFresnelParameters", void 0);
C([
  At("_markAllSubMeshesAsFresnelDirty")
], Wt.prototype, "emissiveFresnelParameters", void 0);
C([
  M("useReflectionFresnelFromSpecular")
], Wt.prototype, "_useReflectionFresnelFromSpecular", void 0);
C([
  At("_markAllSubMeshesAsFresnelDirty")
], Wt.prototype, "useReflectionFresnelFromSpecular", void 0);
C([
  M("useGlossinessFromSpecularMapAlpha")
], Wt.prototype, "_useGlossinessFromSpecularMapAlpha", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "useGlossinessFromSpecularMapAlpha", void 0);
C([
  M("maxSimultaneousLights")
], Wt.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Wt.prototype, "maxSimultaneousLights", void 0);
C([
  M("invertNormalMapX")
], Wt.prototype, "_invertNormalMapX", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "invertNormalMapX", void 0);
C([
  M("invertNormalMapY")
], Wt.prototype, "_invertNormalMapY", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "invertNormalMapY", void 0);
C([
  M("twoSidedLighting")
], Wt.prototype, "_twoSidedLighting", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Wt.prototype, "twoSidedLighting", void 0);
C([
  M("applyDecalMapAfterDetailMap")
], Wt.prototype, "_applyDecalMapAfterDetailMap", void 0);
C([
  At("_markAllSubMeshesAsMiscDirty")
], Wt.prototype, "applyDecalMapAfterDetailMap", void 0);
Ue("BABYLON.StandardMaterial", Wt);
sr.DefaultMaterialFactory = (A) => new Wt("default material", A);
hr.prototype.createDynamicTexture = function(A, e, t, r) {
  const n = new As(this, ri.Dynamic);
  return n.baseWidth = A, n.baseHeight = e, t && (A = this.needPOTTextures ? hr.GetExponentOfTwo(A, this._caps.maxTextureSize) : A, e = this.needPOTTextures ? hr.GetExponentOfTwo(e, this._caps.maxTextureSize) : e), n.width = A, n.height = e, n.isReady = !1, n.generateMipMaps = t, n.samplingMode = r, this.updateTextureSamplingMode(r, n), this._internalTexturesCache.push(n), n;
};
hr.prototype.updateDynamicTexture = function(A, e, t, r = !1, n, i = !1, s = !1) {
  if (!A)
    return;
  const a = this._gl, f = a.TEXTURE_2D, o = this._bindTextureDirectly(f, A, !0, i);
  this._unpackFlipY(t === void 0 ? A.invertY : t), r && a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
  const d = this._getWebGLTextureType(A.type), v = this._getInternalFormat(n || A.format), u = this._getRGBABufferInternalSizedFormat(A.type, v);
  a.texImage2D(f, 0, u, v, d, e), A.generateMipMaps && a.generateMipmap(f), o || this._bindTextureDirectly(f, null), r && a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0), n && (A.format = n), A._dynamicTextureSource = e, A._premulAlpha = r, A.invertY = t || !1, A.isReady = !0;
};
class Xp extends We {
  /**
   * Creates a DynamicTexture
   * @param name defines the name of the texture
   * @param options provides 3 alternatives for width and height of texture, a canvas, object with width and height properties, number for both width and height
   * @param scene defines the scene where you want the texture
   * @param generateMipMaps defines the use of MinMaps or not (default is false)
   * @param samplingMode defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)
   * @param format defines the texture format to use (default is Engine.TEXTUREFORMAT_RGBA)
   * @param invertY defines if the texture needs to be inverted on the y axis during loading
   */
  constructor(e, t, r = null, n = !1, i = 3, s = 5, a) {
    super(null, r, !n, a, i, void 0, void 0, void 0, void 0, s), this.name = e, this.wrapU = We.CLAMP_ADDRESSMODE, this.wrapV = We.CLAMP_ADDRESSMODE, this._generateMipMaps = n;
    const f = this._getEngine();
    if (!f)
      return;
    t.getContext ? (this._canvas = t, this._texture = f.createDynamicTexture(t.width, t.height, n, i)) : (this._canvas = f.createCanvas(1, 1), t.width || t.width === 0 ? this._texture = f.createDynamicTexture(t.width, t.height, n, i) : this._texture = f.createDynamicTexture(t, t, n, i));
    const o = this.getSize();
    this._canvas.width !== o.width && (this._canvas.width = o.width), this._canvas.height !== o.height && (this._canvas.height = o.height), this._context = this._canvas.getContext("2d");
  }
  /**
   * Get the current class name of the texture useful for serialization or dynamic coding.
   * @returns "DynamicTexture"
   */
  getClassName() {
    return "DynamicTexture";
  }
  /**
   * Gets the current state of canRescale
   */
  get canRescale() {
    return !0;
  }
  _recreate(e) {
    this._canvas.width = e.width, this._canvas.height = e.height, this.releaseInternalTexture(), this._texture = this._getEngine().createDynamicTexture(e.width, e.height, this._generateMipMaps, this.samplingMode);
  }
  /**
   * Scales the texture
   * @param ratio the scale factor to apply to both width and height
   */
  scale(e) {
    const t = this.getSize();
    t.width *= e, t.height *= e, this._recreate(t);
  }
  /**
   * Resizes the texture
   * @param width the new width
   * @param height the new height
   */
  scaleTo(e, t) {
    const r = this.getSize();
    r.width = e, r.height = t, this._recreate(r);
  }
  /**
   * Gets the context of the canvas used by the texture
   * @returns the canvas context of the dynamic texture
   */
  getContext() {
    return this._context;
  }
  /**
   * Clears the texture
   * @param clearColor Defines the clear color to use
   */
  clear(e) {
    const t = this.getSize();
    e && (this._context.fillStyle = e), this._context.clearRect(0, 0, t.width, t.height);
  }
  /**
   * Updates the texture
   * @param invertY defines the direction for the Y axis (default is true - y increases downwards)
   * @param premulAlpha defines if alpha is stored as premultiplied (default is false)
   * @param allowGPUOptimization true to allow some specific GPU optimizations (subject to engine feature "allowGPUOptimizationsForGUI" being true)
   */
  update(e, t = !1, r = !1) {
    this._getEngine().updateDynamicTexture(this._texture, this._canvas, e === void 0 ? !0 : e, t, this._format || void 0, void 0, r);
  }
  /**
   * Draws text onto the texture
   * @param text defines the text to be drawn
   * @param x defines the placement of the text from the left
   * @param y defines the placement of the text from the top when invertY is true and from the bottom when false
   * @param font defines the font to be used with font-style, font-size, font-name
   * @param color defines the color used for the text
   * @param fillColor defines the color for the canvas, use null to not overwrite canvas (this bleands with the background to replace, use the clear function)
   * @param invertY defines the direction for the Y axis (default is true - y increases downwards)
   * @param update defines whether texture is immediately update (default is true)
   */
  drawText(e, t, r, n, i, s, a, f = !0) {
    const o = this.getSize();
    if (s && (this._context.fillStyle = s, this._context.fillRect(0, 0, o.width, o.height)), this._context.font = n, t == null) {
      const d = this._context.measureText(e);
      t = (o.width - d.width) / 2;
    }
    if (r == null) {
      const d = parseInt(n.replace(/\D/g, ""));
      r = o.height / 2 + d / 3.65;
    }
    this._context.fillStyle = i || "", this._context.fillText(e, t, r), f && this.update(a);
  }
  /**
   * Clones the texture
   * @returns the clone of the texture.
   */
  clone() {
    const e = this.getScene();
    if (!e)
      return this;
    const t = this.getSize(), r = new Xp(this.name, t, e, this._generateMipMaps);
    return r.hasAlpha = this.hasAlpha, r.level = this.level, r.wrapU = this.wrapU, r.wrapV = this.wrapV, r;
  }
  /**
   * Serializes the dynamic texture.  The scene should be ready before the dynamic texture is serialized
   * @returns a serialized dynamic texture object
   */
  serialize() {
    const e = this.getScene();
    e && !e.isReady() && Se.Warn("The scene must be ready before serializing the dynamic texture");
    const t = super.serialize();
    return Xp._IsCanvasElement(this._canvas) && (t.base64String = this._canvas.toDataURL()), t.invertY = this._invertY, t.samplingMode = this.samplingMode, t;
  }
  static _IsCanvasElement(e) {
    return e.toDataURL !== void 0;
  }
  /** @internal */
  _rebuild() {
    this.update();
  }
}
class XQ {
  /**
   * Check if fixed foveation is supported on this device
   */
  get isFixedFoveationSupported() {
    return this.layerType == "XRWebGLLayer" && typeof this.layer.fixedFoveation == "number";
  }
  /**
   * Get the fixed foveation currently set, as specified by the webxr specs
   * If this returns null, then fixed foveation is not supported
   */
  get fixedFoveation() {
    return this.isFixedFoveationSupported ? this.layer.fixedFoveation : null;
  }
  /**
   * Set the fixed foveation to the specified value, as specified by the webxr specs
   * This value will be normalized to be between 0 and 1, 1 being max foveation, 0 being no foveation
   */
  set fixedFoveation(e) {
    if (this.isFixedFoveationSupported) {
      const t = Math.max(0, Math.min(1, e || 0));
      this.layer.fixedFoveation = t;
    }
  }
  constructor(e, t, r, n, i) {
    this.getWidth = e, this.getHeight = t, this.layer = r, this.layerType = n, this.createRenderTargetTextureProvider = i;
  }
}
class TQ {
  constructor(e, t) {
    this._scene = e, this.layerWrapper = t, this._renderTargetTextures = new Array(), this._engine = e.getEngine();
  }
  _createInternalTexture(e, t) {
    const r = new As(this._engine, ri.Unknown, !0);
    return r.width = e.width, r.height = e.height, r._hardwareTexture = new jm(t, this._engine._gl), r.isReady = !0, r;
  }
  _createRenderTargetTexture(e, t, r, n, i, s) {
    if (!this._engine)
      throw new Error("Engine is disposed");
    const a = { width: e, height: t }, f = s ? new $5(this._scene, a) : new Ta("XR renderTargetTexture", a, this._scene), o = f.renderTarget;
    if (o._samples = f.samples, (r || !n) && (o._framebuffer = r), n)
      if (s)
        o._colorTextureArray = n;
      else {
        const d = this._createInternalTexture(a, n);
        o.setTexture(d, 0), f._texture = d;
      }
    return i && (s ? o._depthStencilTextureArray = i : o._depthStencilTexture = this._createInternalTexture(a, i)), f.disableRescaling(), typeof XRWebGLBinding < "u" && (f.skipInitialClear = !0), this._renderTargetTextures.push(f), f;
  }
  _destroyRenderTargetTexture(e) {
    this._renderTargetTextures.splice(this._renderTargetTextures.indexOf(e), 1), e.dispose();
  }
  getFramebufferDimensions() {
    return this._framebufferDimensions;
  }
  dispose() {
    this._renderTargetTextures.forEach((e) => e.dispose()), this._renderTargetTextures.length = 0;
  }
}
class qQ extends XQ {
  /**
   * @param layer is the layer to be wrapped.
   * @returns a new WebXRLayerWrapper wrapping the provided XRWebGLLayer.
   */
  constructor(e) {
    super(() => e.framebufferWidth, () => e.framebufferHeight, e, "XRWebGLLayer", (t) => new bve(t.scene, this)), this.layer = e;
  }
}
class bve extends TQ {
  constructor(e, t) {
    super(e, t), this.layerWrapper = t, this._layer = t.layer, this._framebufferDimensions = {
      framebufferWidth: this._layer.framebufferWidth,
      framebufferHeight: this._layer.framebufferHeight
    };
  }
  trySetViewportForView(e, t) {
    const r = this._layer.getViewport(t);
    if (!r)
      return !1;
    const n = this._framebufferDimensions.framebufferWidth, i = this._framebufferDimensions.framebufferHeight;
    return e.x = r.x / n, e.y = r.y / i, e.width = r.width / n, e.height = r.height / i, !0;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getRenderTargetTextureForEye(e) {
    const t = this._layer.framebufferWidth, r = this._layer.framebufferHeight, n = this._layer.framebuffer;
    return (!this._rtt || t !== this._framebufferDimensions.framebufferWidth || r !== this._framebufferDimensions.framebufferHeight || n !== this._framebuffer) && (this._rtt = this._createRenderTargetTexture(t, r, n), this._framebufferDimensions.framebufferWidth = t, this._framebufferDimensions.framebufferHeight = r, this._framebuffer = n), this._rtt;
  }
  getRenderTargetTextureForView(e) {
    return this.getRenderTargetTextureForEye(e.eye);
  }
}
class YR {
  /**
   * Get the default values of the configuration object
   * @param engine defines the engine to use (can be null)
   * @returns default values of this configuration object
   */
  static GetDefaults(e) {
    const t = new YR();
    return t.canvasOptions = {
      antialias: !0,
      depth: !0,
      stencil: e ? e.isStencilEnable : !0,
      alpha: !0,
      framebufferScaleFactor: 1
    }, t.newCanvasCssStyle = "position:absolute; bottom:0px;right:0px;z-index:10;width:90%;height:100%;background-color: #000000;", t;
  }
}
class Jee {
  /**
   * Initializes the canvas to be added/removed upon entering/exiting xr
   * @param _xrSessionManager The XR Session manager
   * @param _options optional configuration for this canvas output. defaults will be used if not provided
   */
  constructor(e, t = YR.GetDefaults()) {
    if (this._options = t, this._canvas = null, this._engine = null, this.xrLayer = null, this._xrLayerWrapper = null, this.onXRLayerInitObservable = new Oe(), this._engine = e.scene.getEngine(), this._engine.onDisposeObservable.addOnce(() => {
      this._engine = null;
    }), t.canvasElement)
      this._setManagedOutputCanvas(t.canvasElement);
    else {
      const r = document.createElement("canvas");
      r.style.cssText = this._options.newCanvasCssStyle || "position:absolute; bottom:0px;right:0px;", this._setManagedOutputCanvas(r);
    }
    e.onXRSessionInit.add(() => {
      this._addCanvas();
    }), e.onXRSessionEnded.add(() => {
      this._removeCanvas();
    });
  }
  /**
   * Disposes of the object
   */
  dispose() {
    this._removeCanvas(), this._setManagedOutputCanvas(null);
  }
  /**
   * Initializes a XRWebGLLayer to be used as the session's baseLayer.
   * @param xrSession xr session
   * @returns a promise that will resolve once the XR Layer has been created
   */
  async initializeXRLayerAsync(e) {
    const t = () => (this.xrLayer = new XRWebGLLayer(e, this.canvasContext, this._options.canvasOptions), this._xrLayerWrapper = new qQ(this.xrLayer), this.onXRLayerInitObservable.notifyObservers(this.xrLayer), this.xrLayer);
    return this.canvasContext.makeXRCompatible ? this.canvasContext.makeXRCompatible().then(
      // catch any error and continue. When using the emulator is throws this error for no apparent reason.
      () => {
      },
      () => {
        ye.Warn("Error executing makeXRCompatible. This does not mean that the session will work incorrectly.");
      }
    ).then(() => t()) : Promise.resolve(t());
  }
  _addCanvas() {
    this._canvas && this._engine && this._canvas !== this._engine.getRenderingCanvas() && document.body.appendChild(this._canvas), this.xrLayer ? this._setCanvasSize(!0) : this.onXRLayerInitObservable.addOnce(() => {
      this._setCanvasSize(!0);
    });
  }
  _removeCanvas() {
    this._canvas && this._engine && document.body.contains(this._canvas) && this._canvas !== this._engine.getRenderingCanvas() && document.body.removeChild(this._canvas), this._setCanvasSize(!1);
  }
  _setCanvasSize(e = !0, t = this._xrLayerWrapper) {
    !this._canvas || !this._engine || (e ? t && (this._canvas !== this._engine.getRenderingCanvas() ? (this._canvas.style.width = t.getWidth() + "px", this._canvas.style.height = t.getHeight() + "px") : this._engine.setSize(t.getWidth(), t.getHeight())) : this._originalCanvasSize && (this._canvas !== this._engine.getRenderingCanvas() ? (this._canvas.style.width = this._originalCanvasSize.width + "px", this._canvas.style.height = this._originalCanvasSize.height + "px") : this._engine.setSize(this._originalCanvasSize.width, this._originalCanvasSize.height)));
  }
  _setManagedOutputCanvas(e) {
    this._removeCanvas(), e ? (this._originalCanvasSize = {
      width: e.offsetWidth,
      height: e.offsetHeight
    }, this._canvas = e, this.canvasContext = this._canvas.getContext("webgl2"), this.canvasContext || (this.canvasContext = this._canvas.getContext("webgl"))) : (this._canvas = null, this.canvasContext = null);
  }
}
class zee extends XQ {
  constructor(e) {
    super(() => e.framebufferWidth, () => e.framebufferHeight, e, "XRWebGLLayer", (t) => new Gee(t, this)), this.layer = e;
  }
}
class Gee extends TQ {
  constructor(e, t) {
    super(e.scene, t), this.layerWrapper = t, this._nativeRTTProvider = navigator.xr.getNativeRenderTargetProvider(e.session, this._createRenderTargetTexture.bind(this), this._destroyRenderTargetTexture.bind(this)), this._nativeLayer = t.layer;
  }
  trySetViewportForView(e) {
    return e.x = 0, e.y = 0, e.width = 1, e.height = 1, !0;
  }
  getRenderTargetTextureForEye(e) {
    return this._nativeRTTProvider.getRenderTargetForEye(e);
  }
  getRenderTargetTextureForView(e) {
    return this._nativeRTTProvider.getRenderTargetForEye(e.eye);
  }
  getFramebufferDimensions() {
    return {
      framebufferWidth: this._nativeLayer.framebufferWidth,
      framebufferHeight: this._nativeLayer.framebufferHeight
    };
  }
}
class Zee {
  constructor(e) {
    this._nativeRenderTarget = navigator.xr.getWebXRRenderTarget(e.scene.getEngine());
  }
  async initializeXRLayerAsync(e) {
    return await this._nativeRenderTarget.initializeXRLayerAsync(e), this.xrLayer = this._nativeRenderTarget.xrLayer, this.xrLayer;
  }
  dispose() {
  }
}
class MR {
  /**
   * Constructs a WebXRSessionManager, this must be initialized within a user action before usage
   * @param scene The scene which the session should be created for
   */
  constructor(e) {
    this.scene = e, this.currentTimestamp = -1, this.defaultHeightCompensation = 1.7, this.onXRFrameObservable = new Oe(), this.onXRReferenceSpaceChanged = new Oe(), this.onXRSessionEnded = new Oe(), this.onXRSessionInit = new Oe(), this.inXRFrameLoop = !1, this.inXRSession = !1, this._engine = e.getEngine(), this._onEngineDisposedObserver = this._engine.onDisposeObservable.addOnce(() => {
      this._engine = null;
    }), e.onDisposeObservable.addOnce(() => {
      this.dispose();
    });
  }
  /**
   * The current reference space used in this session. This reference space can constantly change!
   * It is mainly used to offset the camera's position.
   */
  get referenceSpace() {
    return this._referenceSpace;
  }
  /**
   * Set a new reference space and triggers the observable
   */
  set referenceSpace(e) {
    this._referenceSpace = e, this.onXRReferenceSpaceChanged.notifyObservers(this._referenceSpace);
  }
  /**
   * The mode for the managed XR session
   */
  get sessionMode() {
    return this._sessionMode;
  }
  /**
   * Disposes of the session manager
   * This should be called explicitly by the dev, if required.
   */
  dispose() {
    var e;
    this.inXRSession && this.exitXRAsync(), this.onXRFrameObservable.clear(), this.onXRSessionEnded.clear(), this.onXRReferenceSpaceChanged.clear(), this.onXRSessionInit.clear(), (e = this._engine) === null || e === void 0 || e.onDisposeObservable.remove(this._onEngineDisposedObserver), this._engine = null;
  }
  /**
   * Stops the xrSession and restores the render loop
   * @returns Promise which resolves after it exits XR
   */
  exitXRAsync() {
    return this.session && this.inXRSession ? (this.inXRSession = !1, this.session.end().catch(() => {
      Se.Warn("Could not end XR session.");
    })) : Promise.resolve();
  }
  /**
   * Attempts to set the framebuffer-size-normalized viewport to be rendered this frame for this view.
   * In the event of a failure, the supplied viewport is not updated.
   * @param viewport the viewport to which the view will be rendered
   * @param view the view for which to set the viewport
   * @returns whether the operation was successful
   */
  trySetViewportForView(e, t) {
    var r;
    return ((r = this._baseLayerRTTProvider) === null || r === void 0 ? void 0 : r.trySetViewportForView(e, t)) || !1;
  }
  /**
   * Gets the correct render target texture to be rendered this frame for this eye
   * @param eye the eye for which to get the render target
   * @returns the render target for the specified eye or null if not available
   */
  getRenderTargetTextureForEye(e) {
    var t;
    return ((t = this._baseLayerRTTProvider) === null || t === void 0 ? void 0 : t.getRenderTargetTextureForEye(e)) || null;
  }
  /**
   * Gets the correct render target texture to be rendered this frame for this view
   * @param view the view for which to get the render target
   * @returns the render target for the specified view or null if not available
   */
  getRenderTargetTextureForView(e) {
    var t;
    return ((t = this._baseLayerRTTProvider) === null || t === void 0 ? void 0 : t.getRenderTargetTextureForView(e)) || null;
  }
  /**
   * Creates a WebXRRenderTarget object for the XR session
   * @param options optional options to provide when creating a new render target
   * @returns a WebXR render target to which the session can render
   */
  getWebXRRenderTarget(e) {
    const t = this.scene.getEngine();
    return this._xrNavigator.xr.native ? new Zee(this) : (e = e || YR.GetDefaults(t), e.canvasElement = e.canvasElement || t.getRenderingCanvas() || void 0, new Jee(this, e));
  }
  /**
   * Initializes the manager
   * After initialization enterXR can be called to start an XR session
   * @returns Promise which resolves after it is initialized
   */
  initializeAsync() {
    return this._xrNavigator = navigator, this._xrNavigator.xr ? Promise.resolve() : Promise.reject("WebXR not available");
  }
  /**
   * Initializes an xr session
   * @param xrSessionMode mode to initialize
   * @param xrSessionInit defines optional and required values to pass to the session builder
   * @returns a promise which will resolve once the session has been initialized
   */
  initializeSessionAsync(e = "immersive-vr", t = {}) {
    return this._xrNavigator.xr.requestSession(e, t).then((r) => (this.session = r, this._sessionMode = e, this.onXRSessionInit.notifyObservers(r), this.inXRSession = !0, this.session.addEventListener("end", () => {
      var n;
      this.inXRSession = !1, this.onXRSessionEnded.notifyObservers(null), this._engine && (this._engine.framebufferDimensionsObject = null, this._engine.restoreDefaultFramebuffer(), this._engine.customAnimationFrameRequester = null, this._engine._renderLoop()), this.isNative && ((n = this._baseLayerRTTProvider) === null || n === void 0 || n.dispose()), this._baseLayerRTTProvider = null, this._baseLayerWrapper = null;
    }, { once: !0 }), this.session));
  }
  /**
   * Checks if a session would be supported for the creation options specified
   * @param sessionMode session mode to check if supported eg. immersive-vr
   * @returns A Promise that resolves to true if supported and false if not
   */
  isSessionSupportedAsync(e) {
    return MR.IsSessionSupportedAsync(e);
  }
  /**
   * Resets the reference space to the one started the session
   */
  resetReferenceSpace() {
    this.referenceSpace = this.baseReferenceSpace;
  }
  /**
   * Starts rendering to the xr layer
   */
  runXRRenderLoop() {
    var e;
    !this.inXRSession || !this._engine || (this._engine.customAnimationFrameRequester = {
      requestAnimationFrame: (t) => this.session.requestAnimationFrame(t),
      renderFunction: (t, r) => {
        var n;
        !this.inXRSession || !this._engine || (this.currentFrame = r, this.currentTimestamp = t, r && (this.inXRFrameLoop = !0, this._engine.framebufferDimensionsObject = ((n = this._baseLayerRTTProvider) === null || n === void 0 ? void 0 : n.getFramebufferDimensions()) || null, this.onXRFrameObservable.notifyObservers(r), this._engine._renderLoop(), this._engine.framebufferDimensionsObject = null, this.inXRFrameLoop = !1));
      }
    }, this._engine.framebufferDimensionsObject = ((e = this._baseLayerRTTProvider) === null || e === void 0 ? void 0 : e.getFramebufferDimensions()) || null, typeof window < "u" && window.cancelAnimationFrame && window.cancelAnimationFrame(this._engine._frameHandler), this._engine._renderLoop());
  }
  /**
   * Sets the reference space on the xr session
   * @param referenceSpaceType space to set
   * @returns a promise that will resolve once the reference space has been set
   */
  setReferenceSpaceTypeAsync(e = "local-floor") {
    return this.session.requestReferenceSpace(e).then((t) => t, (t) => (Se.Error("XR.requestReferenceSpace failed for the following reason: "), Se.Error(t), Se.Log('Defaulting to universally-supported "viewer" reference space type.'), this.session.requestReferenceSpace("viewer").then((r) => {
      const n = new XRRigidTransform({ x: 0, y: -this.defaultHeightCompensation, z: 0 });
      return r.getOffsetReferenceSpace(n);
    }, (r) => {
      throw Se.Error(r), 'XR initialization failed: required "viewer" reference space type not supported.';
    }))).then((t) => this.session.requestReferenceSpace("viewer").then((r) => (this.viewerReferenceSpace = r, t))).then((t) => (this.referenceSpace = this.baseReferenceSpace = t, this.referenceSpace));
  }
  /**
   * Updates the render state of the session.
   * Note that this is deprecated in favor of WebXRSessionManager.updateRenderState().
   * @param state state to set
   * @returns a promise that resolves once the render state has been updated
   * @deprecated
   */
  updateRenderStateAsync(e) {
    return Promise.resolve(this.session.updateRenderState(e));
  }
  /**
   * @internal
   */
  _setBaseLayerWrapper(e) {
    var t, r;
    this.isNative && ((t = this._baseLayerRTTProvider) === null || t === void 0 || t.dispose()), this._baseLayerWrapper = e, this._baseLayerRTTProvider = ((r = this._baseLayerWrapper) === null || r === void 0 ? void 0 : r.createRenderTargetTextureProvider(this)) || null;
  }
  /**
   * @internal
   */
  _getBaseLayerWrapper() {
    return this._baseLayerWrapper;
  }
  /**
   * Updates the render state of the session
   * @param state state to set
   */
  updateRenderState(e) {
    e.baseLayer && this._setBaseLayerWrapper(this.isNative ? new zee(e.baseLayer) : new qQ(e.baseLayer)), this.session.updateRenderState(e);
  }
  /**
   * Returns a promise that resolves with a boolean indicating if the provided session mode is supported by this browser
   * @param sessionMode defines the session to test
   * @returns a promise with boolean as final value
   */
  static IsSessionSupportedAsync(e) {
    if (!navigator.xr)
      return Promise.resolve(!1);
    const t = navigator.xr.isSessionSupported || navigator.xr.supportsSession;
    return t ? t.call(navigator.xr, e).then((r) => {
      const n = typeof r > "u" ? !0 : r;
      return Promise.resolve(n);
    }).catch((r) => (Se.Warn(r), Promise.resolve(!1))) : Promise.resolve(!1);
  }
  /**
   * Returns true if Babylon.js is using the BabylonNative backend, otherwise false
   */
  get isNative() {
    var e;
    return (e = this._xrNavigator.xr.native) !== null && e !== void 0 ? e : !1;
  }
  /**
   * The current frame rate as reported by the device
   */
  get currentFrameRate() {
    var e;
    return (e = this.session) === null || e === void 0 ? void 0 : e.frameRate;
  }
  /**
   * A list of supported frame rates (only available in-session!
   */
  get supportedFrameRates() {
    var e;
    return (e = this.session) === null || e === void 0 ? void 0 : e.supportedFrameRates;
  }
  /**
   * Set the framerate of the session.
   * @param rate the new framerate. This value needs to be in the supportedFrameRates array
   * @returns a promise that resolves once the framerate has been set
   */
  updateTargetFrameRate(e) {
    return this.session.updateTargetFrameRate(e);
  }
  /**
   * Run a callback in the xr render loop
   * @param callback the callback to call when in XR Frame
   * @param ignoreIfNotInSession if no session is currently running, run it first thing on the next session
   */
  runInXRFrame(e, t = !0) {
    this.inXRFrameLoop ? e() : (this.inXRSession || !t) && this.onXRFrameObservable.addOnce(e);
  }
  /**
   * Check if fixed foveation is supported on this device
   */
  get isFixedFoveationSupported() {
    var e;
    return ((e = this._baseLayerWrapper) === null || e === void 0 ? void 0 : e.isFixedFoveationSupported) || !1;
  }
  /**
   * Get the fixed foveation currently set, as specified by the webxr specs
   * If this returns null, then fixed foveation is not supported
   */
  get fixedFoveation() {
    var e;
    return ((e = this._baseLayerWrapper) === null || e === void 0 ? void 0 : e.fixedFoveation) || null;
  }
  /**
   * Set the fixed foveation to the specified value, as specified by the webxr specs
   * This value will be normalized to be between 0 and 1, 1 being max foveation, 0 being no foveation
   */
  set fixedFoveation(e) {
    const t = Math.max(0, Math.min(1, e || 0));
    this._baseLayerWrapper && (this._baseLayerWrapper.fixedFoveation = t);
  }
  /**
   * Get the features enabled on the current session
   * This is only available in-session!
   * @see https://www.w3.org/TR/webxr/#dom-xrsession-enabledfeatures
   */
  get enabledFeatures() {
    var e, t;
    return (t = (e = this.session) === null || e === void 0 ? void 0 : e.enabledFeatures) !== null && t !== void 0 ? t : null;
  }
}
var d9;
(function(A) {
  A[A.ENTERING_XR = 0] = "ENTERING_XR", A[A.EXITING_XR = 1] = "EXITING_XR", A[A.IN_XR = 2] = "IN_XR", A[A.NOT_IN_XR = 3] = "NOT_IN_XR";
})(d9 || (d9 = {}));
var Jw;
(function(A) {
  A[A.NOT_TRACKING = 0] = "NOT_TRACKING", A[A.TRACKING_LOST = 1] = "TRACKING_LOST", A[A.TRACKING = 2] = "TRACKING";
})(Jw || (Jw = {}));
Ee._GroundMeshParser = (A, e) => dU.Parse(A, e);
class dU extends Ee {
  constructor(e, t) {
    super(e, t), this.generateOctree = !1;
  }
  /**
   * "GroundMesh"
   * @returns "GroundMesh"
   */
  getClassName() {
    return "GroundMesh";
  }
  /**
   * The minimum of x and y subdivisions
   */
  get subdivisions() {
    return Math.min(this._subdivisionsX, this._subdivisionsY);
  }
  /**
   * X subdivisions
   */
  get subdivisionsX() {
    return this._subdivisionsX;
  }
  /**
   * Y subdivisions
   */
  get subdivisionsY() {
    return this._subdivisionsY;
  }
  /**
   * This function will divide the mesh into submeshes and update an octree to help to select the right submeshes
   * for rendering, picking and collision computations. Please note that you must have a decent number of submeshes
   * to get performance improvements when using an octree.
   * @param chunksCount the number of submeshes the mesh will be divided into
   * @param octreeBlocksSize the maximum size of the octree blocks (Default: 32)
   */
  optimize(e, t = 32) {
    this._subdivisionsX = e, this._subdivisionsY = e, this.subdivide(e);
    const r = this;
    r.createOrUpdateSubmeshesOctree && r.createOrUpdateSubmeshesOctree(t);
  }
  /**
   * Returns a height (y) value in the World system :
   * the ground altitude at the coordinates (x, z) expressed in the World system.
   * @param x x coordinate
   * @param z z coordinate
   * @returns the ground y position if (x, z) are outside the ground surface.
   */
  getHeightAtCoordinates(e, t) {
    const r = this.getWorldMatrix(), n = ue.Matrix[5];
    r.invertToRef(n);
    const i = ue.Vector3[8];
    if (S.TransformCoordinatesFromFloatsToRef(e, 0, t, n, i), e = i.x, t = i.z, e < this._minX || e >= this._maxX || t <= this._minZ || t > this._maxZ)
      return this.position.y;
    (!this._heightQuads || this._heightQuads.length == 0) && (this._initHeightQuads(), this._computeHeightQuads());
    const s = this._getFacetAt(e, t), a = -(s.x * e + s.z * t + s.w) / s.y;
    return S.TransformCoordinatesFromFloatsToRef(0, a, 0, r, i), i.y;
  }
  /**
   * Returns a normalized vector (Vector3) orthogonal to the ground
   * at the ground coordinates (x, z) expressed in the World system.
   * @param x x coordinate
   * @param z z coordinate
   * @returns Vector3(0.0, 1.0, 0.0) if (x, z) are outside the ground surface.
   */
  getNormalAtCoordinates(e, t) {
    const r = new S(0, 1, 0);
    return this.getNormalAtCoordinatesToRef(e, t, r), r;
  }
  /**
   * Updates the Vector3 passed a reference with a normalized vector orthogonal to the ground
   * at the ground coordinates (x, z) expressed in the World system.
   * Doesn't update the reference Vector3 if (x, z) are outside the ground surface.
   * @param x x coordinate
   * @param z z coordinate
   * @param ref vector to store the result
   * @returns the GroundMesh.
   */
  getNormalAtCoordinatesToRef(e, t, r) {
    const n = this.getWorldMatrix(), i = ue.Matrix[5];
    n.invertToRef(i);
    const s = ue.Vector3[8];
    if (S.TransformCoordinatesFromFloatsToRef(e, 0, t, i, s), e = s.x, t = s.z, e < this._minX || e > this._maxX || t < this._minZ || t > this._maxZ)
      return this;
    (!this._heightQuads || this._heightQuads.length == 0) && (this._initHeightQuads(), this._computeHeightQuads());
    const a = this._getFacetAt(e, t);
    return S.TransformNormalFromFloatsToRef(a.x, a.y, a.z, n, r), this;
  }
  /**
   * Force the heights to be recomputed for getHeightAtCoordinates() or getNormalAtCoordinates()
   * if the ground has been updated.
   * This can be used in the render loop.
   * @returns the GroundMesh.
   */
  updateCoordinateHeights() {
    return (!this._heightQuads || this._heightQuads.length == 0) && this._initHeightQuads(), this._computeHeightQuads(), this;
  }
  // Returns the element "facet" from the heightQuads array relative to (x, z) local coordinates
  _getFacetAt(e, t) {
    const r = Math.floor((e + this._maxX) * this._subdivisionsX / this._width), n = Math.floor(-(t + this._maxZ) * this._subdivisionsY / this._height + this._subdivisionsY), i = this._heightQuads[n * this._subdivisionsX + r];
    let s;
    return t < i.slope.x * e + i.slope.y ? s = i.facet1 : s = i.facet2, s;
  }
  //  Creates and populates the heightMap array with "facet" elements :
  // a quad is two triangular facets separated by a slope, so a "facet" element is 1 slope + 2 facets
  // slope : Vector2(c, h) = 2D diagonal line equation setting apart two triangular facets in a quad : z = cx + h
  // facet1 : Vector4(a, b, c, d) = first facet 3D plane equation : ax + by + cz + d = 0
  // facet2 :  Vector4(a, b, c, d) = second facet 3D plane equation : ax + by + cz + d = 0
  // Returns the GroundMesh.
  _initHeightQuads() {
    const e = this._subdivisionsX, t = this._subdivisionsY;
    this._heightQuads = new Array();
    for (let r = 0; r < t; r++)
      for (let n = 0; n < e; n++) {
        const i = { slope: at.Zero(), facet1: new Ir(0, 0, 0, 0), facet2: new Ir(0, 0, 0, 0) };
        this._heightQuads[r * e + n] = i;
      }
    return this;
  }
  // Compute each quad element values and update the heightMap array :
  // slope : Vector2(c, h) = 2D diagonal line equation setting apart two triangular facets in a quad : z = cx + h
  // facet1 : Vector4(a, b, c, d) = first facet 3D plane equation : ax + by + cz + d = 0
  // facet2 :  Vector4(a, b, c, d) = second facet 3D plane equation : ax + by + cz + d = 0
  // Returns the GroundMesh.
  _computeHeightQuads() {
    const e = this.getVerticesData(J.PositionKind);
    if (!e)
      return this;
    const t = ue.Vector3[3], r = ue.Vector3[2], n = ue.Vector3[1], i = ue.Vector3[0], s = ue.Vector3[4], a = ue.Vector3[5], f = ue.Vector3[6], o = ue.Vector3[7], d = ue.Vector3[8];
    let v = 0, u = 0, l = 0, P = 0, p = 0, c = 0, H = 0;
    const T = this._subdivisionsX, q = this._subdivisionsY;
    for (let b = 0; b < q; b++)
      for (let j = 0; j < T; j++) {
        v = j * 3, u = b * (T + 1) * 3, l = (b + 1) * (T + 1) * 3, t.x = e[u + v], t.y = e[u + v + 1], t.z = e[u + v + 2], r.x = e[u + v + 3], r.y = e[u + v + 4], r.z = e[u + v + 5], n.x = e[l + v], n.y = e[l + v + 1], n.z = e[l + v + 2], i.x = e[l + v + 3], i.y = e[l + v + 4], i.z = e[l + v + 5], P = (i.z - t.z) / (i.x - t.x), p = t.z - P * t.x, r.subtractToRef(t, s), n.subtractToRef(t, a), i.subtractToRef(t, f), S.CrossToRef(f, a, o), S.CrossToRef(s, f, d), o.normalize(), d.normalize(), c = -(o.x * t.x + o.y * t.y + o.z * t.z), H = -(d.x * r.x + d.y * r.y + d.z * r.z);
        const w = this._heightQuads[b * T + j];
        w.slope.copyFromFloats(P, p), w.facet1.copyFromFloats(o.x, o.y, o.z, c), w.facet2.copyFromFloats(d.x, d.y, d.z, H);
      }
    return this;
  }
  /**
   * Serializes this ground mesh
   * @param serializationObject object to write serialization to
   */
  serialize(e) {
    super.serialize(e), e.subdivisionsX = this._subdivisionsX, e.subdivisionsY = this._subdivisionsY, e.minX = this._minX, e.maxX = this._maxX, e.minZ = this._minZ, e.maxZ = this._maxZ, e.width = this._width, e.height = this._height;
  }
  /**
   * Parses a serialized ground mesh
   * @param parsedMesh the serialized mesh
   * @param scene the scene to create the ground mesh in
   * @returns the created ground mesh
   */
  static Parse(e, t) {
    const r = new dU(e.name, t);
    return r._subdivisionsX = e.subdivisionsX || 1, r._subdivisionsY = e.subdivisionsY || 1, r._minX = e.minX, r._maxX = e.maxX, r._minZ = e.minZ, r._maxZ = e.maxZ, r._width = e.width, r._height = e.height, r;
  }
}
function y2(A) {
  const e = [], t = [], r = [], n = [];
  let i, s;
  const a = A.width || 1, f = A.height || 1, o = (A.subdivisionsX || A.subdivisions || 1) | 0, d = (A.subdivisionsY || A.subdivisions || 1) | 0;
  for (i = 0; i <= d; i++)
    for (s = 0; s <= o; s++) {
      const u = new S(s * a / o - a / 2, 0, (d - i) * f / d - f / 2), l = new S(0, 1, 0);
      t.push(u.x, u.y, u.z), r.push(l.x, l.y, l.z), n.push(s / o, us.UseOpenGLOrientationForUV ? i / d : 1 - i / d);
    }
  for (i = 0; i < d; i++)
    for (s = 0; s < o; s++)
      e.push(s + 1 + (i + 1) * (o + 1)), e.push(s + 1 + i * (o + 1)), e.push(s + i * (o + 1)), e.push(s + (i + 1) * (o + 1)), e.push(s + 1 + (i + 1) * (o + 1)), e.push(s + i * (o + 1));
  const v = new Ut();
  return v.indices = e, v.positions = t, v.normals = r, v.uvs = n, v;
}
function bQ(A) {
  const e = A.xmin !== void 0 && A.xmin !== null ? A.xmin : -1, t = A.zmin !== void 0 && A.zmin !== null ? A.zmin : -1, r = A.xmax !== void 0 && A.xmax !== null ? A.xmax : 1, n = A.zmax !== void 0 && A.zmax !== null ? A.zmax : 1, i = A.subdivisions || { w: 1, h: 1 }, s = A.precision || { w: 1, h: 1 }, a = [], f = [], o = [], d = [];
  let v, u, l, P;
  i.h = i.h < 1 ? 1 : i.h, i.w = i.w < 1 ? 1 : i.w, s.w = s.w < 1 ? 1 : s.w, s.h = s.h < 1 ? 1 : s.h;
  const p = {
    w: (r - e) / i.w,
    h: (n - t) / i.h
  };
  function c(T, q, b, j) {
    const w = f.length / 3, m = s.w + 1;
    for (v = 0; v < s.h; v++)
      for (u = 0; u < s.w; u++) {
        const k = [w + u + v * m, w + (u + 1) + v * m, w + (u + 1) + (v + 1) * m, w + u + (v + 1) * m];
        a.push(k[1]), a.push(k[2]), a.push(k[3]), a.push(k[0]), a.push(k[1]), a.push(k[3]);
      }
    const I = S.Zero(), N = new S(0, 1, 0);
    for (v = 0; v <= s.h; v++)
      for (I.z = v * (j - q) / s.h + q, u = 0; u <= s.w; u++)
        I.x = u * (b - T) / s.w + T, I.y = 0, f.push(I.x, I.y, I.z), o.push(N.x, N.y, N.z), d.push(u / s.w, v / s.h);
  }
  for (l = 0; l < i.h; l++)
    for (P = 0; P < i.w; P++)
      c(e + P * p.w, t + l * p.h, e + (P + 1) * p.w, t + (l + 1) * p.h);
  const H = new Ut();
  return H.indices = a, H.positions = f, H.normals = o, H.uvs = d, H;
}
function xQ(A) {
  const e = [], t = [], r = [], n = [];
  let i, s;
  const a = A.colorFilter || new Ne(0.3, 0.59, 0.11), f = A.alphaFilter || 0;
  let o = !1;
  if (A.minHeight > A.maxHeight) {
    o = !0;
    const v = A.maxHeight;
    A.maxHeight = A.minHeight, A.minHeight = v;
  }
  for (i = 0; i <= A.subdivisions; i++)
    for (s = 0; s <= A.subdivisions; s++) {
      const v = new S(s * A.width / A.subdivisions - A.width / 2, 0, (A.subdivisions - i) * A.height / A.subdivisions - A.height / 2), u = (v.x + A.width / 2) / A.width * (A.bufferWidth - 1) | 0, l = (1 - (v.z + A.height / 2) / A.height) * (A.bufferHeight - 1) | 0, P = (u + l * A.bufferWidth) * 4;
      let p = A.buffer[P] / 255, c = A.buffer[P + 1] / 255, H = A.buffer[P + 2] / 255;
      const T = A.buffer[P + 3] / 255;
      o && (p = 1 - p, c = 1 - c, H = 1 - H);
      const q = p * a.r + c * a.g + H * a.b;
      T >= f ? v.y = A.minHeight + (A.maxHeight - A.minHeight) * q : v.y = A.minHeight - Dn, t.push(v.x, v.y, v.z), r.push(0, 0, 0), n.push(s / A.subdivisions, 1 - i / A.subdivisions);
    }
  for (i = 0; i < A.subdivisions; i++)
    for (s = 0; s < A.subdivisions; s++) {
      const v = s + 1 + (i + 1) * (A.subdivisions + 1), u = s + 1 + i * (A.subdivisions + 1), l = s + i * (A.subdivisions + 1), P = s + (i + 1) * (A.subdivisions + 1), p = t[v * 3 + 1] >= A.minHeight, c = t[u * 3 + 1] >= A.minHeight, H = t[l * 3 + 1] >= A.minHeight;
      p && c && H && (e.push(v), e.push(u), e.push(l)), t[P * 3 + 1] >= A.minHeight && p && H && (e.push(P), e.push(v), e.push(l));
    }
  Ut.ComputeNormals(t, e, r);
  const d = new Ut();
  return d.indices = e, d.positions = t, d.normals = r, d.uvs = n, d;
}
function Wm(A, e = {}, t) {
  const r = new dU(A, t);
  return r._setReady(!1), r._subdivisionsX = e.subdivisionsX || e.subdivisions || 1, r._subdivisionsY = e.subdivisionsY || e.subdivisions || 1, r._width = e.width || 1, r._height = e.height || 1, r._maxX = r._width / 2, r._maxZ = r._height / 2, r._minX = -r._maxX, r._minZ = -r._maxZ, y2(e).applyToMesh(r, e.updatable), r._setReady(!0), r;
}
function FO(A, e, t = null) {
  const r = new Ee(A, t);
  return bQ(e).applyToMesh(r, e.updatable), r;
}
function NO(A, e, t = {}, r = null) {
  const n = t.width || 10, i = t.height || 10, s = t.subdivisions || 1, a = t.minHeight || 0, f = t.maxHeight || 1, o = t.colorFilter || new Ne(0.3, 0.59, 0.11), d = t.alphaFilter || 0, v = t.updatable, u = t.onReady;
  r = r || gr.LastCreatedScene;
  const l = new dU(A, r);
  l._subdivisionsX = s, l._subdivisionsY = s, l._width = n, l._height = i, l._maxX = l._width / 2, l._maxZ = l._height / 2, l._minX = -l._maxX, l._minZ = -l._maxZ, l._setReady(!1);
  const P = (p) => {
    const c = p.width, H = p.height;
    if (r.isDisposed)
      return;
    const T = r == null ? void 0 : r.getEngine().resizeImageBitmap(p, c, H);
    xQ({
      width: n,
      height: i,
      subdivisions: s,
      minHeight: a,
      maxHeight: f,
      colorFilter: o,
      buffer: T,
      bufferWidth: c,
      bufferHeight: H,
      alphaFilter: d
    }).applyToMesh(l, v), u && u(l), l._setReady(!0);
  };
  return ye.LoadImage(e, P, () => {
  }, r.offlineProvider), l;
}
const xve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateGround: Wm,
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateGroundFromHeightMap: NO,
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateTiledGround: FO
};
Ut.CreateGround = y2;
Ut.CreateTiledGround = bQ;
Ut.CreateGroundFromHeightMap = xQ;
Ee.CreateGround = (A, e, t, r, n, i) => Wm(A, {
  width: e,
  height: t,
  subdivisions: r,
  updatable: i
}, n);
Ee.CreateTiledGround = (A, e, t, r, n, i, s, a, f) => FO(A, {
  xmin: e,
  zmin: t,
  xmax: r,
  zmax: n,
  subdivisions: i,
  precision: s,
  updatable: f
}, a);
Ee.CreateGroundFromHeightMap = (A, e, t, r, n, i, s, a, f, o, d) => NO(A, e, {
  width: t,
  height: r,
  subdivisions: n,
  minHeight: i,
  maxHeight: s,
  updatable: f,
  onReady: o,
  alphaFilter: d
}, a);
function QO(A) {
  const e = [], t = [], r = [], n = [], i = A.diameter || 1, s = A.thickness || 0.5, a = (A.tessellation || 16) | 0, f = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE, o = a + 1;
  for (let v = 0; v <= a; v++) {
    const u = v / a, l = v * Math.PI * 2 / a - Math.PI / 2, P = he.Translation(i / 2, 0, 0).multiply(he.RotationY(l));
    for (let p = 0; p <= a; p++) {
      const c = 1 - p / a, H = p * Math.PI * 2 / a + Math.PI, T = Math.cos(H), q = Math.sin(H);
      let b = new S(T, q, 0), j = b.scale(s / 2);
      const w = new at(u, c);
      j = S.TransformCoordinates(j, P), b = S.TransformNormal(b, P), t.push(j.x, j.y, j.z), r.push(b.x, b.y, b.z), n.push(w.x, us.UseOpenGLOrientationForUV ? 1 - w.y : w.y);
      const m = (v + 1) % o, I = (p + 1) % o;
      e.push(v * o + p), e.push(v * o + I), e.push(m * o + p), e.push(v * o + I), e.push(m * o + I), e.push(m * o + p);
    }
  }
  Ut._ComputeSides(f, t, e, r, n, A.frontUVs, A.backUVs);
  const d = new Ut();
  return d.indices = e, d.positions = t, d.normals = r, d.uvs = n, d;
}
function Ag(A, e = {}, t) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, QO(e).applyToMesh(r, e.updatable), r;
}
const Dve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateTorus: Ag
};
Ut.CreateTorus = QO;
Ee.CreateTorus = (A, e, t, r, n, i, s) => Ag(A, {
  diameter: e,
  thickness: t,
  tessellation: r,
  sideOrientation: s,
  updatable: i
}, n);
class YO {
  constructor(e, t = null) {
    if (this.scene = e, this._pointerDownOnMeshAsked = !1, this._isActionableMesh = !1, this._teleportationRequestInitiated = !1, this._teleportationBackRequestInitiated = !1, this._rotationRightAsked = !1, this._rotationLeftAsked = !1, this._dpadPressed = !0, this._activePointer = !1, this._id = YO._IdCounter++, t)
      this._gazeTracker = t.clone("gazeTracker");
    else {
      this._gazeTracker = Ag("gazeTracker", {
        diameter: 35e-4,
        thickness: 25e-4,
        tessellation: 20,
        updatable: !1
      }, e), this._gazeTracker.bakeCurrentTransformIntoVertices(), this._gazeTracker.isPickable = !1, this._gazeTracker.isVisible = !1;
      const r = new Wt("targetMat", e);
      r.specularColor = Ne.Black(), r.emissiveColor = new Ne(0.7, 0.7, 0.7), r.backFaceCulling = !1, this._gazeTracker.material = r;
    }
  }
  /**
   * @internal
   */
  _getForwardRay(e) {
    return new Hi(S.Zero(), new S(0, 0, e));
  }
  /** @internal */
  _selectionPointerDown() {
    this._pointerDownOnMeshAsked = !0, this._currentHit && this.scene.simulatePointerDown(this._currentHit, { pointerId: this._id });
  }
  /** @internal */
  _selectionPointerUp() {
    this._currentHit && this.scene.simulatePointerUp(this._currentHit, { pointerId: this._id }), this._pointerDownOnMeshAsked = !1;
  }
  /** @internal */
  _activatePointer() {
    this._activePointer = !0;
  }
  /** @internal */
  _deactivatePointer() {
    this._activePointer = !1;
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _updatePointerDistance(e = 100) {
  }
  dispose() {
    this._interactionsEnabled = !1, this._teleportationEnabled = !1, this._gazeTracker && this._gazeTracker.dispose();
  }
}
YO._IdCounter = 0;
class pG extends YO {
  constructor(e, t) {
    super(t), this._getCamera = e;
  }
  _getForwardRay(e) {
    const t = this._getCamera();
    return t ? t.getForwardRay(e) : new Hi(S.Zero(), S.Forward());
  }
}
class jve {
}
class lm {
  /** Return this.onEnteringVRObservable
   * Note: This one is for backward compatibility. Please use onEnteringVRObservable directly
   */
  get onEnteringVR() {
    return this.onEnteringVRObservable;
  }
  /** Return this.onExitingVRObservable
   * Note: This one is for backward compatibility. Please use onExitingVRObservable directly
   */
  get onExitingVR() {
    return this.onExitingVRObservable;
  }
  /**
   * The mesh used to display where the user is going to teleport.
   */
  get teleportationTarget() {
    return this._teleportationTarget;
  }
  /**
   * Sets the mesh to be used to display where the user is going to teleport.
   */
  set teleportationTarget(e) {
    e && (e.name = "teleportationTarget", this._isDefaultTeleportationTarget = !1, this._teleportationTarget = e);
  }
  /**
   * The mesh used to display where the user is selecting, this mesh will be cloned and set as the gazeTracker for the left and right controller
   * when set bakeCurrentTransformIntoVertices will be called on the mesh.
   * See https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
   */
  get gazeTrackerMesh() {
    return this._cameraGazer._gazeTracker;
  }
  set gazeTrackerMesh(e) {
    e && (this._cameraGazer._gazeTracker && this._cameraGazer._gazeTracker.dispose(), this._cameraGazer._gazeTracker = e, this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices(), this._cameraGazer._gazeTracker.isPickable = !1, this._cameraGazer._gazeTracker.isVisible = !1, this._cameraGazer._gazeTracker.name = "gazeTracker");
  }
  /**
   * If the ray of the gaze should be displayed.
   */
  get displayGaze() {
    return this._displayGaze;
  }
  /**
   * Sets if the ray of the gaze should be displayed.
   */
  set displayGaze(e) {
    this._displayGaze = e, e || (this._cameraGazer._gazeTracker.isVisible = !1);
  }
  /**
   * If the ray of the LaserPointer should be displayed.
   */
  get displayLaserPointer() {
    return this._displayLaserPointer;
  }
  /**
   * Sets if the ray of the LaserPointer should be displayed.
   */
  set displayLaserPointer(e) {
    this._displayLaserPointer = e;
  }
  /**
   * The deviceOrientationCamera used as the camera when not in VR.
   */
  get deviceOrientationCamera() {
    return this._deviceOrientationCamera;
  }
  /**
   * Based on the current WebVR support, returns the current VR camera used.
   */
  get currentVRCamera() {
    return this._scene.activeCamera;
  }
  /**
   * The deviceOrientationCamera that is used as a fallback when vr device is not connected.
   */
  get vrDeviceOrientationCamera() {
    return this._vrDeviceOrientationCamera;
  }
  /**
   * The html button that is used to trigger entering into VR.
   */
  get vrButton() {
    return this._btnVR;
  }
  get _teleportationRequestInitiated() {
    return this._cameraGazer._teleportationRequestInitiated;
  }
  /**
   * Instantiates a VRExperienceHelper.
   * Helps to quickly add VR support to an existing scene.
   * @param scene The scene the VRExperienceHelper belongs to.
   * @param webVROptions Options to modify the vr experience helper's behavior.
   */
  constructor(e, t = {}) {
    if (this.webVROptions = t, this._fullscreenVRpresenting = !1, this.enableGazeEvenWhenNoPointerLock = !1, this.exitVROnDoubleTap = !0, this.onEnteringVRObservable = new Oe(), this.onAfterEnteringVRObservable = new Oe(), this.onExitingVRObservable = new Oe(), this._useCustomVRButton = !1, this._teleportActive = !1, this._floorMeshesCollection = [], this._teleportationMode = lm.TELEPORTATIONMODE_CONSTANTTIME, this._teleportationTime = 122, this._teleportationSpeed = 20, this._rotationAllowed = !0, this._teleportBackwardsVector = new S(0, -1, -1), this._isDefaultTeleportationTarget = !0, this._teleportationFillColor = "#444444", this._teleportationBorderColor = "#FFFFFF", this._rotationAngle = 0, this._haloCenter = new S(0, 0, 0), this._padSensibilityUp = 0.65, this._padSensibilityDown = 0.35, this._pickedLaserColor = new Ne(0.2, 0.2, 1), this._pickedGazeColor = new Ne(0, 0, 1), this.onNewMeshSelected = new Oe(), this.onNewMeshPicked = new Oe(), this.onBeforeCameraTeleport = new Oe(), this.onAfterCameraTeleport = new Oe(), this.onSelectedMeshUnselected = new Oe(), this.teleportationEnabled = !0, this._teleportationInitialized = !1, this._interactionsEnabled = !1, this._displayGaze = !0, this._displayLaserPointer = !0, this.updateGazeTrackerScale = !0, this.updateGazeTrackerColor = !0, this.updateControllerLaserColor = !0, this.requestPointerLockOnFullScreen = !0, this.xrTestDone = !1, this._onResize = () => {
      this._moveButtonToBottomRight();
    }, this._onFullscreenChange = () => {
      this._fullscreenVRpresenting = !!document.fullscreenElement, !this._fullscreenVRpresenting && this._inputElement && (this.exitVR(), !this._useCustomVRButton && this._btnVR && (this._btnVR.style.top = this._inputElement.offsetTop + this._inputElement.offsetHeight - 70 + "px", this._btnVR.style.left = this._inputElement.offsetLeft + this._inputElement.offsetWidth - 100 + "px", this._updateButtonVisibility()));
    }, this._cachedAngularSensibility = { angularSensibilityX: null, angularSensibilityY: null, angularSensibility: null }, this._beforeRender = () => {
      this._scene.getEngine().isPointerLock || this.enableGazeEvenWhenNoPointerLock || (this._cameraGazer._gazeTracker.isVisible = !1);
    }, this._onNewGamepadConnected = (n) => {
      n.type !== N9.POSE_ENABLED && (n.leftStick && n.onleftstickchanged((i) => {
        this._teleportationInitialized && this.teleportationEnabled && (this._checkTeleportWithRay(i, this._cameraGazer), this._checkTeleportBackwards(i, this._cameraGazer));
      }), n.rightStick && n.onrightstickchanged((i) => {
        this._teleportationInitialized && this._checkRotate(i, this._cameraGazer);
      }), n.type === N9.XBOX && (n.onbuttondown((i) => {
        this._interactionsEnabled && i === El.A && this._cameraGazer._selectionPointerDown();
      }), n.onbuttonup((i) => {
        this._interactionsEnabled && i === El.A && this._cameraGazer._selectionPointerUp();
      })));
    }, this._workingVector = S.Zero(), this._workingQuaternion = Ze.Identity(), this._workingMatrix = he.Identity(), Se.Warn("WebVR is deprecated. Please avoid using this experience helper and use the WebXR experience helper instead"), this._scene = e, this._inputElement = e.getEngine().getInputElement(), !("getVRDisplays" in navigator) && t.useXR === void 0 && (t.useXR = !0), t.createFallbackVRDeviceOrientationFreeCamera === void 0 && (t.createFallbackVRDeviceOrientationFreeCamera = !0), t.createDeviceOrientationCamera === void 0 && (t.createDeviceOrientationCamera = !0), t.laserToggle === void 0 && (t.laserToggle = !0), this._hasEnteredVR = !1, this._scene.activeCamera ? this._position = this._scene.activeCamera.position.clone() : this._position = new S(0, this._defaultHeight, 0), t.createDeviceOrientationCamera || !this._scene.activeCamera) {
      if (this._deviceOrientationCamera = new OO("deviceOrientationVRHelper", this._position.clone(), e), this._scene.activeCamera && (this._deviceOrientationCamera.minZ = this._scene.activeCamera.minZ, this._deviceOrientationCamera.maxZ = this._scene.activeCamera.maxZ, this._scene.activeCamera instanceof b1 && this._scene.activeCamera.rotation)) {
        const n = this._scene.activeCamera;
        n.rotationQuaternion ? this._deviceOrientationCamera.rotationQuaternion.copyFrom(n.rotationQuaternion) : this._deviceOrientationCamera.rotationQuaternion.copyFrom(Ze.RotationYawPitchRoll(n.rotation.y, n.rotation.x, n.rotation.z)), this._deviceOrientationCamera.rotation = n.rotation.clone();
      }
      this._scene.activeCamera = this._deviceOrientationCamera, this._inputElement && this._scene.activeCamera.attachControl();
    } else
      this._existingCamera = this._scene.activeCamera;
    this.webVROptions.useXR && navigator.xr ? MR.IsSessionSupportedAsync("immersive-vr").then((n) => {
      n ? (Se.Log("Using WebXR. It is recommended to use the WebXRDefaultExperience directly"), e.createDefaultXRExperienceAsync({
        floorMeshes: t.floorMeshes || []
      }).then((i) => {
        this.xr = i, this.xrTestDone = !0, this._cameraGazer = new pG(() => this.xr.baseExperience.camera, e), this.xr.baseExperience.onStateChangedObservable.add((s) => {
          switch (s) {
            case d9.ENTERING_XR:
              this.onEnteringVRObservable.notifyObservers(this), this._interactionsEnabled || this.xr.pointerSelection.detach(), this.xr.pointerSelection.displayLaserPointer = this._displayLaserPointer;
              break;
            case d9.EXITING_XR:
              this.onExitingVRObservable.notifyObservers(this), this._scene.getEngine().resize();
              break;
            case d9.IN_XR:
              this._hasEnteredVR = !0;
              break;
            case d9.NOT_IN_XR:
              this._hasEnteredVR = !1;
              break;
          }
        });
      })) : this._completeVRInit(e, t);
    }) : this._completeVRInit(e, t);
  }
  _completeVRInit(e, t) {
    if (this.xrTestDone = !0, t.createFallbackVRDeviceOrientationFreeCamera && (this._vrDeviceOrientationCamera = new EO("VRDeviceOrientationVRHelper", this._position, this._scene, !0, t.vrDeviceOrientationCameraMetrics), this._vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE), this._cameraGazer = new pG(() => this.currentVRCamera, e), !this._useCustomVRButton) {
      this._btnVR = document.createElement("BUTTON"), this._btnVR.className = "babylonVRicon", this._btnVR.id = "babylonVRiconbtn", this._btnVR.title = "Click to switch to VR";
      let i = ".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(" + (window.SVGSVGElement ? "data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A" : "https://cdn.babylonjs.com/Assets/vrButton.png") + "); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";
      i += ".babylonVRicon.vrdisplaypresenting { display: none; }";
      const s = document.createElement("style");
      s.appendChild(document.createTextNode(i)), document.getElementsByTagName("head")[0].appendChild(s), this._moveButtonToBottomRight();
    }
    this._btnVR && this._btnVR.addEventListener("click", () => {
      this.isInVRMode || this.enterVR();
    });
    const r = this._scene.getEngine().getHostWindow();
    r && (r.addEventListener("resize", this._onResize), document.addEventListener("fullscreenchange", this._onFullscreenChange, !1), t.createFallbackVRDeviceOrientationFreeCamera && this._displayVRButton(), this._onKeyDown = (n) => {
      n.keyCode === 27 && this.isInVRMode && this.exitVR();
    }, document.addEventListener("keydown", this._onKeyDown), this._scene.onPrePointerObservable.add(() => {
      this._hasEnteredVR && this.exitVROnDoubleTap && (this.exitVR(), this._fullscreenVRpresenting && this._scene.getEngine().exitFullscreen());
    }, ir.POINTERDOUBLETAP, !1), e.onDisposeObservable.add(() => {
      this.dispose();
    }), this._updateButtonVisibility(), this._circleEase = new Z$(), this._circleEase.setEasingMode(u1.EASINGMODE_EASEINOUT), this._teleportationEasing = this._circleEase, e.onPointerObservable.add((n) => {
      this._interactionsEnabled && e.activeCamera === this.vrDeviceOrientationCamera && n.event.pointerType === "mouse" && (n.type === ir.POINTERDOWN ? this._cameraGazer._selectionPointerDown() : n.type === ir.POINTERUP && this._cameraGazer._selectionPointerUp());
    }), this.webVROptions.floorMeshes && this.enableTeleportation({ floorMeshes: this.webVROptions.floorMeshes }));
  }
  /**
   * Gets a value indicating if we are currently in VR mode.
   */
  get isInVRMode() {
    return this.xr && this.webVROptions.useXR && this.xr.baseExperience.state === d9.IN_XR || this._fullscreenVRpresenting;
  }
  _moveButtonToBottomRight() {
    if (this._inputElement && !this._useCustomVRButton && this._btnVR) {
      const e = this._inputElement.getBoundingClientRect();
      this._btnVR.style.top = e.top + e.height - 70 + "px", this._btnVR.style.left = e.left + e.width - 100 + "px";
    }
  }
  _displayVRButton() {
    !this._useCustomVRButton && !this._btnVRDisplayed && this._btnVR && (document.body.appendChild(this._btnVR), this._btnVRDisplayed = !0);
  }
  _updateButtonVisibility() {
    !this._btnVR || this._useCustomVRButton || (this._btnVR.className = "babylonVRicon", this.isInVRMode && (this._btnVR.className += " vrdisplaypresenting"));
  }
  /**
   * Attempt to enter VR. If a headset is connected and ready, will request present on that.
   * Otherwise, will use the fullscreen API.
   */
  enterVR() {
    if (this.xr) {
      this.xr.baseExperience.enterXRAsync("immersive-vr", "local-floor", this.xr.renderTarget);
      return;
    }
    if (this.onEnteringVRObservable)
      try {
        this.onEnteringVRObservable.notifyObservers(this);
      } catch (e) {
        Se.Warn("Error in your custom logic onEnteringVR: " + e);
      }
    this._scene.activeCamera && (this._position = this._scene.activeCamera.position.clone(), this.vrDeviceOrientationCamera && (this.vrDeviceOrientationCamera.rotation = Ze.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles(), this.vrDeviceOrientationCamera.angularSensibility = 2e3), this._existingCamera = this._scene.activeCamera, this._existingCamera.angularSensibilityX && (this._cachedAngularSensibility.angularSensibilityX = this._existingCamera.angularSensibilityX, this._existingCamera.angularSensibilityX = Number.MAX_VALUE), this._existingCamera.angularSensibilityY && (this._cachedAngularSensibility.angularSensibilityY = this._existingCamera.angularSensibilityY, this._existingCamera.angularSensibilityY = Number.MAX_VALUE), this._existingCamera.angularSensibility && (this._cachedAngularSensibility.angularSensibility = this._existingCamera.angularSensibility, this._existingCamera.angularSensibility = Number.MAX_VALUE)), this._vrDeviceOrientationCamera && (this._vrDeviceOrientationCamera.position = this._position, this._scene.activeCamera && (this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ), this._scene.activeCamera = this._vrDeviceOrientationCamera, this._scene.getEngine().enterFullscreen(this.requestPointerLockOnFullScreen), this._updateButtonVisibility(), this._vrDeviceOrientationCamera.onViewMatrixChangedObservable.addOnce(() => {
      this.onAfterEnteringVRObservable.notifyObservers({ success: !0 });
    })), this._scene.activeCamera && this._inputElement && this._scene.activeCamera.attachControl(), this._interactionsEnabled && this._scene.registerBeforeRender(this._beforeRender), this._hasEnteredVR = !0;
  }
  /**
   * Attempt to exit VR, or fullscreen.
   */
  exitVR() {
    if (this.xr) {
      this.xr.baseExperience.exitXRAsync();
      return;
    }
    if (this._hasEnteredVR) {
      if (this.onExitingVRObservable)
        try {
          this.onExitingVRObservable.notifyObservers(this);
        } catch (e) {
          Se.Warn("Error in your custom logic onExitingVR: " + e);
        }
      this._scene.activeCamera && (this._position = this._scene.activeCamera.position.clone()), this.vrDeviceOrientationCamera && (this.vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE), this._deviceOrientationCamera ? (this._deviceOrientationCamera.position = this._position, this._scene.activeCamera = this._deviceOrientationCamera, this._cachedAngularSensibility.angularSensibilityX && (this._deviceOrientationCamera.angularSensibilityX = this._cachedAngularSensibility.angularSensibilityX, this._cachedAngularSensibility.angularSensibilityX = null), this._cachedAngularSensibility.angularSensibilityY && (this._deviceOrientationCamera.angularSensibilityY = this._cachedAngularSensibility.angularSensibilityY, this._cachedAngularSensibility.angularSensibilityY = null), this._cachedAngularSensibility.angularSensibility && (this._deviceOrientationCamera.angularSensibility = this._cachedAngularSensibility.angularSensibility, this._cachedAngularSensibility.angularSensibility = null)) : this._existingCamera && (this._existingCamera.position = this._position, this._scene.activeCamera = this._existingCamera, this._inputElement && this._scene.activeCamera.attachControl(), this._cachedAngularSensibility.angularSensibilityX && (this._existingCamera.angularSensibilityX = this._cachedAngularSensibility.angularSensibilityX, this._cachedAngularSensibility.angularSensibilityX = null), this._cachedAngularSensibility.angularSensibilityY && (this._existingCamera.angularSensibilityY = this._cachedAngularSensibility.angularSensibilityY, this._cachedAngularSensibility.angularSensibilityY = null), this._cachedAngularSensibility.angularSensibility && (this._existingCamera.angularSensibility = this._cachedAngularSensibility.angularSensibility, this._cachedAngularSensibility.angularSensibility = null)), this._updateButtonVisibility(), this._interactionsEnabled && (this._scene.unregisterBeforeRender(this._beforeRender), this._cameraGazer._gazeTracker.isVisible = !1), this._scene.getEngine().resize(), this._hasEnteredVR = !1;
    }
  }
  /**
   * The position of the vr experience helper.
   */
  get position() {
    return this._position;
  }
  /**
   * Sets the position of the vr experience helper.
   */
  set position(e) {
    this._position = e, this._scene.activeCamera && (this._scene.activeCamera.position = e);
  }
  /**
   * Enables controllers and user interactions such as selecting and object or clicking on an object.
   */
  enableInteractions() {
    if (!this._interactionsEnabled) {
      if (this.xr) {
        this.xr.baseExperience.state === d9.IN_XR && this.xr.pointerSelection.attach();
        return;
      }
      this.raySelectionPredicate = (e) => e.isVisible && (e.isPickable || e.name === this._floorMeshName), this.meshSelectionPredicate = () => !0, this._raySelectionPredicate = (e) => this._isTeleportationFloor(e) || e.name.indexOf("gazeTracker") === -1 && e.name.indexOf("teleportationTarget") === -1 && e.name.indexOf("torusTeleportation") === -1 ? this.raySelectionPredicate(e) : !1, this._interactionsEnabled = !0;
    }
  }
  _isTeleportationFloor(e) {
    for (let t = 0; t < this._floorMeshesCollection.length; t++)
      if (this._floorMeshesCollection[t].id === e.id)
        return !0;
    return !!(this._floorMeshName && e.name === this._floorMeshName);
  }
  /**
   * Adds a floor mesh to be used for teleportation.
   * @param floorMesh the mesh to be used for teleportation.
   */
  addFloorMesh(e) {
    this._floorMeshesCollection && (this._floorMeshesCollection.indexOf(e) > -1 || this._floorMeshesCollection.push(e));
  }
  /**
   * Removes a floor mesh from being used for teleportation.
   * @param floorMesh the mesh to be removed.
   */
  removeFloorMesh(e) {
    if (!this._floorMeshesCollection)
      return;
    const t = this._floorMeshesCollection.indexOf(e);
    t !== -1 && this._floorMeshesCollection.splice(t, 1);
  }
  /**
   * Enables interactions and teleportation using the VR controllers and gaze.
   * @param vrTeleportationOptions options to modify teleportation behavior.
   */
  enableTeleportation(e = {}) {
    if (!this._teleportationInitialized) {
      if (this.enableInteractions(), this.webVROptions.useXR && (e.floorMeshes || e.floorMeshName)) {
        const r = e.floorMeshes || [];
        if (!r.length) {
          const n = this._scene.getMeshByName(e.floorMeshName);
          n && r.push(n);
        }
        if (this.xr) {
          r.forEach((n) => {
            this.xr.teleportation.addFloorMesh(n);
          }), this.xr.teleportation.attached || this.xr.teleportation.attach();
          return;
        } else if (!this.xrTestDone) {
          const n = () => {
            this.xrTestDone && (this._scene.unregisterBeforeRender(n), this.xr ? this.xr.teleportation.attached || this.xr.teleportation.attach() : this.enableTeleportation(e));
          };
          this._scene.registerBeforeRender(n);
          return;
        }
      }
      e.floorMeshName && (this._floorMeshName = e.floorMeshName), e.floorMeshes && (this._floorMeshesCollection = e.floorMeshes), e.teleportationMode && (this._teleportationMode = e.teleportationMode), e.teleportationTime && e.teleportationTime > 0 && (this._teleportationTime = e.teleportationTime), e.teleportationSpeed && e.teleportationSpeed > 0 && (this._teleportationSpeed = e.teleportationSpeed), e.easingFunction !== void 0 && (this._teleportationEasing = e.easingFunction);
      const t = new Ui();
      t.vignetteColor = new xt(0, 0, 0, 0), t.vignetteEnabled = !0, this._teleportationInitialized = !0, this._isDefaultTeleportationTarget && this._createTeleportationCircles();
    }
  }
  _checkTeleportWithRay(e, t) {
    this._teleportationRequestInitiated && !t._teleportationRequestInitiated || (t._teleportationRequestInitiated ? Math.sqrt(e.y * e.y + e.x * e.x) < this._padSensibilityDown && (this._teleportActive && this.teleportCamera(this._haloCenter), t._teleportationRequestInitiated = !1) : e.y < -this._padSensibilityUp && t._dpadPressed && (t._activatePointer(), t._teleportationRequestInitiated = !0));
  }
  _checkRotate(e, t) {
    t._teleportationRequestInitiated || (t._rotationLeftAsked ? e.x > -this._padSensibilityDown && (t._rotationLeftAsked = !1) : e.x < -this._padSensibilityUp && t._dpadPressed && (t._rotationLeftAsked = !0, this._rotationAllowed && this._rotateCamera(!1)), t._rotationRightAsked ? e.x < this._padSensibilityDown && (t._rotationRightAsked = !1) : e.x > this._padSensibilityUp && t._dpadPressed && (t._rotationRightAsked = !0, this._rotationAllowed && this._rotateCamera(!0)));
  }
  _checkTeleportBackwards(e, t) {
    if (!t._teleportationRequestInitiated)
      if (e.y > this._padSensibilityUp && t._dpadPressed) {
        if (!t._teleportationBackRequestInitiated) {
          if (!this.currentVRCamera)
            return;
          const r = Ze.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix()), n = this.currentVRCamera.position;
          r.toEulerAnglesToRef(this._workingVector), this._workingVector.z = 0, this._workingVector.x = 0, Ze.RotationYawPitchRollToRef(this._workingVector.y, this._workingVector.x, this._workingVector.z, this._workingQuaternion), this._workingQuaternion.toRotationMatrix(this._workingMatrix), S.TransformCoordinatesToRef(this._teleportBackwardsVector, this._workingMatrix, this._workingVector);
          const i = new Hi(n, this._workingVector), s = this._scene.pickWithRay(i, this._raySelectionPredicate);
          s && s.pickedPoint && s.pickedMesh && this._isTeleportationFloor(s.pickedMesh) && s.distance < 5 && this.teleportCamera(s.pickedPoint), t._teleportationBackRequestInitiated = !0;
        }
      } else
        t._teleportationBackRequestInitiated = !1;
  }
  _createTeleportationCircles() {
    this._teleportationTarget = Wm("teleportationTarget", { width: 2, height: 2, subdivisions: 2 }, this._scene), this._teleportationTarget.isPickable = !1;
    const e = 512, t = new Xp("DynamicTexture", e, this._scene, !0);
    t.hasAlpha = !0;
    const r = t.getContext(), n = e / 2, i = e / 2, s = 200;
    r.beginPath(), r.arc(n, i, s, 0, 2 * Math.PI, !1), r.fillStyle = this._teleportationFillColor, r.fill(), r.lineWidth = 10, r.strokeStyle = this._teleportationBorderColor, r.stroke(), r.closePath(), t.update();
    const a = new Wt("TextPlaneMaterial", this._scene);
    a.diffuseTexture = t, this._teleportationTarget.material = a;
    const f = Ag("torusTeleportation", {
      diameter: 0.75,
      thickness: 0.1,
      tessellation: 25,
      updatable: !1
    }, this._scene);
    f.isPickable = !1, f.parent = this._teleportationTarget;
    const o = new st("animationInnerCircle", "position.y", 30, st.ANIMATIONTYPE_FLOAT, st.ANIMATIONLOOPMODE_CYCLE), d = [];
    d.push({
      frame: 0,
      value: 0
    }), d.push({
      frame: 30,
      value: 0.4
    }), d.push({
      frame: 60,
      value: 0
    }), o.setKeys(d);
    const v = new $N();
    v.setEasingMode(u1.EASINGMODE_EASEINOUT), o.setEasingFunction(v), f.animations = [], f.animations.push(o), this._scene.beginAnimation(f, 0, 60, !0), this._hideTeleportationTarget();
  }
  _hideTeleportationTarget() {
    this._teleportActive = !1, this._teleportationInitialized && (this._teleportationTarget.isVisible = !1, this._isDefaultTeleportationTarget && (this._teleportationTarget.getChildren()[0].isVisible = !1));
  }
  _rotateCamera(e) {
    if (!(this.currentVRCamera instanceof SA))
      return;
    e ? this._rotationAngle++ : this._rotationAngle--, this.currentVRCamera.animations = [];
    const t = Ze.FromRotationMatrix(he.RotationY(Math.PI / 4 * this._rotationAngle)), r = new st("animationRotation", "rotationQuaternion", 90, st.ANIMATIONTYPE_QUATERNION, st.ANIMATIONLOOPMODE_CONSTANT), n = [];
    n.push({
      frame: 0,
      value: this.currentVRCamera.rotationQuaternion
    }), n.push({
      frame: 6,
      value: t
    }), r.setKeys(n), r.setEasingFunction(this._circleEase), this.currentVRCamera.animations.push(r), this._postProcessMove.animations = [];
    const i = new st("animationPP", "vignetteWeight", 90, st.ANIMATIONTYPE_FLOAT, st.ANIMATIONLOOPMODE_CONSTANT), s = [];
    s.push({
      frame: 0,
      value: 0
    }), s.push({
      frame: 3,
      value: 4
    }), s.push({
      frame: 6,
      value: 0
    }), i.setKeys(s), i.setEasingFunction(this._circleEase), this._postProcessMove.animations.push(i);
    const a = new st("animationPP2", "vignetteStretch", 90, st.ANIMATIONTYPE_FLOAT, st.ANIMATIONLOOPMODE_CONSTANT), f = [];
    f.push({
      frame: 0,
      value: 0
    }), f.push({
      frame: 3,
      value: 10
    }), f.push({
      frame: 6,
      value: 0
    }), a.setKeys(f), a.setEasingFunction(this._circleEase), this._postProcessMove.animations.push(a), this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0, this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0, this._postProcessMove.samples = 4, this._scene.beginAnimation(this.currentVRCamera, 0, 6, !1, 1);
  }
  /**
   * Teleports the users feet to the desired location
   * @param location The location where the user's feet should be placed
   */
  teleportCamera(e) {
    if (!(this.currentVRCamera instanceof SA))
      return;
    this._workingVector.copyFrom(e), this.isInVRMode || (this._workingVector.y += this._defaultHeight), this.onBeforeCameraTeleport.notifyObservers(this._workingVector);
    const t = 90;
    let r, n;
    if (this._teleportationMode == lm.TELEPORTATIONMODE_CONSTANTSPEED) {
      n = t;
      const u = S.Distance(this.currentVRCamera.position, this._workingVector);
      r = this._teleportationSpeed / u;
    } else
      n = Math.round(this._teleportationTime * t / 1e3), r = 1;
    this.currentVRCamera.animations = [];
    const i = new st("animationCameraTeleportation", "position", t, st.ANIMATIONTYPE_VECTOR3, st.ANIMATIONLOOPMODE_CONSTANT), s = [
      {
        frame: 0,
        value: this.currentVRCamera.position
      },
      {
        frame: n,
        value: this._workingVector
      }
    ];
    i.setKeys(s), i.setEasingFunction(this._teleportationEasing), this.currentVRCamera.animations.push(i), this._postProcessMove.animations = [];
    const a = Math.round(n / 2), f = new st("animationPP", "vignetteWeight", t, st.ANIMATIONTYPE_FLOAT, st.ANIMATIONLOOPMODE_CONSTANT), o = [];
    o.push({
      frame: 0,
      value: 0
    }), o.push({
      frame: a,
      value: 8
    }), o.push({
      frame: n,
      value: 0
    }), f.setKeys(o), this._postProcessMove.animations.push(f);
    const d = new st("animationPP2", "vignetteStretch", t, st.ANIMATIONTYPE_FLOAT, st.ANIMATIONLOOPMODE_CONSTANT), v = [];
    v.push({
      frame: 0,
      value: 0
    }), v.push({
      frame: a,
      value: 10
    }), v.push({
      frame: n,
      value: 0
    }), d.setKeys(v), this._postProcessMove.animations.push(d), this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0, this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0, this._scene.beginAnimation(this.currentVRCamera, 0, n, !1, r, () => {
      this.onAfterCameraTeleport.notifyObservers(this._workingVector);
    }), this._hideTeleportationTarget();
  }
  /**
   * Permanently set new colors for the laser pointer
   * @param color the new laser color
   * @param pickedColor the new laser color when picked mesh detected
   */
  setLaserColor(e, t = this._pickedLaserColor) {
    this._pickedLaserColor = t;
  }
  /**
   * Set lighting enabled / disabled on the laser pointer of both controllers
   * @param enabled should the lighting be enabled on the laser pointer
   */
  setLaserLightingState(e = !0) {
  }
  /**
   * Permanently set new colors for the gaze pointer
   * @param color the new gaze color
   * @param pickedColor the new gaze color when picked mesh detected
   */
  setGazeColor(e, t = this._pickedGazeColor) {
    this._pickedGazeColor = t;
  }
  /**
   * Sets the color of the laser ray from the vr controllers.
   * @param color new color for the ray.
   */
  changeLaserColor(e) {
    this.updateControllerLaserColor;
  }
  /**
   * Sets the color of the ray from the vr headsets gaze.
   * @param color new color for the ray.
   */
  changeGazeColor(e) {
    this.updateGazeTrackerColor && this._cameraGazer._gazeTracker.material && (this._cameraGazer._gazeTracker.material.emissiveColor = e);
  }
  /**
   * Exits VR and disposes of the vr experience helper
   */
  dispose() {
    this.isInVRMode && this.exitVR(), this._postProcessMove && this._postProcessMove.dispose(), this._vrDeviceOrientationCamera && this._vrDeviceOrientationCamera.dispose(), !this._useCustomVRButton && this._btnVR && this._btnVR.parentNode && document.body.removeChild(this._btnVR), this._deviceOrientationCamera && this._scene.activeCamera != this._deviceOrientationCamera && this._deviceOrientationCamera.dispose(), this._cameraGazer && this._cameraGazer.dispose(), this._teleportationTarget && this._teleportationTarget.dispose(), this.xr && this.xr.dispose(), this._floorMeshesCollection.length = 0, document.removeEventListener("keydown", this._onKeyDown), window.removeEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChangeBind), window.removeEventListener("resize", this._onResize), document.removeEventListener("fullscreenchange", this._onFullscreenChange), this._scene.gamepadManager.onGamepadConnectedObservable.removeCallback(this._onNewGamepadConnected), this._scene.unregisterBeforeRender(this._beforeRender);
  }
  /**
   * Gets the name of the VRExperienceHelper class
   * @returns "VRExperienceHelper"
   */
  getClassName() {
    return "VRExperienceHelper";
  }
}
lm.TELEPORTATIONMODE_CONSTANTTIME = 0;
lm.TELEPORTATIONMODE_CONSTANTSPEED = 1;
const wve = (A, e, t, r) => !(A.x > t.x + r || t.x - r > e.x || A.y > t.y + r || t.y - r > e.y || A.z > t.z + r || t.z - r > e.z), BW = /* @__PURE__ */ function() {
  const A = { root: 0, found: !1 };
  return function(e, t, r, n) {
    A.root = 0, A.found = !1;
    const i = t * t - 4 * e * r;
    if (i < 0)
      return A;
    const s = Math.sqrt(i);
    let a = (-t - s) / (2 * e), f = (-t + s) / (2 * e);
    if (a > f) {
      const o = f;
      f = a, a = o;
    }
    return a > 0 && a < n ? (A.root = a, A.found = !0, A) : (f > 0 && f < n && (A.root = f, A.found = !0), A);
  };
}();
class LR {
  constructor() {
    this._collisionPoint = S.Zero(), this._planeIntersectionPoint = S.Zero(), this._tempVector = S.Zero(), this._tempVector2 = S.Zero(), this._tempVector3 = S.Zero(), this._tempVector4 = S.Zero(), this._edge = S.Zero(), this._baseToVertex = S.Zero(), this._destinationPoint = S.Zero(), this._slidePlaneNormal = S.Zero(), this._displacementVector = S.Zero(), this._radius = S.One(), this._retry = 0, this._basePointWorld = S.Zero(), this._velocityWorld = S.Zero(), this._normalizedVelocity = S.Zero(), this._collisionMask = -1;
  }
  get collisionMask() {
    return this._collisionMask;
  }
  set collisionMask(e) {
    this._collisionMask = isNaN(e) ? -1 : e;
  }
  /**
   * Gets the plane normal used to compute the sliding response (in local space)
   */
  get slidePlaneNormal() {
    return this._slidePlaneNormal;
  }
  // Methods
  /**
   * @internal
   */
  _initialize(e, t, r) {
    this._velocity = t, this._velocitySquaredLength = this._velocity.lengthSquared();
    const n = Math.sqrt(this._velocitySquaredLength);
    n === 0 || n === 1 ? this._normalizedVelocity.copyFromFloats(t._x, t._y, t._z) : t.scaleToRef(1 / n, this._normalizedVelocity), this._basePoint = e, e.multiplyToRef(this._radius, this._basePointWorld), t.multiplyToRef(this._radius, this._velocityWorld), this._velocityWorldLength = this._velocityWorld.length(), this._epsilon = r, this.collisionFound = !1;
  }
  /**
   * @internal
   */
  _checkPointInTriangle(e, t, r, n, i) {
    t.subtractToRef(e, this._tempVector), r.subtractToRef(e, this._tempVector2), S.CrossToRef(this._tempVector, this._tempVector2, this._tempVector4);
    let s = S.Dot(this._tempVector4, i);
    return s < 0 || (n.subtractToRef(e, this._tempVector3), S.CrossToRef(this._tempVector2, this._tempVector3, this._tempVector4), s = S.Dot(this._tempVector4, i), s < 0) ? !1 : (S.CrossToRef(this._tempVector3, this._tempVector, this._tempVector4), s = S.Dot(this._tempVector4, i), s >= 0);
  }
  /**
   * @internal
   */
  _canDoCollision(e, t, r, n) {
    const i = S.Distance(this._basePointWorld, e), s = Math.max(this._radius.x, this._radius.y, this._radius.z);
    return !(i > this._velocityWorldLength + s + t || !wve(r, n, this._basePointWorld, this._velocityWorldLength + s));
  }
  /**
   * @internal
   */
  _testTriangle(e, t, r, n, i, s, a) {
    let f, o = !1;
    t || (t = []), t[e] || (t[e] = new BA(0, 0, 0, 0), t[e].copyFromPoints(r, n, i));
    const d = t[e];
    if (!s && !d.isFrontFacingTo(this._normalizedVelocity, 0))
      return;
    const v = d.signedDistanceTo(this._basePoint), u = S.Dot(d.normal, this._velocity);
    if (LR.DoubleSidedCheck && u > 1e-4)
      return;
    if (u == 0) {
      if (Math.abs(v) >= 1)
        return;
      o = !0, f = 0;
    } else {
      f = (-1 - v) / u;
      let p = (1 - v) / u;
      if (f > p) {
        const c = p;
        p = f, f = c;
      }
      if (f > 1 || p < 0)
        return;
      f < 0 && (f = 0), f > 1 && (f = 1);
    }
    this._collisionPoint.copyFromFloats(0, 0, 0);
    let l = !1, P = 1;
    if (o || (this._basePoint.subtractToRef(d.normal, this._planeIntersectionPoint), this._velocity.scaleToRef(f, this._tempVector), this._planeIntersectionPoint.addInPlace(this._tempVector), this._checkPointInTriangle(this._planeIntersectionPoint, r, n, i, d.normal) && (l = !0, P = f, this._collisionPoint.copyFrom(this._planeIntersectionPoint))), !l) {
      let p = this._velocitySquaredLength;
      this._basePoint.subtractToRef(r, this._tempVector);
      let c = 2 * S.Dot(this._velocity, this._tempVector), H = this._tempVector.lengthSquared() - 1, T = BW(p, c, H, P);
      T.found && (P = T.root, l = !0, this._collisionPoint.copyFrom(r)), this._basePoint.subtractToRef(n, this._tempVector), c = 2 * S.Dot(this._velocity, this._tempVector), H = this._tempVector.lengthSquared() - 1, T = BW(p, c, H, P), T.found && (P = T.root, l = !0, this._collisionPoint.copyFrom(n)), this._basePoint.subtractToRef(i, this._tempVector), c = 2 * S.Dot(this._velocity, this._tempVector), H = this._tempVector.lengthSquared() - 1, T = BW(p, c, H, P), T.found && (P = T.root, l = !0, this._collisionPoint.copyFrom(i)), n.subtractToRef(r, this._edge), r.subtractToRef(this._basePoint, this._baseToVertex);
      let q = this._edge.lengthSquared(), b = S.Dot(this._edge, this._velocity), j = S.Dot(this._edge, this._baseToVertex);
      if (p = q * -this._velocitySquaredLength + b * b, c = 2 * (q * S.Dot(this._velocity, this._baseToVertex) - b * j), H = q * (1 - this._baseToVertex.lengthSquared()) + j * j, T = BW(p, c, H, P), T.found) {
        const w = (b * T.root - j) / q;
        w >= 0 && w <= 1 && (P = T.root, l = !0, this._edge.scaleInPlace(w), r.addToRef(this._edge, this._collisionPoint));
      }
      if (i.subtractToRef(n, this._edge), n.subtractToRef(this._basePoint, this._baseToVertex), q = this._edge.lengthSquared(), b = S.Dot(this._edge, this._velocity), j = S.Dot(this._edge, this._baseToVertex), p = q * -this._velocitySquaredLength + b * b, c = 2 * (q * S.Dot(this._velocity, this._baseToVertex) - b * j), H = q * (1 - this._baseToVertex.lengthSquared()) + j * j, T = BW(p, c, H, P), T.found) {
        const w = (b * T.root - j) / q;
        w >= 0 && w <= 1 && (P = T.root, l = !0, this._edge.scaleInPlace(w), n.addToRef(this._edge, this._collisionPoint));
      }
      if (r.subtractToRef(i, this._edge), i.subtractToRef(this._basePoint, this._baseToVertex), q = this._edge.lengthSquared(), b = S.Dot(this._edge, this._velocity), j = S.Dot(this._edge, this._baseToVertex), p = q * -this._velocitySquaredLength + b * b, c = 2 * (q * S.Dot(this._velocity, this._baseToVertex) - b * j), H = q * (1 - this._baseToVertex.lengthSquared()) + j * j, T = BW(p, c, H, P), T.found) {
        const w = (b * T.root - j) / q;
        w >= 0 && w <= 1 && (P = T.root, l = !0, this._edge.scaleInPlace(w), i.addToRef(this._edge, this._collisionPoint));
      }
    }
    if (l) {
      const p = P * P * this._velocitySquaredLength;
      (!this.collisionFound || p < this._nearestDistanceSquared) && (a.collisionResponse && (this.intersectionPoint ? this.intersectionPoint.copyFrom(this._collisionPoint) : this.intersectionPoint = this._collisionPoint.clone(), this._nearestDistanceSquared = p, this._nearestDistance = Math.sqrt(p), this.collisionFound = !0), this.collidedMesh = a);
    }
  }
  /**
   * @internal
   */
  _collide(e, t, r, n, i, s, a, f, o, d = !1) {
    if (d)
      if (!r || r.length === 0)
        for (let v = 0; v < t.length - 2; v += 1) {
          const u = t[v], l = t[v + 1], P = t[v + 2];
          !u || !l || !P || ((o ? 1 : 0) ^ v % 2 ? this._testTriangle(v, e, u, l, P, a, f) : this._testTriangle(v, e, l, u, P, a, f));
        }
      else
        for (let v = n; v < i - 2; v += 1) {
          const u = r[v], l = r[v + 1], P = r[v + 2];
          if (P === 4294967295) {
            v += 2;
            continue;
          }
          const p = t[u], c = t[l], H = t[P];
          !p || !c || !H || ((o ? 1 : 0) ^ v % 2 ? this._testTriangle(v, e, p, c, H, a, f) : this._testTriangle(v, e, c, p, H, a, f));
        }
    else if (!r || r.length === 0)
      for (let v = 0; v < t.length; v += 3) {
        const u = t[v], l = t[v + 1], P = t[v + 2];
        o ? this._testTriangle(v, e, u, l, P, a, f) : this._testTriangle(v, e, P, l, u, a, f);
      }
    else
      for (let v = n; v < i; v += 3) {
        const u = t[r[v] - s], l = t[r[v + 1] - s], P = t[r[v + 2] - s];
        o ? this._testTriangle(v, e, u, l, P, a, f) : this._testTriangle(v, e, P, l, u, a, f);
      }
  }
  /**
   * @internal
   */
  _getResponse(e, t) {
    e.addToRef(t, this._destinationPoint), t.scaleInPlace(this._nearestDistance / t.length()), this._basePoint.addToRef(t, e), e.subtractToRef(this.intersectionPoint, this._slidePlaneNormal), this._slidePlaneNormal.normalize(), this._slidePlaneNormal.scaleToRef(this._epsilon, this._displacementVector), e.addInPlace(this._displacementVector), this.intersectionPoint.addInPlace(this._displacementVector), this._slidePlaneNormal.scaleInPlace(BA.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint, this._slidePlaneNormal, this._destinationPoint)), this._destinationPoint.subtractInPlace(this._slidePlaneNormal), this._destinationPoint.subtractToRef(this.intersectionPoint, t);
  }
}
LR.DoubleSidedCheck = !1;
class _ee {
  constructor() {
    this._scaledPosition = S.Zero(), this._scaledVelocity = S.Zero(), this._finalPosition = S.Zero();
  }
  getNewPosition(e, t, r, n, i, s, a) {
    e.divideToRef(r._radius, this._scaledPosition), t.divideToRef(r._radius, this._scaledVelocity), r.collidedMesh = null, r._retry = 0, r._initialVelocity = this._scaledVelocity, r._initialPosition = this._scaledPosition, this._collideWithWorld(this._scaledPosition, this._scaledVelocity, r, n, this._finalPosition, i), this._finalPosition.multiplyInPlace(r._radius), s(a, this._finalPosition, r.collidedMesh);
  }
  createCollider() {
    return new LR();
  }
  init(e) {
    this._scene = e;
  }
  _collideWithWorld(e, t, r, n, i, s = null) {
    const a = Ge.CollisionsEpsilon * 10;
    if (r._retry >= n) {
      i.copyFrom(e);
      return;
    }
    const f = s ? s.collisionMask : r.collisionMask;
    r._initialize(e, t, a);
    const o = s && s.surroundingMeshes || this._scene.meshes;
    for (let d = 0; d < o.length; d++) {
      const v = o[d];
      v.isEnabled() && v.checkCollisions && v.subMeshes && v !== s && f & v.collisionGroup && v._checkCollision(r);
    }
    if (!r.collisionFound) {
      e.addToRef(t, i);
      return;
    }
    if ((t.x !== 0 || t.y !== 0 || t.z !== 0) && r._getResponse(e, t), t.length() <= a) {
      i.copyFrom(e);
      return;
    }
    r._retry++, this._collideWithWorld(e, t, r, n, i, s);
  }
}
sr.CollisionCoordinatorFactory = () => new _ee();
class Pm {
  /**
   * Creates a compute effect that can be used to execute a compute shader
   * @param baseName Name of the effect
   * @param options Set of all options to create the effect
   * @param engine The engine the effect is created for
   * @param key Effect Key identifying uniquely compiled shader variants
   */
  constructor(e, t, r, n = "") {
    var i, s;
    this.name = null, this.defines = "", this.onCompiled = null, this.onError = null, this.uniqueId = 0, this.onCompileObservable = new Oe(), this.onErrorObservable = new Oe(), this.onBindObservable = new Oe(), this._wasPreviouslyReady = !1, this._isReady = !1, this._compilationError = "", this._key = "", this._computeSourceCodeOverride = "", this._pipelineContext = null, this._computeSourceCode = "", this._rawComputeSourceCode = "", this._shaderLanguage = za.WGSL, this.name = e, this._key = n, this._engine = r, this.uniqueId = Pm._UniqueIdSeed++, this.defines = (i = t.defines) !== null && i !== void 0 ? i : "", this.onError = t.onError, this.onCompiled = t.onCompiled, this._entryPoint = (s = t.entryPoint) !== null && s !== void 0 ? s : "main", this._shaderStore = Le.GetShadersStore(this._shaderLanguage), this._shaderRepository = Le.GetShadersRepository(this._shaderLanguage), this._includeShaderStore = Le.GetIncludesShadersStore(this._shaderLanguage);
    let a;
    const f = u9() ? this._engine.getHostDocument() : null;
    e.computeSource ? a = "source:" + e.computeSource : e.computeElement ? (a = f ? f.getElementById(e.computeElement) : null, a || (a = e.computeElement)) : a = e.compute || e;
    const o = {
      defines: this.defines.split(`
`),
      indexParameters: void 0,
      isFragment: !1,
      shouldUseHighPrecisionShader: !1,
      processor: null,
      supportsUniformBuffers: this._engine.supportsUniformBuffers,
      shadersRepository: this._shaderRepository,
      includesShadersStore: this._includeShaderStore,
      version: (this._engine.version * 100).toString(),
      platformName: this._engine.shaderPlatformName,
      processingContext: null,
      isNDCHalfZRange: this._engine.isNDCHalfZRange,
      useReverseDepthBuffer: this._engine.useReverseDepthBuffer
    };
    this._loadShader(a, "Compute", "", (d) => {
      hp.Initialize(o), hp.PreProcess(d, o, (v) => {
        this._rawComputeSourceCode = d, t.processFinalCode && (v = t.processFinalCode(v));
        const u = hp.Finalize(v, "", o);
        this._useFinalCode(u.vertexCode, e);
      }, this._engine);
    });
  }
  _useFinalCode(e, t) {
    if (t) {
      const r = t.computeElement || t.compute || t.spectorName || t;
      this._computeSourceCode = "//#define SHADER_NAME compute:" + r + `
` + e;
    } else
      this._computeSourceCode = e;
    this._prepareEffect();
  }
  /**
   * Unique key for this effect
   */
  get key() {
    return this._key;
  }
  /**
   * If the effect has been compiled and prepared.
   * @returns if the effect is compiled and prepared.
   */
  isReady() {
    try {
      return this._isReadyInternal();
    } catch {
      return !1;
    }
  }
  _isReadyInternal() {
    return this._isReady ? !0 : this._pipelineContext ? this._pipelineContext.isReady : !1;
  }
  /**
   * The engine the effect was initialized with.
   * @returns the engine.
   */
  getEngine() {
    return this._engine;
  }
  /**
   * The pipeline context for this effect
   * @returns the associated pipeline context
   */
  getPipelineContext() {
    return this._pipelineContext;
  }
  /**
   * The error from the last compilation.
   * @returns the error string.
   */
  getCompilationError() {
    return this._compilationError;
  }
  /**
   * Adds a callback to the onCompiled observable and call the callback immediately if already ready.
   * @param func The callback to be used.
   */
  executeWhenCompiled(e) {
    if (this.isReady()) {
      e(this);
      return;
    }
    this.onCompileObservable.add((t) => {
      e(t);
    }), (!this._pipelineContext || this._pipelineContext.isAsync) && setTimeout(() => {
      this._checkIsReady(null);
    }, 16);
  }
  _checkIsReady(e) {
    try {
      if (this._isReadyInternal())
        return;
    } catch (t) {
      this._processCompilationErrors(t, e);
      return;
    }
    setTimeout(() => {
      this._checkIsReady(e);
    }, 16);
  }
  _loadShader(e, t, r, n) {
    if (typeof HTMLElement < "u" && e instanceof HTMLElement) {
      const s = gR(e);
      n(s);
      return;
    }
    if (e.substr(0, 7) === "source:") {
      n(e.substr(7));
      return;
    }
    if (e.substr(0, 7) === "base64:") {
      const s = window.atob(e.substr(7));
      n(s);
      return;
    }
    if (this._shaderStore[e + t + "Shader"]) {
      n(this._shaderStore[e + t + "Shader"]);
      return;
    }
    if (r && this._shaderStore[e + r + "Shader"]) {
      n(this._shaderStore[e + r + "Shader"]);
      return;
    }
    let i;
    e[0] === "." || e[0] === "/" || e.indexOf("http") > -1 ? i = e : i = this._shaderRepository + e, this._engine._loadFile(i + "." + t.toLowerCase() + ".fx", n);
  }
  /**
   * Gets the compute shader source code of this effect
   */
  get computeSourceCode() {
    var e, t;
    return this._computeSourceCodeOverride ? this._computeSourceCodeOverride : (t = (e = this._pipelineContext) === null || e === void 0 ? void 0 : e._getComputeShaderCode()) !== null && t !== void 0 ? t : this._computeSourceCode;
  }
  /**
   * Gets the compute shader source code before it has been processed by the preprocessor
   */
  get rawComputeSourceCode() {
    return this._rawComputeSourceCode;
  }
  /**
   * Prepares the effect
   * @internal
   */
  _prepareEffect() {
    const e = this.defines, t = this._pipelineContext;
    this._isReady = !1;
    try {
      const r = this._engine;
      this._pipelineContext = r.createComputePipelineContext(), this._pipelineContext._name = this._key, r._prepareComputePipelineContext(this._pipelineContext, this._computeSourceCodeOverride ? this._computeSourceCodeOverride : this._computeSourceCode, this._rawComputeSourceCode, this._computeSourceCodeOverride ? null : e, this._entryPoint), r._executeWhenComputeStateIsCompiled(this._pipelineContext, () => {
        this._compilationError = "", this._isReady = !0, this.onCompiled && this.onCompiled(this), this.onCompileObservable.notifyObservers(this), this.onCompileObservable.clear(), t && this.getEngine()._deleteComputePipelineContext(t);
      }), this._pipelineContext.isAsync && this._checkIsReady(t);
    } catch (r) {
      this._processCompilationErrors(r, t);
    }
  }
  _getShaderCodeAndErrorLine(e, t) {
    const r = /COMPUTE SHADER ERROR: 0:(\d+?):/;
    let n = null;
    if (t && e) {
      const i = t.match(r);
      if (i && i.length === 2) {
        const s = parseInt(i[1]), a = e.split(`
`, -1);
        a.length >= s && (n = `Offending line [${s}] in compute code: ${a[s - 1]}`);
      }
    }
    return [e, n];
  }
  _processCompilationErrors(e, t = null) {
    var r;
    if (this._compilationError = e.message, Se.Error("Unable to compile compute effect:"), Se.Error(`Defines:
` + this.defines), Pm.LogShaderCodeOnCompilationError) {
      let n = null, i = null;
      !((r = this._pipelineContext) === null || r === void 0) && r._getComputeShaderCode() && ([i, n] = this._getShaderCodeAndErrorLine(this._pipelineContext._getComputeShaderCode(), this._compilationError), i && (Se.Error("Compute code:"), Se.Error(i))), n && Se.Error(n);
    }
    Se.Error("Error: " + this._compilationError), t && (this._pipelineContext = t, this._isReady = !0, this.onError && this.onError(this, this._compilationError), this.onErrorObservable.notifyObservers(this));
  }
  /**
   * Release all associated resources.
   **/
  dispose() {
    this._pipelineContext && this._pipelineContext.dispose(), this._engine._releaseComputeEffect(this);
  }
  /**
   * This function will add a new compute shader to the shader store
   * @param name the name of the shader
   * @param computeShader compute shader content
   */
  static RegisterShader(e, t) {
    Le.GetShadersStore(za.WGSL)[`${e}ComputeShader`] = t;
  }
}
Pm._UniqueIdSeed = 0;
Pm.LogShaderCodeOnCompilationError = !0;
var io;
(function(A) {
  A[A.Texture = 0] = "Texture", A[A.StorageTexture = 1] = "StorageTexture", A[A.UniformBuffer = 2] = "UniformBuffer", A[A.StorageBuffer = 3] = "StorageBuffer", A[A.TextureWithoutSampler = 4] = "TextureWithoutSampler", A[A.Sampler = 5] = "Sampler", A[A.ExternalTexture = 6] = "ExternalTexture";
})(io || (io = {}));
hr.prototype.createComputeEffect = function(A, e) {
  throw new Error("createComputeEffect: This engine does not support compute shaders!");
};
hr.prototype.createComputePipelineContext = function() {
  throw new Error("createComputePipelineContext: This engine does not support compute shaders!");
};
hr.prototype.createComputeContext = function() {
};
hr.prototype.computeDispatch = function(A, e, t, r, n, i, s) {
  throw new Error("computeDispatch: This engine does not support compute shaders!");
};
hr.prototype.areAllComputeEffectsReady = function() {
  return !0;
};
hr.prototype.releaseComputeEffects = function() {
};
hr.prototype._prepareComputePipelineContext = function(A, e, t, r, n) {
};
hr.prototype._rebuildComputeEffects = function() {
};
hr.prototype._executeWhenComputeStateIsCompiled = function(A, e) {
  e();
};
hr.prototype._releaseComputeEffect = function(A) {
};
hr.prototype._deleteComputePipelineContext = function(A) {
};
class vU {
  /**
   * The options used to create the shader
   */
  get options() {
    return this._options;
  }
  /**
   * The shaderPath used to create the shader
   */
  get shaderPath() {
    return this._shaderPath;
  }
  /**
   * Instantiates a new compute shader.
   * @param name Defines the name of the compute shader in the scene
   * @param engine Defines the engine the compute shader belongs to
   * @param shaderPath Defines  the route to the shader code in one of three ways:
   *  * object: \{ compute: "custom" \}, used with ShaderStore.ShadersStoreWGSL["customComputeShader"]
   *  * object: \{ computeElement: "HTMLElementId" \}, used with shader code in script tags
   *  * object: \{ computeSource: "compute shader code string" \}, where the string contains the shader code
   *  * string: try first to find the code in ShaderStore.ShadersStoreWGSL[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder.
   * @param options Define the options used to create the shader
   */
  constructor(e, t, r, n = {}) {
    if (this._bindings = {}, this._samplers = {}, this._contextIsDirty = !1, this.onCompiled = null, this.onError = null, this.name = e, this._engine = t, this.uniqueId = bR.UniqueId, !this._engine.getCaps().supportComputeShaders) {
      Se.Error("This engine does not support compute shaders!");
      return;
    }
    if (!n.bindingsMapping) {
      Se.Error("You must provide the binding mappings as browsers don't support reflection for wgsl shaders yet!");
      return;
    }
    this._context = t.createComputeContext(), this._shaderPath = r, this._options = Object.assign({ bindingsMapping: {}, defines: [] }, n);
  }
  /**
   * Gets the current class name of the material e.g. "ComputeShader"
   * Mainly use in serialization.
   * @returns the class name
   */
  getClassName() {
    return "ComputeShader";
  }
  /**
   * Binds a texture to the shader
   * @param name Binding name of the texture
   * @param texture Texture to bind
   * @param bindSampler Bind the sampler corresponding to the texture (default: true). The sampler will be bound just before the binding index of the texture
   */
  setTexture(e, t, r = !0) {
    const n = this._bindings[e];
    this._bindings[e] = {
      type: r ? io.Texture : io.TextureWithoutSampler,
      object: t,
      indexInGroupEntries: n == null ? void 0 : n.indexInGroupEntries
    }, this._contextIsDirty || (this._contextIsDirty = !n || n.object !== t || n.type !== this._bindings[e].type);
  }
  /**
   * Binds a storage texture to the shader
   * @param name Binding name of the texture
   * @param texture Texture to bind
   */
  setStorageTexture(e, t) {
    const r = this._bindings[e];
    this._contextIsDirty || (this._contextIsDirty = !r || r.object !== t), this._bindings[e] = {
      type: io.StorageTexture,
      object: t,
      indexInGroupEntries: r == null ? void 0 : r.indexInGroupEntries
    };
  }
  /**
   * Binds an external texture to the shader
   * @param name Binding name of the texture
   * @param texture Texture to bind
   */
  setExternalTexture(e, t) {
    const r = this._bindings[e];
    this._contextIsDirty || (this._contextIsDirty = !r || r.object !== t), this._bindings[e] = {
      type: io.ExternalTexture,
      object: t,
      indexInGroupEntries: r == null ? void 0 : r.indexInGroupEntries
    };
  }
  /**
   * Binds a video texture to the shader (by binding the external texture attached to this video)
   * @param name Binding name of the texture
   * @param texture Texture to bind
   * @returns true if the video texture was successfully bound, else false. false will be returned if the current engine does not support external textures
   */
  setVideoTexture(e, t) {
    return t.externalTexture ? (this.setExternalTexture(e, t.externalTexture), !0) : !1;
  }
  /**
   * Binds a uniform buffer to the shader
   * @param name Binding name of the buffer
   * @param buffer Buffer to bind
   */
  setUniformBuffer(e, t) {
    const r = this._bindings[e];
    this._contextIsDirty || (this._contextIsDirty = !r || r.object !== t), this._bindings[e] = {
      type: io.UniformBuffer,
      object: t,
      indexInGroupEntries: r == null ? void 0 : r.indexInGroupEntries
    };
  }
  /**
   * Binds a storage buffer to the shader
   * @param name Binding name of the buffer
   * @param buffer Buffer to bind
   */
  setStorageBuffer(e, t) {
    const r = this._bindings[e];
    this._contextIsDirty || (this._contextIsDirty = !r || r.object !== t), this._bindings[e] = {
      type: io.StorageBuffer,
      object: t,
      indexInGroupEntries: r == null ? void 0 : r.indexInGroupEntries
    };
  }
  /**
   * Binds a texture sampler to the shader
   * @param name Binding name of the sampler
   * @param sampler Sampler to bind
   */
  setTextureSampler(e, t) {
    const r = this._bindings[e];
    this._contextIsDirty || (this._contextIsDirty = !r || !t.compareSampler(r.object)), this._bindings[e] = {
      type: io.Sampler,
      object: t,
      indexInGroupEntries: r == null ? void 0 : r.indexInGroupEntries
    };
  }
  /**
   * Specifies that the compute shader is ready to be executed (the compute effect and all the resources are ready)
   * @returns true if the compute shader is ready to be executed
   */
  isReady() {
    let e = this._effect;
    for (const i in this._bindings) {
      const s = this._bindings[i], a = s.type, f = s.object;
      switch (a) {
        case io.Texture:
        case io.TextureWithoutSampler:
        case io.StorageTexture: {
          if (!f.isReady())
            return !1;
          break;
        }
        case io.ExternalTexture: {
          if (!f.isReady())
            return !1;
          break;
        }
      }
    }
    const t = [], r = this._shaderPath;
    if (this._options.defines)
      for (let i = 0; i < this._options.defines.length; i++)
        t.push(this._options.defines[i]);
    const n = t.join(`
`);
    return this._cachedDefines !== n && (this._cachedDefines = n, e = this._engine.createComputeEffect(r, {
      defines: n,
      entryPoint: this._options.entryPoint,
      onCompiled: this.onCompiled,
      onError: this.onError
    }), this._effect = e), !!e.isReady();
  }
  /**
   * Dispatches (executes) the compute shader
   * @param x Number of workgroups to execute on the X dimension
   * @param y Number of workgroups to execute on the Y dimension (default: 1)
   * @param z Number of workgroups to execute on the Z dimension (default: 1)
   * @returns True if the dispatch could be done, else false (meaning either the compute effect or at least one of the bound resources was not ready)
   */
  dispatch(e, t, r) {
    var n;
    if (!this.isReady())
      return !1;
    for (const i in this._bindings) {
      const s = this._bindings[i];
      if (!this._options.bindingsMapping[i])
        throw new Error("ComputeShader ('" + this.name + "'): No binding mapping has been provided for the property '" + i + "'");
      switch (s.type) {
        case io.Texture: {
          const a = this._samplers[i], f = s.object;
          (!a || !f._texture || !a.compareSampler(f._texture)) && (this._samplers[i] = new MN().setParameters(f.wrapU, f.wrapV, f.wrapR, f.anisotropicFilteringLevel, f._texture.samplingMode, (n = f._texture) === null || n === void 0 ? void 0 : n._comparisonFunction), this._contextIsDirty = !0);
          break;
        }
        case io.ExternalTexture: {
          this._contextIsDirty = !0;
          break;
        }
        case io.UniformBuffer: {
          const a = s.object;
          a.getBuffer() !== s.buffer && (s.buffer = a.getBuffer(), this._contextIsDirty = !0);
          break;
        }
      }
    }
    return this._contextIsDirty && (this._contextIsDirty = !1, this._context.clear()), this._engine.computeDispatch(this._effect, this._context, this._bindings, e, t, r, this._options.bindingsMapping), !0;
  }
  /**
   * Waits for the compute shader to be ready and executes it
   * @param x Number of workgroups to execute on the X dimension
   * @param y Number of workgroups to execute on the Y dimension (default: 1)
   * @param z Number of workgroups to execute on the Z dimension (default: 1)
   * @param delay Delay between the retries while the shader is not ready (in milliseconds - 10 by default)
   * @returns A promise that is resolved once the shader has been sent to the GPU. Note that it does not mean that the shader execution itself is finished!
   */
  dispatchWhenReady(e, t, r, n = 10) {
    return new Promise((i) => {
      const s = () => {
        this.dispatch(e, t, r) ? i() : setTimeout(s, n);
      };
      s();
    });
  }
  /**
   * Serializes this compute shader in a JSON representation
   * @returns the serialized compute shader object
   */
  serialize() {
    const e = jt.Serialize(this);
    e.options = this._options, e.shaderPath = this._shaderPath, e.bindings = {}, e.textures = {};
    for (const t in this._bindings) {
      const r = this._bindings[t], n = r.object;
      switch (r.type) {
        case io.Texture:
        case io.TextureWithoutSampler:
        case io.StorageTexture: {
          const i = n.serialize();
          i && (e.textures[t] = i, e.bindings[t] = {
            type: r.type
          });
          break;
        }
        case io.UniformBuffer:
          break;
      }
    }
    return e;
  }
  /**
   * Creates a compute shader from parsed compute shader data
   * @param source defines the JSON representation of the compute shader
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a new compute shader
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => new vU(e.name, t.getEngine(), e.shaderPath, e.options), e, t, r);
    for (const i in e.textures) {
      const s = e.bindings[i], a = We.Parse(e.textures[i], t, r);
      s.type === io.Texture ? n.setTexture(i, a) : s.type === io.TextureWithoutSampler ? n.setTexture(i, a, !1) : n.setStorageTexture(i, a);
    }
    return n;
  }
}
C([
  M()
], vU.prototype, "name", void 0);
Ue("BABYLON.ComputeShader", vU);
class NI {
  /**
   * Creates a new block
   * @param minPoint defines the minimum vector (in world space) of the block's bounding box
   * @param maxPoint defines the maximum vector (in world space) of the block's bounding box
   * @param capacity defines the maximum capacity of this block (if capacity is reached the block will be split into sub blocks)
   * @param depth defines the current depth of this block in the octree
   * @param maxDepth defines the maximal depth allowed (beyond this value, the capacity is ignored)
   * @param creationFunc defines a callback to call when an element is added to the block
   */
  constructor(e, t, r, n, i, s) {
    this.entries = [], this._boundingVectors = new Array(), this._capacity = r, this._depth = n, this._maxDepth = i, this._creationFunc = s, this._minPoint = e, this._maxPoint = t, this._boundingVectors.push(e.clone()), this._boundingVectors.push(t.clone()), this._boundingVectors.push(e.clone()), this._boundingVectors[2].x = t.x, this._boundingVectors.push(e.clone()), this._boundingVectors[3].y = t.y, this._boundingVectors.push(e.clone()), this._boundingVectors[4].z = t.z, this._boundingVectors.push(t.clone()), this._boundingVectors[5].z = e.z, this._boundingVectors.push(t.clone()), this._boundingVectors[6].x = e.x, this._boundingVectors.push(t.clone()), this._boundingVectors[7].y = e.y;
  }
  // Property
  /**
   * Gets the maximum capacity of this block (if capacity is reached the block will be split into sub blocks)
   */
  get capacity() {
    return this._capacity;
  }
  /**
   * Gets the minimum vector (in world space) of the block's bounding box
   */
  get minPoint() {
    return this._minPoint;
  }
  /**
   * Gets the maximum vector (in world space) of the block's bounding box
   */
  get maxPoint() {
    return this._maxPoint;
  }
  // Methods
  /**
   * Add a new element to this block
   * @param entry defines the element to add
   */
  addEntry(e) {
    if (this.blocks) {
      for (let t = 0; t < this.blocks.length; t++)
        this.blocks[t].addEntry(e);
      return;
    }
    this._creationFunc(e, this), this.entries.length > this.capacity && this._depth < this._maxDepth && this.createInnerBlocks();
  }
  /**
   * Remove an element from this block
   * @param entry defines the element to remove
   */
  removeEntry(e) {
    if (this.blocks) {
      for (let r = 0; r < this.blocks.length; r++)
        this.blocks[r].removeEntry(e);
      return;
    }
    const t = this.entries.indexOf(e);
    t > -1 && this.entries.splice(t, 1);
  }
  /**
   * Add an array of elements to this block
   * @param entries defines the array of elements to add
   */
  addEntries(e) {
    for (let t = 0; t < e.length; t++) {
      const r = e[t];
      this.addEntry(r);
    }
  }
  /**
   * Test if the current block intersects the frustum planes and if yes, then add its content to the selection array
   * @param frustumPlanes defines the frustum planes to test
   * @param selection defines the array to store current content if selection is positive
   * @param allowDuplicate defines if the selection array can contains duplicated entries
   */
  select(e, t, r) {
    if (cp.IsInFrustum(this._boundingVectors, e)) {
      if (this.blocks) {
        for (let n = 0; n < this.blocks.length; n++)
          this.blocks[n].select(e, t, r);
        return;
      }
      r ? t.concat(this.entries) : t.concatWithNoDuplicate(this.entries);
    }
  }
  /**
   * Test if the current block intersect with the given bounding sphere and if yes, then add its content to the selection array
   * @param sphereCenter defines the bounding sphere center
   * @param sphereRadius defines the bounding sphere radius
   * @param selection defines the array to store current content if selection is positive
   * @param allowDuplicate defines if the selection array can contains duplicated entries
   */
  intersects(e, t, r, n) {
    if (cp.IntersectsSphere(this._minPoint, this._maxPoint, e, t)) {
      if (this.blocks) {
        for (let i = 0; i < this.blocks.length; i++)
          this.blocks[i].intersects(e, t, r, n);
        return;
      }
      n ? r.concat(this.entries) : r.concatWithNoDuplicate(this.entries);
    }
  }
  /**
   * Test if the current block intersect with the given ray and if yes, then add its content to the selection array
   * @param ray defines the ray to test with
   * @param selection defines the array to store current content if selection is positive
   */
  intersectsRay(e, t) {
    if (e.intersectsBoxMinMax(this._minPoint, this._maxPoint)) {
      if (this.blocks) {
        for (let r = 0; r < this.blocks.length; r++)
          this.blocks[r].intersectsRay(e, t);
        return;
      }
      t.concatWithNoDuplicate(this.entries);
    }
  }
  /**
   * Subdivide the content into child blocks (this block will then be empty)
   */
  createInnerBlocks() {
    NI._CreateBlocks(this._minPoint, this._maxPoint, this.entries, this._capacity, this._depth, this._maxDepth, this, this._creationFunc), this.entries.splice(0);
  }
  /**
   * @internal
   */
  static _CreateBlocks(e, t, r, n, i, s, a, f) {
    a.blocks = new Array();
    const o = new S((t.x - e.x) / 2, (t.y - e.y) / 2, (t.z - e.z) / 2);
    for (let d = 0; d < 2; d++)
      for (let v = 0; v < 2; v++)
        for (let u = 0; u < 2; u++) {
          const l = e.add(o.multiplyByFloats(d, v, u)), P = e.add(o.multiplyByFloats(d + 1, v + 1, u + 1)), p = new NI(l, P, n, i + 1, s, f);
          p.addEntries(r), a.blocks.push(p);
        }
  }
}
class cm {
  /**
   * Creates a octree
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeOctrees
   * @param creationFunc function to be used to instantiate the octree
   * @param maxBlockCapacity defines the maximum number of meshes you want on your octree's leaves (default: 64)
   * @param maxDepth defines the maximum depth (sub-levels) for your octree. Default value is 2, which means 8 8 8 = 512 blocks :) (This parameter takes precedence over capacity.)
   */
  constructor(e, t, r = 2) {
    this.maxDepth = r, this.dynamicContent = [], this._maxBlockCapacity = t || 64, this._selectionContent = new K8(1024), this._creationFunc = e;
  }
  // Methods
  /**
   * Updates the octree by adding blocks for the passed in meshes within the min and max world parameters
   * @param worldMin worldMin for the octree blocks var blockSize = new Vector3((worldMax.x - worldMin.x) / 2, (worldMax.y - worldMin.y) / 2, (worldMax.z - worldMin.z) / 2);
   * @param worldMax worldMax for the octree blocks var blockSize = new Vector3((worldMax.x - worldMin.x) / 2, (worldMax.y - worldMin.y) / 2, (worldMax.z - worldMin.z) / 2);
   * @param entries meshes to be added to the octree blocks
   */
  update(e, t, r) {
    NI._CreateBlocks(e, t, r, this._maxBlockCapacity, 0, this.maxDepth, this, this._creationFunc);
  }
  /**
   * Adds a mesh to the octree
   * @param entry Mesh to add to the octree
   */
  addMesh(e) {
    for (let t = 0; t < this.blocks.length; t++)
      this.blocks[t].addEntry(e);
  }
  /**
   * Remove an element from the octree
   * @param entry defines the element to remove
   */
  removeMesh(e) {
    for (let t = 0; t < this.blocks.length; t++)
      this.blocks[t].removeEntry(e);
  }
  /**
   * Selects an array of meshes within the frustum
   * @param frustumPlanes The frustum planes to use which will select all meshes within it
   * @param allowDuplicate If duplicate objects are allowed in the resulting object array
   * @returns array of meshes within the frustum
   */
  select(e, t) {
    this._selectionContent.reset();
    for (let r = 0; r < this.blocks.length; r++)
      this.blocks[r].select(e, this._selectionContent, t);
    return t ? this._selectionContent.concat(this.dynamicContent) : this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;
  }
  /**
   * Test if the octree intersect with the given bounding sphere and if yes, then add its content to the selection array
   * @param sphereCenter defines the bounding sphere center
   * @param sphereRadius defines the bounding sphere radius
   * @param allowDuplicate defines if the selection array can contains duplicated entries
   * @returns an array of objects that intersect the sphere
   */
  intersects(e, t, r) {
    this._selectionContent.reset();
    for (let n = 0; n < this.blocks.length; n++)
      this.blocks[n].intersects(e, t, this._selectionContent, r);
    return r ? this._selectionContent.concat(this.dynamicContent) : this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;
  }
  /**
   * Test if the octree intersect with the given ray and if yes, then add its content to resulting array
   * @param ray defines the ray to test with
   * @returns array of intersected objects
   */
  intersectsRay(e) {
    this._selectionContent.reset();
    for (let t = 0; t < this.blocks.length; t++)
      this.blocks[t].intersectsRay(e, this._selectionContent);
    return this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;
  }
}
cm.CreationFuncForMeshes = (A, e) => {
  const t = A.getBoundingInfo();
  !A.isBlocked && t.boundingBox.intersectsMinMax(e.minPoint, e.maxPoint) && e.entries.push(A);
};
cm.CreationFuncForSubMeshes = (A, e) => {
  A.getBoundingInfo().boundingBox.intersectsMinMax(e.minPoint, e.maxPoint) && e.entries.push(A);
};
sr.prototype.createOrUpdateSelectionOctree = function(A = 64, e = 2) {
  let t = this._getComponent(Ot.NAME_OCTREE);
  t || (t = new DQ(this), this._addComponent(t)), this._selectionOctree || (this._selectionOctree = new cm(cm.CreationFuncForMeshes, A, e));
  const r = this.getWorldExtends();
  return this._selectionOctree.update(r.min, r.max, this.meshes), this._selectionOctree;
};
Object.defineProperty(sr.prototype, "selectionOctree", {
  get: function() {
    return this._selectionOctree;
  },
  enumerable: !0,
  configurable: !0
});
jn.prototype.createOrUpdateSubmeshesOctree = function(A = 64, e = 2) {
  const t = this.getScene();
  let r = t._getComponent(Ot.NAME_OCTREE);
  r || (r = new DQ(t), t._addComponent(r)), this._submeshesOctree || (this._submeshesOctree = new cm(cm.CreationFuncForSubMeshes, A, e)), this.computeWorldMatrix(!0);
  const i = this.getBoundingInfo().boundingBox;
  return this._submeshesOctree.update(i.minimumWorld, i.maximumWorld, this.subMeshes), this._submeshesOctree;
};
class DQ {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_OCTREE, this.checksIsEnabled = !0, this._tempRay = new Hi(S.Zero(), new S(1, 1, 1)), e = e || gr.LastCreatedScene, e && (this.scene = e, this.scene.getActiveMeshCandidates = () => this.getActiveMeshCandidates(), this.scene.getActiveSubMeshCandidates = (t) => this.getActiveSubMeshCandidates(t), this.scene.getCollidingSubMeshCandidates = (t, r) => this.getCollidingSubMeshCandidates(t, r), this.scene.getIntersectingSubMeshCandidates = (t, r) => this.getIntersectingSubMeshCandidates(t, r));
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene.onMeshRemovedObservable.add((e) => {
      const t = this.scene.selectionOctree;
      if (t != null) {
        const r = t.dynamicContent.indexOf(e);
        r !== -1 && t.dynamicContent.splice(r, 1);
      }
    }), this.scene.onMeshImportedObservable.add((e) => {
      const t = this.scene.selectionOctree;
      t != null && t.addMesh(e);
    });
  }
  /**
   * Return the list of active meshes
   * @returns the list of active meshes
   */
  getActiveMeshCandidates() {
    var e;
    return ((e = this.scene._selectionOctree) === null || e === void 0 ? void 0 : e.select(this.scene.frustumPlanes)) || this.scene._getDefaultMeshCandidates();
  }
  /**
   * Return the list of active sub meshes
   * @param mesh The mesh to get the candidates sub meshes from
   * @returns the list of active sub meshes
   */
  getActiveSubMeshCandidates(e) {
    return e._submeshesOctree && e.useOctreeForRenderingSelection ? e._submeshesOctree.select(this.scene.frustumPlanes) : this.scene._getDefaultSubMeshCandidates(e);
  }
  /**
   * Return the list of sub meshes intersecting with a given local ray
   * @param mesh defines the mesh to find the submesh for
   * @param localRay defines the ray in local space
   * @returns the list of intersecting sub meshes
   */
  getIntersectingSubMeshCandidates(e, t) {
    return e._submeshesOctree && e.useOctreeForPicking ? (Hi.TransformToRef(t, e.getWorldMatrix(), this._tempRay), e._submeshesOctree.intersectsRay(this._tempRay)) : this.scene._getDefaultSubMeshCandidates(e);
  }
  /**
   * Return the list of sub meshes colliding with a collider
   * @param mesh defines the mesh to find the submesh for
   * @param collider defines the collider to evaluate the collision against
   * @returns the list of colliding sub meshes
   */
  getCollidingSubMeshCandidates(e, t) {
    if (e._submeshesOctree && e.useOctreeForCollisions) {
      const r = t._velocityWorldLength + Math.max(t._radius.x, t._radius.y, t._radius.z);
      return e._submeshesOctree.intersects(t._basePointWorld, r);
    }
    return this.scene._getDefaultSubMeshCandidates(e);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources.
   */
  dispose() {
  }
}
function MO(A) {
  const e = A.height || 2;
  let t = A.diameterTop === 0 ? 0 : A.diameterTop || A.diameter || 1, r = A.diameterBottom === 0 ? 0 : A.diameterBottom || A.diameter || 1;
  t = t || 1e-5, r = r || 1e-5;
  const n = (A.tessellation || 24) | 0, i = (A.subdivisions || 1) | 0, s = !!A.hasRings, a = !!A.enclose, f = A.cap === 0 ? 0 : A.cap || Ee.CAP_ALL, o = A.arc && (A.arc <= 0 || A.arc > 1) ? 1 : A.arc || 1, d = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE, v = A.faceUV || new Array(3), u = A.faceColors, l = o !== 1 && a ? 2 : 0, P = s ? i : 1, p = 2 + (1 + l) * P;
  let c;
  for (c = 0; c < p; c++)
    u && u[c] === void 0 && (u[c] = new xt(1, 1, 1, 1));
  for (c = 0; c < p; c++)
    v && v[c] === void 0 && (v[c] = new Ir(0, 0, 1, 1));
  const H = [], T = [], q = [], b = [], j = [], w = Math.PI * 2 * o / n;
  let m, I, N;
  const k = (r - t) / 2 / e, R = S.Zero(), y = S.Zero(), O = S.Zero(), Y = S.Zero(), ee = S.Zero(), Z = bf.Y;
  let te, fe, _, G = 1, L = 1, $ = 0, ae = 0;
  for (te = 0; te <= i; te++)
    for (I = te / i, N = (I * (t - r) + r) / 2, G = s && te !== 0 && te !== i ? 2 : 1, _ = 0; _ < G; _++) {
      for (s && (L += _), a && (L += 2 * _), fe = 0; fe <= n; fe++)
        m = fe * w, R.x = Math.cos(-m) * N, R.y = -e / 2 + I * e, R.z = Math.sin(-m) * N, t === 0 && te === i ? (y.x = q[q.length - (n + 1) * 3], y.y = q[q.length - (n + 1) * 3 + 1], y.z = q[q.length - (n + 1) * 3 + 2]) : (y.x = R.x, y.z = R.z, y.y = Math.sqrt(y.x * y.x + y.z * y.z) * k, y.normalize()), fe === 0 && (O.copyFrom(R), Y.copyFrom(y)), T.push(R.x, R.y, R.z), q.push(y.x, y.y, y.z), s ? ae = $ !== L ? v[L].y : v[L].w : ae = v[L].y + (v[L].w - v[L].y) * I, b.push(v[L].x + (v[L].z - v[L].x) * fe / n, us.UseOpenGLOrientationForUV ? 1 - ae : ae), u && j.push(u[L].r, u[L].g, u[L].b, u[L].a);
      o !== 1 && a && (T.push(R.x, R.y, R.z), T.push(0, R.y, 0), T.push(0, R.y, 0), T.push(O.x, O.y, O.z), S.CrossToRef(Z, y, ee), ee.normalize(), q.push(ee.x, ee.y, ee.z, ee.x, ee.y, ee.z), S.CrossToRef(Y, Z, ee), ee.normalize(), q.push(ee.x, ee.y, ee.z, ee.x, ee.y, ee.z), s ? ae = $ !== L ? v[L + 1].y : v[L + 1].w : ae = v[L + 1].y + (v[L + 1].w - v[L + 1].y) * I, b.push(v[L + 1].x, us.UseOpenGLOrientationForUV ? 1 - ae : ae), b.push(v[L + 1].z, us.UseOpenGLOrientationForUV ? 1 - ae : ae), s ? ae = $ !== L ? v[L + 2].y : v[L + 2].w : ae = v[L + 2].y + (v[L + 2].w - v[L + 2].y) * I, b.push(v[L + 2].x, us.UseOpenGLOrientationForUV ? 1 - ae : ae), b.push(v[L + 2].z, us.UseOpenGLOrientationForUV ? 1 - ae : ae), u && (j.push(u[L + 1].r, u[L + 1].g, u[L + 1].b, u[L + 1].a), j.push(u[L + 1].r, u[L + 1].g, u[L + 1].b, u[L + 1].a), j.push(u[L + 2].r, u[L + 2].g, u[L + 2].b, u[L + 2].a), j.push(u[L + 2].r, u[L + 2].g, u[L + 2].b, u[L + 2].a))), $ !== L && ($ = L);
    }
  const Pe = o !== 1 && a ? n + 4 : n;
  for (te = 0, L = 0; L < i; L++) {
    let Xe = 0, De = 0, ne = 0, re = 0;
    for (fe = 0; fe < n; fe++)
      Xe = te * (Pe + 1) + fe, De = (te + 1) * (Pe + 1) + fe, ne = te * (Pe + 1) + (fe + 1), re = (te + 1) * (Pe + 1) + (fe + 1), H.push(Xe, De, ne), H.push(re, ne, De);
    o !== 1 && a && (H.push(Xe + 2, De + 2, ne + 2), H.push(re + 2, ne + 2, De + 2), H.push(Xe + 4, De + 4, ne + 4), H.push(re + 4, ne + 4, De + 4)), te = s ? te + 2 : te + 1;
  }
  const ge = (Xe) => {
    const De = Xe ? t / 2 : r / 2;
    if (De === 0)
      return;
    let ne, re, ve;
    const qe = Xe ? v[p - 1] : v[0];
    let ke = null;
    u && (ke = Xe ? u[p - 1] : u[0]);
    const be = T.length / 3, Fe = Xe ? e / 2 : -e / 2, Ke = new S(0, Fe, 0);
    T.push(Ke.x, Ke.y, Ke.z), q.push(0, Xe ? 1 : -1, 0);
    const nt = qe.y + (qe.w - qe.y) * 0.5;
    b.push(qe.x + (qe.z - qe.x) * 0.5, us.UseOpenGLOrientationForUV ? 1 - nt : nt), ke && j.push(ke.r, ke.g, ke.b, ke.a);
    const ut = new at(0.5, 0.5);
    for (ve = 0; ve <= n; ve++) {
      ne = Math.PI * 2 * ve * o / n;
      const bt = Math.cos(-ne), wt = Math.sin(-ne);
      re = new S(bt * De, Fe, wt * De);
      const Tt = new at(bt * ut.x + 0.5, wt * ut.y + 0.5);
      T.push(re.x, re.y, re.z), q.push(0, Xe ? 1 : -1, 0);
      const lr = qe.y + (qe.w - qe.y) * Tt.y;
      b.push(qe.x + (qe.z - qe.x) * Tt.x, us.UseOpenGLOrientationForUV ? 1 - lr : lr), ke && j.push(ke.r, ke.g, ke.b, ke.a);
    }
    for (ve = 0; ve < n; ve++)
      Xe ? (H.push(be), H.push(be + (ve + 2)), H.push(be + (ve + 1))) : (H.push(be), H.push(be + (ve + 1)), H.push(be + (ve + 2)));
  };
  (f === Ee.CAP_START || f === Ee.CAP_ALL) && ge(!1), (f === Ee.CAP_END || f === Ee.CAP_ALL) && ge(!0), Ut._ComputeSides(d, T, H, q, b, A.frontUVs, A.backUVs);
  const me = new Ut();
  return me.indices = H, me.positions = T, me.normals = q, me.uvs = b, u && (me.colors = j), me;
}
function Ld(A, e = {}, t) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, MO(e).applyToMesh(r, e.updatable), r;
}
const mve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateCylinder: Ld
};
Ut.CreateCylinder = MO;
Ee.CreateCylinder = (A, e, t, r, n, i, s, a, f) => ((s === void 0 || !(s instanceof sr)) && (s !== void 0 && (f = a || Ee.DEFAULTSIDE, a = s), s = i, i = 1), Ld(A, {
  height: e,
  diameterTop: t,
  diameterBottom: r,
  tessellation: n,
  subdivisions: i,
  sideOrientation: f,
  updatable: a
}, s));
Cs.AddNodeConstructor("Light_Type_3", (A, e) => () => new y0(A, S.Zero(), e));
class y0 extends ci {
  /**
   * Creates a HemisphericLight object in the scene according to the passed direction (Vector3).
   * The HemisphericLight simulates the ambient environment light, so the passed direction is the light reflection direction, not the incoming direction.
   * The HemisphericLight can't cast shadows.
   * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
   * @param name The friendly name of the light
   * @param direction The direction of the light reflection
   * @param scene The scene the light belongs to
   */
  constructor(e, t, r) {
    super(e, r), this.groundColor = new Ne(0, 0, 0), this.direction = t || S.Up();
  }
  _buildUniformLayout() {
    this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 4), this._uniformBuffer.addUniform("vLightGround", 3), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create();
  }
  /**
   * Returns the string "HemisphericLight".
   * @returns The class name
   */
  getClassName() {
    return "HemisphericLight";
  }
  /**
   * Sets the HemisphericLight direction towards the passed target (Vector3).
   * Returns the updated direction.
   * @param target The target the direction should point to
   * @returns The computed direction
   */
  setDirectionToTarget(e) {
    return this.direction = S.Normalize(e.subtract(S.Zero())), this.direction;
  }
  /**
   * Returns the shadow generator associated to the light.
   * @returns Always null for hemispheric lights because it does not support shadows.
   */
  getShadowGenerator() {
    return null;
  }
  /**
   * Sets the passed Effect object with the HemisphericLight normalized direction and color and the passed name (string).
   * @param _effect The effect to update
   * @param lightIndex The index of the light in the effect to update
   * @returns The hemispheric light
   */
  transferToEffect(e, t) {
    const r = S.Normalize(this.direction);
    return this._uniformBuffer.updateFloat4("vLightData", r.x, r.y, r.z, 0, t), this._uniformBuffer.updateColor3("vLightGround", this.groundColor.scale(this.intensity), t), this;
  }
  transferToNodeMaterialEffect(e, t) {
    const r = S.Normalize(this.direction);
    return e.setFloat3(t, r.x, r.y, r.z), this;
  }
  /**
   * Computes the world matrix of the node
   * @returns the world matrix
   */
  computeWorldMatrix() {
    return this._worldMatrix || (this._worldMatrix = he.Identity()), this._worldMatrix;
  }
  /**
   * Returns the integer 3.
   * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
   */
  getTypeID() {
    return ci.LIGHTTYPEID_HEMISPHERICLIGHT;
  }
  /**
   * Prepares the list of defines specific to the light type.
   * @param defines the list of defines
   * @param lightIndex defines the index of the light for the effect
   */
  prepareLightSpecificDefines(e, t) {
    e["HEMILIGHT" + t] = !0;
  }
}
C([
  Oi()
], y0.prototype, "groundColor", void 0);
C([
  fo()
], y0.prototype, "direction", void 0);
class Ds {
  /**
   * Gets the camera that is used to render the utility layer (when not set, this will be the last active camera)
   * @param getRigParentIfPossible if the current active camera is a rig camera, should its parent camera be returned
   * @returns the camera that is used when rendering the utility layer
   */
  getRenderCamera(e) {
    if (this._renderCamera)
      return this._renderCamera;
    {
      let t;
      return this.originalScene.activeCameras && this.originalScene.activeCameras.length > 1 ? t = this.originalScene.activeCameras[this.originalScene.activeCameras.length - 1] : t = this.originalScene.activeCamera, e && t && t.isRigCamera ? t.rigParent : t;
    }
  }
  /**
   * Sets the camera that should be used when rendering the utility layer (If set to null the last active camera will be used)
   * @param cam the camera that should be used when rendering the utility layer
   */
  setRenderCamera(e) {
    this._renderCamera = e;
  }
  /**
   * @internal
   * Light which used by gizmos to get light shading
   */
  _getSharedGizmoLight() {
    return this._sharedGizmoLight || (this._sharedGizmoLight = new y0("shared gizmo light", new S(0, 1, 0), this.utilityLayerScene), this._sharedGizmoLight.intensity = 2, this._sharedGizmoLight.groundColor = Ne.Gray()), this._sharedGizmoLight;
  }
  /**
   * A shared utility layer that can be used to overlay objects into a scene (Depth map of the previous scene is cleared before drawing on top of it)
   */
  static get DefaultUtilityLayer() {
    return Ds._DefaultUtilityLayer == null ? Ds._CreateDefaultUtilityLayerFromScene(gr.LastCreatedScene) : Ds._DefaultUtilityLayer;
  }
  /**
   * Creates an utility layer, and set it as a default utility layer
   * @param scene associated scene
   * @internal
   */
  static _CreateDefaultUtilityLayerFromScene(e) {
    return Ds._DefaultUtilityLayer = new Ds(e), Ds._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(() => {
      Ds._DefaultUtilityLayer = null;
    }), Ds._DefaultUtilityLayer;
  }
  /**
   * A shared utility layer that can be used to embed objects into a scene (Depth map of the previous scene is not cleared before drawing on top of it)
   */
  static get DefaultKeepDepthUtilityLayer() {
    return Ds._DefaultKeepDepthUtilityLayer == null && (Ds._DefaultKeepDepthUtilityLayer = new Ds(gr.LastCreatedScene), Ds._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = !1, Ds._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(() => {
      Ds._DefaultKeepDepthUtilityLayer = null;
    })), Ds._DefaultKeepDepthUtilityLayer;
  }
  /**
   * Instantiates a UtilityLayerRenderer
   * @param originalScene the original scene that will be rendered on top of
   * @param handleEvents boolean indicating if the utility layer should handle events
   */
  constructor(e, t = !0) {
    this.originalScene = e, this._pointerCaptures = {}, this._lastPointerEvents = {}, this._sharedGizmoLight = null, this._renderCamera = null, this.pickUtilitySceneFirst = !0, this.shouldRender = !0, this.onlyCheckPointerDownEvents = !0, this.processAllEvents = !1, this.pickingEnabled = !0, this.onPointerOutObservable = new Oe(), this.utilityLayerScene = new sr(e.getEngine(), { virtual: !0 }), this.utilityLayerScene.useRightHandedSystem = e.useRightHandedSystem, this.utilityLayerScene._allowPostProcessClearColor = !1, this.utilityLayerScene.postProcessesEnabled = !1, this.utilityLayerScene.detachControl(), t && (this._originalPointerObserver = e.onPrePointerObservable.add((r) => {
      if (!this.utilityLayerScene.activeCamera || !this.pickingEnabled || !this.processAllEvents && r.type !== ir.POINTERMOVE && r.type !== ir.POINTERUP && r.type !== ir.POINTERDOWN && r.type !== ir.POINTERDOUBLETAP)
        return;
      this.utilityLayerScene.pointerX = e.pointerX, this.utilityLayerScene.pointerY = e.pointerY;
      const n = r.event;
      if (e.isPointerCaptured(n.pointerId)) {
        this._pointerCaptures[n.pointerId] = !1;
        return;
      }
      const i = (a) => {
        let f = null;
        if (r.nearInteractionPickingInfo)
          r.nearInteractionPickingInfo.pickedMesh.getScene() == a ? f = r.nearInteractionPickingInfo : f = new F9();
        else if (a !== this.utilityLayerScene && r.originalPickingInfo)
          f = r.originalPickingInfo;
        else {
          let o = null;
          this._renderCamera && (o = a._activeCamera, a._activeCamera = this._renderCamera, r.ray = null), f = r.ray ? a.pickWithRay(r.ray) : a.pick(e.pointerX, e.pointerY), o && (a._activeCamera = o);
        }
        return f;
      }, s = i(this.utilityLayerScene);
      if (!r.ray && s && (r.ray = s.ray), this.utilityLayerScene.onPrePointerObservable.notifyObservers(r), this.onlyCheckPointerDownEvents && r.type != ir.POINTERDOWN) {
        r.skipOnPointerObservable || this.utilityLayerScene.onPointerObservable.notifyObservers(new vp(r.type, r.event, s), r.type), r.type === ir.POINTERUP && this._pointerCaptures[n.pointerId] && (this._pointerCaptures[n.pointerId] = !1);
        return;
      }
      if (this.utilityLayerScene.autoClearDepthAndStencil || this.pickUtilitySceneFirst)
        s && s.hit && (r.skipOnPointerObservable || this.utilityLayerScene.onPointerObservable.notifyObservers(new vp(r.type, r.event, s), r.type), r.skipOnPointerObservable = !0);
      else {
        const a = i(e), f = r.event;
        a && s && (s.distance === 0 && a.pickedMesh ? this.mainSceneTrackerPredicate && this.mainSceneTrackerPredicate(a.pickedMesh) ? (this._notifyObservers(r, a, f), r.skipOnPointerObservable = !0) : r.type === ir.POINTERDOWN ? this._pointerCaptures[f.pointerId] = !0 : (r.type === ir.POINTERMOVE || r.type === ir.POINTERUP) && (this._lastPointerEvents[f.pointerId] && (this.onPointerOutObservable.notifyObservers(f.pointerId), delete this._lastPointerEvents[f.pointerId]), this._notifyObservers(r, a, f)) : !this._pointerCaptures[f.pointerId] && (s.distance < a.distance || a.distance === 0) ? (this._notifyObservers(r, s, f), r.skipOnPointerObservable || (r.skipOnPointerObservable = s.distance > 0)) : !this._pointerCaptures[f.pointerId] && s.distance >= a.distance && (this.mainSceneTrackerPredicate && this.mainSceneTrackerPredicate(a.pickedMesh) ? (this._notifyObservers(r, a, f), r.skipOnPointerObservable = !0) : ((r.type === ir.POINTERMOVE || r.type === ir.POINTERUP) && this._lastPointerEvents[f.pointerId] && (this.onPointerOutObservable.notifyObservers(f.pointerId), delete this._lastPointerEvents[f.pointerId]), this._notifyObservers(r, s, f))), r.type === ir.POINTERUP && this._pointerCaptures[f.pointerId] && (this._pointerCaptures[f.pointerId] = !1));
      }
    }), this._originalPointerObserver && e.onPrePointerObservable.makeObserverTopPriority(this._originalPointerObserver)), this.utilityLayerScene.autoClear = !1, this._afterRenderObserver = this.originalScene.onAfterRenderCameraObservable.add((r) => {
      this.shouldRender && r == this.getRenderCamera() && this.render();
    }), this._sceneDisposeObserver = this.originalScene.onDisposeObservable.add(() => {
      this.dispose();
    }), this._updateCamera();
  }
  _notifyObservers(e, t, r) {
    e.skipOnPointerObservable || (this.utilityLayerScene.onPointerObservable.notifyObservers(new vp(e.type, e.event, t), e.type), this._lastPointerEvents[r.pointerId] = !0);
  }
  /**
   * Renders the utility layers scene on top of the original scene
   */
  render() {
    if (this._updateCamera(), this.utilityLayerScene.activeCamera) {
      const e = this.utilityLayerScene.activeCamera.getScene(), t = this.utilityLayerScene.activeCamera;
      t._scene = this.utilityLayerScene, t.leftCamera && (t.leftCamera._scene = this.utilityLayerScene), t.rightCamera && (t.rightCamera._scene = this.utilityLayerScene), this.utilityLayerScene.render(!1), t._scene = e, t.leftCamera && (t.leftCamera._scene = e), t.rightCamera && (t.rightCamera._scene = e);
    }
  }
  /**
   * Disposes of the renderer
   */
  dispose() {
    this.onPointerOutObservable.clear(), this._afterRenderObserver && this.originalScene.onAfterCameraRenderObservable.remove(this._afterRenderObserver), this._sceneDisposeObserver && this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver), this._originalPointerObserver && this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver), this.utilityLayerScene.dispose();
  }
  _updateCamera() {
    this.utilityLayerScene.cameraToUseForPointers = this.getRenderCamera(), this.utilityLayerScene.activeCamera = this.getRenderCamera();
  }
}
Ds._DefaultUtilityLayer = null;
Ds._DefaultKeepDepthUtilityLayer = null;
var QI;
(function(A) {
  A[A.Origin = 0] = "Origin", A[A.Pivot = 1] = "Pivot";
})(QI || (QI = {}));
var pD;
(function(A) {
  A[A.World = 0] = "World", A[A.Local = 1] = "Local";
})(pD || (pD = {}));
class Lo {
  /**
   * Ratio for the scale of the gizmo (Default: 1)
   */
  set scaleRatio(e) {
    this._scaleRatio = e;
  }
  get scaleRatio() {
    return this._scaleRatio;
  }
  /**
   * True when the mouse pointer is hovered a gizmo mesh
   */
  get isHovered() {
    return this._isHovered;
  }
  /**
   * Mesh that the gizmo will be attached to. (eg. on a drag gizmo the mesh that will be dragged)
   * * When set, interactions will be enabled
   */
  get attachedMesh() {
    return this._attachedMesh;
  }
  set attachedMesh(e) {
    this._attachedMesh = e, e && (this._attachedNode = e), this._rootMesh.setEnabled(!!e), this._attachedNodeChanged(e);
  }
  /**
   * Node that the gizmo will be attached to. (eg. on a drag gizmo the mesh, bone or NodeTransform that will be dragged)
   * * When set, interactions will be enabled
   */
  get attachedNode() {
    return this._attachedNode;
  }
  set attachedNode(e) {
    this._attachedNode = e, this._attachedMesh = null, this._rootMesh.setEnabled(!!e), this._attachedNodeChanged(e);
  }
  /**
   * Disposes and replaces the current meshes in the gizmo with the specified mesh
   * @param mesh The mesh to replace the default mesh of the gizmo
   */
  setCustomMesh(e) {
    if (e.getScene() != this.gizmoLayer.utilityLayerScene)
      throw "When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";
    this._rootMesh.getChildMeshes().forEach((t) => {
      t.dispose();
    }), e.parent = this._rootMesh, this._customMeshSet = !0;
  }
  /**
   * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
   * NOTE: This is only possible for meshes with uniform scaling, as otherwise it's not possible to decompose the rotation
   */
  set updateGizmoRotationToMatchAttachedMesh(e) {
    this._updateGizmoRotationToMatchAttachedMesh = e;
  }
  get updateGizmoRotationToMatchAttachedMesh() {
    return this._updateGizmoRotationToMatchAttachedMesh;
  }
  /**
   * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
   */
  set updateGizmoPositionToMatchAttachedMesh(e) {
    this._updateGizmoPositionToMatchAttachedMesh = e;
  }
  get updateGizmoPositionToMatchAttachedMesh() {
    return this._updateGizmoPositionToMatchAttachedMesh;
  }
  /**
   * Defines where the gizmo will be positioned if `updateGizmoPositionToMatchAttachedMesh` is enabled.
   * (Default: GizmoAnchorPoint.Origin)
   */
  set anchorPoint(e) {
    this._anchorPoint = e;
  }
  get anchorPoint() {
    return this._anchorPoint;
  }
  /**
   * Set the coordinate system to use. By default it's local.
   * But it's possible for a user to tweak so its local for translation and world for rotation.
   * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`
   */
  set coordinatesMode(e) {
    this._coordinatesMode = e;
    const t = e == pD.Local;
    this.updateGizmoRotationToMatchAttachedMesh = t, this.updateGizmoPositionToMatchAttachedMesh = !0;
  }
  get coordinatesMode() {
    return this._coordinatesMode;
  }
  /**
   * When set, the gizmo will always appear the same size no matter where the camera is (default: true)
   */
  set updateScale(e) {
    this._updateScale = e;
  }
  get updateScale() {
    return this._updateScale;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _attachedNodeChanged(e) {
  }
  /**
   * Creates a gizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
   */
  constructor(e = Ds.DefaultUtilityLayer) {
    this.gizmoLayer = e, this._attachedMesh = null, this._attachedNode = null, this._customRotationQuaternion = null, this._scaleRatio = 1, this._isHovered = !1, this._customMeshSet = !1, this._updateGizmoRotationToMatchAttachedMesh = !0, this._updateGizmoPositionToMatchAttachedMesh = !0, this._anchorPoint = QI.Origin, this._updateScale = !0, this._coordinatesMode = pD.Local, this._interactionsEnabled = !0, this._rightHandtoLeftHandMatrix = he.RotationY(Math.PI), this._rootMesh = new Ee("gizmoRootNode", e.utilityLayerScene), this._rootMesh.rotationQuaternion = Ze.Identity(), this._beforeRenderObserver = this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(() => {
      this._update();
    });
  }
  /**
   * posture that the gizmo will be display
   * When set null, default value will be used (Quaternion(0, 0, 0, 1))
   */
  get customRotationQuaternion() {
    return this._customRotationQuaternion;
  }
  set customRotationQuaternion(e) {
    this._customRotationQuaternion = e;
  }
  /**
   * Updates the gizmo to match the attached mesh's position/rotation
   */
  _update() {
    if (this.attachedNode) {
      let e = this.attachedNode;
      if (this.attachedMesh && (e = this.attachedMesh || this.attachedNode), this.updateGizmoPositionToMatchAttachedMesh)
        if (this.anchorPoint == QI.Pivot && e.getAbsolutePivotPoint) {
          const t = e.getAbsolutePivotPoint();
          this._rootMesh.position.copyFrom(t);
        } else {
          const t = e.getWorldMatrix().getRow(3), r = t ? t.toVector3() : new S(0, 0, 0);
          this._rootMesh.position.copyFrom(r);
        }
      if (this.updateGizmoRotationToMatchAttachedMesh) {
        const r = e._isMesh || e.getClassName() === "AbstractMesh" || e.getClassName() === "TransformNode" || e.getClassName() === "InstancedMesh" ? e : void 0;
        e.getWorldMatrix().decompose(void 0, this._rootMesh.rotationQuaternion, void 0, Lo.PreserveScaling ? r : void 0), this._rootMesh.rotationQuaternion.normalize();
      } else
        this._customRotationQuaternion ? this._rootMesh.rotationQuaternion.copyFrom(this._customRotationQuaternion) : this._rootMesh.rotationQuaternion.set(0, 0, 0, 1);
      if (this.updateScale) {
        const t = this.gizmoLayer.utilityLayerScene.activeCamera, r = t.globalPosition;
        this._rootMesh.position.subtractToRef(r, ue.Vector3[0]);
        let n = this.scaleRatio;
        if (t.mode == Tr.ORTHOGRAPHIC_CAMERA) {
          if (t.orthoTop && t.orthoBottom) {
            const i = t.orthoTop - t.orthoBottom;
            n *= i;
          }
        } else {
          const i = t.getScene().useRightHandedSystem ? S.RightHandedForwardReadOnly : S.LeftHandedForwardReadOnly, s = t.getDirection(i);
          n *= S.Dot(ue.Vector3[0], s);
        }
        this._rootMesh.scaling.setAll(n), e._getWorldMatrixDeterminant() < 0 && !Lo.PreserveScaling && (this._rootMesh.scaling.y *= -1);
      } else
        this._rootMesh.scaling.setAll(this.scaleRatio);
    }
  }
  /**
   * if transform has a pivot and is not using PostMultiplyPivotMatrix, then the worldMatrix contains the pivot matrix (it's not cancelled at the end)
   * so, when extracting the world matrix component, the translation (and other components) is containing the pivot translation.
   * And the pivot is applied each frame. Removing it anyway here makes it applied only in computeWorldMatrix.
   * @param transform local transform that needs to be transform by the pivot inverse matrix
   * @param localMatrix local matrix that needs to be transform by the pivot inverse matrix
   * @param result resulting matrix transformed by pivot inverse if the transform node is using pivot without using post Multiply Pivot Matrix
   */
  _handlePivotMatrixInverse(e, t, r) {
    if (e.isUsingPivotMatrix() && !e.isUsingPostMultiplyPivotMatrix()) {
      e.getPivotMatrix().invertToRef(ue.Matrix[5]), ue.Matrix[5].multiplyToRef(t, r);
      return;
    }
    r.copyFrom(t);
  }
  /**
   * computes the rotation/scaling/position of the transform once the Node world matrix has changed.
   */
  _matrixChanged() {
    if (this._attachedNode)
      if (this._attachedNode._isCamera) {
        const e = this._attachedNode;
        let t, r;
        if (e.parent) {
          const i = ue.Matrix[1];
          e.parent._worldMatrix.invertToRef(i), this._attachedNode._worldMatrix.multiplyToRef(i, ue.Matrix[0]), t = ue.Matrix[0];
        } else
          t = this._attachedNode._worldMatrix;
        if (e.getScene().useRightHandedSystem ? (this._rightHandtoLeftHandMatrix.multiplyToRef(t, ue.Matrix[1]), r = ue.Matrix[1]) : r = t, r.decompose(ue.Vector3[1], ue.Quaternion[0], ue.Vector3[0]), this._attachedNode.getClassName() === "FreeCamera" || this._attachedNode.getClassName() === "FlyCamera" || this._attachedNode.getClassName() === "ArcFollowCamera" || this._attachedNode.getClassName() === "TargetCamera" || this._attachedNode.getClassName() === "TouchCamera" || this._attachedNode.getClassName() === "UniversalCamera") {
          const i = this._attachedNode;
          i.rotation = ue.Quaternion[0].toEulerAngles(), i.rotationQuaternion && (i.rotationQuaternion.copyFrom(ue.Quaternion[0]), i.rotationQuaternion.normalize());
        }
        e.position.copyFrom(ue.Vector3[0]);
      } else if (this._attachedNode._isMesh || this._attachedNode.getClassName() === "AbstractMesh" || this._attachedNode.getClassName() === "TransformNode" || this._attachedNode.getClassName() === "InstancedMesh") {
        const e = this._attachedNode;
        if (e.parent) {
          const t = ue.Matrix[0], r = ue.Matrix[1];
          e.parent.getWorldMatrix().invertToRef(t), this._attachedNode.getWorldMatrix().multiplyToRef(t, r);
          const n = ue.Matrix[4];
          if (this._handlePivotMatrixInverse(e, r, n), n.decompose(ue.Vector3[0], ue.Quaternion[0], e.position, Lo.PreserveScaling ? e : void 0, Lo.UseAbsoluteScaling), ue.Quaternion[0].normalize(), e.isUsingPivotMatrix()) {
            const i = ue.Quaternion[1];
            Ze.RotationYawPitchRollToRef(e.rotation.y, e.rotation.x, e.rotation.z, i);
            const s = ue.Matrix[2];
            he.ScalingToRef(e.scaling.x, e.scaling.y, e.scaling.z, s);
            const a = ue.Matrix[2];
            i.toRotationMatrix(a);
            const f = e.getPivotMatrix(), o = ue.Matrix[3];
            f.invertToRef(o), f.multiplyToRef(s, ue.Matrix[4]), ue.Matrix[4].multiplyToRef(a, ue.Matrix[5]), ue.Matrix[5].multiplyToRef(o, ue.Matrix[6]), ue.Matrix[6].getTranslationToRef(ue.Vector3[1]), e.position.subtractInPlace(ue.Vector3[1]);
          }
        } else {
          const t = ue.Matrix[4];
          this._handlePivotMatrixInverse(e, this._attachedNode._worldMatrix, t), t.decompose(ue.Vector3[0], ue.Quaternion[0], e.position, Lo.PreserveScaling ? e : void 0, Lo.UseAbsoluteScaling);
        }
        ue.Vector3[0].scaleInPlace(1 / e.scalingDeterminant), e.scaling.copyFrom(ue.Vector3[0]), e.billboardMode || (e.rotationQuaternion ? (e.rotationQuaternion.copyFrom(ue.Quaternion[0]), e.rotationQuaternion.normalize()) : e.rotation = ue.Quaternion[0].toEulerAngles());
      } else if (this._attachedNode.getClassName() === "Bone") {
        const e = this._attachedNode, t = e.getParent();
        if (t) {
          const r = ue.Matrix[0], n = ue.Matrix[1];
          t.getFinalMatrix().invertToRef(r), e.getFinalMatrix().multiplyToRef(r, n), e.getLocalMatrix().copyFrom(n);
        } else
          e.getLocalMatrix().copyFrom(e.getFinalMatrix());
        e.markAsDirty();
      } else {
        const e = this._attachedNode;
        if (e.getTypeID) {
          const t = e.getTypeID();
          if (t === ci.LIGHTTYPEID_DIRECTIONALLIGHT || t === ci.LIGHTTYPEID_SPOTLIGHT || t === ci.LIGHTTYPEID_POINTLIGHT) {
            const r = e.parent;
            if (r) {
              const n = ue.Matrix[0], i = ue.Matrix[1];
              r.getWorldMatrix().invertToRef(n), e.getWorldMatrix().multiplyToRef(n, i), i.decompose(void 0, ue.Quaternion[0], ue.Vector3[0]);
            } else
              this._attachedNode._worldMatrix.decompose(void 0, ue.Quaternion[0], ue.Vector3[0]);
            e.position = new S(ue.Vector3[0].x, ue.Vector3[0].y, ue.Vector3[0].z), e.direction && (e.direction = new S(e.direction.x, e.direction.y, e.direction.z));
          }
        }
      }
  }
  /**
   * refresh gizmo mesh material
   * @param gizmoMeshes
   * @param material material to apply
   */
  _setGizmoMeshMaterial(e, t) {
    e && e.forEach((r) => {
      r.material = t, r.color && (r.color = t.diffuseColor);
    });
  }
  /**
   * Subscribes to pointer up, down, and hover events. Used for responsive gizmos.
   * @param gizmoLayer The utility layer the gizmo will be added to
   * @param gizmoAxisCache Gizmo axis definition used for reactive gizmo UI
   * @returns {Observer<PointerInfo>} pointerObserver
   */
  static GizmoAxisPointerObserver(e, t) {
    let r = !1;
    return e.utilityLayerScene.onPointerObservable.add((i) => {
      var s, a;
      if (i.pickInfo) {
        if (i.type === ir.POINTERMOVE) {
          if (r)
            return;
          t.forEach((f) => {
            var o, d;
            if (f.colliderMeshes && f.gizmoMeshes) {
              const v = ((o = f.colliderMeshes) === null || o === void 0 ? void 0 : o.indexOf((d = i == null ? void 0 : i.pickInfo) === null || d === void 0 ? void 0 : d.pickedMesh)) != -1, u = f.dragBehavior.enabled ? v || f.active ? f.hoverMaterial : f.material : f.disableMaterial;
              f.gizmoMeshes.forEach((l) => {
                l.material = u, l.color && (l.color = u.diffuseColor);
              });
            }
          });
        }
        if (i.type === ir.POINTERDOWN && t.has((s = i.pickInfo.pickedMesh) === null || s === void 0 ? void 0 : s.parent)) {
          r = !0;
          const f = t.get((a = i.pickInfo.pickedMesh) === null || a === void 0 ? void 0 : a.parent);
          f.active = !0, t.forEach((o) => {
            var d, v;
            const l = (((d = o.colliderMeshes) === null || d === void 0 ? void 0 : d.indexOf((v = i == null ? void 0 : i.pickInfo) === null || v === void 0 ? void 0 : v.pickedMesh)) != -1 || o.active) && o.dragBehavior.enabled ? o.hoverMaterial : o.disableMaterial;
            o.gizmoMeshes.forEach((P) => {
              P.material = l, P.color && (P.color = l.diffuseColor);
            });
          });
        }
        i.type === ir.POINTERUP && t.forEach((f) => {
          f.active = !1, r = !1, f.gizmoMeshes.forEach((o) => {
            o.material = f.dragBehavior.enabled ? f.material : f.disableMaterial, o.color && (o.color = f.material.diffuseColor);
          });
        });
      }
    });
  }
  /**
   * Disposes of the gizmo
   */
  dispose() {
    this._rootMesh.dispose(), this._beforeRenderObserver && this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver);
  }
}
Lo.PreserveScaling = !1;
Lo.UseAbsoluteScaling = !0;
class lp extends Lo {
  /** Default material used to render when gizmo is not disabled or hovered */
  get coloredMaterial() {
    return this._coloredMaterial;
  }
  /** Material used to render when gizmo is hovered with mouse*/
  get hoverMaterial() {
    return this._hoverMaterial;
  }
  /** Material used to render when gizmo is disabled. typically grey.*/
  get disableMaterial() {
    return this._disableMaterial;
  }
  /**
   * @internal
   */
  static _CreateArrow(e, t, r = 1, n = !1) {
    const i = new Hr("arrow", e), s = Ld("cylinder", {
      diameterTop: 0,
      height: 0.075,
      diameterBottom: 0.0375 * (1 + (r - 1) / 4),
      tessellation: 96
    }, e), a = Ld("cylinder", {
      diameterTop: 5e-3 * r,
      height: 0.275,
      diameterBottom: 5e-3 * r,
      tessellation: 96
    }, e);
    return s.parent = i, s.material = t, s.rotation.x = Math.PI / 2, s.position.z += 0.3, a.parent = i, a.material = t, a.position.z += 0.275 / 2, a.rotation.x = Math.PI / 2, n && (a.visibility = 0, s.visibility = 0), i;
  }
  /**
   * @internal
   */
  static _CreateArrowInstance(e, t) {
    const r = new Hr("arrow", e);
    for (const n of t.getChildMeshes()) {
      const i = n.createInstance(n.name);
      i.parent = r;
    }
    return r;
  }
  /**
   * Creates an AxisDragGizmo
   * @param dragAxis The axis which the gizmo will be able to drag on
   * @param color The color of the gizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
   * @param parent
   * @param thickness display gizmo axis thickness
   * @param hoverColor The color of the gizmo when hovering over and dragging
   * @param disableColor The Color of the gizmo when its disabled
   */
  constructor(e, t = Ne.Gray(), r = Ds.DefaultUtilityLayer, n = null, i = 1, s = Ne.Yellow(), a = Ne.Gray()) {
    var f;
    super(r), this._pointerObserver = null, this.snapDistance = 0, this.onSnapObservable = new Oe(), this._isEnabled = !0, this._parent = null, this._dragging = !1, this._parent = n, this._coloredMaterial = new Wt("", r.utilityLayerScene), this._coloredMaterial.diffuseColor = t, this._coloredMaterial.specularColor = t.subtract(new Ne(0.1, 0.1, 0.1)), this._hoverMaterial = new Wt("", r.utilityLayerScene), this._hoverMaterial.diffuseColor = s, this._disableMaterial = new Wt("", r.utilityLayerScene), this._disableMaterial.diffuseColor = a, this._disableMaterial.alpha = 0.4;
    const o = lp._CreateArrow(r.utilityLayerScene, this._coloredMaterial, i), d = lp._CreateArrow(r.utilityLayerScene, this._coloredMaterial, i + 4, !0);
    this._gizmoMesh = new Ee("", r.utilityLayerScene), this._gizmoMesh.addChild(o), this._gizmoMesh.addChild(d), this._gizmoMesh.lookAt(this._rootMesh.position.add(e)), this._gizmoMesh.scaling.scaleInPlace(1 / 3), this._gizmoMesh.parent = this._rootMesh;
    let v = 0;
    const u = { snapDistance: 0 };
    this.dragBehavior = new O9({ dragAxis: e }), this.dragBehavior.moveAttached = !1, this.dragBehavior.updateDragPlane = !1, this._rootMesh.addBehavior(this.dragBehavior), this.dragBehavior.onDragObservable.add((p) => {
      if (this.attachedNode) {
        let c = !1;
        if (this.snapDistance == 0)
          this.attachedNode.getWorldMatrix().getTranslationToRef(ue.Vector3[2]), ue.Vector3[2].addInPlace(p.delta), this.dragBehavior.validateDrag(ue.Vector3[2]) && (this.attachedNode.position && this.attachedNode.position.addInPlaceFromFloats(p.delta.x, p.delta.y, p.delta.z), this.attachedNode.getWorldMatrix().addTranslationFromFloats(p.delta.x, p.delta.y, p.delta.z), this.attachedNode.updateCache(), c = !0);
        else if (v += p.dragDistance, Math.abs(v) > this.snapDistance) {
          const H = Math.floor(Math.abs(v) / this.snapDistance);
          v = v % this.snapDistance, p.delta.normalizeToRef(ue.Vector3[1]), ue.Vector3[1].scaleInPlace(this.snapDistance * H), this.attachedNode.getWorldMatrix().getTranslationToRef(ue.Vector3[2]), ue.Vector3[2].addInPlace(ue.Vector3[1]), this.dragBehavior.validateDrag(ue.Vector3[2]) && (this.attachedNode.getWorldMatrix().addTranslationFromFloats(ue.Vector3[1].x, ue.Vector3[1].y, ue.Vector3[1].z), this.attachedNode.updateCache(), u.snapDistance = this.snapDistance * H * Math.sign(v), this.onSnapObservable.notifyObservers(u), c = !0);
        }
        c && this._matrixChanged();
      }
    }), this.dragBehavior.onDragStartObservable.add(() => {
      this._dragging = !0;
    }), this.dragBehavior.onDragEndObservable.add(() => {
      this._dragging = !1;
    });
    const l = r._getSharedGizmoLight();
    l.includedOnlyMeshes = l.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));
    const P = {
      gizmoMeshes: o.getChildMeshes(),
      colliderMeshes: d.getChildMeshes(),
      material: this._coloredMaterial,
      hoverMaterial: this._hoverMaterial,
      disableMaterial: this._disableMaterial,
      active: !1,
      dragBehavior: this.dragBehavior
    };
    (f = this._parent) === null || f === void 0 || f.addToAxisCache(d, P), this._pointerObserver = r.utilityLayerScene.onPointerObservable.add((p) => {
      var c;
      if (!this._customMeshSet && (this._isHovered = P.colliderMeshes.indexOf((c = p == null ? void 0 : p.pickInfo) === null || c === void 0 ? void 0 : c.pickedMesh) != -1, !this._parent)) {
        const H = this.dragBehavior.enabled ? this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial : this._disableMaterial;
        this._setGizmoMeshMaterial(P.gizmoMeshes, H);
      }
    }), this.dragBehavior.onEnabledObservable.add((p) => {
      this._setGizmoMeshMaterial(P.gizmoMeshes, p ? P.material : P.disableMaterial);
    });
  }
  _attachedNodeChanged(e) {
    this.dragBehavior && (this.dragBehavior.enabled = !!e);
  }
  /**
   * If the gizmo is enabled
   */
  set isEnabled(e) {
    this._isEnabled = e, e ? this._parent && (this.attachedMesh = this._parent.attachedMesh, this.attachedNode = this._parent.attachedNode) : (this.attachedMesh = null, this.attachedNode = null);
  }
  get isEnabled() {
    return this._isEnabled;
  }
  /**
   * Disposes of the gizmo
   */
  dispose() {
    this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((e) => {
      e && e.dispose();
    }), super.dispose();
  }
}
class aq {
  /**
   * Gets or sets a number used to scale line length
   */
  get scaleLines() {
    return this._scaleLines;
  }
  set scaleLines(e) {
    this._scaleLines = e, this._xAxis.scaling.setAll(this._scaleLines * this._scaleLinesFactor), this._yAxis.scaling.setAll(this._scaleLines * this._scaleLinesFactor), this._zAxis.scaling.setAll(this._scaleLines * this._scaleLinesFactor);
  }
  /** Gets the node hierarchy used to render x-axis */
  get xAxis() {
    return this._xAxis;
  }
  /** Gets the node hierarchy used to render y-axis */
  get yAxis() {
    return this._yAxis;
  }
  /** Gets the node hierarchy used to render z-axis */
  get zAxis() {
    return this._zAxis;
  }
  /**
   * Creates a new AxesViewer
   * @param scene defines the hosting scene
   * @param scaleLines defines a number used to scale line length (1 by default)
   * @param renderingGroupId defines a number used to set the renderingGroupId of the meshes (2 by default)
   * @param xAxis defines the node hierarchy used to render the x-axis
   * @param yAxis defines the node hierarchy used to render the y-axis
   * @param zAxis defines the node hierarchy used to render the z-axis
   * @param lineThickness The line thickness to use when creating the arrow. defaults to 1.
   */
  constructor(e, t = 1, r = 2, n, i, s, a = 1) {
    if (this._scaleLinesFactor = 4, this._instanced = !1, this.scene = null, this._scaleLines = 1, e = e || gr.LastCreatedScene, !!e) {
      if (!n) {
        const f = new Wt("xAxisMaterial", e);
        f.disableLighting = !0, f.emissiveColor = Ne.Red().scale(0.5), n = lp._CreateArrow(e, f, a);
      }
      if (!i) {
        const f = new Wt("yAxisMaterial", e);
        f.disableLighting = !0, f.emissiveColor = Ne.Green().scale(0.5), i = lp._CreateArrow(e, f, a);
      }
      if (!s) {
        const f = new Wt("zAxisMaterial", e);
        f.disableLighting = !0, f.emissiveColor = Ne.Blue().scale(0.5), s = lp._CreateArrow(e, f, a);
      }
      this._xAxis = n, this._yAxis = i, this._zAxis = s, this.scaleLines = t, r != null && (aq._SetRenderingGroupId(this._xAxis, r), aq._SetRenderingGroupId(this._yAxis, r), aq._SetRenderingGroupId(this._zAxis, r)), this.scene = e, this.update(new S(), S.Right(), S.Up(), S.Forward());
    }
  }
  /**
   * Force the viewer to update
   * @param position defines the position of the viewer
   * @param xaxis defines the x axis of the viewer
   * @param yaxis defines the y axis of the viewer
   * @param zaxis defines the z axis of the viewer
   */
  update(e, t, r, n) {
    this._xAxis.position.copyFrom(e), this._xAxis.setDirection(t), this._yAxis.position.copyFrom(e), this._yAxis.setDirection(r), this._zAxis.position.copyFrom(e), this._zAxis.setDirection(n);
  }
  /**
   * Creates an instance of this axes viewer.
   * @returns a new axes viewer with instanced meshes
   */
  createInstance() {
    const e = lp._CreateArrowInstance(this.scene, this._xAxis), t = lp._CreateArrowInstance(this.scene, this._yAxis), r = lp._CreateArrowInstance(this.scene, this._zAxis), n = new aq(this.scene, this.scaleLines, null, e, t, r);
    return n._instanced = !0, n;
  }
  /** Releases resources */
  dispose() {
    this._xAxis && this._xAxis.dispose(!1, !this._instanced), this._yAxis && this._yAxis.dispose(!1, !this._instanced), this._zAxis && this._zAxis.dispose(!1, !this._instanced), this.scene = null;
  }
  static _SetRenderingGroupId(e, t) {
    e.getChildMeshes().forEach((r) => {
      r.renderingGroupId = t;
    });
  }
}
class Bve extends aq {
  /**
   * Creates a new BoneAxesViewer
   * @param scene defines the hosting scene
   * @param bone defines the target bone
   * @param mesh defines the target mesh
   * @param scaleLines defines a scaling factor for line length (1 by default)
   */
  constructor(e, t, r, n = 1) {
    super(e, n), this.pos = S.Zero(), this.xaxis = S.Zero(), this.yaxis = S.Zero(), this.zaxis = S.Zero(), this.mesh = r, this.bone = t;
  }
  /**
   * Force the viewer to update
   */
  update() {
    if (!this.mesh || !this.bone)
      return;
    const e = this.bone;
    e.getAbsolutePositionToRef(this.mesh, this.pos), e.getDirectionToRef(bf.X, this.mesh, this.xaxis), e.getDirectionToRef(bf.Y, this.mesh, this.yaxis), e.getDirectionToRef(bf.Z, this.mesh, this.zaxis), super.update(this.pos, this.xaxis, this.yaxis, this.zaxis);
  }
  /** Releases resources */
  dispose() {
    this.mesh && (this.mesh = null, this.bone = null, super.dispose());
  }
}
Object.defineProperty(sr.prototype, "debugLayer", {
  get: function() {
    return this._debugLayer || (this._debugLayer = new pm(this)), this._debugLayer;
  },
  enumerable: !0,
  configurable: !0
});
var rF;
(function(A) {
  A[A.Properties = 0] = "Properties", A[A.Debug = 1] = "Debug", A[A.Statistics = 2] = "Statistics", A[A.Tools = 3] = "Tools", A[A.Settings = 4] = "Settings";
})(rF || (rF = {}));
class pm {
  /**
   * Observable triggered when a property is changed through the inspector.
   */
  get onPropertyChangedObservable() {
    return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector ? this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable : (this._onPropertyChangedObservable || (this._onPropertyChangedObservable = new Oe()), this._onPropertyChangedObservable);
  }
  /**
   * Observable triggered when the selection is changed through the inspector.
   */
  get onSelectionChangedObservable() {
    return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector ? this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable : (this._onSelectionChangedObservable || (this._onSelectionChangedObservable = new Oe()), this._onSelectionChangedObservable);
  }
  /**
   * Instantiates a new debug layer.
   * The debug layer (aka Inspector) is the go to tool in order to better understand
   * what is happening in your scene
   * @see https://doc.babylonjs.com/toolsAndResources/inspector
   * @param scene Defines the scene to inspect
   */
  constructor(e) {
    this.BJSINSPECTOR = this._getGlobalInspector(), this._scene = e || gr.LastCreatedScene, this._scene && this._scene.onDisposeObservable.add(() => {
      this._scene._debugLayer && this._scene._debugLayer.hide();
    });
  }
  /**
   * Creates the inspector window.
   * @param config
   */
  _createInspector(e) {
    if (this.isVisible())
      return;
    if (this._onPropertyChangedObservable) {
      for (const r of this._onPropertyChangedObservable.observers)
        this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable.add(r);
      this._onPropertyChangedObservable.clear(), this._onPropertyChangedObservable = void 0;
    }
    if (this._onSelectionChangedObservable) {
      for (const r of this._onSelectionChangedObservable.observers)
        this.BJSINSPECTOR.Inspector.OnSelectionChangedObservable.add(r);
      this._onSelectionChangedObservable.clear(), this._onSelectionChangedObservable = void 0;
    }
    const t = Object.assign(Object.assign({}, pm.Config), e);
    this.BJSINSPECTOR = this.BJSINSPECTOR || this._getGlobalInspector(), this.BJSINSPECTOR.Inspector.Show(this._scene, t);
  }
  /**
   * Select a specific entity in the scene explorer and highlight a specific block in that entity property grid
   * @param entity defines the entity to select
   * @param lineContainerTitles defines the specific blocks to highlight (could be a string or an array of strings)
   */
  select(e, t) {
    this.BJSINSPECTOR && (t && (Object.prototype.toString.call(t) == "[object String]" ? this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(t) : this.BJSINSPECTOR.Inspector.MarkMultipleLineContainerTitlesForHighlighting(t)), this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable.notifyObservers(e));
  }
  /** Get the inspector from bundle or global */
  _getGlobalInspector() {
    if (typeof INSPECTOR < "u")
      return INSPECTOR;
    if (typeof BABYLON < "u" && typeof BABYLON.Inspector < "u")
      return BABYLON;
  }
  /**
   * Get if the inspector is visible or not.
   * @returns true if visible otherwise, false
   */
  isVisible() {
    return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;
  }
  /**
   * Hide the inspector and close its window.
   */
  hide() {
    this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.Hide();
  }
  /**
   * Update the scene in the inspector
   */
  setAsActiveScene() {
    this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector._SetNewScene(this._scene);
  }
  /**
   * Launch the debugLayer.
   * @param config Define the configuration of the inspector
   * @returns a promise fulfilled when the debug layer is visible
   */
  show(e) {
    return new Promise((t) => {
      if (typeof this.BJSINSPECTOR > "u") {
        const r = e && e.inspectorURL ? e.inspectorURL : pm.InspectorURL;
        ye.LoadBabylonScript(r, () => {
          this._createInspector(e), t(this);
        });
      } else
        this._createInspector(e), t(this);
    });
  }
}
pm.InspectorURL = `${ye._DefaultCdnUrl}/v${Ge.Version}/inspector/babylon.inspector.bundle.js`;
pm.Config = {
  overlay: !1,
  showExplorer: !0,
  showInspector: !0,
  embedMode: !1,
  handleResize: !0,
  enablePopup: !0
};
function LO(A) {
  let t = [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23];
  const r = [
    0,
    0,
    1,
    0,
    0,
    1,
    0,
    0,
    1,
    0,
    0,
    1,
    0,
    0,
    -1,
    0,
    0,
    -1,
    0,
    0,
    -1,
    0,
    0,
    -1,
    1,
    0,
    0,
    1,
    0,
    0,
    1,
    0,
    0,
    1,
    0,
    0,
    -1,
    0,
    0,
    -1,
    0,
    0,
    -1,
    0,
    0,
    -1,
    0,
    0,
    0,
    1,
    0,
    0,
    1,
    0,
    0,
    1,
    0,
    0,
    1,
    0,
    0,
    -1,
    0,
    0,
    -1,
    0,
    0,
    -1,
    0,
    0,
    -1,
    0
  ], n = [];
  let i = [];
  const s = A.width || A.size || 1, a = A.height || A.size || 1, f = A.depth || A.size || 1, o = A.wrap || !1;
  let d = A.topBaseAt === void 0 ? 1 : A.topBaseAt, v = A.bottomBaseAt === void 0 ? 0 : A.bottomBaseAt;
  d = (d + 4) % 4, v = (v + 4) % 4;
  const u = [2, 0, 3, 1], l = [2, 0, 1, 3];
  let P = u[d], p = l[v], c = [
    1,
    -1,
    1,
    -1,
    -1,
    1,
    -1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    -1,
    -1,
    1,
    -1,
    -1,
    -1,
    -1,
    1,
    -1,
    -1,
    1,
    1,
    -1,
    1,
    -1,
    -1,
    1,
    -1,
    1,
    1,
    1,
    1,
    -1,
    1,
    1,
    -1,
    -1,
    1,
    -1,
    -1,
    -1,
    -1,
    1,
    -1,
    -1,
    1,
    1,
    -1,
    1,
    -1,
    1,
    1,
    -1,
    1,
    1,
    1,
    1,
    -1,
    1,
    1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    1
  ];
  if (o) {
    t = [2, 3, 0, 2, 0, 1, 4, 5, 6, 4, 6, 7, 9, 10, 11, 9, 11, 8, 12, 14, 15, 12, 13, 14], c = [
      -1,
      1,
      1,
      1,
      1,
      1,
      1,
      -1,
      1,
      -1,
      -1,
      1,
      1,
      1,
      -1,
      -1,
      1,
      -1,
      -1,
      -1,
      -1,
      1,
      -1,
      -1,
      1,
      1,
      1,
      1,
      1,
      -1,
      1,
      -1,
      -1,
      1,
      -1,
      1,
      -1,
      1,
      -1,
      -1,
      1,
      1,
      -1,
      -1,
      1,
      -1,
      -1,
      -1
    ];
    let m = [
      [1, 1, 1],
      [-1, 1, 1],
      [-1, 1, -1],
      [1, 1, -1]
    ], I = [
      [-1, -1, 1],
      [1, -1, 1],
      [1, -1, -1],
      [-1, -1, -1]
    ];
    const N = [17, 18, 19, 16], k = [22, 23, 20, 21];
    for (; P > 0; )
      m.unshift(m.pop()), N.unshift(N.pop()), P--;
    for (; p > 0; )
      I.unshift(I.pop()), k.unshift(k.pop()), p--;
    m = m.flat(), I = I.flat(), c = c.concat(m).concat(I), t.push(N[0], N[2], N[3], N[0], N[1], N[2]), t.push(k[0], k[2], k[3], k[0], k[1], k[2]);
  }
  const H = [s / 2, a / 2, f / 2];
  i = c.reduce((m, I, N) => m.concat(I * H[N % 3]), []);
  const T = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE, q = A.faceUV || new Array(6), b = A.faceColors, j = [];
  for (let m = 0; m < 6; m++)
    q[m] === void 0 && (q[m] = new Ir(0, 0, 1, 1)), b && b[m] === void 0 && (b[m] = new xt(1, 1, 1, 1));
  for (let m = 0; m < 6; m++)
    if (n.push(q[m].z, us.UseOpenGLOrientationForUV ? 1 - q[m].w : q[m].w), n.push(q[m].x, us.UseOpenGLOrientationForUV ? 1 - q[m].w : q[m].w), n.push(q[m].x, us.UseOpenGLOrientationForUV ? 1 - q[m].y : q[m].y), n.push(q[m].z, us.UseOpenGLOrientationForUV ? 1 - q[m].y : q[m].y), b)
      for (let I = 0; I < 4; I++)
        j.push(b[m].r, b[m].g, b[m].b, b[m].a);
  Ut._ComputeSides(T, i, t, r, n, A.frontUVs, A.backUVs);
  const w = new Ut();
  if (w.indices = t, w.positions = i, w.normals = r, w.uvs = n, b) {
    const m = T === Ut.DOUBLESIDE ? j.concat(j) : j;
    w.colors = m;
  }
  return w;
}
function $ee(A) {
  const e = A.width || A.size || 1, t = A.height || A.size || 1, r = A.depth || A.size || 1, n = (A.widthSegments || A.segments || 1) | 0, i = (A.heightSegments || A.segments || 1) | 0, s = (A.depthSegments || A.segments || 1) | 0, a = new he(), f = new he(), o = new he(), d = y2({ width: e, height: r, subdivisionsX: n, subdivisionsY: s });
  he.TranslationToRef(0, -t / 2, 0, f), he.RotationZToRef(Math.PI, a), a.multiplyToRef(f, o), d.transform(o);
  const v = y2({ width: e, height: r, subdivisionsX: n, subdivisionsY: s });
  he.TranslationToRef(0, t / 2, 0, o), v.transform(o);
  const u = y2({ width: t, height: r, subdivisionsX: i, subdivisionsY: s });
  he.TranslationToRef(-e / 2, 0, 0, f), he.RotationZToRef(Math.PI / 2, a), a.multiplyToRef(f, o), u.transform(o);
  const l = y2({ width: t, height: r, subdivisionsX: i, subdivisionsY: s });
  he.TranslationToRef(e / 2, 0, 0, f), he.RotationZToRef(-Math.PI / 2, a), a.multiplyToRef(f, o), l.transform(o);
  const P = y2({ width: e, height: t, subdivisionsX: n, subdivisionsY: i });
  he.TranslationToRef(0, 0, -r / 2, f), he.RotationXToRef(-Math.PI / 2, a), a.multiplyToRef(f, o), P.transform(o);
  const p = y2({ width: e, height: t, subdivisionsX: n, subdivisionsY: i });
  return he.TranslationToRef(0, 0, r / 2, f), he.RotationXToRef(Math.PI / 2, a), a.multiplyToRef(f, o), p.transform(o), d.merge([v, l, u, P, p], !0), d;
}
function k0(A, e = {}, t = null) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, LO(e).applyToMesh(r, e.updatable), r;
}
const Wve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateBox: k0
};
Ut.CreateBox = LO;
Ee.CreateBox = (A, e, t = null, r, n) => k0(A, {
  size: e,
  sideOrientation: n,
  updatable: r
}, t);
function KO(A) {
  const e = (A.segments || 32) | 0, t = A.diameterX || A.diameter || 1, r = A.diameterY || A.diameter || 1, n = A.diameterZ || A.diameter || 1, i = A.arc && (A.arc <= 0 || A.arc > 1) ? 1 : A.arc || 1, s = A.slice && A.slice <= 0 ? 1 : A.slice || 1, a = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE, f = !!A.dedupTopBottomIndices, o = new S(t / 2, r / 2, n / 2), d = 2 + e, v = 2 * d, u = [], l = [], P = [], p = [];
  for (let H = 0; H <= d; H++) {
    const T = H / d, q = T * Math.PI * s;
    for (let b = 0; b <= v; b++) {
      const j = b / v, w = j * Math.PI * 2 * i, m = he.RotationZ(-q), I = he.RotationY(w), N = S.TransformCoordinates(S.Up(), m), k = S.TransformCoordinates(N, I), R = k.multiply(o), y = k.divide(o).normalize();
      l.push(R.x, R.y, R.z), P.push(y.x, y.y, y.z), p.push(j, us.UseOpenGLOrientationForUV ? 1 - T : T);
    }
    if (H > 0) {
      const b = l.length / 3;
      for (let j = b - 2 * (v + 1); j + v + 2 < b; j++)
        f ? (H > 1 && (u.push(j), u.push(j + 1), u.push(j + v + 1)), (H < d || s < 1) && (u.push(j + v + 1), u.push(j + 1), u.push(j + v + 2))) : (u.push(j), u.push(j + 1), u.push(j + v + 1), u.push(j + v + 1), u.push(j + 1), u.push(j + v + 2));
    }
  }
  Ut._ComputeSides(a, l, u, P, p, A.frontUVs, A.backUVs);
  const c = new Ut();
  return c.indices = u, c.positions = l, c.normals = P, c.uvs = p, c;
}
function UA(A, e = {}, t = null) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, KO(e).applyToMesh(r, e.updatable), r;
}
const Sve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateSphere: UA
};
Ut.CreateSphere = KO;
Ee.CreateSphere = (A, e, t, r, n, i) => UA(A, {
  segments: e,
  diameterX: t,
  diameterY: t,
  diameterZ: t,
  sideOrientation: i,
  updatable: n
}, r);
function JO(A = {
  subdivisions: 2,
  tessellation: 16,
  height: 1,
  radius: 0.25,
  capSubdivisions: 6
}) {
  const e = Math.max(A.subdivisions ? A.subdivisions : 2, 1) | 0, t = Math.max(A.tessellation ? A.tessellation : 16, 3) | 0, r = Math.max(A.height ? A.height : 1, 0), n = Math.max(A.radius ? A.radius : 0.25, 0), i = Math.max(A.capSubdivisions ? A.capSubdivisions : 6, 1) | 0, s = t, a = e, f = Math.max(A.radiusTop ? A.radiusTop : n, 0), o = Math.max(A.radiusBottom ? A.radiusBottom : n, 0), d = r - (f + o), v = 0, u = 2 * Math.PI, l = Math.max(A.topCapSubdivisions ? A.topCapSubdivisions : i, 1), P = Math.max(A.bottomCapSubdivisions ? A.bottomCapSubdivisions : i, 1), p = Math.acos((o - f) / r);
  let c = [];
  const H = [], T = [], q = [];
  let b = 0;
  const j = [], w = d * 0.5, m = Math.PI * 0.5;
  let I, N;
  const k = S.Zero(), R = S.Zero(), y = Math.cos(p), O = Math.sin(p), Y = new at(f * O, w + f * y).subtract(new at(o * O, -w + o * y)).length(), ee = f * p + Y + o * (m - p);
  let Z = 0;
  for (N = 0; N <= l; N++) {
    const G = [], L = m - p * (N / l);
    Z += f * p / l;
    const $ = Math.cos(L), ae = Math.sin(L), Pe = $ * f;
    for (I = 0; I <= s; I++) {
      const ge = I / s, me = ge * u + v, Xe = Math.sin(me), De = Math.cos(me);
      R.x = Pe * Xe, R.y = w + ae * f, R.z = Pe * De, H.push(R.x, R.y, R.z), k.set($ * Xe, ae, $ * De), T.push(k.x, k.y, k.z), q.push(ge, us.UseOpenGLOrientationForUV ? Z / ee : 1 - Z / ee), G.push(b), b++;
    }
    j.push(G);
  }
  const te = r - f - o + y * f - y * o, fe = O * (o - f) / te;
  for (N = 1; N <= a; N++) {
    const G = [];
    Z += Y / a;
    const L = O * (N * (o - f) / a + f);
    for (I = 0; I <= s; I++) {
      const $ = I / s, ae = $ * u + v, Pe = Math.sin(ae), ge = Math.cos(ae);
      R.x = L * Pe, R.y = w + y * f - N * te / a, R.z = L * ge, H.push(R.x, R.y, R.z), k.set(Pe, fe, ge).normalize(), T.push(k.x, k.y, k.z), q.push($, us.UseOpenGLOrientationForUV ? Z / ee : 1 - Z / ee), G.push(b), b++;
    }
    j.push(G);
  }
  for (N = 1; N <= P; N++) {
    const G = [], L = m - p - (Math.PI - p) * (N / P);
    Z += o * p / P;
    const $ = Math.cos(L), ae = Math.sin(L), Pe = $ * o;
    for (I = 0; I <= s; I++) {
      const ge = I / s, me = ge * u + v, Xe = Math.sin(me), De = Math.cos(me);
      R.x = Pe * Xe, R.y = -w + ae * o, R.z = Pe * De, H.push(R.x, R.y, R.z), k.set($ * Xe, ae, $ * De), T.push(k.x, k.y, k.z), q.push(ge, us.UseOpenGLOrientationForUV ? Z / ee : 1 - Z / ee), G.push(b), b++;
    }
    j.push(G);
  }
  for (I = 0; I < s; I++)
    for (N = 0; N < l + a + P; N++) {
      const G = j[N][I], L = j[N + 1][I], $ = j[N + 1][I + 1], ae = j[N][I + 1];
      c.push(G), c.push(L), c.push(ae), c.push(L), c.push($), c.push(ae);
    }
  if (c = c.reverse(), A.orientation && !A.orientation.equals(S.Up())) {
    const G = new he();
    A.orientation.clone().scale(Math.PI * 0.5).cross(S.Up()).toQuaternion().toRotationMatrix(G);
    const L = S.Zero();
    for (let $ = 0; $ < H.length; $ += 3)
      L.set(H[$], H[$ + 1], H[$ + 2]), S.TransformCoordinatesToRef(L.clone(), G, L), H[$] = L.x, H[$ + 1] = L.y, H[$ + 2] = L.z;
  }
  const _ = new Ut();
  return _.positions = H, _.normals = T, _.uvs = q, _.indices = c, _;
}
function KR(A, e = {
  orientation: S.Up(),
  subdivisions: 2,
  tessellation: 16,
  height: 1,
  radius: 0.25,
  capSubdivisions: 6,
  updatable: !1
}, t = null) {
  const r = new Ee(A, t);
  return JO(e).applyToMesh(r, e.updatable), r;
}
const Uve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateCapsule: KR
};
Ee.CreateCapsule = (A, e, t) => KR(A, e, t);
Ut.CreateCapsule = JO;
function jQ(A) {
  let e = A.pathArray;
  const t = A.closeArray || !1, r = A.closePath || !1, n = A.invertUV || !1, i = Math.floor(e[0].length / 2);
  let s = A.offset || i;
  s = s > i ? i : Math.floor(s);
  const a = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE, f = A.uvs, o = A.colors, d = [], v = [], u = [], l = [], P = [], p = [], c = [], H = [];
  let T;
  const q = [], b = [];
  let j, w, m;
  if (e.length < 2) {
    const ve = [], qe = [];
    for (w = 0; w < e[0].length - s; w++)
      ve.push(e[0][w]), qe.push(e[0][w + s]);
    e = [ve, qe];
  }
  let I = 0;
  const N = r ? 1 : 0;
  let k, R;
  T = e[0].length;
  let y, O;
  for (j = 0; j < e.length; j++) {
    for (c[j] = 0, P[j] = [0], k = e[j], R = k.length, T = T < R ? T : R, m = 0; m < R; )
      d.push(k[m].x, k[m].y, k[m].z), m > 0 && (y = k[m].subtract(k[m - 1]).length(), O = y + c[j], P[j].push(O), c[j] = O), m++;
    r && (m--, d.push(k[0].x, k[0].y, k[0].z), y = k[m].subtract(k[0]).length(), O = y + c[j], P[j].push(O), c[j] = O), q[j] = R + N, b[j] = I, I += R + N;
  }
  let Y, ee, Z = null, te = null;
  for (w = 0; w < T + N; w++) {
    for (H[w] = 0, p[w] = [0], j = 0; j < e.length - 1; j++)
      Y = e[j], ee = e[j + 1], w === T ? (Z = Y[0], te = ee[0]) : (Z = Y[w], te = ee[w]), y = te.subtract(Z).length(), O = y + H[w], p[w].push(O), H[w] = O;
    t && te && Z && (Y = e[j], ee = e[0], w === T && (te = ee[0]), y = te.subtract(Z).length(), O = y + H[w], H[w] = O);
  }
  let fe, _;
  if (f)
    for (j = 0; j < f.length; j++)
      l.push(f[j].x, us.UseOpenGLOrientationForUV ? 1 - f[j].y : f[j].y);
  else
    for (j = 0; j < e.length; j++)
      for (w = 0; w < T + N; w++)
        fe = c[j] != 0 ? P[j][w] / c[j] : 0, _ = H[w] != 0 ? p[w][j] / H[w] : 0, n ? l.push(_, fe) : l.push(fe, us.UseOpenGLOrientationForUV ? 1 - _ : _);
  j = 0;
  let G = 0, L = q[j] - 1, $ = q[j + 1] - 1, ae = L < $ ? L : $, Pe = b[1] - b[0];
  const ge = t ? q.length : q.length - 1;
  for (; G <= ae && j < ge; )
    v.push(G, G + Pe, G + 1), v.push(G + Pe + 1, G + 1, G + Pe), G += 1, G === ae && (j++, j === q.length - 1 ? (Pe = b[0] - b[j], L = q[j] - 1, $ = q[0] - 1) : (Pe = b[j + 1] - b[j], L = q[j] - 1, $ = q[j + 1] - 1), G = b[j], ae = L < $ ? L + G : $ + G);
  if (Ut.ComputeNormals(d, v, u), r) {
    let ve = 0, qe = 0;
    for (j = 0; j < e.length; j++)
      ve = b[j] * 3, j + 1 < e.length ? qe = (b[j + 1] - 1) * 3 : qe = u.length - 3, u[ve] = (u[ve] + u[qe]) * 0.5, u[ve + 1] = (u[ve + 1] + u[qe + 1]) * 0.5, u[ve + 2] = (u[ve + 2] + u[qe + 2]) * 0.5, u[qe] = u[ve], u[qe + 1] = u[ve + 1], u[qe + 2] = u[ve + 2];
  }
  Ut._ComputeSides(a, d, v, u, l, A.frontUVs, A.backUVs);
  let me = null;
  if (o) {
    me = new Float32Array(o.length * 4);
    for (let ve = 0; ve < o.length; ve++)
      me[ve * 4] = o[ve].r, me[ve * 4 + 1] = o[ve].g, me[ve * 4 + 2] = o[ve].b, me[ve * 4 + 3] = o[ve].a;
  }
  const Xe = new Ut(), De = new Float32Array(d), ne = new Float32Array(u), re = new Float32Array(l);
  return Xe.indices = v, Xe.positions = De, Xe.normals = ne, Xe.uvs = re, me && Xe.set(me, J.ColorKind), r && (Xe._idx = b), Xe;
}
function n4(A, e, t = null) {
  const r = e.pathArray, n = e.closeArray, i = e.closePath, s = Ee._GetDefaultSideOrientation(e.sideOrientation), a = e.instance, f = e.updatable;
  if (a) {
    const o = ue.Vector3[0].setAll(Number.MAX_VALUE), d = ue.Vector3[1].setAll(-Number.MAX_VALUE), v = (l) => {
      let P = r[0].length;
      const p = a;
      let c = 0;
      const H = p._originalBuilderSideOrientation === Ee.DOUBLESIDE ? 2 : 1;
      for (let T = 1; T <= H; ++T)
        for (let q = 0; q < r.length; ++q) {
          const b = r[q], j = b.length;
          P = P < j ? P : j;
          for (let w = 0; w < P; ++w) {
            const m = b[w];
            l[c] = m.x, l[c + 1] = m.y, l[c + 2] = m.z, o.minimizeInPlaceFromFloats(m.x, m.y, m.z), d.maximizeInPlaceFromFloats(m.x, m.y, m.z), c += 3;
          }
          if (p._creationDataStorage && p._creationDataStorage.closePath) {
            const w = b[0];
            l[c] = w.x, l[c + 1] = w.y, l[c + 2] = w.z, c += 3;
          }
        }
    }, u = a.getVerticesData(J.PositionKind);
    if (v(u), a.hasBoundingInfo ? a.getBoundingInfo().reConstruct(o, d, a._worldMatrix) : a.buildBoundingInfo(o, d, a._worldMatrix), a.updateVerticesData(J.PositionKind, u, !1, !1), e.colors) {
      const l = a.getVerticesData(J.ColorKind);
      for (let P = 0, p = 0; P < e.colors.length; P++, p += 4) {
        const c = e.colors[P];
        l[p] = c.r, l[p + 1] = c.g, l[p + 2] = c.b, l[p + 3] = c.a;
      }
      a.updateVerticesData(J.ColorKind, l, !1, !1);
    }
    if (e.uvs) {
      const l = a.getVerticesData(J.UVKind);
      for (let P = 0; P < e.uvs.length; P++)
        l[P * 2] = e.uvs[P].x, l[P * 2 + 1] = us.UseOpenGLOrientationForUV ? 1 - e.uvs[P].y : e.uvs[P].y;
      a.updateVerticesData(J.UVKind, l, !1, !1);
    }
    if (!a.areNormalsFrozen || a.isFacetDataEnabled) {
      const l = a.getIndices(), P = a.getVerticesData(J.NormalKind), p = a.isFacetDataEnabled ? a.getFacetDataParameters() : null;
      if (Ut.ComputeNormals(u, l, P, p), a._creationDataStorage && a._creationDataStorage.closePath) {
        let c = 0, H = 0;
        for (let T = 0; T < r.length; T++)
          c = a._creationDataStorage.idx[T] * 3, T + 1 < r.length ? H = (a._creationDataStorage.idx[T + 1] - 1) * 3 : H = P.length - 3, P[c] = (P[c] + P[H]) * 0.5, P[c + 1] = (P[c + 1] + P[H + 1]) * 0.5, P[c + 2] = (P[c + 2] + P[H + 2]) * 0.5, P[H] = P[c], P[H + 1] = P[c + 1], P[H + 2] = P[c + 2];
      }
      a.areNormalsFrozen || a.updateVerticesData(J.NormalKind, P, !1, !1);
    }
    return a;
  } else {
    const o = new Ee(A, t);
    o._originalBuilderSideOrientation = s, o._creationDataStorage = new tQ();
    const d = jQ(e);
    return i && (o._creationDataStorage.idx = d._idx), o._creationDataStorage.closePath = i, o._creationDataStorage.closeArray = n, d.applyToMesh(o, f), o;
  }
}
const Ive = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateRibbon: n4
};
Ut.CreateRibbon = jQ;
Ee.CreateRibbon = (A, e, t = !1, r, n, i, s = !1, a, f) => n4(A, {
  pathArray: e,
  closeArray: t,
  closePath: r,
  offset: n,
  updatable: s,
  sideOrientation: a,
  instance: f
}, i);
function zO(A) {
  const e = [], t = [], r = [], n = [], i = A.radius || 0.5, s = A.tessellation || 64, a = A.arc && (A.arc <= 0 || A.arc > 1) ? 1 : A.arc || 1, f = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE;
  e.push(0, 0, 0), n.push(0.5, 0.5);
  const o = Math.PI * 2 * a, d = a === 1 ? o / s : o / (s - 1);
  let v = 0;
  for (let P = 0; P < s; P++) {
    const p = Math.cos(v), c = Math.sin(v), H = (p + 1) / 2, T = (1 - c) / 2;
    e.push(i * p, i * c, 0), n.push(H, us.UseOpenGLOrientationForUV ? 1 - T : T), v += d;
  }
  a === 1 && (e.push(e[3], e[4], e[5]), n.push(n[2], us.UseOpenGLOrientationForUV ? 1 - n[3] : n[3]));
  const u = e.length / 3;
  for (let P = 1; P < u - 1; P++)
    t.push(P + 1, 0, P);
  Ut.ComputeNormals(e, t, r), Ut._ComputeSides(f, e, t, r, n, A.frontUVs, A.backUVs);
  const l = new Ut();
  return l.indices = t, l.positions = e, l.normals = r, l.uvs = n, l;
}
function uU(A, e = {}, t = null) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, zO(e).applyToMesh(r, e.updatable), r;
}
const Rve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateDisc: uU
};
Ut.CreateDisc = zO;
Ee.CreateDisc = (A, e, t, r = null, n, i) => uU(A, {
  radius: e,
  tessellation: t,
  sideOrientation: i,
  updatable: n
}, r);
function $W(A) {
  const e = A.pattern || Ee.NO_FLIP, t = A.tileWidth || A.tileSize || 1, r = A.tileHeight || A.tileSize || 1, n = A.alignHorizontal || 0, i = A.alignVertical || 0, s = A.width || A.size || 1, a = Math.floor(s / t);
  let f = s - a * t;
  const o = A.height || A.size || 1, d = Math.floor(o / r);
  let v = o - d * r;
  const u = t * a / 2, l = r * d / 2;
  let P = 0, p = 0, c = 0, H = 0, T = 0, q = 0;
  if (f > 0 || v > 0) {
    switch (c = -u, H = -l, T = u, q = l, n) {
      case Ee.CENTER:
        f /= 2, c -= f, T += f;
        break;
      case Ee.LEFT:
        T += f, P = -f / 2;
        break;
      case Ee.RIGHT:
        c -= f, P = f / 2;
        break;
    }
    switch (i) {
      case Ee.CENTER:
        v /= 2, H -= v, q += v;
        break;
      case Ee.BOTTOM:
        q += v, p = -v / 2;
        break;
      case Ee.TOP:
        H -= v, p = v / 2;
        break;
    }
  }
  const b = [], j = [], w = [];
  w[0] = [0, 0, 1, 0, 1, 1, 0, 1], w[1] = [0, 0, 1, 0, 1, 1, 0, 1], (e === Ee.ROTATE_TILE || e === Ee.ROTATE_ROW) && (w[1] = [1, 1, 0, 1, 0, 0, 1, 0]), (e === Ee.FLIP_TILE || e === Ee.FLIP_ROW) && (w[1] = [1, 0, 0, 0, 0, 1, 1, 1]), (e === Ee.FLIP_N_ROTATE_TILE || e === Ee.FLIP_N_ROTATE_ROW) && (w[1] = [0, 1, 1, 1, 1, 0, 0, 0]);
  let m = [];
  const I = [], N = [];
  let k = 0;
  for (let Y = 0; Y < d; Y++)
    for (let ee = 0; ee < a; ee++)
      b.push(-u + ee * t + P, -l + Y * r + p, 0), b.push(-u + (ee + 1) * t + P, -l + Y * r + p, 0), b.push(-u + (ee + 1) * t + P, -l + (Y + 1) * r + p, 0), b.push(-u + ee * t + P, -l + (Y + 1) * r + p, 0), N.push(k, k + 1, k + 3, k + 1, k + 2, k + 3), e === Ee.FLIP_TILE || e === Ee.ROTATE_TILE || e === Ee.FLIP_N_ROTATE_TILE ? m = m.concat(w[(ee % 2 + Y % 2) % 2]) : e === Ee.FLIP_ROW || e === Ee.ROTATE_ROW || e === Ee.FLIP_N_ROTATE_ROW ? m = m.concat(w[Y % 2]) : m = m.concat(w[0]), I.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), j.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1), k += 4;
  if (f > 0 || v > 0) {
    const Y = v > 0 && (i === Ee.CENTER || i === Ee.TOP), ee = v > 0 && (i === Ee.CENTER || i === Ee.BOTTOM), Z = f > 0 && (n === Ee.CENTER || n === Ee.RIGHT), te = f > 0 && (n === Ee.CENTER || n === Ee.LEFT);
    let fe = [], _, G, L, $;
    if (Y && Z && (b.push(c + P, H + p, 0), b.push(-u + P, H + p, 0), b.push(-u + P, H + v + p, 0), b.push(c + P, H + v + p, 0), N.push(k, k + 1, k + 3, k + 1, k + 2, k + 3), k += 4, _ = 1 - f / t, G = 1 - v / r, L = 1, $ = 1, fe = [_, G, L, G, L, $, _, $], e === Ee.ROTATE_ROW && (fe = [1 - _, 1 - G, 1 - L, 1 - G, 1 - L, 1 - $, 1 - _, 1 - $]), e === Ee.FLIP_ROW && (fe = [1 - _, G, 1 - L, G, 1 - L, $, 1 - _, $]), e === Ee.FLIP_N_ROTATE_ROW && (fe = [_, 1 - G, L, 1 - G, L, 1 - $, _, 1 - $]), m = m.concat(fe), I.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), j.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), Y && te && (b.push(u + P, H + p, 0), b.push(T + P, H + p, 0), b.push(T + P, H + v + p, 0), b.push(u + P, H + v + p, 0), N.push(k, k + 1, k + 3, k + 1, k + 2, k + 3), k += 4, _ = 0, G = 1 - v / r, L = f / t, $ = 1, fe = [_, G, L, G, L, $, _, $], (e === Ee.ROTATE_ROW || e === Ee.ROTATE_TILE && a % 2 === 0) && (fe = [1 - _, 1 - G, 1 - L, 1 - G, 1 - L, 1 - $, 1 - _, 1 - $]), (e === Ee.FLIP_ROW || e === Ee.FLIP_TILE && a % 2 === 0) && (fe = [1 - _, G, 1 - L, G, 1 - L, $, 1 - _, $]), (e === Ee.FLIP_N_ROTATE_ROW || e === Ee.FLIP_N_ROTATE_TILE && a % 2 === 0) && (fe = [_, 1 - G, L, 1 - G, L, 1 - $, _, 1 - $]), m = m.concat(fe), I.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), j.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), ee && Z && (b.push(c + P, l + p, 0), b.push(-u + P, l + p, 0), b.push(-u + P, q + p, 0), b.push(c + P, q + p, 0), N.push(k, k + 1, k + 3, k + 1, k + 2, k + 3), k += 4, _ = 1 - f / t, G = 0, L = 1, $ = v / r, fe = [_, G, L, G, L, $, _, $], (e === Ee.ROTATE_ROW && d % 2 === 1 || e === Ee.ROTATE_TILE && d % 1 === 0) && (fe = [1 - _, 1 - G, 1 - L, 1 - G, 1 - L, 1 - $, 1 - _, 1 - $]), (e === Ee.FLIP_ROW && d % 2 === 1 || e === Ee.FLIP_TILE && d % 2 === 0) && (fe = [1 - _, G, 1 - L, G, 1 - L, $, 1 - _, $]), (e === Ee.FLIP_N_ROTATE_ROW && d % 2 === 1 || e === Ee.FLIP_N_ROTATE_TILE && d % 2 === 0) && (fe = [_, 1 - G, L, 1 - G, L, 1 - $, _, 1 - $]), m = m.concat(fe), I.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), j.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), ee && te && (b.push(u + P, l + p, 0), b.push(T + P, l + p, 0), b.push(T + P, q + p, 0), b.push(u + P, q + p, 0), N.push(k, k + 1, k + 3, k + 1, k + 2, k + 3), k += 4, _ = 0, G = 0, L = f / t, $ = v / r, fe = [_, G, L, G, L, $, _, $], (e === Ee.ROTATE_ROW && d % 2 === 1 || e === Ee.ROTATE_TILE && (d + a) % 2 === 1) && (fe = [1 - _, 1 - G, 1 - L, 1 - G, 1 - L, 1 - $, 1 - _, 1 - $]), (e === Ee.FLIP_ROW && d % 2 === 1 || e === Ee.FLIP_TILE && (d + a) % 2 === 1) && (fe = [1 - _, G, 1 - L, G, 1 - L, $, 1 - _, $]), (e === Ee.FLIP_N_ROTATE_ROW && d % 2 === 1 || e === Ee.FLIP_N_ROTATE_TILE && (d + a) % 2 === 1) && (fe = [_, 1 - G, L, 1 - G, L, 1 - $, _, 1 - $]), m = m.concat(fe), I.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), j.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), Y) {
      const ae = [];
      _ = 0, G = 1 - v / r, L = 1, $ = 1, ae[0] = [_, G, L, G, L, $, _, $], ae[1] = [_, G, L, G, L, $, _, $], (e === Ee.ROTATE_TILE || e === Ee.ROTATE_ROW) && (ae[1] = [1 - _, 1 - G, 1 - L, 1 - G, 1 - L, 1 - $, 1 - _, 1 - $]), (e === Ee.FLIP_TILE || e === Ee.FLIP_ROW) && (ae[1] = [1 - _, G, 1 - L, G, 1 - L, $, 1 - _, $]), (e === Ee.FLIP_N_ROTATE_TILE || e === Ee.FLIP_N_ROTATE_ROW) && (ae[1] = [_, 1 - G, L, 1 - G, L, 1 - $, _, 1 - $]);
      for (let Pe = 0; Pe < a; Pe++)
        b.push(-u + Pe * t + P, H + p, 0), b.push(-u + (Pe + 1) * t + P, H + p, 0), b.push(-u + (Pe + 1) * t + P, H + v + p, 0), b.push(-u + Pe * t + P, H + v + p, 0), N.push(k, k + 1, k + 3, k + 1, k + 2, k + 3), k += 4, e === Ee.FLIP_TILE || e === Ee.ROTATE_TILE || e === Ee.FLIP_N_ROTATE_TILE ? m = m.concat(ae[(Pe + 1) % 2]) : e === Ee.FLIP_ROW || e === Ee.ROTATE_ROW || e === Ee.FLIP_N_ROTATE_ROW ? m = m.concat(ae[1]) : m = m.concat(ae[0]), I.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), j.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
    }
    if (ee) {
      const ae = [];
      _ = 0, G = 0, L = 1, $ = v / r, ae[0] = [_, G, L, G, L, $, _, $], ae[1] = [_, G, L, G, L, $, _, $], (e === Ee.ROTATE_TILE || e === Ee.ROTATE_ROW) && (ae[1] = [1 - _, 1 - G, 1 - L, 1 - G, 1 - L, 1 - $, 1 - _, 1 - $]), (e === Ee.FLIP_TILE || e === Ee.FLIP_ROW) && (ae[1] = [1 - _, G, 1 - L, G, 1 - L, $, 1 - _, $]), (e === Ee.FLIP_N_ROTATE_TILE || e === Ee.FLIP_N_ROTATE_ROW) && (ae[1] = [_, 1 - G, L, 1 - G, L, 1 - $, _, 1 - $]);
      for (let Pe = 0; Pe < a; Pe++)
        b.push(-u + Pe * t + P, q - v + p, 0), b.push(-u + (Pe + 1) * t + P, q - v + p, 0), b.push(-u + (Pe + 1) * t + P, q + p, 0), b.push(-u + Pe * t + P, q + p, 0), N.push(k, k + 1, k + 3, k + 1, k + 2, k + 3), k += 4, e === Ee.FLIP_TILE || e === Ee.ROTATE_TILE || e === Ee.FLIP_N_ROTATE_TILE ? m = m.concat(ae[(Pe + d) % 2]) : e === Ee.FLIP_ROW || e === Ee.ROTATE_ROW || e === Ee.FLIP_N_ROTATE_ROW ? m = m.concat(ae[d % 2]) : m = m.concat(ae[0]), I.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), j.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
    }
    if (Z) {
      const ae = [];
      _ = 1 - f / t, G = 0, L = 1, $ = 1, ae[0] = [_, G, L, G, L, $, _, $], ae[1] = [_, G, L, G, L, $, _, $], (e === Ee.ROTATE_TILE || e === Ee.ROTATE_ROW) && (ae[1] = [1 - _, 1 - G, 1 - L, 1 - G, 1 - L, 1 - $, 1 - _, 1 - $]), (e === Ee.FLIP_TILE || e === Ee.FLIP_ROW) && (ae[1] = [1 - _, G, 1 - L, G, 1 - L, $, 1 - _, $]), (e === Ee.FLIP_N_ROTATE_TILE || e === Ee.FLIP_N_ROTATE_ROW) && (ae[1] = [_, 1 - G, L, 1 - G, L, 1 - $, _, 1 - $]);
      for (let Pe = 0; Pe < d; Pe++)
        b.push(c + P, -l + Pe * r + p, 0), b.push(c + f + P, -l + Pe * r + p, 0), b.push(c + f + P, -l + (Pe + 1) * r + p, 0), b.push(c + P, -l + (Pe + 1) * r + p, 0), N.push(k, k + 1, k + 3, k + 1, k + 2, k + 3), k += 4, e === Ee.FLIP_TILE || e === Ee.ROTATE_TILE || e === Ee.FLIP_N_ROTATE_TILE ? m = m.concat(ae[(Pe + 1) % 2]) : e === Ee.FLIP_ROW || e === Ee.ROTATE_ROW || e === Ee.FLIP_N_ROTATE_ROW ? m = m.concat(ae[Pe % 2]) : m = m.concat(ae[0]), I.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), j.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
    }
    if (te) {
      const ae = [];
      _ = 0, G = 0, L = f / r, $ = 1, ae[0] = [_, G, L, G, L, $, _, $], ae[1] = [_, G, L, G, L, $, _, $], (e === Ee.ROTATE_TILE || e === Ee.ROTATE_ROW) && (ae[1] = [1 - _, 1 - G, 1 - L, 1 - G, 1 - L, 1 - $, 1 - _, 1 - $]), (e === Ee.FLIP_TILE || e === Ee.FLIP_ROW) && (ae[1] = [1 - _, G, 1 - L, G, 1 - L, $, 1 - _, $]), (e === Ee.FLIP_N_ROTATE_TILE || e === Ee.FLIP_N_ROTATE_ROW) && (ae[1] = [_, 1 - G, L, 1 - G, L, 1 - $, _, 1 - $]);
      for (let Pe = 0; Pe < d; Pe++)
        b.push(T - f + P, -l + Pe * r + p, 0), b.push(T + P, -l + Pe * r + p, 0), b.push(T + P, -l + (Pe + 1) * r + p, 0), b.push(T - f + P, -l + (Pe + 1) * r + p, 0), N.push(k, k + 1, k + 3, k + 1, k + 2, k + 3), k += 4, e === Ee.FLIP_TILE || e === Ee.ROTATE_TILE || e === Ee.FLIP_N_ROTATE_TILE ? m = m.concat(ae[(Pe + a) % 2]) : e === Ee.FLIP_ROW || e === Ee.ROTATE_ROW || e === Ee.FLIP_N_ROTATE_ROW ? m = m.concat(ae[Pe % 2]) : m = m.concat(ae[0]), I.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), j.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
    }
  }
  const R = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE;
  Ut._ComputeSides(R, b, N, j, m, A.frontUVs, A.backUVs);
  const y = new Ut();
  y.indices = N, y.positions = b, y.normals = j, y.uvs = m;
  const O = R === Ut.DOUBLESIDE ? I.concat(I) : I;
  return y.colors = O, y;
}
function wQ(A, e, t = null) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, $W(e).applyToMesh(r, e.updatable), r;
}
const Vve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateTiledPlane: wQ
};
Ut.CreateTiledPlane = $W;
function mQ(A) {
  const t = A.faceUV || new Array(6), r = A.faceColors, n = A.pattern || Ee.NO_FLIP, i = A.width || A.size || 1, s = A.height || A.size || 1, a = A.depth || A.size || 1, f = A.tileWidth || A.tileSize || 1, o = A.tileHeight || A.tileSize || 1, d = A.alignHorizontal || 0, v = A.alignVertical || 0, u = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE;
  for (let L = 0; L < 6; L++)
    t[L] === void 0 && (t[L] = new Ir(0, 0, 1, 1)), r && r[L] === void 0 && (r[L] = new xt(1, 1, 1, 1));
  const l = i / 2, P = s / 2, p = a / 2, c = [];
  for (let L = 0; L < 2; L++)
    c[L] = $W({
      pattern: n,
      tileWidth: f,
      tileHeight: o,
      width: i,
      height: s,
      alignVertical: v,
      alignHorizontal: d,
      sideOrientation: u
    });
  for (let L = 2; L < 4; L++)
    c[L] = $W({
      pattern: n,
      tileWidth: f,
      tileHeight: o,
      width: a,
      height: s,
      alignVertical: v,
      alignHorizontal: d,
      sideOrientation: u
    });
  let H = v;
  v === Ee.BOTTOM ? H = Ee.TOP : v === Ee.TOP && (H = Ee.BOTTOM);
  for (let L = 4; L < 6; L++)
    c[L] = $W({
      pattern: n,
      tileWidth: f,
      tileHeight: o,
      width: i,
      height: a,
      alignVertical: H,
      alignHorizontal: d,
      sideOrientation: u
    });
  let T = [], q = [], b = [], j = [];
  const w = [], m = [], I = [], N = [];
  let k = 0, R = 0;
  for (let L = 0; L < 6; L++) {
    const $ = c[L].positions.length;
    m[L] = [], I[L] = [];
    for (let ae = 0; ae < $ / 3; ae++)
      m[L].push(new S(c[L].positions[3 * ae], c[L].positions[3 * ae + 1], c[L].positions[3 * ae + 2])), I[L].push(new S(c[L].normals[3 * ae], c[L].normals[3 * ae + 1], c[L].normals[3 * ae + 2]));
    k = c[L].uvs.length, N[L] = [];
    for (let ae = 0; ae < k; ae += 2)
      N[L][ae] = t[L].x + (t[L].z - t[L].x) * c[L].uvs[ae], N[L][ae + 1] = t[L].y + (t[L].w - t[L].y) * c[L].uvs[ae + 1], us.UseOpenGLOrientationForUV && (N[L][ae + 1] = 1 - N[L][ae + 1]);
    if (b = b.concat(N[L]), j = j.concat(c[L].indices.map((ae) => ae + R)), R += m[L].length, r)
      for (let ae = 0; ae < 4; ae++)
        w.push(r[L].r, r[L].g, r[L].b, r[L].a);
  }
  const y = new S(0, 0, p), O = he.RotationY(Math.PI);
  T = m[0].map((L) => S.TransformNormal(L, O).add(y)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), []), q = I[0].map((L) => S.TransformNormal(L, O)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), []), T = T.concat(m[1].map((L) => L.subtract(y)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), [])), q = q.concat(I[1].map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), []));
  const Y = new S(l, 0, 0), ee = he.RotationY(-Math.PI / 2);
  T = T.concat(m[2].map((L) => S.TransformNormal(L, ee).add(Y)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), [])), q = q.concat(I[2].map((L) => S.TransformNormal(L, ee)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), []));
  const Z = he.RotationY(Math.PI / 2);
  T = T.concat(m[3].map((L) => S.TransformNormal(L, Z).subtract(Y)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), [])), q = q.concat(I[3].map((L) => S.TransformNormal(L, Z)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), []));
  const te = new S(0, P, 0), fe = he.RotationX(Math.PI / 2);
  T = T.concat(m[4].map((L) => S.TransformNormal(L, fe).add(te)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), [])), q = q.concat(I[4].map((L) => S.TransformNormal(L, fe)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), []));
  const _ = he.RotationX(-Math.PI / 2);
  T = T.concat(m[5].map((L) => S.TransformNormal(L, _).subtract(te)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), [])), q = q.concat(I[5].map((L) => S.TransformNormal(L, _)).map((L) => [L.x, L.y, L.z]).reduce((L, $) => L.concat($), [])), Ut._ComputeSides(u, T, j, q, b);
  const G = new Ut();
  if (G.indices = j, G.positions = T, G.normals = q, G.uvs = b, r) {
    const L = u === Ut.DOUBLESIDE ? w.concat(w) : w;
    G.colors = L;
  }
  return G;
}
function BQ(A, e, t = null) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, mQ(e).applyToMesh(r, e.updatable), r;
}
const Cve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateTiledBox: BQ
};
Ut.CreateTiledBox = mQ;
function WQ(A) {
  const e = [], t = [], r = [], n = [], i = A.radius || 2, s = A.tube || 0.5, a = A.radialSegments || 32, f = A.tubularSegments || 32, o = A.p || 2, d = A.q || 3, v = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE, u = (c) => {
    const H = Math.cos(c), T = Math.sin(c), q = d / o * c, b = Math.cos(q), j = i * (2 + b) * 0.5 * H, w = i * (2 + b) * T * 0.5, m = i * Math.sin(q) * 0.5;
    return new S(j, w, m);
  };
  let l, P;
  for (l = 0; l <= a; l++) {
    const H = l % a / a * 2 * o * Math.PI, T = u(H), q = u(H + 0.01), b = q.subtract(T);
    let j = q.add(T);
    const w = S.Cross(b, j);
    for (j = S.Cross(w, b), w.normalize(), j.normalize(), P = 0; P < f; P++) {
      const I = P % f / f * 2 * Math.PI, N = -s * Math.cos(I), k = s * Math.sin(I);
      t.push(T.x + N * j.x + k * w.x), t.push(T.y + N * j.y + k * w.y), t.push(T.z + N * j.z + k * w.z), n.push(l / a), n.push(us.UseOpenGLOrientationForUV ? 1 - P / f : P / f);
    }
  }
  for (l = 0; l < a; l++)
    for (P = 0; P < f; P++) {
      const c = (P + 1) % f, H = l * f + P, T = (l + 1) * f + P, q = (l + 1) * f + c, b = l * f + c;
      e.push(b), e.push(T), e.push(H), e.push(b), e.push(q), e.push(T);
    }
  Ut.ComputeNormals(t, e, r), Ut._ComputeSides(v, t, e, r, n, A.frontUVs, A.backUVs);
  const p = new Ut();
  return p.indices = e, p.positions = t, p.normals = r, p.uvs = n, p;
}
function GO(A, e = {}, t) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, WQ(e).applyToMesh(r, e.updatable), r;
}
const Ove = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateTorusKnot: GO
};
Ut.CreateTorusKnot = WQ;
Ee.CreateTorusKnot = (A, e, t, r, n, i, s, a, f, o) => GO(A, {
  radius: e,
  tube: t,
  radialSegments: r,
  tubularSegments: n,
  p: i,
  q: s,
  sideOrientation: o,
  updatable: f
}, a);
const qE = { effect: null, subMesh: null };
class Zo extends P1 {
  /**
   * Instantiate a new shader material.
   * The ShaderMaterial object has the necessary methods to pass data from your scene to the Vertex and Fragment Shaders and returns a material that can be applied to any mesh.
   * This returned material effects how the mesh will look based on the code in the shaders.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/shaders/shaderMaterial
   * @param name Define the name of the material in the scene
   * @param scene Define the scene the material belongs to
   * @param shaderPath Defines  the route to the shader code in one of three ways:
   *  * object: \{ vertex: "custom", fragment: "custom" \}, used with Effect.ShadersStore["customVertexShader"] and Effect.ShadersStore["customFragmentShader"]
   *  * object: \{ vertexElement: "vertexShaderCode", fragmentElement: "fragmentShaderCode" \}, used with shader code in script tags
   *  * object: \{ vertexSource: "vertex shader code string", fragmentSource: "fragment shader code string" \} using with strings containing the shaders code
   *  * string: "./COMMON_NAME", used with external files COMMON_NAME.vertex.fx and COMMON_NAME.fragment.fx in index.html folder.
   * @param options Define the options used to create the shader
   * @param storeEffectOnSubMeshes true to store effect on submeshes, false to store the effect directly in the material class.
   */
  constructor(e, t, r, n = {}, i = !0) {
    super(e, t, i), this._textures = {}, this._textureArrays = {}, this._externalTextures = {}, this._floats = {}, this._ints = {}, this._uints = {}, this._floatsArrays = {}, this._colors3 = {}, this._colors3Arrays = {}, this._colors4 = {}, this._colors4Arrays = {}, this._vectors2 = {}, this._vectors3 = {}, this._vectors4 = {}, this._quaternions = {}, this._quaternionsArrays = {}, this._matrices = {}, this._matrixArrays = {}, this._matrices3x3 = {}, this._matrices2x2 = {}, this._vectors2Arrays = {}, this._vectors3Arrays = {}, this._vectors4Arrays = {}, this._uniformBuffers = {}, this._textureSamplers = {}, this._storageBuffers = {}, this._cachedWorldViewMatrix = new he(), this._cachedWorldViewProjectionMatrix = new he(), this._multiview = !1, this._materialHelperNeedsPreviousMatrices = !1, this._shaderPath = r, this._options = Object.assign({ needAlphaBlending: !1, needAlphaTesting: !1, attributes: ["position", "normal", "uv"], uniforms: ["worldViewProjection"], uniformBuffers: [], samplers: [], externalTextures: [], samplerObjects: [], storageBuffers: [], defines: [], useClipPlane: !1 }, n);
  }
  /**
   * Gets the shader path used to define the shader code
   * It can be modified to trigger a new compilation
   */
  get shaderPath() {
    return this._shaderPath;
  }
  /**
   * Sets the shader path used to define the shader code
   * It can be modified to trigger a new compilation
   */
  set shaderPath(e) {
    this._shaderPath = e;
  }
  /**
   * Gets the options used to compile the shader.
   * They can be modified to trigger a new compilation
   */
  get options() {
    return this._options;
  }
  /**
   * is multiview set to true?
   */
  get isMultiview() {
    return this._multiview;
  }
  /**
   * Gets the current class name of the material e.g. "ShaderMaterial"
   * Mainly use in serialization.
   * @returns the class name
   */
  getClassName() {
    return "ShaderMaterial";
  }
  /**
   * Specifies if the material will require alpha blending
   * @returns a boolean specifying if alpha blending is needed
   */
  needAlphaBlending() {
    return this.alpha < 1 || this._options.needAlphaBlending;
  }
  /**
   * Specifies if this material should be rendered in alpha test mode
   * @returns a boolean specifying if an alpha test is needed.
   */
  needAlphaTesting() {
    return this._options.needAlphaTesting;
  }
  _checkUniform(e) {
    this._options.uniforms.indexOf(e) === -1 && this._options.uniforms.push(e);
  }
  /**
   * Set a texture in the shader.
   * @param name Define the name of the uniform samplers as defined in the shader
   * @param texture Define the texture to bind to this sampler
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setTexture(e, t) {
    return this._options.samplers.indexOf(e) === -1 && this._options.samplers.push(e), this._textures[e] = t, this;
  }
  /**
   * Set a texture array in the shader.
   * @param name Define the name of the uniform sampler array as defined in the shader
   * @param textures Define the list of textures to bind to this sampler
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setTextureArray(e, t) {
    return this._options.samplers.indexOf(e) === -1 && this._options.samplers.push(e), this._checkUniform(e), this._textureArrays[e] = t, this;
  }
  /**
   * Set an internal texture in the shader.
   * @param name Define the name of the uniform samplers as defined in the shader
   * @param texture Define the texture to bind to this sampler
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setExternalTexture(e, t) {
    return this._options.externalTextures.indexOf(e) === -1 && this._options.externalTextures.push(e), this._externalTextures[e] = t, this;
  }
  /**
   * Set a float in the shader.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setFloat(e, t) {
    return this._checkUniform(e), this._floats[e] = t, this;
  }
  /**
   * Set a int in the shader.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setInt(e, t) {
    return this._checkUniform(e), this._ints[e] = t, this;
  }
  /**
   * Set a unsigned int in the shader.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setUInt(e, t) {
    return this._checkUniform(e), this._uints[e] = t, this;
  }
  /**
   * Set an array of floats in the shader.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setFloats(e, t) {
    return this._checkUniform(e), this._floatsArrays[e] = t, this;
  }
  /**
   * Set a vec3 in the shader from a Color3.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setColor3(e, t) {
    return this._checkUniform(e), this._colors3[e] = t, this;
  }
  /**
   * Set a vec3 array in the shader from a Color3 array.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setColor3Array(e, t) {
    return this._checkUniform(e), this._colors3Arrays[e] = t.reduce((r, n) => (n.toArray(r, r.length), r), []), this;
  }
  /**
   * Set a vec4 in the shader from a Color4.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setColor4(e, t) {
    return this._checkUniform(e), this._colors4[e] = t, this;
  }
  /**
   * Set a vec4 array in the shader from a Color4 array.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setColor4Array(e, t) {
    return this._checkUniform(e), this._colors4Arrays[e] = t.reduce((r, n) => (n.toArray(r, r.length), r), []), this;
  }
  /**
   * Set a vec2 in the shader from a Vector2.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setVector2(e, t) {
    return this._checkUniform(e), this._vectors2[e] = t, this;
  }
  /**
   * Set a vec3 in the shader from a Vector3.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setVector3(e, t) {
    return this._checkUniform(e), this._vectors3[e] = t, this;
  }
  /**
   * Set a vec4 in the shader from a Vector4.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setVector4(e, t) {
    return this._checkUniform(e), this._vectors4[e] = t, this;
  }
  /**
   * Set a vec4 in the shader from a Quaternion.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setQuaternion(e, t) {
    return this._checkUniform(e), this._quaternions[e] = t, this;
  }
  /**
   * Set a vec4 array in the shader from a Quaternion array.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setQuaternionArray(e, t) {
    return this._checkUniform(e), this._quaternionsArrays[e] = t.reduce((r, n) => (n.toArray(r, r.length), r), []), this;
  }
  /**
   * Set a mat4 in the shader from a Matrix.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setMatrix(e, t) {
    return this._checkUniform(e), this._matrices[e] = t, this;
  }
  /**
   * Set a float32Array in the shader from a matrix array.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setMatrices(e, t) {
    this._checkUniform(e);
    const r = new Float32Array(t.length * 16);
    for (let n = 0; n < t.length; n++)
      t[n].copyToArray(r, n * 16);
    return this._matrixArrays[e] = r, this;
  }
  /**
   * Set a mat3 in the shader from a Float32Array.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setMatrix3x3(e, t) {
    return this._checkUniform(e), this._matrices3x3[e] = t, this;
  }
  /**
   * Set a mat2 in the shader from a Float32Array.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setMatrix2x2(e, t) {
    return this._checkUniform(e), this._matrices2x2[e] = t, this;
  }
  /**
   * Set a vec2 array in the shader from a number array.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setArray2(e, t) {
    return this._checkUniform(e), this._vectors2Arrays[e] = t, this;
  }
  /**
   * Set a vec3 array in the shader from a number array.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setArray3(e, t) {
    return this._checkUniform(e), this._vectors3Arrays[e] = t, this;
  }
  /**
   * Set a vec4 array in the shader from a number array.
   * @param name Define the name of the uniform as defined in the shader
   * @param value Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setArray4(e, t) {
    return this._checkUniform(e), this._vectors4Arrays[e] = t, this;
  }
  /**
   * Set a uniform buffer in the shader
   * @param name Define the name of the uniform as defined in the shader
   * @param buffer Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setUniformBuffer(e, t) {
    return this._options.uniformBuffers.indexOf(e) === -1 && this._options.uniformBuffers.push(e), this._uniformBuffers[e] = t, this;
  }
  /**
   * Set a texture sampler in the shader
   * @param name Define the name of the uniform as defined in the shader
   * @param sampler Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setTextureSampler(e, t) {
    return this._options.samplerObjects.indexOf(e) === -1 && this._options.samplerObjects.push(e), this._textureSamplers[e] = t, this;
  }
  /**
   * Set a storage buffer in the shader
   * @param name Define the name of the storage buffer as defined in the shader
   * @param buffer Define the value to give to the uniform
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setStorageBuffer(e, t) {
    return this._options.storageBuffers.indexOf(e) === -1 && this._options.storageBuffers.push(e), this._storageBuffers[e] = t, this;
  }
  /**
   * Adds, removes, or replaces the specified shader define and value.
   * * setDefine("MY_DEFINE", true); // enables a boolean define
   * * setDefine("MY_DEFINE", "0.5"); // adds "#define MY_DEFINE 0.5" to the shader (or sets and replaces the value of any existing define with that name)
   * * setDefine("MY_DEFINE", false); // disables and removes the define
   * Note if the active defines do change, the shader will be recompiled and this can be expensive.
   * @param define the define name e.g., "OUTPUT_TO_SRGB" or "#define OUTPUT_TO_SRGB". If the define was passed into the constructor already, the version used should match that, and in either case, it should not include any appended value.
   * @param value either the value of the define (e.g. a numerical value) or for booleans, true if the define should be enabled or false if it should be disabled
   * @returns the material itself allowing "fluent" like uniform updates
   */
  setDefine(e, t) {
    const r = e.trimEnd() + " ", n = this.options.defines.findIndex((i) => i === e || i.startsWith(r));
    return n >= 0 && this.options.defines.splice(n, 1), (typeof t != "boolean" || t) && this.options.defines.push(r + t), this;
  }
  /**
   * Specifies that the submesh is ready to be used
   * @param mesh defines the mesh to check
   * @param subMesh defines which submesh to check
   * @param useInstances specifies that instances should be used
   * @returns a boolean indicating that the submesh is ready or not
   */
  isReadyForSubMesh(e, t, r) {
    return this.isReady(e, r, t);
  }
  /**
   * Checks if the material is ready to render the requested mesh
   * @param mesh Define the mesh to render
   * @param useInstances Define whether or not the material is used with instances
   * @param subMesh defines which submesh to render
   * @returns true if ready, otherwise false
   */
  isReady(e, t, r) {
    var n, i, s, a;
    const f = r && this._storeEffectOnSubMeshes;
    if (this.isFrozen)
      if (f) {
        if (r.effect && r.effect._wasPreviouslyReady)
          return !0;
      } else {
        const N = this._drawWrapper.effect;
        if (N && N._wasPreviouslyReady && N._wasPreviouslyUsingInstances === t)
          return !0;
      }
    const o = this.getScene(), d = o.getEngine(), v = [], u = [], l = new c1();
    let P = this._shaderPath, p = this._options.uniforms, c = this._options.uniformBuffers, H = this._options.samplers;
    d.getCaps().multiview && o.activeCamera && o.activeCamera.outputRenderTarget && o.activeCamera.outputRenderTarget.getViewCount() > 1 && (this._multiview = !0, v.push("#define MULTIVIEW"), this._options.uniforms.indexOf("viewProjection") !== -1 && this._options.uniforms.indexOf("viewProjectionR") === -1 && this._options.uniforms.push("viewProjectionR"));
    for (let N = 0; N < this._options.defines.length; N++) {
      const k = this._options.defines[N].indexOf("#define") === 0 ? this._options.defines[N] : `#define ${this._options.defines[N]}`;
      v.push(k);
    }
    for (let N = 0; N < this._options.attributes.length; N++)
      u.push(this._options.attributes[N]);
    if (e && e.isVerticesDataPresent(J.ColorKind) && (u.indexOf(J.ColorKind) === -1 && u.push(J.ColorKind), v.push("#define VERTEXCOLOR")), t && (v.push("#define INSTANCES"), Ye.PushAttributesForInstances(u, this._materialHelperNeedsPreviousMatrices), e != null && e.hasThinInstances && (v.push("#define THIN_INSTANCES"), e && e.isVerticesDataPresent(J.ColorInstanceKind) && (u.push(J.ColorInstanceKind), v.push("#define INSTANCESCOLOR")))), e && e.useBones && e.computeBonesUsingShaders && e.skeleton) {
      u.push(J.MatricesIndicesKind), u.push(J.MatricesWeightsKind), e.numBoneInfluencers > 4 && (u.push(J.MatricesIndicesExtraKind), u.push(J.MatricesWeightsExtraKind));
      const N = e.skeleton;
      v.push("#define NUM_BONE_INFLUENCERS " + e.numBoneInfluencers), l.addCPUSkinningFallback(0, e), N.isUsingTextureForMatrices ? (v.push("#define BONETEXTURE"), this._options.uniforms.indexOf("boneTextureWidth") === -1 && this._options.uniforms.push("boneTextureWidth"), this._options.samplers.indexOf("boneSampler") === -1 && this._options.samplers.push("boneSampler")) : (v.push("#define BonesPerMesh " + (N.bones.length + 1)), this._options.uniforms.indexOf("mBones") === -1 && this._options.uniforms.push("mBones"));
    } else
      v.push("#define NUM_BONE_INFLUENCERS 0");
    let T = 0;
    const q = e ? e.morphTargetManager : null;
    if (q) {
      const N = q.supportsUVs && v.indexOf("#define UV1") !== -1, k = q.supportsTangents && v.indexOf("#define TANGENT") !== -1, R = q.supportsNormals && v.indexOf("#define NORMAL") !== -1;
      T = q.numInfluencers, N && v.push("#define MORPHTARGETS_UV"), k && v.push("#define MORPHTARGETS_TANGENT"), R && v.push("#define MORPHTARGETS_NORMAL"), T > 0 && v.push("#define MORPHTARGETS"), q.isUsingTextureForTargets && (v.push("#define MORPHTARGETS_TEXTURE"), this._options.uniforms.indexOf("morphTargetTextureIndices") === -1 && this._options.uniforms.push("morphTargetTextureIndices"), this._options.samplers.indexOf("morphTargets") === -1 && this._options.samplers.push("morphTargets")), v.push("#define NUM_MORPH_INFLUENCERS " + T);
      for (let y = 0; y < T; y++)
        u.push(J.PositionKind + y), R && u.push(J.NormalKind + y), k && u.push(J.TangentKind + y), N && u.push(J.UVKind + "_" + y);
      T > 0 && (p = p.slice(), p.push("morphTargetInfluences"), p.push("morphTargetTextureInfo"), p.push("morphTargetTextureIndices"));
    } else
      v.push("#define NUM_MORPH_INFLUENCERS 0");
    if (e) {
      const N = e.bakedVertexAnimationManager;
      N && N.isEnabled && (v.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"), this._options.uniforms.indexOf("bakedVertexAnimationSettings") === -1 && this._options.uniforms.push("bakedVertexAnimationSettings"), this._options.uniforms.indexOf("bakedVertexAnimationTextureSizeInverted") === -1 && this._options.uniforms.push("bakedVertexAnimationTextureSizeInverted"), this._options.uniforms.indexOf("bakedVertexAnimationTime") === -1 && this._options.uniforms.push("bakedVertexAnimationTime"), this._options.samplers.indexOf("bakedVertexAnimationTexture") === -1 && this._options.samplers.push("bakedVertexAnimationTexture")), Ye.PrepareAttributesForBakedVertexAnimation(u, e, v);
    }
    for (const N in this._textures)
      if (!this._textures[N].isReady())
        return !1;
    e && this._shouldTurnAlphaTestOn(e) && v.push("#define ALPHATEST"), this._options.useClipPlane !== !1 && (Mf(p), xq(this, o, v)), this._useLogarithmicDepth && (v.push("#define LOGARITHMICDEPTH"), this._options.uniforms.indexOf("logarithmicDepthConstant") === -1 && this._options.uniforms.push("logarithmicDepthConstant")), this.customShaderNameResolve && (p = p.slice(), c = c.slice(), H = H.slice(), P = this.customShaderNameResolve(P, p, c, H, v, u));
    const b = f ? r._getDrawWrapper() : this._drawWrapper, j = (n = b == null ? void 0 : b.effect) !== null && n !== void 0 ? n : null, w = (i = b == null ? void 0 : b.defines) !== null && i !== void 0 ? i : null, m = v.join(`
`);
    let I = j;
    return w !== m && (I = d.createEffect(P, {
      attributes: u,
      uniformsNames: p,
      uniformBuffersNames: c,
      samplers: H,
      defines: m,
      fallbacks: l,
      onCompiled: this.onCompiled,
      onError: this.onError,
      indexParameters: { maxSimultaneousMorphTargets: T },
      shaderLanguage: this._options.shaderLanguage
    }, d), f ? r.setEffect(I, m, this._materialContext) : b && b.setEffect(I, m), this._onEffectCreatedObservable && (qE.effect = I, qE.subMesh = (s = r ?? (e == null ? void 0 : e.subMeshes[0])) !== null && s !== void 0 ? s : null, this._onEffectCreatedObservable.notifyObservers(qE))), I._wasPreviouslyUsingInstances = !!t, !((a = !(I != null && I.isReady())) !== null && a !== void 0) || a ? !1 : (j !== I && o.resetCachedMaterial(), I._wasPreviouslyReady = !0, !0);
  }
  /**
   * Binds the world matrix to the material
   * @param world defines the world transformation matrix
   * @param effectOverride - If provided, use this effect instead of internal effect
   */
  bindOnlyWorldMatrix(e, t) {
    const r = this.getScene(), n = t ?? this.getEffect();
    n && (this._options.uniforms.indexOf("world") !== -1 && n.setMatrix("world", e), this._options.uniforms.indexOf("worldView") !== -1 && (e.multiplyToRef(r.getViewMatrix(), this._cachedWorldViewMatrix), n.setMatrix("worldView", this._cachedWorldViewMatrix)), this._options.uniforms.indexOf("worldViewProjection") !== -1 && (e.multiplyToRef(r.getTransformMatrix(), this._cachedWorldViewProjectionMatrix), n.setMatrix("worldViewProjection", this._cachedWorldViewProjectionMatrix)));
  }
  /**
   * Binds the submesh to this material by preparing the effect and shader to draw
   * @param world defines the world transformation matrix
   * @param mesh defines the mesh containing the submesh
   * @param subMesh defines the submesh to bind the material to
   */
  bindForSubMesh(e, t, r) {
    var n;
    this.bind(e, t, (n = r._drawWrapperOverride) === null || n === void 0 ? void 0 : n.effect, r);
  }
  /**
   * Binds the material to the mesh
   * @param world defines the world transformation matrix
   * @param mesh defines the mesh to bind the material to
   * @param effectOverride - If provided, use this effect instead of internal effect
   * @param subMesh defines the submesh to bind the material to
   */
  bind(e, t, r, n) {
    var i;
    const s = n && this._storeEffectOnSubMeshes, a = r ?? (s ? n.effect : this.getEffect());
    if (!a)
      return;
    const f = this.getScene();
    this._activeEffect = a, this.bindOnlyWorldMatrix(e, r);
    const o = this._options.uniformBuffers;
    let d = !1;
    if (a && o && o.length > 0 && f.getEngine().supportsUniformBuffers)
      for (let u = 0; u < o.length; ++u)
        switch (o[u]) {
          case "Mesh":
            t && (t.getMeshUniformBuffer().bindToEffect(a, "Mesh"), t.transferToEffect(e));
            break;
          case "Scene":
            Ye.BindSceneUniformBuffer(a, f.getSceneUniformBuffer()), f.finalizeSceneUbo(), d = !0;
            break;
        }
    const v = t && s ? this._mustRebind(f, a, t.visibility) : f.getCachedMaterial() !== this;
    if (a && v) {
      !d && this._options.uniforms.indexOf("view") !== -1 && a.setMatrix("view", f.getViewMatrix()), !d && this._options.uniforms.indexOf("projection") !== -1 && a.setMatrix("projection", f.getProjectionMatrix()), !d && this._options.uniforms.indexOf("viewProjection") !== -1 && (a.setMatrix("viewProjection", f.getTransformMatrix()), this._multiview && a.setMatrix("viewProjectionR", f._transformMatrixR)), f.activeCamera && this._options.uniforms.indexOf("cameraPosition") !== -1 && a.setVector3("cameraPosition", f.activeCamera.globalPosition), Ye.BindBonesParameters(t, a), Df(a, this, f), this._useLogarithmicDepth && Ye.BindLogDepth(s ? n.materialDefines : a.defines, a, f);
      let u;
      for (u in this._textures)
        a.setTexture(u, this._textures[u]);
      for (u in this._textureArrays)
        a.setTextureArray(u, this._textureArrays[u]);
      for (u in this._externalTextures)
        a.setExternalTexture(u, this._externalTextures[u]);
      for (u in this._ints)
        a.setInt(u, this._ints[u]);
      for (u in this._uints)
        a.setUInt(u, this._uints[u]);
      for (u in this._floats)
        a.setFloat(u, this._floats[u]);
      for (u in this._floatsArrays)
        a.setArray(u, this._floatsArrays[u]);
      for (u in this._colors3)
        a.setColor3(u, this._colors3[u]);
      for (u in this._colors3Arrays)
        a.setArray3(u, this._colors3Arrays[u]);
      for (u in this._colors4) {
        const l = this._colors4[u];
        a.setFloat4(u, l.r, l.g, l.b, l.a);
      }
      for (u in this._colors4Arrays)
        a.setArray4(u, this._colors4Arrays[u]);
      for (u in this._vectors2)
        a.setVector2(u, this._vectors2[u]);
      for (u in this._vectors3)
        a.setVector3(u, this._vectors3[u]);
      for (u in this._vectors4)
        a.setVector4(u, this._vectors4[u]);
      for (u in this._quaternions)
        a.setQuaternion(u, this._quaternions[u]);
      for (u in this._matrices)
        a.setMatrix(u, this._matrices[u]);
      for (u in this._matrixArrays)
        a.setMatrices(u, this._matrixArrays[u]);
      for (u in this._matrices3x3)
        a.setMatrix3x3(u, this._matrices3x3[u]);
      for (u in this._matrices2x2)
        a.setMatrix2x2(u, this._matrices2x2[u]);
      for (u in this._vectors2Arrays)
        a.setArray2(u, this._vectors2Arrays[u]);
      for (u in this._vectors3Arrays)
        a.setArray3(u, this._vectors3Arrays[u]);
      for (u in this._vectors4Arrays)
        a.setArray4(u, this._vectors4Arrays[u]);
      for (u in this._quaternionsArrays)
        a.setArray4(u, this._quaternionsArrays[u]);
      for (u in this._uniformBuffers) {
        const l = this._uniformBuffers[u].getBuffer();
        l && a.bindUniformBuffer(l, u);
      }
      for (u in this._textureSamplers)
        a.setTextureSampler(u, this._textureSamplers[u]);
      for (u in this._storageBuffers)
        a.setStorageBuffer(u, this._storageBuffers[u]);
    }
    if (a && t && (v || !this.isFrozen)) {
      const u = t.morphTargetManager;
      u && u.numInfluencers > 0 && Ye.BindMorphTargetParameters(t, a);
      const l = t.bakedVertexAnimationManager;
      l && l.isEnabled && ((i = t.bakedVertexAnimationManager) === null || i === void 0 || i.bind(a, !!a._wasPreviouslyUsingInstances));
    }
    this._afterBind(t, a);
  }
  /**
   * Gets the active textures from the material
   * @returns an array of textures
   */
  getActiveTextures() {
    const e = super.getActiveTextures();
    for (const t in this._textures)
      e.push(this._textures[t]);
    for (const t in this._textureArrays) {
      const r = this._textureArrays[t];
      for (let n = 0; n < r.length; n++)
        e.push(r[n]);
    }
    return e;
  }
  /**
   * Specifies if the material uses a texture
   * @param texture defines the texture to check against the material
   * @returns a boolean specifying if the material uses the texture
   */
  hasTexture(e) {
    if (super.hasTexture(e))
      return !0;
    for (const t in this._textures)
      if (this._textures[t] === e)
        return !0;
    for (const t in this._textureArrays) {
      const r = this._textureArrays[t];
      for (let n = 0; n < r.length; n++)
        if (r[n] === e)
          return !0;
    }
    return !1;
  }
  /**
   * Makes a duplicate of the material, and gives it a new name
   * @param name defines the new name for the duplicated material
   * @returns the cloned material
   */
  clone(e) {
    const t = jt.Clone(() => new Zo(e, this.getScene(), this._shaderPath, this._options, this._storeEffectOnSubMeshes), this);
    t.name = e, t.id = e, typeof t._shaderPath == "object" && (t._shaderPath = Object.assign({}, t._shaderPath)), this._options = Object.assign({}, this._options), Object.keys(this._options).forEach((r) => {
      const n = this._options[r];
      Array.isArray(n) && (this._options[r] = n.slice(0));
    }), this.stencil.copyTo(t.stencil);
    for (const r in this._textures)
      t.setTexture(r, this._textures[r]);
    for (const r in this._textureArrays)
      t.setTextureArray(r, this._textureArrays[r]);
    for (const r in this._externalTextures)
      t.setExternalTexture(r, this._externalTextures[r]);
    for (const r in this._ints)
      t.setInt(r, this._ints[r]);
    for (const r in this._uints)
      t.setUInt(r, this._uints[r]);
    for (const r in this._floats)
      t.setFloat(r, this._floats[r]);
    for (const r in this._floatsArrays)
      t.setFloats(r, this._floatsArrays[r]);
    for (const r in this._colors3)
      t.setColor3(r, this._colors3[r]);
    for (const r in this._colors3Arrays)
      t._colors3Arrays[r] = this._colors3Arrays[r];
    for (const r in this._colors4)
      t.setColor4(r, this._colors4[r]);
    for (const r in this._colors4Arrays)
      t._colors4Arrays[r] = this._colors4Arrays[r];
    for (const r in this._vectors2)
      t.setVector2(r, this._vectors2[r]);
    for (const r in this._vectors3)
      t.setVector3(r, this._vectors3[r]);
    for (const r in this._vectors4)
      t.setVector4(r, this._vectors4[r]);
    for (const r in this._quaternions)
      t.setQuaternion(r, this._quaternions[r]);
    for (const r in this._quaternionsArrays)
      t._quaternionsArrays[r] = this._quaternionsArrays[r];
    for (const r in this._matrices)
      t.setMatrix(r, this._matrices[r]);
    for (const r in this._matrixArrays)
      t._matrixArrays[r] = this._matrixArrays[r].slice();
    for (const r in this._matrices3x3)
      t.setMatrix3x3(r, this._matrices3x3[r]);
    for (const r in this._matrices2x2)
      t.setMatrix2x2(r, this._matrices2x2[r]);
    for (const r in this._vectors2Arrays)
      t.setArray2(r, this._vectors2Arrays[r]);
    for (const r in this._vectors3Arrays)
      t.setArray3(r, this._vectors3Arrays[r]);
    for (const r in this._vectors4Arrays)
      t.setArray4(r, this._vectors4Arrays[r]);
    for (const r in this._uniformBuffers)
      t.setUniformBuffer(r, this._uniformBuffers[r]);
    for (const r in this._textureSamplers)
      t.setTextureSampler(r, this._textureSamplers[r]);
    for (const r in this._storageBuffers)
      t.setStorageBuffer(r, this._storageBuffers[r]);
    return t;
  }
  /**
   * Disposes the material
   * @param forceDisposeEffect specifies if effects should be forcefully disposed
   * @param forceDisposeTextures specifies if textures should be forcefully disposed
   * @param notBoundToMesh specifies if the material that is being disposed is known to be not bound to any mesh
   */
  dispose(e, t, r) {
    if (t) {
      let n;
      for (n in this._textures)
        this._textures[n].dispose();
      for (n in this._textureArrays) {
        const i = this._textureArrays[n];
        for (let s = 0; s < i.length; s++)
          i[s].dispose();
      }
    }
    this._textures = {}, super.dispose(e, t, r);
  }
  /**
   * Serializes this material in a JSON representation
   * @returns the serialized material object
   */
  serialize() {
    const e = jt.Serialize(this);
    e.customType = "BABYLON.ShaderMaterial", e.uniqueId = this.uniqueId, e.options = this._options, e.shaderPath = this._shaderPath, e.storeEffectOnSubMeshes = this._storeEffectOnSubMeshes;
    let t;
    e.stencil = this.stencil.serialize(), e.textures = {};
    for (t in this._textures)
      e.textures[t] = this._textures[t].serialize();
    e.textureArrays = {};
    for (t in this._textureArrays) {
      e.textureArrays[t] = [];
      const r = this._textureArrays[t];
      for (let n = 0; n < r.length; n++)
        e.textureArrays[t].push(r[n].serialize());
    }
    e.ints = {};
    for (t in this._ints)
      e.ints[t] = this._ints[t];
    e.uints = {};
    for (t in this._uints)
      e.uints[t] = this._uints[t];
    e.floats = {};
    for (t in this._floats)
      e.floats[t] = this._floats[t];
    e.FloatArrays = {};
    for (t in this._floatsArrays)
      e.FloatArrays[t] = this._floatsArrays[t];
    e.colors3 = {};
    for (t in this._colors3)
      e.colors3[t] = this._colors3[t].asArray();
    e.colors3Arrays = {};
    for (t in this._colors3Arrays)
      e.colors3Arrays[t] = this._colors3Arrays[t];
    e.colors4 = {};
    for (t in this._colors4)
      e.colors4[t] = this._colors4[t].asArray();
    e.colors4Arrays = {};
    for (t in this._colors4Arrays)
      e.colors4Arrays[t] = this._colors4Arrays[t];
    e.vectors2 = {};
    for (t in this._vectors2)
      e.vectors2[t] = this._vectors2[t].asArray();
    e.vectors3 = {};
    for (t in this._vectors3)
      e.vectors3[t] = this._vectors3[t].asArray();
    e.vectors4 = {};
    for (t in this._vectors4)
      e.vectors4[t] = this._vectors4[t].asArray();
    e.quaternions = {};
    for (t in this._quaternions)
      e.quaternions[t] = this._quaternions[t].asArray();
    e.matrices = {};
    for (t in this._matrices)
      e.matrices[t] = this._matrices[t].asArray();
    e.matrixArray = {};
    for (t in this._matrixArrays)
      e.matrixArray[t] = this._matrixArrays[t];
    e.matrices3x3 = {};
    for (t in this._matrices3x3)
      e.matrices3x3[t] = this._matrices3x3[t];
    e.matrices2x2 = {};
    for (t in this._matrices2x2)
      e.matrices2x2[t] = this._matrices2x2[t];
    e.vectors2Arrays = {};
    for (t in this._vectors2Arrays)
      e.vectors2Arrays[t] = this._vectors2Arrays[t];
    e.vectors3Arrays = {};
    for (t in this._vectors3Arrays)
      e.vectors3Arrays[t] = this._vectors3Arrays[t];
    e.vectors4Arrays = {};
    for (t in this._vectors4Arrays)
      e.vectors4Arrays[t] = this._vectors4Arrays[t];
    e.quaternionsArrays = {};
    for (t in this._quaternionsArrays)
      e.quaternionsArrays[t] = this._quaternionsArrays[t];
    return e;
  }
  /**
   * Creates a shader material from parsed shader material data
   * @param source defines the JSON representation of the material
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a new material
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => new Zo(e.name, t, e.shaderPath, e.options, e.storeEffectOnSubMeshes), e, t, r);
    let i;
    e.stencil && n.stencil.parse(e.stencil, t, r);
    for (i in e.textures)
      n.setTexture(i, We.Parse(e.textures[i], t, r));
    for (i in e.textureArrays) {
      const s = e.textureArrays[i], a = [];
      for (let f = 0; f < s.length; f++)
        a.push(We.Parse(s[f], t, r));
      n.setTextureArray(i, a);
    }
    for (i in e.ints)
      n.setInt(i, e.ints[i]);
    for (i in e.uints)
      n.setUInt(i, e.uints[i]);
    for (i in e.floats)
      n.setFloat(i, e.floats[i]);
    for (i in e.floatsArrays)
      n.setFloats(i, e.floatsArrays[i]);
    for (i in e.colors3)
      n.setColor3(i, Ne.FromArray(e.colors3[i]));
    for (i in e.colors3Arrays) {
      const s = e.colors3Arrays[i].reduce((a, f, o) => (o % 3 === 0 ? a.push([f]) : a[a.length - 1].push(f), a), []).map((a) => Ne.FromArray(a));
      n.setColor3Array(i, s);
    }
    for (i in e.colors4)
      n.setColor4(i, xt.FromArray(e.colors4[i]));
    for (i in e.colors4Arrays) {
      const s = e.colors4Arrays[i].reduce((a, f, o) => (o % 4 === 0 ? a.push([f]) : a[a.length - 1].push(f), a), []).map((a) => xt.FromArray(a));
      n.setColor4Array(i, s);
    }
    for (i in e.vectors2)
      n.setVector2(i, at.FromArray(e.vectors2[i]));
    for (i in e.vectors3)
      n.setVector3(i, S.FromArray(e.vectors3[i]));
    for (i in e.vectors4)
      n.setVector4(i, Ir.FromArray(e.vectors4[i]));
    for (i in e.quaternions)
      n.setQuaternion(i, Ze.FromArray(e.quaternions[i]));
    for (i in e.matrices)
      n.setMatrix(i, he.FromArray(e.matrices[i]));
    for (i in e.matrixArray)
      n._matrixArrays[i] = new Float32Array(e.matrixArray[i]);
    for (i in e.matrices3x3)
      n.setMatrix3x3(i, e.matrices3x3[i]);
    for (i in e.matrices2x2)
      n.setMatrix2x2(i, e.matrices2x2[i]);
    for (i in e.vectors2Arrays)
      n.setArray2(i, e.vectors2Arrays[i]);
    for (i in e.vectors3Arrays)
      n.setArray3(i, e.vectors3Arrays[i]);
    for (i in e.vectors4Arrays)
      n.setArray4(i, e.vectors4Arrays[i]);
    for (i in e.quaternionsArrays)
      n.setArray4(i, e.quaternionsArrays[i]);
    return n;
  }
  /**
   * Creates a new ShaderMaterial from a snippet saved in a remote file
   * @param name defines the name of the ShaderMaterial to create (can be null or empty to use the one from the json data)
   * @param url defines the url to load from
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a promise that will resolve to the new ShaderMaterial
   */
  static ParseFromFileAsync(e, t, r, n = "") {
    return new Promise((i, s) => {
      const a = new ho();
      a.addEventListener("readystatechange", () => {
        if (a.readyState == 4)
          if (a.status == 200) {
            const f = JSON.parse(a.responseText), o = this.Parse(f, r || gr.LastCreatedScene, n);
            e && (o.name = e), i(o);
          } else
            s("Unable to load the ShaderMaterial");
      }), a.open("GET", t), a.send();
    });
  }
  /**
   * Creates a ShaderMaterial from a snippet saved by the Inspector
   * @param snippetId defines the snippet to load
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a promise that will resolve to the new ShaderMaterial
   */
  static ParseFromSnippetAsync(e, t, r = "") {
    return new Promise((n, i) => {
      const s = new ho();
      s.addEventListener("readystatechange", () => {
        if (s.readyState == 4)
          if (s.status == 200) {
            const a = JSON.parse(JSON.parse(s.responseText).jsonPayload), f = JSON.parse(a.shaderMaterial), o = this.Parse(f, t || gr.LastCreatedScene, r);
            o.snippetId = e, n(o);
          } else
            i("Unable to load the snippet " + e);
      }), s.open("GET", this.SnippetUrl + "/" + e.replace(/#/g, "/")), s.send();
    });
  }
}
Zo.SnippetUrl = "https://snippet.babylonjs.com";
Zo.CreateFromSnippetAsync = Zo.ParseFromSnippetAsync;
Ue("BABYLON.ShaderMaterial", Zo);
const yve = "colorPixelShader", kve = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
#define VERTEXCOLOR
varying vec4 vColor;
#else
uniform vec4 color;
#endif
#include<clipPlaneFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
gl_FragColor=vColor;
#else
gl_FragColor=color;
#endif
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[yve] = kve;
const Eve = "colorVertexShader", Fve = `attribute vec3 position;
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<clipPlaneVertexDeclaration>
#include<instancesDeclaration>
uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}
#else
gl_Position=viewProjection*worldPos;
#endif
#include<clipPlaneVertex>
#include<vertexColorMixing>
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[Eve] = Fve;
Ee._LinesMeshParser = (A, e) => Tp.Parse(A, e);
class Tp extends Ee {
  _isShaderMaterial(e) {
    return e.getClassName() === "ShaderMaterial";
  }
  /**
   * Creates a new LinesMesh
   * @param name defines the name
   * @param scene defines the hosting scene
   * @param parent defines the parent mesh if any
   * @param source defines the optional source LinesMesh used to clone data from
   * @param doNotCloneChildren When cloning, skip cloning child meshes of source, default False.
   * When false, achieved by calling a clone(), also passing False.
   * This will make creation of children, recursive.
   * @param useVertexColor defines if this LinesMesh supports vertex color
   * @param useVertexAlpha defines if this LinesMesh supports vertex alpha
   * @param material material to use to draw the line. If not provided, will create a new one
   */
  constructor(e, t = null, r = null, n = null, i, s, a, f) {
    super(e, t, r, n, i), this.useVertexColor = s, this.useVertexAlpha = a, this.color = new Ne(1, 1, 1), this.alpha = 1, n && (this.color = n.color.clone(), this.alpha = n.alpha, this.useVertexColor = n.useVertexColor, this.useVertexAlpha = n.useVertexAlpha), this.intersectionThreshold = 0.1;
    const o = [], d = {
      attributes: [J.PositionKind],
      uniforms: ["world", "viewProjection"],
      needAlphaBlending: !0,
      defines: o,
      useClipPlane: null
    };
    a === !1 ? d.needAlphaBlending = !1 : d.defines.push("#define VERTEXALPHA"), s ? (d.defines.push("#define VERTEXCOLOR"), d.attributes.push(J.ColorKind)) : (d.uniforms.push("color"), this._color4 = new xt()), f ? this.material = f : (this.material = new Zo("colorShader", this.getScene(), "color", d, !1), this.material.doNotSerialize = !0);
  }
  isReady() {
    return this._lineMaterial.isReady(this, !!this._userInstancedBuffersStorage || this.hasThinInstances) ? super.isReady() : !1;
  }
  /**
   * Returns the string "LineMesh"
   */
  getClassName() {
    return "LinesMesh";
  }
  /**
   * @internal
   */
  get material() {
    return this._lineMaterial;
  }
  /**
   * @internal
   */
  set material(e) {
    this._lineMaterial = e, this._lineMaterial.fillMode = gt.LineListDrawMode;
  }
  /**
   * @internal
   */
  get checkCollisions() {
    return !1;
  }
  set checkCollisions(e) {
  }
  /**
   * @internal
   */
  _bind(e, t) {
    if (!this._geometry)
      return this;
    const r = this.isUnIndexed ? null : this._geometry.getIndexBuffer();
    if (!this._userInstancedBuffersStorage || this.hasThinInstances ? this._geometry._bind(t, r) : this._geometry._bind(t, r, this._userInstancedBuffersStorage.vertexBuffers, this._userInstancedBuffersStorage.vertexArrayObjects), !this.useVertexColor && this._isShaderMaterial(this._lineMaterial)) {
      const { r: n, g: i, b: s } = this.color;
      this._color4.set(n, i, s, this.alpha), this._lineMaterial.setColor4("color", this._color4);
    }
    return this;
  }
  /**
   * @internal
   */
  _draw(e, t, r) {
    if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())
      return this;
    const n = this.getScene().getEngine();
    return this._unIndexed ? n.drawArraysType(gt.LineListDrawMode, e.verticesStart, e.verticesCount, r) : n.drawElementsType(gt.LineListDrawMode, e.indexStart, e.indexCount, r), this;
  }
  /**
   * Disposes of the line mesh
   * @param doNotRecurse If children should be disposed
   * @param disposeMaterialAndTextures This parameter is not used by the LineMesh class
   * @param doNotDisposeMaterial If the material should not be disposed (default: false, meaning the material is disposed)
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  dispose(e, t = !1, r) {
    r || this._lineMaterial.dispose(!1, !1, !0), super.dispose(e);
  }
  /**
   * Returns a new LineMesh object cloned from the current one.
   * @param name
   * @param newParent
   * @param doNotCloneChildren
   */
  clone(e, t = null, r) {
    return new Tp(e, this.getScene(), t, this, r);
  }
  /**
   * Creates a new InstancedLinesMesh object from the mesh model.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
   * @param name defines the name of the new instance
   * @returns a new InstancedLinesMesh
   */
  createInstance(e) {
    const t = new SQ(e, this);
    if (this.instancedBuffers) {
      t.instancedBuffers = {};
      for (const r in this.instancedBuffers)
        t.instancedBuffers[r] = this.instancedBuffers[r];
    }
    return t;
  }
  /**
   * Serializes this ground mesh
   * @param serializationObject object to write serialization to
   */
  serialize(e) {
    super.serialize(e), e.color = this.color.asArray(), e.alpha = this.alpha;
  }
  /**
   * Parses a serialized ground mesh
   * @param parsedMesh the serialized mesh
   * @param scene the scene to create the ground mesh in
   * @returns the created ground mesh
   */
  static Parse(e, t) {
    const r = new Tp(e.name, t);
    return r.color = Ne.FromArray(e.color), r.alpha = e.alpha, r;
  }
}
class SQ extends bp {
  constructor(e, t) {
    super(e, t), this.intersectionThreshold = t.intersectionThreshold;
  }
  /**
   * Returns the string "InstancedLinesMesh".
   */
  getClassName() {
    return "InstancedLinesMesh";
  }
}
function UQ(A) {
  const e = [], t = [], r = A.lines, n = A.colors, i = [];
  let s = 0;
  for (let f = 0; f < r.length; f++) {
    const o = r[f];
    for (let d = 0; d < o.length; d++) {
      const { x: v, y: u, z: l } = o[d];
      if (t.push(v, u, l), n) {
        const P = n[f], { r: p, g: c, b: H, a: T } = P[d];
        i.push(p, c, H, T);
      }
      d > 0 && (e.push(s - 1), e.push(s)), s++;
    }
  }
  const a = new Ut();
  return a.indices = e, a.positions = t, n && (a.colors = i), a;
}
function IQ(A) {
  const e = A.dashSize || 3, t = A.gapSize || 1, r = A.dashNb || 200, n = A.points, i = [], s = [], a = S.Zero();
  let f = 0, o = 0, d = 0, v = 0, u = 0, l = 0, P = 0;
  for (P = 0; P < n.length - 1; P++)
    n[P + 1].subtractToRef(n[P], a), f += a.length();
  for (d = f / r, v = e * d / (e + t), P = 0; P < n.length - 1; P++) {
    n[P + 1].subtractToRef(n[P], a), o = Math.floor(a.length() / d), a.normalize();
    for (let c = 0; c < o; c++)
      u = d * c, i.push(n[P].x + u * a.x, n[P].y + u * a.y, n[P].z + u * a.z), i.push(n[P].x + (u + v) * a.x, n[P].y + (u + v) * a.y, n[P].z + (u + v) * a.z), s.push(l, l + 1), l += 2;
  }
  const p = new Ut();
  return p.positions = i, p.indices = s, p;
}
function rm(A, e, t = null) {
  const r = e.instance, n = e.lines, i = e.colors;
  if (r) {
    const o = r.getVerticesData(J.PositionKind);
    let d, v;
    i && (d = r.getVerticesData(J.ColorKind));
    let u = 0, l = 0;
    for (let P = 0; P < n.length; P++) {
      const p = n[P];
      for (let c = 0; c < p.length; c++)
        o[u] = p[c].x, o[u + 1] = p[c].y, o[u + 2] = p[c].z, i && d && (v = i[P], d[l] = v[c].r, d[l + 1] = v[c].g, d[l + 2] = v[c].b, d[l + 3] = v[c].a, l += 4), u += 3;
    }
    return r.updateVerticesData(J.PositionKind, o, !1, !1), i && d && r.updateVerticesData(J.ColorKind, d, !1, !1), r;
  }
  const s = !!i, a = new Tp(A, t, null, void 0, void 0, s, e.useVertexAlpha, e.material);
  return UQ(e).applyToMesh(a, e.updatable), a;
}
function ka(A, e, t = null) {
  const r = e.colors ? [e.colors] : null;
  return rm(A, { lines: [e.points], updatable: e.updatable, instance: e.instance, colors: r, useVertexAlpha: e.useVertexAlpha, material: e.material }, t);
}
function ZO(A, e, t = null) {
  const r = e.points, n = e.instance, i = e.gapSize || 1, s = e.dashSize || 3;
  if (n) {
    const o = (d) => {
      const v = S.Zero(), u = d.length / 6;
      let l = 0, P = 0, p = 0, c = 0, H = 0, T = 0, q = 0, b = 0;
      for (q = 0; q < r.length - 1; q++)
        r[q + 1].subtractToRef(r[q], v), l += v.length();
      p = l / u;
      const j = n._creationDataStorage.dashSize, w = n._creationDataStorage.gapSize;
      for (c = j * p / (j + w), q = 0; q < r.length - 1; q++)
        for (r[q + 1].subtractToRef(r[q], v), P = Math.floor(v.length() / p), v.normalize(), b = 0; b < P && T < d.length; )
          H = p * b, d[T] = r[q].x + H * v.x, d[T + 1] = r[q].y + H * v.y, d[T + 2] = r[q].z + H * v.z, d[T + 3] = r[q].x + (H + c) * v.x, d[T + 4] = r[q].y + (H + c) * v.y, d[T + 5] = r[q].z + (H + c) * v.z, T += 6, b++;
      for (; T < d.length; )
        d[T] = r[q].x, d[T + 1] = r[q].y, d[T + 2] = r[q].z, T += 3;
    };
    return (e.dashNb || e.dashSize || e.gapSize || e.useVertexAlpha || e.material) && Se.Warn("You have used an option other than points with the instance option. Please be aware that these other options will be ignored."), n.updateMeshPositions(o, !1), n;
  }
  const a = new Tp(A, t, null, void 0, void 0, void 0, e.useVertexAlpha, e.material);
  return IQ(e).applyToMesh(a, e.updatable), a._creationDataStorage = new tQ(), a._creationDataStorage.dashSize = s, a._creationDataStorage.gapSize = i, a;
}
const Nve = {
  CreateDashedLines: ZO,
  CreateLineSystem: rm,
  CreateLines: ka
};
Ut.CreateLineSystem = UQ;
Ut.CreateDashedLines = IQ;
Ee.CreateLines = (A, e, t = null, r = !1, n = null) => ka(A, {
  points: e,
  updatable: r,
  instance: n
}, t);
Ee.CreateDashedLines = (A, e, t, r, n, i = null, s, a) => ZO(A, {
  points: e,
  dashSize: t,
  gapSize: r,
  dashNb: n,
  updatable: s,
  instance: a
}, i);
class Qve extends at {
  constructor(e, t) {
    super(e.x, e.y), this.index = t;
  }
}
class bE {
  constructor() {
    this.elements = [];
  }
  add(e) {
    const t = [];
    return e.forEach((r) => {
      const n = new Qve(r, this.elements.length);
      t.push(n), this.elements.push(n);
    }), t;
  }
  computeBounds() {
    const e = new at(this.elements[0].x, this.elements[0].y), t = new at(this.elements[0].x, this.elements[0].y);
    return this.elements.forEach((r) => {
      r.x < e.x ? e.x = r.x : r.x > t.x && (t.x = r.x), r.y < e.y ? e.y = r.y : r.y > t.y && (t.y = r.y);
    }), {
      min: e,
      max: t,
      width: t.x - e.x,
      height: t.y - e.y
    };
  }
}
class Yve {
  /**
   * Creates a rectangle
   * @param xmin bottom X coord
   * @param ymin bottom Y coord
   * @param xmax top X coord
   * @param ymax top Y coord
   * @returns points that make the resulting rectangle
   */
  static Rectangle(e, t, r, n) {
    return [new at(e, t), new at(r, t), new at(r, n), new at(e, n)];
  }
  /**
   * Creates a circle
   * @param radius radius of circle
   * @param cx scale in x
   * @param cy scale in y
   * @param numberOfSides number of sides that make up the circle
   * @returns points that make the resulting circle
   */
  static Circle(e, t = 0, r = 0, n = 32) {
    const i = [];
    let s = 0;
    const a = Math.PI * 2 / n;
    for (let f = 0; f < n; f++)
      i.push(new at(t + Math.cos(s) * e, r + Math.sin(s) * e)), s -= a;
    return i;
  }
  /**
   * Creates a polygon from input string
   * @param input Input polygon data
   * @returns the parsed points
   */
  static Parse(e) {
    const t = e.split(/[^-+eE.\d]+/).map(parseFloat).filter((i) => !isNaN(i));
    let r;
    const n = [];
    for (r = 0; r < (t.length & 2147483646); r += 2)
      n.push(new at(t[r], t[r + 1]));
    return n;
  }
  /**
   * Starts building a polygon from x and y coordinates
   * @param x x coordinate
   * @param y y coordinate
   * @returns the started path2
   */
  static StartingAt(e, t) {
    return sU.StartingAt(e, t);
  }
}
class ete {
  _addToepoint(e) {
    for (const t of e)
      this._epoints.push(t.x, t.y);
  }
  /**
   * Creates a PolygonMeshBuilder
   * @param name name of the builder
   * @param contours Path of the polygon
   * @param scene scene to add to when creating the mesh
   * @param earcutInjection can be used to inject your own earcut reference
   */
  constructor(e, t, r, n = earcut) {
    this._points = new bE(), this._outlinepoints = new bE(), this._holes = new Array(), this._epoints = new Array(), this._eholes = new Array(), this.bjsEarcut = n, this._name = e, this._scene = r || gr.LastCreatedScene;
    let i;
    t instanceof sU ? i = t.getPoints() : i = t, this._addToepoint(i), this._points.add(i), this._outlinepoints.add(i), typeof this.bjsEarcut > "u" && Se.Warn("Earcut was not found, the polygon will not be built.");
  }
  /**
   * Adds a hole within the polygon
   * @param hole Array of points defining the hole
   * @returns this
   */
  addHole(e) {
    this._points.add(e);
    const t = new bE();
    return t.add(e), this._holes.push(t), this._eholes.push(this._epoints.length / 2), this._addToepoint(e), this;
  }
  /**
   * Creates the polygon
   * @param updatable If the mesh should be updatable
   * @param depth The depth of the mesh created
   * @param smoothingThreshold Dot product threshold for smoothed normals
   * @returns the created mesh
   */
  build(e = !1, t = 0, r = 2) {
    const n = new Ee(this._name, this._scene), i = this.buildVertexData(t, r);
    return n.setVerticesData(J.PositionKind, i.positions, e), n.setVerticesData(J.NormalKind, i.normals, e), n.setVerticesData(J.UVKind, i.uvs, e), n.setIndices(i.indices), n;
  }
  /**
   * Creates the polygon
   * @param depth The depth of the mesh created
   * @param smoothingThreshold Dot product threshold for smoothed normals
   * @returns the created VertexData
   */
  buildVertexData(e = 0, t = 2) {
    const r = new Ut(), n = [], i = [], s = [], a = this._points.computeBounds();
    this._points.elements.forEach((d) => {
      n.push(0, 1, 0), i.push(d.x, 0, d.y), s.push((d.x - a.min.x) / a.width, (d.y - a.min.y) / a.height);
    });
    const f = [], o = this.bjsEarcut(this._epoints, this._eholes, 2);
    for (let d = 0; d < o.length; d++)
      f.push(o[d]);
    if (e > 0) {
      const d = i.length / 3;
      this._points.elements.forEach((u) => {
        n.push(0, -1, 0), i.push(u.x, -e, u.y), s.push(1 - (u.x - a.min.x) / a.width, 1 - (u.y - a.min.y) / a.height);
      });
      const v = f.length;
      for (let u = 0; u < v; u += 3) {
        const l = f[u + 0], P = f[u + 1], p = f[u + 2];
        f.push(p + d), f.push(P + d), f.push(l + d);
      }
      this._addSide(i, n, s, f, a, this._outlinepoints, e, !1, t), this._holes.forEach((u) => {
        this._addSide(i, n, s, f, a, u, e, !0, t);
      });
    }
    return r.indices = f, r.positions = i, r.normals = n, r.uvs = s, r;
  }
  /**
   * Adds a side to the polygon
   * @param positions points that make the polygon
   * @param normals normals of the polygon
   * @param uvs uvs of the polygon
   * @param indices indices of the polygon
   * @param bounds bounds of the polygon
   * @param points points of the polygon
   * @param depth depth of the polygon
   * @param flip flip of the polygon
   * @param smoothingThreshold
   */
  _addSide(e, t, r, n, i, s, a, f, o) {
    let d = e.length / 3, v = 0;
    for (let u = 0; u < s.elements.length; u++) {
      const l = s.elements[u], P = s.elements[(u + 1) % s.elements.length];
      e.push(l.x, 0, l.y), e.push(l.x, -a, l.y), e.push(P.x, 0, P.y), e.push(P.x, -a, P.y);
      const p = s.elements[(u + s.elements.length - 1) % s.elements.length], c = s.elements[(u + 2) % s.elements.length];
      let H = new S(-(P.y - l.y), 0, P.x - l.x), T = new S(-(l.y - p.y), 0, l.x - p.x), q = new S(-(c.y - P.y), 0, c.x - P.x);
      f || (H = H.scale(-1), T = T.scale(-1), q = q.scale(-1));
      const b = H.normalizeToNew();
      let j = T.normalizeToNew(), w = q.normalizeToNew();
      const m = S.Dot(j, b);
      m > o ? m < Dn - 1 ? j = new S(l.x, 0, l.y).subtract(new S(P.x, 0, P.y)).normalize() : j = T.add(H).normalize() : j = b;
      const I = S.Dot(q, H);
      I > o ? I < Dn - 1 ? w = new S(P.x, 0, P.y).subtract(new S(l.x, 0, l.y)).normalize() : w = q.add(H).normalize() : w = b, r.push(v / i.width, 0), r.push(v / i.width, 1), v += H.length(), r.push(v / i.width, 0), r.push(v / i.width, 1), t.push(j.x, j.y, j.z), t.push(j.x, j.y, j.z), t.push(w.x, w.y, w.z), t.push(w.x, w.y, w.z), f ? (n.push(d), n.push(d + 2), n.push(d + 1), n.push(d + 1), n.push(d + 2), n.push(d + 3)) : (n.push(d), n.push(d + 1), n.push(d + 2), n.push(d + 1), n.push(d + 3), n.push(d + 2)), d += 4;
    }
  }
}
function RQ(A, e, t, r, n, i, s) {
  const a = t || new Array(3), f = r, o = [], d = s || !1;
  for (let N = 0; N < 3; N++)
    a[N] === void 0 && (a[N] = new Ir(0, 0, 1, 1)), f && f[N] === void 0 && (f[N] = new xt(1, 1, 1, 1));
  const v = A.getVerticesData(J.PositionKind), u = A.getVerticesData(J.NormalKind), l = A.getVerticesData(J.UVKind), P = A.getIndices(), p = v.length / 9;
  let c = 0, H = 0, T = 0, q = 0, b = 0;
  const j = [0];
  if (d)
    for (let N = p; N < v.length / 3; N += 4)
      H = v[3 * (N + 2)] - v[3 * N], T = v[3 * (N + 2) + 2] - v[3 * N + 2], q = Math.sqrt(H * H + T * T), b += q, j.push(b);
  let w = 0, m = 0;
  for (let N = 0; N < u.length; N += 3)
    Math.abs(u[N + 1]) < 1e-3 && (m = 1), Math.abs(u[N + 1] - 1) < 1e-3 && (m = 0), Math.abs(u[N + 1] + 1) < 1e-3 && (m = 2), w = N / 3, m === 1 ? (c = w - p, c % 4 < 1.5 ? d ? l[2 * w] = a[m].x + (a[m].z - a[m].x) * j[Math.floor(c / 4)] / b : l[2 * w] = a[m].x : d ? l[2 * w] = a[m].x + (a[m].z - a[m].x) * j[Math.floor(c / 4) + 1] / b : l[2 * w] = a[m].z, c % 2 === 0 ? l[2 * w + 1] = us.UseOpenGLOrientationForUV ? 1 - a[m].w : a[m].w : l[2 * w + 1] = us.UseOpenGLOrientationForUV ? 1 - a[m].y : a[m].y) : (l[2 * w] = (1 - l[2 * w]) * a[m].x + l[2 * w] * a[m].z, l[2 * w + 1] = (1 - l[2 * w + 1]) * a[m].y + l[2 * w + 1] * a[m].w, us.UseOpenGLOrientationForUV && (l[2 * w + 1] = 1 - l[2 * w + 1])), f && o.push(f[m].r, f[m].g, f[m].b, f[m].a);
  Ut._ComputeSides(e, v, P, u, l, n, i);
  const I = new Ut();
  if (I.indices = P, I.positions = v, I.normals = u, I.uvs = l, f) {
    const N = e === Ut.DOUBLESIDE ? o.concat(o) : o;
    I.colors = N;
  }
  return I;
}
function JR(A, e, t = null, r = earcut) {
  e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation);
  const n = e.shape, i = e.holes || [], s = e.depth || 0, a = e.smoothingThreshold || 2, f = [];
  let o = [];
  for (let P = 0; P < n.length; P++)
    f[P] = new at(n[P].x, n[P].z);
  const d = 1e-8;
  f[0].equalsWithEpsilon(f[f.length - 1], d) && f.pop();
  const v = new ete(A, f, t || gr.LastCreatedScene, r);
  for (let P = 0; P < i.length; P++) {
    o = [];
    for (let p = 0; p < i[P].length; p++)
      o.push(new at(i[P][p].x, i[P][p].z));
    v.addHole(o);
  }
  const u = v.build(!1, s, a);
  return u._originalBuilderSideOrientation = e.sideOrientation, RQ(u, e.sideOrientation, e.faceUV, e.faceColors, e.frontUVs, e.backUVs, e.wrap).applyToMesh(u, e.updatable), u;
}
function zR(A, e, t = null, r = earcut) {
  return JR(A, e, t, r);
}
const Mve = {
  ExtrudePolygon: zR,
  CreatePolygon: JR
};
Ut.CreatePolygon = RQ;
Ee.CreatePolygon = (A, e, t, r, n, i, s = earcut) => JR(A, {
  shape: e,
  holes: r,
  updatable: n,
  sideOrientation: i
}, t, s);
Ee.ExtrudePolygon = (A, e, t, r, n, i, s, a = earcut) => zR(A, {
  shape: e,
  holes: n,
  depth: t,
  updatable: i,
  sideOrientation: s
}, r, a);
function GR(A, e, t = null) {
  const r = e.path, n = e.shape, i = e.scale || 1, s = e.rotation || 0, a = e.cap === 0 ? 0 : e.cap || Ee.NO_CAP, f = e.updatable, o = Ee._GetDefaultSideOrientation(e.sideOrientation), d = e.instance || null, v = e.invertUV || !1, u = e.closeShape || !1, l = e.closePath || !1;
  return tte(A, n, r, i, s, null, null, l, u, a, !1, t, !!f, o, d, v, e.frontUVs || null, e.backUVs || null, e.firstNormal || null, !!e.adjustFrame);
}
function ZR(A, e, t = null) {
  const r = e.path, n = e.shape, i = e.scaleFunction || (() => 1), s = e.rotationFunction || (() => 0), a = e.closePath || e.ribbonCloseArray || !1, f = e.closeShape || e.ribbonClosePath || !1, o = e.cap === 0 ? 0 : e.cap || Ee.NO_CAP, d = e.updatable, v = e.firstNormal || null, u = e.adjustFrame || !1, l = Ee._GetDefaultSideOrientation(e.sideOrientation), P = e.instance, p = e.invertUV || !1;
  return tte(A, n, r, null, null, i, s, a, f, o, !0, t, !!d, l, P || null, p, e.frontUVs || null, e.backUVs || null, v, u);
}
function tte(A, e, t, r, n, i, s, a, f, o, d, v, u, l, P, p, c, H, T, q) {
  const b = (N, k, R, y, O, Y, ee, Z, te, fe, _) => {
    const G = R.getTangents(), L = R.getNormals(), $ = R.getBinormals(), ae = R.getDistances();
    if (_) {
      for (let qe = 0; qe < G.length; qe++)
        if (G[qe].x == 0 && G[qe].y == 0 && G[qe].z == 0 && G[qe].copyFrom(G[qe - 1]), L[qe].x == 0 && L[qe].y == 0 && L[qe].z == 0 && L[qe].copyFrom(L[qe - 1]), $[qe].x == 0 && $[qe].y == 0 && $[qe].z == 0 && $[qe].copyFrom($[qe - 1]), qe > 0) {
          let ke = G[qe - 1];
          S.Dot(ke, G[qe]) < 0 && G[qe].scaleInPlace(-1), ke = L[qe - 1], S.Dot(ke, L[qe]) < 0 && L[qe].scaleInPlace(-1), ke = $[qe - 1], S.Dot(ke, $[qe]) < 0 && $[qe].scaleInPlace(-1);
        }
    }
    let Pe = 0;
    const ge = () => O !== null ? O : 1, Xe = fe && Z ? Z : () => Y !== null ? Y : 0, De = fe && ee ? ee : ge;
    let ne = te === Ee.NO_CAP || te === Ee.CAP_END ? 0 : 2;
    const re = ue.Matrix[0];
    for (let qe = 0; qe < k.length; qe++) {
      const ke = [], be = Xe(qe, ae[qe]), Fe = De(qe, ae[qe]);
      he.RotationAxisToRef(G[qe], Pe, re);
      for (let Ke = 0; Ke < N.length; Ke++) {
        const nt = G[qe].scale(N[Ke].z).add(L[qe].scale(N[Ke].x)).add($[qe].scale(N[Ke].y)), ut = S.Zero();
        S.TransformCoordinatesToRef(nt, re, ut), ut.scaleInPlace(Fe).addInPlace(k[qe]), ke[Ke] = ut;
      }
      y[ne] = ke, Pe += be, ne++;
    }
    const ve = (qe) => {
      const ke = Array(), be = S.Zero();
      let Fe;
      for (Fe = 0; Fe < qe.length; Fe++)
        be.addInPlace(qe[Fe]);
      for (be.scaleInPlace(1 / qe.length), Fe = 0; Fe < qe.length; Fe++)
        ke.push(be);
      return ke;
    };
    switch (te) {
      case Ee.NO_CAP:
        break;
      case Ee.CAP_START:
        y[0] = ve(y[2]), y[1] = y[2];
        break;
      case Ee.CAP_END:
        y[ne] = y[ne - 1], y[ne + 1] = ve(y[ne - 1]);
        break;
      case Ee.CAP_ALL:
        y[0] = ve(y[2]), y[1] = y[2], y[ne] = y[ne - 1], y[ne + 1] = ve(y[ne - 1]);
        break;
    }
    return y;
  };
  let j, w;
  if (P) {
    const N = P._creationDataStorage;
    return j = T ? N.path3D.update(t, T) : N.path3D.update(t), w = b(e, t, N.path3D, N.pathArray, r, n, i, s, N.cap, d, q), P = n4("", { pathArray: w, closeArray: !1, closePath: !1, offset: 0, updatable: !1, sideOrientation: 0, instance: P }, v || void 0), P;
  }
  j = T ? new vm(t, T) : new vm(t);
  const m = new Array();
  o = o < 0 || o > 3 ? 0 : o, w = b(e, t, j, m, r, n, i, s, o, d, q);
  const I = n4(A, {
    pathArray: w,
    closeArray: a,
    closePath: f,
    updatable: u,
    sideOrientation: l,
    invertUV: p,
    frontUVs: c || void 0,
    backUVs: H || void 0
  }, v);
  return I._creationDataStorage.pathArray = w, I._creationDataStorage.path3D = j, I._creationDataStorage.cap = o, I;
}
const Lve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  ExtrudeShape: GR,
  // eslint-disable-next-line @typescript-eslint/naming-convention
  ExtrudeShapeCustom: ZR
};
Ee.ExtrudeShape = (A, e, t, r, n, i, s = null, a, f, o) => {
  const d = {
    shape: e,
    path: t,
    scale: r,
    rotation: n,
    cap: i === 0 ? 0 : i || Ee.NO_CAP,
    sideOrientation: f,
    instance: o,
    updatable: a
  };
  return GR(A, d, s);
};
Ee.ExtrudeShapeCustom = (A, e, t, r, n, i, s, a, f, o, d, v) => {
  const u = {
    shape: e,
    path: t,
    scaleFunction: r,
    rotationFunction: n,
    ribbonCloseArray: i,
    ribbonClosePath: s,
    cap: a === 0 ? 0 : a || Ee.NO_CAP,
    sideOrientation: d,
    instance: v,
    updatable: o
  };
  return ZR(A, u, f);
};
function _O(A, e, t = null) {
  const r = e.arc ? e.arc <= 0 || e.arc > 1 ? 1 : e.arc : 1, n = e.closed === void 0 ? !0 : e.closed, i = e.shape, s = e.radius || 1, a = e.tessellation || 64, f = e.clip || 0, o = e.updatable, d = Ee._GetDefaultSideOrientation(e.sideOrientation), v = e.cap || Ee.NO_CAP, u = Math.PI * 2, l = [], P = e.invertUV || !1;
  let p = 0, c = 0;
  const H = u / a * r;
  let T, q;
  for (p = 0; p <= a - f; p++) {
    for (q = [], (v == Ee.CAP_START || v == Ee.CAP_ALL) && (q.push(new S(0, i[0].y, 0)), q.push(new S(Math.cos(p * H) * i[0].x * s, i[0].y, Math.sin(p * H) * i[0].x * s))), c = 0; c < i.length; c++)
      T = new S(Math.cos(p * H) * i[c].x * s, i[c].y, Math.sin(p * H) * i[c].x * s), q.push(T);
    (v == Ee.CAP_END || v == Ee.CAP_ALL) && (q.push(new S(Math.cos(p * H) * i[i.length - 1].x * s, i[i.length - 1].y, Math.sin(p * H) * i[i.length - 1].x * s)), q.push(new S(0, i[i.length - 1].y, 0))), l.push(q);
  }
  return n4(A, { pathArray: l, closeArray: n, sideOrientation: d, updatable: o, invertUV: P, frontUVs: e.frontUVs, backUVs: e.backUVs }, t);
}
const Kve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateLathe: _O
};
Ee.CreateLathe = (A, e, t, r, n, i, s) => _O(A, {
  shape: e,
  radius: t,
  tessellation: r,
  sideOrientation: s,
  updatable: i
}, n);
function $O(A, e, t = null) {
  const r = e.path;
  let n = e.instance, i = 1;
  e.radius !== void 0 ? i = e.radius : n && (i = n._creationDataStorage.radius);
  const s = e.tessellation || 64, a = e.radiusFunction || null;
  let f = e.cap || Ee.NO_CAP;
  const o = e.invertUV || !1, d = e.updatable, v = Ee._GetDefaultSideOrientation(e.sideOrientation);
  e.arc = e.arc && (e.arc <= 0 || e.arc > 1) ? 1 : e.arc || 1;
  const u = (H, T, q, b, j, w, m, I) => {
    const N = T.getTangents(), k = T.getNormals(), R = T.getDistances(), O = Math.PI * 2 / j * I, ee = w || (() => b);
    let Z, te, fe, _;
    const G = ue.Matrix[0];
    let L = m === Ee.NO_CAP || m === Ee.CAP_END ? 0 : 2;
    for (let ae = 0; ae < H.length; ae++) {
      te = ee(ae, R[ae]), Z = Array(), fe = k[ae];
      for (let Pe = 0; Pe < j; Pe++)
        he.RotationAxisToRef(N[ae], O * Pe, G), _ = Z[Pe] ? Z[Pe] : S.Zero(), S.TransformCoordinatesToRef(fe, G, _), _.scaleInPlace(te).addInPlace(H[ae]), Z[Pe] = _;
      q[L] = Z, L++;
    }
    const $ = (ae, Pe) => {
      const ge = Array();
      for (let me = 0; me < ae; me++)
        ge.push(H[Pe]);
      return ge;
    };
    switch (m) {
      case Ee.NO_CAP:
        break;
      case Ee.CAP_START:
        q[0] = $(j, 0), q[1] = q[2].slice(0);
        break;
      case Ee.CAP_END:
        q[L] = q[L - 1].slice(0), q[L + 1] = $(j, H.length - 1);
        break;
      case Ee.CAP_ALL:
        q[0] = $(j, 0), q[1] = q[2].slice(0), q[L] = q[L - 1].slice(0), q[L + 1] = $(j, H.length - 1);
        break;
    }
    return q;
  };
  let l, P;
  if (n) {
    const H = n._creationDataStorage, T = e.arc || H.arc;
    return l = H.path3D.update(r), P = u(r, l, H.pathArray, i, H.tessellation, a, H.cap, T), n = n4("", { pathArray: P, instance: n }), H.path3D = l, H.pathArray = P, H.arc = T, H.radius = i, n;
  }
  l = new vm(r);
  const p = new Array();
  f = f < 0 || f > 3 ? 0 : f, P = u(r, l, p, i, s, a, f, e.arc);
  const c = n4(A, {
    pathArray: P,
    closePath: !0,
    closeArray: !1,
    updatable: d,
    sideOrientation: v,
    invertUV: o,
    frontUVs: e.frontUVs,
    backUVs: e.backUVs
  }, t);
  return c._creationDataStorage.pathArray = P, c._creationDataStorage.path3D = l, c._creationDataStorage.tessellation = s, c._creationDataStorage.cap = f, c._creationDataStorage.arc = e.arc, c._creationDataStorage.radius = i, c;
}
const Jve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateTube: $O
};
Ee.CreateTube = (A, e, t, r, n, i, s, a, f, o) => $O(A, {
  path: e,
  radius: t,
  tessellation: r,
  radiusFunction: n,
  arc: 1,
  cap: i,
  updatable: a,
  sideOrientation: f,
  instance: o
}, s);
function VQ(A) {
  const e = [];
  e[0] = {
    vertex: [
      [0, 0, 1.732051],
      [1.632993, 0, -0.5773503],
      [-0.8164966, 1.414214, -0.5773503],
      [-0.8164966, -1.414214, -0.5773503]
    ],
    face: [
      [0, 1, 2],
      [0, 2, 3],
      [0, 3, 1],
      [1, 3, 2]
    ]
  }, e[1] = {
    vertex: [
      [0, 0, 1.414214],
      [1.414214, 0, 0],
      [0, 1.414214, 0],
      [-1.414214, 0, 0],
      [0, -1.414214, 0],
      [0, 0, -1.414214]
    ],
    face: [
      [0, 1, 2],
      [0, 2, 3],
      [0, 3, 4],
      [0, 4, 1],
      [1, 4, 5],
      [1, 5, 2],
      [2, 5, 3],
      [3, 5, 4]
    ]
  }, e[2] = {
    vertex: [
      [0, 0, 1.070466],
      [0.7136442, 0, 0.7978784],
      [-0.3568221, 0.618034, 0.7978784],
      [-0.3568221, -0.618034, 0.7978784],
      [0.7978784, 0.618034, 0.3568221],
      [0.7978784, -0.618034, 0.3568221],
      [-0.9341724, 0.381966, 0.3568221],
      [0.1362939, 1, 0.3568221],
      [0.1362939, -1, 0.3568221],
      [-0.9341724, -0.381966, 0.3568221],
      [0.9341724, 0.381966, -0.3568221],
      [0.9341724, -0.381966, -0.3568221],
      [-0.7978784, 0.618034, -0.3568221],
      [-0.1362939, 1, -0.3568221],
      [-0.1362939, -1, -0.3568221],
      [-0.7978784, -0.618034, -0.3568221],
      [0.3568221, 0.618034, -0.7978784],
      [0.3568221, -0.618034, -0.7978784],
      [-0.7136442, 0, -0.7978784],
      [0, 0, -1.070466]
    ],
    face: [
      [0, 1, 4, 7, 2],
      [0, 2, 6, 9, 3],
      [0, 3, 8, 5, 1],
      [1, 5, 11, 10, 4],
      [2, 7, 13, 12, 6],
      [3, 9, 15, 14, 8],
      [4, 10, 16, 13, 7],
      [5, 8, 14, 17, 11],
      [6, 12, 18, 15, 9],
      [10, 11, 17, 19, 16],
      [12, 13, 16, 19, 18],
      [14, 15, 18, 19, 17]
    ]
  }, e[3] = {
    vertex: [
      [0, 0, 1.175571],
      [1.051462, 0, 0.5257311],
      [0.3249197, 1, 0.5257311],
      [-0.8506508, 0.618034, 0.5257311],
      [-0.8506508, -0.618034, 0.5257311],
      [0.3249197, -1, 0.5257311],
      [0.8506508, 0.618034, -0.5257311],
      [0.8506508, -0.618034, -0.5257311],
      [-0.3249197, 1, -0.5257311],
      [-1.051462, 0, -0.5257311],
      [-0.3249197, -1, -0.5257311],
      [0, 0, -1.175571]
    ],
    face: [
      [0, 1, 2],
      [0, 2, 3],
      [0, 3, 4],
      [0, 4, 5],
      [0, 5, 1],
      [1, 5, 7],
      [1, 7, 6],
      [1, 6, 2],
      [2, 6, 8],
      [2, 8, 3],
      [3, 8, 9],
      [3, 9, 4],
      [4, 9, 10],
      [4, 10, 5],
      [5, 10, 7],
      [6, 7, 11],
      [6, 11, 8],
      [7, 10, 11],
      [8, 11, 9],
      [9, 11, 10]
    ]
  }, e[4] = {
    vertex: [
      [0, 0, 1.070722],
      [0.7148135, 0, 0.7971752],
      [-0.104682, 0.7071068, 0.7971752],
      [-0.6841528, 0.2071068, 0.7971752],
      [-0.104682, -0.7071068, 0.7971752],
      [0.6101315, 0.7071068, 0.5236279],
      [1.04156, 0.2071068, 0.1367736],
      [0.6101315, -0.7071068, 0.5236279],
      [-0.3574067, 1, 0.1367736],
      [-0.7888348, -0.5, 0.5236279],
      [-0.9368776, 0.5, 0.1367736],
      [-0.3574067, -1, 0.1367736],
      [0.3574067, 1, -0.1367736],
      [0.9368776, -0.5, -0.1367736],
      [0.7888348, 0.5, -0.5236279],
      [0.3574067, -1, -0.1367736],
      [-0.6101315, 0.7071068, -0.5236279],
      [-1.04156, -0.2071068, -0.1367736],
      [-0.6101315, -0.7071068, -0.5236279],
      [0.104682, 0.7071068, -0.7971752],
      [0.6841528, -0.2071068, -0.7971752],
      [0.104682, -0.7071068, -0.7971752],
      [-0.7148135, 0, -0.7971752],
      [0, 0, -1.070722]
    ],
    face: [
      [0, 2, 3],
      [1, 6, 5],
      [4, 9, 11],
      [7, 15, 13],
      [8, 16, 10],
      [12, 14, 19],
      [17, 22, 18],
      [20, 21, 23],
      [0, 1, 5, 2],
      [0, 3, 9, 4],
      [0, 4, 7, 1],
      [1, 7, 13, 6],
      [2, 5, 12, 8],
      [2, 8, 10, 3],
      [3, 10, 17, 9],
      [4, 11, 15, 7],
      [5, 6, 14, 12],
      [6, 13, 20, 14],
      [8, 12, 19, 16],
      [9, 17, 18, 11],
      [10, 16, 22, 17],
      [11, 18, 21, 15],
      [13, 15, 21, 20],
      [14, 20, 23, 19],
      [16, 19, 23, 22],
      [18, 22, 23, 21]
    ]
  }, e[5] = {
    vertex: [
      [0, 0, 1.322876],
      [1.309307, 0, 0.1889822],
      [-0.9819805, 0.8660254, 0.1889822],
      [0.1636634, -1.299038, 0.1889822],
      [0.3273268, 0.8660254, -0.9449112],
      [-0.8183171, -0.4330127, -0.9449112]
    ],
    face: [
      [0, 3, 1],
      [2, 4, 5],
      [0, 1, 4, 2],
      [0, 2, 5, 3],
      [1, 3, 5, 4]
    ]
  }, e[6] = {
    vertex: [
      [0, 0, 1.159953],
      [1.013464, 0, 0.5642542],
      [-0.3501431, 0.9510565, 0.5642542],
      [-0.7715208, -0.6571639, 0.5642542],
      [0.6633206, 0.9510565, -0.03144481],
      [0.8682979, -0.6571639, -0.3996071],
      [-1.121664, 0.2938926, -0.03144481],
      [-0.2348831, -1.063314, -0.3996071],
      [0.5181548, 0.2938926, -0.9953061],
      [-0.5850262, -0.112257, -0.9953061]
    ],
    face: [
      [0, 1, 4, 2],
      [0, 2, 6, 3],
      [1, 5, 8, 4],
      [3, 6, 9, 7],
      [5, 7, 9, 8],
      [0, 3, 7, 5, 1],
      [2, 4, 8, 9, 6]
    ]
  }, e[7] = {
    vertex: [
      [0, 0, 1.118034],
      [0.8944272, 0, 0.6708204],
      [-0.2236068, 0.8660254, 0.6708204],
      [-0.7826238, -0.4330127, 0.6708204],
      [0.6708204, 0.8660254, 0.2236068],
      [1.006231, -0.4330127, -0.2236068],
      [-1.006231, 0.4330127, 0.2236068],
      [-0.6708204, -0.8660254, -0.2236068],
      [0.7826238, 0.4330127, -0.6708204],
      [0.2236068, -0.8660254, -0.6708204],
      [-0.8944272, 0, -0.6708204],
      [0, 0, -1.118034]
    ],
    face: [
      [0, 1, 4, 2],
      [0, 2, 6, 3],
      [1, 5, 8, 4],
      [3, 6, 10, 7],
      [5, 9, 11, 8],
      [7, 10, 11, 9],
      [0, 3, 7, 9, 5, 1],
      [2, 4, 8, 11, 10, 6]
    ]
  }, e[8] = {
    vertex: [
      [-0.729665, 0.670121, 0.319155],
      [-0.655235, -0.29213, -0.754096],
      [-0.093922, -0.607123, 0.537818],
      [0.702196, 0.595691, 0.485187],
      [0.776626, -0.36656, -0.588064]
    ],
    face: [
      [1, 4, 2],
      [0, 1, 2],
      [3, 0, 2],
      [4, 3, 2],
      [4, 1, 0, 3]
    ]
  }, e[9] = {
    vertex: [
      [-0.868849, -0.100041, 0.61257],
      [-0.329458, 0.976099, 0.28078],
      [-0.26629, -0.013796, -0.477654],
      [-0.13392, -1.034115, 0.229829],
      [0.738834, 0.707117, -0.307018],
      [0.859683, -0.535264, -0.338508]
    ],
    face: [
      [3, 0, 2],
      [5, 3, 2],
      [4, 5, 2],
      [1, 4, 2],
      [0, 1, 2],
      [0, 3, 5, 4, 1]
    ]
  }, e[10] = {
    vertex: [
      [-0.610389, 0.243975, 0.531213],
      [-0.187812, -0.48795, -0.664016],
      [-0.187812, 0.9759, -0.664016],
      [0.187812, -0.9759, 0.664016],
      [0.798201, 0.243975, 0.132803]
    ],
    face: [
      [1, 3, 0],
      [3, 4, 0],
      [3, 1, 4],
      [0, 2, 1],
      [0, 4, 2],
      [2, 4, 1]
    ]
  }, e[11] = {
    vertex: [
      [-1.028778, 0.392027, -0.048786],
      [-0.640503, -0.646161, 0.621837],
      [-0.125162, -0.395663, -0.540059],
      [4683e-6, 0.888447, -0.651988],
      [0.125161, 0.395663, 0.540059],
      [0.632925, -0.791376, 0.433102],
      [1.031672, 0.157063, -0.354165]
    ],
    face: [
      [3, 2, 0],
      [2, 1, 0],
      [2, 5, 1],
      [0, 4, 3],
      [0, 1, 4],
      [4, 1, 5],
      [2, 3, 6],
      [3, 4, 6],
      [5, 2, 6],
      [4, 5, 6]
    ]
  }, e[12] = {
    vertex: [
      [-0.669867, 0.334933, -0.529576],
      [-0.669867, 0.334933, 0.529577],
      [-0.4043, 1.212901, 0],
      [-0.334933, -0.669867, -0.529576],
      [-0.334933, -0.669867, 0.529577],
      [0.334933, 0.669867, -0.529576],
      [0.334933, 0.669867, 0.529577],
      [0.4043, -1.212901, 0],
      [0.669867, -0.334933, -0.529576],
      [0.669867, -0.334933, 0.529577]
    ],
    face: [
      [8, 9, 7],
      [6, 5, 2],
      [3, 8, 7],
      [5, 0, 2],
      [4, 3, 7],
      [0, 1, 2],
      [9, 4, 7],
      [1, 6, 2],
      [9, 8, 5, 6],
      [8, 3, 0, 5],
      [3, 4, 1, 0],
      [4, 9, 6, 1]
    ]
  }, e[13] = {
    vertex: [
      [-0.931836, 0.219976, -0.264632],
      [-0.636706, 0.318353, 0.692816],
      [-0.613483, -0.735083, -0.264632],
      [-0.326545, 0.979634, 0],
      [-0.318353, -0.636706, 0.692816],
      [-0.159176, 0.477529, -0.856368],
      [0.159176, -0.477529, -0.856368],
      [0.318353, 0.636706, 0.692816],
      [0.326545, -0.979634, 0],
      [0.613482, 0.735082, -0.264632],
      [0.636706, -0.318353, 0.692816],
      [0.931835, -0.219977, -0.264632]
    ],
    face: [
      [11, 10, 8],
      [7, 9, 3],
      [6, 11, 8],
      [9, 5, 3],
      [2, 6, 8],
      [5, 0, 3],
      [4, 2, 8],
      [0, 1, 3],
      [10, 4, 8],
      [1, 7, 3],
      [10, 11, 9, 7],
      [11, 6, 5, 9],
      [6, 2, 0, 5],
      [2, 4, 1, 0],
      [4, 10, 7, 1]
    ]
  }, e[14] = {
    vertex: [
      [-0.93465, 0.300459, -0.271185],
      [-0.838689, -0.260219, -0.516017],
      [-0.711319, 0.717591, 0.128359],
      [-0.710334, -0.156922, 0.080946],
      [-0.599799, 0.556003, -0.725148],
      [-0.503838, -4675e-6, -0.969981],
      [-0.487004, 0.26021, 0.48049],
      [-0.460089, -0.750282, -0.512622],
      [-0.376468, 0.973135, -0.325605],
      [-0.331735, -0.646985, 0.084342],
      [-0.254001, 0.831847, 0.530001],
      [-0.125239, -0.494738, -0.966586],
      [0.029622, 0.027949, 0.730817],
      [0.056536, -0.982543, -0.262295],
      [0.08085, 1.087391, 0.076037],
      [0.125583, -0.532729, 0.485984],
      [0.262625, 0.599586, 0.780328],
      [0.391387, -0.726999, -0.716259],
      [0.513854, -0.868287, 0.139347],
      [0.597475, 0.85513, 0.326364],
      [0.641224, 0.109523, 0.783723],
      [0.737185, -0.451155, 0.538891],
      [0.848705, -0.612742, -0.314616],
      [0.976075, 0.365067, 0.32976],
      [1.072036, -0.19561, 0.084927]
    ],
    face: [
      [15, 18, 21],
      [12, 20, 16],
      [6, 10, 2],
      [3, 0, 1],
      [9, 7, 13],
      [2, 8, 4, 0],
      [0, 4, 5, 1],
      [1, 5, 11, 7],
      [7, 11, 17, 13],
      [13, 17, 22, 18],
      [18, 22, 24, 21],
      [21, 24, 23, 20],
      [20, 23, 19, 16],
      [16, 19, 14, 10],
      [10, 14, 8, 2],
      [15, 9, 13, 18],
      [12, 15, 21, 20],
      [6, 12, 16, 10],
      [3, 6, 2, 0],
      [9, 3, 1, 7],
      [9, 15, 12, 6, 3],
      [22, 17, 11, 5, 4, 8, 14, 19, 23, 24]
    ]
  };
  const t = A.type && (A.type < 0 || A.type >= e.length) ? 0 : A.type || 0, r = A.size, n = A.sizeX || r || 1, i = A.sizeY || r || 1, s = A.sizeZ || r || 1, a = A.custom || e[t], f = a.face.length, o = A.faceUV || new Array(f), d = A.faceColors, v = A.flat === void 0 ? !0 : A.flat, u = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE, l = [], P = [], p = [], c = [], H = [];
  let T = 0, q = 0;
  const b = [];
  let j = 0, w = 0, m, I, N, k, R, y;
  if (v)
    for (w = 0; w < f; w++)
      d && d[w] === void 0 && (d[w] = new xt(1, 1, 1, 1)), o && o[w] === void 0 && (o[w] = new Ir(0, 0, 1, 1));
  if (v)
    for (w = 0; w < f; w++) {
      const Y = a.face[w].length;
      for (N = 2 * Math.PI / Y, k = 0.5 * Math.tan(N / 2), R = 0.5, j = 0; j < Y; j++)
        l.push(a.vertex[a.face[w][j]][0] * n, a.vertex[a.face[w][j]][1] * i, a.vertex[a.face[w][j]][2] * s), b.push(T), T++, m = o[w].x + (o[w].z - o[w].x) * (0.5 + k), I = o[w].y + (o[w].w - o[w].y) * (R - 0.5), c.push(m, us.UseOpenGLOrientationForUV ? 1 - I : I), y = k * Math.cos(N) - R * Math.sin(N), R = k * Math.sin(N) + R * Math.cos(N), k = y, d && H.push(d[w].r, d[w].g, d[w].b, d[w].a);
      for (j = 0; j < Y - 2; j++)
        P.push(b[0 + q], b[j + 2 + q], b[j + 1 + q]);
      q += Y;
    }
  else {
    for (j = 0; j < a.vertex.length; j++)
      l.push(a.vertex[j][0] * n, a.vertex[j][1] * i, a.vertex[j][2] * s), c.push(0, us.UseOpenGLOrientationForUV ? 1 : 0);
    for (w = 0; w < f; w++)
      for (j = 0; j < a.face[w].length - 2; j++)
        P.push(a.face[w][0], a.face[w][j + 2], a.face[w][j + 1]);
  }
  Ut.ComputeNormals(l, P, p), Ut._ComputeSides(u, l, P, p, c, A.frontUVs, A.backUVs);
  const O = new Ut();
  return O.positions = l, O.indices = P, O.normals = p, O.uvs = c, d && v && (O.colors = H), O;
}
function hm(A, e = {}, t = null) {
  const r = new Ee(A, t);
  return e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), r._originalBuilderSideOrientation = e.sideOrientation, VQ(e).applyToMesh(r, e.updatable), r;
}
const zve = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreatePolyhedron: hm
};
Ut.CreatePolyhedron = VQ;
Ee.CreatePolyhedron = (A, e, t) => hm(A, e, t);
const Gve = new S(1, 0, 0), Zve = new S(-1, 0, 0), _ve = new S(0, 1, 0), $ve = new S(0, -1, 0), eue = new S(0, 0, 1), tue = new S(0, 0, -1);
class ZC {
  constructor(e = S.Zero(), t = S.Up(), r = at.Zero(), n = 0, i = 0, s = null, a = null, f = null, o = null) {
    this.position = e, this.normal = t, this.uv = r, this.vertexIdx = n, this.vertexIdxForBones = i, this.localPositionOverride = s, this.localNormalOverride = a, this.matrixIndicesOverride = f, this.matrixWeightsOverride = o;
  }
  clone() {
    var e, t, r, n;
    return new ZC(this.position.clone(), this.normal.clone(), this.uv.clone(), this.vertexIdx, this.vertexIdxForBones, (e = this.localPositionOverride) === null || e === void 0 ? void 0 : e.slice(), (t = this.localNormalOverride) === null || t === void 0 ? void 0 : t.slice(), (r = this.matrixIndicesOverride) === null || r === void 0 ? void 0 : r.slice(), (n = this.matrixWeightsOverride) === null || n === void 0 ? void 0 : n.slice());
  }
}
function ey(A, e, t) {
  var r, n, i, s;
  const a = !!e.skeleton, f = t.localMode || a, o = e.overrideMaterialSideOrientation !== null && e.overrideMaterialSideOrientation !== void 0, d = e.getIndices(), v = a ? e.getPositionData(!0, !0) : e.getVerticesData(J.PositionKind), u = a ? e.getNormalsData(!0, !0) : e.getVerticesData(J.NormalKind), l = f ? a ? e.getVerticesData(J.PositionKind) : v : null, P = f ? a ? e.getVerticesData(J.NormalKind) : u : null, p = e.getVerticesData(J.UVKind), c = a ? e.getVerticesData(J.MatricesIndicesKind) : null, H = a ? e.getVerticesData(J.MatricesWeightsKind) : null, T = a ? e.getVerticesData(J.MatricesIndicesExtraKind) : null, q = a ? e.getVerticesData(J.MatricesWeightsExtraKind) : null, b = t.position || S.Zero();
  let j = t.normal || S.Up();
  const w = t.size || S.One(), m = t.angle || 0;
  if (!j) {
    const L = new S(0, 0, 1), $ = e.getScene().activeCamera, ae = S.TransformCoordinates(L, $.getWorldMatrix());
    j = $.globalPosition.subtract(ae);
  }
  const I = -Math.atan2(j.z, j.x) - Math.PI / 2, N = Math.sqrt(j.x * j.x + j.z * j.z), k = Math.atan2(j.y, N), R = new Ut();
  R.indices = [], R.positions = [], R.normals = [], R.uvs = [], R.matricesIndices = a ? [] : null, R.matricesWeights = a ? [] : null, R.matricesIndicesExtra = T ? [] : null, R.matricesWeightsExtra = q ? [] : null;
  let y = 0;
  const O = (L, $) => {
    const ae = new ZC();
    if (!d || !v || !u)
      return ae;
    const Pe = d[L];
    if (ae.vertexIdx = Pe * 3, ae.vertexIdxForBones = Pe * 4, ae.position = new S(v[Pe * 3], v[Pe * 3 + 1], v[Pe * 3 + 2]), S.TransformCoordinatesToRef(ae.position, $, ae.position), ae.normal = new S(u[Pe * 3], u[Pe * 3 + 1], u[Pe * 3 + 2]), S.TransformNormalToRef(ae.normal, $, ae.normal), t.captureUVS && p) {
      const ge = p[Pe * 2 + 1];
      ae.uv = new at(p[Pe * 2], us.UseOpenGLOrientationForUV ? 1 - ge : ge);
    }
    return ae;
  }, Y = [0, 0, 0, 0], ee = (L, $) => {
    if (L.length === 0)
      return L;
    const ae = 0.5 * Math.abs(S.Dot(w, $)), Pe = (Xe, De, ne, re) => {
      for (let ve = 0; ve < re; ++ve)
        if (Xe[ne + ve] === De)
          return ne + ve;
      return -1;
    }, ge = (Xe, De) => {
      var ne, re, ve, qe, ke, be, Fe, Ke, nt, ut, bt, wt, Tt, lr, Qt, tr;
      const br = S.GetClipFactor(Xe.position, De.position, $, ae);
      let Xn = Y, qr = Y;
      if (c && H) {
        const Vn = Xe.matrixIndicesOverride ? 0 : Xe.vertexIdxForBones, ki = (ne = Xe.matrixIndicesOverride) !== null && ne !== void 0 ? ne : c, as = (re = Xe.matrixWeightsOverride) !== null && re !== void 0 ? re : H, Rr = De.matrixIndicesOverride ? 0 : De.vertexIdxForBones, Ii = (ve = De.matrixIndicesOverride) !== null && ve !== void 0 ? ve : c, is = (qe = De.matrixWeightsOverride) !== null && qe !== void 0 ? qe : H;
        Xn = [0, 0, 0, 0], qr = [0, 0, 0, 0];
        let ji = 0;
        for (let oi = 0; oi < 4; ++oi)
          if (as[Vn + oi] > 0) {
            const vr = Pe(Ii, ki[Vn + oi], Rr, 4);
            Xn[ji] = ki[Vn + oi], qr[ji] = Xt.Lerp(as[Vn + oi], vr >= 0 ? is[vr] : 0, br), ji++;
          }
        for (let oi = 0; oi < 4 && ji < 4; ++oi) {
          const vr = Ii[Rr + oi];
          Pe(ki, vr, Vn, 4) === -1 && (Xn[ji] = vr, qr[ji] = Xt.Lerp(0, is[Rr + oi], br), ji++);
        }
        const _i = qr[0] + qr[1] + qr[2] + qr[3];
        qr[0] /= _i, qr[1] /= _i, qr[2] /= _i, qr[3] /= _i;
      }
      const En = Xe.localPositionOverride ? Xe.localPositionOverride[0] : (ke = l == null ? void 0 : l[Xe.vertexIdx]) !== null && ke !== void 0 ? ke : 0, Bn = Xe.localPositionOverride ? Xe.localPositionOverride[1] : (be = l == null ? void 0 : l[Xe.vertexIdx + 1]) !== null && be !== void 0 ? be : 0, Fi = Xe.localPositionOverride ? Xe.localPositionOverride[2] : (Fe = l == null ? void 0 : l[Xe.vertexIdx + 2]) !== null && Fe !== void 0 ? Fe : 0, Gt = De.localPositionOverride ? De.localPositionOverride[0] : (Ke = l == null ? void 0 : l[De.vertexIdx]) !== null && Ke !== void 0 ? Ke : 0, xr = De.localPositionOverride ? De.localPositionOverride[1] : (nt = l == null ? void 0 : l[De.vertexIdx + 1]) !== null && nt !== void 0 ? nt : 0, Br = De.localPositionOverride ? De.localPositionOverride[2] : (ut = l == null ? void 0 : l[De.vertexIdx + 2]) !== null && ut !== void 0 ? ut : 0, nn = Xe.localNormalOverride ? Xe.localNormalOverride[0] : (bt = P == null ? void 0 : P[Xe.vertexIdx]) !== null && bt !== void 0 ? bt : 0, sn = Xe.localNormalOverride ? Xe.localNormalOverride[1] : (wt = P == null ? void 0 : P[Xe.vertexIdx + 1]) !== null && wt !== void 0 ? wt : 0, Pn = Xe.localNormalOverride ? Xe.localNormalOverride[2] : (Tt = P == null ? void 0 : P[Xe.vertexIdx + 2]) !== null && Tt !== void 0 ? Tt : 0, an = De.localNormalOverride ? De.localNormalOverride[0] : (lr = P == null ? void 0 : P[De.vertexIdx]) !== null && lr !== void 0 ? lr : 0, Wn = De.localNormalOverride ? De.localNormalOverride[1] : (Qt = P == null ? void 0 : P[De.vertexIdx + 1]) !== null && Qt !== void 0 ? Qt : 0, rr = De.localNormalOverride ? De.localNormalOverride[2] : (tr = P == null ? void 0 : P[De.vertexIdx + 2]) !== null && tr !== void 0 ? tr : 0, Sr = nn + (an - nn) * br, nr = sn + (Wn - sn) * br, Er = Pn + (rr - Pn) * br, Rn = Math.sqrt(Sr * Sr + nr * nr + Er * Er);
      return new ZC(S.Lerp(Xe.position, De.position, br), S.Lerp(Xe.normal, De.normal, br).normalize(), at.Lerp(Xe.uv, De.uv, br), -1, -1, l ? [
        En + (Gt - En) * br,
        Bn + (xr - Bn) * br,
        Fi + (Br - Fi) * br
      ] : null, P ? [Sr / Rn, nr / Rn, Er / Rn] : null, Xn, qr);
    };
    let me = null;
    L.length > 3 && (me = []);
    for (let Xe = 0; Xe < L.length; Xe += 3) {
      let De = 0, ne = null, re = null, ve = null, qe = null;
      const ke = S.Dot(L[Xe].position, $) - ae, be = S.Dot(L[Xe + 1].position, $) - ae, Fe = S.Dot(L[Xe + 2].position, $) - ae, Ke = ke > 0, nt = be > 0, ut = Fe > 0;
      switch (De = (Ke ? 1 : 0) + (nt ? 1 : 0) + (ut ? 1 : 0), De) {
        case 0:
          L.length > 3 ? (me.push(L[Xe]), me.push(L[Xe + 1]), me.push(L[Xe + 2])) : me = L;
          break;
        case 1:
          if (me = me ?? new Array(), Ke && (ne = L[Xe + 1], re = L[Xe + 2], ve = ge(L[Xe], ne), qe = ge(L[Xe], re)), nt) {
            ne = L[Xe], re = L[Xe + 2], ve = ge(L[Xe + 1], ne), qe = ge(L[Xe + 1], re), me.push(ve), me.push(re.clone()), me.push(ne.clone()), me.push(re.clone()), me.push(ve.clone()), me.push(qe);
            break;
          }
          ut && (ne = L[Xe], re = L[Xe + 1], ve = ge(L[Xe + 2], ne), qe = ge(L[Xe + 2], re)), ne && re && ve && qe && (me.push(ne.clone()), me.push(re.clone()), me.push(ve), me.push(qe), me.push(ve.clone()), me.push(re.clone()));
          break;
        case 2:
          me = me ?? new Array(), Ke || (ne = L[Xe].clone(), re = ge(ne, L[Xe + 1]), ve = ge(ne, L[Xe + 2]), me.push(ne), me.push(re), me.push(ve)), nt || (ne = L[Xe + 1].clone(), re = ge(ne, L[Xe + 2]), ve = ge(ne, L[Xe]), me.push(ne), me.push(re), me.push(ve)), ut || (ne = L[Xe + 2].clone(), re = ge(ne, L[Xe]), ve = ge(ne, L[Xe + 1]), me.push(ne), me.push(re), me.push(ve));
          break;
      }
    }
    return me;
  }, Z = e instanceof Ee ? e : null, te = Z == null ? void 0 : Z._thinInstanceDataStorage.matrixData, fe = (Z == null ? void 0 : Z.thinInstanceCount) || 1, _ = ue.Matrix[0];
  _.copyFrom(he.IdentityReadOnly);
  for (let L = 0; L < fe; ++L) {
    if (Z != null && Z.hasThinInstances && te) {
      const Xe = L * 16;
      _.setRowFromFloats(0, te[Xe + 0], te[Xe + 1], te[Xe + 2], te[Xe + 3]), _.setRowFromFloats(1, te[Xe + 4], te[Xe + 5], te[Xe + 6], te[Xe + 7]), _.setRowFromFloats(2, te[Xe + 8], te[Xe + 9], te[Xe + 10], te[Xe + 11]), _.setRowFromFloats(3, te[Xe + 12], te[Xe + 13], te[Xe + 14], te[Xe + 15]);
    }
    const $ = he.RotationYawPitchRoll(I, k, m).multiply(he.Translation(b.x, b.y, b.z)), ae = he.Invert($), Pe = e.getWorldMatrix(), ge = _.multiply(Pe).multiply(ae), me = new Array(3);
    for (let Xe = 0; Xe < d.length; Xe += 3) {
      let De = me;
      if (De[0] = O(Xe, ge), o && f ? (De[1] = O(Xe + 2, ge), De[2] = O(Xe + 1, ge)) : (De[1] = O(Xe + 1, ge), De[2] = O(Xe + 2, ge)), !(t.cullBackFaces && -De[0].normal.z <= 0 && -De[1].normal.z <= 0 && -De[2].normal.z <= 0) && (De = ee(De, Gve), !!De && (De = ee(De, Zve), !!De && (De = ee(De, _ve), !!De && (De = ee(De, $ve), !!De && (De = ee(De, eue), !!De && (De = ee(De, tue), !!De)))))))
        for (let ne = 0; ne < De.length; ne++) {
          const re = De[ne];
          if (R.indices.push(y), f ? (re.localPositionOverride ? (R.positions[y * 3] = re.localPositionOverride[0], R.positions[y * 3 + 1] = re.localPositionOverride[1], R.positions[y * 3 + 2] = re.localPositionOverride[2]) : l && (R.positions[y * 3] = l[re.vertexIdx], R.positions[y * 3 + 1] = l[re.vertexIdx + 1], R.positions[y * 3 + 2] = l[re.vertexIdx + 2]), re.localNormalOverride ? (R.normals[y * 3] = re.localNormalOverride[0], R.normals[y * 3 + 1] = re.localNormalOverride[1], R.normals[y * 3 + 2] = re.localNormalOverride[2]) : P && (R.normals[y * 3] = P[re.vertexIdx], R.normals[y * 3 + 1] = P[re.vertexIdx + 1], R.normals[y * 3 + 2] = P[re.vertexIdx + 2])) : (re.position.toArray(R.positions, y * 3), re.normal.toArray(R.normals, y * 3)), R.matricesIndices && R.matricesWeights && (re.matrixIndicesOverride ? (R.matricesIndices[y * 4] = re.matrixIndicesOverride[0], R.matricesIndices[y * 4 + 1] = re.matrixIndicesOverride[1], R.matricesIndices[y * 4 + 2] = re.matrixIndicesOverride[2], R.matricesIndices[y * 4 + 3] = re.matrixIndicesOverride[3]) : (c && (R.matricesIndices[y * 4] = c[re.vertexIdxForBones], R.matricesIndices[y * 4 + 1] = c[re.vertexIdxForBones + 1], R.matricesIndices[y * 4 + 2] = c[re.vertexIdxForBones + 2], R.matricesIndices[y * 4 + 3] = c[re.vertexIdxForBones + 3]), T && R.matricesIndicesExtra && (R.matricesIndicesExtra[y * 4] = T[re.vertexIdxForBones], R.matricesIndicesExtra[y * 4 + 1] = T[re.vertexIdxForBones + 1], R.matricesIndicesExtra[y * 4 + 2] = T[re.vertexIdxForBones + 2], R.matricesIndicesExtra[y * 4 + 3] = T[re.vertexIdxForBones + 3])), re.matrixWeightsOverride ? (R.matricesWeights[y * 4] = re.matrixWeightsOverride[0], R.matricesWeights[y * 4 + 1] = re.matrixWeightsOverride[1], R.matricesWeights[y * 4 + 2] = re.matrixWeightsOverride[2], R.matricesWeights[y * 4 + 3] = re.matrixWeightsOverride[3]) : (H && (R.matricesWeights[y * 4] = H[re.vertexIdxForBones], R.matricesWeights[y * 4 + 1] = H[re.vertexIdxForBones + 1], R.matricesWeights[y * 4 + 2] = H[re.vertexIdxForBones + 2], R.matricesWeights[y * 4 + 3] = H[re.vertexIdxForBones + 3]), q && R.matricesWeightsExtra && (R.matricesWeightsExtra[y * 4] = q[re.vertexIdxForBones], R.matricesWeightsExtra[y * 4 + 1] = q[re.vertexIdxForBones + 1], R.matricesWeightsExtra[y * 4 + 2] = q[re.vertexIdxForBones + 2], R.matricesWeightsExtra[y * 4 + 3] = q[re.vertexIdxForBones + 3]))), t.captureUVS)
            re.uv.toArray(R.uvs, y * 2);
          else {
            R.uvs.push(0.5 + re.position.x / w.x);
            const ve = 0.5 + re.position.y / w.y;
            R.uvs.push(us.UseOpenGLOrientationForUV ? 1 - ve : ve);
          }
          y++;
        }
    }
  }
  R.indices.length === 0 && (R.indices = null), R.positions.length === 0 && (R.positions = null), R.normals.length === 0 && (R.normals = null), R.uvs.length === 0 && (R.uvs = null), ((r = R.matricesIndices) === null || r === void 0 ? void 0 : r.length) === 0 && (R.matricesIndices = null), ((n = R.matricesWeights) === null || n === void 0 ? void 0 : n.length) === 0 && (R.matricesWeights = null), ((i = R.matricesIndicesExtra) === null || i === void 0 ? void 0 : i.length) === 0 && (R.matricesIndicesExtra = null), ((s = R.matricesWeightsExtra) === null || s === void 0 ? void 0 : s.length) === 0 && (R.matricesWeightsExtra = null);
  const G = new Ee(A, e.getScene());
  return R.applyToMesh(G), f ? (G.skeleton = e.skeleton, G.parent = e) : (G.position = b.clone(), G.rotation = new S(k, I, m)), G.computeWorldMatrix(!0), G.refreshBoundingInfo(!0, !0), G;
}
const rue = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateDecal: ey
};
Ee.CreateDecal = (A, e, t, r, n, i) => ey(A, e, {
  position: t,
  normal: r,
  size: n,
  angle: i
});
class f1 {
  /**
   * Creates a new isovector from the given x and y coordinates
   * @param x defines the first coordinate, must be an integer
   * @param y defines the second coordinate, must be an integer
   */
  constructor(e = 0, t = 0) {
    this.x = e, this.y = t, e !== Math.floor(e) && Se.Warn("x is not an integer, floor(x) used"), t !== Math.floor(t) && Se.Warn("y is not an integer, floor(y) used");
  }
  // Operators
  /**
   * Gets a new IsoVector copied from the IsoVector
   * @returns a new IsoVector
   */
  clone() {
    return new f1(this.x, this.y);
  }
  /**
   * Rotates one IsoVector 60 degrees counter clockwise about another
   * Please note that this is an in place operation
   * @param other an IsoVector a center of rotation
   * @returns the rotated IsoVector
   */
  rotate60About(e) {
    const t = this.x;
    return this.x = e.x + e.y - this.y, this.y = t + this.y - e.x, this;
  }
  /**
   * Rotates one IsoVector 60 degrees clockwise about another
   * Please note that this is an in place operation
   * @param other an IsoVector as center of rotation
   * @returns the rotated IsoVector
   */
  rotateNeg60About(e) {
    const t = this.x;
    return this.x = t + this.y - e.y, this.y = e.x + e.y - t, this;
  }
  /**
   * For an equilateral triangle OAB with O at isovector (0, 0) and A at isovector (m, n)
   * Rotates one IsoVector 120 degrees counter clockwise about the center of the triangle
   * Please note that this is an in place operation
   * @param m integer a measure a Primary triangle of order (m, n) m > n
   * @param n >= 0 integer a measure for a Primary triangle of order (m, n)
   * @returns the rotated IsoVector
   */
  rotate120(e, t) {
    e !== Math.floor(e) && Se.Warn("m not an integer only floor(m) used"), t !== Math.floor(t) && Se.Warn("n not an integer only floor(n) used");
    const r = this.x;
    return this.x = e - r - this.y, this.y = t + r, this;
  }
  /**
   * For an equilateral triangle OAB with O at isovector (0, 0) and A at isovector (m, n)
   * Rotates one IsoVector 120 degrees clockwise about the center of the triangle
   * Please note that this is an in place operation
   * @param m integer a measure a Primary triangle of order (m, n) m > n
   * @param n >= 0 integer a measure for a Primary triangle of order (m, n)
   * @returns the rotated IsoVector
   */
  rotateNeg120(e, t) {
    e !== Math.floor(e) && Se.Warn("m is not an integer, floor(m) used"), t !== Math.floor(t) && Se.Warn("n is not an integer,   floor(n) used");
    const r = this.x;
    return this.x = this.y - t, this.y = e + t - r - this.y, this;
  }
  /**
   * Transforms an IsoVector to one in Cartesian 3D space based on an isovector
   * @param origin an IsoVector
   * @param isoGridSize
   * @returns Point as a Vector3
   */
  toCartesianOrigin(e, t) {
    const r = S.Zero();
    return r.x = e.x + 2 * this.x * t + this.y * t, r.y = e.y + Math.sqrt(3) * this.y * t, r;
  }
  // Statics
  /**
   * Gets a new IsoVector(0, 0)
   * @returns a new IsoVector
   */
  static Zero() {
    return new f1(0, 0);
  }
}
class CQ {
  constructor() {
    this.cartesian = [], this.vertices = [], this.max = [], this.min = [], this.closestTo = [], this.innerFacets = [], this.isoVecsABOB = [], this.isoVecsOBOA = [], this.isoVecsBAOA = [], this.vertexTypes = [], this.IDATA = new _C("icosahedron", "Regular", [
      [0, kf, -1],
      [-kf, 1, 0],
      [-1, 0, -kf],
      [1, 0, -kf],
      [kf, 1, 0],
      [0, kf, 1],
      [-1, 0, kf],
      [-kf, -1, 0],
      [0, -kf, -1],
      [kf, -1, 0],
      [1, 0, kf],
      [0, -kf, 1]
    ], [
      [0, 2, 1],
      [0, 3, 2],
      [0, 4, 3],
      [0, 5, 4],
      [0, 1, 5],
      [7, 6, 1],
      [8, 7, 2],
      [9, 8, 3],
      [10, 9, 4],
      [6, 10, 5],
      [2, 7, 1],
      [3, 8, 2],
      [4, 9, 3],
      [5, 10, 4],
      [1, 6, 5],
      [11, 6, 7],
      [11, 7, 8],
      [11, 8, 9],
      [11, 9, 10],
      [11, 10, 6]
    ]);
  }
  /**
   * Creates the PrimaryIsoTriangle Triangle OAB
   * @param m an integer
   * @param n an integer
   */
  //operators
  setIndices() {
    let e = 12;
    const t = {}, r = this.m, n = this.n;
    let i = r, s = 1, a = 0;
    n !== 0 && (i = Xt.HCF(r, n)), s = r / i, a = n / i;
    let f, o, d, v, u;
    const l = f1.Zero(), P = new f1(r, n), p = new f1(-n, r + n), c = f1.Zero(), H = f1.Zero(), T = f1.Zero();
    let q = [], b, j, w, m;
    const I = [], N = this.vertByDist, k = (R, y, O, Y) => {
      b = R + "|" + O, j = y + "|" + Y, b in t || j in t ? b in t && !(j in t) ? t[j] = t[b] : j in t && !(b in t) && (t[b] = t[j]) : (t[b] = e, t[j] = e, e++), N[O][0] > 2 ? I[t[b]] = [-N[O][0], N[O][1], t[b]] : I[t[b]] = [q[N[O][0]], N[O][1], t[b]];
    };
    this.IDATA.edgematch = [
      [1, "B"],
      [2, "B"],
      [3, "B"],
      [4, "B"],
      [0, "B"],
      [10, "O", 14, "A"],
      [11, "O", 10, "A"],
      [12, "O", 11, "A"],
      [13, "O", 12, "A"],
      [14, "O", 13, "A"],
      [0, "O"],
      [1, "O"],
      [2, "O"],
      [3, "O"],
      [4, "O"],
      [19, "B", 5, "A"],
      [15, "B", 6, "A"],
      [16, "B", 7, "A"],
      [17, "B", 8, "A"],
      [18, "B", 9, "A"]
    ];
    for (let R = 0; R < 20; R++) {
      if (q = this.IDATA.face[R], d = q[2], v = q[1], u = q[0], w = l.x + "|" + l.y, b = R + "|" + w, b in t || (t[b] = d, I[d] = [q[N[w][0]], N[w][1]]), w = P.x + "|" + P.y, b = R + "|" + w, b in t || (t[b] = v, I[v] = [q[N[w][0]], N[w][1]]), w = p.x + "|" + p.y, b = R + "|" + w, b in t || (t[b] = u, I[u] = [q[N[w][0]], N[w][1]]), f = this.IDATA.edgematch[R][0], o = this.IDATA.edgematch[R][1], o === "B")
        for (let y = 1; y < i; y++)
          H.x = r - y * (s + a), H.y = n + y * s, T.x = -y * a, T.y = y * (s + a), w = H.x + "|" + H.y, m = T.x + "|" + T.y, k(R, f, w, m);
      if (o === "O")
        for (let y = 1; y < i; y++)
          T.x = -y * a, T.y = y * (s + a), c.x = y * s, c.y = y * a, w = T.x + "|" + T.y, m = c.x + "|" + c.y, k(R, f, w, m);
      if (f = this.IDATA.edgematch[R][2], o = this.IDATA.edgematch[R][3], o && o === "A")
        for (let y = 1; y < i; y++)
          c.x = y * s, c.y = y * a, H.x = r - (i - y) * (s + a), H.y = n + (i - y) * s, w = c.x + "|" + c.y, m = H.x + "|" + H.y, k(R, f, w, m);
      for (let y = 0; y < this.vertices.length; y++)
        w = this.vertices[y].x + "|" + this.vertices[y].y, b = R + "|" + w, b in t || (t[b] = e++, N[w][0] > 2 ? I[t[b]] = [-N[w][0], N[w][1], t[b]] : I[t[b]] = [q[N[w][0]], N[w][1], t[b]]);
    }
    this.closestTo = I, this.vecToidx = t;
  }
  calcCoeffs() {
    const e = this.m, t = this.n, r = Math.sqrt(3) / 3, n = e * e + t * t + e * t;
    this.coau = (e + t) / n, this.cobu = -t / n, this.coav = -r * (e - t) / n, this.cobv = r * (2 * e + t) / n;
  }
  createInnerFacets() {
    const e = this.m, t = this.n;
    for (let r = 0; r < t + e + 1; r++)
      for (let n = this.min[r]; n < this.max[r] + 1; n++)
        n < this.max[r] && n < this.max[r + 1] + 1 && this.innerFacets.push(["|" + n + "|" + r, "|" + n + "|" + (r + 1), "|" + (n + 1) + "|" + r]), r > 0 && n < this.max[r - 1] && n + 1 < this.max[r] + 1 && this.innerFacets.push(["|" + n + "|" + r, "|" + (n + 1) + "|" + r, "|" + (n + 1) + "|" + (r - 1)]);
  }
  edgeVecsABOB() {
    const e = this.m, t = this.n, r = new f1(-t, e + t);
    for (let n = 1; n < e + t; n++) {
      const i = new f1(this.min[n], n), s = new f1(this.min[n - 1], n - 1), a = new f1(this.min[n + 1], n + 1), f = i.clone(), o = s.clone(), d = a.clone();
      f.rotate60About(r), o.rotate60About(r), d.rotate60About(r);
      const v = new f1(this.max[f.y], f.y), u = new f1(this.max[f.y - 1], f.y - 1), l = new f1(this.max[f.y - 1] - 1, f.y - 1);
      (f.x !== v.x || f.y !== v.y) && (f.x !== u.x ? (this.vertexTypes.push([1, 0, 0]), this.isoVecsABOB.push([i, u, l]), this.vertexTypes.push([1, 0, 0]), this.isoVecsABOB.push([i, l, v])) : f.y === d.y ? (this.vertexTypes.push([1, 1, 0]), this.isoVecsABOB.push([i, s, u]), this.vertexTypes.push([1, 0, 1]), this.isoVecsABOB.push([i, u, a])) : (this.vertexTypes.push([1, 1, 0]), this.isoVecsABOB.push([i, s, u]), this.vertexTypes.push([1, 0, 0]), this.isoVecsABOB.push([i, u, v])));
    }
  }
  mapABOBtoOBOA() {
    const e = new f1(0, 0);
    for (let t = 0; t < this.isoVecsABOB.length; t++) {
      const r = [];
      for (let n = 0; n < 3; n++)
        e.x = this.isoVecsABOB[t][n].x, e.y = this.isoVecsABOB[t][n].y, this.vertexTypes[t][n] === 0 && e.rotateNeg120(this.m, this.n), r.push(e.clone());
      this.isoVecsOBOA.push(r);
    }
  }
  mapABOBtoBAOA() {
    const e = new f1(0, 0);
    for (let t = 0; t < this.isoVecsABOB.length; t++) {
      const r = [];
      for (let n = 0; n < 3; n++)
        e.x = this.isoVecsABOB[t][n].x, e.y = this.isoVecsABOB[t][n].y, this.vertexTypes[t][n] === 1 && e.rotate120(this.m, this.n), r.push(e.clone());
      this.isoVecsBAOA.push(r);
    }
  }
  // eslint-disable-next-line @typescript-eslint/naming-convention
  MapToFace(e, t) {
    const r = this.IDATA.face[e], n = r[2], i = r[1], s = r[0], a = S.FromArray(this.IDATA.vertex[n]), f = S.FromArray(this.IDATA.vertex[i]), o = S.FromArray(this.IDATA.vertex[s]), d = f.subtract(a), v = o.subtract(a), u = d.scale(this.coau).add(v.scale(this.cobu)), l = d.scale(this.coav).add(v.scale(this.cobv));
    let P, p = ue.Vector3[0];
    for (let c = 0; c < this.cartesian.length; c++)
      p = u.scale(this.cartesian[c].x).add(l.scale(this.cartesian[c].y)).add(a), p.x, p.y, p.z, P = e + "|" + this.vertices[c].x + "|" + this.vertices[c].y, t.vertex[this.vecToidx[P]] = [p.x, p.y, p.z];
  }
  //statics
  /**Creates a primary triangle
   * @internal
   */
  build(e, t) {
    const r = [], n = f1.Zero(), i = new f1(e, t), s = new f1(-t, e + t);
    r.push(n, i, s);
    for (let j = t; j < e + 1; j++)
      for (let w = 0; w < e + 1 - j; w++)
        r.push(new f1(w, j));
    if (t > 0) {
      const j = Xt.HCF(e, t), w = e / j, m = t / j;
      for (let N = 1; N < j; N++)
        r.push(new f1(N * w, N * m)), r.push(new f1(-N * m, N * (w + m))), r.push(new f1(e - N * (w + m), t + N * w));
      const I = e / t;
      for (let N = 1; N < t; N++)
        for (let k = 0; k < N * I; k++)
          r.push(new f1(k, N)), r.push(new f1(k, N).rotate120(e, t)), r.push(new f1(k, N).rotateNeg120(e, t));
    }
    r.sort((j, w) => j.x - w.x), r.sort((j, w) => j.y - w.y);
    const a = new Array(e + t + 1), f = new Array(e + t + 1);
    for (let j = 0; j < a.length; j++)
      a[j] = 1 / 0, f[j] = -1 / 0;
    let o = 0, d = 0;
    const v = r.length;
    for (let j = 0; j < v; j++)
      d = r[j].x, o = r[j].y, a[o] = Math.min(d, a[o]), f[o] = Math.max(d, f[o]);
    const u = (j, w) => {
      const m = j.clone();
      return w === "A" && m.rotateNeg120(e, t), w === "B" && m.rotate120(e, t), m.x < 0 ? m.y : m.x + m.y;
    }, l = [], P = [], p = [], c = [], H = {}, T = [];
    let q = -1, b = -1;
    for (let j = 0; j < v; j++)
      l[j] = r[j].toCartesianOrigin(new f1(0, 0), 0.5), P[j] = u(r[j], "O"), p[j] = u(r[j], "A"), c[j] = u(r[j], "B"), P[j] === p[j] && p[j] === c[j] ? (q = 3, b = P[j]) : P[j] === p[j] ? (q = 4, b = P[j]) : p[j] === c[j] ? (q = 5, b = p[j]) : c[j] === P[j] && (q = 6, b = P[j]), P[j] < p[j] && P[j] < c[j] && (q = 2, b = P[j]), p[j] < P[j] && p[j] < c[j] && (q = 1, b = p[j]), c[j] < p[j] && c[j] < P[j] && (q = 0, b = c[j]), T.push([q, b, r[j].x, r[j].y]);
    T.sort((j, w) => j[2] - w[2]), T.sort((j, w) => j[3] - w[3]), T.sort((j, w) => j[1] - w[1]), T.sort((j, w) => j[0] - w[0]);
    for (let j = 0; j < T.length; j++)
      H[T[j][2] + "|" + T[j][3]] = [T[j][0], T[j][1], j];
    return this.m = e, this.n = t, this.vertices = r, this.vertByDist = H, this.cartesian = l, this.min = a, this.max = f, this;
  }
}
class _C {
  constructor(e, t, r, n) {
    this.name = e, this.category = t, this.vertex = r, this.face = n;
  }
}
class _R extends _C {
  /**
   * @internal
   */
  innerToData(e, t) {
    for (let r = 0; r < t.innerFacets.length; r++)
      this.face.push(t.innerFacets[r].map((n) => t.vecToidx[e + n]));
  }
  /**
   * @internal
   */
  mapABOBtoDATA(e, t) {
    const r = t.IDATA.edgematch[e][0];
    for (let n = 0; n < t.isoVecsABOB.length; n++) {
      const i = [];
      for (let s = 0; s < 3; s++)
        t.vertexTypes[n][s] === 0 ? i.push(e + "|" + t.isoVecsABOB[n][s].x + "|" + t.isoVecsABOB[n][s].y) : i.push(r + "|" + t.isoVecsABOB[n][s].x + "|" + t.isoVecsABOB[n][s].y);
      this.face.push([t.vecToidx[i[0]], t.vecToidx[i[1]], t.vecToidx[i[2]]]);
    }
  }
  /**
   * @internal
   */
  mapOBOAtoDATA(e, t) {
    const r = t.IDATA.edgematch[e][0];
    for (let n = 0; n < t.isoVecsOBOA.length; n++) {
      const i = [];
      for (let s = 0; s < 3; s++)
        t.vertexTypes[n][s] === 1 ? i.push(e + "|" + t.isoVecsOBOA[n][s].x + "|" + t.isoVecsOBOA[n][s].y) : i.push(r + "|" + t.isoVecsOBOA[n][s].x + "|" + t.isoVecsOBOA[n][s].y);
      this.face.push([t.vecToidx[i[0]], t.vecToidx[i[1]], t.vecToidx[i[2]]]);
    }
  }
  /**
   * @internal
   */
  mapBAOAtoDATA(e, t) {
    const r = t.IDATA.edgematch[e][2];
    for (let n = 0; n < t.isoVecsBAOA.length; n++) {
      const i = [];
      for (let s = 0; s < 3; s++)
        t.vertexTypes[n][s] === 1 ? i.push(e + "|" + t.isoVecsBAOA[n][s].x + "|" + t.isoVecsBAOA[n][s].y) : i.push(r + "|" + t.isoVecsBAOA[n][s].x + "|" + t.isoVecsBAOA[n][s].y);
      this.face.push([t.vecToidx[i[0]], t.vecToidx[i[1]], t.vecToidx[i[2]]]);
    }
  }
  /**
   * @internal
   */
  orderData(e) {
    const t = [];
    for (let s = 0; s < 13; s++)
      t[s] = [];
    const r = e.closestTo;
    for (let s = 0; s < r.length; s++)
      r[s][0] > -1 ? r[s][1] > 0 && t[r[s][0]].push([s, r[s][1]]) : t[12].push([s, r[s][0]]);
    const n = [];
    for (let s = 0; s < 12; s++)
      n[s] = s;
    let i = 12;
    for (let s = 0; s < 12; s++) {
      t[s].sort((a, f) => a[1] - f[1]);
      for (let a = 0; a < t[s].length; a++)
        n[t[s][a][0]] = i++;
    }
    for (let s = 0; s < t[12].length; s++)
      n[t[12][s][0]] = i++;
    for (let s = 0; s < this.vertex.length; s++)
      this.vertex[s].push(n[s]);
    this.vertex.sort((s, a) => s[3] - a[3]);
    for (let s = 0; s < this.vertex.length; s++)
      this.vertex[s].pop();
    for (let s = 0; s < this.face.length; s++)
      for (let a = 0; a < this.face[s].length; a++)
        this.face[s][a] = n[this.face[s][a]];
    this.sharedNodes = t[12].length, this.poleNodes = this.vertex.length - this.sharedNodes;
  }
  /**
   * @internal
   */
  setOrder(e, t) {
    const r = [], n = [];
    let i = t.pop();
    n.push(i);
    let s = this.face[i].indexOf(e);
    s = (s + 2) % 3;
    let a = this.face[i][s];
    r.push(a);
    let f = 0;
    for (; t.length > 0; )
      i = t[f], this.face[i].indexOf(a) > -1 ? (s = (this.face[i].indexOf(a) + 1) % 3, a = this.face[i][s], r.push(a), n.push(i), t.splice(f, 1), f = 0) : f++;
    return this.adjacentFaces.push(r), n;
  }
  /**
   * @internal
   */
  toGoldbergPolyhedronData() {
    const e = new _C("GeoDual", "Goldberg", [], []);
    e.name = "GD dual";
    const t = this.vertex.length, r = new Array(t);
    for (let o = 0; o < t; o++)
      r[o] = [];
    for (let o = 0; o < this.face.length; o++)
      for (let d = 0; d < 3; d++)
        r[this.face[o][d]].push(o);
    let n = 0, i = 0, s = 0, a = [], f = [];
    this.adjacentFaces = [];
    for (let o = 0; o < r.length; o++)
      e.face[o] = this.setOrder(o, r[o].concat([])), r[o].forEach((d) => {
        n = 0, i = 0, s = 0, a = this.face[d];
        for (let v = 0; v < 3; v++)
          f = this.vertex[a[v]], n += f[0], i += f[1], s += f[2];
        e.vertex[d] = [n / 3, i / 3, s / 3];
      });
    return e;
  }
  //statics
  /**Builds the data for a Geodesic Polyhedron from a primary triangle
   * @param primTri the primary triangle
   * @internal
   */
  static BuildGeodesicData(e) {
    const t = new _R("Geodesic-m-n", "Geodesic", [
      [0, kf, -1],
      [-kf, 1, 0],
      [-1, 0, -kf],
      [1, 0, -kf],
      [kf, 1, 0],
      [0, kf, 1],
      [-1, 0, kf],
      [-kf, -1, 0],
      [0, -kf, -1],
      [kf, -1, 0],
      [1, 0, kf],
      [0, -kf, 1]
    ], []);
    e.setIndices(), e.calcCoeffs(), e.createInnerFacets(), e.edgeVecsABOB(), e.mapABOBtoOBOA(), e.mapABOBtoBAOA();
    for (let n = 0; n < e.IDATA.face.length; n++)
      e.MapToFace(n, t), t.innerToData(n, e), e.IDATA.edgematch[n][1] === "B" && t.mapABOBtoDATA(n, e), e.IDATA.edgematch[n][1] === "O" && t.mapOBOAtoDATA(n, e), e.IDATA.edgematch[n][3] === "A" && t.mapBAOAtoDATA(n, e);
    t.orderData(e);
    const r = 1;
    return t.vertex = t.vertex.map(function(n) {
      const i = n[0], s = n[1], a = n[2], f = Math.sqrt(i * i + s * s + a * a);
      return n[0] *= r / f, n[1] *= r / f, n[2] *= r / f, n;
    }), t;
  }
}
function rte(A, e, t = null) {
  let r = e.m || 1;
  r !== Math.floor(r) && Se.Warn("m not an integer only floor(m) used");
  let n = e.n || 0;
  if (n !== Math.floor(n) && Se.Warn("n not an integer only floor(n) used"), n > r) {
    const o = n;
    n = r, r = o, Se.Warn("n > m therefore m and n swapped");
  }
  const i = new CQ();
  i.build(r, n);
  const a = {
    custom: _R.BuildGeodesicData(i),
    size: e.size,
    sizeX: e.sizeX,
    sizeY: e.sizeY,
    sizeZ: e.sizeZ,
    faceUV: e.faceUV,
    faceColors: e.faceColors,
    flat: e.flat,
    updatable: e.updatable,
    sideOrientation: e.sideOrientation,
    frontUVs: e.frontUVs,
    backUVs: e.backUVs
  };
  return hm(A, a, t);
}
Ee._GoldbergMeshParser = (A, e) => $R.Parse(A, e);
class $R extends Ee {
  constructor() {
    super(...arguments), this.goldbergData = {
      faceColors: [],
      faceCenters: [],
      faceZaxis: [],
      faceXaxis: [],
      faceYaxis: [],
      nbSharedFaces: 0,
      nbUnsharedFaces: 0,
      nbFaces: 0,
      nbFacesAtPole: 0,
      adjacentFaces: []
    };
  }
  /**
   * Gets the related Goldberg face from pole infos
   * @param poleOrShared Defines the pole index or the shared face index if the fromPole parameter is passed in
   * @param fromPole Defines an optional pole index to find the related info from
   * @returns the goldberg face number
   */
  relatedGoldbergFace(e, t) {
    return t === void 0 ? (e > this.goldbergData.nbUnsharedFaces - 1 && (Se.Warn("Maximum number of unshared faces used"), e = this.goldbergData.nbUnsharedFaces - 1), this.goldbergData.nbUnsharedFaces + e) : (e > 11 && (Se.Warn("Last pole used"), e = 11), t > this.goldbergData.nbFacesAtPole - 1 && (Se.Warn("Maximum number of faces at a pole used"), t = this.goldbergData.nbFacesAtPole - 1), 12 + e * this.goldbergData.nbFacesAtPole + t);
  }
  _changeGoldbergFaceColors(e) {
    for (let r = 0; r < e.length; r++) {
      const n = e[r][0], i = e[r][1], s = e[r][2];
      for (let a = n; a < i + 1; a++)
        this.goldbergData.faceColors[a] = s;
    }
    const t = [];
    for (let r = 0; r < 12; r++)
      for (let n = 0; n < 5; n++)
        t.push(this.goldbergData.faceColors[r].r, this.goldbergData.faceColors[r].g, this.goldbergData.faceColors[r].b, this.goldbergData.faceColors[r].a);
    for (let r = 12; r < this.goldbergData.faceColors.length; r++)
      for (let n = 0; n < 6; n++)
        t.push(this.goldbergData.faceColors[r].r, this.goldbergData.faceColors[r].g, this.goldbergData.faceColors[r].b, this.goldbergData.faceColors[r].a);
    return t;
  }
  /**
   * Set new goldberg face colors
   * @param colorRange the new color to apply to the mesh
   */
  setGoldbergFaceColors(e) {
    const t = this._changeGoldbergFaceColors(e);
    this.setVerticesData(J.ColorKind, t);
  }
  /**
   * Updates new goldberg face colors
   * @param colorRange the new color to apply to the mesh
   */
  updateGoldbergFaceColors(e) {
    const t = this._changeGoldbergFaceColors(e);
    this.updateVerticesData(J.ColorKind, t);
  }
  _changeGoldbergFaceUVs(e) {
    const t = this.getVerticesData(J.UVKind);
    for (let r = 0; r < e.length; r++) {
      const n = e[r][0], i = e[r][1], s = e[r][2], a = e[r][3], f = e[r][4], o = [], d = [];
      let v, u;
      for (let l = 0; l < 5; l++)
        v = s.x + a * Math.cos(f + l * Math.PI / 2.5), u = s.y + a * Math.sin(f + l * Math.PI / 2.5), v < 0 && (v = 0), v > 1 && (v = 1), o.push(v, u);
      for (let l = 0; l < 6; l++)
        v = s.x + a * Math.cos(f + l * Math.PI / 3), u = s.y + a * Math.sin(f + l * Math.PI / 3), v < 0 && (v = 0), v > 1 && (v = 1), d.push(v, u);
      for (let l = n; l < Math.min(12, i + 1); l++)
        for (let P = 0; P < 5; P++)
          t[10 * l + 2 * P] = o[2 * P], t[10 * l + 2 * P + 1] = o[2 * P + 1];
      for (let l = Math.max(12, n); l < i + 1; l++)
        for (let P = 0; P < 6; P++)
          t[12 * l - 24 + 2 * P] = d[2 * P], t[12 * l - 23 + 2 * P] = d[2 * P + 1];
    }
    return t;
  }
  /**
   * set new goldberg face UVs
   * @param uvRange the new UVs to apply to the mesh
   */
  setGoldbergFaceUVs(e) {
    const t = this._changeGoldbergFaceUVs(e);
    this.setVerticesData(J.UVKind, t);
  }
  /**
   * Updates new goldberg face UVs
   * @param uvRange the new UVs to apply to the mesh
   */
  updateGoldbergFaceUVs(e) {
    const t = this._changeGoldbergFaceUVs(e);
    this.updateVerticesData(J.UVKind, t);
  }
  /**
   * Places a mesh on a particular face of the goldberg polygon
   * @param mesh Defines the mesh to position
   * @param face Defines the face to position onto
   * @param position Defines the position relative to the face we are positioning the mesh onto
   */
  placeOnGoldbergFaceAt(e, t, r) {
    const n = S.RotationFromAxis(this.goldbergData.faceXaxis[t], this.goldbergData.faceYaxis[t], this.goldbergData.faceZaxis[t]);
    e.rotation = n, e.position = this.goldbergData.faceCenters[t].add(this.goldbergData.faceXaxis[t].scale(r.x)).add(this.goldbergData.faceYaxis[t].scale(r.y)).add(this.goldbergData.faceZaxis[t].scale(r.z));
  }
  /**
   * Serialize current mesh
   * @param serializationObject defines the object which will receive the serialization data
   */
  serialize(e) {
    super.serialize(e), e.type = "GoldbergMesh";
    const t = {};
    if (t.adjacentFaces = this.goldbergData.adjacentFaces, t.nbSharedFaces = this.goldbergData.nbSharedFaces, t.nbUnsharedFaces = this.goldbergData.nbUnsharedFaces, t.nbFaces = this.goldbergData.nbFaces, t.nbFacesAtPole = this.goldbergData.nbFacesAtPole, this.goldbergData.faceColors) {
      t.faceColors = [];
      for (const r of this.goldbergData.faceColors)
        t.faceColors.push(r.asArray());
    }
    if (this.goldbergData.faceCenters) {
      t.faceCenters = [];
      for (const r of this.goldbergData.faceCenters)
        t.faceCenters.push(r.asArray());
    }
    if (this.goldbergData.faceZaxis) {
      t.faceZaxis = [];
      for (const r of this.goldbergData.faceZaxis)
        t.faceZaxis.push(r.asArray());
    }
    if (this.goldbergData.faceYaxis) {
      t.faceYaxis = [];
      for (const r of this.goldbergData.faceYaxis)
        t.faceYaxis.push(r.asArray());
    }
    if (this.goldbergData.faceXaxis) {
      t.faceXaxis = [];
      for (const r of this.goldbergData.faceXaxis)
        t.faceXaxis.push(r.asArray());
    }
    e.goldbergData = t;
  }
  /**
   * Parses a serialized goldberg mesh
   * @param parsedMesh the serialized mesh
   * @param scene the scene to create the goldberg mesh in
   * @returns the created goldberg mesh
   */
  static Parse(e, t) {
    const r = e.goldbergData;
    r.faceColors = r.faceColors.map((i) => xt.FromArray(i)), r.faceCenters = r.faceCenters.map((i) => S.FromArray(i)), r.faceZaxis = r.faceZaxis.map((i) => S.FromArray(i)), r.faceXaxis = r.faceXaxis.map((i) => S.FromArray(i)), r.faceYaxis = r.faceYaxis.map((i) => S.FromArray(i));
    const n = new $R(e.name, t);
    return n.goldbergData = r, n;
  }
}
function nte(A, e) {
  const t = A.size, r = A.sizeX || t || 1, n = A.sizeY || t || 1, i = A.sizeZ || t || 1, s = A.sideOrientation === 0 ? 0 : A.sideOrientation || Ut.DEFAULTSIDE, a = [], f = [], o = [], d = [];
  let v = 1 / 0, u = -1 / 0, l = 1 / 0, P = -1 / 0;
  for (let H = 0; H < e.vertex.length; H++)
    v = Math.min(v, e.vertex[H][0] * r), u = Math.max(u, e.vertex[H][0] * r), l = Math.min(l, e.vertex[H][1] * n), P = Math.max(P, e.vertex[H][1] * n);
  let p = 0;
  for (let H = 0; H < e.face.length; H++) {
    const T = e.face[H], q = S.FromArray(e.vertex[T[0]]), b = S.FromArray(e.vertex[T[2]]), j = S.FromArray(e.vertex[T[1]]), w = b.subtract(q), m = j.subtract(q), I = S.Cross(m, w).normalize();
    for (let N = 0; N < T.length; N++) {
      o.push(I.x, I.y, I.z);
      const k = e.vertex[T[N]];
      a.push(k[0] * r, k[1] * n, k[2] * i);
      const R = (k[1] * n - l) / (P - l);
      d.push((k[0] * r - v) / (u - v), us.UseOpenGLOrientationForUV ? 1 - R : R);
    }
    for (let N = 0; N < T.length - 2; N++)
      f.push(p, p + N + 2, p + N + 1);
    p += T.length;
  }
  Ut._ComputeSides(s, a, f, o, d);
  const c = new Ut();
  return c.positions = a, c.indices = f, c.normals = o, c.uvs = d, c;
}
function ite(A, e, t = null) {
  const r = e.size, n = e.sizeX || r || 1, i = e.sizeY || r || 1, s = e.sizeZ || r || 1;
  let a = e.m || 1;
  a !== Math.floor(a) && Se.Warn("m not an integer only floor(m) used");
  let f = e.n || 0;
  if (f !== Math.floor(f) && Se.Warn("n not an integer only floor(n) used"), f > a) {
    const P = f;
    f = a, a = P, Se.Warn("n > m therefore m and n swapped");
  }
  const o = new CQ();
  o.build(a, f);
  const d = _R.BuildGeodesicData(o), v = d.toGoldbergPolyhedronData(), u = new $R(A, t);
  e.sideOrientation = Ee._GetDefaultSideOrientation(e.sideOrientation), u._originalBuilderSideOrientation = e.sideOrientation, nte(e, v).applyToMesh(u, e.updatable), u.goldbergData.nbSharedFaces = d.sharedNodes, u.goldbergData.nbUnsharedFaces = d.poleNodes, u.goldbergData.adjacentFaces = d.adjacentFaces, u.goldbergData.nbFaces = u.goldbergData.nbSharedFaces + u.goldbergData.nbUnsharedFaces, u.goldbergData.nbFacesAtPole = (u.goldbergData.nbUnsharedFaces - 12) / 12;
  for (let P = 0; P < d.vertex.length; P++)
    u.goldbergData.faceCenters.push(S.FromArray(d.vertex[P])), u.goldbergData.faceCenters[P].x *= n, u.goldbergData.faceCenters[P].y *= i, u.goldbergData.faceCenters[P].z *= s, u.goldbergData.faceColors.push(new xt(1, 1, 1, 1));
  for (let P = 0; P < v.face.length; P++) {
    const p = v.face[P], c = S.FromArray(v.vertex[p[0]]), H = S.FromArray(v.vertex[p[2]]), T = S.FromArray(v.vertex[p[1]]), q = H.subtract(c), b = T.subtract(c), j = S.Cross(b, q).normalize(), w = S.Cross(b, j).normalize();
    u.goldbergData.faceXaxis.push(b.normalize()), u.goldbergData.faceYaxis.push(j), u.goldbergData.faceZaxis.push(w);
  }
  return u;
}
class nue {
  /** Create the ShapePath used to support glyphs */
  constructor(e) {
    this._paths = [], this._tempPaths = [], this._holes = [], this._resolution = e;
  }
  /** Move the virtual cursor to a coordinate */
  moveTo(e, t) {
    this._currentPath = new sU(e, t), this._tempPaths.push(this._currentPath);
  }
  /** Draw a line from the virtual cursor to a given coordinate */
  lineTo(e, t) {
    this._currentPath.addLineTo(e, t);
  }
  /** Create a quadratic curve from the virtual cursor to a given coordinate */
  quadraticCurveTo(e, t, r, n) {
    this._currentPath.addQuadraticCurveTo(e, t, r, n, this._resolution);
  }
  /** Create a bezier curve from the virtual cursor to a given coordinate */
  bezierCurveTo(e, t, r, n, i, s) {
    this._currentPath.addBezierCurveTo(e, t, r, n, i, s, this._resolution);
  }
  /** Extract holes based on CW / CCW */
  extractHoles() {
    for (const e of this._tempPaths)
      e.area() > 0 ? this._holes.push(e) : this._paths.push(e);
    if (!this._paths.length && this._holes.length) {
      const e = this._holes;
      this._holes = this._paths, this._paths = e;
    }
    this._tempPaths.length = 0;
  }
  /** Gets the list of paths */
  get paths() {
    return this._paths;
  }
  /** Gets the list of holes */
  get holes() {
    return this._holes;
  }
}
function iue(A, e, t, r, n, i) {
  const s = i.glyphs[A] || i.glyphs["?"];
  if (!s)
    return null;
  const a = new nue(n);
  if (s.o) {
    const f = s.o.split(" ");
    for (let o = 0, d = f.length; o < d; )
      switch (f[o++]) {
        case "m": {
          const u = parseInt(f[o++]) * e + t, l = parseInt(f[o++]) * e + r;
          a.moveTo(u, l);
          break;
        }
        case "l": {
          const u = parseInt(f[o++]) * e + t, l = parseInt(f[o++]) * e + r;
          a.lineTo(u, l);
          break;
        }
        case "q": {
          const u = parseInt(f[o++]) * e + t, l = parseInt(f[o++]) * e + r, P = parseInt(f[o++]) * e + t, p = parseInt(f[o++]) * e + r;
          a.quadraticCurveTo(P, p, u, l);
          break;
        }
        case "b": {
          const u = parseInt(f[o++]) * e + t, l = parseInt(f[o++]) * e + r, P = parseInt(f[o++]) * e + t, p = parseInt(f[o++]) * e + r, c = parseInt(f[o++]) * e + t, H = parseInt(f[o++]) * e + r;
          a.bezierCurveTo(P, p, c, H, u, l);
          break;
        }
      }
  }
  return a.extractHoles(), { offsetX: s.ha * e, shapePath: a };
}
function OQ(A, e, t, r) {
  const n = Array.from(A), i = e / r.resolution, s = (r.boundingBox.yMax - r.boundingBox.yMin + r.underlineThickness) * i, a = [];
  let f = 0, o = 0;
  for (let d = 0; d < n.length; d++) {
    const v = n[d];
    if (v === `
`)
      f = 0, o -= s;
    else {
      const u = iue(v, i, f, o, t, r);
      u && (f += u.offsetX, a.push(u.shapePath));
    }
  }
  return a;
}
function ste(A, e, t, r = {
  size: 50,
  resolution: 8,
  depth: 1
}, n = null, i = earcut) {
  var s, a;
  const f = OQ(e, r.size || 50, r.resolution || 8, t), o = [];
  let d = 0;
  for (const u of f) {
    if (!u.paths.length)
      continue;
    const l = u.holes.slice();
    for (const P of u.paths) {
      const p = [], c = [], H = P.getPoints();
      for (const b of H)
        c.push(new S(b.x, 0, b.y));
      const T = l.slice();
      for (const b of T) {
        const j = b.getPoints();
        let w = !1;
        for (const I of j)
          if (P.isPointInside(I)) {
            w = !0;
            break;
          }
        if (!w)
          continue;
        const m = [];
        for (const I of j)
          m.push(new S(I.x, 0, I.y));
        p.push(m), l.splice(l.indexOf(b), 1);
      }
      if (!p.length && l.length)
        for (const b of l) {
          const j = b.getPoints(), w = [];
          for (const m of j)
            w.push(new S(m.x, 0, m.y));
          p.push(w);
        }
      const q = zR(A, {
        shape: c,
        holes: p.length ? p : void 0,
        depth: r.depth || 1,
        faceUV: r.faceUV || ((s = r.perLetterFaceUV) === null || s === void 0 ? void 0 : s.call(r, d)),
        faceColors: r.faceColors || ((a = r.perLetterFaceColors) === null || a === void 0 ? void 0 : a.call(r, d)),
        sideOrientation: Ee._GetDefaultSideOrientation(r.sideOrientation || Ee.DOUBLESIDE)
      }, n, i);
      o.push(q), d++;
    }
  }
  const v = Ee.MergeMeshes(o, !0, !0);
  if (v) {
    const u = v.getBoundingInfo().boundingBox;
    v.position.x += -(u.minimumWorld.x + u.maximumWorld.x) / 2, v.position.y += -(u.minimumWorld.y + u.maximumWorld.y) / 2, v.position.z += -(u.minimumWorld.z + u.maximumWorld.z) / 2 + u.extendSize.z, v.name = A;
    const l = new Hr("pivot", n);
    l.rotation.x = -Math.PI / 2, v.parent = l, v.bakeCurrentTransformIntoVertices(), v.parent = null, l.dispose();
  }
  return v;
}
const Ef = {
  CreateBox: k0,
  CreateTiledBox: BQ,
  CreateSphere: UA,
  CreateDisc: uU,
  CreateIcoSphere: UR,
  CreateRibbon: n4,
  CreateCylinder: Ld,
  CreateTorus: Ag,
  CreateTorusKnot: GO,
  CreateLineSystem: rm,
  CreateLines: ka,
  CreateDashedLines: ZO,
  ExtrudeShape: GR,
  ExtrudeShapeCustom: ZR,
  CreateLathe: _O,
  CreateTiledPlane: wQ,
  CreatePlane: u4,
  CreateGround: Wm,
  CreateTiledGround: FO,
  CreateGroundFromHeightMap: NO,
  CreatePolygon: JR,
  ExtrudePolygon: zR,
  CreateTube: $O,
  CreatePolyhedron: hm,
  CreateGeodesic: rte,
  CreateGoldberg: ite,
  CreateDecal: ey,
  CreateCapsule: KR,
  CreateText: ste
};
class sue {
  /**
   * Creates a new PhysicsViewer
   * @param scene defines the hosting scene
   */
  constructor(e) {
    if (this._impostors = [], this._meshes = [], this._bodies = [], this._inertiaBodies = [], this._constraints = [], this._bodyMeshes = [], this._inertiaMeshes = [], this._constraintMeshes = [], this._numMeshes = 0, this._numBodies = 0, this._numInertiaBodies = 0, this._numConstraints = 0, this._debugMeshMeshes = new Array(), this._constraintAxesSize = 0.4, this._scene = e || gr.LastCreatedScene, !this._scene)
      return;
    const t = this._scene.getPhysicsEngine();
    t && (this._physicsEnginePlugin = t.getPhysicsPlugin()), this._utilityLayer = new Ds(this._scene, !1), this._utilityLayer.pickUtilitySceneFirst = !1, this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = !0;
  }
  /**
   * Updates the debug meshes of the physics engine.
   *
   * This code is useful for synchronizing the debug meshes of the physics engine with the physics impostor and mesh.
   * It checks if the impostor is disposed and if the plugin version is 1, then it syncs the mesh with the impostor.
   * This ensures that the debug meshes are up to date with the physics engine.
   */
  _updateDebugMeshes() {
    const e = this._physicsEnginePlugin;
    (e == null ? void 0 : e.getPluginVersion()) === 1 ? this._updateDebugMeshesV1() : this._updateDebugMeshesV2();
  }
  /**
   * Updates the debug meshes of the physics engine.
   *
   * This method is useful for synchronizing the debug meshes with the physics impostors.
   * It iterates through the impostors and meshes, and if the plugin version is 1, it syncs the mesh with the impostor.
   * This ensures that the debug meshes accurately reflect the physics impostors, which is important for debugging the physics engine.
   */
  _updateDebugMeshesV1() {
    const e = this._physicsEnginePlugin;
    for (let t = 0; t < this._numMeshes; t++) {
      const r = this._impostors[t];
      if (r)
        if (r.isDisposed)
          this.hideImpostor(this._impostors[t--]);
        else {
          if (r.type === tn.MeshImpostor)
            continue;
          const n = this._meshes[t];
          n && e && e.syncMeshWithImpostor(n, r);
        }
    }
  }
  /**
   * Updates the debug meshes of the physics engine for V2 plugin.
   *
   * This method is useful for synchronizing the debug meshes of the physics engine with the current state of the bodies.
   * It iterates through the bodies array and updates the debug meshes with the current transform of each body.
   * This ensures that the debug meshes accurately reflect the current state of the physics engine.
   */
  _updateDebugMeshesV2() {
    const e = this._physicsEnginePlugin;
    for (let t = 0; t < this._numBodies; t++) {
      const r = this._bodies[t], n = this._bodyMeshes[t];
      r && n && e.syncTransform(r, n);
    }
  }
  _updateInertiaMeshes() {
    for (let e = 0; e < this._numInertiaBodies; e++) {
      const t = this._inertiaBodies[e], r = this._inertiaMeshes[e];
      t && r && this._updateDebugInertia(t, r);
    }
  }
  _updateDebugInertia(e, t) {
    var r;
    const n = he.Identity(), i = he.Identity(), s = he.Identity();
    if (e._pluginDataInstances.length) {
      const a = t, f = a._thinInstanceDataStorage.matrixData, o = e.transformNode._thinInstanceDataStorage.matrixData;
      for (let d = 0; d < e._pluginDataInstances.length; d++) {
        const v = e.getMassProperties(d);
        this._getMeshDebugInertiaMatrixToRef(v, n), he.FromArrayToRef(o, d * 16, i), n.multiplyToRef(i, s), s.copyToArray(f, d * 16);
      }
      a.thinInstanceBufferUpdated("matrix");
    } else {
      const a = e.getMassProperties();
      if (this._getMeshDebugInertiaMatrixToRef(a, n), (r = e.transformNode.rotationQuaternion) === null || r === void 0 || r.toRotationMatrix(i), i.setTranslation(e.transformNode.position), e.transformNode.parent) {
        const f = e.transformNode.parent.computeWorldMatrix(!0);
        i.multiplyToRef(f, i);
      }
      n.multiplyToRef(i, n), n.decomposeToTransformNode(t);
    }
  }
  _updateDebugConstraints() {
    for (let e = 0; e < this._numConstraints; e++) {
      const t = this._constraints[e], r = this._constraintMeshes[e];
      t && r && this._updateDebugConstraint(t, r);
    }
  }
  /**
   * Given a scaling vector, make all of its components
   * 1, preserving the sign
   * @param scaling
   */
  _makeScalingUnitInPlace(e) {
    Math.abs(e.x - 1) > Dn && (e.x = 1 * Math.sign(e.x)), Math.abs(e.y - 1) > Dn && (e.y = 1 * Math.sign(e.y)), Math.abs(e.z - 1) > Dn && (e.z = 1 * Math.sign(e.z));
  }
  _updateDebugConstraint(e, t) {
    if (!e._initOptions)
      return;
    const { pivotA: r, pivotB: n, axisA: i, axisB: s, perpAxisA: a, perpAxisB: f } = e._initOptions;
    !r || !n || !i || !s || !a || !f || t.getDescendants(!0).forEach((o) => {
      const d = o.getDescendants(!0)[0], v = o.getDescendants(!0)[1], { parentBody: u, parentBodyIndex: l } = d.metadata, { childBody: P, childBodyIndex: p } = v.metadata, c = this._getTransformFromBodyToRef(u, ue.Matrix[0], l), H = this._getTransformFromBodyToRef(P, ue.Matrix[1], p);
      c.decomposeToTransformNode(d), this._makeScalingUnitInPlace(d.scaling), H.decomposeToTransformNode(v), this._makeScalingUnitInPlace(v.scaling);
      const T = d.getDescendants(!0)[0];
      T.position.copyFrom(r);
      const q = v.getDescendants(!0)[0];
      q.position.copyFrom(n), Ze.FromRotationMatrixToRef(he.FromXYZAxesToRef(i, a, S.CrossToRef(i, a, ue.Vector3[0]), ue.Matrix[0]), T.rotationQuaternion), Ze.FromRotationMatrixToRef(he.FromXYZAxesToRef(s, f, S.CrossToRef(s, f, ue.Vector3[1]), ue.Matrix[1]), q.rotationQuaternion);
    });
  }
  /**
   * Renders a specified physic impostor
   * @param impostor defines the impostor to render
   * @param targetMesh defines the mesh represented by the impostor
   * @returns the new debug mesh used to render the impostor
   */
  showImpostor(e, t) {
    if (!this._scene)
      return null;
    for (let n = 0; n < this._numMeshes; n++)
      if (this._impostors[n] == e)
        return null;
    const r = this._getDebugMesh(e, t);
    return r && (this._impostors[this._numMeshes] = e, this._meshes[this._numMeshes] = r, this._numMeshes === 0 && (this._renderFunction = () => this._updateDebugMeshes(), this._scene.registerBeforeRender(this._renderFunction)), this._numMeshes++), r;
  }
  /**
   * Shows a debug mesh for a given physics body.
   * @param body The physics body to show.
   * @returns The debug mesh, or null if the body is already shown.
   *
   * This function is useful for visualizing the physics body in the scene.
   * It creates a debug mesh for the given body and adds it to the scene.
   * It also registers a before render function to update the debug mesh position and rotation.
   */
  showBody(e) {
    if (!this._scene)
      return null;
    for (let r = 0; r < this._numBodies; r++)
      if (this._bodies[r] == e)
        return null;
    const t = this._getDebugBodyMesh(e);
    return t && (this._bodies[this._numBodies] = e, this._bodyMeshes[this._numBodies] = t, this._numBodies === 0 && (this._renderFunction = () => this._updateDebugMeshes(), this._scene.registerBeforeRender(this._renderFunction)), this._numBodies++), t;
  }
  /**
   * Shows a debug box corresponding to the inertia of a given body
   * @param body
   */
  showInertia(e) {
    if (!this._scene)
      return null;
    for (let r = 0; r < this._numInertiaBodies; r++)
      if (this._inertiaBodies[r] == e)
        return null;
    const t = this._getDebugInertiaMesh(e);
    return t && (this._inertiaBodies[this._numInertiaBodies] = e, this._inertiaMeshes[this._numInertiaBodies] = t, this._numInertiaBodies === 0 && (this._inertiaRenderFunction = () => this._updateInertiaMeshes(), this._scene.registerBeforeRender(this._inertiaRenderFunction)), this._numInertiaBodies++), t;
  }
  /**
   * Shows a debug mesh for a given physics constraint.
   * @param constraint the physics constraint to show
   * @returns the debug mesh, or null if the constraint is already shown
   */
  showConstraint(e) {
    if (!this._scene)
      return null;
    for (let r = 0; r < this._numConstraints; r++)
      if (this._constraints[r] == e)
        return null;
    const t = this._getDebugConstraintMesh(e);
    return t && (this._constraints[this._numConstraints] = e, this._constraintMeshes[this._numConstraints] = t, this._numConstraints === 0 && (this._constraintRenderFunction = () => this._updateDebugConstraints(), this._scene.registerBeforeRender(this._constraintRenderFunction)), this._numConstraints++), t;
  }
  /**
   * Hides an impostor from the scene.
   * @param impostor - The impostor to hide.
   *
   * This method is useful for hiding an impostor from the scene. It removes the
   * impostor from the utility layer scene, disposes the mesh, and removes the
   * impostor from the list of impostors. If the impostor is the last one in the
   * list, it also unregisters the render function.
   */
  hideImpostor(e) {
    if (!e || !this._scene || !this._utilityLayer)
      return;
    let t = !1;
    const r = this._utilityLayer.utilityLayerScene;
    for (let n = 0; n < this._numMeshes; n++)
      if (this._impostors[n] == e) {
        const i = this._meshes[n];
        if (!i)
          continue;
        r.removeMesh(i), i.dispose();
        const s = this._debugMeshMeshes.indexOf(i);
        s > -1 && this._debugMeshMeshes.splice(s, 1), this._numMeshes--, this._numMeshes > 0 ? (this._meshes[n] = this._meshes[this._numMeshes], this._impostors[n] = this._impostors[this._numMeshes], this._meshes[this._numMeshes] = null, this._impostors[this._numMeshes] = null) : (this._meshes[0] = null, this._impostors[0] = null), t = !0;
        break;
      }
    t && this._numMeshes === 0 && this._scene.unregisterBeforeRender(this._renderFunction);
  }
  /**
   * Hides a body from the physics engine.
   * @param body - The body to hide.
   *
   * This function is useful for hiding a body from the physics engine.
   * It removes the body from the utility layer scene and disposes the mesh associated with it.
   * It also unregisters the render function if the number of bodies is 0.
   * This is useful for hiding a body from the physics engine without deleting it.
   */
  hideBody(e) {
    if (!e || !this._scene || !this._utilityLayer)
      return;
    let t = !1;
    const r = this._utilityLayer.utilityLayerScene;
    for (let n = 0; n < this._numBodies; n++)
      if (this._bodies[n] === e) {
        const i = this._bodyMeshes[n];
        if (!i)
          continue;
        r.removeMesh(i), i.dispose(), this._numBodies--, this._numBodies > 0 ? (this._bodyMeshes[n] = this._bodyMeshes[this._numBodies], this._bodies[n] = this._bodies[this._numBodies], this._bodyMeshes[this._numBodies] = null, this._bodies[this._numBodies] = null) : (this._bodyMeshes[0] = null, this._bodies[0] = null), t = !0;
        break;
      }
    t && this._numBodies === 0 && this._scene.unregisterBeforeRender(this._renderFunction);
  }
  hideInertia(e) {
    if (!e || !this._scene || !this._utilityLayer)
      return;
    let t = !1;
    const r = this._utilityLayer.utilityLayerScene;
    for (let n = 0; n < this._numInertiaBodies; n++)
      if (this._inertiaBodies[n] === e) {
        const i = this._inertiaMeshes[n];
        if (!i)
          continue;
        r.removeMesh(i), i.dispose(), this._inertiaBodies.splice(n, 1), this._inertiaMeshes.splice(n, 1), this._numInertiaBodies--, t = !0;
        break;
      }
    t && this._numInertiaBodies === 0 && this._scene.unregisterBeforeRender(this._inertiaRenderFunction);
  }
  /**
   * Hide a physics constraint from the viewer utility layer
   * @param constraint the constraint to hide
   */
  hideConstraint(e) {
    if (!e || !this._scene || !this._utilityLayer)
      return;
    let t = !1;
    const r = this._utilityLayer.utilityLayerScene;
    for (let n = 0; n < this._numConstraints; n++)
      if (this._constraints[n] === e) {
        const i = this._constraintMeshes[n];
        if (!i)
          continue;
        r.removeMesh(i), i.dispose(), this._constraints.splice(n, 1), this._constraintMeshes.splice(n, 1), this._numConstraints--, this._numConstraints > 0 ? (this._constraints[n] = this._constraints[this._numConstraints], this._constraintMeshes[n] = this._constraintMeshes[this._numConstraints], this._constraints[this._numConstraints] = null, this._constraintMeshes[this._numConstraints] = null) : (this._constraints[0] = null, this._constraintMeshes[0] = null), t = !0;
        break;
      }
    t && this._numConstraints === 0 && this._scene.unregisterBeforeRender(this._constraintRenderFunction);
  }
  _getDebugMaterial(e) {
    return this._debugMaterial || (this._debugMaterial = new Wt("", e), this._debugMaterial.wireframe = !0, this._debugMaterial.emissiveColor = Ne.White(), this._debugMaterial.disableLighting = !0), this._debugMaterial;
  }
  _getDebugInertiaMaterial(e) {
    return this._debugInertiaMaterial || (this._debugInertiaMaterial = new Wt("", e), this._debugInertiaMaterial.disableLighting = !0, this._debugInertiaMaterial.alpha = 0), this._debugInertiaMaterial;
  }
  _getDebugBoxMesh(e) {
    return this._debugBoxMesh || (this._debugBoxMesh = k0("physicsBodyBoxViewMesh", { size: 1 }, e), this._debugBoxMesh.rotationQuaternion = Ze.Identity(), this._debugBoxMesh.material = this._getDebugMaterial(e), this._debugBoxMesh.setEnabled(!1)), this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance");
  }
  _getDebugSphereMesh(e) {
    return this._debugSphereMesh || (this._debugSphereMesh = UA("physicsBodySphereViewMesh", { diameter: 1 }, e), this._debugSphereMesh.rotationQuaternion = Ze.Identity(), this._debugSphereMesh.material = this._getDebugMaterial(e), this._debugSphereMesh.setEnabled(!1)), this._debugSphereMesh.createInstance("physicsBodySphereViewInstance");
  }
  _getDebugCapsuleMesh(e) {
    return this._debugCapsuleMesh || (this._debugCapsuleMesh = KR("physicsBodyCapsuleViewMesh", { height: 1 }, e), this._debugCapsuleMesh.rotationQuaternion = Ze.Identity(), this._debugCapsuleMesh.material = this._getDebugMaterial(e), this._debugCapsuleMesh.setEnabled(!1)), this._debugCapsuleMesh.createInstance("physicsBodyCapsuleViewInstance");
  }
  _getDebugCylinderMesh(e) {
    return this._debugCylinderMesh || (this._debugCylinderMesh = Ld("physicsBodyCylinderViewMesh", { diameterTop: 1, diameterBottom: 1, height: 1 }, e), this._debugCylinderMesh.rotationQuaternion = Ze.Identity(), this._debugCylinderMesh.material = this._getDebugMaterial(e), this._debugCylinderMesh.setEnabled(!1)), this._debugCylinderMesh.createInstance("physicsBodyCylinderViewInstance");
  }
  _getDebugMeshMesh(e, t) {
    const r = new Ee(e.name, t, null, e);
    return r.setParent(e), r.position = S.Zero(), r.material = this._getDebugMaterial(t), this._debugMeshMeshes.push(r), r;
  }
  _getDebugMesh(e, t) {
    if (!this._utilityLayer || t && t.parent && t.parent.physicsImpostor)
      return null;
    let r = null;
    const n = this._utilityLayer.utilityLayerScene;
    if (!e.physicsBody)
      return Se.Warn("Unable to get physicsBody of impostor. It might be initialized later by its parent's impostor."), null;
    switch (e.type) {
      case tn.BoxImpostor:
        r = this._getDebugBoxMesh(n), e.getBoxSizeToRef(r.scaling);
        break;
      case tn.SphereImpostor: {
        r = this._getDebugSphereMesh(n);
        const i = e.getRadius();
        r.scaling.x = i * 2, r.scaling.y = i * 2, r.scaling.z = i * 2;
        break;
      }
      case tn.CapsuleImpostor: {
        r = this._getDebugCapsuleMesh(n);
        const i = e.object.getBoundingInfo();
        r.scaling.x = (i.boundingBox.maximum.x - i.boundingBox.minimum.x) * 2 * e.object.scaling.x, r.scaling.y = (i.boundingBox.maximum.y - i.boundingBox.minimum.y) * e.object.scaling.y, r.scaling.z = (i.boundingBox.maximum.z - i.boundingBox.minimum.z) * 2 * e.object.scaling.z;
        break;
      }
      case tn.MeshImpostor:
        t && (r = this._getDebugMeshMesh(t, n));
        break;
      case tn.NoImpostor:
        t ? t.getChildMeshes().filter((s) => s.physicsImpostor ? 1 : 0).forEach((s) => {
          if (s.physicsImpostor && s.getClassName() === "Mesh") {
            const a = s.getBoundingInfo(), f = a.boundingBox.minimum, o = a.boundingBox.maximum;
            switch (s.physicsImpostor.type) {
              case tn.BoxImpostor:
                r = this._getDebugBoxMesh(n), r.position.copyFrom(f), r.position.addInPlace(o), r.position.scaleInPlace(0.5);
                break;
              case tn.SphereImpostor:
                r = this._getDebugSphereMesh(n);
                break;
              case tn.CylinderImpostor:
                r = this._getDebugCylinderMesh(n);
                break;
              default:
                r = null;
                break;
            }
            r && (r.scaling.x = o.x - f.x, r.scaling.y = o.y - f.y, r.scaling.z = o.z - f.z, r.parent = s);
          }
        }) : Se.Warn("No target mesh parameter provided for NoImpostor. Skipping."), r = null;
        break;
      case tn.CylinderImpostor: {
        r = this._getDebugCylinderMesh(n);
        const i = e.object.getBoundingInfo();
        r.scaling.x = (i.boundingBox.maximum.x - i.boundingBox.minimum.x) * e.object.scaling.x, r.scaling.y = (i.boundingBox.maximum.y - i.boundingBox.minimum.y) * e.object.scaling.y, r.scaling.z = (i.boundingBox.maximum.z - i.boundingBox.minimum.z) * e.object.scaling.z;
        break;
      }
    }
    return r;
  }
  /**
   * Creates a debug mesh for a given physics body
   * @param body The physics body to create the debug mesh for
   * @returns The created debug mesh or null if the utility layer is not available
   *
   * This code is useful for creating a debug mesh for a given physics body.
   * It creates a Mesh object with a VertexData object containing the positions and indices
   * of the geometry of the body. The mesh is then assigned a debug material from the utility layer scene.
   * This allows for visualizing the physics body in the scene.
   */
  _getDebugBodyMesh(e) {
    if (!this._utilityLayer)
      return null;
    const t = this._utilityLayer.utilityLayerScene, r = new Ee("custom", t), n = new Ut(), i = e.getGeometry();
    if (n.positions = i.positions, n.indices = i.indices, n.applyToMesh(r), e._pluginDataInstances) {
      const s = new Float32Array(e._pluginDataInstances.length * 16);
      r.thinInstanceSetBuffer("matrix", s, 16);
    }
    return r.material = this._getDebugMaterial(t), r;
  }
  _getMeshDebugInertiaMatrixToRef(e, t) {
    var r, n, i;
    const s = (r = e.inertiaOrientation) !== null && r !== void 0 ? r : Ze.Identity(), a = (n = e.inertia) !== null && n !== void 0 ? n : S.Zero(), f = (i = e.centerOfMass) !== null && i !== void 0 ? i : S.Zero(), o = (a.x - a.y + a.z) * 6, d = Math.sqrt(Math.max(o, 0)), v = a.x * 12 - o, u = Math.sqrt(Math.max(v, 0)), l = a.z * 12 - o, P = Math.sqrt(Math.max(l, 0)), p = ue.Vector3[0];
    p.set(P, d, u);
    const c = he.ScalingToRef(p.x, p.y, p.z, ue.Matrix[0]), H = s.toRotationMatrix(ue.Matrix[1]), T = he.TranslationToRef(f.x, f.y, f.z, ue.Matrix[2]);
    return c.multiplyToRef(H, t), t.multiplyToRef(T, t), t;
  }
  _getDebugInertiaMesh(e) {
    if (!this._utilityLayer)
      return null;
    const t = this._utilityLayer.utilityLayerScene, r = Ef.CreateBox("custom", { size: 1 }, t), n = he.Identity();
    if (e._pluginDataInstances.length) {
      const i = new Float32Array(e._pluginDataInstances.length * 16);
      for (let s = 0; s < e._pluginDataInstances.length; ++s) {
        const a = e.getMassProperties(s);
        this._getMeshDebugInertiaMatrixToRef(a, n), n.copyToArray(i, s * 16);
      }
      r.thinInstanceSetBuffer("matrix", i, 16);
    } else {
      const i = e.getMassProperties();
      this._getMeshDebugInertiaMatrixToRef(i, n), n.decomposeToTransformNode(r);
    }
    return r.enableEdgesRendering(), r.edgesWidth = 2, r.edgesColor = new xt(1, 0, 1, 1), r.material = this._getDebugInertiaMaterial(t), r;
  }
  _getTransformFromBodyToRef(e, t, r) {
    const n = e.transformNode;
    return r && r >= 0 ? he.FromArrayToRef(n._thinInstanceDataStorage.matrixData, r, t) : t.copyFrom(n.getWorldMatrix());
  }
  _getDebugConstraintMesh(e) {
    if (!this._utilityLayer)
      return null;
    const t = this._utilityLayer.utilityLayerScene;
    if (!e._initOptions)
      return null;
    const { pivotA: r, pivotB: n, axisA: i, axisB: s, perpAxisA: a, perpAxisB: f } = e._initOptions;
    if (!r || !n || !i || !s || !a || !f)
      return null;
    const o = new Ee("parentingDebugConstraint", t), d = e.getBodiesUsingConstraint();
    for (const v of d) {
      const u = new Hr("parentOfPair", t);
      u.parent = o;
      const { parentBody: l, parentBodyIndex: P, childBody: p, childBodyIndex: c } = v, H = this._getTransformFromBodyToRef(l, ue.Matrix[0], P), T = this._getTransformFromBodyToRef(p, ue.Matrix[1], c), q = new Hr("parentCoordSystem", t);
      q.parent = u, q.metadata = { parentBody: l, parentBodyIndex: P }, H.decomposeToTransformNode(q);
      const b = new Hr("childCoordSystem", t);
      b.parent = u, b.metadata = { childBody: p, childBodyIndex: c }, T.decomposeToTransformNode(b);
      const j = Ze.FromRotationMatrix(he.FromXYZAxesToRef(i, a, i.cross(a), ue.Matrix[0])), w = Ze.FromRotationMatrix(he.FromXYZAxesToRef(s, f, s.cross(f), ue.Matrix[0])), m = r, I = n, N = new Hr("constraint_parent", t);
      N.position.copyFrom(m), N.rotationQuaternion = j, N.parent = q;
      const k = new Hr("constraint_child", t);
      k.parent = b, k.position.copyFrom(I), k.rotationQuaternion = w;
      const R = new aq(t, this._constraintAxesSize);
      R.xAxis.parent = N, R.yAxis.parent = N, R.zAxis.parent = N;
      const y = new aq(t, this._constraintAxesSize);
      y.xAxis.parent = k, y.yAxis.parent = k, y.zAxis.parent = k;
    }
    return o;
  }
  /**
   * Clean up physics debug display
   */
  dispose() {
    for (let e = this._numMeshes - 1; e >= 0; e--)
      this.hideImpostor(this._impostors[0]);
    for (let e = this._numBodies - 1; e >= 0; e--)
      this.hideBody(this._bodies[0]);
    for (let e = this._numInertiaBodies - 1; e >= 0; e--)
      this.hideInertia(this._inertiaBodies[0]);
    this._debugBoxMesh && this._debugBoxMesh.dispose(), this._debugSphereMesh && this._debugSphereMesh.dispose(), this._debugCylinderMesh && this._debugCylinderMesh.dispose(), this._debugMaterial && this._debugMaterial.dispose(), this._impostors.length = 0, this._scene = null, this._physicsEnginePlugin = null, this._utilityLayer && (this._utilityLayer.dispose(), this._utilityLayer = null);
  }
}
class yQ {
  /**
   * Helper function to create a colored helper in a scene in one line.
   * @param ray Defines the ray we are currently trying to visualize
   * @param scene Defines the scene the ray is used in
   * @param color Defines the color we want to see the ray in
   * @returns The newly created ray helper.
   */
  static CreateAndShow(e, t, r) {
    const n = new yQ(e);
    return n.show(t, r), n;
  }
  /**
   * Instantiate a new ray helper.
   * As raycast might be hard to debug, the RayHelper can help rendering the different rays
   * in order to better appreciate the issue one might have.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/picking_collisions#debugging
   * @param ray Defines the ray we are currently trying to visualize
   */
  constructor(e) {
    this.ray = e;
  }
  /**
   * Shows the ray we are willing to debug.
   * @param scene Defines the scene the ray needs to be rendered in
   * @param color Defines the color the ray needs to be rendered in
   */
  show(e, t) {
    if (!this._renderFunction && this.ray) {
      const r = this.ray;
      this._renderFunction = () => this._render(), this._scene = e, this._renderPoints = [r.origin, r.origin.add(r.direction.scale(r.length))], this._renderLine = ka("ray", { points: this._renderPoints, updatable: !0 }, e), this._renderLine.isPickable = !1, this._renderFunction && this._scene.registerBeforeRender(this._renderFunction);
    }
    t && this._renderLine && this._renderLine.color.copyFrom(t);
  }
  /**
   * Hides the ray we are debugging.
   */
  hide() {
    this._renderFunction && this._scene && (this._scene.unregisterBeforeRender(this._renderFunction), this._scene = null, this._renderFunction = null, this._renderLine && (this._renderLine.dispose(), this._renderLine = null), this._renderPoints = []);
  }
  _render() {
    var e;
    const t = this.ray;
    if (!t)
      return;
    const r = this._renderPoints[1], n = Math.min(t.length, 1e6);
    r.copyFrom(t.direction), r.scaleInPlace(n), r.addInPlace(t.origin), this._renderPoints[0].copyFrom(t.origin), ka("ray", { points: this._renderPoints, updatable: !0, instance: this._renderLine }, this._scene), (e = this._renderLine) === null || e === void 0 || e.refreshBoundingInfo();
  }
  /**
   * Attach a ray helper to a mesh so that we can easily see its orientation for instance or information like its normals.
   * @param mesh Defines the mesh we want the helper attached to
   * @param meshSpaceDirection Defines the direction of the Ray in mesh space (local space of the mesh node)
   * @param meshSpaceOrigin Defines the origin of the Ray in mesh space (local space of the mesh node)
   * @param length Defines the length of the ray
   */
  attachToMesh(e, t, r, n) {
    this._attachedToMesh = e;
    const i = this.ray;
    i && (i.direction || (i.direction = S.Zero()), i.origin || (i.origin = S.Zero()), n && (i.length = n), r || (r = S.Zero()), t || (t = new S(0, 0, -1)), this._scene || (this._scene = e.getScene()), this._meshSpaceDirection ? (this._meshSpaceDirection.copyFrom(t), this._meshSpaceOrigin.copyFrom(r)) : (this._meshSpaceDirection = t.clone(), this._meshSpaceOrigin = r.clone()), this._onAfterRenderObserver || (this._onAfterRenderObserver = this._scene.onBeforeRenderObservable.add(() => this._updateToMesh()), this._onAfterStepObserver = this._scene.onAfterStepObservable.add(() => this._updateToMesh())), this._attachedToMesh.computeWorldMatrix(!0), this._updateToMesh());
  }
  /**
   * Detach the ray helper from the mesh it has previously been attached to.
   */
  detachFromMesh() {
    this._attachedToMesh && this._scene && (this._onAfterRenderObserver && (this._scene.onBeforeRenderObservable.remove(this._onAfterRenderObserver), this._scene.onAfterStepObservable.remove(this._onAfterStepObserver)), this._attachedToMesh = null, this._onAfterRenderObserver = null, this._onAfterStepObserver = null, this._scene = null);
  }
  _updateToMesh() {
    const e = this.ray;
    if (!(!this._attachedToMesh || !e)) {
      if (this._attachedToMesh.isDisposed()) {
        this.detachFromMesh();
        return;
      }
      this._attachedToMesh.getDirectionToRef(this._meshSpaceDirection, e.direction), S.TransformCoordinatesToRef(this._meshSpaceOrigin, this._attachedToMesh.getWorldMatrix(), e.origin);
    }
  }
  /**
   * Dispose the helper and release its associated resources.
   */
  dispose() {
    this.hide(), this.detachFromMesh(), this.ray = null;
  }
}
class Ru {
  /** public static method to create a BoneWeight Shader
   * @param options The constructor options
   * @param scene The scene that the shader is scoped to
   * @returns The created ShaderMaterial
   * @see http://www.babylonjs-playground.com/#1BZJVJ#395
   */
  static CreateBoneWeightShader(e, t) {
    var r, n, i, s, a, f;
    const o = e.skeleton, d = (r = e.colorBase) !== null && r !== void 0 ? r : Ne.Black(), v = (n = e.colorZero) !== null && n !== void 0 ? n : Ne.Blue(), u = (i = e.colorQuarter) !== null && i !== void 0 ? i : Ne.Green(), l = (s = e.colorHalf) !== null && s !== void 0 ? s : Ne.Yellow(), P = (a = e.colorFull) !== null && a !== void 0 ? a : Ne.Red(), p = (f = e.targetBoneIndex) !== null && f !== void 0 ? f : 0;
    An.ShadersStore["boneWeights:" + o.name + "VertexShader"] = `precision highp float;

        attribute vec3 position;
        attribute vec2 uv;

        uniform mat4 view;
        uniform mat4 projection;
        uniform mat4 worldViewProjection;

        #include<bonesDeclaration>
        #if NUM_BONE_INFLUENCERS == 0
            attribute vec4 matricesIndices;
            attribute vec4 matricesWeights;
        #endif
        #include<bakedVertexAnimationDeclaration>

        #include<instancesDeclaration>

        varying vec3 vColor;

        uniform vec3 colorBase;
        uniform vec3 colorZero;
        uniform vec3 colorQuarter;
        uniform vec3 colorHalf;
        uniform vec3 colorFull;

        uniform float targetBoneIndex;

        void main() {
            vec3 positionUpdated = position;

            #include<instancesVertex>
            #include<bonesVertex>
            #include<bakedVertexAnimation>

            vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);

            vec3 color = colorBase;
            float totalWeight = 0.;
            if(matricesIndices[0] == targetBoneIndex && matricesWeights[0] > 0.){
                totalWeight += matricesWeights[0];
            }
            if(matricesIndices[1] == targetBoneIndex && matricesWeights[1] > 0.){
                totalWeight += matricesWeights[1];
            }
            if(matricesIndices[2] == targetBoneIndex && matricesWeights[2] > 0.){
                totalWeight += matricesWeights[2];
            }
            if(matricesIndices[3] == targetBoneIndex && matricesWeights[3] > 0.){
                totalWeight += matricesWeights[3];
            }

            color = mix(color, colorZero, smoothstep(0., 0.25, totalWeight));
            color = mix(color, colorQuarter, smoothstep(0.25, 0.5, totalWeight));
            color = mix(color, colorHalf, smoothstep(0.5, 0.75, totalWeight));
            color = mix(color, colorFull, smoothstep(0.75, 1.0, totalWeight));
            vColor = color;

        gl_Position = projection * view * worldPos;
        }`, An.ShadersStore["boneWeights:" + o.name + "FragmentShader"] = `
            precision highp float;
            varying vec3 vPosition;

            varying vec3 vColor;

            void main() {
                vec4 color = vec4(vColor, 1.0);
                gl_FragColor = color;
            }
        `;
    const c = new Zo("boneWeight:" + o.name, t, {
      vertex: "boneWeights:" + o.name,
      fragment: "boneWeights:" + o.name
    }, {
      attributes: ["position", "normal", "matricesIndices", "matricesWeights"],
      uniforms: [
        "world",
        "worldView",
        "worldViewProjection",
        "view",
        "projection",
        "viewProjection",
        "colorBase",
        "colorZero",
        "colorQuarter",
        "colorHalf",
        "colorFull",
        "targetBoneIndex"
      ]
    });
    return c.setColor3("colorBase", d), c.setColor3("colorZero", v), c.setColor3("colorQuarter", u), c.setColor3("colorHalf", l), c.setColor3("colorFull", P), c.setFloat("targetBoneIndex", p), c.getClassName = () => "BoneWeightShader", c.transparencyMode = gt.MATERIAL_OPAQUE, c;
  }
  /** public static method to create a BoneWeight Shader
   * @param options The constructor options
   * @param scene The scene that the shader is scoped to
   * @returns The created ShaderMaterial
   */
  static CreateSkeletonMapShader(e, t) {
    var r;
    const n = e.skeleton, i = (r = e.colorMap) !== null && r !== void 0 ? r : [
      {
        color: new Ne(1, 0.38, 0.18),
        location: 0
      },
      {
        color: new Ne(0.59, 0.18, 1),
        location: 0.2
      },
      {
        color: new Ne(0.59, 1, 0.18),
        location: 0.4
      },
      {
        color: new Ne(1, 0.87, 0.17),
        location: 0.6
      },
      {
        color: new Ne(1, 0.17, 0.42),
        location: 0.8
      },
      {
        color: new Ne(0.17, 0.68, 1),
        location: 1
      }
    ], s = n.bones.length + 1, a = Ru._CreateBoneMapColorBuffer(s, i, t), f = new Zo("boneWeights:" + n.name, t, {
      vertexSource: `precision highp float;

            attribute vec3 position;
            attribute vec2 uv;

            uniform mat4 view;
            uniform mat4 projection;
            uniform mat4 worldViewProjection;
            uniform float colorMap[` + n.bones.length * 4 + `];

            #include<bonesDeclaration>
            #if NUM_BONE_INFLUENCERS == 0
                attribute vec4 matricesIndices;
                attribute vec4 matricesWeights;
            #endif
            #include<bakedVertexAnimationDeclaration>
            #include<instancesDeclaration>

            varying vec3 vColor;

            void main() {
                vec3 positionUpdated = position;

                #include<instancesVertex>
                #include<bonesVertex>
                #include<bakedVertexAnimation>

                vec3 color = vec3(0.);
                bool first = true;

                for (int i = 0; i < 4; i++) {
                    int boneIdx = int(matricesIndices[i]);
                    float boneWgt = matricesWeights[i];

                    vec3 c = vec3(colorMap[boneIdx * 4 + 0], colorMap[boneIdx * 4 + 1], colorMap[boneIdx * 4 + 2]);

                    if (boneWgt > 0.) {
                        if (first) {
                            first = false;
                            color = c;
                        } else {
                            color = mix(color, c, boneWgt);
                        }
                    }
                }

                vColor = color;

                vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);

                gl_Position = projection * view * worldPos;
            }`,
      fragmentSource: `
            precision highp float;
            varying vec3 vColor;

            void main() {
                vec4 color = vec4( vColor, 1.0 );
                gl_FragColor = color;
            }
            `
    }, {
      attributes: ["position", "normal", "matricesIndices", "matricesWeights"],
      uniforms: ["world", "worldView", "worldViewProjection", "view", "projection", "viewProjection", "colorMap"]
    });
    return f.setFloats("colorMap", a), f.getClassName = () => "SkeletonMapShader", f.transparencyMode = gt.MATERIAL_OPAQUE, f;
  }
  /** private static method to create a BoneWeight Shader
   * @param size The size of the buffer to create (usually the bone count)
   * @param colorMap The gradient data to generate
   * @param scene The scene that the shader is scoped to
   * @returns an Array of floats from the color gradient values
   */
  static _CreateBoneMapColorBuffer(e, t, r) {
    const n = new Xp("temp", { width: e, height: 1 }, r, !1), i = n.getContext(), s = i.createLinearGradient(0, 0, e, 0);
    t.forEach((d) => {
      s.addColorStop(d.location, d.color.toHexString());
    }), i.fillStyle = s, i.fillRect(0, 0, e, 1), n.update();
    const a = [], f = i.getImageData(0, 0, e, 1).data, o = 1 / 255;
    for (let d = 0; d < f.length; d++)
      a.push(f[d] * o);
    return n.dispose(), a;
  }
  /** Gets the Scene. */
  get scene() {
    return this._scene;
  }
  /** Gets the utilityLayer. */
  get utilityLayer() {
    return this._utilityLayer;
  }
  /** Checks Ready Status. */
  get isReady() {
    return this._ready;
  }
  /** Sets Ready Status. */
  set ready(e) {
    this._ready = e;
  }
  /** Gets the debugMesh */
  get debugMesh() {
    return this._debugMesh;
  }
  /** Sets the debugMesh */
  set debugMesh(e) {
    this._debugMesh = e;
  }
  /** Gets the displayMode */
  get displayMode() {
    return this.options.displayMode || Ru.DISPLAY_LINES;
  }
  /** Sets the displayMode */
  set displayMode(e) {
    e > Ru.DISPLAY_SPHERE_AND_SPURS && (e = Ru.DISPLAY_LINES), this.options.displayMode = e;
  }
  /**
   * Creates a new SkeletonViewer
   * @param skeleton defines the skeleton to render
   * @param mesh defines the mesh attached to the skeleton
   * @param scene defines the hosting scene
   * @param autoUpdateBonesMatrices defines a boolean indicating if bones matrices must be forced to update before rendering (true by default)
   * @param renderingGroupId defines the rendering group id to use with the viewer
   * @param options All of the extra constructor options for the SkeletonViewer
   */
  constructor(e, t, r, n = !0, i = 3, s = {}) {
    var a, f, o, d, v, u, l, P, p, c, H, T, q, b;
    if (this.skeleton = e, this.mesh = t, this.autoUpdateBonesMatrices = n, this.renderingGroupId = i, this.options = s, this.color = Ne.White(), this._debugLines = new Array(), this._localAxes = null, this._isEnabled = !0, this._obs = null, this._scene = r, this._ready = !1, s.pauseAnimations = (a = s.pauseAnimations) !== null && a !== void 0 ? a : !0, s.returnToRest = (f = s.returnToRest) !== null && f !== void 0 ? f : !1, s.displayMode = (o = s.displayMode) !== null && o !== void 0 ? o : Ru.DISPLAY_LINES, s.displayOptions = (d = s.displayOptions) !== null && d !== void 0 ? d : {}, s.displayOptions.midStep = (v = s.displayOptions.midStep) !== null && v !== void 0 ? v : 0.235, s.displayOptions.midStepFactor = (u = s.displayOptions.midStepFactor) !== null && u !== void 0 ? u : 0.155, s.displayOptions.sphereBaseSize = (l = s.displayOptions.sphereBaseSize) !== null && l !== void 0 ? l : 0.15, s.displayOptions.sphereScaleUnit = (P = s.displayOptions.sphereScaleUnit) !== null && P !== void 0 ? P : 2, s.displayOptions.sphereFactor = (p = s.displayOptions.sphereFactor) !== null && p !== void 0 ? p : 0.865, s.displayOptions.spurFollowsChild = (c = s.displayOptions.spurFollowsChild) !== null && c !== void 0 ? c : !1, s.displayOptions.showLocalAxes = (H = s.displayOptions.showLocalAxes) !== null && H !== void 0 ? H : !1, s.displayOptions.localAxesSize = (T = s.displayOptions.localAxesSize) !== null && T !== void 0 ? T : 0.075, s.computeBonesUsingShaders = (q = s.computeBonesUsingShaders) !== null && q !== void 0 ? q : !0, s.useAllBones = (b = s.useAllBones) !== null && b !== void 0 ? b : !0, this._boneIndices = /* @__PURE__ */ new Set(), !s.useAllBones) {
      const w = t == null ? void 0 : t.getVerticesData(J.MatricesIndicesKind), m = t == null ? void 0 : t.getVerticesData(J.MatricesWeightsKind);
      if (w && m)
        for (let I = 0; I < w.length; ++I) {
          const N = w[I];
          m[I] !== 0 && this._boneIndices.add(N);
        }
    }
    this._utilityLayer = new Ds(this._scene, !1), this._utilityLayer.pickUtilitySceneFirst = !1, this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = !0;
    let j = this.options.displayMode || 0;
    j > Ru.DISPLAY_SPHERE_AND_SPURS && (j = Ru.DISPLAY_LINES), this.displayMode = j, this.update(), this._bindObs();
  }
  /** The Dynamic bindings for the update functions */
  _bindObs() {
    switch (this.displayMode) {
      case Ru.DISPLAY_LINES: {
        this._obs = this.scene.onBeforeRenderObservable.add(() => {
          this._displayLinesUpdate();
        });
        break;
      }
    }
  }
  /** Update the viewer to sync with current skeleton state, only used to manually update. */
  update() {
    switch (this.displayMode) {
      case Ru.DISPLAY_LINES: {
        this._displayLinesUpdate();
        break;
      }
      case Ru.DISPLAY_SPHERES: {
        this._buildSpheresAndSpurs(!0);
        break;
      }
      case Ru.DISPLAY_SPHERE_AND_SPURS: {
        this._buildSpheresAndSpurs(!1);
        break;
      }
    }
    this._buildLocalAxes();
  }
  /** Gets or sets a boolean indicating if the viewer is enabled */
  set isEnabled(e) {
    this.isEnabled !== e && (this._isEnabled = e, this.debugMesh && this.debugMesh.setEnabled(e), e && !this._obs ? this._bindObs() : !e && this._obs && (this.scene.onBeforeRenderObservable.remove(this._obs), this._obs = null));
  }
  get isEnabled() {
    return this._isEnabled;
  }
  _getBonePosition(e, t, r, n = 0, i = 0, s = 0) {
    const a = ue.Matrix[0], f = t.getParent();
    if (a.copyFrom(t.getLocalMatrix()), n !== 0 || i !== 0 || s !== 0) {
      const o = ue.Matrix[1];
      he.IdentityToRef(o), o.setTranslationFromFloats(n, i, s), o.multiplyToRef(a, a);
    }
    f && a.multiplyToRef(f.getAbsoluteMatrix(), a), a.multiplyToRef(r, a), e.x = a.m[12], e.y = a.m[13], e.z = a.m[14];
  }
  _getLinesForBonesWithLength(e, t) {
    const r = e.length;
    let n, i;
    t ? (n = t.getWorldMatrix(), i = t.position) : (n = new he(), i = e[0].position);
    let s = 0;
    for (let a = 0; a < r; a++) {
      const f = e[a];
      let o = this._debugLines[s];
      f._index === -1 || !this._boneIndices.has(f.getIndex()) && !this.options.useAllBones || (o || (o = [S.Zero(), S.Zero()], this._debugLines[s] = o), this._getBonePosition(o[0], f, n), this._getBonePosition(o[1], f, n, 0, f.length, 0), o[0].subtractInPlace(i), o[1].subtractInPlace(i), s++);
    }
  }
  _getLinesForBonesNoLength(e) {
    const t = e.length;
    let r = 0;
    const n = this.mesh;
    let i, s;
    n ? (i = n, s = n.position) : (i = new Hr(""), s = e[0].position);
    for (let a = t - 1; a >= 0; a--) {
      const f = e[a], o = f.getParent();
      if (!o || !this._boneIndices.has(f.getIndex()) && !this.options.useAllBones)
        continue;
      let d = this._debugLines[r];
      d || (d = [S.Zero(), S.Zero()], this._debugLines[r] = d), f.getAbsolutePositionToRef(i, d[0]), o.getAbsolutePositionToRef(i, d[1]), d[0].subtractInPlace(s), d[1].subtractInPlace(s), r++;
    }
    n || i.dispose();
  }
  /**
   * function to revert the mesh and scene back to the initial state.
   * @param animationState
   */
  _revert(e) {
    this.options.pauseAnimations && (this.scene.animationsEnabled = e, this.utilityLayer.utilityLayerScene.animationsEnabled = e);
  }
  /**
   * function to get the absolute bind pose of a bone by accumulating transformations up the bone hierarchy.
   * @param bone
   * @param matrix
   */
  _getAbsoluteBindPoseToRef(e, t) {
    if (e === null || e._index === -1) {
      t.copyFrom(he.Identity());
      return;
    }
    this._getAbsoluteBindPoseToRef(e.getParent(), t), e.getBindMatrix().multiplyToRef(t, t);
  }
  /**
   * function to build and bind sphere joint points and spur bone representations.
   * @param spheresOnly
   */
  _buildSpheresAndSpurs(e = !0) {
    var t, r;
    this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this._ready = !1;
    const n = (t = this.utilityLayer) === null || t === void 0 ? void 0 : t.utilityLayerScene, i = this.skeleton.bones, s = [], a = [], f = this.scene.animationsEnabled;
    try {
      this.options.pauseAnimations && (this.scene.animationsEnabled = !1, n.animationsEnabled = !1), this.options.returnToRest && this.skeleton.returnToRest(), this.autoUpdateBonesMatrices && this.skeleton.computeAbsoluteMatrices();
      let o = Number.NEGATIVE_INFINITY;
      const d = this.options.displayOptions || {};
      for (let p = 0; p < i.length; p++) {
        const c = i[p];
        if (c._index === -1 || !this._boneIndices.has(c.getIndex()) && !this.options.useAllBones)
          continue;
        const H = new he();
        this._getAbsoluteBindPoseToRef(c, H);
        const T = new S();
        H.decompose(void 0, void 0, T), c.children.forEach((I) => {
          const N = new he();
          I.getLocalMatrix().multiplyToRef(H, N);
          const k = new S();
          N.decompose(void 0, void 0, k);
          const R = S.Distance(T, k);
          if (R > o && (o = R), e)
            return;
          const y = k.clone().subtract(T.clone()), O = y.length(), Y = y.normalize().scale(O), ee = d.midStep || 0.165, Z = d.midStepFactor || 0.215, te = Y.scale(ee), fe = ZR("skeletonViewer", {
            shape: [new S(1, -1, 0), new S(1, 1, 0), new S(-1, 1, 0), new S(-1, -1, 0), new S(1, -1, 0)],
            path: [S.Zero(), te, Y],
            scaleFunction: ($) => {
              switch ($) {
                case 0:
                case 2:
                  return 0;
                case 1:
                  return O * Z;
              }
              return 0;
            },
            sideOrientation: Ee.DEFAULTSIDE,
            updatable: !1
          }, n), _ = fe.getTotalVertices(), G = [], L = [];
          for (let $ = 0; $ < _; $++)
            G.push(1, 0, 0, 0), d.spurFollowsChild && $ > 9 ? L.push(I.getIndex(), 0, 0, 0) : L.push(c.getIndex(), 0, 0, 0);
          fe.position = T.clone(), fe.setVerticesData(J.MatricesWeightsKind, G, !1), fe.setVerticesData(J.MatricesIndicesKind, L, !1), fe.convertToFlatShadedMesh(), a.push(fe);
        });
        const q = d.sphereBaseSize || 0.2, b = UA("skeletonViewer", {
          segments: 6,
          diameter: q,
          updatable: !0
        }, n), j = b.getTotalVertices(), w = [], m = [];
        for (let I = 0; I < j; I++)
          w.push(1, 0, 0, 0), m.push(c.getIndex(), 0, 0, 0);
        b.setVerticesData(J.MatricesWeightsKind, w, !1), b.setVerticesData(J.MatricesIndicesKind, m, !1), b.position = T.clone(), s.push([b, c]);
      }
      const v = d.sphereScaleUnit || 2, u = d.sphereFactor || 0.85, l = [];
      for (let p = 0; p < s.length; p++) {
        const [c, H] = s[p], T = 1 / (v / o);
        let q = 0, b = H;
        for (; b.getParent() && b.getParent().getIndex() !== -1; )
          q++, b = b.getParent();
        c.scaling.scaleInPlace(T * Math.pow(u, q)), l.push(c);
      }
      this.debugMesh = Ee.MergeMeshes(l.concat(a), !0, !0), this.debugMesh && (this.debugMesh.renderingGroupId = this.renderingGroupId, this.debugMesh.skeleton = this.skeleton, this.debugMesh.parent = this.mesh, this.debugMesh.computeBonesUsingShaders = (r = this.options.computeBonesUsingShaders) !== null && r !== void 0 ? r : !0, this.debugMesh.alwaysSelectAsActiveMesh = !0);
      const P = this.utilityLayer._getSharedGizmoLight();
      P.intensity = 0.7, this._revert(f), this.ready = !0;
    } catch (o) {
      console.error(o), this._revert(f), this.dispose();
    }
  }
  _buildLocalAxes() {
    var e;
    this._localAxes && this._localAxes.dispose(), this._localAxes = null;
    const t = this.options.displayOptions || {};
    if (!t.showLocalAxes)
      return;
    const r = this._utilityLayer.utilityLayerScene, n = t.localAxesSize || 0.075, i = [], s = [], a = new xt(1, 0, 0, 1), f = new xt(0, 1, 0, 1), o = new xt(0, 0, 1, 1), d = [], v = [], u = 6;
    for (const l in this.skeleton.bones) {
      const P = this.skeleton.bones[l];
      if (P._index === -1 || !this._boneIndices.has(P.getIndex()) && !this.options.useAllBones)
        continue;
      const p = new he(), c = new S();
      this._getAbsoluteBindPoseToRef(P, p), p.decompose(void 0, ue.Quaternion[0], c);
      const H = new he();
      ue.Quaternion[0].toRotationMatrix(H);
      const T = S.TransformCoordinates(new S(0 + n, 0, 0), H), q = S.TransformCoordinates(new S(0, 0 + n, 0), H), b = S.TransformCoordinates(new S(0, 0, 0 + n), H), j = [c, c.add(T)], w = [c, c.add(q)], m = [c, c.add(b)], I = [j, w, m], N = [
        [a, a],
        [f, f],
        [o, o]
      ];
      i.push(...I), s.push(...N);
      for (let k = 0; k < u; k++)
        d.push(1, 0, 0, 0), v.push(P.getIndex(), 0, 0, 0);
    }
    this._localAxes = rm("localAxes", { lines: i, colors: s, updatable: !0 }, r), this._localAxes.setVerticesData(J.MatricesWeightsKind, d, !1), this._localAxes.setVerticesData(J.MatricesIndicesKind, v, !1), this._localAxes.skeleton = this.skeleton, this._localAxes.renderingGroupId = this.renderingGroupId + 1, this._localAxes.parent = this.mesh, this._localAxes.computeBonesUsingShaders = (e = this.options.computeBonesUsingShaders) !== null && e !== void 0 ? e : !0;
  }
  /** Update the viewer to sync with current skeleton state, only used for the line display. */
  _displayLinesUpdate() {
    if (!this._utilityLayer)
      return;
    this.autoUpdateBonesMatrices && this.skeleton.computeAbsoluteMatrices(), this.skeleton.bones[0].length === void 0 ? this._getLinesForBonesNoLength(this.skeleton.bones) : this._getLinesForBonesWithLength(this.skeleton.bones, this.mesh);
    const e = this._utilityLayer.utilityLayerScene;
    e && (this._debugMesh ? rm("", { lines: this._debugLines, updatable: !0, instance: this._debugMesh }, e) : (this._debugMesh = rm("", { lines: this._debugLines, updatable: !0, instance: null }, e), this._debugMesh.renderingGroupId = this.renderingGroupId), this.mesh ? this._debugMesh.position.copyFrom(this.mesh.position) : this._debugMesh.position.copyFrom(this.skeleton.bones[0].position), this._debugMesh.color = this.color);
  }
  /** Changes the displayMode of the skeleton viewer
   * @param mode The displayMode numerical value
   */
  changeDisplayMode(e) {
    const t = !!this.isEnabled;
    this.displayMode !== e && (this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this.displayMode = e, this.update(), this._bindObs(), this.isEnabled = t);
  }
  /** Sets a display option of the skeleton viewer
   *
   * | Option           | Type    | Default | Description |
   * | ---------------- | ------- | ------- | ----------- |
   * | midStep          | float   | 0.235   | A percentage between a bone and its child that determines the widest part of a spur. Only used when `displayMode` is set to `DISPLAY_SPHERE_AND_SPURS`. |
   * | midStepFactor    | float   | 0.15    | Mid step width expressed as a factor of the length. A value of 0.5 makes the spur width half of the spur length. Only used when `displayMode` is set to `DISPLAY_SPHERE_AND_SPURS`. |
   * | sphereBaseSize   | float   | 2       | Sphere base size. Only used when `displayMode` is set to `DISPLAY_SPHERE_AND_SPURS`. |
   * | sphereScaleUnit  | float   | 0.865   | Sphere scale factor used to scale spheres in relation to the longest bone. Only used when `displayMode` is set to `DISPLAY_SPHERE_AND_SPURS`. |
   * | spurFollowsChild | boolean | false   | Whether a spur should attach its far end to the child bone. |
   * | showLocalAxes    | boolean | false   | Displays local axes on all bones. |
   * | localAxesSize    | float   | 0.075   | Determines the length of each local axis. |
   *
   * @param option String of the option name
   * @param value The numerical option value
   */
  changeDisplayOptions(e, t) {
    const r = !!this.isEnabled;
    this.options.displayOptions[e] = t, this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this.update(), this._bindObs(), this.isEnabled = r;
  }
  /** Release associated resources */
  dispose() {
    this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null), this._utilityLayer && (this._utilityLayer.dispose(), this._utilityLayer = null), this.ready = !1;
  }
}
Ru.DISPLAY_LINES = 0;
Ru.DISPLAY_SPHERES = 1;
Ru.DISPLAY_SPHERE_AND_SPURS = 2;
class aue {
  /**
   * Gets or sets the transparency of the frustum planes
   */
  get transparency() {
    return this._transparency;
  }
  set transparency(e) {
    this._transparency = e;
    for (let t = 6; t < 12; ++t)
      this._lightHelperFrustumMeshes[t].material.alpha = e;
  }
  /**
   * true to display the edges of the frustum
   */
  get showLines() {
    return this._showLines;
  }
  set showLines(e) {
    if (this._showLines !== e) {
      this._showLines = e;
      for (let t = 0; t < 6; ++t)
        this._lightHelperFrustumMeshes[t].setEnabled(e);
    }
  }
  /**
   * true to display the planes of the frustum
   */
  get showPlanes() {
    return this._showPlanes;
  }
  set showPlanes(e) {
    if (this._showPlanes !== e) {
      this._showPlanes = e;
      for (let t = 6; t < 12; ++t)
        this._lightHelperFrustumMeshes[t].setEnabled(e);
    }
  }
  /**
   * Creates a new frustum viewer
   * @param light directional light to display the frustum for
   * @param camera camera used to retrieve the minZ / maxZ values if the shadowMinZ/shadowMaxZ values of the light are not setup
   */
  constructor(e, t) {
    this._oldPosition = new S(Number.NaN, Number.NaN, Number.NaN), this._oldDirection = new S(Number.NaN, Number.NaN, Number.NaN), this._transparency = 0.3, this._showLines = !0, this._showPlanes = !0, this._scene = e.getScene(), this._light = e, this._camera = t, this._inverseViewMatrix = he.Identity(), this._lightHelperFrustumMeshes = [], this._createGeometry(), this.show(), this.update();
  }
  /**
   * Shows the frustum
   */
  show() {
    this._lightHelperFrustumMeshes.forEach((e, t) => {
      e.setEnabled(t < 6 && this._showLines || t >= 6 && this._showPlanes);
    }), this._oldPosition.set(Number.NaN, Number.NaN, Number.NaN), this._visible = !0;
  }
  /**
   * Hides the frustum
   */
  hide() {
    this._lightHelperFrustumMeshes.forEach((e) => {
      e.setEnabled(!1);
    }), this._visible = !1;
  }
  /**
   * Updates the frustum.
   * Call this method to update the frustum view if the light has changed position/direction
   */
  update() {
    var e, t, r, n, i, s;
    if (!this._visible || this._oldPosition.equals(this._light.position) && this._oldDirection.equals(this._light.direction) && this._oldAutoCalc === this._light.autoCalcShadowZBounds && this._oldMinZ === this._light.shadowMinZ && this._oldMaxZ === this._light.shadowMaxZ)
      return;
    this._oldPosition.copyFrom(this._light.position), this._oldDirection.copyFrom(this._light.direction), this._oldAutoCalc = this._light.autoCalcShadowZBounds, this._oldMinZ = this._light.shadowMinZ, this._oldMaxZ = this._light.shadowMaxZ, ue.Vector3[0].set(this._light.orthoLeft, this._light.orthoBottom, this._light.shadowMinZ !== void 0 ? this._light.shadowMinZ : this._camera.minZ), ue.Vector3[1].set(this._light.orthoRight, this._light.orthoTop, this._light.shadowMaxZ !== void 0 ? this._light.shadowMaxZ : this._camera.maxZ);
    const a = this._getInvertViewMatrix();
    ue.Vector3[2].copyFromFloats(ue.Vector3[1].x, ue.Vector3[1].y, ue.Vector3[0].z), ue.Vector3[3].copyFromFloats(ue.Vector3[1].x, ue.Vector3[0].y, ue.Vector3[0].z), ue.Vector3[4].copyFromFloats(ue.Vector3[0].x, ue.Vector3[0].y, ue.Vector3[0].z), ue.Vector3[5].copyFromFloats(ue.Vector3[0].x, ue.Vector3[1].y, ue.Vector3[0].z), S.TransformCoordinatesToRef(ue.Vector3[2], a, ue.Vector3[2]), S.TransformCoordinatesToRef(ue.Vector3[3], a, ue.Vector3[3]), S.TransformCoordinatesToRef(ue.Vector3[4], a, ue.Vector3[4]), S.TransformCoordinatesToRef(ue.Vector3[5], a, ue.Vector3[5]), ue.Vector3[6].copyFromFloats(ue.Vector3[1].x, ue.Vector3[1].y, ue.Vector3[1].z), ue.Vector3[7].copyFromFloats(ue.Vector3[1].x, ue.Vector3[0].y, ue.Vector3[1].z), ue.Vector3[8].copyFromFloats(ue.Vector3[0].x, ue.Vector3[0].y, ue.Vector3[1].z), ue.Vector3[9].copyFromFloats(ue.Vector3[0].x, ue.Vector3[1].y, ue.Vector3[1].z), S.TransformCoordinatesToRef(ue.Vector3[6], a, ue.Vector3[6]), S.TransformCoordinatesToRef(ue.Vector3[7], a, ue.Vector3[7]), S.TransformCoordinatesToRef(ue.Vector3[8], a, ue.Vector3[8]), S.TransformCoordinatesToRef(ue.Vector3[9], a, ue.Vector3[9]), ka("nearlines", { updatable: !0, points: this._nearLinesPoints, instance: this._lightHelperFrustumMeshes[0] }, this._scene), ka("farlines", { updatable: !0, points: this._farLinesPoints, instance: this._lightHelperFrustumMeshes[1] }, this._scene), ka("trlines", { updatable: !0, points: this._trLinesPoints, instance: this._lightHelperFrustumMeshes[2] }, this._scene), ka("brlines", { updatable: !0, points: this._brLinesPoints, instance: this._lightHelperFrustumMeshes[3] }, this._scene), ka("tllines", { updatable: !0, points: this._tlLinesPoints, instance: this._lightHelperFrustumMeshes[4] }, this._scene), ka("bllines", { updatable: !0, points: this._blLinesPoints, instance: this._lightHelperFrustumMeshes[5] }, this._scene), ue.Vector3[2].toArray(this._nearPlaneVertices, 0), ue.Vector3[3].toArray(this._nearPlaneVertices, 3), ue.Vector3[4].toArray(this._nearPlaneVertices, 6), ue.Vector3[5].toArray(this._nearPlaneVertices, 9), (e = this._lightHelperFrustumMeshes[6].geometry) === null || e === void 0 || e.updateVerticesDataDirectly("position", this._nearPlaneVertices, 0), ue.Vector3[6].toArray(this._farPlaneVertices, 0), ue.Vector3[7].toArray(this._farPlaneVertices, 3), ue.Vector3[8].toArray(this._farPlaneVertices, 6), ue.Vector3[9].toArray(this._farPlaneVertices, 9), (t = this._lightHelperFrustumMeshes[7].geometry) === null || t === void 0 || t.updateVerticesDataDirectly("position", this._farPlaneVertices, 0), ue.Vector3[2].toArray(this._rightPlaneVertices, 0), ue.Vector3[6].toArray(this._rightPlaneVertices, 3), ue.Vector3[7].toArray(this._rightPlaneVertices, 6), ue.Vector3[3].toArray(this._rightPlaneVertices, 9), (r = this._lightHelperFrustumMeshes[8].geometry) === null || r === void 0 || r.updateVerticesDataDirectly("position", this._rightPlaneVertices, 0), ue.Vector3[5].toArray(this._leftPlaneVertices, 0), ue.Vector3[9].toArray(this._leftPlaneVertices, 3), ue.Vector3[8].toArray(this._leftPlaneVertices, 6), ue.Vector3[4].toArray(this._leftPlaneVertices, 9), (n = this._lightHelperFrustumMeshes[9].geometry) === null || n === void 0 || n.updateVerticesDataDirectly("position", this._leftPlaneVertices, 0), ue.Vector3[2].toArray(this._topPlaneVertices, 0), ue.Vector3[6].toArray(this._topPlaneVertices, 3), ue.Vector3[9].toArray(this._topPlaneVertices, 6), ue.Vector3[5].toArray(this._topPlaneVertices, 9), (i = this._lightHelperFrustumMeshes[10].geometry) === null || i === void 0 || i.updateVerticesDataDirectly("position", this._topPlaneVertices, 0), ue.Vector3[3].toArray(this._bottomPlaneVertices, 0), ue.Vector3[7].toArray(this._bottomPlaneVertices, 3), ue.Vector3[8].toArray(this._bottomPlaneVertices, 6), ue.Vector3[4].toArray(this._bottomPlaneVertices, 9), (s = this._lightHelperFrustumMeshes[11].geometry) === null || s === void 0 || s.updateVerticesDataDirectly("position", this._bottomPlaneVertices, 0);
  }
  /**
   * Dispose of the class / remove the frustum view
   */
  dispose() {
    this._lightHelperFrustumMeshes.forEach((e) => {
      var t;
      (t = e.material) === null || t === void 0 || t.dispose(), e.dispose();
    }), this._rootNode.dispose();
  }
  _createGeometry() {
    this._rootNode = new Hr("directionalLightHelperRoot_" + this._light.name, this._scene), this._rootNode.parent = this._light.parent, this._nearLinesPoints = [S.ZeroReadOnly, S.ZeroReadOnly, S.ZeroReadOnly, S.ZeroReadOnly, S.ZeroReadOnly];
    const e = ka("nearlines", { updatable: !0, points: this._nearLinesPoints }, this._scene);
    e.parent = this._rootNode, e.alwaysSelectAsActiveMesh = !0, this._farLinesPoints = [S.ZeroReadOnly, S.ZeroReadOnly, S.ZeroReadOnly, S.ZeroReadOnly, S.ZeroReadOnly];
    const t = ka("farlines", { updatable: !0, points: this._farLinesPoints }, this._scene);
    t.parent = this._rootNode, t.alwaysSelectAsActiveMesh = !0, this._trLinesPoints = [S.ZeroReadOnly, S.ZeroReadOnly];
    const r = ka("trlines", { updatable: !0, points: this._trLinesPoints }, this._scene);
    r.parent = this._rootNode, r.alwaysSelectAsActiveMesh = !0, this._brLinesPoints = [S.ZeroReadOnly, S.ZeroReadOnly];
    const n = ka("brlines", { updatable: !0, points: this._brLinesPoints }, this._scene);
    n.parent = this._rootNode, n.alwaysSelectAsActiveMesh = !0, this._tlLinesPoints = [S.ZeroReadOnly, S.ZeroReadOnly];
    const i = ka("tllines", { updatable: !0, points: this._tlLinesPoints }, this._scene);
    i.parent = this._rootNode, i.alwaysSelectAsActiveMesh = !0, this._blLinesPoints = [S.ZeroReadOnly, S.ZeroReadOnly];
    const s = ka("bllines", { updatable: !0, points: this._blLinesPoints }, this._scene);
    s.parent = this._rootNode, s.alwaysSelectAsActiveMesh = !0, this._lightHelperFrustumMeshes.push(e, t, r, n, i, s);
    const a = (f, o, d) => {
      const v = new Ee(f + "plane", this._scene), u = new Wt(f + "PlaneMat", this._scene);
      v.material = u, v.parent = this._rootNode, v.alwaysSelectAsActiveMesh = !0, u.emissiveColor = o, u.alpha = this.transparency, u.backFaceCulling = !1, u.disableLighting = !0;
      const l = [0, 1, 2, 0, 2, 3], P = new Ut();
      P.positions = d, P.indices = l, P.applyToMesh(v, !0), this._lightHelperFrustumMeshes.push(v);
    };
    this._nearPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this._farPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this._rightPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this._leftPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this._topPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this._bottomPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], a("near", new Ne(1, 0, 0), this._nearPlaneVertices), a("far", new Ne(0.3, 0, 0), this._farPlaneVertices), a("right", new Ne(0, 1, 0), this._rightPlaneVertices), a("left", new Ne(0, 0.3, 0), this._leftPlaneVertices), a("top", new Ne(0, 0, 1), this._topPlaneVertices), a("bottom", new Ne(0, 0, 0.3), this._bottomPlaneVertices), this._nearLinesPoints[0] = ue.Vector3[2], this._nearLinesPoints[1] = ue.Vector3[3], this._nearLinesPoints[2] = ue.Vector3[4], this._nearLinesPoints[3] = ue.Vector3[5], this._nearLinesPoints[4] = ue.Vector3[2], this._farLinesPoints[0] = ue.Vector3[6], this._farLinesPoints[1] = ue.Vector3[7], this._farLinesPoints[2] = ue.Vector3[8], this._farLinesPoints[3] = ue.Vector3[9], this._farLinesPoints[4] = ue.Vector3[6], this._trLinesPoints[0] = ue.Vector3[2], this._trLinesPoints[1] = ue.Vector3[6], this._brLinesPoints[0] = ue.Vector3[3], this._brLinesPoints[1] = ue.Vector3[7], this._tlLinesPoints[0] = ue.Vector3[4], this._tlLinesPoints[1] = ue.Vector3[8], this._blLinesPoints[0] = ue.Vector3[5], this._blLinesPoints[1] = ue.Vector3[9];
  }
  _getInvertViewMatrix() {
    return he.LookAtLHToRef(this._light.position, this._light.position.add(this._light.direction), S.UpReadOnly, this._inverseViewMatrix), this._inverseViewMatrix.invertToRef(this._inverseViewMatrix), this._inverseViewMatrix;
  }
}
class et {
}
et.ALPHA_DISABLE = 0;
et.ALPHA_ADD = 1;
et.ALPHA_COMBINE = 2;
et.ALPHA_SUBTRACT = 3;
et.ALPHA_MULTIPLY = 4;
et.ALPHA_MAXIMIZED = 5;
et.ALPHA_ONEONE = 6;
et.ALPHA_PREMULTIPLIED = 7;
et.ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
et.ALPHA_INTERPOLATE = 9;
et.ALPHA_SCREENMODE = 10;
et.ALPHA_ONEONE_ONEONE = 11;
et.ALPHA_ALPHATOCOLOR = 12;
et.ALPHA_REVERSEONEMINUS = 13;
et.ALPHA_SRC_DSTONEMINUSSRCALPHA = 14;
et.ALPHA_ONEONE_ONEZERO = 15;
et.ALPHA_EXCLUSION = 16;
et.ALPHA_LAYER_ACCUMULATE = 17;
et.ALPHA_EQUATION_ADD = 0;
et.ALPHA_EQUATION_SUBSTRACT = 1;
et.ALPHA_EQUATION_REVERSE_SUBTRACT = 2;
et.ALPHA_EQUATION_MAX = 3;
et.ALPHA_EQUATION_MIN = 4;
et.ALPHA_EQUATION_DARKEN = 5;
et.DELAYLOADSTATE_NONE = 0;
et.DELAYLOADSTATE_LOADED = 1;
et.DELAYLOADSTATE_LOADING = 2;
et.DELAYLOADSTATE_NOTLOADED = 4;
et.NEVER = 512;
et.ALWAYS = 519;
et.LESS = 513;
et.EQUAL = 514;
et.LEQUAL = 515;
et.GREATER = 516;
et.GEQUAL = 518;
et.NOTEQUAL = 517;
et.KEEP = 7680;
et.ZERO = 0;
et.REPLACE = 7681;
et.INCR = 7682;
et.DECR = 7683;
et.INVERT = 5386;
et.INCR_WRAP = 34055;
et.DECR_WRAP = 34056;
et.TEXTURE_CLAMP_ADDRESSMODE = 0;
et.TEXTURE_WRAP_ADDRESSMODE = 1;
et.TEXTURE_MIRROR_ADDRESSMODE = 2;
et.TEXTURE_CREATIONFLAG_STORAGE = 1;
et.TEXTUREFORMAT_ALPHA = 0;
et.TEXTUREFORMAT_LUMINANCE = 1;
et.TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
et.TEXTUREFORMAT_RGB = 4;
et.TEXTUREFORMAT_RGBA = 5;
et.TEXTUREFORMAT_RED = 6;
et.TEXTUREFORMAT_R = 6;
et.TEXTUREFORMAT_RG = 7;
et.TEXTUREFORMAT_RED_INTEGER = 8;
et.TEXTUREFORMAT_R_INTEGER = 8;
et.TEXTUREFORMAT_RG_INTEGER = 9;
et.TEXTUREFORMAT_RGB_INTEGER = 10;
et.TEXTUREFORMAT_RGBA_INTEGER = 11;
et.TEXTUREFORMAT_BGRA = 12;
et.TEXTUREFORMAT_DEPTH24_STENCIL8 = 13;
et.TEXTUREFORMAT_DEPTH32_FLOAT = 14;
et.TEXTUREFORMAT_DEPTH16 = 15;
et.TEXTUREFORMAT_DEPTH24 = 16;
et.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8 = 17;
et.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8 = 18;
et.TEXTUREFORMAT_STENCIL8 = 19;
et.TEXTUREFORMAT_UNDEFINED = 4294967295;
et.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM = 36492;
et.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 36493;
et.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 36495;
et.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 36494;
et.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5 = 33779;
et.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919;
et.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3 = 33778;
et.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918;
et.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1 = 33777;
et.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1 = 33776;
et.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917;
et.TEXTUREFORMAT_COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916;
et.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4 = 37808;
et.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840;
et.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL = 36196;
et.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2 = 37492;
et.TEXTUREFORMAT_COMPRESSED_SRGB8_ETC2 = 37493;
et.TEXTUREFORMAT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494;
et.TEXTUREFORMAT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495;
et.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC = 37496;
et.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497;
et.TEXTURETYPE_UNSIGNED_BYTE = 0;
et.TEXTURETYPE_UNSIGNED_INT = 0;
et.TEXTURETYPE_FLOAT = 1;
et.TEXTURETYPE_HALF_FLOAT = 2;
et.TEXTURETYPE_BYTE = 3;
et.TEXTURETYPE_SHORT = 4;
et.TEXTURETYPE_UNSIGNED_SHORT = 5;
et.TEXTURETYPE_INT = 6;
et.TEXTURETYPE_UNSIGNED_INTEGER = 7;
et.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8;
et.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9;
et.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10;
et.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11;
et.TEXTURETYPE_UNSIGNED_INT_24_8 = 12;
et.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13;
et.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14;
et.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15;
et.TEXTURETYPE_UNDEFINED = 16;
et.TEXTURE_2D = 3553;
et.TEXTURE_2D_ARRAY = 35866;
et.TEXTURE_CUBE_MAP = 34067;
et.TEXTURE_CUBE_MAP_ARRAY = 3735928559;
et.TEXTURE_3D = 32879;
et.TEXTURE_NEAREST_SAMPLINGMODE = 1;
et.TEXTURE_NEAREST_NEAREST = 1;
et.TEXTURE_BILINEAR_SAMPLINGMODE = 2;
et.TEXTURE_LINEAR_LINEAR = 2;
et.TEXTURE_TRILINEAR_SAMPLINGMODE = 3;
et.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;
et.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;
et.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;
et.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;
et.TEXTURE_NEAREST_LINEAR = 7;
et.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8;
et.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;
et.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;
et.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11;
et.TEXTURE_LINEAR_NEAREST = 12;
et.TEXTURE_EXPLICIT_MODE = 0;
et.TEXTURE_SPHERICAL_MODE = 1;
et.TEXTURE_PLANAR_MODE = 2;
et.TEXTURE_CUBIC_MODE = 3;
et.TEXTURE_PROJECTION_MODE = 4;
et.TEXTURE_SKYBOX_MODE = 5;
et.TEXTURE_INVCUBIC_MODE = 6;
et.TEXTURE_EQUIRECTANGULAR_MODE = 7;
et.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;
et.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
et.TEXTURE_FILTERING_QUALITY_OFFLINE = 4096;
et.TEXTURE_FILTERING_QUALITY_HIGH = 64;
et.TEXTURE_FILTERING_QUALITY_MEDIUM = 16;
et.TEXTURE_FILTERING_QUALITY_LOW = 8;
et.SCALEMODE_FLOOR = 1;
et.SCALEMODE_NEAREST = 2;
et.SCALEMODE_CEILING = 3;
et.MATERIAL_TextureDirtyFlag = 1;
et.MATERIAL_LightDirtyFlag = 2;
et.MATERIAL_FresnelDirtyFlag = 4;
et.MATERIAL_AttributesDirtyFlag = 8;
et.MATERIAL_MiscDirtyFlag = 16;
et.MATERIAL_PrePassDirtyFlag = 32;
et.MATERIAL_AllDirtyFlag = 63;
et.MATERIAL_TriangleFillMode = 0;
et.MATERIAL_WireFrameFillMode = 1;
et.MATERIAL_PointFillMode = 2;
et.MATERIAL_PointListDrawMode = 3;
et.MATERIAL_LineListDrawMode = 4;
et.MATERIAL_LineLoopDrawMode = 5;
et.MATERIAL_LineStripDrawMode = 6;
et.MATERIAL_TriangleStripDrawMode = 7;
et.MATERIAL_TriangleFanDrawMode = 8;
et.MATERIAL_ClockWiseSideOrientation = 0;
et.MATERIAL_CounterClockWiseSideOrientation = 1;
et.ACTION_NothingTrigger = 0;
et.ACTION_OnPickTrigger = 1;
et.ACTION_OnLeftPickTrigger = 2;
et.ACTION_OnRightPickTrigger = 3;
et.ACTION_OnCenterPickTrigger = 4;
et.ACTION_OnPickDownTrigger = 5;
et.ACTION_OnDoublePickTrigger = 6;
et.ACTION_OnPickUpTrigger = 7;
et.ACTION_OnPickOutTrigger = 16;
et.ACTION_OnLongPressTrigger = 8;
et.ACTION_OnPointerOverTrigger = 9;
et.ACTION_OnPointerOutTrigger = 10;
et.ACTION_OnEveryFrameTrigger = 11;
et.ACTION_OnIntersectionEnterTrigger = 12;
et.ACTION_OnIntersectionExitTrigger = 13;
et.ACTION_OnKeyDownTrigger = 14;
et.ACTION_OnKeyUpTrigger = 15;
et.PARTICLES_BILLBOARDMODE_Y = 2;
et.PARTICLES_BILLBOARDMODE_ALL = 7;
et.PARTICLES_BILLBOARDMODE_STRETCHED = 8;
et.PARTICLES_BILLBOARDMODE_STRETCHED_LOCAL = 9;
et.MESHES_CULLINGSTRATEGY_STANDARD = 0;
et.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1;
et.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2;
et.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3;
et.SCENELOADER_NO_LOGGING = 0;
et.SCENELOADER_MINIMAL_LOGGING = 1;
et.SCENELOADER_SUMMARY_LOGGING = 2;
et.SCENELOADER_DETAILED_LOGGING = 3;
et.PREPASS_IRRADIANCE_TEXTURE_TYPE = 0;
et.PREPASS_POSITION_TEXTURE_TYPE = 1;
et.PREPASS_VELOCITY_TEXTURE_TYPE = 2;
et.PREPASS_REFLECTIVITY_TEXTURE_TYPE = 3;
et.PREPASS_COLOR_TEXTURE_TYPE = 4;
et.PREPASS_DEPTH_TEXTURE_TYPE = 5;
et.PREPASS_NORMAL_TEXTURE_TYPE = 6;
et.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE = 7;
et.BUFFER_CREATIONFLAG_READ = 1;
et.BUFFER_CREATIONFLAG_WRITE = 2;
et.BUFFER_CREATIONFLAG_READWRITE = 3;
et.BUFFER_CREATIONFLAG_UNIFORM = 4;
et.BUFFER_CREATIONFLAG_VERTEX = 8;
et.BUFFER_CREATIONFLAG_INDEX = 16;
et.BUFFER_CREATIONFLAG_STORAGE = 32;
et.RENDERPASS_MAIN = 0;
et.INPUT_ALT_KEY = 18;
et.INPUT_CTRL_KEY = 17;
et.INPUT_META_KEY1 = 91;
et.INPUT_META_KEY2 = 92;
et.INPUT_META_KEY3 = 93;
et.INPUT_SHIFT_KEY = 16;
et.SNAPSHOTRENDERING_STANDARD = 0;
et.SNAPSHOTRENDERING_FAST = 1;
et.PERSPECTIVE_CAMERA = 0;
et.ORTHOGRAPHIC_CAMERA = 1;
et.FOVMODE_VERTICAL_FIXED = 0;
et.FOVMODE_HORIZONTAL_FIXED = 1;
et.RIG_MODE_NONE = 0;
et.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10;
et.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11;
et.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12;
et.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13;
et.RIG_MODE_STEREOSCOPIC_INTERLACED = 14;
et.RIG_MODE_VR = 20;
et.RIG_MODE_CUSTOM = 22;
et.MAX_SUPPORTED_UV_SETS = 6;
et.GL_ALPHA_EQUATION_ADD = 32774;
et.GL_ALPHA_EQUATION_MIN = 32775;
et.GL_ALPHA_EQUATION_MAX = 32776;
et.GL_ALPHA_EQUATION_SUBTRACT = 32778;
et.GL_ALPHA_EQUATION_REVERSE_SUBTRACT = 32779;
et.GL_ALPHA_FUNCTION_SRC = 768;
et.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR = 769;
et.GL_ALPHA_FUNCTION_SRC_ALPHA = 770;
et.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA = 771;
et.GL_ALPHA_FUNCTION_DST_ALPHA = 772;
et.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA = 773;
et.GL_ALPHA_FUNCTION_DST_COLOR = 774;
et.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR = 775;
et.GL_ALPHA_FUNCTION_SRC_ALPHA_SATURATED = 776;
et.GL_ALPHA_FUNCTION_CONSTANT_COLOR = 32769;
et.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR = 32770;
et.GL_ALPHA_FUNCTION_CONSTANT_ALPHA = 32771;
et.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA = 32772;
et.SnippetUrl = "https://snippet.babylonjs.com";
class ate {
  constructor() {
    this.renderWidth = 512, this.renderHeight = 256, this.textureSize = 512, this.deterministicLockstep = !1, this.lockstepMaxSteps = 4;
  }
}
class ote extends Ge {
  /**
   * Gets a boolean indicating that the engine is running in deterministic lock step mode
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
   * @returns true if engine is in deterministic lock step mode
   */
  isDeterministicLockStep() {
    return this._options.deterministicLockstep;
  }
  /**
   * Gets the max steps when engine is running in deterministic lock step
   * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
   * @returns the max steps
   */
  getLockstepMaxSteps() {
    return this._options.lockstepMaxSteps;
  }
  /**
   * Gets the current hardware scaling level.
   * By default the hardware scaling level is computed from the window device ratio.
   * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.
   * @returns a number indicating the current hardware scaling level
   */
  getHardwareScalingLevel() {
    return 1;
  }
  constructor(e = new ate()) {
    super(null), Ge.Instances.push(this), e.deterministicLockstep === void 0 && (e.deterministicLockstep = !1), e.lockstepMaxSteps === void 0 && (e.lockstepMaxSteps = 4), this._options = e, k9.SetMatrixPrecision(!!e.useHighPrecisionMatrix), this._caps = {
      maxTexturesImageUnits: 16,
      maxVertexTextureImageUnits: 16,
      maxCombinedTexturesImageUnits: 32,
      maxTextureSize: 512,
      maxCubemapTextureSize: 512,
      maxRenderTextureSize: 512,
      maxVertexAttribs: 16,
      maxVaryingVectors: 16,
      maxFragmentUniformVectors: 16,
      maxVertexUniformVectors: 16,
      standardDerivatives: !1,
      astc: null,
      pvrtc: null,
      etc1: null,
      etc2: null,
      bptc: null,
      maxAnisotropy: 0,
      uintIndices: !1,
      fragmentDepthSupported: !1,
      highPrecisionShaderSupported: !0,
      colorBufferFloat: !1,
      supportFloatTexturesResolve: !1,
      textureFloat: !1,
      textureFloatLinearFiltering: !1,
      textureFloatRender: !1,
      textureHalfFloat: !1,
      textureHalfFloatLinearFiltering: !1,
      textureHalfFloatRender: !1,
      textureLOD: !1,
      texelFetch: !1,
      drawBuffersExtension: !1,
      depthTextureExtension: !1,
      vertexArrayObject: !1,
      instancedArrays: !1,
      supportOcclusionQuery: !1,
      canUseTimestampForTimerQuery: !1,
      maxMSAASamples: 1,
      blendMinMax: !1,
      canUseGLInstanceID: !1,
      canUseGLVertexID: !1,
      supportComputeShaders: !1,
      supportSRGBBuffers: !1,
      supportTransformFeedbacks: !1,
      textureMaxLevel: !1,
      texture2DArrayMaxLayerCount: 128,
      disableMorphTargetTexture: !1
    }, this._features = {
      forceBitmapOverHTMLImageElement: !1,
      supportRenderAndCopyToLodForFloatTextures: !1,
      supportDepthStencilTexture: !1,
      supportShadowSamplers: !1,
      uniformBufferHardCheckMatrix: !1,
      allowTexturePrefiltering: !1,
      trackUbosInFrame: !1,
      checkUbosContentBeforeUpload: !1,
      supportCSM: !1,
      basisNeedsPOT: !1,
      support3DTextures: !1,
      needTypeSuffixInShaderConstants: !1,
      supportMSAA: !1,
      supportSSAO2: !1,
      supportExtendedTextureFormats: !1,
      supportSwitchCaseInShader: !1,
      supportSyncTextureRead: !1,
      needsInvertingBitmap: !1,
      useUBOBindingCache: !1,
      needShaderCodeInlining: !1,
      needToAlwaysBindUniformBuffers: !1,
      supportRenderPasses: !0,
      supportSpriteInstancing: !1,
      forceVertexBufferStrideMultiple4Bytes: !1,
      _collectUbosUpdatedInFrame: !1
    }, Se.Log(`Babylon.js v${Ge.Version} - Null engine`);
    const t = typeof self < "u" ? self : typeof global < "u" ? global : window;
    typeof URL > "u" && (t.URL = {
      createObjectURL: function() {
      },
      revokeObjectURL: function() {
      }
    }), typeof Blob > "u" && (t.Blob = function() {
    });
  }
  /**
   * Creates a vertex buffer
   * @param vertices the data for the vertex buffer
   * @returns the new WebGL static buffer
   */
  createVertexBuffer(e) {
    const t = new tg();
    return t.references = 1, t;
  }
  /**
   * Creates a new index buffer
   * @param indices defines the content of the index buffer
   * @returns a new webGL buffer
   */
  createIndexBuffer(e) {
    const t = new tg();
    return t.references = 1, t;
  }
  /**
   * Clear the current render buffer or the current render target (if any is set up)
   * @param color defines the color to use
   * @param backBuffer defines if the back buffer must be cleared
   * @param depth defines if the depth buffer must be cleared
   * @param stencil defines if the stencil buffer must be cleared
   */
  clear(e, t, r, n = !1) {
  }
  /**
   * Gets the current render width
   * @param useScreen defines if screen size must be used (or the current render target if any)
   * @returns a number defining the current render width
   */
  getRenderWidth(e = !1) {
    return !e && this._currentRenderTarget ? this._currentRenderTarget.width : this._options.renderWidth;
  }
  /**
   * Gets the current render height
   * @param useScreen defines if screen size must be used (or the current render target if any)
   * @returns a number defining the current render height
   */
  getRenderHeight(e = !1) {
    return !e && this._currentRenderTarget ? this._currentRenderTarget.height : this._options.renderHeight;
  }
  /**
   * Set the WebGL's viewport
   * @param viewport defines the viewport element to be used
   * @param requiredWidth defines the width required for rendering. If not provided the rendering canvas' width is used
   * @param requiredHeight defines the height required for rendering. If not provided the rendering canvas' height is used
   */
  setViewport(e, t, r) {
    this._cachedViewport = e;
  }
  createShaderProgram(e, t, r, n, i) {
    return {
      // eslint-disable-next-line @typescript-eslint/naming-convention
      __SPECTOR_rebuildProgram: null
    };
  }
  /**
   * Gets the list of webGL uniform locations associated with a specific program based on a list of uniform names
   * @param pipelineContext defines the pipeline context to use
   * @param uniformsNames defines the list of uniform names
   * @returns an array of webGL uniform locations
   */
  getUniforms(e, t) {
    return [];
  }
  /**
   * Gets the lsit of active attributes for a given webGL program
   * @param pipelineContext defines the pipeline context to use
   * @param attributesNames defines the list of attribute names to get
   * @returns an array of indices indicating the offset of each attribute
   */
  getAttributes(e, t) {
    return [];
  }
  /**
   * Binds an effect to the webGL context
   * @param effect defines the effect to bind
   */
  bindSamplers(e) {
    this._currentEffect = null;
  }
  /**
   * Activates an effect, making it the current one (ie. the one used for rendering)
   * @param effect defines the effect to activate
   */
  enableEffect(e) {
    e = e !== null && zo.IsWrapper(e) ? e.effect : e, this._currentEffect = e, e && (e.onBind && e.onBind(e), e._onBindObservable && e._onBindObservable.notifyObservers(e));
  }
  /**
   * Set various states to the webGL context
   * @param culling defines culling state: true to enable culling, false to disable it
   * @param zOffset defines the value to apply to zOffset (0 by default)
   * @param force defines if states must be applied even if cache is up to date
   * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)
   * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)
   * @param stencil stencil states to set
   * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)
   */
  setState(e, t = 0, r, n = !1, i, s, a = 0) {
  }
  /**
   * Set the value of an uniform to an array of int32
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of int32 to store
   * @returns true if value was set
   */
  setIntArray(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of int32 (stored as vec2)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of int32 to store
   * @returns true if value was set
   */
  setIntArray2(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of int32 (stored as vec3)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of int32 to store
   * @returns true if value was set
   */
  setIntArray3(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of int32 (stored as vec4)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of int32 to store
   * @returns true if value was set
   */
  setIntArray4(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of float32
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of float32 to store
   * @returns true if value was set
   */
  setFloatArray(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of float32 (stored as vec2)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of float32 to store
   * @returns true if value was set
   */
  setFloatArray2(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of float32 (stored as vec3)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of float32 to store
   * @returns true if value was set
   */
  setFloatArray3(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of float32 (stored as vec4)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of float32 to store
   * @returns true if value was set
   */
  setFloatArray4(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of number
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of number to store
   * @returns true if value was set
   */
  setArray(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of number (stored as vec2)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of number to store
   * @returns true if value was set
   */
  setArray2(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of number (stored as vec3)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of number to store
   * @returns true if value was set
   */
  setArray3(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of number (stored as vec4)
   * @param uniform defines the webGL uniform location where to store the value
   * @param array defines the array of number to store
   * @returns true if value was set
   */
  setArray4(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to an array of float32 (stored as matrices)
   * @param uniform defines the webGL uniform location where to store the value
   * @param matrices defines the array of float32 to store
   * @returns true if value was set
   */
  setMatrices(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to a matrix (3x3)
   * @param uniform defines the webGL uniform location where to store the value
   * @param matrix defines the Float32Array representing the 3x3 matrix to store
   * @returns true if value was set
   */
  setMatrix3x3(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to a matrix (2x2)
   * @param uniform defines the webGL uniform location where to store the value
   * @param matrix defines the Float32Array representing the 2x2 matrix to store
   * @returns true if value was set
   */
  setMatrix2x2(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to a number (float)
   * @param uniform defines the webGL uniform location where to store the value
   * @param value defines the float number to store
   * @returns true if value was set
   */
  setFloat(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to a vec2
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @returns true if value was set
   */
  setFloat2(e, t, r) {
    return !0;
  }
  /**
   * Set the value of an uniform to a vec3
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @param z defines the 3rd component of the value
   * @returns true if value was set
   */
  setFloat3(e, t, r, n) {
    return !0;
  }
  /**
   * Set the value of an uniform to a boolean
   * @param uniform defines the webGL uniform location where to store the value
   * @param bool defines the boolean to store
   * @returns true if value was set
   */
  setBool(e, t) {
    return !0;
  }
  /**
   * Set the value of an uniform to a vec4
   * @param uniform defines the webGL uniform location where to store the value
   * @param x defines the 1st component of the value
   * @param y defines the 2nd component of the value
   * @param z defines the 3rd component of the value
   * @param w defines the 4th component of the value
   * @returns true if value was set
   */
  setFloat4(e, t, r, n, i) {
    return !0;
  }
  /**
   * Sets the current alpha mode
   * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
   * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
   */
  setAlphaMode(e, t = !1) {
    this._alphaMode !== e && (this.alphaState.alphaBlend = e !== 0, t || this.setDepthWrite(e === 0), this._alphaMode = e);
  }
  /**
   * Bind webGl buffers directly to the webGL context
   * @param vertexBuffers defines the vertex buffer to bind
   * @param indexBuffer defines the index buffer to bind
   * @param effect defines the effect associated with the vertex buffer
   */
  bindBuffers(e, t, r) {
  }
  /**
   * Force the entire cache to be cleared
   * You should not have to use this function unless your engine needs to share the webGL context with another engine
   * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)
   */
  wipeCaches(e) {
    this.preventCacheWipeBetweenFrames || (this.resetTextureCache(), this._currentEffect = null, e && (this._currentProgram = null, this._stencilStateComposer.reset(), this.depthCullingState.reset(), this.alphaState.reset()), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null);
  }
  /**
   * Send a draw order
   * @param useTriangles defines if triangles must be used to draw (else wireframe will be used)
   * @param indexStart defines the starting index
   * @param indexCount defines the number of index to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  draw(e, t, r, n) {
  }
  /**
   * Draw a list of indexed primitives
   * @param fillMode defines the primitive to use
   * @param indexStart defines the starting index
   * @param indexCount defines the number of index to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  drawElementsType(e, t, r, n) {
  }
  /**
   * Draw a list of unindexed primitives
   * @param fillMode defines the primitive to use
   * @param verticesStart defines the index of first vertex to draw
   * @param verticesCount defines the count of vertices to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  drawArraysType(e, t, r, n) {
  }
  /** @internal */
  _createTexture() {
    return {};
  }
  /**
   * @internal
   */
  _releaseTexture(e) {
  }
  /**
   * Usually called from Texture.ts.
   * Passed information to create a WebGLTexture
   * @param urlArg defines a value which contains one of the following:
   * * A conventional http URL, e.g. 'http://...' or 'file://...'
   * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
   * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
   * @param noMipmap defines a boolean indicating that no mipmaps shall be generated.  Ignored for compressed textures.  They must be in the file
   * @param invertY when true, image is flipped when loaded.  You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
   * @param scene needed for loading to the correct scene
   * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
   * @param onLoad optional callback to be called upon successful completion
   * @param onError optional callback to be called upon failure
   * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
   * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
   * @param format internal format.  Default: RGB when extension is '.jpg' else RGBA.  Ignored for compressed textures
   * @param forcedExtension defines the extension to use to pick the right loader
   * @param mimeType defines an optional mime type
   * @returns a InternalTexture for assignment back into BABYLON.Texture
   */
  createTexture(e, t, r, n, i = 3, s = null, a = null, f = null, o = null, d = null, v = null, u) {
    const l = new As(this, ri.Url), P = String(e);
    return l.url = P, l.generateMipMaps = !t, l.samplingMode = i, l.invertY = r, l.baseWidth = this._options.textureSize, l.baseHeight = this._options.textureSize, l.width = this._options.textureSize, l.height = this._options.textureSize, d && (l.format = d), l.isReady = !0, s && setTimeout(() => {
      s(l);
    }), this._internalTexturesCache.push(l), l;
  }
  /**
   * @internal
   */
  _createHardwareRenderTargetWrapper(e, t, r) {
    const n = new DR(e, t, r, this);
    return this._renderTargetWrapperCache.push(n), n;
  }
  /**
   * Creates a new render target wrapper
   * @param size defines the size of the texture
   * @param options defines the options used to create the texture
   * @returns a new render target wrapper
   */
  createRenderTargetTexture(e, t) {
    const r = this._createHardwareRenderTargetWrapper(!1, !1, e), n = {};
    t !== void 0 && typeof t == "object" ? (n.generateMipMaps = t.generateMipMaps, n.generateDepthBuffer = t.generateDepthBuffer === void 0 ? !0 : t.generateDepthBuffer, n.generateStencilBuffer = n.generateDepthBuffer && t.generateStencilBuffer, n.type = t.type === void 0 ? 0 : t.type, n.samplingMode = t.samplingMode === void 0 ? 3 : t.samplingMode) : (n.generateMipMaps = t, n.generateDepthBuffer = !0, n.generateStencilBuffer = !1, n.type = 0, n.samplingMode = 3);
    const i = new As(this, ri.RenderTarget), s = e.width || e, a = e.height || e;
    return r._generateDepthBuffer = n.generateDepthBuffer, r._generateStencilBuffer = !!n.generateStencilBuffer, i.baseWidth = s, i.baseHeight = a, i.width = s, i.height = a, i.isReady = !0, i.samples = 1, i.generateMipMaps = !!n.generateMipMaps, i.samplingMode = n.samplingMode, i.type = n.type, this._internalTexturesCache.push(i), r;
  }
  /**
   * Creates a new render target wrapper
   * @param size defines the size of the texture
   * @param options defines the options used to create the texture
   * @returns a new render target wrapper
   */
  createRenderTargetCubeTexture(e, t) {
    const r = this._createHardwareRenderTargetWrapper(!1, !0, e), n = Object.assign({ generateMipMaps: !0, generateDepthBuffer: !0, generateStencilBuffer: !1, type: 0, samplingMode: 3, format: 5 }, t);
    n.generateStencilBuffer = n.generateDepthBuffer && n.generateStencilBuffer, (n.type === 1 && !this._caps.textureFloatLinearFiltering || n.type === 2 && !this._caps.textureHalfFloatLinearFiltering) && (n.samplingMode = 1), r._generateDepthBuffer = n.generateDepthBuffer, r._generateStencilBuffer = !!n.generateStencilBuffer;
    const i = new As(this, ri.RenderTarget);
    return i.baseWidth = e, i.baseHeight = e, i.width = e, i.height = e, i.isReady = !0, i.isCube = !0, i.samples = 1, i.generateMipMaps = !!n.generateMipMaps, i.samplingMode = n.samplingMode, i.type = n.type, this._internalTexturesCache.push(i), r;
  }
  /**
   * Update the sampling mode of a given texture
   * @param samplingMode defines the required sampling mode
   * @param texture defines the texture to update
   */
  updateTextureSamplingMode(e, t) {
    t.samplingMode = e;
  }
  /**
   * Creates a raw texture
   * @param data defines the data to store in the texture
   * @param width defines the width of the texture
   * @param height defines the height of the texture
   * @param format defines the format of the data
   * @param generateMipMaps defines if the engine should generate the mip levels
   * @param invertY defines if data must be stored with Y axis inverted
   * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
   * @param compression defines the compression used (null by default)
   * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   * @returns the raw texture inside an InternalTexture
   */
  createRawTexture(e, t, r, n, i, s, a, f = null, o = 0, d = 0, v = !1) {
    const u = new As(this, ri.Raw);
    return u.baseWidth = t, u.baseHeight = r, u.width = t, u.height = r, u.format = n, u.generateMipMaps = i, u.samplingMode = a, u.invertY = s, u._compression = f, u.type = o, u._useSRGBBuffer = v, this._doNotHandleContextLost || (u._bufferView = e), u;
  }
  /**
   * Update a raw texture
   * @param texture defines the texture to update
   * @param data defines the data to store in the texture
   * @param format defines the format of the data
   * @param invertY defines if data must be stored with Y axis inverted
   * @param compression defines the compression used (null by default)
   * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   */
  updateRawTexture(e, t, r, n, i = null, s = 0, a = !1) {
    e && (e._bufferView = t, e.format = r, e.invertY = n, e._compression = i, e.type = s, e._useSRGBBuffer = a);
  }
  /**
   * Binds the frame buffer to the specified texture.
   * @param rtWrapper The render target wrapper to render to
   * @param faceIndex The face of the texture to render to in case of cube texture
   * @param requiredWidth The width of the target to render to
   * @param requiredHeight The height of the target to render to
   * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true
   */
  bindFramebuffer(e, t, r, n, i) {
    this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = e, this._currentFramebuffer = null, this._cachedViewport && !i && this.setViewport(this._cachedViewport, r, n);
  }
  /**
   * Unbind the current render target texture from the webGL context
   * @param rtWrapper defines the render target wrapper to unbind
   * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
   * @param onBeforeUnbind defines a function which will be called before the effective unbind
   */
  unBindFramebuffer(e, t = !1, r) {
    this._currentRenderTarget = null, r && r(), this._currentFramebuffer = null;
  }
  /**
   * Creates a dynamic vertex buffer
   * @param vertices the data for the dynamic vertex buffer
   * @returns the new WebGL dynamic buffer
   */
  createDynamicVertexBuffer(e) {
    const t = new tg();
    return t.references = 1, t.capacity = 1, t;
  }
  /**
   * Update the content of a dynamic texture
   * @param texture defines the texture to update
   * @param canvas defines the canvas containing the source
   * @param invertY defines if data must be stored with Y axis inverted
   * @param premulAlpha defines if alpha is stored as premultiplied
   * @param format defines the format of the data
   */
  updateDynamicTexture(e, t, r, n = !1, i) {
  }
  /**
   * Gets a boolean indicating if all created effects are ready
   * @returns true if all effects are ready
   */
  areAllEffectsReady() {
    return !0;
  }
  /**
   * @internal
   * Get the current error code of the webGL context
   * @returns the error code
   * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError
   */
  getError() {
    return 0;
  }
  /** @internal */
  _getUnpackAlignement() {
    return 1;
  }
  /**
   * @internal
   */
  _unpackFlipY(e) {
  }
  /**
   * Update a dynamic index buffer
   * @param indexBuffer defines the target index buffer
   * @param indices defines the data to update
   * @param offset defines the offset in the target index buffer where update should start
   */
  updateDynamicIndexBuffer(e, t, r = 0) {
  }
  /**
   * Updates a dynamic vertex buffer.
   * @param vertexBuffer the vertex buffer to update
   * @param vertices the data used to update the vertex buffer
   * @param byteOffset the byte offset of the data (optional)
   * @param byteLength the byte length of the data (optional)
   */
  updateDynamicVertexBuffer(e, t, r, n) {
  }
  /**
   * @internal
   */
  _bindTextureDirectly(e, t) {
    return this._boundTexturesCache[this._activeChannel] !== t ? (this._boundTexturesCache[this._activeChannel] = t, !0) : !1;
  }
  /**
   * @internal
   */
  _bindTexture(e, t) {
    e < 0 || this._bindTextureDirectly(0, t);
  }
  _deleteBuffer(e) {
  }
  /**
   * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled
   */
  releaseEffects() {
  }
  displayLoadingUI() {
  }
  hideLoadingUI() {
  }
  set loadingUIText(e) {
  }
  /**
   * @internal
   */
  _uploadCompressedDataToTextureDirectly(e, t, r, n, i, s = 0, a = 0) {
  }
  /**
   * @internal
   */
  _uploadDataToTextureDirectly(e, t, r = 0, n = 0) {
  }
  /**
   * @internal
   */
  _uploadArrayBufferViewToTexture(e, t, r = 0, n = 0) {
  }
  /**
   * @internal
   */
  _uploadImageToTexture(e, t, r = 0, n = 0) {
  }
}
hr.prototype._debugPushGroup = function(A, e) {
};
hr.prototype._debugPopGroup = function(A) {
};
hr.prototype._debugInsertMarker = function(A, e) {
};
hr.prototype._debugFlushPendingCommands = function() {
};
class fte {
  constructor() {
    this._timeElapsedQueryEnded = !1;
  }
}
class Ate {
  constructor() {
    this.occlusionInternalRetryCounter = 0, this.isOcclusionQueryInProgress = !1, this.isOccluded = !1, this.occlusionRetryCount = -1, this.occlusionType = jn.OCCLUSION_TYPE_NONE, this.occlusionQueryAlgorithmType = jn.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE, this.forceRenderingWhenOccluded = !1;
  }
}
Ge.prototype.createQuery = function() {
  const A = this._gl.createQuery();
  if (!A)
    throw new Error("Unable to create Occlusion Query");
  return A;
};
Ge.prototype.deleteQuery = function(A) {
  return this._gl.deleteQuery(A), this;
};
Ge.prototype.isQueryResultAvailable = function(A) {
  return this._gl.getQueryParameter(A, this._gl.QUERY_RESULT_AVAILABLE);
};
Ge.prototype.getQueryResult = function(A) {
  return this._gl.getQueryParameter(A, this._gl.QUERY_RESULT);
};
Ge.prototype.beginOcclusionQuery = function(A, e) {
  const t = this._getGlAlgorithmType(A);
  return this._gl.beginQuery(t, e), !0;
};
Ge.prototype.endOcclusionQuery = function(A) {
  const e = this._getGlAlgorithmType(A);
  return this._gl.endQuery(e), this;
};
Ge.prototype._createTimeQuery = function() {
  const A = this.getCaps().timerQuery;
  return A.createQueryEXT ? A.createQueryEXT() : this.createQuery();
};
Ge.prototype._deleteTimeQuery = function(A) {
  const e = this.getCaps().timerQuery;
  if (e.deleteQueryEXT) {
    e.deleteQueryEXT(A);
    return;
  }
  this.deleteQuery(A);
};
Ge.prototype._getTimeQueryResult = function(A) {
  const e = this.getCaps().timerQuery;
  return e.getQueryObjectEXT ? e.getQueryObjectEXT(A, e.QUERY_RESULT_EXT) : this.getQueryResult(A);
};
Ge.prototype._getTimeQueryAvailability = function(A) {
  const e = this.getCaps().timerQuery;
  return e.getQueryObjectEXT ? e.getQueryObjectEXT(A, e.QUERY_RESULT_AVAILABLE_EXT) : this.isQueryResultAvailable(A);
};
Ge.prototype.startTimeQuery = function() {
  const A = this.getCaps(), e = A.timerQuery;
  if (!e)
    return null;
  const t = new fte();
  if (this._gl.getParameter(e.GPU_DISJOINT_EXT), A.canUseTimestampForTimerQuery)
    t._startTimeQuery = this._createTimeQuery(), e.queryCounterEXT(t._startTimeQuery, e.TIMESTAMP_EXT);
  else {
    if (this._currentNonTimestampToken)
      return this._currentNonTimestampToken;
    t._timeElapsedQuery = this._createTimeQuery(), e.beginQueryEXT ? e.beginQueryEXT(e.TIME_ELAPSED_EXT, t._timeElapsedQuery) : this._gl.beginQuery(e.TIME_ELAPSED_EXT, t._timeElapsedQuery), this._currentNonTimestampToken = t;
  }
  return t;
};
Ge.prototype.endTimeQuery = function(A) {
  const e = this.getCaps(), t = e.timerQuery;
  if (!t || !A)
    return -1;
  if (e.canUseTimestampForTimerQuery) {
    if (!A._startTimeQuery)
      return -1;
    A._endTimeQuery || (A._endTimeQuery = this._createTimeQuery(), t.queryCounterEXT(A._endTimeQuery, t.TIMESTAMP_EXT));
  } else if (!A._timeElapsedQueryEnded) {
    if (!A._timeElapsedQuery)
      return -1;
    t.endQueryEXT ? t.endQueryEXT(t.TIME_ELAPSED_EXT) : (this._gl.endQuery(t.TIME_ELAPSED_EXT), this._currentNonTimestampToken = null), A._timeElapsedQueryEnded = !0;
  }
  const r = this._gl.getParameter(t.GPU_DISJOINT_EXT);
  let n = !1;
  if (A._endTimeQuery ? n = this._getTimeQueryAvailability(A._endTimeQuery) : A._timeElapsedQuery && (n = this._getTimeQueryAvailability(A._timeElapsedQuery)), n && !r) {
    let i = 0;
    if (e.canUseTimestampForTimerQuery) {
      if (!A._startTimeQuery || !A._endTimeQuery)
        return -1;
      const s = this._getTimeQueryResult(A._startTimeQuery);
      i = this._getTimeQueryResult(A._endTimeQuery) - s, this._deleteTimeQuery(A._startTimeQuery), this._deleteTimeQuery(A._endTimeQuery), A._startTimeQuery = null, A._endTimeQuery = null;
    } else {
      if (!A._timeElapsedQuery)
        return -1;
      i = this._getTimeQueryResult(A._timeElapsedQuery), this._deleteTimeQuery(A._timeElapsedQuery), A._timeElapsedQuery = null, A._timeElapsedQueryEnded = !1;
    }
    return i;
  }
  return -1;
};
Ge.prototype._captureGPUFrameTime = !1;
Ge.prototype._gpuFrameTime = new v9();
Ge.prototype.getGPUFrameTimeCounter = function() {
  return this._gpuFrameTime;
};
Ge.prototype.captureGPUFrameTime = function(A) {
  A !== this._captureGPUFrameTime && (this._captureGPUFrameTime = A, A ? (this._onBeginFrameObserver = this.onBeginFrameObservable.add(() => {
    this._gpuFrameTimeToken || (this._gpuFrameTimeToken = this.startTimeQuery());
  }), this._onEndFrameObserver = this.onEndFrameObservable.add(() => {
    if (!this._gpuFrameTimeToken)
      return;
    const e = this.endTimeQuery(this._gpuFrameTimeToken);
    e > -1 && (this._gpuFrameTimeToken = null, this._gpuFrameTime.fetchNewFrame(), this._gpuFrameTime.addCount(e, !0));
  })) : (this.onBeginFrameObservable.remove(this._onBeginFrameObserver), this._onBeginFrameObserver = null, this.onEndFrameObservable.remove(this._onEndFrameObserver), this._onEndFrameObserver = null));
};
Ge.prototype._getGlAlgorithmType = function(A) {
  return A === jn.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
};
Object.defineProperty(jn.prototype, "isOcclusionQueryInProgress", {
  get: function() {
    return this._occlusionDataStorage.isOcclusionQueryInProgress;
  },
  set: function(A) {
    this._occlusionDataStorage.isOcclusionQueryInProgress = A;
  },
  enumerable: !1,
  configurable: !0
});
Object.defineProperty(jn.prototype, "_occlusionDataStorage", {
  get: function() {
    return this.__occlusionDataStorage || (this.__occlusionDataStorage = new Ate()), this.__occlusionDataStorage;
  },
  enumerable: !1,
  configurable: !0
});
Object.defineProperty(jn.prototype, "isOccluded", {
  get: function() {
    return this._occlusionDataStorage.isOccluded;
  },
  set: function(A) {
    this._occlusionDataStorage.isOccluded = A;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(jn.prototype, "occlusionQueryAlgorithmType", {
  get: function() {
    return this._occlusionDataStorage.occlusionQueryAlgorithmType;
  },
  set: function(A) {
    this._occlusionDataStorage.occlusionQueryAlgorithmType = A;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(jn.prototype, "occlusionType", {
  get: function() {
    return this._occlusionDataStorage.occlusionType;
  },
  set: function(A) {
    this._occlusionDataStorage.occlusionType = A;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(jn.prototype, "occlusionRetryCount", {
  get: function() {
    return this._occlusionDataStorage.occlusionRetryCount;
  },
  set: function(A) {
    this._occlusionDataStorage.occlusionRetryCount = A;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(jn.prototype, "forceRenderingWhenOccluded", {
  get: function() {
    return this._occlusionDataStorage.forceRenderingWhenOccluded;
  },
  set: function(A) {
    this._occlusionDataStorage.forceRenderingWhenOccluded = A;
  },
  enumerable: !0,
  configurable: !0
});
jn.prototype._checkOcclusionQuery = function() {
  const A = this._occlusionDataStorage;
  if (A.occlusionType === jn.OCCLUSION_TYPE_NONE)
    return A.isOccluded = !1, !1;
  const e = this.getEngine();
  if (!e.getCaps().supportOcclusionQuery || !e.isQueryResultAvailable)
    return A.isOccluded = !1, !1;
  if (this.isOcclusionQueryInProgress && this._occlusionQuery !== null && this._occlusionQuery !== void 0)
    if (e.isQueryResultAvailable(this._occlusionQuery)) {
      const n = e.getQueryResult(this._occlusionQuery);
      A.isOcclusionQueryInProgress = !1, A.occlusionInternalRetryCounter = 0, A.isOccluded = !(n > 0);
    } else if (A.occlusionInternalRetryCounter++, A.occlusionRetryCount !== -1 && A.occlusionInternalRetryCounter > A.occlusionRetryCount)
      A.isOcclusionQueryInProgress = !1, A.occlusionInternalRetryCounter = 0, A.isOccluded = A.occlusionType === jn.OCCLUSION_TYPE_OPTIMISTIC ? !1 : A.isOccluded;
    else
      return A.occlusionType === jn.OCCLUSION_TYPE_OPTIMISTIC ? !1 : A.isOccluded;
  const t = this.getScene();
  if (t.getBoundingBoxRenderer) {
    const r = t.getBoundingBoxRenderer();
    this._occlusionQuery === null && (this._occlusionQuery = e.createQuery()), e.beginOcclusionQuery(A.occlusionQueryAlgorithmType, this._occlusionQuery) && (r.renderOcclusionBoundingBox(this), e.endOcclusionQuery(A.occlusionQueryAlgorithmType), this._occlusionDataStorage.isOcclusionQueryInProgress = !0);
  }
  return A.isOccluded;
};
var oue = !0;
Ge.prototype.createTransformFeedback = function() {
  const A = this._gl.createTransformFeedback();
  if (!A)
    throw new Error("Unable to create Transform Feedback");
  return A;
};
Ge.prototype.deleteTransformFeedback = function(A) {
  this._gl.deleteTransformFeedback(A);
};
Ge.prototype.bindTransformFeedback = function(A) {
  this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK, A);
};
Ge.prototype.beginTransformFeedback = function(A = !0) {
  this._gl.beginTransformFeedback(A ? this._gl.POINTS : this._gl.TRIANGLES);
};
Ge.prototype.endTransformFeedback = function() {
  this._gl.endTransformFeedback();
};
Ge.prototype.setTranformFeedbackVaryings = function(A, e) {
  this._gl.transformFeedbackVaryings(A, e, this._gl.INTERLEAVED_ATTRIBS);
};
Ge.prototype.bindTransformFeedbackBuffer = function(A) {
  this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER, 0, A ? A.underlyingResource : null);
};
hr.prototype.createExternalTexture = function(A) {
  return null;
};
hr.prototype.setExternalTexture = function(A, e) {
  throw new Error("setExternalTexture: This engine does not support external textures!");
};
hr.prototype.updateVideoTexture = function(A, e, t) {
  if (!A || A._isDisabled)
    return;
  const r = this._getInternalFormat(A.format), n = this._getRGBABufferInternalSizedFormat(0, A.format), i = this._bindTextureDirectly(this._gl.TEXTURE_2D, A, !0);
  this._unpackFlipY(!t);
  try {
    if (this._videoTextureSupported === void 0 && (this._gl.getError(), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, n, r, this._gl.UNSIGNED_BYTE, e), this._gl.getError() !== 0 ? this._videoTextureSupported = !1 : this._videoTextureSupported = !0), this._videoTextureSupported)
      this._gl.texImage2D(this._gl.TEXTURE_2D, 0, n, r, this._gl.UNSIGNED_BYTE, e);
    else {
      if (!A._workingCanvas) {
        A._workingCanvas = this.createCanvas(A.width, A.height);
        const s = A._workingCanvas.getContext("2d");
        if (!s)
          throw new Error("Unable to get 2d context");
        A._workingContext = s, A._workingCanvas.width = A.width, A._workingCanvas.height = A.height;
      }
      A._workingContext.clearRect(0, 0, A.width, A.height), A._workingContext.drawImage(e, 0, 0, e.videoWidth, e.videoHeight, 0, 0, A.width, A.height), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, n, r, this._gl.UNSIGNED_BYTE, A._workingCanvas);
    }
    A.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), i || this._bindTextureDirectly(this._gl.TEXTURE_2D, null), A.isReady = !0;
  } catch {
    A._isDisabled = !0;
  }
};
hr.prototype.restoreSingleAttachment = function() {
  const A = this._gl;
  this.bindAttachments([A.BACK]);
};
hr.prototype.restoreSingleAttachmentForRenderTarget = function() {
  const A = this._gl;
  this.bindAttachments([A.COLOR_ATTACHMENT0]);
};
hr.prototype.buildTextureLayout = function(A) {
  const e = this._gl, t = [];
  for (let r = 0; r < A.length; r++)
    A[r] ? t.push(e["COLOR_ATTACHMENT" + r]) : t.push(e.NONE);
  return t;
};
hr.prototype.bindAttachments = function(A) {
  this._gl.drawBuffers(A);
};
hr.prototype.unBindMultiColorAttachmentFramebuffer = function(A, e = !1, t) {
  this._currentRenderTarget = null;
  const r = this._gl, n = A._attachments, i = n.length;
  if (A._MSAAFramebuffer) {
    r.bindFramebuffer(r.READ_FRAMEBUFFER, A._MSAAFramebuffer), r.bindFramebuffer(r.DRAW_FRAMEBUFFER, A._framebuffer);
    for (let s = 0; s < i; s++) {
      const a = A.textures[s];
      for (let f = 0; f < i; f++)
        n[f] = r.NONE;
      n[s] = r[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + s : "COLOR_ATTACHMENT" + s + "_WEBGL"], r.readBuffer(n[s]), r.drawBuffers(n), r.blitFramebuffer(0, 0, a.width, a.height, 0, 0, a.width, a.height, r.COLOR_BUFFER_BIT, r.NEAREST);
    }
    for (let s = 0; s < i; s++)
      n[s] = r[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + s : "COLOR_ATTACHMENT" + s + "_WEBGL"];
    r.drawBuffers(n);
  }
  for (let s = 0; s < i; s++) {
    const a = A.textures[s];
    a != null && a.generateMipMaps && !e && !a.isCube && (this._bindTextureDirectly(r.TEXTURE_2D, a, !0), r.generateMipmap(r.TEXTURE_2D), this._bindTextureDirectly(r.TEXTURE_2D, null));
  }
  t && (A._MSAAFramebuffer && this._bindUnboundFramebuffer(A._framebuffer), t()), this._bindUnboundFramebuffer(null);
};
hr.prototype.createMultipleRenderTarget = function(A, e, t = !0) {
  var r;
  let n = !1, i = !0, s = !1, a = !1, f = 15, o = 1;
  const d = 0, v = 3, u = !1, l = 5, P = 3553;
  let p = [], c = [], H = [], T = [], q = [], b = [], j = [], w = [];
  const m = this._createHardwareRenderTargetWrapper(!0, !1, A);
  e !== void 0 && (n = e.generateMipMaps === void 0 ? !1 : e.generateMipMaps, i = e.generateDepthBuffer === void 0 ? !0 : e.generateDepthBuffer, s = e.generateStencilBuffer === void 0 ? !1 : e.generateStencilBuffer, a = e.generateDepthTexture === void 0 ? !1 : e.generateDepthTexture, o = e.textureCount || 1, e.types && (p = e.types), e.samplingModes && (c = e.samplingModes), e.useSRGBBuffers && (H = e.useSRGBBuffers), e.formats && (T = e.formats), e.targetTypes && (q = e.targetTypes), e.faceIndex && (b = e.faceIndex), e.layerIndex && (j = e.layerIndex), e.layerCounts && (w = e.layerCounts), this.webGLVersion > 1 && (e.depthTextureFormat === 13 || e.depthTextureFormat === 17 || e.depthTextureFormat === 16 || e.depthTextureFormat === 14 || e.depthTextureFormat === 18) && (f = e.depthTextureFormat));
  const I = this._gl, N = I.createFramebuffer();
  this._bindUnboundFramebuffer(N);
  const k = A.width || A, R = A.height || A, y = [], O = [], Y = this.webGLVersion > 1 && a && (e.depthTextureFormat === 13 || e.depthTextureFormat === 17 || e.depthTextureFormat === 18), ee = this._setupFramebufferDepthAttachments(!Y && s, !a && i, k, R);
  m._framebuffer = N, m._depthStencilBuffer = ee, m._generateDepthBuffer = !a && i, m._generateStencilBuffer = !Y && s, m._attachments = O;
  for (let Z = 0; Z < o; Z++) {
    let te = c[Z] || v, fe = p[Z] || d, _ = H[Z] || u;
    const G = T[Z] || l, L = q[Z] || P, $ = (r = w[Z]) !== null && r !== void 0 ? r : 1;
    (fe === 1 && !this._caps.textureFloatLinearFiltering || fe === 2 && !this._caps.textureHalfFloatLinearFiltering) && (te = 1);
    const ae = this._getSamplingParameters(te, n);
    fe === 1 && !this._caps.textureFloat && (fe = 0, Se.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type")), _ = _ && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU);
    const Pe = this.webGLVersion > 1, ge = I[Pe ? "COLOR_ATTACHMENT" + Z : "COLOR_ATTACHMENT" + Z + "_WEBGL"];
    if (O.push(ge), L === -1)
      continue;
    const me = new As(this, ri.MultiRenderTarget);
    y[Z] = me, I.activeTexture(I["TEXTURE" + Z]), I.bindTexture(L, me._hardwareTexture.underlyingResource), I.texParameteri(L, I.TEXTURE_MAG_FILTER, ae.mag), I.texParameteri(L, I.TEXTURE_MIN_FILTER, ae.min), I.texParameteri(L, I.TEXTURE_WRAP_S, I.CLAMP_TO_EDGE), I.texParameteri(L, I.TEXTURE_WRAP_T, I.CLAMP_TO_EDGE);
    const Xe = this._getRGBABufferInternalSizedFormat(fe, G, _), De = this._getInternalFormat(G), ne = this._getWebGLTextureType(fe);
    if (Pe && (L === 35866 || L === 32879))
      L === 35866 ? me.is2DArray = !0 : me.is3D = !0, me.baseDepth = me.depth = $, I.texImage3D(L, 0, Xe, k, R, $, 0, De, ne, null);
    else if (L === 34067) {
      for (let re = 0; re < 6; re++)
        I.texImage2D(I.TEXTURE_CUBE_MAP_POSITIVE_X + re, 0, Xe, k, R, 0, De, ne, null);
      me.isCube = !0;
    } else
      I.texImage2D(I.TEXTURE_2D, 0, Xe, k, R, 0, De, ne, null);
    n && I.generateMipmap(L), this._bindTextureDirectly(L, null), me.baseWidth = k, me.baseHeight = R, me.width = k, me.height = R, me.isReady = !0, me.samples = 1, me.generateMipMaps = n, me.samplingMode = te, me.type = fe, me._useSRGBBuffer = _, me.format = G, this._internalTexturesCache.push(me);
  }
  if (a && this._caps.depthTextureExtension) {
    const Z = new As(this, ri.Depth);
    let te = 5, fe = I.DEPTH_COMPONENT16, _ = I.DEPTH_COMPONENT, G = I.UNSIGNED_SHORT, L = I.DEPTH_ATTACHMENT;
    this.webGLVersion < 2 ? fe = I.DEPTH_COMPONENT : f === 14 ? (te = 1, G = I.FLOAT, fe = I.DEPTH_COMPONENT32F) : f === 18 ? (te = 0, G = I.FLOAT_32_UNSIGNED_INT_24_8_REV, fe = I.DEPTH32F_STENCIL8, _ = I.DEPTH_STENCIL, L = I.DEPTH_STENCIL_ATTACHMENT) : f === 16 ? (te = 0, G = I.UNSIGNED_INT, fe = I.DEPTH_COMPONENT24, L = I.DEPTH_ATTACHMENT) : (f === 13 || f === 17) && (te = 12, G = I.UNSIGNED_INT_24_8, fe = I.DEPTH24_STENCIL8, _ = I.DEPTH_STENCIL, L = I.DEPTH_STENCIL_ATTACHMENT), I.activeTexture(I.TEXTURE0), I.bindTexture(I.TEXTURE_2D, Z._hardwareTexture.underlyingResource), I.texParameteri(I.TEXTURE_2D, I.TEXTURE_MAG_FILTER, I.NEAREST), I.texParameteri(I.TEXTURE_2D, I.TEXTURE_MIN_FILTER, I.NEAREST), I.texParameteri(I.TEXTURE_2D, I.TEXTURE_WRAP_S, I.CLAMP_TO_EDGE), I.texParameteri(I.TEXTURE_2D, I.TEXTURE_WRAP_T, I.CLAMP_TO_EDGE), I.texImage2D(I.TEXTURE_2D, 0, fe, k, R, 0, _, G, null), I.framebufferTexture2D(I.FRAMEBUFFER, L, I.TEXTURE_2D, Z._hardwareTexture.underlyingResource, 0), Z.baseWidth = k, Z.baseHeight = R, Z.width = k, Z.height = R, Z.isReady = !0, Z.samples = 1, Z.generateMipMaps = n, Z.samplingMode = 1, Z.format = f, Z.type = te, y[o] = Z, this._internalTexturesCache.push(Z);
  }
  return m.setTextures(y), t && I.drawBuffers(O), this._bindUnboundFramebuffer(null), m.setLayerAndFaceIndices(j, b), this.resetTextureCache(), m;
};
hr.prototype.updateMultipleRenderTargetTextureSampleCount = function(A, e, t = !0) {
  if (this.webGLVersion < 2 || !A || !A.texture)
    return 1;
  if (A.samples === e)
    return e;
  const r = A._attachments.length;
  if (r === 0)
    return 1;
  const n = this._gl;
  e = Math.min(e, this.getCaps().maxMSAASamples);
  const i = !!A._depthStencilBuffer;
  if (i && (n.deleteRenderbuffer(A._depthStencilBuffer), A._depthStencilBuffer = null), A._MSAAFramebuffer && (n.deleteFramebuffer(A._MSAAFramebuffer), A._MSAAFramebuffer = null), e > 1 && typeof n.renderbufferStorageMultisample == "function") {
    const s = n.createFramebuffer();
    if (!s)
      throw new Error("Unable to create multi sampled framebuffer");
    A._MSAAFramebuffer = s, this._bindUnboundFramebuffer(s);
    const a = [];
    for (let f = 0; f < r; f++)
      A.textures[f]._hardwareTexture.releaseMSAARenderBuffers();
    for (let f = 0; f < r; f++) {
      const o = A.textures[f], d = o._hardwareTexture, v = n[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + f : "COLOR_ATTACHMENT" + f + "_WEBGL"], u = this._createRenderBuffer(o.width, o.height, e, -1, this._getRGBABufferInternalSizedFormat(o.type, o.format, o._useSRGBBuffer), v);
      if (!u)
        throw new Error("Unable to create multi sampled framebuffer");
      d.addMSAARenderBuffer(u), o.samples = e, a.push(v);
    }
    t && n.drawBuffers(a);
  } else
    this._bindUnboundFramebuffer(A._framebuffer);
  return i && (A._depthStencilBuffer = this._setupFramebufferDepthAttachments(A._generateStencilBuffer, A._generateDepthBuffer, A.texture.width, A.texture.height, e)), this._bindUnboundFramebuffer(null), e;
};
hr.prototype._createDepthStencilCubeTexture = function(A, e, t) {
  const r = new As(this, ri.DepthStencil);
  if (r.isCube = !0, this.webGLVersion === 1)
    return Se.Error("Depth cube texture is not supported by WebGL 1."), r;
  const n = Object.assign({ bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1 }, e), i = this._gl;
  this._bindTextureDirectly(i.TEXTURE_CUBE_MAP, r, !0), this._setupDepthStencilTexture(r, A, n.generateStencil, n.bilinearFiltering, n.comparisonFunction), t._depthStencilTexture = r, t._depthStencilTextureWithStencil = n.generateStencil;
  for (let s = 0; s < 6; s++)
    n.generateStencil ? i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + s, 0, i.DEPTH24_STENCIL8, A, A, 0, i.DEPTH_STENCIL, i.UNSIGNED_INT_24_8, null) : i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + s, 0, i.DEPTH_COMPONENT24, A, A, 0, i.DEPTH_COMPONENT, i.UNSIGNED_INT, null);
  return this._bindTextureDirectly(i.TEXTURE_CUBE_MAP, null), this._internalTexturesCache.push(r), r;
};
hr.prototype._partialLoadFile = function(A, e, t, r, n = null) {
  const i = (a) => {
    t[e] = a, t._internalCount++, t._internalCount === 6 && r(t);
  }, s = (a, f) => {
    n && a && n(a.status + " " + a.statusText, f);
  };
  this._loadFile(A, i, void 0, void 0, !0, s);
};
hr.prototype._cascadeLoadFiles = function(A, e, t, r = null) {
  const n = [];
  n._internalCount = 0;
  for (let i = 0; i < 6; i++)
    this._partialLoadFile(t[i], i, n, e, r);
};
hr.prototype._cascadeLoadImgs = function(A, e, t, r, n = null, i) {
  const s = [];
  s._internalCount = 0;
  for (let a = 0; a < 6; a++)
    this._partialLoadImg(r[a], a, s, A, e, t, n, i);
};
hr.prototype._partialLoadImg = function(A, e, t, r, n, i, s = null, a) {
  const f = v4();
  nU(A, (v) => {
    t[e] = v, t._internalCount++, r && r.removePendingData(f), t._internalCount === 6 && i && i(n, t);
  }, (v, u) => {
    r && r.removePendingData(f), s && s(v, u);
  }, r ? r.offlineProvider : null, a), r && r.addPendingData(f);
};
hr.prototype._setCubeMapTextureParams = function(A, e, t) {
  const r = this._gl;
  r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MIN_FILTER, e ? r.LINEAR_MIPMAP_LINEAR : r.LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), A.samplingMode = e ? 3 : 2, e && this.getCaps().textureMaxLevel && t !== void 0 && t > 0 && (r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAX_LEVEL, t), A._maxLodLevel = t), this._bindTextureDirectly(r.TEXTURE_CUBE_MAP, null);
};
hr.prototype.createCubeTextureBase = function(A, e, t, r, n = null, i = null, s, a = null, f = !1, o = 0, d = 0, v = null, u = null, l = null, P = !1) {
  const p = v || new As(this, ri.Cube);
  p.isCube = !0, p.url = A, p.generateMipMaps = !r, p._lodGenerationScale = o, p._lodGenerationOffset = d, p._useSRGBBuffer = !!P && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU || !!r), p !== v && (p.label = A.substring(0, 60)), this._doNotHandleContextLost || (p._extension = a, p._files = t);
  const c = A;
  this._transformTextureUrl && !v && (A = this._transformTextureUrl(A));
  const H = A.split("?")[0], T = H.lastIndexOf("."), q = a || (T > -1 ? H.substring(T).toLowerCase() : "");
  let b = null;
  for (const w of hr._TextureLoaders)
    if (w.canLoad(q)) {
      b = w;
      break;
    }
  const j = (w, m) => {
    A === c ? i && w && i(w.status + " " + w.statusText, m) : (Se.Warn(`Failed to load ${A}, falling back to the ${c}`), this.createCubeTextureBase(c, e, t, !!r, n, i, s, a, f, o, d, p, u, l, P));
  };
  if (b) {
    const w = (m) => {
      u && u(p, m), b.loadCubeData(m, p, f, n, i);
    };
    t && t.length === 6 ? b.supportCascades ? this._cascadeLoadFiles(e, (m) => w(m.map((I) => new Uint8Array(I))), t, i) : i ? i("Textures type does not support cascades.") : Se.Warn("Texture loader does not support cascades.") : this._loadFile(A, (m) => w(new Uint8Array(m)), void 0, void 0, !0, j);
  } else {
    if (!t)
      throw new Error("Cannot load cubemap because files were not defined");
    this._cascadeLoadImgs(e, p, (w, m) => {
      l && l(w, m);
    }, t, i);
  }
  return this._internalTexturesCache.push(p), p;
};
hr.prototype.createCubeTexture = function(A, e, t, r, n = null, i = null, s, a = null, f = !1, o = 0, d = 0, v = null, u, l = !1) {
  const P = this._gl;
  return this.createCubeTextureBase(A, e, t, !!r, n, i, s, a, f, o, d, v, (p) => this._bindTextureDirectly(P.TEXTURE_CUBE_MAP, p, !0), (p, c) => {
    const H = this.needPOTTextures ? hr.GetExponentOfTwo(c[0].width, this._caps.maxCubemapTextureSize) : c[0].width, T = H, q = [
      P.TEXTURE_CUBE_MAP_POSITIVE_X,
      P.TEXTURE_CUBE_MAP_POSITIVE_Y,
      P.TEXTURE_CUBE_MAP_POSITIVE_Z,
      P.TEXTURE_CUBE_MAP_NEGATIVE_X,
      P.TEXTURE_CUBE_MAP_NEGATIVE_Y,
      P.TEXTURE_CUBE_MAP_NEGATIVE_Z
    ];
    this._bindTextureDirectly(P.TEXTURE_CUBE_MAP, p, !0), this._unpackFlipY(!1);
    const b = s ? this._getInternalFormat(s, p._useSRGBBuffer) : p._useSRGBBuffer ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : P.RGBA;
    let j = s ? this._getInternalFormat(s) : P.RGBA;
    p._useSRGBBuffer && this.webGLVersion === 1 && (j = b);
    for (let w = 0; w < q.length; w++)
      if (c[w].width !== H || c[w].height !== T) {
        if (this._prepareWorkingCanvas(), !this._workingCanvas || !this._workingContext) {
          Se.Warn("Cannot create canvas to resize texture.");
          return;
        }
        this._workingCanvas.width = H, this._workingCanvas.height = T, this._workingContext.drawImage(c[w], 0, 0, c[w].width, c[w].height, 0, 0, H, T), P.texImage2D(q[w], 0, b, j, P.UNSIGNED_BYTE, this._workingCanvas);
      } else
        P.texImage2D(q[w], 0, b, j, P.UNSIGNED_BYTE, c[w]);
    r || P.generateMipmap(P.TEXTURE_CUBE_MAP), this._setCubeMapTextureParams(p, !r), p.width = H, p.height = T, p.isReady = !0, s && (p.format = s), p.onLoadedObservable.notifyObservers(p), p.onLoadedObservable.clear(), n && n();
  }, !!l);
};
hr.prototype.setTextureSampler = function(A, e) {
  throw new Error("setTextureSampler: This engine does not support separate texture sampler objects!");
};
class fue {
}
const dte = new Oe(), vte = new Oe();
Object.defineProperty(Ge.prototype, "onBeforeViewRenderObservable", {
  get: function() {
    return dte;
  }
});
Object.defineProperty(Ge.prototype, "onAfterViewRenderObservable", {
  get: function() {
    return vte;
  }
});
Object.defineProperty(Ge.prototype, "inputElement", {
  get: function() {
    return this._inputElement;
  },
  set: function(A) {
    var e;
    this._inputElement !== A && (this._inputElement = A, (e = this._onEngineViewChanged) === null || e === void 0 || e.call(this));
  }
});
Ge.prototype.getInputElement = function() {
  return this.inputElement || this.getRenderingCanvas();
};
Ge.prototype.registerView = function(A, e, t) {
  this.views || (this.views = []);
  for (const i of this.views)
    if (i.target === A)
      return i;
  const r = this.getRenderingCanvas();
  r && (A.width = r.width, A.height = r.height);
  const n = { target: A, camera: e, clearBeforeCopy: t, enabled: !0, id: (Math.random() * 1e5).toFixed() };
  return this.views.push(n), e && !Array.isArray(e) && e.onDisposeObservable.add(() => {
    this.unRegisterView(A);
  }), n;
};
Ge.prototype.unRegisterView = function(A) {
  if (!this.views || this.views.length === 0)
    return this;
  for (const e of this.views)
    if (e.target === A) {
      const t = this.views.indexOf(e);
      t !== -1 && this.views.splice(t, 1);
      break;
    }
  return this;
};
Ge.prototype._renderViewStep = function(A) {
  const e = A.target, t = e.getContext("2d");
  if (!t)
    return !0;
  const r = this.getRenderingCanvas();
  dte.notifyObservers(A);
  const n = A.camera;
  let i = null, s = null, a = null;
  if (n && (a = Array.isArray(n) ? n[0].getScene() : n.getScene(), i = a.activeCamera, s = a.activeCameras, this.activeView = A, Array.isArray(n) ? a.activeCameras = n : (a.activeCamera = n, a.activeCameras = null)), A.customResize)
    A.customResize(e);
  else {
    const f = Math.floor(e.clientWidth / this._hardwareScalingLevel), o = Math.floor(e.clientHeight / this._hardwareScalingLevel), d = f !== e.width || r.width !== e.width || o !== e.height || r.height !== e.height;
    e.clientWidth && e.clientHeight && d && (e.width = f, e.height = o, this.setSize(f, o));
  }
  return !r.width || !r.height ? !1 : (this._renderFrame(), this.flushFramebuffer(), A.clearBeforeCopy && t.clearRect(0, 0, r.width, r.height), t.drawImage(r, 0, 0), a && (a.activeCameras = s, a.activeCamera = i), vte.notifyObservers(A), !0);
};
Ge.prototype._renderViews = function() {
  if (!this.views || this.views.length === 0 || !this.getRenderingCanvas())
    return !1;
  let e;
  for (const t of this.views) {
    if (!t.enabled)
      continue;
    if (t.target === this.inputElement) {
      e = t;
      continue;
    }
    if (!this._renderViewStep(t))
      return !1;
  }
  return e && !this._renderViewStep(e) ? !1 : (this.activeView = null, !0);
};
hr.prototype.createStorageBuffer = function(A, e) {
  throw new Error("createStorageBuffer: Unsupported method in this engine!");
};
hr.prototype.updateStorageBuffer = function(A, e, t, r) {
};
hr.prototype.readFromStorageBuffer = function(A, e, t, r) {
  throw new Error("readFromStorageBuffer: Unsupported method in this engine!");
};
hr.prototype.setStorageBuffer = function(A, e) {
  throw new Error("setStorageBuffer: Unsupported method in this engine!");
};
function Aue(A) {
  const e = (i) => {
    const s = "\\b" + i + "\\b";
    return A && (A === i || A.match(new RegExp(s, "g")));
  };
  if (this._excludedCompressedTextures && this._excludedCompressedTextures.some(e))
    return A;
  const t = A.lastIndexOf("."), r = A.lastIndexOf("?"), n = r > -1 ? A.substring(r, A.length) : "";
  return (t > -1 ? A.substring(0, t) : A) + this._textureFormatInUse + n;
}
Object.defineProperty(Ge.prototype, "texturesSupported", {
  get: function() {
    const A = [];
    return this._caps.astc && A.push("-astc.ktx"), this._caps.s3tc && A.push("-dxt.ktx"), this._caps.pvrtc && A.push("-pvrtc.ktx"), this._caps.etc2 && A.push("-etc2.ktx"), this._caps.etc1 && A.push("-etc1.ktx"), A;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(Ge.prototype, "textureFormatInUse", {
  get: function() {
    return this._textureFormatInUse || null;
  },
  enumerable: !0,
  configurable: !0
});
Ge.prototype.setCompressedTextureExclusions = function(A) {
  this._excludedCompressedTextures = A;
};
Ge.prototype.setTextureFormatToUse = function(A) {
  const e = this.texturesSupported;
  for (let t = 0, r = e.length; t < r; t++)
    for (let n = 0, i = A.length; n < i; n++)
      if (e[t] === A[n].toLowerCase())
        return this._transformTextureUrl = Aue.bind(this), this._textureFormatInUse = e[t];
  return this._textureFormatInUse = "", this._transformTextureUrl = null, null;
};
class hD {
  constructor() {
    const e = new ArrayBuffer(hD.DEFAULT_BUFFER_SIZE);
    this._uint32s = new Uint32Array(e), this._int32s = new Int32Array(e), this._float32s = new Float32Array(e), this._length = hD.DEFAULT_BUFFER_SIZE / 4, this._position = 0, this._nativeDataStream = new _native.NativeDataStream(() => {
      this._flush();
    });
  }
  writeUint32(e) {
    this._flushIfNecessary(1), this._uint32s[this._position++] = e;
  }
  writeInt32(e) {
    this._flushIfNecessary(1), this._int32s[this._position++] = e;
  }
  writeFloat32(e) {
    this._flushIfNecessary(1), this._float32s[this._position++] = e;
  }
  writeUint32Array(e) {
    this._flushIfNecessary(1 + e.length), this._uint32s[this._position++] = e.length, this._uint32s.set(e, this._position), this._position += e.length;
  }
  writeInt32Array(e) {
    this._flushIfNecessary(1 + e.length), this._uint32s[this._position++] = e.length, this._int32s.set(e, this._position), this._position += e.length;
  }
  writeFloat32Array(e) {
    this._flushIfNecessary(1 + e.length), this._uint32s[this._position++] = e.length, this._float32s.set(e, this._position), this._position += e.length;
  }
  writeNativeData(e) {
    this._flushIfNecessary(e.length), this._uint32s.set(e, this._position), this._position += e.length;
  }
  writeBoolean(e) {
    this.writeUint32(e ? 1 : 0);
  }
  _flushIfNecessary(e) {
    this._position + e > this._length && this._flush();
  }
  _flush() {
    this._nativeDataStream.writeBuffer(this._uint32s.buffer, this._position), this._position = 0;
  }
}
hD.DEFAULT_BUFFER_SIZE = 65536;
const B2 = [
  Math.sqrt(1 / (4 * Math.PI)),
  -Math.sqrt(3 / (4 * Math.PI)),
  Math.sqrt(3 / (4 * Math.PI)),
  -Math.sqrt(3 / (4 * Math.PI)),
  Math.sqrt(15 / (4 * Math.PI)),
  -Math.sqrt(15 / (4 * Math.PI)),
  Math.sqrt(5 / (16 * Math.PI)),
  -Math.sqrt(15 / (4 * Math.PI)),
  Math.sqrt(15 / (16 * Math.PI))
  // l22
], due = [
  () => 1,
  (A) => A.y,
  (A) => A.z,
  (A) => A.x,
  (A) => A.x * A.y,
  (A) => A.y * A.z,
  (A) => 3 * A.z * A.z - 1,
  (A) => A.x * A.z,
  (A) => A.x * A.x - A.y * A.y
  // l22
], F8 = (A, e) => B2[A] * due[A](e), N8 = [Math.PI, 2 * Math.PI / 3, 2 * Math.PI / 3, 2 * Math.PI / 3, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4];
class HD {
  constructor() {
    this.preScaled = !1, this.l00 = S.Zero(), this.l1_1 = S.Zero(), this.l10 = S.Zero(), this.l11 = S.Zero(), this.l2_2 = S.Zero(), this.l2_1 = S.Zero(), this.l20 = S.Zero(), this.l21 = S.Zero(), this.l22 = S.Zero();
  }
  /**
   * Adds a light to the spherical harmonics
   * @param direction the direction of the light
   * @param color the color of the light
   * @param deltaSolidAngle the delta solid angle of the light
   */
  addLight(e, t, r) {
    ue.Vector3[0].set(t.r, t.g, t.b);
    const n = ue.Vector3[0], i = ue.Vector3[1];
    n.scaleToRef(r, i), i.scaleToRef(F8(0, e), ue.Vector3[2]), this.l00.addInPlace(ue.Vector3[2]), i.scaleToRef(F8(1, e), ue.Vector3[2]), this.l1_1.addInPlace(ue.Vector3[2]), i.scaleToRef(F8(2, e), ue.Vector3[2]), this.l10.addInPlace(ue.Vector3[2]), i.scaleToRef(F8(3, e), ue.Vector3[2]), this.l11.addInPlace(ue.Vector3[2]), i.scaleToRef(F8(4, e), ue.Vector3[2]), this.l2_2.addInPlace(ue.Vector3[2]), i.scaleToRef(F8(5, e), ue.Vector3[2]), this.l2_1.addInPlace(ue.Vector3[2]), i.scaleToRef(F8(6, e), ue.Vector3[2]), this.l20.addInPlace(ue.Vector3[2]), i.scaleToRef(F8(7, e), ue.Vector3[2]), this.l21.addInPlace(ue.Vector3[2]), i.scaleToRef(F8(8, e), ue.Vector3[2]), this.l22.addInPlace(ue.Vector3[2]);
  }
  /**
   * Scales the spherical harmonics by the given amount
   * @param scale the amount to scale
   */
  scaleInPlace(e) {
    this.l00.scaleInPlace(e), this.l1_1.scaleInPlace(e), this.l10.scaleInPlace(e), this.l11.scaleInPlace(e), this.l2_2.scaleInPlace(e), this.l2_1.scaleInPlace(e), this.l20.scaleInPlace(e), this.l21.scaleInPlace(e), this.l22.scaleInPlace(e);
  }
  /**
   * Convert from incident radiance (Li) to irradiance (E) by applying convolution with the cosine-weighted hemisphere.
   *
   * ```
   * E_lm = A_l * L_lm
   * ```
   *
   * In spherical harmonics this convolution amounts to scaling factors for each frequency band.
   * This corresponds to equation 5 in "An Efficient Representation for Irradiance Environment Maps", where
   * the scaling factors are given in equation 9.
   */
  convertIncidentRadianceToIrradiance() {
    this.l00.scaleInPlace(N8[0]), this.l1_1.scaleInPlace(N8[1]), this.l10.scaleInPlace(N8[2]), this.l11.scaleInPlace(N8[3]), this.l2_2.scaleInPlace(N8[4]), this.l2_1.scaleInPlace(N8[5]), this.l20.scaleInPlace(N8[6]), this.l21.scaleInPlace(N8[7]), this.l22.scaleInPlace(N8[8]);
  }
  /**
   * Convert from irradiance to outgoing radiance for Lambertian BDRF, suitable for efficient shader evaluation.
   *
   * ```
   * L = (1/pi) * E * rho
   * ```
   *
   * This is done by an additional scale by 1/pi, so is a fairly trivial operation but important conceptually.
   */
  convertIrradianceToLambertianRadiance() {
    this.scaleInPlace(1 / Math.PI);
  }
  /**
   * Integrates the reconstruction coefficients directly in to the SH preventing further
   * required operations at run time.
   *
   * This is simply done by scaling back the SH with Ylm constants parameter.
   * The trigonometric part being applied by the shader at run time.
   */
  preScaleForRendering() {
    this.preScaled = !0, this.l00.scaleInPlace(B2[0]), this.l1_1.scaleInPlace(B2[1]), this.l10.scaleInPlace(B2[2]), this.l11.scaleInPlace(B2[3]), this.l2_2.scaleInPlace(B2[4]), this.l2_1.scaleInPlace(B2[5]), this.l20.scaleInPlace(B2[6]), this.l21.scaleInPlace(B2[7]), this.l22.scaleInPlace(B2[8]);
  }
  /**
   * update the spherical harmonics coefficients from the given array
   * @param data defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)
   * @returns the spherical harmonics (this)
   */
  updateFromArray(e) {
    return S.FromArrayToRef(e[0], 0, this.l00), S.FromArrayToRef(e[1], 0, this.l1_1), S.FromArrayToRef(e[2], 0, this.l10), S.FromArrayToRef(e[3], 0, this.l11), S.FromArrayToRef(e[4], 0, this.l2_2), S.FromArrayToRef(e[5], 0, this.l2_1), S.FromArrayToRef(e[6], 0, this.l20), S.FromArrayToRef(e[7], 0, this.l21), S.FromArrayToRef(e[8], 0, this.l22), this;
  }
  /**
   * update the spherical harmonics coefficients from the given floats array
   * @param data defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)
   * @returns the spherical harmonics (this)
   */
  updateFromFloatsArray(e) {
    return S.FromFloatsToRef(e[0], e[1], e[2], this.l00), S.FromFloatsToRef(e[3], e[4], e[5], this.l1_1), S.FromFloatsToRef(e[6], e[7], e[8], this.l10), S.FromFloatsToRef(e[9], e[10], e[11], this.l11), S.FromFloatsToRef(e[12], e[13], e[14], this.l2_2), S.FromFloatsToRef(e[15], e[16], e[17], this.l2_1), S.FromFloatsToRef(e[18], e[19], e[20], this.l20), S.FromFloatsToRef(e[21], e[22], e[23], this.l21), S.FromFloatsToRef(e[24], e[25], e[26], this.l22), this;
  }
  /**
   * Constructs a spherical harmonics from an array.
   * @param data defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)
   * @returns the spherical harmonics
   */
  static FromArray(e) {
    return new HD().updateFromArray(e);
  }
  // Keep for references.
  /**
   * Gets the spherical harmonics from polynomial
   * @param polynomial the spherical polynomial
   * @returns the spherical harmonics
   */
  static FromPolynomial(e) {
    const t = new HD();
    return t.l00 = e.xx.scale(0.376127).add(e.yy.scale(0.376127)).add(e.zz.scale(0.376126)), t.l1_1 = e.y.scale(0.977204), t.l10 = e.z.scale(0.977204), t.l11 = e.x.scale(0.977204), t.l2_2 = e.xy.scale(1.16538), t.l2_1 = e.yz.scale(1.16538), t.l20 = e.zz.scale(1.34567).subtract(e.xx.scale(0.672834)).subtract(e.yy.scale(0.672834)), t.l21 = e.zx.scale(1.16538), t.l22 = e.xx.scale(1.16538).subtract(e.yy.scale(1.16538)), t.l1_1.scaleInPlace(-1), t.l11.scaleInPlace(-1), t.l2_1.scaleInPlace(-1), t.l21.scaleInPlace(-1), t.scaleInPlace(Math.PI), t;
  }
}
class i4 {
  constructor() {
    this.x = S.Zero(), this.y = S.Zero(), this.z = S.Zero(), this.xx = S.Zero(), this.yy = S.Zero(), this.zz = S.Zero(), this.xy = S.Zero(), this.yz = S.Zero(), this.zx = S.Zero();
  }
  /**
   * The spherical harmonics used to create the polynomials.
   */
  get preScaledHarmonics() {
    return this._harmonics || (this._harmonics = HD.FromPolynomial(this)), this._harmonics.preScaled || this._harmonics.preScaleForRendering(), this._harmonics;
  }
  /**
   * Adds an ambient color to the spherical polynomial
   * @param color the color to add
   */
  addAmbient(e) {
    ue.Vector3[0].copyFromFloats(e.r, e.g, e.b);
    const t = ue.Vector3[0];
    this.xx.addInPlace(t), this.yy.addInPlace(t), this.zz.addInPlace(t);
  }
  /**
   * Scales the spherical polynomial by the given amount
   * @param scale the amount to scale
   */
  scaleInPlace(e) {
    this.x.scaleInPlace(e), this.y.scaleInPlace(e), this.z.scaleInPlace(e), this.xx.scaleInPlace(e), this.yy.scaleInPlace(e), this.zz.scaleInPlace(e), this.yz.scaleInPlace(e), this.zx.scaleInPlace(e), this.xy.scaleInPlace(e);
  }
  /**
   * Updates the spherical polynomial from harmonics
   * @param harmonics the spherical harmonics
   * @returns the spherical polynomial
   */
  updateFromHarmonics(e) {
    return this._harmonics = e, this.x.copyFrom(e.l11), this.x.scaleInPlace(1.02333).scaleInPlace(-1), this.y.copyFrom(e.l1_1), this.y.scaleInPlace(1.02333).scaleInPlace(-1), this.z.copyFrom(e.l10), this.z.scaleInPlace(1.02333), this.xx.copyFrom(e.l00), ue.Vector3[0].copyFrom(e.l20).scaleInPlace(0.247708), ue.Vector3[1].copyFrom(e.l22).scaleInPlace(0.429043), this.xx.scaleInPlace(0.886277).subtractInPlace(ue.Vector3[0]).addInPlace(ue.Vector3[1]), this.yy.copyFrom(e.l00), this.yy.scaleInPlace(0.886277).subtractInPlace(ue.Vector3[0]).subtractInPlace(ue.Vector3[1]), this.zz.copyFrom(e.l00), ue.Vector3[0].copyFrom(e.l20).scaleInPlace(0.495417), this.zz.scaleInPlace(0.886277).addInPlace(ue.Vector3[0]), this.yz.copyFrom(e.l2_1), this.yz.scaleInPlace(0.858086).scaleInPlace(-1), this.zx.copyFrom(e.l21), this.zx.scaleInPlace(0.858086).scaleInPlace(-1), this.xy.copyFrom(e.l2_2), this.xy.scaleInPlace(0.858086), this.scaleInPlace(1 / Math.PI), this;
  }
  /**
   * Gets the spherical polynomial from harmonics
   * @param harmonics the spherical harmonics
   * @returns the spherical polynomial
   */
  static FromHarmonics(e) {
    return new i4().updateFromHarmonics(e);
  }
  /**
   * Constructs a spherical polynomial from an array.
   * @param data defines the 9x3 coefficients (x, y, z, xx, yy, zz, yz, zx, xy)
   * @returns the spherical polynomial
   */
  static FromArray(e) {
    const t = new i4();
    return S.FromArrayToRef(e[0], 0, t.x), S.FromArrayToRef(e[1], 0, t.y), S.FromArrayToRef(e[2], 0, t.z), S.FromArrayToRef(e[3], 0, t.xx), S.FromArrayToRef(e[4], 0, t.yy), S.FromArrayToRef(e[5], 0, t.zz), S.FromArrayToRef(e[6], 0, t.yz), S.FromArrayToRef(e[7], 0, t.zx), S.FromArrayToRef(e[8], 0, t.xy), t;
  }
}
const vue = "rgbdDecodePixelShader", uue = `varying vec2 vUV;uniform sampler2D textureSampler;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{gl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);}`;
Le.ShadersStore[vue] = uue;
function ute(A, e, t, r = !0) {
  const n = A.getScene(), i = n.getEngine(), s = new Ta("resized" + A.name, { width: e, height: t }, n, !A.noMipmap, !0, A._texture.type, !1, A.samplingMode, !1);
  s.wrapU = A.wrapU, s.wrapV = A.wrapV, s.uOffset = A.uOffset, s.vOffset = A.vOffset, s.uScale = A.uScale, s.vScale = A.vScale, s.uAng = A.uAng, s.vAng = A.vAng, s.wAng = A.wAng, s.coordinatesIndex = A.coordinatesIndex, s.level = A.level, s.anisotropicFilteringLevel = A.anisotropicFilteringLevel, s._texture.isReady = !1, A.wrapU = We.CLAMP_ADDRESSMODE, A.wrapV = We.CLAMP_ADDRESSMODE;
  const a = new lg("pass", 1, null, r ? We.BILINEAR_SAMPLINGMODE : We.NEAREST_SAMPLINGMODE, i, !1, 0);
  return a.externalTextureSamplerBinding = !0, a.getEffect().executeWhenCompiled(() => {
    a.onApply = function(o) {
      o.setTexture("textureSampler", A);
    };
    const f = s.renderTarget;
    f && (n.postProcessManager.directRender([a], f), i.unBindFramebuffer(f), s.disposeFramebufferObjects(), a.dispose(), s.getInternalTexture().isReady = !0);
  }), s;
}
function ty(A, e, t, r, n, i, s, a) {
  const f = e.getEngine();
  return e.isReady = !1, n = n ?? e.samplingMode, r = r ?? e.type, i = i ?? e.format, s = s ?? e.width, a = a ?? e.height, r === -1 && (r = 0), new Promise((o) => {
    const d = new kr("postprocess", A, null, null, 1, null, n, f, !1, void 0, r, void 0, null, !1, i);
    d.externalTextureSamplerBinding = !0;
    const v = f.createRenderTargetTexture({ width: s, height: a }, {
      generateDepthBuffer: !1,
      generateMipMaps: !1,
      generateStencilBuffer: !1,
      samplingMode: n,
      type: r,
      format: i
    });
    d.getEffect().executeWhenCompiled(() => {
      d.onApply = (u) => {
        u._bindTexture("textureSampler", e), u.setFloat2("scale", 1, 1);
      }, t.postProcessManager.directRender([d], v, !0), f.restoreDefaultFramebuffer(), f._releaseTexture(e), d && d.dispose(), v._swapAndDie(e), e.type = r, e.format = 5, e.isReady = !0, o(e);
    });
  });
}
let PC, hG;
function LH(A) {
  PC || (PC = new Float32Array(1), hG = new Int32Array(PC.buffer)), PC[0] = A;
  const e = hG[0];
  let t = e >> 16 & 32768, r = e >> 12 & 2047;
  const n = e >> 23 & 255;
  return n < 103 ? t : n > 142 ? (t |= 31744, t |= (n == 255 ? 0 : 1) && e & 8388607, t) : n < 113 ? (r |= 2048, t |= (r >> 114 - n) + (r >> 113 - n & 1), t) : (t |= n - 112 << 10 | r >> 1, t += r & 1, t);
}
function QH(A) {
  const e = (A & 32768) >> 15, t = (A & 31744) >> 10, r = A & 1023;
  return t === 0 ? (e ? -1 : 1) * Math.pow(2, -14) * (r / Math.pow(2, 10)) : t == 31 ? r ? NaN : (e ? -1 : 1) * (1 / 0) : (e ? -1 : 1) * Math.pow(2, t - 15) * (1 + r / Math.pow(2, 10));
}
const lue = async (A, e, t, r, n) => {
  const i = A.getScene(), s = i.getEngine();
  let a;
  if (!A.isCube)
    a = new kr("lod", "lod", ["lod", "gamma"], null, 1, null, We.NEAREST_NEAREST_MIPNEAREST, s);
  else {
    const d = ["#define POSITIVEX", "#define NEGATIVEX", "#define POSITIVEY", "#define NEGATIVEY", "#define POSITIVEZ", "#define NEGATIVEZ"];
    a = new kr("lodCube", "lodCube", ["lod", "gamma"], null, 1, null, We.NEAREST_NEAREST_MIPNEAREST, s, !1, d[r]);
  }
  await new Promise((d) => {
    a.getEffect().executeWhenCompiled(() => {
      d(0);
    });
  });
  const f = new Ta("temp", { width: e, height: t }, i, !1);
  a.onApply = function(d) {
    d.setTexture("textureSampler", A), d.setFloat("lod", n), d.setBool("gamma", A.gammaSpace);
  };
  const o = A.getInternalTexture();
  try {
    if (f.renderTarget && o) {
      const d = o.samplingMode;
      n !== 0 ? A.updateSamplingMode(We.NEAREST_NEAREST_MIPNEAREST) : A.updateSamplingMode(We.NEAREST_NEAREST), i.postProcessManager.directRender([a], f.renderTarget, !0), A.updateSamplingMode(d);
      const v = await s.readPixels(0, 0, e, t), u = new Uint8Array(v.buffer, 0, v.byteLength);
      return s.unBindFramebuffer(f.renderTarget), u;
    } else
      throw Error("Render to texture failed.");
  } finally {
    f.dispose(), a.dispose();
  }
};
async function lte(A, e, t, r = 0, n = 0) {
  return !A.isReady() && A._texture && await new Promise((i, s) => {
    if (A._texture === null) {
      s(0);
      return;
    }
    A._texture.onLoadedObservable.addOnce(() => {
      i(0);
    });
  }), await lue(A, e, t, r, n);
}
const Pte = {
  /**
   * Uses the GPU to create a copy texture rescaled at a given size
   * @param texture Texture to copy from
   * @param width defines the desired width
   * @param height defines the desired height
   * @param useBilinearMode defines if bilinear mode has to be used
   * @returns the generated texture
   */
  CreateResizedCopy: ute,
  /**
   * Apply a post process to a texture
   * @param postProcessName name of the fragment post process
   * @param internalTexture the texture to encode
   * @param scene the scene hosting the texture
   * @param type type of the output texture. If not provided, use the one from internalTexture
   * @param samplingMode sampling mode to use to sample the source texture. If not provided, use the one from internalTexture
   * @param format format of the output texture. If not provided, use the one from internalTexture
   * @returns a promise with the internalTexture having its texture replaced by the result of the processing
   */
  ApplyPostProcess: ty,
  /**
   * Converts a number to half float
   * @param value number to convert
   * @returns converted number
   */
  ToHalfFloat: LH,
  /**
   * Converts a half float to a number
   * @param value half float to convert
   * @returns converted half float
   */
  FromHalfFloat: QH,
  /**
   * Gets the data of the specified texture by rendering it to an intermediate RGBA texture and retrieving the bytes from it.
   * This is convienent to get 8-bit RGBA values for a texture in a GPU compressed format.
   * @param texture the source texture
   * @param width the width of the result, which does not have to match the source texture width
   * @param height the height of the result, which does not have to match the source texture height
   * @param face if the texture has multiple faces, the face index to use for the source
   * @param channels a filter for which of the RGBA channels to return in the result
   * @param lod if the texture has multiple LODs, the lod index to use for the source
   * @returns the 8-bit texture data
   */
  GetTextureDataAsync: lte
};
class $C {
  /**
   * Expand the RGBD Texture from RGBD to Half Float if possible.
   * @param texture the texture to expand.
   */
  static ExpandRGBDTexture(e) {
    const t = e._texture;
    if (!t || !e.isRGBD)
      return;
    const r = t.getEngine(), n = r.getCaps(), i = t.isReady;
    let s = !1;
    n.textureHalfFloatRender && n.textureHalfFloatLinearFiltering ? (s = !0, t.type = 2) : n.textureFloatRender && n.textureFloatLinearFiltering && (s = !0, t.type = 1), s && (t.isReady = !1, t._isRGBD = !1, t.invertY = !1);
    const a = () => {
      if (s) {
        const f = new kr("rgbdDecode", "rgbdDecode", null, null, 1, null, 3, r, !1, void 0, t.type, void 0, null, !1);
        f.externalTextureSamplerBinding = !0;
        const o = r.createRenderTargetTexture(t.width, {
          generateDepthBuffer: !1,
          generateMipMaps: !1,
          generateStencilBuffer: !1,
          samplingMode: t.samplingMode,
          type: t.type,
          format: 5
        });
        f.getEffect().executeWhenCompiled(() => {
          f.onApply = (d) => {
            d._bindTexture("textureSampler", t), d.setFloat2("scale", 1, 1);
          }, e.getScene().postProcessManager.directRender([f], o, !0), r.restoreDefaultFramebuffer(), r._releaseTexture(t), f && f.dispose(), o._swapAndDie(t), t.isReady = !0;
        });
      }
    };
    i ? a() : e.onLoadObservable.addOnce(a);
  }
  /**
   * Encode the texture to RGBD if possible.
   * @param internalTexture the texture to encode
   * @param scene the scene hosting the texture
   * @param outputTextureType type of the texture in which the encoding is performed
   * @returns a promise with the internalTexture having its texture replaced by the result of the processing
   */
  static EncodeTextureToRGBD(e, t, r = 0) {
    return ty("rgbdEncode", e, t, r, 1, 5);
  }
}
class WW {
  constructor(e, t, r, n) {
    this.name = e, this.worldAxisForNormal = t, this.worldAxisForFileX = r, this.worldAxisForFileY = n;
  }
}
class Sm {
  /**
   * Converts a texture to the according Spherical Polynomial data.
   * This extracts the first 3 orders only as they are the only one used in the lighting.
   *
   * @param texture The texture to extract the information from.
   * @returns The Spherical Polynomial data.
   */
  static ConvertCubeMapTextureToSphericalPolynomial(e) {
    var t;
    if (!e.isCube)
      return null;
    (t = e.getScene()) === null || t === void 0 || t.getEngine().flushFramebuffer();
    const r = e.getSize().width, n = e.readPixels(0, void 0, void 0, !1), i = e.readPixels(1, void 0, void 0, !1);
    let s, a;
    e.isRenderTarget ? (s = e.readPixels(3, void 0, void 0, !1), a = e.readPixels(2, void 0, void 0, !1)) : (s = e.readPixels(2, void 0, void 0, !1), a = e.readPixels(3, void 0, void 0, !1));
    const f = e.readPixels(4, void 0, void 0, !1), o = e.readPixels(5, void 0, void 0, !1), d = e.gammaSpace, v = 5;
    let u = 0;
    return (e.textureType == 1 || e.textureType == 2) && (u = 1), new Promise((l) => {
      Promise.all([i, n, s, a, f, o]).then(([P, p, c, H, T, q]) => {
        const b = {
          size: r,
          right: p,
          left: P,
          up: c,
          down: H,
          front: T,
          back: q,
          format: v,
          type: u,
          gammaSpace: d
        };
        l(this.ConvertCubeMapToSphericalPolynomial(b));
      });
    });
  }
  /**
   * Compute the area on the unit sphere of the rectangle defined by (x,y) and the origin
   * See https://www.rorydriscoll.com/2012/01/15/cubemap-texel-solid-angle/
   * @param x
   * @param y
   */
  static _AreaElement(e, t) {
    return Math.atan2(e * t, Math.sqrt(e * e + t * t + 1));
  }
  /**
   * Converts a cubemap to the according Spherical Polynomial data.
   * This extracts the first 3 orders only as they are the only one used in the lighting.
   *
   * @param cubeInfo The Cube map to extract the information from.
   * @returns The Spherical Polynomial data.
   */
  static ConvertCubeMapToSphericalPolynomial(e) {
    const t = new HD();
    let r = 0;
    const n = 2 / e.size, i = n, s = 0.5 * n, a = s - 1;
    for (let u = 0; u < 6; u++) {
      const l = this._FileFaces[u], P = e[l.name];
      let p = a;
      const c = e.format === 5 ? 4 : 3;
      for (let H = 0; H < e.size; H++) {
        let T = a;
        for (let q = 0; q < e.size; q++) {
          const b = l.worldAxisForFileX.scale(T).add(l.worldAxisForFileY.scale(p)).add(l.worldAxisForNormal);
          b.normalize();
          const j = this._AreaElement(T - s, p - s) - this._AreaElement(T - s, p + s) - this._AreaElement(T + s, p - s) + this._AreaElement(T + s, p + s);
          let w = P[H * e.size * c + q * c + 0], m = P[H * e.size * c + q * c + 1], I = P[H * e.size * c + q * c + 2];
          isNaN(w) && (w = 0), isNaN(m) && (m = 0), isNaN(I) && (I = 0), e.type === 0 && (w /= 255, m /= 255, I /= 255), e.gammaSpace && (w = Math.pow(Xt.Clamp(w), xI), m = Math.pow(Xt.Clamp(m), xI), I = Math.pow(Xt.Clamp(I), xI));
          const N = this.MAX_HDRI_VALUE;
          if (this.PRESERVE_CLAMPED_COLORS) {
            const R = Math.max(w, m, I);
            if (R > N) {
              const y = N / R;
              w *= y, m *= y, I *= y;
            }
          } else
            w = Xt.Clamp(w, 0, N), m = Xt.Clamp(m, 0, N), I = Xt.Clamp(I, 0, N);
          const k = new Ne(w, m, I);
          t.addLight(b, k, j), r += j, T += n;
        }
        p += i;
      }
    }
    const v = 4 * Math.PI * 6 / 6 / r;
    return t.scaleInPlace(v), t.convertIncidentRadianceToIrradiance(), t.convertIrradianceToLambertianRadiance(), i4.FromHarmonics(t);
  }
}
Sm._FileFaces = [
  new WW("right", new S(1, 0, 0), new S(0, 0, -1), new S(0, -1, 0)),
  new WW("left", new S(-1, 0, 0), new S(0, 0, 1), new S(0, -1, 0)),
  new WW("up", new S(0, 1, 0), new S(1, 0, 0), new S(0, 0, 1)),
  new WW("down", new S(0, -1, 0), new S(1, 0, 0), new S(0, 0, -1)),
  new WW("front", new S(0, 0, 1), new S(1, 0, 0), new S(0, -1, 0)),
  new WW("back", new S(0, 0, -1), new S(-1, 0, 0), new S(0, -1, 0))
  // -Z bottom
];
Sm.MAX_HDRI_VALUE = 4096;
Sm.PRESERVE_CLAMPED_COLORS = !1;
ls.prototype.forceSphericalPolynomialsRecompute = function() {
  this._texture && (this._texture._sphericalPolynomial = null, this._texture._sphericalPolynomialPromise = null, this._texture._sphericalPolynomialComputed = !1);
};
Object.defineProperty(ls.prototype, "sphericalPolynomial", {
  get: function() {
    if (this._texture) {
      if (this._texture._sphericalPolynomial || this._texture._sphericalPolynomialComputed)
        return this._texture._sphericalPolynomial;
      if (this._texture.isReady)
        return this._texture._sphericalPolynomialPromise || (this._texture._sphericalPolynomialPromise = Sm.ConvertCubeMapTextureToSphericalPolynomial(this), this._texture._sphericalPolynomialPromise === null ? this._texture._sphericalPolynomialComputed = !0 : this._texture._sphericalPolynomialPromise.then((A) => {
          this._texture._sphericalPolynomial = A, this._texture._sphericalPolynomialComputed = !0;
        })), null;
    }
    return null;
  },
  set: function(A) {
    this._texture && (this._texture._sphericalPolynomial = A);
  },
  enumerable: !0,
  configurable: !0
});
const Pue = "rgbdEncodePixelShader", cue = `varying vec2 vUV;uniform sampler2D textureSampler;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{gl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);}`;
Le.ShadersStore[Pue] = cue;
const kQ = "image/png", nF = 2, WI = [134, 22, 135, 150, 246, 214, 150, 54];
function ry(A) {
  const e = new DataView(A.buffer, A.byteOffset, A.byteLength);
  let t = 0;
  for (let s = 0; s < WI.length; s++)
    if (e.getUint8(t++) !== WI[s])
      return Se.Error("Not a babylon environment map"), null;
  let r = "", n = 0;
  for (; n = e.getUint8(t++); )
    r += String.fromCharCode(n);
  let i = JSON.parse(r);
  return i = eV(i), i.specular && (i.specular.specularDataPosition = t, i.specular.lodGenerationScale = i.specular.lodGenerationScale || 0.8), i;
}
function eV(A) {
  if (A.version > nF)
    throw new Error(`Unsupported babylon environment map version "${A.version}". Latest supported version is "${nF}".`);
  return A.version === 2 || (A = Object.assign(Object.assign({}, A), { version: 2, imageType: kQ })), A;
}
async function cte(A, e = {}) {
  var t, r;
  const n = A.getInternalTexture();
  if (!n)
    return Promise.reject("The cube texture is invalid.");
  const i = (t = e.imageType) !== null && t !== void 0 ? t : kQ, s = n.getEngine();
  if (A.textureType !== 2 && A.textureType !== 1 && A.textureType !== 0 && A.textureType !== 0 && A.textureType !== 7 && A.textureType !== -1)
    return Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");
  let a = 1;
  if (!s.getCaps().textureFloatRender && (a = 2, !s.getCaps().textureHalfFloatRender))
    return Promise.reject("Env texture can only be created when the browser supports half float or full float rendering.");
  A.sphericalPolynomial;
  const f = (r = A.getInternalTexture()) === null || r === void 0 ? void 0 : r._sphericalPolynomialPromise, o = n.width, d = new sr(s), v = {};
  s.flushFramebuffer();
  const u = Xt.ILog2(n.width);
  for (let m = 0; m <= u; m++) {
    const I = Math.pow(2, u - m);
    for (let N = 0; N < 6; N++) {
      let k = await A.readPixels(N, m, void 0, !1);
      if (k && k.byteLength === k.length) {
        const Y = new Float32Array(k.byteLength * 4);
        for (let ee = 0; ee < k.byteLength; ee++)
          Y[ee] = k[ee] / 255, Y[ee] = Math.pow(Y[ee], 2.2);
        k = Y;
      } else if (k && A.gammaSpace) {
        const Y = k;
        for (let ee = 0; ee < Y.length; ee++)
          Y[ee] = Math.pow(Y[ee], 2.2);
      }
      const R = s.createRawTexture(k, I, I, 5, !1, !0, 1, null, a);
      await $C.EncodeTextureToRGBD(R, d, a);
      const y = await s._readTexturePixels(R, I, I), O = await eA.DumpDataAsync(I, I, y, i, void 0, !1, !0, e.imageQuality);
      v[m * 6 + N] = O, R.dispose();
    }
  }
  d.dispose(), f && await f;
  const l = {
    version: nF,
    width: o,
    imageType: i,
    irradiance: pue(A),
    specular: {
      mipmaps: [],
      lodGenerationScale: A.lodGenerationScale
    }
  };
  let P = 0;
  for (let m = 0; m <= u; m++)
    for (let I = 0; I < 6; I++) {
      const N = v[m * 6 + I].byteLength;
      l.specular.mipmaps.push({
        length: N,
        position: P
      }), P += N;
    }
  const p = JSON.stringify(l), c = new ArrayBuffer(p.length + 1), H = new Uint8Array(c);
  for (let m = 0, I = p.length; m < I; m++)
    H[m] = p.charCodeAt(m);
  H[p.length] = 0;
  const T = WI.length + P + c.byteLength, q = new ArrayBuffer(T), b = new Uint8Array(q), j = new DataView(q);
  let w = 0;
  for (let m = 0; m < WI.length; m++)
    j.setUint8(w++, WI[m]);
  b.set(new Uint8Array(c), w), w += c.byteLength;
  for (let m = 0; m <= u; m++)
    for (let I = 0; I < 6; I++) {
      const N = v[m * 6 + I];
      b.set(new Uint8Array(N), w), w += N.byteLength;
    }
  return q;
}
function pue(A) {
  const e = A.sphericalPolynomial;
  return e == null ? null : {
    x: [e.x.x, e.x.y, e.x.z],
    y: [e.y.x, e.y.y, e.y.z],
    z: [e.z.x, e.z.y, e.z.z],
    xx: [e.xx.x, e.xx.y, e.xx.z],
    yy: [e.yy.x, e.yy.y, e.yy.z],
    zz: [e.zz.x, e.zz.y, e.zz.z],
    yz: [e.yz.x, e.yz.y, e.yz.z],
    zx: [e.zx.x, e.zx.y, e.zx.z],
    xy: [e.xy.x, e.xy.y, e.xy.z]
  };
}
function ny(A, e) {
  e = eV(e);
  const t = e.specular;
  let r = Xt.Log2(e.width);
  if (r = Math.round(r) + 1, t.mipmaps.length !== 6 * r)
    throw new Error(`Unsupported specular mipmaps number "${t.mipmaps.length}"`);
  const n = new Array(r);
  for (let i = 0; i < r; i++) {
    n[i] = new Array(6);
    for (let s = 0; s < 6; s++) {
      const a = t.mipmaps[i * 6 + s];
      n[i][s] = new Uint8Array(A.buffer, A.byteOffset + t.specularDataPosition + a.position, a.length);
    }
  }
  return n;
}
function EQ(A, e, t) {
  t = eV(t);
  const r = t.specular;
  if (!r)
    return Promise.resolve();
  A._lodGenerationScale = r.lodGenerationScale;
  const n = ny(e, t);
  return YI(A, n, t.imageType);
}
function HG(A, e, t, r, n, i, s, a, f, o, d) {
  return new Promise((v, u) => {
    if (t) {
      const l = e.createTexture(null, !0, !0, null, 1, null, (P) => {
        u(P);
      }, A);
      r.getEffect().executeWhenCompiled(() => {
        r.externalTextureSamplerBinding = !0, r.onApply = (P) => {
          P._bindTexture("textureSampler", l), P.setFloat2("scale", 1, e._features.needsInvertingBitmap && A instanceof ImageBitmap ? -1 : 1);
        }, e.scenes.length && (e.scenes[0].postProcessManager.directRender([r], o, !0, i, s), e.restoreDefaultFramebuffer(), l.dispose(), URL.revokeObjectURL(n), v());
      });
    } else {
      if (e._uploadImageToTexture(d, A, i, s), a) {
        const l = f[s];
        l && e._uploadImageToTexture(l._texture, A, i, 0);
      }
      v();
    }
  });
}
function YI(A, e, t = kQ) {
  if (!ye.IsExponentOfTwo(A.width))
    throw new Error("Texture size must be a power of two");
  const r = Xt.ILog2(A.width) + 1, n = A.getEngine();
  let i = !1, s = !1, a = null, f = null, o = null;
  const d = n.getCaps();
  if (A.format = 5, A.type = 0, A.generateMipMaps = !0, A._cachedAnisotropicFilteringLevel = null, n.updateTextureSamplingMode(3, A), d.textureLOD ? n._features.supportRenderAndCopyToLodForFloatTextures ? d.textureHalfFloatRender && d.textureHalfFloatLinearFiltering ? (i = !0, A.type = 2) : d.textureFloatRender && d.textureFloatLinearFiltering && (i = !0, A.type = 1) : i = !1 : (i = !1, s = !0, o = {}), i)
    a = new kr("rgbdDecode", "rgbdDecode", null, null, 1, null, 3, n, !1, void 0, A.type, void 0, null, !1), A._isRGBD = !1, A.invertY = !1, f = n.createRenderTargetCubeTexture(A.width, {
      generateDepthBuffer: !1,
      generateMipMaps: !0,
      generateStencilBuffer: !1,
      samplingMode: 3,
      type: A.type,
      format: 5
    });
  else if (A._isRGBD = !0, A.invertY = !0, s) {
    const l = A._lodGenerationScale, P = A._lodGenerationOffset;
    for (let p = 0; p < 3; p++) {
      const H = 1 - p / 2, T = P, q = (r - 1) * l + P, b = T + (q - T) * H, j = Math.round(Math.min(Math.max(b, 0), q)), w = new As(n, ri.Temp);
      w.isCube = !0, w.invertY = !0, w.generateMipMaps = !1, n.updateTextureSamplingMode(2, w);
      const m = new ls(null);
      switch (m._isCube = !0, m._texture = w, o[j] = m, p) {
        case 0:
          A._lodTextureLow = m;
          break;
        case 1:
          A._lodTextureMid = m;
          break;
        case 2:
          A._lodTextureHigh = m;
          break;
      }
    }
  }
  const v = [];
  for (let u = 0; u < e.length; u++)
    for (let l = 0; l < 6; l++) {
      const P = e[u][l], p = new Blob([P], { type: t }), c = URL.createObjectURL(p);
      let H;
      if (typeof Image > "u" || n._features.forceBitmapOverHTMLImageElement)
        H = n.createImageBitmap(p, { premultiplyAlpha: "none" }).then((T) => HG(T, n, i, a, c, l, u, s, o, f, A));
      else {
        const T = new Image();
        T.src = c, H = new Promise((q, b) => {
          T.onload = () => {
            HG(T, n, i, a, c, l, u, s, o, f, A).then(() => q()).catch((j) => {
              b(j);
            });
          }, T.onerror = (j) => {
            b(j);
          };
        });
      }
      v.push(H);
    }
  if (e.length < r) {
    let u;
    const l = Math.pow(2, r - 1 - e.length), P = l * l * 4;
    switch (A.type) {
      case 0: {
        u = new Uint8Array(P);
        break;
      }
      case 2: {
        u = new Uint16Array(P);
        break;
      }
      case 1: {
        u = new Float32Array(P);
        break;
      }
    }
    for (let p = e.length; p < r; p++)
      for (let c = 0; c < 6; c++)
        n._uploadArrayBufferViewToTexture(A, u, c, p);
  }
  return Promise.all(v).then(() => {
    f && (n._releaseTexture(A), f._swapAndDie(A)), a && a.dispose(), s && (A._lodTextureHigh && A._lodTextureHigh._texture && (A._lodTextureHigh._texture.isReady = !0), A._lodTextureMid && A._lodTextureMid._texture && (A._lodTextureMid._texture.isReady = !0), A._lodTextureLow && A._lodTextureLow._texture && (A._lodTextureLow._texture.isReady = !0));
  });
}
function iy(A, e) {
  e = eV(e);
  const t = e.irradiance;
  if (!t)
    return;
  const r = new i4();
  S.FromArrayToRef(t.x, 0, r.x), S.FromArrayToRef(t.y, 0, r.y), S.FromArrayToRef(t.z, 0, r.z), S.FromArrayToRef(t.xx, 0, r.xx), S.FromArrayToRef(t.yy, 0, r.yy), S.FromArrayToRef(t.zz, 0, r.zz), S.FromArrayToRef(t.yz, 0, r.yz), S.FromArrayToRef(t.zx, 0, r.zx), S.FromArrayToRef(t.xy, 0, r.xy), A._sphericalPolynomial = r;
}
function pte(A, e, t, r, n) {
  const i = A.getEngine().createRawCubeTexture(null, A.width, A.format, A.type, A.generateMipMaps, A.invertY, A.samplingMode, A._compression), s = YI(i, e).then(() => A);
  return A.onRebuildCallback = (a) => ({
    proxy: s,
    isReady: !0,
    isAsync: !0
  }), A._source = ri.CubeRawRGBD, A._bufferViewArrayArray = e, A._lodGenerationScale = r, A._lodGenerationOffset = n, A._sphericalPolynomial = t, YI(A, e).then(() => (A.isReady = !0, A));
}
const hue = {
  /**
   * Gets the environment info from an env file.
   * @param data The array buffer containing the .env bytes.
   * @returns the environment file info (the json header) if successfully parsed, normalized to the latest supported version.
   */
  GetEnvInfo: ry,
  /**
   * Creates an environment texture from a loaded cube texture.
   * @param texture defines the cube texture to convert in env file
   * @param options options for the conversion process
   * @param options.imageType the mime type for the encoded images, with support for "image/png" (default) and "image/webp"
   * @param options.imageQuality the image quality of encoded WebP images.
   * @returns a promise containing the environment data if successful.
   */
  CreateEnvTextureAsync: cte,
  /**
   * Creates the ArrayBufferViews used for initializing environment texture image data.
   * @param data the image data
   * @param info parameters that determine what views will be created for accessing the underlying buffer
   * @returns the views described by info providing access to the underlying buffer
   */
  CreateImageDataArrayBufferViews: ny,
  /**
   * Uploads the texture info contained in the env file to the GPU.
   * @param texture defines the internal texture to upload to
   * @param data defines the data to load
   * @param info defines the texture info retrieved through the GetEnvInfo method
   * @returns a promise
   */
  UploadEnvLevelsAsync: EQ,
  /**
   * Uploads the levels of image data to the GPU.
   * @param texture defines the internal texture to upload to
   * @param imageData defines the array buffer views of image data [mipmap][face]
   * @param imageType the mime type of the image data
   * @returns a promise
   */
  UploadLevelsAsync: YI,
  /**
   * Uploads spherical polynomials information to the texture.
   * @param texture defines the texture we are trying to upload the information to
   * @param info defines the environment texture info retrieved through the GetEnvInfo method
   */
  UploadEnvSpherical: iy
};
function cC(A, e, t, r) {
  let n = r, i = 0, s = "";
  for (; n < t.length; ) {
    const a = t.charAt(n);
    if (s)
      a === s ? s === '"' || s === "'" ? t.charAt(n - 1) !== "\\" && (s = "") : s = "" : s === "*/" && a === "*" && n + 1 < t.length && (t.charAt(n + 1) === "/" && (s = ""), s === "" && n++);
    else
      switch (a) {
        case A:
          i++;
          break;
        case e:
          i--;
          break;
        case '"':
        case "'":
        case "`":
          s = a;
          break;
        case "/":
          if (n + 1 < t.length) {
            const f = t.charAt(n + 1);
            f === "/" ? s = `
` : f === "*" && (s = "*/");
          }
          break;
      }
    if (n++, i === 0)
      break;
  }
  return i === 0 ? n - 1 : -1;
}
function gG(A, e) {
  for (; e < A.length; ) {
    const t = A[e];
    if (t !== " " && t !== `
` && t !== "\r" && t !== "	" && t !== `
` && t !== " ")
      break;
    e++;
  }
  return e;
}
function xE(A) {
  const e = A.charCodeAt(0);
  return e >= 48 && e <= 57 || // 0-9
  e >= 65 && e <= 90 || // A-Z
  e >= 97 && e <= 122 || // a-z
  e == 95;
}
function iF(A) {
  let e = 0, t = "", r = !1;
  const n = [];
  for (; e < A.length; ) {
    const i = A.charAt(e);
    if (t)
      i === t ? t === '"' || t === "'" ? (A.charAt(e - 1) !== "\\" && (t = ""), n.push(i)) : (t = "", r = !1) : t === "*/" && i === "*" && e + 1 < A.length ? (A.charAt(e + 1) === "/" && (t = ""), t === "" && (r = !1, e++)) : r || n.push(i);
    else {
      switch (i) {
        case '"':
        case "'":
        case "`":
          t = i;
          break;
        case "/":
          if (e + 1 < A.length) {
            const s = A.charAt(e + 1);
            s === "/" ? (t = `
`, r = !0) : s === "*" && (t = "*/", r = !0);
          }
          break;
      }
      r || n.push(i);
    }
    e++;
  }
  return n.join("");
}
function Hue(A, e, t, r) {
  for (; e >= 0 && A.charAt(e) !== t && (!r || A.charAt(e) !== r); )
    e--;
  return e;
}
function gue(A) {
  return A.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
class Aq {
  /** Gets the code after the inlining process */
  get code() {
    return this._sourceCode;
  }
  /**
   * Initializes the inliner
   * @param sourceCode shader code source to inline
   * @param numMaxIterations maximum number of iterations (used to detect recursive calls)
   */
  constructor(e, t = 20) {
    this.debug = !1, this._sourceCode = e, this._numMaxIterations = t, this._functionDescr = [], this.inlineToken = "#define inline";
  }
  /**
   * Start the processing of the shader code
   */
  processCode() {
    this.debug && console.log(`Start inlining process (code size=${this._sourceCode.length})...`), this._collectFunctions(), this._processInlining(this._numMaxIterations), this.debug && console.log("End of inlining process.");
  }
  _collectFunctions() {
    let e = 0;
    for (; e < this._sourceCode.length; ) {
      const t = this._sourceCode.indexOf(this.inlineToken, e);
      if (t < 0)
        break;
      const r = this._sourceCode.indexOf("(", t + this.inlineToken.length);
      if (r < 0) {
        this.debug && console.warn(`Could not find the opening parenthesis after the token. startIndex=${e}`), e = t + this.inlineToken.length;
        continue;
      }
      const n = Aq._RegexpFindFunctionNameAndType.exec(this._sourceCode.substring(t + this.inlineToken.length, r));
      if (!n) {
        this.debug && console.warn(`Could not extract the name/type of the function from: ${this._sourceCode.substring(t + this.inlineToken.length, r)}`), e = t + this.inlineToken.length;
        continue;
      }
      const [i, s] = [n[3], n[4]], a = cC("(", ")", this._sourceCode, r);
      if (a < 0) {
        this.debug && console.warn(`Could not extract the parameters the function '${s}' (type=${i}). funcParamsStartIndex=${r}`), e = t + this.inlineToken.length;
        continue;
      }
      const f = this._sourceCode.substring(r + 1, a), o = gG(this._sourceCode, a + 1);
      if (o === this._sourceCode.length) {
        this.debug && console.warn(`Could not extract the body of the function '${s}' (type=${i}). funcParamsEndIndex=${a}`), e = t + this.inlineToken.length;
        continue;
      }
      const d = cC("{", "}", this._sourceCode, o);
      if (d < 0) {
        this.debug && console.warn(`Could not extract the body of the function '${s}' (type=${i}). funcBodyStartIndex=${o}`), e = t + this.inlineToken.length;
        continue;
      }
      const v = this._sourceCode.substring(o, d + 1), u = iF(f).split(","), l = [];
      for (let c = 0; c < u.length; ++c) {
        const H = u[c].trim(), T = H.lastIndexOf(" ");
        T >= 0 && l.push(H.substring(T + 1));
      }
      i !== "void" && l.push("return"), this._functionDescr.push({
        name: s,
        type: i,
        parameters: l,
        body: v,
        callIndex: 0
      }), e = d + 1;
      const P = t > 0 ? this._sourceCode.substring(0, t) : "", p = d + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(d + 1) : "";
      this._sourceCode = P + p, e -= d + 1 - t;
    }
    this.debug && console.log(`Collect functions: ${this._functionDescr.length} functions found. functionDescr=`, this._functionDescr);
  }
  _processInlining(e = 20) {
    for (; e-- >= 0 && this._replaceFunctionCallsByCode(); )
      ;
    return this.debug && console.log(`numMaxIterations is ${e} after inlining process`), e >= 0;
  }
  _replaceFunctionCallsByCode() {
    let e = !1;
    for (const t of this._functionDescr) {
      const { name: r, type: n, parameters: i, body: s } = t;
      let a = 0;
      for (; a < this._sourceCode.length; ) {
        const f = this._sourceCode.indexOf(r, a);
        if (f < 0)
          break;
        if (f === 0 || xE(this._sourceCode.charAt(f - 1))) {
          a = f + r.length;
          continue;
        }
        const o = gG(this._sourceCode, f + r.length);
        if (o === this._sourceCode.length || this._sourceCode.charAt(o) !== "(") {
          a = f + r.length;
          continue;
        }
        const d = cC("(", ")", this._sourceCode, o);
        if (d < 0) {
          this.debug && console.warn(`Could not extract the parameters of the function call. Function '${r}' (type=${n}). callParamsStartIndex=${o}`), a = f + r.length;
          continue;
        }
        const v = this._sourceCode.substring(o + 1, d), l = ((q) => {
          const b = [];
          let j = 0, w = 0;
          for (; j < q.length; ) {
            if (q.charAt(j) === "(") {
              const m = cC("(", ")", q, j);
              if (m < 0)
                return null;
              j = m;
            } else
              q.charAt(j) === "," && (b.push(q.substring(w, j)), w = j + 1);
            j++;
          }
          return w < j && b.push(q.substring(w, j)), b;
        })(iF(v));
        if (l === null) {
          this.debug && console.warn(`Invalid function call: can't extract the parameters of the function call. Function '${r}' (type=${n}). callParamsStartIndex=${o}, callParams=` + v), a = f + r.length;
          continue;
        }
        const P = [];
        for (let q = 0; q < l.length; ++q) {
          const b = l[q].trim();
          P.push(b);
        }
        const p = n !== "void" ? r + "_" + t.callIndex++ : null;
        if (p && P.push(p + " ="), P.length !== i.length) {
          this.debug && console.warn(`Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '${r}' (type=${n}). function parameters=${i}, call parameters=${P}`), a = f + r.length;
          continue;
        }
        a = d + 1;
        const c = this._replaceNames(s, i, P);
        let H = f > 0 ? this._sourceCode.substring(0, f) : "";
        const T = d + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(d + 1) : "";
        if (p) {
          const q = Hue(this._sourceCode, f - 1, `
`, "{");
          H = this._sourceCode.substring(0, q + 1);
          const b = this._sourceCode.substring(q + 1, f);
          this._sourceCode = H + n + " " + p + `;
` + c + `
` + b + p + T, this.debug && console.log(`Replace function call by code. Function '${r}' (type=${n}). injectDeclarationIndex=${q}, call parameters=${P}`);
        } else
          this._sourceCode = H + c + T, a += c.length - (d + 1 - f), this.debug && console.log(`Replace function call by code. Function '${r}' (type=${n}). functionCallIndex=${f}, call parameters=${P}`);
        e = !0;
      }
    }
    return e;
  }
  _replaceNames(e, t, r) {
    for (let n = 0; n < t.length; ++n) {
      const i = new RegExp(gue(t[n]), "g"), s = t[n].length, a = r[n];
      e = e.replace(i, (f, ...o) => {
        const d = o[0];
        return xE(e.charAt(d - 1)) || xE(e.charAt(d + s)) ? t[n] : a;
      });
    }
    return e;
  }
}
Aq._RegexpFindFunctionNameAndType = /((\s+?)(\w+)\s+(\w+)\s*?)$/;
class Xue {
  get isAsync() {
    return this.isParallelCompiled;
  }
  get isReady() {
    if (this.compilationError) {
      const e = this.compilationError.message;
      throw new Error("SHADER ERROR" + (typeof e == "string" ? `
` + e : ""));
    }
    return this.isCompiled;
  }
  _getVertexShaderCode() {
    return null;
  }
  _getFragmentShaderCode() {
    return null;
  }
  // TODO: what should this do?
  _handlesSpectorRebuildCallback(e) {
    throw new Error("Not implemented");
  }
  constructor(e) {
    this.isParallelCompiled = !0, this.isCompiled = !1, this._valueCache = {}, this._engine = e;
  }
  _fillEffectInformation(e, t, r, n, i, s, a, f) {
    const o = this._engine;
    if (o.supportsUniformBuffers)
      for (const u in t)
        e.bindUniformBlock(u, t[u]);
    this._engine.getUniforms(this, r).forEach((u, l) => {
      n[r[l]] = u;
    }), this._uniforms = n;
    let v;
    for (v = 0; v < i.length; v++)
      e.getUniform(i[v]) == null && (i.splice(v, 1), v--);
    i.forEach((u, l) => {
      s[u] = l;
    }), f.push(...o.getAttributes(this, a));
  }
  /**
   * Release all associated resources.
   **/
  dispose() {
    this._uniforms = {};
  }
  /**
   * @internal
   */
  _cacheMatrix(e, t) {
    const r = this._valueCache[e], n = t.updateFlag;
    return r !== void 0 && r === n ? !1 : (this._valueCache[e] = n, !0);
  }
  /**
   * @internal
   */
  _cacheFloat2(e, t, r) {
    let n = this._valueCache[e];
    if (!n)
      return n = [t, r], this._valueCache[e] = n, !0;
    let i = !1;
    return n[0] !== t && (n[0] = t, i = !0), n[1] !== r && (n[1] = r, i = !0), i;
  }
  /**
   * @internal
   */
  _cacheFloat3(e, t, r, n) {
    let i = this._valueCache[e];
    if (!i)
      return i = [t, r, n], this._valueCache[e] = i, !0;
    let s = !1;
    return i[0] !== t && (i[0] = t, s = !0), i[1] !== r && (i[1] = r, s = !0), i[2] !== n && (i[2] = n, s = !0), s;
  }
  /**
   * @internal
   */
  _cacheFloat4(e, t, r, n, i) {
    let s = this._valueCache[e];
    if (!s)
      return s = [t, r, n, i], this._valueCache[e] = s, !0;
    let a = !1;
    return s[0] !== t && (s[0] = t, a = !0), s[1] !== r && (s[1] = r, a = !0), s[2] !== n && (s[2] = n, a = !0), s[3] !== i && (s[3] = i, a = !0), a;
  }
  /**
   * Sets an integer value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value Value to be set.
   */
  setInt(e, t) {
    const r = this._valueCache[e];
    r !== void 0 && r === t || this._engine.setInt(this._uniforms[e], t) && (this._valueCache[e] = t);
  }
  /**
   * Sets a int2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int2.
   * @param y Second int in int2.
   */
  setInt2(e, t, r) {
    this._cacheFloat2(e, t, r) && (this._engine.setInt2(this._uniforms[e], t, r) || (this._valueCache[e] = null));
  }
  /**
   * Sets a int3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int3.
   * @param y Second int in int3.
   * @param z Third int in int3.
   */
  setInt3(e, t, r, n) {
    this._cacheFloat3(e, t, r, n) && (this._engine.setInt3(this._uniforms[e], t, r, n) || (this._valueCache[e] = null));
  }
  /**
   * Sets a int4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int4.
   * @param y Second int in int4.
   * @param z Third int in int4.
   * @param w Fourth int in int4.
   */
  setInt4(e, t, r, n, i) {
    this._cacheFloat4(e, t, r, n, i) && (this._engine.setInt4(this._uniforms[e], t, r, n, i) || (this._valueCache[e] = null));
  }
  /**
   * Sets an int array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray(e, t) {
    this._valueCache[e] = null, this._engine.setIntArray(this._uniforms[e], t);
  }
  /**
   * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray2(e, t) {
    this._valueCache[e] = null, this._engine.setIntArray2(this._uniforms[e], t);
  }
  /**
   * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray3(e, t) {
    this._valueCache[e] = null, this._engine.setIntArray3(this._uniforms[e], t);
  }
  /**
   * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray4(e, t) {
    this._valueCache[e] = null, this._engine.setIntArray4(this._uniforms[e], t);
  }
  /**
   * Sets an unsigned integer value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value Value to be set.
   */
  setUInt(e, t) {
    const r = this._valueCache[e];
    r !== void 0 && r === t || this._engine.setUInt(this._uniforms[e], t) && (this._valueCache[e] = t);
  }
  /**
   * Sets a unsigned int2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint2.
   * @param y Second unsigned int in uint2.
   */
  setUInt2(e, t, r) {
    this._cacheFloat2(e, t, r) && (this._engine.setUInt2(this._uniforms[e], t, r) || (this._valueCache[e] = null));
  }
  /**
   * Sets a unsigned int3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint3.
   * @param y Second unsigned int in uint3.
   * @param z Third unsigned int in uint3.
   */
  setUInt3(e, t, r, n) {
    this._cacheFloat3(e, t, r, n) && (this._engine.setUInt3(this._uniforms[e], t, r, n) || (this._valueCache[e] = null));
  }
  /**
   * Sets a unsigned int4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint4.
   * @param y Second unsigned int in uint4.
   * @param z Third unsigned int in uint4.
   * @param w Fourth unsigned int in uint4.
   */
  setUInt4(e, t, r, n, i) {
    this._cacheFloat4(e, t, r, n, i) && (this._engine.setUInt4(this._uniforms[e], t, r, n, i) || (this._valueCache[e] = null));
  }
  /**
   * Sets an unsigned int array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray(e, t) {
    this._valueCache[e] = null, this._engine.setUIntArray(this._uniforms[e], t);
  }
  /**
   * Sets an unsigned int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray2(e, t) {
    this._valueCache[e] = null, this._engine.setUIntArray2(this._uniforms[e], t);
  }
  /**
   * Sets an unsigned int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray3(e, t) {
    this._valueCache[e] = null, this._engine.setUIntArray3(this._uniforms[e], t);
  }
  /**
   * Sets an unsigned int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray4(e, t) {
    this._valueCache[e] = null, this._engine.setUIntArray4(this._uniforms[e], t);
  }
  /**
   * Sets an float array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setFloatArray(e, t) {
    this._valueCache[e] = null, this._engine.setFloatArray(this._uniforms[e], t);
  }
  /**
   * Sets an float array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setFloatArray2(e, t) {
    this._valueCache[e] = null, this._engine.setFloatArray2(this._uniforms[e], t);
  }
  /**
   * Sets an float array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setFloatArray3(e, t) {
    this._valueCache[e] = null, this._engine.setFloatArray3(this._uniforms[e], t);
  }
  /**
   * Sets an float array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setFloatArray4(e, t) {
    this._valueCache[e] = null, this._engine.setFloatArray4(this._uniforms[e], t);
  }
  /**
   * Sets an array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setArray(e, t) {
    this._valueCache[e] = null, this._engine.setArray(this._uniforms[e], t);
  }
  /**
   * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setArray2(e, t) {
    this._valueCache[e] = null, this._engine.setArray2(this._uniforms[e], t);
  }
  /**
   * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setArray3(e, t) {
    this._valueCache[e] = null, this._engine.setArray3(this._uniforms[e], t);
  }
  /**
   * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setArray4(e, t) {
    this._valueCache[e] = null, this._engine.setArray4(this._uniforms[e], t);
  }
  /**
   * Sets matrices on a uniform variable.
   * @param uniformName Name of the variable.
   * @param matrices matrices to be set.
   */
  setMatrices(e, t) {
    t && (this._valueCache[e] = null, this._engine.setMatrices(this._uniforms[e], t));
  }
  /**
   * Sets matrix on a uniform variable.
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   */
  setMatrix(e, t) {
    this._cacheMatrix(e, t) && (this._engine.setMatrices(this._uniforms[e], t.toArray()) || (this._valueCache[e] = null));
  }
  /**
   * Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   */
  setMatrix3x3(e, t) {
    this._valueCache[e] = null, this._engine.setMatrix3x3(this._uniforms[e], t);
  }
  /**
   * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   */
  setMatrix2x2(e, t) {
    this._valueCache[e] = null, this._engine.setMatrix2x2(this._uniforms[e], t);
  }
  /**
   * Sets a float on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value value to be set.
   * @returns this effect.
   */
  setFloat(e, t) {
    const r = this._valueCache[e];
    r !== void 0 && r === t || this._engine.setFloat(this._uniforms[e], t) && (this._valueCache[e] = t);
  }
  /**
   * Sets a boolean on a uniform variable.
   * @param uniformName Name of the variable.
   * @param bool value to be set.
   */
  setBool(e, t) {
    const r = this._valueCache[e];
    r !== void 0 && r === t || this._engine.setInt(this._uniforms[e], t ? 1 : 0) && (this._valueCache[e] = t ? 1 : 0);
  }
  /**
   * Sets a Vector2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector2 vector2 to be set.
   */
  setVector2(e, t) {
    this._cacheFloat2(e, t.x, t.y) && (this._engine.setFloat2(this._uniforms[e], t.x, t.y) || (this._valueCache[e] = null));
  }
  /**
   * Sets a float2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float2.
   * @param y Second float in float2.
   */
  setFloat2(e, t, r) {
    this._cacheFloat2(e, t, r) && (this._engine.setFloat2(this._uniforms[e], t, r) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Vector3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector3 Value to be set.
   */
  setVector3(e, t) {
    this._cacheFloat3(e, t.x, t.y, t.z) && (this._engine.setFloat3(this._uniforms[e], t.x, t.y, t.z) || (this._valueCache[e] = null));
  }
  /**
   * Sets a float3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float3.
   * @param y Second float in float3.
   * @param z Third float in float3.
   */
  setFloat3(e, t, r, n) {
    this._cacheFloat3(e, t, r, n) && (this._engine.setFloat3(this._uniforms[e], t, r, n) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Vector4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector4 Value to be set.
   */
  setVector4(e, t) {
    this._cacheFloat4(e, t.x, t.y, t.z, t.w) && (this._engine.setFloat4(this._uniforms[e], t.x, t.y, t.z, t.w) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Quaternion on a uniform variable.
   * @param uniformName Name of the variable.
   * @param quaternion Value to be set.
   */
  setQuaternion(e, t) {
    this._cacheFloat4(e, t.x, t.y, t.z, t.w) && (this._engine.setFloat4(this._uniforms[e], t.x, t.y, t.z, t.w) || (this._valueCache[e] = null));
  }
  /**
   * Sets a float4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float4.
   * @param y Second float in float4.
   * @param z Third float in float4.
   * @param w Fourth float in float4.
   * @returns this effect.
   */
  setFloat4(e, t, r, n, i) {
    this._cacheFloat4(e, t, r, n, i) && (this._engine.setFloat4(this._uniforms[e], t, r, n, i) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Color3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param color3 Value to be set.
   */
  setColor3(e, t) {
    this._cacheFloat3(e, t.r, t.g, t.b) && (this._engine.setFloat3(this._uniforms[e], t.r, t.g, t.b) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Color4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param color3 Value to be set.
   * @param alpha Alpha value to be set.
   */
  setColor4(e, t, r) {
    this._cacheFloat4(e, t.r, t.g, t.b, r) && (this._engine.setFloat4(this._uniforms[e], t.r, t.g, t.b, r) || (this._valueCache[e] = null));
  }
  /**
   * Sets a Color4 on a uniform variable
   * @param uniformName defines the name of the variable
   * @param color4 defines the value to be set
   */
  setDirectColor4(e, t) {
    this._cacheFloat4(e, t.r, t.g, t.b, t.a) && (this._engine.setFloat4(this._uniforms[e], t.r, t.g, t.b, t.a) || (this._valueCache[e] = null));
  }
}
class Tue extends DR {
  get _framebuffer() {
    return this.__framebuffer;
  }
  set _framebuffer(e) {
    this.__framebuffer && this._engine._releaseFramebufferObjects(this.__framebuffer), this.__framebuffer = e;
  }
  get _framebufferDepthStencil() {
    return this.__framebufferDepthStencil;
  }
  set _framebufferDepthStencil(e) {
    this.__framebufferDepthStencil && this._engine._releaseFramebufferObjects(this.__framebufferDepthStencil), this.__framebufferDepthStencil = e;
  }
  constructor(e, t, r, n) {
    super(e, t, r, n), this.__framebuffer = null, this.__framebufferDepthStencil = null, this._engine = n;
  }
  dispose(e = !1) {
    this._framebuffer = null, this._framebufferDepthStencil = null, super.dispose(e);
  }
}
class XG {
  get underlyingResource() {
    return this._nativeTexture;
  }
  constructor(e, t) {
    this._engine = t, this.set(e);
  }
  setUsage() {
  }
  set(e) {
    this._nativeTexture = e;
  }
  reset() {
    this._nativeTexture = null;
  }
  release() {
    this._nativeTexture && this._engine.deleteTexture(this._nativeTexture), this.reset();
  }
}
function DE(A, e) {
  switch (A) {
    case 15:
      return _native.Engine.TEXTURE_FORMAT_D16;
    case 16:
      return _native.Engine.TEXTURE_FORMAT_D24;
    case 13:
      return _native.Engine.TEXTURE_FORMAT_D24S8;
    case 14:
      return _native.Engine.TEXTURE_FORMAT_D32F;
    case 36492:
      return _native.Engine.TEXTURE_FORMAT_BC7;
    case 36494:
      return _native.Engine.TEXTURE_FORMAT_BC6H;
    case 33779:
      return _native.Engine.TEXTURE_FORMAT_BC3;
    case 33778:
      return _native.Engine.TEXTURE_FORMAT_BC2;
    case 33777:
      return _native.Engine.TEXTURE_FORMAT_BC1;
    case 33776:
      return _native.Engine.TEXTURE_FORMAT_BC1;
    case 37808:
      return _native.Engine.TEXTURE_FORMAT_ASTC4x4;
    case 36196:
      return _native.Engine.TEXTURE_FORMAT_ETC1;
    case 37492:
      return _native.Engine.TEXTURE_FORMAT_ETC2;
    case 37496:
      return _native.Engine.TEXTURE_FORMAT_ETC2A;
    case 4: {
      switch (e) {
        case 0:
          return _native.Engine.TEXTURE_FORMAT_RGB8;
        case 3:
          return _native.Engine.TEXTURE_FORMAT_RGB8S;
        case 6:
          return _native.Engine.TEXTURE_FORMAT_RGB8I;
        case 7:
          return _native.Engine.TEXTURE_FORMAT_RGB8U;
      }
      break;
    }
    case 5: {
      switch (e) {
        case 0:
          return _native.Engine.TEXTURE_FORMAT_RGBA8;
        case 1:
          return _native.Engine.TEXTURE_FORMAT_RGBA32F;
        case 2:
          return _native.Engine.TEXTURE_FORMAT_RGBA16F;
        case 3:
          return _native.Engine.TEXTURE_FORMAT_RGBA8S;
        case 4:
          return _native.Engine.TEXTURE_FORMAT_RGBA16I;
        case 5:
          return _native.Engine.TEXTURE_FORMAT_RGBA16U;
        case 6:
          return _native.Engine.TEXTURE_FORMAT_RGBA32I;
        case 7:
          return _native.Engine.TEXTURE_FORMAT_RGBA32U;
      }
      break;
    }
    case 6: {
      switch (e) {
        case 0:
          return _native.Engine.TEXTURE_FORMAT_R8;
        case 1:
          return _native.Engine.TEXTURE_FORMAT_R32F;
        case 2:
          return _native.Engine.TEXTURE_FORMAT_R16F;
        case 3:
          return _native.Engine.TEXTURE_FORMAT_R8S;
        case 4:
          return _native.Engine.TEXTURE_FORMAT_R16S;
        case 5:
          return _native.Engine.TEXTURE_FORMAT_R16U;
        case 6:
          return _native.Engine.TEXTURE_FORMAT_R32I;
        case 7:
          return _native.Engine.TEXTURE_FORMAT_R32U;
      }
      break;
    }
    case 7: {
      switch (e) {
        case 0:
          return _native.Engine.TEXTURE_FORMAT_RG8;
        case 1:
          return _native.Engine.TEXTURE_FORMAT_RG32F;
        case 2:
          return _native.Engine.TEXTURE_FORMAT_RG16F;
        case 3:
          return _native.Engine.TEXTURE_FORMAT_RG8S;
        case 4:
          return _native.Engine.TEXTURE_FORMAT_RG16S;
        case 5:
          return _native.Engine.TEXTURE_FORMAT_RG16U;
        case 6:
          return _native.Engine.TEXTURE_FORMAT_RG32I;
        case 7:
          return _native.Engine.TEXTURE_FORMAT_RG32U;
      }
      break;
    }
    case 12: {
      switch (e) {
        case 0:
          return _native.Engine.TEXTURE_FORMAT_BGRA8;
      }
      break;
    }
  }
  throw new O0(`Unsupported texture format or type: format ${A}, type ${e}.`, Z2.UnsupportedTextureError);
}
function AI(A) {
  switch (A) {
    case 1:
      return _native.Engine.TEXTURE_NEAREST_NEAREST;
    case 2:
      return _native.Engine.TEXTURE_LINEAR_LINEAR;
    case 3:
      return _native.Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR;
    case 4:
      return _native.Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST;
    case 5:
      return _native.Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST;
    case 6:
      return _native.Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR;
    case 7:
      return _native.Engine.TEXTURE_NEAREST_LINEAR;
    case 8:
      return _native.Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR;
    case 9:
      return _native.Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST;
    case 10:
      return _native.Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR;
    case 11:
      return _native.Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST;
    case 12:
      return _native.Engine.TEXTURE_LINEAR_NEAREST;
    default:
      throw new Error(`Unsupported sampling mode: ${A}.`);
  }
}
function jE(A) {
  switch (A) {
    case 1:
      return _native.Engine.ADDRESS_MODE_WRAP;
    case 0:
      return _native.Engine.ADDRESS_MODE_CLAMP;
    case 2:
      return _native.Engine.ADDRESS_MODE_MIRROR;
    default:
      throw new Error("Unexpected wrap mode: " + A + ".");
  }
}
function que(A) {
  switch (A) {
    case 513:
      return _native.Engine.STENCIL_TEST_LESS;
    case 515:
      return _native.Engine.STENCIL_TEST_LEQUAL;
    case 514:
      return _native.Engine.STENCIL_TEST_EQUAL;
    case 518:
      return _native.Engine.STENCIL_TEST_GEQUAL;
    case 516:
      return _native.Engine.STENCIL_TEST_GREATER;
    case 517:
      return _native.Engine.STENCIL_TEST_NOTEQUAL;
    case 512:
      return _native.Engine.STENCIL_TEST_NEVER;
    case 519:
      return _native.Engine.STENCIL_TEST_ALWAYS;
    default:
      throw new Error(`Unsupported stencil func mode: ${A}.`);
  }
}
function bue(A) {
  switch (A) {
    case 7680:
      return _native.Engine.STENCIL_OP_FAIL_S_KEEP;
    case 0:
      return _native.Engine.STENCIL_OP_FAIL_S_ZERO;
    case 7681:
      return _native.Engine.STENCIL_OP_FAIL_S_REPLACE;
    case 7682:
      return _native.Engine.STENCIL_OP_FAIL_S_INCR;
    case 7683:
      return _native.Engine.STENCIL_OP_FAIL_S_DECR;
    case 5386:
      return _native.Engine.STENCIL_OP_FAIL_S_INVERT;
    case 34055:
      return _native.Engine.STENCIL_OP_FAIL_S_INCRSAT;
    case 34056:
      return _native.Engine.STENCIL_OP_FAIL_S_DECRSAT;
    default:
      throw new Error(`Unsupported stencil OpFail mode: ${A}.`);
  }
}
function xue(A) {
  switch (A) {
    case 7680:
      return _native.Engine.STENCIL_OP_FAIL_Z_KEEP;
    case 0:
      return _native.Engine.STENCIL_OP_FAIL_Z_ZERO;
    case 7681:
      return _native.Engine.STENCIL_OP_FAIL_Z_REPLACE;
    case 7682:
      return _native.Engine.STENCIL_OP_FAIL_Z_INCR;
    case 7683:
      return _native.Engine.STENCIL_OP_FAIL_Z_DECR;
    case 5386:
      return _native.Engine.STENCIL_OP_FAIL_Z_INVERT;
    case 34055:
      return _native.Engine.STENCIL_OP_FAIL_Z_INCRSAT;
    case 34056:
      return _native.Engine.STENCIL_OP_FAIL_Z_DECRSAT;
    default:
      throw new Error(`Unsupported stencil depthFail mode: ${A}.`);
  }
}
function Due(A) {
  switch (A) {
    case 7680:
      return _native.Engine.STENCIL_OP_PASS_Z_KEEP;
    case 0:
      return _native.Engine.STENCIL_OP_PASS_Z_ZERO;
    case 7681:
      return _native.Engine.STENCIL_OP_PASS_Z_REPLACE;
    case 7682:
      return _native.Engine.STENCIL_OP_PASS_Z_INCR;
    case 7683:
      return _native.Engine.STENCIL_OP_PASS_Z_DECR;
    case 5386:
      return _native.Engine.STENCIL_OP_PASS_Z_INVERT;
    case 34055:
      return _native.Engine.STENCIL_OP_PASS_Z_INCRSAT;
    case 34056:
      return _native.Engine.STENCIL_OP_PASS_Z_DECRSAT;
    default:
      throw new Error(`Unsupported stencil opPass mode: ${A}.`);
  }
}
function jue(A) {
  switch (A) {
    case 0:
      return _native.Engine.ALPHA_DISABLE;
    case 1:
      return _native.Engine.ALPHA_ADD;
    case 2:
      return _native.Engine.ALPHA_COMBINE;
    case 3:
      return _native.Engine.ALPHA_SUBTRACT;
    case 4:
      return _native.Engine.ALPHA_MULTIPLY;
    case 5:
      return _native.Engine.ALPHA_MAXIMIZED;
    case 6:
      return _native.Engine.ALPHA_ONEONE;
    case 7:
      return _native.Engine.ALPHA_PREMULTIPLIED;
    case 8:
      return _native.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF;
    case 9:
      return _native.Engine.ALPHA_INTERPOLATE;
    case 10:
      return _native.Engine.ALPHA_SCREENMODE;
    default:
      throw new Error(`Unsupported alpha mode: ${A}.`);
  }
}
function wue(A) {
  switch (A) {
    case J.BYTE:
      return _native.Engine.ATTRIB_TYPE_INT8;
    case J.UNSIGNED_BYTE:
      return _native.Engine.ATTRIB_TYPE_UINT8;
    case J.SHORT:
      return _native.Engine.ATTRIB_TYPE_INT16;
    case J.UNSIGNED_SHORT:
      return _native.Engine.ATTRIB_TYPE_UINT16;
    case J.FLOAT:
      return _native.Engine.ATTRIB_TYPE_FLOAT;
    default:
      throw new Error(`Unsupported attribute type: ${A}.`);
  }
}
const hte = new Oe();
if (typeof self < "u" && !Object.prototype.hasOwnProperty.call(self, "_native")) {
  let A;
  Object.defineProperty(self, "_native", {
    get: () => A,
    set: (e) => {
      A = e, A && hte.notifyObservers(A);
    }
  });
}
function Hte() {
  return new Promise((A) => {
    typeof _native > "u" ? hte.addOnce((e) => A(e)) : A(_native);
  });
}
async function gte(A, e) {
  (await Hte())[A] = e;
}
class TG extends tg {
}
class mue {
  constructor(e) {
    this._engine = e, this._pending = new Array(), this._isCommandBufferScopeActive = !1, this._commandStream = Hm._createNativeDataStream(), this._engine.setCommandDataStream(this._commandStream);
  }
  beginCommandScope() {
    if (this._isCommandBufferScopeActive)
      throw new Error("Command scope already active.");
    this._isCommandBufferScopeActive = !0;
  }
  endCommandScope() {
    if (!this._isCommandBufferScopeActive)
      throw new Error("Command scope is not active.");
    this._isCommandBufferScopeActive = !1, this._submit();
  }
  startEncodingCommand(e) {
    this._commandStream.writeNativeData(e);
  }
  encodeCommandArgAsUInt32(e) {
    this._commandStream.writeUint32(e);
  }
  encodeCommandArgAsUInt32s(e) {
    this._commandStream.writeUint32Array(e);
  }
  encodeCommandArgAsInt32(e) {
    this._commandStream.writeInt32(e);
  }
  encodeCommandArgAsInt32s(e) {
    this._commandStream.writeInt32Array(e);
  }
  encodeCommandArgAsFloat32(e) {
    this._commandStream.writeFloat32(e);
  }
  encodeCommandArgAsFloat32s(e) {
    this._commandStream.writeFloat32Array(e);
  }
  encodeCommandArgAsNativeData(e) {
    this._commandStream.writeNativeData(e), this._pending.push(e);
  }
  finishEncodingCommand() {
    this._isCommandBufferScopeActive || this._submit();
  }
  _submit() {
    this._engine.submitCommands(), this._pending.length = 0;
  }
}
class Hm extends Ge {
  setHardwareScalingLevel(e) {
    super.setHardwareScalingLevel(e), this._engine.setHardwareScalingLevel(e);
  }
  constructor(e = {}) {
    if (super(null, !1, void 0, e.adaptToDeviceRatio), this._engine = new _native.Engine(), this._camera = _native.Camera ? new _native.Camera() : null, this._commandBufferEncoder = new mue(this._engine), this._boundBuffersVertexArray = null, this._currentDepthTest = _native.Engine.DEPTH_TEST_LEQUAL, this._stencilTest = !1, this._stencilMask = 255, this._stencilFunc = 519, this._stencilFuncRef = 0, this._stencilFuncMask = 255, this._stencilOpStencilFail = 7680, this._stencilOpDepthFail = 7680, this._stencilOpStencilDepthPass = 7681, this._zOffset = 0, this._zOffsetUnits = 0, this._depthWrite = !0, _native.Engine.PROTOCOL_VERSION !== Hm.PROTOCOL_VERSION)
      throw new Error(`Protocol version mismatch: ${_native.Engine.PROTOCOL_VERSION} (Native) !== ${Hm.PROTOCOL_VERSION} (JS)`);
    this._webGLVersion = 2, this.disableUniformBuffers = !0, this._shaderPlatformName = "NATIVE", this._caps = {
      maxTexturesImageUnits: 16,
      maxVertexTextureImageUnits: 16,
      maxCombinedTexturesImageUnits: 32,
      maxTextureSize: _native.Engine.CAPS_LIMITS_MAX_TEXTURE_SIZE,
      maxCubemapTextureSize: 512,
      maxRenderTextureSize: 512,
      maxVertexAttribs: 16,
      maxVaryingVectors: 16,
      maxFragmentUniformVectors: 16,
      maxVertexUniformVectors: 16,
      standardDerivatives: !0,
      astc: null,
      pvrtc: null,
      etc1: null,
      etc2: null,
      bptc: null,
      maxAnisotropy: 16,
      uintIndices: !0,
      fragmentDepthSupported: !1,
      highPrecisionShaderSupported: !0,
      colorBufferFloat: !1,
      supportFloatTexturesResolve: !1,
      textureFloat: !0,
      textureFloatLinearFiltering: !1,
      textureFloatRender: !0,
      textureHalfFloat: !0,
      textureHalfFloatLinearFiltering: !1,
      textureHalfFloatRender: !0,
      textureLOD: !0,
      texelFetch: !1,
      drawBuffersExtension: !1,
      depthTextureExtension: !1,
      vertexArrayObject: !0,
      instancedArrays: !0,
      supportOcclusionQuery: !1,
      canUseTimestampForTimerQuery: !1,
      blendMinMax: !1,
      maxMSAASamples: 16,
      canUseGLInstanceID: !0,
      canUseGLVertexID: !0,
      supportComputeShaders: !1,
      supportSRGBBuffers: !0,
      supportTransformFeedbacks: !1,
      textureMaxLevel: !1,
      texture2DArrayMaxLayerCount: _native.Engine.CAPS_LIMITS_MAX_TEXTURE_LAYERS,
      disableMorphTargetTexture: !1
    }, this._features = {
      forceBitmapOverHTMLImageElement: !1,
      supportRenderAndCopyToLodForFloatTextures: !1,
      supportDepthStencilTexture: !1,
      supportShadowSamplers: !1,
      uniformBufferHardCheckMatrix: !1,
      allowTexturePrefiltering: !1,
      trackUbosInFrame: !1,
      checkUbosContentBeforeUpload: !1,
      supportCSM: !1,
      basisNeedsPOT: !1,
      support3DTextures: !1,
      needTypeSuffixInShaderConstants: !1,
      supportMSAA: !0,
      supportSSAO2: !1,
      supportExtendedTextureFormats: !1,
      supportSwitchCaseInShader: !1,
      supportSyncTextureRead: !1,
      needsInvertingBitmap: !0,
      useUBOBindingCache: !0,
      needShaderCodeInlining: !0,
      needToAlwaysBindUniformBuffers: !1,
      supportRenderPasses: !0,
      supportSpriteInstancing: !1,
      forceVertexBufferStrideMultiple4Bytes: !1,
      _collectUbosUpdatedInFrame: !1
    }, ye.Log("Babylon Native (v" + Ge.Version + ") launched"), ye.LoadScript = function(n, i, s, a) {
      ye.LoadFile(n, (f) => {
        Function(f).apply(null), i && i();
      }, void 0, void 0, !1, (f, o) => {
        s && s("LoadScript Error", o);
      });
    }, typeof URL > "u" && (window.URL = {
      createObjectURL: function() {
      },
      revokeObjectURL: function() {
      }
    }), typeof Blob > "u" && (window.Blob = function(n) {
      return n;
    }), Array.prototype.flat || Object.defineProperty(Array.prototype, "flat", {
      configurable: !0,
      value: function n() {
        const i = isNaN(arguments[0]) ? 1 : Number(arguments[0]);
        return i ? Array.prototype.reduce.call(this, function(s, a) {
          return Array.isArray(a) ? s.push.apply(s, n.call(a, i - 1)) : s.push(a), s;
        }, []) : Array.prototype.slice.call(this);
      },
      writable: !0
    });
    const t = window && window.devicePixelRatio || 1;
    this._hardwareScalingLevel = e.adaptToDeviceRatio ? 1 / t : 1, this._engine.setHardwareScalingLevel(this._hardwareScalingLevel), this._lastDevicePixelRatio = t, this.resize();
    const r = this.getDepthFunction();
    r && this.setDepthFunction(r), this._shaderProcessor = new LN(), this.onNewSceneAddedObservable.add((n) => {
      const i = n.render;
      n.render = (...s) => {
        this._commandBufferEncoder.beginCommandScope(), i.apply(n, s), this._commandBufferEncoder.endCommandScope();
      };
    });
  }
  dispose() {
    super.dispose(), this._boundBuffersVertexArray && this._deleteVertexArray(this._boundBuffersVertexArray), this._engine.dispose();
  }
  /** @internal */
  static _createNativeDataStream() {
    return new hD();
  }
  /**
   * Can be used to override the current requestAnimationFrame requester.
   * @internal
   */
  _queueNewFrame(e, t) {
    return t.requestAnimationFrame && t !== window ? t.requestAnimationFrame(e) : this._engine.requestAnimationFrame(e), 0;
  }
  /**
   * Override default engine behavior.
   * @param framebuffer
   */
  _bindUnboundFramebuffer(e) {
    this._currentFramebuffer !== e && (this._currentFramebuffer && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_UNBINDFRAMEBUFFER), this._commandBufferEncoder.encodeCommandArgAsNativeData(this._currentFramebuffer), this._commandBufferEncoder.finishEncodingCommand()), e && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_BINDFRAMEBUFFER), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.finishEncodingCommand()), this._currentFramebuffer = e);
  }
  /**
   * Gets host document
   * @returns the host document object
   */
  getHostDocument() {
    return null;
  }
  clear(e, t, r, n = !1) {
    if (this.useReverseDepthBuffer)
      throw new Error("reverse depth buffer is not currently implemented");
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_CLEAR), this._commandBufferEncoder.encodeCommandArgAsUInt32(t && e ? 1 : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(e ? e.r : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(e ? e.g : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(e ? e.b : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(e ? e.a : 1), this._commandBufferEncoder.encodeCommandArgAsUInt32(r ? 1 : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(1), this._commandBufferEncoder.encodeCommandArgAsUInt32(n ? 1 : 0), this._commandBufferEncoder.encodeCommandArgAsUInt32(0), this._commandBufferEncoder.finishEncodingCommand();
  }
  createIndexBuffer(e, t, r) {
    const n = this._normalizeIndexData(e), i = new TG();
    return i.references = 1, i.is32Bits = n.BYTES_PER_ELEMENT === 4, n.byteLength && (i.nativeIndexBuffer = this._engine.createIndexBuffer(n.buffer, n.byteOffset, n.byteLength, i.is32Bits, t ?? !1)), i;
  }
  createVertexBuffer(e, t, r) {
    const n = ArrayBuffer.isView(e) ? e : new Float32Array(e), i = new TG();
    return i.references = 1, n.byteLength && (i.nativeVertexBuffer = this._engine.createVertexBuffer(n.buffer, n.byteOffset, n.byteLength, t ?? !1)), i;
  }
  _recordVertexArrayObject(e, t, r, n, i) {
    r && this._engine.recordIndexBuffer(e, r.nativeIndexBuffer);
    const s = n.getAttributesNames();
    for (let a = 0; a < s.length; a++) {
      const f = n.getAttributeLocation(a);
      if (f >= 0) {
        const o = s[a];
        let d = null;
        if (i && (d = i[o]), d || (d = t[o]), d) {
          const v = d.getBuffer();
          v && v.nativeVertexBuffer && this._engine.recordVertexBuffer(e, v.nativeVertexBuffer, f, d.byteOffset, d.byteStride, d.getSize(), wue(d.type), d.normalized, d.getInstanceDivisor());
        }
      }
    }
  }
  bindBuffers(e, t, r) {
    this._boundBuffersVertexArray && this._deleteVertexArray(this._boundBuffersVertexArray), this._boundBuffersVertexArray = this._engine.createVertexArray(), this._recordVertexArrayObject(this._boundBuffersVertexArray, e, t, r), this.bindVertexArrayObject(this._boundBuffersVertexArray);
  }
  recordVertexArrayObject(e, t, r, n) {
    const i = this._engine.createVertexArray();
    return this._recordVertexArrayObject(i, e, t, r, n), i;
  }
  _deleteVertexArray(e) {
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEVERTEXARRAY), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.finishEncodingCommand();
  }
  bindVertexArrayObject(e) {
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_BINDVERTEXARRAY), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.finishEncodingCommand();
  }
  releaseVertexArrayObject(e) {
    this._deleteVertexArray(e);
  }
  getAttributes(e, t) {
    const r = e;
    return this._engine.getAttributes(r.nativeProgram, t);
  }
  /**
   * Draw a list of indexed primitives
   * @param fillMode defines the primitive to use
   * @param indexStart defines the starting index
   * @param indexCount defines the number of index to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  drawElementsType(e, t, r, n) {
    this._drawCalls.addCount(1, !1), n && _native.Engine.COMMAND_DRAWINDEXEDINSTANCED ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINDEXEDINSTANCED), this._commandBufferEncoder.encodeCommandArgAsUInt32(e), this._commandBufferEncoder.encodeCommandArgAsUInt32(t), this._commandBufferEncoder.encodeCommandArgAsUInt32(r), this._commandBufferEncoder.encodeCommandArgAsUInt32(n)) : (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINDEXED), this._commandBufferEncoder.encodeCommandArgAsUInt32(e), this._commandBufferEncoder.encodeCommandArgAsUInt32(t), this._commandBufferEncoder.encodeCommandArgAsUInt32(r)), this._commandBufferEncoder.finishEncodingCommand();
  }
  /**
   * Draw a list of unindexed primitives
   * @param fillMode defines the primitive to use
   * @param verticesStart defines the index of first vertex to draw
   * @param verticesCount defines the count of vertices to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  drawArraysType(e, t, r, n) {
    this._drawCalls.addCount(1, !1), n && _native.Engine.COMMAND_DRAWINSTANCED ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINSTANCED), this._commandBufferEncoder.encodeCommandArgAsUInt32(e), this._commandBufferEncoder.encodeCommandArgAsUInt32(t), this._commandBufferEncoder.encodeCommandArgAsUInt32(r), this._commandBufferEncoder.encodeCommandArgAsUInt32(n)) : (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAW), this._commandBufferEncoder.encodeCommandArgAsUInt32(e), this._commandBufferEncoder.encodeCommandArgAsUInt32(t), this._commandBufferEncoder.encodeCommandArgAsUInt32(r)), this._commandBufferEncoder.finishEncodingCommand();
  }
  createPipelineContext() {
    return new Xue(this);
  }
  createMaterialContext() {
  }
  createDrawContext() {
  }
  _preparePipelineContext(e, t, r, n, i, s, a, f) {
    const o = e;
    n ? o.nativeProgram = this.createRawShaderProgram() : o.nativeProgram = this.createShaderProgram(e, t, r, f);
  }
  isAsync(e) {
    return !!(e.isAsync && this._engine.createProgramAsync);
  }
  /**
   * @internal
   */
  _executeWhenRenderingStateIsCompiled(e, t) {
    const r = e;
    if (!this.isAsync(e)) {
      t();
      return;
    }
    const n = r.onCompiled;
    n ? r.onCompiled = () => {
      n(), t();
    } : r.onCompiled = t;
  }
  createRawShaderProgram() {
    throw new Error("Not Supported");
  }
  createShaderProgram(e, t, r, n) {
    const i = e;
    if (i.nativeProgram)
      throw new Error("Tried to create a second program in the same NativePipelineContext");
    this.onBeforeShaderCompilationObservable.notifyObservers(this);
    const s = new Aq(t);
    s.processCode(), t = s.code;
    const a = new Aq(r);
    a.processCode(), r = a.code, t = hr._ConcatenateShader(t, n), r = hr._ConcatenateShader(r, n);
    const f = () => {
      var o;
      i.isCompiled = !0, (o = i.onCompiled) === null || o === void 0 || o.call(i), this.onAfterShaderCompilationObservable.notifyObservers(this);
    };
    if (this.isAsync(e))
      return this._engine.createProgramAsync(t, r, f, (o) => {
        i.compilationError = o;
      });
    try {
      const o = i.nativeProgram = this._engine.createProgram(t, r);
      return f(), o;
    } catch (o) {
      const d = o == null ? void 0 : o.message;
      throw new Error("SHADER ERROR" + (typeof d == "string" ? `
` + d : ""));
    }
  }
  /**
   * Inline functions in shader code that are marked to be inlined
   * @param code code to inline
   * @returns inlined code
   */
  inlineShaderCode(e) {
    const t = new Aq(e);
    return t.debug = !1, t.processCode(), t.code;
  }
  _setProgram(e) {
    this._currentProgram !== e && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETPROGRAM), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.finishEncodingCommand(), this._currentProgram = e);
  }
  _deletePipelineContext(e) {
    const t = e;
    t && t.nativeProgram && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEPROGRAM), this._commandBufferEncoder.encodeCommandArgAsNativeData(t.nativeProgram), this._commandBufferEncoder.finishEncodingCommand());
  }
  getUniforms(e, t) {
    const r = e;
    return this._engine.getUniforms(r.nativeProgram, t);
  }
  bindUniformBlock(e, t, r) {
    throw new Error("Not Implemented");
  }
  bindSamplers(e) {
    const t = e.getPipelineContext();
    this._setProgram(t.nativeProgram);
    const r = e.getSamplers();
    for (let n = 0; n < r.length; n++) {
      const i = e.getUniform(r[n]);
      i && (this._boundUniforms[n] = i);
    }
    this._currentEffect = null;
  }
  getRenderWidth(e = !1) {
    return !e && this._currentRenderTarget ? this._currentRenderTarget.width : this._engine.getRenderWidth();
  }
  getRenderHeight(e = !1) {
    return !e && this._currentRenderTarget ? this._currentRenderTarget.height : this._engine.getRenderHeight();
  }
  setViewport(e, t, r) {
    this._cachedViewport = e, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETVIEWPORT), this._commandBufferEncoder.encodeCommandArgAsFloat32(e.x), this._commandBufferEncoder.encodeCommandArgAsFloat32(e.y), this._commandBufferEncoder.encodeCommandArgAsFloat32(e.width), this._commandBufferEncoder.encodeCommandArgAsFloat32(e.height), this._commandBufferEncoder.finishEncodingCommand();
  }
  enableScissor(e, t, r, n) {
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSCISSOR), this._commandBufferEncoder.encodeCommandArgAsFloat32(e), this._commandBufferEncoder.encodeCommandArgAsFloat32(t), this._commandBufferEncoder.encodeCommandArgAsFloat32(r), this._commandBufferEncoder.encodeCommandArgAsFloat32(n), this._commandBufferEncoder.finishEncodingCommand();
  }
  disableScissor() {
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSCISSOR), this._commandBufferEncoder.encodeCommandArgAsFloat32(0), this._commandBufferEncoder.encodeCommandArgAsFloat32(0), this._commandBufferEncoder.encodeCommandArgAsFloat32(0), this._commandBufferEncoder.encodeCommandArgAsFloat32(0), this._commandBufferEncoder.finishEncodingCommand();
  }
  setState(e, t = 0, r, n = !1, i, s, a = 0) {
    var f, o;
    this._zOffset = t, this._zOffsetUnits = a, this._zOffset !== 0 && ye.Warn("zOffset is not supported in Native engine."), this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSTATE), this._commandBufferEncoder.encodeCommandArgAsUInt32(e ? 1 : 0), this._commandBufferEncoder.encodeCommandArgAsFloat32(t), this._commandBufferEncoder.encodeCommandArgAsFloat32(a), this._commandBufferEncoder.encodeCommandArgAsUInt32(!((o = (f = this.cullBackFaces) !== null && f !== void 0 ? f : i) !== null && o !== void 0) || o ? 1 : 0), this._commandBufferEncoder.encodeCommandArgAsUInt32(n ? 1 : 0), this._commandBufferEncoder.finishEncodingCommand();
  }
  /**
   * Gets the client rect of native canvas.  Needed for InputManager.
   * @returns a client rectangle
   */
  getInputElementClientRect() {
    return {
      bottom: this.getRenderHeight(),
      height: this.getRenderHeight(),
      left: 0,
      right: this.getRenderWidth(),
      top: 0,
      width: this.getRenderWidth(),
      x: 0,
      y: 0,
      toJSON: () => {
      }
    };
  }
  /**
   * Set the z offset Factor to apply to current rendering
   * @param value defines the offset to apply
   */
  setZOffset(e) {
    e !== this._zOffset && (this._zOffset = e, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETZOFFSET), this._commandBufferEncoder.encodeCommandArgAsFloat32(this.useReverseDepthBuffer ? -e : e), this._commandBufferEncoder.finishEncodingCommand());
  }
  /**
   * Gets the current value of the zOffset Factor
   * @returns the current zOffset Factor state
   */
  getZOffset() {
    return this._zOffset;
  }
  /**
   * Set the z offset Units to apply to current rendering
   * @param value defines the offset to apply
   */
  setZOffsetUnits(e) {
    e !== this._zOffsetUnits && (this._zOffsetUnits = e, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETZOFFSETUNITS), this._commandBufferEncoder.encodeCommandArgAsFloat32(this.useReverseDepthBuffer ? -e : e), this._commandBufferEncoder.finishEncodingCommand());
  }
  /**
   * Gets the current value of the zOffset Units
   * @returns the current zOffset Units state
   */
  getZOffsetUnits() {
    return this._zOffsetUnits;
  }
  /**
   * Enable or disable depth buffering
   * @param enable defines the state to set
   */
  setDepthBuffer(e) {
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHTEST), this._commandBufferEncoder.encodeCommandArgAsUInt32(e ? this._currentDepthTest : _native.Engine.DEPTH_TEST_ALWAYS), this._commandBufferEncoder.finishEncodingCommand();
  }
  /**
   * Gets a boolean indicating if depth writing is enabled
   * @returns the current depth writing state
   */
  getDepthWrite() {
    return this._depthWrite;
  }
  getDepthFunction() {
    switch (this._currentDepthTest) {
      case _native.Engine.DEPTH_TEST_NEVER:
        return 512;
      case _native.Engine.DEPTH_TEST_ALWAYS:
        return 519;
      case _native.Engine.DEPTH_TEST_GREATER:
        return 516;
      case _native.Engine.DEPTH_TEST_GEQUAL:
        return 518;
      case _native.Engine.DEPTH_TEST_NOTEQUAL:
        return 517;
      case _native.Engine.DEPTH_TEST_EQUAL:
        return 514;
      case _native.Engine.DEPTH_TEST_LESS:
        return 513;
      case _native.Engine.DEPTH_TEST_LEQUAL:
        return 515;
    }
    return null;
  }
  setDepthFunction(e) {
    let t = 0;
    switch (e) {
      case 512:
        t = _native.Engine.DEPTH_TEST_NEVER;
        break;
      case 519:
        t = _native.Engine.DEPTH_TEST_ALWAYS;
        break;
      case 516:
        t = _native.Engine.DEPTH_TEST_GREATER;
        break;
      case 518:
        t = _native.Engine.DEPTH_TEST_GEQUAL;
        break;
      case 517:
        t = _native.Engine.DEPTH_TEST_NOTEQUAL;
        break;
      case 514:
        t = _native.Engine.DEPTH_TEST_EQUAL;
        break;
      case 513:
        t = _native.Engine.DEPTH_TEST_LESS;
        break;
      case 515:
        t = _native.Engine.DEPTH_TEST_LEQUAL;
        break;
    }
    this._currentDepthTest = t, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHTEST), this._commandBufferEncoder.encodeCommandArgAsUInt32(this._currentDepthTest), this._commandBufferEncoder.finishEncodingCommand();
  }
  /**
   * Enable or disable depth writing
   * @param enable defines the state to set
   */
  setDepthWrite(e) {
    this._depthWrite = e, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHWRITE), this._commandBufferEncoder.encodeCommandArgAsUInt32(Number(e)), this._commandBufferEncoder.finishEncodingCommand();
  }
  /**
   * Enable or disable color writing
   * @param enable defines the state to set
   */
  setColorWrite(e) {
    this._colorWrite = e, this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETCOLORWRITE), this._commandBufferEncoder.encodeCommandArgAsUInt32(Number(e)), this._commandBufferEncoder.finishEncodingCommand();
  }
  /**
   * Gets a boolean indicating if color writing is enabled
   * @returns the current color writing state
   */
  getColorWrite() {
    return this._colorWrite;
  }
  applyStencil() {
    this._setStencil(this._stencilMask, bue(this._stencilOpStencilFail), xue(this._stencilOpDepthFail), Due(this._stencilOpStencilDepthPass), que(this._stencilFunc), this._stencilFuncRef);
  }
  _setStencil(e, t, r, n, i, s) {
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSTENCIL), this._commandBufferEncoder.encodeCommandArgAsUInt32(e), this._commandBufferEncoder.encodeCommandArgAsUInt32(t), this._commandBufferEncoder.encodeCommandArgAsUInt32(r), this._commandBufferEncoder.encodeCommandArgAsUInt32(n), this._commandBufferEncoder.encodeCommandArgAsUInt32(i), this._commandBufferEncoder.encodeCommandArgAsUInt32(s), this._commandBufferEncoder.finishEncodingCommand();
  }
  /**
   * Enable or disable the stencil buffer
   * @param enable defines if the stencil buffer must be enabled or disabled
   */
  setStencilBuffer(e) {
    this._stencilTest = e, e ? this.applyStencil() : this._setStencil(255, _native.Engine.STENCIL_OP_FAIL_S_KEEP, _native.Engine.STENCIL_OP_FAIL_Z_KEEP, _native.Engine.STENCIL_OP_PASS_Z_KEEP, _native.Engine.STENCIL_TEST_ALWAYS, 0);
  }
  /**
   * Gets a boolean indicating if stencil buffer is enabled
   * @returns the current stencil buffer state
   */
  getStencilBuffer() {
    return this._stencilTest;
  }
  /**
   * Gets the current stencil operation when stencil passes
   * @returns a number defining stencil operation to use when stencil passes
   */
  getStencilOperationPass() {
    return this._stencilOpStencilDepthPass;
  }
  /**
   * Sets the stencil operation to use when stencil passes
   * @param operation defines the stencil operation to use when stencil passes
   */
  setStencilOperationPass(e) {
    this._stencilOpStencilDepthPass = e, this.applyStencil();
  }
  /**
   * Sets the current stencil mask
   * @param mask defines the new stencil mask to use
   */
  setStencilMask(e) {
    this._stencilMask = e, this.applyStencil();
  }
  /**
   * Sets the current stencil function
   * @param stencilFunc defines the new stencil function to use
   */
  setStencilFunction(e) {
    this._stencilFunc = e, this.applyStencil();
  }
  /**
   * Sets the current stencil reference
   * @param reference defines the new stencil reference to use
   */
  setStencilFunctionReference(e) {
    this._stencilFuncRef = e, this.applyStencil();
  }
  /**
   * Sets the current stencil mask
   * @param mask defines the new stencil mask to use
   */
  setStencilFunctionMask(e) {
    this._stencilFuncMask = e;
  }
  /**
   * Sets the stencil operation to use when stencil fails
   * @param operation defines the stencil operation to use when stencil fails
   */
  setStencilOperationFail(e) {
    this._stencilOpStencilFail = e, this.applyStencil();
  }
  /**
   * Sets the stencil operation to use when depth fails
   * @param operation defines the stencil operation to use when depth fails
   */
  setStencilOperationDepthFail(e) {
    this._stencilOpDepthFail = e, this.applyStencil();
  }
  /**
   * Gets the current stencil mask
   * @returns a number defining the new stencil mask to use
   */
  getStencilMask() {
    return this._stencilMask;
  }
  /**
   * Gets the current stencil function
   * @returns a number defining the stencil function to use
   */
  getStencilFunction() {
    return this._stencilFunc;
  }
  /**
   * Gets the current stencil reference value
   * @returns a number defining the stencil reference value to use
   */
  getStencilFunctionReference() {
    return this._stencilFuncRef;
  }
  /**
   * Gets the current stencil mask
   * @returns a number defining the stencil mask to use
   */
  getStencilFunctionMask() {
    return this._stencilFuncMask;
  }
  /**
   * Gets the current stencil operation when stencil fails
   * @returns a number defining stencil operation to use when stencil fails
   */
  getStencilOperationFail() {
    return this._stencilOpStencilFail;
  }
  /**
   * Gets the current stencil operation when depth fails
   * @returns a number defining stencil operation to use when depth fails
   */
  getStencilOperationDepthFail() {
    return this._stencilOpDepthFail;
  }
  /**
   * Sets alpha constants used by some alpha blending modes
   * @param r defines the red component
   * @param g defines the green component
   * @param b defines the blue component
   * @param a defines the alpha component
   */
  setAlphaConstants(e, t, r, n) {
    throw new Error("Setting alpha blend constant color not yet implemented.");
  }
  /**
   * Sets the current alpha mode
   * @param mode defines the mode to use (one of the BABYLON.undefined)
   * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
   */
  setAlphaMode(e, t = !1) {
    if (this._alphaMode === e)
      return;
    const r = jue(e);
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETBLENDMODE), this._commandBufferEncoder.encodeCommandArgAsUInt32(r), this._commandBufferEncoder.finishEncodingCommand(), t || this.setDepthWrite(e === 0), this._alphaMode = e;
  }
  /**
   * Gets the current alpha mode
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
   * @returns the current alpha mode
   */
  getAlphaMode() {
    return this._alphaMode;
  }
  setInt(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINT), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsInt32(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setIntArray(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsInt32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setIntArray2(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY2), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsInt32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setIntArray3(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY3), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsInt32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setIntArray4(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY4), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsInt32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setFloatArray(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setFloatArray2(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY2), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setFloatArray3(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY3), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setFloatArray4(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY4), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setArray(e, t) {
    return e ? this.setFloatArray(e, new Float32Array(t)) : !1;
  }
  setArray2(e, t) {
    return e ? this.setFloatArray2(e, new Float32Array(t)) : !1;
  }
  setArray3(e, t) {
    return e ? this.setFloatArray3(e, new Float32Array(t)) : !1;
  }
  setArray4(e, t) {
    return e ? this.setFloatArray4(e, new Float32Array(t)) : !1;
  }
  setMatrices(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRICES), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setMatrix3x3(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRIX3X3), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setMatrix2x2(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRIX2X2), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32s(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setFloat(e, t) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32(t), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setFloat2(e, t, r) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT2), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32(t), this._commandBufferEncoder.encodeCommandArgAsFloat32(r), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setFloat3(e, t, r, n) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT3), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32(t), this._commandBufferEncoder.encodeCommandArgAsFloat32(r), this._commandBufferEncoder.encodeCommandArgAsFloat32(n), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setFloat4(e, t, r, n, i) {
    return e ? (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT4), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsFloat32(t), this._commandBufferEncoder.encodeCommandArgAsFloat32(r), this._commandBufferEncoder.encodeCommandArgAsFloat32(n), this._commandBufferEncoder.encodeCommandArgAsFloat32(i), this._commandBufferEncoder.finishEncodingCommand(), !0) : !1;
  }
  setColor3(e, t) {
    return e ? (this.setFloat3(e, t.r, t.g, t.b), !0) : !1;
  }
  setColor4(e, t, r) {
    return e ? (this.setFloat4(e, t.r, t.g, t.b, r), !0) : !1;
  }
  wipeCaches(e) {
    this.preventCacheWipeBetweenFrames || (this.resetTextureCache(), this._currentEffect = null, e && (this._currentProgram = null, this._stencilStateComposer.reset(), this._depthCullingState.reset(), this._alphaState.reset()), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null);
  }
  _createTexture() {
    return this._engine.createTexture();
  }
  _deleteTexture(e) {
    e && this._engine.deleteTexture(e);
  }
  /**
   * Update the content of a dynamic texture
   * @param texture defines the texture to update
   * @param canvas defines the canvas containing the source
   * @param invertY defines if data must be stored with Y axis inverted
   * @param premulAlpha defines if alpha is stored as premultiplied
   * @param format defines the format of the data
   */
  updateDynamicTexture(e, t, r, n = !1, i) {
    if (n === void 0 && (n = !1), e && e._hardwareTexture) {
      const s = t.getCanvasTexture(), a = e._hardwareTexture.underlyingResource;
      this._engine.copyTexture(a, s), e.isReady = !0;
    }
  }
  createDynamicTexture(e, t, r, n) {
    return e = Math.max(e, 1), t = Math.max(t, 1), this.createRawTexture(new Uint8Array(e * t * 4), e, t, 5, !1, !1, n);
  }
  createVideoElement(e) {
    return this._camera ? this._camera.createVideo(e) : null;
  }
  updateVideoTexture(e, t, r) {
    if (e && e._hardwareTexture && this._camera) {
      const n = e._hardwareTexture.underlyingResource;
      this._camera.updateVideoTexture(n, t, r);
    }
  }
  createRawTexture(e, t, r, n, i, s, a, f = null, o = 0, d = 0, v = !1) {
    const u = new As(this, ri.Raw);
    if (u.format = n, u.generateMipMaps = i, u.samplingMode = a, u.invertY = s, u.baseWidth = t, u.baseHeight = r, u.width = u.baseWidth, u.height = u.baseHeight, u._compression = f, u.type = o, u._useSRGBBuffer = this._getUseSRGBBuffer(v, !i), this.updateRawTexture(u, e, n, s, f, o, u._useSRGBBuffer), u._hardwareTexture) {
      const l = u._hardwareTexture.underlyingResource, P = AI(a);
      this._setTextureSampling(l, P);
    }
    return this._internalTexturesCache.push(u), u;
  }
  createRawTexture2DArray(e, t, r, n, i, s, a, f, o = null, d = 0) {
    const v = new As(this, ri.Raw2DArray);
    if (v.baseWidth = t, v.baseHeight = r, v.baseDepth = n, v.width = t, v.height = r, v.depth = n, v.format = i, v.type = d, v.generateMipMaps = s, v.samplingMode = f, v.is2DArray = !0, v._hardwareTexture) {
      const u = v._hardwareTexture.underlyingResource;
      this._engine.loadRawTexture2DArray(u, e, t, r, n, DE(i, d), s, a);
      const l = AI(f);
      this._setTextureSampling(u, l);
    }
    return v.isReady = !0, this._internalTexturesCache.push(v), v;
  }
  updateRawTexture(e, t, r, n, i = null, s = 0, a = !1) {
    if (e) {
      if (t && e._hardwareTexture) {
        const f = e._hardwareTexture.underlyingResource;
        this._engine.loadRawTexture(f, t, e.width, e.height, DE(r, s), e.generateMipMaps, e.invertY);
      }
      e.isReady = !0;
    }
  }
  // TODO: Refactor to share more logic with babylon.engine.ts version.
  /**
   * Usually called from Texture.ts.
   * Passed information to create a NativeTexture
   * @param url defines a value which contains one of the following:
   * * A conventional http URL, e.g. 'http://...' or 'file://...'
   * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
   * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
   * @param noMipmap defines a boolean indicating that no mipmaps shall be generated.  Ignored for compressed textures.  They must be in the file
   * @param invertY when true, image is flipped when loaded.  You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
   * @param scene needed for loading to the correct scene
   * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
   * @param onLoad optional callback to be called upon successful completion
   * @param onError optional callback to be called upon failure
   * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
   * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
   * @param format internal format.  Default: RGB when extension is '.jpg' else RGBA.  Ignored for compressed textures
   * @param forcedExtension defines the extension to use to pick the right loader
   * @param mimeType defines an optional mime type
   * @param loaderOptions options to be passed to the loader
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   * @returns a InternalTexture for assignment back into BABYLON.Texture
   */
  createTexture(e, t, r, n, i = 3, s = null, a = null, f = null, o = null, d = null, v = null, u, l, P, p = !1) {
    e = e || "";
    const c = e.substr(0, 5) === "data:", H = c && e.indexOf(";base64,") !== -1, T = o || new As(this, ri.Url), q = e;
    this._transformTextureUrl && !H && !o && !f && (e = this._transformTextureUrl(e));
    const b = e.lastIndexOf("."), j = v || (b > -1 ? e.substring(b).toLowerCase() : "");
    let w = null;
    for (const N of Ge._TextureLoaders)
      if (N.canLoad(j)) {
        w = N;
        break;
      }
    n && n.addPendingData(T), T.url = e, T.generateMipMaps = !t, T.samplingMode = i, T.invertY = r, T._useSRGBBuffer = this._getUseSRGBBuffer(p, t), this.doNotHandleContextLost || (T._buffer = f);
    let m = null;
    s && !o && (m = T.onLoadedObservable.add(s)), o || this._internalTexturesCache.push(T);
    const I = (N, k) => {
      n && n.removePendingData(T), e === q ? (m && T.onLoadedObservable.remove(m), gr.UseFallbackTexture && this.createTexture(gr.FallbackTexture, t, T.invertY, n, i, null, a, f, T), a && a((N || "Unknown error") + (gr.UseFallbackTexture ? " - Fallback texture was used" : ""), k)) : (Se.Warn(`Failed to load ${e}, falling back to ${q}`), this.createTexture(q, t, T.invertY, n, i, s, a, f, T, d, v, u, l));
    };
    if (w)
      throw new Error("Loading textures from IInternalTextureLoader not yet implemented.");
    {
      const N = (k) => {
        if (!T._hardwareTexture) {
          n && n.removePendingData(T);
          return;
        }
        const R = T._hardwareTexture.underlyingResource;
        this._engine.loadTexture(R, k, !t, r, T._useSRGBBuffer, () => {
          T.baseWidth = this._engine.getTextureWidth(R), T.baseHeight = this._engine.getTextureHeight(R), T.width = T.baseWidth, T.height = T.baseHeight, T.isReady = !0;
          const y = AI(i);
          this._setTextureSampling(R, y), n && n.removePendingData(T), T.onLoadedObservable.notifyObservers(T), T.onLoadedObservable.clear();
        }, () => {
          throw new Error("Could not load a native texture.");
        });
      };
      if (c && f)
        if (f instanceof ArrayBuffer)
          N(new Uint8Array(f));
        else if (ArrayBuffer.isView(f))
          N(f);
        else if (typeof f == "string")
          N(new Uint8Array(ye.DecodeBase64(f)));
        else
          throw new Error("Unsupported buffer type");
      else
        H ? N(new Uint8Array(ye.DecodeBase64(e))) : this._loadFile(e, (k) => N(new Uint8Array(k)), void 0, void 0, !0, (k, R) => {
          I("Unable to load " + (k && k.responseURL, R));
        });
    }
    return T;
  }
  /**
   * Wraps an external native texture in a Babylon texture.
   * @param texture defines the external texture
   * @param hasMipMaps defines whether the external texture has mip maps
   * @param samplingMode defines the sampling mode for the external texture (default: 3)
   * @returns the babylon internal texture
   */
  wrapNativeTexture(e, t = !1, r = 3) {
    const n = new XG(e, this._engine), i = new As(this, ri.Unknown, !0);
    return i._hardwareTexture = n, i.baseWidth = this._engine.getTextureWidth(e), i.baseHeight = this._engine.getTextureHeight(e), i.width = i.baseWidth, i.height = i.baseHeight, i.isReady = !0, i.useMipMaps = t, this.updateTextureSamplingMode(r, i), i;
  }
  /**
   * Wraps an external web gl texture in a Babylon texture.
   * @returns the babylon internal texture
   */
  wrapWebGLTexture() {
    throw new Error("wrapWebGLTexture is not supported, use wrapNativeTexture instead.");
  }
  _createDepthStencilTexture(e, t, r) {
    var n, i;
    const s = t.generateStencil || !1, a = t.samples || 1, f = r, o = new As(this, ri.DepthStencil), d = (n = e.width) !== null && n !== void 0 ? n : e, v = (i = e.height) !== null && i !== void 0 ? i : e, u = this._engine.createFrameBuffer(o._hardwareTexture.underlyingResource, d, v, s, !0, a);
    return f._framebufferDepthStencil = u, o;
  }
  /**
   * @internal
   */
  _releaseFramebufferObjects(e) {
    e && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEFRAMEBUFFER), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.finishEncodingCommand());
  }
  /**
   * @internal Engine abstraction for loading and creating an image bitmap from a given source string.
   * @param imageSource source to load the image from.
   * @param options An object that sets options for the image's extraction.
   * @returns ImageBitmap
   */
  _createImageBitmapFromSource(e, t) {
    return new Promise((n, i) => {
      const s = this.createCanvasImage();
      s.onload = () => {
        try {
          const a = this._engine.createImageBitmap(s);
          n(a);
        } catch (a) {
          i(`Error loading image ${s.src} with exception: ${a}`);
        }
      }, s.onerror = (a) => {
        i(`Error loading image ${s.src} with exception: ${a}`);
      }, s.src = e;
    });
  }
  /**
   * Engine abstraction for createImageBitmap
   * @param image source for image
   * @param options An object that sets options for the image's extraction.
   * @returns ImageBitmap
   */
  createImageBitmap(e, t) {
    return new Promise((r, n) => {
      if (Array.isArray(e)) {
        const i = e;
        if (i.length) {
          const s = this._engine.createImageBitmap(i[0]);
          if (s) {
            r(s);
            return;
          }
        }
      }
      n("Unsupported data for createImageBitmap.");
    });
  }
  /**
   * Resize an image and returns the image data as an uint8array
   * @param image image to resize
   * @param bufferWidth destination buffer width
   * @param bufferHeight destination buffer height
   * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size
   */
  resizeImageBitmap(e, t, r) {
    return this._engine.resizeImageBitmap(e, t, r);
  }
  /**
   * Creates a cube texture
   * @param rootUrl defines the url where the files to load is located
   * @param scene defines the current scene
   * @param files defines the list of files to load (1 per face)
   * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
   * @param onLoad defines an optional callback raised when the texture is loaded
   * @param onError defines an optional callback raised if there is an issue to load the texture
   * @param format defines the format of the data
   * @param forcedExtension defines the extension to use to pick the right loader
   * @param createPolynomials if a polynomial sphere should be created for the cube texture
   * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
   * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
   * @param fallback defines texture to use while falling back when (compressed) texture file not found.
   * @param loaderOptions options to be passed to the loader
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   * @returns the cube texture as an InternalTexture
   */
  createCubeTexture(e, t, r, n, i = null, s = null, a, f = null, o = !1, d = 0, v = 0, u = null, l, P = !1) {
    const p = u || new As(this, ri.Cube);
    p.isCube = !0, p.url = e, p.generateMipMaps = !n, p._lodGenerationScale = d, p._lodGenerationOffset = v, p._useSRGBBuffer = this._getUseSRGBBuffer(P, !!n), this._doNotHandleContextLost || (p._extension = f, p._files = r);
    const c = e.lastIndexOf(".");
    if ((f || (c > -1 ? e.substring(c).toLowerCase() : "")) === ".env") {
      const T = (q) => {
        const b = ry(q);
        p.width = b.width, p.height = b.width, iy(p, b);
        const j = b.specular;
        if (!j)
          throw new Error("Nothing else parsed so far");
        p._lodGenerationScale = j.lodGenerationScale;
        const w = ny(q, b);
        p.format = 5, p.type = 0, p.generateMipMaps = !0, p.getEngine().updateTextureSamplingMode(We.TRILINEAR_SAMPLINGMODE, p), p._isRGBD = !0, p.invertY = !0, this._engine.loadCubeTextureWithMips(p._hardwareTexture.underlyingResource, w, !1, p._useSRGBBuffer, () => {
          p.isReady = !0, i && i();
        }, () => {
          throw new Error("Could not load a native cube texture.");
        });
      };
      if (r && r.length === 6)
        throw new Error("Multi-file loading not allowed on env files.");
      {
        const q = (b, j) => {
          s && b && s(b.status + " " + b.statusText, j);
        };
        this._loadFile(e, (b) => T(new Uint8Array(b)), void 0, void 0, !0, q);
      }
    } else {
      if (!r || r.length !== 6)
        throw new Error("Cannot load cubemap because 6 files were not defined");
      const T = [r[0], r[3], r[1], r[4], r[2], r[5]];
      Promise.all(T.map((q) => ye.LoadFileAsync(q).then((b) => new Uint8Array(b)))).then((q) => new Promise((b, j) => {
        this._engine.loadCubeTexture(p._hardwareTexture.underlyingResource, q, !n, !0, p._useSRGBBuffer, b, j);
      })).then(() => {
        p.isReady = !0, i && i();
      }, (q) => {
        s && s(`Failed to load cubemap: ${q.message}`, q);
      });
    }
    return this._internalTexturesCache.push(p), p;
  }
  /** @internal */
  _createHardwareTexture() {
    return new XG(this._createTexture(), this._engine);
  }
  /** @internal */
  _createHardwareRenderTargetWrapper(e, t, r) {
    const n = new Tue(e, t, r, this);
    return this._renderTargetWrapperCache.push(n), n;
  }
  /** @internal */
  _createInternalTexture(e, t, r = !0, n = ri.Unknown) {
    var i, s, a;
    let f = !1, o = 0, d = 3, v = 5, u = !1, l = 1, P;
    t !== void 0 && typeof t == "object" ? (f = !!t.generateMipMaps, o = t.type === void 0 ? 0 : t.type, d = t.samplingMode === void 0 ? 3 : t.samplingMode, v = t.format === void 0 ? 5 : t.format, u = t.useSRGBBuffer === void 0 ? !1 : t.useSRGBBuffer, l = (i = t.samples) !== null && i !== void 0 ? i : 1, P = t.label) : f = !!t, u = this._getUseSRGBBuffer(u, !f), (o === 1 && !this._caps.textureFloatLinearFiltering || o === 2 && !this._caps.textureHalfFloatLinearFiltering) && (d = 1), o === 1 && !this._caps.textureFloat && (o = 0, Se.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));
    const p = new As(this, n), c = (s = e.width) !== null && s !== void 0 ? s : e, H = (a = e.height) !== null && a !== void 0 ? a : e, T = e.layers || 0;
    if (T !== 0)
      throw new Error("Texture layers are not supported in Babylon Native");
    const q = p._hardwareTexture.underlyingResource, b = DE(v, o);
    return this._engine.initializeTexture(q, c, H, f, b, !0, u, l), this._setTextureSampling(q, AI(d)), p._useSRGBBuffer = u, p.baseWidth = c, p.baseHeight = H, p.width = c, p.height = H, p.depth = T, p.isReady = !0, p.samples = l, p.generateMipMaps = f, p.samplingMode = d, p.type = o, p.format = v, p.label = P, this._internalTexturesCache.push(p), p;
  }
  createRenderTargetTexture(e, t) {
    var r, n, i, s;
    const a = this._createHardwareRenderTargetWrapper(!1, !1, e);
    let f = !0, o = !1, d = !1, v, u = 1;
    t !== void 0 && typeof t == "object" && (f = (r = t.generateDepthBuffer) !== null && r !== void 0 ? r : !0, o = !!t.generateStencilBuffer, d = !!t.noColorAttachment, v = t.colorAttachment, u = (n = t.samples) !== null && n !== void 0 ? n : 1);
    const l = v || (d ? null : this._createInternalTexture(e, t, !0, ri.RenderTarget)), P = (i = e.width) !== null && i !== void 0 ? i : e, p = (s = e.height) !== null && s !== void 0 ? s : e, c = this._engine.createFrameBuffer(l ? l._hardwareTexture.underlyingResource : null, P, p, o, f, u);
    return a._framebuffer = c, a._generateDepthBuffer = f, a._generateStencilBuffer = o, a._samples = u, a.setTextures(l), a;
  }
  updateRenderTargetTextureSampleCount(e, t) {
    return Se.Warn("Updating render target sample count is not currently supported"), e.samples;
  }
  updateTextureSamplingMode(e, t) {
    if (t._hardwareTexture) {
      const r = AI(e);
      this._setTextureSampling(t._hardwareTexture.underlyingResource, r);
    }
    t.samplingMode = e;
  }
  bindFramebuffer(e, t, r, n, i) {
    const s = e;
    if (this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = e, t)
      throw new Error("Cuboid frame buffers are not yet supported in NativeEngine.");
    if (r || n)
      throw new Error("Required width/height for frame buffers not yet supported in NativeEngine.");
    s._framebufferDepthStencil ? this._bindUnboundFramebuffer(s._framebufferDepthStencil) : this._bindUnboundFramebuffer(s._framebuffer);
  }
  unBindFramebuffer(e, t = !1, r) {
    this._currentRenderTarget = null, r && r(), this._bindUnboundFramebuffer(null);
  }
  createDynamicVertexBuffer(e) {
    return this.createVertexBuffer(e, !0);
  }
  updateDynamicIndexBuffer(e, t, r = 0) {
    const n = e, i = this._normalizeIndexData(t);
    n.is32Bits = i.BYTES_PER_ELEMENT === 4, this._engine.updateDynamicIndexBuffer(n.nativeIndexBuffer, i.buffer, i.byteOffset, i.byteLength, r);
  }
  updateDynamicVertexBuffer(e, t, r, n) {
    const i = e, s = ArrayBuffer.isView(t) ? t : new Float32Array(t);
    this._engine.updateDynamicVertexBuffer(i.nativeVertexBuffer, s.buffer, s.byteOffset + (r ?? 0), n ?? s.byteLength);
  }
  // TODO: Refactor to share more logic with base Engine implementation.
  _setTexture(e, t, r = !1, n = !1) {
    const i = this._boundUniforms[e];
    if (!i)
      return !1;
    if (!t)
      return this._boundTexturesCache[e] != null && (this._activeChannel = e, this._boundTexturesCache[e] = null), !1;
    if (t.video)
      this._activeChannel = e, t.update();
    else if (t.delayLoadState === 4)
      return t.delayLoad(), !1;
    let s;
    return n ? s = t.depthStencilTexture : t.isReady() ? s = t.getInternalTexture() : t.isCube ? s = this.emptyCubeTexture : t.is3D ? s = this.emptyTexture3D : t.is2DArray ? s = this.emptyTexture2DArray : s = this.emptyTexture, this._activeChannel = e, !s || !s._hardwareTexture ? !1 : (this._setTextureWrapMode(s._hardwareTexture.underlyingResource, jE(t.wrapU), jE(t.wrapV), jE(t.wrapR)), this._updateAnisotropicLevel(t), this._setTextureCore(i, s._hardwareTexture.underlyingResource), !0);
  }
  // filter is a NativeFilter.XXXX value.
  _setTextureSampling(e, t) {
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTURESAMPLING), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsUInt32(t), this._commandBufferEncoder.finishEncodingCommand();
  }
  // addressModes are NativeAddressMode.XXXX values.
  _setTextureWrapMode(e, t, r, n) {
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTUREWRAPMODE), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsUInt32(t), this._commandBufferEncoder.encodeCommandArgAsUInt32(r), this._commandBufferEncoder.encodeCommandArgAsUInt32(n), this._commandBufferEncoder.finishEncodingCommand();
  }
  _setTextureCore(e, t) {
    this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTURE), this._commandBufferEncoder.encodeCommandArgAsNativeData(e), this._commandBufferEncoder.encodeCommandArgAsNativeData(t), this._commandBufferEncoder.finishEncodingCommand();
  }
  // TODO: Share more of this logic with the base implementation.
  // TODO: Rename to match naming in base implementation once refactoring allows different parameters.
  _updateAnisotropicLevel(e) {
    const t = e.getInternalTexture(), r = e.anisotropicFilteringLevel;
    !t || !t._hardwareTexture || t._cachedAnisotropicFilteringLevel !== r && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTUREANISOTROPICLEVEL), this._commandBufferEncoder.encodeCommandArgAsNativeData(t._hardwareTexture.underlyingResource), this._commandBufferEncoder.encodeCommandArgAsUInt32(r), this._commandBufferEncoder.finishEncodingCommand(), t._cachedAnisotropicFilteringLevel = r);
  }
  /**
   * @internal
   */
  _bindTexture(e, t) {
    const r = this._boundUniforms[e];
    if (r && t && t._hardwareTexture) {
      const n = t._hardwareTexture.underlyingResource;
      this._setTextureCore(r, n);
    }
  }
  _deleteBuffer(e) {
    e.nativeIndexBuffer && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEINDEXBUFFER), this._commandBufferEncoder.encodeCommandArgAsNativeData(e.nativeIndexBuffer), this._commandBufferEncoder.finishEncodingCommand(), delete e.nativeIndexBuffer), e.nativeVertexBuffer && (this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEVERTEXBUFFER), this._commandBufferEncoder.encodeCommandArgAsNativeData(e.nativeVertexBuffer), this._commandBufferEncoder.finishEncodingCommand(), delete e.nativeVertexBuffer);
  }
  /**
   * Create a canvas
   * @param width width
   * @param height height
   * @returns ICanvas interface
   */
  createCanvas(e, t) {
    if (!_native.Canvas)
      throw new Error("Native Canvas plugin not available.");
    const r = new _native.Canvas();
    return r.width = e, r.height = t, r;
  }
  /**
   * Create an image to use with canvas
   * @returns IImage interface
   */
  createCanvasImage() {
    if (!_native.Canvas)
      throw new Error("Native Canvas plugin not available.");
    return new _native.Image();
  }
  /**
   * Update a portion of an internal texture
   * @param texture defines the texture to update
   * @param imageData defines the data to store into the texture
   * @param xOffset defines the x coordinates of the update rectangle
   * @param yOffset defines the y coordinates of the update rectangle
   * @param width defines the width of the update rectangle
   * @param height defines the height of the update rectangle
   * @param faceIndex defines the face index if texture is a cube (0 by default)
   * @param lod defines the lod level to update (0 by default)
   * @param generateMipMaps defines whether to generate mipmaps or not
   */
  updateTextureData(e, t, r, n, i, s, a = 0, f = 0, o = !1) {
    throw new Error("updateTextureData not implemented.");
  }
  /**
   * @internal
   */
  _uploadCompressedDataToTextureDirectly(e, t, r, n, i, s = 0, a = 0) {
    throw new Error("_uploadCompressedDataToTextureDirectly not implemented.");
  }
  /**
   * @internal
   */
  _uploadDataToTextureDirectly(e, t, r = 0, n = 0) {
    throw new Error("_uploadDataToTextureDirectly not implemented.");
  }
  /**
   * @internal
   */
  _uploadArrayBufferViewToTexture(e, t, r = 0, n = 0) {
    throw new Error("_uploadArrayBufferViewToTexture not implemented.");
  }
  /**
   * @internal
   */
  _uploadImageToTexture(e, t, r = 0, n = 0) {
    throw new Error("_uploadArrayBufferViewToTexture not implemented.");
  }
  getFontOffset(e) {
    return { ascent: 0, height: 0, descent: 0 };
  }
  _readTexturePixels(e, t, r, n, i, s, a, f, o, d) {
    var v, u, l, P;
    if (n !== void 0 && n !== -1)
      throw new Error(`Reading cubemap faces is not supported, but faceIndex is ${n}.`);
    return this._engine.readTexture((v = e._hardwareTexture) === null || v === void 0 ? void 0 : v.underlyingResource, i ?? 0, o ?? 0, d ?? 0, t, r, (u = s == null ? void 0 : s.buffer) !== null && u !== void 0 ? u : null, (l = s == null ? void 0 : s.byteOffset) !== null && l !== void 0 ? l : 0, (P = s == null ? void 0 : s.byteLength) !== null && P !== void 0 ? P : 0).then((p) => (s || (s = new Uint8Array(p)), s));
  }
}
Hm.PROTOCOL_VERSION = 8;
Hm._createNativeDataStream = function() {
  return _native.NativeDataStream.VALIDATION_ENABLED ? new Xte() : new hD();
};
class Xte extends hD {
  constructor() {
    super();
  }
  writeUint32(e) {
    super.writeUint32(_native.NativeDataStream.VALIDATION_UINT_32), super.writeUint32(e);
  }
  writeInt32(e) {
    super.writeUint32(_native.NativeDataStream.VALIDATION_INT_32), super.writeInt32(e);
  }
  writeFloat32(e) {
    super.writeUint32(_native.NativeDataStream.VALIDATION_FLOAT_32), super.writeFloat32(e);
  }
  writeUint32Array(e) {
    super.writeUint32(_native.NativeDataStream.VALIDATION_UINT_32_ARRAY), super.writeUint32Array(e);
  }
  writeInt32Array(e) {
    super.writeUint32(_native.NativeDataStream.VALIDATION_INT_32_ARRAY), super.writeInt32Array(e);
  }
  writeFloat32Array(e) {
    super.writeUint32(_native.NativeDataStream.VALIDATION_FLOAT_32_ARRAY), super.writeFloat32Array(e);
  }
  writeNativeData(e) {
    super.writeUint32(_native.NativeDataStream.VALIDATION_NATIVE_DATA), super.writeNativeData(e);
  }
  writeBoolean(e) {
    super.writeUint32(_native.NativeDataStream.VALIDATION_BOOLEAN), super.writeBoolean(e);
  }
}
var sF;
(function(A) {
  A.LowPower = "low-power", A.HighPerformance = "high-performance";
})(sF || (sF = {}));
var k2;
(function(A) {
  A.DepthClipControl = "depth-clip-control", A.Depth32FloatStencil8 = "depth32float-stencil8", A.TextureCompressionBC = "texture-compression-bc", A.TextureCompressionETC2 = "texture-compression-etc2", A.TextureCompressionASTC = "texture-compression-astc", A.TimestampQuery = "timestamp-query", A.IndirectFirstInstance = "indirect-first-instance", A.ShaderF16 = "shader-f16", A.RG11B10UFloatRenderable = "rg11b10ufloat-renderable", A.BGRA8UnormStorage = "bgra8unorm-storage", A.Float32Filterable = "float32-filterable";
})(k2 || (k2 = {}));
var aF;
(function(A) {
  A.Unmapped = "unmapped", A.Pending = "pending", A.Mapped = "mapped";
})(aF || (aF = {}));
var ga;
(function(A) {
  A[A.MapRead = 1] = "MapRead", A[A.MapWrite = 2] = "MapWrite", A[A.CopySrc = 4] = "CopySrc", A[A.CopyDst = 8] = "CopyDst", A[A.Index = 16] = "Index", A[A.Vertex = 32] = "Vertex", A[A.Uniform = 64] = "Uniform", A[A.Storage = 128] = "Storage", A[A.Indirect = 256] = "Indirect", A[A.QueryResolve = 512] = "QueryResolve";
})(ga || (ga = {}));
var vD;
(function(A) {
  A[A.Read = 1] = "Read", A[A.Write = 2] = "Write";
})(vD || (vD = {}));
var Hp;
(function(A) {
  A.E1d = "1d", A.E2d = "2d", A.E3d = "3d";
})(Hp || (Hp = {}));
var Po;
(function(A) {
  A[A.CopySrc = 1] = "CopySrc", A[A.CopyDst = 2] = "CopyDst", A[A.TextureBinding = 4] = "TextureBinding", A[A.StorageBinding = 8] = "StorageBinding", A[A.RenderAttachment = 16] = "RenderAttachment";
})(Po || (Po = {}));
var Da;
(function(A) {
  A.E1d = "1d", A.E2d = "2d", A.E2dArray = "2d-array", A.Cube = "cube", A.CubeArray = "cube-array", A.E3d = "3d";
})(Da || (Da = {}));
var zH;
(function(A) {
  A.All = "all", A.StencilOnly = "stencil-only", A.DepthOnly = "depth-only";
})(zH || (zH = {}));
var we;
(function(A) {
  A.R8Unorm = "r8unorm", A.R8Snorm = "r8snorm", A.R8Uint = "r8uint", A.R8Sint = "r8sint", A.R16Uint = "r16uint", A.R16Sint = "r16sint", A.R16Float = "r16float", A.RG8Unorm = "rg8unorm", A.RG8Snorm = "rg8snorm", A.RG8Uint = "rg8uint", A.RG8Sint = "rg8sint", A.R32Uint = "r32uint", A.R32Sint = "r32sint", A.R32Float = "r32float", A.RG16Uint = "rg16uint", A.RG16Sint = "rg16sint", A.RG16Float = "rg16float", A.RGBA8Unorm = "rgba8unorm", A.RGBA8UnormSRGB = "rgba8unorm-srgb", A.RGBA8Snorm = "rgba8snorm", A.RGBA8Uint = "rgba8uint", A.RGBA8Sint = "rgba8sint", A.BGRA8Unorm = "bgra8unorm", A.BGRA8UnormSRGB = "bgra8unorm-srgb", A.RGB9E5UFloat = "rgb9e5ufloat", A.RGB10A2UINT = "rgb10a2uint", A.RGB10A2Unorm = "rgb10a2unorm", A.RG11B10UFloat = "rg11b10ufloat", A.RG32Uint = "rg32uint", A.RG32Sint = "rg32sint", A.RG32Float = "rg32float", A.RGBA16Uint = "rgba16uint", A.RGBA16Sint = "rgba16sint", A.RGBA16Float = "rgba16float", A.RGBA32Uint = "rgba32uint", A.RGBA32Sint = "rgba32sint", A.RGBA32Float = "rgba32float", A.Stencil8 = "stencil8", A.Depth16Unorm = "depth16unorm", A.Depth24Plus = "depth24plus", A.Depth24PlusStencil8 = "depth24plus-stencil8", A.Depth32Float = "depth32float", A.BC1RGBAUnorm = "bc1-rgba-unorm", A.BC1RGBAUnormSRGB = "bc1-rgba-unorm-srgb", A.BC2RGBAUnorm = "bc2-rgba-unorm", A.BC2RGBAUnormSRGB = "bc2-rgba-unorm-srgb", A.BC3RGBAUnorm = "bc3-rgba-unorm", A.BC3RGBAUnormSRGB = "bc3-rgba-unorm-srgb", A.BC4RUnorm = "bc4-r-unorm", A.BC4RSnorm = "bc4-r-snorm", A.BC5RGUnorm = "bc5-rg-unorm", A.BC5RGSnorm = "bc5-rg-snorm", A.BC6HRGBUFloat = "bc6h-rgb-ufloat", A.BC6HRGBFloat = "bc6h-rgb-float", A.BC7RGBAUnorm = "bc7-rgba-unorm", A.BC7RGBAUnormSRGB = "bc7-rgba-unorm-srgb", A.ETC2RGB8Unorm = "etc2-rgb8unorm", A.ETC2RGB8UnormSRGB = "etc2-rgb8unorm-srgb", A.ETC2RGB8A1Unorm = "etc2-rgb8a1unorm", A.ETC2RGB8A1UnormSRGB = "etc2-rgb8a1unorm-srgb", A.ETC2RGBA8Unorm = "etc2-rgba8unorm", A.ETC2RGBA8UnormSRGB = "etc2-rgba8unorm-srgb", A.EACR11Unorm = "eac-r11unorm", A.EACR11Snorm = "eac-r11snorm", A.EACRG11Unorm = "eac-rg11unorm", A.EACRG11Snorm = "eac-rg11snorm", A.ASTC4x4Unorm = "astc-4x4-unorm", A.ASTC4x4UnormSRGB = "astc-4x4-unorm-srgb", A.ASTC5x4Unorm = "astc-5x4-unorm", A.ASTC5x4UnormSRGB = "astc-5x4-unorm-srgb", A.ASTC5x5Unorm = "astc-5x5-unorm", A.ASTC5x5UnormSRGB = "astc-5x5-unorm-srgb", A.ASTC6x5Unorm = "astc-6x5-unorm", A.ASTC6x5UnormSRGB = "astc-6x5-unorm-srgb", A.ASTC6x6Unorm = "astc-6x6-unorm", A.ASTC6x6UnormSRGB = "astc-6x6-unorm-srgb", A.ASTC8x5Unorm = "astc-8x5-unorm", A.ASTC8x5UnormSRGB = "astc-8x5-unorm-srgb", A.ASTC8x6Unorm = "astc-8x6-unorm", A.ASTC8x6UnormSRGB = "astc-8x6-unorm-srgb", A.ASTC8x8Unorm = "astc-8x8-unorm", A.ASTC8x8UnormSRGB = "astc-8x8-unorm-srgb", A.ASTC10x5Unorm = "astc-10x5-unorm", A.ASTC10x5UnormSRGB = "astc-10x5-unorm-srgb", A.ASTC10x6Unorm = "astc-10x6-unorm", A.ASTC10x6UnormSRGB = "astc-10x6-unorm-srgb", A.ASTC10x8Unorm = "astc-10x8-unorm", A.ASTC10x8UnormSRGB = "astc-10x8-unorm-srgb", A.ASTC10x10Unorm = "astc-10x10-unorm", A.ASTC10x10UnormSRGB = "astc-10x10-unorm-srgb", A.ASTC12x10Unorm = "astc-12x10-unorm", A.ASTC12x10UnormSRGB = "astc-12x10-unorm-srgb", A.ASTC12x12Unorm = "astc-12x12-unorm", A.ASTC12x12UnormSRGB = "astc-12x12-unorm-srgb", A.Depth32FloatStencil8 = "depth32float-stencil8";
})(we || (we = {}));
var zw;
(function(A) {
  A.ClampToEdge = "clamp-to-edge", A.Repeat = "repeat", A.MirrorRepeat = "mirror-repeat";
})(zw || (zw = {}));
var Ji;
(function(A) {
  A.Nearest = "nearest", A.Linear = "linear";
})(Ji || (Ji = {}));
var oF;
(function(A) {
  A.Nearest = "nearest", A.Linear = "linear";
})(oF || (oF = {}));
var q6;
(function(A) {
  A.Never = "never", A.Less = "less", A.Equal = "equal", A.LessEqual = "less-equal", A.Greater = "greater", A.NotEqual = "not-equal", A.GreaterEqual = "greater-equal", A.Always = "always";
})(q6 || (q6 = {}));
var G8;
(function(A) {
  A[A.Vertex = 1] = "Vertex", A[A.Fragment = 2] = "Fragment", A[A.Compute = 4] = "Compute";
})(G8 || (G8 = {}));
var dq;
(function(A) {
  A.Uniform = "uniform", A.Storage = "storage", A.ReadOnlyStorage = "read-only-storage";
})(dq || (dq = {}));
var Xq;
(function(A) {
  A.Filtering = "filtering", A.NonFiltering = "non-filtering", A.Comparison = "comparison";
})(Xq || (Xq = {}));
var Ll;
(function(A) {
  A.Float = "float", A.UnfilterableFloat = "unfilterable-float", A.Depth = "depth", A.Sint = "sint", A.Uint = "uint";
})(Ll || (Ll = {}));
var eO;
(function(A) {
  A.WriteOnly = "write-only";
})(eO || (eO = {}));
var fF;
(function(A) {
  A.Error = "error", A.Warning = "warning", A.Info = "info";
})(fF || (fF = {}));
var AF;
(function(A) {
  A.Validation = "validation", A.Internal = "internal";
})(AF || (AF = {}));
var SS;
(function(A) {
  A.Auto = "auto";
})(SS || (SS = {}));
var Fl;
(function(A) {
  A.PointList = "point-list", A.LineList = "line-list", A.LineStrip = "line-strip", A.TriangleList = "triangle-list", A.TriangleStrip = "triangle-strip";
})(Fl || (Fl = {}));
var MI;
(function(A) {
  A.CCW = "ccw", A.CW = "cw";
})(MI || (MI = {}));
var eS;
(function(A) {
  A.None = "none", A.Front = "front", A.Back = "back";
})(eS || (eS = {}));
var dF;
(function(A) {
  A[A.Red = 1] = "Red", A[A.Green = 2] = "Green", A[A.Blue = 4] = "Blue", A[A.Alpha = 8] = "Alpha", A[A.All = 15] = "All";
})(dF || (dF = {}));
var ad;
(function(A) {
  A.Zero = "zero", A.One = "one", A.Src = "src", A.OneMinusSrc = "one-minus-src", A.SrcAlpha = "src-alpha", A.OneMinusSrcAlpha = "one-minus-src-alpha", A.Dst = "dst", A.OneMinusDst = "one-minus-dst", A.DstAlpha = "dst-alpha", A.OneMinusDstAlpha = "one-minus-dst-alpha", A.SrcAlphaSaturated = "src-alpha-saturated", A.Constant = "constant", A.OneMinusConstant = "one-minus-constant";
})(ad || (ad = {}));
var Z8;
(function(A) {
  A.Add = "add", A.Subtract = "subtract", A.ReverseSubtract = "reverse-subtract", A.Min = "min", A.Max = "max";
})(Z8 || (Z8 = {}));
var T0;
(function(A) {
  A.Keep = "keep", A.Zero = "zero", A.Replace = "replace", A.Invert = "invert", A.IncrementClamp = "increment-clamp", A.DecrementClamp = "decrement-clamp", A.IncrementWrap = "increment-wrap", A.DecrementWrap = "decrement-wrap";
})(T0 || (T0 = {}));
var Tq;
(function(A) {
  A.Uint16 = "uint16", A.Uint32 = "uint32";
})(Tq || (Tq = {}));
var jo;
(function(A) {
  A.Uint8x2 = "uint8x2", A.Uint8x4 = "uint8x4", A.Sint8x2 = "sint8x2", A.Sint8x4 = "sint8x4", A.Unorm8x2 = "unorm8x2", A.Unorm8x4 = "unorm8x4", A.Snorm8x2 = "snorm8x2", A.Snorm8x4 = "snorm8x4", A.Uint16x2 = "uint16x2", A.Uint16x4 = "uint16x4", A.Sint16x2 = "sint16x2", A.Sint16x4 = "sint16x4", A.Unorm16x2 = "unorm16x2", A.Unorm16x4 = "unorm16x4", A.Snorm16x2 = "snorm16x2", A.Snorm16x4 = "snorm16x4", A.Float16x2 = "float16x2", A.Float16x4 = "float16x4", A.Float32 = "float32", A.Float32x2 = "float32x2", A.Float32x3 = "float32x3", A.Float32x4 = "float32x4", A.Uint32 = "uint32", A.Uint32x2 = "uint32x2", A.Uint32x3 = "uint32x3", A.Uint32x4 = "uint32x4", A.Sint32 = "sint32", A.Sint32x2 = "sint32x2", A.Sint32x3 = "sint32x3", A.Sint32x4 = "sint32x4", A.UNORM10x10x10x2 = "unorm10-10-10-2";
})(jo || (jo = {}));
var LI;
(function(A) {
  A.Vertex = "vertex", A.Instance = "instance";
})(LI || (LI = {}));
var vF;
(function(A) {
  A.Beginning = "beginning", A.End = "end";
})(vF || (vF = {}));
var uF;
(function(A) {
  A.Beginning = "beginning", A.End = "end";
})(uF || (uF = {}));
var f9;
(function(A) {
  A.Load = "load", A.Clear = "clear";
})(f9 || (f9 = {}));
var Hc;
(function(A) {
  A.Store = "store", A.Discard = "discard";
})(Hc || (Hc = {}));
var KI;
(function(A) {
  A.Occlusion = "occlusion", A.Timestamp = "timestamp";
})(KI || (KI = {}));
var JI;
(function(A) {
  A.Opaque = "opaque", A.Premultiplied = "premultiplied";
})(JI || (JI = {}));
var lF;
(function(A) {
  A.Unknown = "unknown", A.Destroyed = "destroyed";
})(lF || (lF = {}));
var PF;
(function(A) {
  A.Validation = "validation", A.OutOfMemory = "out-of-memory", A.Internal = "internal";
})(PF || (PF = {}));
class Wo {
  constructor() {
    this.shaderLanguage = za.GLSL, this.vertexBufferKindToNumberOfComponents = {};
  }
  _addUniformToLeftOverUBO(e, t, r) {
    let n = 0;
    [e, t, n] = this._getArraySize(e, t, r);
    for (let i = 0; i < this._webgpuProcessingContext.leftOverUniforms.length; i++)
      if (this._webgpuProcessingContext.leftOverUniforms[i].name === e)
        return;
    this._webgpuProcessingContext.leftOverUniforms.push({
      name: e,
      type: t,
      length: n
    });
  }
  _buildLeftOverUBO() {
    if (!this._webgpuProcessingContext.leftOverUniforms.length)
      return "";
    const e = Wo.LeftOvertUBOName;
    let t = this._webgpuProcessingContext.availableBuffers[e];
    return t || (t = {
      binding: this._webgpuProcessingContext.getNextFreeUBOBinding()
    }, this._webgpuProcessingContext.availableBuffers[e] = t, this._addBufferBindingDescription(e, t, dq.Uniform, !0), this._addBufferBindingDescription(e, t, dq.Uniform, !1)), this._generateLeftOverUBOCode(e, t);
  }
  _collectBindingNames() {
    for (let e = 0; e < this._webgpuProcessingContext.bindGroupLayoutEntries.length; e++) {
      const t = this._webgpuProcessingContext.bindGroupLayoutEntries[e];
      if (t === void 0) {
        this._webgpuProcessingContext.bindGroupLayoutEntries[e] = [];
        continue;
      }
      for (let r = 0; r < t.length; r++) {
        const n = this._webgpuProcessingContext.bindGroupLayoutEntries[e][r], i = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[e][n.binding].name, s = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[e][n.binding].nameInArrayOfTexture;
        n && (n.texture || n.externalTexture || n.storageTexture ? this._webgpuProcessingContext.textureNames.push(s) : n.sampler ? this._webgpuProcessingContext.samplerNames.push(i) : n.buffer && this._webgpuProcessingContext.bufferNames.push(i));
      }
    }
  }
  _preCreateBindGroupEntries() {
    const e = this._webgpuProcessingContext.bindGroupEntries;
    for (let t = 0; t < this._webgpuProcessingContext.bindGroupLayoutEntries.length; t++) {
      const r = this._webgpuProcessingContext.bindGroupLayoutEntries[t], n = [];
      for (let i = 0; i < r.length; i++) {
        const s = this._webgpuProcessingContext.bindGroupLayoutEntries[t][i];
        s.sampler || s.texture || s.storageTexture || s.externalTexture ? n.push({
          binding: s.binding,
          resource: void 0
        }) : s.buffer && n.push({
          binding: s.binding,
          resource: {
            buffer: void 0,
            offset: 0,
            size: 0
          }
        });
      }
      e[t] = n;
    }
  }
  _addTextureBindingDescription(e, t, r, n, i, s) {
    let { groupIndex: a, bindingIndex: f } = t.textures[r];
    if (this._webgpuProcessingContext.bindGroupLayoutEntries[a] || (this._webgpuProcessingContext.bindGroupLayoutEntries[a] = [], this._webgpuProcessingContext.bindGroupLayoutEntryInfo[a] = []), !this._webgpuProcessingContext.bindGroupLayoutEntryInfo[a][f]) {
      let o;
      n === null ? o = this._webgpuProcessingContext.bindGroupLayoutEntries[a].push({
        binding: f,
        visibility: 0,
        externalTexture: {}
      }) : i ? o = this._webgpuProcessingContext.bindGroupLayoutEntries[a].push({
        binding: f,
        visibility: 0,
        storageTexture: {
          access: eO.WriteOnly,
          format: i,
          viewDimension: n
        }
      }) : o = this._webgpuProcessingContext.bindGroupLayoutEntries[a].push({
        binding: f,
        visibility: 0,
        texture: {
          sampleType: t.sampleType,
          viewDimension: n,
          multisampled: !1
        }
      });
      const d = t.isTextureArray ? e + r : e;
      this._webgpuProcessingContext.bindGroupLayoutEntryInfo[a][f] = { name: e, index: o - 1, nameInArrayOfTexture: d };
    }
    f = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[a][f].index, s ? this._webgpuProcessingContext.bindGroupLayoutEntries[a][f].visibility |= G8.Vertex : this._webgpuProcessingContext.bindGroupLayoutEntries[a][f].visibility |= G8.Fragment;
  }
  _addSamplerBindingDescription(e, t, r) {
    let { groupIndex: n, bindingIndex: i } = t.binding;
    if (this._webgpuProcessingContext.bindGroupLayoutEntries[n] || (this._webgpuProcessingContext.bindGroupLayoutEntries[n] = [], this._webgpuProcessingContext.bindGroupLayoutEntryInfo[n] = []), !this._webgpuProcessingContext.bindGroupLayoutEntryInfo[n][i]) {
      const s = this._webgpuProcessingContext.bindGroupLayoutEntries[n].push({
        binding: i,
        visibility: 0,
        sampler: {
          type: t.type
        }
      });
      this._webgpuProcessingContext.bindGroupLayoutEntryInfo[n][i] = { name: e, index: s - 1 };
    }
    i = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[n][i].index, r ? this._webgpuProcessingContext.bindGroupLayoutEntries[n][i].visibility |= G8.Vertex : this._webgpuProcessingContext.bindGroupLayoutEntries[n][i].visibility |= G8.Fragment;
  }
  _addBufferBindingDescription(e, t, r, n) {
    let { groupIndex: i, bindingIndex: s } = t.binding;
    if (this._webgpuProcessingContext.bindGroupLayoutEntries[i] || (this._webgpuProcessingContext.bindGroupLayoutEntries[i] = [], this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i] = []), !this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][s]) {
      const a = this._webgpuProcessingContext.bindGroupLayoutEntries[i].push({
        binding: s,
        visibility: 0,
        buffer: {
          type: r
        }
      });
      this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][s] = { name: e, index: a - 1 };
    }
    s = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][s].index, n ? this._webgpuProcessingContext.bindGroupLayoutEntries[i][s].visibility |= G8.Vertex : this._webgpuProcessingContext.bindGroupLayoutEntries[i][s].visibility |= G8.Fragment;
  }
  _injectStartingAndEndingCode(e, t, r, n) {
    let i = e.indexOf(t);
    if (i < 0)
      return console.error('No "main" function found in shader code! Processing aborted.'), e;
    if (r) {
      for (; i++ < e.length && e.charAt(i) != "{"; )
        ;
      if (i < e.length) {
        const s = e.substring(0, i + 1), a = e.substring(i + 1);
        e = s + r + a;
      }
    }
    if (n) {
      const s = e.lastIndexOf("}");
      e = e.substring(0, s), e += n + `
}`;
    }
    return e;
  }
}
Wo.AutoSamplerSuffix = "Sampler";
Wo.LeftOvertUBOName = "LeftOver";
Wo.InternalsUBOName = "Internals";
Wo.UniformSizes = {
  // GLSL types
  bool: 1,
  int: 1,
  float: 1,
  vec2: 2,
  ivec2: 2,
  uvec2: 2,
  vec3: 3,
  ivec3: 3,
  uvec3: 3,
  vec4: 4,
  ivec4: 4,
  uvec4: 4,
  mat2: 4,
  mat3: 12,
  mat4: 16,
  // WGSL types
  i32: 1,
  u32: 1,
  f32: 1,
  mat2x2: 4,
  mat3x3: 12,
  mat4x4: 16
};
Wo._SamplerFunctionByWebGLSamplerType = {
  sampler2D: "sampler2D",
  sampler2DArray: "sampler2DArray",
  sampler2DShadow: "sampler2DShadow",
  sampler2DArrayShadow: "sampler2DArrayShadow",
  samplerCube: "samplerCube",
  sampler3D: "sampler3D"
};
Wo._TextureTypeByWebGLSamplerType = {
  sampler2D: "texture2D",
  sampler2DArray: "texture2DArray",
  sampler2DShadow: "texture2D",
  sampler2DArrayShadow: "texture2DArray",
  samplerCube: "textureCube",
  samplerCubeArray: "textureCubeArray",
  sampler3D: "texture3D"
};
Wo._GpuTextureViewDimensionByWebGPUTextureType = {
  textureCube: Da.Cube,
  textureCubeArray: Da.CubeArray,
  texture2D: Da.E2d,
  texture2DArray: Da.E2dArray,
  texture3D: Da.E3d
};
Wo._SamplerTypeByWebGLSamplerType = {
  sampler2DShadow: "samplerShadow",
  sampler2DArrayShadow: "samplerShadow"
};
Wo._IsComparisonSamplerByWebGPUSamplerType = {
  samplerShadow: !0,
  samplerArrayShadow: !0,
  sampler: !1
};
class Bue {
  get isAsync() {
    return !1;
  }
  get isReady() {
    return !!this.stages;
  }
  constructor(e, t) {
    this.bindGroupLayouts = {}, this._name = "unnamed", this.shaderProcessingContext = e, this._leftOverUniformsByName = {}, this.engine = t, this.vertexBufferKindToType = {};
  }
  _handlesSpectorRebuildCallback() {
  }
  _fillEffectInformation(e, t, r, n, i, s, a, f) {
    const o = this.engine;
    e._fragmentSourceCode = "", e._vertexSourceCode = "";
    const d = this.shaderProcessingContext.availableTextures;
    let v;
    for (v = 0; v < i.length; v++) {
      const P = i[v], p = d[i[v]];
      p == null || p == null ? (i.splice(v, 1), v--) : s[P] = v;
    }
    for (const P of o.getAttributes(this, a))
      f.push(P);
    this.buildUniformLayout();
    const u = [], l = [];
    for (v = 0; v < a.length; v++) {
      const P = f[v];
      P >= 0 && (u.push(a[v]), l.push(P));
    }
    this.shaderProcessingContext.attributeNamesFromEffect = u, this.shaderProcessingContext.attributeLocationsFromEffect = l;
  }
  /** @internal */
  /**
   * Build the uniform buffer used in the material.
   */
  buildUniformLayout() {
    if (this.shaderProcessingContext.leftOverUniforms.length) {
      this.uniformBuffer = new yr(this.engine, void 0, void 0, "leftOver-" + this._name);
      for (const e of this.shaderProcessingContext.leftOverUniforms) {
        const t = e.type.replace(/^(.*?)(<.*>)?$/, "$1"), r = Wo.UniformSizes[t];
        this.uniformBuffer.addUniform(e.name, r, e.length), this._leftOverUniformsByName[e.name] = e.type;
      }
      this.uniformBuffer.create();
    }
  }
  /**
   * Release all associated resources.
   **/
  dispose() {
    this.uniformBuffer && this.uniformBuffer.dispose();
  }
  /**
   * Sets an integer value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value Value to be set.
   */
  setInt(e, t) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateInt(e, t);
  }
  /**
   * Sets an int2 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int2.
   * @param y Second int in int2.
   */
  setInt2(e, t, r) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateInt2(e, t, r);
  }
  /**
   * Sets an int3 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int3.
   * @param y Second int in int3.
   * @param z Third int in int3.
   */
  setInt3(e, t, r, n) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateInt3(e, t, r, n);
  }
  /**
   * Sets an int4 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First int in int4.
   * @param y Second int in int4.
   * @param z Third int in int4.
   * @param w Fourth int in int4.
   */
  setInt4(e, t, r, n, i) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateInt4(e, t, r, n, i);
  }
  /**
   * Sets an int array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray(e, t) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateIntArray(e, t);
  }
  /**
   * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray2(e, t) {
    this.setIntArray(e, t);
  }
  /**
   * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray3(e, t) {
    this.setIntArray(e, t);
  }
  /**
   * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setIntArray4(e, t) {
    this.setIntArray(e, t);
  }
  /**
   * Sets an unsigned integer value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value Value to be set.
   */
  setUInt(e, t) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateUInt(e, t);
  }
  /**
   * Sets an unsigned int2 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint2.
   * @param y Second unsigned int in uint2.
   */
  setUInt2(e, t, r) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateUInt2(e, t, r);
  }
  /**
   * Sets an unsigned int3 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint3.
   * @param y Second unsigned int in uint3.
   * @param z Third unsigned int in uint3.
   */
  setUInt3(e, t, r, n) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateUInt3(e, t, r, n);
  }
  /**
   * Sets an unsigned int4 value on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First unsigned int in uint4.
   * @param y Second unsigned int in uint4.
   * @param z Third unsigned int in uint4.
   * @param w Fourth unsigned int in uint4.
   */
  setUInt4(e, t, r, n, i) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateUInt4(e, t, r, n, i);
  }
  /**
   * Sets an unsigned int array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray(e, t) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateUIntArray(e, t);
  }
  /**
   * Sets an unsigned int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray2(e, t) {
    this.setUIntArray(e, t);
  }
  /**
   * Sets an unsigned int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray3(e, t) {
    this.setUIntArray(e, t);
  }
  /**
   * Sets an unsigned int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setUIntArray4(e, t) {
    this.setUIntArray(e, t);
  }
  /**
   * Sets an array on a uniform variable.
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setArray(e, t) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateArray(e, t);
  }
  /**
   * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setArray2(e, t) {
    this.setArray(e, t);
  }
  /**
   * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   * @returns this effect.
   */
  setArray3(e, t) {
    this.setArray(e, t);
  }
  /**
   * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
   * @param uniformName Name of the variable.
   * @param array array to be set.
   */
  setArray4(e, t) {
    this.setArray(e, t);
  }
  /**
   * Sets matrices on a uniform variable.
   * @param uniformName Name of the variable.
   * @param matrices matrices to be set.
   */
  setMatrices(e, t) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateMatrices(e, t);
  }
  /**
   * Sets matrix on a uniform variable.
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   */
  setMatrix(e, t) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateMatrix(e, t);
  }
  /**
   * Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   */
  setMatrix3x3(e, t) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateMatrix3x3(e, t);
  }
  /**
   * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
   * @param uniformName Name of the variable.
   * @param matrix matrix to be set.
   */
  setMatrix2x2(e, t) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateMatrix2x2(e, t);
  }
  /**
   * Sets a float on a uniform variable.
   * @param uniformName Name of the variable.
   * @param value value to be set.
   * @returns this effect.
   */
  setFloat(e, t) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateFloat(e, t);
  }
  /**
   * Sets a Vector2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector2 vector2 to be set.
   */
  setVector2(e, t) {
    this.setFloat2(e, t.x, t.y);
  }
  /**
   * Sets a float2 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float2.
   * @param y Second float in float2.
   */
  setFloat2(e, t, r) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateFloat2(e, t, r);
  }
  /**
   * Sets a Vector3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector3 Value to be set.
   */
  setVector3(e, t) {
    this.setFloat3(e, t.x, t.y, t.z);
  }
  /**
   * Sets a float3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float3.
   * @param y Second float in float3.
   * @param z Third float in float3.
   */
  setFloat3(e, t, r, n) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateFloat3(e, t, r, n);
  }
  /**
   * Sets a Vector4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param vector4 Value to be set.
   */
  setVector4(e, t) {
    this.setFloat4(e, t.x, t.y, t.z, t.w);
  }
  /**
   * Sets a Quaternion on a uniform variable.
   * @param uniformName Name of the variable.
   * @param quaternion Value to be set.
   */
  setQuaternion(e, t) {
    this.setFloat4(e, t.x, t.y, t.z, t.w);
  }
  /**
   * Sets a float4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param x First float in float4.
   * @param y Second float in float4.
   * @param z Third float in float4.
   * @param w Fourth float in float4.
   * @returns this effect.
   */
  setFloat4(e, t, r, n, i) {
    !this.uniformBuffer || !this._leftOverUniformsByName[e] || this.uniformBuffer.updateFloat4(e, t, r, n, i);
  }
  /**
   * Sets a Color3 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param color3 Value to be set.
   */
  setColor3(e, t) {
    this.setFloat3(e, t.r, t.g, t.b);
  }
  /**
   * Sets a Color4 on a uniform variable.
   * @param uniformName Name of the variable.
   * @param color3 Value to be set.
   * @param alpha Alpha value to be set.
   */
  setColor4(e, t, r) {
    this.setFloat4(e, t.r, t.g, t.b, r);
  }
  /**
   * Sets a Color4 on a uniform variable
   * @param uniformName defines the name of the variable
   * @param color4 defines the value to be set
   */
  setDirectColor4(e, t) {
    this.setFloat4(e, t.r, t.g, t.b, t.a);
  }
  _getVertexShaderCode() {
    var e;
    return (e = this.sources) === null || e === void 0 ? void 0 : e.vertex;
  }
  _getFragmentShaderCode() {
    var e;
    return (e = this.sources) === null || e === void 0 ? void 0 : e.fragment;
  }
}
const Wue = 4, Sue = 65536, qG = {
  // GLSL types
  mat2: 2,
  mat3: 3,
  mat4: 4,
  // WGSL types
  mat2x2: 2,
  mat3x3: 3,
  mat4x4: 4
};
class gp {
  static get KnownUBOs() {
    return gp._SimplifiedKnownBindings ? gp._SimplifiedKnownUBOs : gp._KnownUBOs;
  }
  constructor(e) {
    this.shaderLanguage = e, this._attributeNextLocation = 0, this._varyingNextLocation = 0, this.freeGroupIndex = 0, this.freeBindingIndex = 0, this.availableVaryings = {}, this.availableAttributes = {}, this.availableBuffers = {}, this.availableTextures = {}, this.availableSamplers = {}, this.orderedAttributes = [], this.bindGroupLayoutEntries = [], this.bindGroupLayoutEntryInfo = [], this.bindGroupEntries = [], this.bufferNames = [], this.textureNames = [], this.samplerNames = [], this.leftOverUniforms = [], this._findStartingGroupBinding();
  }
  _findStartingGroupBinding() {
    const e = gp.KnownUBOs, t = [];
    for (const r in e) {
      const n = e[r].binding;
      n.groupIndex !== -1 && (t[n.groupIndex] === void 0 ? t[n.groupIndex] = n.bindingIndex : t[n.groupIndex] = Math.max(t[n.groupIndex], n.bindingIndex));
    }
    this.freeGroupIndex = t.length - 1, this.freeGroupIndex === 0 ? (this.freeGroupIndex++, this.freeBindingIndex = 0) : this.freeBindingIndex = t[t.length - 1] + 1;
  }
  getAttributeNextLocation(e, t = 0) {
    var r;
    const n = this._attributeNextLocation;
    return this._attributeNextLocation += ((r = qG[e]) !== null && r !== void 0 ? r : 1) * (t || 1), n;
  }
  getVaryingNextLocation(e, t = 0) {
    var r;
    const n = this._varyingNextLocation;
    return this._varyingNextLocation += ((r = qG[e]) !== null && r !== void 0 ? r : 1) * (t || 1), n;
  }
  getNextFreeUBOBinding() {
    return this._getNextFreeBinding(1);
  }
  _getNextFreeBinding(e) {
    if (this.freeBindingIndex > Sue - e && (this.freeGroupIndex++, this.freeBindingIndex = 0), this.freeGroupIndex === Wue)
      throw "Too many textures or UBOs have been declared and it is not supported in WebGPU.";
    const t = {
      groupIndex: this.freeGroupIndex,
      bindingIndex: this.freeBindingIndex
    };
    return this.freeBindingIndex += e, t;
  }
}
gp._SimplifiedKnownBindings = !0;
gp._SimplifiedKnownUBOs = {
  Scene: { binding: { groupIndex: 0, bindingIndex: 0 } },
  Light0: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light1: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light2: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light3: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light4: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light5: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light6: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light7: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light8: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light9: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light10: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light11: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light12: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light13: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light14: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light15: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light16: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light17: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light18: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light19: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light20: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light21: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light22: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light23: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light24: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light25: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light26: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light27: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light28: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light29: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light30: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Light31: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Material: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Mesh: { binding: { groupIndex: -1, bindingIndex: -1 } },
  Internals: { binding: { groupIndex: -1, bindingIndex: -1 } }
};
gp._KnownUBOs = {
  Scene: { binding: { groupIndex: 0, bindingIndex: 0 } },
  Light0: { binding: { groupIndex: 1, bindingIndex: 0 } },
  Light1: { binding: { groupIndex: 1, bindingIndex: 1 } },
  Light2: { binding: { groupIndex: 1, bindingIndex: 2 } },
  Light3: { binding: { groupIndex: 1, bindingIndex: 3 } },
  Light4: { binding: { groupIndex: 1, bindingIndex: 4 } },
  Light5: { binding: { groupIndex: 1, bindingIndex: 5 } },
  Light6: { binding: { groupIndex: 1, bindingIndex: 6 } },
  Light7: { binding: { groupIndex: 1, bindingIndex: 7 } },
  Light8: { binding: { groupIndex: 1, bindingIndex: 8 } },
  Light9: { binding: { groupIndex: 1, bindingIndex: 9 } },
  Light10: { binding: { groupIndex: 1, bindingIndex: 10 } },
  Light11: { binding: { groupIndex: 1, bindingIndex: 11 } },
  Light12: { binding: { groupIndex: 1, bindingIndex: 12 } },
  Light13: { binding: { groupIndex: 1, bindingIndex: 13 } },
  Light14: { binding: { groupIndex: 1, bindingIndex: 14 } },
  Light15: { binding: { groupIndex: 1, bindingIndex: 15 } },
  Light16: { binding: { groupIndex: 1, bindingIndex: 16 } },
  Light17: { binding: { groupIndex: 1, bindingIndex: 17 } },
  Light18: { binding: { groupIndex: 1, bindingIndex: 18 } },
  Light19: { binding: { groupIndex: 1, bindingIndex: 19 } },
  Light20: { binding: { groupIndex: 1, bindingIndex: 20 } },
  Light21: { binding: { groupIndex: 1, bindingIndex: 21 } },
  Light22: { binding: { groupIndex: 1, bindingIndex: 22 } },
  Light23: { binding: { groupIndex: 1, bindingIndex: 23 } },
  Light24: { binding: { groupIndex: 1, bindingIndex: 24 } },
  Light25: { binding: { groupIndex: 1, bindingIndex: 25 } },
  Light26: { binding: { groupIndex: 1, bindingIndex: 26 } },
  Light27: { binding: { groupIndex: 1, bindingIndex: 27 } },
  Light28: { binding: { groupIndex: 1, bindingIndex: 28 } },
  Light29: { binding: { groupIndex: 1, bindingIndex: 29 } },
  Light30: { binding: { groupIndex: 1, bindingIndex: 30 } },
  Light31: { binding: { groupIndex: 1, bindingIndex: 31 } },
  Material: { binding: { groupIndex: 2, bindingIndex: 0 } },
  Mesh: { binding: { groupIndex: 2, bindingIndex: 1 } },
  Internals: { binding: { groupIndex: 2, bindingIndex: 2 } }
};
class Uue extends Wo {
  constructor() {
    super(...arguments), this._missingVaryings = [], this._textureArrayProcessing = [], this._vertexIsGLES3 = !1, this._fragmentIsGLES3 = !1, this.shaderLanguage = za.GLSL, this.parseGLES3 = !0;
  }
  _getArraySize(e, t, r) {
    let n = 0;
    const i = e.indexOf("["), s = e.indexOf("]");
    if (i > 0 && s > 0) {
      const a = e.substring(i + 1, s);
      n = +a, isNaN(n) && (n = +r[a.trim()]), e = e.substr(0, i);
    }
    return [e, t, n];
  }
  initializeShaders(e) {
    this._webgpuProcessingContext = e, this._missingVaryings.length = 0, this._textureArrayProcessing.length = 0, this.attributeKeywordName = void 0, this.varyingVertexKeywordName = void 0, this.varyingFragmentKeywordName = void 0;
  }
  preProcessShaderCode(e, t) {
    const r = `// Internals UBO
uniform ${Wo.InternalsUBOName} {
float yFactor_;
float textureOutputHeight_;
};
`, n = e.indexOf("// Internals UBO") !== -1;
    return t ? (this._fragmentIsGLES3 = e.indexOf("#version 3") !== -1, this._fragmentIsGLES3 && (this.varyingFragmentKeywordName = "in"), n ? e : r + `##INJECTCODE##
` + e) : (this._vertexIsGLES3 = e.indexOf("#version 3") !== -1, this._vertexIsGLES3 && (this.attributeKeywordName = "in", this.varyingVertexKeywordName = "out"), n ? e : r + e);
  }
  varyingCheck(e, t) {
    const r = /(flat\s)?\s*\bout\b/, n = /(flat\s)?\s*\bin\b/, i = /(flat\s)?\s*\bvarying\b/;
    return (t && this._fragmentIsGLES3 ? n : !t && this._vertexIsGLES3 ? r : i).test(e);
  }
  varyingProcessor(e, t, r) {
    var n;
    this._preProcessors = r;
    const i = /\s*(flat)?\s*out\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm, s = /\s*(flat)?\s*in\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm, a = /\s*(flat)?\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm, o = (t && this._fragmentIsGLES3 ? s : !t && this._vertexIsGLES3 ? i : a).exec(e);
    if (o !== null) {
      const d = (n = o[1]) !== null && n !== void 0 ? n : "", v = o[2], u = o[3];
      let l;
      t ? (l = this._webgpuProcessingContext.availableVaryings[u], this._missingVaryings[l] = "", l === void 0 && Se.Warn(`Invalid fragment shader: The varying named "${u}" is not declared in the vertex shader! This declaration will be ignored.`)) : (l = this._webgpuProcessingContext.getVaryingNextLocation(v, this._getArraySize(u, v, r)[2]), this._webgpuProcessingContext.availableVaryings[u] = l, this._missingVaryings[l] = `layout(location = ${l}) ${d} in ${v} ${u};`), e = e.replace(o[0], l === void 0 ? "" : `layout(location = ${l}) ${d} ${t ? "in" : "out"} ${v} ${u};`);
    }
    return e;
  }
  attributeProcessor(e, t) {
    this._preProcessors = t;
    const r = /\s*in\s+(\S+)\s+(\S+)\s*;/gm, n = /\s*attribute\s+(\S+)\s+(\S+)\s*;/gm, s = (this._vertexIsGLES3 ? r : n).exec(e);
    if (s !== null) {
      const a = s[1], f = s[2], o = this._webgpuProcessingContext.getAttributeNextLocation(a, this._getArraySize(f, a, t)[2]);
      this._webgpuProcessingContext.availableAttributes[f] = o, this._webgpuProcessingContext.orderedAttributes[o] = f;
      const d = this.vertexBufferKindToNumberOfComponents[f];
      if (d !== void 0) {
        const v = d < 0 ? d === -1 ? "int" : "ivec" + -d : d === 1 ? "uint" : "uvec" + d, u = `_int_${f}_`;
        e = e.replace(s[0], `layout(location = ${o}) in ${v} ${u}; ${a} ${f} = ${a}(${u});`);
      } else
        e = e.replace(s[0], `layout(location = ${o}) in ${a} ${f};`);
    }
    return e;
  }
  uniformProcessor(e, t, r) {
    var n;
    this._preProcessors = r;
    const s = /\s*uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm.exec(e);
    if (s !== null) {
      let a = s[1], f = s[2];
      if (a.indexOf("sampler") === 0 || a.indexOf("sampler") === 1) {
        let o = 0;
        [f, a, o] = this._getArraySize(f, a, r);
        let d = this._webgpuProcessingContext.availableTextures[f];
        if (!d) {
          d = {
            autoBindSampler: !0,
            isTextureArray: o > 0,
            isStorageTexture: !1,
            textures: [],
            sampleType: Ll.Float
          };
          for (let I = 0; I < (o || 1); ++I)
            d.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding());
        }
        const v = (n = Wo._SamplerTypeByWebGLSamplerType[a]) !== null && n !== void 0 ? n : "sampler", u = !!Wo._IsComparisonSamplerByWebGPUSamplerType[v], l = u ? Xq.Comparison : Xq.Filtering, P = f + Wo.AutoSamplerSuffix;
        let p = this._webgpuProcessingContext.availableSamplers[P];
        p || (p = {
          binding: this._webgpuProcessingContext.getNextFreeUBOBinding(),
          type: l
        });
        const c = a.charAt(0) === "u" ? "u" : a.charAt(0) === "i" ? "i" : "";
        c && (a = a.substr(1));
        const H = u ? Ll.Depth : c === "u" ? Ll.Uint : c === "i" ? Ll.Sint : Ll.Float;
        d.sampleType = H;
        const T = o > 0, q = p.binding.groupIndex, b = p.binding.bindingIndex, j = Wo._SamplerFunctionByWebGLSamplerType[a], w = Wo._TextureTypeByWebGLSamplerType[a], m = Wo._GpuTextureViewDimensionByWebGPUTextureType[w];
        if (!T)
          o = 1, e = `layout(set = ${q}, binding = ${b}) uniform ${v} ${P};
                        layout(set = ${d.textures[0].groupIndex}, binding = ${d.textures[0].bindingIndex}) uniform ${c}${w} ${f}Texture;
                        #define ${f} ${c}${j}(${f}Texture, ${P})`;
        else {
          const I = [];
          I.push(`layout(set = ${q}, binding = ${b}) uniform ${c}${v} ${P};`), e = `
`;
          for (let N = 0; N < o; ++N) {
            const k = d.textures[N].groupIndex, R = d.textures[N].bindingIndex;
            I.push(`layout(set = ${k}, binding = ${R}) uniform ${w} ${f}Texture${N};`), e += `${N > 0 ? `
` : ""}#define ${f}${N} ${c}${j}(${f}Texture${N}, ${P})`;
          }
          e = I.join(`
`) + e, this._textureArrayProcessing.push(f);
        }
        this._webgpuProcessingContext.availableTextures[f] = d, this._webgpuProcessingContext.availableSamplers[P] = p, this._addSamplerBindingDescription(P, p, !t);
        for (let I = 0; I < o; ++I)
          this._addTextureBindingDescription(f, d, I, m, null, !t);
      } else
        this._addUniformToLeftOverUBO(f, a, r), e = "";
    }
    return e;
  }
  uniformBufferProcessor(e, t) {
    const n = /uniform\s+(\w+)/gm.exec(e);
    if (n !== null) {
      const i = n[1];
      let s = this._webgpuProcessingContext.availableBuffers[i];
      if (!s) {
        const a = gp.KnownUBOs[i];
        let f;
        a && a.binding.groupIndex !== -1 ? f = a.binding : f = this._webgpuProcessingContext.getNextFreeUBOBinding(), s = { binding: f }, this._webgpuProcessingContext.availableBuffers[i] = s;
      }
      this._addBufferBindingDescription(i, s, dq.Uniform, !t), e = e.replace("uniform", `layout(set = ${s.binding.groupIndex}, binding = ${s.binding.bindingIndex}) uniform`);
    }
    return e;
  }
  postProcessor(e, t, r, n, i) {
    const s = e.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1, a = /#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;
    if (e = e.replace(a, ""), e = e.replace(/texture2D\s*\(/g, "texture("), r) {
      const f = e.indexOf("gl_FragCoord") >= 0, o = `
                glFragCoord_ = gl_FragCoord;
                if (yFactor_ == 1.) {
                    glFragCoord_.y = textureOutputHeight_ - glFragCoord_.y;
                }
            `, d = f ? `vec4 glFragCoord_;
` : "", v = e.search(/layout *\(location *= *0\) *out/g) !== -1;
      if (e = e.replace(/texture2DLodEXT\s*\(/g, "textureLod("), e = e.replace(/textureCubeLodEXT\s*\(/g, "textureLod("), e = e.replace(/textureCube\s*\(/g, "texture("), e = e.replace(/gl_FragDepthEXT/g, "gl_FragDepth"), e = e.replace(/gl_FragColor/g, "glFragColor"), e = e.replace(/gl_FragData/g, "glFragData"), e = e.replace(/gl_FragCoord/g, "glFragCoord_"), !this._fragmentIsGLES3)
        e = e.replace(/void\s+?main\s*\(/g, (s || v ? "" : `layout(location = 0) out vec4 glFragColor;
`) + "void main(");
      else {
        const u = /^\s*out\s+\S+\s+\S+\s*;/gm.exec(e);
        u !== null && (e = e.substring(0, u.index) + "layout(location = 0) " + e.substring(u.index));
      }
      e = e.replace(/dFdy/g, "(-yFactor_)*dFdy"), e = e.replace("##INJECTCODE##", d), f && (e = this._injectStartingAndEndingCode(e, "void main", o));
    } else if (e = e.replace(/gl_InstanceID/g, "gl_InstanceIndex"), e = e.replace(/gl_VertexID/g, "gl_VertexIndex"), t.indexOf("#define MULTIVIEW") !== -1)
      return `#extension GL_OVR_multiview2 : require
layout (num_views = 2) in;
` + e;
    if (!r) {
      const f = e.lastIndexOf("}");
      e = e.substring(0, f), e += `gl_Position.y *= yFactor_;
`, i.isNDCHalfZRange || (e += `gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0;
`), e += "}";
    }
    return e;
  }
  _applyTextureArrayProcessing(e, t) {
    const r = new RegExp(t + "\\s*\\[(.+)?\\]", "gm");
    let n = r.exec(e);
    for (; n !== null; ) {
      const i = n[1];
      let s = +i;
      this._preProcessors && isNaN(s) && (s = +this._preProcessors[i.trim()]), e = e.replace(n[0], t + s), n = r.exec(e);
    }
    return e;
  }
  _generateLeftOverUBOCode(e, t) {
    let r = `layout(set = ${t.binding.groupIndex}, binding = ${t.binding.bindingIndex}) uniform ${e} {
    `;
    for (const n of this._webgpuProcessingContext.leftOverUniforms)
      n.length > 0 ? r += `    ${n.type} ${n.name}[${n.length}];
` : r += `    ${n.type} ${n.name};
`;
    return r += `};

`, r;
  }
  finalizeShaders(e, t) {
    for (let n = 0; n < this._textureArrayProcessing.length; ++n) {
      const i = this._textureArrayProcessing[n];
      e = this._applyTextureArrayProcessing(e, i), t = this._applyTextureArrayProcessing(t, i);
    }
    for (let n = 0; n < this._missingVaryings.length; ++n) {
      const i = this._missingVaryings[n];
      i && i.length > 0 && (t = i + `
` + t);
    }
    const r = this._buildLeftOverUBO();
    return e = r + e, t = r + t, this._collectBindingNames(), this._preCreateBindGroupEntries(), this._preProcessors = null, this.vertexBufferKindToNumberOfComponents = {}, { vertexCode: e, fragmentCode: t };
  }
}
const Iue = "bonesDeclaration", Rue = `#if NUM_BONE_INFLUENCERS>0
attribute matricesIndices : vec4<f32>;attribute matricesWeights : vec4<f32>;
#if NUM_BONE_INFLUENCERS>4
attribute matricesIndicesExtra : vec4<f32>;attribute matricesWeightsExtra : vec4<f32>;
#endif
#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#ifdef BONETEXTURE
var boneSampler : texture_2d<f32>;uniform boneTextureWidth : f32;
#else
uniform mBones : array<mat4x4,BonesPerMesh>;
#ifdef BONES_VELOCITY_ENABLED
uniform mPreviousBones : array<mat4x4,BonesPerMesh>;
#endif
#endif
#ifdef BONETEXTURE
fn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4<f32>
{let offset=i32(index) *4; 
let m0=textureLoad(smp,vec2<i32>(offset+0,0),0);let m1=textureLoad(smp,vec2<i32>(offset+1,0),0);let m2=textureLoad(smp,vec2<i32>(offset+2,0),0);let m3=textureLoad(smp,vec2<i32>(offset+3,0),0);return mat4x4<f32>(m0,m1,m2,m3);}
#endif
#endif
#endif
`;
Le.IncludesShadersStoreWGSL[Iue] = Rue;
const Vue = "bonesVertex", Cue = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#if NUM_BONE_INFLUENCERS>0
var influence : mat4x4<f32>;
#ifdef BONETEXTURE
influence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];
#endif 
#if NUM_BONE_INFLUENCERS>4
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];
#endif 
#if NUM_BONE_INFLUENCERS>5
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];
#endif 
#if NUM_BONE_INFLUENCERS>6
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];
#endif 
#if NUM_BONE_INFLUENCERS>7
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];
#endif 
#else 
influence=uniforms.mBones[int(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];
#endif 
#if NUM_BONE_INFLUENCERS>4
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];
#endif 
#if NUM_BONE_INFLUENCERS>5
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];
#endif 
#if NUM_BONE_INFLUENCERS>6
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];
#endif 
#if NUM_BONE_INFLUENCERS>7
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];
#endif 
#endif
finalWorld=finalWorld*influence;
#endif
#endif
`;
Le.IncludesShadersStoreWGSL[Vue] = Cue;
const Oue = "bakedVertexAnimationDeclaration", yue = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
uniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationTextureSizeInverted: vec2<f32>;uniform bakedVertexAnimationSettings: vec4<f32>;var bakedVertexAnimationTexture : texture_2d<f32>;
#ifdef INSTANCES
attribute bakedVertexAnimationSettingsInstanced : vec4<f32>;
#endif
fn readMatrixFromRawSamplerVAT(smp : texture_2d<f32>,index : f32,frame : f32)->mat4x4<f32>
{let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2<i32>(offset+0,frameUV),0);let m1=textureLoad(smp,vec2<i32>(offset+1,frameUV),0);let m2=textureLoad(smp,vec2<i32>(offset+2,frameUV),0);let m3=textureLoad(smp,vec2<i32>(offset+3,frameUV),0);return mat4x4<f32>(m0,m1,m2,m3);}
#endif
`;
Le.IncludesShadersStoreWGSL[Oue] = yue;
const kue = "bakedVertexAnimation", Eue = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
{
#ifdef INSTANCES
let VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;
#else
let VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;
#endif
let totalFrames: f32=VATEndFrame-VATStartFrame+1.0;let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;let frameCorrection: f32=select(1.0,0.0,time<1.0);let numOfFrames: f32=totalFrames-frameCorrection;var VATFrameNum: f32=fract(time)*numOfFrames;VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;VATFrameNum=floor(VATFrameNum);VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;var VATInfluence : mat4x4<f32>;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];
#endif
finalWorld=finalWorld*VATInfluence;}
#endif
`;
Le.IncludesShadersStoreWGSL[kue] = Eue;
const Fue = "clipPlaneFragment", Nue = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
if (false) {}
#endif
#ifdef CLIPPLANE
else if (fragmentInputs.fClipDistance>0.0)
{discard;}
#endif
#ifdef CLIPPLANE2
else if (fragmentInputs.fClipDistance2>0.0)
{discard;}
#endif
#ifdef CLIPPLANE3
else if (fragmentInputs.fClipDistance3>0.0)
{discard;}
#endif
#ifdef CLIPPLANE4
else if (fragmentInputs.fClipDistance4>0.0)
{discard;}
#endif
#ifdef CLIPPLANE5
else if (fragmentInputs.fClipDistance5>0.0)
{discard;}
#endif
#ifdef CLIPPLANE6
else if (fragmentInputs.fClipDistance6>0.0)
{discard;}
#endif
`;
Le.IncludesShadersStoreWGSL[Fue] = Nue;
const Que = "clipPlaneFragmentDeclaration", Yue = `#ifdef CLIPPLANE
varying fClipDistance: f32;
#endif
#ifdef CLIPPLANE2
varying fClipDistance2: f32;
#endif
#ifdef CLIPPLANE3
varying fClipDistance3: f32;
#endif
#ifdef CLIPPLANE4
varying fClipDistance4: f32;
#endif
#ifdef CLIPPLANE5
varying fClipDistance5: f32;
#endif
#ifdef CLIPPLANE6
varying fClipDistance6: f32;
#endif
`;
Le.IncludesShadersStoreWGSL[Que] = Yue;
const Mue = "clipPlaneVertex", Lue = `#ifdef CLIPPLANE
vertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane);
#endif
#ifdef CLIPPLANE2
vertexOutputs.fClipDistance2=dot(worldPos,uniforms.vClipPlane2);
#endif
#ifdef CLIPPLANE3
vertexOutputs.fClipDistance3=dot(worldPos,uniforms.vClipPlane3);
#endif
#ifdef CLIPPLANE4
vertexOutputs.fClipDistance4=dot(worldPos,uniforms.vClipPlane4);
#endif
#ifdef CLIPPLANE5
vertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5);
#endif
#ifdef CLIPPLANE6
vertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6);
#endif
`;
Le.IncludesShadersStoreWGSL[Mue] = Lue;
const Kue = "clipPlaneVertexDeclaration", Jue = `#ifdef CLIPPLANE
uniform vClipPlane: vec4<f32>;varying fClipDistance: f32;
#endif
#ifdef CLIPPLANE2
uniform vClipPlane2: vec4<f32>;varying fClipDistance2: f32;
#endif
#ifdef CLIPPLANE3
uniform vClipPlane3: vec4<f32>;varying fClipDistance3: f32;
#endif
#ifdef CLIPPLANE4
uniform vClipPlane4: vec4<f32>;varying fClipDistance4: f32;
#endif
#ifdef CLIPPLANE5
uniform vClipPlane5: vec4<f32>;varying fClipDistance5: f32;
#endif
#ifdef CLIPPLANE6
uniform vClipPlane6: vec4<f32>;varying fClipDistance6: f32;
#endif
`;
Le.IncludesShadersStoreWGSL[Kue] = Jue;
const zue = "instancesDeclaration", Gue = `#ifdef INSTANCES
attribute world0 : vec4<f32>;attribute world1 : vec4<f32>;attribute world2 : vec4<f32>;attribute world3 : vec4<f32>;
#ifdef INSTANCESCOLOR
attribute instanceColor : vec4<f32>;
#endif
#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)
uniform world : mat4x4<f32>;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY)
attribute previousWorld0 : vec4<f32>;attribute previousWorld1 : vec4<f32>;attribute previousWorld2 : vec4<f32>;attribute previousWorld3 : vec4<f32>;
#ifdef THIN_INSTANCES
uniform previousWorld : mat4x4<f32>;
#endif
#endif
#else
#if !defined(WORLD_UBO)
uniform world : mat4x4<f32>;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY)
uniform previousWorld : mat4x4<f32>;
#endif
#endif
`;
Le.IncludesShadersStoreWGSL[zue] = Gue;
const Zue = "instancesVertex", _ue = `#ifdef INSTANCES
var finalWorld=mat4x4<f32>(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3);
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
var finalPreviousWorld=mat4x4<f32>(previousWorld0,previousWorld1,previousWorld2,previousWorld3);
#endif
#ifdef THIN_INSTANCES
#if !defined(WORLD_UBO)
finalWorld=uniforms.world*finalWorld;
#else
finalWorld=mesh.world*finalWorld;
#endif
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
finalPreviousWorld=previousWorld*finalPreviousWorld;
#endif
#endif
#else
#if !defined(WORLD_UBO)
var finalWorld=uniforms.world;
#else
var finalWorld=mesh.world;
#endif
#if defined(PREPASS_VELOCITY) || defined(VELOCITY)
var finalPreviousWorld=previousWorld;
#endif
#endif
`;
Le.IncludesShadersStoreWGSL[Zue] = _ue;
const $ue = "meshUboDeclaration", ele = `struct Mesh {world : mat4x4<f32>,
visibility : f32,};var<uniform> mesh : Mesh;
#define WORLD_UBO
`;
Le.IncludesShadersStoreWGSL[$ue] = ele;
const tle = "morphTargetsVertex", rle = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE 
vertexID=f32(vertexInputs.vertexIndex)*uniforms.morphTargetTextureInfo.x;positionUpdated=positionUpdated+(readVector3FromRawSampler({X},vertexID)-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];vertexID=vertexID+1.0;
#ifdef MORPHTARGETS_NORMAL
normalUpdated=normalUpdated+(readVector3FromRawSampler({X},vertexID) -vertexInputs.normal)*uniforms.morphTargetInfluences[{X}];vertexID=vertexID+1.0;
#endif
#ifdef MORPHTARGETS_UV
uvUpdated=uvUpdated+(readVector3FromRawSampler({X},vertexID).xy-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}];vertexID=vertexID+1.0;
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated.xyz=tangentUpdated.xyz+(readVector3FromRawSampler({X},vertexID) -vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[{X}];
#endif
#else
positionUpdated=positionUpdated+(position{X}-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];
#ifdef MORPHTARGETS_NORMAL
normalUpdated+=(normal{X}-vertexInputs.normal)*uniforms.morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated.xyz=tangentUpdated.xyz+(tangent{X}-vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_UV
uvUpdated=uvUpdated+(uv_{X}-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}];
#endif
#endif
#endif
`;
Le.IncludesShadersStoreWGSL[tle] = rle;
const nle = "morphTargetsVertexDeclaration", ile = `#ifdef MORPHTARGETS
#ifndef MORPHTARGETS_TEXTURE
attribute position{X} : vec3<f32>;
#ifdef MORPHTARGETS_NORMAL
attribute normal{X} : vec3<f32>;
#endif
#ifdef MORPHTARGETS_TANGENT
attribute tangent{X} : vec3<f32>;
#endif
#ifdef MORPHTARGETS_UV
attribute uv_{X} : vec2<f32>;
#endif
#endif
#endif
`;
Le.IncludesShadersStoreWGSL[nle] = ile;
const sle = "morphTargetsVertexGlobal", ale = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE
var vertexID : f32;
#endif
#endif
`;
Le.IncludesShadersStoreWGSL[sle] = ale;
const ole = "morphTargetsVertexGlobalDeclaration", fle = `#ifdef MORPHTARGETS
uniform morphTargetInfluences : array<f32,NUM_MORPH_INFLUENCERS>;
#ifdef MORPHTARGETS_TEXTURE 
uniform morphTargetTextureIndices : array<f32,NUM_MORPH_INFLUENCERS>;uniform morphTargetTextureInfo : vec3<f32>;var morphTargets : texture_2d_array<f32>;var morphTargetsSampler : sampler;fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3<f32>
{ 
let y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);let x=vertexIndex-y*uniforms.morphTargetTextureInfo.y;let textureUV=vec2<f32>((x+0.5)/uniforms.morphTargetTextureInfo.y,(y+0.5)/uniforms.morphTargetTextureInfo.z);return textureSampleLevel(morphTargets,morphTargetsSampler,textureUV,i32(uniforms.morphTargetTextureIndices[targetIndex]),0.0).xyz;}
#endif
#endif
`;
Le.IncludesShadersStoreWGSL[ole] = fle;
const Ale = "sceneUboDeclaration", dle = `struct Scene {viewProjection : mat4x4<f32>,
#ifdef MULTIVIEW
viewProjectionR : mat4x4<f32>,
#endif 
view : mat4x4<f32>,
projection : mat4x4<f32>,
vEyePosition : vec4<f32>,};var<uniform> scene : Scene;
`;
Le.IncludesShadersStoreWGSL[Ale] = dle;
const bG = "fragmentOutputs.fragDepth", vle = "uniforms", ule = "internals", lle = {
  texture_1d: Da.E1d,
  texture_2d: Da.E2d,
  texture_2d_array: Da.E2dArray,
  texture_3d: Da.E3d,
  texture_cube: Da.Cube,
  texture_cube_array: Da.CubeArray,
  texture_multisampled_2d: Da.E2d,
  texture_depth_2d: Da.E2d,
  texture_depth_2d_array: Da.E2dArray,
  texture_depth_cube: Da.Cube,
  texture_depth_cube_array: Da.CubeArray,
  texture_depth_multisampled_2d: Da.E2d,
  texture_storage_1d: Da.E1d,
  texture_storage_2d: Da.E2d,
  texture_storage_2d_array: Da.E2dArray,
  texture_storage_3d: Da.E3d,
  texture_external: null
};
class Ple extends Wo {
  constructor() {
    super(...arguments), this.shaderLanguage = za.WGSL, this.uniformRegexp = /uniform\s+(\w+)\s*:\s*(.+)\s*;/, this.textureRegexp = /var\s+(\w+)\s*:\s*((array<\s*)?(texture_\w+)\s*(<\s*(.+)\s*>)?\s*(,\s*\w+\s*>\s*)?);/, this.noPrecision = !0;
  }
  _getArraySize(e, t, r) {
    let n = 0;
    const i = t.lastIndexOf(">");
    if (t.indexOf("array") >= 0 && i > 0) {
      let s = i;
      for (; s > 0 && t.charAt(s) !== " " && t.charAt(s) !== ","; )
        s--;
      const a = t.substring(s + 1, i);
      for (n = +a, isNaN(n) && (n = +r[a.trim()]); s > 0 && (t.charAt(s) === " " || t.charAt(s) === ","); )
        s--;
      t = t.substring(t.indexOf("<") + 1, s + 1);
    }
    return [e, t, n];
  }
  initializeShaders(e) {
    this._webgpuProcessingContext = e, this._attributesInputWGSL = [], this._attributesWGSL = [], this._attributesConversionCodeWGSL = [], this._hasNonFloatAttribute = !1, this._varyingsWGSL = [], this._varyingNamesWGSL = [], this._stridedUniformArrays = [];
  }
  preProcessShaderCode(e) {
    return `struct ${Wo.InternalsUBOName} {
  yFactor_: f32,
  textureOutputHeight_: f32,
};
var<uniform> ${ule} : ${Wo.InternalsUBOName};
` + iF(e);
  }
  varyingProcessor(e, t, r) {
    const i = /\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s*:\s*(.+)\s*;/gm.exec(e);
    if (i !== null) {
      const s = i[2], a = i[1];
      let f;
      t ? (f = this._webgpuProcessingContext.availableVaryings[a], f === void 0 && Se.Warn(`Invalid fragment shader: The varying named "${a}" is not declared in the vertex shader! This declaration will be ignored.`)) : (f = this._webgpuProcessingContext.getVaryingNextLocation(s, this._getArraySize(a, s, r)[2]), this._webgpuProcessingContext.availableVaryings[a] = f, this._varyingsWGSL.push(`  @location(${f}) ${a} : ${s},`), this._varyingNamesWGSL.push(a)), e = "";
    }
    return e;
  }
  attributeProcessor(e, t) {
    const n = /\s*attribute\s+(\S+)\s*:\s*(.+)\s*;/gm.exec(e);
    if (n !== null) {
      const i = n[2], s = n[1], a = this._webgpuProcessingContext.getAttributeNextLocation(i, this._getArraySize(s, i, t)[2]);
      this._webgpuProcessingContext.availableAttributes[s] = a, this._webgpuProcessingContext.orderedAttributes[a] = s;
      const f = this.vertexBufferKindToNumberOfComponents[s];
      if (f !== void 0) {
        const o = f < 0 ? f === -1 ? "i32" : "vec" + -f + "<i32>" : f === 1 ? "u32" : "vec" + f + "<u32>", d = `_int_${s}_`;
        this._attributesInputWGSL.push(`@location(${a}) ${d} : ${o},`), this._attributesWGSL.push(`${s} : ${i},`), this._attributesConversionCodeWGSL.push(`vertexInputs.${s} = ${i}(vertexInputs_.${d});`), this._hasNonFloatAttribute = !0;
      } else
        this._attributesInputWGSL.push(`@location(${a}) ${s} : ${i},`), this._attributesWGSL.push(`${s} : ${i},`), this._attributesConversionCodeWGSL.push(`vertexInputs.${s} = vertexInputs_.${s};`);
      e = "";
    }
    return e;
  }
  uniformProcessor(e, t, r) {
    const n = this.uniformRegexp.exec(e);
    if (n !== null) {
      const i = n[2], s = n[1];
      this._addUniformToLeftOverUBO(s, i, r), e = "";
    }
    return e;
  }
  textureProcessor(e, t, r) {
    const n = this.textureRegexp.exec(e);
    if (n !== null) {
      const i = n[1], s = n[2], a = !!n[3], f = n[4], o = f.indexOf("storage") > 0, d = n[6], v = o ? d.substring(0, d.indexOf(",")).trim() : null;
      let u = a ? this._getArraySize(i, s, r)[2] : 0, l = this._webgpuProcessingContext.availableTextures[i];
      if (l)
        u = l.textures.length;
      else {
        l = {
          isTextureArray: u > 0,
          isStorageTexture: o,
          textures: [],
          sampleType: Ll.Float
        }, u = u || 1;
        for (let H = 0; H < u; ++H)
          l.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding());
      }
      this._webgpuProcessingContext.availableTextures[i] = l;
      const P = f.indexOf("depth") > 0, p = lle[f], c = P ? Ll.Depth : d === "u32" ? Ll.Uint : d === "i32" ? Ll.Sint : Ll.Float;
      if (l.sampleType = c, p === void 0)
        throw `Can't get the texture dimension corresponding to the texture function "${f}"!`;
      for (let H = 0; H < u; ++H) {
        const { groupIndex: T, bindingIndex: q } = l.textures[H];
        H === 0 && (e = `@group(${T}) @binding(${q}) ${e}`), this._addTextureBindingDescription(i, l, H, p, v, !t);
      }
    }
    return e;
  }
  postProcessor(e) {
    return e;
  }
  finalizeShaders(e, t) {
    const r = t.indexOf("fragmentInputs.position") >= 0 ? `
            if (internals.yFactor_ == 1.) {
                fragmentInputs.position.y = internals.textureOutputHeight_ - fragmentInputs.position.y;
            }
        ` : "";
    e = this._processSamplers(e, !0), t = this._processSamplers(t, !1), e = this._processCustomBuffers(e, !0), t = this._processCustomBuffers(t, !1);
    const n = this._buildLeftOverUBO();
    e = n + e, t = n + t, e = e.replace(/#define /g, "//#define "), e = this._processStridedUniformArrays(e);
    let i = `struct VertexInputs {
  @builtin(vertex_index) vertexIndex : u32,
  @builtin(instance_index) instanceIndex : u32,
`;
    this._attributesInputWGSL.length > 0 && (i += this._attributesInputWGSL.join(`
`)), i += `
};
var<private> vertexInputs` + (this._hasNonFloatAttribute ? "_" : "") + ` : VertexInputs;
`, this._hasNonFloatAttribute && (i += `struct VertexInputs_ {
  vertexIndex : u32, instanceIndex : u32,
`, i += this._attributesWGSL.join(`
`), i += `
};
var<private> vertexInputs : VertexInputs_;
`);
    let s = `struct FragmentInputs {
  @builtin(position) position : vec4<f32>,
`;
    this._varyingsWGSL.length > 0 && (s += this._varyingsWGSL.join(`
`)), s += `
};
var<private> vertexOutputs : FragmentInputs;
`, e = i + s + e;
    let a = `
  vertexInputs${this._hasNonFloatAttribute ? "_" : ""} = input;
`;
    this._hasNonFloatAttribute && (a += `vertexInputs.vertexIndex = vertexInputs_.vertexIndex;
vertexInputs.instanceIndex = vertexInputs_.instanceIndex;
`, a += this._attributesConversionCodeWGSL.join(`
`), a += `
`);
    const f = `  vertexOutputs.position.y = vertexOutputs.position.y * internals.yFactor_;
  return vertexOutputs;`;
    e = this._injectStartingAndEndingCode(e, "fn main", a, f), t = t.replace(/#define /g, "//#define "), t = this._processStridedUniformArrays(t), t = t.replace(/dpdy/g, "(-internals.yFactor_)*dpdy");
    let o = `struct FragmentInputs {
  @builtin(position) position : vec4<f32>,
  @builtin(front_facing) frontFacing : bool,
`;
    this._varyingsWGSL.length > 0 && (o += this._varyingsWGSL.join(`
`)), o += `
};
var<private> fragmentInputs : FragmentInputs;
`;
    let d = `struct FragmentOutputs {
  @location(0) color : vec4<f32>,
`, v = !1, u = 0;
    for (; !v && (u = t.indexOf(bG, u), !(u < 0)); ) {
      const p = u;
      for (v = !0; u > 1 && t.charAt(u) !== `
`; ) {
        if (t.charAt(u) === "/" && t.charAt(u - 1) === "/") {
          v = !1;
          break;
        }
        u--;
      }
      u = p + bG.length;
    }
    v && (d += `  @builtin(frag_depth) fragDepth: f32,
`), d += `};
var<private> fragmentOutputs : FragmentOutputs;
`, t = o + d + t;
    const l = `  fragmentInputs = input;
  ` + r, P = "  return fragmentOutputs;";
    return t = this._injectStartingAndEndingCode(t, "fn main", l, P), this._collectBindingNames(), this._preCreateBindGroupEntries(), this.vertexBufferKindToNumberOfComponents = {}, { vertexCode: e, fragmentCode: t };
  }
  _generateLeftOverUBOCode(e, t) {
    let r = "", n = `struct ${e} {
`;
    for (const i of this._webgpuProcessingContext.leftOverUniforms) {
      const s = i.type.replace(/^(.*?)(<.*>)?$/, "$1"), a = Wo.UniformSizes[s];
      if (i.length > 0)
        if (a <= 2) {
          const f = `${e}_${this._stridedUniformArrays.length}_strided_arr`;
          r += `struct ${f} {
                        @size(16)
                        el: ${s},
                    }`, this._stridedUniformArrays.push(i.name), n += ` @align(16) ${i.name} : array<${f}, ${i.length}>,
`;
        } else
          n += ` ${i.name} : array<${i.type}, ${i.length}>,
`;
      else
        n += `  ${i.name} : ${i.type},
`;
    }
    return n += `};
`, n = `${r}
${n}`, n += `@group(${t.binding.groupIndex}) @binding(${t.binding.bindingIndex}) var<uniform> ${vle} : ${e};
`, n;
  }
  _processSamplers(e, t) {
    const r = /var\s+(\w+Sampler)\s*:\s*(sampler|sampler_comparison)\s*;/gm;
    for (; ; ) {
      const n = r.exec(e);
      if (n === null)
        break;
      const i = n[1], s = n[2], a = i.indexOf(Wo.AutoSamplerSuffix) === i.length - Wo.AutoSamplerSuffix.length ? i.substring(0, i.indexOf(Wo.AutoSamplerSuffix)) : null, f = s === "sampler_comparison" ? Xq.Comparison : Xq.Filtering;
      if (a) {
        const l = this._webgpuProcessingContext.availableTextures[a];
        l && (l.autoBindSampler = !0);
      }
      let o = this._webgpuProcessingContext.availableSamplers[i];
      o || (o = {
        binding: this._webgpuProcessingContext.getNextFreeUBOBinding(),
        type: f
      }, this._webgpuProcessingContext.availableSamplers[i] = o), this._addSamplerBindingDescription(i, o, t);
      const d = e.substring(0, n.index), v = `@group(${o.binding.groupIndex}) @binding(${o.binding.bindingIndex}) `, u = e.substring(n.index);
      e = d + v + u, r.lastIndex += v.length;
    }
    return e;
  }
  _processCustomBuffers(e, t) {
    const r = /var<\s*(uniform|storage)\s*(,\s*(read|read_write)\s*)?>\s+(\S+)\s*:\s*(\S+)\s*;/gm;
    for (; ; ) {
      const n = r.exec(e);
      if (n === null)
        break;
      const i = n[1], s = n[3];
      let a = n[4];
      const f = n[5];
      let o = this._webgpuProcessingContext.availableBuffers[a];
      if (!o) {
        const p = i === "uniform" ? gp.KnownUBOs[f] : null;
        let c;
        p ? (a = f, c = p.binding, c.groupIndex === -1 && (c = this._webgpuProcessingContext.getNextFreeUBOBinding())) : c = this._webgpuProcessingContext.getNextFreeUBOBinding(), o = { binding: c }, this._webgpuProcessingContext.availableBuffers[a] = o;
      }
      this._addBufferBindingDescription(a, this._webgpuProcessingContext.availableBuffers[a], s === "read_write" ? dq.Storage : i === "storage" ? dq.ReadOnlyStorage : dq.Uniform, t);
      const d = o.binding.groupIndex, v = o.binding.bindingIndex, u = e.substring(0, n.index), l = `@group(${d}) @binding(${v}) `, P = e.substring(n.index);
      e = u + l + P, r.lastIndex += l.length;
    }
    return e;
  }
  _processStridedUniformArrays(e) {
    for (const t of this._stridedUniformArrays)
      e = e.replace(new RegExp(`${t}\\s*\\[(.*)\\]`, "g"), `${t}[$1].el`);
    return e;
  }
}
class DC {
  get underlyingResource() {
    return this._webgpuTexture;
  }
  getMSAATexture(e = 0) {
    var t, r;
    return (r = (t = this._webgpuMSAATexture) === null || t === void 0 ? void 0 : t[e]) !== null && r !== void 0 ? r : null;
  }
  setMSAATexture(e, t = -1) {
    this._webgpuMSAATexture || (this._webgpuMSAATexture = []), t === -1 && (t = this._webgpuMSAATexture.length), this._webgpuMSAATexture[t] = e;
  }
  releaseMSAATexture() {
    if (this._webgpuMSAATexture) {
      for (const e of this._webgpuMSAATexture)
        e == null || e.destroy();
      this._webgpuMSAATexture = null;
    }
  }
  constructor(e = null) {
    this.format = we.RGBA8Unorm, this.textureUsages = 0, this.textureAdditionalUsages = 0, this._webgpuTexture = e, this._webgpuMSAATexture = null, this.view = null, this.viewForWriting = null;
  }
  set(e) {
    this._webgpuTexture = e;
  }
  setUsage(e, t, r, n, i) {
    this.createView({
      format: this.format,
      dimension: r ? Da.Cube : Da.E2d,
      mipLevelCount: t ? Xt.ILog2(Math.max(n, i)) + 1 : 1,
      baseArrayLayer: 0,
      baseMipLevel: 0,
      arrayLayerCount: r ? 6 : 1,
      aspect: zH.All
    });
  }
  createView(e, t = !1) {
    if (this.view = this._webgpuTexture.createView(e), t && e) {
      const r = e.mipLevelCount;
      e.mipLevelCount = 1, this.viewForWriting = this._webgpuTexture.createView(e), e.mipLevelCount = r;
    }
  }
  reset() {
    this._webgpuTexture = null, this._webgpuMSAATexture = null, this.view = null, this.viewForWriting = null;
  }
  release() {
    var e, t;
    (e = this._webgpuTexture) === null || e === void 0 || e.destroy(), this.releaseMSAATexture(), (t = this._copyInvertYTempTexture) === null || t === void 0 || t.destroy(), this.reset();
  }
}
const cle = `
    const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f));
    const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f));

    layout(location = 0) out vec2 vTex;

    void main() {
        vTex = tex[gl_VertexIndex];
        gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);
    }
    `, ple = `
    layout(set = 0, binding = 0) uniform sampler imgSampler;
    layout(set = 0, binding = 1) uniform texture2D img;

    layout(location = 0) in vec2 vTex;
    layout(location = 0) out vec4 outColor;

    void main() {
        outColor = texture(sampler2D(img, imgSampler), vTex);
    }
    `, Tte = `
    #extension GL_EXT_samplerless_texture_functions : enable

    const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f));
    const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f));

    layout(set = 0, binding = 0) uniform texture2D img;

    #ifdef INVERTY
        layout(location = 0) out flat ivec2 vTextureSize;
    #endif

    void main() {
        #ifdef INVERTY
            vTextureSize = textureSize(img, 0);
        #endif
        gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);
    }
    `, hle = `
    #extension GL_EXT_samplerless_texture_functions : enable

    layout(set = 0, binding = 0) uniform texture2D img;

    #ifdef INVERTY
        layout(location = 0) in flat ivec2 vTextureSize;
    #endif
    layout(location = 0) out vec4 outColor;

    void main() {
    #ifdef INVERTY
        vec4 color = texelFetch(img, ivec2(gl_FragCoord.x, vTextureSize.y - gl_FragCoord.y), 0);
    #else
        vec4 color = texelFetch(img, ivec2(gl_FragCoord.xy), 0);
    #endif
    #ifdef PREMULTIPLYALPHA
        color.rgb *= color.a;
    #endif
        outColor = color;
    }
    `, Hle = Tte, gle = `
    #extension GL_EXT_samplerless_texture_functions : enable

    layout(set = 0, binding = 0) uniform texture2D img;
    layout(set = 0, binding = 1) uniform Params {
        float ofstX;
        float ofstY;
        float width;
        float height;
    };

    #ifdef INVERTY
        layout(location = 0) in flat ivec2 vTextureSize;
    #endif
    layout(location = 0) out vec4 outColor;

    void main() {
        if (gl_FragCoord.x < ofstX || gl_FragCoord.x >= ofstX + width) {
            discard;
        }
        if (gl_FragCoord.y < ofstY || gl_FragCoord.y >= ofstY + height) {
            discard;
        }
    #ifdef INVERTY
        vec4 color = texelFetch(img, ivec2(gl_FragCoord.x, ofstY + height - (gl_FragCoord.y - ofstY)), 0);
    #else
        vec4 color = texelFetch(img, ivec2(gl_FragCoord.xy), 0);
    #endif
    #ifdef PREMULTIPLYALPHA
        color.rgb *= color.a;
    #endif
        outColor = color;
    }
    `, Xle = `
    const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f));

    void main() {
        gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);
    }
    `, Tle = `
    layout(set = 0, binding = 0) uniform Uniforms {
        uniform vec4 color;
    };

    layout(location = 0) out vec4 outColor;

    void main() {
        outColor = color;
    }
    `, qle = `
    struct VertexOutput {
        @builtin(position) Position : vec4<f32>,
        @location(0) fragUV : vec2<f32>
    }
  
    @vertex
    fn main(
        @builtin(vertex_index) VertexIndex : u32
    ) -> VertexOutput {
        var pos = array<vec2<f32>, 4>(
            vec2(-1.0,  1.0),
            vec2( 1.0,  1.0),
            vec2(-1.0, -1.0),
            vec2( 1.0, -1.0)
        );
        var tex = array<vec2<f32>, 4>(
            vec2(0.0, 0.0),
            vec2(1.0, 0.0),
            vec2(0.0, 1.0),
            vec2(1.0, 1.0)
        );

        var output: VertexOutput;

        output.Position = vec4<f32>(pos[VertexIndex], 0.0, 1.0);
        output.fragUV = tex[VertexIndex];

        return output;
    }
    `, ble = `
    @group(0) @binding(0) var videoSampler: sampler;
    @group(0) @binding(1) var videoTexture: texture_external;

    @fragment
    fn main(
        @location(0) fragUV: vec2<f32>
    ) -> @location(0) vec4<f32> {
        return textureSampleBaseClampToEdge(videoTexture, videoSampler, fragUV);
    }
    `, xle = `
    @group(0) @binding(0) var videoSampler: sampler;
    @group(0) @binding(1) var videoTexture: texture_external;

    @fragment
    fn main(
        @location(0) fragUV: vec2<f32>
    ) -> @location(0) vec4<f32> {
        return textureSampleBaseClampToEdge(videoTexture, videoSampler, vec2<f32>(fragUV.x, 1.0 - fragUV.y));
    }
    `;
var H0;
(function(A) {
  A[A.MipMap = 0] = "MipMap", A[A.InvertYPremultiplyAlpha = 1] = "InvertYPremultiplyAlpha", A[A.Clear = 2] = "Clear", A[A.InvertYPremultiplyAlphaWithOfst = 3] = "InvertYPremultiplyAlphaWithOfst";
})(H0 || (H0 = {}));
var QW;
(function(A) {
  A[A.DontInvertY = 0] = "DontInvertY", A[A.InvertY = 1] = "InvertY";
})(QW || (QW = {}));
const xG = [
  { vertex: cle, fragment: ple },
  { vertex: Tte, fragment: hle },
  { vertex: Xle, fragment: Tle },
  { vertex: Hle, fragment: gle }
], F2 = {
  "": 0,
  r8unorm: 1,
  r8uint: 2,
  r8sint: 3,
  r16uint: 4,
  r16sint: 5,
  r16float: 6,
  rg8unorm: 7,
  rg8uint: 8,
  rg8sint: 9,
  r32uint: 10,
  r32sint: 11,
  r32float: 12,
  rg16uint: 13,
  rg16sint: 14,
  rg16float: 15,
  rgba8unorm: 16,
  "rgba8unorm-srgb": 17,
  rgba8uint: 18,
  rgba8sint: 19,
  bgra8unorm: 20,
  "bgra8unorm-srgb": 21,
  rgb10a2uint: 22,
  rgb10a2unorm: 23,
  /* rg11b10ufloat: this entry is dynamically added if the "RG11B10UFloatRenderable" extension is supported */
  rg32uint: 24,
  rg32sint: 25,
  rg32float: 26,
  rgba16uint: 27,
  rgba16sint: 28,
  rgba16float: 29,
  rgba32uint: 30,
  rgba32sint: 31,
  rgba32float: 32,
  stencil8: 33,
  depth16unorm: 34,
  depth24plus: 35,
  "depth24plus-stencil8": 36,
  depth32float: 37,
  "depth32float-stencil8": 38
};
class Ns {
  static ComputeNumMipmapLevels(e, t) {
    return Xt.ILog2(Math.max(e, t)) + 1;
  }
  //------------------------------------------------------------------------------
  //                         Initialization / Helpers
  //------------------------------------------------------------------------------
  constructor(e, t, r, n, i) {
    if (this._pipelines = {}, this._compiledShaders = [], this._videoPipelines = {}, this._videoCompiledShaders = [], this._deferredReleaseTextures = [], this._device = e, this._glslang = t, this._tintWASM = r, this._bufferManager = n, i.indexOf(k2.RG11B10UFloatRenderable) !== -1) {
      const s = Object.keys(F2);
      F2[we.RG11B10UFloat] = F2[s[s.length - 1]] + 1;
    }
    this._mipmapSampler = e.createSampler({ minFilter: Ji.Linear }), this._videoSampler = e.createSampler({ minFilter: Ji.Linear }), this._ubCopyWithOfst = this._bufferManager.createBuffer(4 * 4, ga.Uniform | ga.CopyDst, "UBCopyWithOffset").underlyingResource, this._getPipeline(we.RGBA8Unorm), this._getVideoPipeline(we.RGBA8Unorm);
  }
  _getPipeline(e, t = H0.MipMap, r) {
    const n = t === H0.MipMap ? 1 : t === H0.InvertYPremultiplyAlpha ? ((r.invertY ? 1 : 0) << 1) + ((r.premultiplyAlpha ? 1 : 0) << 2) : t === H0.Clear ? 8 : t === H0.InvertYPremultiplyAlphaWithOfst ? ((r.invertY ? 1 : 0) << 4) + ((r.premultiplyAlpha ? 1 : 0) << 5) : 0;
    this._pipelines[e] || (this._pipelines[e] = []);
    let i = this._pipelines[e][n];
    if (!i) {
      let s = `#version 450
`;
      (t === H0.InvertYPremultiplyAlpha || t === H0.InvertYPremultiplyAlphaWithOfst) && (r.invertY && (s += `#define INVERTY
`), r.premultiplyAlpha && (s += `#define PREMULTIPLYALPHA
`));
      let a = this._compiledShaders[n];
      if (!a) {
        let o = this._glslang.compileGLSL(s + xG[t].vertex, "vertex"), d = this._glslang.compileGLSL(s + xG[t].fragment, "fragment");
        this._tintWASM && (o = this._tintWASM.convertSpirV2WGSL(o), d = this._tintWASM.convertSpirV2WGSL(d));
        const v = this._device.createShaderModule({
          code: o
        }), u = this._device.createShaderModule({
          code: d
        });
        a = this._compiledShaders[n] = [v, u];
      }
      const f = this._device.createRenderPipeline({
        layout: SS.Auto,
        vertex: {
          module: a[0],
          entryPoint: "main"
        },
        fragment: {
          module: a[1],
          entryPoint: "main",
          targets: [
            {
              format: e
            }
          ]
        },
        primitive: {
          topology: Fl.TriangleStrip,
          stripIndexFormat: Tq.Uint16
        }
      });
      i = this._pipelines[e][n] = [f, f.getBindGroupLayout(0)];
    }
    return i;
  }
  _getVideoPipeline(e, t = QW.DontInvertY) {
    const r = t === QW.InvertY ? 1 : 0;
    this._videoPipelines[e] || (this._videoPipelines[e] = []);
    let n = this._videoPipelines[e][r];
    if (!n) {
      let i = this._videoCompiledShaders[r];
      if (!i) {
        const a = this._device.createShaderModule({
          code: qle
        }), f = this._device.createShaderModule({
          code: r === 0 ? ble : xle
        });
        i = this._videoCompiledShaders[r] = [a, f];
      }
      const s = this._device.createRenderPipeline({
        label: `CopyVideoToTexture_${e}_${r === 0 ? "DontInvertY" : "InvertY"}`,
        layout: SS.Auto,
        vertex: {
          module: i[0],
          entryPoint: "main"
        },
        fragment: {
          module: i[1],
          entryPoint: "main",
          targets: [
            {
              format: e
            }
          ]
        },
        primitive: {
          topology: Fl.TriangleStrip,
          stripIndexFormat: Tq.Uint16
        }
      });
      n = this._videoPipelines[e][r] = [s, s.getBindGroupLayout(0)];
    }
    return n;
  }
  static GetTextureTypeFromFormat(e) {
    switch (e) {
      case we.R8Unorm:
      case we.R8Snorm:
      case we.R8Uint:
      case we.R8Sint:
      case we.RG8Unorm:
      case we.RG8Snorm:
      case we.RG8Uint:
      case we.RG8Sint:
      case we.RGBA8Unorm:
      case we.RGBA8UnormSRGB:
      case we.RGBA8Snorm:
      case we.RGBA8Uint:
      case we.RGBA8Sint:
      case we.BGRA8Unorm:
      case we.BGRA8UnormSRGB:
      case we.RGB10A2UINT:
      case we.RGB10A2Unorm:
      case we.RGB9E5UFloat:
      case we.RG11B10UFloat:
      case we.BC7RGBAUnorm:
      case we.BC7RGBAUnormSRGB:
      case we.BC6HRGBUFloat:
      case we.BC6HRGBFloat:
      case we.BC5RGUnorm:
      case we.BC5RGSnorm:
      case we.BC3RGBAUnorm:
      case we.BC3RGBAUnormSRGB:
      case we.BC2RGBAUnorm:
      case we.BC2RGBAUnormSRGB:
      case we.BC4RUnorm:
      case we.BC4RSnorm:
      case we.BC1RGBAUnorm:
      case we.BC1RGBAUnormSRGB:
      case we.ETC2RGB8Unorm:
      case we.ETC2RGB8UnormSRGB:
      case we.ETC2RGB8A1Unorm:
      case we.ETC2RGB8A1UnormSRGB:
      case we.ETC2RGBA8Unorm:
      case we.ETC2RGBA8UnormSRGB:
      case we.EACR11Unorm:
      case we.EACR11Snorm:
      case we.EACRG11Unorm:
      case we.EACRG11Snorm:
      case we.ASTC4x4Unorm:
      case we.ASTC4x4UnormSRGB:
      case we.ASTC5x4Unorm:
      case we.ASTC5x4UnormSRGB:
      case we.ASTC5x5Unorm:
      case we.ASTC5x5UnormSRGB:
      case we.ASTC6x5Unorm:
      case we.ASTC6x5UnormSRGB:
      case we.ASTC6x6Unorm:
      case we.ASTC6x6UnormSRGB:
      case we.ASTC8x5Unorm:
      case we.ASTC8x5UnormSRGB:
      case we.ASTC8x6Unorm:
      case we.ASTC8x6UnormSRGB:
      case we.ASTC8x8Unorm:
      case we.ASTC8x8UnormSRGB:
      case we.ASTC10x5Unorm:
      case we.ASTC10x5UnormSRGB:
      case we.ASTC10x6Unorm:
      case we.ASTC10x6UnormSRGB:
      case we.ASTC10x8Unorm:
      case we.ASTC10x8UnormSRGB:
      case we.ASTC10x10Unorm:
      case we.ASTC10x10UnormSRGB:
      case we.ASTC12x10Unorm:
      case we.ASTC12x10UnormSRGB:
      case we.ASTC12x12Unorm:
      case we.ASTC12x12UnormSRGB:
      case we.Stencil8:
        return 0;
      case we.R16Uint:
      case we.R16Sint:
      case we.RG16Uint:
      case we.RG16Sint:
      case we.RGBA16Uint:
      case we.RGBA16Sint:
      case we.Depth16Unorm:
        return 5;
      case we.R16Float:
      case we.RG16Float:
      case we.RGBA16Float:
        return 2;
      case we.R32Uint:
      case we.R32Sint:
      case we.RG32Uint:
      case we.RG32Sint:
      case we.RGBA32Uint:
      case we.RGBA32Sint:
        return 7;
      case we.R32Float:
      case we.RG32Float:
      case we.RGBA32Float:
      case we.Depth32Float:
      case we.Depth32FloatStencil8:
      case we.Depth24Plus:
      case we.Depth24PlusStencil8:
        return 1;
    }
    return 0;
  }
  static _GetBlockInformationFromFormat(e) {
    switch (e) {
      case we.R8Unorm:
      case we.R8Snorm:
      case we.R8Uint:
      case we.R8Sint:
        return { width: 1, height: 1, length: 1 };
      case we.R16Uint:
      case we.R16Sint:
      case we.R16Float:
      case we.RG8Unorm:
      case we.RG8Snorm:
      case we.RG8Uint:
      case we.RG8Sint:
        return { width: 1, height: 1, length: 2 };
      case we.R32Uint:
      case we.R32Sint:
      case we.R32Float:
      case we.RG16Uint:
      case we.RG16Sint:
      case we.RG16Float:
      case we.RGBA8Unorm:
      case we.RGBA8UnormSRGB:
      case we.RGBA8Snorm:
      case we.RGBA8Uint:
      case we.RGBA8Sint:
      case we.BGRA8Unorm:
      case we.BGRA8UnormSRGB:
      case we.RGB9E5UFloat:
      case we.RGB10A2UINT:
      case we.RGB10A2Unorm:
      case we.RG11B10UFloat:
        return { width: 1, height: 1, length: 4 };
      case we.RG32Uint:
      case we.RG32Sint:
      case we.RG32Float:
      case we.RGBA16Uint:
      case we.RGBA16Sint:
      case we.RGBA16Float:
        return { width: 1, height: 1, length: 8 };
      case we.RGBA32Uint:
      case we.RGBA32Sint:
      case we.RGBA32Float:
        return { width: 1, height: 1, length: 16 };
      case we.Stencil8:
        throw "No fixed size for Stencil8 format!";
      case we.Depth16Unorm:
        return { width: 1, height: 1, length: 2 };
      case we.Depth24Plus:
        throw "No fixed size for Depth24Plus format!";
      case we.Depth24PlusStencil8:
        throw "No fixed size for Depth24PlusStencil8 format!";
      case we.Depth32Float:
        return { width: 1, height: 1, length: 4 };
      case we.Depth32FloatStencil8:
        return { width: 1, height: 1, length: 5 };
      case we.BC7RGBAUnorm:
      case we.BC7RGBAUnormSRGB:
      case we.BC6HRGBUFloat:
      case we.BC6HRGBFloat:
      case we.BC5RGUnorm:
      case we.BC5RGSnorm:
      case we.BC3RGBAUnorm:
      case we.BC3RGBAUnormSRGB:
      case we.BC2RGBAUnorm:
      case we.BC2RGBAUnormSRGB:
        return { width: 4, height: 4, length: 16 };
      case we.BC4RUnorm:
      case we.BC4RSnorm:
      case we.BC1RGBAUnorm:
      case we.BC1RGBAUnormSRGB:
        return { width: 4, height: 4, length: 8 };
      case we.ETC2RGB8Unorm:
      case we.ETC2RGB8UnormSRGB:
      case we.ETC2RGB8A1Unorm:
      case we.ETC2RGB8A1UnormSRGB:
      case we.EACR11Unorm:
      case we.EACR11Snorm:
        return { width: 4, height: 4, length: 8 };
      case we.ETC2RGBA8Unorm:
      case we.ETC2RGBA8UnormSRGB:
      case we.EACRG11Unorm:
      case we.EACRG11Snorm:
        return { width: 4, height: 4, length: 16 };
      case we.ASTC4x4Unorm:
      case we.ASTC4x4UnormSRGB:
        return { width: 4, height: 4, length: 16 };
      case we.ASTC5x4Unorm:
      case we.ASTC5x4UnormSRGB:
        return { width: 5, height: 4, length: 16 };
      case we.ASTC5x5Unorm:
      case we.ASTC5x5UnormSRGB:
        return { width: 5, height: 5, length: 16 };
      case we.ASTC6x5Unorm:
      case we.ASTC6x5UnormSRGB:
        return { width: 6, height: 5, length: 16 };
      case we.ASTC6x6Unorm:
      case we.ASTC6x6UnormSRGB:
        return { width: 6, height: 6, length: 16 };
      case we.ASTC8x5Unorm:
      case we.ASTC8x5UnormSRGB:
        return { width: 8, height: 5, length: 16 };
      case we.ASTC8x6Unorm:
      case we.ASTC8x6UnormSRGB:
        return { width: 8, height: 6, length: 16 };
      case we.ASTC8x8Unorm:
      case we.ASTC8x8UnormSRGB:
        return { width: 8, height: 8, length: 16 };
      case we.ASTC10x5Unorm:
      case we.ASTC10x5UnormSRGB:
        return { width: 10, height: 5, length: 16 };
      case we.ASTC10x6Unorm:
      case we.ASTC10x6UnormSRGB:
        return { width: 10, height: 6, length: 16 };
      case we.ASTC10x8Unorm:
      case we.ASTC10x8UnormSRGB:
        return { width: 10, height: 8, length: 16 };
      case we.ASTC10x10Unorm:
      case we.ASTC10x10UnormSRGB:
        return { width: 10, height: 10, length: 16 };
      case we.ASTC12x10Unorm:
      case we.ASTC12x10UnormSRGB:
        return { width: 12, height: 10, length: 16 };
      case we.ASTC12x12Unorm:
      case we.ASTC12x12UnormSRGB:
        return { width: 12, height: 12, length: 16 };
    }
    return { width: 1, height: 1, length: 4 };
  }
  static _IsHardwareTexture(e) {
    return !!e.release;
  }
  static _IsInternalTexture(e) {
    return !!e.dispose;
  }
  static IsImageBitmap(e) {
    return e.close !== void 0;
  }
  static IsImageBitmapArray(e) {
    return Array.isArray(e) && e[0].close !== void 0;
  }
  setCommandEncoder(e) {
    this._commandEncoderForCreation = e;
  }
  static IsCompressedFormat(e) {
    switch (e) {
      case we.BC7RGBAUnormSRGB:
      case we.BC7RGBAUnorm:
      case we.BC6HRGBFloat:
      case we.BC6HRGBUFloat:
      case we.BC5RGSnorm:
      case we.BC5RGUnorm:
      case we.BC4RSnorm:
      case we.BC4RUnorm:
      case we.BC3RGBAUnormSRGB:
      case we.BC3RGBAUnorm:
      case we.BC2RGBAUnormSRGB:
      case we.BC2RGBAUnorm:
      case we.BC1RGBAUnormSRGB:
      case we.BC1RGBAUnorm:
      case we.ETC2RGB8Unorm:
      case we.ETC2RGB8UnormSRGB:
      case we.ETC2RGB8A1Unorm:
      case we.ETC2RGB8A1UnormSRGB:
      case we.ETC2RGBA8Unorm:
      case we.ETC2RGBA8UnormSRGB:
      case we.EACR11Unorm:
      case we.EACR11Snorm:
      case we.EACRG11Unorm:
      case we.EACRG11Snorm:
      case we.ASTC4x4Unorm:
      case we.ASTC4x4UnormSRGB:
      case we.ASTC5x4Unorm:
      case we.ASTC5x4UnormSRGB:
      case we.ASTC5x5Unorm:
      case we.ASTC5x5UnormSRGB:
      case we.ASTC6x5Unorm:
      case we.ASTC6x5UnormSRGB:
      case we.ASTC6x6Unorm:
      case we.ASTC6x6UnormSRGB:
      case we.ASTC8x5Unorm:
      case we.ASTC8x5UnormSRGB:
      case we.ASTC8x6Unorm:
      case we.ASTC8x6UnormSRGB:
      case we.ASTC8x8Unorm:
      case we.ASTC8x8UnormSRGB:
      case we.ASTC10x5Unorm:
      case we.ASTC10x5UnormSRGB:
      case we.ASTC10x6Unorm:
      case we.ASTC10x6UnormSRGB:
      case we.ASTC10x8Unorm:
      case we.ASTC10x8UnormSRGB:
      case we.ASTC10x10Unorm:
      case we.ASTC10x10UnormSRGB:
      case we.ASTC12x10Unorm:
      case we.ASTC12x10UnormSRGB:
      case we.ASTC12x12Unorm:
      case we.ASTC12x12UnormSRGB:
        return !0;
    }
    return !1;
  }
  static GetWebGPUTextureFormat(e, t, r = !1) {
    switch (t) {
      case 15:
        return we.Depth16Unorm;
      case 16:
        return we.Depth24Plus;
      case 13:
        return we.Depth24PlusStencil8;
      case 14:
        return we.Depth32Float;
      case 18:
        return we.Depth32FloatStencil8;
      case 19:
        return we.Stencil8;
      case 36492:
        return r ? we.BC7RGBAUnormSRGB : we.BC7RGBAUnorm;
      case 36495:
        return we.BC6HRGBUFloat;
      case 36494:
        return we.BC6HRGBFloat;
      case 33779:
        return r ? we.BC3RGBAUnormSRGB : we.BC3RGBAUnorm;
      case 33778:
        return r ? we.BC2RGBAUnormSRGB : we.BC2RGBAUnorm;
      case 33777:
      case 33776:
        return r ? we.BC1RGBAUnormSRGB : we.BC1RGBAUnorm;
      case 37808:
        return r ? we.ASTC4x4UnormSRGB : we.ASTC4x4Unorm;
      case 36196:
      case 37492:
        return r ? we.ETC2RGB8UnormSRGB : we.ETC2RGB8Unorm;
      case 37496:
        return r ? we.ETC2RGBA8UnormSRGB : we.ETC2RGBA8Unorm;
    }
    switch (e) {
      case 3:
        switch (t) {
          case 6:
            return we.R8Snorm;
          case 7:
            return we.RG8Snorm;
          case 4:
            throw "RGB format not supported in WebGPU";
          case 8:
            return we.R8Sint;
          case 9:
            return we.RG8Sint;
          case 10:
            throw "RGB_INTEGER format not supported in WebGPU";
          case 11:
            return we.RGBA8Sint;
          default:
            return we.RGBA8Snorm;
        }
      case 0:
        switch (t) {
          case 6:
            return we.R8Unorm;
          case 7:
            return we.RG8Unorm;
          case 4:
            throw "TEXTUREFORMAT_RGB format not supported in WebGPU";
          case 5:
            return r ? we.RGBA8UnormSRGB : we.RGBA8Unorm;
          case 12:
            return r ? we.BGRA8UnormSRGB : we.BGRA8Unorm;
          case 8:
            return we.R8Uint;
          case 9:
            return we.RG8Uint;
          case 10:
            throw "RGB_INTEGER format not supported in WebGPU";
          case 11:
            return we.RGBA8Uint;
          case 0:
            throw "TEXTUREFORMAT_ALPHA format not supported in WebGPU";
          case 1:
            throw "TEXTUREFORMAT_LUMINANCE format not supported in WebGPU";
          case 2:
            throw "TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU";
          default:
            return we.RGBA8Unorm;
        }
      case 4:
        switch (t) {
          case 8:
            return we.R16Sint;
          case 9:
            return we.RG16Sint;
          case 10:
            throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
          case 11:
            return we.RGBA16Sint;
          default:
            return we.RGBA16Sint;
        }
      case 5:
        switch (t) {
          case 8:
            return we.R16Uint;
          case 9:
            return we.RG16Uint;
          case 10:
            throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
          case 11:
            return we.RGBA16Uint;
          default:
            return we.RGBA16Uint;
        }
      case 6:
        switch (t) {
          case 8:
            return we.R32Sint;
          case 9:
            return we.RG32Sint;
          case 10:
            throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
          case 11:
            return we.RGBA32Sint;
          default:
            return we.RGBA32Sint;
        }
      case 7:
        switch (t) {
          case 8:
            return we.R32Uint;
          case 9:
            return we.RG32Uint;
          case 10:
            throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
          case 11:
            return we.RGBA32Uint;
          default:
            return we.RGBA32Uint;
        }
      case 1:
        switch (t) {
          case 6:
            return we.R32Float;
          case 7:
            return we.RG32Float;
          case 4:
            throw "TEXTUREFORMAT_RGB format not supported in WebGPU";
          case 5:
            return we.RGBA32Float;
          default:
            return we.RGBA32Float;
        }
      case 2:
        switch (t) {
          case 6:
            return we.R16Float;
          case 7:
            return we.RG16Float;
          case 4:
            throw "TEXTUREFORMAT_RGB format not supported in WebGPU";
          case 5:
            return we.RGBA16Float;
          default:
            return we.RGBA16Float;
        }
      case 10:
        throw "TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU";
      case 13:
        switch (t) {
          case 5:
            return we.RG11B10UFloat;
          case 11:
            throw "TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV";
          default:
            return we.RG11B10UFloat;
        }
      case 14:
        switch (t) {
          case 5:
            return we.RGB9E5UFloat;
          case 11:
            throw "TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV";
          default:
            return we.RGB9E5UFloat;
        }
      case 8:
        throw "TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU";
      case 9:
        throw "TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU";
      case 11:
        switch (t) {
          case 5:
            return we.RGB10A2Unorm;
          case 11:
            return we.RGB10A2UINT;
          default:
            return we.RGB10A2Unorm;
        }
    }
    return r ? we.RGBA8UnormSRGB : we.RGBA8Unorm;
  }
  static GetNumChannelsFromWebGPUTextureFormat(e) {
    switch (e) {
      case we.R8Unorm:
      case we.R8Snorm:
      case we.R8Uint:
      case we.R8Sint:
      case we.BC4RUnorm:
      case we.BC4RSnorm:
      case we.R16Uint:
      case we.R16Sint:
      case we.Depth16Unorm:
      case we.R16Float:
      case we.R32Uint:
      case we.R32Sint:
      case we.R32Float:
      case we.Depth32Float:
      case we.Stencil8:
      case we.Depth24Plus:
      case we.EACR11Unorm:
      case we.EACR11Snorm:
        return 1;
      case we.RG8Unorm:
      case we.RG8Snorm:
      case we.RG8Uint:
      case we.RG8Sint:
      case we.Depth32FloatStencil8:
      case we.BC5RGUnorm:
      case we.BC5RGSnorm:
      case we.RG16Uint:
      case we.RG16Sint:
      case we.RG16Float:
      case we.RG32Uint:
      case we.RG32Sint:
      case we.RG32Float:
      case we.Depth24PlusStencil8:
      case we.EACRG11Unorm:
      case we.EACRG11Snorm:
        return 2;
      case we.RGB9E5UFloat:
      case we.RG11B10UFloat:
      case we.BC6HRGBUFloat:
      case we.BC6HRGBFloat:
      case we.ETC2RGB8Unorm:
      case we.ETC2RGB8UnormSRGB:
        return 3;
      case we.RGBA8Unorm:
      case we.RGBA8UnormSRGB:
      case we.RGBA8Snorm:
      case we.RGBA8Uint:
      case we.RGBA8Sint:
      case we.BGRA8Unorm:
      case we.BGRA8UnormSRGB:
      case we.RGB10A2UINT:
      case we.RGB10A2Unorm:
      case we.BC7RGBAUnorm:
      case we.BC7RGBAUnormSRGB:
      case we.BC3RGBAUnorm:
      case we.BC3RGBAUnormSRGB:
      case we.BC2RGBAUnorm:
      case we.BC2RGBAUnormSRGB:
      case we.BC1RGBAUnorm:
      case we.BC1RGBAUnormSRGB:
      case we.RGBA16Uint:
      case we.RGBA16Sint:
      case we.RGBA16Float:
      case we.RGBA32Uint:
      case we.RGBA32Sint:
      case we.RGBA32Float:
      case we.ETC2RGB8A1Unorm:
      case we.ETC2RGB8A1UnormSRGB:
      case we.ETC2RGBA8Unorm:
      case we.ETC2RGBA8UnormSRGB:
      case we.ASTC4x4Unorm:
      case we.ASTC4x4UnormSRGB:
      case we.ASTC5x4Unorm:
      case we.ASTC5x4UnormSRGB:
      case we.ASTC5x5Unorm:
      case we.ASTC5x5UnormSRGB:
      case we.ASTC6x5Unorm:
      case we.ASTC6x5UnormSRGB:
      case we.ASTC6x6Unorm:
      case we.ASTC6x6UnormSRGB:
      case we.ASTC8x5Unorm:
      case we.ASTC8x5UnormSRGB:
      case we.ASTC8x6Unorm:
      case we.ASTC8x6UnormSRGB:
      case we.ASTC8x8Unorm:
      case we.ASTC8x8UnormSRGB:
      case we.ASTC10x5Unorm:
      case we.ASTC10x5UnormSRGB:
      case we.ASTC10x6Unorm:
      case we.ASTC10x6UnormSRGB:
      case we.ASTC10x8Unorm:
      case we.ASTC10x8UnormSRGB:
      case we.ASTC10x10Unorm:
      case we.ASTC10x10UnormSRGB:
      case we.ASTC12x10Unorm:
      case we.ASTC12x10UnormSRGB:
      case we.ASTC12x12Unorm:
      case we.ASTC12x12UnormSRGB:
        return 4;
    }
    throw `Unknown format ${e}!`;
  }
  static HasStencilAspect(e) {
    switch (e) {
      case we.Stencil8:
      case we.Depth32FloatStencil8:
      case we.Depth24PlusStencil8:
        return !0;
    }
    return !1;
  }
  static HasDepthAndStencilAspects(e) {
    switch (e) {
      case we.Depth32FloatStencil8:
      case we.Depth24PlusStencil8:
        return !0;
    }
    return !1;
  }
  static GetDepthFormatOnly(e) {
    switch (e) {
      case we.Depth16Unorm:
        return we.Depth16Unorm;
      case we.Depth24Plus:
        return we.Depth24Plus;
      case we.Depth24PlusStencil8:
        return we.Depth24Plus;
      case we.Depth32Float:
        return we.Depth32Float;
      case we.Depth32FloatStencil8:
        return we.Depth32Float;
    }
    return e;
  }
  static GetSample(e) {
    return e > 1 ? 4 : 1;
  }
  copyVideoToTexture(e, t, r, n = !1, i) {
    var s, a, f, o;
    const d = i === void 0, [v, u] = this._getVideoPipeline(r, n ? QW.InvertY : QW.DontInvertY);
    d && (i = this._device.createCommandEncoder({})), (a = (s = i).pushDebugGroup) === null || a === void 0 || a.call(s, `copy video to texture - invertY=${n}`);
    const P = {
      colorAttachments: [
        {
          view: t._hardwareTexture.underlyingResource.createView({
            format: r,
            dimension: Da.E2d,
            mipLevelCount: 1,
            baseArrayLayer: 0,
            baseMipLevel: 0,
            arrayLayerCount: 1,
            aspect: zH.All
          }),
          loadOp: f9.Load,
          storeOp: Hc.Store
        }
      ]
    }, p = i.beginRenderPass(P), c = {
      layout: u,
      entries: [
        {
          binding: 0,
          resource: this._videoSampler
        },
        {
          binding: 1,
          resource: this._device.importExternalTexture({
            source: e.underlyingResource
          })
        }
      ]
    }, H = this._device.createBindGroup(c);
    p.setPipeline(v), p.setBindGroup(0, H), p.draw(4, 1, 0, 0), p.end(), (o = (f = i).popDebugGroup) === null || o === void 0 || o.call(f), d && (this._device.queue.submit([i.finish()]), i = null);
  }
  invertYPreMultiplyAlpha(e, t, r, n, i = !1, s = !1, a = 0, f = 0, o = 1, d = 0, v = 0, u = 0, l = 0, P, p) {
    var c, H, T, q, b, j;
    const w = u !== 0, m = P === void 0, [I, N] = this._getPipeline(n, w ? H0.InvertYPremultiplyAlphaWithOfst : H0.InvertYPremultiplyAlpha, {
      invertY: i,
      premultiplyAlpha: s
    });
    a = Math.max(a, 0), m && (P = this._device.createCommandEncoder({})), (H = (c = P).pushDebugGroup) === null || H === void 0 || H.call(c, `internal process texture - invertY=${i} premultiplyAlpha=${s}`);
    let k;
    if (Ns._IsHardwareTexture(e) ? (k = e.underlyingResource, i && !s && o === 1 && a === 0 || (e = void 0)) : (k = e, e = void 0), !k)
      return;
    w && this._bufferManager.setRawData(this._ubCopyWithOfst, 0, new Float32Array([d, v, u, l]), 0, 4 * 4);
    const R = e, y = (T = R == null ? void 0 : R._copyInvertYTempTexture) !== null && T !== void 0 ? T : this.createTexture({ width: t, height: r, layers: 1 }, !1, !1, !1, !1, !1, n, 1, P, Po.CopySrc | Po.RenderAttachment | Po.TextureBinding, void 0, "TempTextureForCopyWithInvertY"), O = (q = R == null ? void 0 : R._copyInvertYRenderPassDescr) !== null && q !== void 0 ? q : {
      colorAttachments: [
        {
          view: y.createView({
            format: n,
            dimension: Da.E2d,
            baseMipLevel: 0,
            mipLevelCount: 1,
            arrayLayerCount: 1,
            baseArrayLayer: 0
          }),
          loadOp: f9.Load,
          storeOp: Hc.Store
        }
      ]
    }, Y = P.beginRenderPass(O);
    let ee = w ? R == null ? void 0 : R._copyInvertYBindGroupWithOfst : R == null ? void 0 : R._copyInvertYBindGroup;
    if (!ee) {
      const Z = {
        layout: N,
        entries: [
          {
            binding: 0,
            resource: k.createView({
              format: n,
              dimension: Da.E2d,
              baseMipLevel: f,
              mipLevelCount: 1,
              arrayLayerCount: o,
              baseArrayLayer: a
            })
          }
        ]
      };
      w && Z.entries.push({
        binding: 1,
        resource: {
          buffer: this._ubCopyWithOfst
        }
      }), ee = this._device.createBindGroup(Z);
    }
    Y.setPipeline(I), Y.setBindGroup(0, ee), Y.draw(4, 1, 0, 0), Y.end(), P.copyTextureToTexture({
      texture: y
    }, {
      texture: k,
      mipLevel: f,
      origin: {
        x: 0,
        y: 0,
        z: a
      }
    }, {
      width: t,
      height: r,
      depthOrArrayLayers: 1
    }), R ? (R._copyInvertYTempTexture = y, R._copyInvertYRenderPassDescr = O, w ? R._copyInvertYBindGroupWithOfst = ee : R._copyInvertYBindGroup = ee) : this._deferredReleaseTextures.push([y, null]), (j = (b = P).popDebugGroup) === null || j === void 0 || j.call(b), m && (this._device.queue.submit([P.finish()]), P = null);
  }
  copyWithInvertY(e, t, r, n) {
    var i, s, a, f;
    const o = n === void 0, [d, v] = this._getPipeline(t, H0.InvertYPremultiplyAlpha, { invertY: !0, premultiplyAlpha: !1 });
    o && (n = this._device.createCommandEncoder({})), (s = (i = n).pushDebugGroup) === null || s === void 0 || s.call(i, "internal copy texture with invertY");
    const u = n.beginRenderPass(r), l = this._device.createBindGroup({
      layout: v,
      entries: [
        {
          binding: 0,
          resource: e
        }
      ]
    });
    u.setPipeline(d), u.setBindGroup(0, l), u.draw(4, 1, 0, 0), u.end(), (f = (a = n).popDebugGroup) === null || f === void 0 || f.call(a), o && (this._device.queue.submit([n.finish()]), n = null);
  }
  //------------------------------------------------------------------------------
  //                               Creation
  //------------------------------------------------------------------------------
  createTexture(e, t = !1, r = !1, n = !1, i = !1, s = !1, a = we.RGBA8Unorm, f = 1, o, d = -1, v = 0, u) {
    f = Ns.GetSample(f);
    const l = e.layers || 1, P = {
      width: e.width,
      height: e.height,
      depthOrArrayLayers: l
    }, p = F2[a] ? Po.RenderAttachment : 0, c = Ns.IsCompressedFormat(a), H = t ? Ns.ComputeNumMipmapLevels(e.width, e.height) : 1, T = d >= 0 ? d : Po.CopySrc | Po.CopyDst | Po.TextureBinding;
    v |= t && !c ? Po.CopySrc | p : 0, !c && !s && (v |= p | Po.CopyDst);
    const q = this._device.createTexture({
      label: `Texture${s ? "3D" : "2D"}_${u ? u + "_" : ""}${P.width}x${P.height}x${P.depthOrArrayLayers}_${t ? "wmips" : "womips"}_${a}_samples${f}`,
      size: P,
      dimension: s ? Hp.E3d : Hp.E2d,
      format: a,
      usage: T | v,
      sampleCount: f,
      mipLevelCount: H
    });
    return Ns.IsImageBitmap(e) && (this.updateTexture(e, q, e.width, e.height, l, a, 0, 0, n, i, 0, 0), t && r && this.generateMipmaps(q, a, H, 0, o)), q;
  }
  createCubeTexture(e, t = !1, r = !1, n = !1, i = !1, s = we.RGBA8Unorm, a = 1, f, o = -1, d = 0, v) {
    a = Ns.GetSample(a);
    const u = Ns.IsImageBitmapArray(e) ? e[0].width : e.width, l = Ns.IsImageBitmapArray(e) ? e[0].height : e.height, P = F2[s] ? Po.RenderAttachment : 0, p = Ns.IsCompressedFormat(s), c = t ? Ns.ComputeNumMipmapLevels(u, l) : 1, H = o >= 0 ? o : Po.CopySrc | Po.CopyDst | Po.TextureBinding;
    d |= t && !p ? Po.CopySrc | P : 0, p || (d |= P | Po.CopyDst);
    const T = this._device.createTexture({
      label: `TextureCube_${v ? v + "_" : ""}${u}x${l}x6_${t ? "wmips" : "womips"}_${s}_samples${a}`,
      size: {
        width: u,
        height: l,
        depthOrArrayLayers: 6
      },
      dimension: Hp.E2d,
      format: s,
      usage: H | d,
      sampleCount: a,
      mipLevelCount: c
    });
    return Ns.IsImageBitmapArray(e) && (this.updateCubeTextures(e, T, u, l, s, n, i, 0, 0), t && r && this.generateCubeMipmaps(T, s, c, f)), T;
  }
  generateCubeMipmaps(e, t, r, n) {
    var i, s, a, f;
    const o = n === void 0;
    o && (n = this._device.createCommandEncoder({})), (s = (i = n).pushDebugGroup) === null || s === void 0 || s.call(i, `create cube mipmaps - ${r} levels`);
    for (let d = 0; d < 6; ++d)
      this.generateMipmaps(e, t, r, d, n);
    (f = (a = n).popDebugGroup) === null || f === void 0 || f.call(a), o && (this._device.queue.submit([n.finish()]), n = null);
  }
  generateMipmaps(e, t, r, n = 0, i) {
    var s, a, f, o, d, v, u, l;
    const P = i === void 0, [p, c] = this._getPipeline(t);
    n = Math.max(n, 0), P && (i = this._device.createCommandEncoder({})), (a = (s = i).pushDebugGroup) === null || a === void 0 || a.call(s, `create mipmaps for face #${n} - ${r} levels`);
    let H;
    if (Ns._IsHardwareTexture(e) ? (H = e.underlyingResource, e._mipmapGenRenderPassDescr = e._mipmapGenRenderPassDescr || [], e._mipmapGenBindGroup = e._mipmapGenBindGroup || []) : (H = e, e = void 0), !H)
      return;
    const T = e;
    for (let q = 1; q < r; ++q) {
      const b = (o = (f = T == null ? void 0 : T._mipmapGenRenderPassDescr[n]) === null || f === void 0 ? void 0 : f[q - 1]) !== null && o !== void 0 ? o : {
        colorAttachments: [
          {
            view: H.createView({
              format: t,
              dimension: Da.E2d,
              baseMipLevel: q,
              mipLevelCount: 1,
              arrayLayerCount: 1,
              baseArrayLayer: n
            }),
            loadOp: f9.Load,
            storeOp: Hc.Store
          }
        ]
      };
      T && (T._mipmapGenRenderPassDescr[n] = T._mipmapGenRenderPassDescr[n] || [], T._mipmapGenRenderPassDescr[n][q - 1] = b);
      const j = i.beginRenderPass(b), w = (v = (d = T == null ? void 0 : T._mipmapGenBindGroup[n]) === null || d === void 0 ? void 0 : d[q - 1]) !== null && v !== void 0 ? v : this._device.createBindGroup({
        layout: c,
        entries: [
          {
            binding: 0,
            resource: this._mipmapSampler
          },
          {
            binding: 1,
            resource: H.createView({
              format: t,
              dimension: Da.E2d,
              baseMipLevel: q - 1,
              mipLevelCount: 1,
              arrayLayerCount: 1,
              baseArrayLayer: n
            })
          }
        ]
      });
      T && (T._mipmapGenBindGroup[n] = T._mipmapGenBindGroup[n] || [], T._mipmapGenBindGroup[n][q - 1] = w), j.setPipeline(p), j.setBindGroup(0, w), j.draw(4, 1, 0, 0), j.end();
    }
    (l = (u = i).popDebugGroup) === null || l === void 0 || l.call(u), P && (this._device.queue.submit([i.finish()]), i = null);
  }
  createGPUTextureForInternalTexture(e, t, r, n, i) {
    e._hardwareTexture || (e._hardwareTexture = new DC()), t === void 0 && (t = e.width), r === void 0 && (r = e.height), n === void 0 && (n = e.depth);
    const s = e._hardwareTexture, a = ((i ?? 0) & 1) !== 0;
    s.format = Ns.GetWebGPUTextureFormat(e.type, e.format, e._useSRGBBuffer), s.textureUsages = e._source === ri.RenderTarget || e.source === ri.MultiRenderTarget ? Po.TextureBinding | Po.CopySrc | Po.RenderAttachment : e._source === ri.DepthStencil ? Po.TextureBinding | Po.RenderAttachment : -1, s.textureAdditionalUsages = a ? Po.StorageBinding : 0;
    const f = e.generateMipMaps, o = n || 1;
    let d;
    if (e._maxLodLevel !== null ? d = e._maxLodLevel : d = f ? Ns.ComputeNumMipmapLevels(t, r) : 1, e.isCube) {
      const v = this.createCubeTexture({ width: t, height: r }, e.generateMipMaps, e.generateMipMaps, e.invertY, !1, s.format, 1, this._commandEncoderForCreation, s.textureUsages, s.textureAdditionalUsages, e.label);
      s.set(v), s.createView({
        format: Ns.GetDepthFormatOnly(s.format),
        dimension: Da.Cube,
        mipLevelCount: d,
        baseArrayLayer: 0,
        baseMipLevel: 0,
        arrayLayerCount: 6,
        aspect: Ns.HasDepthAndStencilAspects(s.format) ? zH.DepthOnly : zH.All
      }, a);
    } else {
      const v = this.createTexture({ width: t, height: r, layers: o }, e.generateMipMaps, e.generateMipMaps, e.invertY, !1, e.is3D, s.format, 1, this._commandEncoderForCreation, s.textureUsages, s.textureAdditionalUsages, e.label);
      s.set(v), s.createView({
        format: Ns.GetDepthFormatOnly(s.format),
        dimension: e.is2DArray ? Da.E2dArray : e.is3D ? Hp.E3d : Da.E2d,
        mipLevelCount: d,
        baseArrayLayer: 0,
        baseMipLevel: 0,
        arrayLayerCount: e.is3D ? 1 : o,
        aspect: Ns.HasDepthAndStencilAspects(s.format) ? zH.DepthOnly : zH.All
      }, a);
    }
    return e.width = e.baseWidth = t, e.height = e.baseHeight = r, e.depth = e.baseDepth = n, this.createMSAATexture(e, e.samples), s;
  }
  createMSAATexture(e, t, r = !0, n = -1) {
    const i = e._hardwareTexture;
    if (r && (i == null || i.releaseMSAATexture()), !i || (t ?? 1) <= 1)
      return;
    const s = e.width, a = e.height, f = this.createTexture({ width: s, height: a, layers: 1 }, !1, !1, !1, !1, !1, i.format, t, this._commandEncoderForCreation, Po.RenderAttachment, 0, e.label ? "MSAA" + e.label : void 0);
    i.setMSAATexture(f, n);
  }
  //------------------------------------------------------------------------------
  //                                  Update
  //------------------------------------------------------------------------------
  updateCubeTextures(e, t, r, n, i, s = !1, a = !1, f = 0, o = 0) {
    const d = [0, 3, 1, 4, 2, 5];
    for (let v = 0; v < d.length; ++v) {
      const u = e[d[v]];
      this.updateTexture(u, t, r, n, 1, i, v, 0, s, a, f, o);
    }
  }
  // TODO WEBGPU handle data source not being in the same format than the destination texture?
  updateTexture(e, t, r, n, i, s, a = 0, f = 0, o = !1, d = !1, v = 0, u = 0, l) {
    const P = Ns._IsInternalTexture(t) ? t._hardwareTexture.underlyingResource : t, p = Ns._GetBlockInformationFromFormat(s), c = Ns._IsInternalTexture(t) ? t._hardwareTexture : t, H = {
      texture: P,
      origin: {
        x: v,
        y: u,
        z: Math.max(a, 0)
      },
      mipLevel: f,
      premultipliedAlpha: d
    }, T = {
      width: Math.ceil(r / p.width) * p.width,
      height: Math.ceil(n / p.height) * p.height,
      depthOrArrayLayers: i || 1
    };
    if (e.byteLength !== void 0) {
      e = e;
      const q = Math.ceil(r / p.width) * p.length;
      if (Math.ceil(q / 256) * 256 === q) {
        const j = this._device.createCommandEncoder({}), w = this._bufferManager.createRawBuffer(e.byteLength, ga.MapWrite | ga.CopySrc, !0, "TempBufferForUpdateTexture" + (P ? "_" + P.label : "")), m = w.getMappedRange();
        new Uint8Array(m).set(e), w.unmap(), j.copyBufferToTexture({
          buffer: w,
          offset: 0,
          bytesPerRow: q,
          rowsPerImage: n
        }, H, T), this._device.queue.submit([j.finish()]), this._bufferManager.releaseBuffer(w);
      } else
        this._device.queue.writeTexture(H, e, {
          offset: 0,
          bytesPerRow: q,
          rowsPerImage: n
        }, T);
      if (o || d)
        if (Ns._IsInternalTexture(t)) {
          const j = v === 0 && u === 0 && r === t.width && n === t.height;
          this.invertYPreMultiplyAlpha(c, t.width, t.height, s, o, d, a, f, i || 1, v, u, j ? 0 : r, j ? 0 : n, void 0, l);
        } else
          throw "updateTexture: Can't process the texture data because a GPUTexture was provided instead of an InternalTexture!";
    } else if (e = e, o)
      if (H.premultipliedAlpha = !1, Ns._IsInternalTexture(t) && v === 0 && u === 0 && r === t.width && n === t.height)
        this._device.queue.copyExternalImageToTexture({ source: e }, H, T), this.invertYPreMultiplyAlpha(c, r, n, s, o, d, a, f, i || 1, 0, 0, 0, 0, void 0, l);
      else {
        const q = this._device.createCommandEncoder({}), b = this.createTexture({ width: r, height: n, layers: 1 }, !1, !1, !1, !1, !1, s, 1, q, Po.CopySrc | Po.TextureBinding, void 0, "TempTextureForUpdateTexture");
        this._deferredReleaseTextures.push([b, null]), T.depthOrArrayLayers = 1, this._device.queue.copyExternalImageToTexture({ source: e }, { texture: b }, T), T.depthOrArrayLayers = i || 1, this.invertYPreMultiplyAlpha(b, r, n, s, o, d, a, f, i || 1, 0, 0, 0, 0, q, l), q.copyTextureToTexture({ texture: b }, H, T), this._device.queue.submit([q.finish()]);
      }
    else
      this._device.queue.copyExternalImageToTexture({ source: e }, H, T);
  }
  readPixels(e, t, r, n, i, s, a = 0, f = 0, o = null, d = !1) {
    const v = Ns._GetBlockInformationFromFormat(s), u = Math.ceil(n / v.width) * v.length, l = Math.ceil(u / 256) * 256, P = l * i, p = this._bufferManager.createRawBuffer(P, ga.MapRead | ga.CopyDst, void 0, "TempBufferForReadPixels" + (e.label ? "_" + e.label : "")), c = this._device.createCommandEncoder({});
    return c.copyTextureToBuffer({
      texture: e,
      mipLevel: f,
      origin: {
        x: t,
        y: r,
        z: Math.max(a, 0)
      }
    }, {
      buffer: p,
      offset: 0,
      bytesPerRow: l
    }, {
      width: n,
      height: i,
      depthOrArrayLayers: 1
    }), this._device.queue.submit([c.finish()]), this._bufferManager.readDataFromBuffer(p, P, n, i, u, l, Ns.GetTextureTypeFromFormat(s), 0, o, !0, d);
  }
  //------------------------------------------------------------------------------
  //                              Dispose
  //------------------------------------------------------------------------------
  releaseTexture(e) {
    if (Ns._IsInternalTexture(e)) {
      const t = e._hardwareTexture, r = e._irradianceTexture;
      this._deferredReleaseTextures.push([t, r]);
    } else
      this._deferredReleaseTextures.push([e, null]);
  }
  destroyDeferredTextures() {
    for (let e = 0; e < this._deferredReleaseTextures.length; ++e) {
      const [t, r] = this._deferredReleaseTextures[e];
      t && (Ns._IsHardwareTexture(t) ? t.release() : t.destroy()), r == null || r.dispose();
    }
    this._deferredReleaseTextures.length = 0;
  }
}
class qte extends tg {
  constructor(e, t = 0) {
    super(), this.capacity = t, this._buffer = e;
  }
  get underlyingResource() {
    return this._buffer;
  }
}
class tO {
  static _IsGPUBuffer(e) {
    return e.underlyingResource === void 0;
  }
  static _FlagsToString(e, t = "") {
    let r = t;
    for (let n = 0; n <= 9; ++n)
      e & 1 << n && (r && (r += "_"), r += ga[1 << n]);
    return r;
  }
  constructor(e) {
    this._deferredReleaseBuffers = [], this._device = e;
  }
  createRawBuffer(e, t, r = !1, n) {
    const i = e.byteLength !== void 0 ? e.byteLength + 3 & -4 : e + 3 & -4, s = {
      label: tO._FlagsToString(t, n ?? "Buffer") + "_size" + i,
      mappedAtCreation: r,
      size: i,
      usage: t
    };
    return this._device.createBuffer(s);
  }
  createBuffer(e, t, r) {
    const n = e.byteLength !== void 0, i = this.createRawBuffer(e, t, void 0, r), s = new qte(i);
    return s.references = 1, s.capacity = n ? e.byteLength : e, n && this.setSubData(s, 0, e), s;
  }
  setRawData(e, t, r, n, i) {
    this._device.queue.writeBuffer(e, t, r.buffer, n, i);
  }
  setSubData(e, t, r, n = 0, i = 0) {
    const s = e.underlyingResource;
    i = i || r.byteLength, i = Math.min(i, e.capacity - t);
    let a = r.byteOffset + n, f = a + i;
    const o = i + 3 & -4;
    if (o !== i) {
      const u = new Uint8Array(r.buffer.slice(a, f));
      r = new Uint8Array(o), r.set(u), n = 0, a = 0, f = o, i = o;
    }
    const d = 1024 * 1024 * 15;
    let v = 0;
    for (; f - (a + v) > d; )
      this._device.queue.writeBuffer(s, t + v, r.buffer, a + v, d), v += d;
    this._device.queue.writeBuffer(s, t + v, r.buffer, a + v, i - v);
  }
  _getHalfFloatAsFloatRGBAArrayBuffer(e, t, r) {
    r || (r = new Float32Array(e));
    const n = new Uint16Array(t);
    for (; e--; )
      r[e] = QH(n[e]);
    return r;
  }
  readDataFromBuffer(e, t, r, n, i, s, a = 0, f = 0, o = null, d = !0, v = !1) {
    const u = a === 1 ? 2 : a === 2 ? 1 : 0;
    return new Promise((l, P) => {
      e.mapAsync(vD.Read, f, t).then(() => {
        const p = e.getMappedRange(f, t);
        let c = o;
        if (v)
          c === null ? c = KC(a, t, !0, p) : c = KC(a, c.buffer, void 0, p);
        else if (c === null)
          switch (u) {
            case 0:
              c = new Uint8Array(t), c.set(new Uint8Array(p));
              break;
            case 1:
              c = this._getHalfFloatAsFloatRGBAArrayBuffer(t / 2, p);
              break;
            case 2:
              c = new Float32Array(t / 4), c.set(new Float32Array(p));
              break;
          }
        else
          switch (u) {
            case 0:
              c = new Uint8Array(c.buffer), c.set(new Uint8Array(p));
              break;
            case 1:
              c = this._getHalfFloatAsFloatRGBAArrayBuffer(t / 2, p, o);
              break;
            case 2:
              c = new Float32Array(c.buffer), c.set(new Float32Array(p));
              break;
          }
        if (i !== s) {
          u === 1 && !v && (i *= 2, s *= 2);
          const H = new Uint8Array(c.buffer);
          let T = i, q = 0;
          for (let b = 1; b < n; ++b) {
            q = b * s;
            for (let j = 0; j < i; ++j)
              H[T++] = H[q++];
          }
          u !== 0 && !v ? c = new Float32Array(H.buffer, 0, T / 4) : c = new Uint8Array(H.buffer, 0, T);
        }
        e.unmap(), d && this.releaseBuffer(e), l(c);
      }, (p) => P(p));
    });
  }
  releaseBuffer(e) {
    return tO._IsGPUBuffer(e) ? (this._deferredReleaseBuffers.push(e), !0) : (e.references--, e.references === 0 ? (this._deferredReleaseBuffers.push(e.underlyingResource), !0) : !1);
  }
  destroyDeferredBuffers() {
    for (let e = 0; e < this._deferredReleaseBuffers.length; ++e)
      this._deferredReleaseBuffers[e].destroy();
    this._deferredReleaseBuffers.length = 0;
  }
}
const Dle = [
  0,
  0,
  3,
  7,
  0,
  2,
  6,
  2,
  4,
  1,
  5,
  3,
  1
  // TEXTURE_LINEAR_NEAREST
], jle = [
  0,
  64,
  32,
  96,
  16,
  80,
  48,
  112,
  8
  // ALWAYS
], wle = [
  0,
  128,
  128,
  0,
  0,
  0,
  0,
  128,
  0,
  0,
  0,
  0,
  128
  // TEXTURE_LINEAR_NEAREST
];
class rD {
  constructor(e) {
    this._samplers = {}, this._device = e, this.disabled = !1;
  }
  static GetSamplerHashCode(e) {
    var t, r, n;
    const i = e._cachedAnisotropicFilteringLevel && e._cachedAnisotropicFilteringLevel > 1 ? 4 : 1;
    return Dle[e.samplingMode] + jle[(e._comparisonFunction || 514) - 512 + 1] + wle[e.samplingMode] + // handle the lodMinClamp = lodMaxClamp = 0 case when no filter used for mip mapping
    (((t = e._cachedWrapU) !== null && t !== void 0 ? t : 1) << 8) + (((r = e._cachedWrapV) !== null && r !== void 0 ? r : 1) << 10) + (((n = e._cachedWrapR) !== null && n !== void 0 ? n : 1) << 12) + ((e.useMipMaps ? 1 : 0) << 14) + // need to factor this in because _getSamplerFilterDescriptor depends on samplingMode AND useMipMaps!
    (i << 15);
  }
  static _GetSamplerFilterDescriptor(e, t) {
    let r, n, i, s, a;
    const f = e.useMipMaps;
    switch (e.samplingMode) {
      case 11:
        r = Ji.Linear, n = Ji.Linear, i = Ji.Nearest, f || (s = a = 0);
        break;
      case 3:
      case 3:
        r = Ji.Linear, n = Ji.Linear, f ? i = Ji.Linear : (i = Ji.Nearest, s = a = 0);
        break;
      case 8:
        r = Ji.Nearest, n = Ji.Nearest, f ? i = Ji.Linear : (i = Ji.Nearest, s = a = 0);
        break;
      case 4:
        r = Ji.Nearest, n = Ji.Nearest, i = Ji.Nearest, f || (s = a = 0);
        break;
      case 5:
        r = Ji.Nearest, n = Ji.Linear, i = Ji.Nearest, f || (s = a = 0);
        break;
      case 6:
        r = Ji.Nearest, n = Ji.Linear, f ? i = Ji.Linear : (i = Ji.Nearest, s = a = 0);
        break;
      case 7:
        r = Ji.Nearest, n = Ji.Linear, i = Ji.Nearest, s = a = 0;
        break;
      case 1:
      case 1:
        r = Ji.Nearest, n = Ji.Nearest, i = Ji.Nearest, s = a = 0;
        break;
      case 9:
        r = Ji.Linear, n = Ji.Nearest, i = Ji.Nearest, f || (s = a = 0);
        break;
      case 10:
        r = Ji.Linear, n = Ji.Nearest, f ? i = Ji.Linear : (i = Ji.Nearest, s = a = 0);
        break;
      case 2:
      case 2:
        r = Ji.Linear, n = Ji.Linear, i = Ji.Nearest, s = a = 0;
        break;
      case 12:
        r = Ji.Linear, n = Ji.Nearest, i = Ji.Nearest, s = a = 0;
        break;
      default:
        r = Ji.Nearest, n = Ji.Nearest, i = Ji.Nearest, s = a = 0;
        break;
    }
    return t > 1 && (s !== 0 || a !== 0) && i !== Ji.Nearest ? {
      magFilter: Ji.Linear,
      minFilter: Ji.Linear,
      mipmapFilter: Ji.Linear,
      anisotropyEnabled: !0
    } : {
      magFilter: r,
      minFilter: n,
      mipmapFilter: i,
      lodMinClamp: s,
      lodMaxClamp: a
    };
  }
  static _GetWrappingMode(e) {
    switch (e) {
      case 1:
        return zw.Repeat;
      case 0:
        return zw.ClampToEdge;
      case 2:
        return zw.MirrorRepeat;
    }
    return zw.Repeat;
  }
  static _GetSamplerWrappingDescriptor(e) {
    return {
      addressModeU: this._GetWrappingMode(e._cachedWrapU),
      addressModeV: this._GetWrappingMode(e._cachedWrapV),
      addressModeW: this._GetWrappingMode(e._cachedWrapR)
    };
  }
  static _GetSamplerDescriptor(e, t) {
    const r = e.useMipMaps && e._cachedAnisotropicFilteringLevel && e._cachedAnisotropicFilteringLevel > 1 ? 4 : 1, n = this._GetSamplerFilterDescriptor(e, r);
    return Object.assign(Object.assign(Object.assign({ label: t }, n), this._GetSamplerWrappingDescriptor(e)), { compare: e._comparisonFunction ? rD.GetCompareFunction(e._comparisonFunction) : void 0, maxAnisotropy: n.anisotropyEnabled ? r : 1 });
  }
  static GetCompareFunction(e) {
    switch (e) {
      case 519:
        return q6.Always;
      case 514:
        return q6.Equal;
      case 516:
        return q6.Greater;
      case 518:
        return q6.GreaterEqual;
      case 513:
        return q6.Less;
      case 515:
        return q6.LessEqual;
      case 512:
        return q6.Never;
      case 517:
        return q6.NotEqual;
      default:
        return q6.Less;
    }
  }
  getSampler(e, t = !1, r = 0, n) {
    if (this.disabled)
      return this._device.createSampler(rD._GetSamplerDescriptor(e, n));
    t ? r = 0 : r === 0 && (r = rD.GetSamplerHashCode(e));
    let i = t ? void 0 : this._samplers[r];
    return i || (i = this._device.createSampler(rD._GetSamplerDescriptor(e, n)), t || (this._samplers[r] = i)), i;
  }
}
var hf;
(function(A) {
  A[A.StencilReadMask = 0] = "StencilReadMask", A[A.StencilWriteMask = 1] = "StencilWriteMask", A[A.DepthBias = 2] = "DepthBias", A[A.DepthBiasSlopeScale = 3] = "DepthBiasSlopeScale", A[A.DepthStencilState = 4] = "DepthStencilState", A[A.MRTAttachments1 = 5] = "MRTAttachments1", A[A.MRTAttachments2 = 6] = "MRTAttachments2", A[A.RasterizationState = 7] = "RasterizationState", A[A.ColorStates = 8] = "ColorStates", A[A.ShaderStage = 9] = "ShaderStage", A[A.TextureStage = 10] = "TextureStage", A[A.VertexState = 11] = "VertexState", A[A.NumStates = 12] = "NumStates";
})(hf || (hf = {}));
const pC = {
  0: 1,
  1: 2,
  768: 3,
  769: 4,
  770: 5,
  771: 6,
  772: 7,
  773: 8,
  774: 9,
  775: 10,
  776: 11,
  32769: 12,
  32770: 13,
  32771: 12,
  32772: 13
  // OneMinusBlendColor (alpha)
}, SW = {
  0: 0,
  7680: 1,
  7681: 2,
  7682: 3,
  7683: 4,
  5386: 5,
  34055: 6,
  34056: 7
  // DECR_WRAP
}, mle = {
  [J.PositionKind]: !0,
  [J.NormalKind]: !0,
  [J.TangentKind]: !0,
  [J.UVKind]: !0,
  [J.UV2Kind]: !0,
  [J.UV3Kind]: !0,
  [J.UV4Kind]: !0,
  [J.UV5Kind]: !0,
  [J.UV6Kind]: !0,
  [J.ColorKind]: !0,
  [J.ColorInstanceKind]: !0,
  [J.MatricesIndicesKind]: !0,
  [J.MatricesWeightsKind]: !0,
  [J.MatricesIndicesExtraKind]: !0,
  [J.MatricesWeightsExtraKind]: !0
};
class co {
  static _IsSignedType(e) {
    switch (e) {
      case J.BYTE:
      case J.SHORT:
      case J.INT:
      case J.FLOAT:
        return !0;
      case J.UNSIGNED_BYTE:
      case J.UNSIGNED_SHORT:
      case J.UNSIGNED_INT:
        return !1;
      default:
        throw new Error(`Invalid type '${e}'`);
    }
  }
  constructor(e, t) {
    this.mrtTextureCount = 0, this._device = e, this._useTextureStage = !0, this._states = new Array(30), this._statesLength = 0, this._stateDirtyLowestIndex = 0, this._emptyVertexBuffer = t, this._mrtFormats = [], this._parameter = { token: void 0, pipeline: null }, this.disabled = !1, this.vertexBuffers = [], this._kMaxVertexBufferStride = e.limits.maxVertexBufferArrayStride || 2048, this.reset();
  }
  reset() {
    this._isDirty = !0, this.vertexBuffers.length = 0, this.setAlphaToCoverage(!1), this.resetDepthCullingState(), this.setClampDepth(!1), this.setDepthBias(0), this._webgpuColorFormat = [we.BGRA8Unorm], this.setColorFormat(we.BGRA8Unorm), this.setMRT([]), this.setAlphaBlendEnabled(!1), this.setAlphaBlendFactors([null, null, null, null], [null, null]), this.setWriteMask(15), this.setDepthStencilFormat(we.Depth24PlusStencil8), this.setStencilEnabled(!1), this.resetStencilState(), this.setBuffers(null, null, null), this._setTextureState(0);
  }
  get colorFormats() {
    return this._mrtAttachments1 > 0 ? this._mrtFormats : this._webgpuColorFormat;
  }
  getRenderPipeline(e, t, r, n = 0) {
    if (r = Ns.GetSample(r), this.disabled) {
      const s = co._GetTopology(e);
      return this._setVertexState(t), this._setTextureState(n), this._parameter.pipeline = this._createRenderPipeline(t, s, r), co.NumCacheMiss++, co._NumPipelineCreationCurrentFrame++, this._parameter.pipeline;
    }
    if (this._setShaderStage(t.uniqueId), this._setRasterizationState(e, r), this._setColorStates(), this._setDepthStencilState(), this._setVertexState(t), this._setTextureState(n), this.lastStateDirtyLowestIndex = this._stateDirtyLowestIndex, !this._isDirty && this._parameter.pipeline)
      return this._stateDirtyLowestIndex = this._statesLength, co.NumCacheHitWithoutHash++, this._parameter.pipeline;
    if (this._getRenderPipeline(this._parameter), this._isDirty = !1, this._stateDirtyLowestIndex = this._statesLength, this._parameter.pipeline)
      return co.NumCacheHitWithHash++, this._parameter.pipeline;
    const i = co._GetTopology(e);
    return this._parameter.pipeline = this._createRenderPipeline(t, i, r), this._setRenderPipeline(this._parameter), co.NumCacheMiss++, co._NumPipelineCreationCurrentFrame++, this._parameter.pipeline;
  }
  endFrame() {
    co.NumPipelineCreationLastFrame = co._NumPipelineCreationCurrentFrame, co._NumPipelineCreationCurrentFrame = 0;
  }
  setAlphaToCoverage(e) {
    this._alphaToCoverageEnabled = e;
  }
  setFrontFace(e) {
    this._frontFace = e;
  }
  setCullEnabled(e) {
    this._cullEnabled = e;
  }
  setCullFace(e) {
    this._cullFace = e;
  }
  setClampDepth(e) {
    this._clampDepth = e;
  }
  resetDepthCullingState() {
    this.setDepthCullingState(!1, 2, 1, 0, 0, !0, !0, 519);
  }
  setDepthCullingState(e, t, r, n, i, s, a, f) {
    this._depthWriteEnabled = a, this._depthTestEnabled = s, this._depthCompare = (f ?? 519) - 512, this._cullFace = r, this._cullEnabled = e, this._frontFace = t, this.setDepthBiasSlopeScale(n), this.setDepthBias(i);
  }
  setDepthBias(e) {
    this._depthBias !== e && (this._depthBias = e, this._states[hf.DepthBias] = e, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.DepthBias));
  }
  /*public setDepthBiasClamp(depthBiasClamp: number): void {
      if (this._depthBiasClamp !== depthBiasClamp) {
          this._depthBiasClamp = depthBiasClamp;
          this._states[StatePosition.DepthBiasClamp] = depthBiasClamp.toString();
          this._isDirty = true;
      }
  }*/
  setDepthBiasSlopeScale(e) {
    this._depthBiasSlopeScale !== e && (this._depthBiasSlopeScale = e, this._states[hf.DepthBiasSlopeScale] = e, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.DepthBiasSlopeScale));
  }
  setColorFormat(e) {
    this._webgpuColorFormat[0] = e, this._colorFormat = F2[e ?? ""];
  }
  setMRTAttachments(e) {
    this.mrtAttachments = e;
    let t = 0;
    for (let r = 0; r < e.length; ++r)
      e[r] !== 0 && (t += 1 << r);
    this._mrtEnabledMask !== t && (this._mrtEnabledMask = t, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.MRTAttachments1));
  }
  setMRT(e, t) {
    var r, n;
    if (t = t ?? e.length, t > 10)
      throw "Can't handle more than 10 attachments for a MRT in cache render pipeline!";
    this.mrtTextureArray = e, this.mrtTextureCount = t, this._mrtEnabledMask = 65535;
    const i = [0, 0];
    let s = 0, a = 0, f = 0;
    for (let o = 0; o < t; ++o) {
      const d = e[o], v = d == null ? void 0 : d._hardwareTexture;
      this._mrtFormats[f] = (r = v == null ? void 0 : v.format) !== null && r !== void 0 ? r : this._webgpuColorFormat[0], i[s] += F2[(n = this._mrtFormats[f]) !== null && n !== void 0 ? n : ""] << a, a += 6, f++, a >= 32 && (a = 0, s++);
    }
    this._mrtFormats.length = f, (this._mrtAttachments1 !== i[0] || this._mrtAttachments2 !== i[1]) && (this._mrtAttachments1 = i[0], this._mrtAttachments2 = i[1], this._states[hf.MRTAttachments1] = i[0], this._states[hf.MRTAttachments2] = i[1], this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.MRTAttachments1));
  }
  setAlphaBlendEnabled(e) {
    this._alphaBlendEnabled = e;
  }
  setAlphaBlendFactors(e, t) {
    this._alphaBlendFuncParams = e, this._alphaBlendEqParams = t;
  }
  setWriteMask(e) {
    this._writeMask = e;
  }
  setDepthStencilFormat(e) {
    this._webgpuDepthStencilFormat = e, this._depthStencilFormat = e === void 0 ? 0 : F2[e];
  }
  setDepthTestEnabled(e) {
    this._depthTestEnabled = e;
  }
  setDepthWriteEnabled(e) {
    this._depthWriteEnabled = e;
  }
  setDepthCompare(e) {
    this._depthCompare = (e ?? 519) - 512;
  }
  setStencilEnabled(e) {
    this._stencilEnabled = e;
  }
  setStencilCompare(e) {
    this._stencilFrontCompare = (e ?? 519) - 512;
  }
  setStencilDepthFailOp(e) {
    this._stencilFrontDepthFailOp = e === null ? 1 : SW[e];
  }
  setStencilPassOp(e) {
    this._stencilFrontPassOp = e === null ? 2 : SW[e];
  }
  setStencilFailOp(e) {
    this._stencilFrontFailOp = e === null ? 1 : SW[e];
  }
  setStencilReadMask(e) {
    this._stencilReadMask !== e && (this._stencilReadMask = e, this._states[hf.StencilReadMask] = e, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.StencilReadMask));
  }
  setStencilWriteMask(e) {
    this._stencilWriteMask !== e && (this._stencilWriteMask = e, this._states[hf.StencilWriteMask] = e, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.StencilWriteMask));
  }
  resetStencilState() {
    this.setStencilState(!1, 519, 7680, 7681, 7680, 255, 255);
  }
  setStencilState(e, t, r, n, i, s, a) {
    this._stencilEnabled = e, this._stencilFrontCompare = (t ?? 519) - 512, this._stencilFrontDepthFailOp = r === null ? 1 : SW[r], this._stencilFrontPassOp = n === null ? 2 : SW[n], this._stencilFrontFailOp = i === null ? 1 : SW[i], this.setStencilReadMask(s), this.setStencilWriteMask(a);
  }
  setBuffers(e, t, r) {
    this._vertexBuffers = e, this._overrideVertexBuffers = r, this._indexBuffer = t;
  }
  static _GetTopology(e) {
    switch (e) {
      case 0:
        return Fl.TriangleList;
      case 2:
        return Fl.PointList;
      case 1:
        return Fl.LineList;
      case 3:
        return Fl.PointList;
      case 4:
        return Fl.LineList;
      case 5:
        throw "LineLoop is an unsupported fillmode in WebGPU";
      case 6:
        return Fl.LineStrip;
      case 7:
        return Fl.TriangleStrip;
      case 8:
        throw "TriangleFan is an unsupported fillmode in WebGPU";
      default:
        return Fl.TriangleList;
    }
  }
  static _GetAphaBlendOperation(e) {
    switch (e) {
      case 32774:
        return Z8.Add;
      case 32778:
        return Z8.Subtract;
      case 32779:
        return Z8.ReverseSubtract;
      case 32775:
        return Z8.Min;
      case 32776:
        return Z8.Max;
      default:
        return Z8.Add;
    }
  }
  static _GetAphaBlendFactor(e) {
    switch (e) {
      case 0:
        return ad.Zero;
      case 1:
        return ad.One;
      case 768:
        return ad.Src;
      case 769:
        return ad.OneMinusSrc;
      case 770:
        return ad.SrcAlpha;
      case 771:
        return ad.OneMinusSrcAlpha;
      case 772:
        return ad.DstAlpha;
      case 773:
        return ad.OneMinusDstAlpha;
      case 774:
        return ad.Dst;
      case 775:
        return ad.OneMinusDst;
      case 776:
        return ad.SrcAlphaSaturated;
      case 32769:
        return ad.Constant;
      case 32770:
        return ad.OneMinusConstant;
      case 32771:
        return ad.Constant;
      case 32772:
        return ad.OneMinusConstant;
      default:
        return ad.One;
    }
  }
  static _GetCompareFunction(e) {
    switch (e) {
      case 0:
        return q6.Never;
      case 1:
        return q6.Less;
      case 2:
        return q6.Equal;
      case 3:
        return q6.LessEqual;
      case 4:
        return q6.Greater;
      case 5:
        return q6.NotEqual;
      case 6:
        return q6.GreaterEqual;
      case 7:
        return q6.Always;
    }
    return q6.Never;
  }
  static _GetStencilOpFunction(e) {
    switch (e) {
      case 0:
        return T0.Zero;
      case 1:
        return T0.Keep;
      case 2:
        return T0.Replace;
      case 3:
        return T0.IncrementClamp;
      case 4:
        return T0.DecrementClamp;
      case 5:
        return T0.Invert;
      case 6:
        return T0.IncrementWrap;
      case 7:
        return T0.DecrementWrap;
    }
    return T0.Keep;
  }
  static _GetVertexInputDescriptorFormat(e) {
    const t = e.type, r = e.normalized, n = e.getSize();
    switch (t) {
      case J.BYTE:
        switch (n) {
          case 1:
          case 2:
            return r ? jo.Snorm8x2 : jo.Sint8x2;
          case 3:
          case 4:
            return r ? jo.Snorm8x4 : jo.Sint8x4;
        }
        break;
      case J.UNSIGNED_BYTE:
        switch (n) {
          case 1:
          case 2:
            return r ? jo.Unorm8x2 : jo.Uint8x2;
          case 3:
          case 4:
            return r ? jo.Unorm8x4 : jo.Uint8x4;
        }
        break;
      case J.SHORT:
        switch (n) {
          case 1:
          case 2:
            return r ? jo.Snorm16x2 : jo.Sint16x2;
          case 3:
          case 4:
            return r ? jo.Snorm16x4 : jo.Sint16x4;
        }
        break;
      case J.UNSIGNED_SHORT:
        switch (n) {
          case 1:
          case 2:
            return r ? jo.Unorm16x2 : jo.Uint16x2;
          case 3:
          case 4:
            return r ? jo.Unorm16x4 : jo.Uint16x4;
        }
        break;
      case J.INT:
        switch (n) {
          case 1:
            return jo.Sint32;
          case 2:
            return jo.Sint32x2;
          case 3:
            return jo.Sint32x3;
          case 4:
            return jo.Sint32x4;
        }
        break;
      case J.UNSIGNED_INT:
        switch (n) {
          case 1:
            return jo.Uint32;
          case 2:
            return jo.Uint32x2;
          case 3:
            return jo.Uint32x3;
          case 4:
            return jo.Uint32x4;
        }
        break;
      case J.FLOAT:
        switch (n) {
          case 1:
            return jo.Float32;
          case 2:
            return jo.Float32x2;
          case 3:
            return jo.Float32x3;
          case 4:
            return jo.Float32x4;
        }
        break;
    }
    throw new Error(`Invalid Format '${e.getKind()}' - type=${t}, normalized=${r}, size=${n}`);
  }
  _getAphaBlendState() {
    return this._alphaBlendEnabled ? {
      srcFactor: co._GetAphaBlendFactor(this._alphaBlendFuncParams[2]),
      dstFactor: co._GetAphaBlendFactor(this._alphaBlendFuncParams[3]),
      operation: co._GetAphaBlendOperation(this._alphaBlendEqParams[1])
    } : null;
  }
  _getColorBlendState() {
    return this._alphaBlendEnabled ? {
      srcFactor: co._GetAphaBlendFactor(this._alphaBlendFuncParams[0]),
      dstFactor: co._GetAphaBlendFactor(this._alphaBlendFuncParams[1]),
      operation: co._GetAphaBlendOperation(this._alphaBlendEqParams[0])
    } : null;
  }
  _setShaderStage(e) {
    this._shaderId !== e && (this._shaderId = e, this._states[hf.ShaderStage] = e, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.ShaderStage));
  }
  _setRasterizationState(e, t) {
    const r = this._frontFace, n = this._cullEnabled ? this._cullFace : 0, i = this._clampDepth ? 1 : 0, s = this._alphaToCoverageEnabled ? 1 : 0, a = r - 1 + (n << 1) + (i << 3) + (s << 4) + (e << 5) + (t << 8);
    this._rasterizationState !== a && (this._rasterizationState = a, this._states[hf.RasterizationState] = this._rasterizationState, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.RasterizationState));
  }
  _setColorStates() {
    let e = ((this._writeMask ? 1 : 0) << 22) + (this._colorFormat << 23) + ((this._depthWriteEnabled ? 1 : 0) << 29);
    this._alphaBlendEnabled && (e += ((this._alphaBlendFuncParams[0] === null ? 2 : pC[this._alphaBlendFuncParams[0]]) << 0) + ((this._alphaBlendFuncParams[1] === null ? 2 : pC[this._alphaBlendFuncParams[1]]) << 4) + ((this._alphaBlendFuncParams[2] === null ? 2 : pC[this._alphaBlendFuncParams[2]]) << 8) + ((this._alphaBlendFuncParams[3] === null ? 2 : pC[this._alphaBlendFuncParams[3]]) << 12) + ((this._alphaBlendEqParams[0] === null ? 1 : this._alphaBlendEqParams[0] - 32773) << 16) + ((this._alphaBlendEqParams[1] === null ? 1 : this._alphaBlendEqParams[1] - 32773) << 19)), e !== this._colorStates && (this._colorStates = e, this._states[hf.ColorStates] = this._colorStates, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.ColorStates));
  }
  _setDepthStencilState() {
    const e = this._stencilEnabled ? this._stencilFrontCompare + (this._stencilFrontDepthFailOp << 3) + (this._stencilFrontPassOp << 6) + (this._stencilFrontFailOp << 9) : 591, t = this._depthStencilFormat + ((this._depthTestEnabled ? this._depthCompare : 7) << 6) + (e << 10);
    this._depthStencilState !== t && (this._depthStencilState = t, this._states[hf.DepthStencilState] = this._depthStencilState, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.DepthStencilState));
  }
  _setVertexState(e) {
    var t, r;
    const n = this._statesLength;
    let i = hf.VertexState;
    const s = e._pipelineContext, a = s.shaderProcessingContext.attributeNamesFromEffect, f = s.shaderProcessingContext.attributeLocationsFromEffect;
    let o, d = 0;
    for (let v = 0; v < a.length; v++) {
      const u = f[v];
      let l = (t = this._overrideVertexBuffers && this._overrideVertexBuffers[a[v]]) !== null && t !== void 0 ? t : this._vertexBuffers[a[v]];
      l || (l = this._emptyVertexBuffer);
      const P = (r = l.effectiveBuffer) === null || r === void 0 ? void 0 : r.underlyingResource;
      if (l._validOffsetRange === void 0) {
        const c = l.effectiveByteOffset, H = l.getSize(!0), T = l.effectiveByteStride;
        l._validOffsetRange = c + H <= this._kMaxVertexBufferStride && T === 0 || T !== 0 && c + H <= T;
      }
      o && o === P && l._validOffsetRange || (this.vertexBuffers[d++] = l, o = l._validOffsetRange ? P : null);
      const p = l.hashCode + (u << 7);
      this._isDirty = this._isDirty || this._states[i] !== p, this._states[i++] = p;
    }
    this.vertexBuffers.length = d, this._statesLength = i, this._isDirty = this._isDirty || i !== n, this._isDirty && (this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.VertexState));
  }
  _setTextureState(e) {
    this._textureState !== e && (this._textureState = e, this._states[hf.TextureStage] = this._textureState, this._isDirty = !0, this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, hf.TextureStage));
  }
  _createPipelineLayout(e) {
    if (this._useTextureStage)
      return this._createPipelineLayoutWithTextureStage(e);
    const t = [], r = e.shaderProcessingContext.bindGroupLayoutEntries;
    for (let n = 0; n < r.length; n++) {
      const i = r[n];
      t[n] = this._device.createBindGroupLayout({
        entries: i
      });
    }
    return e.bindGroupLayouts[0] = t, this._device.createPipelineLayout({ bindGroupLayouts: t });
  }
  _createPipelineLayoutWithTextureStage(e) {
    var t;
    const r = e.shaderProcessingContext, n = r.bindGroupLayoutEntries;
    let i = 1;
    for (let a = 0; a < n.length; a++) {
      const f = n[a];
      for (let o = 0; o < f.length; o++) {
        const d = n[a][o];
        if (d.texture) {
          const v = r.bindGroupLayoutEntryInfo[a][d.binding].name, u = r.availableTextures[v], l = u.autoBindSampler ? r.availableSamplers[v + Wo.AutoSamplerSuffix] : null;
          let P = u.sampleType, p = (t = l == null ? void 0 : l.type) !== null && t !== void 0 ? t : Xq.Filtering;
          if (this._textureState & i && P !== Ll.Depth && (u.autoBindSampler && (p = Xq.NonFiltering), P = Ll.UnfilterableFloat), d.texture.sampleType = P, l) {
            const c = r.bindGroupLayoutEntryInfo[l.binding.groupIndex][l.binding.bindingIndex].index;
            n[l.binding.groupIndex][c].sampler.type = p;
          }
          i = i << 1;
        }
      }
    }
    const s = [];
    for (let a = 0; a < n.length; ++a)
      s[a] = this._device.createBindGroupLayout({
        entries: n[a]
      });
    return e.bindGroupLayouts[this._textureState] = s, this._device.createPipelineLayout({ bindGroupLayouts: s });
  }
  _getVertexInputDescriptor(e) {
    var t, r;
    const n = [], i = e._pipelineContext, s = i.shaderProcessingContext.attributeNamesFromEffect, a = i.shaderProcessingContext.attributeLocationsFromEffect;
    let f, o;
    for (let d = 0; d < s.length; d++) {
      const v = a[d];
      let u = (t = this._overrideVertexBuffers && this._overrideVertexBuffers[s[d]]) !== null && t !== void 0 ? t : this._vertexBuffers[s[d]];
      u || (u = this._emptyVertexBuffer);
      let l = (r = u.effectiveBuffer) === null || r === void 0 ? void 0 : r.underlyingResource, P = u.effectiveByteOffset;
      const p = !u._validOffsetRange;
      if (!(f && o && f === l) || p) {
        const c = {
          arrayStride: u.effectiveByteStride,
          stepMode: u.getIsInstanced() ? LI.Instance : LI.Vertex,
          attributes: []
        };
        n.push(c), o = c.attributes, p && (P = 0, l = null);
      }
      o.push({
        shaderLocation: v,
        offset: P,
        format: co._GetVertexInputDescriptorFormat(u)
      }), f = l;
    }
    return n;
  }
  _processNonFloatVertexBuffers(e, t) {
    const r = e.engine._getShaderProcessor(e.shaderProcessingContext.shaderLanguage);
    let n = !1;
    for (const i in this._vertexBuffers) {
      const s = this._vertexBuffers[i];
      if (!s || !mle[i])
        continue;
      const a = s.normalized ? J.FLOAT : s.type, f = e.vertexBufferKindToType[i];
      (a !== J.FLOAT && f === void 0 || f !== void 0 && f !== a) && (n = !0, e.vertexBufferKindToType[i] = a, a !== J.FLOAT && (r.vertexBufferKindToNumberOfComponents[i] = J.DeduceStride(i), co._IsSignedType(a) && (r.vertexBufferKindToNumberOfComponents[i] *= -1)));
    }
    n && t._processShaderCode(r, !0);
  }
  _createRenderPipeline(e, t, r) {
    var n, i, s;
    const a = e._pipelineContext, f = this._getVertexInputDescriptor(e), o = this._createPipelineLayout(a), d = [], v = this._getAphaBlendState(), u = this._getColorBlendState();
    if (this._processNonFloatVertexBuffers(a, e), this._mrtAttachments1 > 0)
      for (let c = 0; c < this._mrtFormats.length; ++c) {
        const H = this._mrtFormats[c];
        if (H) {
          const T = {
            format: H,
            writeMask: this._mrtEnabledMask & 1 << c ? this._writeMask : 0
          };
          v && u && (T.blend = {
            alpha: v,
            color: u
          }), d.push(T);
        } else
          d.push(null);
      }
    else if (this._webgpuColorFormat[0]) {
      const c = {
        format: this._webgpuColorFormat[0],
        writeMask: this._writeMask
      };
      v && u && (c.blend = {
        alpha: v,
        color: u
      }), d.push(c);
    } else
      d.push(null);
    const l = {
      compare: co._GetCompareFunction(
        this._stencilEnabled ? this._stencilFrontCompare : 7
        /* ALWAYS */
      ),
      depthFailOp: co._GetStencilOpFunction(
        this._stencilEnabled ? this._stencilFrontDepthFailOp : 1
        /* KEEP */
      ),
      failOp: co._GetStencilOpFunction(
        this._stencilEnabled ? this._stencilFrontFailOp : 1
        /* KEEP */
      ),
      passOp: co._GetStencilOpFunction(
        this._stencilEnabled ? this._stencilFrontPassOp : 1
        /* KEEP */
      )
    };
    let P;
    (t === Fl.LineStrip || t === Fl.TriangleStrip) && (P = !this._indexBuffer || this._indexBuffer.is32Bits ? Tq.Uint32 : Tq.Uint16);
    const p = this._webgpuDepthStencilFormat ? Ns.HasStencilAspect(this._webgpuDepthStencilFormat) : !1;
    return this._device.createRenderPipeline({
      label: `RenderPipeline_${(i = (n = d[0]) === null || n === void 0 ? void 0 : n.format) !== null && i !== void 0 ? i : "nooutput"}_${(s = this._webgpuDepthStencilFormat) !== null && s !== void 0 ? s : "nodepth"}_samples${r}_textureState${this._textureState}`,
      layout: o,
      vertex: {
        module: a.stages.vertexStage.module,
        entryPoint: a.stages.vertexStage.entryPoint,
        buffers: f
      },
      primitive: {
        topology: t,
        stripIndexFormat: P,
        frontFace: this._frontFace === 1 ? MI.CCW : MI.CW,
        cullMode: this._cullEnabled ? this._cullFace === 2 ? eS.Front : eS.Back : eS.None
      },
      fragment: a.stages.fragmentStage ? {
        module: a.stages.fragmentStage.module,
        entryPoint: a.stages.fragmentStage.entryPoint,
        targets: d
      } : void 0,
      multisample: {
        count: r
        /*mask,
        alphaToCoverageEnabled,*/
      },
      depthStencil: this._webgpuDepthStencilFormat === void 0 ? void 0 : {
        depthWriteEnabled: this._depthWriteEnabled,
        depthCompare: this._depthTestEnabled ? co._GetCompareFunction(this._depthCompare) : q6.Always,
        format: this._webgpuDepthStencilFormat,
        stencilFront: this._stencilEnabled && p ? l : void 0,
        stencilBack: this._stencilEnabled && p ? l : void 0,
        stencilReadMask: this._stencilEnabled && p ? this._stencilReadMask : void 0,
        stencilWriteMask: this._stencilEnabled && p ? this._stencilWriteMask : void 0,
        depthBias: this._depthBias,
        depthBiasClamp: this._depthBiasClamp,
        depthBiasSlopeScale: this._depthBiasSlopeScale
      }
    });
  }
}
co.NumCacheHitWithoutHash = 0;
co.NumCacheHitWithHash = 0;
co.NumCacheMiss = 0;
co.NumPipelineCreationLastFrame = 0;
co._NumPipelineCreationCurrentFrame = 0;
class bte {
  constructor() {
    this.values = {};
  }
  count() {
    let e = 0, t = this.pipeline ? 1 : 0;
    for (const r in this.values) {
      const n = this.values[r], [i, s] = n.count();
      e += i, t += s, e++;
    }
    return [e, t];
  }
}
class N2 extends co {
  static GetNodeCounts() {
    const e = N2._Cache.count();
    return { nodeCount: e[0], pipelineCount: e[1] };
  }
  static _GetPipelines(e, t, r, n) {
    if (e.pipeline) {
      const i = r.slice();
      i.length = n, t.push(i);
    }
    for (const i in e.values) {
      const s = e.values[i];
      r[n] = parseInt(i), N2._GetPipelines(s, t, r, n + 1);
    }
  }
  static GetPipelines() {
    const e = [];
    return N2._GetPipelines(N2._Cache, e, [], 0), e;
  }
  constructor(e, t) {
    super(e, t), this._nodeStack = [], this._nodeStack[0] = N2._Cache;
  }
  _getRenderPipeline(e) {
    let t = this._nodeStack[this._stateDirtyLowestIndex];
    for (let r = this._stateDirtyLowestIndex; r < this._statesLength; ++r) {
      let n = t.values[this._states[r]];
      n || (n = new bte(), t.values[this._states[r]] = n), t = n, this._nodeStack[r + 1] = t;
    }
    e.token = t, e.pipeline = t.pipeline;
  }
  _setRenderPipeline(e) {
    e.token.pipeline = e.pipeline;
  }
}
N2._Cache = new bte();
class Ble extends KN {
  constructor(e) {
    super(!1), this._cache = e, this.reset();
  }
  get func() {
    return this._func;
  }
  set func(e) {
    this._func !== e && (this._func = e, this._cache.setStencilCompare(e));
  }
  get funcMask() {
    return this._funcMask;
  }
  set funcMask(e) {
    this._funcMask !== e && (this._funcMask = e, this._cache.setStencilReadMask(e));
  }
  get opStencilFail() {
    return this._opStencilFail;
  }
  set opStencilFail(e) {
    this._opStencilFail !== e && (this._opStencilFail = e, this._cache.setStencilFailOp(e));
  }
  get opDepthFail() {
    return this._opDepthFail;
  }
  set opDepthFail(e) {
    this._opDepthFail !== e && (this._opDepthFail = e, this._cache.setStencilDepthFailOp(e));
  }
  get opStencilDepthPass() {
    return this._opStencilDepthPass;
  }
  set opStencilDepthPass(e) {
    this._opStencilDepthPass !== e && (this._opStencilDepthPass = e, this._cache.setStencilPassOp(e));
  }
  get mask() {
    return this._mask;
  }
  set mask(e) {
    this._mask !== e && (this._mask = e, this._cache.setStencilWriteMask(e));
  }
  get enabled() {
    return this._enabled;
  }
  set enabled(e) {
    this._enabled !== e && (this._enabled = e, this._cache.setStencilEnabled(e));
  }
  reset() {
    super.reset(), this._cache.resetStencilState();
  }
  apply() {
    var e;
    const t = (e = this.stencilMaterial) === null || e === void 0 ? void 0 : e.enabled;
    this.enabled = t ? this.stencilMaterial.enabled : this.stencilGlobal.enabled, this.enabled && (this.func = t ? this.stencilMaterial.func : this.stencilGlobal.func, this.funcRef = t ? this.stencilMaterial.funcRef : this.stencilGlobal.funcRef, this.funcMask = t ? this.stencilMaterial.funcMask : this.stencilGlobal.funcMask, this.opStencilFail = t ? this.stencilMaterial.opStencilFail : this.stencilGlobal.opStencilFail, this.opDepthFail = t ? this.stencilMaterial.opDepthFail : this.stencilGlobal.opDepthFail, this.opStencilDepthPass = t ? this.stencilMaterial.opStencilDepthPass : this.stencilGlobal.opStencilDepthPass, this.mask = t ? this.stencilMaterial.mask : this.stencilGlobal.mask);
  }
}
class Wle extends YN {
  /**
   * Initializes the state.
   * @param cache
   */
  constructor(e) {
    super(!1), this._cache = e, this.reset();
  }
  get zOffset() {
    return this._zOffset;
  }
  set zOffset(e) {
    this._zOffset !== e && (this._zOffset = e, this._isZOffsetDirty = !0, this._cache.setDepthBiasSlopeScale(e));
  }
  get zOffsetUnits() {
    return this._zOffsetUnits;
  }
  set zOffsetUnits(e) {
    this._zOffsetUnits !== e && (this._zOffsetUnits = e, this._isZOffsetDirty = !0, this._cache.setDepthBias(e));
  }
  get cullFace() {
    return this._cullFace;
  }
  set cullFace(e) {
    this._cullFace !== e && (this._cullFace = e, this._isCullFaceDirty = !0, this._cache.setCullFace(e ?? 1));
  }
  get cull() {
    return this._cull;
  }
  set cull(e) {
    this._cull !== e && (this._cull = e, this._isCullDirty = !0, this._cache.setCullEnabled(!!e));
  }
  get depthFunc() {
    return this._depthFunc;
  }
  set depthFunc(e) {
    this._depthFunc !== e && (this._depthFunc = e, this._isDepthFuncDirty = !0, this._cache.setDepthCompare(e));
  }
  get depthMask() {
    return this._depthMask;
  }
  set depthMask(e) {
    this._depthMask !== e && (this._depthMask = e, this._isDepthMaskDirty = !0, this._cache.setDepthWriteEnabled(e));
  }
  get depthTest() {
    return this._depthTest;
  }
  set depthTest(e) {
    this._depthTest !== e && (this._depthTest = e, this._isDepthTestDirty = !0, this._cache.setDepthTestEnabled(e));
  }
  get frontFace() {
    return this._frontFace;
  }
  set frontFace(e) {
    this._frontFace !== e && (this._frontFace = e, this._isFrontFaceDirty = !0, this._cache.setFrontFace(e ?? 2));
  }
  reset() {
    super.reset(), this._cache.resetDepthCullingState();
  }
  apply() {
  }
}
class FQ {
  /**
   * Checks if a texture is an external or internal texture
   * @param texture the external or internal texture
   * @returns true if the texture is an external texture, else false
   */
  static IsExternalTexture(e) {
    return e.underlyingResource !== void 0;
  }
  /**
   * Get the class name of the texture.
   * @returns "ExternalTexture"
   */
  getClassName() {
    return "ExternalTexture";
  }
  /**
   * Gets the underlying texture object
   */
  get underlyingResource() {
    return this._video;
  }
  /**
   * Constructs the texture
   * @param video The video the texture should be wrapped around
   */
  constructor(e) {
    this.useMipMaps = !1, this.type = 16, this.format = 4294967295, this._video = e, this.uniqueId = As._Counter++;
  }
  /**
   * Get if the texture is ready to be used (downloaded, converted, mip mapped...).
   * @returns true if fully ready
   */
  isReady() {
    return this._video.readyState >= this._video.HAVE_CURRENT_DATA;
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
  }
}
class sy {
  get forceBindGroupCreation() {
    return this._numExternalTextures > 0;
  }
  get hasFloatOrDepthTextures() {
    return this._numFloatOrDepthTextures > 0;
  }
  constructor() {
    this.uniqueId = sy._Counter++, this.updateId = 0, this.textureState = 0, this.reset();
  }
  reset() {
    this.samplers = {}, this.textures = {}, this.isDirty = !0, this._numFloatOrDepthTextures = 0, this._numExternalTextures = 0;
  }
  setSampler(e, t) {
    let r = this.samplers[e], n = -1;
    r ? n = r.hashCode : this.samplers[e] = r = { sampler: t, hashCode: 0 }, r.sampler = t, r.hashCode = t ? rD.GetSamplerHashCode(t) : 0;
    const i = n !== r.hashCode;
    i && this.updateId++, this.isDirty || (this.isDirty = i);
  }
  setTexture(e, t) {
    var r, n, i;
    let s = this.textures[e], a = -1;
    s ? a = (n = (r = s.texture) === null || r === void 0 ? void 0 : r.uniqueId) !== null && n !== void 0 ? n : -1 : this.textures[e] = s = { texture: t, isFloatOrDepthTexture: !1, isExternalTexture: !1 }, s.isExternalTexture && this._numExternalTextures--, s.isFloatOrDepthTexture && this._numFloatOrDepthTextures--, t ? (s.isFloatOrDepthTexture = t.type === 1 || t.format >= 13 && t.format <= 18, s.isExternalTexture = FQ.IsExternalTexture(t), s.isFloatOrDepthTexture && this._numFloatOrDepthTextures++, s.isExternalTexture && this._numExternalTextures++) : (s.isFloatOrDepthTexture = !1, s.isExternalTexture = !1), s.texture = t;
    const f = a !== ((i = t == null ? void 0 : t.uniqueId) !== null && i !== void 0 ? i : -1);
    f && this.updateId++, this.isDirty || (this.isDirty = f);
  }
}
sy._Counter = 0;
class tV {
  isDirty(e) {
    return this._isDirty || this._materialContextUpdateId !== e;
  }
  resetIsDirty(e) {
    this._isDirty = !1, this._materialContextUpdateId = e;
  }
  get useInstancing() {
    return this._useInstancing;
  }
  set useInstancing(e) {
    this._useInstancing !== e && (e ? (this.indirectDrawBuffer = this._bufferManager.createRawBuffer(20, ga.CopyDst | ga.Indirect | ga.Storage, void 0, "IndirectDrawBuffer"), this._indirectDrawData = new Uint32Array(5), this._indirectDrawData[3] = 0, this._indirectDrawData[4] = 0) : (this.indirectDrawBuffer && this._bufferManager.releaseBuffer(this.indirectDrawBuffer), this.indirectDrawBuffer = void 0, this._indirectDrawData = void 0), this._useInstancing = e, this._currentInstanceCount = -1);
  }
  constructor(e) {
    this._bufferManager = e, this.uniqueId = tV._Counter++, this._useInstancing = !1, this._currentInstanceCount = 0, this.reset();
  }
  reset() {
    this.buffers = {}, this._isDirty = !0, this._materialContextUpdateId = 0, this.fastBundle = void 0, this.bindGroups = void 0;
  }
  setBuffer(e, t) {
    var r;
    this._isDirty || (this._isDirty = (t == null ? void 0 : t.uniqueId) !== ((r = this.buffers[e]) === null || r === void 0 ? void 0 : r.uniqueId)), this.buffers[e] = t;
  }
  setIndirectData(e, t, r) {
    t === this._currentInstanceCount || !this.indirectDrawBuffer || !this._indirectDrawData || (this._currentInstanceCount = t, this._indirectDrawData[0] = e, this._indirectDrawData[1] = t, this._indirectDrawData[2] = r, this._bufferManager.setRawData(this.indirectDrawBuffer, 0, this._indirectDrawData, 0, 20));
  }
  dispose() {
    this.indirectDrawBuffer && (this._bufferManager.releaseBuffer(this.indirectDrawBuffer), this.indirectDrawBuffer = void 0, this._indirectDrawData = void 0), this.fastBundle = void 0, this.bindGroups = void 0, this.buffers = void 0;
  }
}
tV._Counter = 0;
class jC {
  constructor() {
    this.values = {};
  }
}
class d1 {
  static get Statistics() {
    return {
      totalCreated: d1.NumBindGroupsCreatedTotal,
      lastFrameCreated: d1.NumBindGroupsCreatedLastFrame,
      lookupLastFrame: d1.NumBindGroupsLookupLastFrame,
      noLookupLastFrame: d1.NumBindGroupsNoLookupLastFrame
    };
  }
  constructor(e, t, r) {
    this.disabled = !1, this._device = e, this._cacheSampler = t, this._engine = r;
  }
  endFrame() {
    d1.NumBindGroupsCreatedLastFrame = d1._NumBindGroupsCreatedCurrentFrame, d1.NumBindGroupsLookupLastFrame = d1._NumBindGroupsLookupCurrentFrame, d1.NumBindGroupsNoLookupLastFrame = d1._NumBindGroupsNoLookupCurrentFrame, d1._NumBindGroupsCreatedCurrentFrame = 0, d1._NumBindGroupsLookupCurrentFrame = 0, d1._NumBindGroupsNoLookupCurrentFrame = 0;
  }
  /**
   * Cache is currently based on the uniform/storage buffers, samplers and textures used by the binding groups.
   * Note that all uniform buffers have an offset of 0 in Babylon and we don't have a use case where we would have the same buffer used with different capacity values:
   * that means we don't need to factor in the offset/size of the buffer in the cache, only the id
   * @param webgpuPipelineContext
   * @param drawContext
   * @param materialContext
   */
  getBindGroups(e, t, r) {
    var n, i, s, a, f, o, d, v, u, l;
    let P, p = d1._Cache;
    const c = this.disabled || r.forceBindGroupCreation;
    if (!c) {
      if (!t.isDirty(r.updateId) && !r.isDirty)
        return d1._NumBindGroupsNoLookupCurrentFrame++, t.bindGroups;
      for (const T of e.shaderProcessingContext.bufferNames) {
        const q = (i = (n = t.buffers[T]) === null || n === void 0 ? void 0 : n.uniqueId) !== null && i !== void 0 ? i : 0;
        let b = p.values[q];
        b || (b = new jC(), p.values[q] = b), p = b;
      }
      for (const T of e.shaderProcessingContext.samplerNames) {
        const q = (a = (s = r.samplers[T]) === null || s === void 0 ? void 0 : s.hashCode) !== null && a !== void 0 ? a : 0;
        let b = p.values[q];
        b || (b = new jC(), p.values[q] = b), p = b;
      }
      for (const T of e.shaderProcessingContext.textureNames) {
        const q = (d = (o = (f = r.textures[T]) === null || f === void 0 ? void 0 : f.texture) === null || o === void 0 ? void 0 : o.uniqueId) !== null && d !== void 0 ? d : 0;
        let b = p.values[q];
        b || (b = new jC(), p.values[q] = b), p = b;
      }
      P = p.bindGroups;
    }
    if (t.resetIsDirty(r.updateId), r.isDirty = !1, P)
      return t.bindGroups = P, d1._NumBindGroupsLookupCurrentFrame++, P;
    P = [], t.bindGroups = P, c || (p.bindGroups = P), d1.NumBindGroupsCreatedTotal++, d1._NumBindGroupsCreatedCurrentFrame++;
    const H = e.bindGroupLayouts[r.textureState];
    for (let T = 0; T < e.shaderProcessingContext.bindGroupLayoutEntries.length; T++) {
      const q = e.shaderProcessingContext.bindGroupLayoutEntries[T], b = e.shaderProcessingContext.bindGroupEntries[T];
      for (let w = 0; w < q.length; w++) {
        const m = e.shaderProcessingContext.bindGroupLayoutEntries[T][w], I = e.shaderProcessingContext.bindGroupLayoutEntryInfo[T][m.binding], N = (v = I.nameInArrayOfTexture) !== null && v !== void 0 ? v : I.name;
        if (m.sampler) {
          const k = r.samplers[N];
          if (k) {
            const R = k.sampler;
            if (!R) {
              this._engine.dbgSanityChecks && Se.Error(`Trying to bind a null sampler! entry=${JSON.stringify(m)}, name=${N}, bindingInfo=${JSON.stringify(k, (y, O) => y === "texture" ? "<no dump>" : O)}, materialContext.uniqueId=${r.uniqueId}`, 50);
              continue;
            }
            b[w].resource = this._cacheSampler.getSampler(R, !1, k.hashCode, R.label);
          } else
            Se.Error(`Sampler "${N}" could not be bound. entry=${JSON.stringify(m)}, materialContext=${JSON.stringify(r, (R, y) => R === "texture" || R === "sampler" ? "<no dump>" : y)}`, 50);
        } else if (m.texture || m.storageTexture) {
          const k = r.textures[N];
          if (k) {
            if (this._engine.dbgSanityChecks && k.texture === null) {
              Se.Error(`Trying to bind a null texture! entry=${JSON.stringify(m)}, bindingInfo=${JSON.stringify(k, (y, O) => y === "texture" ? "<no dump>" : O)}, materialContext.uniqueId=${r.uniqueId}`, 50);
              continue;
            }
            const R = k.texture._hardwareTexture;
            if (this._engine.dbgSanityChecks && (!R || m.texture && !R.view || m.storageTexture && !R.viewForWriting)) {
              Se.Error(`Trying to bind a null gpu texture or view! entry=${JSON.stringify(m)}, name=${N}, bindingInfo=${JSON.stringify(k, (y, O) => y === "texture" ? "<no dump>" : O)}, isReady=${(u = k.texture) === null || u === void 0 ? void 0 : u.isReady}, materialContext.uniqueId=${r.uniqueId}`, 50);
              continue;
            }
            b[w].resource = m.storageTexture ? R.viewForWriting : R.view;
          } else
            Se.Error(`Texture "${N}" could not be bound. entry=${JSON.stringify(m)}, materialContext=${JSON.stringify(r, (R, y) => R === "texture" || R === "sampler" ? "<no dump>" : y)}`, 50);
        } else if (m.externalTexture) {
          const k = r.textures[N];
          if (k) {
            if (this._engine.dbgSanityChecks && k.texture === null) {
              Se.Error(`Trying to bind a null external texture! entry=${JSON.stringify(m)}, name=${N}, bindingInfo=${JSON.stringify(k, (y, O) => y === "texture" ? "<no dump>" : O)}, materialContext.uniqueId=${r.uniqueId}`, 50);
              continue;
            }
            const R = k.texture.underlyingResource;
            if (this._engine.dbgSanityChecks && !R) {
              Se.Error(`Trying to bind a null gpu external texture! entry=${JSON.stringify(m)}, name=${N}, bindingInfo=${JSON.stringify(k, (y, O) => y === "texture" ? "<no dump>" : O)}, isReady=${(l = k.texture) === null || l === void 0 ? void 0 : l.isReady}, materialContext.uniqueId=${r.uniqueId}`, 50);
              continue;
            }
            b[w].resource = this._device.importExternalTexture({ source: R });
          } else
            Se.Error(`Texture "${N}" could not be bound. entry=${JSON.stringify(m)}, materialContext=${JSON.stringify(r, (R, y) => R === "texture" || R === "sampler" ? "<no dump>" : y)}`, 50);
        } else if (m.buffer) {
          const k = t.buffers[N];
          if (k) {
            const R = k.underlyingResource;
            b[w].resource.buffer = R, b[w].resource.size = k.capacity;
          } else
            Se.Error(`Can't find buffer "${N}". entry=${JSON.stringify(m)}, buffers=${JSON.stringify(t.buffers)}, drawContext.uniqueId=${t.uniqueId}`, 50);
        }
      }
      const j = H[T];
      P[T] = this._device.createBindGroup({
        layout: j,
        entries: b
      });
    }
    return P;
  }
}
d1.NumBindGroupsCreatedTotal = 0;
d1.NumBindGroupsCreatedLastFrame = 0;
d1.NumBindGroupsLookupLastFrame = 0;
d1.NumBindGroupsNoLookupLastFrame = 0;
d1._Cache = new jC();
d1._NumBindGroupsCreatedCurrentFrame = 0;
d1._NumBindGroupsLookupCurrentFrame = 0;
d1._NumBindGroupsNoLookupCurrentFrame = 0;
const Sle = "clearQuadVertexShader", Ule = `uniform float depthValue;const vec2 pos[4]={vec2(-1.0,1.0),
vec2(1.0,1.0),
vec2(-1.0,-1.0),
vec2(1.0,-1.0)};
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
gl_Position=vec4(pos[gl_VertexID],depthValue,1.0);
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[Sle] = Ule;
const Ile = "clearQuadPixelShader", Rle = `uniform vec4 color;void main() {gl_FragColor=color;}
`;
Le.ShadersStore[Ile] = Rle;
class Vle {
  setDepthStencilFormat(e) {
    this._depthTextureFormat = e, this._cacheRenderPipeline.setDepthStencilFormat(e);
  }
  setColorFormat(e) {
    this._cacheRenderPipeline.setColorFormat(e);
  }
  setMRTAttachments(e, t, r) {
    this._cacheRenderPipeline.setMRT(t, r), this._cacheRenderPipeline.setMRTAttachments(e);
  }
  constructor(e, t, r) {
    this._bindGroups = {}, this._bundleCache = {}, this._keyTemp = [], this._device = e, this._engine = t, this._cacheRenderPipeline = new N2(this._device, r), this._cacheRenderPipeline.setDepthTestEnabled(!1), this._cacheRenderPipeline.setStencilReadMask(255), this._effect = t.createEffect("clearQuad", [], ["color", "depthValue"]);
  }
  clear(e, t, r, n, i = 1) {
    var s, a;
    let f, o = null, d;
    const v = !!this._engine._currentRenderTarget;
    if (e)
      f = e;
    else {
      let T = 0;
      this._keyTemp.length = 0;
      for (let b = 0; b < this._cacheRenderPipeline.colorFormats.length; ++b)
        this._keyTemp[T++] = F2[(s = this._cacheRenderPipeline.colorFormats[b]) !== null && s !== void 0 ? s : ""];
      const q = F2[(a = this._depthTextureFormat) !== null && a !== void 0 ? a : 0];
      if (this._keyTemp[T] = (t ? t.r + t.g * 256 + t.b * 256 * 256 + t.a * 256 * 256 * 256 : 0) + (r ? 2 ** 32 : 0) + (n ? 2 ** 33 : 0) + (this._engine.useReverseDepthBuffer ? 2 ** 34 : 0) + (v ? 2 ** 35 : 0) + (i > 1 ? 2 ** 36 : 0) + q * 2 ** 37, d = this._keyTemp.join("_"), o = this._bundleCache[d], o)
        return o;
      f = this._device.createRenderBundleEncoder({
        colorFormats: this._cacheRenderPipeline.colorFormats,
        depthStencilFormat: this._depthTextureFormat,
        sampleCount: Ns.GetSample(i)
      });
    }
    this._cacheRenderPipeline.setDepthWriteEnabled(!!r), this._cacheRenderPipeline.setStencilEnabled(!!n && !!this._depthTextureFormat && Ns.HasStencilAspect(this._depthTextureFormat)), this._cacheRenderPipeline.setStencilWriteMask(n ? 255 : 0), this._cacheRenderPipeline.setStencilCompare(n ? 519 : 512), this._cacheRenderPipeline.setStencilPassOp(n ? 7681 : 7680), this._cacheRenderPipeline.setWriteMask(t ? 15 : 0);
    const u = this._cacheRenderPipeline.getRenderPipeline(7, this._effect, i), l = this._effect._pipelineContext;
    t && this._effect.setDirectColor4("color", t), this._effect.setFloat("depthValue", this._engine.useReverseDepthBuffer ? this._engine._clearReverseDepthValue : this._engine._clearDepthValue), l.uniformBuffer.update();
    const P = v ? this._engine._ubInvertY : this._engine._ubDontInvertY, p = l.uniformBuffer.getBuffer(), c = p.uniqueId + "-" + P.uniqueId;
    let H = this._bindGroups[c];
    if (!H) {
      const T = l.bindGroupLayouts[0];
      H = this._bindGroups[c] = [], H.push(this._device.createBindGroup({
        layout: T[0],
        entries: []
      })), gp._SimplifiedKnownBindings || H.push(this._device.createBindGroup({
        layout: T[1],
        entries: []
      })), H.push(this._device.createBindGroup({
        layout: T[gp._SimplifiedKnownBindings ? 1 : 2],
        entries: [
          {
            binding: 0,
            resource: {
              buffer: P.underlyingResource,
              size: P.capacity
            }
          },
          {
            binding: 1,
            resource: {
              buffer: p.underlyingResource,
              size: p.capacity
            }
          }
        ]
      }));
    }
    f.setPipeline(u);
    for (let T = 0; T < H.length; ++T)
      f.setBindGroup(T, H[T]);
    return f.draw(4, 1, 0, 0), e || (o = f.finish(), this._bundleCache[d] = o), o;
  }
}
class NQ {
  constructor(e, t, r, n) {
    this.x = Math.floor(e), this.y = Math.floor(t), this.w = Math.floor(r), this.h = Math.floor(n);
  }
  run(e) {
    e.setViewport(this.x, this.y, this.w, this.h, 0, 1);
  }
  clone() {
    return new NQ(this.x, this.y, this.w, this.h);
  }
}
class QQ {
  constructor(e, t, r, n) {
    this.x = e, this.y = t, this.w = r, this.h = n;
  }
  run(e) {
    e.setScissorRect(this.x, this.y, this.w, this.h);
  }
  clone() {
    return new QQ(this.x, this.y, this.w, this.h);
  }
}
class rO {
  constructor(e) {
    this.ref = e;
  }
  run(e) {
    e.setStencilReference(this.ref);
  }
  clone() {
    return new rO(this.ref);
  }
}
class YQ {
  constructor(e) {
    this.color = e;
  }
  run(e) {
    e.setBlendConstant(this.color);
  }
  clone() {
    return new YQ(this.color);
  }
}
class MQ {
  constructor(e) {
    this.query = e;
  }
  run(e) {
    e.beginOcclusionQuery(this.query);
  }
  clone() {
    return new MQ(this.query);
  }
}
class LQ {
  constructor() {
  }
  run(e) {
    e.endOcclusionQuery();
  }
  clone() {
    return new LQ();
  }
}
class KQ {
  constructor() {
    this.bundles = [];
  }
  run(e) {
    e.executeBundles(this.bundles);
  }
  clone() {
    const e = new KQ();
    return e.bundles = this.bundles, e;
  }
}
class JQ {
  constructor(e) {
    this.numDrawCalls = 0, this._device = e, this._list = new Array(10), this._listLength = 0;
  }
  addBundle(e) {
    if (!this._currentItemIsBundle) {
      const t = new KQ();
      this._list[this._listLength++] = t, this._currentBundleList = t.bundles, this._currentItemIsBundle = !0;
    }
    e && this._currentBundleList.push(e);
  }
  _finishBundle() {
    this._currentItemIsBundle && this._bundleEncoder && (this._currentBundleList.push(this._bundleEncoder.finish()), this._bundleEncoder = void 0, this._currentItemIsBundle = !1);
  }
  addItem(e) {
    this._finishBundle(), this._list[this._listLength++] = e, this._currentItemIsBundle = !1;
  }
  getBundleEncoder(e, t, r) {
    return this._currentItemIsBundle || (this.addBundle(), this._bundleEncoder = this._device.createRenderBundleEncoder({
      colorFormats: e,
      depthStencilFormat: t,
      sampleCount: Ns.GetSample(r)
    })), this._bundleEncoder;
  }
  close() {
    this._finishBundle();
  }
  run(e) {
    this.close();
    for (let t = 0; t < this._listLength; ++t)
      this._list[t].run(e);
  }
  reset() {
    this._listLength = 0, this._currentItemIsBundle = !1, this.numDrawCalls = 0;
  }
  clone() {
    this.close();
    const e = new JQ(this._device);
    e._list = new Array(this._listLength), e._listLength = this._listLength, e.numDrawCalls = this.numDrawCalls;
    for (let t = 0; t < this._listLength; ++t)
      e._list[t] = this._list[t].clone();
    return e;
  }
}
class xte {
  get querySet() {
    return this._querySet;
  }
  constructor(e, t, r, n, i = !0, s) {
    this._dstBuffers = [], this._device = r, this._bufferManager = n, this._count = e, this._canUseMultipleBuffers = i, this._querySet = r.createQuerySet({
      label: s,
      type: t,
      count: e
    }), this._queryBuffer = n.createRawBuffer(8 * e, ga.QueryResolve | ga.CopySrc, void 0, "QueryBuffer"), i || this._dstBuffers.push(this._bufferManager.createRawBuffer(8 * this._count, ga.MapRead | ga.CopyDst, void 0, "QueryBufferNoMultipleBuffers"));
  }
  _getBuffer(e, t) {
    if (!this._canUseMultipleBuffers && this._dstBuffers.length === 0)
      return null;
    const r = this._device.createCommandEncoder();
    let n;
    return this._dstBuffers.length === 0 ? n = this._bufferManager.createRawBuffer(8 * this._count, ga.MapRead | ga.CopyDst, void 0, "QueryBufferAdditionalBuffer") : (n = this._dstBuffers[this._dstBuffers.length - 1], this._dstBuffers.length--), r.resolveQuerySet(this._querySet, e, t, this._queryBuffer, 0), r.copyBufferToBuffer(this._queryBuffer, 0, n, 0, 8 * t), this._device.queue.submit([r.finish()]), n;
  }
  async readValues(e = 0, t = 1) {
    const r = this._getBuffer(e, t);
    if (r === null)
      return null;
    await r.mapAsync(vD.Read);
    const n = new BigUint64Array(r.getMappedRange()).slice();
    return r.unmap(), this._dstBuffers[this._dstBuffers.length] = r, n;
  }
  async readValue(e = 0) {
    const t = this._getBuffer(e, 1);
    if (t === null)
      return null;
    await t.mapAsync(vD.Read);
    const r = new BigUint64Array(t.getMappedRange()), n = Number(r[0]);
    return t.unmap(), this._dstBuffers[this._dstBuffers.length] = t, n;
  }
  async readTwoValuesAndSubtract(e = 0) {
    const t = this._getBuffer(e, 2);
    if (t === null)
      return null;
    await t.mapAsync(vD.Read);
    const r = new BigUint64Array(t.getMappedRange()), n = Number(r[1] - r[0]);
    return t.unmap(), this._dstBuffers[this._dstBuffers.length] = t, n;
  }
  dispose() {
    this._querySet.destroy(), this._bufferManager.releaseBuffer(this._queryBuffer);
    for (let e = 0; e < this._dstBuffers.length; ++e)
      this._bufferManager.releaseBuffer(this._dstBuffers[e]);
  }
}
class Cle {
  get gpuFrameTimeCounter() {
    return this._gpuFrameTimeCounter;
  }
  constructor(e, t) {
    this._enabled = !1, this._gpuFrameTimeCounter = new v9(), this._measureDurationState = 0, this._device = e, this._bufferManager = t;
  }
  get enable() {
    return this._enabled;
  }
  set enable(e) {
    this._enabled !== e && (this._enabled = e, this._measureDurationState = 0, e ? this._measureDuration = new Ole(this._device, this._bufferManager) : this._measureDuration.dispose());
  }
  startFrame(e) {
    this._enabled && this._measureDurationState === 0 && (this._measureDuration.start(e), this._measureDurationState = 1);
  }
  endFrame(e) {
    this._measureDurationState === 1 && (this._measureDurationState = 2, this._measureDuration.stop(e).then((t) => {
      t !== null && t >= 0 && (this._gpuFrameTimeCounter.fetchNewFrame(), this._gpuFrameTimeCounter.addCount(t, !0)), this._measureDurationState = 0;
    }));
  }
}
class Ole {
  constructor(e, t) {
    this._querySet = new xte(2, KI.Timestamp, e, t);
  }
  start(e) {
    e.writeTimestamp(this._querySet.querySet, 0);
  }
  async stop(e) {
    return e.writeTimestamp(this._querySet.querySet, 1), this._querySet.readTwoValuesAndSubtract(0);
  }
  dispose() {
    this._querySet.dispose();
  }
}
class yle {
  get querySet() {
    return this._querySet.querySet;
  }
  get hasQueries() {
    return this._currentTotalIndices !== this._availableIndices.length;
  }
  canBeginQuery(e) {
    if (this._frameQuerySetIsDirty === this._engine.frameId || this._queryFrameId[e] === this._engine.frameId)
      return !1;
    const t = this._engine._getCurrentRenderPassWrapper().renderPassDescriptor.occlusionQuerySet !== void 0;
    return t && (this._queryFrameId[e] = this._engine.frameId), t;
  }
  constructor(e, t, r, n = 50, i = 100) {
    this._availableIndices = [], this._frameQuerySetIsDirty = -1, this._queryFrameId = [], this._engine = e, this._device = t, this._bufferManager = r, this._frameLastBuffer = -1, this._currentTotalIndices = 0, this._countIncrement = i, this._allocateNewIndices(n);
  }
  createQuery() {
    this._availableIndices.length === 0 && this._allocateNewIndices();
    const e = this._availableIndices[this._availableIndices.length - 1];
    return this._availableIndices.length--, e;
  }
  deleteQuery(e) {
    this._availableIndices[this._availableIndices.length] = e;
  }
  isQueryResultAvailable(e) {
    return this._retrieveQueryBuffer(), !!this._lastBuffer && e < this._lastBuffer.length;
  }
  getQueryResult(e) {
    var t, r;
    return Number((r = (t = this._lastBuffer) === null || t === void 0 ? void 0 : t[e]) !== null && r !== void 0 ? r : -1);
  }
  _retrieveQueryBuffer() {
    this._lastBuffer && this._frameLastBuffer === this._engine.frameId || this._frameLastBuffer !== this._engine.frameId && (this._frameLastBuffer = this._engine.frameId, this._querySet.readValues(0, this._currentTotalIndices).then((e) => {
      this._lastBuffer = e;
    }));
  }
  _allocateNewIndices(e) {
    e = e ?? this._countIncrement, this._delayQuerySetDispose();
    for (let t = 0; t < e; ++t)
      this._availableIndices.push(this._currentTotalIndices + t);
    this._currentTotalIndices += e, this._querySet = new xte(this._currentTotalIndices, KI.Occlusion, this._device, this._bufferManager, !1, "QuerySet_OcclusionQuery_count_" + this._currentTotalIndices), this._frameQuerySetIsDirty = this._engine.frameId;
  }
  _delayQuerySetDispose() {
    const e = this._querySet;
    e && setTimeout(() => e.dispose, 1e3);
  }
  dispose() {
    var e;
    (e = this._querySet) === null || e === void 0 || e.dispose(), this._availableIndices.length = 0;
  }
}
class Nl {
  async initTwgsl(e) {
    if (!Nl._twgsl)
      return e = e || {}, e = Object.assign(Object.assign({}, Nl._TWgslDefaultOptions), e), e.twgsl ? (Nl._twgsl = e.twgsl, Promise.resolve()) : (e.jsPath && e.wasmPath && await ye.LoadBabylonScriptAsync(e.jsPath), self.twgsl ? (Nl._twgsl = await self.twgsl(ye.GetBabylonScriptURL(e.wasmPath)), Promise.resolve()) : Promise.reject("twgsl is not available."));
  }
  convertSpirV2WGSL(e, t = !1) {
    const r = Nl._twgsl.convertSpirV2WGSL(e, Nl.DisableUniformityAnalysis || t);
    return Nl.ShowWGSLShaderCode && (console.log(r), console.log("***********************************************")), Nl.DisableUniformityAnalysis || t ? `diagnostic(off, derivative_uniformity);
` + r : r;
  }
}
Nl._TWgslDefaultOptions = {
  jsPath: `${ye._DefaultCdnUrl}/twgsl/twgsl.js`,
  wasmPath: `${ye._DefaultCdnUrl}/twgsl/twgsl.wasm`
};
Nl.ShowWGSLShaderCode = !1;
Nl.DisableUniformityAnalysis = !1;
Nl._twgsl = null;
class kle {
  constructor(e, t, r) {
    this._record = !1, this._play = !1, this._playBundleListIndex = 0, this._allBundleLists = [], this._enabled = !1, this._engine = e, this._mode = t, this._bundleList = r;
  }
  get enabled() {
    return this._enabled;
  }
  get play() {
    return this._play;
  }
  get record() {
    return this._record;
  }
  set enabled(e) {
    this._allBundleLists.length = 0, this._record = this._enabled = e, this._play = !1, e && (this._modeSaved = this._mode, this._mode = 0);
  }
  get mode() {
    return this._mode;
  }
  set mode(e) {
    this._record ? this._modeSaved = e : this._mode = e;
  }
  endRenderPass(e) {
    if (!this._record && !this._play)
      return !1;
    let t;
    if (this._record)
      t = this._bundleList.clone(), this._allBundleLists.push(t), this._bundleList.reset();
    else {
      if (this._playBundleListIndex >= this._allBundleLists.length)
        throw new Error(`Invalid playBundleListIndex! Your snapshot is no longer valid for the current frame, you should recreate a new one. playBundleListIndex=${this._playBundleListIndex}, allBundleLists.length=${this._allBundleLists.length}}`);
      t = this._allBundleLists[this._playBundleListIndex++];
    }
    return t.run(e), this._mode === 1 && this._engine._reportDrawCall(t.numDrawCalls), !0;
  }
  endFrame() {
    this._record && (this._record = !1, this._play = !0, this._mode = this._modeSaved), this._playBundleListIndex = 0;
  }
  reset() {
    this.enabled = !1, this.enabled = !0;
  }
}
const Ele = "postprocessVertexShader", Fle = `attribute position: vec2<f32>;uniform scale: vec2<f32>;varying vUV: vec2<f32>;const madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
vertexOutputs.vUV=(vertexInputs.position*madd+madd)*uniforms.scale;vertexOutputs.position=vec4(vertexInputs.position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStoreWGSL[Ele] = Fle;
const DG = {
  label: "TextureView_SwapChain_ResolveTarget",
  dimension: Hp.E2d,
  format: void 0,
  mipLevelCount: 1,
  arrayLayerCount: 1
}, jG = {
  label: "TextureView_SwapChain",
  dimension: Hp.E2d,
  format: void 0,
  mipLevelCount: 1,
  arrayLayerCount: 1
}, hC = "/* disable_uniformity_analysis */", Nle = new xt();
class wn extends Ge {
  /**
   * Gets or sets the snapshot rendering mode
   */
  get snapshotRenderingMode() {
    return this._snapshotRendering.mode;
  }
  set snapshotRenderingMode(e) {
    this._snapshotRendering.mode = e;
  }
  /**
   * Creates a new snapshot at the next frame using the current snapshotRenderingMode
   */
  snapshotRenderingReset() {
    this._snapshotRendering.reset();
  }
  /**
   * Enables or disables the snapshot rendering mode
   * Note that the WebGL engine does not support snapshot rendering so setting the value won't have any effect for this engine
   */
  get snapshotRendering() {
    return this._snapshotRendering.enabled;
  }
  set snapshotRendering(e) {
    this._snapshotRendering.enabled = e;
  }
  /**
   * Sets this to true to disable the cache for the samplers. You should do it only for testing purpose!
   */
  get disableCacheSamplers() {
    return this._cacheSampler ? this._cacheSampler.disabled : !1;
  }
  set disableCacheSamplers(e) {
    this._cacheSampler && (this._cacheSampler.disabled = e);
  }
  /**
   * Sets this to true to disable the cache for the render pipelines. You should do it only for testing purpose!
   */
  get disableCacheRenderPipelines() {
    return this._cacheRenderPipeline ? this._cacheRenderPipeline.disabled : !1;
  }
  set disableCacheRenderPipelines(e) {
    this._cacheRenderPipeline && (this._cacheRenderPipeline.disabled = e);
  }
  /**
   * Sets this to true to disable the cache for the bind groups. You should do it only for testing purpose!
   */
  get disableCacheBindGroups() {
    return this._cacheBindGroups ? this._cacheBindGroups.disabled : !1;
  }
  set disableCacheBindGroups(e) {
    this._cacheBindGroups && (this._cacheBindGroups.disabled = e);
  }
  /**
   * Gets a Promise<boolean> indicating if the engine can be instantiated (ie. if a WebGPU context can be found)
   */
  static get IsSupportedAsync() {
    return navigator.gpu ? navigator.gpu.requestAdapter().then((e) => !!e, () => !1).catch(() => !1) : Promise.resolve(!1);
  }
  /**
   * Not supported by WebGPU, you should call IsSupportedAsync instead!
   */
  static get IsSupported() {
    return Se.Warn("You must call IsSupportedAsync for WebGPU!"), !1;
  }
  /**
   * Gets a boolean indicating that the engine supports uniform buffers
   */
  get supportsUniformBuffers() {
    return !0;
  }
  /** Gets the supported extensions by the WebGPU adapter */
  get supportedExtensions() {
    return this._adapterSupportedExtensions;
  }
  /** Gets the currently enabled extensions on the WebGPU device */
  get enabledExtensions() {
    return this._deviceEnabledExtensions;
  }
  /** Gets the supported limits by the WebGPU adapter */
  get supportedLimits() {
    return this._adapterSupportedLimits;
  }
  /** Gets the current limits of the WebGPU device */
  get currentLimits() {
    return this._deviceLimits;
  }
  /**
   * Returns a string describing the current engine
   */
  get description() {
    return this.name + this.version;
  }
  /**
   * Returns the version of the engine
   */
  get version() {
    return 1;
  }
  /**
   * Gets an object containing information about the current engine context
   * @returns an object containing the vendor, the renderer and the version of the current engine context
   */
  getInfo() {
    return {
      vendor: this._adapterInfo.vendor || "unknown vendor",
      renderer: this._adapterInfo.architecture || "unknown renderer",
      version: this._adapterInfo.description || "unknown version"
    };
  }
  /**
   * (WebGPU only) True (default) to be in compatibility mode, meaning rendering all existing scenes without artifacts (same rendering than WebGL).
   * Setting the property to false will improve performances but may not work in some scenes if some precautions are not taken.
   * See https://doc.babylonjs.com/setup/support/webGPU/webGPUOptimization/webGPUNonCompatibilityMode for more details
   */
  get compatibilityMode() {
    return this._compatibilityMode;
  }
  set compatibilityMode(e) {
    this._compatibilityMode = e;
  }
  /** @internal */
  get currentSampleCount() {
    return this._currentRenderTarget ? this._currentRenderTarget.samples : this._mainPassSampleCount;
  }
  /**
   * Create a new instance of the gpu engine asynchronously
   * @param canvas Defines the canvas to use to display the result
   * @param options Defines the options passed to the engine to create the GPU context dependencies
   * @returns a promise that resolves with the created engine
   */
  static CreateAsync(e, t = {}) {
    const r = new wn(e, t);
    return new Promise((n) => {
      r.initAsync(t.glslangOptions, t.twgslOptions).then(() => n(r));
    });
  }
  /**
   * Create a new instance of the gpu engine.
   * @param canvas Defines the canvas to use to display the result
   * @param options Defines the options passed to the engine to create the GPU context dependencies
   */
  constructor(e, t = {}) {
    var r, n;
    if (super(null, (r = t.antialias) !== null && r !== void 0 ? r : !0, t), this._uploadEncoderDescriptor = { label: "upload" }, this._renderEncoderDescriptor = { label: "render" }, this._clearDepthValue = 1, this._clearReverseDepthValue = 0, this._clearStencilValue = 0, this._defaultSampleCount = 4, this._glslang = null, this._tintWASM = null, this._adapterInfo = {
      vendor: "",
      architecture: "",
      device: "",
      description: ""
    }, this._compiledComputeEffects = {}, this._counters = {
      numEnableEffects: 0,
      numEnableDrawWrapper: 0,
      numBundleCreationNonCompatMode: 0,
      numBundleReuseNonCompatMode: 0
    }, this.countersLastFrame = {
      numEnableEffects: 0,
      numEnableDrawWrapper: 0,
      numBundleCreationNonCompatMode: 0,
      numBundleReuseNonCompatMode: 0
    }, this.numMaxUncapturedErrors = 20, this._commandBuffers = [null, null], this._currentRenderPass = null, this._mainRenderPassWrapper = {
      renderPassDescriptor: null,
      colorAttachmentViewDescriptor: null,
      depthAttachmentViewDescriptor: null,
      colorAttachmentGPUTextures: [],
      depthTextureFormat: void 0
    }, this._rttRenderPassWrapper = {
      renderPassDescriptor: null,
      colorAttachmentViewDescriptor: null,
      depthAttachmentViewDescriptor: null,
      colorAttachmentGPUTextures: [],
      depthTextureFormat: void 0
    }, this._pendingDebugCommands = [], this._currentOverrideVertexBuffers = null, this._currentIndexBuffer = null, this._colorWriteLocal = !0, this._forceEnableEffect = !1, this.dbgShowShaderCode = !1, this.dbgSanityChecks = !0, this.dbgVerboseLogsForFirstFrames = !1, this.dbgVerboseLogsNumFrames = 10, this.dbgLogIfNotDrawWrapper = !0, this.dbgShowEmptyEnableEffectCalls = !0, this.isNDCHalfZRange = !0, this.hasOriginBottomLeft = !1, this._viewportsCurrent = { x: 0, y: 0, w: 0, h: 0 }, this._scissorsCurrent = { x: 0, y: 0, w: 0, h: 0 }, this._scissorCached = { x: 0, y: 0, z: 0, w: 0 }, this._stencilRefsCurrent = -1, this._blendColorsCurrent = [null, null, null, null], this._name = "WebGPU", t.deviceDescriptor = t.deviceDescriptor || {}, t.enableGPUDebugMarkers = (n = t.enableGPUDebugMarkers) !== null && n !== void 0 ? n : !1, Se.Log(`Babylon.js v${Ge.Version} - ${this.description} engine`), !navigator.gpu) {
      Se.Error("WebGPU is not supported by your browser.");
      return;
    }
    t.swapChainFormat = t.swapChainFormat || navigator.gpu.getPreferredCanvasFormat(), this._isWebGPU = !0, this._shaderPlatformName = "WEBGPU", this._renderingCanvas = e, this._options = t, this._mainPassSampleCount = t.antialias ? this._defaultSampleCount : 1, this._setupMobileChecks(), this._sharedInit(e), this._shaderProcessor = new Uue(), this._shaderProcessorWGSL = new Ple();
  }
  //------------------------------------------------------------------------------
  //                              Initialization
  //------------------------------------------------------------------------------
  /**
   * Initializes the WebGPU context and dependencies.
   * @param glslangOptions Defines the GLSLang compiler options if necessary
   * @param twgslOptions Defines the Twgsl compiler options if necessary
   * @returns a promise notifying the readiness of the engine.
   */
  initAsync(e, t) {
    var r;
    return this._initGlslang(e ?? ((r = this._options) === null || r === void 0 ? void 0 : r.glslangOptions)).then((n) => {
      var i;
      return this._glslang = n, this._tintWASM = wn.UseTWGSL ? new Nl() : null, this._tintWASM ? this._tintWASM.initTwgsl(t ?? ((i = this._options) === null || i === void 0 ? void 0 : i.twgslOptions)).then(() => navigator.gpu.requestAdapter(this._options), (s) => {
        throw Se.Error("Can not initialize twgsl!"), Se.Error(s), Error("WebGPU initializations stopped.");
      }) : navigator.gpu.requestAdapter(this._options);
    }, (n) => {
      throw Se.Error("Can not initialize glslang!"), Se.Error(n), Error("WebGPU initializations stopped.");
    }).then((n) => {
      var i, s, a;
      if (n) {
        this._adapter = n, this._adapterSupportedExtensions = [], (i = this._adapter.features) === null || i === void 0 || i.forEach((d) => this._adapterSupportedExtensions.push(d)), this._adapterSupportedLimits = this._adapter.limits, this._adapter.requestAdapterInfo().then((d) => {
          this._adapterInfo = d;
        });
        const f = (s = this._options.deviceDescriptor) !== null && s !== void 0 ? s : {}, o = (a = f == null ? void 0 : f.requiredFeatures) !== null && a !== void 0 ? a : this._options.enableAllFeatures ? this._adapterSupportedExtensions : void 0;
        if (o) {
          const d = o, v = [];
          for (const u of d)
            this._adapterSupportedExtensions.indexOf(u) !== -1 && v.push(u);
          f.requiredFeatures = v;
        }
        if (this._options.setMaximumLimits && !f.requiredLimits) {
          f.requiredLimits = {};
          for (const d in this._adapterSupportedLimits)
            f.requiredLimits[d] = this._adapterSupportedLimits[d];
        }
        return this._adapter.requestDevice(f);
      } else
        throw "Could not retrieve a WebGPU adapter (adapter is null).";
    }).then((n) => {
      var i, s;
      this._device = n, this._deviceEnabledExtensions = [], (i = this._device.features) === null || i === void 0 || i.forEach((f) => this._deviceEnabledExtensions.push(f)), this._deviceLimits = n.limits;
      let a = -1;
      this._device.addEventListener("uncapturederror", (f) => {
        ++a < this.numMaxUncapturedErrors ? Se.Warn(`WebGPU uncaptured error (${a + 1}): ${f.error} - ${f.error.message}`) : a++ === this.numMaxUncapturedErrors && Se.Warn(`WebGPU uncaptured error: too many warnings (${this.numMaxUncapturedErrors}), no more warnings will be reported to the console for this engine.`);
      }), this._doNotHandleContextLost || (s = this._device.lost) === null || s === void 0 || s.then((f) => {
        this._isDisposed || (this._contextWasLost = !0, Se.Warn("WebGPU context lost. " + f), this.onContextLostObservable.notifyObservers(this), this._restoreEngineAfterContextLost(() => this.initAsync()));
      });
    }, (n) => {
      Se.Error("Could not retrieve a WebGPU device."), Se.Error(n);
    }).then(() => {
      this._bufferManager = new tO(this._device), this._textureHelper = new Ns(this._device, this._glslang, this._tintWASM, this._bufferManager, this._deviceEnabledExtensions), this._cacheSampler = new rD(this._device), this._cacheBindGroups = new d1(this._device, this._cacheSampler, this), this._timestampQuery = new Cle(this._device, this._bufferManager), this._occlusionQuery = this._device.createQuerySet ? new yle(this, this._device, this._bufferManager) : void 0, this._bundleList = new JQ(this._device), this._snapshotRendering = new kle(this, this._snapshotRenderingMode, this._bundleList), this._ubInvertY = this._bufferManager.createBuffer(new Float32Array([-1, 0]), ga.Uniform | ga.CopyDst, "UBInvertY"), this._ubDontInvertY = this._bufferManager.createBuffer(new Float32Array([1, 0]), ga.Uniform | ga.CopyDst, "UBDontInvertY"), this.dbgVerboseLogsForFirstFrames && this._count === void 0 && (this._count = 0, console.log("%c frame #" + this._count + " - begin", "background: #ffff00")), this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor), this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor), this._initializeLimits(), this._emptyVertexBuffer = new J(this, [0], "", !1, !1, 1, !1, 0, 1), this._cacheRenderPipeline = new N2(this._device, this._emptyVertexBuffer), this._depthCullingState = new Wle(this._cacheRenderPipeline), this._stencilStateComposer = new Ble(this._cacheRenderPipeline), this._stencilStateComposer.stencilGlobal = this._stencilState, this._depthCullingState.depthTest = !0, this._depthCullingState.depthFunc = 515, this._depthCullingState.depthMask = !0, this._textureHelper.setCommandEncoder(this._uploadEncoder), this._clearQuad = new Vle(this._device, this, this._emptyVertexBuffer), this._defaultDrawContext = this.createDrawContext(), this._currentDrawContext = this._defaultDrawContext, this._defaultMaterialContext = this.createMaterialContext(), this._currentMaterialContext = this._defaultMaterialContext, this._initializeContextAndSwapChain(), this._initializeMainAttachments(), this.resize();
    }).catch((n) => {
      Se.Error("Can not create WebGPU Device and/or context."), Se.Error(n), console.trace && console.trace();
    });
  }
  _initGlslang(e) {
    return e = e || {}, e = Object.assign(Object.assign({}, wn._GLSLslangDefaultOptions), e), e.glslang ? Promise.resolve(e.glslang) : self.glslang ? self.glslang(e.wasmPath) : e.jsPath && e.wasmPath ? ye.LoadBabylonScriptAsync(e.jsPath).then(() => self.glslang(ye.GetBabylonScriptURL(e.wasmPath))) : Promise.reject("gslang is not available.");
  }
  _initializeLimits() {
    this._caps = {
      maxTexturesImageUnits: this._deviceLimits.maxSampledTexturesPerShaderStage,
      maxVertexTextureImageUnits: this._deviceLimits.maxSampledTexturesPerShaderStage,
      maxCombinedTexturesImageUnits: this._deviceLimits.maxSampledTexturesPerShaderStage * 2,
      maxTextureSize: this._deviceLimits.maxTextureDimension2D,
      maxCubemapTextureSize: this._deviceLimits.maxTextureDimension2D,
      maxRenderTextureSize: this._deviceLimits.maxTextureDimension2D,
      maxVertexAttribs: this._deviceLimits.maxVertexAttributes,
      maxVaryingVectors: this._deviceLimits.maxInterStageShaderVariables,
      maxFragmentUniformVectors: Math.floor(this._deviceLimits.maxUniformBufferBindingSize / 4),
      maxVertexUniformVectors: Math.floor(this._deviceLimits.maxUniformBufferBindingSize / 4),
      standardDerivatives: !0,
      astc: this._deviceEnabledExtensions.indexOf(k2.TextureCompressionASTC) >= 0 ? !0 : void 0,
      s3tc: this._deviceEnabledExtensions.indexOf(k2.TextureCompressionBC) >= 0 ? !0 : void 0,
      pvrtc: null,
      etc1: null,
      etc2: this._deviceEnabledExtensions.indexOf(k2.TextureCompressionETC2) >= 0 ? !0 : void 0,
      bptc: this._deviceEnabledExtensions.indexOf(k2.TextureCompressionBC) >= 0 ? !0 : void 0,
      maxAnisotropy: 16,
      uintIndices: !0,
      fragmentDepthSupported: !0,
      highPrecisionShaderSupported: !0,
      colorBufferFloat: !0,
      supportFloatTexturesResolve: !1,
      textureFloat: !0,
      textureFloatLinearFiltering: this._deviceEnabledExtensions.indexOf(k2.Float32Filterable) >= 0,
      textureFloatRender: !0,
      textureHalfFloat: !0,
      textureHalfFloatLinearFiltering: !0,
      textureHalfFloatRender: !0,
      textureLOD: !0,
      texelFetch: !0,
      drawBuffersExtension: !0,
      depthTextureExtension: !0,
      vertexArrayObject: !1,
      instancedArrays: !0,
      timerQuery: typeof BigUint64Array < "u" && this._deviceEnabledExtensions.indexOf(k2.TimestampQuery) !== -1 ? !0 : void 0,
      supportOcclusionQuery: typeof BigUint64Array < "u",
      canUseTimestampForTimerQuery: !0,
      multiview: !1,
      oculusMultiview: !1,
      parallelShaderCompile: void 0,
      blendMinMax: !0,
      maxMSAASamples: 4,
      canUseGLInstanceID: !0,
      canUseGLVertexID: !0,
      supportComputeShaders: !0,
      supportSRGBBuffers: !0,
      supportTransformFeedbacks: !1,
      textureMaxLevel: !0,
      texture2DArrayMaxLayerCount: this._deviceLimits.maxTextureArrayLayers,
      disableMorphTargetTexture: !1
    }, this._caps.parallelShaderCompile = null, this._features = {
      forceBitmapOverHTMLImageElement: !0,
      supportRenderAndCopyToLodForFloatTextures: !0,
      supportDepthStencilTexture: !0,
      supportShadowSamplers: !0,
      uniformBufferHardCheckMatrix: !1,
      allowTexturePrefiltering: !0,
      trackUbosInFrame: !0,
      checkUbosContentBeforeUpload: !0,
      supportCSM: !0,
      basisNeedsPOT: !1,
      support3DTextures: !0,
      needTypeSuffixInShaderConstants: !0,
      supportMSAA: !0,
      supportSSAO2: !0,
      supportExtendedTextureFormats: !0,
      supportSwitchCaseInShader: !0,
      supportSyncTextureRead: !1,
      needsInvertingBitmap: !1,
      useUBOBindingCache: !1,
      needShaderCodeInlining: !0,
      needToAlwaysBindUniformBuffers: !0,
      supportRenderPasses: !0,
      supportSpriteInstancing: !0,
      forceVertexBufferStrideMultiple4Bytes: !0,
      _collectUbosUpdatedInFrame: !1
    };
  }
  _initializeContextAndSwapChain() {
    if (!this._renderingCanvas)
      throw "The rendering canvas has not been set!";
    this._context = this._renderingCanvas.getContext("webgpu"), this._configureContext(), this._colorFormat = this._options.swapChainFormat, this._mainRenderPassWrapper.colorAttachmentGPUTextures = [new DC()], this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format = this._colorFormat, this._setColorFormat(this._mainRenderPassWrapper);
  }
  // Set default values as WebGL with depth and stencil attachment for the broadest Compat.
  _initializeMainAttachments() {
    if (!this._bufferManager)
      return;
    this.flushFramebuffer(), this._mainTextureExtends = {
      width: this.getRenderWidth(!0),
      height: this.getRenderHeight(!0),
      depthOrArrayLayers: 1
    };
    const e = new Float32Array([this.getRenderHeight(!0)]);
    this._bufferManager.setSubData(this._ubInvertY, 4, e), this._bufferManager.setSubData(this._ubDontInvertY, 4, e);
    let t;
    if (this._options.antialias) {
      const i = {
        label: `Texture_MainColor_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}_antialiasing`,
        size: this._mainTextureExtends,
        mipLevelCount: 1,
        sampleCount: this._mainPassSampleCount,
        dimension: Hp.E2d,
        format: this._options.swapChainFormat,
        usage: Po.RenderAttachment
      };
      this._mainTexture && this._textureHelper.releaseTexture(this._mainTexture), this._mainTexture = this._device.createTexture(i), t = [
        {
          view: this._mainTexture.createView({
            label: "TextureView_MainColor_antialiasing",
            dimension: Hp.E2d,
            format: this._options.swapChainFormat,
            mipLevelCount: 1,
            arrayLayerCount: 1
          }),
          clearValue: new xt(0, 0, 0, 1),
          loadOp: f9.Clear,
          storeOp: Hc.Store
          // don't use StoreOp.Discard, else using several cameras with different viewports or using scissors will fail because we call beginRenderPass / endPass several times for the same color attachment!
        }
      ];
    } else
      t = [
        {
          view: void 0,
          clearValue: new xt(0, 0, 0, 1),
          loadOp: f9.Clear,
          storeOp: Hc.Store
        }
      ];
    this._mainRenderPassWrapper.depthTextureFormat = this.isStencilEnable ? we.Depth24PlusStencil8 : we.Depth32Float, this._setDepthTextureFormat(this._mainRenderPassWrapper), this._setColorFormat(this._mainRenderPassWrapper);
    const r = {
      label: `Texture_MainDepthStencil_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}`,
      size: this._mainTextureExtends,
      mipLevelCount: 1,
      sampleCount: this._mainPassSampleCount,
      dimension: Hp.E2d,
      format: this._mainRenderPassWrapper.depthTextureFormat,
      usage: Po.RenderAttachment
    };
    this._depthTexture && this._textureHelper.releaseTexture(this._depthTexture), this._depthTexture = this._device.createTexture(r);
    const n = {
      view: this._depthTexture.createView({
        label: `TextureView_MainDepthStencil_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}`,
        dimension: Hp.E2d,
        format: this._depthTexture.format,
        mipLevelCount: 1,
        arrayLayerCount: 1
      }),
      depthClearValue: this._clearDepthValue,
      depthLoadOp: f9.Clear,
      depthStoreOp: Hc.Store,
      stencilClearValue: this._clearStencilValue,
      stencilLoadOp: this.isStencilEnable ? f9.Clear : void 0,
      stencilStoreOp: this.isStencilEnable ? Hc.Store : void 0
    };
    this._mainRenderPassWrapper.renderPassDescriptor = {
      label: "MainRenderPass",
      colorAttachments: t,
      depthStencilAttachment: n
    };
  }
  _configureContext() {
    this._context.configure({
      device: this._device,
      format: this._options.swapChainFormat,
      usage: Po.RenderAttachment | Po.CopySrc,
      alphaMode: this.premultipliedAlpha ? JI.Premultiplied : JI.Opaque
    });
  }
  /**
   * Force a specific size of the canvas
   * @param width defines the new canvas' width
   * @param height defines the new canvas' height
   * @param forceSetSize true to force setting the sizes of the underlying canvas
   * @returns true if the size was changed
   */
  setSize(e, t, r = !1) {
    return super.setSize(e, t, r) ? (this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - setSize -", e, t)), this._initializeMainAttachments(), this.snapshotRendering && this.snapshotRenderingReset(), !0) : !1;
  }
  /**
   * @internal
   */
  _getShaderProcessor(e) {
    return e === za.WGSL ? this._shaderProcessorWGSL : this._shaderProcessor;
  }
  /**
   * @internal
   */
  _getShaderProcessingContext(e) {
    return new gp(e);
  }
  _currentPassIsMainPass() {
    return this._currentRenderTarget === null;
  }
  _getCurrentRenderPass() {
    return this._currentRenderTarget && !this._currentRenderPass ? this._startRenderTargetRenderPass(this._currentRenderTarget, !1, null, !1, !1) : this._currentRenderPass || this._startMainRenderPass(!1), this._currentRenderPass;
  }
  /** @internal */
  _getCurrentRenderPassWrapper() {
    return this._currentRenderTarget ? this._rttRenderPassWrapper : this._mainRenderPassWrapper;
  }
  //------------------------------------------------------------------------------
  //                          Static Pipeline WebGPU States
  //------------------------------------------------------------------------------
  /** @internal */
  applyStates() {
    this._stencilStateComposer.apply(), this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend);
  }
  /**
   * Force the entire cache to be cleared
   * You should not have to use this function unless your engine needs to share the WebGPU context with another engine
   * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)
   */
  wipeCaches(e) {
    this.preventCacheWipeBetweenFrames && !e || (this._forceEnableEffect = !0, this._currentIndexBuffer = null, this._currentOverrideVertexBuffers = null, this._cacheRenderPipeline.setBuffers(null, null, null), e && (this._stencilStateComposer.reset(), this._depthCullingState.reset(), this._depthCullingState.depthFunc = 515, this._alphaState.reset(), this._alphaMode = 1, this._alphaEquation = 0, this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters), this._cacheRenderPipeline.setAlphaBlendEnabled(!1), this.setColorWrite(!0)), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null);
  }
  /**
   * Enable or disable color writing
   * @param enable defines the state to set
   */
  setColorWrite(e) {
    this._colorWriteLocal = e, this._cacheRenderPipeline.setWriteMask(e ? 15 : 0);
  }
  /**
   * Gets a boolean indicating if color writing is enabled
   * @returns the current color writing state
   */
  getColorWrite() {
    return this._colorWriteLocal;
  }
  _mustUpdateViewport() {
    const e = this._viewportCached.x, t = this._viewportCached.y, r = this._viewportCached.z, n = this._viewportCached.w, i = this._viewportsCurrent.x !== e || this._viewportsCurrent.y !== t || this._viewportsCurrent.w !== r || this._viewportsCurrent.h !== n;
    return i && (this._viewportsCurrent.x = this._viewportCached.x, this._viewportsCurrent.y = this._viewportCached.y, this._viewportsCurrent.w = this._viewportCached.z, this._viewportsCurrent.h = this._viewportCached.w), i;
  }
  _applyViewport(e) {
    const t = Math.floor(this._viewportCached.x), r = Math.floor(this._viewportCached.z), n = Math.floor(this._viewportCached.w);
    let i = Math.floor(this._viewportCached.y);
    this._currentRenderTarget || (i = this.getRenderHeight(!0) - i - n), e ? e.addItem(new NQ(t, i, r, n)) : this._getCurrentRenderPass().setViewport(t, i, r, n, 0, 1), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - viewport applied - (", this._viewportCached.x, this._viewportCached.y, this._viewportCached.z, this._viewportCached.w, ") current pass is main pass=" + this._currentPassIsMainPass()));
  }
  /**
   * @internal
   */
  _viewport(e, t, r, n) {
    this._viewportCached.x = e, this._viewportCached.y = t, this._viewportCached.z = r, this._viewportCached.w = n;
  }
  _mustUpdateScissor() {
    const e = this._scissorCached.x, t = this._scissorCached.y, r = this._scissorCached.z, n = this._scissorCached.w, i = this._scissorsCurrent.x !== e || this._scissorsCurrent.y !== t || this._scissorsCurrent.w !== r || this._scissorsCurrent.h !== n;
    return i && (this._scissorsCurrent.x = this._scissorCached.x, this._scissorsCurrent.y = this._scissorCached.y, this._scissorsCurrent.w = this._scissorCached.z, this._scissorsCurrent.h = this._scissorCached.w), i;
  }
  _applyScissor(e) {
    const t = this._currentRenderTarget ? this._scissorCached.y : this.getRenderHeight() - this._scissorCached.w - this._scissorCached.y;
    e ? e.addItem(new QQ(this._scissorCached.x, t, this._scissorCached.z, this._scissorCached.w)) : this._getCurrentRenderPass().setScissorRect(this._scissorCached.x, t, this._scissorCached.z, this._scissorCached.w), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - scissor applied - (", this._scissorCached.x, this._scissorCached.y, this._scissorCached.z, this._scissorCached.w, ") current pass is main pass=" + this._currentPassIsMainPass()));
  }
  _scissorIsActive() {
    return this._scissorCached.x !== 0 || this._scissorCached.y !== 0 || this._scissorCached.z !== 0 || this._scissorCached.w !== 0;
  }
  enableScissor(e, t, r, n) {
    this._scissorCached.x = e, this._scissorCached.y = t, this._scissorCached.z = r, this._scissorCached.w = n;
  }
  disableScissor() {
    this._scissorCached.x = this._scissorCached.y = this._scissorCached.z = this._scissorCached.w = 0, this._scissorsCurrent.x = this._scissorsCurrent.y = this._scissorsCurrent.w = this._scissorsCurrent.h = 0;
  }
  _mustUpdateStencilRef() {
    const e = this._stencilStateComposer.funcRef !== this._stencilRefsCurrent;
    return e && (this._stencilRefsCurrent = this._stencilStateComposer.funcRef), e;
  }
  _applyStencilRef(e) {
    var t, r;
    e ? e.addItem(new rO((t = this._stencilStateComposer.funcRef) !== null && t !== void 0 ? t : 0)) : this._getCurrentRenderPass().setStencilReference((r = this._stencilStateComposer.funcRef) !== null && r !== void 0 ? r : 0);
  }
  _mustUpdateBlendColor() {
    const e = this._alphaState._blendConstants, t = e[0] !== this._blendColorsCurrent[0] || e[1] !== this._blendColorsCurrent[1] || e[2] !== this._blendColorsCurrent[2] || e[3] !== this._blendColorsCurrent[3];
    return t && (this._blendColorsCurrent[0] = e[0], this._blendColorsCurrent[1] = e[1], this._blendColorsCurrent[2] = e[2], this._blendColorsCurrent[3] = e[3]), t;
  }
  _applyBlendColor(e) {
    e ? e.addItem(new YQ(this._alphaState._blendConstants.slice())) : this._getCurrentRenderPass().setBlendConstant(this._alphaState._blendConstants);
  }
  _resetRenderPassStates() {
    this._viewportsCurrent.x = this._viewportsCurrent.y = this._viewportsCurrent.w = this._viewportsCurrent.h = 0, this._scissorsCurrent.x = this._scissorsCurrent.y = this._scissorsCurrent.w = this._scissorsCurrent.h = 0, this._stencilRefsCurrent = -1, this._blendColorsCurrent[0] = this._blendColorsCurrent[1] = this._blendColorsCurrent[2] = this._blendColorsCurrent[3] = null;
  }
  /**
   * Clear the current render buffer or the current render target (if any is set up)
   * @param color defines the color to use
   * @param backBuffer defines if the back buffer must be cleared
   * @param depth defines if the depth buffer must be cleared
   * @param stencil defines if the stencil buffer must be cleared
   */
  clear(e, t, r, n = !1) {
    e && e.a === void 0 && (e.a = 1);
    const i = this._scissorIsActive();
    this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - clear - backBuffer=", t, " depth=", r, " stencil=", n, " scissor is active=", i)), this._currentRenderTarget ? i ? (this._currentRenderPass || this._startRenderTargetRenderPass(this._currentRenderTarget, !1, t ? e : null, r, n), this._applyScissor(this.compatibilityMode ? null : this._bundleList), this._clearFullQuad(t ? e : null, r, n)) : (this._currentRenderPass && this._endCurrentRenderPass(), this._startRenderTargetRenderPass(this._currentRenderTarget, !0, t ? e : null, r, n)) : ((!this._currentRenderPass || !i) && this._startMainRenderPass(!i, t ? e : null, r, n), i && (this._applyScissor(this.compatibilityMode ? null : this._bundleList), this._clearFullQuad(t ? e : null, r, n)));
  }
  _clearFullQuad(e, t, r) {
    var n, i;
    const s = this.compatibilityMode ? this._getCurrentRenderPass() : null;
    this._clearQuad.setColorFormat(this._colorFormat), this._clearQuad.setDepthStencilFormat(this._depthTextureFormat), this._clearQuad.setMRTAttachments((n = this._cacheRenderPipeline.mrtAttachments) !== null && n !== void 0 ? n : [], (i = this._cacheRenderPipeline.mrtTextureArray) !== null && i !== void 0 ? i : [], this._cacheRenderPipeline.mrtTextureCount), this.compatibilityMode ? s.setStencilReference(this._clearStencilValue) : this._bundleList.addItem(new rO(this._clearStencilValue));
    const a = this._clearQuad.clear(s, e, t, r, this.currentSampleCount);
    this.compatibilityMode ? this._applyStencilRef(null) : (this._bundleList.addBundle(a), this._applyStencilRef(this._bundleList), this._reportDrawCall());
  }
  //------------------------------------------------------------------------------
  //                              Vertex/Index/Storage Buffers
  //------------------------------------------------------------------------------
  /**
   * Creates a vertex buffer
   * @param data the data for the vertex buffer
   * @param _updatable whether the buffer should be created as updatable
   * @param label defines the label of the buffer (for debug purpose)
   * @returns the new buffer
   */
  createVertexBuffer(e, t, r) {
    let n;
    return e instanceof Array ? n = new Float32Array(e) : e instanceof ArrayBuffer ? n = new Uint8Array(e) : n = e, this._bufferManager.createBuffer(n, ga.Vertex | ga.CopyDst, r);
  }
  /**
   * Creates a vertex buffer
   * @param data the data for the dynamic vertex buffer
   * @param label defines the label of the buffer (for debug purpose)
   * @returns the new buffer
   */
  createDynamicVertexBuffer(e, t) {
    return this.createVertexBuffer(e, void 0, t);
  }
  /**
   * Creates a new index buffer
   * @param indices defines the content of the index buffer
   * @param updatable defines if the index buffer must be updatable
   * @param label defines the label of the buffer (for debug purpose)
   * @returns a new buffer
   */
  createIndexBuffer(e, t, r) {
    let n = !0, i;
    e instanceof Uint32Array || e instanceof Int32Array ? i = e : e instanceof Uint16Array ? (i = e, n = !1) : e.length > 65535 ? i = new Uint32Array(e) : (i = new Uint16Array(e), n = !1);
    const s = this._bufferManager.createBuffer(i, ga.Index | ga.CopyDst, r);
    return s.is32Bits = n, s;
  }
  /**
   * @internal
   */
  _createBuffer(e, t, r) {
    let n;
    e instanceof Array ? n = new Float32Array(e) : e instanceof ArrayBuffer ? n = new Uint8Array(e) : n = e;
    let i = 0;
    return t & 1 && (i |= ga.CopySrc), t & 2 && (i |= ga.CopyDst), t & 4 && (i |= ga.Uniform), t & 8 && (i |= ga.Vertex), t & 16 && (i |= ga.Index), t & 32 && (i |= ga.Storage), this._bufferManager.createBuffer(n, i, r);
  }
  /**
   * @internal
   */
  bindBuffersDirectly() {
    throw "Not implemented on WebGPU";
  }
  /**
   * @internal
   */
  updateAndBindInstancesBuffer() {
    throw "Not implemented on WebGPU";
  }
  /**
   * Bind a list of vertex buffers with the engine
   * @param vertexBuffers defines the list of vertex buffers to bind
   * @param indexBuffer defines the index buffer to bind
   * @param effect defines the effect associated with the vertex buffers
   * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
   */
  bindBuffers(e, t, r, n) {
    this._currentIndexBuffer = t, this._currentOverrideVertexBuffers = n ?? null, this._cacheRenderPipeline.setBuffers(e, t, this._currentOverrideVertexBuffers);
  }
  /**
   * @internal
   */
  _releaseBuffer(e) {
    return this._bufferManager.releaseBuffer(e);
  }
  //------------------------------------------------------------------------------
  //                              Effects
  //------------------------------------------------------------------------------
  /**
   * Create a new effect (used to store vertex/fragment shaders)
   * @param baseName defines the base name of the effect (The name of file without .fragment.fx or .vertex.fx)
   * @param attributesNamesOrOptions defines either a list of attribute names or an IEffectCreationOptions object
   * @param uniformsNamesOrEngine defines either a list of uniform names or the engine to use
   * @param samplers defines an array of string used to represent textures
   * @param defines defines the string containing the defines to use to compile the shaders
   * @param fallbacks defines the list of potential fallbacks to use if shader compilation fails
   * @param onCompiled defines a function to call when the effect creation is successful
   * @param onError defines a function to call when the effect creation has failed
   * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
   * @param shaderLanguage the language the shader is written in (default: GLSL)
   * @returns the new Effect
   */
  createEffect(e, t, r, n, i, s, a, f, o, d = za.GLSL) {
    var v;
    const u = e.vertexElement || e.vertex || e.vertexToken || e.vertexSource || e, l = e.fragmentElement || e.fragment || e.fragmentToken || e.fragmentSource || e, P = this._getGlobalDefines();
    let p = (v = i ?? t.defines) !== null && v !== void 0 ? v : "";
    P && (p += `
` + P);
    const c = u + "+" + l + "@" + p;
    if (this._compiledEffects[c]) {
      const T = this._compiledEffects[c];
      return a && T.isReady() && a(T), T;
    }
    const H = new An(e, t, r, n, this, i, s, a, f, o, c, d);
    return this._compiledEffects[c] = H, H;
  }
  _compileRawShaderToSpirV(e, t) {
    return this._glslang.compileGLSL(e, t);
  }
  _compileShaderToSpirV(e, t, r, n) {
    return this._compileRawShaderToSpirV(n + (r ? r + `
` : "") + e, t);
  }
  _getWGSLShader(e, t, r) {
    return r ? r = "//" + r.split(`
`).join(`
//`) + `
` : r = "", r + e;
  }
  _createPipelineStageDescriptor(e, t, r, n, i) {
    return this._tintWASM && r === za.GLSL && (e = this._tintWASM.convertSpirV2WGSL(e, n), t = this._tintWASM.convertSpirV2WGSL(t, i)), {
      vertexStage: {
        module: this._device.createShaderModule({
          code: e
        }),
        entryPoint: "main"
      },
      fragmentStage: {
        module: this._device.createShaderModule({
          code: t
        }),
        entryPoint: "main"
      }
    };
  }
  _compileRawPipelineStageDescriptor(e, t, r) {
    const n = e.indexOf(hC) >= 0, i = t.indexOf(hC) >= 0, s = r === za.GLSL ? this._compileRawShaderToSpirV(e, "vertex") : e, a = r === za.GLSL ? this._compileRawShaderToSpirV(t, "fragment") : t;
    return this._createPipelineStageDescriptor(s, a, r, n, i);
  }
  _compilePipelineStageDescriptor(e, t, r, n) {
    this.onBeforeShaderCompilationObservable.notifyObservers(this);
    const i = e.indexOf(hC) >= 0, s = t.indexOf(hC) >= 0, a = `#version 450
`, f = n === za.GLSL ? this._compileShaderToSpirV(e, "vertex", r, a) : this._getWGSLShader(e, "vertex", r), o = n === za.GLSL ? this._compileShaderToSpirV(t, "fragment", r, a) : this._getWGSLShader(t, "fragment", r), d = this._createPipelineStageDescriptor(f, o, n, i, s);
    return this.onAfterShaderCompilationObservable.notifyObservers(this), d;
  }
  /**
   * @internal
   */
  createRawShaderProgram() {
    throw "Not available on WebGPU";
  }
  /**
   * @internal
   */
  createShaderProgram() {
    throw "Not available on WebGPU";
  }
  /**
   * Inline functions in shader code that are marked to be inlined
   * @param code code to inline
   * @returns inlined code
   */
  inlineShaderCode(e) {
    const t = new Aq(e);
    return t.debug = !1, t.processCode(), t.code;
  }
  /**
   * Creates a new pipeline context
   * @param shaderProcessingContext defines the shader processing context used during the processing if available
   * @returns the new pipeline
   */
  createPipelineContext(e) {
    return new Bue(e, this);
  }
  /**
   * Creates a new material context
   * @returns the new context
   */
  createMaterialContext() {
    return new sy();
  }
  /**
   * Creates a new draw context
   * @returns the new context
   */
  createDrawContext() {
    return new tV(this._bufferManager);
  }
  /**
   * @internal
   */
  _preparePipelineContext(e, t, r, n, i, s, a, f) {
    const o = e, d = o.shaderProcessingContext.shaderLanguage;
    this.dbgShowShaderCode && (console.log(f), console.log(t), console.log(r), console.log("***********************************************")), o.sources = {
      fragment: r,
      vertex: t,
      rawVertex: i,
      rawFragment: s
    }, n ? o.stages = this._compileRawPipelineStageDescriptor(t, r, d) : o.stages = this._compilePipelineStageDescriptor(t, r, f, d);
  }
  /**
   * Gets the list of active attributes for a given WebGPU program
   * @param pipelineContext defines the pipeline context to use
   * @param attributesNames defines the list of attribute names to get
   * @returns an array of indices indicating the offset of each attribute
   */
  getAttributes(e, t) {
    const r = new Array(t.length), n = e;
    for (let i = 0; i < t.length; i++) {
      const s = t[i], a = n.shaderProcessingContext.availableAttributes[s];
      a !== void 0 && (r[i] = a);
    }
    return r;
  }
  /**
   * Activates an effect, making it the current one (ie. the one used for rendering)
   * @param effect defines the effect to activate
   */
  enableEffect(e) {
    if (!e)
      return;
    let t = !0;
    if (!zo.IsWrapper(e))
      t = e !== this._currentEffect, this._currentEffect = e, this._currentMaterialContext = this._defaultMaterialContext, this._currentDrawContext = this._defaultDrawContext, this._counters.numEnableEffects++, this.dbgLogIfNotDrawWrapper && Se.Warn(`enableEffect has been called with an Effect and not a Wrapper! effect.uniqueId=${e.uniqueId}, effect.name=${e.name}, effect.name.vertex=${e.name.vertex}, effect.name.fragment=${e.name.fragment}`, 10);
    else if (!e.effect || e.effect === this._currentEffect && e.materialContext === this._currentMaterialContext && e.drawContext === this._currentDrawContext && !this._forceEnableEffect) {
      if (!e.effect && this.dbgShowEmptyEnableEffectCalls)
        throw console.error("drawWrapper=", e), "Invalid call to enableEffect: the effect property is empty!";
      return;
    } else if (t = e.effect !== this._currentEffect, this._currentEffect = e.effect, this._currentMaterialContext = e.materialContext, this._currentDrawContext = e.drawContext, this._counters.numEnableDrawWrapper++, !this._currentMaterialContext)
      throw console.error("drawWrapper=", e), "Invalid call to enableEffect: the materialContext property is empty!";
    this._stencilStateComposer.stencilMaterial = void 0, this._forceEnableEffect = t || this._forceEnableEffect ? !1 : this._forceEnableEffect, t && (this._currentEffect.onBind && this._currentEffect.onBind(this._currentEffect), this._currentEffect._onBindObservable && this._currentEffect._onBindObservable.notifyObservers(this._currentEffect));
  }
  /**
   * @internal
   */
  _releaseEffect(e) {
    this._compiledEffects[e._key] && (delete this._compiledEffects[e._key], this._deletePipelineContext(e.getPipelineContext()));
  }
  /**
   * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled
   */
  releaseEffects() {
    for (const e in this._compiledEffects) {
      const t = this._compiledEffects[e].getPipelineContext();
      this._deletePipelineContext(t);
    }
    this._compiledEffects = {};
  }
  _deletePipelineContext(e) {
    e && e.dispose();
  }
  //------------------------------------------------------------------------------
  //                              Textures
  //------------------------------------------------------------------------------
  /**
   * Gets a boolean indicating that only power of 2 textures are supported
   * Please note that you can still use non power of 2 textures but in this case the engine will forcefully convert them
   */
  get needPOTTextures() {
    return !1;
  }
  /** @internal */
  _createHardwareTexture() {
    return new DC();
  }
  /**
   * @internal
   */
  _releaseTexture(e) {
    const t = this._internalTexturesCache.indexOf(e);
    t !== -1 && this._internalTexturesCache.splice(t, 1), this._textureHelper.releaseTexture(e);
  }
  /**
   * @internal
   */
  _getRGBABufferInternalSizedFormat() {
    return 5;
  }
  updateTextureComparisonFunction(e, t) {
    e._comparisonFunction = t;
  }
  /**
   * Creates an internal texture without binding it to a framebuffer
   * @internal
   * @param size defines the size of the texture
   * @param options defines the options used to create the texture
   * @param delayGPUTextureCreation true to delay the texture creation the first time it is really needed. false to create it right away
   * @param source source type of the texture
   * @returns a new internal texture
   */
  _createInternalTexture(e, t, r = !0, n = ri.Unknown) {
    var i, s, a;
    const f = {};
    t !== void 0 && typeof t == "object" ? (f.generateMipMaps = t.generateMipMaps, f.type = t.type === void 0 ? 0 : t.type, f.samplingMode = t.samplingMode === void 0 ? 3 : t.samplingMode, f.format = t.format === void 0 ? 5 : t.format, f.samples = (i = t.samples) !== null && i !== void 0 ? i : 1, f.creationFlags = (s = t.creationFlags) !== null && s !== void 0 ? s : 0, f.useSRGBBuffer = (a = t.useSRGBBuffer) !== null && a !== void 0 ? a : !1, f.label = t.label) : (f.generateMipMaps = t, f.type = 0, f.samplingMode = 3, f.format = 5, f.samples = 1, f.creationFlags = 0, f.useSRGBBuffer = !1), (f.type === 1 && !this._caps.textureFloatLinearFiltering || f.type === 2 && !this._caps.textureHalfFloatLinearFiltering) && (f.samplingMode = 1), f.type === 1 && !this._caps.textureFloat && (f.type = 0, Se.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));
    const o = new As(this, n), d = e.width || e, v = e.height || e, u = e.layers || 0;
    return o.baseWidth = d, o.baseHeight = v, o.width = d, o.height = v, o.depth = u, o.isReady = !0, o.samples = f.samples, o.generateMipMaps = !!f.generateMipMaps, o.samplingMode = f.samplingMode, o.type = f.type, o.format = f.format, o.is2DArray = u > 0, o._cachedWrapU = 0, o._cachedWrapV = 0, o._useSRGBBuffer = f.useSRGBBuffer, o.label = f.label, this._internalTexturesCache.push(o), r || this._textureHelper.createGPUTextureForInternalTexture(o, d, v, u || 1, f.creationFlags), o;
  }
  /**
   * Usually called from Texture.ts.
   * Passed information to create a hardware texture
   * @param url defines a value which contains one of the following:
   * * A conventional http URL, e.g. 'http://...' or 'file://...'
   * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
   * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
   * @param noMipmap defines a boolean indicating that no mipmaps shall be generated.  Ignored for compressed textures.  They must be in the file
   * @param invertY when true, image is flipped when loaded.  You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
   * @param scene needed for loading to the correct scene
   * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
   * @param onLoad optional callback to be called upon successful completion
   * @param onError optional callback to be called upon failure
   * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
   * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
   * @param format internal format.  Default: RGB when extension is '.jpg' else RGBA.  Ignored for compressed textures
   * @param forcedExtension defines the extension to use to pick the right loader
   * @param mimeType defines an optional mime type
   * @param loaderOptions options to be passed to the loader
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
   * @returns a InternalTexture for assignment back into BABYLON.Texture
   */
  createTexture(e, t, r, n, i = 3, s = null, a = null, f = null, o = null, d = null, v = null, u, l, P, p) {
    return this._createTextureBase(e, t, r, n, i, s, a, (c, H, T, q, b, j, w, m) => {
      var I;
      const N = q;
      if (c.baseWidth = N.width, c.baseHeight = N.height, c.width = N.width, c.height = N.height, c.format = c.format !== -1 ? c.format : d ?? 5, c.type = c.type !== -1 ? c.type : 0, m(c.width, c.height, N, H, c, () => {
      }), !((I = c._hardwareTexture) === null || I === void 0) && I.underlyingResource)
        !j && !w && this._generateMipmaps(c, this._uploadEncoder);
      else {
        const k = this._textureHelper.createGPUTextureForInternalTexture(c, N.width, N.height, void 0, P);
        Ns.IsImageBitmap(N) && (this._textureHelper.updateTexture(N, c, N.width, N.height, c.depth, k.format, 0, 0, b, !1, 0, 0), !j && !w && this._generateMipmaps(c, this._uploadEncoder));
      }
      T && T.removePendingData(c), c.isReady = !0, c.onLoadedObservable.notifyObservers(c), c.onLoadedObservable.clear();
    }, () => !1, f, o, d, v, u, l, p);
  }
  /**
   * Wraps an external web gpu texture in a Babylon texture.
   * @param texture defines the external texture
   * @returns the babylon internal texture
   */
  wrapWebGPUTexture(e) {
    const t = new DC(e), r = new As(this, ri.Unknown, !0);
    return r._hardwareTexture = t, r.isReady = !0, r;
  }
  /**
   * Wraps an external web gl texture in a Babylon texture.
   * @returns the babylon internal texture
   */
  wrapWebGLTexture() {
    throw new Error("wrapWebGLTexture is not supported, use wrapWebGPUTexture instead.");
  }
  generateMipMapsForCubemap(e) {
    var t;
    e.generateMipMaps && (!((t = e._hardwareTexture) === null || t === void 0) && t.underlyingResource || this._textureHelper.createGPUTextureForInternalTexture(e), this._generateMipmaps(e));
  }
  /**
   * Update the sampling mode of a given texture
   * @param samplingMode defines the required sampling mode
   * @param texture defines the texture to update
   * @param generateMipMaps defines whether to generate mipmaps for the texture
   */
  updateTextureSamplingMode(e, t, r = !1) {
    r && (t.generateMipMaps = !0, this._generateMipmaps(t)), t.samplingMode = e;
  }
  /**
   * Update the sampling mode of a given texture
   * @param texture defines the texture to update
   * @param wrapU defines the texture wrap mode of the u coordinates
   * @param wrapV defines the texture wrap mode of the v coordinates
   * @param wrapR defines the texture wrap mode of the r coordinates
   */
  updateTextureWrappingMode(e, t, r = null, n = null) {
    t !== null && (e._cachedWrapU = t), r !== null && (e._cachedWrapV = r), (e.is2DArray || e.is3D) && n !== null && (e._cachedWrapR = n);
  }
  /**
   * Update the dimensions of a texture
   * @param texture texture to update
   * @param width new width of the texture
   * @param height new height of the texture
   * @param depth new depth of the texture
   */
  updateTextureDimensions(e, t, r, n = 1) {
    if (!e._hardwareTexture || e.width === t && e.height === r && e.depth === n)
      return;
    const i = e._hardwareTexture.textureAdditionalUsages;
    e._hardwareTexture.release(), this._textureHelper.createGPUTextureForInternalTexture(e, t, r, n, i);
  }
  /**
   * @internal
   */
  _setInternalTexture(e, t, r) {
    if (r = r ?? e, this._currentEffect) {
      const i = this._currentEffect._pipelineContext.shaderProcessingContext.availableTextures[r];
      if (this._currentMaterialContext.setTexture(e, t), i && i.autoBindSampler) {
        const s = r + Wo.AutoSamplerSuffix;
        this._currentMaterialContext.setSampler(s, t);
      }
    }
  }
  /**
   * Sets a texture to the according uniform.
   * @param channel The texture channel
   * @param unused unused parameter
   * @param texture The texture to apply
   * @param name The name of the uniform in the effect
   */
  setTexture(e, t, r, n) {
    this._setTexture(e, r, !1, !1, n, n);
  }
  /**
   * Sets an array of texture to the WebGPU context
   * @param channel defines the channel where the texture array must be set
   * @param unused unused parameter
   * @param textures defines the array of textures to bind
   * @param name name of the channel
   */
  setTextureArray(e, t, r, n) {
    for (let i = 0; i < r.length; i++)
      this._setTexture(-1, r[i], !0, !1, n + i.toString(), n);
  }
  _setTexture(e, t, r = !1, n = !1, i = "", s) {
    if (s = s ?? i, this._currentEffect) {
      if (!t)
        return this._currentMaterialContext.setTexture(i, null), !1;
      if (t.video)
        t.update();
      else if (t.delayLoadState === 4)
        return t.delayLoad(), !1;
      let a = null;
      if (n ? a = t.depthStencilTexture : t.isReady() ? a = t.getInternalTexture() : t.isCube ? a = this.emptyCubeTexture : t.is3D ? a = this.emptyTexture3D : t.is2DArray ? a = this.emptyTexture2DArray : a = this.emptyTexture, a && !a.isMultiview) {
        if (a.isCube && a._cachedCoordinatesMode !== t.coordinatesMode) {
          a._cachedCoordinatesMode = t.coordinatesMode;
          const f = t.coordinatesMode !== 3 && t.coordinatesMode !== 5 ? 1 : 0;
          t.wrapU = f, t.wrapV = f;
        }
        a._cachedWrapU = t.wrapU, a._cachedWrapV = t.wrapV, a.is3D && (a._cachedWrapR = t.wrapR), this._setAnisotropicLevel(0, a, t.anisotropicFilteringLevel);
      }
      this._setInternalTexture(i, a, s);
    } else
      this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - _setTexture called with a null _currentEffect! texture=", t));
    return !0;
  }
  /**
   * @internal
   */
  _setAnisotropicLevel(e, t, r) {
    t._cachedAnisotropicFilteringLevel !== r && (t._cachedAnisotropicFilteringLevel = Math.min(r, this._caps.maxAnisotropy));
  }
  /**
   * @internal
   */
  _bindTexture(e, t, r) {
    e !== void 0 && this._setInternalTexture(r, t);
  }
  /**
   * Generates the mipmaps for a texture
   * @param texture texture to generate the mipmaps for
   */
  generateMipmaps(e) {
    this._generateMipmaps(e);
  }
  /**
   * @internal
   */
  _generateMipmaps(e, t) {
    t = t ?? this._renderEncoder;
    const r = e._hardwareTexture;
    if (!r)
      return;
    t === this._renderEncoder && this._endCurrentRenderPass();
    const n = e._hardwareTexture.format, i = Ns.ComputeNumMipmapLevels(e.width, e.height);
    this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - generate mipmaps - width=" + e.width + ", height=" + e.height + ", isCube=" + e.isCube + ", command encoder=" + (t === this._renderEncoder ? "render" : "copy"))), e.isCube ? this._textureHelper.generateCubeMipmaps(r, n, i, t) : this._textureHelper.generateMipmaps(r, n, i, 0, t);
  }
  /**
   * Update a portion of an internal texture
   * @param texture defines the texture to update
   * @param imageData defines the data to store into the texture
   * @param xOffset defines the x coordinates of the update rectangle
   * @param yOffset defines the y coordinates of the update rectangle
   * @param width defines the width of the update rectangle
   * @param height defines the height of the update rectangle
   * @param faceIndex defines the face index if texture is a cube (0 by default)
   * @param lod defines the lod level to update (0 by default)
   * @param generateMipMaps defines whether to generate mipmaps or not
   */
  updateTextureData(e, t, r, n, i, s, a = 0, f = 0, o = !1) {
    var d;
    let v = e._hardwareTexture;
    !((d = e._hardwareTexture) === null || d === void 0) && d.underlyingResource || (v = this._textureHelper.createGPUTextureForInternalTexture(e));
    const u = new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
    this._textureHelper.updateTexture(u, e, i, s, e.depth, v.format, a, f, e.invertY, !1, r, n), o && this._generateMipmaps(e);
  }
  /**
   * @internal
   */
  _uploadCompressedDataToTextureDirectly(e, t, r, n, i, s = 0, a = 0) {
    var f;
    let o = e._hardwareTexture;
    !((f = e._hardwareTexture) === null || f === void 0) && f.underlyingResource || (e.format = t, o = this._textureHelper.createGPUTextureForInternalTexture(e, r, n));
    const d = new Uint8Array(i.buffer, i.byteOffset, i.byteLength);
    this._textureHelper.updateTexture(d, e, r, n, e.depth, o.format, s, a, !1, !1, 0, 0);
  }
  /**
   * @internal
   */
  _uploadDataToTextureDirectly(e, t, r = 0, n = 0, i, s = !1) {
    var a;
    const f = Math.round(Math.log(e.width) * Math.LOG2E), o = Math.round(Math.log(e.height) * Math.LOG2E), d = s ? e.width : Math.pow(2, Math.max(f - n, 0)), v = s ? e.height : Math.pow(2, Math.max(o - n, 0));
    let u = e._hardwareTexture;
    !((a = e._hardwareTexture) === null || a === void 0) && a.underlyingResource || (u = this._textureHelper.createGPUTextureForInternalTexture(e, d, v));
    const l = new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
    this._textureHelper.updateTexture(l, e, d, v, e.depth, u.format, r, n, e.invertY, !1, 0, 0);
  }
  /**
   * @internal
   */
  _uploadArrayBufferViewToTexture(e, t, r = 0, n = 0) {
    this._uploadDataToTextureDirectly(e, t, r, n);
  }
  /**
   * @internal
   */
  _uploadImageToTexture(e, t, r = 0, n = 0) {
    var i;
    let s = e._hardwareTexture;
    if (!((i = e._hardwareTexture) === null || i === void 0) && i.underlyingResource || (s = this._textureHelper.createGPUTextureForInternalTexture(e)), t instanceof HTMLImageElement)
      throw "WebGPU engine: HTMLImageElement not supported in _uploadImageToTexture!";
    const a = t, f = Math.ceil(e.width / (1 << n)), o = Math.ceil(e.height / (1 << n));
    this._textureHelper.updateTexture(a, e, f, o, e.depth, s.format, r, n, e.invertY, !1, 0, 0);
  }
  /**
   * Reads pixels from the current frame buffer. Please note that this function can be slow
   * @param x defines the x coordinate of the rectangle where pixels must be read
   * @param y defines the y coordinate of the rectangle where pixels must be read
   * @param width defines the width of the rectangle where pixels must be read
   * @param height defines the height of the rectangle where pixels must be read
   * @param hasAlpha defines whether the output should have alpha or not (defaults to true)
   * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
   * @returns a ArrayBufferView promise (Uint8Array) containing RGBA colors
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  readPixels(e, t, r, n, i = !0, s = !0) {
    const f = this._getCurrentRenderPassWrapper().colorAttachmentGPUTextures[0];
    if (!f)
      return Promise.resolve(new Uint8Array(0));
    const o = f.underlyingResource, d = f.format;
    return o ? (s && this.flushFramebuffer(), this._textureHelper.readPixels(o, e, t, r, n, d)) : Promise.resolve(new Uint8Array(0));
  }
  //------------------------------------------------------------------------------
  //                              Frame management
  //------------------------------------------------------------------------------
  /**
   * Begin a new frame
   */
  beginFrame() {
    super.beginFrame();
  }
  /**
   * End the current frame
   */
  endFrame() {
    if (this._endCurrentRenderPass(), this._snapshotRendering.endFrame(), this._timestampQuery.endFrame(this._renderEncoder), this.flushFramebuffer(), this._textureHelper.destroyDeferredTextures(), this._bufferManager.destroyDeferredBuffers(), this._features._collectUbosUpdatedInFrame) {
      if (this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), !this._count || this._count < this.dbgVerboseLogsNumFrames)) {
        const e = [];
        for (const t in yr._UpdatedUbosInFrame)
          e.push(t + ":" + yr._UpdatedUbosInFrame[t]);
        console.log("frame #" + this._count + " - updated ubos -", e.join(", "));
      }
      yr._UpdatedUbosInFrame = {};
    }
    this.countersLastFrame.numEnableEffects = this._counters.numEnableEffects, this.countersLastFrame.numEnableDrawWrapper = this._counters.numEnableDrawWrapper, this.countersLastFrame.numBundleCreationNonCompatMode = this._counters.numBundleCreationNonCompatMode, this.countersLastFrame.numBundleReuseNonCompatMode = this._counters.numBundleReuseNonCompatMode, this._counters.numEnableEffects = 0, this._counters.numEnableDrawWrapper = 0, this._counters.numBundleCreationNonCompatMode = 0, this._counters.numBundleReuseNonCompatMode = 0, this._cacheRenderPipeline.endFrame(), this._cacheBindGroups.endFrame(), this._pendingDebugCommands.length = 0, super.endFrame(), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), this._count < this.dbgVerboseLogsNumFrames && console.log("%c frame #" + this._count + " - end", "background: #ffff00"), this._count < this.dbgVerboseLogsNumFrames && (this._count++, this._count !== this.dbgVerboseLogsNumFrames && console.log("%c frame #" + this._count + " - begin", "background: #ffff00")));
  }
  /**
   * Force a WebGPU flush (ie. a flush of all waiting commands)
   */
  flushFramebuffer() {
    this._endCurrentRenderPass(), this._commandBuffers[0] = this._uploadEncoder.finish(), this._commandBuffers[1] = this._renderEncoder.finish(), this._device.queue.submit(this._commandBuffers), this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor), this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor), this._timestampQuery.startFrame(this._uploadEncoder), this._textureHelper.setCommandEncoder(this._uploadEncoder), this._bundleList.reset();
  }
  /** @internal */
  _currentFrameBufferIsDefaultFrameBuffer() {
    return this._currentPassIsMainPass();
  }
  //------------------------------------------------------------------------------
  //                              Render Pass
  //------------------------------------------------------------------------------
  _startRenderTargetRenderPass(e, t, r, n, i) {
    var s, a, f, o, d, v, u, l;
    this._endCurrentRenderPass();
    const P = e, p = P._depthStencilTexture, c = p == null ? void 0 : p._hardwareTexture, H = c == null ? void 0 : c.underlyingResource, T = c == null ? void 0 : c.getMSAATexture(), q = H == null ? void 0 : H.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor), b = T == null ? void 0 : T.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor), j = c ? Ns.HasStencilAspect(c.format) : !1, w = [];
    this.useReverseDepthBuffer && this.setDepthFunctionToGreaterOrEqual();
    const m = Nle;
    r && (m.r = r.r * 255, m.g = r.g * 255, m.b = r.b * 255, m.a = r.a * 255);
    const I = t && r, N = t && n, k = t && i;
    if (P._attachments && P.isMulti) {
      (!this._mrtAttachments || this._mrtAttachments.length === 0) && (this._mrtAttachments = P._defaultAttachments);
      for (let R = 0; R < this._mrtAttachments.length; ++R) {
        const y = this._mrtAttachments[R], O = P.textures[R], Y = O == null ? void 0 : O._hardwareTexture, ee = Y == null ? void 0 : Y.underlyingResource;
        if (Y && ee) {
          const Z = Y.getMSAATexture(R), te = (a = (s = P.layerIndices) === null || s === void 0 ? void 0 : s[R]) !== null && a !== void 0 ? a : 0, fe = (o = (f = P.faceIndices) === null || f === void 0 ? void 0 : f[R]) !== null && o !== void 0 ? o : 0, _ = Object.assign(Object.assign({}, this._rttRenderPassWrapper.colorAttachmentViewDescriptor), { format: Y.format, baseArrayLayer: O.isCube ? te * 6 + fe : te }), G = Object.assign(Object.assign({}, this._rttRenderPassWrapper.colorAttachmentViewDescriptor), { format: Y.format, baseArrayLayer: 0 }), L = O.type === 7 || O.type === 5, $ = ee.createView(_), ae = Z == null ? void 0 : Z.createView(G);
          w.push({
            view: ae || $,
            resolveTarget: Z ? $ : void 0,
            clearValue: y !== 0 && I ? L ? m : r : void 0,
            loadOp: y !== 0 && I ? f9.Clear : f9.Load,
            storeOp: Hc.Store
          });
        }
      }
      this._cacheRenderPipeline.setMRT(P.textures, this._mrtAttachments.length), this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);
    } else {
      const R = P.texture;
      if (R) {
        const y = R._hardwareTexture, O = y.underlyingResource, Y = y.getMSAATexture(), ee = O.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor), Z = Y == null ? void 0 : Y.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor), te = R.type === 7 || R.type === 5;
        w.push({
          view: Z || ee,
          resolveTarget: Y ? ee : void 0,
          clearValue: I ? te ? m : r : void 0,
          loadOp: I ? f9.Clear : f9.Load,
          storeOp: Hc.Store
        });
      } else
        w.push(null);
    }
    if ((d = this._debugPushGroup) === null || d === void 0 || d.call(this, "render target pass", 1), this._rttRenderPassWrapper.renderPassDescriptor = {
      label: ((v = e.label) !== null && v !== void 0 ? v : "RTT") + "RenderPass",
      colorAttachments: w,
      depthStencilAttachment: p && H ? {
        view: b || q,
        depthClearValue: N ? this.useReverseDepthBuffer ? this._clearReverseDepthValue : this._clearDepthValue : void 0,
        depthLoadOp: N ? f9.Clear : f9.Load,
        depthStoreOp: Hc.Store,
        stencilClearValue: P._depthStencilTextureWithStencil && k ? this._clearStencilValue : void 0,
        stencilLoadOp: j ? P._depthStencilTextureWithStencil && k ? f9.Clear : f9.Load : void 0,
        stencilStoreOp: j ? Hc.Store : void 0
      } : void 0,
      occlusionQuerySet: !((u = this._occlusionQuery) === null || u === void 0) && u.hasQueries ? this._occlusionQuery.querySet : void 0
    }, this._currentRenderPass = this._renderEncoder.beginRenderPass(this._rttRenderPassWrapper.renderPassDescriptor), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), !this._count || this._count < this.dbgVerboseLogsNumFrames)) {
      const R = P.texture;
      console.log("frame #" + this._count + " - render target begin pass - rtt name=" + e.label + ", internalTexture.uniqueId=" + R.uniqueId + ", width=" + R.width + ", height=" + R.height + ", setClearStates=" + t, "renderPassDescriptor=", this._rttRenderPassWrapper.renderPassDescriptor);
    }
    (l = this._debugFlushPendingCommands) === null || l === void 0 || l.call(this), this._resetRenderPassStates(), (!c || !Ns.HasStencilAspect(c.format)) && (this._stencilStateComposer.enabled = !1);
  }
  _startMainRenderPass(e, t, r, n) {
    var i, s, a;
    this._endCurrentRenderPass(), this.useReverseDepthBuffer && this.setDepthFunctionToGreaterOrEqual();
    const f = e && t, o = e && r, d = e && n;
    this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].clearValue = f ? t : void 0, this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].loadOp = f ? f9.Clear : f9.Load, this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthClearValue = o ? this.useReverseDepthBuffer ? this._clearReverseDepthValue : this._clearDepthValue : void 0, this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthLoadOp = o ? f9.Clear : f9.Load, this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilClearValue = d ? this._clearStencilValue : void 0, this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilLoadOp = this.isStencilEnable ? d ? f9.Clear : f9.Load : void 0, this._mainRenderPassWrapper.renderPassDescriptor.occlusionQuerySet = !((i = this._occlusionQuery) === null || i === void 0) && i.hasQueries ? this._occlusionQuery.querySet : void 0;
    const v = this._context.getCurrentTexture();
    this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].set(v), this._options.antialias ? (DG.format = v.format, this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].resolveTarget = v.createView(DG)) : (jG.format = v.format, this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].view = v.createView(jG)), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - main begin pass - texture width=" + this._mainTextureExtends.width, " height=" + this._mainTextureExtends.height + ", setClearStates=" + e, "renderPassDescriptor=", this._mainRenderPassWrapper.renderPassDescriptor)), (s = this._debugPushGroup) === null || s === void 0 || s.call(this, "main pass", 0), this._currentRenderPass = this._renderEncoder.beginRenderPass(this._mainRenderPassWrapper.renderPassDescriptor), this._setDepthTextureFormat(this._mainRenderPassWrapper), this._setColorFormat(this._mainRenderPassWrapper), (a = this._debugFlushPendingCommands) === null || a === void 0 || a.call(this), this._resetRenderPassStates(), this._isStencilEnable || (this._stencilStateComposer.enabled = !1);
  }
  /** @internal */
  _endCurrentRenderPass() {
    var e, t, r;
    if (!this._currentRenderPass)
      return 0;
    const n = this._currentPassIsMainPass() ? 2 : 1;
    return !this._snapshotRendering.endRenderPass(this._currentRenderPass) && !this.compatibilityMode && (this._bundleList.run(this._currentRenderPass), this._bundleList.reset()), this._currentRenderPass.end(), this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - " + (n === 2 ? "main" : "render target") + " end pass" + (n === 1 ? " - internalTexture.uniqueId=" + ((t = (e = this._currentRenderTarget) === null || e === void 0 ? void 0 : e.texture) === null || t === void 0 ? void 0 : t.uniqueId) : ""))), (r = this._debugPopGroup) === null || r === void 0 || r.call(this, 0), this._currentRenderPass = null, n;
  }
  /**
   * Binds the frame buffer to the specified texture.
   * @param texture The render target wrapper to render to
   * @param faceIndex The face of the texture to render to in case of cube texture
   * @param requiredWidth The width of the target to render to
   * @param requiredHeight The height of the target to render to
   * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true
   * @param lodLevel defines the lod level to bind to the frame buffer
   * @param layer defines the 2d array index to bind to frame buffer to
   */
  bindFramebuffer(e, t = 0, r, n, i, s = 0, a = 0) {
    var f, o;
    const d = (f = e.texture) === null || f === void 0 ? void 0 : f._hardwareTexture;
    this._currentRenderTarget ? this.unBindFramebuffer(this._currentRenderTarget) : this._endCurrentRenderPass(), this._currentRenderTarget = e, this._rttRenderPassWrapper.colorAttachmentGPUTextures[0] = d, this._rttRenderPassWrapper.depthTextureFormat = this._currentRenderTarget._depthStencilTexture ? Ns.GetWebGPUTextureFormat(-1, this._currentRenderTarget._depthStencilTexture.format) : void 0, this._setDepthTextureFormat(this._rttRenderPassWrapper), this._setColorFormat(this._rttRenderPassWrapper), this._rttRenderPassWrapper.colorAttachmentViewDescriptor = {
      format: this._colorFormat,
      dimension: Da.E2d,
      mipLevelCount: 1,
      baseArrayLayer: e.isCube ? a * 6 + t : a,
      baseMipLevel: s,
      arrayLayerCount: 1,
      aspect: zH.All
    }, this._rttRenderPassWrapper.depthAttachmentViewDescriptor = {
      format: this._depthTextureFormat,
      dimension: Da.E2d,
      mipLevelCount: 1,
      baseArrayLayer: e.isCube ? a * 6 + t : a,
      baseMipLevel: 0,
      arrayLayerCount: 1,
      aspect: zH.All
    }, this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - bindFramebuffer - rtt name=" + e.label + ", internalTexture.uniqueId=" + ((o = e.texture) === null || o === void 0 ? void 0 : o.uniqueId) + ", face=" + t + ", lodLevel=" + s + ", layer=" + a, "colorAttachmentViewDescriptor=", this._rttRenderPassWrapper.colorAttachmentViewDescriptor, "depthAttachmentViewDescriptor=", this._rttRenderPassWrapper.depthAttachmentViewDescriptor)), this._cachedViewport && !i ? this.setViewport(this._cachedViewport, r, n) : (r || (r = e.width, s && (r = r / Math.pow(2, s))), n || (n = e.height, s && (n = n / Math.pow(2, s))), this._viewport(0, 0, r, n)), this.wipeCaches();
  }
  /**
   * Unbind the current render target texture from the WebGPU context
   * @param texture defines the render target wrapper to unbind
   * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
   * @param onBeforeUnbind defines a function which will be called before the effective unbind
   */
  unBindFramebuffer(e, t = !1, r) {
    var n, i;
    const s = this._currentRenderTarget;
    this._currentRenderTarget = null, r && r(), this._currentRenderTarget = s, this._endCurrentRenderPass(), !((n = e.texture) === null || n === void 0) && n.generateMipMaps && !t && !e.isCube && this._generateMipmaps(e.texture), this._currentRenderTarget = null, this.dbgVerboseLogsForFirstFrames && (this._count === void 0 && (this._count = 0), (!this._count || this._count < this.dbgVerboseLogsNumFrames) && console.log("frame #" + this._count + " - unBindFramebuffer - rtt name=" + e.label + ", internalTexture.uniqueId=", (i = e.texture) === null || i === void 0 ? void 0 : i.uniqueId)), this._mrtAttachments = [], this._cacheRenderPipeline.setMRT([]), this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);
  }
  /**
   * Unbind the current render target and bind the default framebuffer
   */
  restoreDefaultFramebuffer() {
    this._currentRenderTarget ? this.unBindFramebuffer(this._currentRenderTarget) : this._currentRenderPass || this._startMainRenderPass(!1), this._cachedViewport && this.setViewport(this._cachedViewport), this.wipeCaches();
  }
  //------------------------------------------------------------------------------
  //                              Render
  //------------------------------------------------------------------------------
  /**
   * @internal
   */
  _setColorFormat(e) {
    var t, r;
    const n = (r = (t = e.colorAttachmentGPUTextures[0]) === null || t === void 0 ? void 0 : t.format) !== null && r !== void 0 ? r : null;
    this._cacheRenderPipeline.setColorFormat(n), this._colorFormat !== n && (this._colorFormat = n);
  }
  /**
   * @internal
   */
  _setDepthTextureFormat(e) {
    this._cacheRenderPipeline.setDepthStencilFormat(e.depthTextureFormat), this._depthTextureFormat !== e.depthTextureFormat && (this._depthTextureFormat = e.depthTextureFormat);
  }
  setDitheringState() {
  }
  setRasterizerState() {
  }
  /**
   * Set various states to the webGL context
   * @param culling defines culling state: true to enable culling, false to disable it
   * @param zOffset defines the value to apply to zOffset (0 by default)
   * @param force defines if states must be applied even if cache is up to date
   * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)
   * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)
   * @param stencil stencil states to set
   * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)
   */
  setState(e, t = 0, r, n = !1, i, s, a = 0) {
    var f, o;
    (this._depthCullingState.cull !== e || r) && (this._depthCullingState.cull = e);
    const d = !((o = (f = this.cullBackFaces) !== null && f !== void 0 ? f : i) !== null && o !== void 0) || o ? 1 : 2;
    (this._depthCullingState.cullFace !== d || r) && (this._depthCullingState.cullFace = d), this.setZOffset(t), this.setZOffsetUnits(a);
    const v = n ? this._currentRenderTarget ? 1 : 2 : this._currentRenderTarget ? 2 : 1;
    (this._depthCullingState.frontFace !== v || r) && (this._depthCullingState.frontFace = v), this._stencilStateComposer.stencilMaterial = s;
  }
  _applyRenderPassChanges(e) {
    const t = this._stencilStateComposer.enabled ? this._mustUpdateStencilRef() : !1, r = this._alphaState.alphaBlend ? this._mustUpdateBlendColor() : !1;
    this._mustUpdateViewport() && this._applyViewport(e), this._mustUpdateScissor() && this._applyScissor(e), t && this._applyStencilRef(e), r && this._applyBlendColor(e);
  }
  _draw(e, t, r, n, i) {
    var s;
    const a = this._getCurrentRenderPass(), f = this._bundleList;
    this.applyStates();
    const o = this._currentEffect._pipelineContext;
    if (this.bindUniformBufferBase(this._currentRenderTarget ? this._ubInvertY : this._ubDontInvertY, 0, Wo.InternalsUBOName), o.uniformBuffer && (o.uniformBuffer.update(), this.bindUniformBufferBase(o.uniformBuffer.getBuffer(), 0, Wo.LeftOvertUBOName)), this._snapshotRendering.play) {
      this._reportDrawCall();
      return;
    }
    !this.compatibilityMode && (this._currentDrawContext.isDirty(this._currentMaterialContext.updateId) || this._currentMaterialContext.isDirty || this._currentMaterialContext.forceBindGroupCreation) && (this._currentDrawContext.fastBundle = void 0);
    const d = !this.compatibilityMode && this._currentDrawContext.fastBundle;
    let v = a;
    if (d || this._snapshotRendering.record) {
      if (this._applyRenderPassChanges(f), !this._snapshotRendering.record) {
        this._counters.numBundleReuseNonCompatMode++, this._currentDrawContext.indirectDrawBuffer && this._currentDrawContext.setIndirectData(n, i || 1, r), f.addBundle(this._currentDrawContext.fastBundle), this._reportDrawCall();
        return;
      }
      v = f.getBundleEncoder(this._cacheRenderPipeline.colorFormats, this._depthTextureFormat, this.currentSampleCount), f.numDrawCalls++;
    }
    let u = 0;
    if (this._currentMaterialContext.hasFloatOrDepthTextures) {
      let H = 1;
      for (let T = 0; T < o.shaderProcessingContext.textureNames.length; ++T) {
        const q = o.shaderProcessingContext.textureNames[T], b = (s = this._currentMaterialContext.textures[q]) === null || s === void 0 ? void 0 : s.texture, j = b && b.format >= 13 && b.format <= 18;
        ((b == null ? void 0 : b.type) === 1 && !this._caps.textureFloatLinearFiltering || j) && (u |= H), H = H << 1;
      }
    }
    this._currentMaterialContext.textureState = u;
    const l = this._cacheRenderPipeline.getRenderPipeline(t, this._currentEffect, this.currentSampleCount, u), P = this._cacheBindGroups.getBindGroups(o, this._currentDrawContext, this._currentMaterialContext);
    this._snapshotRendering.record || (this._applyRenderPassChanges(this.compatibilityMode ? null : f), this.compatibilityMode || (this._counters.numBundleCreationNonCompatMode++, v = this._device.createRenderBundleEncoder({
      colorFormats: this._cacheRenderPipeline.colorFormats,
      depthStencilFormat: this._depthTextureFormat,
      sampleCount: Ns.GetSample(this.currentSampleCount)
    }))), v.setPipeline(l), this._currentIndexBuffer && v.setIndexBuffer(this._currentIndexBuffer.underlyingResource, this._currentIndexBuffer.is32Bits ? Tq.Uint32 : Tq.Uint16, 0);
    const p = this._cacheRenderPipeline.vertexBuffers;
    for (let H = 0; H < p.length; H++) {
      const T = p[H], q = T.effectiveBuffer;
      q && v.setVertexBuffer(H, q.underlyingResource, T._validOffsetRange ? 0 : T.byteOffset);
    }
    for (let H = 0; H < P.length; H++)
      v.setBindGroup(H, P[H]);
    const c = !this.compatibilityMode && !this._snapshotRendering.record;
    c && this._currentDrawContext.indirectDrawBuffer ? (this._currentDrawContext.setIndirectData(n, i || 1, r), e === 0 ? v.drawIndexedIndirect(this._currentDrawContext.indirectDrawBuffer, 0) : v.drawIndirect(this._currentDrawContext.indirectDrawBuffer, 0)) : e === 0 ? v.drawIndexed(n, i || 1, r, 0, 0) : v.draw(n, i || 1, r, 0), c && (this._currentDrawContext.fastBundle = v.finish(), f.addBundle(this._currentDrawContext.fastBundle)), this._reportDrawCall();
  }
  /**
   * Draw a list of indexed primitives
   * @param fillMode defines the primitive to use
   * @param indexStart defines the starting index
   * @param indexCount defines the number of index to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  drawElementsType(e, t, r, n = 1) {
    this._draw(0, e, t, r, n);
  }
  /**
   * Draw a list of unindexed primitives
   * @param fillMode defines the primitive to use
   * @param verticesStart defines the index of first vertex to draw
   * @param verticesCount defines the count of vertices to draw
   * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
   */
  drawArraysType(e, t, r, n = 1) {
    this._currentIndexBuffer = null, this._draw(1, e, t, r, n);
  }
  //------------------------------------------------------------------------------
  //                              Dispose
  //------------------------------------------------------------------------------
  /**
   * Dispose and release all associated resources
   */
  dispose() {
    var e, t;
    this._isDisposed = !0, (e = this._mainTexture) === null || e === void 0 || e.destroy(), (t = this._depthTexture) === null || t === void 0 || t.destroy(), this._device.destroy(), super.dispose();
  }
  //------------------------------------------------------------------------------
  //                              Misc
  //------------------------------------------------------------------------------
  /**
   * Gets the current render width
   * @param useScreen defines if screen size must be used (or the current render target if any)
   * @returns a number defining the current render width
   */
  getRenderWidth(e = !1) {
    var t, r;
    return !e && this._currentRenderTarget ? this._currentRenderTarget.width : (r = (t = this._renderingCanvas) === null || t === void 0 ? void 0 : t.width) !== null && r !== void 0 ? r : 0;
  }
  /**
   * Gets the current render height
   * @param useScreen defines if screen size must be used (or the current render target if any)
   * @returns a number defining the current render height
   */
  getRenderHeight(e = !1) {
    var t, r;
    return !e && this._currentRenderTarget ? this._currentRenderTarget.height : (r = (t = this._renderingCanvas) === null || t === void 0 ? void 0 : t.height) !== null && r !== void 0 ? r : 0;
  }
  //------------------------------------------------------------------------------
  //                              Errors
  //------------------------------------------------------------------------------
  /**
   * Get the current error code of the WebGPU context
   * @returns the error code
   */
  getError() {
    return 0;
  }
  //------------------------------------------------------------------------------
  //                              Unused WebGPU
  //------------------------------------------------------------------------------
  /**
   * @internal
   */
  bindSamplers() {
  }
  /**
   * @internal
   */
  _bindTextureDirectly() {
    return !1;
  }
  /**
   * Gets a boolean indicating if all created effects are ready
   * @returns always true - No parallel shader compilation
   */
  areAllEffectsReady() {
    return !0;
  }
  /**
   * @internal
   */
  _executeWhenRenderingStateIsCompiled(e, t) {
    t();
  }
  /**
   * @internal
   */
  _isRenderingStateCompiled() {
    return !0;
  }
  /** @internal */
  _getUnpackAlignement() {
    return 1;
  }
  /**
   * @internal
   */
  _unpackFlipY() {
  }
  /**
   * @internal
   */
  _bindUnboundFramebuffer() {
    throw "_bindUnboundFramebuffer is not implementedin WebGPU! You probably want to use restoreDefaultFramebuffer or unBindFramebuffer instead";
  }
  // TODO WEBGPU. All of the below should go once engine split with baseEngine.
  /**
   * @internal
   */
  _getSamplingParameters() {
    throw "_getSamplingParameters is not available in WebGPU";
  }
  /**
   * @internal
   */
  getUniforms() {
    return [];
  }
  /**
   * @internal
   */
  setIntArray() {
    return !1;
  }
  /**
   * @internal
   */
  setIntArray2() {
    return !1;
  }
  /**
   * @internal
   */
  setIntArray3() {
    return !1;
  }
  /**
   * @internal
   */
  setIntArray4() {
    return !1;
  }
  /**
   * @internal
   */
  setArray() {
    return !1;
  }
  /**
   * @internal
   */
  setArray2() {
    return !1;
  }
  /**
   * @internal
   */
  setArray3() {
    return !1;
  }
  /**
   * @internal
   */
  setArray4() {
    return !1;
  }
  /**
   * @internal
   */
  setMatrices() {
    return !1;
  }
  /**
   * @internal
   */
  setMatrix3x3() {
    return !1;
  }
  /**
   * @internal
   */
  setMatrix2x2() {
    return !1;
  }
  /**
   * @internal
   */
  setFloat() {
    return !1;
  }
  /**
   * @internal
   */
  setFloat2() {
    return !1;
  }
  /**
   * @internal
   */
  setFloat3() {
    return !1;
  }
  /**
   * @internal
   */
  setFloat4() {
    return !1;
  }
}
wn._GLSLslangDefaultOptions = {
  jsPath: `${ye._DefaultCdnUrl}/glslang/glslang.js`,
  wasmPath: `${ye._DefaultCdnUrl}/glslang/glslang.wasm`
};
wn.UseTWGSL = !0;
wn.prototype.setAlphaMode = function(A, e = !1) {
  if (this._alphaMode === A && (A === 0 && !this._alphaState.alphaBlend || A !== 0 && this._alphaState.alphaBlend)) {
    if (!e) {
      const t = A === 0;
      this.depthCullingState.depthMask !== t && (this.setDepthWrite(t), this._cacheRenderPipeline.setDepthWriteEnabled(t));
    }
    return;
  }
  switch (A) {
    case 0:
      this._alphaState.alphaBlend = !1;
      break;
    case 7:
      this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 1), this._alphaState.alphaBlend = !0;
      break;
    case 8:
      this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 771), this._alphaState.alphaBlend = !0;
      break;
    case 2:
      this._alphaState.setAlphaBlendFunctionParameters(770, 771, 1, 1), this._alphaState.alphaBlend = !0;
      break;
    case 6:
      this._alphaState.setAlphaBlendFunctionParameters(1, 1, 0, 1), this._alphaState.alphaBlend = !0;
      break;
    case 1:
      this._alphaState.setAlphaBlendFunctionParameters(770, 1, 0, 1), this._alphaState.alphaBlend = !0;
      break;
    case 3:
      this._alphaState.setAlphaBlendFunctionParameters(0, 769, 1, 1), this._alphaState.alphaBlend = !0;
      break;
    case 4:
      this._alphaState.setAlphaBlendFunctionParameters(774, 0, 1, 1), this._alphaState.alphaBlend = !0;
      break;
    case 5:
      this._alphaState.setAlphaBlendFunctionParameters(770, 769, 1, 1), this._alphaState.alphaBlend = !0;
      break;
    case 9:
      this._alphaState.setAlphaBlendFunctionParameters(32769, 32770, 32771, 32772), this._alphaState.alphaBlend = !0;
      break;
    case 10:
      this._alphaState.setAlphaBlendFunctionParameters(1, 769, 1, 771), this._alphaState.alphaBlend = !0;
      break;
    case 11:
      this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 1), this._alphaState.alphaBlend = !0;
      break;
    case 12:
      this._alphaState.setAlphaBlendFunctionParameters(772, 1, 0, 0), this._alphaState.alphaBlend = !0;
      break;
    case 13:
      this._alphaState.setAlphaBlendFunctionParameters(775, 769, 773, 771), this._alphaState.alphaBlend = !0;
      break;
    case 14:
      this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 771), this._alphaState.alphaBlend = !0;
      break;
    case 15:
      this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 0), this._alphaState.alphaBlend = !0;
      break;
    case 16:
      this._alphaState.setAlphaBlendFunctionParameters(775, 769, 0, 1), this._alphaState.alphaBlend = !0;
      break;
    case 17:
      this._alphaState.setAlphaBlendFunctionParameters(770, 771, 1, 771), this._alphaState.alphaBlend = !0;
      break;
  }
  e || (this.setDepthWrite(A === Ge.ALPHA_DISABLE), this._cacheRenderPipeline.setDepthWriteEnabled(A === Ge.ALPHA_DISABLE)), this._alphaMode = A, this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend), this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);
};
wn.prototype.setAlphaEquation = function(A) {
  Ge.prototype.setAlphaEquation.call(this, A), this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);
};
class ay {
  getBindGroups(e, t, r) {
    if (!r)
      throw new Error("WebGPUComputeContext.getBindGroups: bindingsMapping is required until browsers support reflection for wgsl shaders!");
    if (this._bindGroups.length === 0) {
      const n = this._bindGroupEntries.length > 0;
      for (const i in e) {
        const s = e[i], a = r[i], f = a.group, o = a.binding, d = s.type, v = s.object;
        let u = s.indexInGroupEntries, l = this._bindGroupEntries[f];
        switch (l || (l = this._bindGroupEntries[f] = []), d) {
          case io.Sampler: {
            const P = v;
            u !== void 0 && n ? l[u].resource = this._cacheSampler.getSampler(P) : (s.indexInGroupEntries = l.length, l.push({
              binding: o,
              resource: this._cacheSampler.getSampler(P)
            }));
            break;
          }
          case io.Texture:
          case io.TextureWithoutSampler: {
            const P = v, p = P._texture._hardwareTexture;
            u !== void 0 && n ? (d === io.Texture && (l[u++].resource = this._cacheSampler.getSampler(P._texture)), l[u].resource = p.view) : (s.indexInGroupEntries = l.length, d === io.Texture && l.push({
              binding: o - 1,
              resource: this._cacheSampler.getSampler(P._texture)
            }), l.push({
              binding: o,
              resource: p.view
            }));
            break;
          }
          case io.StorageTexture: {
            const P = v, p = P._texture._hardwareTexture;
            p.textureAdditionalUsages & Po.StorageBinding || Se.Error(`computeDispatch: The texture (name=${P.name}, uniqueId=${P.uniqueId}) is not a storage texture!`, 50), u !== void 0 && n ? l[u].resource = p.viewForWriting : (s.indexInGroupEntries = l.length, l.push({
              binding: o,
              resource: p.viewForWriting
            }));
            break;
          }
          case io.ExternalTexture: {
            const p = v.underlyingResource;
            u !== void 0 && n ? l[u].resource = this._device.importExternalTexture({ source: p }) : (s.indexInGroupEntries = l.length, l.push({
              binding: o,
              resource: this._device.importExternalTexture({ source: p })
            }));
            break;
          }
          case io.UniformBuffer:
          case io.StorageBuffer: {
            const p = (d === io.UniformBuffer, v).getBuffer(), c = p.underlyingResource;
            u !== void 0 && n ? (l[u].resource.buffer = c, l[u].resource.size = p.capacity) : (s.indexInGroupEntries = l.length, l.push({
              binding: o,
              resource: {
                buffer: c,
                offset: 0,
                size: p.capacity
              }
            }));
            break;
          }
        }
      }
      for (let i = 0; i < this._bindGroupEntries.length; ++i) {
        const s = this._bindGroupEntries[i];
        if (!s) {
          this._bindGroups[i] = void 0;
          continue;
        }
        this._bindGroups[i] = this._device.createBindGroup({
          layout: t.getBindGroupLayout(i),
          entries: s
        });
      }
      this._bindGroups.length = this._bindGroupEntries.length;
    }
    return this._bindGroups;
  }
  constructor(e, t) {
    this._device = e, this._cacheSampler = t, this.uniqueId = ay._Counter++, this._bindGroupEntries = [], this.clear();
  }
  clear() {
    this._bindGroups = [];
  }
}
ay._Counter = 0;
class Qle {
  get isAsync() {
    return !1;
  }
  get isReady() {
    return !!this.stage;
  }
  constructor(e) {
    this._name = "unnamed", this.engine = e;
  }
  _getComputeShaderCode() {
    var e;
    return (e = this.sources) === null || e === void 0 ? void 0 : e.compute;
  }
  dispose() {
  }
}
wn.prototype.createComputeContext = function() {
  return new ay(this._device, this._cacheSampler);
};
wn.prototype.createComputeEffect = function(A, e) {
  const r = (A.computeElement || A.compute || A.computeToken || A.computeSource || A) + "@" + e.defines;
  if (this._compiledComputeEffects[r]) {
    const i = this._compiledComputeEffects[r];
    return e.onCompiled && i.isReady() && e.onCompiled(i), i;
  }
  const n = new Pm(A, e, this, r);
  return this._compiledComputeEffects[r] = n, n;
};
wn.prototype.createComputePipelineContext = function() {
  return new Qle(this);
};
wn.prototype.areAllComputeEffectsReady = function() {
  for (const A in this._compiledComputeEffects)
    if (!this._compiledComputeEffects[A].isReady())
      return !1;
  return !0;
};
wn.prototype.computeDispatch = function(A, e, t, r, n, i, s) {
  this._endCurrentRenderPass();
  const a = A._pipelineContext, f = e;
  a.computePipeline || (a.computePipeline = this._device.createComputePipeline({
    layout: SS.Auto,
    compute: a.stage
  }));
  const o = this._renderEncoder.beginComputePass();
  o.setPipeline(a.computePipeline);
  const d = f.getBindGroups(t, a.computePipeline, s);
  for (let v = 0; v < d.length; ++v) {
    const u = d[v];
    u && o.setBindGroup(v, u);
  }
  o.dispatchWorkgroups(r, n, i), o.end();
};
wn.prototype.releaseComputeEffects = function() {
  for (const A in this._compiledComputeEffects) {
    const e = this._compiledComputeEffects[A].getPipelineContext();
    this._deleteComputePipelineContext(e);
  }
  this._compiledComputeEffects = {};
};
wn.prototype._prepareComputePipelineContext = function(A, e, t, r, n) {
  const i = A;
  this.dbgShowShaderCode && (console.log(r), console.log(e)), i.sources = {
    compute: e,
    rawCompute: t
  }, i.stage = this._createComputePipelineStageDescriptor(e, r, n);
};
wn.prototype._releaseComputeEffect = function(A) {
  this._compiledComputeEffects[A._key] && (delete this._compiledComputeEffects[A._key], this._deleteComputePipelineContext(A.getPipelineContext()));
};
wn.prototype._rebuildComputeEffects = function() {
  for (const A in this._compiledComputeEffects) {
    const e = this._compiledComputeEffects[A];
    e._pipelineContext = null, e._wasPreviouslyReady = !1, e._prepareEffect();
  }
};
wn.prototype._deleteComputePipelineContext = function(A) {
  A && A.dispose();
};
wn.prototype._createComputePipelineStageDescriptor = function(A, e, t) {
  return e ? e = "//" + e.split(`
`).join(`
//`) + `
` : e = "", {
    module: this._device.createShaderModule({
      code: e + A
    }),
    entryPoint: t
  };
};
wn.prototype._createDepthStencilCubeTexture = function(A, e) {
  const t = new As(this, ri.DepthStencil);
  t.isCube = !0;
  const r = Object.assign({ bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1, samples: 1 }, e);
  return t.format = r.generateStencil ? 13 : 14, this._setupDepthStencilTexture(t, A, r.generateStencil, r.bilinearFiltering, r.comparisonFunction, r.samples), this._textureHelper.createGPUTextureForInternalTexture(t), this._internalTexturesCache.push(t), t;
};
wn.prototype.createCubeTexture = function(A, e, t, r, n = null, i = null, s, a = null, f = !1, o = 0, d = 0, v = null, u = !1) {
  return this.createCubeTextureBase(A, e, t, !!r, n, i, s, a, f, o, d, v, null, (l, P) => {
    const p = P, c = p[0].width, H = c;
    this._setCubeMapTextureParams(l, !r), l.format = s ?? -1;
    const T = this._textureHelper.createGPUTextureForInternalTexture(l, c, H);
    this._textureHelper.updateCubeTextures(p, T.underlyingResource, c, H, T.format, !1, !1, 0, 0), r || this._generateMipmaps(l, this._uploadEncoder), l.isReady = !0, l.onLoadedObservable.notifyObservers(l), l.onLoadedObservable.clear(), n && n();
  }, !!u);
};
wn.prototype._setCubeMapTextureParams = function(A, e, t) {
  A.samplingMode = e ? 3 : 2, A._cachedWrapU = 0, A._cachedWrapV = 0, t && (A._maxLodLevel = t);
};
wn.prototype._debugPushGroup = function(A, e) {
  this._options.enableGPUDebugMarkers && (e === 0 || e === 1 ? this._renderEncoder.pushDebugGroup(A) : this._currentRenderPass ? this._currentRenderPass.pushDebugGroup(A) : this._pendingDebugCommands.push(["push", A]));
};
wn.prototype._debugPopGroup = function(A) {
  this._options.enableGPUDebugMarkers && (A === 0 || A === 1 ? this._renderEncoder.popDebugGroup() : this._currentRenderPass ? this._currentRenderPass.popDebugGroup() : this._pendingDebugCommands.push(["pop", null]));
};
wn.prototype._debugInsertMarker = function(A, e) {
  this._options.enableGPUDebugMarkers && (e === 0 || e === 1 ? this._renderEncoder.insertDebugMarker(A) : this._currentRenderPass ? this._currentRenderPass.insertDebugMarker(A) : this._pendingDebugCommands.push(["insert", A]));
};
wn.prototype._debugFlushPendingCommands = function() {
  for (let A = 0; A < this._pendingDebugCommands.length; ++A) {
    const [e, t] = this._pendingDebugCommands[A];
    switch (e) {
      case "push":
        this._debugPushGroup(t);
        break;
      case "pop":
        this._debugPopGroup();
        break;
      case "insert":
        this._debugInsertMarker(t);
        break;
    }
  }
  this._pendingDebugCommands.length = 0;
};
wn.prototype.updateDynamicIndexBuffer = function(A, e, t = 0) {
  const r = A;
  let n;
  A.is32Bits ? n = e instanceof Uint32Array ? e : new Uint32Array(e) : n = e instanceof Uint16Array ? e : new Uint16Array(e), this._bufferManager.setSubData(r, t, n);
};
wn.prototype.updateDynamicVertexBuffer = function(A, e, t, r) {
  const n = A;
  t === void 0 && (t = 0);
  let i;
  r === void 0 ? (e instanceof Array ? i = new Float32Array(e) : e instanceof ArrayBuffer ? i = new Uint8Array(e) : i = e, r = i.byteLength) : e instanceof Array ? i = new Float32Array(e) : e instanceof ArrayBuffer ? i = new Uint8Array(e) : i = e, this._bufferManager.setSubData(n, t, i, 0, r);
};
wn.prototype.updateDynamicTexture = function(A, e, t, r = !1, n, i, s) {
  var a;
  if (!A)
    return;
  const f = e.width, o = e.height;
  let d = A._hardwareTexture;
  !((a = A._hardwareTexture) === null || a === void 0) && a.underlyingResource || (d = this._textureHelper.createGPUTextureForInternalTexture(A, f, o)), this._textureHelper.updateTexture(e, A, f, o, A.depth, d.format, 0, 0, t, r, 0, 0, s), A.generateMipMaps && this._generateMipmaps(A), A.isReady = !0;
};
class Yle extends FQ {
  constructor(e) {
    super(e);
  }
}
An.prototype.setExternalTexture = function(A, e) {
  this._engine.setExternalTexture(A, e);
};
wn.prototype.createExternalTexture = function(A) {
  return new Yle(A);
};
wn.prototype.setExternalTexture = function(A, e) {
  if (!e) {
    this._currentMaterialContext.setTexture(A, null);
    return;
  }
  this._setInternalTexture(A, e);
};
wn.prototype.unBindMultiColorAttachmentFramebuffer = function(A, e = !1, t) {
  t && t();
  const n = A._attachments.length;
  this._endCurrentRenderPass();
  for (let i = 0; i < n; i++) {
    const s = A.textures[i];
    s.generateMipMaps && !e && !s.isCube && this._generateMipmaps(s);
  }
  this._currentRenderTarget = null, this._mrtAttachments = [], this._cacheRenderPipeline.setMRT([]), this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);
};
wn.prototype.createMultipleRenderTarget = function(A, e, t) {
  var r, n, i;
  let s = !1, a = !0, f = !1, o = !1, d = 15, v = 1;
  const u = 0, l = 3, P = !1, p = 5, c = 3553;
  let H = [], T = [], q = [], b = [], j = [], w = [], m = [], I = [], N = [];
  const k = this._createHardwareRenderTargetWrapper(!0, !1, A);
  e !== void 0 && (s = e.generateMipMaps === void 0 ? !1 : e.generateMipMaps, a = e.generateDepthBuffer === void 0 ? !0 : e.generateDepthBuffer, f = e.generateStencilBuffer === void 0 ? !1 : e.generateStencilBuffer, o = e.generateDepthTexture === void 0 ? !1 : e.generateDepthTexture, v = e.textureCount || 1, d = (r = e.depthTextureFormat) !== null && r !== void 0 ? r : 15, e.types && (H = e.types), e.samplingModes && (T = e.samplingModes), e.useSRGBBuffers && (q = e.useSRGBBuffers), e.formats && (b = e.formats), e.targetTypes && (j = e.targetTypes), e.faceIndex && (w = e.faceIndex), e.layerIndex && (m = e.layerIndex), e.layerCounts && (I = e.layerCounts), N = (n = e.labels) !== null && n !== void 0 ? n : N);
  const R = A.width || A, y = A.height || A;
  let O = null;
  (a || f || o) && (o || (a && f ? d = 13 : a ? d = 14 : d = 19), O = k.createDepthStencilTexture(0, !1, f, 1, d, "MultipleRenderTargetDepthStencil"));
  const Y = [], ee = [], Z = [];
  k._generateDepthBuffer = a, k._generateStencilBuffer = f, k._attachments = ee, k._defaultAttachments = Z;
  for (let te = 0; te < v; te++) {
    let fe = T[te] || l, _ = H[te] || u;
    const G = b[te] || p, L = (q[te] || P) && this._caps.supportSRGBBuffers, $ = j[te] || c, ae = (i = I[te]) !== null && i !== void 0 ? i : 1;
    if ((_ === 1 && !this._caps.textureFloatLinearFiltering || _ === 2 && !this._caps.textureHalfFloatLinearFiltering) && (fe = 1), _ === 1 && !this._caps.textureFloat && (_ = 0, Se.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type")), ee.push(te + 1), Z.push(t ? te + 1 : te === 0 ? 1 : 0), $ === -1)
      continue;
    const Pe = new As(this, ri.MultiRenderTarget);
    switch (Y[te] = Pe, $) {
      case 34067:
        Pe.isCube = !0;
        break;
      case 32879:
        Pe.is3D = !0, Pe.baseDepth = Pe.depth = ae;
        break;
      case 35866:
        Pe.is2DArray = !0, Pe.baseDepth = Pe.depth = ae;
        break;
    }
    Pe.baseWidth = R, Pe.baseHeight = y, Pe.width = R, Pe.height = y, Pe.isReady = !0, Pe.samples = 1, Pe.generateMipMaps = s, Pe.samplingMode = fe, Pe.type = _, Pe._cachedWrapU = 0, Pe._cachedWrapV = 0, Pe._useSRGBBuffer = L, Pe.format = G, Pe.label = N[te], this._internalTexturesCache.push(Pe), this._textureHelper.createGPUTextureForInternalTexture(Pe);
  }
  return O && (O.incrementReferences(), Y[v] = O, this._internalTexturesCache.push(O)), k.setTextures(Y), k.setLayerAndFaceIndices(m, w), k;
};
wn.prototype.updateMultipleRenderTargetTextureSampleCount = function(A, e) {
  if (!A || !A.textures || A.textures[0].samples === e)
    return e;
  const t = A.textures.length;
  if (t === 0)
    return 1;
  e = Math.min(e, this.getCaps().maxMSAASamples);
  for (let n = 0; n < t; ++n) {
    const s = A.textures[n]._hardwareTexture;
    s == null || s.releaseMSAATexture();
  }
  const r = A._depthStencilTexture === A.textures[t - 1];
  for (let n = 0; n < t; ++n) {
    const i = A.textures[n];
    this._textureHelper.createMSAATexture(i, e, !1, n === t - 1 && r ? 0 : n), i.samples = e;
  }
  return A._depthStencilTexture && !r && (this._textureHelper.createMSAATexture(A._depthStencilTexture, e), A._depthStencilTexture.samples = e), e;
};
wn.prototype.bindAttachments = function(A) {
  A.length === 0 || !this._currentRenderTarget || (this._mrtAttachments = A, this._currentRenderPass && this._cacheRenderPipeline.setMRTAttachments(A));
};
wn.prototype.buildTextureLayout = function(A) {
  const e = [];
  for (let t = 0; t < A.length; t++)
    A[t] ? e.push(t + 1) : e.push(0);
  return e;
};
wn.prototype.restoreSingleAttachment = function() {
};
wn.prototype.restoreSingleAttachmentForRenderTarget = function() {
};
wn.prototype.getGPUFrameTimeCounter = function() {
  return this._timestampQuery.gpuFrameTimeCounter;
};
wn.prototype.captureGPUFrameTime = function(A) {
  this._timestampQuery.enable = A && !!this._caps.timerQuery;
};
wn.prototype.createQuery = function() {
  return this._occlusionQuery.createQuery();
};
wn.prototype.deleteQuery = function(A) {
  return this._occlusionQuery.deleteQuery(A), this;
};
wn.prototype.isQueryResultAvailable = function(A) {
  return this._occlusionQuery.isQueryResultAvailable(A);
};
wn.prototype.getQueryResult = function(A) {
  return this._occlusionQuery.getQueryResult(A);
};
wn.prototype.beginOcclusionQuery = function(A, e) {
  var t;
  if (this.compatibilityMode) {
    if (this._occlusionQuery.canBeginQuery(e))
      return (t = this._currentRenderPass) === null || t === void 0 || t.beginOcclusionQuery(e), !0;
  } else
    return this._bundleList.addItem(new MQ(e)), !0;
  return !1;
};
wn.prototype.endOcclusionQuery = function() {
  var A;
  return this.compatibilityMode ? (A = this._currentRenderPass) === null || A === void 0 || A.endOcclusionQuery() : this._bundleList.addItem(new LQ()), this;
};
wn.prototype.createRawTexture = function(A, e, t, r, n, i, s, a = null, f = 0, o = 0, d = !1) {
  const v = new As(this, ri.Raw);
  return v.baseWidth = e, v.baseHeight = t, v.width = e, v.height = t, v.format = r, v.generateMipMaps = n, v.samplingMode = s, v.invertY = i, v._compression = a, v.type = f, v._useSRGBBuffer = d, this._doNotHandleContextLost || (v._bufferView = A), this._textureHelper.createGPUTextureForInternalTexture(v, e, t, void 0, o), this.updateRawTexture(v, A, r, i, a, f, d), this._internalTexturesCache.push(v), v;
};
wn.prototype.updateRawTexture = function(A, e, t, r, n = null, i = 0, s = !1) {
  if (A) {
    if (this._doNotHandleContextLost || (A._bufferView = e, A.invertY = r, A._compression = n, A._useSRGBBuffer = s), e) {
      const a = A._hardwareTexture;
      t === 4 && (e = rV(e, A.width, A.height, i));
      const o = new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
      this._textureHelper.updateTexture(o, A, A.width, A.height, A.depth, a.format, 0, 0, r, !1, 0, 0), A.generateMipMaps && this._generateMipmaps(A, this._uploadEncoder);
    }
    A.isReady = !0;
  }
};
wn.prototype.createRawCubeTexture = function(A, e, t, r, n, i, s, a = null) {
  const f = new As(this, ri.CubeRaw);
  return r === 1 && !this._caps.textureFloatLinearFiltering ? (n = !1, s = 1, Se.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")) : r === 2 && !this._caps.textureHalfFloatLinearFiltering ? (n = !1, s = 1, Se.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")) : r === 1 && !this._caps.textureFloatRender ? (n = !1, Se.Warn("Render to float textures is not supported. Mipmap generation forced to false.")) : r === 2 && !this._caps.colorBufferFloat && (n = !1, Se.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")), f.isCube = !0, f.format = t === 4 ? 5 : t, f.type = r, f.generateMipMaps = n, f.width = e, f.height = e, f.samplingMode = s, this._doNotHandleContextLost || (f._bufferViewArray = A), f.invertY = i, f._compression = a, f._cachedWrapU = 0, f._cachedWrapV = 0, this._textureHelper.createGPUTextureForInternalTexture(f), A && this.updateRawCubeTexture(f, A, t, r, i, a), f.isReady = !0, f;
};
wn.prototype.updateRawCubeTexture = function(A, e, t, r, n, i = null) {
  A._bufferViewArray = e, A.invertY = n, A._compression = i;
  const s = A._hardwareTexture, a = t === 4, f = [];
  for (let o = 0; o < e.length; ++o) {
    let d = e[o];
    a && (d = rV(e[o], A.width, A.height, r)), f.push(new Uint8Array(d.buffer, d.byteOffset, d.byteLength));
  }
  this._textureHelper.updateCubeTextures(f, s.underlyingResource, A.width, A.height, s.format, n, !1, 0, 0), A.generateMipMaps && this._generateMipmaps(A, this._uploadEncoder), A.isReady = !0;
};
wn.prototype.createRawCubeTextureFromUrl = function(A, e, t, r, n, i, s, a, f = null, o = null, d = 3, v = !1) {
  const u = this.createRawCubeTexture(null, t, r, n, !i, v, d, null);
  e == null || e.addPendingData(u), u.url = A, this._internalTexturesCache.push(u);
  const l = (p, c) => {
    e == null || e.removePendingData(u), o && p && o(p.status + " " + p.statusText, c);
  }, P = (p) => {
    const c = u.width, H = s(p);
    if (!H)
      return;
    const T = [0, 2, 4, 1, 3, 5];
    if (a) {
      const q = r === 4, b = a(H), j = u._hardwareTexture, w = [0, 1, 2, 3, 4, 5];
      for (let m = 0; m < b.length; m++) {
        const I = c >> m, N = [];
        for (let k = 0; k < 6; k++) {
          let R = b[m][w[k]];
          q && (R = rV(R, I, I, n)), N.push(new Uint8Array(R.buffer, R.byteOffset, R.byteLength));
        }
        this._textureHelper.updateCubeTextures(N, j.underlyingResource, I, I, j.format, v, !1, 0, 0);
      }
    } else {
      const q = [];
      for (let b = 0; b < 6; b++)
        q.push(H[T[b]]);
      this.updateRawCubeTexture(u, q, r, n, v);
    }
    u.isReady = !0, e == null || e.removePendingData(u), f && f();
  };
  return this._loadFile(A, (p) => {
    P(p);
  }, void 0, e == null ? void 0 : e.offlineProvider, !0, l), u;
};
wn.prototype.createRawTexture3D = function(A, e, t, r, n, i, s, a, f = null, o = 0, d = 0) {
  const v = ri.Raw3D, u = new As(this, v);
  return u.baseWidth = e, u.baseHeight = t, u.baseDepth = r, u.width = e, u.height = t, u.depth = r, u.format = n, u.type = o, u.generateMipMaps = i, u.samplingMode = a, u.is3D = !0, this._doNotHandleContextLost || (u._bufferView = A), this._textureHelper.createGPUTextureForInternalTexture(u, e, t, void 0, d), this.updateRawTexture3D(u, A, n, s, f, o), this._internalTexturesCache.push(u), u;
};
wn.prototype.updateRawTexture3D = function(A, e, t, r, n = null, i = 0) {
  if (this._doNotHandleContextLost || (A._bufferView = e, A.format = t, A.invertY = r, A._compression = n), e) {
    const s = A._hardwareTexture;
    t === 4 && (e = rV(e, A.width, A.height, i));
    const f = new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
    this._textureHelper.updateTexture(f, A, A.width, A.height, A.depth, s.format, 0, 0, r, !1, 0, 0), A.generateMipMaps && this._generateMipmaps(A, this._uploadEncoder);
  }
  A.isReady = !0;
};
wn.prototype.createRawTexture2DArray = function(A, e, t, r, n, i, s, a, f = null, o = 0, d = 0) {
  const v = ri.Raw2DArray, u = new As(this, v);
  return u.baseWidth = e, u.baseHeight = t, u.baseDepth = r, u.width = e, u.height = t, u.depth = r, u.format = n, u.type = o, u.generateMipMaps = i, u.samplingMode = a, u.is2DArray = !0, this._doNotHandleContextLost || (u._bufferView = A), this._textureHelper.createGPUTextureForInternalTexture(u, e, t, r, d), this.updateRawTexture2DArray(u, A, n, s, f, o), this._internalTexturesCache.push(u), u;
};
wn.prototype.updateRawTexture2DArray = function(A, e, t, r, n = null, i = 0) {
  if (this._doNotHandleContextLost || (A._bufferView = e, A.format = t, A.invertY = r, A._compression = n), e) {
    const s = A._hardwareTexture;
    t === 4 && (e = rV(e, A.width, A.height, i));
    const f = new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
    this._textureHelper.updateTexture(f, A, A.width, A.height, A.depth, s.format, 0, 0, r, !1, 0, 0), A.generateMipMaps && this._generateMipmaps(A, this._uploadEncoder);
  }
  A.isReady = !0;
};
function rV(A, e, t, r) {
  let n, i = 1;
  r === 1 ? n = new Float32Array(e * t * 4) : r === 2 ? (n = new Uint16Array(e * t * 4), i = 15360) : r === 7 ? n = new Uint32Array(e * t * 4) : n = new Uint8Array(e * t * 4);
  for (let s = 0; s < e; s++)
    for (let a = 0; a < t; a++) {
      const f = (a * e + s) * 3, o = (a * e + s) * 4;
      n[o + 0] = A[f + 0], n[o + 1] = A[f + 1], n[o + 2] = A[f + 2], n[o + 3] = i;
    }
  return n;
}
wn.prototype._readTexturePixels = function(A, e, t, r = -1, n = 0, i = null, s = !0, a = !1, f = 0, o = 0) {
  const d = A._hardwareTexture;
  return s && this.flushFramebuffer(), this._textureHelper.readPixels(d.underlyingResource, f, o, e, t, d.format, r, n, i, a);
};
wn.prototype._readTexturePixelsSync = function() {
  throw "_readTexturePixelsSync is unsupported in WebGPU!";
};
class Mle extends DR {
}
wn.prototype._createHardwareRenderTargetWrapper = function(A, e, t) {
  const r = new Mle(A, e, t, this);
  return this._renderTargetWrapperCache.push(r), r;
};
wn.prototype.createRenderTargetTexture = function(A, e) {
  var t, r, n;
  const i = this._createHardwareRenderTargetWrapper(!1, !1, A), s = {};
  e !== void 0 && typeof e == "object" ? (s.generateMipMaps = e.generateMipMaps, s.generateDepthBuffer = e.generateDepthBuffer === void 0 ? !0 : e.generateDepthBuffer, s.generateStencilBuffer = s.generateDepthBuffer && e.generateStencilBuffer, s.samplingMode = e.samplingMode === void 0 ? 3 : e.samplingMode, s.creationFlags = (t = e.creationFlags) !== null && t !== void 0 ? t : 0, s.noColorAttachment = !!e.noColorAttachment, s.samples = e.samples, s.label = e.label) : (s.generateMipMaps = e, s.generateDepthBuffer = !0, s.generateStencilBuffer = !1, s.samplingMode = 3, s.creationFlags = 0, s.noColorAttachment = !1);
  const a = s.noColorAttachment ? null : this._createInternalTexture(A, e, !0, ri.RenderTarget);
  return i.label = (r = s.label) !== null && r !== void 0 ? r : "RenderTargetWrapper", i._samples = (n = s.samples) !== null && n !== void 0 ? n : 1, i._generateDepthBuffer = s.generateDepthBuffer, i._generateStencilBuffer = !!s.generateStencilBuffer, i.setTextures(a), (i._generateDepthBuffer || i._generateStencilBuffer) && i.createDepthStencilTexture(
    0,
    !1,
    // force false as filtering is not supported for depth textures
    i._generateStencilBuffer,
    i.samples,
    s.generateStencilBuffer ? 13 : 14,
    s.label ? s.label + "-DepthStencil" : void 0
  ), a && (e !== void 0 && typeof e == "object" && e.createMipMaps && !s.generateMipMaps && (a.generateMipMaps = !0), this._textureHelper.createGPUTextureForInternalTexture(a, void 0, void 0, void 0, s.creationFlags), e !== void 0 && typeof e == "object" && e.createMipMaps && !s.generateMipMaps && (a.generateMipMaps = !1)), i;
};
wn.prototype._createDepthStencilTexture = function(A, e) {
  const t = new As(this, ri.DepthStencil);
  t.label = e.label;
  const r = Object.assign({ bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1, samples: 1, depthTextureFormat: e.generateStencil ? 13 : 14 }, e);
  t.format = r.depthTextureFormat, this._setupDepthStencilTexture(t, A, r.generateStencil, r.bilinearFiltering, r.comparisonFunction, r.samples), this._textureHelper.createGPUTextureForInternalTexture(t);
  const n = t._hardwareTexture;
  return t.type = Ns.GetTextureTypeFromFormat(n.format), this._internalTexturesCache.push(t), t;
};
wn.prototype._setupDepthStencilTexture = function(A, e, t, r, n, i = 1) {
  const s = e.width || e, a = e.height || e, f = e.layers || 0;
  A.baseWidth = s, A.baseHeight = a, A.width = s, A.height = a, A.is2DArray = f > 0, A.depth = f, A.isReady = !0, A.samples = i, A.generateMipMaps = !1, A.samplingMode = r ? 2 : 1, A.type = 1, A._comparisonFunction = n, A._cachedWrapU = 0, A._cachedWrapV = 0;
};
wn.prototype.updateRenderTargetTextureSampleCount = function(A, e) {
  return !A || !A.texture || A.samples === e || (e = Math.min(e, this.getCaps().maxMSAASamples), this._textureHelper.createMSAATexture(A.texture, e), A._depthStencilTexture && (this._textureHelper.createMSAATexture(A._depthStencilTexture, e), A._depthStencilTexture.samples = e), A._samples = e, A.texture.samples = e), e;
};
wn.prototype.createRenderTargetCubeTexture = function(A, e) {
  var t;
  const r = this._createHardwareRenderTargetWrapper(!1, !0, A), n = Object.assign({ generateMipMaps: !0, generateDepthBuffer: !0, generateStencilBuffer: !1, type: 0, samplingMode: 3, format: 5, samples: 1 }, e);
  n.generateStencilBuffer = n.generateDepthBuffer && n.generateStencilBuffer, r.label = (t = n.label) !== null && t !== void 0 ? t : "RenderTargetWrapper", r._generateDepthBuffer = n.generateDepthBuffer, r._generateStencilBuffer = n.generateStencilBuffer;
  const i = new As(this, ri.RenderTarget);
  return i.width = A, i.height = A, i.depth = 0, i.isReady = !0, i.isCube = !0, i.samples = n.samples, i.generateMipMaps = n.generateMipMaps, i.samplingMode = n.samplingMode, i.type = n.type, i.format = n.format, this._internalTexturesCache.push(i), r.setTextures(i), (r._generateDepthBuffer || r._generateStencilBuffer) && r.createDepthStencilTexture(0, n.samplingMode === void 0 || n.samplingMode === 2 || n.samplingMode === 2 || n.samplingMode === 3 || n.samplingMode === 3 || n.samplingMode === 5 || n.samplingMode === 6 || n.samplingMode === 7 || n.samplingMode === 11, r._generateStencilBuffer, r.samples), e && e.createMipMaps && !n.generateMipMaps && (i.generateMipMaps = !0), this._textureHelper.createGPUTextureForInternalTexture(i), e && e.createMipMaps && !n.generateMipMaps && (i.generateMipMaps = !1), r;
};
An.prototype.setTextureSampler = function(A, e) {
  this._engine.setTextureSampler(A, e);
};
wn.prototype.setTextureSampler = function(A, e) {
  var t;
  (t = this._currentMaterialContext) === null || t === void 0 || t.setSampler(A, e);
};
An.prototype.setStorageBuffer = function(A, e) {
  this._engine.setStorageBuffer(A, e);
};
wn.prototype.createStorageBuffer = function(A, e, t) {
  return this._createBuffer(A, e | 32, t);
};
wn.prototype.updateStorageBuffer = function(A, e, t, r) {
  const n = A;
  t === void 0 && (t = 0);
  let i;
  r === void 0 ? (e instanceof Array ? i = new Float32Array(e) : e instanceof ArrayBuffer ? i = new Uint8Array(e) : i = e, r = i.byteLength) : e instanceof Array ? i = new Float32Array(e) : e instanceof ArrayBuffer ? i = new Uint8Array(e) : i = e, this._bufferManager.setSubData(n, t, i, 0, r);
};
wn.prototype.readFromStorageBuffer = function(A, e, t, r) {
  t = t || A.capacity;
  const n = this._bufferManager.createRawBuffer(t, ga.MapRead | ga.CopyDst, void 0, "TempReadFromStorageBuffer");
  return this._renderEncoder.copyBufferToBuffer(A.underlyingResource, e ?? 0, n, 0, t), new Promise((i, s) => {
    this.onEndFrameObservable.addOnce(() => {
      n.mapAsync(vD.Read, 0, t).then(() => {
        const a = n.getMappedRange(0, t);
        let f = r;
        if (f === void 0)
          f = new Uint8Array(t), f.set(new Uint8Array(a));
        else {
          const o = f.constructor;
          f = new o(f.buffer), f.set(new o(a));
        }
        n.unmap(), this._bufferManager.releaseBuffer(n), i(f);
      }, (a) => s(a));
    });
  });
};
wn.prototype.setStorageBuffer = function(A, e) {
  var t, r;
  (t = this._currentDrawContext) === null || t === void 0 || t.setBuffer(A, (r = e == null ? void 0 : e.getBuffer()) !== null && r !== void 0 ? r : null);
};
wn.prototype.createUniformBuffer = function(A, e) {
  let t;
  return A instanceof Array ? t = new Float32Array(A) : t = A, this._bufferManager.createBuffer(t, ga.Uniform | ga.CopyDst, e);
};
wn.prototype.createDynamicUniformBuffer = function(A, e) {
  return this.createUniformBuffer(A, e);
};
wn.prototype.updateUniformBuffer = function(A, e, t, r) {
  t === void 0 && (t = 0);
  const n = A;
  let i;
  r === void 0 ? (e instanceof Float32Array ? i = e : i = new Float32Array(e), r = i.byteLength) : e instanceof Float32Array ? i = e : i = new Float32Array(e), this._bufferManager.setSubData(n, t, i, 0, r);
};
wn.prototype.bindUniformBufferBase = function(A, e, t) {
  this._currentDrawContext.setBuffer(t, A);
};
wn.prototype.bindUniformBlock = function() {
};
function Lle(A) {
  return !!(A && A.underlyingResource !== void 0);
}
wn.prototype.updateVideoTexture = function(A, e, t) {
  var r;
  if (!A || A._isDisabled)
    return;
  this._videoTextureSupported === void 0 && (this._videoTextureSupported = !0);
  let n = A._hardwareTexture;
  !((r = A._hardwareTexture) === null || r === void 0) && r.underlyingResource || (n = this._textureHelper.createGPUTextureForInternalTexture(A)), Lle(e) ? (this._textureHelper.copyVideoToTexture(e, A, n.format, !t), A.generateMipMaps && this._generateMipmaps(A), A.isReady = !0) : e && this.createImageBitmap(e).then((i) => {
    this._textureHelper.updateTexture(i, A, A.width, A.height, A.depth, n.format, 0, 0, !t, !1, 0, 0), A.generateMipMaps && this._generateMipmaps(A), A.isReady = !0;
  }).catch(() => {
    A.isReady = !0;
  });
};
class Kle {
  /**
   * Creates an engine based on the capabilities of the underlying hardware
   * @param canvas Defines the canvas to use to display the result
   * @param options Defines the options passed to the engine to create the context dependencies
   * @returns a promise that resolves with the created engine
   */
  static async CreateAsync(e, t) {
    return await wn.IsSupportedAsync ? wn.CreateAsync(e, t) : Ge.IsSupported ? new Ge(e, void 0, t) : new ote(t);
  }
}
class qp {
}
qp.COPY = 1;
qp.CUT = 2;
qp.PASTE = 3;
class wC {
  /**
   *Creates an instance of ClipboardInfo.
   * @param type Defines the type of event (BABYLON.ClipboardEventTypes)
   * @param event Defines the related dom event
   */
  constructor(e, t) {
    this.type = e, this.event = t;
  }
  /**
   *  Get the clipboard event's type from the keycode.
   * @param keyCode Defines the keyCode for the current keyboard event.
   * @returns {number}
   */
  static GetTypeFromCharacter(e) {
    switch (e) {
      case 67:
        return qp.COPY;
      case 86:
        return qp.PASTE;
      case 88:
        return qp.CUT;
      default:
        return -1;
    }
  }
}
class Pp extends Lo {
  /** Default material used to render when gizmo is not disabled or hovered */
  get coloredMaterial() {
    return this._coloredMaterial;
  }
  /** Material used to render when gizmo is hovered with mouse*/
  get hoverMaterial() {
    return this._hoverMaterial;
  }
  /** Material used to render when gizmo is disabled. typically grey.*/
  get disableMaterial() {
    return this._disableMaterial;
  }
  /**
   * Creates an AxisScaleGizmo
   * @param dragAxis The axis which the gizmo will be able to scale on
   * @param color The color of the gizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
   * @param parent
   * @param thickness display gizmo axis thickness
   * @param hoverColor The color of the gizmo when hovering over and dragging
   * @param disableColor The Color of the gizmo when its disabled
   */
  constructor(e, t = Ne.Gray(), r = Ds.DefaultUtilityLayer, n = null, i = 1, s = Ne.Yellow(), a = Ne.Gray()) {
    var f, o, d, v, u, l, P;
    super(r), this._pointerObserver = null, this.snapDistance = 0, this.onSnapObservable = new Oe(), this.uniformScaling = !1, this.sensitivity = 1, this.dragScale = 1, this.incrementalSnap = !1, this._isEnabled = !0, this._parent = null, this._dragging = !1, this._tmpVector = new S(0, 0, 0), this._parent = n, this._coloredMaterial = new Wt("", r.utilityLayerScene), this._coloredMaterial.diffuseColor = t, this._coloredMaterial.specularColor = t.subtract(new Ne(0.1, 0.1, 0.1)), this._hoverMaterial = new Wt("", r.utilityLayerScene), this._hoverMaterial.diffuseColor = s, this._disableMaterial = new Wt("", r.utilityLayerScene), this._disableMaterial.diffuseColor = a, this._disableMaterial.alpha = 0.4, this._gizmoMesh = new Ee("axis", r.utilityLayerScene);
    const { arrowMesh: p, arrowTail: c } = this._createGizmoMesh(this._gizmoMesh, i), H = this._createGizmoMesh(this._gizmoMesh, i + 4, !0);
    this._gizmoMesh.lookAt(this._rootMesh.position.add(e)), this._rootMesh.addChild(this._gizmoMesh, Lo.PreserveScaling), this._gizmoMesh.scaling.scaleInPlace(1 / 3);
    const T = p.position.clone(), q = c.position.clone(), b = c.scaling.clone(), j = (y) => {
      const O = y * (3 / this._rootMesh.scaling.length()) * 6;
      p.position.z += O / 3.5, c.scaling.y += O, this.dragScale = c.scaling.y, c.position.z = p.position.z / 2;
    }, w = () => {
      p.position.set(T.x, T.y, T.z), c.position.set(q.x, q.y, q.z), c.scaling.set(b.x, b.y, b.z), this.dragScale = c.scaling.y, this._dragging = !1;
    };
    this.dragBehavior = new O9({ dragAxis: e }), this.dragBehavior.moveAttached = !1, this.dragBehavior.updateDragPlane = !1, this._rootMesh.addBehavior(this.dragBehavior);
    let m = 0, I = 0;
    const N = { snapDistance: 0 };
    this.dragBehavior.onDragObservable.add((y) => {
      if (this.attachedNode) {
        const O = this.sensitivity * y.dragDistance * (this.scaleRatio * 3 / this._rootMesh.scaling.length()), Y = this._tmpVector;
        let ee = !1, Z = 0;
        if (this.uniformScaling ? Y.setAll(0.57735) : Y.copyFrom(e), this.snapDistance == 0)
          Y.scaleToRef(O, Y);
        else {
          m += O, I += O;
          const _ = this.incrementalSnap ? I : m;
          Math.abs(_) > this.snapDistance ? (Z = Math.floor(Math.abs(_) / this.snapDistance), _ < 0 && (Z *= -1), m = m % this.snapDistance, Y.scaleToRef(this.snapDistance * Z, Y), ee = !0) : Y.scaleInPlace(0);
        }
        Y.addInPlaceFromFloats(1, 1, 1), Y.x = Math.abs(Y.x) < Pp.MinimumAbsoluteScale ? Pp.MinimumAbsoluteScale * (Y.x < 0 ? -1 : 1) : Y.x, Y.y = Math.abs(Y.y) < Pp.MinimumAbsoluteScale ? Pp.MinimumAbsoluteScale * (Y.y < 0 ? -1 : 1) : Y.y, Y.z = Math.abs(Y.z) < Pp.MinimumAbsoluteScale ? Pp.MinimumAbsoluteScale * (Y.z < 0 ? -1 : 1) : Y.z;
        const te = this.attachedNode._isMesh ? this.attachedNode : void 0;
        Math.abs(this.snapDistance) > 0 && this.incrementalSnap ? (this.attachedNode.getWorldMatrix().decompose(void 0, ue.Quaternion[0], ue.Vector3[2], Lo.PreserveScaling ? te : void 0), he.ComposeToRef(Y, ue.Quaternion[0], ue.Vector3[2], ue.Matrix[1])) : (he.ScalingToRef(Y.x, Y.y, Y.z, ue.Matrix[2]), ue.Matrix[2].multiplyToRef(this.attachedNode.getWorldMatrix(), ue.Matrix[1])), ue.Matrix[1].decompose(ue.Vector3[1], void 0, void 0, Lo.PreserveScaling ? te : void 0);
        const fe = 1e5;
        Math.abs(ue.Vector3[1].x) < fe && Math.abs(ue.Vector3[1].y) < fe && Math.abs(ue.Vector3[1].z) < fe && this.attachedNode.getWorldMatrix().copyFrom(ue.Matrix[1]), ee && (N.snapDistance = this.snapDistance * Z, this.onSnapObservable.notifyObservers(N)), this._matrixChanged();
      }
    }), this.dragBehavior.onDragStartObservable.add(() => {
      this._dragging = !0;
    }), this.dragBehavior.onDragObservable.add((y) => j(y.dragDistance)), this.dragBehavior.onDragEndObservable.add(w), (d = (o = (f = n == null ? void 0 : n.uniformScaleGizmo) === null || f === void 0 ? void 0 : f.dragBehavior) === null || o === void 0 ? void 0 : o.onDragObservable) === null || d === void 0 || d.add((y) => j(y.delta.y)), (l = (u = (v = n == null ? void 0 : n.uniformScaleGizmo) === null || v === void 0 ? void 0 : v.dragBehavior) === null || u === void 0 ? void 0 : u.onDragEndObservable) === null || l === void 0 || l.add(w);
    const k = {
      gizmoMeshes: [p, c],
      colliderMeshes: [H.arrowMesh, H.arrowTail],
      material: this._coloredMaterial,
      hoverMaterial: this._hoverMaterial,
      disableMaterial: this._disableMaterial,
      active: !1,
      dragBehavior: this.dragBehavior
    };
    (P = this._parent) === null || P === void 0 || P.addToAxisCache(this._gizmoMesh, k), this._pointerObserver = r.utilityLayerScene.onPointerObservable.add((y) => {
      var O;
      if (!this._customMeshSet && (this._isHovered = k.colliderMeshes.indexOf((O = y == null ? void 0 : y.pickInfo) === null || O === void 0 ? void 0 : O.pickedMesh) != -1, !this._parent)) {
        const Y = this.dragBehavior.enabled ? this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial : this._disableMaterial;
        this._setGizmoMeshMaterial(k.gizmoMeshes, Y);
      }
    }), this.dragBehavior.onEnabledObservable.add((y) => {
      this._setGizmoMeshMaterial(k.gizmoMeshes, y ? this._coloredMaterial : this._disableMaterial);
    });
    const R = r._getSharedGizmoLight();
    R.includedOnlyMeshes = R.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes());
  }
  /**
   * Create Geometry for Gizmo
   * @param parentMesh
   * @param thickness
   * @param isCollider
   */
  _createGizmoMesh(e, t, r = !1) {
    const n = k0("yPosMesh", { size: 0.4 * (1 + (t - 1) / 4) }, this.gizmoLayer.utilityLayerScene), i = Ld("cylinder", { diameterTop: 5e-3 * t, height: 0.275, diameterBottom: 5e-3 * t, tessellation: 96 }, this.gizmoLayer.utilityLayerScene);
    return n.scaling.scaleInPlace(0.1), n.material = this._coloredMaterial, n.rotation.x = Math.PI / 2, n.position.z += 0.3, i.material = this._coloredMaterial, i.position.z += 0.275 / 2, i.rotation.x = Math.PI / 2, r && (n.visibility = 0, i.visibility = 0), e.addChild(n), e.addChild(i), { arrowMesh: n, arrowTail: i };
  }
  _attachedNodeChanged(e) {
    this.dragBehavior && (this.dragBehavior.enabled = !!e);
  }
  /**
   * If the gizmo is enabled
   */
  set isEnabled(e) {
    this._isEnabled = e, e ? this._parent && (this.attachedMesh = this._parent.attachedMesh, this.attachedNode = this._parent.attachedNode) : (this.attachedMesh = null, this.attachedNode = null);
  }
  get isEnabled() {
    return this._isEnabled;
  }
  /**
   * Disposes of the gizmo
   */
  dispose() {
    this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((e) => {
      e && e.dispose();
    }), super.dispose();
  }
  /**
   * Disposes and replaces the current meshes in the gizmo with the specified mesh
   * @param mesh The mesh to replace the default mesh of the gizmo
   * @param useGizmoMaterial If the gizmo's default material should be used (default: false)
   */
  setCustomMesh(e, t = !1) {
    super.setCustomMesh(e), t && (this._rootMesh.getChildMeshes().forEach((r) => {
      r.material = this._coloredMaterial, r.color && (r.color = this._coloredMaterial.diffuseColor);
    }), this._customMeshSet = !1);
  }
}
Pp.MinimumAbsoluteScale = Dn;
class zQ extends Lo {
  /**
   * Sets the axis factor
   * @param factor the Vector3 value
   */
  set axisFactor(e) {
    this._axisFactor = e;
    const t = this._scaleBoxesParent.getChildMeshes();
    let r = 0;
    for (let n = 0; n < 3; n++)
      for (let i = 0; i < 3; i++)
        for (let s = 0; s < 3; s++) {
          const a = (n === 1 ? 1 : 0) + (i === 1 ? 1 : 0) + (s === 1 ? 1 : 0);
          if (!(a === 1 || a === 3)) {
            if (t[r]) {
              const f = new S(n - 1, i - 1, s - 1);
              f.multiplyInPlace(this._axisFactor), t[r].setEnabled(f.lengthSquared() > Dn);
            }
            r++;
          }
        }
  }
  /**
   * Gets the axis factor
   * @returns the Vector3 factor value
   */
  get axisFactor() {
    return this._axisFactor;
  }
  /**
   * Sets scale drag speed value
   * @param value the new speed value
   */
  set scaleDragSpeed(e) {
    this._scaleDragSpeed = e;
  }
  /**
   * Gets scale drag speed
   * @returns the scale speed number
   */
  get scaleDragSpeed() {
    return this._scaleDragSpeed;
  }
  /** Default material used to render when gizmo is not disabled or hovered */
  get coloredMaterial() {
    return this._coloredMaterial;
  }
  /** Material used to render when gizmo is hovered with mouse*/
  get hoverMaterial() {
    return this._hoverColoredMaterial;
  }
  /**
   * Get the pointerDragBehavior
   */
  get pointerDragBehavior() {
    return this._pointerDragBehavior;
  }
  /**
   * Sets the color of the bounding box gizmo
   * @param color the color to set
   */
  setColor(e) {
    this._coloredMaterial.emissiveColor = e, this._hoverColoredMaterial.emissiveColor = e.clone().add(new Ne(0.3, 0.3, 0.3)), this._lineBoundingBox.getChildren().forEach((t) => {
      t.color && (t.color = e);
    });
  }
  /**
   * Creates an BoundingBoxGizmo
   * @param color The color of the gizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
   */
  constructor(e = Ne.Gray(), t = Ds.DefaultKeepDepthUtilityLayer) {
    super(t), this._boundingDimensions = new S(1, 1, 1), this._renderObserver = null, this._pointerObserver = null, this._scaleDragSpeed = 0.2, this._tmpQuaternion = new Ze(), this._tmpVector = new S(0, 0, 0), this._tmpRotationMatrix = new he(), this.ignoreChildren = !1, this.includeChildPredicate = null, this.rotationSphereSize = 0.1, this.scaleBoxSize = 0.1, this.fixedDragMeshScreenSize = !1, this.fixedDragMeshBoundsSize = !1, this.fixedDragMeshScreenSizeDistanceFactor = 10, this.scalingSnapDistance = 0, this.rotationSnapDistance = 0, this.onDragStartObservable = new Oe(), this.onScaleBoxDragObservable = new Oe(), this.onScaleBoxDragEndObservable = new Oe(), this.onRotationSphereDragObservable = new Oe(), this.onRotationSphereDragEndObservable = new Oe(), this.scalePivot = null, this._axisFactor = new S(1, 1, 1), this._existingMeshScale = new S(), this._dragMesh = null, this._pointerDragBehavior = new O9(), this.updateScale = !1, this._anchorMesh = new jn("anchor", t.utilityLayerScene), this._coloredMaterial = new Wt("", t.utilityLayerScene), this._coloredMaterial.disableLighting = !0, this._hoverColoredMaterial = new Wt("", t.utilityLayerScene), this._hoverColoredMaterial.disableLighting = !0, this._lineBoundingBox = new jn("", t.utilityLayerScene), this._lineBoundingBox.rotationQuaternion = new Ze();
    const r = [];
    r.push(ka("lines", { points: [new S(0, 0, 0), new S(this._boundingDimensions.x, 0, 0)] }, t.utilityLayerScene)), r.push(ka("lines", { points: [new S(0, 0, 0), new S(0, this._boundingDimensions.y, 0)] }, t.utilityLayerScene)), r.push(ka("lines", { points: [new S(0, 0, 0), new S(0, 0, this._boundingDimensions.z)] }, t.utilityLayerScene)), r.push(ka("lines", { points: [new S(this._boundingDimensions.x, 0, 0), new S(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, t.utilityLayerScene)), r.push(ka("lines", { points: [new S(this._boundingDimensions.x, 0, 0), new S(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, t.utilityLayerScene)), r.push(ka("lines", { points: [new S(0, this._boundingDimensions.y, 0), new S(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, t.utilityLayerScene)), r.push(ka("lines", { points: [new S(0, this._boundingDimensions.y, 0), new S(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, t.utilityLayerScene)), r.push(ka("lines", { points: [new S(0, 0, this._boundingDimensions.z), new S(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, t.utilityLayerScene)), r.push(ka("lines", { points: [new S(0, 0, this._boundingDimensions.z), new S(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, t.utilityLayerScene)), r.push(ka("lines", {
      points: [
        new S(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z),
        new S(0, this._boundingDimensions.y, this._boundingDimensions.z)
      ]
    }, t.utilityLayerScene)), r.push(ka("lines", {
      points: [
        new S(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z),
        new S(this._boundingDimensions.x, 0, this._boundingDimensions.z)
      ]
    }, t.utilityLayerScene)), r.push(ka("lines", {
      points: [
        new S(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z),
        new S(this._boundingDimensions.x, this._boundingDimensions.y, 0)
      ]
    }, t.utilityLayerScene)), r.forEach((i) => {
      i.color = e, i.position.addInPlace(new S(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), i.isPickable = !1, this._lineBoundingBox.addChild(i);
    }), this._rootMesh.addChild(this._lineBoundingBox), this.setColor(e), this._rotateSpheresParent = new jn("", t.utilityLayerScene), this._rotateSpheresParent.rotationQuaternion = new Ze();
    for (let i = 0; i < 12; i++) {
      const s = UA("", { diameter: 1 }, t.utilityLayerScene);
      s.rotationQuaternion = new Ze(), s.material = this._coloredMaterial, s.isNearGrabbable = !0;
      const a = new O9({});
      a.moveAttached = !1, a.updateDragPlane = !1, s.addBehavior(a);
      const f = new S(1, 0, 0);
      let o = 0, d = 0;
      a.onDragStartObservable.add(() => {
        f.copyFrom(s.forward), o = 0, d = 0;
      }), a.onDragObservable.add((v) => {
        if (this.onRotationSphereDragObservable.notifyObservers({}), this.attachedMesh) {
          const u = this.attachedMesh.parent;
          if (u && u.scaling && u.scaling.isNonUniformWithinEpsilon(1e-3)) {
            Se.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");
            return;
          }
          Vs._RemoveAndStorePivotPoint(this.attachedMesh);
          const l = f, P = v.dragPlaneNormal.scale(S.Dot(v.dragPlaneNormal, l)), p = l.subtract(P).normalizeToNew();
          let c = S.Dot(p, v.delta) < 0 ? Math.abs(v.delta.length()) : -Math.abs(v.delta.length());
          if (c = c / this._boundingDimensions.length() * this._anchorMesh.scaling.length(), this.attachedMesh.rotationQuaternion || (this.attachedMesh.rotationQuaternion = Ze.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z)), this._anchorMesh.rotationQuaternion || (this._anchorMesh.rotationQuaternion = Ze.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z)), o += c, Math.abs(o) <= 2 * Math.PI) {
            if (this.rotationSnapDistance > 0) {
              const H = Math.floor(Math.abs(o) / this.rotationSnapDistance) * (o < 0 ? -1 : 1), T = this.rotationSnapDistance * H;
              c = T - d, d = T;
            }
            i >= 8 ? Ze.RotationYawPitchRollToRef(0, 0, c, this._tmpQuaternion) : i >= 4 ? Ze.RotationYawPitchRollToRef(c, 0, 0, this._tmpQuaternion) : Ze.RotationYawPitchRollToRef(0, c, 0, this._tmpQuaternion), this.attachedMesh.isUsingPivotMatrix() && this._anchorMesh.position.copyFrom(this.attachedMesh.position), this._anchorMesh.addChild(this.attachedMesh), this._anchorMesh.getScene().useRightHandedSystem && this._tmpQuaternion.conjugateInPlace(), this._tmpQuaternion.normalize(), this._anchorMesh.rotationQuaternion.multiplyToRef(this._tmpQuaternion, this._anchorMesh.rotationQuaternion), this._anchorMesh.rotationQuaternion.normalize(), this._anchorMesh.removeChild(this.attachedMesh), this.attachedMesh.setParent(u);
          }
          this.updateBoundingBox(), Vs._RestorePivotPoint(this.attachedMesh);
        }
        this._updateDummy();
      }), a.onDragStartObservable.add(() => {
        this.onDragStartObservable.notifyObservers({}), this._selectNode(s);
      }), a.onDragEndObservable.add((v) => {
        this.onRotationSphereDragEndObservable.notifyObservers({}), this._selectNode(null), this._updateDummy(), this._unhoverMeshOnTouchUp(v.pointerInfo, s);
      }), this._rotateSpheresParent.addChild(s);
    }
    this._rootMesh.addChild(this._rotateSpheresParent), this._scaleBoxesParent = new jn("", t.utilityLayerScene), this._scaleBoxesParent.rotationQuaternion = new Ze();
    for (let i = 0; i < 3; i++)
      for (let s = 0; s < 3; s++)
        for (let a = 0; a < 3; a++) {
          const f = (i === 1 ? 1 : 0) + (s === 1 ? 1 : 0) + (a === 1 ? 1 : 0);
          if (f === 1 || f === 3)
            continue;
          const o = k0("", { size: 1 }, t.utilityLayerScene);
          o.material = this._coloredMaterial, o._internalMetadata = f === 2, o.isNearGrabbable = !0;
          const d = new S(i - 1, s - 1, a - 1).normalize(), v = new O9({ dragAxis: d });
          v.updateDragPlane = !1, v.moveAttached = !1;
          let u = 0, l = 0;
          o.addBehavior(v), v.onDragObservable.add((P) => {
            if (this.onScaleBoxDragObservable.notifyObservers({}), this.attachedMesh) {
              const p = this.attachedMesh.parent;
              if (p && p.scaling && p.scaling.isNonUniformWithinEpsilon(1e-3)) {
                Se.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");
                return;
              }
              Vs._RemoveAndStorePivotPoint(this.attachedMesh);
              let c = P.dragDistance / this._boundingDimensions.length() * this._anchorMesh.scaling.length();
              if (u += c, this.scalingSnapDistance > 0) {
                const T = Math.floor(Math.abs(u) / this.scalingSnapDistance) * (u < 0 ? -1 : 1), q = this.scalingSnapDistance * T;
                c = q - l, l = q;
              }
              const H = new S(c, c, c);
              f === 2 && (H.x *= Math.abs(d.x), H.y *= Math.abs(d.y), H.z *= Math.abs(d.z)), H.scaleInPlace(this._scaleDragSpeed), H.multiplyInPlace(this._axisFactor), this.updateBoundingBox(), this.scalePivot ? (this.attachedMesh.getWorldMatrix().getRotationMatrixToRef(this._tmpRotationMatrix), this._boundingDimensions.scaleToRef(0.5, this._tmpVector), S.TransformCoordinatesToRef(this._tmpVector, this._tmpRotationMatrix, this._tmpVector), this._anchorMesh.position.subtractInPlace(this._tmpVector), this._boundingDimensions.multiplyToRef(this.scalePivot, this._tmpVector), S.TransformCoordinatesToRef(this._tmpVector, this._tmpRotationMatrix, this._tmpVector), this._anchorMesh.position.addInPlace(this._tmpVector)) : (o.absolutePosition.subtractToRef(this._anchorMesh.position, this._tmpVector), this._anchorMesh.position.subtractInPlace(this._tmpVector), this.attachedMesh.isUsingPivotMatrix() && this._anchorMesh.position.subtractInPlace(this.attachedMesh.getPivotPoint())), this._anchorMesh.addChild(this.attachedMesh), this._anchorMesh.scaling.addInPlace(H), (this._anchorMesh.scaling.x < 0 || this._anchorMesh.scaling.y < 0 || this._anchorMesh.scaling.z < 0) && this._anchorMesh.scaling.subtractInPlace(H), this._anchorMesh.removeChild(this.attachedMesh), this.attachedMesh.setParent(p), Vs._RestorePivotPoint(this.attachedMesh);
            }
            this._updateDummy();
          }), v.onDragStartObservable.add(() => {
            this.onDragStartObservable.notifyObservers({}), this._selectNode(o), u = 0, l = 0;
          }), v.onDragEndObservable.add((P) => {
            this.onScaleBoxDragEndObservable.notifyObservers({}), this._selectNode(null), this._updateDummy(), this._unhoverMeshOnTouchUp(P.pointerInfo, o);
          }), this._scaleBoxesParent.addChild(o);
        }
    this._rootMesh.addChild(this._scaleBoxesParent);
    const n = [];
    this._pointerObserver = t.utilityLayerScene.onPointerObservable.add((i) => {
      n[i.event.pointerId] ? i.pickInfo && i.pickInfo.pickedMesh != n[i.event.pointerId] && (n[i.event.pointerId].material = this._coloredMaterial, delete n[i.event.pointerId], this._isHovered = !1) : this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach((s) => {
        i.pickInfo && i.pickInfo.pickedMesh == s && (n[i.event.pointerId] = s, s.material = this._hoverColoredMaterial, this._isHovered = !0);
      });
    }), this._renderObserver = this.gizmoLayer.originalScene.onBeforeRenderObservable.add(() => {
      this.attachedMesh && !this._existingMeshScale.equals(this.attachedMesh.scaling) ? this.updateBoundingBox() : (this.fixedDragMeshScreenSize || this.fixedDragMeshBoundsSize) && (this._updateRotationSpheres(), this._updateScaleBoxes()), this._dragMesh && this.attachedMesh && this._pointerDragBehavior.dragging && (this._lineBoundingBox.position.rotateByQuaternionToRef(this._rootMesh.rotationQuaternion, this._tmpVector), this.attachedMesh.setAbsolutePosition(this._dragMesh.position.add(this._tmpVector.scale(-1))));
    }), this.updateBoundingBox();
  }
  _attachedNodeChanged(e) {
    if (e) {
      this._anchorMesh.scaling.setAll(1), Vs._RemoveAndStorePivotPoint(e);
      const t = e.parent;
      this._anchorMesh.addChild(e), this._anchorMesh.removeChild(e), e.setParent(t), Vs._RestorePivotPoint(e), this.updateBoundingBox(), e.getChildMeshes(!1).forEach((r) => {
        r.markAsDirty("scaling");
      }), this.gizmoLayer.utilityLayerScene.onAfterRenderObservable.addOnce(() => {
        this._updateDummy();
      });
    }
  }
  _selectNode(e) {
    this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach((t) => {
      t.isVisible = !e || t == e;
    });
  }
  _unhoverMeshOnTouchUp(e, t) {
    (e == null ? void 0 : e.event) instanceof PointerEvent && (e == null ? void 0 : e.event.pointerType) === "touch" && (t.material = this._coloredMaterial);
  }
  /**
   * returns an array containing all boxes used for scaling (in increasing x, y and z orders)
   */
  getScaleBoxes() {
    return this._scaleBoxesParent.getChildMeshes();
  }
  /**
   * Updates the bounding box information for the Gizmo
   */
  updateBoundingBox() {
    if (this.attachedMesh) {
      Vs._RemoveAndStorePivotPoint(this.attachedMesh);
      const e = this.attachedMesh.parent;
      this.attachedMesh.setParent(null), this._update(), this.attachedMesh.rotationQuaternion || (this.attachedMesh.rotationQuaternion = Ze.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z)), this._anchorMesh.rotationQuaternion || (this._anchorMesh.rotationQuaternion = Ze.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z)), this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion), this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion), this._tmpVector.copyFrom(this.attachedMesh.position), this.attachedMesh.rotationQuaternion.set(0, 0, 0, 1), this.attachedMesh.position.set(0, 0, 0);
      const t = this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren, this.includeChildPredicate);
      t.max.subtractToRef(t.min, this._boundingDimensions), this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions), this._lineBoundingBox.position.set((t.max.x + t.min.x) / 2, (t.max.y + t.min.y) / 2, (t.max.z + t.min.z) / 2), this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position), this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position), this._lineBoundingBox.computeWorldMatrix(), this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition), this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion), this.attachedMesh.position.copyFrom(this._tmpVector), this.attachedMesh.setParent(e);
    }
    this._updateRotationSpheres(), this._updateScaleBoxes(), this.attachedMesh && (this._existingMeshScale.copyFrom(this.attachedMesh.scaling), Vs._RestorePivotPoint(this.attachedMesh));
  }
  _updateRotationSpheres() {
    const e = this._rotateSpheresParent.getChildMeshes();
    for (let t = 0; t < 3; t++)
      for (let r = 0; r < 2; r++)
        for (let n = 0; n < 2; n++) {
          const i = t * 4 + r * 2 + n;
          if (t == 0 && (e[i].position.set(this._boundingDimensions.x / 2, this._boundingDimensions.y * r, this._boundingDimensions.z * n), e[i].position.addInPlace(new S(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), e[i].lookAt(S.Cross(e[i].position.normalizeToNew(), S.Right()).normalizeToNew().add(e[i].position))), t == 1 && (e[i].position.set(this._boundingDimensions.x * r, this._boundingDimensions.y / 2, this._boundingDimensions.z * n), e[i].position.addInPlace(new S(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), e[i].lookAt(S.Cross(e[i].position.normalizeToNew(), S.Up()).normalizeToNew().add(e[i].position))), t == 2 && (e[i].position.set(this._boundingDimensions.x * r, this._boundingDimensions.y * n, this._boundingDimensions.z / 2), e[i].position.addInPlace(new S(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), e[i].lookAt(S.Cross(e[i].position.normalizeToNew(), S.Forward()).normalizeToNew().add(e[i].position))), this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) {
            e[i].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);
            const s = this.rotationSphereSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;
            e[i].scaling.set(s, s, s);
          } else
            this.fixedDragMeshBoundsSize ? e[i].scaling.set(this.rotationSphereSize * this._boundingDimensions.x, this.rotationSphereSize * this._boundingDimensions.y, this.rotationSphereSize * this._boundingDimensions.z) : e[i].scaling.set(this.rotationSphereSize, this.rotationSphereSize, this.rotationSphereSize);
        }
  }
  _updateScaleBoxes() {
    const e = this._scaleBoxesParent.getChildMeshes();
    let t = 0;
    for (let r = 0; r < 3; r++)
      for (let n = 0; n < 3; n++)
        for (let i = 0; i < 3; i++) {
          const s = (r === 1 ? 1 : 0) + (n === 1 ? 1 : 0) + (i === 1 ? 1 : 0);
          if (!(s === 1 || s === 3)) {
            if (e[t])
              if (e[t].position.set(this._boundingDimensions.x * (r / 2), this._boundingDimensions.y * (n / 2), this._boundingDimensions.z * (i / 2)), e[t].position.addInPlace(new S(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) {
                e[t].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);
                const a = this.scaleBoxSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;
                e[t].scaling.set(a, a, a);
              } else
                this.fixedDragMeshBoundsSize ? e[t].scaling.set(this.scaleBoxSize * this._boundingDimensions.x, this.scaleBoxSize * this._boundingDimensions.y, this.scaleBoxSize * this._boundingDimensions.z) : e[t].scaling.set(this.scaleBoxSize, this.scaleBoxSize, this.scaleBoxSize);
            t++;
          }
        }
  }
  /**
   * Enables rotation on the specified axis and disables rotation on the others
   * @param axis The list of axis that should be enabled (eg. "xy" or "xyz")
   */
  setEnabledRotationAxis(e) {
    this._rotateSpheresParent.getChildMeshes().forEach((t, r) => {
      r < 4 ? t.setEnabled(e.indexOf("x") != -1) : r < 8 ? t.setEnabled(e.indexOf("y") != -1) : t.setEnabled(e.indexOf("z") != -1);
    });
  }
  /**
   * Enables/disables scaling
   * @param enable if scaling should be enabled
   * @param homogeneousScaling defines if scaling should only be homogeneous
   */
  setEnabledScaling(e, t = !1) {
    this._scaleBoxesParent.getChildMeshes().forEach((r) => {
      let n = e;
      t && r._internalMetadata === !0 && (n = !1), r.setEnabled(n);
    });
  }
  _updateDummy() {
    this._dragMesh && (this._dragMesh.position.copyFrom(this._lineBoundingBox.getAbsolutePosition()), this._dragMesh.scaling.copyFrom(this._lineBoundingBox.scaling), this._dragMesh.rotationQuaternion.copyFrom(this._rootMesh.rotationQuaternion));
  }
  /**
   * Enables a pointer drag behavior on the bounding box of the gizmo
   */
  enableDragBehavior() {
    this._dragMesh = k0("dummy", { size: 1 }, this.gizmoLayer.utilityLayerScene), this._dragMesh.visibility = 0, this._dragMesh.rotationQuaternion = new Ze(), this._pointerDragBehavior.useObjectOrientationForDragging = !1, this._dragMesh.addBehavior(this._pointerDragBehavior);
  }
  /**
   * Disposes of the gizmo
   */
  dispose() {
    this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver), this._lineBoundingBox.dispose(), this._rotateSpheresParent.dispose(), this._scaleBoxesParent.dispose(), this._dragMesh && this._dragMesh.dispose(), super.dispose();
  }
  /**
   * Makes a mesh not pickable and wraps the mesh inside of a bounding box mesh that is pickable. (This is useful to avoid picking within complex geometry)
   * @param mesh the mesh to wrap in the bounding box mesh and make not pickable
   * @returns the bounding box mesh with the passed in mesh as a child
   */
  static MakeNotPickableAndWrapInBoundingBox(e) {
    const t = (a) => {
      a.isPickable = !1, a.getChildMeshes().forEach((f) => {
        t(f);
      });
    };
    t(e), e.rotationQuaternion || (e.rotationQuaternion = Ze.RotationYawPitchRoll(e.rotation.y, e.rotation.x, e.rotation.z));
    const r = e.position.clone(), n = e.rotationQuaternion.clone();
    e.rotationQuaternion.set(0, 0, 0, 1), e.position.set(0, 0, 0);
    const i = k0("box", { size: 1 }, e.getScene()), s = e.getHierarchyBoundingVectors();
    return s.max.subtractToRef(s.min, i.scaling), i.scaling.y === 0 && (i.scaling.y = Dn), i.scaling.x === 0 && (i.scaling.x = Dn), i.scaling.z === 0 && (i.scaling.z = Dn), i.position.set((s.max.x + s.min.x) / 2, (s.max.y + s.min.y) / 2, (s.max.z + s.min.z) / 2), e.addChild(i), e.rotationQuaternion.copyFrom(n), e.position.copyFrom(r), e.removeChild(i), i.addChild(e), i.visibility = 0, i;
  }
  /**
   * CustomMeshes are not supported by this gizmo
   */
  setCustomMesh() {
    Se.Error("Custom meshes are not supported on this gizmo");
  }
}
class S0 extends Lo {
  /** Default material used to render when gizmo is not disabled or hovered */
  get coloredMaterial() {
    return this._coloredMaterial;
  }
  /** Material used to render when gizmo is hovered with mouse */
  get hoverMaterial() {
    return this._hoverMaterial;
  }
  /** Color used to render the drag angle sector when gizmo is rotated with mouse */
  set rotationColor(e) {
    this._rotationShaderMaterial.setColor3("rotationColor", e);
  }
  /** Material used to render when gizmo is disabled. typically grey. */
  get disableMaterial() {
    return this._disableMaterial;
  }
  /**
   * Creates a PlaneRotationGizmo
   * @param planeNormal The normal of the plane which the gizmo will be able to rotate on
   * @param color The color of the gizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
   * @param tessellation Amount of tessellation to be used when creating rotation circles
   * @param parent
   * @param useEulerRotation Use and update Euler angle instead of quaternion
   * @param thickness display gizmo axis thickness
   * @param hoverColor The color of the gizmo when hovering over and dragging
   * @param disableColor The Color of the gizmo when its disabled
   */
  constructor(e, t = Ne.Gray(), r = Ds.DefaultUtilityLayer, n = 32, i = null, s = !1, a = 1, f = Ne.Yellow(), o = Ne.Gray()) {
    var d;
    super(r), this._pointerObserver = null, this.snapDistance = 0, this.onSnapObservable = new Oe(), this.angle = 0, this.sensitivity = 1, this._isEnabled = !0, this._parent = null, this._dragging = !1, this._angles = new S(), this._parent = i, this._coloredMaterial = new Wt("", r.utilityLayerScene), this._coloredMaterial.diffuseColor = t, this._coloredMaterial.specularColor = t.subtract(new Ne(0.1, 0.1, 0.1)), this._hoverMaterial = new Wt("", r.utilityLayerScene), this._hoverMaterial.diffuseColor = f, this._hoverMaterial.specularColor = f, this._disableMaterial = new Wt("", r.utilityLayerScene), this._disableMaterial.diffuseColor = o, this._disableMaterial.alpha = 0.4, this._gizmoMesh = new Ee("", r.utilityLayerScene);
    const { rotationMesh: v, collider: u } = this._createGizmoMesh(this._gizmoMesh, a, n);
    this._rotationDisplayPlane = u4("rotationDisplay", {
      size: 0.6,
      updatable: !1
    }, this.gizmoLayer.utilityLayerScene), this._rotationDisplayPlane.rotation.z = Math.PI * 0.5, this._rotationDisplayPlane.parent = this._gizmoMesh, this._rotationDisplayPlane.setEnabled(!1), An.ShadersStore.rotationGizmoVertexShader = S0._RotationGizmoVertexShader, An.ShadersStore.rotationGizmoFragmentShader = S0._RotationGizmoFragmentShader, this._rotationShaderMaterial = new Zo("shader", this.gizmoLayer.utilityLayerScene, {
      vertex: "rotationGizmo",
      fragment: "rotationGizmo"
    }, {
      attributes: ["position", "uv"],
      uniforms: ["worldViewProjection", "angles", "rotationColor"]
    }), this._rotationShaderMaterial.backFaceCulling = !1, this.rotationColor = f, this._rotationDisplayPlane.material = this._rotationShaderMaterial, this._rotationDisplayPlane.visibility = 0.999, this._gizmoMesh.lookAt(this._rootMesh.position.add(e)), this._rootMesh.addChild(this._gizmoMesh, Lo.PreserveScaling), this._gizmoMesh.scaling.scaleInPlace(1 / 3), this.dragBehavior = new O9({ dragPlaneNormal: e }), this.dragBehavior.moveAttached = !1, this.dragBehavior.maxDragAngle = S0.MaxDragAngle, this.dragBehavior._useAlternatePickedPointAboveMaxDragAngle = !0, this._rootMesh.addBehavior(this.dragBehavior);
    const l = new S(), P = new he(), p = new S();
    let c = new S();
    this.dragBehavior.onDragStartObservable.add((m) => {
      this.attachedNode && (l.copyFrom(m.dragPlanePoint), this._rotationDisplayPlane.setEnabled(!0), this._rotationDisplayPlane.getWorldMatrix().invertToRef(P), S.TransformCoordinatesToRef(m.dragPlanePoint, P, l), this._angles.x = Math.atan2(l.y, l.x) + Math.PI, this._angles.y = 0, this._angles.z = this.updateGizmoRotationToMatchAttachedMesh ? 1 : 0, this._dragging = !0, l.copyFrom(m.dragPlanePoint), this._rotationShaderMaterial.setVector3("angles", this._angles), this.angle = 0);
    }), this.dragBehavior.onDragEndObservable.add(() => {
      this._dragging = !1, this._rotationDisplayPlane.setEnabled(!1);
    });
    const H = { snapDistance: 0 };
    let T = 0;
    const q = new he(), b = new Ze();
    this.dragBehavior.onDragObservable.add((m) => {
      if (this.attachedNode) {
        const I = new S(1, 1, 1), N = new Ze(0, 0, 0, 1), k = new S(0, 0, 0);
        if (this.attachedNode.getWorldMatrix().decompose(I, N, k), !(Math.abs(Math.abs(I.x) - Math.abs(I.y)) <= Dn && Math.abs(Math.abs(I.x) - Math.abs(I.z)) <= Dn) && this.updateGizmoRotationToMatchAttachedMesh) {
          Se.Warn("Unable to use a rotation gizmo matching mesh rotation with non uniform scaling. Use uniform scaling or set updateGizmoRotationToMatchAttachedMesh to false.");
          return;
        }
        N.normalize();
        const y = this.updateGizmoPositionToMatchAttachedMesh ? k : this._rootMesh.absolutePosition, O = m.dragPlanePoint.subtract(y).normalize(), Y = l.subtract(y).normalize(), ee = S.Cross(O, Y), Z = S.Dot(O, Y);
        let te = Math.atan2(ee.length(), Z) * this.sensitivity;
        p.copyFrom(e), c.copyFrom(e), this.updateGizmoRotationToMatchAttachedMesh && (N.toRotationMatrix(P), c = S.TransformCoordinates(p, P));
        let fe = !1;
        if (r.utilityLayerScene.activeCamera) {
          const $ = r.utilityLayerScene.activeCamera.position.subtract(y).normalize();
          S.Dot($, c) > 0 && (p.scaleInPlace(-1), c.scaleInPlace(-1), fe = !0);
        }
        S.Dot(c, ee) > 0 && (te = -te), ue.Vector3[0].set(te, 0, 0), this.dragBehavior.validateDrag(ue.Vector3[0]) || (te = 0);
        let G = !1;
        if (this.snapDistance != 0)
          if (T += te, Math.abs(T) > this.snapDistance) {
            let $ = Math.floor(Math.abs(T) / this.snapDistance);
            T < 0 && ($ *= -1), T = T % this.snapDistance, te = this.snapDistance * $, G = !0;
          } else
            te = 0;
        const L = Math.sin(te / 2);
        if (b.set(p.x * L, p.y * L, p.z * L, Math.cos(te / 2)), q.determinant() > 0) {
          const $ = new S();
          b.toEulerAnglesToRef($), Ze.RotationYawPitchRollToRef($.y, -$.x, -$.z, b);
        }
        if (this.updateGizmoRotationToMatchAttachedMesh)
          N.multiplyToRef(b, N), N.normalize(), he.ComposeToRef(I, N, k, this.attachedNode.getWorldMatrix());
        else {
          b.toRotationMatrix(ue.Matrix[0]);
          const $ = this.attachedNode.getWorldMatrix().getTranslation();
          this.attachedNode.getWorldMatrix().multiplyToRef(ue.Matrix[0], this.attachedNode.getWorldMatrix()), this.attachedNode.getWorldMatrix().setTranslation($);
        }
        l.copyFrom(m.dragPlanePoint), G && (H.snapDistance = te, this.onSnapObservable.notifyObservers(H)), this._angles.y += te, this.angle += fe ? -te : te, this._rotationShaderMaterial.setVector3("angles", this._angles), this._matrixChanged();
      }
    });
    const j = r._getSharedGizmoLight();
    j.includedOnlyMeshes = j.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));
    const w = {
      colliderMeshes: [u],
      gizmoMeshes: [v],
      material: this._coloredMaterial,
      hoverMaterial: this._hoverMaterial,
      disableMaterial: this._disableMaterial,
      active: !1,
      dragBehavior: this.dragBehavior
    };
    (d = this._parent) === null || d === void 0 || d.addToAxisCache(this._gizmoMesh, w), this._pointerObserver = r.utilityLayerScene.onPointerObservable.add((m) => {
      var I;
      if (!this._customMeshSet && (this.dragBehavior.maxDragAngle = S0.MaxDragAngle, this._isHovered = w.colliderMeshes.indexOf((I = m == null ? void 0 : m.pickInfo) === null || I === void 0 ? void 0 : I.pickedMesh) != -1, !this._parent)) {
        const N = w.dragBehavior.enabled ? this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial : this._disableMaterial;
        this._setGizmoMeshMaterial(w.gizmoMeshes, N);
      }
    }), this.dragBehavior.onEnabledObservable.add((m) => {
      this._setGizmoMeshMaterial(w.gizmoMeshes, m ? this._coloredMaterial : this._disableMaterial);
    });
  }
  /**
   * Create Geometry for Gizmo
   * @param parentMesh
   * @param thickness
   * @param tessellation
   */
  _createGizmoMesh(e, t, r) {
    const n = Ag("ignore", {
      diameter: 0.6,
      thickness: 0.03 * t,
      tessellation: r
    }, this.gizmoLayer.utilityLayerScene);
    n.visibility = 0;
    const i = Ag("", {
      diameter: 0.6,
      thickness: 5e-3 * t,
      tessellation: r
    }, this.gizmoLayer.utilityLayerScene);
    return i.material = this._coloredMaterial, i.rotation.x = Math.PI / 2, n.rotation.x = Math.PI / 2, e.addChild(i, Lo.PreserveScaling), e.addChild(n, Lo.PreserveScaling), { rotationMesh: i, collider: n };
  }
  _attachedNodeChanged(e) {
    this.dragBehavior && (this.dragBehavior.enabled = !!e);
  }
  /**
   * If the gizmo is enabled
   */
  set isEnabled(e) {
    this._isEnabled = e, e ? this._parent && (this.attachedMesh = this._parent.attachedMesh) : this.attachedMesh = null;
  }
  get isEnabled() {
    return this._isEnabled;
  }
  /**
   * Disposes of the gizmo
   */
  dispose() {
    this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), this._rotationDisplayPlane && this._rotationDisplayPlane.dispose(), this._rotationShaderMaterial && this._rotationShaderMaterial.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((e) => {
      e && e.dispose();
    }), super.dispose();
  }
}
S0.MaxDragAngle = Math.PI * 9 / 20;
S0._RotationGizmoVertexShader = `
        precision highp float;
        attribute vec3 position;
        attribute vec2 uv;
        uniform mat4 worldViewProjection;
        varying vec3 vPosition;
        varying vec2 vUV;

        void main(void) {
            gl_Position = worldViewProjection * vec4(position, 1.0);
            vUV = uv;
        }`;
S0._RotationGizmoFragmentShader = `
        precision highp float;
        varying vec2 vUV;
        varying vec3 vPosition;
        uniform vec3 angles;
        uniform vec3 rotationColor;

        #define twopi 6.283185307

        void main(void) {
            vec2 uv = vUV - vec2(0.5);
            float angle = atan(uv.y, uv.x) + 3.141592;
            float delta = gl_FrontFacing ? angles.y : -angles.y;
            float begin = angles.x - delta * angles.z;
            float start = (begin < (begin + delta)) ? begin : (begin + delta);
            float end = (begin > (begin + delta)) ? begin : (begin + delta);
            float len = sqrt(dot(uv,uv));
            float opacity = 1. - step(0.5, len);

            float base = abs(floor(start / twopi)) * twopi;
            start += base;
            end += base;

            float intensity = 0.;
            for (int i = 0; i < 5; i++)
            {
                intensity += max(step(start, angle) - step(end, angle), 0.);
                angle += twopi;
            }
            gl_FragColor = vec4(rotationColor, min(intensity * 0.25, 0.8)) * opacity;
        }
    `;
class GQ extends Lo {
  get attachedMesh() {
    return this._meshAttached;
  }
  set attachedMesh(e) {
    this._meshAttached = e, this._nodeAttached = e, this._checkBillboardTransform(), [this.xGizmo, this.yGizmo, this.zGizmo].forEach((t) => {
      t.isEnabled ? t.attachedMesh = e : t.attachedMesh = null;
    });
  }
  get attachedNode() {
    return this._nodeAttached;
  }
  set attachedNode(e) {
    this._meshAttached = null, this._nodeAttached = e, this._checkBillboardTransform(), [this.xGizmo, this.yGizmo, this.zGizmo].forEach((t) => {
      t.isEnabled ? t.attachedNode = e : t.attachedNode = null;
    });
  }
  _checkBillboardTransform() {
    this._nodeAttached && this._nodeAttached.billboardMode && console.log("Rotation Gizmo will not work with transforms in billboard mode.");
  }
  /**
   * Sensitivity factor for dragging (Default: 1)
   */
  set sensitivity(e) {
    this._sensitivity = e, [this.xGizmo, this.yGizmo, this.zGizmo].forEach((t) => {
      t && (t.sensitivity = e);
    });
  }
  get sensitivity() {
    return this._sensitivity;
  }
  /**
   * True when the mouse pointer is hovering a gizmo mesh
   */
  get isHovered() {
    let e = !1;
    return [this.xGizmo, this.yGizmo, this.zGizmo].forEach((t) => {
      e = e || t.isHovered;
    }), e;
  }
  /**
   * Creates a RotationGizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
   * @param tessellation Amount of tessellation to be used when creating rotation circles
   * @param useEulerRotation Use and update Euler angle instead of quaternion
   * @param thickness display gizmo axis thickness
   * @param gizmoManager Gizmo manager
   * @param options More options
   */
  constructor(e = Ds.DefaultUtilityLayer, t = 32, r = !1, n = 1, i, s) {
    super(e), this.onDragStartObservable = new Oe(), this.onDragObservable = new Oe(), this.onDragEndObservable = new Oe(), this._observables = [], this._sensitivity = 1, this._gizmoAxisCache = /* @__PURE__ */ new Map();
    const a = s && s.xOptions && s.xOptions.color ? s.xOptions.color : Ne.Red().scale(0.5), f = s && s.yOptions && s.yOptions.color ? s.yOptions.color : Ne.Green().scale(0.5), o = s && s.zOptions && s.zOptions.color ? s.zOptions.color : Ne.Blue().scale(0.5);
    this.xGizmo = new S0(new S(1, 0, 0), a, e, t, this, r, n), this.yGizmo = new S0(new S(0, 1, 0), f, e, t, this, r, n), this.zGizmo = new S0(new S(0, 0, 1), o, e, t, this, r, n), [this.xGizmo, this.yGizmo, this.zGizmo].forEach((d) => {
      s && s.updateScale != null && (d.updateScale = s.updateScale), d.dragBehavior.onDragStartObservable.add(() => {
        this.onDragStartObservable.notifyObservers({});
      }), d.dragBehavior.onDragObservable.add(() => {
        this.onDragObservable.notifyObservers({});
      }), d.dragBehavior.onDragEndObservable.add(() => {
        this.onDragEndObservable.notifyObservers({});
      });
    }), this.attachedMesh = null, this.attachedNode = null, i ? i.addToAxisCache(this._gizmoAxisCache) : Lo.GizmoAxisPointerObserver(e, this._gizmoAxisCache);
  }
  /**
   * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
   * NOTE: This is only possible for meshes with uniform scaling, as otherwise it's not possible to decompose the rotation
   */
  set updateGizmoRotationToMatchAttachedMesh(e) {
    this.xGizmo && (this.xGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.yGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.zGizmo.updateGizmoRotationToMatchAttachedMesh = e);
  }
  get updateGizmoRotationToMatchAttachedMesh() {
    return this.xGizmo.updateGizmoRotationToMatchAttachedMesh;
  }
  set updateGizmoPositionToMatchAttachedMesh(e) {
    this.xGizmo && (this.xGizmo.updateGizmoPositionToMatchAttachedMesh = e, this.yGizmo.updateGizmoPositionToMatchAttachedMesh = e, this.zGizmo.updateGizmoPositionToMatchAttachedMesh = e);
  }
  get updateGizmoPositionToMatchAttachedMesh() {
    return this.xGizmo.updateGizmoPositionToMatchAttachedMesh;
  }
  set anchorPoint(e) {
    this._anchorPoint = e, [this.xGizmo, this.yGizmo, this.zGizmo].forEach((t) => {
      t.anchorPoint = e;
    });
  }
  get anchorPoint() {
    return this._anchorPoint;
  }
  /**
   * Set the coordinate system to use. By default it's local.
   * But it's possible for a user to tweak so its local for translation and world for rotation.
   * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`
   */
  set coordinatesMode(e) {
    [this.xGizmo, this.yGizmo, this.zGizmo].forEach((t) => {
      t.coordinatesMode = e;
    });
  }
  set updateScale(e) {
    this.xGizmo && (this.xGizmo.updateScale = e, this.yGizmo.updateScale = e, this.zGizmo.updateScale = e);
  }
  get updateScale() {
    return this.xGizmo.updateScale;
  }
  /**
   * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
   */
  set snapDistance(e) {
    this.xGizmo && (this.xGizmo.snapDistance = e, this.yGizmo.snapDistance = e, this.zGizmo.snapDistance = e);
  }
  get snapDistance() {
    return this.xGizmo.snapDistance;
  }
  /**
   * Ratio for the scale of the gizmo (Default: 1)
   */
  set scaleRatio(e) {
    this.xGizmo && (this.xGizmo.scaleRatio = e, this.yGizmo.scaleRatio = e, this.zGizmo.scaleRatio = e);
  }
  get scaleRatio() {
    return this.xGizmo.scaleRatio;
  }
  /**
   * posture that the gizmo will be display
   * When set null, default value will be used (Quaternion(0, 0, 0, 1))
   */
  get customRotationQuaternion() {
    return this._customRotationQuaternion;
  }
  set customRotationQuaternion(e) {
    this._customRotationQuaternion = e, [this.xGizmo, this.yGizmo, this.zGizmo].forEach((t) => {
      t && (t.customRotationQuaternion = e);
    });
  }
  /**
   * Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation
   * @param mesh Axis gizmo mesh
   * @param cache Gizmo axis definition used for reactive gizmo UI
   */
  addToAxisCache(e, t) {
    this._gizmoAxisCache.set(e, t);
  }
  /**
   * Disposes of the gizmo
   */
  dispose() {
    this.xGizmo.dispose(), this.yGizmo.dispose(), this.zGizmo.dispose(), this.onDragStartObservable.clear(), this.onDragObservable.clear(), this.onDragEndObservable.clear(), this._observables.forEach((e) => {
      this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(e);
    });
  }
  /**
   * CustomMeshes are not supported by this gizmo
   */
  setCustomMesh() {
    Se.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");
  }
}
class tS extends Lo {
  /** Default material used to render when gizmo is not disabled or hovered */
  get coloredMaterial() {
    return this._coloredMaterial;
  }
  /** Material used to render when gizmo is hovered with mouse*/
  get hoverMaterial() {
    return this._hoverMaterial;
  }
  /** Material used to render when gizmo is disabled. typically grey.*/
  get disableMaterial() {
    return this._disableMaterial;
  }
  /**
   * @internal
   */
  static _CreatePlane(e, t) {
    const r = new Hr("plane", e), n = u4("dragPlane", { width: 0.1375, height: 0.1375, sideOrientation: 2 }, e);
    return n.material = t, n.parent = r, r;
  }
  /**
   * Creates a PlaneDragGizmo
   * @param dragPlaneNormal The axis normal to which the gizmo will be able to drag on
   * @param color The color of the gizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
   * @param parent
   * @param hoverColor The color of the gizmo when hovering over and dragging
   * @param disableColor The Color of the gizmo when its disabled
   */
  constructor(e, t = Ne.Gray(), r = Ds.DefaultUtilityLayer, n = null, i = Ne.Yellow(), s = Ne.Gray()) {
    var a;
    super(r), this._pointerObserver = null, this.snapDistance = 0, this.onSnapObservable = new Oe(), this._isEnabled = !1, this._parent = null, this._dragging = !1, this._parent = n, this._coloredMaterial = new Wt("", r.utilityLayerScene), this._coloredMaterial.diffuseColor = t, this._coloredMaterial.specularColor = t.subtract(new Ne(0.1, 0.1, 0.1)), this._hoverMaterial = new Wt("", r.utilityLayerScene), this._hoverMaterial.diffuseColor = i, this._disableMaterial = new Wt("", r.utilityLayerScene), this._disableMaterial.diffuseColor = s, this._disableMaterial.alpha = 0.4, this._gizmoMesh = tS._CreatePlane(r.utilityLayerScene, this._coloredMaterial), this._gizmoMesh.lookAt(this._rootMesh.position.add(e)), this._gizmoMesh.scaling.scaleInPlace(1 / 3), this._gizmoMesh.parent = this._rootMesh;
    let f = 0;
    const o = new S(), d = { snapDistance: 0 };
    this.dragBehavior = new O9({ dragPlaneNormal: e }), this.dragBehavior.moveAttached = !1, this._rootMesh.addBehavior(this.dragBehavior), this.dragBehavior.onDragObservable.add((l) => {
      if (this.attachedNode) {
        if (this.snapDistance == 0)
          this.attachedNode.getWorldMatrix().getTranslationToRef(ue.Vector3[0]), ue.Vector3[0].addToRef(l.delta, ue.Vector3[0]), this.dragBehavior.validateDrag(ue.Vector3[0]) && this.attachedNode.getWorldMatrix().addTranslationFromFloats(l.delta.x, l.delta.y, l.delta.z);
        else if (f += l.dragDistance, Math.abs(f) > this.snapDistance) {
          const P = Math.floor(Math.abs(f) / this.snapDistance);
          f = f % this.snapDistance, l.delta.normalizeToRef(o), o.scaleInPlace(this.snapDistance * P), this.attachedNode.getWorldMatrix().getTranslationToRef(ue.Vector3[0]), ue.Vector3[0].addToRef(o, ue.Vector3[0]), this.dragBehavior.validateDrag(ue.Vector3[0]) && (this.attachedNode.getWorldMatrix().addTranslationFromFloats(o.x, o.y, o.z), d.snapDistance = this.snapDistance * P, this.onSnapObservable.notifyObservers(d));
        }
        this._matrixChanged();
      }
    }), this.dragBehavior.onDragStartObservable.add(() => {
      this._dragging = !0;
    }), this.dragBehavior.onDragEndObservable.add(() => {
      this._dragging = !1;
    });
    const v = r._getSharedGizmoLight();
    v.includedOnlyMeshes = v.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));
    const u = {
      gizmoMeshes: this._gizmoMesh.getChildMeshes(),
      colliderMeshes: this._gizmoMesh.getChildMeshes(),
      material: this._coloredMaterial,
      hoverMaterial: this._hoverMaterial,
      disableMaterial: this._disableMaterial,
      active: !1,
      dragBehavior: this.dragBehavior
    };
    (a = this._parent) === null || a === void 0 || a.addToAxisCache(this._gizmoMesh, u), this._pointerObserver = r.utilityLayerScene.onPointerObservable.add((l) => {
      var P;
      if (!this._customMeshSet && (this._isHovered = u.colliderMeshes.indexOf((P = l == null ? void 0 : l.pickInfo) === null || P === void 0 ? void 0 : P.pickedMesh) != -1, !this._parent)) {
        const p = u.dragBehavior.enabled ? this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial : this._disableMaterial;
        this._setGizmoMeshMaterial(u.gizmoMeshes, p);
      }
    }), this.dragBehavior.onEnabledObservable.add((l) => {
      this._setGizmoMeshMaterial(u.gizmoMeshes, l ? this._coloredMaterial : this._disableMaterial);
    });
  }
  _attachedNodeChanged(e) {
    this.dragBehavior && (this.dragBehavior.enabled = !!e);
  }
  /**
   * If the gizmo is enabled
   */
  set isEnabled(e) {
    this._isEnabled = e, e ? this._parent && (this.attachedNode = this._parent.attachedNode) : this.attachedNode = null;
  }
  get isEnabled() {
    return this._isEnabled;
  }
  /**
   * Disposes of the gizmo
   */
  dispose() {
    this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), super.dispose(), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((e) => {
      e && e.dispose();
    });
  }
}
class oy extends Lo {
  get attachedMesh() {
    return this._meshAttached;
  }
  set attachedMesh(e) {
    this._meshAttached = e, this._nodeAttached = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      t.isEnabled ? t.attachedMesh = e : t.attachedMesh = null;
    });
  }
  get attachedNode() {
    return this._nodeAttached;
  }
  set attachedNode(e) {
    this._meshAttached = null, this._nodeAttached = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      t.isEnabled ? t.attachedNode = e : t.attachedNode = null;
    });
  }
  /**
   * True when the mouse pointer is hovering a gizmo mesh
   */
  get isHovered() {
    let e = !1;
    return [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      e = e || t.isHovered;
    }), e;
  }
  /**
   * Creates a PositionGizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
    @param thickness display gizmo axis thickness
   * @param gizmoManager
   */
  constructor(e = Ds.DefaultUtilityLayer, t = 1, r) {
    super(e), this._meshAttached = null, this._nodeAttached = null, this._observables = [], this._gizmoAxisCache = /* @__PURE__ */ new Map(), this.onDragStartObservable = new Oe(), this.onDragObservable = new Oe(), this.onDragEndObservable = new Oe(), this._planarGizmoEnabled = !1, this.xGizmo = new lp(new S(1, 0, 0), Ne.Red().scale(0.5), e, this, t), this.yGizmo = new lp(new S(0, 1, 0), Ne.Green().scale(0.5), e, this, t), this.zGizmo = new lp(new S(0, 0, 1), Ne.Blue().scale(0.5), e, this, t), this.xPlaneGizmo = new tS(new S(1, 0, 0), Ne.Red().scale(0.5), this.gizmoLayer, this), this.yPlaneGizmo = new tS(new S(0, 1, 0), Ne.Green().scale(0.5), this.gizmoLayer, this), this.zPlaneGizmo = new tS(new S(0, 0, 1), Ne.Blue().scale(0.5), this.gizmoLayer, this), [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((n) => {
      n.dragBehavior.onDragStartObservable.add(() => {
        this.onDragStartObservable.notifyObservers({});
      }), n.dragBehavior.onDragObservable.add(() => {
        this.onDragObservable.notifyObservers({});
      }), n.dragBehavior.onDragEndObservable.add(() => {
        this.onDragEndObservable.notifyObservers({});
      });
    }), this.attachedMesh = null, r ? r.addToAxisCache(this._gizmoAxisCache) : Lo.GizmoAxisPointerObserver(e, this._gizmoAxisCache);
  }
  /**
   * If the planar drag gizmo is enabled
   * setting this will enable/disable XY, XZ and YZ planes regardless of individual gizmo settings.
   */
  set planarGizmoEnabled(e) {
    this._planarGizmoEnabled = e, [this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      t && (t.isEnabled = e, e && (t.attachedMesh ? t.attachedMesh = this.attachedMesh : t.attachedNode = this.attachedNode));
    }, this);
  }
  get planarGizmoEnabled() {
    return this._planarGizmoEnabled;
  }
  /**
   * posture that the gizmo will be display
   * When set null, default value will be used (Quaternion(0, 0, 0, 1))
   */
  get customRotationQuaternion() {
    return this._customRotationQuaternion;
  }
  set customRotationQuaternion(e) {
    this._customRotationQuaternion = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      t && (t.customRotationQuaternion = e);
    });
  }
  /**
   * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
   * NOTE: This is only possible for meshes with uniform scaling, as otherwise it's not possible to decompose the rotation
   */
  set updateGizmoRotationToMatchAttachedMesh(e) {
    this._updateGizmoRotationToMatchAttachedMesh = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      t && (t.updateGizmoRotationToMatchAttachedMesh = e);
    });
  }
  get updateGizmoRotationToMatchAttachedMesh() {
    return this._updateGizmoRotationToMatchAttachedMesh;
  }
  set updateGizmoPositionToMatchAttachedMesh(e) {
    this._updateGizmoPositionToMatchAttachedMesh = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      t && (t.updateGizmoPositionToMatchAttachedMesh = e);
    });
  }
  get updateGizmoPositionToMatchAttachedMesh() {
    return this._updateGizmoPositionToMatchAttachedMesh;
  }
  set anchorPoint(e) {
    this._anchorPoint = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      t.anchorPoint = e;
    });
  }
  get anchorPoint() {
    return this._anchorPoint;
  }
  /**
   * Set the coordinate system to use. By default it's local.
   * But it's possible for a user to tweak so its local for translation and world for rotation.
   * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`
   */
  set coordinatesMode(e) {
    [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      t.coordinatesMode = e;
    });
  }
  set updateScale(e) {
    this.xGizmo && (this.xGizmo.updateScale = e, this.yGizmo.updateScale = e, this.zGizmo.updateScale = e);
  }
  get updateScale() {
    return this.xGizmo.updateScale;
  }
  /**
   * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
   */
  set snapDistance(e) {
    this._snapDistance = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      t && (t.snapDistance = e);
    });
  }
  get snapDistance() {
    return this._snapDistance;
  }
  /**
   * Ratio for the scale of the gizmo (Default: 1)
   */
  set scaleRatio(e) {
    this._scaleRatio = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((t) => {
      t && (t.scaleRatio = e);
    });
  }
  get scaleRatio() {
    return this._scaleRatio;
  }
  /**
   * Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation
   * @param mesh Axis gizmo mesh
   * @param cache Gizmo axis definition used for reactive gizmo UI
   */
  addToAxisCache(e, t) {
    this._gizmoAxisCache.set(e, t);
  }
  /**
   * Disposes of the gizmo
   */
  dispose() {
    [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((e) => {
      e && e.dispose();
    }), this._observables.forEach((e) => {
      this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(e);
    }), this.onDragStartObservable.clear(), this.onDragObservable.clear(), this.onDragEndObservable.clear();
  }
  /**
   * CustomMeshes are not supported by this gizmo
   */
  setCustomMesh() {
    Se.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)");
  }
}
class ZQ extends Lo {
  /** Default material used to render when gizmo is not disabled or hovered */
  get coloredMaterial() {
    return this._coloredMaterial;
  }
  /** Material used to render when gizmo is hovered with mouse*/
  get hoverMaterial() {
    return this._hoverMaterial;
  }
  /** Material used to render when gizmo is disabled. typically grey.*/
  get disableMaterial() {
    return this._disableMaterial;
  }
  get attachedMesh() {
    return this._meshAttached;
  }
  set attachedMesh(e) {
    this._meshAttached = e, this._nodeAttached = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((t) => {
      t.isEnabled ? t.attachedMesh = e : t.attachedMesh = null;
    });
  }
  get attachedNode() {
    return this._nodeAttached;
  }
  set attachedNode(e) {
    this._meshAttached = null, this._nodeAttached = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((t) => {
      t.isEnabled ? t.attachedNode = e : t.attachedNode = null;
    });
  }
  set updateScale(e) {
    this.xGizmo && (this.xGizmo.updateScale = e, this.yGizmo.updateScale = e, this.zGizmo.updateScale = e);
  }
  get updateScale() {
    return this.xGizmo.updateScale;
  }
  /**
   * True when the mouse pointer is hovering a gizmo mesh
   */
  get isHovered() {
    let e = !1;
    return [this.xGizmo, this.yGizmo, this.zGizmo].forEach((t) => {
      e = e || t.isHovered;
    }), e;
  }
  /**
   * Creates a ScaleGizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
   * @param thickness display gizmo axis thickness
   * @param gizmoManager
   */
  constructor(e = Ds.DefaultUtilityLayer, t = 1, r) {
    super(e), this._meshAttached = null, this._nodeAttached = null, this._incrementalSnap = !1, this._sensitivity = 1, this._observables = [], this._gizmoAxisCache = /* @__PURE__ */ new Map(), this.onDragStartObservable = new Oe(), this.onDragObservable = new Oe(), this.onDragEndObservable = new Oe(), this.uniformScaleGizmo = this._createUniformScaleMesh(), this.xGizmo = new Pp(new S(1, 0, 0), Ne.Red().scale(0.5), e, this, t), this.yGizmo = new Pp(new S(0, 1, 0), Ne.Green().scale(0.5), e, this, t), this.zGizmo = new Pp(new S(0, 0, 1), Ne.Blue().scale(0.5), e, this, t), [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((n) => {
      n.dragBehavior.onDragStartObservable.add(() => {
        this.onDragStartObservable.notifyObservers({});
      }), n.dragBehavior.onDragObservable.add(() => {
        this.onDragObservable.notifyObservers({});
      }), n.dragBehavior.onDragEndObservable.add(() => {
        this.onDragEndObservable.notifyObservers({});
      });
    }), this.attachedMesh = null, this.attachedNode = null, r ? r.addToAxisCache(this._gizmoAxisCache) : Lo.GizmoAxisPointerObserver(e, this._gizmoAxisCache);
  }
  /** Create Geometry for Gizmo */
  _createUniformScaleMesh() {
    this._coloredMaterial = new Wt("", this.gizmoLayer.utilityLayerScene), this._coloredMaterial.diffuseColor = Ne.Gray(), this._hoverMaterial = new Wt("", this.gizmoLayer.utilityLayerScene), this._hoverMaterial.diffuseColor = Ne.Yellow(), this._disableMaterial = new Wt("", this.gizmoLayer.utilityLayerScene), this._disableMaterial.diffuseColor = Ne.Gray(), this._disableMaterial.alpha = 0.4;
    const e = new Pp(new S(0, 1, 0), Ne.Gray().scale(0.5), this.gizmoLayer, this);
    e.updateGizmoRotationToMatchAttachedMesh = !1, e.uniformScaling = !0, this._uniformScalingMesh = hm("uniform", { type: 1 }, e.gizmoLayer.utilityLayerScene), this._uniformScalingMesh.scaling.scaleInPlace(0.01), this._uniformScalingMesh.visibility = 0, this._octahedron = hm("", { type: 1 }, e.gizmoLayer.utilityLayerScene), this._octahedron.scaling.scaleInPlace(7e-3), this._uniformScalingMesh.addChild(this._octahedron), e.setCustomMesh(this._uniformScalingMesh, !0);
    const t = this.gizmoLayer._getSharedGizmoLight();
    t.includedOnlyMeshes = t.includedOnlyMeshes.concat(this._octahedron);
    const r = {
      gizmoMeshes: [this._octahedron, this._uniformScalingMesh],
      colliderMeshes: [this._uniformScalingMesh],
      material: this._coloredMaterial,
      hoverMaterial: this._hoverMaterial,
      disableMaterial: this._disableMaterial,
      active: !1,
      dragBehavior: e.dragBehavior
    };
    return this.addToAxisCache(e._rootMesh, r), e;
  }
  set updateGizmoRotationToMatchAttachedMesh(e) {
    e ? (this._updateGizmoRotationToMatchAttachedMesh = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((t) => {
      t && (t.updateGizmoRotationToMatchAttachedMesh = e);
    })) : Se.Warn("Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported.");
  }
  get updateGizmoRotationToMatchAttachedMesh() {
    return this._updateGizmoRotationToMatchAttachedMesh;
  }
  set anchorPoint(e) {
    this._anchorPoint = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((t) => {
      t && (t.anchorPoint = e);
    });
  }
  get anchorPoint() {
    return this._anchorPoint;
  }
  /**
   * posture that the gizmo will be display
   * When set null, default value will be used (Quaternion(0, 0, 0, 1))
   */
  get customRotationQuaternion() {
    return this._customRotationQuaternion;
  }
  set customRotationQuaternion(e) {
    this._customRotationQuaternion = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((t) => {
      t && (t.customRotationQuaternion = e);
    });
  }
  /**
   * Set the coordinate system to use. By default it's local.
   * But it's possible for a user to tweak so its local for translation and world for rotation.
   * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`
   */
  set coordinatesMode(e) {
    e == pD.World && Se.Warn("Setting coordinates Mode to world on scaling gizmo is not supported."), [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((t) => {
      t.coordinatesMode = pD.Local;
    });
  }
  /**
   * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
   */
  set snapDistance(e) {
    this._snapDistance = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((t) => {
      t && (t.snapDistance = e);
    });
  }
  get snapDistance() {
    return this._snapDistance;
  }
  /**
   * Incremental snap scaling (default is false). When true, with a snapDistance of 0.1, scaling will be 1.1,1.2,1.3 instead of, when false: 1.1,1.21,1.33,...
   */
  set incrementalSnap(e) {
    this._incrementalSnap = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((t) => {
      t && (t.incrementalSnap = e);
    });
  }
  get incrementalSnap() {
    return this._incrementalSnap;
  }
  /**
   * Ratio for the scale of the gizmo (Default: 1)
   */
  set scaleRatio(e) {
    this._scaleRatio = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((t) => {
      t && (t.scaleRatio = e);
    });
  }
  get scaleRatio() {
    return this._scaleRatio;
  }
  /**
   * Sensitivity factor for dragging (Default: 1)
   */
  set sensitivity(e) {
    this._sensitivity = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((t) => {
      t && (t.sensitivity = e);
    });
  }
  get sensitivity() {
    return this._sensitivity;
  }
  /**
   * Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation
   * @param mesh Axis gizmo mesh
   * @param cache Gizmo axis definition used for reactive gizmo UI
   */
  addToAxisCache(e, t) {
    this._gizmoAxisCache.set(e, t);
  }
  /**
   * Disposes of the gizmo
   */
  dispose() {
    [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((e) => {
      e && e.dispose();
    }), this._observables.forEach((e) => {
      this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(e);
    }), this.onDragStartObservable.clear(), this.onDragObservable.clear(), this.onDragEndObservable.clear(), [this._uniformScalingMesh, this._octahedron].forEach((e) => {
      e && e.dispose();
    }), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((e) => {
      e && e.dispose();
    });
  }
}
class Jle {
  /**
   * Utility layer that the bounding box gizmo belongs to
   */
  get keepDepthUtilityLayer() {
    return this._defaultKeepDepthUtilityLayer;
  }
  /**
   * Utility layer that all gizmos besides bounding box belong to
   */
  get utilityLayer() {
    return this._defaultUtilityLayer;
  }
  /**
   * True when the mouse pointer is hovering a gizmo mesh
   */
  get isHovered() {
    let e = !1;
    for (const t in this.gizmos) {
      const r = this.gizmos[t];
      if (r && r.isHovered) {
        e = !0;
        break;
      }
    }
    return e;
  }
  /**
   * Ratio for the scale of the gizmo (Default: 1)
   */
  set scaleRatio(e) {
    this._scaleRatio = e, [this.gizmos.positionGizmo, this.gizmos.rotationGizmo, this.gizmos.scaleGizmo].forEach((t) => {
      t && (t.scaleRatio = e);
    });
  }
  get scaleRatio() {
    return this._scaleRatio;
  }
  /**
   * Set the coordinate system to use. By default it's local.
   * But it's possible for a user to tweak so its local for translation and world for rotation.
   * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`
   */
  set coordinatesMode(e) {
    this._coordinatesMode = e, [this.gizmos.positionGizmo, this.gizmos.rotationGizmo, this.gizmos.scaleGizmo].forEach((t) => {
      t && (t.coordinatesMode = e);
    });
  }
  get coordinatesMode() {
    return this._coordinatesMode;
  }
  /**
   * Instantiates a gizmo manager
   * @param _scene the scene to overlay the gizmos on top of
   * @param thickness display gizmo axis thickness
   * @param utilityLayer the layer where gizmos are rendered
   * @param keepDepthUtilityLayer the layer where occluded gizmos are rendered
   */
  constructor(e, t = 1, r = Ds.DefaultUtilityLayer, n = Ds.DefaultKeepDepthUtilityLayer) {
    this._scene = e, this.clearGizmoOnEmptyPointerEvent = !1, this.enableAutoPicking = !0, this.onAttachedToMeshObservable = new Oe(), this.onAttachedToNodeObservable = new Oe(), this._gizmosEnabled = { positionGizmo: !1, rotationGizmo: !1, scaleGizmo: !1, boundingBoxGizmo: !1 }, this._pointerObservers = [], this._attachedMesh = null, this._attachedNode = null, this._boundingBoxColor = Ne.FromHexString("#0984e3"), this._thickness = 1, this._scaleRatio = 1, this._coordinatesMode = pD.Local, this._gizmoAxisCache = /* @__PURE__ */ new Map(), this.boundingBoxDragBehavior = new Hee(), this.attachableMeshes = null, this.attachableNodes = null, this.usePointerToAttachGizmos = !0, this._defaultUtilityLayer = r, this._defaultKeepDepthUtilityLayer = n, this._defaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = !1, this._thickness = t, this.gizmos = { positionGizmo: null, rotationGizmo: null, scaleGizmo: null, boundingBoxGizmo: null };
    const i = this._attachToMeshPointerObserver(e), s = Lo.GizmoAxisPointerObserver(this._defaultUtilityLayer, this._gizmoAxisCache);
    this._pointerObservers = [i, s];
  }
  /**
   * Subscribes to pointer down events, for attaching and detaching mesh
   * @param scene The scene layer the observer will be added to
   */
  _attachToMeshPointerObserver(e) {
    return e.onPointerObservable.add((r) => {
      if (this.usePointerToAttachGizmos && r.type == ir.POINTERDOWN)
        if (r.pickInfo && r.pickInfo.pickedMesh) {
          if (this.enableAutoPicking) {
            let n = r.pickInfo.pickedMesh;
            if (this.attachableMeshes == null)
              for (; n && n.parent != null; )
                n = n.parent;
            else {
              let i = !1;
              this.attachableMeshes.forEach((s) => {
                n && (n == s || n.isDescendantOf(s)) && (n = s, i = !0);
              }), i || (n = null);
            }
            n instanceof jn ? this._attachedMesh != n && this.attachToMesh(n) : this.clearGizmoOnEmptyPointerEvent && this.attachToMesh(null);
          }
        } else
          this.clearGizmoOnEmptyPointerEvent && this.attachToMesh(null);
    });
  }
  /**
   * Attaches a set of gizmos to the specified mesh
   * @param mesh The mesh the gizmo's should be attached to
   */
  attachToMesh(e) {
    this._attachedMesh && this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh = e, this._attachedNode = null;
    for (const t in this.gizmos) {
      const r = this.gizmos[t];
      r && this._gizmosEnabled[t] && (r.attachedMesh = e);
    }
    this.boundingBoxGizmoEnabled && this._attachedMesh && this._attachedMesh.addBehavior(this.boundingBoxDragBehavior), this.onAttachedToMeshObservable.notifyObservers(e);
  }
  /**
   * Attaches a set of gizmos to the specified node
   * @param node The node the gizmo's should be attached to
   */
  attachToNode(e) {
    this._attachedMesh && this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh = null, this._attachedNode = e;
    for (const t in this.gizmos) {
      const r = this.gizmos[t];
      r && this._gizmosEnabled[t] && (r.attachedNode = e);
    }
    this.boundingBoxGizmoEnabled && this._attachedNode && this._attachedNode.addBehavior(this.boundingBoxDragBehavior), this.onAttachedToNodeObservable.notifyObservers(e);
  }
  /**
   * If the position gizmo is enabled
   */
  set positionGizmoEnabled(e) {
    e ? (this.gizmos.positionGizmo || (this.gizmos.positionGizmo = new oy(this._defaultUtilityLayer, this._thickness, this)), this._attachedNode ? this.gizmos.positionGizmo.attachedNode = this._attachedNode : this.gizmos.positionGizmo.attachedMesh = this._attachedMesh) : this.gizmos.positionGizmo && (this.gizmos.positionGizmo.attachedNode = null), this._gizmosEnabled.positionGizmo = e;
  }
  get positionGizmoEnabled() {
    return this._gizmosEnabled.positionGizmo;
  }
  /**
   * If the rotation gizmo is enabled
   */
  set rotationGizmoEnabled(e) {
    e ? (this.gizmos.rotationGizmo || (this.gizmos.rotationGizmo = new GQ(this._defaultUtilityLayer, 32, !1, this._thickness, this)), this._attachedNode ? this.gizmos.rotationGizmo.attachedNode = this._attachedNode : this.gizmos.rotationGizmo.attachedMesh = this._attachedMesh) : this.gizmos.rotationGizmo && (this.gizmos.rotationGizmo.attachedNode = null), this._gizmosEnabled.rotationGizmo = e;
  }
  get rotationGizmoEnabled() {
    return this._gizmosEnabled.rotationGizmo;
  }
  /**
   * If the scale gizmo is enabled
   */
  set scaleGizmoEnabled(e) {
    e ? (this.gizmos.scaleGizmo = this.gizmos.scaleGizmo || new ZQ(this._defaultUtilityLayer, this._thickness, this), this._attachedNode ? this.gizmos.scaleGizmo.attachedNode = this._attachedNode : this.gizmos.scaleGizmo.attachedMesh = this._attachedMesh) : this.gizmos.scaleGizmo && (this.gizmos.scaleGizmo.attachedNode = null), this._gizmosEnabled.scaleGizmo = e;
  }
  get scaleGizmoEnabled() {
    return this._gizmosEnabled.scaleGizmo;
  }
  /**
   * If the boundingBox gizmo is enabled
   */
  set boundingBoxGizmoEnabled(e) {
    e ? (this.gizmos.boundingBoxGizmo = this.gizmos.boundingBoxGizmo || new zQ(this._boundingBoxColor, this._defaultKeepDepthUtilityLayer), this._attachedMesh ? this.gizmos.boundingBoxGizmo.attachedMesh = this._attachedMesh : this.gizmos.boundingBoxGizmo.attachedNode = this._attachedNode, this._attachedMesh ? (this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh.addBehavior(this.boundingBoxDragBehavior)) : this._attachedNode && (this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode.addBehavior(this.boundingBoxDragBehavior))) : this.gizmos.boundingBoxGizmo && (this._attachedMesh ? this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior) : this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this.gizmos.boundingBoxGizmo.attachedNode = null), this._gizmosEnabled.boundingBoxGizmo = e;
  }
  get boundingBoxGizmoEnabled() {
    return this._gizmosEnabled.boundingBoxGizmo;
  }
  /**
   * Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation
   * @param gizmoAxisCache Gizmo axis definition used for reactive gizmo UI
   */
  addToAxisCache(e) {
    e.size > 0 && e.forEach((t, r) => {
      this._gizmoAxisCache.set(r, t);
    });
  }
  /**
   * Disposes of the gizmo manager
   */
  dispose() {
    var e, t;
    this._pointerObservers.forEach((r) => {
      this._scene.onPointerObservable.remove(r);
    });
    for (const r in this.gizmos) {
      const n = this.gizmos[r];
      n && n.dispose();
    }
    this._defaultKeepDepthUtilityLayer !== Ds._DefaultKeepDepthUtilityLayer && ((e = this._defaultKeepDepthUtilityLayer) === null || e === void 0 || e.dispose()), this._defaultUtilityLayer !== Ds._DefaultUtilityLayer && ((t = this._defaultUtilityLayer) === null || t === void 0 || t.dispose()), this.boundingBoxDragBehavior.detach(), this.onAttachedToMeshObservable.clear();
  }
}
class xD extends ci {
  constructor() {
    super(...arguments), this._needProjectionMatrixCompute = !0;
  }
  _setPosition(e) {
    this._position = e;
  }
  /**
   * Sets the position the shadow will be casted from. Also use as the light position for both
   * point and spot lights.
   */
  get position() {
    return this._position;
  }
  /**
   * Sets the position the shadow will be casted from. Also use as the light position for both
   * point and spot lights.
   */
  set position(e) {
    this._setPosition(e);
  }
  _setDirection(e) {
    this._direction = e;
  }
  /**
   * In 2d mode (needCube being false), gets the direction used to cast the shadow.
   * Also use as the light direction on spot and directional lights.
   */
  get direction() {
    return this._direction;
  }
  /**
   * In 2d mode (needCube being false), sets the direction used to cast the shadow.
   * Also use as the light direction on spot and directional lights.
   */
  set direction(e) {
    this._setDirection(e);
  }
  /**
   * Gets the shadow projection clipping minimum z value.
   */
  get shadowMinZ() {
    return this._shadowMinZ;
  }
  /**
   * Sets the shadow projection clipping minimum z value.
   */
  set shadowMinZ(e) {
    this._shadowMinZ = e, this.forceProjectionMatrixCompute();
  }
  /**
   * Sets the shadow projection clipping maximum z value.
   */
  get shadowMaxZ() {
    return this._shadowMaxZ;
  }
  /**
   * Gets the shadow projection clipping maximum z value.
   */
  set shadowMaxZ(e) {
    this._shadowMaxZ = e, this.forceProjectionMatrixCompute();
  }
  /**
   * Computes the transformed information (transformedPosition and transformedDirection in World space) of the current light
   * @returns true if the information has been computed, false if it does not need to (no parenting)
   */
  computeTransformedInformation() {
    return this.parent && this.parent.getWorldMatrix ? (this.transformedPosition || (this.transformedPosition = S.Zero()), S.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition), this.direction && (this.transformedDirection || (this.transformedDirection = S.Zero()), S.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection)), !0) : !1;
  }
  /**
   * Return the depth scale used for the shadow map.
   * @returns the depth scale.
   */
  getDepthScale() {
    return 50;
  }
  /**
   * Get the direction to use to render the shadow map. In case of cube texture, the face index can be passed.
   * @param faceIndex The index of the face we are computed the direction to generate shadow
   * @returns The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getShadowDirection(e) {
    return this.transformedDirection ? this.transformedDirection : this.direction;
  }
  /**
   * Returns the ShadowLight absolute position in the World.
   * @returns the position vector in world space
   */
  getAbsolutePosition() {
    return this.transformedPosition ? this.transformedPosition : this.position;
  }
  /**
   * Sets the ShadowLight direction toward the passed target.
   * @param target The point to target in local space
   * @returns the updated ShadowLight direction
   */
  setDirectionToTarget(e) {
    return this.direction = S.Normalize(e.subtract(this.position)), this.direction;
  }
  /**
   * Returns the light rotation in euler definition.
   * @returns the x y z rotation in local space.
   */
  getRotation() {
    this.direction.normalize();
    const e = S.Cross(this.direction, bf.Y), t = S.Cross(e, this.direction);
    return S.RotationFromAxis(e, t, this.direction);
  }
  /**
   * Returns whether or not the shadow generation require a cube texture or a 2d texture.
   * @returns true if a cube texture needs to be use
   */
  needCube() {
    return !1;
  }
  /**
   * Detects if the projection matrix requires to be recomputed this frame.
   * @returns true if it requires to be recomputed otherwise, false.
   */
  needProjectionMatrixCompute() {
    return this._needProjectionMatrixCompute;
  }
  /**
   * Forces the shadow generator to recompute the projection matrix even if position and direction did not changed.
   */
  forceProjectionMatrixCompute() {
    this._needProjectionMatrixCompute = !0;
  }
  /** @internal */
  _initCache() {
    super._initCache(), this._cache.position = S.Zero();
  }
  /** @internal */
  _isSynchronized() {
    return !!this._cache.position.equals(this.position);
  }
  /**
   * Computes the world matrix of the node
   * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch
   * @returns the world matrix
   */
  computeWorldMatrix(e) {
    return !e && this.isSynchronized() ? (this._currentRenderId = this.getScene().getRenderId(), this._worldMatrix) : (this._updateCache(), this._cache.position.copyFrom(this.position), this._worldMatrix || (this._worldMatrix = he.Identity()), he.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix), this.parent && this.parent.getWorldMatrix && (this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix), this._markSyncedWithParent()), this._worldMatrixDeterminantIsDirty = !0, this._worldMatrix);
  }
  /**
   * Gets the minZ used for shadow according to both the scene and the light.
   * @param activeCamera The camera we are returning the min for
   * @returns the depth min z
   */
  getDepthMinZ(e) {
    return this.shadowMinZ !== void 0 ? this.shadowMinZ : e.minZ;
  }
  /**
   * Gets the maxZ used for shadow according to both the scene and the light.
   * @param activeCamera The camera we are returning the max for
   * @returns the depth max z
   */
  getDepthMaxZ(e) {
    return this.shadowMaxZ !== void 0 ? this.shadowMaxZ : e.maxZ;
  }
  /**
   * Sets the shadow projection matrix in parameter to the generated projection matrix.
   * @param matrix The matrix to updated with the projection information
   * @param viewMatrix The transform matrix of the light
   * @param renderList The list of mesh to render in the map
   * @returns The current light
   */
  setShadowProjectionMatrix(e, t, r) {
    return this.customProjectionMatrixBuilder ? this.customProjectionMatrixBuilder(t, r, e) : this._setDefaultShadowProjectionMatrix(e, t, r), this;
  }
  /** @internal */
  _syncParentEnabledState() {
    super._syncParentEnabledState(), (!this.parent || !this.parent.getWorldMatrix) && (this.transformedPosition = null, this.transformedDirection = null);
  }
}
C([
  fo()
], xD.prototype, "position", null);
C([
  fo()
], xD.prototype, "direction", null);
C([
  M()
], xD.prototype, "shadowMinZ", null);
C([
  M()
], xD.prototype, "shadowMaxZ", null);
Cs.AddNodeConstructor("Light_Type_1", (A, e) => () => new IA(A, S.Zero(), e));
class IA extends xD {
  /**
   * Fix frustum size for the shadow generation. This is disabled if the value is 0.
   */
  get shadowFrustumSize() {
    return this._shadowFrustumSize;
  }
  /**
   * Specifies a fix frustum size for the shadow generation.
   */
  set shadowFrustumSize(e) {
    this._shadowFrustumSize = e, this.forceProjectionMatrixCompute();
  }
  /**
   * Gets the shadow projection scale against the optimal computed one.
   * 0.1 by default which means that the projection window is increase by 10% from the optimal size.
   * This does not impact in fixed frustum size (shadowFrustumSize being set)
   */
  get shadowOrthoScale() {
    return this._shadowOrthoScale;
  }
  /**
   * Sets the shadow projection scale against the optimal computed one.
   * 0.1 by default which means that the projection window is increase by 10% from the optimal size.
   * This does not impact in fixed frustum size (shadowFrustumSize being set)
   */
  set shadowOrthoScale(e) {
    this._shadowOrthoScale = e, this.forceProjectionMatrixCompute();
  }
  /**
   * Gets or sets the orthoLeft property used to build the light frustum
   */
  get orthoLeft() {
    return this._orthoLeft;
  }
  set orthoLeft(e) {
    this._orthoLeft = e;
  }
  /**
   * Gets or sets the orthoRight property used to build the light frustum
   */
  get orthoRight() {
    return this._orthoRight;
  }
  set orthoRight(e) {
    this._orthoRight = e;
  }
  /**
   * Gets or sets the orthoTop property used to build the light frustum
   */
  get orthoTop() {
    return this._orthoTop;
  }
  set orthoTop(e) {
    this._orthoTop = e;
  }
  /**
   * Gets or sets the orthoBottom property used to build the light frustum
   */
  get orthoBottom() {
    return this._orthoBottom;
  }
  set orthoBottom(e) {
    this._orthoBottom = e;
  }
  /**
   * Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3).
   * The directional light is emitted from everywhere in the given direction.
   * It can cast shadows.
   * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
   * @param name The friendly name of the light
   * @param direction The direction of the light
   * @param scene The scene the light belongs to
   */
  constructor(e, t, r) {
    super(e, r), this._shadowFrustumSize = 0, this._shadowOrthoScale = 0.1, this.autoUpdateExtends = !0, this.autoCalcShadowZBounds = !1, this._orthoLeft = Number.MAX_VALUE, this._orthoRight = Number.MIN_VALUE, this._orthoTop = Number.MIN_VALUE, this._orthoBottom = Number.MAX_VALUE, this.position = t.scale(-1), this.direction = t;
  }
  /**
   * Returns the string "DirectionalLight".
   * @returns The class name
   */
  getClassName() {
    return "DirectionalLight";
  }
  /**
   * Returns the integer 1.
   * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
   */
  getTypeID() {
    return ci.LIGHTTYPEID_DIRECTIONALLIGHT;
  }
  /**
   * Sets the passed matrix "matrix" as projection matrix for the shadows cast by the light according to the passed view matrix.
   * Returns the DirectionalLight Shadow projection matrix.
   * @param matrix
   * @param viewMatrix
   * @param renderList
   */
  _setDefaultShadowProjectionMatrix(e, t, r) {
    this.shadowFrustumSize > 0 ? this._setDefaultFixedFrustumShadowProjectionMatrix(e) : this._setDefaultAutoExtendShadowProjectionMatrix(e, t, r);
  }
  /**
   * Sets the passed matrix "matrix" as fixed frustum projection matrix for the shadows cast by the light according to the passed view matrix.
   * Returns the DirectionalLight Shadow projection matrix.
   * @param matrix
   */
  _setDefaultFixedFrustumShadowProjectionMatrix(e) {
    const t = this.getScene().activeCamera;
    t && he.OrthoLHToRef(this.shadowFrustumSize, this.shadowFrustumSize, this.shadowMinZ !== void 0 ? this.shadowMinZ : t.minZ, this.shadowMaxZ !== void 0 ? this.shadowMaxZ : t.maxZ, e, this.getScene().getEngine().isNDCHalfZRange);
  }
  /**
   * Sets the passed matrix "matrix" as auto extend projection matrix for the shadows cast by the light according to the passed view matrix.
   * Returns the DirectionalLight Shadow projection matrix.
   * @param matrix
   * @param viewMatrix
   * @param renderList
   */
  _setDefaultAutoExtendShadowProjectionMatrix(e, t, r) {
    const n = this.getScene().activeCamera;
    if (!n)
      return;
    if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) {
      const d = S.Zero();
      this._orthoLeft = Number.MAX_VALUE, this._orthoRight = -Number.MAX_VALUE, this._orthoTop = -Number.MAX_VALUE, this._orthoBottom = Number.MAX_VALUE;
      let v = Number.MAX_VALUE, u = -Number.MAX_VALUE;
      for (let l = 0; l < r.length; l++) {
        const P = r[l];
        if (!P)
          continue;
        const c = P.getBoundingInfo().boundingBox;
        for (let H = 0; H < c.vectorsWorld.length; H++)
          S.TransformCoordinatesToRef(c.vectorsWorld[H], t, d), d.x < this._orthoLeft && (this._orthoLeft = d.x), d.y < this._orthoBottom && (this._orthoBottom = d.y), d.x > this._orthoRight && (this._orthoRight = d.x), d.y > this._orthoTop && (this._orthoTop = d.y), this.autoCalcShadowZBounds && (d.z < v && (v = d.z), d.z > u && (u = d.z));
      }
      this.autoCalcShadowZBounds && (this._shadowMinZ = v, this._shadowMaxZ = u);
    }
    const i = this._orthoRight - this._orthoLeft, s = this._orthoTop - this._orthoBottom, a = this.shadowMinZ !== void 0 ? this.shadowMinZ : n.minZ, f = this.shadowMaxZ !== void 0 ? this.shadowMaxZ : n.maxZ, o = this.getScene().getEngine().useReverseDepthBuffer;
    he.OrthoOffCenterLHToRef(this._orthoLeft - i * this.shadowOrthoScale, this._orthoRight + i * this.shadowOrthoScale, this._orthoBottom - s * this.shadowOrthoScale, this._orthoTop + s * this.shadowOrthoScale, o ? f : a, o ? a : f, e, this.getScene().getEngine().isNDCHalfZRange);
  }
  _buildUniformLayout() {
    this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 4), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create();
  }
  /**
   * Sets the passed Effect object with the DirectionalLight transformed position (or position if not parented) and the passed name.
   * @param effect The effect to update
   * @param lightIndex The index of the light in the effect to update
   * @returns The directional light
   */
  transferToEffect(e, t) {
    return this.computeTransformedInformation() ? (this._uniformBuffer.updateFloat4("vLightData", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, t), this) : (this._uniformBuffer.updateFloat4("vLightData", this.direction.x, this.direction.y, this.direction.z, 1, t), this);
  }
  transferToNodeMaterialEffect(e, t) {
    return this.computeTransformedInformation() ? (e.setFloat3(t, this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z), this) : (e.setFloat3(t, this.direction.x, this.direction.y, this.direction.z), this);
  }
  /**
   * Gets the minZ used for shadow according to both the scene and the light.
   *
   * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
   * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
   * (when not using reverse depth buffer / NDC half Z range)
   * @param activeCamera The camera we are returning the min for
   * @returns the depth min z
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getDepthMinZ(e) {
    const t = this._scene.getEngine();
    return !t.useReverseDepthBuffer && t.isNDCHalfZRange ? 0 : 1;
  }
  /**
   * Gets the maxZ used for shadow according to both the scene and the light.
   *
   * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
   * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
   * (when not using reverse depth buffer / NDC half Z range)
   * @param activeCamera The camera we are returning the max for
   * @returns the depth max z
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getDepthMaxZ(e) {
    const t = this._scene.getEngine();
    return t.useReverseDepthBuffer && t.isNDCHalfZRange ? 0 : 1;
  }
  /**
   * Prepares the list of defines specific to the light type.
   * @param defines the list of defines
   * @param lightIndex defines the index of the light for the effect
   */
  prepareLightSpecificDefines(e, t) {
    e["DIRLIGHT" + t] = !0;
  }
}
C([
  M()
], IA.prototype, "shadowFrustumSize", null);
C([
  M()
], IA.prototype, "shadowOrthoScale", null);
C([
  M()
], IA.prototype, "autoUpdateExtends", void 0);
C([
  M()
], IA.prototype, "autoCalcShadowZBounds", void 0);
C([
  M("orthoLeft")
], IA.prototype, "_orthoLeft", void 0);
C([
  M("orthoRight")
], IA.prototype, "_orthoRight", void 0);
C([
  M("orthoTop")
], IA.prototype, "_orthoTop", void 0);
C([
  M("orthoBottom")
], IA.prototype, "_orthoBottom", void 0);
function zI(A, e = {}, t) {
  e.diameter || (e.diameter = 1), e.segments || (e.segments = 16);
  const r = UA("", { slice: 0.5, diameter: e.diameter, segments: e.segments }, t), n = uU("", { radius: e.diameter / 2, tessellation: e.segments * 3 + (4 - e.segments) }, t);
  n.rotation.x = -Math.PI / 2, n.parent = r;
  const i = Ee.MergeMeshes([n, r], !0);
  return i.name = A, i;
}
const zle = {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  CreateHemisphere: zI
};
Ee.CreateHemisphere = (A, e, t, r) => zI(A, {
  segments: e,
  diameter: t
}, r);
Cs.AddNodeConstructor("Light_Type_2", (A, e) => () => new nA(A, S.Zero(), S.Zero(), 0, 0, e));
class nA extends xD {
  /**
   * Gets the cone angle of the spot light in Radians.
   */
  get angle() {
    return this._angle;
  }
  /**
   * Sets the cone angle of the spot light in Radians.
   */
  set angle(e) {
    this._angle = e, this._cosHalfAngle = Math.cos(e * 0.5), this._projectionTextureProjectionLightDirty = !0, this.forceProjectionMatrixCompute(), this._computeAngleValues();
  }
  /**
   * Only used in gltf falloff mode, this defines the angle where
   * the directional falloff will start before cutting at angle which could be seen
   * as outer angle.
   */
  get innerAngle() {
    return this._innerAngle;
  }
  /**
   * Only used in gltf falloff mode, this defines the angle where
   * the directional falloff will start before cutting at angle which could be seen
   * as outer angle.
   */
  set innerAngle(e) {
    this._innerAngle = e, this._computeAngleValues();
  }
  /**
   * Allows scaling the angle of the light for shadow generation only.
   */
  get shadowAngleScale() {
    return this._shadowAngleScale;
  }
  /**
   * Allows scaling the angle of the light for shadow generation only.
   */
  set shadowAngleScale(e) {
    this._shadowAngleScale = e, this.forceProjectionMatrixCompute();
  }
  /**
   * Allows reading the projection texture
   */
  get projectionTextureMatrix() {
    return this._projectionTextureMatrix;
  }
  /**
   * Gets the near clip of the Spotlight for texture projection.
   */
  get projectionTextureLightNear() {
    return this._projectionTextureLightNear;
  }
  /**
   * Sets the near clip of the Spotlight for texture projection.
   */
  set projectionTextureLightNear(e) {
    this._projectionTextureLightNear = e, this._projectionTextureProjectionLightDirty = !0;
  }
  /**
   * Gets the far clip of the Spotlight for texture projection.
   */
  get projectionTextureLightFar() {
    return this._projectionTextureLightFar;
  }
  /**
   * Sets the far clip of the Spotlight for texture projection.
   */
  set projectionTextureLightFar(e) {
    this._projectionTextureLightFar = e, this._projectionTextureProjectionLightDirty = !0;
  }
  /**
   * Gets the Up vector of the Spotlight for texture projection.
   */
  get projectionTextureUpDirection() {
    return this._projectionTextureUpDirection;
  }
  /**
   * Sets the Up vector of the Spotlight for texture projection.
   */
  set projectionTextureUpDirection(e) {
    this._projectionTextureUpDirection = e, this._projectionTextureProjectionLightDirty = !0;
  }
  /**
   * Gets the projection texture of the light.
   */
  get projectionTexture() {
    return this._projectionTexture;
  }
  /**
   * Sets the projection texture of the light.
   */
  set projectionTexture(e) {
    this._projectionTexture !== e && (this._projectionTexture = e, this._projectionTextureDirty = !0, this._projectionTexture && !this._projectionTexture.isReady() && (nA._IsProceduralTexture(this._projectionTexture) ? this._projectionTexture.getEffect().executeWhenCompiled(() => {
      this._markMeshesAsLightDirty();
    }) : nA._IsTexture(this._projectionTexture) && this._projectionTexture.onLoadObservable.addOnce(() => {
      this._markMeshesAsLightDirty();
    })));
  }
  static _IsProceduralTexture(e) {
    return e.onGeneratedObservable !== void 0;
  }
  static _IsTexture(e) {
    return e.onLoadObservable !== void 0;
  }
  /**
   * Gets or sets the light projection matrix as used by the projection texture
   */
  get projectionTextureProjectionLightMatrix() {
    return this._projectionTextureProjectionLightMatrix;
  }
  set projectionTextureProjectionLightMatrix(e) {
    this._projectionTextureProjectionLightMatrix = e, this._projectionTextureProjectionLightDirty = !1, this._projectionTextureDirty = !0;
  }
  /**
   * Creates a SpotLight object in the scene. A spot light is a simply light oriented cone.
   * It can cast shadows.
   * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
   * @param name The light friendly name
   * @param position The position of the spot light in the scene
   * @param direction The direction of the light in the scene
   * @param angle The cone angle of the light in Radians
   * @param exponent The light decay speed with the distance from the emission spot
   * @param scene The scene the lights belongs to
   */
  constructor(e, t, r, n, i, s) {
    super(e, s), this._innerAngle = 0, this._projectionTextureMatrix = he.Zero(), this._projectionTextureLightNear = 1e-6, this._projectionTextureLightFar = 1e3, this._projectionTextureUpDirection = S.Up(), this._projectionTextureViewLightDirty = !0, this._projectionTextureProjectionLightDirty = !0, this._projectionTextureDirty = !0, this._projectionTextureViewTargetVector = S.Zero(), this._projectionTextureViewLightMatrix = he.Zero(), this._projectionTextureProjectionLightMatrix = he.Zero(), this._projectionTextureScalingMatrix = he.FromValues(0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0.5, 0, 0.5, 0.5, 0.5, 1), this.position = t, this.direction = r, this.angle = n, this.exponent = i;
  }
  /**
   * Returns the string "SpotLight".
   * @returns the class name
   */
  getClassName() {
    return "SpotLight";
  }
  /**
   * Returns the integer 2.
   * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
   */
  getTypeID() {
    return ci.LIGHTTYPEID_SPOTLIGHT;
  }
  /**
   * Overrides the direction setter to recompute the projection texture view light Matrix.
   * @param value
   */
  _setDirection(e) {
    super._setDirection(e), this._projectionTextureViewLightDirty = !0;
  }
  /**
   * Overrides the position setter to recompute the projection texture view light Matrix.
   * @param value
   */
  _setPosition(e) {
    super._setPosition(e), this._projectionTextureViewLightDirty = !0;
  }
  /**
   * Sets the passed matrix "matrix" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0.
   * Returns the SpotLight.
   * @param matrix
   * @param viewMatrix
   * @param renderList
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _setDefaultShadowProjectionMatrix(e, t, r) {
    const n = this.getScene().activeCamera;
    if (!n)
      return;
    this._shadowAngleScale = this._shadowAngleScale || 1;
    const i = this._shadowAngleScale * this._angle, s = this.shadowMinZ !== void 0 ? this.shadowMinZ : n.minZ, a = this.shadowMaxZ !== void 0 ? this.shadowMaxZ : n.maxZ, f = this.getScene().getEngine().useReverseDepthBuffer;
    he.PerspectiveFovLHToRef(i, 1, f ? a : s, f ? s : a, e, !0, this._scene.getEngine().isNDCHalfZRange, void 0, f);
  }
  _computeProjectionTextureViewLightMatrix() {
    this._projectionTextureViewLightDirty = !1, this._projectionTextureDirty = !0, this.getAbsolutePosition().addToRef(this.direction, this._projectionTextureViewTargetVector), he.LookAtLHToRef(this.getAbsolutePosition(), this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix);
  }
  _computeProjectionTextureProjectionLightMatrix() {
    this._projectionTextureProjectionLightDirty = !1, this._projectionTextureDirty = !0;
    const e = this.projectionTextureLightFar, t = this.projectionTextureLightNear, r = e / (e - t), n = -r * t, i = 1 / Math.tan(this._angle / 2), s = 1;
    he.FromValuesToRef(i / s, 0, 0, 0, 0, i, 0, 0, 0, 0, r, 1, 0, 0, n, 0, this._projectionTextureProjectionLightMatrix);
  }
  /**
   * Main function for light texture projection matrix computing.
   */
  _computeProjectionTextureMatrix() {
    if (this._projectionTextureDirty = !1, this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix), this._projectionTexture instanceof We) {
      const e = this._projectionTexture.uScale / 2, t = this._projectionTexture.vScale / 2;
      he.FromValuesToRef(e, 0, 0, 0, 0, t, 0, 0, 0, 0, 0.5, 0, 0.5, 0.5, 0.5, 1, this._projectionTextureScalingMatrix);
    }
    this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix);
  }
  _buildUniformLayout() {
    this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 4), this._uniformBuffer.addUniform("vLightDirection", 3), this._uniformBuffer.addUniform("vLightFalloff", 4), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create();
  }
  _computeAngleValues() {
    this._lightAngleScale = 1 / Math.max(1e-3, Math.cos(this._innerAngle * 0.5) - this._cosHalfAngle), this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale;
  }
  /**
   * Sets the passed Effect "effect" with the Light textures.
   * @param effect The effect to update
   * @param lightIndex The index of the light in the effect to update
   * @returns The light
   */
  transferTexturesToEffect(e, t) {
    return this.projectionTexture && this.projectionTexture.isReady() && (this._projectionTextureViewLightDirty && this._computeProjectionTextureViewLightMatrix(), this._projectionTextureProjectionLightDirty && this._computeProjectionTextureProjectionLightMatrix(), this._projectionTextureDirty && this._computeProjectionTextureMatrix(), e.setMatrix("textureProjectionMatrix" + t, this._projectionTextureMatrix), e.setTexture("projectionLightSampler" + t, this.projectionTexture)), this;
  }
  /**
   * Sets the passed Effect object with the SpotLight transformed position (or position if not parented) and normalized direction.
   * @param effect The effect to update
   * @param lightIndex The index of the light in the effect to update
   * @returns The spot light
   */
  transferToEffect(e, t) {
    let r;
    return this.computeTransformedInformation() ? (this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, t), r = S.Normalize(this.transformedDirection)) : (this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, this.exponent, t), r = S.Normalize(this.direction)), this._uniformBuffer.updateFloat4("vLightDirection", r.x, r.y, r.z, this._cosHalfAngle, t), this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, t), this;
  }
  transferToNodeMaterialEffect(e, t) {
    let r;
    return this.computeTransformedInformation() ? r = S.Normalize(this.transformedDirection) : r = S.Normalize(this.direction), this.getScene().useRightHandedSystem ? e.setFloat3(t, -r.x, -r.y, -r.z) : e.setFloat3(t, r.x, r.y, r.z), this;
  }
  /**
   * Disposes the light and the associated resources.
   */
  dispose() {
    super.dispose(), this._projectionTexture && this._projectionTexture.dispose();
  }
  /**
   * Gets the minZ used for shadow according to both the scene and the light.
   * @param activeCamera The camera we are returning the min for
   * @returns the depth min z
   */
  getDepthMinZ(e) {
    const t = this._scene.getEngine(), r = this.shadowMinZ !== void 0 ? this.shadowMinZ : e.minZ;
    return t.useReverseDepthBuffer && t.isNDCHalfZRange ? r : this._scene.getEngine().isNDCHalfZRange ? 0 : r;
  }
  /**
   * Gets the maxZ used for shadow according to both the scene and the light.
   * @param activeCamera The camera we are returning the max for
   * @returns the depth max z
   */
  getDepthMaxZ(e) {
    const t = this._scene.getEngine(), r = this.shadowMaxZ !== void 0 ? this.shadowMaxZ : e.maxZ;
    return t.useReverseDepthBuffer && t.isNDCHalfZRange ? 0 : r;
  }
  /**
   * Prepares the list of defines specific to the light type.
   * @param defines the list of defines
   * @param lightIndex defines the index of the light for the effect
   */
  prepareLightSpecificDefines(e, t) {
    e["SPOTLIGHT" + t] = !0, e["PROJECTEDLIGHTTEXTURE" + t] = !!(this.projectionTexture && this.projectionTexture.isReady());
  }
}
C([
  M()
], nA.prototype, "angle", null);
C([
  M()
], nA.prototype, "innerAngle", null);
C([
  M()
], nA.prototype, "shadowAngleScale", null);
C([
  M()
], nA.prototype, "exponent", void 0);
C([
  M()
], nA.prototype, "projectionTextureLightNear", null);
C([
  M()
], nA.prototype, "projectionTextureLightFar", null);
C([
  M()
], nA.prototype, "projectionTextureUpDirection", null);
C([
  en("projectedLightTexture")
], nA.prototype, "_projectionTexture", void 0);
class D0 extends Lo {
  /**
   * Creates a LightGizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
   */
  constructor(e = Ds.DefaultUtilityLayer) {
    super(e), this._cachedPosition = new S(), this._cachedForward = new S(0, 0, 1), this._pointerObserver = null, this.onClickedObservable = new Oe(), this._light = null, this.attachedMesh = new jn("", this.gizmoLayer.utilityLayerScene), this._attachedMeshParent = new Hr("parent", this.gizmoLayer.utilityLayerScene), this.attachedMesh.parent = this._attachedMeshParent, this._material = new Wt("light", this.gizmoLayer.utilityLayerScene), this._material.diffuseColor = new Ne(0.5, 0.5, 0.5), this._material.specularColor = new Ne(0.1, 0.1, 0.1), this._pointerObserver = e.utilityLayerScene.onPointerObservable.add((t) => {
      this._light && (this._isHovered = !!(t.pickInfo && this._rootMesh.getChildMeshes().indexOf(t.pickInfo.pickedMesh) != -1), this._isHovered && t.event.button === 0 && this.onClickedObservable.notifyObservers(this._light));
    }, ir.POINTERDOWN);
  }
  /**
   * Override attachedNode because lightgizmo only support attached mesh
   * It will return the attached mesh (if any) and setting an attached node will log
   * a warning
   */
  get attachedNode() {
    return this.attachedMesh;
  }
  set attachedNode(e) {
    console.warn("Nodes cannot be attached to LightGizmo. Attach to a mesh instead.");
  }
  /**
   * The light that the gizmo is attached to
   */
  set light(e) {
    if (this._light = e, e) {
      this._lightMesh && this._lightMesh.dispose(), e instanceof y0 ? this._lightMesh = D0._CreateHemisphericLightMesh(this.gizmoLayer.utilityLayerScene) : e instanceof IA ? this._lightMesh = D0._CreateDirectionalLightMesh(this.gizmoLayer.utilityLayerScene) : e instanceof nA ? this._lightMesh = D0._CreateSpotLightMesh(this.gizmoLayer.utilityLayerScene) : this._lightMesh = D0._CreatePointLightMesh(this.gizmoLayer.utilityLayerScene), this._lightMesh.getChildMeshes(!1).forEach((r) => {
        r.material = this._material;
      }), this._lightMesh.parent = this._rootMesh;
      const t = this.gizmoLayer._getSharedGizmoLight();
      if (t.includedOnlyMeshes = t.includedOnlyMeshes.concat(this._lightMesh.getChildMeshes(!1)), this._lightMesh.rotationQuaternion = new Ze(), this.attachedMesh.reservedDataStore || (this.attachedMesh.reservedDataStore = {}), this.attachedMesh.reservedDataStore.lightGizmo = this, e.parent && this._attachedMeshParent.freezeWorldMatrix(e.parent.getWorldMatrix()), e.position && (this.attachedMesh.position.copyFrom(e.position), this.attachedMesh.computeWorldMatrix(!0), this._cachedPosition.copyFrom(this.attachedMesh.position)), e.direction) {
        this.attachedMesh.setDirection(e.direction), this.attachedMesh.computeWorldMatrix(!0);
        const r = this._getMeshForward();
        this._cachedForward.copyFrom(r);
      }
      this._update();
    }
  }
  get light() {
    return this._light;
  }
  /**
   * Gets the material used to render the light gizmo
   */
  get material() {
    return this._material;
  }
  /**
   * @internal
   * returns mesh forward
   */
  _getMeshForward() {
    let e = this.attachedMesh.forward;
    return this.attachedMesh.getScene().useRightHandedSystem && (e.negateToRef(ue.Vector3[0]), e = ue.Vector3[0]), e;
  }
  /**
   * @internal
   * Updates the gizmo to match the attached mesh's position/rotation
   */
  _update() {
    if (super._update(), !!this._light) {
      if (this._light.parent && this._attachedMeshParent.freezeWorldMatrix(this._light.parent.getWorldMatrix()), this._light.position)
        if (this.attachedMesh.position.equals(this._cachedPosition))
          this.attachedMesh.position.copyFrom(this._light.position), this.attachedMesh.computeWorldMatrix(!0), this._cachedPosition.copyFrom(this.attachedMesh.position);
        else {
          const e = this.attachedMesh.position;
          this._light.position = new S(e.x, e.y, e.z), this._cachedPosition.copyFrom(this.attachedMesh.position);
        }
      if (this._light.direction) {
        const e = this._getMeshForward();
        if (S.DistanceSquared(e, this._cachedForward) > 1e-4) {
          const t = e;
          this._light.direction = new S(t.x, t.y, t.z), this._cachedForward.copyFrom(e);
        } else
          S.DistanceSquared(e, this._light.direction) > 1e-4 && (this.attachedMesh.setDirection(this._light.direction), this.attachedMesh.computeWorldMatrix(!0), this._cachedForward.copyFrom(e));
      }
    }
  }
  /**
   * Disposes of the light gizmo
   */
  dispose() {
    this.onClickedObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this._material.dispose(), super.dispose(), this._attachedMeshParent.dispose();
  }
  static _CreateHemisphericLightMesh(e) {
    const t = new Ee("hemisphereLight", e), r = zI(t.name, { segments: 10, diameter: 1 }, e);
    r.position.z = -0.15, r.rotation.x = Math.PI / 2, r.parent = t;
    const n = this._CreateLightLines(3, e);
    return n.parent = t, t.scaling.scaleInPlace(D0._Scale), t.rotation.x = Math.PI / 2, t;
  }
  static _CreatePointLightMesh(e) {
    const t = new Ee("pointLight", e), r = UA(t.name, { segments: 10, diameter: 1 }, e);
    r.rotation.x = Math.PI / 2, r.parent = t;
    const n = this._CreateLightLines(5, e);
    return n.parent = t, t.scaling.scaleInPlace(D0._Scale), t.rotation.x = Math.PI / 2, t;
  }
  static _CreateSpotLightMesh(e) {
    const t = new Ee("spotLight", e), r = UA(t.name, { segments: 10, diameter: 1 }, e);
    r.parent = t;
    const n = zI(t.name, { segments: 10, diameter: 2 }, e);
    n.parent = t, n.rotation.x = -Math.PI / 2;
    const i = this._CreateLightLines(2, e);
    return i.parent = t, t.scaling.scaleInPlace(D0._Scale), t.rotation.x = Math.PI / 2, t;
  }
  static _CreateDirectionalLightMesh(e) {
    const t = new Ee("directionalLight", e), r = new Ee(t.name, e);
    r.parent = t;
    const n = UA(t.name, { diameter: 1.2, segments: 10 }, e);
    n.parent = r;
    const i = Ld(t.name, {
      updatable: !1,
      height: 6,
      diameterTop: 0.3,
      diameterBottom: 0.3,
      tessellation: 6,
      subdivisions: 1
    }, e);
    i.parent = r;
    let s = i.clone(t.name);
    s.scaling.y = 0.5, s.position.x += 1.25;
    let a = i.clone(t.name);
    a.scaling.y = 0.5, a.position.x += -1.25;
    const f = Ld(t.name, {
      updatable: !1,
      height: 1,
      diameterTop: 0,
      diameterBottom: 0.6,
      tessellation: 6,
      subdivisions: 1
    }, e);
    return f.position.y += 3, f.parent = r, s = f.clone(t.name), s.position.y = 1.5, s.position.x += 1.25, a = f.clone(t.name), a.position.y = 1.5, a.position.x += -1.25, r.scaling.scaleInPlace(D0._Scale), r.rotation.z = Math.PI / 2, r.rotation.y = Math.PI / 2, t;
  }
}
D0._Scale = 7e-3;
D0._CreateLightLines = (A, e) => {
  const r = new Ee("root", e);
  r.rotation.x = Math.PI / 2;
  const n = new Ee("linePivot", e);
  n.parent = r;
  const i = Ld("line", {
    updatable: !1,
    height: 2,
    diameterTop: 0.2,
    diameterBottom: 0.3,
    tessellation: 6,
    subdivisions: 1
  }, e);
  if (i.position.y = i.scaling.y / 2 + 1.2, i.parent = n, A < 2)
    return n;
  for (let a = 0; a < 4; a++) {
    const f = n.clone("lineParentClone");
    f.rotation.z = Math.PI / 4, f.rotation.y = Math.PI / 2 + Math.PI / 2 * a, f.getChildMeshes()[0].scaling.y = 0.5, f.getChildMeshes()[0].scaling.x = f.getChildMeshes()[0].scaling.z = 0.8, f.getChildMeshes()[0].position.y = f.getChildMeshes()[0].scaling.y / 2 + 1.2;
  }
  if (A < 3)
    return r;
  for (let a = 0; a < 4; a++) {
    const f = n.clone("linePivotClone");
    f.rotation.z = Math.PI / 2, f.rotation.y = Math.PI / 2 * a;
  }
  if (A < 4)
    return r;
  for (let a = 0; a < 4; a++) {
    const f = n.clone("linePivotClone");
    f.rotation.z = Math.PI + Math.PI / 4, f.rotation.y = Math.PI / 2 + Math.PI / 2 * a, f.getChildMeshes()[0].scaling.y = 0.5, f.getChildMeshes()[0].scaling.x = f.getChildMeshes()[0].scaling.z = 0.8, f.getChildMeshes()[0].position.y = f.getChildMeshes()[0].scaling.y / 2 + 1.2;
  }
  if (A < 5)
    return r;
  const s = n.clone("linePivotClone");
  return s.rotation.z = Math.PI, r;
};
class rS extends Lo {
  /**
   * Creates a CameraGizmo
   * @param gizmoLayer The utility layer the gizmo will be added to
   */
  constructor(e = Ds.DefaultUtilityLayer, t) {
    super(e), this._pointerObserver = null, this.onClickedObservable = new Oe(), this._camera = null, this._invProjection = new he(), this._material = new Wt("cameraGizmoMaterial", this.gizmoLayer.utilityLayerScene), this._gizmoColor = t, this._material.diffuseColor = t ?? new Ne(0.5, 0.5, 0.5), this._material.specularColor = new Ne(0.1, 0.1, 0.1), this._pointerObserver = e.utilityLayerScene.onPointerObservable.add((r) => {
      this._camera && (this._isHovered = !!(r.pickInfo && this._rootMesh.getChildMeshes().indexOf(r.pickInfo.pickedMesh) != -1), this._isHovered && r.event.button === 0 && this.onClickedObservable.notifyObservers(this._camera));
    }, ir.POINTERDOWN);
  }
  /** Gets or sets a boolean indicating if frustum lines must be rendered (true by default)) */
  get displayFrustum() {
    return this._cameraLinesMesh.isEnabled();
  }
  set displayFrustum(e) {
    this._cameraLinesMesh.setEnabled(e);
  }
  /**
   * The camera that the gizmo is attached to
   */
  set camera(e) {
    var t, r;
    if (this._camera = e, this.attachedNode = e, e) {
      this._cameraMesh && this._cameraMesh.dispose(), this._cameraLinesMesh && this._cameraLinesMesh.dispose(), this._cameraMesh = rS._CreateCameraMesh(this.gizmoLayer.utilityLayerScene);
      const n = (r = (t = this._gizmoColor) === null || t === void 0 ? void 0 : t.toColor4(1)) !== null && r !== void 0 ? r : new xt(1, 1, 1, 1);
      this._cameraLinesMesh = rS._CreateCameraFrustum(this.gizmoLayer.utilityLayerScene, n), this._cameraMesh.getChildMeshes(!1).forEach((s) => {
        s.material = this._material;
      }), this._cameraMesh.parent = this._rootMesh, this._cameraLinesMesh.parent = this._rootMesh, this.gizmoLayer.utilityLayerScene.activeCamera && this.gizmoLayer.utilityLayerScene.activeCamera.maxZ < e.maxZ * 1.5 && (this.gizmoLayer.utilityLayerScene.activeCamera.maxZ = e.maxZ * 1.5), this.attachedNode.reservedDataStore || (this.attachedNode.reservedDataStore = {}), this.attachedNode.reservedDataStore.cameraGizmo = this;
      const i = this.gizmoLayer._getSharedGizmoLight();
      i.includedOnlyMeshes = i.includedOnlyMeshes.concat(this._cameraMesh.getChildMeshes(!1)), this._update();
    }
  }
  get camera() {
    return this._camera;
  }
  /**
   * Gets the material used to render the camera gizmo
   */
  get material() {
    return this._material;
  }
  /**
   * @internal
   * Updates the gizmo to match the attached mesh's position/rotation
   */
  _update() {
    super._update(), this._camera && (this._camera.getProjectionMatrix().invertToRef(this._invProjection), this._cameraLinesMesh.setPivotMatrix(this._invProjection, !1), this._cameraLinesMesh.scaling.x = 1 / this._rootMesh.scaling.x, this._cameraLinesMesh.scaling.y = 1 / this._rootMesh.scaling.y, this._cameraLinesMesh.scaling.z = 1 / this._rootMesh.scaling.z, this._cameraMesh.parent = null, this._cameraMesh.rotation.y = Math.PI * 0.5 * (this._camera.getScene().useRightHandedSystem ? 1 : -1), this._cameraMesh.parent = this._rootMesh);
  }
  /**
   * Disposes of the camera gizmo
   */
  dispose() {
    this.onClickedObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this._cameraMesh && this._cameraMesh.dispose(), this._cameraLinesMesh && this._cameraLinesMesh.dispose(), this._material.dispose(), super.dispose();
  }
  static _CreateCameraMesh(e) {
    const t = new Ee("rootCameraGizmo", e), r = new Ee(t.name, e);
    r.parent = t;
    const n = k0(t.name, { width: 1, height: 0.8, depth: 0.5 }, e);
    n.parent = r;
    const i = Ld(t.name, { height: 0.5, diameterTop: 0.8, diameterBottom: 0.8 }, e);
    i.parent = r, i.position.y = 0.3, i.position.x = -0.6, i.rotation.x = Math.PI * 0.5;
    const s = Ld(t.name, { height: 0.5, diameterTop: 0.6, diameterBottom: 0.6 }, e);
    s.parent = r, s.position.y = 0.5, s.position.x = 0.4, s.rotation.x = Math.PI * 0.5;
    const a = Ld(t.name, { height: 0.5, diameterTop: 0.5, diameterBottom: 0.5 }, e);
    return a.parent = r, a.position.y = 0, a.position.x = 0.6, a.rotation.z = Math.PI * 0.5, t.scaling.scaleInPlace(rS._Scale), r.position.x = -0.9, t;
  }
  static _CreateCameraFrustum(e, t) {
    const r = new Ee("rootCameraGizmo", e), n = new Ee(r.name, e);
    n.parent = r;
    for (let i = 0; i < 4; i += 2)
      for (let s = 0; s < 4; s += 2) {
        let a = ka("lines", { points: [new S(-1 + s, -1 + i, -1), new S(-1 + s, -1 + i, 1)], colors: [t, t] }, e);
        a.parent = n, a.alwaysSelectAsActiveMesh = !0, a.isPickable = !1, a = ka("lines", { points: [new S(-1, -1 + s, -1 + i), new S(1, -1 + s, -1 + i)], colors: [t, t] }, e), a.parent = n, a.alwaysSelectAsActiveMesh = !0, a.isPickable = !1, a = ka("lines", { points: [new S(-1 + s, -1, -1 + i), new S(-1 + s, 1, -1 + i)], colors: [t, t] }, e), a.parent = n, a.alwaysSelectAsActiveMesh = !0, a.isPickable = !1;
      }
    return r;
  }
}
rS._Scale = 0.05;
const Gle = "kernelBlurVaryingDeclaration", Zle = "varying vec2 sampleCoord{X};";
Le.IncludesShadersStore[Gle] = Zle;
const _le = "packingFunctions", $le = `vec4 pack(float depth)
{const vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}
float unpack(vec4 color)
{const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}`;
Le.IncludesShadersStore[_le] = $le;
const ePe = "kernelBlurFragment", tPe = `#ifdef DOF
factor=sampleCoC(sampleCoord{X}); 
computedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight;
#else
computedWeight=KERNEL_WEIGHT{X};
#endif
#ifdef PACKEDFLOAT
blend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;
#else
blend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;
#endif
`;
Le.IncludesShadersStore[ePe] = tPe;
const rPe = "kernelBlurFragment2", nPe = `#ifdef DOF
factor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight;
#else
computedWeight=KERNEL_DEP_WEIGHT{X};
#endif
#ifdef PACKEDFLOAT
blend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;
#else
blend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;
#endif
`;
Le.IncludesShadersStore[rPe] = nPe;
const iPe = "kernelBlurPixelShader", sPe = `uniform sampler2D textureSampler;uniform vec2 delta;varying vec2 sampleCenter;
#ifdef DOF
uniform sampler2D circleOfConfusionSampler;float sampleCoC(in vec2 offset) {float coc=texture2D(circleOfConfusionSampler,offset).r;return coc; }
#endif
#include<kernelBlurVaryingDeclaration>[0..varyingCount]
#ifdef PACKEDFLOAT
#include<packingFunctions>
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{float computedWeight=0.0;
#ifdef PACKEDFLOAT
float blend=0.;
#else
vec4 blend=vec4(0.);
#endif
#ifdef DOF
float sumOfWeights=CENTER_WEIGHT; 
float factor=0.0;
#ifdef PACKEDFLOAT
blend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;
#else
blend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;
#endif
#endif
#include<kernelBlurFragment>[0..varyingCount]
#include<kernelBlurFragment2>[0..depCount]
#ifdef PACKEDFLOAT
gl_FragColor=pack(blend);
#else
gl_FragColor=blend;
#endif
#ifdef DOF
gl_FragColor/=sumOfWeights;
#endif
}`;
Le.ShadersStore[iPe] = sPe;
const aPe = "kernelBlurVertex", oPe = "sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};";
Le.IncludesShadersStore[aPe] = oPe;
const fPe = "kernelBlurVertexShader", APe = `attribute vec2 position;uniform vec2 delta;varying vec2 sampleCenter;
#include<kernelBlurVaryingDeclaration>[0..varyingCount]
const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
sampleCenter=(position*madd+madd);
#include<kernelBlurVertex>[0..varyingCount]
gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[fPe] = APe;
class c9 extends kr {
  /**
   * Sets the length in pixels of the blur sample region
   */
  set kernel(e) {
    this._idealKernel !== e && (e = Math.max(e, 1), this._idealKernel = e, this._kernel = this._nearestBestKernel(e), this._blockCompilation || this._updateParameters());
  }
  /**
   * Gets the length in pixels of the blur sample region
   */
  get kernel() {
    return this._idealKernel;
  }
  /**
   * Sets whether or not the blur needs to unpack/repack floats
   */
  set packedFloat(e) {
    this._packedFloat !== e && (this._packedFloat = e, this._blockCompilation || this._updateParameters());
  }
  /**
   * Gets whether or not the blur is unpacking/repacking floats
   */
  get packedFloat() {
    return this._packedFloat;
  }
  /**
   * Gets a string identifying the name of the class
   * @returns "BlurPostProcess" string
   */
  getClassName() {
    return "BlurPostProcess";
  }
  /**
   * Creates a new instance BlurPostProcess
   * @param name The name of the effect.
   * @param direction The direction in which to blur the image.
   * @param kernel The size of the kernel to be used when computing the blur. eg. Size of 3 will blur the center pixel by 2 pixels surrounding it.
   * @param options The required width/height ratio to downsize to before computing the render pass. (Use 1.0 for full size)
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param defines
   * @param _blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)
   */
  constructor(e, t, r, n, i, s = We.BILINEAR_SAMPLINGMODE, a, f, o = 0, d = "", v = !1, u = 5) {
    super(e, "kernelBlur", ["delta", "direction"], ["circleOfConfusionSampler"], n, i, s, a, f, null, o, "kernelBlur", { varyingCount: 0, depCount: 0 }, !0, u), this._blockCompilation = v, this._packedFloat = !1, this._staticDefines = "", this._staticDefines = d, this.direction = t, this.onApplyObservable.add((l) => {
      this._outputTexture ? l.setFloat2("delta", 1 / this._outputTexture.width * this.direction.x, 1 / this._outputTexture.height * this.direction.y) : l.setFloat2("delta", 1 / this.width * this.direction.x, 1 / this.height * this.direction.y);
    }), this.kernel = r;
  }
  /**
   * Updates the effect with the current post process compile time values and recompiles the shader.
   * @param defines Define statements that should be added at the beginning of the shader. (default: null)
   * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)
   * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)
   * @param indexParameters The index parameters to be used for babylons include syntax "#include<kernelBlurVaryingDeclaration>[0..varyingCount]". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx
   * @param onCompiled Called when the shader has been compiled.
   * @param onError Called if there is an error when compiling a shader.
   */
  updateEffect(e = null, t = null, r = null, n, i, s) {
    this._updateParameters(i, s);
  }
  _updateParameters(e, t) {
    const r = this._kernel, n = (r - 1) / 2;
    let i = [], s = [], a = 0;
    for (let c = 0; c < r; c++) {
      const H = c / (r - 1), T = this._gaussianWeight(H * 2 - 1);
      i[c] = c - n, s[c] = T, a += T;
    }
    for (let c = 0; c < s.length; c++)
      s[c] /= a;
    const f = [], o = [], d = [];
    for (let c = 0; c <= n; c += 2) {
      const H = Math.min(c + 1, Math.floor(n));
      if (c === H)
        d.push({ o: i[c], w: s[c] });
      else {
        const q = H === n, b = s[c] + s[H] * (q ? 0.5 : 1), j = i[c] + 1 / (1 + s[c] / s[H]);
        j === 0 ? (d.push({ o: i[c], w: s[c] }), d.push({ o: i[c + 1], w: s[c + 1] })) : (d.push({ o: j, w: b }), d.push({ o: -j, w: b }));
      }
    }
    for (let c = 0; c < d.length; c++)
      o[c] = d[c].o, f[c] = d[c].w;
    i = o, s = f;
    const v = this.getEngine().getCaps().maxVaryingVectors, u = Math.max(v, 0) - 1;
    let l = Math.min(i.length, u), P = "";
    P += this._staticDefines, this._staticDefines.indexOf("DOF") != -1 && (P += `#define CENTER_WEIGHT ${this._glslFloat(s[l - 1])}
`, l--);
    for (let c = 0; c < l; c++)
      P += `#define KERNEL_OFFSET${c} ${this._glslFloat(i[c])}
`, P += `#define KERNEL_WEIGHT${c} ${this._glslFloat(s[c])}
`;
    let p = 0;
    for (let c = u; c < i.length; c++)
      P += `#define KERNEL_DEP_OFFSET${p} ${this._glslFloat(i[c])}
`, P += `#define KERNEL_DEP_WEIGHT${p} ${this._glslFloat(s[c])}
`, p++;
    this.packedFloat && (P += "#define PACKEDFLOAT 1"), this._blockCompilation = !1, super.updateEffect(P, null, null, {
      varyingCount: l,
      depCount: p
    }, e, t);
  }
  /**
   * Best kernels are odd numbers that when divided by 2, their integer part is even, so 5, 9 or 13.
   * Other odd kernels optimize correctly but require proportionally more samples, even kernels are
   * possible but will produce minor visual artifacts. Since each new kernel requires a new shader we
   * want to minimize kernel changes, having gaps between physical kernels is helpful in that regard.
   * The gaps between physical kernels are compensated for in the weighting of the samples
   * @param idealKernel Ideal blur kernel.
   * @returns Nearest best kernel.
   */
  _nearestBestKernel(e) {
    const t = Math.round(e);
    for (const r of [t, t - 1, t + 1, t - 2, t + 2])
      if (r % 2 !== 0 && Math.floor(r / 2) % 2 === 0 && r > 0)
        return Math.max(r, 3);
    return Math.max(t, 3);
  }
  /**
   * Calculates the value of a Gaussian distribution with sigma 3 at a given point.
   * @param x The point on the Gaussian distribution to sample.
   * @returns the value of the Gaussian function at x.
   */
  _gaussianWeight(e) {
    const t = 0.3333333333333333, r = Math.sqrt(2 * Math.PI) * t, n = -(e * e / (2 * t * t));
    return 1 / r * Math.exp(n);
  }
  /**
   * Generates a string that can be used as a floating point number in GLSL.
   * @param x Value to print.
   * @param decimalFigures Number of decimal places to print the number to (excluding trailing 0s).
   * @returns GLSL float string.
   */
  _glslFloat(e, t = 8) {
    return e.toFixed(t).replace(/0+$/, "");
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new c9(e.name, e.direction, e.kernel, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable, e.textureType, void 0, !1), e, r, n);
  }
}
C([
  M("kernel")
], c9.prototype, "_kernel", void 0);
C([
  M("packedFloat")
], c9.prototype, "_packedFloat", void 0);
C([
  HR()
], c9.prototype, "direction", void 0);
Ue("BABYLON.BlurPostProcess", c9);
class uD extends Ta {
  /**
   * Define the blur ratio used to blur the reflection if needed.
   */
  set blurRatio(e) {
    this._blurRatio !== e && (this._blurRatio = e, this._preparePostProcesses());
  }
  get blurRatio() {
    return this._blurRatio;
  }
  /**
   * Define the adaptive blur kernel used to blur the reflection if needed.
   * This will autocompute the closest best match for the `blurKernel`
   */
  set adaptiveBlurKernel(e) {
    this._adaptiveBlurKernel = e, this._autoComputeBlurKernel();
  }
  /**
   * Define the blur kernel used to blur the reflection if needed.
   * Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
   */
  set blurKernel(e) {
    this.blurKernelX = e, this.blurKernelY = e;
  }
  /**
   * Define the blur kernel on the X Axis used to blur the reflection if needed.
   * Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
   */
  set blurKernelX(e) {
    this._blurKernelX !== e && (this._blurKernelX = e, this._preparePostProcesses());
  }
  get blurKernelX() {
    return this._blurKernelX;
  }
  /**
   * Define the blur kernel on the Y Axis used to blur the reflection if needed.
   * Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
   */
  set blurKernelY(e) {
    this._blurKernelY !== e && (this._blurKernelY = e, this._preparePostProcesses());
  }
  get blurKernelY() {
    return this._blurKernelY;
  }
  _autoComputeBlurKernel() {
    const e = this.getScene().getEngine(), t = this.getRenderWidth() / e.getRenderWidth(), r = this.getRenderHeight() / e.getRenderHeight();
    this.blurKernelX = this._adaptiveBlurKernel * t, this.blurKernelY = this._adaptiveBlurKernel * r;
  }
  _onRatioRescale() {
    this._sizeRatio && (this.resize(this._initialSizeParameter), this._adaptiveBlurKernel || this._preparePostProcesses()), this._adaptiveBlurKernel && this._autoComputeBlurKernel();
  }
  _updateGammaSpace() {
    const e = this.getScene();
    e && (this.gammaSpace = !e.imageProcessingConfiguration.isEnabled || !e.imageProcessingConfiguration.applyByPostProcess);
  }
  /**
   * Instantiates a Mirror Texture.
   * Mirror texture can be used to simulate the view from a mirror in a scene.
   * It will dynamically be rendered every frame to adapt to the camera point of view.
   * You can then easily use it as a reflectionTexture on a flat surface.
   * In case the surface is not a plane, please consider relying on reflection probes.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#mirrors
   * @param name
   * @param size
   * @param scene
   * @param generateMipMaps
   * @param type
   * @param samplingMode
   * @param generateDepthBuffer
   */
  constructor(e, t, r, n, i = 0, s = We.BILINEAR_SAMPLINGMODE, a = !0) {
    if (super(e, t, r, n, !0, i, !1, s, a), this.mirrorPlane = new BA(0, 1, 0, 1), this._transformMatrix = he.Zero(), this._mirrorMatrix = he.Zero(), this._adaptiveBlurKernel = 0, this._blurKernelX = 0, this._blurKernelY = 0, this._blurRatio = 1, r = this.getScene(), !r)
      return this;
    this.ignoreCameraViewport = !0, this._updateGammaSpace(), this._imageProcessingConfigChangeObserver = r.imageProcessingConfiguration.onUpdateParameters.add(() => {
      this._updateGammaSpace();
    });
    const f = r.getEngine();
    f.supportsUniformBuffers && (this._sceneUBO = r.createSceneUniformBuffer(`Scene for Mirror Texture (name "${e}")`)), this.onBeforeBindObservable.add(() => {
      var d;
      (d = f._debugPushGroup) === null || d === void 0 || d.call(f, `mirror generation for ${e}`, 1);
    }), this.onAfterUnbindObservable.add(() => {
      var d;
      (d = f._debugPopGroup) === null || d === void 0 || d.call(f, 1);
    });
    let o;
    this.onBeforeRenderObservable.add(() => {
      this._sceneUBO && (this._currentSceneUBO = r.getSceneUniformBuffer(), r.setSceneUniformBuffer(this._sceneUBO), r.getSceneUniformBuffer().unbindEffect()), he.ReflectionToRef(this.mirrorPlane, this._mirrorMatrix), this._mirrorMatrix.multiplyToRef(r.getViewMatrix(), this._transformMatrix), r.setTransformMatrix(this._transformMatrix, r.getProjectionMatrix()), o = r.clipPlane, r.clipPlane = this.mirrorPlane, r._mirroredCameraPosition = S.TransformCoordinates(r.activeCamera.globalPosition, this._mirrorMatrix);
    }), this.onAfterRenderObservable.add(() => {
      this._sceneUBO && r.setSceneUniformBuffer(this._currentSceneUBO), r.updateTransformMatrix(), r._mirroredCameraPosition = null, r.clipPlane = o;
    });
  }
  _preparePostProcesses() {
    if (this.clearPostProcesses(!0), this._blurKernelX && this._blurKernelY) {
      const e = this.getScene().getEngine(), t = e.getCaps().textureFloatRender && e.getCaps().textureFloatLinearFiltering ? 1 : 2;
      this._blurX = new c9("horizontal blur", new at(1, 0), this._blurKernelX, this._blurRatio, null, We.BILINEAR_SAMPLINGMODE, e, !1, t), this._blurX.autoClear = !1, this._blurRatio === 1 && this.samples < 2 && this._texture ? this._blurX.inputTexture = this._renderTarget : this._blurX.alwaysForcePOT = !0, this._blurY = new c9("vertical blur", new at(0, 1), this._blurKernelY, this._blurRatio, null, We.BILINEAR_SAMPLINGMODE, e, !1, t), this._blurY.autoClear = !1, this._blurY.alwaysForcePOT = this._blurRatio !== 1, this.addPostProcess(this._blurX), this.addPostProcess(this._blurY);
    } else
      this._blurY && (this.removePostProcess(this._blurY), this._blurY.dispose(), this._blurY = null), this._blurX && (this.removePostProcess(this._blurX), this._blurX.dispose(), this._blurX = null);
  }
  /**
   * Clone the mirror texture.
   * @returns the cloned texture
   */
  clone() {
    const e = this.getScene();
    if (!e)
      return this;
    const t = this.getSize(), r = new uD(this.name, t.width, e, this._renderTargetOptions.generateMipMaps, this._renderTargetOptions.type, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer);
    return r.hasAlpha = this.hasAlpha, r.level = this.level, r.mirrorPlane = this.mirrorPlane.clone(), this.renderList && (r.renderList = this.renderList.slice(0)), r;
  }
  /**
   * Serialize the texture to a JSON representation you could use in Parse later on
   * @returns the serialized JSON representation
   */
  serialize() {
    if (!this.name)
      return null;
    const e = super.serialize();
    return e.mirrorPlane = this.mirrorPlane.asArray(), e;
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
    var e;
    super.dispose();
    const t = this.getScene();
    t && t.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver), (e = this._sceneUBO) === null || e === void 0 || e.dispose();
  }
}
We._CreateMirror = (A, e, t, r) => new uD(A, e, t, r);
class v1 extends ls {
  /**
   * Gets or sets the size of the bounding box associated with the cube texture
   * When defined, the cubemap will switch to local mode
   * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity
   * @example https://www.babylonjs-playground.com/#RNASML
   */
  set boundingBoxSize(e) {
    if (this._boundingBoxSize && this._boundingBoxSize.equals(e))
      return;
    this._boundingBoxSize = e;
    const t = this.getScene();
    t && t.markAllMaterialsAsDirty(1);
  }
  /**
   * Returns the bounding box size
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#using-local-cubemap-mode
   */
  get boundingBoxSize() {
    return this._boundingBoxSize;
  }
  /**
   * Sets texture matrix rotation angle around Y axis in radians.
   */
  set rotationY(e) {
    this._rotationY = e, this.setReflectionTextureMatrix(he.RotationY(this._rotationY));
  }
  /**
   * Gets texture matrix rotation angle around Y axis radians.
   */
  get rotationY() {
    return this._rotationY;
  }
  /**
   * Are mip maps generated for this texture or not.
   */
  get noMipmap() {
    return this._noMipmap;
  }
  /**
   * Gets the forced extension (if any)
   */
  get forcedExtension() {
    return this._forcedExtension;
  }
  /**
   * Creates a cube texture from an array of image urls
   * @param files defines an array of image urls
   * @param scene defines the hosting scene
   * @param noMipmap specifies if mip maps are not used
   * @returns a cube texture
   */
  static CreateFromImages(e, t, r) {
    let n = "";
    return e.forEach((i) => n += i), new v1(n, t, null, r, e);
  }
  /**
   * Creates and return a texture created from prefilterd data by tools like IBL Baker or Lys.
   * @param url defines the url of the prefiltered texture
   * @param scene defines the scene the texture is attached to
   * @param forcedExtension defines the extension of the file if different from the url
   * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary
   * @returns the prefiltered texture
   */
  static CreateFromPrefilteredData(e, t, r = null, n = !0) {
    const i = t.useDelayedTextureLoading;
    t.useDelayedTextureLoading = !1;
    const s = new v1(e, t, null, !1, null, null, null, void 0, !0, r, n);
    return t.useDelayedTextureLoading = i, s;
  }
  /**
   * Creates a cube texture to use with reflection for instance. It can be based upon dds or six images as well
   * as prefiltered data.
   * @param rootUrl defines the url of the texture or the root name of the six images
   * @param sceneOrEngine defines the scene or engine the texture is attached to
   * @param extensions defines the suffixes add to the picture name in case six images are in use like _px.jpg...
   * @param noMipmap defines if mipmaps should be created or not
   * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz
   * @param onLoad defines a callback triggered at the end of the file load if no errors occurred
   * @param onError defines a callback triggered in case of error during load
   * @param format defines the internal format to use for the texture once loaded
   * @param prefiltered defines whether or not the texture is created from prefiltered data
   * @param forcedExtension defines the extensions to use (force a special type of file to load) in case it is different from the file name
   * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary
   * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
   * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
   * @param loaderOptions options to be passed to the loader
   * @param useSRGBBuffer Defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU) (default: false)
   * @returns the cube texture
   */
  constructor(e, t, r = null, n = !1, i = null, s = null, a = null, f = 5, o = !1, d = null, v = !1, u = 0.8, l = 0, P, p) {
    var c;
    super(t), this._lodScale = 0.8, this._lodOffset = 0, this.onLoadObservable = new Oe(), this.boundingBoxPosition = S.Zero(), this._rotationY = 0, this._files = null, this._forcedExtension = null, this._extensions = null, this._textureMatrixRefraction = new he(), this.name = e, this.url = e, this._noMipmap = n, this.hasAlpha = !1, this._format = f, this.isCube = !0, this._textureMatrix = he.Identity(), this._createPolynomials = v, this.coordinatesMode = We.CUBIC_MODE, this._extensions = r, this._files = i, this._forcedExtension = d, this._loaderOptions = P, this._useSRGBBuffer = p, this._lodScale = u, this._lodOffset = l, !(!e && !i) && this.updateURL(e, d, s, o, a, r, (c = this.getScene()) === null || c === void 0 ? void 0 : c.useDelayedTextureLoading, i);
  }
  /**
   * Get the current class name of the texture useful for serialization or dynamic coding.
   * @returns "CubeTexture"
   */
  getClassName() {
    return "CubeTexture";
  }
  /**
   * Update the url (and optional buffer) of this texture if url was null during construction.
   * @param url the url of the texture
   * @param forcedExtension defines the extension to use
   * @param onLoad callback called when the texture is loaded  (defaults to null)
   * @param prefiltered Defines whether the updated texture is prefiltered or not
   * @param onError callback called if there was an error during the loading process (defaults to null)
   * @param extensions defines the suffixes add to the picture name in case six images are in use like _px.jpg...
   * @param delayLoad defines if the texture should be loaded now (false by default)
   * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz
   */
  updateURL(e, t, r = null, n = !1, i = null, s = null, a = !1, f = null) {
    (!this.name || this.name.startsWith("data:")) && (this.name = e), this.url = e, t && (this._forcedExtension = t);
    const o = e.lastIndexOf("."), d = t || (o > -1 ? e.substring(o).toLowerCase() : ""), v = d.indexOf(".dds") === 0, u = d.indexOf(".env") === 0, l = d.indexOf(".basis") === 0;
    if (u ? (this.gammaSpace = !1, this._prefiltered = !1, this.anisotropicFilteringLevel = 1) : (this._prefiltered = n, n && (this.gammaSpace = !1, this.anisotropicFilteringLevel = 1)), f)
      this._files = f;
    else if (!l && !u && !v && !s && (s = ["_px.jpg", "_py.jpg", "_pz.jpg", "_nx.jpg", "_ny.jpg", "_nz.jpg"]), this._files = this._files || [], this._files.length = 0, s) {
      for (let P = 0; P < s.length; P++)
        this._files.push(e + s[P]);
      this._extensions = s;
    }
    a ? (this.delayLoadState = 4, this._delayedOnLoad = r, this._delayedOnError = i) : this._loadTexture(r, i);
  }
  /**
   * Delays loading of the cube texture
   * @param forcedExtension defines the extension to use
   */
  delayLoad(e) {
    this.delayLoadState === 4 && (e && (this._forcedExtension = e), this.delayLoadState = 1, this._loadTexture(this._delayedOnLoad, this._delayedOnError));
  }
  /**
   * Returns the reflection texture matrix
   * @returns the reflection texture matrix
   */
  getReflectionTextureMatrix() {
    return this._textureMatrix;
  }
  /**
   * Sets the reflection texture matrix
   * @param value Reflection texture matrix
   */
  setReflectionTextureMatrix(e) {
    var t, r;
    if (e.updateFlag === this._textureMatrix.updateFlag || (e.isIdentity() !== this._textureMatrix.isIdentity() && ((t = this.getScene()) === null || t === void 0 || t.markAllMaterialsAsDirty(1, (a) => a.getActiveTextures().indexOf(this) !== -1)), this._textureMatrix = e, !(!((r = this.getScene()) === null || r === void 0) && r.useRightHandedSystem)))
      return;
    const n = ue.Vector3[0], i = ue.Quaternion[0], s = ue.Vector3[1];
    this._textureMatrix.decompose(n, i, s), i.z *= -1, i.w *= -1, he.ComposeToRef(n, i, s, this._textureMatrixRefraction);
  }
  /**
   * Gets a suitable rotate/transform matrix when the texture is used for refraction.
   * There's a separate function from getReflectionTextureMatrix because refraction requires a special configuration of the matrix in right-handed mode.
   * @returns The refraction matrix
   */
  getRefractionTextureMatrix() {
    var e;
    return !((e = this.getScene()) === null || e === void 0) && e.useRightHandedSystem ? this._textureMatrixRefraction : this._textureMatrix;
  }
  _loadTexture(e = null, t = null) {
    var r;
    const n = this.getScene(), i = this._texture;
    this._texture = this._getFromCache(this.url, this._noMipmap, void 0, void 0, this._useSRGBBuffer, this.isCube);
    const s = () => {
      var f;
      this.onLoadObservable.notifyObservers(this), i && (i.dispose(), (f = this.getScene()) === null || f === void 0 || f.markAllMaterialsAsDirty(1)), e && e();
    }, a = (f, o) => {
      this._loadingError = !0, this._errorObject = { message: f, exception: o }, t && t(f, o), We.OnTextureLoadErrorObservable.notifyObservers(this);
    };
    this._texture ? this._texture.isReady ? ye.SetImmediate(() => s()) : this._texture.onLoadedObservable.add(() => s()) : (this._prefiltered ? this._texture = this._getEngine().createPrefilteredCubeTexture(this.url, n, this._lodScale, this._lodOffset, e, a, this._format, this._forcedExtension, this._createPolynomials) : this._texture = this._getEngine().createCubeTexture(this.url, n, this._files, this._noMipmap, e, a, this._format, this._forcedExtension, !1, this._lodScale, this._lodOffset, null, this._loaderOptions, !!this._useSRGBBuffer), (r = this._texture) === null || r === void 0 || r.onLoadedObservable.add(() => this.onLoadObservable.notifyObservers(this)));
  }
  /**
   * Parses text to create a cube texture
   * @param parsedTexture define the serialized text to read from
   * @param scene defines the hosting scene
   * @param rootUrl defines the root url of the cube texture
   * @returns a cube texture
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => {
      var i;
      let s = !1;
      return e.prefiltered && (s = e.prefiltered), new v1(r + ((i = e.url) !== null && i !== void 0 ? i : e.name), t, e.extensions, !1, e.files || null, null, null, void 0, s, e.forcedExtension);
    }, e, t);
    if (e.boundingBoxPosition && (n.boundingBoxPosition = S.FromArray(e.boundingBoxPosition)), e.boundingBoxSize && (n.boundingBoxSize = S.FromArray(e.boundingBoxSize)), e.animations)
      for (let i = 0; i < e.animations.length; i++) {
        const s = e.animations[i], a = Jo("BABYLON.Animation");
        a && n.animations.push(a.Parse(s));
      }
    return n;
  }
  /**
   * Makes a clone, or deep copy, of the cube texture
   * @returns a new cube texture
   */
  clone() {
    let e = 0;
    const t = jt.Clone(() => {
      const r = new v1(this.url, this.getScene() || this._getEngine(), this._extensions, this._noMipmap, this._files);
      return e = r.uniqueId, r;
    }, this);
    return t.uniqueId = e, t;
  }
}
C([
  M()
], v1.prototype, "url", void 0);
C([
  fo()
], v1.prototype, "boundingBoxPosition", void 0);
C([
  fo()
], v1.prototype, "boundingBoxSize", null);
C([
  M("rotationY")
], v1.prototype, "rotationY", null);
C([
  M("files")
], v1.prototype, "_files", void 0);
C([
  M("forcedExtension")
], v1.prototype, "_forcedExtension", void 0);
C([
  M("extensions")
], v1.prototype, "_extensions", void 0);
C([
  qO("textureMatrix")
], v1.prototype, "_textureMatrix", void 0);
C([
  qO("textureMatrixRefraction")
], v1.prototype, "_textureMatrixRefraction", void 0);
We._CubeTextureParser = v1.Parse;
Ue("BABYLON.CubeTexture", v1);
const dPe = "backgroundFragmentDeclaration", vPe = `uniform vec4 vEyePosition;uniform vec4 vPrimaryColor;
#ifdef USEHIGHLIGHTANDSHADOWCOLORS
uniform vec4 vPrimaryColorShadow;
#endif
uniform float shadowLevel;uniform float alpha;
#ifdef DIFFUSE
uniform vec2 vDiffuseInfos;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;
#endif
#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)
uniform vec3 vBackgroundCenter;
#endif
#ifdef REFLECTIONFRESNEL
uniform vec4 vReflectionControl;
#endif
#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)
uniform mat4 view;
#endif
#ifdef PROJECTED_GROUND
uniform vec2 projectedGroundInfos;
#endif
`;
Le.IncludesShadersStore[dPe] = vPe;
const uPe = "backgroundUboDeclaration", lPe = `layout(std140,column_major) uniform;uniform Material
{uniform vec4 vPrimaryColor;uniform vec4 vPrimaryColorShadow;uniform vec2 vDiffuseInfos;uniform vec2 vReflectionInfos;uniform mat4 diffuseMatrix;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;uniform float pointSize;uniform float shadowLevel;uniform float alpha;uniform vec3 vBackgroundCenter;uniform vec4 vReflectionControl;uniform vec2 projectedGroundInfos;};
#include<sceneUboDeclaration>
`;
Le.IncludesShadersStore[uPe] = lPe;
const PPe = "backgroundPixelShader", cPe = `#ifdef TEXTURELODSUPPORT
#extension GL_EXT_shader_texture_lod : enable
#endif
precision highp float;
#include<__decl__backgroundFragment>
#include<helperFunctions>
varying vec3 vPositionW;
#ifdef MAINUV1
varying vec2 vMainUV1;
#endif 
#ifdef MAINUV2 
varying vec2 vMainUV2; 
#endif 
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef DIFFUSE
#if DIFFUSEDIRECTUV==1
#define vDiffuseUV vMainUV1
#elif DIFFUSEDIRECTUV==2
#define vDiffuseUV vMainUV2
#else
varying vec2 vDiffuseUV;
#endif
uniform sampler2D diffuseSampler;
#endif
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
#define sampleReflection(s,c) textureCube(s,c)
uniform samplerCube reflectionSampler;
#ifdef TEXTURELODSUPPORT
#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)
#else
uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
#endif
#else
#define sampleReflection(s,c) texture2D(s,c)
uniform sampler2D reflectionSampler;
#ifdef TEXTURELODSUPPORT
#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)
#else
uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
#endif
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#endif
#include<reflectionFunction>
#endif
#ifndef FROMLINEARSPACE
#define FROMLINEARSPACE;
#endif
#ifndef SHADOWONLY
#define SHADOWONLY;
#endif
#include<imageProcessingDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<imageProcessingFunctions>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<clipPlaneFragmentDeclaration>
#include<fogFragmentDeclaration>
#ifdef REFLECTIONFRESNEL
#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
vec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)
{float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}
#endif
#ifdef PROJECTED_GROUND
float diskIntersectWithBackFaceCulling(vec3 ro,vec3 rd,vec3 c,float r) {float d=rd.y;if(d>0.0) { return 1e6; }
vec3 o=ro-c;float t=-o.y/d;vec3 q=o+rd*t;return (dot(q,q)<r*r) ? t : 1e6;}
float sphereIntersect(vec3 ro,vec3 rd,float ra) {float b=dot(ro,rd);float c=dot(ro,ro)-ra*ra;float h=b*b-c;if(h<0.0) { return -1.0; }
h=sqrt(h);return-b+h;}
vec3 project(vec3 viewDirectionW,vec3 eyePosition) {float radius=projectedGroundInfos.x;float height=projectedGroundInfos.y;vec3 camDir=-viewDirectionW;float skySphereDistance=sphereIntersect(eyePosition,camDir,radius);vec3 skySpherePositionW=eyePosition+camDir*skySphereDistance;vec3 p=normalize(skySpherePositionW);eyePosition.y-=height;float sIntersection=sphereIntersect(eyePosition,p,radius);vec3 h=vec3(0.0,-height,0.0);float dIntersection=diskIntersectWithBackFaceCulling(eyePosition,p,h,radius);p=(eyePosition+min(sIntersection,dIntersection)*p);return p;}
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(0.0,1.0,0.0);
#endif
float shadow=1.;float globalShadow=0.;float shadowLightCount=0.;float aggShadow=0.;float numLights=0.;
#include<lightFragment>[0..maxSimultaneousLights]
#ifdef SHADOWINUSE
globalShadow/=shadowLightCount;
#else
globalShadow=1.0;
#endif
#ifndef BACKMAT_SHADOWONLY
vec4 reflectionColor=vec4(1.,1.,1.,1.);
#ifdef REFLECTION
#ifdef PROJECTED_GROUND
vec3 reflectionVector=project(viewDirectionW,vEyePosition.xyz);reflectionVector=vec3(reflectionMatrix*vec4(reflectionVector,1.));
#else
vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
vec3 reflectionCoords=reflectionVector;
#else
vec2 reflectionCoords=reflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
reflectionCoords/=reflectionVector.z;
#endif
reflectionCoords.y=1.0-reflectionCoords.y;
#endif
#ifdef REFLECTIONBLUR
float reflectionLOD=vReflectionInfos.y;
#ifdef TEXTURELODSUPPORT
reflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;reflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);
#else
float lodReflectionNormalized=saturate(reflectionLOD);float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);if(lodReflectionNormalizedDoubled<1.0){reflectionColor=mix(
sampleReflection(reflectionSamplerHigh,reflectionCoords),
reflectionSpecularMid,
lodReflectionNormalizedDoubled
);} else {reflectionColor=mix(
reflectionSpecularMid,
sampleReflection(reflectionSamplerLow,reflectionCoords),
lodReflectionNormalizedDoubled-1.0
);}
#endif
#else
vec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);reflectionColor=reflectionSample;
#endif
#ifdef RGBDREFLECTION
reflectionColor.rgb=fromRGBD(reflectionColor);
#endif
#ifdef GAMMAREFLECTION
reflectionColor.rgb=toLinearSpace(reflectionColor.rgb);
#endif
#ifdef REFLECTIONBGR
reflectionColor.rgb=reflectionColor.bgr;
#endif
reflectionColor.rgb*=vReflectionInfos.x;
#endif
vec3 diffuseColor=vec3(1.,1.,1.);float finalAlpha=alpha;
#ifdef DIFFUSE
vec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);
#ifdef GAMMADIFFUSE
diffuseMap.rgb=toLinearSpace(diffuseMap.rgb);
#endif
diffuseMap.rgb*=vDiffuseInfos.y;
#ifdef DIFFUSEHASALPHA
finalAlpha*=diffuseMap.a;
#endif
diffuseColor=diffuseMap.rgb;
#endif
#ifdef REFLECTIONFRESNEL
vec3 colorBase=diffuseColor;
#else
vec3 colorBase=reflectionColor.rgb*diffuseColor;
#endif
colorBase=max(colorBase,0.0);
#ifdef USERGBCOLOR
vec3 finalColor=colorBase;
#else
#ifdef USEHIGHLIGHTANDSHADOWCOLORS
vec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);
#else
vec3 mainColor=vPrimaryColor.rgb;
#endif
vec3 finalColor=colorBase*mainColor;
#endif
#ifdef REFLECTIONFRESNEL
vec3 reflectionAmount=vReflectionControl.xxx;vec3 reflectionReflectance0=vReflectionControl.yyy;vec3 reflectionReflectance90=vReflectionControl.zzz;float VdotN=dot(normalize(vEyePosition.xyz),normalW);vec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);reflectionAmount*=planarReflectionFresnel;
#ifdef REFLECTIONFALLOFF
float reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);reflectionDistanceFalloff*=reflectionDistanceFalloff;reflectionAmount*=reflectionDistanceFalloff;
#endif
finalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount));
#endif
#ifdef OPACITYFRESNEL
float viewAngleToFloor=dot(normalW,normalize(vEyePosition.xyz-vBackgroundCenter));const float startAngle=0.1;float fadeFactor=saturate(viewAngleToFloor/startAngle);finalAlpha*=fadeFactor*fadeFactor;
#endif
#ifdef SHADOWINUSE
finalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);
#endif
vec4 color=vec4(finalColor,finalAlpha);
#else
vec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha);
#endif
#include<logDepthFragment>
#include<fogFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
#if !defined(SKIPFINALCOLORCLAMP)
color.rgb=clamp(color.rgb,0.,30.0);
#endif
#else
color=applyImageProcessing(color);
#endif
#ifdef PREMULTIPLYALPHA
color.rgb*=color.a;
#endif
#ifdef NOISE
color.rgb+=dither(vPositionW.xy,0.5);color=max(color,0.0);
#endif
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[PPe] = cPe;
const pPe = "backgroundVertexDeclaration", hPe = `uniform mat4 view;uniform mat4 viewProjection;uniform float shadowLevel;
#ifdef DIFFUSE
uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
`;
Le.IncludesShadersStore[pPe] = hPe;
const HPe = "backgroundVertexShader", gPe = `precision highp float;
#include<__decl__backgroundVertex>
#include<helperFunctions>
attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef MAINUV1
varying vec2 vMainUV1;
#endif
#ifdef MAINUV2
varying vec2 vMainUV2;
#endif
#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0
varying vec2 vDiffuseUV;
#endif
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#ifdef REFLECTIONMAP_SKYBOX
vPositionUVW=position;
#endif
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*finalWorld*vec4(position,1.0);} else {gl_Position=viewProjectionR*finalWorld*vec4(position,1.0);}
#else
gl_Position=viewProjection*finalWorld*vec4(position,1.0);
#endif
vec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos);
#ifdef NORMAL
mat3 normalWorld=mat3(finalWorld);
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vNormalW=normalize(normalWorld*normal);
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));
#ifdef EQUIRECTANGULAR_RELFECTION_FOV
mat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));vec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));if (fFovMultiplier<=1.0) {vDirectionW=normalize(segment);} else {vDirectionW=normalize(vDirectionW+(vDirectionW-segment));}
#endif
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef MAINUV1
vMainUV1=uv;
#endif
#ifdef MAINUV2
vMainUV2=uv2;
#endif
#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0
if (vDiffuseInfos.x==0.)
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}
else
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#ifdef VERTEXCOLOR
vColor=color;
#endif
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[HPe] = gPe;
class XPe extends na {
  /**
   * Constructor of the defines.
   */
  constructor() {
    super(), this.DIFFUSE = !1, this.DIFFUSEDIRECTUV = 0, this.GAMMADIFFUSE = !1, this.DIFFUSEHASALPHA = !1, this.OPACITYFRESNEL = !1, this.REFLECTIONBLUR = !1, this.REFLECTIONFRESNEL = !1, this.REFLECTIONFALLOFF = !1, this.TEXTURELODSUPPORT = !1, this.PREMULTIPLYALPHA = !1, this.USERGBCOLOR = !1, this.USEHIGHLIGHTANDSHADOWCOLORS = !1, this.BACKMAT_SHADOWONLY = !1, this.NOISE = !1, this.REFLECTIONBGR = !1, this.PROJECTED_GROUND = !1, this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.EXPOSURE = !1, this.MULTIVIEW = !1, this.REFLECTION = !1, this.REFLECTIONMAP_3D = !1, this.REFLECTIONMAP_SPHERICAL = !1, this.REFLECTIONMAP_PLANAR = !1, this.REFLECTIONMAP_CUBIC = !1, this.REFLECTIONMAP_PROJECTION = !1, this.REFLECTIONMAP_SKYBOX = !1, this.REFLECTIONMAP_EXPLICIT = !1, this.REFLECTIONMAP_EQUIRECTANGULAR = !1, this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, this.INVERTCUBICMAP = !1, this.REFLECTIONMAP_OPPOSITEZ = !1, this.LODINREFLECTIONALPHA = !1, this.GAMMAREFLECTION = !1, this.RGBDREFLECTION = !1, this.EQUIRECTANGULAR_RELFECTION_FOV = !1, this.MAINUV1 = !1, this.MAINUV2 = !1, this.UV1 = !1, this.UV2 = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.POINTSIZE = !1, this.FOG = !1, this.NORMAL = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.SHADOWFLOAT = !1, this.LOGARITHMICDEPTH = !1, this.NONUNIFORMSCALING = !1, this.ALPHATEST = !1, this.rebuild();
  }
}
class Vi extends P1 {
  /**
   * Experimental Internal Use Only.
   *
   * Key light Color in "perceptual value" meaning the color you would like to see on screen.
   * This acts as a helper to set the primary color to a more "human friendly" value.
   * Conversion to linear space as well as exposure and tone mapping correction will be applied to keep the
   * output color as close as possible from the chosen value.
   * (This does not account for contrast color grading and color curves as they are considered post effect and not directly
   * part of lighting setup.)
   */
  get _perceptualColor() {
    return this.__perceptualColor;
  }
  set _perceptualColor(e) {
    this.__perceptualColor = e, this._computePrimaryColorFromPerceptualColor(), this._markAllSubMeshesAsLightsDirty();
  }
  /**
   * Defines the level of the shadows (dark area of the reflection map) in order to help scaling the colors.
   * The color opposite to the primary color is used at the level chosen to define what the black area would look.
   */
  get primaryColorShadowLevel() {
    return this._primaryColorShadowLevel;
  }
  set primaryColorShadowLevel(e) {
    this._primaryColorShadowLevel = e, this._computePrimaryColors(), this._markAllSubMeshesAsLightsDirty();
  }
  /**
   * Defines the level of the highlights (highlight area of the reflection map) in order to help scaling the colors.
   * The primary color is used at the level chosen to define what the white area would look.
   */
  get primaryColorHighlightLevel() {
    return this._primaryColorHighlightLevel;
  }
  set primaryColorHighlightLevel(e) {
    this._primaryColorHighlightLevel = e, this._computePrimaryColors(), this._markAllSubMeshesAsLightsDirty();
  }
  /**
   * Sets the reflection reflectance fresnel values according to the default standard
   * empirically know to work well :-)
   */
  set reflectionStandardFresnelWeight(e) {
    let t = e;
    t < 0.5 ? (t = t * 2, this.reflectionReflectance0 = Vi.StandardReflectance0 * t, this.reflectionReflectance90 = Vi.StandardReflectance90 * t) : (t = t * 2 - 1, this.reflectionReflectance0 = Vi.StandardReflectance0 + (1 - Vi.StandardReflectance0) * t, this.reflectionReflectance90 = Vi.StandardReflectance90 + (1 - Vi.StandardReflectance90) * t);
  }
  /**
   * The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out".
   * Best used when trying to implement visual zoom effects like fish-eye or binoculars while not adjusting camera fov.
   * Recommended to be keep at 1.0 except for special cases.
   */
  get fovMultiplier() {
    return this._fovMultiplier;
  }
  set fovMultiplier(e) {
    isNaN(e) && (e = 1), this._fovMultiplier = Math.max(0, Math.min(2, e));
  }
  /**
   * Attaches a new image processing configuration to the PBR Material.
   * @param configuration (if null the scene configuration will be use)
   */
  _attachImageProcessingConfiguration(e) {
    e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), e ? this._imageProcessingConfiguration = e : this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
      this._computePrimaryColorFromPerceptualColor(), this._markAllSubMeshesAsImageProcessingDirty();
    })));
  }
  /**
   * Gets the image processing configuration used either in this material.
   */
  get imageProcessingConfiguration() {
    return this._imageProcessingConfiguration;
  }
  /**
   * Sets the Default image processing configuration used either in the this material.
   *
   * If sets to null, the scene one is in use.
   */
  set imageProcessingConfiguration(e) {
    this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty();
  }
  /**
   * Gets whether the color curves effect is enabled.
   */
  get cameraColorCurvesEnabled() {
    return this.imageProcessingConfiguration.colorCurvesEnabled;
  }
  /**
   * Sets whether the color curves effect is enabled.
   */
  set cameraColorCurvesEnabled(e) {
    this.imageProcessingConfiguration.colorCurvesEnabled = e;
  }
  /**
   * Gets whether the color grading effect is enabled.
   */
  get cameraColorGradingEnabled() {
    return this.imageProcessingConfiguration.colorGradingEnabled;
  }
  /**
   * Gets whether the color grading effect is enabled.
   */
  set cameraColorGradingEnabled(e) {
    this.imageProcessingConfiguration.colorGradingEnabled = e;
  }
  /**
   * Gets whether tonemapping is enabled or not.
   */
  get cameraToneMappingEnabled() {
    return this._imageProcessingConfiguration.toneMappingEnabled;
  }
  /**
   * Sets whether tonemapping is enabled or not
   */
  set cameraToneMappingEnabled(e) {
    this._imageProcessingConfiguration.toneMappingEnabled = e;
  }
  /**
   * The camera exposure used on this material.
   * This property is here and not in the camera to allow controlling exposure without full screen post process.
   * This corresponds to a photographic exposure.
   */
  get cameraExposure() {
    return this._imageProcessingConfiguration.exposure;
  }
  /**
   * The camera exposure used on this material.
   * This property is here and not in the camera to allow controlling exposure without full screen post process.
   * This corresponds to a photographic exposure.
   */
  set cameraExposure(e) {
    this._imageProcessingConfiguration.exposure = e;
  }
  /**
   * Gets The camera contrast used on this material.
   */
  get cameraContrast() {
    return this._imageProcessingConfiguration.contrast;
  }
  /**
   * Sets The camera contrast used on this material.
   */
  set cameraContrast(e) {
    this._imageProcessingConfiguration.contrast = e;
  }
  /**
   * Gets the Color Grading 2D Lookup Texture.
   */
  get cameraColorGradingTexture() {
    return this._imageProcessingConfiguration.colorGradingTexture;
  }
  /**
   * Sets the Color Grading 2D Lookup Texture.
   */
  set cameraColorGradingTexture(e) {
    this.imageProcessingConfiguration.colorGradingTexture = e;
  }
  /**
   * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
   * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
   * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
   * corresponding to low luminance, medium luminance, and high luminance areas respectively.
   */
  get cameraColorCurves() {
    return this.imageProcessingConfiguration.colorCurves;
  }
  /**
   * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
   * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
   * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
   * corresponding to low luminance, medium luminance, and high luminance areas respectively.
   */
  set cameraColorCurves(e) {
    this.imageProcessingConfiguration.colorCurves = e;
  }
  /**
   * Instantiates a Background Material in the given scene
   * @param name The friendly name of the material
   * @param scene The scene to add the material to
   */
  constructor(e, t) {
    super(e, t), this.primaryColor = Ne.White(), this._primaryColorShadowLevel = 0, this._primaryColorHighlightLevel = 0, this.reflectionTexture = null, this.reflectionBlur = 0, this.diffuseTexture = null, this._shadowLights = null, this.shadowLights = null, this.shadowLevel = 0, this.sceneCenter = S.Zero(), this.opacityFresnel = !0, this.reflectionFresnel = !1, this.reflectionFalloffDistance = 0, this.reflectionAmount = 1, this.reflectionReflectance0 = 0.05, this.reflectionReflectance90 = 0.5, this.useRGBColor = !0, this.enableNoise = !1, this._fovMultiplier = 1, this.useEquirectangularFOV = !1, this._maxSimultaneousLights = 4, this.maxSimultaneousLights = 4, this._shadowOnly = !1, this.shadowOnly = !1, this._imageProcessingObserver = null, this.switchToBGR = !1, this._enableGroundProjection = !1, this.enableGroundProjection = !1, this.projectedGroundRadius = 1e3, this.projectedGroundHeight = 10, this._renderTargets = new qf(16), this._reflectionControls = Ir.Zero(), this._white = Ne.White(), this._primaryShadowColor = Ne.Black(), this._primaryHighlightColor = Ne.Black(), this._attachImageProcessingConfiguration(null), this.getRenderTargetTextures = () => (this._renderTargets.reset(), this._diffuseTexture && this._diffuseTexture.isRenderTarget && this._renderTargets.push(this._diffuseTexture), this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._renderTargets.push(this._reflectionTexture), this._renderTargets);
  }
  /**
   * Gets a boolean indicating that current material needs to register RTT
   */
  get hasRenderTargetTextures() {
    return !!(this._diffuseTexture && this._diffuseTexture.isRenderTarget || this._reflectionTexture && this._reflectionTexture.isRenderTarget);
  }
  /**
   * The entire material has been created in order to prevent overdraw.
   * @returns false
   */
  needAlphaTesting() {
    return !0;
  }
  /**
   * The entire material has been created in order to prevent overdraw.
   * @returns true if blending is enable
   */
  needAlphaBlending() {
    return this.alpha < 1 || this._diffuseTexture != null && this._diffuseTexture.hasAlpha || this._shadowOnly;
  }
  /**
   * Checks whether the material is ready to be rendered for a given mesh.
   * @param mesh The mesh to render
   * @param subMesh The submesh to check against
   * @param useInstances Specify wether or not the material is used with instances
   * @returns true if all the dependencies are ready (Textures, Effects...)
   */
  isReadyForSubMesh(e, t, r = !1) {
    if (t.effect && this.isFrozen && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new XPe());
    const n = this.getScene(), i = t.materialDefines;
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = n.getEngine();
    if (Ye.PrepareDefinesForLights(n, e, i, !1, this._maxSimultaneousLights), i._needNormals = !0, Ye.PrepareDefinesForMultiview(n, i), i._areTexturesDirty) {
      if (i._needUVs = !1, n.texturesEnabled) {
        if (n.getEngine().getCaps().textureLOD && (i.TEXTURELODSUPPORT = !0), this._diffuseTexture && Dt.DiffuseTextureEnabled) {
          if (!this._diffuseTexture.isReadyOrNotBlocking())
            return !1;
          Ye.PrepareDefinesForMergedUV(this._diffuseTexture, i, "DIFFUSE"), i.DIFFUSEHASALPHA = this._diffuseTexture.hasAlpha, i.GAMMADIFFUSE = this._diffuseTexture.gammaSpace, i.OPACITYFRESNEL = this._opacityFresnel;
        } else
          i.DIFFUSE = !1, i.DIFFUSEDIRECTUV = 0, i.DIFFUSEHASALPHA = !1, i.GAMMADIFFUSE = !1, i.OPACITYFRESNEL = !1;
        const a = this._reflectionTexture;
        if (a && Dt.ReflectionTextureEnabled) {
          if (!a.isReadyOrNotBlocking())
            return !1;
          switch (i.REFLECTION = !0, i.GAMMAREFLECTION = a.gammaSpace, i.RGBDREFLECTION = a.isRGBD, i.REFLECTIONBLUR = this._reflectionBlur > 0, i.LODINREFLECTIONALPHA = a.lodLevelInAlpha, i.EQUIRECTANGULAR_RELFECTION_FOV = this.useEquirectangularFOV, i.REFLECTIONBGR = this.switchToBGR, a.coordinatesMode === We.INVCUBIC_MODE && (i.INVERTCUBICMAP = !0), i.REFLECTIONMAP_3D = a.isCube, i.REFLECTIONMAP_OPPOSITEZ = i.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !a.invertZ : a.invertZ, a.coordinatesMode) {
            case We.EXPLICIT_MODE:
              i.REFLECTIONMAP_EXPLICIT = !0;
              break;
            case We.PLANAR_MODE:
              i.REFLECTIONMAP_PLANAR = !0;
              break;
            case We.PROJECTION_MODE:
              i.REFLECTIONMAP_PROJECTION = !0;
              break;
            case We.SKYBOX_MODE:
              i.REFLECTIONMAP_SKYBOX = !0;
              break;
            case We.SPHERICAL_MODE:
              i.REFLECTIONMAP_SPHERICAL = !0;
              break;
            case We.EQUIRECTANGULAR_MODE:
              i.REFLECTIONMAP_EQUIRECTANGULAR = !0;
              break;
            case We.FIXED_EQUIRECTANGULAR_MODE:
              i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !0;
              break;
            case We.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
              i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !0;
              break;
            case We.CUBIC_MODE:
            case We.INVCUBIC_MODE:
            default:
              i.REFLECTIONMAP_CUBIC = !0;
              break;
          }
          this.reflectionFresnel ? (i.REFLECTIONFRESNEL = !0, i.REFLECTIONFALLOFF = this.reflectionFalloffDistance > 0, this._reflectionControls.x = this.reflectionAmount, this._reflectionControls.y = this.reflectionReflectance0, this._reflectionControls.z = this.reflectionReflectance90, this._reflectionControls.w = 1 / this.reflectionFalloffDistance) : (i.REFLECTIONFRESNEL = !1, i.REFLECTIONFALLOFF = !1);
        } else
          i.REFLECTION = !1, i.REFLECTIONFRESNEL = !1, i.REFLECTIONFALLOFF = !1, i.REFLECTIONBLUR = !1, i.REFLECTIONMAP_3D = !1, i.REFLECTIONMAP_SPHERICAL = !1, i.REFLECTIONMAP_PLANAR = !1, i.REFLECTIONMAP_CUBIC = !1, i.REFLECTIONMAP_PROJECTION = !1, i.REFLECTIONMAP_SKYBOX = !1, i.REFLECTIONMAP_EXPLICIT = !1, i.REFLECTIONMAP_EQUIRECTANGULAR = !1, i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, i.INVERTCUBICMAP = !1, i.REFLECTIONMAP_OPPOSITEZ = !1, i.LODINREFLECTIONALPHA = !1, i.GAMMAREFLECTION = !1, i.RGBDREFLECTION = !1;
      }
      i.PREMULTIPLYALPHA = this.alphaMode === 7 || this.alphaMode === 8, i.USERGBCOLOR = this._useRGBColor, i.NOISE = this._enableNoise;
    }
    if (i._areLightsDirty && (i.USEHIGHLIGHTANDSHADOWCOLORS = !this._useRGBColor && (this._primaryColorShadowLevel !== 0 || this._primaryColorHighlightLevel !== 0), i.BACKMAT_SHADOWONLY = this._shadowOnly), i._areImageProcessingDirty && this._imageProcessingConfiguration) {
      if (!this._imageProcessingConfiguration.isReady())
        return !1;
      this._imageProcessingConfiguration.prepareDefines(i);
    }
    if (i._areMiscDirty && (i.REFLECTIONMAP_3D && this._enableGroundProjection ? (i.PROJECTED_GROUND = !0, i.REFLECTIONMAP_SKYBOX = !0) : i.PROJECTED_GROUND = !1), Ye.PrepareDefinesForMisc(e, n, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), i), Ye.PrepareDefinesForFrameBoundValues(n, s, this, i, r, null, t.getRenderingMesh().hasThinInstances), Ye.PrepareDefinesForAttributes(e, i, !1, !0, !1) && e && !n.getEngine().getCaps().standardDerivatives && !e.isVerticesDataPresent(J.NormalKind) && (e.createNormals(!0), Se.Warn("BackgroundMaterial: Normals have been created for the mesh: " + e.name)), i.isDirty) {
      i.markAsProcessed(), n.resetCachedMaterial();
      const a = new c1();
      i.FOG && a.addFallback(0, "FOG"), i.POINTSIZE && a.addFallback(1, "POINTSIZE"), i.MULTIVIEW && a.addFallback(0, "MULTIVIEW"), Ye.HandleFallbacksForShadows(i, a, this._maxSimultaneousLights);
      const f = [J.PositionKind];
      i.NORMAL && f.push(J.NormalKind), i.UV1 && f.push(J.UVKind), i.UV2 && f.push(J.UV2Kind), Ye.PrepareAttributesForBones(f, e, i, a), Ye.PrepareAttributesForInstances(f, i);
      const o = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "mBones",
        "vPrimaryColor",
        "vPrimaryColorShadow",
        "vReflectionInfos",
        "reflectionMatrix",
        "vReflectionMicrosurfaceInfos",
        "fFovMultiplier",
        "shadowLevel",
        "alpha",
        "vBackgroundCenter",
        "vReflectionControl",
        "vDiffuseInfos",
        "diffuseMatrix",
        "projectedGroundInfos",
        "logarithmicDepthConstant"
      ];
      Mf(o);
      const d = ["diffuseSampler", "reflectionSampler", "reflectionSamplerLow", "reflectionSamplerHigh"], v = ["Material", "Scene"];
      Ui && (Ui.PrepareUniforms(o, i), Ui.PrepareSamplers(d, i)), Ye.PrepareUniformsAndSamplersList({
        uniformsNames: o,
        uniformBuffersNames: v,
        samplers: d,
        defines: i,
        maxSimultaneousLights: this._maxSimultaneousLights
      });
      const u = i.toString(), l = n.getEngine().createEffect("background", {
        attributes: f,
        uniformsNames: o,
        uniformBuffersNames: v,
        samplers: d,
        defines: u,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights }
      }, s);
      t.setEffect(l, i, this._materialContext), this.buildUniformLayout();
    }
    return !t.effect || !t.effect.isReady() ? !1 : (i._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = r, this._checkScenePerformancePriority(), !0);
  }
  /**
   * Compute the primary color according to the chosen perceptual color.
   */
  _computePrimaryColorFromPerceptualColor() {
    this.__perceptualColor && (this._primaryColor.copyFrom(this.__perceptualColor), this._primaryColor.toLinearSpaceToRef(this._primaryColor, this.getScene().getEngine().useExactSrgbConversions), this._imageProcessingConfiguration && this._primaryColor.scaleToRef(1 / this._imageProcessingConfiguration.exposure, this._primaryColor), this._computePrimaryColors());
  }
  /**
   * Compute the highlights and shadow colors according to their chosen levels.
   */
  _computePrimaryColors() {
    this._primaryColorShadowLevel === 0 && this._primaryColorHighlightLevel === 0 || (this._primaryColor.scaleToRef(this._primaryColorShadowLevel, this._primaryShadowColor), this._primaryColor.subtractToRef(this._primaryShadowColor, this._primaryShadowColor), this._white.subtractToRef(this._primaryColor, this._primaryHighlightColor), this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel, this._primaryHighlightColor), this._primaryColor.addToRef(this._primaryHighlightColor, this._primaryHighlightColor));
  }
  /**
   * Build the uniform buffer used in the material.
   */
  buildUniformLayout() {
    this._uniformBuffer.addUniform("vPrimaryColor", 4), this._uniformBuffer.addUniform("vPrimaryColorShadow", 4), this._uniformBuffer.addUniform("vDiffuseInfos", 2), this._uniformBuffer.addUniform("vReflectionInfos", 2), this._uniformBuffer.addUniform("diffuseMatrix", 16), this._uniformBuffer.addUniform("reflectionMatrix", 16), this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos", 3), this._uniformBuffer.addUniform("fFovMultiplier", 1), this._uniformBuffer.addUniform("pointSize", 1), this._uniformBuffer.addUniform("shadowLevel", 1), this._uniformBuffer.addUniform("alpha", 1), this._uniformBuffer.addUniform("vBackgroundCenter", 3), this._uniformBuffer.addUniform("vReflectionControl", 4), this._uniformBuffer.addUniform("projectedGroundInfos", 2), this._uniformBuffer.create();
  }
  /**
   * Unbind the material.
   */
  unbind() {
    this._diffuseTexture && this._diffuseTexture.isRenderTarget && this._uniformBuffer.setTexture("diffuseSampler", null), this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._uniformBuffer.setTexture("reflectionSampler", null), super.unbind();
  }
  /**
   * Bind only the world matrix to the material.
   * @param world The world matrix to bind.
   */
  bindOnlyWorldMatrix(e) {
    this._activeEffect.setMatrix("world", e);
  }
  /**
   * Bind the material for a dedicated submeh (every used meshes will be considered opaque).
   * @param world The world matrix to bind.
   * @param mesh
   * @param subMesh The submesh to bind for.
   */
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    if (!s)
      return;
    this._activeEffect = s, this.bindOnlyWorldMatrix(e), Ye.BindBonesParameters(t, this._activeEffect);
    const a = this._mustRebind(n, s, t.visibility);
    if (a) {
      this._uniformBuffer.bindToEffect(s, "Material"), this.bindViewProjection(s);
      const f = this._reflectionTexture;
      (!this._uniformBuffer.useUbo || !this.isFrozen || !this._uniformBuffer.isSync) && (n.texturesEnabled && (this._diffuseTexture && Dt.DiffuseTextureEnabled && (this._uniformBuffer.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), Ye.BindTextureMatrix(this._diffuseTexture, this._uniformBuffer, "diffuse")), f && Dt.ReflectionTextureEnabled && (this._uniformBuffer.updateMatrix("reflectionMatrix", f.getReflectionTextureMatrix()), this._uniformBuffer.updateFloat2("vReflectionInfos", f.level, this._reflectionBlur), this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos", f.getSize().width, f.lodGenerationScale, f.lodGenerationOffset))), this.shadowLevel > 0 && this._uniformBuffer.updateFloat("shadowLevel", this.shadowLevel), this._uniformBuffer.updateFloat("alpha", this.alpha), this.pointsCloud && this._uniformBuffer.updateFloat("pointSize", this.pointSize), i.USEHIGHLIGHTANDSHADOWCOLORS ? (this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryHighlightColor, 1), this._uniformBuffer.updateColor4("vPrimaryColorShadow", this._primaryShadowColor, 1)) : this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryColor, 1)), this._uniformBuffer.updateFloat("fFovMultiplier", this._fovMultiplier), n.texturesEnabled && (this._diffuseTexture && Dt.DiffuseTextureEnabled && this._uniformBuffer.setTexture("diffuseSampler", this._diffuseTexture), f && Dt.ReflectionTextureEnabled && (i.REFLECTIONBLUR && i.TEXTURELODSUPPORT ? this._uniformBuffer.setTexture("reflectionSampler", f) : i.REFLECTIONBLUR ? (this._uniformBuffer.setTexture("reflectionSampler", f._lodTextureMid || f), this._uniformBuffer.setTexture("reflectionSamplerLow", f._lodTextureLow || f), this._uniformBuffer.setTexture("reflectionSamplerHigh", f._lodTextureHigh || f)) : this._uniformBuffer.setTexture("reflectionSampler", f), i.REFLECTIONFRESNEL && (this._uniformBuffer.updateFloat3("vBackgroundCenter", this.sceneCenter.x, this.sceneCenter.y, this.sceneCenter.z), this._uniformBuffer.updateFloat4("vReflectionControl", this._reflectionControls.x, this._reflectionControls.y, this._reflectionControls.z, this._reflectionControls.w))), i.PROJECTED_GROUND && this._uniformBuffer.updateFloat2("projectedGroundInfos", this.projectedGroundRadius, this.projectedGroundHeight)), Df(this._activeEffect, this, n), n.bindEyePosition(s);
    } else
      n.getEngine()._features.needToAlwaysBindUniformBuffers && (this._uniformBuffer.bindToEffect(s, "Material"), this._needToBindSceneUbo = !0);
    (a || !this.isFrozen) && (n.lightsEnabled && Ye.BindLights(n, t, this._activeEffect, i, this._maxSimultaneousLights), this.bindView(s), Ye.BindFogParameters(n, t, this._activeEffect, !0), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), this._imageProcessingConfiguration && this._imageProcessingConfiguration.bind(this._activeEffect)), this._afterBind(t, this._activeEffect), this._uniformBuffer.update();
  }
  /**
   * Checks to see if a texture is used in the material.
   * @param texture - Base texture to use.
   * @returns - Boolean specifying if a texture is used in the material.
   */
  hasTexture(e) {
    return !!(super.hasTexture(e) || this._reflectionTexture === e || this._diffuseTexture === e);
  }
  /**
   * Dispose the material.
   * @param forceDisposeEffect Force disposal of the associated effect.
   * @param forceDisposeTextures Force disposal of the associated textures.
   */
  dispose(e = !1, t = !1) {
    t && (this.diffuseTexture && this.diffuseTexture.dispose(), this.reflectionTexture && this.reflectionTexture.dispose()), this._renderTargets.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), super.dispose(e);
  }
  /**
   * Clones the material.
   * @param name The cloned name.
   * @returns The cloned material.
   */
  clone(e) {
    return jt.Clone(() => new Vi(e, this.getScene()), this);
  }
  /**
   * Serializes the current material to its JSON representation.
   * @returns The JSON representation.
   */
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.BackgroundMaterial", e;
  }
  /**
   * Gets the class name of the material
   * @returns "BackgroundMaterial"
   */
  getClassName() {
    return "BackgroundMaterial";
  }
  /**
   * Parse a JSON input to create back a background material.
   * @param source The JSON data to parse
   * @param scene The scene to create the parsed material in
   * @param rootUrl The root url of the assets the material depends upon
   * @returns the instantiated BackgroundMaterial.
   */
  static Parse(e, t, r) {
    return jt.Parse(() => new Vi(e.name, t), e, t, r);
  }
}
Vi.StandardReflectance0 = 0.05;
Vi.StandardReflectance90 = 0.5;
C([
  Oi()
], Vi.prototype, "_primaryColor", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Vi.prototype, "primaryColor", void 0);
C([
  Oi()
], Vi.prototype, "__perceptualColor", void 0);
C([
  M()
], Vi.prototype, "_primaryColorShadowLevel", void 0);
C([
  M()
], Vi.prototype, "_primaryColorHighlightLevel", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Vi.prototype, "primaryColorHighlightLevel", null);
C([
  en()
], Vi.prototype, "_reflectionTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "reflectionTexture", void 0);
C([
  M()
], Vi.prototype, "_reflectionBlur", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "reflectionBlur", void 0);
C([
  en()
], Vi.prototype, "_diffuseTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "diffuseTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "shadowLights", void 0);
C([
  M()
], Vi.prototype, "_shadowLevel", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "shadowLevel", void 0);
C([
  fo()
], Vi.prototype, "_sceneCenter", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "sceneCenter", void 0);
C([
  M()
], Vi.prototype, "_opacityFresnel", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "opacityFresnel", void 0);
C([
  M()
], Vi.prototype, "_reflectionFresnel", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "reflectionFresnel", void 0);
C([
  M()
], Vi.prototype, "_reflectionFalloffDistance", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "reflectionFalloffDistance", void 0);
C([
  M()
], Vi.prototype, "_reflectionAmount", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "reflectionAmount", void 0);
C([
  M()
], Vi.prototype, "_reflectionReflectance0", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "reflectionReflectance0", void 0);
C([
  M()
], Vi.prototype, "_reflectionReflectance90", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "reflectionReflectance90", void 0);
C([
  M()
], Vi.prototype, "_useRGBColor", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "useRGBColor", void 0);
C([
  M()
], Vi.prototype, "_enableNoise", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "enableNoise", void 0);
C([
  M()
], Vi.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Vi.prototype, "maxSimultaneousLights", void 0);
C([
  M()
], Vi.prototype, "_shadowOnly", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Vi.prototype, "shadowOnly", void 0);
C([
  CN()
], Vi.prototype, "_imageProcessingConfiguration", void 0);
C([
  M(),
  At("_markAllSubMeshesAsMiscDirty")
], Vi.prototype, "enableGroundProjection", void 0);
C([
  M()
], Vi.prototype, "projectedGroundRadius", void 0);
C([
  M()
], Vi.prototype, "projectedGroundHeight", void 0);
Ue("BABYLON.BackgroundMaterial", Vi);
class gD {
  /**
   * Creates the default options for the helper.
   * @param scene The scene the environment helper belongs to.
   */
  static _GetDefaultOptions(e) {
    return {
      createGround: !0,
      groundSize: 15,
      groundTexture: this._GroundTextureCDNUrl,
      groundColor: new Ne(0.2, 0.2, 0.3).toLinearSpace(e.getEngine().useExactSrgbConversions).scale(3),
      groundOpacity: 0.9,
      enableGroundShadow: !0,
      groundShadowLevel: 0.5,
      enableGroundMirror: !1,
      groundMirrorSizeRatio: 0.3,
      groundMirrorBlurKernel: 64,
      groundMirrorAmount: 1,
      groundMirrorFresnelWeight: 1,
      groundMirrorFallOffDistance: 0,
      groundMirrorTextureType: 0,
      groundYBias: 1e-5,
      createSkybox: !0,
      skyboxSize: 20,
      skyboxTexture: this._SkyboxTextureCDNUrl,
      skyboxColor: new Ne(0.2, 0.2, 0.3).toLinearSpace(e.getEngine().useExactSrgbConversions).scale(3),
      backgroundYRotation: 0,
      sizeAuto: !0,
      rootPosition: S.Zero(),
      setupImageProcessing: !0,
      environmentTexture: this._EnvironmentTextureCDNUrl,
      cameraExposure: 0.8,
      cameraContrast: 1.2,
      toneMappingEnabled: !0
    };
  }
  /**
   * Gets the root mesh created by the helper.
   */
  get rootMesh() {
    return this._rootMesh;
  }
  /**
   * Gets the skybox created by the helper.
   */
  get skybox() {
    return this._skybox;
  }
  /**
   * Gets the skybox texture created by the helper.
   */
  get skyboxTexture() {
    return this._skyboxTexture;
  }
  /**
   * Gets the skybox material created by the helper.
   */
  get skyboxMaterial() {
    return this._skyboxMaterial;
  }
  /**
   * Gets the ground mesh created by the helper.
   */
  get ground() {
    return this._ground;
  }
  /**
   * Gets the ground texture created by the helper.
   */
  get groundTexture() {
    return this._groundTexture;
  }
  /**
   * Gets the ground mirror created by the helper.
   */
  get groundMirror() {
    return this._groundMirror;
  }
  /**
   * Gets the ground mirror render list to helps pushing the meshes
   * you wish in the ground reflection.
   */
  get groundMirrorRenderList() {
    return this._groundMirror ? this._groundMirror.renderList : null;
  }
  /**
   * Gets the ground material created by the helper.
   */
  get groundMaterial() {
    return this._groundMaterial;
  }
  /**
   * constructor
   * @param options Defines the options we want to customize the helper
   * @param scene The scene to add the material to
   */
  constructor(e, t) {
    this._errorHandler = (r, n) => {
      this.onErrorObservable.notifyObservers({ message: r, exception: n });
    }, this._options = Object.assign(Object.assign({}, gD._GetDefaultOptions(t)), e), this._scene = t, this.onErrorObservable = new Oe(), this._setupBackground(), this._setupImageProcessing();
  }
  /**
   * Updates the background according to the new options
   * @param options
   */
  updateOptions(e) {
    const t = Object.assign(Object.assign({}, this._options), e);
    this._ground && !t.createGround && (this._ground.dispose(), this._ground = null), this._groundMaterial && !t.createGround && (this._groundMaterial.dispose(), this._groundMaterial = null), this._groundTexture && this._options.groundTexture != t.groundTexture && (this._groundTexture.dispose(), this._groundTexture = null), this._skybox && !t.createSkybox && (this._skybox.dispose(), this._skybox = null), this._skyboxMaterial && !t.createSkybox && (this._skyboxMaterial.dispose(), this._skyboxMaterial = null), this._skyboxTexture && this._options.skyboxTexture != t.skyboxTexture && (this._skyboxTexture.dispose(), this._skyboxTexture = null), this._groundMirror && !t.enableGroundMirror && (this._groundMirror.dispose(), this._groundMirror = null), this._scene.environmentTexture && this._options.environmentTexture != t.environmentTexture && this._scene.environmentTexture.dispose(), this._options = t, this._setupBackground(), this._setupImageProcessing();
  }
  /**
   * Sets the primary color of all the available elements.
   * @param color the main color to affect to the ground and the background
   */
  setMainColor(e) {
    this.groundMaterial && (this.groundMaterial.primaryColor = e), this.skyboxMaterial && (this.skyboxMaterial.primaryColor = e), this.groundMirror && (this.groundMirror.clearColor = new xt(e.r, e.g, e.b, 1));
  }
  /**
   * Setup the image processing according to the specified options.
   */
  _setupImageProcessing() {
    this._options.setupImageProcessing && (this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast, this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure, this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled, this._setupEnvironmentTexture());
  }
  /**
   * Setup the environment texture according to the specified options.
   */
  _setupEnvironmentTexture() {
    if (this._scene.environmentTexture)
      return;
    if (this._options.environmentTexture instanceof ls) {
      this._scene.environmentTexture = this._options.environmentTexture;
      return;
    }
    const e = v1.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);
    this._scene.environmentTexture = e;
  }
  /**
   * Setup the background according to the specified options.
   */
  _setupBackground() {
    this._rootMesh || (this._rootMesh = new Ee("BackgroundHelper", this._scene)), this._rootMesh.rotation.y = this._options.backgroundYRotation;
    const e = this._getSceneSize();
    this._options.createGround && (this._setupGround(e), this._setupGroundMaterial(), this._setupGroundDiffuseTexture(), this._options.enableGroundMirror && this._setupGroundMirrorTexture(e), this._setupMirrorInGroundMaterial()), this._options.createSkybox && (this._setupSkybox(e), this._setupSkyboxMaterial(), this._setupSkyboxReflectionTexture()), this._rootMesh.position.x = e.rootPosition.x, this._rootMesh.position.z = e.rootPosition.z, this._rootMesh.position.y = e.rootPosition.y;
  }
  /**
   * Get the scene sizes according to the setup.
   */
  _getSceneSize() {
    let e = this._options.groundSize, t = this._options.skyboxSize, r = this._options.rootPosition;
    if (!this._scene.meshes || this._scene.meshes.length === 1)
      return { groundSize: e, skyboxSize: t, rootPosition: r };
    const n = this._scene.getWorldExtends((s) => s !== this._ground && s !== this._rootMesh && s !== this._skybox), i = n.max.subtract(n.min);
    if (this._options.sizeAuto) {
      this._scene.activeCamera instanceof ps && this._scene.activeCamera.upperRadiusLimit && (e = this._scene.activeCamera.upperRadiusLimit * 2, t = e);
      const s = i.length();
      s > e && (e = s * 2, t = e), e *= 1.1, t *= 1.5, r = n.min.add(i.scale(0.5)), r.y = n.min.y - this._options.groundYBias;
    }
    return { groundSize: e, skyboxSize: t, rootPosition: r };
  }
  /**
   * Setup the ground according to the specified options.
   * @param sceneSize
   */
  _setupGround(e) {
    (!this._ground || this._ground.isDisposed()) && (this._ground = u4("BackgroundPlane", { size: e.groundSize }, this._scene), this._ground.rotation.x = Math.PI / 2, this._ground.parent = this._rootMesh, this._ground.onDisposeObservable.add(() => {
      this._ground = null;
    })), this._ground.receiveShadows = this._options.enableGroundShadow;
  }
  /**
   * Setup the ground material according to the specified options.
   */
  _setupGroundMaterial() {
    this._groundMaterial || (this._groundMaterial = new Vi("BackgroundPlaneMaterial", this._scene)), this._groundMaterial.alpha = this._options.groundOpacity, this._groundMaterial.alphaMode = 8, this._groundMaterial.shadowLevel = this._options.groundShadowLevel, this._groundMaterial.primaryColor = this._options.groundColor, this._groundMaterial.useRGBColor = !1, this._groundMaterial.enableNoise = !0, this._ground && (this._ground.material = this._groundMaterial);
  }
  /**
   * Setup the ground diffuse texture according to the specified options.
   */
  _setupGroundDiffuseTexture() {
    if (this._groundMaterial && !this._groundTexture) {
      if (this._options.groundTexture instanceof ls) {
        this._groundMaterial.diffuseTexture = this._options.groundTexture;
        return;
      }
      this._groundTexture = new We(this._options.groundTexture, this._scene, void 0, void 0, void 0, void 0, this._errorHandler), this._groundTexture.gammaSpace = !1, this._groundTexture.hasAlpha = !0, this._groundMaterial.diffuseTexture = this._groundTexture;
    }
  }
  /**
   * Setup the ground mirror texture according to the specified options.
   * @param sceneSize
   */
  _setupGroundMirrorTexture(e) {
    const t = We.CLAMP_ADDRESSMODE;
    if (!this._groundMirror && (this._groundMirror = new uD("BackgroundPlaneMirrorTexture", { ratio: this._options.groundMirrorSizeRatio }, this._scene, !1, this._options.groundMirrorTextureType, We.BILINEAR_SAMPLINGMODE, !0), this._groundMirror.mirrorPlane = new BA(0, -1, 0, e.rootPosition.y), this._groundMirror.anisotropicFilteringLevel = 1, this._groundMirror.wrapU = t, this._groundMirror.wrapV = t, this._groundMirror.renderList))
      for (let n = 0; n < this._scene.meshes.length; n++) {
        const i = this._scene.meshes[n];
        i !== this._ground && i !== this._skybox && i !== this._rootMesh && this._groundMirror.renderList.push(i);
      }
    const r = this._options.groundColor.toGammaSpace(this._scene.getEngine().useExactSrgbConversions);
    this._groundMirror.clearColor = new xt(r.r, r.g, r.b, 1), this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;
  }
  /**
   * Setup the ground to receive the mirror texture.
   */
  _setupMirrorInGroundMaterial() {
    this._groundMaterial && (this._groundMaterial.reflectionTexture = this._groundMirror, this._groundMaterial.reflectionFresnel = !0, this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount, this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight, this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance);
  }
  /**
   * Setup the skybox according to the specified options.
   * @param sceneSize
   */
  _setupSkybox(e) {
    (!this._skybox || this._skybox.isDisposed()) && (this._skybox = k0("BackgroundSkybox", { size: e.skyboxSize, sideOrientation: Ee.BACKSIDE }, this._scene), this._skybox.onDisposeObservable.add(() => {
      this._skybox = null;
    })), this._skybox.parent = this._rootMesh;
  }
  /**
   * Setup the skybox material according to the specified options.
   */
  _setupSkyboxMaterial() {
    this._skybox && (this._skyboxMaterial || (this._skyboxMaterial = new Vi("BackgroundSkyboxMaterial", this._scene)), this._skyboxMaterial.useRGBColor = !1, this._skyboxMaterial.primaryColor = this._options.skyboxColor, this._skyboxMaterial.enableNoise = !0, this._skybox.material = this._skyboxMaterial);
  }
  /**
   * Setup the skybox reflection texture according to the specified options.
   */
  _setupSkyboxReflectionTexture() {
    if (this._skyboxMaterial && !this._skyboxTexture) {
      if (this._options.skyboxTexture instanceof ls) {
        this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture;
        return;
      }
      this._skyboxTexture = new v1(this._options.skyboxTexture, this._scene, void 0, void 0, void 0, void 0, this._errorHandler), this._skyboxTexture.coordinatesMode = We.SKYBOX_MODE, this._skyboxTexture.gammaSpace = !1, this._skyboxMaterial.reflectionTexture = this._skyboxTexture;
    }
  }
  /**
   * Dispose all the elements created by the Helper.
   */
  dispose() {
    this._groundMaterial && this._groundMaterial.dispose(!0, !0), this._skyboxMaterial && this._skyboxMaterial.dispose(!0, !0), this._rootMesh.dispose(!1);
  }
}
gD._GroundTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundGround.png";
gD._SkyboxTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundSkybox.dds";
gD._EnvironmentTextureCDNUrl = "https://assets.babylonjs.com/environments/environmentSpecular.env";
class Ou extends Hr {
  /**
   * Gets the texture being displayed on the sphere
   */
  get texture() {
    return this._texture;
  }
  /**
   * Sets the texture being displayed on the sphere
   */
  set texture(e) {
    this._texture !== e && (this._texture = e, this._useDirectMapping ? (this._texture.wrapU = We.CLAMP_ADDRESSMODE, this._texture.wrapV = We.CLAMP_ADDRESSMODE, this._material.diffuseTexture = this._texture) : (this._texture.coordinatesMode = We.FIXED_EQUIRECTANGULAR_MIRRORED_MODE, this._texture.wrapV = We.CLAMP_ADDRESSMODE, this._material.reflectionTexture = this._texture), this._changeTextureMode(this._textureMode));
  }
  /**
   * Gets the mesh used for the dome.
   */
  get mesh() {
    return this._mesh;
  }
  /**
   * The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out".
   * Also see the options.resolution property.
   */
  get fovMultiplier() {
    return this._material.fovMultiplier;
  }
  set fovMultiplier(e) {
    this._material.fovMultiplier = e;
  }
  /**
   * Gets or set the current texture mode for the texture. It can be:
   * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
   * * TextureDome.MODE_TOPBOTTOM  : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
   * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
   */
  get textureMode() {
    return this._textureMode;
  }
  /**
   * Sets the current texture mode for the texture. It can be:
   * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
   * * TextureDome.MODE_TOPBOTTOM  : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
   * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
   */
  set textureMode(e) {
    this._textureMode !== e && this._changeTextureMode(e);
  }
  /**
   * Is it a 180 degrees dome (half dome) or 360 texture (full dome)
   */
  get halfDome() {
    return this._halfDome;
  }
  /**
   * Set the halfDome mode. If set, only the front (180 degrees) will be displayed and the back will be blacked out.
   */
  set halfDome(e) {
    this._halfDome = e, this._halfDomeMask.setEnabled(e), this._changeTextureMode(this._textureMode);
  }
  /**
   * Set the cross-eye mode. If set, images that can be seen when crossing eyes will render correctly
   */
  set crossEye(e) {
    this._crossEye = e, this._changeTextureMode(this._textureMode);
  }
  /**
   * Is it a cross-eye texture?
   */
  get crossEye() {
    return this._crossEye;
  }
  /**
   * The background material of this dome.
   */
  get material() {
    return this._material;
  }
  /**
   * Create an instance of this class and pass through the parameters to the relevant classes- Texture, StandardMaterial, and Mesh.
   * @param name Element's name, child elements will append suffixes for their own names.
   * @param textureUrlOrElement defines the url(s) or the (video) HTML element to use
   * @param options An object containing optional or exposed sub element properties
   * @param options.resolution
   * @param options.clickToPlay
   * @param options.autoPlay
   * @param options.loop
   * @param options.size
   * @param options.poster
   * @param options.faceForward
   * @param options.useDirectMapping
   * @param options.halfDomeMode
   * @param options.crossEyeMode
   * @param options.generateMipMaps
   * @param options.mesh
   * @param scene
   * @param onError
   */
  constructor(e, t, r, n, i = null) {
    super(e, n), this.onError = i, this._halfDome = !1, this._crossEye = !1, this._useDirectMapping = !1, this._textureMode = Ou.MODE_MONOSCOPIC, this._onBeforeCameraRenderObserver = null, this.onLoadErrorObservable = new Oe(), this.onLoadObservable = new Oe(), n = this.getScene(), e = e || "textureDome", r.resolution = Math.abs(r.resolution) | 0 || 32, r.clickToPlay = !!r.clickToPlay, r.autoPlay = r.autoPlay === void 0 ? !0 : !!r.autoPlay, r.loop = r.loop === void 0 ? !0 : !!r.loop, r.size = Math.abs(r.size) || (n.activeCamera ? n.activeCamera.maxZ * 0.48 : 1e3), r.useDirectMapping === void 0 ? this._useDirectMapping = !0 : this._useDirectMapping = r.useDirectMapping, r.faceForward === void 0 && (r.faceForward = !0), this._setReady(!1), r.mesh ? this._mesh = r.mesh : this._mesh = UA(e + "_mesh", { segments: r.resolution, diameter: r.size, updatable: !1, sideOrientation: Ee.BACKSIDE }, n);
    const s = this._material = new Vi(e + "_material", n);
    s.useEquirectangularFOV = !0, s.fovMultiplier = 1, s.opacityFresnel = !1;
    const a = this._initTexture(t, n, r);
    if (this.texture = a, this._mesh.material = s, this._mesh.parent = this, this._halfDomeMask = UA("", { slice: 0.5, diameter: r.size * 0.98, segments: r.resolution * 2, sideOrientation: Ee.BACKSIDE }, n), this._halfDomeMask.rotate(bf.X, -Math.PI / 2), this._halfDomeMask.parent = this._mesh, this._halfDome = !!r.halfDomeMode, this._halfDomeMask.setEnabled(this._halfDome), this._crossEye = !!r.crossEyeMode, this._texture.anisotropicFilteringLevel = 1, this._texture.onLoadObservable.addOnce(() => {
      this._setReady(!0);
    }), r.faceForward && n.activeCamera) {
      const f = n.activeCamera, o = S.Forward(), d = S.TransformNormal(o, f.getViewMatrix());
      d.normalize(), this.rotation.y = Math.acos(S.Dot(o, d));
    }
    this._changeTextureMode(this._textureMode);
  }
  _changeTextureMode(e) {
    switch (this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._textureMode = e, this._texture.uScale = 1, this._texture.vScale = 1, this._texture.uOffset = 0, this._texture.vOffset = 0, this._texture.vAng = 0, e) {
      case Ou.MODE_MONOSCOPIC:
        this._halfDome && (this._texture.uScale = 2, this._texture.uOffset = -1);
        break;
      case Ou.MODE_SIDEBYSIDE: {
        this._texture.uScale = this._halfDome ? 0.99999 : 0.5;
        const t = this._halfDome ? 0 : 0.5, r = this._halfDome ? -0.5 : 0;
        this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((n) => {
          let i = n.isRightCamera;
          this._crossEye && (i = !i), i ? this._texture.uOffset = t : this._texture.uOffset = r;
        });
        break;
      }
      case Ou.MODE_TOPBOTTOM:
        this._texture.vScale = this._halfDome ? 0.99999 : 0.5, this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((t) => {
          let r = t.isRightCamera;
          this._crossEye && (r = !r), this._texture.vOffset = r ? 0.5 : 0;
        });
        break;
    }
  }
  /**
   * Releases resources associated with this node.
   * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
   * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
   */
  dispose(e, t = !1) {
    this._texture.dispose(), this._mesh.dispose(), this._material.dispose(), this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this.onLoadErrorObservable.clear(), this.onLoadObservable.clear(), super.dispose(e, t);
  }
}
Ou.MODE_MONOSCOPIC = 0;
Ou.MODE_TOPBOTTOM = 1;
Ou.MODE_SIDEBYSIDE = 2;
class US extends Ou {
  /**
   * Gets or sets the texture being displayed on the sphere
   */
  get photoTexture() {
    return this.texture;
  }
  /**
   * sets the texture being displayed on the sphere
   */
  set photoTexture(e) {
    this.texture = e;
  }
  /**
   * Gets the current video mode for the video. It can be:
   * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
   * * TextureDome.MODE_TOPBOTTOM  : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
   * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
   */
  get imageMode() {
    return this.textureMode;
  }
  /**
   * Sets the current video mode for the video. It can be:
   * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
   * * TextureDome.MODE_TOPBOTTOM  : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
   * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
   */
  set imageMode(e) {
    this.textureMode = e;
  }
  _initTexture(e, t, r) {
    return new We(e, t, !r.generateMipMaps, !this._useDirectMapping, void 0, () => {
      this.onLoadObservable.notifyObservers();
    }, (n, i) => {
      this.onLoadErrorObservable.notifyObservers(n || "Unknown error occured"), this.onError && this.onError(n, i);
    });
  }
}
US.MODE_MONOSCOPIC = Ou.MODE_MONOSCOPIC;
US.MODE_TOPBOTTOM = Ou.MODE_TOPBOTTOM;
US.MODE_SIDEBYSIDE = Ou.MODE_SIDEBYSIDE;
const TPe = "data:image/png;base64,[encoded data, 31328 characters]";
let qPe = 0;
const nV = (A) => {
  if (!A.environmentBRDFTexture) {
    const e = A.useDelayedTextureLoading;
    A.useDelayedTextureLoading = !1;
    const t = A._blockEntityCollection;
    A._blockEntityCollection = !1;
    const r = We.CreateFromBase64String(TPe, "EnvironmentBRDFTexture" + qPe++, A, !0, !1, We.BILINEAR_SAMPLINGMODE);
    A._blockEntityCollection = t;
    const n = A.getEngine().getLoadedTexturesCache(), i = n.indexOf(r.getInternalTexture());
    i !== -1 && n.splice(i, 1), r.isRGBD = !0, r.wrapU = We.CLAMP_ADDRESSMODE, r.wrapV = We.CLAMP_ADDRESSMODE, A.environmentBRDFTexture = r, A.useDelayedTextureLoading = e, $C.ExpandRGBDTexture(r);
    const s = A.getEngine().onContextRestoredObservable.add(() => {
      r.isRGBD = !0;
      const a = () => {
        r.isReady() ? $C.ExpandRGBDTexture(r) : ye.SetImmediate(a);
      };
      a();
    });
    A.onDisposeObservable.add(() => {
      A.getEngine().onContextRestoredObservable.remove(s);
    });
  }
  return A.environmentBRDFTexture;
}, bPe = {
  /**
   * Gets a default environment BRDF for MS-BRDF Height Correlated BRDF
   * @param scene defines the hosting scene
   * @returns the environment BRDF texture
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  GetEnvironmentBRDFTexture: nV
};
class xPe extends na {
  constructor() {
    super(...arguments), this.BRDF_V_HEIGHT_CORRELATED = !1, this.MS_BRDF_ENERGY_CONSERVATION = !1, this.SPHERICAL_HARMONICS = !1, this.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = !1;
  }
}
class fd extends Gl {
  /** @internal */
  _markAllSubMeshesAsMiscDirty() {
    this._internalMarkAllSubMeshesAsMiscDirty();
  }
  constructor(e, t = !0) {
    super(e, "PBRBRDF", 90, new xPe(), t), this._useEnergyConservation = fd.DEFAULT_USE_ENERGY_CONSERVATION, this.useEnergyConservation = fd.DEFAULT_USE_ENERGY_CONSERVATION, this._useSmithVisibilityHeightCorrelated = fd.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED, this.useSmithVisibilityHeightCorrelated = fd.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED, this._useSphericalHarmonics = fd.DEFAULT_USE_SPHERICAL_HARMONICS, this.useSphericalHarmonics = fd.DEFAULT_USE_SPHERICAL_HARMONICS, this._useSpecularGlossinessInputEnergyConservation = fd.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION, this.useSpecularGlossinessInputEnergyConservation = fd.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION, this._internalMarkAllSubMeshesAsMiscDirty = e._dirtyCallbacks[16], this._enable(!0);
  }
  prepareDefines(e) {
    e.BRDF_V_HEIGHT_CORRELATED = this._useSmithVisibilityHeightCorrelated, e.MS_BRDF_ENERGY_CONSERVATION = this._useEnergyConservation && this._useSmithVisibilityHeightCorrelated, e.SPHERICAL_HARMONICS = this._useSphericalHarmonics, e.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = this._useSpecularGlossinessInputEnergyConservation;
  }
  getClassName() {
    return "PBRBRDFConfiguration";
  }
}
fd.DEFAULT_USE_ENERGY_CONSERVATION = !0;
fd.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED = !0;
fd.DEFAULT_USE_SPHERICAL_HARMONICS = !0;
fd.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION = !0;
C([
  M(),
  At("_markAllSubMeshesAsMiscDirty")
], fd.prototype, "useEnergyConservation", void 0);
C([
  M(),
  At("_markAllSubMeshesAsMiscDirty")
], fd.prototype, "useSmithVisibilityHeightCorrelated", void 0);
C([
  M(),
  At("_markAllSubMeshesAsMiscDirty")
], fd.prototype, "useSphericalHarmonics", void 0);
C([
  M(),
  At("_markAllSubMeshesAsMiscDirty")
], fd.prototype, "useSpecularGlossinessInputEnergyConservation", void 0);
const DPe = "pbrFragmentDeclaration", jPe = `uniform vec4 vEyePosition;uniform vec3 vReflectionColor;uniform vec4 vAlbedoColor;uniform vec4 vLightingIntensity;uniform vec4 vReflectivityColor;uniform vec4 vMetallicReflectanceFactors;uniform vec3 vEmissiveColor;uniform float visibility;uniform vec3 vAmbientColor;
#ifdef ALBEDO
uniform vec2 vAlbedoInfos;
#endif
#ifdef AMBIENT
uniform vec4 vAmbientInfos;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;
#endif
#ifdef OPACITY
uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;
#endif
#ifdef REFLECTIVITY
uniform vec3 vReflectivityInfos;
#endif
#ifdef MICROSURFACEMAP
uniform vec2 vMicroSurfaceSamplerInfos;
#endif
#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(SS_REFRACTION) || defined(PREPASS)
uniform mat4 view;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;
#ifdef REALTIME_FILTERING
uniform vec2 vReflectionFilteringInfo;
#endif
uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;
#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)
uniform vec3 vReflectionPosition;uniform vec3 vReflectionSize; 
#endif
#endif
#if defined(SS_REFRACTION) && defined(SS_USE_LOCAL_REFRACTIONMAP_CUBIC)
uniform vec3 vRefractionPosition;uniform vec3 vRefractionSize; 
#endif
#ifdef CLEARCOAT
uniform vec2 vClearCoatParams;uniform vec4 vClearCoatRefractionParams;
#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)
uniform vec4 vClearCoatInfos;
#endif
#ifdef CLEARCOAT_TEXTURE
uniform mat4 clearCoatMatrix;
#endif
#ifdef CLEARCOAT_TEXTURE_ROUGHNESS
uniform mat4 clearCoatRoughnessMatrix;
#endif
#ifdef CLEARCOAT_BUMP
uniform vec2 vClearCoatBumpInfos;uniform vec2 vClearCoatTangentSpaceParams;uniform mat4 clearCoatBumpMatrix;
#endif
#ifdef CLEARCOAT_TINT
uniform vec4 vClearCoatTintParams;uniform float clearCoatColorAtDistance;
#ifdef CLEARCOAT_TINT_TEXTURE
uniform vec2 vClearCoatTintInfos;uniform mat4 clearCoatTintMatrix;
#endif
#endif
#endif
#ifdef IRIDESCENCE
uniform vec4 vIridescenceParams;
#if defined(IRIDESCENCE_TEXTURE) || defined(IRIDESCENCE_THICKNESS_TEXTURE)
uniform vec4 vIridescenceInfos;
#endif
#ifdef IRIDESCENCE_TEXTURE
uniform mat4 iridescenceMatrix;
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
uniform mat4 iridescenceThicknessMatrix;
#endif
#endif
#ifdef ANISOTROPIC
uniform vec3 vAnisotropy;
#ifdef ANISOTROPIC_TEXTURE
uniform vec2 vAnisotropyInfos;uniform mat4 anisotropyMatrix;
#endif
#endif
#ifdef SHEEN
uniform vec4 vSheenColor;
#ifdef SHEEN_ROUGHNESS
uniform float vSheenRoughness;
#endif
#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)
uniform vec4 vSheenInfos;
#endif
#ifdef SHEEN_TEXTURE
uniform mat4 sheenMatrix;
#endif
#ifdef SHEEN_TEXTURE_ROUGHNESS
uniform mat4 sheenRoughnessMatrix;
#endif
#endif
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
uniform vec4 vRefractionMicrosurfaceInfos;uniform vec4 vRefractionInfos;uniform mat4 refractionMatrix;
#ifdef REALTIME_FILTERING
uniform vec2 vRefractionFilteringInfo;
#endif
#ifdef SS_DISPERSION
uniform float dispersion;
#endif
#endif
#ifdef SS_THICKNESSANDMASK_TEXTURE
uniform vec2 vThicknessInfos;uniform mat4 thicknessMatrix;
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
uniform vec2 vRefractionIntensityInfos;uniform mat4 refractionIntensityMatrix;
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
uniform vec2 vTranslucencyIntensityInfos;uniform mat4 translucencyIntensityMatrix;
#endif
uniform vec2 vThicknessParam;uniform vec3 vDiffusionDistance;uniform vec4 vTintColor;uniform vec3 vSubSurfaceIntensity;
#endif
#ifdef PREPASS
#ifdef SS_SCATTERING
uniform float scatteringDiffusionProfile;
#endif
#endif
#if DEBUGMODE>0
uniform vec2 vDebugMode;
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;
#endif
#include<decalFragmentDeclaration>
#ifdef USESPHERICALFROMREFLECTIONMAP
#ifdef SPHERICAL_HARMONICS
uniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22;
#else
uniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX;
#endif
#endif
#define ADDITIONAL_FRAGMENT_DECLARATION
`;
Le.IncludesShadersStore[DPe] = jPe;
const wPe = "pbrUboDeclaration", mPe = `layout(std140,column_major) uniform;uniform Material {vec2 vAlbedoInfos;vec4 vAmbientInfos;vec2 vOpacityInfos;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec3 vReflectivityInfos;vec2 vMicroSurfaceSamplerInfos;vec2 vReflectionInfos;vec2 vReflectionFilteringInfo;vec3 vReflectionPosition;vec3 vReflectionSize;vec3 vBumpInfos;mat4 albedoMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 reflectivityMatrix;mat4 microSurfaceSamplerMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;mat4 reflectionMatrix;vec3 vReflectionColor;vec4 vAlbedoColor;vec4 vLightingIntensity;vec3 vReflectionMicrosurfaceInfos;float pointSize;vec4 vReflectivityColor;vec3 vEmissiveColor;vec3 vAmbientColor;vec2 vDebugMode;vec4 vMetallicReflectanceFactors;vec2 vMetallicReflectanceInfos;mat4 metallicReflectanceMatrix;vec2 vReflectanceInfos;mat4 reflectanceMatrix;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX;
#define ADDITIONAL_UBO_DECLARATION
};
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;
Le.IncludesShadersStore[wPe] = mPe;
const BPe = "pbrFragmentExtraDeclaration", WPe = `varying vec3 vPositionW;
#if DEBUGMODE>0
varying vec4 vClipSpacePosition;
#endif
#include<mainUVVaryingDeclaration>[1..7]
#ifdef NORMAL
varying vec3 vNormalW;
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
varying vec3 vEnvironmentIrradiance;
#endif
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
`;
Le.IncludesShadersStore[BPe] = WPe;
const SPe = "samplerFragmentAlternateDeclaration", UPe = `#ifdef _DEFINENAME_
#if _DEFINENAME_DIRECTUV==1
#define v_VARYINGNAME_UV vMainUV1
#elif _DEFINENAME_DIRECTUV==2
#define v_VARYINGNAME_UV vMainUV2
#elif _DEFINENAME_DIRECTUV==3
#define v_VARYINGNAME_UV vMainUV3
#elif _DEFINENAME_DIRECTUV==4
#define v_VARYINGNAME_UV vMainUV4
#elif _DEFINENAME_DIRECTUV==5
#define v_VARYINGNAME_UV vMainUV5
#elif _DEFINENAME_DIRECTUV==6
#define v_VARYINGNAME_UV vMainUV6
#else
varying vec2 v_VARYINGNAME_UV;
#endif
#endif
`;
Le.IncludesShadersStore[SPe] = UPe;
const IPe = "pbrFragmentSamplersDeclaration", RPe = `#include<samplerFragmentDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo)
#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)
#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)
#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)
#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_SAMPLERNAME_,reflectivity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_SAMPLERNAME_,microSurface)
#include<samplerFragmentDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_SAMPLERNAME_,metallicReflectance)
#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_SAMPLERNAME_,reflectance)
#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)
#ifdef CLEARCOAT
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_SAMPLERNAME_,clearCoat)
#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL)
uniform sampler2D clearCoatRoughnessSampler;
#endif
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_SAMPLERNAME_,clearCoatBump)
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_SAMPLERNAME_,clearCoatTint)
#endif
#ifdef IRIDESCENCE
#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_SAMPLERNAME_,iridescence)
#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_SAMPLERNAME_,iridescenceThickness)
#endif
#ifdef SHEEN
#include<samplerFragmentDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_SAMPLERNAME_,sheen)
#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)
#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL)
uniform sampler2D sheenRoughnessSampler;
#endif
#endif
#ifdef ANISOTROPIC
#include<samplerFragmentDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy)
#endif
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
#define sampleReflection(s,c) textureCube(s,c)
uniform samplerCube reflectionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)
#else
uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
#endif
#ifdef USEIRRADIANCEMAP
uniform samplerCube irradianceSampler;
#endif
#else
#define sampleReflection(s,c) texture2D(s,c)
uniform sampler2D reflectionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)
#else
uniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh;
#endif
#ifdef USEIRRADIANCEMAP
uniform sampler2D irradianceSampler;
#endif
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#endif
#endif
#ifdef ENVIRONMENTBRDF
uniform sampler2D environmentBrdfSampler;
#endif
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
#ifdef SS_REFRACTIONMAP_3D
#define sampleRefraction(s,c) textureCube(s,c)
uniform samplerCube refractionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)
#else
uniform samplerCube refractionSamplerLow;uniform samplerCube refractionSamplerHigh;
#endif
#else
#define sampleRefraction(s,c) texture2D(s,c)
uniform sampler2D refractionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)
#else
uniform sampler2D refractionSamplerLow;uniform sampler2D refractionSamplerHigh;
#endif
#endif
#endif
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_SAMPLERNAME_,thickness)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_SAMPLERNAME_,refractionIntensity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity)
#endif
`;
Le.IncludesShadersStore[IPe] = RPe;
const VPe = "subSurfaceScatteringFunctions", CPe = `bool testLightingForSSS(float diffusionProfile)
{return diffusionProfile<1.;}`;
Le.IncludesShadersStore[VPe] = CPe;
const OPe = "importanceSampling", yPe = `vec3 hemisphereCosSample(vec2 u) {float phi=2.*PI*u.x;float cosTheta2=1.-u.y;float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
vec3 hemisphereImportanceSampleDggx(vec2 u,float a) {float phi=2.*PI*u.x;float cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
vec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) { 
float phi=2.*PI*u.x;float sinTheta=pow(u.y,a/(2.*a+1.));float cosTheta=sqrt(1.-sinTheta*sinTheta);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}`;
Le.IncludesShadersStore[OPe] = yPe;
const kPe = "pbrHelperFunctions", EPe = `#define MINIMUMVARIANCE 0.0005
float convertRoughnessToAverageSlope(float roughness)
{return square(roughness)+MINIMUMVARIANCE;}
float fresnelGrazingReflectance(float reflectance0) {float reflectance90=saturate(reflectance0*25.0);return reflectance90;}
vec2 getAARoughnessFactors(vec3 normalVector) {
#ifdef SPECULARAA
vec3 nDfdx=dFdx(normalVector.xyz);vec3 nDfdy=dFdy(normalVector.xyz);float slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));float geometricRoughnessFactor=pow(saturate(slopeSquare),0.333);float geometricAlphaGFactor=sqrt(slopeSquare);geometricAlphaGFactor*=0.75;return vec2(geometricRoughnessFactor,geometricAlphaGFactor);
#else
return vec2(0.);
#endif
}
#ifdef ANISOTROPIC
#ifdef ANISOTROPIC_LEGACY
vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);float alphaB=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);return vec2(alphaT,alphaB);}
vec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy,float roughness) {vec3 anisotropicFrameDirection=anisotropy>=0.0 ? B : T;vec3 anisotropicFrameTangent=cross(normalize(anisotropicFrameDirection),V);vec3 anisotropicFrameNormal=cross(anisotropicFrameTangent,anisotropicFrameDirection);vec3 anisotropicNormal=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));return anisotropicNormal;}
#else
vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(mix(alphaG,1.0,anisotropy*anisotropy),MINIMUMVARIANCE);float alphaB=max(alphaG,MINIMUMVARIANCE);return vec2(alphaT,alphaB);}
vec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy,float roughness) {vec3 bentNormal=cross(B,V);bentNormal=normalize(cross(bentNormal,B));float a=square(square(1.0-anisotropy*(1.0-roughness)));bentNormal=normalize(mix(bentNormal,N,a));return bentNormal;}
#endif
#endif
#if defined(CLEARCOAT) || defined(SS_REFRACTION)
vec3 cocaLambert(vec3 alpha,float distance) {return exp(-alpha*distance);}
vec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {return cocaLambert(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));}
vec3 computeColorAtDistanceInMedia(vec3 color,float distance) {return -log(color)/distance;}
vec3 computeClearCoatAbsorption(float NdotVRefract,float NdotLRefract,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {vec3 clearCoatAbsorption=mix(vec3(1.0),
cocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),
clearCoatIntensity);return clearCoatAbsorption;}
#endif
#ifdef MICROSURFACEAUTOMATIC
float computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)
{const float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;float reflectivityLuminance=getLuminance(reflectivityColor);float reflectivityLuma=sqrt(reflectivityLuminance);microSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return microSurface;}
#endif
`;
Le.IncludesShadersStore[kPe] = EPe;
const FPe = "harmonicsFunctions", NPe = `#ifdef USESPHERICALFROMREFLECTIONMAP
#ifdef SPHERICAL_HARMONICS
vec3 computeEnvironmentIrradiance(vec3 normal) {return vSphericalL00
+ vSphericalL1_1*(normal.y)
+ vSphericalL10*(normal.z)
+ vSphericalL11*(normal.x)
+ vSphericalL2_2*(normal.y*normal.x)
+ vSphericalL2_1*(normal.y*normal.z)
+ vSphericalL20*((3.0*normal.z*normal.z)-1.0)
+ vSphericalL21*(normal.z*normal.x)
+ vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));}
#else
vec3 computeEnvironmentIrradiance(vec3 normal) {float Nx=normal.x;float Ny=normal.y;float Nz=normal.z;vec3 C1=vSphericalZZ.rgb;vec3 Cx=vSphericalX.rgb;vec3 Cy=vSphericalY.rgb;vec3 Cz=vSphericalZ.rgb;vec3 Cxx_zz=vSphericalXX_ZZ.rgb;vec3 Cyy_zz=vSphericalYY_ZZ.rgb;vec3 Cxy=vSphericalXY.rgb;vec3 Cyz=vSphericalYZ.rgb;vec3 Czx=vSphericalZX.rgb;vec3 a1=Cyy_zz*Ny+Cy;vec3 a2=Cyz*Nz+a1;vec3 b1=Czx*Nz+Cx;vec3 b2=Cxy*Ny+b1;vec3 b3=Cxx_zz*Nx+b2;vec3 t1=Cz *Nz+C1;vec3 t2=a2 *Ny+t1;vec3 t3=b3 *Nx+t2;return t3;}
#endif
#endif
`;
Le.IncludesShadersStore[FPe] = NPe;
const QPe = "pbrDirectLightingSetupFunctions", YPe = `struct preLightingInfo
{vec3 lightOffset;float lightDistanceSquared;float lightDistance;float attenuation;vec3 L;vec3 H;float NdotV;float NdotLUnclamped;float NdotL;float VdotH;float roughness;
#ifdef IRIDESCENCE
float iridescenceIntensity;
#endif
};preLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.lightOffset=lightData.xyz-vPositionW;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);result.L=normalize(result.lightOffset);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);return result;}
preLightingInfo computeDirectionalPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.lightDistance=length(-lightData.xyz);result.L=normalize(-lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);return result;}
preLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.NdotL=dot(N,lightData.xyz)*0.5+0.5;result.NdotL=saturateEps(result.NdotL);result.NdotLUnclamped=result.NdotL;
#ifdef SPECULARTERM
result.L=normalize(lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));
#endif
return result;}`;
Le.IncludesShadersStore[QPe] = YPe;
const MPe = "pbrDirectLightingFalloffFunctions", LPe = `float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range)
{return max(0.,1.0-length(lightOffset)/range);}
float computeDistanceLightFalloff_Physical(float lightDistanceSquared)
{return 1.0/maxEps(lightDistanceSquared);}
float computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange)
{float lightDistanceFalloff=1.0/maxEps(lightDistanceSquared);float factor=lightDistanceSquared*inverseSquaredRange;float attenuation=saturate(1.0-factor*factor);attenuation*=attenuation;lightDistanceFalloff*=attenuation;return lightDistanceFalloff;}
float computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange)
{
#ifdef USEPHYSICALLIGHTFALLOFF
return computeDistanceLightFalloff_Physical(lightDistanceSquared);
#elif defined(USEGLTFLIGHTFALLOFF)
return computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);
#else
return computeDistanceLightFalloff_Standard(lightOffset,range);
#endif
}
float computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent)
{float falloff=0.0;float cosAngle=maxEps(dot(-lightDirection,directionToLightCenterW));if (cosAngle>=cosHalfAngle)
{falloff=max(0.,pow(cosAngle,exponent));}
return falloff;}
float computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle)
{const float kMinusLog2ConeAngleIntensityRatio=6.64385618977; 
float concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);vec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);float falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));return falloff;}
float computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset)
{float cd=dot(-lightDirection,directionToLightCenterW);float falloff=saturate(cd*lightAngleScale+lightAngleOffset);falloff*=falloff;return falloff;}
float computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset)
{
#ifdef USEPHYSICALLIGHTFALLOFF
return computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);
#elif defined(USEGLTFLIGHTFALLOFF)
return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);
#else
return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);
#endif
}`;
Le.IncludesShadersStore[MPe] = LPe;
const KPe = "pbrBRDFFunctions", JPe = `#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
#ifdef MS_BRDF_ENERGY_CONSERVATION
vec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);}
#endif
#ifdef ENVIRONMENTBRDF
vec3 getBRDFLookup(float NdotV,float perceptualRoughness) {vec2 UV=vec2(NdotV,perceptualRoughness);vec4 brdfLookup=texture2D(environmentBrdfSampler,UV);
#ifdef ENVIRONMENTBRDF_RGBD
brdfLookup.rgb=fromRGBD(brdfLookup.rgba);
#endif
return brdfLookup.rgb;}
vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) {
#ifdef BRDF_V_HEIGHT_CORRELATED
vec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;
#else
vec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;
#endif
return reflectance;}
vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {
#ifdef BRDF_V_HEIGHT_CORRELATED
vec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);
#else
vec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;
#endif
return reflectance;}
#endif
/* NOT USED
#if defined(SHEEN) && defined(SHEEN_SOFTER)
float getBRDFLookupCharlieSheen(float NdotV,float perceptualRoughness)
{float c=1.0-NdotV;float c3=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));}
#endif
*/
#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)
vec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)
{float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF)
/**
* The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.
* The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table
*/
vec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {vec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;}
#endif
vec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)
{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
float fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90)
{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
#ifdef CLEARCOAT
vec3 getR0RemappedForClearCoat(vec3 f0) {
#ifdef CLEARCOAT_DEFAULTIOR
#ifdef MOBILE
return saturate(f0*(f0*0.526868+0.529324)-0.0482256);
#else
return saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);
#endif
#else
vec3 s=sqrt(f0);vec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);return square(t);
#endif
}
#endif
#ifdef IRIDESCENCE
const mat3 XYZ_TO_REC709=mat3(
3.2404542,-0.9692660, 0.0556434,
-1.5371385, 1.8760108,-0.2040259,
-0.4985314, 0.0415560, 1.0572252
);vec3 getIORTfromAirToSurfaceR0(vec3 f0) {vec3 sqrtF0=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);}
vec3 getR0fromIORs(vec3 iorT,float iorI) {return square((iorT-vec3(iorI))/(iorT+vec3(iorI)));}
float getR0fromIORs(float iorT,float iorI) {return square((iorT-iorI)/(iorT+iorI));}
vec3 evalSensitivity(float opd,vec3 shift) {float phase=2.0*PI*opd*1.0e-9;const vec3 val=vec3(5.4856e-13,4.4201e-13,5.2481e-13);const vec3 pos=vec3(1.6810e+06,1.7953e+06,2.2084e+06);const vec3 var=vec3(4.3278e+09,9.3046e+09,6.6121e+09);vec3 xyz=val*sqrt(2.0*PI*var)*cos(pos*phase+shift)*exp(-square(phase)*var);xyz.x+=9.7470e-14*sqrt(2.0*PI*4.5282e+09)*cos(2.2399e+06*phase+shift[0])*exp(-4.5282e+09*square(phase));xyz/=1.0685e-7;vec3 srgb=XYZ_TO_REC709*xyz;return srgb;}
vec3 evalIridescence(float outsideIOR,float eta2,float cosTheta1,float thinFilmThickness,vec3 baseF0) {vec3 I=vec3(1.0);float iridescenceIOR=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));float sinTheta2Sq=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));float cosTheta2Sq=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;}
float cosTheta2=sqrt(cosTheta2Sq);float R0=getR0fromIORs(iridescenceIOR,outsideIOR);float R12=fresnelSchlickGGX(cosTheta1,R0,1.);float R21=R12;float T121=1.0-R12;float phi12=0.0;if (iridescenceIOR<outsideIOR) phi12=PI;float phi21=PI-phi12;vec3 baseIOR=getIORTfromAirToSurfaceR0(clamp(baseF0,0.0,0.9999)); 
vec3 R1=getR0fromIORs(baseIOR,iridescenceIOR);vec3 R23=fresnelSchlickGGX(cosTheta2,R1,vec3(1.));vec3 phi23=vec3(0.0);if (baseIOR[0]<iridescenceIOR) phi23[0]=PI;if (baseIOR[1]<iridescenceIOR) phi23[1]=PI;if (baseIOR[2]<iridescenceIOR) phi23[2]=PI;float opd=2.0*iridescenceIOR*thinFilmThickness*cosTheta2;vec3 phi=vec3(phi21)+phi23;vec3 R123=clamp(R12*R23,1e-5,0.9999);vec3 r123=sqrt(R123);vec3 Rs=square(T121)*R23/(vec3(1.0)-R123);vec3 C0=R12+Rs;I=C0;vec3 Cm=Rs-T121;for (int m=1; m<=2; ++m)
{Cm*=r123;vec3 Sm=2.0*evalSensitivity(float(m)*opd,float(m)*phi);I+=Cm*Sm;}
return max(I,vec3(0.0));}
#endif
float normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)
{float a2=square(alphaG);float d=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);}
#ifdef SHEEN
float normalDistributionFunction_CharlieSheen(float NdotH,float alphaG)
{float invR=1./alphaG;float cos2h=NdotH*NdotH;float sin2h=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);}
#endif
#ifdef ANISOTROPIC
float normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH,float TdotH,float BdotH,const vec2 alphaTB) {float a2=alphaTB.x*alphaTB.y;vec3 v=vec3(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);float v2=dot(v,v);float w2=a2/v2;return a2*w2*w2*RECIPROCAL_PI;}
#endif
#ifdef BRDF_V_HEIGHT_CORRELATED
float smithVisibility_GGXCorrelated(float NdotL,float NdotV,float alphaG) {
#ifdef MOBILE
float GGXV=NdotL*(NdotV*(1.0-alphaG)+alphaG);float GGXL=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL);
#else
float a2=alphaG*alphaG;float GGXV=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);float GGXL=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);return 0.5/(GGXV+GGXL);
#endif
}
#else
float smithVisibilityG1_TrowbridgeReitzGGXFast(float dot,float alphaG)
{
#ifdef MOBILE
return 1.0/(dot+alphaG+(1.0-alphaG)*dot ));
#else
float alphaSquared=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));
#endif
}
float smithVisibility_TrowbridgeReitzGGXFast(float NdotL,float NdotV,float alphaG)
{float visibility=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;}
#endif
#ifdef ANISOTROPIC
float smithVisibility_GGXCorrelated_Anisotropic(float NdotL,float NdotV,float TdotV,float BdotV,float TdotL,float BdotL,const vec2 alphaTB) {float lambdaV=NdotL*length(vec3(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));float lambdaL=NdotV*length(vec3(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));float v=0.5/(lambdaV+lambdaL);return v;}
#endif
#ifdef CLEARCOAT
float visibility_Kelemen(float VdotH) {return 0.25/(VdotH*VdotH); }
#endif
#ifdef SHEEN
float visibility_Ashikhmin(float NdotL,float NdotV)
{return 1./(4.*(NdotL+NdotV-NdotL*NdotV));}
/* NOT USED
#ifdef SHEEN_SOFTER
float l(float x,float alphaG)
{float oneMinusAlphaSq=(1.0-alphaG)*(1.0-alphaG);float a=mix(21.5473,25.3245,oneMinusAlphaSq);float b=mix(3.82987,3.32435,oneMinusAlphaSq);float c=mix(0.19823,0.16801,oneMinusAlphaSq);float d=mix(-1.97760,-1.27393,oneMinusAlphaSq);float e=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;}
float lambdaSheen(float cosTheta,float alphaG)
{return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));}
float visibility_CharlieSheen(float NdotL,float NdotV,float alphaG)
{float G=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);}
#endif
*/
#endif
float diffuseBRDF_Burley(float NdotL,float NdotV,float VdotH,float roughness) {float diffuseFresnelNV=pow5(saturateEps(1.0-NdotL));float diffuseFresnelNL=pow5(saturateEps(1.0-NdotV));float diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;float fresnel =
(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *
(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;}
#ifdef SS_TRANSLUCENCY
vec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {vec3 S=1./maxEps(diffusionDistance);vec3 temp=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);}
float computeWrappedDiffuseNdotL(float NdotL,float w) {float t=1.0+w;float invt2=1.0/square(t);return saturate((NdotL+w)*invt2);}
#endif
`;
Le.IncludesShadersStore[KPe] = JPe;
const zPe = "hdrFilteringFunctions", GPe = `#ifdef NUM_SAMPLES
#if NUM_SAMPLES>0
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
float radicalInverse_VdC(uint bits) 
{bits=(bits<<16u) | (bits>>16u);bits=((bits & 0x55555555u)<<1u) | ((bits & 0xAAAAAAAAu)>>1u);bits=((bits & 0x33333333u)<<2u) | ((bits & 0xCCCCCCCCu)>>2u);bits=((bits & 0x0F0F0F0Fu)<<4u) | ((bits & 0xF0F0F0F0u)>>4u);bits=((bits & 0x00FF00FFu)<<8u) | ((bits & 0xFF00FF00u)>>8u);return float(bits)*2.3283064365386963e-10; }
vec2 hammersley(uint i,uint N)
{return vec2(float(i)/float(N),radicalInverse_VdC(i));}
#else
float vanDerCorpus(int n,int base)
{float invBase=1.0/float(base);float denom =1.0;float result =0.0;for(int i=0; i<32; ++i)
{if(n>0)
{denom =mod(float(n),2.0);result+=denom*invBase;invBase=invBase/2.0;n =int(float(n)/2.0);}}
return result;}
vec2 hammersley(int i,int N)
{return vec2(float(i)/float(N),vanDerCorpus(i,2));}
#endif
float log4(float x) {return log2(x)/2.;}
const float NUM_SAMPLES_FLOAT=float(NUM_SAMPLES);const float NUM_SAMPLES_FLOAT_INVERSED=1./NUM_SAMPLES_FLOAT;const float K=4.;
#define inline
vec3 irradiance(samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)
{vec3 n=normalize(inputN);vec3 result=vec3(0.0);vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);tangent=normalize(cross(tangent,n));vec3 bitangent=cross(n,tangent);mat3 tbn=mat3(tangent,bitangent,n);float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float omegaP=(4.*PI)/(6.*dim0*dim0);
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
for(uint i=0u; i<NUM_SAMPLES; ++i)
#else
for(int i=0; i<NUM_SAMPLES; ++i)
#endif
{vec2 Xi=hammersley(i,NUM_SAMPLES);vec3 Ls=hemisphereCosSample(Xi);Ls=normalize(Ls);vec3 Ns=vec3(0.,0.,1.);float NoL=dot(Ns,Ls);if (NoL>0.) {float pdf_inversed=PI/NoL;float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(l,0.0,maxLevel);vec3 c=textureCubeLodEXT(inputTexture,tbn*Ls,mipLevel).rgb;
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
result+=c;}}
result=result*NUM_SAMPLES_FLOAT_INVERSED;return result;}
#define inline
vec3 radiance(float alphaG,samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)
{vec3 n=normalize(inputN);vec3 c=textureCube(inputTexture,n).rgb; 
if (alphaG==0.) {
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
return c;} else {vec3 result=vec3(0.);vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);tangent=normalize(cross(tangent,n));vec3 bitangent=cross(n,tangent);mat3 tbn=mat3(tangent,bitangent,n);float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float omegaP=(4.*PI)/(6.*dim0*dim0);float weight=0.;
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
for(uint i=0u; i<NUM_SAMPLES; ++i)
#else
for(int i=0; i<NUM_SAMPLES; ++i)
#endif
{vec2 Xi=hammersley(i,NUM_SAMPLES);vec3 H=hemisphereImportanceSampleDggx(Xi,alphaG);float NoV=1.;float NoH=H.z;float NoH2=H.z*H.z;float NoL=2.*NoH2-1.;vec3 L=vec3(2.*NoH*H.x,2.*NoH*H.y,NoL);L=normalize(L);if (NoL>0.) {float pdf_inversed=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(float(l),0.0,maxLevel);weight+=NoL;vec3 c=textureCubeLodEXT(inputTexture,tbn*L,mipLevel).rgb;
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
result+=c*NoL;}}
result=result/weight;return result;}}
#endif
#endif
`;
Le.IncludesShadersStore[zPe] = GPe;
const ZPe = "pbrDirectLightingFunctions", _Pe = `#define CLEARCOATREFLECTANCE90 1.0
struct lightingInfo
{vec3 diffuse;
#ifdef SPECULARTERM
vec3 specular;
#endif
#ifdef CLEARCOAT
vec4 clearCoat;
#endif
#ifdef SHEEN
vec3 sheen;
#endif
};float adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance) {
#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)
float lightRoughness=lightRadius/lightDistance;float totalRoughness=saturate(lightRoughness+roughness);return totalRoughness;
#else
return roughness;
#endif
}
vec3 computeHemisphericDiffuseLighting(preLightingInfo info,vec3 lightColor,vec3 groundColor) {return mix(groundColor,lightColor,info.NdotL);}
vec3 computeDiffuseLighting(preLightingInfo info,vec3 lightColor) {float diffuseTerm=diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness);return diffuseTerm*info.attenuation*info.NdotL*lightColor;}
#define inline
vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){vec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return toLinearSpace(textureColor);}
#ifdef SS_TRANSLUCENCY
vec3 computeDiffuseAndTransmittedLighting(preLightingInfo info,vec3 lightColor,vec3 transmittance) {float NdotL=absEps(info.NdotLUnclamped);float wrapNdotL=computeWrappedDiffuseNdotL(NdotL,0.02);float trAdapt=step(0.,info.NdotLUnclamped);vec3 transmittanceNdotL=mix(transmittance*wrapNdotL,vec3(wrapNdotL),trAdapt);float diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);return diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;}
#endif
#ifdef SPECULARTERM
vec3 computeSpecularLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float roughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(roughness);vec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);
#ifdef IRIDESCENCE
fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);
#endif
float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);
#ifdef BRDF_V_HEIGHT_CORRELATED
float smithVisibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);
#else
float smithVisibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);
#endif
vec3 specTerm=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}
#endif
#ifdef ANISOTROPIC
vec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float TdotH=dot(T,info.H);float BdotH=dot(B,info.H);float TdotV=dot(T,V);float BdotV=dot(B,V);float TdotL=dot(T,info.L);float BdotL=dot(B,info.L);float alphaG=convertRoughnessToAverageSlope(info.roughness);vec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);alphaTB=max(alphaTB,square(geometricRoughnessFactor));vec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);
#ifdef IRIDESCENCE
fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);
#endif
float distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);float smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);vec3 specTerm=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}
#endif
#ifdef CLEARCOAT
vec4 computeClearCoatLighting(preLightingInfo info,vec3 Ncc,float geometricRoughnessFactor,float clearCoatIntensity,vec3 lightColor) {float NccdotL=saturateEps(dot(Ncc,info.L));float NccdotH=saturateEps(dot(Ncc,info.H));float clearCoatRoughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(clearCoatRoughness);float fresnel=fresnelSchlickGGX(info.VdotH,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnel*=clearCoatIntensity;float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);float kelemenVisibility=visibility_Kelemen(info.VdotH);float clearCoatTerm=fresnel*distribution*kelemenVisibility;return vec4(
clearCoatTerm*info.attenuation*NccdotL*lightColor,
1.0-fresnel
);}
vec3 computeClearCoatLightingAbsorption(float NdotVRefract,vec3 L,vec3 Ncc,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {vec3 LRefract=-refract(L,Ncc,vClearCoatRefractionParams.y);float NdotLRefract=saturateEps(dot(Ncc,LRefract));vec3 absorption=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);return absorption;}
#endif
#ifdef SHEEN
vec3 computeSheenLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float roughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(roughness);float fresnel=1.;float distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);/*#ifdef SHEEN_SOFTER
float visibility=visibility_CharlieSheen(info.NdotL,info.NdotV,alphaG);
#else */
float visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);/* #endif */
float sheenTerm=fresnel*distribution*visibility;return sheenTerm*info.attenuation*info.NdotL*lightColor;}
#endif
`;
Le.IncludesShadersStore[ZPe] = _Pe;
const $Pe = "pbrIBLFunctions", ece = `#if defined(REFLECTION) || defined(SS_REFRACTION)
float getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {float microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;float lod=log2(microsurfaceAverageSlopeTexels);return lod;}
float getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {float lod=log2(cubeMapDimensionPixels)*roughness;return lod;}
#endif
#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)
float environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {float temp=NdotVUnclamped+ambientOcclusion;return saturate(square(temp)-1.0+ambientOcclusion);}
#endif
#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)
float environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {vec3 reflection=reflect(view,normal);float temp=saturate(1.0+1.1*dot(reflection,geometricNormal));return square(temp);}
#endif
#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)
#define UNPACK_LOD(x) (1.0-x)*255.0
float getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {float microsurfaceAverageSlope=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}
#endif
`;
Le.IncludesShadersStore[$Pe] = ece;
const tce = "pbrBlockAlbedoOpacity", rce = `struct albedoOpacityOutParams
{vec3 surfaceAlbedo;float alpha;};
#define pbr_inline
void albedoOpacityBlock(
in vec4 vAlbedoColor,
#ifdef ALBEDO
in vec4 albedoTexture,
in vec2 albedoInfos,
#endif
#ifdef OPACITY
in vec4 opacityMap,
in vec2 vOpacityInfos,
#endif
#ifdef DETAIL
in vec4 detailColor,
in vec4 vDetailInfos,
#endif
#ifdef DECAL
in vec4 decalColor,
in vec4 vDecalInfos,
#endif
out albedoOpacityOutParams outParams
)
{vec3 surfaceAlbedo=vAlbedoColor.rgb;float alpha=vAlbedoColor.a;
#ifdef ALBEDO
#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)
alpha*=albedoTexture.a;
#endif
#ifdef GAMMAALBEDO
surfaceAlbedo*=toLinearSpace(albedoTexture.rgb);
#else
surfaceAlbedo*=albedoTexture.rgb;
#endif
surfaceAlbedo*=albedoInfos.y;
#endif
#ifndef DECAL_AFTER_DETAIL
#include<decalFragment>
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
surfaceAlbedo*=vColor.rgb;
#endif
#ifdef DETAIL
float detailAlbedo=2.0*mix(0.5,detailColor.r,vDetailInfos.y);surfaceAlbedo.rgb=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo; 
#endif
#ifdef DECAL_AFTER_DETAIL
#include<decalFragment>
#endif
#define CUSTOM_FRAGMENT_UPDATE_ALBEDO
#ifdef OPACITY
#ifdef OPACITYRGB
alpha=getLuminance(opacityMap.rgb);
#else
alpha*=opacityMap.a;
#endif
alpha*=vOpacityInfos.y;
#endif
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)
#ifdef ALPHATEST 
#if DEBUGMODE != 88
if (alpha<ALPHATESTVALUE)
discard;
#endif
#ifndef ALPHABLEND
alpha=1.0;
#endif
#endif
#endif
outParams.surfaceAlbedo=surfaceAlbedo;outParams.alpha=alpha;}
`;
Le.IncludesShadersStore[tce] = rce;
const nce = "pbrBlockReflectivity", ice = `struct reflectivityOutParams
{float microSurface;float roughness;vec3 surfaceReflectivityColor;
#ifdef METALLICWORKFLOW
vec3 surfaceAlbedo;
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
vec3 ambientOcclusionColor;
#endif
#if DEBUGMODE>0
#ifdef METALLICWORKFLOW
vec2 metallicRoughness;
#ifdef REFLECTIVITY
vec4 surfaceMetallicColorMap;
#endif
#ifndef FROSTBITE_REFLECTANCE
vec3 metallicF0;
#endif
#else
#ifdef REFLECTIVITY
vec4 surfaceReflectivityColorMap;
#endif
#endif
#endif
};
#define pbr_inline
void reflectivityBlock(
in vec4 vReflectivityColor,
#ifdef METALLICWORKFLOW
in vec3 surfaceAlbedo,
in vec4 metallicReflectanceFactors,
#endif
#ifdef REFLECTIVITY
in vec3 reflectivityInfos,
in vec4 surfaceMetallicOrReflectivityColorMap,
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
in vec3 ambientOcclusionColorIn,
#endif
#ifdef MICROSURFACEMAP
in vec4 microSurfaceTexel,
#endif
#ifdef DETAIL
in vec4 detailColor,
in vec4 vDetailInfos,
#endif
out reflectivityOutParams outParams
)
{float microSurface=vReflectivityColor.a;vec3 surfaceReflectivityColor=vReflectivityColor.rgb;
#ifdef METALLICWORKFLOW
vec2 metallicRoughness=surfaceReflectivityColor.rg;
#ifdef REFLECTIVITY
#if DEBUGMODE>0
outParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;
#endif
#ifdef AOSTOREINMETALMAPRED
vec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);outParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);
#endif
#ifdef METALLNESSSTOREINMETALMAPBLUE
metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;
#else
metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;
#endif
#ifdef ROUGHNESSSTOREINMETALMAPALPHA
metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;
#else
#ifdef ROUGHNESSSTOREINMETALMAPGREEN
metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;
#endif
#endif
#endif
#ifdef DETAIL
float detailRoughness=mix(0.5,detailColor.b,vDetailInfos.w);float loLerp=mix(0.,metallicRoughness.g,detailRoughness*2.);float hiLerp=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);metallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));
#endif
#ifdef MICROSURFACEMAP
metallicRoughness.g*=microSurfaceTexel.r;
#endif
#if DEBUGMODE>0
outParams.metallicRoughness=metallicRoughness;
#endif
#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS
microSurface=1.0-metallicRoughness.g;vec3 baseColor=surfaceAlbedo;
#ifdef FROSTBITE_REFLECTANCE
outParams.surfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);surfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);
#else
vec3 metallicF0=metallicReflectanceFactors.rgb;
#if DEBUGMODE>0
outParams.metallicF0=metallicF0;
#endif
outParams.surfaceAlbedo=mix(baseColor.rgb*(1.0-metallicF0),vec3(0.,0.,0.),metallicRoughness.r);surfaceReflectivityColor=mix(metallicF0,baseColor,metallicRoughness.r);
#endif
#else
#ifdef REFLECTIVITY
surfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;
#if DEBUGMODE>0
outParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;
#endif
#ifdef MICROSURFACEFROMREFLECTIVITYMAP
microSurface*=surfaceMetallicOrReflectivityColorMap.a;microSurface*=reflectivityInfos.z;
#else
#ifdef MICROSURFACEAUTOMATIC
microSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);
#endif
#ifdef MICROSURFACEMAP
microSurface*=microSurfaceTexel.r;
#endif
#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE
#endif
#endif
#endif
microSurface=saturate(microSurface);float roughness=1.-microSurface;outParams.microSurface=microSurface;outParams.roughness=roughness;outParams.surfaceReflectivityColor=surfaceReflectivityColor;}
`;
Le.IncludesShadersStore[nce] = ice;
const sce = "pbrBlockAmbientOcclusion", ace = `struct ambientOcclusionOutParams
{vec3 ambientOcclusionColor;
#if DEBUGMODE>0 && defined(AMBIENT)
vec3 ambientOcclusionColorMap;
#endif
};
#define pbr_inline
void ambientOcclusionBlock(
#ifdef AMBIENT
in vec3 ambientOcclusionColorMap_,
in vec4 vAmbientInfos,
#endif
out ambientOcclusionOutParams outParams
)
{vec3 ambientOcclusionColor=vec3(1.,1.,1.);
#ifdef AMBIENT
vec3 ambientOcclusionColorMap=ambientOcclusionColorMap_*vAmbientInfos.y;
#ifdef AMBIENTINGRAYSCALE
ambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);
#endif
ambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);
#if DEBUGMODE>0
outParams.ambientOcclusionColorMap=ambientOcclusionColorMap;
#endif
#endif
outParams.ambientOcclusionColor=ambientOcclusionColor;}
`;
Le.IncludesShadersStore[sce] = ace;
const oce = "pbrBlockAlphaFresnel", fce = `#ifdef ALPHAFRESNEL
#if defined(ALPHATEST) || defined(ALPHABLEND)
struct alphaFresnelOutParams
{float alpha;};
#define pbr_inline
void alphaFresnelBlock(
in vec3 normalW,
in vec3 viewDirectionW,
in float alpha,
in float microSurface,
out alphaFresnelOutParams outParams
)
{float opacityPerceptual=alpha;
#ifdef LINEARALPHAFRESNEL
float opacity0=opacityPerceptual;
#else
float opacity0=opacityPerceptual*opacityPerceptual;
#endif
float opacity90=fresnelGrazingReflectance(opacity0);vec3 normalForward=faceforward(normalW,-viewDirectionW,normalW);outParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x;
#ifdef ALPHATEST
if (outParams.alpha<ALPHATESTVALUE)
discard;
#ifndef ALPHABLEND
outParams.alpha=1.0;
#endif
#endif
}
#endif
#endif
`;
Le.IncludesShadersStore[oce] = fce;
const Ace = "pbrBlockAnisotropic", dce = `#ifdef ANISOTROPIC
struct anisotropicOutParams
{float anisotropy;vec3 anisotropicTangent;vec3 anisotropicBitangent;vec3 anisotropicNormal;
#if DEBUGMODE>0 && defined(ANISOTROPIC_TEXTURE)
vec3 anisotropyMapData;
#endif
};
#define pbr_inline
void anisotropicBlock(
in vec3 vAnisotropy,
in float roughness,
#ifdef ANISOTROPIC_TEXTURE
in vec3 anisotropyMapData,
#endif
in mat3 TBN,
in vec3 normalW,
in vec3 viewDirectionW,
out anisotropicOutParams outParams
)
{float anisotropy=vAnisotropy.b;vec3 anisotropyDirection=vec3(vAnisotropy.xy,0.);
#ifdef ANISOTROPIC_TEXTURE
anisotropy*=anisotropyMapData.b;
#if DEBUGMODE>0
outParams.anisotropyMapData=anisotropyMapData;
#endif
anisotropyMapData.rg=anisotropyMapData.rg*2.0-1.0;
#ifdef ANISOTROPIC_LEGACY
anisotropyDirection.rg*=anisotropyMapData.rg;
#else
anisotropyDirection.xy=mat2(anisotropyDirection.x,anisotropyDirection.y,-anisotropyDirection.y,anisotropyDirection.x)*normalize(anisotropyMapData.rg);
#endif
#endif
mat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));vec3 anisotropicTangent=normalize(anisoTBN*anisotropyDirection);vec3 anisotropicBitangent=normalize(cross(anisoTBN[2],anisotropicTangent));outParams.anisotropy=anisotropy;outParams.anisotropicTangent=anisotropicTangent;outParams.anisotropicBitangent=anisotropicBitangent;outParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy,roughness);}
#endif
`;
Le.IncludesShadersStore[Ace] = dce;
const vce = "pbrBlockReflection", uce = `#ifdef REFLECTION
struct reflectionOutParams
{vec4 environmentRadiance;vec3 environmentIrradiance;
#ifdef REFLECTIONMAP_3D
vec3 reflectionCoords;
#else
vec2 reflectionCoords;
#endif
#ifdef SS_TRANSLUCENCY
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
vec3 irradianceVector;
#endif
#endif
#endif
};
#define pbr_inline
void createReflectionCoords(
in vec3 vPositionW,
in vec3 normalW,
#ifdef ANISOTROPIC
in anisotropicOutParams anisotropicOut,
#endif
#ifdef REFLECTIONMAP_3D
out vec3 reflectionCoords
#else
out vec2 reflectionCoords
#endif
)
{
#ifdef ANISOTROPIC
vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),anisotropicOut.anisotropicNormal);
#else
vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
reflectionCoords=reflectionVector;
#else
reflectionCoords=reflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
reflectionCoords/=reflectionVector.z;
#endif
reflectionCoords.y=1.0-reflectionCoords.y;
#endif
}
#define pbr_inline
#define inline
void sampleReflectionTexture(
in float alphaG,
in vec3 vReflectionMicrosurfaceInfos,
in vec2 vReflectionInfos,
in vec3 vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
in float NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
in float roughness,
#endif
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSampler,
const vec3 reflectionCoords,
#else
in sampler2D reflectionSampler,
const vec2 reflectionCoords,
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSamplerLow,
in samplerCube reflectionSamplerHigh,
#else
in sampler2D reflectionSamplerLow,
in sampler2D reflectionSamplerHigh,
#endif
#endif
#ifdef REALTIME_FILTERING
in vec2 vReflectionFilteringInfo,
#endif
out vec4 environmentRadiance
)
{
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);
#elif defined(LINEARSPECULARREFLECTION)
float reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);
#else
float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);
#endif
#ifdef LODBASEDMICROSFURACE
reflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;
#ifdef LODINREFLECTIONALPHA
float automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);float requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD);
#else
float requestedReflectionLOD=reflectionLOD;
#endif
#ifdef REALTIME_FILTERING
environmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);
#else
environmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);
#endif
#else
float lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 environmentMid=sampleReflection(reflectionSampler,reflectionCoords);if (lodReflectionNormalizedDoubled<1.0){environmentRadiance=mix(
sampleReflection(reflectionSamplerHigh,reflectionCoords),
environmentMid,
lodReflectionNormalizedDoubled
);} else {environmentRadiance=mix(
environmentMid,
sampleReflection(reflectionSamplerLow,reflectionCoords),
lodReflectionNormalizedDoubled-1.0
);}
#endif
#ifdef RGBDREFLECTION
environmentRadiance.rgb=fromRGBD(environmentRadiance);
#endif
#ifdef GAMMAREFLECTION
environmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);
#endif
environmentRadiance.rgb*=vReflectionInfos.x;environmentRadiance.rgb*=vReflectionColor.rgb;}
#define pbr_inline
#define inline
void reflectionBlock(
in vec3 vPositionW,
in vec3 normalW,
in float alphaG,
in vec3 vReflectionMicrosurfaceInfos,
in vec2 vReflectionInfos,
in vec3 vReflectionColor,
#ifdef ANISOTROPIC
in anisotropicOutParams anisotropicOut,
#endif
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
in float NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
in float roughness,
#endif
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSampler,
#else
in sampler2D reflectionSampler,
#endif
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
in vec3 vEnvironmentIrradiance,
#endif
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
in mat4 reflectionMatrix,
#endif
#endif
#ifdef USEIRRADIANCEMAP
#ifdef REFLECTIONMAP_3D
in samplerCube irradianceSampler,
#else
in sampler2D irradianceSampler,
#endif
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSamplerLow,
in samplerCube reflectionSamplerHigh,
#else
in sampler2D reflectionSamplerLow,
in sampler2D reflectionSamplerHigh,
#endif
#endif
#ifdef REALTIME_FILTERING
in vec2 vReflectionFilteringInfo,
#endif
out reflectionOutParams outParams
)
{vec4 environmentRadiance=vec4(0.,0.,0.,0.);
#ifdef REFLECTIONMAP_3D
vec3 reflectionCoords=vec3(0.);
#else
vec2 reflectionCoords=vec2(0.);
#endif
createReflectionCoords(
vPositionW,
normalW,
#ifdef ANISOTROPIC
anisotropicOut,
#endif
reflectionCoords
);sampleReflectionTexture(
alphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
roughness,
#endif
#ifdef REFLECTIONMAP_3D
reflectionSampler,
reflectionCoords,
#else
reflectionSampler,
reflectionCoords,
#endif
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
environmentRadiance
);vec3 environmentIrradiance=vec3(0.,0.,0.);
#ifdef USESPHERICALFROMREFLECTIONMAP
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
environmentIrradiance=vEnvironmentIrradiance;
#else
#ifdef ANISOTROPIC
vec3 irradianceVector=vec3(reflectionMatrix*vec4(anisotropicOut.anisotropicNormal,0)).xyz;
#else
vec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
irradianceVector.z*=-1.0;
#endif
#ifdef INVERTCUBICMAP
irradianceVector.y*=-1.0;
#endif
#if defined(REALTIME_FILTERING)
environmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo);
#else
environmentIrradiance=computeEnvironmentIrradiance(irradianceVector);
#endif
#ifdef SS_TRANSLUCENCY
outParams.irradianceVector=irradianceVector;
#endif
#endif
#elif defined(USEIRRADIANCEMAP)
vec4 environmentIrradiance4=sampleReflection(irradianceSampler,reflectionCoords);environmentIrradiance=environmentIrradiance4.rgb;
#ifdef RGBDREFLECTION
environmentIrradiance.rgb=fromRGBD(environmentIrradiance4);
#endif
#ifdef GAMMAREFLECTION
environmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);
#endif
#endif
environmentIrradiance*=vReflectionColor.rgb;outParams.environmentRadiance=environmentRadiance;outParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;}
#endif
`;
Le.IncludesShadersStore[vce] = uce;
const lce = "pbrBlockSheen", Pce = `#ifdef SHEEN
struct sheenOutParams
{float sheenIntensity;vec3 sheenColor;float sheenRoughness;
#ifdef SHEEN_LINKWITHALBEDO
vec3 surfaceAlbedo;
#endif
#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
float sheenAlbedoScaling;
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
vec3 finalSheenRadianceScaled;
#endif
#if DEBUGMODE>0
#ifdef SHEEN_TEXTURE
vec4 sheenMapData;
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
vec3 sheenEnvironmentReflectance;
#endif
#endif
};
#define pbr_inline
#define inline
void sheenBlock(
in vec4 vSheenColor,
#ifdef SHEEN_ROUGHNESS
in float vSheenRoughness,
#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
in vec4 sheenMapRoughnessData,
#endif
#endif
in float roughness,
#ifdef SHEEN_TEXTURE
in vec4 sheenMapData,
in float sheenMapLevel,
#endif
in float reflectance,
#ifdef SHEEN_LINKWITHALBEDO
in vec3 baseColor,
in vec3 surfaceAlbedo,
#endif
#ifdef ENVIRONMENTBRDF
in float NdotV,
in vec3 environmentBrdf,
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
in vec2 AARoughnessFactors,
in vec3 vReflectionMicrosurfaceInfos,
in vec2 vReflectionInfos,
in vec3 vReflectionColor,
in vec4 vLightingIntensity,
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSampler,
in vec3 reflectionCoords,
#else
in sampler2D reflectionSampler,
in vec2 reflectionCoords,
#endif
in float NdotVUnclamped,
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSamplerLow,
in samplerCube reflectionSamplerHigh,
#else
in sampler2D reflectionSamplerLow,
in sampler2D reflectionSamplerHigh,
#endif
#endif
#ifdef REALTIME_FILTERING
in vec2 vReflectionFilteringInfo,
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
in float seo,
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
in float eho,
#endif
#endif
out sheenOutParams outParams
)
{float sheenIntensity=vSheenColor.a;
#ifdef SHEEN_TEXTURE
#if DEBUGMODE>0
outParams.sheenMapData=sheenMapData;
#endif
#endif
#ifdef SHEEN_LINKWITHALBEDO
float sheenFactor=pow5(1.0-sheenIntensity);vec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);float sheenRoughness=sheenIntensity;outParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;
#ifdef SHEEN_TEXTURE
sheenIntensity*=sheenMapData.a;
#endif
#else
vec3 sheenColor=vSheenColor.rgb;
#ifdef SHEEN_TEXTURE
#ifdef SHEEN_GAMMATEXTURE
sheenColor.rgb*=toLinearSpace(sheenMapData.rgb);
#else
sheenColor.rgb*=sheenMapData.rgb;
#endif
sheenColor.rgb*=sheenMapLevel;
#endif
#ifdef SHEEN_ROUGHNESS
float sheenRoughness=vSheenRoughness;
#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE
#if defined(SHEEN_TEXTURE)
sheenRoughness*=sheenMapData.a;
#endif
#elif defined(SHEEN_TEXTURE_ROUGHNESS)
#ifdef SHEEN_TEXTURE_ROUGHNESS_IDENTICAL
sheenRoughness*=sheenMapData.a;
#else
sheenRoughness*=sheenMapRoughnessData.a;
#endif
#endif
#else
float sheenRoughness=roughness;
#ifdef SHEEN_TEXTURE
sheenIntensity*=sheenMapData.a;
#endif
#endif
#if !defined(SHEEN_ALBEDOSCALING)
sheenIntensity*=(1.-reflectance);
#endif
sheenColor*=sheenIntensity;
#endif
#ifdef ENVIRONMENTBRDF
/*#ifdef SHEEN_SOFTER
vec3 environmentSheenBrdf=vec3(0.,0.,getBRDFLookupCharlieSheen(NdotV,sheenRoughness));
#else*/
#ifdef SHEEN_ROUGHNESS
vec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness);
#else
vec3 environmentSheenBrdf=environmentBrdf;
#endif
/*#endif*/
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
float sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);
#ifdef SPECULARAA
sheenAlphaG+=AARoughnessFactors.y;
#endif
vec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);sampleReflectionTexture(
sheenAlphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
sheenRoughness,
#endif
reflectionSampler,
reflectionCoords,
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
environmentSheenRadiance
);vec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
sheenEnvironmentReflectance*=seo;
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
sheenEnvironmentReflectance*=eho;
#endif
#if DEBUGMODE>0
outParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;
#endif
outParams.finalSheenRadianceScaled=
environmentSheenRadiance.rgb *
sheenEnvironmentReflectance *
vLightingIntensity.z;
#endif
#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
outParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;
#endif
outParams.sheenIntensity=sheenIntensity;outParams.sheenColor=sheenColor;outParams.sheenRoughness=sheenRoughness;}
#endif
`;
Le.IncludesShadersStore[lce] = Pce;
const cce = "pbrBlockClearcoat", pce = `struct clearcoatOutParams
{vec3 specularEnvironmentR0;float conservationFactor;vec3 clearCoatNormalW;vec2 clearCoatAARoughnessFactors;float clearCoatIntensity;float clearCoatRoughness;
#ifdef REFLECTION
vec3 finalClearCoatRadianceScaled;
#endif
#ifdef CLEARCOAT_TINT
vec3 absorption;float clearCoatNdotVRefract;vec3 clearCoatColor;float clearCoatThickness;
#endif
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
vec3 energyConservationFactorClearCoat;
#endif
#if DEBUGMODE>0
#ifdef CLEARCOAT_BUMP
mat3 TBNClearCoat;
#endif
#ifdef CLEARCOAT_TEXTURE
vec2 clearCoatMapData;
#endif
#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
vec4 clearCoatTintMapData;
#endif
#ifdef REFLECTION
vec4 environmentClearCoatRadiance;vec3 clearCoatEnvironmentReflectance;
#endif
float clearCoatNdotV;
#endif
};
#ifdef CLEARCOAT
#define pbr_inline
#define inline
void clearcoatBlock(
in vec3 vPositionW,
in vec3 geometricNormalW,
in vec3 viewDirectionW,
in vec2 vClearCoatParams,
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
in vec4 clearCoatMapRoughnessData,
#endif
in vec3 specularEnvironmentR0,
#ifdef CLEARCOAT_TEXTURE
in vec2 clearCoatMapData,
#endif
#ifdef CLEARCOAT_TINT
in vec4 vClearCoatTintParams,
in float clearCoatColorAtDistance,
in vec4 vClearCoatRefractionParams,
#ifdef CLEARCOAT_TINT_TEXTURE
in vec4 clearCoatTintMapData,
#endif
#endif
#ifdef CLEARCOAT_BUMP
in vec2 vClearCoatBumpInfos,
in vec4 clearCoatBumpMapData,
in vec2 vClearCoatBumpUV,
#if defined(TANGENT) && defined(NORMAL)
in mat3 vTBN,
#else
in vec2 vClearCoatTangentSpaceParams,
#endif
#ifdef OBJECTSPACE_NORMALMAP
in mat4 normalMatrix,
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
in vec3 faceNormal,
#endif
#ifdef REFLECTION
in vec3 vReflectionMicrosurfaceInfos,
in vec2 vReflectionInfos,
in vec3 vReflectionColor,
in vec4 vLightingIntensity,
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSampler,
#else
in sampler2D reflectionSampler,
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSamplerLow,
in samplerCube reflectionSamplerHigh,
#else
in sampler2D reflectionSamplerLow,
in sampler2D reflectionSamplerHigh,
#endif
#endif
#ifdef REALTIME_FILTERING
in vec2 vReflectionFilteringInfo,
#endif
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
#ifdef RADIANCEOCCLUSION
in float ambientMonochrome,
#endif
#endif
#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
in float frontFacingMultiplier,
#endif
out clearcoatOutParams outParams
)
{float clearCoatIntensity=vClearCoatParams.x;float clearCoatRoughness=vClearCoatParams.y;
#ifdef CLEARCOAT_TEXTURE
clearCoatIntensity*=clearCoatMapData.x;
#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE
clearCoatRoughness*=clearCoatMapData.y;
#endif
#if DEBUGMODE>0
outParams.clearCoatMapData=clearCoatMapData;
#endif
#endif
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
#ifdef CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL
clearCoatRoughness*=clearCoatMapData.y;
#else
clearCoatRoughness*=clearCoatMapRoughnessData.y;
#endif
#endif
outParams.clearCoatIntensity=clearCoatIntensity;outParams.clearCoatRoughness=clearCoatRoughness;
#ifdef CLEARCOAT_TINT
vec3 clearCoatColor=vClearCoatTintParams.rgb;float clearCoatThickness=vClearCoatTintParams.a;
#ifdef CLEARCOAT_TINT_TEXTURE
#ifdef CLEARCOAT_TINT_GAMMATEXTURE
clearCoatColor*=toLinearSpace(clearCoatTintMapData.rgb);
#else
clearCoatColor*=clearCoatTintMapData.rgb;
#endif
clearCoatThickness*=clearCoatTintMapData.a;
#if DEBUGMODE>0
outParams.clearCoatTintMapData=clearCoatTintMapData;
#endif
#endif
outParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);outParams.clearCoatThickness=clearCoatThickness;
#endif
#ifdef CLEARCOAT_REMAP_F0
vec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);
#else
vec3 specularEnvironmentR0Updated=specularEnvironmentR0;
#endif
outParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);vec3 clearCoatNormalW=geometricNormalW;
#ifdef CLEARCOAT_BUMP
#ifdef NORMALXYSCALE
float clearCoatNormalScale=1.0;
#else
float clearCoatNormalScale=vClearCoatBumpInfos.y;
#endif
#if defined(TANGENT) && defined(NORMAL)
mat3 TBNClearCoat=vTBN;
#else
vec2 TBNClearCoatUV=vClearCoatBumpUV*frontFacingMultiplier;mat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,TBNClearCoatUV,vClearCoatTangentSpaceParams);
#endif
#if DEBUGMODE>0
outParams.TBNClearCoat=TBNClearCoat;
#endif
#ifdef OBJECTSPACE_NORMALMAP
clearCoatNormalW=normalize(clearCoatBumpMapData.xyz *2.0-1.0);clearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);
#else
clearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
clearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));
#endif
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
clearCoatNormalW=clearCoatNormalW*frontFacingMultiplier;
#endif
outParams.clearCoatNormalW=clearCoatNormalW;outParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);float clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);float clearCoatNdotV=absEps(clearCoatNdotVUnclamped);
#if DEBUGMODE>0
outParams.clearCoatNdotV=clearCoatNdotV;
#endif
#ifdef CLEARCOAT_TINT
vec3 clearCoatVRefract=refract(-viewDirectionW,clearCoatNormalW,vClearCoatRefractionParams.y);outParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));
#endif
#if defined(ENVIRONMENTBRDF) && (!defined(REFLECTIONMAP_SKYBOX) || defined(MS_BRDF_ENERGY_CONSERVATION))
vec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);
#endif
#if defined(REFLECTION)
float clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);
#ifdef SPECULARAA
clearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;
#endif
vec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);vec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW);
#ifdef REFLECTIONMAP_OPPOSITEZ
clearCoatReflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
vec3 clearCoatReflectionCoords=clearCoatReflectionVector;
#else
vec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
clearCoatReflectionCoords/=clearCoatReflectionVector.z;
#endif
clearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;
#endif
sampleReflectionTexture(
clearCoatAlphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
clearCoatNdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
clearCoatRoughness,
#endif
reflectionSampler,
clearCoatReflectionCoords,
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
environmentClearCoatRadiance
);
#if DEBUGMODE>0
outParams.environmentClearCoatRadiance=environmentClearCoatRadiance;
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
vec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf);
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
float clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);clearCoatEnvironmentReflectance*=clearCoatEho;
#endif
#endif
#endif
#else
vec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness));
#endif
clearCoatEnvironmentReflectance*=clearCoatIntensity;
#if DEBUGMODE>0
outParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;
#endif
outParams.finalClearCoatRadianceScaled=
environmentClearCoatRadiance.rgb *
clearCoatEnvironmentReflectance *
vLightingIntensity.z;
#endif
#if defined(CLEARCOAT_TINT)
outParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);
#endif
float fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnelIBLClearCoat*=clearCoatIntensity;outParams.conservationFactor=(1.-fresnelIBLClearCoat);
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
outParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);
#endif
}
#endif
`;
Le.IncludesShadersStore[cce] = pce;
const hce = "pbrBlockIridescence", Hce = `struct iridescenceOutParams
{float iridescenceIntensity;float iridescenceIOR;float iridescenceThickness;vec3 specularEnvironmentR0;};
#ifdef IRIDESCENCE
#define pbr_inline
#define inline
void iridescenceBlock(
in vec4 vIridescenceParams,
in float viewAngle,
in vec3 specularEnvironmentR0,
#ifdef IRIDESCENCE_TEXTURE
in vec2 iridescenceMapData,
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
in vec2 iridescenceThicknessMapData,
#endif
#ifdef CLEARCOAT
in float NdotVUnclamped,
#ifdef CLEARCOAT_TEXTURE
in vec2 clearCoatMapData,
#endif
#endif
out iridescenceOutParams outParams
)
{float iridescenceIntensity=vIridescenceParams.x;float iridescenceIOR=vIridescenceParams.y;float iridescenceThicknessMin=vIridescenceParams.z;float iridescenceThicknessMax=vIridescenceParams.w;float iridescenceThicknessWeight=1.;
#ifdef IRIDESCENCE_TEXTURE
iridescenceIntensity*=iridescenceMapData.x;
#ifdef IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE
iridescenceThicknessWeight=iridescenceMapData.g;
#endif
#endif
#if defined(IRIDESCENCE_THICKNESS_TEXTURE)
iridescenceThicknessWeight=iridescenceThicknessMapData.g;
#endif
float iridescenceThickness=mix(iridescenceThicknessMin,iridescenceThicknessMax,iridescenceThicknessWeight);float topIor=1.; 
#ifdef CLEARCOAT
float clearCoatIntensity=vClearCoatParams.x;
#ifdef CLEARCOAT_TEXTURE
clearCoatIntensity*=clearCoatMapData.x;
#endif
topIor=mix(1.0,vClearCoatRefractionParams.w-1.,clearCoatIntensity);viewAngle=sqrt(1.0+square(1.0/topIor)*(square(NdotVUnclamped)-1.0));
#endif
vec3 iridescenceFresnel=evalIridescence(topIor,iridescenceIOR,viewAngle,iridescenceThickness,specularEnvironmentR0);outParams.specularEnvironmentR0=mix(specularEnvironmentR0,iridescenceFresnel,iridescenceIntensity);outParams.iridescenceIntensity=iridescenceIntensity;outParams.iridescenceThickness=iridescenceThickness;outParams.iridescenceIOR=iridescenceIOR;}
#endif
`;
Le.IncludesShadersStore[hce] = Hce;
const gce = "pbrBlockSubSurface", Xce = `struct subSurfaceOutParams
{vec3 specularEnvironmentReflectance;
#ifdef SS_REFRACTION
vec3 finalRefraction;vec3 surfaceAlbedo;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
float alpha;
#endif
#ifdef REFLECTION
float refractionFactorForIrradiance;
#endif
#endif
#ifdef SS_TRANSLUCENCY
vec3 transmittance;float translucencyIntensity;
#ifdef REFLECTION
vec3 refractionIrradiance;
#endif
#endif
#if DEBUGMODE>0
#ifdef SS_THICKNESSANDMASK_TEXTURE
vec4 thicknessMap;
#endif
#ifdef SS_REFRACTION
vec4 environmentRefraction;vec3 refractionTransmittance;
#endif
#endif
};
#ifdef SUBSURFACE
#define pbr_inline
#define inline
#ifdef SS_REFRACTION
vec4 sampleEnvironmentRefraction(
in float ior
,in float thickness
,in float refractionLOD
,in vec3 normalW
,in vec3 vPositionW
,in vec3 viewDirectionW
,in mat4 view
,in vec4 vRefractionInfos
,in mat4 refractionMatrix
,in vec4 vRefractionMicrosurfaceInfos
,in float alphaG
#ifdef SS_REFRACTIONMAP_3D
,in samplerCube refractionSampler
#ifndef LODBASEDMICROSFURACE
,in samplerCube refractionSamplerLow
,in samplerCube refractionSamplerHigh
#endif
#else
,in sampler2D refractionSampler
#ifndef LODBASEDMICROSFURACE
,in sampler2D refractionSamplerLow
,in sampler2D refractionSamplerHigh
#endif
#endif
#ifdef ANISOTROPIC
,in anisotropicOutParams anisotropicOut
#endif
#ifdef REALTIME_FILTERING
,in vec2 vRefractionFilteringInfo
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
,in vec3 refractionPosition
,in vec3 refractionSize
#endif
) {vec4 environmentRefraction=vec4(0.,0.,0.,0.);
#ifdef ANISOTROPIC
vec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,ior);
#else
vec3 refractionVector=refract(-viewDirectionW,normalW,ior);
#endif
#ifdef SS_REFRACTIONMAP_OPPOSITEZ
refractionVector.z*=-1.0;
#endif
#ifdef SS_REFRACTIONMAP_3D
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
refractionVector=parallaxCorrectNormal(vPositionW,refractionVector,refractionSize,refractionPosition);
#endif
refractionVector.y=refractionVector.y*vRefractionInfos.w;vec3 refractionCoords=refractionVector;refractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));
#else
#ifdef SS_USE_THICKNESS_AS_DEPTH
vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*thickness,1.0)));
#else
vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));
#endif
vec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;
#endif
#ifdef LODBASEDMICROSFURACE
refractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;
#ifdef SS_LODINREFRACTIONALPHA
float automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);float requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);
#else
float requestedRefractionLOD=refractionLOD;
#endif
#if defined(REALTIME_FILTERING) && defined(SS_REFRACTIONMAP_3D)
environmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0);
#else
environmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);
#endif
#else
float lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));float lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;vec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);if (lodRefractionNormalizedDoubled<1.0){environmentRefraction=mix(
sampleRefraction(refractionSamplerHigh,refractionCoords),
environmentRefractionMid,
lodRefractionNormalizedDoubled
);} else {environmentRefraction=mix(
environmentRefractionMid,
sampleRefraction(refractionSamplerLow,refractionCoords),
lodRefractionNormalizedDoubled-1.0
);}
#endif
#ifdef SS_RGBDREFRACTION
environmentRefraction.rgb=fromRGBD(environmentRefraction);
#endif
#ifdef SS_GAMMAREFRACTION
environmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);
#endif
return environmentRefraction;}
#endif
void subSurfaceBlock(
in vec3 vSubSurfaceIntensity,
in vec2 vThicknessParam,
in vec4 vTintColor,
in vec3 normalW,
in vec3 specularEnvironmentReflectance,
#ifdef SS_THICKNESSANDMASK_TEXTURE
in vec4 thicknessMap,
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
in vec4 refractionIntensityMap,
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
in vec4 translucencyIntensityMap,
#endif
#ifdef REFLECTION
#ifdef SS_TRANSLUCENCY
in mat4 reflectionMatrix,
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
in vec3 irradianceVector_,
#endif
#if defined(REALTIME_FILTERING)
in samplerCube reflectionSampler,
in vec2 vReflectionFilteringInfo,
#endif
#endif
#ifdef USEIRRADIANCEMAP
#ifdef REFLECTIONMAP_3D
in samplerCube irradianceSampler,
#else
in sampler2D irradianceSampler,
#endif
#endif
#endif
#endif
#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
in vec3 surfaceAlbedo,
#endif
#ifdef SS_REFRACTION
in vec3 vPositionW,
in vec3 viewDirectionW,
in mat4 view,
in vec4 vRefractionInfos,
in mat4 refractionMatrix,
in vec4 vRefractionMicrosurfaceInfos,
in vec4 vLightingIntensity,
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
in float alpha,
#endif
#ifdef SS_LODINREFRACTIONALPHA
in float NdotVUnclamped,
#endif
#ifdef SS_LINEARSPECULARREFRACTION
in float roughness,
#endif
in float alphaG,
#ifdef SS_REFRACTIONMAP_3D
in samplerCube refractionSampler,
#ifndef LODBASEDMICROSFURACE
in samplerCube refractionSamplerLow,
in samplerCube refractionSamplerHigh,
#endif
#else
in sampler2D refractionSampler,
#ifndef LODBASEDMICROSFURACE
in sampler2D refractionSamplerLow,
in sampler2D refractionSamplerHigh,
#endif
#endif
#ifdef ANISOTROPIC
in anisotropicOutParams anisotropicOut,
#endif
#ifdef REALTIME_FILTERING
in vec2 vRefractionFilteringInfo,
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
in vec3 refractionPosition,
in vec3 refractionSize,
#endif
#ifdef SS_DISPERSION
in float dispersion,
#endif
#endif
#ifdef SS_TRANSLUCENCY
in vec3 vDiffusionDistance,
#endif
out subSurfaceOutParams outParams
)
{outParams.specularEnvironmentReflectance=specularEnvironmentReflectance;
#ifdef SS_REFRACTION
float refractionIntensity=vSubSurfaceIntensity.x;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
refractionIntensity*=(1.0-alpha);outParams.alpha=1.0;
#endif
#endif
#ifdef SS_TRANSLUCENCY
float translucencyIntensity=vSubSurfaceIntensity.y;
#endif
#ifdef SS_THICKNESSANDMASK_TEXTURE
#if defined(SS_USE_GLTF_TEXTURES)
float thickness=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;
#else
float thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;
#endif
#if DEBUGMODE>0
outParams.thicknessMap=thicknessMap;
#endif
#ifdef SS_MASK_FROM_THICKNESS_TEXTURE
#if defined(SS_REFRACTION) && defined(SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE)
#if defined(SS_USE_GLTF_TEXTURES)
refractionIntensity*=thicknessMap.r;
#else
refractionIntensity*=thicknessMap.g;
#endif
#endif
#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE)
translucencyIntensity*=thicknessMap.b;
#endif
#endif
#else
float thickness=vThicknessParam.y;
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
#ifdef SS_USE_GLTF_TEXTURES
refractionIntensity*=refractionIntensityMap.r;
#else
refractionIntensity*=refractionIntensityMap.g;
#endif
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
translucencyIntensity*=translucencyIntensityMap.b;
#endif
#ifdef SS_TRANSLUCENCY
thickness=maxEps(thickness);vec3 transmittance=transmittanceBRDF_Burley(vTintColor.rgb,vDiffusionDistance,thickness);transmittance*=translucencyIntensity;outParams.transmittance=transmittance;outParams.translucencyIntensity=translucencyIntensity;
#endif
#ifdef SS_REFRACTION
vec4 environmentRefraction=vec4(0.,0.,0.,0.);
#ifdef SS_HAS_THICKNESS
float ior=vRefractionInfos.y;
#else
float ior=vRefractionMicrosurfaceInfos.w;
#endif
#ifdef SS_LODINREFRACTIONALPHA
float refractionAlphaG=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG,NdotVUnclamped);
#elif defined(SS_LINEARSPECULARREFRACTION)
float refractionRoughness=alphaG;refractionRoughness=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,refractionRoughness);
#else
float refractionAlphaG=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG);
#endif
#ifdef SS_DISPERSION
float realIOR=1.0/ior;float iorDispersionSpread=0.04*dispersion*(realIOR-1.0);vec3 iors=vec3(1.0/(realIOR-iorDispersionSpread),ior,1.0/(realIOR+iorDispersionSpread));for (int i=0; i<3; i++) {ior=iors[i];
#endif
vec4 envSample=sampleEnvironmentRefraction(ior,thickness,refractionLOD,normalW,vPositionW,viewDirectionW,view,vRefractionInfos,refractionMatrix,vRefractionMicrosurfaceInfos,alphaG
#ifdef SS_REFRACTIONMAP_3D
,refractionSampler
#ifndef LODBASEDMICROSFURACE
,refractionSamplerLow
,refractionSamplerHigh
#endif
#else
,refractionSampler
#ifndef LODBASEDMICROSFURACE
,refractionSamplerLow
,refractionSamplerHigh
#endif
#endif
#ifdef ANISOTROPIC
,anisotropicOut
#endif
#ifdef REALTIME_FILTERING
,vRefractionFilteringInfo
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
,refractionPosition
,refractionSize
#endif
);
#ifdef SS_DISPERSION
environmentRefraction[i]=envSample[i];}
#else
environmentRefraction=envSample;
#endif
environmentRefraction.rgb*=vRefractionInfos.x;
#endif
#ifdef SS_REFRACTION
vec3 refractionTransmittance=vec3(refractionIntensity);
#ifdef SS_THICKNESSANDMASK_TEXTURE
vec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambert(volumeAlbedo,thickness);
#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)
float maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);vec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);environmentRefraction.rgb*=volumeAlbedo;
#else
vec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y);
#endif
#ifdef SS_ALBEDOFORREFRACTIONTINT
environmentRefraction.rgb*=surfaceAlbedo.rgb;
#endif
outParams.surfaceAlbedo=surfaceAlbedo*(1.-refractionIntensity);
#ifdef REFLECTION
outParams.refractionFactorForIrradiance=(1.-refractionIntensity);
#endif
#ifdef UNUSED_MULTIPLEBOUNCES
vec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);outParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);
#endif
refractionTransmittance*=1.0-outParams.specularEnvironmentReflectance;
#if DEBUGMODE>0
outParams.refractionTransmittance=refractionTransmittance;
#endif
outParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;
#if DEBUGMODE>0
outParams.environmentRefraction=environmentRefraction;
#endif
#endif
#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)
#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)
vec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;
#ifdef REFLECTIONMAP_OPPOSITEZ
irradianceVector.z*=-1.0;
#endif
#ifdef INVERTCUBICMAP
irradianceVector.y*=-1.0;
#endif
#else
vec3 irradianceVector=irradianceVector_;
#endif
#if defined(USESPHERICALFROMREFLECTIONMAP)
#if defined(REALTIME_FILTERING)
vec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo);
#else
vec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector);
#endif
#elif defined(USEIRRADIANCEMAP)
#ifdef REFLECTIONMAP_3D
vec3 irradianceCoords=irradianceVector;
#else
vec2 irradianceCoords=irradianceVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
irradianceCoords/=irradianceVector.z;
#endif
irradianceCoords.y=1.0-irradianceCoords.y;
#endif
vec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords);
#ifdef RGBDREFLECTION
refractionIrradiance.rgb=fromRGBD(refractionIrradiance);
#endif
#ifdef GAMMAREFLECTION
refractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb);
#endif
#else
vec4 refractionIrradiance=vec4(0.);
#endif
refractionIrradiance.rgb*=transmittance;
#ifdef SS_ALBEDOFORTRANSLUCENCYTINT
refractionIrradiance.rgb*=surfaceAlbedo.rgb;
#endif
outParams.refractionIrradiance=refractionIrradiance.rgb;
#endif
}
#endif
`;
Le.IncludesShadersStore[gce] = Xce;
const Tce = "pbrBlockNormalGeometric", qce = `vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;
#endif
vec3 geometricNormalW=normalW;
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
geometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW;
#endif
`;
Le.IncludesShadersStore[Tce] = qce;
const bce = "pbrBlockNormalFinal", xce = `#if defined(FORCENORMALFORWARD) && defined(NORMAL)
vec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;
#if defined(TWOSIDEDLIGHTING)
faceNormal=gl_FrontFacing ? faceNormal : -faceNormal;
#endif
normalW*=sign(dot(normalW,faceNormal));
#endif
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
normalW=gl_FrontFacing ? normalW : -normalW;
#endif
`;
Le.IncludesShadersStore[bce] = xce;
const Dce = "pbrBlockLightmapInit", jce = `#ifdef LIGHTMAP
vec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);
#ifdef RGBDLIGHTMAP
lightmapColor.rgb=fromRGBD(lightmapColor);
#endif
#ifdef GAMMALIGHTMAP
lightmapColor.rgb=toLinearSpace(lightmapColor.rgb);
#endif
lightmapColor.rgb*=vLightmapInfos.y;
#endif
`;
Le.IncludesShadersStore[Dce] = jce;
const wce = "pbrBlockGeometryInfo", mce = `float NdotVUnclamped=dot(normalW,viewDirectionW);float NdotV=absEps(NdotVUnclamped);float alphaG=convertRoughnessToAverageSlope(roughness);vec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz);
#ifdef SPECULARAA
alphaG+=AARoughnessFactors.y;
#endif
#if defined(ENVIRONMENTBRDF)
vec3 environmentBrdf=getBRDFLookup(NdotV,roughness);
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
#ifdef RADIANCEOCCLUSION
#ifdef AMBIENTINGRAYSCALE
float ambientMonochrome=aoOut.ambientOcclusionColor.r;
#else
float ambientMonochrome=getLuminance(aoOut.ambientOcclusionColor);
#endif
float seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);
#endif
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
float eho=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW);
#endif
#endif
#endif
#endif
`;
Le.IncludesShadersStore[wce] = mce;
const Bce = "pbrBlockReflectance0", Wce = `float reflectance=max(max(reflectivityOut.surfaceReflectivityColor.r,reflectivityOut.surfaceReflectivityColor.g),reflectivityOut.surfaceReflectivityColor.b);vec3 specularEnvironmentR0=reflectivityOut.surfaceReflectivityColor.rgb;
#ifdef METALLICWORKFLOW
vec3 specularEnvironmentR90=vec3(metallicReflectanceFactors.a);
#else 
vec3 specularEnvironmentR90=vec3(1.0,1.0,1.0);
#endif
#ifdef ALPHAFRESNEL
float reflectance90=fresnelGrazingReflectance(reflectance);specularEnvironmentR90=specularEnvironmentR90*reflectance90;
#endif
`;
Le.IncludesShadersStore[Bce] = Wce;
const Sce = "pbrBlockReflectance", Uce = `#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
vec3 specularEnvironmentReflectance=getReflectanceFromBRDFLookup(clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,environmentBrdf);
#ifdef RADIANCEOCCLUSION
specularEnvironmentReflectance*=seo;
#endif
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
specularEnvironmentReflectance*=eho;
#endif
#endif
#endif
#else
vec3 specularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));
#endif
#ifdef CLEARCOAT
specularEnvironmentReflectance*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
specularEnvironmentReflectance*=clearcoatOut.absorption;
#endif
#endif
`;
Le.IncludesShadersStore[Sce] = Uce;
const Ice = "pbrBlockDirectLighting", Rce = `vec3 diffuseBase=vec3(0.,0.,0.);
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
#ifdef CLEARCOAT
vec3 clearCoatBase=vec3(0.,0.,0.);
#endif
#ifdef SHEEN
vec3 sheenBase=vec3(0.,0.,0.);
#endif
preLightingInfo preInfo;lightingInfo info;float shadow=1.; 
float aggShadow=0.;float numLights=0.;
#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
vec3 absorption=vec3(0.);
#endif
`;
Le.IncludesShadersStore[Ice] = Rce;
const Vce = "pbrBlockFinalLitComponents", Cce = `aggShadow=aggShadow/numLights;
#if defined(ENVIRONMENTBRDF)
#ifdef MS_BRDF_ENERGY_CONSERVATION
vec3 energyConservationFactor=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);
#endif
#endif
#ifndef METALLICWORKFLOW
#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION
surfaceAlbedo.rgb=(1.-reflectance)*surfaceAlbedo.rgb;
#endif
#endif
#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF)
surfaceAlbedo.rgb=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;
#endif
#ifdef REFLECTION
vec3 finalIrradiance=reflectionOut.environmentIrradiance;
#if defined(CLEARCOAT)
finalIrradiance*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
finalIrradiance*=clearcoatOut.absorption;
#endif
#endif
#if defined(SS_REFRACTION)
finalIrradiance*=subSurfaceOut.refractionFactorForIrradiance;
#endif
#if defined(SS_TRANSLUCENCY)
finalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);finalIrradiance+=subSurfaceOut.refractionIrradiance;
#endif
finalIrradiance*=surfaceAlbedo.rgb;finalIrradiance*=vLightingIntensity.z;finalIrradiance*=aoOut.ambientOcclusionColor;
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase;finalSpecular=max(finalSpecular,0.0);vec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalSpecularScaled*=energyConservationFactor;
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
finalSpecularScaled*=sheenOut.sheenAlbedoScaling;
#endif
#endif
#ifdef REFLECTION
vec3 finalRadiance=reflectionOut.environmentRadiance.rgb;finalRadiance*=subSurfaceOut.specularEnvironmentReflectance;vec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalRadianceScaled*=energyConservationFactor;
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
finalRadianceScaled*=sheenOut.sheenAlbedoScaling;
#endif
#endif
#ifdef SHEEN
vec3 finalSheen=sheenBase*sheenOut.sheenColor;finalSheen=max(finalSheen,0.0);vec3 finalSheenScaled=finalSheen*vLightingIntensity.x*vLightingIntensity.w;
#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF)
sheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
sheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;
#endif
#endif
#endif
#ifdef CLEARCOAT
vec3 finalClearCoat=clearCoatBase;finalClearCoat=max(finalClearCoat,0.0);vec3 finalClearCoatScaled=finalClearCoat*vLightingIntensity.x*vLightingIntensity.w;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;
#endif
#ifdef SS_REFRACTION
subSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;
#ifdef CLEARCOAT_TINT
subSurfaceOut.finalRefraction*=clearcoatOut.absorption;
#endif
#endif
#endif
#ifdef ALPHABLEND
float luminanceOverAlpha=0.0;
#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)
luminanceOverAlpha+=getLuminance(finalRadianceScaled);
#if defined(CLEARCOAT)
luminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);
#endif
#endif
#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)
luminanceOverAlpha+=getLuminance(finalSpecularScaled);
#endif
#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA)
luminanceOverAlpha+=getLuminance(finalClearCoatScaled);
#endif
#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA)
alpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);
#endif
#endif
`;
Le.IncludesShadersStore[Vce] = Cce;
const Oce = "pbrBlockFinalUnlitComponents", yce = `vec3 finalDiffuse=diffuseBase;finalDiffuse*=surfaceAlbedo.rgb;finalDiffuse=max(finalDiffuse,0.0);finalDiffuse*=vLightingIntensity.x;vec3 finalAmbient=vAmbientColor;finalAmbient*=surfaceAlbedo.rgb;vec3 finalEmissive=vEmissiveColor;
#ifdef EMISSIVE
vec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;
#ifdef GAMMAEMISSIVE
finalEmissive*=toLinearSpace(emissiveColorTex.rgb);
#else
finalEmissive*=emissiveColorTex.rgb;
#endif
finalEmissive*= vEmissiveInfos.y;
#endif
finalEmissive*=vLightingIntensity.y;
#ifdef AMBIENT
vec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),aoOut.ambientOcclusionColor,vAmbientInfos.w);
#else
vec3 ambientOcclusionForDirectDiffuse=aoOut.ambientOcclusionColor;
#endif
finalAmbient*=aoOut.ambientOcclusionColor;finalDiffuse*=ambientOcclusionForDirectDiffuse;
`;
Le.IncludesShadersStore[Oce] = yce;
const kce = "pbrBlockFinalColorComposition", Ece = `vec4 finalColor=vec4(
#ifndef UNLIT
#ifdef REFLECTION
finalIrradiance +
#endif
#ifdef SPECULARTERM
finalSpecularScaled +
#endif
#ifdef SHEEN
finalSheenScaled +
#endif
#ifdef CLEARCOAT
finalClearCoatScaled +
#endif
#ifdef REFLECTION
finalRadianceScaled +
#if defined(SHEEN) && defined(ENVIRONMENTBRDF)
sheenOut.finalSheenRadianceScaled +
#endif
#ifdef CLEARCOAT
clearcoatOut.finalClearCoatRadianceScaled +
#endif
#endif
#ifdef SS_REFRACTION
subSurfaceOut.finalRefraction +
#endif
#endif
finalAmbient +
finalDiffuse,
alpha);
#ifdef LIGHTMAP
#ifndef LIGHTMAPEXCLUDED
#ifdef USELIGHTMAPASSHADOWMAP
finalColor.rgb*=lightmapColor.rgb;
#else
finalColor.rgb+=lightmapColor.rgb;
#endif
#endif
#endif
finalColor.rgb+=finalEmissive;
#define CUSTOM_FRAGMENT_BEFORE_FOG
finalColor=max(finalColor,0.0);
`;
Le.IncludesShadersStore[kce] = Ece;
const Fce = "pbrBlockImageProcessing", Nce = `#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)
#if !defined(SKIPFINALCOLORCLAMP)
finalColor.rgb=clamp(finalColor.rgb,0.,30.0);
#endif
#else
finalColor=applyImageProcessing(finalColor);
#endif
finalColor.a*=visibility;
#ifdef PREMULTIPLYALPHA
finalColor.rgb*=finalColor.a;
#endif
`;
Le.IncludesShadersStore[Fce] = Nce;
const Qce = "pbrDebug", Yce = `#if DEBUGMODE>0
if (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) {
#if DEBUGMODE==1
gl_FragColor.rgb=vPositionW.rgb;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==2 && defined(NORMAL)
gl_FragColor.rgb=vNormalW.rgb;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==3 && defined(BUMP) || DEBUGMODE==3 && defined(PARALLAX) || DEBUGMODE==3 && defined(ANISOTROPIC)
gl_FragColor.rgb=TBN[0];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==4 && defined(BUMP) || DEBUGMODE==4 && defined(PARALLAX) || DEBUGMODE==4 && defined(ANISOTROPIC)
gl_FragColor.rgb=TBN[1];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==5
gl_FragColor.rgb=normalW;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==6 && defined(MAINUV1)
gl_FragColor.rgb=vec3(vMainUV1,0.0);
#elif DEBUGMODE==7 && defined(MAINUV2)
gl_FragColor.rgb=vec3(vMainUV2,0.0);
#elif DEBUGMODE==8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)
gl_FragColor.rgb=clearcoatOut.TBNClearCoat[0];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)
gl_FragColor.rgb=clearcoatOut.TBNClearCoat[1];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==10 && defined(CLEARCOAT)
gl_FragColor.rgb=clearcoatOut.clearCoatNormalW;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==11 && defined(ANISOTROPIC)
gl_FragColor.rgb=anisotropicOut.anisotropicNormal;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==12 && defined(ANISOTROPIC)
gl_FragColor.rgb=anisotropicOut.anisotropicTangent;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==13 && defined(ANISOTROPIC)
gl_FragColor.rgb=anisotropicOut.anisotropicBitangent;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==20 && defined(ALBEDO)
gl_FragColor.rgb=albedoTexture.rgb;
#ifndef GAMMAALBEDO
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==21 && defined(AMBIENT)
gl_FragColor.rgb=aoOut.ambientOcclusionColorMap.rgb;
#elif DEBUGMODE==22 && defined(OPACITY)
gl_FragColor.rgb=opacityMap.rgb;
#elif DEBUGMODE==23 && defined(EMISSIVE)
gl_FragColor.rgb=emissiveColorTex.rgb;
#ifndef GAMMAEMISSIVE
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==24 && defined(LIGHTMAP)
gl_FragColor.rgb=lightmapColor.rgb;
#ifndef GAMMALIGHTMAP
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)
gl_FragColor.rgb=reflectivityOut.surfaceMetallicColorMap.rgb;
#elif DEBUGMODE==26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)
gl_FragColor.rgb=reflectivityOut.surfaceReflectivityColorMap.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)
gl_FragColor.rgb=vec3(clearcoatOut.clearCoatMapData.rg,0.0);
#elif DEBUGMODE==28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
gl_FragColor.rgb=clearcoatOut.clearCoatTintMapData.rgb;
#elif DEBUGMODE==29 && defined(SHEEN) && defined(SHEEN_TEXTURE)
gl_FragColor.rgb=sheenOut.sheenMapData.rgb;
#elif DEBUGMODE==30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)
gl_FragColor.rgb=anisotropicOut.anisotropyMapData.rgb;
#elif DEBUGMODE==31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)
gl_FragColor.rgb=subSurfaceOut.thicknessMap.rgb;
#elif DEBUGMODE==32 && defined(BUMP)
gl_FragColor.rgb=texture2D(bumpSampler,vBumpUV).rgb;
#elif DEBUGMODE==40 && defined(SS_REFRACTION)
gl_FragColor.rgb=subSurfaceOut.environmentRefraction.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==41 && defined(REFLECTION)
gl_FragColor.rgb=reflectionOut.environmentRadiance.rgb;
#ifndef GAMMAREFLECTION
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==42 && defined(CLEARCOAT) && defined(REFLECTION)
gl_FragColor.rgb=clearcoatOut.environmentClearCoatRadiance.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==50
gl_FragColor.rgb=diffuseBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==51 && defined(SPECULARTERM)
gl_FragColor.rgb=specularBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==52 && defined(CLEARCOAT)
gl_FragColor.rgb=clearCoatBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==53 && defined(SHEEN)
gl_FragColor.rgb=sheenBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==54 && defined(REFLECTION)
gl_FragColor.rgb=reflectionOut.environmentIrradiance.rgb;
#ifndef GAMMAREFLECTION
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==60
gl_FragColor.rgb=surfaceAlbedo.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==61
gl_FragColor.rgb=clearcoatOut.specularEnvironmentR0;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==62 && defined(METALLICWORKFLOW)
gl_FragColor.rgb=vec3(reflectivityOut.metallicRoughness.r);
#elif DEBUGMODE==71 && defined(METALLICWORKFLOW)
gl_FragColor.rgb=reflectivityOut.metallicF0;
#elif DEBUGMODE==63
gl_FragColor.rgb=vec3(roughness);
#elif DEBUGMODE==64
gl_FragColor.rgb=vec3(alphaG);
#elif DEBUGMODE==65
gl_FragColor.rgb=vec3(NdotV);
#elif DEBUGMODE==66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
gl_FragColor.rgb=clearcoatOut.clearCoatColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==67 && defined(CLEARCOAT)
gl_FragColor.rgb=vec3(clearcoatOut.clearCoatRoughness);
#elif DEBUGMODE==68 && defined(CLEARCOAT)
gl_FragColor.rgb=vec3(clearcoatOut.clearCoatNdotV);
#elif DEBUGMODE==69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)
gl_FragColor.rgb=subSurfaceOut.transmittance;
#elif DEBUGMODE==70 && defined(SUBSURFACE) && defined(SS_REFRACTION)
gl_FragColor.rgb=subSurfaceOut.refractionTransmittance;
#elif DEBUGMODE==72
gl_FragColor.rgb=vec3(microSurface);
#elif DEBUGMODE==73
gl_FragColor.rgb=vAlbedoColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==74 && !defined(METALLICWORKFLOW)
gl_FragColor.rgb=vReflectivityColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==75
gl_FragColor.rgb=vEmissiveColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==80 && defined(RADIANCEOCCLUSION)
gl_FragColor.rgb=vec3(seo);
#elif DEBUGMODE==81 && defined(HORIZONOCCLUSION)
gl_FragColor.rgb=vec3(eho);
#elif DEBUGMODE==82 && defined(MS_BRDF_ENERGY_CONSERVATION)
gl_FragColor.rgb=vec3(energyConservationFactor);
#elif DEBUGMODE==83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
gl_FragColor.rgb=specularEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
gl_FragColor.rgb=clearcoatOut.clearCoatEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==85 && defined(SHEEN) && defined(REFLECTION)
gl_FragColor.rgb=sheenOut.sheenEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==86 && defined(ALPHABLEND)
gl_FragColor.rgb=vec3(luminanceOverAlpha);
#elif DEBUGMODE==87
gl_FragColor.rgb=vec3(alpha);
#elif DEBUGMODE==88 && defined(ALBEDO)
gl_FragColor.rgb=vec3(albedoTexture.a);
#else
float stripeWidth=30.;float stripePos=floor((gl_FragCoord.x+gl_FragCoord.y)/stripeWidth);float whichColor=mod(stripePos,2.);vec3 color1=vec3(.6,.2,.2);vec3 color2=vec3(.3,.1,.1);gl_FragColor.rgb=mix(color1,color2,whichColor);
#endif
gl_FragColor.rgb*=vDebugMode.y;
#ifdef DEBUGMODE_NORMALIZE
gl_FragColor.rgb=normalize(gl_FragColor.rgb)*0.5+0.5;
#endif
#ifdef DEBUGMODE_GAMMA
gl_FragColor.rgb=toGammaSpace(gl_FragColor.rgb);
#endif
gl_FragColor.a=1.0;
#ifdef PREPASS
gl_FragData[0]=toLinearSpace(gl_FragColor); 
gl_FragData[1]=vec4(0.,0.,0.,0.); 
#endif
#ifdef DEBUGMODE_FORCERETURN
return;
#endif
}
#endif
`;
Le.IncludesShadersStore[Qce] = Yce;
const Mce = "pbrPixelShader", Lce = `#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#extension GL_OES_standard_derivatives : enable
#endif
#ifdef LODBASEDMICROSFURACE
#extension GL_EXT_shader_texture_lod : enable
#endif
#define CUSTOM_FRAGMENT_BEGIN
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<prePassDeclaration>[SCENE_MRT_COUNT]
precision highp float;
#include<oitDeclaration>
#ifndef FROMLINEARSPACE
#define FROMLINEARSPACE
#endif
#include<__decl__pbrFragment>
#include<pbrFragmentExtraDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<pbrFragmentSamplersDeclaration>
#include<imageProcessingDeclaration>
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#include<helperFunctions>
#include<subSurfaceScatteringFunctions>
#include<importanceSampling>
#include<pbrHelperFunctions>
#include<imageProcessingFunctions>
#include<shadowsFragmentFunctions>
#include<harmonicsFunctions>
#include<pbrDirectLightingSetupFunctions>
#include<pbrDirectLightingFalloffFunctions>
#include<pbrBRDFFunctions>
#include<hdrFilteringFunctions>
#include<pbrDirectLightingFunctions>
#include<pbrIBLFunctions>
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#ifdef REFLECTION
#include<reflectionFunction>
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
#include<pbrBlockAlbedoOpacity>
#include<pbrBlockReflectivity>
#include<pbrBlockAmbientOcclusion>
#include<pbrBlockAlphaFresnel>
#include<pbrBlockAnisotropic>
#include<pbrBlockReflection>
#include<pbrBlockSheen>
#include<pbrBlockClearcoat>
#include<pbrBlockIridescence>
#include<pbrBlockSubSurface>
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#include<pbrBlockNormalGeometric>
#include<bumpFragment>
#include<pbrBlockNormalFinal>
albedoOpacityOutParams albedoOpacityOut;
#ifdef ALBEDO
vec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset);
#endif
#ifdef OPACITY
vec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);
#endif
#ifdef DECAL
vec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);
#endif
albedoOpacityBlock(
vAlbedoColor,
#ifdef ALBEDO
albedoTexture,
vAlbedoInfos,
#endif
#ifdef OPACITY
opacityMap,
vOpacityInfos,
#endif
#ifdef DETAIL
detailColor,
vDetailInfos,
#endif
#ifdef DECAL
decalColor,
vDecalInfos,
#endif
albedoOpacityOut
);vec3 surfaceAlbedo=albedoOpacityOut.surfaceAlbedo;float alpha=albedoOpacityOut.alpha;
#define CUSTOM_FRAGMENT_UPDATE_ALPHA
#include<depthPrePass>
#define CUSTOM_FRAGMENT_BEFORE_LIGHTS
ambientOcclusionOutParams aoOut;
#ifdef AMBIENT
vec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb;
#endif
ambientOcclusionBlock(
#ifdef AMBIENT
ambientOcclusionColorMap,
vAmbientInfos,
#endif
aoOut
);
#include<pbrBlockLightmapInit>
#ifdef UNLIT
vec3 diffuseBase=vec3(1.,1.,1.);
#else
vec3 baseColor=surfaceAlbedo;reflectivityOutParams reflectivityOut;
#if defined(REFLECTIVITY)
vec4 surfaceMetallicOrReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);vec4 baseReflectivity=surfaceMetallicOrReflectivityColorMap;
#ifndef METALLICWORKFLOW
#ifdef REFLECTIVITY_GAMMA
surfaceMetallicOrReflectivityColorMap=toLinearSpace(surfaceMetallicOrReflectivityColorMap);
#endif
surfaceMetallicOrReflectivityColorMap.rgb*=vReflectivityInfos.y;
#endif
#endif
#if defined(MICROSURFACEMAP)
vec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;
#endif
#ifdef METALLICWORKFLOW
vec4 metallicReflectanceFactors=vMetallicReflectanceFactors;
#ifdef REFLECTANCE
vec4 reflectanceFactorsMap=texture2D(reflectanceSampler,vReflectanceUV+uvOffset);
#ifdef REFLECTANCE_GAMMA
reflectanceFactorsMap=toLinearSpace(reflectanceFactorsMap);
#endif
metallicReflectanceFactors.rgb*=reflectanceFactorsMap.rgb;
#endif
#ifdef METALLIC_REFLECTANCE
vec4 metallicReflectanceFactorsMap=texture2D(metallicReflectanceSampler,vMetallicReflectanceUV+uvOffset);
#ifdef METALLIC_REFLECTANCE_GAMMA
metallicReflectanceFactorsMap=toLinearSpace(metallicReflectanceFactorsMap);
#endif
#ifndef METALLIC_REFLECTANCE_USE_ALPHA_ONLY
metallicReflectanceFactors.rgb*=metallicReflectanceFactorsMap.rgb;
#endif
metallicReflectanceFactors*=metallicReflectanceFactorsMap.a;
#endif
#endif
reflectivityBlock(
vReflectivityColor,
#ifdef METALLICWORKFLOW
surfaceAlbedo,
metallicReflectanceFactors,
#endif
#ifdef REFLECTIVITY
vReflectivityInfos,
surfaceMetallicOrReflectivityColorMap,
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
aoOut.ambientOcclusionColor,
#endif
#ifdef MICROSURFACEMAP
microSurfaceTexel,
#endif
#ifdef DETAIL
detailColor,
vDetailInfos,
#endif
reflectivityOut
);float microSurface=reflectivityOut.microSurface;float roughness=reflectivityOut.roughness;
#ifdef METALLICWORKFLOW
surfaceAlbedo=reflectivityOut.surfaceAlbedo;
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
aoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor;
#endif
#ifdef ALPHAFRESNEL
#if defined(ALPHATEST) || defined(ALPHABLEND)
alphaFresnelOutParams alphaFresnelOut;alphaFresnelBlock(
normalW,
viewDirectionW,
alpha,
microSurface,
alphaFresnelOut
);alpha=alphaFresnelOut.alpha;
#endif
#endif
#include<pbrBlockGeometryInfo>
#ifdef ANISOTROPIC
anisotropicOutParams anisotropicOut;
#ifdef ANISOTROPIC_TEXTURE
vec3 anisotropyMapData=texture2D(anisotropySampler,vAnisotropyUV+uvOffset).rgb*vAnisotropyInfos.y;
#endif
anisotropicBlock(
vAnisotropy,
roughness,
#ifdef ANISOTROPIC_TEXTURE
anisotropyMapData,
#endif
TBN,
normalW,
viewDirectionW,
anisotropicOut
);
#endif
#ifdef REFLECTION
reflectionOutParams reflectionOut;
#ifndef USE_CUSTOM_REFLECTION
reflectionBlock(
vPositionW,
normalW,
alphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#ifdef ANISOTROPIC
anisotropicOut,
#endif
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
roughness,
#endif
reflectionSampler,
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
vEnvironmentIrradiance,
#endif
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
reflectionMatrix,
#endif
#endif
#ifdef USEIRRADIANCEMAP
irradianceSampler,
#endif
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
reflectionOut
);
#else
#define CUSTOM_REFLECTION
#endif
#endif
#include<pbrBlockReflectance0>
#ifdef SHEEN
sheenOutParams sheenOut;
#ifdef SHEEN_TEXTURE
vec4 sheenMapData=texture2D(sheenSampler,vSheenUV+uvOffset);
#endif
#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
vec4 sheenMapRoughnessData=texture2D(sheenRoughnessSampler,vSheenRoughnessUV+uvOffset)*vSheenInfos.w;
#endif
sheenBlock(
vSheenColor,
#ifdef SHEEN_ROUGHNESS
vSheenRoughness,
#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
sheenMapRoughnessData,
#endif
#endif
roughness,
#ifdef SHEEN_TEXTURE
sheenMapData,
vSheenInfos.y,
#endif
reflectance,
#ifdef SHEEN_LINKWITHALBEDO
baseColor,
surfaceAlbedo,
#endif
#ifdef ENVIRONMENTBRDF
NdotV,
environmentBrdf,
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
AARoughnessFactors,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
vLightingIntensity,
reflectionSampler,
reflectionOut.reflectionCoords,
NdotVUnclamped,
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
seo,
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
eho,
#endif
#endif
sheenOut
);
#ifdef SHEEN_LINKWITHALBEDO
surfaceAlbedo=sheenOut.surfaceAlbedo;
#endif
#endif
#ifdef CLEARCOAT
#ifdef CLEARCOAT_TEXTURE
vec2 clearCoatMapData=texture2D(clearCoatSampler,vClearCoatUV+uvOffset).rg*vClearCoatInfos.y;
#endif
#endif
#ifdef IRIDESCENCE
iridescenceOutParams iridescenceOut;
#ifdef IRIDESCENCE_TEXTURE
vec2 iridescenceMapData=texture2D(iridescenceSampler,vIridescenceUV+uvOffset).rg*vIridescenceInfos.y;
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
vec2 iridescenceThicknessMapData=texture2D(iridescenceThicknessSampler,vIridescenceThicknessUV+uvOffset).rg*vIridescenceInfos.w;
#endif
iridescenceBlock(
vIridescenceParams,
NdotV,
specularEnvironmentR0,
#ifdef IRIDESCENCE_TEXTURE
iridescenceMapData,
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
iridescenceThicknessMapData,
#endif
#ifdef CLEARCOAT
NdotVUnclamped,
#ifdef CLEARCOAT_TEXTURE
clearCoatMapData,
#endif
#endif
iridescenceOut
);float iridescenceIntensity=iridescenceOut.iridescenceIntensity;specularEnvironmentR0=iridescenceOut.specularEnvironmentR0;
#endif
clearcoatOutParams clearcoatOut;
#ifdef CLEARCOAT
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
vec4 clearCoatMapRoughnessData=texture2D(clearCoatRoughnessSampler,vClearCoatRoughnessUV+uvOffset)*vClearCoatInfos.w;
#endif
#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
vec4 clearCoatTintMapData=texture2D(clearCoatTintSampler,vClearCoatTintUV+uvOffset);
#endif
#ifdef CLEARCOAT_BUMP
vec4 clearCoatBumpMapData=texture2D(clearCoatBumpSampler,vClearCoatBumpUV+uvOffset);
#endif
clearcoatBlock(
vPositionW,
geometricNormalW,
viewDirectionW,
vClearCoatParams,
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
clearCoatMapRoughnessData,
#endif
specularEnvironmentR0,
#ifdef CLEARCOAT_TEXTURE
clearCoatMapData,
#endif
#ifdef CLEARCOAT_TINT
vClearCoatTintParams,
clearCoatColorAtDistance,
vClearCoatRefractionParams,
#ifdef CLEARCOAT_TINT_TEXTURE
clearCoatTintMapData,
#endif
#endif
#ifdef CLEARCOAT_BUMP
vClearCoatBumpInfos,
clearCoatBumpMapData,
vClearCoatBumpUV,
#if defined(TANGENT) && defined(NORMAL)
vTBN,
#else
vClearCoatTangentSpaceParams,
#endif
#ifdef OBJECTSPACE_NORMALMAP
normalMatrix,
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
faceNormal,
#endif
#ifdef REFLECTION
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
vLightingIntensity,
reflectionSampler,
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
#ifdef RADIANCEOCCLUSION
ambientMonochrome,
#endif
#endif
#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
(gl_FrontFacing ? 1. : -1.),
#endif
clearcoatOut
);
#else
clearcoatOut.specularEnvironmentR0=specularEnvironmentR0;
#endif
#include<pbrBlockReflectance>
subSurfaceOutParams subSurfaceOut;
#ifdef SUBSURFACE
#ifdef SS_THICKNESSANDMASK_TEXTURE
vec4 thicknessMap=texture2D(thicknessSampler,vThicknessUV+uvOffset);
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
vec4 refractionIntensityMap=texture2D(refractionIntensitySampler,vRefractionIntensityUV+uvOffset);
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
vec4 translucencyIntensityMap=texture2D(translucencyIntensitySampler,vTranslucencyIntensityUV+uvOffset);
#endif
subSurfaceBlock(
vSubSurfaceIntensity,
vThicknessParam,
vTintColor,
normalW,
specularEnvironmentReflectance,
#ifdef SS_THICKNESSANDMASK_TEXTURE
thicknessMap,
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
refractionIntensityMap,
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
translucencyIntensityMap,
#endif
#ifdef REFLECTION
#ifdef SS_TRANSLUCENCY
reflectionMatrix,
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
reflectionOut.irradianceVector,
#endif
#if defined(REALTIME_FILTERING)
reflectionSampler,
vReflectionFilteringInfo,
#endif
#endif
#ifdef USEIRRADIANCEMAP
irradianceSampler,
#endif
#endif
#endif
#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
surfaceAlbedo,
#endif
#ifdef SS_REFRACTION
vPositionW,
viewDirectionW,
view,
vRefractionInfos,
refractionMatrix,
vRefractionMicrosurfaceInfos,
vLightingIntensity,
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
alpha,
#endif
#ifdef SS_LODINREFRACTIONALPHA
NdotVUnclamped,
#endif
#ifdef SS_LINEARSPECULARREFRACTION
roughness,
#endif
alphaG,
refractionSampler,
#ifndef LODBASEDMICROSFURACE
refractionSamplerLow,
refractionSamplerHigh,
#endif
#ifdef ANISOTROPIC
anisotropicOut,
#endif
#ifdef REALTIME_FILTERING
vRefractionFilteringInfo,
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
vRefractionPosition,
vRefractionSize,
#endif
#ifdef SS_DISPERSION
dispersion,
#endif
#endif
#ifdef SS_TRANSLUCENCY
vDiffusionDistance,
#endif
subSurfaceOut
);
#ifdef SS_REFRACTION
surfaceAlbedo=subSurfaceOut.surfaceAlbedo;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
alpha=subSurfaceOut.alpha;
#endif
#endif
#else
subSurfaceOut.specularEnvironmentReflectance=specularEnvironmentReflectance;
#endif
#include<pbrBlockDirectLighting>
#include<lightFragment>[0..maxSimultaneousLights]
#include<pbrBlockFinalLitComponents>
#endif 
#include<pbrBlockFinalUnlitComponents>
#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION
#include<pbrBlockFinalColorComposition>
#include<logDepthFragment>
#include<fogFragment>(color,finalColor)
#include<pbrBlockImageProcessing>
#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
#ifdef PREPASS
float writeGeometryInfo=finalColor.a>0.4 ? 1.0 : 0.0;
#ifdef PREPASS_POSITION
gl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);
#endif
#ifdef PREPASS_VELOCITY
vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO_SQRT
vec3 sqAlbedo=sqrt(surfaceAlbedo); 
#endif
#ifdef PREPASS_IRRADIANCE
vec3 irradiance=finalDiffuse;
#ifndef UNLIT
#ifdef REFLECTION
irradiance+=finalIrradiance;
#endif
#endif
#ifdef SS_SCATTERING
gl_FragData[0]=vec4(finalColor.rgb-irradiance,finalColor.a); 
irradiance/=sqAlbedo;
#else
gl_FragData[0]=finalColor; 
float scatteringDiffusionProfile=255.;
#endif
gl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(clamp(irradiance,vec3(0.),vec3(1.)),writeGeometryInfo*scatteringDiffusionProfile/255.); 
#else
gl_FragData[0]=vec4(finalColor.rgb,finalColor.a);
#endif
#ifdef PREPASS_DEPTH
gl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_NORMAL
#ifdef PREPASS_NORMAL_WORLDSPACE
gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalW,writeGeometryInfo); 
#else
gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo); 
#endif
#endif
#ifdef PREPASS_ALBEDO_SQRT
gl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(sqAlbedo,writeGeometryInfo); 
#endif
#ifdef PREPASS_REFLECTIVITY
#ifndef UNLIT
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(specularEnvironmentR0,microSurface)*writeGeometryInfo;
#else
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4( 0.0,0.0,0.0,1.0 )*writeGeometryInfo;
#endif
#endif
#endif
#if !defined(PREPASS) || defined(WEBGL2)
gl_FragColor=finalColor;
#endif
#include<oitFragment>
#if ORDER_INDEPENDENT_TRANSPARENCY
if (fragDepth==nearestDepth) {frontColor.rgb+=finalColor.rgb*finalColor.a*alphaMultiplier;frontColor.a=1.0-alphaMultiplier*(1.0-finalColor.a);} else {backColor+=finalColor;}
#endif
#include<pbrDebug>
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[Mce] = Lce;
const Kce = "pbrVertexDeclaration", Jce = `uniform mat4 view;uniform mat4 viewProjection;
#ifdef ALBEDO
uniform mat4 albedoMatrix;uniform vec2 vAlbedoInfos;
#endif
#ifdef AMBIENT
uniform mat4 ambientMatrix;uniform vec4 vAmbientInfos;
#endif
#ifdef OPACITY
uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;uniform mat4 emissiveMatrix;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;uniform mat4 lightmapMatrix;
#endif
#ifdef REFLECTIVITY 
uniform vec3 vReflectivityInfos;uniform mat4 reflectivityMatrix;
#endif
#ifdef METALLIC_REFLECTANCE
uniform vec2 vMetallicReflectanceInfos;uniform mat4 metallicReflectanceMatrix;
#endif
#ifdef REFLECTANCE
uniform vec2 vReflectanceInfos;uniform mat4 reflectanceMatrix;
#endif
#ifdef MICROSURFACEMAP
uniform vec2 vMicroSurfaceSamplerInfos;uniform mat4 microSurfaceSamplerMatrix;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;uniform mat4 bumpMatrix;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;
#endif
#ifdef CLEARCOAT
#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)
uniform vec4 vClearCoatInfos;
#endif
#ifdef CLEARCOAT_TEXTURE
uniform mat4 clearCoatMatrix;
#endif
#ifdef CLEARCOAT_TEXTURE_ROUGHNESS
uniform mat4 clearCoatRoughnessMatrix;
#endif
#ifdef CLEARCOAT_BUMP
uniform vec2 vClearCoatBumpInfos;uniform mat4 clearCoatBumpMatrix;
#endif
#ifdef CLEARCOAT_TINT_TEXTURE
uniform vec2 vClearCoatTintInfos;uniform mat4 clearCoatTintMatrix;
#endif
#endif
#ifdef IRIDESCENCE
#if defined(IRIDESCENCE_TEXTURE) || defined(IRIDESCENCE_THICKNESS_TEXTURE)
uniform vec4 vIridescenceInfos;
#endif
#ifdef IRIDESCENCE_TEXTURE
uniform mat4 iridescenceMatrix;
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
uniform mat4 iridescenceThicknessMatrix;
#endif
#endif
#ifdef ANISOTROPIC
#ifdef ANISOTROPIC_TEXTURE
uniform vec2 vAnisotropyInfos;uniform mat4 anisotropyMatrix;
#endif
#endif
#ifdef SHEEN
#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)
uniform vec4 vSheenInfos;
#endif
#ifdef SHEEN_TEXTURE
uniform mat4 sheenMatrix;
#endif
#ifdef SHEEN_TEXTURE_ROUGHNESS
uniform mat4 sheenRoughnessMatrix;
#endif
#endif
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
uniform vec4 vRefractionInfos;uniform mat4 refractionMatrix;
#endif
#ifdef SS_THICKNESSANDMASK_TEXTURE
uniform vec2 vThicknessInfos;uniform mat4 thicknessMatrix;
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
uniform vec2 vRefractionIntensityInfos;uniform mat4 refractionIntensityMatrix;
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
uniform vec2 vTranslucencyIntensityInfos;uniform mat4 translucencyIntensityMatrix;
#endif
#endif
#ifdef NORMAL
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
#ifdef USESPHERICALFROMREFLECTIONMAP
#ifdef SPHERICAL_HARMONICS
uniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22;
#else
uniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX;
#endif
#endif
#endif
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;uniform mat4 detailMatrix;
#endif
#include<decalVertexDeclaration>
#define ADDITIONAL_VERTEX_DECLARATION
`;
Le.IncludesShadersStore[Kce] = Jce;
const zce = "pbrVertexShader", Gce = `precision highp float;
#include<__decl__pbrVertex>
#define CUSTOM_VERTEX_BEGIN
attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef TANGENT
attribute vec4 tangent;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#include<uvAttributeDeclaration>[2..7]
#include<mainUVVaryingDeclaration>[1..7]
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<helperFunctions>
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
#include<prePassVertexDeclaration>
#include<samplerVertexDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo)
#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity)
#include<samplerVertexDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler)
#include<samplerVertexDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance)
#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance)
#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)
#ifdef CLEARCOAT
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint)
#endif
#ifdef IRIDESCENCE
#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence)
#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness)
#endif
#ifdef SHEEN
#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen)
#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)
#endif
#ifdef ANISOTROPIC
#include<samplerVertexDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy)
#endif
#ifdef SUBSURFACE
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness)
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity)
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity)
#endif
varying vec3 vPositionW;
#if DEBUGMODE>0
varying vec4 vClipSpacePosition;
#endif
#ifdef NORMAL
varying vec3 vNormalW;
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
varying vec3 vEnvironmentIrradiance;
#include<harmonicsFunctions>
#endif
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<bumpVertexDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 positionUpdated=position;
#ifdef NORMAL
vec3 normalUpdated=normal;
#endif
#ifdef TANGENT
vec4 tangentUpdated=tangent;
#endif
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
vPositionUVW=positionUpdated;
#endif
#define CUSTOM_VERTEX_UPDATE_POSITION
#define CUSTOM_VERTEX_UPDATE_NORMAL
#include<instancesVertex>
#if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);vPositionW=vec3(worldPos);
#include<prePassVertex>
#ifdef NORMAL
mat3 normalWorld=mat3(finalWorld);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vNormalW=normalize(normalWorld*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vNormalW=normalize(normalWorld*normalUpdated);
#endif
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
vec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz;
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);
#endif
#endif
#define CUSTOM_VERTEX_UPDATE_WORLDPOS
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}
#else
gl_Position=viewProjection*worldPos;
#endif
#if DEBUGMODE>0
vClipSpacePosition=gl_Position;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));
#endif
#ifndef UV1
vec2 uvUpdated=vec2(0.,0.);
#endif
#ifdef MAINUV1
vMainUV1=uvUpdated;
#endif
#include<uvVariableDeclaration>[2..7]
#include<samplerVertexImplementation>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_MATRIXNAME_,albedo,_INFONAME_,AlbedoInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_MATRIXNAME_,reflectivity,_INFONAME_,ReflectivityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_MATRIXNAME_,microSurfaceSampler,_INFONAME_,MicroSurfaceSamplerInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_MATRIXNAME_,metallicReflectance,_INFONAME_,MetallicReflectanceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_MATRIXNAME_,reflectance,_INFONAME_,ReflectanceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)
#ifdef CLEARCOAT
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_MATRIXNAME_,clearCoat,_INFONAME_,ClearCoatInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness,_MATRIXNAME_,clearCoatRoughness,_INFONAME_,ClearCoatInfos.z)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_MATRIXNAME_,clearCoatBump,_INFONAME_,ClearCoatBumpInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_MATRIXNAME_,clearCoatTint,_INFONAME_,ClearCoatTintInfos.x)
#endif
#ifdef IRIDESCENCE
#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_MATRIXNAME_,iridescence,_INFONAME_,IridescenceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_MATRIXNAME_,iridescenceThickness,_INFONAME_,IridescenceInfos.z)
#endif
#ifdef SHEEN
#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.z)
#endif
#ifdef ANISOTROPIC
#include<samplerVertexImplementation>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_MATRIXNAME_,anisotropy,_INFONAME_,AnisotropyInfos.x)
#endif
#ifdef SUBSURFACE
#include<samplerVertexImplementation>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_MATRIXNAME_,thickness,_INFONAME_,ThicknessInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_MATRIXNAME_,refractionIntensity,_INFONAME_,RefractionIntensityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_MATRIXNAME_,translucencyIntensity,_INFONAME_,TranslucencyIntensityInfos.x)
#endif
#include<bumpVertex>
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[zce] = Gce;
class Dte extends na {
  constructor() {
    super(...arguments), this.CLEARCOAT = !1, this.CLEARCOAT_DEFAULTIOR = !1, this.CLEARCOAT_TEXTURE = !1, this.CLEARCOAT_TEXTURE_ROUGHNESS = !1, this.CLEARCOAT_TEXTUREDIRECTUV = 0, this.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV = 0, this.CLEARCOAT_BUMP = !1, this.CLEARCOAT_BUMPDIRECTUV = 0, this.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, this.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = !1, this.CLEARCOAT_REMAP_F0 = !1, this.CLEARCOAT_TINT = !1, this.CLEARCOAT_TINT_TEXTURE = !1, this.CLEARCOAT_TINT_TEXTUREDIRECTUV = 0, this.CLEARCOAT_TINT_GAMMATEXTURE = !1;
  }
}
class h9 extends Gl {
  /** @internal */
  _markAllSubMeshesAsTexturesDirty() {
    this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();
  }
  constructor(e, t = !0) {
    super(e, "PBRClearCoat", 100, new Dte(), t), this._isEnabled = !1, this.isEnabled = !1, this.intensity = 1, this.roughness = 0, this._indexOfRefraction = h9._DefaultIndexOfRefraction, this.indexOfRefraction = h9._DefaultIndexOfRefraction, this._texture = null, this.texture = null, this._useRoughnessFromMainTexture = !0, this.useRoughnessFromMainTexture = !0, this._textureRoughness = null, this.textureRoughness = null, this._remapF0OnInterfaceChange = !0, this.remapF0OnInterfaceChange = !0, this._bumpTexture = null, this.bumpTexture = null, this._isTintEnabled = !1, this.isTintEnabled = !1, this.tintColor = Ne.White(), this.tintColorAtDistance = 1, this.tintThickness = 1, this._tintTexture = null, this.tintTexture = null, this._internalMarkAllSubMeshesAsTexturesDirty = e._dirtyCallbacks[1];
  }
  isReadyForSubMesh(e, t, r) {
    if (!this._isEnabled)
      return !0;
    const n = this._material._disableBumpMap;
    return !(e._areTexturesDirty && t.texturesEnabled && (this._texture && Dt.ClearCoatTextureEnabled && !this._texture.isReadyOrNotBlocking() || this._textureRoughness && Dt.ClearCoatTextureEnabled && !this._textureRoughness.isReadyOrNotBlocking() || r.getCaps().standardDerivatives && this._bumpTexture && Dt.ClearCoatBumpTextureEnabled && !n && !this._bumpTexture.isReady() || this._isTintEnabled && this._tintTexture && Dt.ClearCoatTintTextureEnabled && !this._tintTexture.isReadyOrNotBlocking()));
  }
  prepareDefinesBeforeAttributes(e, t) {
    var r;
    this._isEnabled ? (e.CLEARCOAT = !0, e.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture, e.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = this._texture !== null && this._texture._texture === ((r = this._textureRoughness) === null || r === void 0 ? void 0 : r._texture) && this._texture.checkTransformsAreIdentical(this._textureRoughness), e.CLEARCOAT_REMAP_F0 = this._remapF0OnInterfaceChange, e._areTexturesDirty && t.texturesEnabled && (this._texture && Dt.ClearCoatTextureEnabled ? Ye.PrepareDefinesForMergedUV(this._texture, e, "CLEARCOAT_TEXTURE") : e.CLEARCOAT_TEXTURE = !1, this._textureRoughness && Dt.ClearCoatTextureEnabled ? Ye.PrepareDefinesForMergedUV(this._textureRoughness, e, "CLEARCOAT_TEXTURE_ROUGHNESS") : e.CLEARCOAT_TEXTURE_ROUGHNESS = !1, this._bumpTexture && Dt.ClearCoatBumpTextureEnabled ? Ye.PrepareDefinesForMergedUV(this._bumpTexture, e, "CLEARCOAT_BUMP") : e.CLEARCOAT_BUMP = !1, e.CLEARCOAT_DEFAULTIOR = this._indexOfRefraction === h9._DefaultIndexOfRefraction, this._isTintEnabled ? (e.CLEARCOAT_TINT = !0, this._tintTexture && Dt.ClearCoatTintTextureEnabled ? (Ye.PrepareDefinesForMergedUV(this._tintTexture, e, "CLEARCOAT_TINT_TEXTURE"), e.CLEARCOAT_TINT_GAMMATEXTURE = this._tintTexture.gammaSpace) : e.CLEARCOAT_TINT_TEXTURE = !1) : (e.CLEARCOAT_TINT = !1, e.CLEARCOAT_TINT_TEXTURE = !1))) : (e.CLEARCOAT = !1, e.CLEARCOAT_TEXTURE = !1, e.CLEARCOAT_TEXTURE_ROUGHNESS = !1, e.CLEARCOAT_BUMP = !1, e.CLEARCOAT_TINT = !1, e.CLEARCOAT_TINT_TEXTURE = !1, e.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, e.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = !1, e.CLEARCOAT_DEFAULTIOR = !1, e.CLEARCOAT_TEXTUREDIRECTUV = 0, e.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV = 0, e.CLEARCOAT_BUMPDIRECTUV = 0, e.CLEARCOAT_REMAP_F0 = !1, e.CLEARCOAT_TINT_TEXTUREDIRECTUV = 0, e.CLEARCOAT_TINT_GAMMATEXTURE = !1);
  }
  bindForSubMesh(e, t, r, n) {
    var i, s, a, f, o, d, v, u;
    if (!this._isEnabled)
      return;
    const l = n.materialDefines, P = this._material.isFrozen, p = this._material._disableBumpMap, c = this._material._invertNormalMapX, H = this._material._invertNormalMapY, T = l.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL;
    if (!e.useUbo || !P || !e.isSync) {
      T && Dt.ClearCoatTextureEnabled ? (e.updateFloat4("vClearCoatInfos", this._texture.coordinatesIndex, this._texture.level, -1, -1), Ye.BindTextureMatrix(this._texture, e, "clearCoat")) : (this._texture || this._textureRoughness) && Dt.ClearCoatTextureEnabled && (e.updateFloat4("vClearCoatInfos", (s = (i = this._texture) === null || i === void 0 ? void 0 : i.coordinatesIndex) !== null && s !== void 0 ? s : 0, (f = (a = this._texture) === null || a === void 0 ? void 0 : a.level) !== null && f !== void 0 ? f : 0, (d = (o = this._textureRoughness) === null || o === void 0 ? void 0 : o.coordinatesIndex) !== null && d !== void 0 ? d : 0, (u = (v = this._textureRoughness) === null || v === void 0 ? void 0 : v.level) !== null && u !== void 0 ? u : 0), this._texture && Ye.BindTextureMatrix(this._texture, e, "clearCoat"), this._textureRoughness && !T && !l.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE && Ye.BindTextureMatrix(this._textureRoughness, e, "clearCoatRoughness")), this._bumpTexture && r.getCaps().standardDerivatives && Dt.ClearCoatTextureEnabled && !p && (e.updateFloat2("vClearCoatBumpInfos", this._bumpTexture.coordinatesIndex, this._bumpTexture.level), Ye.BindTextureMatrix(this._bumpTexture, e, "clearCoatBump"), t._mirroredCameraPosition ? e.updateFloat2("vClearCoatTangentSpaceParams", c ? 1 : -1, H ? 1 : -1) : e.updateFloat2("vClearCoatTangentSpaceParams", c ? -1 : 1, H ? -1 : 1)), this._tintTexture && Dt.ClearCoatTintTextureEnabled && (e.updateFloat2("vClearCoatTintInfos", this._tintTexture.coordinatesIndex, this._tintTexture.level), Ye.BindTextureMatrix(this._tintTexture, e, "clearCoatTint")), e.updateFloat2("vClearCoatParams", this.intensity, this.roughness);
      const q = 1 - this._indexOfRefraction, b = 1 + this._indexOfRefraction, j = Math.pow(-q / b, 2), w = 1 / this._indexOfRefraction;
      e.updateFloat4("vClearCoatRefractionParams", j, w, q, b), this._isTintEnabled && (e.updateFloat4("vClearCoatTintParams", this.tintColor.r, this.tintColor.g, this.tintColor.b, Math.max(1e-5, this.tintThickness)), e.updateFloat("clearCoatColorAtDistance", Math.max(1e-5, this.tintColorAtDistance)));
    }
    t.texturesEnabled && (this._texture && Dt.ClearCoatTextureEnabled && e.setTexture("clearCoatSampler", this._texture), this._textureRoughness && !T && !l.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE && Dt.ClearCoatTextureEnabled && e.setTexture("clearCoatRoughnessSampler", this._textureRoughness), this._bumpTexture && r.getCaps().standardDerivatives && Dt.ClearCoatBumpTextureEnabled && !p && e.setTexture("clearCoatBumpSampler", this._bumpTexture), this._isTintEnabled && this._tintTexture && Dt.ClearCoatTintTextureEnabled && e.setTexture("clearCoatTintSampler", this._tintTexture));
  }
  hasTexture(e) {
    return this._texture === e || this._textureRoughness === e || this._bumpTexture === e || this._tintTexture === e;
  }
  getActiveTextures(e) {
    this._texture && e.push(this._texture), this._textureRoughness && e.push(this._textureRoughness), this._bumpTexture && e.push(this._bumpTexture), this._tintTexture && e.push(this._tintTexture);
  }
  getAnimatables(e) {
    this._texture && this._texture.animations && this._texture.animations.length > 0 && e.push(this._texture), this._textureRoughness && this._textureRoughness.animations && this._textureRoughness.animations.length > 0 && e.push(this._textureRoughness), this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0 && e.push(this._bumpTexture), this._tintTexture && this._tintTexture.animations && this._tintTexture.animations.length > 0 && e.push(this._tintTexture);
  }
  dispose(e) {
    var t, r, n, i;
    e && ((t = this._texture) === null || t === void 0 || t.dispose(), (r = this._textureRoughness) === null || r === void 0 || r.dispose(), (n = this._bumpTexture) === null || n === void 0 || n.dispose(), (i = this._tintTexture) === null || i === void 0 || i.dispose());
  }
  getClassName() {
    return "PBRClearCoatConfiguration";
  }
  addFallbacks(e, t, r) {
    return e.CLEARCOAT_BUMP && t.addFallback(r++, "CLEARCOAT_BUMP"), e.CLEARCOAT_TINT && t.addFallback(r++, "CLEARCOAT_TINT"), e.CLEARCOAT && t.addFallback(r++, "CLEARCOAT"), r;
  }
  getSamplers(e) {
    e.push("clearCoatSampler", "clearCoatRoughnessSampler", "clearCoatBumpSampler", "clearCoatTintSampler");
  }
  getUniforms() {
    return {
      ubo: [
        { name: "vClearCoatParams", size: 2, type: "vec2" },
        { name: "vClearCoatRefractionParams", size: 4, type: "vec4" },
        { name: "vClearCoatInfos", size: 4, type: "vec4" },
        { name: "clearCoatMatrix", size: 16, type: "mat4" },
        { name: "clearCoatRoughnessMatrix", size: 16, type: "mat4" },
        { name: "vClearCoatBumpInfos", size: 2, type: "vec2" },
        { name: "vClearCoatTangentSpaceParams", size: 2, type: "vec2" },
        { name: "clearCoatBumpMatrix", size: 16, type: "mat4" },
        { name: "vClearCoatTintParams", size: 4, type: "vec4" },
        { name: "clearCoatColorAtDistance", size: 1, type: "float" },
        { name: "vClearCoatTintInfos", size: 2, type: "vec2" },
        { name: "clearCoatTintMatrix", size: 16, type: "mat4" }
      ]
    };
  }
}
h9._DefaultIndexOfRefraction = 1.5;
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], h9.prototype, "isEnabled", void 0);
C([
  M()
], h9.prototype, "intensity", void 0);
C([
  M()
], h9.prototype, "roughness", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], h9.prototype, "indexOfRefraction", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], h9.prototype, "texture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], h9.prototype, "useRoughnessFromMainTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], h9.prototype, "textureRoughness", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], h9.prototype, "remapF0OnInterfaceChange", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], h9.prototype, "bumpTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], h9.prototype, "isTintEnabled", void 0);
C([
  Oi()
], h9.prototype, "tintColor", void 0);
C([
  M()
], h9.prototype, "tintColorAtDistance", void 0);
C([
  M()
], h9.prototype, "tintThickness", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], h9.prototype, "tintTexture", void 0);
class jte extends na {
  constructor() {
    super(...arguments), this.IRIDESCENCE = !1, this.IRIDESCENCE_TEXTURE = !1, this.IRIDESCENCE_TEXTUREDIRECTUV = 0, this.IRIDESCENCE_THICKNESS_TEXTURE = !1, this.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV = 0, this.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE = !1;
  }
}
class dd extends Gl {
  /** @internal */
  _markAllSubMeshesAsTexturesDirty() {
    this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();
  }
  constructor(e, t = !0) {
    super(e, "PBRIridescence", 110, new jte(), t), this._isEnabled = !1, this.isEnabled = !1, this.intensity = 1, this.minimumThickness = dd._DefaultMinimumThickness, this.maximumThickness = dd._DefaultMaximumThickness, this.indexOfRefraction = dd._DefaultIndexOfRefraction, this._texture = null, this.texture = null, this._thicknessTexture = null, this.thicknessTexture = null, this._internalMarkAllSubMeshesAsTexturesDirty = e._dirtyCallbacks[1];
  }
  isReadyForSubMesh(e, t) {
    return this._isEnabled ? !(e._areTexturesDirty && t.texturesEnabled && (this._texture && Dt.IridescenceTextureEnabled && !this._texture.isReadyOrNotBlocking() || this._thicknessTexture && Dt.IridescenceTextureEnabled && !this._thicknessTexture.isReadyOrNotBlocking())) : !0;
  }
  prepareDefinesBeforeAttributes(e, t) {
    var r;
    this._isEnabled ? (e.IRIDESCENCE = !0, e.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE = this._texture !== null && this._texture._texture === ((r = this._thicknessTexture) === null || r === void 0 ? void 0 : r._texture) && this._texture.checkTransformsAreIdentical(this._thicknessTexture), e._areTexturesDirty && t.texturesEnabled && (this._texture && Dt.IridescenceTextureEnabled ? Ye.PrepareDefinesForMergedUV(this._texture, e, "IRIDESCENCE_TEXTURE") : e.IRIDESCENCE_TEXTURE = !1, !e.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE && this._thicknessTexture && Dt.IridescenceTextureEnabled ? Ye.PrepareDefinesForMergedUV(this._thicknessTexture, e, "IRIDESCENCE_THICKNESS_TEXTURE") : e.IRIDESCENCE_THICKNESS_TEXTURE = !1)) : (e.IRIDESCENCE = !1, e.IRIDESCENCE_TEXTURE = !1, e.IRIDESCENCE_THICKNESS_TEXTURE = !1, e.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE = !1, e.IRIDESCENCE_TEXTUREDIRECTUV = 0, e.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV = 0);
  }
  bindForSubMesh(e, t, r, n) {
    var i, s, a, f, o, d, v, u;
    if (!this._isEnabled)
      return;
    const l = n.materialDefines, P = this._material.isFrozen, p = l.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE;
    (!e.useUbo || !P || !e.isSync) && (p && Dt.IridescenceTextureEnabled ? (e.updateFloat4("vIridescenceInfos", this._texture.coordinatesIndex, this._texture.level, -1, -1), Ye.BindTextureMatrix(this._texture, e, "iridescence")) : (this._texture || this._thicknessTexture) && Dt.IridescenceTextureEnabled && (e.updateFloat4("vIridescenceInfos", (s = (i = this._texture) === null || i === void 0 ? void 0 : i.coordinatesIndex) !== null && s !== void 0 ? s : 0, (f = (a = this._texture) === null || a === void 0 ? void 0 : a.level) !== null && f !== void 0 ? f : 0, (d = (o = this._thicknessTexture) === null || o === void 0 ? void 0 : o.coordinatesIndex) !== null && d !== void 0 ? d : 0, (u = (v = this._thicknessTexture) === null || v === void 0 ? void 0 : v.level) !== null && u !== void 0 ? u : 0), this._texture && Ye.BindTextureMatrix(this._texture, e, "iridescence"), this._thicknessTexture && !p && !l.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE && Ye.BindTextureMatrix(this._thicknessTexture, e, "iridescenceThickness")), e.updateFloat4("vIridescenceParams", this.intensity, this.indexOfRefraction, this.minimumThickness, this.maximumThickness)), t.texturesEnabled && (this._texture && Dt.IridescenceTextureEnabled && e.setTexture("iridescenceSampler", this._texture), this._thicknessTexture && !p && !l.IRIDESCENCE_USE_THICKNESS_FROM_MAINTEXTURE && Dt.IridescenceTextureEnabled && e.setTexture("iridescenceThicknessSampler", this._thicknessTexture));
  }
  hasTexture(e) {
    return this._texture === e || this._thicknessTexture === e;
  }
  getActiveTextures(e) {
    this._texture && e.push(this._texture), this._thicknessTexture && e.push(this._thicknessTexture);
  }
  getAnimatables(e) {
    this._texture && this._texture.animations && this._texture.animations.length > 0 && e.push(this._texture), this._thicknessTexture && this._thicknessTexture.animations && this._thicknessTexture.animations.length > 0 && e.push(this._thicknessTexture);
  }
  dispose(e) {
    var t, r;
    e && ((t = this._texture) === null || t === void 0 || t.dispose(), (r = this._thicknessTexture) === null || r === void 0 || r.dispose());
  }
  getClassName() {
    return "PBRIridescenceConfiguration";
  }
  addFallbacks(e, t, r) {
    return e.IRIDESCENCE && t.addFallback(r++, "IRIDESCENCE"), r;
  }
  getSamplers(e) {
    e.push("iridescenceSampler", "iridescenceThicknessSampler");
  }
  getUniforms() {
    return {
      ubo: [
        { name: "vIridescenceParams", size: 4, type: "vec4" },
        { name: "vIridescenceInfos", size: 4, type: "vec4" },
        { name: "iridescenceMatrix", size: 16, type: "mat4" },
        { name: "iridescenceThicknessMatrix", size: 16, type: "mat4" }
      ]
    };
  }
}
dd._DefaultMinimumThickness = 100;
dd._DefaultMaximumThickness = 400;
dd._DefaultIndexOfRefraction = 1.3;
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], dd.prototype, "isEnabled", void 0);
C([
  M()
], dd.prototype, "intensity", void 0);
C([
  M()
], dd.prototype, "minimumThickness", void 0);
C([
  M()
], dd.prototype, "maximumThickness", void 0);
C([
  M()
], dd.prototype, "indexOfRefraction", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], dd.prototype, "texture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], dd.prototype, "thicknessTexture", void 0);
class wte extends na {
  constructor() {
    super(...arguments), this.ANISOTROPIC = !1, this.ANISOTROPIC_TEXTURE = !1, this.ANISOTROPIC_TEXTUREDIRECTUV = 0, this.ANISOTROPIC_LEGACY = !1, this.MAINUV1 = !1;
  }
}
class DD extends Gl {
  /**
   * Sets the anisotropy direction as an angle.
   */
  set angle(e) {
    this.direction.x = Math.cos(e), this.direction.y = Math.sin(e);
  }
  /**
   * Gets the anisotropy angle value in radians.
   * @returns the anisotropy angle value in radians.
   */
  get angle() {
    return Math.atan2(this.direction.y, this.direction.x);
  }
  /** @internal */
  _markAllSubMeshesAsTexturesDirty() {
    this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();
  }
  /** @internal */
  _markAllSubMeshesAsMiscDirty() {
    this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsMiscDirty();
  }
  constructor(e, t = !0) {
    super(e, "PBRAnisotropic", 110, new wte(), t), this._isEnabled = !1, this.isEnabled = !1, this.intensity = 1, this.direction = new at(1, 0), this._texture = null, this.texture = null, this._legacy = !1, this.legacy = !1, this._internalMarkAllSubMeshesAsTexturesDirty = e._dirtyCallbacks[1], this._internalMarkAllSubMeshesAsMiscDirty = e._dirtyCallbacks[16];
  }
  isReadyForSubMesh(e, t) {
    return this._isEnabled ? !(e._areTexturesDirty && t.texturesEnabled && this._texture && Dt.AnisotropicTextureEnabled && !this._texture.isReadyOrNotBlocking()) : !0;
  }
  prepareDefinesBeforeAttributes(e, t, r) {
    this._isEnabled ? (e.ANISOTROPIC = this._isEnabled, this._isEnabled && !r.isVerticesDataPresent(J.TangentKind) && (e._needUVs = !0, e.MAINUV1 = !0), e._areTexturesDirty && t.texturesEnabled && (this._texture && Dt.AnisotropicTextureEnabled ? Ye.PrepareDefinesForMergedUV(this._texture, e, "ANISOTROPIC_TEXTURE") : e.ANISOTROPIC_TEXTURE = !1), e._areMiscDirty && (e.ANISOTROPIC_LEGACY = this._legacy)) : (e.ANISOTROPIC = !1, e.ANISOTROPIC_TEXTURE = !1, e.ANISOTROPIC_TEXTUREDIRECTUV = 0, e.ANISOTROPIC_LEGACY = !1);
  }
  bindForSubMesh(e, t) {
    if (!this._isEnabled)
      return;
    const r = this._material.isFrozen;
    (!e.useUbo || !r || !e.isSync) && (this._texture && Dt.AnisotropicTextureEnabled && (e.updateFloat2("vAnisotropyInfos", this._texture.coordinatesIndex, this._texture.level), Ye.BindTextureMatrix(this._texture, e, "anisotropy")), e.updateFloat3("vAnisotropy", this.direction.x, this.direction.y, this.intensity)), t.texturesEnabled && this._texture && Dt.AnisotropicTextureEnabled && e.setTexture("anisotropySampler", this._texture);
  }
  hasTexture(e) {
    return this._texture === e;
  }
  getActiveTextures(e) {
    this._texture && e.push(this._texture);
  }
  getAnimatables(e) {
    this._texture && this._texture.animations && this._texture.animations.length > 0 && e.push(this._texture);
  }
  dispose(e) {
    e && this._texture && this._texture.dispose();
  }
  getClassName() {
    return "PBRAnisotropicConfiguration";
  }
  addFallbacks(e, t, r) {
    return e.ANISOTROPIC && t.addFallback(r++, "ANISOTROPIC"), r;
  }
  getSamplers(e) {
    e.push("anisotropySampler");
  }
  getUniforms() {
    return {
      ubo: [
        { name: "vAnisotropy", size: 3, type: "vec3" },
        { name: "vAnisotropyInfos", size: 2, type: "vec2" },
        { name: "anisotropyMatrix", size: 16, type: "mat4" }
      ]
    };
  }
  /**
   * Parses a anisotropy Configuration from a serialized object.
   * @param source - Serialized object.
   * @param scene Defines the scene we are parsing for
   * @param rootUrl Defines the rootUrl to load from
   */
  parse(e, t, r) {
    super.parse(e, t, r), e.legacy === void 0 && (this.legacy = !0);
  }
}
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], DD.prototype, "isEnabled", void 0);
C([
  M()
], DD.prototype, "intensity", void 0);
C([
  HR()
], DD.prototype, "direction", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], DD.prototype, "texture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsMiscDirty")
], DD.prototype, "legacy", void 0);
class mte extends na {
  constructor() {
    super(...arguments), this.SHEEN = !1, this.SHEEN_TEXTURE = !1, this.SHEEN_GAMMATEXTURE = !1, this.SHEEN_TEXTURE_ROUGHNESS = !1, this.SHEEN_TEXTUREDIRECTUV = 0, this.SHEEN_TEXTURE_ROUGHNESSDIRECTUV = 0, this.SHEEN_LINKWITHALBEDO = !1, this.SHEEN_ROUGHNESS = !1, this.SHEEN_ALBEDOSCALING = !1, this.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, this.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = !1;
  }
}
class K0 extends Gl {
  /** @internal */
  _markAllSubMeshesAsTexturesDirty() {
    this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();
  }
  constructor(e, t = !0) {
    super(e, "Sheen", 120, new mte(), t), this._isEnabled = !1, this.isEnabled = !1, this._linkSheenWithAlbedo = !1, this.linkSheenWithAlbedo = !1, this.intensity = 1, this.color = Ne.White(), this._texture = null, this.texture = null, this._useRoughnessFromMainTexture = !0, this.useRoughnessFromMainTexture = !0, this._roughness = null, this.roughness = null, this._textureRoughness = null, this.textureRoughness = null, this._albedoScaling = !1, this.albedoScaling = !1, this._internalMarkAllSubMeshesAsTexturesDirty = e._dirtyCallbacks[1];
  }
  isReadyForSubMesh(e, t) {
    return this._isEnabled ? !(e._areTexturesDirty && t.texturesEnabled && (this._texture && Dt.SheenTextureEnabled && !this._texture.isReadyOrNotBlocking() || this._textureRoughness && Dt.SheenTextureEnabled && !this._textureRoughness.isReadyOrNotBlocking())) : !0;
  }
  prepareDefinesBeforeAttributes(e, t) {
    var r;
    this._isEnabled ? (e.SHEEN = !0, e.SHEEN_LINKWITHALBEDO = this._linkSheenWithAlbedo, e.SHEEN_ROUGHNESS = this._roughness !== null, e.SHEEN_ALBEDOSCALING = this._albedoScaling, e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture, e.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = this._texture !== null && this._texture._texture === ((r = this._textureRoughness) === null || r === void 0 ? void 0 : r._texture) && this._texture.checkTransformsAreIdentical(this._textureRoughness), e._areTexturesDirty && t.texturesEnabled && (this._texture && Dt.SheenTextureEnabled ? (Ye.PrepareDefinesForMergedUV(this._texture, e, "SHEEN_TEXTURE"), e.SHEEN_GAMMATEXTURE = this._texture.gammaSpace) : e.SHEEN_TEXTURE = !1, this._textureRoughness && Dt.SheenTextureEnabled ? Ye.PrepareDefinesForMergedUV(this._textureRoughness, e, "SHEEN_TEXTURE_ROUGHNESS") : e.SHEEN_TEXTURE_ROUGHNESS = !1)) : (e.SHEEN = !1, e.SHEEN_TEXTURE = !1, e.SHEEN_TEXTURE_ROUGHNESS = !1, e.SHEEN_LINKWITHALBEDO = !1, e.SHEEN_ROUGHNESS = !1, e.SHEEN_ALBEDOSCALING = !1, e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, e.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = !1, e.SHEEN_GAMMATEXTURE = !1, e.SHEEN_TEXTUREDIRECTUV = 0, e.SHEEN_TEXTURE_ROUGHNESSDIRECTUV = 0);
  }
  bindForSubMesh(e, t, r, n) {
    var i, s, a, f, o, d, v, u;
    if (!this._isEnabled)
      return;
    const l = n.materialDefines, P = this._material.isFrozen, p = l.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL;
    (!e.useUbo || !P || !e.isSync) && (p && Dt.SheenTextureEnabled ? (e.updateFloat4("vSheenInfos", this._texture.coordinatesIndex, this._texture.level, -1, -1), Ye.BindTextureMatrix(this._texture, e, "sheen")) : (this._texture || this._textureRoughness) && Dt.SheenTextureEnabled && (e.updateFloat4("vSheenInfos", (s = (i = this._texture) === null || i === void 0 ? void 0 : i.coordinatesIndex) !== null && s !== void 0 ? s : 0, (f = (a = this._texture) === null || a === void 0 ? void 0 : a.level) !== null && f !== void 0 ? f : 0, (d = (o = this._textureRoughness) === null || o === void 0 ? void 0 : o.coordinatesIndex) !== null && d !== void 0 ? d : 0, (u = (v = this._textureRoughness) === null || v === void 0 ? void 0 : v.level) !== null && u !== void 0 ? u : 0), this._texture && Ye.BindTextureMatrix(this._texture, e, "sheen"), this._textureRoughness && !p && !l.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE && Ye.BindTextureMatrix(this._textureRoughness, e, "sheenRoughness")), e.updateFloat4("vSheenColor", this.color.r, this.color.g, this.color.b, this.intensity), this._roughness !== null && e.updateFloat("vSheenRoughness", this._roughness)), t.texturesEnabled && (this._texture && Dt.SheenTextureEnabled && e.setTexture("sheenSampler", this._texture), this._textureRoughness && !p && !l.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE && Dt.SheenTextureEnabled && e.setTexture("sheenRoughnessSampler", this._textureRoughness));
  }
  hasTexture(e) {
    return this._texture === e || this._textureRoughness === e;
  }
  getActiveTextures(e) {
    this._texture && e.push(this._texture), this._textureRoughness && e.push(this._textureRoughness);
  }
  getAnimatables(e) {
    this._texture && this._texture.animations && this._texture.animations.length > 0 && e.push(this._texture), this._textureRoughness && this._textureRoughness.animations && this._textureRoughness.animations.length > 0 && e.push(this._textureRoughness);
  }
  dispose(e) {
    var t, r;
    e && ((t = this._texture) === null || t === void 0 || t.dispose(), (r = this._textureRoughness) === null || r === void 0 || r.dispose());
  }
  getClassName() {
    return "PBRSheenConfiguration";
  }
  addFallbacks(e, t, r) {
    return e.SHEEN && t.addFallback(r++, "SHEEN"), r;
  }
  getSamplers(e) {
    e.push("sheenSampler", "sheenRoughnessSampler");
  }
  getUniforms() {
    return {
      ubo: [
        { name: "vSheenColor", size: 4, type: "vec4" },
        { name: "vSheenRoughness", size: 1, type: "float" },
        { name: "vSheenInfos", size: 4, type: "vec4" },
        { name: "sheenMatrix", size: 16, type: "mat4" },
        { name: "sheenRoughnessMatrix", size: 16, type: "mat4" }
      ]
    };
  }
}
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], K0.prototype, "isEnabled", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], K0.prototype, "linkSheenWithAlbedo", void 0);
C([
  M()
], K0.prototype, "intensity", void 0);
C([
  Oi()
], K0.prototype, "color", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], K0.prototype, "texture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], K0.prototype, "useRoughnessFromMainTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], K0.prototype, "roughness", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], K0.prototype, "textureRoughness", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], K0.prototype, "albedoScaling", void 0);
class Bte extends na {
  constructor() {
    super(...arguments), this.SUBSURFACE = !1, this.SS_REFRACTION = !1, this.SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE = !1, this.SS_TRANSLUCENCY = !1, this.SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE = !1, this.SS_SCATTERING = !1, this.SS_DISPERSION = !1, this.SS_THICKNESSANDMASK_TEXTURE = !1, this.SS_THICKNESSANDMASK_TEXTUREDIRECTUV = 0, this.SS_HAS_THICKNESS = !1, this.SS_REFRACTIONINTENSITY_TEXTURE = !1, this.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV = 0, this.SS_TRANSLUCENCYINTENSITY_TEXTURE = !1, this.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV = 0, this.SS_REFRACTIONMAP_3D = !1, this.SS_REFRACTIONMAP_OPPOSITEZ = !1, this.SS_LODINREFRACTIONALPHA = !1, this.SS_GAMMAREFRACTION = !1, this.SS_RGBDREFRACTION = !1, this.SS_LINEARSPECULARREFRACTION = !1, this.SS_LINKREFRACTIONTOTRANSPARENCY = !1, this.SS_ALBEDOFORREFRACTIONTINT = !1, this.SS_ALBEDOFORTRANSLUCENCYTINT = !1, this.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = !1, this.SS_USE_THICKNESS_AS_DEPTH = !1, this.SS_MASK_FROM_THICKNESS_TEXTURE = !1, this.SS_USE_GLTF_TEXTURES = !1;
  }
}
class _o extends Gl {
  /**
   * Diffusion profile for subsurface scattering.
   * Useful for better scattering in the skins or foliages.
   */
  get scatteringDiffusionProfile() {
    return this._scene.subSurfaceConfiguration ? this._scene.subSurfaceConfiguration.ssDiffusionProfileColors[this._scatteringDiffusionProfileIndex] : null;
  }
  set scatteringDiffusionProfile(e) {
    this._scene.enableSubSurfaceForPrePass() && e && (this._scatteringDiffusionProfileIndex = this._scene.subSurfaceConfiguration.addDiffusionProfile(e));
  }
  /**
   * Index of refraction of the material's volume.
   * https://en.wikipedia.org/wiki/List_of_refractive_indices
   *
   * This ONLY impacts refraction. If not provided or given a non-valid value,
   * the volume will use the same IOR as the surface.
   */
  get volumeIndexOfRefraction() {
    return this._volumeIndexOfRefraction >= 1 ? this._volumeIndexOfRefraction : this._indexOfRefraction;
  }
  set volumeIndexOfRefraction(e) {
    e >= 1 ? this._volumeIndexOfRefraction = e : this._volumeIndexOfRefraction = -1;
  }
  /** @internal */
  _markAllSubMeshesAsTexturesDirty() {
    this._enable(this._isRefractionEnabled || this._isTranslucencyEnabled || this._isScatteringEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();
  }
  /** @internal */
  _markScenePrePassDirty() {
    this._internalMarkAllSubMeshesAsTexturesDirty(), this._internalMarkScenePrePassDirty();
  }
  constructor(e, t = !0) {
    super(e, "PBRSubSurface", 130, new Bte(), t), this._isRefractionEnabled = !1, this.isRefractionEnabled = !1, this._isTranslucencyEnabled = !1, this.isTranslucencyEnabled = !1, this._isDispersionEnabled = !1, this.isDispersionEnabled = !1, this._isScatteringEnabled = !1, this.isScatteringEnabled = !1, this._scatteringDiffusionProfileIndex = 0, this.refractionIntensity = 1, this.translucencyIntensity = 1, this.useAlbedoToTintRefraction = !1, this.useAlbedoToTintTranslucency = !1, this._thicknessTexture = null, this.thicknessTexture = null, this._refractionTexture = null, this.refractionTexture = null, this._indexOfRefraction = 1.5, this.indexOfRefraction = 1.5, this._volumeIndexOfRefraction = -1, this._invertRefractionY = !1, this.invertRefractionY = !1, this._linkRefractionWithTransparency = !1, this.linkRefractionWithTransparency = !1, this.minimumThickness = 0, this.maximumThickness = 1, this.useThicknessAsDepth = !1, this.tintColor = Ne.White(), this.tintColorAtDistance = 1, this.dispersion = 0, this.diffusionDistance = Ne.White(), this._useMaskFromThicknessTexture = !1, this.useMaskFromThicknessTexture = !1, this._refractionIntensityTexture = null, this.refractionIntensityTexture = null, this._translucencyIntensityTexture = null, this.translucencyIntensityTexture = null, this._useGltfStyleTextures = !1, this.useGltfStyleTextures = !1, this._scene = e.getScene(), this.registerForExtraEvents = !0, this._internalMarkAllSubMeshesAsTexturesDirty = e._dirtyCallbacks[1], this._internalMarkScenePrePassDirty = e._dirtyCallbacks[32];
  }
  isReadyForSubMesh(e, t) {
    if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled)
      return !0;
    if (e._areTexturesDirty && t.texturesEnabled) {
      if (this._thicknessTexture && Dt.ThicknessTextureEnabled && !this._thicknessTexture.isReadyOrNotBlocking())
        return !1;
      const r = this._getRefractionTexture(t);
      if (r && Dt.RefractionTextureEnabled && !r.isReadyOrNotBlocking())
        return !1;
    }
    return !0;
  }
  prepareDefinesBeforeAttributes(e, t) {
    if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled) {
      e.SUBSURFACE = !1, e.SS_DISPERSION = !1, e.SS_TRANSLUCENCY = !1, e.SS_SCATTERING = !1, e.SS_REFRACTION = !1, e.SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE = !1, e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE = !1, e.SS_THICKNESSANDMASK_TEXTURE = !1, e.SS_THICKNESSANDMASK_TEXTUREDIRECTUV = 0, e.SS_HAS_THICKNESS = !1, e.SS_REFRACTIONINTENSITY_TEXTURE = !1, e.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV = 0, e.SS_TRANSLUCENCYINTENSITY_TEXTURE = !1, e.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV = 0, e.SS_REFRACTIONMAP_3D = !1, e.SS_REFRACTIONMAP_OPPOSITEZ = !1, e.SS_LODINREFRACTIONALPHA = !1, e.SS_GAMMAREFRACTION = !1, e.SS_RGBDREFRACTION = !1, e.SS_LINEARSPECULARREFRACTION = !1, e.SS_LINKREFRACTIONTOTRANSPARENCY = !1, e.SS_ALBEDOFORREFRACTIONTINT = !1, e.SS_ALBEDOFORTRANSLUCENCYTINT = !1, e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = !1, e.SS_USE_THICKNESS_AS_DEPTH = !1, e.SS_MASK_FROM_THICKNESS_TEXTURE = !1, e.SS_USE_GLTF_TEXTURES = !1;
      return;
    }
    if (e._areTexturesDirty) {
      e.SUBSURFACE = !0, e.SS_DISPERSION = this._isDispersionEnabled, e.SS_TRANSLUCENCY = this._isTranslucencyEnabled, e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE = !1, e.SS_SCATTERING = this._isScatteringEnabled, e.SS_THICKNESSANDMASK_TEXTURE = !1, e.SS_REFRACTIONINTENSITY_TEXTURE = !1, e.SS_TRANSLUCENCYINTENSITY_TEXTURE = !1, e.SS_HAS_THICKNESS = !1, e.SS_MASK_FROM_THICKNESS_TEXTURE = !1, e.SS_USE_GLTF_TEXTURES = !1, e.SS_REFRACTION = !1, e.SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE = !1, e.SS_REFRACTIONMAP_3D = !1, e.SS_GAMMAREFRACTION = !1, e.SS_RGBDREFRACTION = !1, e.SS_LINEARSPECULARREFRACTION = !1, e.SS_REFRACTIONMAP_OPPOSITEZ = !1, e.SS_LODINREFRACTIONALPHA = !1, e.SS_LINKREFRACTIONTOTRANSPARENCY = !1, e.SS_ALBEDOFORREFRACTIONTINT = !1, e.SS_ALBEDOFORTRANSLUCENCYTINT = !1, e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = !1, e.SS_USE_THICKNESS_AS_DEPTH = !1;
      const r = !!this._thicknessTexture && !!this._refractionIntensityTexture && this._refractionIntensityTexture.checkTransformsAreIdentical(this._thicknessTexture) && this._refractionIntensityTexture._texture === this._thicknessTexture._texture, n = !!this._thicknessTexture && !!this._translucencyIntensityTexture && this._translucencyIntensityTexture.checkTransformsAreIdentical(this._thicknessTexture) && this._translucencyIntensityTexture._texture === this._thicknessTexture._texture, i = (r || !this._refractionIntensityTexture) && (n || !this._translucencyIntensityTexture);
      if (e._areTexturesDirty && t.texturesEnabled && (this._thicknessTexture && Dt.ThicknessTextureEnabled && Ye.PrepareDefinesForMergedUV(this._thicknessTexture, e, "SS_THICKNESSANDMASK_TEXTURE"), this._refractionIntensityTexture && Dt.RefractionIntensityTextureEnabled && !i && Ye.PrepareDefinesForMergedUV(this._refractionIntensityTexture, e, "SS_REFRACTIONINTENSITY_TEXTURE"), this._translucencyIntensityTexture && Dt.TranslucencyIntensityTextureEnabled && !i && Ye.PrepareDefinesForMergedUV(this._translucencyIntensityTexture, e, "SS_TRANSLUCENCYINTENSITY_TEXTURE")), e.SS_HAS_THICKNESS = this.maximumThickness - this.minimumThickness !== 0, e.SS_MASK_FROM_THICKNESS_TEXTURE = (this._useMaskFromThicknessTexture || !!this._refractionIntensityTexture || !!this._translucencyIntensityTexture) && i, e.SS_USE_GLTF_TEXTURES = this._useGltfStyleTextures, e.SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE = (this._useMaskFromThicknessTexture || !!this._refractionIntensityTexture) && i, e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE = (this._useMaskFromThicknessTexture || !!this._translucencyIntensityTexture) && i, this._isRefractionEnabled && t.texturesEnabled) {
        const s = this._getRefractionTexture(t);
        s && Dt.RefractionTextureEnabled && (e.SS_REFRACTION = !0, e.SS_REFRACTIONMAP_3D = s.isCube, e.SS_GAMMAREFRACTION = s.gammaSpace, e.SS_RGBDREFRACTION = s.isRGBD, e.SS_LINEARSPECULARREFRACTION = s.linearSpecularLOD, e.SS_REFRACTIONMAP_OPPOSITEZ = this._scene.useRightHandedSystem && s.isCube ? !s.invertZ : s.invertZ, e.SS_LODINREFRACTIONALPHA = s.lodLevelInAlpha, e.SS_LINKREFRACTIONTOTRANSPARENCY = this._linkRefractionWithTransparency, e.SS_ALBEDOFORREFRACTIONTINT = this.useAlbedoToTintRefraction, e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = s.isCube && s.boundingBoxSize, e.SS_USE_THICKNESS_AS_DEPTH = this.useThicknessAsDepth);
      }
      this._isTranslucencyEnabled && (e.SS_ALBEDOFORTRANSLUCENCYTINT = this.useAlbedoToTintTranslucency);
    }
  }
  /**
   * Binds the material data (this function is called even if mustRebind() returns false)
   * @param uniformBuffer defines the Uniform buffer to fill in.
   * @param scene defines the scene the material belongs to.
   * @param engine defines the engine the material belongs to.
   * @param subMesh the submesh to bind data for
   */
  hardBindForSubMesh(e, t, r, n) {
    if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled)
      return;
    n.getRenderingMesh().getWorldMatrix().decompose(ue.Vector3[0]);
    const i = Math.max(Math.abs(ue.Vector3[0].x), Math.abs(ue.Vector3[0].y), Math.abs(ue.Vector3[0].z));
    e.updateFloat2("vThicknessParam", this.minimumThickness * i, (this.maximumThickness - this.minimumThickness) * i);
  }
  bindForSubMesh(e, t, r, n) {
    if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled)
      return;
    const i = n.materialDefines, s = this._material.isFrozen, a = this._material.realTimeFiltering, f = i.LODBASEDMICROSFURACE, o = this._getRefractionTexture(t);
    if (!e.useUbo || !s || !e.isSync) {
      if (this._thicknessTexture && Dt.ThicknessTextureEnabled && (e.updateFloat2("vThicknessInfos", this._thicknessTexture.coordinatesIndex, this._thicknessTexture.level), Ye.BindTextureMatrix(this._thicknessTexture, e, "thickness")), this._refractionIntensityTexture && Dt.RefractionIntensityTextureEnabled && i.SS_REFRACTIONINTENSITY_TEXTURE && (e.updateFloat2("vRefractionIntensityInfos", this._refractionIntensityTexture.coordinatesIndex, this._refractionIntensityTexture.level), Ye.BindTextureMatrix(this._refractionIntensityTexture, e, "refractionIntensity")), this._translucencyIntensityTexture && Dt.TranslucencyIntensityTextureEnabled && i.SS_TRANSLUCENCYINTENSITY_TEXTURE && (e.updateFloat2("vTranslucencyIntensityInfos", this._translucencyIntensityTexture.coordinatesIndex, this._translucencyIntensityTexture.level), Ye.BindTextureMatrix(this._translucencyIntensityTexture, e, "translucencyIntensity")), o && Dt.RefractionTextureEnabled) {
        e.updateMatrix("refractionMatrix", o.getRefractionTextureMatrix());
        let d = 1;
        o.isCube || o.depth && (d = o.depth);
        const v = o.getSize().width, u = this.volumeIndexOfRefraction;
        if (e.updateFloat4("vRefractionInfos", o.level, 1 / u, d, this._invertRefractionY ? -1 : 1), e.updateFloat4("vRefractionMicrosurfaceInfos", v, o.lodGenerationScale, o.lodGenerationOffset, 1 / this.indexOfRefraction), a && e.updateFloat2("vRefractionFilteringInfo", v, Xt.Log2(v)), o.boundingBoxSize) {
          const l = o;
          e.updateVector3("vRefractionPosition", l.boundingBoxPosition), e.updateVector3("vRefractionSize", l.boundingBoxSize);
        }
      }
      this._isScatteringEnabled && e.updateFloat("scatteringDiffusionProfile", this._scatteringDiffusionProfileIndex), e.updateColor3("vDiffusionDistance", this.diffusionDistance), e.updateFloat4("vTintColor", this.tintColor.r, this.tintColor.g, this.tintColor.b, Math.max(1e-5, this.tintColorAtDistance)), e.updateFloat3("vSubSurfaceIntensity", this.refractionIntensity, this.translucencyIntensity, 0), e.updateFloat("dispersion", this.dispersion);
    }
    t.texturesEnabled && (this._thicknessTexture && Dt.ThicknessTextureEnabled && e.setTexture("thicknessSampler", this._thicknessTexture), this._refractionIntensityTexture && Dt.RefractionIntensityTextureEnabled && i.SS_REFRACTIONINTENSITY_TEXTURE && e.setTexture("refractionIntensitySampler", this._refractionIntensityTexture), this._translucencyIntensityTexture && Dt.TranslucencyIntensityTextureEnabled && i.SS_TRANSLUCENCYINTENSITY_TEXTURE && e.setTexture("translucencyIntensitySampler", this._translucencyIntensityTexture), o && Dt.RefractionTextureEnabled && (f ? e.setTexture("refractionSampler", o) : (e.setTexture("refractionSampler", o._lodTextureMid || o), e.setTexture("refractionSamplerLow", o._lodTextureLow || o), e.setTexture("refractionSamplerHigh", o._lodTextureHigh || o))));
  }
  /**
   * Returns the texture used for refraction or null if none is used.
   * @param scene defines the scene the material belongs to.
   * @returns - Refraction texture if present.  If no refraction texture and refraction
   * is linked with transparency, returns environment texture.  Otherwise, returns null.
   */
  _getRefractionTexture(e) {
    return this._refractionTexture ? this._refractionTexture : this._isRefractionEnabled ? e.environmentTexture : null;
  }
  /**
   * Returns true if alpha blending should be disabled.
   */
  get disableAlphaBlending() {
    return this._isRefractionEnabled && this._linkRefractionWithTransparency;
  }
  /**
   * Fills the list of render target textures.
   * @param renderTargets the list of render targets to update
   */
  fillRenderTargetTextures(e) {
    Dt.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget && e.push(this._refractionTexture);
  }
  hasTexture(e) {
    return this._thicknessTexture === e || this._refractionTexture === e;
  }
  hasRenderTargetTextures() {
    return !!(Dt.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget);
  }
  getActiveTextures(e) {
    this._thicknessTexture && e.push(this._thicknessTexture), this._refractionTexture && e.push(this._refractionTexture);
  }
  getAnimatables(e) {
    this._thicknessTexture && this._thicknessTexture.animations && this._thicknessTexture.animations.length > 0 && e.push(this._thicknessTexture), this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0 && e.push(this._refractionTexture);
  }
  dispose(e) {
    e && (this._thicknessTexture && this._thicknessTexture.dispose(), this._refractionTexture && this._refractionTexture.dispose());
  }
  getClassName() {
    return "PBRSubSurfaceConfiguration";
  }
  addFallbacks(e, t, r) {
    return e.SS_SCATTERING && t.addFallback(r++, "SS_SCATTERING"), e.SS_TRANSLUCENCY && t.addFallback(r++, "SS_TRANSLUCENCY"), r;
  }
  getSamplers(e) {
    e.push("thicknessSampler", "refractionIntensitySampler", "translucencyIntensitySampler", "refractionSampler", "refractionSamplerLow", "refractionSamplerHigh");
  }
  getUniforms() {
    return {
      ubo: [
        { name: "vRefractionMicrosurfaceInfos", size: 4, type: "vec4" },
        { name: "vRefractionFilteringInfo", size: 2, type: "vec2" },
        { name: "vTranslucencyIntensityInfos", size: 2, type: "vec2" },
        { name: "vRefractionInfos", size: 4, type: "vec4" },
        { name: "refractionMatrix", size: 16, type: "mat4" },
        { name: "vThicknessInfos", size: 2, type: "vec2" },
        { name: "vRefractionIntensityInfos", size: 2, type: "vec2" },
        { name: "thicknessMatrix", size: 16, type: "mat4" },
        { name: "refractionIntensityMatrix", size: 16, type: "mat4" },
        { name: "translucencyIntensityMatrix", size: 16, type: "mat4" },
        { name: "vThicknessParam", size: 2, type: "vec2" },
        { name: "vDiffusionDistance", size: 3, type: "vec3" },
        { name: "vTintColor", size: 4, type: "vec4" },
        { name: "vSubSurfaceIntensity", size: 3, type: "vec3" },
        { name: "vRefractionPosition", size: 3, type: "vec3" },
        { name: "vRefractionSize", size: 3, type: "vec3" },
        { name: "scatteringDiffusionProfile", size: 1, type: "float" },
        { name: "dispersion", size: 1, type: "float" }
      ]
    };
  }
}
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "isRefractionEnabled", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "isTranslucencyEnabled", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "isDispersionEnabled", void 0);
C([
  M(),
  At("_markScenePrePassDirty")
], _o.prototype, "isScatteringEnabled", void 0);
C([
  M()
], _o.prototype, "_scatteringDiffusionProfileIndex", void 0);
C([
  M()
], _o.prototype, "refractionIntensity", void 0);
C([
  M()
], _o.prototype, "translucencyIntensity", void 0);
C([
  M()
], _o.prototype, "useAlbedoToTintRefraction", void 0);
C([
  M()
], _o.prototype, "useAlbedoToTintTranslucency", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "thicknessTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "refractionTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "indexOfRefraction", void 0);
C([
  M()
], _o.prototype, "_volumeIndexOfRefraction", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "volumeIndexOfRefraction", null);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "invertRefractionY", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "linkRefractionWithTransparency", void 0);
C([
  M()
], _o.prototype, "minimumThickness", void 0);
C([
  M()
], _o.prototype, "maximumThickness", void 0);
C([
  M()
], _o.prototype, "useThicknessAsDepth", void 0);
C([
  Oi()
], _o.prototype, "tintColor", void 0);
C([
  M()
], _o.prototype, "tintColorAtDistance", void 0);
C([
  M()
], _o.prototype, "dispersion", void 0);
C([
  Oi()
], _o.prototype, "diffusionDistance", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "useMaskFromThicknessTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "refractionIntensityTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "translucencyIntensityTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], _o.prototype, "useGltfStyleTextures", void 0);
const UW = { effect: null, subMesh: null };
class cF extends na {
  /**
   * Initializes the PBR Material defines.
   * @param externalProperties The external properties
   */
  constructor(e) {
    super(e), this.PBR = !0, this.NUM_SAMPLES = "0", this.REALTIME_FILTERING = !1, this.MAINUV1 = !1, this.MAINUV2 = !1, this.MAINUV3 = !1, this.MAINUV4 = !1, this.MAINUV5 = !1, this.MAINUV6 = !1, this.UV1 = !1, this.UV2 = !1, this.UV3 = !1, this.UV4 = !1, this.UV5 = !1, this.UV6 = !1, this.ALBEDO = !1, this.GAMMAALBEDO = !1, this.ALBEDODIRECTUV = 0, this.VERTEXCOLOR = !1, this.BAKED_VERTEX_ANIMATION_TEXTURE = !1, this.AMBIENT = !1, this.AMBIENTDIRECTUV = 0, this.AMBIENTINGRAYSCALE = !1, this.OPACITY = !1, this.VERTEXALPHA = !1, this.OPACITYDIRECTUV = 0, this.OPACITYRGB = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.ALPHABLEND = !1, this.ALPHAFROMALBEDO = !1, this.ALPHATESTVALUE = "0.5", this.SPECULAROVERALPHA = !1, this.RADIANCEOVERALPHA = !1, this.ALPHAFRESNEL = !1, this.LINEARALPHAFRESNEL = !1, this.PREMULTIPLYALPHA = !1, this.EMISSIVE = !1, this.EMISSIVEDIRECTUV = 0, this.GAMMAEMISSIVE = !1, this.REFLECTIVITY = !1, this.REFLECTIVITY_GAMMA = !1, this.REFLECTIVITYDIRECTUV = 0, this.SPECULARTERM = !1, this.MICROSURFACEFROMREFLECTIVITYMAP = !1, this.MICROSURFACEAUTOMATIC = !1, this.LODBASEDMICROSFURACE = !1, this.MICROSURFACEMAP = !1, this.MICROSURFACEMAPDIRECTUV = 0, this.METALLICWORKFLOW = !1, this.ROUGHNESSSTOREINMETALMAPALPHA = !1, this.ROUGHNESSSTOREINMETALMAPGREEN = !1, this.METALLNESSSTOREINMETALMAPBLUE = !1, this.AOSTOREINMETALMAPRED = !1, this.METALLIC_REFLECTANCE = !1, this.METALLIC_REFLECTANCE_GAMMA = !1, this.METALLIC_REFLECTANCEDIRECTUV = 0, this.METALLIC_REFLECTANCE_USE_ALPHA_ONLY = !1, this.REFLECTANCE = !1, this.REFLECTANCE_GAMMA = !1, this.REFLECTANCEDIRECTUV = 0, this.ENVIRONMENTBRDF = !1, this.ENVIRONMENTBRDF_RGBD = !1, this.NORMAL = !1, this.TANGENT = !1, this.BUMP = !1, this.BUMPDIRECTUV = 0, this.OBJECTSPACE_NORMALMAP = !1, this.PARALLAX = !1, this.PARALLAX_RHS = !1, this.PARALLAXOCCLUSION = !1, this.NORMALXYSCALE = !0, this.LIGHTMAP = !1, this.LIGHTMAPDIRECTUV = 0, this.USELIGHTMAPASSHADOWMAP = !1, this.GAMMALIGHTMAP = !1, this.RGBDLIGHTMAP = !1, this.REFLECTION = !1, this.REFLECTIONMAP_3D = !1, this.REFLECTIONMAP_SPHERICAL = !1, this.REFLECTIONMAP_PLANAR = !1, this.REFLECTIONMAP_CUBIC = !1, this.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, this.REFLECTIONMAP_PROJECTION = !1, this.REFLECTIONMAP_SKYBOX = !1, this.REFLECTIONMAP_EXPLICIT = !1, this.REFLECTIONMAP_EQUIRECTANGULAR = !1, this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, this.INVERTCUBICMAP = !1, this.USESPHERICALFROMREFLECTIONMAP = !1, this.USEIRRADIANCEMAP = !1, this.USESPHERICALINVERTEX = !1, this.REFLECTIONMAP_OPPOSITEZ = !1, this.LODINREFLECTIONALPHA = !1, this.GAMMAREFLECTION = !1, this.RGBDREFLECTION = !1, this.LINEARSPECULARREFLECTION = !1, this.RADIANCEOCCLUSION = !1, this.HORIZONOCCLUSION = !1, this.INSTANCES = !1, this.THIN_INSTANCES = !1, this.INSTANCESCOLOR = !1, this.PREPASS = !1, this.PREPASS_IRRADIANCE = !1, this.PREPASS_IRRADIANCE_INDEX = -1, this.PREPASS_ALBEDO_SQRT = !1, this.PREPASS_ALBEDO_SQRT_INDEX = -1, this.PREPASS_DEPTH = !1, this.PREPASS_DEPTH_INDEX = -1, this.PREPASS_NORMAL = !1, this.PREPASS_NORMAL_INDEX = -1, this.PREPASS_NORMAL_WORLDSPACE = !1, this.PREPASS_POSITION = !1, this.PREPASS_POSITION_INDEX = -1, this.PREPASS_VELOCITY = !1, this.PREPASS_VELOCITY_INDEX = -1, this.PREPASS_REFLECTIVITY = !1, this.PREPASS_REFLECTIVITY_INDEX = -1, this.SCENE_MRT_COUNT = 0, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.BONETEXTURE = !1, this.BONES_VELOCITY_ENABLED = !1, this.NONUNIFORMSCALING = !1, this.MORPHTARGETS = !1, this.MORPHTARGETS_NORMAL = !1, this.MORPHTARGETS_TANGENT = !1, this.MORPHTARGETS_UV = !1, this.NUM_MORPH_INFLUENCERS = 0, this.MORPHTARGETS_TEXTURE = !1, this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.EXPOSURE = !1, this.MULTIVIEW = !1, this.ORDER_INDEPENDENT_TRANSPARENCY = !1, this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = !1, this.USEPHYSICALLIGHTFALLOFF = !1, this.USEGLTFLIGHTFALLOFF = !1, this.TWOSIDEDLIGHTING = !1, this.SHADOWFLOAT = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.POINTSIZE = !1, this.FOG = !1, this.LOGARITHMICDEPTH = !1, this.CAMERA_ORTHOGRAPHIC = !1, this.CAMERA_PERSPECTIVE = !1, this.FORCENORMALFORWARD = !1, this.SPECULARAA = !1, this.UNLIT = !1, this.DECAL_AFTER_DETAIL = !1, this.DEBUGMODE = 0, this.rebuild();
  }
  /**
   * Resets the PBR Material defines.
   */
  reset() {
    super.reset(), this.ALPHATESTVALUE = "0.5", this.PBR = !0, this.NORMALXYSCALE = !0;
  }
}
class fs extends P1 {
  /**
   * Enables realtime filtering on the texture.
   */
  get realTimeFiltering() {
    return this._realTimeFiltering;
  }
  set realTimeFiltering(e) {
    this._realTimeFiltering = e, this.markAsDirty(1);
  }
  /**
   * Quality switch for realtime filtering
   */
  get realTimeFilteringQuality() {
    return this._realTimeFilteringQuality;
  }
  set realTimeFilteringQuality(e) {
    this._realTimeFilteringQuality = e, this.markAsDirty(1);
  }
  /**
   * Can this material render to several textures at once
   */
  get canRenderToMRT() {
    return !0;
  }
  /**
   * Attaches a new image processing configuration to the PBR Material.
   * @param configuration
   */
  _attachImageProcessingConfiguration(e) {
    e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), e ? this._imageProcessingConfiguration = e : this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
      this._markAllSubMeshesAsImageProcessingDirty();
    })));
  }
  /**
   * Instantiates a new PBRMaterial instance.
   *
   * @param name The material name
   * @param scene The scene the material will be use in.
   */
  constructor(e, t) {
    super(e, t), this._directIntensity = 1, this._emissiveIntensity = 1, this._environmentIntensity = 1, this._specularIntensity = 1, this._lightingInfos = new Ir(this._directIntensity, this._emissiveIntensity, this._environmentIntensity, this._specularIntensity), this._disableBumpMap = !1, this._albedoTexture = null, this._ambientTexture = null, this._ambientTextureStrength = 1, this._ambientTextureImpactOnAnalyticalLights = fs.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, this._opacityTexture = null, this._reflectionTexture = null, this._emissiveTexture = null, this._reflectivityTexture = null, this._metallicTexture = null, this._metallic = null, this._roughness = null, this._metallicF0Factor = 1, this._metallicReflectanceColor = Ne.White(), this._useOnlyMetallicFromMetallicReflectanceTexture = !1, this._metallicReflectanceTexture = null, this._reflectanceTexture = null, this._microSurfaceTexture = null, this._bumpTexture = null, this._lightmapTexture = null, this._ambientColor = new Ne(0, 0, 0), this._albedoColor = new Ne(1, 1, 1), this._reflectivityColor = new Ne(1, 1, 1), this._reflectionColor = new Ne(1, 1, 1), this._emissiveColor = new Ne(0, 0, 0), this._microSurface = 0.9, this._useLightmapAsShadowmap = !1, this._useHorizonOcclusion = !0, this._useRadianceOcclusion = !0, this._useAlphaFromAlbedoTexture = !1, this._useSpecularOverAlpha = !0, this._useMicroSurfaceFromReflectivityMapAlpha = !1, this._useRoughnessFromMetallicTextureAlpha = !0, this._useRoughnessFromMetallicTextureGreen = !1, this._useMetallnessFromMetallicTextureBlue = !1, this._useAmbientOcclusionFromMetallicTextureRed = !1, this._useAmbientInGrayScale = !1, this._useAutoMicroSurfaceFromReflectivityMap = !1, this._lightFalloff = fs.LIGHTFALLOFF_PHYSICAL, this._useRadianceOverAlpha = !0, this._useObjectSpaceNormalMap = !1, this._useParallax = !1, this._useParallaxOcclusion = !1, this._parallaxScaleBias = 0.05, this._disableLighting = !1, this._maxSimultaneousLights = 4, this._invertNormalMapX = !1, this._invertNormalMapY = !1, this._twoSidedLighting = !1, this._alphaCutOff = 0.4, this._forceAlphaTest = !1, this._useAlphaFresnel = !1, this._useLinearAlphaFresnel = !1, this._environmentBRDFTexture = null, this._forceIrradianceInFragment = !1, this._realTimeFiltering = !1, this._realTimeFilteringQuality = 8, this._forceNormalForward = !1, this._enableSpecularAntiAliasing = !1, this._imageProcessingObserver = null, this._renderTargets = new qf(16), this._globalAmbientColor = new Ne(0, 0, 0), this._unlit = !1, this._applyDecalMapAfterDetailMap = !1, this._debugMode = 0, this.debugMode = 0, this.debugLimit = -1, this.debugFactor = 1, this._cacheHasRenderTargetTextures = !1, this.brdf = new fd(this), this.clearCoat = new h9(this), this.iridescence = new dd(this), this.anisotropy = new DD(this), this.sheen = new K0(this), this.subSurface = new _o(this), this.detailMap = new l4(this), this._attachImageProcessingConfiguration(null), this.getRenderTargetTextures = () => (this._renderTargets.reset(), Dt.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._renderTargets.push(this._reflectionTexture), this._eventInfo.renderTargets = this._renderTargets, this._callbackPluginEventFillRenderTargetTextures(this._eventInfo), this._renderTargets), this._environmentBRDFTexture = nV(this.getScene()), this.prePassConfiguration = new GC();
  }
  /**
   * Gets a boolean indicating that current material needs to register RTT
   */
  get hasRenderTargetTextures() {
    return Dt.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget ? !0 : this._cacheHasRenderTargetTextures;
  }
  /**
   * Can this material render to prepass
   */
  get isPrePassCapable() {
    return !this.disableDepthWrite;
  }
  /**
   * Gets the name of the material class.
   */
  getClassName() {
    return "PBRBaseMaterial";
  }
  /**
   * Returns true if alpha blending should be disabled.
   */
  get _disableAlphaBlending() {
    var e;
    return this._transparencyMode === fs.PBRMATERIAL_OPAQUE || this._transparencyMode === fs.PBRMATERIAL_ALPHATEST || ((e = this.subSurface) === null || e === void 0 ? void 0 : e.disableAlphaBlending);
  }
  /**
   * Specifies whether or not this material should be rendered in alpha blend mode.
   */
  needAlphaBlending() {
    return this._disableAlphaBlending ? !1 : this.alpha < 1 || this._opacityTexture != null || this._shouldUseAlphaFromAlbedoTexture();
  }
  /**
   * Specifies whether or not this material should be rendered in alpha test mode.
   */
  needAlphaTesting() {
    var e;
    return this._forceAlphaTest ? !0 : !((e = this.subSurface) === null || e === void 0) && e.disableAlphaBlending ? !1 : this._hasAlphaChannel() && (this._transparencyMode == null || this._transparencyMode === fs.PBRMATERIAL_ALPHATEST);
  }
  /**
   * Specifies whether or not the alpha value of the albedo texture should be used for alpha blending.
   */
  _shouldUseAlphaFromAlbedoTexture() {
    return this._albedoTexture != null && this._albedoTexture.hasAlpha && this._useAlphaFromAlbedoTexture && this._transparencyMode !== fs.PBRMATERIAL_OPAQUE;
  }
  /**
   * Specifies whether or not there is a usable alpha channel for transparency.
   */
  _hasAlphaChannel() {
    return this._albedoTexture != null && this._albedoTexture.hasAlpha || this._opacityTexture != null;
  }
  /**
   * Gets the texture used for the alpha test.
   */
  getAlphaTestTexture() {
    return this._albedoTexture;
  }
  /**
   * Specifies that the submesh is ready to be used.
   * @param mesh - BJS mesh.
   * @param subMesh - A submesh of the BJS mesh.  Used to check if it is ready.
   * @param useInstances - Specifies that instances should be used.
   * @returns - boolean indicating that the submesh is ready or not.
   */
  isReadyForSubMesh(e, t, r) {
    var n;
    if (this._uniformBufferLayoutBuilt || this.buildUniformLayout(), t.effect && this.isFrozen && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (this._callbackPluginEventGeneric(x6.GetDefineNames, this._eventInfo), t.materialDefines = new cF(this._eventInfo.defineNames));
    const i = t.materialDefines;
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = this.getScene(), a = s.getEngine();
    if (i._areTexturesDirty && (this._eventInfo.hasRenderTargetTextures = !1, this._callbackPluginEventHasRenderTargetTextures(this._eventInfo), this._cacheHasRenderTargetTextures = this._eventInfo.hasRenderTargetTextures, s.texturesEnabled)) {
      if (this._albedoTexture && Dt.DiffuseTextureEnabled && !this._albedoTexture.isReadyOrNotBlocking() || this._ambientTexture && Dt.AmbientTextureEnabled && !this._ambientTexture.isReadyOrNotBlocking() || this._opacityTexture && Dt.OpacityTextureEnabled && !this._opacityTexture.isReadyOrNotBlocking())
        return !1;
      const u = this._getReflectionTexture();
      if (u && Dt.ReflectionTextureEnabled) {
        if (!u.isReadyOrNotBlocking())
          return !1;
        if (u.irradianceTexture) {
          if (!u.irradianceTexture.isReadyOrNotBlocking())
            return !1;
        } else if (!u.sphericalPolynomial && (!((n = u.getInternalTexture()) === null || n === void 0) && n._sphericalPolynomialPromise))
          return !1;
      }
      if (this._lightmapTexture && Dt.LightmapTextureEnabled && !this._lightmapTexture.isReadyOrNotBlocking() || this._emissiveTexture && Dt.EmissiveTextureEnabled && !this._emissiveTexture.isReadyOrNotBlocking())
        return !1;
      if (Dt.SpecularTextureEnabled) {
        if (this._metallicTexture) {
          if (!this._metallicTexture.isReadyOrNotBlocking())
            return !1;
        } else if (this._reflectivityTexture && !this._reflectivityTexture.isReadyOrNotBlocking())
          return !1;
        if (this._metallicReflectanceTexture && !this._metallicReflectanceTexture.isReadyOrNotBlocking() || this._reflectanceTexture && !this._reflectanceTexture.isReadyOrNotBlocking() || this._microSurfaceTexture && !this._microSurfaceTexture.isReadyOrNotBlocking())
          return !1;
      }
      if (a.getCaps().standardDerivatives && this._bumpTexture && Dt.BumpTextureEnabled && !this._disableBumpMap && !this._bumpTexture.isReady() || this._environmentBRDFTexture && Dt.ReflectionTextureEnabled && !this._environmentBRDFTexture.isReady())
        return !1;
    }
    if (this._eventInfo.isReadyForSubMesh = !0, this._eventInfo.defines = i, this._eventInfo.subMesh = t, this._callbackPluginEventIsReadyForSubMesh(this._eventInfo), !this._eventInfo.isReadyForSubMesh || i._areImageProcessingDirty && this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady())
      return !1;
    !a.getCaps().standardDerivatives && !e.isVerticesDataPresent(J.NormalKind) && (e.createNormals(!0), Se.Warn("PBRMaterial: Normals have been created for the mesh: " + e.name));
    const f = t.effect, o = i._areLightsDisposed;
    let d = this._prepareEffect(e, i, this.onCompiled, this.onError, r, null, t.getRenderingMesh().hasThinInstances), v = !1;
    if (d)
      if (this._onEffectCreatedObservable && (UW.effect = d, UW.subMesh = t, this._onEffectCreatedObservable.notifyObservers(UW)), this.allowShaderHotSwapping && f && !d.isReady()) {
        if (d = f, i.markAsUnprocessed(), v = this.isFrozen, o)
          return i._areLightsDisposed = !0, !1;
      } else
        s.resetCachedMaterial(), t.setEffect(d, i, this._materialContext);
    return !t.effect || !t.effect.isReady() ? !1 : (i._renderId = s.getRenderId(), t.effect._wasPreviouslyReady = !v, t.effect._wasPreviouslyUsingInstances = !!r, this._checkScenePerformancePriority(), !0);
  }
  /**
   * Specifies if the material uses metallic roughness workflow.
   * @returns boolean specifying if the material uses metallic roughness workflow.
   */
  isMetallicWorkflow() {
    return !!(this._metallic != null || this._roughness != null || this._metallicTexture);
  }
  _prepareEffect(e, t, r = null, n = null, i = null, s = null, a) {
    if (this._prepareDefines(e, t, i, s, a), !t.isDirty)
      return null;
    t.markAsProcessed();
    const o = this.getScene().getEngine(), d = new c1();
    let v = 0;
    t.USESPHERICALINVERTEX && d.addFallback(v++, "USESPHERICALINVERTEX"), t.FOG && d.addFallback(v, "FOG"), t.SPECULARAA && d.addFallback(v, "SPECULARAA"), t.POINTSIZE && d.addFallback(v, "POINTSIZE"), t.LOGARITHMICDEPTH && d.addFallback(v, "LOGARITHMICDEPTH"), t.PARALLAX && d.addFallback(v, "PARALLAX"), t.PARALLAX_RHS && d.addFallback(v, "PARALLAX_RHS"), t.PARALLAXOCCLUSION && d.addFallback(v++, "PARALLAXOCCLUSION"), t.ENVIRONMENTBRDF && d.addFallback(v++, "ENVIRONMENTBRDF"), t.TANGENT && d.addFallback(v++, "TANGENT"), t.BUMP && d.addFallback(v++, "BUMP"), v = Ye.HandleFallbacksForShadows(t, d, this._maxSimultaneousLights, v++), t.SPECULARTERM && d.addFallback(v++, "SPECULARTERM"), t.USESPHERICALFROMREFLECTIONMAP && d.addFallback(v++, "USESPHERICALFROMREFLECTIONMAP"), t.USEIRRADIANCEMAP && d.addFallback(v++, "USEIRRADIANCEMAP"), t.LIGHTMAP && d.addFallback(v++, "LIGHTMAP"), t.NORMAL && d.addFallback(v++, "NORMAL"), t.AMBIENT && d.addFallback(v++, "AMBIENT"), t.EMISSIVE && d.addFallback(v++, "EMISSIVE"), t.VERTEXCOLOR && d.addFallback(v++, "VERTEXCOLOR"), t.MORPHTARGETS && d.addFallback(v++, "MORPHTARGETS"), t.MULTIVIEW && d.addFallback(0, "MULTIVIEW");
    const u = [J.PositionKind];
    t.NORMAL && u.push(J.NormalKind), t.TANGENT && u.push(J.TangentKind);
    for (let j = 1; j <= 6; ++j)
      t["UV" + j] && u.push(`uv${j === 1 ? "" : j}`);
    t.VERTEXCOLOR && u.push(J.ColorKind), t.INSTANCESCOLOR && u.push(J.ColorInstanceKind), Ye.PrepareAttributesForBones(u, e, t, d), Ye.PrepareAttributesForInstances(u, t), Ye.PrepareAttributesForMorphTargets(u, e, t), Ye.PrepareAttributesForBakedVertexAnimation(u, e, t);
    let l = "pbr";
    const P = [
      "world",
      "view",
      "viewProjection",
      "vEyePosition",
      "vLightsType",
      "vAmbientColor",
      "vAlbedoColor",
      "vReflectivityColor",
      "vMetallicReflectanceFactors",
      "vEmissiveColor",
      "visibility",
      "vReflectionColor",
      "vFogInfos",
      "vFogColor",
      "pointSize",
      "vAlbedoInfos",
      "vAmbientInfos",
      "vOpacityInfos",
      "vReflectionInfos",
      "vReflectionPosition",
      "vReflectionSize",
      "vEmissiveInfos",
      "vReflectivityInfos",
      "vReflectionFilteringInfo",
      "vMetallicReflectanceInfos",
      "vReflectanceInfos",
      "vMicroSurfaceSamplerInfos",
      "vBumpInfos",
      "vLightmapInfos",
      "mBones",
      "albedoMatrix",
      "ambientMatrix",
      "opacityMatrix",
      "reflectionMatrix",
      "emissiveMatrix",
      "reflectivityMatrix",
      "normalMatrix",
      "microSurfaceSamplerMatrix",
      "bumpMatrix",
      "lightmapMatrix",
      "metallicReflectanceMatrix",
      "reflectanceMatrix",
      "vLightingIntensity",
      "logarithmicDepthConstant",
      "vSphericalX",
      "vSphericalY",
      "vSphericalZ",
      "vSphericalXX_ZZ",
      "vSphericalYY_ZZ",
      "vSphericalZZ",
      "vSphericalXY",
      "vSphericalYZ",
      "vSphericalZX",
      "vSphericalL00",
      "vSphericalL1_1",
      "vSphericalL10",
      "vSphericalL11",
      "vSphericalL2_2",
      "vSphericalL2_1",
      "vSphericalL20",
      "vSphericalL21",
      "vSphericalL22",
      "vReflectionMicrosurfaceInfos",
      "vTangentSpaceParams",
      "boneTextureWidth",
      "vDebugMode",
      "morphTargetTextureInfo",
      "morphTargetTextureIndices"
    ], p = [
      "albedoSampler",
      "reflectivitySampler",
      "ambientSampler",
      "emissiveSampler",
      "bumpSampler",
      "lightmapSampler",
      "opacitySampler",
      "reflectionSampler",
      "reflectionSamplerLow",
      "reflectionSamplerHigh",
      "irradianceSampler",
      "microSurfaceSampler",
      "environmentBrdfSampler",
      "boneSampler",
      "metallicReflectanceSampler",
      "reflectanceSampler",
      "morphTargets",
      "oitDepthSampler",
      "oitFrontColorSampler"
    ], c = ["Material", "Scene", "Mesh"], H = { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: t.NUM_MORPH_INFLUENCERS };
    this._eventInfo.fallbacks = d, this._eventInfo.fallbackRank = v, this._eventInfo.defines = t, this._eventInfo.uniforms = P, this._eventInfo.attributes = u, this._eventInfo.samplers = p, this._eventInfo.uniformBuffersNames = c, this._eventInfo.customCode = void 0, this._eventInfo.mesh = e, this._eventInfo.indexParameters = H, this._callbackPluginEventGeneric(x6.PrepareEffect, this._eventInfo), GC.AddUniforms(P), Mf(P), Ui && (Ui.PrepareUniforms(P, t), Ui.PrepareSamplers(p, t)), Ye.PrepareUniformsAndSamplersList({
      uniformsNames: P,
      uniformBuffersNames: c,
      samplers: p,
      defines: t,
      maxSimultaneousLights: this._maxSimultaneousLights
    });
    const T = {};
    this.customShaderNameResolve && (l = this.customShaderNameResolve(l, P, c, p, t, u, T));
    const q = t.toString(), b = o.createEffect(l, {
      attributes: u,
      uniformsNames: P,
      uniformBuffersNames: c,
      samplers: p,
      defines: q,
      fallbacks: d,
      onCompiled: r,
      onError: n,
      indexParameters: H,
      processFinalCode: T.processFinalCode,
      processCodeAfterIncludes: this._eventInfo.customCode,
      multiTarget: t.PREPASS
    }, o);
    return this._eventInfo.customCode = void 0, b;
  }
  _prepareDefines(e, t, r = null, n = null, i = !1) {
    var s;
    const a = this.getScene(), f = a.getEngine();
    Ye.PrepareDefinesForLights(a, e, t, !0, this._maxSimultaneousLights, this._disableLighting), t._needNormals = !0, Ye.PrepareDefinesForMultiview(a, t);
    const o = this.needAlphaBlendingForMesh(e) && this.getScene().useOrderIndependentTransparency;
    if (Ye.PrepareDefinesForPrePass(a, t, this.canRenderToMRT && !o), Ye.PrepareDefinesForOIT(a, t, o), t.METALLICWORKFLOW = this.isMetallicWorkflow(), t._areTexturesDirty) {
      t._needUVs = !1;
      for (let d = 1; d <= 6; ++d)
        t["MAINUV" + d] = !1;
      if (a.texturesEnabled) {
        t.ALBEDODIRECTUV = 0, t.AMBIENTDIRECTUV = 0, t.OPACITYDIRECTUV = 0, t.EMISSIVEDIRECTUV = 0, t.REFLECTIVITYDIRECTUV = 0, t.MICROSURFACEMAPDIRECTUV = 0, t.METALLIC_REFLECTANCEDIRECTUV = 0, t.REFLECTANCEDIRECTUV = 0, t.BUMPDIRECTUV = 0, t.LIGHTMAPDIRECTUV = 0, f.getCaps().textureLOD && (t.LODBASEDMICROSFURACE = !0), this._albedoTexture && Dt.DiffuseTextureEnabled ? (Ye.PrepareDefinesForMergedUV(this._albedoTexture, t, "ALBEDO"), t.GAMMAALBEDO = this._albedoTexture.gammaSpace) : t.ALBEDO = !1, this._ambientTexture && Dt.AmbientTextureEnabled ? (Ye.PrepareDefinesForMergedUV(this._ambientTexture, t, "AMBIENT"), t.AMBIENTINGRAYSCALE = this._useAmbientInGrayScale) : t.AMBIENT = !1, this._opacityTexture && Dt.OpacityTextureEnabled ? (Ye.PrepareDefinesForMergedUV(this._opacityTexture, t, "OPACITY"), t.OPACITYRGB = this._opacityTexture.getAlphaFromRGB) : t.OPACITY = !1;
        const d = this._getReflectionTexture();
        if (d && Dt.ReflectionTextureEnabled) {
          switch (t.REFLECTION = !0, t.GAMMAREFLECTION = d.gammaSpace, t.RGBDREFLECTION = d.isRGBD, t.LODINREFLECTIONALPHA = d.lodLevelInAlpha, t.LINEARSPECULARREFLECTION = d.linearSpecularLOD, this.realTimeFiltering && this.realTimeFilteringQuality > 0 ? (t.NUM_SAMPLES = "" + this.realTimeFilteringQuality, f._features.needTypeSuffixInShaderConstants && (t.NUM_SAMPLES = t.NUM_SAMPLES + "u"), t.REALTIME_FILTERING = !0) : t.REALTIME_FILTERING = !1, t.INVERTCUBICMAP = d.coordinatesMode === We.INVCUBIC_MODE, t.REFLECTIONMAP_3D = d.isCube, t.REFLECTIONMAP_OPPOSITEZ = t.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !d.invertZ : d.invertZ, t.REFLECTIONMAP_CUBIC = !1, t.REFLECTIONMAP_EXPLICIT = !1, t.REFLECTIONMAP_PLANAR = !1, t.REFLECTIONMAP_PROJECTION = !1, t.REFLECTIONMAP_SKYBOX = !1, t.REFLECTIONMAP_SPHERICAL = !1, t.REFLECTIONMAP_EQUIRECTANGULAR = !1, t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, d.coordinatesMode) {
            case We.EXPLICIT_MODE:
              t.REFLECTIONMAP_EXPLICIT = !0;
              break;
            case We.PLANAR_MODE:
              t.REFLECTIONMAP_PLANAR = !0;
              break;
            case We.PROJECTION_MODE:
              t.REFLECTIONMAP_PROJECTION = !0;
              break;
            case We.SKYBOX_MODE:
              t.REFLECTIONMAP_SKYBOX = !0;
              break;
            case We.SPHERICAL_MODE:
              t.REFLECTIONMAP_SPHERICAL = !0;
              break;
            case We.EQUIRECTANGULAR_MODE:
              t.REFLECTIONMAP_EQUIRECTANGULAR = !0;
              break;
            case We.FIXED_EQUIRECTANGULAR_MODE:
              t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !0;
              break;
            case We.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
              t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !0;
              break;
            case We.CUBIC_MODE:
            case We.INVCUBIC_MODE:
            default:
              t.REFLECTIONMAP_CUBIC = !0, t.USE_LOCAL_REFLECTIONMAP_CUBIC = !!d.boundingBoxSize;
              break;
          }
          d.coordinatesMode !== We.SKYBOX_MODE && (d.irradianceTexture ? (t.USEIRRADIANCEMAP = !0, t.USESPHERICALFROMREFLECTIONMAP = !1) : d.isCube && (t.USESPHERICALFROMREFLECTIONMAP = !0, t.USEIRRADIANCEMAP = !1, this._forceIrradianceInFragment || this.realTimeFiltering || this._twoSidedLighting || f.getCaps().maxVaryingVectors <= 8 ? t.USESPHERICALINVERTEX = !1 : t.USESPHERICALINVERTEX = !0));
        } else
          t.REFLECTION = !1, t.REFLECTIONMAP_3D = !1, t.REFLECTIONMAP_SPHERICAL = !1, t.REFLECTIONMAP_PLANAR = !1, t.REFLECTIONMAP_CUBIC = !1, t.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, t.REFLECTIONMAP_PROJECTION = !1, t.REFLECTIONMAP_SKYBOX = !1, t.REFLECTIONMAP_EXPLICIT = !1, t.REFLECTIONMAP_EQUIRECTANGULAR = !1, t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, t.INVERTCUBICMAP = !1, t.USESPHERICALFROMREFLECTIONMAP = !1, t.USEIRRADIANCEMAP = !1, t.USESPHERICALINVERTEX = !1, t.REFLECTIONMAP_OPPOSITEZ = !1, t.LODINREFLECTIONALPHA = !1, t.GAMMAREFLECTION = !1, t.RGBDREFLECTION = !1, t.LINEARSPECULARREFLECTION = !1;
        if (this._lightmapTexture && Dt.LightmapTextureEnabled ? (Ye.PrepareDefinesForMergedUV(this._lightmapTexture, t, "LIGHTMAP"), t.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap, t.GAMMALIGHTMAP = this._lightmapTexture.gammaSpace, t.RGBDLIGHTMAP = this._lightmapTexture.isRGBD) : t.LIGHTMAP = !1, this._emissiveTexture && Dt.EmissiveTextureEnabled ? (Ye.PrepareDefinesForMergedUV(this._emissiveTexture, t, "EMISSIVE"), t.GAMMAEMISSIVE = this._emissiveTexture.gammaSpace) : t.EMISSIVE = !1, Dt.SpecularTextureEnabled) {
          if (this._metallicTexture ? (Ye.PrepareDefinesForMergedUV(this._metallicTexture, t, "REFLECTIVITY"), t.ROUGHNESSSTOREINMETALMAPALPHA = this._useRoughnessFromMetallicTextureAlpha, t.ROUGHNESSSTOREINMETALMAPGREEN = !this._useRoughnessFromMetallicTextureAlpha && this._useRoughnessFromMetallicTextureGreen, t.METALLNESSSTOREINMETALMAPBLUE = this._useMetallnessFromMetallicTextureBlue, t.AOSTOREINMETALMAPRED = this._useAmbientOcclusionFromMetallicTextureRed, t.REFLECTIVITY_GAMMA = !1) : this._reflectivityTexture ? (Ye.PrepareDefinesForMergedUV(this._reflectivityTexture, t, "REFLECTIVITY"), t.MICROSURFACEFROMREFLECTIVITYMAP = this._useMicroSurfaceFromReflectivityMapAlpha, t.MICROSURFACEAUTOMATIC = this._useAutoMicroSurfaceFromReflectivityMap, t.REFLECTIVITY_GAMMA = this._reflectivityTexture.gammaSpace) : t.REFLECTIVITY = !1, this._metallicReflectanceTexture || this._reflectanceTexture) {
            const v = this._metallicReflectanceTexture !== null && this._metallicReflectanceTexture._texture === ((s = this._reflectanceTexture) === null || s === void 0 ? void 0 : s._texture) && this._metallicReflectanceTexture.checkTransformsAreIdentical(this._reflectanceTexture);
            t.METALLIC_REFLECTANCE_USE_ALPHA_ONLY = this._useOnlyMetallicFromMetallicReflectanceTexture && !v, this._metallicReflectanceTexture ? (Ye.PrepareDefinesForMergedUV(this._metallicReflectanceTexture, t, "METALLIC_REFLECTANCE"), t.METALLIC_REFLECTANCE_GAMMA = this._metallicReflectanceTexture.gammaSpace) : t.METALLIC_REFLECTANCE = !1, this._reflectanceTexture && !v && (!this._metallicReflectanceTexture || this._metallicReflectanceTexture && this._useOnlyMetallicFromMetallicReflectanceTexture) ? (Ye.PrepareDefinesForMergedUV(this._reflectanceTexture, t, "REFLECTANCE"), t.REFLECTANCE_GAMMA = this._reflectanceTexture.gammaSpace) : t.REFLECTANCE = !1;
          } else
            t.METALLIC_REFLECTANCE = !1, t.REFLECTANCE = !1;
          this._microSurfaceTexture ? Ye.PrepareDefinesForMergedUV(this._microSurfaceTexture, t, "MICROSURFACEMAP") : t.MICROSURFACEMAP = !1;
        } else
          t.REFLECTIVITY = !1, t.MICROSURFACEMAP = !1;
        f.getCaps().standardDerivatives && this._bumpTexture && Dt.BumpTextureEnabled && !this._disableBumpMap ? (Ye.PrepareDefinesForMergedUV(this._bumpTexture, t, "BUMP"), this._useParallax && this._albedoTexture && Dt.DiffuseTextureEnabled ? (t.PARALLAX = !0, t.PARALLAX_RHS = a.useRightHandedSystem, t.PARALLAXOCCLUSION = !!this._useParallaxOcclusion) : t.PARALLAX = !1, t.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap) : (t.BUMP = !1, t.PARALLAX = !1, t.PARALLAX_RHS = !1, t.PARALLAXOCCLUSION = !1, t.OBJECTSPACE_NORMALMAP = !1), this._environmentBRDFTexture && Dt.ReflectionTextureEnabled ? (t.ENVIRONMENTBRDF = !0, t.ENVIRONMENTBRDF_RGBD = this._environmentBRDFTexture.isRGBD) : (t.ENVIRONMENTBRDF = !1, t.ENVIRONMENTBRDF_RGBD = !1), this._shouldUseAlphaFromAlbedoTexture() ? t.ALPHAFROMALBEDO = !0 : t.ALPHAFROMALBEDO = !1;
      }
      t.SPECULAROVERALPHA = this._useSpecularOverAlpha, this._lightFalloff === fs.LIGHTFALLOFF_STANDARD ? (t.USEPHYSICALLIGHTFALLOFF = !1, t.USEGLTFLIGHTFALLOFF = !1) : this._lightFalloff === fs.LIGHTFALLOFF_GLTF ? (t.USEPHYSICALLIGHTFALLOFF = !1, t.USEGLTFLIGHTFALLOFF = !0) : (t.USEPHYSICALLIGHTFALLOFF = !0, t.USEGLTFLIGHTFALLOFF = !1), t.RADIANCEOVERALPHA = this._useRadianceOverAlpha, !this.backFaceCulling && this._twoSidedLighting ? t.TWOSIDEDLIGHTING = !0 : t.TWOSIDEDLIGHTING = !1, t.SPECULARAA = f.getCaps().standardDerivatives && this._enableSpecularAntiAliasing;
    }
    (t._areTexturesDirty || t._areMiscDirty) && (t.ALPHATESTVALUE = `${this._alphaCutOff}${this._alphaCutOff % 1 === 0 ? "." : ""}`, t.PREMULTIPLYALPHA = this.alphaMode === 7 || this.alphaMode === 8, t.ALPHABLEND = this.needAlphaBlendingForMesh(e), t.ALPHAFRESNEL = this._useAlphaFresnel || this._useLinearAlphaFresnel, t.LINEARALPHAFRESNEL = this._useLinearAlphaFresnel), t._areImageProcessingDirty && this._imageProcessingConfiguration && this._imageProcessingConfiguration.prepareDefines(t), t.FORCENORMALFORWARD = this._forceNormalForward, t.RADIANCEOCCLUSION = this._useRadianceOcclusion, t.HORIZONOCCLUSION = this._useHorizonOcclusion, t._areMiscDirty && (Ye.PrepareDefinesForMisc(e, a, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e) || this._forceAlphaTest, t, this._applyDecalMapAfterDetailMap), t.UNLIT = this._unlit || (this.pointsCloud || this.wireframe) && !e.isVerticesDataPresent(J.NormalKind), t.DEBUGMODE = this._debugMode), Ye.PrepareDefinesForFrameBoundValues(a, f, this, t, !!r, n, i), this._eventInfo.defines = t, this._eventInfo.mesh = e, this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo), Ye.PrepareDefinesForAttributes(e, t, !0, !0, !0, this._transparencyMode !== fs.PBRMATERIAL_OPAQUE), this._callbackPluginEventPrepareDefines(this._eventInfo);
  }
  /**
   * Force shader compilation
   * @param mesh
   * @param onCompiled
   * @param options
   */
  forceCompilation(e, t, r) {
    const n = Object.assign({ clipPlane: !1, useInstances: !1 }, r);
    this._uniformBufferLayoutBuilt || this.buildUniformLayout(), this._callbackPluginEventGeneric(x6.GetDefineNames, this._eventInfo);
    const i = new cF(this._eventInfo.defineNames), s = this._prepareEffect(e, i, void 0, void 0, n.useInstances, n.clipPlane, e.hasThinInstances);
    this._onEffectCreatedObservable && (UW.effect = s, UW.subMesh = null, this._onEffectCreatedObservable.notifyObservers(UW)), s.isReady() ? t && t(this) : s.onCompileObservable.add(() => {
      t && t(this);
    });
  }
  /**
   * Initializes the uniform buffer layout for the shader.
   */
  buildUniformLayout() {
    const e = this._uniformBuffer;
    e.addUniform("vAlbedoInfos", 2), e.addUniform("vAmbientInfos", 4), e.addUniform("vOpacityInfos", 2), e.addUniform("vEmissiveInfos", 2), e.addUniform("vLightmapInfos", 2), e.addUniform("vReflectivityInfos", 3), e.addUniform("vMicroSurfaceSamplerInfos", 2), e.addUniform("vReflectionInfos", 2), e.addUniform("vReflectionFilteringInfo", 2), e.addUniform("vReflectionPosition", 3), e.addUniform("vReflectionSize", 3), e.addUniform("vBumpInfos", 3), e.addUniform("albedoMatrix", 16), e.addUniform("ambientMatrix", 16), e.addUniform("opacityMatrix", 16), e.addUniform("emissiveMatrix", 16), e.addUniform("lightmapMatrix", 16), e.addUniform("reflectivityMatrix", 16), e.addUniform("microSurfaceSamplerMatrix", 16), e.addUniform("bumpMatrix", 16), e.addUniform("vTangentSpaceParams", 2), e.addUniform("reflectionMatrix", 16), e.addUniform("vReflectionColor", 3), e.addUniform("vAlbedoColor", 4), e.addUniform("vLightingIntensity", 4), e.addUniform("vReflectionMicrosurfaceInfos", 3), e.addUniform("pointSize", 1), e.addUniform("vReflectivityColor", 4), e.addUniform("vEmissiveColor", 3), e.addUniform("vAmbientColor", 3), e.addUniform("vDebugMode", 2), e.addUniform("vMetallicReflectanceFactors", 4), e.addUniform("vMetallicReflectanceInfos", 2), e.addUniform("metallicReflectanceMatrix", 16), e.addUniform("vReflectanceInfos", 2), e.addUniform("reflectanceMatrix", 16), e.addUniform("vSphericalL00", 3), e.addUniform("vSphericalL1_1", 3), e.addUniform("vSphericalL10", 3), e.addUniform("vSphericalL11", 3), e.addUniform("vSphericalL2_2", 3), e.addUniform("vSphericalL2_1", 3), e.addUniform("vSphericalL20", 3), e.addUniform("vSphericalL21", 3), e.addUniform("vSphericalL22", 3), e.addUniform("vSphericalX", 3), e.addUniform("vSphericalY", 3), e.addUniform("vSphericalZ", 3), e.addUniform("vSphericalXX_ZZ", 3), e.addUniform("vSphericalYY_ZZ", 3), e.addUniform("vSphericalZZ", 3), e.addUniform("vSphericalXY", 3), e.addUniform("vSphericalYZ", 3), e.addUniform("vSphericalZX", 3), super.buildUniformLayout();
  }
  /**
   * Binds the submesh data.
   * @param world - The world matrix.
   * @param mesh - The BJS mesh.
   * @param subMesh - A submesh of the BJS mesh.
   */
  bindForSubMesh(e, t, r) {
    var n, i, s, a;
    const f = this.getScene(), o = r.materialDefines;
    if (!o)
      return;
    const d = r.effect;
    if (!d)
      return;
    this._activeEffect = d, t.getMeshUniformBuffer().bindToEffect(d, "Mesh"), t.transferToEffect(e);
    const v = f.getEngine();
    this._uniformBuffer.bindToEffect(d, "Material"), this.prePassConfiguration.bindForSubMesh(this._activeEffect, f, t, e, this.isFrozen), this._eventInfo.subMesh = r, this._callbackPluginEventHardBindForSubMesh(this._eventInfo), o.OBJECTSPACE_NORMALMAP && (e.toNormalMatrix(this._normalMatrix), this.bindOnlyNormalMatrix(this._normalMatrix));
    const u = d._forceRebindOnNextCall || this._mustRebind(f, d, t.visibility);
    Ye.BindBonesParameters(t, this._activeEffect, this.prePassConfiguration);
    let l = null;
    const P = this._uniformBuffer;
    if (u) {
      if (this.bindViewProjection(d), l = this._getReflectionTexture(), !P.useUbo || !this.isFrozen || !P.isSync || d._forceRebindOnNextCall) {
        if (f.texturesEnabled) {
          if (this._albedoTexture && Dt.DiffuseTextureEnabled && (P.updateFloat2("vAlbedoInfos", this._albedoTexture.coordinatesIndex, this._albedoTexture.level), Ye.BindTextureMatrix(this._albedoTexture, P, "albedo")), this._ambientTexture && Dt.AmbientTextureEnabled && (P.updateFloat4("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level, this._ambientTextureStrength, this._ambientTextureImpactOnAnalyticalLights), Ye.BindTextureMatrix(this._ambientTexture, P, "ambient")), this._opacityTexture && Dt.OpacityTextureEnabled && (P.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), Ye.BindTextureMatrix(this._opacityTexture, P, "opacity")), l && Dt.ReflectionTextureEnabled) {
            if (P.updateMatrix("reflectionMatrix", l.getReflectionTextureMatrix()), P.updateFloat2("vReflectionInfos", l.level, 0), l.boundingBoxSize) {
              const p = l;
              P.updateVector3("vReflectionPosition", p.boundingBoxPosition), P.updateVector3("vReflectionSize", p.boundingBoxSize);
            }
            if (this.realTimeFiltering) {
              const p = l.getSize().width;
              P.updateFloat2("vReflectionFilteringInfo", p, Xt.Log2(p));
            }
            if (!o.USEIRRADIANCEMAP) {
              const p = l.sphericalPolynomial;
              if (o.USESPHERICALFROMREFLECTIONMAP && p)
                if (o.SPHERICAL_HARMONICS) {
                  const c = p.preScaledHarmonics;
                  P.updateVector3("vSphericalL00", c.l00), P.updateVector3("vSphericalL1_1", c.l1_1), P.updateVector3("vSphericalL10", c.l10), P.updateVector3("vSphericalL11", c.l11), P.updateVector3("vSphericalL2_2", c.l2_2), P.updateVector3("vSphericalL2_1", c.l2_1), P.updateVector3("vSphericalL20", c.l20), P.updateVector3("vSphericalL21", c.l21), P.updateVector3("vSphericalL22", c.l22);
                } else
                  P.updateFloat3("vSphericalX", p.x.x, p.x.y, p.x.z), P.updateFloat3("vSphericalY", p.y.x, p.y.y, p.y.z), P.updateFloat3("vSphericalZ", p.z.x, p.z.y, p.z.z), P.updateFloat3("vSphericalXX_ZZ", p.xx.x - p.zz.x, p.xx.y - p.zz.y, p.xx.z - p.zz.z), P.updateFloat3("vSphericalYY_ZZ", p.yy.x - p.zz.x, p.yy.y - p.zz.y, p.yy.z - p.zz.z), P.updateFloat3("vSphericalZZ", p.zz.x, p.zz.y, p.zz.z), P.updateFloat3("vSphericalXY", p.xy.x, p.xy.y, p.xy.z), P.updateFloat3("vSphericalYZ", p.yz.x, p.yz.y, p.yz.z), P.updateFloat3("vSphericalZX", p.zx.x, p.zx.y, p.zx.z);
            }
            P.updateFloat3("vReflectionMicrosurfaceInfos", l.getSize().width, l.lodGenerationScale, l.lodGenerationOffset);
          }
          this._emissiveTexture && Dt.EmissiveTextureEnabled && (P.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level), Ye.BindTextureMatrix(this._emissiveTexture, P, "emissive")), this._lightmapTexture && Dt.LightmapTextureEnabled && (P.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level), Ye.BindTextureMatrix(this._lightmapTexture, P, "lightmap")), Dt.SpecularTextureEnabled && (this._metallicTexture ? (P.updateFloat3("vReflectivityInfos", this._metallicTexture.coordinatesIndex, this._metallicTexture.level, this._ambientTextureStrength), Ye.BindTextureMatrix(this._metallicTexture, P, "reflectivity")) : this._reflectivityTexture && (P.updateFloat3("vReflectivityInfos", this._reflectivityTexture.coordinatesIndex, this._reflectivityTexture.level, 1), Ye.BindTextureMatrix(this._reflectivityTexture, P, "reflectivity")), this._metallicReflectanceTexture && (P.updateFloat2("vMetallicReflectanceInfos", this._metallicReflectanceTexture.coordinatesIndex, this._metallicReflectanceTexture.level), Ye.BindTextureMatrix(this._metallicReflectanceTexture, P, "metallicReflectance")), this._reflectanceTexture && o.REFLECTANCE && (P.updateFloat2("vReflectanceInfos", this._reflectanceTexture.coordinatesIndex, this._reflectanceTexture.level), Ye.BindTextureMatrix(this._reflectanceTexture, P, "reflectance")), this._microSurfaceTexture && (P.updateFloat2("vMicroSurfaceSamplerInfos", this._microSurfaceTexture.coordinatesIndex, this._microSurfaceTexture.level), Ye.BindTextureMatrix(this._microSurfaceTexture, P, "microSurfaceSampler"))), this._bumpTexture && v.getCaps().standardDerivatives && Dt.BumpTextureEnabled && !this._disableBumpMap && (P.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, this._bumpTexture.level, this._parallaxScaleBias), Ye.BindTextureMatrix(this._bumpTexture, P, "bump"), f._mirroredCameraPosition ? P.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1 : -1, this._invertNormalMapY ? 1 : -1) : P.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1 : 1, this._invertNormalMapY ? -1 : 1));
        }
        if (this.pointsCloud && P.updateFloat("pointSize", this.pointSize), o.METALLICWORKFLOW) {
          Hs.Color3[0].r = this._metallic === void 0 || this._metallic === null ? 1 : this._metallic, Hs.Color3[0].g = this._roughness === void 0 || this._roughness === null ? 1 : this._roughness, P.updateColor4("vReflectivityColor", Hs.Color3[0], 1);
          const p = (i = (n = this.subSurface) === null || n === void 0 ? void 0 : n._indexOfRefraction) !== null && i !== void 0 ? i : 1.5, c = 1, H = Math.pow((p - c) / (p + c), 2);
          this._metallicReflectanceColor.scaleToRef(H * this._metallicF0Factor, Hs.Color3[0]);
          const T = this._metallicF0Factor;
          P.updateColor4("vMetallicReflectanceFactors", Hs.Color3[0], T);
        } else
          P.updateColor4("vReflectivityColor", this._reflectivityColor, this._microSurface);
        P.updateColor3("vEmissiveColor", Dt.EmissiveTextureEnabled ? this._emissiveColor : Ne.BlackReadOnly), P.updateColor3("vReflectionColor", this._reflectionColor), !o.SS_REFRACTION && (!((s = this.subSurface) === null || s === void 0) && s._linkRefractionWithTransparency) ? P.updateColor4("vAlbedoColor", this._albedoColor, 1) : P.updateColor4("vAlbedoColor", this._albedoColor, this.alpha), this._lightingInfos.x = this._directIntensity, this._lightingInfos.y = this._emissiveIntensity, this._lightingInfos.z = this._environmentIntensity * f.environmentIntensity, this._lightingInfos.w = this._specularIntensity, P.updateVector4("vLightingIntensity", this._lightingInfos), f.ambientColor.multiplyToRef(this._ambientColor, this._globalAmbientColor), P.updateColor3("vAmbientColor", this._globalAmbientColor), P.updateFloat2("vDebugMode", this.debugLimit, this.debugFactor);
      }
      f.texturesEnabled && (this._albedoTexture && Dt.DiffuseTextureEnabled && P.setTexture("albedoSampler", this._albedoTexture), this._ambientTexture && Dt.AmbientTextureEnabled && P.setTexture("ambientSampler", this._ambientTexture), this._opacityTexture && Dt.OpacityTextureEnabled && P.setTexture("opacitySampler", this._opacityTexture), l && Dt.ReflectionTextureEnabled && (o.LODBASEDMICROSFURACE ? P.setTexture("reflectionSampler", l) : (P.setTexture("reflectionSampler", l._lodTextureMid || l), P.setTexture("reflectionSamplerLow", l._lodTextureLow || l), P.setTexture("reflectionSamplerHigh", l._lodTextureHigh || l)), o.USEIRRADIANCEMAP && P.setTexture("irradianceSampler", l.irradianceTexture)), o.ENVIRONMENTBRDF && P.setTexture("environmentBrdfSampler", this._environmentBRDFTexture), this._emissiveTexture && Dt.EmissiveTextureEnabled && P.setTexture("emissiveSampler", this._emissiveTexture), this._lightmapTexture && Dt.LightmapTextureEnabled && P.setTexture("lightmapSampler", this._lightmapTexture), Dt.SpecularTextureEnabled && (this._metallicTexture ? P.setTexture("reflectivitySampler", this._metallicTexture) : this._reflectivityTexture && P.setTexture("reflectivitySampler", this._reflectivityTexture), this._metallicReflectanceTexture && P.setTexture("metallicReflectanceSampler", this._metallicReflectanceTexture), this._reflectanceTexture && o.REFLECTANCE && P.setTexture("reflectanceSampler", this._reflectanceTexture), this._microSurfaceTexture && P.setTexture("microSurfaceSampler", this._microSurfaceTexture)), this._bumpTexture && v.getCaps().standardDerivatives && Dt.BumpTextureEnabled && !this._disableBumpMap && P.setTexture("bumpSampler", this._bumpTexture)), this.getScene().useOrderIndependentTransparency && this.needAlphaBlendingForMesh(t) && this.getScene().depthPeelingRenderer.bind(d), this._eventInfo.subMesh = r, this._callbackPluginEventBindForSubMesh(this._eventInfo), Df(this._activeEffect, this, f), this.bindEyePosition(d);
    } else
      f.getEngine()._features.needToAlwaysBindUniformBuffers && (this._needToBindSceneUbo = !0);
    (u || !this.isFrozen) && (f.lightsEnabled && !this._disableLighting && Ye.BindLights(f, t, this._activeEffect, o, this._maxSimultaneousLights), (f.fogEnabled && t.applyFog && f.fogMode !== sr.FOGMODE_NONE || l || this.subSurface.refractionTexture || t.receiveShadows || o.PREPASS) && this.bindView(d), Ye.BindFogParameters(f, t, this._activeEffect, !0), o.NUM_MORPH_INFLUENCERS && Ye.BindMorphTargetParameters(t, this._activeEffect), o.BAKED_VERTEX_ANIMATION_TEXTURE && ((a = t.bakedVertexAnimationManager) === null || a === void 0 || a.bind(d, o.INSTANCES)), this._imageProcessingConfiguration.bind(this._activeEffect), Ye.BindLogDepth(o, this._activeEffect, f)), this._afterBind(t, this._activeEffect), P.update();
  }
  /**
   * Returns the animatable textures.
   * If material have animatable metallic texture, then reflectivity texture will not be returned, even if it has animations.
   * @returns - Array of animatable textures.
   */
  getAnimatables() {
    const e = super.getAnimatables();
    return this._albedoTexture && this._albedoTexture.animations && this._albedoTexture.animations.length > 0 && e.push(this._albedoTexture), this._ambientTexture && this._ambientTexture.animations && this._ambientTexture.animations.length > 0 && e.push(this._ambientTexture), this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0 && e.push(this._opacityTexture), this._reflectionTexture && this._reflectionTexture.animations && this._reflectionTexture.animations.length > 0 && e.push(this._reflectionTexture), this._emissiveTexture && this._emissiveTexture.animations && this._emissiveTexture.animations.length > 0 && e.push(this._emissiveTexture), this._metallicTexture && this._metallicTexture.animations && this._metallicTexture.animations.length > 0 ? e.push(this._metallicTexture) : this._reflectivityTexture && this._reflectivityTexture.animations && this._reflectivityTexture.animations.length > 0 && e.push(this._reflectivityTexture), this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0 && e.push(this._bumpTexture), this._lightmapTexture && this._lightmapTexture.animations && this._lightmapTexture.animations.length > 0 && e.push(this._lightmapTexture), this._metallicReflectanceTexture && this._metallicReflectanceTexture.animations && this._metallicReflectanceTexture.animations.length > 0 && e.push(this._metallicReflectanceTexture), this._reflectanceTexture && this._reflectanceTexture.animations && this._reflectanceTexture.animations.length > 0 && e.push(this._reflectanceTexture), this._microSurfaceTexture && this._microSurfaceTexture.animations && this._microSurfaceTexture.animations.length > 0 && e.push(this._microSurfaceTexture), e;
  }
  /**
   * Returns the texture used for reflections.
   * @returns - Reflection texture if present.  Otherwise, returns the environment texture.
   */
  _getReflectionTexture() {
    return this._reflectionTexture ? this._reflectionTexture : this.getScene().environmentTexture;
  }
  /**
   * Returns an array of the actively used textures.
   * @returns - Array of BaseTextures
   */
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._albedoTexture && e.push(this._albedoTexture), this._ambientTexture && e.push(this._ambientTexture), this._opacityTexture && e.push(this._opacityTexture), this._reflectionTexture && e.push(this._reflectionTexture), this._emissiveTexture && e.push(this._emissiveTexture), this._reflectivityTexture && e.push(this._reflectivityTexture), this._metallicTexture && e.push(this._metallicTexture), this._metallicReflectanceTexture && e.push(this._metallicReflectanceTexture), this._reflectanceTexture && e.push(this._reflectanceTexture), this._microSurfaceTexture && e.push(this._microSurfaceTexture), this._bumpTexture && e.push(this._bumpTexture), this._lightmapTexture && e.push(this._lightmapTexture), e;
  }
  /**
   * Checks to see if a texture is used in the material.
   * @param texture - Base texture to use.
   * @returns - Boolean specifying if a texture is used in the material.
   */
  hasTexture(e) {
    return !!(super.hasTexture(e) || this._albedoTexture === e || this._ambientTexture === e || this._opacityTexture === e || this._reflectionTexture === e || this._emissiveTexture === e || this._reflectivityTexture === e || this._metallicTexture === e || this._metallicReflectanceTexture === e || this._reflectanceTexture === e || this._microSurfaceTexture === e || this._bumpTexture === e || this._lightmapTexture === e);
  }
  /**
   * Sets the required values to the prepass renderer.
   * It can't be sets when subsurface scattering of this material is disabled.
   * When scene have ability to enable subsurface prepass effect, it will enable.
   */
  setPrePassRenderer() {
    var e;
    if (!(!((e = this.subSurface) === null || e === void 0) && e.isScatteringEnabled))
      return !1;
    const t = this.getScene().enableSubSurfaceForPrePass();
    return t && (t.enabled = !0), !0;
  }
  /**
   * Disposes the resources of the material.
   * @param forceDisposeEffect - Forces the disposal of effects.
   * @param forceDisposeTextures - Forces the disposal of all textures.
   */
  dispose(e, t) {
    var r, n, i, s, a, f, o, d, v, u, l, P;
    t && (this._environmentBRDFTexture && this.getScene().environmentBRDFTexture !== this._environmentBRDFTexture && this._environmentBRDFTexture.dispose(), (r = this._albedoTexture) === null || r === void 0 || r.dispose(), (n = this._ambientTexture) === null || n === void 0 || n.dispose(), (i = this._opacityTexture) === null || i === void 0 || i.dispose(), (s = this._reflectionTexture) === null || s === void 0 || s.dispose(), (a = this._emissiveTexture) === null || a === void 0 || a.dispose(), (f = this._metallicTexture) === null || f === void 0 || f.dispose(), (o = this._reflectivityTexture) === null || o === void 0 || o.dispose(), (d = this._bumpTexture) === null || d === void 0 || d.dispose(), (v = this._lightmapTexture) === null || v === void 0 || v.dispose(), (u = this._metallicReflectanceTexture) === null || u === void 0 || u.dispose(), (l = this._reflectanceTexture) === null || l === void 0 || l.dispose(), (P = this._microSurfaceTexture) === null || P === void 0 || P.dispose()), this._renderTargets.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), super.dispose(e, t);
  }
}
fs.PBRMATERIAL_OPAQUE = gt.MATERIAL_OPAQUE;
fs.PBRMATERIAL_ALPHATEST = gt.MATERIAL_ALPHATEST;
fs.PBRMATERIAL_ALPHABLEND = gt.MATERIAL_ALPHABLEND;
fs.PBRMATERIAL_ALPHATESTANDBLEND = gt.MATERIAL_ALPHATESTANDBLEND;
fs.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 0;
fs.LIGHTFALLOFF_PHYSICAL = 0;
fs.LIGHTFALLOFF_GLTF = 1;
fs.LIGHTFALLOFF_STANDARD = 2;
C([
  CN()
], fs.prototype, "_imageProcessingConfiguration", void 0);
C([
  At("_markAllSubMeshesAsMiscDirty")
], fs.prototype, "debugMode", void 0);
class mr extends fs {
  /**
   * Stores the refracted light information in a texture.
   */
  get refractionTexture() {
    return this.subSurface.refractionTexture;
  }
  set refractionTexture(e) {
    this.subSurface.refractionTexture = e, e ? this.subSurface.isRefractionEnabled = !0 : this.subSurface.linkRefractionWithTransparency || (this.subSurface.isRefractionEnabled = !1);
  }
  /**
   * Index of refraction of the material base layer.
   * https://en.wikipedia.org/wiki/List_of_refractive_indices
   *
   * This does not only impact refraction but also the Base F0 of Dielectric Materials.
   *
   * From dielectric fresnel rules: F0 = square((iorT - iorI) / (iorT + iorI))
   */
  get indexOfRefraction() {
    return this.subSurface.indexOfRefraction;
  }
  set indexOfRefraction(e) {
    this.subSurface.indexOfRefraction = e;
  }
  /**
   * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
   */
  get invertRefractionY() {
    return this.subSurface.invertRefractionY;
  }
  set invertRefractionY(e) {
    this.subSurface.invertRefractionY = e;
  }
  /**
   * This parameters will make the material used its opacity to control how much it is refracting against not.
   * Materials half opaque for instance using refraction could benefit from this control.
   */
  get linkRefractionWithTransparency() {
    return this.subSurface.linkRefractionWithTransparency;
  }
  set linkRefractionWithTransparency(e) {
    this.subSurface.linkRefractionWithTransparency = e, e && (this.subSurface.isRefractionEnabled = !0);
  }
  /**
   * BJS is using an hardcoded light falloff based on a manually sets up range.
   * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.
   * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.
   */
  get usePhysicalLightFalloff() {
    return this._lightFalloff === fs.LIGHTFALLOFF_PHYSICAL;
  }
  /**
   * BJS is using an hardcoded light falloff based on a manually sets up range.
   * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.
   * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.
   */
  set usePhysicalLightFalloff(e) {
    e !== this.usePhysicalLightFalloff && (this._markAllSubMeshesAsTexturesDirty(), e ? this._lightFalloff = fs.LIGHTFALLOFF_PHYSICAL : this._lightFalloff = fs.LIGHTFALLOFF_STANDARD);
  }
  /**
   * In order to support the falloff compatibility with gltf, a special mode has been added
   * to reproduce the gltf light falloff.
   */
  get useGLTFLightFalloff() {
    return this._lightFalloff === fs.LIGHTFALLOFF_GLTF;
  }
  /**
   * In order to support the falloff compatibility with gltf, a special mode has been added
   * to reproduce the gltf light falloff.
   */
  set useGLTFLightFalloff(e) {
    e !== this.useGLTFLightFalloff && (this._markAllSubMeshesAsTexturesDirty(), e ? this._lightFalloff = fs.LIGHTFALLOFF_GLTF : this._lightFalloff = fs.LIGHTFALLOFF_STANDARD);
  }
  /**
   * Gets the image processing configuration used either in this material.
   */
  get imageProcessingConfiguration() {
    return this._imageProcessingConfiguration;
  }
  /**
   * Sets the Default image processing configuration used either in the this material.
   *
   * If sets to null, the scene one is in use.
   */
  set imageProcessingConfiguration(e) {
    this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty();
  }
  /**
   * Gets whether the color curves effect is enabled.
   */
  get cameraColorCurvesEnabled() {
    return this.imageProcessingConfiguration.colorCurvesEnabled;
  }
  /**
   * Sets whether the color curves effect is enabled.
   */
  set cameraColorCurvesEnabled(e) {
    this.imageProcessingConfiguration.colorCurvesEnabled = e;
  }
  /**
   * Gets whether the color grading effect is enabled.
   */
  get cameraColorGradingEnabled() {
    return this.imageProcessingConfiguration.colorGradingEnabled;
  }
  /**
   * Gets whether the color grading effect is enabled.
   */
  set cameraColorGradingEnabled(e) {
    this.imageProcessingConfiguration.colorGradingEnabled = e;
  }
  /**
   * Gets whether tonemapping is enabled or not.
   */
  get cameraToneMappingEnabled() {
    return this._imageProcessingConfiguration.toneMappingEnabled;
  }
  /**
   * Sets whether tonemapping is enabled or not
   */
  set cameraToneMappingEnabled(e) {
    this._imageProcessingConfiguration.toneMappingEnabled = e;
  }
  /**
   * The camera exposure used on this material.
   * This property is here and not in the camera to allow controlling exposure without full screen post process.
   * This corresponds to a photographic exposure.
   */
  get cameraExposure() {
    return this._imageProcessingConfiguration.exposure;
  }
  /**
   * The camera exposure used on this material.
   * This property is here and not in the camera to allow controlling exposure without full screen post process.
   * This corresponds to a photographic exposure.
   */
  set cameraExposure(e) {
    this._imageProcessingConfiguration.exposure = e;
  }
  /**
   * Gets The camera contrast used on this material.
   */
  get cameraContrast() {
    return this._imageProcessingConfiguration.contrast;
  }
  /**
   * Sets The camera contrast used on this material.
   */
  set cameraContrast(e) {
    this._imageProcessingConfiguration.contrast = e;
  }
  /**
   * Gets the Color Grading 2D Lookup Texture.
   */
  get cameraColorGradingTexture() {
    return this._imageProcessingConfiguration.colorGradingTexture;
  }
  /**
   * Sets the Color Grading 2D Lookup Texture.
   */
  set cameraColorGradingTexture(e) {
    this._imageProcessingConfiguration.colorGradingTexture = e;
  }
  /**
   * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
   * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
   * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
   * corresponding to low luminance, medium luminance, and high luminance areas respectively.
   */
  get cameraColorCurves() {
    return this._imageProcessingConfiguration.colorCurves;
  }
  /**
   * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
   * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
   * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
   * corresponding to low luminance, medium luminance, and high luminance areas respectively.
   */
  set cameraColorCurves(e) {
    this._imageProcessingConfiguration.colorCurves = e;
  }
  /**
   * Instantiates a new PBRMaterial instance.
   *
   * @param name The material name
   * @param scene The scene the material will be use in.
   */
  constructor(e, t) {
    super(e, t), this.directIntensity = 1, this.emissiveIntensity = 1, this.environmentIntensity = 1, this.specularIntensity = 1, this.disableBumpMap = !1, this.ambientTextureStrength = 1, this.ambientTextureImpactOnAnalyticalLights = mr.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, this.metallicF0Factor = 1, this.metallicReflectanceColor = Ne.White(), this.useOnlyMetallicFromMetallicReflectanceTexture = !1, this.ambientColor = new Ne(0, 0, 0), this.albedoColor = new Ne(1, 1, 1), this.reflectivityColor = new Ne(1, 1, 1), this.reflectionColor = new Ne(1, 1, 1), this.emissiveColor = new Ne(0, 0, 0), this.microSurface = 1, this.useLightmapAsShadowmap = !1, this.useAlphaFromAlbedoTexture = !1, this.forceAlphaTest = !1, this.alphaCutOff = 0.4, this.useSpecularOverAlpha = !0, this.useMicroSurfaceFromReflectivityMapAlpha = !1, this.useRoughnessFromMetallicTextureAlpha = !0, this.useRoughnessFromMetallicTextureGreen = !1, this.useMetallnessFromMetallicTextureBlue = !1, this.useAmbientOcclusionFromMetallicTextureRed = !1, this.useAmbientInGrayScale = !1, this.useAutoMicroSurfaceFromReflectivityMap = !1, this.useRadianceOverAlpha = !0, this.useObjectSpaceNormalMap = !1, this.useParallax = !1, this.useParallaxOcclusion = !1, this.parallaxScaleBias = 0.05, this.disableLighting = !1, this.forceIrradianceInFragment = !1, this.maxSimultaneousLights = 4, this.invertNormalMapX = !1, this.invertNormalMapY = !1, this.twoSidedLighting = !1, this.useAlphaFresnel = !1, this.useLinearAlphaFresnel = !1, this.environmentBRDFTexture = null, this.forceNormalForward = !1, this.enableSpecularAntiAliasing = !1, this.useHorizonOcclusion = !0, this.useRadianceOcclusion = !0, this.unlit = !1, this.applyDecalMapAfterDetailMap = !1, this._environmentBRDFTexture = nV(this.getScene());
  }
  /**
   * Returns the name of this material class.
   */
  getClassName() {
    return "PBRMaterial";
  }
  /**
   * Makes a duplicate of the current material.
   * @param name - name to use for the new material.
   * @param cloneTexturesOnlyOnce - if a texture is used in more than one channel (e.g diffuse and opacity), only clone it once and reuse it on the other channels. Default false.
   * @param rootUrl defines the root URL to use to load textures
   */
  clone(e, t = !0, r = "") {
    const n = jt.Clone(() => new mr(e, this.getScene()), this, { cloneTexturesOnlyOnce: t });
    return n.id = e, n.name = e, this.stencil.copyTo(n.stencil), this._clonePlugins(n, r), n;
  }
  /**
   * Serializes this PBR Material.
   * @returns - An object with the serialized material.
   */
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.PBRMaterial", e;
  }
  // Statics
  /**
   * Parses a PBR Material from a serialized object.
   * @param source - Serialized object.
   * @param scene - BJS scene instance.
   * @param rootUrl - url for the scene object
   * @returns - PBRMaterial
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => new mr(e.name, t), e, t, r);
    return e.stencil && n.stencil.parse(e.stencil, t, r), gt._parsePlugins(e, n, t, r), e.clearCoat && n.clearCoat.parse(e.clearCoat, t, r), e.anisotropy && n.anisotropy.parse(e.anisotropy, t, r), e.brdf && n.brdf.parse(e.brdf, t, r), e.sheen && n.sheen.parse(e.sheen, t, r), e.subSurface && n.subSurface.parse(e.subSurface, t, r), e.iridescence && n.iridescence.parse(e.iridescence, t, r), n;
  }
}
mr.PBRMATERIAL_OPAQUE = fs.PBRMATERIAL_OPAQUE;
mr.PBRMATERIAL_ALPHATEST = fs.PBRMATERIAL_ALPHATEST;
mr.PBRMATERIAL_ALPHABLEND = fs.PBRMATERIAL_ALPHABLEND;
mr.PBRMATERIAL_ALPHATESTANDBLEND = fs.PBRMATERIAL_ALPHATESTANDBLEND;
mr.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = fs.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "directIntensity", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "emissiveIntensity", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "environmentIntensity", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "specularIntensity", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "disableBumpMap", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "albedoTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "ambientTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "ambientTextureStrength", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "ambientTextureImpactOnAnalyticalLights", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesAndMiscDirty")
], mr.prototype, "opacityTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "reflectionTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "emissiveTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "reflectivityTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "metallicTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "metallic", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "roughness", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "metallicF0Factor", void 0);
C([
  Oi(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "metallicReflectanceColor", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useOnlyMetallicFromMetallicReflectanceTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "metallicReflectanceTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "reflectanceTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "microSurfaceTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "bumpTexture", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty", null)
], mr.prototype, "lightmapTexture", void 0);
C([
  Oi("ambient"),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "ambientColor", void 0);
C([
  Oi("albedo"),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "albedoColor", void 0);
C([
  Oi("reflectivity"),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "reflectivityColor", void 0);
C([
  Oi("reflection"),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "reflectionColor", void 0);
C([
  Oi("emissive"),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "emissiveColor", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "microSurface", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useLightmapAsShadowmap", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesAndMiscDirty")
], mr.prototype, "useAlphaFromAlbedoTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesAndMiscDirty")
], mr.prototype, "forceAlphaTest", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesAndMiscDirty")
], mr.prototype, "alphaCutOff", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useSpecularOverAlpha", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useMicroSurfaceFromReflectivityMapAlpha", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useRoughnessFromMetallicTextureAlpha", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useRoughnessFromMetallicTextureGreen", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useMetallnessFromMetallicTextureBlue", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useAmbientOcclusionFromMetallicTextureRed", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useAmbientInGrayScale", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useAutoMicroSurfaceFromReflectivityMap", void 0);
C([
  M()
], mr.prototype, "usePhysicalLightFalloff", null);
C([
  M()
], mr.prototype, "useGLTFLightFalloff", null);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useRadianceOverAlpha", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useObjectSpaceNormalMap", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useParallax", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useParallaxOcclusion", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "parallaxScaleBias", void 0);
C([
  M(),
  At("_markAllSubMeshesAsLightsDirty")
], mr.prototype, "disableLighting", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "forceIrradianceInFragment", void 0);
C([
  M(),
  At("_markAllSubMeshesAsLightsDirty")
], mr.prototype, "maxSimultaneousLights", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "invertNormalMapX", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "invertNormalMapY", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "twoSidedLighting", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useAlphaFresnel", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useLinearAlphaFresnel", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "environmentBRDFTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "forceNormalForward", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "enableSpecularAntiAliasing", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useHorizonOcclusion", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], mr.prototype, "useRadianceOcclusion", void 0);
C([
  M(),
  At("_markAllSubMeshesAsMiscDirty")
], mr.prototype, "unlit", void 0);
C([
  M(),
  At("_markAllSubMeshesAsMiscDirty")
], mr.prototype, "applyDecalMapAfterDetailMap", void 0);
Ue("BABYLON.PBRMaterial", mr);
const Zce = 542327876, wG = 131072, mG = 512, BG = 4, WG = 64, SG = 131072;
function fy(A) {
  return A.charCodeAt(0) + (A.charCodeAt(1) << 8) + (A.charCodeAt(2) << 16) + (A.charCodeAt(3) << 24);
}
function _ce(A) {
  return String.fromCharCode(A & 255, A >> 8 & 255, A >> 16 & 255, A >> 24 & 255);
}
const UG = fy("DXT1"), IG = fy("DXT3"), RG = fy("DXT5"), wE = fy("DX10"), VG = 113, CG = 116, OG = 2, yG = 10, $ce = 88, mE = 31, e3e = 0, t3e = 1, kG = 2, EG = 3, BE = 4, FG = 7, WE = 20, NG = 21, r3e = 22, n3e = 23, i3e = 24, s3e = 25, a3e = 26, o3e = 28, f3e = 32;
class Aa {
  /**
   * Gets DDS information from an array buffer
   * @param data defines the array buffer view to read data from
   * @returns the DDS information
   */
  static GetDDSInfo(e) {
    const t = new Int32Array(e.buffer, e.byteOffset, mE), r = new Int32Array(e.buffer, e.byteOffset, mE + 4);
    let n = 1;
    t[kG] & wG && (n = Math.max(1, t[FG]));
    const i = t[NG], s = i === wE ? r[f3e] : 0;
    let a = 0;
    switch (i) {
      case VG:
        a = 2;
        break;
      case CG:
        a = 1;
        break;
      case wE:
        if (s === yG) {
          a = 2;
          break;
        }
        if (s === OG) {
          a = 1;
          break;
        }
    }
    return {
      width: t[BE],
      height: t[EG],
      mipmapCount: n,
      isFourCC: (t[WE] & BG) === BG,
      isRGB: (t[WE] & WG) === WG,
      isLuminance: (t[WE] & SG) === SG,
      isCube: (t[o3e] & mG) === mG,
      isCompressed: i === UG || i === IG || i === RG,
      dxgiFormat: s,
      textureType: a
    };
  }
  static _GetHalfFloatAsFloatRGBAArrayBuffer(e, t, r, n, i, s) {
    const a = new Float32Array(n), f = new Uint16Array(i, r);
    let o = 0;
    for (let d = 0; d < t; d++)
      for (let v = 0; v < e; v++) {
        const u = (v + d * e) * 4;
        a[o] = QH(f[u]), a[o + 1] = QH(f[u + 1]), a[o + 2] = QH(f[u + 2]), Aa.StoreLODInAlphaChannel ? a[o + 3] = s : a[o + 3] = QH(f[u + 3]), o += 4;
      }
    return a;
  }
  static _GetHalfFloatRGBAArrayBuffer(e, t, r, n, i, s) {
    if (Aa.StoreLODInAlphaChannel) {
      const a = new Uint16Array(n), f = new Uint16Array(i, r);
      let o = 0;
      for (let d = 0; d < t; d++)
        for (let v = 0; v < e; v++) {
          const u = (v + d * e) * 4;
          a[o] = f[u], a[o + 1] = f[u + 1], a[o + 2] = f[u + 2], a[o + 3] = LH(s), o += 4;
        }
      return a;
    }
    return new Uint16Array(i, r, n);
  }
  static _GetFloatRGBAArrayBuffer(e, t, r, n, i, s) {
    if (Aa.StoreLODInAlphaChannel) {
      const a = new Float32Array(n), f = new Float32Array(i, r);
      let o = 0;
      for (let d = 0; d < t; d++)
        for (let v = 0; v < e; v++) {
          const u = (v + d * e) * 4;
          a[o] = f[u], a[o + 1] = f[u + 1], a[o + 2] = f[u + 2], a[o + 3] = s, o += 4;
        }
      return a;
    }
    return new Float32Array(i, r, n);
  }
  static _GetFloatAsHalfFloatRGBAArrayBuffer(e, t, r, n, i, s) {
    const a = new Uint16Array(n), f = new Float32Array(i, r);
    let o = 0;
    for (let d = 0; d < t; d++)
      for (let v = 0; v < e; v++)
        a[o] = LH(f[o]), a[o + 1] = LH(f[o + 1]), a[o + 2] = LH(f[o + 2]), Aa.StoreLODInAlphaChannel ? a[o + 3] = LH(s) : a[o + 3] = LH(f[o + 3]), o += 4;
    return a;
  }
  static _GetFloatAsUIntRGBAArrayBuffer(e, t, r, n, i, s) {
    const a = new Uint8Array(n), f = new Float32Array(i, r);
    let o = 0;
    for (let d = 0; d < t; d++)
      for (let v = 0; v < e; v++) {
        const u = (v + d * e) * 4;
        a[o] = Xt.Clamp(f[u]) * 255, a[o + 1] = Xt.Clamp(f[u + 1]) * 255, a[o + 2] = Xt.Clamp(f[u + 2]) * 255, Aa.StoreLODInAlphaChannel ? a[o + 3] = s : a[o + 3] = Xt.Clamp(f[u + 3]) * 255, o += 4;
      }
    return a;
  }
  static _GetHalfFloatAsUIntRGBAArrayBuffer(e, t, r, n, i, s) {
    const a = new Uint8Array(n), f = new Uint16Array(i, r);
    let o = 0;
    for (let d = 0; d < t; d++)
      for (let v = 0; v < e; v++) {
        const u = (v + d * e) * 4;
        a[o] = Xt.Clamp(QH(f[u])) * 255, a[o + 1] = Xt.Clamp(QH(f[u + 1])) * 255, a[o + 2] = Xt.Clamp(QH(f[u + 2])) * 255, Aa.StoreLODInAlphaChannel ? a[o + 3] = s : a[o + 3] = Xt.Clamp(QH(f[u + 3])) * 255, o += 4;
      }
    return a;
  }
  static _GetRGBAArrayBuffer(e, t, r, n, i, s, a, f, o) {
    const d = new Uint8Array(n), v = new Uint8Array(i, r);
    let u = 0;
    for (let l = 0; l < t; l++)
      for (let P = 0; P < e; P++) {
        const p = (P + l * e) * 4;
        d[u] = v[p + s], d[u + 1] = v[p + a], d[u + 2] = v[p + f], d[u + 3] = v[p + o], u += 4;
      }
    return d;
  }
  static _ExtractLongWordOrder(e) {
    return e === 0 || e === 255 || e === -16777216 ? 0 : 1 + Aa._ExtractLongWordOrder(e >> 8);
  }
  static _GetRGBArrayBuffer(e, t, r, n, i, s, a, f) {
    const o = new Uint8Array(n), d = new Uint8Array(i, r);
    let v = 0;
    for (let u = 0; u < t; u++)
      for (let l = 0; l < e; l++) {
        const P = (l + u * e) * 3;
        o[v] = d[P + s], o[v + 1] = d[P + a], o[v + 2] = d[P + f], v += 3;
      }
    return o;
  }
  static _GetLuminanceArrayBuffer(e, t, r, n, i) {
    const s = new Uint8Array(n), a = new Uint8Array(i, r);
    let f = 0;
    for (let o = 0; o < t; o++)
      for (let d = 0; d < e; d++) {
        const v = d + o * e;
        s[f] = a[v], f++;
      }
    return s;
  }
  /**
   * Uploads DDS Levels to a Babylon Texture
   * @internal
   */
  static UploadDDSLevels(e, t, r, n, i, s, a = -1, f, o = !0) {
    let d = null;
    n.sphericalPolynomial && (d = []);
    const v = !!e.getCaps().s3tc;
    t.generateMipMaps = i;
    const u = new Int32Array(r.buffer, r.byteOffset, mE);
    let l, P, p, c = 0, H, T, q, b, j = 0, w = 1;
    if (u[e3e] !== Zce) {
      Se.Error("Invalid magic number in DDS header");
      return;
    }
    if (!n.isFourCC && !n.isRGB && !n.isLuminance) {
      Se.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");
      return;
    }
    if (n.isCompressed && !v) {
      Se.Error("Compressed textures are not supported on this platform.");
      return;
    }
    let m = u[r3e];
    H = u[t3e] + 4;
    let I = !1;
    if (n.isFourCC)
      switch (l = u[NG], l) {
        case UG:
          w = 8, j = 33777;
          break;
        case IG:
          w = 16, j = 33778;
          break;
        case RG:
          w = 16, j = 33779;
          break;
        case VG:
          I = !0, m = 64;
          break;
        case CG:
          I = !0, m = 128;
          break;
        case wE: {
          H += 5 * 4;
          let ee = !1;
          switch (n.dxgiFormat) {
            case yG:
              I = !0, m = 64, ee = !0;
              break;
            case OG:
              I = !0, m = 128, ee = !0;
              break;
            case $ce:
              n.isRGB = !0, n.isFourCC = !1, m = 32, ee = !0;
              break;
          }
          if (ee)
            break;
        }
        default:
          console.error("Unsupported FourCC code:", _ce(l));
          return;
      }
    const N = Aa._ExtractLongWordOrder(u[n3e]), k = Aa._ExtractLongWordOrder(u[i3e]), R = Aa._ExtractLongWordOrder(u[s3e]), y = Aa._ExtractLongWordOrder(u[a3e]);
    I && (j = e._getRGBABufferInternalSizedFormat(n.textureType)), q = 1, u[kG] & wG && i !== !1 && (q = Math.max(1, u[FG]));
    const O = f || 0, Y = e.getCaps();
    for (let ee = O; ee < s; ee++) {
      for (P = u[BE], p = u[EG], b = 0; b < q; ++b) {
        if (a === -1 || a === b) {
          const Z = a === -1 ? b : 0;
          if (!n.isCompressed && n.isFourCC) {
            t.format = 5, c = P * p * 4;
            let te = null;
            if (e._badOS || e._badDesktopOS || !Y.textureHalfFloat && !Y.textureFloat)
              m === 128 ? (te = Aa._GetFloatAsUIntRGBAArrayBuffer(P, p, r.byteOffset + H, c, r.buffer, Z), d && Z == 0 && d.push(Aa._GetFloatRGBAArrayBuffer(P, p, r.byteOffset + H, c, r.buffer, Z))) : m === 64 && (te = Aa._GetHalfFloatAsUIntRGBAArrayBuffer(P, p, r.byteOffset + H, c, r.buffer, Z), d && Z == 0 && d.push(Aa._GetHalfFloatAsFloatRGBAArrayBuffer(P, p, r.byteOffset + H, c, r.buffer, Z))), t.type = 0;
            else {
              const fe = Y.textureFloat && (o && Y.textureFloatLinearFiltering || !o), _ = Y.textureHalfFloat && (o && Y.textureHalfFloatLinearFiltering || !o), G = (m === 128 || m === 64 && !_) && fe ? 1 : (m === 64 || m === 128 && !fe) && _ ? 2 : 0;
              let L, $ = null;
              switch (m) {
                case 128: {
                  switch (G) {
                    case 1:
                      L = Aa._GetFloatRGBAArrayBuffer, $ = null;
                      break;
                    case 2:
                      L = Aa._GetFloatAsHalfFloatRGBAArrayBuffer, $ = Aa._GetFloatRGBAArrayBuffer;
                      break;
                    case 0:
                      L = Aa._GetFloatAsUIntRGBAArrayBuffer, $ = Aa._GetFloatRGBAArrayBuffer;
                      break;
                  }
                  break;
                }
                default: {
                  switch (G) {
                    case 1:
                      L = Aa._GetHalfFloatAsFloatRGBAArrayBuffer, $ = null;
                      break;
                    case 2:
                      L = Aa._GetHalfFloatRGBAArrayBuffer, $ = Aa._GetHalfFloatAsFloatRGBAArrayBuffer;
                      break;
                    case 0:
                      L = Aa._GetHalfFloatAsUIntRGBAArrayBuffer, $ = Aa._GetHalfFloatAsFloatRGBAArrayBuffer;
                      break;
                  }
                  break;
                }
              }
              t.type = G, te = L(P, p, r.byteOffset + H, c, r.buffer, Z), d && Z == 0 && d.push($ ? $(P, p, r.byteOffset + H, c, r.buffer, Z) : te);
            }
            te && e._uploadDataToTextureDirectly(t, te, ee, Z);
          } else if (n.isRGB)
            t.type = 0, m === 24 ? (t.format = 4, c = P * p * 3, T = Aa._GetRGBArrayBuffer(P, p, r.byteOffset + H, c, r.buffer, N, k, R), e._uploadDataToTextureDirectly(t, T, ee, Z)) : (t.format = 5, c = P * p * 4, T = Aa._GetRGBAArrayBuffer(P, p, r.byteOffset + H, c, r.buffer, N, k, R, y), e._uploadDataToTextureDirectly(t, T, ee, Z));
          else if (n.isLuminance) {
            const te = e._getUnpackAlignement(), fe = P;
            c = Math.floor((P + te - 1) / te) * te * (p - 1) + fe, T = Aa._GetLuminanceArrayBuffer(P, p, r.byteOffset + H, c, r.buffer), t.format = 1, t.type = 0, e._uploadDataToTextureDirectly(t, T, ee, Z);
          } else
            c = Math.max(4, P) / 4 * Math.max(4, p) / 4 * w, T = new Uint8Array(r.buffer, r.byteOffset + H, c), t.type = 0, e._uploadCompressedDataToTextureDirectly(t, j, P, p, T, ee, Z);
        }
        H += m ? P * p * (m / 8) : c, P *= 0.5, p *= 0.5, P = Math.max(1, P), p = Math.max(1, p);
      }
      if (f !== void 0)
        break;
    }
    d && d.length > 0 ? n.sphericalPolynomial = Sm.ConvertCubeMapToSphericalPolynomial({
      size: u[BE],
      right: d[0],
      left: d[1],
      up: d[2],
      down: d[3],
      front: d[4],
      back: d[5],
      format: 5,
      type: 1,
      gammaSpace: !1
    }) : n.sphericalPolynomial = void 0;
  }
}
Aa.StoreLODInAlphaChannel = !1;
hr.prototype.createPrefilteredCubeTexture = function(A, e, t, r, n = null, i = null, s, a = null, f = !0) {
  const o = (d) => {
    if (!d) {
      n && n(null);
      return;
    }
    const v = d.texture;
    if (f ? d.info.sphericalPolynomial && (v._sphericalPolynomial = d.info.sphericalPolynomial) : v._sphericalPolynomial = new i4(), v._source = ri.CubePrefiltered, this.getCaps().textureLOD) {
      n && n(v);
      return;
    }
    const u = 3, l = this._gl, P = d.width;
    if (!P)
      return;
    const p = [];
    for (let c = 0; c < u; c++) {
      const T = 1 - c / (u - 1), q = r, b = Xt.Log2(P) * t + r, j = q + (b - q) * T, w = Math.round(Math.min(Math.max(j, 0), b)), m = new As(this, ri.Temp);
      if (m.type = v.type, m.format = v.format, m.width = Math.pow(2, Math.max(Xt.Log2(P) - w, 0)), m.height = m.width, m.isCube = !0, m._cachedWrapU = 0, m._cachedWrapV = 0, this._bindTextureDirectly(l.TEXTURE_CUBE_MAP, m, !0), m.samplingMode = 2, l.texParameteri(l.TEXTURE_CUBE_MAP, l.TEXTURE_MAG_FILTER, l.LINEAR), l.texParameteri(l.TEXTURE_CUBE_MAP, l.TEXTURE_MIN_FILTER, l.LINEAR), l.texParameteri(l.TEXTURE_CUBE_MAP, l.TEXTURE_WRAP_S, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_CUBE_MAP, l.TEXTURE_WRAP_T, l.CLAMP_TO_EDGE), d.isDDS) {
        const N = d.info, k = d.data;
        this._unpackFlipY(N.isCompressed), Aa.UploadDDSLevels(this, m, k, N, !0, 6, w);
      } else
        Se.Warn("DDS is the only prefiltered cube map supported so far.");
      this._bindTextureDirectly(l.TEXTURE_CUBE_MAP, null);
      const I = new ls(e);
      I._isCube = !0, I._texture = m, m.isReady = !0, p.push(I);
    }
    v._lodTextureHigh = p[2], v._lodTextureMid = p[1], v._lodTextureLow = p[0], n && n(v);
  };
  return this.createCubeTexture(A, e, null, !1, o, i, s, a, f, t, r);
};
class Wte {
  constructor() {
    this.supportCascades = !0;
  }
  /**
   * This returns if the loader support the current file information.
   * @param extension defines the file extension of the file being loaded
   * @returns true if the loader can load the specified file
   */
  canLoad(e) {
    return e.endsWith(".dds");
  }
  /**
   * Uploads the cube texture data to the WebGL texture. It has already been bound.
   * @param imgs contains the cube maps
   * @param texture defines the BabylonJS internal texture
   * @param createPolynomials will be true if polynomials have been requested
   * @param onLoad defines the callback to trigger once the texture is ready
   */
  loadCubeData(e, t, r, n) {
    const i = t.getEngine();
    let s, a = !1, f = 1e3;
    if (Array.isArray(e))
      for (let o = 0; o < e.length; o++) {
        const d = e[o];
        s = Aa.GetDDSInfo(d), t.width = s.width, t.height = s.height, a = (s.isRGB || s.isLuminance || s.mipmapCount > 1) && t.generateMipMaps, i._unpackFlipY(s.isCompressed), Aa.UploadDDSLevels(i, t, d, s, a, 6, -1, o), !s.isFourCC && s.mipmapCount === 1 ? i.generateMipMapsForCubemap(t) : f = s.mipmapCount - 1;
      }
    else {
      const o = e;
      s = Aa.GetDDSInfo(o), t.width = s.width, t.height = s.height, r && (s.sphericalPolynomial = new i4()), a = (s.isRGB || s.isLuminance || s.mipmapCount > 1) && t.generateMipMaps, i._unpackFlipY(s.isCompressed), Aa.UploadDDSLevels(i, t, o, s, a, 6), !s.isFourCC && s.mipmapCount === 1 ? i.generateMipMapsForCubemap(t, !1) : f = s.mipmapCount - 1;
    }
    i._setCubeMapTextureParams(t, a, f), t.isReady = !0, t.onLoadedObservable.notifyObservers(t), t.onLoadedObservable.clear(), n && n({ isDDS: !0, width: t.width, info: s, data: e, texture: t });
  }
  /**
   * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param callback defines the method to call once ready to upload
   */
  loadData(e, t, r) {
    const n = Aa.GetDDSInfo(e), i = (n.isRGB || n.isLuminance || n.mipmapCount > 1) && t.generateMipMaps && n.width >> n.mipmapCount - 1 === 1;
    r(n.width, n.height, i, n.isFourCC, () => {
      Aa.UploadDDSLevels(t.getEngine(), t, e, n, i, 1);
    });
  }
}
Ge._TextureLoaders.push(new Wte());
class Ste {
  constructor() {
    this.supportCascades = !1;
  }
  /**
   * This returns if the loader support the current file information.
   * @param extension defines the file extension of the file being loaded
   * @returns true if the loader can load the specified file
   */
  canLoad(e) {
    return e.endsWith(".env");
  }
  /**
   * Uploads the cube texture data to the WebGL texture. It has already been bound.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param createPolynomials will be true if polynomials have been requested
   * @param onLoad defines the callback to trigger once the texture is ready
   * @param onError defines the callback to trigger in case of error
   */
  loadCubeData(e, t, r, n, i) {
    if (Array.isArray(e))
      return;
    const s = ry(e);
    if (s) {
      t.width = s.width, t.height = s.width;
      try {
        iy(t, s), EQ(t, e, s).then(() => {
          t.isReady = !0, t.onLoadedObservable.notifyObservers(t), t.onLoadedObservable.clear(), n && n();
        }, (a) => {
          i == null || i("Can not upload environment levels", a);
        });
      } catch (a) {
        i == null || i("Can not upload environment file", a);
      }
    } else
      i && i("Can not parse the environment file", null);
  }
  /**
   * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
   */
  loadData() {
    throw ".env not supported in 2d.";
  }
}
Ge._TextureLoaders.push(new Ste());
class yv {
  /**
   * Creates a new KhronosTextureContainer
   * @param data contents of the KTX container file
   * @param facesExpected should be either 1 or 6, based whether a cube texture or or
   */
  constructor(e, t) {
    if (this.data = e, this.isInvalid = !1, !yv.IsValid(e)) {
      this.isInvalid = !0, Se.Error("texture missing KTX identifier");
      return;
    }
    const r = Uint32Array.BYTES_PER_ELEMENT, n = new DataView(this.data.buffer, this.data.byteOffset + 12, 13 * r), s = n.getUint32(0, !0) === 67305985;
    if (this.glType = n.getUint32(1 * r, s), this.glTypeSize = n.getUint32(2 * r, s), this.glFormat = n.getUint32(3 * r, s), this.glInternalFormat = n.getUint32(4 * r, s), this.glBaseInternalFormat = n.getUint32(5 * r, s), this.pixelWidth = n.getUint32(6 * r, s), this.pixelHeight = n.getUint32(7 * r, s), this.pixelDepth = n.getUint32(8 * r, s), this.numberOfArrayElements = n.getUint32(9 * r, s), this.numberOfFaces = n.getUint32(10 * r, s), this.numberOfMipmapLevels = n.getUint32(11 * r, s), this.bytesOfKeyValueData = n.getUint32(12 * r, s), this.glType !== 0) {
      Se.Error("only compressed formats currently supported"), this.isInvalid = !0;
      return;
    } else
      this.numberOfMipmapLevels = Math.max(1, this.numberOfMipmapLevels);
    if (this.pixelHeight === 0 || this.pixelDepth !== 0) {
      Se.Error("only 2D textures currently supported"), this.isInvalid = !0;
      return;
    }
    if (this.numberOfArrayElements !== 0) {
      Se.Error("texture arrays not currently supported"), this.isInvalid = !0;
      return;
    }
    if (this.numberOfFaces !== t) {
      Se.Error("number of faces expected" + t + ", but found " + this.numberOfFaces), this.isInvalid = !0;
      return;
    }
    this.loadType = yv.COMPRESSED_2D;
  }
  /**
   * Uploads KTX content to a Babylon Texture.
   * It is assumed that the texture has already been created & is currently bound
   * @internal
   */
  uploadLevels(e, t) {
    switch (this.loadType) {
      case yv.COMPRESSED_2D:
        this._upload2DCompressedLevels(e, t);
        break;
      case yv.TEX_2D:
      case yv.COMPRESSED_3D:
      case yv.TEX_3D:
    }
  }
  _upload2DCompressedLevels(e, t) {
    let r = yv.HEADER_LEN + this.bytesOfKeyValueData, n = this.pixelWidth, i = this.pixelHeight;
    const s = t ? this.numberOfMipmapLevels : 1;
    for (let a = 0; a < s; a++) {
      const f = new Int32Array(this.data.buffer, this.data.byteOffset + r, 1)[0];
      r += 4;
      for (let o = 0; o < this.numberOfFaces; o++) {
        const d = new Uint8Array(this.data.buffer, this.data.byteOffset + r, f);
        e.getEngine()._uploadCompressedDataToTextureDirectly(e, e.format, n, i, d, o, a), r += f, r += 3 - (f + 3) % 4;
      }
      n = Math.max(1, n * 0.5), i = Math.max(1, i * 0.5);
    }
  }
  /**
   * Checks if the given data starts with a KTX file identifier.
   * @param data the data to check
   * @returns true if the data is a KTX file or false otherwise
   */
  static IsValid(e) {
    if (e.byteLength >= 12) {
      const t = new Uint8Array(e.buffer, e.byteOffset, 12);
      if (t[0] === 171 && t[1] === 75 && t[2] === 84 && t[3] === 88 && t[4] === 32 && t[5] === 49 && t[6] === 49 && t[7] === 187 && t[8] === 13 && t[9] === 10 && t[10] === 26 && t[11] === 10)
        return !0;
    }
    return !1;
  }
}
yv.HEADER_LEN = 12 + 13 * 4;
yv.COMPRESSED_2D = 0;
yv.COMPRESSED_3D = 1;
yv.TEX_2D = 2;
yv.TEX_3D = 3;
class Ute {
  /**
   * Constructor
   * @param workers Array of workers to use for actions
   */
  constructor(e) {
    this._pendingActions = new Array(), this._workerInfos = e.map((t) => ({
      workerPromise: Promise.resolve(t),
      idle: !0
    }));
  }
  /**
   * Terminates all workers and clears any pending actions.
   */
  dispose() {
    for (const e of this._workerInfos)
      e.workerPromise.then((t) => {
        t.terminate();
      });
    this._workerInfos.length = 0, this._pendingActions.length = 0;
  }
  /**
   * Pushes an action to the worker pool. If all the workers are active, the action will be
   * pended until a worker has completed its action.
   * @param action The action to perform. Call onComplete when the action is complete.
   */
  push(e) {
    this._executeOnIdleWorker(e) || this._pendingActions.push(e);
  }
  _executeOnIdleWorker(e) {
    for (const t of this._workerInfos)
      if (t.idle)
        return this._execute(t, e), !0;
    return !1;
  }
  _execute(e, t) {
    e.idle = !1, e.workerPromise.then((r) => {
      t(r, () => {
        const n = this._pendingActions.shift();
        n ? this._execute(e, n) : e.idle = !0;
      });
    });
  }
}
class lU extends Ute {
  constructor(e, t, r = lU.DefaultOptions) {
    super([]), this._maxWorkers = e, this._createWorkerAsync = t, this._options = r;
  }
  push(e) {
    if (!this._executeOnIdleWorker(e))
      if (this._workerInfos.length < this._maxWorkers) {
        const t = {
          workerPromise: this._createWorkerAsync(),
          idle: !1
        };
        this._workerInfos.push(t), this._execute(t, e);
      } else
        this._pendingActions.push(e);
  }
  _execute(e, t) {
    e.timeoutId && (clearTimeout(e.timeoutId), delete e.timeoutId), super._execute(e, (r, n) => {
      t(r, () => {
        n(), e.idle && (e.timeoutId = setTimeout(() => {
          e.workerPromise.then((s) => {
            s.terminate();
          });
          const i = this._workerInfos.indexOf(e);
          i !== -1 && this._workerInfos.splice(i, 1);
        }, this._options.idleTimeElapsedBeforeRelease));
      });
    });
  }
}
lU.DefaultOptions = {
  idleTimeElapsedBeforeRelease: 1e3
};
var pF;
(function(A) {
  A[A.ETC1S = 0] = "ETC1S", A[A.UASTC4x4 = 1] = "UASTC4x4";
})(pF || (pF = {}));
var nS;
(function(A) {
  A[A.ASTC_4X4_RGBA = 0] = "ASTC_4X4_RGBA", A[A.BC7_RGBA = 1] = "BC7_RGBA", A[A.BC3_RGBA = 2] = "BC3_RGBA", A[A.BC1_RGB = 3] = "BC1_RGB", A[A.PVRTC1_4_RGBA = 4] = "PVRTC1_4_RGBA", A[A.PVRTC1_4_RGB = 5] = "PVRTC1_4_RGB", A[A.ETC2_RGBA = 6] = "ETC2_RGBA", A[A.ETC1_RGB = 7] = "ETC1_RGB", A[A.RGBA32 = 8] = "RGBA32", A[A.R8 = 9] = "R8", A[A.RG8 = 10] = "RG8";
})(nS || (nS = {}));
var nO;
(function(A) {
  A[A.COMPRESSED_RGBA_BPTC_UNORM_EXT = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT", A[A.COMPRESSED_RGBA_ASTC_4X4_KHR = 37808] = "COMPRESSED_RGBA_ASTC_4X4_KHR", A[A.COMPRESSED_RGB_S3TC_DXT1_EXT = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT", A[A.COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT", A[A.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842] = "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG", A[A.COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840] = "COMPRESSED_RGB_PVRTC_4BPPV1_IMG", A[A.COMPRESSED_RGBA8_ETC2_EAC = 37496] = "COMPRESSED_RGBA8_ETC2_EAC", A[A.COMPRESSED_RGB8_ETC2 = 37492] = "COMPRESSED_RGB8_ETC2", A[A.COMPRESSED_RGB_ETC1_WEBGL = 36196] = "COMPRESSED_RGB_ETC1_WEBGL", A[A.RGBA8Format = 32856] = "RGBA8Format", A[A.R8Format = 33321] = "R8Format", A[A.RG8Format = 33323] = "RG8Format";
})(nO || (nO = {}));
function hF(A) {
  A.wasmUASTCToASTC && (KTX2DECODER.LiteTranscoder_UASTC_ASTC.WasmModuleURL = A.wasmUASTCToASTC), A.wasmUASTCToBC7 && (KTX2DECODER.LiteTranscoder_UASTC_BC7.WasmModuleURL = A.wasmUASTCToBC7), A.wasmUASTCToRGBA_UNORM && (KTX2DECODER.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL = A.wasmUASTCToRGBA_UNORM), A.wasmUASTCToRGBA_SRGB && (KTX2DECODER.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL = A.wasmUASTCToRGBA_SRGB), A.wasmUASTCToR8_UNORM && (KTX2DECODER.LiteTranscoder_UASTC_R8_UNORM.WasmModuleURL = A.wasmUASTCToR8_UNORM), A.wasmUASTCToRG8_UNORM && (KTX2DECODER.LiteTranscoder_UASTC_RG8_UNORM.WasmModuleURL = A.wasmUASTCToRG8_UNORM), A.jsMSCTranscoder && (KTX2DECODER.MSCTranscoder.JSModuleURL = A.jsMSCTranscoder), A.wasmMSCTranscoder && (KTX2DECODER.MSCTranscoder.WasmModuleURL = A.wasmMSCTranscoder), A.wasmZSTDDecoder && (KTX2DECODER.ZSTDDecoder.WasmModuleURL = A.wasmZSTDDecoder);
}
class Ite {
  constructor() {
    this._isDirty = !0, this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC = !0, this._ktx2DecoderOptions = {};
  }
  /**
   * Gets the dirty flag
   */
  get isDirty() {
    return this._isDirty;
  }
  /**
   * force a (uncompressed) RGBA transcoded format if transcoding a UASTC source format and ASTC + BC7 are not available as a compressed transcoded format
   */
  get useRGBAIfASTCBC7NotAvailableWhenUASTC() {
    return this._useRGBAIfASTCBC7NotAvailableWhenUASTC;
  }
  set useRGBAIfASTCBC7NotAvailableWhenUASTC(e) {
    this._useRGBAIfASTCBC7NotAvailableWhenUASTC !== e && (this._useRGBAIfASTCBC7NotAvailableWhenUASTC = e, this._isDirty = !0);
  }
  /**
   * force a (uncompressed) RGBA transcoded format if transcoding a UASTC source format and only BC1 or BC3 are available as a compressed transcoded format.
   * This property is true by default to favor speed over memory, because currently transcoding from UASTC to BC1/3 is slow because the transcoder transcodes
   * to uncompressed and then recompresses the texture
   */
  get useRGBAIfOnlyBC1BC3AvailableWhenUASTC() {
    return this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC;
  }
  set useRGBAIfOnlyBC1BC3AvailableWhenUASTC(e) {
    this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC !== e && (this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC = e, this._isDirty = !0);
  }
  /**
   * force to always use (uncompressed) RGBA for transcoded format
   */
  get forceRGBA() {
    return this._forceRGBA;
  }
  set forceRGBA(e) {
    this._forceRGBA !== e && (this._forceRGBA = e, this._isDirty = !0);
  }
  /**
   * force to always use (uncompressed) R8 for transcoded format
   */
  get forceR8() {
    return this._forceR8;
  }
  set forceR8(e) {
    this._forceR8 !== e && (this._forceR8 = e, this._isDirty = !0);
  }
  /**
   * force to always use (uncompressed) RG8 for transcoded format
   */
  get forceRG8() {
    return this._forceRG8;
  }
  set forceRG8(e) {
    this._forceRG8 !== e && (this._forceRG8 = e, this._isDirty = !0);
  }
  /**
   * list of transcoders to bypass when looking for a suitable transcoder. The available transcoders are:
   *      UniversalTranscoder_UASTC_ASTC
   *      UniversalTranscoder_UASTC_BC7
   *      UniversalTranscoder_UASTC_RGBA_UNORM
   *      UniversalTranscoder_UASTC_RGBA_SRGB
   *      UniversalTranscoder_UASTC_R8_UNORM
   *      UniversalTranscoder_UASTC_RG8_UNORM
   *      MSCTranscoder
   */
  get bypassTranscoders() {
    return this._bypassTranscoders;
  }
  set bypassTranscoders(e) {
    this._bypassTranscoders !== e && (this._bypassTranscoders = e, this._isDirty = !0);
  }
  /** @internal */
  _getKTX2DecoderOptions() {
    if (!this._isDirty)
      return this._ktx2DecoderOptions;
    this._isDirty = !1;
    const e = {
      useRGBAIfASTCBC7NotAvailableWhenUASTC: this._useRGBAIfASTCBC7NotAvailableWhenUASTC,
      forceRGBA: this._forceRGBA,
      forceR8: this._forceR8,
      forceRG8: this._forceRG8,
      bypassTranscoders: this._bypassTranscoders
    };
    return this.useRGBAIfOnlyBC1BC3AvailableWhenUASTC && (e.transcodeFormatDecisionTree = {
      UASTC: {
        transcodeFormat: [nS.BC1_RGB, nS.BC3_RGBA],
        yes: {
          transcodeFormat: nS.RGBA32,
          engineFormat: nO.RGBA8Format,
          roundToMultiple4: !1
        }
      }
    }), this._ktx2DecoderOptions = e, e;
  }
}
class H6 {
  static GetDefaultNumWorkers() {
    return typeof navigator != "object" || !navigator.hardwareConcurrency ? 1 : Math.min(Math.floor(navigator.hardwareConcurrency * 0.5), 4);
  }
  static _Initialize(e) {
    if (H6._WorkerPoolPromise || H6._DecoderModulePromise)
      return;
    const t = {
      jsDecoderModule: ye.GetBabylonScriptURL(this.URLConfig.jsDecoderModule, !0),
      wasmUASTCToASTC: ye.GetBabylonScriptURL(this.URLConfig.wasmUASTCToASTC, !0),
      wasmUASTCToBC7: ye.GetBabylonScriptURL(this.URLConfig.wasmUASTCToBC7, !0),
      wasmUASTCToRGBA_UNORM: ye.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRGBA_UNORM, !0),
      wasmUASTCToRGBA_SRGB: ye.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRGBA_SRGB, !0),
      wasmUASTCToR8_UNORM: ye.GetBabylonScriptURL(this.URLConfig.wasmUASTCToR8_UNORM, !0),
      wasmUASTCToRG8_UNORM: ye.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRG8_UNORM, !0),
      jsMSCTranscoder: ye.GetBabylonScriptURL(this.URLConfig.jsMSCTranscoder, !0),
      wasmMSCTranscoder: ye.GetBabylonScriptURL(this.URLConfig.wasmMSCTranscoder, !0),
      wasmZSTDDecoder: ye.GetBabylonScriptURL(this.URLConfig.wasmZSTDDecoder, !0)
    };
    e && typeof Worker == "function" && typeof URL < "u" ? H6._WorkerPoolPromise = new Promise((r) => {
      const n = `${hF}(${A3e})()`, i = URL.createObjectURL(new Blob([n], { type: "application/javascript" }));
      r(new lU(e, () => new Promise((s, a) => {
        const f = new Worker(i), o = (v) => {
          f.removeEventListener("error", o), f.removeEventListener("message", d), a(v);
        }, d = (v) => {
          v.data.action === "init" && (f.removeEventListener("error", o), f.removeEventListener("message", d), s(f));
        };
        f.addEventListener("error", o), f.addEventListener("message", d), f.postMessage({
          action: "init",
          urls: t
        });
      })));
    }) : typeof KTX2DECODER > "u" ? H6._DecoderModulePromise = ye.LoadBabylonScriptAsync(t.jsDecoderModule).then(() => (KTX2DECODER.MSCTranscoder.UseFromWorkerThread = !1, KTX2DECODER.WASMMemoryManager.LoadBinariesFromCurrentThread = !0, hF(t), new KTX2DECODER.KTX2Decoder())) : (KTX2DECODER.MSCTranscoder.UseFromWorkerThread = !1, KTX2DECODER.WASMMemoryManager.LoadBinariesFromCurrentThread = !0, H6._DecoderModulePromise = Promise.resolve(new KTX2DECODER.KTX2Decoder()));
  }
  /**
   * Constructor
   * @param engine The engine to use
   * @param numWorkers The number of workers for async operations. Specify `0` to disable web workers and run synchronously in the current context.
   */
  constructor(e, t = H6.DefaultNumWorkers) {
    this._engine = e, H6._Initialize(t);
  }
  /**
   * @internal
   */
  uploadAsync(e, t, r) {
    const n = this._engine.getCaps(), i = {
      astc: !!n.astc,
      bptc: !!n.bptc,
      s3tc: !!n.s3tc,
      pvrtc: !!n.pvrtc,
      etc2: !!n.etc2,
      etc1: !!n.etc1
    };
    if (H6._WorkerPoolPromise)
      return H6._WorkerPoolPromise.then((s) => new Promise((a, f) => {
        s.push((o, d) => {
          const v = (P) => {
            o.removeEventListener("error", v), o.removeEventListener("message", u), f(P), d();
          }, u = (P) => {
            if (P.data.action === "decoded") {
              if (o.removeEventListener("error", v), o.removeEventListener("message", u), !P.data.success)
                f({ message: P.data.msg });
              else
                try {
                  this._createTexture(P.data.decodedData, t, r), a();
                } catch (p) {
                  f({ message: p });
                }
              d();
            }
          };
          o.addEventListener("error", v), o.addEventListener("message", u), o.postMessage({ action: "setDefaultDecoderOptions", options: H6.DefaultDecoderOptions._getKTX2DecoderOptions() });
          const l = new Uint8Array(e.byteLength);
          l.set(new Uint8Array(e.buffer, e.byteOffset, e.byteLength)), o.postMessage({ action: "decode", data: l, caps: i, options: r }, [l.buffer]);
        });
      }));
    if (H6._DecoderModulePromise)
      return H6._DecoderModulePromise.then((s) => (H6.DefaultDecoderOptions.isDirty && (KTX2DECODER.KTX2Decoder.DefaultDecoderOptions = H6.DefaultDecoderOptions._getKTX2DecoderOptions()), new Promise((a, f) => {
        s.decode(e, n).then((o) => {
          this._createTexture(o, t), a();
        }).catch((o) => {
          f({ message: o });
        });
      })));
    throw new Error("KTX2 decoder module is not available");
  }
  _createTexture(e, t, r) {
    this._engine._bindTextureDirectly(3553, t), r && (r.transcodedFormat = e.transcodedFormat, r.isInGammaSpace = e.isInGammaSpace, r.hasAlpha = e.hasAlpha, r.transcoderName = e.transcoderName);
    let i = !0;
    switch (e.transcodedFormat) {
      case 32856:
        t.type = 0, t.format = 5;
        break;
      case 33321:
        t.type = 0, t.format = 6;
        break;
      case 33323:
        t.type = 0, t.format = 7;
        break;
      default:
        t.format = e.transcodedFormat, i = !1;
        break;
    }
    if (t._gammaSpace = e.isInGammaSpace, t.generateMipMaps = e.mipmaps.length > 1, e.errors)
      throw new Error("KTX2 container - could not transcode the data. " + e.errors);
    for (let s = 0; s < e.mipmaps.length; ++s) {
      const a = e.mipmaps[s];
      if (!a || !a.data)
        throw new Error("KTX2 container - could not transcode one of the image");
      i ? (t.width = a.width, t.height = a.height, this._engine._uploadDataToTextureDirectly(t, a.data, 0, s, void 0, !0)) : this._engine._uploadCompressedDataToTextureDirectly(t, e.transcodedFormat, a.width, a.height, a.data, 0, s);
    }
    t._extension = ".ktx2", t.width = e.mipmaps[0].width, t.height = e.mipmaps[0].height, t.isReady = !0, this._engine._bindTextureDirectly(3553, null);
  }
  /**
   * Checks if the given data starts with a KTX2 file identifier.
   * @param data the data to check
   * @returns true if the data is a KTX2 file or false otherwise
   */
  static IsValid(e) {
    if (e.byteLength >= 12) {
      const t = new Uint8Array(e.buffer, e.byteOffset, 12);
      if (t[0] === 171 && t[1] === 75 && t[2] === 84 && t[3] === 88 && t[4] === 32 && t[5] === 50 && t[6] === 48 && t[7] === 187 && t[8] === 13 && t[9] === 10 && t[10] === 26 && t[11] === 10)
        return !0;
    }
    return !1;
  }
}
H6.URLConfig = {
  jsDecoderModule: "https://cdn.babylonjs.com/babylon.ktx2Decoder.js",
  wasmUASTCToASTC: null,
  wasmUASTCToBC7: null,
  wasmUASTCToRGBA_UNORM: null,
  wasmUASTCToRGBA_SRGB: null,
  wasmUASTCToR8_UNORM: null,
  wasmUASTCToRG8_UNORM: null,
  jsMSCTranscoder: null,
  wasmMSCTranscoder: null,
  wasmZSTDDecoder: null
};
H6.DefaultNumWorkers = H6.GetDefaultNumWorkers();
H6.DefaultDecoderOptions = new Ite();
function A3e() {
  let A;
  onmessage = (e) => {
    if (e.data)
      switch (e.data.action) {
        case "init": {
          const t = e.data.urls;
          importScripts(t.jsDecoderModule), hF(t), A = new KTX2DECODER.KTX2Decoder(), postMessage({ action: "init" });
          break;
        }
        case "setDefaultDecoderOptions": {
          KTX2DECODER.KTX2Decoder.DefaultDecoderOptions = e.data.options;
          break;
        }
        case "decode":
          A.decode(e.data.data, e.data.caps, e.data.options).then((t) => {
            const r = [];
            for (let n = 0; n < t.mipmaps.length; ++n) {
              const i = t.mipmaps[n];
              i && i.data && r.push(i.data.buffer);
            }
            postMessage({ action: "decoded", success: !0, decodedData: t }, r);
          }).catch((t) => {
            postMessage({ action: "decoded", success: !1, msg: t });
          });
          break;
      }
  };
}
function d3e(A) {
  switch (A) {
    case 35916:
      return 33776;
    case 35918:
      return 33778;
    case 35919:
      return 33779;
    case 37493:
      return 37492;
    case 37497:
      return 37496;
    case 37495:
      return 37494;
    case 37840:
      return 37808;
    case 36493:
      return 36492;
  }
  return null;
}
class Rte {
  constructor() {
    this.supportCascades = !1;
  }
  /**
   * This returns if the loader support the current file information.
   * @param extension defines the file extension of the file being loaded
   * @param mimeType defines the optional mime type of the file being loaded
   * @returns true if the loader can load the specified file
   */
  canLoad(e, t) {
    return e.endsWith(".ktx") || e.endsWith(".ktx2") || t === "image/ktx" || t === "image/ktx2";
  }
  /**
   * Uploads the cube texture data to the WebGL texture. It has already been bound.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param createPolynomials will be true if polynomials have been requested
   * @param onLoad defines the callback to trigger once the texture is ready
   */
  loadCubeData(e, t, r, n) {
    if (Array.isArray(e))
      return;
    t._invertVScale = !t.invertY;
    const i = t.getEngine(), s = new yv(e, 6), a = s.numberOfMipmapLevels > 1 && t.generateMipMaps;
    i._unpackFlipY(!0), s.uploadLevels(t, t.generateMipMaps), t.width = s.pixelWidth, t.height = s.pixelHeight, i._setCubeMapTextureParams(t, a, s.numberOfMipmapLevels - 1), t.isReady = !0, t.onLoadedObservable.notifyObservers(t), t.onLoadedObservable.clear(), n && n();
  }
  /**
   * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param callback defines the method to call once ready to upload
   * @param options
   */
  loadData(e, t, r, n) {
    if (yv.IsValid(e)) {
      t._invertVScale = !t.invertY;
      const i = new yv(e, 1), s = d3e(i.glInternalFormat);
      s ? (t.format = s, t._useSRGBBuffer = t.getEngine()._getUseSRGBBuffer(!0, t.generateMipMaps), t._gammaSpace = !0) : t.format = i.glInternalFormat, r(i.pixelWidth, i.pixelHeight, t.generateMipMaps, !0, () => {
        i.uploadLevels(t, t.generateMipMaps);
      }, i.isInvalid);
    } else
      H6.IsValid(e) ? new H6(t.getEngine()).uploadAsync(e, t, n).then(() => {
        r(t.width, t.height, t.generateMipMaps, !0, () => {
        }, !1);
      }, (s) => {
        Se.Warn(`Failed to load KTX2 texture data: ${s.message}`), r(0, 0, !1, !1, () => {
        }, !0);
      }) : (Se.Error("texture missing KTX identifier"), r(0, 0, !1, !1, () => {
      }, !0));
  }
}
Ge._TextureLoaders.unshift(new Rte());
class IS extends SA {
  /**
   * Creates a new webXRCamera, this should only be set at the camera after it has been updated by the xrSessionManager
   * @param name the name of the camera
   * @param scene the scene to add the camera to
   * @param _xrSessionManager a constructed xr session manager
   */
  constructor(e, t, r) {
    super(e, S.Zero(), t), this._xrSessionManager = r, this._firstFrame = !1, this._referenceQuaternion = Ze.Identity(), this._referencedPosition = new S(), this._trackingState = Jw.NOT_TRACKING, this.onXRCameraInitializedObservable = new Oe(), this.onBeforeCameraTeleport = new Oe(), this.onAfterCameraTeleport = new Oe(), this.onTrackingStateChanged = new Oe(), this.compensateOnFirstFrame = !0, this._rotate180 = new Ze(0, 1, 0, 0), this.minZ = 0.1, this.rotationQuaternion = new Ze(), this.cameraRigMode = Tr.RIG_MODE_CUSTOM, this.updateUpVectorFromRotation = !0, this._updateNumberOfRigCameras(1), this.freezeProjectionMatrix(), this._deferOnly = !0, this._xrSessionManager.onXRSessionInit.add(() => {
      this._referencedPosition.copyFromFloats(0, 0, 0), this._referenceQuaternion.copyFromFloats(0, 0, 0, 1), this._firstFrame = this.compensateOnFirstFrame;
    }), this._xrSessionManager.onXRFrameObservable.add(() => {
      this._firstFrame && this._updateFromXRSession(), this.onXRCameraInitializedObservable.hasObservers() && (this.onXRCameraInitializedObservable.notifyObservers(this), this.onXRCameraInitializedObservable.clear()), this._deferredUpdated && (this.position.copyFrom(this._deferredPositionUpdate), this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate)), this._updateReferenceSpace(), this._updateFromXRSession();
    }, void 0, !0);
  }
  /**
   * Get the current XR tracking state of the camera
   */
  get trackingState() {
    return this._trackingState;
  }
  _setTrackingState(e) {
    this._trackingState !== e && (this._trackingState = e, this.onTrackingStateChanged.notifyObservers(e));
  }
  /**
   * Return the user's height, unrelated to the current ground.
   * This will be the y position of this camera, when ground level is 0.
   */
  get realWorldHeight() {
    const e = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.baseReferenceSpace);
    return e && e.transform ? e.transform.position.y : 0;
  }
  /** @internal */
  _updateForDualEyeDebugging() {
    this._updateNumberOfRigCameras(2), this.rigCameras[0].viewport = new WA(0, 0, 0.5, 1), this.rigCameras[0].outputRenderTarget = null, this.rigCameras[1].viewport = new WA(0.5, 0, 0.5, 1), this.rigCameras[1].outputRenderTarget = null;
  }
  /**
   * Sets this camera's transformation based on a non-vr camera
   * @param otherCamera the non-vr camera to copy the transformation from
   * @param resetToBaseReferenceSpace should XR reset to the base reference space
   */
  setTransformationFromNonVRCamera(e = this.getScene().activeCamera, t = !0) {
    if (!e || e === this)
      return;
    e.computeWorldMatrix().decompose(void 0, this.rotationQuaternion, this.position), this.position.y = 0, Ze.FromEulerAnglesToRef(0, this.rotationQuaternion.toEulerAngles().y, 0, this.rotationQuaternion), this._firstFrame = !0, t && this._xrSessionManager.resetReferenceSpace();
  }
  /**
   * Gets the current instance class name ("WebXRCamera").
   * @returns the class name
   */
  getClassName() {
    return "WebXRCamera";
  }
  /**
   * Set the target for the camera to look at.
   * Note that this only rotates around the Y axis, as opposed to the default behavior of other cameras
   * @param target the target to set the camera to look at
   */
  setTarget(e) {
    const t = ue.Vector3[1];
    e.subtractToRef(this.position, t), t.y = 0, t.normalize();
    const r = Math.atan2(t.x, t.z);
    this.rotationQuaternion.toEulerAnglesToRef(t), Ze.FromEulerAnglesToRef(t.x, r, t.z, this.rotationQuaternion);
  }
  dispose() {
    super.dispose(), this._lastXRViewerPose = void 0;
  }
  _updateFromXRSession() {
    const e = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.referenceSpace);
    if (this._lastXRViewerPose = e || void 0, !e) {
      this._setTrackingState(Jw.NOT_TRACKING);
      return;
    }
    const t = e.emulatedPosition ? Jw.TRACKING_LOST : Jw.TRACKING;
    if (this._setTrackingState(t), this.minZ !== this._cache.minZ || this.maxZ !== this._cache.maxZ) {
      const r = {
        // if maxZ is 0 it should be "Infinity", but it doesn't work with the WebXR API. Setting to a large number.
        depthFar: this.maxZ || 1e4,
        depthNear: this.minZ
      };
      this._xrSessionManager.updateRenderState(r), this._cache.minZ = this.minZ, this._cache.maxZ = this.maxZ;
    }
    if (e.transform) {
      const r = e.transform.orientation;
      if (e.transform.orientation.x === void 0)
        return;
      const n = e.transform.position;
      this._referencedPosition.set(n.x, n.y, n.z), this._referenceQuaternion.set(r.x, r.y, r.z, r.w), this._scene.useRightHandedSystem || (this._referencedPosition.z *= -1, this._referenceQuaternion.z *= -1, this._referenceQuaternion.w *= -1), this._firstFrame ? (this._firstFrame = !1, this.position.y += this._referencedPosition.y, this._referenceQuaternion.copyFromFloats(0, 0, 0, 1)) : (this.rotationQuaternion.copyFrom(this._referenceQuaternion), this.position.copyFrom(this._referencedPosition));
    }
    this.rigCameras.length !== e.views.length && this._updateNumberOfRigCameras(e.views.length), e.views.forEach((r, n) => {
      var i;
      const s = this.rigCameras[n];
      !s.isLeftCamera && !s.isRightCamera && (r.eye === "right" ? s._isRightCamera = !0 : r.eye === "left" && (s._isLeftCamera = !0));
      const a = r.transform.position, f = r.transform.orientation;
      s.parent = this.parent, s.position.set(a.x, a.y, a.z), s.rotationQuaternion.set(f.x, f.y, f.z, f.w), this._scene.useRightHandedSystem ? s.rotationQuaternion.multiplyInPlace(this._rotate180) : (s.position.z *= -1, s.rotationQuaternion.z *= -1, s.rotationQuaternion.w *= -1), he.FromFloat32ArrayToRefScaled(r.projectionMatrix, 0, 1, s._projectionMatrix), this._scene.useRightHandedSystem || s._projectionMatrix.toggleProjectionMatrixHandInPlace(), n === 0 && this._projectionMatrix.copyFrom(s._projectionMatrix);
      const o = this._xrSessionManager.getRenderTargetTextureForView(r);
      this._renderingMultiview = ((i = o == null ? void 0 : o._texture) === null || i === void 0 ? void 0 : i.isMultiview) || !1, this._renderingMultiview ? n == 0 && (this._xrSessionManager.trySetViewportForView(this.viewport, r), this.outputRenderTarget = o) : (this._xrSessionManager.trySetViewportForView(s.viewport, r), s.outputRenderTarget = o || this._xrSessionManager.getRenderTargetTextureForView(r)), s.layerMask = this.layerMask;
    });
  }
  _updateNumberOfRigCameras(e = 1) {
    for (; this.rigCameras.length < e; ) {
      const t = new b1("XR-RigCamera: " + this.rigCameras.length, S.Zero(), this.getScene());
      t.minZ = 0.1, t.rotationQuaternion = new Ze(), t.updateUpVectorFromRotation = !0, t.isRigCamera = !0, t.rigParent = this, t.freezeProjectionMatrix(), this.rigCameras.push(t);
    }
    for (; this.rigCameras.length > e; ) {
      const t = this.rigCameras.pop();
      t && t.dispose();
    }
  }
  _updateReferenceSpace() {
    if (!this.position.equals(this._referencedPosition) || !this.rotationQuaternion.equals(this._referenceQuaternion)) {
      const e = ue.Matrix[0], t = ue.Matrix[1], r = ue.Matrix[2];
      he.ComposeToRef(IS._ScaleReadOnly, this._referenceQuaternion, this._referencedPosition, e), he.ComposeToRef(IS._ScaleReadOnly, this.rotationQuaternion, this.position, t), e.invert().multiplyToRef(t, r), r.invert(), this._scene.useRightHandedSystem || r.toggleModelMatrixHandInPlace(), r.decompose(void 0, this._referenceQuaternion, this._referencedPosition);
      const n = new XRRigidTransform({
        x: this._referencedPosition.x,
        y: this._referencedPosition.y,
        z: this._referencedPosition.z
      }, {
        x: this._referenceQuaternion.x,
        y: this._referenceQuaternion.y,
        z: this._referenceQuaternion.z,
        w: this._referenceQuaternion.w
      });
      this._xrSessionManager.referenceSpace = this._xrSessionManager.referenceSpace.getOffsetReferenceSpace(n);
    }
  }
}
IS._ScaleReadOnly = S.One();
class Ay {
  /**
   * Creates a WebXRExperienceHelper
   * @param _scene The scene the helper should be created in
   */
  constructor(e) {
    this._scene = e, this._nonVRCamera = null, this._attachedToElement = !1, this._spectatorCamera = null, this._originalSceneAutoClear = !0, this._supported = !1, this._spectatorMode = !1, this._lastTimestamp = 0, this.onInitialXRPoseSetObservable = new Oe(), this.onStateChangedObservable = new Oe(), this.state = d9.NOT_IN_XR, this.sessionManager = new MR(e), this.camera = new IS("webxr", e, this.sessionManager), this.featuresManager = new So(this.sessionManager), e.onDisposeObservable.addOnce(() => {
      this.dispose();
    });
  }
  /**
   * Creates the experience helper
   * @param scene the scene to attach the experience helper to
   * @returns a promise for the experience helper
   */
  static CreateAsync(e) {
    const t = new Ay(e);
    return t.sessionManager.initializeAsync().then(() => (t._supported = !0, t)).catch((r) => {
      throw t._setState(d9.NOT_IN_XR), t.dispose(), r;
    });
  }
  /**
   * Disposes of the experience helper
   */
  dispose() {
    var e;
    this.exitXRAsync(), this.camera.dispose(), this.onStateChangedObservable.clear(), this.onInitialXRPoseSetObservable.clear(), this.sessionManager.dispose(), (e = this._spectatorCamera) === null || e === void 0 || e.dispose(), this._nonVRCamera && (this._scene.activeCamera = this._nonVRCamera);
  }
  /**
   * Enters XR mode (This must be done within a user interaction in most browsers eg. button click)
   * @param sessionMode options for the XR session
   * @param referenceSpaceType frame of reference of the XR session
   * @param renderTarget the output canvas that will be used to enter XR mode
   * @param sessionCreationOptions optional XRSessionInit object to init the session with
   * @returns promise that resolves after xr mode has entered
   */
  async enterXRAsync(e, t, r = this.sessionManager.getWebXRRenderTarget(), n = {}) {
    var i, s, a;
    if (!this._supported)
      throw "WebXR not supported in this browser or environment";
    this._setState(d9.ENTERING_XR), t !== "viewer" && t !== "local" && (n.optionalFeatures = n.optionalFeatures || [], n.optionalFeatures.push(t)), n = await this.featuresManager._extendXRSessionInitObject(n), e === "immersive-ar" && t !== "unbounded" && Se.Warn("We recommend using 'unbounded' reference space type when using 'immersive-ar' session mode");
    try {
      await this.sessionManager.initializeSessionAsync(e, n), await this.sessionManager.setReferenceSpaceTypeAsync(t);
      const f = await r.initializeXRLayerAsync(this.sessionManager.session), o = {
        // if maxZ is 0 it should be "Infinity", but it doesn't work with the WebXR API. Setting to a large number.
        depthFar: this.camera.maxZ || 1e4,
        depthNear: this.camera.minZ
      };
      return this.featuresManager.getEnabledFeature(Gi.LAYERS) || (o.baseLayer = f), this.sessionManager.updateRenderState(o), this.sessionManager.runXRRenderLoop(), this._originalSceneAutoClear = this._scene.autoClear, this._nonVRCamera = this._scene.activeCamera, this._attachedToElement = !!(!((s = (i = this._nonVRCamera) === null || i === void 0 ? void 0 : i.inputs) === null || s === void 0) && s.attachedToElement), (a = this._nonVRCamera) === null || a === void 0 || a.detachControl(), this._scene.activeCamera = this.camera, e !== "immersive-ar" ? this._nonXRToXRCamera() : (this._scene.autoClear = !1, this.camera.compensateOnFirstFrame = !1, this.camera.position.set(0, 0, 0), this.camera.rotationQuaternion.set(0, 0, 0, 1), this.onInitialXRPoseSetObservable.notifyObservers(this.camera)), this.sessionManager.onXRSessionEnded.addOnce(() => {
        this.state !== d9.EXITING_XR && this._setState(d9.EXITING_XR), this.camera.rigCameras.forEach((d) => {
          d.outputRenderTarget = null;
        }), this._scene.autoClear = this._originalSceneAutoClear, this._scene.activeCamera = this._nonVRCamera, this._attachedToElement && this._nonVRCamera && this._nonVRCamera.attachControl(!!this._nonVRCamera.inputs.noPreventDefault), e !== "immersive-ar" && this.camera.compensateOnFirstFrame && (this._nonVRCamera.setPosition ? this._nonVRCamera.setPosition(this.camera.position) : this._nonVRCamera.position.copyFrom(this.camera.position)), this._setState(d9.NOT_IN_XR);
      }), this.sessionManager.onXRFrameObservable.addOnce(() => {
        this._setState(d9.IN_XR);
      }), this.sessionManager;
    } catch (f) {
      throw console.log(f), console.log(f.message), this._setState(d9.NOT_IN_XR), f;
    }
  }
  /**
   * Exits XR mode and returns the scene to its original state
   * @returns promise that resolves after xr mode has exited
   */
  exitXRAsync() {
    return this.state !== d9.IN_XR ? Promise.resolve() : (this._setState(d9.EXITING_XR), this.sessionManager.exitXRAsync());
  }
  /**
   * Enable spectator mode for desktop VR experiences.
   * When spectator mode is enabled a camera will be attached to the desktop canvas and will
   * display the first rig camera's view on the desktop canvas.
   * Please note that this will degrade performance, as it requires another camera render.
   * It is also not recommended to enable this in devices like the quest, as it brings no benefit there.
   * @param options giving WebXRSpectatorModeOption for specutator camera to setup when the spectator mode is enabled.
   */
  enableSpectatorMode(e) {
    this._spectatorMode || (this._spectatorMode = !0, this._switchSpectatorMode(e));
  }
  /**
   * Disable spectator mode for desktop VR experiences.
   */
  disableSpecatatorMode() {
    this._spectatorMode && (this._spectatorMode = !1, this._switchSpectatorMode());
  }
  _switchSpectatorMode(e) {
    const r = 1 / (e != null && e.fps ? e.fps : 1e3) * 1e3, n = e != null && e.preferredCameraIndex ? e == null ? void 0 : e.preferredCameraIndex : 0, i = () => {
      this._spectatorCamera && this.sessionManager.currentTimestamp - this._lastTimestamp >= r && (this._lastTimestamp = this.sessionManager.currentTimestamp, this._spectatorCamera.position.copyFrom(this.camera.rigCameras[n].globalPosition), this._spectatorCamera.rotationQuaternion.copyFrom(this.camera.rigCameras[n].absoluteRotation));
    };
    if (this._spectatorMode) {
      if (n >= this.camera.rigCameras.length)
        throw new Error("the preferred camera index is beyond the length of rig camera array.");
      const s = () => {
        this.state === d9.IN_XR ? (this._spectatorCamera = new bD("webxr-spectator", S.Zero(), this._scene), this._spectatorCamera.rotationQuaternion = new Ze(), this._scene.activeCameras = [this.camera, this._spectatorCamera], this.sessionManager.onXRFrameObservable.add(i), this._scene.onAfterRenderCameraObservable.add((a) => {
          a === this.camera && (this._scene.getEngine().framebufferDimensionsObject = null);
        })) : this.state === d9.EXITING_XR && (this.sessionManager.onXRFrameObservable.removeCallback(i), this._scene.activeCameras = null);
      };
      this.onStateChangedObservable.add(s), s();
    } else
      this.sessionManager.onXRFrameObservable.removeCallback(i), this._scene.activeCameras = [this.camera];
  }
  _nonXRToXRCamera() {
    this.camera.setTransformationFromNonVRCamera(this._nonVRCamera), this.onInitialXRPoseSetObservable.notifyObservers(this.camera);
  }
  _setState(e) {
    this.state !== e && (this.state = e, this.onStateChangedObservable.notifyObservers(this.state));
  }
}
class Jl {
  /**
   * Creates a new component for a motion controller.
   * It is created by the motion controller itself
   *
   * @param id the id of this component
   * @param type the type of the component
   * @param _buttonIndex index in the buttons array of the gamepad
   * @param _axesIndices indices of the values in the axes array of the gamepad
   */
  constructor(e, t, r = -1, n = []) {
    this.id = e, this.type = t, this._buttonIndex = r, this._axesIndices = n, this._axes = {
      x: 0,
      y: 0
    }, this._changes = {}, this._currentValue = 0, this._hasChanges = !1, this._pressed = !1, this._touched = !1, this.onAxisValueChangedObservable = new Oe(), this.onButtonStateChangedObservable = new Oe();
  }
  /**
   * The current axes data. If this component has no axes it will still return an object { x: 0, y: 0 }
   */
  get axes() {
    return this._axes;
  }
  /**
   * Get the changes. Elements will be populated only if they changed with their previous and current value
   */
  get changes() {
    return this._changes;
  }
  /**
   * Return whether or not the component changed the last frame
   */
  get hasChanges() {
    return this._hasChanges;
  }
  /**
   * is the button currently pressed
   */
  get pressed() {
    return this._pressed;
  }
  /**
   * is the button currently touched
   */
  get touched() {
    return this._touched;
  }
  /**
   * Get the current value of this component
   */
  get value() {
    return this._currentValue;
  }
  /**
   * Dispose this component
   */
  dispose() {
    this.onAxisValueChangedObservable.clear(), this.onButtonStateChangedObservable.clear();
  }
  /**
   * Are there axes correlating to this component
   * @returns true is axes data is available
   */
  isAxes() {
    return this._axesIndices.length !== 0;
  }
  /**
   * Is this component a button (hence - pressable)
   * @returns true if can be pressed
   */
  isButton() {
    return this._buttonIndex !== -1;
  }
  /**
   * update this component using the gamepad object it is in. Called on every frame
   * @param nativeController the native gamepad controller object
   */
  update(e) {
    let t = !1, r = !1;
    if (this._hasChanges = !1, this._changes = {}, this.isButton()) {
      const n = e.buttons[this._buttonIndex];
      if (!n)
        return;
      this._currentValue !== n.value && (this.changes.value = {
        current: n.value,
        previous: this._currentValue
      }, t = !0, this._currentValue = n.value), this._touched !== n.touched && (this.changes.touched = {
        current: n.touched,
        previous: this._touched
      }, t = !0, this._touched = n.touched), this._pressed !== n.pressed && (this.changes.pressed = {
        current: n.pressed,
        previous: this._pressed
      }, t = !0, this._pressed = n.pressed);
    }
    this.isAxes() && (this._axes.x !== e.axes[this._axesIndices[0]] && (this.changes.axes = {
      current: {
        x: e.axes[this._axesIndices[0]],
        y: this._axes.y
      },
      previous: {
        x: this._axes.x,
        y: this._axes.y
      }
    }, this._axes.x = e.axes[this._axesIndices[0]], r = !0), this._axes.y !== e.axes[this._axesIndices[1]] && (this.changes.axes ? this.changes.axes.current.y = e.axes[this._axesIndices[1]] : this.changes.axes = {
      current: {
        x: this._axes.x,
        y: e.axes[this._axesIndices[1]]
      },
      previous: {
        x: this._axes.x,
        y: this._axes.y
      }
    }, this._axes.y = e.axes[this._axesIndices[1]], r = !0)), t && (this._hasChanges = !0, this.onButtonStateChangedObservable.notifyObservers(this)), r && (this._hasChanges = !0, this.onAxisValueChangedObservable.notifyObservers(this._axes));
  }
}
Jl.BUTTON_TYPE = "button";
Jl.SQUEEZE_TYPE = "squeeze";
Jl.THUMBSTICK_TYPE = "thumbstick";
Jl.TOUCHPAD_TYPE = "touchpad";
Jl.TRIGGER_TYPE = "trigger";
class Um {
  /**
   * constructs a new abstract motion controller
   * @param scene the scene to which the model of the controller will be added
   * @param layout The profile layout to load
   * @param gamepadObject The gamepad object correlating to this controller
   * @param handedness handedness (left/right/none) of this controller
   * @param _doNotLoadControllerMesh set this flag to ignore the mesh loading
   * @param _controllerCache a cache holding controller models already loaded in this session
   */
  constructor(e, t, r, n, i = !1, s) {
    this.scene = e, this.layout = t, this.gamepadObject = r, this.handedness = n, this._doNotLoadControllerMesh = i, this._controllerCache = s, this._initComponent = (a) => {
      if (!a)
        return;
      const f = this.layout.components[a], o = f.type, d = f.gamepadIndices.button, v = [];
      f.gamepadIndices.xAxis !== void 0 && f.gamepadIndices.yAxis !== void 0 && v.push(f.gamepadIndices.xAxis, f.gamepadIndices.yAxis), this.components[a] = new Jl(a, o, d, v);
    }, this._modelReady = !1, this.components = {}, this.disableAnimation = !1, this.onModelLoadedObservable = new Oe(), t.components && Object.keys(t.components).forEach(this._initComponent);
  }
  /**
   * Dispose this controller, the model mesh and all its components
   */
  dispose() {
    this.getComponentIds().forEach((e) => this.getComponent(e).dispose()), this.rootMesh && (this.rootMesh.getChildren(void 0, !0).forEach((e) => {
      e.setEnabled(!1);
    }), this.rootMesh.dispose(!!this._controllerCache, !this._controllerCache));
  }
  /**
   * Returns all components of specific type
   * @param type the type to search for
   * @returns an array of components with this type
   */
  getAllComponentsOfType(e) {
    return this.getComponentIds().map((t) => this.components[t]).filter((t) => t.type === e);
  }
  /**
   * get a component based an its component id as defined in layout.components
   * @param id the id of the component
   * @returns the component correlates to the id or undefined if not found
   */
  getComponent(e) {
    return this.components[e];
  }
  /**
   * Get the list of components available in this motion controller
   * @returns an array of strings correlating to available components
   */
  getComponentIds() {
    return Object.keys(this.components);
  }
  /**
   * Get the first component of specific type
   * @param type type of component to find
   * @returns a controller component or null if not found
   */
  getComponentOfType(e) {
    return this.getAllComponentsOfType(e)[0] || null;
  }
  /**
   * Get the main (Select) component of this controller as defined in the layout
   * @returns the main component of this controller
   */
  getMainComponent() {
    return this.getComponent(this.layout.selectComponentId);
  }
  /**
   * Loads the model correlating to this controller
   * When the mesh is loaded, the onModelLoadedObservable will be triggered
   * @returns A promise fulfilled with the result of the model loading
   */
  async loadModel() {
    const e = !this._getModelLoadingConstraints();
    let t = this._getGenericFilenameAndPath();
    return e ? Se.Warn("Falling back to generic models") : t = this._getFilenameAndPath(), new Promise((r, n) => {
      const i = (s) => {
        e ? this._getGenericParentMesh(s) : this._setRootMesh(s), this._processLoadedModel(s), this._modelReady = !0, this.onModelLoadedObservable.notifyObservers(this), r(!0);
      };
      if (this._controllerCache) {
        const s = this._controllerCache.filter((a) => a.filename === t.filename && a.path === t.path);
        if (s[0]) {
          s[0].meshes.forEach((a) => a.setEnabled(!0)), i(s[0].meshes);
          return;
        }
      }
      Hn.ImportMesh("", t.path, t.filename, this.scene, (s) => {
        this._controllerCache && this._controllerCache.push(Object.assign(Object.assign({}, t), { meshes: s })), i(s);
      }, null, (s, a) => {
        Se.Log(a), Se.Warn(`Failed to retrieve controller model of type ${this.profileId} from the remote server: ${t.path}${t.filename}`), n(a);
      });
    });
  }
  /**
   * Update this model using the current XRFrame
   * @param xrFrame the current xr frame to use and update the model
   */
  updateFromXRFrame(e) {
    this.getComponentIds().forEach((t) => this.getComponent(t).update(this.gamepadObject)), this.updateModel(e);
  }
  /**
   * Backwards compatibility due to a deeply-integrated typo
   */
  get handness() {
    return this.handedness;
  }
  /**
   * Pulse (vibrate) this controller
   * If the controller does not support pulses, this function will fail silently and return Promise<false> directly after called
   * Consecutive calls to this function will cancel the last pulse call
   *
   * @param value the strength of the pulse in 0.0...1.0 range
   * @param duration Duration of the pulse in milliseconds
   * @param hapticActuatorIndex optional index of actuator (will usually be 0)
   * @returns a promise that will send true when the pulse has ended and false if the device doesn't support pulse or an error accrued
   */
  pulse(e, t, r = 0) {
    return this.gamepadObject.hapticActuators && this.gamepadObject.hapticActuators[r] ? this.gamepadObject.hapticActuators[r].pulse(e, t) : Promise.resolve(!1);
  }
  // Look through all children recursively. This will return null if no mesh exists with the given name.
  _getChildByName(e, t) {
    return e.getChildren((r) => r.name === t, !1)[0];
  }
  // Look through only immediate children. This will return null if no mesh exists with the given name.
  _getImmediateChildByName(e, t) {
    return e.getChildren((r) => r.name == t, !0)[0];
  }
  /**
   * Moves the axis on the controller mesh based on its current state
   * @param axisMap
   * @param axisValue the value of the axis which determines the meshes new position
   * @internal
   */
  _lerpTransform(e, t, r) {
    if (!e.minMesh || !e.maxMesh || !e.valueMesh || !e.minMesh.rotationQuaternion || !e.maxMesh.rotationQuaternion || !e.valueMesh.rotationQuaternion)
      return;
    const n = r ? t * 0.5 + 0.5 : t;
    Ze.SlerpToRef(e.minMesh.rotationQuaternion, e.maxMesh.rotationQuaternion, n, e.valueMesh.rotationQuaternion), S.LerpToRef(e.minMesh.position, e.maxMesh.position, n, e.valueMesh.position);
  }
  /**
   * Update the model itself with the current frame data
   * @param xrFrame the frame to use for updating the model mesh
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  updateModel(e) {
    this._modelReady && this._updateModel(e);
  }
  _getGenericFilenameAndPath() {
    return {
      filename: "generic.babylon",
      path: "https://controllers.babylonjs.com/generic/"
    };
  }
  _getGenericParentMesh(e) {
    this.rootMesh = new Ee(this.profileId + " " + this.handedness, this.scene), e.forEach((t) => {
      t.parent || (t.isPickable = !1, t.setParent(this.rootMesh));
    }), this.rootMesh.rotationQuaternion = Ze.FromEulerAngles(0, Math.PI, 0);
  }
}
class RS extends Um {
  constructor(e, t, r) {
    super(e, v3e[r], t, r), this.profileId = RS.ProfileId;
  }
  _getFilenameAndPath() {
    return {
      filename: "generic.babylon",
      path: "https://controllers.babylonjs.com/generic/"
    };
  }
  _getModelLoadingConstraints() {
    return !0;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _processLoadedModel(e) {
  }
  _setRootMesh(e) {
    this.rootMesh = new Ee(this.profileId + " " + this.handedness, this.scene), e.forEach((t) => {
      t.isPickable = !1, t.parent || t.setParent(this.rootMesh);
    }), this.rootMesh.rotationQuaternion = Ze.FromEulerAngles(0, Math.PI, 0);
  }
  _updateModel() {
  }
}
RS.ProfileId = "generic-trigger";
const v3e = {
  left: {
    selectComponentId: "xr-standard-trigger",
    components: {
      // eslint-disable-next-line @typescript-eslint/naming-convention
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr_standard_trigger",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "generic-trigger-left",
    assetPath: "left.glb"
  },
  right: {
    selectComponentId: "xr-standard-trigger",
    components: {
      // eslint-disable-next-line @typescript-eslint/naming-convention
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr_standard_trigger",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "generic-trigger-right",
    assetPath: "right.glb"
  },
  none: {
    selectComponentId: "xr-standard-trigger",
    components: {
      // eslint-disable-next-line @typescript-eslint/naming-convention
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr_standard_trigger",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "generic-trigger-none",
    assetPath: "none.glb"
  }
};
class Vte extends Um {
  constructor(e, t, r, n, i) {
    super(e, r.layouts[t.handedness || "none"], t.gamepad, t.handedness, void 0, i), this._repositoryUrl = n, this.controllerCache = i, this._buttonMeshMapping = {}, this._touchDots = {}, this.profileId = r.profileId;
  }
  dispose() {
    super.dispose(), this.controllerCache || Object.keys(this._touchDots).forEach((e) => {
      this._touchDots[e].dispose();
    });
  }
  _getFilenameAndPath() {
    return {
      filename: this.layout.assetPath,
      path: `${this._repositoryUrl}/profiles/${this.profileId}/`
    };
  }
  _getModelLoadingConstraints() {
    const e = Hn.IsPluginForExtensionAvailable(".glb");
    return e || Se.Warn("glTF / glb loader was not registered, using generic controller instead"), e;
  }
  _processLoadedModel(e) {
    this.getComponentIds().forEach((t) => {
      const r = this.layout.components[t];
      this._buttonMeshMapping[t] = {
        mainMesh: this._getChildByName(this.rootMesh, r.rootNodeName),
        states: {}
      }, Object.keys(r.visualResponses).forEach((n) => {
        const i = r.visualResponses[n];
        if (i.valueNodeProperty === "transform")
          this._buttonMeshMapping[t].states[n] = {
            valueMesh: this._getChildByName(this.rootMesh, i.valueNodeName),
            minMesh: this._getChildByName(this.rootMesh, i.minNodeName),
            maxMesh: this._getChildByName(this.rootMesh, i.maxNodeName)
          };
        else {
          const s = r.type === Jl.TOUCHPAD_TYPE && r.touchPointNodeName ? r.touchPointNodeName : i.valueNodeName;
          if (this._buttonMeshMapping[t].states[n] = {
            valueMesh: this._getChildByName(this.rootMesh, s)
          }, r.type === Jl.TOUCHPAD_TYPE && !this._touchDots[n]) {
            const a = UA(n + "dot", {
              diameter: 15e-4,
              segments: 8
            }, this.scene);
            a.material = new Wt(n + "mat", this.scene), a.material.diffuseColor = Ne.Red(), a.parent = this._buttonMeshMapping[t].states[n].valueMesh || null, a.isVisible = !1, this._touchDots[n] = a;
          }
        }
      });
    });
  }
  _setRootMesh(e) {
    this.rootMesh = new Ee(this.profileId + "-" + this.handedness, this.scene), this.rootMesh.isPickable = !1;
    let t;
    for (let r = 0; r < e.length; r++) {
      const n = e[r];
      n.isPickable = !1, n.parent || (t = n);
    }
    t && t.setParent(this.rootMesh), this.scene.useRightHandedSystem || this.rootMesh.rotate(bf.Y, Math.PI, ai.WORLD);
  }
  _updateModel(e) {
    this.disableAnimation || this.getComponentIds().forEach((t) => {
      const r = this.getComponent(t);
      if (!r.hasChanges)
        return;
      const n = this._buttonMeshMapping[t], i = this.layout.components[t];
      Object.keys(i.visualResponses).forEach((s) => {
        const a = i.visualResponses[s];
        let f = r.value;
        if (a.componentProperty === "xAxis" ? f = r.axes.x : a.componentProperty === "yAxis" && (f = r.axes.y), a.valueNodeProperty === "transform")
          this._lerpTransform(n.states[s], f, a.componentProperty !== "button");
        else {
          const o = n.states[s].valueMesh;
          o && (o.isVisible = r.touched || r.pressed), this._touchDots[s] && (this._touchDots[s].isVisible = r.touched || r.pressed);
        }
      });
    });
  }
}
const SE = [];
class E9 {
  /**
   * Clear the cache used for profile loading and reload when requested again
   */
  static ClearProfilesCache() {
    this._ProfilesList = null, this._ProfileLoadingPromises = {};
  }
  /**
   * Register the default fallbacks.
   * This function is called automatically when this file is imported.
   */
  static DefaultFallbacks() {
    this.RegisterFallbacksForProfileId("google-daydream", ["generic-touchpad"]), this.RegisterFallbacksForProfileId("htc-vive-focus", ["generic-trigger-touchpad"]), this.RegisterFallbacksForProfileId("htc-vive", ["generic-trigger-squeeze-touchpad"]), this.RegisterFallbacksForProfileId("magicleap-one", ["generic-trigger-squeeze-touchpad"]), this.RegisterFallbacksForProfileId("windows-mixed-reality", ["generic-trigger-squeeze-touchpad-thumbstick"]), this.RegisterFallbacksForProfileId("microsoft-mixed-reality", ["windows-mixed-reality", "generic-trigger-squeeze-touchpad-thumbstick"]), this.RegisterFallbacksForProfileId("oculus-go", ["generic-trigger-touchpad"]), this.RegisterFallbacksForProfileId("oculus-touch-v2", ["oculus-touch", "generic-trigger-squeeze-thumbstick"]), this.RegisterFallbacksForProfileId("oculus-touch", ["generic-trigger-squeeze-thumbstick"]), this.RegisterFallbacksForProfileId("samsung-gearvr", ["windows-mixed-reality", "generic-trigger-squeeze-touchpad-thumbstick"]), this.RegisterFallbacksForProfileId("samsung-odyssey", ["generic-touchpad"]), this.RegisterFallbacksForProfileId("valve-index", ["generic-trigger-squeeze-touchpad-thumbstick"]), this.RegisterFallbacksForProfileId("generic-hand-select", ["generic-trigger"]);
  }
  /**
   * Find a fallback profile if the profile was not found. There are a few predefined generic profiles.
   * @param profileId the profile to which a fallback needs to be found
   * @returns an array with corresponding fallback profiles
   */
  static FindFallbackWithProfileId(e) {
    const t = this._Fallbacks[e] || [];
    return t.unshift(e), t;
  }
  /**
   * When acquiring a new xrInput object (usually by the WebXRInput class), match it with the correct profile.
   * The order of search:
   *
   * 1) Iterate the profiles array of the xr input and try finding a corresponding motion controller
   * 2) (If not found) search in the gamepad id and try using it (legacy versions only)
   * 3) search for registered fallbacks (should be redundant, nonetheless it makes sense to check)
   * 4) return the generic trigger controller if none were found
   *
   * @param xrInput the xrInput to which a new controller is initialized
   * @param scene the scene to which the model will be added
   * @param forceProfile force a certain profile for this controller
   * @returns A promise that fulfils with the motion controller class for this profile id or the generic standard class if none was found
   */
  static GetMotionControllerWithXRInput(e, t, r) {
    const n = [];
    if (r && n.push(r), n.push(...e.profiles || []), n.length && !n[0] && n.pop(), e.gamepad && e.gamepad.id)
      switch (e.gamepad.id) {
        case (e.gamepad.id.match(/oculus touch/gi) ? e.gamepad.id : void 0):
          n.push("oculus-touch-v2");
          break;
      }
    const i = n.indexOf("windows-mixed-reality");
    if (i !== -1 && n.splice(i, 0, "microsoft-mixed-reality"), n.length || n.push("generic-trigger"), this.UseOnlineRepository) {
      const s = this.PrioritizeOnlineRepository ? this._LoadProfileFromRepository : this._LoadProfilesFromAvailableControllers, a = this.PrioritizeOnlineRepository ? this._LoadProfilesFromAvailableControllers : this._LoadProfileFromRepository;
      return s.call(this, n, e, t).catch(() => a.call(this, n, e, t));
    } else
      return this._LoadProfilesFromAvailableControllers(n, e, t);
  }
  /**
   * Register a new controller based on its profile. This function will be called by the controller classes themselves.
   *
   * If you are missing a profile, make sure it is imported in your source, otherwise it will not register.
   *
   * @param type the profile type to register
   * @param constructFunction the function to be called when loading this profile
   */
  static RegisterController(e, t) {
    this._AvailableControllers[e] = t;
  }
  /**
   * Register a fallback to a specific profile.
   * @param profileId the profileId that will receive the fallbacks
   * @param fallbacks A list of fallback profiles
   */
  static RegisterFallbacksForProfileId(e, t) {
    this._Fallbacks[e] ? this._Fallbacks[e].push(...t) : this._Fallbacks[e] = t;
  }
  /**
   * Will update the list of profiles available in the repository
   * @returns a promise that resolves to a map of profiles available online
   */
  static UpdateProfilesList() {
    return this._ProfilesList = ye.LoadFileAsync(this.BaseRepositoryUrl + "/profiles/profilesList.json", !1).then((e) => JSON.parse(e.toString())), this._ProfilesList;
  }
  /**
   * Clear the controller's cache (usually happens at the end of a session)
   */
  static ClearControllerCache() {
    SE.forEach((e) => {
      e.meshes.forEach((t) => {
        t.dispose(!1, !0);
      });
    }), SE.length = 0;
  }
  static _LoadProfileFromRepository(e, t, r) {
    return Promise.resolve().then(() => this._ProfilesList ? this._ProfilesList : this.UpdateProfilesList()).then((n) => {
      for (let i = 0; i < e.length; ++i)
        if (e[i] && n[e[i]])
          return e[i];
      throw new Error(`neither controller ${e[0]} nor all fallbacks were found in the repository,`);
    }).then((n) => (this._ProfileLoadingPromises[n] || (this._ProfileLoadingPromises[n] = ye.LoadFileAsync(`${this.BaseRepositoryUrl}/profiles/${n}/profile.json`, !1).then((i) => JSON.parse(i))), this._ProfileLoadingPromises[n])).then((n) => new Vte(r, t, n, this.BaseRepositoryUrl, this.DisableControllerCache ? void 0 : SE));
  }
  static _LoadProfilesFromAvailableControllers(e, t, r) {
    for (let n = 0; n < e.length; ++n) {
      if (!e[n])
        continue;
      const i = this.FindFallbackWithProfileId(e[n]);
      for (let s = 0; s < i.length; ++s) {
        const a = this._AvailableControllers[i[s]];
        if (a)
          return Promise.resolve(a(t, r));
      }
    }
    throw new Error("no controller requested was found in the available controllers list");
  }
}
E9._AvailableControllers = {};
E9._Fallbacks = {};
E9._ProfileLoadingPromises = {};
E9.BaseRepositoryUrl = "https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist";
E9.PrioritizeOnlineRepository = !0;
E9.UseOnlineRepository = !0;
E9.DisableControllerCache = !0;
E9.RegisterController(RS.ProfileId, (A, e) => new RS(e, A.gamepad, A.handedness));
E9.DefaultFallbacks();
let u3e = 0;
class Cte {
  /**
   * Creates the input source object
   * @see https://doc.babylonjs.com/features/featuresDeepDive/webXR/webXRInputControllerSupport
   * @param _scene the scene which the controller should be associated to
   * @param inputSource the underlying input source for the controller
   * @param _options options for this controller creation
   */
  constructor(e, t, r = {}) {
    this._scene = e, this.inputSource = t, this._options = r, this._tmpVector = new S(), this._disposed = !1, this.onDisposeObservable = new Oe(), this.onMeshLoadedObservable = new Oe(), this.onMotionControllerInitObservable = new Oe(), this._uniqueId = `controller-${u3e++}-${t.targetRayMode}-${t.handedness}`, this.pointer = new jn(`${this._uniqueId}-pointer`, e), this.pointer.rotationQuaternion = new Ze(), this.inputSource.gripSpace && (this.grip = new jn(`${this._uniqueId}-grip`, this._scene), this.grip.rotationQuaternion = new Ze()), this._tmpVector.set(0, 0, this._scene.useRightHandedSystem ? -1 : 1), this.inputSource.gamepad && this.inputSource.targetRayMode === "tracked-pointer" && E9.GetMotionControllerWithXRInput(t, e, this._options.forceControllerProfile).then((n) => {
      this.motionController = n, this.onMotionControllerInitObservable.notifyObservers(n), !this._options.doNotLoadControllerMesh && !this.motionController._doNotLoadControllerMesh && this.motionController.loadModel().then((i) => {
        var s;
        i && this.motionController && this.motionController.rootMesh && (this._options.renderingGroupId && (this.motionController.rootMesh.renderingGroupId = this._options.renderingGroupId, this.motionController.rootMesh.getChildMeshes(!1).forEach((a) => a.renderingGroupId = this._options.renderingGroupId)), this.onMeshLoadedObservable.notifyObservers(this.motionController.rootMesh), this.motionController.rootMesh.parent = this.grip || this.pointer, this.motionController.disableAnimation = !!this._options.disableMotionControllerAnimation), this._disposed && ((s = this.motionController) === null || s === void 0 || s.dispose());
      });
    }, () => {
      ye.Warn("Could not find a matching motion controller for the registered input source");
    });
  }
  /**
   * Get this controllers unique id
   */
  get uniqueId() {
    return this._uniqueId;
  }
  /**
   * Disposes of the object
   */
  dispose() {
    this.grip && this.grip.dispose(!0), this.motionController && this.motionController.dispose(), this.pointer.dispose(!0), this.onMotionControllerInitObservable.clear(), this.onMeshLoadedObservable.clear(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this._disposed = !0;
  }
  /**
   * Gets a world space ray coming from the pointer or grip
   * @param result the resulting ray
   * @param gripIfAvailable use the grip mesh instead of the pointer, if available
   */
  getWorldPointerRayToRef(e, t = !1) {
    const r = t && this.grip ? this.grip : this.pointer;
    S.TransformNormalToRef(this._tmpVector, r.getWorldMatrix(), e.direction), e.direction.normalize(), e.origin.copyFrom(r.absolutePosition), e.length = 1e3;
  }
  /**
   * Updates the controller pose based on the given XRFrame
   * @param xrFrame xr frame to update the pose with
   * @param referenceSpace reference space to use
   * @param xrCamera the xr camera, used for parenting
   */
  updateFromXRFrame(e, t, r) {
    const n = e.getPose(this.inputSource.targetRaySpace, t);
    if (this._lastXRPose = n, n) {
      const i = n.transform.position;
      this.pointer.position.set(i.x, i.y, i.z);
      const s = n.transform.orientation;
      this.pointer.rotationQuaternion.set(s.x, s.y, s.z, s.w), this._scene.useRightHandedSystem || (this.pointer.position.z *= -1, this.pointer.rotationQuaternion.z *= -1, this.pointer.rotationQuaternion.w *= -1), this.pointer.parent = r.parent;
    }
    if (this.inputSource.gripSpace && this.grip) {
      const i = e.getPose(this.inputSource.gripSpace, t);
      if (i) {
        const s = i.transform.position, a = i.transform.orientation;
        this.grip.position.set(s.x, s.y, s.z), this.grip.rotationQuaternion.set(a.x, a.y, a.z, a.w), this._scene.useRightHandedSystem || (this.grip.position.z *= -1, this.grip.rotationQuaternion.z *= -1, this.grip.rotationQuaternion.w *= -1);
      }
      this.grip.parent = r.parent;
    }
    this.motionController && this.motionController.updateFromXRFrame(e);
  }
}
class Ote {
  /**
   * Initializes the WebXRInput
   * @param xrSessionManager the xr session manager for this session
   * @param xrCamera the WebXR camera for this session. Mainly used for teleportation
   * @param _options = initialization options for this xr input
   */
  constructor(e, t, r = {}) {
    if (this.xrSessionManager = e, this.xrCamera = t, this._options = r, this.controllers = [], this.onControllerAddedObservable = new Oe(), this.onControllerRemovedObservable = new Oe(), this._onInputSourcesChange = (n) => {
      this._addAndRemoveControllers(n.added, n.removed);
    }, this._sessionEndedObserver = this.xrSessionManager.onXRSessionEnded.add(() => {
      this._addAndRemoveControllers([], this.controllers.map((n) => n.inputSource));
    }), this._sessionInitObserver = this.xrSessionManager.onXRSessionInit.add((n) => {
      n.addEventListener("inputsourceschange", this._onInputSourcesChange);
    }), this._frameObserver = this.xrSessionManager.onXRFrameObservable.add((n) => {
      this.controllers.forEach((i) => {
        i.updateFromXRFrame(n, this.xrSessionManager.referenceSpace, this.xrCamera);
      });
    }), this._options.customControllersRepositoryURL && (E9.BaseRepositoryUrl = this._options.customControllersRepositoryURL), E9.UseOnlineRepository = !this._options.disableOnlineControllerRepository, E9.UseOnlineRepository)
      try {
        E9.UpdateProfilesList().catch(() => {
          E9.UseOnlineRepository = !1;
        });
      } catch {
        E9.UseOnlineRepository = !1;
      }
  }
  _addAndRemoveControllers(e, t) {
    const r = this.controllers.map((s) => s.inputSource);
    for (const s of e)
      if (r.indexOf(s) === -1) {
        const a = new Cte(this.xrSessionManager.scene, s, Object.assign(Object.assign({}, this._options.controllerOptions || {}), { forceControllerProfile: this._options.forceInputProfile, doNotLoadControllerMesh: this._options.doNotLoadControllerMeshes, disableMotionControllerAnimation: this._options.disableControllerAnimation }));
        this.controllers.push(a), this.onControllerAddedObservable.notifyObservers(a);
      }
    const n = [], i = [];
    this.controllers.forEach((s) => {
      t.indexOf(s.inputSource) === -1 ? n.push(s) : i.push(s);
    }), this.controllers = n, i.forEach((s) => {
      this.onControllerRemovedObservable.notifyObservers(s), s.dispose();
    });
  }
  /**
   * Disposes of the object
   */
  dispose() {
    this.controllers.forEach((e) => {
      e.dispose();
    }), this.xrSessionManager.onXRFrameObservable.remove(this._frameObserver), this.xrSessionManager.onXRSessionInit.remove(this._sessionInitObserver), this.xrSessionManager.onXRSessionEnded.remove(this._sessionEndedObserver), this.onControllerAddedObservable.clear(), this.onControllerRemovedObservable.clear(), E9.ClearControllerCache();
  }
}
class ig extends L9 {
  /**
   * constructs a new background remover module
   * @param _xrSessionManager the session manager for this module
   * @param _options read-only options to be used in this module
   */
  constructor(e, t) {
    super(e), this._options = t, this._attachController = (r) => {
      if (this._controllers[r.uniqueId])
        return;
      const { laserPointer: n, selectionMesh: i } = this._generateNewMeshPair(r.pointer);
      switch (this._controllers[r.uniqueId] = {
        xrController: r,
        laserPointer: n,
        selectionMesh: i,
        meshUnderPointer: null,
        pick: null,
        tmpRay: new Hi(new S(), new S()),
        disabledByNearInteraction: !1,
        id: ig._IdCounter++
      }, this._attachedController ? !this._options.enablePointerSelectionOnAllControllers && this._options.preferredHandedness && r.inputSource.handedness === this._options.preferredHandedness && (this._attachedController = r.uniqueId) : this._options.enablePointerSelectionOnAllControllers || (this._attachedController = r.uniqueId), r.inputSource.targetRayMode) {
        case "tracked-pointer":
          return this._attachTrackedPointerRayMode(r);
        case "gaze":
          return this._attachGazeMode(r);
        case "screen":
          return this._attachScreenRayMode(r);
      }
    }, this._controllers = {}, this._tmpVectorForPickCompare = new S(), this.disablePointerLighting = !0, this.disableSelectionMeshLighting = !0, this.displayLaserPointer = !0, this.displaySelectionMesh = !0, this.laserPointerPickedColor = new Ne(0.9, 0.9, 0.9), this.laserPointerDefaultColor = new Ne(0.7, 0.7, 0.7), this.selectionMeshDefaultColor = new Ne(0.8, 0.8, 0.8), this.selectionMeshPickedColor = new Ne(0.3, 0.3, 1), this._identityMatrix = he.Identity(), this._screenCoordinatesRef = S.Zero(), this._viewportRef = new WA(0, 0, 0, 0), this._scene = this._xrSessionManager.scene;
  }
  /**
   * attach this feature
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  attach() {
    if (!super.attach())
      return !1;
    if (this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (e) => {
      this._detachController(e.uniqueId);
    }), this._scene.constantlyUpdateMeshUnderPointer = !0, this._options.gazeCamera) {
      const e = this._options.gazeCamera, { laserPointer: t, selectionMesh: r } = this._generateNewMeshPair(e);
      this._controllers.camera = {
        webXRCamera: e,
        laserPointer: t,
        selectionMesh: r,
        meshUnderPointer: null,
        pick: null,
        tmpRay: new Hi(new S(), new S()),
        disabledByNearInteraction: !1,
        id: ig._IdCounter++
      }, this._attachGazeMode();
    }
    return !0;
  }
  /**
   * detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    return super.detach() ? (Object.keys(this._controllers).forEach((e) => {
      this._detachController(e);
    }), !0) : !1;
  }
  /**
   * Will get the mesh under a specific pointer.
   * `scene.meshUnderPointer` will only return one mesh - either left or right.
   * @param controllerId the controllerId to check
   * @returns The mesh under pointer or null if no mesh is under the pointer
   */
  getMeshUnderPointer(e) {
    return this._controllers[e] ? this._controllers[e].meshUnderPointer : null;
  }
  /**
   * Get the xr controller that correlates to the pointer id in the pointer event
   *
   * @param id the pointer id to search for
   * @returns the controller that correlates to this id or null if not found
   */
  getXRControllerByPointerId(e) {
    const t = Object.keys(this._controllers);
    for (let r = 0; r < t.length; ++r)
      if (this._controllers[t[r]].id === e)
        return this._controllers[t[r]].xrController || null;
    return null;
  }
  /**
   * @internal
   */
  _getPointerSelectionDisabledByPointerId(e) {
    const t = Object.keys(this._controllers);
    for (let r = 0; r < t.length; ++r)
      if (this._controllers[t[r]].id === e)
        return this._controllers[t[r]].disabledByNearInteraction;
    return !0;
  }
  /**
   * @internal
   */
  _setPointerSelectionDisabledByPointerId(e, t) {
    const r = Object.keys(this._controllers);
    for (let n = 0; n < r.length; ++n)
      if (this._controllers[r[n]].id === e) {
        this._controllers[r[n]].disabledByNearInteraction = t;
        return;
      }
  }
  _onXRFrame(e) {
    Object.keys(this._controllers).forEach((t) => {
      const r = this._controllers[t];
      if (!this._options.enablePointerSelectionOnAllControllers && t !== this._attachedController || r.disabledByNearInteraction) {
        r.selectionMesh.isVisible = !1, r.laserPointer.isVisible = !1, r.pick = null;
        return;
      }
      r.laserPointer.isVisible = this.displayLaserPointer;
      let n;
      if (r.xrController)
        n = r.xrController.pointer.position, r.xrController.getWorldPointerRayToRef(r.tmpRay);
      else if (r.webXRCamera)
        n = r.webXRCamera.position, r.webXRCamera.getForwardRayToRef(r.tmpRay);
      else
        return;
      if (this._options.maxPointerDistance && (r.tmpRay.length = this._options.maxPointerDistance), !this._options.disableScenePointerVectorUpdate && n) {
        const f = this._xrSessionManager.scene, o = this._options.xrInput.xrCamera;
        o && (o.viewport.toGlobalToRef(f.getEngine().getRenderWidth(), f.getEngine().getRenderHeight(), this._viewportRef), S.ProjectToRef(n, this._identityMatrix, f.getTransformMatrix(), this._viewportRef, this._screenCoordinatesRef), typeof this._screenCoordinatesRef.x == "number" && typeof this._screenCoordinatesRef.y == "number" && !isNaN(this._screenCoordinatesRef.x) && !isNaN(this._screenCoordinatesRef.y) && (f.pointerX = this._screenCoordinatesRef.x, f.pointerY = this._screenCoordinatesRef.y, r.screenCoordinates = {
          x: this._screenCoordinatesRef.x,
          y: this._screenCoordinatesRef.y
        }));
      }
      let i = null;
      this._utilityLayerScene && (i = this._utilityLayerScene.pickWithRay(r.tmpRay, this._utilityLayerScene.pointerMovePredicate || this.raySelectionPredicate));
      const s = this._scene.pickWithRay(r.tmpRay, this._scene.pointerMovePredicate || this.raySelectionPredicate);
      !i || !i.hit ? r.pick = s : !s || !s.hit || i.distance < s.distance ? r.pick = i : r.pick = s, r.pick && r.xrController && (r.pick.aimTransform = r.xrController.pointer, r.pick.gripTransform = r.xrController.grip || null);
      const a = r.pick;
      if (a && a.pickedPoint && a.hit) {
        this._updatePointerDistance(r.laserPointer, a.distance), r.selectionMesh.position.copyFrom(a.pickedPoint), r.selectionMesh.scaling.x = Math.sqrt(a.distance), r.selectionMesh.scaling.y = Math.sqrt(a.distance), r.selectionMesh.scaling.z = Math.sqrt(a.distance);
        const f = this._convertNormalToDirectionOfRay(a.getNormal(!0), r.tmpRay), o = 1e-3;
        if (r.selectionMesh.position.copyFrom(a.pickedPoint), f) {
          const d = S.Cross(bf.Y, f), v = S.Cross(f, d);
          S.RotationFromAxisToRef(v, f, d, r.selectionMesh.rotation), r.selectionMesh.position.addInPlace(f.scale(o));
        }
        r.selectionMesh.isVisible = this.displaySelectionMesh, r.meshUnderPointer = a.pickedMesh;
      } else
        r.selectionMesh.isVisible = !1, this._updatePointerDistance(r.laserPointer, 1), r.meshUnderPointer = null;
    });
  }
  get _utilityLayerScene() {
    return this._options.customUtilityLayerScene || Ds.DefaultUtilityLayer.utilityLayerScene;
  }
  _attachGazeMode(e) {
    const t = this._controllers[e && e.uniqueId || "camera"], r = this._options.timeToSelect || 3e3, n = this._options.useUtilityLayer ? this._utilityLayerScene : this._scene;
    let i = new F9();
    const s = Ag("selection", {
      diameter: 35e-4 * 15,
      thickness: 25e-4 * 6,
      tessellation: 20
    }, n);
    s.isVisible = !1, s.isPickable = !1, s.parent = t.selectionMesh;
    let a = 0, f = !1;
    const o = {
      pointerId: t.id,
      pointerType: "xr"
    };
    t.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {
      if (t.pick) {
        if (this._augmentPointerInit(o, t.id, t.screenCoordinates), t.laserPointer.material.alpha = 0, s.isVisible = !1, t.pick.hit)
          if (this._pickingMoved(i, t.pick))
            f && (this._options.disablePointerUpOnTouchOut || this._scene.simulatePointerUp(t.pick, o)), f = !1, a = 0;
          else if (a > r / 10 && (s.isVisible = !0), a += this._scene.getEngine().getDeltaTime(), a >= r)
            this._scene.simulatePointerDown(t.pick, o), f = !0, this._options.disablePointerUpOnTouchOut && this._scene.simulatePointerUp(t.pick, o), s.isVisible = !1;
          else {
            const d = 1 - a / r;
            s.scaling.set(d, d, d);
          }
        else
          f = !1, a = 0;
        this._scene.simulatePointerMove(t.pick, o), i = t.pick;
      }
    }), this._options.renderingGroupId !== void 0 && (s.renderingGroupId = this._options.renderingGroupId), e && e.onDisposeObservable.addOnce(() => {
      t.pick && !this._options.disablePointerUpOnTouchOut && f && (this._scene.simulatePointerUp(t.pick, o), t.finalPointerUpTriggered = !0), s.dispose();
    });
  }
  _attachScreenRayMode(e) {
    const t = this._controllers[e.uniqueId];
    let r = !1;
    const n = {
      pointerId: t.id,
      pointerType: "xr"
    };
    t.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {
      this._augmentPointerInit(n, t.id, t.screenCoordinates), !(!t.pick || this._options.disablePointerUpOnTouchOut && r) && (r ? this._scene.simulatePointerMove(t.pick, n) : (this._scene.simulatePointerDown(t.pick, n), t.pointerDownTriggered = !0, r = !0, this._options.disablePointerUpOnTouchOut && this._scene.simulatePointerUp(t.pick, n)));
    }), e.onDisposeObservable.addOnce(() => {
      this._augmentPointerInit(n, t.id, t.screenCoordinates), this._xrSessionManager.runInXRFrame(() => {
        t.pick && !t.finalPointerUpTriggered && r && !this._options.disablePointerUpOnTouchOut && (this._scene.simulatePointerUp(t.pick, n), t.finalPointerUpTriggered = !0);
      });
    });
  }
  _attachTrackedPointerRayMode(e) {
    const t = this._controllers[e.uniqueId];
    if (this._options.forceGazeMode)
      return this._attachGazeMode(e);
    const r = {
      pointerId: t.id,
      pointerType: "xr"
    };
    if (t.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {
      t.laserPointer.material.disableLighting = this.disablePointerLighting, t.selectionMesh.material.disableLighting = this.disableSelectionMeshLighting, t.pick && (this._augmentPointerInit(r, t.id, t.screenCoordinates), this._scene.simulatePointerMove(t.pick, r));
    }), e.inputSource.gamepad) {
      const n = (i) => {
        this._options.overrideButtonId && (t.selectionComponent = i.getComponent(this._options.overrideButtonId)), t.selectionComponent || (t.selectionComponent = i.getMainComponent()), t.onButtonChangedObserver = t.selectionComponent.onButtonStateChangedObservable.add((s) => {
          if (s.changes.pressed) {
            const a = s.changes.pressed.current;
            t.pick ? (this._options.enablePointerSelectionOnAllControllers || e.uniqueId === this._attachedController) && (this._augmentPointerInit(r, t.id, t.screenCoordinates), a ? (this._scene.simulatePointerDown(t.pick, r), t.pointerDownTriggered = !0, t.selectionMesh.material.emissiveColor = this.selectionMeshPickedColor, t.laserPointer.material.emissiveColor = this.laserPointerPickedColor) : (this._scene.simulatePointerUp(t.pick, r), t.selectionMesh.material.emissiveColor = this.selectionMeshDefaultColor, t.laserPointer.material.emissiveColor = this.laserPointerDefaultColor)) : a && !this._options.enablePointerSelectionOnAllControllers && !this._options.disableSwitchOnClick && (this._attachedController = e.uniqueId);
          }
        });
      };
      e.motionController ? n(e.motionController) : e.onMotionControllerInitObservable.add(n);
    } else {
      const n = (s) => {
        this._augmentPointerInit(r, t.id, t.screenCoordinates), t.xrController && s.inputSource === t.xrController.inputSource && t.pick && (this._scene.simulatePointerDown(t.pick, r), t.pointerDownTriggered = !0, t.selectionMesh.material.emissiveColor = this.selectionMeshPickedColor, t.laserPointer.material.emissiveColor = this.laserPointerPickedColor);
      }, i = (s) => {
        this._augmentPointerInit(r, t.id, t.screenCoordinates), t.xrController && s.inputSource === t.xrController.inputSource && t.pick && (this._scene.simulatePointerUp(t.pick, r), t.selectionMesh.material.emissiveColor = this.selectionMeshDefaultColor, t.laserPointer.material.emissiveColor = this.laserPointerDefaultColor);
      };
      t.eventListeners = {
        selectend: i,
        selectstart: n
      }, this._xrSessionManager.session.addEventListener("selectstart", n), this._xrSessionManager.session.addEventListener("selectend", i);
    }
  }
  _convertNormalToDirectionOfRay(e, t) {
    return e && Math.acos(S.Dot(e, t.direction)) < Math.PI / 2 && e.scaleInPlace(-1), e;
  }
  _detachController(e) {
    const t = this._controllers[e];
    if (t) {
      if (t.selectionComponent && t.onButtonChangedObserver && t.selectionComponent.onButtonStateChangedObservable.remove(t.onButtonChangedObserver), t.onFrameObserver && this._xrSessionManager.onXRFrameObservable.remove(t.onFrameObserver), t.eventListeners && Object.keys(t.eventListeners).forEach((r) => {
        const n = t.eventListeners && t.eventListeners[r];
        n && this._xrSessionManager.session.removeEventListener(r, n);
      }), !t.finalPointerUpTriggered && t.pointerDownTriggered) {
        const r = {
          pointerId: t.id,
          pointerType: "xr"
        };
        this._xrSessionManager.runInXRFrame(() => {
          this._augmentPointerInit(r, t.id, t.screenCoordinates), this._scene.simulatePointerUp(t.pick || new F9(), r), t.finalPointerUpTriggered = !0;
        });
      }
      this._xrSessionManager.scene.onBeforeRenderObservable.addOnce(() => {
        try {
          if (t.selectionMesh.dispose(), t.laserPointer.dispose(), delete this._controllers[e], this._attachedController === e) {
            const r = Object.keys(this._controllers);
            r.length ? this._attachedController = r[0] : this._attachedController = "";
          }
        } catch {
          ye.Warn("controller already detached.");
        }
      });
    }
  }
  _generateNewMeshPair(e) {
    const t = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Ds.DefaultUtilityLayer.utilityLayerScene : this._scene, r = this._options.customLasterPointerMeshGenerator ? this._options.customLasterPointerMeshGenerator() : Ld("laserPointer", {
      height: 1,
      diameterTop: 2e-4,
      diameterBottom: 4e-3,
      tessellation: 20,
      subdivisions: 1
    }, t);
    r.parent = e;
    const n = new Wt("laserPointerMat", t);
    n.emissiveColor = this.laserPointerDefaultColor, n.alpha = 0.7, r.material = n, r.rotation.x = Math.PI / 2, this._updatePointerDistance(r, 1), r.isPickable = !1, r.isVisible = !1;
    const i = this._options.customSelectionMeshGenerator ? this._options.customSelectionMeshGenerator() : Ag("gazeTracker", {
      diameter: 35e-4 * 3,
      thickness: 25e-4 * 3,
      tessellation: 20
    }, t);
    i.bakeCurrentTransformIntoVertices(), i.isPickable = !1, i.isVisible = !1;
    const s = new Wt("targetMat", t);
    return s.specularColor = Ne.Black(), s.emissiveColor = this.selectionMeshDefaultColor, s.backFaceCulling = !1, i.material = s, this._options.renderingGroupId !== void 0 && (r.renderingGroupId = this._options.renderingGroupId, i.renderingGroupId = this._options.renderingGroupId), {
      laserPointer: r,
      selectionMesh: i
    };
  }
  _pickingMoved(e, t) {
    var r;
    if (!e.hit || !t.hit || !e.pickedMesh || !e.pickedPoint || !t.pickedMesh || !t.pickedPoint || e.pickedMesh !== t.pickedMesh)
      return !0;
    (r = e.pickedPoint) === null || r === void 0 || r.subtractToRef(t.pickedPoint, this._tmpVectorForPickCompare), this._tmpVectorForPickCompare.set(Math.abs(this._tmpVectorForPickCompare.x), Math.abs(this._tmpVectorForPickCompare.y), Math.abs(this._tmpVectorForPickCompare.z));
    const n = (this._options.gazeModePointerMovedFactor || 1) * 0.01 * t.distance;
    return this._tmpVectorForPickCompare.length() > n;
  }
  _updatePointerDistance(e, t = 100) {
    e.scaling.y = t, this._scene.useRightHandedSystem && (t *= -1), e.position.z = t / 2 + 0.05;
  }
  _augmentPointerInit(e, t, r) {
    e.pointerId = t, e.pointerType = "xr", r && (e.screenX = r.x, e.screenY = r.y);
  }
  /** @internal */
  get lasterPointerDefaultColor() {
    return this.laserPointerDefaultColor;
  }
}
ig._IdCounter = 200;
ig.Name = Gi.POINTER_SELECTION;
ig.Version = 1;
So.AddWebXRFeature(ig.Name, (A, e) => () => new ig(A, e), ig.Version, !0);
rA.prototype._projectOnTrianglesToRef = function(A, e, t, r, n, i) {
  const s = ue.Vector3[0], a = ue.Vector3[1];
  let f = 1 / 0;
  for (let o = this.indexStart; o < this.indexStart + this.indexCount - (3 - r); o += r) {
    const d = t[o], v = t[o + 1], u = t[o + 2];
    if (n && u === 4294967295) {
      o += 2;
      continue;
    }
    const l = e[d], P = e[v], p = e[u];
    if (!l || !P || !p)
      continue;
    const c = S.ProjectOnTriangleToRef(A, l, P, p, a);
    c < f && (s.copyFrom(a), f = c);
  }
  return i.copyFrom(s), f;
};
rA.prototype._projectOnUnIndexedTrianglesToRef = function(A, e, t, r) {
  const n = ue.Vector3[0], i = ue.Vector3[1];
  let s = 1 / 0;
  for (let a = this.verticesStart; a < this.verticesStart + this.verticesCount; a += 3) {
    const f = e[a], o = e[a + 1], d = e[a + 2], v = S.ProjectOnTriangleToRef(A, f, o, d, i);
    v < s && (n.copyFrom(i), s = v);
  }
  return r.copyFrom(n), s;
};
rA.prototype.projectToRef = function(A, e, t, r) {
  const n = this.getMaterial();
  if (!n)
    return -1;
  let i = 3, s = !1;
  switch (n.fillMode) {
    case 3:
    case 5:
    case 6:
    case 8:
      return -1;
    case 7:
      i = 1, s = !0;
      break;
  }
  return n.fillMode === 4 ? -1 : !t.length && this._mesh._unIndexed ? this._projectOnUnIndexedTrianglesToRef(A, e, t, r) : this._projectOnTrianglesToRef(A, e, t, i, s, r);
};
var vc;
(function(A) {
  A[A.DEHYDRATED = 0] = "DEHYDRATED", A[A.HOVER = 1] = "HOVER", A[A.TOUCH = 2] = "TOUCH";
})(vc || (vc = {}));
var zx;
(function(A) {
  A[A.DISABLED = 0] = "DISABLED", A[A.CENTERED_ON_CONTROLLER = 1] = "CENTERED_ON_CONTROLLER", A[A.CENTERED_IN_FRONT = 2] = "CENTERED_IN_FRONT";
})(zx || (zx = {}));
class sg extends L9 {
  /**
   * constructs a new background remover module
   * @param _xrSessionManager the session manager for this module
   * @param _options read-only options to be used in this module
   */
  constructor(e, t) {
    super(e), this._options = t, this._tmpRay = new Hi(new S(), new S()), this._attachController = (r) => {
      if (this._controllers[r.uniqueId])
        return;
      const { touchCollisionMesh: n, touchCollisionMeshFunction: i, hydrateCollisionMeshFunction: s } = this._generateNewTouchPointMesh(), a = this._generateVisualCue();
      switch (this._controllers[r.uniqueId] = {
        xrController: r,
        meshUnderPointer: null,
        nearInteractionTargetMesh: null,
        pick: null,
        stalePick: null,
        touchCollisionMesh: n,
        touchCollisionMeshFunction: i,
        hydrateCollisionMeshFunction: s,
        currentAnimationState: vc.DEHYDRATED,
        grabRay: new Hi(new S(), new S()),
        hoverInteraction: !1,
        nearInteraction: !1,
        grabInteraction: !1,
        id: sg._IdCounter++,
        pickedPointVisualCue: a
      }, this._attachedController ? !this._options.enableNearInteractionOnAllControllers && this._options.preferredHandedness && r.inputSource.handedness === this._options.preferredHandedness && (this._attachedController = r.uniqueId) : this._options.enableNearInteractionOnAllControllers || (this._attachedController = r.uniqueId), r.inputSource.targetRayMode) {
        case "tracked-pointer":
          return this._attachNearInteractionMode(r);
        case "gaze":
          return null;
        case "screen":
          return null;
      }
    }, this._controllers = {}, this._farInteractionFeature = null, this.selectionMeshDefaultColor = new Ne(0.8, 0.8, 0.8), this.selectionMeshPickedColor = new Ne(0.3, 0.3, 1), this._hoverRadius = 0.1, this._pickRadius = 0.02, this._controllerPickRadius = 0.03, this._nearGrabLengthScale = 5, this._scene = this._xrSessionManager.scene, this._options.nearInteractionControllerMode === void 0 && (this._options.nearInteractionControllerMode = zx.CENTERED_IN_FRONT), this._options.farInteractionFeature && (this._farInteractionFeature = this._options.farInteractionFeature);
  }
  /**
   * Attach this feature
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  attach() {
    return super.attach() ? (this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (e) => {
      this._detachController(e.uniqueId);
    }), this._scene.constantlyUpdateMeshUnderPointer = !0, !0) : !1;
  }
  /**
   * Detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    return super.detach() ? (Object.keys(this._controllers).forEach((e) => {
      this._detachController(e);
    }), !0) : !1;
  }
  /**
   * Will get the mesh under a specific pointer.
   * `scene.meshUnderPointer` will only return one mesh - either left or right.
   * @param controllerId the controllerId to check
   * @returns The mesh under pointer or null if no mesh is under the pointer
   */
  getMeshUnderPointer(e) {
    return this._controllers[e] ? this._controllers[e].meshUnderPointer : null;
  }
  /**
   * Get the xr controller that correlates to the pointer id in the pointer event
   *
   * @param id the pointer id to search for
   * @returns the controller that correlates to this id or null if not found
   */
  getXRControllerByPointerId(e) {
    const t = Object.keys(this._controllers);
    for (let r = 0; r < t.length; ++r)
      if (this._controllers[t[r]].id === e)
        return this._controllers[t[r]].xrController || null;
    return null;
  }
  /**
   * This function sets webXRControllerPointerSelection feature that will be disabled when
   * the hover range is reached for a mesh and will be reattached when not in hover range.
   * This is used to remove the selection rays when moving.
   * @param farInteractionFeature the feature to disable when finger is in hover range for a mesh
   */
  setFarInteractionFeature(e) {
    this._farInteractionFeature = e;
  }
  /**
   * Filter used for near interaction pick and hover
   * @param mesh
   */
  _nearPickPredicate(e) {
    return e.isEnabled() && e.isVisible && e.isPickable && e.isNearPickable;
  }
  /**
   * Filter used for near interaction grab
   * @param mesh
   */
  _nearGrabPredicate(e) {
    return e.isEnabled() && e.isVisible && e.isPickable && e.isNearGrabbable;
  }
  /**
   * Filter used for any near interaction
   * @param mesh
   */
  _nearInteractionPredicate(e) {
    return e.isEnabled() && e.isVisible && e.isPickable && (e.isNearPickable || e.isNearGrabbable);
  }
  _controllerAvailablePredicate(e, t) {
    let r = e;
    for (; r; ) {
      if (r.reservedDataStore && r.reservedDataStore.nearInteraction && r.reservedDataStore.nearInteraction.excludedControllerId === t)
        return !1;
      r = r.parent;
    }
    return !0;
  }
  _handleTransitionAnimation(e, t) {
    var r;
    if (!(e.currentAnimationState === t || this._options.nearInteractionControllerMode !== zx.CENTERED_IN_FRONT || !((r = e.xrController) === null || r === void 0) && r.inputSource.hand)) {
      if (t > e.currentAnimationState)
        switch (e.currentAnimationState) {
          case vc.DEHYDRATED:
            if (e.hydrateCollisionMeshFunction(!0), t === vc.HOVER)
              break;
          case vc.HOVER:
            if (e.touchCollisionMeshFunction(!0), t === vc.TOUCH)
              break;
        }
      else
        switch (e.currentAnimationState) {
          case vc.TOUCH:
            if (e.touchCollisionMeshFunction(!1), t === vc.HOVER)
              break;
          case vc.HOVER:
            if (e.hydrateCollisionMeshFunction(!1), t === vc.DEHYDRATED)
              break;
        }
      e.currentAnimationState = t;
    }
  }
  _processTouchPoint(e, t, r) {
    var n;
    const i = this._controllers[e];
    i.grabRay.origin.copyFrom(t), r.toEulerAnglesToRef(ue.Vector3[0]), i.grabRay.direction.copyFrom(ue.Vector3[0]), this._options.nearInteractionControllerMode === zx.CENTERED_IN_FRONT && !(!((n = i.xrController) === null || n === void 0) && n.inputSource.hand) && (i.xrController.getWorldPointerRayToRef(this._tmpRay), i.grabRay.origin.addInPlace(this._tmpRay.direction.scale(0.05))), i.grabRay.length = this._nearGrabLengthScale * this._hoverRadius, i.touchCollisionMesh.position.copyFrom(i.grabRay.origin);
  }
  _onXRFrame(e) {
    Object.keys(this._controllers).forEach((t) => {
      var r;
      const n = this._controllers[t], i = (r = n.xrController) === null || r === void 0 ? void 0 : r.inputSource.hand;
      if (!this._options.enableNearInteractionOnAllControllers && t !== this._attachedController || !n.xrController || !i && (!this._options.nearInteractionControllerMode || !n.xrController.inputSource.gamepad)) {
        n.pick = null;
        return;
      }
      if (n.hoverInteraction = !1, n.nearInteraction = !1, n.xrController) {
        if (i) {
          const o = i.get("index-finger-tip");
          if (o) {
            const d = e.getJointPose(o, this._xrSessionManager.referenceSpace);
            if (d && d.transform) {
              const v = this._scene.useRightHandedSystem ? 1 : -1;
              ue.Vector3[0].set(d.transform.position.x, d.transform.position.y, d.transform.position.z * v), ue.Quaternion[0].set(d.transform.orientation.x, d.transform.orientation.y, d.transform.orientation.z * v, d.transform.orientation.w * v), this._processTouchPoint(t, ue.Vector3[0], ue.Quaternion[0]);
            }
          }
        } else if (n.xrController.inputSource.gamepad && this._options.nearInteractionControllerMode !== zx.DISABLED) {
          let o = n.xrController.pointer;
          n.xrController.grip && this._options.nearInteractionControllerMode === zx.CENTERED_ON_CONTROLLER && (o = n.xrController.grip), this._processTouchPoint(t, o.position, o.rotationQuaternion);
        }
      } else
        return;
      const s = (o, d) => {
        let v = null;
        return !d || !d.hit ? v = o : !o || !o.hit || d.distance < o.distance ? v = d : v = o, v;
      }, a = (o) => {
        let d = new F9(), v = !1;
        const u = o && o.pickedPoint && o.hit;
        return o != null && o.pickedPoint && (v = o.pickedPoint.x === 0 && o.pickedPoint.y === 0 && o.pickedPoint.z === 0), u && !v && (d = o), d;
      };
      if (!n.grabInteraction) {
        let o = null, d = null;
        this._options.useUtilityLayer && this._utilityLayerScene && (d = this._pickWithSphere(n, this._hoverRadius, this._utilityLayerScene, (l) => this._nearInteractionPredicate(l)));
        const v = this._pickWithSphere(n, this._hoverRadius, this._scene, (l) => this._nearInteractionPredicate(l)), u = s(v, d);
        if (u && u.hit && (o = a(u), o.hit && (n.hoverInteraction = !0)), n.hoverInteraction) {
          let l = null;
          const P = i ? this._pickRadius : this._controllerPickRadius;
          this._options.useUtilityLayer && this._utilityLayerScene && (l = this._pickWithSphere(n, P, this._utilityLayerScene, (T) => this._nearPickPredicate(T)));
          const p = this._pickWithSphere(n, P, this._scene, (T) => this._nearPickPredicate(T)), c = s(p, l), H = a(c);
          H.hit && (o = H, n.nearInteraction = !0);
        }
        n.stalePick = n.pick, n.pick = o, n.pick && n.pick.pickedPoint && n.pick.hit ? (n.meshUnderPointer = n.pick.pickedMesh, n.pickedPointVisualCue.position.copyFrom(n.pick.pickedPoint), n.pickedPointVisualCue.isVisible = !0, this._farInteractionFeature && this._farInteractionFeature.attached && this._farInteractionFeature._setPointerSelectionDisabledByPointerId(n.id, !0)) : (n.meshUnderPointer = null, n.pickedPointVisualCue.isVisible = !1, this._farInteractionFeature && this._farInteractionFeature.attached && this._farInteractionFeature._setPointerSelectionDisabledByPointerId(n.id, !1));
      }
      let f = vc.DEHYDRATED;
      n.grabInteraction || n.nearInteraction ? f = vc.TOUCH : n.hoverInteraction && (f = vc.HOVER), this._handleTransitionAnimation(n, f);
    });
  }
  get _utilityLayerScene() {
    return this._options.customUtilityLayerScene || Ds.DefaultUtilityLayer.utilityLayerScene;
  }
  _generateVisualCue() {
    const e = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Ds.DefaultUtilityLayer.utilityLayerScene : this._scene, t = UA("nearInteraction", {
      diameter: 35e-4 * 3
    }, e);
    t.bakeCurrentTransformIntoVertices(), t.isPickable = !1, t.isVisible = !1, t.rotationQuaternion = Ze.Identity();
    const r = new Wt("targetMat", e);
    return r.specularColor = Ne.Black(), r.emissiveColor = this.selectionMeshDefaultColor, r.backFaceCulling = !1, t.material = r, t;
  }
  _isControllerReadyForNearInteraction(e) {
    return this._farInteractionFeature ? this._farInteractionFeature._getPointerSelectionDisabledByPointerId(e) : !0;
  }
  _attachNearInteractionMode(e) {
    const t = this._controllers[e.uniqueId], r = {
      pointerId: t.id,
      pointerType: "xr-near"
    };
    t.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {
      !this._options.enableNearInteractionOnAllControllers && e.uniqueId !== this._attachedController || !t.xrController || !t.xrController.inputSource.hand && (!this._options.nearInteractionControllerMode || !t.xrController.inputSource.gamepad) || (t.pick && (t.pick.ray = t.grabRay), t.pick && this._isControllerReadyForNearInteraction(t.id) && this._scene.simulatePointerMove(t.pick, r), t.nearInteraction && t.pick && t.pick.hit ? t.nearInteractionTargetMesh || (this._scene.simulatePointerDown(t.pick, r), t.nearInteractionTargetMesh = t.meshUnderPointer) : t.nearInteractionTargetMesh && t.stalePick && (this._scene.simulatePointerUp(t.stalePick, r), t.nearInteractionTargetMesh = null));
    });
    const n = (i) => {
      this._options.enableNearInteractionOnAllControllers || e.uniqueId === this._attachedController && this._isControllerReadyForNearInteraction(t.id) ? (t.pick && (t.pick.ray = t.grabRay), i && t.pick && t.meshUnderPointer && this._nearGrabPredicate(t.meshUnderPointer) ? (t.grabInteraction = !0, t.pickedPointVisualCue.isVisible = !1, this._scene.simulatePointerDown(t.pick, r)) : !i && t.pick && t.grabInteraction && (this._scene.simulatePointerUp(t.pick, r), t.grabInteraction = !1, t.pickedPointVisualCue.isVisible = !0)) : i && !this._options.enableNearInteractionOnAllControllers && !this._options.disableSwitchOnClick && (this._attachedController = e.uniqueId);
    };
    if (e.inputSource.gamepad) {
      const i = (s) => {
        t.squeezeComponent = s.getComponent("grasp"), t.squeezeComponent ? t.onSqueezeButtonChangedObserver = t.squeezeComponent.onButtonStateChangedObservable.add((a) => {
          if (a.changes.pressed) {
            const f = a.changes.pressed.current;
            n(f);
          }
        }) : (t.selectionComponent = s.getMainComponent(), t.onButtonChangedObserver = t.selectionComponent.onButtonStateChangedObservable.add((a) => {
          if (a.changes.pressed) {
            const f = a.changes.pressed.current;
            n(f);
          }
        }));
      };
      e.motionController ? i(e.motionController) : e.onMotionControllerInitObservable.add(i);
    } else {
      const i = (a) => {
        t.xrController && a.inputSource === t.xrController.inputSource && t.pick && this._isControllerReadyForNearInteraction(t.id) && t.meshUnderPointer && this._nearGrabPredicate(t.meshUnderPointer) && (t.grabInteraction = !0, t.pickedPointVisualCue.isVisible = !1, this._scene.simulatePointerDown(t.pick, r));
      }, s = (a) => {
        t.xrController && a.inputSource === t.xrController.inputSource && t.pick && this._isControllerReadyForNearInteraction(t.id) && (this._scene.simulatePointerUp(t.pick, r), t.grabInteraction = !1, t.pickedPointVisualCue.isVisible = !0);
      };
      t.eventListeners = {
        selectend: s,
        selectstart: i
      }, this._xrSessionManager.session.addEventListener("selectstart", i), this._xrSessionManager.session.addEventListener("selectend", s);
    }
  }
  _detachController(e) {
    const t = this._controllers[e];
    if (t && (t.squeezeComponent && t.onSqueezeButtonChangedObserver && t.squeezeComponent.onButtonStateChangedObservable.remove(t.onSqueezeButtonChangedObserver), t.selectionComponent && t.onButtonChangedObserver && t.selectionComponent.onButtonStateChangedObservable.remove(t.onButtonChangedObserver), t.onFrameObserver && this._xrSessionManager.onXRFrameObservable.remove(t.onFrameObserver), t.eventListeners && Object.keys(t.eventListeners).forEach((r) => {
      const n = t.eventListeners && t.eventListeners[r];
      n && this._xrSessionManager.session.removeEventListener(r, n);
    }), t.touchCollisionMesh.dispose(), t.pickedPointVisualCue.dispose(), this._xrSessionManager.runInXRFrame(() => {
      const r = {
        pointerId: t.id,
        pointerType: "xr-near"
      };
      this._scene.simulatePointerUp(new F9(), r);
    }), delete this._controllers[e], this._attachedController === e)) {
      const r = Object.keys(this._controllers);
      r.length ? this._attachedController = r[0] : this._attachedController = "";
    }
  }
  _generateNewTouchPointMesh() {
    const e = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Ds.DefaultUtilityLayer.utilityLayerScene : this._scene, t = UA("PickSphere", { diameter: 1 }, e);
    t.isVisible = !1, this._options.motionControllerOrbMaterial ? t.material = this._options.motionControllerOrbMaterial : ja.ParseFromSnippetAsync("8RUNKL#3", e).then((m) => {
      t.material = m;
    });
    const r = new _N();
    r.setEasingMode(u1.EASINGMODE_EASEINOUT);
    const n = new S(this._controllerPickRadius, this._controllerPickRadius, this._controllerPickRadius), i = this._controllerPickRadius * (4 / 3), s = new S(i, i, i), a = this._controllerPickRadius * (7 / 6), f = new S(a, a, a), o = this._controllerPickRadius * (4 / 5), d = new S(o, o, o), v = this._controllerPickRadius * (3 / 2), u = new S(v, v, v), l = [
      { frame: 0, value: n },
      { frame: 10, value: u },
      { frame: 18, value: s }
    ], P = [
      { frame: 0, value: s },
      { frame: 10, value: d },
      { frame: 18, value: n }
    ], p = [
      { frame: 0, value: S.ZeroReadOnly },
      { frame: 12, value: f },
      { frame: 15, value: n }
    ], c = [
      { frame: 0, value: n },
      { frame: 10, value: S.ZeroReadOnly },
      { frame: 15, value: S.ZeroReadOnly }
    ], H = new st("touch", "scaling", 60, st.ANIMATIONTYPE_VECTOR3, st.ANIMATIONLOOPMODE_CONSTANT), T = new st("release", "scaling", 60, st.ANIMATIONTYPE_VECTOR3, st.ANIMATIONLOOPMODE_CONSTANT), q = new st("hydrate", "scaling", 60, st.ANIMATIONTYPE_VECTOR3, st.ANIMATIONLOOPMODE_CONSTANT), b = new st("dehydrate", "scaling", 60, st.ANIMATIONTYPE_VECTOR3, st.ANIMATIONLOOPMODE_CONSTANT);
    return H.setEasingFunction(r), T.setEasingFunction(r), q.setEasingFunction(r), b.setEasingFunction(r), H.setKeys(l), T.setKeys(P), q.setKeys(p), b.setKeys(c), { touchCollisionMesh: t, touchCollisionMeshFunction: (m) => {
      const I = m ? H : T;
      e.beginDirectAnimation(t, [I], 0, 18, !1, 1);
    }, hydrateCollisionMeshFunction: (m) => {
      const I = m ? q : b;
      m && (t.isVisible = !0), e.beginDirectAnimation(t, [I], 0, 15, !1, 1, () => {
        m || (t.isVisible = !1);
      });
    } };
  }
  _pickWithSphere(e, t, r, n) {
    const i = new F9();
    if (i.distance = 1 / 0, e.touchCollisionMesh && e.xrController) {
      const s = e.touchCollisionMesh.position, a = rg.CreateFromCenterAndRadius(s, t);
      for (let f = 0; f < r.meshes.length; f++) {
        const o = r.meshes[f];
        if (!n(o) || !this._controllerAvailablePredicate(o, e.xrController.uniqueId))
          continue;
        const d = sg.PickMeshWithSphere(o, a);
        d && d.hit && d.distance < i.distance && (i.hit = d.hit, i.pickedMesh = o, i.pickedPoint = d.pickedPoint, i.aimTransform = e.xrController.pointer, i.gripTransform = e.xrController.grip || null, i.originMesh = e.touchCollisionMesh, i.distance = d.distance);
      }
    }
    return i;
  }
  /**
   * Picks a mesh with a sphere
   * @param mesh the mesh to pick
   * @param sphere picking sphere in world coordinates
   * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
   * @returns the picking info
   */
  static PickMeshWithSphere(e, t, r = !1) {
    const n = e.subMeshes, i = new F9(), s = e.getBoundingInfo();
    if (!e._generatePointsArray() || !e.subMeshes || !s || !r && !rg.Intersects(s.boundingSphere, t))
      return i;
    const a = ue.Vector3[0], f = ue.Vector3[1];
    let o = 1 / 0, d, v, u;
    const l = ue.Vector3[2], P = ue.Matrix[0];
    P.copyFrom(e.getWorldMatrix()), P.invert(), S.TransformCoordinatesToRef(t.center, P, l);
    for (let p = 0; p < n.length; p++)
      n[p].projectToRef(l, e._positions, e.getIndices(), f), S.TransformCoordinatesToRef(f, e.getWorldMatrix(), f), d = S.Distance(f, t.center), u = S.Distance(f, e.getAbsolutePosition()), v = S.Distance(t.center, e.getAbsolutePosition()), v !== -1 && u !== -1 && u > v && (d = 0, f.copyFrom(t.center)), d !== -1 && d < o && (o = d, a.copyFrom(f));
    return o < t.radius && (i.hit = !0, i.distance = o, i.pickedMesh = e, i.pickedPoint = a.clone()), i;
  }
}
sg._IdCounter = 200;
sg.Name = Gi.NEAR_INTERACTION;
sg.Version = 1;
So.AddWebXRFeature(sg.Name, (A, e) => () => new sg(A, e), sg.Version, !0);
class yte {
  /**
   * Creates a WebXREnterExitUIButton
   * @param element button element
   * @param sessionMode XR initialization session mode
   * @param referenceSpaceType the type of reference space to be used
   */
  constructor(e, t, r) {
    this.element = e, this.sessionMode = t, this.referenceSpaceType = r;
  }
  /**
   * Extendable function which can be used to update the button's visuals when the state changes
   * @param activeButton the current active button in the UI
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  update(e) {
  }
}
class l3e {
}
class dy {
  /**
   * Construct a new EnterExit UI class
   *
   * @param _scene babylon scene object to use
   * @param options (read-only) version of the options passed to this UI
   */
  constructor(e, t) {
    if (this._scene = e, this.options = t, this._activeButton = null, this._buttons = [], this.activeButtonChangedObservable = new Oe(), this._onSessionGranted = (n) => {
      this._helper && this._enterXRWithButtonIndex(0);
    }, this.overlay = document.createElement("div"), this.overlay.classList.add("xr-button-overlay"), !t.ignoreSessionGrantedEvent && navigator.xr && navigator.xr.addEventListener("sessiongranted", this._onSessionGranted), typeof window < "u" && window.location && window.location.protocol === "http:" && window.location.hostname !== "localhost")
      throw ye.Warn("WebXR can only be served over HTTPS"), new Error("WebXR can only be served over HTTPS");
    if (t.customButtons)
      this._buttons = t.customButtons;
    else {
      this.overlay.style.cssText = "z-index:11;position: absolute; right: 20px;bottom: 50px;";
      const n = t.sessionMode || "immersive-vr", i = t.referenceSpaceType || "local-floor";
      let a = ".babylonVRicon { color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(" + (typeof SVGSVGElement > "u" ? "https://cdn.babylonjs.com/Assets/vrButton.png" : "data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A") + "); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";
      a += '.babylonVRicon.vrdisplaypresenting { background-image: none;} .vrdisplaypresenting::after { content: "EXIT"} .xr-error::after { content: "ERROR"}';
      const f = document.createElement("style");
      f.appendChild(document.createTextNode(a)), document.getElementsByTagName("head")[0].appendChild(f);
      const o = document.createElement("button");
      o.className = "babylonVRicon", o.title = `${n} - ${i}`, this._buttons.push(new yte(o, n, i)), this._buttons[this._buttons.length - 1].update = function(d) {
        this.element.style.display = d === null || d === this ? "" : "none", o.className = "babylonVRicon" + (d === this ? " vrdisplaypresenting" : "");
      }, this._updateButtons(null);
    }
    const r = e.getEngine().getInputElement();
    r && r.parentNode && (r.parentNode.appendChild(this.overlay), e.onDisposeObservable.addOnce(() => {
      this.dispose();
    }));
  }
  /**
   * Set the helper to be used with this UI component.
   * The UI is bound to an experience helper. If not provided the UI can still be used but the events should be registered by the developer.
   *
   * @param helper the experience helper to attach
   * @param renderTarget an optional render target (in case it is created outside of the helper scope)
   * @returns a promise that resolves when the ui is ready
   */
  async setHelperAsync(e, t) {
    this._helper = e, this._renderTarget = t;
    const r = this._buttons.map((i) => e.sessionManager.isSessionSupportedAsync(i.sessionMode));
    e.onStateChangedObservable.add((i) => {
      i == d9.NOT_IN_XR && this._updateButtons(null);
    }), (await Promise.all(r)).forEach((i, s) => {
      i ? (this.overlay.appendChild(this._buttons[s].element), this._buttons[s].element.onclick = this._enterXRWithButtonIndex.bind(this, s)) : ye.Warn(`Session mode "${this._buttons[s].sessionMode}" not supported in browser`);
    });
  }
  /**
   * Creates UI to allow the user to enter/exit XR mode
   * @param scene the scene to add the ui to
   * @param helper the xr experience helper to enter/exit xr with
   * @param options options to configure the UI
   * @returns the created ui
   */
  static async CreateAsync(e, t, r) {
    const n = new dy(e, r);
    return await n.setHelperAsync(t, r.renderTarget || void 0), n;
  }
  async _enterXRWithButtonIndex(e = 0) {
    if (this._helper.state == d9.IN_XR)
      await this._helper.exitXRAsync(), this._updateButtons(null);
    else if (this._helper.state == d9.NOT_IN_XR)
      try {
        await this._helper.enterXRAsync(this._buttons[e].sessionMode, this._buttons[e].referenceSpaceType, this._renderTarget, {
          optionalFeatures: this.options.optionalFeatures,
          requiredFeatures: this.options.requiredFeatures
        }), this._updateButtons(this._buttons[e]);
      } catch (t) {
        this._updateButtons(null);
        const r = this._buttons[e].element, n = r.title;
        r.title = "Error entering XR session : " + n, r.classList.add("xr-error"), this.options.onError && this.options.onError(t);
      }
  }
  /**
   * Disposes of the XR UI component
   */
  dispose() {
    const e = this._scene.getEngine().getInputElement();
    e && e.parentNode && e.parentNode.contains(this.overlay) && e.parentNode.removeChild(this.overlay), this.activeButtonChangedObservable.clear(), navigator.xr.removeEventListener("sessiongranted", this._onSessionGranted);
  }
  _updateButtons(e) {
    this._activeButton = e, this._buttons.forEach((t) => {
      t.update(this._activeButton);
    }), this.activeButtonChangedObservable.notifyObservers(this._activeButton);
  }
}
var Gx;
(function(A) {
  A[A.INIT = 0] = "INIT", A[A.STARTED = 1] = "STARTED", A[A.ENDED = 2] = "ENDED";
})(Gx || (Gx = {}));
function HF(A) {
  var e;
  let t = 0;
  const r = Date.now();
  A.observableParameters = (e = A.observableParameters) !== null && e !== void 0 ? e : {};
  const n = A.contextObservable.add((i) => {
    const s = Date.now();
    t = s - r;
    const a = {
      startTime: r,
      currentTime: s,
      deltaTime: t,
      completeRate: t / A.timeout,
      payload: i
    };
    A.onTick && A.onTick(a), A.breakCondition && A.breakCondition() && (A.contextObservable.remove(n), A.onAborted && A.onAborted(a)), t >= A.timeout && (A.contextObservable.remove(n), A.onEnded && A.onEnded(a));
  }, A.observableParameters.mask, A.observableParameters.insertFirst, A.observableParameters.scope);
  return n;
}
class kte {
  /**
   * Will construct a new advanced timer based on the options provided. Timer will not start until start() is called.
   * @param options construction options for this advanced timer
   */
  constructor(e) {
    var t, r;
    this.onEachCountObservable = new Oe(), this.onTimerAbortedObservable = new Oe(), this.onTimerEndedObservable = new Oe(), this.onStateChangedObservable = new Oe(), this._observer = null, this._breakOnNextTick = !1, this._tick = (n) => {
      const i = Date.now();
      this._timer = i - this._startTime;
      const s = {
        startTime: this._startTime,
        currentTime: i,
        deltaTime: this._timer,
        completeRate: this._timer / this._timeToEnd,
        payload: n
      }, a = this._breakOnNextTick || this._breakCondition(s);
      a || this._timer >= this._timeToEnd ? this._stop(s, a) : this.onEachCountObservable.notifyObservers(s);
    }, this._setState(Gx.INIT), this._contextObservable = e.contextObservable, this._observableParameters = (t = e.observableParameters) !== null && t !== void 0 ? t : {}, this._breakCondition = (r = e.breakCondition) !== null && r !== void 0 ? r : () => !1, this._timeToEnd = e.timeout, e.onEnded && this.onTimerEndedObservable.add(e.onEnded), e.onTick && this.onEachCountObservable.add(e.onTick), e.onAborted && this.onTimerAbortedObservable.add(e.onAborted);
  }
  /**
   * set a breaking condition for this timer. Default is to never break during count
   * @param predicate the new break condition. Returns true to break, false otherwise
   */
  set breakCondition(e) {
    this._breakCondition = e;
  }
  /**
   * Reset ALL associated observables in this advanced timer
   */
  clearObservables() {
    this.onEachCountObservable.clear(), this.onTimerAbortedObservable.clear(), this.onTimerEndedObservable.clear(), this.onStateChangedObservable.clear();
  }
  /**
   * Will start a new iteration of this timer. Only one instance of this timer can run at a time.
   *
   * @param timeToEnd how much time to measure until timer ended
   */
  start(e = this._timeToEnd) {
    if (this._state === Gx.STARTED)
      throw new Error("Timer already started. Please stop it before starting again");
    this._timeToEnd = e, this._startTime = Date.now(), this._timer = 0, this._observer = this._contextObservable.add(this._tick, this._observableParameters.mask, this._observableParameters.insertFirst, this._observableParameters.scope), this._setState(Gx.STARTED);
  }
  /**
   * Will force a stop on the next tick.
   */
  stop() {
    this._state === Gx.STARTED && (this._breakOnNextTick = !0);
  }
  /**
   * Dispose this timer, clearing all resources
   */
  dispose() {
    this._observer && this._contextObservable.remove(this._observer), this.clearObservables();
  }
  _setState(e) {
    this._state = e, this.onStateChangedObservable.notifyObservers(this._state);
  }
  _stop(e, t = !1) {
    this._contextObservable.remove(this._observer), this._setState(Gx.ENDED), t ? this.onTimerAbortedObservable.notifyObservers(e) : this.onTimerEndedObservable.notifyObservers(e);
  }
}
class nm extends L9 {
  /**
   * Is rotation enabled when moving forward?
   * Disabling this feature will prevent the user from deciding the direction when teleporting
   */
  get rotationEnabled() {
    return this._rotationEnabled;
  }
  /**
   * Sets whether rotation is enabled or not
   * @param enabled is rotation enabled when teleportation is shown
   */
  set rotationEnabled(e) {
    if (this._rotationEnabled = e, this._options.teleportationTargetMesh) {
      const t = this._options.teleportationTargetMesh.getChildMeshes(!1, (r) => r.name === "rotationCone");
      t[0] && t[0].setEnabled(e);
    }
  }
  /**
   * Exposes the currently set teleportation target mesh.
   */
  get teleportationTargetMesh() {
    return this._options.teleportationTargetMesh || null;
  }
  /**
   * constructs a new teleportation system
   * @param _xrSessionManager an instance of WebXRSessionManager
   * @param _options configuration object for this feature
   */
  constructor(e, t) {
    super(e), this._options = t, this._controllers = {}, this._snappedToPoint = !1, this._cachedColor4White = new xt(1, 1, 1, 1), this._tmpRay = new Hi(new S(), new S()), this._tmpVector = new S(), this._tmpQuaternion = new Ze(), this.skipNextTeleportation = !1, this.backwardsMovementEnabled = !0, this.backwardsTeleportationDistance = 0.7, this.parabolicCheckRadius = 5, this.parabolicRayEnabled = !0, this.straightRayEnabled = !0, this.rotationAngle = Math.PI / 8, this.onTargetMeshPositionUpdatedObservable = new Oe(), this.teleportationEnabled = !0, this._rotationEnabled = !0, this._attachController = (r) => {
      if (this._controllers[r.uniqueId] || this._options.forceHandedness && r.inputSource.handedness !== this._options.forceHandedness)
        return;
      this._controllers[r.uniqueId] = {
        xrController: r,
        teleportationState: {
          forward: !1,
          backwards: !1,
          rotating: !1,
          currentRotation: 0,
          baseRotation: 0,
          blocked: !1
        }
      };
      const n = this._controllers[r.uniqueId];
      if (n.xrController.inputSource.targetRayMode === "tracked-pointer" && n.xrController.inputSource.gamepad) {
        const i = () => {
          if (r.motionController) {
            const s = r.motionController.getComponentOfType(Jl.THUMBSTICK_TYPE) || r.motionController.getComponentOfType(Jl.TOUCHPAD_TYPE);
            if (!s || this._options.useMainComponentOnly) {
              const a = r.motionController.getMainComponent();
              if (!a)
                return;
              n.teleportationComponent = a, n.onButtonChangedObserver = a.onButtonStateChangedObservable.add(() => {
                if (this.teleportationEnabled && a.changes.pressed)
                  if (a.changes.pressed.current) {
                    n.teleportationState.forward = !0, this._currentTeleportationControllerId = n.xrController.uniqueId, n.teleportationState.baseRotation = this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y, n.teleportationState.currentRotation = 0;
                    const f = this._options.timeToTeleport || 3e3;
                    HF({
                      timeout: f,
                      contextObservable: this._xrSessionManager.onXRFrameObservable,
                      breakCondition: () => !a.pressed,
                      onEnded: () => {
                        this._currentTeleportationControllerId === n.xrController.uniqueId && n.teleportationState.forward && this._teleportForward(r.uniqueId);
                      }
                    });
                  } else
                    n.teleportationState.forward = !1, this._currentTeleportationControllerId = "";
              });
            } else
              n.teleportationComponent = s, n.onAxisChangedObserver = s.onAxisValueChangedObservable.add((a) => {
                if (a.y <= 0.7 && n.teleportationState.backwards && (n.teleportationState.backwards = !1), a.y > 0.7 && !n.teleportationState.forward && this.backwardsMovementEnabled && !this.snapPointsOnly && !n.teleportationState.backwards) {
                  n.teleportationState.backwards = !0, this._tmpQuaternion.copyFrom(this._options.xrInput.xrCamera.rotationQuaternion), this._tmpQuaternion.toEulerAnglesToRef(this._tmpVector), this._tmpVector.x = 0, this._tmpVector.z = 0, Ze.FromEulerVectorToRef(this._tmpVector, this._tmpQuaternion), this._tmpVector.set(0, 0, this.backwardsTeleportationDistance * (this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1)), this._tmpVector.rotateByQuaternionToRef(this._tmpQuaternion, this._tmpVector), this._tmpVector.addInPlace(this._options.xrInput.xrCamera.position), this._tmpRay.origin.copyFrom(this._tmpVector), this._tmpRay.length = this._options.xrInput.xrCamera.realWorldHeight + 0.1, this._tmpRay.direction.set(0, -1, 0);
                  const f = this._xrSessionManager.scene.pickWithRay(this._tmpRay, (o) => this._floorMeshes.indexOf(o) !== -1);
                  f && f.pickedPoint && (this._options.xrInput.xrCamera.position.x = f.pickedPoint.x, this._options.xrInput.xrCamera.position.z = f.pickedPoint.z);
                }
                if (a.y < -0.7 && !this._currentTeleportationControllerId && !n.teleportationState.rotating && this.teleportationEnabled && (n.teleportationState.forward = !0, this._currentTeleportationControllerId = n.xrController.uniqueId, n.teleportationState.baseRotation = this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y), a.x) {
                  if (n.teleportationState.forward)
                    this._currentTeleportationControllerId === n.xrController.uniqueId && (this.rotationEnabled ? setTimeout(() => {
                      n.teleportationState.currentRotation = Math.atan2(a.x, a.y * (this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1));
                    }) : n.teleportationState.currentRotation = 0);
                  else if (!n.teleportationState.rotating && Math.abs(a.x) > 0.7) {
                    n.teleportationState.rotating = !0;
                    const f = this.rotationAngle * (a.x > 0 ? 1 : -1) * (this._xrSessionManager.scene.useRightHandedSystem ? -1 : 1);
                    Ze.FromEulerAngles(0, f, 0).multiplyToRef(this._options.xrInput.xrCamera.rotationQuaternion, this._options.xrInput.xrCamera.rotationQuaternion);
                  }
                } else
                  n.teleportationState.rotating = !1;
                a.x === 0 && a.y === 0 && (n.teleportationState.blocked && (n.teleportationState.blocked = !1, this._setTargetMeshVisibility(!1)), n.teleportationState.forward && this._teleportForward(r.uniqueId));
              });
          }
        };
        r.motionController ? i() : r.onMotionControllerInitObservable.addOnce(() => {
          i();
        });
      } else
        this._xrSessionManager.scene.onPointerObservable.add((i) => {
          if (i.type === ir.POINTERDOWN) {
            n.teleportationState.forward = !0, this._currentTeleportationControllerId = n.xrController.uniqueId, n.teleportationState.baseRotation = this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y, n.teleportationState.currentRotation = 0;
            const s = this._options.timeToTeleport || 3e3;
            HF({
              timeout: s,
              contextObservable: this._xrSessionManager.onXRFrameObservable,
              onEnded: () => {
                this._currentTeleportationControllerId === n.xrController.uniqueId && n.teleportationState.forward && this._teleportForward(r.uniqueId);
              }
            });
          } else
            i.type === ir.POINTERUP && (n.teleportationState.forward = !1, this._currentTeleportationControllerId = "");
        });
    }, this._options.teleportationTargetMesh || this._createDefaultTargetMesh(), this._floorMeshes = this._options.floorMeshes || [], this._snapToPositions = this._options.snapPositions || [], this._blockedRayColor = this._options.blockedRayColor || new xt(1, 0, 0, 0.75), this._setTargetMeshVisibility(!1);
  }
  /**
   * Get the snapPointsOnly flag
   */
  get snapPointsOnly() {
    return !!this._options.snapPointsOnly;
  }
  /**
   * Sets the snapPointsOnly flag
   * @param snapToPoints should teleportation be exclusively to snap points
   */
  set snapPointsOnly(e) {
    this._options.snapPointsOnly = e;
  }
  /**
   * Add a new mesh to the floor meshes array
   * @param mesh the mesh to use as floor mesh
   */
  addFloorMesh(e) {
    this._floorMeshes.push(e);
  }
  /**
   * Add a mesh to the list of meshes blocking the teleportation ray
   * @param mesh The mesh to add to the teleportation-blocking meshes
   */
  addBlockerMesh(e) {
    this._options.pickBlockerMeshes = this._options.pickBlockerMeshes || [], this._options.pickBlockerMeshes.push(e);
  }
  /**
   * Add a new snap-to point to fix teleportation to this position
   * @param newSnapPoint The new Snap-To point
   */
  addSnapPoint(e) {
    this._snapToPositions.push(e);
  }
  attach() {
    return super.attach() ? (this._currentTeleportationControllerId = "", this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (e) => {
      this._detachController(e.uniqueId);
    }), !0) : !1;
  }
  detach() {
    return super.detach() ? (Object.keys(this._controllers).forEach((e) => {
      this._detachController(e);
    }), this._setTargetMeshVisibility(!1), this._currentTeleportationControllerId = "", this._controllers = {}, !0) : !1;
  }
  dispose() {
    super.dispose(), this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.dispose(!1, !0);
  }
  /**
   * Remove a mesh from the floor meshes array
   * @param mesh the mesh to remove
   */
  removeFloorMesh(e) {
    const t = this._floorMeshes.indexOf(e);
    t !== -1 && this._floorMeshes.splice(t, 1);
  }
  /**
   * Remove a mesh from the blocker meshes array
   * @param mesh the mesh to remove
   */
  removeBlockerMesh(e) {
    this._options.pickBlockerMeshes = this._options.pickBlockerMeshes || [];
    const t = this._options.pickBlockerMeshes.indexOf(e);
    t !== -1 && this._options.pickBlockerMeshes.splice(t, 1);
  }
  /**
   * Remove a mesh from the floor meshes array using its name
   * @param name the mesh name to remove
   */
  removeFloorMeshByName(e) {
    const t = this._xrSessionManager.scene.getMeshByName(e);
    t && this.removeFloorMesh(t);
  }
  /**
   * This function will iterate through the array, searching for this point or equal to it. It will then remove it from the snap-to array
   * @param snapPointToRemove the point (or a clone of it) to be removed from the array
   * @returns was the point found and removed or not
   */
  removeSnapPoint(e) {
    let t = this._snapToPositions.indexOf(e);
    if (t === -1) {
      for (let r = 0; r < this._snapToPositions.length; ++r)
        if (this._snapToPositions[r].equals(e)) {
          t = r;
          break;
        }
    }
    return t !== -1 ? (this._snapToPositions.splice(t, 1), !0) : !1;
  }
  /**
   * This function sets a selection feature that will be disabled when
   * the forward ray is shown and will be reattached when hidden.
   * This is used to remove the selection rays when moving.
   * @param selectionFeature the feature to disable when forward movement is enabled
   */
  setSelectionFeature(e) {
    this._selectionFeature = e;
  }
  _onXRFrame(e) {
    const t = this._xrSessionManager.currentFrame, r = this._xrSessionManager.scene;
    if (!this.attach || !t)
      return;
    const n = this._options.teleportationTargetMesh;
    if (this._currentTeleportationControllerId) {
      if (!n)
        return;
      n.rotationQuaternion = n.rotationQuaternion || new Ze();
      const i = this._controllers[this._currentTeleportationControllerId];
      if (i && i.teleportationState.forward) {
        Ze.RotationYawPitchRollToRef(i.teleportationState.currentRotation + i.teleportationState.baseRotation, 0, 0, n.rotationQuaternion);
        let s = !1;
        if (i.xrController.getWorldPointerRayToRef(this._tmpRay), this.straightRayEnabled) {
          const a = r.pickWithRay(this._tmpRay, (f) => {
            if (this._options.pickBlockerMeshes && this._options.pickBlockerMeshes.indexOf(f) !== -1)
              return !0;
            const o = this._floorMeshes.indexOf(f);
            return o === -1 ? !1 : this._floorMeshes[o].absolutePosition.y < this._options.xrInput.xrCamera.globalPosition.y;
          });
          if (a && a.pickedMesh && this._options.pickBlockerMeshes && this._options.pickBlockerMeshes.indexOf(a.pickedMesh) !== -1) {
            i.teleportationState.blocked = !0, this._setTargetMeshVisibility(!1), this._showParabolicPath(a);
            return;
          } else
            a && a.pickedPoint && (i.teleportationState.blocked = !1, s = !0, this._setTargetMeshPosition(a), this._setTargetMeshVisibility(!0), this._showParabolicPath(a));
        }
        if (this.parabolicRayEnabled && !s) {
          const a = i.xrController.pointer.rotationQuaternion.toEulerAngles().x, f = 1 + (Math.PI / 2 - Math.abs(a)), o = this.parabolicCheckRadius * f;
          this._tmpRay.origin.addToRef(this._tmpRay.direction.scale(o * 2), this._tmpVector), this._tmpVector.y = this._tmpRay.origin.y, this._tmpRay.origin.addInPlace(this._tmpRay.direction.scale(o)), this._tmpVector.subtractToRef(this._tmpRay.origin, this._tmpRay.direction), this._tmpRay.direction.normalize();
          const d = r.pickWithRay(this._tmpRay, (v) => this._options.pickBlockerMeshes && this._options.pickBlockerMeshes.indexOf(v) !== -1 ? !0 : this._floorMeshes.indexOf(v) !== -1);
          if (d && d.pickedMesh && this._options.pickBlockerMeshes && this._options.pickBlockerMeshes.indexOf(d.pickedMesh) !== -1) {
            i.teleportationState.blocked = !0, this._setTargetMeshVisibility(!1), this._showParabolicPath(d);
            return;
          } else
            d && d.pickedPoint && (i.teleportationState.blocked = !1, s = !0, this._setTargetMeshPosition(d), this._setTargetMeshVisibility(!0), this._showParabolicPath(d));
        }
        this._setTargetMeshVisibility(s);
      } else
        this._setTargetMeshVisibility(!1);
    } else
      this._disposeBezierCurve(), this._setTargetMeshVisibility(!1);
  }
  _createDefaultTargetMesh() {
    this._options.defaultTargetMeshOptions = this._options.defaultTargetMeshOptions || {};
    const e = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Ds.DefaultUtilityLayer.utilityLayerScene : this._xrSessionManager.scene, t = Wm("teleportationTarget", { width: 2, height: 2, subdivisions: 2 }, e);
    if (t.isPickable = !1, this._options.defaultTargetMeshOptions.teleportationCircleMaterial)
      t.material = this._options.defaultTargetMeshOptions.teleportationCircleMaterial;
    else {
      const s = new Xp("teleportationPlaneDynamicTexture", 512, e, !0);
      s.hasAlpha = !0;
      const a = s.getContext(), f = 512 / 2, o = 512 / 2, d = 200;
      a.beginPath(), a.arc(f, o, d, 0, 2 * Math.PI, !1), a.fillStyle = this._options.defaultTargetMeshOptions.teleportationFillColor || "#444444", a.fill(), a.lineWidth = 10, a.strokeStyle = this._options.defaultTargetMeshOptions.teleportationBorderColor || "#FFFFFF", a.stroke(), a.closePath(), s.update();
      const v = new Wt("teleportationPlaneMaterial", e);
      v.diffuseTexture = s, t.material = v;
    }
    const r = Ag("torusTeleportation", {
      diameter: 0.75,
      thickness: 0.1,
      tessellation: 20
    }, e);
    if (r.isPickable = !1, r.parent = t, !this._options.defaultTargetMeshOptions.disableAnimation) {
      const i = new st("animationInnerCircle", "position.y", 30, st.ANIMATIONTYPE_FLOAT, st.ANIMATIONLOOPMODE_CYCLE), s = [];
      s.push({
        frame: 0,
        value: 0
      }), s.push({
        frame: 30,
        value: 0.4
      }), s.push({
        frame: 60,
        value: 0
      }), i.setKeys(s);
      const a = new $N();
      a.setEasingMode(u1.EASINGMODE_EASEINOUT), i.setEasingFunction(a), r.animations = [], r.animations.push(i), e.beginAnimation(r, 0, 60, !0);
    }
    const n = Ld("rotationCone", { diameterTop: 0, tessellation: 4 }, e);
    if (n.isPickable = !1, n.scaling.set(0.5, 0.12, 0.2), n.rotate(bf.X, Math.PI / 2), n.position.z = 0.6, n.parent = r, this._options.defaultTargetMeshOptions.torusArrowMaterial)
      r.material = this._options.defaultTargetMeshOptions.torusArrowMaterial, n.material = this._options.defaultTargetMeshOptions.torusArrowMaterial;
    else {
      const i = new Wt("torusConsMat", e);
      i.disableLighting = !!this._options.defaultTargetMeshOptions.disableLighting, i.disableLighting ? i.emissiveColor = new Ne(0.3, 0.3, 1) : i.diffuseColor = new Ne(0.3, 0.3, 1), i.alpha = 0.9, r.material = i, n.material = i, this._teleportationRingMaterial = i;
    }
    this._options.renderingGroupId !== void 0 && (t.renderingGroupId = this._options.renderingGroupId, r.renderingGroupId = this._options.renderingGroupId, n.renderingGroupId = this._options.renderingGroupId), this._options.teleportationTargetMesh = t, this._setTargetMeshVisibility(!1);
  }
  _detachController(e) {
    const t = this._controllers[e];
    t && (t.teleportationComponent && (t.onAxisChangedObserver && t.teleportationComponent.onAxisValueChangedObservable.remove(t.onAxisChangedObserver), t.onButtonChangedObserver && t.teleportationComponent.onButtonStateChangedObservable.remove(t.onButtonChangedObserver)), delete this._controllers[e]);
  }
  _findClosestSnapPointWithRadius(e, t = this._options.snapToPositionRadius || 0.8) {
    let r = null, n = Number.MAX_VALUE;
    if (this._snapToPositions.length) {
      const i = t * t;
      this._snapToPositions.forEach((s) => {
        const a = S.DistanceSquared(s, e);
        a <= i && a < n && (n = a, r = s);
      });
    }
    return r;
  }
  _setTargetMeshPosition(e) {
    const t = e.pickedPoint;
    if (!this._options.teleportationTargetMesh || !t)
      return;
    const r = this._findClosestSnapPointWithRadius(t);
    this._snappedToPoint = !!r, this.snapPointsOnly && !this._snappedToPoint && this._teleportationRingMaterial ? this._teleportationRingMaterial.diffuseColor.set(1, 0.3, 0.3) : this.snapPointsOnly && this._snappedToPoint && this._teleportationRingMaterial && this._teleportationRingMaterial.diffuseColor.set(0.3, 0.3, 1), this._options.teleportationTargetMesh.position.copyFrom(r || t), this._options.teleportationTargetMesh.position.y += 0.01, this.onTargetMeshPositionUpdatedObservable.notifyObservers(e);
  }
  _setTargetMeshVisibility(e, t) {
    this._options.teleportationTargetMesh && (this._options.teleportationTargetMesh.isVisible === e && !t || (this._options.teleportationTargetMesh.isVisible = e, this._options.teleportationTargetMesh.getChildren(void 0, !1).forEach((r) => {
      r.isVisible = e;
    }), e ? this._selectionFeature && this._selectionFeature.detach() : (this._quadraticBezierCurve && (this._quadraticBezierCurve.dispose(), this._quadraticBezierCurve = null), this._selectionFeature && this._selectionFeature.attach())));
  }
  _disposeBezierCurve() {
    this._quadraticBezierCurve && (this._quadraticBezierCurve.dispose(), this._quadraticBezierCurve = null);
  }
  _showParabolicPath(e) {
    if (!e.pickedPoint || !this._currentTeleportationControllerId)
      return;
    const t = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Ds.DefaultUtilityLayer.utilityLayerScene : this._xrSessionManager.scene, r = this._controllers[this._currentTeleportationControllerId], n = j0.CreateQuadraticBezier(r.xrController.pointer.absolutePosition, e.ray.origin, e.pickedPoint, 25), i = r.teleportationState.blocked ? this._blockedRayColor : void 0, s = new Array(26).fill(i || this._cachedColor4White);
    this._options.generateRayPathMesh ? this._quadraticBezierCurve = this._options.generateRayPathMesh(n.getPoints(), e) : this._quadraticBezierCurve = ka("teleportation path line", { points: n.getPoints(), instance: this._quadraticBezierCurve, updatable: !0, colors: s }, t), this._quadraticBezierCurve.isPickable = !1, this._options.renderingGroupId !== void 0 && (this._quadraticBezierCurve.renderingGroupId = this._options.renderingGroupId);
  }
  _teleportForward(e) {
    const t = this._controllers[e];
    if (!(!t || !t.teleportationState.forward || !this.teleportationEnabled) && (t.teleportationState.forward = !1, this._currentTeleportationControllerId = "", !(this.snapPointsOnly && !this._snappedToPoint))) {
      if (this.skipNextTeleportation) {
        this.skipNextTeleportation = !1;
        return;
      }
      if (this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.isVisible) {
        const r = this._options.xrInput.xrCamera.realWorldHeight;
        this._options.xrInput.xrCamera.onBeforeCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position), this._options.xrInput.xrCamera.position.copyFrom(this._options.teleportationTargetMesh.position), this._options.xrInput.xrCamera.position.y += r, Ze.FromEulerAngles(0, t.teleportationState.currentRotation - (this._xrSessionManager.scene.useRightHandedSystem ? Math.PI : 0), 0).multiplyToRef(this._options.xrInput.xrCamera.rotationQuaternion, this._options.xrInput.xrCamera.rotationQuaternion), this._options.xrInput.xrCamera.onAfterCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position);
      }
    }
  }
}
nm.Name = Gi.TELEPORTATION;
nm.Version = 1;
So.AddWebXRFeature(nm.Name, (A, e) => () => new nm(A, e), nm.Version, !0);
class P3e {
}
class vy {
  constructor() {
  }
  /**
   * Creates the default xr experience
   * @param scene scene
   * @param options options for basic configuration
   * @returns resulting WebXRDefaultExperience
   */
  static CreateAsync(e, t = {}) {
    const r = new vy();
    if (e.onDisposeObservable.addOnce(() => {
      r.dispose();
    }), !t.disableDefaultUI) {
      const n = Object.assign({ renderTarget: r.renderTarget }, t.uiOptions || {});
      t.optionalFeatures && (typeof t.optionalFeatures == "boolean" ? n.optionalFeatures = ["hit-test", "anchors", "plane-detection", "hand-tracking"] : n.optionalFeatures = t.optionalFeatures), r.enterExitUI = new dy(e, n);
    }
    return Ay.CreateAsync(e).then((n) => {
      if (r.baseExperience = n, t.ignoreNativeCameraTransformation && (r.baseExperience.camera.compensateOnFirstFrame = !1), r.input = new Ote(n.sessionManager, n.camera, Object.assign({ controllerOptions: {
        renderingGroupId: t.renderingGroupId
      } }, t.inputOptions || {})), !t.disablePointerSelection) {
        const i = Object.assign(Object.assign({}, t.pointerSelectionOptions), { xrInput: r.input, renderingGroupId: t.renderingGroupId });
        r.pointerSelection = r.baseExperience.featuresManager.enableFeature(ig.Name, t.useStablePlugins ? "stable" : "latest", i), t.disableTeleportation || (r.teleportation = r.baseExperience.featuresManager.enableFeature(nm.Name, t.useStablePlugins ? "stable" : "latest", Object.assign({ floorMeshes: t.floorMeshes, xrInput: r.input, renderingGroupId: t.renderingGroupId }, t.teleportationOptions)), r.teleportation.setSelectionFeature(r.pointerSelection));
      }
      if (t.disableNearInteraction || (r.nearInteraction = r.baseExperience.featuresManager.enableFeature(sg.Name, t.useStablePlugins ? "stable" : "latest", Object.assign({ xrInput: r.input, farInteractionFeature: r.pointerSelection, renderingGroupId: t.renderingGroupId, useUtilityLayer: !0, enableNearInteractionOnAllControllers: !0 }, t.nearInteractionOptions))), r.renderTarget = r.baseExperience.sessionManager.getWebXRRenderTarget(t.outputCanvasOptions), !t.disableDefaultUI)
        return r.enterExitUI.setHelperAsync(r.baseExperience, r.renderTarget);
    }).then(() => r).catch((n) => (Se.Error("Error initializing XR"), Se.Error(n), r));
  }
  /**
   * Disposes of the experience helper
   */
  dispose() {
    this.baseExperience && this.baseExperience.dispose(), this.input && this.input.dispose(), this.enterExitUI && this.enterExitUI.dispose(), this.renderTarget && this.renderTarget.dispose();
  }
}
var c3e = !0;
sr.prototype.createDefaultLight = function(A = !1) {
  if (A && this.lights)
    for (let e = 0; e < this.lights.length; e++)
      this.lights[e].dispose();
  this.lights.length === 0 && new y0("default light", S.Up(), this);
};
sr.prototype.createDefaultCamera = function(A = !1, e = !1, t = !1) {
  if (e && this.activeCamera && (this.activeCamera.dispose(), this.activeCamera = null), !this.activeCamera) {
    const r = this.getWorldExtends((f) => f.isVisible && f.isEnabled()), n = r.max.subtract(r.min), i = r.min.add(n.scale(0.5));
    let s, a = n.length() * 1.5;
    if (isFinite(a) || (a = 1, i.copyFromFloats(0, 0, 0)), A) {
      const f = new ps("default camera", -(Math.PI / 2), Math.PI / 2, a, i, this);
      f.lowerRadiusLimit = a * 0.01, f.wheelPrecision = 100 / a, s = f;
    } else {
      const f = new SA("default camera", new S(i.x, i.y, -a), this);
      f.setTarget(i), s = f;
    }
    s.minZ = a * 0.01, s.maxZ = a * 1e3, s.speed = a * 0.2, this.activeCamera = s, t && s.attachControl();
  }
};
sr.prototype.createDefaultCameraOrLight = function(A = !1, e = !1, t = !1) {
  this.createDefaultLight(e), this.createDefaultCamera(A, e, t);
};
sr.prototype.createDefaultSkybox = function(A, e = !1, t = 1e3, r = 0, n = !0) {
  if (!A)
    return Se.Warn("Can not create default skybox without environment texture."), null;
  n && A && (this.environmentTexture = A);
  const i = k0("hdrSkyBox", { size: t }, this);
  if (e) {
    const s = new mr("skyBox", this);
    s.backFaceCulling = !1, s.reflectionTexture = A.clone(), s.reflectionTexture && (s.reflectionTexture.coordinatesMode = We.SKYBOX_MODE), s.microSurface = 1 - r, s.disableLighting = !0, s.twoSidedLighting = !0, i.material = s;
  } else {
    const s = new Wt("skyBox", this);
    s.backFaceCulling = !1, s.reflectionTexture = A.clone(), s.reflectionTexture && (s.reflectionTexture.coordinatesMode = We.SKYBOX_MODE), s.disableLighting = !0, i.material = s;
  }
  return i.isPickable = !1, i.infiniteDistance = !0, i.ignoreCameraMaxZ = !0, i;
};
sr.prototype.createDefaultEnvironment = function(A) {
  return gD ? new gD(A, this) : null;
};
sr.prototype.createDefaultVRExperience = function(A = {}) {
  return new lm(this, A);
};
sr.prototype.createDefaultXRExperienceAsync = function(A = {}) {
  return vy.CreateAsync(this, A).then((e) => e);
};
function QG(A) {
  for (; A.firstChild; )
    A.removeChild(A.firstChild);
  A.srcObject = null, A.src = "", A.removeAttribute("src");
}
class xc extends We {
  /**
   * Event triggered when a dom action is required by the user to play the video.
   * This happens due to recent changes in browser policies preventing video to auto start.
   */
  get onUserActionRequestedObservable() {
    return this._onUserActionRequestedObservable || (this._onUserActionRequestedObservable = new Oe()), this._onUserActionRequestedObservable;
  }
  _processError(e) {
    this._errorFound = !0, this._onError ? this._onError(e == null ? void 0 : e.message) : Se.Error(e == null ? void 0 : e.message);
  }
  _handlePlay() {
    this._errorFound = !1, this.video.play().catch((e) => {
      if ((e == null ? void 0 : e.name) === "NotAllowedError") {
        if (this._onUserActionRequestedObservable && this._onUserActionRequestedObservable.hasObservers()) {
          this._onUserActionRequestedObservable.notifyObservers(this);
          return;
        } else if (!this.video.muted) {
          Se.Warn("Unable to autoplay a video with sound. Trying again with muted turned true"), this.video.muted = !0, this._errorFound = !1, this.video.play().catch((t) => {
            this._processError(t);
          });
          return;
        }
      }
      this._processError(e);
    });
  }
  /**
   * Creates a video texture.
   * If you want to display a video in your scene, this is the special texture for that.
   * This special texture works similar to other textures, with the exception of a few parameters.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/videoTexture
   * @param name optional name, will detect from video source, if not defined
   * @param src can be used to provide an url, array of urls or an already setup HTML video element.
   * @param scene is obviously the current scene.
   * @param generateMipMaps can be used to turn on mipmaps (Can be expensive for videoTextures because they are often updated).
   * @param invertY is false by default but can be used to invert video on Y axis
   * @param samplingMode controls the sampling method and is set to TRILINEAR_SAMPLINGMODE by default
   * @param settings allows finer control over video usage
   * @param onError defines a callback triggered when an error occurred during the loading session
   * @param format defines the texture format to use (Engine.TEXTUREFORMAT_RGBA by default)
   */
  constructor(e, t, r, n = !1, i = !1, s = We.TRILINEAR_SAMPLINGMODE, a = {}, f, o = 5) {
    var d, v;
    super(null, r, !n, i), this._onUserActionRequestedObservable = null, this._stillImageCaptured = !1, this._displayingPosterTexture = !1, this._frameId = -1, this._currentSrc = null, this._errorFound = !1, this.isVideo = !0, this._resizeInternalTexture = () => {
      var l;
      this._texture != null && this._texture.dispose(), !this._getEngine().needPOTTextures || ye.IsExponentOfTwo(this.video.videoWidth) && ye.IsExponentOfTwo(this.video.videoHeight) ? (this.wrapU = We.WRAP_ADDRESSMODE, this.wrapV = We.WRAP_ADDRESSMODE) : (this.wrapU = We.CLAMP_ADDRESSMODE, this.wrapV = We.CLAMP_ADDRESSMODE, this._generateMipMaps = !1), this._texture = this._getEngine().createDynamicTexture(this.video.videoWidth, this.video.videoHeight, this._generateMipMaps, this.samplingMode), this._texture.format = (l = this._format) !== null && l !== void 0 ? l : 5, this._frameId = -1, this._updateInternalTexture();
    }, this._createInternalTexture = () => {
      if (this._texture != null)
        if (this._displayingPosterTexture)
          this._displayingPosterTexture = !1;
        else
          return;
      if (this.video.addEventListener("resize", this._resizeInternalTexture), this._resizeInternalTexture(), !this.video.autoplay && !this._settings.poster && !this._settings.independentVideoSource) {
        const l = this.video.onplaying, P = this.video.muted;
        this.video.muted = !0, this.video.onplaying = () => {
          this.video.muted = P, this.video.onplaying = l, this._updateInternalTexture(), this._errorFound || this.video.pause(), this.onLoadObservable.hasObservers() && this.onLoadObservable.notifyObservers(this);
        }, this._handlePlay();
      } else
        this._updateInternalTexture(), this.onLoadObservable.hasObservers() && this.onLoadObservable.notifyObservers(this);
    }, this._reset = () => {
      this._texture != null && (this._displayingPosterTexture || (this._texture.dispose(), this._texture = null));
    }, this._updateInternalTexture = () => {
      if (this._texture == null || this.video.readyState < this.video.HAVE_CURRENT_DATA || this._displayingPosterTexture)
        return;
      const l = this.getScene().getFrameId();
      this._frameId !== l && (this._frameId = l, this._getEngine().updateVideoTexture(this._texture, this._externalTexture ? this._externalTexture : this.video, this._invertY));
    }, this._settings = Object.assign({ autoPlay: !0, loop: !0, autoUpdateTexture: !0 }, a), this._onError = f, this._generateMipMaps = n, this._initialSamplingMode = s, this.autoUpdateTexture = this._settings.autoUpdateTexture, this._currentSrc = t, this.name = e || this._getName(t), this.video = this._getVideo(t), this._externalTexture = (v = (d = this._engine) === null || d === void 0 ? void 0 : d.createExternalTexture(this.video)) !== null && v !== void 0 ? v : null, this._settings.independentVideoSource || (this._settings.poster && (this.video.poster = this._settings.poster), this._settings.autoPlay !== void 0 && (this.video.autoplay = this._settings.autoPlay), this._settings.loop !== void 0 && (this.video.loop = this._settings.loop), this._settings.muted !== void 0 && (this.video.muted = this._settings.muted), this.video.setAttribute("playsinline", ""), this.video.addEventListener("paused", this._updateInternalTexture), this.video.addEventListener("seeked", this._updateInternalTexture), this.video.addEventListener("emptied", this._reset), this._settings.autoPlay && this._handlePlay()), this._createInternalTextureOnEvent = this._settings.poster && !this._settings.autoPlay ? "play" : "canplay", this.video.addEventListener(this._createInternalTextureOnEvent, this._createInternalTexture), this._format = o;
    const u = this.video.readyState >= this.video.HAVE_CURRENT_DATA;
    this._settings.poster && (!this._settings.autoPlay || !u) ? (this._texture = this._getEngine().createTexture(this._settings.poster, !1, !this.invertY, r), this._displayingPosterTexture = !0) : u && this._createInternalTexture();
  }
  /**
   * Get the current class name of the video texture useful for serialization or dynamic coding.
   * @returns "VideoTexture"
   */
  getClassName() {
    return "VideoTexture";
  }
  _getName(e) {
    return e instanceof HTMLVideoElement ? e.currentSrc : typeof e == "object" ? e.toString() : e;
  }
  _getVideo(e) {
    if (e.isNative)
      return e;
    if (e instanceof HTMLVideoElement)
      return ye.SetCorsBehavior(e.currentSrc, e), e;
    const t = document.createElement("video");
    return typeof e == "string" ? (ye.SetCorsBehavior(e, t), t.src = e) : (ye.SetCorsBehavior(e[0], t), e.forEach((r) => {
      const n = document.createElement("source");
      n.src = r, t.appendChild(n);
    })), this.onDisposeObservable.addOnce(() => {
      QG(t);
    }), t;
  }
  /**
   * @internal Internal method to initiate `update`.
   */
  _rebuild() {
    this.update();
  }
  /**
   * Update Texture in the `auto` mode. Does not do anything if `settings.autoUpdateTexture` is false.
   */
  update() {
    this.autoUpdateTexture && this.updateTexture(!0);
  }
  /**
   * Update Texture in `manual` mode. Does not do anything if not visible or paused.
   * @param isVisible Visibility state, detected by user using `scene.getActiveMeshes()` or otherwise.
   */
  updateTexture(e) {
    e && (this.video.paused && this._stillImageCaptured || (this._stillImageCaptured = !0, this._updateInternalTexture()));
  }
  /**
   * Get the underlying external texture (if supported by the current engine, else null)
   */
  get externalTexture() {
    return this._externalTexture;
  }
  /**
   * Change video content. Changing video instance or setting multiple urls (as in constructor) is not supported.
   * @param url New url.
   */
  updateURL(e) {
    this.video.src = e, this._currentSrc = e;
  }
  /**
   * Clones the texture.
   * @returns the cloned texture
   */
  clone() {
    return new xc(this.name, this._currentSrc, this.getScene(), this._generateMipMaps, this.invertY, this.samplingMode, this._settings);
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
    var e;
    super.dispose(), this._currentSrc = null, this._onUserActionRequestedObservable && (this._onUserActionRequestedObservable.clear(), this._onUserActionRequestedObservable = null), this.video.removeEventListener(this._createInternalTextureOnEvent, this._createInternalTexture), this._settings.independentVideoSource || (this.video.removeEventListener("paused", this._updateInternalTexture), this.video.removeEventListener("seeked", this._updateInternalTexture), this.video.removeEventListener("emptied", this._reset), this.video.removeEventListener("resize", this._resizeInternalTexture), this.video.pause()), (e = this._externalTexture) === null || e === void 0 || e.dispose();
  }
  /**
   * Creates a video texture straight from a stream.
   * @param scene Define the scene the texture should be created in
   * @param stream Define the stream the texture should be created from
   * @param constraints video constraints
   * @param invertY Defines if the video should be stored with invert Y set to true (true by default)
   * @returns The created video texture as a promise
   */
  static CreateFromStreamAsync(e, t, r, n = !0) {
    const i = e.getEngine().createVideoElement(r);
    return e.getEngine()._badOS && (document.body.appendChild(i), i.style.transform = "scale(0.0001, 0.0001)", i.style.opacity = "0", i.style.position = "fixed", i.style.bottom = "0px", i.style.right = "0px"), i.setAttribute("autoplay", ""), i.setAttribute("muted", "true"), i.setAttribute("playsinline", ""), i.muted = !0, i.isNative || (i.mozSrcObject !== void 0 ? i.mozSrcObject = t : typeof i.srcObject == "object" ? i.srcObject = t : i.src = window.URL && window.URL.createObjectURL(t)), new Promise((s) => {
      const a = () => {
        const f = new xc("video", i, e, !0, n, void 0, void 0, void 0, 4);
        e.getEngine()._badOS && f.onDisposeObservable.addOnce(() => {
          i.remove();
        }), f.onDisposeObservable.addOnce(() => {
          QG(i);
        }), s(f), i.removeEventListener("playing", a);
      };
      i.addEventListener("playing", a), i.play();
    });
  }
  /**
   * Creates a video texture straight from your WebCam video feed.
   * @param scene Define the scene the texture should be created in
   * @param constraints Define the constraints to use to create the web cam feed from WebRTC
   * @param audioConstaints Define the audio constraints to use to create the web cam feed from WebRTC
   * @param invertY Defines if the video should be stored with invert Y set to true (true by default)
   * @returns The created video texture as a promise
   */
  static async CreateFromWebCamAsync(e, t, r = !1, n = !0) {
    if (navigator.mediaDevices) {
      const i = await navigator.mediaDevices.getUserMedia({
        video: t,
        audio: r
      }), s = await this.CreateFromStreamAsync(e, i, t, n);
      return s.onDisposeObservable.addOnce(() => {
        i.getTracks().forEach((a) => {
          a.stop();
        });
      }), s;
    }
    return Promise.reject("No support for userMedia on this device");
  }
  /**
   * Creates a video texture straight from your WebCam video feed.
   * @param scene Defines the scene the texture should be created in
   * @param onReady Defines a callback to triggered once the texture will be ready
   * @param constraints Defines the constraints to use to create the web cam feed from WebRTC
   * @param audioConstaints Defines the audio constraints to use to create the web cam feed from WebRTC
   * @param invertY Defines if the video should be stored with invert Y set to true (true by default)
   */
  static CreateFromWebCam(e, t, r, n = !1, i = !0) {
    this.CreateFromWebCamAsync(e, r, n, i).then(function(s) {
      t && t(s);
    }).catch(function(s) {
      Se.Error(s.name);
    });
  }
}
C([
  M("settings")
], xc.prototype, "_settings", void 0);
C([
  M("src")
], xc.prototype, "_currentSrc", void 0);
C([
  M()
], xc.prototype, "isVideo", void 0);
We._CreateVideoTexture = (A, e, t, r = !1, n = !1, i = We.TRILINEAR_SAMPLINGMODE, s = {}, a, f = 5) => new xc(A, e, t, r, n, i, s, a, f);
Ue("BABYLON.VideoTexture", xc);
class uy extends Ou {
  /**
   * Get the video texture associated with this video dome
   */
  get videoTexture() {
    return this._texture;
  }
  /**
   * Get the video mode of this dome
   */
  get videoMode() {
    return this.textureMode;
  }
  /**
   * Set the video mode of this dome.
   * @see textureMode
   */
  set videoMode(e) {
    this.textureMode = e;
  }
  _initTexture(e, t, r) {
    const n = { loop: r.loop, autoPlay: r.autoPlay, autoUpdateTexture: !0, poster: r.poster }, i = new xc((this.name || "videoDome") + "_texture", e, t, r.generateMipMaps, this._useDirectMapping, We.TRILINEAR_SAMPLINGMODE, n);
    return r.clickToPlay && (this._pointerObserver = t.onPointerObservable.add((s) => {
      var a;
      ((a = s.pickInfo) === null || a === void 0 ? void 0 : a.pickedMesh) === this.mesh && this._texture.video.play();
    }, ir.POINTERDOWN)), this._textureObserver = i.onLoadObservable.add(() => {
      this.onLoadObservable.notifyObservers();
    }), i;
  }
  /**
   * Releases resources associated with this node.
   * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
   * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
   */
  dispose(e, t = !1) {
    this._texture.onLoadObservable.remove(this._textureObserver), this._scene.onPointerObservable.remove(this._pointerObserver), super.dispose(e, t);
  }
}
uy.MODE_MONOSCOPIC = Ou.MODE_MONOSCOPIC;
uy.MODE_TOPBOTTOM = Ou.MODE_TOPBOTTOM;
uy.MODE_SIDEBYSIDE = Ou.MODE_SIDEBYSIDE;
class Ete {
  // Properties
  /**
   * Gets the perf counter used for GPU frame time
   */
  get gpuFrameTimeCounter() {
    return this.engine.getGPUFrameTimeCounter();
  }
  /**
   * Gets the GPU frame time capture status
   */
  get captureGPUFrameTime() {
    return this._captureGPUFrameTime;
  }
  /**
   * Enable or disable the GPU frame time capture
   */
  set captureGPUFrameTime(e) {
    e !== this._captureGPUFrameTime && (this._captureGPUFrameTime = e, this.engine.captureGPUFrameTime(e));
  }
  /**
   * Gets the perf counter used for shader compilation time
   */
  get shaderCompilationTimeCounter() {
    return this._shaderCompilationTime;
  }
  /**
   * Gets the shader compilation time capture status
   */
  get captureShaderCompilationTime() {
    return this._captureShaderCompilationTime;
  }
  /**
   * Enable or disable the shader compilation time capture
   */
  set captureShaderCompilationTime(e) {
    e !== this._captureShaderCompilationTime && (this._captureShaderCompilationTime = e, e ? (this._onBeforeShaderCompilationObserver = this.engine.onBeforeShaderCompilationObservable.add(() => {
      this._shaderCompilationTime.fetchNewFrame(), this._shaderCompilationTime.beginMonitoring();
    }), this._onAfterShaderCompilationObserver = this.engine.onAfterShaderCompilationObservable.add(() => {
      this._shaderCompilationTime.endMonitoring();
    })) : (this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver), this._onBeforeShaderCompilationObserver = null, this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver), this._onAfterShaderCompilationObserver = null));
  }
  /**
   * Instantiates a new engine instrumentation.
   * This class can be used to get instrumentation data from a Babylon engine
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
   * @param engine Defines the engine to instrument
   */
  constructor(e) {
    this.engine = e, this._captureGPUFrameTime = !1, this._captureShaderCompilationTime = !1, this._shaderCompilationTime = new v9(), this._onBeginFrameObserver = null, this._onEndFrameObserver = null, this._onBeforeShaderCompilationObserver = null, this._onAfterShaderCompilationObserver = null;
  }
  /**
   * Dispose and release associated resources.
   */
  dispose() {
    this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver), this._onBeginFrameObserver = null, this.engine.onEndFrameObservable.remove(this._onEndFrameObserver), this._onEndFrameObserver = null, this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver), this._onBeforeShaderCompilationObserver = null, this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver), this._onAfterShaderCompilationObserver = null, this.engine = null;
  }
}
class Fte {
  // Properties
  /**
   * Gets the perf counter used for active meshes evaluation time
   */
  get activeMeshesEvaluationTimeCounter() {
    return this._activeMeshesEvaluationTime;
  }
  /**
   * Gets the active meshes evaluation time capture status
   */
  get captureActiveMeshesEvaluationTime() {
    return this._captureActiveMeshesEvaluationTime;
  }
  /**
   * Enable or disable the active meshes evaluation time capture
   */
  set captureActiveMeshesEvaluationTime(e) {
    e !== this._captureActiveMeshesEvaluationTime && (this._captureActiveMeshesEvaluationTime = e, e ? (this._onBeforeActiveMeshesEvaluationObserver = this.scene.onBeforeActiveMeshesEvaluationObservable.add(() => {
      ye.StartPerformanceCounter("Active meshes evaluation"), this._activeMeshesEvaluationTime.beginMonitoring();
    }), this._onAfterActiveMeshesEvaluationObserver = this.scene.onAfterActiveMeshesEvaluationObservable.add(() => {
      ye.EndPerformanceCounter("Active meshes evaluation"), this._activeMeshesEvaluationTime.endMonitoring(!1);
    })) : (this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver), this._onBeforeActiveMeshesEvaluationObserver = null, this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver), this._onAfterActiveMeshesEvaluationObserver = null));
  }
  /**
   * Gets the perf counter used for render targets render time
   */
  get renderTargetsRenderTimeCounter() {
    return this._renderTargetsRenderTime;
  }
  /**
   * Gets the render targets render time capture status
   */
  get captureRenderTargetsRenderTime() {
    return this._captureRenderTargetsRenderTime;
  }
  /**
   * Enable or disable the render targets render time capture
   */
  set captureRenderTargetsRenderTime(e) {
    e !== this._captureRenderTargetsRenderTime && (this._captureRenderTargetsRenderTime = e, e ? (this._onBeforeRenderTargetsRenderObserver = this.scene.onBeforeRenderTargetsRenderObservable.add(() => {
      ye.StartPerformanceCounter("Render targets rendering"), this._renderTargetsRenderTime.beginMonitoring();
    }), this._onAfterRenderTargetsRenderObserver = this.scene.onAfterRenderTargetsRenderObservable.add(() => {
      ye.EndPerformanceCounter("Render targets rendering"), this._renderTargetsRenderTime.endMonitoring(!1);
    })) : (this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver), this._onBeforeRenderTargetsRenderObserver = null, this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver), this._onAfterRenderTargetsRenderObserver = null));
  }
  /**
   * Gets the perf counter used for particles render time
   */
  get particlesRenderTimeCounter() {
    return this._particlesRenderTime;
  }
  /**
   * Gets the particles render time capture status
   */
  get captureParticlesRenderTime() {
    return this._captureParticlesRenderTime;
  }
  /**
   * Enable or disable the particles render time capture
   */
  set captureParticlesRenderTime(e) {
    e !== this._captureParticlesRenderTime && (this._captureParticlesRenderTime = e, e ? (this._onBeforeParticlesRenderingObserver = this.scene.onBeforeParticlesRenderingObservable.add(() => {
      ye.StartPerformanceCounter("Particles"), this._particlesRenderTime.beginMonitoring();
    }), this._onAfterParticlesRenderingObserver = this.scene.onAfterParticlesRenderingObservable.add(() => {
      ye.EndPerformanceCounter("Particles"), this._particlesRenderTime.endMonitoring(!1);
    })) : (this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver), this._onBeforeParticlesRenderingObserver = null, this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver), this._onAfterParticlesRenderingObserver = null));
  }
  /**
   * Gets the perf counter used for sprites render time
   */
  get spritesRenderTimeCounter() {
    return this._spritesRenderTime;
  }
  /**
   * Gets the sprites render time capture status
   */
  get captureSpritesRenderTime() {
    return this._captureSpritesRenderTime;
  }
  /**
   * Enable or disable the sprites render time capture
   */
  set captureSpritesRenderTime(e) {
    e !== this._captureSpritesRenderTime && (this._captureSpritesRenderTime = e, this.scene.spriteManagers && (e ? (this._onBeforeSpritesRenderingObserver = this.scene.onBeforeSpritesRenderingObservable.add(() => {
      ye.StartPerformanceCounter("Sprites"), this._spritesRenderTime.beginMonitoring();
    }), this._onAfterSpritesRenderingObserver = this.scene.onAfterSpritesRenderingObservable.add(() => {
      ye.EndPerformanceCounter("Sprites"), this._spritesRenderTime.endMonitoring(!1);
    })) : (this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver), this._onBeforeSpritesRenderingObserver = null, this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver), this._onAfterSpritesRenderingObserver = null)));
  }
  /**
   * Gets the perf counter used for physics time
   */
  get physicsTimeCounter() {
    return this._physicsTime;
  }
  /**
   * Gets the physics time capture status
   */
  get capturePhysicsTime() {
    return this._capturePhysicsTime;
  }
  /**
   * Enable or disable the physics time capture
   */
  set capturePhysicsTime(e) {
    e !== this._capturePhysicsTime && this.scene.onBeforePhysicsObservable && (this._capturePhysicsTime = e, e ? (this._onBeforePhysicsObserver = this.scene.onBeforePhysicsObservable.add(() => {
      ye.StartPerformanceCounter("Physics"), this._physicsTime.beginMonitoring();
    }), this._onAfterPhysicsObserver = this.scene.onAfterPhysicsObservable.add(() => {
      ye.EndPerformanceCounter("Physics"), this._physicsTime.endMonitoring();
    })) : (this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver), this._onBeforePhysicsObserver = null, this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver), this._onAfterPhysicsObserver = null));
  }
  /**
   * Gets the perf counter used for animations time
   */
  get animationsTimeCounter() {
    return this._animationsTime;
  }
  /**
   * Gets the animations time capture status
   */
  get captureAnimationsTime() {
    return this._captureAnimationsTime;
  }
  /**
   * Enable or disable the animations time capture
   */
  set captureAnimationsTime(e) {
    e !== this._captureAnimationsTime && (this._captureAnimationsTime = e, e ? this._onAfterAnimationsObserver = this.scene.onAfterAnimationsObservable.add(() => {
      this._animationsTime.endMonitoring();
    }) : (this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver), this._onAfterAnimationsObserver = null));
  }
  /**
   * Gets the perf counter used for frame time capture
   */
  get frameTimeCounter() {
    return this._frameTime;
  }
  /**
   * Gets the frame time capture status
   */
  get captureFrameTime() {
    return this._captureFrameTime;
  }
  /**
   * Enable or disable the frame time capture
   */
  set captureFrameTime(e) {
    this._captureFrameTime = e;
  }
  /**
   * Gets the perf counter used for inter-frames time capture
   */
  get interFrameTimeCounter() {
    return this._interFrameTime;
  }
  /**
   * Gets the inter-frames time capture status
   */
  get captureInterFrameTime() {
    return this._captureInterFrameTime;
  }
  /**
   * Enable or disable the inter-frames time capture
   */
  set captureInterFrameTime(e) {
    this._captureInterFrameTime = e;
  }
  /**
   * Gets the perf counter used for render time capture
   */
  get renderTimeCounter() {
    return this._renderTime;
  }
  /**
   * Gets the render time capture status
   */
  get captureRenderTime() {
    return this._captureRenderTime;
  }
  /**
   * Enable or disable the render time capture
   */
  set captureRenderTime(e) {
    e !== this._captureRenderTime && (this._captureRenderTime = e, e ? (this._onBeforeDrawPhaseObserver = this.scene.onBeforeDrawPhaseObservable.add(() => {
      this._renderTime.beginMonitoring(), ye.StartPerformanceCounter("Main render");
    }), this._onAfterDrawPhaseObserver = this.scene.onAfterDrawPhaseObservable.add(() => {
      this._renderTime.endMonitoring(!1), ye.EndPerformanceCounter("Main render");
    })) : (this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver), this._onBeforeDrawPhaseObserver = null, this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver), this._onAfterDrawPhaseObserver = null));
  }
  /**
   * Gets the perf counter used for camera render time capture
   */
  get cameraRenderTimeCounter() {
    return this._cameraRenderTime;
  }
  /**
   * Gets the camera render time capture status
   */
  get captureCameraRenderTime() {
    return this._captureCameraRenderTime;
  }
  /**
   * Enable or disable the camera render time capture
   */
  set captureCameraRenderTime(e) {
    e !== this._captureCameraRenderTime && (this._captureCameraRenderTime = e, e ? (this._onBeforeCameraRenderObserver = this.scene.onBeforeCameraRenderObservable.add((t) => {
      this._cameraRenderTime.beginMonitoring(), ye.StartPerformanceCounter(`Rendering camera ${t.name}`);
    }), this._onAfterCameraRenderObserver = this.scene.onAfterCameraRenderObservable.add((t) => {
      this._cameraRenderTime.endMonitoring(!1), ye.EndPerformanceCounter(`Rendering camera ${t.name}`);
    })) : (this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = null, this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = null));
  }
  /**
   * Gets the perf counter used for draw calls
   */
  get drawCallsCounter() {
    return this.scene.getEngine()._drawCalls;
  }
  /**
   * Instantiates a new scene instrumentation.
   * This class can be used to get instrumentation data from a Babylon engine
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#sceneinstrumentation
   * @param scene Defines the scene to instrument
   */
  constructor(e) {
    this.scene = e, this._captureActiveMeshesEvaluationTime = !1, this._activeMeshesEvaluationTime = new v9(), this._captureRenderTargetsRenderTime = !1, this._renderTargetsRenderTime = new v9(), this._captureFrameTime = !1, this._frameTime = new v9(), this._captureRenderTime = !1, this._renderTime = new v9(), this._captureInterFrameTime = !1, this._interFrameTime = new v9(), this._captureParticlesRenderTime = !1, this._particlesRenderTime = new v9(), this._captureSpritesRenderTime = !1, this._spritesRenderTime = new v9(), this._capturePhysicsTime = !1, this._physicsTime = new v9(), this._captureAnimationsTime = !1, this._animationsTime = new v9(), this._captureCameraRenderTime = !1, this._cameraRenderTime = new v9(), this._onBeforeActiveMeshesEvaluationObserver = null, this._onAfterActiveMeshesEvaluationObserver = null, this._onBeforeRenderTargetsRenderObserver = null, this._onAfterRenderTargetsRenderObserver = null, this._onAfterRenderObserver = null, this._onBeforeDrawPhaseObserver = null, this._onAfterDrawPhaseObserver = null, this._onBeforeAnimationsObserver = null, this._onBeforeParticlesRenderingObserver = null, this._onAfterParticlesRenderingObserver = null, this._onBeforeSpritesRenderingObserver = null, this._onAfterSpritesRenderingObserver = null, this._onBeforePhysicsObserver = null, this._onAfterPhysicsObserver = null, this._onAfterAnimationsObserver = null, this._onBeforeCameraRenderObserver = null, this._onAfterCameraRenderObserver = null, this._onBeforeAnimationsObserver = e.onBeforeAnimationsObservable.add(() => {
      this._captureActiveMeshesEvaluationTime && this._activeMeshesEvaluationTime.fetchNewFrame(), this._captureRenderTargetsRenderTime && this._renderTargetsRenderTime.fetchNewFrame(), this._captureFrameTime && (ye.StartPerformanceCounter("Scene rendering"), this._frameTime.beginMonitoring()), this._captureInterFrameTime && this._interFrameTime.endMonitoring(), this._captureParticlesRenderTime && this._particlesRenderTime.fetchNewFrame(), this._captureSpritesRenderTime && this._spritesRenderTime.fetchNewFrame(), this._captureAnimationsTime && this._animationsTime.beginMonitoring(), this._captureRenderTime && this._renderTime.fetchNewFrame(), this._captureCameraRenderTime && this._cameraRenderTime.fetchNewFrame(), this.scene.getEngine()._drawCalls.fetchNewFrame();
    }), this._onAfterRenderObserver = e.onAfterRenderObservable.add(() => {
      this._captureFrameTime && (ye.EndPerformanceCounter("Scene rendering"), this._frameTime.endMonitoring()), this._captureRenderTime && this._renderTime.endMonitoring(!1), this._captureInterFrameTime && this._interFrameTime.beginMonitoring(), this._captureActiveMeshesEvaluationTime && this._activeMeshesEvaluationTime.endFrame(), this._captureRenderTargetsRenderTime && this._renderTargetsRenderTime.endFrame(), this._captureParticlesRenderTime && this._particlesRenderTime.endFrame(), this._captureSpritesRenderTime && this._spritesRenderTime.endFrame(), this._captureRenderTime && this._renderTime.endFrame(), this._captureCameraRenderTime && this._cameraRenderTime.endFrame();
    });
  }
  /**
   * Dispose and release associated resources.
   */
  dispose() {
    this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = null, this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver), this._onBeforeActiveMeshesEvaluationObserver = null, this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver), this._onAfterActiveMeshesEvaluationObserver = null, this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver), this._onBeforeRenderTargetsRenderObserver = null, this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver), this._onAfterRenderTargetsRenderObserver = null, this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver), this._onBeforeAnimationsObserver = null, this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver), this._onBeforeParticlesRenderingObserver = null, this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver), this._onAfterParticlesRenderingObserver = null, this._onBeforeSpritesRenderingObserver && (this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver), this._onBeforeSpritesRenderingObserver = null), this._onAfterSpritesRenderingObserver && (this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver), this._onAfterSpritesRenderingObserver = null), this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver), this._onBeforeDrawPhaseObserver = null, this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver), this._onAfterDrawPhaseObserver = null, this._onBeforePhysicsObserver && (this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver), this._onBeforePhysicsObserver = null), this._onAfterPhysicsObserver && (this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver), this._onAfterPhysicsObserver = null), this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver), this._onAfterAnimationsObserver = null, this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = null, this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = null, this.scene = null;
  }
}
const p3e = "glowMapGenerationPixelShader", h3e = `#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)
#include<helperFunctions>
#endif
#ifdef DIFFUSE
varying vec2 vUVDiffuse;uniform sampler2D diffuseSampler;
#endif
#ifdef OPACITY
varying vec2 vUVOpacity;uniform sampler2D opacitySampler;uniform float opacityIntensity;
#endif
#ifdef EMISSIVE
varying vec2 vUVEmissive;uniform sampler2D emissiveSampler;
#endif
#ifdef VERTEXALPHA
varying vec4 vColor;
#endif
uniform vec4 glowColor;uniform float glowIntensity;
#include<clipPlaneFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#include<clipPlaneFragment>
vec4 finalColor=glowColor;
#ifdef DIFFUSE
vec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);
#ifdef DIFFUSE_ISLINEAR
albedoTexture=toGammaSpace(albedoTexture);
#endif
#ifdef GLOW
finalColor.a*=albedoTexture.a;
#endif
#ifdef HIGHLIGHT
finalColor.a=albedoTexture.a;
#endif
#endif
#ifdef OPACITY
vec4 opacityMap=texture2D(opacitySampler,vUVOpacity);
#ifdef OPACITYRGB
finalColor.a*=getLuminance(opacityMap.rgb);
#else
finalColor.a*=opacityMap.a;
#endif
finalColor.a*=opacityIntensity;
#endif
#ifdef VERTEXALPHA
finalColor.a*=vColor.a;
#endif
#ifdef ALPHATEST
if (finalColor.a<ALPHATESTVALUE)
discard;
#endif
#ifdef EMISSIVE
vec4 emissive=texture2D(emissiveSampler,vUVEmissive);
#ifdef EMISSIVE_ISLINEAR
emissive=toGammaSpace(emissive);
#endif
gl_FragColor=emissive*finalColor*glowIntensity;
#else
gl_FragColor=finalColor*glowIntensity;
#endif
#ifdef HIGHLIGHT
gl_FragColor.a=glowColor.a;
#endif
}`;
Le.ShadersStore[p3e] = h3e;
const H3e = "glowMapGenerationVertexShader", g3e = `attribute vec3 position;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
#include<instancesDeclaration>
uniform mat4 viewProjection;varying vec4 vPosition;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef DIFFUSE
varying vec2 vUVDiffuse;uniform mat4 diffuseMatrix;
#endif
#ifdef OPACITY
varying vec2 vUVOpacity;uniform mat4 opacityMatrix;
#endif
#ifdef EMISSIVE
varying vec2 vUVEmissive;uniform mat4 emissiveMatrix;
#endif
#ifdef VERTEXALPHA
attribute vec4 color;varying vec4 vColor;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#ifdef CUBEMAP
vPosition=worldPos;gl_Position=viewProjection*finalWorld*vec4(position,1.0);
#else
vPosition=viewProjection*worldPos;gl_Position=vPosition;
#endif
#ifdef DIFFUSE
#ifdef DIFFUSEUV1
vUVDiffuse=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef DIFFUSEUV2
vUVDiffuse=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#ifdef OPACITY
#ifdef OPACITYUV1
vUVOpacity=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef OPACITYUV2
vUVOpacity=vec2(opacityMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#ifdef EMISSIVE
#ifdef EMISSIVEUV1
vUVEmissive=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef EMISSIVEUV2
vUVEmissive=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#ifdef VERTEXALPHA
vColor=color;
#endif
#include<clipPlaneVertex>
}`;
Le.ShadersStore[H3e] = g3e;
class mc {
  /**
   * Gets the camera attached to the layer.
   */
  get camera() {
    return this._effectLayerOptions.camera;
  }
  /**
   * Gets the rendering group id the layer should render in.
   */
  get renderingGroupId() {
    return this._effectLayerOptions.renderingGroupId;
  }
  set renderingGroupId(e) {
    this._effectLayerOptions.renderingGroupId = e;
  }
  /**
   * Gets the main texture where the effect is rendered
   */
  get mainTexture() {
    return this._mainTexture;
  }
  /**
   * Sets a specific material to be used to render a mesh/a list of meshes in the layer
   * @param mesh mesh or array of meshes
   * @param material material to use by the layer when rendering the mesh(es). If undefined is passed, the specific material created by the layer will be used.
   */
  setMaterialForRendering(e, t) {
    if (this._mainTexture.setMaterialForRendering(e, t), Array.isArray(e))
      for (let r = 0; r < e.length; ++r) {
        const n = e[r];
        t ? this._materialForRendering[n.uniqueId] = [n, t] : delete this._materialForRendering[n.uniqueId];
      }
    else
      t ? this._materialForRendering[e.uniqueId] = [e, t] : delete this._materialForRendering[e.uniqueId];
  }
  /**
   * Gets the intensity of the effect for a specific mesh.
   * @param mesh The mesh to get the effect intensity for
   * @returns The intensity of the effect for the mesh
   */
  getEffectIntensity(e) {
    var t;
    return (t = this._effectIntensity[e.uniqueId]) !== null && t !== void 0 ? t : 1;
  }
  /**
   * Sets the intensity of the effect for a specific mesh.
   * @param mesh The mesh to set the effect intensity for
   * @param intensity The intensity of the effect for the mesh
   */
  setEffectIntensity(e, t) {
    this._effectIntensity[e.uniqueId] = t;
  }
  /**
   * Instantiates a new effect Layer and references it in the scene.
   * @param name The name of the layer
   * @param scene The scene to use the layer in
   */
  constructor(e, t) {
    this._vertexBuffers = {}, this._maxSize = 0, this._mainTextureDesiredSize = { width: 0, height: 0 }, this._shouldRender = !0, this._postProcesses = [], this._textures = [], this._emissiveTextureAndColor = { texture: null, color: new xt() }, this._effectIntensity = {}, this.neutralColor = new xt(), this.isEnabled = !0, this.disableBoundingBoxesFromEffectLayer = !1, this.onDisposeObservable = new Oe(), this.onBeforeRenderMainTextureObservable = new Oe(), this.onBeforeComposeObservable = new Oe(), this.onBeforeRenderMeshToEffect = new Oe(), this.onAfterRenderMeshToEffect = new Oe(), this.onAfterComposeObservable = new Oe(), this.onSizeChangedObservable = new Oe(), this._materialForRendering = {}, this.name = e, this._scene = t || gr.LastCreatedScene, mc._SceneComponentInitialization(this._scene), this._engine = this._scene.getEngine(), this._maxSize = this._engine.getCaps().maxTextureSize, this._scene.effectLayers.push(this), this._mergeDrawWrapper = [], this._generateIndexBuffer(), this._generateVertexBuffer();
  }
  /**
   * Number of times _internalRender will be called. Some effect layers need to render the mesh several times, so they should override this method with the number of times the mesh should be rendered
   * @returns Number of times a mesh must be rendered in the layer
   */
  _numInternalDraws() {
    return 1;
  }
  /**
   * Initializes the effect layer with the required options.
   * @param options Sets of none mandatory options to use with the layer (see IEffectLayerOptions for more information)
   */
  _init(e) {
    this._effectLayerOptions = Object.assign({ mainTextureRatio: 0.5, alphaBlendingMode: 2, camera: null, renderingGroupId: -1, mainTextureType: 0, generateStencilBuffer: !1 }, e), this._setMainTextureSize(), this._createMainTexture(), this._createTextureAndPostProcesses();
  }
  /**
   * Generates the index buffer of the full screen quad blending to the main canvas.
   */
  _generateIndexBuffer() {
    const e = [];
    e.push(0), e.push(1), e.push(2), e.push(0), e.push(2), e.push(3), this._indexBuffer = this._engine.createIndexBuffer(e);
  }
  /**
   * Generates the vertex buffer of the full screen quad blending to the main canvas.
   */
  _generateVertexBuffer() {
    const e = [];
    e.push(1, 1), e.push(-1, 1), e.push(-1, -1), e.push(1, -1);
    const t = new J(this._engine, e, J.PositionKind, !1, !1, 2);
    this._vertexBuffers[J.PositionKind] = t;
  }
  /**
   * Sets the main texture desired size which is the closest power of two
   * of the engine canvas size.
   */
  _setMainTextureSize() {
    this._effectLayerOptions.mainTextureFixedSize ? (this._mainTextureDesiredSize.width = this._effectLayerOptions.mainTextureFixedSize, this._mainTextureDesiredSize.height = this._effectLayerOptions.mainTextureFixedSize) : (this._mainTextureDesiredSize.width = this._engine.getRenderWidth() * this._effectLayerOptions.mainTextureRatio, this._mainTextureDesiredSize.height = this._engine.getRenderHeight() * this._effectLayerOptions.mainTextureRatio, this._mainTextureDesiredSize.width = this._engine.needPOTTextures ? Ge.GetExponentOfTwo(this._mainTextureDesiredSize.width, this._maxSize) : this._mainTextureDesiredSize.width, this._mainTextureDesiredSize.height = this._engine.needPOTTextures ? Ge.GetExponentOfTwo(this._mainTextureDesiredSize.height, this._maxSize) : this._mainTextureDesiredSize.height), this._mainTextureDesiredSize.width = Math.floor(this._mainTextureDesiredSize.width), this._mainTextureDesiredSize.height = Math.floor(this._mainTextureDesiredSize.height);
  }
  /**
   * Creates the main texture for the effect layer.
   */
  _createMainTexture() {
    this._mainTexture = new Ta("EffectLayerMainRTT", {
      width: this._mainTextureDesiredSize.width,
      height: this._mainTextureDesiredSize.height
    }, this._scene, !1, !0, this._effectLayerOptions.mainTextureType, !1, We.TRILINEAR_SAMPLINGMODE, !0, this._effectLayerOptions.generateStencilBuffer), this._mainTexture.activeCamera = this._effectLayerOptions.camera, this._mainTexture.wrapU = We.CLAMP_ADDRESSMODE, this._mainTexture.wrapV = We.CLAMP_ADDRESSMODE, this._mainTexture.anisotropicFilteringLevel = 1, this._mainTexture.updateSamplingMode(We.BILINEAR_SAMPLINGMODE), this._mainTexture.renderParticles = !1, this._mainTexture.renderList = null, this._mainTexture.ignoreCameraViewport = !0;
    for (const e in this._materialForRendering) {
      const [t, r] = this._materialForRendering[e];
      this._mainTexture.setMaterialForRendering(t, r);
    }
    if (this._mainTexture.customIsReadyFunction = (e, t, r) => {
      if ((r || t === 0) && e.subMeshes)
        for (let n = 0; n < e.subMeshes.length; ++n) {
          const i = e.subMeshes[n], s = i.getMaterial(), a = i.getRenderingMesh();
          if (!s)
            continue;
          const o = a._getInstancesRenderList(i._id, !!i.getReplacementMesh()).hardwareInstancedRendering[i._id] || a.hasThinInstances;
          if (this._setEmissiveTextureAndColor(a, i, s), !this._isReady(i, o, this._emissiveTextureAndColor.texture))
            return !1;
        }
      return !0;
    }, this._mainTexture.customRenderFunction = (e, t, r, n) => {
      this.onBeforeRenderMainTextureObservable.notifyObservers(this);
      let i;
      const s = this._scene.getEngine();
      if (n.length) {
        for (s.setColorWrite(!1), i = 0; i < n.length; i++)
          this._renderSubMesh(n.data[i]);
        s.setColorWrite(!0);
      }
      for (i = 0; i < e.length; i++)
        this._renderSubMesh(e.data[i]);
      for (i = 0; i < t.length; i++)
        this._renderSubMesh(t.data[i]);
      const a = s.getAlphaMode();
      for (i = 0; i < r.length; i++)
        this._renderSubMesh(r.data[i], !0);
      s.setAlphaMode(a);
    }, this._mainTexture.onClearObservable.add((e) => {
      e.clear(this.neutralColor, !0, !0, !0);
    }), this._scene.getBoundingBoxRenderer) {
      const e = this._scene.getBoundingBoxRenderer().enabled;
      this._mainTexture.onBeforeBindObservable.add(() => {
        this._scene.getBoundingBoxRenderer().enabled = !this.disableBoundingBoxesFromEffectLayer && e;
      }), this._mainTexture.onAfterUnbindObservable.add(() => {
        this._scene.getBoundingBoxRenderer().enabled = e;
      });
    }
  }
  /**
   * Adds specific effects defines.
   * @param defines The defines to add specifics to.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _addCustomEffectDefines(e) {
  }
  /**
   * Checks for the readiness of the element composing the layer.
   * @param subMesh the mesh to check for
   * @param useInstances specify whether or not to use instances to render the mesh
   * @param emissiveTexture the associated emissive texture used to generate the glow
   * @returns true if ready otherwise, false
   */
  _isReady(e, t, r) {
    var n;
    const i = this._scene.getEngine(), s = e.getMesh(), a = (n = s._internalAbstractMeshDataInfo._materialForRenderPass) === null || n === void 0 ? void 0 : n[i.currentRenderPassId];
    if (a)
      return a.isReadyForSubMesh(s, e, t);
    const f = e.getMaterial();
    if (!f)
      return !1;
    if (this._useMeshMaterial(e.getRenderingMesh()))
      return f.isReadyForSubMesh(e.getMesh(), e, t);
    const o = [], d = [J.PositionKind];
    let v = !1, u = !1;
    if (f) {
      const q = f.needAlphaTesting(), b = f.getAlphaTestTexture(), j = b && b.hasAlpha && (f.useAlphaFromDiffuseTexture || f._useAlphaFromAlbedoTexture);
      b && (q || j) && (o.push("#define DIFFUSE"), s.isVerticesDataPresent(J.UV2Kind) && b.coordinatesIndex === 1 ? (o.push("#define DIFFUSEUV2"), u = !0) : s.isVerticesDataPresent(J.UVKind) && (o.push("#define DIFFUSEUV1"), v = !0), q && (o.push("#define ALPHATEST"), o.push("#define ALPHATESTVALUE 0.4")), b.gammaSpace || o.push("#define DIFFUSE_ISLINEAR"));
      const w = f.opacityTexture;
      w && (o.push("#define OPACITY"), s.isVerticesDataPresent(J.UV2Kind) && w.coordinatesIndex === 1 ? (o.push("#define OPACITYUV2"), u = !0) : s.isVerticesDataPresent(J.UVKind) && (o.push("#define OPACITYUV1"), v = !0));
    }
    r && (o.push("#define EMISSIVE"), s.isVerticesDataPresent(J.UV2Kind) && r.coordinatesIndex === 1 ? (o.push("#define EMISSIVEUV2"), u = !0) : s.isVerticesDataPresent(J.UVKind) && (o.push("#define EMISSIVEUV1"), v = !0), r.gammaSpace || o.push("#define EMISSIVE_ISLINEAR")), s.useVertexColors && s.isVerticesDataPresent(J.ColorKind) && s.hasVertexAlpha && f.transparencyMode !== gt.MATERIAL_OPAQUE && (d.push(J.ColorKind), o.push("#define VERTEXALPHA")), v && (d.push(J.UVKind), o.push("#define UV1")), u && (d.push(J.UV2Kind), o.push("#define UV2"));
    const l = new c1();
    if (s.useBones && s.computeBonesUsingShaders) {
      d.push(J.MatricesIndicesKind), d.push(J.MatricesWeightsKind), s.numBoneInfluencers > 4 && (d.push(J.MatricesIndicesExtraKind), d.push(J.MatricesWeightsExtraKind)), o.push("#define NUM_BONE_INFLUENCERS " + s.numBoneInfluencers);
      const q = s.skeleton;
      q && q.isUsingTextureForMatrices ? o.push("#define BONETEXTURE") : o.push("#define BonesPerMesh " + (q ? q.bones.length + 1 : 0)), s.numBoneInfluencers > 0 && l.addCPUSkinningFallback(0, s);
    } else
      o.push("#define NUM_BONE_INFLUENCERS 0");
    const P = s.morphTargetManager;
    let p = 0;
    P && P.numInfluencers > 0 && (o.push("#define MORPHTARGETS"), p = P.numInfluencers, o.push("#define NUM_MORPH_INFLUENCERS " + p), P.isUsingTextureForTargets && o.push("#define MORPHTARGETS_TEXTURE"), Ye.PrepareAttributesForMorphTargetsInfluencers(d, s, p)), t && (o.push("#define INSTANCES"), Ye.PushAttributesForInstances(d), e.getRenderingMesh().hasThinInstances && o.push("#define THIN_INSTANCES")), xq(f, this._scene, o), this._addCustomEffectDefines(o);
    const c = e._getDrawWrapper(void 0, !0), H = c.defines, T = o.join(`
`);
    if (H !== T) {
      const q = [
        "world",
        "mBones",
        "viewProjection",
        "glowColor",
        "morphTargetInfluences",
        "boneTextureWidth",
        "diffuseMatrix",
        "emissiveMatrix",
        "opacityMatrix",
        "opacityIntensity",
        "morphTargetTextureInfo",
        "morphTargetTextureIndices",
        "glowIntensity"
      ];
      Mf(q), c.setEffect(this._engine.createEffect("glowMapGeneration", d, q, ["diffuseSampler", "emissiveSampler", "opacitySampler", "boneSampler", "morphTargets"], T, l, void 0, void 0, { maxSimultaneousMorphTargets: p }), T);
    }
    return c.effect.isReady();
  }
  /**
   * Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene.
   */
  render() {
    for (let s = 0; s < this._postProcesses.length; s++)
      if (!this._postProcesses[s].isReady())
        return;
    const e = this._scene.getEngine(), t = this._numInternalDraws();
    let r = !0;
    for (let s = 0; s < t; ++s) {
      let a = this._mergeDrawWrapper[s];
      a || (a = this._mergeDrawWrapper[s] = new zo(this._engine), a.setEffect(this._createMergeEffect())), r = r && a.effect.isReady();
    }
    if (!r)
      return;
    this.onBeforeComposeObservable.notifyObservers(this);
    const n = e.getAlphaMode();
    for (let s = 0; s < t; ++s) {
      const a = this._mergeDrawWrapper[s];
      e.enableEffect(a), e.setState(!1), e.bindBuffers(this._vertexBuffers, this._indexBuffer, a.effect), e.setAlphaMode(this._effectLayerOptions.alphaBlendingMode), this._internalRender(a.effect, s);
    }
    e.setAlphaMode(n), this.onAfterComposeObservable.notifyObservers(this);
    const i = this._mainTexture.getSize();
    this._setMainTextureSize(), (i.width !== this._mainTextureDesiredSize.width || i.height !== this._mainTextureDesiredSize.height) && this._mainTextureDesiredSize.width !== 0 && this._mainTextureDesiredSize.height !== 0 && (this.onSizeChangedObservable.notifyObservers(this), this._disposeTextureAndPostProcesses(), this._createMainTexture(), this._createTextureAndPostProcesses());
  }
  /**
   * Determine if a given mesh will be used in the current effect.
   * @param mesh mesh to test
   * @returns true if the mesh will be used
   */
  hasMesh(e) {
    return this.renderingGroupId === -1 || e.renderingGroupId === this.renderingGroupId;
  }
  /**
   * Returns true if the layer contains information to display, otherwise false.
   * @returns true if the glow layer should be rendered
   */
  shouldRender() {
    return this.isEnabled && this._shouldRender;
  }
  /**
   * Returns true if the mesh should render, otherwise false.
   * @param mesh The mesh to render
   * @returns true if it should render otherwise false
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _shouldRenderMesh(e) {
    return !0;
  }
  /**
   * Returns true if the mesh can be rendered, otherwise false.
   * @param mesh The mesh to render
   * @param material The material used on the mesh
   * @returns true if it can be rendered otherwise false
   */
  _canRenderMesh(e, t) {
    return !t.needAlphaBlendingForMesh(e);
  }
  /**
   * Returns true if the mesh should render, otherwise false.
   * @returns true if it should render otherwise false
   */
  _shouldRenderEmissiveTextureForMesh() {
    return !0;
  }
  /**
   * Renders the submesh passed in parameter to the generation map.
   * @param subMesh
   * @param enableAlphaMode
   */
  _renderSubMesh(e, t = !1) {
    var r, n;
    if (!this.shouldRender())
      return;
    const i = e.getMaterial(), s = e.getMesh(), a = e.getReplacementMesh(), f = e.getRenderingMesh(), o = e.getEffectiveMesh(), d = this._scene, v = d.getEngine();
    if (o._internalAbstractMeshDataInfo._isActiveIntermediate = !1, !i || !this._canRenderMesh(f, i))
      return;
    let u = (r = f.overrideMaterialSideOrientation) !== null && r !== void 0 ? r : i.sideOrientation;
    o._getWorldMatrixDeterminant() < 0 && (u = u === gt.ClockWiseSideOrientation ? gt.CounterClockWiseSideOrientation : gt.ClockWiseSideOrientation);
    const P = u === gt.ClockWiseSideOrientation;
    v.setState(i.backFaceCulling, i.zOffset, void 0, P, i.cullBackFaces, void 0, i.zOffsetUnits);
    const p = f._getInstancesRenderList(e._id, !!a);
    if (p.mustReturn || !this._shouldRenderMesh(f))
      return;
    const c = p.hardwareInstancedRendering[e._id] || f.hasThinInstances;
    if (this._setEmissiveTextureAndColor(f, e, i), this.onBeforeRenderMeshToEffect.notifyObservers(s), this._useMeshMaterial(f))
      f.render(e, t, a || void 0);
    else if (this._isReady(e, c, this._emissiveTextureAndColor.texture)) {
      const H = (n = o._internalAbstractMeshDataInfo._materialForRenderPass) === null || n === void 0 ? void 0 : n[v.currentRenderPassId];
      let T = e._getDrawWrapper();
      if (!T && H && (T = H._getDrawWrapper()), !T)
        return;
      const q = T.effect;
      if (v.enableEffect(T), c || f._bind(e, q, i.fillMode), H ? H.bindForSubMesh(o.getWorldMatrix(), o, e) : (q.setMatrix("viewProjection", d.getTransformMatrix()), q.setMatrix("world", o.getWorldMatrix()), q.setFloat4("glowColor", this._emissiveTextureAndColor.color.r, this._emissiveTextureAndColor.color.g, this._emissiveTextureAndColor.color.b, this._emissiveTextureAndColor.color.a)), !H) {
        const b = i.needAlphaTesting(), j = i.getAlphaTestTexture(), w = j && j.hasAlpha && (i.useAlphaFromDiffuseTexture || i._useAlphaFromAlbedoTexture);
        if (j && (b || w)) {
          q.setTexture("diffuseSampler", j);
          const I = j.getTextureMatrix();
          I && q.setMatrix("diffuseMatrix", I);
        }
        const m = i.opacityTexture;
        if (m) {
          q.setTexture("opacitySampler", m), q.setFloat("opacityIntensity", m.level);
          const I = m.getTextureMatrix();
          I && q.setMatrix("opacityMatrix", I);
        }
        if (this._emissiveTextureAndColor.texture && (q.setTexture("emissiveSampler", this._emissiveTextureAndColor.texture), q.setMatrix("emissiveMatrix", this._emissiveTextureAndColor.texture.getTextureMatrix())), f.useBones && f.computeBonesUsingShaders && f.skeleton) {
          const I = f.skeleton;
          if (I.isUsingTextureForMatrices) {
            const N = I.getTransformMatrixTexture(f);
            if (!N)
              return;
            q.setTexture("boneSampler", N), q.setFloat("boneTextureWidth", 4 * (I.bones.length + 1));
          } else
            q.setMatrices("mBones", I.getTransformMatrices(f));
        }
        Ye.BindMorphTargetParameters(f, q), f.morphTargetManager && f.morphTargetManager.isUsingTextureForTargets && f.morphTargetManager._bind(q), t && v.setAlphaMode(i.alphaMode), q.setFloat("glowIntensity", this.getEffectIntensity(f)), Df(q, i, d);
      }
      f._processRendering(o, e, q, i.fillMode, p, c, (b, j) => q.setMatrix("world", j));
    } else
      this._mainTexture.resetRefreshCounter();
    this.onAfterRenderMeshToEffect.notifyObservers(s);
  }
  /**
   * Defines whether the current material of the mesh should be use to render the effect.
   * @param mesh defines the current mesh to render
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _useMeshMaterial(e) {
    return !1;
  }
  /**
   * Rebuild the required buffers.
   * @internal Internal use only.
   */
  _rebuild() {
    const e = this._vertexBuffers[J.PositionKind];
    e && e._rebuild(), this._generateIndexBuffer();
  }
  /**
   * Dispose only the render target textures and post process.
   */
  _disposeTextureAndPostProcesses() {
    this._mainTexture.dispose();
    for (let e = 0; e < this._postProcesses.length; e++)
      this._postProcesses[e] && this._postProcesses[e].dispose();
    this._postProcesses = [];
    for (let e = 0; e < this._textures.length; e++)
      this._textures[e] && this._textures[e].dispose();
    this._textures = [];
  }
  /**
   * Dispose the highlight layer and free resources.
   */
  dispose() {
    const e = this._vertexBuffers[J.PositionKind];
    e && (e.dispose(), this._vertexBuffers[J.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null);
    for (const r of this._mergeDrawWrapper)
      r.dispose();
    this._mergeDrawWrapper = [], this._disposeTextureAndPostProcesses();
    const t = this._scene.effectLayers.indexOf(this, 0);
    t > -1 && this._scene.effectLayers.splice(t, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onBeforeRenderMainTextureObservable.clear(), this.onBeforeComposeObservable.clear(), this.onBeforeRenderMeshToEffect.clear(), this.onAfterRenderMeshToEffect.clear(), this.onAfterComposeObservable.clear(), this.onSizeChangedObservable.clear();
  }
  /**
   * Gets the class name of the effect layer
   * @returns the string with the class name of the effect layer
   */
  getClassName() {
    return "EffectLayer";
  }
  /**
   * Creates an effect layer from parsed effect layer data
   * @param parsedEffectLayer defines effect layer data
   * @param scene defines the current scene
   * @param rootUrl defines the root URL containing the effect layer information
   * @returns a parsed effect Layer
   */
  static Parse(e, t, r) {
    return ye.Instantiate(e.customType).Parse(e, t, r);
  }
}
mc._SceneComponentInitialization = (A) => {
  throw qn("EffectLayerSceneComponent");
};
C([
  M()
], mc.prototype, "name", void 0);
C([
  rU()
], mc.prototype, "neutralColor", void 0);
C([
  M()
], mc.prototype, "isEnabled", void 0);
C([
  U$()
], mc.prototype, "camera", null);
C([
  M()
], mc.prototype, "renderingGroupId", null);
C([
  M()
], mc.prototype, "disableBoundingBoxesFromEffectLayer", void 0);
J1.AddParser(Ot.NAME_EFFECTLAYER, (A, e, t, r) => {
  if (A.effectLayers) {
    t.effectLayers || (t.effectLayers = []);
    for (let n = 0; n < A.effectLayers.length; n++) {
      const i = mc.Parse(A.effectLayers[n], e, r);
      t.effectLayers.push(i);
    }
  }
});
J1.prototype.removeEffectLayer = function(A) {
  const e = this.effectLayers.indexOf(A);
  return e !== -1 && this.effectLayers.splice(e, 1), e;
};
J1.prototype.addEffectLayer = function(A) {
  this.effectLayers.push(A);
};
class Nte {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_EFFECTLAYER, this._renderEffects = !1, this._needStencil = !1, this._previousStencilState = !1, this.scene = e || gr.LastCreatedScene, this.scene && (this._engine = this.scene.getEngine(), this.scene.effectLayers = []);
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._isReadyForMeshStage.registerStep(Ot.STEP_ISREADYFORMESH_EFFECTLAYER, this, this._isReadyForMesh), this.scene._cameraDrawRenderTargetStage.registerStep(Ot.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER, this, this._renderMainTexture), this.scene._beforeCameraDrawStage.registerStep(Ot.STEP_BEFORECAMERADRAW_EFFECTLAYER, this, this._setStencil), this.scene._afterRenderingGroupDrawStage.registerStep(Ot.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW, this, this._drawRenderingGroup), this.scene._afterCameraDrawStage.registerStep(Ot.STEP_AFTERCAMERADRAW_EFFECTLAYER, this, this._setStencilBack), this.scene._afterCameraDrawStage.registerStep(Ot.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW, this, this._drawCamera);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
    const e = this.scene.effectLayers;
    for (const t of e)
      t._rebuild();
  }
  /**
   * Serializes the component data to the specified json object
   * @param serializationObject The object to serialize to
   */
  serialize(e) {
    e.effectLayers = [];
    const t = this.scene.effectLayers;
    for (const r of t)
      r.serialize && e.effectLayers.push(r.serialize());
  }
  /**
   * Adds all the elements from the container to the scene
   * @param container the container holding the elements
   */
  addFromContainer(e) {
    e.effectLayers && e.effectLayers.forEach((t) => {
      this.scene.addEffectLayer(t);
    });
  }
  /**
   * Removes all the elements in the container from the scene
   * @param container contains the elements to remove
   * @param dispose if the removed element should be disposed (default: false)
   */
  removeFromContainer(e, t) {
    e.effectLayers && e.effectLayers.forEach((r) => {
      this.scene.removeEffectLayer(r), t && r.dispose();
    });
  }
  /**
   * Disposes the component and the associated resources.
   */
  dispose() {
    const e = this.scene.effectLayers;
    for (; e.length; )
      e[0].dispose();
  }
  _isReadyForMesh(e, t) {
    const r = this._engine.currentRenderPassId, n = this.scene.effectLayers;
    for (const i of n) {
      if (!i.hasMesh(e))
        continue;
      const s = i._mainTexture;
      this._engine.currentRenderPassId = s.renderPassId;
      for (const a of e.subMeshes)
        if (!i.isReady(a, t))
          return this._engine.currentRenderPassId = r, !1;
    }
    return this._engine.currentRenderPassId = r, !0;
  }
  _renderMainTexture(e) {
    this._renderEffects = !1, this._needStencil = !1;
    let t = !1;
    const r = this.scene.effectLayers;
    if (r && r.length > 0) {
      this._previousStencilState = this._engine.getStencilBuffer();
      for (const n of r)
        if (n.shouldRender() && (!n.camera || n.camera.cameraRigMode === Tr.RIG_MODE_NONE && e === n.camera || n.camera.cameraRigMode !== Tr.RIG_MODE_NONE && n.camera._rigCameras.indexOf(e) > -1)) {
          this._renderEffects = !0, this._needStencil = this._needStencil || n.needStencil();
          const i = n._mainTexture;
          i._shouldRender() && (this.scene.incrementRenderId(), i.render(!1, !1), t = !0);
        }
      this.scene.incrementRenderId();
    }
    return t;
  }
  _setStencil() {
    this._needStencil && this._engine.setStencilBuffer(!0);
  }
  _setStencilBack() {
    this._needStencil && this._engine.setStencilBuffer(this._previousStencilState);
  }
  _draw(e) {
    if (this._renderEffects) {
      this._engine.setDepthBuffer(!1);
      const t = this.scene.effectLayers;
      for (let r = 0; r < t.length; r++) {
        const n = t[r];
        n.renderingGroupId === e && n.shouldRender() && n.render();
      }
      this._engine.setDepthBuffer(!0);
    }
  }
  _drawCamera() {
    this._renderEffects && this._draw(-1);
  }
  _drawRenderingGroup(e) {
    !this.scene._isInIntermediateRendering() && this._renderEffects && this._draw(e);
  }
}
mc._SceneComponentInitialization = (A) => {
  let e = A._getComponent(Ot.NAME_EFFECTLAYER);
  e || (e = new Nte(A), A._addComponent(e));
};
const X3e = "glowMapMergePixelShader", T3e = `varying vec2 vUV;uniform sampler2D textureSampler;
#ifdef EMISSIVE
uniform sampler2D textureSampler2;
#endif
uniform float offset;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 baseColor=texture2D(textureSampler,vUV);
#ifdef EMISSIVE
baseColor+=texture2D(textureSampler2,vUV);baseColor*=offset;
#else
baseColor.a=abs(offset-baseColor.a);
#ifdef STROKE
float alpha=smoothstep(.0,.1,baseColor.a);baseColor.a=alpha;baseColor.rgb=baseColor.rgb*alpha;
#endif
#endif
#if LDR
baseColor=clamp(baseColor,0.,1.0);
#endif
gl_FragColor=baseColor;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[X3e] = T3e;
const q3e = "glowMapMergeVertexShader", b3e = `attribute vec2 position;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=position*madd+madd;gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[q3e] = b3e;
J1.prototype.getGlowLayerByName = function(A) {
  var e;
  for (let t = 0; t < ((e = this.effectLayers) === null || e === void 0 ? void 0 : e.length); t++)
    if (this.effectLayers[t].name === A && this.effectLayers[t].getEffectName() === zl.EffectName)
      return this.effectLayers[t];
  return null;
};
class zl extends mc {
  /**
   * Sets the kernel size of the blur.
   */
  set blurKernelSize(e) {
    if (e === this._options.blurKernelSize)
      return;
    this._options.blurKernelSize = e;
    const t = this._getEffectiveBlurKernelSize();
    this._horizontalBlurPostprocess1.kernel = t, this._verticalBlurPostprocess1.kernel = t, this._horizontalBlurPostprocess2.kernel = t, this._verticalBlurPostprocess2.kernel = t;
  }
  /**
   * Gets the kernel size of the blur.
   */
  get blurKernelSize() {
    return this._options.blurKernelSize;
  }
  /**
   * Sets the glow intensity.
   */
  set intensity(e) {
    this._intensity = e;
  }
  /**
   * Gets the glow intensity.
   */
  get intensity() {
    return this._intensity;
  }
  /**
   * Instantiates a new glow Layer and references it to the scene.
   * @param name The name of the layer
   * @param scene The scene to use the layer in
   * @param options Sets of none mandatory options to use with the layer (see IGlowLayerOptions for more information)
   */
  constructor(e, t, r) {
    super(e, t), this._intensity = 1, this._includedOnlyMeshes = [], this._excludedMeshes = [], this._meshesUsingTheirOwnMaterials = [], this.neutralColor = new xt(0, 0, 0, 1), this._options = Object.assign({ mainTextureRatio: zl.DefaultTextureRatio, blurKernelSize: 32, mainTextureFixedSize: void 0, camera: null, mainTextureSamples: 1, renderingGroupId: -1, ldrMerge: !1, alphaBlendingMode: 1, mainTextureType: 0, generateStencilBuffer: !1 }, r), this._init({
      alphaBlendingMode: this._options.alphaBlendingMode,
      camera: this._options.camera,
      mainTextureFixedSize: this._options.mainTextureFixedSize,
      mainTextureRatio: this._options.mainTextureRatio,
      renderingGroupId: this._options.renderingGroupId,
      mainTextureType: this._options.mainTextureType,
      generateStencilBuffer: this._options.generateStencilBuffer
    });
  }
  /**
   * Get the effect name of the layer.
   * @returns The effect name
   */
  getEffectName() {
    return zl.EffectName;
  }
  /**
   * Create the merge effect. This is the shader use to blit the information back
   * to the main canvas at the end of the scene rendering.
   */
  _createMergeEffect() {
    let e = `#define EMISSIVE 
`;
    return this._options.ldrMerge && (e += `#define LDR 
`), this._engine.createEffect("glowMapMerge", [J.PositionKind], ["offset"], ["textureSampler", "textureSampler2"], e);
  }
  /**
   * Creates the render target textures and post processes used in the glow layer.
   */
  _createTextureAndPostProcesses() {
    let e = this._mainTextureDesiredSize.width, t = this._mainTextureDesiredSize.height;
    e = this._engine.needPOTTextures ? Ge.GetExponentOfTwo(e, this._maxSize) : e, t = this._engine.needPOTTextures ? Ge.GetExponentOfTwo(t, this._maxSize) : t;
    let r = 0;
    this._engine.getCaps().textureHalfFloatRender ? r = 2 : r = 0, this._blurTexture1 = new Ta("GlowLayerBlurRTT", {
      width: e,
      height: t
    }, this._scene, !1, !0, r), this._blurTexture1.wrapU = We.CLAMP_ADDRESSMODE, this._blurTexture1.wrapV = We.CLAMP_ADDRESSMODE, this._blurTexture1.updateSamplingMode(We.BILINEAR_SAMPLINGMODE), this._blurTexture1.renderParticles = !1, this._blurTexture1.ignoreCameraViewport = !0;
    const n = Math.floor(e / 2), i = Math.floor(t / 2);
    this._blurTexture2 = new Ta("GlowLayerBlurRTT2", {
      width: n,
      height: i
    }, this._scene, !1, !0, r), this._blurTexture2.wrapU = We.CLAMP_ADDRESSMODE, this._blurTexture2.wrapV = We.CLAMP_ADDRESSMODE, this._blurTexture2.updateSamplingMode(We.BILINEAR_SAMPLINGMODE), this._blurTexture2.renderParticles = !1, this._blurTexture2.ignoreCameraViewport = !0, this._textures = [this._blurTexture1, this._blurTexture2];
    const s = this._getEffectiveBlurKernelSize();
    this._horizontalBlurPostprocess1 = new c9("GlowLayerHBP1", new at(1, 0), s, {
      width: e,
      height: t
    }, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, r), this._horizontalBlurPostprocess1.width = e, this._horizontalBlurPostprocess1.height = t, this._horizontalBlurPostprocess1.externalTextureSamplerBinding = !0, this._horizontalBlurPostprocess1.onApplyObservable.add((a) => {
      a.setTexture("textureSampler", this._mainTexture);
    }), this._verticalBlurPostprocess1 = new c9("GlowLayerVBP1", new at(0, 1), s, {
      width: e,
      height: t
    }, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, r), this._horizontalBlurPostprocess2 = new c9("GlowLayerHBP2", new at(1, 0), s, {
      width: n,
      height: i
    }, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, r), this._horizontalBlurPostprocess2.width = n, this._horizontalBlurPostprocess2.height = i, this._horizontalBlurPostprocess2.externalTextureSamplerBinding = !0, this._horizontalBlurPostprocess2.onApplyObservable.add((a) => {
      a.setTexture("textureSampler", this._blurTexture1);
    }), this._verticalBlurPostprocess2 = new c9("GlowLayerVBP2", new at(0, 1), s, {
      width: n,
      height: i
    }, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, r), this._postProcesses = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1, this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2], this._postProcesses1 = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1], this._postProcesses2 = [this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2], this._mainTexture.samples = this._options.mainTextureSamples, this._mainTexture.onAfterUnbindObservable.add(() => {
      const a = this._blurTexture1.renderTarget;
      if (a) {
        this._scene.postProcessManager.directRender(this._postProcesses1, a, !0);
        const f = this._blurTexture2.renderTarget;
        f && this._scene.postProcessManager.directRender(this._postProcesses2, f, !0), this._engine.unBindFramebuffer(f ?? a, !0);
      }
    }), this._postProcesses.map((a) => {
      a.autoClear = !1;
    });
  }
  /**
   * @returns The blur kernel size used by the glow.
   * Note: The value passed in the options is divided by 2 for back compatibility.
   */
  _getEffectiveBlurKernelSize() {
    return this._options.blurKernelSize / 2;
  }
  /**
   * Checks for the readiness of the element composing the layer.
   * @param subMesh the mesh to check for
   * @param useInstances specify whether or not to use instances to render the mesh
   * @returns true if ready otherwise, false
   */
  isReady(e, t) {
    const r = e.getMaterial(), n = e.getRenderingMesh();
    if (!r || !n)
      return !1;
    const i = r.emissiveTexture;
    return super._isReady(e, t, i);
  }
  /**
   * Returns whether or not the layer needs stencil enabled during the mesh rendering.
   */
  needStencil() {
    return !1;
  }
  /**
   * Returns true if the mesh can be rendered, otherwise false.
   * @param mesh The mesh to render
   * @param material The material used on the mesh
   * @returns true if it can be rendered otherwise false
   */
  _canRenderMesh(e, t) {
    return !0;
  }
  /**
   * Implementation specific of rendering the generating effect on the main canvas.
   * @param effect The effect used to render through
   */
  _internalRender(e) {
    e.setTexture("textureSampler", this._blurTexture1), e.setTexture("textureSampler2", this._blurTexture2), e.setFloat("offset", this._intensity);
    const t = this._engine, r = t.getStencilBuffer();
    t.setStencilBuffer(!1), t.drawElementsType(gt.TriangleFillMode, 0, 6), t.setStencilBuffer(r);
  }
  /**
   * Sets the required values for both the emissive texture and and the main color.
   * @param mesh
   * @param subMesh
   * @param material
   */
  _setEmissiveTextureAndColor(e, t, r) {
    var n;
    let i = 1;
    if (this.customEmissiveTextureSelector ? this._emissiveTextureAndColor.texture = this.customEmissiveTextureSelector(e, t, r) : r ? (this._emissiveTextureAndColor.texture = r.emissiveTexture, this._emissiveTextureAndColor.texture && (i = this._emissiveTextureAndColor.texture.level)) : this._emissiveTextureAndColor.texture = null, this.customEmissiveColorSelector)
      this.customEmissiveColorSelector(e, t, r, this._emissiveTextureAndColor.color);
    else if (r.emissiveColor) {
      const s = (n = r.emissiveIntensity) !== null && n !== void 0 ? n : 1;
      i *= s, this._emissiveTextureAndColor.color.set(r.emissiveColor.r * i, r.emissiveColor.g * i, r.emissiveColor.b * i, r.alpha);
    } else
      this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);
  }
  /**
   * Returns true if the mesh should render, otherwise false.
   * @param mesh The mesh to render
   * @returns true if it should render otherwise false
   */
  _shouldRenderMesh(e) {
    return this.hasMesh(e);
  }
  /**
   * Adds specific effects defines.
   * @param defines The defines to add specifics to.
   */
  _addCustomEffectDefines(e) {
    e.push("#define GLOW");
  }
  /**
   * Add a mesh in the exclusion list to prevent it to impact or being impacted by the glow layer.
   * @param mesh The mesh to exclude from the glow layer
   */
  addExcludedMesh(e) {
    this._excludedMeshes.indexOf(e.uniqueId) === -1 && this._excludedMeshes.push(e.uniqueId);
  }
  /**
   * Remove a mesh from the exclusion list to let it impact or being impacted by the glow layer.
   * @param mesh The mesh to remove
   */
  removeExcludedMesh(e) {
    const t = this._excludedMeshes.indexOf(e.uniqueId);
    t !== -1 && this._excludedMeshes.splice(t, 1);
  }
  /**
   * Add a mesh in the inclusion list to impact or being impacted by the glow layer.
   * @param mesh The mesh to include in the glow layer
   */
  addIncludedOnlyMesh(e) {
    this._includedOnlyMeshes.indexOf(e.uniqueId) === -1 && this._includedOnlyMeshes.push(e.uniqueId);
  }
  /**
   * Remove a mesh from the Inclusion list to prevent it to impact or being impacted by the glow layer.
   * @param mesh The mesh to remove
   */
  removeIncludedOnlyMesh(e) {
    const t = this._includedOnlyMeshes.indexOf(e.uniqueId);
    t !== -1 && this._includedOnlyMeshes.splice(t, 1);
  }
  /**
   * Determine if a given mesh will be used in the glow layer
   * @param mesh The mesh to test
   * @returns true if the mesh will be highlighted by the current glow layer
   */
  hasMesh(e) {
    return super.hasMesh(e) ? this._includedOnlyMeshes.length ? this._includedOnlyMeshes.indexOf(e.uniqueId) !== -1 : this._excludedMeshes.length ? this._excludedMeshes.indexOf(e.uniqueId) === -1 : !0 : !1;
  }
  /**
   * Defines whether the current material of the mesh should be use to render the effect.
   * @param mesh defines the current mesh to render
   */
  _useMeshMaterial(e) {
    return this._meshesUsingTheirOwnMaterials.length == 0 ? !1 : this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId) > -1;
  }
  /**
   * Add a mesh to be rendered through its own material and not with emissive only.
   * @param mesh The mesh for which we need to use its material
   */
  referenceMeshToUseItsOwnMaterial(e) {
    e.resetDrawCache(this._mainTexture.renderPassId), this._meshesUsingTheirOwnMaterials.push(e.uniqueId), e.onDisposeObservable.add(() => {
      this._disposeMesh(e);
    });
  }
  /**
   * Remove a mesh from being rendered through its own material and not with emissive only.
   * @param mesh The mesh for which we need to not use its material
   */
  unReferenceMeshFromUsingItsOwnMaterial(e) {
    let t = this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId);
    for (; t >= 0; )
      this._meshesUsingTheirOwnMaterials.splice(t, 1), t = this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId);
    e.resetDrawCache(this._mainTexture.renderPassId);
  }
  /**
   * Free any resources and references associated to a mesh.
   * Internal use
   * @param mesh The mesh to free.
   * @internal
   */
  _disposeMesh(e) {
    this.removeIncludedOnlyMesh(e), this.removeExcludedMesh(e);
  }
  /**
   * Gets the class name of the effect layer
   * @returns the string with the class name of the effect layer
   */
  getClassName() {
    return "GlowLayer";
  }
  /**
   * Serializes this glow layer
   * @returns a serialized glow layer object
   */
  serialize() {
    const e = jt.Serialize(this);
    e.customType = "BABYLON.GlowLayer";
    let t;
    if (e.includedMeshes = [], this._includedOnlyMeshes.length)
      for (t = 0; t < this._includedOnlyMeshes.length; t++) {
        const r = this._scene.getMeshByUniqueId(this._includedOnlyMeshes[t]);
        r && e.includedMeshes.push(r.id);
      }
    if (e.excludedMeshes = [], this._excludedMeshes.length)
      for (t = 0; t < this._excludedMeshes.length; t++) {
        const r = this._scene.getMeshByUniqueId(this._excludedMeshes[t]);
        r && e.excludedMeshes.push(r.id);
      }
    return e;
  }
  /**
   * Creates a Glow Layer from parsed glow layer data
   * @param parsedGlowLayer defines glow layer data
   * @param scene defines the current scene
   * @param rootUrl defines the root URL containing the glow layer information
   * @returns a parsed Glow Layer
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => new zl(e.name, t, e.options), e, t, r);
    let i;
    for (i = 0; i < e.excludedMeshes.length; i++) {
      const s = t.getMeshById(e.excludedMeshes[i]);
      s && n.addExcludedMesh(s);
    }
    for (i = 0; i < e.includedMeshes.length; i++) {
      const s = t.getMeshById(e.includedMeshes[i]);
      s && n.addIncludedOnlyMesh(s);
    }
    return n;
  }
}
zl.EffectName = "GlowLayer";
zl.DefaultBlurKernelSize = 32;
zl.DefaultTextureRatio = 0.5;
C([
  M()
], zl.prototype, "blurKernelSize", null);
C([
  M()
], zl.prototype, "intensity", null);
C([
  M("options")
], zl.prototype, "_options", void 0);
Ue("BABYLON.GlowLayer", zl);
const x3e = "glowBlurPostProcessPixelShader", D3e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 direction;uniform float blurWidth;float getLuminance(vec3 color)
{return dot(color,vec3(0.2126,0.7152,0.0722));}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{float weights[7];weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;vec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);vec2 texelStep=texelSize*direction*blurWidth;vec2 start=vUV-3.0*texelStep;vec4 baseColor=vec4(0.,0.,0.,0.);vec2 texelOffset=vec2(0.,0.);for (int i=0; i<7; i++)
{vec4 texel=texture2D(textureSampler,start+texelOffset);baseColor.a+=texel.a*weights[i];float luminance=getLuminance(baseColor.rgb);float luminanceTexel=getLuminance(texel.rgb);float choice=step(luminanceTexel,luminance);baseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;texelOffset+=texelStep;}
gl_FragColor=baseColor;}`;
Le.ShadersStore[x3e] = D3e;
J1.prototype.getHighlightLayerByName = function(A) {
  var e;
  for (let t = 0; t < ((e = this.effectLayers) === null || e === void 0 ? void 0 : e.length); t++)
    if (this.effectLayers[t].name === A && this.effectLayers[t].getEffectName() === Ad.EffectName)
      return this.effectLayers[t];
  return null;
};
class YG extends kr {
  constructor(e, t, r, n, i, s = We.BILINEAR_SAMPLINGMODE, a, f) {
    super(e, "glowBlurPostProcess", ["screenSize", "direction", "blurWidth"], null, n, i, s, a, f), this.direction = t, this.kernel = r, this.onApplyObservable.add((o) => {
      o.setFloat2("screenSize", this.width, this.height), o.setVector2("direction", this.direction), o.setFloat("blurWidth", this.kernel);
    });
  }
}
class Ad extends mc {
  /**
   * Specifies the horizontal size of the blur.
   */
  set blurHorizontalSize(e) {
    this._horizontalBlurPostprocess.kernel = e, this._options.blurHorizontalSize = e;
  }
  /**
   * Specifies the vertical size of the blur.
   */
  set blurVerticalSize(e) {
    this._verticalBlurPostprocess.kernel = e, this._options.blurVerticalSize = e;
  }
  /**
   * Gets the horizontal size of the blur.
   */
  get blurHorizontalSize() {
    return this._horizontalBlurPostprocess.kernel;
  }
  /**
   * Gets the vertical size of the blur.
   */
  get blurVerticalSize() {
    return this._verticalBlurPostprocess.kernel;
  }
  /**
   * Instantiates a new highlight Layer and references it to the scene..
   * @param name The name of the layer
   * @param scene The scene to use the layer in
   * @param options Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information)
   */
  constructor(e, t, r) {
    super(e, t), this.name = e, this.innerGlow = !0, this.outerGlow = !0, this.onBeforeBlurObservable = new Oe(), this.onAfterBlurObservable = new Oe(), this._instanceGlowingMeshStencilReference = Ad.GlowingMeshStencilReference++, this._meshes = {}, this._excludedMeshes = {}, this.neutralColor = Ad.NeutralColor, this._engine.isStencilEnable || Se.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }"), this._options = Object.assign({ mainTextureRatio: 0.5, blurTextureSizeRatio: 0.5, blurHorizontalSize: 1, blurVerticalSize: 1, alphaBlendingMode: 2, camera: null, renderingGroupId: -1, mainTextureType: 0 }, r), this._init({
      alphaBlendingMode: this._options.alphaBlendingMode,
      camera: this._options.camera,
      mainTextureFixedSize: this._options.mainTextureFixedSize,
      mainTextureRatio: this._options.mainTextureRatio,
      renderingGroupId: this._options.renderingGroupId,
      mainTextureType: this._options.mainTextureType
    }), this._shouldRender = !1;
  }
  /**
   * Get the effect name of the layer.
   * @returns The effect name
   */
  getEffectName() {
    return Ad.EffectName;
  }
  _numInternalDraws() {
    return 2;
  }
  /**
   * Create the merge effect. This is the shader use to blit the information back
   * to the main canvas at the end of the scene rendering.
   */
  _createMergeEffect() {
    return this._engine.createEffect("glowMapMerge", [J.PositionKind], ["offset"], ["textureSampler"], this._options.isStroke ? `#define STROKE 
` : void 0);
  }
  /**
   * Creates the render target textures and post processes used in the highlight layer.
   */
  _createTextureAndPostProcesses() {
    let e = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio, t = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;
    e = this._engine.needPOTTextures ? Ge.GetExponentOfTwo(e, this._maxSize) : e, t = this._engine.needPOTTextures ? Ge.GetExponentOfTwo(t, this._maxSize) : t;
    let r = 0;
    this._engine.getCaps().textureHalfFloatRender ? r = 2 : r = 0, this._blurTexture = new Ta("HighlightLayerBlurRTT", {
      width: e,
      height: t
    }, this._scene, !1, !0, r), this._blurTexture.wrapU = We.CLAMP_ADDRESSMODE, this._blurTexture.wrapV = We.CLAMP_ADDRESSMODE, this._blurTexture.anisotropicFilteringLevel = 16, this._blurTexture.updateSamplingMode(We.TRILINEAR_SAMPLINGMODE), this._blurTexture.renderParticles = !1, this._blurTexture.ignoreCameraViewport = !0, this._textures = [this._blurTexture], this._options.alphaBlendingMode === 2 ? (this._downSamplePostprocess = new lg("HighlightLayerPPP", this._options.blurTextureSizeRatio, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._downSamplePostprocess.externalTextureSamplerBinding = !0, this._downSamplePostprocess.onApplyObservable.add((n) => {
      n.setTexture("textureSampler", this._mainTexture);
    }), this._horizontalBlurPostprocess = new YG("HighlightLayerHBP", new at(1, 0), this._options.blurHorizontalSize, 1, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._horizontalBlurPostprocess.onApplyObservable.add((n) => {
      n.setFloat2("screenSize", e, t);
    }), this._verticalBlurPostprocess = new YG("HighlightLayerVBP", new at(0, 1), this._options.blurVerticalSize, 1, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._verticalBlurPostprocess.onApplyObservable.add((n) => {
      n.setFloat2("screenSize", e, t);
    }), this._postProcesses = [this._downSamplePostprocess, this._horizontalBlurPostprocess, this._verticalBlurPostprocess]) : (this._horizontalBlurPostprocess = new c9("HighlightLayerHBP", new at(1, 0), this._options.blurHorizontalSize / 2, {
      width: e,
      height: t
    }, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, r), this._horizontalBlurPostprocess.width = e, this._horizontalBlurPostprocess.height = t, this._horizontalBlurPostprocess.externalTextureSamplerBinding = !0, this._horizontalBlurPostprocess.onApplyObservable.add((n) => {
      n.setTexture("textureSampler", this._mainTexture);
    }), this._verticalBlurPostprocess = new c9("HighlightLayerVBP", new at(0, 1), this._options.blurVerticalSize / 2, {
      width: e,
      height: t
    }, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, r), this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess]), this._mainTexture.onAfterUnbindObservable.add(() => {
      this.onBeforeBlurObservable.notifyObservers(this);
      const n = this._blurTexture.renderTarget;
      n && (this._scene.postProcessManager.directRender(this._postProcesses, n, !0), this._engine.unBindFramebuffer(n, !0)), this.onAfterBlurObservable.notifyObservers(this);
    }), this._postProcesses.map((n) => {
      n.autoClear = !1;
    });
  }
  /**
   * Returns whether or not the layer needs stencil enabled during the mesh rendering.
   */
  needStencil() {
    return !0;
  }
  /**
   * Checks for the readiness of the element composing the layer.
   * @param subMesh the mesh to check for
   * @param useInstances specify whether or not to use instances to render the mesh
   * @returns true if ready otherwise, false
   */
  isReady(e, t) {
    const r = e.getMaterial(), n = e.getRenderingMesh();
    if (!r || !n || !this._meshes)
      return !1;
    let i = null;
    const s = this._meshes[n.uniqueId];
    return s && s.glowEmissiveOnly && r && (i = r.emissiveTexture), super._isReady(e, t, i);
  }
  /**
   * Implementation specific of rendering the generating effect on the main canvas.
   * @param effect The effect used to render through
   * @param renderIndex
   */
  _internalRender(e, t) {
    e.setTexture("textureSampler", this._blurTexture);
    const r = this._engine;
    r.cacheStencilState(), r.setStencilOperationPass(7681), r.setStencilOperationFail(7680), r.setStencilOperationDepthFail(7680), r.setStencilMask(0), r.setStencilBuffer(!0), r.setStencilFunctionReference(this._instanceGlowingMeshStencilReference), this.outerGlow && t === 0 && (e.setFloat("offset", 0), r.setStencilFunction(517), r.drawElementsType(gt.TriangleFillMode, 0, 6)), this.innerGlow && t === 1 && (e.setFloat("offset", 1), r.setStencilFunction(514), r.drawElementsType(gt.TriangleFillMode, 0, 6)), r.restoreStencilState();
  }
  /**
   * Returns true if the layer contains information to display, otherwise false.
   */
  shouldRender() {
    return super.shouldRender() ? !!this._meshes : !1;
  }
  /**
   * Returns true if the mesh should render, otherwise false.
   * @param mesh The mesh to render
   * @returns true if it should render otherwise false
   */
  _shouldRenderMesh(e) {
    return !(this._excludedMeshes && this._excludedMeshes[e.uniqueId] || !super.hasMesh(e));
  }
  /**
   * Returns true if the mesh can be rendered, otherwise false.
   * @param mesh The mesh to render
   * @param material The material used on the mesh
   * @returns true if it can be rendered otherwise false
   */
  _canRenderMesh(e, t) {
    return !0;
  }
  /**
   * Adds specific effects defines.
   * @param defines The defines to add specifics to.
   */
  _addCustomEffectDefines(e) {
    e.push("#define HIGHLIGHT");
  }
  /**
   * Sets the required values for both the emissive texture and and the main color.
   * @param mesh
   * @param subMesh
   * @param material
   */
  _setEmissiveTextureAndColor(e, t, r) {
    const n = this._meshes[e.uniqueId];
    n ? this._emissiveTextureAndColor.color.set(n.color.r, n.color.g, n.color.b, 1) : this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a), n && n.glowEmissiveOnly && r ? (this._emissiveTextureAndColor.texture = r.emissiveTexture, this._emissiveTextureAndColor.color.set(1, 1, 1, 1)) : this._emissiveTextureAndColor.texture = null;
  }
  /**
   * Add a mesh in the exclusion list to prevent it to impact or being impacted by the highlight layer.
   * @param mesh The mesh to exclude from the highlight layer
   */
  addExcludedMesh(e) {
    if (!this._excludedMeshes)
      return;
    if (!this._excludedMeshes[e.uniqueId]) {
      const r = {
        mesh: e,
        beforeBind: null,
        afterRender: null,
        stencilState: !1
      };
      r.beforeBind = e.onBeforeBindObservable.add((n) => {
        r.stencilState = n.getEngine().getStencilBuffer(), n.getEngine().setStencilBuffer(!1);
      }), r.afterRender = e.onAfterRenderObservable.add((n) => {
        n.getEngine().setStencilBuffer(r.stencilState);
      }), this._excludedMeshes[e.uniqueId] = r;
    }
  }
  /**
   * Remove a mesh from the exclusion list to let it impact or being impacted by the highlight layer.
   * @param mesh The mesh to highlight
   */
  removeExcludedMesh(e) {
    if (!this._excludedMeshes)
      return;
    const t = this._excludedMeshes[e.uniqueId];
    t && (t.beforeBind && e.onBeforeBindObservable.remove(t.beforeBind), t.afterRender && e.onAfterRenderObservable.remove(t.afterRender)), this._excludedMeshes[e.uniqueId] = null;
  }
  /**
   * Determine if a given mesh will be highlighted by the current HighlightLayer
   * @param mesh mesh to test
   * @returns true if the mesh will be highlighted by the current HighlightLayer
   */
  hasMesh(e) {
    return !this._meshes || !super.hasMesh(e) ? !1 : this._meshes[e.uniqueId] !== void 0 && this._meshes[e.uniqueId] !== null;
  }
  /**
   * Add a mesh in the highlight layer in order to make it glow with the chosen color.
   * @param mesh The mesh to highlight
   * @param color The color of the highlight
   * @param glowEmissiveOnly Extract the glow from the emissive texture
   */
  addMesh(e, t, r = !1) {
    if (!this._meshes)
      return;
    const n = this._meshes[e.uniqueId];
    n ? n.color = t : (this._meshes[e.uniqueId] = {
      mesh: e,
      color: t,
      // Lambda required for capture due to Observable this context
      observerHighlight: e.onBeforeBindObservable.add((i) => {
        this.isEnabled && (this._excludedMeshes && this._excludedMeshes[i.uniqueId] ? this._defaultStencilReference(i) : i.getScene().getEngine().setStencilFunctionReference(this._instanceGlowingMeshStencilReference));
      }),
      observerDefault: e.onAfterRenderObservable.add((i) => {
        this.isEnabled && this._defaultStencilReference(i);
      }),
      glowEmissiveOnly: r
    }, e.onDisposeObservable.add(() => {
      this._disposeMesh(e);
    })), this._shouldRender = !0;
  }
  /**
   * Remove a mesh from the highlight layer in order to make it stop glowing.
   * @param mesh The mesh to highlight
   */
  removeMesh(e) {
    if (!this._meshes)
      return;
    const t = this._meshes[e.uniqueId];
    t && (t.observerHighlight && e.onBeforeBindObservable.remove(t.observerHighlight), t.observerDefault && e.onAfterRenderObservable.remove(t.observerDefault), delete this._meshes[e.uniqueId]), this._shouldRender = !1;
    for (const r in this._meshes)
      if (this._meshes[r]) {
        this._shouldRender = !0;
        break;
      }
  }
  /**
   * Remove all the meshes currently referenced in the highlight layer
   */
  removeAllMeshes() {
    if (this._meshes) {
      for (const e in this._meshes)
        if (Object.prototype.hasOwnProperty.call(this._meshes, e)) {
          const t = this._meshes[e];
          t && this.removeMesh(t.mesh);
        }
    }
  }
  /**
   * Force the stencil to the normal expected value for none glowing parts
   * @param mesh
   */
  _defaultStencilReference(e) {
    e.getScene().getEngine().setStencilFunctionReference(Ad.NormalMeshStencilReference);
  }
  /**
   * Free any resources and references associated to a mesh.
   * Internal use
   * @param mesh The mesh to free.
   * @internal
   */
  _disposeMesh(e) {
    this.removeMesh(e), this.removeExcludedMesh(e);
  }
  /**
   * Dispose the highlight layer and free resources.
   */
  dispose() {
    if (this._meshes) {
      for (const e in this._meshes) {
        const t = this._meshes[e];
        t && t.mesh && (t.observerHighlight && t.mesh.onBeforeBindObservable.remove(t.observerHighlight), t.observerDefault && t.mesh.onAfterRenderObservable.remove(t.observerDefault));
      }
      this._meshes = null;
    }
    if (this._excludedMeshes) {
      for (const e in this._excludedMeshes) {
        const t = this._excludedMeshes[e];
        t && (t.beforeBind && t.mesh.onBeforeBindObservable.remove(t.beforeBind), t.afterRender && t.mesh.onAfterRenderObservable.remove(t.afterRender));
      }
      this._excludedMeshes = null;
    }
    super.dispose();
  }
  /**
   * Gets the class name of the effect layer
   * @returns the string with the class name of the effect layer
   */
  getClassName() {
    return "HighlightLayer";
  }
  /**
   * Serializes this Highlight layer
   * @returns a serialized Highlight layer object
   */
  serialize() {
    const e = jt.Serialize(this);
    if (e.customType = "BABYLON.HighlightLayer", e.meshes = [], this._meshes)
      for (const t in this._meshes) {
        const r = this._meshes[t];
        r && e.meshes.push({
          glowEmissiveOnly: r.glowEmissiveOnly,
          color: r.color.asArray(),
          meshId: r.mesh.id
        });
      }
    if (e.excludedMeshes = [], this._excludedMeshes)
      for (const t in this._excludedMeshes) {
        const r = this._excludedMeshes[t];
        r && e.excludedMeshes.push(r.mesh.id);
      }
    return e;
  }
  /**
   * Creates a Highlight layer from parsed Highlight layer data
   * @param parsedHightlightLayer defines the Highlight layer data
   * @param scene defines the current scene
   * @param rootUrl defines the root URL containing the Highlight layer information
   * @returns a parsed Highlight layer
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => new Ad(e.name, t, e.options), e, t, r);
    let i;
    for (i = 0; i < e.excludedMeshes.length; i++) {
      const s = t.getMeshById(e.excludedMeshes[i]);
      s && n.addExcludedMesh(s);
    }
    for (i = 0; i < e.meshes.length; i++) {
      const s = e.meshes[i], a = t.getMeshById(s.meshId);
      a && n.addMesh(a, Ne.FromArray(s.color), s.glowEmissiveOnly);
    }
    return n;
  }
}
Ad.EffectName = "HighlightLayer";
Ad.NeutralColor = new xt(0, 0, 0, 0);
Ad.GlowingMeshStencilReference = 2;
Ad.NormalMeshStencilReference = 1;
C([
  M()
], Ad.prototype, "innerGlow", void 0);
C([
  M()
], Ad.prototype, "outerGlow", void 0);
C([
  M()
], Ad.prototype, "blurHorizontalSize", null);
C([
  M()
], Ad.prototype, "blurVerticalSize", null);
C([
  M("options")
], Ad.prototype, "_options", void 0);
Ue("BABYLON.HighlightLayer", Ad);
class Qte {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_LAYER, this.scene = e || gr.LastCreatedScene, this.scene && (this._engine = this.scene.getEngine(), this.scene.layers = []);
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._beforeCameraDrawStage.registerStep(Ot.STEP_BEFORECAMERADRAW_LAYER, this, this._drawCameraBackground), this.scene._afterCameraDrawStage.registerStep(Ot.STEP_AFTERCAMERADRAW_LAYER, this, this._drawCameraForegroundWithPostProcessing), this.scene._afterCameraPostProcessStage.registerStep(Ot.STEP_AFTERCAMERAPOSTPROCESS_LAYER, this, this._drawCameraForegroundWithoutPostProcessing), this.scene._beforeRenderTargetDrawStage.registerStep(Ot.STEP_BEFORERENDERTARGETDRAW_LAYER, this, this._drawRenderTargetBackground), this.scene._afterRenderTargetDrawStage.registerStep(Ot.STEP_AFTERRENDERTARGETDRAW_LAYER, this, this._drawRenderTargetForegroundWithPostProcessing), this.scene._afterRenderTargetPostProcessStage.registerStep(Ot.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER, this, this._drawRenderTargetForegroundWithoutPostProcessing);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
    const e = this.scene.layers;
    for (const t of e)
      t._rebuild();
  }
  /**
   * Disposes the component and the associated resources.
   */
  dispose() {
    const e = this.scene.layers;
    for (; e.length; )
      e[0].dispose();
  }
  _draw(e) {
    const t = this.scene.layers;
    if (t.length) {
      this._engine.setDepthBuffer(!1);
      for (const r of t)
        e(r) && r.render();
      this._engine.setDepthBuffer(!0);
    }
  }
  _drawCameraPredicate(e, t, r, n) {
    return !e.renderOnlyInRenderTargetTextures && e.isBackground === t && e.applyPostProcess === r && (e.layerMask & n) !== 0;
  }
  _drawCameraBackground(e) {
    this._draw((t) => this._drawCameraPredicate(t, !0, !0, e.layerMask));
  }
  _drawCameraForegroundWithPostProcessing(e) {
    this._draw((t) => this._drawCameraPredicate(t, !1, !0, e.layerMask));
  }
  _drawCameraForegroundWithoutPostProcessing(e) {
    this._draw((t) => this._drawCameraPredicate(t, !1, !1, e.layerMask));
  }
  _drawRenderTargetPredicate(e, t, r, n, i) {
    return e.renderTargetTextures.length > 0 && e.isBackground === t && e.applyPostProcess === r && e.renderTargetTextures.indexOf(i) > -1 && (e.layerMask & n) !== 0;
  }
  _drawRenderTargetBackground(e) {
    this._draw((t) => this._drawRenderTargetPredicate(t, !0, !0, this.scene.activeCamera.layerMask, e));
  }
  _drawRenderTargetForegroundWithPostProcessing(e) {
    this._draw((t) => this._drawRenderTargetPredicate(t, !1, !0, this.scene.activeCamera.layerMask, e));
  }
  _drawRenderTargetForegroundWithoutPostProcessing(e) {
    this._draw((t) => this._drawRenderTargetPredicate(t, !1, !1, this.scene.activeCamera.layerMask, e));
  }
  /**
   * Adds all the elements from the container to the scene
   * @param container the container holding the elements
   */
  addFromContainer(e) {
    e.layers && e.layers.forEach((t) => {
      this.scene.layers.push(t);
    });
  }
  /**
   * Removes all the elements in the container from the scene
   * @param container contains the elements to remove
   * @param dispose if the removed element should be disposed (default: false)
   */
  removeFromContainer(e, t = !1) {
    e.layers && e.layers.forEach((r) => {
      const n = this.scene.layers.indexOf(r);
      n !== -1 && this.scene.layers.splice(n, 1), t && r.dispose();
    });
  }
}
const j3e = "layerPixelShader", w3e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec4 color;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 baseColor=texture2D(textureSampler,vUV);
#ifdef LINEAR
baseColor.rgb=toGammaSpace(baseColor.rgb);
#endif
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
gl_FragColor=baseColor*color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[j3e] = w3e;
const m3e = "layerVertexShader", B3e = `attribute vec2 position;uniform vec2 scale;uniform vec2 offset;uniform mat4 textureMatrix;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec2 shiftedPosition=position*scale+offset;vUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));gl_Position=vec4(shiftedPosition,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[m3e] = B3e;
class Yte {
  /**
   * Determines if the layer is drawn before (true) or after (false) post-processing.
   * If the layer is background, it is always before.
   */
  set applyPostProcess(e) {
    this._applyPostProcess = e;
  }
  get applyPostProcess() {
    return this.isBackground || this._applyPostProcess;
  }
  /**
   * Back compatibility with callback before the onDisposeObservable existed.
   * The set callback will be triggered when the layer has been disposed.
   */
  set onDispose(e) {
    this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);
  }
  /**
   * Back compatibility with callback before the onBeforeRenderObservable existed.
   * The set callback will be triggered just before rendering the layer.
   */
  set onBeforeRender(e) {
    this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e);
  }
  /**
   * Back compatibility with callback before the onAfterRenderObservable existed.
   * The set callback will be triggered just after rendering the layer.
   */
  set onAfterRender(e) {
    this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(e);
  }
  /**
   * Instantiates a new layer.
   * This represents a full screen 2d layer.
   * This can be useful to display a picture in the  background of your scene for instance.
   * @see https://www.babylonjs-playground.com/#08A2BS#1
   * @param name Define the name of the layer in the scene
   * @param imgUrl Define the url of the texture to display in the layer
   * @param scene Define the scene the layer belongs to
   * @param isBackground Defines whether the layer is displayed in front or behind the scene
   * @param color Defines a color for the layer
   */
  constructor(e, t, r, n, i) {
    this.name = e, this._applyPostProcess = !0, this.scale = new at(1, 1), this.offset = new at(0, 0), this.alphaBlendingMode = 2, this.layerMask = 268435455, this.renderTargetTextures = [], this.renderOnlyInRenderTargetTextures = !1, this.isEnabled = !0, this._vertexBuffers = {}, this.onDisposeObservable = new Oe(), this.onBeforeRenderObservable = new Oe(), this.onAfterRenderObservable = new Oe(), this.texture = t ? new We(t, r, !0) : null, this.isBackground = n === void 0 ? !0 : n, this.color = i === void 0 ? new xt(1, 1, 1, 1) : i, this._scene = r || gr.LastCreatedScene;
    let s = this._scene._getComponent(Ot.NAME_LAYER);
    s || (s = new Qte(this._scene), this._scene._addComponent(s)), this._scene.layers.push(this);
    const a = this._scene.getEngine();
    this._drawWrapper = new zo(a);
    const f = [];
    f.push(1, 1), f.push(-1, 1), f.push(-1, -1), f.push(1, -1);
    const o = new J(a, f, J.PositionKind, !1, !1, 2);
    this._vertexBuffers[J.PositionKind] = o, this._createIndexBuffer();
  }
  _createIndexBuffer() {
    const e = this._scene.getEngine(), t = [];
    t.push(0), t.push(1), t.push(2), t.push(0), t.push(2), t.push(3), this._indexBuffer = e.createIndexBuffer(t);
  }
  /** @internal */
  _rebuild() {
    const e = this._vertexBuffers[J.PositionKind];
    e && e._rebuild(), this._createIndexBuffer();
  }
  /**
   * Checks if the layer is ready to be rendered
   * @returns true if the layer is ready. False otherwise.
   */
  isReady() {
    var e;
    const t = this._scene.getEngine();
    let r = "";
    this.alphaTest && (r = "#define ALPHATEST"), this.texture && !this.texture.gammaSpace && (r += `
#define LINEAR`), this._previousDefines !== r && (this._previousDefines = r, this._drawWrapper.effect = t.createEffect("layer", [J.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], r));
    const n = this._drawWrapper.effect;
    return (n == null ? void 0 : n.isReady()) && ((e = this.texture) === null || e === void 0 ? void 0 : e.isReady());
  }
  /**
   * Renders the layer in the scene.
   */
  render() {
    if (!this.isEnabled)
      return;
    const e = this._scene.getEngine();
    if (!this.isReady())
      return;
    const t = this._drawWrapper.effect;
    this.onBeforeRenderObservable.notifyObservers(this), e.enableEffect(this._drawWrapper), e.setState(!1), t.setTexture("textureSampler", this.texture), t.setMatrix("textureMatrix", this.texture.getTextureMatrix()), t.setFloat4("color", this.color.r, this.color.g, this.color.b, this.color.a), t.setVector2("offset", this.offset), t.setVector2("scale", this.scale), e.bindBuffers(this._vertexBuffers, this._indexBuffer, t), this.alphaTest ? e.drawElementsType(gt.TriangleFillMode, 0, 6) : (e.setAlphaMode(this.alphaBlendingMode), e.drawElementsType(gt.TriangleFillMode, 0, 6), e.setAlphaMode(0)), this.onAfterRenderObservable.notifyObservers(this);
  }
  /**
   * Disposes and releases the associated resources.
   */
  dispose() {
    const e = this._vertexBuffers[J.PositionKind];
    e && (e.dispose(), this._vertexBuffers[J.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this.texture && (this.texture.dispose(), this.texture = null), this.renderTargetTextures = [];
    const t = this._scene.layers.indexOf(this);
    this._scene.layers.splice(t, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderObservable.clear();
  }
}
class ly {
  /**
   * Creates a new Lens Flare.
   * This represents one of the lens effect in a `lensFlareSystem`.
   * It controls one of the individual texture used in the effect.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
   * @param size Define the size of the lens flare (a floating value between 0 and 1)
   * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
   * @param color Define the lens color
   * @param imgUrl Define the lens texture url
   * @param system Define the `lensFlareSystem` this flare is part of
   * @returns The newly created Lens Flare
   */
  static AddFlare(e, t, r, n, i) {
    return new ly(e, t, r, n, i);
  }
  /**
   * Instantiates a new Lens Flare.
   * This represents one of the lens effect in a `lensFlareSystem`.
   * It controls one of the individual texture used in the effect.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
   * @param size Define the size of the lens flare in the system (a floating value between 0 and 1)
   * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
   * @param color Define the lens color
   * @param imgUrl Define the lens texture url
   * @param system Define the `lensFlareSystem` this flare is part of
   */
  constructor(e, t, r, n, i) {
    this.size = e, this.position = t, this.alphaMode = 6, this.color = r || new Ne(1, 1, 1), this.texture = n ? new We(n, i.getScene(), !0) : null, this._system = i;
    const s = i.scene.getEngine();
    this._drawWrapper = new zo(s), this._drawWrapper.effect = s.createEffect("lensFlare", [J.PositionKind], ["color", "viewportMatrix"], ["textureSampler"], ""), i.lensFlares.push(this);
  }
  /**
   * Dispose and release the lens flare with its associated resources.
   */
  dispose() {
    this.texture && this.texture.dispose();
    const e = this._system.lensFlares.indexOf(this);
    this._system.lensFlares.splice(e, 1);
  }
}
const W3e = "lensFlarePixelShader", S3e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec4 color;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 baseColor=texture2D(textureSampler,vUV);gl_FragColor=baseColor*color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[W3e] = S3e;
const U3e = "lensFlareVertexShader", I3e = `attribute vec2 position;uniform mat4 viewportMatrix;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=position*madd+madd;gl_Position=viewportMatrix*vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[U3e] = I3e;
class gm {
  /** Gets the scene */
  get scene() {
    return this._scene;
  }
  /**
   * Instantiates a lens flare system.
   * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
   * It is usually composed of several `lensFlare`.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
   * @param name Define the name of the lens flare system in the scene
   * @param emitter Define the source (the emitter) of the lens flares (it can be a camera, a light or a mesh).
   * @param scene Define the scene the lens flare system belongs to
   */
  constructor(e, t, r) {
    this.name = e, this.lensFlares = [], this.borderLimit = 300, this.viewportBorder = 0, this.layerMask = 268435455, this._vertexBuffers = {}, this._isEnabled = !0, this._scene = r || gr.LastCreatedScene, gm._SceneComponentInitialization(this._scene), this._emitter = t, this.id = e, r.lensFlareSystems.push(this), this.meshesSelectionPredicate = (s) => r.activeCamera && s.material && s.isVisible && s.isEnabled() && s.isBlocker && (s.layerMask & r.activeCamera.layerMask) != 0;
    const n = r.getEngine(), i = [];
    i.push(1, 1), i.push(-1, 1), i.push(-1, -1), i.push(1, -1), this._vertexBuffers[J.PositionKind] = new J(n, i, J.PositionKind, !1, !1, 2), this._createIndexBuffer();
  }
  _createIndexBuffer() {
    const e = [];
    e.push(0), e.push(1), e.push(2), e.push(0), e.push(2), e.push(3), this._indexBuffer = this._scene.getEngine().createIndexBuffer(e);
  }
  /**
   * Define if the lens flare system is enabled.
   */
  get isEnabled() {
    return this._isEnabled;
  }
  set isEnabled(e) {
    this._isEnabled = e;
  }
  /**
   * Get the scene the effects belongs to.
   * @returns the scene holding the lens flare system
   */
  getScene() {
    return this._scene;
  }
  /**
   * Get the emitter of the lens flare system.
   * It defines the source of the lens flares (it can be a camera, a light or a mesh).
   * @returns the emitter of the lens flare system
   */
  getEmitter() {
    return this._emitter;
  }
  /**
   * Set the emitter of the lens flare system.
   * It defines the source of the lens flares (it can be a camera, a light or a mesh).
   * @param newEmitter Define the new emitter of the system
   */
  setEmitter(e) {
    this._emitter = e;
  }
  /**
   * Get the lens flare system emitter position.
   * The emitter defines the source of the lens flares (it can be a camera, a light or a mesh).
   * @returns the position
   */
  getEmitterPosition() {
    return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;
  }
  /**
   * @internal
   */
  computeEffectivePosition(e) {
    let t = this.getEmitterPosition();
    t = S.Project(t, he.Identity(), this._scene.getTransformMatrix(), e), this._positionX = t.x, this._positionY = t.y, t = S.TransformCoordinates(this.getEmitterPosition(), this._scene.getViewMatrix()), this.viewportBorder > 0 && (e.x -= this.viewportBorder, e.y -= this.viewportBorder, e.width += this.viewportBorder * 2, e.height += this.viewportBorder * 2, t.x += this.viewportBorder, t.y += this.viewportBorder, this._positionX += this.viewportBorder, this._positionY += this.viewportBorder);
    const r = this._scene.useRightHandedSystem;
    return t.z > 0 && !r || t.z < 0 && r ? (this._positionX > e.x && this._positionX < e.x + e.width && this._positionY > e.y && this._positionY < e.y + e.height, !0) : !1;
  }
  /** @internal */
  _isVisible() {
    if (!this._isEnabled || !this._scene.activeCamera)
      return !1;
    const t = this.getEmitterPosition().subtract(this._scene.activeCamera.globalPosition), r = t.length();
    t.normalize();
    const n = new Hi(this._scene.activeCamera.globalPosition, t), i = this._scene.pickWithRay(n, this.meshesSelectionPredicate, !0);
    return !i || !i.hit || i.distance > r;
  }
  /**
   * @internal
   */
  render() {
    if (!this._scene.activeCamera)
      return !1;
    const e = this._scene.getEngine(), r = this._scene.activeCamera.viewport.toGlobal(e.getRenderWidth(!0), e.getRenderHeight(!0));
    if (!this.computeEffectivePosition(r) || !this._isVisible())
      return !1;
    let n, i;
    this._positionX < this.borderLimit + r.x ? n = this.borderLimit + r.x - this._positionX : this._positionX > r.x + r.width - this.borderLimit ? n = this._positionX - r.x - r.width + this.borderLimit : n = 0, this._positionY < this.borderLimit + r.y ? i = this.borderLimit + r.y - this._positionY : this._positionY > r.y + r.height - this.borderLimit ? i = this._positionY - r.y - r.height + this.borderLimit : i = 0;
    let s = n > i ? n : i;
    s -= this.viewportBorder, s > this.borderLimit && (s = this.borderLimit);
    let a = 1 - Xt.Clamp(s / this.borderLimit, 0, 1);
    if (a < 0)
      return !1;
    a > 1 && (a = 1), this.viewportBorder > 0 && (r.x += this.viewportBorder, r.y += this.viewportBorder, r.width -= this.viewportBorder * 2, r.height -= this.viewportBorder * 2, this._positionX -= this.viewportBorder, this._positionY -= this.viewportBorder);
    const f = r.x + r.width / 2, o = r.y + r.height / 2, d = f - this._positionX, v = o - this._positionY;
    e.setState(!1), e.setDepthBuffer(!1);
    for (let u = 0; u < this.lensFlares.length; u++) {
      const l = this.lensFlares[u];
      if (!l._drawWrapper.effect.isReady() || l.texture && !l.texture.isReady())
        continue;
      e.enableEffect(l._drawWrapper), e.bindBuffers(this._vertexBuffers, this._indexBuffer, l._drawWrapper.effect), e.setAlphaMode(l.alphaMode);
      const P = f - d * l.position, p = o - v * l.position, c = l.size, H = l.size * e.getAspectRatio(this._scene.activeCamera, !0), T = 2 * (P / (r.width + r.x * 2)) - 1, q = 1 - 2 * (p / (r.height + r.y * 2)), b = he.FromValues(c / 2, 0, 0, 0, 0, H / 2, 0, 0, 0, 0, 1, 0, T, q, 0, 1);
      l._drawWrapper.effect.setMatrix("viewportMatrix", b), l._drawWrapper.effect.setTexture("textureSampler", l.texture), l._drawWrapper.effect.setFloat4("color", l.color.r * a, l.color.g * a, l.color.b * a, 1), e.drawElementsType(gt.TriangleFillMode, 0, 6);
    }
    return e.setDepthBuffer(!0), e.setAlphaMode(0), !0;
  }
  /**
   * Rebuilds the lens flare system
   */
  rebuild() {
    var e;
    this._createIndexBuffer();
    for (const t in this._vertexBuffers)
      (e = this._vertexBuffers[t]) === null || e === void 0 || e._rebuild();
  }
  /**
   * Dispose and release the lens flare with its associated resources.
   */
  dispose() {
    const e = this._vertexBuffers[J.PositionKind];
    for (e && (e.dispose(), this._vertexBuffers[J.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null); this.lensFlares.length; )
      this.lensFlares[0].dispose();
    const t = this._scene.lensFlareSystems.indexOf(this);
    this._scene.lensFlareSystems.splice(t, 1);
  }
  /**
   * Parse a lens flare system from a JSON representation
   * @param parsedLensFlareSystem Define the JSON to parse
   * @param scene Define the scene the parsed system should be instantiated in
   * @param rootUrl Define the rootUrl of the load sequence to easily find a load relative dependencies such as textures
   * @returns the parsed system
   */
  static Parse(e, t, r) {
    const n = t.getLastEntryById(e.emitterId), i = e.name || "lensFlareSystem#" + e.emitterId, s = new gm(i, n, t);
    s.id = e.id || i, s.borderLimit = e.borderLimit;
    for (let a = 0; a < e.flares.length; a++) {
      const f = e.flares[a];
      ly.AddFlare(f.size, f.position, Ne.FromArray(f.color), f.textureName ? r + f.textureName : "", s);
    }
    return s;
  }
  /**
   * Serialize the current Lens Flare System into a JSON representation.
   * @returns the serialized JSON
   */
  serialize() {
    const e = {};
    e.id = this.id, e.name = this.name, e.emitterId = this.getEmitter().id, e.borderLimit = this.borderLimit, e.flares = [];
    for (let t = 0; t < this.lensFlares.length; t++) {
      const r = this.lensFlares[t];
      e.flares.push({
        size: r.size,
        position: r.position,
        color: r.color.asArray(),
        textureName: ye.GetFilename(r.texture ? r.texture.name : "")
      });
    }
    return e;
  }
}
gm._SceneComponentInitialization = (A) => {
  throw qn("LensFlareSystemSceneComponent");
};
J1.AddParser(Ot.NAME_LENSFLARESYSTEM, (A, e, t, r) => {
  if (A.lensFlareSystems !== void 0 && A.lensFlareSystems !== null) {
    t.lensFlareSystems || (t.lensFlareSystems = []);
    for (let n = 0, i = A.lensFlareSystems.length; n < i; n++) {
      const s = A.lensFlareSystems[n], a = gm.Parse(s, e, r);
      t.lensFlareSystems.push(a);
    }
  }
});
J1.prototype.getLensFlareSystemByName = function(A) {
  for (let e = 0; e < this.lensFlareSystems.length; e++)
    if (this.lensFlareSystems[e].name === A)
      return this.lensFlareSystems[e];
  return null;
};
J1.prototype.getLensFlareSystemById = function(A) {
  for (let e = 0; e < this.lensFlareSystems.length; e++)
    if (this.lensFlareSystems[e].id === A)
      return this.lensFlareSystems[e];
  return null;
};
J1.prototype.getLensFlareSystemByID = function(A) {
  return this.getLensFlareSystemById(A);
};
J1.prototype.removeLensFlareSystem = function(A) {
  const e = this.lensFlareSystems.indexOf(A);
  return e !== -1 && this.lensFlareSystems.splice(e, 1), e;
};
J1.prototype.addLensFlareSystem = function(A) {
  this.lensFlareSystems.push(A);
};
class Mte {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_LENSFLARESYSTEM, this.scene = e, e.lensFlareSystems = [];
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._afterCameraDrawStage.registerStep(Ot.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM, this, this._draw);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
    for (let e = 0; e < this.scene.lensFlareSystems.length; e++)
      this.scene.lensFlareSystems[e].rebuild();
  }
  /**
   * Adds all the elements from the container to the scene
   * @param container the container holding the elements
   */
  addFromContainer(e) {
    e.lensFlareSystems && e.lensFlareSystems.forEach((t) => {
      this.scene.addLensFlareSystem(t);
    });
  }
  /**
   * Removes all the elements in the container from the scene
   * @param container contains the elements to remove
   * @param dispose if the removed element should be disposed (default: false)
   */
  removeFromContainer(e, t) {
    e.lensFlareSystems && e.lensFlareSystems.forEach((r) => {
      this.scene.removeLensFlareSystem(r), t && r.dispose();
    });
  }
  /**
   * Serializes the component data to the specified json object
   * @param serializationObject The object to serialize to
   */
  serialize(e) {
    e.lensFlareSystems = [];
    const t = this.scene.lensFlareSystems;
    for (const r of t)
      e.lensFlareSystems.push(r.serialize());
  }
  /**
   * Disposes the component and the associated resources.
   */
  dispose() {
    const e = this.scene.lensFlareSystems;
    for (; e.length; )
      e[0].dispose();
  }
  _draw(e) {
    if (this.scene.lensFlaresEnabled) {
      const t = this.scene.lensFlareSystems;
      ye.StartPerformanceCounter("Lens flares", t.length > 0);
      for (const r of t)
        e.layerMask & r.layerMask && r.render();
      ye.EndPerformanceCounter("Lens flares", t.length > 0);
    }
  }
}
gm._SceneComponentInitialization = (A) => {
  let e = A._getComponent(Ot.NAME_LENSFLARESYSTEM);
  e || (e = new Mte(A), A._addComponent(e));
};
const R3e = "bayerDitherFunctions", V3e = `float bayerDither2(vec2 _P) {return mod(2.0*_P.y+_P.x+1.0,4.0);}
float bayerDither4(vec2 _P) {vec2 P1=mod(_P,2.0); 
vec2 P2=floor(0.5*mod(_P,4.0)); 
return 4.0*bayerDither2(P1)+bayerDither2(P2);}
float bayerDither8(vec2 _P) {vec2 P1=mod(_P,2.0); 
vec2 P2=floor(0.5 *mod(_P,4.0)); 
vec2 P4=floor(0.25*mod(_P,8.0)); 
return 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);}
`;
Le.IncludesShadersStore[R3e] = V3e;
const C3e = "shadowMapFragmentExtraDeclaration", O3e = `#if SM_FLOAT==0
#include<packingFunctions>
#endif
#if SM_SOFTTRANSPARENTSHADOW==1
#include<bayerDitherFunctions>
uniform float softTransparentShadowSM;
#endif
varying float vDepthMetricSM;
#if SM_USEDISTANCE==1
uniform vec3 lightDataSM;varying vec3 vPositionWSM;
#endif
uniform vec3 biasAndScaleSM;uniform vec2 depthValuesSM;
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
varying float zSM;
#endif
`;
Le.IncludesShadersStore[C3e] = O3e;
const y3e = "shadowMapFragment", k3e = `float depthSM=vDepthMetricSM;
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
#if SM_USEDISTANCE==1
depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#else
#ifdef USE_REVERSE_DEPTHBUFFER
depthSM=(-zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#else
depthSM=(zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#endif
#endif
#ifdef USE_REVERSE_DEPTHBUFFER
gl_FragDepth=clamp(1.0-depthSM,0.0,1.0);
#else
gl_FragDepth=clamp(depthSM,0.0,1.0); 
#endif
#elif SM_USEDISTANCE==1
depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#endif
#if SM_ESM==1
depthSM=clamp(exp(-min(87.,biasAndScaleSM.z*depthSM)),0.,1.);
#endif
#if SM_FLOAT==1
gl_FragColor=vec4(depthSM,1.0,1.0,1.0);
#else
gl_FragColor=pack(depthSM);
#endif
return;`;
Le.IncludesShadersStore[y3e] = k3e;
const E3e = "shadowMapPixelShader", F3e = `#include<shadowMapFragmentExtraDeclaration>
#ifdef ALPHATEXTURE
varying vec2 vUV;uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#include<clipPlaneFragment>
#ifdef ALPHATEXTURE
float alphaFromAlphaTexture=texture2D(diffuseSampler,vUV).a;
#ifdef ALPHATESTVALUE
if (alphaFromAlphaTexture<ALPHATESTVALUE)
discard;
#endif
#endif
#if SM_SOFTTRANSPARENTSHADOW==1
#ifdef ALPHATEXTURE
if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alphaFromAlphaTexture) discard;
#else
if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM) discard;
#endif
#endif
#include<shadowMapFragment>
}`;
Le.ShadersStore[E3e] = F3e;
const N3e = "sceneVertexDeclaration", Q3e = `uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
uniform mat4 view;uniform mat4 projection;uniform vec4 vEyePosition;
`;
Le.IncludesShadersStore[N3e] = Q3e;
const Y3e = "meshVertexDeclaration", M3e = `uniform mat4 world;uniform float visibility;
`;
Le.IncludesShadersStore[Y3e] = M3e;
const L3e = "shadowMapVertexDeclaration", K3e = `#include<sceneVertexDeclaration>
#include<meshVertexDeclaration>
`;
Le.IncludesShadersStore[L3e] = K3e;
const J3e = "shadowMapUboDeclaration", z3e = `layout(std140,column_major) uniform;
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;
Le.IncludesShadersStore[J3e] = z3e;
const G3e = "shadowMapVertexExtraDeclaration", Z3e = `#if SM_NORMALBIAS==1
uniform vec3 lightDataSM;
#endif
uniform vec3 biasAndScaleSM;uniform vec2 depthValuesSM;varying float vDepthMetricSM;
#if SM_USEDISTANCE==1
varying vec3 vPositionWSM;
#endif
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
varying float zSM;
#endif
`;
Le.IncludesShadersStore[G3e] = Z3e;
const _3e = "shadowMapVertexNormalBias", $3e = `#if SM_NORMALBIAS==1
#if SM_DIRECTIONINLIGHTDATA==1
vec3 worldLightDirSM=normalize(-lightDataSM.xyz);
#else
vec3 directionToLightSM=lightDataSM.xyz-worldPos.xyz;vec3 worldLightDirSM=normalize(directionToLightSM);
#endif
float ndlSM=dot(vNormalW,worldLightDirSM);float sinNLSM=sqrt(1.0-ndlSM*ndlSM);float normalBiasSM=biasAndScaleSM.y*sinNLSM;worldPos.xyz-=vNormalW*normalBiasSM;
#endif
`;
Le.IncludesShadersStore[_3e] = $3e;
const epe = "shadowMapVertexMetric", tpe = `#if SM_USEDISTANCE==1
vPositionWSM=worldPos.xyz;
#endif
#if SM_DEPTHTEXTURE==1
#ifdef IS_NDC_HALF_ZRANGE
#define BIASFACTOR 0.5
#else
#define BIASFACTOR 1.0
#endif
#ifdef USE_REVERSE_DEPTHBUFFER
gl_Position.z-=biasAndScaleSM.x*gl_Position.w*BIASFACTOR;
#else
gl_Position.z+=biasAndScaleSM.x*gl_Position.w*BIASFACTOR;
#endif
#endif
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
zSM=gl_Position.z;gl_Position.z=0.0;
#elif SM_USEDISTANCE==0
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetricSM=(-gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#else
vDepthMetricSM=(gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#endif
#endif
`;
Le.IncludesShadersStore[epe] = tpe;
const rpe = "shadowMapVertexShader", npe = `attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef INSTANCES
attribute vec4 world0;attribute vec4 world1;attribute vec4 world2;attribute vec4 world3;
#endif
#include<helperFunctions>
#include<__decl__shadowMapVertex>
#ifdef ALPHATEXTURE
varying vec2 vUV;uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#include<shadowMapVertexExtraDeclaration>
#include<clipPlaneVertexDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#ifdef NORMAL
vec3 normalUpdated=normal;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#ifdef NORMAL
mat3 normWorldSM=mat3(finalWorld);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vec3 vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normWorldSM=transposeMat3(inverseMat3(normWorldSM));
#endif
vec3 vNormalW=normalize(normWorldSM*normalUpdated);
#endif
#endif
#include<shadowMapVertexNormalBias>
gl_Position=viewProjection*worldPos;
#include<shadowMapVertexMetric>
#ifdef ALPHATEXTURE
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#include<clipPlaneVertex>
}`;
Le.ShadersStore[rpe] = npe;
const ipe = "depthBoxBlurPixelShader", spe = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec4 colorDepth=vec4(0.0);for (int x=-OFFSET; x<=OFFSET; x++)
for (int y=-OFFSET; y<=OFFSET; y++)
colorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);gl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));}`;
Le.ShadersStore[ipe] = spe;
const ape = "shadowMapFragmentSoftTransparentShadow", ope = `#if SM_SOFTTRANSPARENTSHADOW==1
if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alpha) discard;
#endif
`;
Le.IncludesShadersStore[ape] = ope;
class ln {
  /**
   * Gets the bias: offset applied on the depth preventing acnea (in light direction).
   */
  get bias() {
    return this._bias;
  }
  /**
   * Sets the bias: offset applied on the depth preventing acnea (in light direction).
   */
  set bias(e) {
    this._bias = e;
  }
  /**
   * Gets the normalBias: offset applied on the depth preventing acnea (along side the normal direction and proportional to the light/normal angle).
   */
  get normalBias() {
    return this._normalBias;
  }
  /**
   * Sets the normalBias: offset applied on the depth preventing acnea (along side the normal direction and proportional to the light/normal angle).
   */
  set normalBias(e) {
    this._normalBias = e;
  }
  /**
   * Gets the blur box offset: offset applied during the blur pass.
   * Only useful if useKernelBlur = false
   */
  get blurBoxOffset() {
    return this._blurBoxOffset;
  }
  /**
   * Sets the blur box offset: offset applied during the blur pass.
   * Only useful if useKernelBlur = false
   */
  set blurBoxOffset(e) {
    this._blurBoxOffset !== e && (this._blurBoxOffset = e, this._disposeBlurPostProcesses());
  }
  /**
   * Gets the blur scale: scale of the blurred texture compared to the main shadow map.
   * 2 means half of the size.
   */
  get blurScale() {
    return this._blurScale;
  }
  /**
   * Sets the blur scale: scale of the blurred texture compared to the main shadow map.
   * 2 means half of the size.
   */
  set blurScale(e) {
    this._blurScale !== e && (this._blurScale = e, this._disposeBlurPostProcesses());
  }
  /**
   * Gets the blur kernel: kernel size of the blur pass.
   * Only useful if useKernelBlur = true
   */
  get blurKernel() {
    return this._blurKernel;
  }
  /**
   * Sets the blur kernel: kernel size of the blur pass.
   * Only useful if useKernelBlur = true
   */
  set blurKernel(e) {
    this._blurKernel !== e && (this._blurKernel = e, this._disposeBlurPostProcesses());
  }
  /**
   * Gets whether the blur pass is a kernel blur (if true) or box blur.
   * Only useful in filtered mode (useBlurExponentialShadowMap...)
   */
  get useKernelBlur() {
    return this._useKernelBlur;
  }
  /**
   * Sets whether the blur pass is a kernel blur (if true) or box blur.
   * Only useful in filtered mode (useBlurExponentialShadowMap...)
   */
  set useKernelBlur(e) {
    this._useKernelBlur !== e && (this._useKernelBlur = e, this._disposeBlurPostProcesses());
  }
  /**
   * Gets the depth scale used in ESM mode.
   */
  get depthScale() {
    return this._depthScale !== void 0 ? this._depthScale : this._light.getDepthScale();
  }
  /**
   * Sets the depth scale used in ESM mode.
   * This can override the scale stored on the light.
   */
  set depthScale(e) {
    this._depthScale = e;
  }
  _validateFilter(e) {
    return e;
  }
  /**
   * Gets the current mode of the shadow generator (normal, PCF, ESM...).
   * The returned value is a number equal to one of the available mode defined in ShadowMap.FILTER_x like _FILTER_NONE
   */
  get filter() {
    return this._filter;
  }
  /**
   * Sets the current mode of the shadow generator (normal, PCF, ESM...).
   * The returned value is a number equal to one of the available mode defined in ShadowMap.FILTER_x like _FILTER_NONE
   */
  set filter(e) {
    if (e = this._validateFilter(e), this._light.needCube()) {
      if (e === ln.FILTER_BLUREXPONENTIALSHADOWMAP) {
        this.useExponentialShadowMap = !0;
        return;
      } else if (e === ln.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) {
        this.useCloseExponentialShadowMap = !0;
        return;
      } else if (e === ln.FILTER_PCF || e === ln.FILTER_PCSS) {
        this.usePoissonSampling = !0;
        return;
      }
    }
    if ((e === ln.FILTER_PCF || e === ln.FILTER_PCSS) && !this._scene.getEngine()._features.supportShadowSamplers) {
      this.usePoissonSampling = !0;
      return;
    }
    this._filter !== e && (this._filter = e, this._disposeBlurPostProcesses(), this._applyFilterValues(), this._light._markMeshesAsLightDirty());
  }
  /**
   * Gets if the current filter is set to Poisson Sampling.
   */
  get usePoissonSampling() {
    return this.filter === ln.FILTER_POISSONSAMPLING;
  }
  /**
   * Sets the current filter to Poisson Sampling.
   */
  set usePoissonSampling(e) {
    const t = this._validateFilter(ln.FILTER_POISSONSAMPLING);
    !e && this.filter !== ln.FILTER_POISSONSAMPLING || (this.filter = e ? t : ln.FILTER_NONE);
  }
  /**
   * Gets if the current filter is set to ESM.
   */
  get useExponentialShadowMap() {
    return this.filter === ln.FILTER_EXPONENTIALSHADOWMAP;
  }
  /**
   * Sets the current filter is to ESM.
   */
  set useExponentialShadowMap(e) {
    const t = this._validateFilter(ln.FILTER_EXPONENTIALSHADOWMAP);
    !e && this.filter !== ln.FILTER_EXPONENTIALSHADOWMAP || (this.filter = e ? t : ln.FILTER_NONE);
  }
  /**
   * Gets if the current filter is set to filtered ESM.
   */
  get useBlurExponentialShadowMap() {
    return this.filter === ln.FILTER_BLUREXPONENTIALSHADOWMAP;
  }
  /**
   * Gets if the current filter is set to filtered  ESM.
   */
  set useBlurExponentialShadowMap(e) {
    const t = this._validateFilter(ln.FILTER_BLUREXPONENTIALSHADOWMAP);
    !e && this.filter !== ln.FILTER_BLUREXPONENTIALSHADOWMAP || (this.filter = e ? t : ln.FILTER_NONE);
  }
  /**
   * Gets if the current filter is set to "close ESM" (using the inverse of the
   * exponential to prevent steep falloff artifacts).
   */
  get useCloseExponentialShadowMap() {
    return this.filter === ln.FILTER_CLOSEEXPONENTIALSHADOWMAP;
  }
  /**
   * Sets the current filter to "close ESM" (using the inverse of the
   * exponential to prevent steep falloff artifacts).
   */
  set useCloseExponentialShadowMap(e) {
    const t = this._validateFilter(ln.FILTER_CLOSEEXPONENTIALSHADOWMAP);
    !e && this.filter !== ln.FILTER_CLOSEEXPONENTIALSHADOWMAP || (this.filter = e ? t : ln.FILTER_NONE);
  }
  /**
   * Gets if the current filter is set to filtered "close ESM" (using the inverse of the
   * exponential to prevent steep falloff artifacts).
   */
  get useBlurCloseExponentialShadowMap() {
    return this.filter === ln.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP;
  }
  /**
   * Sets the current filter to filtered "close ESM" (using the inverse of the
   * exponential to prevent steep falloff artifacts).
   */
  set useBlurCloseExponentialShadowMap(e) {
    const t = this._validateFilter(ln.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);
    !e && this.filter !== ln.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP || (this.filter = e ? t : ln.FILTER_NONE);
  }
  /**
   * Gets if the current filter is set to "PCF" (percentage closer filtering).
   */
  get usePercentageCloserFiltering() {
    return this.filter === ln.FILTER_PCF;
  }
  /**
   * Sets the current filter to "PCF" (percentage closer filtering).
   */
  set usePercentageCloserFiltering(e) {
    const t = this._validateFilter(ln.FILTER_PCF);
    !e && this.filter !== ln.FILTER_PCF || (this.filter = e ? t : ln.FILTER_NONE);
  }
  /**
   * Gets the PCF or PCSS Quality.
   * Only valid if usePercentageCloserFiltering or usePercentageCloserFiltering is true.
   */
  get filteringQuality() {
    return this._filteringQuality;
  }
  /**
   * Sets the PCF or PCSS Quality.
   * Only valid if usePercentageCloserFiltering or usePercentageCloserFiltering is true.
   */
  set filteringQuality(e) {
    this._filteringQuality !== e && (this._filteringQuality = e, this._disposeBlurPostProcesses(), this._applyFilterValues(), this._light._markMeshesAsLightDirty());
  }
  /**
   * Gets if the current filter is set to "PCSS" (contact hardening).
   */
  get useContactHardeningShadow() {
    return this.filter === ln.FILTER_PCSS;
  }
  /**
   * Sets the current filter to "PCSS" (contact hardening).
   */
  set useContactHardeningShadow(e) {
    const t = this._validateFilter(ln.FILTER_PCSS);
    !e && this.filter !== ln.FILTER_PCSS || (this.filter = e ? t : ln.FILTER_NONE);
  }
  /**
   * Gets the Light Size (in shadow map uv unit) used in PCSS to determine the blocker search area and the penumbra size.
   * Using a ratio helps keeping shape stability independently of the map size.
   *
   * It does not account for the light projection as it was having too much
   * instability during the light setup or during light position changes.
   *
   * Only valid if useContactHardeningShadow is true.
   */
  get contactHardeningLightSizeUVRatio() {
    return this._contactHardeningLightSizeUVRatio;
  }
  /**
   * Sets the Light Size (in shadow map uv unit) used in PCSS to determine the blocker search area and the penumbra size.
   * Using a ratio helps keeping shape stability independently of the map size.
   *
   * It does not account for the light projection as it was having too much
   * instability during the light setup or during light position changes.
   *
   * Only valid if useContactHardeningShadow is true.
   */
  set contactHardeningLightSizeUVRatio(e) {
    this._contactHardeningLightSizeUVRatio = e;
  }
  /** Gets or sets the actual darkness of a shadow */
  get darkness() {
    return this._darkness;
  }
  set darkness(e) {
    this.setDarkness(e);
  }
  /**
   * Returns the darkness value (float). This can only decrease the actual darkness of a shadow.
   * 0 means strongest and 1 would means no shadow.
   * @returns the darkness.
   */
  getDarkness() {
    return this._darkness;
  }
  /**
   * Sets the darkness value (float). This can only decrease the actual darkness of a shadow.
   * @param darkness The darkness value 0 means strongest and 1 would means no shadow.
   * @returns the shadow generator allowing fluent coding.
   */
  setDarkness(e) {
    return e >= 1 ? this._darkness = 1 : e <= 0 ? this._darkness = 0 : this._darkness = e, this;
  }
  /** Gets or sets the ability to have transparent shadow  */
  get transparencyShadow() {
    return this._transparencyShadow;
  }
  set transparencyShadow(e) {
    this.setTransparencyShadow(e);
  }
  /**
   * Sets the ability to have transparent shadow (boolean).
   * @param transparent True if transparent else False
   * @returns the shadow generator allowing fluent coding
   */
  setTransparencyShadow(e) {
    return this._transparencyShadow = e, this;
  }
  /**
   * Gets the main RTT containing the shadow map (usually storing depth from the light point of view).
   * @returns The render target texture if present otherwise, null
   */
  getShadowMap() {
    return this._shadowMap;
  }
  /**
   * Gets the RTT used during rendering (can be a blurred version of the shadow map or the shadow map itself).
   * @returns The render target texture if the shadow map is present otherwise, null
   */
  getShadowMapForRendering() {
    return this._shadowMap2 ? this._shadowMap2 : this._shadowMap;
  }
  /**
   * Gets the class name of that object
   * @returns "ShadowGenerator"
   */
  getClassName() {
    return ln.CLASSNAME;
  }
  /**
   * Helper function to add a mesh and its descendants to the list of shadow casters.
   * @param mesh Mesh to add
   * @param includeDescendants boolean indicating if the descendants should be added. Default to true
   * @returns the Shadow Generator itself
   */
  addShadowCaster(e, t = !0) {
    if (!this._shadowMap)
      return this;
    if (this._shadowMap.renderList || (this._shadowMap.renderList = []), this._shadowMap.renderList.indexOf(e) === -1 && this._shadowMap.renderList.push(e), t)
      for (const r of e.getChildMeshes())
        this._shadowMap.renderList.indexOf(r) === -1 && this._shadowMap.renderList.push(r);
    return this;
  }
  /**
   * Helper function to remove a mesh and its descendants from the list of shadow casters
   * @param mesh Mesh to remove
   * @param includeDescendants boolean indicating if the descendants should be removed. Default to true
   * @returns the Shadow Generator itself
   */
  removeShadowCaster(e, t = !0) {
    if (!this._shadowMap || !this._shadowMap.renderList)
      return this;
    const r = this._shadowMap.renderList.indexOf(e);
    if (r !== -1 && this._shadowMap.renderList.splice(r, 1), t)
      for (const n of e.getChildren())
        this.removeShadowCaster(n);
    return this;
  }
  /**
   * Returns the associated light object.
   * @returns the light generating the shadow
   */
  getLight() {
    return this._light;
  }
  _getCamera() {
    var e;
    return (e = this._camera) !== null && e !== void 0 ? e : this._scene.activeCamera;
  }
  /**
   * Gets or sets the size of the texture what stores the shadows
   */
  get mapSize() {
    return this._mapSize;
  }
  set mapSize(e) {
    this._mapSize = e, this._light._markMeshesAsLightDirty(), this.recreateShadowMap();
  }
  /**
   * Creates a ShadowGenerator object.
   * A ShadowGenerator is the required tool to use the shadows.
   * Each light casting shadows needs to use its own ShadowGenerator.
   * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
   * @param mapSize The size of the texture what stores the shadows. Example : 1024.
   * @param light The light object generating the shadows.
   * @param usefullFloatFirst By default the generator will try to use half float textures but if you need precision (for self shadowing for instance), you can use this option to enforce full float texture.
   * @param camera Camera associated with this shadow generator (default: null). If null, takes the scene active camera at the time we need to access it
   * @param useRedTextureType Forces the generator to use a Red instead of a RGBA type for the shadow map texture format (default: false)
   */
  constructor(e, t, r, n, i) {
    this.onBeforeShadowMapRenderObservable = new Oe(), this.onAfterShadowMapRenderObservable = new Oe(), this.onBeforeShadowMapRenderMeshObservable = new Oe(), this.onAfterShadowMapRenderMeshObservable = new Oe(), this._bias = 5e-5, this._normalBias = 0, this._blurBoxOffset = 1, this._blurScale = 2, this._blurKernel = 1, this._useKernelBlur = !1, this._filter = ln.FILTER_NONE, this._filteringQuality = ln.QUALITY_HIGH, this._contactHardeningLightSizeUVRatio = 0.1, this._darkness = 0, this._transparencyShadow = !1, this.enableSoftTransparentShadow = !1, this.useOpacityTextureForTransparentShadow = !1, this.frustumEdgeFalloff = 0, this.forceBackFacesOnly = !1, this._lightDirection = S.Zero(), this._viewMatrix = he.Zero(), this._projectionMatrix = he.Zero(), this._transformMatrix = he.Zero(), this._cachedPosition = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cachedDirection = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._currentFaceIndex = 0, this._currentFaceIndexCache = 0, this._defaultTextureMatrix = he.Identity(), this._mapSize = e, this._light = t, this._scene = t.getScene(), this._camera = n ?? null, this._useRedTextureType = !!i;
    let s = t._shadowGenerators;
    s || (s = t._shadowGenerators = /* @__PURE__ */ new Map()), s.set(this._camera, this), this.id = t.id, this._useUBO = this._scene.getEngine().supportsUniformBuffers, this._useUBO && (this._sceneUBOs = [], this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for Shadow Generator (light "${this._light.name}")`))), ln._SceneComponentInitialization(this._scene);
    const a = this._scene.getEngine().getCaps();
    r ? a.textureFloatRender && a.textureFloatLinearFiltering ? this._textureType = 1 : a.textureHalfFloatRender && a.textureHalfFloatLinearFiltering ? this._textureType = 2 : this._textureType = 0 : a.textureHalfFloatRender && a.textureHalfFloatLinearFiltering ? this._textureType = 2 : a.textureFloatRender && a.textureFloatLinearFiltering ? this._textureType = 1 : this._textureType = 0, this._initializeGenerator(), this._applyFilterValues();
  }
  _initializeGenerator() {
    this._light._markMeshesAsLightDirty(), this._initializeShadowMap();
  }
  _createTargetRenderTexture() {
    const e = this._scene.getEngine();
    e._features.supportDepthStencilTexture ? (this._shadowMap = new Ta(this._light.name + "_shadowMap", this._mapSize, this._scene, !1, !0, this._textureType, this._light.needCube(), void 0, !1, !1, void 0, this._useRedTextureType ? 6 : 5), this._shadowMap.createDepthStencilTexture(e.useReverseDepthBuffer ? 516 : 513, !0)) : this._shadowMap = new Ta(this._light.name + "_shadowMap", this._mapSize, this._scene, !1, !0, this._textureType, this._light.needCube()), this._shadowMap.noPrePassRenderer = !0;
  }
  _initializeShadowMap() {
    if (this._createTargetRenderTexture(), this._shadowMap === null)
      return;
    this._shadowMap.wrapU = We.CLAMP_ADDRESSMODE, this._shadowMap.wrapV = We.CLAMP_ADDRESSMODE, this._shadowMap.anisotropicFilteringLevel = 1, this._shadowMap.updateSamplingMode(We.BILINEAR_SAMPLINGMODE), this._shadowMap.renderParticles = !1, this._shadowMap.ignoreCameraViewport = !0, this._storedUniqueId && (this._shadowMap.uniqueId = this._storedUniqueId), this._shadowMap.customRenderFunction = (n, i, s, a) => this._renderForShadowMap(n, i, s, a), this._shadowMap.customIsReadyFunction = () => !0;
    const e = this._scene.getEngine();
    this._shadowMap.onBeforeBindObservable.add(() => {
      var n;
      this._currentSceneUBO = this._scene.getSceneUniformBuffer(), (n = e._debugPushGroup) === null || n === void 0 || n.call(e, `shadow map generation for pass id ${e.currentRenderPassId}`, 1);
    }), this._shadowMap.onBeforeRenderObservable.add((n) => {
      this._sceneUBOs && this._scene.setSceneUniformBuffer(this._sceneUBOs[0]), this._currentFaceIndex = n, this._filter === ln.FILTER_PCF && e.setColorWrite(!1), this.getTransformMatrix(), this._scene.setTransformMatrix(this._viewMatrix, this._projectionMatrix), this._useUBO && (this._scene.getSceneUniformBuffer().unbindEffect(), this._scene.finalizeSceneUbo());
    }), this._shadowMap.onAfterUnbindObservable.add(() => {
      var n, i;
      if (this._sceneUBOs && this._scene.setSceneUniformBuffer(this._currentSceneUBO), this._scene.updateTransformMatrix(), this._filter === ln.FILTER_PCF && e.setColorWrite(!0), !this.useBlurExponentialShadowMap && !this.useBlurCloseExponentialShadowMap) {
        (n = e._debugPopGroup) === null || n === void 0 || n.call(e, 1);
        return;
      }
      const s = this.getShadowMapForRendering();
      s && (this._scene.postProcessManager.directRender(this._blurPostProcesses, s.renderTarget, !0), e.unBindFramebuffer(s.renderTarget, !0), (i = e._debugPopGroup) === null || i === void 0 || i.call(e, 1));
    });
    const t = new xt(0, 0, 0, 0), r = new xt(1, 1, 1, 1);
    this._shadowMap.onClearObservable.add((n) => {
      this._filter === ln.FILTER_PCF ? n.clear(r, !1, !0, !1) : this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? n.clear(t, !0, !0, !1) : n.clear(r, !0, !0, !1);
    }), this._shadowMap.onResizeObservable.add((n) => {
      this._storedUniqueId = this._shadowMap.uniqueId, this._mapSize = n.getRenderSize(), this._light._markMeshesAsLightDirty(), this.recreateShadowMap();
    });
    for (let n = $6.MIN_RENDERINGGROUPS; n < $6.MAX_RENDERINGGROUPS; n++)
      this._shadowMap.setRenderingAutoClearDepthStencil(n, !1);
  }
  _initializeBlurRTTAndPostProcesses() {
    const e = this._scene.getEngine(), t = this._mapSize / this.blurScale;
    (!this.useKernelBlur || this.blurScale !== 1) && (this._shadowMap2 = new Ta(this._light.name + "_shadowMap2", t, this._scene, !1, !0, this._textureType, void 0, void 0, !1), this._shadowMap2.wrapU = We.CLAMP_ADDRESSMODE, this._shadowMap2.wrapV = We.CLAMP_ADDRESSMODE, this._shadowMap2.updateSamplingMode(We.BILINEAR_SAMPLINGMODE)), this.useKernelBlur ? (this._kernelBlurXPostprocess = new c9(this._light.name + "KernelBlurX", new at(1, 0), this.blurKernel, 1, null, We.BILINEAR_SAMPLINGMODE, e, !1, this._textureType), this._kernelBlurXPostprocess.width = t, this._kernelBlurXPostprocess.height = t, this._kernelBlurXPostprocess.externalTextureSamplerBinding = !0, this._kernelBlurXPostprocess.onApplyObservable.add((r) => {
      r.setTexture("textureSampler", this._shadowMap);
    }), this._kernelBlurYPostprocess = new c9(this._light.name + "KernelBlurY", new at(0, 1), this.blurKernel, 1, null, We.BILINEAR_SAMPLINGMODE, e, !1, this._textureType), this._kernelBlurXPostprocess.autoClear = !1, this._kernelBlurYPostprocess.autoClear = !1, this._textureType === 0 && (this._kernelBlurXPostprocess.packedFloat = !0, this._kernelBlurYPostprocess.packedFloat = !0), this._blurPostProcesses = [this._kernelBlurXPostprocess, this._kernelBlurYPostprocess]) : (this._boxBlurPostprocess = new kr(this._light.name + "DepthBoxBlur", "depthBoxBlur", ["screenSize", "boxOffset"], [], 1, null, We.BILINEAR_SAMPLINGMODE, e, !1, "#define OFFSET " + this._blurBoxOffset, this._textureType), this._boxBlurPostprocess.externalTextureSamplerBinding = !0, this._boxBlurPostprocess.onApplyObservable.add((r) => {
      r.setFloat2("screenSize", t, t), r.setTexture("textureSampler", this._shadowMap);
    }), this._boxBlurPostprocess.autoClear = !1, this._blurPostProcesses = [this._boxBlurPostprocess]);
  }
  _renderForShadowMap(e, t, r, n) {
    let i;
    if (n.length)
      for (i = 0; i < n.length; i++)
        this._renderSubMeshForShadowMap(n.data[i]);
    for (i = 0; i < e.length; i++)
      this._renderSubMeshForShadowMap(e.data[i]);
    for (i = 0; i < t.length; i++)
      this._renderSubMeshForShadowMap(t.data[i]);
    if (this._transparencyShadow)
      for (i = 0; i < r.length; i++)
        this._renderSubMeshForShadowMap(r.data[i], !0);
    else
      for (i = 0; i < r.length; i++)
        r.data[i].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate = !1;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _bindCustomEffectForRenderSubMeshForShadowMap(e, t, r) {
    t.setMatrix("viewProjection", this.getTransformMatrix());
  }
  _renderSubMeshForShadowMap(e, t = !1) {
    var r, n;
    const i = e.getRenderingMesh(), s = e.getEffectiveMesh(), a = this._scene, f = a.getEngine(), o = e.getMaterial();
    if (s._internalAbstractMeshDataInfo._isActiveIntermediate = !1, !o || e.verticesCount === 0 || e._renderId === a.getRenderId())
      return;
    const d = s._getWorldMatrixDeterminant() < 0;
    let v = (r = i.overrideMaterialSideOrientation) !== null && r !== void 0 ? r : o.sideOrientation;
    d && (v = v === 0 ? 1 : 0);
    const u = v === 0;
    f.setState(o.backFaceCulling, void 0, void 0, u, o.cullBackFaces);
    const l = i._getInstancesRenderList(e._id, !!e.getReplacementMesh());
    if (l.mustReturn)
      return;
    const P = f.getCaps().instancedArrays && (l.visibleInstances[e._id] !== null && l.visibleInstances[e._id] !== void 0 || i.hasThinInstances);
    if (!(this.customAllowRendering && !this.customAllowRendering(e)))
      if (this.isReady(e, P, t)) {
        e._renderId = a.getRenderId();
        const p = o.shadowDepthWrapper, c = (n = p == null ? void 0 : p.getEffect(e, this, f.currentRenderPassId)) !== null && n !== void 0 ? n : e._getDrawWrapper(), H = zo.GetEffect(c);
        f.enableEffect(c), P || i._bind(e, H, o.fillMode), this.getTransformMatrix(), H.setFloat3("biasAndScaleSM", this.bias, this.normalBias, this.depthScale), this.getLight().getTypeID() === ci.LIGHTTYPEID_DIRECTIONALLIGHT ? H.setVector3("lightDataSM", this._cachedDirection) : H.setVector3("lightDataSM", this._cachedPosition);
        const T = this._getCamera();
        if (T && H.setFloat2("depthValuesSM", this.getLight().getDepthMinZ(T), this.getLight().getDepthMinZ(T) + this.getLight().getDepthMaxZ(T)), t && this.enableSoftTransparentShadow && H.setFloat("softTransparentShadowSM", s.visibility * o.alpha), p)
          e._setMainDrawWrapperOverride(c), p.standalone ? p.baseMaterial.bindForSubMesh(s.getWorldMatrix(), i, e) : o.bindForSubMesh(s.getWorldMatrix(), i, e), e._setMainDrawWrapperOverride(null);
        else {
          if (this._opacityTexture && (H.setTexture("diffuseSampler", this._opacityTexture), H.setMatrix("diffuseMatrix", this._opacityTexture.getTextureMatrix() || this._defaultTextureMatrix)), i.useBones && i.computeBonesUsingShaders && i.skeleton) {
            const b = i.skeleton;
            if (b.isUsingTextureForMatrices) {
              const j = b.getTransformMatrixTexture(i);
              if (!j)
                return;
              H.setTexture("boneSampler", j), H.setFloat("boneTextureWidth", 4 * (b.bones.length + 1));
            } else
              H.setMatrices("mBones", b.getTransformMatrices(i));
          }
          Ye.BindMorphTargetParameters(i, H), i.morphTargetManager && i.morphTargetManager.isUsingTextureForTargets && i.morphTargetManager._bind(H), Df(H, o, a);
        }
        !this._useUBO && !p && this._bindCustomEffectForRenderSubMeshForShadowMap(e, H, s), Ye.BindSceneUniformBuffer(H, this._scene.getSceneUniformBuffer()), this._scene.getSceneUniformBuffer().bindUniformBuffer();
        const q = s.getWorldMatrix();
        P && (s.getMeshUniformBuffer().bindToEffect(H, "Mesh"), s.transferToEffect(q)), this.forceBackFacesOnly && f.setState(!0, 0, !1, !0, o.cullBackFaces), this.onBeforeShadowMapRenderMeshObservable.notifyObservers(i), this.onBeforeShadowMapRenderObservable.notifyObservers(H), i._processRendering(s, e, H, o.fillMode, l, P, (b, j) => {
          s !== i && !b ? (i.getMeshUniformBuffer().bindToEffect(H, "Mesh"), i.transferToEffect(j)) : (s.getMeshUniformBuffer().bindToEffect(H, "Mesh"), s.transferToEffect(b ? j : q));
        }), this.forceBackFacesOnly && f.setState(!0, 0, !1, !1, o.cullBackFaces), this.onAfterShadowMapRenderObservable.notifyObservers(H), this.onAfterShadowMapRenderMeshObservable.notifyObservers(i);
      } else
        this._shadowMap && this._shadowMap.resetRefreshCounter();
  }
  _applyFilterValues() {
    this._shadowMap && (this.filter === ln.FILTER_NONE || this.filter === ln.FILTER_PCSS ? this._shadowMap.updateSamplingMode(We.NEAREST_SAMPLINGMODE) : this._shadowMap.updateSamplingMode(We.BILINEAR_SAMPLINGMODE));
  }
  /**
   * Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.
   * @param onCompiled Callback triggered at the and of the effects compilation
   * @param options Sets of optional options forcing the compilation with different modes
   */
  forceCompilation(e, t) {
    const r = Object.assign({ useInstances: !1 }, t), n = this.getShadowMap();
    if (!n) {
      e && e(this);
      return;
    }
    const i = n.renderList;
    if (!i) {
      e && e(this);
      return;
    }
    const s = [];
    for (const o of i)
      s.push(...o.subMeshes);
    if (s.length === 0) {
      e && e(this);
      return;
    }
    let a = 0;
    const f = () => {
      var o, d;
      if (!(!this._scene || !this._scene.getEngine())) {
        for (; this.isReady(s[a], r.useInstances, (d = (o = s[a].getMaterial()) === null || o === void 0 ? void 0 : o.needAlphaBlendingForMesh(s[a].getMesh())) !== null && d !== void 0 ? d : !1); )
          if (a++, a >= s.length) {
            e && e(this);
            return;
          }
        setTimeout(f, 16);
      }
    };
    f();
  }
  /**
   * Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.
   * @param options Sets of optional options forcing the compilation with different modes
   * @returns A promise that resolves when the compilation completes
   */
  forceCompilationAsync(e) {
    return new Promise((t) => {
      this.forceCompilation(() => {
        t();
      }, e);
    });
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _isReadyCustomDefines(e, t, r) {
  }
  _prepareShadowDefines(e, t, r, n) {
    r.push("#define SM_LIGHTTYPE_" + this._light.getClassName().toUpperCase()), r.push("#define SM_FLOAT " + (this._textureType !== 0 ? "1" : "0")), r.push("#define SM_ESM " + (this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? "1" : "0")), r.push("#define SM_DEPTHTEXTURE " + (this.usePercentageCloserFiltering || this.useContactHardeningShadow ? "1" : "0"));
    const i = e.getMesh();
    return r.push("#define SM_NORMALBIAS " + (this.normalBias && i.isVerticesDataPresent(J.NormalKind) ? "1" : "0")), r.push("#define SM_DIRECTIONINLIGHTDATA " + (this.getLight().getTypeID() === ci.LIGHTTYPEID_DIRECTIONALLIGHT ? "1" : "0")), r.push("#define SM_USEDISTANCE " + (this._light.needCube() ? "1" : "0")), r.push("#define SM_SOFTTRANSPARENTSHADOW " + (this.enableSoftTransparentShadow && n ? "1" : "0")), this._isReadyCustomDefines(r, e, t), r;
  }
  /**
   * Determine whether the shadow generator is ready or not (mainly all effects and related post processes needs to be ready).
   * @param subMesh The submesh we want to render in the shadow map
   * @param useInstances Defines whether will draw in the map using instances
   * @param isTransparent Indicates that isReady is called for a transparent subMesh
   * @returns true if ready otherwise, false
   */
  isReady(e, t, r) {
    var n;
    const i = e.getMaterial(), s = i == null ? void 0 : i.shadowDepthWrapper;
    if (this._opacityTexture = null, !i)
      return !1;
    const a = [];
    if (this._prepareShadowDefines(e, t, a, r), s) {
      if (!s.isReadyForSubMesh(e, a, this, t, this._scene.getEngine().currentRenderPassId))
        return !1;
    } else {
      const f = e._getDrawWrapper(void 0, !0);
      let o = f.effect, d = f.defines;
      const v = [J.PositionKind], u = e.getMesh();
      this.normalBias && u.isVerticesDataPresent(J.NormalKind) && (v.push(J.NormalKind), a.push("#define NORMAL"), u.nonUniformScaling && a.push("#define NONUNIFORMSCALING"));
      const l = i.needAlphaTesting();
      if ((l || i.needAlphaBlending()) && (this.useOpacityTextureForTransparentShadow ? this._opacityTexture = i.opacityTexture : this._opacityTexture = i.getAlphaTestTexture(), this._opacityTexture)) {
        if (!this._opacityTexture.isReady())
          return !1;
        const T = (n = i.alphaCutOff) !== null && n !== void 0 ? n : ln.DEFAULT_ALPHA_CUTOFF;
        a.push("#define ALPHATEXTURE"), l && a.push(`#define ALPHATESTVALUE ${T}${T % 1 === 0 ? "." : ""}`), u.isVerticesDataPresent(J.UVKind) && (v.push(J.UVKind), a.push("#define UV1")), u.isVerticesDataPresent(J.UV2Kind) && this._opacityTexture.coordinatesIndex === 1 && (v.push(J.UV2Kind), a.push("#define UV2"));
      }
      const P = new c1();
      if (u.useBones && u.computeBonesUsingShaders && u.skeleton) {
        v.push(J.MatricesIndicesKind), v.push(J.MatricesWeightsKind), u.numBoneInfluencers > 4 && (v.push(J.MatricesIndicesExtraKind), v.push(J.MatricesWeightsExtraKind));
        const T = u.skeleton;
        a.push("#define NUM_BONE_INFLUENCERS " + u.numBoneInfluencers), u.numBoneInfluencers > 0 && P.addCPUSkinningFallback(0, u), T.isUsingTextureForMatrices ? a.push("#define BONETEXTURE") : a.push("#define BonesPerMesh " + (T.bones.length + 1));
      } else
        a.push("#define NUM_BONE_INFLUENCERS 0");
      const p = u.morphTargetManager;
      let c = 0;
      if (p && p.numInfluencers > 0 && (a.push("#define MORPHTARGETS"), c = p.numInfluencers, a.push("#define NUM_MORPH_INFLUENCERS " + c), p.isUsingTextureForTargets && a.push("#define MORPHTARGETS_TEXTURE"), Ye.PrepareAttributesForMorphTargetsInfluencers(v, u, c)), xq(i, this._scene, a), t && (a.push("#define INSTANCES"), Ye.PushAttributesForInstances(v), e.getRenderingMesh().hasThinInstances && a.push("#define THIN_INSTANCES")), this.customShaderOptions && this.customShaderOptions.defines)
        for (const T of this.customShaderOptions.defines)
          a.indexOf(T) === -1 && a.push(T);
      const H = a.join(`
`);
      if (d !== H) {
        d = H;
        let T = "shadowMap";
        const q = [
          "world",
          "mBones",
          "viewProjection",
          "diffuseMatrix",
          "lightDataSM",
          "depthValuesSM",
          "biasAndScaleSM",
          "morphTargetInfluences",
          "boneTextureWidth",
          "softTransparentShadowSM",
          "morphTargetTextureInfo",
          "morphTargetTextureIndices"
        ], b = ["diffuseSampler", "boneSampler", "morphTargets"], j = ["Scene", "Mesh"];
        if (Mf(q), this.customShaderOptions) {
          if (T = this.customShaderOptions.shaderName, this.customShaderOptions.attributes)
            for (const m of this.customShaderOptions.attributes)
              v.indexOf(m) === -1 && v.push(m);
          if (this.customShaderOptions.uniforms)
            for (const m of this.customShaderOptions.uniforms)
              q.indexOf(m) === -1 && q.push(m);
          if (this.customShaderOptions.samplers)
            for (const m of this.customShaderOptions.samplers)
              b.indexOf(m) === -1 && b.push(m);
        }
        const w = this._scene.getEngine();
        o = w.createEffect(T, {
          attributes: v,
          uniformsNames: q,
          uniformBuffersNames: j,
          samplers: b,
          defines: H,
          fallbacks: P,
          onCompiled: null,
          onError: null,
          indexParameters: { maxSimultaneousMorphTargets: c }
        }, w), f.setEffect(o, d);
      }
      if (!o.isReady())
        return !1;
    }
    return (this.useBlurExponentialShadowMap || this.useBlurCloseExponentialShadowMap) && (!this._blurPostProcesses || !this._blurPostProcesses.length) && this._initializeBlurRTTAndPostProcesses(), !(this._kernelBlurXPostprocess && !this._kernelBlurXPostprocess.isReady() || this._kernelBlurYPostprocess && !this._kernelBlurYPostprocess.isReady() || this._boxBlurPostprocess && !this._boxBlurPostprocess.isReady());
  }
  /**
   * Prepare all the defines in a material relying on a shadow map at the specified light index.
   * @param defines Defines of the material we want to update
   * @param lightIndex Index of the light in the enabled light list of the material
   */
  prepareDefines(e, t) {
    const r = this._scene, n = this._light;
    !r.shadowsEnabled || !n.shadowEnabled || (e["SHADOW" + t] = !0, this.useContactHardeningShadow ? (e["SHADOWPCSS" + t] = !0, this._filteringQuality === ln.QUALITY_LOW ? e["SHADOWLOWQUALITY" + t] = !0 : this._filteringQuality === ln.QUALITY_MEDIUM && (e["SHADOWMEDIUMQUALITY" + t] = !0)) : this.usePercentageCloserFiltering ? (e["SHADOWPCF" + t] = !0, this._filteringQuality === ln.QUALITY_LOW ? e["SHADOWLOWQUALITY" + t] = !0 : this._filteringQuality === ln.QUALITY_MEDIUM && (e["SHADOWMEDIUMQUALITY" + t] = !0)) : this.usePoissonSampling ? e["SHADOWPOISSON" + t] = !0 : this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? e["SHADOWESM" + t] = !0 : (this.useCloseExponentialShadowMap || this.useBlurCloseExponentialShadowMap) && (e["SHADOWCLOSEESM" + t] = !0), n.needCube() && (e["SHADOWCUBE" + t] = !0));
  }
  /**
   * Binds the shadow related information inside of an effect (information like near, far, darkness...
   * defined in the generator but impacting the effect).
   * @param lightIndex Index of the light in the enabled light list of the material owning the effect
   * @param effect The effect we are binding the information for
   */
  bindShadowLight(e, t) {
    const r = this._light;
    if (!this._scene.shadowsEnabled || !r.shadowEnabled)
      return;
    const i = this._getCamera();
    if (!i)
      return;
    const s = this.getShadowMap();
    s && (r.needCube() || t.setMatrix("lightMatrix" + e, this.getTransformMatrix()), this._filter === ln.FILTER_PCF ? (t.setDepthStencilTexture("shadowSampler" + e, this.getShadowMapForRendering()), r._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), s.getSize().width, 1 / s.getSize().width, this.frustumEdgeFalloff, e)) : this._filter === ln.FILTER_PCSS ? (t.setDepthStencilTexture("shadowSampler" + e, this.getShadowMapForRendering()), t.setTexture("depthSampler" + e, this.getShadowMapForRendering()), r._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), 1 / s.getSize().width, this._contactHardeningLightSizeUVRatio * s.getSize().width, this.frustumEdgeFalloff, e)) : (t.setTexture("shadowSampler" + e, this.getShadowMapForRendering()), r._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), this.blurScale / s.getSize().width, this.depthScale, this.frustumEdgeFalloff, e)), r._uniformBuffer.updateFloat2("depthValues", this.getLight().getDepthMinZ(i), this.getLight().getDepthMinZ(i) + this.getLight().getDepthMaxZ(i), e));
  }
  /**
   * Gets the view matrix used to render the shadow map.
   */
  get viewMatrix() {
    return this._viewMatrix;
  }
  /**
   * Gets the projection matrix used to render the shadow map.
   */
  get projectionMatrix() {
    return this._projectionMatrix;
  }
  /**
   * Gets the transformation matrix used to project the meshes into the map from the light point of view.
   * (eq to shadow projection matrix * light transform matrix)
   * @returns The transform matrix used to create the shadow map
   */
  getTransformMatrix() {
    const e = this._scene;
    if (this._currentRenderId === e.getRenderId() && this._currentFaceIndexCache === this._currentFaceIndex)
      return this._transformMatrix;
    this._currentRenderId = e.getRenderId(), this._currentFaceIndexCache = this._currentFaceIndex;
    let t = this._light.position;
    if (this._light.computeTransformedInformation() && (t = this._light.transformedPosition), S.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex), this._lightDirection), Math.abs(S.Dot(this._lightDirection, S.Up())) === 1 && (this._lightDirection.z = 1e-13), this._light.needProjectionMatrixCompute() || !this._cachedPosition || !this._cachedDirection || !t.equals(this._cachedPosition) || !this._lightDirection.equals(this._cachedDirection)) {
      this._cachedPosition.copyFrom(t), this._cachedDirection.copyFrom(this._lightDirection), he.LookAtLHToRef(t, t.add(this._lightDirection), S.Up(), this._viewMatrix);
      const r = this.getShadowMap();
      if (r) {
        const n = r.renderList;
        n && this._light.setShadowProjectionMatrix(this._projectionMatrix, this._viewMatrix, n);
      }
      this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);
    }
    return this._transformMatrix;
  }
  /**
   * Recreates the shadow map dependencies like RTT and post processes. This can be used during the switch between
   * Cube and 2D textures for instance.
   */
  recreateShadowMap() {
    const e = this._shadowMap;
    if (!e)
      return;
    const t = e.renderList;
    if (this._disposeRTTandPostProcesses(), this._initializeGenerator(), this.filter = this._filter, this._applyFilterValues(), t) {
      this._shadowMap.renderList || (this._shadowMap.renderList = []);
      for (const r of t)
        this._shadowMap.renderList.push(r);
    } else
      this._shadowMap.renderList = null;
  }
  _disposeBlurPostProcesses() {
    this._shadowMap2 && (this._shadowMap2.dispose(), this._shadowMap2 = null), this._boxBlurPostprocess && (this._boxBlurPostprocess.dispose(), this._boxBlurPostprocess = null), this._kernelBlurXPostprocess && (this._kernelBlurXPostprocess.dispose(), this._kernelBlurXPostprocess = null), this._kernelBlurYPostprocess && (this._kernelBlurYPostprocess.dispose(), this._kernelBlurYPostprocess = null), this._blurPostProcesses = [];
  }
  _disposeRTTandPostProcesses() {
    this._shadowMap && (this._shadowMap.dispose(), this._shadowMap = null), this._disposeBlurPostProcesses();
  }
  _disposeSceneUBOs() {
    if (this._sceneUBOs) {
      for (const e of this._sceneUBOs)
        e.dispose();
      this._sceneUBOs = [];
    }
  }
  /**
   * Disposes the ShadowGenerator.
   * Returns nothing.
   */
  dispose() {
    if (this._disposeRTTandPostProcesses(), this._disposeSceneUBOs(), this._light) {
      if (this._light._shadowGenerators) {
        const e = this._light._shadowGenerators.entries();
        for (let t = e.next(); t.done !== !0; t = e.next()) {
          const [r, n] = t.value;
          n === this && this._light._shadowGenerators.delete(r);
        }
        this._light._shadowGenerators.size === 0 && (this._light._shadowGenerators = null);
      }
      this._light._markMeshesAsLightDirty();
    }
    this.onBeforeShadowMapRenderMeshObservable.clear(), this.onBeforeShadowMapRenderObservable.clear(), this.onAfterShadowMapRenderMeshObservable.clear(), this.onAfterShadowMapRenderObservable.clear();
  }
  /**
   * Serializes the shadow generator setup to a json object.
   * @returns The serialized JSON object
   */
  serialize() {
    var e;
    const t = {}, r = this.getShadowMap();
    if (!r)
      return t;
    if (t.className = this.getClassName(), t.lightId = this._light.id, t.cameraId = (e = this._camera) === null || e === void 0 ? void 0 : e.id, t.id = this.id, t.mapSize = r.getRenderSize(), t.forceBackFacesOnly = this.forceBackFacesOnly, t.darkness = this.getDarkness(), t.transparencyShadow = this._transparencyShadow, t.frustumEdgeFalloff = this.frustumEdgeFalloff, t.bias = this.bias, t.normalBias = this.normalBias, t.usePercentageCloserFiltering = this.usePercentageCloserFiltering, t.useContactHardeningShadow = this.useContactHardeningShadow, t.contactHardeningLightSizeUVRatio = this.contactHardeningLightSizeUVRatio, t.filteringQuality = this.filteringQuality, t.useExponentialShadowMap = this.useExponentialShadowMap, t.useBlurExponentialShadowMap = this.useBlurExponentialShadowMap, t.useCloseExponentialShadowMap = this.useBlurExponentialShadowMap, t.useBlurCloseExponentialShadowMap = this.useBlurExponentialShadowMap, t.usePoissonSampling = this.usePoissonSampling, t.depthScale = this.depthScale, t.blurBoxOffset = this.blurBoxOffset, t.blurKernel = this.blurKernel, t.blurScale = this.blurScale, t.useKernelBlur = this.useKernelBlur, t.renderList = [], r.renderList)
      for (let n = 0; n < r.renderList.length; n++) {
        const i = r.renderList[n];
        t.renderList.push(i.id);
      }
    return t;
  }
  /**
   * Parses a serialized ShadowGenerator and returns a new ShadowGenerator.
   * @param parsedShadowGenerator The JSON object to parse
   * @param scene The scene to create the shadow map for
   * @param constr A function that builds a shadow generator or undefined to create an instance of the default shadow generator
   * @returns The parsed shadow generator
   */
  static Parse(e, t, r) {
    const n = t.getLightById(e.lightId), i = e.cameraId !== void 0 ? t.getCameraById(e.cameraId) : null, s = r ? r(e.mapSize, n, i) : new ln(e.mapSize, n, void 0, i), a = s.getShadowMap();
    for (let f = 0; f < e.renderList.length; f++)
      t.getMeshesById(e.renderList[f]).forEach(function(d) {
        a && (a.renderList || (a.renderList = []), a.renderList.push(d));
      });
    return e.id !== void 0 && (s.id = e.id), s.forceBackFacesOnly = !!e.forceBackFacesOnly, e.darkness !== void 0 && s.setDarkness(e.darkness), e.transparencyShadow && s.setTransparencyShadow(!0), e.frustumEdgeFalloff !== void 0 && (s.frustumEdgeFalloff = e.frustumEdgeFalloff), e.bias !== void 0 && (s.bias = e.bias), e.normalBias !== void 0 && (s.normalBias = e.normalBias), e.usePercentageCloserFiltering ? s.usePercentageCloserFiltering = !0 : e.useContactHardeningShadow ? s.useContactHardeningShadow = !0 : e.usePoissonSampling ? s.usePoissonSampling = !0 : e.useExponentialShadowMap ? s.useExponentialShadowMap = !0 : e.useBlurExponentialShadowMap ? s.useBlurExponentialShadowMap = !0 : e.useCloseExponentialShadowMap ? s.useCloseExponentialShadowMap = !0 : e.useBlurCloseExponentialShadowMap ? s.useBlurCloseExponentialShadowMap = !0 : e.useVarianceShadowMap ? s.useExponentialShadowMap = !0 : e.useBlurVarianceShadowMap && (s.useBlurExponentialShadowMap = !0), e.contactHardeningLightSizeUVRatio !== void 0 && (s.contactHardeningLightSizeUVRatio = e.contactHardeningLightSizeUVRatio), e.filteringQuality !== void 0 && (s.filteringQuality = e.filteringQuality), e.depthScale && (s.depthScale = e.depthScale), e.blurScale && (s.blurScale = e.blurScale), e.blurBoxOffset && (s.blurBoxOffset = e.blurBoxOffset), e.useKernelBlur && (s.useKernelBlur = e.useKernelBlur), e.blurKernel && (s.blurKernel = e.blurKernel), s;
  }
}
ln.CLASSNAME = "ShadowGenerator";
ln.FILTER_NONE = 0;
ln.FILTER_EXPONENTIALSHADOWMAP = 1;
ln.FILTER_POISSONSAMPLING = 2;
ln.FILTER_BLUREXPONENTIALSHADOWMAP = 3;
ln.FILTER_CLOSEEXPONENTIALSHADOWMAP = 4;
ln.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5;
ln.FILTER_PCF = 6;
ln.FILTER_PCSS = 7;
ln.QUALITY_HIGH = 0;
ln.QUALITY_MEDIUM = 1;
ln.QUALITY_LOW = 2;
ln.DEFAULT_ALPHA_CUTOFF = 0.5;
ln._SceneComponentInitialization = (A) => {
  throw qn("ShadowGeneratorSceneComponent");
};
const fpe = "depthPixelShader", Ape = `#ifdef ALPHATEST
varying vec2 vUV;uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
varying float vDepthMetric;
#ifdef PACKED
#include<packingFunctions>
#endif
#ifdef STORE_CAMERASPACE_Z
varying vec4 vViewPos;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
#endif
#ifdef STORE_CAMERASPACE_Z
#ifdef PACKED
gl_FragColor=pack(vViewPos.z);
#else
gl_FragColor=vec4(vViewPos.z,0.0,0.0,1.0);
#endif
#else
#ifdef NONLINEARDEPTH
#ifdef PACKED
gl_FragColor=pack(gl_FragCoord.z);
#else
gl_FragColor=vec4(gl_FragCoord.z,0.0,0.0,0.0);
#endif
#else
#ifdef PACKED
gl_FragColor=pack(vDepthMetric);
#else
gl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0);
#endif
#endif
#endif
}`;
Le.ShadersStore[fpe] = Ape;
const dpe = "pointCloudVertexDeclaration", vpe = `#ifdef POINTSIZE
uniform float pointSize;
#endif
`;
Le.IncludesShadersStore[dpe] = vpe;
const upe = "depthVertexShader", lpe = `attribute vec3 position;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
#include<instancesDeclaration>
uniform mat4 viewProjection;uniform vec2 depthValues;
#if defined(ALPHATEST) || defined(NEED_UV)
varying vec2 vUV;uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#ifdef STORE_CAMERASPACE_Z
uniform mat4 view;varying vec4 vViewPos;
#endif
#include<pointCloudVertexDeclaration>
varying float vDepthMetric;
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#include<clipPlaneVertex>
gl_Position=viewProjection*worldPos;
#ifdef STORE_CAMERASPACE_Z
vViewPos=view*worldPos;
#else
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetric=((-gl_Position.z+depthValues.x)/(depthValues.y));
#else
vDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));
#endif
#endif
#if defined(ALPHATEST) || defined(BASIC_RENDER)
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#include<pointCloudVertex>
}
`;
Le.ShadersStore[upe] = lpe;
class jD {
  /**
   * Sets a specific material to be used to render a mesh/a list of meshes by the depth renderer
   * @param mesh mesh or array of meshes
   * @param material material to use by the depth render when rendering the mesh(es). If undefined is passed, the specific material created by the depth renderer will be used.
   */
  setMaterialForRendering(e, t) {
    this._depthMap.setMaterialForRendering(e, t);
  }
  /**
   * Instantiates a depth renderer
   * @param scene The scene the renderer belongs to
   * @param type The texture type of the depth map (default: Engine.TEXTURETYPE_FLOAT)
   * @param camera The camera to be used to render the depth map (default: scene's active camera)
   * @param storeNonLinearDepth Defines whether the depth is stored linearly like in Babylon Shadows or directly like glFragCoord.z
   * @param samplingMode The sampling mode to be used with the render target (Linear, Nearest...) (default: TRILINEAR_SAMPLINGMODE)
   * @param storeCameraSpaceZ Defines whether the depth stored is the Z coordinate in camera space. If true, storeNonLinearDepth has no effect. (Default: false)
   * @param name Name of the render target (default: DepthRenderer)
   */
  constructor(e, t = 1, r = null, n = !1, i = We.TRILINEAR_SAMPLINGMODE, s = !1, a) {
    this.enabled = !0, this.forceDepthWriteTransparentMeshes = !1, this.useOnlyInActiveCamera = !1, this.reverseCulling = !1, this._scene = e, this._storeNonLinearDepth = n, this._storeCameraSpaceZ = s, this.isPacked = t === 0, this.isPacked ? this.clearColor = new xt(1, 1, 1, 1) : this.clearColor = new xt(s ? 1e8 : 1, 0, 0, 1), jD._SceneComponentInitialization(this._scene);
    const f = e.getEngine();
    this._camera = r, i !== We.NEAREST_SAMPLINGMODE && (t === 1 && !f._caps.textureFloatLinearFiltering && (i = We.NEAREST_SAMPLINGMODE), t === 2 && !f._caps.textureHalfFloatLinearFiltering && (i = We.NEAREST_SAMPLINGMODE));
    const o = this.isPacked || !f._features.supportExtendedTextureFormats ? 5 : 6;
    this._depthMap = new Ta(a ?? "DepthRenderer", { width: f.getRenderWidth(), height: f.getRenderHeight() }, this._scene, !1, !0, t, !1, i, void 0, void 0, void 0, o), this._depthMap.wrapU = We.CLAMP_ADDRESSMODE, this._depthMap.wrapV = We.CLAMP_ADDRESSMODE, this._depthMap.refreshRate = 1, this._depthMap.renderParticles = !1, this._depthMap.renderList = null, this._depthMap.noPrePassRenderer = !0, this._depthMap.activeCamera = this._camera, this._depthMap.ignoreCameraViewport = !0, this._depthMap.useCameraPostProcesses = !1, this._depthMap.onClearObservable.add((v) => {
      v.clear(this.clearColor, !0, !0, !0);
    }), this._depthMap.onBeforeBindObservable.add(() => {
      var v;
      (v = f._debugPushGroup) === null || v === void 0 || v.call(f, "depth renderer", 1);
    }), this._depthMap.onAfterUnbindObservable.add(() => {
      var v;
      (v = f._debugPopGroup) === null || v === void 0 || v.call(f, 1);
    }), this._depthMap.customIsReadyFunction = (v, u, l) => {
      if ((l || u === 0) && v.subMeshes)
        for (let P = 0; P < v.subMeshes.length; ++P) {
          const p = v.subMeshes[P], c = p.getRenderingMesh(), H = c._getInstancesRenderList(p._id, !!p.getReplacementMesh()), T = f.getCaps().instancedArrays && (H.visibleInstances[p._id] !== null && H.visibleInstances[p._id] !== void 0 || c.hasThinInstances);
          if (!this.isReady(p, T))
            return !1;
        }
      return !0;
    };
    const d = (v) => {
      var u, l;
      const P = v.getRenderingMesh(), p = v.getEffectiveMesh(), c = this._scene, H = c.getEngine(), T = v.getMaterial();
      if (p._internalAbstractMeshDataInfo._isActiveIntermediate = !1, !T || p.infiniteDistance || T.disableDepthWrite || v.verticesCount === 0 || v._renderId === c.getRenderId())
        return;
      const q = p._getWorldMatrixDeterminant() < 0;
      let b = (u = P.overrideMaterialSideOrientation) !== null && u !== void 0 ? u : T.sideOrientation;
      q && (b = b === 0 ? 1 : 0);
      const j = b === 0;
      H.setState(T.backFaceCulling, 0, !1, j, this.reverseCulling ? !T.cullBackFaces : T.cullBackFaces);
      const w = P._getInstancesRenderList(v._id, !!v.getReplacementMesh());
      if (w.mustReturn)
        return;
      const m = H.getCaps().instancedArrays && (w.visibleInstances[v._id] !== null && w.visibleInstances[v._id] !== void 0 || P.hasThinInstances), I = this._camera || c.activeCamera;
      if (this.isReady(v, m) && I) {
        v._renderId = c.getRenderId();
        const N = (l = p._internalAbstractMeshDataInfo._materialForRenderPass) === null || l === void 0 ? void 0 : l[H.currentRenderPassId];
        let k = v._getDrawWrapper();
        !k && N && (k = N._getDrawWrapper());
        const R = I.mode === Tr.ORTHOGRAPHIC_CAMERA;
        if (!k)
          return;
        const y = k.effect;
        H.enableEffect(k), m || P._bind(v, y, T.fillMode), N ? N.bindForSubMesh(p.getWorldMatrix(), p, v) : (y.setMatrix("viewProjection", c.getTransformMatrix()), y.setMatrix("world", p.getWorldMatrix()), this._storeCameraSpaceZ && y.setMatrix("view", c.getViewMatrix()));
        let O, Y;
        if (R ? (O = !H.useReverseDepthBuffer && H.isNDCHalfZRange ? 0 : 1, Y = H.useReverseDepthBuffer && H.isNDCHalfZRange ? 0 : 1) : (O = H.useReverseDepthBuffer && H.isNDCHalfZRange ? I.minZ : H.isNDCHalfZRange ? 0 : I.minZ, Y = H.useReverseDepthBuffer && H.isNDCHalfZRange ? 0 : I.maxZ), y.setFloat2("depthValues", O, O + Y), !N) {
          if (T.needAlphaTesting()) {
            const ee = T.getAlphaTestTexture();
            ee && (y.setTexture("diffuseSampler", ee), y.setMatrix("diffuseMatrix", ee.getTextureMatrix()));
          }
          if (P.useBones && P.computeBonesUsingShaders && P.skeleton) {
            const ee = P.skeleton;
            if (ee.isUsingTextureForMatrices) {
              const Z = ee.getTransformMatrixTexture(P);
              if (!Z)
                return;
              y.setTexture("boneSampler", Z), y.setFloat("boneTextureWidth", 4 * (ee.bones.length + 1));
            } else
              y.setMatrices("mBones", ee.getTransformMatrices(P));
          }
          Df(y, T, c), Ye.BindMorphTargetParameters(P, y), P.morphTargetManager && P.morphTargetManager.isUsingTextureForTargets && P.morphTargetManager._bind(y), T.pointsCloud && y.setFloat("pointSize", T.pointSize);
        }
        P._processRendering(p, v, y, T.fillMode, w, m, (ee, Z) => y.setMatrix("world", Z));
      }
    };
    this._depthMap.customRenderFunction = (v, u, l, P) => {
      let p;
      if (P.length)
        for (p = 0; p < P.length; p++)
          d(P.data[p]);
      for (p = 0; p < v.length; p++)
        d(v.data[p]);
      for (p = 0; p < u.length; p++)
        d(u.data[p]);
      if (this.forceDepthWriteTransparentMeshes)
        for (p = 0; p < l.length; p++)
          d(l.data[p]);
      else
        for (p = 0; p < l.length; p++)
          l.data[p].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate = !1;
    };
  }
  /**
   * Creates the depth rendering effect and checks if the effect is ready.
   * @param subMesh The submesh to be used to render the depth map of
   * @param useInstances If multiple world instances should be used
   * @returns if the depth renderer is ready to render the depth map
   */
  isReady(e, t) {
    var r;
    const n = this._scene.getEngine(), i = e.getMesh(), s = i.getScene(), a = (r = i._internalAbstractMeshDataInfo._materialForRenderPass) === null || r === void 0 ? void 0 : r[n.currentRenderPassId];
    if (a)
      return a.isReadyForSubMesh(i, e, t);
    const f = e.getMaterial();
    if (!f || f.disableDepthWrite)
      return !1;
    const o = [], d = [J.PositionKind];
    if (f && f.needAlphaTesting() && f.getAlphaTestTexture() && (o.push("#define ALPHATEST"), i.isVerticesDataPresent(J.UVKind) && (d.push(J.UVKind), o.push("#define UV1")), i.isVerticesDataPresent(J.UV2Kind) && (d.push(J.UV2Kind), o.push("#define UV2"))), i.useBones && i.computeBonesUsingShaders) {
      d.push(J.MatricesIndicesKind), d.push(J.MatricesWeightsKind), i.numBoneInfluencers > 4 && (d.push(J.MatricesIndicesExtraKind), d.push(J.MatricesWeightsExtraKind)), o.push("#define NUM_BONE_INFLUENCERS " + i.numBoneInfluencers), o.push("#define BonesPerMesh " + (i.skeleton ? i.skeleton.bones.length + 1 : 0));
      const c = e.getRenderingMesh().skeleton;
      c != null && c.isUsingTextureForMatrices && o.push("#define BONETEXTURE");
    } else
      o.push("#define NUM_BONE_INFLUENCERS 0");
    const v = i.morphTargetManager;
    let u = 0;
    v && v.numInfluencers > 0 && (u = v.numInfluencers, o.push("#define MORPHTARGETS"), o.push("#define NUM_MORPH_INFLUENCERS " + u), v.isUsingTextureForTargets && o.push("#define MORPHTARGETS_TEXTURE"), Ye.PrepareAttributesForMorphTargetsInfluencers(d, i, u)), f.pointsCloud && o.push("#define POINTSIZE"), t && (o.push("#define INSTANCES"), Ye.PushAttributesForInstances(d), e.getRenderingMesh().hasThinInstances && o.push("#define THIN_INSTANCES")), this._storeNonLinearDepth && o.push("#define NONLINEARDEPTH"), this._storeCameraSpaceZ && o.push("#define STORE_CAMERASPACE_Z"), this.isPacked && o.push("#define PACKED"), xq(f, s, o);
    const l = e._getDrawWrapper(void 0, !0), P = l.defines, p = o.join(`
`);
    if (P !== p) {
      const c = [
        "world",
        "mBones",
        "boneTextureWidth",
        "pointSize",
        "viewProjection",
        "view",
        "diffuseMatrix",
        "depthValues",
        "morphTargetInfluences",
        "morphTargetTextureInfo",
        "morphTargetTextureIndices"
      ];
      Mf(c), l.setEffect(n.createEffect("depth", d, c, ["diffuseSampler", "morphTargets", "boneSampler"], p, void 0, void 0, void 0, {
        maxSimultaneousMorphTargets: u
      }), p);
    }
    return l.effect.isReady();
  }
  /**
   * Gets the texture which the depth map will be written to.
   * @returns The depth map texture
   */
  getDepthMap() {
    return this._depthMap;
  }
  /**
   * Disposes of the depth renderer.
   */
  dispose() {
    const e = [];
    for (const t in this._scene._depthRenderer)
      this._scene._depthRenderer[t] === this && e.push(t);
    if (e.length > 0) {
      this._depthMap.dispose();
      for (const t of e)
        delete this._scene._depthRenderer[t];
    }
  }
}
jD._SceneComponentInitialization = (A) => {
  throw qn("DepthRendererSceneComponent");
};
const Ppe = "minmaxReduxPixelShader", cpe = `varying vec2 vUV;uniform sampler2D textureSampler;
#if defined(INITIAL)
uniform sampler2D sourceTexture;uniform vec2 texSize;void main(void)
{ivec2 coord=ivec2(vUV*(texSize-1.0));float f1=texelFetch(sourceTexture,coord,0).r;float f2=texelFetch(sourceTexture,coord+ivec2(1,0),0).r;float f3=texelFetch(sourceTexture,coord+ivec2(1,1),0).r;float f4=texelFetch(sourceTexture,coord+ivec2(0,1),0).r;float minz=min(min(min(f1,f2),f3),f4);
#ifdef DEPTH_REDUX
float maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4);
#else
float maxz=max(max(max(f1,f2),f3),f4);
#endif
glFragColor=vec4(minz,maxz,0.,0.);}
#elif defined(MAIN)
uniform vec2 texSize;void main(void)
{ivec2 coord=ivec2(vUV*(texSize-1.0));vec2 f1=texelFetch(textureSampler,coord,0).rg;vec2 f2=texelFetch(textureSampler,coord+ivec2(1,0),0).rg;vec2 f3=texelFetch(textureSampler,coord+ivec2(1,1),0).rg;vec2 f4=texelFetch(textureSampler,coord+ivec2(0,1),0).rg;float minz=min(min(min(f1.x,f2.x),f3.x),f4.x);float maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);glFragColor=vec4(minz,maxz,0.,0.);}
#elif defined(ONEBEFORELAST)
uniform ivec2 texSize;void main(void)
{ivec2 coord=ivec2(vUV*vec2(texSize-1));vec2 f1=texelFetch(textureSampler,coord % texSize,0).rg;vec2 f2=texelFetch(textureSampler,(coord+ivec2(1,0)) % texSize,0).rg;vec2 f3=texelFetch(textureSampler,(coord+ivec2(1,1)) % texSize,0).rg;vec2 f4=texelFetch(textureSampler,(coord+ivec2(0,1)) % texSize,0).rg;float minz=min(f1.x,f2.x);float maxz=max(f1.y,f2.y);glFragColor=vec4(minz,maxz,0.,0.);}
#elif defined(LAST)
void main(void)
{glFragColor=vec4(0.);if (true) { 
discard;}}
#endif
`;
Le.ShadersStore[Ppe] = cpe;
class Lte {
  /**
   * Creates a min/max reducer
   * @param camera The camera to use for the post processes
   */
  constructor(e) {
    this.onAfterReductionPerformed = new Oe(), this._forceFullscreenViewport = !0, this._activated = !1, this._camera = e, this._postProcessManager = new yI(e.getScene()), this._onContextRestoredObserver = e.getEngine().onContextRestoredObservable.add(() => {
      this._postProcessManager._rebuild();
    });
  }
  /**
   * Gets the texture used to read the values from.
   */
  get sourceTexture() {
    return this._sourceTexture;
  }
  /**
   * Sets the source texture to read the values from.
   * One must indicate if the texture is a depth texture or not through the depthRedux parameter
   * because in such textures '1' value must not be taken into account to compute the maximum
   * as this value is used to clear the texture.
   * Note that the computation is not activated by calling this function, you must call activate() for that!
   * @param sourceTexture The texture to read the values from. The values should be in the red channel.
   * @param depthRedux Indicates if the texture is a depth texture or not
   * @param type The type of the textures created for the reduction (defaults to TEXTURETYPE_HALF_FLOAT)
   * @param forceFullscreenViewport Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)
   */
  setSourceTexture(e, t, r = 2, n = !0) {
    if (e === this._sourceTexture)
      return;
    this.dispose(!1), this._sourceTexture = e, this._reductionSteps = [], this._forceFullscreenViewport = n;
    const i = this._camera.getScene(), s = new kr(
      "Initial reduction phase",
      "minmaxRedux",
      // shader
      ["texSize"],
      ["sourceTexture"],
      // textures
      1,
      // options
      null,
      // camera
      1,
      // sampling
      i.getEngine(),
      // engine
      !1,
      // reusable
      "#define INITIAL" + (t ? `
#define DEPTH_REDUX` : ""),
      // defines
      r,
      void 0,
      void 0,
      void 0,
      7
    );
    s.autoClear = !1, s.forceFullscreenViewport = n;
    let a = this._sourceTexture.getRenderWidth(), f = this._sourceTexture.getRenderHeight();
    s.onApply = /* @__PURE__ */ ((d, v) => (u) => {
      u.setTexture("sourceTexture", this._sourceTexture), u.setFloat2("texSize", d, v);
    })(a, f), this._reductionSteps.push(s);
    let o = 1;
    for (; a > 1 || f > 1; ) {
      a = Math.max(Math.round(a / 2), 1), f = Math.max(Math.round(f / 2), 1);
      const d = new kr(
        "Reduction phase " + o,
        "minmaxRedux",
        // shader
        ["texSize"],
        null,
        { width: a, height: f },
        // options
        null,
        // camera
        1,
        // sampling
        i.getEngine(),
        // engine
        !1,
        // reusable
        "#define " + (a == 1 && f == 1 ? "LAST" : a == 1 || f == 1 ? "ONEBEFORELAST" : "MAIN"),
        // defines
        r,
        void 0,
        void 0,
        void 0,
        7
      );
      if (d.autoClear = !1, d.forceFullscreenViewport = n, d.onApply = /* @__PURE__ */ ((v, u) => (l) => {
        v == 1 || u == 1 ? l.setInt2("texSize", v, u) : l.setFloat2("texSize", v, u);
      })(a, f), this._reductionSteps.push(d), o++, a == 1 && f == 1) {
        const v = (u, l, P) => {
          const p = new Float32Array(4 * u * l), c = { min: 0, max: 0 };
          return () => {
            i.getEngine()._readTexturePixels(P.inputTexture.texture, u, l, -1, 0, p, !1), c.min = p[0], c.max = p[1], this.onAfterReductionPerformed.notifyObservers(c);
          };
        };
        d.onAfterRenderObservable.add(v(a, f, d));
      }
    }
  }
  /**
   * Defines the refresh rate of the computation.
   * Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...
   */
  get refreshRate() {
    return this._sourceTexture ? this._sourceTexture.refreshRate : -1;
  }
  set refreshRate(e) {
    this._sourceTexture && (this._sourceTexture.refreshRate = e);
  }
  /**
   * Gets the activation status of the reducer
   */
  get activated() {
    return this._activated;
  }
  /**
   * Activates the reduction computation.
   * When activated, the observers registered in onAfterReductionPerformed are
   * called after the computation is performed
   */
  activate() {
    this._onAfterUnbindObserver || !this._sourceTexture || (this._onAfterUnbindObserver = this._sourceTexture.onAfterUnbindObservable.add(() => {
      var e, t;
      const r = this._camera.getScene().getEngine();
      (e = r._debugPushGroup) === null || e === void 0 || e.call(r, "min max reduction", 1), this._reductionSteps[0].activate(this._camera), this._postProcessManager.directRender(this._reductionSteps, this._reductionSteps[0].inputTexture, this._forceFullscreenViewport), r.unBindFramebuffer(this._reductionSteps[0].inputTexture, !1), (t = r._debugPopGroup) === null || t === void 0 || t.call(r, 1);
    }), this._activated = !0);
  }
  /**
   * Deactivates the reduction computation.
   */
  deactivate() {
    !this._onAfterUnbindObserver || !this._sourceTexture || (this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver), this._onAfterUnbindObserver = null, this._activated = !1);
  }
  /**
   * Disposes the min/max reducer
   * @param disposeAll true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.
   */
  dispose(e = !0) {
    if (e && (this.onAfterReductionPerformed.clear(), this._onContextRestoredObserver && (this._camera.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver), this._onContextRestoredObserver = null)), this.deactivate(), this._reductionSteps) {
      for (let t = 0; t < this._reductionSteps.length; ++t)
        this._reductionSteps[t].dispose();
      this._reductionSteps = null;
    }
    this._postProcessManager && e && this._postProcessManager.dispose(), this._sourceTexture = null;
  }
}
class Kte extends Lte {
  /**
   * Gets the depth renderer used for the computation.
   * Note that the result is null if you provide your own renderer when calling setDepthRenderer.
   */
  get depthRenderer() {
    return this._depthRenderer;
  }
  /**
   * Creates a depth reducer
   * @param camera The camera used to render the depth texture
   */
  constructor(e) {
    super(e);
  }
  /**
   * Sets the depth renderer to use to generate the depth map
   * @param depthRenderer The depth renderer to use. If not provided, a new one will be created automatically
   * @param type The texture type of the depth map (default: TEXTURETYPE_HALF_FLOAT)
   * @param forceFullscreenViewport Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)
   */
  setDepthRenderer(e = null, t = 2, r = !0) {
    const n = this._camera.getScene();
    this._depthRenderer && (delete n._depthRenderer[this._depthRendererId], this._depthRenderer.dispose(), this._depthRenderer = null), e === null && (n._depthRenderer || (n._depthRenderer = {}), e = this._depthRenderer = new jD(n, t, this._camera, !1, 1), e.enabled = !1, this._depthRendererId = "minmax" + this._camera.id, n._depthRenderer[this._depthRendererId] = e), super.setSourceTexture(e.getDepthMap(), !0, t, r);
  }
  /**
   * @internal
   */
  setSourceTexture(e, t, r = 2, n = !0) {
    super.setSourceTexture(e, t, r, n);
  }
  /**
   * Activates the reduction computation.
   * When activated, the observers registered in onAfterReductionPerformed are
   * called after the computation is performed
   */
  activate() {
    this._depthRenderer && (this._depthRenderer.enabled = !0), super.activate();
  }
  /**
   * Deactivates the reduction computation.
   */
  deactivate() {
    super.deactivate(), this._depthRenderer && (this._depthRenderer.enabled = !1);
  }
  /**
   * Disposes the depth reducer
   * @param disposeAll true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.
   */
  dispose(e = !0) {
    if (super.dispose(e), this._depthRenderer && e) {
      const t = this._depthRenderer.getDepthMap().getScene();
      t && delete t._depthRenderer[this._depthRendererId], this._depthRenderer.dispose(), this._depthRenderer = null;
    }
  }
}
const MG = S.Up(), ppe = S.Zero(), R9 = new S(), IW = new S(), HC = new he();
class X6 extends ln {
  _validateFilter(e) {
    return e === ln.FILTER_NONE || e === ln.FILTER_PCF || e === ln.FILTER_PCSS ? e : (console.error('Unsupported filter "' + e + '"!'), ln.FILTER_NONE);
  }
  /**
   * Gets or set the number of cascades used by the CSM.
   */
  get numCascades() {
    return this._numCascades;
  }
  set numCascades(e) {
    e = Math.min(Math.max(e, X6.MIN_CASCADES_COUNT), X6.MAX_CASCADES_COUNT), e !== this._numCascades && (this._numCascades = e, this.recreateShadowMap(), this._recreateSceneUBOs());
  }
  /**
   * Enables or disables the shadow casters bounding info computation.
   * If your shadow casters don't move, you can disable this feature.
   * If it is enabled, the bounding box computation is done every frame.
   */
  get freezeShadowCastersBoundingInfo() {
    return this._freezeShadowCastersBoundingInfo;
  }
  set freezeShadowCastersBoundingInfo(e) {
    this._freezeShadowCastersBoundingInfoObservable && e && (this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable), this._freezeShadowCastersBoundingInfoObservable = null), !this._freezeShadowCastersBoundingInfoObservable && !e && (this._freezeShadowCastersBoundingInfoObservable = this._scene.onBeforeRenderObservable.add(() => this._computeShadowCastersBoundingInfo())), this._freezeShadowCastersBoundingInfo = e, e && this._computeShadowCastersBoundingInfo();
  }
  _computeShadowCastersBoundingInfo() {
    if (this._scbiMin.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._scbiMax.copyFromFloats(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE), this._shadowMap && this._shadowMap.renderList) {
      const e = this._shadowMap.renderList;
      for (let r = 0; r < e.length; r++) {
        const n = e[r];
        if (!n)
          continue;
        const i = n.getBoundingInfo(), s = i.boundingBox;
        this._scbiMin.minimizeInPlace(s.minimumWorld), this._scbiMax.maximizeInPlace(s.maximumWorld);
      }
      const t = this._scene.meshes;
      for (let r = 0; r < t.length; r++) {
        const n = t[r];
        if (!n || !n.isVisible || !n.isEnabled || !n.receiveShadows)
          continue;
        const i = n.getBoundingInfo(), s = i.boundingBox;
        this._scbiMin.minimizeInPlace(s.minimumWorld), this._scbiMax.maximizeInPlace(s.maximumWorld);
      }
    }
    this._shadowCastersBoundingInfo.reConstruct(this._scbiMin, this._scbiMax);
  }
  /**
   * Gets or sets the shadow casters bounding info.
   * If you provide your own shadow casters bounding info, first enable freezeShadowCastersBoundingInfo
   * so that the system won't overwrite the bounds you provide
   */
  get shadowCastersBoundingInfo() {
    return this._shadowCastersBoundingInfo;
  }
  set shadowCastersBoundingInfo(e) {
    this._shadowCastersBoundingInfo = e;
  }
  /**
   * Sets the minimal and maximal distances to use when computing the cascade breaks.
   *
   * The values of min / max are typically the depth zmin and zmax values of your scene, for a given frame.
   * If you don't know these values, simply leave them to their defaults and don't call this function.
   * @param min minimal distance for the breaks (default to 0.)
   * @param max maximal distance for the breaks (default to 1.)
   */
  setMinMaxDistance(e, t) {
    this._minDistance === e && this._maxDistance === t || (e > t && (e = 0, t = 1), e < 0 && (e = 0), t > 1 && (t = 1), this._minDistance = e, this._maxDistance = t, this._breaksAreDirty = !0);
  }
  /** Gets the minimal distance used in the cascade break computation */
  get minDistance() {
    return this._minDistance;
  }
  /** Gets the maximal distance used in the cascade break computation */
  get maxDistance() {
    return this._maxDistance;
  }
  /**
   * Gets the class name of that object
   * @returns "CascadedShadowGenerator"
   */
  getClassName() {
    return X6.CLASSNAME;
  }
  /**
   * Gets a cascade minimum extents
   * @param cascadeIndex index of the cascade
   * @returns the minimum cascade extents
   */
  getCascadeMinExtents(e) {
    return e >= 0 && e < this._numCascades ? this._cascadeMinExtents[e] : null;
  }
  /**
   * Gets a cascade maximum extents
   * @param cascadeIndex index of the cascade
   * @returns the maximum cascade extents
   */
  getCascadeMaxExtents(e) {
    return e >= 0 && e < this._numCascades ? this._cascadeMaxExtents[e] : null;
  }
  /**
   * Gets the shadow max z distance. It's the limit beyond which shadows are not displayed.
   * It defaults to camera.maxZ
   */
  get shadowMaxZ() {
    return this._getCamera() ? this._shadowMaxZ : 0;
  }
  /**
   * Sets the shadow max z distance.
   */
  set shadowMaxZ(e) {
    const t = this._getCamera();
    if (!t) {
      this._shadowMaxZ = e;
      return;
    }
    this._shadowMaxZ === e || e < t.minZ || e > t.maxZ && t.maxZ !== 0 || (this._shadowMaxZ = e, this._light._markMeshesAsLightDirty(), this._breaksAreDirty = !0);
  }
  /**
   * Gets or sets the debug flag.
   * When enabled, the cascades are materialized by different colors on the screen.
   */
  get debug() {
    return this._debug;
  }
  set debug(e) {
    this._debug = e, this._light._markMeshesAsLightDirty();
  }
  /**
   * Gets or sets the depth clamping value.
   *
   * When enabled, it improves the shadow quality because the near z plane of the light frustum don't need to be adjusted
   * to account for the shadow casters far away.
   *
   * Note that this property is incompatible with PCSS filtering, so it won't be used in that case.
   */
  get depthClamp() {
    return this._depthClamp;
  }
  set depthClamp(e) {
    this._depthClamp = e;
  }
  /**
   * Gets or sets the percentage of blending between two cascades (value between 0. and 1.).
   * It defaults to 0.1 (10% blending).
   */
  get cascadeBlendPercentage() {
    return this._cascadeBlendPercentage;
  }
  set cascadeBlendPercentage(e) {
    this._cascadeBlendPercentage = e, this._light._markMeshesAsLightDirty();
  }
  /**
   * Gets or set the lambda parameter.
   * This parameter is used to split the camera frustum and create the cascades.
   * It's a value between 0. and 1.: If 0, the split is a uniform split of the frustum, if 1 it is a logarithmic split.
   * For all values in-between, it's a linear combination of the uniform and logarithm split algorithm.
   */
  get lambda() {
    return this._lambda;
  }
  set lambda(e) {
    const t = Math.min(Math.max(e, 0), 1);
    this._lambda != t && (this._lambda = t, this._breaksAreDirty = !0);
  }
  /**
   * Gets the view matrix corresponding to a given cascade
   * @param cascadeNum cascade to retrieve the view matrix from
   * @returns the cascade view matrix
   */
  getCascadeViewMatrix(e) {
    return e >= 0 && e < this._numCascades ? this._viewMatrices[e] : null;
  }
  /**
   * Gets the projection matrix corresponding to a given cascade
   * @param cascadeNum cascade to retrieve the projection matrix from
   * @returns the cascade projection matrix
   */
  getCascadeProjectionMatrix(e) {
    return e >= 0 && e < this._numCascades ? this._projectionMatrices[e] : null;
  }
  /**
   * Gets the transformation matrix corresponding to a given cascade
   * @param cascadeNum cascade to retrieve the transformation matrix from
   * @returns the cascade transformation matrix
   */
  getCascadeTransformMatrix(e) {
    return e >= 0 && e < this._numCascades ? this._transformMatrices[e] : null;
  }
  /**
   * Sets the depth renderer to use when autoCalcDepthBounds is enabled.
   *
   * Note that if no depth renderer is set, a new one will be automatically created internally when necessary.
   *
   * You should call this function if you already have a depth renderer enabled in your scene, to avoid
   * doing multiple depth rendering each frame. If you provide your own depth renderer, make sure it stores linear depth!
   * @param depthRenderer The depth renderer to use when autoCalcDepthBounds is enabled. If you pass null or don't call this function at all, a depth renderer will be automatically created
   */
  setDepthRenderer(e) {
    this._depthRenderer = e, this._depthReducer && this._depthReducer.setDepthRenderer(this._depthRenderer);
  }
  /**
   * Gets or sets the autoCalcDepthBounds property.
   *
   * When enabled, a depth rendering pass is first performed (with an internally created depth renderer or with the one
   * you provide by calling setDepthRenderer). Then, a min/max reducing is applied on the depth map to compute the
   * minimal and maximal depth of the map and those values are used as inputs for the setMinMaxDistance() function.
   * It can greatly enhance the shadow quality, at the expense of more GPU works.
   * When using this option, you should increase the value of the lambda parameter, and even set it to 1 for best results.
   */
  get autoCalcDepthBounds() {
    return this._autoCalcDepthBounds;
  }
  set autoCalcDepthBounds(e) {
    const t = this._getCamera();
    if (t) {
      if (this._autoCalcDepthBounds = e, !e) {
        this._depthReducer && this._depthReducer.deactivate(), this.setMinMaxDistance(0, 1);
        return;
      }
      this._depthReducer || (this._depthReducer = new Kte(t), this._depthReducer.onAfterReductionPerformed.add((r) => {
        let n = r.min, i = r.max;
        n >= i && (n = 0, i = 1), (n != this._minDistance || i != this._maxDistance) && this.setMinMaxDistance(n, i);
      }), this._depthReducer.setDepthRenderer(this._depthRenderer)), this._depthReducer.activate();
    }
  }
  /**
   * Defines the refresh rate of the min/max computation used when autoCalcDepthBounds is set to true
   * Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...
   * Note that if you provided your own depth renderer through a call to setDepthRenderer, you are responsible
   * for setting the refresh rate on the renderer yourself!
   */
  get autoCalcDepthBoundsRefreshRate() {
    var e, t, r;
    return (r = (t = (e = this._depthReducer) === null || e === void 0 ? void 0 : e.depthRenderer) === null || t === void 0 ? void 0 : t.getDepthMap().refreshRate) !== null && r !== void 0 ? r : -1;
  }
  set autoCalcDepthBoundsRefreshRate(e) {
    var t;
    !((t = this._depthReducer) === null || t === void 0) && t.depthRenderer && (this._depthReducer.depthRenderer.getDepthMap().refreshRate = e);
  }
  /**
   * Create the cascade breaks according to the lambda, shadowMaxZ and min/max distance properties, as well as the camera near and far planes.
   * This function is automatically called when updating lambda, shadowMaxZ and min/max distances, however you should call it yourself if
   * you change the camera near/far planes!
   */
  splitFrustum() {
    this._breaksAreDirty = !0;
  }
  _splitFrustum() {
    const e = this._getCamera();
    if (!e)
      return;
    const t = e.minZ, r = e.maxZ || this._shadowMaxZ, n = r - t, i = this._minDistance, s = this._shadowMaxZ < r && this._shadowMaxZ >= t ? Math.min((this._shadowMaxZ - t) / (r - t), this._maxDistance) : this._maxDistance, a = t + i * n, f = t + s * n, o = f - a, d = f / a;
    for (let v = 0; v < this._cascades.length; ++v) {
      const u = (v + 1) / this._numCascades, l = a * d ** u, P = a + o * u, p = this._lambda * (l - P) + P;
      this._cascades[v].prevBreakDistance = v === 0 ? i : this._cascades[v - 1].breakDistance, this._cascades[v].breakDistance = (p - t) / n, this._viewSpaceFrustumsZ[v] = p, this._frustumLengths[v] = (this._cascades[v].breakDistance - this._cascades[v].prevBreakDistance) * n;
    }
    this._breaksAreDirty = !1;
  }
  _computeMatrices() {
    const e = this._scene;
    if (!this._getCamera())
      return;
    S.NormalizeToRef(this._light.getShadowDirection(0), this._lightDirection), Math.abs(S.Dot(this._lightDirection, S.Up())) === 1 && (this._lightDirection.z = 1e-13), this._cachedDirection.copyFrom(this._lightDirection);
    const r = e.getEngine().useReverseDepthBuffer;
    for (let n = 0; n < this._numCascades; ++n) {
      this._computeFrustumInWorldSpace(n), this._computeCascadeFrustum(n), this._cascadeMaxExtents[n].subtractToRef(this._cascadeMinExtents[n], R9), this._frustumCenter[n].addToRef(this._lightDirection.scale(this._cascadeMinExtents[n].z), this._shadowCameraPos[n]), he.LookAtLHToRef(this._shadowCameraPos[n], this._frustumCenter[n], MG, this._viewMatrices[n]);
      let i = 0, s = R9.z;
      const a = this._shadowCastersBoundingInfo;
      a.update(this._viewMatrices[n]), s = Math.min(s, a.boundingBox.maximumWorld.z), !this._depthClamp || this.filter === ln.FILTER_PCSS ? i = Math.min(i, a.boundingBox.minimumWorld.z) : i = Math.max(i, a.boundingBox.minimumWorld.z), he.OrthoOffCenterLHToRef(this._cascadeMinExtents[n].x, this._cascadeMaxExtents[n].x, this._cascadeMinExtents[n].y, this._cascadeMaxExtents[n].y, r ? s : i, r ? i : s, this._projectionMatrices[n], e.getEngine().isNDCHalfZRange), this._cascadeMinExtents[n].z = i, this._cascadeMaxExtents[n].z = s, this._viewMatrices[n].multiplyToRef(this._projectionMatrices[n], this._transformMatrices[n]), S.TransformCoordinatesToRef(ppe, this._transformMatrices[n], R9), R9.scaleInPlace(this._mapSize / 2), IW.copyFromFloats(Math.round(R9.x), Math.round(R9.y), Math.round(R9.z)), IW.subtractInPlace(R9).scaleInPlace(2 / this._mapSize), he.TranslationToRef(IW.x, IW.y, 0, HC), this._projectionMatrices[n].multiplyToRef(HC, this._projectionMatrices[n]), this._viewMatrices[n].multiplyToRef(this._projectionMatrices[n], this._transformMatrices[n]), this._transformMatrices[n].copyToArray(this._transformMatricesAsArray, n * 16);
    }
  }
  // Get the 8 points of the view frustum in world space
  _computeFrustumInWorldSpace(e) {
    const t = this._getCamera();
    if (!t)
      return;
    const r = this._cascades[e].prevBreakDistance, n = this._cascades[e].breakDistance, i = this._scene.getEngine().isNDCHalfZRange;
    t.getViewMatrix();
    const s = t.maxZ === 0, a = t.maxZ;
    s && (t.maxZ = this._shadowMaxZ, t.getProjectionMatrix(!0));
    const f = he.Invert(t.getTransformationMatrix());
    s && (t.maxZ = a, t.getProjectionMatrix(!0));
    const o = this._scene.getEngine().useReverseDepthBuffer ? 4 : 0;
    for (let d = 0; d < X6._FrustumCornersNDCSpace.length; ++d)
      R9.copyFrom(X6._FrustumCornersNDCSpace[(d + o) % X6._FrustumCornersNDCSpace.length]), i && R9.z === -1 && (R9.z = 0), S.TransformCoordinatesToRef(R9, f, this._frustumCornersWorldSpace[e][d]);
    for (let d = 0; d < X6._FrustumCornersNDCSpace.length / 2; ++d)
      R9.copyFrom(this._frustumCornersWorldSpace[e][d + 4]).subtractInPlace(this._frustumCornersWorldSpace[e][d]), IW.copyFrom(R9).scaleInPlace(r), R9.scaleInPlace(n), R9.addInPlace(this._frustumCornersWorldSpace[e][d]), this._frustumCornersWorldSpace[e][d + 4].copyFrom(R9), this._frustumCornersWorldSpace[e][d].addInPlace(IW);
  }
  _computeCascadeFrustum(e) {
    if (this._cascadeMinExtents[e].copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cascadeMaxExtents[e].copyFromFloats(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE), this._frustumCenter[e].copyFromFloats(0, 0, 0), !!this._getCamera()) {
      for (let r = 0; r < this._frustumCornersWorldSpace[e].length; ++r)
        this._frustumCenter[e].addInPlace(this._frustumCornersWorldSpace[e][r]);
      if (this._frustumCenter[e].scaleInPlace(1 / this._frustumCornersWorldSpace[e].length), this.stabilizeCascades) {
        let r = 0;
        for (let n = 0; n < this._frustumCornersWorldSpace[e].length; ++n) {
          const i = this._frustumCornersWorldSpace[e][n].subtractToRef(this._frustumCenter[e], R9).length();
          r = Math.max(r, i);
        }
        r = Math.ceil(r * 16) / 16, this._cascadeMaxExtents[e].copyFromFloats(r, r, r), this._cascadeMinExtents[e].copyFromFloats(-r, -r, -r);
      } else {
        const r = this._frustumCenter[e];
        this._frustumCenter[e].addToRef(this._lightDirection, R9), he.LookAtLHToRef(r, R9, MG, HC);
        for (let n = 0; n < this._frustumCornersWorldSpace[e].length; ++n)
          S.TransformCoordinatesToRef(this._frustumCornersWorldSpace[e][n], HC, R9), this._cascadeMinExtents[e].minimizeInPlace(R9), this._cascadeMaxExtents[e].maximizeInPlace(R9);
      }
    }
  }
  _recreateSceneUBOs() {
    if (this._disposeSceneUBOs(), this._sceneUBOs)
      for (let e = 0; e < this._numCascades; ++e)
        this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for CSM Shadow Generator (light "${this._light.name}" cascade #${e})`));
  }
  /**
   *  Support test.
   */
  static get IsSupported() {
    const e = gr.LastCreatedEngine;
    return e ? e._features.supportCSM : !1;
  }
  /**
   * Creates a Cascaded Shadow Generator object.
   * A ShadowGenerator is the required tool to use the shadows.
   * Each directional light casting shadows needs to use its own ShadowGenerator.
   * Documentation : https://doc.babylonjs.com/babylon101/cascadedShadows
   * @param mapSize The size of the texture what stores the shadows. Example : 1024.
   * @param light The directional light object generating the shadows.
   * @param usefulFloatFirst By default the generator will try to use half float textures but if you need precision (for self shadowing for instance), you can use this option to enforce full float texture.
   * @param camera Camera associated with this shadow generator (default: null). If null, takes the scene active camera at the time we need to access it
   * @param useRedTextureType Forces the generator to use a Red instead of a RGBA type for the shadow map texture format (default: true)
   */
  constructor(e, t, r, n, i = !0) {
    if (!X6.IsSupported) {
      Se.Error("CascadedShadowMap is not supported by the current engine.");
      return;
    }
    super(e, t, r, n, i), this.usePercentageCloserFiltering = !0;
  }
  _initializeGenerator() {
    var e, t, r, n, i, s, a, f, o, d, v, u, l, P, p, c, H, T, q, b;
    this.penumbraDarkness = (e = this.penumbraDarkness) !== null && e !== void 0 ? e : 1, this._numCascades = (t = this._numCascades) !== null && t !== void 0 ? t : X6.DEFAULT_CASCADES_COUNT, this.stabilizeCascades = (r = this.stabilizeCascades) !== null && r !== void 0 ? r : !1, this._freezeShadowCastersBoundingInfoObservable = (n = this._freezeShadowCastersBoundingInfoObservable) !== null && n !== void 0 ? n : null, this.freezeShadowCastersBoundingInfo = (i = this.freezeShadowCastersBoundingInfo) !== null && i !== void 0 ? i : !1, this._scbiMin = (s = this._scbiMin) !== null && s !== void 0 ? s : new S(0, 0, 0), this._scbiMax = (a = this._scbiMax) !== null && a !== void 0 ? a : new S(0, 0, 0), this._shadowCastersBoundingInfo = (f = this._shadowCastersBoundingInfo) !== null && f !== void 0 ? f : new Md(new S(0, 0, 0), new S(0, 0, 0)), this._breaksAreDirty = (o = this._breaksAreDirty) !== null && o !== void 0 ? o : !0, this._minDistance = (d = this._minDistance) !== null && d !== void 0 ? d : 0, this._maxDistance = (v = this._maxDistance) !== null && v !== void 0 ? v : 1, this._currentLayer = (u = this._currentLayer) !== null && u !== void 0 ? u : 0, this._shadowMaxZ = (p = (l = this._shadowMaxZ) !== null && l !== void 0 ? l : (P = this._getCamera()) === null || P === void 0 ? void 0 : P.maxZ) !== null && p !== void 0 ? p : 1e4, this._debug = (c = this._debug) !== null && c !== void 0 ? c : !1, this._depthClamp = (H = this._depthClamp) !== null && H !== void 0 ? H : !0, this._cascadeBlendPercentage = (T = this._cascadeBlendPercentage) !== null && T !== void 0 ? T : 0.1, this._lambda = (q = this._lambda) !== null && q !== void 0 ? q : 0.5, this._autoCalcDepthBounds = (b = this._autoCalcDepthBounds) !== null && b !== void 0 ? b : !1, this._recreateSceneUBOs(), super._initializeGenerator();
  }
  _createTargetRenderTexture() {
    const e = this._scene.getEngine(), t = { width: this._mapSize, height: this._mapSize, layers: this.numCascades };
    this._shadowMap = new Ta(this._light.name + "_CSMShadowMap", t, this._scene, !1, !0, this._textureType, !1, void 0, !1, !1, void 0, this._useRedTextureType ? 6 : 5), this._shadowMap.createDepthStencilTexture(e.useReverseDepthBuffer ? 516 : 513, !0), this._shadowMap.noPrePassRenderer = !0;
  }
  _initializeShadowMap() {
    if (super._initializeShadowMap(), this._shadowMap === null)
      return;
    this._transformMatricesAsArray = new Float32Array(this._numCascades * 16), this._viewSpaceFrustumsZ = new Array(this._numCascades), this._frustumLengths = new Array(this._numCascades), this._lightSizeUVCorrection = new Array(this._numCascades * 2), this._depthCorrection = new Array(this._numCascades), this._cascades = [], this._viewMatrices = [], this._projectionMatrices = [], this._transformMatrices = [], this._cascadeMinExtents = [], this._cascadeMaxExtents = [], this._frustumCenter = [], this._shadowCameraPos = [], this._frustumCornersWorldSpace = [];
    for (let t = 0; t < this._numCascades; ++t) {
      this._cascades[t] = {
        prevBreakDistance: 0,
        breakDistance: 0
      }, this._viewMatrices[t] = he.Zero(), this._projectionMatrices[t] = he.Zero(), this._transformMatrices[t] = he.Zero(), this._cascadeMinExtents[t] = new S(), this._cascadeMaxExtents[t] = new S(), this._frustumCenter[t] = new S(), this._shadowCameraPos[t] = new S(), this._frustumCornersWorldSpace[t] = new Array(X6._FrustumCornersNDCSpace.length);
      for (let r = 0; r < X6._FrustumCornersNDCSpace.length; ++r)
        this._frustumCornersWorldSpace[t][r] = new S();
    }
    const e = this._scene.getEngine();
    this._shadowMap.onBeforeBindObservable.clear(), this._shadowMap.onBeforeRenderObservable.clear(), this._shadowMap.onBeforeRenderObservable.add((t) => {
      this._sceneUBOs && this._scene.setSceneUniformBuffer(this._sceneUBOs[t]), this._currentLayer = t, this._filter === ln.FILTER_PCF && e.setColorWrite(!1), this._scene.setTransformMatrix(this.getCascadeViewMatrix(t), this.getCascadeProjectionMatrix(t)), this._useUBO && (this._scene.getSceneUniformBuffer().unbindEffect(), this._scene.finalizeSceneUbo());
    }), this._shadowMap.onBeforeBindObservable.add(() => {
      var t;
      this._currentSceneUBO = this._scene.getSceneUniformBuffer(), (t = e._debugPushGroup) === null || t === void 0 || t.call(e, `cascaded shadow map generation for pass id ${e.currentRenderPassId}`, 1), this._breaksAreDirty && this._splitFrustum(), this._computeMatrices();
    }), this._splitFrustum();
  }
  _bindCustomEffectForRenderSubMeshForShadowMap(e, t) {
    t.setMatrix("viewProjection", this.getCascadeTransformMatrix(this._currentLayer));
  }
  _isReadyCustomDefines(e) {
    e.push("#define SM_DEPTHCLAMP " + (this._depthClamp && this._filter !== ln.FILTER_PCSS ? "1" : "0"));
  }
  /**
   * Prepare all the defines in a material relying on a shadow map at the specified light index.
   * @param defines Defines of the material we want to update
   * @param lightIndex Index of the light in the enabled light list of the material
   */
  prepareDefines(e, t) {
    super.prepareDefines(e, t);
    const r = this._scene, n = this._light;
    if (!r.shadowsEnabled || !n.shadowEnabled)
      return;
    e["SHADOWCSM" + t] = !0, e["SHADOWCSMDEBUG" + t] = this.debug, e["SHADOWCSMNUM_CASCADES" + t] = this.numCascades, e["SHADOWCSM_RIGHTHANDED" + t] = r.useRightHandedSystem;
    const i = this._getCamera();
    i && this._shadowMaxZ <= (i.maxZ || this._shadowMaxZ) && (e["SHADOWCSMUSESHADOWMAXZ" + t] = !0), this.cascadeBlendPercentage === 0 && (e["SHADOWCSMNOBLEND" + t] = !0);
  }
  /**
   * Binds the shadow related information inside of an effect (information like near, far, darkness...
   * defined in the generator but impacting the effect).
   * @param lightIndex Index of the light in the enabled light list of the material owning the effect
   * @param effect The effect we are binfing the information for
   */
  bindShadowLight(e, t) {
    const r = this._light;
    if (!this._scene.shadowsEnabled || !r.shadowEnabled)
      return;
    const i = this._getCamera();
    if (!i)
      return;
    const s = this.getShadowMap();
    if (!s)
      return;
    const a = s.getSize().width;
    if (t.setMatrices("lightMatrix" + e, this._transformMatricesAsArray), t.setArray("viewFrustumZ" + e, this._viewSpaceFrustumsZ), t.setFloat("cascadeBlendFactor" + e, this.cascadeBlendPercentage === 0 ? 1e4 : 1 / this.cascadeBlendPercentage), t.setArray("frustumLengths" + e, this._frustumLengths), this._filter === ln.FILTER_PCF)
      t.setDepthStencilTexture("shadowSampler" + e, s), r._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), a, 1 / a, this.frustumEdgeFalloff, e);
    else if (this._filter === ln.FILTER_PCSS) {
      for (let f = 0; f < this._numCascades; ++f)
        this._lightSizeUVCorrection[f * 2 + 0] = f === 0 ? 1 : (this._cascadeMaxExtents[0].x - this._cascadeMinExtents[0].x) / (this._cascadeMaxExtents[f].x - this._cascadeMinExtents[f].x), this._lightSizeUVCorrection[f * 2 + 1] = f === 0 ? 1 : (this._cascadeMaxExtents[0].y - this._cascadeMinExtents[0].y) / (this._cascadeMaxExtents[f].y - this._cascadeMinExtents[f].y), this._depthCorrection[f] = f === 0 ? 1 : (this._cascadeMaxExtents[f].z - this._cascadeMinExtents[f].z) / (this._cascadeMaxExtents[0].z - this._cascadeMinExtents[0].z);
      t.setDepthStencilTexture("shadowSampler" + e, s), t.setTexture("depthSampler" + e, s), t.setArray2("lightSizeUVCorrection" + e, this._lightSizeUVCorrection), t.setArray("depthCorrection" + e, this._depthCorrection), t.setFloat("penumbraDarkness" + e, this.penumbraDarkness), r._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), 1 / a, this._contactHardeningLightSizeUVRatio * a, this.frustumEdgeFalloff, e);
    } else
      t.setTexture("shadowSampler" + e, s), r._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), a, 1 / a, this.frustumEdgeFalloff, e);
    r._uniformBuffer.updateFloat2("depthValues", this.getLight().getDepthMinZ(i), this.getLight().getDepthMinZ(i) + this.getLight().getDepthMaxZ(i), e);
  }
  /**
   * Gets the transformation matrix of the first cascade used to project the meshes into the map from the light point of view.
   * (eq to view projection * shadow projection matrices)
   * @returns The transform matrix used to create the shadow map
   */
  getTransformMatrix() {
    return this.getCascadeTransformMatrix(0);
  }
  /**
   * Disposes the ShadowGenerator.
   * Returns nothing.
   */
  dispose() {
    super.dispose(), this._freezeShadowCastersBoundingInfoObservable && (this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable), this._freezeShadowCastersBoundingInfoObservable = null), this._depthReducer && (this._depthReducer.dispose(), this._depthReducer = null);
  }
  /**
   * Serializes the shadow generator setup to a json object.
   * @returns The serialized JSON object
   */
  serialize() {
    const e = super.serialize(), t = this.getShadowMap();
    if (!t)
      return e;
    if (e.numCascades = this._numCascades, e.debug = this._debug, e.stabilizeCascades = this.stabilizeCascades, e.lambda = this._lambda, e.cascadeBlendPercentage = this.cascadeBlendPercentage, e.depthClamp = this._depthClamp, e.autoCalcDepthBounds = this.autoCalcDepthBounds, e.shadowMaxZ = this._shadowMaxZ, e.penumbraDarkness = this.penumbraDarkness, e.freezeShadowCastersBoundingInfo = this._freezeShadowCastersBoundingInfo, e.minDistance = this.minDistance, e.maxDistance = this.maxDistance, e.renderList = [], t.renderList)
      for (let r = 0; r < t.renderList.length; r++) {
        const n = t.renderList[r];
        e.renderList.push(n.id);
      }
    return e;
  }
  /**
   * Parses a serialized ShadowGenerator and returns a new ShadowGenerator.
   * @param parsedShadowGenerator The JSON object to parse
   * @param scene The scene to create the shadow map for
   * @returns The parsed shadow generator
   */
  static Parse(e, t) {
    const r = ln.Parse(e, t, (n, i, s) => new X6(n, i, void 0, s));
    return e.numCascades !== void 0 && (r.numCascades = e.numCascades), e.debug !== void 0 && (r.debug = e.debug), e.stabilizeCascades !== void 0 && (r.stabilizeCascades = e.stabilizeCascades), e.lambda !== void 0 && (r.lambda = e.lambda), e.cascadeBlendPercentage !== void 0 && (r.cascadeBlendPercentage = e.cascadeBlendPercentage), e.depthClamp !== void 0 && (r.depthClamp = e.depthClamp), e.autoCalcDepthBounds !== void 0 && (r.autoCalcDepthBounds = e.autoCalcDepthBounds), e.shadowMaxZ !== void 0 && (r.shadowMaxZ = e.shadowMaxZ), e.penumbraDarkness !== void 0 && (r.penumbraDarkness = e.penumbraDarkness), e.freezeShadowCastersBoundingInfo !== void 0 && (r.freezeShadowCastersBoundingInfo = e.freezeShadowCastersBoundingInfo), e.minDistance !== void 0 && e.maxDistance !== void 0 && r.setMinMaxDistance(e.minDistance, e.maxDistance), r;
  }
}
X6._FrustumCornersNDCSpace = [
  new S(-1, 1, -1),
  new S(1, 1, -1),
  new S(1, -1, -1),
  new S(-1, -1, -1),
  new S(-1, 1, 1),
  new S(1, 1, 1),
  new S(1, -1, 1),
  new S(-1, -1, 1)
];
X6.CLASSNAME = "CascadedShadowGenerator";
X6.DEFAULT_CASCADES_COUNT = 4;
X6.MIN_CASCADES_COUNT = 2;
X6.MAX_CASCADES_COUNT = 4;
X6._SceneComponentInitialization = (A) => {
  throw qn("ShadowGeneratorSceneComponent");
};
J1.AddParser(Ot.NAME_SHADOWGENERATOR, (A, e) => {
  if (A.shadowGenerators !== void 0 && A.shadowGenerators !== null)
    for (let t = 0, r = A.shadowGenerators.length; t < r; t++) {
      const n = A.shadowGenerators[t];
      n.className === X6.CLASSNAME ? X6.Parse(n, e) : ln.Parse(n, e);
    }
});
class Jte {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_SHADOWGENERATOR, this.scene = e;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._gatherRenderTargetsStage.registerStep(Ot.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR, this, this._gatherRenderTargets);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Serializes the component data to the specified json object
   * @param serializationObject The object to serialize to
   */
  serialize(e) {
    e.shadowGenerators = [];
    const t = this.scene.lights;
    for (const r of t) {
      const n = r.getShadowGenerators();
      if (n) {
        const i = n.values();
        for (let s = i.next(); s.done !== !0; s = i.next()) {
          const a = s.value;
          e.shadowGenerators.push(a.serialize());
        }
      }
    }
  }
  /**
   * Adds all the elements from the container to the scene
   * @param container the container holding the elements
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  addFromContainer(e) {
  }
  /**
   * Removes all the elements in the container from the scene
   * @param container contains the elements to remove
   * @param dispose if the removed element should be disposed (default: false)
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  removeFromContainer(e, t) {
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  dispose() {
  }
  _gatherRenderTargets(e) {
    const t = this.scene;
    if (this.scene.shadowsEnabled)
      for (let r = 0; r < t.lights.length; r++) {
        const n = t.lights[r], i = n.getShadowGenerators();
        if (n.isEnabled() && n.shadowEnabled && i) {
          const s = i.values();
          for (let a = s.next(); a.done !== !0; a = s.next()) {
            const o = a.value.getShadowMap();
            t.textures.indexOf(o) !== -1 && e.push(o);
          }
        }
      }
  }
}
ln._SceneComponentInitialization = (A) => {
  let e = A._getComponent(Ot.NAME_SHADOWGENERATOR);
  e || (e = new Jte(A), A._addComponent(e));
};
Cs.AddNodeConstructor("Light_Type_0", (A, e) => () => new ag(A, S.Zero(), e));
class ag extends xD {
  /**
   * Getter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
   * This specifies what angle the shadow will use to be created.
   *
   * It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps.
   */
  get shadowAngle() {
    return this._shadowAngle;
  }
  /**
   * Setter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
   * This specifies what angle the shadow will use to be created.
   *
   * It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps.
   */
  set shadowAngle(e) {
    this._shadowAngle = e, this.forceProjectionMatrixCompute();
  }
  /**
   * Gets the direction if it has been set.
   * In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
   */
  get direction() {
    return this._direction;
  }
  /**
   * In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
   */
  set direction(e) {
    const t = this.needCube();
    if (this._direction = e, this.needCube() !== t && this._shadowGenerators) {
      const r = this._shadowGenerators.values();
      for (let n = r.next(); n.done !== !0; n = r.next())
        n.value.recreateShadowMap();
    }
  }
  /**
   * Creates a PointLight object from the passed name and position (Vector3) and adds it in the scene.
   * A PointLight emits the light in every direction.
   * It can cast shadows.
   * If the scene camera is already defined and you want to set your PointLight at the camera position, just set it :
   * ```javascript
   * var pointLight = new PointLight("pl", camera.position, scene);
   * ```
   * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
   * @param name The light friendly name
   * @param position The position of the point light in the scene
   * @param scene The scene the lights belongs to
   */
  constructor(e, t, r) {
    super(e, r), this._shadowAngle = Math.PI / 2, this.position = t;
  }
  /**
   * Returns the string "PointLight"
   * @returns the class name
   */
  getClassName() {
    return "PointLight";
  }
  /**
   * Returns the integer 0.
   * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
   */
  getTypeID() {
    return ci.LIGHTTYPEID_POINTLIGHT;
  }
  /**
   * Specifies whether or not the shadowmap should be a cube texture.
   * @returns true if the shadowmap needs to be a cube texture.
   */
  needCube() {
    return !this.direction;
  }
  /**
   * Returns a new Vector3 aligned with the PointLight cube system according to the passed cube face index (integer).
   * @param faceIndex The index of the face we are computed the direction to generate shadow
   * @returns The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true
   */
  getShadowDirection(e) {
    if (this.direction)
      return super.getShadowDirection(e);
    switch (e) {
      case 0:
        return new S(1, 0, 0);
      case 1:
        return new S(-1, 0, 0);
      case 2:
        return new S(0, -1, 0);
      case 3:
        return new S(0, 1, 0);
      case 4:
        return new S(0, 0, 1);
      case 5:
        return new S(0, 0, -1);
    }
    return S.Zero();
  }
  /**
   * Sets the passed matrix "matrix" as a left-handed perspective projection matrix with the following settings :
   * - fov = PI / 2
   * - aspect ratio : 1.0
   * - z-near and far equal to the active camera minZ and maxZ.
   * Returns the PointLight.
   * @param matrix
   * @param viewMatrix
   * @param renderList
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _setDefaultShadowProjectionMatrix(e, t, r) {
    const n = this.getScene().activeCamera;
    if (!n)
      return;
    const i = this.shadowMinZ !== void 0 ? this.shadowMinZ : n.minZ, s = this.shadowMaxZ !== void 0 ? this.shadowMaxZ : n.maxZ, a = this.getScene().getEngine().useReverseDepthBuffer;
    he.PerspectiveFovLHToRef(this.shadowAngle, 1, a ? s : i, a ? i : s, e, !0, this._scene.getEngine().isNDCHalfZRange, void 0, a);
  }
  _buildUniformLayout() {
    this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 4), this._uniformBuffer.addUniform("vLightFalloff", 4), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create();
  }
  /**
   * Sets the passed Effect "effect" with the PointLight transformed position (or position, if none) and passed name (string).
   * @param effect The effect to update
   * @param lightIndex The index of the light in the effect to update
   * @returns The point light
   */
  transferToEffect(e, t) {
    return this.computeTransformedInformation() ? this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0, t) : this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, 0, t), this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, 0, 0, t), this;
  }
  transferToNodeMaterialEffect(e, t) {
    return this.computeTransformedInformation() ? e.setFloat3(t, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z) : e.setFloat3(t, this.position.x, this.position.y, this.position.z), this;
  }
  /**
   * Prepares the list of defines specific to the light type.
   * @param defines the list of defines
   * @param lightIndex defines the index of the light for the effect
   */
  prepareLightSpecificDefines(e, t) {
    e["POINTLIGHT" + t] = !0;
  }
}
C([
  M()
], ag.prototype, "shadowAngle", null);
class oq {
  /**
   * Creates a new default loading screen
   * @param _renderingCanvas defines the canvas used to render the scene
   * @param _loadingText defines the default text to display
   * @param _loadingDivBackgroundColor defines the default background color
   */
  constructor(e, t = "", r = "black") {
    this._renderingCanvas = e, this._loadingText = t, this._loadingDivBackgroundColor = r, this._resizeLoadingUI = () => {
      const n = this._renderingCanvas.getBoundingClientRect(), i = window.getComputedStyle(this._renderingCanvas).position;
      this._loadingDiv && (this._loadingDiv.style.position = i === "fixed" ? "fixed" : "absolute", this._loadingDiv.style.left = n.left + "px", this._loadingDiv.style.top = n.top + "px", this._loadingDiv.style.width = n.width + "px", this._loadingDiv.style.height = n.height + "px");
    };
  }
  /**
   * Function called to display the loading screen
   */
  displayLoadingUI() {
    if (this._loadingDiv)
      return;
    this._loadingDiv = document.createElement("div"), this._loadingDiv.id = "babylonjsLoadingDiv", this._loadingDiv.style.opacity = "0", this._loadingDiv.style.transition = "opacity 1.5s ease", this._loadingDiv.style.pointerEvents = "none", this._loadingDiv.style.display = "grid", this._loadingDiv.style.gridTemplateRows = "100%", this._loadingDiv.style.gridTemplateColumns = "100%", this._loadingDiv.style.justifyItems = "center", this._loadingDiv.style.alignItems = "center", this._loadingTextDiv = document.createElement("div"), this._loadingTextDiv.style.position = "absolute", this._loadingTextDiv.style.left = "0", this._loadingTextDiv.style.top = "50%", this._loadingTextDiv.style.marginTop = "80px", this._loadingTextDiv.style.width = "100%", this._loadingTextDiv.style.height = "20px", this._loadingTextDiv.style.fontFamily = "Arial", this._loadingTextDiv.style.fontSize = "14px", this._loadingTextDiv.style.color = "white", this._loadingTextDiv.style.textAlign = "center", this._loadingTextDiv.style.zIndex = "1", this._loadingTextDiv.innerHTML = "Loading", this._loadingDiv.appendChild(this._loadingTextDiv), this._loadingTextDiv.innerHTML = this._loadingText, this._style = document.createElement("style"), this._style.type = "text/css";
    const e = `@-webkit-keyframes spin1 {                    0% { -webkit-transform: rotate(0deg);}
                    100% { -webkit-transform: rotate(360deg);}
                }                @keyframes spin1 {                    0% { transform: rotate(0deg);}
                    100% { transform: rotate(360deg);}
                }`;
    this._style.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(this._style);
    const t = !!window.SVGSVGElement, r = new Image();
    oq.DefaultLogoUrl ? r.src = oq.DefaultLogoUrl : r.src = t ? "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODAuMTcgMjA4LjA0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6I2UwNjg0Yjt9LmNscy0ze2ZpbGw6I2JiNDY0Yjt9LmNscy00e2ZpbGw6I2UwZGVkODt9LmNscy01e2ZpbGw6I2Q1ZDJjYTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkJhYnlsb25Mb2dvPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iUGFnZV9FbGVtZW50cyIgZGF0YS1uYW1lPSJQYWdlIEVsZW1lbnRzIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik05MC4wOSwwLDAsNTJWMTU2bDkwLjA5LDUyLDkwLjA4LTUyVjUyWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxODAuMTcgNTIuMDEgMTUxLjk3IDM1LjczIDEyNC44NSA1MS4zOSAxNTMuMDUgNjcuNjcgMTgwLjE3IDUyLjAxIi8+PHBvbHlnb24gY2xhc3M9ImNscy0yIiBwb2ludHM9IjI3LjEyIDY3LjY3IDExNy4yMSAxNS42NiA5MC4wOCAwIDAgNTIuMDEgMjcuMTIgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iNjEuODkgMTIwLjMgOTAuMDggMTM2LjU4IDExOC4yOCAxMjAuMyA5MC4wOCAxMDQuMDIgNjEuODkgMTIwLjMiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDE1My4wNSAxNDAuMzcgOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyAwIDUyLjAxIDAgMTU2LjAzIDkwLjA4IDIwOC4wNCAxODAuMTcgMTU2LjAzIDE4MC4xNyA1Mi4wMSAxNTMuMDUgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iOTAuMDggNzEuNDYgNjEuODkgODcuNzQgNjEuODkgMTIwLjMgOTAuMDggMTA0LjAyIDExOC4yOCAxMjAuMyAxMTguMjggODcuNzQgOTAuMDggNzEuNDYiLz48cG9seWdvbiBjbGFzcz0iY2xzLTQiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDExOC4yOCA4Ny43NCAxMTguMjggMTIwLjMgOTAuMDggMTM2LjU4IDkwLjA4IDE3Ni43MiAxNTMuMDUgMTQwLjM3IDE1My4wNSA2Ny42NyIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSIyNy4xMiA2Ny42NyA2MS44OSA4Ny43NCA2MS44OSAxMjAuMyA5MC4wOCAxMzYuNTggOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyIvPjwvZz48L2c+PC9zdmc+" : "https://cdn.babylonjs.com/Assets/babylonLogo.png", r.style.width = "150px", r.style.gridColumn = "1", r.style.gridRow = "1", r.style.top = "50%", r.style.left = "50%", r.style.transform = "translate(-50%, -50%)", r.style.position = "absolute";
    const n = document.createElement("div");
    n.style.width = "300px", n.style.gridColumn = "1", n.style.gridRow = "1", n.style.top = "50%", n.style.left = "50%", n.style.transform = "translate(-50%, -50%)", n.style.position = "absolute";
    const i = new Image();
    if (oq.DefaultSpinnerUrl ? i.src = oq.DefaultSpinnerUrl : i.src = t ? "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOTIgMzkyIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UwNjg0Yjt9LmNscy0ye2ZpbGw6bm9uZTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlNwaW5uZXJJY29uPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iU3Bpbm5lciI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDAuMjEsMTI2LjQzYzMuNy03LjMxLDcuNjctMTQuNDQsMTItMjEuMzJsMy4zNi01LjEsMy41Mi01YzEuMjMtMS42MywyLjQxLTMuMjksMy42NS00LjkxczIuNTMtMy4yMSwzLjgyLTQuNzlBMTg1LjIsMTg1LjIsMCwwLDEsODMuNCw2Ny40M2EyMDgsMjA4LDAsMCwxLDE5LTE1LjY2YzMuMzUtMi40MSw2Ljc0LTQuNzgsMTAuMjUtN3M3LjExLTQuMjgsMTAuNzUtNi4zMmM3LjI5LTQsMTQuNzMtOCwyMi41My0xMS40OSwzLjktMS43Miw3Ljg4LTMuMywxMi00LjY0YTEwNC4yMiwxMDQuMjIsMCwwLDEsMTIuNDQtMy4yMyw2Mi40NCw2Mi40NCwwLDAsMSwxMi43OC0xLjM5QTI1LjkyLDI1LjkyLDAsMCwxLDE5NiwyMS40NGE2LjU1LDYuNTUsMCwwLDEsMi4wNSw5LDYuNjYsNi42NiwwLDAsMS0xLjY0LDEuNzhsLS40MS4yOWEyMi4wNywyMi4wNywwLDAsMS01Ljc4LDMsMzAuNDIsMzAuNDIsMCwwLDEtNS42NywxLjYyLDM3LjgyLDM3LjgyLDAsMCwxLTUuNjkuNzFjLTEsMC0xLjkuMTgtMi44NS4yNmwtMi44NS4yNHEtNS43Mi41MS0xMS40OCwxLjFjLTMuODQuNC03LjcxLjgyLTExLjU4LDEuNGExMTIuMzQsMTEyLjM0LDAsMCwwLTIyLjk0LDUuNjFjLTMuNzIsMS4zNS03LjM0LDMtMTAuOTQsNC42NHMtNy4xNCwzLjUxLTEwLjYsNS41MUExNTEuNiwxNTEuNiwwLDAsMCw2OC41Niw4N0M2Ny4yMyw4OC40OCw2Niw5MCw2NC42NCw5MS41NnMtMi41MSwzLjE1LTMuNzUsNC43M2wtMy41NCw0LjljLTEuMTMsMS42Ni0yLjIzLDMuMzUtMy4zMyw1YTEyNywxMjcsMCwwLDAtMTAuOTMsMjEuNDksMS41OCwxLjU4LDAsMSwxLTMtMS4xNVM0MC4xOSwxMjYuNDcsNDAuMjEsMTI2LjQzWiIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjM5MiIgaGVpZ2h0PSIzOTIiLz48L2c+PC9nPjwvc3ZnPg==" : "https://cdn.babylonjs.com/Assets/loadingIcon.png", i.style.animation = "spin1 0.75s infinite linear", i.style.webkitAnimation = "spin1 0.75s infinite linear", i.style.transformOrigin = "50% 50%", i.style.webkitTransformOrigin = "50% 50%", !t) {
      const s = { w: 16, h: 18.5 }, a = { w: 30, h: 30 };
      r.style.width = `${s.w}vh`, r.style.height = `${s.h}vh`, r.style.left = `calc(50% - ${s.w / 2}vh)`, r.style.top = `calc(50% - ${s.h / 2}vh)`, i.style.width = `${a.w}vh`, i.style.height = `${a.h}vh`, i.style.left = `calc(50% - ${a.w / 2}vh)`, i.style.top = `calc(50% - ${a.h / 2}vh)`;
    }
    n.appendChild(i), this._loadingDiv.appendChild(r), this._loadingDiv.appendChild(n), this._resizeLoadingUI(), window.addEventListener("resize", this._resizeLoadingUI), this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor, document.body.appendChild(this._loadingDiv), this._loadingDiv.style.opacity = "1";
  }
  /**
   * Function called to hide the loading screen
   */
  hideLoadingUI() {
    if (!this._loadingDiv)
      return;
    const e = () => {
      this._loadingTextDiv && (this._loadingTextDiv.remove(), this._loadingTextDiv = null), this._loadingDiv && (this._loadingDiv.remove(), this._loadingDiv = null), this._style && (this._style.remove(), this._style = null), window.removeEventListener("resize", this._resizeLoadingUI);
    };
    this._loadingDiv.style.opacity = "0", this._loadingDiv.addEventListener("transitionend", e);
  }
  /**
   * Gets or sets the text to display while loading
   */
  set loadingUIText(e) {
    this._loadingText = e, this._loadingTextDiv && (this._loadingTextDiv.innerHTML = this._loadingText);
  }
  get loadingUIText() {
    return this._loadingText;
  }
  /**
   * Gets or sets the color to use for the background
   */
  get loadingUIBackgroundColor() {
    return this._loadingDivBackgroundColor;
  }
  set loadingUIBackgroundColor(e) {
    this._loadingDivBackgroundColor = e, this._loadingDiv && (this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor);
  }
}
oq.DefaultLogoUrl = "";
oq.DefaultSpinnerUrl = "";
Ge.DefaultLoadingScreenFactory = (A) => new oq(A);
class wq {
  /**
   * Converts a panorama stored in RGB right to left up to down format into a cubemap (6 faces).
   *
   * @param float32Array The source data.
   * @param inputWidth The width of the input panorama.
   * @param inputHeight The height of the input panorama.
   * @param size The willing size of the generated cubemap (each faces will be size * size pixels)
   * @returns The cubemap data
   */
  static ConvertPanoramaToCubemap(e, t, r, n, i = !1) {
    if (!e)
      throw "ConvertPanoramaToCubemap: input cannot be null";
    if (e.length != t * r * 3)
      throw "ConvertPanoramaToCubemap: input size is wrong";
    const s = this.CreateCubemapTexture(n, this.FACE_FRONT, e, t, r, i), a = this.CreateCubemapTexture(n, this.FACE_BACK, e, t, r, i), f = this.CreateCubemapTexture(n, this.FACE_LEFT, e, t, r, i), o = this.CreateCubemapTexture(n, this.FACE_RIGHT, e, t, r, i), d = this.CreateCubemapTexture(n, this.FACE_UP, e, t, r, i), v = this.CreateCubemapTexture(n, this.FACE_DOWN, e, t, r, i);
    return {
      front: s,
      back: a,
      left: f,
      right: o,
      up: d,
      down: v,
      size: n,
      type: 1,
      format: 4,
      gammaSpace: !1
    };
  }
  static CreateCubemapTexture(e, t, r, n, i, s = !1) {
    const a = new ArrayBuffer(e * e * 4 * 3), f = new Float32Array(a), o = s ? Math.max(1, Math.round(n / 4 / e)) : 1, d = 1 / o, v = d * d, u = t[1].subtract(t[0]).scale(d / e), l = t[3].subtract(t[2]).scale(d / e), P = 1 / e;
    let p = 0;
    for (let c = 0; c < e; c++)
      for (let H = 0; H < o; H++) {
        let T = t[0], q = t[2];
        for (let b = 0; b < e; b++)
          for (let j = 0; j < o; j++) {
            const w = q.subtract(T).scale(p).add(T);
            w.normalize();
            const m = this.CalcProjectionSpherical(w, r, n, i);
            f[c * e * 3 + b * 3 + 0] += m.r * v, f[c * e * 3 + b * 3 + 1] += m.g * v, f[c * e * 3 + b * 3 + 2] += m.b * v, T = T.add(u), q = q.add(l);
          }
        p += P * d;
      }
    return f;
  }
  static CalcProjectionSpherical(e, t, r, n) {
    let i = Math.atan2(e.z, e.x);
    const s = Math.acos(e.y);
    for (; i < -Math.PI; )
      i += 2 * Math.PI;
    for (; i > Math.PI; )
      i -= 2 * Math.PI;
    let a = i / Math.PI;
    const f = s / Math.PI;
    a = a * 0.5 + 0.5;
    let o = Math.round(a * r);
    o < 0 ? o = 0 : o >= r && (o = r - 1);
    let d = Math.round(f * n);
    d < 0 ? d = 0 : d >= n && (d = n - 1);
    const v = n - d - 1, u = t[v * r * 3 + o * 3 + 0], l = t[v * r * 3 + o * 3 + 1], P = t[v * r * 3 + o * 3 + 2];
    return {
      r: u,
      g: l,
      b: P
    };
  }
}
wq.FACE_LEFT = [new S(-1, -1, -1), new S(1, -1, -1), new S(-1, 1, -1), new S(1, 1, -1)];
wq.FACE_RIGHT = [new S(1, -1, 1), new S(-1, -1, 1), new S(1, 1, 1), new S(-1, 1, 1)];
wq.FACE_FRONT = [new S(1, -1, -1), new S(1, -1, 1), new S(1, 1, -1), new S(1, 1, 1)];
wq.FACE_BACK = [new S(-1, -1, 1), new S(-1, -1, -1), new S(-1, 1, 1), new S(-1, 1, -1)];
wq.FACE_DOWN = [new S(1, 1, -1), new S(1, 1, 1), new S(-1, 1, -1), new S(-1, 1, 1)];
wq.FACE_UP = [new S(-1, -1, -1), new S(-1, -1, 1), new S(1, -1, -1), new S(1, -1, 1)];
class iO {
  static _Ldexp(e, t) {
    return t > 1023 ? e * Math.pow(2, 1023) * Math.pow(2, t - 1023) : t < -1074 ? e * Math.pow(2, -1074) * Math.pow(2, t + 1074) : e * Math.pow(2, t);
  }
  static _Rgbe2float(e, t, r, n, i, s) {
    i > 0 ? (i = this._Ldexp(1, i - 136), e[s + 0] = t * i, e[s + 1] = r * i, e[s + 2] = n * i) : (e[s + 0] = 0, e[s + 1] = 0, e[s + 2] = 0);
  }
  static _ReadStringLine(e, t) {
    let r = "", n = "";
    for (let i = t; i < e.length - t && (n = String.fromCharCode(e[i]), n != `
`); i++)
      r += n;
    return r;
  }
  /**
   * Reads header information from an RGBE texture stored in a native array.
   * More information on this format are available here:
   * https://en.wikipedia.org/wiki/RGBE_image_format
   *
   * @param uint8array The binary file stored in  native array.
   * @returns The header information.
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static RGBE_ReadHeader(e) {
    let t = 0, r = 0, n = this._ReadStringLine(e, 0);
    if (n[0] != "#" || n[1] != "?")
      throw "Bad HDR Format.";
    let i = !1, s = !1, a = 0;
    do
      a += n.length + 1, n = this._ReadStringLine(e, a), n == "FORMAT=32-bit_rle_rgbe" ? s = !0 : n.length == 0 && (i = !0);
    while (!i);
    if (!s)
      throw "HDR Bad header format, unsupported FORMAT";
    a += n.length + 1, n = this._ReadStringLine(e, a);
    const o = /^-Y (.*) \+X (.*)$/g.exec(n);
    if (!o || o.length < 3)
      throw "HDR Bad header format, no size";
    if (r = parseInt(o[2]), t = parseInt(o[1]), r < 8 || r > 32767)
      throw "HDR Bad header format, unsupported size";
    return a += n.length + 1, {
      height: t,
      width: r,
      dataPosition: a
    };
  }
  /**
   * Returns the cubemap information (each faces texture data) extracted from an RGBE texture.
   * This RGBE texture needs to store the information as a panorama.
   *
   * More information on this format are available here:
   * https://en.wikipedia.org/wiki/RGBE_image_format
   *
   * @param buffer The binary file stored in an array buffer.
   * @param size The expected size of the extracted cubemap.
   * @returns The Cube Map information.
   */
  static GetCubeMapTextureData(e, t, r = !1) {
    const n = new Uint8Array(e), i = this.RGBE_ReadHeader(n), s = this.RGBE_ReadPixels(n, i);
    return wq.ConvertPanoramaToCubemap(s, i.width, i.height, t, r);
  }
  /**
   * Returns the pixels data extracted from an RGBE texture.
   * This pixels will be stored left to right up to down in the R G B order in one array.
   *
   * More information on this format are available here:
   * https://en.wikipedia.org/wiki/RGBE_image_format
   *
   * @param uint8array The binary file stored in an array buffer.
   * @param hdrInfo The header information of the file.
   * @returns The pixels data in RGB right to left up to down order.
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  static RGBE_ReadPixels(e, t) {
    return this._RGBEReadPixelsRLE(e, t);
  }
  static _RGBEReadPixelsRLE(e, t) {
    let r = t.height;
    const n = t.width;
    let i, s, a, f, o, d = t.dataPosition, v = 0, u = 0, l = 0;
    const P = new ArrayBuffer(n * 4), p = new Uint8Array(P), c = new ArrayBuffer(t.width * t.height * 4 * 3), H = new Float32Array(c);
    for (; r > 0; ) {
      if (i = e[d++], s = e[d++], a = e[d++], f = e[d++], i != 2 || s != 2 || a & 128 || t.width < 8 || t.width > 32767)
        return this._RGBEReadPixelsNOTRLE(e, t);
      if ((a << 8 | f) != n)
        throw "HDR Bad header format, wrong scan line width";
      for (v = 0, l = 0; l < 4; l++)
        for (u = (l + 1) * n; v < u; )
          if (i = e[d++], s = e[d++], i > 128) {
            if (o = i - 128, o == 0 || o > u - v)
              throw "HDR Bad Format, bad scanline data (run)";
            for (; o-- > 0; )
              p[v++] = s;
          } else {
            if (o = i, o == 0 || o > u - v)
              throw "HDR Bad Format, bad scanline data (non-run)";
            if (p[v++] = s, --o > 0)
              for (let T = 0; T < o; T++)
                p[v++] = e[d++];
          }
      for (l = 0; l < n; l++)
        i = p[l], s = p[l + n], a = p[l + 2 * n], f = p[l + 3 * n], this._Rgbe2float(H, i, s, a, f, (t.height - r) * n * 3 + l * 3);
      r--;
    }
    return H;
  }
  static _RGBEReadPixelsNOTRLE(e, t) {
    let r = t.height;
    const n = t.width;
    let i, s, a, f, o, d = t.dataPosition;
    const v = new ArrayBuffer(t.width * t.height * 4 * 3), u = new Float32Array(v);
    for (; r > 0; ) {
      for (o = 0; o < t.width; o++)
        i = e[d++], s = e[d++], a = e[d++], f = e[d++], this._Rgbe2float(u, i, s, a, f, (t.height - r) * n * 3 + o * 3);
      r--;
    }
    return u;
  }
}
const hpe = "hdrFilteringVertexShader", Hpe = `attribute vec2 position;varying vec3 direction;uniform vec3 up;uniform vec3 right;uniform vec3 front;
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
mat3 view=mat3(up,right,front);direction=view*vec3(position,1.0);gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[hpe] = Hpe;
const gpe = "hdrFilteringPixelShader", Xpe = `#include<helperFunctions>
#include<importanceSampling>
#include<pbrBRDFFunctions>
#include<hdrFilteringFunctions>
uniform float alphaG;uniform samplerCube inputTexture;uniform vec2 vFilteringInfo;uniform float hdrScale;varying vec3 direction;void main() {vec3 color=radiance(alphaG,inputTexture,direction,vFilteringInfo);gl_FragColor=vec4(color*hdrScale,1.0);}`;
Le.ShadersStore[gpe] = Xpe;
class _Q {
  /**
   * Instantiates HDR filter for reflection maps
   *
   * @param engine Thin engine
   * @param options Options
   */
  constructor(e, t = {}) {
    this._lodGenerationOffset = 0, this._lodGenerationScale = 0.8, this.quality = 4096, this.hdrScale = 1, this._engine = e, this.hdrScale = t.hdrScale || this.hdrScale, this.quality = t.quality || this.quality;
  }
  _createRenderTarget(e) {
    let t = 0;
    this._engine.getCaps().textureHalfFloatRender ? t = 2 : this._engine.getCaps().textureFloatRender && (t = 1);
    const r = this._engine.createRenderTargetCubeTexture(e, {
      format: 5,
      type: t,
      createMipMaps: !0,
      generateMipMaps: !1,
      generateDepthBuffer: !1,
      generateStencilBuffer: !1,
      samplingMode: 1
    });
    return this._engine.updateTextureWrappingMode(r.texture, 0, 0, 0), this._engine.updateTextureSamplingMode(3, r.texture, !0), r;
  }
  _prefilterInternal(e) {
    const t = e.getSize().width, r = Xt.ILog2(t) + 1, n = this._effectWrapper.effect, i = this._createRenderTarget(t);
    this._effectRenderer.saveStates(), this._effectRenderer.setViewport();
    const s = e.getInternalTexture();
    s && this._engine.updateTextureSamplingMode(3, s, !0), this._effectRenderer.applyEffectWrapper(this._effectWrapper);
    const a = [
      [new S(0, 0, -1), new S(0, -1, 0), new S(1, 0, 0)],
      [new S(0, 0, 1), new S(0, -1, 0), new S(-1, 0, 0)],
      [new S(1, 0, 0), new S(0, 0, 1), new S(0, 1, 0)],
      [new S(1, 0, 0), new S(0, 0, -1), new S(0, -1, 0)],
      [new S(1, 0, 0), new S(0, -1, 0), new S(0, 0, 1)],
      [new S(-1, 0, 0), new S(0, -1, 0), new S(0, 0, -1)]
      // NegativeZ
    ];
    n.setFloat("hdrScale", this.hdrScale), n.setFloat2("vFilteringInfo", e.getSize().width, r), n.setTexture("inputTexture", e);
    for (let d = 0; d < 6; d++) {
      n.setVector3("up", a[d][0]), n.setVector3("right", a[d][1]), n.setVector3("front", a[d][2]);
      for (let v = 0; v < r; v++) {
        this._engine.bindFramebuffer(i, d, void 0, void 0, !0, v), this._effectRenderer.applyEffectWrapper(this._effectWrapper);
        let u = Math.pow(2, (v - this._lodGenerationOffset) / this._lodGenerationScale) / t;
        v === 0 && (u = 0), n.setFloat("alphaG", u), this._effectRenderer.draw();
      }
    }
    this._effectRenderer.restoreStates(), this._engine.restoreDefaultFramebuffer(), this._engine._releaseTexture(e._texture);
    const f = i.texture.type, o = i.texture.format;
    return i._swapAndDie(e._texture), e._texture.type = f, e._texture.format = o, e.gammaSpace = !1, e.lodGenerationOffset = this._lodGenerationOffset, e.lodGenerationScale = this._lodGenerationScale, e._prefiltered = !0, e;
  }
  _createEffect(e, t) {
    const r = [];
    return e.gammaSpace && r.push("#define GAMMA_INPUT"), r.push("#define NUM_SAMPLES " + this.quality + "u"), new ng({
      engine: this._engine,
      name: "hdrFiltering",
      vertexShader: "hdrFiltering",
      fragmentShader: "hdrFiltering",
      samplerNames: ["inputTexture"],
      uniformNames: ["vSampleDirections", "vWeights", "up", "right", "front", "vFilteringInfo", "hdrScale", "alphaG"],
      useShaderStore: !0,
      defines: r,
      onCompiled: t
    });
  }
  /**
   * Get a value indicating if the filter is ready to be used
   * @param texture Texture to filter
   * @returns true if the filter is ready
   */
  isReady(e) {
    return e.isReady() && this._effectWrapper.effect.isReady();
  }
  /**
   * Prefilters a cube texture to have mipmap levels representing roughness values.
   * Prefiltering will be invoked at the end of next rendering pass.
   * This has to be done once the map is loaded, and has not been prefiltered by a third party software.
   * See http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf for more information
   * @param texture Texture to filter
   * @param onFinished Callback when filtering is done
   * @returns Promise called when prefiltering is done
   */
  prefilter(e, t = null) {
    return this._engine._features.allowTexturePrefiltering ? new Promise((r) => {
      this._effectRenderer = new fU(this._engine), this._effectWrapper = this._createEffect(e), this._effectWrapper.effect.executeWhenCompiled(() => {
        this._prefilterInternal(e), this._effectRenderer.dispose(), this._effectWrapper.dispose(), r(), t && t();
      });
    }) : (Se.Warn("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead."), Promise.reject("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead."));
  }
}
class _2 extends ls {
  /**
   * Sets whether or not the texture is blocking during loading.
   */
  set isBlocking(e) {
    this._isBlocking = e;
  }
  /**
   * Gets whether or not the texture is blocking during loading.
   */
  get isBlocking() {
    return this._isBlocking;
  }
  /**
   * Sets texture matrix rotation angle around Y axis in radians.
   */
  set rotationY(e) {
    this._rotationY = e, this.setReflectionTextureMatrix(he.RotationY(this._rotationY));
  }
  /**
   * Gets texture matrix rotation angle around Y axis radians.
   */
  get rotationY() {
    return this._rotationY;
  }
  /**
   * Gets or sets the size of the bounding box associated with the cube texture
   * When defined, the cubemap will switch to local mode
   * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity
   * @example https://www.babylonjs-playground.com/#RNASML
   */
  set boundingBoxSize(e) {
    if (this._boundingBoxSize && this._boundingBoxSize.equals(e))
      return;
    this._boundingBoxSize = e;
    const t = this.getScene();
    t && t.markAllMaterialsAsDirty(1);
  }
  get boundingBoxSize() {
    return this._boundingBoxSize;
  }
  /**
   * Instantiates an HDRTexture from the following parameters.
   *
   * @param url The location of the HDR raw data (Panorama stored in RGBE format)
   * @param sceneOrEngine The scene or engine the texture will be used in
   * @param size The cubemap desired size (the more it increases the longer the generation will be)
   * @param noMipmap Forces to not generate the mipmap if true
   * @param generateHarmonics Specifies whether you want to extract the polynomial harmonics during the generation process
   * @param gammaSpace Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)
   * @param prefilterOnLoad Prefilters HDR texture to allow use of this texture as a PBR reflection texture.
   * @param onLoad
   * @param onError
   */
  constructor(e, t, r, n = !1, i = !0, s = !1, a = !1, f = null, o = null, d = !1) {
    var v;
    super(t), this._generateHarmonics = !0, this._onError = null, this._isBlocking = !0, this._rotationY = 0, this.boundingBoxPosition = S.Zero(), this.onLoadObservable = new Oe(), e && (this._coordinatesMode = We.CUBIC_MODE, this.name = e, this.url = e, this.hasAlpha = !1, this.isCube = !0, this._textureMatrix = he.Identity(), this._prefilterOnLoad = a, this._onLoad = () => {
      this.onLoadObservable.notifyObservers(this), f && f();
    }, this._onError = o, this.gammaSpace = s, this._noMipmap = n, this._size = r, this._supersample = d, this._generateHarmonics = i, this._texture = this._getFromCache(e, this._noMipmap, void 0, void 0, void 0, this.isCube), this._texture ? this._texture.isReady ? ye.SetImmediate(() => this._onLoad()) : this._texture.onLoadedObservable.add(this._onLoad) : !((v = this.getScene()) === null || v === void 0) && v.useDelayedTextureLoading ? this.delayLoadState = 4 : this._loadTexture());
  }
  /**
   * Get the current class name of the texture useful for serialization or dynamic coding.
   * @returns "HDRCubeTexture"
   */
  getClassName() {
    return "HDRCubeTexture";
  }
  /**
   * Occurs when the file is raw .hdr file.
   */
  _loadTexture() {
    const e = this._getEngine(), t = e.getCaps();
    let r = 0;
    t.textureFloat && t.textureFloatLinearFiltering ? r = 1 : t.textureHalfFloat && t.textureHalfFloatLinearFiltering && (r = 2);
    const n = (i) => {
      this.lodGenerationOffset = 0, this.lodGenerationScale = 0.8;
      const s = iO.GetCubeMapTextureData(i, this._size, this._supersample);
      if (this._generateHarmonics) {
        const d = Sm.ConvertCubeMapToSphericalPolynomial(s);
        this.sphericalPolynomial = d;
      }
      const a = [];
      let f = null, o = null;
      for (let d = 0; d < 6; d++) {
        r === 2 ? o = new Uint16Array(this._size * this._size * 3) : r === 0 && (f = new Uint8Array(this._size * this._size * 3));
        const v = s[_2._FacesMapping[d]];
        if (this.gammaSpace || o || f) {
          for (let u = 0; u < this._size * this._size; u++)
            if (this.gammaSpace && (v[u * 3 + 0] = Math.pow(v[u * 3 + 0], JW), v[u * 3 + 1] = Math.pow(v[u * 3 + 1], JW), v[u * 3 + 2] = Math.pow(v[u * 3 + 2], JW)), o && (o[u * 3 + 0] = LH(v[u * 3 + 0]), o[u * 3 + 1] = LH(v[u * 3 + 1]), o[u * 3 + 2] = LH(v[u * 3 + 2])), f) {
              let l = Math.max(v[u * 3 + 0] * 255, 0), P = Math.max(v[u * 3 + 1] * 255, 0), p = Math.max(v[u * 3 + 2] * 255, 0);
              const c = Math.max(Math.max(l, P), p);
              if (c > 255) {
                const H = 255 / c;
                l *= H, P *= H, p *= H;
              }
              f[u * 3 + 0] = l, f[u * 3 + 1] = P, f[u * 3 + 2] = p;
            }
        }
        o ? a.push(o) : f ? a.push(f) : a.push(v);
      }
      return a;
    };
    if (e._features.allowTexturePrefiltering && this._prefilterOnLoad) {
      const i = this._onLoad, s = new _Q(e);
      this._onLoad = () => {
        s.prefilter(this, i);
      };
    }
    this._texture = e.createRawCubeTextureFromUrl(this.url, this.getScene(), this._size, 4, r, this._noMipmap, n, null, this._onLoad, this._onError);
  }
  clone() {
    const e = new _2(this.url, this.getScene() || this._getEngine(), this._size, this._noMipmap, this._generateHarmonics, this.gammaSpace);
    return e.level = this.level, e.wrapU = this.wrapU, e.wrapV = this.wrapV, e.coordinatesIndex = this.coordinatesIndex, e.coordinatesMode = this.coordinatesMode, e;
  }
  // Methods
  delayLoad() {
    this.delayLoadState === 4 && (this.delayLoadState = 1, this._texture = this._getFromCache(this.url, this._noMipmap), this._texture || this._loadTexture());
  }
  /**
   * Get the texture reflection matrix used to rotate/transform the reflection.
   * @returns the reflection matrix
   */
  getReflectionTextureMatrix() {
    return this._textureMatrix;
  }
  /**
   * Set the texture reflection matrix used to rotate/transform the reflection.
   * @param value Define the reflection matrix to set
   */
  setReflectionTextureMatrix(e) {
    var t;
    this._textureMatrix = e, e.updateFlag !== this._textureMatrix.updateFlag && e.isIdentity() !== this._textureMatrix.isIdentity() && ((t = this.getScene()) === null || t === void 0 || t.markAllMaterialsAsDirty(1, (r) => r.getActiveTextures().indexOf(this) !== -1));
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
    this.onLoadObservable.clear(), super.dispose();
  }
  /**
   * Parses a JSON representation of an HDR Texture in order to create the texture
   * @param parsedTexture Define the JSON representation
   * @param scene Define the scene the texture should be created in
   * @param rootUrl Define the root url in case we need to load relative dependencies
   * @returns the newly created texture after parsing
   */
  static Parse(e, t, r) {
    let n = null;
    return e.name && !e.isRenderTarget && (n = new _2(r + e.name, t, e.size, e.noMipmap, e.generateHarmonics, e.useInGammaSpace), n.name = e.name, n.hasAlpha = e.hasAlpha, n.level = e.level, n.coordinatesMode = e.coordinatesMode, n.isBlocking = e.isBlocking), n && (e.boundingBoxPosition && (n.boundingBoxPosition = S.FromArray(e.boundingBoxPosition)), e.boundingBoxSize && (n.boundingBoxSize = S.FromArray(e.boundingBoxSize)), e.rotationY && (n.rotationY = e.rotationY)), n;
  }
  serialize() {
    if (!this.name)
      return null;
    const e = {};
    return e.name = this.name, e.hasAlpha = this.hasAlpha, e.isCube = !0, e.level = this.level, e.size = this._size, e.coordinatesMode = this.coordinatesMode, e.useInGammaSpace = this.gammaSpace, e.generateHarmonics = this._generateHarmonics, e.customType = "BABYLON.HDRCubeTexture", e.noMipmap = this._noMipmap, e.isBlocking = this._isBlocking, e.rotationY = this._rotationY, e;
  }
}
_2._FacesMapping = ["right", "left", "up", "down", "front", "back"];
Ue("BABYLON.HDRCubeTexture", _2);
class lD {
  /**
   * Gets or sets the influence of this target (ie. its weight in the overall morphing)
   */
  get influence() {
    return this._influence;
  }
  set influence(e) {
    if (this._influence === e)
      return;
    const t = this._influence;
    this._influence = e, this.onInfluenceChanged.hasObservers() && this.onInfluenceChanged.notifyObservers(t === 0 || e === 0);
  }
  /**
   * Gets or sets the animation properties override
   */
  get animationPropertiesOverride() {
    return !this._animationPropertiesOverride && this._scene ? this._scene.animationPropertiesOverride : this._animationPropertiesOverride;
  }
  set animationPropertiesOverride(e) {
    this._animationPropertiesOverride = e;
  }
  /**
   * Creates a new MorphTarget
   * @param name defines the name of the target
   * @param influence defines the influence to use
   * @param scene defines the scene the morphtarget belongs to
   */
  constructor(e, t = 0, r = null) {
    this.name = e, this.animations = [], this._positions = null, this._normals = null, this._tangents = null, this._uvs = null, this._uniqueId = 0, this.onInfluenceChanged = new Oe(), this._onDataLayoutChanged = new Oe(), this._animationPropertiesOverride = null, this._scene = r || gr.LastCreatedScene, this.influence = t, this._scene && (this._uniqueId = this._scene.getUniqueId());
  }
  /**
   * Gets the unique ID of this manager
   */
  get uniqueId() {
    return this._uniqueId;
  }
  /**
   * Gets a boolean defining if the target contains position data
   */
  get hasPositions() {
    return !!this._positions;
  }
  /**
   * Gets a boolean defining if the target contains normal data
   */
  get hasNormals() {
    return !!this._normals;
  }
  /**
   * Gets a boolean defining if the target contains tangent data
   */
  get hasTangents() {
    return !!this._tangents;
  }
  /**
   * Gets a boolean defining if the target contains texture coordinates data
   */
  get hasUVs() {
    return !!this._uvs;
  }
  /**
   * Affects position data to this target
   * @param data defines the position data to use
   */
  setPositions(e) {
    const t = this.hasPositions;
    this._positions = e, t !== this.hasPositions && this._onDataLayoutChanged.notifyObservers(void 0);
  }
  /**
   * Gets the position data stored in this target
   * @returns a FloatArray containing the position data (or null if not present)
   */
  getPositions() {
    return this._positions;
  }
  /**
   * Affects normal data to this target
   * @param data defines the normal data to use
   */
  setNormals(e) {
    const t = this.hasNormals;
    this._normals = e, t !== this.hasNormals && this._onDataLayoutChanged.notifyObservers(void 0);
  }
  /**
   * Gets the normal data stored in this target
   * @returns a FloatArray containing the normal data (or null if not present)
   */
  getNormals() {
    return this._normals;
  }
  /**
   * Affects tangent data to this target
   * @param data defines the tangent data to use
   */
  setTangents(e) {
    const t = this.hasTangents;
    this._tangents = e, t !== this.hasTangents && this._onDataLayoutChanged.notifyObservers(void 0);
  }
  /**
   * Gets the tangent data stored in this target
   * @returns a FloatArray containing the tangent data (or null if not present)
   */
  getTangents() {
    return this._tangents;
  }
  /**
   * Affects texture coordinates data to this target
   * @param data defines the texture coordinates data to use
   */
  setUVs(e) {
    const t = this.hasUVs;
    this._uvs = e, t !== this.hasUVs && this._onDataLayoutChanged.notifyObservers(void 0);
  }
  /**
   * Gets the texture coordinates data stored in this target
   * @returns a FloatArray containing the texture coordinates data (or null if not present)
   */
  getUVs() {
    return this._uvs;
  }
  /**
   * Clone the current target
   * @returns a new MorphTarget
   */
  clone() {
    const e = jt.Clone(() => new lD(this.name, this.influence, this._scene), this);
    return e._positions = this._positions, e._normals = this._normals, e._tangents = this._tangents, e._uvs = this._uvs, e;
  }
  /**
   * Serializes the current target into a Serialization object
   * @returns the serialized object
   */
  serialize() {
    const e = {};
    return e.name = this.name, e.influence = this.influence, e.positions = Array.prototype.slice.call(this.getPositions()), this.id != null && (e.id = this.id), this.hasNormals && (e.normals = Array.prototype.slice.call(this.getNormals())), this.hasTangents && (e.tangents = Array.prototype.slice.call(this.getTangents())), this.hasUVs && (e.uvs = Array.prototype.slice.call(this.getUVs())), jt.AppendSerializedAnimations(this, e), e;
  }
  /**
   * Returns the string "MorphTarget"
   * @returns "MorphTarget"
   */
  getClassName() {
    return "MorphTarget";
  }
  // Statics
  /**
   * Creates a new target from serialized data
   * @param serializationObject defines the serialized data to use
   * @param scene defines the hosting scene
   * @returns a new MorphTarget
   */
  static Parse(e, t) {
    const r = new lD(e.name, e.influence);
    if (r.setPositions(e.positions), e.id != null && (r.id = e.id), e.normals && r.setNormals(e.normals), e.tangents && r.setTangents(e.tangents), e.uvs && r.setUVs(e.uvs), e.animations) {
      for (let n = 0; n < e.animations.length; n++) {
        const i = e.animations[n], s = Jo("BABYLON.Animation");
        s && r.animations.push(s.Parse(i));
      }
      e.autoAnimate && t && t.beginAnimation(r, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1);
    }
    return r;
  }
  /**
   * Creates a MorphTarget from mesh data
   * @param mesh defines the source mesh
   * @param name defines the name to use for the new target
   * @param influence defines the influence to attach to the target
   * @returns a new MorphTarget
   */
  static FromMesh(e, t, r) {
    t || (t = e.name);
    const n = new lD(t, r, e.getScene());
    return n.setPositions(e.getVerticesData(J.PositionKind)), e.isVerticesDataPresent(J.NormalKind) && n.setNormals(e.getVerticesData(J.NormalKind)), e.isVerticesDataPresent(J.TangentKind) && n.setTangents(e.getVerticesData(J.TangentKind)), e.isVerticesDataPresent(J.UVKind) && n.setUVs(e.getVerticesData(J.UVKind)), n;
  }
}
C([
  M()
], lD.prototype, "id", void 0);
class Py extends We {
  /**
   * Gets the number of layers of the texture
   */
  get depth() {
    return this._depth;
  }
  /**
   * Create a new RawTexture2DArray
   * @param data defines the data of the texture
   * @param width defines the width of the texture
   * @param height defines the height of the texture
   * @param depth defines the number of layers of the texture
   * @param format defines the texture format to use
   * @param scene defines the hosting scene
   * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)
   * @param invertY defines if texture must be stored with Y axis inverted
   * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)
   * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   */
  constructor(e, t, r, n, i, s, a = !0, f = !1, o = We.TRILINEAR_SAMPLINGMODE, d = 0, v) {
    super(null, s, !a, f), this.format = i, this._texture = s.getEngine().createRawTexture2DArray(e, t, r, n, i, a, f, o, null, d, v), this._depth = n, this.is2DArray = !0;
  }
  /**
   * Update the texture with new data
   * @param data defines the data to store in the texture
   */
  update(e) {
    this._texture && this._getEngine().updateRawTexture2DArray(this._texture, e, this._texture.format, this._texture.invertY, null, this._texture.type);
  }
  /**
   * Creates a RGBA texture from some data.
   * @param data Define the texture data
   * @param width Define the width of the texture
   * @param height Define the height of the texture
   * @param depth defines the number of layers of the texture
   * @param scene defines the scene the texture will belong to
   * @param generateMipMaps Define whether or not to create mip maps for the texture
   * @param invertY define if the data should be flipped on Y when uploaded to the GPU
   * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
   * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
   * @returns the RGBA texture
   */
  static CreateRGBATexture(e, t, r, n, i, s = !0, a = !1, f = 3, o = 0) {
    return new Py(e, t, r, n, 5, i, s, a, f, o);
  }
}
class U0 {
  /**
   * Sets a boolean indicating that adding new target or updating an existing target will not update the underlying data buffers
   */
  set areUpdatesFrozen(e) {
    e ? this._blockCounter++ : (this._blockCounter--, this._blockCounter <= 0 && (this._blockCounter = 0, this._syncActiveTargets(!0)));
  }
  get areUpdatesFrozen() {
    return this._blockCounter > 0;
  }
  /**
   * Creates a new MorphTargetManager
   * @param scene defines the current scene
   */
  constructor(e = null) {
    if (this._targets = new Array(), this._targetInfluenceChangedObservers = new Array(), this._targetDataLayoutChangedObservers = new Array(), this._activeTargets = new qf(16), this._supportsNormals = !1, this._supportsTangents = !1, this._supportsUVs = !1, this._vertexCount = 0, this._textureVertexStride = 0, this._textureWidth = 0, this._textureHeight = 1, this._uniqueId = 0, this._tempInfluences = new Array(), this._canUseTextureForTargets = !1, this._blockCounter = 0, this._parentContainer = null, this.optimizeInfluencers = !0, this.enableNormalMorphing = !0, this.enableTangentMorphing = !0, this.enableUVMorphing = !0, this._useTextureToStoreTargets = !0, e || (e = gr.LastCreatedScene), this._scene = e, this._scene) {
      this._scene.addMorphTargetManager(this), this._uniqueId = this._scene.getUniqueId();
      const t = this._scene.getEngine().getCaps();
      this._canUseTextureForTargets = t.canUseGLVertexID && t.textureFloat && t.maxVertexTextureImageUnits > 0 && t.texture2DArrayMaxLayerCount > 1;
    }
  }
  /**
   * Gets the unique ID of this manager
   */
  get uniqueId() {
    return this._uniqueId;
  }
  /**
   * Gets the number of vertices handled by this manager
   */
  get vertexCount() {
    return this._vertexCount;
  }
  /**
   * Gets a boolean indicating if this manager supports morphing of normals
   */
  get supportsNormals() {
    return this._supportsNormals && this.enableNormalMorphing;
  }
  /**
   * Gets a boolean indicating if this manager supports morphing of tangents
   */
  get supportsTangents() {
    return this._supportsTangents && this.enableTangentMorphing;
  }
  /**
   * Gets a boolean indicating if this manager supports morphing of texture coordinates
   */
  get supportsUVs() {
    return this._supportsUVs && this.enableUVMorphing;
  }
  /**
   * Gets the number of targets stored in this manager
   */
  get numTargets() {
    return this._targets.length;
  }
  /**
   * Gets the number of influencers (ie. the number of targets with influences > 0)
   */
  get numInfluencers() {
    return this._activeTargets.length;
  }
  /**
   * Gets the list of influences (one per target)
   */
  get influences() {
    return this._influences;
  }
  /**
   * Gets or sets a boolean indicating that targets should be stored as a texture instead of using vertex attributes (default is true).
   * Please note that this option is not available if the hardware does not support it
   */
  get useTextureToStoreTargets() {
    return this._useTextureToStoreTargets;
  }
  set useTextureToStoreTargets(e) {
    this._useTextureToStoreTargets = e;
  }
  /**
   * Gets a boolean indicating that the targets are stored into a texture (instead of as attributes)
   */
  get isUsingTextureForTargets() {
    var e;
    return U0.EnableTextureStorage && this.useTextureToStoreTargets && this._canUseTextureForTargets && !(!((e = this._scene) === null || e === void 0) && e.getEngine().getCaps().disableMorphTargetTexture);
  }
  /**
   * Gets the active target at specified index. An active target is a target with an influence > 0
   * @param index defines the index to check
   * @returns the requested target
   */
  getActiveTarget(e) {
    return this._activeTargets.data[e];
  }
  /**
   * Gets the target at specified index
   * @param index defines the index to check
   * @returns the requested target
   */
  getTarget(e) {
    return this._targets[e];
  }
  /**
   * Add a new target to this manager
   * @param target defines the target to add
   */
  addTarget(e) {
    this._targets.push(e), this._targetInfluenceChangedObservers.push(e.onInfluenceChanged.add((t) => {
      this._syncActiveTargets(t);
    })), this._targetDataLayoutChangedObservers.push(e._onDataLayoutChanged.add(() => {
      this._syncActiveTargets(!0);
    })), this._syncActiveTargets(!0);
  }
  /**
   * Removes a target from the manager
   * @param target defines the target to remove
   */
  removeTarget(e) {
    const t = this._targets.indexOf(e);
    t >= 0 && (this._targets.splice(t, 1), e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t, 1)[0]), e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t, 1)[0]), this._syncActiveTargets(!0)), this._scene && this._scene.stopAnimation(e);
  }
  /**
   * @internal
   */
  _bind(e) {
    e.setFloat3("morphTargetTextureInfo", this._textureVertexStride, this._textureWidth, this._textureHeight), e.setFloatArray("morphTargetTextureIndices", this._morphTargetTextureIndices), e.setTexture("morphTargets", this._targetStoreTexture);
  }
  /**
   * Clone the current manager
   * @returns a new MorphTargetManager
   */
  clone() {
    const e = new U0(this._scene);
    for (const t of this._targets)
      e.addTarget(t.clone());
    return e.enableNormalMorphing = this.enableNormalMorphing, e.enableTangentMorphing = this.enableTangentMorphing, e.enableUVMorphing = this.enableUVMorphing, e;
  }
  /**
   * Serializes the current manager into a Serialization object
   * @returns the serialized object
   */
  serialize() {
    const e = {};
    e.id = this.uniqueId, e.targets = [];
    for (const t of this._targets)
      e.targets.push(t.serialize());
    return e;
  }
  _syncActiveTargets(e) {
    if (this.areUpdatesFrozen)
      return;
    let t = 0;
    this._activeTargets.reset(), this._supportsNormals = !0, this._supportsTangents = !0, this._supportsUVs = !0, this._vertexCount = 0, this._scene && this._targets.length > this._scene.getEngine().getCaps().texture2DArrayMaxLayerCount && (this.useTextureToStoreTargets = !1), (!this._morphTargetTextureIndices || this._morphTargetTextureIndices.length !== this._targets.length) && (this._morphTargetTextureIndices = new Float32Array(this._targets.length));
    let r = -1;
    for (const n of this._targets) {
      if (r++, n.influence === 0 && this.optimizeInfluencers)
        continue;
      if (this._activeTargets.length >= U0.MaxActiveMorphTargetsInVertexAttributeMode && !this.isUsingTextureForTargets)
        break;
      this._activeTargets.push(n), this._morphTargetTextureIndices[t] = r, this._tempInfluences[t++] = n.influence, this._supportsNormals = this._supportsNormals && n.hasNormals, this._supportsTangents = this._supportsTangents && n.hasTangents, this._supportsUVs = this._supportsUVs && n.hasUVs;
      const i = n.getPositions();
      if (i) {
        const s = i.length / 3;
        if (this._vertexCount === 0)
          this._vertexCount = s;
        else if (this._vertexCount !== s) {
          Se.Error("Incompatible target. Targets must all have the same vertices count.");
          return;
        }
      }
    }
    this._morphTargetTextureIndices.length !== t && (this._morphTargetTextureIndices = this._morphTargetTextureIndices.slice(0, t)), (!this._influences || this._influences.length !== t) && (this._influences = new Float32Array(t));
    for (let n = 0; n < t; n++)
      this._influences[n] = this._tempInfluences[n];
    e && this.synchronize();
  }
  /**
   * Synchronize the targets with all the meshes using this morph target manager
   */
  synchronize() {
    if (!(!this._scene || this.areUpdatesFrozen)) {
      if (this.isUsingTextureForTargets && this._vertexCount) {
        this._textureVertexStride = 1, this._supportsNormals && this._textureVertexStride++, this._supportsTangents && this._textureVertexStride++, this._supportsUVs && this._textureVertexStride++, this._textureWidth = this._vertexCount * this._textureVertexStride, this._textureHeight = 1;
        const e = this._scene.getEngine().getCaps().maxTextureSize;
        this._textureWidth > e && (this._textureHeight = Math.ceil(this._textureWidth / e), this._textureWidth = e);
        let t = !0;
        if (this._targetStoreTexture) {
          const r = this._targetStoreTexture.getSize();
          r.width === this._textureWidth && r.height === this._textureHeight && this._targetStoreTexture.depth === this._targets.length && (t = !1);
        }
        if (t) {
          this._targetStoreTexture && this._targetStoreTexture.dispose();
          const r = this._targets.length, n = new Float32Array(r * this._textureWidth * this._textureHeight * 4);
          let i = 0;
          for (let s = 0; s < r; s++) {
            const a = this._targets[s], f = a.getPositions(), o = a.getNormals(), d = a.getUVs(), v = a.getTangents();
            if (!f) {
              s === 0 && Se.Error("Invalid morph target. Target must have positions.");
              return;
            }
            i = s * this._textureWidth * this._textureHeight * 4;
            for (let u = 0; u < this._vertexCount; u++)
              n[i] = f[u * 3], n[i + 1] = f[u * 3 + 1], n[i + 2] = f[u * 3 + 2], i += 4, this._supportsNormals && o && (n[i] = o[u * 3], n[i + 1] = o[u * 3 + 1], n[i + 2] = o[u * 3 + 2], i += 4), this._supportsUVs && d && (n[i] = d[u * 2], n[i + 1] = d[u * 2 + 1], i += 4), this._supportsTangents && v && (n[i] = v[u * 3], n[i + 1] = v[u * 3 + 1], n[i + 2] = v[u * 3 + 2], i += 4);
          }
          this._targetStoreTexture = Py.CreateRGBATexture(n, this._textureWidth, this._textureHeight, r, this._scene, !1, !1, 1, 1);
        }
      }
      for (const e of this._scene.meshes)
        e.morphTargetManager === this && e._syncGeometryWithMorphTargetManager();
    }
  }
  /**
   * Release all resources
   */
  dispose() {
    if (this._targetStoreTexture && this._targetStoreTexture.dispose(), this._targetStoreTexture = null, this._scene) {
      if (this._scene.removeMorphTargetManager(this), this._parentContainer) {
        const e = this._parentContainer.morphTargetManagers.indexOf(this);
        e > -1 && this._parentContainer.morphTargetManagers.splice(e, 1), this._parentContainer = null;
      }
      for (const e of this._targets)
        this._scene.stopAnimation(e);
    }
  }
  // Statics
  /**
   * Creates a new MorphTargetManager from serialized data
   * @param serializationObject defines the serialized data
   * @param scene defines the hosting scene
   * @returns the new MorphTargetManager
   */
  static Parse(e, t) {
    const r = new U0(t);
    r._uniqueId = e.id;
    for (const n of e.targets)
      r.addTarget(lD.Parse(n, t));
    return r;
  }
}
U0.EnableTextureStorage = !0;
U0.MaxActiveMorphTargetsInVertexAttributeMode = 8;
class iV {
  constructor() {
    this._hasHit = !1, this._hitDistance = 0, this._hitNormalWorld = S.Zero(), this._hitPointWorld = S.Zero(), this._rayFromWorld = S.Zero(), this._rayToWorld = S.Zero(), this._triangleIndex = -1;
  }
  /**
   * Gets if there was a hit
   */
  get hasHit() {
    return this._hasHit;
  }
  /**
   * Gets the distance from the hit
   */
  get hitDistance() {
    return this._hitDistance;
  }
  /**
   * Gets the hit normal/direction in the world
   */
  get hitNormalWorld() {
    return this._hitNormalWorld;
  }
  /**
   * Gets the hit point in the world
   */
  get hitPointWorld() {
    return this._hitPointWorld;
  }
  /**
   * Gets the ray "start point" of the ray in the world
   */
  get rayFromWorld() {
    return this._rayFromWorld;
  }
  /**
   * Gets the ray "end point" of the ray in the world
   */
  get rayToWorld() {
    return this._rayToWorld;
  }
  /*
   * The index of the original triangle which was hit. Will be -1 if contact point is not on a mesh shape
   */
  get triangleIndex() {
    return this._triangleIndex;
  }
  /**
   * Sets the hit data (normal & point in world space)
   * @param hitNormalWorld defines the normal in world space
   * @param hitPointWorld defines the point in world space
   */
  setHitData(e, t, r) {
    this._hasHit = !0, this._hitNormalWorld.set(e.x, e.y, e.z), this._hitPointWorld.set(t.x, t.y, t.z), this._triangleIndex = r ?? -1;
  }
  /**
   * Sets the distance from the start point to the hit point
   * @param distance
   */
  setHitDistance(e) {
    this._hitDistance = e;
  }
  /**
   * Calculates the distance manually
   */
  calculateHitDistance() {
    this._hitDistance = S.Distance(this._rayFromWorld, this._hitPointWorld);
  }
  /**
   * Resets all the values to default
   * @param from The from point on world space
   * @param to The to point on world space
   */
  reset(e = S.Zero(), t = S.Zero()) {
    this._rayFromWorld.copyFrom(e), this._rayToWorld.copyFrom(t), this._hasHit = !1, this._hitDistance = 0, this._hitNormalWorld.setAll(0), this._hitPointWorld.setAll(0), this._triangleIndex = -1, this.body = void 0, this.bodyIndex = void 0;
  }
}
let $Q = class zte {
  /**
   *
   * @returns version
   */
  getPluginVersion() {
    return this._physicsPlugin.getPluginVersion();
  }
  /**
   * Factory used to create the default physics plugin.
   * @returns The default physics plugin
   */
  static DefaultPluginFactory() {
    throw qn("CannonJSPlugin");
  }
  /**
   * Creates a new Physics Engine
   * @param gravity defines the gravity vector used by the simulation
   * @param _physicsPlugin defines the plugin to use (CannonJS by default)
   */
  constructor(e, t = zte.DefaultPluginFactory()) {
    if (this._physicsPlugin = t, this._impostors = [], this._joints = [], this._subTimeStep = 0, this._uniqueIdCounter = 0, !this._physicsPlugin.isSupported())
      throw new Error("Physics Engine " + this._physicsPlugin.name + " cannot be found. Please make sure it is included.");
    e = e || new S(0, -9.807, 0), this.setGravity(e), this.setTimeStep();
  }
  /**
   * Sets the gravity vector used by the simulation
   * @param gravity defines the gravity vector to use
   */
  setGravity(e) {
    this.gravity = e, this._physicsPlugin.setGravity(this.gravity);
  }
  /**
   * Set the time step of the physics engine.
   * Default is 1/60.
   * To slow it down, enter 1/600 for example.
   * To speed it up, 1/30
   * @param newTimeStep defines the new timestep to apply to this world.
   */
  setTimeStep(e = 1 / 60) {
    this._physicsPlugin.setTimeStep(e);
  }
  /**
   * Get the time step of the physics engine.
   * @returns the current time step
   */
  getTimeStep() {
    return this._physicsPlugin.getTimeStep();
  }
  /**
   * Set the sub time step of the physics engine.
   * Default is 0 meaning there is no sub steps
   * To increase physics resolution precision, set a small value (like 1 ms)
   * @param subTimeStep defines the new sub timestep used for physics resolution.
   */
  setSubTimeStep(e = 0) {
    this._subTimeStep = e;
  }
  /**
   * Get the sub time step of the physics engine.
   * @returns the current sub time step
   */
  getSubTimeStep() {
    return this._subTimeStep;
  }
  /**
   * Release all resources
   */
  dispose() {
    this._impostors.forEach(function(e) {
      e.dispose();
    }), this._physicsPlugin.dispose();
  }
  /**
   * Gets the name of the current physics plugin
   * @returns the name of the plugin
   */
  getPhysicsPluginName() {
    return this._physicsPlugin.name;
  }
  /**
   * Adding a new impostor for the impostor tracking.
   * This will be done by the impostor itself.
   * @param impostor the impostor to add
   */
  addImpostor(e) {
    this._impostors.push(e), e.uniqueId = this._uniqueIdCounter++, e.parent || this._physicsPlugin.generatePhysicsBody(e);
  }
  /**
   * Remove an impostor from the engine.
   * This impostor and its mesh will not longer be updated by the physics engine.
   * @param impostor the impostor to remove
   */
  removeImpostor(e) {
    const t = this._impostors.indexOf(e);
    t > -1 && this._impostors.splice(t, 1).length && this.getPhysicsPlugin().removePhysicsBody(e);
  }
  /**
   * Add a joint to the physics engine
   * @param mainImpostor defines the main impostor to which the joint is added.
   * @param connectedImpostor defines the impostor that is connected to the main impostor using this joint
   * @param joint defines the joint that will connect both impostors.
   */
  addJoint(e, t, r) {
    const n = {
      mainImpostor: e,
      connectedImpostor: t,
      joint: r
    };
    r.physicsPlugin = this._physicsPlugin, this._joints.push(n), this._physicsPlugin.generateJoint(n);
  }
  /**
   * Removes a joint from the simulation
   * @param mainImpostor defines the impostor used with the joint
   * @param connectedImpostor defines the other impostor connected to the main one by the joint
   * @param joint defines the joint to remove
   */
  removeJoint(e, t, r) {
    const n = this._joints.filter(function(i) {
      return i.connectedImpostor === t && i.joint === r && i.mainImpostor === e;
    });
    n.length && this._physicsPlugin.removeJoint(n[0]);
  }
  /**
   * Called by the scene. No need to call it.
   * @param delta defines the timespan between frames
   */
  _step(e) {
    this._impostors.forEach((t) => {
      t.isBodyInitRequired() && this._physicsPlugin.generatePhysicsBody(t);
    }), e > 0.1 ? e = 0.1 : e <= 0 && (e = 1 / 60), this._physicsPlugin.executeStep(e, this._impostors);
  }
  /**
   * Gets the current plugin used to run the simulation
   * @returns current plugin
   */
  getPhysicsPlugin() {
    return this._physicsPlugin;
  }
  /**
   * Gets the list of physic impostors
   * @returns an array of PhysicsImpostor
   */
  getImpostors() {
    return this._impostors;
  }
  /**
   * Gets the impostor for a physics enabled object
   * @param object defines the object impersonated by the impostor
   * @returns the PhysicsImpostor or null if not found
   */
  getImpostorForPhysicsObject(e) {
    for (let t = 0; t < this._impostors.length; ++t)
      if (this._impostors[t].object === e)
        return this._impostors[t];
    return null;
  }
  /**
   * Gets the impostor for a physics body object
   * @param body defines physics body used by the impostor
   * @returns the PhysicsImpostor or null if not found
   */
  getImpostorWithPhysicsBody(e) {
    for (let t = 0; t < this._impostors.length; ++t)
      if (this._impostors[t].physicsBody === e)
        return this._impostors[t];
    return null;
  }
  /**
   * Does a raycast in the physics world
   * @param from when should the ray start?
   * @param to when should the ray end?
   * @returns PhysicsRaycastResult
   */
  raycast(e, t) {
    return this._physicsPlugin.raycast(e, t);
  }
  /**
   * Does a raycast in the physics world
   * @param from when should the ray start?
   * @param to when should the ray end?
   * @param result resulting PhysicsRaycastResult
   */
  raycastToRef(e, t, r) {
    return this._physicsPlugin.raycastToRef(e, t, r);
  }
};
class sO {
  constructor(e = !0, t = 10, r = CANNON) {
    if (this._useDeltaForWorldStep = e, this.name = "CannonJSPlugin", this._physicsMaterials = new Array(), this._fixedTimeStep = 1 / 60, this._physicsBodiesToRemoveAfterStep = new Array(), this._firstFrame = !0, this._tmpQuaternion = new Ze(), this._minus90X = new Ze(-0.7071067811865475, 0, 0, 0.7071067811865475), this._plus90X = new Ze(0.7071067811865475, 0, 0, 0.7071067811865475), this._tmpPosition = S.Zero(), this._tmpDeltaPosition = S.Zero(), this._tmpUnityRotation = new Ze(), this.BJSCANNON = r, !this.isSupported()) {
      Se.Error("CannonJS is not available. Please make sure you included the js file.");
      return;
    }
    this._extendNamespace(), this.world = new this.BJSCANNON.World(), this.world.broadphase = new this.BJSCANNON.NaiveBroadphase(), this.world.solver.iterations = t, this._cannonRaycastResult = new this.BJSCANNON.RaycastResult(), this._raycastResult = new iV();
  }
  /**
   *
   * @returns plugin version
   */
  getPluginVersion() {
    return 1;
  }
  setGravity(e) {
    const t = e;
    this.world.gravity.set(t.x, t.y, t.z);
  }
  setTimeStep(e) {
    this._fixedTimeStep = e;
  }
  getTimeStep() {
    return this._fixedTimeStep;
  }
  executeStep(e, t) {
    if (this._firstFrame) {
      this._firstFrame = !1;
      for (const r of t)
        r.type == tn.HeightmapImpostor || r.type === tn.PlaneImpostor || r.beforeStep();
    }
    this.world.step(this._useDeltaForWorldStep ? e : this._fixedTimeStep), this._removeMarkedPhysicsBodiesFromWorld();
  }
  _removeMarkedPhysicsBodiesFromWorld() {
    this._physicsBodiesToRemoveAfterStep.length > 0 && (this._physicsBodiesToRemoveAfterStep.forEach((e) => {
      typeof this.world.removeBody == "function" ? this.world.removeBody(e) : this.world.remove(e);
    }), this._physicsBodiesToRemoveAfterStep.length = 0);
  }
  applyImpulse(e, t, r) {
    const n = new this.BJSCANNON.Vec3(r.x, r.y, r.z), i = new this.BJSCANNON.Vec3(t.x, t.y, t.z);
    e.physicsBody.applyImpulse(i, n);
  }
  applyForce(e, t, r) {
    const n = new this.BJSCANNON.Vec3(r.x, r.y, r.z), i = new this.BJSCANNON.Vec3(t.x, t.y, t.z);
    e.physicsBody.applyForce(i, n);
  }
  generatePhysicsBody(e) {
    if (this._removeMarkedPhysicsBodiesFromWorld(), e.parent) {
      e.physicsBody && (this.removePhysicsBody(e), e.forceUpdate());
      return;
    }
    if (e.isBodyInitRequired()) {
      const t = this._createShape(e);
      if (!t) {
        Se.Warn("It was not possible to create a physics body for this object.");
        return;
      }
      const r = e.physicsBody;
      r && this.removePhysicsBody(e);
      const n = this._addMaterial("mat-" + e.uniqueId, e.getParam("friction"), e.getParam("restitution")), i = {
        mass: e.getParam("mass"),
        material: n
      }, s = e.getParam("nativeOptions");
      for (const a in s)
        Object.prototype.hasOwnProperty.call(s, a) && (i[a] = s[a]);
      e.physicsBody = new this.BJSCANNON.Body(i), e.physicsBody.addEventListener("collide", e.onCollide), this.world.addEventListener("preStep", e.beforeStep), this.world.addEventListener("postStep", e.afterStep), e.physicsBody.addShape(t), typeof this.world.addBody == "function" ? this.world.addBody(e.physicsBody) : this.world.add(e.physicsBody), r && ["force", "torque", "velocity", "angularVelocity"].forEach(function(a) {
        const f = r[a];
        e.physicsBody[a].set(f.x, f.y, f.z);
      }), this._processChildMeshes(e);
    }
    this._updatePhysicsBodyTransformation(e);
  }
  _processChildMeshes(e) {
    const t = e.object.getChildMeshes ? e.object.getChildMeshes(!0) : [], r = e.object.rotationQuaternion;
    if (r ? r.conjugateToRef(this._tmpQuaternion) : this._tmpQuaternion.set(0, 0, 0, 1), t.length) {
      const n = (i) => {
        if (!i.rotationQuaternion)
          return;
        const s = i.getPhysicsImpostor();
        if (s && s.parent !== e && i.parent) {
          const f = i.getAbsolutePosition().subtract(i.parent.getAbsolutePosition()), o = i.rotationQuaternion.multiply(this._tmpQuaternion);
          s.physicsBody && (this.removePhysicsBody(s), s.physicsBody = null), s.parent = e, s.resetUpdateFlags(), e.physicsBody.addShape(this._createShape(s), new this.BJSCANNON.Vec3(f.x, f.y, f.z), new this.BJSCANNON.Quaternion(o.x, o.y, o.z, o.w)), e.physicsBody.mass += s.getParam("mass");
        }
        i.getChildMeshes(!0).filter((a) => !!a.physicsImpostor).forEach(n);
      };
      t.filter((i) => !!i.physicsImpostor).forEach(n);
    }
  }
  removePhysicsBody(e) {
    e.physicsBody.removeEventListener("collide", e.onCollide), this.world.removeEventListener("preStep", e.beforeStep), this.world.removeEventListener("postStep", e.afterStep), this._physicsBodiesToRemoveAfterStep.indexOf(e.physicsBody) === -1 && this._physicsBodiesToRemoveAfterStep.push(e.physicsBody);
  }
  generateJoint(e) {
    const t = e.mainImpostor.physicsBody, r = e.connectedImpostor.physicsBody;
    if (!t || !r)
      return;
    let n;
    const i = e.joint.jointData, s = {
      pivotA: i.mainPivot ? new this.BJSCANNON.Vec3().set(i.mainPivot.x, i.mainPivot.y, i.mainPivot.z) : null,
      pivotB: i.connectedPivot ? new this.BJSCANNON.Vec3().set(i.connectedPivot.x, i.connectedPivot.y, i.connectedPivot.z) : null,
      axisA: i.mainAxis ? new this.BJSCANNON.Vec3().set(i.mainAxis.x, i.mainAxis.y, i.mainAxis.z) : null,
      axisB: i.connectedAxis ? new this.BJSCANNON.Vec3().set(i.connectedAxis.x, i.connectedAxis.y, i.connectedAxis.z) : null,
      maxForce: i.nativeParams.maxForce,
      collideConnected: !!i.collision
    };
    switch (e.joint.type) {
      case ta.HingeJoint:
      case ta.Hinge2Joint:
        n = new this.BJSCANNON.HingeConstraint(t, r, s);
        break;
      case ta.DistanceJoint:
        n = new this.BJSCANNON.DistanceConstraint(t, r, i.maxDistance || 2);
        break;
      case ta.SpringJoint: {
        const a = i;
        n = new this.BJSCANNON.Spring(t, r, {
          restLength: a.length,
          stiffness: a.stiffness,
          damping: a.damping,
          localAnchorA: s.pivotA,
          localAnchorB: s.pivotB
        });
        break;
      }
      case ta.LockJoint:
        n = new this.BJSCANNON.LockConstraint(t, r, s);
        break;
      case ta.PointToPointJoint:
      case ta.BallAndSocketJoint:
      default:
        n = new this.BJSCANNON.PointToPointConstraint(t, s.pivotA, r, s.pivotB, s.maxForce);
        break;
    }
    n.collideConnected = !!i.collision, e.joint.physicsJoint = n, e.joint.type !== ta.SpringJoint ? this.world.addConstraint(n) : (e.joint.jointData.forceApplicationCallback = e.joint.jointData.forceApplicationCallback || function() {
      n.applyForce();
    }, e.mainImpostor.registerAfterPhysicsStep(e.joint.jointData.forceApplicationCallback));
  }
  removeJoint(e) {
    e.joint.type !== ta.SpringJoint ? this.world.removeConstraint(e.joint.physicsJoint) : e.mainImpostor.unregisterAfterPhysicsStep(e.joint.jointData.forceApplicationCallback);
  }
  _addMaterial(e, t, r) {
    let n, i;
    for (n = 0; n < this._physicsMaterials.length; n++)
      if (i = this._physicsMaterials[n], i.friction === t && i.restitution === r)
        return i;
    const s = new this.BJSCANNON.Material(e);
    return s.friction = t, s.restitution = r, this._physicsMaterials.push(s), s;
  }
  _checkWithEpsilon(e) {
    return e < Dn ? Dn : e;
  }
  _createShape(e) {
    const t = e.object;
    let r;
    const n = e.getObjectExtents();
    switch (e.type) {
      case tn.SphereImpostor: {
        const i = n.x, s = n.y, a = n.z;
        r = new this.BJSCANNON.Sphere(Math.max(this._checkWithEpsilon(i), this._checkWithEpsilon(s), this._checkWithEpsilon(a)) / 2);
        break;
      }
      case tn.CylinderImpostor: {
        let i = e.getParam("nativeOptions");
        i || (i = {});
        const s = i.radiusTop !== void 0 ? i.radiusTop : this._checkWithEpsilon(n.x) / 2, a = i.radiusBottom !== void 0 ? i.radiusBottom : this._checkWithEpsilon(n.x) / 2, f = i.height !== void 0 ? i.height : this._checkWithEpsilon(n.y), o = i.numSegments !== void 0 ? i.numSegments : 16;
        r = new this.BJSCANNON.Cylinder(s, a, f, o);
        const d = new this.BJSCANNON.Quaternion();
        d.setFromAxisAngle(new this.BJSCANNON.Vec3(1, 0, 0), -Math.PI / 2);
        const v = new this.BJSCANNON.Vec3(0, 0, 0);
        r.transformAllPoints(v, d);
        break;
      }
      case tn.BoxImpostor: {
        const i = n.scale(0.5);
        r = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(this._checkWithEpsilon(i.x), this._checkWithEpsilon(i.y), this._checkWithEpsilon(i.z)));
        break;
      }
      case tn.PlaneImpostor:
        Se.Warn("Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead"), r = new this.BJSCANNON.Plane();
        break;
      case tn.MeshImpostor: {
        const i = t.getVerticesData ? t.getVerticesData(J.PositionKind) : [], s = t.getIndices ? t.getIndices() : [];
        if (!i) {
          Se.Warn("Tried to create a MeshImpostor for an object without vertices. This will fail.");
          return;
        }
        const a = t.position.clone(), f = t.rotation && t.rotation.clone(), o = t.rotationQuaternion && t.rotationQuaternion.clone();
        t.position.copyFromFloats(0, 0, 0), t.rotation && t.rotation.copyFromFloats(0, 0, 0), t.rotationQuaternion && t.rotationQuaternion.copyFrom(e.getParentsRotation()), t.rotationQuaternion && t.parent && t.rotationQuaternion.conjugateInPlace();
        const d = t.computeWorldMatrix(!0), v = [];
        let u;
        for (u = 0; u < i.length; u += 3)
          S.TransformCoordinates(S.FromArray(i, u), d).toArray(v, u);
        Se.Warn("MeshImpostor only collides against spheres."), r = new this.BJSCANNON.Trimesh(v, s), t.position.copyFrom(a), f && t.rotation && t.rotation.copyFrom(f), o && t.rotationQuaternion && t.rotationQuaternion.copyFrom(o);
        break;
      }
      case tn.HeightmapImpostor: {
        const i = t.position.clone(), s = t.rotation && t.rotation.clone(), a = t.rotationQuaternion && t.rotationQuaternion.clone();
        t.position.copyFromFloats(0, 0, 0), t.rotation && t.rotation.copyFromFloats(0, 0, 0), t.rotationQuaternion && t.rotationQuaternion.copyFrom(e.getParentsRotation()), t.rotationQuaternion && t.parent && t.rotationQuaternion.conjugateInPlace(), t.rotationQuaternion && t.rotationQuaternion.multiplyInPlace(this._minus90X), r = this._createHeightmap(t), t.position.copyFrom(i), s && t.rotation && t.rotation.copyFrom(s), a && t.rotationQuaternion && t.rotationQuaternion.copyFrom(a), t.computeWorldMatrix(!0);
        break;
      }
      case tn.ParticleImpostor:
        r = new this.BJSCANNON.Particle();
        break;
      case tn.NoImpostor:
        r = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(0, 0, 0));
        break;
    }
    return r;
  }
  _createHeightmap(e, t) {
    let r = e.getVerticesData(J.PositionKind);
    const n = e.computeWorldMatrix(!0), i = [];
    let s;
    for (s = 0; s < r.length; s += 3)
      S.TransformCoordinates(S.FromArray(r, s), n).toArray(i, s);
    r = i;
    const a = new Array(), f = t || ~~(Math.sqrt(r.length / 3) - 1), o = e.getBoundingInfo(), d = Math.min(o.boundingBox.extendSizeWorld.x, o.boundingBox.extendSizeWorld.y), v = o.boundingBox.extendSizeWorld.z, u = d * 2 / f;
    for (let P = 0; P < r.length; P = P + 3) {
      const p = Math.round(r[P + 0] / u + f / 2), c = Math.round((r[P + 1] / u - f / 2) * -1), H = -r[P + 2] + v;
      a[p] || (a[p] = []), a[p][c] || (a[p][c] = H), a[p][c] = Math.max(H, a[p][c]);
    }
    for (let P = 0; P <= f; ++P) {
      if (!a[P]) {
        let p = 1;
        for (; !a[(P + p) % f]; )
          p++;
        a[P] = a[(P + p) % f].slice();
      }
      for (let p = 0; p <= f; ++p)
        if (!a[P][p]) {
          let c = 1, H;
          for (; H === void 0; )
            H = a[P][(p + c++) % f];
          a[P][p] = H;
        }
    }
    const l = new this.BJSCANNON.Heightfield(a, {
      elementSize: u
    });
    return l.minY = v, l;
  }
  _updatePhysicsBodyTransformation(e) {
    const t = e.object;
    if (t.computeWorldMatrix && t.computeWorldMatrix(!0), !t.getBoundingInfo())
      return;
    const r = e.getObjectCenter();
    this._tmpDeltaPosition.copyFrom(t.getAbsolutePivotPoint().subtract(r)), this._tmpDeltaPosition.divideInPlace(e.object.scaling), this._tmpPosition.copyFrom(r);
    let n = t.rotationQuaternion;
    if (n) {
      if ((e.type === tn.PlaneImpostor || e.type === tn.HeightmapImpostor) && (n = n.multiply(this._minus90X), e.setDeltaRotation(this._plus90X)), e.type === tn.HeightmapImpostor) {
        const i = t;
        let s = i.getBoundingInfo();
        const a = i.rotationQuaternion;
        i.rotationQuaternion = this._tmpUnityRotation, i.computeWorldMatrix(!0);
        const f = r.clone();
        let o = i.getPivotMatrix();
        o ? o = o.clone() : o = he.Identity();
        const d = he.Translation(s.boundingBox.extendSizeWorld.x, 0, -s.boundingBox.extendSizeWorld.z);
        i.setPreTransformMatrix(d), i.computeWorldMatrix(!0), s = i.getBoundingInfo();
        const v = s.boundingBox.centerWorld.subtract(r).subtract(i.position).negate();
        this._tmpPosition.copyFromFloats(v.x, v.y - s.boundingBox.extendSizeWorld.y, v.z), this._tmpDeltaPosition.copyFrom(s.boundingBox.centerWorld.subtract(f)), this._tmpDeltaPosition.y += s.boundingBox.extendSizeWorld.y, i.rotationQuaternion = a, i.setPreTransformMatrix(o), i.computeWorldMatrix(!0);
      } else
        e.type === tn.MeshImpostor && this._tmpDeltaPosition.copyFromFloats(0, 0, 0);
      e.setDeltaPosition(this._tmpDeltaPosition), e.physicsBody.position.set(this._tmpPosition.x, this._tmpPosition.y, this._tmpPosition.z), e.physicsBody.quaternion.set(n.x, n.y, n.z, n.w);
    }
  }
  setTransformationFromPhysicsBody(e) {
    if (e.object.position.set(e.physicsBody.position.x, e.physicsBody.position.y, e.physicsBody.position.z), e.object.rotationQuaternion) {
      const t = e.physicsBody.quaternion;
      e.object.rotationQuaternion.set(t.x, t.y, t.z, t.w);
    }
  }
  setPhysicsBodyTransformation(e, t, r) {
    e.physicsBody.position.set(t.x, t.y, t.z), e.physicsBody.quaternion.set(r.x, r.y, r.z, r.w);
  }
  isSupported() {
    return this.BJSCANNON !== void 0;
  }
  setLinearVelocity(e, t) {
    e.physicsBody.velocity.set(t.x, t.y, t.z);
  }
  setAngularVelocity(e, t) {
    e.physicsBody.angularVelocity.set(t.x, t.y, t.z);
  }
  getLinearVelocity(e) {
    const t = e.physicsBody.velocity;
    return t ? new S(t.x, t.y, t.z) : null;
  }
  getAngularVelocity(e) {
    const t = e.physicsBody.angularVelocity;
    return t ? new S(t.x, t.y, t.z) : null;
  }
  setBodyMass(e, t) {
    e.physicsBody.mass = t, e.physicsBody.updateMassProperties();
  }
  getBodyMass(e) {
    return e.physicsBody.mass;
  }
  getBodyFriction(e) {
    return e.physicsBody.material.friction;
  }
  setBodyFriction(e, t) {
    e.physicsBody.material.friction = t;
  }
  getBodyRestitution(e) {
    return e.physicsBody.material.restitution;
  }
  setBodyRestitution(e, t) {
    e.physicsBody.material.restitution = t;
  }
  sleepBody(e) {
    e.physicsBody.sleep();
  }
  wakeUpBody(e) {
    e.physicsBody.wakeUp();
  }
  updateDistanceJoint(e, t) {
    e.physicsJoint.distance = t;
  }
  setMotor(e, t, r, n) {
    n || (e.physicsJoint.enableMotor(), e.physicsJoint.setMotorSpeed(t), r && this.setLimit(e, r));
  }
  setLimit(e, t, r) {
    e.physicsJoint.motorEquation.maxForce = r, e.physicsJoint.motorEquation.minForce = t === void 0 ? -t : t;
  }
  syncMeshWithImpostor(e, t) {
    const r = t.physicsBody;
    e.position.x = r.position.x, e.position.y = r.position.y, e.position.z = r.position.z, e.rotationQuaternion && (e.rotationQuaternion.x = r.quaternion.x, e.rotationQuaternion.y = r.quaternion.y, e.rotationQuaternion.z = r.quaternion.z, e.rotationQuaternion.w = r.quaternion.w);
  }
  getRadius(e) {
    return e.physicsBody.shapes[0].boundingSphereRadius;
  }
  getBoxSizeToRef(e, t) {
    const r = e.physicsBody.shapes[0];
    t.x = r.halfExtents.x * 2, t.y = r.halfExtents.y * 2, t.z = r.halfExtents.z * 2;
  }
  dispose() {
  }
  _extendNamespace() {
    const e = new this.BJSCANNON.Vec3(), t = this.BJSCANNON;
    this.BJSCANNON.World.prototype.step = function(r, n, i) {
      if (i = i || 10, n = n || 0, n === 0)
        this.internalStep(r), this.time += r;
      else {
        let s = Math.floor((this.time + n) / r) - Math.floor(this.time / r);
        s = Math.min(s, i) || 1;
        const a = performance.now();
        for (let u = 0; u !== s && (this.internalStep(r), !(performance.now() - a > r * 1e3)); u++)
          ;
        this.time += n;
        const o = this.time % r / r, d = e, v = this.bodies;
        for (let u = 0; u !== v.length; u++) {
          const l = v[u];
          l.type !== t.Body.STATIC && l.sleepState !== t.Body.SLEEPING ? (l.position.vsub(l.previousPosition, d), d.scale(o, d), l.position.vadd(d, l.interpolatedPosition)) : (l.interpolatedPosition.set(l.position.x, l.position.y, l.position.z), l.interpolatedQuaternion.set(l.quaternion.x, l.quaternion.y, l.quaternion.z, l.quaternion.w));
        }
      }
    };
  }
  /**
   * Does a raycast in the physics world
   * @param from when should the ray start?
   * @param to when should the ray end?
   * @returns PhysicsRaycastResult
   */
  raycast(e, t) {
    return this._raycastResult.reset(e, t), this.raycastToRef(e, t, this._raycastResult), this._raycastResult;
  }
  /**
   * Does a raycast in the physics world
   * @param from when should the ray start?
   * @param to when should the ray end?
   * @param result resulting PhysicsRaycastResult
   */
  raycastToRef(e, t, r) {
    this._cannonRaycastResult.reset(), this.world.raycastClosest(e, t, {}, this._cannonRaycastResult), r.reset(e, t), this._cannonRaycastResult.hasHit && (r.setHitData({
      x: this._cannonRaycastResult.hitNormalWorld.x,
      y: this._cannonRaycastResult.hitNormalWorld.y,
      z: this._cannonRaycastResult.hitNormalWorld.z
    }, {
      x: this._cannonRaycastResult.hitPointWorld.x,
      y: this._cannonRaycastResult.hitPointWorld.y,
      z: this._cannonRaycastResult.hitPointWorld.z
    }), r.setHitDistance(this._cannonRaycastResult.distance));
  }
}
$Q.DefaultPluginFactory = () => new sO();
class gF {
  constructor(e = !0, t, r = OIMO) {
    this._useDeltaForWorldStep = e, this.name = "OimoJSPlugin", this._fixedTimeStep = 1 / 60, this._tmpImpostorsArray = [], this._tmpPositionVector = S.Zero(), this.BJSOIMO = r, this.world = new this.BJSOIMO.World({
      iterations: t
    }), this.world.clear(), this._raycastResult = new iV();
  }
  /**
   *
   * @returns plugin version
   */
  getPluginVersion() {
    return 1;
  }
  setGravity(e) {
    this.world.gravity.set(e.x, e.y, e.z);
  }
  setTimeStep(e) {
    this.world.timeStep = e;
  }
  getTimeStep() {
    return this.world.timeStep;
  }
  executeStep(e, t) {
    t.forEach(function(n) {
      n.beforeStep();
    }), this.world.timeStep = this._useDeltaForWorldStep ? e : this._fixedTimeStep, this.world.step(), t.forEach((n) => {
      n.afterStep(), this._tmpImpostorsArray[n.uniqueId] = n;
    });
    let r = this.world.contacts;
    for (; r !== null; ) {
      if (r.touching && !r.body1.sleeping && !r.body2.sleeping) {
        r = r.next;
        continue;
      }
      const n = this._tmpImpostorsArray[+r.body1.name], i = this._tmpImpostorsArray[+r.body2.name];
      if (!n || !i) {
        r = r.next;
        continue;
      }
      n.onCollide({ body: i.physicsBody, point: null, distance: 0, impulse: 0, normal: null }), i.onCollide({ body: n.physicsBody, point: null, distance: 0, impulse: 0, normal: null }), r = r.next;
    }
  }
  applyImpulse(e, t, r) {
    const n = e.physicsBody.mass;
    e.physicsBody.applyImpulse(r.scale(this.world.invScale), t.scale(this.world.invScale * n));
  }
  applyForce(e, t, r) {
    Se.Warn("Oimo doesn't support applying force. Using impulse instead."), this.applyImpulse(e, t, r);
  }
  generatePhysicsBody(e) {
    if (e.parent) {
      e.physicsBody && (this.removePhysicsBody(e), e.forceUpdate());
      return;
    }
    if (e.isBodyInitRequired()) {
      const t = {
        name: e.uniqueId,
        //Oimo must have mass, also for static objects.
        config: [e.getParam("mass") || 1e-3, e.getParam("friction"), e.getParam("restitution")],
        size: [],
        type: [],
        pos: [],
        posShape: [],
        rot: [],
        rotShape: [],
        move: e.getParam("mass") !== 0,
        density: e.getParam("mass"),
        friction: e.getParam("friction"),
        restitution: e.getParam("restitution"),
        //Supporting older versions of Oimo
        world: this.world
      }, r = [e];
      ((a) => {
        a.getChildMeshes && a.getChildMeshes().forEach(function(f) {
          f.physicsImpostor && r.push(f.physicsImpostor);
        });
      })(e.object);
      const i = (a) => Math.max(a, Dn), s = new Ze();
      r.forEach((a) => {
        if (!a.object.rotationQuaternion)
          return;
        const f = a.object.rotationQuaternion;
        s.copyFrom(f), a.object.rotationQuaternion.set(0, 0, 0, 1), a.object.computeWorldMatrix(!0);
        const o = s.toEulerAngles(), d = a.getObjectExtents(), v = 57.29577951308232;
        if (a === e) {
          const u = e.getObjectCenter();
          e.object.getAbsolutePivotPoint().subtractToRef(u, this._tmpPositionVector), this._tmpPositionVector.divideInPlace(e.object.scaling), t.pos.push(u.x), t.pos.push(u.y), t.pos.push(u.z), t.posShape.push(0, 0, 0), t.rotShape.push(0, 0, 0);
        } else {
          const u = a.object.position.clone();
          t.posShape.push(u.x), t.posShape.push(u.y), t.posShape.push(u.z), t.rotShape.push(o.x * v, o.y * v, o.z * v);
        }
        switch (a.object.rotationQuaternion.copyFrom(s), a.type) {
          case tn.ParticleImpostor:
            Se.Warn("No Particle support in OIMO.js. using SphereImpostor instead");
          case tn.SphereImpostor: {
            const u = d.x, l = d.y, P = d.z, p = Math.max(i(u), i(l), i(P)) / 2;
            t.type.push("sphere"), t.size.push(p), t.size.push(p), t.size.push(p);
            break;
          }
          case tn.CylinderImpostor: {
            const u = i(d.x) / 2, l = i(d.y);
            t.type.push("cylinder"), t.size.push(u), t.size.push(l), t.size.push(l);
            break;
          }
          case tn.PlaneImpostor:
          case tn.BoxImpostor:
          default: {
            const u = i(d.x), l = i(d.y), P = i(d.z);
            t.type.push("box"), t.size.push(u), t.size.push(l), t.size.push(P);
            break;
          }
        }
        a.object.rotationQuaternion = f;
      }), e.physicsBody = this.world.add(t), e.physicsBody.resetQuaternion(s), e.physicsBody.updatePosition(0);
    } else
      this._tmpPositionVector.copyFromFloats(0, 0, 0);
    e.setDeltaPosition(this._tmpPositionVector);
  }
  removePhysicsBody(e) {
    this.world.removeRigidBody(e.physicsBody);
  }
  generateJoint(e) {
    const t = e.mainImpostor.physicsBody, r = e.connectedImpostor.physicsBody;
    if (!t || !r)
      return;
    const n = e.joint.jointData, i = n.nativeParams || {};
    let s;
    const a = {
      body1: t,
      body2: r,
      axe1: i.axe1 || (n.mainAxis ? n.mainAxis.asArray() : null),
      axe2: i.axe2 || (n.connectedAxis ? n.connectedAxis.asArray() : null),
      pos1: i.pos1 || (n.mainPivot ? n.mainPivot.asArray() : null),
      pos2: i.pos2 || (n.connectedPivot ? n.connectedPivot.asArray() : null),
      min: i.min,
      max: i.max,
      collision: i.collision || n.collision,
      spring: i.spring,
      //supporting older version of Oimo
      world: this.world
    };
    switch (e.joint.type) {
      case ta.BallAndSocketJoint:
        s = "jointBall";
        break;
      case ta.SpringJoint: {
        Se.Warn("OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead");
        const f = n;
        a.min = f.length || a.min, a.max = Math.max(a.min, a.max);
      }
      case ta.DistanceJoint:
        s = "jointDistance", a.max = n.maxDistance;
        break;
      case ta.PrismaticJoint:
        s = "jointPrisme";
        break;
      case ta.SliderJoint:
        s = "jointSlide";
        break;
      case ta.WheelJoint:
        s = "jointWheel";
        break;
      case ta.HingeJoint:
      default:
        s = "jointHinge";
        break;
    }
    a.type = s, e.joint.physicsJoint = this.world.add(a);
  }
  removeJoint(e) {
    try {
      this.world.removeJoint(e.joint.physicsJoint);
    } catch (t) {
      Se.Warn(t);
    }
  }
  isSupported() {
    return this.BJSOIMO !== void 0;
  }
  setTransformationFromPhysicsBody(e) {
    if (!e.physicsBody.sleeping) {
      if (e.physicsBody.shapes.next) {
        let t = e.physicsBody.shapes;
        for (; t.next; )
          t = t.next;
        e.object.position.set(t.position.x, t.position.y, t.position.z);
      } else {
        const t = e.physicsBody.getPosition();
        e.object.position.set(t.x, t.y, t.z);
      }
      if (e.object.rotationQuaternion) {
        const t = e.physicsBody.getQuaternion();
        e.object.rotationQuaternion.set(t.x, t.y, t.z, t.w);
      }
    }
  }
  setPhysicsBodyTransformation(e, t, r) {
    const n = e.physicsBody;
    e.physicsBody.shapes.next || (n.position.set(t.x, t.y, t.z), n.orientation.set(r.x, r.y, r.z, r.w), n.syncShapes(), n.awake());
  }
  /*private _getLastShape(body: any): any {
      var lastShape = body.shapes;
      while (lastShape.next) {
          lastShape = lastShape.next;
      }
      return lastShape;
  }*/
  setLinearVelocity(e, t) {
    e.physicsBody.linearVelocity.set(t.x, t.y, t.z);
  }
  setAngularVelocity(e, t) {
    e.physicsBody.angularVelocity.set(t.x, t.y, t.z);
  }
  getLinearVelocity(e) {
    const t = e.physicsBody.linearVelocity;
    return t ? new S(t.x, t.y, t.z) : null;
  }
  getAngularVelocity(e) {
    const t = e.physicsBody.angularVelocity;
    return t ? new S(t.x, t.y, t.z) : null;
  }
  setBodyMass(e, t) {
    const r = t === 0;
    e.physicsBody.shapes.density = r ? 1 : t, e.physicsBody.setupMass(r ? 2 : 1);
  }
  getBodyMass(e) {
    return e.physicsBody.shapes.density;
  }
  getBodyFriction(e) {
    return e.physicsBody.shapes.friction;
  }
  setBodyFriction(e, t) {
    e.physicsBody.shapes.friction = t;
  }
  getBodyRestitution(e) {
    return e.physicsBody.shapes.restitution;
  }
  setBodyRestitution(e, t) {
    e.physicsBody.shapes.restitution = t;
  }
  sleepBody(e) {
    e.physicsBody.sleep();
  }
  wakeUpBody(e) {
    e.physicsBody.awake();
  }
  updateDistanceJoint(e, t, r) {
    e.physicsJoint.limitMotor.upperLimit = t, r !== void 0 && (e.physicsJoint.limitMotor.lowerLimit = r);
  }
  setMotor(e, t, r, n) {
    r !== void 0 ? Se.Warn("OimoJS plugin currently has unexpected behavior when using setMotor with force parameter") : r = 1e6, t *= -1;
    const i = n ? e.physicsJoint.rotationalLimitMotor2 : e.physicsJoint.rotationalLimitMotor1 || e.physicsJoint.rotationalLimitMotor || e.physicsJoint.limitMotor;
    i && i.setMotor(t, r);
  }
  setLimit(e, t, r, n) {
    const i = n ? e.physicsJoint.rotationalLimitMotor2 : e.physicsJoint.rotationalLimitMotor1 || e.physicsJoint.rotationalLimitMotor || e.physicsJoint.limitMotor;
    i && i.setLimit(t, r === void 0 ? -t : r);
  }
  syncMeshWithImpostor(e, t) {
    const r = t.physicsBody;
    e.position.x = r.position.x, e.position.y = r.position.y, e.position.z = r.position.z, e.rotationQuaternion && (e.rotationQuaternion.x = r.orientation.x, e.rotationQuaternion.y = r.orientation.y, e.rotationQuaternion.z = r.orientation.z, e.rotationQuaternion.w = r.orientation.w);
  }
  getRadius(e) {
    return e.physicsBody.shapes.radius;
  }
  getBoxSizeToRef(e, t) {
    const r = e.physicsBody.shapes;
    t.x = r.halfWidth * 2, t.y = r.halfHeight * 2, t.z = r.halfDepth * 2;
  }
  dispose() {
    this.world.clear();
  }
  /**
   * Does a raycast in the physics world
   * @param from when should the ray start?
   * @param to when should the ray end?
   * @returns PhysicsRaycastResult
   */
  raycast(e, t) {
    return Se.Warn("raycast is not currently supported by the Oimo physics plugin"), this._raycastResult.reset(e, t), this._raycastResult;
  }
  /**
   * Does a raycast in the physics world
   * @param from when should the ray start?
   * @param to when should the ray end?
   * @param result resulting PhysicsRaycastResult
   */
  raycastToRef(e, t, r) {
    Se.Warn("raycast is not currently supported by the Oimo physics plugin"), r.reset(e, t);
  }
}
class eg {
  /**
   * Initializes the ammoJS plugin
   * @param _useDeltaForWorldStep if the time between frames should be used when calculating physics steps (Default: true)
   * @param ammoInjection can be used to inject your own ammo reference
   * @param overlappingPairCache can be used to specify your own overlapping pair cache
   */
  constructor(e = !0, t = Ammo, r = null) {
    if (this._useDeltaForWorldStep = e, this.bjsAMMO = {}, this.name = "AmmoJSPlugin", this._timeStep = 1 / 60, this._fixedTimeStep = 1 / 60, this._maxSteps = 5, this._tmpQuaternion = new Ze(), this._tmpContactCallbackResult = !1, this._tmpContactPoint = new S(), this._tmpContactNormal = new S(), this._tmpVec3 = new S(), this._tmpMatrix = new he(), typeof t == "function") {
      Se.Error("AmmoJS is not ready. Please make sure you await Ammo() before using the plugin.");
      return;
    } else
      this.bjsAMMO = t;
    if (!this.isSupported()) {
      Se.Error("AmmoJS is not available. Please make sure you included the js file.");
      return;
    }
    this._collisionConfiguration = new this.bjsAMMO.btSoftBodyRigidBodyCollisionConfiguration(), this._dispatcher = new this.bjsAMMO.btCollisionDispatcher(this._collisionConfiguration), this._overlappingPairCache = r || new this.bjsAMMO.btDbvtBroadphase(), this._solver = new this.bjsAMMO.btSequentialImpulseConstraintSolver(), this._softBodySolver = new this.bjsAMMO.btDefaultSoftBodySolver(), this.world = new this.bjsAMMO.btSoftRigidDynamicsWorld(this._dispatcher, this._overlappingPairCache, this._solver, this._collisionConfiguration, this._softBodySolver), this._tmpAmmoConcreteContactResultCallback = new this.bjsAMMO.ConcreteContactResultCallback(), this._tmpAmmoConcreteContactResultCallback.addSingleResult = (n) => {
      n = this.bjsAMMO.wrapPointer(n, this.bjsAMMO.btManifoldPoint);
      const i = n.getPositionWorldOnA(), s = n.m_normalWorldOnB;
      this._tmpContactPoint.x = i.x(), this._tmpContactPoint.y = i.y(), this._tmpContactPoint.z = i.z(), this._tmpContactNormal.x = s.x(), this._tmpContactNormal.y = s.y(), this._tmpContactNormal.z = s.z(), this._tmpContactImpulse = n.getAppliedImpulse(), this._tmpContactDistance = n.getDistance(), this._tmpContactCallbackResult = !0;
    }, this._raycastResult = new iV(), this._tmpAmmoTransform = new this.bjsAMMO.btTransform(), this._tmpAmmoTransform.setIdentity(), this._tmpAmmoQuaternion = new this.bjsAMMO.btQuaternion(0, 0, 0, 1), this._tmpAmmoVectorA = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorB = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorC = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorD = new this.bjsAMMO.btVector3(0, 0, 0);
  }
  /**
   *
   * @returns plugin version
   */
  getPluginVersion() {
    return 1;
  }
  /**
   * Sets the gravity of the physics world (m/(s^2))
   * @param gravity Gravity to set
   */
  setGravity(e) {
    this._tmpAmmoVectorA.setValue(e.x, e.y, e.z), this.world.setGravity(this._tmpAmmoVectorA), this.world.getWorldInfo().set_m_gravity(this._tmpAmmoVectorA);
  }
  /**
   * Amount of time to step forward on each frame (only used if useDeltaForWorldStep is false in the constructor)
   * @param timeStep timestep to use in seconds
   */
  setTimeStep(e) {
    this._timeStep = e;
  }
  /**
   * Increment to step forward in the physics engine (If timeStep is set to 1/60 and fixedTimeStep is set to 1/120 the physics engine should run 2 steps per frame) (Default: 1/60)
   * @param fixedTimeStep fixedTimeStep to use in seconds
   */
  setFixedTimeStep(e) {
    this._fixedTimeStep = e;
  }
  /**
   * Sets the maximum number of steps by the physics engine per frame (Default: 5)
   * @param maxSteps the maximum number of steps by the physics engine per frame
   */
  setMaxSteps(e) {
    this._maxSteps = e;
  }
  /**
   * Gets the current timestep (only used if useDeltaForWorldStep is false in the constructor)
   * @returns the current timestep in seconds
   */
  getTimeStep() {
    return this._timeStep;
  }
  // Ammo's contactTest and contactPairTest take a callback that runs synchronously, wrap them so that they are easier to consume
  _isImpostorInContact(e) {
    return this._tmpContactCallbackResult = !1, this.world.contactTest(e.physicsBody, this._tmpAmmoConcreteContactResultCallback), this._tmpContactCallbackResult;
  }
  // Ammo's collision events have some weird quirks
  // contactPairTest fires too many events as it fires events even when objects are close together but contactTest does not
  // so only fire event if both contactTest and contactPairTest have a hit
  _isImpostorPairInContact(e, t) {
    return this._tmpContactCallbackResult = !1, this.world.contactPairTest(e.physicsBody, t.physicsBody, this._tmpAmmoConcreteContactResultCallback), this._tmpContactCallbackResult;
  }
  // Ammo's behavior when maxSteps > 0 does not behave as described in docs
  // @see http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Stepping_The_World
  //
  // When maxSteps is 0 do the entire simulation in one step
  // When maxSteps is > 0, run up to maxStep times, if on the last step the (remaining step - fixedTimeStep) is < fixedTimeStep, the remainder will be used for the step. (eg. if remainder is 1.001 and fixedTimeStep is 1 the last step will be 1.001, if instead it did 2 steps (1, 0.001) issues occuered when having a tiny step in ammo)
  // Note: To get deterministic physics, timeStep would always need to be divisible by fixedTimeStep
  _stepSimulation(e = 1 / 60, t = 10, r = 1 / 60) {
    if (t == 0)
      this.world.stepSimulation(e, 0);
    else
      for (; t > 0 && e > 0; )
        e - r < r ? (this.world.stepSimulation(e, 0), e = 0) : (e -= r, this.world.stepSimulation(r, 0)), t--;
  }
  /**
   * Moves the physics simulation forward delta seconds and updates the given physics imposters
   * Prior to the step the imposters physics location is set to the position of the babylon meshes
   * After the step the babylon meshes are set to the position of the physics imposters
   * @param delta amount of time to step forward
   * @param impostors array of imposters to update before/after the step
   */
  executeStep(e, t) {
    for (const r of t)
      r.soft || r.beforeStep();
    this._stepSimulation(this._useDeltaForWorldStep ? e : this._timeStep, this._maxSteps, this._fixedTimeStep);
    for (const r of t)
      if (r.soft ? this._afterSoftStep(r) : r.afterStep(), r._onPhysicsCollideCallbacks.length > 0 && this._isImpostorInContact(r))
        for (const n of r._onPhysicsCollideCallbacks)
          for (const i of n.otherImpostors)
            (r.physicsBody.isActive() || i.physicsBody.isActive()) && this._isImpostorPairInContact(r, i) && (r.onCollide({
              body: i.physicsBody,
              point: this._tmpContactPoint,
              distance: this._tmpContactDistance,
              impulse: this._tmpContactImpulse,
              normal: this._tmpContactNormal
            }), i.onCollide({
              body: r.physicsBody,
              point: this._tmpContactPoint,
              distance: this._tmpContactDistance,
              impulse: this._tmpContactImpulse,
              normal: this._tmpContactNormal
            }));
  }
  /**
   * Update babylon mesh to match physics world object
   * @param impostor imposter to match
   */
  _afterSoftStep(e) {
    e.type === tn.RopeImpostor ? this._ropeStep(e) : this._softbodyOrClothStep(e);
  }
  /**
   * Update babylon mesh vertices vertices to match physics world softbody or cloth
   * @param impostor imposter to match
   */
  _ropeStep(e) {
    const t = e.physicsBody.get_m_nodes(), r = t.size();
    let n, i, s, a, f;
    const o = new Array();
    for (let u = 0; u < r; u++)
      n = t.at(u), i = n.get_m_x(), s = i.x(), a = i.y(), f = i.z(), o.push(new S(s, a, f));
    const d = e.object, v = e.getParam("shape");
    e._isFromLine ? e.object = ka("lines", { points: o, instance: d }) : e.object = GR("ext", { shape: v, path: o, instance: d });
  }
  /**
   * Update babylon mesh vertices vertices to match physics world softbody or cloth
   * @param impostor imposter to match
   */
  _softbodyOrClothStep(e) {
    const t = e.type === tn.ClothImpostor ? 1 : -1, r = e.object;
    let n = r.getVerticesData(J.PositionKind);
    n || (n = []);
    let i = r.getVerticesData(J.NormalKind);
    i || (i = []);
    const s = n.length / 3, a = e.physicsBody.get_m_nodes();
    let f, o, d, v, u, l, P, p;
    for (let H = 0; H < s; H++) {
      f = a.at(H), o = f.get_m_x(), d = o.x(), v = o.y(), u = o.z() * t;
      const T = f.get_m_n();
      l = T.x(), P = T.y(), p = T.z() * t, n[3 * H] = d, n[3 * H + 1] = v, n[3 * H + 2] = u, i[3 * H] = l, i[3 * H + 1] = P, i[3 * H + 2] = p;
    }
    const c = new Ut();
    c.positions = n, c.normals = i, c.uvs = r.getVerticesData(J.UVKind), c.colors = r.getVerticesData(J.ColorKind), r && r.getIndices && (c.indices = r.getIndices()), c.applyToMesh(r);
  }
  /**
   * Applies an impulse on the imposter
   * @param impostor imposter to apply impulse to
   * @param force amount of force to be applied to the imposter
   * @param contactPoint the location to apply the impulse on the imposter
   */
  applyImpulse(e, t, r) {
    if (e.soft)
      Se.Warn("Cannot be applied to a soft body");
    else {
      e.physicsBody.activate();
      const n = this._tmpAmmoVectorA, i = this._tmpAmmoVectorB;
      e.object && e.object.getWorldMatrix && r.subtractInPlace(e.object.getWorldMatrix().getTranslation()), n.setValue(r.x, r.y, r.z), i.setValue(t.x, t.y, t.z), e.physicsBody.applyImpulse(i, n);
    }
  }
  /**
   * Applies a force on the imposter
   * @param impostor imposter to apply force
   * @param force amount of force to be applied to the imposter
   * @param contactPoint the location to apply the force on the imposter
   */
  applyForce(e, t, r) {
    if (e.soft)
      Se.Warn("Cannot be applied to a soft body");
    else {
      e.physicsBody.activate();
      const n = this._tmpAmmoVectorA, i = this._tmpAmmoVectorB;
      if (e.object && e.object.getWorldMatrix) {
        const s = e.object.getWorldMatrix().getTranslation();
        n.setValue(r.x - s.x, r.y - s.y, r.z - s.z);
      } else
        n.setValue(r.x, r.y, r.z);
      i.setValue(t.x, t.y, t.z), e.physicsBody.applyForce(i, n);
    }
  }
  /**
   * Creates a physics body using the plugin
   * @param impostor the imposter to create the physics body on
   */
  generatePhysicsBody(e) {
    if (e._pluginData.toDispose = [], e.parent) {
      e.physicsBody && (this.removePhysicsBody(e), e.forceUpdate());
      return;
    }
    if (e.isBodyInitRequired()) {
      const t = this._createShape(e), r = e.getParam("mass");
      if (e._pluginData.mass = r, e.soft)
        t.get_m_cfg().set_collisions(17), t.get_m_cfg().set_kDP(e.getParam("damping")), this.bjsAMMO.castObject(t, this.bjsAMMO.btCollisionObject).getCollisionShape().setMargin(e.getParam("margin")), t.setActivationState(eg._DISABLE_DEACTIVATION_FLAG), this.world.addSoftBody(t, 1, -1), e.physicsBody = t, e._pluginData.toDispose.push(t), this.setBodyPressure(e, 0), e.type === tn.SoftbodyImpostor && this.setBodyPressure(e, e.getParam("pressure")), this.setBodyStiffness(e, e.getParam("stiffness")), this.setBodyVelocityIterations(e, e.getParam("velocityIterations")), this.setBodyPositionIterations(e, e.getParam("positionIterations"));
      else {
        const n = new this.bjsAMMO.btVector3(0, 0, 0), i = new this.bjsAMMO.btTransform();
        e.object.computeWorldMatrix(!0), i.setIdentity(), r !== 0 && t.calculateLocalInertia(r, n), this._tmpAmmoVectorA.setValue(e.object.position.x, e.object.position.y, e.object.position.z), this._tmpAmmoQuaternion.setValue(e.object.rotationQuaternion.x, e.object.rotationQuaternion.y, e.object.rotationQuaternion.z, e.object.rotationQuaternion.w), i.setOrigin(this._tmpAmmoVectorA), i.setRotation(this._tmpAmmoQuaternion);
        const s = new this.bjsAMMO.btDefaultMotionState(i), a = new this.bjsAMMO.btRigidBodyConstructionInfo(r, s, t, n), f = new this.bjsAMMO.btRigidBody(a);
        if (r === 0 && (f.setCollisionFlags(f.getCollisionFlags() | eg._KINEMATIC_FLAG), f.setActivationState(eg._DISABLE_DEACTIVATION_FLAG)), e.type == tn.NoImpostor && !t.getChildShape && f.setCollisionFlags(f.getCollisionFlags() | eg._DISABLE_COLLISION_FLAG), e.type !== tn.MeshImpostor && e.type !== tn.NoImpostor) {
          const v = e.object.getBoundingInfo();
          this._tmpVec3.copyFrom(e.object.getAbsolutePosition()), this._tmpVec3.subtractInPlace(v.boundingBox.centerWorld), this._tmpVec3.x /= e.object.scaling.x, this._tmpVec3.y /= e.object.scaling.y, this._tmpVec3.z /= e.object.scaling.z, e.setDeltaPosition(this._tmpVec3);
        }
        const o = e.getParam("group"), d = e.getParam("mask");
        o && d ? this.world.addRigidBody(f, o, d) : this.world.addRigidBody(f), e.physicsBody = f, e._pluginData.toDispose = e._pluginData.toDispose.concat([f, a, s, i, n, t]);
      }
      this.setBodyRestitution(e, e.getParam("restitution")), this.setBodyFriction(e, e.getParam("friction"));
    }
  }
  /**
   * Removes the physics body from the imposter and disposes of the body's memory
   * @param impostor imposter to remove the physics body from
   */
  removePhysicsBody(e) {
    this.world && (e.soft ? this.world.removeSoftBody(e.physicsBody) : this.world.removeRigidBody(e.physicsBody), e._pluginData && (e._pluginData.toDispose.forEach((t) => {
      this.bjsAMMO.destroy(t);
    }), e._pluginData.toDispose = []));
  }
  /**
   * Generates a joint
   * @param impostorJoint the imposter joint to create the joint with
   */
  generateJoint(e) {
    const t = e.mainImpostor.physicsBody, r = e.connectedImpostor.physicsBody;
    if (!t || !r)
      return;
    const n = e.joint.jointData;
    n.mainPivot || (n.mainPivot = new S(0, 0, 0)), n.connectedPivot || (n.connectedPivot = new S(0, 0, 0));
    let i;
    switch (e.joint.type) {
      case ta.DistanceJoint: {
        const s = n.maxDistance;
        s && (n.mainPivot = new S(0, -s / 2, 0), n.connectedPivot = new S(0, s / 2, 0)), i = new this.bjsAMMO.btPoint2PointConstraint(t, r, new this.bjsAMMO.btVector3(n.mainPivot.x, n.mainPivot.y, n.mainPivot.z), new this.bjsAMMO.btVector3(n.connectedPivot.x, n.connectedPivot.y, n.connectedPivot.z));
        break;
      }
      case ta.HingeJoint: {
        n.mainAxis || (n.mainAxis = new S(0, 0, 0)), n.connectedAxis || (n.connectedAxis = new S(0, 0, 0));
        const s = new this.bjsAMMO.btVector3(n.mainAxis.x, n.mainAxis.y, n.mainAxis.z), a = new this.bjsAMMO.btVector3(n.connectedAxis.x, n.connectedAxis.y, n.connectedAxis.z);
        i = new this.bjsAMMO.btHingeConstraint(t, r, new this.bjsAMMO.btVector3(n.mainPivot.x, n.mainPivot.y, n.mainPivot.z), new this.bjsAMMO.btVector3(n.connectedPivot.x, n.connectedPivot.y, n.connectedPivot.z), s, a);
        break;
      }
      case ta.BallAndSocketJoint:
        i = new this.bjsAMMO.btPoint2PointConstraint(t, r, new this.bjsAMMO.btVector3(n.mainPivot.x, n.mainPivot.y, n.mainPivot.z), new this.bjsAMMO.btVector3(n.connectedPivot.x, n.connectedPivot.y, n.connectedPivot.z));
        break;
      default:
        Se.Warn("JointType not currently supported by the Ammo plugin, falling back to PhysicsJoint.BallAndSocketJoint"), i = new this.bjsAMMO.btPoint2PointConstraint(t, r, new this.bjsAMMO.btVector3(n.mainPivot.x, n.mainPivot.y, n.mainPivot.z), new this.bjsAMMO.btVector3(n.connectedPivot.x, n.connectedPivot.y, n.connectedPivot.z));
        break;
    }
    this.world.addConstraint(i, !e.joint.jointData.collision), e.joint.physicsJoint = i;
  }
  /**
   * Removes a joint
   * @param impostorJoint the imposter joint to remove the joint from
   */
  removeJoint(e) {
    this.world && this.world.removeConstraint(e.joint.physicsJoint);
  }
  // adds all verticies (including child verticies) to the triangle mesh
  _addMeshVerts(e, t, r) {
    let n = 0;
    if (r && r.getIndices && r.getWorldMatrix && r.getChildMeshes) {
      let i = r.getIndices();
      i || (i = []);
      let s = r.getVerticesData(J.PositionKind);
      s || (s = []);
      let a;
      if (t && t !== r) {
        let o;
        t.rotationQuaternion ? o = t.rotationQuaternion : t.rotation ? o = Ze.FromEulerAngles(t.rotation.x, t.rotation.y, t.rotation.z) : o = Ze.Identity(), he.Compose(S.One(), o, t.position).invertToRef(this._tmpMatrix), a = r.computeWorldMatrix(!1).multiply(this._tmpMatrix);
      } else
        he.ScalingToRef(r.scaling.x, r.scaling.y, r.scaling.z, this._tmpMatrix), a = this._tmpMatrix;
      const f = i.length / 3;
      for (let o = 0; o < f; o++) {
        const d = [];
        for (let v = 0; v < 3; v++) {
          let u = new S(s[i[o * 3 + v] * 3 + 0], s[i[o * 3 + v] * 3 + 1], s[i[o * 3 + v] * 3 + 2]);
          u = S.TransformCoordinates(u, a);
          let l;
          v == 0 ? l = this._tmpAmmoVectorA : v == 1 ? l = this._tmpAmmoVectorB : l = this._tmpAmmoVectorC, l.setValue(u.x, u.y, u.z), d.push(l);
        }
        e.addTriangle(d[0], d[1], d[2]), n++;
      }
      r.getChildMeshes().forEach((o) => {
        n += this._addMeshVerts(e, t, o);
      });
    }
    return n;
  }
  /**
   * Initialise the soft body vertices to match its object's (mesh) vertices
   * Softbody vertices (nodes) are in world space and to match this
   * The object's position and rotation is set to zero and so its vertices are also then set in world space
   * @param impostor to create the softbody for
   */
  _softVertexData(e) {
    const t = e.object;
    if (t && t.getIndices && t.getWorldMatrix && t.getChildMeshes) {
      t.getIndices();
      let r = t.getVerticesData(J.PositionKind);
      r || (r = []);
      let n = t.getVerticesData(J.NormalKind);
      n || (n = []), t.computeWorldMatrix(!1);
      const i = [], s = [];
      for (let f = 0; f < r.length; f += 3) {
        let o = new S(r[f], r[f + 1], r[f + 2]), d = new S(n[f], n[f + 1], n[f + 2]);
        o = S.TransformCoordinates(o, t.getWorldMatrix()), d = S.TransformNormal(d, t.getWorldMatrix()), i.push(o.x, o.y, o.z), s.push(d.x, d.y, d.z);
      }
      const a = new Ut();
      return a.positions = i, a.normals = s, a.uvs = t.getVerticesData(J.UVKind), a.colors = t.getVerticesData(J.ColorKind), t && t.getIndices && (a.indices = t.getIndices()), a.applyToMesh(t), t.position = S.Zero(), t.rotationQuaternion = null, t.rotation = S.Zero(), t.computeWorldMatrix(!0), a;
    }
    return Ut.ExtractFromMesh(t);
  }
  /**
   * Create an impostor's soft body
   * @param impostor to create the softbody for
   */
  _createSoftbody(e) {
    const t = e.object;
    if (t && t.getIndices) {
      let r = t.getIndices();
      r || (r = []);
      const n = this._softVertexData(e), i = n.positions, s = n.normals;
      if (i === null || s === null)
        return new this.bjsAMMO.btCompoundShape();
      {
        const a = [], f = [];
        for (let P = 0; P < i.length; P += 3) {
          const p = new S(i[P], i[P + 1], i[P + 2]), c = new S(s[P], s[P + 1], s[P + 2]);
          a.push(p.x, p.y, -p.z), f.push(c.x, c.y, -c.z);
        }
        const o = new this.bjsAMMO.btSoftBodyHelpers().CreateFromTriMesh(this.world.getWorldInfo(), a, t.getIndices(), r.length / 3, !0), d = i.length / 3, v = o.get_m_nodes();
        let u, l;
        for (let P = 0; P < d; P++)
          u = v.at(P), l = u.get_m_n(), l.setX(f[3 * P]), l.setY(f[3 * P + 1]), l.setZ(f[3 * P + 2]);
        return o;
      }
    }
  }
  /**
   * Create cloth for an impostor
   * @param impostor to create the softbody for
   */
  _createCloth(e) {
    const t = e.object;
    if (t && t.getIndices) {
      t.getIndices();
      const r = this._softVertexData(e), n = r.positions, i = r.normals;
      if (n === null || i === null)
        return new this.bjsAMMO.btCompoundShape();
      {
        const s = n.length, a = Math.sqrt(s / 3);
        e.segments = a;
        const f = a - 1;
        return this._tmpAmmoVectorA.setValue(n[0], n[1], n[2]), this._tmpAmmoVectorB.setValue(n[3 * f], n[3 * f + 1], n[3 * f + 2]), this._tmpAmmoVectorD.setValue(n[s - 3], n[s - 2], n[s - 1]), this._tmpAmmoVectorC.setValue(n[s - 3 - 3 * f], n[s - 2 - 3 * f], n[s - 1 - 3 * f]), new this.bjsAMMO.btSoftBodyHelpers().CreatePatch(this.world.getWorldInfo(), this._tmpAmmoVectorA, this._tmpAmmoVectorB, this._tmpAmmoVectorC, this._tmpAmmoVectorD, a, a, e.getParam("fixedPoints"), !0);
      }
    }
  }
  /**
   * Create rope for an impostor
   * @param impostor to create the softbody for
   */
  _createRope(e) {
    let t, r;
    const n = this._softVertexData(e), i = n.positions, s = n.normals;
    if (i === null || s === null)
      return new this.bjsAMMO.btCompoundShape();
    n.applyToMesh(e.object, !0), e._isFromLine = !0;
    const a = s.map((u) => u * u), f = (u, l) => u + l;
    if (a.reduce(f) === 0)
      t = i.length, r = t / 3 - 1, this._tmpAmmoVectorA.setValue(i[0], i[1], i[2]), this._tmpAmmoVectorB.setValue(i[t - 3], i[t - 2], i[t - 1]);
    else {
      e._isFromLine = !1;
      const u = e.getParam("path");
      if (e.getParam("shape") === null)
        return Se.Warn("No shape available for extruded mesh"), new this.bjsAMMO.btCompoundShape();
      t = u.length, r = t - 1, this._tmpAmmoVectorA.setValue(u[0].x, u[0].y, u[0].z), this._tmpAmmoVectorB.setValue(u[t - 1].x, u[t - 1].y, u[t - 1].z);
    }
    e.segments = r;
    let d = e.getParam("fixedPoints");
    d = d > 3 ? 3 : d;
    const v = new this.bjsAMMO.btSoftBodyHelpers().CreateRope(this.world.getWorldInfo(), this._tmpAmmoVectorA, this._tmpAmmoVectorB, r - 1, d);
    return v.get_m_cfg().set_collisions(17), v;
  }
  /**
   * Create a custom physics impostor shape using the plugin's onCreateCustomShape handler
   * @param impostor to create the custom physics shape for
   */
  _createCustom(e) {
    let t = null;
    return this.onCreateCustomShape && (t = this.onCreateCustomShape(e)), t == null && (t = new this.bjsAMMO.btCompoundShape()), t;
  }
  // adds all verticies (including child verticies) to the convex hull shape
  _addHullVerts(e, t, r) {
    let n = 0;
    if (r && r.getIndices && r.getWorldMatrix && r.getChildMeshes) {
      let i = r.getIndices();
      i || (i = []);
      let s = r.getVerticesData(J.PositionKind);
      s || (s = []), r.computeWorldMatrix(!1);
      const a = i.length / 3;
      for (let f = 0; f < a; f++) {
        const o = [];
        for (let d = 0; d < 3; d++) {
          let v = new S(s[i[f * 3 + d] * 3 + 0], s[i[f * 3 + d] * 3 + 1], s[i[f * 3 + d] * 3 + 2]);
          he.ScalingToRef(r.scaling.x, r.scaling.y, r.scaling.z, this._tmpMatrix), v = S.TransformCoordinates(v, this._tmpMatrix);
          let u;
          d == 0 ? u = this._tmpAmmoVectorA : d == 1 ? u = this._tmpAmmoVectorB : u = this._tmpAmmoVectorC, u.setValue(v.x, v.y, v.z), o.push(u);
        }
        e.addPoint(o[0], !0), e.addPoint(o[1], !0), e.addPoint(o[2], !0), n++;
      }
      r.getChildMeshes().forEach((f) => {
        n += this._addHullVerts(e, t, f);
      });
    }
    return n;
  }
  _createShape(e, t = !1) {
    const r = e.object;
    let n;
    const i = e.getObjectExtents();
    if (!t) {
      const s = e.object.getChildMeshes ? e.object.getChildMeshes(!0) : [];
      n = new this.bjsAMMO.btCompoundShape();
      let a = 0;
      if (s.forEach((f) => {
        const o = f.getPhysicsImpostor();
        if (o) {
          if (o.type == tn.MeshImpostor)
            throw "A child MeshImpostor is not supported. Only primitive impostors are supported as children (eg. box or sphere)";
          const d = this._createShape(o), v = f.parent.getWorldMatrix().clone(), u = new S();
          v.decompose(u), this._tmpAmmoTransform.getOrigin().setValue(f.position.x * u.x, f.position.y * u.y, f.position.z * u.z), this._tmpAmmoQuaternion.setValue(f.rotationQuaternion.x, f.rotationQuaternion.y, f.rotationQuaternion.z, f.rotationQuaternion.w), this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion), n.addChildShape(this._tmpAmmoTransform, d), o.dispose(), a++;
        }
      }), a > 0) {
        if (e.type != tn.NoImpostor) {
          const f = this._createShape(e, !0);
          f && (this._tmpAmmoTransform.getOrigin().setValue(0, 0, 0), this._tmpAmmoQuaternion.setValue(0, 0, 0, 1), this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion), n.addChildShape(this._tmpAmmoTransform, f));
        }
        return n;
      } else
        this.bjsAMMO.destroy(n), n = null;
    }
    switch (e.type) {
      case tn.SphereImpostor:
        if (Xt.WithinEpsilon(i.x, i.y, 1e-4) && Xt.WithinEpsilon(i.x, i.z, 1e-4))
          n = new this.bjsAMMO.btSphereShape(i.x / 2);
        else {
          const s = [new this.bjsAMMO.btVector3(0, 0, 0)], a = [1];
          n = new this.bjsAMMO.btMultiSphereShape(s, a, 1), n.setLocalScaling(new this.bjsAMMO.btVector3(i.x / 2, i.y / 2, i.z / 2));
        }
        break;
      case tn.CapsuleImpostor:
        {
          const s = i.x / 2;
          n = new this.bjsAMMO.btCapsuleShape(s, i.y - s * 2);
        }
        break;
      case tn.CylinderImpostor:
        this._tmpAmmoVectorA.setValue(i.x / 2, i.y / 2, i.z / 2), n = new this.bjsAMMO.btCylinderShape(this._tmpAmmoVectorA);
        break;
      case tn.PlaneImpostor:
      case tn.BoxImpostor:
        this._tmpAmmoVectorA.setValue(i.x / 2, i.y / 2, i.z / 2), n = new this.bjsAMMO.btBoxShape(this._tmpAmmoVectorA);
        break;
      case tn.MeshImpostor:
        if (e.getParam("mass") == 0) {
          if (this.onCreateCustomMeshImpostor)
            n = this.onCreateCustomMeshImpostor(e);
          else {
            const s = new this.bjsAMMO.btTriangleMesh();
            e._pluginData.toDispose.push(s), this._addMeshVerts(s, r, r) == 0 ? n = new this.bjsAMMO.btCompoundShape() : n = new this.bjsAMMO.btBvhTriangleMeshShape(s);
          }
          break;
        }
      case tn.ConvexHullImpostor: {
        if (this.onCreateCustomConvexHullImpostor)
          n = this.onCreateCustomConvexHullImpostor(e);
        else {
          const s = new this.bjsAMMO.btConvexHullShape();
          this._addHullVerts(s, r, r) == 0 ? (e._pluginData.toDispose.push(s), n = new this.bjsAMMO.btCompoundShape()) : n = s;
        }
        break;
      }
      case tn.NoImpostor:
        n = new this.bjsAMMO.btSphereShape(i.x / 2);
        break;
      case tn.CustomImpostor:
        n = this._createCustom(e);
        break;
      case tn.SoftbodyImpostor:
        n = this._createSoftbody(e);
        break;
      case tn.ClothImpostor:
        n = this._createCloth(e);
        break;
      case tn.RopeImpostor:
        n = this._createRope(e);
        break;
      default:
        Se.Warn("The impostor type is not currently supported by the ammo plugin.");
        break;
    }
    return n;
  }
  /**
   * Sets the mesh body position/rotation from the babylon impostor
   * @param impostor imposter containing the physics body and babylon object
   */
  setTransformationFromPhysicsBody(e) {
    e.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform), e.object.position.set(this._tmpAmmoTransform.getOrigin().x(), this._tmpAmmoTransform.getOrigin().y(), this._tmpAmmoTransform.getOrigin().z()), e.object.rotationQuaternion ? e.object.rotationQuaternion.set(this._tmpAmmoTransform.getRotation().x(), this._tmpAmmoTransform.getRotation().y(), this._tmpAmmoTransform.getRotation().z(), this._tmpAmmoTransform.getRotation().w()) : e.object.rotation && (this._tmpQuaternion.set(this._tmpAmmoTransform.getRotation().x(), this._tmpAmmoTransform.getRotation().y(), this._tmpAmmoTransform.getRotation().z(), this._tmpAmmoTransform.getRotation().w()), this._tmpQuaternion.toEulerAnglesToRef(e.object.rotation));
  }
  /**
   * Sets the babylon object's position/rotation from the physics body's position/rotation
   * @param impostor imposter containing the physics body and babylon object
   * @param newPosition new position
   * @param newRotation new rotation
   */
  setPhysicsBodyTransformation(e, t, r) {
    const n = e.physicsBody.getWorldTransform();
    if (Math.abs(n.getOrigin().x() - t.x) > Dn || Math.abs(n.getOrigin().y() - t.y) > Dn || Math.abs(n.getOrigin().z() - t.z) > Dn || Math.abs(n.getRotation().x() - r.x) > Dn || Math.abs(n.getRotation().y() - r.y) > Dn || Math.abs(n.getRotation().z() - r.z) > Dn || Math.abs(n.getRotation().w() - r.w) > Dn)
      if (this._tmpAmmoVectorA.setValue(t.x, t.y, t.z), n.setOrigin(this._tmpAmmoVectorA), this._tmpAmmoQuaternion.setValue(r.x, r.y, r.z, r.w), n.setRotation(this._tmpAmmoQuaternion), e.physicsBody.setWorldTransform(n), e.mass == 0) {
        const i = e.physicsBody.getMotionState();
        i && i.setWorldTransform(n);
      } else
        e.physicsBody.activate();
  }
  /**
   * If this plugin is supported
   * @returns true if its supported
   */
  isSupported() {
    return this.bjsAMMO !== void 0;
  }
  /**
   * Sets the linear velocity of the physics body
   * @param impostor imposter to set the velocity on
   * @param velocity velocity to set
   */
  setLinearVelocity(e, t) {
    this._tmpAmmoVectorA.setValue(t.x, t.y, t.z), e.soft ? e.physicsBody.linearVelocity(this._tmpAmmoVectorA) : e.physicsBody.setLinearVelocity(this._tmpAmmoVectorA);
  }
  /**
   * Sets the angular velocity of the physics body
   * @param impostor imposter to set the velocity on
   * @param velocity velocity to set
   */
  setAngularVelocity(e, t) {
    this._tmpAmmoVectorA.setValue(t.x, t.y, t.z), e.soft ? e.physicsBody.angularVelocity(this._tmpAmmoVectorA) : e.physicsBody.setAngularVelocity(this._tmpAmmoVectorA);
  }
  /**
   * gets the linear velocity
   * @param impostor imposter to get linear velocity from
   * @returns linear velocity
   */
  getLinearVelocity(e) {
    let t;
    if (e.soft ? t = e.physicsBody.linearVelocity() : t = e.physicsBody.getLinearVelocity(), !t)
      return null;
    const r = new S(t.x(), t.y(), t.z());
    return this.bjsAMMO.destroy(t), r;
  }
  /**
   * gets the angular velocity
   * @param impostor imposter to get angular velocity from
   * @returns angular velocity
   */
  getAngularVelocity(e) {
    let t;
    if (e.soft ? t = e.physicsBody.angularVelocity() : t = e.physicsBody.getAngularVelocity(), !t)
      return null;
    const r = new S(t.x(), t.y(), t.z());
    return this.bjsAMMO.destroy(t), r;
  }
  /**
   * Sets the mass of physics body
   * @param impostor imposter to set the mass on
   * @param mass mass to set
   */
  setBodyMass(e, t) {
    e.soft ? e.physicsBody.setTotalMass(t, !1) : e.physicsBody.setMassProps(t), e._pluginData.mass = t;
  }
  /**
   * Gets the mass of the physics body
   * @param impostor imposter to get the mass from
   * @returns mass
   */
  getBodyMass(e) {
    return e._pluginData.mass || 0;
  }
  /**
   * Gets friction of the impostor
   * @param impostor impostor to get friction from
   * @returns friction value
   */
  getBodyFriction(e) {
    return e._pluginData.friction || 0;
  }
  /**
   * Sets friction of the impostor
   * @param impostor impostor to set friction on
   * @param friction friction value
   */
  setBodyFriction(e, t) {
    e.soft ? e.physicsBody.get_m_cfg().set_kDF(t) : e.physicsBody.setFriction(t), e._pluginData.friction = t;
  }
  /**
   * Gets restitution of the impostor
   * @param impostor impostor to get restitution from
   * @returns restitution value
   */
  getBodyRestitution(e) {
    return e._pluginData.restitution || 0;
  }
  /**
   * Sets restitution of the impostor
   * @param impostor impostor to set resitution on
   * @param restitution resitution value
   */
  setBodyRestitution(e, t) {
    e.physicsBody.setRestitution(t), e._pluginData.restitution = t;
  }
  /**
   * Gets pressure inside the impostor
   * @param impostor impostor to get pressure from
   * @returns pressure value
   */
  getBodyPressure(e) {
    return e.soft ? e._pluginData.pressure || 0 : (Se.Warn("Pressure is not a property of a rigid body"), 0);
  }
  /**
   * Sets pressure inside a soft body impostor
   * Cloth and rope must remain 0 pressure
   * @param impostor impostor to set pressure on
   * @param pressure pressure value
   */
  setBodyPressure(e, t) {
    e.soft ? e.type === tn.SoftbodyImpostor ? (e.physicsBody.get_m_cfg().set_kPR(t), e._pluginData.pressure = t) : (e.physicsBody.get_m_cfg().set_kPR(0), e._pluginData.pressure = 0) : Se.Warn("Pressure can only be applied to a softbody");
  }
  /**
   * Gets stiffness of the impostor
   * @param impostor impostor to get stiffness from
   * @returns pressure value
   */
  getBodyStiffness(e) {
    return e.soft ? e._pluginData.stiffness || 0 : (Se.Warn("Stiffness is not a property of a rigid body"), 0);
  }
  /**
   * Sets stiffness of the impostor
   * @param impostor impostor to set stiffness on
   * @param stiffness stiffness value from 0 to 1
   */
  setBodyStiffness(e, t) {
    e.soft ? (t = t < 0 ? 0 : t, t = t > 1 ? 1 : t, e.physicsBody.get_m_materials().at(0).set_m_kLST(t), e._pluginData.stiffness = t) : Se.Warn("Stiffness cannot be applied to a rigid body");
  }
  /**
   * Gets velocityIterations of the impostor
   * @param impostor impostor to get velocity iterations from
   * @returns velocityIterations value
   */
  getBodyVelocityIterations(e) {
    return e.soft ? e._pluginData.velocityIterations || 0 : (Se.Warn("Velocity iterations is not a property of a rigid body"), 0);
  }
  /**
   * Sets velocityIterations of the impostor
   * @param impostor impostor to set velocity iterations on
   * @param velocityIterations velocityIterations value
   */
  setBodyVelocityIterations(e, t) {
    e.soft ? (t = t < 0 ? 0 : t, e.physicsBody.get_m_cfg().set_viterations(t), e._pluginData.velocityIterations = t) : Se.Warn("Velocity iterations cannot be applied to a rigid body");
  }
  /**
   * Gets positionIterations of the impostor
   * @param impostor impostor to get position iterations from
   * @returns positionIterations value
   */
  getBodyPositionIterations(e) {
    return e.soft ? e._pluginData.positionIterations || 0 : (Se.Warn("Position iterations is not a property of a rigid body"), 0);
  }
  /**
   * Sets positionIterations of the impostor
   * @param impostor impostor to set position on
   * @param positionIterations positionIterations value
   */
  setBodyPositionIterations(e, t) {
    e.soft ? (t = t < 0 ? 0 : t, e.physicsBody.get_m_cfg().set_piterations(t), e._pluginData.positionIterations = t) : Se.Warn("Position iterations cannot be applied to a rigid body");
  }
  /**
   * Append an anchor to a cloth object
   * @param impostor is the cloth impostor to add anchor to
   * @param otherImpostor is the rigid impostor to anchor to
   * @param width ratio across width from 0 to 1
   * @param height ratio up height from 0 to 1
   * @param influence the elasticity between cloth impostor and anchor from 0, very stretchy to 1, little stretch
   * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
   */
  appendAnchor(e, t, r, n, i = 1, s = !1) {
    const a = e.segments, f = Math.round((a - 1) * r), o = Math.round((a - 1) * n), d = a - 1 - o, v = f + a * d;
    e.physicsBody.appendAnchor(v, t.physicsBody, s, i);
  }
  /**
   * Append an hook to a rope object
   * @param impostor is the rope impostor to add hook to
   * @param otherImpostor is the rigid impostor to hook to
   * @param length ratio along the rope from 0 to 1
   * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, little stretch
   * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
   */
  appendHook(e, t, r, n = 1, i = !1) {
    const s = Math.round(e.segments * r);
    e.physicsBody.appendAnchor(s, t.physicsBody, i, n);
  }
  /**
   * Sleeps the physics body and stops it from being active
   * @param impostor impostor to sleep
   */
  sleepBody(e) {
    e.physicsBody.forceActivationState(0);
  }
  /**
   * Activates the physics body
   * @param impostor impostor to activate
   */
  wakeUpBody(e) {
    e.physicsBody.activate();
  }
  /**
   * Updates the distance parameters of the joint
   */
  updateDistanceJoint() {
    Se.Warn("updateDistanceJoint is not currently supported by the Ammo physics plugin");
  }
  /**
   * Sets a motor on the joint
   * @param joint joint to set motor on
   * @param speed speed of the motor
   * @param maxForce maximum force of the motor
   */
  setMotor(e, t, r) {
    e.physicsJoint.enableAngularMotor(!0, t, r);
  }
  /**
   * Sets the motors limit
   */
  setLimit() {
    Se.Warn("setLimit is not currently supported by the Ammo physics plugin");
  }
  /**
   * Syncs the position and rotation of a mesh with the impostor
   * @param mesh mesh to sync
   * @param impostor impostor to update the mesh with
   */
  syncMeshWithImpostor(e, t) {
    t.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform), e.position.x = this._tmpAmmoTransform.getOrigin().x(), e.position.y = this._tmpAmmoTransform.getOrigin().y(), e.position.z = this._tmpAmmoTransform.getOrigin().z(), e.rotationQuaternion && (e.rotationQuaternion.x = this._tmpAmmoTransform.getRotation().x(), e.rotationQuaternion.y = this._tmpAmmoTransform.getRotation().y(), e.rotationQuaternion.z = this._tmpAmmoTransform.getRotation().z(), e.rotationQuaternion.w = this._tmpAmmoTransform.getRotation().w());
  }
  /**
   * Gets the radius of the impostor
   * @param impostor impostor to get radius from
   * @returns the radius
   */
  getRadius(e) {
    return e.getObjectExtents().x / 2;
  }
  /**
   * Gets the box size of the impostor
   * @param impostor impostor to get box size from
   * @param result the resulting box size
   */
  getBoxSizeToRef(e, t) {
    const r = e.getObjectExtents();
    t.x = r.x, t.y = r.y, t.z = r.z;
  }
  /**
   * Disposes of the impostor
   */
  dispose() {
    this.bjsAMMO.destroy(this.world), this.bjsAMMO.destroy(this._solver), this.bjsAMMO.destroy(this._overlappingPairCache), this.bjsAMMO.destroy(this._dispatcher), this.bjsAMMO.destroy(this._collisionConfiguration), this.bjsAMMO.destroy(this._tmpAmmoVectorA), this.bjsAMMO.destroy(this._tmpAmmoVectorB), this.bjsAMMO.destroy(this._tmpAmmoVectorC), this.bjsAMMO.destroy(this._tmpAmmoTransform), this.bjsAMMO.destroy(this._tmpAmmoQuaternion), this.bjsAMMO.destroy(this._tmpAmmoConcreteContactResultCallback), this.world = null;
  }
  /**
   * Does a raycast in the physics world
   * @param from where should the ray start?
   * @param to where should the ray end?
   * @returns PhysicsRaycastResult
   */
  raycast(e, t) {
    return this.raycastToRef(e, t, this._raycastResult), this._raycastResult;
  }
  /**
   * Does a raycast in the physics world
   * @param from when should the ray start?
   * @param to when should the ray end?
   * @param result resulting PhysicsRaycastResult
   */
  raycastToRef(e, t, r) {
    this._tmpAmmoVectorRCA = new this.bjsAMMO.btVector3(e.x, e.y, e.z), this._tmpAmmoVectorRCB = new this.bjsAMMO.btVector3(t.x, t.y, t.z);
    const n = new this.bjsAMMO.ClosestRayResultCallback(this._tmpAmmoVectorRCA, this._tmpAmmoVectorRCB);
    this.world.rayTest(this._tmpAmmoVectorRCA, this._tmpAmmoVectorRCB, n), r.reset(e, t), n.hasHit() && (r.setHitData({
      x: n.get_m_hitNormalWorld().x(),
      y: n.get_m_hitNormalWorld().y(),
      z: n.get_m_hitNormalWorld().z()
    }, {
      x: n.get_m_hitPointWorld().x(),
      y: n.get_m_hitPointWorld().y(),
      z: n.get_m_hitPointWorld().z()
    }), r.calculateHitDistance()), this.bjsAMMO.destroy(n), this.bjsAMMO.destroy(this._tmpAmmoVectorRCA), this.bjsAMMO.destroy(this._tmpAmmoVectorRCB);
  }
}
eg._DISABLE_COLLISION_FLAG = 4;
eg._KINEMATIC_FLAG = 2;
eg._DISABLE_DEACTIVATION_FLAG = 4;
J1.prototype.removeReflectionProbe = function(A) {
  if (!this.reflectionProbes)
    return -1;
  const e = this.reflectionProbes.indexOf(A);
  return e !== -1 && this.reflectionProbes.splice(e, 1), e;
};
J1.prototype.addReflectionProbe = function(A) {
  this.reflectionProbes || (this.reflectionProbes = []), this.reflectionProbes.push(A);
};
class Im {
  /**
   * Creates a new reflection probe
   * @param name defines the name of the probe
   * @param size defines the texture resolution (for each face)
   * @param scene defines the hosting scene
   * @param generateMipMaps defines if mip maps should be generated automatically (true by default)
   * @param useFloat defines if HDR data (float data) should be used to store colors (false by default)
   * @param linearSpace defines if the probe should be generated in linear space or not (false by default)
   */
  constructor(e, t, r, n = !0, i = !1, s = !1) {
    if (this.name = e, this._viewMatrix = he.Identity(), this._target = S.Zero(), this._add = S.Zero(), this._invertYAxis = !1, this.position = S.Zero(), this.metadata = null, this._parentContainer = null, this._scene = r, r.getEngine().supportsUniformBuffers) {
      this._sceneUBOs = [];
      for (let d = 0; d < 6; ++d)
        this._sceneUBOs.push(r.createSceneUniformBuffer(`Scene for Reflection Probe (name "${e}") face #${d}`));
    }
    this._scene.reflectionProbes || (this._scene.reflectionProbes = []), this._scene.reflectionProbes.push(this);
    let a = 0;
    if (i) {
      const d = this._scene.getEngine().getCaps();
      d.textureHalfFloatRender ? a = 2 : d.textureFloatRender && (a = 1);
    }
    this._renderTargetTexture = new Ta(e, t, r, n, !0, a, !0), this._renderTargetTexture.gammaSpace = !s, this._renderTargetTexture.invertZ = r.useRightHandedSystem;
    const f = r.getEngine().useReverseDepthBuffer;
    this._renderTargetTexture.onBeforeRenderObservable.add((d) => {
      switch (this._sceneUBOs && (r.setSceneUniformBuffer(this._sceneUBOs[d]), r.getSceneUniformBuffer().unbindEffect()), d) {
        case 0:
          this._add.copyFromFloats(1, 0, 0);
          break;
        case 1:
          this._add.copyFromFloats(-1, 0, 0);
          break;
        case 2:
          this._add.copyFromFloats(0, this._invertYAxis ? 1 : -1, 0);
          break;
        case 3:
          this._add.copyFromFloats(0, this._invertYAxis ? -1 : 1, 0);
          break;
        case 4:
          this._add.copyFromFloats(0, 0, r.useRightHandedSystem ? -1 : 1);
          break;
        case 5:
          this._add.copyFromFloats(0, 0, r.useRightHandedSystem ? 1 : -1);
          break;
      }
      this._attachedMesh && this.position.copyFrom(this._attachedMesh.getAbsolutePosition()), this.position.addToRef(this._add, this._target);
      const v = r.useRightHandedSystem ? he.LookAtRHToRef : he.LookAtLHToRef, u = r.useRightHandedSystem ? he.PerspectiveFovRH : he.PerspectiveFovLH;
      v(this.position, this._target, S.Up(), this._viewMatrix), r.activeCamera && (this._projectionMatrix = u(Math.PI / 2, 1, f ? r.activeCamera.maxZ : r.activeCamera.minZ, f ? r.activeCamera.minZ : r.activeCamera.maxZ, this._scene.getEngine().isNDCHalfZRange), r.setTransformMatrix(this._viewMatrix, this._projectionMatrix), r.activeCamera.isRigCamera && !this._renderTargetTexture.activeCamera && (this._renderTargetTexture.activeCamera = r.activeCamera.rigParent || null)), r._forcedViewPosition = this.position;
    });
    let o;
    this._renderTargetTexture.onBeforeBindObservable.add(() => {
      var d, v;
      this._currentSceneUBO = r.getSceneUniformBuffer(), (v = (d = r.getEngine())._debugPushGroup) === null || v === void 0 || v.call(d, `reflection probe generation for ${e}`, 1), o = this._scene.imageProcessingConfiguration.applyByPostProcess, s && (r.imageProcessingConfiguration.applyByPostProcess = !0);
    }), this._renderTargetTexture.onAfterUnbindObservable.add(() => {
      var d, v;
      r.imageProcessingConfiguration.applyByPostProcess = o, r._forcedViewPosition = null, this._sceneUBOs && r.setSceneUniformBuffer(this._currentSceneUBO), r.updateTransformMatrix(!0), (v = (d = r.getEngine())._debugPopGroup) === null || v === void 0 || v.call(d, 1);
    });
  }
  /** Gets or sets the number of samples to use for multi-sampling (0 by default). Required WebGL2 */
  get samples() {
    return this._renderTargetTexture.samples;
  }
  set samples(e) {
    this._renderTargetTexture.samples = e;
  }
  /** Gets or sets the refresh rate to use (on every frame by default) */
  get refreshRate() {
    return this._renderTargetTexture.refreshRate;
  }
  set refreshRate(e) {
    this._renderTargetTexture.refreshRate = e;
  }
  /**
   * Gets the hosting scene
   * @returns a Scene
   */
  getScene() {
    return this._scene;
  }
  /** Gets the internal CubeTexture used to render to */
  get cubeTexture() {
    return this._renderTargetTexture;
  }
  /** Gets or sets the list of meshes to render */
  get renderList() {
    return this._renderTargetTexture.renderList;
  }
  set renderList(e) {
    this._renderTargetTexture.renderList = e;
  }
  /**
   * Attach the probe to a specific mesh (Rendering will be done from attached mesh's position)
   * @param mesh defines the mesh to attach to
   */
  attachToMesh(e) {
    this._attachedMesh = e;
  }
  /**
   * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups
   * @param renderingGroupId The rendering group id corresponding to its index
   * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
   */
  setRenderingAutoClearDepthStencil(e, t) {
    this._renderTargetTexture.setRenderingAutoClearDepthStencil(e, t);
  }
  /**
   * Clean all associated resources
   */
  dispose() {
    const e = this._scene.reflectionProbes.indexOf(this);
    if (e !== -1 && this._scene.reflectionProbes.splice(e, 1), this._parentContainer) {
      const t = this._parentContainer.reflectionProbes.indexOf(this);
      t > -1 && this._parentContainer.reflectionProbes.splice(t, 1), this._parentContainer = null;
    }
    if (this._renderTargetTexture && (this._renderTargetTexture.dispose(), this._renderTargetTexture = null), this._sceneUBOs) {
      for (const t of this._sceneUBOs)
        t.dispose();
      this._sceneUBOs = [];
    }
  }
  /**
   * Converts the reflection probe information to a readable string for debug purpose.
   * @param fullDetails Supports for multiple levels of logging within scene loading
   * @returns the human readable reflection probe info
   */
  toString(e) {
    let t = "Name: " + this.name;
    return e && (t += ", position: " + this.position.toString(), this._attachedMesh && (t += ", attached mesh: " + this._attachedMesh.name)), t;
  }
  /**
   * Get the class name of the refection probe.
   * @returns "ReflectionProbe"
   */
  getClassName() {
    return "ReflectionProbe";
  }
  /**
   * Serialize the reflection probe to a JSON representation we can easily use in the respective Parse function.
   * @returns The JSON representation of the texture
   */
  serialize() {
    const e = jt.Serialize(this, this._renderTargetTexture.serialize());
    return e.isReflectionProbe = !0, e.metadata = this.metadata, e;
  }
  /**
   * Parse the JSON representation of a reflection probe in order to recreate the reflection probe in the given scene.
   * @param parsedReflectionProbe Define the JSON representation of the reflection probe
   * @param scene Define the scene the parsed reflection probe should be instantiated in
   * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies
   * @returns The parsed reflection probe if successful
   */
  static Parse(e, t, r) {
    let n = null;
    if (t.reflectionProbes)
      for (let i = 0; i < t.reflectionProbes.length; i++) {
        const s = t.reflectionProbes[i];
        if (s.name === e.name) {
          n = s;
          break;
        }
      }
    return n = jt.Parse(() => n || new Im(e.name, e.renderTargetSize, t, e._generateMipMaps), e, t, r), n.cubeTexture._waitingRenderList = e.renderList, e._attachedMesh && n.attachToMesh(t.getMeshById(e._attachedMesh)), e.metadata && (n.metadata = e.metadata), n;
  }
}
C([
  tU()
], Im.prototype, "_attachedMesh", void 0);
C([
  fo()
], Im.prototype, "position", void 0);
var Tpe = !0;
class SI {
}
SI.LoaderInjectedPhysicsEngine = void 0;
let EW = {}, nD = {};
const LG = (A, e, t, r) => {
  if (!e.materials)
    return null;
  for (let n = 0, i = e.materials.length; n < i; n++) {
    const s = e.materials[n];
    if (A(s))
      return { parsedMaterial: s, material: gt.Parse(s, t, r) };
  }
  return null;
}, qpe = (A, e, t) => {
  for (const r in e)
    if (A.name === e[r])
      return t.push(A.id), !0;
  return A.parentId !== void 0 && t.indexOf(A.parentId) !== -1 ? (t.push(A.id), !0) : !1;
}, YW = (A, e) => A + " of " + (e ? e.file + " from " + e.name + " version: " + e.version + ", exporter version: " + e.exporter_version : "unknown"), Gte = (A, e) => {
  const t = e;
  if (e._waitingData.lods) {
    if (e._waitingData.lods.ids && e._waitingData.lods.ids.length > 0) {
      const r = e._waitingData.lods.ids, n = t.isEnabled(!1);
      if (e._waitingData.lods.distances) {
        const i = e._waitingData.lods.distances;
        if (i.length >= r.length) {
          const s = i.length > r.length ? i[i.length - 1] : 0;
          t.setEnabled(!1);
          for (let a = 0; a < r.length; a++) {
            const f = r[a], o = A.getMeshById(f);
            o != null && t.addLODLevel(i[a], o);
          }
          s > 0 && t.addLODLevel(s, null), n === !0 && t.setEnabled(!0);
        } else
          ye.Warn("Invalid level of detail distances for " + e.name);
      }
    }
    e._waitingData.lods = null;
  }
}, gC = (A, e, t) => {
  if (typeof A != "number") {
    const n = t.getLastEntryById(A);
    return n && e !== void 0 && e !== null ? n.instances[parseInt(e)] : n;
  }
  const r = EW[A];
  return r && e !== void 0 && e !== null ? r.instances[parseInt(e)] : r;
}, aO = (A, e) => typeof A != "number" ? e.getLastMaterialById(A, !0) : nD[A], KG = (A, e, t, r, n = !1) => {
  const i = new xR(A);
  let s = "importScene has failed JSON parse";
  try {
    var a = JSON.parse(e);
    s = "";
    const f = Hn.loggingLevel === Hn.DETAILED_LOGGING;
    let o, d;
    if (a.environmentTexture !== void 0 && a.environmentTexture !== null) {
      const u = a.isPBR !== void 0 ? a.isPBR : !0;
      if (a.environmentTextureType && a.environmentTextureType === "BABYLON.HDRCubeTexture") {
        const l = a.environmentTextureSize ? a.environmentTextureSize : 128, P = new _2((a.environmentTexture.match(/https?:\/\//g) ? "" : t) + a.environmentTexture, A, l, !0, !u, void 0, a.environmentTexturePrefilterOnLoad);
        a.environmentTextureRotationY && (P.rotationY = a.environmentTextureRotationY), A.environmentTexture = P;
      } else if (typeof a.environmentTexture == "object") {
        const l = v1.Parse(a.environmentTexture, A, t);
        A.environmentTexture = l;
      } else if (a.environmentTexture.endsWith(".env")) {
        const l = new v1((a.environmentTexture.match(/https?:\/\//g) ? "" : t) + a.environmentTexture, A, a.environmentTextureForcedExtension);
        a.environmentTextureRotationY && (l.rotationY = a.environmentTextureRotationY), A.environmentTexture = l;
      } else {
        const l = v1.CreateFromPrefilteredData((a.environmentTexture.match(/https?:\/\//g) ? "" : t) + a.environmentTexture, A, a.environmentTextureForcedExtension);
        a.environmentTextureRotationY && (l.rotationY = a.environmentTextureRotationY), A.environmentTexture = l;
      }
      if (a.createDefaultSkybox === !0) {
        const l = A.activeCamera !== void 0 && A.activeCamera !== null ? (A.activeCamera.maxZ - A.activeCamera.minZ) / 2 : 1e3, P = a.skyboxBlurLevel || 0;
        A.createDefaultSkybox(A.environmentTexture, u, l, P);
      }
      i.environmentTexture = A.environmentTexture;
    }
    if (a.environmentIntensity !== void 0 && a.environmentIntensity !== null && (A.environmentIntensity = a.environmentIntensity), a.lights !== void 0 && a.lights !== null)
      for (o = 0, d = a.lights.length; o < d; o++) {
        const u = a.lights[o], l = ci.Parse(u, A);
        l && (EW[u.uniqueId] = l, i.lights.push(l), l._parentContainer = i, s += o === 0 ? `
	Lights:` : "", s += `
		` + l.toString(f));
      }
    if (a.reflectionProbes !== void 0 && a.reflectionProbes !== null)
      for (o = 0, d = a.reflectionProbes.length; o < d; o++) {
        const u = a.reflectionProbes[o], l = Im.Parse(u, A, t);
        l && (i.reflectionProbes.push(l), l._parentContainer = i, s += o === 0 ? `
	Reflection Probes:` : "", s += `
		` + l.toString(f));
      }
    if (a.animations !== void 0 && a.animations !== null)
      for (o = 0, d = a.animations.length; o < d; o++) {
        const u = a.animations[o], l = Jo("BABYLON.Animation");
        if (l) {
          const P = l.Parse(u);
          A.animations.push(P), i.animations.push(P), s += o === 0 ? `
	Animations:` : "", s += `
		` + P.toString(f);
        }
      }
    if (a.materials !== void 0 && a.materials !== null)
      for (o = 0, d = a.materials.length; o < d; o++) {
        const u = a.materials[o], l = gt.Parse(u, A, t);
        l && (nD[u.uniqueId || u.id] = l, i.materials.push(l), l._parentContainer = i, s += o === 0 ? `
	Materials:` : "", s += `
		` + l.toString(f), l.getActiveTextures().forEach((p) => {
          i.textures.indexOf(p) == -1 && (i.textures.push(p), p._parentContainer = i);
        }));
      }
    if (a.multiMaterials !== void 0 && a.multiMaterials !== null)
      for (o = 0, d = a.multiMaterials.length; o < d; o++) {
        const u = a.multiMaterials[o], l = Dc.ParseMultiMaterial(u, A);
        nD[u.uniqueId || u.id] = l, i.multiMaterials.push(l), l._parentContainer = i, s += o === 0 ? `
	MultiMaterials:` : "", s += `
		` + l.toString(f), l.getActiveTextures().forEach((p) => {
          i.textures.indexOf(p) == -1 && (i.textures.push(p), p._parentContainer = i);
        });
      }
    if (a.morphTargetManagers !== void 0 && a.morphTargetManagers !== null)
      for (const u of a.morphTargetManagers) {
        const l = U0.Parse(u, A);
        i.morphTargetManagers.push(l), l._parentContainer = i;
      }
    if (a.skeletons !== void 0 && a.skeletons !== null)
      for (o = 0, d = a.skeletons.length; o < d; o++) {
        const u = a.skeletons[o], l = r4.Parse(u, A);
        i.skeletons.push(l), l._parentContainer = i, s += o === 0 ? `
	Skeletons:` : "", s += `
		` + l.toString(f);
      }
    const v = a.geometries;
    if (v != null) {
      const u = new Array(), l = v.vertexData;
      if (l != null)
        for (o = 0, d = l.length; o < d; o++) {
          const P = l[o];
          u.push(Tf.Parse(P, A, t));
        }
      u.forEach((P) => {
        P && (i.geometries.push(P), P._parentContainer = i);
      });
    }
    if (a.transformNodes !== void 0 && a.transformNodes !== null)
      for (o = 0, d = a.transformNodes.length; o < d; o++) {
        const u = a.transformNodes[o], l = Hr.Parse(u, A, t);
        EW[u.uniqueId] = l, i.transformNodes.push(l), l._parentContainer = i;
      }
    if (a.meshes !== void 0 && a.meshes !== null)
      for (o = 0, d = a.meshes.length; o < d; o++) {
        const u = a.meshes[o], l = Ee.Parse(u, A, t);
        if (EW[u.uniqueId] = l, i.meshes.push(l), l._parentContainer = i, l.hasInstances)
          for (const P of l.instances)
            i.meshes.push(P), P._parentContainer = i;
        s += o === 0 ? `
	Meshes:` : "", s += `
		` + l.toString(f);
      }
    if (a.cameras !== void 0 && a.cameras !== null)
      for (o = 0, d = a.cameras.length; o < d; o++) {
        const u = a.cameras[o], l = Tr.Parse(u, A);
        EW[u.uniqueId] = l, i.cameras.push(l), l._parentContainer = i, s += o === 0 ? `
	Cameras:` : "", s += `
		` + l.toString(f);
      }
    if (a.postProcesses !== void 0 && a.postProcesses !== null)
      for (o = 0, d = a.postProcesses.length; o < d; o++) {
        const u = a.postProcesses[o], l = kr.Parse(u, A, t);
        l && (i.postProcesses.push(l), l._parentContainer = i, s += o === 0 ? `
Postprocesses:` : "", s += `
		` + l.toString());
      }
    if (a.animationGroups !== void 0 && a.animationGroups !== null)
      for (o = 0, d = a.animationGroups.length; o < d; o++) {
        const u = a.animationGroups[o], l = w0.Parse(u, A);
        i.animationGroups.push(l), l._parentContainer = i, s += o === 0 ? `
	AnimationGroups:` : "", s += `
		` + l.toString(f);
      }
    for (o = 0, d = A.cameras.length; o < d; o++) {
      const u = A.cameras[o];
      u._waitingParentId !== null && (u.parent = gC(u._waitingParentId, u._waitingParentInstanceIndex, A), u._waitingParentId = null, u._waitingParentInstanceIndex = null);
    }
    for (o = 0, d = A.lights.length; o < d; o++) {
      const u = A.lights[o];
      u && u._waitingParentId !== null && (u.parent = gC(u._waitingParentId, u._waitingParentInstanceIndex, A), u._waitingParentId = null, u._waitingParentInstanceIndex = null);
    }
    for (o = 0, d = A.transformNodes.length; o < d; o++) {
      const u = A.transformNodes[o];
      u._waitingParentId !== null && (u.parent = gC(u._waitingParentId, u._waitingParentInstanceIndex, A), u._waitingParentId = null, u._waitingParentInstanceIndex = null);
    }
    for (o = 0, d = A.meshes.length; o < d; o++) {
      const u = A.meshes[o];
      u._waitingParentId !== null && (u.parent = gC(u._waitingParentId, u._waitingParentInstanceIndex, A), u._waitingParentId = null, u._waitingParentInstanceIndex = null), u._waitingData.lods && Gte(A, u);
    }
    for (A.multiMaterials.forEach((u) => {
      u._waitingSubMaterialsUniqueIds.forEach((l) => {
        u.subMaterials.push(aO(l, A));
      }), u._waitingSubMaterialsUniqueIds = [];
    }), A.meshes.forEach((u) => {
      u._waitingMaterialId !== null && (u.material = aO(u._waitingMaterialId, A), u._waitingMaterialId = null);
    }), o = 0, d = A.skeletons.length; o < d; o++) {
      const u = A.skeletons[o];
      u._hasWaitingData && (u.bones != null && u.bones.forEach((l) => {
        if (l._waitingTransformNodeId) {
          const P = A.getLastEntryById(l._waitingTransformNodeId);
          P && l.linkTransformNode(P), l._waitingTransformNodeId = null;
        }
      }), u._hasWaitingData = null);
    }
    for (o = 0, d = A.meshes.length; o < d; o++) {
      const u = A.meshes[o];
      u._waitingData.freezeWorldMatrix ? (u.freezeWorldMatrix(), u._waitingData.freezeWorldMatrix = null) : u.computeWorldMatrix(!0);
    }
    for (o = 0, d = A.lights.length; o < d; o++) {
      const u = A.lights[o];
      if (u._excludedMeshesIds.length > 0) {
        for (let l = 0; l < u._excludedMeshesIds.length; l++) {
          const P = A.getMeshById(u._excludedMeshesIds[l]);
          P && u.excludedMeshes.push(P);
        }
        u._excludedMeshesIds = [];
      }
      if (u._includedOnlyMeshesIds.length > 0) {
        for (let l = 0; l < u._includedOnlyMeshesIds.length; l++) {
          const P = A.getMeshById(u._includedOnlyMeshesIds[l]);
          P && u.includedOnlyMeshes.push(P);
        }
        u._includedOnlyMeshesIds = [];
      }
    }
    for (A.geometries.forEach((u) => {
      u._loadedUniqueId = "";
    }), J1.Parse(a, A, i, t), o = 0, d = A.meshes.length; o < d; o++) {
      const u = A.meshes[o];
      u._waitingData.actions && (Rs.Parse(u._waitingData.actions, u, A), u._waitingData.actions = null);
    }
    a.actions !== void 0 && a.actions !== null && Rs.Parse(a.actions, null, A);
  } catch (f) {
    const o = YW("loadAssets", a ? a.producer : "Unknown") + s;
    if (r)
      r(o, f);
    else
      throw Se.Log(o), f;
  } finally {
    EW = {}, nD = {}, n || i.removeAllFromScene(), s !== null && Hn.loggingLevel !== Hn.NO_LOGGING && Se.Log(YW("loadAssets", a ? a.producer : "Unknown") + (Hn.loggingLevel !== Hn.MINIMAL_LOGGING ? s : ""));
  }
  return i;
};
Hn.RegisterPlugin({
  name: "babylon.js",
  extensions: ".babylon",
  canDirectLoad: (A) => A.indexOf("babylon") !== -1,
  importMesh: (A, e, t, r, n, i, s, a) => {
    var f;
    let o = "importMesh has failed JSON parse";
    try {
      var d = JSON.parse(t);
      o = "";
      const v = Hn.loggingLevel === Hn.DETAILED_LOGGING;
      A ? Array.isArray(A) || (A = [A]) : A = null;
      const u = [], l = /* @__PURE__ */ new Map(), P = [];
      if (d.transformNodes !== void 0 && d.transformNodes !== null)
        for (let p = 0, c = d.transformNodes.length; p < c; p++) {
          const H = d.transformNodes[p], T = Hr.Parse(H, e, r);
          P.push(T), l.set(T._waitingParsedUniqueId, T), T._waitingParsedUniqueId = null;
        }
      if (d.meshes !== void 0 && d.meshes !== null) {
        const p = [], c = [], H = [], T = [];
        for (let b = 0, j = d.meshes.length; b < j; b++) {
          const w = d.meshes[b];
          if (A === null || qpe(w, A, u)) {
            if (A !== null && delete A[A.indexOf(w.name)], w.geometryId !== void 0 && w.geometryId !== null && d.geometries !== void 0 && d.geometries !== null) {
              let I = !1;
              ["boxes", "spheres", "cylinders", "toruses", "grounds", "planes", "torusKnots", "vertexData"].forEach((N) => {
                I === !0 || !d.geometries[N] || !Array.isArray(d.geometries[N]) || d.geometries[N].forEach((k) => {
                  if (k.id === w.geometryId) {
                    switch (N) {
                      case "vertexData":
                        Tf.Parse(k, e, r);
                        break;
                    }
                    I = !0;
                  }
                });
              }), I === !1 && Se.Warn("Geometry not found for mesh " + w.id);
            }
            if (w.materialUniqueId || w.materialId) {
              const I = w.materialUniqueId ? H : c;
              let N = I.indexOf(w.materialUniqueId || w.materialId) !== -1;
              if (N === !1 && d.multiMaterials !== void 0 && d.multiMaterials !== null) {
                const k = (R, y) => {
                  I.push(R);
                  const O = LG(y, d, e, r);
                  O && O.material && (nD[O.parsedMaterial.uniqueId || O.parsedMaterial.id] = O.material, o += `
	Material ` + O.material.toString(v));
                };
                for (let R = 0, y = d.multiMaterials.length; R < y; R++) {
                  const O = d.multiMaterials[R];
                  if (w.materialUniqueId && O.uniqueId === w.materialUniqueId || O.id === w.materialId) {
                    O.materialsUniqueIds ? O.materialsUniqueIds.forEach((ee) => k(ee, (Z) => Z.uniqueId === ee)) : O.materials.forEach((ee) => k(ee, (Z) => Z.id === ee)), I.push(O.uniqueId || O.id);
                    const Y = Dc.ParseMultiMaterial(O, e);
                    nD[O.uniqueId || O.id] = Y, Y && (N = !0, o += `
	Multi-Material ` + Y.toString(v));
                    break;
                  }
                }
              }
              if (N === !1) {
                I.push(w.materialUniqueId || w.materialId);
                const k = LG((R) => w.materialUniqueId && R.uniqueId === w.materialUniqueId || R.id === w.materialId, d, e, r);
                !k || !k.material ? Se.Warn("Material not found for mesh " + w.id) : (nD[k.parsedMaterial.uniqueId || k.parsedMaterial.id] = k.material, o += `
	Material ` + k.material.toString(v));
              }
            }
            if (w.skeletonId !== null && w.skeletonId !== void 0 && d.skeletonId !== -1 && d.skeletons !== void 0 && d.skeletons !== null && !(p.indexOf(w.skeletonId) > -1))
              for (let N = 0, k = d.skeletons.length; N < k; N++) {
                const R = d.skeletons[N];
                if (R.id === w.skeletonId) {
                  const y = r4.Parse(R, e);
                  s.push(y), p.push(R.id), o += `
	Skeleton ` + y.toString(v);
                }
              }
            if (w.morphTargetManagerId > -1 && d.morphTargetManagers !== void 0 && d.morphTargetManagers !== null && !(T.indexOf(w.morphTargetManagerId) > -1))
              for (let N = 0, k = d.morphTargetManagers.length; N < k; N++) {
                const R = d.morphTargetManagers[N];
                if (R.id === w.morphTargetManagerId) {
                  const y = U0.Parse(R, e);
                  T.push(y.uniqueId), o += `
Morph target ` + y.toString();
                }
              }
            const m = Ee.Parse(w, e, r);
            n.push(m), l.set(m._waitingParsedUniqueId, m), m._waitingParsedUniqueId = null, o += `
	Mesh ` + m.toString(v);
          }
        }
        e.multiMaterials.forEach((b) => {
          b._waitingSubMaterialsUniqueIds.forEach((j) => {
            b.subMaterials.push(aO(j, e));
          }), b._waitingSubMaterialsUniqueIds = [];
        }), e.meshes.forEach((b) => {
          b._waitingMaterialId !== null && (b.material = aO(b._waitingMaterialId, e), b._waitingMaterialId = null);
        });
        for (let b = 0, j = e.transformNodes.length; b < j; b++) {
          const w = e.transformNodes[b];
          if (w._waitingParentId !== null) {
            let m = l.get(parseInt(w._waitingParentId)) || null;
            m === null && (m = e.getLastEntryById(w._waitingParentId));
            let I = m;
            w._waitingParentInstanceIndex && (I = m.instances[parseInt(w._waitingParentInstanceIndex)], w._waitingParentInstanceIndex = null), w.parent = I, w._waitingParentId = null;
          }
        }
        let q;
        for (let b = 0, j = e.meshes.length; b < j; b++) {
          if (q = e.meshes[b], q._waitingParentId) {
            let w = l.get(parseInt(q._waitingParentId)) || null;
            w === null && (w = e.getLastEntryById(q._waitingParentId));
            let m = w;
            if (q._waitingParentInstanceIndex && (m = w.instances[parseInt(q._waitingParentInstanceIndex)], q._waitingParentInstanceIndex = null), q.parent = m, ((f = q.parent) === null || f === void 0 ? void 0 : f.getClassName()) === "TransformNode") {
              const I = P.indexOf(q.parent);
              I > -1 && P.splice(I, 1);
            }
            q._waitingParentId = null;
          }
          q._waitingData.lods && Gte(e, q);
        }
        for (const b of P)
          b.dispose();
        for (let b = 0, j = e.skeletons.length; b < j; b++) {
          const w = e.skeletons[b];
          w._hasWaitingData && (w.bones != null && w.bones.forEach((m) => {
            if (m._waitingTransformNodeId) {
              const I = e.getLastEntryById(m._waitingTransformNodeId);
              I && m.linkTransformNode(I), m._waitingTransformNodeId = null;
            }
          }), w._hasWaitingData = null);
        }
        for (let b = 0, j = e.meshes.length; b < j; b++)
          q = e.meshes[b], q._waitingData.freezeWorldMatrix ? (q.freezeWorldMatrix(), q._waitingData.freezeWorldMatrix = null) : q.computeWorldMatrix(!0);
      }
      if (d.particleSystems !== void 0 && d.particleSystems !== null) {
        const p = J1.GetIndividualParser(Ot.NAME_PARTICLESYSTEM);
        if (p)
          for (let c = 0, H = d.particleSystems.length; c < H; c++) {
            const T = d.particleSystems[c];
            u.indexOf(T.emitterId) !== -1 && i.push(p(T, e, r));
          }
      }
      return e.geometries.forEach((p) => {
        p._loadedUniqueId = "";
      }), !0;
    } catch (v) {
      const u = YW("importMesh", d ? d.producer : "Unknown") + o;
      if (a)
        a(u, v);
      else
        throw Se.Log(u), v;
    } finally {
      o !== null && Hn.loggingLevel !== Hn.NO_LOGGING && Se.Log(YW("importMesh", d ? d.producer : "Unknown") + (Hn.loggingLevel !== Hn.MINIMAL_LOGGING ? o : "")), nD = {};
    }
    return !1;
  },
  load: (A, e, t, r) => {
    let n = "importScene has failed JSON parse";
    try {
      var i = JSON.parse(e);
      if (n = "", i.useDelayedTextureLoading !== void 0 && i.useDelayedTextureLoading !== null && (A.useDelayedTextureLoading = i.useDelayedTextureLoading && !Hn.ForceFullSceneLoadingForIncremental), i.autoClear !== void 0 && i.autoClear !== null && (A.autoClear = i.autoClear), i.clearColor !== void 0 && i.clearColor !== null && (A.clearColor = xt.FromArray(i.clearColor)), i.ambientColor !== void 0 && i.ambientColor !== null && (A.ambientColor = Ne.FromArray(i.ambientColor)), i.gravity !== void 0 && i.gravity !== null && (A.gravity = S.FromArray(i.gravity)), i.useRightHandedSystem !== void 0 && (A.useRightHandedSystem = !!i.useRightHandedSystem), i.fogMode && i.fogMode !== 0)
        switch (A.fogMode = i.fogMode, A.fogColor = Ne.FromArray(i.fogColor), A.fogStart = i.fogStart, A.fogEnd = i.fogEnd, A.fogDensity = i.fogDensity, n += "	Fog mode for scene:  ", A.fogMode) {
          case 1:
            n += `exp
`;
            break;
          case 2:
            n += `exp2
`;
            break;
          case 3:
            n += `linear
`;
            break;
        }
      if (i.physicsEnabled) {
        let a;
        i.physicsEngine === "cannon" || i.physicsEngine === sO.name ? a = new sO(void 0, void 0, SI.LoaderInjectedPhysicsEngine) : i.physicsEngine === "oimo" || i.physicsEngine === gF.name ? a = new gF(void 0, SI.LoaderInjectedPhysicsEngine) : (i.physicsEngine === "ammo" || i.physicsEngine === eg.name) && (a = new eg(void 0, SI.LoaderInjectedPhysicsEngine, void 0)), n = "	Physics engine " + (i.physicsEngine ? i.physicsEngine : "oimo") + ` enabled
`;
        const f = i.physicsGravity ? S.FromArray(i.physicsGravity) : null;
        A.enablePhysics(f, a);
      }
      return i.metadata !== void 0 && i.metadata !== null && (A.metadata = i.metadata), i.collisionsEnabled !== void 0 && i.collisionsEnabled !== null && (A.collisionsEnabled = i.collisionsEnabled), KG(A, e, t, r, !0) ? (i.autoAnimate && A.beginAnimation(A, i.autoAnimateFrom, i.autoAnimateTo, i.autoAnimateLoop, i.autoAnimateSpeed || 1), i.activeCameraID !== void 0 && i.activeCameraID !== null && A.setActiveCameraById(i.activeCameraID), !0) : !1;
    } catch (s) {
      const a = YW("importScene", i ? i.producer : "Unknown") + n;
      if (r)
        r(a, s);
      else
        throw Se.Log(a), s;
    } finally {
      n !== null && Hn.loggingLevel !== Hn.NO_LOGGING && Se.Log(YW("importScene", i ? i.producer : "Unknown") + (Hn.loggingLevel !== Hn.MINIMAL_LOGGING ? n : ""));
    }
    return !1;
  },
  loadAssetContainer: (A, e, t, r) => KG(A, e, t, r)
});
class GI {
  /**
   * Define if the fresnel effect is enable or not.
   */
  get isEnabled() {
    return this._isEnabled;
  }
  set isEnabled(e) {
    this._isEnabled !== e && (this._isEnabled = e, Ge.MarkAllMaterialsAsDirty(20));
  }
  /**
   * Creates a new FresnelParameters object.
   *
   * @param options provide your own settings to optionally to override defaults
   */
  constructor(e = {}) {
    this._isEnabled = !0, this.bias = e.bias === void 0 ? 0 : e.bias, this.power = e.power === void 0 ? 1 : e.power, this.leftColor = e.leftColor || Ne.White(), this.rightColor = e.rightColor || Ne.Black(), e.isEnabled === !1 && (this.isEnabled = !1);
  }
  /**
   * Clones the current fresnel and its values
   * @returns a clone fresnel configuration
   */
  clone() {
    const e = new GI();
    return sA.DeepCopy(this, e), e;
  }
  /**
   * Determines equality between FresnelParameters objects
   * @param otherFresnelParameters defines the second operand
   * @returns true if the power, bias, leftColor, rightColor and isEnabled values are equal to the given ones
   */
  equals(e) {
    return e && this.bias === e.bias && this.power === e.power && this.leftColor.equals(e.leftColor) && this.rightColor.equals(e.rightColor) && this.isEnabled === e.isEnabled;
  }
  /**
   * Serializes the current fresnel parameters to a JSON representation.
   * @returns the JSON serialization
   */
  serialize() {
    return {
      isEnabled: this.isEnabled,
      leftColor: this.leftColor.asArray(),
      rightColor: this.rightColor.asArray(),
      bias: this.bias,
      power: this.power
    };
  }
  /**
   * Parse a JSON object and deserialize it to a new Fresnel parameter object.
   * @param parsedFresnelParameters Define the JSON representation
   * @returns the parsed parameters
   */
  static Parse(e) {
    return new GI({
      isEnabled: e.isEnabled,
      leftColor: Ne.FromArray(e.leftColor),
      rightColor: Ne.FromArray(e.rightColor),
      bias: e.bias,
      power: e.power || 1
    });
  }
}
jt._FresnelParametersParser = GI.Parse;
class bpe extends Zo {
  constructor(e, t) {
    super(e, t, "color", {
      attributes: ["position"],
      uniforms: ["world", "viewProjection", "color"]
    }), this.disableColorWrite = !0, this.forceDepthWrite = !0, this.setColor4("color", new xt(0, 0, 0, 1));
  }
}
class Yv extends fs {
  /**
   * Gets the current double sided mode.
   */
  get doubleSided() {
    return this._twoSidedLighting;
  }
  /**
   * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
   */
  set doubleSided(e) {
    this._twoSidedLighting !== e && (this._twoSidedLighting = e, this.backFaceCulling = !e, this._markAllSubMeshesAsTexturesDirty());
  }
  /**
   * Instantiates a new PBRMaterial instance.
   *
   * @param name The material name
   * @param scene The scene the material will be use in.
   */
  constructor(e, t) {
    super(e, t), this.maxSimultaneousLights = 4, this.disableLighting = !1, this.invertNormalMapX = !1, this.invertNormalMapY = !1, this.emissiveColor = new Ne(0, 0, 0), this.occlusionStrength = 1, this.useLightmapAsShadowmap = !1, this._useAlphaFromAlbedoTexture = !0, this._useAmbientInGrayScale = !0;
  }
  getClassName() {
    return "PBRBaseSimpleMaterial";
  }
}
C([
  M(),
  At("_markAllSubMeshesAsLightsDirty")
], Yv.prototype, "maxSimultaneousLights", void 0);
C([
  M(),
  At("_markAllSubMeshesAsLightsDirty")
], Yv.prototype, "disableLighting", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty", "_reflectionTexture")
], Yv.prototype, "environmentTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], Yv.prototype, "invertNormalMapX", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], Yv.prototype, "invertNormalMapY", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty", "_bumpTexture")
], Yv.prototype, "normalTexture", void 0);
C([
  Oi("emissive"),
  At("_markAllSubMeshesAsTexturesDirty")
], Yv.prototype, "emissiveColor", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty")
], Yv.prototype, "emissiveTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty", "_ambientTextureStrength")
], Yv.prototype, "occlusionStrength", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty", "_ambientTexture")
], Yv.prototype, "occlusionTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty", "_alphaCutOff")
], Yv.prototype, "alphaCutOff", void 0);
C([
  M()
], Yv.prototype, "doubleSided", null);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty", null)
], Yv.prototype, "lightmapTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], Yv.prototype, "useLightmapAsShadowmap", void 0);
class s4 extends Yv {
  /**
   * Instantiates a new PBRMetalRoughnessMaterial instance.
   *
   * @param name The material name
   * @param scene The scene the material will be use in.
   */
  constructor(e, t) {
    super(e, t), this._useRoughnessFromMetallicTextureAlpha = !1, this._useRoughnessFromMetallicTextureGreen = !0, this._useMetallnessFromMetallicTextureBlue = !0, this.metallic = 1, this.roughness = 1;
  }
  /**
   * Return the current class name of the material.
   */
  getClassName() {
    return "PBRMetallicRoughnessMaterial";
  }
  /**
   * Makes a duplicate of the current material.
   * @param name - name to use for the new material.
   */
  clone(e) {
    const t = jt.Clone(() => new s4(e, this.getScene()), this);
    return t.id = e, t.name = e, this.clearCoat.copyTo(t.clearCoat), this.anisotropy.copyTo(t.anisotropy), this.brdf.copyTo(t.brdf), this.sheen.copyTo(t.sheen), this.subSurface.copyTo(t.subSurface), t;
  }
  /**
   * Serialize the material to a parsable JSON object.
   */
  serialize() {
    const e = jt.Serialize(this);
    return e.customType = "BABYLON.PBRMetallicRoughnessMaterial", e.clearCoat = this.clearCoat.serialize(), e.anisotropy = this.anisotropy.serialize(), e.brdf = this.brdf.serialize(), e.sheen = this.sheen.serialize(), e.subSurface = this.subSurface.serialize(), e.iridescence = this.iridescence.serialize(), e;
  }
  /**
   * Parses a JSON object corresponding to the serialize function.
   * @param source
   * @param scene
   * @param rootUrl
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => new s4(e.name, t), e, t, r);
    return e.clearCoat && n.clearCoat.parse(e.clearCoat, t, r), e.anisotropy && n.anisotropy.parse(e.anisotropy, t, r), e.brdf && n.brdf.parse(e.brdf, t, r), e.sheen && n.sheen.parse(e.sheen, t, r), e.subSurface && n.subSurface.parse(e.subSurface, t, r), e.iridescence && n.iridescence.parse(e.iridescence, t, r), n;
  }
}
C([
  Oi(),
  At("_markAllSubMeshesAsTexturesDirty", "_albedoColor")
], s4.prototype, "baseColor", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty", "_albedoTexture")
], s4.prototype, "baseTexture", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], s4.prototype, "metallic", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], s4.prototype, "roughness", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty", "_metallicTexture")
], s4.prototype, "metallicRoughnessTexture", void 0);
Ue("BABYLON.PBRMetallicRoughnessMaterial", s4);
class a4 extends Yv {
  /**
   * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.
   */
  get useMicroSurfaceFromReflectivityMapAlpha() {
    return this._useMicroSurfaceFromReflectivityMapAlpha;
  }
  /**
   * Instantiates a new PBRSpecularGlossinessMaterial instance.
   *
   * @param name The material name
   * @param scene The scene the material will be use in.
   */
  constructor(e, t) {
    super(e, t), this._useMicroSurfaceFromReflectivityMapAlpha = !0;
  }
  /**
   * Return the current class name of the material.
   */
  getClassName() {
    return "PBRSpecularGlossinessMaterial";
  }
  /**
   * Makes a duplicate of the current material.
   * @param name - name to use for the new material.
   */
  clone(e) {
    const t = jt.Clone(() => new a4(e, this.getScene()), this);
    return t.id = e, t.name = e, this.clearCoat.copyTo(t.clearCoat), this.anisotropy.copyTo(t.anisotropy), this.brdf.copyTo(t.brdf), this.sheen.copyTo(t.sheen), this.subSurface.copyTo(t.subSurface), t;
  }
  /**
   * Serialize the material to a parsable JSON object.
   */
  serialize() {
    const e = jt.Serialize(this);
    return e.customType = "BABYLON.PBRSpecularGlossinessMaterial", e.clearCoat = this.clearCoat.serialize(), e.anisotropy = this.anisotropy.serialize(), e.brdf = this.brdf.serialize(), e.sheen = this.sheen.serialize(), e.subSurface = this.subSurface.serialize(), e.iridescence = this.iridescence.serialize(), e;
  }
  /**
   * Parses a JSON object corresponding to the serialize function.
   * @param source
   * @param scene
   * @param rootUrl
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => new a4(e.name, t), e, t, r);
    return e.clearCoat && n.clearCoat.parse(e.clearCoat, t, r), e.anisotropy && n.anisotropy.parse(e.anisotropy, t, r), e.brdf && n.brdf.parse(e.brdf, t, r), e.sheen && n.sheen.parse(e.sheen, t, r), e.subSurface && n.subSurface.parse(e.subSurface, t, r), e.iridescence && n.iridescence.parse(e.iridescence, t, r), n;
  }
}
C([
  Oi("diffuse"),
  At("_markAllSubMeshesAsTexturesDirty", "_albedoColor")
], a4.prototype, "diffuseColor", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty", "_albedoTexture")
], a4.prototype, "diffuseTexture", void 0);
C([
  Oi("specular"),
  At("_markAllSubMeshesAsTexturesDirty", "_reflectivityColor")
], a4.prototype, "specularColor", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty", "_microSurface")
], a4.prototype, "glossiness", void 0);
C([
  en(),
  At("_markAllSubMeshesAsTexturesDirty", "_reflectivityTexture")
], a4.prototype, "specularGlossinessTexture", void 0);
Ue("BABYLON.PBRSpecularGlossinessMaterial", a4);
class PD extends ls {
  /**
   * Instantiates a ColorGradingTexture from the following parameters.
   *
   * @param url The location of the color grading data (currently only supporting 3dl)
   * @param sceneOrEngine The scene or engine the texture will be used in
   * @param onLoad defines a callback triggered when the texture has been loaded
   */
  constructor(e, t, r = null) {
    if (super(t), !!e)
      if (this._textureMatrix = he.Identity(), this.name = e, this.url = e, this._onLoad = r, this._texture = this._getFromCache(e, !0), this._texture)
        this._triggerOnLoad();
      else {
        const n = this.getScene();
        n ? n.useDelayedTextureLoading ? this.delayLoadState = 4 : this._loadTexture() : this._loadTexture();
      }
  }
  /**
   * Fires the onload event from the constructor if requested.
   */
  _triggerOnLoad() {
    this._onLoad && this._onLoad();
  }
  /**
   * Returns the texture matrix used in most of the material.
   * This is not used in color grading but keep for troubleshooting purpose (easily swap diffuse by colorgrading to look in).
   */
  getTextureMatrix() {
    return this._textureMatrix;
  }
  /**
   * Occurs when the file being loaded is a .3dl LUT file.
   */
  _load3dlTexture() {
    const e = this._getEngine();
    let t;
    e._features.support3DTextures ? t = e.createRawTexture3D(null, 1, 1, 1, 5, !1, !1, 2, null, 0) : t = e.createRawTexture(null, 1, 1, 5, !1, !1, 2, null, 0), this._texture = t, this._texture.isReady = !1, this.isCube = !1, this.is3D = e._features.support3DTextures, this.wrapU = 0, this.wrapV = 0, this.wrapR = 0, this.anisotropicFilteringLevel = 1;
    const r = (i) => {
      if (typeof i != "string")
        return;
      let s = null, a = null, f;
      const o = i.split(`
`);
      let d = 0, v = 0, u = 0, l = 0, P = 0;
      for (let p = 0; p < o.length; p++) {
        if (f = o[p], !PD._NoneEmptyLineRegex.test(f) || f.indexOf("#") === 0)
          continue;
        const c = f.split(" ");
        if (d === 0) {
          d = c.length, s = new Uint8Array(d * d * d * 4), a = new Float32Array(d * d * d * 4);
          continue;
        }
        if (d != 0) {
          const H = Math.max(parseInt(c[0]), 0), T = Math.max(parseInt(c[1]), 0), q = Math.max(parseInt(c[2]), 0);
          P = Math.max(H, P), P = Math.max(T, P), P = Math.max(q, P);
          const b = (v + l * d + u * d * d) * 4;
          a && (a[b + 0] = H, a[b + 1] = T, a[b + 2] = q), u++, u % d == 0 && (l++, u = 0, l % d == 0 && (v++, l = 0));
        }
      }
      if (a && s)
        for (let p = 0; p < a.length; p++)
          if (p > 0 && (p + 1) % 4 === 0)
            s[p] = 255;
          else {
            const c = a[p];
            s[p] = c / P * 255;
          }
      t.is3D ? (t.updateSize(d, d, d), e.updateRawTexture3D(t, s, 5, !1)) : (t.updateSize(d * d, d), e.updateRawTexture(t, s, 5, !1)), t.isReady = !0, this._triggerOnLoad();
    }, n = this.getScene();
    return n ? n._loadFile(this.url, r) : e._loadFile(this.url, r), this._texture;
  }
  /**
   * Starts the loading process of the texture.
   */
  _loadTexture() {
    this.url && this.url.toLocaleLowerCase().indexOf(".3dl") == this.url.length - 4 && this._load3dlTexture();
  }
  /**
   * Clones the color grading texture.
   */
  clone() {
    const e = new PD(this.url, this.getScene() || this._getEngine());
    return e.level = this.level, e;
  }
  /**
   * Called during delayed load for textures.
   */
  delayLoad() {
    this.delayLoadState === 4 && (this.delayLoadState = 1, this._texture = this._getFromCache(this.url, !0), this._texture || this._loadTexture());
  }
  /**
   * Parses a color grading texture serialized by Babylon.
   * @param parsedTexture The texture information being parsedTexture
   * @param scene The scene to load the texture in
   * @returns A color grading texture
   */
  static Parse(e, t) {
    let r = null;
    return e.name && !e.isRenderTarget && (r = new PD(e.name, t), r.name = e.name, r.level = e.level), r;
  }
  /**
   * Serializes the LUT texture to json format.
   */
  serialize() {
    if (!this.name)
      return null;
    const e = {};
    return e.name = this.name, e.level = this.level, e.customType = "BABYLON.ColorGradingTexture", e;
  }
}
PD._NoneEmptyLineRegex = /\S+/;
Ue("BABYLON.ColorGradingTexture", PD);
class VS extends ls {
  /**
   * Instantiates an EquiRectangularCubeTexture from the following parameters.
   * @param url The location of the image
   * @param scene The scene the texture will be used in
   * @param size The cubemap desired size (the more it increases the longer the generation will be)
   * @param noMipmap Forces to not generate the mipmap if true
   * @param gammaSpace Specifies if the texture will be used in gamma or linear space
   * (the PBR material requires those textures in linear space, but the standard material would require them in Gamma space)
   * @param onLoad — defines a callback called when texture is loaded
   * @param onError — defines a callback called if there is an error
   */
  constructor(e, t, r, n = !1, i = !0, s = null, a = null, f = !1) {
    if (super(t), this._onLoad = null, this._onError = null, !e)
      throw new Error("Image url is not set");
    this._coordinatesMode = We.CUBIC_MODE, this.name = e, this.url = e, this._size = r, this._supersample = f, this._noMipmap = n, this.gammaSpace = i, this._onLoad = s, this._onError = a, this.hasAlpha = !1, this.isCube = !0, this._texture = this._getFromCache(e, this._noMipmap, void 0, void 0, void 0, this.isCube), this._texture ? s && (this._texture.isReady ? ye.SetImmediate(() => s()) : this._texture.onLoadedObservable.add(s)) : t.useDelayedTextureLoading ? this.delayLoadState = 4 : this._loadImage(() => this._loadTexture(), this._onError);
  }
  /**
   * Load the image data, by putting the image on a canvas and extracting its buffer.
   * @param loadTextureCallback
   * @param onError
   */
  _loadImage(e, t) {
    const r = this.getScene();
    if (!r)
      return;
    const n = r.getEngine().createRawCubeTexture(null, this._size, 4, r.getEngine().getCaps().textureFloat ? 1 : 7, this._noMipmap, !1, 3);
    n.generateMipMaps = !this._noMipmap, r.addPendingData(n), n.url = this.url, n.isReady = !1, r.getEngine()._internalTexturesCache.push(n), this._texture = n;
    const i = document.createElement("canvas");
    nU(this.url, (s) => {
      this._width = s.width, this._height = s.height, i.width = this._width, i.height = this._height;
      const a = i.getContext("2d");
      a.drawImage(s, 0, 0);
      const f = a.getImageData(0, 0, s.width, s.height);
      this._buffer = f.data.buffer, i.remove(), e();
    }, (s, a) => {
      r.removePendingData(n), t && t(`${this.getClassName()} could not be loaded`, a);
    }, r ? r.offlineProvider : null);
  }
  /**
   * Convert the image buffer into a cubemap and create a CubeTexture.
   */
  _loadTexture() {
    const e = this.getScene(), t = () => {
      const i = this._getFloat32ArrayFromArrayBuffer(this._buffer), s = wq.ConvertPanoramaToCubemap(i, this._width, this._height, this._size, this._supersample), a = [];
      for (let f = 0; f < 6; f++) {
        const o = s[VS._FacesMapping[f]];
        a.push(o);
      }
      return a;
    };
    if (!e)
      return;
    const r = t(), n = this._texture;
    e.getEngine().updateRawCubeTexture(n, r, n.format, n.type, n.invertY), n.isReady = !0, e.removePendingData(n), n.onLoadedObservable.notifyObservers(n), n.onLoadedObservable.clear(), this._onLoad && this._onLoad();
  }
  /**
   * Convert the ArrayBuffer into a Float32Array and drop the transparency channel.
   * @param buffer The ArrayBuffer that should be converted.
   * @returns The buffer as Float32Array.
   */
  _getFloat32ArrayFromArrayBuffer(e) {
    const t = new DataView(e), r = new Float32Array(e.byteLength * 3 / 4);
    let n = 0;
    for (let i = 0; i < e.byteLength; i++)
      (i + 1) % 4 !== 0 && (r[n++] = t.getUint8(i) / 255);
    return r;
  }
  /**
   * Get the current class name of the texture useful for serialization or dynamic coding.
   * @returns "EquiRectangularCubeTexture"
   */
  getClassName() {
    return "EquiRectangularCubeTexture";
  }
  /**
   * Create a clone of the current EquiRectangularCubeTexture and return it.
   * @returns A clone of the current EquiRectangularCubeTexture.
   */
  clone() {
    const e = this.getScene();
    if (!e)
      return this;
    const t = new VS(this.url, e, this._size, this._noMipmap, this.gammaSpace);
    return t.level = this.level, t.wrapU = this.wrapU, t.wrapV = this.wrapV, t.coordinatesIndex = this.coordinatesIndex, t.coordinatesMode = this.coordinatesMode, t;
  }
}
VS._FacesMapping = ["right", "left", "up", "down", "front", "back"];
class cy extends ls {
  /**
   * Instantiates a HtmlElementTexture from the following parameters.
   *
   * @param name Defines the name of the texture
   * @param element Defines the video or canvas the texture is filled with
   * @param options Defines the other none mandatory texture creation options
   */
  constructor(e, t, r) {
    var n, i;
    super(r.scene || r.engine), this.onLoadObservable = new Oe(), !(!t || !r.engine && !r.scene) && (r = Object.assign(Object.assign({}, cy._DefaultOptions), r), this._generateMipMaps = r.generateMipMaps, this._samplingMode = r.samplingMode, this._textureMatrix = he.Identity(), this._format = r.format, this.name = e, this.element = t, this._isVideo = !!t.getVideoPlaybackQuality, this._externalTexture = this._isVideo && (i = (n = this._engine) === null || n === void 0 ? void 0 : n.createExternalTexture(t)) !== null && i !== void 0 ? i : null, this.anisotropicFilteringLevel = 1, this._createInternalTexture());
  }
  _createInternalTexture() {
    let e = 0, t = 0;
    this._isVideo ? (e = this.element.videoWidth, t = this.element.videoHeight) : (e = this.element.width, t = this.element.height);
    const r = this._getEngine();
    r && (this._texture = r.createDynamicTexture(e, t, this._generateMipMaps, this._samplingMode), this._texture.format = this._format), this.update();
  }
  /**
   * Returns the texture matrix used in most of the material.
   */
  getTextureMatrix() {
    return this._textureMatrix;
  }
  /**
   * Updates the content of the texture.
   * @param invertY Defines whether the texture should be inverted on Y (false by default on video and true on canvas)
   */
  update(e = null) {
    const t = this._getEngine();
    if (this._texture == null || t == null)
      return;
    const r = this.isReady();
    if (this._isVideo) {
      const n = this.element;
      if (n.readyState < n.HAVE_CURRENT_DATA)
        return;
      t.updateVideoTexture(this._texture, this._externalTexture ? this._externalTexture : n, e === null ? !0 : e);
    } else {
      const n = this.element;
      t.updateDynamicTexture(this._texture, n, e === null ? !0 : e, !1, this._format);
    }
    !r && this.isReady() && this.onLoadObservable.notifyObservers(this);
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
    this.onLoadObservable.clear(), super.dispose();
  }
}
cy._DefaultOptions = {
  generateMipMaps: !1,
  samplingMode: 2,
  format: 5,
  engine: null,
  scene: null
};
const xpe = 1, Dpe = 2, jpe = 3, wpe = 9, mpe = 10, Bpe = 11, Wpe = 48, Spe = 4, Upe = 0, Ipe = 1, Rpe = 2, Vpe = 3;
function sV(A) {
  let e = 0;
  return {
    id_length: A[e++],
    colormap_type: A[e++],
    image_type: A[e++],
    colormap_index: A[e++] | A[e++] << 8,
    colormap_length: A[e++] | A[e++] << 8,
    colormap_size: A[e++],
    origin: [A[e++] | A[e++] << 8, A[e++] | A[e++] << 8],
    width: A[e++] | A[e++] << 8,
    height: A[e++] | A[e++] << 8,
    pixel_size: A[e++],
    flags: A[e++]
  };
}
function eY(A, e) {
  if (e.length < 19) {
    Se.Error("Unable to load TGA file - Not enough data to contain header");
    return;
  }
  let t = 18;
  const r = sV(e);
  if (r.id_length + t > e.length) {
    Se.Error("Unable to load TGA file - Not enough data");
    return;
  }
  t += r.id_length;
  let n = !1, i = !1, s = !1;
  switch (r.image_type) {
    case wpe:
      n = !0;
    case xpe:
      i = !0;
      break;
    case mpe:
      n = !0;
    case Dpe:
      break;
    case Bpe:
      n = !0;
    case jpe:
      s = !0;
      break;
  }
  let a;
  const f = r.pixel_size >> 3, o = r.width * r.height * f;
  let d;
  if (i && (d = e.subarray(t, t += r.colormap_length * (r.colormap_size >> 3))), n) {
    a = new Uint8Array(o);
    let b, j, w, m = 0;
    const I = new Uint8Array(f);
    for (; t < o && m < o; )
      if (b = e[t++], j = (b & 127) + 1, b & 128) {
        for (w = 0; w < f; ++w)
          I[w] = e[t++];
        for (w = 0; w < j; ++w)
          a.set(I, m + w * f);
        m += f * j;
      } else {
        for (j *= f, w = 0; w < j; ++w)
          a[m + w] = e[t++];
        m += j;
      }
  } else
    a = e.subarray(t, t += i ? r.width * r.height : o);
  let v, u, l, P, p, c;
  switch ((r.flags & Wpe) >> Spe) {
    default:
    case Rpe:
      v = 0, l = 1, c = r.width, u = 0, P = 1, p = r.height;
      break;
    case Upe:
      v = 0, l = 1, c = r.width, u = r.height - 1, P = -1, p = -1;
      break;
    case Vpe:
      v = r.width - 1, l = -1, c = -1, u = 0, P = 1, p = r.height;
      break;
    case Ipe:
      v = r.width - 1, l = -1, c = -1, u = r.height - 1, P = -1, p = -1;
      break;
  }
  const H = "_getImageData" + (s ? "Grey" : "") + r.pixel_size + "bits", T = Zte[H](r, d, a, u, P, p, v, l, c);
  A.getEngine()._uploadDataToTextureDirectly(A, T);
}
function Cpe(A, e, t, r, n, i, s, a, f) {
  const o = t, d = e, v = A.width, u = A.height;
  let l, P = 0, p, c;
  const H = new Uint8Array(v * u * 4);
  for (c = r; c !== i; c += n)
    for (p = s; p !== f; p += a, P++)
      l = o[P], H[(p + v * c) * 4 + 3] = 255, H[(p + v * c) * 4 + 2] = d[l * 3 + 0], H[(p + v * c) * 4 + 1] = d[l * 3 + 1], H[(p + v * c) * 4 + 0] = d[l * 3 + 2];
  return H;
}
function Ope(A, e, t, r, n, i, s, a, f) {
  const o = t, d = A.width, v = A.height;
  let u, l = 0, P, p;
  const c = new Uint8Array(d * v * 4);
  for (p = r; p !== i; p += n)
    for (P = s; P !== f; P += a, l += 2) {
      u = o[l + 0] + (o[l + 1] << 8);
      const H = ((u & 31744) >> 10) * 255 / 31 | 0, T = ((u & 992) >> 5) * 255 / 31 | 0, q = (u & 31) * 255 / 31 | 0;
      c[(P + d * p) * 4 + 0] = H, c[(P + d * p) * 4 + 1] = T, c[(P + d * p) * 4 + 2] = q, c[(P + d * p) * 4 + 3] = u & 32768 ? 0 : 255;
    }
  return c;
}
function ype(A, e, t, r, n, i, s, a, f) {
  const o = t, d = A.width, v = A.height;
  let u = 0, l, P;
  const p = new Uint8Array(d * v * 4);
  for (P = r; P !== i; P += n)
    for (l = s; l !== f; l += a, u += 3)
      p[(l + d * P) * 4 + 3] = 255, p[(l + d * P) * 4 + 2] = o[u + 0], p[(l + d * P) * 4 + 1] = o[u + 1], p[(l + d * P) * 4 + 0] = o[u + 2];
  return p;
}
function kpe(A, e, t, r, n, i, s, a, f) {
  const o = t, d = A.width, v = A.height;
  let u = 0, l, P;
  const p = new Uint8Array(d * v * 4);
  for (P = r; P !== i; P += n)
    for (l = s; l !== f; l += a, u += 4)
      p[(l + d * P) * 4 + 2] = o[u + 0], p[(l + d * P) * 4 + 1] = o[u + 1], p[(l + d * P) * 4 + 0] = o[u + 2], p[(l + d * P) * 4 + 3] = o[u + 3];
  return p;
}
function Epe(A, e, t, r, n, i, s, a, f) {
  const o = t, d = A.width, v = A.height;
  let u, l = 0, P, p;
  const c = new Uint8Array(d * v * 4);
  for (p = r; p !== i; p += n)
    for (P = s; P !== f; P += a, l++)
      u = o[l], c[(P + d * p) * 4 + 0] = u, c[(P + d * p) * 4 + 1] = u, c[(P + d * p) * 4 + 2] = u, c[(P + d * p) * 4 + 3] = 255;
  return c;
}
function Fpe(A, e, t, r, n, i, s, a, f) {
  const o = t, d = A.width, v = A.height;
  let u = 0, l, P;
  const p = new Uint8Array(d * v * 4);
  for (P = r; P !== i; P += n)
    for (l = s; l !== f; l += a, u += 2)
      p[(l + d * P) * 4 + 0] = o[u + 0], p[(l + d * P) * 4 + 1] = o[u + 0], p[(l + d * P) * 4 + 2] = o[u + 0], p[(l + d * P) * 4 + 3] = o[u + 1];
  return p;
}
const Zte = {
  /**
   * Gets the header of a TGA file
   * @param data defines the TGA data
   * @returns the header
   */
  GetTGAHeader: sV,
  /**
   * Uploads TGA content to a Babylon Texture
   * @internal
   */
  UploadContent: eY,
  /** @internal */
  _getImageData8bits: Cpe,
  /** @internal */
  _getImageData16bits: Ope,
  /** @internal */
  _getImageData24bits: ype,
  /** @internal */
  _getImageData32bits: kpe,
  /** @internal */
  _getImageDataGrey8bits: Epe,
  /** @internal */
  _getImageDataGrey16bits: Fpe
};
class _te {
  constructor() {
    this.supportCascades = !1;
  }
  /**
   * This returns if the loader support the current file information.
   * @param extension defines the file extension of the file being loaded
   * @returns true if the loader can load the specified file
   */
  canLoad(e) {
    return e.endsWith(".tga");
  }
  /**
   * Uploads the cube texture data to the WebGL texture. It has already been bound.
   */
  loadCubeData() {
    throw ".env not supported in Cube.";
  }
  /**
   * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param callback defines the method to call once ready to upload
   */
  loadData(e, t, r) {
    const n = new Uint8Array(e.buffer, e.byteOffset, e.byteLength), i = sV(n);
    r(i.width, i.height, t.generateMipMaps, !1, () => {
      eY(t, n);
    });
  }
}
Ge._TextureLoaders.push(new _te());
class $te {
  constructor() {
    this.supportCascades = !1;
  }
  /**
   * This returns if the loader support the current file information.
   * @param extension defines the file extension of the file being loaded
   * @returns true if the loader can load the specified file
   */
  canLoad(e) {
    return e.endsWith(".hdr");
  }
  /**
   * Uploads the cube texture data to the WebGL texture. It has already been bound.
   */
  loadCubeData() {
    throw ".env not supported in Cube.";
  }
  /**
   * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param callback defines the method to call once ready to upload
   */
  loadData(e, t, r) {
    const n = new Uint8Array(e.buffer, e.byteOffset, e.byteLength), i = iO.RGBE_ReadHeader(n), s = iO.RGBE_ReadPixels(n, i), a = i.width * i.height, f = new Float32Array(a * 4);
    for (let o = 0; o < a; o += 1)
      f[o * 4] = s[o * 3], f[o * 4 + 1] = s[o * 3 + 1], f[o * 4 + 2] = s[o * 3 + 2], f[o * 4 + 3] = 1;
    r(i.width, i.height, t.generateMipMaps, !1, () => {
      const o = t.getEngine();
      t.type = 1, t.format = 5, t._gammaSpace = !1, o._uploadDataToTextureDirectly(t, f);
    });
  }
}
Ge._TextureLoaders.push(new $te());
class Npe {
}
var _8;
(function(A) {
  A[A.cTFETC1 = 0] = "cTFETC1", A[A.cTFETC2 = 1] = "cTFETC2", A[A.cTFBC1 = 2] = "cTFBC1", A[A.cTFBC3 = 3] = "cTFBC3", A[A.cTFBC4 = 4] = "cTFBC4", A[A.cTFBC5 = 5] = "cTFBC5", A[A.cTFBC7 = 6] = "cTFBC7", A[A.cTFPVRTC1_4_RGB = 8] = "cTFPVRTC1_4_RGB", A[A.cTFPVRTC1_4_RGBA = 9] = "cTFPVRTC1_4_RGBA", A[A.cTFASTC_4x4 = 10] = "cTFASTC_4x4", A[A.cTFATC_RGB = 11] = "cTFATC_RGB", A[A.cTFATC_RGBA_INTERPOLATED_ALPHA = 12] = "cTFATC_RGBA_INTERPOLATED_ALPHA", A[A.cTFRGBA32 = 13] = "cTFRGBA32", A[A.cTFRGB565 = 14] = "cTFRGB565", A[A.cTFBGR565 = 15] = "cTFBGR565", A[A.cTFRGBA4444 = 16] = "cTFRGBA4444", A[A.cTFFXT1_RGB = 17] = "cTFFXT1_RGB", A[A.cTFPVRTC2_4_RGB = 18] = "cTFPVRTC2_4_RGB", A[A.cTFPVRTC2_4_RGBA = 19] = "cTFPVRTC2_4_RGBA", A[A.cTFETC2_EAC_R11 = 20] = "cTFETC2_EAC_R11", A[A.cTFETC2_EAC_RG11 = 21] = "cTFETC2_EAC_RG11";
})(_8 || (_8 = {}));
const qq = {
  /**
   * URL to use when loading the basis transcoder
   */
  JSModuleURL: `${ye._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.js`,
  /**
   * URL to use when loading the wasm module for the transcoder
   */
  WasmModuleURL: `${ye._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.wasm`
}, ere = (A, e) => {
  let t;
  switch (A) {
    case _8.cTFETC1:
      t = 36196;
      break;
    case _8.cTFBC1:
      t = 33776;
      break;
    case _8.cTFBC4:
      t = 33779;
      break;
    case _8.cTFASTC_4x4:
      t = 37808;
      break;
    case _8.cTFETC2:
      t = 37496;
      break;
    case _8.cTFBC7:
      t = 36492;
      break;
  }
  if (t === void 0)
    throw "The chosen Basis transcoder format is not currently supported";
  return t;
};
let UE = null, U2 = null, Qpe = 0;
const Ype = !1, Mpe = () => (UE || (UE = new Promise((A, e) => {
  U2 ? A(U2) : ye.LoadFileAsync(ye.GetBabylonScriptURL(qq.WasmModuleURL)).then((t) => {
    if (typeof URL != "function")
      return e("Basis transcoder requires an environment with a URL constructor");
    const r = URL.createObjectURL(new Blob([`(${Lpe})()`], { type: "application/javascript" }));
    U2 = new Worker(r);
    const n = (i) => {
      i.data.action === "init" ? (U2.removeEventListener("message", n), A(U2)) : i.data.action === "error" && e(i.data.error || "error initializing worker");
    };
    U2.addEventListener("message", n), U2.postMessage({ action: "init", url: ye.GetBabylonScriptURL(qq.JSModuleURL), wasmBinary: t });
  }).catch(e);
})), UE), oO = (A, e) => {
  const t = A instanceof ArrayBuffer ? new Uint8Array(A) : A;
  return new Promise((r, n) => {
    Mpe().then(() => {
      const i = Qpe++, s = (f) => {
        f.data.action === "transcode" && f.data.id === i && (U2.removeEventListener("message", s), f.data.success ? r(f.data) : n("Transcode is not supported on this device"));
      };
      U2.addEventListener("message", s);
      const a = new Uint8Array(t.byteLength);
      a.set(new Uint8Array(t.buffer, t.byteOffset, t.byteLength)), U2.postMessage({ action: "transcode", id: i, imageData: a, config: e, ignoreSupportedFormats: Ype }, [
        a.buffer
      ]);
    }, (i) => {
      n(i);
    });
  });
}, XC = (A, e) => {
  var t, r;
  let n = (t = e._gl) === null || t === void 0 ? void 0 : t.TEXTURE_2D;
  A.isCube && (n = (r = e._gl) === null || r === void 0 ? void 0 : r.TEXTURE_CUBE_MAP), e._bindTextureDirectly(n, A, !0);
}, fO = (A, e) => {
  const t = A.getEngine();
  for (let r = 0; r < e.fileInfo.images.length; r++) {
    const n = e.fileInfo.images[r].levels[0];
    if (A._invertVScale = A.invertY, e.format === -1 || e.format === _8.cTFRGB565)
      if (A.type = 10, A.format = 4, t._features.basisNeedsPOT && (Xt.Log2(n.width) % 1 !== 0 || Xt.Log2(n.height) % 1 !== 0)) {
        const i = new As(t, ri.Temp);
        A._invertVScale = A.invertY, i.type = 10, i.format = 4, i.width = n.width + 3 & -4, i.height = n.height + 3 & -4, XC(i, t), t._uploadDataToTextureDirectly(i, new Uint16Array(n.transcodedPixels.buffer), r, 0, 4, !0), t._rescaleTexture(i, A, t.scenes[0], t._getInternalFormat(4), () => {
          t._releaseTexture(i), XC(A, t);
        });
      } else
        A._invertVScale = !A.invertY, A.width = n.width + 3 & -4, A.height = n.height + 3 & -4, A.samplingMode = 2, XC(A, t), t._uploadDataToTextureDirectly(A, new Uint16Array(n.transcodedPixels.buffer), r, 0, 4, !0);
    else {
      A.width = n.width, A.height = n.height, A.generateMipMaps = e.fileInfo.images[r].levels.length > 1;
      const i = py.GetInternalFormatFromBasisFormat(e.format, t);
      A.format = i, XC(A, t), e.fileInfo.images[r].levels.forEach((s, a) => {
        t._uploadCompressedDataToTextureDirectly(A, i, s.width, s.height, s.transcodedPixels, r, a);
      }), t._features.basisNeedsPOT && (Xt.Log2(A.width) % 1 !== 0 || Xt.Log2(A.height) % 1 !== 0) && (ye.Warn("Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1."), A._cachedWrapU = We.CLAMP_ADDRESSMODE, A._cachedWrapV = We.CLAMP_ADDRESSMODE);
    }
  }
}, py = {
  /**
   * URL to use when loading the basis transcoder
   */
  JSModuleURL: qq.JSModuleURL,
  /**
   * URL to use when loading the wasm module for the transcoder
   */
  WasmModuleURL: qq.WasmModuleURL,
  /**
   * Get the internal format to be passed to texImage2D corresponding to the .basis format value
   * @param basisFormat format chosen from GetSupportedTranscodeFormat
   * @returns internal format corresponding to the Basis format
   */
  GetInternalFormatFromBasisFormat: ere,
  /**
   * Transcodes a loaded image file to compressed pixel data
   * @param data image data to transcode
   * @param config configuration options for the transcoding
   * @returns a promise resulting in the transcoded image
   */
  TranscodeAsync: oO,
  /**
   * Loads a texture from the transcode result
   * @param texture texture load to
   * @param transcodeResult the result of transcoding the basis file to load from
   */
  LoadTextureFromTranscodeResult: fO
};
function Lpe() {
  const A = {
    cTFETC1: 0,
    cTFETC2: 1,
    cTFBC1: 2,
    cTFBC3: 3,
    cTFBC4: 4,
    cTFBC5: 5,
    cTFBC7: 6,
    cTFPVRTC1_4_RGB: 8,
    cTFPVRTC1_4_RGBA: 9,
    cTFASTC_4x4: 10,
    cTFATC_RGB: 11,
    cTFATC_RGBA_INTERPOLATED_ALPHA: 12,
    cTFRGBA32: 13,
    cTFRGB565: 14,
    cTFBGR565: 15,
    cTFRGBA4444: 16,
    cTFFXT1_RGB: 17,
    cTFPVRTC2_4_RGB: 18,
    cTFPVRTC2_4_RGBA: 19,
    cTFETC2_EAC_R11: 20,
    cTFETC2_EAC_RG11: 21
  };
  let e = null;
  onmessage = (s) => {
    if (s.data.action === "init") {
      if (!e) {
        try {
          importScripts(s.data.url);
        } catch (a) {
          postMessage({ action: "error", error: a });
        }
        e = BASIS({
          // Override wasm binary
          wasmBinary: s.data.wasmBinary
        });
      }
      e !== null && e.then((a) => {
        BASIS = a, a.initializeBasis(), postMessage({ action: "init" });
      });
    } else if (s.data.action === "transcode") {
      const a = s.data.config, f = s.data.imageData, o = new BASIS.BasisFile(f), d = r(o);
      let v = s.data.ignoreSupportedFormats ? null : t(s.data.config, d), u = !1;
      v === null && (u = !0, v = d.hasAlpha ? A.cTFBC3 : A.cTFBC1);
      let l = !0;
      o.startTranscoding() || (l = !1);
      const P = [];
      for (let p = 0; p < d.images.length && l; p++) {
        const c = d.images[p];
        if (a.loadSingleImage === void 0 || a.loadSingleImage === p) {
          let H = c.levels.length;
          a.loadMipmapLevels === !1 && (H = 1);
          for (let T = 0; T < H; T++) {
            const q = c.levels[T], b = n(o, p, T, v, u);
            if (!b) {
              l = !1;
              break;
            }
            q.transcodedPixels = b, P.push(q.transcodedPixels.buffer);
          }
        }
      }
      o.close(), o.delete(), u && (v = -1), l ? postMessage({ action: "transcode", success: l, id: s.data.id, fileInfo: d, format: v }, P) : postMessage({ action: "transcode", success: l, id: s.data.id });
    }
  };
  function t(s, a) {
    let f = null;
    return s.supportedCompressionFormats && (s.supportedCompressionFormats.astc ? f = A.cTFASTC_4x4 : s.supportedCompressionFormats.bc7 ? f = A.cTFBC7 : s.supportedCompressionFormats.s3tc ? f = a.hasAlpha ? A.cTFBC3 : A.cTFBC1 : s.supportedCompressionFormats.pvrtc ? f = a.hasAlpha ? A.cTFPVRTC1_4_RGBA : A.cTFPVRTC1_4_RGB : s.supportedCompressionFormats.etc2 ? f = A.cTFETC2 : s.supportedCompressionFormats.etc1 ? f = A.cTFETC1 : f = A.cTFRGB565), f;
  }
  function r(s) {
    const a = s.getHasAlpha(), f = s.getNumImages(), o = [];
    for (let v = 0; v < f; v++) {
      const u = {
        levels: []
      }, l = s.getNumLevels(v);
      for (let P = 0; P < l; P++) {
        const p = {
          width: s.getImageWidth(v, P),
          height: s.getImageHeight(v, P)
        };
        u.levels.push(p);
      }
      o.push(u);
    }
    return { hasAlpha: a, images: o };
  }
  function n(s, a, f, o, d) {
    const v = s.getImageTranscodedSizeInBytes(a, f, o);
    let u = new Uint8Array(v);
    if (!s.transcodeImage(u, a, f, o, 1, 0))
      return null;
    if (d) {
      const l = s.getImageWidth(a, f) + 3 & -4, P = s.getImageHeight(a, f) + 3 & -4;
      u = i(u, 0, l, P);
    }
    return u;
  }
  function i(s, a, f, o) {
    const d = new Uint16Array(4), v = new Uint16Array(f * o), u = f / 4, l = o / 4;
    for (let P = 0; P < l; P++)
      for (let p = 0; p < u; p++) {
        const c = a + 8 * (P * u + p);
        d[0] = s[c] | s[c + 1] << 8, d[1] = s[c + 2] | s[c + 3] << 8, d[2] = (2 * (d[0] & 31) + 1 * (d[1] & 31)) / 3 | (2 * (d[0] & 2016) + 1 * (d[1] & 2016)) / 3 & 2016 | (2 * (d[0] & 63488) + 1 * (d[1] & 63488)) / 3 & 63488, d[3] = (2 * (d[1] & 31) + 1 * (d[0] & 31)) / 3 | (2 * (d[1] & 2016) + 1 * (d[0] & 2016)) / 3 & 2016 | (2 * (d[1] & 63488) + 1 * (d[0] & 63488)) / 3 & 63488;
        for (let H = 0; H < 4; H++) {
          const T = s[c + 4 + H];
          let q = (P * 4 + H) * f + p * 4;
          v[q++] = d[T & 3], v[q++] = d[T >> 2 & 3], v[q++] = d[T >> 4 & 3], v[q++] = d[T >> 6 & 3];
        }
      }
    return v;
  }
}
Object.defineProperty(py, "JSModuleURL", {
  get: function() {
    return qq.JSModuleURL;
  },
  set: function(A) {
    qq.JSModuleURL = A;
  }
});
Object.defineProperty(py, "WasmModuleURL", {
  get: function() {
    return qq.WasmModuleURL;
  },
  set: function(A) {
    qq.WasmModuleURL = A;
  }
});
class tre {
  constructor() {
    this.supportCascades = !1;
  }
  /**
   * This returns if the loader support the current file information.
   * @param extension defines the file extension of the file being loaded
   * @returns true if the loader can load the specified file
   */
  canLoad(e) {
    return e.endsWith(".basis");
  }
  /**
   * Uploads the cube texture data to the WebGL texture. It has already been bound.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param createPolynomials will be true if polynomials have been requested
   * @param onLoad defines the callback to trigger once the texture is ready
   * @param onError defines the callback to trigger in case of error
   */
  loadCubeData(e, t, r, n, i) {
    if (Array.isArray(e))
      return;
    const s = t.getEngine().getCaps(), a = {
      supportedCompressionFormats: {
        etc1: !!s.etc1,
        s3tc: !!s.s3tc,
        pvrtc: !!s.pvrtc,
        etc2: !!s.etc2,
        astc: !!s.astc,
        bc7: !!s.bptc
      }
    };
    oO(e, a).then((f) => {
      const o = f.fileInfo.images[0].levels.length > 1 && t.generateMipMaps;
      fO(t, f), t.getEngine()._setCubeMapTextureParams(t, o), t.isReady = !0, t.onLoadedObservable.notifyObservers(t), t.onLoadedObservable.clear(), n && n();
    }).catch((f) => {
      const o = "Failed to transcode Basis file, transcoding may not be supported on this device";
      ye.Warn(o), t.isReady = !0, i && i(f);
    });
  }
  /**
   * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param callback defines the method to call once ready to upload
   */
  loadData(e, t, r) {
    const n = t.getEngine().getCaps(), i = {
      supportedCompressionFormats: {
        etc1: !!n.etc1,
        s3tc: !!n.s3tc,
        pvrtc: !!n.pvrtc,
        etc2: !!n.etc2,
        astc: !!n.astc,
        bc7: !!n.bptc
      }
    };
    oO(e, i).then((s) => {
      const a = s.fileInfo.images[0].levels[0], f = s.fileInfo.images[0].levels.length > 1 && t.generateMipMaps;
      r(a.width, a.height, f, s.format !== -1, () => {
        fO(t, s);
      });
    }).catch((s) => {
      ye.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"), ye.Warn(`Failed to transcode Basis file: ${s}`), r(0, 0, !1, !1, () => {
      }, !0);
    });
  }
}
Ge._TextureLoaders.push(new tre());
class Zx extends Ta {
  /**
   * Get if draw buffers (render textures) are currently supported by the used hardware and browser.
   */
  get isSupported() {
    var e, t;
    return (t = (e = this._engine) === null || e === void 0 ? void 0 : e.getCaps().drawBuffersExtension) !== null && t !== void 0 ? t : !1;
  }
  /**
   * Get the list of textures generated by the multi render target.
   */
  get textures() {
    return this._textures;
  }
  /**
   * Gets the number of textures in this MRT. This number can be different from `_textures.length` in case a depth texture is generated.
   */
  get count() {
    return this._count;
  }
  /**
   * Get the depth texture generated by the multi render target if options.generateDepthTexture has been set
   */
  get depthTexture() {
    return this._textures[this._textures.length - 1];
  }
  /**
   * Set the wrapping mode on U of all the textures we are rendering to.
   * Can be any of the Texture. (CLAMP_ADDRESSMODE, MIRROR_ADDRESSMODE or WRAP_ADDRESSMODE)
   */
  set wrapU(e) {
    if (this._textures)
      for (let t = 0; t < this._textures.length; t++)
        this._textures[t].wrapU = e;
  }
  /**
   * Set the wrapping mode on V of all the textures we are rendering to.
   * Can be any of the Texture. (CLAMP_ADDRESSMODE, MIRROR_ADDRESSMODE or WRAP_ADDRESSMODE)
   */
  set wrapV(e) {
    if (this._textures)
      for (let t = 0; t < this._textures.length; t++)
        this._textures[t].wrapV = e;
  }
  /**
   * Instantiate a new multi render target texture.
   * A multi render target, like a render target provides the ability to render to a texture.
   * Unlike the render target, it can render to several draw buffers (render textures) in one draw.
   * This is specially interesting in deferred rendering or for any effects requiring more than
   * just one color from a single pass.
   * @param name Define the name of the texture
   * @param size Define the size of the buffers to render to
   * @param count Define the number of target we are rendering into
   * @param scene Define the scene the texture belongs to
   * @param options Define the options used to create the multi render target
   * @param textureNames Define the names to set to the textures (if count \> 0 - optional)
   */
  constructor(e, t, r, n, i, s) {
    const a = i && i.generateMipMaps ? i.generateMipMaps : !1, f = i && i.generateDepthTexture ? i.generateDepthTexture : !1, o = i && i.depthTextureFormat ? i.depthTextureFormat : 15, d = !i || i.doNotChangeAspectRatio === void 0 ? !0 : i.doNotChangeAspectRatio, v = i && i.drawOnlyOnFirstAttachmentByDefault ? i.drawOnlyOnFirstAttachmentByDefault : !1;
    if (super(e, t, n, a, d, void 0, void 0, void 0, void 0, void 0, void 0, void 0, !0), !this.isSupported) {
      this.dispose();
      return;
    }
    this._textureNames = s;
    const u = [], l = [], P = [], p = [], c = [], H = [], T = [], q = [];
    this._initTypes(r, u, l, P, p, c, H, T, q, i);
    const b = !i || i.generateDepthBuffer === void 0 ? !0 : i.generateDepthBuffer, j = !i || i.generateStencilBuffer === void 0 ? !1 : i.generateStencilBuffer;
    this._multiRenderTargetOptions = {
      samplingModes: l,
      generateMipMaps: a,
      generateDepthBuffer: b,
      generateStencilBuffer: j,
      generateDepthTexture: f,
      depthTextureFormat: o,
      types: u,
      textureCount: r,
      useSRGBBuffers: P,
      formats: p,
      targetTypes: c,
      faceIndex: H,
      layerIndex: T,
      layerCounts: q,
      labels: s
    }, this._count = r, this._drawOnlyOnFirstAttachmentByDefault = v, r > 0 && (this._createInternalTextures(), this._createTextures(s));
  }
  _initTypes(e, t, r, n, i, s, a, f, o, d) {
    for (let v = 0; v < e; v++)
      d && d.types && d.types[v] !== void 0 ? t.push(d.types[v]) : t.push(d && d.defaultType ? d.defaultType : 0), d && d.samplingModes && d.samplingModes[v] !== void 0 ? r.push(d.samplingModes[v]) : r.push(We.BILINEAR_SAMPLINGMODE), d && d.useSRGBBuffers && d.useSRGBBuffers[v] !== void 0 ? n.push(d.useSRGBBuffers[v]) : n.push(!1), d && d.formats && d.formats[v] !== void 0 ? i.push(d.formats[v]) : i.push(5), d && d.targetTypes && d.targetTypes[v] !== void 0 ? s.push(d.targetTypes[v]) : s.push(3553), d && d.faceIndex && d.faceIndex[v] !== void 0 ? a.push(d.faceIndex[v]) : a.push(0), d && d.layerIndex && d.layerIndex[v] !== void 0 ? f.push(d.layerIndex[v]) : f.push(0), d && d.layerCounts && d.layerCounts[v] !== void 0 ? o.push(d.layerCounts[v]) : o.push(1);
  }
  _createInternaTextureIndexMapping() {
    const e = {}, t = [];
    if (!this._renderTarget)
      return t;
    const r = this._renderTarget.textures;
    for (let n = 0; n < r.length; n++) {
      const i = r[n];
      if (!i)
        continue;
      const s = e[i.uniqueId];
      s !== void 0 ? t[n] = s : e[i.uniqueId] = n;
    }
    return t;
  }
  /**
   * @internal
   */
  _rebuild(e = !1, t) {
    if (this._count < 1)
      return;
    const r = this._createInternaTextureIndexMapping();
    this.releaseInternalTextures(), this._createInternalTextures(), e && (this._releaseTextures(), this._createTextures(t));
    const n = this._renderTarget.textures;
    for (let i = 0; i < n.length; i++) {
      const s = this._textures[i];
      r[i] !== void 0 && this._renderTarget.setTexture(n[r[i]], i), s._texture = n[i], s._texture && (s._noMipmap = !s._texture.useMipMaps, s._useSRGBBuffer = s._texture._useSRGBBuffer);
    }
    this.samples !== 1 && this._renderTarget.setSamples(this.samples, !this._drawOnlyOnFirstAttachmentByDefault, !0);
  }
  _createInternalTextures() {
    this._renderTarget = this._getEngine().createMultipleRenderTarget(this._size, this._multiRenderTargetOptions, !this._drawOnlyOnFirstAttachmentByDefault), this._texture = this._renderTarget.texture;
  }
  _releaseTextures() {
    if (this._textures)
      for (let e = 0; e < this._textures.length; e++)
        this._textures[e]._texture = null, this._textures[e].dispose();
  }
  _createTextures(e) {
    const t = this._renderTarget.textures;
    this._textures = [];
    for (let r = 0; r < t.length; r++) {
      const n = new We(null, this.getScene());
      e != null && e[r] && (n.name = e[r]), n._texture = t[r], n._texture && (n._noMipmap = !n._texture.useMipMaps, n._useSRGBBuffer = n._texture._useSRGBBuffer), this._textures.push(n);
    }
  }
  /**
   * Replaces an internal texture within the MRT. Useful to share textures between MultiRenderTarget.
   * @param texture The new texture to set in the MRT
   * @param index The index of the texture to replace
   * @param disposePrevious Set to true if the previous internal texture should be disposed
   */
  setInternalTexture(e, t, r = !0) {
    var n, i;
    if (this.renderTarget && (t === 0 && (this._texture = e), this.renderTarget.setTexture(e, t, r), this.textures[t] || (this.textures[t] = new We(null, this.getScene()), this.textures[t].name = (i = (n = this._textureNames) === null || n === void 0 ? void 0 : n[t]) !== null && i !== void 0 ? i : this.textures[t].name), this.textures[t]._texture = e, this.textures[t]._noMipmap = !e.useMipMaps, this.textures[t]._useSRGBBuffer = e._useSRGBBuffer, this._count = this.renderTarget.textures ? this.renderTarget.textures.length : 0, this._multiRenderTargetOptions.types && (this._multiRenderTargetOptions.types[t] = e.type), this._multiRenderTargetOptions.samplingModes && (this._multiRenderTargetOptions.samplingModes[t] = e.samplingMode), this._multiRenderTargetOptions.useSRGBBuffers && (this._multiRenderTargetOptions.useSRGBBuffers[t] = e._useSRGBBuffer), this._multiRenderTargetOptions.targetTypes && this._multiRenderTargetOptions.targetTypes[t] !== -1)) {
      let s = 0;
      e.is2DArray ? s = 35866 : e.isCube ? s = 34067 : e.is3D ? s = 32879 : s = 3553, this._multiRenderTargetOptions.targetTypes[t] = s;
    }
  }
  /**
   * Changes an attached texture's face index or layer.
   * @param index The index of the texture to modify the attachment of
   * @param layerIndex The layer index of the texture to be attached to the framebuffer
   * @param faceIndex The face index of the texture to be attached to the framebuffer
   */
  setLayerAndFaceIndex(e, t = -1, r = -1) {
    !this.textures[e] || !this.renderTarget || (this._multiRenderTargetOptions.layerIndex && (this._multiRenderTargetOptions.layerIndex[e] = t), this._multiRenderTargetOptions.faceIndex && (this._multiRenderTargetOptions.faceIndex[e] = r), this.renderTarget.setLayerAndFaceIndex(e, t, r));
  }
  /**
   * Changes every attached texture's face index or layer.
   * @param layerIndices The layer indices of the texture to be attached to the framebuffer
   * @param faceIndices The face indices of the texture to be attached to the framebuffer
   */
  setLayerAndFaceIndices(e, t) {
    this.renderTarget && (this._multiRenderTargetOptions.layerIndex = e, this._multiRenderTargetOptions.faceIndex = t, this.renderTarget.setLayerAndFaceIndices(e, t));
  }
  /**
   * Define the number of samples used if MSAA is enabled.
   */
  get samples() {
    return this._samples;
  }
  set samples(e) {
    this._renderTarget ? this._samples = this._renderTarget.setSamples(e) : this._samples = e;
  }
  /**
   * Resize all the textures in the multi render target.
   * Be careful as it will recreate all the data in the new texture.
   * @param size Define the new size
   */
  resize(e) {
    this._processSizeParameter(e, !1), this._rebuild(void 0, this._textureNames);
  }
  /**
   * Changes the number of render targets in this MRT
   * Be careful as it will recreate all the data in the new texture.
   * @param count new texture count
   * @param options Specifies texture types and sampling modes for new textures
   * @param textureNames Specifies the names of the textures (optional)
   */
  updateCount(e, t, r) {
    this._multiRenderTargetOptions.textureCount = e, this._count = e;
    const n = [], i = [], s = [], a = [], f = [], o = [], d = [], v = [];
    this._textureNames = r, this._initTypes(e, n, i, s, a, f, o, d, v, t), this._multiRenderTargetOptions.types = n, this._multiRenderTargetOptions.samplingModes = i, this._multiRenderTargetOptions.useSRGBBuffers = s, this._multiRenderTargetOptions.formats = a, this._multiRenderTargetOptions.targetTypes = f, this._multiRenderTargetOptions.faceIndex = o, this._multiRenderTargetOptions.layerIndex = d, this._multiRenderTargetOptions.layerCounts = v, this._multiRenderTargetOptions.labels = r, this._rebuild(!0, r);
  }
  _unbindFrameBuffer(e, t) {
    this._renderTarget && e.unBindMultiColorAttachmentFramebuffer(this._renderTarget, this.isCube, () => {
      this.onAfterRenderObservable.notifyObservers(t);
    });
  }
  /**
   * Dispose the render targets and their associated resources
   * @param doNotDisposeInternalTextures
   */
  dispose(e = !1) {
    this._releaseTextures(), e ? this._texture = null : this.releaseInternalTextures(), super.dispose();
  }
  /**
   * Release all the underlying texture used as draw buffers (render textures).
   */
  releaseInternalTextures() {
    var e, t;
    const r = (e = this._renderTarget) === null || e === void 0 ? void 0 : e.textures;
    if (r) {
      for (let n = r.length - 1; n >= 0; n--)
        this._textures[n]._texture = null;
      (t = this._renderTarget) === null || t === void 0 || t.dispose(), this._renderTarget = null;
    }
  }
}
class XF {
  /**
   * Initializes a texture package frame.
   * @param id The numerical frame identifier
   * @param scale Scalar Vector2 for UV frame
   * @param offset Vector2 for the frame position in UV units.
   * @returns TexturePackerFrame
   */
  constructor(e, t, r) {
    this.id = e, this.scale = t, this.offset = r;
  }
}
class I0 {
  /**
   * Initializes a texture package series from an array of meshes or a single mesh.
   * @param name The name of the package
   * @param meshes The target meshes to compose the package from
   * @param options The arguments that texture packer should follow while building.
   * @param scene The scene which the textures are scoped to.
   * @returns TexturePacker
   */
  constructor(e, t, r, n) {
    var i, s, a, f, o, d, v, u, l, P, p, c, H;
    return this.name = e, this.meshes = t, this.scene = n, this.options = r, this.options.map = (i = this.options.map) !== null && i !== void 0 ? i : [
      "ambientTexture",
      "bumpTexture",
      "diffuseTexture",
      "emissiveTexture",
      "lightmapTexture",
      "opacityTexture",
      "reflectionTexture",
      "refractionTexture",
      "specularTexture"
    ], this.options.uvsIn = (s = this.options.uvsIn) !== null && s !== void 0 ? s : J.UVKind, this.options.uvsOut = (a = this.options.uvsOut) !== null && a !== void 0 ? a : J.UVKind, this.options.layout = (f = this.options.layout) !== null && f !== void 0 ? f : I0.LAYOUT_STRIP, this.options.layout === I0.LAYOUT_COLNUM && (this.options.colnum = (o = this.options.colnum) !== null && o !== void 0 ? o : 8), this.options.updateInputMeshes = (d = this.options.updateInputMeshes) !== null && d !== void 0 ? d : !0, this.options.disposeSources = (v = this.options.disposeSources) !== null && v !== void 0 ? v : !0, this._expecting = 0, this.options.fillBlanks = (u = this.options.fillBlanks) !== null && u !== void 0 ? u : !0, this.options.fillBlanks === !0 && (this.options.customFillColor = (l = this.options.customFillColor) !== null && l !== void 0 ? l : "black"), this.options.frameSize = (P = this.options.frameSize) !== null && P !== void 0 ? P : 256, this.options.paddingRatio = (p = this.options.paddingRatio) !== null && p !== void 0 ? p : 0.0115, this._paddingValue = Math.ceil(this.options.frameSize * this.options.paddingRatio), this._paddingValue % 2 !== 0 && this._paddingValue++, this.options.paddingMode = (c = this.options.paddingMode) !== null && c !== void 0 ? c : I0.SUBUV_WRAP, this.options.paddingMode === I0.SUBUV_COLOR && (this.options.paddingColor = (H = this.options.paddingColor) !== null && H !== void 0 ? H : new xt(0, 0, 0, 1)), this.sets = {}, this.frames = [], this;
  }
  /**
   * Starts the package process
   * @param resolve The promises resolution function
   * @returns TexturePacker
   */
  _createFrames(e) {
    const t = this._calculateSize(), r = new at(1, 1).divide(t);
    let n = 0;
    const i = this._expecting, s = this.meshes.length, a = Object.keys(this.sets);
    for (let u = 0; u < a.length; u++) {
      const l = a[u], P = new Xp(
        this.name + ".TexturePack." + l + "Set",
        { width: t.x, height: t.y },
        this.scene,
        !0,
        //Generate Mips
        We.TRILINEAR_SAMPLINGMODE,
        Ge.TEXTUREFORMAT_RGBA
      ), p = P.getContext();
      p.fillStyle = "rgba(0,0,0,0)", p.fillRect(0, 0, t.x, t.y), P.update(!1), this.sets[l] = P;
    }
    const f = this.options.frameSize || 256, o = this._paddingValue, d = f + 2 * o, v = () => {
      this._calculateMeshUVFrames(f, o, t, r, this.options.updateInputMeshes || !1);
    };
    for (let u = 0; u < s; u++) {
      const P = this.meshes[u].material;
      for (let p = 0; p < a.length; p++) {
        const c = new Xp("temp", d, this.scene, !0), H = c.getContext(), T = this._getFrameOffset(u), q = () => {
          n++, c.update(!1);
          const j = H.getImageData(0, 0, d, d), w = this.sets[b];
          if (w.getContext().putImageData(j, t.x * T.x, t.y * T.y), c.dispose(), w.update(!1), n == i) {
            v(), e();
            return;
          }
        }, b = a[p] || "_blank";
        if (!P || P[b] === null)
          H.fillStyle = "rgba(0,0,0,0)", this.options.fillBlanks && (H.fillStyle = this.options.customFillColor), H.fillRect(0, 0, d, d), q();
        else {
          const j = P[b], w = new Image();
          j instanceof Xp ? w.src = j.getContext().canvas.toDataURL("image/png") : w.src = j.url, ye.SetCorsBehavior(w.src, w), w.onload = () => {
            H.fillStyle = "rgba(0,0,0,0)", H.fillRect(0, 0, d, d), c.update(!1), H.setTransform(1, 0, 0, -1, 0, 0);
            const m = [0, 0, 1, 0, 1, 1, 0, 1, -1, 1, -1, 0, -2, 0, -1, 1, -1];
            switch (this.options.paddingMode) {
              case 0:
                for (let I = 0; I < 9; I++)
                  H.drawImage(w, 0, 0, w.width, w.height, o + f * m[I], o + f * m[I + 1] - d, f, f);
                break;
              case 1:
                for (let I = 0; I < o; I++)
                  H.drawImage(w, 0, 0, w.width, w.height, I + f * m[0], o - d, f, f), H.drawImage(w, 0, 0, w.width, w.height, o * 2 - I, o - d, f, f), H.drawImage(w, 0, 0, w.width, w.height, o, I - d, f, f), H.drawImage(w, 0, 0, w.width, w.height, o, o * 2 - I - d, f, f);
                H.drawImage(w, 0, 0, w.width, w.height, o + f * m[0], o + f * m[1] - d, f, f);
                break;
              case 2:
                H.fillStyle = (this.options.paddingColor || Ne.Black()).toHexString(), H.fillRect(0, 0, d, -d), H.clearRect(o, o, f, f), H.drawImage(w, 0, 0, w.width, w.height, o + f * m[0], o + f * m[1] - d, f, f);
                break;
            }
            H.setTransform(1, 0, 0, 1, 0, 0), q();
          };
        }
      }
    }
  }
  /**
   * Calculates the Size of the Channel Sets
   * @returns Vector2
   */
  _calculateSize() {
    const e = this.meshes.length || 0, t = this.options.frameSize || 0, r = this._paddingValue || 0;
    switch (this.options.layout) {
      case 0:
        return new at(t * e + 2 * r * e, t + 2 * r);
      case 1: {
        const n = Math.max(2, Math.ceil(Math.sqrt(e))), i = t * n + 2 * r * n;
        return new at(i, i);
      }
      case 2: {
        const n = this.options.colnum || 1, i = Math.max(1, Math.ceil(e / n));
        return new at(t * n + 2 * r * n, t * i + 2 * r * i);
      }
    }
    return at.Zero();
  }
  /**
   * Calculates the UV data for the frames.
   * @param baseSize the base frameSize
   * @param padding the base frame padding
   * @param dtSize size of the Dynamic Texture for that channel
   * @param dtUnits is 1/dtSize
   * @param update flag to update the input meshes
   */
  _calculateMeshUVFrames(e, t, r, n, i) {
    const s = this.meshes.length;
    for (let a = 0; a < s; a++) {
      const f = this.meshes[a], o = new at(e / r.x, e / r.y), d = n.clone().scale(t), u = this._getFrameOffset(a).add(d), l = new XF(a, o, u);
      this.frames.push(l), i && (this._updateMeshUV(f, a), this._updateTextureReferences(f));
    }
  }
  /**
   * Calculates the frames Offset.
   * @param index of the frame
   * @returns Vector2
   */
  _getFrameOffset(e) {
    const t = this.meshes.length;
    let r, n, i;
    switch (this.options.layout) {
      case 0:
        return r = 1 / t, new at(e * r, 0);
      case 1: {
        const s = Math.max(2, Math.ceil(Math.sqrt(t)));
        return n = Math.floor(e / s), i = e - n * s, r = 1 / s, new at(i * r, n * r);
      }
      case 2: {
        const s = this.options.colnum || 1, a = Math.max(1, Math.ceil(t / s));
        return i = Math.floor(e / a), n = e - i * a, r = new at(1 / s, 1 / a), new at(i * r.x, n * r.y);
      }
    }
    return at.Zero();
  }
  /**
   * Updates a Mesh to the frame data
   * @param mesh that is the target
   * @param frameID or the frame index
   */
  _updateMeshUV(e, t) {
    const r = this.frames[t], n = e.getVerticesData(this.options.uvsIn || J.UVKind), i = [];
    let s = 0;
    n.length && (s = n.length || 0);
    for (let a = 0; a < s; a += 2)
      i.push(n[a] * r.scale.x + r.offset.x, n[a + 1] * r.scale.y + r.offset.y);
    e.setVerticesData(this.options.uvsOut || J.UVKind, i);
  }
  /**
   * Updates a Meshes materials to use the texture packer channels
   * @param m is the mesh to target
   * @param force all channels on the packer to be set.
   */
  _updateTextureReferences(e, t = !1) {
    const r = e.material, n = Object.keys(this.sets), i = (s) => {
      s.dispose && s.dispose();
    };
    for (let s = 0; s < n.length; s++) {
      const a = n[s];
      if (t)
        r[a] !== null && i(r[a]), r[a] = this.sets[a];
      else {
        if (!r)
          return;
        r[a] !== null && (i(r[a]), r[a] = this.sets[a]);
      }
    }
  }
  /**
   * Public method to set a Mesh to a frame
   * @param m that is the target
   * @param frameID or the frame index
   * @param updateMaterial trigger for if the Meshes attached Material be updated?
   */
  setMeshToFrame(e, t, r = !1) {
    this._updateMeshUV(e, t), r && this._updateTextureReferences(e, !0);
  }
  /**
   * Starts the async promise to compile the texture packer.
   * @returns Promise<void>
   */
  processAsync() {
    return new Promise((e, t) => {
      try {
        if (this.meshes.length === 0) {
          e();
          return;
        }
        let r = 0;
        const n = (i) => {
          if (r++, this.options.map) {
            for (let s = 0; s < this.options.map.length; s++) {
              const a = this.options.map[s];
              i[a] !== null && (this.sets[this.options.map[s]] || (this.sets[this.options.map[s]] = !0), this._expecting++);
            }
            r === this.meshes.length && this._createFrames(e);
          }
        };
        for (let i = 0; i < this.meshes.length; i++) {
          const s = this.meshes[i], a = s.material;
          if (!a) {
            if (r++, r === this.meshes.length)
              return this._createFrames(e);
            continue;
          }
          a.forceCompilationAsync(s).then(() => {
            n(a);
          });
        }
      } catch (r) {
        return t(r);
      }
    });
  }
  /**
   * Disposes all textures associated with this packer
   */
  dispose() {
    const e = Object.keys(this.sets);
    for (let t = 0; t < e.length; t++) {
      const r = e[t];
      this.sets[r].dispose();
    }
  }
  /**
   * Starts the download process for all the channels converting them to base64 data and embedding it all in a JSON file.
   * @param imageType is the image type to use.
   * @param quality of the image if downloading as jpeg, Ranges from >0 to 1.
   */
  download(e = "png", t = 1) {
    setTimeout(() => {
      const r = {
        name: this.name,
        sets: {},
        options: {},
        frames: []
      }, n = Object.keys(this.sets), i = Object.keys(this.options);
      try {
        for (let f = 0; f < n.length; f++) {
          const o = n[f], d = this.sets[o];
          r.sets[o] = d.getContext().canvas.toDataURL("image/" + e, t);
        }
        for (let f = 0; f < i.length; f++) {
          const o = i[f];
          r.options[o] = this.options[o];
        }
        for (let f = 0; f < this.frames.length; f++) {
          const o = this.frames[f];
          r.frames.push(o.scale.x, o.scale.y, o.offset.x, o.offset.y);
        }
      } catch (f) {
        Se.Warn("Unable to download: " + f);
        return;
      }
      const s = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(r, null, 4)), a = document.createElement("a");
      a.setAttribute("href", s), a.setAttribute("download", this.name + "_texurePackage.json"), document.body.appendChild(a), a.click(), a.remove();
    }, 0);
  }
  /**
   * Public method to load a texturePacker JSON file.
   * @param data of the JSON file in string format.
   */
  updateFromJSON(e) {
    try {
      const t = JSON.parse(e);
      this.name = t.name;
      const r = Object.keys(t.options);
      for (let i = 0; i < r.length; i++)
        this.options[r[i]] = t.options[r[i]];
      for (let i = 0; i < t.frames.length; i += 4) {
        const s = new XF(i / 4, new at(t.frames[i], t.frames[i + 1]), new at(t.frames[i + 2], t.frames[i + 3]));
        this.frames.push(s);
      }
      const n = Object.keys(t.sets);
      for (let i = 0; i < n.length; i++) {
        const s = new We(t.sets[n[i]], this.scene, !1, !1);
        this.sets[n[i]] = s;
      }
    } catch (t) {
      Se.Warn("Unable to update from JSON: " + t);
    }
  }
}
I0.LAYOUT_STRIP = 0;
I0.LAYOUT_POWER2 = 1;
I0.LAYOUT_COLNUM = 2;
I0.SUBUV_WRAP = 0;
I0.SUBUV_EXTEND = 1;
I0.SUBUV_COLOR = 2;
class rre extends Y0 {
  /**
   * Instantiates a new Custom Procedural Texture.
   * Procedural texturing is a way to programmatically create a texture. There are 2 types of procedural textures: code-only, and code that references some classic 2D images, sometimes called 'refMaps' or 'sampler' images.
   * Custom Procedural textures are the easiest way to create your own procedural in your application.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/proceduralTextures#creating-custom-procedural-textures
   * @param name Define the name of the texture
   * @param texturePath Define the folder path containing all the custom texture related files (config, shaders...)
   * @param size Define the size of the texture to create
   * @param scene Define the scene the texture belongs to
   * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
   * @param generateMipMaps Define if the texture should creates mip maps or not
   * @param skipJson Define a boolena indicating that there is no json config file to load
   */
  constructor(e, t, r, n, i, s, a) {
    super(e, r, null, n, i, s), this._animate = !0, this._time = 0, this._texturePath = t, a ? this.setFragment(this._texturePath) : this._loadJson(t), this.refreshRate = 1;
  }
  _loadJson(e) {
    const t = () => {
      try {
        this.setFragment(this._texturePath);
      } catch {
        Se.Log("No json or ShaderStore or DOM element found for CustomProceduralTexture");
      }
    }, r = e + "/config.json", n = new ho();
    n.open("GET", r), n.addEventListener("load", () => {
      if (n.status === 200 || n.responseText && n.responseText.length > 0)
        try {
          this._config = JSON.parse(n.response), this.updateShaderUniforms(), this.updateTextures(), this.setFragment(this._texturePath + "/custom"), this._animate = this._config.animate, this.refreshRate = this._config.refreshrate;
        } catch {
          t();
        }
      else
        t();
    }, !1), n.addEventListener("error", () => {
      t();
    }, !1);
    try {
      n.send();
    } catch {
      Se.Error("CustomProceduralTexture: Error on XHR send request.");
    }
  }
  /**
   * Is the texture ready to be used ? (rendered at least once)
   * @returns true if ready, otherwise, false.
   */
  isReady() {
    if (!super.isReady())
      return !1;
    for (const e in this._textures)
      if (!this._textures[e].isReady())
        return !1;
    return !0;
  }
  /**
   * Render the texture to its associated render target.
   * @param useCameraPostProcess Define if camera post process should be applied to the texture
   */
  render(e) {
    const t = this.getScene();
    this._animate && t && (this._time += t.getAnimationRatio() * 0.03, this.updateShaderUniforms()), super.render(e);
  }
  /**
   * Update the list of dependant textures samplers in the shader.
   */
  updateTextures() {
    for (let e = 0; e < this._config.sampler2Ds.length; e++)
      this.setTexture(this._config.sampler2Ds[e].sample2Dname, new We(this._texturePath + "/" + this._config.sampler2Ds[e].textureRelativeUrl, this.getScene()));
  }
  /**
   * Update the uniform values of the procedural texture in the shader.
   */
  updateShaderUniforms() {
    if (this._config)
      for (let e = 0; e < this._config.uniforms.length; e++) {
        const t = this._config.uniforms[e];
        switch (t.type) {
          case "float":
            this.setFloat(t.name, t.value);
            break;
          case "color3":
            this.setColor3(t.name, new Ne(t.r, t.g, t.b));
            break;
          case "color4":
            this.setColor4(t.name, new xt(t.r, t.g, t.b, t.a));
            break;
          case "vector2":
            this.setVector2(t.name, new at(t.x, t.y));
            break;
          case "vector3":
            this.setVector3(t.name, new S(t.x, t.y, t.z));
            break;
        }
      }
    this.setFloat("time", this._time);
  }
  /**
   * Define if the texture animates or not.
   */
  get animate() {
    return this._animate;
  }
  set animate(e) {
    this._animate = e;
  }
}
const Kpe = "noisePixelShader", Jpe = `uniform float brightness;uniform float persistence;uniform float timeScale;varying vec2 vUV;vec2 hash22(vec2 p)
{p=p*mat2(127.1,311.7,269.5,183.3);p=-1.0+2.0*fract(sin(p)*43758.5453123);return sin(p*6.283+timeScale);}
float interpolationNoise(vec2 p)
{vec2 pi=floor(p);vec2 pf=p-pi;vec2 w=pf*pf*(3.-2.*pf);float f00=dot(hash22(pi+vec2(.0,.0)),pf-vec2(.0,.0));float f01=dot(hash22(pi+vec2(.0,1.)),pf-vec2(.0,1.));float f10=dot(hash22(pi+vec2(1.0,0.)),pf-vec2(1.0,0.));float f11=dot(hash22(pi+vec2(1.0,1.)),pf-vec2(1.0,1.));float xm1=mix(f00,f10,w.x);float xm2=mix(f01,f11,w.x);float ym=mix(xm1,xm2,w.y); 
return ym;}
float perlinNoise2D(float x,float y)
{float sum=0.0;float frequency=0.0;float amplitude=0.0;for(int i=0; i<OCTAVES; i++)
{frequency=pow(2.0,float(i));amplitude=pow(persistence,float(i));sum=sum+interpolationNoise(vec2(x*frequency,y*frequency))*amplitude;}
return sum;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{float x=abs(vUV.x);float y=abs(vUV.y);float noise=brightness+(1.0-brightness)*perlinNoise2D(x,y);gl_FragColor=vec4(noise,noise,noise,1.0);}
`;
Le.ShadersStore[Kpe] = Jpe;
class ZI extends Y0 {
  /**
   * Creates a new NoiseProceduralTexture
   * @param name defines the name fo the texture
   * @param size defines the size of the texture (default is 256)
   * @param scene defines the hosting scene
   * @param fallbackTexture defines the texture to use if the NoiseProceduralTexture can't be created
   * @param generateMipMaps defines if mipmaps must be generated (true by default)
   */
  constructor(e, t = 256, r = gr.LastCreatedScene, n, i) {
    super(e, t, "noise", r, n, i), this.time = 0, this.brightness = 0.2, this.octaves = 3, this.persistence = 0.8, this.animationSpeedFactor = 1, this.autoClear = !1, this._updateShaderUniforms();
  }
  _updateShaderUniforms() {
    const e = this.getScene();
    e && (this.time += e.getAnimationRatio() * this.animationSpeedFactor * 0.01, this.setFloat("brightness", this.brightness), this.setFloat("persistence", this.persistence), this.setFloat("timeScale", this.time));
  }
  _getDefines() {
    return "#define OCTAVES " + (this.octaves | 0);
  }
  /**
   * Generate the current state of the procedural texture
   * @param useCameraPostProcess
   */
  render(e) {
    this._updateShaderUniforms(), super.render(e);
  }
  /**
   * Serializes this noise procedural texture
   * @returns a serialized noise procedural texture object
   */
  serialize() {
    const e = {};
    return e.customType = "BABYLON.NoiseProceduralTexture", e.brightness = this.brightness, e.octaves = this.octaves, e.persistence = this.persistence, e.animationSpeedFactor = this.animationSpeedFactor, e.size = this.getSize().width, e.generateMipMaps = this._generateMipMaps, e.time = this.time, e;
  }
  /**
   * Clone the texture.
   * @returns the cloned texture
   */
  clone() {
    const e = this.getSize(), t = new ZI(this.name, e.width, this.getScene(), this._fallbackTexture ? this._fallbackTexture : void 0, this._generateMipMaps);
    return t.hasAlpha = this.hasAlpha, t.level = this.level, t.coordinatesMode = this.coordinatesMode, t.brightness = this.brightness, t.octaves = this.octaves, t.persistence = this.persistence, t.animationSpeedFactor = this.animationSpeedFactor, t.time = this.time, t;
  }
  /**
   * Creates a NoiseProceduralTexture from parsed noise procedural texture data
   * @param parsedTexture defines parsed texture data
   * @param scene defines the current scene
   * @returns a parsed NoiseProceduralTexture
   */
  static Parse(e, t) {
    var r;
    const n = new ZI(e.name, e.size, t, void 0, e.generateMipMaps);
    return n.brightness = e.brightness, n.octaves = e.octaves, n.persistence = e.persistence, n.animationSpeedFactor = e.animationSpeedFactor, n.time = (r = e.time) !== null && r !== void 0 ? r : 0, n;
  }
}
Ue("BABYLON.NoiseProceduralTexture", ZI);
class hy extends v1 {
  /**
   * Creates a cube texture where the raw buffers are passed in.
   * @param scene defines the scene the texture is attached to
   * @param data defines the array of data to use to create each face
   * @param size defines the size of the textures
   * @param format defines the format of the data
   * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
   * @param generateMipMaps  defines if the engine should generate the mip levels
   * @param invertY defines if data must be stored with Y axis inverted
   * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
   * @param compression defines the compression used (null by default)
   */
  constructor(e, t, r, n = 5, i = 0, s = !1, a = !1, f = 3, o = null) {
    super("", e), this._texture = e.getEngine().createRawCubeTexture(t, r, n, i, s, a, f, o);
  }
  /**
   * Updates the raw cube texture.
   * @param data defines the data to store
   * @param format defines the data format
   * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
   * @param invertY defines if data must be stored with Y axis inverted
   * @param compression defines the compression used (null by default)
   */
  update(e, t, r, n, i = null) {
    this._texture.getEngine().updateRawCubeTexture(this._texture, e, t, r, n, i);
  }
  /**
   * Updates a raw cube texture with RGBD encoded data.
   * @param data defines the array of data [mipmap][face] to use to create each face
   * @param sphericalPolynomial defines the spherical polynomial for irradiance
   * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
   * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
   * @returns a promise that resolves when the operation is complete
   */
  updateRGBDAsync(e, t = null, r = 0.8, n = 0) {
    return pte(this._texture, e, t, r, n).then(() => {
    });
  }
  /**
   * Clones the raw cube texture.
   * @returns a new cube texture
   */
  clone() {
    return jt.Clone(() => {
      const e = this.getScene(), t = this._texture, r = new hy(e, t._bufferViewArray, t.width, t.format, t.type, t.generateMipMaps, t.invertY, t.samplingMode, t._compression);
      return t.source === ri.CubeRawRGBD && r.updateRGBDAsync(t._bufferViewArrayArray, t._sphericalPolynomial, t._lodGenerationScale, t._lodGenerationOffset), r;
    }, this);
  }
}
class zpe extends We {
  /**
   * Create a new RawTexture3D
   * @param data defines the data of the texture
   * @param width defines the width of the texture
   * @param height defines the height of the texture
   * @param depth defines the depth of the texture
   * @param format defines the texture format to use
   * @param scene defines the hosting scene
   * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)
   * @param invertY defines if texture must be stored with Y axis inverted
   * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)
   * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
   * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
   */
  constructor(e, t, r, n, i, s, a = !0, f = !1, o = We.TRILINEAR_SAMPLINGMODE, d = 0, v) {
    super(null, s, !a, f), this.format = i, this._texture = s.getEngine().createRawTexture3D(e, t, r, n, i, a, f, o, null, d, v), this.is3D = !0;
  }
  /**
   * Update the texture with new data
   * @param data defines the data to store in the texture
   */
  update(e) {
    this._texture && this._getEngine().updateRawTexture3D(this._texture, e, this._texture.format, this._texture.invertY, null, this._texture.type);
  }
}
class tY extends Ta {
  /**
   * Creates a refraction texture used by refraction channel of the standard material.
   * It is like a mirror but to see through a material.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refraction
   * @param name Define the texture name
   * @param size Define the size of the underlying texture
   * @param scene Define the scene the refraction belongs to
   * @param generateMipMaps Define if we need to generate mips level for the refraction
   */
  constructor(e, t, r, n) {
    super(e, t, r, n, !0), this.refractionPlane = new BA(0, 1, 0, 1), this.depth = 2, this.onBeforeRenderObservable.add(() => {
      this.getScene().clipPlane = this.refractionPlane;
    }), this.onAfterRenderObservable.add(() => {
      this.getScene().clipPlane = null;
    });
  }
  /**
   * Clone the refraction texture.
   * @returns the cloned texture
   */
  clone() {
    const e = this.getScene();
    if (!e)
      return this;
    const t = this.getSize(), r = new tY(this.name, t.width, e, this._generateMipMaps);
    return r.hasAlpha = this.hasAlpha, r.level = this.level, r.refractionPlane = this.refractionPlane.clone(), this.renderList && (r.renderList = this.renderList.slice(0)), r.depth = this.depth, r;
  }
  /**
   * Serialize the texture to a JSON representation you could use in Parse later on
   * @returns the serialized JSON representation
   */
  serialize() {
    if (!this.name)
      return null;
    const e = super.serialize();
    return e.mirrorPlane = this.refractionPlane.asArray(), e.depth = this.depth, e;
  }
}
class Gpe extends nq {
  /**
   * Gets the render target wrapper associated with this render target
   */
  get renderTarget() {
    return this._renderTarget;
  }
  /**
   * Instantiates a new ThinRenderTargetTexture.
   * Tiny helper class to wrap a RenderTargetWrapper in a texture.
   * This can be used as an internal texture wrapper in ThinEngine to benefit from the cache and to hold on the associated RTT
   * @param engine Define the internalTexture to wrap
   * @param size Define the size of the RTT to create
   * @param options Define rendertarget options
   */
  constructor(e, t, r) {
    super(null), this._renderTarget = null, this._engine = e, this._renderTargetOptions = r, this.resize(t);
  }
  /**
   * Resize the texture to a new desired size.
   * Be careful as it will recreate all the data in the new texture.
   * @param size Define the new size. It can be:
   *   - a number for squared texture,
   *   - an object containing { width: number, height: number }
   */
  resize(e) {
    var t;
    (t = this._renderTarget) === null || t === void 0 || t.dispose(), this._renderTarget = null, this._texture = null, this._size = e, this._engine && (this._renderTarget = this._engine.createRenderTargetTexture(this._size, this._renderTargetOptions)), this._texture = this.renderTarget.texture;
  }
  /**
   * Get the underlying lower level texture from Babylon.
   * @returns the internal texture
   */
  getInternalTexture() {
    return this._texture;
  }
  /**
   * Get the class name of the texture.
   * @returns "ThinRenderTargetTexture"
   */
  getClassName() {
    return "ThinRenderTargetTexture";
  }
  /**
   * Dispose the texture and release its associated resources.
   * @param disposeOnlyFramebuffers
   */
  dispose(e = !1) {
    var t;
    (t = this._renderTarget) === null || t === void 0 || t.dispose(!0), this._renderTarget = null, e || super.dispose();
  }
}
class Ko extends um {
  /**
   * Creates a new connection point
   * @param name defines the connection point name
   * @param ownerBlock defines the block hosting this connection point
   * @param direction defines the direction of the connection point
   * @param _blockType
   * @param _blockName
   */
  constructor(e, t, r, n, i) {
    super(e, t, r), this._blockType = n, this._blockName = i, this.needDualDirectionValidation = !0;
  }
  /**
   * Gets a number indicating if the current point can be connected to another point
   * @param connectionPoint defines the other connection point
   * @returns a number defining the compatibility state
   */
  checkCompatibilityState(e) {
    return e instanceof Ko && e._blockName === this._blockName ? pc.Compatible : pc.TypeIncompatible;
  }
  /**
   * Creates a block suitable to be used as an input for this input point.
   * If null is returned, a block based on the point type will be created.
   * @returns The returned string parameter is the name of the output point of NodeMaterialBlock (first parameter of the returned array) that can be connected to the input
   */
  createCustomInputBlock() {
    return [new this._blockType(this._blockName), this.name];
  }
}
class nre extends Mr {
  /**
   * Creates a new BonesBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Vertex), this.registerInput("matricesIndices", de.Vector4), this.registerInput("matricesWeights", de.Vector4), this.registerInput("matricesIndicesExtra", de.Vector4, !0), this.registerInput("matricesWeightsExtra", de.Vector4, !0), this.registerInput("world", de.Matrix), this.registerOutput("output", de.Matrix);
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("boneSampler"), e._excludeVariableName("boneTextureWidth"), e._excludeVariableName("mBones"), e._excludeVariableName("BonesPerMesh");
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "BonesBlock";
  }
  /**
   * Gets the matrix indices input component
   */
  get matricesIndices() {
    return this._inputs[0];
  }
  /**
   * Gets the matrix weights input component
   */
  get matricesWeights() {
    return this._inputs[1];
  }
  /**
   * Gets the extra matrix indices input component
   */
  get matricesIndicesExtra() {
    return this._inputs[2];
  }
  /**
   * Gets the extra matrix weights input component
   */
  get matricesWeightsExtra() {
    return this._inputs[3];
  }
  /**
   * Gets the world input component
   */
  get world() {
    return this._inputs[4];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  autoConfigure(e, t = () => !0) {
    if (!this.matricesIndices.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "matricesIndices" && t(n));
      r || (r = new gi("matricesIndices"), r.setAsAttribute("matricesIndices")), r.output.connectTo(this.matricesIndices);
    }
    if (!this.matricesWeights.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "matricesWeights" && t(n));
      r || (r = new gi("matricesWeights"), r.setAsAttribute("matricesWeights")), r.output.connectTo(this.matricesWeights);
    }
    if (!this.world.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.World && t(n));
      r || (r = new gi("world"), r.setAsSystemValue(Bi.World)), r.output.connectTo(this.world);
    }
  }
  provideFallbacks(e, t) {
    e && e.useBones && e.computeBonesUsingShaders && e.skeleton && t.addCPUSkinningFallback(0, e);
  }
  bind(e, t, r) {
    Ye.BindBonesParameters(r, e);
  }
  prepareDefines(e, t, r) {
    r._areAttributesDirty && Ye.PrepareDefinesForBones(e, r);
  }
  _buildBlock(e) {
    super._buildBlock(e), e.sharedData.blocksWithFallbacks.push(this), e.sharedData.forcedBindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this), e.uniforms.push("boneTextureWidth"), e.uniforms.push("mBones"), e.samplers.push("boneSampler");
    const t = `//${this.name}`;
    e._emitFunctionFromInclude("bonesDeclaration", t, {
      removeAttributes: !0,
      removeUniforms: !1,
      removeVaryings: !0,
      removeIfDef: !1
    });
    const r = e._getFreeVariableName("influence");
    e.compilationString += e._emitCodeFromInclude("bonesVertex", t, {
      replaceStrings: [
        {
          search: /finalWorld=finalWorld\*influence;/,
          replace: ""
        },
        {
          search: /influence/gm,
          replace: r
        }
      ]
    });
    const n = this._outputs[0], i = this.world;
    return e.compilationString += `#if NUM_BONE_INFLUENCERS>0
`, e.compilationString += this._declareOutput(n, e) + ` = ${i.associatedVariableName} * ${r};
`, e.compilationString += `#else
`, e.compilationString += this._declareOutput(n, e) + ` = ${i.associatedVariableName};
`, e.compilationString += `#endif
`, this;
  }
}
Ue("BABYLON.BonesBlock", nre);
class ire extends Mr {
  /**
   * Creates a new InstancesBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Vertex), this.registerInput("world0", de.Vector4), this.registerInput("world1", de.Vector4), this.registerInput("world2", de.Vector4), this.registerInput("world3", de.Vector4), this.registerInput("world", de.Matrix, !0), this.registerOutput("output", de.Matrix), this.registerOutput("instanceID", de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "InstancesBlock";
  }
  /**
   * Gets the first world row input component
   */
  get world0() {
    return this._inputs[0];
  }
  /**
   * Gets the second world row input component
   */
  get world1() {
    return this._inputs[1];
  }
  /**
   * Gets the third world row input component
   */
  get world2() {
    return this._inputs[2];
  }
  /**
   * Gets the forth world row input component
   */
  get world3() {
    return this._inputs[3];
  }
  /**
   * Gets the world input component
   */
  get world() {
    return this._inputs[4];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets the instanceID component
   */
  get instanceID() {
    return this._outputs[1];
  }
  autoConfigure(e, t = () => !0) {
    if (!this.world0.connectedPoint) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "world0" && t(n));
      r || (r = new gi("world0"), r.setAsAttribute("world0")), r.output.connectTo(this.world0);
    }
    if (!this.world1.connectedPoint) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "world1" && t(n));
      r || (r = new gi("world1"), r.setAsAttribute("world1")), r.output.connectTo(this.world1);
    }
    if (!this.world2.connectedPoint) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "world2" && t(n));
      r || (r = new gi("world2"), r.setAsAttribute("world2")), r.output.connectTo(this.world2);
    }
    if (!this.world3.connectedPoint) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "world3" && t(n));
      r || (r = new gi("world3"), r.setAsAttribute("world3")), r.output.connectTo(this.world3);
    }
    if (!this.world.connectedPoint) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "world" && t(n));
      r || (r = new gi("world"), r.setAsSystemValue(Bi.World)), r.output.connectTo(this.world);
    }
    this.world.define = "!INSTANCES || THIN_INSTANCES";
  }
  prepareDefines(e, t, r, n = !1, i) {
    let s = !1;
    r.INSTANCES !== n && (r.setValue("INSTANCES", n), s = !0), i && r.THIN_INSTANCES !== !!(i != null && i.getRenderingMesh().hasThinInstances) && (r.setValue("THIN_INSTANCES", !!(i != null && i.getRenderingMesh().hasThinInstances)), s = !0), s && r.markAsUnprocessed();
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = e.sharedData.scene.getEngine();
    e.sharedData.blocksWithDefines.push(this);
    const r = this._outputs[0], n = this._outputs[1], i = this.world0, s = this.world1, a = this.world2, f = this.world3;
    return e.compilationString += `#ifdef INSTANCES
`, e.compilationString += this._declareOutput(r, e) + ` = mat4(${i.associatedVariableName}, ${s.associatedVariableName}, ${a.associatedVariableName}, ${f.associatedVariableName});
`, e.compilationString += `#ifdef THIN_INSTANCES
`, e.compilationString += `${r.associatedVariableName} = ${this.world.associatedVariableName} * ${r.associatedVariableName};
`, e.compilationString += `#endif
`, t._caps.canUseGLInstanceID ? e.compilationString += this._declareOutput(n, e) + ` = float(gl_InstanceID);
` : e.compilationString += this._declareOutput(n, e) + ` = 0.0;
`, e.compilationString += `#else
`, e.compilationString += this._declareOutput(r, e) + ` = ${this.world.associatedVariableName};
`, e.compilationString += this._declareOutput(n, e) + ` = 0.0;
`, e.compilationString += `#endif
`, this;
  }
}
Ue("BABYLON.InstancesBlock", ire);
class rY extends Mr {
  /**
   * Create a new MorphTargetsBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Vertex), this.registerInput("position", de.Vector3), this.registerInput("normal", de.Vector3), this.registerInput("tangent", de.AutoDetect), this.tangent.addExcludedConnectionPointFromAllowedTypes(de.Color4 | de.Vector4 | de.Vector3), this.registerInput("uv", de.Vector2), this.registerOutput("positionOutput", de.Vector3), this.registerOutput("normalOutput", de.Vector3), this.registerOutput("tangentOutput", de.Vector4), this.registerOutput("uvOutput", de.Vector2);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MorphTargetsBlock";
  }
  /**
   * Gets the position input component
   */
  get position() {
    return this._inputs[0];
  }
  /**
   * Gets the normal input component
   */
  get normal() {
    return this._inputs[1];
  }
  /**
   * Gets the tangent input component
   */
  get tangent() {
    return this._inputs[2];
  }
  /**
   * Gets the tangent input component
   */
  get uv() {
    return this._inputs[3];
  }
  /**
   * Gets the position output component
   */
  get positionOutput() {
    return this._outputs[0];
  }
  /**
   * Gets the normal output component
   */
  get normalOutput() {
    return this._outputs[1];
  }
  /**
   * Gets the tangent output component
   */
  get tangentOutput() {
    return this._outputs[2];
  }
  /**
   * Gets the tangent output component
   */
  get uvOutput() {
    return this._outputs[3];
  }
  initialize(e) {
    e._excludeVariableName("morphTargetInfluences");
  }
  autoConfigure(e, t = () => !0) {
    if (!this.position.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "position" && t(n));
      r || (r = new gi("position"), r.setAsAttribute()), r.output.connectTo(this.position);
    }
    if (!this.normal.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "normal" && t(n));
      r || (r = new gi("normal"), r.setAsAttribute("normal")), r.output.connectTo(this.normal);
    }
    if (!this.tangent.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "tangent" && t(n));
      r || (r = new gi("tangent"), r.setAsAttribute("tangent")), r.output.connectTo(this.tangent);
    }
    if (!this.uv.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "uv" && t(n));
      r || (r = new gi("uv"), r.setAsAttribute("uv")), r.output.connectTo(this.uv);
    }
  }
  prepareDefines(e, t, r) {
    if (e.morphTargetManager) {
      const n = e.morphTargetManager;
      n != null && n.isUsingTextureForTargets && n.numInfluencers !== r.NUM_MORPH_INFLUENCERS && r.markAsAttributesDirty();
    }
    r._areAttributesDirty && Ye.PrepareDefinesForMorphTargets(e, r);
  }
  bind(e, t, r) {
    r && r.morphTargetManager && r.morphTargetManager.numInfluencers > 0 && (Ye.BindMorphTargetParameters(r, e), r.morphTargetManager.isUsingTextureForTargets && r.morphTargetManager._bind(e));
  }
  replaceRepeatableContent(e, t, r, n) {
    const i = this.position, s = this.normal, a = this.tangent, f = this.uv, o = this.positionOutput, d = this.normalOutput, v = this.tangentOutput, u = this.uvOutput, l = e, P = n.NUM_MORPH_INFLUENCERS, p = r.morphTargetManager, c = p && p.supportsNormals && n.NORMAL, H = p && p.supportsTangents && n.TANGENT, T = p && p.supportsUVs && n.UV1;
    let q = "";
    p != null && p.isUsingTextureForTargets && P > 0 && (q += `float vertexID;
`);
    for (let b = 0; b < P; b++)
      q += `#ifdef MORPHTARGETS
`, p != null && p.isUsingTextureForTargets ? (q += `vertexID = float(gl_VertexID) * morphTargetTextureInfo.x;
`, q += `${o.associatedVariableName} += (readVector3FromRawSampler(${b}, vertexID) - ${i.associatedVariableName}) * morphTargetInfluences[${b}];
`, q += `vertexID += 1.0;
`) : q += `${o.associatedVariableName} += (position${b} - ${i.associatedVariableName}) * morphTargetInfluences[${b}];
`, c && (q += `#ifdef MORPHTARGETS_NORMAL
`, p != null && p.isUsingTextureForTargets ? (q += `${d.associatedVariableName} += (readVector3FromRawSampler(${b}, vertexID) - ${s.associatedVariableName}) * morphTargetInfluences[${b}];
`, q += `vertexID += 1.0;
`) : q += `${d.associatedVariableName} += (normal${b} - ${s.associatedVariableName}) * morphTargetInfluences[${b}];
`, q += `#endif
`), T && (q += `#ifdef MORPHTARGETS_UV
`, p != null && p.isUsingTextureForTargets ? (q += `${u.associatedVariableName} += (readVector3FromRawSampler(${b}, vertexID).xy - ${f.associatedVariableName}) * morphTargetInfluences[${b}];
`, q += `vertexID += 1.0;
`) : q += `${u.associatedVariableName}.xy += (uv_${b} - ${f.associatedVariableName}.xy) * morphTargetInfluences[${b}];
`, q += `#endif
`), H && (q += `#ifdef MORPHTARGETS_TANGENT
`, p != null && p.isUsingTextureForTargets ? q += `${v.associatedVariableName}.xyz += (readVector3FromRawSampler(${b}, vertexID) - ${a.associatedVariableName}.xyz) * morphTargetInfluences[${b}];
` : q += `${v.associatedVariableName}.xyz += (tangent${b} - ${a.associatedVariableName}.xyz) * morphTargetInfluences[${b}];
`, a.type === de.Vector4 ? q += `${v.associatedVariableName}.w = ${a.associatedVariableName}.w;
` : q += `${v.associatedVariableName}.w = 1.;
`, q += `#endif
`), q += `#endif
`;
    if (l.compilationString = l.compilationString.replace(this._repeatableContentAnchor, q), P > 0)
      for (let b = 0; b < P; b++)
        l.attributes.push(J.PositionKind + b), c && l.attributes.push(J.NormalKind + b), H && l.attributes.push(J.TangentKind + b), T && l.attributes.push(J.UVKind + "_" + b);
  }
  _buildBlock(e) {
    super._buildBlock(e), e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), e.sharedData.repeatableContentBlocks.push(this);
    const t = this.position, r = this.normal, n = this.tangent, i = this.uv, s = this.positionOutput, a = this.normalOutput, f = this.tangentOutput, o = this.uvOutput, d = `//${this.name}`;
    return e.uniforms.push("morphTargetInfluences"), e.uniforms.push("morphTargetTextureInfo"), e.uniforms.push("morphTargetTextureIndices"), e.samplers.push("morphTargets"), e._emitFunctionFromInclude("morphTargetsVertexGlobalDeclaration", d), e._emitFunctionFromInclude("morphTargetsVertexDeclaration", d, {
      repeatKey: "maxSimultaneousMorphTargets"
    }), e.compilationString += `${this._declareOutput(s, e)} = ${t.associatedVariableName};
`, e.compilationString += `#ifdef NORMAL
`, e.compilationString += `${this._declareOutput(a, e)} = ${r.associatedVariableName};
`, e.compilationString += `#else
`, e.compilationString += `${this._declareOutput(a, e)} = vec3(0., 0., 0.);
`, e.compilationString += `#endif
`, e.compilationString += `#ifdef TANGENT
`, e.compilationString += `${this._declareOutput(f, e)} = ${n.associatedVariableName};
`, e.compilationString += `#else
`, e.compilationString += `${this._declareOutput(f, e)} = vec4(0., 0., 0., 0.);
`, e.compilationString += `#endif
`, e.compilationString += `#ifdef UV1
`, e.compilationString += `${this._declareOutput(o, e)} = ${i.associatedVariableName};
`, e.compilationString += `#else
`, e.compilationString += `${this._declareOutput(o, e)} = vec2(0., 0.);
`, e.compilationString += `#endif
`, this._repeatableContentAnchor = e._repeatableContentAnchor, e.compilationString += this._repeatableContentAnchor, this;
  }
}
Ue("BABYLON.MorphTargetsBlock", rY);
class sre extends Mr {
  /**
   * Creates a new LightInformationBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Vertex), this.registerInput("worldPosition", de.Vector4, !1, Ve.Vertex), this.registerOutput("direction", de.Vector3), this.registerOutput("color", de.Color3), this.registerOutput("intensity", de.Float), this.registerOutput("shadowBias", de.Float), this.registerOutput("shadowNormalBias", de.Float), this.registerOutput("shadowDepthScale", de.Float), this.registerOutput("shadowDepthRange", de.Vector2);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "LightInformationBlock";
  }
  /**
   * Gets the world position input component
   */
  get worldPosition() {
    return this._inputs[0];
  }
  /**
   * Gets the direction output component
   */
  get direction() {
    return this._outputs[0];
  }
  /**
   * Gets the direction output component
   */
  get color() {
    return this._outputs[1];
  }
  /**
   * Gets the direction output component
   */
  get intensity() {
    return this._outputs[2];
  }
  /**
   * Gets the shadow bias output component
   */
  get shadowBias() {
    return this._outputs[3];
  }
  /**
   * Gets the shadow normal bias output component
   */
  get shadowNormalBias() {
    return this._outputs[4];
  }
  /**
   * Gets the shadow depth scale component
   */
  get shadowDepthScale() {
    return this._outputs[5];
  }
  /**
   * Gets the shadow depth range component
   */
  get shadowDepthRange() {
    return this._outputs[6];
  }
  bind(e, t, r) {
    if (!r)
      return;
    this.light && this.light.isDisposed() && (this.light = null);
    let n = this.light;
    const i = t.getScene();
    if (!n && i.lights.length && (n = this.light = i.lights[0], this._forcePrepareDefines = !0), !n || !n.isEnabled) {
      e.setFloat3(this._lightDataUniformName, 0, 0, 0), e.setFloat4(this._lightColorUniformName, 0, 0, 0, 0);
      return;
    }
    n.transferToNodeMaterialEffect(e, this._lightDataUniformName), e.setColor4(this._lightColorUniformName, n.diffuse, n.intensity);
    const s = n.getShadowGenerator();
    if ((this.shadowBias.hasEndpoints || this.shadowNormalBias.hasEndpoints || this.shadowDepthScale.hasEndpoints) && (s ? e.setFloat3(this._lightShadowUniformName, s.bias, s.normalBias, s.depthScale) : e.setFloat3(this._lightShadowUniformName, 0, 0, 0)), this.shadowDepthRange)
      if (s && i.activeCamera) {
        const a = n;
        e.setFloat2(this._lightShadowExtraUniformName, a.getDepthMinZ(i.activeCamera), a.getDepthMinZ(i.activeCamera) + a.getDepthMaxZ(i.activeCamera));
      } else
        e.setFloat2(this._lightShadowExtraUniformName, 0, 0);
  }
  prepareDefines(e, t, r) {
    if (!r._areLightsDirty && !this._forcePrepareDefines)
      return;
    this._forcePrepareDefines = !1;
    const n = this.light;
    r.setValue(this._lightTypeDefineName, !!(n && n instanceof ag), !0);
  }
  _buildBlock(e) {
    super._buildBlock(e), e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this);
    const t = this.direction, r = this.color, n = this.intensity, i = this.shadowBias, s = this.shadowNormalBias, a = this.shadowDepthScale, f = this.shadowDepthRange;
    return this._lightDataUniformName = e._getFreeVariableName("lightData"), this._lightColorUniformName = e._getFreeVariableName("lightColor"), this._lightShadowUniformName = e._getFreeVariableName("shadowData"), this._lightShadowExtraUniformName = e._getFreeVariableName("shadowExtraData"), this._lightTypeDefineName = e._getFreeDefineName("LIGHTPOINTTYPE"), e._emitUniformFromString(this._lightDataUniformName, "vec3"), e._emitUniformFromString(this._lightColorUniformName, "vec4"), e.compilationString += `#ifdef ${this._lightTypeDefineName}
`, e.compilationString += this._declareOutput(t, e) + ` = normalize(${this.worldPosition.associatedVariableName}.xyz - ${this._lightDataUniformName});
`, e.compilationString += `#else
`, e.compilationString += this._declareOutput(t, e) + ` = ${this._lightDataUniformName};
`, e.compilationString += `#endif
`, e.compilationString += this._declareOutput(r, e) + ` = ${this._lightColorUniformName}.rgb;
`, e.compilationString += this._declareOutput(n, e) + ` = ${this._lightColorUniformName}.a;
`, (i.hasEndpoints || s.hasEndpoints || a.hasEndpoints) && (e._emitUniformFromString(this._lightShadowUniformName, "vec3"), i.hasEndpoints && (e.compilationString += this._declareOutput(i, e) + ` = ${this._lightShadowUniformName}.x;
`), s.hasEndpoints && (e.compilationString += this._declareOutput(s, e) + ` = ${this._lightShadowUniformName}.y;
`), a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + ` = ${this._lightShadowUniformName}.z;
`)), f.hasEndpoints && (e._emitUniformFromString(this._lightShadowExtraUniformName, "vec2"), e.compilationString += this._declareOutput(f, e) + ` = ${this._lightShadowUniformName};
`), this;
  }
  serialize() {
    const e = super.serialize();
    return this.light && (e.lightId = this.light.id), e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), e.lightId && (this.light = t.getLightById(e.lightId));
  }
}
Ue("BABYLON.LightInformationBlock", sre);
class nY extends Mr {
  /**
   * Create a new ImageProcessingBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.convertInputToLinearSpace = !0, this.registerInput("color", de.AutoDetect), this.registerOutput("output", de.Color4), this.registerOutput("rgb", de.Color3), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Color4 | de.Vector3 | de.Vector4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ImageProcessingBlock";
  }
  /**
   * Gets the color input component
   */
  get color() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets the rgb component
   */
  get rgb() {
    return this._outputs[1];
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("exposureLinear"), e._excludeVariableName("contrast"), e._excludeVariableName("vInverseScreenSize"), e._excludeVariableName("vignetteSettings1"), e._excludeVariableName("vignetteSettings2"), e._excludeVariableName("vCameraColorCurveNegative"), e._excludeVariableName("vCameraColorCurveNeutral"), e._excludeVariableName("vCameraColorCurvePositive"), e._excludeVariableName("txColorTransform"), e._excludeVariableName("colorTransformSettings"), e._excludeVariableName("ditherIntensity");
  }
  isReady(e, t, r) {
    return !(r._areImageProcessingDirty && t.imageProcessingConfiguration && !t.imageProcessingConfiguration.isReady());
  }
  prepareDefines(e, t, r) {
    r._areImageProcessingDirty && t.imageProcessingConfiguration && t.imageProcessingConfiguration.prepareDefines(r);
  }
  bind(e, t, r) {
    r && t.imageProcessingConfiguration && t.imageProcessingConfiguration.bind(e);
  }
  _buildBlock(e) {
    var t;
    super._buildBlock(e), e.sharedData.blocksWithDefines.push(this), e.sharedData.blockingBlocks.push(this), e.sharedData.bindableBlocks.push(this), e.uniforms.push("exposureLinear"), e.uniforms.push("contrast"), e.uniforms.push("vInverseScreenSize"), e.uniforms.push("vignetteSettings1"), e.uniforms.push("vignetteSettings2"), e.uniforms.push("vCameraColorCurveNegative"), e.uniforms.push("vCameraColorCurveNeutral"), e.uniforms.push("vCameraColorCurvePositive"), e.uniforms.push("txColorTransform"), e.uniforms.push("colorTransformSettings"), e.uniforms.push("ditherIntensity");
    const r = this.color, n = this._outputs[0], i = `//${this.name}`;
    return e._emitFunctionFromInclude("helperFunctions", i), e._emitFunctionFromInclude("imageProcessingDeclaration", i), e._emitFunctionFromInclude("imageProcessingFunctions", i), !((t = r.connectedPoint) === null || t === void 0) && t.isConnected && (r.connectedPoint.type === de.Color4 || r.connectedPoint.type === de.Vector4 ? e.compilationString += `${this._declareOutput(n, e)} = ${r.associatedVariableName};
` : e.compilationString += `${this._declareOutput(n, e)} = vec4(${r.associatedVariableName}, 1.0);
`, e.compilationString += `#ifdef IMAGEPROCESSINGPOSTPROCESS
`, this.convertInputToLinearSpace && (e.compilationString += `${n.associatedVariableName}.rgb = toLinearSpace(${r.associatedVariableName}.rgb);
`), e.compilationString += `#else
`, e.compilationString += `#ifdef IMAGEPROCESSING
`, this.convertInputToLinearSpace && (e.compilationString += `${n.associatedVariableName}.rgb = toLinearSpace(${r.associatedVariableName}.rgb);
`), e.compilationString += `${n.associatedVariableName} = applyImageProcessing(${n.associatedVariableName});
`, e.compilationString += `#endif
`, e.compilationString += `#endif
`, this.rgb.hasEndpoints && (e.compilationString += this._declareOutput(this.rgb, e) + ` = ${this.output.associatedVariableName}.xyz;
`)), this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.convertInputToLinearSpace = ${this.convertInputToLinearSpace};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return e.convertInputToLinearSpace = this.convertInputToLinearSpace, e;
  }
  _deserialize(e, t, r) {
    var n;
    super._deserialize(e, t, r), this.convertInputToLinearSpace = (n = e.convertInputToLinearSpace) !== null && n !== void 0 ? n : !0;
  }
}
C([
  rn("Convert input to linear space", Gr.Boolean, "ADVANCED")
], nY.prototype, "convertInputToLinearSpace", void 0);
Ue("BABYLON.ImageProcessingBlock", nY);
class Rm extends Mr {
  /**
   * Create a new TBNBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment, !0), this.registerInput("normal", de.AutoDetect, !1), this.normal.addExcludedConnectionPointFromAllowedTypes(de.Color4 | de.Vector4 | de.Vector3), this.registerInput("tangent", de.Vector4, !1), this.registerInput("world", de.Matrix, !1), this.registerOutput("TBN", de.Object, Ve.Fragment, new Ko("TBN", this, ao.Output, Rm, "TBNBlock")), this.registerOutput("row0", de.Vector3, Ve.Fragment), this.registerOutput("row1", de.Vector3, Ve.Fragment), this.registerOutput("row2", de.Vector3, Ve.Fragment);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "TBNBlock";
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("tbnNormal"), e._excludeVariableName("tbnTangent"), e._excludeVariableName("tbnBitangent"), e._excludeVariableName("TBN");
  }
  /**
   * Gets the normal input component
   */
  get normal() {
    return this._inputs[0];
  }
  /**
   * Gets the tangent input component
   */
  get tangent() {
    return this._inputs[1];
  }
  /**
   * Gets the world matrix input component
   */
  get world() {
    return this._inputs[2];
  }
  /**
   * Gets the TBN output component
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  get TBN() {
    return this._outputs[0];
  }
  /**
   * Gets the row0 of the output matrix
   */
  get row0() {
    return this._outputs[1];
  }
  /**
   * Gets the row1 of the output matrix
   */
  get row1() {
    return this._outputs[2];
  }
  /**
   * Gets the row2 of the output matrix
   */
  get row2() {
    return this._outputs[3];
  }
  get target() {
    return Ve.Fragment;
  }
  set target(e) {
  }
  autoConfigure(e, t = () => !0) {
    if (!this.world.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isSystemValue && n.systemValue === Bi.World && t(n));
      r || (r = new gi("world"), r.setAsSystemValue(Bi.World)), r.output.connectTo(this.world);
    }
    if (!this.normal.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "normal" && t(n));
      r || (r = new gi("normal"), r.setAsAttribute("normal")), r.output.connectTo(this.normal);
    }
    if (!this.tangent.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "tangent" && n.type === de.Vector4 && t(n));
      r || (r = new gi("tangent"), r.setAsAttribute("tangent")), r.output.connectTo(this.tangent);
    }
  }
  prepareDefines(e, t, r) {
    var n, i, s, a;
    const f = this.normal, o = this.tangent;
    let d = f.isConnected;
    !((n = f.connectInputBlock) === null || n === void 0) && n.isAttribute && !e.isVerticesDataPresent((i = f.connectInputBlock) === null || i === void 0 ? void 0 : i.name) && (d = !1);
    let v = o.isConnected;
    !((s = o.connectInputBlock) === null || s === void 0) && s.isAttribute && !e.isVerticesDataPresent((a = o.connectInputBlock) === null || a === void 0 ? void 0 : a.name) && (v = !1);
    const u = d && v;
    r.setValue("TBNBLOCK", u, !0);
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.normal, r = this.tangent, n = this.world, i = this.TBN, s = this.row0, a = this.row1, f = this.row2;
    return e.target === Ve.Fragment && (e.compilationString += `
                // ${this.name}
                vec3 tbnNormal = normalize(${t.associatedVariableName}).xyz;
                vec3 tbnTangent = normalize(${r.associatedVariableName}.xyz);
                vec3 tbnBitangent = cross(tbnNormal, tbnTangent) * ${r.associatedVariableName}.w;
                mat3 ${i.associatedVariableName} = mat3(${n.associatedVariableName}) * mat3(tbnTangent, tbnBitangent, tbnNormal);
            `, s.hasEndpoints && (e.compilationString += this._declareOutput(s, e) + ` = vec3(${i.associatedVariableName}[0][0], ${i.associatedVariableName}[0][1], ${i.associatedVariableName}[0][2]);
`), a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + ` = vec3(${i.associatedVariableName}[1[0], ${i.associatedVariableName}[1][1], ${i.associatedVariableName}[1][2]);
`), f.hasEndpoints && (e.compilationString += this._declareOutput(f, e) + ` = vec3(${i.associatedVariableName}[2][0], ${i.associatedVariableName}[2][1], ${i.associatedVariableName}[2][2]);
`), e.sharedData.blocksWithDefines.push(this)), this;
  }
}
Ue("BABYLON.TBNBlock", Rm);
class PU extends Mr {
  /**
   * Create a new PerturbNormalBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this._tangentSpaceParameterName = "", this._tangentCorrectionFactorName = "", this._worldMatrixName = "", this.invertX = !1, this.invertY = !1, this.useParallaxOcclusion = !1, this.useObjectSpaceNormalMap = !1, this._isUnique = !0, this.registerInput("worldPosition", de.Vector4, !1), this.registerInput("worldNormal", de.Vector4, !1), this.registerInput("worldTangent", de.Vector4, !0), this.registerInput("uv", de.Vector2, !1), this.registerInput("normalMapColor", de.Color3, !1), this.registerInput("strength", de.Float, !1), this.registerInput("viewDirection", de.Vector3, !0), this.registerInput("parallaxScale", de.Float, !0), this.registerInput("parallaxHeight", de.Float, !0), this.registerInput("TBN", de.Object, !0, Ve.VertexAndFragment, new Ko("TBN", this, ao.Input, Rm, "TBNBlock")), this.registerInput("world", de.Matrix, !0), this.registerOutput("output", de.Vector4), this.registerOutput("uvOffset", de.Vector2);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "PerturbNormalBlock";
  }
  /**
   * Gets the world position input component
   */
  get worldPosition() {
    return this._inputs[0];
  }
  /**
   * Gets the world normal input component
   */
  get worldNormal() {
    return this._inputs[1];
  }
  /**
   * Gets the world tangent input component
   */
  get worldTangent() {
    return this._inputs[2];
  }
  /**
   * Gets the uv input component
   */
  get uv() {
    return this._inputs[3];
  }
  /**
   * Gets the normal map color input component
   */
  get normalMapColor() {
    return this._inputs[4];
  }
  /**
   * Gets the strength input component
   */
  get strength() {
    return this._inputs[5];
  }
  /**
   * Gets the view direction input component
   */
  get viewDirection() {
    return this._inputs[6];
  }
  /**
   * Gets the parallax scale input component
   */
  get parallaxScale() {
    return this._inputs[7];
  }
  /**
   * Gets the parallax height input component
   */
  get parallaxHeight() {
    return this._inputs[8];
  }
  /**
   * Gets the TBN input component
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  get TBN() {
    return this._inputs[9];
  }
  /**
   * Gets the World input component
   */
  get world() {
    return this._inputs[10];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets the uv offset output component
   */
  get uvOffset() {
    return this._outputs[1];
  }
  prepareDefines(e, t, r) {
    const n = this.normalMapColor.connectedPoint._ownerBlock.samplerName, i = this.viewDirection.isConnected && (this.useParallaxOcclusion && n || !this.useParallaxOcclusion && this.parallaxHeight.isConnected);
    r.setValue("BUMP", !0), r.setValue("PARALLAX", i, !0), r.setValue("PARALLAX_RHS", t.getScene().useRightHandedSystem, !0), r.setValue("PARALLAXOCCLUSION", this.useParallaxOcclusion, !0), r.setValue("OBJECTSPACE_NORMALMAP", this.useObjectSpaceNormalMap, !0);
  }
  bind(e, t, r) {
    t.getScene()._mirroredCameraPosition ? e.setFloat2(this._tangentSpaceParameterName, this.invertX ? 1 : -1, this.invertY ? 1 : -1) : e.setFloat2(this._tangentSpaceParameterName, this.invertX ? -1 : 1, this.invertY ? -1 : 1), r && (e.setFloat(this._tangentCorrectionFactorName, r.getWorldMatrix().determinant() < 0 ? -1 : 1), this.useObjectSpaceNormalMap && !this.world.isConnected && e.setMatrix(this._worldMatrixName, r.getWorldMatrix()));
  }
  autoConfigure(e, t = () => !0) {
    if (!this.uv.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "uv" && t(n));
      r || (r = new gi("uv"), r.setAsAttribute()), r.output.connectTo(this.uv);
    }
    if (!this.strength.isConnected) {
      const r = new gi("strength");
      r.value = 1, r.output.connectTo(this.strength);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = `//${this.name}`, r = this.uv, n = this.worldPosition, i = this.worldNormal, s = this.worldTangent;
    e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), this._tangentSpaceParameterName = e._getFreeDefineName("tangentSpaceParameter"), e._emitUniformFromString(this._tangentSpaceParameterName, "vec2"), this._tangentCorrectionFactorName = e._getFreeDefineName("tangentCorrectionFactor"), e._emitUniformFromString(this._tangentCorrectionFactorName, "float"), this._worldMatrixName = e._getFreeDefineName("perturbNormalWorldMatrix"), e._emitUniformFromString(this._worldMatrixName, "mat4");
    let a = null;
    this.normalMapColor.connectedPoint && (a = this.normalMapColor.connectedPoint._ownerBlock.samplerName);
    const f = this.viewDirection.isConnected && (this.useParallaxOcclusion && a || !this.useParallaxOcclusion && this.parallaxHeight.isConnected), o = this.parallaxScale.isConnectedToInputBlock ? this.parallaxScale.connectInputBlock.isConstant ? e._emitFloat(this.parallaxScale.connectInputBlock.value) : this.parallaxScale.associatedVariableName : "0.05", d = this.strength.isConnectedToInputBlock && this.strength.connectInputBlock.isConstant ? `
#if !defined(NORMALXYSCALE)
1.0/
#endif
${e._emitFloat(this.strength.connectInputBlock.value)}` : `
#if !defined(NORMALXYSCALE)
1.0/
#endif
${this.strength.associatedVariableName}`;
    e._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
    const v = { search: /defined\(TANGENT\)/g, replace: s.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" }, u = { search: /varying mat3 vTBN;/g, replace: "" }, l = { search: /uniform mat4 normalMatrix;/g, replace: "" }, P = this.TBN;
    P.isConnected ? e.compilationString += `
            #ifdef TBNBLOCK
            mat3 vTBN = ${P.associatedVariableName};
            #endif
            ` : s.isConnected && (e.compilationString += `vec3 tbnNormal = normalize(${i.associatedVariableName}.xyz);
`, e.compilationString += `vec3 tbnTangent = normalize(${s.associatedVariableName}.xyz);
`, e.compilationString += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent) * ${this._tangentCorrectionFactorName};
`, e.compilationString += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);
`), e._emitFunctionFromInclude("bumpFragmentMainFunctions", t, {
      replaceStrings: [v, u, l]
    }), e._emitFunctionFromInclude("bumpFragmentFunctions", t, {
      replaceStrings: [
        { search: /#include<samplerFragmentDeclaration>\(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump\)/g, replace: "" },
        { search: /uniform sampler2D bumpSampler;/g, replace: "" },
        {
          search: /vec2 parallaxOcclusion\(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale\)/g,
          replace: `#define inline
vec2 parallaxOcclusion(vec3 vViewDirCoT, vec3 vNormalCoT, vec2 texCoord, float parallaxScale, sampler2D bumpSampler)`
        },
        { search: /vec2 parallaxOffset\(vec3 viewDir,float heightScale\)/g, replace: "vec2 parallaxOffset(vec3 viewDir, float heightScale, float height_)" },
        { search: /texture2D\(bumpSampler,vBumpUV\)\.w/g, replace: "height_" }
      ]
    });
    const p = !f || !a ? this.normalMapColor.associatedVariableName : `texture2D(${a}, ${r.associatedVariableName} + uvOffset).xyz`;
    return e.compilationString += this._declareOutput(this.output, e) + ` = vec4(0.);
`, e.compilationString += e._emitCodeFromInclude("bumpFragment", t, {
      replaceStrings: [
        { search: /texture2D\(bumpSampler,vBumpUV\)/g, replace: `${p}` },
        {
          search: /#define CUSTOM_FRAGMENT_BUMP_FRAGMENT/g,
          replace: `mat4 normalMatrix = toNormalMatrix(${this.world.isConnected ? this.world.associatedVariableName : this._worldMatrixName});`
        },
        { search: /perturbNormal\(TBN,texture2D\(bumpSampler,vBumpUV\+uvOffset\).xyz,vBumpInfos.y\)/g, replace: `perturbNormal(TBN, ${p}, vBumpInfos.y)` },
        {
          search: /parallaxOcclusion\(invTBN\*-viewDirectionW,invTBN\*normalW,vBumpUV,vBumpInfos.z\)/g,
          replace: `parallaxOcclusion((invTBN * -viewDirectionW), (invTBN * normalW), vBumpUV, vBumpInfos.z, ${f && this.useParallaxOcclusion ? a : "bumpSampler"})`
        },
        {
          search: /parallaxOffset\(invTBN\*viewDirectionW,vBumpInfos\.z\)/g,
          replace: `parallaxOffset(invTBN * viewDirectionW, vBumpInfos.z, ${f ? this.parallaxHeight.associatedVariableName : "0."})`
        },
        { search: /vTangentSpaceParams/g, replace: this._tangentSpaceParameterName },
        { search: /vBumpInfos.y/g, replace: d },
        { search: /vBumpInfos.z/g, replace: o },
        { search: /vBumpUV/g, replace: r.associatedVariableName },
        { search: /vPositionW/g, replace: n.associatedVariableName + ".xyz" },
        { search: /normalW=/g, replace: this.output.associatedVariableName + ".xyz = " },
        { search: /mat3\(normalMatrix\)\*normalW/g, replace: "mat3(normalMatrix) * " + this.output.associatedVariableName + ".xyz" },
        { search: /normalW/g, replace: i.associatedVariableName + ".xyz" },
        { search: /viewDirectionW/g, replace: f ? this.viewDirection.associatedVariableName : "vec3(0.)" },
        v
      ]
    }), this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode() + `${this._codeVariableName}.invertX = ${this.invertX};
`;
    return e += `${this._codeVariableName}.invertY = ${this.invertY};
`, e += `${this._codeVariableName}.useParallaxOcclusion = ${this.useParallaxOcclusion};
`, e += `${this._codeVariableName}.useObjectSpaceNormalMap = ${this.useObjectSpaceNormalMap};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return e.invertX = this.invertX, e.invertY = this.invertY, e.useParallaxOcclusion = this.useParallaxOcclusion, e.useObjectSpaceNormalMap = this.useObjectSpaceNormalMap, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.invertX = e.invertX, this.invertY = e.invertY, this.useParallaxOcclusion = !!e.useParallaxOcclusion, this.useObjectSpaceNormalMap = !!e.useObjectSpaceNormalMap;
  }
}
C([
  rn("Invert X axis", Gr.Boolean, "PROPERTIES", { notifiers: { update: !1 } })
], PU.prototype, "invertX", void 0);
C([
  rn("Invert Y axis", Gr.Boolean, "PROPERTIES", { notifiers: { update: !1 } })
], PU.prototype, "invertY", void 0);
C([
  rn("Use parallax occlusion", Gr.Boolean)
], PU.prototype, "useParallaxOcclusion", void 0);
C([
  rn("Object Space Mode", Gr.Boolean, "PROPERTIES", { notifiers: { update: !1 } })
], PU.prototype, "useObjectSpaceNormalMap", void 0);
Ue("BABYLON.PerturbNormalBlock", PU);
class are extends Mr {
  /**
   * Create a new DiscardBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment, !0), this.registerInput("value", de.Float, !0), this.registerInput("cutoff", de.Float, !0);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "DiscardBlock";
  }
  /**
   * Gets the color input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the cutoff input component
   */
  get cutoff() {
    return this._inputs[1];
  }
  _buildBlock(e) {
    if (super._buildBlock(e), e.sharedData.hints.needAlphaTesting = !0, !(!this.cutoff.isConnected || !this.value.isConnected))
      return e.compilationString += `if (${this.value.associatedVariableName} < ${this.cutoff.associatedVariableName}) discard;
`, this;
  }
}
Ue("BABYLON.DiscardBlock", are);
class ore extends Mr {
  /**
   * Creates a new FrontFacingBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.registerOutput("output", de.Float, Ve.Fragment);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "FrontFacingBlock";
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    if (super._buildBlock(e), e.target === Ve.Vertex)
      throw "FrontFacingBlock must only be used in a fragment shader";
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = gl_FrontFacing ? 1.0 : 0.0;
`, this;
  }
}
Ue("BABYLON.FrontFacingBlock", ore);
class fre extends Mr {
  /**
   * Create a new DerivativeBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.registerInput("input", de.AutoDetect, !1), this.registerOutput("dx", de.BasedOnInput), this.registerOutput("dy", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._outputs[1]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "DerivativeBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the derivative output on x
   */
  get dx() {
    return this._outputs[0];
  }
  /**
   * Gets the derivative output on y
   */
  get dy() {
    return this._outputs[1];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], r = this._outputs[1];
    return e._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable"), t.hasEndpoints && (e.compilationString += this._declareOutput(t, e) + ` = dFdx(${this.input.associatedVariableName});
`), r.hasEndpoints && (e.compilationString += this._declareOutput(r, e) + ` = dFdy(${this.input.associatedVariableName});
`), this;
  }
}
Ue("BABYLON.DerivativeBlock", fre);
class Are extends Mr {
  /**
   * Creates a new FragCoordBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.registerOutput("xy", de.Vector2, Ve.Fragment), this.registerOutput("xyz", de.Vector3, Ve.Fragment), this.registerOutput("xyzw", de.Vector4, Ve.Fragment), this.registerOutput("x", de.Float, Ve.Fragment), this.registerOutput("y", de.Float, Ve.Fragment), this.registerOutput("z", de.Float, Ve.Fragment), this.registerOutput("w", de.Float, Ve.Fragment);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "FragCoordBlock";
  }
  /**
   * Gets the xy component
   */
  get xy() {
    return this._outputs[0];
  }
  /**
   * Gets the xyz component
   */
  get xyz() {
    return this._outputs[1];
  }
  /**
   * Gets the xyzw component
   */
  get xyzw() {
    return this._outputs[2];
  }
  /**
   * Gets the x component
   */
  get x() {
    return this._outputs[3];
  }
  /**
   * Gets the y component
   */
  get y() {
    return this._outputs[4];
  }
  /**
   * Gets the z component
   */
  get z() {
    return this._outputs[5];
  }
  /**
   * Gets the w component
   */
  get output() {
    return this._outputs[6];
  }
  // eslint-disable-next-line @typescript-eslint/naming-convention
  writeOutputs(e) {
    let t = "";
    for (const r of this._outputs)
      r.hasEndpoints && (t += `${this._declareOutput(r, e)} = gl_FragCoord.${r.name};
`);
    return t;
  }
  _buildBlock(e) {
    if (super._buildBlock(e), e.target === Ve.Vertex)
      throw "FragCoordBlock must only be used in a fragment shader";
    return e.compilationString += this.writeOutputs(e), this;
  }
}
Ue("BABYLON.FragCoordBlock", Are);
class dre extends Mr {
  /**
   * Creates a new ScreenSizeBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.registerOutput("xy", de.Vector2, Ve.Fragment), this.registerOutput("x", de.Float, Ve.Fragment), this.registerOutput("y", de.Float, Ve.Fragment);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ScreenSizeBlock";
  }
  /**
   * Gets the xy component
   */
  get xy() {
    return this._outputs[0];
  }
  /**
   * Gets the x component
   */
  get x() {
    return this._outputs[1];
  }
  /**
   * Gets the y component
   */
  get y() {
    return this._outputs[2];
  }
  bind(e) {
    const t = this._scene.getEngine();
    e.setFloat2(this._varName, t.getRenderWidth(), t.getRenderHeight());
  }
  // eslint-disable-next-line @typescript-eslint/naming-convention
  writeOutputs(e, t) {
    let r = "";
    for (const n of this._outputs)
      n.hasEndpoints && (r += `${this._declareOutput(n, e)} = ${t}.${n.name};
`);
    return r;
  }
  _buildBlock(e) {
    if (super._buildBlock(e), this._scene = e.sharedData.scene, e.target === Ve.Vertex)
      throw "ScreenSizeBlock must only be used in a fragment shader";
    return e.sharedData.bindableBlocks.push(this), this._varName = e._getFreeVariableName("screenSize"), e._emitUniformFromString(this._varName, "vec2"), e.compilationString += this.writeOutputs(e, this._varName), this;
  }
}
Ue("BABYLON.ScreenSizeBlock", dre);
class vre extends Mr {
  /**
   * Creates a new ScreenSpaceBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.registerInput("vector", de.AutoDetect), this.registerInput("worldViewProjection", de.Matrix), this.registerOutput("output", de.Vector2), this.registerOutput("x", de.Float), this.registerOutput("y", de.Float), this.inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Vector3 | de.Vector4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ScreenSpaceBlock";
  }
  /**
   * Gets the vector input
   */
  get vector() {
    return this._inputs[0];
  }
  /**
   * Gets the worldViewProjection transform input
   */
  get worldViewProjection() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets the x output component
   */
  get x() {
    return this._outputs[1];
  }
  /**
   * Gets the y output component
   */
  get y() {
    return this._outputs[2];
  }
  autoConfigure(e, t = () => !0) {
    if (!this.worldViewProjection.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.WorldViewProjection && t(n));
      r || (r = new gi("worldViewProjection"), r.setAsSystemValue(Bi.WorldViewProjection)), r.output.connectTo(this.worldViewProjection);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.vector, r = this.worldViewProjection;
    if (!t.connectedPoint)
      return;
    const n = r.associatedVariableName, i = e._getFreeVariableName("screenSpaceTemp");
    switch (t.connectedPoint.type) {
      case de.Vector3:
        e.compilationString += `vec4 ${i} = ${n} * vec4(${t.associatedVariableName}, 1.0);
`;
        break;
      case de.Vector4:
        e.compilationString += `vec4 ${i} = ${n} * ${t.associatedVariableName};
`;
        break;
    }
    return e.compilationString += `${i}.xy /= ${i}.w;`, e.compilationString += `${i}.xy = ${i}.xy * 0.5 + vec2(0.5, 0.5);`, this.output.hasEndpoints && (e.compilationString += this._declareOutput(this.output, e) + ` = ${i}.xy;
`), this.x.hasEndpoints && (e.compilationString += this._declareOutput(this.x, e) + ` = ${i}.x;
`), this.y.hasEndpoints && (e.compilationString += this._declareOutput(this.y, e) + ` = ${i}.y;
`), this;
  }
}
Ue("BABYLON.ScreenSpaceBlock", vre);
class ure extends Mr {
  /**
   * Creates a new TwirlBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.registerInput("input", de.Vector2), this.registerInput("strength", de.Float), this.registerInput("center", de.Vector2), this.registerInput("offset", de.Vector2), this.registerOutput("output", de.Vector2), this.registerOutput("x", de.Float), this.registerOutput("y", de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "TwirlBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the strength component
   */
  get strength() {
    return this._inputs[1];
  }
  /**
   * Gets the center component
   */
  get center() {
    return this._inputs[2];
  }
  /**
   * Gets the offset component
   */
  get offset() {
    return this._inputs[3];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets the x output component
   */
  get x() {
    return this._outputs[1];
  }
  /**
   * Gets the y output component
   */
  get y() {
    return this._outputs[2];
  }
  autoConfigure() {
    if (!this.center.isConnected) {
      const e = new gi("center");
      e.value = new at(0.5, 0.5), e.output.connectTo(this.center);
    }
    if (!this.strength.isConnected) {
      const e = new gi("strength");
      e.value = 1, e.output.connectTo(this.strength);
    }
    if (!this.offset.isConnected) {
      const e = new gi("offset");
      e.value = new at(0, 0), e.output.connectTo(this.offset);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = e._getFreeVariableName("delta"), r = e._getFreeVariableName("angle"), n = e._getFreeVariableName("x"), i = e._getFreeVariableName("y"), s = e._getFreeVariableName("result");
    return e.compilationString += `
            vec2 ${t} = ${this.input.associatedVariableName} - ${this.center.associatedVariableName};
            float ${r} = ${this.strength.associatedVariableName} * length(${t});
            float ${n} = cos(${r}) * ${t}.x - sin(${r}) * ${t}.y;
            float ${i} = sin(${r}) * ${t}.x + cos(${r}) * ${t}.y;
            vec2 ${s} = vec2(${n} + ${this.center.associatedVariableName}.x + ${this.offset.associatedVariableName}.x, ${i} + ${this.center.associatedVariableName}.y + ${this.offset.associatedVariableName}.y);
        `, this.output.hasEndpoints && (e.compilationString += this._declareOutput(this.output, e) + ` = ${s};
`), this.x.hasEndpoints && (e.compilationString += this._declareOutput(this.x, e) + ` = ${s}.x;
`), this.y.hasEndpoints && (e.compilationString += this._declareOutput(this.y, e) + ` = ${s}.y;
`), this;
  }
}
Ue("BABYLON.TwirlBlock", ure);
class aV extends Mr {
  /**
   * Creates a new HeightToNormalBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.generateInWorldSpace = !1, this.automaticNormalizationNormal = !0, this.automaticNormalizationTangent = !0, this.registerInput("input", de.Float), this.registerInput("worldPosition", de.Vector3), this.registerInput("worldNormal", de.Vector3), this.registerInput("worldTangent", de.AutoDetect, !0), this.registerOutput("output", de.Vector4), this.registerOutput("xyz", de.Vector3), this._inputs[3].addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Vector3 | de.Vector4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "HeightToNormalBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the position component
   */
  get worldPosition() {
    return this._inputs[1];
  }
  /**
   * Gets the normal component
   */
  get worldNormal() {
    return this._inputs[2];
  }
  /**
   * Gets the tangent component
   */
  get worldTangent() {
    return this._inputs[3];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets the xyz component
   */
  get xyz() {
    return this._outputs[1];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    !this.generateInWorldSpace && !this.worldTangent.isConnected && console.error(`You must connect the 'worldTangent' input of the ${this.name} block!`);
    const r = this.generateInWorldSpace ? "" : `
            vec3 biTangent = cross(normal, tangent);
            mat3 TBN = mat3(tangent, biTangent, normal);
            `, n = this.generateInWorldSpace ? "" : `
            result = TBN * result;
            result = result * vec3(0.5) + vec3(0.5);
            `, i = `
            vec4 heightToNormal(in float height, in vec3 position, in vec3 tangent, in vec3 normal) {
                ${r}
                ${this.automaticNormalizationTangent ? "tangent = normalize(tangent);" : ""}
                ${this.automaticNormalizationNormal ? "normal = normalize(normal);" : ""}
                vec3 worlddX = dFdx(position);
                vec3 worlddY = dFdy(position);
                vec3 crossX = cross(normal, worlddX);
                vec3 crossY = cross(normal, worlddY);
                float d = abs(dot(crossY, worlddX));
                vec3 inToNormal = vec3(((((height + dFdx(height)) - height) * crossY) + (((height + dFdy(height)) - height) * crossX)) * sign(d));
                inToNormal.y *= -1.0;
                vec3 result = normalize((d * normal) - inToNormal);
                ${n}
                return vec4(result, 0.);
            }`;
    return e._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable"), e._emitFunction("heightToNormal", i, "// heightToNormal"), e.compilationString += this._declareOutput(t, e) + ` = heightToNormal(${this.input.associatedVariableName}, ${this.worldPosition.associatedVariableName}, ${this.worldTangent.isConnected ? this.worldTangent.associatedVariableName : "vec3(0.)"}.xyz, ${this.worldNormal.associatedVariableName});
`, this.xyz.hasEndpoints && (e.compilationString += this._declareOutput(this.xyz, e) + ` = ${this.output.associatedVariableName}.xyz;
`), this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.generateInWorldSpace = ${this.generateInWorldSpace};
`, e += `${this._codeVariableName}.automaticNormalizationNormal = ${this.automaticNormalizationNormal};
`, e += `${this._codeVariableName}.automaticNormalizationTangent = ${this.automaticNormalizationTangent};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return e.generateInWorldSpace = this.generateInWorldSpace, e.automaticNormalizationNormal = this.automaticNormalizationNormal, e.automaticNormalizationTangent = this.automaticNormalizationTangent, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.generateInWorldSpace = e.generateInWorldSpace, this.automaticNormalizationNormal = e.automaticNormalizationNormal, this.automaticNormalizationTangent = e.automaticNormalizationTangent;
  }
}
C([
  rn("Generate in world space instead of tangent space", Gr.Boolean, "PROPERTIES", { notifiers: { update: !0 } })
], aV.prototype, "generateInWorldSpace", void 0);
C([
  rn("Force normalization for the worldNormal input", Gr.Boolean, "PROPERTIES", { notifiers: { update: !0 } })
], aV.prototype, "automaticNormalizationNormal", void 0);
C([
  rn("Force normalization for the worldTangent input", Gr.Boolean, "PROPERTIES", { notifiers: { update: !0 } })
], aV.prototype, "automaticNormalizationTangent", void 0);
Ue("BABYLON.HeightToNormalBlock", aV);
class lre extends Mr {
  /**
   * Create a new FragDepthBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment, !0), this.registerInput("depth", de.Float, !0), this.registerInput("worldPos", de.Vector4, !0), this.registerInput("viewProjection", de.Matrix, !0);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "FragDepthBlock";
  }
  /**
   * Gets the depth input component
   */
  get depth() {
    return this._inputs[0];
  }
  /**
   * Gets the worldPos input component
   */
  get worldPos() {
    return this._inputs[1];
  }
  /**
   * Gets the viewProjection input component
   */
  get viewProjection() {
    return this._inputs[2];
  }
  _buildBlock(e) {
    return super._buildBlock(e), this.depth.isConnected ? e.compilationString += `gl_FragDepth = ${this.depth.associatedVariableName};
` : this.worldPos.isConnected && this.viewProjection.isConnected ? e.compilationString += `
                vec4 p = ${this.viewProjection.associatedVariableName} * ${this.worldPos.associatedVariableName};
                float v = p.z / p.w;
                #ifndef IS_NDC_HALF_ZRANGE
                    v = v * 0.5 + 0.5;
                #endif
                gl_FragDepth = v;
    
            ` : console.warn("FragDepthBlock: either the depth input or both the worldPos and viewProjection inputs must be connected!"), this;
  }
}
Ue("BABYLON.FragDepthBlock", lre);
class Pre extends Mr {
  /**
   * Create a new ShadowMapBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.registerInput("worldPosition", de.Vector4, !1), this.registerInput("viewProjection", de.Matrix, !1), this.registerInput("worldNormal", de.AutoDetect, !0), this.registerOutput("depth", de.Vector3), this.worldNormal.addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Vector3 | de.Vector4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ShadowMapBlock";
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("vPositionWSM"), e._excludeVariableName("lightDataSM"), e._excludeVariableName("biasAndScaleSM"), e._excludeVariableName("depthValuesSM"), e._excludeVariableName("clipPos"), e._excludeVariableName("worldPos"), e._excludeVariableName("zSM");
  }
  /**
   * Gets the world position input component
   */
  get worldPosition() {
    return this._inputs[0];
  }
  /**
   * Gets the view x projection input component
   */
  get viewProjection() {
    return this._inputs[1];
  }
  /**
   * Gets the world normal input component
   */
  get worldNormal() {
    return this._inputs[2];
  }
  /**
   * Gets the depth output component
   */
  get depth() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = `//${this.name}`;
    return e._emitUniformFromString("biasAndScaleSM", "vec3"), e._emitUniformFromString("lightDataSM", "vec3"), e._emitUniformFromString("depthValuesSM", "vec2"), e._emitFunctionFromInclude("packingFunctions", t), e.compilationString += `vec4 worldPos = ${this.worldPosition.associatedVariableName};
`, e.compilationString += `vec3 vPositionWSM;
`, e.compilationString += `float vDepthMetricSM = 0.0;
`, e.compilationString += `float zSM;
`, this.worldNormal.isConnected && (e.compilationString += `vec3 vNormalW = ${this.worldNormal.associatedVariableName}.xyz;
`, e.compilationString += e._emitCodeFromInclude("shadowMapVertexNormalBias", t)), e.compilationString += `vec4 clipPos = ${this.viewProjection.associatedVariableName} * worldPos;
`, e.compilationString += e._emitCodeFromInclude("shadowMapVertexMetric", t, {
      replaceStrings: [
        {
          search: /gl_Position/g,
          replace: "clipPos"
        }
      ]
    }), e.compilationString += e._emitCodeFromInclude("shadowMapFragment", t, {
      replaceStrings: [
        {
          search: /return;/g,
          replace: ""
        }
      ]
    }), e.compilationString += `
            #if SM_DEPTHTEXTURE == 1
                #ifdef IS_NDC_HALF_ZRANGE
                    gl_FragDepth = (clipPos.z / clipPos.w);
                #else
                    gl_FragDepth = (clipPos.z / clipPos.w) * 0.5 + 0.5;
                #endif
            #endif
        `, e.compilationString += `${this._declareOutput(this.depth, e)} = vec3(depthSM, 1., 1.);
`, this;
  }
}
Ue("BABYLON.ShadowMapBlock", Pre);
class cre extends Mr {
  /**
   * Create a new PrePassOutputBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment, !0), this.registerInput("viewDepth", de.Float, !0), this.registerInput("worldPosition", de.AutoDetect, !0), this.registerInput("viewNormal", de.AutoDetect, !0), this.registerInput("reflectivity", de.AutoDetect, !0), this.inputs[1].addExcludedConnectionPointFromAllowedTypes(de.Vector3 | de.Vector4), this.inputs[2].addExcludedConnectionPointFromAllowedTypes(de.Vector3 | de.Vector4), this.inputs[3].addExcludedConnectionPointFromAllowedTypes(de.Vector3 | de.Vector4 | de.Color3 | de.Color4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "PrePassOutputBlock";
  }
  /**
   * Gets the view depth component
   */
  get viewDepth() {
    return this._inputs[0];
  }
  /**
   * Gets the world position component
   */
  get worldPosition() {
    return this._inputs[1];
  }
  /**
   * Gets the view normal component
   */
  get viewNormal() {
    return this._inputs[2];
  }
  /**
   * Gets the reflectivity component
   */
  get reflectivity() {
    return this._inputs[3];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.worldPosition, r = this.viewNormal, n = this.viewDepth, i = this.reflectivity;
    e.sharedData.blocksWithDefines.push(this);
    const s = `//${this.name}`;
    return e._emitFunctionFromInclude("helperFunctions", s), e.compilationString += `#if defined(PREPASS)\r
`, e.compilationString += `#ifdef PREPASS_DEPTH\r
`, n.connectedPoint ? e.compilationString += ` gl_FragData[PREPASS_DEPTH_INDEX] = vec4(${n.associatedVariableName}, 0.0, 0.0, 1.0);\r
` : e.compilationString += ` gl_FragData[PREPASS_DEPTH_INDEX] = vec4(0.0, 0.0, 0.0, 0.0);\r
`, e.compilationString += `#endif\r
`, e.compilationString += `#ifdef PREPASS_POSITION\r
`, t.connectedPoint ? e.compilationString += ` gl_FragData[PREPASS_POSITION_INDEX] = vec4(${t.associatedVariableName}.rgb, ${t.connectedPoint.type === de.Vector4 ? t.associatedVariableName + ".a" : "1.0"});\r
` : e.compilationString += ` gl_FragData[PREPASS_POSITION_INDEX] = vec4(0.0, 0.0, 0.0, 0.0);\r
`, e.compilationString += `#endif\r
`, e.compilationString += `#ifdef PREPASS_NORMAL\r
`, r.connectedPoint ? e.compilationString += ` gl_FragData[PREPASS_NORMAL_INDEX] = vec4(${r.associatedVariableName}.rgb, ${r.connectedPoint.type === de.Vector4 ? r.associatedVariableName + ".a" : "1.0"});\r
` : e.compilationString += ` gl_FragData[PREPASS_NORMAL_INDEX] = vec4(0.0, 0.0, 0.0, 0.0);\r
`, e.compilationString += `#endif\r
`, e.compilationString += `#ifdef PREPASS_REFLECTIVITY\r
`, i.connectedPoint ? e.compilationString += ` gl_FragData[PREPASS_REFLECTIVITY_INDEX] = vec4(${i.associatedVariableName}.rgb, ${i.connectedPoint.type === de.Vector4 ? i.associatedVariableName + ".a" : "1.0"});\r
` : e.compilationString += ` gl_FragData[PREPASS_REFLECTIVITY_INDEX] = vec4(0.0, 0.0, 0.0, 1.0);\r
`, e.compilationString += `#endif\r
`, e.compilationString += `#endif\r
`, this;
  }
}
Ue("BABYLON.PrePassOutputBlock", cre);
class pre extends Mr {
  /**
   * Create a new FogBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.VertexAndFragment, !1), this.registerInput("worldPosition", de.Vector4, !1, Ve.Vertex), this.registerInput("view", de.Matrix, !1, Ve.Vertex), this.registerInput("input", de.AutoDetect, !1, Ve.Fragment), this.registerInput("fogColor", de.AutoDetect, !1, Ve.Fragment), this.registerOutput("output", de.Color3, Ve.Fragment), this.input.addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Vector3 | de.Color4), this.fogColor.addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Vector3 | de.Color4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "FogBlock";
  }
  /**
   * Gets the world position input component
   */
  get worldPosition() {
    return this._inputs[0];
  }
  /**
   * Gets the view input component
   */
  get view() {
    return this._inputs[1];
  }
  /**
   * Gets the color input component
   */
  get input() {
    return this._inputs[2];
  }
  /**
   * Gets the fog color input component
   */
  get fogColor() {
    return this._inputs[3];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  autoConfigure(e, t = () => !0) {
    if (!this.view.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.View && t(n));
      r || (r = new gi("view"), r.setAsSystemValue(Bi.View)), r.output.connectTo(this.view);
    }
    if (!this.fogColor.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.FogColor && t(n));
      r || (r = new gi("fogColor", void 0, de.Color3), r.setAsSystemValue(Bi.FogColor)), r.output.connectTo(this.fogColor);
    }
  }
  prepareDefines(e, t, r) {
    const n = e.getScene();
    r.setValue("FOG", t.fogEnabled && Ye.GetFogState(e, n));
  }
  bind(e, t, r) {
    if (!r)
      return;
    const n = r.getScene();
    e.setFloat4(this._fogParameters, n.fogMode, n.fogStart, n.fogEnd, n.fogDensity);
  }
  _buildBlock(e) {
    if (super._buildBlock(e), e.target === Ve.Fragment) {
      e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), e._emitFunctionFromInclude("fogFragmentDeclaration", `//${this.name}`, {
        removeUniforms: !0,
        removeVaryings: !0,
        removeIfDef: !1,
        replaceStrings: [{ search: /float CalcFogFactor\(\)/, replace: "float CalcFogFactor(vec3 vFogDistance, vec4 vFogInfos)" }]
      });
      const t = e._getFreeVariableName("fog"), r = this.input, n = this.fogColor;
      this._fogParameters = e._getFreeVariableName("fogParameters");
      const i = this._outputs[0];
      e._emitUniformFromString(this._fogParameters, "vec4"), e.compilationString += `#ifdef FOG
`, e.compilationString += `float ${t} = CalcFogFactor(${this._fogDistanceName}, ${this._fogParameters});
`, e.compilationString += this._declareOutput(i, e) + ` = ${t} * ${r.associatedVariableName}.rgb + (1.0 - ${t}) * ${n.associatedVariableName}.rgb;
`, e.compilationString += `#else
${this._declareOutput(i, e)} =  ${r.associatedVariableName}.rgb;
`, e.compilationString += `#endif
`;
    } else {
      const t = this.worldPosition, r = this.view;
      this._fogDistanceName = e._getFreeVariableName("vFogDistance"), e._emitVaryingFromString(this._fogDistanceName, "vec3"), e.compilationString += `${this._fogDistanceName} = (${r.associatedVariableName} * ${t.associatedVariableName}).xyz;
`;
    }
    return this;
  }
}
Ue("BABYLON.FogBlock", pre);
class AO extends Mr {
  static _OnGenerateOnlyFragmentCodeChanged(e, t) {
    const r = e;
    return r.worldPosition.isConnected ? (r.generateOnlyFragmentCode = !r.generateOnlyFragmentCode, console.error("The worldPosition input must not be connected to be able to switch!"), !1) : (r._setTarget(), !0);
  }
  _setTarget() {
    this._setInitialTarget(this.generateOnlyFragmentCode ? Ve.Fragment : Ve.VertexAndFragment), this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? Ve.Fragment : Ve.Vertex;
  }
  /**
   * Create a new LightBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.VertexAndFragment), this._lightId = 0, this.generateOnlyFragmentCode = !1, this._isUnique = !0, this.registerInput("worldPosition", de.Vector4, !1, Ve.Vertex), this.registerInput("worldNormal", de.Vector4, !1, Ve.Fragment), this.registerInput("cameraPosition", de.Vector3, !1, Ve.Fragment), this.registerInput("glossiness", de.Float, !0, Ve.Fragment), this.registerInput("glossPower", de.Float, !0, Ve.Fragment), this.registerInput("diffuseColor", de.Color3, !0, Ve.Fragment), this.registerInput("specularColor", de.Color3, !0, Ve.Fragment), this.registerInput("view", de.Matrix, !0), this.registerOutput("diffuseOutput", de.Color3, Ve.Fragment), this.registerOutput("specularOutput", de.Color3, Ve.Fragment), this.registerOutput("shadow", de.Float, Ve.Fragment);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "LightBlock";
  }
  /**
   * Gets the world position input component
   */
  get worldPosition() {
    return this._inputs[0];
  }
  /**
   * Gets the world normal input component
   */
  get worldNormal() {
    return this._inputs[1];
  }
  /**
   * Gets the camera (or eye) position component
   */
  get cameraPosition() {
    return this._inputs[2];
  }
  /**
   * Gets the glossiness component
   */
  get glossiness() {
    return this._inputs[3];
  }
  /**
   * Gets the glossiness power component
   */
  get glossPower() {
    return this._inputs[4];
  }
  /**
   * Gets the diffuse color component
   */
  get diffuseColor() {
    return this._inputs[5];
  }
  /**
   * Gets the specular color component
   */
  get specularColor() {
    return this._inputs[6];
  }
  /**
   * Gets the view matrix component
   */
  get view() {
    return this._inputs[7];
  }
  /**
   * Gets the diffuse output component
   */
  get diffuseOutput() {
    return this._outputs[0];
  }
  /**
   * Gets the specular output component
   */
  get specularOutput() {
    return this._outputs[1];
  }
  /**
   * Gets the shadow output component
   */
  get shadow() {
    return this._outputs[2];
  }
  autoConfigure(e, t = () => !0) {
    if (!this.cameraPosition.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.CameraPosition && t(n));
      r || (r = new gi("cameraPosition"), r.setAsSystemValue(Bi.CameraPosition)), r.output.connectTo(this.cameraPosition);
    }
  }
  prepareDefines(e, t, r) {
    if (!r._areLightsDirty)
      return;
    const n = e.getScene();
    if (!this.light)
      Ye.PrepareDefinesForLights(n, e, r, !0, t.maxSimultaneousLights);
    else {
      const i = {
        needNormals: !1,
        needRebuild: !1,
        lightmapMode: !1,
        shadowEnabled: !1,
        specularEnabled: !1
      };
      Ye.PrepareDefinesForLight(n, e, this.light, this._lightId, r, !0, i), i.needRebuild && r.rebuild();
    }
  }
  updateUniformsAndSamples(e, t, r, n) {
    for (let i = 0; i < t.maxSimultaneousLights && r["LIGHT" + i]; i++) {
      const s = e.uniforms.indexOf("vLightData" + i) >= 0;
      Ye.PrepareUniformsAndSamplersForLight(i, e.uniforms, e.samplers, r["PROJECTEDLIGHTTEXTURE" + i], n, s);
    }
  }
  bind(e, t, r) {
    if (!r)
      return;
    const n = r.getScene();
    this.light ? Ye.BindLight(this.light, this._lightId, n, e, !0) : Ye.BindLights(n, r, e, !0, t.maxSimultaneousLights);
  }
  _injectVertexCode(e) {
    const t = this.worldPosition, r = `//${this.name}`;
    this.light ? (this._lightId = (e.counters.lightCounter !== void 0 ? e.counters.lightCounter : -1) + 1, e.counters.lightCounter = this._lightId, e._emitFunctionFromInclude(e.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", r, {
      replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }]
    }, this._lightId.toString())) : (e._emitFunctionFromInclude(e.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", r, {
      repeatKey: "maxSimultaneousLights"
    }), this._lightId = 0, e.sharedData.dynamicUniformBlocks.push(this));
    const n = "v_" + t.associatedVariableName;
    e._emitVaryingFromString(n, "vec4") && (e.compilationString += `${n} = ${t.associatedVariableName};
`), this.light ? e.compilationString += e._emitCodeFromInclude("shadowsVertex", r, {
      replaceStrings: [
        { search: /{X}/g, replace: this._lightId.toString() },
        { search: /worldPos/g, replace: t.associatedVariableName }
      ]
    }) : (e.compilationString += `vec4 worldPos = ${t.associatedVariableName};
`, this.view.isConnected && (e.compilationString += `mat4 view = ${this.view.associatedVariableName};
`), e.compilationString += e._emitCodeFromInclude("shadowsVertex", r, {
      repeatKey: "maxSimultaneousLights"
    }));
  }
  _buildBlock(e) {
    if (super._buildBlock(e), e.target !== Ve.Fragment) {
      this._injectVertexCode(e);
      return;
    }
    this.generateOnlyFragmentCode && e.sharedData.dynamicUniformBlocks.push(this), e.sharedData.forcedBindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this);
    const t = `//${this.name}`, r = this.worldPosition;
    let n = r.associatedVariableName;
    this.generateOnlyFragmentCode ? (n = e._getFreeVariableName("globalWorldPos"), e._emitFunction("light_globalworldpos", `vec3 ${n};
`, t), e.compilationString += `${n} = ${r.associatedVariableName}.xyz;
`, e.compilationString += e._emitCodeFromInclude("shadowsVertex", t, {
      repeatKey: "maxSimultaneousLights",
      substitutionVars: this.generateOnlyFragmentCode ? `worldPos,${r.associatedVariableName}` : void 0
    })) : n = "v_" + n + ".xyz", e._emitFunctionFromInclude("helperFunctions", t), e._emitFunctionFromInclude("lightsFragmentFunctions", t, {
      replaceStrings: [{ search: /vPositionW/g, replace: n }]
    }), e._emitFunctionFromInclude("shadowsFragmentFunctions", t, {
      replaceStrings: [{ search: /vPositionW/g, replace: n }]
    }), this.light ? e._emitFunctionFromInclude(e.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", t, {
      replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }]
    }, this._lightId.toString()) : e._emitFunctionFromInclude(e.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", t, {
      repeatKey: "maxSimultaneousLights",
      substitutionVars: this.generateOnlyFragmentCode ? "varying," : void 0
    }), this._lightId === 0 && (e._registerTempVariable("viewDirectionW") && (e.compilationString += `vec3 viewDirectionW = normalize(${this.cameraPosition.associatedVariableName} - ${n});
`), e.compilationString += `lightingInfo info;
`, e.compilationString += `float shadow = 1.;
`, e.compilationString += `float aggShadow = 0.;
`, e.compilationString += `float numLights = 0.;
`, e.compilationString += `float glossiness = ${this.glossiness.isConnected ? this.glossiness.associatedVariableName : "1.0"} * ${this.glossPower.isConnected ? this.glossPower.associatedVariableName : "1024.0"};
`, e.compilationString += `vec3 diffuseBase = vec3(0., 0., 0.);
`, e.compilationString += `vec3 specularBase = vec3(0., 0., 0.);
`, e.compilationString += `vec3 normalW = ${this.worldNormal.associatedVariableName}.xyz;
`), this.light ? e.compilationString += e._emitCodeFromInclude("lightFragment", t, {
      replaceStrings: [
        { search: /{X}/g, replace: this._lightId.toString() },
        { search: /vPositionW/g, replace: n + ".xyz" }
      ]
    }) : e.compilationString += e._emitCodeFromInclude("lightFragment", t, {
      repeatKey: "maxSimultaneousLights",
      substitutionVars: `vPositionW,${n}.xyz`
    }), this._lightId === 0 && (e.compilationString += `aggShadow = aggShadow / numLights;
`);
    const i = this.diffuseOutput, s = this.specularOutput;
    return e.compilationString += this._declareOutput(i, e) + ` = diffuseBase${this.diffuseColor.isConnected ? " * " + this.diffuseColor.associatedVariableName : ""};
`, s.hasEndpoints && (e.compilationString += this._declareOutput(s, e) + ` = specularBase${this.specularColor.isConnected ? " * " + this.specularColor.associatedVariableName : ""};
`), this.shadow.hasEndpoints && (e.compilationString += this._declareOutput(this.shadow, e) + ` = aggShadow;
`), this;
  }
  serialize() {
    const e = super.serialize();
    return e.generateOnlyFragmentCode = this.generateOnlyFragmentCode, this.light && (e.lightId = this.light.id), e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), e.lightId && (this.light = t.getLightById(e.lightId)), this.generateOnlyFragmentCode = e.generateOnlyFragmentCode, this._setTarget();
  }
}
C([
  rn("Generate only fragment code", Gr.Boolean, "ADVANCED", {
    notifiers: { rebuild: !0, update: !0, onValidation: AO._OnGenerateOnlyFragmentCodeChanged }
  })
], AO.prototype, "generateOnlyFragmentCode", void 0);
Ue("BABYLON.LightBlock", AO);
class E0 extends Mr {
  /**
   * Gets or sets the texture associated with the node
   */
  get texture() {
    return this._texture;
  }
  set texture(e) {
    var t;
    if (this._texture === e)
      return;
    const r = (t = e == null ? void 0 : e.getScene()) !== null && t !== void 0 ? t : gr.LastCreatedScene;
    !e && r && r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(this._texture)), this._texture = e, e && r && r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(e));
  }
  /**
   * Gets the sampler name associated with this image source
   */
  get samplerName() {
    return this._samplerName;
  }
  /**
   * Creates a new ImageSourceBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.VertexAndFragment), this.registerOutput("source", de.Object, Ve.VertexAndFragment, new Ko("source", this, ao.Output, E0, "ImageSourceBlock"));
  }
  bind(e) {
    this.texture && e.setTexture(this._samplerName, this.texture);
  }
  isReady() {
    return !(this.texture && !this.texture.isReadyOrNotBlocking());
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ImageSourceBlock";
  }
  /**
   * Gets the output component
   */
  get source() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    return super._buildBlock(e), e.target === Ve.Vertex && (this._samplerName = e._getFreeVariableName(this.name + "Sampler"), e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), e.sharedData.bindableBlocks.push(this)), e._emit2DSampler(this._samplerName), this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return this.texture && (e += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});
`, e += `${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};
`, e += `${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};
`, e += `${this._codeVariableName}.texture.uAng = ${this.texture.uAng};
`, e += `${this._codeVariableName}.texture.vAng = ${this.texture.vAng};
`, e += `${this._codeVariableName}.texture.wAng = ${this.texture.wAng};
`, e += `${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};
`, e += `${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};
`, e += `${this._codeVariableName}.texture.uScale = ${this.texture.uScale};
`, e += `${this._codeVariableName}.texture.vScale = ${this.texture.vScale};
`, e += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};
`), e;
  }
  serialize() {
    const e = super.serialize();
    return this.texture && !this.texture.isRenderTarget && this.texture.getClassName() !== "VideoTexture" && (e.texture = this.texture.serialize()), e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), e.texture && !ja.IgnoreTexturesAtLoadTime && e.texture.url !== void 0 && (r = e.texture.url.indexOf("data:") === 0 ? "" : r, this.texture = We.Parse(e.texture, t, r));
  }
}
Ue("BABYLON.ImageSourceBlock", E0);
class _I extends Mr {
  /**
   * Gets or sets the texture associated with the node
   */
  get texture() {
    var e;
    return this.source.isConnected ? ((e = this.source.connectedPoint) === null || e === void 0 ? void 0 : e.ownerBlock).texture : this._texture;
  }
  set texture(e) {
    var t;
    if (this._texture === e)
      return;
    const r = (t = e == null ? void 0 : e.getScene()) !== null && t !== void 0 ? t : gr.LastCreatedScene;
    !e && r && r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(this._texture)), this._texture = e, e && r && r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(e));
  }
  static _IsPrePassTextureBlock(e) {
    return (e == null ? void 0 : e.getClassName()) === "PrePassTextureBlock";
  }
  get _isSourcePrePass() {
    return _I._IsPrePassTextureBlock(this._imageSource);
  }
  /**
   * Gets the sampler name associated with this texture
   */
  get samplerName() {
    if (this._imageSource) {
      if (!_I._IsPrePassTextureBlock(this._imageSource))
        return this._imageSource.samplerName;
      if (this.source.connectedPoint)
        return this._imageSource.getSamplerName(this.source.connectedPoint);
    }
    return this._samplerName;
  }
  /**
   * Gets a boolean indicating that this block is linked to an ImageSourceBlock
   */
  get hasImageSource() {
    return this.source.isConnected;
  }
  /**
   * Gets or sets a boolean indicating if content needs to be converted to gamma space
   */
  set convertToGammaSpace(e) {
    var t;
    if (e !== this._convertToGammaSpace && (this._convertToGammaSpace = e, this.texture)) {
      const r = (t = this.texture.getScene()) !== null && t !== void 0 ? t : gr.LastCreatedScene;
      r == null || r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(this.texture));
    }
  }
  get convertToGammaSpace() {
    return this._convertToGammaSpace;
  }
  /**
   * Gets or sets a boolean indicating if content needs to be converted to linear space
   */
  set convertToLinearSpace(e) {
    var t;
    if (e !== this._convertToLinearSpace && (this._convertToLinearSpace = e, this.texture)) {
      const r = (t = this.texture.getScene()) !== null && t !== void 0 ? t : gr.LastCreatedScene;
      r == null || r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(this.texture));
    }
  }
  get convertToLinearSpace() {
    return this._convertToLinearSpace;
  }
  /**
   * Create a new TextureBlock
   * @param name defines the block name
   * @param fragmentOnly
   */
  constructor(e, t = !1) {
    super(e, t ? Ve.Fragment : Ve.VertexAndFragment), this._convertToGammaSpace = !1, this._convertToLinearSpace = !1, this.disableLevelMultiplication = !1, this._fragmentOnly = t, this.registerInput("uv", de.AutoDetect, !1, Ve.VertexAndFragment), this.registerInput("source", de.Object, !0, Ve.VertexAndFragment, new Ko("source", this, ao.Input, E0, "ImageSourceBlock")), this.registerInput("layer", de.Float, !0), this.registerInput("lod", de.Float, !0), this.registerOutput("rgba", de.Color4, Ve.Neutral), this.registerOutput("rgb", de.Color3, Ve.Neutral), this.registerOutput("r", de.Float, Ve.Neutral), this.registerOutput("g", de.Float, Ve.Neutral), this.registerOutput("b", de.Float, Ve.Neutral), this.registerOutput("a", de.Float, Ve.Neutral), this.registerOutput("level", de.Float, Ve.Neutral), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Vector2 | de.Vector3 | de.Vector4), this._inputs[0]._prioritizeVertex = !t;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "TextureBlock";
  }
  /**
   * Gets the uv input component
   */
  get uv() {
    return this._inputs[0];
  }
  /**
   * Gets the source input component
   */
  get source() {
    return this._inputs[1];
  }
  /**
   * Gets the layer input component
   */
  get layer() {
    return this._inputs[2];
  }
  /**
   * Gets the LOD input component
   */
  get lod() {
    return this._inputs[3];
  }
  /**
   * Gets the rgba output component
   */
  get rgba() {
    return this._outputs[0];
  }
  /**
   * Gets the rgb output component
   */
  get rgb() {
    return this._outputs[1];
  }
  /**
   * Gets the r output component
   */
  get r() {
    return this._outputs[2];
  }
  /**
   * Gets the g output component
   */
  get g() {
    return this._outputs[3];
  }
  /**
   * Gets the b output component
   */
  get b() {
    return this._outputs[4];
  }
  /**
   * Gets the a output component
   */
  get a() {
    return this._outputs[5];
  }
  /**
   * Gets the level output component
   */
  get level() {
    return this._outputs[6];
  }
  get target() {
    if (this._fragmentOnly)
      return Ve.Fragment;
    if (!this.uv.isConnected || this.uv.sourceBlock.isInput)
      return Ve.VertexAndFragment;
    let e = this.uv.connectedPoint;
    for (; e; ) {
      if (e.target === Ve.Fragment)
        return Ve.Fragment;
      if (e.target === Ve.Vertex)
        return Ve.VertexAndFragment;
      if (e.target === Ve.Neutral || e.target === Ve.VertexAndFragment) {
        const t = e.ownerBlock;
        if (t.target === Ve.Fragment)
          return Ve.Fragment;
        e = null;
        for (const r of t.inputs)
          if (r.connectedPoint) {
            e = r.connectedPoint;
            break;
          }
      }
    }
    return Ve.VertexAndFragment;
  }
  set target(e) {
  }
  autoConfigure(e, t = () => !0) {
    if (!this.uv.isConnected)
      if (e.mode === Vv.PostProcess) {
        const r = e.getBlockByPredicate((n) => n.name === "uv" && t(n));
        r && r.connectTo(this);
      } else {
        const r = e.mode === Vv.Particle ? "particle_uv" : "uv";
        let n = e.getInputBlockByPredicate((i) => i.isAttribute && i.name === r && t(i));
        n || (n = new gi("uv"), n.setAsAttribute(r)), n.output.connectTo(this.uv);
      }
  }
  initializeDefines(e, t, r) {
    r._areTexturesDirty && this._mainUVDefineName !== void 0 && r.setValue(this._mainUVDefineName, !1, !0);
  }
  prepareDefines(e, t, r) {
    if (!r._areTexturesDirty)
      return;
    if (!this.texture || !this.texture.getTextureMatrix) {
      this._isMixed && (r.setValue(this._defineName, !1, !0), r.setValue(this._mainUVDefineName, !0, !0));
      return;
    }
    const n = this.convertToGammaSpace && this.texture && !this.texture.gammaSpace, i = this.convertToLinearSpace && this.texture && this.texture.gammaSpace;
    r.setValue(this._linearDefineName, n, !0), r.setValue(this._gammaDefineName, i, !0), this._isMixed && (this.texture.getTextureMatrix().isIdentityAs3x2() ? (r.setValue(this._defineName, !1, !0), r.setValue(this._mainUVDefineName, !0, !0)) : (r.setValue(this._defineName, !0), r[this._mainUVDefineName] == null && r.setValue(this._mainUVDefineName, !1, !0)));
  }
  isReady() {
    return this._isSourcePrePass ? !0 : !(this.texture && !this.texture.isReadyOrNotBlocking());
  }
  bind(e) {
    this._isSourcePrePass && e.setFloat(this._textureInfoName, 1), this.texture && (this._isMixed && (e.setFloat(this._textureInfoName, this.texture.level), e.setMatrix(this._textureTransformName, this.texture.getTextureMatrix())), this._imageSource || e.setTexture(this._samplerName, this.texture));
  }
  get _isMixed() {
    return this.target !== Ve.Fragment;
  }
  _injectVertexCode(e) {
    const t = this.uv;
    if (this._defineName = e._getFreeDefineName("UVTRANSFORM"), this._mainUVDefineName = "VMAIN" + t.associatedVariableName.toUpperCase(), this._mainUVName = "vMain" + t.associatedVariableName, this._transformedUVName = e._getFreeVariableName("transformedUV"), this._textureTransformName = e._getFreeVariableName("textureTransform"), this._textureInfoName = e._getFreeVariableName("textureInfoName"), this.level.associatedVariableName = this._textureInfoName, e._emitVaryingFromString(this._transformedUVName, "vec2", this._defineName), e._emitVaryingFromString(this._mainUVName, "vec2", this._mainUVDefineName), e._emitUniformFromString(this._textureTransformName, "mat4", this._defineName), e.compilationString += `#ifdef ${this._defineName}
`, e.compilationString += `${this._transformedUVName} = vec2(${this._textureTransformName} * vec4(${t.associatedVariableName}.xy, 1.0, 0.0));
`, e.compilationString += `#elif defined(${this._mainUVDefineName})
`, e.compilationString += `${this._mainUVName} = ${t.associatedVariableName}.xy;
`, e.compilationString += `#endif
`, !!this._outputs.some((r) => r.isConnectedInVertexShader)) {
      this._writeTextureRead(e, !0);
      for (const r of this._outputs)
        r.hasEndpoints && r.name !== "level" && this._writeOutput(e, r, r.name, !0);
    }
  }
  _getUVW(e) {
    var t, r, n;
    let i = e;
    if ((n = (r = (t = this._texture) === null || t === void 0 ? void 0 : t._texture) === null || r === void 0 ? void 0 : r.is2DArray) !== null && n !== void 0 ? n : !1) {
      const a = this.layer.isConnected ? this.layer.associatedVariableName : "0";
      i = `vec3(${e}, ${a})`;
    }
    return i;
  }
  get _samplerFunc() {
    return this.lod.isConnected ? "texture2DLodEXT" : "texture2D";
  }
  get _samplerLodSuffix() {
    return this.lod.isConnected ? `, ${this.lod.associatedVariableName}` : "";
  }
  _generateTextureLookup(e) {
    const t = this.samplerName;
    e.compilationString += `#ifdef ${this._defineName}
`, e.compilationString += `vec4 ${this._tempTextureRead} = ${this._samplerFunc}(${t}, ${this._getUVW(this._transformedUVName)}${this._samplerLodSuffix});
`, e.compilationString += `#elif defined(${this._mainUVDefineName})
`, e.compilationString += `vec4 ${this._tempTextureRead} = ${this._samplerFunc}(${t}, ${this._getUVW(this._mainUVName ? this._mainUVName : this.uv.associatedVariableName)}${this._samplerLodSuffix});
`, e.compilationString += `#endif
`;
  }
  _writeTextureRead(e, t = !1) {
    const r = this.uv;
    if (t) {
      if (e.target === Ve.Fragment)
        return;
      this._generateTextureLookup(e);
      return;
    }
    if (this.uv.ownerBlock.target === Ve.Fragment) {
      e.compilationString += `vec4 ${this._tempTextureRead} = ${this._samplerFunc}(${this.samplerName}, ${this._getUVW(r.associatedVariableName)}${this._samplerLodSuffix});
`;
      return;
    }
    this._generateTextureLookup(e);
  }
  _generateConversionCode(e, t, r) {
    r !== "a" && ((!this.texture || !this.texture.gammaSpace) && (e.compilationString += `#ifdef ${this._linearDefineName}
                    ${t.associatedVariableName} = toGammaSpace(${t.associatedVariableName});
                    #endif
                `), e.compilationString += `#ifdef ${this._gammaDefineName}
                ${t.associatedVariableName} = toLinearSpace(${t.associatedVariableName});
                #endif
            `);
  }
  _writeOutput(e, t, r, n = !1) {
    if (n) {
      if (e.target === Ve.Fragment)
        return;
      e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r};
`, this._generateConversionCode(e, t, r);
      return;
    }
    if (this.uv.ownerBlock.target === Ve.Fragment) {
      e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r};
`, this._generateConversionCode(e, t, r);
      return;
    }
    let i = "";
    this.disableLevelMultiplication || (i = ` * ${this._textureInfoName}`), e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r}${i};
`, this._generateConversionCode(e, t, r);
  }
  _buildBlock(e) {
    var t, r, n, i;
    if (super._buildBlock(e), this.source.isConnected ? this._imageSource = this.source.connectedPoint.ownerBlock : this._imageSource = null, (e.target === Ve.Vertex || this._fragmentOnly || e.target === Ve.Fragment) && (this._tempTextureRead = e._getFreeVariableName("tempTextureRead"), this._linearDefineName = e._getFreeDefineName("ISLINEAR"), this._gammaDefineName = e._getFreeDefineName("ISGAMMA")), (!this._isMixed && e.target === Ve.Fragment || this._isMixed && e.target === Ve.Vertex) && (this._imageSource || (this._samplerName = e._getFreeVariableName(this.name + "Sampler"), !((r = (t = this._texture) === null || t === void 0 ? void 0 : t._texture) === null || r === void 0) && r.is2DArray ? e._emit2DArraySampler(this._samplerName) : e._emit2DSampler(this._samplerName)), e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this)), e.target !== Ve.Fragment) {
      this._injectVertexCode(e);
      return;
    }
    if (!this._outputs.some((a) => a.isConnectedInFragmentShader))
      return;
    this._isMixed && !this._imageSource && (!((i = (n = this._texture) === null || n === void 0 ? void 0 : n._texture) === null || i === void 0) && i.is2DArray ? e._emit2DArraySampler(this._samplerName) : e._emit2DSampler(this._samplerName));
    const s = `//${this.name}`;
    e._emitFunctionFromInclude("helperFunctions", s), this._isMixed && e._emitUniformFromString(this._textureInfoName, "float"), this._writeTextureRead(e);
    for (const a of this._outputs)
      a.hasEndpoints && a.name !== "level" && this._writeOutput(e, a, a.name);
    return this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};
`, e += `${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};
`, e += `${this._codeVariableName}.disableLevelMultiplication = ${this.disableLevelMultiplication};
`, this.texture && (e += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});
`, e += `${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};
`, e += `${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};
`, e += `${this._codeVariableName}.texture.uAng = ${this.texture.uAng};
`, e += `${this._codeVariableName}.texture.vAng = ${this.texture.vAng};
`, e += `${this._codeVariableName}.texture.wAng = ${this.texture.wAng};
`, e += `${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};
`, e += `${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};
`, e += `${this._codeVariableName}.texture.uScale = ${this.texture.uScale};
`, e += `${this._codeVariableName}.texture.vScale = ${this.texture.vScale};
`, e += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};
`), e;
  }
  serialize() {
    const e = super.serialize();
    return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, e.fragmentOnly = this._fragmentOnly, e.disableLevelMultiplication = this.disableLevelMultiplication, !this.hasImageSource && this.texture && !this.texture.isRenderTarget && this.texture.getClassName() !== "VideoTexture" && (e.texture = this.texture.serialize()), e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, this._fragmentOnly = !!e.fragmentOnly, this.disableLevelMultiplication = !!e.disableLevelMultiplication, e.texture && !ja.IgnoreTexturesAtLoadTime && e.texture.url !== void 0 && (r = e.texture.url.indexOf("data:") === 0 ? "" : r, this.texture = We.Parse(e.texture, t, r));
  }
}
Ue("BABYLON.TextureBlock", _I);
class $I extends Mr {
  /**
   * Gets or sets the texture associated with the node
   */
  get texture() {
    return this._texture;
  }
  set texture(e) {
    var t;
    if (this._texture === e)
      return;
    const r = (t = e == null ? void 0 : e.getScene()) !== null && t !== void 0 ? t : gr.LastCreatedScene;
    !e && r && r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(this._texture)), this._texture = e, e && r && r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(e));
  }
  static _OnGenerateOnlyFragmentCodeChanged(e, t) {
    return e._onGenerateOnlyFragmentCodeChanged();
  }
  _onGenerateOnlyFragmentCodeChanged() {
    return this._setTarget(), !0;
  }
  _setTarget() {
    this._setInitialTarget(this.generateOnlyFragmentCode ? Ve.Fragment : Ve.VertexAndFragment);
  }
  /**
   * Create a new ReflectionTextureBaseBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.VertexAndFragment), this.generateOnlyFragmentCode = !1;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ReflectionTextureBaseBlock";
  }
  _getTexture() {
    return this.texture;
  }
  autoConfigure(e, t = () => !0) {
    if (!this.position.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.isAttribute && n.name === "position" && t(n));
      r || (r = new gi("position"), r.setAsAttribute()), r.output.connectTo(this.position);
    }
    if (!this.world.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.World && t(n));
      r || (r = new gi("world"), r.setAsSystemValue(Bi.World)), r.output.connectTo(this.world);
    }
    if (this.view && !this.view.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.View && t(n));
      r || (r = new gi("view"), r.setAsSystemValue(Bi.View)), r.output.connectTo(this.view);
    }
  }
  prepareDefines(e, t, r) {
    if (!r._areTexturesDirty)
      return;
    const n = this._getTexture();
    !n || !n.getTextureMatrix || (r.setValue(this._define3DName, n.isCube, !0), r.setValue(this._defineLocalCubicName, !!n.boundingBoxSize, !0), r.setValue(this._defineExplicitName, n.coordinatesMode === 0, !0), r.setValue(this._defineSkyboxName, n.coordinatesMode === 5, !0), r.setValue(this._defineCubicName, n.coordinatesMode === 3 || n.coordinatesMode === 6, !0), r.setValue("INVERTCUBICMAP", n.coordinatesMode === 6, !0), r.setValue(this._defineSphericalName, n.coordinatesMode === 1, !0), r.setValue(this._definePlanarName, n.coordinatesMode === 2, !0), r.setValue(this._defineProjectionName, n.coordinatesMode === 4, !0), r.setValue(this._defineEquirectangularName, n.coordinatesMode === 7, !0), r.setValue(this._defineEquirectangularFixedName, n.coordinatesMode === 8, !0), r.setValue(this._defineMirroredEquirectangularFixedName, n.coordinatesMode === 9, !0));
  }
  isReady() {
    const e = this._getTexture();
    return !(e && !e.isReadyOrNotBlocking());
  }
  bind(e, t, r) {
    const n = this._getTexture();
    if (!(!r || !n) && (e.setMatrix(this._reflectionMatrixName, n.getReflectionTextureMatrix()), n.isCube ? e.setTexture(this._cubeSamplerName, n) : e.setTexture(this._2DSamplerName, n), n.boundingBoxSize)) {
      const i = n;
      e.setVector3(this._reflectionPositionName, i.boundingBoxPosition), e.setVector3(this._reflectionSizeName, i.boundingBoxSize);
    }
  }
  /**
   * Gets the code to inject in the vertex shader
   * @param state current state of the node material building
   * @returns the shader code
   */
  handleVertexSide(e) {
    if (this.generateOnlyFragmentCode && e.target === Ve.Vertex)
      return "";
    this._define3DName = e._getFreeDefineName("REFLECTIONMAP_3D"), this._defineCubicName = e._getFreeDefineName("REFLECTIONMAP_CUBIC"), this._defineSphericalName = e._getFreeDefineName("REFLECTIONMAP_SPHERICAL"), this._definePlanarName = e._getFreeDefineName("REFLECTIONMAP_PLANAR"), this._defineProjectionName = e._getFreeDefineName("REFLECTIONMAP_PROJECTION"), this._defineExplicitName = e._getFreeDefineName("REFLECTIONMAP_EXPLICIT"), this._defineEquirectangularName = e._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR"), this._defineLocalCubicName = e._getFreeDefineName("USE_LOCAL_REFLECTIONMAP_CUBIC"), this._defineMirroredEquirectangularFixedName = e._getFreeDefineName("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"), this._defineEquirectangularFixedName = e._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR_FIXED"), this._defineSkyboxName = e._getFreeDefineName("REFLECTIONMAP_SKYBOX"), this._defineOppositeZ = e._getFreeDefineName("REFLECTIONMAP_OPPOSITEZ"), this._reflectionMatrixName = e._getFreeVariableName("reflectionMatrix"), e._emitUniformFromString(this._reflectionMatrixName, "mat4");
    let t = "";
    this._worldPositionNameInFragmentOnlyMode = e._getFreeVariableName("worldPosition");
    const r = this.generateOnlyFragmentCode ? this._worldPositionNameInFragmentOnlyMode : "v_" + this.worldPosition.associatedVariableName;
    return (this.generateOnlyFragmentCode || e._emitVaryingFromString(r, "vec4")) && (t += `${this.generateOnlyFragmentCode ? "vec4 " : ""}${r} = ${this.worldPosition.associatedVariableName};
`), this._positionUVWName = e._getFreeVariableName("positionUVW"), this._directionWName = e._getFreeVariableName("directionW"), (this.generateOnlyFragmentCode || e._emitVaryingFromString(this._positionUVWName, "vec3", this._defineSkyboxName)) && (t += `#ifdef ${this._defineSkyboxName}
`, t += `${this.generateOnlyFragmentCode ? "vec3 " : ""}${this._positionUVWName} = ${this.position.associatedVariableName}.xyz;
`, t += `#endif
`), (this.generateOnlyFragmentCode || e._emitVaryingFromString(this._directionWName, "vec3", `defined(${this._defineEquirectangularFixedName}) || defined(${this._defineMirroredEquirectangularFixedName})`)) && (t += `#if defined(${this._defineEquirectangularFixedName}) || defined(${this._defineMirroredEquirectangularFixedName})
`, t += `${this.generateOnlyFragmentCode ? "vec3 " : ""}${this._directionWName} = normalize(vec3(${this.world.associatedVariableName} * vec4(${this.position.associatedVariableName}.xyz, 0.0)));
`, t += `#endif
`), t;
  }
  /**
   * Handles the inits for the fragment code path
   * @param state node material build state
   */
  handleFragmentSideInits(e) {
    e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), this._cubeSamplerName = e._getFreeVariableName(this.name + "CubeSampler"), e.samplers.push(this._cubeSamplerName), this._2DSamplerName = e._getFreeVariableName(this.name + "2DSampler"), e.samplers.push(this._2DSamplerName), e._samplerDeclaration += `#ifdef ${this._define3DName}
`, e._samplerDeclaration += `uniform samplerCube ${this._cubeSamplerName};
`, e._samplerDeclaration += `#else
`, e._samplerDeclaration += `uniform sampler2D ${this._2DSamplerName};
`, e._samplerDeclaration += `#endif
`, e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this);
    const t = `//${this.name}`;
    e._emitFunctionFromInclude("helperFunctions", t), e._emitFunctionFromInclude("reflectionFunction", t, {
      replaceStrings: [{ search: /vec3 computeReflectionCoords/g, replace: "void DUMMYFUNC" }]
    }), this._reflectionColorName = e._getFreeVariableName("reflectionColor"), this._reflectionVectorName = e._getFreeVariableName("reflectionUVW"), this._reflectionCoordsName = e._getFreeVariableName("reflectionCoords"), this._reflectionPositionName = e._getFreeVariableName("vReflectionPosition"), e._emitUniformFromString(this._reflectionPositionName, "vec3"), this._reflectionSizeName = e._getFreeVariableName("vReflectionPosition"), e._emitUniformFromString(this._reflectionSizeName, "vec3");
  }
  /**
   * Generates the reflection coords code for the fragment code path
   * @param worldNormalVarName name of the world normal variable
   * @param worldPos name of the world position variable. If not provided, will use the world position connected to this block
   * @param onlyReflectionVector if true, generates code only for the reflection vector computation, not for the reflection coordinates
   * @param doNotEmitInvertZ if true, does not emit the invertZ code
   * @returns the shader code
   */
  handleFragmentSideCodeReflectionCoords(e, t, r = !1, n = !1) {
    t || (t = this.generateOnlyFragmentCode ? this._worldPositionNameInFragmentOnlyMode : `v_${this.worldPosition.associatedVariableName}`);
    const i = this._reflectionMatrixName, s = `normalize(${this._directionWName})`, a = `${this._positionUVWName}`, f = `${this.cameraPosition.associatedVariableName}`, o = `${this.view.associatedVariableName}`;
    e += ".xyz";
    let d = `
            #ifdef ${this._defineMirroredEquirectangularFixedName}
                vec3 ${this._reflectionVectorName} = computeMirroredFixedEquirectangularCoords(${t}, ${e}, ${s});
            #endif

            #ifdef ${this._defineEquirectangularFixedName}
                vec3 ${this._reflectionVectorName} = computeFixedEquirectangularCoords(${t}, ${e}, ${s});
            #endif

            #ifdef ${this._defineEquirectangularName}
                vec3 ${this._reflectionVectorName} = computeEquirectangularCoords(${t}, ${e}, ${f}.xyz, ${i});
            #endif

            #ifdef ${this._defineSphericalName}
                vec3 ${this._reflectionVectorName} = computeSphericalCoords(${t}, ${e}, ${o}, ${i});
            #endif

            #ifdef ${this._definePlanarName}
                vec3 ${this._reflectionVectorName} = computePlanarCoords(${t}, ${e}, ${f}.xyz, ${i});
            #endif

            #ifdef ${this._defineCubicName}
                #ifdef ${this._defineLocalCubicName}
                    vec3 ${this._reflectionVectorName} = computeCubicLocalCoords(${t}, ${e}, ${f}.xyz, ${i}, ${this._reflectionSizeName}, ${this._reflectionPositionName});
                #else
                vec3 ${this._reflectionVectorName} = computeCubicCoords(${t}, ${e}, ${f}.xyz, ${i});
                #endif
            #endif

            #ifdef ${this._defineProjectionName}
                vec3 ${this._reflectionVectorName} = computeProjectionCoords(${t}, ${o}, ${i});
            #endif

            #ifdef ${this._defineSkyboxName}
                vec3 ${this._reflectionVectorName} = computeSkyBoxCoords(${a}, ${i});
            #endif

            #ifdef ${this._defineExplicitName}
                vec3 ${this._reflectionVectorName} = vec3(0, 0, 0);
            #endif
`;
    return n || (d += `#ifdef ${this._defineOppositeZ}
                ${this._reflectionVectorName}.z *= -1.0;
            #endif
`), r || (d += `
                #ifdef ${this._define3DName}
                    vec3 ${this._reflectionCoordsName} = ${this._reflectionVectorName};
                #else
                    vec2 ${this._reflectionCoordsName} = ${this._reflectionVectorName}.xy;
                    #ifdef ${this._defineProjectionName}
                        ${this._reflectionCoordsName} /= ${this._reflectionVectorName}.z;
                    #endif
                    ${this._reflectionCoordsName}.y = 1.0 - ${this._reflectionCoordsName}.y;
                #endif
`), d;
  }
  /**
   * Generates the reflection color code for the fragment code path
   * @param lodVarName name of the lod variable
   * @param swizzleLookupTexture swizzle to use for the final color variable
   * @returns the shader code
   */
  handleFragmentSideCodeReflectionColor(e, t = ".rgb") {
    let n = `${"vec" + (t.length === 0 ? "4" : t.length - 1)} ${this._reflectionColorName};
            #ifdef ${this._define3DName}
`;
    return e ? n += `${this._reflectionColorName} = textureCubeLodEXT(${this._cubeSamplerName}, ${this._reflectionVectorName}, ${e})${t};
` : n += `${this._reflectionColorName} = textureCube(${this._cubeSamplerName}, ${this._reflectionVectorName})${t};
`, n += `
            #else
`, e ? n += `${this._reflectionColorName} = texture2DLodEXT(${this._2DSamplerName}, ${this._reflectionCoordsName}, ${e})${t};
` : n += `${this._reflectionColorName} = texture2D(${this._2DSamplerName}, ${this._reflectionCoordsName})${t};
`, n += `#endif
`, n;
  }
  /**
   * Generates the code corresponding to the connected output points
   * @param state node material build state
   * @param varName name of the variable to output
   * @returns the shader code
   */
  writeOutputs(e, t) {
    let r = "";
    if (e.target === Ve.Fragment)
      for (const n of this._outputs)
        n.hasEndpoints && (r += `${this._declareOutput(n, e)} = ${t}.${n.name};
`);
    return r;
  }
  _buildBlock(e) {
    return super._buildBlock(e), this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    if (!this.texture)
      return e;
    if (this.texture.isCube) {
      const t = this.texture.forcedExtension;
      e += `${this._codeVariableName}.texture = new BABYLON.CubeTexture("${this.texture.name}", undefined, undefined, ${this.texture.noMipmap}, null, undefined, undefined, undefined, ${this.texture._prefiltered}, ${t ? '"' + t + '"' : "null"});
`;
    } else
      e += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null);
`;
    return e += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return this.texture && !this.texture.isRenderTarget && (e.texture = this.texture.serialize()), e.generateOnlyFragmentCode = this.generateOnlyFragmentCode, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), e.texture && !ja.IgnoreTexturesAtLoadTime && (r = e.texture.url.indexOf("data:") === 0 ? "" : r, e.texture.isCube ? this.texture = v1.Parse(e.texture, t, r) : this.texture = We.Parse(e.texture, t, r)), this.generateOnlyFragmentCode = e.generateOnlyFragmentCode, this._setTarget();
  }
}
C([
  rn("Generate only fragment code", Gr.Boolean, "ADVANCED", {
    notifiers: { rebuild: !0, update: !0, onValidation: $I._OnGenerateOnlyFragmentCodeChanged }
  })
], $I.prototype, "generateOnlyFragmentCode", void 0);
Ue("BABYLON.ReflectionTextureBaseBlock", $I);
class hre extends $I {
  _onGenerateOnlyFragmentCodeChanged() {
    return this.position.isConnected ? (this.generateOnlyFragmentCode = !this.generateOnlyFragmentCode, console.error("The position input must not be connected to be able to switch!"), !1) : this.worldPosition.isConnected ? (this.generateOnlyFragmentCode = !this.generateOnlyFragmentCode, console.error("The worldPosition input must not be connected to be able to switch!"), !1) : (this._setTarget(), !0);
  }
  _setTarget() {
    super._setTarget(), this.getInputByName("position").target = this.generateOnlyFragmentCode ? Ve.Fragment : Ve.Vertex, this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? Ve.Fragment : Ve.Vertex;
  }
  /**
   * Create a new ReflectionTextureBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("position", de.AutoDetect, !1, Ve.Vertex), this.registerInput("worldPosition", de.Vector4, !1, Ve.Vertex), this.registerInput("worldNormal", de.Vector4, !1, Ve.Fragment), this.registerInput("world", de.Matrix, !1, Ve.Vertex), this.registerInput("cameraPosition", de.Vector3, !1, Ve.Fragment), this.registerInput("view", de.Matrix, !1, Ve.Fragment), this.registerOutput("rgb", de.Color3, Ve.Fragment), this.registerOutput("rgba", de.Color4, Ve.Fragment), this.registerOutput("r", de.Float, Ve.Fragment), this.registerOutput("g", de.Float, Ve.Fragment), this.registerOutput("b", de.Float, Ve.Fragment), this.registerOutput("a", de.Float, Ve.Fragment), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Vector3 | de.Vector4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ReflectionTextureBlock";
  }
  /**
   * Gets the world position input component
   */
  get position() {
    return this._inputs[0];
  }
  /**
   * Gets the world position input component
   */
  get worldPosition() {
    return this._inputs[1];
  }
  /**
   * Gets the world normal input component
   */
  get worldNormal() {
    return this._inputs[2];
  }
  /**
   * Gets the world input component
   */
  get world() {
    return this._inputs[3];
  }
  /**
   * Gets the camera (or eye) position component
   */
  get cameraPosition() {
    return this._inputs[4];
  }
  /**
   * Gets the view input component
   */
  get view() {
    return this._inputs[5];
  }
  /**
   * Gets the rgb output component
   */
  get rgb() {
    return this._outputs[0];
  }
  /**
   * Gets the rgba output component
   */
  get rgba() {
    return this._outputs[1];
  }
  /**
   * Gets the r output component
   */
  get r() {
    return this._outputs[2];
  }
  /**
   * Gets the g output component
   */
  get g() {
    return this._outputs[3];
  }
  /**
   * Gets the b output component
   */
  get b() {
    return this._outputs[4];
  }
  /**
   * Gets the a output component
   */
  get a() {
    return this._outputs[5];
  }
  autoConfigure(e, t = () => !0) {
    if (super.autoConfigure(e), !this.cameraPosition.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.CameraPosition && t(n));
      r || (r = new gi("cameraPosition"), r.setAsSystemValue(Bi.CameraPosition)), r.output.connectTo(this.cameraPosition);
    }
  }
  _buildBlock(e) {
    if (super._buildBlock(e), !this.texture)
      return e.compilationString += this.writeOutputs(e, "vec4(0.)"), this;
    if (e.target !== Ve.Fragment)
      return e.compilationString += this.handleVertexSide(e), this;
    this.generateOnlyFragmentCode && (e.compilationString += this.handleVertexSide(e)), this.handleFragmentSideInits(e);
    const t = e._getFreeVariableName("normalWUnit");
    return e.compilationString += `vec4 ${t} = normalize(${this.worldNormal.associatedVariableName});
`, e.compilationString += this.handleFragmentSideCodeReflectionCoords(t), e.compilationString += this.handleFragmentSideCodeReflectionColor(void 0, ""), e.compilationString += this.writeOutputs(e, this._reflectionColorName), this;
  }
}
Ue("BABYLON.ReflectionTextureBlock", hre);
class oV extends Mr {
  /**
   * Create a new SceneDepthBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.VertexAndFragment), this.useNonLinearDepth = !1, this.storeCameraSpaceZ = !1, this.force32itsFloat = !1, this._isUnique = !0, this.registerInput("uv", de.AutoDetect, !1, Ve.VertexAndFragment), this.registerOutput("depth", de.Float, Ve.Neutral), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Vector2 | de.Vector3 | de.Vector4), this._inputs[0]._prioritizeVertex = !1;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SceneDepthBlock";
  }
  /**
   * Gets the uv input component
   */
  get uv() {
    return this._inputs[0];
  }
  /**
   * Gets the depth output component
   */
  get depth() {
    return this._outputs[0];
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("textureSampler");
  }
  get target() {
    return !this.uv.isConnected || this.uv.sourceBlock.isInput ? Ve.VertexAndFragment : Ve.Fragment;
  }
  _getTexture(e) {
    return e.enableDepthRenderer(void 0, this.useNonLinearDepth, this.force32itsFloat, void 0, this.storeCameraSpaceZ).getDepthMap();
  }
  bind(e, t) {
    const r = this._getTexture(t.getScene());
    e.setTexture(this._samplerName, r);
  }
  _injectVertexCode(e) {
    const t = this.uv;
    if (t.connectedPoint.ownerBlock.isInput && (t.connectedPoint.ownerBlock.isAttribute || e._emitUniformFromString(t.associatedVariableName, "vec" + (t.type === de.Vector3 ? "3" : t.type === de.Vector4 ? "4" : "2"))), this._mainUVName = "vMain" + t.associatedVariableName, e._emitVaryingFromString(this._mainUVName, "vec2"), e.compilationString += `${this._mainUVName} = ${t.associatedVariableName}.xy;
`, !!this._outputs.some((r) => r.isConnectedInVertexShader)) {
      this._writeTextureRead(e, !0);
      for (const r of this._outputs)
        r.hasEndpoints && this._writeOutput(e, r, "r", !0);
    }
  }
  _writeTextureRead(e, t = !1) {
    const r = this.uv;
    if (t) {
      if (e.target === Ve.Fragment)
        return;
      e.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${r.associatedVariableName}.xy);
`;
      return;
    }
    if (this.uv.ownerBlock.target === Ve.Fragment) {
      e.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${r.associatedVariableName}.xy);
`;
      return;
    }
    e.compilationString += `vec4 ${this._tempTextureRead} = texture2D(${this._samplerName}, ${this._mainUVName});
`;
  }
  _writeOutput(e, t, r, n = !1) {
    if (n) {
      if (e.target === Ve.Fragment)
        return;
      e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r};
`;
      return;
    }
    if (this.uv.ownerBlock.target === Ve.Fragment) {
      e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r};
`;
      return;
    }
    e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r};
`;
  }
  _buildBlock(e) {
    if (super._buildBlock(e), this._samplerName = e._getFreeVariableName(this.name + "Sampler"), this._tempTextureRead = e._getFreeVariableName("tempTextureRead"), e.sharedData.bindableBlocks.indexOf(this) < 0 && e.sharedData.bindableBlocks.push(this), e.target !== Ve.Fragment) {
      e._emit2DSampler(this._samplerName), this._injectVertexCode(e);
      return;
    }
    if (this._outputs.some((t) => t.isConnectedInFragmentShader)) {
      e._emit2DSampler(this._samplerName), this._writeTextureRead(e);
      for (const t of this._outputs)
        t.hasEndpoints && this._writeOutput(e, t, "r");
      return this;
    }
  }
  serialize() {
    const e = super.serialize();
    return e.useNonLinearDepth = this.useNonLinearDepth, e.storeCameraSpaceZ = this.storeCameraSpaceZ, e.force32itsFloat = this.force32itsFloat, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.useNonLinearDepth = e.useNonLinearDepth, this.storeCameraSpaceZ = !!e.storeCameraSpaceZ, this.force32itsFloat = e.force32itsFloat;
  }
}
C([
  rn("Use non linear depth", Gr.Boolean, "ADVANCED", {
    notifiers: {
      activatePreviewCommand: !0,
      callback: (A, e) => {
        const t = e;
        let r = !1;
        return t.useNonLinearDepth && (t.storeCameraSpaceZ = !1, r = !0), A && A.disableDepthRenderer(), r;
      }
    }
  })
], oV.prototype, "useNonLinearDepth", void 0);
C([
  rn("Store Camera space Z", Gr.Boolean, "ADVANCED", {
    notifiers: {
      activatePreviewCommand: !0,
      callback: (A, e) => {
        const t = e;
        let r = !1;
        return t.storeCameraSpaceZ && (t.useNonLinearDepth = !1, r = !0), A && A.disableDepthRenderer(), r;
      }
    }
  })
], oV.prototype, "storeCameraSpaceZ", void 0);
C([
  rn("Force 32 bits float", Gr.Boolean, "ADVANCED", {
    notifiers: { activatePreviewCommand: !0, callback: (A) => A == null ? void 0 : A.disableDepthRenderer() }
  })
], oV.prototype, "force32itsFloat", void 0);
Ue("BABYLON.SceneDepthBlock", oV);
class Hre extends Mr {
  /**
   * Create a new ClipPlanesBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.VertexAndFragment, !0), this.registerInput("worldPosition", de.Vector4, !1);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ClipPlanesBlock";
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("vClipPlane"), e._excludeVariableName("fClipDistance"), e._excludeVariableName("vClipPlane2"), e._excludeVariableName("fClipDistance2"), e._excludeVariableName("vClipPlane3"), e._excludeVariableName("fClipDistance3"), e._excludeVariableName("vClipPlane4"), e._excludeVariableName("fClipDistance4"), e._excludeVariableName("vClipPlane5"), e._excludeVariableName("fClipDistance5"), e._excludeVariableName("vClipPlane6"), e._excludeVariableName("fClipDistance6");
  }
  /**
   * Gets the worldPosition input component
   */
  get worldPosition() {
    return this._inputs[0];
  }
  get target() {
    return Ve.VertexAndFragment;
  }
  set target(e) {
  }
  prepareDefines(e, t, r) {
    var n, i, s, a, f, o;
    const d = e.getScene(), v = !!((n = t.clipPlane) !== null && n !== void 0 ? n : d.clipPlane), u = !!((i = t.clipPlane2) !== null && i !== void 0 ? i : d.clipPlane2), l = !!((s = t.clipPlane3) !== null && s !== void 0 ? s : d.clipPlane3), P = !!((a = t.clipPlane4) !== null && a !== void 0 ? a : d.clipPlane4), p = !!((f = t.clipPlane5) !== null && f !== void 0 ? f : d.clipPlane5), c = !!((o = t.clipPlane6) !== null && o !== void 0 ? o : d.clipPlane6);
    r.setValue("CLIPPLANE", v, !0), r.setValue("CLIPPLANE2", u, !0), r.setValue("CLIPPLANE3", l, !0), r.setValue("CLIPPLANE4", P, !0), r.setValue("CLIPPLANE5", p, !0), r.setValue("CLIPPLANE6", c, !0);
  }
  bind(e, t, r) {
    if (!r)
      return;
    const n = r.getScene();
    Df(e, t, n);
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = `//${this.name}`;
    if (e.target !== Ve.Fragment) {
      const r = this.worldPosition;
      e._emitFunctionFromInclude("clipPlaneVertexDeclaration", t, {
        replaceStrings: [{ search: /uniform vec4 vClipPlane\d*;/g, replace: "" }]
      }), e.compilationString += e._emitCodeFromInclude("clipPlaneVertex", t, {
        replaceStrings: [{ search: /worldPos/g, replace: r.associatedVariableName }]
      }), e._emitUniformFromString("vClipPlane", "vec4"), e._emitUniformFromString("vClipPlane2", "vec4"), e._emitUniformFromString("vClipPlane3", "vec4"), e._emitUniformFromString("vClipPlane4", "vec4"), e._emitUniformFromString("vClipPlane5", "vec4"), e._emitUniformFromString("vClipPlane6", "vec4");
      return;
    }
    return e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this), e._emitFunctionFromInclude("clipPlaneFragmentDeclaration", t), e.compilationString += e._emitCodeFromInclude("clipPlaneFragment", t), this;
  }
}
Ue("BABYLON.ClipPlanesBlock", Hre);
class gre extends Mr {
  /**
   * The texture associated with the node is the prepass texture
   */
  get texture() {
    return null;
  }
  set texture(e) {
  }
  /**
   * Creates a new PrePassTextureBlock
   * @param name defines the block name
   * @param target defines the target of that block (VertexAndFragment by default)
   */
  constructor(e, t = Ve.VertexAndFragment) {
    super(e, t, !1), this.registerOutput("position", de.Object, Ve.VertexAndFragment, new Ko("position", this, ao.Output, E0, "ImageSourceBlock")), this.registerOutput("depth", de.Object, Ve.VertexAndFragment, new Ko("depth", this, ao.Output, E0, "ImageSourceBlock")), this.registerOutput("normal", de.Object, Ve.VertexAndFragment, new Ko("normal", this, ao.Output, E0, "ImageSourceBlock"));
  }
  /**
   * Returns the sampler name associated with the node connection point
   * @param output
   * @returns
   */
  getSamplerName(e) {
    return e === this._outputs[0] ? this._positionSamplerName : e === this._outputs[1] ? this._depthSamplerName : e === this._outputs[2] ? this._normalSamplerName : "";
  }
  /**
   * Gets the position texture
   */
  get position() {
    return this._outputs[0];
  }
  /**
   * Gets the depth texture
   */
  get depth() {
    return this._outputs[1];
  }
  /**
   * Gets the normal texture
   */
  get normal() {
    return this._outputs[2];
  }
  /**
   * Gets the sampler name associated with this image source
   */
  get positionSamplerName() {
    return this._positionSamplerName;
  }
  /**
   * Gets the sampler name associated with this image source
   */
  get normalSamplerName() {
    return this._normalSamplerName;
  }
  /**
   * Gets the sampler name associated with this image source
   */
  get depthSamplerName() {
    return this._depthSamplerName;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "PrePassTextureBlock";
  }
  _buildBlock(e) {
    if (super._buildBlock(e), e.target !== Ve.Vertex)
      return this._positionSamplerName = "prepassPositionSampler", this._depthSamplerName = "prepassDepthSampler", this._normalSamplerName = "prepassNormalSampler", e.sharedData.variableNames.prepassPositionSampler = 0, e.sharedData.variableNames.prepassDepthSampler = 0, e.sharedData.variableNames.prepassNormalSampler = 0, e.sharedData.textureBlocks.push(this), e.sharedData.bindableBlocks.push(this), e._emit2DSampler(this._positionSamplerName), e._emit2DSampler(this._depthSamplerName), e._emit2DSampler(this._normalSamplerName), this;
  }
  bind(e, t) {
    const n = t.getScene().enablePrePassRenderer();
    if (!n)
      return;
    const i = n.defaultRT;
    i.textures && (this.position.isConnected && e.setTexture(this._positionSamplerName, i.textures[n.getIndex(1)]), this.depth.isConnected && e.setTexture(this._depthSamplerName, i.textures[n.getIndex(5)]), this.normal.isConnected && e.setTexture(this._normalSamplerName, i.textures[n.getIndex(6)]));
  }
}
Ue("BABYLON.PrePassTextureBlock", gre);
class Xre extends Mr {
  /** Gets the list of attached endpoints */
  get endpoints() {
    return this._endpoints;
  }
  /**
   * Gets or sets the target of the block
   */
  get target() {
    const e = this._inputs[0];
    if (e.isConnected) {
      const t = e.connectedPoint.ownerBlock;
      if (t.target !== Ve.VertexAndFragment)
        return t.target;
      if (e.connectedPoint.target !== Ve.VertexAndFragment)
        return e.connectedPoint.target;
    }
    return this._target;
  }
  set target(e) {
    this._target & e || (this._target = e);
  }
  /**
   * Create a new NodeMaterialTeleportInBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this._endpoints = [], this.registerInput("input", de.AutoDetect);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "NodeMaterialTeleportInBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /** Gets a boolean indicating that this connection will be used in the fragment shader */
  isConnectedInFragmentShader() {
    return this.endpoints.some((e) => e.output.isConnectedInFragmentShader);
  }
  _dumpCode(e, t) {
    let r = super._dumpCode(e, t);
    for (const n of this.endpoints)
      t.indexOf(n) === -1 && (r += n._dumpCode(e, t));
    return r;
  }
  /**
   * Checks if the current block is an ancestor of a given block
   * @param block defines the potential descendant block to check
   * @returns true if block is a descendant
   */
  isAnAncestorOf(e) {
    for (const t of this.endpoints)
      if (t === e || t.isAnAncestorOf(e))
        return !0;
    return !1;
  }
  /**
   * Add an enpoint to this block
   * @param endpoint define the endpoint to attach to
   */
  attachToEndpoint(e) {
    e.detach(), this._endpoints.push(e), e._entryPoint = this, e._outputs[0]._typeConnectionSource = this._inputs[0], e._tempEntryPointUniqueId = null, e.name = "> " + this.name;
  }
  /**
   * Remove enpoint from this block
   * @param endpoint define the endpoint to remove
   */
  detachFromEndpoint(e) {
    const t = this._endpoints.indexOf(e);
    t !== -1 && (this._endpoints.splice(t, 1), e._outputs[0]._typeConnectionSource = null, e._entryPoint = null);
  }
  /**
   * Release resources
   */
  dispose() {
    super.dispose();
    for (const e of this._endpoints)
      this.detachFromEndpoint(e);
    this._endpoints = [];
  }
}
Ue("BABYLON.NodeMaterialTeleportInBlock", Xre);
class Tre extends Mr {
  /**
   * Create a new TeleportOutBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this._entryPoint = null, this._tempEntryPointUniqueId = null, this.registerOutput("output", de.BasedOnInput);
  }
  /**
   * Gets the entry point
   */
  get entryPoint() {
    return this._entryPoint;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "NodeMaterialTeleportOutBlock";
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets or sets the target of the block
   */
  get target() {
    return this._entryPoint ? this._entryPoint.target : this._target;
  }
  set target(e) {
    this._target & e || (this._target = e);
  }
  /** Detach from entry point */
  detach() {
    this._entryPoint && this._entryPoint.detachFromEndpoint(this);
  }
  _buildBlock(e) {
    super._buildBlock(e), this.entryPoint && (e.compilationString += this._declareOutput(this.output, e) + ` = ${this.entryPoint.input.associatedVariableName};
`);
  }
  /**
   * Clone the current block to a new identical block
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a copy of the current block
   */
  clone(e, t = "") {
    const r = super.clone(e, t);
    return this.entryPoint && this.entryPoint.attachToEndpoint(r), r;
  }
  _customBuildStep(e, t) {
    this.entryPoint && this.entryPoint.build(e, t);
  }
  _dumpCode(e, t) {
    let r = "";
    return this.entryPoint && t.indexOf(this.entryPoint) === -1 && (r += this.entryPoint._dumpCode(e, t)), r + super._dumpCode(e, t);
  }
  _dumpCodeForOutputConnections(e) {
    let t = super._dumpCodeForOutputConnections(e);
    return this.entryPoint && (t += this.entryPoint._dumpCodeForOutputConnections(e)), t;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return this.entryPoint && (e += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});
`), e;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    var e, t;
    const r = super.serialize();
    return r.entryPoint = (t = (e = this.entryPoint) === null || e === void 0 ? void 0 : e.uniqueId) !== null && t !== void 0 ? t : "", r;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this._tempEntryPointUniqueId = e.entryPoint;
  }
}
Ue("BABYLON.NodeMaterialTeleportOutBlock", Tre);
class qre extends Mr {
  /**
   * Creates a new AddBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._inputs[0].acceptedConnectionPointTypes.push(de.Float), this._inputs[1].acceptedConnectionPointTypes.push(de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "AddBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = ${this.left.associatedVariableName} + ${this.right.associatedVariableName};
`, this;
  }
}
Ue("BABYLON.AddBlock", qre);
class bre extends Mr {
  /**
   * Creates a new ScaleBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("input", de.AutoDetect), this.registerInput("factor", de.Float), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ScaleBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the factor input component
   */
  get factor() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = ${this.input.associatedVariableName} * ${this.factor.associatedVariableName};
`, this;
  }
}
Ue("BABYLON.ScaleBlock", bre);
class Hy extends Mr {
  /**
   * Creates a new ClampBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.minimum = 0, this.maximum = 1, this.registerInput("value", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ClampBlock";
  }
  /**
   * Gets the value input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = clamp(${this.value.associatedVariableName}, ${this._writeFloat(this.minimum)}, ${this._writeFloat(this.maximum)});
`, this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode() + `${this._codeVariableName}.minimum = ${this.minimum};
`;
    return e += `${this._codeVariableName}.maximum = ${this.maximum};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return e.minimum = this.minimum, e.maximum = this.maximum, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.minimum = e.minimum, this.maximum = e.maximum;
  }
}
C([
  rn("Minimum", Gr.Float)
], Hy.prototype, "minimum", void 0);
C([
  rn("Maximum", Gr.Float)
], Hy.prototype, "maximum", void 0);
Ue("BABYLON.ClampBlock", Hy);
class xre extends Mr {
  /**
   * Creates a new CrossBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerOutput("output", de.Vector3), this._linkConnectionTypes(0, 1), this._inputs[0].excludedConnectionPointTypes.push(de.Float), this._inputs[0].excludedConnectionPointTypes.push(de.Matrix), this._inputs[0].excludedConnectionPointTypes.push(de.Vector2), this._inputs[1].excludedConnectionPointTypes.push(de.Float), this._inputs[1].excludedConnectionPointTypes.push(de.Matrix), this._inputs[1].excludedConnectionPointTypes.push(de.Vector2);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "CrossBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = cross(${this.left.associatedVariableName}.xyz, ${this.right.associatedVariableName}.xyz);
`, this;
  }
}
Ue("BABYLON.CrossBlock", xre);
class Dre extends Mr {
  /**
   * Gets or sets the options for this custom block
   */
  get options() {
    return this._options;
  }
  set options(e) {
    this._deserializeOptions(e);
  }
  /**
   * Creates a new CustomBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "CustomBlock";
  }
  _buildBlock(e) {
    super._buildBlock(e);
    let t = this._code, r = this._options.functionName;
    this._inputs.forEach((i) => {
      const s = new RegExp("\\{TYPE_" + i.name + "\\}", "gm"), a = e._getGLType(i.type);
      t = t.replace(s, a), r = r.replace(s, a);
    }), this._outputs.forEach((i) => {
      const s = new RegExp("\\{TYPE_" + i.name + "\\}", "gm"), a = e._getGLType(i.type);
      t = t.replace(s, a), r = r.replace(s, a);
    }), e._emitFunction(r, t, ""), this._outputs.forEach((i) => {
      e.compilationString += this._declareOutput(i, e) + `;
`;
    }), e.compilationString += r + "(";
    let n = !1;
    return this._inputs.forEach((i, s) => {
      var a, f, o;
      s > 0 && (e.compilationString += ", "), this._inputSamplers && this._inputSamplers.indexOf(i.name) !== -1 ? e.compilationString += (o = (f = (a = i.connectedPoint) === null || a === void 0 ? void 0 : a.ownerBlock) === null || f === void 0 ? void 0 : f.samplerName) !== null && o !== void 0 ? o : i.associatedVariableName : e.compilationString += i.associatedVariableName, n = !0;
    }), this._outputs.forEach((i, s) => {
      (s > 0 || n) && (e.compilationString += ", "), e.compilationString += i.associatedVariableName;
    }), e.compilationString += `);
`, this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.options = ${JSON.stringify(this._options)};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return e.options = this._options, e;
  }
  _deserialize(e, t, r) {
    this._deserializeOptions(e.options), super._deserialize(e, t, r);
  }
  _deserializeOptions(e) {
    var t, r, n;
    this._options = e, this._code = e.code.join(`
`) + `
`, this.name = this.name || e.name, this.target = Ve[e.target], (t = e.inParameters) === null || t === void 0 || t.forEach((i, s) => {
      const a = de[i.type];
      i.type === "sampler2D" || i.type === "samplerCube" ? (this._inputSamplers = this._inputSamplers || [], this._inputSamplers.push(i.name), this.registerInput(i.name, de.Object, !0, Ve.VertexAndFragment, new Ko(i.name, this, ao.Input, E0, "ImageSourceBlock"))) : this.registerInput(i.name, a), Object.defineProperty(this, i.name, {
        get: function() {
          return this._inputs[s];
        },
        enumerable: !0,
        configurable: !0
      });
    }), (r = e.outParameters) === null || r === void 0 || r.forEach((i, s) => {
      this.registerOutput(i.name, de[i.type]), Object.defineProperty(this, i.name, {
        get: function() {
          return this._outputs[s];
        },
        enumerable: !0,
        configurable: !0
      }), i.type === "BasedOnInput" && (this._outputs[s]._typeConnectionSource = this._findInputByName(i.typeFromInput)[0]);
    }), (n = e.inLinkedConnectionTypes) === null || n === void 0 || n.forEach((i) => {
      this._linkConnectionTypes(this._findInputByName(i.input1)[1], this._findInputByName(i.input2)[1]);
    });
  }
  _findInputByName(e) {
    if (!e)
      return null;
    for (let t = 0; t < this._inputs.length; t++)
      if (this._inputs[t].name === e)
        return [this._inputs[t], t];
    return null;
  }
}
Ue("BABYLON.CustomBlock", Dre);
class jre extends Mr {
  /**
   * Creates a new DotBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerOutput("output", de.Float), this._linkConnectionTypes(0, 1), this._inputs[0].excludedConnectionPointTypes.push(de.Float), this._inputs[0].excludedConnectionPointTypes.push(de.Matrix), this._inputs[1].excludedConnectionPointTypes.push(de.Float), this._inputs[1].excludedConnectionPointTypes.push(de.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "DotBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = dot(${this.left.associatedVariableName}, ${this.right.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.DotBlock", jre);
class wre extends Mr {
  /**
   * Creates a new NormalizeBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("input", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._inputs[0].excludedConnectionPointTypes.push(de.Float), this._inputs[0].excludedConnectionPointTypes.push(de.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "NormalizeBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], r = this._inputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = normalize(${r.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.NormalizeBlock", wre);
class mre extends Mr {
  /**
   * Create a new ColorMergerBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.rSwizzle = "r", this.gSwizzle = "g", this.bSwizzle = "b", this.aSwizzle = "a", this.registerInput("rgb ", de.Color3, !0), this.registerInput("r", de.Float, !0), this.registerInput("g", de.Float, !0), this.registerInput("b", de.Float, !0), this.registerInput("a", de.Float, !0), this.registerOutput("rgba", de.Color4), this.registerOutput("rgb", de.Color3);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ColorMergerBlock";
  }
  /**
   * Gets the rgb component (input)
   */
  get rgbIn() {
    return this._inputs[0];
  }
  /**
   * Gets the r component (input)
   */
  get r() {
    return this._inputs[1];
  }
  /**
   * Gets the g component (input)
   */
  get g() {
    return this._inputs[2];
  }
  /**
   * Gets the b component (input)
   */
  get b() {
    return this._inputs[3];
  }
  /**
   * Gets the a component (input)
   */
  get a() {
    return this._inputs[4];
  }
  /**
   * Gets the rgba component (output)
   */
  get rgba() {
    return this._outputs[0];
  }
  /**
   * Gets the rgb component (output)
   */
  get rgbOut() {
    return this._outputs[1];
  }
  /**
   * Gets the rgb component (output)
   * @deprecated Please use rgbOut instead.
   */
  get rgb() {
    return this.rgbOut;
  }
  _inputRename(e) {
    return e === "rgb " ? "rgbIn" : e;
  }
  _buildSwizzle(e) {
    return "." + (this.rSwizzle + this.gSwizzle + this.bSwizzle + this.aSwizzle).substr(0, e);
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.r, r = this.g, n = this.b, i = this.a, s = this.rgbIn, a = this._outputs[0], f = this._outputs[1];
    return s.isConnected ? (a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + ` = vec4(${s.associatedVariableName}, ${i.isConnected ? this._writeVariable(i) : "0.0"})${this._buildSwizzle(4)};
`), f.hasEndpoints && (e.compilationString += this._declareOutput(f, e) + ` = ${s.associatedVariableName}${this._buildSwizzle(3)};
`)) : (a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + ` = vec4(${t.isConnected ? this._writeVariable(t) : "0.0"}, ${r.isConnected ? this._writeVariable(r) : "0.0"}, ${n.isConnected ? this._writeVariable(n) : "0.0"}, ${i.isConnected ? this._writeVariable(i) : "0.0"})${this._buildSwizzle(4)};
`), f.hasEndpoints && (e.compilationString += this._declareOutput(f, e) + ` = vec3(${t.isConnected ? this._writeVariable(t) : "0.0"}, ${r.isConnected ? this._writeVariable(r) : "0.0"}, ${n.isConnected ? this._writeVariable(n) : "0.0"})${this._buildSwizzle(3)};
`)), this;
  }
  serialize() {
    const e = super.serialize();
    return e.rSwizzle = this.rSwizzle, e.gSwizzle = this.gSwizzle, e.bSwizzle = this.bSwizzle, e.aSwizzle = this.aSwizzle, e;
  }
  _deserialize(e, t, r) {
    var n, i, s, a;
    super._deserialize(e, t, r), this.rSwizzle = (n = e.rSwizzle) !== null && n !== void 0 ? n : "r", this.gSwizzle = (i = e.gSwizzle) !== null && i !== void 0 ? i : "g", this.bSwizzle = (s = e.bSwizzle) !== null && s !== void 0 ? s : "b", this.aSwizzle = (a = e.aSwizzle) !== null && a !== void 0 ? a : "a";
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.rSwizzle = "${this.rSwizzle}";
`, e += `${this._codeVariableName}.gSwizzle = "${this.gSwizzle}";
`, e += `${this._codeVariableName}.bSwizzle = "${this.bSwizzle}";
`, e += `${this._codeVariableName}.aSwizzle = "${this.aSwizzle}";
`, e;
  }
}
Ue("BABYLON.ColorMergerBlock", mre);
class Bre extends Mr {
  /**
   * Create a new VectorSplitterBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("xyzw", de.Vector4, !0), this.registerInput("xyz ", de.Vector3, !0), this.registerInput("xy ", de.Vector2, !0), this.registerOutput("xyz", de.Vector3), this.registerOutput("xy", de.Vector2), this.registerOutput("zw", de.Vector2), this.registerOutput("x", de.Float), this.registerOutput("y", de.Float), this.registerOutput("z", de.Float), this.registerOutput("w", de.Float), this.inputsAreExclusive = !0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "VectorSplitterBlock";
  }
  /**
   * Gets the xyzw component (input)
   */
  get xyzw() {
    return this._inputs[0];
  }
  /**
   * Gets the xyz component (input)
   */
  get xyzIn() {
    return this._inputs[1];
  }
  /**
   * Gets the xy component (input)
   */
  get xyIn() {
    return this._inputs[2];
  }
  /**
   * Gets the xyz component (output)
   */
  get xyzOut() {
    return this._outputs[0];
  }
  /**
   * Gets the xy component (output)
   */
  get xyOut() {
    return this._outputs[1];
  }
  /**
   * Gets the zw component (output)
   */
  get zw() {
    return this._outputs[2];
  }
  /**
   * Gets the x component (output)
   */
  get x() {
    return this._outputs[3];
  }
  /**
   * Gets the y component (output)
   */
  get y() {
    return this._outputs[4];
  }
  /**
   * Gets the z component (output)
   */
  get z() {
    return this._outputs[5];
  }
  /**
   * Gets the w component (output)
   */
  get w() {
    return this._outputs[6];
  }
  _inputRename(e) {
    switch (e) {
      case "xy ":
        return "xyIn";
      case "xyz ":
        return "xyzIn";
      default:
        return e;
    }
  }
  _outputRename(e) {
    switch (e) {
      case "xy":
        return "xyOut";
      case "xyz":
        return "xyzOut";
      default:
        return e;
    }
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.xyzw.isConnected ? this.xyzw : this.xyzIn.isConnected ? this.xyzIn : this.xyIn, r = this._outputs[0], n = this._outputs[1], i = this._outputs[2], s = this._outputs[3], a = this._outputs[4], f = this._outputs[5], o = this._outputs[6];
    return r.hasEndpoints && (t === this.xyIn ? e.compilationString += this._declareOutput(r, e) + ` = vec3(${t.associatedVariableName}, 0.0);
` : e.compilationString += this._declareOutput(r, e) + ` = ${t.associatedVariableName}.xyz;
`), i.hasEndpoints && this.xyzw.isConnected && (e.compilationString += this._declareOutput(i, e) + ` = ${this.xyzw.associatedVariableName}.zw;
`), n.hasEndpoints && (e.compilationString += this._declareOutput(n, e) + ` = ${t.associatedVariableName}.xy;
`), s.hasEndpoints && (e.compilationString += this._declareOutput(s, e) + ` = ${t.associatedVariableName}.x;
`), a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + ` = ${t.associatedVariableName}.y;
`), f.hasEndpoints && (e.compilationString += this._declareOutput(f, e) + ` = ${t.associatedVariableName}.z;
`), o.hasEndpoints && (e.compilationString += this._declareOutput(o, e) + ` = ${t.associatedVariableName}.w;
`), this;
  }
}
Ue("BABYLON.VectorSplitterBlock", Bre);
class Wre extends Mr {
  /**
   * Creates a new LerpBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerInput("gradient", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._linkConnectionTypes(1, 2, !0), this._inputs[2].acceptedConnectionPointTypes.push(de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "LerpBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the gradient operand input component
   */
  get gradient() {
    return this._inputs[2];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.LerpBlock", Wre);
class Sre extends Mr {
  /**
   * Creates a new DivideBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._inputs[0].acceptedConnectionPointTypes.push(de.Float), this._inputs[1].acceptedConnectionPointTypes.push(de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "DivideBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = ${this.left.associatedVariableName} / ${this.right.associatedVariableName};
`, this;
  }
}
Ue("BABYLON.DivideBlock", Sre);
class Ure extends Mr {
  /**
   * Creates a new SubtractBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._inputs[0].acceptedConnectionPointTypes.push(de.Float), this._inputs[1].acceptedConnectionPointTypes.push(de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SubtractBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = ${this.left.associatedVariableName} - ${this.right.associatedVariableName};
`, this;
  }
}
Ue("BABYLON.SubtractBlock", Ure);
class Ire extends Mr {
  /**
   * Creates a new StepBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("value", de.Float), this.registerInput("edge", de.Float), this.registerOutput("output", de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "StepBlock";
  }
  /**
   * Gets the value operand input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the edge operand input component
   */
  get edge() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = step(${this.edge.associatedVariableName}, ${this.value.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.StepBlock", Ire);
class iY extends Mr {
  /**
   * Creates a new OneMinusBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("input", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._outputs[0].excludedConnectionPointTypes.push(de.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "OneMinusBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = 1. - ${this.input.associatedVariableName};
`, this;
  }
}
Ue("BABYLON.OneMinusBlock", iY);
Ue("BABYLON.OppositeBlock", iY);
class sY extends Mr {
  /**
   * Creates a new ViewDirectionBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("worldPosition", de.Vector4), this.registerInput("cameraPosition", de.Vector3), this.registerOutput("output", de.Vector3);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ViewDirectionBlock";
  }
  /**
   * Gets the world position component
   */
  get worldPosition() {
    return this._inputs[0];
  }
  /**
   * Gets the camera position component
   */
  get cameraPosition() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  autoConfigure(e, t = () => !0) {
    if (!this.cameraPosition.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.CameraPosition && t(n));
      r || (r = new gi("cameraPosition"), r.setAsSystemValue(Bi.CameraPosition)), r.output.connectTo(this.cameraPosition);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = normalize(${this.cameraPosition.associatedVariableName} - ${this.worldPosition.associatedVariableName}.xyz);
`, this;
  }
}
Ue("BABYLON.ViewDirectionBlock", sY);
class Rre extends Mr {
  /**
   * Create a new FresnelBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("worldNormal", de.Vector4), this.registerInput("viewDirection", de.Vector3), this.registerInput("bias", de.Float), this.registerInput("power", de.Float), this.registerOutput("fresnel", de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "FresnelBlock";
  }
  /**
   * Gets the world normal input component
   */
  get worldNormal() {
    return this._inputs[0];
  }
  /**
   * Gets the view direction input component
   */
  get viewDirection() {
    return this._inputs[1];
  }
  /**
   * Gets the bias input component
   */
  get bias() {
    return this._inputs[2];
  }
  /**
   * Gets the camera (or eye) position component
   */
  get power() {
    return this._inputs[3];
  }
  /**
   * Gets the fresnel output component
   */
  get fresnel() {
    return this._outputs[0];
  }
  autoConfigure(e) {
    if (!this.viewDirection.isConnected) {
      const t = new sY("View direction");
      t.output.connectTo(this.viewDirection), t.autoConfigure(e);
    }
    if (!this.bias.isConnected) {
      const t = new gi("bias");
      t.value = 0, t.output.connectTo(this.bias);
    }
    if (!this.power.isConnected) {
      const t = new gi("power");
      t.value = 1, t.output.connectTo(this.power);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = `//${this.name}`;
    return e._emitFunctionFromInclude("fresnelFunction", t, { removeIfDef: !0 }), e.compilationString += this._declareOutput(this.fresnel, e) + ` = computeFresnelTerm(${this.viewDirection.associatedVariableName}.xyz, ${this.worldNormal.associatedVariableName}.xyz, ${this.bias.associatedVariableName}, ${this.power.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.FresnelBlock", Rre);
class Vre extends Mr {
  /**
   * Creates a new MaxBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MaxBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = max(${this.left.associatedVariableName}, ${this.right.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.MaxBlock", Vre);
class Cre extends Mr {
  /**
   * Creates a new MinBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MinBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = min(${this.left.associatedVariableName}, ${this.right.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.MinBlock", Cre);
class Ore extends Mr {
  /**
   * Creates a new DistanceBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerOutput("output", de.Float), this._linkConnectionTypes(0, 1), this._inputs[0].excludedConnectionPointTypes.push(de.Float), this._inputs[0].excludedConnectionPointTypes.push(de.Matrix), this._inputs[1].excludedConnectionPointTypes.push(de.Float), this._inputs[1].excludedConnectionPointTypes.push(de.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "DistanceBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = length(${this.left.associatedVariableName} - ${this.right.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.DistanceBlock", Ore);
class yre extends Mr {
  /**
   * Creates a new LengthBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("value", de.AutoDetect), this.registerOutput("output", de.Float), this._inputs[0].excludedConnectionPointTypes.push(de.Float), this._inputs[0].excludedConnectionPointTypes.push(de.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "LengthBlock";
  }
  /**
   * Gets the value input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = length(${this.value.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.LengthBlock", yre);
class kre extends Mr {
  /**
   * Creates a new NegateBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("value", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "NegateBlock";
  }
  /**
   * Gets the value input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = -1.0 * ${this.value.associatedVariableName};
`, this;
  }
}
Ue("BABYLON.NegateBlock", kre);
class Ere extends Mr {
  /**
   * Creates a new PowBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("value", de.AutoDetect), this.registerInput("power", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "PowBlock";
  }
  /**
   * Gets the value operand input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the power operand input component
   */
  get power() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = pow(${this.value.associatedVariableName}, ${this.power.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.PowBlock", Ere);
class Fre extends Mr {
  /**
   * Creates a new RandomNumberBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("seed", de.AutoDetect), this.registerOutput("output", de.Float), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Vector2 | de.Vector3 | de.Vector4 | de.Color3 | de.Color4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "RandomNumberBlock";
  }
  /**
   * Gets the seed input component
   */
  get seed() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], r = `//${this.name}`;
    return e._emitFunctionFromInclude("helperFunctions", r), e.compilationString += this._declareOutput(t, e) + ` = getRand(${this.seed.associatedVariableName}.xy);
`, this;
  }
}
Ue("BABYLON.RandomNumberBlock", Fre);
class Nre extends Mr {
  /**
   * Creates a new ArcTan2Block
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("x", de.Float), this.registerInput("y", de.Float), this.registerOutput("output", de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ArcTan2Block";
  }
  /**
   * Gets the x operand input component
   */
  get x() {
    return this._inputs[0];
  }
  /**
   * Gets the y operand input component
   */
  get y() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = atan(${this.x.associatedVariableName}, ${this.y.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.ArcTan2Block", Nre);
class Qre extends Mr {
  /**
   * Creates a new SmoothStepBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("value", de.AutoDetect), this.registerInput("edge0", de.Float), this.registerInput("edge1", de.Float), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SmoothStepBlock";
  }
  /**
   * Gets the value operand input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the first edge operand input component
   */
  get edge0() {
    return this._inputs[1];
  }
  /**
   * Gets the second edge operand input component
   */
  get edge1() {
    return this._inputs[2];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = smoothstep(${this.edge0.associatedVariableName}, ${this.edge1.associatedVariableName}, ${this.value.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.SmoothStepBlock", Qre);
class Yre extends Mr {
  /**
   * Creates a new ReciprocalBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("input", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ReciprocalBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return this.input.type === de.Matrix ? e.compilationString += this._declareOutput(t, e) + ` = inverse(${this.input.associatedVariableName});
` : e.compilationString += this._declareOutput(t, e) + ` = 1. / ${this.input.associatedVariableName};
`, this;
  }
}
Ue("BABYLON.ReciprocalBlock", Yre);
class Mre extends Mr {
  /**
   * Creates a new ReplaceColorBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("value", de.AutoDetect), this.registerInput("reference", de.AutoDetect), this.registerInput("distance", de.Float), this.registerInput("replacement", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._linkConnectionTypes(0, 3), this._inputs[0].excludedConnectionPointTypes.push(de.Float), this._inputs[0].excludedConnectionPointTypes.push(de.Matrix), this._inputs[1].excludedConnectionPointTypes.push(de.Float), this._inputs[1].excludedConnectionPointTypes.push(de.Matrix), this._inputs[3].excludedConnectionPointTypes.push(de.Float), this._inputs[3].excludedConnectionPointTypes.push(de.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ReplaceColorBlock";
  }
  /**
   * Gets the value input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the reference input component
   */
  get reference() {
    return this._inputs[1];
  }
  /**
   * Gets the distance input component
   */
  get distance() {
    return this._inputs[2];
  }
  /**
   * Gets the replacement input component
   */
  get replacement() {
    return this._inputs[3];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + `;
`, e.compilationString += `if (length(${this.value.associatedVariableName} - ${this.reference.associatedVariableName}) < ${this.distance.associatedVariableName}) {
`, e.compilationString += `${t.associatedVariableName} = ${this.replacement.associatedVariableName};
`, e.compilationString += `} else {
`, e.compilationString += `${t.associatedVariableName} = ${this.value.associatedVariableName};
`, e.compilationString += `}
`, this;
  }
}
Ue("BABYLON.ReplaceColorBlock", Mre);
class Lre extends Mr {
  /**
   * Creates a new PosterizeBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("value", de.AutoDetect), this.registerInput("steps", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._inputs[0].excludedConnectionPointTypes.push(de.Matrix), this._inputs[1].excludedConnectionPointTypes.push(de.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "PosterizeBlock";
  }
  /**
   * Gets the value input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the steps input component
   */
  get steps() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = floor(${this.value.associatedVariableName} / (1.0 / ${this.steps.associatedVariableName})) * (1.0 / ${this.steps.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.PosterizeBlock", Lre);
var Gw;
(function(A) {
  A[A.SawTooth = 0] = "SawTooth", A[A.Square = 1] = "Square", A[A.Triangle = 2] = "Triangle";
})(Gw || (Gw = {}));
class Kre extends Mr {
  /**
   * Creates a new WaveBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.kind = Gw.SawTooth, this.registerInput("input", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._inputs[0].excludedConnectionPointTypes.push(de.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "WaveBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    switch (this.kind) {
      case Gw.SawTooth: {
        e.compilationString += this._declareOutput(t, e) + ` = ${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName});
`;
        break;
      }
      case Gw.Square: {
        e.compilationString += this._declareOutput(t, e) + ` = 1.0 - 2.0 * round(fract(${this.input.associatedVariableName}));
`;
        break;
      }
      case Gw.Triangle: {
        e.compilationString += this._declareOutput(t, e) + ` = 2.0 * abs(2.0 * (${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName}))) - 1.0;
`;
        break;
      }
    }
    return this;
  }
  serialize() {
    const e = super.serialize();
    return e.kind = this.kind, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.kind = e.kind;
  }
}
Ue("BABYLON.WaveBlock", Kre);
class mC {
  /**
   * Gets value indicating which step this color is associated with (between 0 and 1)
   */
  get step() {
    return this._step;
  }
  /**
   * Sets a value indicating which step this color is associated with (between 0 and 1)
   */
  set step(e) {
    this._step = e;
  }
  /**
   * Gets the color associated with this step
   */
  get color() {
    return this._color;
  }
  /**
   * Sets the color associated with this step
   */
  set color(e) {
    this._color = e;
  }
  /**
   * Creates a new GradientBlockColorStep
   * @param step defines a value indicating which step this color is associated with (between 0 and 1)
   * @param color defines the color associated with this step
   */
  constructor(e, t) {
    this.step = e, this.color = t;
  }
}
class Jre extends Mr {
  /** calls observable when the value is changed*/
  colorStepsUpdated() {
    this.onValueChangedObservable.notifyObservers(this);
  }
  /**
   * Creates a new GradientBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.colorSteps = [new mC(0, Ne.Black()), new mC(1, Ne.White())], this.onValueChangedObservable = new Oe(), this.registerInput("gradient", de.AutoDetect), this.registerOutput("output", de.Color3), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Float | de.Vector2 | de.Vector3 | de.Vector4 | de.Color3 | de.Color4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GradientBlock";
  }
  /**
   * Gets the gradient input component
   */
  get gradient() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _writeColorConstant(e) {
    const t = this.colorSteps[e];
    return `vec3(${t.color.r}, ${t.color.g}, ${t.color.b})`;
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    if (!this.colorSteps.length || !this.gradient.connectedPoint) {
      e.compilationString += this._declareOutput(t, e) + ` = vec3(0., 0., 0.);
`;
      return;
    }
    const r = e._getFreeVariableName("gradientTempColor"), n = e._getFreeVariableName("gradientTempPosition");
    e.compilationString += `vec3 ${r} = ${this._writeColorConstant(0)};
`, e.compilationString += `float ${n};
`;
    let i = this.gradient.associatedVariableName;
    this.gradient.connectedPoint.type !== de.Float && (i += ".x");
    for (let s = 1; s < this.colorSteps.length; s++) {
      const a = this.colorSteps[s], f = this.colorSteps[s - 1];
      e.compilationString += `${n} = clamp((${i} - ${e._emitFloat(f.step)}) / (${e._emitFloat(a.step)} -  ${e._emitFloat(f.step)}), 0.0, 1.0) * step(${e._emitFloat(s)}, ${e._emitFloat(this.colorSteps.length - 1)});
`, e.compilationString += `${r} = mix(${r}, ${this._writeColorConstant(s)}, ${n});
`;
    }
    return e.compilationString += this._declareOutput(t, e) + ` = ${r};
`, this;
  }
  serialize() {
    const e = super.serialize();
    e.colorSteps = [];
    for (const t of this.colorSteps)
      e.colorSteps.push({
        step: t.step,
        color: {
          r: t.color.r,
          g: t.color.g,
          b: t.color.b
        }
      });
    return e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.colorSteps.length = 0;
    for (const n of e.colorSteps)
      this.colorSteps.push(new mC(n.step, new Ne(n.color.r, n.color.g, n.color.b)));
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    e += `${this._codeVariableName}.colorSteps = [];
`;
    for (const t of this.colorSteps)
      e += `${this._codeVariableName}.colorSteps.push(new BABYLON.GradientBlockColorStep(${t.step}, new BABYLON.Color3(${t.color.r}, ${t.color.g}, ${t.color.b})));
`;
    return e;
  }
}
Ue("BABYLON.GradientBlock", Jre);
class zre extends Mr {
  /**
   * Creates a new NLerpBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerInput("gradient", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._linkConnectionTypes(1, 2, !0), this._inputs[2].acceptedConnectionPointTypes.push(de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "NLerpBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the gradient operand input component
   */
  get gradient() {
    return this._inputs[2];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = normalize(mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName}));
`, this;
  }
}
Ue("BABYLON.NLerpBlock", zre);
class aY extends Mr {
  /**
   * Creates a new WorleyNoise3DBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.manhattanDistance = !1, this.registerInput("seed", de.Vector3), this.registerInput("jitter", de.Float), this.registerOutput("output", de.Vector2), this.registerOutput("x", de.Float), this.registerOutput("y", de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "WorleyNoise3DBlock";
  }
  /**
   * Gets the seed input component
   */
  get seed() {
    return this._inputs[0];
  }
  /**
   * Gets the jitter input component
   */
  get jitter() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets the x component
   */
  get x() {
    return this._outputs[1];
  }
  /**
   * Gets the y component
   */
  get y() {
    return this._outputs[2];
  }
  _buildBlock(e) {
    if (super._buildBlock(e), !this.seed.isConnected || !this.output.hasEndpoints && !this.x.hasEndpoints && !this.y.hasEndpoints)
      return;
    let t = `vec3 permute(vec3 x){
`;
    t += `    return mod((34.0 * x + 1.0) * x, 289.0);
`, t += `}

`, t += `vec3 dist(vec3 x, vec3 y, vec3 z,  bool manhattanDistance){
`, t += `    return manhattanDistance ?  abs(x) + abs(y) + abs(z) :  (x * x + y * y + z * z);
`, t += `}

`, t += `vec2 worley(vec3 P, float jitter, bool manhattanDistance){
`, t += `    float K = 0.142857142857; // 1/7
`, t += `    float Ko = 0.428571428571; // 1/2-K/2
`, t += `    float  K2 = 0.020408163265306; // 1/(7*7)
`, t += `    float Kz = 0.166666666667; // 1/6
`, t += `    float Kzo = 0.416666666667; // 1/2-1/6*2
`, t += `
`, t += `    vec3 Pi = mod(floor(P), 289.0);
`, t += `    vec3 Pf = fract(P) - 0.5;
`, t += `
`, t += `    vec3 Pfx = Pf.x + vec3(1.0, 0.0, -1.0);
`, t += `    vec3 Pfy = Pf.y + vec3(1.0, 0.0, -1.0);
`, t += `    vec3 Pfz = Pf.z + vec3(1.0, 0.0, -1.0);
`, t += `
`, t += `    vec3 p = permute(Pi.x + vec3(-1.0, 0.0, 1.0));
`, t += `    vec3 p1 = permute(p + Pi.y - 1.0);
`, t += `    vec3 p2 = permute(p + Pi.y);
`, t += `    vec3 p3 = permute(p + Pi.y + 1.0);
`, t += `
`, t += `    vec3 p11 = permute(p1 + Pi.z - 1.0);
`, t += `    vec3 p12 = permute(p1 + Pi.z);
`, t += `    vec3 p13 = permute(p1 + Pi.z + 1.0);
`, t += `
`, t += `    vec3 p21 = permute(p2 + Pi.z - 1.0);
`, t += `    vec3 p22 = permute(p2 + Pi.z);
`, t += `    vec3 p23 = permute(p2 + Pi.z + 1.0);
`, t += `
`, t += `    vec3 p31 = permute(p3 + Pi.z - 1.0);
`, t += `    vec3 p32 = permute(p3 + Pi.z);
`, t += `    vec3 p33 = permute(p3 + Pi.z + 1.0);
`, t += `
`, t += `    vec3 ox11 = fract(p11*K) - Ko;
`, t += `    vec3 oy11 = mod(floor(p11*K), 7.0)*K - Ko;
`, t += `    vec3 oz11 = floor(p11*K2)*Kz - Kzo; // p11 < 289 guaranteed
`, t += `
`, t += `    vec3 ox12 = fract(p12*K) - Ko;
`, t += `    vec3 oy12 = mod(floor(p12*K), 7.0)*K - Ko;
`, t += `    vec3 oz12 = floor(p12*K2)*Kz - Kzo;
`, t += `
`, t += `    vec3 ox13 = fract(p13*K) - Ko;
`, t += `    vec3 oy13 = mod(floor(p13*K), 7.0)*K - Ko;
`, t += `    vec3 oz13 = floor(p13*K2)*Kz - Kzo;
`, t += `
`, t += `    vec3 ox21 = fract(p21*K) - Ko;
`, t += `    vec3 oy21 = mod(floor(p21*K), 7.0)*K - Ko;
`, t += `    vec3 oz21 = floor(p21*K2)*Kz - Kzo;
`, t += `
`, t += `    vec3 ox22 = fract(p22*K) - Ko;
`, t += `    vec3 oy22 = mod(floor(p22*K), 7.0)*K - Ko;
`, t += `    vec3 oz22 = floor(p22*K2)*Kz - Kzo;
`, t += `
`, t += `    vec3 ox23 = fract(p23*K) - Ko;
`, t += `    vec3 oy23 = mod(floor(p23*K), 7.0)*K - Ko;
`, t += `    vec3 oz23 = floor(p23*K2)*Kz - Kzo;
`, t += `
`, t += `    vec3 ox31 = fract(p31*K) - Ko;
`, t += `    vec3 oy31 = mod(floor(p31*K), 7.0)*K - Ko;
`, t += `    vec3 oz31 = floor(p31*K2)*Kz - Kzo;
`, t += `
`, t += `    vec3 ox32 = fract(p32*K) - Ko;
`, t += `    vec3 oy32 = mod(floor(p32*K), 7.0)*K - Ko;
`, t += `    vec3 oz32 = floor(p32*K2)*Kz - Kzo;
`, t += `
`, t += `    vec3 ox33 = fract(p33*K) - Ko;
`, t += `    vec3 oy33 = mod(floor(p33*K), 7.0)*K - Ko;
`, t += `    vec3 oz33 = floor(p33*K2)*Kz - Kzo;
`, t += `
`, t += `    vec3 dx11 = Pfx + jitter*ox11;
`, t += `    vec3 dy11 = Pfy.x + jitter*oy11;
`, t += `    vec3 dz11 = Pfz.x + jitter*oz11;
`, t += `
`, t += `    vec3 dx12 = Pfx + jitter*ox12;
`, t += `    vec3 dy12 = Pfy.x + jitter*oy12;
`, t += `    vec3 dz12 = Pfz.y + jitter*oz12;
`, t += `
`, t += `    vec3 dx13 = Pfx + jitter*ox13;
`, t += `    vec3 dy13 = Pfy.x + jitter*oy13;
`, t += `    vec3 dz13 = Pfz.z + jitter*oz13;
`, t += `
`, t += `    vec3 dx21 = Pfx + jitter*ox21;
`, t += `    vec3 dy21 = Pfy.y + jitter*oy21;
`, t += `    vec3 dz21 = Pfz.x + jitter*oz21;
`, t += `
`, t += `    vec3 dx22 = Pfx + jitter*ox22;
`, t += `    vec3 dy22 = Pfy.y + jitter*oy22;
`, t += `    vec3 dz22 = Pfz.y + jitter*oz22;
`, t += `
`, t += `    vec3 dx23 = Pfx + jitter*ox23;
`, t += `    vec3 dy23 = Pfy.y + jitter*oy23;
`, t += `    vec3 dz23 = Pfz.z + jitter*oz23;
`, t += `
`, t += `    vec3 dx31 = Pfx + jitter*ox31;
`, t += `    vec3 dy31 = Pfy.z + jitter*oy31;
`, t += `    vec3 dz31 = Pfz.x + jitter*oz31;
`, t += `
`, t += `    vec3 dx32 = Pfx + jitter*ox32;
`, t += `    vec3 dy32 = Pfy.z + jitter*oy32;
`, t += `    vec3 dz32 = Pfz.y + jitter*oz32;
`, t += `
`, t += `    vec3 dx33 = Pfx + jitter*ox33;
`, t += `    vec3 dy33 = Pfy.z + jitter*oy33;
`, t += `    vec3 dz33 = Pfz.z + jitter*oz33;
`, t += `
`, t += `    vec3 d11 = dist(dx11, dy11, dz11, manhattanDistance);
`, t += `    vec3 d12 =dist(dx12, dy12, dz12, manhattanDistance);
`, t += `    vec3 d13 = dist(dx13, dy13, dz13, manhattanDistance);
`, t += `    vec3 d21 = dist(dx21, dy21, dz21, manhattanDistance);
`, t += `    vec3 d22 = dist(dx22, dy22, dz22, manhattanDistance);
`, t += `    vec3 d23 = dist(dx23, dy23, dz23, manhattanDistance);
`, t += `    vec3 d31 = dist(dx31, dy31, dz31, manhattanDistance);
`, t += `    vec3 d32 = dist(dx32, dy32, dz32, manhattanDistance);
`, t += `    vec3 d33 = dist(dx33, dy33, dz33, manhattanDistance);
`, t += `
`, t += `    vec3 d1a = min(d11, d12);
`, t += `    d12 = max(d11, d12);
`, t += `    d11 = min(d1a, d13); // Smallest now not in d12 or d13
`, t += `    d13 = max(d1a, d13);
`, t += `    d12 = min(d12, d13); // 2nd smallest now not in d13
`, t += `    vec3 d2a = min(d21, d22);
`, t += `    d22 = max(d21, d22);
`, t += `    d21 = min(d2a, d23); // Smallest now not in d22 or d23
`, t += `    d23 = max(d2a, d23);
`, t += `    d22 = min(d22, d23); // 2nd smallest now not in d23
`, t += `    vec3 d3a = min(d31, d32);
`, t += `    d32 = max(d31, d32);
`, t += `    d31 = min(d3a, d33); // Smallest now not in d32 or d33
`, t += `    d33 = max(d3a, d33);
`, t += `    d32 = min(d32, d33); // 2nd smallest now not in d33
`, t += `    vec3 da = min(d11, d21);
`, t += `    d21 = max(d11, d21);
`, t += `    d11 = min(da, d31); // Smallest now in d11
`, t += `    d31 = max(da, d31); // 2nd smallest now not in d31
`, t += `    d11.xy = (d11.x < d11.y) ? d11.xy : d11.yx;
`, t += `    d11.xz = (d11.x < d11.z) ? d11.xz : d11.zx; // d11.x now smallest
`, t += `    d12 = min(d12, d21); // 2nd smallest now not in d21
`, t += `    d12 = min(d12, d22); // nor in d22
`, t += `    d12 = min(d12, d31); // nor in d31
`, t += `    d12 = min(d12, d32); // nor in d32
`, t += `    d11.yz = min(d11.yz,d12.xy); // nor in d12.yz
`, t += `    d11.y = min(d11.y,d12.z); // Only two more to go
`, t += `    d11.y = min(d11.y,d11.z); // Done! (Phew!)
`, t += `    return sqrt(d11.xy); // F1, F2
`, t += `}

`, e._emitFunction("worley3D", t, "// Worley3D");
    const r = e._getFreeVariableName("worleyTemp");
    return e.compilationString += `vec2 ${r} = worley(${this.seed.associatedVariableName}, ${this.jitter.associatedVariableName}, ${this.manhattanDistance});
`, this.output.hasEndpoints && (e.compilationString += this._declareOutput(this.output, e) + ` = ${r};
`), this.x.hasEndpoints && (e.compilationString += this._declareOutput(this.x, e) + ` = ${r}.x;
`), this.y.hasEndpoints && (e.compilationString += this._declareOutput(this.y, e) + ` = ${r}.y;
`), this;
  }
  /**
   * Exposes the properties to the UI?
   */
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.manhattanDistance = ${this.manhattanDistance};
`;
  }
  /**
   * Exposes the properties to the Serialize?
   */
  serialize() {
    const e = super.serialize();
    return e.manhattanDistance = this.manhattanDistance, e;
  }
  /**
   * Exposes the properties to the deserialize?
   * @param serializationObject
   * @param scene
   * @param rootUrl
   */
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.manhattanDistance = e.manhattanDistance;
  }
}
C([
  rn("Use Manhattan Distance", Gr.Boolean, "PROPERTIES", { notifiers: { update: !1 } })
], aY.prototype, "manhattanDistance", void 0);
Ue("BABYLON.WorleyNoise3DBlock", aY);
class Gre extends Mr {
  /**
   * Creates a new SimplexPerlin3DBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("seed", de.Vector3), this.registerOutput("output", de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SimplexPerlin3DBlock";
  }
  /**
   * Gets the seed operand input component
   */
  get seed() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    if (super._buildBlock(e), !this.seed.isConnected || !this._outputs[0].hasEndpoints)
      return;
    let t = `const float SKEWFACTOR = 1.0/3.0;
`;
    return t += `const float UNSKEWFACTOR = 1.0/6.0;
`, t += `const float SIMPLEX_CORNER_POS = 0.5;
`, t += `const float SIMPLEX_TETRAHADRON_HEIGHT = 0.70710678118654752440084436210485;
`, t += `float SimplexPerlin3D( vec3 P ){
`, t += `    P.x = P == vec3(0., 0., 0.) ? 0.00001 : P.x;
`, t += `    P *= SIMPLEX_TETRAHADRON_HEIGHT;
`, t += "    vec3 Pi = floor( P + dot( P, vec3( SKEWFACTOR) ) );", t += `    vec3 x0 = P - Pi + dot(Pi, vec3( UNSKEWFACTOR ) );
`, t += `    vec3 g = step(x0.yzx, x0.xyz);
`, t += `    vec3 l = 1.0 - g;
`, t += `    vec3 Pi_1 = min( g.xyz, l.zxy );
`, t += `    vec3 Pi_2 = max( g.xyz, l.zxy );
`, t += `    vec3 x1 = x0 - Pi_1 + UNSKEWFACTOR;
`, t += `    vec3 x2 = x0 - Pi_2 + SKEWFACTOR;
`, t += `    vec3 x3 = x0 - SIMPLEX_CORNER_POS;
`, t += `    vec4 v1234_x = vec4( x0.x, x1.x, x2.x, x3.x );
`, t += `    vec4 v1234_y = vec4( x0.y, x1.y, x2.y, x3.y );
`, t += `    vec4 v1234_z = vec4( x0.z, x1.z, x2.z, x3.z );
`, t += `    Pi.xyz = Pi.xyz - floor(Pi.xyz * ( 1.0 / 69.0 )) * 69.0;
`, t += `    vec3 Pi_inc1 = step( Pi, vec3( 69.0 - 1.5 ) ) * ( Pi + 1.0 );
`, t += `    vec4 Pt = vec4( Pi.xy, Pi_inc1.xy ) + vec2( 50.0, 161.0 ).xyxy;
`, t += `    Pt *= Pt;
`, t += `    vec4 V1xy_V2xy = mix( Pt.xyxy, Pt.zwzw, vec4( Pi_1.xy, Pi_2.xy ) );
`, t += `    Pt = vec4( Pt.x, V1xy_V2xy.xz, Pt.z ) * vec4( Pt.y, V1xy_V2xy.yw, Pt.w );
`, t += `    const vec3 SOMELARGEFLOATS = vec3( 635.298681, 682.357502, 668.926525 );
`, t += `    const vec3 ZINC = vec3( 48.500388, 65.294118, 63.934599 );
`, t += `    vec3 lowz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi.zzz * ZINC.xyz ) );
`, t += `    vec3 highz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi_inc1.zzz * ZINC.xyz ) );
`, t += `    Pi_1 = ( Pi_1.z < 0.5 ) ? lowz_mods : highz_mods;
`, t += `    Pi_2 = ( Pi_2.z < 0.5 ) ? lowz_mods : highz_mods;
`, t += `    vec4 hash_0 = fract( Pt * vec4( lowz_mods.x, Pi_1.x, Pi_2.x, highz_mods.x ) ) - 0.49999;
`, t += `    vec4 hash_1 = fract( Pt * vec4( lowz_mods.y, Pi_1.y, Pi_2.y, highz_mods.y ) ) - 0.49999;
`, t += `    vec4 hash_2 = fract( Pt * vec4( lowz_mods.z, Pi_1.z, Pi_2.z, highz_mods.z ) ) - 0.49999;
`, t += `    vec4 grad_results = inversesqrt( hash_0 * hash_0 + hash_1 * hash_1 + hash_2 * hash_2 ) * ( hash_0 * v1234_x + hash_1 * v1234_y + hash_2 * v1234_z );
`, t += `    const float FINAL_NORMALIZATION = 37.837227241611314102871574478976;
`, t += `    vec4 kernel_weights = v1234_x * v1234_x + v1234_y * v1234_y + v1234_z * v1234_z;
`, t += `    kernel_weights = max(0.5 - kernel_weights, 0.0);
`, t += `    kernel_weights = kernel_weights*kernel_weights*kernel_weights;
`, t += `    return dot( kernel_weights, grad_results ) * FINAL_NORMALIZATION;
`, t += `}
`, e._emitFunction("SimplexPerlin3D", t, "// SimplexPerlin3D"), e.compilationString += this._declareOutput(this._outputs[0], e) + ` = SimplexPerlin3D(${this.seed.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.SimplexPerlin3DBlock", Gre);
class Zre extends Mr {
  /**
   * Creates a new NormalBlendBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("normalMap0", de.AutoDetect), this.registerInput("normalMap1", de.AutoDetect), this.registerOutput("output", de.Vector3), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Color4 | de.Vector3 | de.Vector4), this._inputs[1].addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Color4 | de.Vector3 | de.Vector4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "NormalBlendBlock";
  }
  /**
   * Gets the first input component
   */
  get normalMap0() {
    return this._inputs[0];
  }
  /**
   * Gets the second input component
   */
  get normalMap1() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], r = this._inputs[0], n = this._inputs[1], i = e._getFreeVariableName("stepR"), s = e._getFreeVariableName("stepG");
    return e.compilationString += `float ${i} = step(0.5, ${r.associatedVariableName}.r);
`, e.compilationString += `float ${s} = step(0.5, ${r.associatedVariableName}.g);
`, e.compilationString += this._declareOutput(t, e) + `;
`, e.compilationString += `${t.associatedVariableName}.r = (1.0 - ${i}) * ${r.associatedVariableName}.r * ${n.associatedVariableName}.r * 2.0 + ${i} * (1.0 - (1.0 - ${r.associatedVariableName}.r) * (1.0 - ${n.associatedVariableName}.r) * 2.0);
`, e.compilationString += `${t.associatedVariableName}.g = (1.0 - ${s}) * ${r.associatedVariableName}.g * ${n.associatedVariableName}.g * 2.0 + ${s} * (1.0 - (1.0 - ${r.associatedVariableName}.g) * (1.0 - ${n.associatedVariableName}.g) * 2.0);
`, e.compilationString += `${t.associatedVariableName}.b = ${r.associatedVariableName}.b * ${n.associatedVariableName}.b;
`, this;
  }
}
Ue("BABYLON.NormalBlendBlock", Zre);
class _re extends Mr {
  /**
   * Creates a new Rotate2dBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("input", de.Vector2), this.registerInput("angle", de.Float), this.registerOutput("output", de.Vector2);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "Rotate2dBlock";
  }
  /**
   * Gets the input vector
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the input angle
   */
  get angle() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.angle.isConnected) {
      const e = new gi("angle");
      e.value = 0, e.output.connectTo(this.angle);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], r = this.angle, n = this.input;
    return e.compilationString += this._declareOutput(t, e) + ` = vec2(cos(${r.associatedVariableName}) * ${n.associatedVariableName}.x - sin(${r.associatedVariableName}) * ${n.associatedVariableName}.y, sin(${r.associatedVariableName}) * ${n.associatedVariableName}.x + cos(${r.associatedVariableName}) * ${n.associatedVariableName}.y);
`, this;
  }
}
Ue("BABYLON.Rotate2dBlock", _re);
class $re extends Mr {
  /**
   * Creates a new ReflectBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("incident", de.AutoDetect), this.registerInput("normal", de.AutoDetect), this.registerOutput("output", de.Vector3), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Vector3 | de.Vector4 | de.Color3 | de.Color4), this._inputs[1].addExcludedConnectionPointFromAllowedTypes(de.Vector3 | de.Vector4 | de.Color3 | de.Color4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ReflectBlock";
  }
  /**
   * Gets the incident component
   */
  get incident() {
    return this._inputs[0];
  }
  /**
   * Gets the normal component
   */
  get normal() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = reflect(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz);
`, this;
  }
}
Ue("BABYLON.ReflectBlock", $re);
class ene extends Mr {
  /**
   * Creates a new RefractBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("incident", de.AutoDetect), this.registerInput("normal", de.AutoDetect), this.registerInput("ior", de.Float), this.registerOutput("output", de.Vector3), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Vector3 | de.Vector4 | de.Color3 | de.Color4), this._inputs[1].addExcludedConnectionPointFromAllowedTypes(de.Vector3 | de.Vector4 | de.Color3 | de.Color4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "RefractBlock";
  }
  /**
   * Gets the incident component
   */
  get incident() {
    return this._inputs[0];
  }
  /**
   * Gets the normal component
   */
  get normal() {
    return this._inputs[1];
  }
  /**
   * Gets the index of refraction component
   */
  get ior() {
    return this._inputs[2];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = refract(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz, ${this.ior.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.RefractBlock", ene);
class tne extends Mr {
  /**
   * Creates a new DesaturateBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("color", de.Color3), this.registerInput("level", de.Float), this.registerOutput("output", de.Color3);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "DesaturateBlock";
  }
  /**
   * Gets the color operand input component
   */
  get color() {
    return this._inputs[0];
  }
  /**
   * Gets the level operand input component
   */
  get level() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], n = this.color.associatedVariableName, i = e._getFreeVariableName("colorMin"), s = e._getFreeVariableName("colorMax"), a = e._getFreeVariableName("colorMerge");
    return e.compilationString += `float ${i} = min(min(${n}.x, ${n}.y), ${n}.z);
`, e.compilationString += `float ${s} = max(max(${n}.x, ${n}.y), ${n}.z);
`, e.compilationString += `float ${a} = 0.5 * (${i} + ${s});
`, e.compilationString += this._declareOutput(t, e) + ` = mix(${n}, vec3(${a}, ${a}, ${a}), ${this.level.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.DesaturateBlock", tne);
class Vm extends Mr {
  /**
   * Create a new SheenBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.albedoScaling = !1, this.linkSheenWithAlbedo = !1, this._isUnique = !0, this.registerInput("intensity", de.Float, !0, Ve.Fragment), this.registerInput("color", de.Color3, !0, Ve.Fragment), this.registerInput("roughness", de.Float, !0, Ve.Fragment), this.registerOutput("sheen", de.Object, Ve.Fragment, new Ko("sheen", this, ao.Output, Vm, "SheenBlock"));
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("sheenOut"), e._excludeVariableName("sheenMapData"), e._excludeVariableName("vSheenColor"), e._excludeVariableName("vSheenRoughness");
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SheenBlock";
  }
  /**
   * Gets the intensity input component
   */
  get intensity() {
    return this._inputs[0];
  }
  /**
   * Gets the color input component
   */
  get color() {
    return this._inputs[1];
  }
  /**
   * Gets the roughness input component
   */
  get roughness() {
    return this._inputs[2];
  }
  /**
   * Gets the sheen object output component
   */
  get sheen() {
    return this._outputs[0];
  }
  prepareDefines(e, t, r) {
    super.prepareDefines(e, t, r), r.setValue("SHEEN", !0), r.setValue("SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE", !0, !0), r.setValue("SHEEN_LINKWITHALBEDO", this.linkSheenWithAlbedo, !0), r.setValue("SHEEN_ROUGHNESS", this.roughness.isConnected, !0), r.setValue("SHEEN_ALBEDOSCALING", this.albedoScaling, !0);
  }
  /**
   * Gets the main code of the block (fragment side)
   * @param reflectionBlock instance of a ReflectionBlock null if the code must be generated without an active reflection module
   * @returns the shader code
   */
  getCode(e) {
    let t = "";
    const r = this.color.isConnected ? this.color.associatedVariableName : "vec3(1.)", n = this.intensity.isConnected ? this.intensity.associatedVariableName : "1.", i = this.roughness.isConnected ? this.roughness.associatedVariableName : "0.";
    return t = `#ifdef SHEEN
            sheenOutParams sheenOut;

            vec4 vSheenColor = vec4(${r}, ${n});

            sheenBlock(
                vSheenColor,
            #ifdef SHEEN_ROUGHNESS
                ${i},
            #endif
                roughness,
            #ifdef SHEEN_TEXTURE
                vec4(0.),
                1.0,
            #endif
                reflectance,
            #ifdef SHEEN_LINKWITHALBEDO
                baseColor,
                surfaceAlbedo,
            #endif
            #ifdef ENVIRONMENTBRDF
                NdotV,
                environmentBrdf,
            #endif
            #if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
                AARoughnessFactors,
                ${e == null ? void 0 : e._vReflectionMicrosurfaceInfosName},
                ${e == null ? void 0 : e._vReflectionInfosName},
                ${e == null ? void 0 : e.reflectionColor},
                vLightingIntensity,
                #ifdef ${e == null ? void 0 : e._define3DName}
                    ${e == null ? void 0 : e._cubeSamplerName},
                #else
                    ${e == null ? void 0 : e._2DSamplerName},
                #endif
                reflectionOut.reflectionCoords,
                NdotVUnclamped,
                #ifndef LODBASEDMICROSFURACE
                    #ifdef ${e == null ? void 0 : e._define3DName}
                        ${e == null ? void 0 : e._cubeSamplerName},
                        ${e == null ? void 0 : e._cubeSamplerName},
                    #else
                        ${e == null ? void 0 : e._2DSamplerName},
                        ${e == null ? void 0 : e._2DSamplerName},
                    #endif
                #endif
                #if !defined(${e == null ? void 0 : e._defineSkyboxName}) && defined(RADIANCEOCCLUSION)
                    seo,
                #endif
                #if !defined(${e == null ? void 0 : e._defineSkyboxName}) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(${e == null ? void 0 : e._define3DName})
                    eho,
                #endif
            #endif
                sheenOut
            );

            #ifdef SHEEN_LINKWITHALBEDO
                surfaceAlbedo = sheenOut.surfaceAlbedo;
            #endif
        #endif
`, t;
  }
  _buildBlock(e) {
    return e.target === Ve.Fragment && e.sharedData.blocksWithDefines.push(this), this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.albedoScaling = ${this.albedoScaling};
`, e += `${this._codeVariableName}.linkSheenWithAlbedo = ${this.linkSheenWithAlbedo};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return e.albedoScaling = this.albedoScaling, e.linkSheenWithAlbedo = this.linkSheenWithAlbedo, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.albedoScaling = e.albedoScaling, this.linkSheenWithAlbedo = e.linkSheenWithAlbedo;
  }
}
C([
  rn("Albedo scaling", Gr.Boolean, "PROPERTIES", { notifiers: { update: !0 } })
], Vm.prototype, "albedoScaling", void 0);
C([
  rn("Link sheen with albedo", Gr.Boolean, "PROPERTIES", { notifiers: { update: !0 } })
], Vm.prototype, "linkSheenWithAlbedo", void 0);
Ue("BABYLON.SheenBlock", Vm);
class fV extends Mr {
  /**
   * Create a new AnisotropyBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this._tangentCorrectionFactorName = "", this._isUnique = !0, this.registerInput("intensity", de.Float, !0, Ve.Fragment), this.registerInput("direction", de.Vector2, !0, Ve.Fragment), this.registerInput("uv", de.Vector2, !0), this.registerInput("worldTangent", de.Vector4, !0), this.registerInput("TBN", de.Object, !0, Ve.VertexAndFragment, new Ko("TBN", this, ao.Input, Rm, "TBNBlock")), this.registerInput("roughness", de.Float, !0, Ve.Fragment), this.registerOutput("anisotropy", de.Object, Ve.Fragment, new Ko("anisotropy", this, ao.Output, fV, "AnisotropyBlock"));
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("anisotropicOut"), e._excludeVariableName("TBN");
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "AnisotropyBlock";
  }
  /**
   * Gets the intensity input component
   */
  get intensity() {
    return this._inputs[0];
  }
  /**
   * Gets the direction input component
   */
  get direction() {
    return this._inputs[1];
  }
  /**
   * Gets the uv input component
   */
  get uv() {
    return this._inputs[2];
  }
  /**
   * Gets the worldTangent input component
   */
  get worldTangent() {
    return this._inputs[3];
  }
  /**
   * Gets the TBN input component
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  get TBN() {
    return this._inputs[4];
  }
  /**
   * Gets the roughness input component
   */
  get roughness() {
    return this._inputs[5];
  }
  /**
   * Gets the anisotropy object output component
   */
  get anisotropy() {
    return this._outputs[0];
  }
  _generateTBNSpace(e) {
    let t = "";
    const r = `//${this.name}`, n = this.uv, i = this.worldPositionConnectionPoint, s = this.worldNormalConnectionPoint, a = this.worldTangent;
    n.isConnected || console.error("You must connect the 'uv' input of the Anisotropy block!"), e._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
    const f = { search: /defined\(TANGENT\)/g, replace: a.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" }, o = this.TBN;
    return o.isConnected ? e.compilationString += `
            #ifdef TBNBLOCK
            mat3 vTBN = ${o.associatedVariableName};
            #endif
            ` : a.isConnected && (t += `vec3 tbnNormal = normalize(${s.associatedVariableName}.xyz);
`, t += `vec3 tbnTangent = normalize(${a.associatedVariableName}.xyz);
`, t += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent) * ${this._tangentCorrectionFactorName};
`, t += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);
`), t += `
            #if defined(${a.isConnected ? "TANGENT" : "IGNORE"}) && defined(NORMAL)
                mat3 TBN = vTBN;
            #else
                mat3 TBN = cotangent_frame(${s.associatedVariableName + ".xyz"}, ${"v_" + i.associatedVariableName + ".xyz"}, ${n.isConnected ? n.associatedVariableName : "vec2(0.)"}, vec2(1., 1.));
            #endif
`, e._emitFunctionFromInclude("bumpFragmentMainFunctions", r, {
      replaceStrings: [f]
    }), t;
  }
  /**
   * Gets the main code of the block (fragment side)
   * @param state current state of the node material building
   * @param generateTBNSpace if true, the code needed to create the TBN coordinate space is generated
   * @returns the shader code
   */
  getCode(e, t = !1) {
    let r = "";
    t && (r += this._generateTBNSpace(e));
    const n = this.intensity.isConnected ? this.intensity.associatedVariableName : "1.0", i = this.direction.isConnected ? this.direction.associatedVariableName : "vec2(1., 0.)", s = this.roughness.isConnected ? this.roughness.associatedVariableName : "0.";
    return r += `anisotropicOutParams anisotropicOut;
            anisotropicBlock(
                vec3(${i}, ${n}),
                ${s},
            #ifdef ANISOTROPIC_TEXTURE
                vec3(0.),
            #endif
                TBN,
                normalW,
                viewDirectionW,
                anisotropicOut
            );
`, r;
  }
  prepareDefines(e, t, r) {
    super.prepareDefines(e, t, r), r.setValue("ANISOTROPIC", !0), r.setValue("ANISOTROPIC_TEXTURE", !1, !0), r.setValue("ANISOTROPIC_LEGACY", !this.roughness.isConnected);
  }
  bind(e, t, r) {
    super.bind(e, t, r), r && e.setFloat(this._tangentCorrectionFactorName, r.getWorldMatrix().determinant() < 0 ? -1 : 1);
  }
  _buildBlock(e) {
    return e.target === Ve.Fragment && (e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), this._tangentCorrectionFactorName = e._getFreeDefineName("tangentCorrectionFactor"), e._emitUniformFromString(this._tangentCorrectionFactorName, "float")), this;
  }
}
Ue("BABYLON.AnisotropyBlock", fV);
class Cm extends $I {
  _onGenerateOnlyFragmentCodeChanged() {
    return this.position.isConnected ? (this.generateOnlyFragmentCode = !this.generateOnlyFragmentCode, console.error("The position input must not be connected to be able to switch!"), !1) : (this._setTarget(), !0);
  }
  _setTarget() {
    super._setTarget(), this.getInputByName("position").target = this.generateOnlyFragmentCode ? Ve.Fragment : Ve.Vertex, this.generateOnlyFragmentCode && (this.forceIrradianceInFragment = !0);
  }
  /**
   * Create a new ReflectionBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.useSphericalHarmonics = !0, this.forceIrradianceInFragment = !1, this._isUnique = !0, this.registerInput("position", de.AutoDetect, !1, Ve.Vertex), this.registerInput("world", de.Matrix, !1, Ve.Vertex), this.registerInput("color", de.Color3, !0, Ve.Fragment), this.registerOutput("reflection", de.Object, Ve.Fragment, new Ko("reflection", this, ao.Output, Cm, "ReflectionBlock")), this.position.addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Vector3 | de.Vector4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ReflectionBlock";
  }
  /**
   * Gets the position input component
   */
  get position() {
    return this._inputs[0];
  }
  /**
   * Gets the world position input component
   */
  get worldPosition() {
    return this.worldPositionConnectionPoint;
  }
  /**
   * Gets the world normal input component
   */
  get worldNormal() {
    return this.worldNormalConnectionPoint;
  }
  /**
   * Gets the world input component
   */
  get world() {
    return this._inputs[1];
  }
  /**
   * Gets the camera (or eye) position component
   */
  get cameraPosition() {
    return this.cameraPositionConnectionPoint;
  }
  /**
   * Gets the view input component
   */
  get view() {
    return this.viewConnectionPoint;
  }
  /**
   * Gets the color input component
   */
  get color() {
    return this._inputs[2];
  }
  /**
   * Gets the reflection object output component
   */
  get reflection() {
    return this._outputs[0];
  }
  /**
   * Returns true if the block has a texture (either its own texture or the environment texture from the scene, if set)
   */
  get hasTexture() {
    return !!this._getTexture();
  }
  /**
   * Gets the reflection color (either the name of the variable if the color input is connected, else a default value)
   */
  get reflectionColor() {
    return this.color.isConnected ? this.color.associatedVariableName : "vec3(1., 1., 1.)";
  }
  _getTexture() {
    return this.texture ? this.texture : this._scene.environmentTexture;
  }
  prepareDefines(e, t, r) {
    super.prepareDefines(e, t, r);
    const n = this._getTexture(), i = n && n.getTextureMatrix;
    r.setValue("REFLECTION", i, !0), i && (r.setValue(this._defineLODReflectionAlpha, n.lodLevelInAlpha, !0), r.setValue(this._defineLinearSpecularReflection, n.linearSpecularLOD, !0), r.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem ? !n.invertZ : n.invertZ, !0), r.setValue("SPHERICAL_HARMONICS", this.useSphericalHarmonics, !0), r.setValue("GAMMAREFLECTION", n.gammaSpace, !0), r.setValue("RGBDREFLECTION", n.isRGBD, !0), n && n.coordinatesMode !== We.SKYBOX_MODE && n.isCube && (r.setValue("USESPHERICALFROMREFLECTIONMAP", !0), r.setValue("USEIRRADIANCEMAP", !1), this.forceIrradianceInFragment || this._scene.getEngine().getCaps().maxVaryingVectors <= 8 ? r.setValue("USESPHERICALINVERTEX", !1) : r.setValue("USESPHERICALINVERTEX", !0)));
  }
  bind(e, t, r, n) {
    super.bind(e, t, r);
    const i = this._getTexture();
    if (!i || !n)
      return;
    i.isCube ? e.setTexture(this._cubeSamplerName, i) : e.setTexture(this._2DSamplerName, i);
    const s = i.getSize().width;
    e.setFloat3(this._vReflectionMicrosurfaceInfosName, s, i.lodGenerationScale, i.lodGenerationOffset), e.setFloat2(this._vReflectionFilteringInfoName, s, Xt.Log2(s));
    const a = n.materialDefines, f = i.sphericalPolynomial;
    if (a.USESPHERICALFROMREFLECTIONMAP && f)
      if (a.SPHERICAL_HARMONICS) {
        const o = f.preScaledHarmonics;
        e.setVector3("vSphericalL00", o.l00), e.setVector3("vSphericalL1_1", o.l1_1), e.setVector3("vSphericalL10", o.l10), e.setVector3("vSphericalL11", o.l11), e.setVector3("vSphericalL2_2", o.l2_2), e.setVector3("vSphericalL2_1", o.l2_1), e.setVector3("vSphericalL20", o.l20), e.setVector3("vSphericalL21", o.l21), e.setVector3("vSphericalL22", o.l22);
      } else
        e.setFloat3("vSphericalX", f.x.x, f.x.y, f.x.z), e.setFloat3("vSphericalY", f.y.x, f.y.y, f.y.z), e.setFloat3("vSphericalZ", f.z.x, f.z.y, f.z.z), e.setFloat3("vSphericalXX_ZZ", f.xx.x - f.zz.x, f.xx.y - f.zz.y, f.xx.z - f.zz.z), e.setFloat3("vSphericalYY_ZZ", f.yy.x - f.zz.x, f.yy.y - f.zz.y, f.yy.z - f.zz.z), e.setFloat3("vSphericalZZ", f.zz.x, f.zz.y, f.zz.z), e.setFloat3("vSphericalXY", f.xy.x, f.xy.y, f.xy.z), e.setFloat3("vSphericalYZ", f.yz.x, f.yz.y, f.yz.z), e.setFloat3("vSphericalZX", f.zx.x, f.zx.y, f.zx.z);
  }
  /**
   * Gets the code to inject in the vertex shader
   * @param state current state of the node material building
   * @returns the shader code
   */
  handleVertexSide(e) {
    let t = super.handleVertexSide(e);
    e._emitFunctionFromInclude("harmonicsFunctions", `//${this.name}`, {
      replaceStrings: [
        { search: /uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g, replace: "" },
        { search: /uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g, replace: "" }
      ]
    });
    const r = e._getFreeVariableName("reflectionVector");
    return this._vEnvironmentIrradianceName = e._getFreeVariableName("vEnvironmentIrradiance"), e._emitVaryingFromString(this._vEnvironmentIrradianceName, "vec3", "defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)"), e._emitUniformFromString("vSphericalL00", "vec3", "SPHERICAL_HARMONICS"), e._emitUniformFromString("vSphericalL1_1", "vec3", "SPHERICAL_HARMONICS"), e._emitUniformFromString("vSphericalL10", "vec3", "SPHERICAL_HARMONICS"), e._emitUniformFromString("vSphericalL11", "vec3", "SPHERICAL_HARMONICS"), e._emitUniformFromString("vSphericalL2_2", "vec3", "SPHERICAL_HARMONICS"), e._emitUniformFromString("vSphericalL2_1", "vec3", "SPHERICAL_HARMONICS"), e._emitUniformFromString("vSphericalL20", "vec3", "SPHERICAL_HARMONICS"), e._emitUniformFromString("vSphericalL21", "vec3", "SPHERICAL_HARMONICS"), e._emitUniformFromString("vSphericalL22", "vec3", "SPHERICAL_HARMONICS"), e._emitUniformFromString("vSphericalX", "vec3", "SPHERICAL_HARMONICS", !0), e._emitUniformFromString("vSphericalY", "vec3", "SPHERICAL_HARMONICS", !0), e._emitUniformFromString("vSphericalZ", "vec3", "SPHERICAL_HARMONICS", !0), e._emitUniformFromString("vSphericalXX_ZZ", "vec3", "SPHERICAL_HARMONICS", !0), e._emitUniformFromString("vSphericalYY_ZZ", "vec3", "SPHERICAL_HARMONICS", !0), e._emitUniformFromString("vSphericalZZ", "vec3", "SPHERICAL_HARMONICS", !0), e._emitUniformFromString("vSphericalXY", "vec3", "SPHERICAL_HARMONICS", !0), e._emitUniformFromString("vSphericalYZ", "vec3", "SPHERICAL_HARMONICS", !0), e._emitUniformFromString("vSphericalZX", "vec3", "SPHERICAL_HARMONICS", !0), t += `#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
                vec3 ${r} = vec3(${this._reflectionMatrixName} * vec4(normalize(${this.worldNormal.associatedVariableName}).xyz, 0)).xyz;
                #ifdef ${this._defineOppositeZ}
                    ${r}.z *= -1.0;
                #endif
                ${this._vEnvironmentIrradianceName} = computeEnvironmentIrradiance(${r});
            #endif
`, t;
  }
  /**
   * Gets the main code of the block (fragment side)
   * @param state current state of the node material building
   * @param normalVarName name of the existing variable corresponding to the normal
   * @returns the shader code
   */
  getCode(e, t) {
    let r = "";
    this.handleFragmentSideInits(e), e._emitFunctionFromInclude("harmonicsFunctions", `//${this.name}`, {
      replaceStrings: [
        { search: /uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g, replace: "" },
        { search: /uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g, replace: "" }
      ]
    }), e._emitFunction("sampleReflection", `
            #ifdef ${this._define3DName}
                #define sampleReflection(s, c) textureCube(s, c)
            #else
                #define sampleReflection(s, c) texture2D(s, c)
            #endif
`, `//${this.name}`), e._emitFunction("sampleReflectionLod", `
            #ifdef ${this._define3DName}
                #define sampleReflectionLod(s, c, l) textureCubeLodEXT(s, c, l)
            #else
                #define sampleReflectionLod(s, c, l) texture2DLodEXT(s, c, l)
            #endif
`, `//${this.name}`);
    const n = `
            vec3 computeReflectionCoordsPBR(vec4 worldPos, vec3 worldNormal) {
                ${this.handleFragmentSideCodeReflectionCoords("worldNormal", "worldPos", !0, !0)}
                return ${this._reflectionVectorName};
            }
`;
    return e._emitFunction("computeReflectionCoordsPBR", n, `//${this.name}`), this._vReflectionMicrosurfaceInfosName = e._getFreeVariableName("vReflectionMicrosurfaceInfos"), e._emitUniformFromString(this._vReflectionMicrosurfaceInfosName, "vec3"), this._vReflectionInfosName = e._getFreeVariableName("vReflectionInfos"), this._vReflectionFilteringInfoName = e._getFreeVariableName("vReflectionFilteringInfo"), e._emitUniformFromString(this._vReflectionFilteringInfoName, "vec2"), r += `#ifdef REFLECTION
            vec2 ${this._vReflectionInfosName} = vec2(1., 0.);

            reflectionOutParams reflectionOut;

            reflectionBlock(
                ${this.generateOnlyFragmentCode ? this._worldPositionNameInFragmentOnlyMode : "v_" + this.worldPosition.associatedVariableName}.xyz,
                ${t},
                alphaG,
                ${this._vReflectionMicrosurfaceInfosName},
                ${this._vReflectionInfosName},
                ${this.reflectionColor},
            #ifdef ANISOTROPIC
                anisotropicOut,
            #endif
            #if defined(${this._defineLODReflectionAlpha}) && !defined(${this._defineSkyboxName})
                NdotVUnclamped,
            #endif
            #ifdef ${this._defineLinearSpecularReflection}
                roughness,
            #endif
            #ifdef ${this._define3DName}
                ${this._cubeSamplerName},
            #else
                ${this._2DSamplerName},
            #endif
            #if defined(NORMAL) && defined(USESPHERICALINVERTEX)
                ${this._vEnvironmentIrradianceName},
            #endif
            #ifdef USESPHERICALFROMREFLECTIONMAP
                #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
                    ${this._reflectionMatrixName},
                #endif
            #endif
            #ifdef USEIRRADIANCEMAP
                irradianceSampler, // ** not handled **
            #endif
            #ifndef LODBASEDMICROSFURACE
                #ifdef ${this._define3DName}
                    ${this._cubeSamplerName},
                    ${this._cubeSamplerName},
                #else
                    ${this._2DSamplerName},
                    ${this._2DSamplerName},
                #endif
            #endif
            #ifdef REALTIME_FILTERING
                ${this._vReflectionFilteringInfoName},
            #endif
                reflectionOut
            );
        #endif
`, r;
  }
  _buildBlock(e) {
    return this._scene = e.sharedData.scene, e.target !== Ve.Fragment && (this._defineLODReflectionAlpha = e._getFreeDefineName("LODINREFLECTIONALPHA"), this._defineLinearSpecularReflection = e._getFreeDefineName("LINEARSPECULARREFLECTION")), this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return this.texture && (e += `${this._codeVariableName}.texture.gammaSpace = ${this.texture.gammaSpace};
`), e += `${this._codeVariableName}.useSphericalHarmonics = ${this.useSphericalHarmonics};
`, e += `${this._codeVariableName}.forceIrradianceInFragment = ${this.forceIrradianceInFragment};
`, e;
  }
  serialize() {
    var e, t;
    const r = super.serialize();
    return r.useSphericalHarmonics = this.useSphericalHarmonics, r.forceIrradianceInFragment = this.forceIrradianceInFragment, r.gammaSpace = (t = (e = this.texture) === null || e === void 0 ? void 0 : e.gammaSpace) !== null && t !== void 0 ? t : !0, r;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.useSphericalHarmonics = e.useSphericalHarmonics, this.forceIrradianceInFragment = e.forceIrradianceInFragment, this.texture && (this.texture.gammaSpace = e.gammaSpace);
  }
}
C([
  rn("Spherical Harmonics", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], Cm.prototype, "useSphericalHarmonics", void 0);
C([
  rn("Force irradiance in fragment", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], Cm.prototype, "forceIrradianceInFragment", void 0);
Ue("BABYLON.ReflectionBlock", Cm);
class Xm extends Mr {
  /**
   * Create a new ClearCoatBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this._tangentCorrectionFactorName = "", this.remapF0OnInterfaceChange = !0, this._isUnique = !0, this.registerInput("intensity", de.Float, !1, Ve.Fragment), this.registerInput("roughness", de.Float, !0, Ve.Fragment), this.registerInput("indexOfRefraction", de.Float, !0, Ve.Fragment), this.registerInput("normalMapColor", de.Color3, !0, Ve.Fragment), this.registerInput("uv", de.Vector2, !0, Ve.Fragment), this.registerInput("tintColor", de.Color3, !0, Ve.Fragment), this.registerInput("tintAtDistance", de.Float, !0, Ve.Fragment), this.registerInput("tintThickness", de.Float, !0, Ve.Fragment), this.registerInput("worldTangent", de.Vector4, !0), this.registerInput("worldNormal", de.AutoDetect, !0), this.worldNormal.addExcludedConnectionPointFromAllowedTypes(de.Color4 | de.Vector4 | de.Vector3), this.registerInput("TBN", de.Object, !0, Ve.VertexAndFragment, new Ko("TBN", this, ao.Input, Rm, "TBNBlock")), this.registerOutput("clearcoat", de.Object, Ve.Fragment, new Ko("clearcoat", this, ao.Output, Xm, "ClearCoatBlock"));
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("clearcoatOut"), e._excludeVariableName("vClearCoatParams"), e._excludeVariableName("vClearCoatTintParams"), e._excludeVariableName("vClearCoatRefractionParams"), e._excludeVariableName("vClearCoatTangentSpaceParams"), e._excludeVariableName("vGeometricNormaClearCoatW");
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ClearCoatBlock";
  }
  /**
   * Gets the intensity input component
   */
  get intensity() {
    return this._inputs[0];
  }
  /**
   * Gets the roughness input component
   */
  get roughness() {
    return this._inputs[1];
  }
  /**
   * Gets the ior input component
   */
  get indexOfRefraction() {
    return this._inputs[2];
  }
  /**
   * Gets the bump texture input component
   */
  get normalMapColor() {
    return this._inputs[3];
  }
  /**
   * Gets the uv input component
   */
  get uv() {
    return this._inputs[4];
  }
  /**
   * Gets the tint color input component
   */
  get tintColor() {
    return this._inputs[5];
  }
  /**
   * Gets the tint "at distance" input component
   */
  get tintAtDistance() {
    return this._inputs[6];
  }
  /**
   * Gets the tint thickness input component
   */
  get tintThickness() {
    return this._inputs[7];
  }
  /**
   * Gets the world tangent input component
   */
  get worldTangent() {
    return this._inputs[8];
  }
  /**
   * Gets the world normal input component
   */
  get worldNormal() {
    return this._inputs[9];
  }
  /**
   * Gets the TBN input component
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  get TBN() {
    return this._inputs[10];
  }
  /**
   * Gets the clear coat object output component
   */
  get clearcoat() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.intensity.isConnected) {
      const e = new gi("ClearCoat intensity", Ve.Fragment, de.Float);
      e.value = 1, e.output.connectTo(this.intensity);
    }
  }
  prepareDefines(e, t, r) {
    super.prepareDefines(e, t, r), r.setValue("CLEARCOAT", !0), r.setValue("CLEARCOAT_TEXTURE", !1, !0), r.setValue("CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE", !0, !0), r.setValue("CLEARCOAT_TINT", this.tintColor.isConnected || this.tintThickness.isConnected || this.tintAtDistance.isConnected, !0), r.setValue("CLEARCOAT_BUMP", this.normalMapColor.isConnected, !0), r.setValue("CLEARCOAT_DEFAULTIOR", this.indexOfRefraction.isConnected ? this.indexOfRefraction.connectInputBlock.value === h9._DefaultIndexOfRefraction : !0, !0), r.setValue("CLEARCOAT_REMAP_F0", this.remapF0OnInterfaceChange, !0);
  }
  bind(e, t, r) {
    var n, i;
    super.bind(e, t, r);
    const s = (i = (n = this.indexOfRefraction.connectInputBlock) === null || n === void 0 ? void 0 : n.value) !== null && i !== void 0 ? i : h9._DefaultIndexOfRefraction, a = 1 - s, f = 1 + s, o = Math.pow(-a / f, 2), d = 1 / s;
    e.setFloat4("vClearCoatRefractionParams", o, d, a, f);
    const v = this.clearcoat.hasEndpoints ? this.clearcoat.endpoints[0].ownerBlock : null, u = v != null && v.perturbedNormal.isConnected ? v.perturbedNormal.connectedPoint.ownerBlock : null;
    this._scene._mirroredCameraPosition ? e.setFloat2("vClearCoatTangentSpaceParams", u != null && u.invertX ? 1 : -1, u != null && u.invertY ? 1 : -1) : e.setFloat2("vClearCoatTangentSpaceParams", u != null && u.invertX ? -1 : 1, u != null && u.invertY ? -1 : 1), r && e.setFloat(this._tangentCorrectionFactorName, r.getWorldMatrix().determinant() < 0 ? -1 : 1);
  }
  _generateTBNSpace(e, t, r) {
    let n = "";
    const i = `//${this.name}`, s = this.worldTangent;
    e._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
    const a = { search: /defined\(TANGENT\)/g, replace: s.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" }, f = this.TBN;
    return f.isConnected ? e.compilationString += `
            #ifdef TBNBLOCK
            mat3 vTBN = ${f.associatedVariableName};
            #endif
            ` : s.isConnected && (n += `vec3 tbnNormal = normalize(${r}.xyz);
`, n += `vec3 tbnTangent = normalize(${s.associatedVariableName}.xyz);
`, n += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent) * ${this._tangentCorrectionFactorName};
`, n += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);
`), e._emitFunctionFromInclude("bumpFragmentMainFunctions", i, {
      replaceStrings: [a]
    }), n;
  }
  /**
   * Gets the main code of the block (fragment side)
   * @param state current state of the node material building
   * @param ccBlock instance of a ClearCoatBlock or null if the code must be generated without an active clear coat module
   * @param reflectionBlock instance of a ReflectionBlock null if the code must be generated without an active reflection module
   * @param worldPosVarName name of the variable holding the world position
   * @param generateTBNSpace if true, the code needed to create the TBN coordinate space is generated
   * @param vTBNAvailable indicate that the vTBN variable is already existing because it has already been generated by another block (PerturbNormal or Anisotropy)
   * @param worldNormalVarName name of the variable holding the world normal
   * @returns the shader code
   */
  static GetCode(e, t, r, n, i, s, a) {
    let f = "";
    const o = t != null && t.intensity.isConnected ? t.intensity.associatedVariableName : "1.", d = t != null && t.roughness.isConnected ? t.roughness.associatedVariableName : "0.", v = t != null && t.normalMapColor.isConnected ? t.normalMapColor.associatedVariableName : "vec3(0.)", u = t != null && t.uv.isConnected ? t.uv.associatedVariableName : "vec2(0.)", l = t != null && t.tintColor.isConnected ? t.tintColor.associatedVariableName : "vec3(1.)", P = t != null && t.tintThickness.isConnected ? t.tintThickness.associatedVariableName : "1.", p = t != null && t.tintAtDistance.isConnected ? t.tintAtDistance.associatedVariableName : "1.", c = "vec4(0.)";
    if (t) {
      e._emitUniformFromString("vClearCoatRefractionParams", "vec4"), e._emitUniformFromString("vClearCoatTangentSpaceParams", "vec2");
      const H = t.worldNormal;
      f += `vec3 vGeometricNormaClearCoatW = ${H.isConnected ? "normalize(" + H.associatedVariableName + ".xyz)" : "geometricNormalW"};
`;
    } else
      f += `vec3 vGeometricNormaClearCoatW = geometricNormalW;
`;
    return i && t && (f += t._generateTBNSpace(e, n, a), s = t.worldTangent.isConnected), f += `clearcoatOutParams clearcoatOut;

        #ifdef CLEARCOAT
            vec2 vClearCoatParams = vec2(${o}, ${d});
            vec4 vClearCoatTintParams = vec4(${l}, ${P});

            clearcoatBlock(
                ${n}.xyz,
                vGeometricNormaClearCoatW,
                viewDirectionW,
                vClearCoatParams,
                specularEnvironmentR0,
            #ifdef CLEARCOAT_TEXTURE
                vec2(0.),
            #endif
            #ifdef CLEARCOAT_TINT
                vClearCoatTintParams,
                ${p},
                vClearCoatRefractionParams,
                #ifdef CLEARCOAT_TINT_TEXTURE
                    ${c},
                #endif
            #endif
            #ifdef CLEARCOAT_BUMP
                vec2(0., 1.),
                vec4(${v}, 0.),
                ${u},
                #if defined(${s ? "TANGENT" : "IGNORE"}) && defined(NORMAL)
                    vTBN,
                #else
                    vClearCoatTangentSpaceParams,
                #endif
                #ifdef OBJECTSPACE_NORMALMAP
                    normalMatrix,
                #endif
            #endif
            #if defined(FORCENORMALFORWARD) && defined(NORMAL)
                faceNormal,
            #endif
            #ifdef REFLECTION
                ${r == null ? void 0 : r._vReflectionMicrosurfaceInfosName},
                ${r == null ? void 0 : r._vReflectionInfosName},
                ${r == null ? void 0 : r.reflectionColor},
                vLightingIntensity,
                #ifdef ${r == null ? void 0 : r._define3DName}
                    ${r == null ? void 0 : r._cubeSamplerName},
                #else
                    ${r == null ? void 0 : r._2DSamplerName},
                #endif
                #ifndef LODBASEDMICROSFURACE
                    #ifdef ${r == null ? void 0 : r._define3DName}
                        ${r == null ? void 0 : r._cubeSamplerName},
                        ${r == null ? void 0 : r._cubeSamplerName},
                    #else
                        ${r == null ? void 0 : r._2DSamplerName},
                        ${r == null ? void 0 : r._2DSamplerName},
                    #endif
                #endif
            #endif
            #if defined(ENVIRONMENTBRDF) && !defined(${r == null ? void 0 : r._defineSkyboxName})
                #ifdef RADIANCEOCCLUSION
                    ambientMonochrome,
                #endif
            #endif
            #if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
                (gl_FrontFacing ? 1. : -1.),
            #endif
                clearcoatOut
            );
        #else
            clearcoatOut.specularEnvironmentR0 = specularEnvironmentR0;
        #endif
`, f;
  }
  _buildBlock(e) {
    return this._scene = e.sharedData.scene, e.target === Ve.Fragment && (e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this), this._tangentCorrectionFactorName = e._getFreeDefineName("tangentCorrectionFactor"), e._emitUniformFromString(this._tangentCorrectionFactorName, "float")), this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.remapF0OnInterfaceChange = ${this.remapF0OnInterfaceChange};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return e.remapF0OnInterfaceChange = this.remapF0OnInterfaceChange, e;
  }
  _deserialize(e, t, r) {
    var n;
    super._deserialize(e, t, r), this.remapF0OnInterfaceChange = (n = e.remapF0OnInterfaceChange) !== null && n !== void 0 ? n : !0;
  }
}
C([
  rn("Remap F0 on interface change", Gr.Boolean, "ADVANCED")
], Xm.prototype, "remapF0OnInterfaceChange", void 0);
Ue("BABYLON.ClearCoatBlock", Xm);
class eR extends Mr {
  /**
   * Create a new IridescenceBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this._isUnique = !0, this.registerInput("intensity", de.Float, !0, Ve.Fragment), this.registerInput("indexOfRefraction", de.Float, !0, Ve.Fragment), this.registerInput("thickness", de.Float, !0, Ve.Fragment), this.registerOutput("iridescence", de.Object, Ve.Fragment, new Ko("iridescence", this, ao.Output, eR, "IridescenceBlock"));
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("iridescenceOut"), e._excludeVariableName("vIridescenceParams");
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "IridescenceBlock";
  }
  /**
   * Gets the intensity input component
   */
  get intensity() {
    return this._inputs[0];
  }
  /**
   * Gets the indexOfRefraction input component
   */
  get indexOfRefraction() {
    return this._inputs[1];
  }
  /**
   * Gets the thickness input component
   */
  get thickness() {
    return this._inputs[2];
  }
  /**
   * Gets the iridescence object output component
   */
  get iridescence() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.intensity.isConnected) {
      const e = new gi("Iridescence intensity", Ve.Fragment, de.Float);
      e.value = 1, e.output.connectTo(this.intensity);
      const t = new gi("Iridescence ior", Ve.Fragment, de.Float);
      t.value = 1.3, t.output.connectTo(this.indexOfRefraction);
      const r = new gi("Iridescence thickness", Ve.Fragment, de.Float);
      r.value = 400, r.output.connectTo(this.thickness);
    }
  }
  prepareDefines(e, t, r) {
    super.prepareDefines(e, t, r), r.setValue("IRIDESCENCE", !0, !0), r.setValue("IRIDESCENCE_TEXTURE", !1, !0), r.setValue("IRIDESCENCE_THICKNESS_TEXTURE", !1, !0);
  }
  /**
   * Gets the main code of the block (fragment side)
   * @param iridescenceBlock instance of a IridescenceBlock or null if the code must be generated without an active iridescence module
   * @returns the shader code
   */
  static GetCode(e) {
    let t = "";
    const r = e != null && e.intensity.isConnected ? e.intensity.associatedVariableName : "1.", n = e != null && e.indexOfRefraction.isConnected ? e.indexOfRefraction.associatedVariableName : dd._DefaultIndexOfRefraction, i = e != null && e.thickness.isConnected ? e.thickness.associatedVariableName : dd._DefaultMaximumThickness;
    return t += `iridescenceOutParams iridescenceOut;

        #ifdef IRIDESCENCE
            iridescenceBlock(
                vec4(${r}, ${n}, 1., ${i}),
                NdotV,
                specularEnvironmentR0,
                #ifdef CLEARCOAT
                    NdotVUnclamped,
                #endif
                iridescenceOut
            );

            float iridescenceIntensity = iridescenceOut.iridescenceIntensity;
            specularEnvironmentR0 = iridescenceOut.specularEnvironmentR0;
        #endif
`, t;
  }
  _buildBlock(e) {
    return e.target === Ve.Fragment && (e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this)), this;
  }
  serialize() {
    return super.serialize();
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r);
  }
}
Ue("BABYLON.IridescenceBlock", eR);
class wD extends Mr {
  /**
   * Create a new RefractionBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this.linkRefractionWithTransparency = !1, this.invertRefractionY = !1, this.useThicknessAsDepth = !1, this._isUnique = !0, this.registerInput("intensity", de.Float, !1, Ve.Fragment), this.registerInput("tintAtDistance", de.Float, !0, Ve.Fragment), this.registerInput("volumeIndexOfRefraction", de.Float, !0, Ve.Fragment), this.registerOutput("refraction", de.Object, Ve.Fragment, new Ko("refraction", this, ao.Output, wD, "RefractionBlock"));
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("vRefractionPosition"), e._excludeVariableName("vRefractionSize");
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "RefractionBlock";
  }
  /**
   * Gets the intensity input component
   */
  get intensity() {
    return this._inputs[0];
  }
  /**
   * Gets the tint at distance input component
   */
  get tintAtDistance() {
    return this._inputs[1];
  }
  /**
   * Gets the volume index of refraction input component
   */
  get volumeIndexOfRefraction() {
    return this._inputs[2];
  }
  /**
   * Gets the view input component
   */
  get view() {
    return this.viewConnectionPoint;
  }
  /**
   * Gets the refraction object output component
   */
  get refraction() {
    return this._outputs[0];
  }
  /**
   * Returns true if the block has a texture
   */
  get hasTexture() {
    return !!this._getTexture();
  }
  _getTexture() {
    return this.texture ? this.texture : this._scene.environmentTexture;
  }
  autoConfigure(e, t = () => !0) {
    if (!this.intensity.isConnected) {
      const r = new gi("Refraction intensity", Ve.Fragment, de.Float);
      r.value = 1, r.output.connectTo(this.intensity);
    }
    if (this.view && !this.view.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.View && t(n));
      r || (r = new gi("view"), r.setAsSystemValue(Bi.View)), r.output.connectTo(this.view);
    }
  }
  prepareDefines(e, t, r) {
    super.prepareDefines(e, t, r);
    const n = this._getTexture(), i = n && n.getTextureMatrix;
    r.setValue("SS_REFRACTION", i, !0), i && (r.setValue(this._define3DName, n.isCube, !0), r.setValue(this._defineLODRefractionAlpha, n.lodLevelInAlpha, !0), r.setValue(this._defineLinearSpecularRefraction, n.linearSpecularLOD, !0), r.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem && n.isCube ? !n.invertZ : n.invertZ, !0), r.setValue("SS_LINKREFRACTIONTOTRANSPARENCY", this.linkRefractionWithTransparency, !0), r.setValue("SS_GAMMAREFRACTION", n.gammaSpace, !0), r.setValue("SS_RGBDREFRACTION", n.isRGBD, !0), r.setValue("SS_USE_LOCAL_REFRACTIONMAP_CUBIC", !!n.boundingBoxSize, !0), r.setValue("SS_USE_THICKNESS_AS_DEPTH", this.useThicknessAsDepth, !0));
  }
  isReady() {
    const e = this._getTexture();
    return !(e && !e.isReadyOrNotBlocking());
  }
  bind(e, t, r) {
    var n, i, s, a;
    super.bind(e, t, r);
    const f = this._getTexture();
    if (!f)
      return;
    f.isCube ? e.setTexture(this._cubeSamplerName, f) : e.setTexture(this._2DSamplerName, f), e.setMatrix(this._refractionMatrixName, f.getRefractionTextureMatrix());
    let o = 1;
    f.isCube || f.depth && (o = f.depth);
    const d = (a = (i = (n = this.volumeIndexOfRefraction.connectInputBlock) === null || n === void 0 ? void 0 : n.value) !== null && i !== void 0 ? i : (s = this.indexOfRefractionConnectionPoint.connectInputBlock) === null || s === void 0 ? void 0 : s.value) !== null && a !== void 0 ? a : 1.5;
    e.setFloat4(this._vRefractionInfosName, f.level, 1 / d, o, this.invertRefractionY ? -1 : 1), e.setFloat4(this._vRefractionMicrosurfaceInfosName, f.getSize().width, f.lodGenerationScale, f.lodGenerationOffset, 1 / d);
    const v = f.getSize().width;
    if (e.setFloat2(this._vRefractionFilteringInfoName, v, Xt.Log2(v)), f.boundingBoxSize) {
      const u = f;
      e.setVector3("vRefractionPosition", u.boundingBoxPosition), e.setVector3("vRefractionSize", u.boundingBoxSize);
    }
  }
  /**
   * Gets the main code of the block (fragment side)
   * @param state current state of the node material building
   * @returns the shader code
   */
  getCode(e) {
    const t = "";
    return e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), this._cubeSamplerName = e._getFreeVariableName(this.name + "CubeSampler"), e.samplers.push(this._cubeSamplerName), this._2DSamplerName = e._getFreeVariableName(this.name + "2DSampler"), e.samplers.push(this._2DSamplerName), this._define3DName = e._getFreeDefineName("SS_REFRACTIONMAP_3D"), e._samplerDeclaration += `#ifdef ${this._define3DName}
`, e._samplerDeclaration += `uniform samplerCube ${this._cubeSamplerName};
`, e._samplerDeclaration += `#else
`, e._samplerDeclaration += `uniform sampler2D ${this._2DSamplerName};
`, e._samplerDeclaration += `#endif
`, e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), this._defineLODRefractionAlpha = e._getFreeDefineName("SS_LODINREFRACTIONALPHA"), this._defineLinearSpecularRefraction = e._getFreeDefineName("SS_LINEARSPECULARREFRACTION"), this._defineOppositeZ = e._getFreeDefineName("SS_REFRACTIONMAP_OPPOSITEZ"), this._refractionMatrixName = e._getFreeVariableName("refractionMatrix"), e._emitUniformFromString(this._refractionMatrixName, "mat4"), e._emitFunction("sampleRefraction", `
            #ifdef ${this._define3DName}
                #define sampleRefraction(s, c) textureCube(s, c)
            #else
                #define sampleRefraction(s, c) texture2D(s, c)
            #endif
`, `//${this.name}`), e._emitFunction("sampleRefractionLod", `
            #ifdef ${this._define3DName}
                #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)
            #else
                #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)
            #endif
`, `//${this.name}`), this._vRefractionMicrosurfaceInfosName = e._getFreeVariableName("vRefractionMicrosurfaceInfos"), e._emitUniformFromString(this._vRefractionMicrosurfaceInfosName, "vec4"), this._vRefractionInfosName = e._getFreeVariableName("vRefractionInfos"), e._emitUniformFromString(this._vRefractionInfosName, "vec4"), this._vRefractionFilteringInfoName = e._getFreeVariableName("vRefractionFilteringInfo"), e._emitUniformFromString(this._vRefractionFilteringInfoName, "vec2"), e._emitUniformFromString("vRefractionPosition", "vec3"), e._emitUniformFromString("vRefractionSize", "vec3"), t;
  }
  _buildBlock(e) {
    return this._scene = e.sharedData.scene, this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return this.texture && (this.texture.isCube ? e = `${this._codeVariableName}.texture = new BABYLON.CubeTexture("${this.texture.name}");
` : e = `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}");
`, e += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};
`), e += `${this._codeVariableName}.linkRefractionWithTransparency = ${this.linkRefractionWithTransparency};
`, e += `${this._codeVariableName}.invertRefractionY = ${this.invertRefractionY};
`, e += `${this._codeVariableName}.useThicknessAsDepth = ${this.useThicknessAsDepth};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return this.texture && !this.texture.isRenderTarget && (e.texture = this.texture.serialize()), e.linkRefractionWithTransparency = this.linkRefractionWithTransparency, e.invertRefractionY = this.invertRefractionY, e.useThicknessAsDepth = this.useThicknessAsDepth, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), e.texture && (r = e.texture.url.indexOf("data:") === 0 ? "" : r, e.texture.isCube ? this.texture = v1.Parse(e.texture, t, r) : this.texture = We.Parse(e.texture, t, r)), this.linkRefractionWithTransparency = e.linkRefractionWithTransparency, this.invertRefractionY = e.invertRefractionY, this.useThicknessAsDepth = !!e.useThicknessAsDepth;
  }
}
C([
  rn("Link refraction to transparency", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], wD.prototype, "linkRefractionWithTransparency", void 0);
C([
  rn("Invert refraction Y", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], wD.prototype, "invertRefractionY", void 0);
C([
  rn("Use thickness as depth", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], wD.prototype, "useThicknessAsDepth", void 0);
Ue("BABYLON.RefractionBlock", wD);
class CS extends Mr {
  /**
   * Create a new SubSurfaceBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Fragment), this._isUnique = !0, this.registerInput("thickness", de.Float, !1, Ve.Fragment), this.registerInput("tintColor", de.Color3, !0, Ve.Fragment), this.registerInput("translucencyIntensity", de.Float, !0, Ve.Fragment), this.registerInput("translucencyDiffusionDist", de.Color3, !0, Ve.Fragment), this.registerInput("refraction", de.Object, !0, Ve.Fragment, new Ko("refraction", this, ao.Input, wD, "RefractionBlock")), this.registerInput("dispersion", de.Float, !0, Ve.Fragment), this.registerOutput("subsurface", de.Object, Ve.Fragment, new Ko("subsurface", this, ao.Output, CS, "SubSurfaceBlock"));
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("subSurfaceOut"), e._excludeVariableName("vThicknessParam"), e._excludeVariableName("vTintColor"), e._excludeVariableName("vSubSurfaceIntensity"), e._excludeVariableName("dispersion");
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SubSurfaceBlock";
  }
  /**
   * Gets the thickness component
   */
  get thickness() {
    return this._inputs[0];
  }
  /**
   * Gets the tint color input component
   */
  get tintColor() {
    return this._inputs[1];
  }
  /**
   * Gets the translucency intensity input component
   */
  get translucencyIntensity() {
    return this._inputs[2];
  }
  /**
   * Gets the translucency diffusion distance input component
   */
  get translucencyDiffusionDist() {
    return this._inputs[3];
  }
  /**
   * Gets the refraction object parameters
   */
  get refraction() {
    return this._inputs[4];
  }
  /**
   * Gets the dispersion input component
   */
  get dispersion() {
    return this._inputs[5];
  }
  /**
   * Gets the sub surface object output component
   */
  get subsurface() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.thickness.isConnected) {
      const e = new gi("SubSurface thickness", Ve.Fragment, de.Float);
      e.value = 0, e.output.connectTo(this.thickness);
    }
  }
  prepareDefines(e, t, r) {
    super.prepareDefines(e, t, r);
    const n = this.translucencyDiffusionDist.isConnected || this.translucencyIntensity.isConnected;
    r.setValue("SUBSURFACE", n || this.refraction.isConnected, !0), r.setValue("SS_TRANSLUCENCY", n, !0), r.setValue("SS_THICKNESSANDMASK_TEXTURE", !1, !0), r.setValue("SS_REFRACTIONINTENSITY_TEXTURE", !1, !0), r.setValue("SS_TRANSLUCENCYINTENSITY_TEXTURE", !1, !0), r.setValue("SS_MASK_FROM_THICKNESS_TEXTURE", !1, !0), r.setValue("SS_USE_GLTF_TEXTURES", !1, !0), r.setValue("SS_DISPERSION", this.dispersion.isConnected, !0);
  }
  /**
   * Gets the main code of the block (fragment side)
   * @param state current state of the node material building
   * @param ssBlock instance of a SubSurfaceBlock or null if the code must be generated without an active sub surface module
   * @param reflectionBlock instance of a ReflectionBlock null if the code must be generated without an active reflection module
   * @param worldPosVarName name of the variable holding the world position
   * @returns the shader code
   */
  static GetCode(e, t, r, n) {
    var i, s, a, f, o, d, v, u, l, P, p, c, H, T, q, b;
    let j = "";
    const w = t != null && t.thickness.isConnected ? t.thickness.associatedVariableName : "0.", m = t != null && t.tintColor.isConnected ? t.tintColor.associatedVariableName : "vec3(1.)", I = t != null && t.translucencyIntensity.isConnected ? t == null ? void 0 : t.translucencyIntensity.associatedVariableName : "1.", N = t != null && t.translucencyDiffusionDist.isConnected ? t == null ? void 0 : t.translucencyDiffusionDist.associatedVariableName : "vec3(1.)", k = t != null && t.refraction.isConnected ? (i = t == null ? void 0 : t.refraction.connectedPoint) === null || i === void 0 ? void 0 : i.ownerBlock : null, R = k != null && k.tintAtDistance.isConnected ? k.tintAtDistance.associatedVariableName : "1.", y = k != null && k.intensity.isConnected ? k.intensity.associatedVariableName : "1.", O = k != null && k.view.isConnected ? k.view.associatedVariableName : "", Y = t != null && t.dispersion.isConnected ? t == null ? void 0 : t.dispersion.associatedVariableName : "0.0";
    return j += (s = k == null ? void 0 : k.getCode(e)) !== null && s !== void 0 ? s : "", j += `subSurfaceOutParams subSurfaceOut;

        #ifdef SUBSURFACE
            vec2 vThicknessParam = vec2(0., ${w});
            vec4 vTintColor = vec4(${m}, ${R});
            vec3 vSubSurfaceIntensity = vec3(${y}, ${I}, 0.);
            float dispersion = ${Y};
            subSurfaceBlock(
                vSubSurfaceIntensity,
                vThicknessParam,
                vTintColor,
                normalW,
                specularEnvironmentReflectance,
            #ifdef SS_THICKNESSANDMASK_TEXTURE
                vec4(0.),
            #endif
            #ifdef REFLECTION
                #ifdef SS_TRANSLUCENCY
                    ${r == null ? void 0 : r._reflectionMatrixName},
                    #ifdef USESPHERICALFROMREFLECTIONMAP
                        #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
                            reflectionOut.irradianceVector,
                        #endif
                        #if defined(REALTIME_FILTERING)
                            ${r == null ? void 0 : r._cubeSamplerName},
                            ${r == null ? void 0 : r._vReflectionFilteringInfoName},
                        #endif
                        #endif
                    #ifdef USEIRRADIANCEMAP
                        irradianceSampler,
                    #endif
                #endif
            #endif
            #if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
                surfaceAlbedo,
            #endif
            #ifdef SS_REFRACTION
                ${n}.xyz,
                viewDirectionW,
                ${O},
                ${(a = k == null ? void 0 : k._vRefractionInfosName) !== null && a !== void 0 ? a : ""},
                ${(f = k == null ? void 0 : k._refractionMatrixName) !== null && f !== void 0 ? f : ""},
                ${(o = k == null ? void 0 : k._vRefractionMicrosurfaceInfosName) !== null && o !== void 0 ? o : ""},
                vLightingIntensity,
                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY
                    alpha,
                #endif
                #ifdef ${(d = k == null ? void 0 : k._defineLODRefractionAlpha) !== null && d !== void 0 ? d : "IGNORE"}
                    NdotVUnclamped,
                #endif
                #ifdef ${(v = k == null ? void 0 : k._defineLinearSpecularRefraction) !== null && v !== void 0 ? v : "IGNORE"}
                    roughness,
                #endif
                alphaG,
                #ifdef ${(u = k == null ? void 0 : k._define3DName) !== null && u !== void 0 ? u : "IGNORE"}
                    ${(l = k == null ? void 0 : k._cubeSamplerName) !== null && l !== void 0 ? l : ""},
                #else
                    ${(P = k == null ? void 0 : k._2DSamplerName) !== null && P !== void 0 ? P : ""},
                #endif
                #ifndef LODBASEDMICROSFURACE
                    #ifdef ${(p = k == null ? void 0 : k._define3DName) !== null && p !== void 0 ? p : "IGNORE"}
                        ${(c = k == null ? void 0 : k._cubeSamplerName) !== null && c !== void 0 ? c : ""},
                        ${(H = k == null ? void 0 : k._cubeSamplerName) !== null && H !== void 0 ? H : ""},
                    #else
                        ${(T = k == null ? void 0 : k._2DSamplerName) !== null && T !== void 0 ? T : ""},
                        ${(q = k == null ? void 0 : k._2DSamplerName) !== null && q !== void 0 ? q : ""},
                    #endif
                #endif
                #ifdef ANISOTROPIC
                    anisotropicOut,
                #endif
                #ifdef REALTIME_FILTERING
                    ${(b = k == null ? void 0 : k._vRefractionFilteringInfoName) !== null && b !== void 0 ? b : ""},
                #endif
                #ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
                    vRefractionPosition,
                    vRefractionSize,
                #endif
                #ifdef SS_DISPERSION
                    dispersion,
                #endif
            #endif
            #ifdef SS_TRANSLUCENCY
                ${N},
            #endif
                subSurfaceOut
            );

            #ifdef SS_REFRACTION
                surfaceAlbedo = subSurfaceOut.surfaceAlbedo;
                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY
                    alpha = subSurfaceOut.alpha;
                #endif
            #endif
        #else
            subSurfaceOut.specularEnvironmentReflectance = specularEnvironmentReflectance;
        #endif
`, j;
  }
  _buildBlock(e) {
    return e.target === Ve.Fragment && e.sharedData.blocksWithDefines.push(this), this;
  }
}
Ue("BABYLON.SubSurfaceBlock", CS);
const Zpe = {
  ambientClr: ["finalAmbient", ""],
  diffuseDir: ["finalDiffuse", ""],
  specularDir: ["finalSpecularScaled", "!defined(UNLIT) && defined(SPECULARTERM)"],
  clearcoatDir: ["finalClearCoatScaled", "!defined(UNLIT) && defined(CLEARCOAT)"],
  sheenDir: ["finalSheenScaled", "!defined(UNLIT) && defined(SHEEN)"],
  diffuseInd: ["finalIrradiance", "!defined(UNLIT) && defined(REFLECTION)"],
  specularInd: ["finalRadianceScaled", "!defined(UNLIT) && defined(REFLECTION)"],
  clearcoatInd: ["clearcoatOut.finalClearCoatRadianceScaled", "!defined(UNLIT) && defined(REFLECTION) && defined(CLEARCOAT)"],
  sheenInd: ["sheenOut.finalSheenRadianceScaled", "!defined(UNLIT) && defined(REFLECTION) && defined(SHEEN) && defined(ENVIRONMENTBRDF)"],
  refraction: ["subSurfaceOut.finalRefraction", "!defined(UNLIT) && defined(SS_REFRACTION)"],
  lighting: ["finalColor.rgb", ""],
  shadow: ["aggShadow", ""],
  alpha: ["alpha", ""]
};
class g9 extends Mr {
  static _OnGenerateOnlyFragmentCodeChanged(e, t) {
    const r = e;
    return r.worldPosition.isConnected ? (r.generateOnlyFragmentCode = !r.generateOnlyFragmentCode, console.error("The worldPosition input must not be connected to be able to switch!"), !1) : (r._setTarget(), !0);
  }
  _setTarget() {
    this._setInitialTarget(this.generateOnlyFragmentCode ? Ve.Fragment : Ve.VertexAndFragment), this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? Ve.Fragment : Ve.Vertex;
  }
  /**
   * Create a new ReflectionBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.VertexAndFragment), this._environmentBRDFTexture = null, this._metallicReflectanceColor = Ne.White(), this._metallicF0Factor = 1, this.directIntensity = 1, this.environmentIntensity = 1, this.specularIntensity = 1, this.lightFalloff = 0, this.useAlphaTest = !1, this.alphaTestCutoff = 0.5, this.useAlphaBlending = !1, this.useRadianceOverAlpha = !0, this.useSpecularOverAlpha = !0, this.enableSpecularAntiAliasing = !1, this.realTimeFiltering = !1, this.realTimeFilteringQuality = 8, this.useEnergyConservation = !0, this.useRadianceOcclusion = !0, this.useHorizonOcclusion = !0, this.unlit = !1, this.forceNormalForward = !1, this.generateOnlyFragmentCode = !1, this.debugMode = 0, this.debugLimit = 0, this.debugFactor = 1, this._isUnique = !0, this.registerInput("worldPosition", de.Vector4, !1, Ve.Vertex), this.registerInput("worldNormal", de.Vector4, !1, Ve.Fragment), this.registerInput("view", de.Matrix, !1), this.registerInput("cameraPosition", de.Vector3, !1, Ve.Fragment), this.registerInput("perturbedNormal", de.Vector4, !0, Ve.Fragment), this.registerInput("baseColor", de.Color3, !0, Ve.Fragment), this.registerInput("metallic", de.Float, !1, Ve.Fragment), this.registerInput("roughness", de.Float, !1, Ve.Fragment), this.registerInput("ambientOcc", de.Float, !0, Ve.Fragment), this.registerInput("opacity", de.Float, !0, Ve.Fragment), this.registerInput("indexOfRefraction", de.Float, !0, Ve.Fragment), this.registerInput("ambientColor", de.Color3, !0, Ve.Fragment), this.registerInput("reflection", de.Object, !0, Ve.Fragment, new Ko("reflection", this, ao.Input, Cm, "ReflectionBlock")), this.registerInput("clearcoat", de.Object, !0, Ve.Fragment, new Ko("clearcoat", this, ao.Input, Xm, "ClearCoatBlock")), this.registerInput("sheen", de.Object, !0, Ve.Fragment, new Ko("sheen", this, ao.Input, Vm, "SheenBlock")), this.registerInput("subsurface", de.Object, !0, Ve.Fragment, new Ko("subsurface", this, ao.Input, CS, "SubSurfaceBlock")), this.registerInput("anisotropy", de.Object, !0, Ve.Fragment, new Ko("anisotropy", this, ao.Input, fV, "AnisotropyBlock")), this.registerInput("iridescence", de.Object, !0, Ve.Fragment, new Ko("iridescence", this, ao.Input, eR, "IridescenceBlock")), this.registerOutput("ambientClr", de.Color3, Ve.Fragment), this.registerOutput("diffuseDir", de.Color3, Ve.Fragment), this.registerOutput("specularDir", de.Color3, Ve.Fragment), this.registerOutput("clearcoatDir", de.Color3, Ve.Fragment), this.registerOutput("sheenDir", de.Color3, Ve.Fragment), this.registerOutput("diffuseInd", de.Color3, Ve.Fragment), this.registerOutput("specularInd", de.Color3, Ve.Fragment), this.registerOutput("clearcoatInd", de.Color3, Ve.Fragment), this.registerOutput("sheenInd", de.Color3, Ve.Fragment), this.registerOutput("refraction", de.Color3, Ve.Fragment), this.registerOutput("lighting", de.Color3, Ve.Fragment), this.registerOutput("shadow", de.Float, Ve.Fragment), this.registerOutput("alpha", de.Float, Ve.Fragment);
  }
  /**
   * Initialize the block and prepare the context for build
   * @param state defines the state that will be used for the build
   */
  initialize(e) {
    e._excludeVariableName("vLightingIntensity"), e._excludeVariableName("geometricNormalW"), e._excludeVariableName("normalW"), e._excludeVariableName("faceNormal"), e._excludeVariableName("albedoOpacityOut"), e._excludeVariableName("surfaceAlbedo"), e._excludeVariableName("alpha"), e._excludeVariableName("aoOut"), e._excludeVariableName("baseColor"), e._excludeVariableName("reflectivityOut"), e._excludeVariableName("microSurface"), e._excludeVariableName("roughness"), e._excludeVariableName("NdotVUnclamped"), e._excludeVariableName("NdotV"), e._excludeVariableName("alphaG"), e._excludeVariableName("AARoughnessFactors"), e._excludeVariableName("environmentBrdf"), e._excludeVariableName("ambientMonochrome"), e._excludeVariableName("seo"), e._excludeVariableName("eho"), e._excludeVariableName("environmentRadiance"), e._excludeVariableName("irradianceVector"), e._excludeVariableName("environmentIrradiance"), e._excludeVariableName("diffuseBase"), e._excludeVariableName("specularBase"), e._excludeVariableName("preInfo"), e._excludeVariableName("info"), e._excludeVariableName("shadow"), e._excludeVariableName("finalDiffuse"), e._excludeVariableName("finalAmbient"), e._excludeVariableName("ambientOcclusionForDirectDiffuse"), e._excludeVariableName("finalColor"), e._excludeVariableName("vClipSpacePosition"), e._excludeVariableName("vDebugMode");
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "PBRMetallicRoughnessBlock";
  }
  /**
   * Gets the world position input component
   */
  get worldPosition() {
    return this._inputs[0];
  }
  /**
   * Gets the world normal input component
   */
  get worldNormal() {
    return this._inputs[1];
  }
  /**
   * Gets the view matrix parameter
   */
  get view() {
    return this._inputs[2];
  }
  /**
   * Gets the camera position input component
   */
  get cameraPosition() {
    return this._inputs[3];
  }
  /**
   * Gets the perturbed normal input component
   */
  get perturbedNormal() {
    return this._inputs[4];
  }
  /**
   * Gets the base color input component
   */
  get baseColor() {
    return this._inputs[5];
  }
  /**
   * Gets the metallic input component
   */
  get metallic() {
    return this._inputs[6];
  }
  /**
   * Gets the roughness input component
   */
  get roughness() {
    return this._inputs[7];
  }
  /**
   * Gets the ambient occlusion input component
   */
  get ambientOcc() {
    return this._inputs[8];
  }
  /**
   * Gets the opacity input component
   */
  get opacity() {
    return this._inputs[9];
  }
  /**
   * Gets the index of refraction input component
   */
  get indexOfRefraction() {
    return this._inputs[10];
  }
  /**
   * Gets the ambient color input component
   */
  get ambientColor() {
    return this._inputs[11];
  }
  /**
   * Gets the reflection object parameters
   */
  get reflection() {
    return this._inputs[12];
  }
  /**
   * Gets the clear coat object parameters
   */
  get clearcoat() {
    return this._inputs[13];
  }
  /**
   * Gets the sheen object parameters
   */
  get sheen() {
    return this._inputs[14];
  }
  /**
   * Gets the sub surface object parameters
   */
  get subsurface() {
    return this._inputs[15];
  }
  /**
   * Gets the anisotropy object parameters
   */
  get anisotropy() {
    return this._inputs[16];
  }
  /**
   * Gets the iridescence object parameters
   */
  get iridescence() {
    return this._inputs[17];
  }
  /**
   * Gets the ambient output component
   */
  get ambientClr() {
    return this._outputs[0];
  }
  /**
   * Gets the diffuse output component
   */
  get diffuseDir() {
    return this._outputs[1];
  }
  /**
   * Gets the specular output component
   */
  get specularDir() {
    return this._outputs[2];
  }
  /**
   * Gets the clear coat output component
   */
  get clearcoatDir() {
    return this._outputs[3];
  }
  /**
   * Gets the sheen output component
   */
  get sheenDir() {
    return this._outputs[4];
  }
  /**
   * Gets the indirect diffuse output component
   */
  get diffuseInd() {
    return this._outputs[5];
  }
  /**
   * Gets the indirect specular output component
   */
  get specularInd() {
    return this._outputs[6];
  }
  /**
   * Gets the indirect clear coat output component
   */
  get clearcoatInd() {
    return this._outputs[7];
  }
  /**
   * Gets the indirect sheen output component
   */
  get sheenInd() {
    return this._outputs[8];
  }
  /**
   * Gets the refraction output component
   */
  get refraction() {
    return this._outputs[9];
  }
  /**
   * Gets the global lighting output component
   */
  get lighting() {
    return this._outputs[10];
  }
  /**
   * Gets the shadow output component
   */
  get shadow() {
    return this._outputs[11];
  }
  /**
   * Gets the alpha output component
   */
  get alpha() {
    return this._outputs[12];
  }
  autoConfigure(e, t = () => !0) {
    if (!this.cameraPosition.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.CameraPosition && t(n));
      r || (r = new gi("cameraPosition"), r.setAsSystemValue(Bi.CameraPosition)), r.output.connectTo(this.cameraPosition);
    }
    if (!this.view.isConnected) {
      let r = e.getInputBlockByPredicate((n) => n.systemValue === Bi.View && t(n));
      r || (r = new gi("view"), r.setAsSystemValue(Bi.View)), r.output.connectTo(this.view);
    }
  }
  prepareDefines(e, t, r) {
    r.setValue("PBR", !0), r.setValue("METALLICWORKFLOW", !0), r.setValue("DEBUGMODE", this.debugMode, !0), r.setValue("DEBUGMODE_FORCERETURN", !0), r.setValue("NORMALXYSCALE", !0), r.setValue("BUMP", this.perturbedNormal.isConnected, !0), r.setValue("LODBASEDMICROSFURACE", this._scene.getEngine().getCaps().textureLOD), r.setValue("ALBEDO", !1, !0), r.setValue("OPACITY", this.opacity.isConnected, !0), r.setValue("AMBIENT", !0, !0), r.setValue("AMBIENTINGRAYSCALE", !1, !0), r.setValue("REFLECTIVITY", !1, !0), r.setValue("AOSTOREINMETALMAPRED", !1, !0), r.setValue("METALLNESSSTOREINMETALMAPBLUE", !1, !0), r.setValue("ROUGHNESSSTOREINMETALMAPALPHA", !1, !0), r.setValue("ROUGHNESSSTOREINMETALMAPGREEN", !1, !0), this.lightFalloff === fs.LIGHTFALLOFF_STANDARD ? (r.setValue("USEPHYSICALLIGHTFALLOFF", !1), r.setValue("USEGLTFLIGHTFALLOFF", !1)) : this.lightFalloff === fs.LIGHTFALLOFF_GLTF ? (r.setValue("USEPHYSICALLIGHTFALLOFF", !1), r.setValue("USEGLTFLIGHTFALLOFF", !0)) : (r.setValue("USEPHYSICALLIGHTFALLOFF", !0), r.setValue("USEGLTFLIGHTFALLOFF", !1));
    const n = this.alphaTestCutoff.toString();
    r.setValue("ALPHABLEND", this.useAlphaBlending, !0), r.setValue("ALPHAFROMALBEDO", !1, !0), r.setValue("ALPHATEST", this.useAlphaTest, !0), r.setValue("ALPHATESTVALUE", n.indexOf(".") < 0 ? n + "." : n, !0), r.setValue("OPACITYRGB", !1, !0), r.setValue("RADIANCEOVERALPHA", this.useRadianceOverAlpha, !0), r.setValue("SPECULAROVERALPHA", this.useSpecularOverAlpha, !0), r.setValue("SPECULARAA", this._scene.getEngine().getCaps().standardDerivatives && this.enableSpecularAntiAliasing, !0), r.setValue("REALTIME_FILTERING", this.realTimeFiltering, !0);
    const i = e.getScene();
    if (i.getEngine()._features.needTypeSuffixInShaderConstants ? r.setValue("NUM_SAMPLES", this.realTimeFilteringQuality + "u", !0) : r.setValue("NUM_SAMPLES", "" + this.realTimeFilteringQuality, !0), r.setValue("BRDF_V_HEIGHT_CORRELATED", !0), r.setValue("MS_BRDF_ENERGY_CONSERVATION", this.useEnergyConservation, !0), r.setValue("RADIANCEOCCLUSION", this.useRadianceOcclusion, !0), r.setValue("HORIZONOCCLUSION", this.useHorizonOcclusion, !0), r.setValue("UNLIT", this.unlit, !0), r.setValue("FORCENORMALFORWARD", this.forceNormalForward, !0), this._environmentBRDFTexture && Dt.ReflectionTextureEnabled ? (r.setValue("ENVIRONMENTBRDF", !0), r.setValue("ENVIRONMENTBRDF_RGBD", this._environmentBRDFTexture.isRGBD, !0)) : (r.setValue("ENVIRONMENTBRDF", !1), r.setValue("ENVIRONMENTBRDF_RGBD", !1)), r._areImageProcessingDirty && t.imageProcessingConfiguration && t.imageProcessingConfiguration.prepareDefines(r), !!r._areLightsDirty)
      if (!this.light)
        Ye.PrepareDefinesForLights(i, e, r, !0, t.maxSimultaneousLights), r._needNormals = !0, Ye.PrepareDefinesForMultiview(i, r);
      else {
        const a = {
          needNormals: !1,
          needRebuild: !1,
          lightmapMode: !1,
          shadowEnabled: !1,
          specularEnabled: !1
        };
        Ye.PrepareDefinesForLight(i, e, this.light, this._lightId, r, !0, a), a.needRebuild && r.rebuild();
      }
  }
  updateUniformsAndSamples(e, t, r, n) {
    for (let i = 0; i < t.maxSimultaneousLights && r["LIGHT" + i]; i++) {
      const s = e.uniforms.indexOf("vLightData" + i) >= 0;
      Ye.PrepareUniformsAndSamplersForLight(i, e.uniforms, e.samplers, r["PROJECTEDLIGHTTEXTURE" + i], n, s);
    }
  }
  isReady(e, t, r) {
    return !(this._environmentBRDFTexture && !this._environmentBRDFTexture.isReady() || r._areImageProcessingDirty && t.imageProcessingConfiguration && !t.imageProcessingConfiguration.isReady());
  }
  bind(e, t, r) {
    var n, i;
    if (!r)
      return;
    const s = r.getScene();
    this.light ? Ye.BindLight(this.light, this._lightId, s, e, !0) : Ye.BindLights(s, r, e, !0, t.maxSimultaneousLights), e.setTexture(this._environmentBrdfSamplerName, this._environmentBRDFTexture), e.setFloat2("vDebugMode", this.debugLimit, this.debugFactor);
    const a = this._scene.ambientColor;
    a && e.setColor3("ambientFromScene", a);
    const f = s.useRightHandedSystem === (s._mirroredCameraPosition != null);
    e.setFloat(this._invertNormalName, f ? -1 : 1), e.setFloat4("vLightingIntensity", this.directIntensity, 1, this.environmentIntensity * this._scene.environmentIntensity, this.specularIntensity);
    const o = 1, d = (i = (n = this.indexOfRefraction.connectInputBlock) === null || n === void 0 ? void 0 : n.value) !== null && i !== void 0 ? i : 1.5, v = Math.pow((d - o) / (d + o), 2);
    this._metallicReflectanceColor.scaleToRef(v * this._metallicF0Factor, Hs.Color3[0]);
    const u = this._metallicF0Factor;
    e.setColor4(this._vMetallicReflectanceFactorsName, Hs.Color3[0], u), t.imageProcessingConfiguration && t.imageProcessingConfiguration.bind(e);
  }
  _injectVertexCode(e) {
    var t, r;
    const n = this.worldPosition, i = `//${this.name}`;
    this.light ? (this._lightId = (e.counters.lightCounter !== void 0 ? e.counters.lightCounter : -1) + 1, e.counters.lightCounter = this._lightId, e._emitFunctionFromInclude(e.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", i, {
      replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }]
    }, this._lightId.toString())) : (e._emitFunctionFromInclude(e.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", i, {
      repeatKey: "maxSimultaneousLights"
    }), this._lightId = 0, e.sharedData.dynamicUniformBlocks.push(this));
    const s = "v_" + n.associatedVariableName;
    e._emitVaryingFromString(s, "vec4") && (e.compilationString += `${s} = ${n.associatedVariableName};
`);
    const a = this.reflection.isConnected ? (t = this.reflection.connectedPoint) === null || t === void 0 ? void 0 : t.ownerBlock : null;
    a && (a.viewConnectionPoint = this.view), e.compilationString += (r = a == null ? void 0 : a.handleVertexSide(e)) !== null && r !== void 0 ? r : "", e._emitVaryingFromString("vClipSpacePosition", "vec4", "defined(IGNORE) || DEBUGMODE > 0") && (e._injectAtEnd += `#if DEBUGMODE > 0
`, e._injectAtEnd += `vClipSpacePosition = gl_Position;
`, e._injectAtEnd += `#endif
`), this.light ? e.compilationString += e._emitCodeFromInclude("shadowsVertex", i, {
      replaceStrings: [
        { search: /{X}/g, replace: this._lightId.toString() },
        { search: /worldPos/g, replace: n.associatedVariableName }
      ]
    }) : (e.compilationString += `vec4 worldPos = ${n.associatedVariableName};
`, this.view.isConnected && (e.compilationString += `mat4 view = ${this.view.associatedVariableName};
`), e.compilationString += e._emitCodeFromInclude("shadowsVertex", i, {
      repeatKey: "maxSimultaneousLights"
    }));
  }
  _getAlbedoOpacityCode() {
    let e = `albedoOpacityOutParams albedoOpacityOut;
`;
    const t = this.baseColor.isConnected ? this.baseColor.associatedVariableName : "vec3(1.)", r = this.opacity.isConnected ? this.opacity.associatedVariableName : "1.";
    return e += `albedoOpacityBlock(
                vec4(${t}, 1.),
            #ifdef ALBEDO
                vec4(1.),
                vec2(1., 1.),
            #endif
            #ifdef OPACITY
                vec4(${r}),
                vec2(1., 1.),
            #endif
                albedoOpacityOut
            );

            vec3 surfaceAlbedo = albedoOpacityOut.surfaceAlbedo;
            float alpha = albedoOpacityOut.alpha;
`, e;
  }
  _getAmbientOcclusionCode() {
    let e = `ambientOcclusionOutParams aoOut;
`;
    const t = this.ambientOcc.isConnected ? this.ambientOcc.associatedVariableName : "1.";
    return e += `ambientOcclusionBlock(
            #ifdef AMBIENT
                vec3(${t}),
                vec4(0., 1.0, 1.0, 0.),
            #endif
                aoOut
            );
`, e;
  }
  _getReflectivityCode(e) {
    let t = `reflectivityOutParams reflectivityOut;
`;
    const r = "1.";
    return this._vMetallicReflectanceFactorsName = e._getFreeVariableName("vMetallicReflectanceFactors"), e._emitUniformFromString(this._vMetallicReflectanceFactorsName, "vec4"), t += `vec3 baseColor = surfaceAlbedo;

            reflectivityBlock(
                vec4(${this.metallic.associatedVariableName}, ${this.roughness.associatedVariableName}, 0., 0.),
            #ifdef METALLICWORKFLOW
                surfaceAlbedo,
                ${this._vMetallicReflectanceFactorsName},
            #endif
            #ifdef REFLECTIVITY
                vec3(0., 0., ${r}),
                vec4(1.),
            #endif
            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY)  && defined(AOSTOREINMETALMAPRED)
                aoOut.ambientOcclusionColor,
            #endif
            #ifdef MICROSURFACEMAP
                microSurfaceTexel, <== not handled!
            #endif
                reflectivityOut
            );

            float microSurface = reflectivityOut.microSurface;
            float roughness = reflectivityOut.roughness;

            #ifdef METALLICWORKFLOW
                surfaceAlbedo = reflectivityOut.surfaceAlbedo;
            #endif
            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
                aoOut.ambientOcclusionColor = reflectivityOut.ambientOcclusionColor;
            #endif
`, t;
  }
  _buildBlock(e) {
    var t, r, n, i, s, a, f, o, d, v, u, l, P, p, c, H, T, q, b, j, w, m, I, N, k, R, y, O, Y, ee, Z, te, fe, _, G, L, $, ae, Pe, ge, me;
    super._buildBlock(e), this._scene = e.sharedData.scene, this._environmentBRDFTexture || (this._environmentBRDFTexture = nV(this._scene));
    const Xe = this.reflection.isConnected ? (t = this.reflection.connectedPoint) === null || t === void 0 ? void 0 : t.ownerBlock : null;
    if (Xe && (Xe.worldPositionConnectionPoint = this.worldPosition, Xe.cameraPositionConnectionPoint = this.cameraPosition, Xe.worldNormalConnectionPoint = this.worldNormal, Xe.viewConnectionPoint = this.view), e.target !== Ve.Fragment)
      return this._injectVertexCode(e), this;
    e.sharedData.forcedBindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this), e.sharedData.blockingBlocks.push(this), this.generateOnlyFragmentCode && e.sharedData.dynamicUniformBlocks.push(this);
    const De = `//${this.name}`, ne = this.perturbedNormal;
    let re = this.worldPosition.associatedVariableName;
    this.generateOnlyFragmentCode ? (re = e._getFreeVariableName("globalWorldPos"), e._emitFunction("pbr_globalworldpos", `vec3 ${re};
`, De), e.compilationString += `${re} = ${this.worldPosition.associatedVariableName}.xyz;
`, e.compilationString += e._emitCodeFromInclude("shadowsVertex", De, {
      repeatKey: "maxSimultaneousLights",
      substitutionVars: this.generateOnlyFragmentCode ? `worldPos,${this.worldPosition.associatedVariableName}` : void 0
    }), e.compilationString += `#if DEBUGMODE > 0
`, e.compilationString += `vec4 vClipSpacePosition = vec4((vec2(gl_FragCoord.xy) / vec2(1.0)) * 2.0 - 1.0, 0.0, 1.0);
`, e.compilationString += `#endif
`) : re = "v_" + re, this._environmentBrdfSamplerName = e._getFreeVariableName("environmentBrdfSampler"), e._emit2DSampler(this._environmentBrdfSamplerName), e.sharedData.hints.needAlphaBlending = e.sharedData.hints.needAlphaBlending || this.useAlphaBlending, e.sharedData.hints.needAlphaTesting = e.sharedData.hints.needAlphaTesting || this.useAlphaTest, e._emitExtension("lod", "#extension GL_EXT_shader_texture_lod : enable", "defined(LODBASEDMICROSFURACE)"), e._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable"), e._emitUniformFromString("vDebugMode", "vec2", "defined(IGNORE) || DEBUGMODE > 0"), e._emitUniformFromString("ambientFromScene", "vec3"), e.uniforms.push("exposureLinear"), e.uniforms.push("contrast"), e.uniforms.push("vInverseScreenSize"), e.uniforms.push("vignetteSettings1"), e.uniforms.push("vignetteSettings2"), e.uniforms.push("vCameraColorCurveNegative"), e.uniforms.push("vCameraColorCurveNeutral"), e.uniforms.push("vCameraColorCurvePositive"), e.uniforms.push("txColorTransform"), e.uniforms.push("colorTransformSettings"), e.uniforms.push("ditherIntensity"), this.light ? e._emitFunctionFromInclude(e.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", De, {
      replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }]
    }, this._lightId.toString()) : e._emitFunctionFromInclude(e.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", De, {
      repeatKey: "maxSimultaneousLights",
      substitutionVars: this.generateOnlyFragmentCode ? "varying," : void 0
    }), e._emitFunctionFromInclude("helperFunctions", De), e._emitFunctionFromInclude("importanceSampling", De), e._emitFunctionFromInclude("pbrHelperFunctions", De), e._emitFunctionFromInclude("imageProcessingDeclaration", De), e._emitFunctionFromInclude("imageProcessingFunctions", De), e._emitFunctionFromInclude("shadowsFragmentFunctions", De), e._emitFunctionFromInclude("pbrDirectLightingSetupFunctions", De, {
      replaceStrings: [{ search: /vPositionW/g, replace: re + ".xyz" }]
    }), e._emitFunctionFromInclude("pbrDirectLightingFalloffFunctions", De), e._emitFunctionFromInclude("pbrBRDFFunctions", De, {
      replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: (r = Xe == null ? void 0 : Xe._defineSkyboxName) !== null && r !== void 0 ? r : "REFLECTIONMAP_SKYBOX" }]
    }), e._emitFunctionFromInclude("hdrFilteringFunctions", De), e._emitFunctionFromInclude("pbrDirectLightingFunctions", De, {
      replaceStrings: [{ search: /vPositionW/g, replace: re + ".xyz" }]
    }), e._emitFunctionFromInclude("pbrIBLFunctions", De), e._emitFunctionFromInclude("pbrBlockAlbedoOpacity", De), e._emitFunctionFromInclude("pbrBlockReflectivity", De), e._emitFunctionFromInclude("pbrBlockAmbientOcclusion", De), e._emitFunctionFromInclude("pbrBlockAlphaFresnel", De), e._emitFunctionFromInclude("pbrBlockAnisotropic", De), e._emitUniformFromString("vLightingIntensity", "vec4"), Xe != null && Xe.generateOnlyFragmentCode && (e.compilationString += Xe.handleVertexSide(e)), this._vNormalWName = e._getFreeVariableName("vNormalW"), e.compilationString += `vec4 ${this._vNormalWName} = normalize(${this.worldNormal.associatedVariableName});
`, e._registerTempVariable("viewDirectionW") && (e.compilationString += `vec3 viewDirectionW = normalize(${this.cameraPosition.associatedVariableName} - ${re}.xyz);
`), e.compilationString += `vec3 geometricNormalW = ${this._vNormalWName}.xyz;
`, e.compilationString += `vec3 normalW = ${ne.isConnected ? "normalize(" + ne.associatedVariableName + ".xyz)" : "geometricNormalW"};
`, this._invertNormalName = e._getFreeVariableName("invertNormal"), e._emitUniformFromString(this._invertNormalName, "float"), e.compilationString += e._emitCodeFromInclude("pbrBlockNormalFinal", De, {
      replaceStrings: [
        { search: /vPositionW/g, replace: re + ".xyz" },
        { search: /vEyePosition.w/g, replace: this._invertNormalName }
      ]
    }), e.compilationString += this._getAlbedoOpacityCode(), e.compilationString += e._emitCodeFromInclude("depthPrePass", De), e.compilationString += this._getAmbientOcclusionCode(), e.compilationString += e._emitCodeFromInclude("pbrBlockLightmapInit", De), e.compilationString += `#ifdef UNLIT
                vec3 diffuseBase = vec3(1., 1., 1.);
            #else
`, e.compilationString += this._getReflectivityCode(e), e.compilationString += e._emitCodeFromInclude("pbrBlockGeometryInfo", De, {
      replaceStrings: [
        { search: /REFLECTIONMAP_SKYBOX/g, replace: (n = Xe == null ? void 0 : Xe._defineSkyboxName) !== null && n !== void 0 ? n : "REFLECTIONMAP_SKYBOX" },
        { search: /REFLECTIONMAP_3D/g, replace: (i = Xe == null ? void 0 : Xe._define3DName) !== null && i !== void 0 ? i : "REFLECTIONMAP_3D" }
      ]
    });
    const ve = this.anisotropy.isConnected ? (s = this.anisotropy.connectedPoint) === null || s === void 0 ? void 0 : s.ownerBlock : null;
    ve && (ve.worldPositionConnectionPoint = this.worldPosition, ve.worldNormalConnectionPoint = this.worldNormal, e.compilationString += ve.getCode(e, !this.perturbedNormal.isConnected)), Xe && Xe.hasTexture && (e.compilationString += Xe.getCode(e, ve ? "anisotropicOut.anisotropicNormal" : "normalW")), e._emitFunctionFromInclude("pbrBlockReflection", De, {
      replaceStrings: [
        { search: /computeReflectionCoords/g, replace: "computeReflectionCoordsPBR" },
        { search: /REFLECTIONMAP_3D/g, replace: (a = Xe == null ? void 0 : Xe._define3DName) !== null && a !== void 0 ? a : "REFLECTIONMAP_3D" },
        { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: (f = Xe == null ? void 0 : Xe._defineOppositeZ) !== null && f !== void 0 ? f : "REFLECTIONMAP_OPPOSITEZ" },
        { search: /REFLECTIONMAP_PROJECTION/g, replace: (o = Xe == null ? void 0 : Xe._defineProjectionName) !== null && o !== void 0 ? o : "REFLECTIONMAP_PROJECTION" },
        { search: /REFLECTIONMAP_SKYBOX/g, replace: (d = Xe == null ? void 0 : Xe._defineSkyboxName) !== null && d !== void 0 ? d : "REFLECTIONMAP_SKYBOX" },
        { search: /LODINREFLECTIONALPHA/g, replace: (v = Xe == null ? void 0 : Xe._defineLODReflectionAlpha) !== null && v !== void 0 ? v : "LODINREFLECTIONALPHA" },
        { search: /LINEARSPECULARREFLECTION/g, replace: (u = Xe == null ? void 0 : Xe._defineLinearSpecularReflection) !== null && u !== void 0 ? u : "LINEARSPECULARREFLECTION" },
        { search: /vReflectionFilteringInfo/g, replace: (l = Xe == null ? void 0 : Xe._vReflectionFilteringInfoName) !== null && l !== void 0 ? l : "vReflectionFilteringInfo" }
      ]
    }), e.compilationString += e._emitCodeFromInclude("pbrBlockReflectance0", De, {
      replaceStrings: [{ search: /metallicReflectanceFactors/g, replace: this._vMetallicReflectanceFactorsName }]
    });
    const qe = this.sheen.isConnected ? (P = this.sheen.connectedPoint) === null || P === void 0 ? void 0 : P.ownerBlock : null;
    qe && (e.compilationString += qe.getCode(Xe)), e._emitFunctionFromInclude("pbrBlockSheen", De, {
      replaceStrings: [
        { search: /REFLECTIONMAP_3D/g, replace: (p = Xe == null ? void 0 : Xe._define3DName) !== null && p !== void 0 ? p : "REFLECTIONMAP_3D" },
        { search: /REFLECTIONMAP_SKYBOX/g, replace: (c = Xe == null ? void 0 : Xe._defineSkyboxName) !== null && c !== void 0 ? c : "REFLECTIONMAP_SKYBOX" },
        { search: /LODINREFLECTIONALPHA/g, replace: (H = Xe == null ? void 0 : Xe._defineLODReflectionAlpha) !== null && H !== void 0 ? H : "LODINREFLECTIONALPHA" },
        { search: /LINEARSPECULARREFLECTION/g, replace: (T = Xe == null ? void 0 : Xe._defineLinearSpecularReflection) !== null && T !== void 0 ? T : "LINEARSPECULARREFLECTION" }
      ]
    });
    const ke = this.iridescence.isConnected ? (q = this.iridescence.connectedPoint) === null || q === void 0 ? void 0 : q.ownerBlock : null;
    e.compilationString += eR.GetCode(ke), e._emitFunctionFromInclude("pbrBlockIridescence", De, {
      replaceStrings: []
    });
    const be = this.clearcoat.isConnected ? (b = this.clearcoat.connectedPoint) === null || b === void 0 ? void 0 : b.ownerBlock : null, Fe = !this.perturbedNormal.isConnected && !this.anisotropy.isConnected, Ke = this.perturbedNormal.isConnected && ((w = ((j = this.perturbedNormal.connectedPoint) === null || j === void 0 ? void 0 : j.ownerBlock).worldTangent) === null || w === void 0 ? void 0 : w.isConnected), nt = this.anisotropy.isConnected && ((m = this.anisotropy.connectedPoint) === null || m === void 0 ? void 0 : m.ownerBlock).worldTangent.isConnected;
    let ut = Ke || !this.perturbedNormal.isConnected && nt;
    e.compilationString += Xm.GetCode(e, be, Xe, re, Fe, ut, this.worldNormal.associatedVariableName), Fe && (ut = (I = be == null ? void 0 : be.worldTangent.isConnected) !== null && I !== void 0 ? I : !1), e._emitFunctionFromInclude("pbrBlockClearcoat", De, {
      replaceStrings: [
        { search: /computeReflectionCoords/g, replace: "computeReflectionCoordsPBR" },
        { search: /REFLECTIONMAP_3D/g, replace: (N = Xe == null ? void 0 : Xe._define3DName) !== null && N !== void 0 ? N : "REFLECTIONMAP_3D" },
        { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: (k = Xe == null ? void 0 : Xe._defineOppositeZ) !== null && k !== void 0 ? k : "REFLECTIONMAP_OPPOSITEZ" },
        { search: /REFLECTIONMAP_PROJECTION/g, replace: (R = Xe == null ? void 0 : Xe._defineProjectionName) !== null && R !== void 0 ? R : "REFLECTIONMAP_PROJECTION" },
        { search: /REFLECTIONMAP_SKYBOX/g, replace: (y = Xe == null ? void 0 : Xe._defineSkyboxName) !== null && y !== void 0 ? y : "REFLECTIONMAP_SKYBOX" },
        { search: /LODINREFLECTIONALPHA/g, replace: (O = Xe == null ? void 0 : Xe._defineLODReflectionAlpha) !== null && O !== void 0 ? O : "LODINREFLECTIONALPHA" },
        { search: /LINEARSPECULARREFLECTION/g, replace: (Y = Xe == null ? void 0 : Xe._defineLinearSpecularReflection) !== null && Y !== void 0 ? Y : "LINEARSPECULARREFLECTION" },
        { search: /defined\(TANGENT\)/g, replace: ut ? "defined(TANGENT)" : "defined(IGNORE)" }
      ]
    }), e.compilationString += e._emitCodeFromInclude("pbrBlockReflectance", De, {
      replaceStrings: [
        { search: /REFLECTIONMAP_SKYBOX/g, replace: (ee = Xe == null ? void 0 : Xe._defineSkyboxName) !== null && ee !== void 0 ? ee : "REFLECTIONMAP_SKYBOX" },
        { search: /REFLECTIONMAP_3D/g, replace: (Z = Xe == null ? void 0 : Xe._define3DName) !== null && Z !== void 0 ? Z : "REFLECTIONMAP_3D" }
      ]
    });
    const bt = this.subsurface.isConnected ? (te = this.subsurface.connectedPoint) === null || te === void 0 ? void 0 : te.ownerBlock : null, wt = this.subsurface.isConnected ? (_ = ((fe = this.subsurface.connectedPoint) === null || fe === void 0 ? void 0 : fe.ownerBlock).refraction.connectedPoint) === null || _ === void 0 ? void 0 : _.ownerBlock : null;
    wt && (wt.viewConnectionPoint = this.view, wt.indexOfRefractionConnectionPoint = this.indexOfRefraction), e.compilationString += CS.GetCode(e, bt, Xe, re), e._emitFunctionFromInclude("pbrBlockSubSurface", De, {
      replaceStrings: [
        { search: /REFLECTIONMAP_3D/g, replace: (G = Xe == null ? void 0 : Xe._define3DName) !== null && G !== void 0 ? G : "REFLECTIONMAP_3D" },
        { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: (L = Xe == null ? void 0 : Xe._defineOppositeZ) !== null && L !== void 0 ? L : "REFLECTIONMAP_OPPOSITEZ" },
        { search: /REFLECTIONMAP_PROJECTION/g, replace: ($ = Xe == null ? void 0 : Xe._defineProjectionName) !== null && $ !== void 0 ? $ : "REFLECTIONMAP_PROJECTION" },
        { search: /SS_REFRACTIONMAP_3D/g, replace: (ae = wt == null ? void 0 : wt._define3DName) !== null && ae !== void 0 ? ae : "SS_REFRACTIONMAP_3D" },
        { search: /SS_LODINREFRACTIONALPHA/g, replace: (Pe = wt == null ? void 0 : wt._defineLODRefractionAlpha) !== null && Pe !== void 0 ? Pe : "SS_LODINREFRACTIONALPHA" },
        { search: /SS_LINEARSPECULARREFRACTION/g, replace: (ge = wt == null ? void 0 : wt._defineLinearSpecularRefraction) !== null && ge !== void 0 ? ge : "SS_LINEARSPECULARREFRACTION" },
        { search: /SS_REFRACTIONMAP_OPPOSITEZ/g, replace: (me = wt == null ? void 0 : wt._defineOppositeZ) !== null && me !== void 0 ? me : "SS_REFRACTIONMAP_OPPOSITEZ" }
      ]
    }), e.compilationString += e._emitCodeFromInclude("pbrBlockDirectLighting", De), this.light ? e.compilationString += e._emitCodeFromInclude("lightFragment", De, {
      replaceStrings: [
        { search: /{X}/g, replace: this._lightId.toString() },
        { search: /vPositionW/g, replace: re + ".xyz" }
      ]
    }) : e.compilationString += e._emitCodeFromInclude("lightFragment", De, {
      repeatKey: "maxSimultaneousLights",
      substitutionVars: `vPositionW,${re}.xyz`
    }), e.compilationString += e._emitCodeFromInclude("pbrBlockFinalLitComponents", De), e.compilationString += `#endif
`;
    const Tt = this.ambientColor.isConnected ? this.ambientColor.associatedVariableName : "vec3(0., 0., 0.)";
    let lr = fs.DEFAULT_AO_ON_ANALYTICAL_LIGHTS.toString();
    lr.indexOf(".") === -1 && (lr += "."), e.compilationString += e._emitCodeFromInclude("pbrBlockFinalUnlitComponents", De, {
      replaceStrings: [
        { search: /vec3 finalEmissive[\s\S]*?finalEmissive\*=vLightingIntensity\.y;/g, replace: "" },
        { search: /vAmbientColor/g, replace: Tt + " * ambientFromScene" },
        { search: /vAmbientInfos\.w/g, replace: lr }
      ]
    }), e.compilationString += e._emitCodeFromInclude("pbrBlockFinalColorComposition", De, {
      replaceStrings: [{ search: /finalEmissive/g, replace: "vec3(0.)" }]
    }), e.compilationString += e._emitCodeFromInclude("pbrBlockImageProcessing", De, {
      replaceStrings: [{ search: /visibility/g, replace: "1." }]
    }), e.compilationString += e._emitCodeFromInclude("pbrDebug", De, {
      replaceStrings: [
        { search: /vNormalW/g, replace: this._vNormalWName },
        { search: /vPositionW/g, replace: re },
        { search: /albedoTexture\.rgb;/g, replace: `vec3(1.);
gl_FragColor.rgb = toGammaSpace(gl_FragColor.rgb);
` }
      ]
    });
    for (const Qt of this._outputs)
      if (Qt.hasEndpoints) {
        const tr = Zpe[Qt.name];
        if (tr) {
          const [br, Xn] = tr;
          Xn && (e.compilationString += `#if ${Xn}
`), e.compilationString += `${this._declareOutput(Qt, e)} = ${br};
`, Xn && (e.compilationString += `#else
`, e.compilationString += `${this._declareOutput(Qt, e)} = vec3(0.);
`, e.compilationString += `#endif
`);
        } else
          console.error(`There's no remapping for the ${Qt.name} end point! No code generated`);
      }
    return this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.lightFalloff = ${this.lightFalloff};
`, e += `${this._codeVariableName}.useAlphaTest = ${this.useAlphaTest};
`, e += `${this._codeVariableName}.alphaTestCutoff = ${this.alphaTestCutoff};
`, e += `${this._codeVariableName}.useAlphaBlending = ${this.useAlphaBlending};
`, e += `${this._codeVariableName}.useRadianceOverAlpha = ${this.useRadianceOverAlpha};
`, e += `${this._codeVariableName}.useSpecularOverAlpha = ${this.useSpecularOverAlpha};
`, e += `${this._codeVariableName}.enableSpecularAntiAliasing = ${this.enableSpecularAntiAliasing};
`, e += `${this._codeVariableName}.realTimeFiltering = ${this.realTimeFiltering};
`, e += `${this._codeVariableName}.realTimeFilteringQuality = ${this.realTimeFilteringQuality};
`, e += `${this._codeVariableName}.useEnergyConservation = ${this.useEnergyConservation};
`, e += `${this._codeVariableName}.useRadianceOcclusion = ${this.useRadianceOcclusion};
`, e += `${this._codeVariableName}.useHorizonOcclusion = ${this.useHorizonOcclusion};
`, e += `${this._codeVariableName}.unlit = ${this.unlit};
`, e += `${this._codeVariableName}.forceNormalForward = ${this.forceNormalForward};
`, e += `${this._codeVariableName}.debugMode = ${this.debugMode};
`, e += `${this._codeVariableName}.debugLimit = ${this.debugLimit};
`, e += `${this._codeVariableName}.debugFactor = ${this.debugFactor};
`, e;
  }
  serialize() {
    const e = super.serialize();
    return this.light && (e.lightId = this.light.id), e.lightFalloff = this.lightFalloff, e.useAlphaTest = this.useAlphaTest, e.alphaTestCutoff = this.alphaTestCutoff, e.useAlphaBlending = this.useAlphaBlending, e.useRadianceOverAlpha = this.useRadianceOverAlpha, e.useSpecularOverAlpha = this.useSpecularOverAlpha, e.enableSpecularAntiAliasing = this.enableSpecularAntiAliasing, e.realTimeFiltering = this.realTimeFiltering, e.realTimeFilteringQuality = this.realTimeFilteringQuality, e.useEnergyConservation = this.useEnergyConservation, e.useRadianceOcclusion = this.useRadianceOcclusion, e.useHorizonOcclusion = this.useHorizonOcclusion, e.unlit = this.unlit, e.forceNormalForward = this.forceNormalForward, e.debugMode = this.debugMode, e.debugLimit = this.debugLimit, e.debugFactor = this.debugFactor, e.generateOnlyFragmentCode = this.generateOnlyFragmentCode, e;
  }
  _deserialize(e, t, r) {
    var n, i;
    super._deserialize(e, t, r), e.lightId && (this.light = t.getLightById(e.lightId)), this.lightFalloff = (n = e.lightFalloff) !== null && n !== void 0 ? n : 0, this.useAlphaTest = e.useAlphaTest, this.alphaTestCutoff = e.alphaTestCutoff, this.useAlphaBlending = e.useAlphaBlending, this.useRadianceOverAlpha = e.useRadianceOverAlpha, this.useSpecularOverAlpha = e.useSpecularOverAlpha, this.enableSpecularAntiAliasing = e.enableSpecularAntiAliasing, this.realTimeFiltering = !!e.realTimeFiltering, this.realTimeFilteringQuality = (i = e.realTimeFilteringQuality) !== null && i !== void 0 ? i : 8, this.useEnergyConservation = e.useEnergyConservation, this.useRadianceOcclusion = e.useRadianceOcclusion, this.useHorizonOcclusion = e.useHorizonOcclusion, this.unlit = e.unlit, this.forceNormalForward = !!e.forceNormalForward, this.debugMode = e.debugMode, this.debugLimit = e.debugLimit, this.debugFactor = e.debugFactor, this.generateOnlyFragmentCode = !!e.generateOnlyFragmentCode, this._setTarget();
  }
}
C([
  rn("Direct lights", Gr.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: !0 } })
], g9.prototype, "directIntensity", void 0);
C([
  rn("Environment lights", Gr.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: !0 } })
], g9.prototype, "environmentIntensity", void 0);
C([
  rn("Specular highlights", Gr.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: !0 } })
], g9.prototype, "specularIntensity", void 0);
C([
  rn("Light falloff", Gr.List, "LIGHTING & COLORS", {
    notifiers: { update: !0 },
    options: [
      { label: "Physical", value: fs.LIGHTFALLOFF_PHYSICAL },
      { label: "GLTF", value: fs.LIGHTFALLOFF_GLTF },
      { label: "Standard", value: fs.LIGHTFALLOFF_STANDARD }
    ]
  })
], g9.prototype, "lightFalloff", void 0);
C([
  rn("Alpha Testing", Gr.Boolean, "OPACITY")
], g9.prototype, "useAlphaTest", void 0);
C([
  rn("Alpha CutOff", Gr.Float, "OPACITY", { min: 0, max: 1, notifiers: { update: !0 } })
], g9.prototype, "alphaTestCutoff", void 0);
C([
  rn("Alpha blending", Gr.Boolean, "OPACITY")
], g9.prototype, "useAlphaBlending", void 0);
C([
  rn("Radiance over alpha", Gr.Boolean, "RENDERING", { notifiers: { update: !0 } })
], g9.prototype, "useRadianceOverAlpha", void 0);
C([
  rn("Specular over alpha", Gr.Boolean, "RENDERING", { notifiers: { update: !0 } })
], g9.prototype, "useSpecularOverAlpha", void 0);
C([
  rn("Specular anti-aliasing", Gr.Boolean, "RENDERING", { notifiers: { update: !0 } })
], g9.prototype, "enableSpecularAntiAliasing", void 0);
C([
  rn("Realtime filtering", Gr.Boolean, "RENDERING", { notifiers: { update: !0 } })
], g9.prototype, "realTimeFiltering", void 0);
C([
  rn("Realtime filtering quality", Gr.List, "RENDERING", {
    notifiers: { update: !0 },
    options: [
      { label: "Low", value: 8 },
      { label: "Medium", value: 16 },
      { label: "High", value: 64 }
    ]
  })
], g9.prototype, "realTimeFilteringQuality", void 0);
C([
  rn("Energy Conservation", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], g9.prototype, "useEnergyConservation", void 0);
C([
  rn("Radiance occlusion", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], g9.prototype, "useRadianceOcclusion", void 0);
C([
  rn("Horizon occlusion", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], g9.prototype, "useHorizonOcclusion", void 0);
C([
  rn("Unlit", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], g9.prototype, "unlit", void 0);
C([
  rn("Force normal forward", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], g9.prototype, "forceNormalForward", void 0);
C([
  rn("Generate only fragment code", Gr.Boolean, "ADVANCED", {
    notifiers: { rebuild: !0, update: !0, onValidation: g9._OnGenerateOnlyFragmentCodeChanged }
  })
], g9.prototype, "generateOnlyFragmentCode", void 0);
C([
  rn("Debug mode", Gr.List, "DEBUG", {
    notifiers: { update: !0 },
    options: [
      { label: "None", value: 0 },
      // Geometry
      { label: "Normalized position", value: 1 },
      { label: "Normals", value: 2 },
      { label: "Tangents", value: 3 },
      { label: "Bitangents", value: 4 },
      { label: "Bump Normals", value: 5 },
      //{ label: "UV1", value: 6 },
      //{ label: "UV2", value: 7 },
      { label: "ClearCoat Normals", value: 8 },
      { label: "ClearCoat Tangents", value: 9 },
      { label: "ClearCoat Bitangents", value: 10 },
      { label: "Anisotropic Normals", value: 11 },
      { label: "Anisotropic Tangents", value: 12 },
      { label: "Anisotropic Bitangents", value: 13 },
      // Maps
      //{ label: "Emissive Map", value: 23 },
      //{ label: "Light Map", value: 24 },
      // Env
      { label: "Env Refraction", value: 40 },
      { label: "Env Reflection", value: 41 },
      { label: "Env Clear Coat", value: 42 },
      // Lighting
      { label: "Direct Diffuse", value: 50 },
      { label: "Direct Specular", value: 51 },
      { label: "Direct Clear Coat", value: 52 },
      { label: "Direct Sheen", value: 53 },
      { label: "Env Irradiance", value: 54 },
      // Lighting Params
      { label: "Surface Albedo", value: 60 },
      { label: "Reflectance 0", value: 61 },
      { label: "Metallic", value: 62 },
      { label: "Metallic F0", value: 71 },
      { label: "Roughness", value: 63 },
      { label: "AlphaG", value: 64 },
      { label: "NdotV", value: 65 },
      { label: "ClearCoat Color", value: 66 },
      { label: "ClearCoat Roughness", value: 67 },
      { label: "ClearCoat NdotV", value: 68 },
      { label: "Transmittance", value: 69 },
      { label: "Refraction Transmittance", value: 70 },
      // Misc
      { label: "SEO", value: 80 },
      { label: "EHO", value: 81 },
      { label: "Energy Factor", value: 82 },
      { label: "Specular Reflectance", value: 83 },
      { label: "Clear Coat Reflectance", value: 84 },
      { label: "Sheen Reflectance", value: 85 },
      { label: "Luminance Over Alpha", value: 86 },
      { label: "Alpha", value: 87 }
    ]
  })
], g9.prototype, "debugMode", void 0);
C([
  rn("Split position", Gr.Float, "DEBUG", { min: -1, max: 1, notifiers: { update: !0 } })
], g9.prototype, "debugLimit", void 0);
C([
  rn("Output factor", Gr.Float, "DEBUG", { min: 0, max: 5, notifiers: { update: !0 } })
], g9.prototype, "debugFactor", void 0);
Ue("BABYLON.PBRMetallicRoughnessBlock", g9);
class rne extends Mr {
  /**
   * Creates a new ModBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("left", de.AutoDetect), this.registerInput("right", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._inputs[1].acceptedConnectionPointTypes.push(de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ModBlock";
  }
  /**
   * Gets the left operand input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right operand input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = mod(${this.left.associatedVariableName}, ${this.right.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.ModBlock", rne);
class nne extends Mr {
  /**
   * Creates a new MatrixBuilder
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("row0", de.Vector4), this.registerInput("row1", de.Vector4), this.registerInput("row2", de.Vector4), this.registerInput("row3", de.Vector4), this.registerOutput("output", de.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MatrixBuilder";
  }
  /**
   * Gets the row0 vector
   */
  get row0() {
    return this._inputs[0];
  }
  /**
   * Gets the row1 vector
   */
  get row1() {
    return this._inputs[1];
  }
  /**
   * Gets the row2 vector
   */
  get row2() {
    return this._inputs[2];
  }
  /**
   * Gets the row3 vector
   */
  get row3() {
    return this._inputs[3];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.row0.isConnected) {
      const e = new gi("row0");
      e.value = new Ir(1, 0, 0, 0), e.output.connectTo(this.row0);
    }
    if (!this.row1.isConnected) {
      const e = new gi("row1");
      e.value = new Ir(0, 1, 0, 0), e.output.connectTo(this.row1);
    }
    if (!this.row2.isConnected) {
      const e = new gi("row2");
      e.value = new Ir(0, 0, 1, 0), e.output.connectTo(this.row2);
    }
    if (!this.row3.isConnected) {
      const e = new gi("row3");
      e.value = new Ir(0, 0, 0, 1), e.output.connectTo(this.row3);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], r = this.row0, n = this.row1, i = this.row2, s = this.row3;
    return e.compilationString += this._declareOutput(t, e) + ` = mat4(${r.associatedVariableName}, ${n.associatedVariableName}, ${i.associatedVariableName}, ${s.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.MatrixBuilder", nne);
var lc;
(function(A) {
  A[A.Equal = 0] = "Equal", A[A.NotEqual = 1] = "NotEqual", A[A.LessThan = 2] = "LessThan", A[A.GreaterThan = 3] = "GreaterThan", A[A.LessOrEqual = 4] = "LessOrEqual", A[A.GreaterOrEqual = 5] = "GreaterOrEqual", A[A.Xor = 6] = "Xor", A[A.Or = 7] = "Or", A[A.And = 8] = "And";
})(lc || (lc = {}));
class ine extends Mr {
  /**
   * Creates a new ConditionalBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.condition = lc.LessThan, this.registerInput("a", de.Float), this.registerInput("b", de.Float), this.registerInput("true", de.AutoDetect, !0), this.registerInput("false", de.AutoDetect, !0), this.registerOutput("output", de.BasedOnInput), this._linkConnectionTypes(2, 3), this._outputs[0]._typeConnectionSource = this._inputs[2], this._outputs[0]._defaultConnectionPointType = de.Float;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ConditionalBlock";
  }
  /**
   * Gets the first operand component
   */
  get a() {
    return this._inputs[0];
  }
  /**
   * Gets the second operand component
   */
  get b() {
    return this._inputs[1];
  }
  /**
   * Gets the value to return if condition is true
   */
  get true() {
    return this._inputs[2];
  }
  /**
   * Gets the value to return if condition is false
   */
  get false() {
    return this._inputs[3];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], r = this.true.isConnected ? this.true.associatedVariableName : "1.0", n = this.false.isConnected ? this.false.associatedVariableName : "0.0";
    switch (this.condition) {
      case lc.Equal: {
        e.compilationString += this._declareOutput(t, e) + ` = ${this.a.associatedVariableName} == ${this.b.associatedVariableName} ? ${r} : ${n};
`;
        break;
      }
      case lc.NotEqual: {
        e.compilationString += this._declareOutput(t, e) + ` = ${this.a.associatedVariableName} != ${this.b.associatedVariableName} ? ${r} : ${n};
`;
        break;
      }
      case lc.LessThan: {
        e.compilationString += this._declareOutput(t, e) + ` = ${this.a.associatedVariableName} < ${this.b.associatedVariableName} ? ${r} : ${n};
`;
        break;
      }
      case lc.LessOrEqual: {
        e.compilationString += this._declareOutput(t, e) + ` = ${this.a.associatedVariableName} <= ${this.b.associatedVariableName} ? ${r} : ${n};
`;
        break;
      }
      case lc.GreaterThan: {
        e.compilationString += this._declareOutput(t, e) + ` = ${this.a.associatedVariableName} > ${this.b.associatedVariableName} ? ${r} : ${n};
`;
        break;
      }
      case lc.GreaterOrEqual: {
        e.compilationString += this._declareOutput(t, e) + ` = ${this.a.associatedVariableName} >= ${this.b.associatedVariableName} ? ${r} : ${n};
`;
        break;
      }
      case lc.Xor: {
        e.compilationString += this._declareOutput(t, e) + ` = (mod(${this.a.associatedVariableName} + ${this.b.associatedVariableName}, 2.0) > 0.0) ? ${r} : ${n};
`;
        break;
      }
      case lc.Or: {
        e.compilationString += this._declareOutput(t, e) + ` = (min(${this.a.associatedVariableName} + ${this.b.associatedVariableName}, 1.0) > 0.0) ? ${r} : ${n};
`;
        break;
      }
      case lc.And: {
        e.compilationString += this._declareOutput(t, e) + ` = (${this.a.associatedVariableName} * ${this.b.associatedVariableName} > 0.0)  ? ${r} : ${n};
`;
        break;
      }
    }
    return this;
  }
  serialize() {
    const e = super.serialize();
    return e.condition = this.condition, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.condition = e.condition;
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.condition = BABYLON.ConditionalBlockConditions.${lc[this.condition]};
`;
  }
}
Ue("BABYLON.ConditionalBlock", ine);
class oY extends Mr {
  /**
   * Creates a new CloudBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.octaves = 6, this.registerInput("seed", de.AutoDetect), this.registerInput("chaos", de.AutoDetect, !0), this.registerInput("offsetX", de.Float, !0), this.registerInput("offsetY", de.Float, !0), this.registerInput("offsetZ", de.Float, !0), this.registerOutput("output", de.Float), this._inputs[0].acceptedConnectionPointTypes.push(de.Vector2), this._inputs[0].acceptedConnectionPointTypes.push(de.Vector3), this._linkConnectionTypes(0, 1);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "CloudBlock";
  }
  /**
   * Gets the seed input component
   */
  get seed() {
    return this._inputs[0];
  }
  /**
   * Gets the chaos input component
   */
  get chaos() {
    return this._inputs[1];
  }
  /**
   * Gets the offset X input component
   */
  get offsetX() {
    return this._inputs[2];
  }
  /**
   * Gets the offset Y input component
   */
  get offsetY() {
    return this._inputs[3];
  }
  /**
   * Gets the offset Z input component
   */
  get offsetZ() {
    return this._inputs[4];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    var t, r;
    if (super._buildBlock(e), !this.seed.isConnected || !this._outputs[0].hasEndpoints)
      return;
    const n = `

        float cloudRandom(in float p) { p = fract(p * 0.011); p *= p + 7.5; p *= p + p; return fract(p); }

        // Based on Morgan McGuire @morgan3d
        // https://www.shadertoy.com/view/4dS3Wd
        float cloudNoise(in vec2 x, in vec2 chaos) {
            vec2 step = chaos * vec2(75., 120.) + vec2(75., 120.);

            vec2 i = floor(x);
            vec2 f = fract(x);

            float n = dot(i, step);

            vec2 u = f * f * (3.0 - 2.0 * f);
            return mix(
                    mix(cloudRandom(n + dot(step, vec2(0, 0))), cloudRandom(n + dot(step, vec2(1, 0))), u.x),
                    mix(cloudRandom(n + dot(step, vec2(0, 1))), cloudRandom(n + dot(step, vec2(1, 1))), u.x),
                    u.y
                );
        }

        float cloudNoise(in vec3 x, in vec3 chaos) {
            vec3 step = chaos * vec3(60., 120., 75.) + vec3(60., 120., 75.);

            vec3 i = floor(x);
            vec3 f = fract(x);

            float n = dot(i, step);

            vec3 u = f * f * (3.0 - 2.0 * f);
            return mix(mix(mix( cloudRandom(n + dot(step, vec3(0, 0, 0))), cloudRandom(n + dot(step, vec3(1, 0, 0))), u.x),
                           mix( cloudRandom(n + dot(step, vec3(0, 1, 0))), cloudRandom(n + dot(step, vec3(1, 1, 0))), u.x), u.y),
                       mix(mix( cloudRandom(n + dot(step, vec3(0, 0, 1))), cloudRandom(n + dot(step, vec3(1, 0, 1))), u.x),
                           mix( cloudRandom(n + dot(step, vec3(0, 1, 1))), cloudRandom(n + dot(step, vec3(1, 1, 1))), u.x), u.y), u.z);
        }`, i = `
        float fbm(in vec2 st, in vec2 chaos) {
            // Initial values
            float value = 0.0;
            float amplitude = .5;
            float frequency = 0.;

            // Loop of octaves
            for (int i = 0; i < OCTAVES; i++) {
                value += amplitude * cloudNoise(st, chaos);
                st *= 2.0;
                amplitude *= 0.5;
            }
            return value;
        }

        float fbm(in vec3 x, in vec3 chaos) {
            // Initial values
            float value = 0.0;
            float amplitude = 0.5;
            for (int i = 0; i < OCTAVES; ++i) {
                value += amplitude * cloudNoise(x, chaos);
                x = x * 2.0;
                amplitude *= 0.5;
            }
            return value;
        }`, s = `fbm${this.octaves}`;
    e._emitFunction("CloudBlockCode", n, "// CloudBlockCode"), e._emitFunction("CloudBlockCodeFBM" + this.octaves, i.replace(/fbm/gi, s).replace(/OCTAVES/gi, (this.octaves | 0).toString()), "// CloudBlockCode FBM");
    const a = e._getFreeVariableName("st"), f = ((t = this.seed.connectedPoint) === null || t === void 0 ? void 0 : t.type) === de.Vector2 ? "vec2" : "vec3";
    e.compilationString += `${f} ${a} = ${this.seed.associatedVariableName};
`, this.offsetX.isConnected && (e.compilationString += `${a}.x += 0.1 * ${this.offsetX.associatedVariableName};
`), this.offsetY.isConnected && (e.compilationString += `${a}.y += 0.1 * ${this.offsetY.associatedVariableName};
`), this.offsetZ.isConnected && f === "vec3" && (e.compilationString += `${a}.z += 0.1 * ${this.offsetZ.associatedVariableName};
`);
    let o = "";
    return this.chaos.isConnected ? o = this.chaos.associatedVariableName : o = ((r = this.seed.connectedPoint) === null || r === void 0 ? void 0 : r.type) === de.Vector2 ? "vec2(0., 0.)" : "vec3(0., 0., 0.)", e.compilationString += this._declareOutput(this._outputs[0], e) + ` = ${s}(${a}, ${o});
`, this;
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.octaves = ${this.octaves};
`;
  }
  serialize() {
    const e = super.serialize();
    return e.octaves = this.octaves, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.octaves = e.octaves;
  }
}
C([
  rn("Octaves", Gr.Int)
], oY.prototype, "octaves", void 0);
Ue("BABYLON.CloudBlock", oY);
class sne extends Mr {
  /**
   * Creates a new VoronoiNoiseBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("seed", de.Vector2), this.registerInput("offset", de.Float), this.registerInput("density", de.Float), this.registerOutput("output", de.Float), this.registerOutput("cells", de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "VoronoiNoiseBlock";
  }
  /**
   * Gets the seed input component
   */
  get seed() {
    return this._inputs[0];
  }
  /**
   * Gets the offset input component
   */
  get offset() {
    return this._inputs[1];
  }
  /**
   * Gets the density input component
   */
  get density() {
    return this._inputs[2];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets the output component
   */
  get cells() {
    return this._outputs[1];
  }
  _buildBlock(e) {
    if (super._buildBlock(e), !this.seed.isConnected)
      return;
    let t = `vec2 voronoiRandom(vec2 seed, float offset){
            mat2 m = mat2(15.27, 47.63, 99.41, 89.98);
            vec2 uv = fract(sin(m * seed) * 46839.32);
            return vec2(sin(uv.y * offset) * 0.5 + 0.5, cos(uv.x * offset) * 0.5 + 0.5);
        }
        `;
    e._emitFunction("voronoiRandom", t, "// Voronoi random generator"), t = `void voronoi(vec2 seed, float offset, float density, out float outValue, out float cells){
            vec2 g = floor(seed * density);
            vec2 f = fract(seed * density);
            float t = 8.0;
            vec3 res = vec3(8.0, 0.0, 0.0);

            for(int y=-1; y<=1; y++)
            {
                for(int x=-1; x<=1; x++)
                {
                    vec2 lattice = vec2(x,y);
                    vec2 randomOffset = voronoiRandom(lattice + g, offset);
                    float d = distance(lattice + randomOffset, f);
                    if(d < res.x)
                    {
                        res = vec3(d, randomOffset.x, randomOffset.y);
                        outValue = res.x;
                        cells = res.y;
                    }
                }
            }
        }
        `, e._emitFunction("voronoi", t, "// Voronoi");
    const r = e._getFreeVariableName("tempOutput"), n = e._getFreeVariableName("tempCells");
    return e.compilationString += `float ${r} = 0.0;
`, e.compilationString += `float ${n} = 0.0;
`, e.compilationString += `voronoi(${this.seed.associatedVariableName}, ${this.offset.associatedVariableName}, ${this.density.associatedVariableName}, ${r}, ${n});
`, this.output.hasEndpoints && (e.compilationString += this._declareOutput(this.output, e) + ` = ${r};
`), this.cells.hasEndpoints && (e.compilationString += this._declareOutput(this.cells, e) + ` = ${n};
`), this;
  }
}
Ue("BABYLON.VoronoiNoiseBlock", sne);
class ane extends Mr {
  /**
   * Creates a new ElbowBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("input", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ElbowBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets or sets the target of the block
   */
  get target() {
    const e = this._inputs[0];
    if (e.isConnected) {
      const t = e.connectedPoint.ownerBlock;
      if (t.target !== Ve.VertexAndFragment)
        return t.target;
      if (e.connectedPoint.target !== Ve.VertexAndFragment)
        return e.connectedPoint.target;
    }
    return this._target;
  }
  set target(e) {
    this._target & e || (this._target = e);
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], r = this._inputs[0];
    return e.compilationString += this._declareOutput(t, e) + ` = ${r.associatedVariableName};
`, this;
  }
}
Ue("BABYLON.ElbowBlock", ane);
class gy extends Mr {
  /**
   * Gets or sets the texture associated with the node
   */
  get texture() {
    var e;
    return this.source.isConnected ? ((e = this.source.connectedPoint) === null || e === void 0 ? void 0 : e.ownerBlock).texture : this._texture;
  }
  set texture(e) {
    var t;
    if (this._texture === e)
      return;
    const r = (t = e == null ? void 0 : e.getScene()) !== null && t !== void 0 ? t : gr.LastCreatedScene;
    !e && r && r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(this._texture)), this._texture = e, e && r && r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(e));
  }
  /**
   * Gets the textureY associated with the node
   */
  get textureY() {
    var e;
    return this.sourceY.isConnected ? ((e = this.sourceY.connectedPoint) === null || e === void 0 ? void 0 : e.ownerBlock).texture : null;
  }
  /**
   * Gets the textureZ associated with the node
   */
  get textureZ() {
    var e, t;
    return !((e = this.sourceZ) === null || e === void 0) && e.isConnected ? ((t = this.sourceY.connectedPoint) === null || t === void 0 ? void 0 : t.ownerBlock).texture : null;
  }
  _getImageSourceBlock(e) {
    return e != null && e.isConnected ? e.connectedPoint.ownerBlock : null;
  }
  /**
   * Gets the sampler name associated with this texture
   */
  get samplerName() {
    const e = this._getImageSourceBlock(this.source);
    return e ? e.samplerName : this._samplerName;
  }
  /**
   * Gets the samplerY name associated with this texture
   */
  get samplerYName() {
    var e, t;
    return (t = (e = this._getImageSourceBlock(this.sourceY)) === null || e === void 0 ? void 0 : e.samplerName) !== null && t !== void 0 ? t : null;
  }
  /**
   * Gets the samplerZ name associated with this texture
   */
  get samplerZName() {
    var e, t;
    return (t = (e = this._getImageSourceBlock(this.sourceZ)) === null || e === void 0 ? void 0 : e.samplerName) !== null && t !== void 0 ? t : null;
  }
  /**
   * Gets a boolean indicating that this block is linked to an ImageSourceBlock
   */
  get hasImageSource() {
    return this.source.isConnected;
  }
  /**
   * Gets or sets a boolean indicating if content needs to be converted to gamma space
   */
  set convertToGammaSpace(e) {
    var t;
    if (e !== this._convertToGammaSpace && (this._convertToGammaSpace = e, this.texture)) {
      const r = (t = this.texture.getScene()) !== null && t !== void 0 ? t : gr.LastCreatedScene;
      r == null || r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(this.texture));
    }
  }
  get convertToGammaSpace() {
    return this._convertToGammaSpace;
  }
  /**
   * Gets or sets a boolean indicating if content needs to be converted to linear space
   */
  set convertToLinearSpace(e) {
    var t;
    if (e !== this._convertToLinearSpace && (this._convertToLinearSpace = e, this.texture)) {
      const r = (t = this.texture.getScene()) !== null && t !== void 0 ? t : gr.LastCreatedScene;
      r == null || r.markAllMaterialsAsDirty(1, (n) => n.hasTexture(this.texture));
    }
  }
  get convertToLinearSpace() {
    return this._convertToLinearSpace;
  }
  /**
   * Create a new TriPlanarBlock
   * @param name defines the block name
   */
  constructor(e, t = !1) {
    super(e, Ve.Neutral), this.projectAsCube = !1, this._convertToGammaSpace = !1, this._convertToLinearSpace = !1, this.disableLevelMultiplication = !1, this.registerInput("position", de.AutoDetect, !1), this.registerInput("normal", de.AutoDetect, !1), this.registerInput("sharpness", de.Float, !0), this.registerInput("source", de.Object, !0, Ve.VertexAndFragment, new Ko("source", this, ao.Input, E0, "ImageSourceBlock")), this.registerInput("sourceY", de.Object, !0, Ve.VertexAndFragment, new Ko("sourceY", this, ao.Input, E0, "ImageSourceBlock")), t || this.registerInput("sourceZ", de.Object, !0, Ve.VertexAndFragment, new Ko("sourceZ", this, ao.Input, E0, "ImageSourceBlock")), this.registerOutput("rgba", de.Color4, Ve.Neutral), this.registerOutput("rgb", de.Color3, Ve.Neutral), this.registerOutput("r", de.Float, Ve.Neutral), this.registerOutput("g", de.Float, Ve.Neutral), this.registerOutput("b", de.Float, Ve.Neutral), this.registerOutput("a", de.Float, Ve.Neutral), this.registerOutput("level", de.Float, Ve.Neutral), this._inputs[0].addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Vector3 | de.Vector4), this._inputs[1].addExcludedConnectionPointFromAllowedTypes(de.Color3 | de.Vector3 | de.Vector4);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "TriPlanarBlock";
  }
  /**
   * Gets the position input component
   */
  get position() {
    return this._inputs[0];
  }
  /**
   * Gets the normal input component
   */
  get normal() {
    return this._inputs[1];
  }
  /**
   * Gets the sharpness input component
   */
  get sharpness() {
    return this._inputs[2];
  }
  /**
   * Gets the source input component
   */
  get source() {
    return this._inputs[3];
  }
  /**
   * Gets the sourceY input component
   */
  get sourceY() {
    return this._inputs[4];
  }
  /**
   * Gets the sourceZ input component
   */
  get sourceZ() {
    return this._inputs[5];
  }
  /**
   * Gets the rgba output component
   */
  get rgba() {
    return this._outputs[0];
  }
  /**
   * Gets the rgb output component
   */
  get rgb() {
    return this._outputs[1];
  }
  /**
   * Gets the r output component
   */
  get r() {
    return this._outputs[2];
  }
  /**
   * Gets the g output component
   */
  get g() {
    return this._outputs[3];
  }
  /**
   * Gets the b output component
   */
  get b() {
    return this._outputs[4];
  }
  /**
   * Gets the a output component
   */
  get a() {
    return this._outputs[5];
  }
  /**
   * Gets the level output component
   */
  get level() {
    return this._outputs[6];
  }
  prepareDefines(e, t, r) {
    if (!r._areTexturesDirty)
      return;
    const n = this.convertToGammaSpace && this.texture && !this.texture.gammaSpace, i = this.convertToLinearSpace && this.texture && this.texture.gammaSpace;
    r.setValue(this._linearDefineName, n, !0), r.setValue(this._gammaDefineName, i, !0);
  }
  isReady() {
    return !(this.texture && !this.texture.isReadyOrNotBlocking());
  }
  bind(e) {
    this.texture && (e.setFloat(this._textureInfoName, this.texture.level), this._imageSource || e.setTexture(this._samplerName, this.texture));
  }
  _generateTextureLookup(e) {
    var t, r;
    const n = this.samplerName, i = (t = this.samplerYName) !== null && t !== void 0 ? t : n, s = (r = this.samplerZName) !== null && r !== void 0 ? r : n, a = this.sharpness.isConnected ? this.sharpness.associatedVariableName : "1.0", f = e._getFreeVariableName("x"), o = e._getFreeVariableName("y"), d = e._getFreeVariableName("z"), v = e._getFreeVariableName("w"), u = e._getFreeVariableName("n"), l = e._getFreeVariableName("uvx"), P = e._getFreeVariableName("uvy"), p = e._getFreeVariableName("uvz");
    e.compilationString += `
            vec3 ${u} = ${this.normal.associatedVariableName}.xyz;

            vec2 ${l} = ${this.position.associatedVariableName}.yz;
            vec2 ${P} = ${this.position.associatedVariableName}.zx;
            vec2 ${p} = ${this.position.associatedVariableName}.xy;
        `, this.projectAsCube && (e.compilationString += `
                ${l}.xy = ${l}.yx;

                if (${u}.x >= 0.0) {
                    ${l}.x = -${l}.x;
                }
                if (${u}.y < 0.0) {
                    ${P}.y = -${P}.y;
                }
                if (${u}.z < 0.0) {
                    ${p}.x = -${p}.x;
                }
            `), e.compilationString += `
            vec4 ${f} = texture2D(${n}, ${l});
            vec4 ${o} = texture2D(${i}, ${P});
            vec4 ${d} = texture2D(${s}, ${p});
           
            // blend weights
            vec3 ${v} = pow(abs(${u}), vec3(${a}));

            // blend and return
            vec4 ${this._tempTextureRead} = (${f}*${v}.x + ${o}*${v}.y + ${d}*${v}.z) / (${v}.x + ${v}.y + ${v}.z);        
        `;
  }
  _generateConversionCode(e, t, r) {
    r !== "a" && ((!this.texture || !this.texture.gammaSpace) && (e.compilationString += `#ifdef ${this._linearDefineName}
                    ${t.associatedVariableName} = toGammaSpace(${t.associatedVariableName});
                    #endif
                `), e.compilationString += `#ifdef ${this._gammaDefineName}
                ${t.associatedVariableName} = toLinearSpace(${t.associatedVariableName});
                #endif
            `);
  }
  _writeOutput(e, t, r) {
    let n = "";
    this.disableLevelMultiplication || (n = ` * ${this._textureInfoName}`), e.compilationString += `${this._declareOutput(t, e)} = ${this._tempTextureRead}.${r}${n};
`, this._generateConversionCode(e, t, r);
  }
  _buildBlock(e) {
    super._buildBlock(e), this.source.isConnected ? this._imageSource = this.source.connectedPoint.ownerBlock : this._imageSource = null, this._textureInfoName = e._getFreeVariableName("textureInfoName"), this.level.associatedVariableName = this._textureInfoName, this._tempTextureRead = e._getFreeVariableName("tempTextureRead"), this._linearDefineName = e._getFreeDefineName("ISLINEAR"), this._gammaDefineName = e._getFreeDefineName("ISGAMMA"), this._imageSource || (this._samplerName = e._getFreeVariableName(this.name + "Sampler"), e._emit2DSampler(this._samplerName)), e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this);
    const t = `//${this.name}`;
    e._emitFunctionFromInclude("helperFunctions", t), e._emitUniformFromString(this._textureInfoName, "float"), this._generateTextureLookup(e);
    for (const r of this._outputs)
      r.hasEndpoints && r.name !== "level" && this._writeOutput(e, r, r.name);
    return this;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};
`, e += `${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};
`, e += `${this._codeVariableName}.disableLevelMultiplication = ${this.disableLevelMultiplication};
`, e += `${this._codeVariableName}.projectAsCube = ${this.projectAsCube};
`, this.texture && (e += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});
`, e += `${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};
`, e += `${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};
`, e += `${this._codeVariableName}.texture.uAng = ${this.texture.uAng};
`, e += `${this._codeVariableName}.texture.vAng = ${this.texture.vAng};
`, e += `${this._codeVariableName}.texture.wAng = ${this.texture.wAng};
`, e += `${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};
`, e += `${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};
`, e += `${this._codeVariableName}.texture.uScale = ${this.texture.uScale};
`, e += `${this._codeVariableName}.texture.vScale = ${this.texture.vScale};
`, e += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};
`), e;
  }
  serialize() {
    const e = super.serialize();
    return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, e.disableLevelMultiplication = this.disableLevelMultiplication, e.projectAsCube = this.projectAsCube, !this.hasImageSource && this.texture && !this.texture.isRenderTarget && this.texture.getClassName() !== "VideoTexture" && (e.texture = this.texture.serialize()), e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, this.disableLevelMultiplication = !!e.disableLevelMultiplication, this.projectAsCube = !!e.projectAsCube, e.texture && !ja.IgnoreTexturesAtLoadTime && e.texture.url !== void 0 && (r = e.texture.url.indexOf("data:") === 0 ? "" : r, this.texture = We.Parse(e.texture, t, r));
  }
}
C([
  rn("Project as cube", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], gy.prototype, "projectAsCube", void 0);
Ue("BABYLON.TriPlanarBlock", gy);
class one extends gy {
  /**
   * Create a new BiPlanarBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, !0);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "BiPlanarBlock";
  }
  _generateTextureLookup(e) {
    var t;
    const r = this.samplerName, n = (t = this.samplerYName) !== null && t !== void 0 ? t : this.samplerName, i = this.sharpness.isConnected ? this.sharpness.associatedVariableName : "1.0", s = e._getFreeVariableName("dpdx"), a = e._getFreeVariableName("dpdy"), f = e._getFreeVariableName("n"), o = e._getFreeVariableName("ma"), d = e._getFreeVariableName("mi"), v = e._getFreeVariableName("me"), u = e._getFreeVariableName("x"), l = e._getFreeVariableName("y"), P = e._getFreeVariableName("y");
    e.compilationString += `
            // grab coord derivatives for texturing
            vec3 ${s} = dFdx(${this.position.associatedVariableName}.xyz);
            vec3 ${a} = dFdy(${this.position.associatedVariableName}.xyz);
            vec3 ${f} = abs(${this.normal.associatedVariableName}.xyz);
        
            // determine major axis (in x; yz are following axis)
            ivec3 ${o} = (${f}.x>${f}.y && ${f}.x>${f}.z) ? ivec3(0,1,2) :
                    (${f}.y>${f}.z)            ? ivec3(1,2,0) :
                                            ivec3(2,0,1) ;
            // determine minor axis (in x; yz are following axis)
            ivec3 ${d} = (${f}.x<${f}.y && ${f}.x<${f}.z) ? ivec3(0,1,2) :
                    (${f}.y<${f}.z)            ? ivec3(1,2,0) :
                                            ivec3(2,0,1) ;
            // determine median axis (in x;  yz are following axis)
            ivec3 ${v} = ivec3(3) - ${d} - ${o};
            
            // project+fetch
            vec4 ${u} = textureGrad( ${r}, vec2(   ${this.position.associatedVariableName}[${o}.y],   ${this.position.associatedVariableName}[${o}.z]), 
                                    vec2(${s}[${o}.y],${s}[${o}.z]), 
                                    vec2(${a}[${o}.y],${a}[${o}.z]) );
            vec4 ${l} = textureGrad( ${n}, vec2(   ${this.position.associatedVariableName}[${v}.y],   ${this.position.associatedVariableName}[${v}.z]), 
                                    vec2(${s}[${v}.y],${s}[${v}.z]),
                                    vec2(${a}[${v}.y],${a}[${v}.z]) );
            
            // blend factors
            vec2 ${P} = vec2(${f}[${o}.x],${f}[${v}.x]);
            // make local support
            ${P} = clamp( (${P}-0.5773)/(1.0-0.5773), 0.0, 1.0 );
            // shape transition
            ${P} = pow( ${P}, vec2(${i}/8.0) );
            // blend and return
            vec4 ${this._tempTextureRead} = (${u}*${P}.x + ${l}*${P}.y) / (${P}.x + ${P}.y);
        `;
  }
}
Ue("BABYLON.BiPlanarBlock", one);
class fne extends Mr {
  /**
   * Creates a new MatrixDeterminantBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("input", de.Matrix), this.registerOutput("output", de.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MatrixDeterminantBlock";
  }
  /**
   * Gets the input matrix
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.output, r = this.input;
    return e.compilationString += this._declareOutput(t, e) + `${t.associatedVariableName} = determinant(${r.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.MatrixDeterminantBlock", fne);
class Ane extends Mr {
  /**
   * Creates a new MatrixTransposeBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.registerInput("input", de.Matrix), this.registerOutput("output", de.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MatrixTransposeBlock";
  }
  /**
   * Gets the input matrix
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.output, r = this.input;
    return e.compilationString += this._declareOutput(t, e) + `${t.associatedVariableName} = transpose(${r.associatedVariableName});
`, this;
  }
}
Ue("BABYLON.MatrixTransposeBlock", Ane);
var xa;
(function(A) {
  A[A.None = 0] = "None", A[A.Normal = 1] = "Normal", A[A.Tangent = 2] = "Tangent", A[A.VertexColor = 3] = "VertexColor", A[A.UV1 = 4] = "UV1", A[A.UV2 = 5] = "UV2", A[A.UV3 = 6] = "UV3", A[A.UV4 = 7] = "UV4", A[A.UV5 = 8] = "UV5", A[A.UV6 = 9] = "UV6";
})(xa || (xa = {}));
class fY extends Mr {
  /**
   * Creates a new MeshAttributeExistsBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.attributeType = xa.None, this.registerInput("input", de.AutoDetect), this.registerInput("fallback", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1), this._inputs[0].onConnectionObservable.add((t) => {
      var r;
      if (this.attributeType)
        return;
      const n = t.ownerBlock;
      if (n instanceof gi && n.isAttribute)
        switch (n.name) {
          case "color":
            this.attributeType = xa.VertexColor;
            break;
          case "normal":
            this.attributeType = xa.Normal;
            break;
          case "tangent":
            this.attributeType = xa.Tangent;
            break;
          case "uv":
            this.attributeType = xa.UV1;
            break;
          case "uv2":
            this.attributeType = xa.UV2;
            break;
          case "uv3":
            this.attributeType = xa.UV3;
            break;
          case "uv4":
            this.attributeType = xa.UV4;
            break;
          case "uv5":
            this.attributeType = xa.UV5;
            break;
          case "uv6":
            this.attributeType = xa.UV6;
            break;
        }
      else if (n instanceof rY)
        switch ((r = this.input.connectedPoint) === null || r === void 0 ? void 0 : r.name) {
          case "normalOutput":
            this.attributeType = xa.Normal;
            break;
          case "tangentOutput":
            this.attributeType = xa.Tangent;
            break;
          case "uvOutput":
            this.attributeType = xa.UV1;
            break;
        }
    });
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MeshAttributeExistsBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the fallback component when speciefied attribute doesn't exist
   */
  get fallback() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    let t = null;
    switch (this.attributeType) {
      case xa.VertexColor:
        t = "VERTEXCOLOR_NME";
        break;
      case xa.Normal:
        t = "NORMAL";
        break;
      case xa.Tangent:
        t = "TANGENT";
        break;
      case xa.UV1:
        t = "UV1";
        break;
      case xa.UV2:
        t = "UV2";
        break;
      case xa.UV3:
        t = "UV3";
        break;
      case xa.UV4:
        t = "UV4";
        break;
      case xa.UV5:
        t = "UV5";
        break;
      case xa.UV6:
        t = "UV6";
        break;
    }
    const r = this._declareOutput(this.output, e);
    return t && (e.compilationString += `#ifdef ${t}
`), e.compilationString += `${r} = ${this.input.associatedVariableName};
`, t && (e.compilationString += `#else
`, e.compilationString += `${r} = ${this.fallback.associatedVariableName};
`, e.compilationString += `#endif
`), this;
  }
  serialize() {
    const e = super.serialize();
    return e.attributeType = this.attributeType, e;
  }
  _deserialize(e, t, r) {
    var n;
    super._deserialize(e, t, r), this.attributeType = (n = e.attributeType) !== null && n !== void 0 ? n : xa.None;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return e += `${this._codeVariableName}.attributeType = ${this.attributeType};
`, e;
  }
}
C([
  rn("Attribute lookup", Gr.List, void 0, {
    notifiers: { update: !0 },
    options: [
      { label: "(None)", value: xa.None },
      { label: "Normal", value: xa.Normal },
      { label: "Tangent", value: xa.Tangent },
      { label: "Vertex Color", value: xa.VertexColor },
      { label: "UV1", value: xa.UV1 },
      { label: "UV2", value: xa.UV2 },
      { label: "UV3", value: xa.UV3 },
      { label: "UV4", value: xa.UV4 },
      { label: "UV5", value: xa.UV5 },
      { label: "UV6", value: xa.UV6 }
    ]
  })
], fY.prototype, "attributeType", void 0);
Ue("BABYLON.MeshAttributeExistsBlock", fY);
var no;
(function(A) {
  A[A.EaseInSine = 0] = "EaseInSine", A[A.EaseOutSine = 1] = "EaseOutSine", A[A.EaseInOutSine = 2] = "EaseInOutSine", A[A.EaseInQuad = 3] = "EaseInQuad", A[A.EaseOutQuad = 4] = "EaseOutQuad", A[A.EaseInOutQuad = 5] = "EaseInOutQuad", A[A.EaseInCubic = 6] = "EaseInCubic", A[A.EaseOutCubic = 7] = "EaseOutCubic", A[A.EaseInOutCubic = 8] = "EaseInOutCubic", A[A.EaseInQuart = 9] = "EaseInQuart", A[A.EaseOutQuart = 10] = "EaseOutQuart", A[A.EaseInOutQuart = 11] = "EaseInOutQuart", A[A.EaseInQuint = 12] = "EaseInQuint", A[A.EaseOutQuint = 13] = "EaseOutQuint", A[A.EaseInOutQuint = 14] = "EaseInOutQuint", A[A.EaseInExpo = 15] = "EaseInExpo", A[A.EaseOutExpo = 16] = "EaseOutExpo", A[A.EaseInOutExpo = 17] = "EaseInOutExpo", A[A.EaseInCirc = 18] = "EaseInCirc", A[A.EaseOutCirc = 19] = "EaseOutCirc", A[A.EaseInOutCirc = 20] = "EaseInOutCirc", A[A.EaseInBack = 21] = "EaseInBack", A[A.EaseOutBack = 22] = "EaseOutBack", A[A.EaseInOutBack = 23] = "EaseInOutBack", A[A.EaseInElastic = 24] = "EaseInElastic", A[A.EaseOutElastic = 25] = "EaseOutElastic", A[A.EaseInOutElastic = 26] = "EaseInOutElastic";
})(no || (no = {}));
class dne extends Mr {
  /**
   * Creates a new CurveBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e, Ve.Neutral), this.type = no.EaseInOutSine, this.registerInput("input", de.AutoDetect), this.registerOutput("output", de.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._inputs[0].excludedConnectionPointTypes.push(de.Matrix), this._inputs[0].excludedConnectionPointTypes.push(de.Object), this._inputs[0].excludedConnectionPointTypes.push(de.Int);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "CurveBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _duplicateEntry(e, t) {
    return `ret.${t} = ${e.replace(/VAL/g, "v." + t)}`;
  }
  _duplicateEntryDirect(e) {
    return `return ${e.replace(/VAL/g, "v")}`;
  }
  _duplicateVector(e, t) {
    if (t === "float")
      return this._duplicateEntryDirect(e);
    const r = parseInt(t.replace("vec", ""));
    let n = `
            vec${r} ret = vec${r}(0.0);
        `;
    for (let i = 1; i <= r; i++)
      n += this._duplicateEntry(e, i === 1 ? "x" : i === 2 ? "y" : i === 3 ? "z" : "w") + `;
`;
    return n += `return ret;
`, n;
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0];
    let r = "", n = "", i = "";
    switch (this.input.type) {
      case de.Float:
        i = "float";
        break;
      case de.Vector2:
        i = "vec2";
        break;
      case de.Vector3:
      case de.Color3:
        i = "vec3";
        break;
      case de.Vector4:
      case de.Color4:
        i = "vec4";
        break;
    }
    switch (n = no[this.type] + "_" + i, this.type) {
      case no.EaseInSine:
        r = "return 1.0 - cos((v * 3.1415) / 2.0)";
        break;
      case no.EaseOutSine:
        r = "return sin((v * 3.1415) / 2.0)";
        break;
      case no.EaseInOutSine:
        r = "return -(cos(v * 3.1415) - 1.0) / 2.0";
        break;
      case no.EaseInQuad:
        r = "return v * v";
        break;
      case no.EaseOutQuad:
        r = "return (1.0 - v) * (1.0 - v)";
        break;
      case no.EaseInOutQuad: {
        const s = "VAL < 0.5 ? 2.0 * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 2.0) / 2.0";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInCubic:
        r = "return v * v * v";
        break;
      case no.EaseOutCubic: {
        const s = "1.0 - pow(1.0 - VAL, 3.0)";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInOutCubic: {
        const s = "VAL < 0.5 ? 4.0 * VAL * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 3.0) / 2.0";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInQuart:
        r = "return v * v * v * v";
        break;
      case no.EaseOutQuart: {
        const s = "1.0 - pow(1.0 - VAL, 4.0)";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInOutQuart: {
        const s = "VAL < 0.5 ? 8.0 * VAL * VAL * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 4.0) / 2.0";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInQuint:
        r = "return v * v * v * v * v";
        break;
      case no.EaseOutQuint: {
        const s = "1.0 - pow(1.0 - VAL, 5.0)";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInOutQuint: {
        const s = "VAL < 0.5 ? 16.0 * VAL * VAL * VAL * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 5.0) / 2.0";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInExpo: {
        const s = "VAL == 0.0 ? 0.0 : pow(2.0, 10.0 * VAL - 10.0)";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseOutExpo: {
        const s = "VAL == 1.0 ? 1.0 : 1.0 - pow(2.0, -10.0 * VAL)";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInOutExpo: {
        const s = "VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : VAL < 0.5 ? pow(2.0, 20.0 * VAL - 10.0) / 2.0 : (2.0 - pow(2.0, -20.0 * VAL + 10.0)) / 2.0";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInCirc: {
        const s = "1.0 - sqrt(1.0 - pow(VAL, 2.0))";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseOutCirc: {
        const s = "sqrt(1.0 - pow(VAL - 1.0, 2.0))";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInOutCirc: {
        const s = "VAL < 0.5 ? (1.0 - sqrt(1.0 - pow(2.0 * VAL, 2.0))) / 2.0 : (sqrt(1.0 - pow(-2.0 * VAL + 2.0, 2.0)) + 1.0) / 2.0";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInBack: {
        r = "return 2.70158 * v * v * v - 1.70158 * v * v";
        break;
      }
      case no.EaseOutBack: {
        const s = "2.70158 * pow(VAL - 1.0, 3.0) + 1.70158 * pow(VAL - 1.0, 2.0)";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInOutBack: {
        const s = "VAL < 0.5 ? (pow(2.0 * VAL, 2.0) * ((3.5949095) * 2.0 * VAL - 2.5949095)) / 2.0 : (pow(2.0 * VAL - 2.0, 2.0) * (3.5949095 * (VAL * 2.0 - 2.0) + 3.5949095) + 2.0) / 2.0";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInElastic: {
        const s = "VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : -pow(2.0, 10.0 * VAL - 10.0) * sin((VAL * 10.0 - 10.75) * ((2.0 * 3.1415) / 3.0))";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseOutElastic: {
        const s = "VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : pow(2.0, -10.0 * VAL) * sin((VAL * 10.0 - 0.75) * ((2.0 * 3.1415) / 3.0)) + 1.0";
        r = this._duplicateVector(s, i);
        break;
      }
      case no.EaseInOutElastic: {
        const s = "VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : VAL < 0.5 ? -(pow(2.0, 20.0 * VAL - 10.0) * sin((20.0 * VAL - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 : (pow(2.0, -20.0 * VAL + 10.0) * sin((20.0 * VAL - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 + 1.0";
        r = this._duplicateVector(s, i);
        break;
      }
    }
    return e._emitFunction(n, `${i} ${n}(${i} v) {${r};}
`, ""), e.compilationString += this._declareOutput(t, e) + ` = ${n}(${this.input.associatedVariableName});
`, this;
  }
  serialize() {
    const e = super.serialize();
    return e.curveType = this.type, e;
  }
  _deserialize(e, t, r) {
    super._deserialize(e, t, r), this.type = e.curveType;
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.type = BABYLON.CurveBlockTypes.${no[this.type]};
`;
  }
}
Ue("BABYLON.CurveBlock", dne);
class _pe {
  /**
   * Function used to optimize a NodeMaterial graph
   * @param _vertexOutputNodes defines the list of output nodes for the vertex shader
   * @param _fragmentOutputNodes defines the list of output nodes for the fragment shader
   */
  optimize(e, t) {
  }
}
class $pe {
  constructor() {
    this.mm = /* @__PURE__ */ new Map();
  }
  get(e, t) {
    const r = this.mm.get(e);
    if (r !== void 0)
      return r.get(t);
  }
  set(e, t, r) {
    let n = this.mm.get(e);
    n === void 0 && this.mm.set(e, n = /* @__PURE__ */ new Map()), n.set(t, r);
  }
}
class ehe {
  /** Gets the standalone status of the wrapper */
  get standalone() {
    var e, t;
    return (t = (e = this._options) === null || e === void 0 ? void 0 : e.standalone) !== null && t !== void 0 ? t : !1;
  }
  /** Gets the base material the wrapper is built upon */
  get baseMaterial() {
    return this._baseMaterial;
  }
  /** Gets the doNotInjectCode status of the wrapper */
  get doNotInjectCode() {
    var e, t;
    return (t = (e = this._options) === null || e === void 0 ? void 0 : e.doNotInjectCode) !== null && t !== void 0 ? t : !1;
  }
  /**
   * Instantiate a new shadow depth wrapper.
   * It works by injecting some specific code in the vertex/fragment shaders of the base material and is used by a shadow generator to
   * generate the shadow depth map. For more information, please refer to the documentation:
   * https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
   * @param baseMaterial Material to wrap
   * @param scene Define the scene the material belongs to
   * @param options Options used to create the wrapper
   */
  constructor(e, t, r) {
    this._baseMaterial = e, this._scene = t ?? gr.LastCreatedScene, this._options = r, this._subMeshToEffect = /* @__PURE__ */ new Map(), this._subMeshToDepthWrapper = new $pe(), this._meshes = /* @__PURE__ */ new Map(), this._onEffectCreatedObserver = this._baseMaterial.onEffectCreatedObservable.add((n) => {
      var i, s;
      const a = (i = n.subMesh) === null || i === void 0 ? void 0 : i.getMesh();
      a && !this._meshes.has(a) && this._meshes.set(a, a.onDisposeObservable.add((f) => {
        const o = this._subMeshToEffect.keys();
        for (let d = o.next(); d.done !== !0; d = o.next()) {
          const v = d.value;
          (v == null ? void 0 : v.getMesh()) === f && (this._subMeshToEffect.delete(v), this._deleteDepthWrapperEffect(v));
        }
      })), ((s = this._subMeshToEffect.get(n.subMesh)) === null || s === void 0 ? void 0 : s[0]) !== n.effect && (this._subMeshToEffect.set(n.subMesh, [n.effect, this._scene.getEngine().currentRenderPassId]), this._deleteDepthWrapperEffect(n.subMesh));
    });
  }
  _deleteDepthWrapperEffect(e) {
    const t = this._subMeshToDepthWrapper.mm.get(e);
    t && (t.forEach((r) => {
      var n;
      (n = r.mainDrawWrapper.effect) === null || n === void 0 || n.dispose();
    }), this._subMeshToDepthWrapper.mm.delete(e));
  }
  /**
   * Gets the effect to use to generate the depth map
   * @param subMesh subMesh to get the effect for
   * @param shadowGenerator shadow generator to get the effect for
   * @param passIdForDrawWrapper Id of the pass for which the effect from the draw wrapper must be retrieved from
   * @returns the effect to use to generate the depth map for the subMesh + shadow generator specified
   */
  getEffect(e, t, r) {
    var n;
    const i = (n = this._subMeshToDepthWrapper.mm.get(e)) === null || n === void 0 ? void 0 : n.get(t);
    if (!i)
      return null;
    let s = i.drawWrapper[r];
    return s || (s = i.drawWrapper[r] = new zo(this._scene.getEngine()), s.setEffect(i.mainDrawWrapper.effect, i.mainDrawWrapper.defines)), s;
  }
  /**
   * Specifies that the submesh is ready to be used for depth rendering
   * @param subMesh submesh to check
   * @param defines the list of defines to take into account when checking the effect
   * @param shadowGenerator combined with subMesh, it defines the effect to check
   * @param useInstances specifies that instances should be used
   * @param passIdForDrawWrapper Id of the pass for which the draw wrapper should be created
   * @returns a boolean indicating that the submesh is ready or not
   */
  isReadyForSubMesh(e, t, r, n, i) {
    var s, a;
    return this.standalone && !this._baseMaterial.isReadyForSubMesh(e.getMesh(), e, n) ? !1 : (a = (s = this._makeEffect(e, t, r, i)) === null || s === void 0 ? void 0 : s.isReady()) !== null && a !== void 0 ? a : !1;
  }
  /**
   * Disposes the resources
   */
  dispose() {
    this._baseMaterial.onEffectCreatedObservable.remove(this._onEffectCreatedObserver), this._onEffectCreatedObserver = null;
    const e = this._meshes.entries();
    for (let t = e.next(); t.done !== !0; t = e.next()) {
      const [r, n] = t.value;
      r.onDisposeObservable.remove(n);
    }
  }
  _makeEffect(e, t, r, n) {
    var i, s, a;
    const f = this._scene.getEngine(), o = this._subMeshToEffect.get(e);
    if (!o)
      return null;
    const [d, v] = o;
    let u = this._subMeshToDepthWrapper.get(e, r);
    if (!u) {
      const H = new zo(f);
      H.defines = (s = (i = e._getDrawWrapper(v)) === null || i === void 0 ? void 0 : i.defines) !== null && s !== void 0 ? s : null, u = {
        drawWrapper: [],
        mainDrawWrapper: H,
        depthDefines: "",
        token: v4()
      }, u.drawWrapper[n] = H, this._subMeshToDepthWrapper.set(e, r, u);
    }
    const l = t.join(`
`);
    if (u.mainDrawWrapper.effect && l === u.depthDefines)
      return u.mainDrawWrapper.effect;
    u.depthDefines = l;
    const P = d.getUniformNames().slice();
    let p = d.vertexSourceCodeBeforeMigration, c = d.fragmentSourceCodeBeforeMigration;
    if (!this.doNotInjectCode) {
      const H = this._options && this._options.remappedVariables ? `#include<shadowMapVertexNormalBias>(${this._options.remappedVariables.join(",")})` : An.IncludesShadersStore.shadowMapVertexNormalBias, T = this._options && this._options.remappedVariables ? `#include<shadowMapVertexMetric>(${this._options.remappedVariables.join(",")})` : An.IncludesShadersStore.shadowMapVertexMetric, q = this._options && this._options.remappedVariables ? `#include<shadowMapFragmentSoftTransparentShadow>(${this._options.remappedVariables.join(",")})` : An.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow, b = An.IncludesShadersStore.shadowMapFragment;
      p = p.replace(/void\s+?main/g, An.IncludesShadersStore.shadowMapVertexExtraDeclaration + `
void main`), p = p.replace(/#define SHADOWDEPTH_NORMALBIAS|#define CUSTOM_VERTEX_UPDATE_WORLDPOS/g, H), p.indexOf("#define SHADOWDEPTH_METRIC") !== -1 ? p = p.replace(/#define SHADOWDEPTH_METRIC/g, T) : p = p.replace(/}\s*$/g, T + `
}`), p = p.replace(/#define SHADER_NAME.*?\n|out vec4 glFragColor;\n/g, "");
      const j = c.indexOf("#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW") >= 0 || c.indexOf("#define CUSTOM_FRAGMENT_BEFORE_FOG") >= 0, w = c.indexOf("#define SHADOWDEPTH_FRAGMENT") !== -1;
      let m = "";
      j ? c = c.replace(/#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW|#define CUSTOM_FRAGMENT_BEFORE_FOG/g, q) : m = q + `
`, c = c.replace(/void\s+?main/g, An.IncludesShadersStore.shadowMapFragmentExtraDeclaration + `
void main`), w ? c = c.replace(/#define SHADOWDEPTH_FRAGMENT/g, b) : m += b + `
`, m && (c = c.replace(/}\s*$/g, m + "}")), P.push("biasAndScaleSM", "depthValuesSM", "lightDataSM", "softTransparentShadowSM");
    }
    u.mainDrawWrapper.effect = f.createEffect({
      vertexSource: p,
      fragmentSource: c,
      vertexToken: u.token,
      fragmentToken: u.token
    }, {
      attributes: d.getAttributesNames(),
      uniformsNames: P,
      uniformBuffersNames: d.getUniformBuffersNames(),
      samplers: d.getSamplers(),
      defines: l + `
` + d.defines.replace("#define SHADOWS", "").replace(/#define SHADOW\d/g, ""),
      indexParameters: d.getIndexParameters()
    }, f);
    for (let H = 0; H < u.drawWrapper.length; ++H)
      H !== n && ((a = u.drawWrapper[H]) === null || a === void 0 || a.setEffect(u.mainDrawWrapper.effect, u.mainDrawWrapper.defines));
    return u.mainDrawWrapper.effect;
  }
}
class vne extends na {
  constructor() {
    super(...arguments), this.DECAL = !1, this.DECALDIRECTUV = 0, this.DECAL_SMOOTHALPHA = !1, this.GAMMADECAL = !1;
  }
}
class cU extends Gl {
  /** @internal */
  _markAllSubMeshesAsTexturesDirty() {
    this._enable(this._isEnabled), this._internalMarkAllSubMeshesAsTexturesDirty();
  }
  /**
   * Creates a new DecalMapConfiguration
   * @param material The material to attach the decal map plugin to
   * @param addToPluginList If the plugin should be added to the material plugin list
   */
  constructor(e, t = !0) {
    super(e, "DecalMap", 150, new vne(), t), this._isEnabled = !1, this.isEnabled = !1, this._smoothAlpha = !1, this.smoothAlpha = !1, this.registerForExtraEvents = !0, this._internalMarkAllSubMeshesAsTexturesDirty = e._dirtyCallbacks[1];
  }
  isReadyForSubMesh(e, t, r, n) {
    const i = n.getMesh().decalMap;
    return !this._isEnabled || !(i != null && i.texture) || !Dt.DecalMapEnabled || !t.texturesEnabled ? !0 : i.isReady();
  }
  prepareDefines(e, t, r) {
    const n = r.decalMap;
    !this._isEnabled || !(n != null && n.texture) || !Dt.DecalMapEnabled || !t.texturesEnabled ? (e.DECAL && e.markAsTexturesDirty(), e.DECAL = !1) : ((!e.DECAL || e.GAMMADECAL !== n.texture.gammaSpace) && e.markAsTexturesDirty(), e.DECAL = !0, e.GAMMADECAL = n.texture.gammaSpace, e.DECAL_SMOOTHALPHA = this._smoothAlpha, Ye.PrepareDefinesForMergedUV(n.texture, e, "DECAL"));
  }
  /**
   * Note that we override hardBindForSubMesh and not bindForSubMesh because the material can be shared by multiple meshes,
   * in which case mustRebind could return false even though the decal map is different for each mesh: that's because the decal map
   * is not part of the material but hosted by the decalMap of the mesh instead.
   */
  hardBindForSubMesh(e, t, r, n) {
    const i = n.getMesh().decalMap;
    if (!this._isEnabled || !(i != null && i.texture) || !Dt.DecalMapEnabled || !t.texturesEnabled)
      return;
    const s = this._material.isFrozen, a = i.texture;
    (!e.useUbo || !s || !e.isSync) && (e.updateFloat4("vDecalInfos", a.coordinatesIndex, 0, 0, 0), Ye.BindTextureMatrix(a, e, "decal")), e.setTexture("decalSampler", a);
  }
  getClassName() {
    return "DecalMapConfiguration";
  }
  getSamplers(e) {
    e.push("decalSampler");
  }
  getUniforms() {
    return {
      ubo: [
        { name: "vDecalInfos", size: 4, type: "vec4" },
        { name: "decalMatrix", size: 16, type: "mat4" }
      ]
    };
  }
}
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], cU.prototype, "isEnabled", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], cU.prototype, "smoothAlpha", void 0);
Ue("BABYLON.DecalMapConfiguration", cU);
function the(A) {
  return A instanceof fs ? new DD(A) : null;
}
function rhe(A) {
  return A instanceof fs ? new fd(A) : null;
}
function nhe(A) {
  return A instanceof fs ? new h9(A) : null;
}
function ihe(A) {
  return A instanceof fs ? new dd(A) : null;
}
function she(A) {
  return A instanceof fs ? new K0(A) : null;
}
function ahe(A) {
  return A instanceof fs ? new _o(A) : null;
}
function ohe(A) {
  return A instanceof fs || A instanceof Wt ? new l4(A) : null;
}
var OS;
(function(A) {
  A[A.MATERIAL_TYPE_STANDARD = 0] = "MATERIAL_TYPE_STANDARD", A[A.MATERIAL_TYPE_PBR = 1] = "MATERIAL_TYPE_PBR", A[A.MATERIAL_TYPE_SIMPLE = 2] = "MATERIAL_TYPE_SIMPLE";
})(OS || (OS = {}));
var Tc;
(function(A) {
  A[A.COLOR_MODE_SET = 0] = "COLOR_MODE_SET", A[A.COLOR_MODE_ADD = 1] = "COLOR_MODE_ADD", A[A.COLOR_MODE_MULTIPLY = 2] = "COLOR_MODE_MULTIPLY";
})(Tc || (Tc = {}));
var K2;
(function(A) {
  A[A.COLOR_DISTRIBUTION_TYPE_SEGMENT = 0] = "COLOR_DISTRIBUTION_TYPE_SEGMENT", A[A.COLOR_DISTRIBUTION_TYPE_LINE = 1] = "COLOR_DISTRIBUTION_TYPE_LINE";
})(K2 || (K2 = {}));
class D6 {
}
D6.DEFAULT_COLOR = Ne.White();
D6.DEFAULT_WIDTH_ATTENUATED = 1;
D6.DEFAULT_WIDTH = 0.1;
class Qs {
  /**
   * Converts GreasedLinePoints to number[][]
   * @param points GreasedLinePoints
   * @returns number[][] with x, y, z coordinates of the points, like [[x, y, z, x, y, z, ...], [x, y, z, ...]]
   */
  static ConvertPoints(e) {
    if (e.length && Array.isArray(e) && typeof e[0] == "number")
      return [e];
    if (e.length && Array.isArray(e[0]) && typeof e[0][0] == "number")
      return e;
    if (e.length && !Array.isArray(e[0]) && e[0] instanceof S) {
      const t = [];
      for (let r = 0; r < e.length; r++) {
        const n = e[r];
        t.push(n.x, n.y, n.z);
      }
      return [t];
    } else if (e.length > 0 && Array.isArray(e[0]) && e[0].length > 0 && e[0][0] instanceof S) {
      const t = [];
      return e.forEach((n) => {
        t.push(n.flatMap((i) => [i.x, i.y, i.z]));
      }), t;
    } else {
      if (e instanceof Float32Array)
        return [Array.from(e)];
      if (e.length && e[0] instanceof Float32Array) {
        const t = [];
        return e.forEach((r) => {
          t.push(Array.from(r));
        }), t;
      }
    }
    return [];
  }
  /**
   * Omit zero length lines predicate for the MeshesToLines function
   * @param p1 point1 position of the face
   * @param p2 point2 position of the face
   * @param p3 point3 position of the face
   * @returns original points or null if any edge length is zero
   */
  static OmitZeroLengthPredicate(e, t, r) {
    const n = [];
    return t.subtract(e).lengthSquared() > 0 && n.push([e, t]), r.subtract(t).lengthSquared() > 0 && n.push([t, r]), e.subtract(r).lengthSquared() > 0 && n.push([r, e]), n.length === 0 ? null : n;
  }
  /**
   * Omit duplicate lines predicate for the MeshesToLines function
   * @param p1 point1 position of the face
   * @param p2 point2 position of the face
   * @param p3 point3 position of the face
   * @returns original points or null if any edge length is zero
   */
  static OmitDuplicatesPredicate(e, t, r, n) {
    const i = [];
    return Qs._SearchInPoints(e, t, n) || i.push([e, t]), Qs._SearchInPoints(t, r, n) || i.push([t, r]), Qs._SearchInPoints(r, e, n) || i.push([r, e]), i.length === 0 ? null : i;
  }
  static _SearchInPoints(e, t, r) {
    var n, i, s;
    for (const a of r)
      for (let f = 0; f < a.length; f++)
        if (!((n = a[f]) === null || n === void 0) && n.equals(e) && (!((i = a[f + 1]) === null || i === void 0) && i.equals(t) || !((s = a[f - 1]) === null || s === void 0) && s.equals(t)))
          return !0;
    return !1;
  }
  /**
   * Gets mesh triangles as line positions
   * @param meshes array of meshes
   * @param predicate predicate function which decides whether to include the mesh triangle/face in the ouput
   * @returns array of arrays of points
   */
  static MeshesToLines(e, t) {
    const r = [];
    return e.forEach((n, i) => {
      const s = n.getVerticesData(J.PositionKind), a = n.getIndices();
      if (s && a)
        for (let f = 0, o = 0; f < a.length; f++) {
          const d = a[o++] * 3, v = a[o++] * 3, u = a[o++] * 3, l = new S(s[d], s[d + 1], s[d + 2]), P = new S(s[v], s[v + 1], s[v + 2]), p = new S(s[u], s[u + 1], s[u + 2]);
          if (t) {
            const c = t(l, P, p, r, f, d, n, i, s, a);
            if (c)
              for (const H of c)
                r.push(H);
          } else
            r.push([l, P], [P, p], [p, l]);
        }
    }), r;
  }
  /**
   * Converts number coordinates to Vector3s
   * @param points number array of x, y, z, x, y z, ... coordinates
   * @returns Vector3 array
   */
  static ToVector3Array(e) {
    if (Array.isArray(e[0])) {
      const n = [], i = e;
      for (const s of i) {
        const a = [];
        for (let f = 0; f < s.length; f += 3)
          a.push(new S(s[f], s[f + 1], s[f + 2]));
        n.push(a);
      }
      return n;
    }
    const t = e, r = [];
    for (let n = 0; n < t.length; n += 3)
      r.push(new S(t[n], t[n + 1], t[n + 2]));
    return r;
  }
  /**
   * Gets a number array from a Vector3 array.
   * You can you for example to convert your Vector3[] offsets to the required number[] for the offsets option.
   * @param points Vector3 array
   * @returns an array of x, y, z coordinates as numbers [x, y, z, x, y, z, x, y, z, ....]
   */
  static ToNumberArray(e) {
    return e.flatMap((t) => [t.x, t.y, t.z]);
  }
  /**
   * Calculates the sum of points of every line and the number of points in each line.
   * This function is useful when you are drawing multiple lines in one mesh and you want
   * to know the counts. For example for creating an offsets table.
   * @param points point array
   * @returns points count info
   */
  static GetPointsCountInfo(e) {
    const t = new Array(e.length);
    let r = 0;
    for (let n = e.length; n--; )
      t[n] = e[n].length / 3, r += t[n];
    return { total: r, counts: t };
  }
  /**
   * Gets the length of the line counting all it's segments length
   * @param data array of line points
   * @returns length of the line
   */
  static GetLineLength(e) {
    if (e.length === 0)
      return 0;
    let t;
    typeof e[0] == "number" ? t = Qs.ToVector3Array(e) : t = e;
    const r = ue.Vector3[0];
    let n = 0;
    for (let i = 0; i < t.length - 1; i++) {
      const s = t[i], a = t[i + 1];
      n += a.subtractToRef(s, r).length();
    }
    return n;
  }
  /**
   * Divides a segment into smaller segments.
   * A segment is a part of the line between it's two points.
   * @param point1 first point of the line
   * @param point2 second point of the line
   * @param segmentCount number of segments we want to have in the divided line
   * @returns
   */
  static SegmentizeSegmentByCount(e, t, r) {
    const n = [], i = t.subtract(e), s = ue.Vector3[0];
    s.setAll(r);
    const a = ue.Vector3[1];
    i.divideToRef(s, a);
    let f = e.clone();
    n.push(f);
    for (let o = 0; o < r; o++)
      f = f.clone(), n.push(f.addInPlace(a));
    return n;
  }
  /**
   * Divides a line into segments.
   * A segment is a part of the line between it's two points.
   * @param what line points
   * @param segmentLength length of each segment of the resulting line (distance between two line points)
   * @returns line point
   */
  static SegmentizeLineBySegmentLength(e, t) {
    const r = e[0] instanceof S ? Qs.GetLineSegments(e) : typeof e[0] == "number" ? Qs.GetLineSegments(Qs.ToVector3Array(e)) : e, n = [];
    return r.forEach((i) => {
      i.length > t ? Qs.SegmentizeSegmentByCount(i.point1, i.point2, Math.ceil(i.length / t)).forEach((a) => {
        n.push(a);
      }) : (n.push(i.point1), n.push(i.point2));
    }), n;
  }
  /**
   * Divides a line into segments.
   * A segment is a part of the line between it's two points.
   * @param what line points
   * @param segmentCount number of segments
   * @returns line point
   */
  static SegmentizeLineBySegmentCount(e, t) {
    const r = typeof e[0] == "number" ? Qs.ToVector3Array(e) : e, n = Qs.GetLineLength(r) / t;
    return Qs.SegmentizeLineBySegmentLength(r, n);
  }
  /**
   * Gets line segments.
   * A segment is a part of the line between it's two points.
   * @param points line points
   * @returns segments information of the line segment including starting point, ending point and the distance between them
   */
  static GetLineSegments(e) {
    const t = [];
    for (let r = 0; r < e.length - 1; r++) {
      const n = e[r], i = e[r + 1], s = i.subtract(n).length();
      t.push({ point1: n, point2: i, length: s });
    }
    return t;
  }
  /**
   * Gets the minimum and the maximum length of a line segment in the line.
   * A segment is a part of the line between it's two points.
   * @param points line points
   * @returns
   */
  static GetMinMaxSegmentLength(e) {
    const r = Qs.GetLineSegments(e).sort((n) => n.length);
    return {
      min: r[0].length,
      max: r[r.length - 1].length
    };
  }
  /**
   * Finds the last visible position in world space of the line according to the visibility parameter
   * @param lineSegments segments of the line
   * @param lineLength total length of the line
   * @param visbility normalized value of visibility
   * @returns world space coordinate of the last visible piece of the line
   */
  static GetPositionOnLineByVisibility(e, t, r, n = !1) {
    const i = t * r;
    let s = 0, a = 0;
    const f = e.length;
    for (let d = 0; d < f; d++) {
      if (i <= s + e[d].length) {
        a = d;
        break;
      }
      s += e[d].length;
    }
    const o = (i - s) / e[a].length;
    return e[a].point2.subtractToRef(e[a].point1, ue.Vector3[0]), ue.Vector3[1] = ue.Vector3[0].multiplyByFloats(o, o, o), n || ue.Vector3[1].addInPlace(e[a].point1), ue.Vector3[1].clone();
  }
  /**
   * Creates lines in a shape of circle/arc.
   * A segment is a part of the line between it's two points.
   * @param radiusX radiusX of the circle
   * @param segments number of segments in the circle
   * @param z z coordinate of the points. Defaults to 0.
   * @param radiusY radiusY of the circle - you can draw an oval if using different values
   * @param segmentAngle angle offset of the segments. Defaults to Math.PI * 2 / segments. Change this value to draw a part of the circle.
   * @returns line points
   */
  static GetCircleLinePoints(e, t, r = 0, n = e, i = Math.PI * 2 / t) {
    const s = [];
    for (let a = 0; a <= t; a++)
      s.push(new S(Math.cos(a * i) * e, Math.sin(a * i) * n, r));
    return s;
  }
  /**
   * Gets line points in a shape of a bezier curve
   * @param p0 bezier point0
   * @param p1 bezier point1
   * @param p2 bezier point2
   * @param segments number of segments in the curve
   * @returns
   */
  static GetBezierLinePoints(e, t, r, n) {
    return j0.CreateQuadraticBezier(e, t, r, n).getPoints().flatMap((i) => [i.x, i.y, i.z]);
  }
  /**
   *
   * @param position position of the arrow cap (mainly you want to create a triangle, set widthUp and widthDown to the same value and omit widthStartUp and widthStartDown)
   * @param direction direction which the arrow points to
   * @param length length (size) of the arrow cap itself
   * @param widthUp the arrow width above the line
   * @param widthDown the arrow width belove the line
   * @param widthStartUp the arrow width at the start of the arrow above the line. In most scenarios this is 0.
   * @param widthStartDown the arrow width at the start of the arrow below the line. In most scenarios this is 0.
   * @returns
   */
  static GetArrowCap(e, t, r, n, i, s = 0, a = 0) {
    return {
      points: [e.clone(), e.add(t.multiplyByFloats(r, r, r))],
      widths: [n, i, s, a]
    };
  }
  /**
   * Gets 3D positions of points from a text and font
   * @param text Text
   * @param size Size of the font
   * @param resolution Resolution of the font
   * @param fontData defines the font data (can be generated with http://gero3.github.io/facetype.js/)
   * @param z z coordinate
   * @param includeInner include the inner parts of the font in the result. Default true. If false, only the outlines will be returned.
   * @returns number[][] of 3D positions
   */
  static GetPointsFromText(e, t, r, n, i = 0, s = !0) {
    const a = [], f = OQ(e, t, r, n);
    for (const o of f) {
      for (const d of o.paths) {
        const v = [], u = d.getPoints();
        for (const l of u)
          v.push(l.x, l.y, i);
        a.push(v);
      }
      if (s)
        for (const d of o.holes) {
          const v = [], u = d.getPoints();
          for (const l of u)
            v.push(l.x, l.y, i);
          a.push(v);
        }
    }
    return a;
  }
  /**
   * Converts an array of Color3 to Uint8Array
   * @param colors Arrray of Color3
   * @returns Uin8Array of colors [r, g, b, a, r, g, b, a, ...]
   */
  static Color3toRGBAUint8(e) {
    const t = new Uint8Array(e.length * 4);
    for (let r = 0, n = 0; r < e.length; r++)
      t[n++] = e[r].r * 255, t[n++] = e[r].g * 255, t[n++] = e[r].b * 255, t[n++] = 255;
    return t;
  }
  /**
   * Creates a RawTexture from an RGBA color array and sets it on the plugin material instance.
   * @param name name of the texture
   * @param colors Uint8Array of colors
   */
  static CreateColorsTexture(e, t, r, n) {
    const i = Qs.Color3toRGBAUint8(t), s = new Bo(i, t.length, 1, Ge.TEXTUREFORMAT_RGBA, n, !1, !0, r);
    return s.name = e, s;
  }
  /**
   * A minimum size texture for the colors sampler2D when there is no colors texture defined yet.
   * For fast switching using the useColors property without the need to use defines.
   * @param scene Scene
   * @returns empty colors texture
   */
  static PrepareEmptyColorsTexture(e) {
    if (!D6.EmptyColorsTexture) {
      const t = new Uint8Array(4);
      D6.EmptyColorsTexture = new Bo(t, 1, 1, Ge.TEXTUREFORMAT_RGBA, e, !1, !1, Bo.NEAREST_NEAREST), D6.EmptyColorsTexture.name = "grlEmptyColorsTexture";
    }
    return D6.EmptyColorsTexture;
  }
  /**
   * Diposes the shared empty colors texture
   */
  static DisposeEmptyColorsTexture() {
    var e;
    (e = D6.EmptyColorsTexture) === null || e === void 0 || e.dispose(), D6.EmptyColorsTexture = null;
  }
  /**
   * Converts boolean to number.
   * @param bool
   * @returns 1 if true, 0 if false.
   */
  static BooleanToNumber(e) {
    return e ? 1 : 0;
  }
}
class une extends na {
  constructor() {
    super(...arguments), this.GREASED_LINE_HAS_COLOR = !1, this.GREASED_LINE_SIZE_ATTENUATION = !1, this.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = !1, this.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = !1, this.GREASED_LINE_CAMERA_FACING = !0;
  }
}
class o4 extends Gl {
  /**
   * Creates a new instance of the GreasedLinePluginMaterial
   * @param material base material for the plugin
   * @param scene the scene
   * @param options plugin options
   */
  constructor(e, t, r) {
    var n, i, s, a, f, o, d, v, u, l, P, p, c, H, T, q, b;
    r = r || {
      color: D6.DEFAULT_COLOR
    };
    const j = new une();
    j.GREASED_LINE_HAS_COLOR = !!r.color && !r.useColors, j.GREASED_LINE_SIZE_ATTENUATION = (n = r.sizeAttenuation) !== null && n !== void 0 ? n : !1, j.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = r.colorDistributionType === K2.COLOR_DISTRIBUTION_TYPE_LINE, j.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = (t ?? e.getScene()).useRightHandedSystem, j.GREASED_LINE_CAMERA_FACING = (i = r.cameraFacing) !== null && i !== void 0 ? i : !0, super(e, o4.GREASED_LINE_MATERIAL_NAME, 200, j), this.colorsTexture = null, this._scene = t ?? e.getScene(), this._engine = this._scene.getEngine(), this._cameraFacing = (s = r.cameraFacing) !== null && s !== void 0 ? s : !0, this.visibility = (a = r.visibility) !== null && a !== void 0 ? a : 1, this.useDash = (f = r.useDash) !== null && f !== void 0 ? f : !1, this.dashRatio = (o = r.dashRatio) !== null && o !== void 0 ? o : 0.5, this.dashOffset = (d = r.dashOffset) !== null && d !== void 0 ? d : 0, this.width = r.width ? r.width : r.sizeAttenuation ? D6.DEFAULT_WIDTH_ATTENUATED : D6.DEFAULT_WIDTH, this._sizeAttenuation = (v = r.sizeAttenuation) !== null && v !== void 0 ? v : !1, this.colorMode = (u = r.colorMode) !== null && u !== void 0 ? u : Tc.COLOR_MODE_SET, this._color = (l = r.color) !== null && l !== void 0 ? l : null, this.useColors = (P = r.useColors) !== null && P !== void 0 ? P : !1, this._colorsDistributionType = (p = r.colorDistributionType) !== null && p !== void 0 ? p : K2.COLOR_DISTRIBUTION_TYPE_SEGMENT, this.colorsSampling = (c = r.colorsSampling) !== null && c !== void 0 ? c : Bo.NEAREST_NEAREST, this._colors = (H = r.colors) !== null && H !== void 0 ? H : null, this.dashCount = (T = r.dashCount) !== null && T !== void 0 ? T : 1, this.resolution = (q = r.resolution) !== null && q !== void 0 ? q : new at(this._engine.getRenderWidth(), this._engine.getRenderHeight()), r.colorsTexture ? this.colorsTexture = r.colorsTexture : this._colors ? this.colorsTexture = Qs.CreateColorsTexture(`${e.name}-colors-texture`, this._colors, this.colorsSampling, this._scene) : (this._color = (b = this._color) !== null && b !== void 0 ? b : D6.DEFAULT_COLOR, Qs.PrepareEmptyColorsTexture(this._scene)), this._engine.onDisposeObservable.add(() => {
      Qs.DisposeEmptyColorsTexture();
    }), this._enable(!0);
  }
  /**
   * Get the shader attributes
   * @param attributes array which will be filled with the attributes
   */
  getAttributes(e) {
    e.push("grl_offsets"), e.push("grl_widths"), e.push("grl_colorPointers"), e.push("grl_counters"), this._cameraFacing ? (e.push("grl_previousAndSide"), e.push("grl_nextAndCounters")) : e.push("grl_slopes");
  }
  /**
   * Get the shader samplers
   * @param samplers
   */
  getSamplers(e) {
    e.push("grl_colors");
  }
  /**
   * Get the shader textures
   * @param activeTextures
   */
  getActiveTextures(e) {
    this.colorsTexture && e.push(this.colorsTexture);
  }
  /**
   * Get the shader uniforms
   * @returns uniforms
   */
  getUniforms() {
    const e = [
      { name: "grl_singleColor", size: 3, type: "vec3" },
      { name: "grl_dashOptions", size: 4, type: "vec4" },
      { name: "grl_colorMode_visibility_colorsWidth_useColors", size: 4, type: "vec4" }
    ];
    return this._cameraFacing && e.push({ name: "grl_projection", size: 16, type: "mat4" }, { name: "grl_aspect_resolution_lineWidth", size: 4, type: "vec4" }), {
      ubo: e,
      vertex: this._cameraFacing ? `
                uniform vec4 grl_aspect_resolution_lineWidth;
                uniform mat4 grl_projection;
                ` : "",
      fragment: `
                uniform vec4 grl_dashOptions;
                uniform vec4 grl_colorMode_visibility_colorsWidth_useColors;
                uniform vec3 grl_singleColor;
                `
    };
  }
  // only getter, it doesn't make sense to use this plugin on a mesh other than GreasedLineMesh
  // and it doesn't make sense to disable it on the mesh
  get isEnabled() {
    return !0;
  }
  /**
   * Bind the uniform buffer
   * @param uniformBuffer
   */
  bindForSubMesh(e) {
    var t;
    if (this._cameraFacing) {
      const i = this._scene.activeCamera;
      if (i) {
        const a = i.getProjectionMatrix();
        e.updateMatrix("grl_projection", a);
      } else
        throw Error("GreasedLinePluginMaterial requires an active camera.");
      const s = ue.Vector4[0];
      s.x = this._aspect, s.y = this._resolution.x, s.z = this._resolution.y, s.w = this.width, e.updateVector4("grl_aspect_resolution_lineWidth", s);
    }
    const r = ue.Vector4[0];
    r.x = Qs.BooleanToNumber(this.useDash), r.y = this._dashArray, r.z = this.dashOffset, r.w = this.dashRatio, e.updateVector4("grl_dashOptions", r);
    const n = ue.Vector4[1];
    n.x = this.colorMode, n.y = this.visibility, n.z = this.colorsTexture ? this.colorsTexture.getSize().width : 0, n.w = Qs.BooleanToNumber(this.useColors), e.updateVector4("grl_colorMode_visibility_colorsWidth_useColors", n), this._color && e.updateColor3("grl_singleColor", this._color), e.setTexture("grl_colors", (t = this.colorsTexture) !== null && t !== void 0 ? t : D6.EmptyColorsTexture);
  }
  /**
   * Prepare the defines
   * @param defines
   * @param _scene
   * @param _mesh
   */
  prepareDefines(e, t, r) {
    e.GREASED_LINE_HAS_COLOR = !!this.color && !this.useColors, e.GREASED_LINE_SIZE_ATTENUATION = this._sizeAttenuation, e.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = this._colorsDistributionType === K2.COLOR_DISTRIBUTION_TYPE_LINE, e.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = t.useRightHandedSystem, e.GREASED_LINE_CAMERA_FACING = this._cameraFacing;
  }
  /**
   * Get the class name
   * @returns class name
   */
  getClassName() {
    return o4.GREASED_LINE_MATERIAL_NAME;
  }
  /**
   * Get shader code
   * @param shaderType vertex/fragment
   * @returns shader code
   */
  getCustomCode(e) {
    if (e === "vertex") {
      const t = {
        // eslint-disable-next-line @typescript-eslint/naming-convention
        CUSTOM_VERTEX_DEFINITIONS: `
                attribute float grl_widths;
                attribute vec3 grl_offsets;
                attribute float grl_colorPointers;

                varying float grlCounters;
                varying float grlColorPointer;

                #ifdef GREASED_LINE_CAMERA_FACING
                    attribute vec4 grl_previousAndSide;
                    attribute vec4 grl_nextAndCounters;

                    vec2 grlFix( vec4 i, float aspect ) {
                        vec2 res = i.xy / i.w;
                        res.x *= aspect;
                        return res;
                    }
                #else
                    attribute vec3 grl_slopes;
                    attribute float grl_counters;
                #endif
                `,
        // eslint-disable-next-line @typescript-eslint/naming-convention
        CUSTOM_VERTEX_UPDATE_POSITION: `
                #ifdef GREASED_LINE_CAMERA_FACING
                    vec3 grlPositionOffset = grl_offsets;
                    positionUpdated += grlPositionOffset;
                #else
                    positionUpdated = (positionUpdated + grl_offsets) + (grl_slopes * grl_widths);
                #endif
                `,
        // eslint-disable-next-line @typescript-eslint/naming-convention
        CUSTOM_VERTEX_MAIN_END: `
                grlColorPointer = grl_colorPointers;

                #ifdef GREASED_LINE_CAMERA_FACING

                    float grlAspect = grl_aspect_resolution_lineWidth.x;
                    float grlBaseWidth = grl_aspect_resolution_lineWidth.w;


                    vec3 grlPrevious = grl_previousAndSide.xyz;
                    float grlSide = grl_previousAndSide.w;

                    vec3 grlNext = grl_nextAndCounters.xyz;
                    grlCounters = grl_nextAndCounters.w;

                    mat4 grlMatrix = viewProjection * finalWorld;
                    vec4 grlFinalPosition = grlMatrix * vec4( positionUpdated , 1.0 );
                    vec4 grlPrevPos = grlMatrix * vec4( grlPrevious + grlPositionOffset, 1.0 );
                    vec4 grlNextPos = grlMatrix * vec4( grlNext + grlPositionOffset, 1.0 );

                    vec2 grlCurrentP = grlFix( grlFinalPosition, grlAspect );
                    vec2 grlPrevP = grlFix( grlPrevPos, grlAspect );
                    vec2 grlNextP = grlFix( grlNextPos, grlAspect );

                    float grlWidth = grlBaseWidth * grl_widths;

                    vec2 grlDir;
                    if( grlNextP == grlCurrentP ) grlDir = normalize( grlCurrentP - grlPrevP );
                    else if( grlPrevP == grlCurrentP ) grlDir = normalize( grlNextP - grlCurrentP );
                    else {
                        vec2 grlDir1 = normalize( grlCurrentP - grlPrevP );
                        vec2 grlDir2 = normalize( grlNextP - grlCurrentP );
                        grlDir = normalize( grlDir1 + grlDir2 );
                    }
                    vec4 grlNormal = vec4( -grlDir.y, grlDir.x, 0., 1. );
                    #ifdef GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM
                        grlNormal.xy *= -.5 * grlWidth;
                    #else
                        grlNormal.xy *= .5 * grlWidth;
                    #endif

                    grlNormal *= grl_projection;

                    #ifdef GREASED_LINE_SIZE_ATTENUATION
                        grlNormal.xy *= grlFinalPosition.w;
                        grlNormal.xy /= ( vec4( grl_aspect_resolution_lineWidth.yz, 0., 1. ) * grl_projection ).xy;
                    #endif

                    grlFinalPosition.xy += grlNormal.xy * grlSide;
                    gl_Position = grlFinalPosition;

                    vPositionW = vec3(grlFinalPosition);
                #else
                    grlCounters = grl_counters;
                #endif
                `
      };
      return this._cameraFacing && (t["!gl_Position\\=viewProjection\\*worldPos;"] = "//"), t;
    }
    return e === "fragment" ? {
      // eslint-disable-next-line @typescript-eslint/naming-convention
      CUSTOM_FRAGMENT_DEFINITIONS: `
                    varying float grlCounters;
                    varying float grlColorPointer;
                    uniform sampler2D grl_colors;
                `,
      // eslint-disable-next-line @typescript-eslint/naming-convention
      CUSTOM_FRAGMENT_MAIN_END: `
                    float grlColorMode = grl_colorMode_visibility_colorsWidth_useColors.x;
                    float grlVisibility = grl_colorMode_visibility_colorsWidth_useColors.y;
                    float grlColorsWidth = grl_colorMode_visibility_colorsWidth_useColors.z;
                    float grlUseColors = grl_colorMode_visibility_colorsWidth_useColors.w;

                    float grlUseDash = grl_dashOptions.x;
                    float grlDashArray = grl_dashOptions.y;
                    float grlDashOffset = grl_dashOptions.z;
                    float grlDashRatio = grl_dashOptions.w;

                    gl_FragColor.a *= step(grlCounters, grlVisibility);
                    if( gl_FragColor.a == 0. ) discard;

                    if(grlUseDash == 1.){
                        gl_FragColor.a *= ceil(mod(grlCounters + grlDashOffset, grlDashArray) - (grlDashArray * grlDashRatio));
                        if (gl_FragColor.a == 0.) discard;
                    }

                    #ifdef GREASED_LINE_HAS_COLOR
                        if (grlColorMode == ${Tc.COLOR_MODE_SET}.) {
                            gl_FragColor.rgb = grl_singleColor;
                        } else if (grlColorMode == ${Tc.COLOR_MODE_ADD}.) {
                            gl_FragColor.rgb += grl_singleColor;
                        } else if (grlColorMode == ${Tc.COLOR_MODE_MULTIPLY}.) {
                            gl_FragColor.rgb *= grl_singleColor;
                        }
                    #else
                        if (grlUseColors == 1.) {
                            #ifdef GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE
                                vec4 grlColor = texture2D(grl_colors, vec2(grlCounters, 0.), 0.);
                            #else
                                vec4 grlColor = texture2D(grl_colors, vec2(grlColorPointer/grlColorsWidth, 0.), 0.);
                            #endif
                            if (grlColorMode == ${Tc.COLOR_MODE_SET}.) {
                                gl_FragColor = grlColor;
                            } else if (grlColorMode == ${Tc.COLOR_MODE_ADD}.) {
                                gl_FragColor += grlColor;
                            } else if (grlColorMode == ${Tc.COLOR_MODE_MULTIPLY}.) {
                                gl_FragColor *= grlColor;
                            }
                        }
                    #endif

                `
    } : null;
  }
  /**
   * Disposes the plugin material.
   */
  dispose() {
    var e;
    (e = this.colorsTexture) === null || e === void 0 || e.dispose(), super.dispose();
  }
  /**
   * Returns the colors used to colorize the line
   */
  get colors() {
    return this._colors;
  }
  /**
   * Sets the colors used to colorize the line
   */
  set colors(e) {
    this.setColors(e);
  }
  /**
   * Creates or updates the colors texture
   * @param colors color table RGBA
   * @param lazy if lazy, the colors are not updated
   * @param forceNewTexture force creation of a new texture
   * @returns
   */
  setColors(e, t = !1, r = !1) {
    var n, i, s, a;
    const f = (i = (n = this._colors) === null || n === void 0 ? void 0 : n.length) !== null && i !== void 0 ? i : 0;
    if (this._colors = e, e === null || e.length === 0) {
      (s = this.colorsTexture) === null || s === void 0 || s.dispose();
      return;
    }
    if (!(t && !r))
      if (this.colorsTexture && f === e.length && !r) {
        const o = Qs.Color3toRGBAUint8(e);
        this.colorsTexture.update(o);
      } else
        (a = this.colorsTexture) === null || a === void 0 || a.dispose(), this.colorsTexture = Qs.CreateColorsTexture(`${this._material.name}-colors-texture`, e, this.colorsSampling, this._scene);
  }
  /**
   * Updates the material. Use when material created in lazy mode.
   */
  updateLazy() {
    this._colors && this.setColors(this._colors, !1, !0);
  }
  /**
   * Gets the number of dashes in the line
   */
  get dashCount() {
    return this._dashCount;
  }
  /**
   * Sets the number of dashes in the line
   * @param value dash
   */
  set dashCount(e) {
    this._dashCount = e, this._dashArray = 1 / e;
  }
  /**
   * If set to true the line will be rendered always with the same width regardless how far it is located from the camera.
   * Not supported for non camera facing lines.
   */
  get sizeAttenuation() {
    return this._sizeAttenuation;
  }
  /**
   * Turn on/off size attenuation of the width option and widths array.
   * Not supported for non camera facing lines.
   * @param value If set to true the line will be rendered always with the same width regardless how far it is located from the camera.
   */
  set sizeAttenuation(e) {
    this._sizeAttenuation = e, this.markAllDefinesAsDirty();
  }
  /**
   * Gets the color of the line
   */
  get color() {
    return this._color;
  }
  /**
   * Sets the color of the line
   * @param value Color3 or null to clear the color. You need to clear the color if you use colors and useColors = true
   */
  set color(e) {
    this.setColor(e);
  }
  /**
   * Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.
   * @param value color
   */
  setColor(e, t = !1) {
    this._color === null && e !== null || this._color !== null && e === null ? (this._color = e, !t && this.markAllDefinesAsDirty()) : this._color = e;
  }
  /**
   * Gets the color distributiopn type
   */
  get colorsDistributionType() {
    return this._colorsDistributionType;
  }
  /**
   * Sets the color distribution type
   * @see GreasedLineMeshColorDistributionType
   * @param value color distribution type
   */
  set colorsDistributionType(e) {
    this._colorsDistributionType = e, this.markAllDefinesAsDirty();
  }
  /**
   * Gets the resolution
   */
  get resolution() {
    return this._resolution;
  }
  /**
   * Sets the resolution
   * @param value resolution of the screen for GreasedLine
   */
  set resolution(e) {
    this._aspect = e.x / e.y, this._resolution = e;
  }
  /**
   * Serializes this plugin material
   * @returns serializationObjec
   */
  serialize() {
    const e = super.serialize(), t = {
      colorDistributionType: this._colorsDistributionType,
      colorsSampling: this.colorsSampling,
      colorMode: this.colorMode,
      dashCount: this._dashCount,
      dashOffset: this.dashOffset,
      dashRatio: this.dashRatio,
      resolution: this._resolution,
      sizeAttenuation: this._sizeAttenuation,
      useColors: this.useColors,
      useDash: this.useDash,
      visibility: this.visibility,
      width: this.width
    };
    return this._colors && (t.colors = this._colors), this._color && (t.color = this._color), e.greasedLineMaterialOptions = t, e;
  }
  /**
   * Parses a serialized objects
   * @param source serialized object
   * @param scene scene
   * @param rootUrl root url for textures
   */
  parse(e, t, r) {
    var n;
    super.parse(e, t, r);
    const i = e.greasedLineMaterialOptions;
    (n = this.colorsTexture) === null || n === void 0 || n.dispose(), i.color && this.setColor(i.color, !0), i.colorDistributionType && (this.colorsDistributionType = i.colorDistributionType), i.colors && (this.colors = i.colors), i.colorsSampling && (this.colorsSampling = i.colorsSampling), i.colorMode && (this.colorMode = i.colorMode), i.useColors && (this.useColors = i.useColors), i.visibility && (this.visibility = i.visibility), i.useDash && (this.useDash = i.useDash), i.dashCount && (this.dashCount = i.dashCount), i.dashRatio && (this.dashRatio = i.dashRatio), i.dashOffset && (this.dashOffset = i.dashOffset), i.width && (this.width = i.width), i.sizeAttenuation && (this.sizeAttenuation = i.sizeAttenuation), i.resolution && (this.resolution = i.resolution), this.colors ? this.colorsTexture = Qs.CreateColorsTexture(`${this._material.name}-colors-texture`, this.colors, this.colorsSampling, t) : Qs.PrepareEmptyColorsTexture(t), this.markAllDefinesAsDirty();
  }
  /**
   * Makes a duplicate of the current configuration into another one.
   * @param plugin define the config where to copy the info
   */
  copyTo(e) {
    var t;
    const r = e;
    (t = r.colorsTexture) === null || t === void 0 || t.dispose(), this._colors && (r.colorsTexture = Qs.CreateColorsTexture(`${r._material.name}-colors-texture`, this._colors, r.colorsSampling, this._scene)), r.setColor(this.color, !0), r.colorsDistributionType = this.colorsDistributionType, r.colorsSampling = this.colorsSampling, r.colorMode = this.colorMode, r.useColors = this.useColors, r.visibility = this.visibility, r.useDash = this.useDash, r.dashCount = this.dashCount, r.dashRatio = this.dashRatio, r.dashOffset = this.dashOffset, r.width = this.width, r.sizeAttenuation = this.sizeAttenuation, r.resolution = this.resolution, r.markAllDefinesAsDirty();
  }
}
o4.GREASED_LINE_MATERIAL_NAME = "GreasedLinePluginMaterial";
Ue(`BABYLON.${o4.GREASED_LINE_MATERIAL_NAME}`, o4);
const fhe = "greasedLinePixelShader", Ahe = `precision highp float;uniform sampler2D grlColors;uniform float grlUseColors;uniform float grlUseDash;uniform float grlDashArray;uniform float grlDashOffset;uniform float grlDashRatio;uniform float grlVisibility;uniform float grlColorsWidth;uniform vec2 grl_colorModeAndColorDistributionType;uniform vec3 grlColor;varying float grlCounters;varying float grlColorPointer;void main() {float grlColorMode=grl_colorModeAndColorDistributionType.x;float grlColorDistributionType=grl_colorModeAndColorDistributionType.y;gl_FragColor=vec4(grlColor,1.);gl_FragColor.a=step(grlCounters,grlVisibility);if (gl_FragColor.a==0.) discard;if( grlUseDash==1. ){gl_FragColor.a=ceil(mod(grlCounters+grlDashOffset,grlDashArray)-(grlDashArray*grlDashRatio));if (gl_FragColor.a==0.) discard;}
if (grlUseColors==1.) {vec4 textureColor;if (grlColorDistributionType==COLOR_DISTRIBUTION_TYPE_LINE) { 
textureColor=texture2D(grlColors,vec2(grlCounters,0.),0.);} else {textureColor=texture2D(grlColors,vec2(grlColorPointer/grlColorsWidth,0.),0.);}
if (grlColorMode==COLOR_MODE_SET) {gl_FragColor=textureColor;} else if (grlColorMode==COLOR_MODE_ADD) {gl_FragColor+=textureColor;} else if (grlColorMode==COLOR_MODE_MULTIPLY) {gl_FragColor*=textureColor;}}}
`;
Le.ShadersStore[fhe] = Ahe;
const dhe = "greasedLineVertexShader", vhe = `precision highp float;
#include<instancesDeclaration>
attribute float grl_widths;attribute vec3 grl_offsets;attribute float grl_colorPointers;attribute vec3 position;uniform mat4 viewProjection;uniform mat4 projection;varying float grlCounters;varying float grlColorPointer;
#ifdef GREASED_LINE_CAMERA_FACING
attribute vec4 grl_nextAndCounters;attribute vec4 grl_previousAndSide;uniform vec2 grlResolution;uniform float grlAspect;uniform float grlWidth;uniform float grlSizeAttenuation;vec2 grlFix( vec4 i,float aspect ) {vec2 res=i.xy/i.w;res.x*=aspect;return res;}
#else
attribute vec3 grl_slopes;attribute float grl_counters;
#endif
void main() {
#include<instancesVertex>
grlColorPointer=grl_colorPointers;
#ifdef GREASED_LINE_CAMERA_FACING
float grlBaseWidth=grlWidth;vec3 grlPrevious=grl_previousAndSide.xyz;float grlSide=grl_previousAndSide.w;vec3 grlNext=grl_nextAndCounters.xyz;grlCounters=grl_nextAndCounters.w;mat4 grlMatrix=viewProjection*finalWorld ;vec3 grlPositionOffset=grl_offsets;vec4 grlFinalPosition=grlMatrix*vec4( position+grlPositionOffset ,1.0 );vec4 grlPrevPos=grlMatrix*vec4( grlPrevious+grlPositionOffset,1.0 );vec4 grlNextPos=grlMatrix*vec4( grlNext+grlPositionOffset,1.0 );vec2 grlCurrentP=grlFix( grlFinalPosition,grlAspect );vec2 grlPrevP=grlFix( grlPrevPos,grlAspect );vec2 grlNextP=grlFix( grlNextPos,grlAspect );float grlWidth=grlBaseWidth*grl_widths;vec2 grlDir;if( grlNextP==grlCurrentP ) grlDir=normalize( grlCurrentP-grlPrevP );else if( grlPrevP==grlCurrentP ) grlDir=normalize( grlNextP-grlCurrentP );else {vec2 grlDir1=normalize( grlCurrentP-grlPrevP );vec2 grlDir2=normalize( grlNextP-grlCurrentP );grlDir=normalize( grlDir1+grlDir2 );}
vec4 grlNormal=vec4( -grlDir.y,grlDir.x,0.,1. );
#ifdef GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM
grlNormal.xy*=-.5*grlWidth;
#else
grlNormal.xy*=.5*grlWidth;
#endif
grlNormal*=projection;if (grlSizeAttenuation==1.) {grlNormal.xy*=grlFinalPosition.w;grlNormal.xy/=( vec4( grlResolution,0.,1. )*projection ).xy;}
grlFinalPosition.xy+=grlNormal.xy*grlSide;gl_Position=grlFinalPosition;
#else
grlCounters=grl_counters;vec4 grlFinalPosition=worldViewProjection*vec4( (position+grl_offsets)+grl_slopes*grl_widths ,1.0 ) ;gl_Position=grlFinalPosition;
#endif
}
`;
Le.ShadersStore[dhe] = vhe;
class AY extends Zo {
  /**
   * GreasedLineSimple material constructor
   * @param name material name
   * @param scene the scene
   * @param options material options
   */
  constructor(e, t, r) {
    var n, i, s, a, f, o, d, v, u, l, P, p, c, H;
    const T = [
      `COLOR_DISTRIBUTION_TYPE_LINE ${K2.COLOR_DISTRIBUTION_TYPE_LINE}.`,
      `COLOR_DISTRIBUTION_TYPE_SEGMENT ${K2.COLOR_DISTRIBUTION_TYPE_SEGMENT}.`,
      `COLOR_MODE_SET ${Tc.COLOR_MODE_SET}.`,
      `COLOR_MODE_ADD ${Tc.COLOR_MODE_ADD}.`,
      `COLOR_MODE_MULTIPLY ${Tc.COLOR_MODE_MULTIPLY}.`
    ], q = ["position", "grl_widths", "grl_offsets", "grl_colorPointers"];
    t.useRightHandedSystem && T.push("GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM"), r.cameraFacing ? (T.push("GREASED_LINE_CAMERA_FACING"), q.push("grl_previousAndSide", "grl_nextAndCounters")) : (q.push("grl_slopes"), q.push("grl_counters")), super(e, t, {
      vertex: "greasedLine",
      fragment: "greasedLine"
    }, {
      attributes: q,
      uniforms: [
        "world",
        "viewProjection",
        "view",
        "projection",
        "grlColorsWidth",
        "grlUseColors",
        "grlWidth",
        "grlColor",
        "grl_colorModeAndColorDistributionType",
        "grlResolution",
        "grlAspect",
        "grlAizeAttenuation",
        "grlDashArray",
        "grlDashOffset",
        "grlDashRatio",
        "grlUseDash",
        "grlVisibility"
      ],
      samplers: ["grlColors"],
      defines: T
    }), this._color = Ne.White(), this._colorsDistributionType = K2.COLOR_DISTRIBUTION_TYPE_SEGMENT, this._colorsTexture = null, r = r || {
      color: D6.DEFAULT_COLOR
    };
    const b = t.getEngine();
    this.visibility = (n = r.visibility) !== null && n !== void 0 ? n : 1, this.useDash = (i = r.useDash) !== null && i !== void 0 ? i : !1, this.dashRatio = (s = r.dashRatio) !== null && s !== void 0 ? s : 0.5, this.dashOffset = (a = r.dashOffset) !== null && a !== void 0 ? a : 0, this.dashCount = (f = r.dashCount) !== null && f !== void 0 ? f : 1, this.width = r.width ? r.width : r.sizeAttenuation && r.cameraFacing ? D6.DEFAULT_WIDTH_ATTENUATED : D6.DEFAULT_WIDTH, this.sizeAttenuation = (o = r.sizeAttenuation) !== null && o !== void 0 ? o : !1, this.color = (d = r.color) !== null && d !== void 0 ? d : Ne.White(), this.useColors = (v = r.useColors) !== null && v !== void 0 ? v : !1, this.colorsDistributionType = (u = r.colorDistributionType) !== null && u !== void 0 ? u : K2.COLOR_DISTRIBUTION_TYPE_SEGMENT, this.colorsSampling = (l = r.colorsSampling) !== null && l !== void 0 ? l : Bo.NEAREST_NEAREST, this.colorMode = (P = r.colorMode) !== null && P !== void 0 ? P : Tc.COLOR_MODE_SET, this._colors = (p = r.colors) !== null && p !== void 0 ? p : null, this._cameraFacing = (c = r.cameraFacing) !== null && c !== void 0 ? c : !0, this.resolution = (H = r.resolution) !== null && H !== void 0 ? H : new at(b.getRenderWidth(), b.getRenderHeight()), r.colorsTexture ? this.colorsTexture = r.colorsTexture : this.colorsTexture = Qs.PrepareEmptyColorsTexture(t), this._colors && this.setColors(this._colors), b.onDisposeObservable.add(() => {
      Qs.DisposeEmptyColorsTexture();
    });
  }
  /**
   * Disposes the plugin material.
   */
  dispose() {
    var e;
    (e = this._colorsTexture) === null || e === void 0 || e.dispose(), super.dispose();
  }
  _setColorModeAndColorDistributionType() {
    this.setVector2("grl_colorModeAndColorDistributionType", new at(this._colorMode, this._colorsDistributionType));
  }
  /**
   * Updates the material. Use when material created in lazy mode.
   */
  updateLazy() {
    this._colors && this.setColors(this._colors, !1, !0);
  }
  /**
   * Returns the colors used to colorize the line
   */
  get colors() {
    return this._colors;
  }
  /**
   * Sets the colors used to colorize the line
   */
  set colors(e) {
    this.setColors(e);
  }
  /**
   * Creates or updates the colors texture
   * @param colors color table RGBA
   * @param lazy if lazy, the colors are not updated
   * @param forceNewTexture force creation of a new texture
   * @returns
   */
  setColors(e, t = !1, r = !1) {
    var n, i, s, a;
    const f = (i = (n = this._colors) === null || n === void 0 ? void 0 : n.length) !== null && i !== void 0 ? i : 0;
    if (this._colors = e, e === null || e.length === 0) {
      (s = this._colorsTexture) === null || s === void 0 || s.dispose();
      return;
    }
    if (!(t && !r))
      if (this._colorsTexture && f === e.length && !r) {
        const o = Qs.Color3toRGBAUint8(e);
        this._colorsTexture.update(o);
      } else
        (a = this._colorsTexture) === null || a === void 0 || a.dispose(), this.colorsTexture = Qs.CreateColorsTexture(`${this.name}-colors-texture`, e, this.colorsSampling, this.getScene());
  }
  /**
   * Gets the colors texture
   */
  get colorsTexture() {
    var e;
    return (e = this._colorsTexture) !== null && e !== void 0 ? e : null;
  }
  /**
   * Sets the colorsTexture
   */
  set colorsTexture(e) {
    this._colorsTexture = e, this.setFloat("grlColorsWidth", this._colorsTexture.getSize().width), this.setTexture("grlColors", this._colorsTexture);
  }
  /**
   * Line base width. At each point the line width is calculated by widths[pointIndex] * width
   */
  get width() {
    return this._width;
  }
  /**
   * Line base width. At each point the line width is calculated by widths[pointIndex] * width
   */
  set width(e) {
    this._width = e, this.setFloat("grlWidth", e);
  }
  /**
   * Whether to use the colors option to colorize the line
   */
  get useColors() {
    return this._useColors;
  }
  set useColors(e) {
    this._useColors = e, this.setFloat("grlUseColors", Qs.BooleanToNumber(e));
  }
  /**
   * The type of sampling of the colors texture. The values are the same when using with textures.
   */
  get colorsSampling() {
    return this._colorsSampling;
  }
  /**
   * The type of sampling of the colors texture. The values are the same when using with textures.
   */
  set colorsSampling(e) {
    this._colorsSampling = e;
  }
  /**
   * Normalized value of how much of the line will be visible
   * 0 - 0% of the line will be visible
   * 1 - 100% of the line will be visible
   */
  get visibility() {
    return this._visibility;
  }
  set visibility(e) {
    this._visibility = e, this.setFloat("grlVisibility", e);
  }
  /**
   * Turns on/off dash mode
   */
  get useDash() {
    return this._useDash;
  }
  /**
   * Turns on/off dash mode
   */
  set useDash(e) {
    this._useDash = e, this.setFloat("grlUseDash", Qs.BooleanToNumber(e));
  }
  /**
   * Gets the dash offset
   */
  get dashOffset() {
    return this._dashOffset;
  }
  /**
   * Sets the dash offset
   */
  set dashOffset(e) {
    this._dashOffset = e, this.setFloat("grlDashOffset", e);
  }
  /**
   * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.
   */
  get dashRatio() {
    return this._dashRatio;
  }
  /**
   * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.
   */
  set dashRatio(e) {
    this._dashRatio = e, this.setFloat("grlDashRatio", e);
  }
  /**
   * Gets the number of dashes in the line
   */
  get dashCount() {
    return this._dashCount;
  }
  /**
   * Sets the number of dashes in the line
   * @param value dash
   */
  set dashCount(e) {
    this._dashCount = e, this._dashArray = 1 / e, this.setFloat("grlDashArray", this._dashArray);
  }
  /**
   * False means 1 unit in width = 1 unit on scene, true means 1 unit in width is reduced on the screen to make better looking lines
   */
  get sizeAttenuation() {
    return this._sizeAttenuation;
  }
  /**
   * Turn on/off attenuation of the width option and widths array.
   * @param value false means 1 unit in width = 1 unit on scene, true means 1 unit in width is reduced on the screen to make better looking lines
   */
  set sizeAttenuation(e) {
    this._sizeAttenuation = e, this.setFloat("grlSizeAttenuation", Qs.BooleanToNumber(e));
  }
  /**
   * Gets the color of the line
   */
  get color() {
    return this.color;
  }
  /**
   * Sets the color of the line
   * @param value Color3
   */
  set color(e) {
    this.setColor(e);
  }
  /**
   * Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.
   * The simple material always needs a color to be set. If you set it to null it will set the color to the default color (GreasedLineSimpleMaterial.DEFAULT_COLOR).
   * @param value color
   */
  setColor(e) {
    e = e ?? D6.DEFAULT_COLOR, this._color = e, this.setColor3("grlColor", e);
  }
  /**
   * Gets the color distributiopn type
   */
  get colorsDistributionType() {
    return this._colorsDistributionType;
  }
  /**
   * Sets the color distribution type
   * @see GreasedLineMeshColorDistributionType
   * @param value color distribution type
   */
  set colorsDistributionType(e) {
    this._colorsDistributionType = e, this._setColorModeAndColorDistributionType();
  }
  /**
   * Gets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.
   * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.
   * @see GreasedLineMeshColorMode
   */
  get colorMode() {
    return this._colorMode;
  }
  /**
   * Sets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.
   * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.
   * @see GreasedLineMeshColorMode
   */
  set colorMode(e) {
    this._colorMode = e, this._setColorModeAndColorDistributionType();
  }
  /**
   * Gets the resolution
   */
  get resolution() {
    return this._resolution;
  }
  /**
   * Sets the resolution
   * @param value resolution of the screen for GreasedLine
   */
  set resolution(e) {
    this._resolution = e, this.setVector2("grlResolution", e), this.setFloat("grlAspect", e.x / e.y);
  }
  /**
   * Serializes this plugin material
   * @returns serializationObjec
   */
  serialize() {
    const e = super.serialize(), t = {
      colorDistributionType: this._colorsDistributionType,
      colorsSampling: this._colorsSampling,
      colorMode: this._colorMode,
      color: this._color,
      dashCount: this._dashCount,
      dashOffset: this._dashOffset,
      dashRatio: this._dashRatio,
      resolution: this._resolution,
      sizeAttenuation: this._sizeAttenuation,
      useColors: this._useColors,
      useDash: this._useDash,
      visibility: this._visibility,
      width: this._width,
      cameraFacing: this._cameraFacing
    };
    return this._colors && (t.colors = this._colors), e.greasedLineMaterialOptions = t, e;
  }
  /**
   * Parses a serialized objects
   * @param source serialized object
   * @param scene scene
   * @param _rootUrl root url for textures
   */
  parse(e, t, r) {
    var n, i;
    const s = e.greasedLineMaterialOptions;
    (n = this._colorsTexture) === null || n === void 0 || n.dispose(), s.color && (this.color = s.color), s.colorDistributionType && (this.colorsDistributionType = s.colorDistributionType), s.colorsSampling && (this.colorsSampling = s.colorsSampling), s.colorMode && (this.colorMode = s.colorMode), s.useColors && (this.useColors = s.useColors), s.visibility && (this.visibility = s.visibility), s.useDash && (this.useDash = s.useDash), s.dashCount && (this.dashCount = s.dashCount), s.dashRatio && (this.dashRatio = s.dashRatio), s.dashOffset && (this.dashOffset = s.dashOffset), s.width && (this.width = s.width), s.sizeAttenuation && (this.sizeAttenuation = s.sizeAttenuation), s.resolution && (this.resolution = s.resolution), s.colors ? this.colorsTexture = Qs.CreateColorsTexture(`${this.name}-colors-texture`, s.colors, this.colorsSampling, this.getScene()) : this.colorsTexture = Qs.PrepareEmptyColorsTexture(t), this._cameraFacing = (i = s.cameraFacing) !== null && i !== void 0 ? i : !0, this.setDefine("GREASED_LINE_CAMERA_FACING", this._cameraFacing);
  }
}
const uhe = `#if defined(DBG_ENABLED)
attribute float dbg_initialPass;
varying vec3 dbg_vBarycentric;
flat varying vec3 dbg_vVertexWorldPos;
flat varying float dbg_vPass;
#endif`, lhe = `#if defined(DBG_ENABLED)
float dbg_vertexIndex = mod(float(gl_VertexID), 3.);
if (dbg_vertexIndex == 0.0) { 
    dbg_vBarycentric = vec3(1.,0.,0.); 
}
else if (dbg_vertexIndex == 1.0) { 
    dbg_vBarycentric = vec3(0.,1.,0.); 
}
else { 
    dbg_vBarycentric = vec3(0.,0.,1.); 
}

dbg_vVertexWorldPos = vPositionW;
dbg_vPass = dbg_initialPass;
#endif`, Phe = `#if defined(DBG_ENABLED)
uniform vec3 dbg_shadedDiffuseColor;
uniform vec4 dbg_shadedSpecularColorPower;
uniform vec3 dbg_thicknessRadiusScale;

#if DBG_MODE == 2 || DBG_MODE == 3
    uniform vec3 dbg_vertexColor;
#endif

#if DBG_MODE == 1
    uniform vec3 dbg_wireframeTrianglesColor;
#elif DBG_MODE == 3
    uniform vec3 dbg_wireframeVerticesColor;
#elif DBG_MODE == 4 || DBG_MODE == 5
    uniform vec3 dbg_uvPrimaryColor;
    uniform vec3 dbg_uvSecondaryColor;
#elif DBG_MODE == 7
    uniform vec3 dbg_materialColor;
#endif
#endif`, che = `#if defined(DBG_ENABLED)
varying vec3 dbg_vBarycentric;
flat varying vec3 dbg_vVertexWorldPos;
flat varying float dbg_vPass;

#if !defined(DBG_MULTIPLY)
    vec3 dbg_applyShading(vec3 color) {
        vec3 N = vNormalW.xyz;
        vec3 L = normalize(vEyePosition.xyz - vPositionW.xyz);
        vec3 H = normalize(L + L);
        float LdotN = clamp(dot(L,N), 0., 1.);
        float HdotN = clamp(dot(H,N), 0., 1.);
        float specTerm = pow(HdotN, dbg_shadedSpecularColorPower.w);
        color *= (LdotN / PI);
        color += dbg_shadedSpecularColorPower.rgb * (specTerm / PI);
        return color;
    }
#endif

#if DBG_MODE == 1 || DBG_MODE == 3
    float dbg_edgeFactor() {
        vec3 d = fwidth(dbg_vBarycentric);
        vec3 a3 = smoothstep(vec3(0.), d * dbg_thicknessRadiusScale.x, dbg_vBarycentric);
        return min(min(a3.x, a3.y), a3.z);
    }
#endif

#if DBG_MODE == 2 || DBG_MODE == 3
    float dbg_cornerFactor() {
        vec3 worldPos = vPositionW;
        float dist = length(worldPos - dbg_vVertexWorldPos);
        float camDist = length(worldPos - vEyePosition.xyz);
        float d = sqrt(camDist) * .001;
        return smoothstep((dbg_thicknessRadiusScale.y * d), ((dbg_thicknessRadiusScale.y * 1.01) * d), dist);
    }
#endif

#if (DBG_MODE == 4 && defined(UV1)) || (DBG_MODE == 5 && defined(UV2))
    float dbg_checkerboardFactor(vec2 uv) {
        vec2 f = fract(uv * dbg_thicknessRadiusScale.z);
        f -= .5;
        return (f.x * f.y) > 0. ? 1. : 0.;
    }
#endif
#endif`, phe = `#if defined(DBG_ENABLED)
vec3 dbg_color = vec3(1.);
#if DBG_MODE == 1
    dbg_color = mix(dbg_wireframeTrianglesColor, vec3(1.), dbg_edgeFactor());
#elif DBG_MODE == 2 || DBG_MODE == 3
    float dbg_cornerFactor = dbg_cornerFactor();
    if (dbg_vPass == 0. && dbg_cornerFactor == 1.) discard;
    dbg_color = mix(dbg_vertexColor, vec3(1.), dbg_cornerFactor);
    #if DBG_MODE == 3
        dbg_color *= mix(dbg_wireframeVerticesColor, vec3(1.), dbg_edgeFactor());
    #endif
#elif DBG_MODE == 4 && defined(UV1)
    dbg_color = mix(dbg_uvPrimaryColor, dbg_uvSecondaryColor, dbg_checkerboardFactor(vMainUV1));
#elif DBG_MODE == 5 && defined(UV2)
    dbg_color = mix(dbg_uvPrimaryColor, dbg_uvSecondaryColor, dbg_checkerboardFactor(vMainUV2));
#elif DBG_MODE == 6 && defined(VERTEXCOLOR)
    dbg_color = vColor.rgb;
#elif DBG_MODE == 7
    dbg_color = dbg_materialColor;
#endif

#if defined(DBG_MULTIPLY)
    gl_FragColor *= vec4(dbg_color, 1.);
#else
    #if DBG_MODE != 6
        gl_FragColor = vec4(dbg_applyShading(dbg_shadedDiffuseColor) * dbg_color, 1.);
    #else
        gl_FragColor = vec4(dbg_color, 1.);
    #endif
#endif
#endif`, lne = [
  new Ne(0.98, 0.26, 0.38),
  new Ne(0.47, 0.75, 0.3),
  new Ne(0, 0.26, 0.77),
  new Ne(0.97, 0.6, 0.76),
  new Ne(0.19, 0.63, 0.78),
  new Ne(0.98, 0.8, 0.6),
  new Ne(0.65, 0.43, 0.15),
  new Ne(0.15, 0.47, 0.22),
  new Ne(0.67, 0.71, 0.86),
  new Ne(0.09, 0.46, 0.56),
  new Ne(0.8, 0.98, 0.02),
  new Ne(0.39, 0.29, 0.13),
  new Ne(0.53, 0.63, 0.06),
  new Ne(0.95, 0.96, 0.41),
  new Ne(1, 0.72, 0.94),
  new Ne(0.63, 0.08, 0.31),
  new Ne(0.66, 0.96, 0.95),
  new Ne(0.22, 0.14, 0.19),
  new Ne(0.14, 0.65, 0.59),
  new Ne(0.93, 1, 0.68),
  new Ne(0.93, 0.14, 0.44),
  new Ne(0.47, 0.86, 0.67),
  new Ne(0.85, 0.07, 0.78),
  new Ne(0.53, 0.64, 0.98),
  new Ne(0.43, 0.37, 0.56),
  new Ne(0.71, 0.65, 0.25),
  new Ne(0.66, 0.19, 0.01),
  new Ne(0.94, 0.53, 0.12),
  new Ne(0.41, 0.44, 0.44),
  new Ne(0.24, 0.71, 0.96),
  new Ne(0.57, 0.28, 0.56),
  new Ne(0.44, 0.98, 0.42)
];
var im;
(function(A) {
  A[A.NONE = 0] = "NONE", A[A.TRIANGLES = 1] = "TRIANGLES", A[A.VERTICES = 2] = "VERTICES", A[A.TRIANGLES_VERTICES = 3] = "TRIANGLES_VERTICES", A[A.UV0 = 4] = "UV0", A[A.UV1 = 5] = "UV1", A[A.VERTEXCOLORS = 6] = "VERTEXCOLORS", A[A.MATERIALIDS = 7] = "MATERIALIDS";
})(im || (im = {}));
class hhe extends na {
  constructor() {
    super(...arguments), this.DBG_MODE = im.NONE, this.DBG_MULTIPLY = !0, this.DBG_ENABLED = !0;
  }
}
class Q9 extends Gl {
  /** @internal */
  _markAllDefinesAsDirty() {
    this._enable(this._isEnabled), this.markAllDefinesAsDirty();
  }
  /**
   * Creates a new MeshDebugPluginMaterial
   * @param material Material to attach the mesh debug plugin to
   * @param options Options for the mesh debug plugin
   */
  constructor(e, t = {}) {
    var r, n, i, s, a, f, o, d, v, u, l, P, p;
    const c = new hhe();
    c.DBG_MODE = (r = t.mode) !== null && r !== void 0 ? r : c.DBG_MODE, c.DBG_MULTIPLY = (n = t.multiply) !== null && n !== void 0 ? n : c.DBG_MULTIPLY, super(e, "MeshDebug", 200, c, !0, !0), this._mode = c.DBG_MODE, this._multiply = c.DBG_MULTIPLY, this.shadedDiffuseColor = (i = t.shadedDiffuseColor) !== null && i !== void 0 ? i : new Ne(1, 1, 1), this.shadedSpecularColor = (s = t.shadedSpecularColor) !== null && s !== void 0 ? s : new Ne(0.8, 0.8, 0.8), this.shadedSpecularPower = (a = t.shadedSpecularPower) !== null && a !== void 0 ? a : 10, this.wireframeThickness = (f = t.wireframeThickness) !== null && f !== void 0 ? f : 0.7, this.wireframeTrianglesColor = (o = t.wireframeTrianglesColor) !== null && o !== void 0 ? o : new Ne(0, 0, 0), this.wireframeVerticesColor = (d = t.wireframeVerticesColor) !== null && d !== void 0 ? d : new Ne(0.8, 0.8, 0.8), this.vertexColor = (v = t.vertexColor) !== null && v !== void 0 ? v : new Ne(0, 0, 0), this.vertexRadius = (u = t.vertexRadius) !== null && u !== void 0 ? u : 1.2, this.uvScale = (l = t.uvScale) !== null && l !== void 0 ? l : 20, this.uvPrimaryColor = (P = t.uvPrimaryColor) !== null && P !== void 0 ? P : new Ne(1, 1, 1), this.uvSecondaryColor = (p = t.uvSecondaryColor) !== null && p !== void 0 ? p : new Ne(0.5, 0.5, 0.5), this._materialColor = Q9.MaterialColors[Q9._PluginCount++ % Q9.MaterialColors.length], this.isEnabled = !0;
  }
  /**
   * Get the class name
   * @returns Class name
   */
  getClassName() {
    return "MeshDebugPluginMaterial";
  }
  /**
   * Gets whether the mesh debug plugin is enabled in the material.
   */
  get isEnabled() {
    return this._isEnabled;
  }
  /**
   * Sets whether the mesh debug plugin is enabled in the material.
   * @param value enabled
   */
  set isEnabled(e) {
    if (this._isEnabled !== e) {
      if (!this._material.getScene().getEngine().isWebGPU && this._material.getScene().getEngine().webGLVersion == 1) {
        Se.Error("MeshDebugPluginMaterial is not supported on WebGL 1.0."), this._isEnabled = !1;
        return;
      }
      this._isEnabled = e, this._markAllDefinesAsDirty();
    }
  }
  /**
   * Prepare the defines
   * @param defines Mesh debug defines
   * @param scene Scene
   * @param mesh Mesh associated with material
   */
  prepareDefines(e, t, r) {
    (this._mode == im.VERTICES || this._mode == im.TRIANGLES || this._mode == im.TRIANGLES_VERTICES) && !r.isVerticesDataPresent("dbg_initialPass") && Se.Warn("For best results with TRIANGLES, TRIANGLES_VERTICES, or VERTICES modes, please use MeshDebugPluginMaterial.PrepareMeshForTrianglesAndVerticesMode() on mesh.", 1), e.DBG_MODE = this._mode, e.DBG_MULTIPLY = this._multiply, e.DBG_ENABLED = this._isEnabled;
  }
  /**
   * Get the shader attributes
   * @param attributes Array of attributes
   */
  getAttributes(e) {
    e.push("dbg_initialPass");
  }
  /**
   * Get the shader uniforms
   * @returns Uniforms
   */
  getUniforms() {
    return {
      ubo: [
        { name: "dbg_shadedDiffuseColor", size: 3, type: "vec3" },
        { name: "dbg_shadedSpecularColorPower", size: 4, type: "vec4" },
        { name: "dbg_thicknessRadiusScale", size: 3, type: "vec3" },
        { name: "dbg_wireframeTrianglesColor", size: 3, type: "vec3" },
        { name: "dbg_wireframeVerticesColor", size: 3, type: "vec3" },
        { name: "dbg_vertexColor", size: 3, type: "vec3" },
        { name: "dbg_uvPrimaryColor", size: 3, type: "vec3" },
        { name: "dbg_uvSecondaryColor", size: 3, type: "vec3" },
        { name: "dbg_materialColor", size: 3, type: "vec3" }
      ],
      fragment: Phe
    };
  }
  /**
   * Bind the uniform buffer
   * @param uniformBuffer Uniform buffer
   */
  bindForSubMesh(e) {
    this._isEnabled && (e.updateFloat3("dbg_shadedDiffuseColor", this.shadedDiffuseColor.r, this.shadedDiffuseColor.g, this.shadedDiffuseColor.b), e.updateFloat4("dbg_shadedSpecularColorPower", this.shadedSpecularColor.r, this.shadedSpecularColor.g, this.shadedSpecularColor.b, this.shadedSpecularPower), e.updateFloat3("dbg_thicknessRadiusScale", this.wireframeThickness, this.vertexRadius, this.uvScale), e.updateColor3("dbg_wireframeTrianglesColor", this.wireframeTrianglesColor), e.updateColor3("dbg_wireframeVerticesColor", this.wireframeVerticesColor), e.updateColor3("dbg_vertexColor", this.vertexColor), e.updateColor3("dbg_uvPrimaryColor", this.uvPrimaryColor), e.updateColor3("dbg_uvSecondaryColor", this.uvSecondaryColor), e.updateColor3("dbg_materialColor", this._materialColor));
  }
  /**
   * Get shader code
   * @param shaderType "vertex" or "fragment"
   * @returns Shader code
   */
  getCustomCode(e) {
    return e === "vertex" ? {
      CUSTOM_VERTEX_DEFINITIONS: uhe,
      CUSTOM_VERTEX_MAIN_END: lhe
    } : {
      CUSTOM_FRAGMENT_DEFINITIONS: che,
      CUSTOM_FRAGMENT_MAIN_END: phe
    };
  }
  /**
   * Resets static variables of the plugin to their original state
   */
  static Reset() {
    this._PluginCount = 0, this.MaterialColors = lne;
  }
  /**
   * Renders triangles in a mesh 3 times by tripling the indices in the index buffer.
   * Used to prepare a mesh to be rendered in `TRIANGLES`, `VERTICES`, or `TRIANGLES_VERTICES` modes.
   * NOTE: This is a destructive operation. The mesh's index buffer and vertex buffers are modified, and a new vertex buffer is allocated.
   * If you'd like the ability to revert these changes, toggle the optional `returnRollback` flag.
   * @param mesh the mesh to target
   * @param returnRollback whether or not to return a function that reverts mesh to its initial state. Default: false.
   * @returns a rollback function if `returnRollback` is true, otherwise an empty function.
   */
  static PrepareMeshForTrianglesAndVerticesMode(e, t = !1) {
    let r = () => {
    };
    if (e.getTotalIndices() == 0)
      return r;
    if (t) {
      const d = e.getVerticesDataKinds(), v = e.getIndices(), u = {};
      for (const l of d)
        u[l] = e.getVerticesData(l);
      r = function() {
        e.setIndices(v);
        for (const l of d) {
          const P = e.getVertexBuffer(l).getStrideSize();
          e.setVerticesData(l, u[l], void 0, P);
        }
        e.removeVerticesData("dbg_initialPass");
      };
    }
    let n = Array.from(e.getIndices());
    const i = [];
    for (let d = 0; d < n.length; d += 3)
      i.push(n[d + 1], n[d + 2], n[d + 0]);
    e.setIndices(n.concat(i)), e.convertToUnIndexedMesh(), e.isUnIndexed = !1, n = Array.from(e.getIndices());
    const s = [];
    for (let d = n.length / 2; d < n.length; d += 3)
      s.push(n[d + 1], n[d + 2], n[d + 0]);
    e.setIndices(n.concat(s));
    const a = e.getTotalVertices(), f = a / 2, o = new Array(a).fill(1, 0, f).fill(0, f, a);
    return e.setVerticesData("dbg_initialPass", o, !1, 1), r;
  }
}
Q9._PluginCount = 0;
Q9.MaterialColors = lne;
C([
  Oi()
], Q9.prototype, "_materialColor", void 0);
C([
  M()
], Q9.prototype, "_isEnabled", void 0);
C([
  M(),
  At("_markAllDefinesAsDirty")
], Q9.prototype, "mode", void 0);
C([
  M(),
  At("_markAllDefinesAsDirty")
], Q9.prototype, "multiply", void 0);
C([
  Oi()
], Q9.prototype, "shadedDiffuseColor", void 0);
C([
  Oi()
], Q9.prototype, "shadedSpecularColor", void 0);
C([
  M()
], Q9.prototype, "shadedSpecularPower", void 0);
C([
  M()
], Q9.prototype, "wireframeThickness", void 0);
C([
  Oi()
], Q9.prototype, "wireframeTrianglesColor", void 0);
C([
  Oi()
], Q9.prototype, "wireframeVerticesColor", void 0);
C([
  Oi()
], Q9.prototype, "vertexColor", void 0);
C([
  M()
], Q9.prototype, "vertexRadius", void 0);
C([
  M()
], Q9.prototype, "uvScale", void 0);
C([
  Oi()
], Q9.prototype, "uvPrimaryColor", void 0);
C([
  Oi()
], Q9.prototype, "uvSecondaryColor", void 0);
Ue("BABYLON.MeshDebugPluginMaterial", Q9);
Object.defineProperty(Wt.prototype, "decalMap", {
  get: function() {
    if (!this._decalMap) {
      if (this._uniformBufferLayoutBuilt)
        return null;
      this._decalMap = new cU(this);
    }
    return this._decalMap;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(fs.prototype, "decalMap", {
  get: function() {
    if (!this._decalMap) {
      if (this._uniformBufferLayoutBuilt)
        return null;
      this._decalMap = new cU(this);
    }
    return this._decalMap;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(jn.prototype, "decalMap", {
  get: function() {
    return this._decalMap;
  },
  set: function(A) {
    this._decalMap = A;
  },
  enumerable: !0,
  configurable: !0
});
class g0 {
  /**
   * Creates a new Polar object
   * @param radius the radius of the vector
   * @param theta the angle of the vector
   */
  constructor(e, t) {
    this.radius = e, this.theta = t;
  }
  /**
   * Gets the class name
   * @returns the string "Polar"
   */
  getClassName() {
    return "Polar";
  }
  /**
   * Converts the current polar to a string
   * @returns the current polar as a string
   */
  toString() {
    return JSON.stringify(this);
  }
  /**
   * Converts the current polar to an array
   * @reutrns the current polar as an array
   */
  asArray() {
    return [this.radius, this.theta];
  }
  /**
   * Adds the current Polar and the given Polar and stores the result
   * @param polar the polar to add
   * @param ref the polar to store the result in
   * @returns the updated ref
   */
  addToRef(e, t) {
    return t.radius = this.radius + e.radius, t.theta = this.theta + e.theta, t;
  }
  /**
   * Adds the current Polar and the given Polar
   * @param polar the polar to add
   * @returns the sum polar
   */
  add(e) {
    const t = new g0(0, 0);
    return this.addToRef(e, t), t;
  }
  /**
   * Adds the given polar to the current polar
   * @param polar the polar to add
   * @returns the current polar
   */
  addInPlace(e) {
    return this.addToRef(e, this), this;
  }
  /**
   * Adds the provided values to the current polar
   * @param radius the amount to add to the radius
   * @param theta the amount to add to the theta
   * @returns the current polar
   */
  addInPlaceFromFloats(e, t) {
    return this.radius += e, this.theta += t, this;
  }
  /**
   * Subtracts the given Polar from the current Polar and stores the result
   * @param polar the polar to subtract
   * @param ref the polar to store the result in
   * @returns the updated ref
   */
  subtractToRef(e, t) {
    return t.radius = this.radius - e.radius, t.theta = this.theta - e.theta, t;
  }
  /**
   * Subtracts the given Polar from the current Polar
   * @param polar the polar to subtract
   * @returns the difference polar
   */
  subtract(e) {
    const t = new g0(0, 0);
    return this.subtractToRef(e, t), t;
  }
  /**
   * Subtracts the given Polar from the current Polar
   * @param polar the polar to subtract
   * @returns the current polar
   */
  subtractInPlace(e) {
    return this.subtractToRef(e, this), this;
  }
  /**
   * Subtracts the given floats from the current polar
   * @param radius the amount to subtract from the radius
   * @param theta the amount to subtract from the theta
   * @param ref the polar to store the result in
   * @returns the updated ref
   */
  subtractFromFloatsToRef(e, t, r) {
    return r.radius = this.radius - e, r.theta = this.theta - t, r;
  }
  /**
   * Subtracts the given floats from the current polar
   * @param radius the amount to subtract from the radius
   * @param theta the amount to subtract from the theta
   * @returns the difference polar
   */
  subtractFromFloats(e, t) {
    const r = new g0(0, 0);
    return this.subtractFromFloatsToRef(e, t, r), r;
  }
  /**
   * Multiplies the given Polar with the current Polar and stores the result
   * @param polar the polar to multiply
   * @param ref the polar to store the result in
   * @returns the updated ref
   */
  multiplyToRef(e, t) {
    return t.radius = this.radius * e.radius, t.theta = this.theta * e.theta, t;
  }
  /**
   * Multiplies the given Polar with the current Polar
   * @param polar the polar to multiply
   * @returns the product polar
   */
  multiply(e) {
    const t = new g0(0, 0);
    return this.multiplyToRef(e, t), t;
  }
  /**
   * Multiplies the given Polar with the current Polar
   * @param polar the polar to multiply
   * @returns the current polar
   */
  multiplyInPlace(e) {
    return this.multiplyToRef(e, this), this;
  }
  /**
   * Divides the current Polar by the given Polar and stores the result
   * @param polar the polar to divide
   * @param ref the polar to store the result in
   * @returns the updated ref
   */
  divideToRef(e, t) {
    return t.radius = this.radius / e.radius, t.theta = this.theta / e.theta, t;
  }
  /**
   * Divides the current Polar by the given Polar
   * @param polar the polar to divide
   * @returns the quotient polar
   */
  divide(e) {
    const t = new g0(0, 0);
    return this.divideToRef(e, t), t;
  }
  /**
   * Divides the current Polar by the given Polar
   * @param polar the polar to divide
   * @returns the current polar
   */
  divideInPlace(e) {
    return this.divideToRef(e, this), this;
  }
  /**
   * Clones the current polar
   * @returns a clone of the current polar
   */
  clone() {
    return new g0(this.radius, this.theta);
  }
  /**
   * Copies the source polar into the current polar
   * @param source the polar to copy from
   * @returns the current polar
   */
  copyFrom(e) {
    return this.radius = e.radius, this.theta = e.theta, this;
  }
  /**
   * Copies the given values into the current polar
   * @param radius the radius to use
   * @param theta the theta to use
   * @returns the current polar
   */
  copyFromFloats(e, t) {
    return this.radius = e, this.theta = t, this;
  }
  /**
   * Scales the current polar and stores the result
   * @param scale defines the multiplication factor
   * @param ref where to store the result
   * @returns the updated ref
   */
  scaleToRef(e, t) {
    return t.radius = this.radius * e, t.theta = this.theta * e, t;
  }
  /**
   * Scales the current polar and returns a new polar with the scaled coordinates
   * @param scale defines the multiplication factor
   * @returns the scaled polar
   */
  scale(e) {
    const t = new g0(0, 0);
    return this.scaleToRef(e, t), t;
  }
  /**
   * Scales the current polar
   * @param scale defines the multiplication factor
   * @returns the current polar
   */
  scaleInPlace(e) {
    return this.scaleToRef(e, this), this;
  }
  /**
   * Sets the values of the current polar
   * @param radius the new radius
   * @param theta the new theta
   * @returns the current polar
   */
  set(e, t) {
    return this.radius = e, this.theta = t, this;
  }
  /**
   * Sets the values of the current polar
   * @param value the new values
   * @returns the current polar
   */
  setAll(e) {
    return this.set(e, e), this;
  }
  /**
   * Gets the rectangular coordinates of the current Polar
   * @param ref the reference to assign the result
   * @returns the updated reference
   */
  toVector2ToRef(e) {
    const t = this.radius * Math.cos(this.theta), r = this.radius * Math.sin(this.theta);
    return e.set(t, r), e;
  }
  /**
   * Gets the rectangular coordinates of the current Polar
   * @returns the rectangular coordinates
   */
  toVector2() {
    const e = new at(0, 0);
    return this.toVector2ToRef(e);
  }
  /**
   * Converts a given Vector2 to its polar coordinates
   * @param v the Vector2 to convert
   * @param ref the reference to assign the result
   * @returns the updated reference
   */
  static FromVector2ToRef(e, t) {
    const r = Math.sign(e.y) * Math.acos(e.x / e.length());
    return t.radius = e.length(), t.theta = r, t;
  }
  /**
   * Converts a given Vector2 to its polar coordinates
   * @param v the Vector2 to convert
   * @returns a Polar
   */
  static FromVector2(e) {
    const t = new g0(0, 0);
    return g0.FromVector2ToRef(e, t), t;
  }
  /**
   * Converts an array of floats to a polar
   * @param array the array to convert
   * @returns the converted polar
   */
  static FromArray(e) {
    return new g0(e[0], e[1]);
  }
}
class X0 {
  /**
   * @param radius spherical radius
   * @param theta angle from positive y axis to radial line from 0 to PI (vertical)
   * @param phi angle from positive x axis measured anticlockwise from -PI to PI (horizontal)
   */
  constructor(e, t, r) {
    this.radius = e, this.theta = t, this.phi = r;
  }
  /**
   * Gets the class name
   * @returns the string "Spherical"
   */
  getClassName() {
    return "Spherical";
  }
  /**
   * Converts the current spherical to a string
   * @returns the current spherical as a string
   */
  toString() {
    return JSON.stringify(this);
  }
  /**
   * Converts the current spherical to an array
   * @reutrns the current spherical as an array
   */
  asArray() {
    return [this.radius, this.theta, this.phi];
  }
  /**
   * Adds the current Spherical and the given Spherical and stores the result
   * @param spherical the spherical to add
   * @param ref the spherical to store the result in
   * @returns the updated ref
   */
  addToRef(e, t) {
    return t.radius = this.radius + e.radius, t.theta = this.theta + e.theta, t.phi = this.phi + e.phi, t;
  }
  /**
   * Adds the current Spherical and the given Spherical
   * @param spherical the spherical to add
   * @returns the sum spherical
   */
  add(e) {
    const t = new X0(0, 0, 0);
    return this.addToRef(e, t), t;
  }
  /**
   * Adds the given spherical to the current spherical
   * @param spherical the spherical to add
   * @returns the current spherical
   */
  addInPlace(e) {
    return this.addToRef(e, this), this;
  }
  /**
   * Adds the provided values to the current spherical
   * @param radius the amount to add to the radius
   * @param theta the amount to add to the theta
   * @param phi the amount to add to the phi
   * @returns the current spherical
   */
  addInPlaceFromFloats(e, t, r) {
    return this.radius += e, this.theta += t, this.phi += r, this;
  }
  /**
   * Subtracts the given Spherical from the current Spherical and stores the result
   * @param spherical the spherical to subtract
   * @param ref the spherical to store the result in
   * @returns the updated ref
   */
  subtractToRef(e, t) {
    return t.radius = this.radius - e.radius, t.theta = this.theta - e.theta, t.phi = this.phi - e.phi, t;
  }
  /**
   * Subtracts the given Spherical from the current Spherical
   * @param spherical the spherical to subtract
   * @returns the difference spherical
   */
  subtract(e) {
    const t = new X0(0, 0, 0);
    return this.subtractToRef(e, t), t;
  }
  /**
   * Subtracts the given Spherical from the current Spherical
   * @param spherical the spherical to subtract
   * @returns the current spherical
   */
  subtractInPlace(e) {
    return this.subtractToRef(e, this), this;
  }
  /**
   * Subtracts the given floats from the current spherical
   * @param radius the amount to subtract from the radius
   * @param theta the amount to subtract from the theta
   * @param phi the amount to subtract from the phi
   * @param ref the spherical to store the result in
   * @returns the updated ref
   */
  subtractFromFloatsToRef(e, t, r, n) {
    return n.radius = this.radius - e, n.theta = this.theta - t, n.phi = this.phi - r, n;
  }
  /**
   * Subtracts the given floats from the current spherical
   * @param radius the amount to subtract from the radius
   * @param theta the amount to subtract from the theta
   * @param phi the amount to subtract from the phi
   * @returns the difference spherical
   */
  subtractFromFloats(e, t, r) {
    const n = new X0(0, 0, 0);
    return this.subtractFromFloatsToRef(e, t, r, n), n;
  }
  /**
   * Multiplies the given Spherical with the current Spherical and stores the result
   * @param spherical the spherical to multiply
   * @param ref the spherical to store the result in
   * @returns the updated ref
   */
  multiplyToRef(e, t) {
    return t.radius = this.radius * e.radius, t.theta = this.theta * e.theta, t.phi = this.phi * e.phi, t;
  }
  /**
   * Multiplies the given Spherical with the current Spherical
   * @param spherical the spherical to multiply
   * @returns the product spherical
   */
  multiply(e) {
    const t = new X0(0, 0, 0);
    return this.multiplyToRef(e, t), t;
  }
  /**
   * Multiplies the given Spherical with the current Spherical
   * @param spherical the spherical to multiply
   * @returns the current spherical
   */
  multiplyInPlace(e) {
    return this.multiplyToRef(e, this), this;
  }
  /**
   * Divides the current Spherical by the given Spherical and stores the result
   * @param spherical the spherical to divide
   * @param ref the spherical to store the result in
   * @returns the updated ref
   */
  divideToRef(e, t) {
    return t.radius = this.radius / e.radius, t.theta = this.theta / e.theta, t.phi = this.phi / e.phi, t;
  }
  /**
   * Divides the current Spherical by the given Spherical
   * @param spherical the spherical to divide
   * @returns the quotient spherical
   */
  divide(e) {
    const t = new X0(0, 0, 0);
    return this.divideToRef(e, t), t;
  }
  /**
   * Divides the current Spherical by the given Spherical
   * @param spherical the spherical to divide
   * @returns the current spherical
   */
  divideInPlace(e) {
    return this.divideToRef(e, this), this;
  }
  /**
   * Clones the current spherical
   * @returns a clone of the current spherical
   */
  clone() {
    return new X0(this.radius, this.theta, this.phi);
  }
  /**
   * Copies the source spherical into the current spherical
   * @param source the spherical to copy from
   * @returns the current spherical
   */
  copyFrom(e) {
    return this.radius = e.radius, this.theta = e.theta, this.phi = e.phi, this;
  }
  /**
   * Copies the given values into the current spherical
   * @param radius the radius to use
   * @param theta the theta to use
   * @param phi the phi to use
   * @returns the current spherical
   */
  copyFromFloats(e, t, r) {
    return this.radius = e, this.theta = t, this.phi = r, this;
  }
  /**
   * Scales the current spherical and stores the result
   * @param scale defines the multiplication factor
   * @param ref where to store the result
   * @returns the updated ref
   */
  scaleToRef(e, t) {
    return t.radius = this.radius * e, t.theta = this.theta * e, t.phi = this.phi * e, t;
  }
  /**
   * Scales the current spherical and returns a new spherical with the scaled coordinates
   * @param scale defines the multiplication factor
   * @returns the scaled spherical
   */
  scale(e) {
    const t = new X0(0, 0, 0);
    return this.scaleToRef(e, t), t;
  }
  /**
   * Scales the current spherical
   * @param scale defines the multiplication factor
   * @returns the current spherical
   */
  scaleInPlace(e) {
    return this.scaleToRef(e, this), this;
  }
  /**
   * Sets the values of the current spherical
   * @param radius the new radius
   * @param theta the new theta
   * @param phi the new phi
   * @returns the current spherical
   */
  set(e, t, r) {
    return this.radius = e, this.theta = t, this.phi = r, this;
  }
  /**
   * Sets the values of the current spherical
   * @param value the new values
   * @returns the current spherical
   */
  setAll(e) {
    return this.set(e, e, e), this;
  }
  /**
   * Assigns the rectangular coordinates of the current Spherical to a Vector3
   * @param ref the Vector3 to update
   * @returns the updated Vector3
   */
  toVector3ToRef(e) {
    const t = this.radius * Math.sin(this.theta) * Math.cos(this.phi), r = this.radius * Math.cos(this.theta), n = this.radius * Math.sin(this.theta) * Math.sin(this.phi);
    return e.set(t, r, n), e;
  }
  /**
   * Gets a Vector3 from the current spherical coordinates
   * @returns the (x, y,z) form of the current Spherical
   */
  toVector3() {
    const e = new S(0, 0, 0);
    return this.toVector3ToRef(e);
  }
  /**
   * Assigns the spherical coordinates from a Vector3
   * @param vector the vector to convert
   * @param ref the Spherical to update
   * @returns the updated ref
   */
  static FromVector3ToRef(e, t) {
    return t.radius = e.length(), t.theta = Math.acos(e.y / t.radius), t.phi = Math.atan2(e.z, e.x), t;
  }
  /**
   * Gets a Spherical from a Vector3
   * @param vector defines the vector in (x, y, z) coordinate space
   * @returns a new Spherical
   */
  static FromVector3(e) {
    const t = new X0(0, 0, 0);
    return X0.FromVector3ToRef(e, t), t;
  }
  /**
   * Converts an array of floats to a spherical
   * @param array the array to convert
   * @returns the converted spherical
   */
  static FromArray(e) {
    return new X0(e[0], e[1], e[2]);
  }
}
function Hhe(A) {
  return new Promise((e) => {
    DracoDecoderModule({ wasmBinary: A }).then((t) => {
      e({ module: t });
    });
  });
}
function TF(A, e, t, r, n) {
  let i = null, s = null, a = null;
  try {
    i = new A.Decoder(), s = new A.DecoderBuffer(), s.Init(e, e.byteLength);
    let f;
    const o = i.GetEncodedGeometryType(s);
    switch (o) {
      case A.TRIANGULAR_MESH: {
        const u = new A.Mesh();
        if (f = i.DecodeBufferToMesh(s, u), !f.ok() || u.ptr === 0)
          throw new Error(f.error_msg());
        const P = u.num_faces() * 3, p = P * 4, c = A._malloc(p);
        try {
          i.GetTrianglesUInt32Array(u, p, c);
          const H = new Uint32Array(P);
          H.set(new Uint32Array(A.HEAPF32.buffer, c, P)), r(H);
        } finally {
          A._free(c);
        }
        a = u;
        break;
      }
      case A.POINT_CLOUD: {
        const u = new A.PointCloud();
        if (f = i.DecodeBufferToPointCloud(s, u), !f.ok() || !u.ptr)
          throw new Error(f.error_msg());
        a = u;
        break;
      }
      default:
        throw new Error(`Invalid geometry type ${o}`);
    }
    const d = a.num_points(), v = (u, l, P, p) => {
      const c = p.data_type(), H = p.num_components(), T = p.normalized(), q = p.byte_stride(), b = p.byte_offset(), w = {
        [A.DT_FLOAT32]: { typedArrayConstructor: Float32Array, heap: A.HEAPF32 },
        [A.DT_INT8]: { typedArrayConstructor: Int8Array, heap: A.HEAP8 },
        [A.DT_INT16]: { typedArrayConstructor: Int16Array, heap: A.HEAP16 },
        [A.DT_INT32]: { typedArrayConstructor: Int32Array, heap: A.HEAP32 },
        [A.DT_UINT8]: { typedArrayConstructor: Uint8Array, heap: A.HEAPU8 },
        [A.DT_UINT16]: { typedArrayConstructor: Uint16Array, heap: A.HEAPU16 },
        [A.DT_UINT32]: { typedArrayConstructor: Uint32Array, heap: A.HEAPU32 }
      }[c];
      if (!w)
        throw new Error(`Invalid data type ${c}`);
      const m = d * H, I = m * w.typedArrayConstructor.BYTES_PER_ELEMENT, N = A._malloc(I);
      try {
        u.GetAttributeDataArrayForAllPoints(l, p, c, I, N);
        const k = new w.typedArrayConstructor(w.heap.buffer, N, m);
        n(P, k.slice(), H, b, q, T);
      } finally {
        A._free(N);
      }
    };
    if (t)
      for (const u in t) {
        const l = t[u], P = i.GetAttributeByUniqueId(a, l);
        v(i, a, u, P);
      }
    else {
      const u = {
        position: A.POSITION,
        normal: A.NORMAL,
        color: A.COLOR,
        uv: A.TEX_COORD
      };
      for (const l in u) {
        const P = i.GetAttributeId(a, u[l]);
        if (P !== -1) {
          const p = i.GetAttribute(a, P);
          v(i, a, l, p);
        }
      }
    }
    return d;
  } finally {
    a && A.destroy(a), s && A.destroy(s), i && A.destroy(i);
  }
}
function ghe() {
  let A;
  onmessage = (e) => {
    const t = e.data;
    switch (t.id) {
      case "init": {
        const r = t.decoder;
        r.url && (importScripts(r.url), A = DracoDecoderModule({ wasmBinary: r.wasmBinary })), postMessage({ id: "initDone" });
        break;
      }
      case "decodeMesh": {
        if (!A)
          throw new Error("Draco decoder module is not available");
        A.then((r) => {
          const n = TF(r, t.dataView, t.attributes, (i) => {
            postMessage({ id: "indices", data: i }, [i.buffer]);
          }, (i, s, a, f, o, d) => {
            postMessage({ id: "attribute", kind: i, data: s, size: a, byteOffset: f, byteStride: o, normalized: d }, [s.buffer]);
          });
          postMessage({ id: "decodeMeshDone", totalVertices: n });
        });
        break;
      }
    }
  };
}
class Yd {
  /**
   * Returns true if the decoder configuration is available.
   */
  static get DecoderAvailable() {
    const e = Yd.Configuration.decoder;
    return !!(e.wasmUrl && e.wasmBinaryUrl && typeof WebAssembly == "object" || e.fallbackUrl);
  }
  static GetDefaultNumWorkers() {
    return typeof navigator != "object" || !navigator.hardwareConcurrency ? 1 : Math.min(Math.floor(navigator.hardwareConcurrency * 0.5), 4);
  }
  /**
   * Default instance for the draco compression object.
   */
  static get Default() {
    return Yd._Default || (Yd._Default = new Yd()), Yd._Default;
  }
  /**
   * Constructor
   * @param numWorkers The number of workers for async operations. Specify `0` to disable web workers and run synchronously in the current context.
   */
  constructor(e = Yd.DefaultNumWorkers) {
    const t = Yd.Configuration.decoder, r = t.wasmUrl && t.wasmBinaryUrl && typeof WebAssembly == "object" ? {
      url: ye.GetBabylonScriptURL(t.wasmUrl, !0),
      wasmBinaryPromise: ye.LoadFileAsync(ye.GetBabylonScriptURL(t.wasmBinaryUrl, !0))
    } : {
      url: ye.GetBabylonScriptURL(t.fallbackUrl),
      wasmBinaryPromise: Promise.resolve(void 0)
    };
    e && typeof Worker == "function" && typeof URL == "function" ? this._workerPoolPromise = r.wasmBinaryPromise.then((n) => {
      const i = `${TF}(${ghe})()`, s = URL.createObjectURL(new Blob([i], { type: "application/javascript" }));
      return new lU(e, () => new Promise((a, f) => {
        const o = new Worker(s), d = (u) => {
          o.removeEventListener("error", d), o.removeEventListener("message", v), f(u);
        }, v = (u) => {
          u.data.id === "initDone" && (o.removeEventListener("error", d), o.removeEventListener("message", v), a(o));
        };
        o.addEventListener("error", d), o.addEventListener("message", v), o.postMessage({
          id: "init",
          decoder: {
            url: r.url,
            wasmBinary: n
          }
        });
      }));
    }) : this._decoderModulePromise = r.wasmBinaryPromise.then((n) => {
      if (!r.url)
        throw new Error("Draco decoder module is not available");
      return ye.LoadBabylonScriptAsync(r.url).then(() => Hhe(n));
    });
  }
  /**
   * Stop all async operations and release resources.
   */
  dispose() {
    this._workerPoolPromise && this._workerPoolPromise.then((e) => {
      e.dispose();
    }), delete this._workerPoolPromise, delete this._decoderModulePromise;
  }
  /**
   * Returns a promise that resolves when ready. Call this manually to ensure draco compression is ready before use.
   * @returns a promise that resolves when ready
   */
  whenReadyAsync() {
    return this._workerPoolPromise ? this._workerPoolPromise.then(() => {
    }) : this._decoderModulePromise ? this._decoderModulePromise.then(() => {
    }) : Promise.resolve();
  }
  _decodeMeshAsync(e, t, r) {
    const n = e instanceof ArrayBuffer ? new Int8Array(e) : new Int8Array(e.buffer, e.byteOffset, e.byteLength), i = (s, a) => r && r[s] !== void 0 ? (a !== r[s] && Se.Warn(`Normalized flag from Draco data (${a}) does not match normalized flag from glTF accessor (${r[s]}). Using flag from glTF accessor.`), r[s]) : a;
    if (this._workerPoolPromise)
      return this._workerPoolPromise.then((s) => new Promise((a, f) => {
        s.push((o, d) => {
          let v = null;
          const u = [], l = (c) => {
            o.removeEventListener("error", l), o.removeEventListener("message", P), f(c), d();
          }, P = (c) => {
            const H = c.data;
            switch (H.id) {
              case "decodeMeshDone": {
                o.removeEventListener("error", l), o.removeEventListener("message", P), a({ indices: v, attributes: u, totalVertices: H.totalVertices }), d();
                break;
              }
              case "indices": {
                v = H.data;
                break;
              }
              case "attribute": {
                u.push({
                  kind: H.kind,
                  data: H.data,
                  size: H.size,
                  byteOffset: H.byteOffset,
                  byteStride: H.byteStride,
                  normalized: i(H.kind, H.normalized)
                });
                break;
              }
            }
          };
          o.addEventListener("error", l), o.addEventListener("message", P);
          const p = n.slice();
          o.postMessage({ id: "decodeMesh", dataView: p, attributes: t }, [p.buffer]);
        });
      }));
    if (this._decoderModulePromise)
      return this._decoderModulePromise.then((s) => {
        let a = null;
        const f = [], o = TF(s.module, n, t, (d) => {
          a = d;
        }, (d, v, u, l, P, p) => {
          f.push({
            kind: d,
            data: v,
            size: u,
            byteOffset: l,
            byteStride: P,
            normalized: p
          });
        });
        return { indices: a, attributes: f, totalVertices: o };
      });
    throw new Error("Draco decoder module is not available");
  }
  /**
   * Decode Draco compressed mesh data to Babylon geometry.
   * @param name The name to use when creating the geometry
   * @param scene The scene to use when creating the geometry
   * @param data The ArrayBuffer or ArrayBufferView for the Draco compression data
   * @param attributes A map of attributes from vertex buffer kinds to Draco unique ids
   * @returns A promise that resolves with the decoded geometry
   */
  decodeMeshToGeometryAsync(e, t, r, n) {
    return this._decodeMeshAsync(r, n).then((i) => {
      const s = new Tf(e, t);
      i.indices && s.setIndices(i.indices);
      for (const a of i.attributes)
        s.setVerticesBuffer(new J(t.getEngine(), a.data, a.kind, !1, void 0, a.byteStride, void 0, a.byteOffset, a.size, void 0, a.normalized, !0), i.totalVertices);
      return s;
    });
  }
  /** @internal */
  _decodeMeshToGeometryForGltfAsync(e, t, r, n, i) {
    return this._decodeMeshAsync(r, n, i).then((s) => {
      const a = new Tf(e, t);
      s.indices && a.setIndices(s.indices);
      for (const f of s.attributes)
        a.setVerticesBuffer(new J(t.getEngine(), f.data, f.kind, !1, void 0, f.byteStride, void 0, f.byteOffset, f.size, void 0, f.normalized, !0), s.totalVertices);
      return a;
    });
  }
  /**
   * Decode Draco compressed mesh data to Babylon vertex data.
   * @param data The ArrayBuffer or ArrayBufferView for the Draco compression data
   * @param attributes A map of attributes from vertex buffer kinds to Draco unique ids
   * @returns A promise that resolves with the decoded vertex data
   * @deprecated Use {@link decodeMeshToGeometryAsync} for better performance in some cases
   */
  decodeMeshAsync(e, t) {
    return this._decodeMeshAsync(e, t).then((r) => {
      const n = new Ut();
      r.indices && (n.indices = r.indices);
      for (const i of r.attributes) {
        const s = J.GetFloatData(i.data, i.size, J.GetDataType(i.data), i.byteOffset, i.byteStride, i.normalized, r.totalVertices);
        n.set(s, i.kind);
      }
      return n;
    });
  }
}
Yd.Configuration = {
  decoder: {
    wasmUrl: `${ye._DefaultCdnUrl}/draco_wasm_wrapper_gltf.js`,
    wasmBinaryUrl: `${ye._DefaultCdnUrl}/draco_decoder_gltf.wasm`,
    fallbackUrl: `${ye._DefaultCdnUrl}/draco_decoder_gltf.js`
  }
};
Yd.DefaultNumWorkers = Yd.GetDefaultNumWorkers();
Yd._Default = null;
class Q2 {
  /**
   * Default instance for the meshoptimizer object.
   */
  static get Default() {
    return Q2._Default || (Q2._Default = new Q2()), Q2._Default;
  }
  /**
   * Constructor
   */
  constructor() {
    const e = Q2.Configuration.decoder;
    this._decoderModulePromise = ye.LoadBabylonScriptAsync(e.url).then(() => MeshoptDecoder.ready);
  }
  /**
   * Stop all async operations and release resources.
   */
  dispose() {
    delete this._decoderModulePromise;
  }
  /**
   * Decode meshopt data.
   * @see https://github.com/zeux/meshoptimizer/tree/master/js#decoder
   * @param source The input data.
   * @param count The number of elements.
   * @param stride The stride in bytes.
   * @param mode The compression mode.
   * @param filter The compression filter.
   * @returns a Promise<Uint8Array> that resolves to the decoded data
   */
  decodeGltfBufferAsync(e, t, r, n, i) {
    return this._decoderModulePromise.then(() => {
      const s = new Uint8Array(t * r);
      return MeshoptDecoder.decodeGltfBuffer(s, t, r, e, n, i), s;
    });
  }
}
Q2.Configuration = {
  decoder: {
    url: `${ye._DefaultCdnUrl}/meshopt_decoder.js`
  }
};
Q2._Default = null;
let TC = 0;
class tR {
  /**
   * Initializes the vertex
   * @param pos The position of the vertex
   * @param normal The normal of the vertex
   * @param uv The texture coordinate of the vertex
   * @param vertColor The RGBA color of the vertex
   */
  constructor(e, t, r, n) {
    this.pos = e, this.normal = t, this.uv = r, this.vertColor = n;
  }
  /**
   * Make a clone, or deep copy, of the vertex
   * @returns A new Vertex
   */
  clone() {
    var e, t;
    return new tR(this.pos.clone(), this.normal.clone(), (e = this.uv) === null || e === void 0 ? void 0 : e.clone(), (t = this.vertColor) === null || t === void 0 ? void 0 : t.clone());
  }
  /**
   * Invert all orientation-specific data (e.g. vertex normal). Called when the
   * orientation of a polygon is flipped.
   */
  flip() {
    this.normal = this.normal.scale(-1);
  }
  /**
   * Create a new vertex between this vertex and `other` by linearly
   * interpolating all properties using a parameter of `t`. Subclasses should
   * override this to interpolate additional properties.
   * @param other the vertex to interpolate against
   * @param t The factor used to linearly interpolate between the vertices
   */
  interpolate(e, t) {
    return new tR(S.Lerp(this.pos, e.pos, t), S.Lerp(this.normal, e.normal, t), this.uv && e.uv ? at.Lerp(this.uv, e.uv, t) : void 0, this.vertColor && e.vertColor ? xt.Lerp(this.vertColor, e.vertColor, t) : void 0);
  }
}
class Zw {
  /**
   * Initializes the plane
   * @param normal The normal for the plane
   * @param w
   */
  constructor(e, t) {
    this.normal = e, this.w = t;
  }
  /**
   * Construct a plane from three points
   * @param a Point a
   * @param b Point b
   * @param c Point c
   */
  static FromPoints(e, t, r) {
    const n = r.subtract(e), i = t.subtract(e);
    if (n.lengthSquared() === 0 || i.lengthSquared() === 0)
      return null;
    const s = S.Normalize(S.Cross(n, i));
    return new Zw(s, S.Dot(s, e));
  }
  /**
   * Clone, or make a deep copy of the plane
   * @returns a new Plane
   */
  clone() {
    return new Zw(this.normal.clone(), this.w);
  }
  /**
   * Flip the face of the plane
   */
  flip() {
    this.normal.scaleInPlace(-1), this.w = -this.w;
  }
  /**
   * Split `polygon` by this plane if needed, then put the polygon or polygon
   * fragments in the appropriate lists. Coplanar polygons go into either
  `* coplanarFront` or `coplanarBack` depending on their orientation with
   * respect to this plane. Polygons in front or in back of this plane go into
   * either `front` or `back`
   * @param polygon The polygon to be split
   * @param coplanarFront Will contain polygons coplanar with the plane that are oriented to the front of the plane
   * @param coplanarBack Will contain polygons coplanar with the plane that are oriented to the back of the plane
   * @param front Will contain the polygons in front of the plane
   * @param back Will contain the polygons begind the plane
   */
  splitPolygon(e, t, r, n, i) {
    let d = 0;
    const v = [];
    let u, l;
    for (u = 0; u < e.vertices.length; u++) {
      l = S.Dot(this.normal, e.vertices[u].pos) - this.w;
      const P = l < -Zw.EPSILON ? 2 : l > Zw.EPSILON ? 1 : 0;
      d |= P, v.push(P);
    }
    switch (d) {
      case 0:
        (S.Dot(this.normal, e.plane.normal) > 0 ? t : r).push(e);
        break;
      case 1:
        n.push(e);
        break;
      case 2:
        i.push(e);
        break;
      case 3: {
        const P = [], p = [];
        for (u = 0; u < e.vertices.length; u++) {
          const H = (u + 1) % e.vertices.length, T = v[u], q = v[H], b = e.vertices[u], j = e.vertices[H];
          if (T !== 2 && P.push(b), T !== 1 && p.push(T !== 2 ? b.clone() : b), (T | q) === 3) {
            l = (this.w - S.Dot(this.normal, b.pos)) / S.Dot(this.normal, j.pos.subtract(b.pos));
            const w = b.interpolate(j, l);
            P.push(w), p.push(w.clone());
          }
        }
        let c;
        P.length >= 3 && (c = new yS(P, e.shared), c.plane && n.push(c)), p.length >= 3 && (c = new yS(p, e.shared), c.plane && i.push(c));
        break;
      }
    }
  }
}
Zw.EPSILON = 1e-5;
class yS {
  /**
   * Initializes the polygon
   * @param vertices The vertices of the polygon
   * @param shared The properties shared across all polygons
   */
  constructor(e, t) {
    this.vertices = e, this.shared = t, this.plane = Zw.FromPoints(e[0].pos, e[1].pos, e[2].pos);
  }
  /**
   * Clones, or makes a deep copy, or the polygon
   */
  clone() {
    const e = this.vertices.map((t) => t.clone());
    return new yS(e, this.shared);
  }
  /**
   * Flips the faces of the polygon
   */
  flip() {
    this.vertices.reverse().map((e) => {
      e.flip();
    }), this.plane.flip();
  }
}
let p0 = class BC {
  /**
   * Initializes the node
   * @param polygons A collection of polygons held in the node
   */
  constructor(e) {
    this._plane = null, this._front = null, this._back = null, this._polygons = new Array(), e && this.build(e);
  }
  /**
   * Clones, or makes a deep copy, of the node
   * @returns The cloned node
   */
  clone() {
    const e = new BC();
    return e._plane = this._plane && this._plane.clone(), e._front = this._front && this._front.clone(), e._back = this._back && this._back.clone(), e._polygons = this._polygons.map((t) => t.clone()), e;
  }
  /**
   * Convert solid space to empty space and empty space to solid space
   */
  invert() {
    for (let t = 0; t < this._polygons.length; t++)
      this._polygons[t].flip();
    this._plane && this._plane.flip(), this._front && this._front.invert(), this._back && this._back.invert();
    const e = this._front;
    this._front = this._back, this._back = e;
  }
  /**
   * Recursively remove all polygons in `polygons` that are inside this BSP
   * tree.
   * @param polygons Polygons to remove from the BSP
   * @returns Polygons clipped from the BSP
   */
  clipPolygons(e) {
    if (!this._plane)
      return e.slice();
    let t = [], r = [];
    for (let n = 0; n < e.length; n++)
      this._plane.splitPolygon(e[n], t, r, t, r);
    return this._front && (t = this._front.clipPolygons(t)), this._back ? r = this._back.clipPolygons(r) : r = [], t.concat(r);
  }
  /**
   * Remove all polygons in this BSP tree that are inside the other BSP tree
   * `bsp`.
   * @param bsp BSP containing polygons to remove from this BSP
   */
  clipTo(e) {
    this._polygons = e.clipPolygons(this._polygons), this._front && this._front.clipTo(e), this._back && this._back.clipTo(e);
  }
  /**
   * Return a list of all polygons in this BSP tree
   * @returns List of all polygons in this BSP tree
   */
  allPolygons() {
    let e = this._polygons.slice();
    return this._front && (e = e.concat(this._front.allPolygons())), this._back && (e = e.concat(this._back.allPolygons())), e;
  }
  /**
   * Build a BSP tree out of `polygons`. When called on an existing tree, the
   * new polygons are filtered down to the bottom of the tree and become new
   * nodes there. Each set of polygons is partitioned using the first polygon
   * (no heuristic is used to pick a good split)
   * @param polygons Polygons used to construct the BSP tree
   */
  build(e) {
    if (!e.length)
      return;
    this._plane || (this._plane = e[0].plane.clone());
    const t = [], r = [];
    for (let n = 0; n < e.length; n++)
      this._plane.splitPolygon(e[n], this._polygons, this._polygons, t, r);
    t.length && (this._front || (this._front = new BC()), this._front.build(t)), r.length && (this._back || (this._back = new BC()), this._back.build(r));
  }
};
class YH {
  constructor() {
    this._polygons = new Array();
  }
  /**
   * Convert a VertexData to CSG
   * @param mesh defines the VertexData to convert to CSG
   * @returns the new CSG
   */
  static FromVertexData(e) {
    let t, r, n;
    const i = [], s = e.indices, a = e.positions, f = e.normals, o = e.uvs, d = e.colors;
    if (!s || !a)
      throw "BABYLON.CSG: VertexData must at least contain positions and indices";
    for (let u = 0; u < s.length; u += 3) {
      n = [];
      for (let l = 0; l < 3; l++) {
        const P = u + l, p = s[P], c = f ? S.FromArray(f, p * 3) : S.Zero(), H = o ? at.FromArray(o, p * 2) : void 0, T = d ? xt.FromArray(d, p * 4) : void 0, q = S.FromArray(a, p * 3);
        t = new tR(q, c, H, T), n.push(t);
      }
      r = new yS(n, { subMeshId: 0, meshId: TC, materialIndex: 0 }), r.plane && i.push(r);
    }
    const v = YH._FromPolygons(i);
    return v.matrix = he.Identity(), v.position = S.Zero(), v.rotation = S.Zero(), v.scaling = S.One(), v.rotationQuaternion = Ze.Identity(), TC++, v;
  }
  /**
   * Convert the Mesh to CSG
   * @param mesh The Mesh to convert to CSG
   * @param absolute If true, the final (local) matrix transformation is set to the identity and not to that of `mesh`. It can help when dealing with right-handed meshes (default: false)
   * @returns A new CSG from the Mesh
   */
  static FromMesh(e, t = !1) {
    let r, n, i, s, a, f, o;
    const d = [];
    let v, u, l, P = null, p, c = !1;
    if (e instanceof Ee)
      e.computeWorldMatrix(!0), v = e.getWorldMatrix(), u = e.position.clone(), l = e.rotation.clone(), e.rotationQuaternion && (P = e.rotationQuaternion.clone()), p = e.scaling.clone(), e.material && t && (c = e.material.sideOrientation === 0);
    else
      throw "BABYLON.CSG: Wrong Mesh type, must be BABYLON.Mesh";
    const H = e.getIndices(), T = e.getVerticesData(J.PositionKind), q = e.getVerticesData(J.NormalKind), b = e.getVerticesData(J.UVKind), j = e.getVerticesData(J.ColorKind), w = e.subMeshes;
    for (let I = 0, N = w.length; I < N; I++)
      for (let k = w[I].indexStart, R = w[I].indexCount + w[I].indexStart; k < R; k += 3) {
        o = [];
        for (let y = 0; y < 3; y++) {
          const O = y === 0 ? k + y : c ? k + 3 - y : k + y, Y = new S(q[H[O] * 3], q[H[O] * 3 + 1], q[H[O] * 3 + 2]);
          b && (i = new at(b[H[O] * 2], b[H[O] * 2 + 1])), j && (a = new xt(j[H[O] * 4], j[H[O] * 4 + 1], j[H[O] * 4 + 2], j[H[O] * 4 + 3]));
          const ee = new S(T[H[O] * 3], T[H[O] * 3 + 1], T[H[O] * 3 + 2]);
          s = S.TransformCoordinates(ee, v), n = S.TransformNormal(Y, v), r = new tR(s, n, i, a), o.push(r);
        }
        f = new yS(o, { subMeshId: I, meshId: TC, materialIndex: w[I].materialIndex }), f.plane && d.push(f);
      }
    const m = YH._FromPolygons(d);
    return m.matrix = t ? he.Identity() : v, m.position = t ? S.Zero() : u, m.rotation = t ? S.Zero() : l, m.scaling = t ? S.One() : p, m.rotationQuaternion = t && P ? Ze.Identity() : P, TC++, m;
  }
  /**
   * Construct a CSG solid from a list of `CSG.Polygon` instances.
   * @param polygons Polygons used to construct a CSG solid
   */
  static _FromPolygons(e) {
    const t = new YH();
    return t._polygons = e, t;
  }
  /**
   * Clones, or makes a deep copy, of the CSG
   * @returns A new CSG
   */
  clone() {
    const e = new YH();
    return e._polygons = this._polygons.map((t) => t.clone()), e.copyTransformAttributes(this), e;
  }
  /**
   * Unions this CSG with another CSG
   * @param csg The CSG to union against this CSG
   * @returns The unioned CSG
   */
  union(e) {
    const t = new p0(this.clone()._polygons), r = new p0(e.clone()._polygons);
    return t.clipTo(r), r.clipTo(t), r.invert(), r.clipTo(t), r.invert(), t.build(r.allPolygons()), YH._FromPolygons(t.allPolygons()).copyTransformAttributes(this);
  }
  /**
   * Unions this CSG with another CSG in place
   * @param csg The CSG to union against this CSG
   */
  unionInPlace(e) {
    const t = new p0(this._polygons), r = new p0(e._polygons);
    t.clipTo(r), r.clipTo(t), r.invert(), r.clipTo(t), r.invert(), t.build(r.allPolygons()), this._polygons = t.allPolygons();
  }
  /**
   * Subtracts this CSG with another CSG
   * @param csg The CSG to subtract against this CSG
   * @returns A new CSG
   */
  subtract(e) {
    const t = new p0(this.clone()._polygons), r = new p0(e.clone()._polygons);
    return t.invert(), t.clipTo(r), r.clipTo(t), r.invert(), r.clipTo(t), r.invert(), t.build(r.allPolygons()), t.invert(), YH._FromPolygons(t.allPolygons()).copyTransformAttributes(this);
  }
  /**
   * Subtracts this CSG with another CSG in place
   * @param csg The CSG to subtract against this CSG
   */
  subtractInPlace(e) {
    const t = new p0(this._polygons), r = new p0(e._polygons);
    t.invert(), t.clipTo(r), r.clipTo(t), r.invert(), r.clipTo(t), r.invert(), t.build(r.allPolygons()), t.invert(), this._polygons = t.allPolygons();
  }
  /**
   * Intersect this CSG with another CSG
   * @param csg The CSG to intersect against this CSG
   * @returns A new CSG
   */
  intersect(e) {
    const t = new p0(this.clone()._polygons), r = new p0(e.clone()._polygons);
    return t.invert(), r.clipTo(t), r.invert(), t.clipTo(r), r.clipTo(t), t.build(r.allPolygons()), t.invert(), YH._FromPolygons(t.allPolygons()).copyTransformAttributes(this);
  }
  /**
   * Intersects this CSG with another CSG in place
   * @param csg The CSG to intersect against this CSG
   */
  intersectInPlace(e) {
    const t = new p0(this._polygons), r = new p0(e._polygons);
    t.invert(), r.clipTo(t), r.invert(), t.clipTo(r), r.clipTo(t), t.build(r.allPolygons()), t.invert(), this._polygons = t.allPolygons();
  }
  /**
   * Return a new CSG solid with solid and empty space switched. This solid is
   * not modified.
   * @returns A new CSG solid with solid and empty space switched
   */
  inverse() {
    const e = this.clone();
    return e.inverseInPlace(), e;
  }
  /**
   * Inverses the CSG in place
   */
  inverseInPlace() {
    this._polygons.map((e) => {
      e.flip();
    });
  }
  /**
   * This is used to keep meshes transformations so they can be restored
   * when we build back a Babylon Mesh
   * NB : All CSG operations are performed in world coordinates
   * @param csg The CSG to copy the transform attributes from
   * @returns This CSG
   */
  copyTransformAttributes(e) {
    return this.matrix = e.matrix, this.position = e.position, this.rotation = e.rotation, this.scaling = e.scaling, this.rotationQuaternion = e.rotationQuaternion, this;
  }
  /**
   * Build vertex data from CSG
   * Coordinates here are in world space
   * @returns the final vertex data
   */
  toVertexData(e = null, t = null) {
    const r = this.matrix.clone();
    r.invert();
    const n = this._polygons, i = [], s = [], a = [];
    let f = null, o = null;
    const d = S.Zero(), v = S.Zero(), u = at.Zero(), l = new xt(0, 0, 0, 0), P = [0, 0, 0], p = {};
    let c;
    for (let T = 0, q = n.length; T < q; T++) {
      const b = n[T];
      e && e(b);
      for (let j = 2, w = b.vertices.length; j < w; j++) {
        P[0] = 0, P[1] = j - 1, P[2] = j;
        for (let m = 0; m < 3; m++) {
          d.copyFrom(b.vertices[P[m]].pos), v.copyFrom(b.vertices[P[m]].normal), b.vertices[P[m]].uv && (f || (f = []), u.copyFrom(b.vertices[P[m]].uv)), b.vertices[P[m]].vertColor && (o || (o = []), l.copyFrom(b.vertices[P[m]].vertColor));
          const I = S.TransformCoordinates(d, r), N = S.TransformNormal(v, r);
          c = p[I.x + "," + I.y + "," + I.z];
          let k = !1;
          f && !(f[c * 2] === u.x || f[c * 2 + 1] === u.y) && (k = !0);
          let R = !1;
          o && !(o[c * 4] === l.r || o[c * 4 + 1] === l.g || o[c * 4 + 2] === l.b || o[c * 4 + 3] === l.a) && (R = !0), (!(typeof c < "u" && a[c * 3] === N.x && a[c * 3 + 1] === N.y && a[c * 3 + 2] === N.z) || k || R) && (i.push(I.x, I.y, I.z), f && f.push(u.x, u.y), a.push(v.x, v.y, v.z), o && o.push(l.r, l.g, l.b, l.a), c = p[I.x + "," + I.y + "," + I.z] = i.length / 3 - 1), s.push(c), t && t();
        }
      }
    }
    const H = new Ut();
    return H.positions = i, H.normals = a, f && (H.uvs = f), o && (H.colors = o), H.indices = s, H;
  }
  /**
   * Build Raw mesh from CSG
   * Coordinates here are in world space
   * @param name The name of the mesh geometry
   * @param scene The Scene
   * @param keepSubMeshes Specifies if the submeshes should be kept
   * @returns A new Mesh
   */
  buildMeshGeometry(e, t, r) {
    const n = new Ee(e, t), i = this._polygons;
    let s = 0;
    const a = {};
    let f;
    if (r && i.sort((d, v) => d.shared.meshId === v.shared.meshId ? d.shared.subMeshId - v.shared.subMeshId : d.shared.meshId - v.shared.meshId), this.toVertexData((d) => {
      a[d.shared.meshId] || (a[d.shared.meshId] = {}), a[d.shared.meshId][d.shared.subMeshId] || (a[d.shared.meshId][d.shared.subMeshId] = {
        indexStart: 1 / 0,
        indexEnd: -1 / 0,
        materialIndex: d.shared.materialIndex
      }), f = a[d.shared.meshId][d.shared.subMeshId];
    }, () => {
      f.indexStart = Math.min(s, f.indexStart), f.indexEnd = Math.max(s, f.indexEnd), s++;
    }).applyToMesh(n), r) {
      let d = 0, v;
      n.subMeshes = [];
      for (const u in a) {
        v = -1;
        for (const l in a[u])
          f = a[u][l], rA.CreateFromIndices(f.materialIndex + d, f.indexStart, f.indexEnd - f.indexStart + 1, n), v = Math.max(f.materialIndex, v);
        d += ++v;
      }
    }
    return n;
  }
  /**
   * Build Mesh from CSG taking material and transforms into account
   * @param name The name of the Mesh
   * @param material The material of the Mesh
   * @param scene The Scene
   * @param keepSubMeshes Specifies if submeshes should be kept
   * @returns The new Mesh
   */
  toMesh(e, t = null, r, n) {
    const i = this.buildMeshGeometry(e, r, n);
    return i.material = t, i.position.copyFrom(this.position), i.rotation.copyFrom(this.rotation), this.rotationQuaternion && (i.rotationQuaternion = this.rotationQuaternion.clone()), i.scaling.copyFrom(this.scaling), i.computeWorldMatrix(!0), i;
  }
}
const Xhe = "meshUVSpaceRendererVertexShader", The = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;uniform mat4 projMatrix;varying vec2 vDecalTC;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
void main(void) {vec3 positionUpdated=position;vec3 normalUpdated=normal;
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);mat3 normWorldSM=mat3(finalWorld);vec3 vNormalW;
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normWorldSM=transposeMat3(inverseMat3(normWorldSM));
#endif
vNormalW=normalize(normWorldSM*normalUpdated);
#endif
vec3 normalView=normalize((projMatrix*vec4(vNormalW,0.0)).xyz);vec3 decalTC=(projMatrix*worldPos).xyz;vDecalTC=decalTC.xy;gl_Position=vec4(uv*2.0-1.0,normalView.z>0.0 ? 2. : decalTC.z,1.0);}
`;
Le.ShadersStore[Xhe] = The;
const qhe = "meshUVSpaceRendererPixelShader", bhe = `precision highp float;varying vec2 vDecalTC;uniform sampler2D textureSampler;void main(void) {if (vDecalTC.x<0. || vDecalTC.x>1. || vDecalTC.y<0. || vDecalTC.y>1.) {discard;}
gl_FragColor=texture2D(textureSampler,vDecalTC);}
`;
Le.ShadersStore[qhe] = bhe;
class Qw {
  static _GetShader(e) {
    if (!e._meshUVSpaceRendererShader) {
      const t = new Zo("meshUVSpaceRendererShader", e, {
        vertex: "meshUVSpaceRenderer",
        fragment: "meshUVSpaceRenderer"
      }, {
        attributes: ["position", "normal", "uv"],
        uniforms: ["world", "projMatrix"],
        samplers: ["textureSampler"],
        needAlphaBlending: !0
      });
      t.backFaceCulling = !1, t.alphaMode = 2, e.onDisposeObservable.add(() => {
        var r;
        (r = e._meshUVSpaceRendererShader) === null || r === void 0 || r.dispose(), e._meshUVSpaceRendererShader = null;
      }), e._meshUVSpaceRendererShader = t;
    }
    return e._meshUVSpaceRendererShader;
  }
  static _IsRenderTargetTexture(e) {
    return e.renderList !== void 0;
  }
  /**
   * Creates a new MeshUVSpaceRenderer
   * @param mesh The mesh used for the source UV space
   * @param scene The scene the mesh belongs to
   * @param options The options to use when creating the texture
   */
  constructor(e, t, r) {
    this._textureCreatedInternally = !1, this.clearColor = new xt(0, 0, 0, 0), this._mesh = e, this._scene = t, this._options = Object.assign({ width: 1024, height: 1024, textureType: 0, generateMipMaps: !0, optimizeUVAllocation: !0 }, r);
  }
  /**
   * Checks if the texture is ready to be used
   * @returns true if the texture is ready to be used
   */
  isReady() {
    return this.texture || this._createDiffuseRTT(), Qw._IsRenderTargetTexture(this.texture) ? this.texture.isReadyForRendering() : this.texture.isReady();
  }
  /**
   * Projects and renders a texture in the mesh UV space
   * @param texture The texture
   * @param position The position of the center of projection (world space coordinates)
   * @param normal The direction of the projection (world space coordinates)
   * @param size The size of the projection
   * @param angle The rotation angle around the direction of the projection
   */
  renderTexture(e, t, r, n, i = 0) {
    if (this.texture || this._createDiffuseRTT(), Qw._IsRenderTargetTexture(this.texture)) {
      const s = this._createProjectionMatrix(t, r, n, i), a = Qw._GetShader(this._scene);
      a.setTexture("textureSampler", e), a.setMatrix("projMatrix", s), this.texture.render();
    }
  }
  /**
   * Clears the texture map
   */
  clear() {
    if (Qw._IsRenderTargetTexture(this.texture) && this.texture.renderTarget) {
      const e = this._scene.getEngine();
      e.bindFramebuffer(this.texture.renderTarget), e.clear(this.clearColor, !0, !0, !0), e.unBindFramebuffer(this.texture.renderTarget);
    }
  }
  /**
   * Disposes of the ressources
   */
  dispose() {
    this._textureCreatedInternally && (this.texture.dispose(), this._textureCreatedInternally = !1);
  }
  _createDiffuseRTT() {
    this._textureCreatedInternally = !0;
    const e = this._createRenderTargetTexture(this._options.width, this._options.height);
    e.setMaterialForRendering(this._mesh, Qw._GetShader(this._scene)), this.texture = e;
  }
  _createRenderTargetTexture(e, t) {
    const r = new Ta(this._mesh.name + "_uvspaceTexture", { width: e, height: t }, this._scene, this._options.generateMipMaps, !0, this._options.textureType, !1, this._options.generateMipMaps ? 3 : 2, !1, !1, !1, 5);
    return r.renderParticles = !1, r.optimizeUVAllocation = !!this._options.optimizeUVAllocation, r.onClearObservable.addOnce(() => {
      this._scene.getEngine().clear(this.clearColor, !0, !0, !0), r.onClearObservable.add(() => {
      });
    }), r.renderList = [this._mesh], r;
  }
  _createProjectionMatrix(e, t, r, n = 0) {
    const i = -Math.atan2(t.z, t.x) - Math.PI / 2, s = Math.sqrt(t.x * t.x + t.z * t.z), a = Math.atan2(t.y, s), f = e.add(t.scale(r.z * 0.5)), o = he.RotationYawPitchRoll(i, a, n).multiply(he.Translation(f.x, f.y, f.z)), d = he.Invert(o), v = he.FromArray([2 / r.x, 0, 0, 0, 0, 2 / r.y, 0, 0, 0, 0, 1 / r.z, 0, 0, 0, 0, 1]), u = he.FromArray([0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0.5, 0.5, 0, 1]);
    return d.multiply(v).multiply(u);
  }
}
Ee._TrailMeshParser = (A, e) => rR.Parse(A, e);
class rR extends Ee {
  /**
   * Creates a new TrailMesh.
   * @param name The value used by scene.getMeshByName() to do a lookup.
   * @param generator The mesh or transform node to generate a trail.
   * @param scene The scene to add this mesh to.
   * @param diameter Diameter of trailing mesh. Default is 1.
   * @param length Length of trailing mesh. Default is 60.
   * @param autoStart Automatically start trailing mesh. Default true.
   */
  constructor(e, t, r, n = 1, i = 60, s = !0) {
    super(e, r), this._sectionPolygonPointsCount = 4, this._running = !1, this._autoStart = s, this._generator = t, this.diameter = n, this._length = i, this._sectionVectors = [], this._sectionNormalVectors = [];
    for (let a = 0; a < this._sectionPolygonPointsCount; a++)
      this._sectionVectors[a] = S.Zero(), this._sectionNormalVectors[a] = S.Zero();
    this._createMesh();
  }
  /**
   * "TrailMesh"
   * @returns "TrailMesh"
   */
  getClassName() {
    return "TrailMesh";
  }
  _createMesh() {
    const e = new Ut(), t = [], r = [], n = [];
    let i = S.Zero();
    this._generator instanceof jn && this._generator.hasBoundingInfo ? i = this._generator.getBoundingInfo().boundingBox.centerWorld : i = this._generator.position;
    const s = 2 * Math.PI / this._sectionPolygonPointsCount;
    for (let a = 0; a < this._sectionPolygonPointsCount; a++)
      t.push(i.x + Math.cos(a * s) * this.diameter, i.y + Math.sin(a * s) * this.diameter, i.z);
    for (let a = 1; a <= this._length; a++) {
      for (let o = 0; o < this._sectionPolygonPointsCount; o++)
        t.push(i.x + Math.cos(o * s) * this.diameter, i.y + Math.sin(o * s) * this.diameter, i.z);
      const f = t.length / 3 - 2 * this._sectionPolygonPointsCount;
      for (let o = 0; o < this._sectionPolygonPointsCount - 1; o++)
        n.push(f + o, f + o + this._sectionPolygonPointsCount, f + o + this._sectionPolygonPointsCount + 1), n.push(f + o, f + o + this._sectionPolygonPointsCount + 1, f + o + 1);
      n.push(f + this._sectionPolygonPointsCount - 1, f + this._sectionPolygonPointsCount - 1 + this._sectionPolygonPointsCount, f + this._sectionPolygonPointsCount), n.push(f + this._sectionPolygonPointsCount - 1, f + this._sectionPolygonPointsCount, f);
    }
    Ut.ComputeNormals(t, n, r), e.positions = t, e.normals = r, e.indices = n, e.applyToMesh(this, !0), this._autoStart && this.start();
  }
  /**
   * Start trailing mesh.
   */
  start() {
    this._running || (this._running = !0, this._beforeRenderObserver = this.getScene().onBeforeRenderObservable.add(() => {
      this.update();
    }));
  }
  /**
   * Stop trailing mesh.
   */
  stop() {
    this._beforeRenderObserver && this._running && (this._running = !1, this.getScene().onBeforeRenderObservable.remove(this._beforeRenderObserver));
  }
  /**
   * Update trailing mesh geometry.
   */
  update() {
    const e = this.getVerticesData(J.PositionKind), t = this.getVerticesData(J.NormalKind), r = this._generator.getWorldMatrix();
    if (e && t) {
      for (let s = 3 * this._sectionPolygonPointsCount; s < e.length; s++)
        e[s - 3 * this._sectionPolygonPointsCount] = e[s] - t[s] / this._length * this.diameter;
      for (let s = 3 * this._sectionPolygonPointsCount; s < t.length; s++)
        t[s - 3 * this._sectionPolygonPointsCount] = t[s];
      const n = e.length - 3 * this._sectionPolygonPointsCount, i = 2 * Math.PI / this._sectionPolygonPointsCount;
      for (let s = 0; s < this._sectionPolygonPointsCount; s++)
        this._sectionVectors[s].copyFromFloats(Math.cos(s * i) * this.diameter, Math.sin(s * i) * this.diameter, 0), this._sectionNormalVectors[s].copyFromFloats(Math.cos(s * i), Math.sin(s * i), 0), S.TransformCoordinatesToRef(this._sectionVectors[s], r, this._sectionVectors[s]), S.TransformNormalToRef(this._sectionNormalVectors[s], r, this._sectionNormalVectors[s]);
      for (let s = 0; s < this._sectionPolygonPointsCount; s++)
        e[n + 3 * s] = this._sectionVectors[s].x, e[n + 3 * s + 1] = this._sectionVectors[s].y, e[n + 3 * s + 2] = this._sectionVectors[s].z, t[n + 3 * s] = this._sectionNormalVectors[s].x, t[n + 3 * s + 1] = this._sectionNormalVectors[s].y, t[n + 3 * s + 2] = this._sectionNormalVectors[s].z;
      this.updateVerticesData(J.PositionKind, e, !0, !1), this.updateVerticesData(J.NormalKind, t, !0, !1);
    }
  }
  /**
   * Returns a new TrailMesh object.
   * @param name is a string, the name given to the new mesh
   * @param newGenerator use new generator object for cloned trail mesh
   * @returns a new mesh
   */
  clone(e = "", t) {
    return new rR(e, t === void 0 ? this._generator : t, this.getScene(), this.diameter, this._length, this._autoStart);
  }
  /**
   * Serializes this trail mesh
   * @param serializationObject object to write serialization to
   */
  serialize(e) {
    super.serialize(e), e.generatorId = this._generator.id;
  }
  /**
   * Parses a serialized trail mesh
   * @param parsedMesh the serialized mesh
   * @param scene the scene to create the trail mesh in
   * @returns the created trail mesh
   */
  static Parse(e, t) {
    var r, n;
    const i = (r = t.getLastMeshById(e.generatorId)) !== null && r !== void 0 ? r : t.getLastTransformNodeById(e.generatorId);
    if (!i)
      throw new Error("TrailMesh: generator not found with ID " + e.generatorId);
    return new rR(e.name, i, t, (n = e.diameter) !== null && n !== void 0 ? n : e._diameter, e._length, e._autoStart);
  }
}
class xhe {
  /**
   * Creates a SimplificationSettings
   * @param quality expected quality
   * @param distance distance when this optimized version should be used
   * @param optimizeMesh already optimized mesh
   */
  constructor(e, t, r) {
    this.quality = e, this.distance = t, this.optimizeMesh = r;
  }
}
class Pne {
  /**
   * Creates a new queue
   */
  constructor() {
    this.running = !1, this._simplificationArray = [];
  }
  /**
   * Adds a new simplification task
   * @param task defines a task to add
   */
  addTask(e) {
    this._simplificationArray.push(e);
  }
  /**
   * Execute next task
   */
  executeNext() {
    const e = this._simplificationArray.pop();
    e ? (this.running = !0, this.runSimplification(e)) : this.running = !1;
  }
  /**
   * Execute a simplification task
   * @param task defines the task to run
   */
  runSimplification(e) {
    if (e.parallelProcessing)
      e.settings.forEach((t) => {
        this._getSimplifier(e).simplify(t, (n) => {
          t.distance !== void 0 && e.mesh.addLODLevel(t.distance, n), n.isVisible = !0, t.quality === e.settings[e.settings.length - 1].quality && e.successCallback && e.successCallback(), this.executeNext();
        });
      });
    else {
      const t = this._getSimplifier(e), r = (n, i) => {
        t.simplify(n, (s) => {
          n.distance !== void 0 && e.mesh.addLODLevel(n.distance, s), s.isVisible = !0, i();
        });
      };
      up.Run(e.settings.length, (n) => {
        r(e.settings[n.index], () => {
          n.executeNext();
        });
      }, () => {
        e.successCallback && e.successCallback(), this.executeNext();
      });
    }
  }
  _getSimplifier(e) {
    switch (e.simplificationType) {
      case nR.QUADRATIC:
      default:
        return new cne(e.mesh);
    }
  }
}
var nR;
(function(A) {
  A[A.QUADRATIC = 0] = "QUADRATIC";
})(nR || (nR = {}));
class Dhe {
  constructor(e) {
    this._vertices = e, this.error = new Array(4), this.deleted = !1, this.isDirty = !1, this.deletePending = !1, this.borderFactor = 0;
  }
}
class jhe {
  constructor(e, t) {
    this.position = e, this.id = t, this.isBorder = !0, this.q = new iS(), this.triangleCount = 0, this.triangleStart = 0, this.originalOffsets = [];
  }
  updatePosition(e) {
    this.position.copyFrom(e);
  }
}
class iS {
  constructor(e) {
    this.data = new Array(10);
    for (let t = 0; t < 10; ++t)
      e && e[t] ? this.data[t] = e[t] : this.data[t] = 0;
  }
  det(e, t, r, n, i, s, a, f, o) {
    return this.data[e] * this.data[i] * this.data[o] + this.data[r] * this.data[n] * this.data[f] + this.data[t] * this.data[s] * this.data[a] - this.data[r] * this.data[i] * this.data[a] - this.data[e] * this.data[s] * this.data[f] - this.data[t] * this.data[n] * this.data[o];
  }
  addInPlace(e) {
    for (let t = 0; t < 10; ++t)
      this.data[t] += e.data[t];
  }
  addArrayInPlace(e) {
    for (let t = 0; t < 10; ++t)
      this.data[t] += e[t];
  }
  add(e) {
    const t = new iS();
    for (let r = 0; r < 10; ++r)
      t.data[r] = this.data[r] + e.data[r];
    return t;
  }
  static FromData(e, t, r, n) {
    return new iS(iS.DataFromNumbers(e, t, r, n));
  }
  //returning an array to avoid garbage collection
  static DataFromNumbers(e, t, r, n) {
    return [e * e, e * t, e * r, e * n, t * t, t * r, t * n, r * r, r * n, n * n];
  }
}
class whe {
  constructor(e, t) {
    this.vertexId = e, this.triangleId = t;
  }
}
class cne {
  /**
   * Creates a new QuadraticErrorSimplification
   * @param _mesh defines the target mesh
   */
  constructor(e) {
    this._mesh = e, this.syncIterations = 5e3, this.aggressiveness = 7, this.decimationIterations = 100, this.boundingBoxEpsilon = Dn;
  }
  /**
   * Simplification of a given mesh according to the given settings.
   * Since this requires computation, it is assumed that the function runs async.
   * @param settings The settings of the simplification, including quality and distance
   * @param successCallback A callback that will be called after the mesh was simplified.
   */
  simplify(e, t) {
    this._initDecimatedMesh(), up.Run(this._mesh.subMeshes.length, (r) => {
      this._initWithMesh(r.index, () => {
        this._runDecimation(e, r.index, () => {
          r.executeNext();
        });
      }, e.optimizeMesh);
    }, () => {
      setTimeout(() => {
        t(this._reconstructedMesh);
      }, 0);
    });
  }
  _runDecimation(e, t, r) {
    const n = ~~(this._triangles.length * e.quality);
    let i = 0;
    const s = this._triangles.length, a = (f, o) => {
      setTimeout(() => {
        f % 5 === 0 && this._updateMesh(f === 0);
        for (let u = 0; u < this._triangles.length; ++u)
          this._triangles[u].isDirty = !1;
        const d = 1e-9 * Math.pow(f + 3, this.aggressiveness), v = (u) => {
          const l = ~~((this._triangles.length / 2 + u) % this._triangles.length), P = this._triangles[l];
          if (P && !(P.error[3] > d || P.deleted || P.isDirty)) {
            for (let p = 0; p < 3; ++p)
              if (P.error[p] < d) {
                const c = [], H = [], T = P._vertices[p], q = P._vertices[(p + 1) % 3];
                if (T.isBorder || q.isBorder)
                  continue;
                const b = S.Zero();
                this._calculateError(T, q, b);
                const j = [];
                if (this._isFlipped(T, q, b, c, j) || this._isFlipped(q, T, b, H, j) || c.indexOf(!0) < 0 || H.indexOf(!0) < 0)
                  continue;
                const w = [];
                if (j.forEach((N) => {
                  w.indexOf(N) === -1 && (N.deletePending = !0, w.push(N));
                }), w.length % 2 !== 0)
                  continue;
                T.q = q.q.add(T.q), T.updatePosition(b);
                const m = this._references.length;
                i = this._updateTriangles(T, T, c, i), i = this._updateTriangles(T, q, H, i);
                const I = this._references.length - m;
                if (I <= T.triangleCount) {
                  if (I)
                    for (let N = 0; N < I; N++)
                      this._references[T.triangleStart + N] = this._references[m + N];
                } else
                  T.triangleStart = m;
                T.triangleCount = I;
                break;
              }
          }
        };
        up.SyncAsyncForLoop(this._triangles.length, this.syncIterations, v, o, () => s - i <= n);
      }, 0);
    };
    up.Run(this.decimationIterations, (f) => {
      s - i <= n ? f.breakLoop() : a(f.index, () => {
        f.executeNext();
      });
    }, () => {
      setTimeout(() => {
        this._reconstructMesh(t), r();
      }, 0);
    });
  }
  _initWithMesh(e, t, r) {
    this._vertices = [], this._triangles = [];
    const n = this._mesh.getVerticesData(J.PositionKind), i = this._mesh.getIndices(), s = this._mesh.subMeshes[e], a = (v) => {
      if (r) {
        for (let u = 0; u < this._vertices.length; ++u)
          if (this._vertices[u].position.equalsWithEpsilon(v, 1e-4))
            return this._vertices[u];
      }
      return null;
    }, f = [], o = (v) => {
      if (!n)
        return;
      const u = v + s.verticesStart, l = S.FromArray(n, u * 3), P = a(l) || new jhe(l, this._vertices.length);
      P.originalOffsets.push(u), P.id === this._vertices.length && this._vertices.push(P), f.push(P.id);
    }, d = s.verticesCount;
    up.SyncAsyncForLoop(d, this.syncIterations / 4 >> 0, o, () => {
      const v = (u) => {
        if (!i)
          return;
        const P = (s.indexStart / 3 + u) * 3, p = i[P + 0], c = i[P + 1], H = i[P + 2], T = this._vertices[f[p - s.verticesStart]], q = this._vertices[f[c - s.verticesStart]], b = this._vertices[f[H - s.verticesStart]], j = new Dhe([T, q, b]);
        j.originalOffset = P, this._triangles.push(j);
      };
      up.SyncAsyncForLoop(s.indexCount / 3, this.syncIterations, v, () => {
        this._init(t);
      });
    });
  }
  _init(e) {
    const t = (r) => {
      const n = this._triangles[r];
      n.normal = S.Cross(n._vertices[1].position.subtract(n._vertices[0].position), n._vertices[2].position.subtract(n._vertices[0].position)).normalize();
      for (let i = 0; i < 3; i++)
        n._vertices[i].q.addArrayInPlace(iS.DataFromNumbers(n.normal.x, n.normal.y, n.normal.z, -S.Dot(n.normal, n._vertices[0].position)));
    };
    up.SyncAsyncForLoop(this._triangles.length, this.syncIterations, t, () => {
      const r = (n) => {
        const i = this._triangles[n];
        for (let s = 0; s < 3; ++s)
          i.error[s] = this._calculateError(i._vertices[s], i._vertices[(s + 1) % 3]);
        i.error[3] = Math.min(i.error[0], i.error[1], i.error[2]);
      };
      up.SyncAsyncForLoop(this._triangles.length, this.syncIterations, r, () => {
        e();
      });
    });
  }
  _reconstructMesh(e) {
    const t = [];
    let r;
    for (r = 0; r < this._vertices.length; ++r)
      this._vertices[r].triangleCount = 0;
    let n, i;
    for (r = 0; r < this._triangles.length; ++r)
      if (!this._triangles[r].deleted) {
        for (n = this._triangles[r], i = 0; i < 3; ++i)
          n._vertices[i].triangleCount = 1;
        t.push(n);
      }
    const s = this._reconstructedMesh.getVerticesData(J.PositionKind) || [], a = this._reconstructedMesh.getVerticesData(J.NormalKind) || [], f = this._reconstructedMesh.getVerticesData(J.UVKind) || [], o = this._reconstructedMesh.getVerticesData(J.ColorKind) || [], d = this._mesh.getVerticesData(J.NormalKind), v = this._mesh.getVerticesData(J.UVKind), u = this._mesh.getVerticesData(J.ColorKind);
    let l = 0;
    for (r = 0; r < this._vertices.length; ++r) {
      const b = this._vertices[r];
      b.id = l, b.triangleCount && b.originalOffsets.forEach((j) => {
        s.push(b.position.x), s.push(b.position.y), s.push(b.position.z), d && d.length && (a.push(d[j * 3]), a.push(d[j * 3 + 1]), a.push(d[j * 3 + 2])), v && v.length && (f.push(v[j * 2]), f.push(v[j * 2 + 1])), u && u.length && (o.push(u[j * 4]), o.push(u[j * 4 + 1]), o.push(u[j * 4 + 2]), o.push(u[j * 4 + 3])), ++l;
      });
    }
    const P = this._reconstructedMesh.getTotalIndices(), p = this._reconstructedMesh.getTotalVertices(), c = this._reconstructedMesh.subMeshes;
    this._reconstructedMesh.subMeshes = [];
    const H = this._reconstructedMesh.getIndices(), T = this._mesh.getIndices();
    for (r = 0; r < t.length; ++r)
      n = t[r], [0, 1, 2].forEach((b) => {
        const j = T[n.originalOffset + b];
        let w = n._vertices[b].originalOffsets.indexOf(j);
        w < 0 && (w = 0), H.push(n._vertices[b].id + w + p);
      });
    this._reconstructedMesh.setIndices(H), this._reconstructedMesh.setVerticesData(J.PositionKind, s), a.length > 0 && this._reconstructedMesh.setVerticesData(J.NormalKind, a), f.length > 0 && this._reconstructedMesh.setVerticesData(J.UVKind, f), o.length > 0 && this._reconstructedMesh.setVerticesData(J.ColorKind, o);
    const q = this._mesh.subMeshes[e];
    e > 0 && (this._reconstructedMesh.subMeshes = [], c.forEach((b) => {
      rA.AddToMesh(
        b.materialIndex,
        b.verticesStart,
        b.verticesCount,
        /* 0, newPositionData.length/3, */
        b.indexStart,
        b.indexCount,
        b.getMesh()
      );
    }), rA.AddToMesh(
      q.materialIndex,
      p,
      l,
      /* 0, newPositionData.length / 3, */
      P,
      t.length * 3,
      this._reconstructedMesh
    ));
  }
  _initDecimatedMesh() {
    this._reconstructedMesh = new Ee(this._mesh.name + "Decimated", this._mesh.getScene()), this._reconstructedMesh.material = this._mesh.material, this._reconstructedMesh.parent = this._mesh.parent, this._reconstructedMesh.isVisible = !1, this._reconstructedMesh.renderingGroupId = this._mesh.renderingGroupId;
  }
  _isFlipped(e, t, r, n, i) {
    for (let s = 0; s < e.triangleCount; ++s) {
      const a = this._triangles[this._references[e.triangleStart + s].triangleId];
      if (a.deleted)
        continue;
      const f = this._references[e.triangleStart + s].vertexId, o = a._vertices[(f + 1) % 3], d = a._vertices[(f + 2) % 3];
      if (o === t || d === t) {
        n[s] = !0, i.push(a);
        continue;
      }
      let v = o.position.subtract(r);
      v = v.normalize();
      let u = d.position.subtract(r);
      if (u = u.normalize(), Math.abs(S.Dot(v, u)) > 0.999)
        return !0;
      const l = S.Cross(v, u).normalize();
      if (n[s] = !1, S.Dot(l, a.normal) < 0.2)
        return !0;
    }
    return !1;
  }
  _updateTriangles(e, t, r, n) {
    let i = n;
    for (let s = 0; s < t.triangleCount; ++s) {
      const a = this._references[t.triangleStart + s], f = this._triangles[a.triangleId];
      if (!f.deleted) {
        if (r[s] && f.deletePending) {
          f.deleted = !0, i++;
          continue;
        }
        f._vertices[a.vertexId] = e, f.isDirty = !0, f.error[0] = this._calculateError(f._vertices[0], f._vertices[1]) + f.borderFactor / 2, f.error[1] = this._calculateError(f._vertices[1], f._vertices[2]) + f.borderFactor / 2, f.error[2] = this._calculateError(f._vertices[2], f._vertices[0]) + f.borderFactor / 2, f.error[3] = Math.min(f.error[0], f.error[1], f.error[2]), this._references.push(a);
      }
    }
    return i;
  }
  _identifyBorder() {
    for (let e = 0; e < this._vertices.length; ++e) {
      const t = [], r = [], n = this._vertices[e];
      let i;
      for (i = 0; i < n.triangleCount; ++i) {
        const s = this._triangles[this._references[n.triangleStart + i].triangleId];
        for (let a = 0; a < 3; a++) {
          let f = 0;
          const o = s._vertices[a];
          for (; f < t.length && r[f] !== o.id; )
            ++f;
          f === t.length ? (t.push(1), r.push(o.id)) : t[f]++;
        }
      }
      for (i = 0; i < t.length; ++i)
        t[i] === 1 ? this._vertices[r[i]].isBorder = !0 : this._vertices[r[i]].isBorder = !1;
    }
  }
  _updateMesh(e = !1) {
    let t;
    if (!e) {
      const f = [];
      for (t = 0; t < this._triangles.length; ++t)
        this._triangles[t].deleted || f.push(this._triangles[t]);
      this._triangles = f;
    }
    for (t = 0; t < this._vertices.length; ++t)
      this._vertices[t].triangleCount = 0, this._vertices[t].triangleStart = 0;
    let r, n, i;
    for (t = 0; t < this._triangles.length; ++t)
      for (r = this._triangles[t], n = 0; n < 3; ++n)
        i = r._vertices[n], i.triangleCount++;
    let s = 0;
    for (t = 0; t < this._vertices.length; ++t)
      this._vertices[t].triangleStart = s, s += this._vertices[t].triangleCount, this._vertices[t].triangleCount = 0;
    const a = new Array(this._triangles.length * 3);
    for (t = 0; t < this._triangles.length; ++t)
      for (r = this._triangles[t], n = 0; n < 3; ++n)
        i = r._vertices[n], a[i.triangleStart + i.triangleCount] = new whe(n, t), i.triangleCount++;
    this._references = a, e && this._identifyBorder();
  }
  _vertexError(e, t) {
    const r = t.x, n = t.y, i = t.z;
    return e.data[0] * r * r + 2 * e.data[1] * r * n + 2 * e.data[2] * r * i + 2 * e.data[3] * r + e.data[4] * n * n + 2 * e.data[5] * n * i + 2 * e.data[6] * n + e.data[7] * i * i + 2 * e.data[8] * i + e.data[9];
  }
  _calculateError(e, t, r) {
    const n = e.q.add(t.q), i = e.isBorder && t.isBorder;
    let s = 0;
    const a = n.det(0, 1, 2, 1, 4, 5, 2, 5, 7);
    if (a !== 0 && !i)
      r || (r = S.Zero()), r.x = -1 / a * n.det(1, 2, 3, 4, 5, 6, 5, 7, 8), r.y = 1 / a * n.det(0, 2, 3, 1, 5, 6, 2, 7, 8), r.z = -1 / a * n.det(0, 1, 3, 1, 4, 6, 2, 5, 8), s = this._vertexError(n, r);
    else {
      const f = e.position.add(t.position).divide(new S(2, 2, 2)), o = this._vertexError(n, e.position), d = this._vertexError(n, t.position), v = this._vertexError(n, f);
      s = Math.min(o, d, v), s === o ? r && r.copyFrom(e.position) : s === d ? r && r.copyFrom(t.position) : r && r.copyFrom(f);
    }
    return s;
  }
}
Object.defineProperty(sr.prototype, "simplificationQueue", {
  get: function() {
    if (!this._simplificationQueue) {
      this._simplificationQueue = new Pne();
      let A = this._getComponent(Ot.NAME_SIMPLIFICATIONQUEUE);
      A || (A = new pne(this), this._addComponent(A));
    }
    return this._simplificationQueue;
  },
  set: function(A) {
    this._simplificationQueue = A;
  },
  enumerable: !0,
  configurable: !0
});
Ee.prototype.simplify = function(A, e = !0, t = nR.QUADRATIC, r) {
  return this.getScene().simplificationQueue.addTask({
    settings: A,
    parallelProcessing: e,
    mesh: this,
    simplificationType: t,
    successCallback: r
  }), this;
};
class pne {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_SIMPLIFICATIONQUEUE, this.scene = e;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._beforeCameraUpdateStage.registerStep(Ot.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE, this, this._beforeCameraUpdate);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources
   */
  dispose() {
  }
  _beforeCameraUpdate() {
    this.scene._simplificationQueue && !this.scene._simplificationQueue.running && this.scene._simplificationQueue.executeNext();
  }
}
var m0;
(function(A) {
  A[A.POINTS_MODE_POINTS = 0] = "POINTS_MODE_POINTS", A[A.POINTS_MODE_PATHS = 1] = "POINTS_MODE_PATHS";
})(m0 || (m0 = {}));
var kS;
(function(A) {
  A[A.FACES_MODE_SINGLE_SIDED = 0] = "FACES_MODE_SINGLE_SIDED", A[A.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING = 1] = "FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING", A[A.FACES_MODE_DOUBLE_SIDED = 2] = "FACES_MODE_DOUBLE_SIDED";
})(kS || (kS = {}));
var cD;
(function(A) {
  A[A.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT = 0] = "AUTO_DIRECTIONS_FROM_FIRST_SEGMENT", A[A.AUTO_DIRECTIONS_FROM_ALL_SEGMENTS = 1] = "AUTO_DIRECTIONS_FROM_ALL_SEGMENTS", A[A.AUTO_DIRECTIONS_ENHANCED = 2] = "AUTO_DIRECTIONS_ENHANCED", A[A.AUTO_DIRECTIONS_NONE = 99] = "AUTO_DIRECTIONS_NONE";
})(cD || (cD = {}));
class dY extends Ee {
  constructor(e, t, r) {
    var n, i, s, a;
    super(e, t, null, null, !1, !1), this.name = e, this._options = r, this._lazy = !1, this._updatable = !1, this._engine = t.getEngine(), this._lazy = (n = r.lazy) !== null && n !== void 0 ? n : !1, this._updatable = (i = r.updatable) !== null && i !== void 0 ? i : !1, this._vertexPositions = [], this._indices = [], this._uvs = [], this._points = [], this._colorPointers = (s = r.colorPointers) !== null && s !== void 0 ? s : [], this._widths = (a = r.widths) !== null && a !== void 0 ? a : new Array(r.points.length).fill(1);
  }
  /**
   * "GreasedLineMesh"
   * @returns "GreasedLineMesh"
   */
  getClassName() {
    return "GreasedLineMesh";
  }
  _updateWidthsWithValue(e) {
    let t = 0;
    for (const n of this._points)
      t += n.length;
    const r = t / 3 * 2 - this._widths.length;
    for (let n = 0; n < r; n++)
      this._widths.push(e);
  }
  /**
   * Updated a lazy line. Rerenders the line and updates boundinfo as well.
   */
  updateLazy() {
    var e, t;
    this._setPoints(this._points), this._options.colorPointers || this._updateColorPointers(), this._createVertexBuffers((e = this._options.ribbonOptions) === null || e === void 0 ? void 0 : e.smoothShading), this.refreshBoundingInfo(), (t = this.greasedLineMaterial) === null || t === void 0 || t.updateLazy();
  }
  /**
   * Adds new points to the line. It doesn't rerenders the line if in lazy mode.
   * @param points points table
   */
  addPoints(e, t) {
    for (const r of e)
      this._points.push(r);
    this._lazy || this.setPoints(this._points, t);
  }
  /**
   * Dispose the line and it's resources
   */
  dispose() {
    super.dispose();
  }
  /**
   *
   * @returns true if the mesh was created in lazy mode
   */
  isLazy() {
    return this._lazy;
  }
  /**
   * Return the points offsets
   */
  get offsets() {
    return this._offsets;
  }
  /**
   * Sets point offests
   * @param offsets offset table [x,y,z, x,y,z, ....]
   */
  set offsets(e) {
    this._offsets = e, this._offsetsBuffer ? this._offsetsBuffer.update(e) : this._createOffsetsBuffer(e);
  }
  /**
   * Gets widths at each line point like [widthLower, widthUpper, widthLower, widthUpper, ...]
   */
  get widths() {
    return this._widths;
  }
  /**
   * Sets widths at each line point
   * @param widths width table [widthLower, widthUpper, widthLower, widthUpper ...]
   */
  set widths(e) {
    this._widths = e, this._lazy || this._widthsBuffer && this._widthsBuffer.update(e);
  }
  /**
   * Gets the color pointer. Each vertex need a color pointer. These color pointers points to the colors in the color table @see colors
   */
  get colorPointers() {
    return this._colorPointers;
  }
  /**
   * Sets the color pointer
   * @param colorPointers array of color pointer in the colors array. One pointer for every vertex is needed.
   */
  set colorPointers(e) {
    this._colorPointers = e, this._lazy || this._colorPointersBuffer && this._colorPointersBuffer.update(e);
  }
  /**
   * Gets the pluginMaterial associated with line
   */
  get greasedLineMaterial() {
    var e, t;
    if (this.material && this.material instanceof AY)
      return this.material;
    const r = (t = (e = this.material) === null || e === void 0 ? void 0 : e.pluginManager) === null || t === void 0 ? void 0 : t.getPlugin(o4.GREASED_LINE_MATERIAL_NAME);
    if (r)
      return r;
  }
  /**
   * Return copy the points.
   */
  get points() {
    const e = [];
    return sA.DeepCopy(this._points, e), e;
  }
  /**
   * Sets line points and rerenders the line.
   * @param points points table
   */
  setPoints(e, t) {
    this._points = e, this._updateWidths(), t != null && t.colorPointers || this._updateColorPointers(), this._setPoints(e, t);
  }
  _initGreasedLine() {
    this._vertexPositions = [], this._indices = [], this._uvs = [];
  }
  _createLineOptions() {
    return {
      points: this._points,
      colorPointers: this._colorPointers,
      lazy: this._lazy,
      updatable: this._updatable,
      uvs: this._uvs,
      widths: this._widths,
      ribbonOptions: this._options.ribbonOptions
    };
  }
  /**
   * Serializes this GreasedLineMesh
   * @param serializationObject object to write serialization to
   */
  serialize(e) {
    super.serialize(e), e.type = this.getClassName(), e.lineOptions = this._createLineOptions();
  }
  _createVertexBuffers(e = !1) {
    const t = new Ut();
    return t.positions = this._vertexPositions, t.indices = this._indices, t.uvs = this._uvs, e && (t.normals = [], Ut.ComputeNormals(this._vertexPositions, this._indices, t.normals)), t.applyToMesh(this, this._options.updatable), t;
  }
  _createOffsetsBuffer(e) {
    const t = this._scene.getEngine(), r = new P9(t, e, this._updatable, 3);
    this.setVerticesBuffer(r.createVertexBuffer("grl_offsets", 0, 3)), this._offsetsBuffer = r;
  }
}
Ee._GreasedLineMeshParser = (A, e) => T1.Parse(A, e);
class T1 extends dY {
  /**
   * GreasedLineMesh
   * @param name name of the mesh
   * @param scene the scene
   * @param _options mesh options
   */
  constructor(e, t, r) {
    super(e, t, r), this.name = e, this.intersectionThreshold = 0.1, this._previousAndSide = [], this._nextAndCounters = [], r.points && this.addPoints(Qs.ConvertPoints(r.points));
  }
  /**
   * "GreasedLineMesh"
   * @returns "GreasedLineMesh"
   */
  getClassName() {
    return "GreasedLineMesh";
  }
  _updateColorPointers() {
    if (this._options.colorPointers)
      return;
    let e = 0;
    this._colorPointers = [], this._points.forEach((t) => {
      for (let r = 0; r < t.length; r += 3)
        this._colorPointers.push(e), this._colorPointers.push(e++);
    });
  }
  _updateWidths() {
    super._updateWidthsWithValue(0);
  }
  _setPoints(e) {
    this._points = e, this._options.points = e, this._initGreasedLine();
    let t = 0;
    e.forEach((r) => {
      var n;
      const i = [], s = [], a = [], f = Qs.GetLineLength(r);
      for (let l = 0, P = 0; P < r.length; l++, P += 3) {
        const p = r.slice(0, P + 3), H = Qs.GetLineLength(p) / f;
        if (s.push(r[P], r[P + 1], r[P + 2]), s.push(r[P], r[P + 1], r[P + 2]), i.push(H), i.push(H), P < r.length - 3) {
          const T = l * 2 + t;
          a.push(T, T + 1, T + 2), a.push(T + 2, T + 1, T + 3);
        }
      }
      t += r.length / 3 * 2;
      const o = [], d = [], v = [];
      let u = [];
      this._preprocess(s, o, d, v, u);
      for (const l of s)
        this._vertexPositions.push(l);
      for (const l of a)
        this._indices.push(l);
      for (let l = 0; l < v.length; l++)
        this._previousAndSide.push(o[l * 3], o[l * 3 + 1], o[l * 3 + 2], v[l]), this._nextAndCounters.push(d[l * 3], d[l * 3 + 1], d[l * 3 + 2], i[l]);
      u = (n = this._options.uvs) !== null && n !== void 0 ? n : u;
      for (const l of u)
        this._uvs.push(l);
    }), this._lazy || (this._options.colorPointers || this._updateColorPointers(), this._createVertexBuffers(), this.refreshBoundingInfo());
  }
  /**
   * Clones the GreasedLineMesh.
   * @param name new line name
   * @param newParent new parent node
   * @returns cloned line
   */
  clone(e = `${this.name}-cloned`, t) {
    const r = this._createLineOptions(), n = {};
    sA.DeepCopy(r, n, ["instance"], void 0, !0);
    const i = new T1(e, this._scene, n);
    return t && (i.parent = t), i.material = this.material, i;
  }
  /**
   * Serializes this GreasedLineMesh
   * @param serializationObject object to write serialization to
   */
  serialize(e) {
    super.serialize(e), e.type = this.getClassName(), e.lineOptions = this._createLineOptions();
  }
  /**
   * Parses a serialized GreasedLineMesh
   * @param parsedMesh the serialized GreasedLineMesh
   * @param scene the scene to create the GreasedLineMesh in
   * @returns the created GreasedLineMesh
   */
  static Parse(e, t) {
    const r = e.lineOptions, n = e.name;
    return new T1(n, t, r);
  }
  _initGreasedLine() {
    super._initGreasedLine(), this._previousAndSide = [], this._nextAndCounters = [];
  }
  /**
   * Checks whether a ray is intersecting this GreasedLineMesh
   * @param ray ray to check the intersection of this mesh with
   * @param fastCheck not supported
   * @param trianglePredicate not supported
   * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
   * @param worldToUse not supported
   * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
   * @returns the picking info
   */
  intersects(e, t, r, n = !1, i, s = !1) {
    const a = new F9(), f = this.findAllIntersections(e, t, r, n, i, s, !0);
    if ((f == null ? void 0 : f.length) === 1) {
      const o = f[0];
      a.hit = !0, a.distance = o.distance, a.ray = e, a.pickedMesh = this, a.pickedPoint = o.point;
    }
    return a;
  }
  /**
   * Gets all intersections of a ray and the line
   * @param ray Ray to check the intersection of this mesh with
   * @param _fastCheck not supported
   * @param _trianglePredicate not supported
   * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
   * @param _worldToUse not supported
   * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
   * @param firstOnly If true, the first and only intersection is immediatelly returned if found
   * @returns intersection(s)
   */
  findAllIntersections(e, t, r, n = !1, i, s = !1, a = !1) {
    var f, o;
    if (n && !s && e.intersectsSphere(this._boundingSphere, this.intersectionThreshold) === !1)
      return;
    const d = this.getIndices(), v = this.getVerticesData(J.PositionKind), u = this._widths, l = (o = (f = this.greasedLineMaterial) === null || f === void 0 ? void 0 : f.width) !== null && o !== void 0 ? o : 1, P = [];
    if (d && v && u) {
      let p = 0, c = 0;
      for (p = 0, c = d.length - 1; p < c; p += 3) {
        const H = d[p], T = d[p + 1];
        T1._V_START.fromArray(v, H * 3), T1._V_END.fromArray(v, T * 3), this._offsets && (T1._V_OFFSET_START.fromArray(this._offsets, H * 3), T1._V_OFFSET_END.fromArray(this._offsets, T * 3), T1._V_START.addInPlace(T1._V_OFFSET_START), T1._V_END.addInPlace(T1._V_OFFSET_END));
        const q = Math.floor(p / 3), b = u[q] !== void 0 ? u[q] : 1, j = this.intersectionThreshold * (l * b) / 2, w = e.intersectionSegment(T1._V_START, T1._V_END, j);
        if (w !== -1 && (P.push({
          distance: w,
          point: e.direction.normalize().multiplyByFloats(w, w, w).add(e.origin)
        }), a))
          return P;
      }
      p = c;
    }
    return P;
  }
  get _boundingSphere() {
    return this.getBoundingInfo().boundingSphere;
  }
  static _CompareV3(e, t, r) {
    const n = e * 6, i = t * 6;
    return r[n] === r[i] && r[n + 1] === r[i + 1] && r[n + 2] === r[i + 2];
  }
  static _CopyV3(e, t) {
    const r = e * 6;
    return [t[r], t[r + 1], t[r + 2]];
  }
  _preprocess(e, t, r, n, i) {
    const s = e.length / 6;
    let a = [];
    T1._CompareV3(0, s - 1, e) ? a = T1._CopyV3(s - 2, e) : a = T1._CopyV3(0, e), t.push(a[0], a[1], a[2]), t.push(a[0], a[1], a[2]);
    for (let f = 0; f < s; f++)
      n.push(1), n.push(-1), this._options.uvs || (i.push(f / (s - 1), 0), i.push(f / (s - 1), 1)), f < s - 1 && (a = T1._CopyV3(f, e), t.push(a[0], a[1], a[2]), t.push(a[0], a[1], a[2])), f > 0 && (a = T1._CopyV3(f, e), r.push(a[0], a[1], a[2]), r.push(a[0], a[1], a[2]));
    return T1._CompareV3(s - 1, 0, e) ? a = T1._CopyV3(1, e) : a = T1._CopyV3(s - 1, e), r.push(a[0], a[1], a[2]), r.push(a[0], a[1], a[2]), {
      previous: t,
      next: r,
      uvs: i,
      side: n
    };
  }
  _createVertexBuffers() {
    const e = super._createVertexBuffers(), t = this._scene.getEngine(), r = new P9(t, this._previousAndSide, !1, 4);
    this.setVerticesBuffer(r.createVertexBuffer("grl_previousAndSide", 0, 4));
    const n = new P9(t, this._nextAndCounters, !1, 4);
    this.setVerticesBuffer(n.createVertexBuffer("grl_nextAndCounters", 0, 4));
    const i = new P9(t, this._widths, this._updatable, 1);
    this.setVerticesBuffer(i.createVertexBuffer("grl_widths", 0, 1)), this._widthsBuffer = i;
    const s = new P9(t, this._colorPointers, this._updatable, 1);
    return this.setVerticesBuffer(s.createVertexBuffer("grl_colorPointers", 0, 1)), this._colorPointersBuffer = s, e;
  }
}
T1._V_START = new S();
T1._V_END = new S();
T1._V_OFFSET_START = new S();
T1._V_OFFSET_END = new S();
Ee._GreasedLineRibbonMeshParser = (A, e) => L1.Parse(A, e);
class L1 extends dY {
  /**
   * GreasedLineRibbonMesh
   * @param name name of the mesh
   * @param scene the scene
   * @param _options mesh options
   * @param _pathOptions used internaly when parsing a serialized GreasedLineRibbonMesh
   */
  constructor(e, t, r, n) {
    var i;
    if (super(e, t, r), this.name = e, !r.ribbonOptions)
      throw "'GreasedLineMeshOptions.ribbonOptions' is not set.";
    this._paths = [], this._counters = [], this._slopes = [], this._widths = (i = r.widths) !== null && i !== void 0 ? i : [], this._ribbonWidths = [], this._pathsOptions = n ?? [], r.points && this.addPoints(Qs.ConvertPoints(r.points), r, !!n);
  }
  /**
   * Adds new points to the line. It doesn't rerenders the line if in lazy mode.
   * @param points points table
   */
  addPoints(e, t, r = !1) {
    if (!t.ribbonOptions)
      throw "addPoints() on GreasedLineRibbonMesh instance requires 'GreasedLineMeshOptions.ribbonOptions'.";
    r || this._pathsOptions.push({ options: t, pathCount: e.length }), super.addPoints(e, t);
  }
  /**
   * "GreasedLineRibbonMesh"
   * @returns "GreasedLineRibbonMesh"
   */
  getClassName() {
    return "GreasedLineRibbonMesh";
  }
  /**
   * Return true if the line was created from two edge paths or one points path.
   * In this case the line is always flat.
   */
  get isFlatLine() {
    return this._paths.length < 3;
  }
  /**
   * Returns the slopes of the line at each point relative to the center of the line
   */
  get slopes() {
    return this._slopes;
  }
  /**
   * Set the slopes of the line at each point relative to the center of the line
   */
  set slopes(e) {
    this._slopes = e;
  }
  _updateColorPointers() {
    if (this._options.colorPointers)
      return;
    let e = 0;
    this._colorPointers = [];
    for (let t = 0; t < this._pathsOptions.length; t++) {
      const { options: r, pathCount: n } = this._pathsOptions[t], i = this._points[t];
      if (r.ribbonOptions.pointsMode === m0.POINTS_MODE_POINTS)
        for (let s = 0; s < n; s++)
          for (let a = 0; a < i.length; a += 3)
            this._colorPointers.push(e), this._colorPointers.push(e++);
      else
        for (let s = 0; s < i.length; s += 3) {
          for (let a = 0; a < n; a++)
            this._colorPointers.push(e);
          e++;
        }
    }
  }
  _updateWidths() {
    super._updateWidthsWithValue(1);
  }
  _setPoints(e, t) {
    var r, n;
    if (!this._options.ribbonOptions)
      throw "No 'GreasedLineMeshOptions.ribbonOptions' provided.";
    this._points = e, this._options.points = e, this._initGreasedLine();
    let i = 0, s;
    for (let a = 0, f = 0; a < this._pathsOptions.length; a++) {
      const { options: o, pathCount: d } = this._pathsOptions[a], v = e.slice(f, f + d);
      if (f += d, ((r = o.ribbonOptions) === null || r === void 0 ? void 0 : r.pointsMode) === m0.POINTS_MODE_PATHS)
        i = this._preprocess(Qs.ToVector3Array(v), i, o);
      else {
        if (((n = o.ribbonOptions) === null || n === void 0 ? void 0 : n.directionsAutoMode) === cD.AUTO_DIRECTIONS_NONE) {
          if (!o.ribbonOptions.directions)
            throw "In GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_NONE 'GreasedLineMeshOptions.ribbonOptions.directions' must be defined.";
          s = L1._GetDirectionPlanesFromDirectionsOption(v.length, o.ribbonOptions.directions);
        }
        v.forEach((u, l) => {
          const P = L1._ConvertToRibbonPath(u, o.ribbonOptions, this._scene.useRightHandedSystem, s && s[l]);
          i = this._preprocess(P, i, o);
        });
      }
    }
    this._lazy || (this._createVertexBuffers(), this.refreshBoundingInfo());
  }
  static _GetDirectionPlanesFromDirectionsOption(e, t) {
    return Array.isArray(t) ? t : new Array(e).fill(t);
  }
  static _CreateRibbonVertexData(e, t) {
    var r, n, i;
    const s = e.length;
    if (s < 2)
      throw "Minimum of two paths are required to create a GreasedLineRibbonMesh.";
    const a = [], f = [], o = e[0];
    for (let l = 0; l < o.length; l++)
      for (let P = 0; P < e.length; P++) {
        const p = e[P][l];
        a.push(p.x, p.y, p.z);
      }
    const d = [1, 0, s], v = (n = ((r = t.ribbonOptions) === null || r === void 0 ? void 0 : r.facesMode) === kS.FACES_MODE_DOUBLE_SIDED) !== null && n !== void 0 ? n : !1, u = ((i = t.ribbonOptions) === null || i === void 0 ? void 0 : i.pointsMode) === m0.POINTS_MODE_PATHS && t.ribbonOptions.closePath;
    if (s > 2)
      for (let l = 0; l < o.length - 1; l++) {
        d[0] = 1 + s * l, d[1] = s * l, d[2] = (l + 1) * s;
        for (let P = 0; P < (s - 1) * 2; P++)
          P % 2 !== 0 && (d[2] += 1), P % 2 === 0 && P > 0 && (d[0] += 1, d[1] += 1), f.push(d[1] + (P % 2 !== 0 ? s : 0), d[0], d[2]), v && f.push(d[0], d[1] + (P % 2 !== 0 ? s : 0), d[2]);
      }
    else
      for (let l = 0; l < a.length / 3 - 3; l += 2)
        f.push(l, l + 1, l + 2), f.push(l + 2, l + 1, l + 3), v && (f.push(l + 1, l, l + 2), f.push(l + 1, l + 2, l + 3));
    if (u) {
      let l = s * (o.length - 1);
      for (let P = 0; P < s - 1; P++)
        f.push(l, P + 1, P), f.push(l + 1, P + 1, l), v && (f.push(P, P + 1, l), f.push(l, P + 1, l + 1)), l++;
    }
    return {
      positions: a,
      indices: f
    };
  }
  _preprocess(e, t, r) {
    var n, i, s, a;
    this._paths = e;
    const f = L1._CreateRibbonVertexData(e, r), o = f.positions;
    if (!this._options.widths)
      throw "No 'GreasedLineMeshOptions.widths' table is specified.";
    for (const P of o)
      this._vertexPositions.push(P);
    let d = e;
    if (((n = r.ribbonOptions) === null || n === void 0 ? void 0 : n.pointsMode) === m0.POINTS_MODE_PATHS && r.ribbonOptions.closePath) {
      d = [];
      for (let P = 0; P < e.length; P++) {
        const p = e[P].slice();
        p.push(e[P][0].clone()), d.push(p);
      }
    }
    this._calculateSegmentLengths(d);
    const v = d.length, u = new Array(v).fill(0);
    for (let P = 0; P < d[0].length; P++) {
      let p = 0;
      for (let c = 0; c < v; c++) {
        const H = u[c] + this._vSegmentLengths[c][P] / this._vTotalLengths[c];
        this._counters.push(H), this._uvs.push(H, p), u[c] = H, p += this._uSegmentLengths[P][c] / this._uTotalLengths[P];
      }
    }
    for (let P = 0, p = 0; P < d[0].length; P++) {
      const c = this._uSegmentLengths[P][0] / 2, H = this._uSegmentLengths[P][v - 1] / 2;
      this._ribbonWidths.push((((i = this._widths[p++]) !== null && i !== void 0 ? i : 1) - 1) * c);
      for (let T = 0; T < v - 2; T++)
        this._ribbonWidths.push(0);
      this._ribbonWidths.push((((s = this._widths[p++]) !== null && s !== void 0 ? s : 1) - 1) * H);
    }
    const l = ((a = r.ribbonOptions) === null || a === void 0 ? void 0 : a.pointsMode) === m0.POINTS_MODE_PATHS ? new Array(d[0].length * d.length * 6).fill(0) : L1._CalculateSlopes(d);
    for (const P of l)
      this._slopes.push(P);
    if (f.indices)
      for (let P = 0; P < f.indices.length; P++)
        this._indices.push(f.indices[P] + t);
    return t += o.length / 3, t;
  }
  static _ConvertToRibbonPath(e, t, r, n) {
    if (t.pointsMode === m0.POINTS_MODE_POINTS && !t.width)
      throw "'GreasedLineMeshOptions.ribbonOptiosn.width' must be specified in GreasedLineRibbonPointsMode.POINTS_MODE_POINTS.";
    const i = [], s = [];
    if (t.pointsMode === m0.POINTS_MODE_POINTS) {
      const a = t.width / 2, f = Qs.ToVector3Array(e);
      let o = null, d = null;
      t.directionsAutoMode === cD.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT && (n = L1._GetDirectionFromPoints(f[0], f[1], null));
      for (let v = 0; v < f.length - (n ? 0 : 1); v++) {
        const u = f[v], l = f[v + 1];
        if (n)
          o = n;
        else if (t.directionsAutoMode === cD.AUTO_DIRECTIONS_FROM_ALL_SEGMENTS)
          o = L1._GetDirectionFromPoints(u, l, o);
        else {
          const P = l.subtract(u);
          P.applyRotationQuaternionInPlace(P.x > P.y && P.x > P.z ? r ? L1._RightHandedForwardReadOnlyQuaternion : L1._LeftHandedForwardReadOnlyQuaternion : L1._LeftReadOnlyQuaternion), o = P.normalize();
        }
        d = o.multiplyByFloats(a, a, a), i.push(u.add(d)), s.push(u.subtract(d));
      }
      n || (i.push(f[f.length - 1].add(d)), s.push(f[f.length - 1].subtract(d)));
    }
    return [i, s];
  }
  static _GetDirectionFromPoints(e, t, r) {
    return e.x === t.x && (!r || (r == null ? void 0 : r.x) === 1) ? L1.DIRECTION_YZ : e.y === t.y ? L1.DIRECTION_XZ : e.z === t.z ? L1.DIRECTION_XY : L1.DIRECTION_XZ;
  }
  /**
   * Clones the GreasedLineRibbonMesh.
   * @param name new line name
   * @param newParent new parent node
   * @returns cloned line
   */
  clone(e = `${this.name}-cloned`, t) {
    const r = this._createLineOptions(), n = {}, i = [];
    sA.DeepCopy(this._pathsOptions, i, void 0, void 0, !0), sA.DeepCopy(r, n, ["instance"], void 0, !0);
    const s = new L1(e, this._scene, n, i);
    return t && (s.parent = t), s.material = this.material, s;
  }
  /**
   * Serializes this GreasedLineRibbonMesh
   * @param serializationObject object to write serialization to
   */
  serialize(e) {
    super.serialize(e), e.type = this.getClassName(), e.lineOptions = this._createLineOptions(), e.pathsOptions = this._pathsOptions;
  }
  /**
   * Parses a serialized GreasedLineRibbonMesh
   * @param parsedMesh the serialized GreasedLineRibbonMesh
   * @param scene the scene to create the GreasedLineRibbonMesh in
   * @returns the created GreasedLineRibbonMesh
   */
  static Parse(e, t) {
    const r = e.lineOptions, n = e.name, i = e.pathOptions;
    return new L1(n, t, r, i);
  }
  _initGreasedLine() {
    super._initGreasedLine(), this._paths = [], this._counters = [], this._slopes = [], this._ribbonWidths = [];
  }
  _calculateSegmentLengths(e) {
    const t = e.length;
    this._vSegmentLengths = new Array(t), this._vTotalLengths = new Array(t);
    let r = 0;
    for (let s = 0; s < t; s++) {
      const a = e[s];
      this._vSegmentLengths[s] = [0], r = 0;
      for (let f = 0; f < a.length - 1; f++) {
        const o = Math.abs(a[f].subtract(a[f + 1]).lengthSquared());
        r += o, this._vSegmentLengths[s].push(o);
      }
      this._vTotalLengths[s] = r;
    }
    const n = e[0].length;
    this._uSegmentLengths = new Array(n).fill([]), this._uTotalLengths = new Array(n).fill([]);
    const i = new S();
    for (let s = 0; s < n; s++) {
      r = 0;
      for (let a = 1; a < t; a++) {
        e[a][s].subtractToRef(e[a - 1][s], i);
        const f = i.length();
        r += f, this._uSegmentLengths[s].push(f);
      }
      this._uTotalLengths[s] = r;
    }
  }
  static _CalculateSlopes(e) {
    const t = e[0], r = e.length === 2 ? e[1] : e[e.length - 1], n = [], i = new S();
    for (let s = 0; s < t.length; s++)
      for (let a = 0; a < e.length; a++)
        a === 0 || a === e.length - 1 ? (t[s].subtract(r[s]).normalizeToRef(i), n.push(i.x, i.y, i.z), n.push(-i.x, -i.y, -i.z)) : n.push(0, 0, 0, 0, 0, 0);
    return n;
  }
  _createVertexBuffers() {
    var e, t;
    this._uvs = (e = this._options.uvs) !== null && e !== void 0 ? e : this._uvs;
    const r = super._createVertexBuffers((t = this._options.ribbonOptions) === null || t === void 0 ? void 0 : t.smoothShading), n = new P9(this._engine, this._counters, this._updatable, 1);
    this.setVerticesBuffer(n.createVertexBuffer("grl_counters", 0, 1));
    const i = new P9(this._engine, this._colorPointers, this._updatable, 1);
    this.setVerticesBuffer(i.createVertexBuffer("grl_colorPointers", 0, 1));
    const s = new P9(this._engine, this._slopes, this._updatable, 3);
    this.setVerticesBuffer(s.createVertexBuffer("grl_slopes", 0, 3));
    const a = new P9(this._engine, this._ribbonWidths, this._updatable, 1);
    return this.setVerticesBuffer(a.createVertexBuffer("grl_widths", 0, 1)), this._widthsBuffer = a, r;
  }
}
L1.DEFAULT_WIDTH = 0.1;
L1._RightHandedForwardReadOnlyQuaternion = Ze.RotationAxis(S.RightHandedForwardReadOnly, Math.PI / 2);
L1._LeftHandedForwardReadOnlyQuaternion = Ze.RotationAxis(S.LeftHandedForwardReadOnly, Math.PI / 2);
L1._LeftReadOnlyQuaternion = Ze.RotationAxis(S.LeftReadOnly, Math.PI / 2);
L1.DIRECTION_XY = S.LeftHandedForwardReadOnly;
L1.DIRECTION_XZ = S.UpReadOnly;
L1.DIRECTION_YZ = S.LeftReadOnly;
var E2;
(function(A) {
  A[A.COLOR_DISTRIBUTION_NONE = 0] = "COLOR_DISTRIBUTION_NONE", A[A.COLOR_DISTRIBUTION_REPEAT = 1] = "COLOR_DISTRIBUTION_REPEAT", A[A.COLOR_DISTRIBUTION_EVEN = 2] = "COLOR_DISTRIBUTION_EVEN", A[A.COLOR_DISTRIBUTION_START = 3] = "COLOR_DISTRIBUTION_START", A[A.COLOR_DISTRIBUTION_END = 4] = "COLOR_DISTRIBUTION_END", A[A.COLOR_DISTRIBUTION_START_END = 5] = "COLOR_DISTRIBUTION_START_END";
})(E2 || (E2 = {}));
var rq;
(function(A) {
  A[A.WIDTH_DISTRIBUTION_NONE = 0] = "WIDTH_DISTRIBUTION_NONE", A[A.WIDTH_DISTRIBUTION_REPEAT = 1] = "WIDTH_DISTRIBUTION_REPEAT", A[A.WIDTH_DISTRIBUTION_EVEN = 2] = "WIDTH_DISTRIBUTION_EVEN", A[A.WIDTH_DISTRIBUTION_START = 3] = "WIDTH_DISTRIBUTION_START", A[A.WIDTH_DISTRIBUTION_END = 4] = "WIDTH_DISTRIBUTION_END", A[A.WIDTH_DISTRIBUTION_START_END = 5] = "WIDTH_DISTRIBUTION_START_END";
})(rq || (rq = {}));
function hne(A, e, t) {
  t = t ?? gr.LastCreatedScene;
  let r;
  switch (e.materialType) {
    case OS.MATERIAL_TYPE_PBR:
      r = new mr(A, t), new o4(r, t, e);
      break;
    case OS.MATERIAL_TYPE_SIMPLE:
      r = new AY(A, t, e);
      break;
    default:
      r = new Wt(A, t), new o4(r, t, e);
      break;
  }
  return r;
}
function mhe(A, e, t, r) {
  var n, i, s, a, f, o, d, v, u, l, P, p;
  r = r ?? gr.LastCreatedScene;
  let c;
  const H = Qs.ConvertPoints(e.points);
  e.widthDistribution = (n = e.widthDistribution) !== null && n !== void 0 ? n : rq.WIDTH_DISTRIBUTION_START, e.ribbonOptions && (e.ribbonOptions.facesMode = (i = e.ribbonOptions.facesMode) !== null && i !== void 0 ? i : kS.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING, e.ribbonOptions.pointsMode = (s = e.ribbonOptions.pointsMode) !== null && s !== void 0 ? s : m0.POINTS_MODE_POINTS, e.ribbonOptions.directionsAutoMode = (a = e.ribbonOptions.directionsAutoMode) !== null && a !== void 0 ? a : e.ribbonOptions.directions ? cD.AUTO_DIRECTIONS_NONE : cD.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT), t = t ?? {
    color: D6.DEFAULT_COLOR
  }, t.createAndAssignMaterial = (f = t.createAndAssignMaterial) !== null && f !== void 0 ? f : !0, t.colorDistribution = (o = t == null ? void 0 : t.colorDistribution) !== null && o !== void 0 ? o : E2.COLOR_DISTRIBUTION_START, t.materialType = (d = t.materialType) !== null && d !== void 0 ? d : OS.MATERIAL_TYPE_STANDARD;
  let T = 0;
  Array.isArray(H[0]) && H.forEach((w) => {
    T += w.length / 3;
  });
  const q = Hne(T, (v = e.widths) !== null && v !== void 0 ? v : [], e.widthDistribution), b = t != null && t.colors ? gne(T, t.colors, t.colorDistribution, (u = t.color) !== null && u !== void 0 ? u : D6.DEFAULT_COLOR) : void 0, j = {
    points: H,
    updatable: e.updatable,
    widths: q,
    lazy: e.lazy,
    ribbonOptions: e.ribbonOptions,
    uvs: e.uvs,
    colorPointers: e.colorPointers
  };
  if (j.ribbonOptions && j.ribbonOptions.pointsMode === m0.POINTS_MODE_POINTS && (j.ribbonOptions.width = (P = (l = t.width) !== null && l !== void 0 ? l : j.ribbonOptions.width) !== null && P !== void 0 ? P : D6.DEFAULT_WIDTH), e.instance)
    if (c = e.instance, c instanceof L1)
      c.addPoints(H, j);
    else {
      const w = c.widths;
      if (w) {
        const m = w.slice();
        for (const I of q)
          m.push(I);
        c.widths = m;
      } else
        c.widths = q;
      c.addPoints(H);
    }
  else if (c = j.ribbonOptions ? new L1(A, r, j) : new T1(A, r, j), t) {
    const w = {
      materialType: t.materialType,
      dashCount: t.dashCount,
      dashOffset: t.dashOffset,
      dashRatio: t.dashRatio,
      resolution: t.resolution,
      sizeAttenuation: t.sizeAttenuation,
      useColors: t.useColors,
      useDash: t.useDash,
      visibility: t.visibility,
      width: t.width,
      color: t.color,
      colorMode: t.colorMode,
      colorsSampling: t.colorsSampling,
      colorDistributionType: t.colorDistributionType,
      colors: b,
      cameraFacing: !e.ribbonOptions,
      colorsTexture: t.colorsTexture
    };
    if (t.createAndAssignMaterial) {
      const m = hne(A, w, r);
      c.material = m, ((p = e.ribbonOptions) === null || p === void 0 ? void 0 : p.facesMode) === kS.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING && (m.backFaceCulling = !1);
    }
  }
  if (b && e.instance && e.instance.greasedLineMaterial) {
    const w = e.instance.greasedLineMaterial.colors;
    if (w) {
      const m = w.concat(b);
      e.instance.greasedLineMaterial.setColors(m, c.isLazy());
    }
  }
  return c;
}
function Hne(A, e, t, r = 1, n = 1) {
  const i = A - e.length / 2, s = [];
  if (i < 0)
    return e.slice(0, A * 2);
  if (i > 0) {
    if (e.length % 2 != 0 && e.push(r), t === rq.WIDTH_DISTRIBUTION_START_END) {
      const a = Math.floor(e.length / 2);
      for (let d = 0, v = 0; d < a - 1; d++)
        s.push(e[v++]), s.push(e[v++]);
      const f = e[a / 2], o = e[a / 2 + 1];
      for (let d = 0; d < i; d++)
        s.push(o), s.push(f);
      for (let d = a; d < e.length; d += 2)
        s.push(e[d]), s.push(e[d + 1]);
    } else if (t === rq.WIDTH_DISTRIBUTION_START) {
      for (let a = 0; a < e.length; a += 2)
        s.push(e[a]), s.push(e[a + 1]);
      for (let a = 0; a < i; a++)
        s.push(r), s.push(n);
    } else if (t === rq.WIDTH_DISTRIBUTION_END) {
      for (let a = 0; a < i; a++)
        s.push(r), s.push(n);
      for (let a = 0; a < e.length; a += 2)
        s.push(e[a]), s.push(e[a + 1]);
    } else if (t === rq.WIDTH_DISTRIBUTION_REPEAT) {
      let a = 0;
      for (let f = 0; f < A; f++)
        s.push(e[a++]), s.push(e[a++]), a === e.length && (a = 0);
    } else if (t === rq.WIDTH_DISTRIBUTION_EVEN) {
      let a = 0;
      const f = e.length / ((A - 1) * 2);
      for (let o = 0; o < A; o++) {
        const d = Math.floor(a);
        s.push(e[d]), s.push(e[d + 1]), a += f;
      }
    }
  } else
    for (let a = 0; a < e.length; a++)
      s.push(e[a]);
  return s;
}
function gne(A, e, t, r) {
  A = Math.max(e.length, A);
  const n = A - e.length;
  if (n < 0)
    return e.slice(0, A);
  const i = [];
  if (n > 0) {
    if (t === E2.COLOR_DISTRIBUTION_START_END) {
      const s = Math.floor(e.length / 2);
      for (let a = 0; a < s; a++)
        i.push(e[a]);
      for (let a = 0; a < n - 1; a++)
        i.push(r);
      for (let a = s; a < e.length; a++)
        i.push(e[a]);
    } else if (t === E2.COLOR_DISTRIBUTION_START) {
      for (let s = 0; s < e.length; s++)
        i.push(e[s]);
      for (let s = 0; s < n; s++)
        i.push(r);
    } else if (t === E2.COLOR_DISTRIBUTION_END) {
      for (let s = 0; s < n - 1; s++)
        i.push(r);
      for (let s = 0; s < e.length; s++)
        i.push(e[s]);
    } else if (t === E2.COLOR_DISTRIBUTION_REPEAT) {
      let s = 0;
      for (let a = 0; a < A; a++)
        i.push(e[s]), s++, s === e.length && (s = 0);
    } else if (t === E2.COLOR_DISTRIBUTION_EVEN) {
      let s = 0;
      const a = e.length / (A - 1);
      for (let f = 0; f < A - 1; f++) {
        const o = Math.floor(s);
        i.push(e[o]), s += a;
      }
    } else if (t === E2.COLOR_DISTRIBUTION_NONE)
      for (let s = 0; s < e.length; s++)
        i.push(e[s]);
  } else
    for (let s = 0; s < A; s++)
      i.push(e[s]);
  return i;
}
Ee.prototype.thinInstanceAdd = function(A, e = !0) {
  if (!this.getScene().getEngine().getCaps().instancedArrays)
    return Se.Error("Thin Instances are not supported on this device as Instanced Array extension not supported"), -1;
  this._thinInstanceUpdateBufferSize("matrix", Array.isArray(A) ? A.length : 1);
  const t = this._thinInstanceDataStorage.instancesCount;
  if (Array.isArray(A))
    for (let r = 0; r < A.length; ++r)
      this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, A[r], r === A.length - 1 && e);
  else
    this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, A, e);
  return t;
};
Ee.prototype.thinInstanceAddSelf = function(A = !0) {
  return this.thinInstanceAdd(he.IdentityReadOnly, A);
};
Ee.prototype.thinInstanceRegisterAttribute = function(A, e) {
  A === J.ColorKind && (A = J.ColorInstanceKind), this.removeVerticesData(A), this._thinInstanceInitializeUserStorage(), this._userThinInstanceBuffersStorage.strides[A] = e, this._userThinInstanceBuffersStorage.sizes[A] = e * Math.max(32, this._thinInstanceDataStorage.instancesCount), this._userThinInstanceBuffersStorage.data[A] = new Float32Array(this._userThinInstanceBuffersStorage.sizes[A]), this._userThinInstanceBuffersStorage.vertexBuffers[A] = new J(this.getEngine(), this._userThinInstanceBuffersStorage.data[A], A, !0, !1, e, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[A]);
};
Ee.prototype.thinInstanceSetMatrixAt = function(A, e, t = !0) {
  if (!this._thinInstanceDataStorage.matrixData || A >= this._thinInstanceDataStorage.instancesCount)
    return !1;
  const r = this._thinInstanceDataStorage.matrixData;
  return e.copyToArray(r, A * 16), this._thinInstanceDataStorage.worldMatrices && (this._thinInstanceDataStorage.worldMatrices[A] = e), t && (this.thinInstanceBufferUpdated("matrix"), this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1)), !0;
};
Ee.prototype.thinInstanceSetAttributeAt = function(A, e, t, r = !0) {
  return A === J.ColorKind && (A = J.ColorInstanceKind), !this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.data[A] || e >= this._thinInstanceDataStorage.instancesCount ? !1 : (this._thinInstanceUpdateBufferSize(A, 0), this._userThinInstanceBuffersStorage.data[A].set(t, e * this._userThinInstanceBuffersStorage.strides[A]), r && this.thinInstanceBufferUpdated(A), !0);
};
Object.defineProperty(Ee.prototype, "thinInstanceCount", {
  get: function() {
    return this._thinInstanceDataStorage.instancesCount;
  },
  set: function(A) {
    var e, t;
    const r = (e = this._thinInstanceDataStorage.matrixData) !== null && e !== void 0 ? e : (t = this.source) === null || t === void 0 ? void 0 : t._thinInstanceDataStorage.matrixData, n = r ? r.length / 16 : 0;
    A <= n && (this._thinInstanceDataStorage.instancesCount = A);
  },
  enumerable: !0,
  configurable: !0
});
Ee.prototype._thinInstanceCreateMatrixBuffer = function(A, e, t = !1) {
  A === J.ColorKind && (A = J.ColorInstanceKind);
  const r = new P9(this.getEngine(), e, !t, 16, !1, !0);
  for (let n = 0; n < 4; n++)
    this.setVerticesBuffer(r.createVertexBuffer(A + n, n * 4, 4));
  return r;
};
Ee.prototype.thinInstanceSetBuffer = function(A, e, t = 0, r = !1) {
  var n, i, s;
  t = t || 16, A === "matrix" ? ((n = this._thinInstanceDataStorage.matrixBuffer) === null || n === void 0 || n.dispose(), this._thinInstanceDataStorage.matrixBuffer = null, this._thinInstanceDataStorage.matrixBufferSize = e ? e.length : 32 * t, this._thinInstanceDataStorage.matrixData = e, this._thinInstanceDataStorage.worldMatrices = null, e !== null ? (this._thinInstanceDataStorage.instancesCount = e.length / t, this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", e, r), this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1)) : (this._thinInstanceDataStorage.instancesCount = 0, this.doNotSyncBoundingInfo || this.refreshBoundingInfo())) : A === "previousMatrix" ? ((i = this._thinInstanceDataStorage.previousMatrixBuffer) === null || i === void 0 || i.dispose(), this._thinInstanceDataStorage.previousMatrixBuffer = null, this._thinInstanceDataStorage.previousMatrixData = e, e !== null && (this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", e, r))) : (A === J.ColorKind && (A = J.ColorInstanceKind), e === null ? !((s = this._userThinInstanceBuffersStorage) === null || s === void 0) && s.data[A] && (this.removeVerticesData(A), delete this._userThinInstanceBuffersStorage.data[A], delete this._userThinInstanceBuffersStorage.strides[A], delete this._userThinInstanceBuffersStorage.sizes[A], delete this._userThinInstanceBuffersStorage.vertexBuffers[A]) : (this._thinInstanceInitializeUserStorage(), this._userThinInstanceBuffersStorage.data[A] = e, this._userThinInstanceBuffersStorage.strides[A] = t, this._userThinInstanceBuffersStorage.sizes[A] = e.length, this._userThinInstanceBuffersStorage.vertexBuffers[A] = new J(this.getEngine(), e, A, !r, !1, t, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[A])));
};
Ee.prototype.thinInstanceBufferUpdated = function(A) {
  var e, t, r;
  A === "matrix" ? (e = this._thinInstanceDataStorage.matrixBuffer) === null || e === void 0 || e.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, this._thinInstanceDataStorage.instancesCount) : A === "previousMatrix" ? (t = this._thinInstanceDataStorage.previousMatrixBuffer) === null || t === void 0 || t.updateDirectly(this._thinInstanceDataStorage.previousMatrixData, 0, this._thinInstanceDataStorage.instancesCount) : (A === J.ColorKind && (A = J.ColorInstanceKind), !((r = this._userThinInstanceBuffersStorage) === null || r === void 0) && r.vertexBuffers[A] && this._userThinInstanceBuffersStorage.vertexBuffers[A].updateDirectly(this._userThinInstanceBuffersStorage.data[A], 0));
};
Ee.prototype.thinInstancePartialBufferUpdate = function(A, e, t) {
  var r;
  A === "matrix" ? this._thinInstanceDataStorage.matrixBuffer && this._thinInstanceDataStorage.matrixBuffer.updateDirectly(e, t) : (A === J.ColorKind && (A = J.ColorInstanceKind), !((r = this._userThinInstanceBuffersStorage) === null || r === void 0) && r.vertexBuffers[A] && this._userThinInstanceBuffersStorage.vertexBuffers[A].updateDirectly(e, t));
};
Ee.prototype.thinInstanceGetWorldMatrices = function() {
  if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer)
    return [];
  const A = this._thinInstanceDataStorage.matrixData;
  if (!this._thinInstanceDataStorage.worldMatrices) {
    this._thinInstanceDataStorage.worldMatrices = [];
    for (let e = 0; e < this._thinInstanceDataStorage.instancesCount; ++e)
      this._thinInstanceDataStorage.worldMatrices[e] = he.FromArray(A, e * 16);
  }
  return this._thinInstanceDataStorage.worldMatrices;
};
Ee.prototype.thinInstanceRefreshBoundingInfo = function(A = !1, e = !1, t = !1) {
  if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer)
    return;
  const r = this._thinInstanceDataStorage.boundingVectors;
  if (A || !this.rawBoundingInfo) {
    r.length = 0, this.refreshBoundingInfo(e, t);
    const s = this.getBoundingInfo();
    this.rawBoundingInfo = new Md(s.minimum, s.maximum);
  }
  const n = this.getBoundingInfo(), i = this._thinInstanceDataStorage.matrixData;
  if (r.length === 0)
    for (let s = 0; s < n.boundingBox.vectors.length; ++s)
      r.push(n.boundingBox.vectors[s].clone());
  ue.Vector3[0].setAll(Number.POSITIVE_INFINITY), ue.Vector3[1].setAll(Number.NEGATIVE_INFINITY);
  for (let s = 0; s < this._thinInstanceDataStorage.instancesCount; ++s) {
    he.FromArrayToRef(i, s * 16, ue.Matrix[0]);
    for (let a = 0; a < r.length; ++a)
      S.TransformCoordinatesToRef(r[a], ue.Matrix[0], ue.Vector3[2]), ue.Vector3[0].minimizeInPlace(ue.Vector3[2]), ue.Vector3[1].maximizeInPlace(ue.Vector3[2]);
  }
  n.reConstruct(ue.Vector3[0], ue.Vector3[1]), this._updateBoundingInfo();
};
Ee.prototype._thinInstanceUpdateBufferSize = function(A, e = 1) {
  var t, r, n;
  A === J.ColorKind && (A = J.ColorInstanceKind);
  const i = A === "matrix";
  if (!i && (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.strides[A]))
    return;
  const s = i ? 16 : this._userThinInstanceBuffersStorage.strides[A], a = i ? this._thinInstanceDataStorage.matrixBufferSize : this._userThinInstanceBuffersStorage.sizes[A];
  let f = i ? this._thinInstanceDataStorage.matrixData : this._userThinInstanceBuffersStorage.data[A];
  const o = (this._thinInstanceDataStorage.instancesCount + e) * s;
  let d = a;
  for (; d < o; )
    d *= 2;
  if (!f || a != d) {
    if (!f)
      f = new Float32Array(d);
    else {
      const v = new Float32Array(d);
      v.set(f, 0), f = v;
    }
    i ? ((t = this._thinInstanceDataStorage.matrixBuffer) === null || t === void 0 || t.dispose(), this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", f, !1), this._thinInstanceDataStorage.matrixData = f, this._thinInstanceDataStorage.matrixBufferSize = d, this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData && ((r = this._thinInstanceDataStorage.previousMatrixBuffer) === null || r === void 0 || r.dispose(), this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", f, !1))) : ((n = this._userThinInstanceBuffersStorage.vertexBuffers[A]) === null || n === void 0 || n.dispose(), this._userThinInstanceBuffersStorage.data[A] = f, this._userThinInstanceBuffersStorage.sizes[A] = d, this._userThinInstanceBuffersStorage.vertexBuffers[A] = new J(this.getEngine(), f, A, !0, !1, s, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[A]));
  }
};
Ee.prototype._thinInstanceInitializeUserStorage = function() {
  this._userThinInstanceBuffersStorage || (this._userThinInstanceBuffersStorage = {
    data: {},
    sizes: {},
    vertexBuffers: {},
    strides: {}
  });
};
Ee.prototype._disposeThinInstanceSpecificData = function() {
  var A;
  !((A = this._thinInstanceDataStorage) === null || A === void 0) && A.matrixBuffer && (this._thinInstanceDataStorage.matrixBuffer.dispose(), this._thinInstanceDataStorage.matrixBuffer = null);
};
var Me;
(function(A) {
  A[A.Int = 1] = "Int", A[A.Float = 2] = "Float", A[A.Vector2 = 4] = "Vector2", A[A.Vector3 = 8] = "Vector3", A[A.Vector4 = 16] = "Vector4", A[A.Matrix = 32] = "Matrix", A[A.Geometry = 64] = "Geometry", A[A.Texture = 128] = "Texture", A[A.AutoDetect = 1024] = "AutoDetect", A[A.BasedOnInput = 2048] = "BasedOnInput", A[A.Undefined = 4096] = "Undefined", A[A.All = 4095] = "All";
})(Me || (Me = {}));
var $8;
(function(A) {
  A[A.Compatible = 0] = "Compatible", A[A.TypeIncompatible = 1] = "TypeIncompatible", A[A.HierarchyIssue = 2] = "HierarchyIssue";
})($8 || ($8 = {}));
var ES;
(function(A) {
  A[A.Input = 0] = "Input", A[A.Output = 1] = "Output";
})(ES || (ES = {}));
class qF {
  /** Gets the direction of the point */
  get direction() {
    return this._direction;
  }
  /**
   * Gets or sets the connection point type (default is float)
   */
  get type() {
    if (this._type === Me.AutoDetect) {
      if (this._ownerBlock.isInput)
        return this._ownerBlock.type;
      if (this._connectedPoint)
        return this._connectedPoint.type;
      if (this._linkedConnectionSource && this._linkedConnectionSource.isConnected)
        return this._linkedConnectionSource.type;
    }
    if (this._type === Me.BasedOnInput) {
      if (this._typeConnectionSource)
        return !this._typeConnectionSource.isConnected && this._defaultConnectionPointType ? this._defaultConnectionPointType : this._typeConnectionSource.type;
      if (this._defaultConnectionPointType)
        return this._defaultConnectionPointType;
    }
    return this._type;
  }
  set type(e) {
    this._type = e;
  }
  /**
   * Gets a boolean indicating that the current point is connected to another NodeMaterialBlock
   */
  get isConnected() {
    return this.connectedPoint !== null || this.hasEndpoints;
  }
  /** Get the other side of the connection (if any) */
  get connectedPoint() {
    return this._connectedPoint;
  }
  /** Get the block that owns this connection point */
  get ownerBlock() {
    return this._ownerBlock;
  }
  /** Get the block connected on the other side of this connection (if any) */
  get sourceBlock() {
    return this._connectedPoint ? this._connectedPoint.ownerBlock : null;
  }
  /** Get the block connected on the endpoints of this connection (if any) */
  get connectedBlocks() {
    return this._endpoints.length === 0 ? [] : this._endpoints.map((e) => e.ownerBlock);
  }
  /** Gets the list of connected endpoints */
  get endpoints() {
    return this._endpoints;
  }
  /** Gets a boolean indicating if that output point is connected to at least one input */
  get hasEndpoints() {
    return this._endpoints && this._endpoints.length > 0;
  }
  /** Get the inner type (ie AutoDetect for instance instead of the inferred one) */
  get innerType() {
    return this._linkedConnectionSource && this._linkedConnectionSource.isConnected ? this.type : this._type;
  }
  /** @internal */
  _resetCounters() {
    this._callCount = 0, this._executionCount = 0;
  }
  /**
   * Gets the number of times this point was called
   */
  get callCount() {
    return this._callCount;
  }
  /**
   * Gets the number of times this point was executed
   */
  get executionCount() {
    return this._executionCount;
  }
  /**
   * Gets the value represented by this connection point
   * @param state current evaluation state
   * @returns the connected value or the value if nothing is connected
   */
  getConnectedValue(e) {
    var t;
    return this.isConnected ? !((t = this._connectedPoint) === null || t === void 0) && t._storedFunction ? (this._connectedPoint._callCount++, this._connectedPoint._executionCount++, this._connectedPoint._storedFunction(e)) : (this._connectedPoint._callCount++, this._connectedPoint._executionCount = 1, this._connectedPoint._storedValue) : (this._callCount++, this._executionCount = 1, this.value);
  }
  /**
   * Creates a new connection point
   * @param name defines the connection point name
   * @param ownerBlock defines the block hosting this connection point
   * @param direction defines the direction of the connection point
   */
  constructor(e, t, r) {
    this._connectedPoint = null, this._storedValue = null, this._storedFunction = null, this._acceptedConnectionPointType = null, this._endpoints = new Array(), this._type = Me.Geometry, this._linkedConnectionSource = null, this._typeConnectionSource = null, this._defaultConnectionPointType = null, this.acceptedConnectionPointTypes = [], this.excludedConnectionPointTypes = [], this.onConnectionObservable = new Oe(), this.isExposedOnFrame = !1, this.exposedPortPosition = -1, this.defaultValue = null, this.value = null, this.valueMin = null, this.valueMax = null, this._callCount = 0, this._executionCount = 0, this._ownerBlock = t, this.name = e, this._direction = r;
  }
  /**
   * Gets the current class name e.g. "NodeMaterialConnectionPoint"
   * @returns the class name
   */
  getClassName() {
    return "NodeGeometryConnectionPoint";
  }
  /**
   * Gets a boolean indicating if the current point can be connected to another point
   * @param connectionPoint defines the other connection point
   * @returns a boolean
   */
  canConnectTo(e) {
    return this.checkCompatibilityState(e) === $8.Compatible;
  }
  /**
   * Gets a number indicating if the current point can be connected to another point
   * @param connectionPoint defines the other connection point
   * @returns a number defining the compatibility state
   */
  checkCompatibilityState(e) {
    const t = this._ownerBlock, r = e.ownerBlock;
    if (this.type !== e.type && e.innerType !== Me.AutoDetect)
      return e.acceptedConnectionPointTypes && e.acceptedConnectionPointTypes.indexOf(this.type) !== -1 ? $8.Compatible : $8.TypeIncompatible;
    if (e.excludedConnectionPointTypes && e.excludedConnectionPointTypes.indexOf(this.type) !== -1)
      return $8.TypeIncompatible;
    let n = r, i = t;
    return this.direction === ES.Input && (n = t, i = r), n.isAnAncestorOf(i) ? $8.HierarchyIssue : $8.Compatible;
  }
  /**
   * Connect this point to another connection point
   * @param connectionPoint defines the other connection point
   * @param ignoreConstraints defines if the system will ignore connection type constraints (default is false)
   * @returns the current connection point
   */
  connectTo(e, t = !1) {
    if (!t && !this.canConnectTo(e))
      throw "Cannot connect these two connectors.";
    return this._endpoints.push(e), e._connectedPoint = this, this.onConnectionObservable.notifyObservers(e), e.onConnectionObservable.notifyObservers(this), this;
  }
  /**
   * Disconnect this point from one of his endpoint
   * @param endpoint defines the other connection point
   * @returns the current connection point
   */
  disconnectFrom(e) {
    const t = this._endpoints.indexOf(e);
    return t === -1 ? this : (this._endpoints.splice(t, 1), e._connectedPoint = null, this);
  }
  /**
   * Fill the list of excluded connection point types with all types other than those passed in the parameter
   * @param mask Types (ORed values of NodeMaterialBlockConnectionPointTypes) that are allowed, and thus will not be pushed to the excluded list
   */
  addExcludedConnectionPointFromAllowedTypes(e) {
    let t = 1;
    for (; t < Me.All; )
      e & t || this.excludedConnectionPointTypes.push(t), t = t << 1;
  }
  /**
   * Serializes this point in a JSON representation
   * @param isInput defines if the connection point is an input (default is true)
   * @returns the serialized point object
   */
  serialize(e = !0) {
    const t = {};
    return t.name = this.name, t.displayName = this.displayName, this.value !== void 0 && this.value !== null && (this.value.asArray ? (t.valueType = "BABYLON." + this.value.getClassName(), t.value = this.value.asArray()) : (t.valueType = "number", t.value = this.value)), e && this.connectedPoint && (t.inputName = this.name, t.targetBlockId = this.connectedPoint.ownerBlock.uniqueId, t.targetConnectionName = this.connectedPoint.name), t;
  }
  /**
   * Release resources
   */
  dispose() {
    this.onConnectionObservable.clear();
  }
}
class yi {
  /**
   * Gets the time spent to build this block (in ms)
   */
  get buildExecutionTime() {
    return this._buildExecutionTime;
  }
  /**
   * Gets the list of input points
   */
  get inputs() {
    return this._inputs;
  }
  /** Gets the list of output points */
  get outputs() {
    return this._outputs;
  }
  /**
   * Gets or set the name of the block
   */
  get name() {
    return this._name;
  }
  set name(e) {
    this._name = e;
  }
  /**
   * Gets a boolean indicating if this block is an input
   */
  get isInput() {
    return this._isInput;
  }
  /**
   * Gets a boolean indicating if this block is a teleport out
   */
  get isTeleportOut() {
    return this._isTeleportOut;
  }
  /**
   * Gets a boolean indicating if this block is a teleport in
   */
  get isTeleportIn() {
    return this._isTeleportIn;
  }
  /**
   * Gets a boolean indicating if this block is a debug block
   */
  get isDebug() {
    return this._isDebug;
  }
  /**
   * Gets a boolean indicating that this block can only be used once per NodeGeometry
   */
  get isUnique() {
    return this._isUnique;
  }
  /**
   * Gets the current class name e.g. "NodeGeometryBlock"
   * @returns the class name
   */
  getClassName() {
    return "NodeGeometryBlock";
  }
  _inputRename(e) {
    return e;
  }
  _outputRename(e) {
    return e;
  }
  /**
   * Checks if the current block is an ancestor of a given block
   * @param block defines the potential descendant block to check
   * @returns true if block is a descendant
   */
  isAnAncestorOf(e) {
    for (const t of this._outputs)
      if (t.hasEndpoints) {
        for (const r of t.endpoints)
          if (r.ownerBlock === e || r.ownerBlock.isAnAncestorOf(e))
            return !0;
      }
    return !1;
  }
  /**
   * Checks if the current block is an ancestor of a given type
   * @param type defines the potential type to check
   * @returns true if block is a descendant
   */
  isAnAncestorOfType(e) {
    if (this.getClassName() === e)
      return !0;
    for (const t of this._outputs)
      if (t.hasEndpoints) {
        for (const r of t.endpoints)
          if (r.ownerBlock.isAnAncestorOfType(e))
            return !0;
      }
    return !1;
  }
  /**
   * Get the first descendant using a predicate
   * @param predicate defines the predicate to check
   * @returns descendant or null if none found
   */
  getDescendantOfPredicate(e) {
    if (e(this))
      return this;
    for (const t of this._outputs)
      if (t.hasEndpoints)
        for (const r of t.endpoints) {
          const n = r.ownerBlock.getDescendantOfPredicate(e);
          if (n)
            return n;
        }
    return null;
  }
  /**
   * Creates a new NodeGeometryBlock
   * @param name defines the block name
   */
  constructor(e) {
    this._name = "", this._isInput = !1, this._isTeleportOut = !1, this._isTeleportIn = !1, this._isDebug = !1, this._isUnique = !1, this._buildExecutionTime = 0, this.onBuildObservable = new Oe(), this._inputs = new Array(), this._outputs = new Array(), this._codeVariableName = "", this.visibleOnFrame = !1, this._name = e, this.uniqueId = bR.UniqueId;
  }
  /**
   * Register a new input. Must be called inside a block constructor
   * @param name defines the connection point name
   * @param type defines the connection point type
   * @param isOptional defines a boolean indicating that this input can be omitted
   * @param value value to return if there is no connection
   * @param valueMin min value accepted for value
   * @param valueMax max value accepted for value
   * @returns the current block
   */
  registerInput(e, t, r = !1, n, i, s) {
    const a = new qF(e, this, ES.Input);
    return a.type = t, a.isOptional = r, a.defaultValue = n, a.value = n, a.valueMin = i, a.valueMax = s, this._inputs.push(a), this;
  }
  /**
   * Register a new output. Must be called inside a block constructor
   * @param name defines the connection point name
   * @param type defines the connection point type
   * @param point an already created connection point. If not provided, create a new one
   * @returns the current block
   */
  registerOutput(e, t, r) {
    return r = r ?? new qF(e, this, ES.Output), r.type = t, this._outputs.push(r), this;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _buildBlock(e) {
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _customBuildStep(e) {
  }
  /**
   * Build the current node and generate the vertex data
   * @param state defines the current generation state
   * @returns true if already built
   */
  build(e) {
    if (this._buildId === e.buildId)
      return !0;
    if (this._outputs.length > 0) {
      if (!this._outputs.some((r) => r.hasEndpoints) && !this.isDebug)
        return !1;
      this.outputs.forEach((r) => r._resetCounters());
    }
    this._buildId = e.buildId;
    for (const r of this._inputs) {
      if (!r.connectedPoint) {
        r.isOptional || e.notConnectedNonOptionalInputs.push(r);
        continue;
      }
      const n = r.connectedPoint.ownerBlock;
      n && n !== this && n.build(e);
    }
    this._customBuildStep(e), e.verbose && console.log(`Building ${this.name} [${this.getClassName()}]`);
    const t = Yi.Now;
    this._buildBlock(e), this._buildExecutionTime = Yi.Now - t;
    for (const r of this._outputs)
      for (const n of r.endpoints) {
        const i = n.ownerBlock;
        i && i.build(e);
      }
    return this.onBuildObservable.notifyObservers(this), !1;
  }
  _linkConnectionTypes(e, t, r = !1) {
    r ? this._inputs[t]._acceptedConnectionPointType = this._inputs[e] : this._inputs[e]._linkedConnectionSource = this._inputs[t], this._inputs[t]._linkedConnectionSource = this._inputs[e];
  }
  /**
   * Initialize the block and prepare the context for build
   */
  initialize() {
  }
  /**
   * Lets the block try to connect some inputs automatically
   */
  autoConfigure() {
  }
  /**
   * Find an input by its name
   * @param name defines the name of the input to look for
   * @returns the input or null if not found
   */
  getInputByName(e) {
    const t = this._inputs.filter((r) => r.name === e);
    return t.length ? t[0] : null;
  }
  /**
   * Find an output by its name
   * @param name defines the name of the output to look for
   * @returns the output or null if not found
   */
  getOutputByName(e) {
    const t = this._outputs.filter((r) => r.name === e);
    return t.length ? t[0] : null;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = {};
    e.customType = "BABYLON." + this.getClassName(), e.id = this.uniqueId, e.name = this.name, e.inputs = [], e.outputs = [];
    for (const t of this.inputs)
      e.inputs.push(t.serialize());
    for (const t of this.outputs)
      e.outputs.push(t.serialize(!1));
    return e;
  }
  /**
   * @internal
   */
  _deserialize(e) {
    this._name = e.name, this.comments = e.comments, this.visibleOnFrame = !!e.visibleOnFrame, this._deserializePortDisplayNamesAndExposedOnFrame(e);
  }
  _deserializePortDisplayNamesAndExposedOnFrame(e) {
    const t = e.inputs, r = e.outputs;
    t && t.forEach((n) => {
      const i = this.inputs.find((s) => s.name === n.name);
      if (i && (n.displayName && (i.displayName = n.displayName), n.isExposedOnFrame && (i.isExposedOnFrame = n.isExposedOnFrame, i.exposedPortPosition = n.exposedPortPosition), n.value !== void 0 && n.value !== null))
        if (n.valueType === "number")
          i.value = n.value;
        else {
          const s = Jo(n.valueType);
          s && (i.value = s.FromArray(n.value));
        }
    }), r && r.forEach((n, i) => {
      n.displayName && (this.outputs[i].displayName = n.displayName), n.isExposedOnFrame && (this.outputs[i].isExposedOnFrame = n.isExposedOnFrame, this.outputs[i].exposedPortPosition = n.exposedPortPosition);
    });
  }
  _dumpPropertiesCode() {
    return `${this._codeVariableName}.visibleOnFrame = ${this.visibleOnFrame};
`;
  }
  /**
   * @internal
   */
  _dumpCodeForOutputConnections(e) {
    let t = "";
    if (e.indexOf(this) !== -1)
      return t;
    e.push(this);
    for (const r of this.inputs) {
      if (!r.isConnected)
        continue;
      const n = r.connectedPoint, i = n.ownerBlock;
      t += i._dumpCodeForOutputConnections(e), t += `${i._codeVariableName}.${i._outputRename(n.name)}.connectTo(${this._codeVariableName}.${this._inputRename(r.name)});
`;
    }
    return t;
  }
  /**
   * @internal
   */
  _dumpCode(e, t) {
    t.push(this);
    const r = this.name.replace(/[^A-Za-z_]+/g, "");
    if (this._codeVariableName = r || `${this.getClassName()}_${this.uniqueId}`, e.indexOf(this._codeVariableName) !== -1) {
      let i = 0;
      do
        i++, this._codeVariableName = r + i;
      while (e.indexOf(this._codeVariableName) !== -1);
    }
    e.push(this._codeVariableName);
    let n = `
// ${this.getClassName()}
`;
    this.comments && (n += `// ${this.comments}
`), n += `var ${this._codeVariableName} = new BABYLON.${this.getClassName()}("${this.name}");
`, n += this._dumpPropertiesCode();
    for (const i of this.inputs) {
      if (!i.isConnected)
        continue;
      const a = i.connectedPoint.ownerBlock;
      t.indexOf(a) === -1 && (n += a._dumpCode(e, t));
    }
    for (const i of this.outputs)
      if (i.hasEndpoints)
        for (const s of i.endpoints) {
          const a = s.ownerBlock;
          a && t.indexOf(a) === -1 && (n += a._dumpCode(e, t));
        }
    return n;
  }
  /**
   * Clone the current block to a new identical block
   * @returns a copy of the current block
   */
  clone() {
    const e = this.serialize(), t = Jo(e.customType);
    if (t) {
      const r = new t();
      return r._deserialize(e), r;
    }
    return null;
  }
  /**
   * Release resources
   */
  dispose() {
    for (const e of this.inputs)
      e.dispose();
    for (const e of this.outputs)
      e.dispose();
    this.onBuildObservable.clear();
  }
}
C([
  M("comment")
], yi.prototype, "comments", void 0);
class vY extends yi {
  /**
   * Gets the current vertex data if the graph was successfully built
   */
  get currentVertexData() {
    return this._vertexData;
  }
  /**
   * Create a new GeometryOutputBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this._vertexData = null, this._isUnique = !0, this.registerInput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GeometryOutputBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  _buildBlock(e) {
    e.vertexData = this.geometry.getConnectedValue(e), this._vertexData = e.vertexData;
  }
}
Ue("BABYLON.GeometryOutputBlock", vY);
var Ws;
(function(A) {
  A[A.None = 0] = "None", A[A.Positions = 1] = "Positions", A[A.Normals = 2] = "Normals", A[A.Tangents = 3] = "Tangents", A[A.UV = 4] = "UV", A[A.UV2 = 5] = "UV2", A[A.UV3 = 6] = "UV3", A[A.UV4 = 7] = "UV4", A[A.UV5 = 8] = "UV5", A[A.UV6 = 9] = "UV6", A[A.Colors = 10] = "Colors", A[A.VertexID = 11] = "VertexID", A[A.FaceID = 12] = "FaceID", A[A.GeometryID = 13] = "GeometryID", A[A.CollectionID = 14] = "CollectionID", A[A.LoopID = 15] = "LoopID", A[A.InstanceID = 16] = "InstanceID";
})(Ws || (Ws = {}));
class Xne {
  constructor() {
    this._rotationMatrix = new he(), this._scalingMatrix = new he(), this._positionMatrix = new he(), this._scalingRotationMatrix = new he(), this._transformMatrix = new he(), this._tempVector3 = new S(), this.notConnectedNonOptionalInputs = [], this.noContextualData = [], this.vertexData = null, this._geometryContext = null, this._executionContext = null, this._instancingContext = null, this._geometryContextStack = [], this._executionContextStack = [], this._instancingContextStack = [];
  }
  /** Gets or sets the geometry context */
  get geometryContext() {
    return this._geometryContext;
  }
  /** Gets or sets the execution context */
  get executionContext() {
    return this._executionContext;
  }
  /** Gets or sets the instancing context */
  get instancingContext() {
    return this._instancingContext;
  }
  /**
   * Push the new active geometry context
   * @param geometryContext defines the geometry context
   */
  pushGeometryContext(e) {
    this._geometryContext = e, this._geometryContextStack.push(this._geometryContext);
  }
  /**
   * Push the new active execution context
   * @param executionContext defines the execution context
   */
  pushExecutionContext(e) {
    this._executionContext = e, this._executionContextStack.push(this._executionContext);
  }
  /**
   * Push the new active instancing context
   * @param instancingContext defines the instancing context
   */
  pushInstancingContext(e) {
    this._instancingContext = e, this._instancingContextStack.push(this._instancingContext);
  }
  /**
   * Remove current geometry context and restore the previous one
   */
  restoreGeometryContext() {
    this._geometryContextStack.pop(), this._geometryContext = this._geometryContextStack.length > 0 ? this._geometryContextStack[this._geometryContextStack.length - 1] : null;
  }
  /**
   * Remove current execution context and restore the previous one
   */
  restoreExecutionContext() {
    this._executionContextStack.pop(), this._executionContext = this._executionContextStack.length > 0 ? this._executionContextStack[this._executionContextStack.length - 1] : null;
  }
  /**
   * Remove current isntancing context and restore the previous one
   */
  restoreInstancingContext() {
    this._instancingContextStack.pop(), this._instancingContext = this._instancingContextStack.length > 0 ? this._instancingContextStack[this._instancingContextStack.length - 1] : null;
  }
  /**
   * Gets the value associated with a contextual source
   * @param source Source of the contextual value
   * @param skipWarning Do not store the warning for reporting if true
   * @returns the value associated with the source
   */
  getContextualValue(e, t = !1) {
    if (!this.executionContext)
      return t || this.noContextualData.push(e), null;
    const r = this.executionContext.getExecutionIndex();
    switch (e) {
      case Ws.Positions:
        return this.executionContext.getOverridePositionsContextualValue ? this.executionContext.getOverridePositionsContextualValue() : !this.geometryContext || !this.geometryContext.positions ? S.Zero() : S.FromArray(this.geometryContext.positions, r * 3);
      case Ws.Normals:
        return this.executionContext.getOverrideNormalsContextualValue ? this.executionContext.getOverrideNormalsContextualValue() : !this.geometryContext || !this.geometryContext.normals ? S.Zero() : S.FromArray(this.geometryContext.normals, r * 3);
      case Ws.Colors:
        return !this.geometryContext || !this.geometryContext.colors ? Ir.Zero() : Ir.FromArray(this.geometryContext.colors, r * 4);
      case Ws.Tangents:
        return !this.geometryContext || !this.geometryContext.tangents ? Ir.Zero() : Ir.FromArray(this.geometryContext.tangents, r * 4);
      case Ws.UV:
        return this.executionContext.getOverrideUVs1ContextualValue ? this.executionContext.getOverrideUVs1ContextualValue() : !this.geometryContext || !this.geometryContext.uvs ? at.Zero() : at.FromArray(this.geometryContext.uvs, r * 2);
      case Ws.UV2:
        return !this.geometryContext || !this.geometryContext.uvs2 ? at.Zero() : at.FromArray(this.geometryContext.uvs2, r * 2);
      case Ws.UV3:
        return !this.geometryContext || !this.geometryContext.uvs3 ? at.Zero() : at.FromArray(this.geometryContext.uvs3, r * 2);
      case Ws.UV4:
        return !this.geometryContext || !this.geometryContext.uvs4 ? at.Zero() : at.FromArray(this.geometryContext.uvs4, r * 2);
      case Ws.UV5:
        return !this.geometryContext || !this.geometryContext.uvs5 ? at.Zero() : at.FromArray(this.geometryContext.uvs5, r * 2);
      case Ws.UV6:
        return !this.geometryContext || !this.geometryContext.uvs6 ? at.Zero() : at.FromArray(this.geometryContext.uvs6, r * 2);
      case Ws.VertexID:
        return r;
      case Ws.FaceID:
        return this.executionContext.getExecutionFaceIndex();
      case Ws.LoopID:
        return this.executionContext.getExecutionLoopIndex();
      case Ws.InstanceID:
        return this.instancingContext ? this.instancingContext.getInstanceIndex() : 0;
      case Ws.GeometryID:
        return this.geometryContext ? this.geometryContext.uniqueId : 0;
      case Ws.CollectionID:
        return !this.geometryContext || !this.geometryContext.metadata ? 0 : this.geometryContext.metadata.collectionId || 0;
    }
    return null;
  }
  /**
   * Adapt a value to a target type
   * @param source defines the value to adapt
   * @param targetType defines the target type
   * @returns the adapted value
   */
  adapt(e, t) {
    const r = e.getConnectedValue(this) || 0;
    if (e.type === t)
      return r;
    switch (t) {
      case Me.Vector2:
        return new at(r, r);
      case Me.Vector3:
        return new S(r, r, r);
      case Me.Vector4:
        return new Ir(r, r, r, r);
    }
    return null;
  }
  /**
   * Adapt an input value to a target type
   * @param source defines the value to adapt
   * @param targetType defines the target type
   * @param defaultValue defines the default value to use if not connected
   * @returns the adapted value
   */
  adaptInput(e, t, r) {
    var n;
    if (!e.isConnected)
      return e.value || r;
    const i = e.getConnectedValue(this);
    if (((n = e._connectedPoint) === null || n === void 0 ? void 0 : n.type) === t)
      return i;
    switch (t) {
      case Me.Vector2:
        return new at(i, i);
      case Me.Vector3:
        return new S(i, i, i);
      case Me.Vector4:
        return new Ir(i, i, i, i);
    }
    return null;
  }
  /**
   * Emits console errors and exceptions if there is a failing check
   */
  emitErrors() {
    let e = "";
    for (const t of this.notConnectedNonOptionalInputs)
      e += `input ${t.name} from block ${t.ownerBlock.name}[${t.ownerBlock.getClassName()}] is not connected and is not optional.
`;
    for (const t of this.noContextualData)
      e += `Contextual input ${Ws[t]} has no context to pull data from (must be connected to a setXXX block or a instantiateXXX block).
`;
    if (e)
      throw `Build of NodeGeometry failed:
` + e;
  }
  /** @internal  */
  _instantiate(e, t, r, n, i) {
    he.ScalingToRef(n.x, n.y, n.z, this._scalingMatrix), he.RotationYawPitchRollToRef(r.y, r.x, r.z, this._rotationMatrix), he.TranslationToRef(t.x, t.y, t.z, this._positionMatrix), this._scalingMatrix.multiplyToRef(this._rotationMatrix, this._scalingRotationMatrix), this._scalingRotationMatrix.multiplyToRef(this._positionMatrix, this._transformMatrix);
    for (let s = 0; s < e.positions.length; s += 3)
      this._tempVector3.fromArray(e.positions, s), S.TransformCoordinatesToRef(this._tempVector3, this._transformMatrix, this._tempVector3), this._tempVector3.toArray(e.positions, s), e.normals && (this._tempVector3.fromArray(e.normals, s), S.TransformNormalToRef(this._tempVector3, this._scalingRotationMatrix, this._tempVector3), this._tempVector3.toArray(e.normals, s));
    i.push(e);
  }
  /** @internal  */
  _instantiateWithMatrix(e, t, r) {
    for (let n = 0; n < e.positions.length; n += 3)
      this._tempVector3.fromArray(e.positions, n), S.TransformCoordinatesToRef(this._tempVector3, t, this._tempVector3), this._tempVector3.toArray(e.positions, n), e.normals && (this._tempVector3.fromArray(e.normals, n), S.TransformNormalToRef(this._tempVector3, t, this._tempVector3), this._tempVector3.toArray(e.normals, n));
    r.push(e);
  }
  /** @internal  */
  _instantiateWithPositionAndMatrix(e, t, r, n) {
    he.TranslationToRef(t.x, t.y, t.z, this._positionMatrix), r.multiplyToRef(this._positionMatrix, this._transformMatrix);
    for (let i = 0; i < e.positions.length; i += 3)
      this._tempVector3.fromArray(e.positions, i), S.TransformCoordinatesToRef(this._tempVector3, this._transformMatrix, this._tempVector3), this._tempVector3.toArray(e.positions, i), e.normals && (this._tempVector3.fromArray(e.normals, i), S.TransformNormalToRef(this._tempVector3, this._transformMatrix, this._tempVector3), this._tempVector3.toArray(e.normals, i));
    n.push(e);
  }
}
class xf extends yi {
  /**
   * Gets or sets the connection point type (default is float)
   */
  get type() {
    if (this._type === Me.AutoDetect && this.value != null) {
      if (!isNaN(this.value))
        return this._type = Me.Float, this._type;
      switch (this.value.getClassName()) {
        case "Vector2":
          return this._type = Me.Vector2, this._type;
        case "Vector3":
          return this._type = Me.Vector3, this._type;
        case "Vector4":
          return this._type = Me.Vector4, this._type;
        case "Matrix":
          return this._type = Me.Matrix, this._type;
      }
    }
    return this._type;
  }
  /**
   * Gets a boolean indicating that the current connection point is a contextual value
   */
  get isContextual() {
    return this._contextualSource !== Ws.None;
  }
  /**
   * Gets or sets the current contextual value
   */
  get contextualValue() {
    return this._contextualSource;
  }
  set contextualValue(e) {
    switch (this._contextualSource = e, e) {
      case Ws.Positions:
      case Ws.Normals:
        this._type = Me.Vector3;
        break;
      case Ws.Colors:
      case Ws.Tangents:
        this._type = Me.Vector4;
        break;
      case Ws.UV:
      case Ws.UV2:
      case Ws.UV3:
      case Ws.UV4:
      case Ws.UV5:
      case Ws.UV6:
        this._type = Me.Vector2;
        break;
      case Ws.VertexID:
      case Ws.GeometryID:
      case Ws.CollectionID:
      case Ws.FaceID:
      case Ws.LoopID:
      case Ws.InstanceID:
        this._type = Me.Int;
        break;
    }
    this.output && (this.output.type = this._type);
  }
  /**
   * Creates a new InputBlock
   * @param name defines the block name
   * @param type defines the type of the input (can be set to NodeGeometryBlockConnectionPointTypes.AutoDetect)
   */
  constructor(e, t = Me.AutoDetect) {
    super(e), this._type = Me.Undefined, this._contextualSource = Ws.None, this.min = 0, this.max = 0, this.groupInInspector = "", this.onValueChangedObservable = new Oe(), this._type = t, this._isInput = !0, this.setDefaultValue(), this.registerOutput("output", t);
  }
  /**
   * Gets or sets the value of that point.
   * Please note that this value will be ignored if valueCallback is defined
   */
  get value() {
    return this._storedValue;
  }
  set value(e) {
    this.type === Me.Float && this.min !== this.max && (e = Math.max(this.min, e), e = Math.min(this.max, e)), this._storedValue = e, this.onValueChangedObservable.notifyObservers(this);
  }
  /**
   * Gets or sets a callback used to get the value of that point.
   * Please note that setting this value will force the connection point to ignore the value property
   */
  get valueCallback() {
    return this._valueCallback;
  }
  set valueCallback(e) {
    this._valueCallback = e;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GeometryInputBlock";
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Set the input block to its default value (based on its type)
   */
  setDefaultValue() {
    switch (this.contextualValue = Ws.None, this.type) {
      case Me.Int:
      case Me.Float:
        this.value = 0;
        break;
      case Me.Vector2:
        this.value = at.Zero();
        break;
      case Me.Vector3:
        this.value = S.Zero();
        break;
      case Me.Vector4:
        this.value = Ir.Zero();
        break;
      case Me.Matrix:
        this.value = he.Identity();
        break;
    }
  }
  _buildBlock(e) {
    super._buildBlock(e), this.isContextual ? (this.output._storedValue = null, this.output._storedFunction = (t) => t.getContextualValue(this._contextualSource)) : (this.output._storedFunction = null, this.output._storedValue = this.value);
  }
  dispose() {
    this.onValueChangedObservable.clear(), super.dispose();
  }
  _dumpPropertiesCode() {
    const e = this._codeVariableName;
    if (this.isContextual)
      return super._dumpPropertiesCode() + `${e}.contextualValue = BABYLON.NodeGeometryContextualSources.${Ws[this._contextualSource]};
`;
    const t = [];
    let r = "";
    switch (this.type) {
      case Me.Float:
      case Me.Int:
        r = `${this.value}`;
        break;
      case Me.Vector2:
        r = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;
        break;
      case Me.Vector3:
        r = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;
        break;
      case Me.Vector4:
        r = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;
        break;
    }
    return t.push(`${e}.value = ${r}`), (this.type === Me.Float || this.type === Me.Int) && t.push(`${e}.min = ${this.min}`, `${e}.max = ${this.max}`), t.push(""), super._dumpPropertiesCode() + t.join(`;
`);
  }
  serialize() {
    const e = super.serialize();
    return e.type = this.type, e.contextualValue = this.contextualValue, e.min = this.min, e.max = this.max, e.groupInInspector = this.groupInInspector, this._storedValue !== null && !this.isContextual && (this._storedValue.asArray ? (e.valueType = "BABYLON." + this._storedValue.getClassName(), e.value = this._storedValue.asArray()) : (e.valueType = "number", e.value = this._storedValue)), e;
  }
  _deserialize(e) {
    if (super._deserialize(e), this._type = e.type, this.contextualValue = e.contextualValue, this.min = e.min || 0, this.max = e.max || 0, this.groupInInspector = e.groupInInspector || "", !!e.valueType)
      if (e.valueType === "number")
        this._storedValue = e.value;
      else {
        const t = Jo(e.valueType);
        t && (this._storedValue = t.FromArray(e.value));
      }
  }
}
Ue("BABYLON.GeometryInputBlock", xf);
class Xy extends yi {
  /**
   * Create a new BoxBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.registerInput("size", Me.Float, !0, 1), this.registerInput("width", Me.Float, !0, 0), this.registerInput("height", Me.Float, !0, 0), this.registerInput("depth", Me.Float, !0, 0), this.registerInput("subdivisions", Me.Int, !0, 1), this.registerInput("subdivisionsX", Me.Int, !0, 0), this.registerInput("subdivisionsY", Me.Int, !0, 0), this.registerInput("subdivisionsZ", Me.Int, !0, 0), this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "BoxBlock";
  }
  /**
   * Gets the size input component
   */
  get size() {
    return this._inputs[0];
  }
  /**
   * Gets the width input component
   */
  get width() {
    return this._inputs[1];
  }
  /**
   * Gets the height input component
   */
  get height() {
    return this._inputs[2];
  }
  /**
   * Gets the depth input component
   */
  get depth() {
    return this._inputs[3];
  }
  /**
   * Gets the subdivisions input component
   */
  get subdivisions() {
    return this._inputs[4];
  }
  /**
   * Gets the subdivisionsX input component
   */
  get subdivisionsX() {
    return this._inputs[5];
  }
  /**
   * Gets the subdivisionsY input component
   */
  get subdivisionsY() {
    return this._inputs[6];
  }
  /**
   * Gets the subdivisionsZ input component
   */
  get subdivisionsZ() {
    return this._inputs[7];
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.size.isConnected) {
      if (!this.width.isConnected && !this.height.isConnected && !this.depth.isConnected) {
        const e = new xf("Size");
        e.value = 1, e.output.connectTo(this.size);
        return;
      }
      if (!this.width.isConnected) {
        const e = new xf("Width");
        e.value = 1, e.output.connectTo(this.width);
      }
      if (!this.height.isConnected) {
        const e = new xf("Height");
        e.value = 1, e.output.connectTo(this.height);
      }
      if (!this.depth.isConnected) {
        const e = new xf("Depth");
        e.value = 1, e.output.connectTo(this.depth);
      }
    }
  }
  _buildBlock(e) {
    const t = {}, r = (n) => {
      t.size = this.size.getConnectedValue(n), t.width = this.width.getConnectedValue(n), t.height = this.height.getConnectedValue(n), t.depth = this.depth.getConnectedValue(n);
      const i = this.subdivisions.getConnectedValue(n), s = this.subdivisionsX.getConnectedValue(n), a = this.subdivisionsY.getConnectedValue(n), f = this.subdivisionsZ.getConnectedValue(n);
      return i && (t.segments = i), s && (t.widthSegments = s), a && (t.heightSegments = a), f && (t.depthSegments = f), $ee(t);
    };
    if (this.evaluateContext)
      this.geometry._storedFunction = r;
    else {
      const n = r(e);
      this.geometry._storedFunction = () => (this.geometry._executionCount = 1, n.clone());
    }
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], Xy.prototype, "evaluateContext", void 0);
Ue("BABYLON.BoxBlock", Xy);
class Ql {
  /** Get the inspector from bundle or global */
  _getGlobalNodeGeometryEditor() {
    if (typeof NODEGEOMETRYEDITOR < "u")
      return NODEGEOMETRYEDITOR;
    if (typeof BABYLON < "u" && typeof BABYLON.NodeGeometryEditor < "u")
      return BABYLON;
  }
  /**
   * Gets the time spent to build this block (in ms)
   */
  get buildExecutionTime() {
    return this._buildExecutionTime;
  }
  /**
   * Creates a new geometry
   * @param name defines the name of the geometry
   */
  constructor(e) {
    this._buildId = Ql._BuildIdGenerator++, this._buildWasSuccessful = !1, this._vertexData = null, this._buildExecutionTime = 0, this.BJSNODEGEOMETRYEDITOR = this._getGlobalNodeGeometryEditor(), this.editorData = null, this.attachedBlocks = [], this.onBuildObservable = new Oe(), this.outputBlock = null, this.name = e;
  }
  /**
   * Gets the current class name of the geometry e.g. "NodeGeometry"
   * @returns the class name
   */
  getClassName() {
    return "NodeGeometry";
  }
  /**
   * Get a block by its name
   * @param name defines the name of the block to retrieve
   * @returns the required block or null if not found
   */
  getBlockByName(e) {
    let t = null;
    for (const r of this.attachedBlocks)
      if (r.name === e)
        if (!t)
          t = r;
        else
          return ye.Warn("More than one block was found with the name `" + e + "`"), t;
    return t;
  }
  /**
   * Get a block using a predicate
   * @param predicate defines the predicate used to find the good candidate
   * @returns the required block or null if not found
   */
  getBlockByPredicate(e) {
    for (const t of this.attachedBlocks)
      if (e(t))
        return t;
    return null;
  }
  /**
   * Gets the list of input blocks attached to this material
   * @returns an array of InputBlocks
   */
  getInputBlocks() {
    const e = [];
    for (const t of this.attachedBlocks)
      t.isInput && e.push(t);
    return e;
  }
  /**
   * Launch the node geometry editor
   * @param config Define the configuration of the editor
   * @returns a promise fulfilled when the node editor is visible
   */
  edit(e) {
    return new Promise((t) => {
      if (this.BJSNODEGEOMETRYEDITOR = this.BJSNODEGEOMETRYEDITOR || this._getGlobalNodeGeometryEditor(), typeof this.BJSNODEGEOMETRYEDITOR > "u") {
        const r = e && e.editorURL ? e.editorURL : Ql.EditorURL;
        ye.LoadBabylonScript(r, () => {
          this.BJSNODEGEOMETRYEDITOR = this.BJSNODEGEOMETRYEDITOR || this._getGlobalNodeGeometryEditor(), this._createNodeEditor(e == null ? void 0 : e.nodeGeometryEditorConfig), t();
        });
      } else
        this._createNodeEditor(e == null ? void 0 : e.nodeGeometryEditorConfig), t();
    });
  }
  /** Creates the node editor window. */
  _createNodeEditor(e) {
    const t = Object.assign({ nodeGeometry: this }, e);
    this.BJSNODEGEOMETRYEDITOR.NodeGeometryEditor.Show(t);
  }
  /**
   * Build the final geometry
   * @param verbose defines if the build should log activity
   * @param updateBuildId defines if the internal build Id should be updated (default is true)
   * @param autoConfigure defines if the autoConfigure method should be called when initializing blocks (default is false)
   */
  build(e = !1, t = !0, r = !1) {
    if (this._buildWasSuccessful = !1, !this.outputBlock)
      throw "You must define the outputBlock property before building the geometry";
    const n = Yi.Now;
    this._initializeBlock(this.outputBlock, r);
    const i = new Xne();
    i.buildId = this._buildId, i.verbose = e, this.outputBlock.build(i), t && (this._buildId = Ql._BuildIdGenerator++), this._buildExecutionTime = Yi.Now - n, i.emitErrors(), this._buildWasSuccessful = !0, this._vertexData = i.vertexData, this.onBuildObservable.notifyObservers(this);
  }
  /**
   * Creates a mesh from the geometry blocks
   * @param name defines the name of the mesh
   * @param scene The scene the mesh is scoped to
   * @returns The new mesh
   */
  createMesh(e, t = null) {
    if (this._buildWasSuccessful || this.build(), !this._vertexData)
      return null;
    const r = new Ee(e, t);
    return this._vertexData.applyToMesh(r), r._internalMetadata = r._internalMetadata || {}, r._internalMetadata.nodeGeometry = this, r;
  }
  /**
   * Creates a mesh from the geometry blocks
   * @param mesh the mesh to update
   * @returns True if successfully updated
   */
  updateMesh(e) {
    return this._buildWasSuccessful || this.build(), this._vertexData ? (this._vertexData.applyToMesh(e), e._internalMetadata = e._internalMetadata || {}, e._internalMetadata.nodeGeometry = this, e) : !1;
  }
  _initializeBlock(e, t = !0) {
    e.initialize(), t && e.autoConfigure(), e._preparationId = this._buildId, this.attachedBlocks.indexOf(e) === -1 && this.attachedBlocks.push(e);
    for (const r of e.inputs) {
      const n = r.connectedPoint;
      if (n) {
        const i = n.ownerBlock;
        i !== e && this._initializeBlock(i, t);
      }
    }
  }
  /**
   * Clear the current geometry
   */
  clear() {
    this.outputBlock = null, this.attachedBlocks.length = 0;
  }
  /**
   * Remove a block from the current geometry
   * @param block defines the block to remove
   */
  removeBlock(e) {
    const t = this.attachedBlocks.indexOf(e);
    t > -1 && this.attachedBlocks.splice(t, 1), e === this.outputBlock && (this.outputBlock = null);
  }
  /**
   * Clear the current graph and load a new one from a serialization object
   * @param source defines the JSON representation of the geometry
   * @param merge defines whether or not the source must be merged or replace the current content
   */
  parseSerializedObject(e, t = !1) {
    t || this.clear();
    const r = {};
    for (const n of e.blocks) {
      const i = Jo(n.customType);
      if (i) {
        const s = new i();
        s._deserialize(n), r[n.id] = s, this.attachedBlocks.push(s);
      }
    }
    for (const n of this.attachedBlocks)
      if (n.isTeleportOut) {
        const i = n, s = i._tempEntryPointUniqueId;
        if (s) {
          const a = r[s];
          a && a.attachToEndpoint(i);
        }
      }
    for (let n = 0; n < e.blocks.length; n++) {
      const i = e.blocks[n], s = r[i.id];
      s && (s.inputs.length && i.inputs.some((a) => a.targetConnectionName) && !t || this._restoreConnections(s, e, r));
    }
    if (e.outputNodeId && (this.outputBlock = r[e.outputNodeId]), e.locations || e.editorData && e.editorData.locations) {
      const n = e.locations || e.editorData.locations;
      for (const s of n)
        r[s.blockId] && (s.blockId = r[s.blockId].uniqueId);
      t && this.editorData && this.editorData.locations && n.concat(this.editorData.locations), e.locations ? this.editorData = {
        locations: n
      } : (this.editorData = e.editorData, this.editorData.locations = n);
      const i = [];
      for (const s in r)
        i[s] = r[s].uniqueId;
      this.editorData.map = i;
    }
    this.comment = e.comment;
  }
  _restoreConnections(e, t, r) {
    for (const n of e.outputs)
      for (const i of t.blocks) {
        const s = r[i.id];
        if (s) {
          for (const a of i.inputs)
            if (r[a.targetBlockId] === e && a.targetConnectionName === n.name) {
              const f = s.getInputByName(a.inputName);
              if (!f || f.isConnected)
                continue;
              n.connectTo(f, !0), this._restoreConnections(s, t, r);
              continue;
            }
        }
      }
  }
  /**
   * Generate a string containing the code declaration required to create an equivalent of this geometry
   * @returns a string
   */
  generateCode() {
    let e = [];
    const t = [], r = ["const", "var", "let"];
    this.outputBlock && this._gatherBlocks(this.outputBlock, t);
    let n = `let nodeGeometry = new BABYLON.NodeGeometry("${this.name || "node geometry"}");
`;
    for (const i of t)
      i.isInput && e.indexOf(i) === -1 && (n += i._dumpCode(r, e));
    return this.outputBlock && (e = [], n += `// Connections
`, n += this.outputBlock._dumpCodeForOutputConnections(e), n += `// Output nodes
`, n += `nodeGeometry.outputBlock = ${this.outputBlock._codeVariableName};
`, n += `nodeGeometry.build();
`), n;
  }
  _gatherBlocks(e, t) {
    if (t.indexOf(e) === -1) {
      t.push(e);
      for (const r of e.inputs) {
        const n = r.connectedPoint;
        if (n) {
          const i = n.ownerBlock;
          i !== e && this._gatherBlocks(i, t);
        }
      }
      if (e.isTeleportOut) {
        const r = e;
        r.entryPoint && this._gatherBlocks(r.entryPoint, t);
      }
    }
  }
  /**
   * Clear the current geometry and set it to a default state
   */
  setToDefault() {
    this.clear(), this.editorData = null;
    const e = new Xy("Box");
    e.autoConfigure();
    const t = new vY("Geometry Output");
    e.geometry.connectTo(t.geometry), this.outputBlock = t;
  }
  /**
   * Makes a duplicate of the current geometry.
   * @param name defines the name to use for the new geometry
   */
  clone(e) {
    const t = this.serialize(), r = jt.Clone(() => new Ql(e), this);
    return r.name = e, r.parseSerializedObject(t), r._buildId = this._buildId, r.build(!1), r;
  }
  /**
   * Serializes this geometry in a JSON representation
   * @param selectedBlocks defines the list of blocks to save (if null the whole geometry will be saved)
   * @returns the serialized geometry object
   */
  serialize(e) {
    const t = e ? {} : jt.Serialize(this);
    t.editorData = JSON.parse(JSON.stringify(this.editorData));
    let r = [];
    e ? r = e : (t.customType = "BABYLON.NodeGeometry", this.outputBlock && (t.outputNodeId = this.outputBlock.uniqueId)), t.blocks = [];
    for (const n of r)
      t.blocks.push(n.serialize());
    if (!e)
      for (const n of this.attachedBlocks)
        r.indexOf(n) === -1 && t.blocks.push(n.serialize());
    return t;
  }
  /**
   * Disposes the ressources
   */
  dispose() {
    for (const e of this.attachedBlocks)
      e.dispose();
    this.attachedBlocks.length = 0, this.onBuildObservable.clear();
  }
  /**
   * Creates a new node geometry set to default basic configuration
   * @param name defines the name of the geometry
   * @returns a new NodeGeometry
   */
  static CreateDefault(e) {
    const t = new Ql(e);
    return t.setToDefault(), t.build(), t;
  }
  /**
   * Creates a node geometry from parsed geometry data
   * @param source defines the JSON representation of the geometry
   * @returns a new node geometry
   */
  static Parse(e) {
    const t = jt.Parse(() => new Ql(e.name), e, null);
    return t.parseSerializedObject(e), t.build(), t;
  }
  /**
   * Creates a node geometry from a snippet saved by the node geometry editor
   * @param snippetId defines the snippet to load
   * @param nodeGeometry defines a node geometry to update (instead of creating a new one)
   * @param skipBuild defines whether to build the node geometry
   * @returns a promise that will resolve to the new node geometry
   */
  static ParseFromSnippetAsync(e, t, r = !1) {
    return e === "_BLANK" ? Promise.resolve(Ql.CreateDefault("blank")) : new Promise((n, i) => {
      const s = new ho();
      s.addEventListener("readystatechange", () => {
        if (s.readyState == 4)
          if (s.status == 200) {
            const a = JSON.parse(JSON.parse(s.responseText).jsonPayload), f = JSON.parse(a.nodeGeometry);
            t || (t = jt.Parse(() => new Ql(e), f, null)), t.parseSerializedObject(f), t.snippetId = e;
            try {
              r || t.build(), n(t);
            } catch (o) {
              i(o);
            }
          } else
            i("Unable to load the snippet " + e);
      }), s.open("GET", this.SnippetUrl + "/" + e.replace(/#/g, "/")), s.send();
    });
  }
}
Ql._BuildIdGenerator = 0;
Ql.EditorURL = `${ye._DefaultCdnUrl}/v${Ge.Version}/nodeGeometryEditor/babylon.nodeGeometryEditor.js`;
Ql.SnippetUrl = "https://snippet.babylonjs.com";
C([
  M()
], Ql.prototype, "name", void 0);
C([
  M("comment")
], Ql.prototype, "comment", void 0);
class Ty extends yi {
  /**
   * Creates a new GeometryOptimizeBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !0, this.epsilon = Dn, this.registerInput("geometry", Me.Geometry), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GeometryOptimizeBlock";
  }
  /**
   * Gets the geometry component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      if (!this.geometry.isConnected)
        return null;
      const n = this.geometry.getConnectedValue(r), i = [], s = {};
      for (let f = 0; f < n.positions.length; f += 3) {
        const o = n.positions[f], d = n.positions[f + 1], v = n.positions[f + 2];
        let u = !1;
        for (let l = 0; l < i.length; l += 3)
          if (Xt.WithinEpsilon(o, i[l], this.epsilon) && Xt.WithinEpsilon(d, i[l + 1], this.epsilon) && Xt.WithinEpsilon(v, i[l + 2], this.epsilon)) {
            s[f / 3] = l / 3, u = !0;
            continue;
          }
        u || (s[f / 3] = i.length / 3, i.push(o, d, v));
      }
      const a = new Ut();
      return a.positions = i, a.indices = n.indices.map((f) => s[f]), a;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
    return e += `${this._codeVariableName}.epsilon = ${this.epsilon};
`, e;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e.epsilon = this.epsilon, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext, this.epsilon = e.epsilon;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], Ty.prototype, "evaluateContext", void 0);
C([
  rn("Epsilon", Gr.Float, "ADVANCED", { notifiers: { rebuild: !0 } })
], Ty.prototype, "epsilon", void 0);
Ue("BABYLON.GeometryOptimizeBlock", Ty);
class uY extends yi {
  /**
   * Create a new PlaneBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.registerInput("size", Me.Float, !0, 1), this.registerInput("width", Me.Float, !0, 0), this.registerInput("height", Me.Float, !0, 0), this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "PlaneBlock";
  }
  /**
   * Gets the size input component
   */
  get size() {
    return this._inputs[0];
  }
  /**
   * Gets the width input component
   */
  get width() {
    return this._inputs[1];
  }
  /**
   * Gets the height input component
   */
  get height() {
    return this._inputs[2];
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.size.isConnected) {
      if (!this.width.isConnected && !this.height.isConnected) {
        const e = new xf("Size");
        e.value = 1, e.output.connectTo(this.size);
        return;
      }
      if (!this.width.isConnected) {
        const e = new xf("Width");
        e.value = 1, e.output.connectTo(this.width);
      }
      if (!this.height.isConnected) {
        const e = new xf("Height");
        e.value = 1, e.output.connectTo(this.height);
      }
    }
  }
  _buildBlock(e) {
    const t = {}, r = (n) => (t.size = this.size.getConnectedValue(n), t.width = this.width.getConnectedValue(n), t.height = this.height.getConnectedValue(n), UO(t));
    if (this.evaluateContext)
      this.geometry._storedFunction = r;
    else {
      const n = r(e);
      this.geometry._storedFunction = () => (this.geometry._executionCount = 1, n.clone());
    }
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], uY.prototype, "evaluateContext", void 0);
Ue("BABYLON.PlaneBlock", uY);
class lY extends yi {
  /**
   * Gets or sets the mesh to use to get vertex data
   */
  get mesh() {
    return this._mesh;
  }
  set mesh(e) {
    this._mesh = e;
  }
  /**
   * Create a new MeshBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this._cachedVertexData = null, this.reverseWindingOrder = !1, this.serializedCachedData = !1, this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MeshBlock";
  }
  /**
   * Gets a boolean indicating if the block is using cached data
   */
  get isUsingCachedData() {
    return !this.mesh && !!this._cachedVertexData;
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  /**
   * Remove stored data
   */
  cleanData() {
    this._mesh = null, this._cachedVertexData = null;
  }
  _buildBlock() {
    if (!this._mesh) {
      this._cachedVertexData ? this.geometry._storedValue = this._cachedVertexData.clone() : this.geometry._storedValue = null;
      return;
    }
    const e = Ut.ExtractFromMesh(this._mesh, !1, !0);
    if (this._cachedVertexData = null, this.reverseWindingOrder && e.indices)
      for (let t = 0; t < e.indices.length; t += 3) {
        const r = e.indices[t];
        e.indices[t] = e.indices[t + 2], e.indices[t + 2] = r;
      }
    this.geometry._storedFunction = () => e.clone();
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.serializedCachedData = this.serializedCachedData, this.serializedCachedData && (this._mesh ? e.cachedVertexData = Ut.ExtractFromMesh(this._mesh, !1, !0).serialize() : this._cachedVertexData && (e.cachedVertexData = this._cachedVertexData.serialize())), e.reverseWindingOrder = this.reverseWindingOrder, e;
  }
  _deserialize(e) {
    super._deserialize(e), e.cachedVertexData && (this._cachedVertexData = Ut.Parse(e.cachedVertexData)), this.serializedCachedData = !!e.serializedCachedData, this.reverseWindingOrder = e.reverseWindingOrder;
  }
}
C([
  rn("Serialize cached data", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], lY.prototype, "serializedCachedData", void 0);
Ue("BABYLON.MeshBlock", lY);
class PY extends yi {
  /**
   * Create a new IcoSphereBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.registerInput("radius", Me.Float, !0, 1), this.registerInput("radiusX", Me.Float, !0, 0), this.registerInput("radiusY", Me.Float, !0, 0), this.registerInput("radiusZ", Me.Float, !0, 0), this.registerInput("subdivisions", Me.Int, !0, 4), this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "IcoSphereBlock";
  }
  /**
   * Gets the radius input component
   */
  get radius() {
    return this._inputs[0];
  }
  /**
   * Gets the radiusX input component
   */
  get radiusX() {
    return this._inputs[1];
  }
  /**
   * Gets the radiusY input component
   */
  get radiusY() {
    return this._inputs[2];
  }
  /**
   * Gets the radiusZ input component
   */
  get radiusZ() {
    return this._inputs[3];
  }
  /**
   * Gets the subdivisions input component
   */
  get subdivisions() {
    return this._inputs[4];
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.radius.isConnected) {
      const e = new xf("Radius");
      e.value = 0.2, e.output.connectTo(this.radius);
    }
  }
  _buildBlock(e) {
    const t = {}, r = (n) => (t.radius = this.radius.getConnectedValue(n), t.subdivisions = this.subdivisions.getConnectedValue(n), t.radiusX = this.radiusX.getConnectedValue(n), t.radiusY = this.radiusY.getConnectedValue(n), t.radiusZ = this.radiusZ.getConnectedValue(n), RO(t));
    if (this.evaluateContext)
      this.geometry._storedFunction = r;
    else {
      const n = r(e);
      this.geometry._storedFunction = () => (this.geometry._executionCount = 1, n.clone());
    }
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], PY.prototype, "evaluateContext", void 0);
Ue("BABYLON.IcoSphereBlock", PY);
class cY extends yi {
  /**
   * Create a new SphereBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.registerInput("segments", Me.Int, !0, 32), this.registerInput("diameter", Me.Float, !0, 1), this.registerInput("diameterX", Me.Float, !0, 0), this.registerInput("diameterY", Me.Float, !0, 0), this.registerInput("diameterZ", Me.Float, !0, 0), this.registerInput("arc", Me.Float, !0, 1), this.registerInput("slice", Me.Float, !0, 1), this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SphereBlock";
  }
  /**
   * Gets the segments input component
   */
  get segments() {
    return this._inputs[0];
  }
  /**
   * Gets the diameter input component
   */
  get diameter() {
    return this._inputs[1];
  }
  /**
   * Gets the diameterX input component
   */
  get diameterX() {
    return this._inputs[2];
  }
  /**
   * Gets the diameterY input component
   */
  get diameterY() {
    return this._inputs[3];
  }
  /**
   * Gets the diameterZ input component
   */
  get diameterZ() {
    return this._inputs[4];
  }
  /**
   * Gets the arc input component
   */
  get arc() {
    return this._inputs[5];
  }
  /**
   * Gets the slice input component
   */
  get slice() {
    return this._inputs[6];
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.diameter.isConnected) {
      const e = new xf("Diameter");
      e.value = 1, e.output.connectTo(this.diameter);
    }
  }
  _buildBlock(e) {
    const t = {}, r = (n) => (t.segments = this.segments.getConnectedValue(n), t.diameter = this.diameter.getConnectedValue(n), t.diameterX = this.diameterX.getConnectedValue(n), t.diameterY = this.diameterY.getConnectedValue(n), t.diameterZ = this.diameterZ.getConnectedValue(n), t.arc = this.arc.getConnectedValue(n), t.slice = this.slice.getConnectedValue(n), KO(t));
    if (this.evaluateContext)
      this.geometry._storedFunction = r;
    else {
      const n = r(e);
      this.geometry._storedFunction = () => (this.geometry._executionCount = 1, n.clone());
    }
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], cY.prototype, "evaluateContext", void 0);
Ue("BABYLON.SphereBlock", cY);
class pY extends yi {
  /**
   * Create a new GridBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.registerInput("width", Me.Float, !0, 1), this.registerInput("height", Me.Float, !0, 1), this.registerInput("subdivisions", Me.Int, !0, 1), this.registerInput("subdivisionsX", Me.Int, !0, 0), this.registerInput("subdivisionsY", Me.Int, !0, 0), this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GridBlock";
  }
  /**
   * Gets the width input component
   */
  get width() {
    return this._inputs[0];
  }
  /**
   * Gets the height input component
   */
  get height() {
    return this._inputs[1];
  }
  /**
   * Gets the subdivisions input component
   */
  get subdivisions() {
    return this._inputs[2];
  }
  /**
   * Gets the subdivisionsX input component
   */
  get subdivisionsX() {
    return this._inputs[3];
  }
  /**
   * Gets the subdivisionsY input component
   */
  get subdivisionsY() {
    return this._inputs[4];
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.width.isConnected) {
      const e = new xf("Width");
      e.value = 1, e.output.connectTo(this.width);
    }
    if (!this.height.isConnected) {
      const e = new xf("Height");
      e.value = 1, e.output.connectTo(this.height);
    }
  }
  _buildBlock(e) {
    const t = {}, r = (n) => (t.width = this.width.getConnectedValue(n), t.height = this.height.getConnectedValue(n), t.subdivisions = this.subdivisions.getConnectedValue(n), t.subdivisionsX = this.subdivisionsX.getConnectedValue(n), t.subdivisionsY = this.subdivisionsY.getConnectedValue(n), y2(t));
    if (this.evaluateContext)
      this.geometry._storedFunction = r;
    else {
      const n = r(e);
      this.geometry._storedFunction = () => (this.geometry._executionCount = 1, n.clone());
    }
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], pY.prototype, "evaluateContext", void 0);
Ue("BABYLON.GridBlock", pY);
class hY extends yi {
  /**
   * Create a new TorusBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.registerInput("diameter", Me.Float, !0, 1), this.registerInput("thickness", Me.Float, !0, 0.5), this.registerInput("tessellation", Me.Int, !0, 16), this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "TorusBlock";
  }
  /**
   * Gets the diameter input component
   */
  get diameter() {
    return this._inputs[0];
  }
  /**
   * Gets the thickness input component
   */
  get thickness() {
    return this._inputs[1];
  }
  /**
   * Gets the tessellation input component
   */
  get tessellation() {
    return this._inputs[2];
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.diameter.isConnected) {
      const e = new xf("Diameter");
      e.value = 1, e.output.connectTo(this.diameter);
    }
  }
  _buildBlock(e) {
    const t = {}, r = (n) => (t.thickness = this.thickness.getConnectedValue(n), t.diameter = this.diameter.getConnectedValue(n), t.tessellation = this.tessellation.getConnectedValue(n), QO(t));
    if (this.evaluateContext)
      this.geometry._storedFunction = r;
    else {
      const n = r(e);
      this.geometry._storedFunction = () => (this.geometry._executionCount = 1, n.clone());
    }
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], hY.prototype, "evaluateContext", void 0);
Ue("BABYLON.TorusBlock", hY);
class HY extends yi {
  /**
   * Create a new SphereBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.registerInput("height", Me.Float, !0, 25), this.registerInput("diameter", Me.Float, !0, 1), this.registerInput("diameterTop", Me.Float, !0, -1), this.registerInput("diameterBottom", Me.Float, !0, -1), this.registerInput("subdivisions", Me.Int, !0, 1), this.registerInput("tessellation", Me.Int, !0, 24), this.registerInput("arc", Me.Float, !0, 1), this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "CylinderBlock";
  }
  /**
   * Gets the height input component
   */
  get height() {
    return this._inputs[0];
  }
  /**
   * Gets the diameter input component
   */
  get diameter() {
    return this._inputs[1];
  }
  /**
   * Gets the diameterTop input component
   */
  get diameterTop() {
    return this._inputs[2];
  }
  /**
   * Gets the diameterBottom input component
   */
  get diameterBottom() {
    return this._inputs[3];
  }
  /**
   * Gets the subdivisions input component
   */
  get subdivisions() {
    return this._inputs[4];
  }
  /**
   * Gets the tessellation input component
   */
  get tessellation() {
    return this._inputs[5];
  }
  /**
   * Gets the arc input component
   */
  get arc() {
    return this._inputs[6];
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.diameter.isConnected) {
      const e = new xf("Diameter");
      e.value = 1, e.output.connectTo(this.diameter);
    }
    if (!this.height.isConnected) {
      const e = new xf("Height");
      e.value = 1, e.output.connectTo(this.height);
    }
  }
  _buildBlock(e) {
    const t = {}, r = (n) => (t.height = this.height.getConnectedValue(n), t.diameter = this.diameter.getConnectedValue(n), t.diameterTop = this.diameterTop.getConnectedValue(n), t.diameterBottom = this.diameterBottom.getConnectedValue(n), t.diameterTop === -1 && (t.diameterTop = t.diameter), t.diameterBottom === -1 && (t.diameterBottom = t.diameter), t.tessellation = this.tessellation.getConnectedValue(n), t.subdivisions = this.subdivisions.getConnectedValue(n), t.arc = this.arc.getConnectedValue(n), MO(t));
    if (this.evaluateContext)
      this.geometry._storedFunction = r;
    else {
      const n = r(e);
      this.geometry._storedFunction = () => (this.geometry._executionCount = 1, n.clone());
    }
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], HY.prototype, "evaluateContext", void 0);
Ue("BABYLON.CylinderBlock", HY);
class gY extends yi {
  /**
   * Create a new CapsuleBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.registerInput("height", Me.Float, !0, 1), this.registerInput("radius", Me.Float, !0, 0.25), this.registerInput("tessellation", Me.Int, !0, 16), this.registerInput("subdivisions", Me.Int, !0, 2), this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "CapsuleBlock";
  }
  /**
   * Gets the height input component
   */
  get height() {
    return this._inputs[0];
  }
  /**
   * Gets the radius input component
   */
  get radius() {
    return this._inputs[1];
  }
  /**
   * Gets the tessellation input component
   */
  get tessellation() {
    return this._inputs[2];
  }
  /**
   * Gets the subdivisions input component
   */
  get subdivisions() {
    return this._inputs[3];
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.height.isConnected) {
      const e = new xf("Height");
      e.value = 1, e.output.connectTo(this.height);
    }
    if (!this.radius.isConnected) {
      const e = new xf("Radius");
      e.value = 0.2, e.output.connectTo(this.radius);
    }
  }
  _buildBlock(e) {
    const t = {}, r = (n) => (t.height = this.height.getConnectedValue(n), t.radius = this.radius.getConnectedValue(n), t.tessellation = this.tessellation.getConnectedValue(n), t.subdivisions = this.subdivisions.getConnectedValue(n), JO(t));
    if (this.evaluateContext)
      this.geometry._storedFunction = r;
    else {
      const n = r(e);
      this.geometry._storedFunction = () => (this.geometry._executionCount = 1, n.clone());
    }
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], gY.prototype, "evaluateContext", void 0);
Ue("BABYLON.CapsuleBlock", gY);
class XY extends yi {
  /**
   * Create a new DiscBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.registerInput("radius", Me.Float, !0, 0.5), this.registerInput("tessellation", Me.Int, !0, 64), this.registerInput("arc", Me.Float, !0, 1), this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "DiscBlock";
  }
  /**
   * Gets the radius input component
   */
  get radius() {
    return this._inputs[0];
  }
  /**
   * Gets the tessellation input component
   */
  get tessellation() {
    return this._inputs[1];
  }
  /**
   * Gets the arc input component
   */
  get arc() {
    return this._inputs[2];
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.radius.isConnected) {
      const e = new xf("Radius");
      e.value = 0.2, e.output.connectTo(this.radius);
    }
  }
  _buildBlock(e) {
    const t = {}, r = (n) => (t.radius = this.radius.getConnectedValue(n), t.tessellation = this.tessellation.getConnectedValue(n), t.arc = this.arc.getConnectedValue(n), zO(t));
    if (this.evaluateContext)
      this.geometry._storedFunction = r;
    else {
      const n = r(e);
      this.geometry._storedFunction = () => (this.geometry._executionCount = 1, n.clone());
    }
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], XY.prototype, "evaluateContext", void 0);
Ue("BABYLON.DiscBlock", XY);
class Tne extends yi {
  /**
   * Create a new NullBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerOutput("geometry", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "NullBlock";
  }
  /**
   * Gets the geometry output component
   */
  get geometry() {
    return this._outputs[0];
  }
  _buildBlock() {
    this.geometry._storedValue = null;
  }
}
Ue("BABYLON.NullBlock", Tne);
class TY extends yi {
  /**
   * Create a new SetPositionsBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !0, this.registerInput("geometry", Me.Geometry), this.registerInput("positions", Me.Vector3), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current index in the current flow
   * @returns the current index
   */
  getExecutionIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current loop index in the current flow
   * @returns the current loop index
   */
  getExecutionLoopIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current face index in the current flow
   * @returns the current face index
   */
  getExecutionFaceIndex() {
    return 0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SetPositionsBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the positions input component
   */
  get positions() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      if (r.pushExecutionContext(this), this._vertexData = this.geometry.getConnectedValue(r), this._vertexData && (this._vertexData = this._vertexData.clone()), r.pushGeometryContext(this._vertexData), !this._vertexData || !this._vertexData.positions || !this.positions.isConnected) {
        r.restoreGeometryContext(), r.restoreExecutionContext(), this.output._storedValue = null;
        return;
      }
      const n = this._vertexData.positions.length / 3;
      for (this._currentIndex = 0; this._currentIndex < n; this._currentIndex++) {
        const i = this.positions.getConnectedValue(r);
        i && i.toArray(this._vertexData.positions, this._currentIndex * 3);
      }
      return r.restoreGeometryContext(), r.restoreExecutionContext(), this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], TY.prototype, "evaluateContext", void 0);
Ue("BABYLON.SetPositionsBlock", TY);
class qY extends yi {
  /**
   * Create a new SetNormalsBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !0, this.registerInput("geometry", Me.Geometry), this.registerInput("normals", Me.Vector3), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current index in the current flow
   * @returns the current index
   */
  getExecutionIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current loop index in the current flow
   * @returns the current loop index
   */
  getExecutionLoopIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current face index in the current flow
   * @returns the current face index
   */
  getExecutionFaceIndex() {
    return 0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SetNormalsBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the normals input component
   */
  get normals() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      if (r.pushExecutionContext(this), this._vertexData = this.geometry.getConnectedValue(r), this._vertexData && (this._vertexData = this._vertexData.clone()), r.pushGeometryContext(this._vertexData), !this._vertexData || !this._vertexData.positions) {
        r.restoreGeometryContext(), r.restoreExecutionContext(), this.output._storedValue = null;
        return;
      }
      if (!this.normals.isConnected) {
        r.restoreGeometryContext(), r.restoreExecutionContext(), this.output._storedValue = this._vertexData;
        return;
      }
      this._vertexData.normals || (this._vertexData.normals = []);
      const n = this._vertexData.positions.length / 3;
      for (this._currentIndex = 0; this._currentIndex < n; this._currentIndex++) {
        const i = this.normals.getConnectedValue(r);
        i && i.toArray(this._vertexData.normals, this._currentIndex * 3);
      }
      return r.restoreGeometryContext(), r.restoreExecutionContext(), this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], qY.prototype, "evaluateContext", void 0);
Ue("BABYLON.SetNormalsBlock", qY);
class qy extends yi {
  /**
   * Create a new SetUVsBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !0, this.textureCoordinateIndex = 0, this.registerInput("geometry", Me.Geometry), this.registerInput("uvs", Me.Vector2), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current index in the current flow
   * @returns the current index
   */
  getExecutionIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current loop index in the current flow
   * @returns the current loop index
   */
  getExecutionLoopIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current face index in the current flow
   * @returns the current face index
   */
  getExecutionFaceIndex() {
    return 0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SetUVsBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the uvs input component
   */
  get uvs() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      if (r.pushExecutionContext(this), this._vertexData = this.geometry.getConnectedValue(r), this._vertexData && (this._vertexData = this._vertexData.clone()), r.pushGeometryContext(this._vertexData), !this._vertexData || !this._vertexData.positions) {
        r.restoreGeometryContext(), r.restoreExecutionContext(), this.output._storedValue = null;
        return;
      }
      if (!this.uvs.isConnected) {
        r.restoreGeometryContext(), r.restoreExecutionContext(), this.output._storedValue = this._vertexData;
        return;
      }
      const n = [], i = this._vertexData.positions.length / 3;
      for (this._currentIndex = 0; this._currentIndex < i; this._currentIndex++) {
        const s = this.uvs.getConnectedValue(r);
        s && s.toArray(n, this._currentIndex * 2);
      }
      switch (this.textureCoordinateIndex) {
        case 0:
          this._vertexData.uvs = n;
          break;
        case 1:
          this._vertexData.uvs2 = n;
          break;
        case 2:
          this._vertexData.uvs3 = n;
          break;
        case 3:
          this._vertexData.uvs4 = n;
          break;
        case 4:
          this._vertexData.uvs5 = n;
          break;
        case 5:
          this._vertexData.uvs6 = n;
          break;
      }
      return r.restoreGeometryContext(), r.restoreExecutionContext(), this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode() + `${this._codeVariableName}.textureCoordinateIndex};
`;
    return e += `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`, e;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e.textureCoordinateIndex = this.textureCoordinateIndex, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.textureCoordinateIndex = e.textureCoordinateIndex, e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], qy.prototype, "evaluateContext", void 0);
C([
  rn("Texture coordinates index", Gr.List, "ADVANCED", {
    notifiers: { update: !0 },
    options: [
      { label: "UV1", value: 0 },
      { label: "UV2", value: 1 },
      { label: "UV3", value: 2 },
      { label: "UV4", value: 3 },
      { label: "UV5", value: 4 },
      { label: "UV6", value: 5 }
    ]
  })
], qy.prototype, "textureCoordinateIndex", void 0);
Ue("BABYLON.SetUVsBlock", qy);
class bY extends yi {
  /**
   * Create a new SetColorsBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !0, this.registerInput("geometry", Me.Geometry), this.registerInput("colors", Me.Vector4), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current index in the current flow
   * @returns the current index
   */
  getExecutionIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current loop index in the current flow
   * @returns the current loop index
   */
  getExecutionLoopIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current face index in the current flow
   * @returns the current face index
   */
  getExecutionFaceIndex() {
    return 0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SetColorsBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the colors input component
   */
  get colors() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      if (r.pushExecutionContext(this), this._vertexData = this.geometry.getConnectedValue(r), this._vertexData && (this._vertexData = this._vertexData.clone()), r.pushGeometryContext(this._vertexData), !this._vertexData || !this._vertexData.positions) {
        r.restoreGeometryContext(), r.restoreExecutionContext(), this.output._storedValue = null;
        return;
      }
      if (!this.colors.isConnected) {
        r.restoreGeometryContext(), r.restoreExecutionContext(), this.output._storedValue = this._vertexData;
        return;
      }
      this._vertexData.colors || (this._vertexData.colors = []);
      const n = this._vertexData.positions.length / 3;
      for (this._currentIndex = 0; this._currentIndex < n; this._currentIndex++) {
        const i = this.colors.getConnectedValue(r);
        i && i.toArray(this._vertexData.colors, this._currentIndex * 4);
      }
      return r.restoreGeometryContext(), r.restoreExecutionContext(), this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], bY.prototype, "evaluateContext", void 0);
Ue("BABYLON.SetColorsBlock", bY);
class xY extends yi {
  /**
   * Create a new SetTangentsBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !0, this.registerInput("geometry", Me.Geometry), this.registerInput("tangents", Me.Vector4), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current index in the current flow
   * @returns the current index
   */
  getExecutionIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current loop index in the current flow
   * @returns the current loop index
   */
  getExecutionLoopIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current face index in the current flow
   * @returns the current face index
   */
  getExecutionFaceIndex() {
    return 0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SetTangentsBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the tangents input component
   */
  get tangents() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      if (r.pushExecutionContext(this), this._vertexData = this.geometry.getConnectedValue(r), this._vertexData && (this._vertexData = this._vertexData.clone()), r.pushGeometryContext(this._vertexData), !this._vertexData || !this._vertexData.positions) {
        r.restoreGeometryContext(), r.restoreExecutionContext(), this.output._storedValue = null;
        return;
      }
      if (!this.tangents.isConnected) {
        r.restoreGeometryContext(), r.restoreExecutionContext(), this.output._storedValue = this._vertexData;
        return;
      }
      this._vertexData.tangents || (this._vertexData.tangents = []);
      const n = this._vertexData.positions.length / 3;
      for (this._currentIndex = 0; this._currentIndex < n; this._currentIndex++) {
        const i = this.tangents.getConnectedValue(r);
        i && i.toArray(this._vertexData.tangents, this._currentIndex * 4);
      }
      return r.restoreGeometryContext(), r.restoreExecutionContext(), this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], xY.prototype, "evaluateContext", void 0);
Ue("BABYLON.SetTangentsBlock", xY);
var Ov;
(function(A) {
  A[A.Add = 0] = "Add", A[A.Subtract = 1] = "Subtract", A[A.Multiply = 2] = "Multiply", A[A.Divide = 3] = "Divide", A[A.Max = 4] = "Max", A[A.Min = 5] = "Min";
})(Ov || (Ov = {}));
class DY extends yi {
  /**
   * Create a new MathBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.operation = Ov.Add, this.registerInput("left", Me.AutoDetect), this.registerInput("right", Me.AutoDetect), this.registerOutput("output", Me.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._inputs[0].excludedConnectionPointTypes.push(Me.Matrix), this._inputs[0].excludedConnectionPointTypes.push(Me.Geometry), this._inputs[0].excludedConnectionPointTypes.push(Me.Texture), this._inputs[1].excludedConnectionPointTypes.push(Me.Matrix), this._inputs[1].excludedConnectionPointTypes.push(Me.Geometry), this._inputs[1].excludedConnectionPointTypes.push(Me.Texture), this._inputs[1].acceptedConnectionPointTypes.push(Me.Float), this._linkConnectionTypes(0, 1);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MathBlock";
  }
  /**
   * Gets the left input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock() {
    let e;
    const t = this.left, r = this.right;
    if (!t.isConnected || !r.isConnected) {
      this.output._storedFunction = null, this.output._storedValue = null;
      return;
    }
    const n = t.type === Me.Float || t.type === Me.Int;
    switch (this.operation) {
      case Ov.Add: {
        n ? e = (i) => t.getConnectedValue(i) + r.getConnectedValue(i) : e = (i) => t.getConnectedValue(i).add(i.adapt(r, t.type));
        break;
      }
      case Ov.Subtract: {
        n ? e = (i) => t.getConnectedValue(i) - r.getConnectedValue(i) : e = (i) => t.getConnectedValue(i).subtract(i.adapt(r, t.type));
        break;
      }
      case Ov.Multiply: {
        n ? e = (i) => t.getConnectedValue(i) * r.getConnectedValue(i) : e = (i) => t.getConnectedValue(i).multiply(i.adapt(r, t.type));
        break;
      }
      case Ov.Divide: {
        n ? e = (i) => t.getConnectedValue(i) / r.getConnectedValue(i) : e = (i) => t.getConnectedValue(i).divide(i.adapt(r, t.type));
        break;
      }
      case Ov.Min: {
        if (n)
          e = (i) => Math.min(t.getConnectedValue(i), r.getConnectedValue(i));
        else
          switch (t.type) {
            case Me.Vector2: {
              e = (i) => at.Minimize(t.getConnectedValue(i), i.adapt(r, t.type));
              break;
            }
            case Me.Vector3: {
              e = (i) => S.Minimize(t.getConnectedValue(i), i.adapt(r, t.type));
              break;
            }
            case Me.Vector4: {
              e = (i) => Ir.Minimize(t.getConnectedValue(i), i.adapt(r, t.type));
              break;
            }
          }
        break;
      }
      case Ov.Max:
        if (n)
          e = (i) => Math.max(t.getConnectedValue(i), r.getConnectedValue(i));
        else {
          switch (t.type) {
            case Me.Vector2: {
              e = (i) => at.Maximize(t.getConnectedValue(i), i.adapt(r, t.type));
              break;
            }
            case Me.Vector3: {
              e = (i) => S.Maximize(t.getConnectedValue(i), i.adapt(r, t.type));
              break;
            }
            case Me.Vector4: {
              e = (i) => Ir.Maximize(t.getConnectedValue(i), i.adapt(r, t.type));
              break;
            }
          }
          break;
        }
    }
    this.output._storedFunction = (i) => t.type === Me.Int ? e(i) | 0 : e(i);
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.operation = BABYLON.MathBlockOperations.${Ov[this.operation]};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.operation = this.operation, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.operation = e.operation;
  }
}
C([
  rn("Operation", Gr.List, "ADVANCED", {
    notifiers: { rebuild: !0 },
    options: [
      { label: "Add", value: Ov.Add },
      { label: "Subtract", value: Ov.Subtract },
      { label: "Multiply", value: Ov.Multiply },
      { label: "Divide", value: Ov.Divide },
      { label: "Max", value: Ov.Max },
      { label: "Min", value: Ov.Min }
    ]
  })
], DY.prototype, "operation", void 0);
Ue("BABYLON.MathBlock", DY);
class qne extends yi {
  /**
   * Create a new MapRangeBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("value", Me.AutoDetect), this.registerInput("fromMin", Me.Float, !0, 0), this.registerInput("fromMax", Me.Float, !0, 1), this.registerInput("toMin", Me.Float, !0, 0), this.registerInput("toMax", Me.Float, !0, 1), this.registerOutput("output", Me.BasedOnInput), this._inputs[0].excludedConnectionPointTypes.push(Me.Vector2), this._inputs[0].excludedConnectionPointTypes.push(Me.Vector3), this._inputs[0].excludedConnectionPointTypes.push(Me.Vector4), this._inputs[0].excludedConnectionPointTypes.push(Me.Matrix), this._inputs[0].excludedConnectionPointTypes.push(Me.Geometry), this._inputs[0].excludedConnectionPointTypes.push(Me.Texture), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MapRangeBlock";
  }
  /**
   * Gets the value input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the fromMin input component
   */
  get fromMin() {
    return this._inputs[1];
  }
  /**
   * Gets the fromMax input component
   */
  get fromMax() {
    return this._inputs[2];
  }
  /**
   * Gets the toMin input component
   */
  get toMin() {
    return this._inputs[3];
  }
  /**
   * Gets the toMax input component
   */
  get toMax() {
    return this._inputs[4];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock() {
    if (!this.value.isConnected) {
      this.output._storedFunction = null, this.output._storedValue = null;
      return;
    }
    this.output._storedFunction = (e) => {
      const t = this.value.getConnectedValue(e), r = this.fromMin.getConnectedValue(e), n = this.fromMax.getConnectedValue(e), i = this.toMin.getConnectedValue(e), s = this.toMax.getConnectedValue(e), a = (t - r) / (n - r) * (s - i) + i;
      return this.output.type === Me.Int ? Math.floor(a) : a;
    };
  }
}
Ue("BABYLON.MapRangeBlock", qne);
var y9;
(function(A) {
  A[A.Equal = 0] = "Equal", A[A.NotEqual = 1] = "NotEqual", A[A.LessThan = 2] = "LessThan", A[A.GreaterThan = 3] = "GreaterThan", A[A.LessOrEqual = 4] = "LessOrEqual", A[A.GreaterOrEqual = 5] = "GreaterOrEqual", A[A.Xor = 6] = "Xor", A[A.Or = 7] = "Or", A[A.And = 8] = "And";
})(y9 || (y9 = {}));
class jY extends yi {
  /**
   * Create a new ConditionBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.test = y9.Equal, this.registerInput("left", Me.Float), this.registerInput("right", Me.Float, !0, 0), this.registerInput("ifTrue", Me.AutoDetect, !0, 1), this.registerInput("ifFalse", Me.AutoDetect, !0, 0), this.registerOutput("output", Me.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[2], this._outputs[0]._defaultConnectionPointType = Me.Float, this._inputs[0].acceptedConnectionPointTypes.push(Me.Int), this._inputs[1].acceptedConnectionPointTypes.push(Me.Int), this._linkConnectionTypes(2, 3);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ConditionBlock";
  }
  /**
   * Gets the left input component
   */
  get left() {
    return this._inputs[0];
  }
  /**
   * Gets the right input component
   */
  get right() {
    return this._inputs[1];
  }
  /**
   * Gets the ifTrue input component
   */
  get ifTrue() {
    return this._inputs[2];
  }
  /**
   * Gets the ifFalse input component
   */
  get ifFalse() {
    return this._inputs[3];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock() {
    if (!this.left.isConnected) {
      this.output._storedFunction = null, this.output._storedValue = null;
      return;
    }
    const e = (t) => {
      const r = this.left.getConnectedValue(t), n = this.right.getConnectedValue(t);
      let i = !1;
      switch (this.test) {
        case y9.Equal:
          i = Xt.WithinEpsilon(r, n, Dn);
          break;
        case y9.NotEqual:
          i = r !== n;
          break;
        case y9.LessThan:
          i = r < n;
          break;
        case y9.GreaterThan:
          i = r > n;
          break;
        case y9.LessOrEqual:
          i = r <= n;
          break;
        case y9.GreaterOrEqual:
          i = r >= n;
          break;
        case y9.Xor:
          i = !!r && !n || !r && !!n;
          break;
        case y9.Or:
          i = !!r || !!n;
          break;
        case y9.And:
          i = !!r && !!n;
          break;
      }
      return i;
    };
    this.output._storedFunction = (t) => e(t) ? this.ifTrue.getConnectedValue(t) : this.ifFalse.getConnectedValue(t);
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.test = BABYLON.ConditionBlockTests.${y9[this.test]};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.test = this.test, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.test = e.test;
  }
}
C([
  rn("Test", Gr.List, "ADVANCED", {
    notifiers: { rebuild: !0 },
    options: [
      { label: "Equal", value: y9.Equal },
      { label: "NotEqual", value: y9.NotEqual },
      { label: "LessThan", value: y9.LessThan },
      { label: "GreaterThan", value: y9.GreaterThan },
      { label: "LessOrEqual", value: y9.LessOrEqual },
      { label: "GreaterOrEqual", value: y9.GreaterOrEqual },
      { label: "Xor", value: y9.Xor },
      { label: "Or", value: y9.Or },
      { label: "And", value: y9.And }
    ]
  })
], jY.prototype, "test", void 0);
Ue("BABYLON.ConditionBlock", jY);
var B0;
(function(A) {
  A[A.None = 0] = "None", A[A.LoopID = 1] = "LoopID", A[A.InstanceID = 2] = "InstanceID";
})(B0 || (B0 = {}));
class wY extends yi {
  /**
   * Create a new RandomBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this._currentLockId = -1, this.lockMode = B0.None, this.registerInput("min", Me.AutoDetect), this.registerInput("max", Me.AutoDetect), this.registerOutput("output", Me.BasedOnInput), this._inputs[0].excludedConnectionPointTypes.push(Me.Matrix), this._inputs[0].excludedConnectionPointTypes.push(Me.Geometry), this._inputs[0].excludedConnectionPointTypes.push(Me.Texture), this._inputs[1].excludedConnectionPointTypes.push(Me.Matrix), this._inputs[1].excludedConnectionPointTypes.push(Me.Geometry), this._inputs[1].excludedConnectionPointTypes.push(Me.Texture), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "RandomBlock";
  }
  /**
   * Gets the min input component
   */
  get min() {
    return this._inputs[0];
  }
  /**
   * Gets the max input component
   */
  get max() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.min.isConnected) {
      const e = new xf("Min");
      e.value = 0, e.output.connectTo(this.min);
    }
    if (!this.max.isConnected) {
      const e = new xf("Max");
      e.value = 1, e.output.connectTo(this.max);
    }
  }
  _buildBlock() {
    let e = null;
    switch (this._currentLockId = -1, this.min.type) {
      case Me.Int:
      case Me.Float: {
        e = (t) => {
          const r = this.min.getConnectedValue(t) || 0, n = this.max.getConnectedValue(t) || 0;
          return r + Math.random() * (n - r);
        };
        break;
      }
      case Me.Vector2: {
        e = (t) => {
          const r = this.min.getConnectedValue(t) || at.Zero(), n = this.max.getConnectedValue(t) || at.Zero();
          return new at(r.x + Math.random() * (n.x - r.x), r.y + Math.random() * (n.y - r.y));
        };
        break;
      }
      case Me.Vector3: {
        e = (t) => {
          const r = this.min.getConnectedValue(t) || S.Zero(), n = this.max.getConnectedValue(t) || S.Zero();
          return new S(r.x + Math.random() * (n.x - r.x), r.y + Math.random() * (n.y - r.y), r.z + Math.random() * (n.z - r.z));
        };
        break;
      }
      case Me.Vector4: {
        e = (t) => {
          const r = this.min.getConnectedValue(t) || Ir.Zero(), n = this.max.getConnectedValue(t) || Ir.Zero();
          return new Ir(r.x + Math.random() * (n.x - r.x), r.y + Math.random() * (n.y - r.y), r.z + Math.random() * (n.z - r.z), r.w + Math.random() * (n.w - r.w));
        };
        break;
      }
    }
    this.lockMode === B0.None || !e ? this.output._storedFunction = e : this.output._storedFunction = (t) => {
      let r = 0;
      switch (this.lockMode) {
        case B0.InstanceID:
          r = t.getContextualValue(Ws.InstanceID, !0) || 0;
          break;
        case B0.LoopID:
          r = t.getContextualValue(Ws.LoopID, !0) || 0;
          break;
      }
      return (this._currentLockId !== r || this.lockMode === B0.None) && (this._currentLockId = r, this.output._storedValue = e(t)), this.output._storedValue;
    };
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.lockMode = BABYLON.RandomBlockLocks.${B0[this.lockMode]};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.lockMode = this.lockMode, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.lockMode = e.lockMode;
  }
}
C([
  rn("LockMode", Gr.List, "ADVANCED", {
    notifiers: { rebuild: !0 },
    options: [
      { label: "None", value: B0.None },
      { label: "LoopID", value: B0.LoopID },
      { label: "InstanceID", value: B0.InstanceID }
    ]
  })
], wY.prototype, "lockMode", void 0);
Ue("BABYLON.RandomBlock", wY);
class bne extends yi {
  /**
   * Create a new NoiseBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("offset", Me.Vector3, !0, S.Zero()), this.registerInput("scale", Me.Float, !0, 1), this.registerInput("octaves", Me.Float, !0, 2, 0, 16), this.registerInput("roughness", Me.Float, !0, 0.5, 0, 1), this.registerOutput("output", Me.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "NoiseBlock";
  }
  /**
   * Gets the offset input component
   */
  get offset() {
    return this._inputs[0];
  }
  /**
   * Gets the scale input component
   */
  get scale() {
    return this._inputs[1];
  }
  /**
   * Gets the octaves input component
   */
  get octaves() {
    return this._inputs[2];
  }
  /**
   * Gets the roughtness input component
   */
  get roughness() {
    return this._inputs[3];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _negateIf(e, t) {
    return t !== 0 ? -e : e;
  }
  _noiseGrad(e, t, r, n) {
    const i = e & 15, s = i < 8 ? t : r, a = i === 12 || i == 14 ? t : n, f = i < 4 ? r : a;
    return this._negateIf(s, i & s) + this._negateIf(f, i & 2);
  }
  _fade(e) {
    return e * e * e * (e * (e * 6 - 15) + 10);
  }
  _hashBitRotate(e, t) {
    return e << t | e >> 32 - t;
  }
  _hash(e, t, r) {
    let n, i, s;
    return n = i = s = 3735928584, s += r, i += t, n += e, s ^= i, s -= this._hashBitRotate(i, 14), n ^= s, n -= this._hashBitRotate(s, 11), i ^= n, i -= this._hashBitRotate(n, 25), s ^= i, s -= this._hashBitRotate(i, 16), n ^= s, n -= this._hashBitRotate(s, 4), i ^= n, i -= this._hashBitRotate(n, 14), s ^= i, s -= this._hashBitRotate(i, 24), s;
  }
  _mix(e, t, r, n, i, s, a, f, o, d, v) {
    const u = 1 - o, l = 1 - d;
    return (1 - v) * (l * (e * u + t * o) + d * (r * u + n * o)) + v * (l * (i * u + s * o) + d * (a * u + f * o));
  }
  _perlinNoise(e) {
    const t = (e.x | 0) - (e.x < 0 ? 1 : 0), r = (e.y | 0) - (e.y < 0 ? 1 : 0), n = (e.z | 0) - (e.z < 0 ? 1 : 0), i = e.x - t, s = e.y - r, a = e.z - n, f = this._fade(i), o = this._fade(s), d = this._fade(a);
    return this._mix(this._noiseGrad(this._hash(t, r, n), i, s, a), this._noiseGrad(this._hash(t + 1, r, n), i - 1, s, a), this._noiseGrad(this._hash(t, r + 1, n), i, s - 1, a), this._noiseGrad(this._hash(t + 1, r + 1, n), i - 1, s - 1, a), this._noiseGrad(this._hash(t, r, n + 1), i, s, a - 1), this._noiseGrad(this._hash(t + 1, r, n + 1), i - 1, s, a - 1), this._noiseGrad(this._hash(t, r + 1, n + 1), i, s - 1, a - 1), this._noiseGrad(this._hash(t + 1, r + 1, n + 1), i - 1, s - 1, a - 1), f, o, d);
  }
  _perlinSigned(e) {
    return this._perlinNoise(e) * 0.982;
  }
  _perlin(e) {
    return this._perlinSigned(e) / 2 + 0.5;
  }
  /**
   * Gets a perlin noise value
   * @param octaves
   * @param roughness
   * @param position
   * @returns a value between 0 and 1
   * @see Based on https://github.com/blender/blender/blob/main/source/blender/blenlib/intern/noise.cc#L533
   */
  noise(e, t, r, n, i) {
    const s = new S(r.x * i + n.x, r.y * i + n.y, r.z * i + n.z);
    let a = 1, f = 1, o = 0, d = 0;
    e = Xt.Clamp(e, 0, 15);
    const v = e | 0;
    for (let p = 0; p <= v; p++) {
      const c = this._perlin(s.scale(a));
      d += c * f, o += f, f *= Xt.Clamp(t, 0, 1), a *= 2;
    }
    const u = e - Math.floor(e);
    if (u == 0)
      return d / o;
    const l = this._perlin(s.scale(a));
    let P = d + l * f;
    return d /= o, P /= o + f, (1 - u) * d + u * P;
  }
  _buildBlock() {
    this.output._storedFunction = (e) => {
      const t = e.getContextualValue(Ws.Positions), r = this.octaves.getConnectedValue(e), n = this.roughness.getConnectedValue(e), i = this.offset.getConnectedValue(e), s = this.scale.getConnectedValue(e);
      return this.noise(r, n, t, i, s);
    };
  }
}
Ue("BABYLON.NoiseBlock", bne);
class mY extends yi {
  /**
   * Create a new MergeGeometryBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.registerInput("geometry0", Me.Geometry), this.registerInput("geometry1", Me.Geometry, !0), this.registerInput("geometry2", Me.Geometry, !0), this.registerInput("geometry3", Me.Geometry, !0), this.registerInput("geometry4", Me.Geometry, !0), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MergeGeometryBlock";
  }
  /**
   * Gets the geometry0 input component
   */
  get geometry0() {
    return this._inputs[0];
  }
  /**
   * Gets the geometry1 input component
   */
  get geometry1() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry2 input component
   */
  get geometry2() {
    return this._inputs[2];
  }
  /**
   * Gets the geometry3 input component
   */
  get geometry3() {
    return this._inputs[3];
  }
  /**
   * Gets the geometry4 input component
   */
  get geometry4() {
    return this._inputs[4];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      let n = this.geometry0.getConnectedValue(r);
      const i = [];
      if (n)
        n = n.clone();
      else
        return null;
      if (this.geometry1.isConnected) {
        const s = this.geometry1.getConnectedValue(r);
        s && i.push(s);
      }
      if (this.geometry2.isConnected) {
        const s = this.geometry2.getConnectedValue(r);
        s && i.push(s);
      }
      if (this.geometry3.isConnected) {
        const s = this.geometry3.getConnectedValue(r);
        s && i.push(s);
      }
      if (this.geometry4.isConnected) {
        const s = this.geometry4.getConnectedValue(r);
        s && i.push(s);
      }
      return i.length && n && (n = n.merge(i, !0, !1, !0, !0)), n;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], mY.prototype, "evaluateContext", void 0);
Ue("BABYLON.MergeGeometryBlock", mY);
class BY extends yi {
  /**
   * Create a new GeometryCollectionBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !0, this.registerInput("geometry0", Me.Geometry, !0), this.registerInput("geometry1", Me.Geometry, !0), this.registerInput("geometry2", Me.Geometry, !0), this.registerInput("geometry3", Me.Geometry, !0), this.registerInput("geometry4", Me.Geometry, !0), this.registerInput("geometry5", Me.Geometry, !0), this.registerInput("geometry6", Me.Geometry, !0), this.registerInput("geometry7", Me.Geometry, !0), this.registerInput("geometry8", Me.Geometry, !0), this.registerInput("geometry9", Me.Geometry, !0), this.registerOutput("output", Me.Geometry), this._outputs[0]._typeConnectionSource = this._inputs[0], this._linkConnectionTypes(0, 1);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GeometryCollectionBlock";
  }
  /**
   * Gets the geometry0 input component
   */
  get geometry0() {
    return this._inputs[0];
  }
  /**
   * Gets the geometry1 input component
   */
  get geometry1() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry2 input component
   */
  get geometry2() {
    return this._inputs[2];
  }
  /**
   * Gets the geometry3 input component
   */
  get geometry3() {
    return this._inputs[3];
  }
  /**
   * Gets the geometry4 input component
   */
  get geometry4() {
    return this._inputs[4];
  }
  /**
   * Gets the geometry5 input component
   */
  get geometry5() {
    return this._inputs[5];
  }
  /**
   * Gets the geometry6 input component
   */
  get geometry6() {
    return this._inputs[6];
  }
  /**
   * Gets the geometry7 input component
   */
  get geometry7() {
    return this._inputs[7];
  }
  /**
   * Gets the geometry8 input component
   */
  get geometry8() {
    return this._inputs[8];
  }
  /**
   * Gets the geometry9 input component
   */
  get geometry9() {
    return this._inputs[9];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _storeGeometry(e, t, r, n) {
    if (e.isConnected) {
      const i = e.getConnectedValue(t);
      if (!i)
        return;
      i.metadata = i.metadata || {}, i.metadata.collectionId = r, n.push(i);
    }
  }
  _buildBlock(e) {
    const t = (r) => {
      const n = [];
      return this._storeGeometry(this.geometry0, r, 0, n), this._storeGeometry(this.geometry1, r, 1, n), this._storeGeometry(this.geometry2, r, 2, n), this._storeGeometry(this.geometry3, r, 3, n), this._storeGeometry(this.geometry4, r, 4, n), this._storeGeometry(this.geometry5, r, 5, n), this._storeGeometry(this.geometry6, r, 6, n), this._storeGeometry(this.geometry7, r, 7, n), this._storeGeometry(this.geometry8, r, 8, n), this._storeGeometry(this.geometry9, r, 9, n), n.length ? n[Math.round(Math.random() * (n.length - 1))] : null;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext;
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], BY.prototype, "evaluateContext", void 0);
Ue("BABYLON.GeometryCollectionBlock", BY);
class xne extends yi {
  /**
   * Creates a new GeometryElbowBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("input", Me.AutoDetect), this.registerOutput("output", Me.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the time spent to build this block (in ms)
   */
  get buildExecutionTime() {
    return 0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GeometryElbowBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this._outputs[0], r = this._inputs[0];
    t._storedFunction = (n) => r.getConnectedValue(n);
  }
}
Ue("BABYLON.GeometryElbowBlock", xne);
class Dne extends yi {
  /**
   * Creates a new ComputeNormalsBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("geometry", Me.Geometry), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ComputeNormalsBlock";
  }
  /**
   * Gets the geometry component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock() {
    this.output._storedFunction = (e) => {
      if (!this.geometry.isConnected)
        return null;
      const t = this.geometry.getConnectedValue(e);
      return t.normals || (t.normals = []), Ut.ComputeNormals(t.positions, t.indices, t.normals), t;
    };
  }
}
Ue("BABYLON.ComputeNormalsBlock", Dne);
class jne extends yi {
  /**
   * Create a new VectorConverterBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("xyzw ", Me.Vector4, !0), this.registerInput("xyz ", Me.Vector3, !0), this.registerInput("xy ", Me.Vector2, !0), this.registerInput("zw ", Me.Vector2, !0), this.registerInput("x ", Me.Float, !0), this.registerInput("y ", Me.Float, !0), this.registerInput("z ", Me.Float, !0), this.registerInput("w ", Me.Float, !0), this.registerOutput("xyzw", Me.Vector4), this.registerOutput("xyz", Me.Vector3), this.registerOutput("xy", Me.Vector2), this.registerOutput("zw", Me.Vector2), this.registerOutput("x", Me.Float), this.registerOutput("y", Me.Float), this.registerOutput("z", Me.Float), this.registerOutput("w", Me.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "VectorConverterBlock";
  }
  /**
   * Gets the xyzw component (input)
   */
  get xyzwIn() {
    return this._inputs[0];
  }
  /**
   * Gets the xyz component (input)
   */
  get xyzIn() {
    return this._inputs[1];
  }
  /**
   * Gets the xy component (input)
   */
  get xyIn() {
    return this._inputs[2];
  }
  /**
   * Gets the zw component (input)
   */
  get zwIn() {
    return this._inputs[3];
  }
  /**
   * Gets the x component (input)
   */
  get xIn() {
    return this._inputs[4];
  }
  /**
   * Gets the y component (input)
   */
  get yIn() {
    return this._inputs[5];
  }
  /**
   * Gets the z component (input)
   */
  get zIn() {
    return this._inputs[6];
  }
  /**
   * Gets the w component (input)
   */
  get wIn() {
    return this._inputs[7];
  }
  /**
   * Gets the xyzw component (output)
   */
  get xyzwOut() {
    return this._outputs[0];
  }
  /**
   * Gets the xyz component (output)
   */
  get xyzOut() {
    return this._outputs[1];
  }
  /**
   * Gets the xy component (output)
   */
  get xyOut() {
    return this._outputs[2];
  }
  /**
   * Gets the zw component (output)
   */
  get zwOut() {
    return this._outputs[3];
  }
  /**
   * Gets the x component (output)
   */
  get xOut() {
    return this._outputs[4];
  }
  /**
   * Gets the y component (output)
   */
  get yOut() {
    return this._outputs[5];
  }
  /**
   * Gets the z component (output)
   */
  get zOut() {
    return this._outputs[6];
  }
  /**
   * Gets the w component (output)
   */
  get wOut() {
    return this._outputs[7];
  }
  _inputRename(e) {
    return e === "xyzw " ? "xyzwIn" : e === "xyz " ? "xyzIn" : e === "xy " ? "xyIn" : e === "zw " ? "zwIn" : e === "x " ? "xIn" : e === "y " ? "yIn" : e === "z " ? "zIn" : e === "w " ? "wIn" : e;
  }
  _outputRename(e) {
    switch (e) {
      case "x":
        return "xOut";
      case "y":
        return "yOut";
      case "z":
        return "zOut";
      case "w":
        return "wOut";
      case "xy":
        return "xyOut";
      case "zw":
        return "zwOut";
      case "xyz":
        return "xyzOut";
      case "xyzw":
        return "xyzwOut";
      default:
        return e;
    }
  }
  _buildBlock(e) {
    super._buildBlock(e);
    const t = this.xIn, r = this.yIn, n = this.zIn, i = this.wIn, s = this.xyIn, a = this.zwIn, f = this.xyzIn, o = this.xyzwIn, d = this.xyzwOut, v = this.xyzOut, u = this.xyOut, l = this.zwOut, P = this.xOut, p = this.yOut, c = this.zOut, H = this.wOut, T = (q) => {
      if (o.isConnected)
        return o.getConnectedValue(q);
      let b = 0, j = 0, w = 0, m = 0;
      if (t.isConnected && (b = t.getConnectedValue(q)), r.isConnected && (j = r.getConnectedValue(q)), n.isConnected && (w = n.getConnectedValue(q)), i.isConnected && (m = i.getConnectedValue(q)), s.isConnected) {
        const I = s.getConnectedValue(q);
        I && (b = I.x, j = I.y);
      }
      if (a.isConnected) {
        const I = a.getConnectedValue(q);
        I && (w = I.x, m = I.y);
      }
      if (f.isConnected) {
        const I = f.getConnectedValue(q);
        I && (b = I.x, j = I.y, w = I.z);
      }
      return new Ir(b, j, w, m);
    };
    d._storedFunction = (q) => T(q), v._storedFunction = (q) => {
      const b = T(q);
      return new S(b.x, b.y, b.z);
    }, u._storedFunction = (q) => {
      const b = T(q);
      return new at(b.x, b.y);
    }, l._storedFunction = (q) => {
      const b = T(q);
      return new at(b.z, b.w);
    }, P._storedFunction = (q) => T(q).x, p._storedFunction = (q) => T(q).y, c._storedFunction = (q) => T(q).z, H._storedFunction = (q) => T(q).w;
  }
}
Ue("BABYLON.VectorConverterBlock", jne);
class wne extends yi {
  /**
   * Creates a new NormalizeVectorBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("input", Me.AutoDetect), this.registerOutput("output", Me.BasedOnInput), this._inputs[0].excludedConnectionPointTypes.push(Me.Float), this._inputs[0].excludedConnectionPointTypes.push(Me.Matrix), this._inputs[0].excludedConnectionPointTypes.push(Me.Geometry), this._inputs[0].excludedConnectionPointTypes.push(Me.Texture), this._outputs[0]._typeConnectionSource = this._inputs[0];
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "NormalizeVectorBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    if (super._buildBlock(e), this.output._storedFunction = null, !this.input.isConnected) {
      this.output._storedValue = null;
      return;
    }
    this.output._storedFunction = (t) => this.input.getConnectedValue(t).normalize();
  }
}
Ue("BABYLON.NormalizeVectorBlock", wne);
class WY extends yi {
  /**
   * Create a new SetMaterialIDBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !0, this.registerInput("geometry", Me.Geometry), this.registerInput("id", Me.Int, !0, 0), this.registerOutput("output", Me.Geometry), this.id.acceptedConnectionPointTypes.push(Me.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "SetMaterialIDBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the id input component
   */
  get id() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    if (!this.geometry.isConnected) {
      this.output._storedFunction = null, this.output._storedValue = null;
      return;
    }
    const t = (r) => {
      const n = this.geometry.getConnectedValue(r);
      if (!n || !n.indices || !n.positions)
        return n;
      const i = new wI();
      return i.materialIndex = this.id.getConnectedValue(r) | 0, i.indexStart = 0, i.indexCount = n.indices.length, i.verticesStart = 0, i.verticesCount = n.positions.length / 3, n.materialInfos = [i], n;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], WY.prototype, "evaluateContext", void 0);
Ue("BABYLON.SetMaterialIDBlock", WY);
var Bs;
(function(A) {
  A[A.Cos = 0] = "Cos", A[A.Sin = 1] = "Sin", A[A.Abs = 2] = "Abs", A[A.Exp = 3] = "Exp", A[A.Round = 4] = "Round", A[A.Floor = 5] = "Floor", A[A.Ceiling = 6] = "Ceiling", A[A.Sqrt = 7] = "Sqrt", A[A.Log = 8] = "Log", A[A.Tan = 9] = "Tan", A[A.ArcTan = 10] = "ArcTan", A[A.ArcCos = 11] = "ArcCos", A[A.ArcSin = 12] = "ArcSin", A[A.Sign = 13] = "Sign", A[A.Negate = 14] = "Negate", A[A.OneMinus = 15] = "OneMinus", A[A.Reciprocal = 16] = "Reciprocal", A[A.ToDegrees = 17] = "ToDegrees", A[A.ToRadians = 18] = "ToRadians";
})(Bs || (Bs = {}));
class SY extends yi {
  /**
   * Creates a new GeometryTrigonometryBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.operation = Bs.Cos, this.registerInput("input", Me.AutoDetect), this.registerOutput("output", Me.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._inputs[0].excludedConnectionPointTypes.push(Me.Matrix), this._inputs[0].excludedConnectionPointTypes.push(Me.Geometry), this._inputs[0].excludedConnectionPointTypes.push(Me.Texture);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GeometryTrigonometryBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e);
    let t = null;
    switch (this.operation) {
      case Bs.Cos: {
        t = (r) => Math.cos(r);
        break;
      }
      case Bs.Sin: {
        t = (r) => Math.sin(r);
        break;
      }
      case Bs.Abs: {
        t = (r) => Math.abs(r);
        break;
      }
      case Bs.Exp: {
        t = (r) => Math.exp(r);
        break;
      }
      case Bs.Round: {
        t = (r) => Math.round(r);
        break;
      }
      case Bs.Floor: {
        t = (r) => Math.floor(r);
        break;
      }
      case Bs.Ceiling: {
        t = (r) => Math.ceil(r);
        break;
      }
      case Bs.Sqrt: {
        t = (r) => Math.sqrt(r);
        break;
      }
      case Bs.Log: {
        t = (r) => Math.log(r);
        break;
      }
      case Bs.Tan: {
        t = (r) => Math.tan(r);
        break;
      }
      case Bs.ArcTan: {
        t = (r) => Math.atan(r);
        break;
      }
      case Bs.ArcCos: {
        t = (r) => Math.acos(r);
        break;
      }
      case Bs.ArcSin: {
        t = (r) => Math.asin(r);
        break;
      }
      case Bs.Sign: {
        t = (r) => Math.sign(r);
        break;
      }
      case Bs.Negate: {
        t = (r) => -r;
        break;
      }
      case Bs.OneMinus: {
        t = (r) => 1 - r;
        break;
      }
      case Bs.Reciprocal: {
        t = (r) => 1 / r;
        break;
      }
      case Bs.ToRadians: {
        t = (r) => r * Math.PI / 180;
        break;
      }
      case Bs.ToDegrees: {
        t = (r) => r * 180 / Math.PI;
        break;
      }
    }
    if (!t) {
      this.input._storedFunction = null, this.input._storedValue = null;
      return;
    }
    switch (this.input.type) {
      case Me.Int:
      case Me.Float: {
        this.output._storedFunction = (r) => {
          const n = this.input.getConnectedValue(r);
          return t(n);
        };
        break;
      }
      case Me.Vector2: {
        this.output._storedFunction = (r) => {
          const n = this.input.getConnectedValue(r);
          return new at(t(n.x), t(n.y));
        };
        break;
      }
      case Me.Vector3: {
        this.output._storedFunction = (r) => {
          const n = this.input.getConnectedValue(r);
          return new S(t(n.x), t(n.y), t(n.z));
        };
        break;
      }
      case Me.Vector4: {
        this.output._storedFunction = (r) => {
          const n = this.input.getConnectedValue(r);
          return new Ir(t(n.x), t(n.y), t(n.z), t(n.w));
        };
        break;
      }
    }
    return this;
  }
  serialize() {
    const e = super.serialize();
    return e.operation = this.operation, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.operation = e.operation;
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.operation = BABYLON.GeometryTrigonometryBlockOperations.${Bs[this.operation]};
`;
  }
}
C([
  rn("Operation", Gr.List, "ADVANCED", {
    notifiers: { rebuild: !0 },
    options: [
      { label: "Cos", value: Bs.Cos },
      { label: "Sin", value: Bs.Sin },
      { label: "Abs", value: Bs.Abs },
      { label: "Exp", value: Bs.Exp },
      { label: "Round", value: Bs.Round },
      { label: "Floor", value: Bs.Floor },
      { label: "Ceiling", value: Bs.Ceiling },
      { label: "Sqrt", value: Bs.Sqrt },
      { label: "Log", value: Bs.Log },
      { label: "Tan", value: Bs.Tan },
      { label: "ArcTan", value: Bs.ArcTan },
      { label: "ArcCos", value: Bs.ArcCos },
      { label: "ArcSin", value: Bs.ArcSin },
      { label: "Sign", value: Bs.Sign },
      { label: "Negate", value: Bs.Negate },
      { label: "OneMinus", value: Bs.OneMinus },
      { label: "Reciprocal", value: Bs.Reciprocal },
      { label: "ToDegrees", value: Bs.ToDegrees },
      { label: "ToRadians", value: Bs.ToRadians }
    ]
  })
], SY.prototype, "operation", void 0);
Ue("BABYLON.GeometryTrigonometryBlock", SY);
class UY extends yi {
  /**
   * Create a new GeometryTransformBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this._rotationMatrix = new he(), this._scalingMatrix = new he(), this._translationMatrix = new he(), this._scalingRotationMatrix = new he(), this._transformMatrix = new he(), this.evaluateContext = !0, this.registerInput("value", Me.AutoDetect), this.registerInput("matrix", Me.Matrix, !0), this.registerInput("translation", Me.Vector3, !0, S.Zero()), this.registerInput("rotation", Me.Vector3, !0, S.Zero()), this.registerInput("scaling", Me.Vector3, !0, S.One()), this.registerOutput("output", Me.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._inputs[0].excludedConnectionPointTypes.push(Me.Float), this._inputs[0].excludedConnectionPointTypes.push(Me.Matrix), this._inputs[0].excludedConnectionPointTypes.push(Me.Texture);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GeometryTransformBlock";
  }
  /**
   * Gets the value input component
   */
  get value() {
    return this._inputs[0];
  }
  /**
   * Gets the matrix input component
   */
  get matrix() {
    return this._inputs[1];
  }
  /**
   * Gets the translation input component
   */
  get translation() {
    return this._inputs[2];
  }
  /**
   * Gets the rotation input component
   */
  get rotation() {
    return this._inputs[3];
  }
  /**
   * Gets the scaling input component
   */
  get scaling() {
    return this._inputs[4];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    if (!this.value.isConnected) {
      this.output._storedFunction = null, this.output._storedValue = null;
      return;
    }
    const t = (r) => {
      const n = this.value.getConnectedValue(r);
      if (!n)
        return null;
      let i;
      if (this.matrix.isConnected)
        i = this.matrix.getConnectedValue(r);
      else {
        const s = this.scaling.getConnectedValue(r), a = this.rotation.getConnectedValue(r), f = this.translation.getConnectedValue(r);
        he.ScalingToRef(s.x, s.y, s.z, this._scalingMatrix), he.RotationYawPitchRollToRef(a.y, a.x, a.z, this._rotationMatrix), he.TranslationToRef(f.x, f.y, f.z, this._translationMatrix), this._scalingMatrix.multiplyToRef(this._rotationMatrix, this._scalingRotationMatrix), this._scalingRotationMatrix.multiplyToRef(this._translationMatrix, this._transformMatrix), i = this._transformMatrix;
      }
      switch (this.value.type) {
        case Me.Geometry: {
          const s = n.clone();
          return s.transform(i), s;
        }
        case Me.Vector2:
          return at.Transform(n, i);
        case Me.Vector3:
          return S.TransformCoordinates(n, i);
        case Me.Vector4:
          return Ir.TransformCoordinates(n, i);
      }
      return null;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], UY.prototype, "evaluateContext", void 0);
Ue("BABYLON.GeometryTransformBlock", UY);
class mne extends yi {
  /**
   * Create a new RotationXBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("angle", Me.Float, !1, 0), this.registerOutput("matrix", Me.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "RotationXBlock";
  }
  /**
   * Gets the angle input component
   */
  get angle() {
    return this._inputs[0];
  }
  /**
   * Gets the matrix output component
   */
  get matrix() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.angle.isConnected) {
      const e = new xf("Angle");
      e.value = 0, e.output.connectTo(this.angle);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e), this.matrix._storedFunction = (t) => he.RotationX(this.angle.getConnectedValue(t));
  }
}
Ue("BABYLON.RotationXBlock", mne);
class Bne extends yi {
  /**
   * Create a new RotationYBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("angle", Me.Float, !1, 0), this.registerOutput("matrix", Me.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "RotationYBlock";
  }
  /**
   * Gets the angle input component
   */
  get angle() {
    return this._inputs[0];
  }
  /**
   * Gets the matrix output component
   */
  get matrix() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.angle.isConnected) {
      const e = new xf("Angle");
      e.value = 0, e.output.connectTo(this.angle);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e), this.matrix._storedFunction = (t) => he.RotationY(this.angle.getConnectedValue(t));
  }
}
Ue("BABYLON.RotationYBlock", Bne);
class Wne extends yi {
  /**
   * Create a new RotationZBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("angle", Me.Float, !1, 0), this.registerOutput("matrix", Me.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "RotationZBlock";
  }
  /**
   * Gets the angle input component
   */
  get angle() {
    return this._inputs[0];
  }
  /**
   * Gets the matrix output component
   */
  get matrix() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.angle.isConnected) {
      const e = new xf("Angle");
      e.value = 0, e.output.connectTo(this.angle);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e), this.matrix._storedFunction = (t) => he.RotationZ(this.angle.getConnectedValue(t));
  }
}
Ue("BABYLON.RotationZBlock", Wne);
class Sne extends yi {
  /**
   * Create a new ScalingBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("scale", Me.Vector3, !1, S.One()), this.registerOutput("matrix", Me.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "ScalingBlock";
  }
  /**
   * Gets the scale input component
   */
  get scale() {
    return this._inputs[0];
  }
  /**
   * Gets the matrix output component
   */
  get matrix() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.scale.isConnected) {
      const e = new xf("Scale");
      e.value = new S(1, 1, 1), e.output.connectTo(this.scale);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e), this.matrix._storedFunction = (t) => {
      const r = this.scale.getConnectedValue(t);
      return he.Scaling(r.x, r.y, r.z);
    };
  }
}
Ue("BABYLON.ScalingBlock", Sne);
class Une extends yi {
  /**
   * Create a new AlignBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("source", Me.Vector3, !0, S.Up()), this.registerInput("target", Me.Vector3, !0, S.Left()), this.registerOutput("matrix", Me.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "AlignBlock";
  }
  /**
   * Gets the source input component
   */
  get source() {
    return this._inputs[0];
  }
  /**
   * Gets the target input component
   */
  get target() {
    return this._inputs[1];
  }
  /**
   * Gets the matrix output component
   */
  get matrix() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    super._buildBlock(e), this.matrix._storedFunction = (t) => {
      const r = this.source.getConnectedValue(t).clone(), n = this.target.getConnectedValue(t).clone(), i = new he();
      return r.normalize(), n.normalize(), he.RotationAlignToRef(r, n, i, !0), i;
    };
  }
}
Ue("BABYLON.AlignBlock", Une);
class Ine extends yi {
  /**
   * Create a new TranslationBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("translation", Me.Vector3, !1, S.Zero()), this.registerOutput("matrix", Me.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "TranslationBlock";
  }
  /**
   * Gets the translation input component
   */
  get translation() {
    return this._inputs[0];
  }
  /**
   * Gets the matrix output component
   */
  get matrix() {
    return this._outputs[0];
  }
  autoConfigure() {
    if (!this.translation.isConnected) {
      const e = new xf("Translation");
      e.value = new S(0, 0, 0), e.output.connectTo(this.translation);
    }
  }
  _buildBlock(e) {
    super._buildBlock(e), this.matrix._storedFunction = (t) => {
      const r = this.translation.getConnectedValue(t);
      return he.Translation(r.x, r.y, r.z);
    };
  }
}
Ue("BABYLON.TranslationBlock", Ine);
class by extends yi {
  /**
   * Create a new InstantiateOnVerticesBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this._indexTranslation = null, this.evaluateContext = !0, this.removeDuplicatedPositions = !0, this.registerInput("geometry", Me.Geometry), this.registerInput("instance", Me.Geometry, !0), this.registerInput("density", Me.Float, !0, 1, 0, 1), this.registerInput("matrix", Me.Matrix, !0), this.registerInput("rotation", Me.Vector3, !0, S.Zero()), this.registerInput("scaling", Me.Vector3, !0, S.One()), this.scaling.acceptedConnectionPointTypes.push(Me.Float), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current instance index in the current flow
   * @returns the current index
   */
  getInstanceIndex() {
    return this._currentLoopIndex;
  }
  /**
   * Gets the current index in the current flow
   * @returns the current index
   */
  getExecutionIndex() {
    return this._indexTranslation ? this._indexTranslation[this._currentIndex] : this._currentIndex;
  }
  /**
   * Gets the current loop index in the current flow
   * @returns the current loop index
   */
  getExecutionLoopIndex() {
    return this._currentLoopIndex;
  }
  /**
   * Gets the current face index in the current flow
   * @returns the current face index
   */
  getExecutionFaceIndex() {
    return 0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "InstantiateOnVerticesBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the instance input component
   */
  get instance() {
    return this._inputs[1];
  }
  /**
   * Gets the density input component
   */
  get density() {
    return this._inputs[2];
  }
  /**
   * Gets the matrix input component
   */
  get matrix() {
    return this._inputs[3];
  }
  /**
   * Gets the rotation input component
   */
  get rotation() {
    return this._inputs[4];
  }
  /**
   * Gets the scaling input component
   */
  get scaling() {
    return this._inputs[5];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      if (r.pushExecutionContext(this), r.pushInstancingContext(this), this._vertexData = this.geometry.getConnectedValue(r), r.pushGeometryContext(this._vertexData), !this._vertexData || !this._vertexData.positions || !this.instance.isConnected) {
        r.restoreExecutionContext(), r.restoreInstancingContext(), r.restoreGeometryContext(), this.output._storedValue = null;
        return;
      }
      let n = this._vertexData.positions.length / 3;
      const i = [], s = new S(), a = [];
      let f = this._vertexData.positions;
      if (this._currentLoopIndex = 0, this.removeDuplicatedPositions) {
        for (this._indexTranslation = {}, this._currentIndex = 0; this._currentIndex < n; this._currentIndex++) {
          const o = f[this._currentIndex * 3], d = f[this._currentIndex * 3 + 1], v = f[this._currentIndex * 3 + 2];
          let u = !1;
          for (let l = 0; l < a.length; l += 3)
            if (Math.abs(a[l] - o) < Dn && Math.abs(a[l + 1] - d) < Dn && Math.abs(a[l + 2] - v) < Dn) {
              u = !0;
              break;
            }
          u || (this._indexTranslation[a.length / 3] = this._currentIndex, a.push(o, d, v));
        }
        f = a, n = f.length / 3;
      } else
        this._indexTranslation = null;
      for (this._currentIndex = 0; this._currentIndex < n; this._currentIndex++) {
        const o = this.instance.getConnectedValue(r);
        if (!o || !o.positions || o.positions.length === 0)
          continue;
        const d = this.density.getConnectedValue(r);
        if (d < 1 && Math.random() > d)
          continue;
        s.fromArray(f, this._currentIndex * 3);
        const v = o.clone();
        if (this.matrix.isConnected) {
          const u = this.matrix.getConnectedValue(r);
          r._instantiateWithPositionAndMatrix(v, s, u, i);
        } else {
          const u = r.adaptInput(this.scaling, Me.Vector3, S.OneReadOnly), l = this.rotation.getConnectedValue(r) || S.ZeroReadOnly;
          r._instantiate(v, s, l, u, i);
        }
        this._currentLoopIndex++;
      }
      if (r.restoreGeometryContext(), r.restoreExecutionContext(), r.restoreInstancingContext(), i.length)
        if (i.length === 1)
          this._vertexData = i[0];
        else {
          const o = i.splice(0, 1)[0];
          this._vertexData = o.merge(i, !0, !1, !0, !0);
        }
      else
        return null;
      return this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode() + `${this._codeVariableName}.removeDuplicatedPositions = ${this.removeDuplicatedPositions ? "true" : "false"};
`;
    return e += `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`, e;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.removeDuplicatedPositions = this.removeDuplicatedPositions, e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.removeDuplicatedPositions = e.removeDuplicatedPositions, e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], by.prototype, "evaluateContext", void 0);
C([
  rn("Remove duplicated positions", Gr.Boolean, "ADVANCED", { notifiers: { update: !0 } })
], by.prototype, "removeDuplicatedPositions", void 0);
Ue("BABYLON.InstantiateOnVerticesBlock", by);
class IY extends yi {
  /**
   * Create a new InstantiateOnFacesBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this._currentPosition = new S(), this._currentUV = new at(), this._vertex0 = new S(), this._vertex1 = new S(), this._vertex2 = new S(), this._tempVector0 = new S(), this._tempVector1 = new S(), this._uv0 = new at(), this._uv1 = new at(), this._uv2 = new at(), this.evaluateContext = !0, this.registerInput("geometry", Me.Geometry), this.registerInput("instance", Me.Geometry, !0), this.registerInput("count", Me.Int, !0, 256), this.registerInput("matrix", Me.Matrix, !0), this.registerInput("rotation", Me.Vector3, !0, S.Zero()), this.registerInput("scaling", Me.Vector3, !0, S.One()), this.scaling.acceptedConnectionPointTypes.push(Me.Float), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current instance index in the current flow
   * @returns the current index
   */
  getInstanceIndex() {
    return this._currentLoopIndex;
  }
  /**
   * Gets the current index in the current flow
   * @returns the current index
   */
  getExecutionIndex() {
    return 0;
  }
  /**
   * Gets the current face index in the current flow
   * @returns the current face index
   */
  getExecutionFaceIndex() {
    return this._currentFaceIndex;
  }
  /**
   * Gets the current loop index in the current flow
   * @returns the current loop index
   */
  getExecutionLoopIndex() {
    return this._currentLoopIndex;
  }
  /**
   * Gets the value associated with a contextual positions
   * @returns the value associated with the source
   */
  getOverridePositionsContextualValue() {
    return this._currentPosition;
  }
  /**
   * Gets the value associated with a contextual normals
   * @returns the value associated with the source
   */
  getOverrideNormalsContextualValue() {
    return this._vertex1.subtractToRef(this._vertex0, this._tempVector0), this._vertex2.subtractToRef(this._vertex1, this._tempVector1), this._tempVector0.normalize(), this._tempVector1.normalize(), S.Cross(this._tempVector1, this._tempVector0);
  }
  /**
   * Gets the value associated with a contextual UV1 se
   * @returns the value associated with the source
   */
  getOverrideUVs1ContextualValue() {
    return this._currentUV;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "InstantiateOnFacesBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the instance input component
   */
  get instance() {
    return this._inputs[1];
  }
  /**
   * Gets the count input component
   */
  get count() {
    return this._inputs[2];
  }
  /**
   * Gets the matrix input component
   */
  get matrix() {
    return this._inputs[3];
  }
  /**
   * Gets the rotation input component
   */
  get rotation() {
    return this._inputs[4];
  }
  /**
   * Gets the scaling input component
   */
  get scaling() {
    return this._inputs[5];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      if (r.pushExecutionContext(this), r.pushInstancingContext(this), this._vertexData = this.geometry.getConnectedValue(r), r.pushGeometryContext(this._vertexData), !this._vertexData || !this._vertexData.positions || !this._vertexData.indices || !this.instance.isConnected) {
        r.restoreExecutionContext(), r.restoreInstancingContext(), r.restoreGeometryContext(), this.output._storedValue = null;
        return;
      }
      let n = null;
      const i = this.count.getConnectedValue(r), s = this._vertexData.indices.length / 3, a = i / s;
      let f = 0;
      const o = [];
      let d = 0;
      for (this._currentLoopIndex = 0, this._currentFaceIndex = 0; this._currentFaceIndex < s; this._currentFaceIndex++) {
        f += a;
        const v = (f | 0) - d;
        if (v < 1)
          continue;
        const u = this._vertexData.indices[this._currentFaceIndex * 3], l = this._vertexData.indices[this._currentFaceIndex * 3 + 1], P = this._vertexData.indices[this._currentFaceIndex * 3 + 2];
        this._vertex0.fromArray(this._vertexData.positions, u * 3), this._vertex1.fromArray(this._vertexData.positions, l * 3), this._vertex2.fromArray(this._vertexData.positions, P * 3), this._vertexData.uvs && (this._uv0.fromArray(this._vertexData.uvs, u * 2), this._uv1.fromArray(this._vertexData.uvs, l * 2), this._uv2.fromArray(this._vertexData.uvs, P * 2));
        for (let p = 0; p < v && !(d >= i); p++) {
          let c = Math.random(), H = Math.random();
          if (c > H) {
            const w = c;
            c = H, H = w;
          }
          const T = c, q = H - c, b = 1 - T - q;
          if (this._currentPosition.set(T * this._vertex0.x + q * this._vertex1.x + b * this._vertex2.x, T * this._vertex0.y + q * this._vertex1.y + b * this._vertex2.y, T * this._vertex0.z + q * this._vertex1.z + b * this._vertex2.z), this._vertexData.uvs && this._currentUV.set(T * this._uv0.x + q * this._uv1.x + b * this._uv2.x, T * this._uv0.y + q * this._uv1.y + b * this._uv2.y), n = this.instance.getConnectedValue(r), !n || !n.positions || n.positions.length === 0) {
            f -= a;
            continue;
          }
          const j = n.clone();
          if (this.matrix.isConnected) {
            const w = this.matrix.getConnectedValue(r);
            r._instantiateWithPositionAndMatrix(j, this._currentPosition, w, o);
          } else {
            const w = r.adaptInput(this.scaling, Me.Vector3, S.OneReadOnly), m = this.rotation.getConnectedValue(r) || S.ZeroReadOnly;
            r._instantiate(j, this._currentPosition, m, w, o);
          }
          d++, this._currentLoopIndex++;
        }
      }
      if (o.length)
        if (o.length === 1)
          this._vertexData = o[0];
        else {
          const v = o.splice(0, 1)[0];
          this._vertexData = v.merge(o, !0, !1, !0, !0);
        }
      return r.restoreExecutionContext(), r.restoreInstancingContext(), r.restoreGeometryContext(), this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], IY.prototype, "evaluateContext", void 0);
Ue("BABYLON.InstantiateOnFacesBlock", IY);
class RY extends yi {
  /**
   * Create a new InstantiateOnVolumeBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this._currentPosition = new S(), this._vertex0 = new S(), this._vertex1 = new S(), this._vertex2 = new S(), this.evaluateContext = !0, this.registerInput("geometry", Me.Geometry), this.registerInput("instance", Me.Geometry, !0), this.registerInput("count", Me.Int, !0, 256), this.registerInput("matrix", Me.Matrix, !0), this.registerInput("rotation", Me.Vector3, !0, S.Zero()), this.registerInput("scaling", Me.Vector3, !0, S.One()), this.scaling.acceptedConnectionPointTypes.push(Me.Float), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current instance index in the current flow
   * @returns the current index
   */
  getInstanceIndex() {
    return this._currentLoopIndex;
  }
  /**
   * Gets the current index in the current flow
   * @returns the current index
   */
  getExecutionIndex() {
    return 0;
  }
  /**
   * Gets the current face index in the current flow
   * @returns the current face index
   */
  getExecutionFaceIndex() {
    return 0;
  }
  /**
   * Gets the current loop index in the current flow
   * @returns the current loop index
   */
  getExecutionLoopIndex() {
    return this._currentLoopIndex;
  }
  /**
   * Gets the value associated with a contextual positions
   * @returns the value associated with the source
   */
  getOverridePositionsContextualValue() {
    return this._currentPosition;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "InstantiateOnVolumeBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the instance input component
   */
  get instance() {
    return this._inputs[1];
  }
  /**
   * Gets the count input component
   */
  get count() {
    return this._inputs[2];
  }
  /**
   * Gets the matrix input component
   */
  get matrix() {
    return this._inputs[3];
  }
  /**
   * Gets the rotation input component
   */
  get rotation() {
    return this._inputs[4];
  }
  /**
   * Gets the scaling input component
   */
  get scaling() {
    return this._inputs[5];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      if (r.pushExecutionContext(this), r.pushInstancingContext(this), this._vertexData = this.geometry.getConnectedValue(r), r.pushGeometryContext(this._vertexData), !this._vertexData || !this._vertexData.positions || !this._vertexData.indices || !this.instance.isConnected) {
        r.restoreExecutionContext(), r.restoreInstancingContext(), r.restoreGeometryContext(), this.output._storedValue = null;
        return;
      }
      let n = null;
      const i = this.count.getConnectedValue(r), s = [], a = WS(this._vertexData.positions, 0, this._vertexData.positions.length / 3), f = a.minimum, o = a.maximum, d = new S(1, 0, 0), v = this._vertexData.indices.length / 3;
      this._currentLoopIndex = 0;
      for (let u = 0; u < i; u++) {
        this._currentPosition.set(Math.random() * (o.x - f.x) + f.x, Math.random() * (o.y - f.y) + f.y, Math.random() * (o.z - f.z) + f.z);
        const l = new Hi(this._currentPosition, d);
        let P = 0;
        for (let c = 0; c < v; c++) {
          this._vertex0.fromArray(this._vertexData.positions, this._vertexData.indices[c * 3] * 3), this._vertex1.fromArray(this._vertexData.positions, this._vertexData.indices[c * 3 + 1] * 3), this._vertex2.fromArray(this._vertexData.positions, this._vertexData.indices[c * 3 + 2] * 3);
          const H = l.intersectsTriangle(this._vertex0, this._vertex1, this._vertex2);
          H && H.distance > 0 && P++;
        }
        if (P % 2 === 0) {
          u--;
          continue;
        }
        if (n = this.instance.getConnectedValue(r), !n || !n.positions || n.positions.length === 0)
          continue;
        const p = n.clone();
        if (this.matrix.isConnected) {
          const c = this.matrix.getConnectedValue(r);
          r._instantiateWithPositionAndMatrix(p, this._currentPosition, c, s);
        } else {
          const c = r.adaptInput(this.scaling, Me.Vector3, S.OneReadOnly), H = this.rotation.getConnectedValue(r) || S.ZeroReadOnly;
          r._instantiate(p, this._currentPosition, H, c, s);
        }
        this._currentLoopIndex++;
      }
      if (s.length)
        if (s.length === 1)
          this._vertexData = s[0];
        else {
          const u = s.splice(0, 1)[0];
          this._vertexData = u.merge(s, !0, !1, !0, !0);
        }
      return r.restoreGeometryContext(), r.restoreExecutionContext(), r.restoreInstancingContext(), this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], RY.prototype, "evaluateContext", void 0);
Ue("BABYLON.InstantiateOnVolumeBlock", RY);
class xy extends yi {
  /**
   * Create a new InstantiateBaseBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !0, this.registerInput("instance", Me.Geometry, !0), this.registerInput("count", Me.Int, !0, 1), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current instance index in the current flow
   * @returns the current index
   */
  getInstanceIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current index in the current flow
   * @returns the current index
   */
  getExecutionIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current loop index in the current flow
   * @returns the current loop index
   */
  getExecutionLoopIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current face index in the current flow
   * @returns the current face index
   */
  getExecutionFaceIndex() {
    return 0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "InstantiateBaseBlock";
  }
  /**
   * Gets the instance input component
   */
  get instance() {
    return this._inputs[0];
  }
  /**
   * Gets the count input component
   */
  get count() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e;
  }
  _deserialize(e) {
    super._deserialize(e), e.evaluateContext !== void 0 && (this.evaluateContext = e.evaluateContext);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], xy.prototype, "evaluateContext", void 0);
class Rne extends xy {
  /**
   * Create a new InstantiateBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("matrix", Me.Matrix, !0), this.registerInput("position", Me.Vector3, !0, S.Zero()), this.registerInput("rotation", Me.Vector3, !0, S.Zero()), this.registerInput("scaling", Me.Vector3, !0, S.One()), this.scaling.acceptedConnectionPointTypes.push(Me.Float);
  }
  /**
   * Gets the current instance index in the current flow
   * @returns the current index
   */
  getInstanceIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current index in the current flow
   * @returns the current index
   */
  getExecutionIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current loop index in the current flow
   * @returns the current loop index
   */
  getExecutionLoopIndex() {
    return this._currentIndex;
  }
  /**
   * Gets the current face index in the current flow
   * @returns the current face index
   */
  getExecutionFaceIndex() {
    return 0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "InstantiateBlock";
  }
  /**
   * Gets the matrix input component
   */
  get matrix() {
    return this._inputs[2];
  }
  /**
   * Gets the position input component
   */
  get position() {
    return this._inputs[3];
  }
  /**
   * Gets the rotation input component
   */
  get rotation() {
    return this._inputs[4];
  }
  /**
   * Gets the scaling input component
   */
  get scaling() {
    return this._inputs[5];
  }
  _buildBlock(e) {
    const t = (r) => {
      r.pushExecutionContext(this), r.pushInstancingContext(this);
      const n = this.count.getConnectedValue(r), i = [];
      for (this._currentIndex = 0; this._currentIndex < n; this._currentIndex++) {
        const s = this.instance.getConnectedValue(r);
        if (!s || !s.positions || s.positions.length === 0)
          continue;
        const a = s.clone();
        if (this.matrix.isConnected) {
          const f = this.matrix.getConnectedValue(r);
          r._instantiateWithMatrix(a, f, i);
        } else {
          const f = this.position.getConnectedValue(r) || S.ZeroReadOnly, o = r.adaptInput(this.scaling, Me.Vector3, S.OneReadOnly), d = this.rotation.getConnectedValue(r) || S.ZeroReadOnly;
          r._instantiate(a, f, d, o, i);
        }
      }
      if (i.length)
        if (i.length === 1)
          this._vertexData = i[0];
        else {
          const s = i.splice(0, 1)[0];
          this._vertexData = s.merge(i, !0, !1, !0, !0);
        }
      return r.restoreExecutionContext(), r.restoreInstancingContext(), this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
}
Ue("BABYLON.InstantiateBlock", Rne);
class Vne extends xy {
  /**
   * Create a new Instantiate Linear Block
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("direction", Me.Vector3, !0, new S(1, 0, 0)), this.registerInput("rotation", Me.Vector3, !0, new S(0, 0, 0)), this.registerInput("scaling", Me.Vector3, !0, new S(0, 0, 0)), this.scaling.acceptedConnectionPointTypes.push(Me.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "InstantiateLinearBlock";
  }
  /**
   * Gets the direction input component
   */
  get direction() {
    return this._inputs[2];
  }
  /**
   * Gets the rotation input component
   */
  get rotation() {
    return this._inputs[3];
  }
  /**
   * Gets the scaling input component
   */
  get scaling() {
    return this._inputs[4];
  }
  _buildBlock(e) {
    const t = (r) => {
      r.pushExecutionContext(this), r.pushInstancingContext(this);
      const n = this.count.getConnectedValue(r), i = [], s = he.Identity(), a = S.Zero(), f = S.Zero(), o = S.Zero();
      for (this._currentIndex = 0; this._currentIndex < n; this._currentIndex++) {
        const d = this.instance.getConnectedValue(r);
        if (!d || !d.positions || d.positions.length === 0)
          continue;
        const v = d.clone(), u = this.direction.getConnectedValue(r), l = this.rotation.getConnectedValue(r), P = r.adaptInput(this.scaling, Me.Vector3, S.OneReadOnly);
        a.copyFrom(u.clone().scale(this._currentIndex)), f.copyFrom(l.clone().scale(this._currentIndex)), o.copyFrom(P.clone().scale(this._currentIndex)), o.addInPlaceFromFloats(1, 1, 1), he.ComposeToRef(o, Ze.FromEulerAngles(f.x, f.y, f.z), a, s), r._instantiateWithMatrix(v, s, i);
      }
      if (i.length)
        if (i.length === 1)
          this._vertexData = i[0];
        else {
          const d = i.splice(0, 1)[0];
          this._vertexData = d.merge(i, !0, !1, !0, !0);
        }
      return r.restoreExecutionContext(), r.restoreInstancingContext(), this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
}
Ue("BABYLON.InstantiateLinearBlock", Vne);
class Cne extends xy {
  /**
   * Create a new InstantiateRadialBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("radius", Me.Int, !0, 0, 0), this.registerInput("angleStart", Me.Float, !0, 0), this.registerInput("angleEnd", Me.Float, !0, Math.PI * 2), this.registerInput("transform", Me.Vector3, !0, new S(0, 0, 0)), this.registerInput("rotation", Me.Vector3, !0, new S(0, 0, 0)), this.registerInput("scaling", Me.Vector3, !0, new S(0, 0, 0)), this.scaling.acceptedConnectionPointTypes.push(Me.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "InstantiateRadialBlock";
  }
  /**
   * Gets the direction input component
   */
  get radius() {
    return this._inputs[2];
  }
  /**
   * Gets the direction input component
   */
  get angleStart() {
    return this._inputs[3];
  }
  /**
   * Gets the direction input component
   */
  get angleEnd() {
    return this._inputs[4];
  }
  /**
   * Gets the transform input component
   */
  get transform() {
    return this._inputs[5];
  }
  /**
   * Gets the rotation input component
   */
  get rotation() {
    return this._inputs[6];
  }
  /**
   * Gets the scaling input component
   */
  get scaling() {
    return this._inputs[7];
  }
  _buildBlock(e) {
    const t = (r) => {
      r.pushExecutionContext(this), r.pushInstancingContext(this);
      const n = this.count.getConnectedValue(r), i = [], s = he.Identity(), a = he.Identity(), f = he.Identity(), o = S.Zero(), d = S.Zero(), v = S.Zero();
      for (this._currentIndex = 0; this._currentIndex < n; this._currentIndex++) {
        const u = this.instance.getConnectedValue(r);
        if (!u || !u.positions || u.positions.length === 0)
          continue;
        const l = u.clone(), P = this.radius.getConnectedValue(r), p = this.angleStart.getConnectedValue(r), c = this.angleEnd.getConnectedValue(r), H = this.transform.getConnectedValue(r), T = this.rotation.getConnectedValue(r), q = r.adaptInput(this.scaling, Me.Vector3, S.OneReadOnly), j = (c - p) / n, w = p + j * this._currentIndex, m = Ze.FromEulerAngles(0, w, 0);
        o.copyFrom(H.clone().scale(this._currentIndex)), d.copyFrom(T.clone().scale(this._currentIndex)), v.copyFrom(q.clone().scale(this._currentIndex)), v.addInPlaceFromFloats(1, 1, 1), he.RotationYawPitchRollToRef(d.y, d.x, d.z, s), a.setTranslationFromFloats(0, 0, P), he.ComposeToRef(v, m, o, f), s.multiplyToRef(a, a), a.multiplyToRef(f, f), r._instantiateWithMatrix(l, f, i);
      }
      if (i.length)
        if (i.length === 1)
          this._vertexData = i[0];
        else {
          const u = i.splice(0, 1)[0];
          this._vertexData = u.merge(i, !0, !1, !0, !0);
        }
      return r.restoreExecutionContext(), r.restoreInstancingContext(), this._vertexData;
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
}
Ue("BABYLON.InstantiateRadialBlock", Cne);
class One extends yi {
  /**
   * Create a new IntFloatConverterBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("float ", Me.Float, !0), this.registerInput("int ", Me.Int, !0), this.registerOutput("float", Me.Float), this.registerOutput("int", Me.Int);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "IntFloatConverterBlock";
  }
  /**
   * Gets the float input component
   */
  get floatIn() {
    return this._inputs[0];
  }
  /**
   * Gets the int input component
   */
  get intIn() {
    return this._inputs[1];
  }
  /**
   * Gets the float output component
   */
  get floatOut() {
    return this._outputs[0];
  }
  /**
   * Gets the int output component
   */
  get intOut() {
    return this._outputs[1];
  }
  _inputRename(e) {
    return e === "float " ? "floatIn" : e === "int " ? "intIn" : e;
  }
  _buildBlock() {
    this.floatOut._storedFunction = (e) => this.floatIn.isConnected ? this.floatIn.getConnectedValue(e) : this.intIn.isConnected ? this.intIn.getConnectedValue(e) : 0, this.intOut._storedFunction = (e) => this.floatIn.isConnected ? Math.floor(this.floatIn.getConnectedValue(e)) : this.intIn.isConnected ? Math.floor(this.intIn.getConnectedValue(e)) : 0;
  }
}
Ue("BABYLON.IntFloatConverterBlock", One);
class yne extends yi {
  /**
   * Create a new DebugBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.log = [], this._isDebug = !0, this.registerInput("input", Me.AutoDetect), this.registerOutput("output", Me.BasedOnInput), this._outputs[0]._typeConnectionSource = this._inputs[0], this._inputs[0].excludedConnectionPointTypes.push(Me.Geometry), this._inputs[0].excludedConnectionPointTypes.push(Me.Texture);
  }
  /**
   * Gets the time spent to build this block (in ms)
   */
  get buildExecutionTime() {
    return 0;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "DebugBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    if (!this.input.isConnected) {
      this.output._storedFunction = null, this.output._storedValue = null;
      return;
    }
    this.log = [];
    const t = (r) => {
      const n = this.input.getConnectedValue(r);
      return n == null ? (this.log.push("null"), n) : (this.log.push(n.toString()), n);
    };
    this.output.isConnected ? this.output._storedFunction = t : this.output._storedValue = t(e);
  }
}
Ue("BABYLON.DebugBlock", yne);
class kne extends yi {
  /**
   * Create a new GeometryInfoBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("geometry", Me.Geometry), this.registerOutput("output", Me.Geometry), this.registerOutput("id", Me.Int), this.registerOutput("collectionId", Me.Int), this.registerOutput("verticesCount", Me.Int), this.registerOutput("facesCount", Me.Int);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GeometryInfoBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  /**
   * Gets the id output component
   */
  get id() {
    return this._outputs[1];
  }
  /**
   * Gets the collectionId output component
   */
  get collectionId() {
    return this._outputs[2];
  }
  /**
   * Gets the verticesCount output component
   */
  get verticesCount() {
    return this._outputs[3];
  }
  /**
   * Gets the facesCount output component
   */
  get facesCount() {
    return this._outputs[4];
  }
  _buildBlock() {
    if (!this.geometry.isConnected) {
      this.id._storedValue = 0, this.collectionId._storedValue = 0, this.verticesCount._storedValue = 0, this.facesCount._storedValue = 0, this.output._storedValue = 0, this.id._storedFunction = null, this.collectionId._storedFunction = null, this.verticesCount._storedFunction = null, this.facesCount._storedFunction = null, this.output._storedFunction = null;
      return;
    }
    this.output._storedFunction = (e) => (this._currentVertexData = this.geometry.getConnectedValue(e), this._currentVertexData), this.id._storedFunction = (e) => (this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(e), this._currentVertexData.uniqueId), this.collectionId._storedFunction = (e) => (this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(e), this._currentVertexData.metadata ? this._currentVertexData.metadata.collectionId : 0), this.verticesCount._storedFunction = (e) => (this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(e), this._currentVertexData.positions ? this._currentVertexData.positions.length / 3 : 0), this.facesCount._storedFunction = (e) => (this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(e), this._currentVertexData.indices ? this._currentVertexData.indices.length / 3 : 0);
  }
}
Ue("BABYLON.GeometryInfoBlock", kne);
var GH;
(function(A) {
  A[A.Spherical = 0] = "Spherical", A[A.Cylindrical = 1] = "Cylindrical", A[A.Cubic = 2] = "Cubic";
})(GH || (GH = {}));
class VY extends yi {
  /**
   * Create a new MappingBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.mapping = GH.Spherical, this.registerInput("position", Me.Vector3), this.registerInput("normal", Me.Vector3), this.registerInput("center", Me.Vector3, !0, S.Zero()), this.registerOutput("uv", Me.Vector2);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MappingBlock";
  }
  /**
   * Gets the position input component
   */
  get position() {
    return this._inputs[0];
  }
  /**
   * Gets the normal input component
   */
  get normal() {
    return this._inputs[1];
  }
  /**
   * Gets the center input component
   */
  get center() {
    return this._inputs[2];
  }
  /**
   * Gets the output component
   */
  get uv() {
    return this._outputs[0];
  }
  _buildBlock() {
    if (!this.position.isConnected) {
      this.uv._storedFunction = null, this.uv._storedValue = null;
      return;
    }
    const e = S.Zero(), t = (r) => {
      const n = this.position.getConnectedValue(r) || S.Zero(), i = this.normal.getConnectedValue(r) || S.Zero(), s = this.center.getConnectedValue(r), a = at.Zero();
      switch (this.mapping) {
        case GH.Spherical: {
          n.subtractToRef(s, e);
          const f = e.length();
          f > 0 && (a.x = Math.acos(e.y / f) / Math.PI, (e.x !== 0 || e.z !== 0) && (a.y = Math.atan2(e.x, e.z) / (Math.PI * 2)));
          break;
        }
        case GH.Cylindrical: {
          n.subtractToRef(s, e);
          const f = e.length();
          f > 0 && (a.x = Math.atan2(e.x / f, e.z / f) / (Math.PI * 2), a.y = (e.y + 1) / 2);
          break;
        }
        case GH.Cubic: {
          const f = Math.abs(i.x), o = Math.abs(i.y), d = Math.abs(i.z), v = Math.max(Math.abs(n.x), Math.abs(n.y), Math.abs(n.z));
          let u = 0, l = 0;
          f >= o && f >= d ? (u = n.y / v - s.y, l = n.z / v - s.z) : o >= f && o >= d ? (u = n.x / v - s.x, l = n.z / v - s.z) : (u = n.x / v - s.x, l = n.y / v - s.y), a.x = (u + 1) / 2, a.y = (l + 1) / 2;
        }
      }
      return a;
    };
    this.uv._storedFunction = (r) => t(r);
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.mapping = BABYLON.MappingTypes.${GH[this.mapping]};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.mapping = this.mapping, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.mapping = e.mapping;
  }
}
C([
  rn("Mapping", Gr.List, "ADVANCED", {
    notifiers: { rebuild: !0 },
    options: [
      { label: "Spherical", value: GH.Spherical },
      { label: "Cylindrical", value: GH.Cylindrical },
      { label: "Cubic", value: GH.Cubic }
    ]
  })
], VY.prototype, "mapping", void 0);
Ue("BABYLON.MappingBlock", VY);
class Ene extends yi {
  /**
   * Create a new MatrixComposeBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("matrix0", Me.Matrix), this.registerInput("matrix1", Me.Matrix), this.registerOutput("output", Me.Matrix);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "MatrixComposeBlock";
  }
  /**
   * Gets the matrix0 input component
   */
  get matrix0() {
    return this._inputs[0];
  }
  /**
   * Gets the matrix1 input component
   */
  get matrix1() {
    return this._inputs[1];
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock() {
    this.output._storedFunction = (e) => {
      if (!this.matrix0.isConnected || !this.matrix1.isConnected)
        return null;
      const t = this.matrix0.getConnectedValue(e), r = this.matrix1.getConnectedValue(e);
      return !t || !r ? null : t.multiply(r);
    };
  }
}
Ue("BABYLON.MatrixComposeBlock", Ene);
class Fne extends yi {
  /** Gets the list of attached endpoints */
  get endpoints() {
    return this._endpoints;
  }
  /**
   * Create a new TeleportInBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this._endpoints = [], this._isTeleportIn = !0, this.registerInput("input", Me.AutoDetect);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "TeleportInBlock";
  }
  /**
   * Gets the input component
   */
  get input() {
    return this._inputs[0];
  }
  _dumpCode(e, t) {
    let r = super._dumpCode(e, t);
    for (const n of this.endpoints)
      t.indexOf(n) === -1 && (r += n._dumpCode(e, t));
    return r;
  }
  /**
   * Checks if the current block is an ancestor of a given type
   * @param type defines the potential type to check
   * @returns true if block is a descendant
   */
  isAnAncestorOfType(e) {
    if (this.getClassName() === e)
      return !0;
    for (const t of this.endpoints)
      if (t.isAnAncestorOfType(e))
        return !0;
    return !1;
  }
  /**
   * Checks if the current block is an ancestor of a given block
   * @param block defines the potential descendant block to check
   * @returns true if block is a descendant
   */
  isAnAncestorOf(e) {
    for (const t of this.endpoints)
      if (t === e || t.isAnAncestorOf(e))
        return !0;
    return !1;
  }
  /**
   * Get the first descendant using a predicate
   * @param predicate defines the predicate to check
   * @returns descendant or null if none found
   */
  getDescendantOfPredicate(e) {
    if (e(this))
      return this;
    for (const t of this.endpoints) {
      const r = t.getDescendantOfPredicate(e);
      if (r)
        return r;
    }
    return null;
  }
  /**
   * Add an enpoint to this block
   * @param endpoint define the endpoint to attach to
   */
  attachToEndpoint(e) {
    e.detach(), this._endpoints.push(e), e._entryPoint = this, e._outputs[0]._typeConnectionSource = this._inputs[0], e._tempEntryPointUniqueId = null, e.name = "> " + this.name;
  }
  /**
   * Remove enpoint from this block
   * @param endpoint define the endpoint to remove
   */
  detachFromEndpoint(e) {
    const t = this._endpoints.indexOf(e);
    t !== -1 && (this._endpoints.splice(t, 1), e._outputs[0]._typeConnectionSource = null, e._entryPoint = null);
  }
  _buildBlock() {
    for (const e of this._endpoints)
      e.output._storedFunction = (t) => this.input.getConnectedValue(t);
  }
}
Ue("BABYLON.TeleportInBlock", Fne);
class Nne extends yi {
  /**
   * Create a new TeleportOutBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this._entryPoint = null, this._tempEntryPointUniqueId = null, this._isTeleportOut = !0, this.registerOutput("output", Me.BasedOnInput);
  }
  /**
   * Gets the entry point
   */
  get entryPoint() {
    return this._entryPoint;
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "TeleportOutBlock";
  }
  /**
   * Gets the output component
   */
  get output() {
    return this._outputs[0];
  }
  /** Detach from entry point */
  detach() {
    this._entryPoint && this._entryPoint.detachFromEndpoint(this);
  }
  _buildBlock() {
  }
  _customBuildStep(e) {
    this.entryPoint && this.entryPoint.build(e);
  }
  _dumpCode(e, t) {
    let r = "";
    return this.entryPoint && t.indexOf(this.entryPoint) === -1 && (r += this.entryPoint._dumpCode(e, t)), r + super._dumpCode(e, t);
  }
  _dumpCodeForOutputConnections(e) {
    let t = super._dumpCodeForOutputConnections(e);
    return this.entryPoint && (t += this.entryPoint._dumpCodeForOutputConnections(e)), t;
  }
  /**
   * Clone the current block to a new identical block
   * @returns a copy of the current block
   */
  clone() {
    const e = super.clone();
    return this.entryPoint && this.entryPoint.attachToEndpoint(e), e;
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode();
    return this.entryPoint && (e += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});
`), e;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    var e, t;
    const r = super.serialize();
    return r.entryPoint = (t = (e = this.entryPoint) === null || e === void 0 ? void 0 : e.uniqueId) !== null && t !== void 0 ? t : "", r;
  }
  _deserialize(e) {
    super._deserialize(e), this._tempEntryPointUniqueId = e.entryPoint;
  }
}
Ue("BABYLON.TeleportOutBlock", Nne);
class CY extends yi {
  /**
   * Gets the texture data
   */
  get textureData() {
    return this._data;
  }
  /**
   * Gets the texture width
   */
  get textureWidth() {
    return this._width;
  }
  /**
   * Gets the texture height
   */
  get textureHeight() {
    return this._height;
  }
  /**
   * Creates a new GeometryTextureBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this._data = null, this.serializedCachedData = !1, this.registerOutput("texture", Me.Texture);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GeometryTextureBlock";
  }
  /**
   * Gets the texture component
   */
  get texture() {
    return this._outputs[0];
  }
  _prepareImgToLoadAsync(e) {
    return new Promise((t, r) => {
      const n = new Image(), i = document.createElement("canvas"), s = i.getContext("2d");
      n.onload = () => {
        i.width = n.width, i.height = n.height, s.drawImage(n, 0, 0);
        const f = s.getImageData(0, 0, n.width, n.height).data, o = new Float32Array(f.length);
        for (let d = 0; d < f.length; d++)
          o[d] = f[d] / 255;
        this._data = o, this._width = n.width, this._height = n.height, t();
      }, n.onerror = () => {
        this._data = null, r();
      }, n.src = e;
    });
  }
  /**
   * Remove stored data
   */
  cleanData() {
    this._data = null;
  }
  /**
   * Load the texture data
   * @param imageFile defines the file to load data from
   * @returns a promise fulfilled when image data is loaded
   */
  loadTextureFromFileAsync(e) {
    return this._prepareImgToLoadAsync(URL.createObjectURL(e));
  }
  /**
   * Load the texture data
   * @param url defines the url to load data from
   * @returns a promise fulfilled when image data is loaded
   */
  loadTextureFromUrlAsync(e) {
    return this._prepareImgToLoadAsync(e);
  }
  /**
   * Load the texture data
   * @param url defines the url to load data from
   * @returns a promise fulfilled when image data is loaded
   */
  extractFromTextureAsync(e) {
    return new Promise((t, r) => {
      if (!e.isReady()) {
        e.onLoadObservable.addOnce(() => this.extractFromTextureAsync(e).then(t).catch(r));
        return;
      }
      const n = e.getSize();
      Pte.GetTextureDataAsync(e, n.width, n.height).then(async (i) => {
        const s = new Float32Array(i.length);
        for (let a = 0; a < i.length; a++)
          s[a] = i[a] / 255;
        this._data = s, this._width = n.width, this._height = n.height, t();
      }).catch(r);
    });
  }
  _buildBlock() {
    if (!this._data) {
      this.texture._storedValue = null;
      return;
    }
    const e = {
      data: this._data,
      width: this._width,
      height: this._height
    };
    this.texture._storedValue = e;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.width = this._width, e.height = this._height, e.serializedCachedData = this.serializedCachedData, this._data && this.serializedCachedData && (e.data = Array.from(this._data)), e;
  }
  _deserialize(e) {
    super._deserialize(e), this._width = e.width, this._height = e.height, e.data ? (this._data = new Float32Array(e.data), this.serializedCachedData = !0) : this.serializedCachedData = !!e.serializedCachedData;
  }
}
C([
  rn("Serialize cached data", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], CY.prototype, "serializedCachedData", void 0);
Ue("BABYLON.GeometryTextureBlock", CY);
class OY extends yi {
  /**
   * Creates a new GeometryTextureFetchBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.clampCoordinates = !0, this.registerInput("texture", Me.Texture), this.registerInput("coordinates", Me.Vector2), this.registerOutput("rgba", Me.Vector4), this.registerOutput("rgb", Me.Vector3), this.registerOutput("r", Me.Float), this.registerOutput("g", Me.Float), this.registerOutput("b", Me.Float), this.registerOutput("a", Me.Float);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "GeometryTextureFetchBlock";
  }
  /**
   * Gets the texture component
   */
  get texture() {
    return this.inputs[0];
  }
  /**
   * Gets the coordinates component
   */
  get coordinates() {
    return this.inputs[1];
  }
  /**
   * Gets the rgba component
   */
  get rgba() {
    return this._outputs[0];
  }
  /**
   * Gets the rgb component
   */
  get rgb() {
    return this._outputs[1];
  }
  /**
   * Gets the r component
   */
  get r() {
    return this._outputs[2];
  }
  /**
   * Gets the g component
   */
  get g() {
    return this._outputs[3];
  }
  /**
   * Gets the b component
   */
  get b() {
    return this._outputs[4];
  }
  /**
   * Gets the a component
   */
  get a() {
    return this._outputs[5];
  }
  _repeatClamp(e) {
    return e >= 0 ? e % 1 : 1 - Math.abs(e) % 1;
  }
  _buildBlock() {
    const e = (t) => {
      const r = this.texture.getConnectedValue(t);
      if (!r || !r.data)
        return null;
      const n = this.coordinates.getConnectedValue(t);
      if (!n)
        return null;
      const i = this.clampCoordinates ? Math.max(0, Math.min(n.x, 1)) : this._repeatClamp(n.x), s = this.clampCoordinates ? Math.max(0, Math.min(n.y, 1)) : this._repeatClamp(n.y), a = Math.floor(i * (r.width - 1)), f = Math.floor(s * (r.height - 1)), o = a + r.width * f;
      return Ir.FromArray(r.data, o * 4);
    };
    this.rgba._storedFunction = (t) => e(t), this.rgb._storedFunction = (t) => {
      const r = e(t);
      return r ? r.toVector3() : null;
    }, this.r._storedFunction = (t) => {
      const r = e(t);
      return r ? r.x : null;
    }, this.g._storedFunction = (t) => {
      const r = e(t);
      return r ? r.y : null;
    }, this.b._storedFunction = (t) => {
      const r = e(t);
      return r ? r.z : null;
    }, this.a._storedFunction = (t) => {
      const r = e(t);
      return r ? r.w : null;
    };
  }
  _dumpPropertiesCode() {
    return super._dumpPropertiesCode() + `${this._codeVariableName}.clampCoordinates = ${this.clampCoordinates};
`;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.clampCoordinates = this.clampCoordinates, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.clampCoordinates = e.clampCoordinates;
  }
}
C([
  rn("Clamp Coordinates", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], OY.prototype, "clampCoordinates", void 0);
Ue("BABYLON.GeometryTextureFetchBlock", OY);
class Qne extends yi {
  /**
   * Create a new BoundingBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.registerInput("geometry", Me.Geometry), this.registerOutput("min", Me.Vector3), this.registerOutput("max", Me.Vector3);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "BoundingBlock";
  }
  /**
   * Gets the geometry input component
   */
  get geometry() {
    return this._inputs[0];
  }
  /**
   * Gets the min output component
   */
  get min() {
    return this._outputs[0];
  }
  /**
   * Gets the max output component
   */
  get max() {
    return this._outputs[1];
  }
  _buildBlock() {
    this.min._storedFunction = (e) => {
      const t = this.geometry.getConnectedValue(e);
      return t ? WS(t.positions, 0, t.positions.length / 3).minimum : null;
    }, this.max._storedFunction = (e) => {
      const t = this.geometry.getConnectedValue(e);
      return t ? WS(t.positions, 0, t.positions.length / 3).maximum : null;
    };
  }
}
Ue("BABYLON.BoundingBlock", Qne);
var ZH;
(function(A) {
  A[A.Intersect = 0] = "Intersect", A[A.Subtract = 1] = "Subtract", A[A.Union = 2] = "Union";
})(ZH || (ZH = {}));
class Dy extends yi {
  /**
   * Create a new BooleanGeometryBlock
   * @param name defines the block name
   */
  constructor(e) {
    super(e), this.evaluateContext = !1, this.operation = ZH.Intersect, this.registerInput("geometry0", Me.Geometry), this.registerInput("geometry1", Me.Geometry), this.registerOutput("output", Me.Geometry);
  }
  /**
   * Gets the current class name
   * @returns the class name
   */
  getClassName() {
    return "BooleanGeometryBlock";
  }
  /**
   * Gets the geometry0 input component
   */
  get geometry0() {
    return this._inputs[0];
  }
  /**
   * Gets the geometry1 input component
   */
  get geometry1() {
    return this._inputs[1];
  }
  /**
   * Gets the geometry output component
   */
  get output() {
    return this._outputs[0];
  }
  _buildBlock(e) {
    const t = (r) => {
      const n = this.geometry0.getConnectedValue(r), i = this.geometry1.getConnectedValue(r);
      if (!n || !i)
        return null;
      const s = n.positions.length / 3;
      !n.normals && i.normals && (n.normals = new Array(n.positions.length)), !i.normals && n.normals && (i.normals = new Array(i.positions.length)), !n.uvs && i.uvs && (n.uvs = new Array(s * 2)), !i.uvs && n.uvs && (i.uvs = new Array(s * 2)), !n.colors && i.colors && (n.colors = new Array(s * 4)), !i.colors && n.colors && (i.colors = new Array(s * 4));
      const a = YH.FromVertexData(n), f = YH.FromVertexData(i);
      let o;
      switch (this.operation) {
        case ZH.Intersect:
          o = a.intersect(f);
          break;
        case ZH.Subtract:
          o = a.subtract(f);
          break;
        case ZH.Union:
          o = a.union(f);
          break;
      }
      return o.toVertexData();
    };
    this.evaluateContext ? this.output._storedFunction = t : (this.output._storedFunction = null, this.output._storedValue = t(e));
  }
  _dumpPropertiesCode() {
    let e = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};
`;
    return e += `${this._codeVariableName}.operation = BABYLON.BooleanGeometryOperations.${ZH[this.operation]};
`, e;
  }
  /**
   * Serializes this block in a JSON representation
   * @returns the serialized block object
   */
  serialize() {
    const e = super.serialize();
    return e.evaluateContext = this.evaluateContext, e.operation = this.operation, e;
  }
  _deserialize(e) {
    super._deserialize(e), this.evaluateContext = e.evaluateContext, e.operation && (this.operation = e.operation);
  }
}
C([
  rn("Evaluate context", Gr.Boolean, "ADVANCED", { notifiers: { rebuild: !0 } })
], Dy.prototype, "evaluateContext", void 0);
C([
  rn("Operation", Gr.List, "ADVANCED", {
    notifiers: { rebuild: !0 },
    options: [
      { label: "Intersect", value: ZH.Intersect },
      { label: "Subtract", value: ZH.Subtract },
      { label: "Union", value: ZH.Union }
    ]
  })
], Dy.prototype, "operation", void 0);
Ue("BABYLON.BooleanGeometryBlock", Dy);
class Bhe {
  /**
   * Initializes the recastJS plugin
   * @param recastInjection can be used to inject your own recast reference
   */
  constructor(e = Recast) {
    if (this.bjsRECAST = {}, this.name = "RecastJSPlugin", this._maximumSubStepCount = 10, this._timeStep = 1 / 60, this._timeFactor = 1, this._worker = null, typeof e == "function" ? Se.Error("RecastJS is not ready. Please make sure you await Recast() before using the plugin.") : this.bjsRECAST = e, !this.isSupported()) {
      Se.Error("RecastJS is not available. Please make sure you included the js file.");
      return;
    }
    this.setTimeStep(), this._tempVec1 = new this.bjsRECAST.Vec3(), this._tempVec2 = new this.bjsRECAST.Vec3();
  }
  /**
   * Set worker URL to be used when generating a new navmesh
   * @param workerURL url string
   * @returns boolean indicating if worker is created
   */
  setWorkerURL(e) {
    return window && window.Worker ? (this._worker = new Worker(e), !0) : !1;
  }
  /**
   * Set the time step of the navigation tick update.
   * Default is 1/60.
   * A value of 0 will disable fixed time update
   * @param newTimeStep the new timestep to apply to this world.
   */
  setTimeStep(e = 1 / 60) {
    this._timeStep = e;
  }
  /**
   * Get the time step of the navigation tick update.
   * @returns the current time step
   */
  getTimeStep() {
    return this._timeStep;
  }
  /**
   * If delta time in navigation tick update is greater than the time step
   * a number of sub iterations are done. If more iterations are need to reach deltatime
   * they will be discarded.
   * A value of 0 will set to no maximum and update will use as many substeps as needed
   * @param newStepCount the maximum number of iterations
   */
  setMaximumSubStepCount(e = 10) {
    this._maximumSubStepCount = e;
  }
  /**
   * Get the maximum number of iterations per navigation tick update
   * @returns the maximum number of iterations
   */
  getMaximumSubStepCount() {
    return this._maximumSubStepCount;
  }
  /**
   * Time factor applied when updating crowd agents (default 1). A value of 0 will pause crowd updates.
   * @param value the time factor applied at update
   */
  set timeFactor(e) {
    this._timeFactor = Math.max(e, 0);
  }
  /**
   * Get the time factor used for crowd agent update
   * @returns the time factor
   */
  get timeFactor() {
    return this._timeFactor;
  }
  /**
   * Creates a navigation mesh
   * @param meshes array of all the geometry used to compute the navigation mesh
   * @param parameters bunch of parameters used to filter geometry
   * @param completion callback when data is available from the worker. Not used without a worker
   */
  createNavMesh(e, t, r) {
    this._worker && !r ? console.warn("A worker is avaible but no completion callback. Defaulting to blocking navmesh creation") : !this._worker && r && console.warn("A completion callback is avaible but no worker. Defaulting to blocking navmesh creation"), this.navMesh = new this.bjsRECAST.NavMesh();
    let n, i, s;
    const a = [], f = [];
    let o = 0;
    for (n = 0; n < e.length; n++)
      if (e[n]) {
        const d = e[n], v = d.getIndices();
        if (!v)
          continue;
        const u = d.getVerticesData(J.PositionKind, !1, !1);
        if (!u)
          continue;
        const l = [], P = d.computeWorldMatrix(!0);
        if (d.hasThinInstances) {
          const p = d.thinInstanceGetWorldMatrices();
          for (let c = 0; c < p.length; c++) {
            const H = new he();
            p[c].multiplyToRef(P, H), l.push(H);
          }
        } else
          l.push(P);
        for (let p = 0; p < l.length; p++) {
          const c = l[p];
          for (i = 0; i < v.length; i++)
            a.push(v[i] + o);
          const H = S.Zero(), T = S.Zero();
          for (s = 0; s < u.length; s += 3)
            S.FromArrayToRef(u, s, T), S.TransformCoordinatesToRef(T, c, H), f.push(H.x, H.y, H.z);
          o += u.length / 3;
        }
      }
    if (this._worker && r)
      this._worker.postMessage([f, o, a, a.length, t]), this._worker.onmessage = function(d) {
        r(d.data);
      };
    else {
      const d = new this.bjsRECAST.rcConfig();
      d.cs = t.cs, d.ch = t.ch, d.borderSize = t.borderSize ? t.borderSize : 0, d.tileSize = t.tileSize ? t.tileSize : 0, d.walkableSlopeAngle = t.walkableSlopeAngle, d.walkableHeight = t.walkableHeight, d.walkableClimb = t.walkableClimb, d.walkableRadius = t.walkableRadius, d.maxEdgeLen = t.maxEdgeLen, d.maxSimplificationError = t.maxSimplificationError, d.minRegionArea = t.minRegionArea, d.mergeRegionArea = t.mergeRegionArea, d.maxVertsPerPoly = t.maxVertsPerPoly, d.detailSampleDist = t.detailSampleDist, d.detailSampleMaxError = t.detailSampleMaxError, this.navMesh.build(f, o, a, a.length, d);
    }
  }
  /**
   * Create a navigation mesh debug mesh
   * @param scene is where the mesh will be added
   * @returns debug display mesh
   */
  createDebugNavMesh(e) {
    let t, r;
    const n = this.navMesh.getDebugNavMesh(), i = n.getTriangleCount(), s = [], a = [];
    for (t = 0; t < i * 3; t++)
      s.push(t);
    for (t = 0; t < i; t++)
      for (r = 0; r < 3; r++) {
        const d = n.getTriangle(t).getPoint(r);
        a.push(d.x, d.y, d.z);
      }
    const f = new Ee("NavMeshDebug", e), o = new Ut();
    return o.indices = s, o.positions = a, o.applyToMesh(f, !1), f;
  }
  /**
   * Get a navigation mesh constrained position, closest to the parameter position
   * @param position world position
   * @returns the closest point to position constrained by the navigation mesh
   */
  getClosestPoint(e) {
    this._tempVec1.x = e.x, this._tempVec1.y = e.y, this._tempVec1.z = e.z;
    const t = this.navMesh.getClosestPoint(this._tempVec1);
    return new S(t.x, t.y, t.z);
  }
  /**
   * Get a navigation mesh constrained position, closest to the parameter position
   * @param position world position
   * @param result output the closest point to position constrained by the navigation mesh
   */
  getClosestPointToRef(e, t) {
    this._tempVec1.x = e.x, this._tempVec1.y = e.y, this._tempVec1.z = e.z;
    const r = this.navMesh.getClosestPoint(this._tempVec1);
    t.set(r.x, r.y, r.z);
  }
  /**
   * Get a navigation mesh constrained position, within a particular radius
   * @param position world position
   * @param maxRadius the maximum distance to the constrained world position
   * @returns the closest point to position constrained by the navigation mesh
   */
  getRandomPointAround(e, t) {
    this._tempVec1.x = e.x, this._tempVec1.y = e.y, this._tempVec1.z = e.z;
    const r = this.navMesh.getRandomPointAround(this._tempVec1, t);
    return new S(r.x, r.y, r.z);
  }
  /**
   * Get a navigation mesh constrained position, within a particular radius
   * @param position world position
   * @param maxRadius the maximum distance to the constrained world position
   * @param result output the closest point to position constrained by the navigation mesh
   */
  getRandomPointAroundToRef(e, t, r) {
    this._tempVec1.x = e.x, this._tempVec1.y = e.y, this._tempVec1.z = e.z;
    const n = this.navMesh.getRandomPointAround(this._tempVec1, t);
    r.set(n.x, n.y, n.z);
  }
  /**
   * Compute the final position from a segment made of destination-position
   * @param position world position
   * @param destination world position
   * @returns the resulting point along the navmesh
   */
  moveAlong(e, t) {
    this._tempVec1.x = e.x, this._tempVec1.y = e.y, this._tempVec1.z = e.z, this._tempVec2.x = t.x, this._tempVec2.y = t.y, this._tempVec2.z = t.z;
    const r = this.navMesh.moveAlong(this._tempVec1, this._tempVec2);
    return new S(r.x, r.y, r.z);
  }
  /**
   * Compute the final position from a segment made of destination-position
   * @param position world position
   * @param destination world position
   * @param result output the resulting point along the navmesh
   */
  moveAlongToRef(e, t, r) {
    this._tempVec1.x = e.x, this._tempVec1.y = e.y, this._tempVec1.z = e.z, this._tempVec2.x = t.x, this._tempVec2.y = t.y, this._tempVec2.z = t.z;
    const n = this.navMesh.moveAlong(this._tempVec1, this._tempVec2);
    r.set(n.x, n.y, n.z);
  }
  /**
   * Compute a navigation path from start to end. Returns an empty array if no path can be computed
   * @param start world position
   * @param end world position
   * @returns array containing world position composing the path
   */
  computePath(e, t) {
    let r;
    this._tempVec1.x = e.x, this._tempVec1.y = e.y, this._tempVec1.z = e.z, this._tempVec2.x = t.x, this._tempVec2.y = t.y, this._tempVec2.z = t.z;
    const n = this.navMesh.computePath(this._tempVec1, this._tempVec2), i = n.getPointCount(), s = [];
    for (r = 0; r < i; r++) {
      const a = n.getPoint(r);
      s.push(new S(a.x, a.y, a.z));
    }
    return s;
  }
  /**
   * Create a new Crowd so you can add agents
   * @param maxAgents the maximum agent count in the crowd
   * @param maxAgentRadius the maximum radius an agent can have
   * @param scene to attach the crowd to
   * @returns the crowd you can add agents to
   */
  createCrowd(e, t, r) {
    return new Yne(this, e, t, r);
  }
  /**
   * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)
   * The queries will try to find a solution within those bounds
   * default is (1,1,1)
   * @param extent x,y,z value that define the extent around the queries point of reference
   */
  setDefaultQueryExtent(e) {
    this._tempVec1.x = e.x, this._tempVec1.y = e.y, this._tempVec1.z = e.z, this.navMesh.setDefaultQueryExtent(this._tempVec1);
  }
  /**
   * Get the Bounding box extent specified by setDefaultQueryExtent
   * @returns the box extent values
   */
  getDefaultQueryExtent() {
    const e = this.navMesh.getDefaultQueryExtent();
    return new S(e.x, e.y, e.z);
  }
  /**
   * build the navmesh from a previously saved state using getNavmeshData
   * @param data the Uint8Array returned by getNavmeshData
   */
  buildFromNavmeshData(e) {
    const t = e.length * e.BYTES_PER_ELEMENT, r = this.bjsRECAST._malloc(t), n = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, r, t);
    n.set(e);
    const i = new this.bjsRECAST.NavmeshData();
    i.dataPointer = n.byteOffset, i.size = e.length, this.navMesh = new this.bjsRECAST.NavMesh(), this.navMesh.buildFromNavmeshData(i), this.bjsRECAST._free(n.byteOffset);
  }
  /**
   * returns the navmesh data that can be used later. The navmesh must be built before retrieving the data
   * @returns data the Uint8Array that can be saved and reused
   */
  getNavmeshData() {
    const e = this.navMesh.getNavmeshData(), t = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, e.dataPointer, e.size), r = new Uint8Array(e.size);
    return r.set(t), this.navMesh.freeNavmeshData(e), r;
  }
  /**
   * Get the Bounding box extent result specified by setDefaultQueryExtent
   * @param result output the box extent values
   */
  getDefaultQueryExtentToRef(e) {
    const t = this.navMesh.getDefaultQueryExtent();
    e.set(t.x, t.y, t.z);
  }
  /**
   * Disposes
   */
  dispose() {
  }
  /**
   * Creates a cylinder obstacle and add it to the navigation
   * @param position world position
   * @param radius cylinder radius
   * @param height cylinder height
   * @returns the obstacle freshly created
   */
  addCylinderObstacle(e, t, r) {
    return this._tempVec1.x = e.x, this._tempVec1.y = e.y, this._tempVec1.z = e.z, this.navMesh.addCylinderObstacle(this._tempVec1, t, r);
  }
  /**
   * Creates an oriented box obstacle and add it to the navigation
   * @param position world position
   * @param extent box size
   * @param angle angle in radians of the box orientation on Y axis
   * @returns the obstacle freshly created
   */
  addBoxObstacle(e, t, r) {
    return this._tempVec1.x = e.x, this._tempVec1.y = e.y, this._tempVec1.z = e.z, this._tempVec2.x = t.x, this._tempVec2.y = t.y, this._tempVec2.z = t.z, this.navMesh.addBoxObstacle(this._tempVec1, this._tempVec2, r);
  }
  /**
   * Removes an obstacle created by addCylinderObstacle or addBoxObstacle
   * @param obstacle obstacle to remove from the navigation
   */
  removeObstacle(e) {
    this.navMesh.removeObstacle(e);
  }
  /**
   * If this plugin is supported
   * @returns true if plugin is supported
   */
  isSupported() {
    return this.bjsRECAST !== void 0;
  }
}
class Yne {
  /**
   * Constructor
   * @param plugin recastJS plugin
   * @param maxAgents the maximum agent count in the crowd
   * @param maxAgentRadius the maximum radius an agent can have
   * @param scene to attach the crowd to
   * @returns the crowd you can add agents to
   */
  constructor(e, t, r, n) {
    this.recastCrowd = {}, this.transforms = new Array(), this.agents = new Array(), this.reachRadii = new Array(), this._agentDestinationArmed = new Array(), this._agentDestination = new Array(), this._onBeforeAnimationsObserver = null, this.onReachTargetObservable = new Oe(), this.bjsRECASTPlugin = e, this.recastCrowd = new this.bjsRECASTPlugin.bjsRECAST.Crowd(t, r, this.bjsRECASTPlugin.navMesh.getNavMesh()), this._scene = n, this._onBeforeAnimationsObserver = n.onBeforeAnimationsObservable.add(() => {
      this.update(n.getEngine().getDeltaTime() * 1e-3 * e.timeFactor);
    });
  }
  /**
   * Add a new agent to the crowd with the specified parameter a corresponding transformNode.
   * You can attach anything to that node. The node position is updated in the scene update tick.
   * @param pos world position that will be constrained by the navigation mesh
   * @param parameters agent parameters
   * @param transform hooked to the agent that will be update by the scene
   * @returns agent index
   */
  addAgent(e, t, r) {
    const n = new this.bjsRECASTPlugin.bjsRECAST.dtCrowdAgentParams();
    n.radius = t.radius, n.height = t.height, n.maxAcceleration = t.maxAcceleration, n.maxSpeed = t.maxSpeed, n.collisionQueryRange = t.collisionQueryRange, n.pathOptimizationRange = t.pathOptimizationRange, n.separationWeight = t.separationWeight, n.updateFlags = 7, n.obstacleAvoidanceType = 0, n.queryFilterType = 0, n.userData = 0;
    const i = this.recastCrowd.addAgent(new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x, e.y, e.z), n);
    return this.transforms.push(r), this.agents.push(i), this.reachRadii.push(t.reachRadius ? t.reachRadius : t.radius), this._agentDestinationArmed.push(!1), this._agentDestination.push(new S(0, 0, 0)), i;
  }
  /**
   * Returns the agent position in world space
   * @param index agent index returned by addAgent
   * @returns world space position
   */
  getAgentPosition(e) {
    const t = this.recastCrowd.getAgentPosition(e);
    return new S(t.x, t.y, t.z);
  }
  /**
   * Returns the agent position result in world space
   * @param index agent index returned by addAgent
   * @param result output world space position
   */
  getAgentPositionToRef(e, t) {
    const r = this.recastCrowd.getAgentPosition(e);
    t.set(r.x, r.y, r.z);
  }
  /**
   * Returns the agent velocity in world space
   * @param index agent index returned by addAgent
   * @returns world space velocity
   */
  getAgentVelocity(e) {
    const t = this.recastCrowd.getAgentVelocity(e);
    return new S(t.x, t.y, t.z);
  }
  /**
   * Returns the agent velocity result in world space
   * @param index agent index returned by addAgent
   * @param result output world space velocity
   */
  getAgentVelocityToRef(e, t) {
    const r = this.recastCrowd.getAgentVelocity(e);
    t.set(r.x, r.y, r.z);
  }
  /**
   * Returns the agent next target point on the path
   * @param index agent index returned by addAgent
   * @returns world space position
   */
  getAgentNextTargetPath(e) {
    const t = this.recastCrowd.getAgentNextTargetPath(e);
    return new S(t.x, t.y, t.z);
  }
  /**
   * Returns the agent next target point on the path
   * @param index agent index returned by addAgent
   * @param result output world space position
   */
  getAgentNextTargetPathToRef(e, t) {
    const r = this.recastCrowd.getAgentNextTargetPath(e);
    t.set(r.x, r.y, r.z);
  }
  /**
   * Gets the agent state
   * @param index agent index returned by addAgent
   * @returns agent state
   */
  getAgentState(e) {
    return this.recastCrowd.getAgentState(e);
  }
  /**
   * returns true if the agent in over an off mesh link connection
   * @param index agent index returned by addAgent
   * @returns true if over an off mesh link connection
   */
  overOffmeshConnection(e) {
    return this.recastCrowd.overOffmeshConnection(e);
  }
  /**
   * Asks a particular agent to go to a destination. That destination is constrained by the navigation mesh
   * @param index agent index returned by addAgent
   * @param destination targeted world position
   */
  agentGoto(e, t) {
    this.recastCrowd.agentGoto(e, new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x, t.y, t.z));
    const r = this.agents.indexOf(e);
    r > -1 && (this._agentDestinationArmed[r] = !0, this._agentDestination[r].set(t.x, t.y, t.z));
  }
  /**
   * Teleport the agent to a new position
   * @param index agent index returned by addAgent
   * @param destination targeted world position
   */
  agentTeleport(e, t) {
    this.recastCrowd.agentTeleport(e, new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x, t.y, t.z));
  }
  /**
   * Update agent parameters
   * @param index agent index returned by addAgent
   * @param parameters agent parameters
   */
  updateAgentParameters(e, t) {
    const r = this.recastCrowd.getAgentParameters(e);
    t.radius !== void 0 && (r.radius = t.radius), t.height !== void 0 && (r.height = t.height), t.maxAcceleration !== void 0 && (r.maxAcceleration = t.maxAcceleration), t.maxSpeed !== void 0 && (r.maxSpeed = t.maxSpeed), t.collisionQueryRange !== void 0 && (r.collisionQueryRange = t.collisionQueryRange), t.pathOptimizationRange !== void 0 && (r.pathOptimizationRange = t.pathOptimizationRange), t.separationWeight !== void 0 && (r.separationWeight = t.separationWeight), this.recastCrowd.setAgentParameters(e, r);
  }
  /**
   * remove a particular agent previously created
   * @param index agent index returned by addAgent
   */
  removeAgent(e) {
    this.recastCrowd.removeAgent(e);
    const t = this.agents.indexOf(e);
    t > -1 && (this.agents.splice(t, 1), this.transforms.splice(t, 1), this.reachRadii.splice(t, 1), this._agentDestinationArmed.splice(t, 1), this._agentDestination.splice(t, 1));
  }
  /**
   * get the list of all agents attached to this crowd
   * @returns list of agent indices
   */
  getAgents() {
    return this.agents;
  }
  /**
   * Tick update done by the Scene. Agent position/velocity/acceleration is updated by this function
   * @param deltaTime in seconds
   */
  update(e) {
    if (this.bjsRECASTPlugin.navMesh.update(), e <= Dn)
      return;
    const t = this.bjsRECASTPlugin.getTimeStep(), r = this.bjsRECASTPlugin.getMaximumSubStepCount();
    if (t <= Dn)
      this.recastCrowd.update(e);
    else {
      let n = Math.floor(e / t);
      r && n > r && (n = r), n < 1 && (n = 1);
      const i = e / n;
      for (let s = 0; s < n; s++)
        this.recastCrowd.update(i);
    }
    for (let n = 0; n < this.agents.length; n++) {
      const i = this.agents[n], s = this.getAgentPosition(i);
      if (this.transforms[n].position = s, this._agentDestinationArmed[n]) {
        const a = s.x - this._agentDestination[n].x, f = s.z - this._agentDestination[n].z, o = this.reachRadii[n], d = this._agentDestination[n].y - this.reachRadii[n], v = this._agentDestination[n].y + this.reachRadii[n], u = a * a + f * f;
        s.y > d && s.y < v && u < o * o && (this.onReachTargetObservable.notifyObservers({ agentIndex: i, destination: this._agentDestination[n] }), this._agentDestinationArmed[n] = !1);
      }
    }
  }
  /**
   * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)
   * The queries will try to find a solution within those bounds
   * default is (1,1,1)
   * @param extent x,y,z value that define the extent around the queries point of reference
   */
  setDefaultQueryExtent(e) {
    const t = new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x, e.y, e.z);
    this.recastCrowd.setDefaultQueryExtent(t);
  }
  /**
   * Get the Bounding box extent specified by setDefaultQueryExtent
   * @returns the box extent values
   */
  getDefaultQueryExtent() {
    const e = this.recastCrowd.getDefaultQueryExtent();
    return new S(e.x, e.y, e.z);
  }
  /**
   * Get the Bounding box extent result specified by setDefaultQueryExtent
   * @param result output the box extent values
   */
  getDefaultQueryExtentToRef(e) {
    const t = this.recastCrowd.getDefaultQueryExtent();
    e.set(t.x, t.y, t.z);
  }
  /**
   * Get the next corner points composing the path (max 4 points)
   * @param index agent index returned by addAgent
   * @returns array containing world position composing the path
   */
  getCorners(e) {
    let t;
    const r = this.recastCrowd.getCorners(e), n = r.getPointCount(), i = [];
    for (t = 0; t < n; t++) {
      const s = r.getPoint(t);
      i.push(new S(s.x, s.y, s.z));
    }
    return i;
  }
  /**
   * Release all resources
   */
  dispose() {
    this.recastCrowd.destroy(), this._scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver), this._onBeforeAnimationsObserver = null, this.onReachTargetObservable.clear();
  }
}
Ge.OfflineProviderFactory = (A, e, t = !1) => new Cv(A, e, t);
class Cv {
  /**
   * Gets a boolean indicating if scene must be saved in the database
   */
  get enableSceneOffline() {
    return this._enableSceneOffline;
  }
  /**
   * Gets a boolean indicating if textures must be saved in the database
   */
  get enableTexturesOffline() {
    return this._enableTexturesOffline;
  }
  /**
   * Creates a new Database
   * @param urlToScene defines the url to load the scene
   * @param callbackManifestChecked defines the callback to use when manifest is checked
   * @param disableManifestCheck defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)
   */
  constructor(e, t, r = !1) {
    this._idbFactory = typeof indexedDB < "u" ? indexedDB : void 0, this._currentSceneUrl = Cv._ReturnFullUrlLocation(e), this._db = null, this._enableSceneOffline = !1, this._enableTexturesOffline = !1, this._manifestVersionFound = 0, this._mustUpdateRessources = !1, this._hasReachedQuota = !1, Cv.IDBStorageEnabled ? r ? (this._enableSceneOffline = !0, this._enableTexturesOffline = !0, this._manifestVersionFound = 1, ye.SetImmediate(() => {
      t(!0);
    })) : this._checkManifestFile(t) : t(!0);
  }
  _checkManifestFile(e) {
    const t = () => {
      this._enableSceneOffline = !1, this._enableTexturesOffline = !1, e(!1);
    }, r = () => {
      try {
        if (typeof URL == "function" && this._currentSceneUrl.indexOf("http") === 0) {
          const a = new URL(this._currentSceneUrl);
          return a.pathname += ".manifest", a.toString();
        }
      } catch {
      }
      return `${this._currentSceneUrl}.manifest`;
    };
    let n = !1, i = r();
    const s = new ho();
    navigator.onLine && (n = !0, i = i + (i.match(/\?/) == null ? "?" : "&") + Date.now()), s.open("GET", i), s.addEventListener("load", () => {
      if (s.status === 200 || Cv._ValidateXHRData(s, 1))
        try {
          const a = JSON.parse(s.response);
          this._enableSceneOffline = a.enableSceneOffline, this._enableTexturesOffline = a.enableTexturesOffline && Cv._IsUASupportingBlobStorage, a.version && !isNaN(parseInt(a.version)) && (this._manifestVersionFound = a.version), e(!0);
        } catch {
          t();
        }
      else
        t();
    }, !1), s.addEventListener("error", () => {
      if (n) {
        n = !1;
        const a = r();
        s.open("GET", a), s.send();
      } else
        t();
    }, !1);
    try {
      s.send();
    } catch {
      Se.Error("Error on XHR send request."), e(!1);
    }
  }
  /**
   * Open the database and make it available
   * @param successCallback defines the callback to call on success
   * @param errorCallback defines the callback to call on error
   */
  open(e, t) {
    const r = () => {
      this._isSupported = !1, t && t();
    };
    if (!this._idbFactory || !(this._enableSceneOffline || this._enableTexturesOffline))
      this._isSupported = !1, t && t();
    else if (this._db)
      e && e();
    else {
      this._hasReachedQuota = !1, this._isSupported = !0;
      const n = this._idbFactory.open("babylonjs", 1);
      n.onerror = () => {
        r();
      }, n.onblocked = () => {
        Se.Error("IDB request blocked. Please reload the page."), r();
      }, n.onsuccess = () => {
        this._db = n.result, e();
      }, n.onupgradeneeded = (i) => {
        if (this._db = i.target.result, this._db)
          try {
            this._db.createObjectStore("scenes", { keyPath: "sceneUrl" }), this._db.createObjectStore("versions", { keyPath: "sceneUrl" }), this._db.createObjectStore("textures", { keyPath: "textureUrl" });
          } catch (s) {
            Se.Error("Error while creating object stores. Exception: " + s.message), r();
          }
      };
    }
  }
  /**
   * Loads an image from the database
   * @param url defines the url to load from
   * @param image defines the target DOM image
   */
  loadImage(e, t) {
    const r = Cv._ReturnFullUrlLocation(e), n = () => {
      !this._hasReachedQuota && this._db !== null ? this._saveImageIntoDBAsync(r, t) : t.src = e;
    };
    this._mustUpdateRessources ? n() : this._loadImageFromDBAsync(r, t, n);
  }
  _loadImageFromDBAsync(e, t, r) {
    if (this._isSupported && this._db !== null) {
      let n;
      const i = this._db.transaction(["textures"]);
      i.onabort = () => {
        t.src = e;
      }, i.oncomplete = () => {
        let a;
        n && typeof URL == "function" ? (a = URL.createObjectURL(n.data), t.onerror = () => {
          Se.Error("Error loading image from blob URL: " + a + " switching back to web url: " + e), t.src = e;
        }, t.src = a) : r();
      };
      const s = i.objectStore("textures").get(e);
      s.onsuccess = (a) => {
        n = a.target.result;
      }, s.onerror = () => {
        Se.Error("Error loading texture " + e + " from DB."), t.src = e;
      };
    } else
      Se.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."), t.src = e;
  }
  _saveImageIntoDBAsync(e, t) {
    let r;
    if (this._isSupported) {
      const n = () => {
        let i;
        if (r && typeof URL == "function")
          try {
            i = URL.createObjectURL(r);
          } catch {
            i = URL.createObjectURL(r);
          }
        i && (t.src = i);
      };
      if (Cv._IsUASupportingBlobStorage) {
        const i = new ho();
        i.open("GET", e), i.responseType = "blob", i.addEventListener("load", () => {
          if (i.status === 200 && this._db) {
            r = i.response;
            const s = this._db.transaction(["textures"], "readwrite");
            s.onabort = (f) => {
              try {
                const d = f.target.error;
                d && d.name === "QuotaExceededError" && (this._hasReachedQuota = !0);
              } catch {
              }
              n();
            }, s.oncomplete = () => {
              n();
            };
            const a = { textureUrl: e, data: r };
            try {
              const f = s.objectStore("textures").put(a);
              f.onsuccess = () => {
              }, f.onerror = () => {
                n();
              };
            } catch (f) {
              f.code === 25 && (Cv._IsUASupportingBlobStorage = !1, this._enableTexturesOffline = !1), t.src = e;
            }
          } else
            t.src = e;
        }, !1), i.addEventListener("error", () => {
          Se.Error("Error in XHR request in BABYLON.Database."), t.src = e;
        }, !1), i.send();
      } else
        t.src = e;
    } else
      Se.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."), t.src = e;
  }
  _checkVersionFromDB(e, t) {
    const r = () => {
      this._saveVersionIntoDBAsync(e, t);
    };
    this._loadVersionFromDBAsync(e, t, r);
  }
  _loadVersionFromDBAsync(e, t, r) {
    if (this._isSupported && this._db) {
      let n;
      try {
        const i = this._db.transaction(["versions"]);
        i.oncomplete = () => {
          n ? this._manifestVersionFound !== n.data ? (this._mustUpdateRessources = !0, r()) : t(n.data) : (this._mustUpdateRessources = !0, r());
        }, i.onabort = () => {
          t(-1);
        };
        const s = i.objectStore("versions").get(e);
        s.onsuccess = (a) => {
          n = a.target.result;
        }, s.onerror = () => {
          Se.Error("Error loading version for scene " + e + " from DB."), t(-1);
        };
      } catch (i) {
        Se.Error("Error while accessing 'versions' object store (READ OP). Exception: " + i.message), t(-1);
      }
    } else
      Se.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."), t(-1);
  }
  _saveVersionIntoDBAsync(e, t) {
    if (this._isSupported && !this._hasReachedQuota && this._db)
      try {
        const r = this._db.transaction(["versions"], "readwrite");
        r.onabort = (s) => {
          try {
            const a = s.target.error;
            a && a.name === "QuotaExceededError" && (this._hasReachedQuota = !0);
          } catch {
          }
          t(-1);
        }, r.oncomplete = () => {
          t(this._manifestVersionFound);
        };
        const n = { sceneUrl: e, data: this._manifestVersionFound }, i = r.objectStore("versions").put(n);
        i.onsuccess = () => {
        }, i.onerror = () => {
          Se.Error("Error in DB add version request in BABYLON.Database.");
        };
      } catch (r) {
        Se.Error("Error while accessing 'versions' object store (WRITE OP). Exception: " + r.message), t(-1);
      }
    else
      t(-1);
  }
  /**
   * Loads a file from database
   * @param url defines the URL to load from
   * @param sceneLoaded defines a callback to call on success
   * @param progressCallBack defines a callback to call when progress changed
   * @param errorCallback defines a callback to call on error
   * @param useArrayBuffer defines a boolean to use array buffer instead of text string
   */
  loadFile(e, t, r, n, i) {
    const s = Cv._ReturnFullUrlLocation(e), a = () => {
      this._saveFileAsync(s, t, r, i, n);
    };
    this._checkVersionFromDB(s, (f) => {
      f !== -1 ? this._mustUpdateRessources ? this._saveFileAsync(s, t, r, i, n) : this._loadFileAsync(s, t, a) : n && n();
    });
  }
  _loadFileAsync(e, t, r) {
    if (this._isSupported && this._db) {
      let n;
      e.indexOf(".babylon") !== -1 ? n = "scenes" : n = "textures";
      let i;
      const s = this._db.transaction([n]);
      s.oncomplete = () => {
        i ? t(i.data) : r();
      }, s.onabort = () => {
        r();
      };
      const a = s.objectStore(n).get(e);
      a.onsuccess = (f) => {
        i = f.target.result;
      }, a.onerror = () => {
        Se.Error("Error loading file " + e + " from DB."), r();
      };
    } else
      Se.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."), t();
  }
  _saveFileAsync(e, t, r, n, i) {
    if (this._isSupported) {
      let s;
      e.indexOf(".babylon") !== -1 ? s = "scenes" : s = "textures";
      const a = new ho();
      let f;
      a.open("GET", e + (e.match(/\?/) == null ? "?" : "&") + Date.now()), n && (a.responseType = "arraybuffer"), r && (a.onprogress = r), a.addEventListener("load", () => {
        if (a.status === 200 || a.status < 400 && Cv._ValidateXHRData(a, n ? 6 : 1))
          if (f = n ? a.response : a.responseText, !this._hasReachedQuota && this._db) {
            const o = this._db.transaction([s], "readwrite");
            o.onabort = (v) => {
              try {
                const u = v.target.error;
                u && u.name === "QuotaExceededError" && (this._hasReachedQuota = !0);
              } catch {
              }
              t(f);
            }, o.oncomplete = () => {
              t(f);
            };
            let d;
            s === "scenes" ? d = { sceneUrl: e, data: f, version: this._manifestVersionFound } : d = { textureUrl: e, data: f };
            try {
              const v = o.objectStore(s).put(d);
              v.onsuccess = () => {
              }, v.onerror = () => {
                Se.Error("Error in DB add file request in BABYLON.Database.");
              };
            } catch {
              t(f);
            }
          } else
            t(f);
        else
          a.status >= 400 && i ? i(a) : t();
      }, !1), a.addEventListener("error", () => {
        Se.Error("error on XHR request."), i && i();
      }, !1), a.send();
    } else
      Se.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."), i && i();
  }
  /**
   * Validates if xhr data is correct
   * @param xhr defines the request to validate
   * @param dataType defines the expected data type
   * @returns true if data is correct
   */
  static _ValidateXHRData(e, t = 7) {
    try {
      if (t & 1) {
        if (e.responseText && e.responseText.length > 0)
          return !0;
        if (t === 1)
          return !1;
      }
      if (t & 2) {
        const r = sV(e.response);
        if (r.width && r.height && r.width > 0 && r.height > 0)
          return !0;
        if (t === 2)
          return !1;
      }
      if (t & 4) {
        const r = new Uint8Array(e.response, 0, 3);
        return r[0] === 68 && r[1] === 68 && r[2] === 83;
      }
    } catch {
    }
    return !1;
  }
}
Cv._IsUASupportingBlobStorage = !0;
Cv.IDBStorageEnabled = !1;
Cv._ParseURL = (A) => {
  const e = document.createElement("a");
  e.href = A;
  const t = A.substring(0, A.lastIndexOf("#")), r = A.substring(t.lastIndexOf("/") + 1, A.length);
  return A.substring(0, A.indexOf(r, 0));
};
Cv._ReturnFullUrlLocation = (A) => A.indexOf("http:/") === -1 && A.indexOf("https:/") === -1 && typeof window < "u" ? Cv._ParseURL(window.location.href) + A : A;
class Mne {
  _isUbo(e) {
    return e.addUniform !== void 0;
  }
  constructor(e) {
    this._isUbo(e) ? (this.setMatrix3x3 = e.updateMatrix3x3.bind(e), this.setMatrix2x2 = e.updateMatrix2x2.bind(e), this.setFloat = e.updateFloat.bind(e), this.setFloat2 = e.updateFloat2.bind(e), this.setFloat3 = e.updateFloat3.bind(e), this.setFloat4 = e.updateFloat4.bind(e), this.setFloatArray = e.updateFloatArray.bind(e), this.setArray = e.updateArray.bind(e), this.setIntArray = e.updateIntArray.bind(e), this.setMatrix = e.updateMatrix.bind(e), this.setMatrices = e.updateMatrices.bind(e), this.setVector3 = e.updateVector3.bind(e), this.setVector4 = e.updateVector4.bind(e), this.setColor3 = e.updateColor3.bind(e), this.setColor4 = e.updateColor4.bind(e), this.setDirectColor4 = e.updateDirectColor4.bind(e), this.setInt = e.updateInt.bind(e), this.setInt2 = e.updateInt2.bind(e), this.setInt3 = e.updateInt3.bind(e), this.setInt4 = e.updateInt4.bind(e)) : (this.setMatrix3x3 = e.setMatrix3x3.bind(e), this.setMatrix2x2 = e.setMatrix2x2.bind(e), this.setFloat = e.setFloat.bind(e), this.setFloat2 = e.setFloat2.bind(e), this.setFloat3 = e.setFloat3.bind(e), this.setFloat4 = e.setFloat4.bind(e), this.setFloatArray = e.setFloatArray.bind(e), this.setArray = e.setArray.bind(e), this.setIntArray = e.setIntArray.bind(e), this.setMatrix = e.setMatrix.bind(e), this.setMatrices = e.setMatrices.bind(e), this.setVector3 = e.setVector3.bind(e), this.setVector4 = e.setVector4.bind(e), this.setColor3 = e.setColor3.bind(e), this.setColor4 = e.setColor4.bind(e), this.setDirectColor4 = e.setDirectColor4.bind(e), this.setInt = e.setInt.bind(e), this.setInt2 = e.setInt2.bind(e), this.setInt3 = e.setInt3.bind(e), this.setInt4 = e.setInt4.bind(e));
  }
}
const Whe = "gpuUpdateParticlesPixelShader", She = `#version 300 es
void main() {discard;}
`;
Le.ShadersStore[Whe] = She;
const Uhe = "gpuUpdateParticlesVertexShader", Ihe = `#version 300 es
#define PI 3.14159
uniform float currentCount;uniform float timeDelta;uniform float stopFactor;
#ifndef LOCAL
uniform mat4 emitterWM;
#endif
uniform vec2 lifeTime;uniform vec2 emitPower;uniform vec2 sizeRange;uniform vec4 scaleRange;
#ifndef COLORGRADIENTS
uniform vec4 color1;uniform vec4 color2;
#endif
uniform vec3 gravity;uniform sampler2D randomSampler;uniform sampler2D randomSampler2;uniform vec4 angleRange;
#ifdef BOXEMITTER
uniform vec3 direction1;uniform vec3 direction2;uniform vec3 minEmitBox;uniform vec3 maxEmitBox;
#endif
#ifdef POINTEMITTER
uniform vec3 direction1;uniform vec3 direction2;
#endif
#ifdef HEMISPHERICEMITTER
uniform float radius;uniform float radiusRange;uniform float directionRandomizer;
#endif
#ifdef SPHEREEMITTER
uniform float radius;uniform float radiusRange;
#ifdef DIRECTEDSPHEREEMITTER
uniform vec3 direction1;uniform vec3 direction2;
#else
uniform float directionRandomizer;
#endif
#endif
#ifdef CYLINDEREMITTER
uniform float radius;uniform float height;uniform float radiusRange;
#ifdef DIRECTEDCYLINDEREMITTER
uniform vec3 direction1;uniform vec3 direction2;
#else
uniform float directionRandomizer;
#endif
#endif
#ifdef CONEEMITTER
uniform vec2 radius;uniform float coneAngle;uniform vec2 height;uniform float directionRandomizer;
#endif
in vec3 position;
#ifdef CUSTOMEMITTER
in vec3 initialPosition;
#endif
in float age;in float life;in vec4 seed;in vec3 size;
#ifndef COLORGRADIENTS
in vec4 color;
#endif
in vec3 direction;
#ifndef BILLBOARD
in vec3 initialDirection;
#endif
#ifdef ANGULARSPEEDGRADIENTS
in float angle;
#else
in vec2 angle;
#endif
#ifdef ANIMATESHEET
in float cellIndex;
#ifdef ANIMATESHEETRANDOMSTART
in float cellStartOffset;
#endif
#endif
#ifdef NOISE
in vec3 noiseCoordinates1;in vec3 noiseCoordinates2;
#endif
out vec3 outPosition;
#ifdef CUSTOMEMITTER
out vec3 outInitialPosition;
#endif
out float outAge;out float outLife;out vec4 outSeed;out vec3 outSize;
#ifndef COLORGRADIENTS
out vec4 outColor;
#endif
out vec3 outDirection;
#ifndef BILLBOARD
out vec3 outInitialDirection;
#endif
#ifdef ANGULARSPEEDGRADIENTS
out float outAngle;
#else
out vec2 outAngle;
#endif
#ifdef ANIMATESHEET
out float outCellIndex;
#ifdef ANIMATESHEETRANDOMSTART
out float outCellStartOffset;
#endif
#endif
#ifdef NOISE
out vec3 outNoiseCoordinates1;out vec3 outNoiseCoordinates2;
#endif
#ifdef SIZEGRADIENTS
uniform sampler2D sizeGradientSampler;
#endif 
#ifdef ANGULARSPEEDGRADIENTS
uniform sampler2D angularSpeedGradientSampler;
#endif 
#ifdef VELOCITYGRADIENTS
uniform sampler2D velocityGradientSampler;
#endif
#ifdef LIMITVELOCITYGRADIENTS
uniform sampler2D limitVelocityGradientSampler;uniform float limitVelocityDamping;
#endif
#ifdef DRAGGRADIENTS
uniform sampler2D dragGradientSampler;
#endif
#ifdef NOISE
uniform vec3 noiseStrength;uniform sampler2D noiseSampler;
#endif
#ifdef ANIMATESHEET
uniform vec4 cellInfos;
#endif
vec3 getRandomVec3(float offset) {return texture(randomSampler2,vec2(float(gl_VertexID)*offset/currentCount,0)).rgb;}
vec4 getRandomVec4(float offset) {return texture(randomSampler,vec2(float(gl_VertexID)*offset/currentCount,0));}
void main() {float newAge=age+timeDelta; 
if (newAge>=life && stopFactor != 0.) {vec3 newPosition;vec3 newDirection;vec4 randoms=getRandomVec4(seed.x);outLife=lifeTime.x+(lifeTime.y-lifeTime.x)*randoms.r;outAge=newAge-life;outSeed=seed;
#ifdef SIZEGRADIENTS 
outSize.x=texture(sizeGradientSampler,vec2(0,0)).r;
#else
outSize.x=sizeRange.x+(sizeRange.y-sizeRange.x)*randoms.g;
#endif
outSize.y=scaleRange.x+(scaleRange.y-scaleRange.x)*randoms.b;outSize.z=scaleRange.z+(scaleRange.w-scaleRange.z)*randoms.a; 
#ifndef COLORGRADIENTS
outColor=color1+(color2-color1)*randoms.b;
#endif
#ifndef ANGULARSPEEDGRADIENTS 
outAngle.y=angleRange.x+(angleRange.y-angleRange.x)*randoms.a;outAngle.x=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;
#else
outAngle=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;
#endif 
#ifdef POINTEMITTER
vec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);newPosition=vec3(0,0,0);newDirection=direction1+(direction2-direction1)*randoms3;
#elif defined(BOXEMITTER)
vec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);newPosition=minEmitBox+(maxEmitBox-minEmitBox)*randoms2;newDirection=direction1+(direction2-direction1)*randoms3; 
#elif defined(HEMISPHERICEMITTER)
vec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);float phi=2.0*PI*randoms2.x;float theta=acos(2.0*randoms2.y-1.0);float randX=cos(phi)*sin(theta);float randY=cos(theta);float randZ=sin(phi)*sin(theta);newPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,abs(randY),randZ);newDirection=newPosition+directionRandomizer*randoms3; 
#elif defined(SPHEREEMITTER)
vec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);float phi=2.0*PI*randoms2.x;float theta=acos(2.0*randoms2.y-1.0);float randX=cos(phi)*sin(theta);float randY=cos(theta);float randZ=sin(phi)*sin(theta);newPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,randY,randZ);
#ifdef DIRECTEDSPHEREEMITTER
newDirection=normalize(direction1+(direction2-direction1)*randoms3);
#else
newDirection=normalize(newPosition+directionRandomizer*randoms3);
#endif
#elif defined(CYLINDEREMITTER)
vec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);float yPos=(randoms2.x-0.5)*height;float angle=randoms2.y*PI*2.;float inverseRadiusRangeSquared=((1.-radiusRange)*(1.-radiusRange));float positionRadius=radius*sqrt(inverseRadiusRangeSquared+(randoms2.z*(1.-inverseRadiusRangeSquared)));float xPos=positionRadius*cos(angle);float zPos=positionRadius*sin(angle);newPosition=vec3(xPos,yPos,zPos);
#ifdef DIRECTEDCYLINDEREMITTER
newDirection=direction1+(direction2-direction1)*randoms3;
#else
angle=angle+((randoms3.x-0.5)*PI)*directionRandomizer;newDirection=vec3(cos(angle),(randoms3.y-0.5)*directionRandomizer,sin(angle));newDirection=normalize(newDirection);
#endif
#elif defined(CONEEMITTER)
vec3 randoms2=getRandomVec3(seed.y);float s=2.0*PI*randoms2.x;
#ifdef CONEEMITTERSPAWNPOINT
float h=0.0001;
#else
float h=randoms2.y*height.y;h=1.-h*h; 
#endif
float lRadius=radius.x-radius.x*randoms2.z*radius.y;lRadius=lRadius*h;float randX=lRadius*sin(s);float randZ=lRadius*cos(s);float randY=h *height.x;newPosition=vec3(randX,randY,randZ); 
if (abs(cos(coneAngle))==1.0) {newDirection=vec3(0.,1.0,0.);} else {vec3 randoms3=getRandomVec3(seed.z);newDirection=normalize(newPosition+directionRandomizer*randoms3); }
#elif defined(CUSTOMEMITTER)
newPosition=initialPosition;outInitialPosition=initialPosition;
#else 
newPosition=vec3(0.,0.,0.);newDirection=2.0*(getRandomVec3(seed.w)-vec3(0.5,0.5,0.5));
#endif
float power=emitPower.x+(emitPower.y-emitPower.x)*randoms.a;
#ifdef LOCAL
outPosition=newPosition;
#else
outPosition=(emitterWM*vec4(newPosition,1.)).xyz;
#endif
#ifdef CUSTOMEMITTER
outDirection=direction;
#ifndef BILLBOARD 
outInitialDirection=direction;
#endif
#else
#ifdef LOCAL
vec3 initial=newDirection;
#else 
vec3 initial=(emitterWM*vec4(newDirection,0.)).xyz;
#endif
outDirection=initial*power;
#ifndef BILLBOARD 
outInitialDirection=initial;
#endif
#endif
#ifdef ANIMATESHEET 
outCellIndex=cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
outCellStartOffset=randoms.a*outLife;
#endif 
#endif
#ifdef NOISE
outNoiseCoordinates1=noiseCoordinates1;outNoiseCoordinates2=noiseCoordinates2;
#endif
} else {float directionScale=timeDelta;outAge=newAge;float ageGradient=newAge/life;
#ifdef VELOCITYGRADIENTS
directionScale*=texture(velocityGradientSampler,vec2(ageGradient,0)).r;
#endif
#ifdef DRAGGRADIENTS
directionScale*=1.0-texture(dragGradientSampler,vec2(ageGradient,0)).r;
#endif
#if defined(CUSTOMEMITTER)
outPosition=position+(direction-position)*ageGradient; 
outInitialPosition=initialPosition;
#else
outPosition=position+direction*directionScale;
#endif
outLife=life;outSeed=seed;
#ifndef COLORGRADIENTS 
outColor=color;
#endif
#ifdef SIZEGRADIENTS
outSize.x=texture(sizeGradientSampler,vec2(ageGradient,0)).r;outSize.yz=size.yz;
#else
outSize=size;
#endif 
#ifndef BILLBOARD 
outInitialDirection=initialDirection;
#endif
#ifdef CUSTOMEMITTER
outDirection=direction;
#else
vec3 updatedDirection=direction+gravity*timeDelta;
#ifdef LIMITVELOCITYGRADIENTS
float limitVelocity=texture(limitVelocityGradientSampler,vec2(ageGradient,0)).r;float currentVelocity=length(updatedDirection);if (currentVelocity>limitVelocity) {updatedDirection=updatedDirection*limitVelocityDamping;}
#endif
outDirection=updatedDirection;
#ifdef NOISE
float fetchedR=texture(noiseSampler,vec2(noiseCoordinates1.x,noiseCoordinates1.y)*vec2(0.5)+vec2(0.5)).r;float fetchedG=texture(noiseSampler,vec2(noiseCoordinates1.z,noiseCoordinates2.x)*vec2(0.5)+vec2(0.5)).r;float fetchedB=texture(noiseSampler,vec2(noiseCoordinates2.y,noiseCoordinates2.z)*vec2(0.5)+vec2(0.5)).r;vec3 force=vec3(2.*fetchedR-1.,2.*fetchedG-1.,2.*fetchedB-1.)*noiseStrength;outDirection=outDirection+force*timeDelta;outNoiseCoordinates1=noiseCoordinates1;outNoiseCoordinates2=noiseCoordinates2;
#endif 
#endif 
#ifdef ANGULARSPEEDGRADIENTS
float angularSpeed=texture(angularSpeedGradientSampler,vec2(ageGradient,0)).r;outAngle=angle+angularSpeed*timeDelta;
#else
outAngle=vec2(angle.x+angle.y*timeDelta,angle.y);
#endif
#ifdef ANIMATESHEET 
float offsetAge=outAge;float dist=cellInfos.y-cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
outCellStartOffset=cellStartOffset;offsetAge+=cellStartOffset;
#else
float cellStartOffset=0.;
#endif 
float ratio=0.;if (cellInfos.w==1.0) {ratio=clamp(mod(cellStartOffset+cellInfos.z*offsetAge,life)/life,0.,1.0);}
else {ratio=clamp(cellStartOffset+cellInfos.z*offsetAge/life,0.,1.0);}
outCellIndex=float(int(cellInfos.x+ratio*dist));
#endif
}}`;
Le.ShadersStore[Uhe] = Ihe;
class Lne {
  constructor(e, t) {
    this._renderVAO = [], this._updateVAO = [], this.alignDataInBuffer = !1, this._parent = e, this._engine = t, this._updateEffectOptions = {
      attributes: [
        "position",
        "initialPosition",
        "age",
        "life",
        "seed",
        "size",
        "color",
        "direction",
        "initialDirection",
        "angle",
        "cellIndex",
        "cellStartOffset",
        "noiseCoordinates1",
        "noiseCoordinates2"
      ],
      uniformsNames: [
        "currentCount",
        "timeDelta",
        "emitterWM",
        "lifeTime",
        "color1",
        "color2",
        "sizeRange",
        "scaleRange",
        "gravity",
        "emitPower",
        "direction1",
        "direction2",
        "minEmitBox",
        "maxEmitBox",
        "radius",
        "directionRandomizer",
        "height",
        "coneAngle",
        "stopFactor",
        "angleRange",
        "radiusRange",
        "cellInfos",
        "noiseStrength",
        "limitVelocityDamping"
      ],
      uniformBuffersNames: [],
      samplers: [
        "randomSampler",
        "randomSampler2",
        "sizeGradientSampler",
        "angularSpeedGradientSampler",
        "velocityGradientSampler",
        "limitVelocityGradientSampler",
        "noiseSampler",
        "dragGradientSampler"
      ],
      defines: "",
      fallbacks: null,
      onCompiled: null,
      onError: null,
      indexParameters: null,
      maxSimultaneousLights: 0,
      transformFeedbackVaryings: []
    };
  }
  contextLost() {
    this._updateEffect = void 0, this._renderVAO.length = 0, this._updateVAO.length = 0;
  }
  isUpdateBufferCreated() {
    return !!this._updateEffect;
  }
  isUpdateBufferReady() {
    var e, t;
    return (t = (e = this._updateEffect) === null || e === void 0 ? void 0 : e.isReady()) !== null && t !== void 0 ? t : !1;
  }
  createUpdateBuffer(e) {
    return this._updateEffectOptions.transformFeedbackVaryings = ["outPosition"], this._updateEffectOptions.transformFeedbackVaryings.push("outAge"), this._updateEffectOptions.transformFeedbackVaryings.push("outSize"), this._updateEffectOptions.transformFeedbackVaryings.push("outLife"), this._updateEffectOptions.transformFeedbackVaryings.push("outSeed"), this._updateEffectOptions.transformFeedbackVaryings.push("outDirection"), this._parent.particleEmitterType instanceof dD && this._updateEffectOptions.transformFeedbackVaryings.push("outInitialPosition"), this._parent._colorGradientsTexture || this._updateEffectOptions.transformFeedbackVaryings.push("outColor"), this._parent._isBillboardBased || this._updateEffectOptions.transformFeedbackVaryings.push("outInitialDirection"), this._parent.noiseTexture && (this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates1"), this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates2")), this._updateEffectOptions.transformFeedbackVaryings.push("outAngle"), this._parent.isAnimationSheetEnabled && (this._updateEffectOptions.transformFeedbackVaryings.push("outCellIndex"), this._parent.spriteRandomStartCell && this._updateEffectOptions.transformFeedbackVaryings.push("outCellStartOffset")), this._updateEffectOptions.defines = e, this._updateEffect = new An("gpuUpdateParticles", this._updateEffectOptions, this._engine), new Mne(this._updateEffect);
  }
  createVertexBuffers(e, t) {
    this._updateVAO.push(this._createUpdateVAO(e)), this._renderVAO.push(this._engine.recordVertexArrayObject(t, null, this._parent._getWrapper(this._parent.blendMode).effect)), this._engine.bindArrayBuffer(null), this._renderVertexBuffers = t;
  }
  createParticleBuffer(e) {
    return e;
  }
  bindDrawBuffers(e, t, r) {
    r ? this._engine.bindBuffers(this._renderVertexBuffers, r, t) : this._engine.bindVertexArrayObject(this._renderVAO[e], null);
  }
  preUpdateParticleBuffer() {
    const e = this._engine;
    if (this._engine.enableEffect(this._updateEffect), !e.setState)
      throw new Error("GPU particles cannot work without a full Engine. ThinEngine is not supported");
  }
  updateParticleBuffer(e, t, r) {
    this._updateEffect.setTexture("randomSampler", this._parent._randomTexture), this._updateEffect.setTexture("randomSampler2", this._parent._randomTexture2), this._parent._sizeGradientsTexture && this._updateEffect.setTexture("sizeGradientSampler", this._parent._sizeGradientsTexture), this._parent._angularSpeedGradientsTexture && this._updateEffect.setTexture("angularSpeedGradientSampler", this._parent._angularSpeedGradientsTexture), this._parent._velocityGradientsTexture && this._updateEffect.setTexture("velocityGradientSampler", this._parent._velocityGradientsTexture), this._parent._limitVelocityGradientsTexture && this._updateEffect.setTexture("limitVelocityGradientSampler", this._parent._limitVelocityGradientsTexture), this._parent._dragGradientsTexture && this._updateEffect.setTexture("dragGradientSampler", this._parent._dragGradientsTexture), this._parent.noiseTexture && this._updateEffect.setTexture("noiseSampler", this._parent.noiseTexture), this._engine.bindVertexArrayObject(this._updateVAO[e], null);
    const n = this._engine;
    n.bindTransformFeedbackBuffer(t.getBuffer()), n.setRasterizerState(!1), n.beginTransformFeedback(!0), n.drawArraysType(3, 0, r), n.endTransformFeedback(), n.setRasterizerState(!0), n.bindTransformFeedbackBuffer(null);
  }
  releaseBuffers() {
  }
  releaseVertexBuffers() {
    for (let e = 0; e < this._updateVAO.length; e++)
      this._engine.releaseVertexArrayObject(this._updateVAO[e]);
    this._updateVAO.length = 0;
    for (let e = 0; e < this._renderVAO.length; e++)
      this._engine.releaseVertexArrayObject(this._renderVAO[e]);
    this._renderVAO.length = 0;
  }
  _createUpdateVAO(e) {
    const t = {};
    t.position = e.createVertexBuffer("position", 0, 3);
    let r = 3;
    t.age = e.createVertexBuffer("age", r, 1), r += 1, t.size = e.createVertexBuffer("size", r, 3), r += 3, t.life = e.createVertexBuffer("life", r, 1), r += 1, t.seed = e.createVertexBuffer("seed", r, 4), r += 4, t.direction = e.createVertexBuffer("direction", r, 3), r += 3, this._parent.particleEmitterType instanceof dD && (t.initialPosition = e.createVertexBuffer("initialPosition", r, 3), r += 3), this._parent._colorGradientsTexture || (t.color = e.createVertexBuffer("color", r, 4), r += 4), this._parent._isBillboardBased || (t.initialDirection = e.createVertexBuffer("initialDirection", r, 3), r += 3), this._parent.noiseTexture && (t.noiseCoordinates1 = e.createVertexBuffer("noiseCoordinates1", r, 3), r += 3, t.noiseCoordinates2 = e.createVertexBuffer("noiseCoordinates2", r, 3), r += 3), this._parent._angularSpeedGradientsTexture ? (t.angle = e.createVertexBuffer("angle", r, 1), r += 1) : (t.angle = e.createVertexBuffer("angle", r, 2), r += 2), this._parent._isAnimationSheetEnabled && (t.cellIndex = e.createVertexBuffer("cellIndex", r, 1), r += 1, this._parent.spriteRandomStartCell && (t.cellStartOffset = e.createVertexBuffer("cellStartOffset", r, 1), r += 1));
    const n = this._engine.recordVertexArrayObject(t, null, this._updateEffect);
    return this._engine.bindArrayBuffer(null), n;
  }
}
Ue("BABYLON.WebGL2ParticleSystem", Lne);
const Rhe = "gpuUpdateParticlesComputeShader", Vhe = `struct Particle {position : vec3<f32>,
age : f32,
size : vec3<f32>,
life : f32,
seed : vec4<f32>,
direction : vec3<f32>,
dummy0: f32,
#ifdef CUSTOMEMITTER
initialPosition : vec3<f32>,
dummy1: f32,
#endif
#ifndef COLORGRADIENTS
color : vec4<f32>,
#endif
#ifndef BILLBOARD
initialDirection : vec3<f32>,
dummy2: f32,
#endif
#ifdef NOISE
noiseCoordinates1 : vec3<f32>,
dummy3: f32,
noiseCoordinates2 : vec3<f32>,
dummy4: f32,
#endif
#ifdef ANGULARSPEEDGRADIENTS
angle : f32,
#else
angle : vec2<f32>,
#endif
#ifdef ANIMATESHEET
cellIndex : f32,
#ifdef ANIMATESHEETRANDOMSTART
cellStartOffset : f32,
#endif
#endif
};struct Particles {particles : array<Particle>,};struct SimParams {currentCount : f32,
timeDelta : f32,
stopFactor : f32,
randomTextureSize: i32,
lifeTime : vec2<f32>,
emitPower : vec2<f32>,
#ifndef COLORGRADIENTS
color1 : vec4<f32>,
color2 : vec4<f32>,
#endif
sizeRange : vec2<f32>,
scaleRange : vec4<f32>,
angleRange : vec4<f32>,
gravity : vec3<f32>,
#ifdef LIMITVELOCITYGRADIENTS
limitVelocityDamping : f32,
#endif
#ifdef ANIMATESHEET
cellInfos : vec4<f32>,
#endif
#ifdef NOISE
noiseStrength : vec3<f32>,
#endif
#ifndef LOCAL
emitterWM : mat4x4<f32>,
#endif
#ifdef BOXEMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
minEmitBox : vec3<f32>,
maxEmitBox : vec3<f32>,
#endif
#ifdef CONEEMITTER
radius : vec2<f32>,
coneAngle : f32,
height : vec2<f32>,
directionRandomizer : f32,
#endif
#ifdef CYLINDEREMITTER
radius : f32,
height : f32,
radiusRange : f32,
#ifdef DIRECTEDCYLINDEREMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
#else
directionRandomizer : f32,
#endif
#endif
#ifdef HEMISPHERICEMITTER
radius : f32,
radiusRange : f32,
directionRandomizer : f32,
#endif
#ifdef POINTEMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
#endif
#ifdef SPHEREEMITTER
radius : f32,
radiusRange : f32,
#ifdef DIRECTEDSPHEREEMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
#else
directionRandomizer : f32,
#endif
#endif
};@binding(0) @group(0) var<uniform> params : SimParams;@binding(1) @group(0) var<storage,read> particlesIn : Particles;@binding(2) @group(0) var<storage,read_write> particlesOut : Particles;@binding(3) @group(0) var randomTexture : texture_2d<f32>;@binding(4) @group(0) var randomTexture2 : texture_2d<f32>;
#ifdef SIZEGRADIENTS
@binding(0) @group(1) var sizeGradientSampler : sampler;@binding(1) @group(1) var sizeGradientTexture : texture_2d<f32>;
#endif 
#ifdef ANGULARSPEEDGRADIENTS
@binding(2) @group(1) var angularSpeedGradientSampler : sampler;@binding(3) @group(1) var angularSpeedGradientTexture : texture_2d<f32>;
#endif 
#ifdef VELOCITYGRADIENTS
@binding(4) @group(1) var velocityGradientSampler : sampler;@binding(5) @group(1) var velocityGradientTexture : texture_2d<f32>;
#endif
#ifdef LIMITVELOCITYGRADIENTS
@binding(6) @group(1) var limitVelocityGradientSampler : sampler;@binding(7) @group(1) var limitVelocityGradientTexture : texture_2d<f32>;
#endif
#ifdef DRAGGRADIENTS
@binding(8) @group(1) var dragGradientSampler : sampler;@binding(9) @group(1) var dragGradientTexture : texture_2d<f32>;
#endif
#ifdef NOISE
@binding(10) @group(1) var noiseSampler : sampler;@binding(11) @group(1) var noiseTexture : texture_2d<f32>;
#endif
fn getRandomVec3(offset : f32,vertexID : f32)->vec3<f32> {return textureLoad(randomTexture2,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0).rgb;}
fn getRandomVec4(offset : f32,vertexID : f32)->vec4<f32> {return textureLoad(randomTexture,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0);}
@compute @workgroup_size(64)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {let index : u32=GlobalInvocationID.x;let vertexID : f32=f32(index);if (index>=u32(params.currentCount)) {return;}
let PI : f32=3.14159;let timeDelta : f32=params.timeDelta;let newAge : f32=particlesIn.particles[index].age+timeDelta;let life : f32=particlesIn.particles[index].life;let seed : vec4<f32>=particlesIn.particles[index].seed;let direction : vec3<f32>=particlesIn.particles[index].direction;if (newAge>=life && params.stopFactor != 0.) {var newPosition : vec3<f32>;var newDirection : vec3<f32>;let randoms : vec4<f32>=getRandomVec4(seed.x,vertexID);let outLife : f32=params.lifeTime.x+(params.lifeTime.y-params.lifeTime.x)*randoms.r;particlesOut.particles[index].life=outLife;particlesOut.particles[index].age=newAge-life;particlesOut.particles[index].seed=seed;var sizex : f32;
#ifdef SIZEGRADIENTS 
sizex=textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(0.,0.),0.).r;
#else
sizex=params.sizeRange.x+(params.sizeRange.y-params.sizeRange.x)*randoms.g;
#endif
particlesOut.particles[index].size=vec3<f32>(
sizex,
params.scaleRange.x+(params.scaleRange.y-params.scaleRange.x)*randoms.b,
params.scaleRange.z+(params.scaleRange.w-params.scaleRange.z)*randoms.a);
#ifndef COLORGRADIENTS
particlesOut.particles[index].color=params.color1+(params.color2-params.color1)*randoms.b;
#endif
#ifndef ANGULARSPEEDGRADIENTS 
particlesOut.particles[index].angle=vec2<f32>(
params.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r,
params.angleRange.x+(params.angleRange.y-params.angleRange.x)*randoms.a);
#else
particlesOut.particles[index].angle=params.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r;
#endif 
#if defined(POINTEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=vec3<f32>(0.,0.,0.);newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;
#elif defined(BOXEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=params.minEmitBox+(params.maxEmitBox-params.minEmitBox)*randoms2;newDirection=params.direction1+(params.direction2-params.direction1)*randoms3; 
#elif defined(HEMISPHERICEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,abs(randY),randZ);newDirection=normalize(newPosition+params.directionRandomizer*randoms3);
#elif defined(SPHEREEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,randY,randZ);
#ifdef DIRECTEDSPHEREEMITTER
newDirection=normalize(params.direction1+(params.direction2-params.direction1)*randoms3);
#else
newDirection=normalize(newPosition+params.directionRandomizer*randoms3);
#endif
#elif defined(CYLINDEREMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let yPos : f32=(-0.5+randoms2.x)*params.height;var angle : f32=randoms2.y*PI*2.;let inverseRadiusRangeSquared : f32=(1.-params.radiusRange)*(1.-params.radiusRange);let positionRadius : f32=params.radius*sqrt(inverseRadiusRangeSquared+randoms2.z*(1.-inverseRadiusRangeSquared));let xPos : f32=positionRadius*cos(angle);let zPos : f32=positionRadius*sin(angle);newPosition=vec3<f32>(xPos,yPos,zPos);
#ifdef DIRECTEDCYLINDEREMITTER
newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;
#else
angle=angle+(-0.5+randoms3.x)*PI*params.directionRandomizer;newDirection=vec3<f32>(cos(angle),(-0.5+randoms3.y)*params.directionRandomizer,sin(angle));newDirection=normalize(newDirection);
#endif
#elif defined(CONEEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let s : f32=2.0*PI*randoms2.x;
#ifdef CONEEMITTERSPAWNPOINT
let h : f32=0.0001;
#else
var h : f32=randoms2.y*params.height.y;h=1.-h*h; 
#endif
var lRadius : f32=params.radius.x-params.radius.x*randoms2.z*params.radius.y;lRadius=lRadius*h;let randX : f32=lRadius*sin(s);let randZ : f32=lRadius*cos(s);let randY : f32=h *params.height.x;newPosition=vec3<f32>(randX,randY,randZ); 
if (abs(cos(params.coneAngle))==1.0) {newDirection=vec3<f32>(0.,1.0,0.);} else {let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newDirection=normalize(newPosition+params.directionRandomizer*randoms3); }
#elif defined(CUSTOMEMITTER)
newPosition=particlesIn.particles[index].initialPosition;particlesOut.particles[index].initialPosition=newPosition;
#else 
newPosition=vec3<f32>(0.,0.,0.);newDirection=2.0*(getRandomVec3(seed.w,vertexID)-vec3<f32>(0.5,0.5,0.5));
#endif
let power : f32=params.emitPower.x+(params.emitPower.y-params.emitPower.x)*randoms.a;
#ifdef LOCAL
particlesOut.particles[index].position=newPosition;
#else
particlesOut.particles[index].position=(params.emitterWM*vec4<f32>(newPosition,1.)).xyz;
#endif
#ifdef CUSTOMEMITTER
particlesOut.particles[index].direction=direction;
#ifndef BILLBOARD 
particlesOut.particles[index].initialDirection=direction;
#endif
#else
#ifdef LOCAL
let initial : vec3<f32>=newDirection;
#else 
let initial : vec3<f32>=(params.emitterWM*vec4<f32>(newDirection,0.)).xyz;
#endif
particlesOut.particles[index].direction=initial*power;
#ifndef BILLBOARD 
particlesOut.particles[index].initialDirection=initial;
#endif
#endif
#ifdef ANIMATESHEET 
particlesOut.particles[index].cellIndex=params.cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
particlesOut.particles[index].cellStartOffset=randoms.a*outLife;
#endif 
#endif
#ifdef NOISE
particlesOut.particles[index].noiseCoordinates1=particlesIn.particles[index].noiseCoordinates1;particlesOut.particles[index].noiseCoordinates2=particlesIn.particles[index].noiseCoordinates2;
#endif
} else {var directionScale : f32=timeDelta;particlesOut.particles[index].age=newAge;let ageGradient : f32=newAge/life;
#ifdef VELOCITYGRADIENTS
directionScale=directionScale*textureSampleLevel(velocityGradientTexture,velocityGradientSampler,vec2<f32>(ageGradient,0.),0.).r;
#endif
#ifdef DRAGGRADIENTS
directionScale=directionScale*(1.0-textureSampleLevel(dragGradientTexture,dragGradientSampler,vec2<f32>(ageGradient,0.),0.).r);
#endif
let position : vec3<f32>=particlesIn.particles[index].position;
#if defined(CUSTOMEMITTER)
particlesOut.particles[index].position=position+(direction-position)*ageGradient; 
particlesOut.particles[index].initialPosition=particlesIn.particles[index].initialPosition;
#else
particlesOut.particles[index].position=position+direction*directionScale;
#endif
particlesOut.particles[index].life=life;particlesOut.particles[index].seed=seed;
#ifndef COLORGRADIENTS 
particlesOut.particles[index].color=particlesIn.particles[index].color;
#endif
#ifdef SIZEGRADIENTS
particlesOut.particles[index].size=vec3<f32>(
textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(ageGradient,0.),0.).r,
particlesIn.particles[index].size.yz);
#else
particlesOut.particles[index].size=particlesIn.particles[index].size;
#endif 
#ifndef BILLBOARD 
particlesOut.particles[index].initialDirection=particlesIn.particles[index].initialDirection;
#endif
#ifdef CUSTOMEMITTER
particlesOut.particles[index].direction=direction;
#else
var updatedDirection : vec3<f32>=direction+params.gravity*timeDelta;
#ifdef LIMITVELOCITYGRADIENTS
let limitVelocity : f32=textureSampleLevel(limitVelocityGradientTexture,limitVelocityGradientSampler,vec2<f32>(ageGradient,0.),0.).r;let currentVelocity : f32=length(updatedDirection);if (currentVelocity>limitVelocity) {updatedDirection=updatedDirection*params.limitVelocityDamping;}
#endif
particlesOut.particles[index].direction=updatedDirection;
#ifdef NOISE
let noiseCoordinates1 : vec3<f32>=particlesIn.particles[index].noiseCoordinates1;let noiseCoordinates2 : vec3<f32>=particlesIn.particles[index].noiseCoordinates2;let fetchedR : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.x,noiseCoordinates1.y)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let fetchedG : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.z,noiseCoordinates2.x)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let fetchedB : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates2.y,noiseCoordinates2.z)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let force : vec3<f32>=vec3<f32>(-1.+2.*fetchedR,-1.+2.*fetchedG,-1.+2.*fetchedB)*params.noiseStrength;particlesOut.particles[index].direction=particlesOut.particles[index].direction+force*timeDelta;particlesOut.particles[index].noiseCoordinates1=noiseCoordinates1;particlesOut.particles[index].noiseCoordinates2=noiseCoordinates2;
#endif 
#endif 
#ifdef ANGULARSPEEDGRADIENTS
let angularSpeed : f32=textureSampleLevel(angularSpeedGradientTexture,angularSpeedGradientSampler,vec2<f32>(ageGradient,0.),0.).r;particlesOut.particles[index].angle=particlesIn.particles[index].angle+angularSpeed*timeDelta;
#else
let angle : vec2<f32>=particlesIn.particles[index].angle;particlesOut.particles[index].angle=vec2<f32>(angle.x+angle.y*timeDelta,angle.y);
#endif
#ifdef ANIMATESHEET 
var offsetAge : f32=particlesOut.particles[index].age;let dist : f32=params.cellInfos.y-params.cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
let cellStartOffset : f32=particlesIn.particles[index].cellStartOffset;particlesOut.particles[index].cellStartOffset=cellStartOffset;offsetAge=offsetAge+cellStartOffset;
#else
let cellStartOffset : f32=0.;
#endif 
var ratio : f32;if (params.cellInfos.w==1.0) {ratio=clamp(((cellStartOffset+params.cellInfos.z*offsetAge) % life)/life,0.,1.0);}
else {ratio=clamp((cellStartOffset+params.cellInfos.z*offsetAge)/life,0.,1.0);}
particlesOut.particles[index].cellIndex=f32(i32(params.cellInfos.x+ratio*dist));
#endif
}}
`;
Le.ShadersStoreWGSL[Rhe] = Vhe;
class Kne {
  constructor(e, t) {
    this._bufferComputeShader = [], this._renderVertexBuffers = [], this.alignDataInBuffer = !0, this._parent = e, this._engine = t;
  }
  contextLost() {
    this._updateComputeShader = void 0, this._bufferComputeShader.length = 0, this._renderVertexBuffers.length = 0;
  }
  isUpdateBufferCreated() {
    return !!this._updateComputeShader;
  }
  isUpdateBufferReady() {
    var e, t;
    return (t = (e = this._updateComputeShader) === null || e === void 0 ? void 0 : e.isReady()) !== null && t !== void 0 ? t : !1;
  }
  createUpdateBuffer(e) {
    var t;
    const r = {
      params: { group: 0, binding: 0 },
      particlesIn: { group: 0, binding: 1 },
      particlesOut: { group: 0, binding: 2 },
      randomTexture: { group: 0, binding: 3 },
      randomTexture2: { group: 0, binding: 4 }
    };
    return this._parent._sizeGradientsTexture && (r.sizeGradientTexture = { group: 1, binding: 1 }), this._parent._angularSpeedGradientsTexture && (r.angularSpeedGradientTexture = { group: 1, binding: 3 }), this._parent._velocityGradientsTexture && (r.velocityGradientTexture = { group: 1, binding: 5 }), this._parent._limitVelocityGradientsTexture && (r.limitVelocityGradientTexture = { group: 1, binding: 7 }), this._parent._dragGradientsTexture && (r.dragGradientTexture = { group: 1, binding: 9 }), this._parent.noiseTexture && (r.noiseTexture = { group: 1, binding: 11 }), this._updateComputeShader = new vU("updateParticles", this._engine, "gpuUpdateParticles", { bindingsMapping: r, defines: e.split(`
`) }), (t = this._simParamsComputeShader) === null || t === void 0 || t.dispose(), this._simParamsComputeShader = new yr(this._engine), this._simParamsComputeShader.addUniform("currentCount", 1), this._simParamsComputeShader.addUniform("timeDelta", 1), this._simParamsComputeShader.addUniform("stopFactor", 1), this._simParamsComputeShader.addUniform("randomTextureSize", 1), this._simParamsComputeShader.addUniform("lifeTime", 2), this._simParamsComputeShader.addUniform("emitPower", 2), this._parent._colorGradientsTexture || (this._simParamsComputeShader.addUniform("color1", 4), this._simParamsComputeShader.addUniform("color2", 4)), this._simParamsComputeShader.addUniform("sizeRange", 2), this._simParamsComputeShader.addUniform("scaleRange", 4), this._simParamsComputeShader.addUniform("angleRange", 4), this._simParamsComputeShader.addUniform("gravity", 3), this._parent._limitVelocityGradientsTexture && this._simParamsComputeShader.addUniform("limitVelocityDamping", 1), this._parent.isAnimationSheetEnabled && this._simParamsComputeShader.addUniform("cellInfos", 4), this._parent.noiseTexture && this._simParamsComputeShader.addUniform("noiseStrength", 3), this._parent.isLocal || this._simParamsComputeShader.addUniform("emitterWM", 16), this._parent.particleEmitterType && this._parent.particleEmitterType.buildUniformLayout(this._simParamsComputeShader), this._updateComputeShader.setUniformBuffer("params", this._simParamsComputeShader), new Mne(this._simParamsComputeShader);
  }
  createVertexBuffers(e, t) {
    this._renderVertexBuffers.push(t);
  }
  createParticleBuffer(e) {
    const t = new bee(this._engine, e.length * 4, 11);
    return t.update(e), this._bufferComputeShader.push(t), t.getBuffer();
  }
  bindDrawBuffers(e, t, r) {
    this._engine.bindBuffers(this._renderVertexBuffers[e], r, t);
  }
  preUpdateParticleBuffer() {
  }
  updateParticleBuffer(e, t, r) {
    this._simParamsComputeShader.update(), this._updateComputeShader.setTexture("randomTexture", this._parent._randomTexture, !1), this._updateComputeShader.setTexture("randomTexture2", this._parent._randomTexture2, !1), this._parent._sizeGradientsTexture && this._updateComputeShader.setTexture("sizeGradientTexture", this._parent._sizeGradientsTexture), this._parent._angularSpeedGradientsTexture && this._updateComputeShader.setTexture("angularSpeedGradientTexture", this._parent._angularSpeedGradientsTexture), this._parent._velocityGradientsTexture && this._updateComputeShader.setTexture("velocityGradientTexture", this._parent._velocityGradientsTexture), this._parent._limitVelocityGradientsTexture && this._updateComputeShader.setTexture("limitVelocityGradientTexture", this._parent._limitVelocityGradientsTexture), this._parent._dragGradientsTexture && this._updateComputeShader.setTexture("dragGradientTexture", this._parent._dragGradientsTexture), this._parent.noiseTexture && this._updateComputeShader.setTexture("noiseTexture", this._parent.noiseTexture), this._updateComputeShader.setStorageBuffer("particlesIn", this._bufferComputeShader[e]), this._updateComputeShader.setStorageBuffer("particlesOut", this._bufferComputeShader[e ^ 1]), this._updateComputeShader.dispatch(Math.ceil(r / 64));
  }
  releaseBuffers() {
    var e;
    for (let t = 0; t < this._bufferComputeShader.length; ++t)
      this._bufferComputeShader[t].dispose();
    this._bufferComputeShader.length = 0, (e = this._simParamsComputeShader) === null || e === void 0 || e.dispose(), this._simParamsComputeShader = null, this._updateComputeShader = null;
  }
  releaseVertexBuffers() {
    this._renderVertexBuffers.length = 0;
  }
}
Ue("BABYLON.ComputeShaderParticleSystem", Kne);
class yY {
  /**
   * Creates a new color4 gradient
   * @param gradient gets or sets the gradient value (between 0 and 1)
   * @param color1 gets or sets first associated color
   * @param color2 gets or sets first second color
   */
  constructor(e, t, r) {
    this.gradient = e, this.color1 = t, this.color2 = r;
  }
  /**
   * Will get a color picked randomly between color1 and color2.
   * If color2 is undefined then color1 will be used
   * @param result defines the target Color4 to store the result in
   */
  getColorToRef(e) {
    if (!this.color2) {
      e.copyFrom(this.color1);
      return;
    }
    xt.LerpToRef(this.color1, this.color2, Math.random(), e);
  }
}
class Jne {
  /**
   * Creates a new color3 gradient
   * @param gradient gets or sets the gradient value (between 0 and 1)
   * @param color gets or sets associated color
   */
  constructor(e, t) {
    this.gradient = e, this.color = t;
  }
}
class kY {
  /**
   * Creates a new factor gradient
   * @param gradient gets or sets the gradient value (between 0 and 1)
   * @param factor1 gets or sets first associated factor
   * @param factor2 gets or sets second associated factor
   */
  constructor(e, t, r) {
    this.gradient = e, this.factor1 = t, this.factor2 = r;
  }
  /**
   * Will get a number picked randomly between factor1 and factor2.
   * If factor2 is undefined then factor1 will be used
   * @returns the picked number
   */
  getFactor() {
    return this.factor2 === void 0 || this.factor2 === this.factor1 ? this.factor1 : this.factor1 + (this.factor2 - this.factor1) * Math.random();
  }
}
class kl {
  /**
   * Gets the current gradient from an array of IValueGradient
   * @param ratio defines the current ratio to get
   * @param gradients defines the array of IValueGradient
   * @param updateFunc defines the callback function used to get the final value from the selected gradients
   */
  static GetCurrentGradient(e, t, r) {
    if (t[0].gradient > e) {
      r(t[0], t[0], 1);
      return;
    }
    for (let i = 0; i < t.length - 1; i++) {
      const s = t[i], a = t[i + 1];
      if (e >= s.gradient && e <= a.gradient) {
        const f = (e - s.gradient) / (a.gradient - s.gradient);
        r(s, a, f);
        return;
      }
    }
    const n = t.length - 1;
    r(t[n], t[n], 1);
  }
}
class FS {
  /**
   * Creates a new instance Particle
   * @param particleSystem the particle system the particle belongs to
   */
  constructor(e) {
    this.particleSystem = e, this.position = S.Zero(), this.direction = S.Zero(), this.color = new xt(0, 0, 0, 0), this.colorStep = new xt(0, 0, 0, 0), this.lifeTime = 1, this.age = 0, this.size = 0, this.scale = new at(1, 1), this.angle = 0, this.angularSpeed = 0, this.cellIndex = 0, this._attachedSubEmitters = null, this._currentColor1 = new xt(0, 0, 0, 0), this._currentColor2 = new xt(0, 0, 0, 0), this._currentSize1 = 0, this._currentSize2 = 0, this._currentAngularSpeed1 = 0, this._currentAngularSpeed2 = 0, this._currentVelocity1 = 0, this._currentVelocity2 = 0, this._currentLimitVelocity1 = 0, this._currentLimitVelocity2 = 0, this._currentDrag1 = 0, this._currentDrag2 = 0, this.id = FS._Count++, this.particleSystem.isAnimationSheetEnabled && this._updateCellInfoFromSystem();
  }
  _updateCellInfoFromSystem() {
    this.cellIndex = this.particleSystem.startSpriteCellID;
  }
  /**
   * Defines how the sprite cell index is updated for the particle
   */
  updateCellIndex() {
    let e = this.age, t = this.particleSystem.spriteCellChangeSpeed;
    this.particleSystem.spriteRandomStartCell && (this._randomCellOffset === void 0 && (this._randomCellOffset = Math.random() * this.lifeTime), t === 0 ? (t = 1, e = this._randomCellOffset) : e += this._randomCellOffset);
    const r = this._initialEndSpriteCellID - this._initialStartSpriteCellID;
    let n;
    this._initialSpriteCellLoop ? n = Xt.Clamp(e * t % this.lifeTime / this.lifeTime) : n = Xt.Clamp(e * t / this.lifeTime), this.cellIndex = this._initialStartSpriteCellID + n * r | 0;
  }
  /**
   * @internal
   */
  _inheritParticleInfoToSubEmitter(e) {
    if (e.particleSystem.emitter.position) {
      const t = e.particleSystem.emitter;
      if (t.position.copyFrom(this.position), e.inheritDirection) {
        const r = ue.Vector3[0];
        this.direction.normalizeToRef(r), t.setDirection(r, 0, Math.PI / 2);
      }
    } else
      e.particleSystem.emitter.copyFrom(this.position);
    this.direction.scaleToRef(e.inheritedVelocityAmount / 2, ue.Vector3[0]), e.particleSystem._inheritedVelocityOffset.copyFrom(ue.Vector3[0]);
  }
  /** @internal */
  _inheritParticleInfoToSubEmitters() {
    this._attachedSubEmitters && this._attachedSubEmitters.length > 0 && this._attachedSubEmitters.forEach((e) => {
      this._inheritParticleInfoToSubEmitter(e);
    });
  }
  /** @internal */
  _reset() {
    this.age = 0, this.id = FS._Count++, this._currentColorGradient = null, this._currentSizeGradient = null, this._currentAngularSpeedGradient = null, this._currentVelocityGradient = null, this._currentLimitVelocityGradient = null, this._currentDragGradient = null, this.cellIndex = this.particleSystem.startSpriteCellID, this._randomCellOffset = void 0;
  }
  /**
   * Copy the properties of particle to another one.
   * @param other the particle to copy the information to.
   */
  copyTo(e) {
    e.position.copyFrom(this.position), this._initialDirection ? e._initialDirection ? e._initialDirection.copyFrom(this._initialDirection) : e._initialDirection = this._initialDirection.clone() : e._initialDirection = null, e.direction.copyFrom(this.direction), this._localPosition && (e._localPosition ? e._localPosition.copyFrom(this._localPosition) : e._localPosition = this._localPosition.clone()), e.color.copyFrom(this.color), e.colorStep.copyFrom(this.colorStep), e.lifeTime = this.lifeTime, e.age = this.age, e._randomCellOffset = this._randomCellOffset, e.size = this.size, e.scale.copyFrom(this.scale), e.angle = this.angle, e.angularSpeed = this.angularSpeed, e.particleSystem = this.particleSystem, e.cellIndex = this.cellIndex, e.id = this.id, e._attachedSubEmitters = this._attachedSubEmitters, this._currentColorGradient && (e._currentColorGradient = this._currentColorGradient, e._currentColor1.copyFrom(this._currentColor1), e._currentColor2.copyFrom(this._currentColor2)), this._currentSizeGradient && (e._currentSizeGradient = this._currentSizeGradient, e._currentSize1 = this._currentSize1, e._currentSize2 = this._currentSize2), this._currentAngularSpeedGradient && (e._currentAngularSpeedGradient = this._currentAngularSpeedGradient, e._currentAngularSpeed1 = this._currentAngularSpeed1, e._currentAngularSpeed2 = this._currentAngularSpeed2), this._currentVelocityGradient && (e._currentVelocityGradient = this._currentVelocityGradient, e._currentVelocity1 = this._currentVelocity1, e._currentVelocity2 = this._currentVelocity2), this._currentLimitVelocityGradient && (e._currentLimitVelocityGradient = this._currentLimitVelocityGradient, e._currentLimitVelocity1 = this._currentLimitVelocity1, e._currentLimitVelocity2 = this._currentLimitVelocity2), this._currentDragGradient && (e._currentDragGradient = this._currentDragGradient, e._currentDrag1 = this._currentDrag1, e._currentDrag2 = this._currentDrag2), this.particleSystem.isAnimationSheetEnabled && (e._initialStartSpriteCellID = this._initialStartSpriteCellID, e._initialEndSpriteCellID = this._initialEndSpriteCellID, e._initialSpriteCellLoop = this._initialSpriteCellLoop), this.particleSystem.useRampGradients && (e.remapData && this.remapData ? e.remapData.copyFrom(this.remapData) : e.remapData = new Ir(0, 0, 0, 0)), this._randomNoiseCoordinates1 && (e._randomNoiseCoordinates1 ? (e._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1), e._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2)) : (e._randomNoiseCoordinates1 = this._randomNoiseCoordinates1.clone(), e._randomNoiseCoordinates2 = this._randomNoiseCoordinates2.clone()));
  }
}
FS._Count = 0;
var NS;
(function(A) {
  A[A.ATTACHED = 0] = "ATTACHED", A[A.END = 1] = "END";
})(NS || (NS = {}));
class vq {
  /**
   * Creates a sub emitter
   * @param particleSystem the particle system to be used by the sub emitter
   */
  constructor(e) {
    if (this.particleSystem = e, this.type = NS.END, this.inheritDirection = !1, this.inheritedVelocityAmount = 0, !e.emitter || !e.emitter.dispose) {
      const t = Jo("BABYLON.AbstractMesh");
      e.emitter = new t("SubemitterSystemEmitter", e.getScene()), e._disposeEmitterOnDispose = !0;
    }
  }
  /**
   * Clones the sub emitter
   * @returns the cloned sub emitter
   */
  clone() {
    let e = this.particleSystem.emitter;
    if (!e)
      e = new S();
    else if (e instanceof S)
      e = e.clone();
    else if (e.getClassName().indexOf("Mesh") !== -1) {
      const r = Jo("BABYLON.Mesh");
      e = new r("", e.getScene()), e.isVisible = !1;
    }
    const t = new vq(this.particleSystem.clone(this.particleSystem.name, e));
    return t.particleSystem.name += "Clone", t.type = this.type, t.inheritDirection = this.inheritDirection, t.inheritedVelocityAmount = this.inheritedVelocityAmount, t.particleSystem._disposeEmitterOnDispose = !0, t.particleSystem.disposeOnStop = !0, t;
  }
  /**
   * Serialize current object to a JSON object
   * @param serializeTexture defines if the texture must be serialized as well
   * @returns the serialized object
   */
  serialize(e = !1) {
    const t = {};
    return t.type = this.type, t.inheritDirection = this.inheritDirection, t.inheritedVelocityAmount = this.inheritedVelocityAmount, t.particleSystem = this.particleSystem.serialize(e), t;
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static _ParseParticleSystem(e, t, r, n = !1) {
    throw qn("ParseParticle");
  }
  /**
   * Creates a new SubEmitter from a serialized JSON version
   * @param serializationObject defines the JSON object to read from
   * @param sceneOrEngine defines the hosting scene or the hosting engine
   * @param rootUrl defines the rootUrl for data loading
   * @returns a new SubEmitter
   */
  static Parse(e, t, r) {
    const n = e.particleSystem, i = new vq(vq._ParseParticleSystem(n, t, r, !0));
    return i.type = e.type, i.inheritDirection = e.inheritDirection, i.inheritedVelocityAmount = e.inheritedVelocityAmount, i.particleSystem._isSubEmitter = !0, i;
  }
  /** Release associated resources */
  dispose() {
    this.particleSystem.dispose();
  }
}
const Che = "particlesPixelShader", Ohe = `#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
varying vec2 vUV;varying vec4 vColor;uniform vec4 textureMask;uniform sampler2D diffuseSampler;
#include<clipPlaneFragmentDeclaration>
#include<imageProcessingDeclaration>
#include<logDepthDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
#ifdef RAMPGRADIENT
varying vec4 remapRanges;uniform sampler2D rampSampler;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec4 textureColor=texture2D(diffuseSampler,vUV);vec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;
#ifdef RAMPGRADIENT
float alpha=baseColor.a;float remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);vec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));baseColor.rgb*=rampColor.rgb;float finalAlpha=baseColor.a;baseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);
#endif
#ifdef BLENDMULTIPLYMODE
float sourceAlpha=vColor.a*textureColor.a;baseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);
#endif
#include<logDepthFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
baseColor.rgb=toLinearSpace(baseColor.rgb);
#else
#ifdef IMAGEPROCESSING
baseColor.rgb=toLinearSpace(baseColor.rgb);baseColor=applyImageProcessing(baseColor);
#endif
#endif
gl_FragColor=baseColor;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[Che] = Ohe;
const yhe = "particlesVertexShader", khe = `attribute vec3 position;attribute vec4 color;attribute float angle;attribute vec2 size;
#ifdef ANIMATESHEET
attribute float cellIndex;
#endif
#ifndef BILLBOARD
attribute vec3 direction;
#endif
#ifdef BILLBOARDSTRETCHED
attribute vec3 direction;
#endif
#ifdef RAMPGRADIENT
attribute vec4 remapData;
#endif
attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 translationPivot;
#ifdef ANIMATESHEET
uniform vec3 particlesInfos; 
#endif
varying vec2 vUV;varying vec4 vColor;varying vec3 vPositionW;
#ifdef RAMPGRADIENT
varying vec4 remapRanges;
#endif
#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)
uniform mat4 invView;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#ifdef BILLBOARD
uniform vec3 eyePosition;
#endif
vec3 rotate(vec3 yaxis,vec3 rotatedCorner) {vec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));vec3 zaxis=normalize(cross(yaxis,xaxis));vec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);vec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);vec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;return position+alignedCorner;}
#ifdef BILLBOARDSTRETCHED
vec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {vec3 normalizedToCamera=normalize(toCamera);vec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));vec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);vec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);
#ifdef BILLBOARDSTRETCHED_LOCAL
vec3 row1=direction;
#else
vec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));vec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);
#endif
mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;return position+alignedCorner;}
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec2 cornerPos;cornerPos=(vec2(offset.x-0.5,offset.y -0.5)-translationPivot)*size;
#ifdef BILLBOARD
vec3 rotatedCorner;
#ifdef BILLBOARDY
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.y=0.;rotatedCorner.xz+=translationPivot;vec3 yaxis=position-eyePosition;yaxis.y=0.;vPositionW=rotate(normalize(yaxis),rotatedCorner);vec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;
#elif defined(BILLBOARDSTRETCHED)
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;vec3 toCamera=position-eyePosition;vPositionW=rotateAlign(toCamera,rotatedCorner);vec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;
#else
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;vec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;vPositionW=(invView*vec4(viewPos,1)).xyz;
#endif
#ifdef RAMPGRADIENT
remapRanges=remapData;
#endif
gl_Position=projection*vec4(viewPos,1.0);
#else
vec3 rotatedCorner;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.y=0.;rotatedCorner.xz+=translationPivot;vec3 yaxis=normalize(direction);vPositionW=rotate(yaxis,rotatedCorner);gl_Position=projection*view*vec4(vPositionW,1.0);
#endif
vColor=color;
#ifdef ANIMATESHEET
float rowOffset=floor(cellIndex*particlesInfos.z);float columnOffset=cellIndex-rowOffset/particlesInfos.z;vec2 uvScale=particlesInfos.xy;vec2 uvOffset=vec2(offset.x ,1.0-offset.y);vUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;
#else
vUV=offset;
#endif
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
vec4 worldPos=vec4(vPositionW,1.0);
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[yhe] = khe;
class ti extends N0 {
  /**
   * Sets a callback that will be triggered when the system is disposed
   */
  set onDispose(e) {
    this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);
  }
  /** Gets or sets a boolean indicating that ramp gradients must be used
   * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro#ramp-gradients
   */
  get useRampGradients() {
    return this._useRampGradients;
  }
  set useRampGradients(e) {
    this._useRampGradients !== e && (this._useRampGradients = e, this._resetEffect());
  }
  //end of Sub-emitter
  /**
   * Gets the current list of active particles
   */
  get particles() {
    return this._particles;
  }
  /**
   * Gets the number of particles active at the same time.
   * @returns The number of active particles.
   */
  getActiveCount() {
    return this._particles.length;
  }
  /**
   * Returns the string "ParticleSystem"
   * @returns a string containing the class name
   */
  getClassName() {
    return "ParticleSystem";
  }
  /**
   * Gets a boolean indicating that the system is stopping
   * @returns true if the system is currently stopping
   */
  isStopping() {
    return this._stopped && this.isAlive();
  }
  /**
   * Gets the custom effect used to render the particles
   * @param blendMode Blend mode for which the effect should be retrieved
   * @returns The effect
   */
  getCustomEffect(e = 0) {
    var t, r;
    return (r = (t = this._customWrappers[e]) === null || t === void 0 ? void 0 : t.effect) !== null && r !== void 0 ? r : this._customWrappers[0].effect;
  }
  _getCustomDrawWrapper(e = 0) {
    var t;
    return (t = this._customWrappers[e]) !== null && t !== void 0 ? t : this._customWrappers[0];
  }
  /**
   * Sets the custom effect used to render the particles
   * @param effect The effect to set
   * @param blendMode Blend mode for which the effect should be set
   */
  setCustomEffect(e, t = 0) {
    this._customWrappers[t] = new zo(this._engine), this._customWrappers[t].effect = e, this._customWrappers[t].drawContext && (this._customWrappers[t].drawContext.useInstancing = this._useInstancing);
  }
  /**
   * Observable that will be called just before the particles are drawn
   */
  get onBeforeDrawParticlesObservable() {
    return this._onBeforeDrawParticlesObservable || (this._onBeforeDrawParticlesObservable = new Oe()), this._onBeforeDrawParticlesObservable;
  }
  /**
   * Gets the name of the particle vertex shader
   */
  get vertexShaderName() {
    return "particles";
  }
  /**
   * Gets the vertex buffers used by the particle system
   */
  get vertexBuffers() {
    return this._vertexBuffers;
  }
  /**
   * Gets the index buffer used by the particle system (or null if no index buffer is used (if _useInstancing=true))
   */
  get indexBuffer() {
    return this._indexBuffer;
  }
  /**
   * Instantiates a particle system.
   * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
   * @param name The name of the particle system
   * @param capacity The max number of particles alive at the same time
   * @param sceneOrEngine The scene the particle system belongs to or the engine to use if no scene
   * @param customEffect a custom effect used to change the way particles are rendered by default
   * @param isAnimationSheetEnabled Must be true if using a spritesheet to animate the particles texture
   * @param epsilon Offset used to render the particles
   */
  constructor(e, t, r, n = null, i = !1, s = 0.01) {
    super(e), this._emitterInverseWorldMatrix = he.Identity(), this._inheritedVelocityOffset = new S(), this.onDisposeObservable = new Oe(), this.onStoppedObservable = new Oe(), this._particles = new Array(), this._stockParticles = new Array(), this._newPartsExcess = 0, this._vertexBuffers = {}, this._scaledColorStep = new xt(0, 0, 0, 0), this._colorDiff = new xt(0, 0, 0, 0), this._scaledDirection = S.Zero(), this._scaledGravity = S.Zero(), this._currentRenderId = -1, this._useInstancing = !1, this._started = !1, this._stopped = !1, this._actualFrame = 0, this._currentEmitRate1 = 0, this._currentEmitRate2 = 0, this._currentStartSize1 = 0, this._currentStartSize2 = 0, this.updateInAnimate = !0, this._rawTextureWidth = 256, this._useRampGradients = !1, this._disposeEmitterOnDispose = !1, this.isLocal = !1, this.isGPU = !1, this._onBeforeDrawParticlesObservable = null, this.recycleParticle = (f) => {
      const o = this._particles.pop();
      o !== f && o.copyTo(f), this._stockParticles.push(o);
    }, this._createParticle = () => {
      let f;
      if (this._stockParticles.length !== 0 ? (f = this._stockParticles.pop(), f._reset()) : f = new FS(this), this._subEmitters && this._subEmitters.length > 0) {
        const o = this._subEmitters[Math.floor(Math.random() * this._subEmitters.length)];
        f._attachedSubEmitters = [], o.forEach((d) => {
          if (d.type === NS.ATTACHED) {
            const v = d.clone();
            f._attachedSubEmitters.push(v), v.particleSystem.start();
          }
        });
      }
      return f;
    }, this._emitFromParticle = (f) => {
      if (!this._subEmitters || this._subEmitters.length === 0)
        return;
      const o = Math.floor(Math.random() * this._subEmitters.length);
      this._subEmitters[o].forEach((d) => {
        if (d.type === NS.END) {
          const v = d.clone();
          f._inheritParticleInfoToSubEmitter(v), v.particleSystem._rootParticleSystem = this, this.activeSubSystems.push(v.particleSystem), v.particleSystem.start();
        }
      });
    }, this._capacity = t, this._epsilon = s, this._isAnimationSheetEnabled = i, !r || r.getClassName() === "Scene" ? (this._scene = r || gr.LastCreatedScene, this._engine = this._scene.getEngine(), this.uniqueId = this._scene.getUniqueId(), this._scene.particleSystems.push(this)) : (this._engine = r, this.defaultProjectionMatrix = he.PerspectiveFovLH(0.8, 1, 0.1, 100, this._engine.isNDCHalfZRange)), this._engine.getCaps().vertexArrayObject && (this._vertexArrayObject = null), this._attachImageProcessingConfiguration(null), this._customWrappers = { 0: new zo(this._engine) }, this._customWrappers[0].effect = n, this._drawWrappers = [], this._useInstancing = this._engine.getCaps().instancedArrays, this._createIndexBuffer(), this._createVertexBuffers(), this.particleEmitterType = new AD();
    let a = null;
    this.updateFunction = (f) => {
      var o;
      let d = null;
      this.noiseTexture && (d = this.noiseTexture.getSize(), (o = this.noiseTexture.getContent()) === null || o === void 0 || o.then((u) => {
        a = u;
      }));
      const v = f === this._particles;
      for (let u = 0; u < f.length; u++) {
        const l = f[u];
        let P = this._scaledUpdateSpeed;
        const p = l.age;
        if (l.age += P, l.age > l.lifeTime) {
          const T = l.age - p;
          P = (l.lifeTime - p) * P / T, l.age = l.lifeTime;
        }
        const c = l.age / l.lifeTime;
        this._colorGradients && this._colorGradients.length > 0 ? kl.GetCurrentGradient(c, this._colorGradients, (T, q, b) => {
          T !== l._currentColorGradient && (l._currentColor1.copyFrom(l._currentColor2), q.getColorToRef(l._currentColor2), l._currentColorGradient = T), xt.LerpToRef(l._currentColor1, l._currentColor2, b, l.color);
        }) : (l.colorStep.scaleToRef(P, this._scaledColorStep), l.color.addInPlace(this._scaledColorStep), l.color.a < 0 && (l.color.a = 0)), this._angularSpeedGradients && this._angularSpeedGradients.length > 0 && kl.GetCurrentGradient(c, this._angularSpeedGradients, (T, q, b) => {
          T !== l._currentAngularSpeedGradient && (l._currentAngularSpeed1 = l._currentAngularSpeed2, l._currentAngularSpeed2 = q.getFactor(), l._currentAngularSpeedGradient = T), l.angularSpeed = Xt.Lerp(l._currentAngularSpeed1, l._currentAngularSpeed2, b);
        }), l.angle += l.angularSpeed * P;
        let H = P;
        if (this._velocityGradients && this._velocityGradients.length > 0 && kl.GetCurrentGradient(c, this._velocityGradients, (T, q, b) => {
          T !== l._currentVelocityGradient && (l._currentVelocity1 = l._currentVelocity2, l._currentVelocity2 = q.getFactor(), l._currentVelocityGradient = T), H *= Xt.Lerp(l._currentVelocity1, l._currentVelocity2, b);
        }), l.direction.scaleToRef(H, this._scaledDirection), this._limitVelocityGradients && this._limitVelocityGradients.length > 0 && kl.GetCurrentGradient(c, this._limitVelocityGradients, (T, q, b) => {
          T !== l._currentLimitVelocityGradient && (l._currentLimitVelocity1 = l._currentLimitVelocity2, l._currentLimitVelocity2 = q.getFactor(), l._currentLimitVelocityGradient = T);
          const j = Xt.Lerp(l._currentLimitVelocity1, l._currentLimitVelocity2, b);
          l.direction.length() > j && l.direction.scaleInPlace(this.limitVelocityDamping);
        }), this._dragGradients && this._dragGradients.length > 0 && kl.GetCurrentGradient(c, this._dragGradients, (T, q, b) => {
          T !== l._currentDragGradient && (l._currentDrag1 = l._currentDrag2, l._currentDrag2 = q.getFactor(), l._currentDragGradient = T);
          const j = Xt.Lerp(l._currentDrag1, l._currentDrag2, b);
          this._scaledDirection.scaleInPlace(1 - j);
        }), this.isLocal && l._localPosition ? (l._localPosition.addInPlace(this._scaledDirection), S.TransformCoordinatesToRef(l._localPosition, this._emitterWorldMatrix, l.position)) : l.position.addInPlace(this._scaledDirection), a && d && l._randomNoiseCoordinates1) {
          const T = this._fetchR(l._randomNoiseCoordinates1.x, l._randomNoiseCoordinates1.y, d.width, d.height, a), q = this._fetchR(l._randomNoiseCoordinates1.z, l._randomNoiseCoordinates2.x, d.width, d.height, a), b = this._fetchR(l._randomNoiseCoordinates2.y, l._randomNoiseCoordinates2.z, d.width, d.height, a), j = ue.Vector3[0], w = ue.Vector3[1];
          j.copyFromFloats((2 * T - 1) * this.noiseStrength.x, (2 * q - 1) * this.noiseStrength.y, (2 * b - 1) * this.noiseStrength.z), j.scaleToRef(P, w), l.direction.addInPlace(w);
        }
        if (this.gravity.scaleToRef(P, this._scaledGravity), l.direction.addInPlace(this._scaledGravity), this._sizeGradients && this._sizeGradients.length > 0 && kl.GetCurrentGradient(c, this._sizeGradients, (T, q, b) => {
          T !== l._currentSizeGradient && (l._currentSize1 = l._currentSize2, l._currentSize2 = q.getFactor(), l._currentSizeGradient = T), l.size = Xt.Lerp(l._currentSize1, l._currentSize2, b);
        }), this._useRampGradients && (this._colorRemapGradients && this._colorRemapGradients.length > 0 && kl.GetCurrentGradient(c, this._colorRemapGradients, (T, q, b) => {
          const j = Xt.Lerp(T.factor1, q.factor1, b), w = Xt.Lerp(T.factor2, q.factor2, b);
          l.remapData.x = j, l.remapData.y = w - j;
        }), this._alphaRemapGradients && this._alphaRemapGradients.length > 0 && kl.GetCurrentGradient(c, this._alphaRemapGradients, (T, q, b) => {
          const j = Xt.Lerp(T.factor1, q.factor1, b), w = Xt.Lerp(T.factor2, q.factor2, b);
          l.remapData.z = j, l.remapData.w = w - j;
        })), this._isAnimationSheetEnabled && l.updateCellIndex(), l._inheritParticleInfoToSubEmitters(), l.age >= l.lifeTime) {
          this._emitFromParticle(l), l._attachedSubEmitters && (l._attachedSubEmitters.forEach((T) => {
            T.particleSystem.disposeOnStop = !0, T.particleSystem.stop();
          }), l._attachedSubEmitters = null), this.recycleParticle(l), v && u--;
          continue;
        }
      }
    };
  }
  _addFactorGradient(e, t, r, n) {
    const i = new kY(t, r, n);
    e.push(i), e.sort((s, a) => s.gradient < a.gradient ? -1 : s.gradient > a.gradient ? 1 : 0);
  }
  _removeFactorGradient(e, t) {
    if (!e)
      return;
    let r = 0;
    for (const n of e) {
      if (n.gradient === t) {
        e.splice(r, 1);
        break;
      }
      r++;
    }
  }
  /**
   * Adds a new life time gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the life time factor to affect to the specified gradient
   * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
   * @returns the current particle system
   */
  addLifeTimeGradient(e, t, r) {
    return this._lifeTimeGradients || (this._lifeTimeGradients = []), this._addFactorGradient(this._lifeTimeGradients, e, t, r), this;
  }
  /**
   * Remove a specific life time gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeLifeTimeGradient(e) {
    return this._removeFactorGradient(this._lifeTimeGradients, e), this;
  }
  /**
   * Adds a new size gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the size factor to affect to the specified gradient
   * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
   * @returns the current particle system
   */
  addSizeGradient(e, t, r) {
    return this._sizeGradients || (this._sizeGradients = []), this._addFactorGradient(this._sizeGradients, e, t, r), this;
  }
  /**
   * Remove a specific size gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeSizeGradient(e) {
    return this._removeFactorGradient(this._sizeGradients, e), this;
  }
  /**
   * Adds a new color remap gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param min defines the color remap minimal range
   * @param max defines the color remap maximal range
   * @returns the current particle system
   */
  addColorRemapGradient(e, t, r) {
    return this._colorRemapGradients || (this._colorRemapGradients = []), this._addFactorGradient(this._colorRemapGradients, e, t, r), this;
  }
  /**
   * Remove a specific color remap gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeColorRemapGradient(e) {
    return this._removeFactorGradient(this._colorRemapGradients, e), this;
  }
  /**
   * Adds a new alpha remap gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param min defines the alpha remap minimal range
   * @param max defines the alpha remap maximal range
   * @returns the current particle system
   */
  addAlphaRemapGradient(e, t, r) {
    return this._alphaRemapGradients || (this._alphaRemapGradients = []), this._addFactorGradient(this._alphaRemapGradients, e, t, r), this;
  }
  /**
   * Remove a specific alpha remap gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeAlphaRemapGradient(e) {
    return this._removeFactorGradient(this._alphaRemapGradients, e), this;
  }
  /**
   * Adds a new angular speed gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the angular speed  to affect to the specified gradient
   * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
   * @returns the current particle system
   */
  addAngularSpeedGradient(e, t, r) {
    return this._angularSpeedGradients || (this._angularSpeedGradients = []), this._addFactorGradient(this._angularSpeedGradients, e, t, r), this;
  }
  /**
   * Remove a specific angular speed gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeAngularSpeedGradient(e) {
    return this._removeFactorGradient(this._angularSpeedGradients, e), this;
  }
  /**
   * Adds a new velocity gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the velocity to affect to the specified gradient
   * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
   * @returns the current particle system
   */
  addVelocityGradient(e, t, r) {
    return this._velocityGradients || (this._velocityGradients = []), this._addFactorGradient(this._velocityGradients, e, t, r), this;
  }
  /**
   * Remove a specific velocity gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeVelocityGradient(e) {
    return this._removeFactorGradient(this._velocityGradients, e), this;
  }
  /**
   * Adds a new limit velocity gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the limit velocity value to affect to the specified gradient
   * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
   * @returns the current particle system
   */
  addLimitVelocityGradient(e, t, r) {
    return this._limitVelocityGradients || (this._limitVelocityGradients = []), this._addFactorGradient(this._limitVelocityGradients, e, t, r), this;
  }
  /**
   * Remove a specific limit velocity gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeLimitVelocityGradient(e) {
    return this._removeFactorGradient(this._limitVelocityGradients, e), this;
  }
  /**
   * Adds a new drag gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the drag value to affect to the specified gradient
   * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
   * @returns the current particle system
   */
  addDragGradient(e, t, r) {
    return this._dragGradients || (this._dragGradients = []), this._addFactorGradient(this._dragGradients, e, t, r), this;
  }
  /**
   * Remove a specific drag gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeDragGradient(e) {
    return this._removeFactorGradient(this._dragGradients, e), this;
  }
  /**
   * Adds a new emit rate gradient (please note that this will only work if you set the targetStopDuration property)
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the emit rate value to affect to the specified gradient
   * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
   * @returns the current particle system
   */
  addEmitRateGradient(e, t, r) {
    return this._emitRateGradients || (this._emitRateGradients = []), this._addFactorGradient(this._emitRateGradients, e, t, r), this;
  }
  /**
   * Remove a specific emit rate gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeEmitRateGradient(e) {
    return this._removeFactorGradient(this._emitRateGradients, e), this;
  }
  /**
   * Adds a new start size gradient (please note that this will only work if you set the targetStopDuration property)
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the start size value to affect to the specified gradient
   * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
   * @returns the current particle system
   */
  addStartSizeGradient(e, t, r) {
    return this._startSizeGradients || (this._startSizeGradients = []), this._addFactorGradient(this._startSizeGradients, e, t, r), this;
  }
  /**
   * Remove a specific start size gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeStartSizeGradient(e) {
    return this._removeFactorGradient(this._startSizeGradients, e), this;
  }
  _createRampGradientTexture() {
    if (!this._rampGradients || !this._rampGradients.length || this._rampGradientsTexture || !this._scene)
      return;
    const e = new Uint8Array(this._rawTextureWidth * 4), t = Hs.Color3[0];
    for (let r = 0; r < this._rawTextureWidth; r++) {
      const n = r / this._rawTextureWidth;
      kl.GetCurrentGradient(n, this._rampGradients, (i, s, a) => {
        Ne.LerpToRef(i.color, s.color, a, t), e[r * 4] = t.r * 255, e[r * 4 + 1] = t.g * 255, e[r * 4 + 2] = t.b * 255, e[r * 4 + 3] = 255;
      });
    }
    this._rampGradientsTexture = Bo.CreateRGBATexture(e, this._rawTextureWidth, 1, this._scene, !1, !1, 1);
  }
  /**
   * Gets the current list of ramp gradients.
   * You must use addRampGradient and removeRampGradient to update this list
   * @returns the list of ramp gradients
   */
  getRampGradients() {
    return this._rampGradients;
  }
  /** Force the system to rebuild all gradients that need to be resync */
  forceRefreshGradients() {
    this._syncRampGradientTexture();
  }
  _syncRampGradientTexture() {
    this._rampGradients && (this._rampGradients.sort((e, t) => e.gradient < t.gradient ? -1 : e.gradient > t.gradient ? 1 : 0), this._rampGradientsTexture && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), this._createRampGradientTexture());
  }
  /**
   * Adds a new ramp gradient used to remap particle colors
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param color defines the color to affect to the specified gradient
   * @returns the current particle system
   */
  addRampGradient(e, t) {
    this._rampGradients || (this._rampGradients = []);
    const r = new Jne(e, t);
    return this._rampGradients.push(r), this._syncRampGradientTexture(), this;
  }
  /**
   * Remove a specific ramp gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeRampGradient(e) {
    return this._removeGradientAndTexture(e, this._rampGradients, this._rampGradientsTexture), this._rampGradientsTexture = null, this._rampGradients && this._rampGradients.length > 0 && this._createRampGradientTexture(), this;
  }
  /**
   * Adds a new color gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param color1 defines the color to affect to the specified gradient
   * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from
   * @returns this particle system
   */
  addColorGradient(e, t, r) {
    this._colorGradients || (this._colorGradients = []);
    const n = new yY(e, t, r);
    return this._colorGradients.push(n), this._colorGradients.sort((i, s) => i.gradient < s.gradient ? -1 : i.gradient > s.gradient ? 1 : 0), this;
  }
  /**
   * Remove a specific color gradient
   * @param gradient defines the gradient to remove
   * @returns this particle system
   */
  removeColorGradient(e) {
    if (!this._colorGradients)
      return this;
    let t = 0;
    for (const r of this._colorGradients) {
      if (r.gradient === e) {
        this._colorGradients.splice(t, 1);
        break;
      }
      t++;
    }
    return this;
  }
  /**
   * Resets the draw wrappers cache
   */
  resetDrawCache() {
    for (const e of this._drawWrappers)
      if (e)
        for (const t of e)
          t == null || t.dispose();
    this._drawWrappers = [];
  }
  _fetchR(e, t, r, n, i) {
    e = Math.abs(e) * 0.5 + 0.5, t = Math.abs(t) * 0.5 + 0.5;
    const s = e * r % r | 0, a = t * n % n | 0, f = (s + a * r) * 4;
    return i[f] / 255;
  }
  _reset() {
    this._resetEffect();
  }
  _resetEffect() {
    this._vertexBuffer && (this._vertexBuffer.dispose(), this._vertexBuffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), this._createVertexBuffers();
  }
  _createVertexBuffers() {
    this._vertexBufferSize = this._useInstancing ? 10 : 12, this._isAnimationSheetEnabled && (this._vertexBufferSize += 1), (!this._isBillboardBased || this.billboardMode === ti.BILLBOARDMODE_STRETCHED || this.billboardMode === ti.BILLBOARDMODE_STRETCHED_LOCAL) && (this._vertexBufferSize += 3), this._useRampGradients && (this._vertexBufferSize += 4);
    const e = this._engine, t = this._vertexBufferSize * (this._useInstancing ? 1 : 4);
    this._vertexData = new Float32Array(this._capacity * t), this._vertexBuffer = new P9(e, this._vertexData, !0, t);
    let r = 0;
    const n = this._vertexBuffer.createVertexBuffer(J.PositionKind, r, 3, this._vertexBufferSize, this._useInstancing);
    this._vertexBuffers[J.PositionKind] = n, r += 3;
    const i = this._vertexBuffer.createVertexBuffer(J.ColorKind, r, 4, this._vertexBufferSize, this._useInstancing);
    this._vertexBuffers[J.ColorKind] = i, r += 4;
    const s = this._vertexBuffer.createVertexBuffer("angle", r, 1, this._vertexBufferSize, this._useInstancing);
    this._vertexBuffers.angle = s, r += 1;
    const a = this._vertexBuffer.createVertexBuffer("size", r, 2, this._vertexBufferSize, this._useInstancing);
    if (this._vertexBuffers.size = a, r += 2, this._isAnimationSheetEnabled) {
      const o = this._vertexBuffer.createVertexBuffer("cellIndex", r, 1, this._vertexBufferSize, this._useInstancing);
      this._vertexBuffers.cellIndex = o, r += 1;
    }
    if (!this._isBillboardBased || this.billboardMode === ti.BILLBOARDMODE_STRETCHED || this.billboardMode === ti.BILLBOARDMODE_STRETCHED_LOCAL) {
      const o = this._vertexBuffer.createVertexBuffer("direction", r, 3, this._vertexBufferSize, this._useInstancing);
      this._vertexBuffers.direction = o, r += 3;
    }
    if (this._useRampGradients) {
      const o = this._vertexBuffer.createVertexBuffer("remapData", r, 4, this._vertexBufferSize, this._useInstancing);
      this._vertexBuffers.remapData = o, r += 4;
    }
    let f;
    if (this._useInstancing) {
      const o = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]);
      this._spriteBuffer = new P9(e, o, !1, 2), f = this._spriteBuffer.createVertexBuffer("offset", 0, 2);
    } else
      f = this._vertexBuffer.createVertexBuffer("offset", r, 2, this._vertexBufferSize, this._useInstancing), r += 2;
    this._vertexBuffers.offset = f, this.resetDrawCache();
  }
  _createIndexBuffer() {
    if (this._useInstancing) {
      this._linesIndexBufferUseInstancing = this._engine.createIndexBuffer(new Uint32Array([0, 1, 1, 3, 3, 2, 2, 0, 0, 3]));
      return;
    }
    const e = [], t = [];
    let r = 0;
    for (let n = 0; n < this._capacity; n++)
      e.push(r), e.push(r + 1), e.push(r + 2), e.push(r), e.push(r + 2), e.push(r + 3), t.push(r, r + 1, r + 1, r + 2, r + 2, r + 3, r + 3, r, r, r + 3), r += 4;
    this._indexBuffer = this._engine.createIndexBuffer(e), this._linesIndexBuffer = this._engine.createIndexBuffer(t);
  }
  /**
   * Gets the maximum number of particles active at the same time.
   * @returns The max number of active particles.
   */
  getCapacity() {
    return this._capacity;
  }
  /**
   * Gets whether there are still active particles in the system.
   * @returns True if it is alive, otherwise false.
   */
  isAlive() {
    return this._alive;
  }
  /**
   * Gets if the system has been started. (Note: this will still be true after stop is called)
   * @returns True if it has been started, otherwise false.
   */
  isStarted() {
    return this._started;
  }
  _prepareSubEmitterInternalArray() {
    this._subEmitters = new Array(), this.subEmitters && this.subEmitters.forEach((e) => {
      e instanceof ti ? this._subEmitters.push([new vq(e)]) : e instanceof vq ? this._subEmitters.push([e]) : e instanceof Array && this._subEmitters.push(e);
    });
  }
  /**
   * Starts the particle system and begins to emit
   * @param delay defines the delay in milliseconds before starting the system (this.startDelay by default)
   */
  start(e = this.startDelay) {
    var t;
    if (!this.targetStopDuration && this._hasTargetStopDurationDependantGradient())
      throw "Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";
    if (e) {
      setTimeout(() => {
        this.start(0);
      }, e);
      return;
    }
    if (this._prepareSubEmitterInternalArray(), this._started = !0, this._stopped = !1, this._actualFrame = 0, this._subEmitters && this._subEmitters.length != 0 && (this.activeSubSystems = []), this._emitRateGradients && (this._emitRateGradients.length > 0 && (this._currentEmitRateGradient = this._emitRateGradients[0], this._currentEmitRate1 = this._currentEmitRateGradient.getFactor(), this._currentEmitRate2 = this._currentEmitRate1), this._emitRateGradients.length > 1 && (this._currentEmitRate2 = this._emitRateGradients[1].getFactor())), this._startSizeGradients && (this._startSizeGradients.length > 0 && (this._currentStartSizeGradient = this._startSizeGradients[0], this._currentStartSize1 = this._currentStartSizeGradient.getFactor(), this._currentStartSize2 = this._currentStartSize1), this._startSizeGradients.length > 1 && (this._currentStartSize2 = this._startSizeGradients[1].getFactor())), this.preWarmCycles) {
      ((t = this.emitter) === null || t === void 0 ? void 0 : t.getClassName().indexOf("Mesh")) !== -1 && this.emitter.computeWorldMatrix(!0);
      const r = this.noiseTexture;
      if (r && r.onGeneratedObservable)
        r.onGeneratedObservable.addOnce(() => {
          setTimeout(() => {
            for (let n = 0; n < this.preWarmCycles; n++)
              this.animate(!0), r.render();
          });
        });
      else
        for (let n = 0; n < this.preWarmCycles; n++)
          this.animate(!0);
    }
    this.beginAnimationOnStart && this.animations && this.animations.length > 0 && this._scene && this._scene.beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop);
  }
  /**
   * Stops the particle system.
   * @param stopSubEmitters if true it will stop the current system and all created sub-Systems if false it will stop the current root system only, this param is used by the root particle system only. the default value is true.
   */
  stop(e = !0) {
    this._stopped || (this.onStoppedObservable.notifyObservers(this), this._stopped = !0, e && this._stopSubEmitters());
  }
  // animation sheet
  /**
   * Remove all active particles
   */
  reset() {
    this._stockParticles.length = 0, this._particles.length = 0;
  }
  /**
   * @internal (for internal use only)
   */
  _appendParticleVertex(e, t, r, n) {
    let i = e * this._vertexBufferSize;
    if (this._vertexData[i++] = t.position.x + this.worldOffset.x, this._vertexData[i++] = t.position.y + this.worldOffset.y, this._vertexData[i++] = t.position.z + this.worldOffset.z, this._vertexData[i++] = t.color.r, this._vertexData[i++] = t.color.g, this._vertexData[i++] = t.color.b, this._vertexData[i++] = t.color.a, this._vertexData[i++] = t.angle, this._vertexData[i++] = t.scale.x * t.size, this._vertexData[i++] = t.scale.y * t.size, this._isAnimationSheetEnabled && (this._vertexData[i++] = t.cellIndex), this._isBillboardBased)
      (this.billboardMode === ti.BILLBOARDMODE_STRETCHED || this.billboardMode === ti.BILLBOARDMODE_STRETCHED_LOCAL) && (this._vertexData[i++] = t.direction.x, this._vertexData[i++] = t.direction.y, this._vertexData[i++] = t.direction.z);
    else if (t._initialDirection) {
      let s = t._initialDirection;
      this.isLocal && (S.TransformNormalToRef(s, this._emitterWorldMatrix, ue.Vector3[0]), s = ue.Vector3[0]), s.x === 0 && s.z === 0 && (s.x = 1e-3), this._vertexData[i++] = s.x, this._vertexData[i++] = s.y, this._vertexData[i++] = s.z;
    } else {
      let s = t.direction;
      this.isLocal && (S.TransformNormalToRef(s, this._emitterWorldMatrix, ue.Vector3[0]), s = ue.Vector3[0]), s.x === 0 && s.z === 0 && (s.x = 1e-3), this._vertexData[i++] = s.x, this._vertexData[i++] = s.y, this._vertexData[i++] = s.z;
    }
    this._useRampGradients && t.remapData && (this._vertexData[i++] = t.remapData.x, this._vertexData[i++] = t.remapData.y, this._vertexData[i++] = t.remapData.z, this._vertexData[i++] = t.remapData.w), this._useInstancing || (this._isAnimationSheetEnabled && (r === 0 ? r = this._epsilon : r === 1 && (r = 1 - this._epsilon), n === 0 ? n = this._epsilon : n === 1 && (n = 1 - this._epsilon)), this._vertexData[i++] = r, this._vertexData[i++] = n);
  }
  _stopSubEmitters() {
    this.activeSubSystems && (this.activeSubSystems.forEach((e) => {
      e.stop(!0);
    }), this.activeSubSystems = []);
  }
  _removeFromRoot() {
    if (!this._rootParticleSystem)
      return;
    const e = this._rootParticleSystem.activeSubSystems.indexOf(this);
    e !== -1 && this._rootParticleSystem.activeSubSystems.splice(e, 1), this._rootParticleSystem = null;
  }
  // End of sub system methods
  _update(e) {
    if (this._alive = this._particles.length > 0, this.emitter.position) {
      const r = this.emitter;
      this._emitterWorldMatrix = r.getWorldMatrix();
    } else {
      const r = this.emitter;
      this._emitterWorldMatrix = he.Translation(r.x, r.y, r.z);
    }
    this._emitterWorldMatrix.invertToRef(this._emitterInverseWorldMatrix), this.updateFunction(this._particles);
    let t;
    for (let r = 0; r < e && this._particles.length !== this._capacity; r++) {
      if (t = this._createParticle(), this._particles.push(t), this.targetStopDuration && this._lifeTimeGradients && this._lifeTimeGradients.length > 0) {
        const i = Xt.Clamp(this._actualFrame / this.targetStopDuration);
        kl.GetCurrentGradient(i, this._lifeTimeGradients, (s, a) => {
          const f = s, o = a, d = f.getFactor(), v = o.getFactor(), u = (i - f.gradient) / (o.gradient - f.gradient);
          t.lifeTime = Xt.Lerp(d, v, u);
        });
      } else
        t.lifeTime = Xt.RandomRange(this.minLifeTime, this.maxLifeTime);
      const n = Xt.RandomRange(this.minEmitPower, this.maxEmitPower);
      if (this.startPositionFunction ? this.startPositionFunction(this._emitterWorldMatrix, t.position, t, this.isLocal) : this.particleEmitterType.startPositionFunction(this._emitterWorldMatrix, t.position, t, this.isLocal), this.isLocal && (t._localPosition ? t._localPosition.copyFrom(t.position) : t._localPosition = t.position.clone(), S.TransformCoordinatesToRef(t._localPosition, this._emitterWorldMatrix, t.position)), this.startDirectionFunction ? this.startDirectionFunction(this._emitterWorldMatrix, t.direction, t, this.isLocal) : this.particleEmitterType.startDirectionFunction(this._emitterWorldMatrix, t.direction, t, this.isLocal, this._emitterInverseWorldMatrix), n === 0 ? t._initialDirection ? t._initialDirection.copyFrom(t.direction) : t._initialDirection = t.direction.clone() : t._initialDirection = null, t.direction.scaleInPlace(n), !this._sizeGradients || this._sizeGradients.length === 0 ? t.size = Xt.RandomRange(this.minSize, this.maxSize) : (t._currentSizeGradient = this._sizeGradients[0], t._currentSize1 = t._currentSizeGradient.getFactor(), t.size = t._currentSize1, this._sizeGradients.length > 1 ? t._currentSize2 = this._sizeGradients[1].getFactor() : t._currentSize2 = t._currentSize1), t.scale.copyFromFloats(Xt.RandomRange(this.minScaleX, this.maxScaleX), Xt.RandomRange(this.minScaleY, this.maxScaleY)), this._startSizeGradients && this._startSizeGradients[0] && this.targetStopDuration) {
        const i = this._actualFrame / this.targetStopDuration;
        kl.GetCurrentGradient(i, this._startSizeGradients, (s, a, f) => {
          s !== this._currentStartSizeGradient && (this._currentStartSize1 = this._currentStartSize2, this._currentStartSize2 = a.getFactor(), this._currentStartSizeGradient = s);
          const o = Xt.Lerp(this._currentStartSize1, this._currentStartSize2, f);
          t.scale.scaleInPlace(o);
        });
      }
      if (!this._angularSpeedGradients || this._angularSpeedGradients.length === 0 ? t.angularSpeed = Xt.RandomRange(this.minAngularSpeed, this.maxAngularSpeed) : (t._currentAngularSpeedGradient = this._angularSpeedGradients[0], t.angularSpeed = t._currentAngularSpeedGradient.getFactor(), t._currentAngularSpeed1 = t.angularSpeed, this._angularSpeedGradients.length > 1 ? t._currentAngularSpeed2 = this._angularSpeedGradients[1].getFactor() : t._currentAngularSpeed2 = t._currentAngularSpeed1), t.angle = Xt.RandomRange(this.minInitialRotation, this.maxInitialRotation), this._velocityGradients && this._velocityGradients.length > 0 && (t._currentVelocityGradient = this._velocityGradients[0], t._currentVelocity1 = t._currentVelocityGradient.getFactor(), this._velocityGradients.length > 1 ? t._currentVelocity2 = this._velocityGradients[1].getFactor() : t._currentVelocity2 = t._currentVelocity1), this._limitVelocityGradients && this._limitVelocityGradients.length > 0 && (t._currentLimitVelocityGradient = this._limitVelocityGradients[0], t._currentLimitVelocity1 = t._currentLimitVelocityGradient.getFactor(), this._limitVelocityGradients.length > 1 ? t._currentLimitVelocity2 = this._limitVelocityGradients[1].getFactor() : t._currentLimitVelocity2 = t._currentLimitVelocity1), this._dragGradients && this._dragGradients.length > 0 && (t._currentDragGradient = this._dragGradients[0], t._currentDrag1 = t._currentDragGradient.getFactor(), this._dragGradients.length > 1 ? t._currentDrag2 = this._dragGradients[1].getFactor() : t._currentDrag2 = t._currentDrag1), !this._colorGradients || this._colorGradients.length === 0) {
        const i = Xt.RandomRange(0, 1);
        xt.LerpToRef(this.color1, this.color2, i, t.color), this.colorDead.subtractToRef(t.color, this._colorDiff), this._colorDiff.scaleToRef(1 / t.lifeTime, t.colorStep);
      } else
        t._currentColorGradient = this._colorGradients[0], t._currentColorGradient.getColorToRef(t.color), t._currentColor1.copyFrom(t.color), this._colorGradients.length > 1 ? this._colorGradients[1].getColorToRef(t._currentColor2) : t._currentColor2.copyFrom(t.color);
      this._isAnimationSheetEnabled && (t._initialStartSpriteCellID = this.startSpriteCellID, t._initialEndSpriteCellID = this.endSpriteCellID, t._initialSpriteCellLoop = this.spriteCellLoop), t.direction.addInPlace(this._inheritedVelocityOffset), this._useRampGradients && (t.remapData = new Ir(0, 1, 0, 1)), this.noiseTexture && (t._randomNoiseCoordinates1 ? (t._randomNoiseCoordinates1.copyFromFloats(Math.random(), Math.random(), Math.random()), t._randomNoiseCoordinates2.copyFromFloats(Math.random(), Math.random(), Math.random())) : (t._randomNoiseCoordinates1 = new S(Math.random(), Math.random(), Math.random()), t._randomNoiseCoordinates2 = new S(Math.random(), Math.random(), Math.random()))), t._inheritParticleInfoToSubEmitters();
    }
  }
  /**
   * @internal
   */
  static _GetAttributeNamesOrOptions(e = !1, t = !1, r = !1) {
    const n = [J.PositionKind, J.ColorKind, "angle", "offset", "size"];
    return e && n.push("cellIndex"), t || n.push("direction"), r && n.push("remapData"), n;
  }
  /**
   * @internal
   */
  static _GetEffectCreationOptions(e = !1, t = !1) {
    const r = ["invView", "view", "projection", "textureMask", "translationPivot", "eyePosition"];
    return Mf(r), e && r.push("particlesInfos"), t && r.push("logarithmicDepthConstant"), r;
  }
  /**
   * Fill the defines array according to the current settings of the particle system
   * @param defines Array to be updated
   * @param blendMode blend mode to take into account when updating the array
   */
  fillDefines(e, t) {
    if (this._scene && xq(this, this._scene, e), this._isAnimationSheetEnabled && e.push("#define ANIMATESHEET"), this.useLogarithmicDepth && e.push("#define LOGARITHMICDEPTH"), t === ti.BLENDMODE_MULTIPLY && e.push("#define BLENDMULTIPLYMODE"), this._useRampGradients && e.push("#define RAMPGRADIENT"), this._isBillboardBased)
      switch (e.push("#define BILLBOARD"), this.billboardMode) {
        case ti.BILLBOARDMODE_Y:
          e.push("#define BILLBOARDY");
          break;
        case ti.BILLBOARDMODE_STRETCHED:
        case ti.BILLBOARDMODE_STRETCHED_LOCAL:
          e.push("#define BILLBOARDSTRETCHED"), this.billboardMode === ti.BILLBOARDMODE_STRETCHED_LOCAL && e.push("#define BILLBOARDSTRETCHED_LOCAL");
          break;
        case ti.BILLBOARDMODE_ALL:
          e.push("#define BILLBOARDMODE_ALL");
          break;
      }
    this._imageProcessingConfiguration && (this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines), e.push(this._imageProcessingConfigurationDefines.toString()));
  }
  /**
   * Fill the uniforms, attributes and samplers arrays according to the current settings of the particle system
   * @param uniforms Uniforms array to fill
   * @param attributes Attributes array to fill
   * @param samplers Samplers array to fill
   */
  fillUniformsAttributesAndSamplerNames(e, t, r) {
    t.push(...ti._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled, this._isBillboardBased && this.billboardMode !== ti.BILLBOARDMODE_STRETCHED && this.billboardMode !== ti.BILLBOARDMODE_STRETCHED_LOCAL, this._useRampGradients)), e.push(...ti._GetEffectCreationOptions(this._isAnimationSheetEnabled, this.useLogarithmicDepth)), r.push("diffuseSampler", "rampSampler"), this._imageProcessingConfiguration && (Ui.PrepareUniforms(e, this._imageProcessingConfigurationDefines), Ui.PrepareSamplers(r, this._imageProcessingConfigurationDefines));
  }
  /**
   * @internal
   */
  _getWrapper(e) {
    const t = this._getCustomDrawWrapper(e);
    if (t != null && t.effect)
      return t;
    const r = [];
    this.fillDefines(r, e);
    const n = this._engine._features.supportRenderPasses ? this._engine.currentRenderPassId : 0;
    let i = this._drawWrappers[n];
    i || (i = this._drawWrappers[n] = []);
    let s = i[e];
    s || (s = new zo(this._engine), s.drawContext && (s.drawContext.useInstancing = this._useInstancing), i[e] = s);
    const a = r.join(`
`);
    if (s.defines !== a) {
      const f = [], o = [], d = [];
      this.fillUniformsAttributesAndSamplerNames(o, f, d), s.setEffect(this._engine.createEffect("particles", f, o, d, a), a);
    }
    return s;
  }
  /**
   * Animates the particle system for the current frame by emitting new particles and or animating the living ones.
   * @param preWarmOnly will prevent the system from updating the vertex buffer (default is false)
   */
  animate(e = !1) {
    var t;
    if (!this._started)
      return;
    if (!e && this._scene) {
      if (!this.isReady() || this._currentRenderId === this._scene.getFrameId())
        return;
      this._currentRenderId = this._scene.getFrameId();
    }
    this._scaledUpdateSpeed = this.updateSpeed * (e ? this.preWarmStepOffset : ((t = this._scene) === null || t === void 0 ? void 0 : t.getAnimationRatio()) || 1);
    let r;
    if (this.manualEmitCount > -1)
      r = this.manualEmitCount, this._newPartsExcess = 0, this.manualEmitCount = 0;
    else {
      let n = this.emitRate;
      if (this._emitRateGradients && this._emitRateGradients.length > 0 && this.targetStopDuration) {
        const i = this._actualFrame / this.targetStopDuration;
        kl.GetCurrentGradient(i, this._emitRateGradients, (s, a, f) => {
          s !== this._currentEmitRateGradient && (this._currentEmitRate1 = this._currentEmitRate2, this._currentEmitRate2 = a.getFactor(), this._currentEmitRateGradient = s), n = Xt.Lerp(this._currentEmitRate1, this._currentEmitRate2, f);
        });
      }
      r = n * this._scaledUpdateSpeed >> 0, this._newPartsExcess += n * this._scaledUpdateSpeed - r;
    }
    if (this._newPartsExcess > 1 && (r += this._newPartsExcess >> 0, this._newPartsExcess -= this._newPartsExcess >> 0), this._alive = !1, this._stopped ? r = 0 : (this._actualFrame += this._scaledUpdateSpeed, this.targetStopDuration && this._actualFrame >= this.targetStopDuration && this.stop()), this._update(r), this._stopped && (this._alive || (this._started = !1, this.onAnimationEnd && this.onAnimationEnd(), this.disposeOnStop && this._scene && this._scene._toBeDisposed.push(this))), !e) {
      let n = 0;
      for (let i = 0; i < this._particles.length; i++) {
        const s = this._particles[i];
        this._appendParticleVertices(n, s), n += this._useInstancing ? 1 : 4;
      }
      this._vertexBuffer && this._vertexBuffer.updateDirectly(this._vertexData, 0, this._particles.length);
    }
    this.manualEmitCount === 0 && this.disposeOnStop && this.stop();
  }
  _appendParticleVertices(e, t) {
    this._appendParticleVertex(e++, t, 0, 0), this._useInstancing || (this._appendParticleVertex(e++, t, 1, 0), this._appendParticleVertex(e++, t, 1, 1), this._appendParticleVertex(e++, t, 0, 1));
  }
  /**
   * Rebuilds the particle system.
   */
  rebuild() {
    var e, t;
    this._engine.getCaps().vertexArrayObject && (this._vertexArrayObject = null), this._createIndexBuffer(), (e = this._spriteBuffer) === null || e === void 0 || e._rebuild(), (t = this._vertexBuffer) === null || t === void 0 || t._rebuild();
    for (const r in this._vertexBuffers)
      this._vertexBuffers[r]._rebuild();
    this.resetDrawCache();
  }
  /**
   * Is this system ready to be used/rendered
   * @returns true if the system is ready
   */
  isReady() {
    if (!this.emitter || this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady() || !this.particleTexture || !this.particleTexture.isReady())
      return !1;
    if (this.blendMode !== ti.BLENDMODE_MULTIPLYADD) {
      if (!this._getWrapper(this.blendMode).effect.isReady())
        return !1;
    } else if (!this._getWrapper(ti.BLENDMODE_MULTIPLY).effect.isReady() || !this._getWrapper(ti.BLENDMODE_ADD).effect.isReady())
      return !1;
    return !0;
  }
  _render(e) {
    var t, r, n, i, s, a, f, o;
    const d = this._getWrapper(e), v = d.effect, u = this._engine;
    u.enableEffect(d);
    const l = (t = this.defaultViewMatrix) !== null && t !== void 0 ? t : this._scene.getViewMatrix();
    if (v.setTexture("diffuseSampler", this.particleTexture), v.setMatrix("view", l), v.setMatrix("projection", (r = this.defaultProjectionMatrix) !== null && r !== void 0 ? r : this._scene.getProjectionMatrix()), this._isAnimationSheetEnabled && this.particleTexture) {
      const p = this.particleTexture.getBaseSize();
      v.setFloat3("particlesInfos", this.spriteCellWidth / p.width, this.spriteCellHeight / p.height, this.spriteCellWidth / p.width);
    }
    if (v.setVector2("translationPivot", this.translationPivot), v.setFloat4("textureMask", this.textureMask.r, this.textureMask.g, this.textureMask.b, this.textureMask.a), this._isBillboardBased && this._scene) {
      const p = this._scene.activeCamera;
      v.setVector3("eyePosition", p.globalPosition);
    }
    this._rampGradientsTexture && ((!this._rampGradients || !this._rampGradients.length) && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), v.setTexture("rampSampler", this._rampGradientsTexture));
    const P = v.defines;
    switch (this._scene && Df(v, this, this._scene), P.indexOf("#define BILLBOARDMODE_ALL") >= 0 && (l.invertToRef(ue.Matrix[0]), v.setMatrix("invView", ue.Matrix[0])), this._vertexArrayObject !== void 0 ? !((n = this._scene) === null || n === void 0) && n.forceWireframe ? u.bindBuffers(this._vertexBuffers, this._linesIndexBufferUseInstancing, v) : (this._vertexArrayObject || (this._vertexArrayObject = this._engine.recordVertexArrayObject(this._vertexBuffers, null, v)), this._engine.bindVertexArrayObject(this._vertexArrayObject, !((i = this._scene) === null || i === void 0) && i.forceWireframe ? this._linesIndexBufferUseInstancing : this._indexBuffer)) : this._indexBuffer ? u.bindBuffers(this._vertexBuffers, !((a = this._scene) === null || a === void 0) && a.forceWireframe ? this._linesIndexBuffer : this._indexBuffer, v) : u.bindBuffers(this._vertexBuffers, !((s = this._scene) === null || s === void 0) && s.forceWireframe ? this._linesIndexBufferUseInstancing : null, v), this.useLogarithmicDepth && this._scene && Ye.BindLogDepth(P, v, this._scene), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(v), e) {
      case ti.BLENDMODE_ADD:
        u.setAlphaMode(1);
        break;
      case ti.BLENDMODE_ONEONE:
        u.setAlphaMode(6);
        break;
      case ti.BLENDMODE_STANDARD:
        u.setAlphaMode(2);
        break;
      case ti.BLENDMODE_MULTIPLY:
        u.setAlphaMode(4);
        break;
    }
    return this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.notifyObservers(v), this._useInstancing ? !((f = this._scene) === null || f === void 0) && f.forceWireframe ? u.drawElementsType(6, 0, 10, this._particles.length) : u.drawArraysType(7, 0, 4, this._particles.length) : !((o = this._scene) === null || o === void 0) && o.forceWireframe ? u.drawElementsType(1, 0, this._particles.length * 10) : u.drawElementsType(0, 0, this._particles.length * 6), this._particles.length;
  }
  /**
   * Renders the particle system in its current state.
   * @returns the current number of particles
   */
  render() {
    if (!this.isReady() || !this._particles.length)
      return 0;
    const e = this._engine;
    e.setState && (e.setState(!1), this.forceDepthWrite && e.setDepthWrite(!0));
    let t = 0;
    return this.blendMode === ti.BLENDMODE_MULTIPLYADD ? t = this._render(ti.BLENDMODE_MULTIPLY) + this._render(ti.BLENDMODE_ADD) : t = this._render(this.blendMode), this._engine.unbindInstanceAttributes(), this._engine.setAlphaMode(0), t;
  }
  /**
   * Disposes the particle system and free the associated resources
   * @param disposeTexture defines if the particle texture must be disposed as well (true by default)
   */
  dispose(e = !0) {
    if (this.resetDrawCache(), this._vertexBuffer && (this._vertexBuffer.dispose(), this._vertexBuffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._indexBuffer && (this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._linesIndexBuffer && (this._engine._releaseBuffer(this._linesIndexBuffer), this._linesIndexBuffer = null), this._linesIndexBufferUseInstancing && (this._engine._releaseBuffer(this._linesIndexBufferUseInstancing), this._linesIndexBufferUseInstancing = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), e && this.particleTexture && (this.particleTexture.dispose(), this.particleTexture = null), e && this.noiseTexture && (this.noiseTexture.dispose(), this.noiseTexture = null), this._rampGradientsTexture && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), this._removeFromRoot(), this.subEmitters && !this._subEmitters && this._prepareSubEmitterInternalArray(), this._subEmitters && this._subEmitters.length) {
      for (let t = 0; t < this._subEmitters.length; t++)
        for (const r of this._subEmitters[t])
          r.dispose();
      this._subEmitters = [], this.subEmitters = [];
    }
    if (this._disposeEmitterOnDispose && this.emitter && this.emitter.dispose && this.emitter.dispose(!0), this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.clear(), this._scene) {
      const t = this._scene.particleSystems.indexOf(this);
      t > -1 && this._scene.particleSystems.splice(t, 1), this._scene._activeParticleSystems.dispose();
    }
    this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onStoppedObservable.clear(), this.reset();
  }
  // Clone
  /**
   * Clones the particle system.
   * @param name The name of the cloned object
   * @param newEmitter The new emitter to use
   * @param cloneTexture Also clone the textures if true
   * @returns the cloned particle system
   */
  clone(e, t, r = !1) {
    const n = Object.assign({}, this._customWrappers);
    let i = null;
    const s = this._engine;
    if (s.createEffectForParticles && this.customShader != null) {
      i = this.customShader;
      const o = i.shaderOptions.defines.length > 0 ? i.shaderOptions.defines.join(`
`) : "", d = s.createEffectForParticles(i.shaderPath.fragmentElement, i.shaderOptions.uniforms, i.shaderOptions.samplers, o);
      n[0] ? n[0].effect = d : this.setCustomEffect(d, 0);
    }
    const a = this.serialize(r), f = ti.Parse(a, this._scene || this._engine, this._rootUrl);
    return f.name = e, f.customShader = i, f._customWrappers = n, t === void 0 && (t = this.emitter), this.noiseTexture && (f.noiseTexture = this.noiseTexture.clone()), f.emitter = t, this.preventAutoStart || f.start(), f;
  }
  /**
   * Serializes the particle system to a JSON object
   * @param serializeTexture defines if the texture must be serialized as well
   * @returns the JSON object
   */
  serialize(e = !1) {
    const t = {};
    if (ti._Serialize(t, this, e), t.textureMask = this.textureMask.asArray(), t.customShader = this.customShader, t.preventAutoStart = this.preventAutoStart, this.subEmitters) {
      t.subEmitters = [], this._subEmitters || this._prepareSubEmitterInternalArray();
      for (const r of this._subEmitters) {
        const n = [];
        for (const i of r)
          n.push(i.serialize(e));
        t.subEmitters.push(n);
      }
    }
    return t;
  }
  /**
   * @internal
   */
  static _Serialize(e, t, r) {
    if (e.name = t.name, e.id = t.id, e.capacity = t.getCapacity(), e.disposeOnStop = t.disposeOnStop, e.manualEmitCount = t.manualEmitCount, t.emitter.position) {
      const c = t.emitter;
      e.emitterId = c.id;
    } else {
      const c = t.emitter;
      e.emitter = c.asArray();
    }
    t.particleEmitterType && (e.particleEmitterType = t.particleEmitterType.serialize()), t.particleTexture && (r ? e.texture = t.particleTexture.serialize() : (e.textureName = t.particleTexture.name, e.invertY = !!t.particleTexture._invertY)), e.isLocal = t.isLocal, jt.AppendSerializedAnimations(t, e), e.beginAnimationOnStart = t.beginAnimationOnStart, e.beginAnimationFrom = t.beginAnimationFrom, e.beginAnimationTo = t.beginAnimationTo, e.beginAnimationLoop = t.beginAnimationLoop, e.startDelay = t.startDelay, e.renderingGroupId = t.renderingGroupId, e.isBillboardBased = t.isBillboardBased, e.billboardMode = t.billboardMode, e.minAngularSpeed = t.minAngularSpeed, e.maxAngularSpeed = t.maxAngularSpeed, e.minSize = t.minSize, e.maxSize = t.maxSize, e.minScaleX = t.minScaleX, e.maxScaleX = t.maxScaleX, e.minScaleY = t.minScaleY, e.maxScaleY = t.maxScaleY, e.minEmitPower = t.minEmitPower, e.maxEmitPower = t.maxEmitPower, e.minLifeTime = t.minLifeTime, e.maxLifeTime = t.maxLifeTime, e.emitRate = t.emitRate, e.gravity = t.gravity.asArray(), e.noiseStrength = t.noiseStrength.asArray(), e.color1 = t.color1.asArray(), e.color2 = t.color2.asArray(), e.colorDead = t.colorDead.asArray(), e.updateSpeed = t.updateSpeed, e.targetStopDuration = t.targetStopDuration, e.blendMode = t.blendMode, e.preWarmCycles = t.preWarmCycles, e.preWarmStepOffset = t.preWarmStepOffset, e.minInitialRotation = t.minInitialRotation, e.maxInitialRotation = t.maxInitialRotation, e.startSpriteCellID = t.startSpriteCellID, e.spriteCellLoop = t.spriteCellLoop, e.endSpriteCellID = t.endSpriteCellID, e.spriteCellChangeSpeed = t.spriteCellChangeSpeed, e.spriteCellWidth = t.spriteCellWidth, e.spriteCellHeight = t.spriteCellHeight, e.spriteRandomStartCell = t.spriteRandomStartCell, e.isAnimationSheetEnabled = t.isAnimationSheetEnabled, e.useLogarithmicDepth = t.useLogarithmicDepth;
    const n = t.getColorGradients();
    if (n) {
      e.colorGradients = [];
      for (const c of n) {
        const H = {
          gradient: c.gradient,
          color1: c.color1.asArray()
        };
        c.color2 ? H.color2 = c.color2.asArray() : H.color2 = c.color1.asArray(), e.colorGradients.push(H);
      }
    }
    const i = t.getRampGradients();
    if (i) {
      e.rampGradients = [];
      for (const c of i) {
        const H = {
          gradient: c.gradient,
          color: c.color.asArray()
        };
        e.rampGradients.push(H);
      }
      e.useRampGradients = t.useRampGradients;
    }
    const s = t.getColorRemapGradients();
    if (s) {
      e.colorRemapGradients = [];
      for (const c of s) {
        const H = {
          gradient: c.gradient,
          factor1: c.factor1
        };
        c.factor2 !== void 0 ? H.factor2 = c.factor2 : H.factor2 = c.factor1, e.colorRemapGradients.push(H);
      }
    }
    const a = t.getAlphaRemapGradients();
    if (a) {
      e.alphaRemapGradients = [];
      for (const c of a) {
        const H = {
          gradient: c.gradient,
          factor1: c.factor1
        };
        c.factor2 !== void 0 ? H.factor2 = c.factor2 : H.factor2 = c.factor1, e.alphaRemapGradients.push(H);
      }
    }
    const f = t.getSizeGradients();
    if (f) {
      e.sizeGradients = [];
      for (const c of f) {
        const H = {
          gradient: c.gradient,
          factor1: c.factor1
        };
        c.factor2 !== void 0 ? H.factor2 = c.factor2 : H.factor2 = c.factor1, e.sizeGradients.push(H);
      }
    }
    const o = t.getAngularSpeedGradients();
    if (o) {
      e.angularSpeedGradients = [];
      for (const c of o) {
        const H = {
          gradient: c.gradient,
          factor1: c.factor1
        };
        c.factor2 !== void 0 ? H.factor2 = c.factor2 : H.factor2 = c.factor1, e.angularSpeedGradients.push(H);
      }
    }
    const d = t.getVelocityGradients();
    if (d) {
      e.velocityGradients = [];
      for (const c of d) {
        const H = {
          gradient: c.gradient,
          factor1: c.factor1
        };
        c.factor2 !== void 0 ? H.factor2 = c.factor2 : H.factor2 = c.factor1, e.velocityGradients.push(H);
      }
    }
    const v = t.getDragGradients();
    if (v) {
      e.dragGradients = [];
      for (const c of v) {
        const H = {
          gradient: c.gradient,
          factor1: c.factor1
        };
        c.factor2 !== void 0 ? H.factor2 = c.factor2 : H.factor2 = c.factor1, e.dragGradients.push(H);
      }
    }
    const u = t.getEmitRateGradients();
    if (u) {
      e.emitRateGradients = [];
      for (const c of u) {
        const H = {
          gradient: c.gradient,
          factor1: c.factor1
        };
        c.factor2 !== void 0 ? H.factor2 = c.factor2 : H.factor2 = c.factor1, e.emitRateGradients.push(H);
      }
    }
    const l = t.getStartSizeGradients();
    if (l) {
      e.startSizeGradients = [];
      for (const c of l) {
        const H = {
          gradient: c.gradient,
          factor1: c.factor1
        };
        c.factor2 !== void 0 ? H.factor2 = c.factor2 : H.factor2 = c.factor1, e.startSizeGradients.push(H);
      }
    }
    const P = t.getLifeTimeGradients();
    if (P) {
      e.lifeTimeGradients = [];
      for (const c of P) {
        const H = {
          gradient: c.gradient,
          factor1: c.factor1
        };
        c.factor2 !== void 0 ? H.factor2 = c.factor2 : H.factor2 = c.factor1, e.lifeTimeGradients.push(H);
      }
    }
    const p = t.getLimitVelocityGradients();
    if (p) {
      e.limitVelocityGradients = [];
      for (const c of p) {
        const H = {
          gradient: c.gradient,
          factor1: c.factor1
        };
        c.factor2 !== void 0 ? H.factor2 = c.factor2 : H.factor2 = c.factor1, e.limitVelocityGradients.push(H);
      }
      e.limitVelocityDamping = t.limitVelocityDamping;
    }
    t.noiseTexture && (e.noiseTexture = t.noiseTexture.serialize());
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    var i, s, a;
    let f;
    r instanceof hr ? f = null : f = r;
    const o = Jo("BABYLON.Texture");
    if (o && f && (e.texture ? t.particleTexture = o.Parse(e.texture, f, n) : e.textureName && (t.particleTexture = new o(n + e.textureName, f, !1, e.invertY !== void 0 ? e.invertY : !0), t.particleTexture.name = e.textureName)), !e.emitterId && e.emitterId !== 0 && e.emitter === void 0 ? t.emitter = S.Zero() : e.emitterId && f ? t.emitter = f.getLastMeshById(e.emitterId) : t.emitter = S.FromArray(e.emitter), t.isLocal = !!e.isLocal, e.renderingGroupId !== void 0 && (t.renderingGroupId = e.renderingGroupId), e.isBillboardBased !== void 0 && (t.isBillboardBased = e.isBillboardBased), e.billboardMode !== void 0 && (t.billboardMode = e.billboardMode), e.useLogarithmicDepth !== void 0 && (t.useLogarithmicDepth = e.useLogarithmicDepth), e.animations) {
      for (let v = 0; v < e.animations.length; v++) {
        const u = e.animations[v], l = Jo("BABYLON.Animation");
        l && t.animations.push(l.Parse(u));
      }
      t.beginAnimationOnStart = e.beginAnimationOnStart, t.beginAnimationFrom = e.beginAnimationFrom, t.beginAnimationTo = e.beginAnimationTo, t.beginAnimationLoop = e.beginAnimationLoop;
    }
    if (e.autoAnimate && f && f.beginAnimation(t, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1), t.startDelay = e.startDelay | 0, t.minAngularSpeed = e.minAngularSpeed, t.maxAngularSpeed = e.maxAngularSpeed, t.minSize = e.minSize, t.maxSize = e.maxSize, e.minScaleX && (t.minScaleX = e.minScaleX, t.maxScaleX = e.maxScaleX, t.minScaleY = e.minScaleY, t.maxScaleY = e.maxScaleY), e.preWarmCycles !== void 0 && (t.preWarmCycles = e.preWarmCycles, t.preWarmStepOffset = e.preWarmStepOffset), e.minInitialRotation !== void 0 && (t.minInitialRotation = e.minInitialRotation, t.maxInitialRotation = e.maxInitialRotation), t.minLifeTime = e.minLifeTime, t.maxLifeTime = e.maxLifeTime, t.minEmitPower = e.minEmitPower, t.maxEmitPower = e.maxEmitPower, t.emitRate = e.emitRate, t.gravity = S.FromArray(e.gravity), e.noiseStrength && (t.noiseStrength = S.FromArray(e.noiseStrength)), t.color1 = xt.FromArray(e.color1), t.color2 = xt.FromArray(e.color2), t.colorDead = xt.FromArray(e.colorDead), t.updateSpeed = e.updateSpeed, t.targetStopDuration = e.targetStopDuration, t.blendMode = e.blendMode, e.colorGradients)
      for (const v of e.colorGradients)
        t.addColorGradient(v.gradient, xt.FromArray(v.color1), v.color2 ? xt.FromArray(v.color2) : void 0);
    if (e.rampGradients) {
      for (const v of e.rampGradients)
        t.addRampGradient(v.gradient, Ne.FromArray(v.color));
      t.useRampGradients = e.useRampGradients;
    }
    if (e.colorRemapGradients)
      for (const v of e.colorRemapGradients)
        t.addColorRemapGradient(v.gradient, v.factor1 !== void 0 ? v.factor1 : v.factor, v.factor2);
    if (e.alphaRemapGradients)
      for (const v of e.alphaRemapGradients)
        t.addAlphaRemapGradient(v.gradient, v.factor1 !== void 0 ? v.factor1 : v.factor, v.factor2);
    if (e.sizeGradients)
      for (const v of e.sizeGradients)
        t.addSizeGradient(v.gradient, v.factor1 !== void 0 ? v.factor1 : v.factor, v.factor2);
    if (e.angularSpeedGradients)
      for (const v of e.angularSpeedGradients)
        t.addAngularSpeedGradient(v.gradient, v.factor1 !== void 0 ? v.factor1 : v.factor, v.factor2);
    if (e.velocityGradients)
      for (const v of e.velocityGradients)
        t.addVelocityGradient(v.gradient, v.factor1 !== void 0 ? v.factor1 : v.factor, v.factor2);
    if (e.dragGradients)
      for (const v of e.dragGradients)
        t.addDragGradient(v.gradient, v.factor1 !== void 0 ? v.factor1 : v.factor, v.factor2);
    if (e.emitRateGradients)
      for (const v of e.emitRateGradients)
        t.addEmitRateGradient(v.gradient, v.factor1 !== void 0 ? v.factor1 : v.factor, v.factor2);
    if (e.startSizeGradients)
      for (const v of e.startSizeGradients)
        t.addStartSizeGradient(v.gradient, v.factor1 !== void 0 ? v.factor1 : v.factor, v.factor2);
    if (e.lifeTimeGradients)
      for (const v of e.lifeTimeGradients)
        t.addLifeTimeGradient(v.gradient, v.factor1 !== void 0 ? v.factor1 : v.factor, v.factor2);
    if (e.limitVelocityGradients) {
      for (const v of e.limitVelocityGradients)
        t.addLimitVelocityGradient(v.gradient, v.factor1 !== void 0 ? v.factor1 : v.factor, v.factor2);
      t.limitVelocityDamping = e.limitVelocityDamping;
    }
    if (e.noiseTexture && f) {
      const v = Jo("BABYLON.ProceduralTexture");
      t.noiseTexture = v.Parse(e.noiseTexture, f, n);
    }
    let d;
    if (e.particleEmitterType) {
      switch (e.particleEmitterType.type) {
        case "SphereParticleEmitter":
          d = new oU();
          break;
        case "SphereDirectedParticleEmitter":
          d = new SR();
          break;
        case "ConeEmitter":
        case "ConeParticleEmitter":
          d = new wR();
          break;
        case "CylinderParticleEmitter":
          d = new aU();
          break;
        case "CylinderDirectedParticleEmitter":
          d = new mR();
          break;
        case "HemisphericParticleEmitter":
          d = new BR();
          break;
        case "PointParticleEmitter":
          d = new WR();
          break;
        case "MeshParticleEmitter":
          d = new IO();
          break;
        case "BoxEmitter":
        case "BoxParticleEmitter":
        default:
          d = new AD();
          break;
      }
      d.parse(e.particleEmitterType, f);
    } else
      d = new AD(), d.parse(e, f);
    t.particleEmitterType = d, t.startSpriteCellID = e.startSpriteCellID, t.endSpriteCellID = e.endSpriteCellID, t.spriteCellLoop = (i = e.spriteCellLoop) !== null && i !== void 0 ? i : !0, t.spriteCellWidth = e.spriteCellWidth, t.spriteCellHeight = e.spriteCellHeight, t.spriteCellChangeSpeed = e.spriteCellChangeSpeed, t.spriteRandomStartCell = e.spriteRandomStartCell, t.disposeOnStop = (s = e.disposeOnStop) !== null && s !== void 0 ? s : !1, t.manualEmitCount = (a = e.manualEmitCount) !== null && a !== void 0 ? a : -1;
  }
  /**
   * Parses a JSON object to create a particle system.
   * @param parsedParticleSystem The JSON object to parse
   * @param sceneOrEngine The scene or the engine to create the particle system in
   * @param rootUrl The root url to use to load external dependencies like texture
   * @param doNotStart Ignore the preventAutoStart attribute and does not start
   * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
   * @returns the Parsed particle system
   */
  static Parse(e, t, r, n = !1, i) {
    const s = e.name;
    let a = null, f = null, o, d;
    if (t instanceof hr ? o = t : (d = t, o = d.getEngine()), e.customShader && o.createEffectForParticles) {
      f = e.customShader;
      const u = f.shaderOptions.defines.length > 0 ? f.shaderOptions.defines.join(`
`) : "";
      a = o.createEffectForParticles(f.shaderPath.fragmentElement, f.shaderOptions.uniforms, f.shaderOptions.samplers, u);
    }
    const v = new ti(s, i || e.capacity, t, a, e.isAnimationSheetEnabled);
    if (v.customShader = f, v._rootUrl = r, e.id && (v.id = e.id), e.subEmitters) {
      v.subEmitters = [];
      for (const u of e.subEmitters) {
        const l = [];
        for (const P of u)
          l.push(vq.Parse(P, t, r));
        v.subEmitters.push(l);
      }
    }
    return ti._Parse(e, v, t, r), e.textureMask && (v.textureMask = xt.FromArray(e.textureMask)), e.preventAutoStart && (v.preventAutoStart = e.preventAutoStart), !n && !v.preventAutoStart && v.start(), v;
  }
}
ti.BILLBOARDMODE_Y = 2;
ti.BILLBOARDMODE_ALL = 7;
ti.BILLBOARDMODE_STRETCHED = 8;
ti.BILLBOARDMODE_STRETCHED_LOCAL = 9;
vq._ParseParticleSystem = ti.Parse;
const Ehe = "clipPlaneFragmentDeclaration2", Fhe = `#ifdef CLIPPLANE
in float fClipDistance;
#endif
#ifdef CLIPPLANE2
in float fClipDistance2;
#endif
#ifdef CLIPPLANE3
in float fClipDistance3;
#endif
#ifdef CLIPPLANE4
in float fClipDistance4;
#endif
#ifdef CLIPPLANE5
in float fClipDistance5;
#endif
#ifdef CLIPPLANE6
in float fClipDistance6;
#endif
`;
Le.IncludesShadersStore[Ehe] = Fhe;
const Nhe = "gpuRenderParticlesPixelShader", Qhe = `precision highp float;
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
uniform sampler2D diffuseSampler;varying vec2 vUV;varying vec4 vColor;
#include<clipPlaneFragmentDeclaration2> 
#include<imageProcessingDeclaration>
#include<logDepthDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
void main() {
#include<clipPlaneFragment> 
vec4 textureColor=texture2D(diffuseSampler,vUV);gl_FragColor=textureColor*vColor;
#ifdef BLENDMULTIPLYMODE
float alpha=vColor.a*textureColor.a;gl_FragColor.rgb=gl_FragColor.rgb*alpha+vec3(1.0)*(1.0-alpha);
#endif 
#include<logDepthFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
gl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);
#else
#ifdef IMAGEPROCESSING
gl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);gl_FragColor=applyImageProcessing(gl_FragColor);
#endif
#endif
}
`;
Le.ShadersStore[Nhe] = Qhe;
const Yhe = "clipPlaneVertexDeclaration2", Mhe = `#ifdef CLIPPLANE
uniform vec4 vClipPlane;out float fClipDistance;
#endif
#ifdef CLIPPLANE2
uniform vec4 vClipPlane2;out float fClipDistance2;
#endif
#ifdef CLIPPLANE3
uniform vec4 vClipPlane3;out float fClipDistance3;
#endif
#ifdef CLIPPLANE4
uniform vec4 vClipPlane4;out float fClipDistance4;
#endif
#ifdef CLIPPLANE5
uniform vec4 vClipPlane5;out float fClipDistance5;
#endif
#ifdef CLIPPLANE6
uniform vec4 vClipPlane6;out float fClipDistance6;
#endif
`;
Le.IncludesShadersStore[Yhe] = Mhe;
const Lhe = "gpuRenderParticlesVertexShader", Khe = `precision highp float;uniform mat4 view;uniform mat4 projection;uniform vec2 translationPivot;uniform vec3 worldOffset;
#ifdef LOCAL
uniform mat4 emitterWM;
#endif
attribute vec3 position;attribute float age;attribute float life;attribute vec3 size;
#ifndef BILLBOARD
attribute vec3 initialDirection;
#endif
#ifdef BILLBOARDSTRETCHED
attribute vec3 direction;
#endif
attribute float angle;
#ifdef ANIMATESHEET
attribute float cellIndex;
#endif
attribute vec2 offset;attribute vec2 uv;varying vec2 vUV;varying vec4 vColor;varying vec3 vPositionW;
#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)
uniform mat4 invView;
#endif
#include<clipPlaneVertexDeclaration2>
#include<logDepthDeclaration>
#ifdef COLORGRADIENTS
uniform sampler2D colorGradientSampler;
#else
uniform vec4 colorDead;attribute vec4 color;
#endif
#ifdef ANIMATESHEET
uniform vec3 sheetInfos;
#endif
#ifdef BILLBOARD
uniform vec3 eyePosition;
#endif
vec3 rotate(vec3 yaxis,vec3 rotatedCorner) {vec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));vec3 zaxis=normalize(cross(yaxis,xaxis));vec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);vec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);vec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;
#ifdef LOCAL
return ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;
#else
return (position+worldOffset)+alignedCorner;
#endif
}
#ifdef BILLBOARDSTRETCHED
vec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {vec3 normalizedToCamera=normalize(toCamera);vec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));vec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));vec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);vec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);vec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;
#ifdef LOCAL
return ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;
#else
return (position+worldOffset)+alignedCorner;
#endif
}
#endif
void main() {
#ifdef ANIMATESHEET
float rowOffset=floor(cellIndex/sheetInfos.z);float columnOffset=cellIndex-rowOffset*sheetInfos.z;vec2 uvScale=sheetInfos.xy;vec2 uvOffset=vec2(uv.x ,1.0-uv.y);vUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;
#else
vUV=uv;
#endif
float ratio=age/life;
#ifdef COLORGRADIENTS
vColor=texture2D(colorGradientSampler,vec2(ratio,0));
#else
vColor=color*vec4(1.0-ratio)+colorDead*vec4(ratio);
#endif
vec2 cornerPos=(offset-translationPivot)*size.yz*size.x;
#ifdef BILLBOARD
vec4 rotatedCorner;rotatedCorner.w=0.;
#ifdef BILLBOARDY
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.y=0.;rotatedCorner.xz+=translationPivot;vec3 yaxis=(position+worldOffset)-eyePosition;yaxis.y=0.;vPositionW=rotate(normalize(yaxis),rotatedCorner.xyz);vec4 viewPosition=(view*vec4(vPositionW,1.0));
#elif defined(BILLBOARDSTRETCHED)
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;vec3 toCamera=(position+worldOffset)-eyePosition;vPositionW=rotateAlign(toCamera,rotatedCorner.xyz);vec4 viewPosition=(view*vec4(vPositionW,1.0));
#else
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;
#ifdef LOCAL
vec4 viewPosition=view*vec4(((emitterWM*vec4(position,1.0)).xyz+worldOffset),1.0)+rotatedCorner;
#else
vec4 viewPosition=view*vec4((position+worldOffset),1.0)+rotatedCorner;
#endif
vPositionW=(invView*viewPosition).xyz;
#endif
#else
vec3 rotatedCorner;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=0.;rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.xz+=translationPivot;vec3 yaxis=normalize(initialDirection);vPositionW=rotate(yaxis,rotatedCorner);vec4 viewPosition=view*vec4(vPositionW,1.0);
#endif
gl_Position=projection*viewPosition;
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
vec4 worldPos=vec4(vPositionW,1.0);
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
}`;
Le.ShadersStore[Lhe] = Khe;
class bc extends N0 {
  /**
   * Gets a boolean indicating if the GPU particles can be rendered on current browser
   */
  static get IsSupported() {
    if (!gr.LastCreatedEngine)
      return !1;
    const e = gr.LastCreatedEngine.getCaps();
    return e.supportTransformFeedbacks || e.supportComputeShaders;
  }
  _createIndexBuffer() {
    this._linesIndexBufferUseInstancing = this._engine.createIndexBuffer(new Uint32Array([0, 1, 1, 3, 3, 2, 2, 0, 0, 3]));
  }
  /**
   * Gets the maximum number of particles active at the same time.
   * @returns The max number of active particles.
   */
  getCapacity() {
    return this._capacity;
  }
  /**
   * Gets or set the number of active particles
   * The value cannot be greater than "capacity" (if it is, it will be limited to "capacity").
   */
  get maxActiveParticleCount() {
    return this._maxActiveParticleCount;
  }
  set maxActiveParticleCount(e) {
    this._maxActiveParticleCount = Math.min(e, this._capacity);
  }
  /**
   * Gets or set the number of active particles
   * @deprecated Please use maxActiveParticleCount instead.
   */
  get activeParticleCount() {
    return this.maxActiveParticleCount;
  }
  set activeParticleCount(e) {
    this.maxActiveParticleCount = e;
  }
  /**
   * Is this system ready to be used/rendered
   * @returns true if the system is ready
   */
  isReady() {
    if (!this.emitter || this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady() || !this.particleTexture || !this.particleTexture.isReady())
      return !1;
    if (this.blendMode !== ti.BLENDMODE_MULTIPLYADD) {
      if (!this._getWrapper(this.blendMode).effect.isReady())
        return !1;
    } else if (!this._getWrapper(ti.BLENDMODE_MULTIPLY).effect.isReady() || !this._getWrapper(ti.BLENDMODE_ADD).effect.isReady())
      return !1;
    return this._platform.isUpdateBufferCreated() ? this._platform.isUpdateBufferReady() : (this._recreateUpdateEffect(), !1);
  }
  /**
   * Gets if the system has been started. (Note: this will still be true after stop is called)
   * @returns True if it has been started, otherwise false.
   */
  isStarted() {
    return this._started;
  }
  /**
   * Gets if the system has been stopped. (Note: rendering is still happening but the system is frozen)
   * @returns True if it has been stopped, otherwise false.
   */
  isStopped() {
    return this._stopped;
  }
  /**
   * Gets a boolean indicating that the system is stopping
   * @returns true if the system is currently stopping
   */
  isStopping() {
    return !1;
  }
  /**
   * Gets the number of particles active at the same time.
   * @returns The number of active particles.
   */
  getActiveCount() {
    return this._currentActiveCount;
  }
  /**
   * Starts the particle system and begins to emit
   * @param delay defines the delay in milliseconds before starting the system (this.startDelay by default)
   */
  start(e = this.startDelay) {
    if (!this.targetStopDuration && this._hasTargetStopDurationDependantGradient())
      throw "Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";
    if (e) {
      setTimeout(() => {
        this.start(0);
      }, e);
      return;
    }
    this._started = !0, this._stopped = !1, this._preWarmDone = !1, this.beginAnimationOnStart && this.animations && this.animations.length > 0 && this._scene && this._scene.beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop);
  }
  /**
   * Stops the particle system.
   */
  stop() {
    this._stopped || (this._stopped = !0);
  }
  /**
   * Remove all active particles
   */
  reset() {
    this._releaseBuffers(), this._platform.releaseVertexBuffers(), this._currentActiveCount = 0, this._targetIndex = 0;
  }
  /**
   * Returns the string "GPUParticleSystem"
   * @returns a string containing the class name
   */
  getClassName() {
    return "GPUParticleSystem";
  }
  /**
   * Gets the custom effect used to render the particles
   * @param blendMode Blend mode for which the effect should be retrieved
   * @returns The effect
   */
  getCustomEffect(e = 0) {
    var t, r;
    return (r = (t = this._customWrappers[e]) === null || t === void 0 ? void 0 : t.effect) !== null && r !== void 0 ? r : this._customWrappers[0].effect;
  }
  _getCustomDrawWrapper(e = 0) {
    var t;
    return (t = this._customWrappers[e]) !== null && t !== void 0 ? t : this._customWrappers[0];
  }
  /**
   * Sets the custom effect used to render the particles
   * @param effect The effect to set
   * @param blendMode Blend mode for which the effect should be set
   */
  setCustomEffect(e, t = 0) {
    this._customWrappers[t] = new zo(this._engine), this._customWrappers[t].effect = e;
  }
  /**
   * Observable that will be called just before the particles are drawn
   */
  get onBeforeDrawParticlesObservable() {
    return this._onBeforeDrawParticlesObservable || (this._onBeforeDrawParticlesObservable = new Oe()), this._onBeforeDrawParticlesObservable;
  }
  /**
   * Gets the name of the particle vertex shader
   */
  get vertexShaderName() {
    return "gpuRenderParticles";
  }
  /**
   * Gets the vertex buffers used by the particle system
   * Should be called after render() has been called for the current frame so that the buffers returned are the ones that have been updated
   * in the current frame (there's a ping-pong between two sets of buffers - for a given frame, one set is used as the source and the other as the destination)
   */
  get vertexBuffers() {
    return this._renderVertexBuffers[this._targetIndex ^ 1];
  }
  /**
   * Gets the index buffer used by the particle system (null for GPU particle systems)
   */
  get indexBuffer() {
    return null;
  }
  _removeGradientAndTexture(e, t, r) {
    return super._removeGradientAndTexture(e, t, r), this._releaseBuffers(), this;
  }
  /**
   * Adds a new color gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param color1 defines the color to affect to the specified gradient
   * @returns the current particle system
   */
  addColorGradient(e, t) {
    this._colorGradients || (this._colorGradients = []);
    const r = new yY(e, t);
    return this._colorGradients.push(r), this._refreshColorGradient(!0), this._releaseBuffers(), this;
  }
  _refreshColorGradient(e = !1) {
    this._colorGradients && (e && this._colorGradients.sort((t, r) => t.gradient < r.gradient ? -1 : t.gradient > r.gradient ? 1 : 0), this._colorGradientsTexture && (this._colorGradientsTexture.dispose(), this._colorGradientsTexture = null));
  }
  /** Force the system to rebuild all gradients that need to be resync */
  forceRefreshGradients() {
    this._refreshColorGradient(), this._refreshFactorGradient(this._sizeGradients, "_sizeGradientsTexture"), this._refreshFactorGradient(this._angularSpeedGradients, "_angularSpeedGradientsTexture"), this._refreshFactorGradient(this._velocityGradients, "_velocityGradientsTexture"), this._refreshFactorGradient(this._limitVelocityGradients, "_limitVelocityGradientsTexture"), this._refreshFactorGradient(this._dragGradients, "_dragGradientsTexture"), this.reset();
  }
  /**
   * Remove a specific color gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeColorGradient(e) {
    return this._removeGradientAndTexture(e, this._colorGradients, this._colorGradientsTexture), this._colorGradientsTexture = null, this;
  }
  /**
   * Resets the draw wrappers cache
   */
  resetDrawCache() {
    var e;
    for (const t in this._drawWrappers)
      (e = this._drawWrappers[t].drawContext) === null || e === void 0 || e.reset();
  }
  _addFactorGradient(e, t, r) {
    const n = new kY(t, r);
    e.push(n), this._releaseBuffers();
  }
  /**
   * Adds a new size gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the size factor to affect to the specified gradient
   * @returns the current particle system
   */
  addSizeGradient(e, t) {
    return this._sizeGradients || (this._sizeGradients = []), this._addFactorGradient(this._sizeGradients, e, t), this._refreshFactorGradient(this._sizeGradients, "_sizeGradientsTexture", !0), this._releaseBuffers(), this;
  }
  /**
   * Remove a specific size gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeSizeGradient(e) {
    return this._removeGradientAndTexture(e, this._sizeGradients, this._sizeGradientsTexture), this._sizeGradientsTexture = null, this;
  }
  _refreshFactorGradient(e, t, r = !1) {
    if (!e)
      return;
    r && e.sort((i, s) => i.gradient < s.gradient ? -1 : i.gradient > s.gradient ? 1 : 0);
    const n = this;
    n[t] && (n[t].dispose(), n[t] = null);
  }
  /**
   * Adds a new angular speed gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the angular speed to affect to the specified gradient
   * @returns the current particle system
   */
  addAngularSpeedGradient(e, t) {
    return this._angularSpeedGradients || (this._angularSpeedGradients = []), this._addFactorGradient(this._angularSpeedGradients, e, t), this._refreshFactorGradient(this._angularSpeedGradients, "_angularSpeedGradientsTexture", !0), this._releaseBuffers(), this;
  }
  /**
   * Remove a specific angular speed gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeAngularSpeedGradient(e) {
    return this._removeGradientAndTexture(e, this._angularSpeedGradients, this._angularSpeedGradientsTexture), this._angularSpeedGradientsTexture = null, this;
  }
  /**
   * Adds a new velocity gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the velocity to affect to the specified gradient
   * @returns the current particle system
   */
  addVelocityGradient(e, t) {
    return this._velocityGradients || (this._velocityGradients = []), this._addFactorGradient(this._velocityGradients, e, t), this._refreshFactorGradient(this._velocityGradients, "_velocityGradientsTexture", !0), this._releaseBuffers(), this;
  }
  /**
   * Remove a specific velocity gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeVelocityGradient(e) {
    return this._removeGradientAndTexture(e, this._velocityGradients, this._velocityGradientsTexture), this._velocityGradientsTexture = null, this;
  }
  /**
   * Adds a new limit velocity gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the limit velocity value to affect to the specified gradient
   * @returns the current particle system
   */
  addLimitVelocityGradient(e, t) {
    return this._limitVelocityGradients || (this._limitVelocityGradients = []), this._addFactorGradient(this._limitVelocityGradients, e, t), this._refreshFactorGradient(this._limitVelocityGradients, "_limitVelocityGradientsTexture", !0), this._releaseBuffers(), this;
  }
  /**
   * Remove a specific limit velocity gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeLimitVelocityGradient(e) {
    return this._removeGradientAndTexture(e, this._limitVelocityGradients, this._limitVelocityGradientsTexture), this._limitVelocityGradientsTexture = null, this;
  }
  /**
   * Adds a new drag gradient
   * @param gradient defines the gradient to use (between 0 and 1)
   * @param factor defines the drag value to affect to the specified gradient
   * @returns the current particle system
   */
  addDragGradient(e, t) {
    return this._dragGradients || (this._dragGradients = []), this._addFactorGradient(this._dragGradients, e, t), this._refreshFactorGradient(this._dragGradients, "_dragGradientsTexture", !0), this._releaseBuffers(), this;
  }
  /**
   * Remove a specific drag gradient
   * @param gradient defines the gradient to remove
   * @returns the current particle system
   */
  removeDragGradient(e) {
    return this._removeGradientAndTexture(e, this._dragGradients, this._dragGradientsTexture), this._dragGradientsTexture = null, this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  addEmitRateGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  removeEmitRateGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  addStartSizeGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  removeStartSizeGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  addColorRemapGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  removeColorRemapGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  addAlphaRemapGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  removeAlphaRemapGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  addRampGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  removeRampGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the list of ramp gradients
   */
  getRampGradients() {
    return null;
  }
  /**
   * Not supported by GPUParticleSystem
   * Gets or sets a boolean indicating that ramp gradients must be used
   * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro#ramp-gradients
   */
  get useRampGradients() {
    return !1;
  }
  set useRampGradients(e) {
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  addLifeTimeGradient() {
    return this;
  }
  /**
   * Not supported by GPUParticleSystem
   * @returns the current particle system
   */
  removeLifeTimeGradient() {
    return this;
  }
  /**
   * Instantiates a GPU particle system.
   * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
   * @param name The name of the particle system
   * @param options The options used to create the system
   * @param sceneOrEngine The scene the particle system belongs to or the engine to use if no scene
   * @param customEffect a custom effect used to change the way particles are rendered by default
   * @param isAnimationSheetEnabled Must be true if using a spritesheet to animate the particles texture
   */
  constructor(e, t, r, n = null, i = !1) {
    if (super(e), this.layerMask = 268435455, this._accumulatedCount = 0, this._renderVertexBuffers = [], this._targetIndex = 0, this._currentRenderId = -1, this._currentRenderingCameraUniqueId = -1, this._started = !1, this._stopped = !1, this._timeDelta = 0, this.updateInAnimate = !1, this._actualFrame = 0, this._rawTextureWidth = 256, this.onDisposeObservable = new Oe(), this.onStoppedObservable = new Oe(), this.forceDepthWrite = !1, this._preWarmDone = !1, this.isLocal = !1, this.isGPU = !0, this._onBeforeDrawParticlesObservable = null, !r || r.getClassName() === "Scene" ? (this._scene = r || gr.LastCreatedScene, this._engine = this._scene.getEngine(), this.uniqueId = this._scene.getUniqueId(), this._scene.particleSystems.push(this)) : (this._engine = r, this.defaultProjectionMatrix = he.PerspectiveFovLH(0.8, 1, 0.1, 100, this._engine.isNDCHalfZRange)), this._engine.getCaps().supportComputeShaders) {
      if (!Jo("BABYLON.ComputeShaderParticleSystem"))
        throw new Error("The ComputeShaderParticleSystem class is not available! Make sure you have imported it.");
      this._platform = new (Jo("BABYLON.ComputeShaderParticleSystem"))(this, this._engine);
    } else {
      if (!Jo("BABYLON.WebGL2ParticleSystem"))
        throw new Error("The WebGL2ParticleSystem class is not available! Make sure you have imported it.");
      this._platform = new (Jo("BABYLON.WebGL2ParticleSystem"))(this, this._engine);
    }
    this._customWrappers = { 0: new zo(this._engine) }, this._customWrappers[0].effect = n, this._drawWrappers = { 0: new zo(this._engine) }, this._drawWrappers[0].drawContext && (this._drawWrappers[0].drawContext.useInstancing = !0), this._createIndexBuffer(), this._attachImageProcessingConfiguration(null), t = t ?? {}, t.randomTextureSize || delete t.randomTextureSize;
    const s = Object.assign({ capacity: 5e4, randomTextureSize: this._engine.getCaps().maxTextureSize }, t), a = t;
    isFinite(a) && (s.capacity = a), this._capacity = s.capacity, this._maxActiveParticleCount = s.capacity, this._currentActiveCount = 0, this._isAnimationSheetEnabled = i, this.particleEmitterType = new AD();
    const f = Math.min(this._engine.getCaps().maxTextureSize, s.randomTextureSize);
    let o = [];
    for (let d = 0; d < f; ++d)
      o.push(Math.random()), o.push(Math.random()), o.push(Math.random()), o.push(Math.random());
    this._randomTexture = new Bo(new Float32Array(o), f, 1, 5, r, !1, !1, 1, 1), this._randomTexture.name = "GPUParticleSystem_random1", this._randomTexture.wrapU = 1, this._randomTexture.wrapV = 1, o = [];
    for (let d = 0; d < f; ++d)
      o.push(Math.random()), o.push(Math.random()), o.push(Math.random()), o.push(Math.random());
    this._randomTexture2 = new Bo(new Float32Array(o), f, 1, 5, r, !1, !1, 1, 1), this._randomTexture2.name = "GPUParticleSystem_random2", this._randomTexture2.wrapU = 1, this._randomTexture2.wrapV = 1, this._randomTextureSize = f;
  }
  _reset() {
    this._releaseBuffers();
  }
  _createVertexBuffers(e, t, r) {
    const n = {};
    n.position = t.createVertexBuffer("position", 0, 3, this._attributesStrideSize, !0);
    let i = 3;
    n.age = t.createVertexBuffer("age", i, 1, this._attributesStrideSize, !0), i += 1, n.size = t.createVertexBuffer("size", i, 3, this._attributesStrideSize, !0), i += 3, n.life = t.createVertexBuffer("life", i, 1, this._attributesStrideSize, !0), i += 1, i += 4, this.billboardMode === ti.BILLBOARDMODE_STRETCHED && (n.direction = t.createVertexBuffer("direction", i, 3, this._attributesStrideSize, !0)), i += 3, this._platform.alignDataInBuffer && (i += 1), this.particleEmitterType instanceof dD && (i += 3, this._platform.alignDataInBuffer && (i += 1)), this._colorGradientsTexture || (n.color = t.createVertexBuffer("color", i, 4, this._attributesStrideSize, !0), i += 4), this._isBillboardBased || (n.initialDirection = t.createVertexBuffer("initialDirection", i, 3, this._attributesStrideSize, !0), i += 3, this._platform.alignDataInBuffer && (i += 1)), this.noiseTexture && (n.noiseCoordinates1 = t.createVertexBuffer("noiseCoordinates1", i, 3, this._attributesStrideSize, !0), i += 3, this._platform.alignDataInBuffer && (i += 1), n.noiseCoordinates2 = t.createVertexBuffer("noiseCoordinates2", i, 3, this._attributesStrideSize, !0), i += 3, this._platform.alignDataInBuffer && (i += 1)), n.angle = t.createVertexBuffer("angle", i, 1, this._attributesStrideSize, !0), this._angularSpeedGradientsTexture ? i++ : i += 2, this._isAnimationSheetEnabled && (n.cellIndex = t.createVertexBuffer("cellIndex", i, 1, this._attributesStrideSize, !0), i += 1, this.spriteRandomStartCell && (n.cellStartOffset = t.createVertexBuffer("cellStartOffset", i, 1, this._attributesStrideSize, !0), i += 1)), n.offset = r.createVertexBuffer("offset", 0, 2), n.uv = r.createVertexBuffer("uv", 2, 2), this._renderVertexBuffers.push(n), this._platform.createVertexBuffers(e, n), this.resetDrawCache();
  }
  _initialize(e = !1) {
    if (this._buffer0 && !e)
      return;
    const t = this._engine, r = [];
    this._attributesStrideSize = 21, this._targetIndex = 0, this._platform.alignDataInBuffer && (this._attributesStrideSize += 1), this.particleEmitterType instanceof dD && (this._attributesStrideSize += 3, this._platform.alignDataInBuffer && (this._attributesStrideSize += 1)), this.isBillboardBased || (this._attributesStrideSize += 3, this._platform.alignDataInBuffer && (this._attributesStrideSize += 1)), this._colorGradientsTexture && (this._attributesStrideSize -= 4), this._angularSpeedGradientsTexture && (this._attributesStrideSize -= 1), this._isAnimationSheetEnabled && (this._attributesStrideSize += 1, this.spriteRandomStartCell && (this._attributesStrideSize += 1)), this.noiseTexture && (this._attributesStrideSize += 6, this._platform.alignDataInBuffer && (this._attributesStrideSize += 2)), this._platform.alignDataInBuffer && (this._attributesStrideSize += 3 - (this._attributesStrideSize + 3 & 3));
    const n = this.particleEmitterType instanceof dD, i = ue.Vector3[0];
    let s = 0;
    for (let d = 0; d < this._capacity; d++)
      if (r.push(0), r.push(0), r.push(0), r.push(0), r.push(0), r.push(0), r.push(0), r.push(0), r.push(Math.random()), r.push(Math.random()), r.push(Math.random()), r.push(Math.random()), n ? (this.particleEmitterType.particleDestinationGenerator(d, null, i), r.push(i.x), r.push(i.y), r.push(i.z)) : (r.push(0), r.push(0), r.push(0)), this._platform.alignDataInBuffer && r.push(0), s += 16, n && (this.particleEmitterType.particlePositionGenerator(d, null, i), r.push(i.x), r.push(i.y), r.push(i.z), this._platform.alignDataInBuffer && r.push(0), s += 4), this._colorGradientsTexture || (r.push(0), r.push(0), r.push(0), r.push(0), s += 4), this.isBillboardBased || (r.push(0), r.push(0), r.push(0), this._platform.alignDataInBuffer && r.push(0), s += 4), this.noiseTexture && (r.push(Math.random()), r.push(Math.random()), r.push(Math.random()), this._platform.alignDataInBuffer && r.push(0), r.push(Math.random()), r.push(Math.random()), r.push(Math.random()), this._platform.alignDataInBuffer && r.push(0), s += 8), r.push(0), s += 1, this._angularSpeedGradientsTexture || (r.push(0), s += 1), this._isAnimationSheetEnabled && (r.push(0), s += 1, this.spriteRandomStartCell && (r.push(0), s += 1)), this._platform.alignDataInBuffer) {
        let v = 3 - (s + 3 & 3);
        for (s += v; v-- > 0; )
          r.push(0);
      }
    const a = new Float32Array([0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1, 0.5, -0.5, 1, 0, -0.5, -0.5, 0, 0]), f = this._platform.createParticleBuffer(r), o = this._platform.createParticleBuffer(r);
    this._buffer0 = new P9(t, f, !1, this._attributesStrideSize), this._buffer1 = new P9(t, o, !1, this._attributesStrideSize), this._spriteBuffer = new P9(t, a, !1, 4), this._renderVertexBuffers = [], this._createVertexBuffers(this._buffer0, this._buffer1, this._spriteBuffer), this._createVertexBuffers(this._buffer1, this._buffer0, this._spriteBuffer), this._sourceBuffer = this._buffer0, this._targetBuffer = this._buffer1;
  }
  /** @internal */
  _recreateUpdateEffect() {
    this._createColorGradientTexture(), this._createSizeGradientTexture(), this._createAngularSpeedGradientTexture(), this._createVelocityGradientTexture(), this._createLimitVelocityGradientTexture(), this._createDragGradientTexture();
    let e = this.particleEmitterType ? this.particleEmitterType.getEffectDefines() : "";
    return this._isBillboardBased && (e += `
#define BILLBOARD`), this._colorGradientsTexture && (e += `
#define COLORGRADIENTS`), this._sizeGradientsTexture && (e += `
#define SIZEGRADIENTS`), this._angularSpeedGradientsTexture && (e += `
#define ANGULARSPEEDGRADIENTS`), this._velocityGradientsTexture && (e += `
#define VELOCITYGRADIENTS`), this._limitVelocityGradientsTexture && (e += `
#define LIMITVELOCITYGRADIENTS`), this._dragGradientsTexture && (e += `
#define DRAGGRADIENTS`), this.isAnimationSheetEnabled && (e += `
#define ANIMATESHEET`, this.spriteRandomStartCell && (e += `
#define ANIMATESHEETRANDOMSTART`)), this.noiseTexture && (e += `
#define NOISE`), this.isLocal && (e += `
#define LOCAL`), this._platform.isUpdateBufferCreated() && this._cachedUpdateDefines === e ? !0 : (this._cachedUpdateDefines = e, this._updateBuffer = this._platform.createUpdateBuffer(e), this._platform.isUpdateBufferReady());
  }
  /**
   * @internal
   */
  _getWrapper(e) {
    const t = this._getCustomDrawWrapper(e);
    if (t != null && t.effect)
      return t;
    const r = [];
    this.fillDefines(r, e);
    let n = this._drawWrappers[e];
    n || (n = new zo(this._engine), n.drawContext && (n.drawContext.useInstancing = !0), this._drawWrappers[e] = n);
    const i = r.join(`
`);
    if (n.defines !== i) {
      const s = [], a = [], f = [];
      this.fillUniformsAttributesAndSamplerNames(a, s, f), n.setEffect(this._engine.createEffect("gpuRenderParticles", s, a, f, i), i);
    }
    return n;
  }
  /**
   * @internal
   */
  static _GetAttributeNamesOrOptions(e = !1, t = !1, r = !1, n = !1) {
    const i = [J.PositionKind, "age", "life", "size", "angle"];
    return e || i.push(J.ColorKind), t && i.push("cellIndex"), r || i.push("initialDirection"), n && i.push("direction"), i.push("offset", J.UVKind), i;
  }
  /**
   * @internal
   */
  static _GetEffectCreationOptions(e = !1, t = !1) {
    const r = ["emitterWM", "worldOffset", "view", "projection", "colorDead", "invView", "translationPivot", "eyePosition"];
    return Mf(r), e && r.push("sheetInfos"), t && r.push("logarithmicDepthConstant"), r;
  }
  /**
   * Fill the defines array according to the current settings of the particle system
   * @param defines Array to be updated
   * @param blendMode blend mode to take into account when updating the array
   */
  fillDefines(e, t = 0) {
    if (this._scene && xq(this, this._scene, e), t === ti.BLENDMODE_MULTIPLY && e.push("#define BLENDMULTIPLYMODE"), this.isLocal && e.push("#define LOCAL"), this.useLogarithmicDepth && e.push("#define LOGARITHMICDEPTH"), this._isBillboardBased)
      switch (e.push("#define BILLBOARD"), this.billboardMode) {
        case ti.BILLBOARDMODE_Y:
          e.push("#define BILLBOARDY");
          break;
        case ti.BILLBOARDMODE_STRETCHED:
          e.push("#define BILLBOARDSTRETCHED");
          break;
        case ti.BILLBOARDMODE_ALL:
          e.push("#define BILLBOARDMODE_ALL");
          break;
      }
    this._colorGradientsTexture && e.push("#define COLORGRADIENTS"), this.isAnimationSheetEnabled && e.push("#define ANIMATESHEET"), this._imageProcessingConfiguration && (this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines), e.push("" + this._imageProcessingConfigurationDefines.toString()));
  }
  /**
   * Fill the uniforms, attributes and samplers arrays according to the current settings of the particle system
   * @param uniforms Uniforms array to fill
   * @param attributes Attributes array to fill
   * @param samplers Samplers array to fill
   */
  fillUniformsAttributesAndSamplerNames(e, t, r) {
    t.push(...bc._GetAttributeNamesOrOptions(!!this._colorGradientsTexture, this._isAnimationSheetEnabled, this._isBillboardBased, this._isBillboardBased && this.billboardMode === ti.BILLBOARDMODE_STRETCHED)), e.push(...bc._GetEffectCreationOptions(this._isAnimationSheetEnabled, this.useLogarithmicDepth)), r.push("diffuseSampler", "colorGradientSampler"), this._imageProcessingConfiguration && (Ui.PrepareUniforms(e, this._imageProcessingConfigurationDefines), Ui.PrepareSamplers(r, this._imageProcessingConfigurationDefines));
  }
  /**
   * Animates the particle system for the current frame by emitting new particles and or animating the living ones.
   * @param preWarm defines if we are in the pre-warmimg phase
   */
  animate(e = !1) {
    var t;
    this._timeDelta = this.updateSpeed * (e ? this.preWarmStepOffset : ((t = this._scene) === null || t === void 0 ? void 0 : t.getAnimationRatio()) || 1), this._actualFrame += this._timeDelta, this._stopped || this.targetStopDuration && this._actualFrame >= this.targetStopDuration && this.stop(), this.updateInAnimate && this._update();
  }
  _createFactorGradientTexture(e, t) {
    const r = this[t];
    if (!e || !e.length || r)
      return;
    const n = new Float32Array(this._rawTextureWidth);
    for (let i = 0; i < this._rawTextureWidth; i++) {
      const s = i / this._rawTextureWidth;
      kl.GetCurrentGradient(s, e, (a, f, o) => {
        n[i] = Xt.Lerp(a.factor1, f.factor1, o);
      });
    }
    this[t] = Bo.CreateRTexture(n, this._rawTextureWidth, 1, this._scene || this._engine, !1, !1, 1), this[t].name = t.substring(1);
  }
  _createSizeGradientTexture() {
    this._createFactorGradientTexture(this._sizeGradients, "_sizeGradientsTexture");
  }
  _createAngularSpeedGradientTexture() {
    this._createFactorGradientTexture(this._angularSpeedGradients, "_angularSpeedGradientsTexture");
  }
  _createVelocityGradientTexture() {
    this._createFactorGradientTexture(this._velocityGradients, "_velocityGradientsTexture");
  }
  _createLimitVelocityGradientTexture() {
    this._createFactorGradientTexture(this._limitVelocityGradients, "_limitVelocityGradientsTexture");
  }
  _createDragGradientTexture() {
    this._createFactorGradientTexture(this._dragGradients, "_dragGradientsTexture");
  }
  _createColorGradientTexture() {
    if (!this._colorGradients || !this._colorGradients.length || this._colorGradientsTexture)
      return;
    const e = new Uint8Array(this._rawTextureWidth * 4), t = Hs.Color4[0];
    for (let r = 0; r < this._rawTextureWidth; r++) {
      const n = r / this._rawTextureWidth;
      kl.GetCurrentGradient(n, this._colorGradients, (i, s, a) => {
        xt.LerpToRef(i.color1, s.color1, a, t), e[r * 4] = t.r * 255, e[r * 4 + 1] = t.g * 255, e[r * 4 + 2] = t.b * 255, e[r * 4 + 3] = t.a * 255;
      });
    }
    this._colorGradientsTexture = Bo.CreateRGBATexture(e, this._rawTextureWidth, 1, this._scene, !1, !1, 1), this._colorGradientsTexture.name = "colorGradients";
  }
  _render(e, t) {
    var r, n, i, s, a;
    const f = this._getWrapper(e), o = f.effect;
    this._engine.enableEffect(f);
    const d = ((r = this._scene) === null || r === void 0 ? void 0 : r.getViewMatrix()) || he.IdentityReadOnly;
    if (o.setMatrix("view", d), o.setMatrix("projection", (n = this.defaultProjectionMatrix) !== null && n !== void 0 ? n : this._scene.getProjectionMatrix()), o.setTexture("diffuseSampler", this.particleTexture), o.setVector2("translationPivot", this.translationPivot), o.setVector3("worldOffset", this.worldOffset), this.isLocal && o.setMatrix("emitterWM", t), this._colorGradientsTexture ? o.setTexture("colorGradientSampler", this._colorGradientsTexture) : o.setDirectColor4("colorDead", this.colorDead), this._isAnimationSheetEnabled && this.particleTexture) {
      const u = this.particleTexture.getBaseSize();
      o.setFloat3("sheetInfos", this.spriteCellWidth / u.width, this.spriteCellHeight / u.height, u.width / this.spriteCellWidth);
    }
    if (this._isBillboardBased && this._scene) {
      const u = this._scene.activeCamera;
      o.setVector3("eyePosition", u.globalPosition);
    }
    const v = o.defines;
    if (this._scene && Df(o, this, this._scene), v.indexOf("#define BILLBOARDMODE_ALL") >= 0) {
      const u = d.clone();
      u.invert(), o.setMatrix("invView", u);
    }
    switch (this.useLogarithmicDepth && this._scene && Ye.BindLogDepth(v, o, this._scene), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(o), e) {
      case ti.BLENDMODE_ADD:
        this._engine.setAlphaMode(1);
        break;
      case ti.BLENDMODE_ONEONE:
        this._engine.setAlphaMode(6);
        break;
      case ti.BLENDMODE_STANDARD:
        this._engine.setAlphaMode(2);
        break;
      case ti.BLENDMODE_MULTIPLY:
        this._engine.setAlphaMode(4);
        break;
    }
    return this._platform.bindDrawBuffers(this._targetIndex, o, !((i = this._scene) === null || i === void 0) && i.forceWireframe ? this._linesIndexBufferUseInstancing : null), this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.notifyObservers(o), !((s = this._scene) === null || s === void 0) && s.forceWireframe ? this._engine.drawElementsType(6, 0, 10, this._currentActiveCount) : this._engine.drawArraysType(7, 0, 4, this._currentActiveCount), this._engine.setAlphaMode(0), !((a = this._scene) === null || a === void 0) && a.forceWireframe && this._engine.unbindInstanceAttributes(), this._currentActiveCount;
  }
  /** @internal */
  _update(e) {
    if (!this.emitter || !this._targetBuffer || !this._recreateUpdateEffect())
      return;
    if (!e)
      if (this.emitter.position)
        e = this.emitter.getWorldMatrix();
      else {
        const r = this.emitter;
        e = ue.Matrix[0], he.TranslationToRef(r.x, r.y, r.z, e);
      }
    this._platform.preUpdateParticleBuffer(), this._updateBuffer.setFloat("currentCount", this._currentActiveCount), this._updateBuffer.setFloat("timeDelta", this._timeDelta), this._updateBuffer.setFloat("stopFactor", this._stopped ? 0 : 1), this._updateBuffer.setInt("randomTextureSize", this._randomTextureSize), this._updateBuffer.setFloat2("lifeTime", this.minLifeTime, this.maxLifeTime), this._updateBuffer.setFloat2("emitPower", this.minEmitPower, this.maxEmitPower), this._colorGradientsTexture || (this._updateBuffer.setDirectColor4("color1", this.color1), this._updateBuffer.setDirectColor4("color2", this.color2)), this._updateBuffer.setFloat2("sizeRange", this.minSize, this.maxSize), this._updateBuffer.setFloat4("scaleRange", this.minScaleX, this.maxScaleX, this.minScaleY, this.maxScaleY), this._updateBuffer.setFloat4("angleRange", this.minAngularSpeed, this.maxAngularSpeed, this.minInitialRotation, this.maxInitialRotation), this._updateBuffer.setVector3("gravity", this.gravity), this._limitVelocityGradientsTexture && this._updateBuffer.setFloat("limitVelocityDamping", this.limitVelocityDamping), this.particleEmitterType && this.particleEmitterType.applyToShader(this._updateBuffer), this._isAnimationSheetEnabled && this._updateBuffer.setFloat4("cellInfos", this.startSpriteCellID, this.endSpriteCellID, this.spriteCellChangeSpeed, this.spriteCellLoop ? 1 : 0), this.noiseTexture && this._updateBuffer.setVector3("noiseStrength", this.noiseStrength), this.isLocal || this._updateBuffer.setMatrix("emitterWM", e), this._platform.updateParticleBuffer(this._targetIndex, this._targetBuffer, this._currentActiveCount), this._targetIndex++, this._targetIndex === 2 && (this._targetIndex = 0);
    const t = this._sourceBuffer;
    this._sourceBuffer = this._targetBuffer, this._targetBuffer = t;
  }
  /**
   * Renders the particle system in its current state
   * @param preWarm defines if the system should only update the particles but not render them
   * @param forceUpdateOnly if true, force to only update the particles and never display them (meaning, even if preWarm=false, when forceUpdateOnly=true the particles won't be displayed)
   * @returns the current number of particles
   */
  render(e = !1, t = !1) {
    if (!this._started || !this.isReady())
      return 0;
    if (!e && this._scene) {
      if (!this._preWarmDone && this.preWarmCycles) {
        for (let s = 0; s < this.preWarmCycles; s++)
          this.animate(!0), this.render(!0, !0);
        this._preWarmDone = !0;
      }
      if (this._currentRenderId === this._scene.getRenderId() && (!this._scene.activeCamera || this._scene.activeCamera && this._currentRenderingCameraUniqueId === this._scene.activeCamera.uniqueId))
        return 0;
      this._currentRenderId = this._scene.getRenderId(), this._scene.activeCamera && (this._currentRenderingCameraUniqueId = this._scene.activeCamera.uniqueId);
    }
    if (this._initialize(), this._accumulatedCount += this.emitRate * this._timeDelta, this._accumulatedCount > 1) {
      const s = this._accumulatedCount | 0;
      this._accumulatedCount -= s, this._currentActiveCount += s;
    }
    if (this._currentActiveCount = Math.min(this._maxActiveParticleCount, this._currentActiveCount), !this._currentActiveCount)
      return 0;
    let r;
    if (this.emitter.position)
      r = this.emitter.getWorldMatrix();
    else {
      const s = this.emitter;
      r = ue.Matrix[0], he.TranslationToRef(s.x, s.y, s.z, r);
    }
    const n = this._engine;
    this.updateInAnimate || this._update(r);
    let i = 0;
    return !e && !t && (n.setState(!1), this.forceDepthWrite && n.setDepthWrite(!0), this.blendMode === ti.BLENDMODE_MULTIPLYADD ? i = this._render(ti.BLENDMODE_MULTIPLY, r) + this._render(ti.BLENDMODE_ADD, r) : i = this._render(this.blendMode, r), this._engine.setAlphaMode(0)), i;
  }
  /**
   * Rebuilds the particle system
   */
  rebuild() {
    const e = () => {
      !this._recreateUpdateEffect() || !this._platform.isUpdateBufferReady() ? setTimeout(e, 10) : this._initialize(!0);
    };
    this._createIndexBuffer(), this._cachedUpdateDefines = "", this._platform.contextLost(), e();
  }
  _releaseBuffers() {
    this._buffer0 && (this._buffer0.dispose(), this._buffer0 = null), this._buffer1 && (this._buffer1.dispose(), this._buffer1 = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._platform.releaseBuffers();
  }
  /**
   * Disposes the particle system and free the associated resources
   * @param disposeTexture defines if the particule texture must be disposed as well (true by default)
   */
  dispose(e = !0) {
    for (const t in this._drawWrappers)
      this._drawWrappers[t].dispose();
    if (this._drawWrappers = {}, this._scene) {
      const t = this._scene.particleSystems.indexOf(this);
      t > -1 && this._scene.particleSystems.splice(t, 1);
    }
    this._releaseBuffers(), this._platform.releaseVertexBuffers();
    for (let t = 0; t < this._renderVertexBuffers.length; ++t) {
      const r = this._renderVertexBuffers[t];
      for (const n in r)
        r[n].dispose();
    }
    this._renderVertexBuffers = [], this._colorGradientsTexture && (this._colorGradientsTexture.dispose(), this._colorGradientsTexture = null), this._sizeGradientsTexture && (this._sizeGradientsTexture.dispose(), this._sizeGradientsTexture = null), this._angularSpeedGradientsTexture && (this._angularSpeedGradientsTexture.dispose(), this._angularSpeedGradientsTexture = null), this._velocityGradientsTexture && (this._velocityGradientsTexture.dispose(), this._velocityGradientsTexture = null), this._limitVelocityGradientsTexture && (this._limitVelocityGradientsTexture.dispose(), this._limitVelocityGradientsTexture = null), this._dragGradientsTexture && (this._dragGradientsTexture.dispose(), this._dragGradientsTexture = null), this._randomTexture && (this._randomTexture.dispose(), this._randomTexture = null), this._randomTexture2 && (this._randomTexture2.dispose(), this._randomTexture2 = null), e && this.particleTexture && (this.particleTexture.dispose(), this.particleTexture = null), e && this.noiseTexture && (this.noiseTexture.dispose(), this.noiseTexture = null), this.onStoppedObservable.clear(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();
  }
  /**
   * Clones the particle system.
   * @param name The name of the cloned object
   * @param newEmitter The new emitter to use
   * @param cloneTexture Also clone the textures if true
   * @returns the cloned particle system
   */
  clone(e, t, r = !1) {
    const n = Object.assign({}, this._customWrappers);
    let i = null;
    const s = this._engine;
    if (s.createEffectForParticles && this.customShader != null) {
      i = this.customShader;
      const o = i.shaderOptions.defines.length > 0 ? i.shaderOptions.defines.join(`
`) : "";
      n[0] = s.createEffectForParticles(i.shaderPath.fragmentElement, i.shaderOptions.uniforms, i.shaderOptions.samplers, o, void 0, void 0, void 0, this);
    }
    const a = this.serialize(r), f = bc.Parse(a, this._scene || this._engine, this._rootUrl);
    return f.name = e, f.customShader = i, f._customWrappers = n, t === void 0 && (t = this.emitter), this.noiseTexture && (f.noiseTexture = this.noiseTexture.clone()), f.emitter = t, f;
  }
  /**
   * Serializes the particle system to a JSON object
   * @param serializeTexture defines if the texture must be serialized as well
   * @returns the JSON object
   */
  serialize(e = !1) {
    const t = {};
    return ti._Serialize(t, this, e), t.activeParticleCount = this.activeParticleCount, t.randomTextureSize = this._randomTextureSize, t.customShader = this.customShader, t;
  }
  /**
   * Parses a JSON object to create a GPU particle system.
   * @param parsedParticleSystem The JSON object to parse
   * @param sceneOrEngine The scene or the engine to create the particle system in
   * @param rootUrl The root url to use to load external dependencies like texture
   * @param doNotStart Ignore the preventAutoStart attribute and does not start
   * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
   * @returns the parsed GPU particle system
   */
  static Parse(e, t, r, n = !1, i) {
    const s = e.name;
    let a, f;
    t instanceof hr ? a = t : (f = t, a = f.getEngine());
    const o = new bc(s, { capacity: i || e.capacity, randomTextureSize: e.randomTextureSize }, t, null, e.isAnimationSheetEnabled);
    if (o._rootUrl = r, e.customShader && a.createEffectForParticles) {
      const d = e.customShader, v = d.shaderOptions.defines.length > 0 ? d.shaderOptions.defines.join(`
`) : "", u = a.createEffectForParticles(d.shaderPath.fragmentElement, d.shaderOptions.uniforms, d.shaderOptions.samplers, v, void 0, void 0, void 0, o);
      o.setCustomEffect(u, 0), o.customShader = d;
    }
    return e.id && (o.id = e.id), e.activeParticleCount && (o.activeParticleCount = e.activeParticleCount), ti._Parse(e, o, t, r), e.preventAutoStart && (o.preventAutoStart = e.preventAutoStart), !n && !o.preventAutoStart && o.start(), o;
  }
}
class bq {
  constructor() {
    this._emitterNodeIsOwned = !0, this.systems = [];
  }
  /**
   * Gets or sets the emitter node used with this set
   */
  get emitterNode() {
    return this._emitterNode;
  }
  set emitterNode(e) {
    this._emitterNodeIsOwned && this._emitterNode && (this._emitterNode.dispose && this._emitterNode.dispose(), this._emitterNodeIsOwned = !1);
    for (const t of this.systems)
      t.emitter = e;
    this._emitterNode = e;
  }
  /**
   * Creates a new emitter mesh as a sphere
   * @param options defines the options used to create the sphere
   * @param options.diameter
   * @param options.segments
   * @param options.color
   * @param renderingGroupId defines the renderingGroupId to use for the sphere
   * @param scene defines the hosting scene
   */
  setEmitterAsSphere(e, t, r) {
    this._emitterNodeIsOwned && this._emitterNode && this._emitterNode.dispose && this._emitterNode.dispose(), this._emitterNodeIsOwned = !0, this._emitterCreationOptions = {
      kind: "Sphere",
      options: e,
      renderingGroupId: t
    };
    const n = UA("emitterSphere", { diameter: e.diameter, segments: e.segments }, r);
    n.renderingGroupId = t;
    const i = new Wt("emitterSphereMaterial", r);
    i.emissiveColor = e.color, n.material = i;
    for (const s of this.systems)
      s.emitter = n;
    this._emitterNode = n;
  }
  /**
   * Starts all particle systems of the set
   * @param emitter defines an optional mesh to use as emitter for the particle systems
   */
  start(e) {
    for (const t of this.systems)
      e && (t.emitter = e), t.start();
  }
  /**
   * Release all associated resources
   */
  dispose() {
    for (const e of this.systems)
      e.dispose();
    this.systems.length = 0, this._emitterNode && (this._emitterNode.dispose && this._emitterNode.dispose(), this._emitterNode = null);
  }
  /**
   * Serialize the set into a JSON compatible object
   * @param serializeTexture defines if the texture must be serialized as well
   * @returns a JSON compatible representation of the set
   */
  serialize(e = !1) {
    const t = {};
    t.systems = [];
    for (const r of this.systems)
      t.systems.push(r.serialize(e));
    return this._emitterNode && (t.emitter = this._emitterCreationOptions), t;
  }
  /**
   * Parse a new ParticleSystemSet from a serialized source
   * @param data defines a JSON compatible representation of the set
   * @param scene defines the hosting scene
   * @param gpu defines if we want GPU particles or CPU particles
   * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
   * @returns a new ParticleSystemSet
   */
  static Parse(e, t, r = !1, n) {
    const i = new bq(), s = this.BaseAssetsUrl + "/textures/";
    t = t || gr.LastCreatedScene;
    for (const a of e.systems)
      i.systems.push(r ? bc.Parse(a, t, s, !0, n) : ti.Parse(a, t, s, !0, n));
    if (e.emitter) {
      const a = e.emitter.options;
      switch (e.emitter.kind) {
        case "Sphere":
          i.setEmitterAsSphere({
            diameter: a.diameter,
            segments: a.segments,
            color: Ne.FromArray(a.color)
          }, e.emitter.renderingGroupId, t);
          break;
      }
    }
    return i;
  }
}
bq.BaseAssetsUrl = "https://assets.babylonjs.com/particles";
class Tm {
  /**
   * Create a default particle system that you can tweak
   * @param emitter defines the emitter to use
   * @param capacity defines the system capacity (default is 500 particles)
   * @param scene defines the hosting scene
   * @param useGPU defines if a GPUParticleSystem must be created (default is false)
   * @returns the new Particle system
   */
  static CreateDefault(e, t = 500, r, n = !1) {
    let i;
    return n ? i = new bc("default system", { capacity: t }, r) : i = new ti("default system", t, r), i.emitter = e, i.particleTexture = new We("https://assets.babylonjs.com/textures/flare.png", i.getScene()), i.createConeEmitter(0.1, Math.PI / 4), i.color1 = new xt(1, 1, 1, 1), i.color2 = new xt(1, 1, 1, 1), i.colorDead = new xt(1, 1, 1, 0), i.minSize = 0.1, i.maxSize = 0.1, i.minEmitPower = 2, i.maxEmitPower = 2, i.updateSpeed = 1 / 60, i.emitRate = 30, i;
  }
  /**
   * This is the main static method (one-liner) of this helper to create different particle systems
   * @param type This string represents the type to the particle system to create
   * @param scene The scene where the particle system should live
   * @param gpu If the system will use gpu
   * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
   * @returns the ParticleSystemSet created
   */
  static CreateAsync(e, t, r = !1, n) {
    t || (t = gr.LastCreatedScene);
    const i = {};
    return t.addPendingData(i), new Promise((s, a) => {
      if (r && !bc.IsSupported)
        return t.removePendingData(i), a("Particle system with GPU is not supported.");
      ye.LoadFile(`${Tm.BaseAssetsUrl}/systems/${e}.json`, (f) => {
        t.removePendingData(i);
        const o = JSON.parse(f.toString());
        return s(bq.Parse(o, t, r, n));
      }, void 0, void 0, void 0, () => (t.removePendingData(i), a(`An error occurred with the creation of your particle system. Check if your type '${e}' exists.`)));
    });
  }
  /**
   * Static function used to export a particle system to a ParticleSystemSet variable.
   * Please note that the emitter shape is not exported
   * @param systems defines the particle systems to export
   * @returns the created particle system set
   */
  static ExportSet(e) {
    const t = new bq();
    for (const r of e)
      t.systems.push(r);
    return t;
  }
  /**
   * Creates a particle system from a snippet saved in a remote file
   * @param name defines the name of the particle system to create (can be null or empty to use the one from the json data)
   * @param url defines the url to load from
   * @param scene defines the hosting scene
   * @param gpu If the system will use gpu
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
   * @returns a promise that will resolve to the new particle system
   */
  static ParseFromFileAsync(e, t, r, n = !1, i = "", s) {
    return new Promise((a, f) => {
      const o = new ho();
      o.addEventListener("readystatechange", () => {
        if (o.readyState == 4)
          if (o.status == 200) {
            const d = JSON.parse(o.responseText);
            let v;
            n ? v = bc.Parse(d, r, i, !1, s) : v = ti.Parse(d, r, i, !1, s), e && (v.name = e), a(v);
          } else
            f("Unable to load the particle system");
      }), o.open("GET", t), o.send();
    });
  }
  /**
   * Creates a particle system from a snippet saved by the particle system editor
   * @param snippetId defines the snippet to load (can be set to _BLANK to create a default one)
   * @param scene defines the hosting scene
   * @param gpu If the system will use gpu
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
   * @returns a promise that will resolve to the new particle system
   */
  static ParseFromSnippetAsync(e, t, r = !1, n = "", i) {
    if (e === "_BLANK") {
      const s = this.CreateDefault(null);
      return s.start(), Promise.resolve(s);
    }
    return new Promise((s, a) => {
      const f = new ho();
      f.addEventListener("readystatechange", () => {
        if (f.readyState == 4)
          if (f.status == 200) {
            const o = JSON.parse(JSON.parse(f.responseText).jsonPayload), d = JSON.parse(o.particleSystem);
            let v;
            r ? v = bc.Parse(d, t, n, !1, i) : v = ti.Parse(d, t, n, !1, i), v.snippetId = e, s(v);
          } else
            a("Unable to load the snippet " + e);
      }), f.open("GET", this.SnippetUrl + "/" + e.replace(/#/g, "/")), f.send();
    });
  }
}
Tm.BaseAssetsUrl = bq.BaseAssetsUrl;
Tm.SnippetUrl = "https://snippet.babylonjs.com";
Tm.CreateFromSnippetAsync = Tm.ParseFromSnippetAsync;
J1.AddParser(Ot.NAME_PARTICLESYSTEM, (A, e, t, r) => {
  const n = J1.GetIndividualParser(Ot.NAME_PARTICLESYSTEM);
  if (n && A.particleSystems !== void 0 && A.particleSystems !== null)
    for (let i = 0, s = A.particleSystems.length; i < s; i++) {
      const a = A.particleSystems[i];
      t.particleSystems.push(n(a, e, r));
    }
});
J1.AddIndividualParser(Ot.NAME_PARTICLESYSTEM, (A, e, t) => A.activeParticleCount ? bc.Parse(A, e, t) : ti.Parse(A, e, t));
Ge.prototype.createEffectForParticles = function(A, e = [], t = [], r = "", n, i, s, a) {
  var f;
  let o = [], d = [];
  const v = [];
  return a ? a.fillUniformsAttributesAndSamplerNames(d, o, v) : (o = ti._GetAttributeNamesOrOptions(), d = ti._GetEffectCreationOptions()), r.indexOf(" BILLBOARD") === -1 && (r += `
#define BILLBOARD
`), a != null && a.isAnimationSheetEnabled && r.indexOf(" ANIMATESHEET") === -1 && (r += `
#define ANIMATESHEET
`), t.indexOf("diffuseSampler") === -1 && t.push("diffuseSampler"), this.createEffect({
    vertex: (f = a == null ? void 0 : a.vertexShaderName) !== null && f !== void 0 ? f : "particles",
    fragmentElement: A
  }, o, d.concat(e), v.concat(t), r, n, i, s);
};
Ee.prototype.getEmittedParticleSystems = function() {
  const A = [];
  for (let e = 0; e < this.getScene().particleSystems.length; e++) {
    const t = this.getScene().particleSystems[e];
    t.emitter === this && A.push(t);
  }
  return A;
};
Ee.prototype.getHierarchyEmittedParticleSystems = function() {
  const A = [], e = this.getDescendants();
  e.push(this);
  for (let t = 0; t < this.getScene().particleSystems.length; t++) {
    const r = this.getScene().particleSystems[t], n = r.emitter;
    n.position && e.indexOf(n) !== -1 && A.push(r);
  }
  return A;
};
class bF {
  /**
   * Particle BoundingInfo object
   * @returns a BoundingInfo
   */
  getBoundingInfo() {
    return this._boundingInfo;
  }
  /**
   * Returns true if there is already a bounding info
   */
  get hasBoundingInfo() {
    return this._boundingInfo !== null;
  }
  /**
   * Creates a Solid Particle object.
   * Don't create particles manually, use instead the Solid Particle System internal tools like _addParticle()
   * @param particleIndex (integer) is the particle index in the Solid Particle System pool.
   * @param particleId (integer) is the particle identifier. Unless some particles are removed from the SPS, it's the same value than the particle idx.
   * @param positionIndex (integer) is the starting index of the particle vertices in the SPS "positions" array.
   * @param indiceIndex (integer) is the starting index of the particle indices in the SPS "indices" array.
   * @param model (ModelShape) is a reference to the model shape on what the particle is designed.
   * @param shapeId (integer) is the model shape identifier in the SPS.
   * @param idxInShape (integer) is the index of the particle in the current model (ex: the 10th box of addShape(box, 30))
   * @param sps defines the sps it is associated to
   * @param modelBoundingInfo is the reference to the model BoundingInfo used for intersection computations.
   * @param materialIndex is the particle material identifier (integer) when the MultiMaterials are enabled in the SPS.
   */
  constructor(e, t, r, n, i, s, a, f, o = null, d = null) {
    this.idx = 0, this.id = 0, this.color = new xt(1, 1, 1, 1), this.position = S.Zero(), this.rotation = S.Zero(), this.scaling = S.One(), this.uvs = new Ir(0, 0, 1, 1), this.velocity = S.Zero(), this.pivot = S.Zero(), this.translateFromPivot = !1, this.alive = !0, this.isVisible = !0, this._pos = 0, this._ind = 0, this.shapeId = 0, this.idxInShape = 0, this._stillInvisible = !1, this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1], this.parentId = null, this.materialIndex = null, this.props = null, this.cullingStrategy = jn.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY, this._globalPosition = S.Zero(), this.idx = e, this.id = t, this._pos = r, this._ind = n, this._model = i, this.shapeId = s, this.idxInShape = a, this._sps = f, o && (this._modelBoundingInfo = o, this._boundingInfo = new Md(o.minimum, o.maximum)), d !== null && (this.materialIndex = d);
  }
  /**
   * Copies the particle property values into the existing target : position, rotation, scaling, uvs, colors, pivot, parent, visibility, alive
   * @param target the particle target
   * @returns the current particle
   */
  copyToRef(e) {
    return e.position.copyFrom(this.position), e.rotation.copyFrom(this.rotation), this.rotationQuaternion && (e.rotationQuaternion ? e.rotationQuaternion.copyFrom(this.rotationQuaternion) : e.rotationQuaternion = this.rotationQuaternion.clone()), e.scaling.copyFrom(this.scaling), this.color && (e.color ? e.color.copyFrom(this.color) : e.color = this.color.clone()), e.uvs.copyFrom(this.uvs), e.velocity.copyFrom(this.velocity), e.pivot.copyFrom(this.pivot), e.translateFromPivot = this.translateFromPivot, e.alive = this.alive, e.isVisible = this.isVisible, e.parentId = this.parentId, e.cullingStrategy = this.cullingStrategy, this.materialIndex !== null && (e.materialIndex = this.materialIndex), this;
  }
  /**
   * Legacy support, changed scale to scaling
   */
  get scale() {
    return this.scaling;
  }
  /**
   * Legacy support, changed scale to scaling
   */
  set scale(e) {
    this.scaling = e;
  }
  /**
   * Legacy support, changed quaternion to rotationQuaternion
   */
  get quaternion() {
    return this.rotationQuaternion;
  }
  /**
   * Legacy support, changed quaternion to rotationQuaternion
   */
  set quaternion(e) {
    this.rotationQuaternion = e;
  }
  /**
   * Returns a boolean. True if the particle intersects another particle or another mesh, else false.
   * The intersection is computed on the particle bounding sphere and Axis Aligned Bounding Box (AABB)
   * @param target is the object (solid particle or mesh) what the intersection is computed against.
   * @returns true if it intersects
   */
  intersectsMesh(e) {
    return !this._boundingInfo || !e.hasBoundingInfo ? !1 : this._sps._bSphereOnly ? rg.Intersects(this._boundingInfo.boundingSphere, e.getBoundingInfo().boundingSphere) : this._boundingInfo.intersects(e.getBoundingInfo(), !1);
  }
  /**
   * Returns `true` if the solid particle is within the frustum defined by the passed array of planes.
   * A particle is in the frustum if its bounding box intersects the frustum
   * @param frustumPlanes defines the frustum to test
   * @returns true if the particle is in the frustum planes
   */
  isInFrustum(e) {
    return this._boundingInfo !== null && this._boundingInfo.isInFrustum(e, this.cullingStrategy);
  }
  /**
   * get the rotation matrix of the particle
   * @internal
   */
  getRotationMatrix(e) {
    let t;
    if (this.rotationQuaternion)
      t = this.rotationQuaternion;
    else {
      t = ue.Quaternion[0];
      const r = this.rotation;
      Ze.RotationYawPitchRollToRef(r.y, r.x, r.z, t);
    }
    t.toRotationMatrix(e);
  }
}
class xF {
  /**
   * Get or set the shapeId
   * @deprecated Please use shapeId instead
   */
  get shapeID() {
    return this.shapeId;
  }
  set shapeID(e) {
    this.shapeId = e;
  }
  /**
   * Creates a ModelShape object. This is an internal simplified reference to a mesh used as for a model to replicate particles from by the SPS.
   * SPS internal tool, don't use it manually.
   * @internal
   */
  constructor(e, t, r, n, i, s, a, f, o) {
    this._indicesLength = 0, this.shapeId = e, this._shape = t, this._indices = r, this._indicesLength = r.length, this._shapeUV = s, this._shapeColors = i, this._normals = n, this._positionFunction = a, this._vertexFunction = f, this._material = o;
  }
}
class zne {
  /**
   * Creates a new sorted particle
   * @param idx
   * @param ind
   * @param indLength
   * @param materialIndex
   */
  constructor(e, t, r, n) {
    this.idx = 0, this.ind = 0, this.indicesLength = 0, this.sqDistance = 0, this.materialIndex = 0, this.idx = e, this.ind = t, this.indicesLength = r, this.materialIndex = n;
  }
}
class Gne {
  /**
   * Creates a new solid particle vertex
   */
  constructor() {
    this.position = S.Zero(), this.color = new xt(1, 1, 1, 1), this.uv = at.Zero();
  }
  // Getters and Setters for back-compatibility
  /** Vertex x coordinate */
  get x() {
    return this.position.x;
  }
  set x(e) {
    this.position.x = e;
  }
  /** Vertex y coordinate */
  get y() {
    return this.position.y;
  }
  set y(e) {
    this.position.y = e;
  }
  /** Vertex z coordinate */
  get z() {
    return this.position.z;
  }
  set z(e) {
    this.position.z = e;
  }
}
class Jhe {
  /**
   * Creates a SPS (Solid Particle System) object.
   * @param name (String) is the SPS name, this will be the underlying mesh name.
   * @param scene (Scene) is the scene in which the SPS is added.
   * @param options defines the options of the sps e.g.
   * * updatable (optional boolean, default true) : if the SPS must be updatable or immutable.
   * * isPickable (optional boolean, default false) : if the solid particles must be pickable.
   * * enableDepthSort (optional boolean, default false) : if the solid particles must be sorted in the geometry according to their distance to the camera.
   * * useModelMaterial (optional boolean, default false) : if the model materials must be used to create the SPS multimaterial. This enables the multimaterial supports of the SPS.
   * * enableMultiMaterial (optional boolean, default false) : if the solid particles can be given different materials.
   * * expandable (optional boolean, default false) : if particles can still be added after the initial SPS mesh creation.
   * * particleIntersection (optional boolean, default false) : if the solid particle intersections must be computed.
   * * boundingSphereOnly (optional boolean, default false) : if the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster).
   * * bSphereRadiusFactor (optional float, default 1.0) : a number to multiply the bounding sphere radius by in order to reduce it for instance.
   * * computeBoundingBox (optional boolean, default false): if the bounding box of the entire SPS will be computed (for occlusion detection, for example). If it is false, the bounding box will be the bounding box of the first particle.
   * * autoFixFaceOrientation (optional boolean, default false): if the particle face orientations will be flipped for transformations that change orientation (scale (-1, 1, 1), for example)
   * @param options.updatable
   * @param options.isPickable
   * @param options.enableDepthSort
   * @param options.particleIntersection
   * @param options.boundingSphereOnly
   * @param options.bSphereRadiusFactor
   * @param options.expandable
   * @param options.useModelMaterial
   * @param options.enableMultiMaterial
   * @param options.computeBoundingBox
   * @param options.autoFixFaceOrientation
   * @example bSphereRadiusFactor = 1.0 / Math.sqrt(3.0) => the bounding sphere exactly matches a spherical mesh.
   */
  constructor(e, t, r) {
    this.particles = new Array(), this.nbParticles = 0, this.billboard = !1, this.recomputeNormals = !1, this.counter = 0, this.vars = {}, this._bSphereOnly = !1, this._bSphereRadiusFactor = 1, this._positions = new Array(), this._indices = new Array(), this._normals = new Array(), this._colors = new Array(), this._uvs = new Array(), this._index = 0, this._updatable = !0, this._pickable = !1, this._isVisibilityBoxLocked = !1, this._alwaysVisible = !1, this._depthSort = !1, this._expandable = !1, this._shapeCounter = 0, this._copy = new bF(0, 0, 0, 0, null, 0, 0, this), this._color = new xt(0, 0, 0, 0), this._computeParticleColor = !0, this._computeParticleTexture = !0, this._computeParticleRotation = !0, this._computeParticleVertex = !1, this._computeBoundingBox = !1, this._autoFixFaceOrientation = !1, this._depthSortParticles = !0, this._mustUnrotateFixedNormals = !1, this._particlesIntersect = !1, this._needs32Bits = !1, this._isNotBuilt = !0, this._lastParticleId = 0, this._idxOfId = [], this._multimaterialEnabled = !1, this._useModelMaterial = !1, this._depthSortFunction = (n, i) => i.sqDistance - n.sqDistance, this._materialSortFunction = (n, i) => n.materialIndex - i.materialIndex, this._autoUpdateSubMeshes = !1, this._recomputeInvisibles = !1, this.name = e, this._scene = t || gr.LastCreatedScene, this._camera = t.activeCamera, this._pickable = r ? r.isPickable : !1, this._depthSort = r ? r.enableDepthSort : !1, this._multimaterialEnabled = r ? r.enableMultiMaterial : !1, this._useModelMaterial = r ? r.useModelMaterial : !1, this._multimaterialEnabled = this._useModelMaterial ? !0 : this._multimaterialEnabled, this._expandable = r ? r.expandable : !1, this._particlesIntersect = r ? r.particleIntersection : !1, this._bSphereOnly = r ? r.boundingSphereOnly : !1, this._bSphereRadiusFactor = r && r.bSphereRadiusFactor ? r.bSphereRadiusFactor : 1, this._computeBoundingBox = r != null && r.computeBoundingBox ? r.computeBoundingBox : !1, this._autoFixFaceOrientation = r != null && r.autoFixFaceOrientation ? r.autoFixFaceOrientation : !1, r && r.updatable !== void 0 ? this._updatable = r.updatable : this._updatable = !0, this._pickable && (this.pickedBySubMesh = [[]], this.pickedParticles = this.pickedBySubMesh[0]), (this._depthSort || this._multimaterialEnabled) && (this.depthSortedParticles = []), this._multimaterialEnabled && (this._multimaterial = new Dc(this.name + "MultiMaterial", this._scene), this._materials = [], this._materialIndexesById = {}), this._tmpVertex = new Gne();
  }
  /**
   * Builds the SPS underlying mesh. Returns a standard Mesh.
   * If no model shape was added to the SPS, the returned mesh is just a single triangular plane.
   * @returns the created mesh
   */
  buildMesh() {
    if (!this._isNotBuilt && this.mesh)
      return this.mesh;
    if (this.nbParticles === 0 && !this.mesh) {
      const t = uU("", { radius: 1, tessellation: 3 }, this._scene);
      this.addShape(t, 1), t.dispose();
    }
    if (this._indices32 = this._needs32Bits ? new Uint32Array(this._indices) : new Uint16Array(this._indices), this._positions32 = new Float32Array(this._positions), this._uvs32 = new Float32Array(this._uvs), this._colors32 = new Float32Array(this._colors), !this.mesh) {
      const t = new Ee(this.name, this._scene);
      this.mesh = t;
    }
    !this._updatable && this._multimaterialEnabled && this._sortParticlesByMaterial(), this.recomputeNormals && Ut.ComputeNormals(this._positions32, this._indices32, this._normals), this._normals32 = new Float32Array(this._normals), this._fixedNormal32 = new Float32Array(this._normals), this._mustUnrotateFixedNormals && this._unrotateFixedNormals();
    const e = new Ut();
    if (e.indices = this._depthSort ? this._indices : this._indices32, e.set(this._positions32, J.PositionKind), e.set(this._normals32, J.NormalKind), this._uvs32.length > 0 && e.set(this._uvs32, J.UVKind), this._colors32.length > 0 && e.set(this._colors32, J.ColorKind), e.applyToMesh(this.mesh, this._updatable), this.mesh.isPickable = this._pickable, this._pickable) {
      let t = 0;
      for (let r = 0; r < this.nbParticles; r++) {
        const n = this.particles[r], i = n._model._indicesLength;
        for (let s = 0; s < i; s++)
          if (s % 3 == 0) {
            const f = { idx: n.idx, faceId: t };
            this.pickedParticles[t] = f, t++;
          }
      }
    }
    return this._multimaterialEnabled && this.setMultiMaterial(this._materials), this._expandable || (!this._depthSort && !this._multimaterialEnabled && !this._autoFixFaceOrientation && (this._indices = null), this._positions = null, this._normals = null, this._uvs = null, this._colors = null, this._updatable || (this.particles.length = 0)), this._isNotBuilt = !1, this.recomputeNormals = !1, this._recomputeInvisibles = !0, this.mesh;
  }
  _getUVKind(e, t) {
    var r, n;
    return t === -1 && (!((r = e.material) === null || r === void 0) && r.diffuseTexture ? t = e.material.diffuseTexture.coordinatesIndex : !((n = e.material) === null || n === void 0) && n.albedoTexture && (t = e.material.albedoTexture.coordinatesIndex)), "uv" + (t ? t + 1 : "");
  }
  /**
   * Digests the mesh and generates as many solid particles in the system as wanted. Returns the SPS.
   * These particles will have the same geometry than the mesh parts and will be positioned at the same localisation than the mesh original places.
   * Thus the particles generated from `digest()` have their property `position` set yet.
   * @param mesh ( Mesh ) is the mesh to be digested
   * @param options {facetNb} (optional integer, default 1) is the number of mesh facets per particle, this parameter is overridden by the parameter `number` if any
   * {delta} (optional integer, default 0) is the random extra number of facets per particle , each particle will have between `facetNb` and `facetNb + delta` facets
   * {number} (optional positive integer) is the wanted number of particles : each particle is built with `mesh_total_facets / number` facets
   * {storage} (optional existing array) is an array where the particles will be stored for a further use instead of being inserted in the SPS.
   * {uvKind} (optional positive integer, default 0) is the kind of UV to read from. Use -1 to deduce it from the diffuse/albedo texture (if any) of the mesh material
   * @param options.facetNb
   * @param options.number
   * @param options.delta
   * @param options.storage
   * @param options.uvKind
   * @returns the current SPS
   */
  digest(e, t) {
    var r;
    let n = t && t.facetNb || 1, i = t && t.number || 0, s = t && t.delta || 0;
    const a = e.getVerticesData(J.PositionKind), f = e.getIndices(), o = e.getVerticesData(this._getUVKind(e, (r = t == null ? void 0 : t.uvKind) !== null && r !== void 0 ? r : 0)), d = e.getVerticesData(J.ColorKind), v = e.getVerticesData(J.NormalKind), u = t && t.storage ? t.storage : null;
    let l = 0;
    const P = f.length / 3;
    i ? (i = i > P ? P : i, n = Math.round(P / i), s = 0) : n = n > P ? P : n;
    const p = [], c = [], H = [], T = [], q = [], b = S.Zero(), j = n;
    for (; l < P; ) {
      n = j + Math.floor((1 + s) * Math.random()), l > P - n && (n = P - l), p.length = 0, c.length = 0, H.length = 0, T.length = 0, q.length = 0;
      let w = 0;
      for (let L = l * 3; L < (l + n) * 3; L++) {
        H.push(w);
        const $ = f[L], ae = $ * 3;
        if (p.push(a[ae], a[ae + 1], a[ae + 2]), c.push(v[ae], v[ae + 1], v[ae + 2]), o) {
          const Pe = $ * 2;
          T.push(o[Pe], o[Pe + 1]);
        }
        if (d) {
          const Pe = $ * 4;
          q.push(d[Pe], d[Pe + 1], d[Pe + 2], d[Pe + 3]);
        }
        w++;
      }
      let m = this.nbParticles;
      const I = this._posToShape(p), N = this._uvsToShapeUV(T), k = H.slice(), R = q.slice(), y = c.slice();
      b.copyFromFloats(0, 0, 0);
      let O;
      for (O = 0; O < I.length; O++)
        b.addInPlace(I[O]);
      b.scaleInPlace(1 / I.length);
      const Y = new S(1 / 0, 1 / 0, 1 / 0), ee = new S(-1 / 0, -1 / 0, -1 / 0);
      for (O = 0; O < I.length; O++)
        I[O].subtractInPlace(b), Y.minimizeInPlaceFromFloats(I[O].x, I[O].y, I[O].z), ee.maximizeInPlaceFromFloats(I[O].x, I[O].y, I[O].z);
      let Z;
      this._particlesIntersect && (Z = new Md(Y, ee));
      let te = null;
      this._useModelMaterial && (te = e.material ? e.material : this._setDefaultMaterial());
      const fe = new xF(this._shapeCounter, I, k, y, R, N, null, null, te), _ = this._positions.length, G = this._indices.length;
      this._meshBuilder(this._index, G, I, this._positions, k, this._indices, T, this._uvs, R, this._colors, y, this._normals, m, 0, null, fe), this._addParticle(m, this._lastParticleId, _, G, fe, this._shapeCounter, 0, Z, u), this.particles[this.nbParticles].position.addInPlace(b), u || (this._index += I.length, m++, this.nbParticles++, this._lastParticleId++), this._shapeCounter++, l += n;
    }
    return this._isNotBuilt = !0, this;
  }
  /**
   * Unrotate the fixed normals in case the mesh was built with pre-rotated particles, ex : use of positionFunction in addShape()
   * @internal
   */
  _unrotateFixedNormals() {
    let e = 0, t = 0;
    const r = ue.Vector3[0], n = ue.Quaternion[0], i = ue.Matrix[0];
    for (let s = 0; s < this.particles.length; s++) {
      const a = this.particles[s], f = a._model._shape;
      if (a.rotationQuaternion)
        a.rotationQuaternion.conjugateToRef(n);
      else {
        const o = a.rotation;
        Ze.RotationYawPitchRollToRef(o.y, o.x, o.z, n), n.conjugateInPlace();
      }
      n.toRotationMatrix(i);
      for (let o = 0; o < f.length; o++)
        t = e + o * 3, S.TransformNormalFromFloatsToRef(this._normals32[t], this._normals32[t + 1], this._normals32[t + 2], i, r), r.toArray(this._fixedNormal32, t);
      e = t + 3;
    }
  }
  /**
   * Resets the temporary working copy particle
   * @internal
   */
  _resetCopy() {
    const e = this._copy;
    e.position.setAll(0), e.rotation.setAll(0), e.rotationQuaternion = null, e.scaling.setAll(1), e.uvs.copyFromFloats(0, 0, 1, 1), e.color = null, e.translateFromPivot = !1, e.shapeId = 0, e.materialIndex = null;
  }
  /**
   * Inserts the shape model geometry in the global SPS mesh by updating the positions, indices, normals, colors, uvs arrays
   * @param p the current index in the positions array to be updated
   * @param ind the current index in the indices array
   * @param shape a Vector3 array, the shape geometry
   * @param positions the positions array to be updated
   * @param meshInd the shape indices array
   * @param indices the indices array to be updated
   * @param meshUV the shape uv array
   * @param uvs the uv array to be updated
   * @param meshCol the shape color array
   * @param colors the color array to be updated
   * @param meshNor the shape normals array
   * @param normals the normals array to be updated
   * @param idx the particle index
   * @param idxInShape the particle index in its shape
   * @param options the addShape() method  passed options
   * @param model
   * @model the particle model
   * @internal
   */
  _meshBuilder(e, t, r, n, i, s, a, f, o, d, v, u, l, P, p, c) {
    let H, T = 0, q = 0, b = 0;
    this._resetCopy();
    const j = this._copy, w = !!(p && p.storage);
    if (j.idx = l, j.idxInShape = P, j.shapeId = c.shapeId, this._useModelMaterial) {
      const Z = c._material.uniqueId, te = this._materialIndexesById;
      Object.prototype.hasOwnProperty.call(te, Z) || (te[Z] = this._materials.length, this._materials.push(c._material));
      const fe = te[Z];
      j.materialIndex = fe;
    }
    if (p && p.positionFunction && (p.positionFunction(j, l, P), this._mustUnrotateFixedNormals = !0), w)
      return j;
    const m = ue.Matrix[0], I = this._tmpVertex, N = I.position, k = I.color, R = I.uv, y = ue.Vector3[1], O = ue.Vector3[2], Y = ue.Vector3[3];
    he.IdentityToRef(m), j.getRotationMatrix(m), j.pivot.multiplyToRef(j.scaling, Y), j.translateFromPivot ? O.setAll(0) : O.copyFrom(Y);
    const ee = p && p.vertexFunction;
    for (H = 0; H < r.length; H++) {
      if (N.copyFrom(r[H]), j.color && k.copyFrom(j.color), a && R.copyFromFloats(a[T], a[T + 1]), ee && p.vertexFunction(j, I, H), N.multiplyInPlace(j.scaling).subtractInPlace(Y), S.TransformCoordinatesToRef(N, m, y), y.addInPlace(O).addInPlace(j.position), n.push(y.x, y.y, y.z), a) {
        const Z = j.uvs;
        f.push((Z.z - Z.x) * R.x + Z.x, (Z.w - Z.y) * R.y + Z.y), T += 2;
      }
      if (j.color)
        this._color.copyFrom(k);
      else {
        const Z = this._color;
        o && o[q] !== void 0 ? (Z.r = o[q], Z.g = o[q + 1], Z.b = o[q + 2], Z.a = o[q + 3]) : (Z.r = 1, Z.g = 1, Z.b = 1, Z.a = 1);
      }
      d.push(this._color.r, this._color.g, this._color.b, this._color.a), q += 4, !this.recomputeNormals && v && (S.TransformNormalFromFloatsToRef(v[b], v[b + 1], v[b + 2], m, N), u.push(N.x, N.y, N.z), b += 3);
    }
    for (H = 0; H < i.length; H++) {
      const Z = e + i[H];
      s.push(Z), Z > 65535 && (this._needs32Bits = !0);
    }
    if (this._depthSort || this._multimaterialEnabled) {
      const Z = j.materialIndex !== null ? j.materialIndex : 0;
      this.depthSortedParticles.push(new zne(l, t, i.length, Z));
    }
    return j;
  }
  /**
   * Returns a shape Vector3 array from positions float array
   * @param positions float array
   * @returns a vector3 array
   * @internal
   */
  _posToShape(e) {
    const t = [];
    for (let r = 0; r < e.length; r += 3)
      t.push(S.FromArray(e, r));
    return t;
  }
  /**
   * Returns a shapeUV array from a float uvs (array deep copy)
   * @param uvs as a float array
   * @returns a shapeUV array
   * @internal
   */
  _uvsToShapeUV(e) {
    const t = [];
    if (e)
      for (let r = 0; r < e.length; r++)
        t.push(e[r]);
    return t;
  }
  /**
   * Adds a new particle object in the particles array
   * @param idx particle index in particles array
   * @param id particle id
   * @param idxpos positionIndex : the starting index of the particle vertices in the SPS "positions" array
   * @param idxind indiceIndex : he starting index of the particle indices in the SPS "indices" array
   * @param model particle ModelShape object
   * @param shapeId model shape identifier
   * @param idxInShape index of the particle in the current model
   * @param bInfo model bounding info object
   * @param storage target storage array, if any
   * @internal
   */
  _addParticle(e, t, r, n, i, s, a, f = null, o = null) {
    const d = new bF(e, t, r, n, i, s, a, this, f);
    return (o || this.particles).push(d), d;
  }
  /**
   * Adds some particles to the SPS from the model shape. Returns the shape id.
   * Please read the doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/immutable_sps
   * @param mesh is any Mesh object that will be used as a model for the solid particles. If the mesh does not have vertex normals, it will turn on the recomputeNormals attribute.
   * @param nb (positive integer) the number of particles to be created from this model
   * @param options {positionFunction} is an optional javascript function to called for each particle on SPS creation.
   * {vertexFunction} is an optional javascript function to called for each vertex of each particle on SPS creation
   * {storage} (optional existing array) is an array where the particles will be stored for a further use instead of being inserted in the SPS.
   * @param options.positionFunction
   * @param options.vertexFunction
   * @param options.storage
   * @returns the number of shapes in the system
   */
  addShape(e, t, r) {
    const n = e.getVerticesData(J.PositionKind), i = e.getIndices(), s = e.getVerticesData(J.UVKind), a = e.getVerticesData(J.ColorKind), f = e.getVerticesData(J.NormalKind);
    this.recomputeNormals = !f;
    const o = Array.from(i), d = f ? Array.from(f) : [], v = a ? Array.from(a) : [], u = r && r.storage ? r.storage : null;
    let l = null;
    this._particlesIntersect && (l = e.getBoundingInfo());
    const P = this._posToShape(n), p = this._uvsToShapeUV(s), c = r ? r.positionFunction : null, H = r ? r.vertexFunction : null;
    let T = null;
    this._useModelMaterial && (T = e.material ? e.material : this._setDefaultMaterial());
    const q = new xF(this._shapeCounter, P, o, d, v, p, c, H, T);
    for (let b = 0; b < t; b++)
      this._insertNewParticle(this.nbParticles, b, q, P, i, s, a, f, l, u, r);
    return this._shapeCounter++, this._isNotBuilt = !0, this._shapeCounter - 1;
  }
  /**
   * Rebuilds a particle back to its just built status : if needed, recomputes the custom positions and vertices
   * @internal
   */
  _rebuildParticle(e, t = !1) {
    this._resetCopy();
    const r = this._copy;
    e._model._positionFunction && e._model._positionFunction(r, e.idx, e.idxInShape);
    const n = ue.Matrix[0], i = ue.Vector3[0], s = ue.Vector3[1], a = ue.Vector3[2], f = ue.Vector3[3];
    r.getRotationMatrix(n), e.pivot.multiplyToRef(e.scaling, f), r.translateFromPivot ? a.copyFromFloats(0, 0, 0) : a.copyFrom(f);
    const o = e._model._shape;
    for (let d = 0; d < o.length; d++)
      i.copyFrom(o[d]), e._model._vertexFunction && e._model._vertexFunction(r, i, d), i.multiplyInPlace(r.scaling).subtractInPlace(f), S.TransformCoordinatesToRef(i, n, s), s.addInPlace(a).addInPlace(r.position).toArray(this._positions32, e._pos + d * 3);
    t && (e.position.setAll(0), e.rotation.setAll(0), e.rotationQuaternion = null, e.scaling.setAll(1), e.uvs.setAll(0), e.pivot.setAll(0), e.translateFromPivot = !1, e.parentId = null);
  }
  /**
   * Rebuilds the whole mesh and updates the VBO : custom positions and vertices are recomputed if needed.
   * @param reset boolean, default false : if the particles must be reset at position and rotation zero, scaling 1, color white, initial UVs and not parented.
   * @returns the SPS.
   */
  rebuildMesh(e = !1) {
    for (let t = 0; t < this.particles.length; t++)
      this._rebuildParticle(this.particles[t], e);
    return this.mesh.updateVerticesData(J.PositionKind, this._positions32, !1, !1), this;
  }
  /** Removes the particles from the start-th to the end-th included from an expandable SPS (required).
   *  Returns an array with the removed particles.
   *  If the number of particles to remove is lower than zero or greater than the global remaining particle number, then an empty array is returned.
   *  The SPS can't be empty so at least one particle needs to remain in place.
   *  Under the hood, the VertexData array, so the VBO buffer, is recreated each call.
   * @param start index of the first particle to remove
   * @param end index of the last particle to remove (included)
   * @returns an array populated with the removed particles
   */
  removeParticles(e, t) {
    const r = t - e + 1;
    if (!this._expandable || r <= 0 || r >= this.nbParticles || !this._updatable)
      return [];
    const n = this.particles, i = this.nbParticles;
    if (t < i - 1) {
      const o = t + 1, d = n[o]._pos - n[e]._pos, v = n[o]._ind - n[e]._ind;
      for (let u = o; u < i; u++) {
        const l = n[u];
        l._pos -= d, l._ind -= v;
      }
    }
    const s = n.splice(e, r);
    this._positions.length = 0, this._indices.length = 0, this._colors.length = 0, this._uvs.length = 0, this._normals.length = 0, this._index = 0, this._idxOfId.length = 0, (this._depthSort || this._multimaterialEnabled) && (this.depthSortedParticles = []);
    let a = 0;
    const f = n.length;
    for (let o = 0; o < f; o++) {
      const d = n[o], v = d._model, u = v._shape, l = v._indices, P = v._normals, p = v._shapeColors, c = v._shapeUV;
      d.idx = o, this._idxOfId[d.id] = o, this._meshBuilder(this._index, a, u, this._positions, l, this._indices, c, this._uvs, p, this._colors, P, this._normals, d.idx, d.idxInShape, null, v), this._index += u.length, a += l.length;
    }
    return this.nbParticles -= r, this._isNotBuilt = !0, s;
  }
  /**
   * Inserts some pre-created particles in the solid particle system so that they can be managed by setParticles().
   * @param solidParticleArray an array populated with Solid Particles objects
   * @returns the SPS
   */
  insertParticlesFromArray(e) {
    if (!this._expandable)
      return this;
    let t = 0, r = e[0].shapeId;
    const n = e.length;
    for (let i = 0; i < n; i++) {
      const s = e[i], a = s._model, f = a._shape, o = a._indices, d = a._shapeUV, v = a._shapeColors, u = a._normals, l = !u;
      this.recomputeNormals = l || this.recomputeNormals;
      const P = s.getBoundingInfo(), p = this._insertNewParticle(this.nbParticles, t, a, f, o, d, v, u, P, null, null);
      s.copyToRef(p), t++, r != s.shapeId && (r = s.shapeId, t = 0);
    }
    return this._isNotBuilt = !0, this;
  }
  /**
   * Creates a new particle and modifies the SPS mesh geometry :
   * - calls _meshBuilder() to increase the SPS mesh geometry step by step
   * - calls _addParticle() to populate the particle array
   * factorized code from addShape() and insertParticlesFromArray()
   * @param idx particle index in the particles array
   * @param i particle index in its shape
   * @param modelShape particle ModelShape object
   * @param shape shape vertex array
   * @param meshInd shape indices array
   * @param meshUV shape uv array
   * @param meshCol shape color array
   * @param meshNor shape normals array
   * @param bbInfo shape bounding info
   * @param storage target particle storage
   * @param options
   * @options addShape() passed options
   * @internal
   */
  _insertNewParticle(e, t, r, n, i, s, a, f, o, d, v) {
    const u = this._positions.length, l = this._indices.length, P = this._meshBuilder(this._index, l, n, this._positions, i, this._indices, s, this._uvs, a, this._colors, f, this._normals, e, t, v, r);
    let p = null;
    return this._updatable && (p = this._addParticle(this.nbParticles, this._lastParticleId, u, l, r, this._shapeCounter, t, o, d), p.position.copyFrom(P.position), p.rotation.copyFrom(P.rotation), P.rotationQuaternion && (p.rotationQuaternion ? p.rotationQuaternion.copyFrom(P.rotationQuaternion) : p.rotationQuaternion = P.rotationQuaternion.clone()), P.color && (p.color ? p.color.copyFrom(P.color) : p.color = P.color.clone()), p.scaling.copyFrom(P.scaling), p.uvs.copyFrom(P.uvs), P.materialIndex !== null && (p.materialIndex = P.materialIndex), this.expandable && (this._idxOfId[p.id] = p.idx)), d || (this._index += n.length, this.nbParticles++, this._lastParticleId++), p;
  }
  /**
   *  Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc.
   *  This method calls `updateParticle()` for each particle of the SPS.
   *  For an animated SPS, it is usually called within the render loop.
   * This methods does nothing if called on a non updatable or not yet built SPS. Example : buildMesh() not called after having added or removed particles from an expandable SPS.
   * @param start The particle index in the particle array where to start to compute the particle property values _(default 0)_
   * @param end The particle index in the particle array where to stop to compute the particle property values _(default nbParticle - 1)_
   * @param update If the mesh must be finally updated on this call after all the particle computations _(default true)_
   * @returns the SPS.
   */
  setParticles(e = 0, t = this.nbParticles - 1, r = !0) {
    if (!this._updatable || this._isNotBuilt)
      return this;
    this.beforeUpdateParticles(e, t, r);
    const n = ue.Matrix[0], i = ue.Matrix[1], s = this.mesh, a = this._colors32, f = this._positions32, o = this._normals32, d = this._uvs32, v = this._indices32, u = this._indices, l = this._fixedNormal32, P = this._depthSort && this._depthSortParticles, p = ue.Vector3, c = p[5].copyFromFloats(1, 0, 0), H = p[6].copyFromFloats(0, 1, 0), T = p[7].copyFromFloats(0, 0, 1), q = p[8].setAll(Number.MAX_VALUE), b = p[9].setAll(-Number.MAX_VALUE), j = p[10].setAll(0), w = this._tmpVertex, m = w.position, I = w.color, N = w.uv;
    if ((this.billboard || this._depthSort) && (this.mesh.computeWorldMatrix(!0), this.mesh._worldMatrix.invertToRef(i)), this.billboard) {
      const fe = p[0];
      this._camera.getDirectionToRef(bf.Z, fe), S.TransformNormalToRef(fe, i, T), T.normalize();
      const _ = this._camera.getViewMatrix(!0);
      S.TransformNormalFromFloatsToRef(_.m[1], _.m[5], _.m[9], i, H), S.CrossToRef(H, T, c), H.normalize(), c.normalize();
    }
    this._depthSort && S.TransformCoordinatesToRef(this._camera.globalPosition, i, j), he.IdentityToRef(n);
    let k = 0, R = 0, y = 0, O = 0, Y = 0, ee = 0, Z = 0;
    if (this.mesh.isFacetDataEnabled && (this._computeBoundingBox = !0), t = t >= this.nbParticles ? this.nbParticles - 1 : t, this._computeBoundingBox && (e != 0 || t != this.nbParticles - 1)) {
      const fe = this.mesh.getBoundingInfo();
      fe && (q.copyFrom(fe.minimum), b.copyFrom(fe.maximum));
    }
    R = this.particles[e]._pos;
    const te = R / 3 | 0;
    O = te * 4, ee = te * 2;
    for (let fe = e; fe <= t; fe++) {
      const _ = this.particles[fe];
      this.updateParticle(_);
      const G = _._model._shape, L = _._model._shapeUV, $ = _._rotationMatrix, ae = _.position, Pe = _.rotation, ge = _.scaling, me = _._globalPosition;
      if (P) {
        const Xe = this.depthSortedParticles[fe];
        Xe.idx = _.idx, Xe.ind = _._ind, Xe.indicesLength = _._model._indicesLength, Xe.sqDistance = S.DistanceSquared(_.position, j);
      }
      if (!_.alive || _._stillInvisible && !_.isVisible && !this._recomputeInvisibles) {
        Z = G.length, R += Z * 3, O += Z * 4, ee += Z * 2;
        continue;
      }
      if (_.isVisible) {
        _._stillInvisible = !1;
        const Xe = p[12];
        if (_.pivot.multiplyToRef(ge, Xe), this.billboard && (Pe.x = 0, Pe.y = 0), (this._computeParticleRotation || this.billboard) && _.getRotationMatrix(n), _.parentId !== null) {
          const re = this.getParticleById(_.parentId);
          if (re) {
            const ve = re._rotationMatrix, qe = re._globalPosition, ke = ae.x * ve[1] + ae.y * ve[4] + ae.z * ve[7], be = ae.x * ve[0] + ae.y * ve[3] + ae.z * ve[6], Fe = ae.x * ve[2] + ae.y * ve[5] + ae.z * ve[8];
            if (me.x = qe.x + be, me.y = qe.y + ke, me.z = qe.z + Fe, this._computeParticleRotation || this.billboard) {
              const Ke = n.m;
              $[0] = Ke[0] * ve[0] + Ke[1] * ve[3] + Ke[2] * ve[6], $[1] = Ke[0] * ve[1] + Ke[1] * ve[4] + Ke[2] * ve[7], $[2] = Ke[0] * ve[2] + Ke[1] * ve[5] + Ke[2] * ve[8], $[3] = Ke[4] * ve[0] + Ke[5] * ve[3] + Ke[6] * ve[6], $[4] = Ke[4] * ve[1] + Ke[5] * ve[4] + Ke[6] * ve[7], $[5] = Ke[4] * ve[2] + Ke[5] * ve[5] + Ke[6] * ve[8], $[6] = Ke[8] * ve[0] + Ke[9] * ve[3] + Ke[10] * ve[6], $[7] = Ke[8] * ve[1] + Ke[9] * ve[4] + Ke[10] * ve[7], $[8] = Ke[8] * ve[2] + Ke[9] * ve[5] + Ke[10] * ve[8];
            }
          } else
            _.parentId = null;
        } else if (me.x = ae.x, me.y = ae.y, me.z = ae.z, this._computeParticleRotation || this.billboard) {
          const re = n.m;
          $[0] = re[0], $[1] = re[1], $[2] = re[2], $[3] = re[4], $[4] = re[5], $[5] = re[6], $[6] = re[8], $[7] = re[9], $[8] = re[10];
        }
        const ne = p[11];
        for (_.translateFromPivot ? ne.setAll(0) : ne.copyFrom(Xe), Z = 0; Z < G.length; Z++) {
          k = R + Z * 3, y = O + Z * 4, Y = ee + Z * 2;
          const re = 2 * Z, ve = re + 1;
          m.copyFrom(G[Z]), this._computeParticleColor && _.color && I.copyFrom(_.color), this._computeParticleTexture && N.copyFromFloats(L[re], L[ve]), this._computeParticleVertex && this.updateParticleVertex(_, w, Z);
          const qe = m.x * ge.x - Xe.x, ke = m.y * ge.y - Xe.y, be = m.z * ge.z - Xe.z;
          let Fe = qe * $[0] + ke * $[3] + be * $[6], Ke = qe * $[1] + ke * $[4] + be * $[7], nt = qe * $[2] + ke * $[5] + be * $[8];
          Fe += ne.x, Ke += ne.y, nt += ne.z;
          const ut = f[k] = me.x + c.x * Fe + H.x * Ke + T.x * nt, bt = f[k + 1] = me.y + c.y * Fe + H.y * Ke + T.y * nt, wt = f[k + 2] = me.z + c.z * Fe + H.z * Ke + T.z * nt;
          if (this._computeBoundingBox && (q.minimizeInPlaceFromFloats(ut, bt, wt), b.maximizeInPlaceFromFloats(ut, bt, wt)), !this._computeParticleVertex) {
            const Tt = l[k], lr = l[k + 1], Qt = l[k + 2], tr = Tt * $[0] + lr * $[3] + Qt * $[6], br = Tt * $[1] + lr * $[4] + Qt * $[7], Xn = Tt * $[2] + lr * $[5] + Qt * $[8];
            o[k] = c.x * tr + H.x * br + T.x * Xn, o[k + 1] = c.y * tr + H.y * br + T.y * Xn, o[k + 2] = c.z * tr + H.z * br + T.z * Xn;
          }
          if (this._computeParticleColor && _.color) {
            const Tt = this._colors32;
            Tt[y] = I.r, Tt[y + 1] = I.g, Tt[y + 2] = I.b, Tt[y + 3] = I.a;
          }
          if (this._computeParticleTexture) {
            const Tt = _.uvs;
            d[Y] = N.x * (Tt.z - Tt.x) + Tt.x, d[Y + 1] = N.y * (Tt.w - Tt.y) + Tt.y;
          }
        }
      } else
        for (_._stillInvisible = !0, Z = 0; Z < G.length; Z++) {
          if (k = R + Z * 3, y = O + Z * 4, Y = ee + Z * 2, f[k] = f[k + 1] = f[k + 2] = 0, o[k] = o[k + 1] = o[k + 2] = 0, this._computeParticleColor && _.color) {
            const Xe = _.color;
            a[y] = Xe.r, a[y + 1] = Xe.g, a[y + 2] = Xe.b, a[y + 3] = Xe.a;
          }
          if (this._computeParticleTexture) {
            const Xe = _.uvs;
            d[Y] = L[Z * 2] * (Xe.z - Xe.x) + Xe.x, d[Y + 1] = L[Z * 2 + 1] * (Xe.w - Xe.y) + Xe.y;
          }
        }
      if (this._particlesIntersect) {
        const Xe = _.getBoundingInfo(), De = Xe.boundingBox, ne = Xe.boundingSphere, re = _._modelBoundingInfo;
        if (!this._bSphereOnly) {
          const nt = re.boundingBox.vectors, ut = p[1], bt = p[2];
          ut.setAll(Number.MAX_VALUE), bt.setAll(-Number.MAX_VALUE);
          for (let wt = 0; wt < 8; wt++) {
            const Tt = nt[wt].x * ge.x, lr = nt[wt].y * ge.y, Qt = nt[wt].z * ge.z, tr = Tt * $[0] + lr * $[3] + Qt * $[6], br = Tt * $[1] + lr * $[4] + Qt * $[7], Xn = Tt * $[2] + lr * $[5] + Qt * $[8], qr = ae.x + c.x * tr + H.x * br + T.x * Xn, En = ae.y + c.y * tr + H.y * br + T.y * Xn, Bn = ae.z + c.z * tr + H.z * br + T.z * Xn;
            ut.minimizeInPlaceFromFloats(qr, En, Bn), bt.maximizeInPlaceFromFloats(qr, En, Bn);
          }
          De.reConstruct(ut, bt, s._worldMatrix);
        }
        const ve = re.minimum.multiplyToRef(ge, p[1]), qe = re.maximum.multiplyToRef(ge, p[2]), ke = qe.addToRef(ve, p[3]).scaleInPlace(0.5).addInPlace(me), be = qe.subtractToRef(ve, p[4]).scaleInPlace(0.5 * this._bSphereRadiusFactor), Fe = ke.subtractToRef(be, p[1]), Ke = ke.addToRef(be, p[2]);
        ne.reConstruct(Fe, Ke, s._worldMatrix);
      }
      R = k + 3, O = y + 4, ee = Y + 2;
    }
    if (r) {
      if (this._computeParticleColor) {
        const _ = s.getVertexBuffer(J.ColorKind);
        _ && !s.isPickable ? _.updateDirectly(a, 0) : s.updateVerticesData(J.ColorKind, a, !1, !1);
      }
      if (this._computeParticleTexture) {
        const _ = s.getVertexBuffer(J.UVKind);
        _ && !s.isPickable ? _.updateDirectly(d, 0) : s.updateVerticesData(J.UVKind, d, !1, !1);
      }
      const fe = s.getVertexBuffer(J.PositionKind);
      if (fe && !s.isPickable ? fe.updateDirectly(f, 0) : s.updateVerticesData(J.PositionKind, f, !1, !1), !s.areNormalsFrozen || s.isFacetDataEnabled) {
        if (this._computeParticleVertex || s.isFacetDataEnabled) {
          const _ = s.isFacetDataEnabled ? s.getFacetDataParameters() : null;
          Ut.ComputeNormals(f, v, o, _);
          for (let G = 0; G < o.length; G++)
            l[G] = o[G];
        }
        if (!s.areNormalsFrozen) {
          const _ = s.getVertexBuffer(J.NormalKind);
          _ && !s.isPickable ? _.updateDirectly(o, 0) : s.updateVerticesData(J.NormalKind, o, !1, !1);
        }
      }
      if (P) {
        const _ = this.depthSortedParticles;
        _.sort(this._depthSortFunction);
        const G = _.length;
        let L = 0, $ = 0;
        for (let ae = 0; ae < G; ae++) {
          const Pe = _[ae], ge = Pe.indicesLength, me = Pe.ind;
          for (let Xe = 0; Xe < ge; Xe++)
            if (v[L] = u[me + Xe], L++, this._pickable && Xe % 3 == 0) {
              const ne = this.pickedParticles[$];
              ne.idx = Pe.idx, ne.faceId = $, $++;
            }
        }
      }
      if (this._autoFixFaceOrientation) {
        let _ = 0;
        for (let G = 0; G < this.particles.length; G++) {
          const L = P ? this.particles[this.depthSortedParticles[G].idx] : this.particles[G];
          if (L.scale.x * L.scale.y * L.scale.z < 0)
            for (let ae = 0; ae < L._model._indicesLength; ae += 3) {
              const Pe = u[L._ind + ae];
              v[_ + ae] = u[L._ind + ae + 1], v[_ + ae + 1] = Pe;
            }
          _ += L._model._indicesLength;
        }
      }
      (P || this._autoFixFaceOrientation) && s.updateIndices(v);
    }
    return this._computeBoundingBox && (s.hasBoundingInfo ? s.getBoundingInfo().reConstruct(q, b, s._worldMatrix) : s.buildBoundingInfo(q, b, s._worldMatrix)), this._autoUpdateSubMeshes && this.computeSubMeshes(), this._recomputeInvisibles = !1, this.afterUpdateParticles(e, t, r), this;
  }
  /**
   * Disposes the SPS.
   */
  dispose() {
    this.mesh.dispose(), this.vars = null, this._positions = null, this._indices = null, this._normals = null, this._uvs = null, this._colors = null, this._indices32 = null, this._positions32 = null, this._normals32 = null, this._fixedNormal32 = null, this._uvs32 = null, this._colors32 = null, this.pickedParticles = null, this.pickedBySubMesh = null, this._materials = null, this._materialIndexes = null, this._indicesByMaterial = null, this._idxOfId = null;
  }
  /** Returns an object {idx: number faceId: number} for the picked particle from the passed pickingInfo object.
   * idx is the particle index in the SPS
   * faceId is the picked face index counted within this particle.
   * Returns null if the pickInfo can't identify a picked particle.
   * @param pickingInfo (PickingInfo object)
   * @returns {idx: number, faceId: number} or null
   */
  pickedParticle(e) {
    if (e.hit) {
      const t = e.subMeshId, r = e.faceId - this.mesh.subMeshes[t].indexStart / 3, n = this.pickedBySubMesh;
      if (n[t] && n[t][r])
        return n[t][r];
    }
    return null;
  }
  /**
   * Returns a SolidParticle object from its identifier : particle.id
   * @param id (integer) the particle Id
   * @returns the searched particle or null if not found in the SPS.
   */
  getParticleById(e) {
    const t = this.particles[e];
    if (t && t.id == e)
      return t;
    const r = this.particles, n = this._idxOfId[e];
    if (n !== void 0)
      return r[n];
    let i = 0;
    const s = this.nbParticles;
    for (; i < s; ) {
      const a = r[i];
      if (a.id == e)
        return a;
      i++;
    }
    return null;
  }
  /**
   * Returns a new array populated with the particles having the passed shapeId.
   * @param shapeId (integer) the shape identifier
   * @returns a new solid particle array
   */
  getParticlesByShapeId(e) {
    const t = [];
    return this.getParticlesByShapeIdToRef(e, t), t;
  }
  /**
   * Populates the passed array "ref" with the particles having the passed shapeId.
   * @param shapeId the shape identifier
   * @returns the SPS
   * @param ref
   */
  getParticlesByShapeIdToRef(e, t) {
    t.length = 0;
    for (let r = 0; r < this.nbParticles; r++) {
      const n = this.particles[r];
      n.shapeId == e && t.push(n);
    }
    return this;
  }
  /**
   * Computes the required SubMeshes according the materials assigned to the particles.
   * @returns the solid particle system.
   * Does nothing if called before the SPS mesh is built.
   */
  computeSubMeshes() {
    if (!this.mesh || !this._multimaterialEnabled)
      return this;
    const e = this.depthSortedParticles;
    if (this.particles.length > 0)
      for (let s = 0; s < this.particles.length; s++) {
        const a = this.particles[s];
        a.materialIndex || (a.materialIndex = 0);
        const f = e[s];
        f.materialIndex = a.materialIndex, f.ind = a._ind, f.indicesLength = a._model._indicesLength, f.idx = a.idx;
      }
    this._sortParticlesByMaterial();
    const t = this._indicesByMaterial, r = this._materialIndexes, n = this.mesh;
    n.subMeshes = [];
    const i = n.getTotalVertices();
    for (let s = 0; s < r.length; s++) {
      const a = t[s], f = t[s + 1] - a, o = r[s];
      new rA(o, 0, i, a, f, n);
    }
    return this;
  }
  /**
   * Sorts the solid particles by material when MultiMaterial is enabled.
   * Updates the indices32 array.
   * Updates the indicesByMaterial array.
   * Updates the mesh indices array.
   * @returns the SPS
   * @internal
   */
  _sortParticlesByMaterial() {
    const e = [0];
    this._indicesByMaterial = e;
    const t = [];
    this._materialIndexes = t;
    const r = this.depthSortedParticles;
    r.sort(this._materialSortFunction);
    const n = r.length, i = this._indices32, s = this._indices;
    let a = 0, f = 0, o = 0, d = r[0].materialIndex;
    t.push(d), this._pickable && (this.pickedBySubMesh = [[]], this.pickedParticles = this.pickedBySubMesh[0]);
    for (let v = 0; v < n; v++) {
      const u = r[v], l = u.indicesLength, P = u.ind;
      u.materialIndex !== d && (d = u.materialIndex, e.push(o), t.push(d), this._pickable && (a++, this.pickedBySubMesh[a] = [], f = 0));
      let p = 0;
      for (let c = 0; c < l; c++) {
        if (i[o] = s[P + c], this._pickable && c % 3 == 0) {
          const T = this.pickedBySubMesh[a][f];
          T ? (T.idx = u.idx, T.faceId = p) : this.pickedBySubMesh[a][f] = { idx: u.idx, faceId: p }, f++, p++;
        }
        o++;
      }
    }
    return e.push(i.length), this._updatable && this.mesh.updateIndices(i), this;
  }
  /**
   * Sets the material indexes by id materialIndexesById[id] = materialIndex
   * @internal
   */
  _setMaterialIndexesById() {
    this._materialIndexesById = {};
    for (let e = 0; e < this._materials.length; e++) {
      const t = this._materials[e].uniqueId;
      this._materialIndexesById[t] = e;
    }
  }
  /**
   * Returns an array with unique values of Materials from the passed array
   * @param array the material array to be checked and filtered
   * @internal
   */
  _filterUniqueMaterialId(e) {
    return e.filter(function(r, n, i) {
      return i.indexOf(r) === n;
    });
  }
  /**
   * Sets a new Standard Material as _defaultMaterial if not already set.
   * @internal
   */
  _setDefaultMaterial() {
    return this._defaultMaterial || (this._defaultMaterial = new Wt(this.name + "DefaultMaterial", this._scene)), this._defaultMaterial;
  }
  /**
   * Visibility helper : Recomputes the visible size according to the mesh bounding box
   * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
   * @returns the SPS.
   */
  refreshVisibleSize() {
    return this._isVisibilityBoxLocked || this.mesh.refreshBoundingInfo(), this;
  }
  /**
   * Visibility helper : Sets the size of a visibility box, this sets the underlying mesh bounding box.
   * @param size the size (float) of the visibility box
   * note : this doesn't lock the SPS mesh bounding box.
   * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
   */
  setVisibilityBox(e) {
    const t = e / 2;
    this.mesh.buildBoundingInfo(new S(-t, -t, -t), new S(t, t, t));
  }
  /**
   * Gets whether the SPS as always visible or not
   * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
   */
  get isAlwaysVisible() {
    return this._alwaysVisible;
  }
  /**
   * Sets the SPS as always visible or not
   * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
   */
  set isAlwaysVisible(e) {
    this._alwaysVisible = e, this.mesh.alwaysSelectAsActiveMesh = e;
  }
  /**
   * Sets the SPS visibility box as locked or not. This enables/disables the underlying mesh bounding box updates.
   * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
   */
  set isVisibilityBoxLocked(e) {
    this._isVisibilityBoxLocked = e;
    const t = this.mesh.getBoundingInfo();
    t.isLocked = e;
  }
  /**
   * Gets if the SPS visibility box as locked or not. This enables/disables the underlying mesh bounding box updates.
   * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
   */
  get isVisibilityBoxLocked() {
    return this._isVisibilityBoxLocked;
  }
  /**
   * Tells to `setParticles()` to compute the particle rotations or not.
   * Default value : true. The SPS is faster when it's set to false.
   * Note : the particle rotations aren't stored values, so setting `computeParticleRotation` to false will prevents the particle to rotate.
   */
  set computeParticleRotation(e) {
    this._computeParticleRotation = e;
  }
  /**
   * Tells to `setParticles()` to compute the particle colors or not.
   * Default value : true. The SPS is faster when it's set to false.
   * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
   */
  set computeParticleColor(e) {
    this._computeParticleColor = e;
  }
  set computeParticleTexture(e) {
    this._computeParticleTexture = e;
  }
  /**
   * Tells to `setParticles()` to call the vertex function for each vertex of each particle, or not.
   * Default value : false. The SPS is faster when it's set to false.
   * Note : the particle custom vertex positions aren't stored values.
   */
  set computeParticleVertex(e) {
    this._computeParticleVertex = e;
  }
  /**
   * Tells to `setParticles()` to compute or not the mesh bounding box when computing the particle positions.
   */
  set computeBoundingBox(e) {
    this._computeBoundingBox = e;
  }
  /**
   * Tells to `setParticles()` to sort or not the distance between each particle and the camera.
   * Skipped when `enableDepthSort` is set to `false` (default) at construction time.
   * Default : `true`
   */
  set depthSortParticles(e) {
    this._depthSortParticles = e;
  }
  /**
   * Gets if `setParticles()` computes the particle rotations or not.
   * Default value : true. The SPS is faster when it's set to false.
   * Note : the particle rotations aren't stored values, so setting `computeParticleRotation` to false will prevents the particle to rotate.
   */
  get computeParticleRotation() {
    return this._computeParticleRotation;
  }
  /**
   * Gets if `setParticles()` computes the particle colors or not.
   * Default value : true. The SPS is faster when it's set to false.
   * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
   */
  get computeParticleColor() {
    return this._computeParticleColor;
  }
  /**
   * Gets if `setParticles()` computes the particle textures or not.
   * Default value : true. The SPS is faster when it's set to false.
   * Note : the particle textures are stored values, so setting `computeParticleTexture` to false will keep yet the last colors set.
   */
  get computeParticleTexture() {
    return this._computeParticleTexture;
  }
  /**
   * Gets if `setParticles()` calls the vertex function for each vertex of each particle, or not.
   * Default value : false. The SPS is faster when it's set to false.
   * Note : the particle custom vertex positions aren't stored values.
   */
  get computeParticleVertex() {
    return this._computeParticleVertex;
  }
  /**
   * Gets if `setParticles()` computes or not the mesh bounding box when computing the particle positions.
   */
  get computeBoundingBox() {
    return this._computeBoundingBox;
  }
  /**
   * Gets if `setParticles()` sorts or not the distance between each particle and the camera.
   * Skipped when `enableDepthSort` is set to `false` (default) at construction time.
   * Default : `true`
   */
  get depthSortParticles() {
    return this._depthSortParticles;
  }
  /**
   * Gets if the SPS is created as expandable at construction time.
   * Default : `false`
   */
  get expandable() {
    return this._expandable;
  }
  /**
   * Gets if the SPS supports the Multi Materials
   */
  get multimaterialEnabled() {
    return this._multimaterialEnabled;
  }
  /**
   * Gets if the SPS uses the model materials for its own multimaterial.
   */
  get useModelMaterial() {
    return this._useModelMaterial;
  }
  /**
   * The SPS used material array.
   */
  get materials() {
    return this._materials;
  }
  /**
   * Sets the SPS MultiMaterial from the passed materials.
   * Note : the passed array is internally copied and not used then by reference.
   * @param materials an array of material objects. This array indexes are the materialIndex values of the particles.
   */
  setMultiMaterial(e) {
    this._materials = this._filterUniqueMaterialId(e), this._setMaterialIndexesById(), this._multimaterial && this._multimaterial.dispose(), this._multimaterial = new Dc(this.name + "MultiMaterial", this._scene);
    for (let t = 0; t < this._materials.length; t++)
      this._multimaterial.subMaterials.push(this._materials[t]);
    this.computeSubMeshes(), this.mesh.material = this._multimaterial;
  }
  /**
   * The SPS computed multimaterial object
   */
  get multimaterial() {
    return this._multimaterial;
  }
  set multimaterial(e) {
    this._multimaterial = e;
  }
  /**
   * If the subMeshes must be updated on the next call to setParticles()
   */
  get autoUpdateSubMeshes() {
    return this._autoUpdateSubMeshes;
  }
  set autoUpdateSubMeshes(e) {
    this._autoUpdateSubMeshes = e;
  }
  // =======================================================================
  // Particle behavior logic
  // these following methods may be overwritten by the user to fit his needs
  /**
   * This function does nothing. It may be overwritten to set all the particle first values.
   * The SPS doesn't call this function, you may have to call it by your own.
   * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/manage_sps_particles
   */
  initParticles() {
  }
  /**
   * This function does nothing. It may be overwritten to recycle a particle.
   * The SPS doesn't call this function, you may have to call it by your own.
   * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/manage_sps_particles
   * @param particle The particle to recycle
   * @returns the recycled particle
   */
  recycleParticle(e) {
    return e;
  }
  /**
   * Updates a particle : this function should  be overwritten by the user.
   * It is called on each particle by `setParticles()`. This is the place to code each particle behavior.
   * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/manage_sps_particles
   * @example : just set a particle position or velocity and recycle conditions
   * @param particle The particle to update
   * @returns the updated particle
   */
  updateParticle(e) {
    return e;
  }
  /**
   * Updates a vertex of a particle : it can be overwritten by the user.
   * This will be called on each vertex particle by `setParticles()` if `computeParticleVertex` is set to true only.
   * @param particle the current particle
   * @param vertex the current vertex of the current particle : a SolidParticleVertex object
   * @param pt the index of the current vertex in the particle shape
   * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_vertices
   * @example : just set a vertex particle position or color
   * @returns the sps
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  updateParticleVertex(e, t, r) {
    return this;
  }
  /**
   * This will be called before any other treatment by `setParticles()` and will be passed three parameters.
   * This does nothing and may be overwritten by the user.
   * @param start the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
   * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
   * @param update the boolean update value actually passed to setParticles()
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  beforeUpdateParticles(e, t, r) {
  }
  /**
   * This will be called  by `setParticles()` after all the other treatments and just before the actual mesh update.
   * This will be passed three parameters.
   * This does nothing and may be overwritten by the user.
   * @param start the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
   * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
   * @param update the boolean update value actually passed to setParticles()
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  afterUpdateParticles(e, t, r) {
  }
}
class Zne {
  /**
   * Creates a Point Cloud object.
   * Don't create particles manually, use instead the PCS internal tools like _addParticle()
   * @param particleIndex (integer) is the particle index in the PCS pool. It's also the particle identifier.
   * @param group (PointsGroup) is the group the particle belongs to
   * @param groupId (integer) is the group identifier in the PCS.
   * @param idxInGroup (integer) is the index of the particle in the current point group (ex: the 10th point of addPoints(30))
   * @param pcs defines the PCS it is associated to
   */
  constructor(e, t, r, n, i) {
    this.idx = 0, this.color = new xt(1, 1, 1, 1), this.position = S.Zero(), this.rotation = S.Zero(), this.uv = new at(0, 0), this.velocity = S.Zero(), this.pivot = S.Zero(), this.translateFromPivot = !1, this._pos = 0, this._ind = 0, this.groupId = 0, this.idxInGroup = 0, this._stillInvisible = !1, this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1], this.parentId = null, this._globalPosition = S.Zero(), this.idx = e, this._group = t, this.groupId = r, this.idxInGroup = n, this._pcs = i;
  }
  /**
   * get point size
   */
  get size() {
    return this.size;
  }
  /**
   * Set point size
   */
  set size(e) {
    this.size = e;
  }
  /**
   * Legacy support, changed quaternion to rotationQuaternion
   */
  get quaternion() {
    return this.rotationQuaternion;
  }
  /**
   * Legacy support, changed quaternion to rotationQuaternion
   */
  set quaternion(e) {
    this.rotationQuaternion = e;
  }
  /**
   * Returns a boolean. True if the particle intersects a mesh, else false
   * The intersection is computed on the particle position and Axis Aligned Bounding Box (AABB) or Sphere
   * @param target is the object (point or mesh) what the intersection is computed against
   * @param isSphere is boolean flag when false (default) bounding box of mesh is used, when true the bounding sphere is used
   * @returns true if it intersects
   */
  intersectsMesh(e, t) {
    if (!e.hasBoundingInfo)
      return !1;
    if (!this._pcs.mesh)
      throw new Error("Point Cloud System doesnt contain the Mesh");
    if (t)
      return e.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));
    const r = e.getBoundingInfo().boundingBox, n = r.maximumWorld.x, i = r.minimumWorld.x, s = r.maximumWorld.y, a = r.minimumWorld.y, f = r.maximumWorld.z, o = r.minimumWorld.z, d = this.position.x + this._pcs.mesh.position.x, v = this.position.y + this._pcs.mesh.position.y, u = this.position.z + this._pcs.mesh.position.z;
    return i <= d && d <= n && a <= v && v <= s && o <= u && u <= f;
  }
  /**
   * get the rotation matrix of the particle
   * @internal
   */
  getRotationMatrix(e) {
    let t;
    if (this.rotationQuaternion)
      t = this.rotationQuaternion;
    else {
      t = ue.Quaternion[0];
      const r = this.rotation;
      Ze.RotationYawPitchRollToRef(r.y, r.x, r.z, t);
    }
    t.toRotationMatrix(e);
  }
}
class WC {
  /**
   * Get or set the groupId
   * @deprecated Please use groupId instead
   */
  get groupID() {
    return this.groupId;
  }
  set groupID(e) {
    this.groupId = e;
  }
  /**
   * Creates a points group object. This is an internal reference to produce particles for the PCS.
   * PCS internal tool, don't use it manually.
   * @internal
   */
  constructor(e, t) {
    this.groupId = e, this._positionFunction = t;
  }
}
var Iv;
(function(A) {
  A[A.Color = 2] = "Color", A[A.UV = 1] = "UV", A[A.Random = 0] = "Random", A[A.Stated = 3] = "Stated";
})(Iv || (Iv = {}));
class _ne {
  /**
   * Gets the particle positions computed by the Point Cloud System
   */
  get positions() {
    return this._positions32;
  }
  /**
   * Gets the particle colors computed by the Point Cloud System
   */
  get colors() {
    return this._colors32;
  }
  /**
   * Gets the particle uvs computed by the Point Cloud System
   */
  get uvs() {
    return this._uvs32;
  }
  /**
   * Creates a PCS (Points Cloud System) object
   * @param name (String) is the PCS name, this will be the underlying mesh name
   * @param pointSize (number) is the size for each point. Has no effect on a WebGPU engine.
   * @param scene (Scene) is the scene in which the PCS is added
   * @param options defines the options of the PCS e.g.
   * * updatable (optional boolean, default true) : if the PCS must be updatable or immutable
   * @param options.updatable
   */
  constructor(e, t, r, n) {
    this.particles = new Array(), this.nbParticles = 0, this.counter = 0, this.vars = {}, this._promises = [], this._positions = new Array(), this._indices = new Array(), this._normals = new Array(), this._colors = new Array(), this._uvs = new Array(), this._updatable = !0, this._isVisibilityBoxLocked = !1, this._alwaysVisible = !1, this._groups = new Array(), this._groupCounter = 0, this._computeParticleColor = !0, this._computeParticleTexture = !0, this._computeParticleRotation = !0, this._computeBoundingBox = !1, this._isReady = !1, this.name = e, this._size = t, this._scene = r || gr.LastCreatedScene, n && n.updatable !== void 0 ? this._updatable = n.updatable : this._updatable = !0;
  }
  /**
   * Builds the PCS underlying mesh. Returns a standard Mesh.
   * If no points were added to the PCS, the returned mesh is just a single point.
   * @param material The material to use to render the mesh. If not provided, will create a default one
   * @returns a promise for the created mesh
   */
  buildMeshAsync(e) {
    return Promise.all(this._promises).then(() => (this._isReady = !0, this._buildMesh(e)));
  }
  /**
   * @internal
   */
  _buildMesh(e) {
    this.nbParticles === 0 && this.addPoints(1), this._positions32 = new Float32Array(this._positions), this._uvs32 = new Float32Array(this._uvs), this._colors32 = new Float32Array(this._colors);
    const t = new Ut();
    t.set(this._positions32, J.PositionKind), this._uvs32.length > 0 && t.set(this._uvs32, J.UVKind);
    let r = 0;
    this._colors32.length > 0 && (r = 1, t.set(this._colors32, J.ColorKind));
    const n = new Ee(this.name, this._scene);
    t.applyToMesh(n, this._updatable), this.mesh = n, this._positions = null, this._uvs = null, this._colors = null, this._updatable || (this.particles.length = 0);
    let i = e;
    return i || (i = new Wt("point cloud material", this._scene), i.emissiveColor = new Ne(r, r, r), i.disableLighting = !0, i.pointsCloud = !0, i.pointSize = this._size), n.material = i, new Promise((s) => s(n));
  }
  // adds a new particle object in the particles array
  _addParticle(e, t, r, n) {
    const i = new Zne(e, t, r, n, this);
    return this.particles.push(i), i;
  }
  _randomUnitVector(e) {
    e.position = new S(Math.random(), Math.random(), Math.random()), e.color = new xt(1, 1, 1, 1);
  }
  _getColorIndicesForCoord(e, t, r, n) {
    const i = e._groupImageData, s = r * (n * 4) + t * 4, a = [s, s + 1, s + 2, s + 3], f = a[0], o = a[1], d = a[2], v = a[3], u = i[f], l = i[o], P = i[d], p = i[v];
    return new xt(u / 255, l / 255, P / 255, p);
  }
  _setPointsColorOrUV(e, t, r, n, i, s, a, f) {
    f = f ?? 0, r && e.updateFacetData();
    const d = 2 * e.getBoundingInfo().boundingSphere.radius;
    let v = e.getVerticesData(J.PositionKind);
    const u = e.getIndices(), l = e.getVerticesData(J.UVKind + (f ? f + 1 : "")), P = e.getVerticesData(J.ColorKind), p = S.Zero();
    e.computeWorldMatrix();
    const c = e.getWorldMatrix();
    if (!c.isIdentity()) {
      v = v.slice(0);
      for (let Er = 0; Er < v.length / 3; Er++)
        S.TransformCoordinatesFromFloatsToRef(v[3 * Er], v[3 * Er + 1], v[3 * Er + 2], c, p), v[3 * Er] = p.x, v[3 * Er + 1] = p.y, v[3 * Er + 2] = p.z;
    }
    let H = 0, T = 0, q = 0, b = 0, j = 0, w = 0, m = 0, I = 0, N = 0, k = 0, R = 0, y = 0, O = 0;
    const Y = S.Zero(), ee = S.Zero(), Z = S.Zero(), te = S.Zero(), fe = S.Zero();
    let _ = 0, G = 0, L = 0, $ = 0, ae = 0, Pe = 0;
    const ge = at.Zero(), me = at.Zero(), Xe = at.Zero(), De = at.Zero(), ne = at.Zero();
    let re = 0, ve = 0, qe = 0, ke = 0, be = 0, Fe = 0, Ke = 0, nt = 0, ut = 0, bt = 0, wt = 0, Tt = 0;
    const lr = Ir.Zero(), Qt = Ir.Zero(), tr = Ir.Zero(), br = Ir.Zero(), Xn = Ir.Zero();
    let qr = 0, En = 0;
    a = a || 0;
    let Bn, Fi, Gt = new Ir(0, 0, 0, 0), xr = S.Zero(), Br = S.Zero(), nn = S.Zero(), sn = 0, Pn = S.Zero(), an = 0, Wn = 0;
    const rr = new Hi(S.Zero(), new S(1, 0, 0));
    let Sr, nr = S.Zero();
    for (let Er = 0; Er < u.length / 3; Er++) {
      T = u[3 * Er], q = u[3 * Er + 1], b = u[3 * Er + 2], j = v[3 * T], w = v[3 * T + 1], m = v[3 * T + 2], I = v[3 * q], N = v[3 * q + 1], k = v[3 * q + 2], R = v[3 * b], y = v[3 * b + 1], O = v[3 * b + 2], Y.set(j, w, m), ee.set(I, N, k), Z.set(R, y, O), ee.subtractToRef(Y, te), Z.subtractToRef(ee, fe), l && (_ = l[2 * T], G = l[2 * T + 1], L = l[2 * q], $ = l[2 * q + 1], ae = l[2 * b], Pe = l[2 * b + 1], ge.set(_, G), me.set(L, $), Xe.set(ae, Pe), me.subtractToRef(ge, De), Xe.subtractToRef(me, ne)), P && n && (re = P[4 * T], ve = P[4 * T + 1], qe = P[4 * T + 2], ke = P[4 * T + 3], be = P[4 * q], Fe = P[4 * q + 1], Ke = P[4 * q + 2], nt = P[4 * q + 3], ut = P[4 * b], bt = P[4 * b + 1], wt = P[4 * b + 2], Tt = P[4 * b + 3], lr.set(re, ve, qe, ke), Qt.set(be, Fe, Ke, nt), tr.set(ut, bt, wt, Tt), Qt.subtractToRef(lr, br), tr.subtractToRef(Qt, Xn));
      let Rn, Vn, ki, as, Rr, Ii, is, ji;
      const _i = new Ne(0, 0, 0), oi = new Ne(0, 0, 0);
      let vr, Fr;
      for (let pr = 0; pr < t._groupDensity[Er]; pr++)
        H = this.particles.length, this._addParticle(H, t, this._groupCounter, Er + pr), Fr = this.particles[H], qr = Xt.RandomRange(0, 1), En = Xt.RandomRange(0, 1), Bn = Y.add(te.scale(qr)).add(fe.scale(qr * En)), r && (xr = e.getFacetNormal(Er).normalize().scale(-1), Br = te.clone().normalize(), nn = S.Cross(xr, Br), sn = Xt.RandomRange(0, 2 * Math.PI), Pn = Br.scale(Math.cos(sn)).add(nn.scale(Math.sin(sn))), sn = Xt.RandomRange(0.1, Math.PI / 2), nr = Pn.scale(Math.cos(sn)).add(xr.scale(Math.sin(sn))), rr.origin = Bn.add(nr.scale(1e-5)), rr.direction = nr, rr.length = d, Sr = rr.intersectsMesh(e), Sr.hit && (Wn = Sr.pickedPoint.subtract(Bn).length(), an = Xt.RandomRange(0, 1) * Wn, Bn.addInPlace(nr.scale(an)))), Fr.position = Bn.clone(), this._positions.push(Fr.position.x, Fr.position.y, Fr.position.z), n !== void 0 ? l && (Fi = ge.add(De.scale(qr)).add(ne.scale(qr * En)), n ? i && t._groupImageData !== null ? (Rn = t._groupImgWidth, Vn = t._groupImgHeight, vr = this._getColorIndicesForCoord(t, Math.round(Fi.x * Rn), Math.round(Fi.y * Vn), Rn), Fr.color = vr, this._colors.push(vr.r, vr.g, vr.b, vr.a)) : P ? (Gt = lr.add(br.scale(qr)).add(Xn.scale(qr * En)), Fr.color = new xt(Gt.x, Gt.y, Gt.z, Gt.w), this._colors.push(Gt.x, Gt.y, Gt.z, Gt.w)) : (Gt = lr.set(Math.random(), Math.random(), Math.random(), 1), Fr.color = new xt(Gt.x, Gt.y, Gt.z, Gt.w), this._colors.push(Gt.x, Gt.y, Gt.z, Gt.w)) : (Fr.uv = Fi.clone(), this._uvs.push(Fr.uv.x, Fr.uv.y))) : (s ? (_i.set(s.r, s.g, s.b), ki = Xt.RandomRange(-a, a), as = Xt.RandomRange(-a, a), ji = _i.toHSV(), Rr = ji.r, Ii = ji.g + ki, is = ji.b + as, Ii < 0 && (Ii = 0), Ii > 1 && (Ii = 1), is < 0 && (is = 0), is > 1 && (is = 1), Ne.HSVtoRGBToRef(Rr, Ii, is, oi), Gt.set(oi.r, oi.g, oi.b, 1)) : Gt = lr.set(Math.random(), Math.random(), Math.random(), 1), Fr.color = new xt(Gt.x, Gt.y, Gt.z, Gt.w), this._colors.push(Gt.x, Gt.y, Gt.z, Gt.w));
    }
  }
  // stores mesh texture in dynamic texture for color pixel retrieval
  // when pointColor type is color for surface points
  _colorFromTexture(e, t, r) {
    if (e.material === null) {
      Se.Warn(e.name + "has no material."), t._groupImageData = null, this._setPointsColorOrUV(e, t, r, !0, !1);
      return;
    }
    const i = e.material.getActiveTextures();
    if (i.length === 0) {
      Se.Warn(e.name + "has no usable texture."), t._groupImageData = null, this._setPointsColorOrUV(e, t, r, !0, !1);
      return;
    }
    const s = e.clone();
    s.setEnabled(!1), this._promises.push(new Promise((a) => {
      ls.WhenAllReady(i, () => {
        let f = t._textureNb;
        f < 0 && (f = 0), f > i.length - 1 && (f = i.length - 1);
        const o = () => {
          t._groupImgWidth = i[f].getSize().width, t._groupImgHeight = i[f].getSize().height, this._setPointsColorOrUV(s, t, r, !0, !0, void 0, void 0, i[f].coordinatesIndex), s.dispose(), a();
        };
        t._groupImageData = null;
        const d = i[f].readPixels();
        d ? d.then((v) => {
          t._groupImageData = v, o();
        }) : o();
      });
    }));
  }
  // calculates the point density per facet of a mesh for surface points
  _calculateDensity(e, t, r) {
    let n = new Array(), i, s, a, f, o, d, v, u, l, P, p, c;
    const H = S.Zero(), T = S.Zero(), q = S.Zero(), b = S.Zero(), j = S.Zero(), w = S.Zero();
    let m, I, N, k, R;
    const y = new Array();
    let O = 0;
    const Y = r.length / 3;
    for (let _ = 0; _ < Y; _++)
      i = r[3 * _], s = r[3 * _ + 1], a = r[3 * _ + 2], f = t[3 * i], o = t[3 * i + 1], d = t[3 * i + 2], v = t[3 * s], u = t[3 * s + 1], l = t[3 * s + 2], P = t[3 * a], p = t[3 * a + 1], c = t[3 * a + 2], H.set(f, o, d), T.set(v, u, l), q.set(P, p, c), T.subtractToRef(H, b), q.subtractToRef(T, j), q.subtractToRef(H, w), m = b.length(), I = j.length(), N = w.length(), k = (m + I + N) / 2, R = Math.sqrt(k * (k - m) * (k - I) * (k - N)), O += R, y[_] = R;
    let ee = 0;
    for (let _ = 0; _ < Y; _++)
      n[_] = Math.floor(e * y[_] / O), ee += n[_];
    const Z = e - ee, te = Math.floor(Z / Y), fe = Z % Y;
    te > 0 && (n = n.map((_) => _ + te));
    for (let _ = 0; _ < fe; _++)
      n[_] += 1;
    return n;
  }
  /**
   * Adds points to the PCS in random positions within a unit sphere
   * @param nb (positive integer) the number of particles to be created from this model
   * @param pointFunction is an optional javascript function to be called for each particle on PCS creation
   * @returns the number of groups in the system
   */
  addPoints(e, t = this._randomUnitVector) {
    const r = new WC(this._groupCounter, t);
    let n, i = this.nbParticles;
    for (let s = 0; s < e; s++)
      n = this._addParticle(i, r, this._groupCounter, s), r && r._positionFunction && r._positionFunction(n, i, s), this._positions.push(n.position.x, n.position.y, n.position.z), n.color && this._colors.push(n.color.r, n.color.g, n.color.b, n.color.a), n.uv && this._uvs.push(n.uv.x, n.uv.y), i++;
    return this.nbParticles += e, this._groupCounter++, this._groupCounter;
  }
  /**
   * Adds points to the PCS from the surface of the model shape
   * @param mesh is any Mesh object that will be used as a surface model for the points
   * @param nb (positive integer) the number of particles to be created from this model
   * @param colorWith determines whether a point is colored using color (default), uv, random, stated or none (invisible)
   * @param color (color4) to be used when colorWith is stated or color (number) when used to specify texture position
   * @param range (number from 0 to 1) to determine the variation in shape and tone for a stated color
   * @returns the number of groups in the system
   */
  addSurfacePoints(e, t, r, n, i) {
    let s = r || Iv.Random;
    (isNaN(s) || s < 0 || s > 3) && (s = Iv.Random);
    const a = e.getVerticesData(J.PositionKind), f = e.getIndices();
    this._groups.push(this._groupCounter);
    const o = new WC(this._groupCounter, null);
    switch (o._groupDensity = this._calculateDensity(t, a, f), s === Iv.Color ? o._textureNb = n || 0 : n = n || new xt(1, 1, 1, 1), s) {
      case Iv.Color:
        this._colorFromTexture(e, o, !1);
        break;
      case Iv.UV:
        this._setPointsColorOrUV(e, o, !1, !1, !1);
        break;
      case Iv.Random:
        this._setPointsColorOrUV(e, o, !1);
        break;
      case Iv.Stated:
        this._setPointsColorOrUV(e, o, !1, void 0, void 0, n, i);
        break;
    }
    return this.nbParticles += t, this._groupCounter++, this._groupCounter - 1;
  }
  /**
   * Adds points to the PCS inside the model shape
   * @param mesh is any Mesh object that will be used as a surface model for the points
   * @param nb (positive integer) the number of particles to be created from this model
   * @param colorWith determines whether a point is colored using color (default), uv, random, stated or none (invisible)
   * @param color (color4) to be used when colorWith is stated or color (number) when used to specify texture position
   * @param range (number from 0 to 1) to determine the variation in shape and tone for a stated color
   * @returns the number of groups in the system
   */
  addVolumePoints(e, t, r, n, i) {
    let s = r || Iv.Random;
    (isNaN(s) || s < 0 || s > 3) && (s = Iv.Random);
    const a = e.getVerticesData(J.PositionKind), f = e.getIndices();
    this._groups.push(this._groupCounter);
    const o = new WC(this._groupCounter, null);
    switch (o._groupDensity = this._calculateDensity(t, a, f), s === Iv.Color ? o._textureNb = n || 0 : n = n || new xt(1, 1, 1, 1), s) {
      case Iv.Color:
        this._colorFromTexture(e, o, !0);
        break;
      case Iv.UV:
        this._setPointsColorOrUV(e, o, !0, !1, !1);
        break;
      case Iv.Random:
        this._setPointsColorOrUV(e, o, !0);
        break;
      case Iv.Stated:
        this._setPointsColorOrUV(e, o, !0, void 0, void 0, n, i);
        break;
    }
    return this.nbParticles += t, this._groupCounter++, this._groupCounter - 1;
  }
  /**
   *  Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc.
   *  This method calls `updateParticle()` for each particle of the SPS.
   *  For an animated SPS, it is usually called within the render loop.
   * @param start The particle index in the particle array where to start to compute the particle property values _(default 0)_
   * @param end The particle index in the particle array where to stop to compute the particle property values _(default nbParticle - 1)_
   * @param update If the mesh must be finally updated on this call after all the particle computations _(default true)_
   * @returns the PCS.
   */
  setParticles(e = 0, t = this.nbParticles - 1, r = !0) {
    var n, i;
    if (!this._updatable || !this._isReady)
      return this;
    this.beforeUpdateParticles(e, t, r);
    const s = ue.Matrix[0], a = this.mesh, f = this._colors32, o = this._positions32, d = this._uvs32, v = ue.Vector3, u = v[5].copyFromFloats(1, 0, 0), l = v[6].copyFromFloats(0, 1, 0), P = v[7].copyFromFloats(0, 0, 1), p = v[8].setAll(Number.MAX_VALUE), c = v[9].setAll(-Number.MAX_VALUE);
    he.IdentityToRef(s);
    let H = 0;
    if (!((n = this.mesh) === null || n === void 0) && n.isFacetDataEnabled && (this._computeBoundingBox = !0), t = t >= this.nbParticles ? this.nbParticles - 1 : t, this._computeBoundingBox && (e != 0 || t != this.nbParticles - 1)) {
      const j = (i = this.mesh) === null || i === void 0 ? void 0 : i.getBoundingInfo();
      j && (p.copyFrom(j.minimum), c.copyFrom(j.maximum));
    }
    H = 0;
    let T = 0, q = 0, b = 0;
    for (let j = e; j <= t; j++) {
      const w = this.particles[j];
      H = w.idx, T = 3 * H, q = 4 * H, b = 2 * H, this.updateParticle(w);
      const m = w._rotationMatrix, I = w.position, N = w._globalPosition;
      if (this._computeParticleRotation && w.getRotationMatrix(s), w.parentId !== null) {
        const $ = this.particles[w.parentId], ae = $._rotationMatrix, Pe = $._globalPosition, ge = I.x * ae[1] + I.y * ae[4] + I.z * ae[7], me = I.x * ae[0] + I.y * ae[3] + I.z * ae[6], Xe = I.x * ae[2] + I.y * ae[5] + I.z * ae[8];
        if (N.x = Pe.x + me, N.y = Pe.y + ge, N.z = Pe.z + Xe, this._computeParticleRotation) {
          const De = s.m;
          m[0] = De[0] * ae[0] + De[1] * ae[3] + De[2] * ae[6], m[1] = De[0] * ae[1] + De[1] * ae[4] + De[2] * ae[7], m[2] = De[0] * ae[2] + De[1] * ae[5] + De[2] * ae[8], m[3] = De[4] * ae[0] + De[5] * ae[3] + De[6] * ae[6], m[4] = De[4] * ae[1] + De[5] * ae[4] + De[6] * ae[7], m[5] = De[4] * ae[2] + De[5] * ae[5] + De[6] * ae[8], m[6] = De[8] * ae[0] + De[9] * ae[3] + De[10] * ae[6], m[7] = De[8] * ae[1] + De[9] * ae[4] + De[10] * ae[7], m[8] = De[8] * ae[2] + De[9] * ae[5] + De[10] * ae[8];
        }
      } else if (N.x = 0, N.y = 0, N.z = 0, this._computeParticleRotation) {
        const $ = s.m;
        m[0] = $[0], m[1] = $[1], m[2] = $[2], m[3] = $[4], m[4] = $[5], m[5] = $[6], m[6] = $[8], m[7] = $[9], m[8] = $[10];
      }
      const R = v[11];
      w.translateFromPivot ? R.setAll(0) : R.copyFrom(w.pivot);
      const y = v[0];
      y.copyFrom(w.position);
      const O = y.x - w.pivot.x, Y = y.y - w.pivot.y, ee = y.z - w.pivot.z;
      let Z = O * m[0] + Y * m[3] + ee * m[6], te = O * m[1] + Y * m[4] + ee * m[7], fe = O * m[2] + Y * m[5] + ee * m[8];
      Z += R.x, te += R.y, fe += R.z;
      const _ = o[T] = N.x + u.x * Z + l.x * te + P.x * fe, G = o[T + 1] = N.y + u.y * Z + l.y * te + P.y * fe, L = o[T + 2] = N.z + u.z * Z + l.z * te + P.z * fe;
      if (this._computeBoundingBox && (p.minimizeInPlaceFromFloats(_, G, L), c.maximizeInPlaceFromFloats(_, G, L)), this._computeParticleColor && w.color) {
        const $ = w.color, ae = this._colors32;
        ae[q] = $.r, ae[q + 1] = $.g, ae[q + 2] = $.b, ae[q + 3] = $.a;
      }
      if (this._computeParticleTexture && w.uv) {
        const $ = w.uv, ae = this._uvs32;
        ae[b] = $.x, ae[b + 1] = $.y;
      }
    }
    return a && (r && (this._computeParticleColor && a.updateVerticesData(J.ColorKind, f, !1, !1), this._computeParticleTexture && a.updateVerticesData(J.UVKind, d, !1, !1), a.updateVerticesData(J.PositionKind, o, !1, !1)), this._computeBoundingBox && (a.hasBoundingInfo ? a.getBoundingInfo().reConstruct(p, c, a._worldMatrix) : a.buildBoundingInfo(p, c, a._worldMatrix))), this.afterUpdateParticles(e, t, r), this;
  }
  /**
   * Disposes the PCS.
   */
  dispose() {
    var e;
    (e = this.mesh) === null || e === void 0 || e.dispose(), this.vars = null, this._positions = null, this._indices = null, this._normals = null, this._uvs = null, this._colors = null, this._indices32 = null, this._positions32 = null, this._uvs32 = null, this._colors32 = null;
  }
  /**
   * Visibility helper : Recomputes the visible size according to the mesh bounding box
   * doc :
   * @returns the PCS.
   */
  refreshVisibleSize() {
    var e;
    return this._isVisibilityBoxLocked || (e = this.mesh) === null || e === void 0 || e.refreshBoundingInfo(), this;
  }
  /**
   * Visibility helper : Sets the size of a visibility box, this sets the underlying mesh bounding box.
   * @param size the size (float) of the visibility box
   * note : this doesn't lock the PCS mesh bounding box.
   * doc :
   */
  setVisibilityBox(e) {
    if (!this.mesh)
      return;
    const t = e / 2;
    this.mesh.buildBoundingInfo(new S(-t, -t, -t), new S(t, t, t));
  }
  /**
   * Gets whether the PCS is always visible or not
   * doc :
   */
  get isAlwaysVisible() {
    return this._alwaysVisible;
  }
  /**
   * Sets the PCS as always visible or not
   * doc :
   */
  set isAlwaysVisible(e) {
    this.mesh && (this._alwaysVisible = e, this.mesh.alwaysSelectAsActiveMesh = e);
  }
  /**
   * Tells to `setParticles()` to compute the particle rotations or not
   * Default value : false. The PCS is faster when it's set to false
   * Note : particle rotations are only applied to parent particles
   * Note : the particle rotations aren't stored values, so setting `computeParticleRotation` to false will prevents the particle to rotate
   */
  set computeParticleRotation(e) {
    this._computeParticleRotation = e;
  }
  /**
   * Tells to `setParticles()` to compute the particle colors or not.
   * Default value : true. The PCS is faster when it's set to false.
   * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
   */
  set computeParticleColor(e) {
    this._computeParticleColor = e;
  }
  set computeParticleTexture(e) {
    this._computeParticleTexture = e;
  }
  /**
   * Gets if `setParticles()` computes the particle colors or not.
   * Default value : false. The PCS is faster when it's set to false.
   * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
   */
  get computeParticleColor() {
    return this._computeParticleColor;
  }
  /**
   * Gets if `setParticles()` computes the particle textures or not.
   * Default value : false. The PCS is faster when it's set to false.
   * Note : the particle textures are stored values, so setting `computeParticleTexture` to false will keep yet the last colors set.
   */
  get computeParticleTexture() {
    return this._computeParticleTexture;
  }
  /**
   * Tells to `setParticles()` to compute or not the mesh bounding box when computing the particle positions.
   */
  set computeBoundingBox(e) {
    this._computeBoundingBox = e;
  }
  /**
   * Gets if `setParticles()` computes or not the mesh bounding box when computing the particle positions.
   */
  get computeBoundingBox() {
    return this._computeBoundingBox;
  }
  // =======================================================================
  // Particle behavior logic
  // these following methods may be overwritten by users to fit their needs
  /**
   * This function does nothing. It may be overwritten to set all the particle first values.
   * The PCS doesn't call this function, you may have to call it by your own.
   * doc :
   */
  initParticles() {
  }
  /**
   * This function does nothing. It may be overwritten to recycle a particle
   * The PCS doesn't call this function, you can to call it
   * doc :
   * @param particle The particle to recycle
   * @returns the recycled particle
   */
  recycleParticle(e) {
    return e;
  }
  /**
   * Updates a particle : this function should  be overwritten by the user.
   * It is called on each particle by `setParticles()`. This is the place to code each particle behavior.
   * doc :
   * @example : just set a particle position or velocity and recycle conditions
   * @param particle The particle to update
   * @returns the updated particle
   */
  updateParticle(e) {
    return e;
  }
  /**
   * This will be called before any other treatment by `setParticles()` and will be passed three parameters.
   * This does nothing and may be overwritten by the user.
   * @param start the particle index in the particle array where to start to iterate, same than the value passed to setParticle()
   * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
   * @param update the boolean update value actually passed to setParticles()
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  beforeUpdateParticles(e, t, r) {
  }
  /**
   * This will be called  by `setParticles()` after all the other treatments and just before the actual mesh update.
   * This will be passed three parameters.
   * This does nothing and may be overwritten by the user.
   * @param start the particle index in the particle array where to start to iterate, same than the value passed to setParticle()
   * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
   * @param update the boolean update value actually passed to setParticles()
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  afterUpdateParticles(e, t, r) {
  }
}
Object.defineProperty(jn.prototype, "physicsImpostor", {
  get: function() {
    return this._physicsImpostor;
  },
  set: function(A) {
    this._physicsImpostor !== A && (this._disposePhysicsObserver && this.onDisposeObservable.remove(this._disposePhysicsObserver), this._physicsImpostor = A, A && (this._disposePhysicsObserver = this.onDisposeObservable.add(() => {
      this.physicsImpostor && (this.physicsImpostor.dispose(
        /*!doNotRecurse*/
      ), this.physicsImpostor = null);
    })));
  },
  enumerable: !0,
  configurable: !0
});
jn.prototype.getPhysicsImpostor = function() {
  return this.physicsImpostor;
};
jn.prototype.applyImpulse = function(A, e) {
  return this.physicsImpostor ? (this.physicsImpostor.applyImpulse(A, e), this) : this;
};
jn.prototype.setPhysicsLinkWith = function(A, e, t, r) {
  return !this.physicsImpostor || !A.physicsImpostor ? this : (this.physicsImpostor.createJoint(A.physicsImpostor, ta.HingeJoint, {
    mainPivot: e,
    connectedPivot: t,
    nativeParams: r
  }), this);
};
class jy {
  /**
   *
   * @returns physics plugin version
   */
  getPluginVersion() {
    return this._physicsPlugin.getPluginVersion();
  }
  /**
   * Factory used to create the default physics plugin.
   * @returns The default physics plugin
   */
  static DefaultPluginFactory() {
    throw qn("");
  }
  /**
   * Creates a new Physics Engine
   * @param gravity defines the gravity vector used by the simulation
   * @param _physicsPlugin defines the plugin to use (CannonJS by default)
   */
  constructor(e, t = jy.DefaultPluginFactory()) {
    this._physicsPlugin = t, this._physicsBodies = [], this._subTimeStep = 0, e = e || new S(0, -9.807, 0), this.setGravity(e), this.setTimeStep();
  }
  /**
   * Sets the gravity vector used by the simulation
   * @param gravity defines the gravity vector to use
   */
  setGravity(e) {
    this.gravity = e, this._physicsPlugin.setGravity(this.gravity);
  }
  /**
   * Set the time step of the physics engine.
   * Default is 1/60.
   * To slow it down, enter 1/600 for example.
   * To speed it up, 1/30
   * @param newTimeStep defines the new timestep to apply to this world.
   */
  setTimeStep(e = 1 / 60) {
    this._physicsPlugin.setTimeStep(e);
  }
  /**
   * Get the time step of the physics engine.
   * @returns the current time step
   */
  getTimeStep() {
    return this._physicsPlugin.getTimeStep();
  }
  /**
   * Set the sub time step of the physics engine.
   * Default is 0 meaning there is no sub steps
   * To increase physics resolution precision, set a small value (like 1 ms)
   * @param subTimeStep defines the new sub timestep used for physics resolution.
   */
  setSubTimeStep(e = 0) {
    this._subTimeStep = e;
  }
  /**
   * Get the sub time step of the physics engine.
   * @returns the current sub time step
   */
  getSubTimeStep() {
    return this._subTimeStep;
  }
  /**
   * Release all resources
   */
  dispose() {
    this._physicsPlugin.dispose();
  }
  /**
   * Gets the name of the current physics plugin
   * @returns the name of the plugin
   */
  getPhysicsPluginName() {
    return this._physicsPlugin.name;
  }
  /**
   * Adding a new impostor for the impostor tracking.
   * This will be done by the impostor itself.
   * @param impostor the impostor to add
   */
  /**
   * Called by the scene. No need to call it.
   * @param delta defines the timespan between frames
   */
  _step(e) {
    e > 0.1 ? e = 0.1 : e <= 0 && (e = 1 / 60), this._physicsPlugin.executeStep(e, this._physicsBodies);
  }
  /**
   * Add a body as an active component of this engine
   * @param body
   */
  addBody(e) {
    this._physicsBodies.push(e);
  }
  /**
   * Removes a particular body from this engine
   */
  removeBody(e) {
    const t = this._physicsBodies.indexOf(e);
    t > -1 && this._physicsBodies.splice(t, 1);
  }
  /**
       * Returns an array of bodies added to this engine
  
       */
  getBodies() {
    return this._physicsBodies;
  }
  /**
   * Gets the current plugin used to run the simulation
   * @returns current plugin
   */
  getPhysicsPlugin() {
    return this._physicsPlugin;
  }
  /**
   * Does a raycast in the physics world
   * @param from when should the ray start?
   * @param to when should the ray end?
   * @param result resulting PhysicsRaycastResult
   */
  raycastToRef(e, t, r, n) {
    this._physicsPlugin.raycast(e, t, r, n);
  }
  /**
   * Does a raycast in the physics world
   * @param from when should the ray start?
   * @param to when should the ray end?
   * @returns PhysicsRaycastResult
   */
  raycast(e, t, r) {
    const n = new iV();
    return this._physicsPlugin.raycast(e, t, n, r), n;
  }
}
class wy {
  /**
   * Constructs a new physics body for the given node.
   * @param transformNode - The Transform Node to construct the physics body for. For better performance, it is advised that this node does not have a parent.
   * @param motionType - The motion type of the physics body. The options are:
   *  - PhysicsMotionType.STATIC - Static bodies are not moving and unaffected by forces or collisions. They are good for level boundaries or terrain.
   *  - PhysicsMotionType.DYNAMIC - Dynamic bodies are fully simulated. They can move and collide with other objects.
   *  - PhysicsMotionType.ANIMATED - They behave like dynamic bodies, but they won't be affected by other bodies, but still push other bodies out of the way.
   * @param startsAsleep - Whether the physics body should start in a sleeping state (not a guarantee). Defaults to false.
   * @param scene - The scene containing the physics engine.
   *
   * This code is useful for creating a physics body for a given Transform Node in a scene.
   * It checks the version of the physics engine and the physics plugin, and initializes the body accordingly.
   * It also sets the node's rotation quaternion if it is not already set. Finally, it adds the body to the physics engine.
   */
  constructor(e, t, r, n) {
    if (this._pluginData = void 0, this._pluginDataInstances = [], this._collisionCBEnabled = !1, this._collisionEndedCBEnabled = !1, this.disablePreStep = !0, this._isDisposed = !1, !n)
      return;
    const i = n.getPhysicsEngine();
    if (!i)
      throw new Error("No Physics Engine available.");
    if (this._physicsEngine = i, i.getPluginVersion() != 2)
      throw new Error("Plugin version is incorrect. Expected version 2.");
    const s = i.getPhysicsPlugin();
    if (!s)
      throw new Error("No Physics Plugin available.");
    this._physicsPlugin = s, e.rotationQuaternion || (e.rotationQuaternion = Ze.FromEulerAngles(e.rotation.x, e.rotation.y, e.rotation.z)), this.startAsleep = r;
    const a = e;
    a.hasThinInstances ? this._physicsPlugin.initBodyInstances(this, t, a) : (e.parent && e.computeWorldMatrix(!0), this._physicsPlugin.initBody(this, t, e.absolutePosition, e.absoluteRotationQuaternion)), this.transformNode = e, e.physicsBody = this, i.addBody(this), this._nodeDisposeObserver = e.onDisposeObservable.add(() => {
      this.dispose();
    });
  }
  /**
   * Returns the string "PhysicsBody".
   * @returns "PhysicsBody"
   */
  getClassName() {
    return "PhysicsBody";
  }
  /**
   * Clone the PhysicsBody to a new body and assign it to the transformNode parameter
   * @param transformNode transformNode that will be used for the cloned PhysicsBody
   * @returns the newly cloned PhysicsBody
   */
  clone(e) {
    const t = new wy(e, this.getMotionType(), this.startAsleep, this.transformNode.getScene());
    return t.shape = this.shape, t.setMassProperties(this.getMassProperties()), t.setLinearDamping(this.getLinearDamping()), t.setAngularDamping(this.getAngularDamping()), t;
  }
  /**
   * If a physics body is connected to an instanced node, update the number physic instances to match the number of node instances.
   */
  updateBodyInstances() {
    const e = this.transformNode;
    e.hasThinInstances && this._physicsPlugin.updateBodyInstances(this, e);
  }
  /**
   * This returns the number of internal instances of the physics body
   */
  get numInstances() {
    return this._pluginDataInstances.length;
  }
  /**
   * Sets the shape of the physics body.
   * @param shape - The shape of the physics body.
   *
   * This method is useful for setting the shape of the physics body, which is necessary for the physics engine to accurately simulate the body's behavior.
   * The shape is used to calculate the body's mass, inertia, and other properties.
   */
  set shape(e) {
    this._physicsPlugin.setShape(this, e);
  }
  /**
   * Retrieves the physics shape associated with this object.
   *
   * @returns The physics shape associated with this object, or `undefined` if no
   * shape is associated.
   *
   * This method is useful for retrieving the physics shape associated with this object,
   * which can be used to apply physical forces to the object or to detect collisions.
   */
  get shape() {
    return this._physicsPlugin.getShape(this);
  }
  /**
   * Sets the event mask for the physics engine.
   *
   * @param eventMask - A bitmask that determines which events will be sent to the physics engine.
   *
   * This method is useful for setting the event mask for the physics engine, which determines which events
   * will be sent to the physics engine. This allows the user to control which events the physics engine will respond to.
   */
  setEventMask(e, t) {
    this._physicsPlugin.setEventMask(this, e, t);
  }
  /**
   * Gets the event mask of the physics engine.
   *
   * @returns The event mask of the physics engine.
   *
   * This method is useful for getting the event mask of the physics engine,
   * which is used to determine which events the engine will respond to.
   * This is important for ensuring that the engine is responding to the correct events and not
   * wasting resources on unnecessary events.
   */
  getEventMask(e) {
    return this._physicsPlugin.getEventMask(this, e);
  }
  /**
   * Sets the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.
   */
  setMotionType(e, t) {
    this._physicsPlugin.setMotionType(this, e, t);
  }
  /**
   * Gets the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.
   */
  getMotionType(e) {
    return this._physicsPlugin.getMotionType(this, e);
  }
  /**
   * Computes the mass properties of the physics object, based on the set of physics shapes this body uses.
   * This method is useful for computing the initial mass properties of a physics object, such as its mass,
   * inertia, and center of mass; these values are important for accurately simulating the physics of the
   * object in the physics engine, and computing values based on the shape will provide you with reasonable
   * intial values, which you can then customize.
   */
  computeMassProperties(e) {
    return this._physicsPlugin.computeMassProperties(this, e);
  }
  /**
   * Sets the mass properties of the physics object.
   *
   * @param massProps - The mass properties to set.
   * @param instanceIndex - The index of the instance to set the mass properties for. If not defined, the mass properties will be set for all instances.
   *
   * This method is useful for setting the mass properties of a physics object, such as its mass,
   * inertia, and center of mass. This is important for accurately simulating the physics of the object in the physics engine.
   */
  setMassProperties(e, t) {
    this._physicsPlugin.setMassProperties(this, e, t);
  }
  /**
   * Retrieves the mass properties of the object.
   *
   * @returns The mass properties of the object.
   *
   * This method is useful for physics simulations, as it allows the user to
   * retrieve the mass properties of the object, such as its mass, center of mass,
   * and moment of inertia. This information is necessary for accurate physics
   * simulations.
   */
  getMassProperties(e) {
    return this._physicsPlugin.getMassProperties(this, e);
  }
  /**
   * Sets the linear damping of the physics body.
   *
   * @param damping - The linear damping value.
   *
   * This method is useful for controlling the linear damping of the physics body,
   * which is the rate at which the body's velocity decreases over time. This is useful for simulating
   * the effects of air resistance or other forms of friction.
   */
  setLinearDamping(e, t) {
    this._physicsPlugin.setLinearDamping(this, e, t);
  }
  /**
   * Gets the linear damping of the physics body.
   * @returns The linear damping of the physics body.
   *
   * This method is useful for retrieving the linear damping of the physics body, which is the amount of
   * resistance the body has to linear motion. This is useful for simulating realistic physics behavior
   * in a game.
   */
  getLinearDamping(e) {
    return this._physicsPlugin.getLinearDamping(this, e);
  }
  /**
   * Sets the angular damping of the physics body.
   * @param damping The angular damping of the body.
   *
   * This method is useful for controlling the angular velocity of a physics body.
   * By setting the damping, the body's angular velocity will be reduced over time, simulating the effect of friction.
   * This can be used to create realistic physical behavior in a physics engine.
   */
  setAngularDamping(e, t) {
    this._physicsPlugin.setAngularDamping(this, e, t);
  }
  /**
   * Gets the angular damping of the physics body.
   *
   * @returns The angular damping of the physics body.
   *
   * This method is useful for getting the angular damping of the physics body,
   * which is the rate of reduction of the angular velocity over time.
   * This is important for simulating realistic physics behavior in a game.
   */
  getAngularDamping(e) {
    return this._physicsPlugin.getAngularDamping(this, e);
  }
  /**
   * Sets the linear velocity of the physics object.
   * @param linVel - The linear velocity to set.
   *
   * This method is useful for setting the linear velocity of a physics object,
   * which is necessary for simulating realistic physics in a game engine.
   * By setting the linear velocity, the physics object will move in the direction and speed specified by the vector.
   * This allows for realistic physics simulations, such as simulating the motion of a ball rolling down a hill.
   */
  setLinearVelocity(e, t) {
    this._physicsPlugin.setLinearVelocity(this, e, t);
  }
  /**
   * Gets the linear velocity of the physics body and stores it in the given vector3.
   * @param linVel - The vector3 to store the linear velocity in.
   *
   * This method is useful for getting the linear velocity of a physics body in a physics engine.
   * This can be used to determine the speed and direction of the body, which can be used to calculate the motion of the body.
   */
  getLinearVelocityToRef(e, t) {
    return this._physicsPlugin.getLinearVelocityToRef(this, e, t);
  }
  /**
   * Gets the linear velocity of the physics body as a new vector3.
   * @returns The linear velocity of the physics body.
   *
   * This method is useful for getting the linear velocity of a physics body in a physics engine.
   * This can be used to determine the speed and direction of the body, which can be used to calculate the motion of the body.
   */
  getLinearVelocity(e) {
    const t = new S();
    return this.getLinearVelocityToRef(t, e), t;
  }
  /**
   * Sets the angular velocity of the physics object.
   * @param angVel - The angular velocity to set.
   *
   * This method is useful for setting the angular velocity of a physics object, which is necessary for
   * simulating realistic physics behavior. The angular velocity is used to determine the rate of rotation of the object,
   * which is important for simulating realistic motion.
   */
  setAngularVelocity(e, t) {
    this._physicsPlugin.setAngularVelocity(this, e, t);
  }
  /**
   * Gets the angular velocity of the physics body and stores it in the given vector3.
   * @param angVel - The vector3 to store the angular velocity in.
   *
   * This method is useful for getting the angular velocity of a physics body, which can be used to determine the body's
   * rotational speed. This information can be used to create realistic physics simulations.
   */
  getAngularVelocityToRef(e, t) {
    return this._physicsPlugin.getAngularVelocityToRef(this, e, t);
  }
  /**
   * Gets the angular velocity of the physics body as a new vector3.
   * @returns The angular velocity of the physics body.
   *
   * This method is useful for getting the angular velocity of a physics body, which can be used to determine the body's
   * rotational speed. This information can be used to create realistic physics simulations.
   */
  getAngularVelocity(e) {
    const t = new S();
    return this.getAngularVelocityToRef(t, e), t;
  }
  /**
   * Applies an impulse to the physics object.
   *
   * @param impulse The impulse vector.
   * @param location The location of the impulse.
   * @param instanceIndex For a instanced body, the instance to where the impulse should be applied. If not specified, the impulse is applied to all instances.
   *
   * This method is useful for applying an impulse to a physics object, which can be used to simulate physical forces such as gravity,
   * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.
   */
  applyImpulse(e, t, r) {
    this._physicsPlugin.applyImpulse(this, e, t, r);
  }
  /**
   * Applies a force to the physics object.
   *
   * @param force The force vector.
   * @param location The location of the force.
   * @param instanceIndex For a instanced body, the instance to where the force should be applied. If not specified, the force is applied to all instances.
   *
   * This method is useful for applying a force to a physics object, which can be used to simulate physical forces such as gravity,
   * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.
   */
  applyForce(e, t, r) {
    this._physicsPlugin.applyForce(this, e, t, r);
  }
  /**
   * Retrieves the geometry of the body from the physics plugin.
   *
   * @returns The geometry of the body.
   *
   * This method is useful for retrieving the geometry of the body from the physics plugin, which can be used for various physics calculations.
   */
  getGeometry() {
    return this._physicsPlugin.getBodyGeometry(this);
  }
  /**
   * Returns an observable that will be notified for when a collision starts or continues for this PhysicsBody
   * @returns Observable
   */
  getCollisionObservable() {
    return this._physicsPlugin.getCollisionObservable(this);
  }
  /**
   * Returns an observable that will be notified when the body has finished colliding with another body
   * @returns
   */
  getCollisionEndedObservable() {
    return this._physicsPlugin.getCollisionEndedObservable(this);
  }
  /**
   * Enable or disable collision callback for this PhysicsBody.
   * @param enabled true if PhysicsBody's collision will rise a collision event and notifies the observable
   */
  setCollisionCallbackEnabled(e) {
    this._collisionCBEnabled = e, this._physicsPlugin.setCollisionCallbackEnabled(this, e);
  }
  setCollisionEndedCallbackEnabled(e) {
    this._collisionEndedCBEnabled = e, this._physicsPlugin.setCollisionEndedCallbackEnabled(this, e);
  }
  /*
   * Get the center of the object in world space.
   * @param instanceIndex - If this body is instanced, the index of the instance to get the center for.
   * @returns geometric center of the associated mesh
   */
  getObjectCenterWorld(e) {
    const t = new S();
    return this.getObjectCenterWorldToRef(t, e);
  }
  /*
   * Get the center of the object in world space.
   * @param ref - The vector3 to store the result in.
   * @param instanceIndex - If this body is instanced, the index of the instance to get the center for.
   * @returns geometric center of the associated mesh
   */
  getObjectCenterWorldToRef(e, t) {
    var r;
    if (((r = this._pluginDataInstances) === null || r === void 0 ? void 0 : r.length) > 0) {
      const n = t || 0, i = this.transformNode._thinInstanceDataStorage.matrixData;
      i && e.set(i[n * 16 + 12], i[n * 16 + 13], i[n * 16 + 14]);
    } else
      e.copyFrom(this.transformNode.position);
    return e;
  }
  /**
   * Adds a constraint to the physics engine.
   *
   * @param childBody - The body to which the constraint will be applied.
   * @param constraint - The constraint to be applied.
   * @param instanceIndex - If this body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
   * @param childInstanceIndex - If the child body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
   *
   */
  addConstraint(e, t, r, n) {
    this._physicsPlugin.addConstraint(this, e, t, r, n);
  }
  /**
   * Sync with a bone
   * @param bone The bone that the impostor will be synced to.
   * @param boneMesh The mesh that the bone is influencing.
   * @param jointPivot The pivot of the joint / bone in local space.
   * @param distToJoint Optional distance from the impostor to the joint.
   * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.
   * @param boneAxis Optional vector3 axis the bone is aligned with
   */
  syncWithBone(e, t, r, n, i, s) {
    const a = this.transformNode;
    if (a.rotationQuaternion)
      if (i) {
        const d = ue.Quaternion[0];
        e.getRotationQuaternionToRef(ai.WORLD, t, d), d.multiplyToRef(i, a.rotationQuaternion);
      } else
        e.getRotationQuaternionToRef(ai.WORLD, t, a.rotationQuaternion);
    const f = ue.Vector3[0], o = ue.Vector3[1];
    s || (s = ue.Vector3[2], s.x = 0, s.y = 1, s.z = 0), e.getDirectionToRef(s, t, o), e.getAbsolutePositionToRef(t, f), n == null && r && (n = r.length()), n != null && (f.x += o.x * n, f.y += o.y * n, f.z += o.z * n), a.setAbsolutePosition(f);
  }
  /**
   * Executes a callback on the body or all of the instances of a body
   * @param callback the callback to execute
   */
  iterateOverAllInstances(e) {
    var t;
    if (((t = this._pluginDataInstances) === null || t === void 0 ? void 0 : t.length) > 0)
      for (let r = 0; r < this._pluginDataInstances.length; r++)
        e(this, r);
    else
      e(this, void 0);
  }
  /**
   * Sets the gravity factor of the physics body
   * @param factor the gravity factor to set
   * @param instanceIndex the instance of the body to set, if undefined all instances will be set
   */
  setGravityFactor(e, t) {
    this._physicsPlugin.setGravityFactor(this, e, t);
  }
  /**
   * Gets the gravity factor of the physics body
   * @param instanceIndex the instance of the body to get, if undefined the value of first instance will be returned
   * @returns the gravity factor
   */
  getGravityFactor(e) {
    return this._physicsPlugin.getGravityFactor(this, e);
  }
  /**
   * Set the target transformation (position and rotation) of the body, such that the body will set its velocity to reach that target
   * @param position The target position
   * @param rotation The target rotation
   * @param instanceIndex The index of the instance in an instanced body
   */
  setTargetTransform(e, t, r) {
    this._physicsPlugin.setTargetTransform(this, e, t, r);
  }
  /**
   * Disposes the body from the physics engine.
   *
   * This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.
   */
  dispose() {
    this._isDisposed || (this._collisionCBEnabled && this.setCollisionCallbackEnabled(!1), this._collisionEndedCBEnabled && this.setCollisionEndedCallbackEnabled(!1), this._nodeDisposeObserver && (this.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver), this._nodeDisposeObserver = null), this._physicsEngine.removeBody(this), this._physicsPlugin.removeBody(this), this._physicsPlugin.disposeBody(this), this.transformNode.physicsBody = null, this._pluginData = null, this._pluginDataInstances.length = 0, this._isDisposed = !0);
  }
}
var I2;
(function(A) {
  A[A.FREE = 0] = "FREE", A[A.LIMITED = 1] = "LIMITED", A[A.LOCKED = 2] = "LOCKED";
})(I2 || (I2 = {}));
var MH;
(function(A) {
  A[A.LINEAR_X = 0] = "LINEAR_X", A[A.LINEAR_Y = 1] = "LINEAR_Y", A[A.LINEAR_Z = 2] = "LINEAR_Z", A[A.ANGULAR_X = 3] = "ANGULAR_X", A[A.ANGULAR_Y = 4] = "ANGULAR_Y", A[A.ANGULAR_Z = 5] = "ANGULAR_Z", A[A.LINEAR_DISTANCE = 6] = "LINEAR_DISTANCE";
})(MH || (MH = {}));
var kv;
(function(A) {
  A[A.BALL_AND_SOCKET = 1] = "BALL_AND_SOCKET", A[A.DISTANCE = 2] = "DISTANCE", A[A.HINGE = 3] = "HINGE", A[A.SLIDER = 4] = "SLIDER", A[A.LOCK = 5] = "LOCK", A[A.PRISMATIC = 6] = "PRISMATIC", A[A.SIX_DOF = 7] = "SIX_DOF";
})(kv || (kv = {}));
var Ff;
(function(A) {
  A[A.SPHERE = 0] = "SPHERE", A[A.CAPSULE = 1] = "CAPSULE", A[A.CYLINDER = 2] = "CYLINDER", A[A.BOX = 3] = "BOX", A[A.CONVEX_HULL = 4] = "CONVEX_HULL", A[A.CONTAINER = 5] = "CONTAINER", A[A.MESH = 6] = "MESH", A[A.HEIGHTFIELD = 7] = "HEIGHTFIELD";
})(Ff || (Ff = {}));
var _x;
(function(A) {
  A[A.NONE = 0] = "NONE", A[A.VELOCITY = 1] = "VELOCITY", A[A.POSITION = 2] = "POSITION";
})(_x || (_x = {}));
var q0;
(function(A) {
  A.COLLISION_STARTED = "COLLISION_STARTED", A.COLLISION_CONTINUED = "COLLISION_CONTINUED", A.COLLISION_FINISHED = "COLLISION_FINISHED", A.TRIGGER_ENTERED = "TRIGGER_ENTERED", A.TRIGGER_EXITED = "TRIGGER_EXITED";
})(q0 || (q0 = {}));
var W0;
(function(A) {
  A[A.STATIC = 0] = "STATIC", A[A.ANIMATED = 1] = "ANIMATED", A[A.DYNAMIC = 2] = "DYNAMIC";
})(W0 || (W0 = {}));
class P4 {
  /**
   * Constructs a new physics shape.
   * @param options The options for the physics shape. These are:
   *  * type: The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER
   *  * parameters: The parameters of the shape.
   *  * pluginData: The plugin data of the shape. This is used if you already have a reference to the object on the plugin side.
   * You need to specify either type or pluginData.
   * @param scene The scene the shape belongs to.
   *
   * This code is useful for creating a new physics shape with the given type, options, and scene.
   * It also checks that the physics engine and plugin version are correct.
   * If not, it throws an error. This ensures that the shape is created with the correct parameters and is compatible with the physics engine.
   */
  constructor(e, t) {
    var r;
    if (this._pluginData = void 0, this._isTrigger = !1, this._isDisposed = !1, !t)
      return;
    const n = t.getPhysicsEngine();
    if (!n)
      throw new Error("No Physics Engine available.");
    if (n.getPluginVersion() != 2)
      throw new Error("Plugin version is incorrect. Expected version 2.");
    const i = n.getPhysicsPlugin();
    if (!i)
      throw new Error("No Physics Plugin available.");
    if (this._physicsPlugin = i, e.pluginData !== void 0 && e.pluginData !== null)
      this._pluginData = e.pluginData, this._type = this._physicsPlugin.getShapeType(this);
    else if (e.type !== void 0 && e.type !== null) {
      this._type = e.type;
      const s = (r = e.parameters) !== null && r !== void 0 ? r : {};
      this._physicsPlugin.initShape(this, e.type, s);
    }
  }
  /**
   * Returns the string "PhysicsShape".
   * @returns "PhysicsShape"
   */
  getClassName() {
    return "PhysicsShape";
  }
  /**
   * Returns the type of the physics shape.
   * @returns The type of the physics shape.
   */
  get type() {
    return this._type;
  }
  /**
   * Set the membership mask of a shape. This is a bitfield of arbitrary
   * "categories" to which the shape is a member. This is used in combination
   * with the collide mask to determine if this shape should collide with
   * another.
   *
   * @param membershipMask Bitfield of categories of this shape.
   */
  set filterMembershipMask(e) {
    this._physicsPlugin.setShapeFilterMembershipMask(this, e);
  }
  /**
   * Get the membership mask of a shape.
   * @returns Bitmask of categories which this shape is a member of.
   */
  get filterMembershipMask() {
    return this._physicsPlugin.getShapeFilterMembershipMask(this);
  }
  /**
   * Sets the collide mask of a shape. This is a bitfield of arbitrary
   * "categories" to which this shape collides with. Given two shapes,
   * the engine will check if the collide mask and membership overlap:
   * shapeA.filterMembershipMask & shapeB.filterCollideMask
   *
   * If this value is zero (i.e. shapeB only collides with categories
   * which shapeA is _not_ a member of) then the shapes will not collide.
   *
   * Note, the engine will also perform the same test with shapeA and
   * shapeB swapped; the shapes will not collide if either shape has
   * a collideMask which prevents collision with the other shape.
   *
   * @param collideMask Bitmask of categories this shape should collide with
   */
  set filterCollideMask(e) {
    this._physicsPlugin.setShapeFilterCollideMask(this, e);
  }
  /**
   *
   * @returns Bitmask of categories that this shape should collide with
   */
  get filterCollideMask() {
    return this._physicsPlugin.getShapeFilterCollideMask(this);
  }
  /**
   *
   * @param material
   */
  set material(e) {
    this._physicsPlugin.setMaterial(this, e), this._material = e;
  }
  /**
   * Returns the material of the physics shape.
   * @returns The material of the physics shape.
   */
  get material() {
    return this._material;
  }
  /**
   * Sets the density of the physics shape.
   * @param density The density of the physics shape.
   */
  set density(e) {
    this._physicsPlugin.setDensity(this, e);
  }
  /**
   * Returns the density of the physics shape.
   * @returns The density of the physics shape.
   */
  get density() {
    return this._physicsPlugin.getDensity(this);
  }
  /**
   * Utility to add a child shape to this container,
   * automatically computing the relative transform between
   * the container shape and the child instance.
   *
   * @param parentTransform The transform node associated with this shape
   * @param newChild The new PhysicsShape to add
   * @param childTransform The transform node associated with the child shape
   */
  addChildFromParent(e, t, r) {
    const n = r.computeWorldMatrix(!0), i = e.computeWorldMatrix(!0), s = ue.Matrix[0];
    n.multiplyToRef(he.Invert(i), s);
    const a = ue.Vector3[0], f = ue.Quaternion[0], o = ue.Vector3[1];
    s.decompose(o, f, a), this._physicsPlugin.addChild(this, t, a, f, o);
  }
  /**
   * Adds a child shape to a container with an optional transform
   * @param newChild The new PhysicsShape to add
   * @param translation Optional position of the child shape relative to this shape
   * @param rotation Optional rotation of the child shape relative to this shape
   * @param scale Optional scale of the child shape relative to this shape
   */
  addChild(e, t, r, n) {
    this._physicsPlugin.addChild(this, e, t, r, n);
  }
  /**
   * Removes a child shape from this shape.
   * @param childIndex The index of the child shape to remove
   */
  removeChild(e) {
    this._physicsPlugin.removeChild(this, e);
  }
  /**
   * Returns the number of children of a physics shape.
   * @returns The number of children of a physics shape.
   */
  getNumChildren() {
    return this._physicsPlugin.getNumChildren(this);
  }
  /**
   * Returns the bounding box of the physics shape.
   * @returns The bounding box of the physics shape.
   */
  getBoundingBox() {
    return this._physicsPlugin.getBoundingBox(this);
  }
  set isTrigger(e) {
    this._isTrigger !== e && (this._isTrigger = e, this._physicsPlugin.setTrigger(this, e));
  }
  get isTrigger() {
    return this._isTrigger;
  }
  /**
   * Dispose the shape and release its associated resources.
   */
  dispose() {
    this._isDisposed || (this._physicsPlugin.disposeShape(this), this._isDisposed = !0);
  }
}
class EY extends P4 {
  /**
   * Constructor for the Sphere Shape
   * @param center local center of the sphere
   * @param radius radius
   * @param scene scene to attach to
   */
  constructor(e, t, r) {
    super({ type: Ff.SPHERE, parameters: { center: e, radius: t } }, r);
  }
  /**
   * Derive an approximate sphere from the mesh.
   * @param mesh node from which to derive the sphere shape
   * @returns PhysicsShapeSphere
   */
  static FromMesh(e) {
    const t = e.getBoundingInfo(), r = t.boundingSphere.center, n = t.boundingBox.extendSize, i = Math.max(n.x, n.y, n.z);
    return new EY(r, i, e.getScene());
  }
}
class FY extends P4 {
  /**
   *
   * @param pointA Starting point that defines the capsule segment
   * @param pointB ending point of that same segment
   * @param radius radius
   * @param scene scene to attach to
   */
  constructor(e, t, r, n) {
    super({ type: Ff.CAPSULE, parameters: { pointA: e, pointB: t, radius: r } }, n);
  }
  /**
   * Derive an approximate capsule from the mesh. Note, this is
   * not the optimal bounding capsule.
   * @param mesh Node from which to derive a cylinder shape
   */
  static FromMesh(e) {
    const t = e.getBoundingInfo(), r = t.boundingBox.extendSize.x, n = new S(0, t.boundingBox.extendSize.y - r, 0), i = t.boundingBox.center.add(n), s = t.boundingBox.center.subtract(n);
    return new FY(i, s, r, e.getScene());
  }
}
class NY extends P4 {
  /**
   *
   * @param pointA Starting point that defines the cylinder segment
   * @param pointB ending point of that same segment
   * @param radius radius
   * @param scene scene to attach to
   */
  constructor(e, t, r, n) {
    super({ type: Ff.CYLINDER, parameters: { pointA: e, pointB: t, radius: r } }, n);
  }
  /**
   * Derive an approximate cylinder from the mesh. Note, this is
   * not the optimal bounding cylinder.
   * @param mesh Node from which to derive a cylinder shape
   */
  static FromMesh(e) {
    const t = e.getBoundingInfo(), r = t.boundingBox.extendSize.x, n = new S(0, t.boundingBox.extendSize.y, 0), i = t.boundingBox.center.add(n), s = t.boundingBox.center.subtract(n);
    return new NY(i, s, r, e.getScene());
  }
}
class QY extends P4 {
  /**
   *
   * @param center local center of the box
   * @param rotation local orientation
   * @param extents size of the box in each direction
   * @param scene scene to attach to
   */
  constructor(e, t, r, n) {
    super({ type: Ff.BOX, parameters: { center: e, rotation: t, extents: r } }, n);
  }
  /**
   *
   * @param mesh
   * @returns PhysicsShapeBox
   */
  static FromMesh(e) {
    const t = e.getBoundingInfo(), r = t.boundingBox.center, n = t.boundingBox.extendSize.scale(2);
    return new QY(r, Ze.Identity(), n, e.getScene());
  }
}
class zhe extends P4 {
  /**
   *
   * @param mesh the mesh to be used as topology infos for the convex hull
   * @param scene scene to attach to
   */
  constructor(e, t) {
    super({ type: Ff.CONVEX_HULL, parameters: { mesh: e } }, t);
  }
}
class Ghe extends P4 {
  /**
   *
   * @param mesh the mesh topology that will be used to create the shape
   * @param scene scene to attach to
   */
  constructor(e, t) {
    super({ type: Ff.MESH, parameters: { mesh: e } }, t);
  }
}
class Zhe extends P4 {
  /**
   * Constructor of the Shape container
   * @param scene scene to attach to
   */
  constructor(e) {
    super({ type: Ff.CONTAINER, parameters: {} }, e);
  }
}
class mD {
  /**
   * Constructs a new constraint for the physics constraint.
   * @param type The type of constraint to create.
   * @param options The options for the constraint.
   * @param scene The scene the constraint belongs to.
   *
   * This code is useful for creating a new constraint for the physics engine. It checks if the scene has a physics engine, and if the plugin version is correct.
   * If all checks pass, it initializes the constraint with the given type and options.
   */
  constructor(e, t, r) {
    if (this._pluginData = void 0, !r)
      throw new Error("Missing scene parameter for constraint constructor.");
    const n = r.getPhysicsEngine();
    if (!n)
      throw new Error("No Physics Engine available.");
    if (n.getPluginVersion() != 2)
      throw new Error("Plugin version is incorrect. Expected version 2.");
    const i = n.getPhysicsPlugin();
    if (!i)
      throw new Error("No Physics Plugin available.");
    this._physicsPlugin = i, this._options = t, this._type = e;
  }
  /**
   * Gets the type of the constraint.
   *
   * @returns The type of the constraint.
   *
   */
  get type() {
    return this._type;
  }
  /**
   * Retrieves the options of the physics constraint.
   *
   * @returns The physics constraint parameters.
   *
   */
  get options() {
    return this._options;
  }
  /**
   * Enable/disable the constraint
   * @param isEnabled value for the constraint
   */
  set isEnabled(e) {
    this._physicsPlugin.setEnabled(this, e);
  }
  /**
   *
   * @returns true if constraint is enabled
   */
  get isEnabled() {
    return this._physicsPlugin.getEnabled(this);
  }
  /**
   * Enables or disables collisions for the physics engine.
   *
   * @param isEnabled - A boolean value indicating whether collisions should be enabled or disabled.
   *
   */
  set isCollisionsEnabled(e) {
    this._physicsPlugin.setCollisionsEnabled(this, e);
  }
  /**
   * Gets whether collisions are enabled for this physics object.
   *
   * @returns `true` if collisions are enabled, `false` otherwise.
   *
   */
  get isCollisionsEnabled() {
    return this._physicsPlugin.getCollisionsEnabled(this);
  }
  /**
   * Gets all bodies that are using this constraint
   * @returns
   */
  getBodiesUsingConstraint() {
    return this._physicsPlugin.getBodiesUsingConstraint(this);
  }
  /**
   * Disposes the constraint from the physics engine.
   *
   * This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.
   */
  dispose() {
    this._physicsPlugin.disposeConstraint(this);
  }
}
class _he {
}
class $ne extends mD {
  constructor(e, t, r) {
    super(kv.SIX_DOF, e, r), this.limits = t;
  }
  /**
   * Sets the friction of the given axis of the physics engine.
   * @param axis - The axis of the physics engine to set the friction for.
   * @param friction - The friction to set for the given axis.
   *
   */
  setAxisFriction(e, t) {
    this._physicsPlugin.setAxisFriction(this, e, t);
  }
  /**
   * Gets the friction of the given axis of the physics engine.
   * @param axis - The axis of the physics engine.
   * @returns The friction of the given axis, or null if the constraint hasn't been initialized yet.
   *
   */
  getAxisFriction(e) {
    return this._physicsPlugin.getAxisFriction(this, e);
  }
  /**
   * Sets the limit mode for the given axis of the constraint.
   * @param axis The axis to set the limit mode for.
   * @param limitMode The limit mode to set.
   *
   * This method is useful for setting the limit mode for a given axis of the constraint. This is important for
   * controlling the behavior of the physics engine when the constraint is reached. By setting the limit mode,
   * the engine can be configured to either stop the motion of the objects, or to allow them to continue
   * moving beyond the constraint.
   */
  setAxisMode(e, t) {
    this._physicsPlugin.setAxisMode(this, e, t);
  }
  /**
   * Gets the limit mode of the given axis of the constraint.
   *
   * @param axis - The axis of the constraint.
   * @returns The limit mode of the given axis, or null if the constraint hasn't been initialized yet.
   *
   */
  getAxisMode(e) {
    return this._physicsPlugin.getAxisMode(this, e);
  }
  /**
   * Sets the minimum limit of a given axis of a constraint.
   * @param axis - The axis of the constraint.
   * @param minLimit - The minimum limit of the axis.
   *
   */
  setAxisMinLimit(e, t) {
    this._physicsPlugin.setAxisMinLimit(this, e, t);
  }
  /**
   * Gets the minimum limit of the given axis of the physics engine.
   * @param axis - The axis of the physics engine.
   * @returns The minimum limit of the given axis, or null if the constraint hasn't been initialized yet.
   *
   */
  getAxisMinLimit(e) {
    return this._physicsPlugin.getAxisMinLimit(this, e);
  }
  /**
   * Sets the maximum limit of the given axis for the physics engine.
   * @param axis - The axis to set the limit for.
   * @param limit - The maximum limit of the axis.
   *
   * This method is useful for setting the maximum limit of the given axis for the physics engine,
   * which can be used to control the movement of the physics object. This helps to ensure that the
   * physics object does not move beyond the given limit.
   */
  setAxisMaxLimit(e, t) {
    this._physicsPlugin.setAxisMaxLimit(this, e, t);
  }
  /**
   * Gets the maximum limit of the given axis of the physics engine.
   * @param axis - The axis of the physics engine.
   * @returns The maximum limit of the given axis, or null if the constraint hasn't been initialized yet.
   *
   */
  getAxisMaxLimit(e) {
    return this._physicsPlugin.getAxisMaxLimit(this, e);
  }
  /**
   * Sets the motor type of the given axis of the constraint.
   * @param axis - The axis of the constraint.
   * @param motorType - The type of motor to use.
   * @returns void
   *
   */
  setAxisMotorType(e, t) {
    this._physicsPlugin.setAxisMotorType(this, e, t);
  }
  /**
   * Gets the motor type of the specified axis of the constraint.
   *
   * @param axis - The axis of the constraint.
   * @returns The motor type of the specified axis, or null if the constraint hasn't been initialized yet.
   *
   */
  getAxisMotorType(e) {
    return this._physicsPlugin.getAxisMotorType(this, e);
  }
  /**
   * Sets the target velocity of the motor associated with the given axis of the constraint.
   * @param axis - The axis of the constraint.
   * @param target - The target velocity of the motor.
   *
   * This method is useful for setting the target velocity of the motor associated with the given axis of the constraint.
   */
  setAxisMotorTarget(e, t) {
    this._physicsPlugin.setAxisMotorTarget(this, e, t);
  }
  /**
   * Gets the target velocity of the motor associated to the given constraint axis.
   * @param axis - The constraint axis associated to the motor.
   * @returns The target velocity of the motor, or null if the constraint hasn't been initialized yet.
   *
   */
  getAxisMotorTarget(e) {
    return this._physicsPlugin.getAxisMotorTarget(this, e);
  }
  /**
   * Sets the maximum force of the motor of the given axis of the constraint.
   * @param axis - The axis of the constraint.
   * @param maxForce - The maximum force of the motor.
   *
   */
  setAxisMotorMaxForce(e, t) {
    this._physicsPlugin.setAxisMotorMaxForce(this, e, t);
  }
  /**
   * Gets the maximum force of the motor of the given axis of the constraint.
   * @param axis - The axis of the constraint.
   * @returns The maximum force of the motor, or null if the constraint hasn't been initialized yet.
   *
   */
  getAxisMotorMaxForce(e) {
    return this._physicsPlugin.getAxisMotorMaxForce(this, e);
  }
}
class $he extends mD {
  constructor(e, t, r, n, i) {
    super(kv.BALL_AND_SOCKET, { pivotA: e, pivotB: t, axisA: r, axisB: n }, i);
  }
}
class e0e extends mD {
  constructor(e, t) {
    super(kv.DISTANCE, { maxDistance: e }, t);
  }
}
class t0e extends mD {
  constructor(e, t, r, n, i) {
    super(kv.HINGE, { pivotA: e, pivotB: t, axisA: r, axisB: n }, i);
  }
}
class r0e extends mD {
  constructor(e, t, r, n, i) {
    super(kv.SLIDER, { pivotA: e, pivotB: t, axisA: r, axisB: n }, i);
  }
}
class n0e extends mD {
  constructor(e, t, r, n, i) {
    super(kv.LOCK, { pivotA: e, pivotB: t, axisA: r, axisB: n }, i);
  }
}
class i0e extends mD {
  constructor(e, t, r, n, i) {
    super(kv.PRISMATIC, { pivotA: e, pivotB: t, axisA: r, axisB: n }, i);
  }
}
class s0e extends $ne {
  constructor(e, t, r, n, i, s, a, f, o) {
    super({ pivotA: e, pivotB: t, axisA: r, axisB: n }, [{ axis: MH.LINEAR_DISTANCE, minLimit: i, maxLimit: s, stiffness: a, damping: f }], o);
  }
}
var R2;
(function(A) {
  A[A.GEOMETRIC_MEAN = 0] = "GEOMETRIC_MEAN", A[A.MINIMUM = 1] = "MINIMUM", A[A.MAXIMUM = 2] = "MAXIMUM", A[A.ARITHMETIC_MEAN = 3] = "ARITHMETIC_MEAN", A[A.MULTIPLY = 4] = "MULTIPLY";
})(R2 || (R2 = {}));
class a0e {
  constructor(e, t, r = { mass: 0 }, n) {
    var i;
    if (this.transformNode = e, this.type = t, this._options = r, this._scene = n, this._disposeShapeWhenDisposed = !0, !this.transformNode) {
      Se.Error("No object was provided. A physics object is obligatory");
      return;
    }
    const s = e;
    if (this.transformNode.parent && this._options.mass !== 0 && s.hasThinInstances && Se.Warn("A physics body has been created for an object which has a parent and thin instances. Babylon physics currently works in local space so unexpected issues may occur."), !this._scene && e.getScene && (this._scene = e.getScene()), !this._scene)
      return;
    this._options.mass = r.mass === void 0 ? 0 : r.mass, this._options.friction = r.friction === void 0 ? 0.2 : r.friction, this._options.restitution = r.restitution === void 0 ? 0.2 : r.restitution;
    const a = this._options.mass === 0 ? W0.STATIC : W0.DYNAMIC, f = (i = this._options.startAsleep) !== null && i !== void 0 ? i : !1;
    this.body = new wy(e, a, f, this._scene), this._addSizeOptions(), t.getClassName && t.getClassName() === "PhysicsShape" ? (this.shape = t, this._disposeShapeWhenDisposed = !1) : this.shape = new P4({ type: t, parameters: this._options }, this._scene), this._options.isTriggerShape && (this.shape.isTrigger = !0), this.material = { friction: this._options.friction, restitution: this._options.restitution }, this.body.shape = this.shape, this.shape.material = this.material, this.body.setMassProperties({ mass: this._options.mass }), this._nodeDisposeObserver = this.transformNode.onDisposeObservable.add(() => {
      this.dispose();
    });
  }
  _getObjectBoundingBox() {
    return this.transformNode.getRawBoundingInfo ? this.transformNode.getRawBoundingInfo().boundingBox : new cp(new S(-0.5, -0.5, -0.5), new S(0.5, 0.5, 0.5));
  }
  _hasVertices(e) {
    return (e == null ? void 0 : e.getTotalVertices()) > 0;
  }
  _addSizeOptions() {
    var e, t, r, n, i, s, a, f;
    this.transformNode.computeWorldMatrix(!0);
    const o = this._getObjectBoundingBox(), d = ue.Vector3[0];
    d.copyFrom(o.extendSize), d.scaleInPlace(2), d.multiplyInPlace(this.transformNode.scaling), d.x = Math.abs(d.x), d.y = Math.abs(d.y), d.z = Math.abs(d.z);
    const v = ue.Vector3[1];
    if (v.copyFrom(o.minimum), v.multiplyInPlace(this.transformNode.scaling), !this._options.center) {
      const u = new S();
      u.copyFrom(o.center), u.multiplyInPlace(this.transformNode.scaling), this._options.center = u;
    }
    switch (this.type) {
      case Ff.SPHERE:
        !this._options.radius && Xt.WithinEpsilon(d.x, d.y, 1e-4) && Xt.WithinEpsilon(d.x, d.z, 1e-4) ? this._options.radius = d.x / 2 : this._options.radius || (Se.Warn("Non uniform scaling is unsupported for sphere shapes. Setting the radius to the biggest bounding box extent."), this._options.radius = Math.max(d.x, d.y, d.z) / 2);
        break;
      case Ff.CAPSULE:
        {
          const u = d.x / 2;
          this._options.radius = (e = this._options.radius) !== null && e !== void 0 ? e : u, this._options.pointA = (t = this._options.pointA) !== null && t !== void 0 ? t : new S(0, v.y + u, 0), this._options.pointB = (r = this._options.pointB) !== null && r !== void 0 ? r : new S(0, v.y + d.y - u, 0);
        }
        break;
      case Ff.CYLINDER:
        {
          const u = d.x / 2;
          this._options.radius = (n = this._options.radius) !== null && n !== void 0 ? n : u, this._options.pointA = (i = this._options.pointA) !== null && i !== void 0 ? i : new S(0, v.y, 0), this._options.pointB = (s = this._options.pointB) !== null && s !== void 0 ? s : new S(0, v.y + d.y, 0);
        }
        break;
      case Ff.MESH:
      case Ff.CONVEX_HULL:
        if (!this._options.mesh && this._hasVertices(this.transformNode))
          this._options.mesh = this.transformNode;
        else if (!this._options.mesh || !this._hasVertices(this._options.mesh))
          throw new Error("No valid mesh was provided for mesh or convex hull shape parameter. Please provide a mesh with valid geometry (number of vertices greater than 0).");
        break;
      case Ff.BOX:
        this._options.extents = (a = this._options.extents) !== null && a !== void 0 ? a : new S(d.x, d.y, d.z), this._options.rotation = (f = this._options.rotation) !== null && f !== void 0 ? f : Ze.Identity();
        break;
    }
  }
  /**
   * Releases the body, shape and material
   */
  dispose() {
    this._nodeDisposeObserver && (this.body.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver), this._nodeDisposeObserver = null), this.body.dispose(), this._disposeShapeWhenDisposed && this.shape.dispose();
  }
}
class o0e {
  /**
   * Constructor of the mesh accumulator
   * @param mesh - The mesh used to compute the world matrix.
   * @param collectIndices - use mesh indices
   * @param scene - The scene used to determine the right handed system.
   *
   * Merge mesh and its children so whole hierarchy can be used as a mesh shape or convex hull
   */
  constructor(e, t, r) {
    this._vertices = [], this._indices = [], this._isRightHanded = r.useRightHandedSystem, this._collectIndices = t;
  }
  /**
   * Adds a mesh to the physics engine.
   * @param mesh The mesh to add.
   * @param includeChildren Whether to include the children of the mesh.
   *
   * This method adds a mesh to the physics engine by computing the world matrix,
   * multiplying it with the body from world matrix, and then transforming the
   * coordinates of the mesh's vertices. It also adds the indices of the mesh
   * to the physics engine. If includeChildren is true, it will also add the
   * children of the mesh to the physics engine, ignoring any children which
   * have a physics impostor. This is useful for creating a physics engine
   * that accurately reflects the mesh and its children.
   */
  addNodeMeshes(e, t) {
    e.computeWorldMatrix(!0);
    const r = ue.Matrix[0];
    if (he.ScalingToRef(e.absoluteScaling.x, e.absoluteScaling.y, e.absoluteScaling.z, r), e instanceof Ee ? this._addMesh(e, r) : e instanceof bp && this._addMesh(e.sourceMesh, r), t) {
      const n = ue.Matrix[1];
      e.computeWorldMatrix().invertToRef(n);
      const i = ue.Matrix[2];
      n.multiplyToRef(r, i), e.getChildMeshes(!1).filter((a) => !a.physicsBody).forEach((a) => {
        const f = a.computeWorldMatrix(), o = ue.Matrix[3];
        f.multiplyToRef(i, o), a instanceof Ee ? this._addMesh(a, o) : a instanceof bp && this._addMesh(a.sourceMesh, o);
      });
    }
  }
  _addMesh(e, t) {
    const r = e.getVerticesData(J.PositionKind) || [], n = r.length / 3, i = this._vertices.length;
    for (let s = 0; s < n; s++) {
      const a = new S(r[s * 3 + 0], r[s * 3 + 1], r[s * 3 + 2]);
      this._vertices.push(S.TransformCoordinates(a, t));
    }
    if (this._collectIndices) {
      const s = e.getIndices();
      if (s)
        for (let a = 0; a < s.length; a += 3)
          this._isRightHanded ? (this._indices.push(s[a + 0] + i), this._indices.push(s[a + 1] + i), this._indices.push(s[a + 2] + i)) : (this._indices.push(s[a + 2] + i), this._indices.push(s[a + 1] + i), this._indices.push(s[a + 0] + i));
    }
  }
  /**
   * Allocate and populate the vertex positions inside the physics plugin.
   *
   * @returns An array of floats, whose backing memory is inside the plugin. The array contains the
   * positions of the mesh vertices, where a position is defined by three floats. You must call
   * freeBuffer() on the returned array once you have finished with it, in order to free the
   * memory inside the plugin..
   */
  getVertices(e) {
    const t = this._vertices.length * 3, n = t * 4, i = e._malloc(n), s = new Float32Array(e.HEAPU8.buffer, i, t);
    for (let a = 0; a < this._vertices.length; a++)
      s[a * 3 + 0] = this._vertices[a].x, s[a * 3 + 1] = this._vertices[a].y, s[a * 3 + 2] = this._vertices[a].z;
    return { offset: i, numObjects: t };
  }
  freeBuffer(e, t) {
    e._free(t.offset);
  }
  /**
   * Allocate and populate the triangle indices inside the physics plugin
   *
   * @returns A new Int32Array, whose backing memory is inside the plugin. The array contains the indices
   * of the triangle positions, where a single triangle is defined by three indices. You must call
   * freeBuffer() on this array once you have finished with it, to free the memory inside the plugin..
   */
  getTriangles(e) {
    const r = this._indices.length * 4, n = e._malloc(r), i = new Int32Array(e.HEAPU8.buffer, n, this._indices.length);
    for (let s = 0; s < this._indices.length; s++)
      i[s] = this._indices[s];
    return { offset: n, numObjects: this._indices.length };
  }
}
class JG {
  constructor(e) {
    this.hpBodyId = e, this.userMassProps = { centerOfMass: void 0, mass: void 0, inertia: void 0, inertiaOrientation: void 0 };
  }
}
class zG {
  constructor() {
    this.bodyId = BigInt(0), this.position = new S(), this.normal = new S();
  }
}
class GG {
  constructor() {
    this.contactOnA = new zG(), this.contactOnB = new zG(), this.impulseApplied = 0, this.type = 0;
  }
  static readToRef(e, t, r) {
    const n = new Int32Array(e, t), i = new Float32Array(e, t), s = 2;
    r.contactOnA.bodyId = BigInt(n[s]), r.contactOnA.position.set(i[s + 8], i[s + 9], i[s + 10]), r.contactOnA.normal.set(i[s + 11], i[s + 12], i[s + 13]);
    const a = 18;
    r.contactOnB.bodyId = BigInt(n[a]), r.contactOnB.position.set(i[a + 8], i[a + 9], i[a + 10]), r.contactOnB.normal.set(i[a + 11], i[a + 12], i[a + 13]), r.impulseApplied = i[a + 13 + 3], r.type = n[0];
  }
}
class ZG {
  constructor() {
    this.bodyIdA = BigInt(0), this.bodyIdB = BigInt(0), this.type = 0;
  }
  static readToRef(e, t, r) {
    const n = new Int32Array(e, t);
    r.type = n[0], r.bodyIdA = BigInt(n[2]), r.bodyIdB = BigInt(n[6]);
  }
}
class f0e {
  constructor(e = !0, t = HK) {
    if (this._useDeltaForWorldStep = e, this._hknp = {}, this.name = "HavokPlugin", this._fixedTimeStep = 1 / 60, this._timeStep = 1 / 60, this._tmpVec3 = Nf.BuildArray(3, S.Zero), this._bodies = /* @__PURE__ */ new Map(), this._bodyCollisionObservable = /* @__PURE__ */ new Map(), this._constraintToBodyIdPair = /* @__PURE__ */ new Map(), this._bodyCollisionEndedObservable = /* @__PURE__ */ new Map(), this.onCollisionObservable = new Oe(), this.onCollisionEndedObservable = new Oe(), this.onTriggerCollisionObservable = new Oe(), typeof t == "function") {
      Se.Error("Havok is not ready. Please make sure you await HK() before using the plugin.");
      return;
    } else
      this._hknp = t;
    if (!this.isSupported()) {
      Se.Error("Havok is not available. Please make sure you included the js file.");
      return;
    }
    this.world = this._hknp.HP_World_Create()[1], this._queryCollector = this._hknp.HP_QueryCollector_Create(1)[1];
  }
  /**
   * If this plugin is supported
   * @returns true if its supported
   */
  isSupported() {
    return this._hknp !== void 0;
  }
  /**
   * Sets the gravity of the physics world.
   *
   * @param gravity - The gravity vector to set.
   *
   */
  setGravity(e) {
    this._hknp.HP_World_SetGravity(this.world, this._bVecToV3(e));
  }
  /**
   * Sets the fixed time step for the physics engine.
   *
   * @param timeStep - The fixed time step to use for the physics engine.
   *
   */
  setTimeStep(e) {
    this._fixedTimeStep = e;
  }
  /**
   * Gets the fixed time step used by the physics engine.
   *
   * @returns The fixed time step used by the physics engine.
   *
   */
  getTimeStep() {
    return this._fixedTimeStep;
  }
  /**
   * Executes a single step of the physics engine.
   *
   * @param delta The time delta in seconds since the last step.
   * @param physicsBodies An array of physics bodies to be simulated.
   * @returns void
   *
   * This method is useful for simulating the physics engine. It sets the physics body transformation,
   * steps the world, syncs the physics body, and notifies collisions. This allows for the physics engine
   * to accurately simulate the physics bodies in the world.
   */
  executeStep(e, t) {
    for (const r of t)
      r.disablePreStep || this.setPhysicsBodyTransformation(r, r.transformNode);
    this._hknp.HP_World_Step(this.world, this._useDeltaForWorldStep ? e : this._timeStep), this._bodyBuffer = this._hknp.HP_World_GetBodyBuffer(this.world)[1];
    for (const r of t)
      this.sync(r);
    this._notifyCollisions(), this._notifyTriggers();
  }
  /**
   * Returns the version of the physics engine plugin.
   *
   * @returns The version of the physics engine plugin.
   *
   * This method is useful for determining the version of the physics engine plugin that is currently running.
   */
  getPluginVersion() {
    return 2;
  }
  /**
   * Initializes a physics body with the given position and orientation.
   *
   * @param body - The physics body to initialize.
   * @param motionType - The motion type of the body.
   * @param position - The position of the body.
   * @param orientation - The orientation of the body.
   * This code is useful for initializing a physics body with the given position and orientation.
   * It creates a plugin data for the body and adds it to the world. It then converts the position
   * and orientation to a transform and sets the body's transform to the given values.
   */
  initBody(e, t, r, n) {
    e._pluginData = new JG(this._hknp.HP_Body_Create()[1]), this._internalSetMotionType(e._pluginData, t);
    const i = [this._bVecToV3(r), this._bQuatToV4(n)];
    this._hknp.HP_Body_SetQTransform(e._pluginData.hpBodyId, i), this._hknp.HP_World_AddBody(this.world, e._pluginData.hpBodyId, e.startAsleep), this._bodies.set(e._pluginData.hpBodyId[0], { body: e, index: 0 });
  }
  /**
   * Removes a body from the world. To dispose of a body, it is necessary to remove it from the world first.
   *
   * @param body - The body to remove.
   */
  removeBody(e) {
    if (e._pluginDataInstances && e._pluginDataInstances.length > 0)
      for (const t of e._pluginDataInstances)
        this._bodyCollisionObservable.delete(t.hpBodyId[0]), this._hknp.HP_World_RemoveBody(this.world, t.hpBodyId), this._bodies.delete(t.hpBodyId[0]);
    e._pluginData && (this._bodyCollisionObservable.delete(e._pluginData.hpBodyId[0]), this._hknp.HP_World_RemoveBody(this.world, e._pluginData.hpBodyId), this._bodies.delete(e._pluginData.hpBodyId[0]));
  }
  /**
   * Initializes the body instances for a given physics body and mesh.
   *
   * @param body - The physics body to initialize.
   * @param motionType - How the body will be handled by the engine
   * @param mesh - The mesh to initialize.
   *
   * This code is useful for creating a physics body from a mesh. It creates a
   * body instance for each instance of the mesh and adds it to the world. It also
   * sets the position of the body instance to the position of the mesh instance.
   * This allows for the physics engine to accurately simulate the mesh in the
   * world.
   */
  initBodyInstances(e, t, r) {
    var n, i;
    const s = (i = (n = r._thinInstanceDataStorage) === null || n === void 0 ? void 0 : n.instancesCount) !== null && i !== void 0 ? i : 0, a = r._thinInstanceDataStorage.matrixData;
    a && (this._createOrUpdateBodyInstances(e, t, a, 0, s, !1), e._pluginDataInstances.forEach((f, o) => {
      this._bodies.set(f.hpBodyId[0], { body: e, index: o });
    }));
  }
  _createOrUpdateBodyInstances(e, t, r, n, i, s) {
    const a = ue.Quaternion[0], f = he.Identity();
    for (let o = n; o < i; o++) {
      const d = [r[o * 16 + 12], r[o * 16 + 13], r[o * 16 + 14]];
      let v;
      s ? v = e._pluginDataInstances[o].hpBodyId : v = this._hknp.HP_Body_Create()[1], f.setRowFromFloats(0, r[o * 16 + 0], r[o * 16 + 1], r[o * 16 + 2], 0), f.setRowFromFloats(1, r[o * 16 + 4], r[o * 16 + 5], r[o * 16 + 6], 0), f.setRowFromFloats(2, r[o * 16 + 8], r[o * 16 + 9], r[o * 16 + 10], 0), Ze.FromRotationMatrixToRef(f, a);
      const u = [d, [a.x, a.y, a.z, a.w]];
      if (this._hknp.HP_Body_SetQTransform(v, u), !s) {
        const l = new JG(v);
        e._pluginDataInstances.length && (l.userMassProps = e._pluginDataInstances[0].userMassProps), this._internalSetMotionType(l, t), this._internalUpdateMassProperties(l), e._pluginDataInstances.push(l), this._hknp.HP_World_AddBody(this.world, v, e.startAsleep), l.worldTransformOffset = this._hknp.HP_Body_GetWorldTransformOffset(v)[1];
      }
    }
  }
  /**
   * Update the internal body instances for a given physics body to match the instances in a mesh.
   * @param body the body that will be updated
   * @param mesh the mesh with reference instances
   */
  updateBodyInstances(e, t) {
    var r, n;
    const i = (n = (r = t._thinInstanceDataStorage) === null || r === void 0 ? void 0 : r.instancesCount) !== null && n !== void 0 ? n : 0, s = t._thinInstanceDataStorage.matrixData;
    if (!s)
      return;
    const a = e._pluginDataInstances.length, f = this.getMotionType(e);
    if (i > a) {
      this._createOrUpdateBodyInstances(e, f, s, a, i, !1);
      const o = this._hknp.HP_Body_GetShape(e._pluginDataInstances[0].hpBodyId)[1];
      for (let d = a; d < i; d++)
        this._hknp.HP_Body_SetShape(e._pluginDataInstances[d].hpBodyId, o), this._internalUpdateMassProperties(e._pluginDataInstances[d]), this._bodies.set(e._pluginDataInstances[d].hpBodyId[0], { body: e, index: d });
    } else if (i < a) {
      const o = a - i;
      for (let d = 0; d < o; d++) {
        const v = e._pluginDataInstances.pop();
        this._bodies.delete(v.hpBodyId[0]), this._hknp.HP_World_RemoveBody(this.world, v.hpBodyId), this._hknp.HP_Body_Release(v.hpBodyId);
      }
      this._createOrUpdateBodyInstances(e, f, s, 0, i, !0);
    }
  }
  /**
   * Synchronizes the transform of a physics body with its transform node.
   * @param body - The physics body to synchronize.
   *
   * This function is useful for keeping the physics body's transform in sync with its transform node.
   * This is important for ensuring that the physics body is accurately represented in the physics engine.
   */
  sync(e) {
    this.syncTransform(e, e.transformNode);
  }
  /**
   * Synchronizes the transform of a physics body with the transform of its
   * corresponding transform node.
   *
   * @param body - The physics body to synchronize.
   * @param transformNode - The destination Transform Node.
   *
   * This code is useful for synchronizing the position and orientation of a
   * physics body with the position and orientation of its corresponding
   * transform node. This is important for ensuring that the physics body and
   * the transform node are in the same position and orientation in the scene.
   * This is necessary for the physics engine to accurately simulate the
   * physical behavior of the body.
   */
  syncTransform(e, t) {
    var r;
    if (e._pluginDataInstances.length) {
      const n = t, i = n._thinInstanceDataStorage.matrixData;
      if (!i)
        return;
      const s = e._pluginDataInstances.length;
      for (let a = 0; a < s; a++) {
        const f = e._pluginDataInstances[a].worldTransformOffset, o = new Float32Array(this._hknp.HEAPU8.buffer, this._bodyBuffer + f, 16), d = a * 16;
        for (let v = 0; v < 15; v++)
          (v & 3) != 3 && (i[d + v] = o[v]);
        i[d + 15] = 1;
      }
      n.thinInstanceBufferUpdated("matrix");
    } else
      try {
        const n = this._hknp.HP_Body_GetQTransform(e._pluginData.hpBodyId)[1], i = n[0], s = n[1], a = ue.Quaternion[0];
        a.set(s[0], s[1], s[2], s[3]);
        const f = t.parent;
        if (f && !f.getWorldMatrix().isIdentity()) {
          f.computeWorldMatrix(!0), a.normalize();
          const o = ue.Matrix[0], d = ue.Vector3[0];
          d.copyFromFloats(i[0], i[1], i[2]), he.ComposeToRef(t.absoluteScaling, a, d, o);
          const v = ue.Matrix[1];
          f.getWorldMatrix().invertToRef(v);
          const u = ue.Matrix[2];
          o.multiplyToRef(v, u), u.decomposeToTransformNode(t), (r = t.rotationQuaternion) === null || r === void 0 || r.normalize();
        } else
          t.position.set(i[0], i[1], i[2]), t.rotationQuaternion ? t.rotationQuaternion.copyFrom(a) : a.toEulerAnglesToRef(t.rotation);
      } catch (n) {
        console.log(`Syncing transform failed for node ${t.name}: ${n.message}...`);
      }
  }
  /**
   * Sets the shape of a physics body.
   * @param body - The physics body to set the shape for.
   * @param shape - The physics shape to set.
   *
   * This function is used to set the shape of a physics body. It is useful for
   * creating a physics body with a specific shape, such as a box or a sphere,
   * which can then be used to simulate physical interactions in a physics engine.
   * This function is especially useful for meshes with multiple instances, as it
   * will set the shape for each instance of the mesh.
   */
  setShape(e, t) {
    var r, n, i;
    const s = t && t._pluginData ? t._pluginData : BigInt(0);
    if (!(e.transformNode instanceof Ee) || !(!((r = e.transformNode._thinInstanceDataStorage) === null || r === void 0) && r.matrixData)) {
      this._hknp.HP_Body_SetShape(e._pluginData.hpBodyId, s), this._internalUpdateMassProperties(e._pluginData);
      return;
    }
    const f = (i = (n = e.transformNode._thinInstanceDataStorage) === null || n === void 0 ? void 0 : n.instancesCount) !== null && i !== void 0 ? i : 0;
    for (let o = 0; o < f; o++)
      this._hknp.HP_Body_SetShape(e._pluginDataInstances[o].hpBodyId, s), this._internalUpdateMassProperties(e._pluginDataInstances[o]);
  }
  /**
   * Returns a reference to the first instance of the plugin data for a physics body.
   * @param body
   * @param instanceIndex
   * @returns a reference to the first instance
   */
  _getPluginReference(e, t) {
    var r;
    return !((r = e._pluginDataInstances) === null || r === void 0) && r.length ? e._pluginDataInstances[t ?? 0] : e._pluginData;
  }
  /**
   * Gets the shape of a physics body. This will create a new shape object
   *
   * @param body - The physics body.
   * @returns The shape of the physics body.
   *
   */
  getShape(e) {
    const t = this._getPluginReference(e), r = this._hknp.HP_Body_GetShape(t.hpBodyId)[1];
    if (r != 0) {
      const n = e.transformNode.getScene();
      return new P4({ pluginData: r }, n);
    }
    return null;
  }
  /**
   * Gets the type of a physics shape.
   * @param shape - The physics shape to get the type for.
   * @returns The type of the physics shape.
   *
   */
  getShapeType(e) {
    return e.type ? e.type : this._hknp.HP_Shape_GetType(e._pluginData);
  }
  /**
   * Sets the event mask of a physics body.
   * @param body - The physics body to set the event mask for.
   * @param eventMask - The event mask to set.
   *
   * This function is useful for setting the event mask of a physics body, which is used to determine which events the body will respond to. This is important for ensuring that the physics engine is able to accurately simulate the behavior of the body in the game world.
   */
  setEventMask(e, t, r) {
    this._applyToBodyOrInstances(e, (n) => {
      this._hknp.HP_Body_SetEventMask(n.hpBodyId, t);
    }, r);
  }
  /**
   * Retrieves the event mask of a physics body.
   *
   * @param body - The physics body to retrieve the event mask from.
   * @returns The event mask of the physics body.
   *
   */
  getEventMask(e, t) {
    const r = this._getPluginReference(e, t);
    return this._hknp.HP_Body_GetEventMask(r.hpBodyId)[1];
  }
  _fromMassPropertiesTuple(e) {
    return {
      centerOfMass: S.FromArray(e[0]),
      mass: e[1],
      inertia: S.FromArray(e[2]),
      inertiaOrientation: Ze.FromArray(e[3])
    };
  }
  _internalUpdateMassProperties(e) {
    const t = this._internalComputeMassProperties(e), r = e.userMassProps;
    r.centerOfMass && (t[0] = r.centerOfMass.asArray()), r.mass != null && (t[1] = r.mass), r.inertia && (t[2] = r.inertia.asArray()), r.inertiaOrientation && (t[3] = r.inertiaOrientation.asArray()), this._hknp.HP_Body_SetMassProperties(e.hpBodyId, t);
  }
  _internalSetMotionType(e, t) {
    switch (t) {
      case W0.STATIC:
        this._hknp.HP_Body_SetMotionType(e.hpBodyId, this._hknp.MotionType.STATIC);
        break;
      case W0.ANIMATED:
        this._hknp.HP_Body_SetMotionType(e.hpBodyId, this._hknp.MotionType.KINEMATIC);
        break;
      case W0.DYNAMIC:
        this._hknp.HP_Body_SetMotionType(e.hpBodyId, this._hknp.MotionType.DYNAMIC);
        break;
    }
  }
  setMotionType(e, t, r) {
    this._applyToBodyOrInstances(e, (n) => {
      this._internalSetMotionType(n, t);
    }, r);
  }
  getMotionType(e, t) {
    const r = this._getPluginReference(e, t), n = this._hknp.HP_Body_GetMotionType(r.hpBodyId)[1];
    switch (n) {
      case this._hknp.MotionType.STATIC:
        return W0.STATIC;
      case this._hknp.MotionType.KINEMATIC:
        return W0.ANIMATED;
      case this._hknp.MotionType.DYNAMIC:
        return W0.DYNAMIC;
    }
    throw new Error("Unknown motion type: " + n);
  }
  _internalComputeMassProperties(e) {
    const t = this._hknp.HP_Body_GetShape(e.hpBodyId);
    if (t[0] == this._hknp.Result.RESULT_OK) {
      const r = this._hknp.HP_Shape_BuildMassProperties(t[1]);
      if (r[0] == this._hknp.Result.RESULT_OK)
        return r[1];
    }
    return [[0, 0, 0], 1, [1, 1, 1], [0, 0, 0, 1]];
  }
  /**
   * Computes the mass properties of a physics body, from it's shape
   *
   * @param body - The physics body to copmute the mass properties of
   */
  computeMassProperties(e, t) {
    const r = this._getPluginReference(e, t), n = this._internalComputeMassProperties(r);
    return this._fromMassPropertiesTuple(n);
  }
  /**
   * Sets the mass properties of a physics body.
   *
   * @param body - The physics body to set the mass properties of.
   * @param massProps - The mass properties to set.
   * @param instanceIndex - The index of the instance to set the mass properties of. If undefined, the mass properties of all the bodies will be set.
   * This function is useful for setting the mass properties of a physics body,
   * such as its mass, inertia, and center of mass. This is important for
   * accurately simulating the physics of the body in the physics engine.
   *
   */
  setMassProperties(e, t, r) {
    this._applyToBodyOrInstances(e, (n) => {
      n.userMassProps = t, this._internalUpdateMassProperties(n);
    }, r);
  }
  /**
   *
   */
  getMassProperties(e, t) {
    const r = this._getPluginReference(e, t), n = this._hknp.HP_Body_GetMassProperties(r.hpBodyId)[1];
    return this._fromMassPropertiesTuple(n);
  }
  /**
   * Sets the linear damping of the given body.
   * @param body - The body to set the linear damping for.
   * @param damping - The linear damping to set.
   *
   * This method is useful for controlling the linear damping of a body in a physics engine.
   * Linear damping is a force that opposes the motion of the body, and is proportional to the velocity of the body.
   * This method allows the user to set the linear damping of a body, which can be used to control the motion of the body.
   */
  setLinearDamping(e, t, r) {
    this._applyToBodyOrInstances(e, (n) => {
      this._hknp.HP_Body_SetLinearDamping(n.hpBodyId, t);
    }, r);
  }
  /**
   * Gets the linear damping of the given body.
   * @param body - The body to get the linear damping from.
   * @returns The linear damping of the given body.
   *
   * This method is useful for getting the linear damping of a body in a physics engine.
   * Linear damping is a force that opposes the motion of the body and is proportional to the velocity of the body.
   * It is used to simulate the effects of air resistance and other forms of friction.
   */
  getLinearDamping(e, t) {
    const r = this._getPluginReference(e, t);
    return this._hknp.HP_Body_GetLinearDamping(r.hpBodyId)[1];
  }
  /**
   * Sets the angular damping of a physics body.
   * @param body - The physics body to set the angular damping for.
   * @param damping - The angular damping value to set.
   *
   * This function is useful for controlling the angular velocity of a physics body.
   * By setting the angular damping, the body's angular velocity will be reduced over time, allowing for more realistic physics simulations.
   */
  setAngularDamping(e, t, r) {
    this._applyToBodyOrInstances(e, (n) => {
      this._hknp.HP_Body_SetAngularDamping(n.hpBodyId, t);
    }, r);
  }
  /**
   * Gets the angular damping of a physics body.
   * @param body - The physics body to get the angular damping from.
   * @returns The angular damping of the body.
   *
   * This function is useful for retrieving the angular damping of a physics body,
   * which is used to control the rotational motion of the body. The angular damping is a value between 0 and 1, where 0 is no damping and 1 is full damping.
   */
  getAngularDamping(e, t) {
    const r = this._getPluginReference(e, t);
    return this._hknp.HP_Body_GetAngularDamping(r.hpBodyId)[1];
  }
  /**
   * Sets the linear velocity of a physics body.
   * @param body - The physics body to set the linear velocity of.
   * @param linVel - The linear velocity to set.
   *
   * This function is useful for setting the linear velocity of a physics body, which is necessary for simulating
   * motion in a physics engine. The linear velocity is the speed and direction of the body's movement.
   */
  setLinearVelocity(e, t, r) {
    this._applyToBodyOrInstances(e, (n) => {
      this._hknp.HP_Body_SetLinearVelocity(n.hpBodyId, this._bVecToV3(t));
    }, r);
  }
  /**
   * Gets the linear velocity of a physics body and stores it in a given vector.
   * @param body - The physics body to get the linear velocity from.
   * @param linVel - The vector to store the linear velocity in.
   *
   * This function is useful for retrieving the linear velocity of a physics body,
   * which can be used to determine the speed and direction of the body. This
   * information can be used to simulate realistic physics behavior in a game.
   */
  getLinearVelocityToRef(e, t, r) {
    const n = this._getPluginReference(e, r), i = this._hknp.HP_Body_GetLinearVelocity(n.hpBodyId)[1];
    this._v3ToBvecRef(i, t);
  }
  /*
   * Apply an operation either to all instances of a body, if instanceIndex is not specified, or to a specific instance.
   */
  _applyToBodyOrInstances(e, t, r) {
    var n;
    if (((n = e._pluginDataInstances) === null || n === void 0 ? void 0 : n.length) > 0 && r === void 0)
      for (let i = 0; i < e._pluginDataInstances.length; i++)
        t(e._pluginDataInstances[i]);
    else
      t(this._getPluginReference(e, r));
  }
  /**
   * Applies an impulse to a physics body at a given location.
   * @param body - The physics body to apply the impulse to.
   * @param impulse - The impulse vector to apply.
   * @param location - The location in world space to apply the impulse.
   * @param instanceIndex - The index of the instance to apply the impulse to. If not specified, the impulse will be applied to all instances.
   *
   * This method is useful for applying an impulse to a physics body at a given location.
   * This can be used to simulate physical forces such as explosions, collisions, and gravity.
   */
  applyImpulse(e, t, r, n) {
    this._applyToBodyOrInstances(e, (i) => {
      this._hknp.HP_Body_ApplyImpulse(i.hpBodyId, this._bVecToV3(r), this._bVecToV3(t));
    }, n);
  }
  /**
   * Applies a force to a physics body at a given location.
   * @param body - The physics body to apply the impulse to.
   * @param force - The force vector to apply.
   * @param location - The location in world space to apply the impulse.
   * @param instanceIndex - The index of the instance to apply the force to. If not specified, the force will be applied to all instances.
   *
   * This method is useful for applying a force to a physics body at a given location.
   * This can be used to simulate physical forces such as explosions, collisions, and gravity.
   */
  applyForce(e, t, r, n) {
    t.scaleToRef(this.getTimeStep(), this._tmpVec3[0]), this.applyImpulse(e, this._tmpVec3[0], r, n);
  }
  /**
   * Sets the angular velocity of a physics body.
   *
   * @param body - The physics body to set the angular velocity of.
   * @param angVel - The angular velocity to set.
   *
   * This function is useful for setting the angular velocity of a physics body in a physics engine.
   * This allows for more realistic simulations of physical objects, as they can be given a rotational velocity.
   */
  setAngularVelocity(e, t, r) {
    this._applyToBodyOrInstances(e, (n) => {
      this._hknp.HP_Body_SetAngularVelocity(n.hpBodyId, this._bVecToV3(t));
    }, r);
  }
  /**
   * Gets the angular velocity of a body.
   * @param body - The body to get the angular velocity from.
   * @param angVel - The vector3 to store the angular velocity.
   *
   * This method is useful for getting the angular velocity of a body in a physics engine. It
   * takes the body and a vector3 as parameters and stores the angular velocity of the body
   * in the vector3. This is useful for getting the angular velocity of a body in order to
   * calculate the motion of the body in the physics engine.
   */
  getAngularVelocityToRef(e, t, r) {
    const n = this._getPluginReference(e, r), i = this._hknp.HP_Body_GetAngularVelocity(n.hpBodyId)[1];
    this._v3ToBvecRef(i, t);
  }
  /**
   * Sets the transformation of the given physics body to the given transform node.
   * @param body The physics body to set the transformation for.
   * @param node The transform node to set the transformation from.
   * Sets the transformation of the given physics body to the given transform node.
   *
   * This function is useful for setting the transformation of a physics body to a
   * transform node, which is necessary for the physics engine to accurately simulate
   * the motion of the body. It also takes into account instances of the transform
   * node, which is necessary for accurate simulation of multiple bodies with the
   * same transformation.
   */
  setPhysicsBodyTransformation(e, t) {
    const r = e.transformNode;
    if (e.numInstances > 0) {
      const i = r._thinInstanceDataStorage.matrixData;
      if (!i)
        return;
      const s = e.numInstances;
      this._createOrUpdateBodyInstances(e, e.getMotionType(), i, 0, s, !0);
    } else
      this._hknp.HP_Body_SetQTransform(e._pluginData.hpBodyId, this._getTransformInfos(t));
  }
  /**
   * Set the target transformation (position and rotation) of the body, such that the body will set its velocity to reach that target
   * @param body The physics body to set the target transformation for.
   * @param position The target position
   * @param rotation The target rotation
   * @param instanceIndex The index of the instance in an instanced body
   */
  setTargetTransform(e, t, r, n) {
    this._applyToBodyOrInstances(e, (i) => {
      this._hknp.HP_Body_SetTargetQTransform(i.hpBodyId, [this._bVecToV3(t), this._bQuatToV4(r)]);
    }, n);
  }
  /**
   * Sets the gravity factor of a body
   * @param body the physics body to set the gravity factor for
   * @param factor the gravity factor
   * @param instanceIndex the index of the instance in an instanced body
   */
  setGravityFactor(e, t, r) {
    this._applyToBodyOrInstances(e, (n) => {
      this._hknp.HP_Body_SetGravityFactor(n.hpBodyId, t);
    }, r);
  }
  /**
   * Get the gravity factor of a body
   * @param body the physics body to get the gravity factor from
   * @param instanceIndex the index of the instance in an instanced body. If not specified, the gravity factor of the first instance will be returned.
   * @returns the gravity factor
   */
  getGravityFactor(e, t) {
    const r = this._getPluginReference(e, t);
    return this._hknp.HP_Body_GetGravityFactor(r.hpBodyId)[1];
  }
  /**
   * Disposes a physics body.
   *
   * @param body - The physics body to dispose.
   *
   * This method is useful for releasing the resources associated with a physics body when it is no longer needed.
   * This is important for avoiding memory leaks in the physics engine.
   */
  disposeBody(e) {
    if (e._pluginDataInstances && e._pluginDataInstances.length > 0)
      for (const t of e._pluginDataInstances)
        this._hknp.HP_Body_Release(t.hpBodyId), t.hpBodyId = void 0;
    e._pluginData && (this._hknp.HP_Body_Release(e._pluginData.hpBodyId), e._pluginData.hpBodyId = void 0);
  }
  /**
   * Initializes a physics shape with the given type and parameters.
   * @param shape - The physics shape to initialize.
   * @param type - The type of shape to initialize.
   * @param options - The parameters for the shape.
   *
   * This code is useful for initializing a physics shape with the given type and parameters.
   * It allows for the creation of a sphere, box, capsule, container, cylinder, mesh, and heightfield.
   * Depending on the type of shape, different parameters are required.
   * For example, a sphere requires a radius, while a box requires extents and a rotation.
   */
  initShape(e, t, r) {
    switch (t) {
      case Ff.SPHERE:
        {
          const n = r.radius || 1, i = r.center ? this._bVecToV3(r.center) : [0, 0, 0];
          e._pluginData = this._hknp.HP_Shape_CreateSphere(i, n)[1];
        }
        break;
      case Ff.BOX:
        {
          const n = r.rotation ? this._bQuatToV4(r.rotation) : [0, 0, 0, 1], i = r.extents ? this._bVecToV3(r.extents) : [1, 1, 1], s = r.center ? this._bVecToV3(r.center) : [0, 0, 0];
          e._pluginData = this._hknp.HP_Shape_CreateBox(s, n, i)[1];
        }
        break;
      case Ff.CAPSULE:
        {
          const n = r.pointA ? this._bVecToV3(r.pointA) : [0, 0, 0], i = r.pointB ? this._bVecToV3(r.pointB) : [0, 1, 0], s = r.radius || 0;
          e._pluginData = this._hknp.HP_Shape_CreateCapsule(n, i, s)[1];
        }
        break;
      case Ff.CONTAINER:
        e._pluginData = this._hknp.HP_Shape_CreateContainer()[1];
        break;
      case Ff.CYLINDER:
        {
          const n = r.pointA ? this._bVecToV3(r.pointA) : [0, 0, 0], i = r.pointB ? this._bVecToV3(r.pointB) : [0, 1, 0], s = r.radius || 0;
          e._pluginData = this._hknp.HP_Shape_CreateCylinder(n, i, s)[1];
        }
        break;
      case Ff.CONVEX_HULL:
      case Ff.MESH:
        {
          const n = r.mesh;
          if (n) {
            const i = !!r.includeChildMeshes, s = t != Ff.CONVEX_HULL, a = new o0e(n, s, n == null ? void 0 : n.getScene());
            a.addNodeMeshes(n, i);
            const f = a.getVertices(this._hknp), o = f.numObjects / 3;
            if (t == Ff.CONVEX_HULL)
              e._pluginData = this._hknp.HP_Shape_CreateConvexHull(f.offset, o)[1];
            else {
              const d = a.getTriangles(this._hknp), v = d.numObjects / 3;
              e._pluginData = this._hknp.HP_Shape_CreateMesh(f.offset, o, d.offset, v)[1], a.freeBuffer(this._hknp, d);
            }
            a.freeBuffer(this._hknp, f);
          } else
            throw new Error("No mesh provided to create physics shape.");
        }
        break;
      default:
        throw new Error("Unsupported Shape Type.");
    }
  }
  setShapeFilterMembershipMask(e, t) {
    const r = this._hknp.HP_Shape_GetFilterInfo(e._pluginData)[1][1];
    this._hknp.HP_Shape_SetFilterInfo(e._pluginData, [t, r]);
  }
  getShapeFilterMembershipMask(e) {
    return this._hknp.HP_Shape_GetFilterInfo(e._pluginData)[1][0];
  }
  setShapeFilterCollideMask(e, t) {
    const r = this._hknp.HP_Shape_GetFilterInfo(e._pluginData)[1][0];
    this._hknp.HP_Shape_SetFilterInfo(e._pluginData, [r, t]);
  }
  getShapeFilterCollideMask(e) {
    return this._hknp.HP_Shape_GetFilterInfo(e._pluginData)[1][1];
  }
  /**
   * Sets the material of a physics shape.
   * @param shape - The physics shape to set the material of.
   * @param material - The material to set.
   *
   */
  setMaterial(e, t) {
    var r, n, i, s, a;
    const f = (r = t.friction) !== null && r !== void 0 ? r : 0.5, o = (n = t.staticFriction) !== null && n !== void 0 ? n : f, d = (i = t.restitution) !== null && i !== void 0 ? i : 0, v = (s = t.frictionCombine) !== null && s !== void 0 ? s : R2.MINIMUM, u = (a = t.restitutionCombine) !== null && a !== void 0 ? a : R2.MAXIMUM, l = [o, f, d, this._materialCombineToNative(v), this._materialCombineToNative(u)];
    this._hknp.HP_Shape_SetMaterial(e._pluginData, l);
  }
  /**
   * Sets the density of a physics shape.
   * @param shape - The physics shape to set the density of.
   * @param density - The density to set.
   *
   */
  setDensity(e, t) {
    this._hknp.HP_Shape_SetDensity(e._pluginData, t);
  }
  /**
   * Calculates the density of a given physics shape.
   *
   * @param shape - The physics shape to calculate the density of.
   * @returns The density of the given physics shape.
   *
   */
  getDensity(e) {
    return this._hknp.HP_Shape_GetDensity(e._pluginData)[1];
  }
  /**
   * Gets the transform infos of a given transform node.
   * @param node - The transform node.
   * @returns An array containing the position and orientation of the node.
   * This code is useful for getting the position and orientation of a given transform node.
   * It first checks if the node has a rotation quaternion, and if not, it creates one from the node's rotation.
   * It then creates an array containing the position and orientation of the node and returns it.
   */
  _getTransformInfos(e) {
    if (e.parent)
      return e.computeWorldMatrix(!0), [this._bVecToV3(e.absolutePosition), this._bQuatToV4(e.absoluteRotationQuaternion)];
    let t = ue.Quaternion[0];
    if (e.rotationQuaternion)
      t = e.rotationQuaternion;
    else {
      const n = e.rotation;
      Ze.FromEulerAnglesToRef(n.x, n.y, n.z, t);
    }
    return [this._bVecToV3(e.position), this._bQuatToV4(t)];
  }
  /**
   * Adds a child shape to the given shape.
   * @param shape - The parent shape.
   * @param newChild - The child shape to add.
   * @param translation - The relative translation of the child from the parent shape
   * @param rotation - The relative rotation of the child from the parent shape
   * @param scale - The relative scale scale of the child from the parent shaep
   *
   */
  addChild(e, t, r, n, i) {
    const s = [
      r ? this._bVecToV3(r) : [0, 0, 0],
      n ? this._bQuatToV4(n) : [0, 0, 0, 1],
      i ? this._bVecToV3(i) : [1, 1, 1]
    ];
    this._hknp.HP_Shape_AddChild(e._pluginData, t._pluginData, s);
  }
  /**
   * Removes a child shape from a parent shape.
   * @param shape - The parent shape.
   * @param childIndex - The index of the child shape to remove.
   *
   */
  removeChild(e, t) {
    this._hknp.HP_Shape_RemoveChild(e._pluginData, t);
  }
  /**
   * Returns the number of children of the given shape.
   *
   * @param shape - The shape to get the number of children from.
   * @returns The number of children of the given shape.
   *
   */
  getNumChildren(e) {
    return this._hknp.HP_Shape_GetNumChildren(e._pluginData)[1];
  }
  /**
   * Marks the shape as a trigger
   * @param shape the shape to mark as a trigger
   * @param isTrigger if the shape is a trigger
   */
  setTrigger(e, t) {
    this._hknp.HP_Shape_SetTrigger(e._pluginData, t);
  }
  /**
   * Calculates the bounding box of a given physics shape.
   *
   * @param _shape - The physics shape to calculate the bounding box for.
   * @returns The calculated bounding box.
   *
   * This method is useful for physics engines as it allows to calculate the
   * boundaries of a given shape. Knowing the boundaries of a shape is important
   * for collision detection and other physics calculations.
   */
  getBoundingBox(e) {
    return {};
  }
  /**
   * Gets the geometry of a physics body.
   *
   * @param body - The physics body.
   * @returns An object containing the positions and indices of the body's geometry.
   *
   */
  getBodyGeometry(e) {
    var t;
    const r = ((t = e._pluginDataInstances) === null || t === void 0 ? void 0 : t.length) > 0 ? e._pluginDataInstances[0] : e._pluginData, n = this._hknp.HP_Body_GetShape(r.hpBodyId)[1], i = this._hknp.HP_Shape_CreateDebugDisplayGeometry(n);
    if (i[0] != this._hknp.Result.RESULT_OK)
      return { positions: [], indices: [] };
    const s = this._hknp.HP_DebugGeometry_GetInfo(i[1])[1], a = new Float32Array(this._hknp.HEAPU8.buffer, s[0], s[1] * 3), f = new Uint32Array(this._hknp.HEAPU8.buffer, s[2], s[3] * 3), o = a.slice(0), d = f.slice(0);
    return this._hknp.HP_DebugGeometry_Release(i[1]), { positions: o, indices: d };
  }
  /**
   * Releases a physics shape from the physics engine.
   *
   * @param shape - The physics shape to be released.
   * @returns void
   *
   * This method is useful for releasing a physics shape from the physics engine, freeing up resources and preventing memory leaks.
   */
  disposeShape(e) {
    this._hknp.HP_Shape_Release(e._pluginData), e._pluginData = void 0;
  }
  // constraint
  /**
   * Initializes a physics constraint with the given parameters.
   *
   * @param constraint - The physics constraint to be initialized.
   * @param body - The main body
   * @param childBody - The child body.
   * @param instanceIndex - If this body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
   * @param childInstanceIndex - If the child body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
   *
   * This function is useful for setting up a physics constraint in a physics engine.
   */
  initConstraint(e, t, r, n, i) {
    var s, a, f, o, d;
    const v = e.type, u = e.options;
    if (!v || !u) {
      Se.Warn("No constraint type or options. Constraint is invalid.");
      return;
    }
    if (t._pluginDataInstances.length > 0 && n === void 0 || r._pluginDataInstances.length > 0 && i === void 0) {
      Se.Warn("Body is instanced but no instance index was specified. Constraint will not be applied.");
      return;
    }
    e._pluginData = (s = e._pluginData) !== null && s !== void 0 ? s : [];
    const l = this._hknp.HP_Constraint_Create()[1];
    e._pluginData.push(l);
    const P = this._getPluginReference(t, n).hpBodyId, p = this._getPluginReference(r, i).hpBodyId;
    this._hknp.HP_Constraint_SetParentBody(l, P), this._hknp.HP_Constraint_SetChildBody(l, p), this._constraintToBodyIdPair.set(l[0], [P[0], p[0]]);
    const c = u.pivotA ? this._bVecToV3(u.pivotA) : this._bVecToV3(S.Zero()), H = (a = u.axisA) !== null && a !== void 0 ? a : new S(1, 0, 0), T = this._tmpVec3[0];
    u.perpAxisA ? T.copyFrom(u.perpAxisA) : H.getNormalToRef(T), this._hknp.HP_Constraint_SetAnchorInParent(l, c, this._bVecToV3(H), this._bVecToV3(T));
    const q = u.pivotB ? this._bVecToV3(u.pivotB) : this._bVecToV3(S.Zero()), b = (f = u.axisB) !== null && f !== void 0 ? f : new S(1, 0, 0), j = this._tmpVec3[0];
    if (u.perpAxisB ? j.copyFrom(u.perpAxisB) : b.getNormalToRef(j), this._hknp.HP_Constraint_SetAnchorInChild(l, q, this._bVecToV3(b), this._bVecToV3(j)), e._initOptions || (e._initOptions = {
      axisA: H.clone(),
      axisB: b.clone(),
      perpAxisA: T.clone(),
      perpAxisB: j.clone(),
      pivotA: new S(c[0], c[1], c[2]),
      pivotB: new S(q[0], q[1], q[2])
    }), v == kv.LOCK)
      this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.ANGULAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
    else if (v == kv.DISTANCE) {
      const m = u.maxDistance || 0, I = this._hknp.ConstraintAxis.LINEAR_DISTANCE;
      this._hknp.HP_Constraint_SetAxisMode(l, I, this._hknp.ConstraintAxisLimitMode.LIMITED), this._hknp.HP_Constraint_SetAxisMinLimit(l, I, m), this._hknp.HP_Constraint_SetAxisMaxLimit(l, I, m);
    } else if (v == kv.HINGE)
      this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
    else if (v == kv.PRISMATIC)
      this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.ANGULAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
    else if (v == kv.SLIDER)
      this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
    else if (v == kv.BALL_AND_SOCKET)
      this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED), this._hknp.HP_Constraint_SetAxisMode(l, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
    else if (v == kv.SIX_DOF) {
      const m = e;
      for (const I of m.limits) {
        const N = this._constraintAxisToNative(I.axis);
        ((o = I.minLimit) !== null && o !== void 0 ? o : -1) == 0 && ((d = I.maxLimit) !== null && d !== void 0 ? d : -1) == 0 ? this._hknp.HP_Constraint_SetAxisMode(l, N, this._hknp.ConstraintAxisLimitMode.LOCKED) : (I.minLimit != null && (this._hknp.HP_Constraint_SetAxisMode(l, N, this._hknp.ConstraintAxisLimitMode.LIMITED), this._hknp.HP_Constraint_SetAxisMinLimit(l, N, I.minLimit)), I.maxLimit != null && (this._hknp.HP_Constraint_SetAxisMode(l, N, this._hknp.ConstraintAxisLimitMode.LIMITED), this._hknp.HP_Constraint_SetAxisMaxLimit(l, N, I.maxLimit))), I.stiffness && this._hknp.HP_Constraint_SetAxisStiffness(l, N, I.stiffness), I.damping && this._hknp.HP_Constraint_SetAxisDamping(l, N, I.damping);
      }
    } else
      throw new Error("Unsupported Constraint Type.");
    const w = !!u.collision;
    this._hknp.HP_Constraint_SetCollisionsEnabled(l, w), this._hknp.HP_Constraint_SetEnabled(l, !0);
  }
  /**
   * Get a list of all the pairs of bodies that are connected by this constraint.
   * @param constraint the constraint to search from
   * @returns a list of parent, child pairs
   */
  getBodiesUsingConstraint(e) {
    const t = [];
    for (const r of e._pluginData) {
      const n = this._constraintToBodyIdPair.get(r[0]);
      if (n) {
        const i = this._bodies.get(n[0]), s = this._bodies.get(n[1]);
        i && s && t.push({ parentBody: i.body, parentBodyIndex: i.index, childBody: s.body, childBodyIndex: s.index });
      }
    }
    return t;
  }
  /**
   * Adds a constraint to the physics engine.
   *
   * @param body - The main body to which the constraint is applied.
   * @param childBody - The body to which the constraint is applied.
   * @param constraint - The constraint to be applied.
   * @param instanceIndex - If this body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
   * @param childInstanceIndex - If the child body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
   */
  addConstraint(e, t, r, n, i) {
    this.initConstraint(r, e, t, n, i);
  }
  /**
   * Enables or disables a constraint in the physics engine.
   * @param constraint - The constraint to enable or disable.
   * @param isEnabled - Whether the constraint should be enabled or disabled.
   *
   */
  setEnabled(e, t) {
    for (const r of e._pluginData)
      this._hknp.HP_Constraint_SetEnabled(r, t);
  }
  /**
   * Gets the enabled state of the given constraint.
   * @param constraint - The constraint to get the enabled state from.
   * @returns The enabled state of the given constraint.
   *
   */
  getEnabled(e) {
    const t = e._pluginData && e._pluginData[0];
    return t ? this._hknp.HP_Constraint_GetEnabled(t)[1] : !1;
  }
  /**
   * Enables or disables collisions for the given constraint.
   * @param constraint - The constraint to enable or disable collisions for.
   * @param isEnabled - Whether collisions should be enabled or disabled.
   *
   */
  setCollisionsEnabled(e, t) {
    for (const r of e._pluginData)
      this._hknp.HP_Constraint_SetCollisionsEnabled(r, t);
  }
  /**
   * Gets whether collisions are enabled for the given constraint.
   * @param constraint - The constraint to get collisions enabled for.
   * @returns Whether collisions are enabled for the given constraint.
   *
   */
  getCollisionsEnabled(e) {
    const t = e._pluginData && e._pluginData[0];
    return t ? this._hknp.HP_Constraint_GetCollisionsEnabled(t)[1] : !1;
  }
  /**
   * Sets the friction of the given axis of the given constraint.
   *
   * @param constraint - The constraint to set the friction of.
   * @param axis - The axis of the constraint to set the friction of.
   * @param friction - The friction to set.
   * @returns void
   *
   */
  setAxisFriction(e, t, r) {
    for (const n of e._pluginData)
      this._hknp.HP_Constraint_SetAxisFriction(n, this._constraintAxisToNative(t), r);
  }
  /**
   * Gets the friction value of the specified axis of the given constraint.
   *
   * @param constraint - The constraint to get the axis friction from.
   * @param axis - The axis to get the friction from.
   * @returns The friction value of the specified axis.
   *
   */
  getAxisFriction(e, t) {
    const r = e._pluginData && e._pluginData[0];
    return r ? this._hknp.HP_Constraint_GetAxisFriction(r, this._constraintAxisToNative(t))[1] : null;
  }
  /**
   * Sets the limit mode of the specified axis of the given constraint.
   * @param constraint - The constraint to set the axis mode of.
   * @param axis - The axis to set the limit mode of.
   * @param limitMode - The limit mode to set.
   */
  setAxisMode(e, t, r) {
    for (const n of e._pluginData)
      this._hknp.HP_Constraint_SetAxisMode(n, this._constraintAxisToNative(t), this._limitModeToNative(r));
  }
  /**
   * Gets the axis limit mode of the given constraint.
   *
   * @param constraint - The constraint to get the axis limit mode from.
   * @param axis - The axis to get the limit mode from.
   * @returns The axis limit mode of the given constraint.
   *
   */
  getAxisMode(e, t) {
    const r = e._pluginData && e._pluginData[0];
    if (r) {
      const n = this._hknp.HP_Constraint_GetAxisMode(r, this._constraintAxisToNative(t))[1];
      return this._nativeToLimitMode(n);
    }
    return null;
  }
  /**
   * Sets the minimum limit of the given axis of the given constraint.
   * @param constraint - The constraint to set the minimum limit of.
   * @param axis - The axis to set the minimum limit of.
   * @param limit - The minimum limit to set.
   *
   */
  setAxisMinLimit(e, t, r) {
    for (const n of e._pluginData)
      this._hknp.HP_Constraint_SetAxisMinLimit(n, this._constraintAxisToNative(t), r);
  }
  /**
   * Gets the minimum limit of the specified axis of the given constraint.
   * @param constraint - The constraint to get the minimum limit from.
   * @param axis - The axis to get the minimum limit from.
   * @returns The minimum limit of the specified axis of the given constraint.
   *
   */
  getAxisMinLimit(e, t) {
    const r = e._pluginData && e._pluginData[0];
    return r ? this._hknp.HP_Constraint_GetAxisMinLimit(r, this._constraintAxisToNative(t))[1] : null;
  }
  /**
   * Sets the maximum limit of the given axis of the given constraint.
   * @param constraint - The constraint to set the maximum limit of the given axis.
   * @param axis - The axis to set the maximum limit of.
   * @param limit - The maximum limit to set.
   *
   */
  setAxisMaxLimit(e, t, r) {
    for (const n of e._pluginData)
      this._hknp.HP_Constraint_SetAxisMaxLimit(n, this._constraintAxisToNative(t), r);
  }
  /**
   * Gets the maximum limit of the given axis of the given constraint.
   *
   * @param constraint - The constraint to get the maximum limit from.
   * @param axis - The axis to get the maximum limit from.
   * @returns The maximum limit of the given axis of the given constraint.
   *
   */
  getAxisMaxLimit(e, t) {
    const r = e._pluginData && e._pluginData[0];
    return r ? this._hknp.HP_Constraint_GetAxisMaxLimit(r, this._constraintAxisToNative(t))[1] : null;
  }
  /**
   * Sets the motor type of the given axis of the given constraint.
   * @param constraint - The constraint to set the motor type of.
   * @param axis - The axis of the constraint to set the motor type of.
   * @param motorType - The motor type to set.
   * @returns void
   *
   */
  setAxisMotorType(e, t, r) {
    for (const n of e._pluginData)
      this._hknp.HP_Constraint_SetAxisMotorType(n, this._constraintAxisToNative(t), this._constraintMotorTypeToNative(r));
  }
  /**
   * Gets the motor type of the specified axis of the given constraint.
   * @param constraint - The constraint to get the motor type from.
   * @param axis - The axis of the constraint to get the motor type from.
   * @returns The motor type of the specified axis of the given constraint.
   *
   */
  getAxisMotorType(e, t) {
    const r = e._pluginData && e._pluginData[0];
    return r ? this._nativeToMotorType(this._hknp.HP_Constraint_GetAxisMotorType(r, this._constraintAxisToNative(t))[1]) : null;
  }
  /**
   * Sets the target of an axis motor of a constraint.
   *
   * @param constraint - The constraint to set the axis motor target of.
   * @param axis - The axis of the constraint to set the motor target of.
   * @param target - The target of the axis motor.
   *
   */
  setAxisMotorTarget(e, t, r) {
    for (const n of e._pluginData)
      this._hknp.HP_Constraint_SetAxisMotorTarget(n, this._constraintAxisToNative(t), r);
  }
  /**
   * Gets the target of the motor of the given axis of the given constraint.
   *
   * @param constraint - The constraint to get the motor target from.
   * @param axis - The axis of the constraint to get the motor target from.
   * @returns The target of the motor of the given axis of the given constraint.
   *
   */
  getAxisMotorTarget(e, t) {
    return e._pluginData && e._pluginData[0] ? this._hknp.HP_Constraint_GetAxisMotorTarget(e._pluginData, this._constraintAxisToNative(t))[1] : null;
  }
  /**
   * Sets the maximum force that can be applied by the motor of the given constraint axis.
   * @param constraint - The constraint to set the motor max force for.
   * @param axis - The axis of the constraint to set the motor max force for.
   * @param maxForce - The maximum force that can be applied by the motor.
   *
   */
  setAxisMotorMaxForce(e, t, r) {
    for (const n of e._pluginData)
      this._hknp.HP_Constraint_SetAxisMotorMaxForce(n, this._constraintAxisToNative(t), r);
  }
  /**
   * Gets the maximum force of the motor of the given constraint axis.
   *
   * @param constraint - The constraint to get the motor maximum force from.
   * @param axis - The axis of the constraint to get the motor maximum force from.
   * @returns The maximum force of the motor of the given constraint axis.
   *
   */
  getAxisMotorMaxForce(e, t) {
    const r = e._pluginData && e._pluginData[0];
    return r ? this._hknp.HP_Constraint_GetAxisMotorMaxForce(r, this._constraintAxisToNative(t))[1] : null;
  }
  /**
   * Disposes a physics constraint.
   *
   * @param constraint - The physics constraint to dispose.
   *
   * This method is useful for releasing the resources associated with a physics constraint, such as
   * the Havok constraint, when it is no longer needed. This is important for avoiding memory leaks.
   */
  disposeConstraint(e) {
    for (const t of e._pluginData)
      this._hknp.HP_Constraint_SetEnabled(t, !1), this._hknp.HP_Constraint_Release(t);
    e._pluginData.length = 0;
  }
  /**
   * Performs a raycast from a given start point to a given end point and stores the result in a given PhysicsRaycastResult object.
   *
   * @param from - The start point of the raycast.
   * @param to - The end point of the raycast.
   * @param result - The PhysicsRaycastResult object to store the result of the raycast.
   * @param query - The raycast query options. See [[IRaycastQuery]] for more information.
   *
   * Performs a raycast. It takes in two points, from and to, and a PhysicsRaycastResult object to store the result of the raycast.
   * It then performs the raycast and stores the hit data in the PhysicsRaycastResult object.
   */
  raycast(e, t, r, n) {
    var i, s;
    const a = (i = n == null ? void 0 : n.membership) !== null && i !== void 0 ? i : -1, f = (s = n == null ? void 0 : n.collideWith) !== null && s !== void 0 ? s : -1;
    r.reset(e, t);
    const o = !1, d = [BigInt(0)], v = [this._bVecToV3(e), this._bVecToV3(t), [a, f], o, d];
    if (this._hknp.HP_World_CastRayWithCollector(this.world, this._queryCollector, v), this._hknp.HP_QueryCollector_GetNumHits(this._queryCollector)[1] > 0) {
      const u = this._hknp.HP_QueryCollector_GetCastRayResult(this._queryCollector, 0)[1], l = u[1][3], P = u[1][4], p = u[1][5];
      r.setHitData({ x: P[0], y: P[1], z: P[2] }, { x: l[0], y: l[1], z: l[2] }, p), r.calculateHitDistance();
      const c = this._bodies.get(u[1][0][0]);
      r.body = c == null ? void 0 : c.body, r.bodyIndex = c == null ? void 0 : c.index;
    }
  }
  /**
   * Return the collision observable for a particular physics body.
   * @param body the physics body
   */
  getCollisionObservable(e) {
    const t = e._pluginData.hpBodyId[0];
    let r = this._bodyCollisionObservable.get(t);
    return r || (r = new Oe(), this._bodyCollisionObservable.set(t, r)), r;
  }
  /**
   * Return the collision ended observable for a particular physics body.
   * @param body the physics body
   * @returns
   */
  getCollisionEndedObservable(e) {
    const t = e._pluginData.hpBodyId[0];
    let r = this._bodyCollisionEndedObservable.get(t);
    return r || (r = new Oe(), this._bodyCollisionEndedObservable.set(t, r)), r;
  }
  /**
   * Enable collision to be reported for a body when a callback is setup on the world
   * @param body the physics body
   * @param enabled
   */
  setCollisionCallbackEnabled(e, t) {
    const r = this._hknp.EventType.COLLISION_STARTED.value | this._hknp.EventType.COLLISION_CONTINUED.value | this._hknp.EventType.COLLISION_FINISHED.value;
    e._pluginDataInstances && e._pluginDataInstances.length ? e._pluginDataInstances.forEach((n) => {
      this._hknp.HP_Body_SetEventMask(n.hpBodyId, t ? r : 0);
    }) : e._pluginData && this._hknp.HP_Body_SetEventMask(e._pluginData.hpBodyId, t ? r : 0);
  }
  /**
   * Enable collision ended to be reported for a body when a callback is setup on the world
   * @param body
   * @param enabled
   */
  setCollisionEndedCallbackEnabled(e, t) {
    const r = this._getPluginReference(e);
    let n = this._hknp.HP_Body_GetEventMask(r.hpBodyId)[1];
    n = t ? n | this._hknp.EventType.COLLISION_FINISHED.value : n & ~this._hknp.EventType.COLLISION_FINISHED.value, e._pluginDataInstances && e._pluginDataInstances.length ? e._pluginDataInstances.forEach((i) => {
      this._hknp.HP_Body_SetEventMask(i.hpBodyId, n);
    }) : e._pluginData && this._hknp.HP_Body_SetEventMask(e._pluginData.hpBodyId, n);
  }
  _notifyTriggers() {
    let e = this._hknp.HP_World_GetTriggerEvents(this.world)[1];
    const t = new ZG();
    for (; e; ) {
      ZG.readToRef(this._hknp.HEAPU8.buffer, e, t);
      const r = this._bodies.get(t.bodyIdA), n = this._bodies.get(t.bodyIdB);
      if (r && n) {
        const i = {
          collider: r.body,
          colliderIndex: r.index,
          collidedAgainst: n.body,
          collidedAgainstIndex: n.index,
          type: this._nativeTriggerCollisionValueToCollisionType(t.type)
        };
        this.onTriggerCollisionObservable.notifyObservers(i);
      }
      e = this._hknp.HP_World_GetNextTriggerEvent(this.world, e);
    }
  }
  /**
   * Runs thru all detected collisions and filter by body
   */
  _notifyCollisions() {
    let e = this._hknp.HP_World_GetCollisionEvents(this.world)[1];
    const t = new GG(), r = Number(this.world);
    for (; e; ) {
      GG.readToRef(this._hknp.HEAPU8.buffer, e, t);
      const n = this._bodies.get(t.contactOnA.bodyId), i = this._bodies.get(t.contactOnB.bodyId);
      if (n && i) {
        const s = {
          collider: n.body,
          colliderIndex: n.index,
          collidedAgainst: i.body,
          collidedAgainstIndex: i.index,
          type: this._nativeCollisionValueToCollisionType(t.type)
        };
        if (s.type === q0.COLLISION_FINISHED)
          this.onCollisionEndedObservable.notifyObservers(s);
        else {
          t.contactOnB.position.subtractToRef(t.contactOnA.position, this._tmpVec3[0]);
          const a = S.Dot(this._tmpVec3[0], t.contactOnA.normal);
          s.point = t.contactOnA.position, s.distance = a, s.impulse = t.impulseApplied, s.normal = t.contactOnA.normal, this.onCollisionObservable.notifyObservers(s);
        }
        if (this._bodyCollisionObservable.size && s.type !== q0.COLLISION_FINISHED) {
          const a = this._bodyCollisionObservable.get(t.contactOnA.bodyId), f = this._bodyCollisionObservable.get(t.contactOnB.bodyId);
          a ? a.notifyObservers(s) : f && (s.collider = i.body, s.colliderIndex = i.index, s.collidedAgainst = n.body, s.collidedAgainstIndex = n.index, s.normal = t.contactOnB.normal, f.notifyObservers(s));
        } else if (this._bodyCollisionEndedObservable.size) {
          const a = this._bodyCollisionEndedObservable.get(t.contactOnA.bodyId), f = this._bodyCollisionEndedObservable.get(t.contactOnB.bodyId);
          a ? a.notifyObservers(s) : f && (s.collider = i.body, s.colliderIndex = i.index, s.collidedAgainst = n.body, s.collidedAgainstIndex = n.index, s.normal = t.contactOnB.normal, f.notifyObservers(s));
        }
      }
      e = this._hknp.HP_World_GetNextCollisionEvent(r, e);
    }
  }
  /**
   * Gets the number of bodies in the world
   */
  get numBodies() {
    return this._hknp.HP_World_GetNumBodies(this.world)[1];
  }
  /**
   * Dispose the world and free resources
   */
  dispose() {
    this._hknp.HP_QueryCollector_Release(this._queryCollector), this._queryCollector = BigInt(0), this._hknp.HP_World_Release(this.world), this.world = void 0;
  }
  _v3ToBvecRef(e, t) {
    t.set(e[0], e[1], e[2]);
  }
  _bVecToV3(e) {
    return [e._x, e._y, e._z];
  }
  _bQuatToV4(e) {
    return [e._x, e._y, e._z, e._w];
  }
  _constraintMotorTypeToNative(e) {
    switch (e) {
      case _x.POSITION:
        return this._hknp.ConstraintMotorType.POSITION;
      case _x.VELOCITY:
        return this._hknp.ConstraintMotorType.VELOCITY;
    }
    return this._hknp.ConstraintMotorType.NONE;
  }
  _nativeToMotorType(e) {
    switch (e) {
      case this._hknp.ConstraintMotorType.POSITION:
        return _x.POSITION;
      case this._hknp.ConstraintMotorType.VELOCITY:
        return _x.VELOCITY;
    }
    return _x.NONE;
  }
  _materialCombineToNative(e) {
    switch (e) {
      case R2.GEOMETRIC_MEAN:
        return this._hknp.MaterialCombine.GEOMETRIC_MEAN;
      case R2.MINIMUM:
        return this._hknp.MaterialCombine.MINIMUM;
      case R2.MAXIMUM:
        return this._hknp.MaterialCombine.MAXIMUM;
      case R2.ARITHMETIC_MEAN:
        return this._hknp.MaterialCombine.ARITHMETIC_MEAN;
      case R2.MULTIPLY:
        return this._hknp.MaterialCombine.MULTIPLY;
    }
  }
  _constraintAxisToNative(e) {
    switch (e) {
      case MH.LINEAR_X:
        return this._hknp.ConstraintAxis.LINEAR_X;
      case MH.LINEAR_Y:
        return this._hknp.ConstraintAxis.LINEAR_Y;
      case MH.LINEAR_Z:
        return this._hknp.ConstraintAxis.LINEAR_Z;
      case MH.ANGULAR_X:
        return this._hknp.ConstraintAxis.ANGULAR_X;
      case MH.ANGULAR_Y:
        return this._hknp.ConstraintAxis.ANGULAR_Y;
      case MH.ANGULAR_Z:
        return this._hknp.ConstraintAxis.ANGULAR_Z;
      case MH.LINEAR_DISTANCE:
        return this._hknp.ConstraintAxis.LINEAR_DISTANCE;
    }
  }
  _nativeToLimitMode(e) {
    switch (e) {
      case this._hknp.ConstraintAxisLimitMode.FREE:
        return I2.FREE;
      case this._hknp.ConstraintAxisLimitMode.LIMITED:
        return I2.LIMITED;
      case this._hknp.ConstraintAxisLimitMode.LOCKED:
        return I2.LOCKED;
    }
    return I2.FREE;
  }
  _limitModeToNative(e) {
    switch (e) {
      case I2.FREE:
        return this._hknp.ConstraintAxisLimitMode.FREE;
      case I2.LIMITED:
        return this._hknp.ConstraintAxisLimitMode.LIMITED;
      case I2.LOCKED:
        return this._hknp.ConstraintAxisLimitMode.LOCKED;
    }
  }
  _nativeCollisionValueToCollisionType(e) {
    switch (e) {
      case this._hknp.EventType.COLLISION_STARTED.value:
        return q0.COLLISION_STARTED;
      case this._hknp.EventType.COLLISION_FINISHED.value:
        return q0.COLLISION_FINISHED;
      case this._hknp.EventType.COLLISION_CONTINUED.value:
        return q0.COLLISION_CONTINUED;
    }
    return q0.COLLISION_STARTED;
  }
  _nativeTriggerCollisionValueToCollisionType(e) {
    switch (e) {
      case 8:
        return q0.TRIGGER_ENTERED;
      case 16:
        return q0.TRIGGER_EXITED;
    }
    return q0.TRIGGER_ENTERED;
  }
}
sr.prototype.getPhysicsEngine = function() {
  return this._physicsEngine;
};
sr.prototype.enablePhysics = function(A = null, e) {
  if (this._physicsEngine)
    return !0;
  let t = this._getComponent(Ot.NAME_PHYSICSENGINE);
  t || (t = new A0e(this), this._addComponent(t));
  try {
    if (!e || (e == null ? void 0 : e.getPluginVersion()) === 1)
      this._physicsEngine = new $Q(A, e);
    else if ((e == null ? void 0 : e.getPluginVersion()) === 2)
      this._physicsEngine = new jy(A, e);
    else
      throw new Error("Unsupported Physics plugin version.");
    return this._physicsTimeAccumulator = 0, !0;
  } catch (r) {
    return Se.Error(r.message), !1;
  }
};
sr.prototype.disablePhysicsEngine = function() {
  this._physicsEngine && (this._physicsEngine.dispose(), this._physicsEngine = null);
};
sr.prototype.isPhysicsEnabled = function() {
  return this._physicsEngine !== void 0;
};
sr.prototype.deleteCompoundImpostor = function(A) {
  const e = A.parts[0].mesh;
  e.physicsImpostor && (e.physicsImpostor.dispose(
    /*true*/
  ), e.physicsImpostor = null);
};
sr.prototype._advancePhysicsEngineStep = function(A) {
  if (this._physicsEngine) {
    const e = this._physicsEngine.getSubTimeStep();
    if (e > 0)
      for (this._physicsTimeAccumulator += A; this._physicsTimeAccumulator > e; )
        this.onBeforePhysicsObservable.notifyObservers(this), this._physicsEngine._step(e / 1e3), this.onAfterPhysicsObservable.notifyObservers(this), this._physicsTimeAccumulator -= e;
    else
      this.onBeforePhysicsObservable.notifyObservers(this), this._physicsEngine._step(A / 1e3), this.onAfterPhysicsObservable.notifyObservers(this);
  }
};
class A0e {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_PHYSICSENGINE, this.scene = e, this.scene.onBeforePhysicsObservable = new Oe(), this.scene.onAfterPhysicsObservable = new Oe(), this.scene.getDeterministicFrameTime = () => this.scene._physicsEngine ? this.scene._physicsEngine.getTimeStep() * 1e3 : 1e3 / 60;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources
   */
  dispose() {
    this.scene.onBeforePhysicsObservable.clear(), this.scene.onAfterPhysicsObservable.clear(), this.scene._physicsEngine && this.scene.disablePhysicsEngine();
  }
}
Object.defineProperty(Hr.prototype, "physicsBody", {
  get: function() {
    return this._physicsBody;
  },
  set: function(A) {
    this._physicsBody !== A && (this._disposePhysicsObserver && this.onDisposeObservable.remove(this._disposePhysicsObserver), this._physicsBody = A, A && (this._disposePhysicsObserver = this.onDisposeObservable.add(() => {
      this.physicsBody && (this.physicsBody.dispose(
        /*!doNotRecurse*/
      ), this.physicsBody = null);
    })));
  },
  enumerable: !0,
  configurable: !0
});
Hr.prototype.getPhysicsBody = function() {
  return this.physicsBody;
};
Hr.prototype.applyImpulse = function(A, e) {
  if (!this.physicsBody)
    throw new Error("No Physics Body for TransformNode");
  return this.physicsBody.applyImpulse(A, e), this;
};
class sm {
  /*
   * Gets the hit contact point between a mesh and a ray. The method varies between
   * the different plugin versions; V1 uses a mesh intersection, V2 uses the physics body instance/object center (to avoid a raycast and improve perf).
   */
  static GetContactPointToRef(e, t, r, n, i) {
    const s = e.getScene().getPhysicsEngine(), a = s == null ? void 0 : s.getPluginVersion();
    if (a === 1) {
      const o = new Hi(t, r).intersectsMesh(e);
      if (o.hit && o.pickedPoint)
        return n.copyFrom(o.pickedPoint), !0;
    } else if (a === 2)
      return e.physicsBody.getObjectCenterWorldToRef(n, i), !0;
    return !1;
  }
  /**
   * Checks if a body will be affected by forces
   * @param body the body to check
   * @param instanceIndex for instanced bodies, the index of the instance to check
   * @returns
   */
  static HasAppliedForces(e, t) {
    var r, n, i;
    return e.getMotionType(t) === W0.STATIC || ((n = (r = e.getMassProperties(t)) === null || r === void 0 ? void 0 : r.mass) !== null && n !== void 0 ? n : 0) === 0 || ((i = e.transformNode) === null || i === void 0 ? void 0 : i.getTotalVertices()) === 0;
  }
  /**
   * Checks if a point is inside a cylinder
   * @param point point to check
   * @param origin cylinder origin on the bottom
   * @param radius cylinder radius
   * @param height cylinder height
   * @returns
   */
  static IsInsideCylinder(e, t, r, n) {
    const i = ue.Vector3[0];
    return e.subtractToRef(t, i), Math.abs(i.x) <= r && Math.abs(i.z) <= r && i.y >= 0 && i.y <= n;
  }
}
class d0e {
  /**
   * Initializes the Physics helper
   * @param scene Babylon.js scene
   */
  constructor(e) {
    if (this._hitData = { force: new S(), contactPoint: new S(), distanceFromOrigin: 0 }, this._scene = e, this._physicsEngine = this._scene.getPhysicsEngine(), !this._physicsEngine) {
      Se.Warn("Physics engine not enabled. Please enable the physics before you can use the methods.");
      return;
    }
  }
  /**
   * Applies a radial explosion impulse
   * @param origin the origin of the explosion
   * @param radiusOrEventOptions the radius or the options of radial explosion
   * @param strength the explosion strength
   * @param falloff possible options: Constant & Linear. Defaults to Constant
   * @returns A physics radial explosion event, or null
   */
  applyRadialExplosionImpulse(e, t, r, n) {
    if (!this._physicsEngine)
      return Se.Warn("Physics engine not enabled. Please enable the physics before you call this method."), null;
    if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0 || this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0)
      return null;
    let i = !1;
    if (typeof t == "number") {
      const f = t;
      t = new sS(), t.radius = f, t.strength = r ?? t.strength, t.falloff = n ?? t.falloff;
    } else
      i = !!(t.affectedImpostorsCallback || t.affectedBodiesCallback);
    const s = new _G(this._scene, t), a = this._hitData;
    if (this._physicsEngine.getPluginVersion() === 1) {
      const f = Array();
      this._physicsEngine.getImpostors().forEach((d) => {
        s.getImpostorHitData(d, e, a) && (d.applyImpulse(a.force, a.contactPoint), i && f.push({
          impostor: d,
          hitData: this._copyPhysicsHitData(a)
        }));
      }), s.triggerAffectedImpostorsCallback(f);
    } else
      this._applicationForBodies(s, e, a, i, (f, o) => {
        f.applyImpulse(o.force, o.contactPoint, o.instanceIndex);
      });
    return s.dispose(!1), s;
  }
  /**
   * Applies a radial explosion force
   * @param origin the origin of the explosion
   * @param radiusOrEventOptions the radius or the options of radial explosion
   * @param strength the explosion strength
   * @param falloff possible options: Constant & Linear. Defaults to Constant
   * @returns A physics radial explosion event, or null
   */
  applyRadialExplosionForce(e, t, r, n) {
    if (!this._physicsEngine)
      return Se.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;
    if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0 || this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0)
      return null;
    let i = !1;
    if (typeof t == "number") {
      const f = t;
      t = new sS(), t.radius = f, t.strength = r ?? t.strength, t.falloff = n ?? t.falloff;
    } else
      i = !!(t.affectedImpostorsCallback || t.affectedBodiesCallback);
    const s = new _G(this._scene, t), a = this._hitData;
    if (this._physicsEngine.getPluginVersion() === 1) {
      const f = Array();
      this._physicsEngine.getImpostors().forEach((d) => {
        s.getImpostorHitData(d, e, a) && (d.applyForce(a.force, a.contactPoint), i && f.push({
          impostor: d,
          hitData: this._copyPhysicsHitData(a)
        }));
      }), s.triggerAffectedImpostorsCallback(f);
    } else
      this._applicationForBodies(s, e, a, i, (f, o) => {
        f.applyForce(o.force, o.contactPoint, o.instanceIndex);
      });
    return s.dispose(!1), s;
  }
  _applicationForBodies(e, t, r, n, i) {
    const s = Array(), a = this._physicsEngine.getBodies();
    for (const f of a)
      f.iterateOverAllInstances((o, d) => {
        e.getBodyHitData(o, t, r, d) && (i(o, r), n && s.push({
          body: o,
          hitData: this._copyPhysicsHitData(r)
        }));
      });
    e.triggerAffectedBodiesCallback(s);
  }
  /**
   * Creates a gravitational field
   * @param origin the origin of the gravitational field
   * @param radiusOrEventOptions the radius or the options of radial gravitational field
   * @param strength the gravitational field strength
   * @param falloff possible options: Constant & Linear. Defaults to Constant
   * @returns A physics gravitational field event, or null
   */
  gravitationalField(e, t, r, n) {
    if (!this._physicsEngine)
      return Se.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;
    if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0 || this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0)
      return null;
    if (typeof t == "number") {
      const s = t;
      t = new sS(), t.radius = s, t.strength = r ?? t.strength, t.falloff = n ?? t.falloff;
    }
    const i = new v0e(this, this._scene, e, t);
    return i.dispose(!1), i;
  }
  /**
   * Creates a physics updraft event
   * @param origin the origin of the updraft
   * @param radiusOrEventOptions the radius or the options of the updraft
   * @param strength the strength of the updraft
   * @param height the height of the updraft
   * @param updraftMode possible options: Center & Perpendicular. Defaults to Center
   * @returns A physics updraft event, or null
   */
  updraft(e, t, r, n, i) {
    if (!this._physicsEngine)
      return Se.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;
    if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0 || this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0)
      return null;
    if (typeof t == "number") {
      const a = t;
      t = new YY(), t.radius = a, t.strength = r ?? t.strength, t.height = n ?? t.height, t.updraftMode = i ?? t.updraftMode;
    }
    const s = new my(this._scene, e, t);
    return s.dispose(!1), s;
  }
  /**
   * Creates a physics vortex event
   * @param origin the of the vortex
   * @param radiusOrEventOptions the radius or the options of the vortex
   * @param strength the strength of the vortex
   * @param height   the height of the vortex
   * @returns a Physics vortex event, or null
   * A physics vortex event or null
   */
  vortex(e, t, r, n) {
    if (!this._physicsEngine)
      return Se.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;
    if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0 || this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0)
      return null;
    if (typeof t == "number") {
      const s = t;
      t = new MY(), t.radius = s, t.strength = r ?? t.strength, t.height = n ?? t.height;
    }
    const i = new QS(this._scene, e, t);
    return i.dispose(!1), i;
  }
  _copyPhysicsHitData(e) {
    return { force: e.force.clone(), contactPoint: e.contactPoint.clone(), distanceFromOrigin: e.distanceFromOrigin, instanceIndex: e.instanceIndex };
  }
}
class _G {
  /**
   * Initializes a radial explosion event
   * @param _scene BabylonJS scene
   * @param _options The options for the vortex event
   */
  constructor(e, t) {
    this._scene = e, this._options = t, this._dataFetched = !1, this._options = Object.assign(Object.assign({}, new sS()), this._options);
  }
  /**
   * Returns the data related to the radial explosion event (sphere).
   * @returns The radial explosion event data
   */
  getData() {
    return this._dataFetched = !0, {
      sphere: this._sphere
    };
  }
  _getHitData(e, t, r, n) {
    const i = ue.Vector3[0];
    i.copyFrom(t).subtractInPlace(r);
    const s = ue.Vector3[1];
    if (!sm.GetContactPointToRef(e, r, i, s, n.instanceIndex))
      return !1;
    const f = S.Distance(r, s);
    if (f > this._options.radius)
      return !1;
    const o = this._options.falloff === iR.Constant ? this._options.strength : this._options.strength * (1 - f / this._options.radius);
    return i.scaleInPlace(o), n.force.copyFrom(i), n.contactPoint.copyFrom(s), n.distanceFromOrigin = f, !0;
  }
  /**
   * Returns the force and contact point of the body or false, if the body is not affected by the force/impulse.
   * @param body A physics body where the transform node is an AbstractMesh
   * @param origin the origin of the explosion
   * @param data the data of the hit
   * @param instanceIndex the instance index of the body
   * @returns if there was a hit
   */
  getBodyHitData(e, t, r, n) {
    if (sm.HasAppliedForces(e, n))
      return !1;
    const i = e.transformNode, s = e.getObjectCenterWorld(n);
    return r.instanceIndex = n, this._getHitData(i, s, t, r);
  }
  /**
   * Returns the force and contact point of the impostor or false, if the impostor is not affected by the force/impulse.
   * @param impostor A physics imposter
   * @param origin the origin of the explosion
   * @returns A physics force and contact point, or null
   */
  getImpostorHitData(e, t, r) {
    if (e.mass === 0 || e.object.getClassName() !== "Mesh" && e.object.getClassName() !== "InstancedMesh")
      return !1;
    const n = e.object;
    if (!this._intersectsWithSphere(n, t, this._options.radius))
      return !1;
    const i = e.getObjectCenter();
    return this._getHitData(n, i, t, r), !0;
  }
  /**
   * Triggers affected impostors callbacks
   * @param affectedImpostorsWithData defines the list of affected impostors (including associated data)
   */
  triggerAffectedImpostorsCallback(e) {
    this._options.affectedImpostorsCallback && this._options.affectedImpostorsCallback(e);
  }
  /**
   * Triggers affected bodies callbacks
   * @param affectedBodiesWithData defines the list of affected bodies (including associated data)
   */
  triggerAffectedBodiesCallback(e) {
    this._options.affectedBodiesCallback && this._options.affectedBodiesCallback(e);
  }
  /**
   * Disposes the sphere.
   * @param force Specifies if the sphere should be disposed by force
   */
  dispose(e = !0) {
    this._sphere && (e ? this._sphere.dispose() : setTimeout(() => {
      this._dataFetched || this._sphere.dispose();
    }, 0));
  }
  /*** Helpers ***/
  _prepareSphere() {
    this._sphere || (this._sphere = UA("radialExplosionEventSphere", this._options.sphere, this._scene), this._sphere.isVisible = !1);
  }
  _intersectsWithSphere(e, t, r) {
    return this._prepareSphere(), this._sphere.position = t, this._sphere.scaling.setAll(r * 2), this._sphere._updateBoundingInfo(), this._sphere.computeWorldMatrix(!0), this._sphere.intersectsMesh(e, !0);
  }
}
class v0e {
  /**
   * Initializes the physics gravitational field event
   * @param _physicsHelper A physics helper
   * @param _scene BabylonJS scene
   * @param _origin The origin position of the gravitational field event
   * @param _options The options for the vortex event
   */
  constructor(e, t, r, n) {
    this._physicsHelper = e, this._scene = t, this._origin = r, this._options = n, this._dataFetched = !1, this._options = Object.assign(Object.assign({}, new sS()), this._options), this._tickCallback = () => this._tick(), this._options.strength = this._options.strength * -1;
  }
  /**
   * Returns the data related to the gravitational field event (sphere).
   * @returns A gravitational field event
   */
  getData() {
    return this._dataFetched = !0, {
      sphere: this._sphere
    };
  }
  /**
   * Enables the gravitational field.
   */
  enable() {
    this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);
  }
  /**
   * Disables the gravitational field.
   */
  disable() {
    this._scene.unregisterBeforeRender(this._tickCallback);
  }
  /**
   * Disposes the sphere.
   * @param force The force to dispose from the gravitational field event
   */
  dispose(e = !0) {
    this._sphere && (e ? this._sphere.dispose() : setTimeout(() => {
      this._dataFetched || this._sphere.dispose();
    }, 0));
  }
  _tick() {
    var e;
    if (this._sphere)
      this._physicsHelper.applyRadialExplosionForce(this._origin, this._options);
    else {
      const t = this._physicsHelper.applyRadialExplosionForce(this._origin, this._options);
      t && (this._sphere = (e = t.getData().sphere) === null || e === void 0 ? void 0 : e.clone("radialExplosionEventSphereClone"));
    }
  }
}
class my {
  /**
   * Initializes the physics updraft event
   * @param _scene BabylonJS scene
   * @param _origin The origin position of the updraft
   * @param _options The options for the updraft event
   */
  constructor(e, t, r) {
    this._scene = e, this._origin = t, this._options = r, this._originTop = S.Zero(), this._originDirection = S.Zero(), this._cylinderPosition = S.Zero(), this._dataFetched = !1, this._physicsEngine = this._scene.getPhysicsEngine(), this._options = Object.assign(Object.assign({}, new YY()), this._options), this._origin.addToRef(new S(0, this._options.height / 2, 0), this._cylinderPosition), this._origin.addToRef(new S(0, this._options.height, 0), this._originTop), this._options.updraftMode === YS.Perpendicular && (this._originDirection = this._origin.subtract(this._originTop).normalize()), this._tickCallback = () => this._tick(), this._physicsEngine.getPluginVersion() === 1 && this._prepareCylinder();
  }
  /**
   * Returns the data related to the updraft event (cylinder).
   * @returns A physics updraft event
   */
  getData() {
    return this._dataFetched = !0, {
      cylinder: this._cylinder
    };
  }
  /**
   * Enables the updraft.
   */
  enable() {
    this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);
  }
  /**
   * Disables the updraft.
   */
  disable() {
    this._scene.unregisterBeforeRender(this._tickCallback);
  }
  /**
   * Disposes the cylinder.
   * @param force Specifies if the updraft should be disposed by force
   */
  dispose(e = !0) {
    this._cylinder && (e ? (this._cylinder.dispose(), this._cylinder = void 0) : setTimeout(() => {
      !this._dataFetched && this._cylinder && (this._cylinder.dispose(), this._cylinder = void 0);
    }, 0));
  }
  _getHitData(e, t) {
    let r;
    this._options.updraftMode === YS.Perpendicular ? r = this._originDirection : r = e.subtract(this._originTop);
    const n = S.Distance(this._origin, e), i = this._options.strength * -1, s = r.multiplyByFloats(i, i, i);
    t.force.copyFrom(s), t.contactPoint.copyFrom(e), t.distanceFromOrigin = n;
  }
  _getBodyHitData(e, t, r) {
    if (sm.HasAppliedForces(e))
      return !1;
    const n = e.getObjectCenterWorld(r);
    return sm.IsInsideCylinder(n, this._origin, this._options.radius, this._options.height) ? (t.instanceIndex = r, this._getHitData(n, t), !0) : !1;
  }
  _getImpostorHitData(e, t) {
    if (e.mass === 0)
      return !1;
    const r = e.object;
    if (!this._intersectsWithCylinder(r))
      return !1;
    const n = e.getObjectCenter();
    return this._getHitData(n, t), !0;
  }
  _tick() {
    const e = my._HitData;
    this._physicsEngine.getPluginVersion() === 1 ? this._physicsEngine.getImpostors().forEach((t) => {
      this._getImpostorHitData(t, e) && t.applyForce(e.force, e.contactPoint);
    }) : this._physicsEngine.getBodies().forEach((t) => {
      t.iterateOverAllInstances((r, n) => {
        this._getBodyHitData(r, e, n) && r.applyForce(e.force, e.contactPoint, e.instanceIndex);
      });
    });
  }
  /*** Helpers ***/
  _prepareCylinder() {
    this._cylinder || (this._cylinder = Ld("updraftEventCylinder", {
      height: this._options.height,
      diameter: this._options.radius * 2
    }, this._scene), this._cylinder.isVisible = !1);
  }
  _intersectsWithCylinder(e) {
    return this._cylinder ? (this._cylinder.position = this._cylinderPosition, this._cylinder.intersectsMesh(e, !0)) : !1;
  }
}
my._HitData = { force: new S(), contactPoint: new S(), distanceFromOrigin: 0 };
class QS {
  /**
   * Initializes the physics vortex event
   * @param _scene The BabylonJS scene
   * @param _origin The origin position of the vortex
   * @param _options The options for the vortex event
   */
  constructor(e, t, r) {
    this._scene = e, this._origin = t, this._options = r, this._originTop = S.Zero(), this._cylinderPosition = S.Zero(), this._dataFetched = !1, this._physicsEngine = this._scene.getPhysicsEngine(), this._options = Object.assign(Object.assign({}, new MY()), this._options), this._origin.addToRef(new S(0, this._options.height / 2, 0), this._cylinderPosition), this._origin.addToRef(new S(0, this._options.height, 0), this._originTop), this._tickCallback = () => this._tick(), this._physicsEngine.getPluginVersion() === 1 && this._prepareCylinder();
  }
  /**
   * Returns the data related to the vortex event (cylinder).
   * @returns The physics vortex event data
   */
  getData() {
    return this._dataFetched = !0, {
      cylinder: this._cylinder
    };
  }
  /**
   * Enables the vortex.
   */
  enable() {
    this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);
  }
  /**
   * Disables the cortex.
   */
  disable() {
    this._scene.unregisterBeforeRender(this._tickCallback);
  }
  /**
   * Disposes the sphere.
   * @param force
   */
  dispose(e = !0) {
    this._cylinder && (e ? this._cylinder.dispose() : setTimeout(() => {
      this._dataFetched || this._cylinder.dispose();
    }, 0));
  }
  _getHitData(e, t, r) {
    const n = QS.originOnPlane;
    n.set(this._origin.x, t.y, this._origin.z);
    const i = ue.Vector3[0];
    t.subtractToRef(n, i);
    const s = ue.Vector3[1];
    if (!sm.GetContactPointToRef(e, n, i, s, r.instanceIndex))
      return !1;
    const o = S.Distance(s, n) / this._options.radius, d = ue.Vector3[2];
    s.normalizeToRef(d), o > this._options.centripetalForceThreshold && d.negateInPlace();
    let v, u, l;
    if (o > this._options.centripetalForceThreshold)
      v = d.x * this._options.centripetalForceMultiplier, u = d.y * this._options.updraftForceMultiplier, l = d.z * this._options.centripetalForceMultiplier;
    else {
      const p = S.Cross(n, t).normalize();
      v = (p.x + d.x) * this._options.centrifugalForceMultiplier, u = this._originTop.y * this._options.updraftForceMultiplier, l = (p.z + d.z) * this._options.centrifugalForceMultiplier;
    }
    const P = ue.Vector3[3];
    return P.set(v, u, l), P.scaleInPlace(this._options.strength), r.force.copyFrom(P), r.contactPoint.copyFrom(t), r.distanceFromOrigin = o, !0;
  }
  _getBodyHitData(e, t, r) {
    if (sm.HasAppliedForces(e, r))
      return !1;
    const n = e.transformNode, i = e.getObjectCenterWorld(r);
    return sm.IsInsideCylinder(i, this._origin, this._options.radius, this._options.height) ? (t.instanceIndex = r, this._getHitData(n, i, t)) : !1;
  }
  _getImpostorHitData(e, t) {
    if (e.mass === 0 || e.object.getClassName() !== "Mesh" && e.object.getClassName() !== "InstancedMesh")
      return !1;
    const r = e.object;
    if (!this._intersectsWithCylinder(r))
      return !1;
    const n = e.getObjectCenter();
    return this._getHitData(r, n, t), !0;
  }
  _tick() {
    const e = QS.hitData;
    this._physicsEngine.getPluginVersion() === 1 ? this._physicsEngine.getImpostors().forEach((t) => {
      this._getImpostorHitData(t, e) && t.applyForce(e.force, e.contactPoint);
    }) : this._physicsEngine.getBodies().forEach((t) => {
      t.iterateOverAllInstances((r, n) => {
        this._getBodyHitData(r, e, n) && r.applyForce(e.force, e.contactPoint, e.instanceIndex);
      });
    });
  }
  /*** Helpers ***/
  _prepareCylinder() {
    this._cylinder || (this._cylinder = Ld("vortexEventCylinder", {
      height: this._options.height,
      diameter: this._options.radius * 2
    }, this._scene), this._cylinder.isVisible = !1);
  }
  _intersectsWithCylinder(e) {
    return this._cylinder.position = this._cylinderPosition, this._cylinder.intersectsMesh(e, !0);
  }
}
QS.originOnPlane = S.Zero();
QS.hitData = { force: new S(), contactPoint: new S(), distanceFromOrigin: 0 };
class sS {
  constructor() {
    this.radius = 5, this.strength = 10, this.falloff = iR.Constant, this.sphere = { segments: 32, diameter: 1 };
  }
}
class YY {
  constructor() {
    this.radius = 5, this.strength = 10, this.height = 10, this.updraftMode = YS.Center;
  }
}
class MY {
  constructor() {
    this.radius = 5, this.strength = 10, this.height = 10, this.centripetalForceThreshold = 0.7, this.centripetalForceMultiplier = 5, this.centrifugalForceMultiplier = 0.5, this.updraftForceMultiplier = 0.02;
  }
}
var iR;
(function(A) {
  A[A.Constant = 0] = "Constant", A[A.Linear = 1] = "Linear";
})(iR || (iR = {}));
var YS;
(function(A) {
  A[A.Center = 0] = "Center", A[A.Perpendicular = 1] = "Perpendicular";
})(YS || (YS = {}));
const u0e = "blackAndWhitePixelShader", l0e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float degree;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{vec3 color=texture2D(textureSampler,vUV).rgb;float luminance=dot(color,vec3(0.3,0.59,0.11)); 
vec3 blackAndWhite=vec3(luminance,luminance,luminance);gl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);}`;
Le.ShadersStore[u0e] = l0e;
class AV extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "BlackAndWhitePostProcess" string
   */
  getClassName() {
    return "BlackAndWhitePostProcess";
  }
  /**
   * Creates a black and white post process
   * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#black-and-white
   * @param name The name of the effect.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   */
  constructor(e, t, r, n, i, s) {
    super(e, "blackAndWhite", ["degree"], null, t, r, n, i, s), this.degree = 1, this.onApplyObservable.add((a) => {
      a.setFloat("degree", this.degree);
    });
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new AV(e.name, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable), e, r, n);
  }
}
C([
  M()
], AV.prototype, "degree", void 0);
Ue("BABYLON.BlackAndWhitePostProcess", AV);
class gs {
  /**
   * Instantiates a post process render effect.
   * A post process can be used to apply a shader to a texture after it is rendered.
   * @param engine The engine the effect is tied to
   * @param name The name of the effect
   * @param getPostProcesses A function that returns a set of post processes which the effect will run in order to be run.
   * @param singleInstance False if this post process can be run on multiple cameras. (default: true)
   */
  constructor(e, t, r, n) {
    this._name = t, this._singleInstance = n || !0, this._getPostProcesses = r, this._cameras = {}, this._indicesForCamera = {}, this._postProcesses = {};
  }
  /**
   * Checks if all the post processes in the effect are supported.
   */
  get isSupported() {
    for (const e in this._postProcesses)
      if (Object.prototype.hasOwnProperty.call(this._postProcesses, e)) {
        const t = this._postProcesses[e];
        for (let r = 0; r < t.length; r++)
          if (!t[r].isSupported)
            return !1;
      }
    return !0;
  }
  /**
   * Updates the current state of the effect
   * @internal
   */
  _update() {
  }
  /**
   * Attaches the effect on cameras
   * @param cameras The camera to attach to.
   * @internal
   */
  _attachCameras(e) {
    let t;
    const r = ye.MakeArray(e || this._cameras);
    if (r)
      for (let n = 0; n < r.length; n++) {
        const i = r[n];
        if (!i)
          continue;
        const s = i.name;
        if (this._singleInstance ? t = 0 : t = s, !this._postProcesses[t]) {
          const a = this._getPostProcesses();
          a && (this._postProcesses[t] = Array.isArray(a) ? a : [a]);
        }
        this._indicesForCamera[s] || (this._indicesForCamera[s] = []), this._postProcesses[t].forEach((a) => {
          const f = i.attachPostProcess(a);
          this._indicesForCamera[s].push(f);
        }), this._cameras[s] || (this._cameras[s] = i);
      }
  }
  /**
   * Detaches the effect on cameras
   * @param cameras The camera to detach from.
   * @internal
   */
  _detachCameras(e) {
    const t = ye.MakeArray(e || this._cameras);
    if (t)
      for (let r = 0; r < t.length; r++) {
        const n = t[r], i = n.name, s = this._postProcesses[this._singleInstance ? 0 : i];
        s && s.forEach((a) => {
          n.detachPostProcess(a);
        }), this._cameras[i] && (this._cameras[i] = null), delete this._indicesForCamera[i];
      }
  }
  /**
   * Enables the effect on given cameras
   * @param cameras The camera to enable.
   * @internal
   */
  _enable(e) {
    const t = ye.MakeArray(e || this._cameras);
    if (t)
      for (let r = 0; r < t.length; r++) {
        const n = t[r], i = n.name, s = this._singleInstance ? 0 : i;
        for (let a = 0; a < this._indicesForCamera[i].length; a++) {
          const f = this._indicesForCamera[i][a], o = n._postProcesses[f];
          o == null && t[r].attachPostProcess(this._postProcesses[s][a], f);
        }
      }
  }
  /**
   * Disables the effect on the given cameras
   * @param cameras The camera to disable.
   * @internal
   */
  _disable(e) {
    const t = ye.MakeArray(e || this._cameras);
    if (t)
      for (let r = 0; r < t.length; r++) {
        const n = t[r], i = n.name;
        this._postProcesses[this._singleInstance ? 0 : i].forEach((s) => {
          n.detachPostProcess(s);
        });
      }
  }
  /**
   * Gets a list of the post processes contained in the effect.
   * @param camera The camera to get the post processes on.
   * @returns The list of the post processes in the effect.
   */
  getPostProcesses(e) {
    return this._singleInstance ? this._postProcesses[0] : e ? this._postProcesses[e.name] : null;
  }
}
const P0e = "extractHighlightsPixelShader", c0e = `#include<helperFunctions>
varying vec2 vUV;uniform sampler2D textureSampler;uniform float threshold;uniform float exposure;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{gl_FragColor=texture2D(textureSampler,vUV);float luma=dot(LuminanceEncodeApprox,gl_FragColor.rgb*exposure);gl_FragColor.rgb=step(threshold,luma)*gl_FragColor.rgb;}`;
Le.ShadersStore[P0e] = c0e;
class By extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "ExtractHighlightsPostProcess" string
   */
  getClassName() {
    return "ExtractHighlightsPostProcess";
  }
  constructor(e, t, r, n, i, s, a = 0, f = !1) {
    super(e, "extractHighlights", ["threshold", "exposure"], null, t, r, n, i, s, null, a, void 0, null, f), this.threshold = 0.9, this._exposure = 1, this._inputPostProcess = null, this.onApplyObservable.add((o) => {
      this.externalTextureSamplerBinding = !!this._inputPostProcess, this._inputPostProcess && o.setTextureFromPostProcess("textureSampler", this._inputPostProcess), o.setFloat("threshold", Math.pow(this.threshold, JW)), o.setFloat("exposure", this._exposure);
    });
  }
}
C([
  M()
], By.prototype, "threshold", void 0);
Ue("BABYLON.ExtractHighlightsPostProcess", By);
const p0e = "bloomMergePixelShader", h0e = `uniform sampler2D textureSampler;uniform sampler2D bloomBlur;varying vec2 vUV;uniform float bloomWeight;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{gl_FragColor=texture2D(textureSampler,vUV);vec3 blurred=texture2D(bloomBlur,vUV).rgb;gl_FragColor.rgb=gl_FragColor.rgb+(blurred.rgb*bloomWeight); }
`;
Le.ShadersStore[p0e] = h0e;
class Wy extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "BloomMergePostProcess" string
   */
  getClassName() {
    return "BloomMergePostProcess";
  }
  /**
   * Creates a new instance of @see BloomMergePostProcess
   * @param name The name of the effect.
   * @param originalFromInput Post process which's input will be used for the merge.
   * @param blurred Blurred highlights post process which's output will be used.
   * @param weight Weight of the bloom to be added to the original input.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r, n, i, s, a, f, o, d = 0, v = !1) {
    super(e, "bloomMerge", ["bloomWeight"], ["bloomBlur"], i, s, a, f, o, null, d, void 0, null, !0), this.weight = 1, this.weight = n, this.externalTextureSamplerBinding = !0, this.onApplyObservable.add((u) => {
      u.setTextureFromPostProcess("textureSampler", t), u.setTextureFromPostProcessOutput("bloomBlur", r), u.setFloat("bloomWeight", this.weight);
    }), v || this.updateEffect();
  }
}
C([
  M()
], Wy.prototype, "weight", void 0);
Ue("BABYLON.BloomMergePostProcess", Wy);
class DF extends gs {
  /**
   * The luminance threshold to find bright areas of the image to bloom.
   */
  get threshold() {
    return this._downscale.threshold;
  }
  set threshold(e) {
    this._downscale.threshold = e;
  }
  /**
   * The strength of the bloom.
   */
  get weight() {
    return this._merge.weight;
  }
  set weight(e) {
    this._merge.weight = e;
  }
  /**
   * Specifies the size of the bloom blur kernel, relative to the final output size
   */
  get kernel() {
    return this._blurX.kernel / this._bloomScale;
  }
  set kernel(e) {
    this._blurX.kernel = e * this._bloomScale, this._blurY.kernel = e * this._bloomScale;
  }
  /**
   * Creates a new instance of @see BloomEffect
   * @param scene The scene the effect belongs to.
   * @param _bloomScale The ratio of the blur texture to the input texture that should be used to compute the bloom.
   * @param bloomWeight The strength of bloom.
   * @param bloomKernel The size of the kernel to be used when applying the blur.
   * @param pipelineTextureType The type of texture to be used when performing the post processing.
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r, n, i = 0, s = !1) {
    super(e.getEngine(), "bloom", () => this._effects, !0), this._bloomScale = t, this._effects = [], this._downscale = new By("highlights", 1, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, i, s), this._blurX = new c9("horizontal blur", new at(1, 0), 10, t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, i, void 0, s), this._blurX.alwaysForcePOT = !0, this._blurX.autoClear = !1, this._blurY = new c9("vertical blur", new at(0, 1), 10, t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, i, void 0, s), this._blurY.alwaysForcePOT = !0, this._blurY.autoClear = !1, this.kernel = n, this._effects = [this._downscale, this._blurX, this._blurY], this._merge = new Wy("bloomMerge", this._downscale, this._blurY, r, t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, i, s), this._merge.autoClear = !1, this._effects.push(this._merge);
  }
  /**
   * Disposes each of the internal effects for a given camera.
   * @param camera The camera to dispose the effect on.
   */
  disposeEffects(e) {
    for (let t = 0; t < this._effects.length; t++)
      this._effects[t].dispose(e);
  }
  /**
   * @internal Internal
   */
  _updateEffects() {
    for (let e = 0; e < this._effects.length; e++)
      this._effects[e].updateEffect();
  }
  /**
   * Internal
   * @returns if all the contained post processes are ready.
   * @internal
   */
  _isReady() {
    for (let e = 0; e < this._effects.length; e++)
      if (!this._effects[e].isReady())
        return !1;
    return !0;
  }
}
const H0e = "chromaticAberrationPixelShader", g0e = `uniform sampler2D textureSampler; 
uniform float chromatic_aberration;uniform float radialIntensity;uniform vec2 direction;uniform vec2 centerPosition;uniform float screen_width;uniform float screen_height;varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec2 centered_screen_pos=vec2(vUV.x-centerPosition.x,vUV.y-centerPosition.y);vec2 directionOfEffect=direction;if(directionOfEffect.x==0. && directionOfEffect.y==0.){directionOfEffect=normalize(centered_screen_pos);}
float radius2=centered_screen_pos.x*centered_screen_pos.x
+ centered_screen_pos.y*centered_screen_pos.y;float radius=sqrt(radius2);vec4 original=texture2D(textureSampler,vUV);vec3 ref_indices=vec3(-0.3,0.0,0.3);float ref_shiftX=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.x/screen_width;float ref_shiftY=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.y/screen_height;vec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);vec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);vec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);original.r=texture2D(textureSampler,ref_coords_r).r;original.g=texture2D(textureSampler,ref_coords_g).g;original.b=texture2D(textureSampler,ref_coords_b).b;original.a=clamp(texture2D(textureSampler,ref_coords_r).a+texture2D(textureSampler,ref_coords_g).a+texture2D(textureSampler,ref_coords_b).a,0.,1.);gl_FragColor=original;}`;
Le.ShadersStore[H0e] = g0e;
class Pg extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "ChromaticAberrationPostProcess" string
   */
  getClassName() {
    return "ChromaticAberrationPostProcess";
  }
  /**
   * Creates a new instance ChromaticAberrationPostProcess
   * @param name The name of the effect.
   * @param screenWidth The width of the screen to apply the effect on.
   * @param screenHeight The height of the screen to apply the effect on.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r, n, i, s, a, f, o = 0, d = !1) {
    super(e, "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], n, i, s, a, f, null, o, void 0, null, d), this.aberrationAmount = 30, this.radialIntensity = 0, this.direction = new at(0.707, 0.707), this.centerPosition = new at(0.5, 0.5), this.screenWidth = t, this.screenHeight = r, this.onApplyObservable.add((v) => {
      v.setFloat("chromatic_aberration", this.aberrationAmount), v.setFloat("screen_width", t), v.setFloat("screen_height", r), v.setFloat("radialIntensity", this.radialIntensity), v.setFloat2("direction", this.direction.x, this.direction.y), v.setFloat2("centerPosition", this.centerPosition.x, this.centerPosition.y);
    });
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new Pg(e.name, e.screenWidth, e.screenHeight, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable, e.textureType, !1), e, r, n);
  }
}
C([
  M()
], Pg.prototype, "aberrationAmount", void 0);
C([
  M()
], Pg.prototype, "radialIntensity", void 0);
C([
  M()
], Pg.prototype, "direction", void 0);
C([
  M()
], Pg.prototype, "centerPosition", void 0);
C([
  M()
], Pg.prototype, "screenWidth", void 0);
C([
  M()
], Pg.prototype, "screenHeight", void 0);
Ue("BABYLON.ChromaticAberrationPostProcess", Pg);
const X0e = "circleOfConfusionPixelShader", T0e = `uniform sampler2D depthSampler;varying vec2 vUV;uniform vec2 cameraMinMaxZ;uniform float focusDistance;uniform float cocPrecalculation;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{float depth=texture2D(depthSampler,vUV).r;
#define CUSTOM_COC_DEPTH
float pixelDistance=(cameraMinMaxZ.x+cameraMinMaxZ.y*depth)*1000.0; 
#define CUSTOM_COC_PIXELDISTANCE
float coc=abs(cocPrecalculation*((focusDistance-pixelDistance)/pixelDistance));coc=clamp(coc,0.0,1.0);gl_FragColor=vec4(coc,coc,coc,1.0);}
`;
Le.ShadersStore[X0e] = T0e;
class Om extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "CircleOfConfusionPostProcess" string
   */
  getClassName() {
    return "CircleOfConfusionPostProcess";
  }
  /**
   * Creates a new instance CircleOfConfusionPostProcess
   * @param name The name of the effect.
   * @param depthTexture The depth texture of the scene to compute the circle of confusion. This must be set in order for this to function but may be set after initialization if needed.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r, n, i, s, a, f = 0, o = !1) {
    super(e, "circleOfConfusion", ["cameraMinMaxZ", "focusDistance", "cocPrecalculation"], ["depthSampler"], r, n, i, s, a, null, f, void 0, null, o), this.lensSize = 50, this.fStop = 1.4, this.focusDistance = 2e3, this.focalLength = 50, this._depthTexture = null, this._depthTexture = t, this.onApplyObservable.add((d) => {
      if (!this._depthTexture) {
        Se.Warn("No depth texture set on CircleOfConfusionPostProcess");
        return;
      }
      d.setTexture("depthSampler", this._depthTexture);
      const u = this.lensSize / this.fStop * this.focalLength / (this.focusDistance - this.focalLength);
      d.setFloat("focusDistance", this.focusDistance), d.setFloat("cocPrecalculation", u);
      const l = this._depthTexture.activeCamera;
      d.setFloat2("cameraMinMaxZ", l.minZ, l.maxZ - l.minZ);
    });
  }
  /**
   * Depth texture to be used to compute the circle of confusion. This must be set here or in the constructor in order for the post process to function.
   */
  set depthTexture(e) {
    this._depthTexture = e;
  }
}
C([
  M()
], Om.prototype, "lensSize", void 0);
C([
  M()
], Om.prototype, "fStop", void 0);
C([
  M()
], Om.prototype, "focusDistance", void 0);
C([
  M()
], Om.prototype, "focalLength", void 0);
Ue("BABYLON.CircleOfConfusionPostProcess", Om);
const q0e = "colorCorrectionPixelShader", b0e = `uniform sampler2D textureSampler; 
uniform sampler2D colorTable; 
varying vec2 vUV;const float SLICE_COUNT=16.0; 
vec4 sampleAs3DTexture(sampler2D textureSampler,vec3 uv,float width) {float sliceSize=1.0/width; 
float slicePixelSize=sliceSize/width; 
float sliceInnerSize=slicePixelSize*(width-1.0); 
float zSlice0=min(floor(uv.z*width),width-1.0);float zSlice1=min(zSlice0+1.0,width-1.0);float xOffset=slicePixelSize*0.5+uv.x*sliceInnerSize;float s0=xOffset+(zSlice0*sliceSize);float s1=xOffset+(zSlice1*sliceSize);vec4 slice0Color=texture2D(textureSampler,vec2(s0,uv.y));vec4 slice1Color=texture2D(textureSampler,vec2(s1,uv.y));float zOffset=mod(uv.z*width,1.0);vec4 result=mix(slice0Color,slice1Color,zOffset);return result;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec4 screen_color=texture2D(textureSampler,vUV);gl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);}`;
Le.ShadersStore[q0e] = b0e;
class dV extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "ColorCorrectionPostProcess" string
   */
  getClassName() {
    return "ColorCorrectionPostProcess";
  }
  constructor(e, t, r, n, i, s, a) {
    super(e, "colorCorrection", null, ["colorTable"], r, n, i, s, a);
    const f = (n == null ? void 0 : n.getScene()) || null;
    this._colorTableTexture = new We(t, f, !0, !1, We.TRILINEAR_SAMPLINGMODE), this._colorTableTexture.anisotropicFilteringLevel = 1, this._colorTableTexture.wrapU = We.CLAMP_ADDRESSMODE, this._colorTableTexture.wrapV = We.CLAMP_ADDRESSMODE, this.colorTableUrl = t, this.onApply = (o) => {
      o.setTexture("colorTable", this._colorTableTexture);
    };
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new dV(e.name, e.colorTableUrl, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable), e, r, n);
  }
}
C([
  M()
], dV.prototype, "colorTableUrl", void 0);
Ue("BABYLON.ColorCorrectionPostProcess", dV);
const x0e = "convolutionPixelShader", D0e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform float kernel[9];
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec2 onePixel=vec2(1.0,1.0)/screenSize;vec4 colorSum =
texture2D(textureSampler,vUV+onePixel*vec2(-1,-1))*kernel[0] +
texture2D(textureSampler,vUV+onePixel*vec2(0,-1))*kernel[1] +
texture2D(textureSampler,vUV+onePixel*vec2(1,-1))*kernel[2] +
texture2D(textureSampler,vUV+onePixel*vec2(-1,0))*kernel[3] +
texture2D(textureSampler,vUV+onePixel*vec2(0,0))*kernel[4] +
texture2D(textureSampler,vUV+onePixel*vec2(1,0))*kernel[5] +
texture2D(textureSampler,vUV+onePixel*vec2(-1,1))*kernel[6] +
texture2D(textureSampler,vUV+onePixel*vec2(0,1))*kernel[7] +
texture2D(textureSampler,vUV+onePixel*vec2(1,1))*kernel[8];float kernelWeight =
kernel[0] +
kernel[1] +
kernel[2] +
kernel[3] +
kernel[4] +
kernel[5] +
kernel[6] +
kernel[7] +
kernel[8];if (kernelWeight<=0.0) {kernelWeight=1.0;}
gl_FragColor=vec4((colorSum/kernelWeight).rgb,1);}`;
Le.ShadersStore[x0e] = D0e;
class cg extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "ConvolutionPostProcess" string
   */
  getClassName() {
    return "ConvolutionPostProcess";
  }
  /**
   * Creates a new instance ConvolutionPostProcess
   * @param name The name of the effect.
   * @param kernel Array of 9 values corresponding to the 3x3 kernel to be applied
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   */
  constructor(e, t, r, n, i, s, a, f = 0) {
    super(e, "convolution", ["kernel", "screenSize"], null, r, n, i, s, a, null, f), this.kernel = t, this.onApply = (o) => {
      o.setFloat2("screenSize", this.width, this.height), o.setArray("kernel", this.kernel);
    };
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new cg(e.name, e.kernel, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable, e.textureType), e, r, n);
  }
}
cg.EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1];
cg.EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0];
cg.EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1];
cg.SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0];
cg.EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2];
cg.GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0];
C([
  M()
], cg.prototype, "kernel", void 0);
Ue("BABYLON.ConvolutionPostProcess", cg);
class sR extends c9 {
  /**
   * Gets a string identifying the name of the class
   * @returns "DepthOfFieldBlurPostProcess" string
   */
  getClassName() {
    return "DepthOfFieldBlurPostProcess";
  }
  /**
   * Creates a new instance DepthOfFieldBlurPostProcess
   * @param name The name of the effect.
   * @param scene The scene the effect belongs to.
   * @param direction The direction the blur should be applied.
   * @param kernel The size of the kernel used to blur.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param circleOfConfusion The circle of confusion + depth map to be used to avoid blurring across edges
   * @param imageToBlur The image to apply the blur to (default: Current rendered frame)
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)
   */
  constructor(e, t, r, n, i, s, a, f = null, o = We.BILINEAR_SAMPLINGMODE, d, v, u = 0, l = !1, P = 5) {
    super(
      e,
      r,
      n,
      i,
      s,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      o = 2,
      d,
      v,
      u,
      `#define DOF 1
`,
      l,
      P
    ), this.direction = r, this.externalTextureSamplerBinding = !!f, this.onApplyObservable.add((p) => {
      f != null && p.setTextureFromPostProcess("textureSampler", f), p.setTextureFromPostProcessOutput("circleOfConfusionSampler", a);
    });
  }
}
C([
  M()
], sR.prototype, "direction", void 0);
Ue("BABYLON.DepthOfFieldBlurPostProcess", sR);
const j0e = "depthOfFieldMergePixelShader", w0e = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)
#else
#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)
#endif
uniform sampler2D textureSampler;varying vec2 vUV;uniform sampler2D circleOfConfusionSampler;uniform sampler2D blurStep0;
#if BLUR_LEVEL>0
uniform sampler2D blurStep1;
#endif
#if BLUR_LEVEL>1
uniform sampler2D blurStep2;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{float coc=TEXTUREFUNC(circleOfConfusionSampler,vUV,0.0).r;
#if BLUR_LEVEL==0
vec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);vec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);gl_FragColor=mix(original,blurred0,coc);
#endif
#if BLUR_LEVEL==1
if(coc<0.5){vec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);gl_FragColor=mix(original,blurred1,coc/0.5);}else{vec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);gl_FragColor=mix(blurred1,blurred0,(coc-0.5)/0.5);}
#endif
#if BLUR_LEVEL==2
if(coc<0.33){vec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);vec4 blurred2=TEXTUREFUNC(blurStep2,vUV,0.0);gl_FragColor=mix(original,blurred2,coc/0.33);}else if(coc<0.66){vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);vec4 blurred2=TEXTUREFUNC(blurStep2,vUV,0.0);gl_FragColor=mix(blurred2,blurred1,(coc-0.33)/0.33);}else{vec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);gl_FragColor=mix(blurred1,blurred0,(coc-0.66)/0.34);}
#endif
}
`;
Le.ShadersStore[j0e] = w0e;
class eie extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "DepthOfFieldMergePostProcess" string
   */
  getClassName() {
    return "DepthOfFieldMergePostProcess";
  }
  /**
   * Creates a new instance of DepthOfFieldMergePostProcess
   * @param name The name of the effect.
   * @param originalFromInput Post process which's input will be used for the merge.
   * @param circleOfConfusion Circle of confusion post process which's output will be used to blur each pixel.
   * @param _blurSteps Blur post processes from low to high which will be mixed with the original image.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r, n, i, s, a, f, o, d = 0, v = !1) {
    super(e, "depthOfFieldMerge", [], ["circleOfConfusionSampler", "blurStep0", "blurStep1", "blurStep2"], i, s, a, f, o, null, d, void 0, null, !0), this._blurSteps = n, this.externalTextureSamplerBinding = !0, this.onApplyObservable.add((u) => {
      u.setTextureFromPostProcess("textureSampler", t), u.setTextureFromPostProcessOutput("circleOfConfusionSampler", r), n.forEach((l, P) => {
        u.setTextureFromPostProcessOutput("blurStep" + (n.length - P - 1), l);
      });
    }), v || this.updateEffect();
  }
  /**
   * Updates the effect with the current post process compile time values and recompiles the shader.
   * @param defines Define statements that should be added at the beginning of the shader. (default: null)
   * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)
   * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)
   * @param indexParameters The index parameters to be used for babylons include syntax "#include<kernelBlurVaryingDeclaration>[0..varyingCount]". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx
   * @param onCompiled Called when the shader has been compiled.
   * @param onError Called if there is an error when compiling a shader.
   */
  updateEffect(e = null, t = null, r = null, n, i, s) {
    e || (e = "", e += "#define BLUR_LEVEL " + (this._blurSteps.length - 1) + `
`), super.updateEffect(e, t, r, n, i, s);
  }
}
var am;
(function(A) {
  A[A.Low = 0] = "Low", A[A.Medium = 1] = "Medium", A[A.High = 2] = "High";
})(am || (am = {}));
class jF extends gs {
  /**
   * The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter)
   */
  set focalLength(e) {
    this._circleOfConfusion.focalLength = e;
  }
  get focalLength() {
    return this._circleOfConfusion.focalLength;
  }
  /**
   * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)
   */
  set fStop(e) {
    this._circleOfConfusion.fStop = e;
  }
  get fStop() {
    return this._circleOfConfusion.fStop;
  }
  /**
   * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)
   */
  set focusDistance(e) {
    this._circleOfConfusion.focusDistance = e;
  }
  get focusDistance() {
    return this._circleOfConfusion.focusDistance;
  }
  /**
   * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.
   */
  set lensSize(e) {
    this._circleOfConfusion.lensSize = e;
  }
  get lensSize() {
    return this._circleOfConfusion.lensSize;
  }
  /**
   * Creates a new instance DepthOfFieldEffect
   * @param scene The scene the effect belongs to.
   * @param depthTexture The depth texture of the scene to compute the circle of confusion.This must be set in order for this to function but may be set after initialization if needed.
   * @param blurLevel
   * @param pipelineTextureType The type of texture to be used when performing the post processing.
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r = am.Low, n = 0, i = !1) {
    super(e.getEngine(), "depth of field", () => this._effects, !0), this._effects = [];
    const s = e.getEngine(), a = s.isWebGPU || s.webGLVersion > 1 ? 6 : 5;
    this._circleOfConfusion = new Om("circleOfConfusion", t, 1, null, We.BILINEAR_SAMPLINGMODE, s, !1, n, i), this._depthOfFieldBlurY = [], this._depthOfFieldBlurX = [];
    let f = 1, o = 15;
    switch (r) {
      case am.High: {
        f = 3, o = 51;
        break;
      }
      case am.Medium: {
        f = 2, o = 31;
        break;
      }
      default: {
        o = 15, f = 1;
        break;
      }
    }
    const d = o / Math.pow(2, f - 1);
    let v = 1;
    for (let u = 0; u < f; u++) {
      const l = new sR("vertical blur", e, new at(0, 1), d, v, null, this._circleOfConfusion, u == 0 ? this._circleOfConfusion : null, We.BILINEAR_SAMPLINGMODE, s, !1, n, i, u == 0 ? a : 5);
      l.autoClear = !1, v = 0.75 / Math.pow(2, u);
      const P = new sR("horizontal blur", e, new at(1, 0), d, v, null, this._circleOfConfusion, null, We.BILINEAR_SAMPLINGMODE, s, !1, n, i);
      P.autoClear = !1, this._depthOfFieldBlurY.push(l), this._depthOfFieldBlurX.push(P);
    }
    this._effects = [this._circleOfConfusion];
    for (let u = 0; u < this._depthOfFieldBlurX.length; u++)
      this._effects.push(this._depthOfFieldBlurY[u]), this._effects.push(this._depthOfFieldBlurX[u]);
    this._dofMerge = new eie("dofMerge", this._circleOfConfusion, this._circleOfConfusion, this._depthOfFieldBlurX, v, null, We.BILINEAR_SAMPLINGMODE, s, !1, n, i), this._dofMerge.autoClear = !1, this._effects.push(this._dofMerge);
  }
  /**
   * Get the current class name of the current effect
   * @returns "DepthOfFieldEffect"
   */
  getClassName() {
    return "DepthOfFieldEffect";
  }
  /**
   * Depth texture to be used to compute the circle of confusion. This must be set here or in the constructor in order for the post process to function.
   */
  set depthTexture(e) {
    this._circleOfConfusion.depthTexture = e;
  }
  /**
   * Disposes each of the internal effects for a given camera.
   * @param camera The camera to dispose the effect on.
   */
  disposeEffects(e) {
    for (let t = 0; t < this._effects.length; t++)
      this._effects[t].dispose(e);
  }
  /**
   * @internal Internal
   */
  _updateEffects() {
    for (let e = 0; e < this._effects.length; e++)
      this._effects[e].updateEffect();
  }
  /**
   * Internal
   * @returns if all the contained post processes are ready.
   * @internal
   */
  _isReady() {
    for (let e = 0; e < this._effects.length; e++)
      if (!this._effects[e].isReady())
        return !1;
    return !0;
  }
}
const m0e = "displayPassPixelShader", B0e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D passSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{gl_FragColor=texture2D(passSampler,vUV);}`;
Le.ShadersStore[m0e] = B0e;
class Sy extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "DisplayPassPostProcess" string
   */
  getClassName() {
    return "DisplayPassPostProcess";
  }
  /**
   * Creates the DisplayPassPostProcess
   * @param name The name of the effect.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   */
  constructor(e, t, r, n, i, s) {
    super(e, "displayPass", ["passSampler"], ["passSampler"], t, r, n, i, s);
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new Sy(e.name, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable), e, r, n);
  }
}
Ue("BABYLON.DisplayPassPostProcess", Sy);
const W0e = "filterPixelShader", S0e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform mat4 kernelMatrix;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec3 baseColor=texture2D(textureSampler,vUV).rgb;vec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;gl_FragColor=vec4(updatedColor,1.0);}`;
Le.ShadersStore[W0e] = S0e;
class vV extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "FilterPostProcess" string
   */
  getClassName() {
    return "FilterPostProcess";
  }
  /**
   *
   * @param name The name of the effect.
   * @param kernelMatrix The matrix to be applied to the image
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   */
  constructor(e, t, r, n, i, s, a) {
    super(e, "filter", ["kernelMatrix"], null, r, n, i, s, a), this.kernelMatrix = t, this.onApply = (f) => {
      f.setMatrix("kernelMatrix", this.kernelMatrix);
    };
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new vV(e.name, e.kernelMatrix, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable), e, r, n);
  }
}
C([
  qO()
], vV.prototype, "kernelMatrix", void 0);
Ue("BABYLON.FilterPostProcess", vV);
const U0e = "fxaaPixelShader", I0e = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)
#else
#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)
#endif
uniform sampler2D textureSampler;uniform vec2 texelSize;varying vec2 vUV;varying vec2 sampleCoordS;varying vec2 sampleCoordE;varying vec2 sampleCoordN;varying vec2 sampleCoordW;varying vec2 sampleCoordNW;varying vec2 sampleCoordSE;varying vec2 sampleCoordNE;varying vec2 sampleCoordSW;const float fxaaQualitySubpix=1.0;const float fxaaQualityEdgeThreshold=0.166;const float fxaaQualityEdgeThresholdMin=0.0833;const vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);
#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)
void main(){vec2 posM;posM.x=vUV.x;posM.y=vUV.y;vec4 rgbyM=TEXTUREFUNC(textureSampler,vUV,0.0);float lumaM=FxaaLuma(rgbyM);float lumaS=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordS,0.0));float lumaE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordE,0.0));float lumaN=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordN,0.0));float lumaW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordW,0.0));float maxSM=max(lumaS,lumaM);float minSM=min(lumaS,lumaM);float maxESM=max(lumaE,maxSM);float minESM=min(lumaE,minSM);float maxWN=max(lumaN,lumaW);float minWN=min(lumaN,lumaW);float rangeMax=max(maxWN,maxESM);float rangeMin=min(minWN,minESM);float rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;float range=rangeMax-rangeMin;float rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);
#ifndef MALI
if(range<rangeMaxClamped) 
{gl_FragColor=rgbyM;return;}
#endif
float lumaNW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordNW,0.0));float lumaSE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordSE,0.0));float lumaNE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordNE,0.0));float lumaSW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordSW,0.0));float lumaNS=lumaN+lumaS;float lumaWE=lumaW+lumaE;float subpixRcpRange=1.0/range;float subpixNSWE=lumaNS+lumaWE;float edgeHorz1=(-2.0*lumaM)+lumaNS;float edgeVert1=(-2.0*lumaM)+lumaWE;float lumaNESE=lumaNE+lumaSE;float lumaNWNE=lumaNW+lumaNE;float edgeHorz2=(-2.0*lumaE)+lumaNESE;float edgeVert2=(-2.0*lumaN)+lumaNWNE;float lumaNWSW=lumaNW+lumaSW;float lumaSWSE=lumaSW+lumaSE;float edgeHorz4=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);float edgeVert4=(abs(edgeVert1)*2.0)+abs(edgeVert2);float edgeHorz3=(-2.0*lumaW)+lumaNWSW;float edgeVert3=(-2.0*lumaS)+lumaSWSE;float edgeHorz=abs(edgeHorz3)+edgeHorz4;float edgeVert=abs(edgeVert3)+edgeVert4;float subpixNWSWNESE=lumaNWSW+lumaNESE;float lengthSign=texelSize.x;bool horzSpan=edgeHorz>=edgeVert;float subpixA=subpixNSWE*2.0+subpixNWSWNESE;if (!horzSpan)
{lumaN=lumaW;}
if (!horzSpan) 
{lumaS=lumaE;}
if (horzSpan) 
{lengthSign=texelSize.y;}
float subpixB=(subpixA*(1.0/12.0))-lumaM;float gradientN=lumaN-lumaM;float gradientS=lumaS-lumaM;float lumaNN=lumaN+lumaM;float lumaSS=lumaS+lumaM;bool pairN=abs(gradientN)>=abs(gradientS);float gradient=max(abs(gradientN),abs(gradientS));if (pairN)
{lengthSign=-lengthSign;}
float subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);vec2 posB;posB.x=posM.x;posB.y=posM.y;vec2 offNP;offNP.x=(!horzSpan) ? 0.0 : texelSize.x;offNP.y=(horzSpan) ? 0.0 : texelSize.y;if (!horzSpan) 
{posB.x+=lengthSign*0.5;}
if (horzSpan)
{posB.y+=lengthSign*0.5;}
vec2 posN;posN.x=posB.x-offNP.x*1.5;posN.y=posB.y-offNP.y*1.5;vec2 posP;posP.x=posB.x+offNP.x*1.5;posP.y=posB.y+offNP.y*1.5;float subpixD=((-2.0)*subpixC)+3.0;float lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN,0.0));float subpixE=subpixC*subpixC;float lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP,0.0));if (!pairN) 
{lumaNN=lumaSS;}
float gradientScaled=gradient*1.0/4.0;float lumaMM=lumaM-lumaNN*0.5;float subpixF=subpixD*subpixE;bool lumaMLTZero=lumaMM<0.0;lumaEndN-=lumaNN*0.5;lumaEndP-=lumaNN*0.5;bool doneN=abs(lumaEndN)>=gradientScaled;bool doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) 
{posN.x-=offNP.x*3.0;}
if (!doneN) 
{posN.y-=offNP.y*3.0;}
bool doneNP=(!doneN) || (!doneP);if (!doneP) 
{posP.x+=offNP.x*3.0;}
if (!doneP)
{posP.y+=offNP.y*3.0;}
if (doneNP)
{if (!doneN) lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN.xy,0.0));if (!doneP) lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP.xy,0.0));if (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;if (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;doneN=abs(lumaEndN)>=gradientScaled;doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) posN.x-=offNP.x*12.0;if (!doneN) posN.y-=offNP.y*12.0;doneNP=(!doneN) || (!doneP);if (!doneP) posP.x+=offNP.x*12.0;if (!doneP) posP.y+=offNP.y*12.0;}
float dstN=posM.x-posN.x;float dstP=posP.x-posM.x;if (!horzSpan)
{dstN=posM.y-posN.y;}
if (!horzSpan) 
{dstP=posP.y-posM.y;}
bool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;float spanLength=(dstP+dstN);bool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;float spanLengthRcp=1.0/spanLength;bool directionN=dstN<dstP;float dst=min(dstN,dstP);bool goodSpan=directionN ? goodSpanN : goodSpanP;float subpixG=subpixF*subpixF;float pixelOffset=(dst*(-spanLengthRcp))+0.5;float subpixH=subpixG*fxaaQualitySubpix;float pixelOffsetGood=goodSpan ? pixelOffset : 0.0;float pixelOffsetSubpix=max(pixelOffsetGood,subpixH);if (!horzSpan)
{posM.x+=pixelOffsetSubpix*lengthSign;}
if (horzSpan)
{posM.y+=pixelOffsetSubpix*lengthSign;}
#ifdef MALI
if(range<rangeMaxClamped) 
{gl_FragColor=rgbyM;}
else
{gl_FragColor=TEXTUREFUNC(textureSampler,posM,0.0);}
#else
gl_FragColor=TEXTUREFUNC(textureSampler,posM,0.0);
#endif
}`;
Le.ShadersStore[U0e] = I0e;
const R0e = "fxaaVertexShader", V0e = `attribute vec2 position;uniform vec2 texelSize;varying vec2 vUV;varying vec2 sampleCoordS;varying vec2 sampleCoordE;varying vec2 sampleCoordN;varying vec2 sampleCoordW;varying vec2 sampleCoordNW;varying vec2 sampleCoordSE;varying vec2 sampleCoordNE;varying vec2 sampleCoordSW;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=(position*madd+madd);sampleCoordS=vUV+vec2( 0.0,1.0)*texelSize;sampleCoordE=vUV+vec2( 1.0,0.0)*texelSize;sampleCoordN=vUV+vec2( 0.0,-1.0)*texelSize;sampleCoordW=vUV+vec2(-1.0,0.0)*texelSize;sampleCoordNW=vUV+vec2(-1.0,-1.0)*texelSize;sampleCoordSE=vUV+vec2( 1.0,1.0)*texelSize;sampleCoordNE=vUV+vec2( 1.0,-1.0)*texelSize;sampleCoordSW=vUV+vec2(-1.0,1.0)*texelSize;gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[R0e] = V0e;
class ym extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "FxaaPostProcess" string
   */
  getClassName() {
    return "FxaaPostProcess";
  }
  constructor(e, t, r = null, n, i, s, a = 0) {
    super(e, "fxaa", ["texelSize"], null, t, r, n || We.BILINEAR_SAMPLINGMODE, i, s, null, a, "fxaa", void 0, !0);
    const f = this._getDefines();
    this.updateEffect(f), this.onApplyObservable.add((o) => {
      const d = this.texelSize;
      o.setFloat2("texelSize", d.x, d.y);
    });
  }
  _getDefines() {
    const e = this.getEngine();
    if (!e)
      return null;
    const t = e.getGlInfo();
    return t && t.renderer && t.renderer.toLowerCase().indexOf("mali") > -1 ? `#define MALI 1
` : null;
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new ym(e.name, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable), e, r, n);
  }
}
Ue("BABYLON.FxaaPostProcess", ym);
const C0e = "grainPixelShader", O0e = `#include<helperFunctions>
uniform sampler2D textureSampler; 
uniform float intensity;uniform float animatedSeed;varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{gl_FragColor=texture2D(textureSampler,vUV);vec2 seed=vUV*(animatedSeed);float grain=dither(seed,intensity);float lum=getLuminance(gl_FragColor.rgb);float grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;gl_FragColor.rgb+=grain*grainAmount;gl_FragColor.rgb=max(gl_FragColor.rgb,0.0);}`;
Le.ShadersStore[C0e] = O0e;
class km extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "GrainPostProcess" string
   */
  getClassName() {
    return "GrainPostProcess";
  }
  /**
   * Creates a new instance of @see GrainPostProcess
   * @param name The name of the effect.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r, n, i, s, a = 0, f = !1) {
    super(e, "grain", ["intensity", "animatedSeed"], [], t, r, n, i, s, null, a, void 0, null, f), this.intensity = 30, this.animated = !1, this.onApplyObservable.add((o) => {
      o.setFloat("intensity", this.intensity), o.setFloat("animatedSeed", this.animated ? Math.random() + 1 : 1);
    });
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new km(e.name, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable), e, r, n);
  }
}
C([
  M()
], km.prototype, "intensity", void 0);
C([
  M()
], km.prototype, "animated", void 0);
Ue("BABYLON.GrainPostProcess", km);
const y0e = "highlightsPixelShader", k0e = `varying vec2 vUV;uniform sampler2D textureSampler;const vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{vec4 tex=texture2D(textureSampler,vUV);vec3 c=tex.rgb;float luma=dot(c.rgb,RGBLuminanceCoefficients);gl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a); }`;
Le.ShadersStore[y0e] = k0e;
class E0e extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "HighlightsPostProcess" string
   */
  getClassName() {
    return "HighlightsPostProcess";
  }
  /**
   * Extracts highlights from the image
   * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses
   * @param name The name of the effect.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of texture for the post process (default: Engine.TEXTURETYPE_UNSIGNED_INT)
   */
  constructor(e, t, r, n, i, s, a = 0) {
    super(e, "highlights", null, null, t, r, n, i, s, null, a);
  }
}
const F0e = "imageProcessingPixelShader", N0e = `varying vec2 vUV;uniform sampler2D textureSampler;
#include<imageProcessingDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec4 result=texture2D(textureSampler,vUV);
#ifdef IMAGEPROCESSING
#ifndef FROMLINEARSPACE
result.rgb=toLinearSpace(result.rgb);
#endif
result=applyImageProcessing(result);
#else
#ifdef FROMLINEARSPACE
result=applyImageProcessing(result);
#endif
#endif
gl_FragColor=result;}`;
Le.ShadersStore[F0e] = N0e;
class Uy extends kr {
  /**
   * Gets the image processing configuration used either in this material.
   */
  get imageProcessingConfiguration() {
    return this._imageProcessingConfiguration;
  }
  /**
   * Sets the Default image processing configuration used either in the this material.
   *
   * If sets to null, the scene one is in use.
   */
  set imageProcessingConfiguration(e) {
    e.applyByPostProcess = !0, this._attachImageProcessingConfiguration(e);
  }
  /**
   * Attaches a new image processing configuration to the PBR Material.
   * @param configuration
   * @param doNotBuild
   */
  _attachImageProcessingConfiguration(e, t = !1) {
    if (e !== this._imageProcessingConfiguration) {
      if (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), e)
        this._imageProcessingConfiguration = e;
      else {
        let r = null;
        const n = this.getEngine(), i = this.getCamera();
        if (i)
          r = i.getScene();
        else if (n && n.scenes) {
          const s = n.scenes;
          r = s[s.length - 1];
        } else
          r = gr.LastCreatedScene;
        r ? this._imageProcessingConfiguration = r.imageProcessingConfiguration : this._imageProcessingConfiguration = new Ui();
      }
      this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
        this._updateParameters();
      })), t || this._updateParameters();
    }
  }
  /**
   * If the post process is supported.
   */
  get isSupported() {
    const e = this.getEffect();
    return !e || e.isSupported;
  }
  /**
   * Gets Color curves setup used in the effect if colorCurvesEnabled is set to true .
   */
  get colorCurves() {
    return this.imageProcessingConfiguration.colorCurves;
  }
  /**
   * Sets Color curves setup used in the effect if colorCurvesEnabled is set to true .
   */
  set colorCurves(e) {
    this.imageProcessingConfiguration.colorCurves = e;
  }
  /**
   * Gets whether the color curves effect is enabled.
   */
  get colorCurvesEnabled() {
    return this.imageProcessingConfiguration.colorCurvesEnabled;
  }
  /**
   * Sets whether the color curves effect is enabled.
   */
  set colorCurvesEnabled(e) {
    this.imageProcessingConfiguration.colorCurvesEnabled = e;
  }
  /**
   * Gets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.
   */
  get colorGradingTexture() {
    return this.imageProcessingConfiguration.colorGradingTexture;
  }
  /**
   * Sets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.
   */
  set colorGradingTexture(e) {
    this.imageProcessingConfiguration.colorGradingTexture = e;
  }
  /**
   * Gets whether the color grading effect is enabled.
   */
  get colorGradingEnabled() {
    return this.imageProcessingConfiguration.colorGradingEnabled;
  }
  /**
   * Gets whether the color grading effect is enabled.
   */
  set colorGradingEnabled(e) {
    this.imageProcessingConfiguration.colorGradingEnabled = e;
  }
  /**
   * Gets exposure used in the effect.
   */
  get exposure() {
    return this.imageProcessingConfiguration.exposure;
  }
  /**
   * Sets exposure used in the effect.
   */
  set exposure(e) {
    this.imageProcessingConfiguration.exposure = e;
  }
  /**
   * Gets whether tonemapping is enabled or not.
   */
  get toneMappingEnabled() {
    return this._imageProcessingConfiguration.toneMappingEnabled;
  }
  /**
   * Sets whether tonemapping is enabled or not
   */
  set toneMappingEnabled(e) {
    this._imageProcessingConfiguration.toneMappingEnabled = e;
  }
  /**
   * Gets the type of tone mapping effect.
   */
  get toneMappingType() {
    return this._imageProcessingConfiguration.toneMappingType;
  }
  /**
   * Sets the type of tone mapping effect.
   */
  set toneMappingType(e) {
    this._imageProcessingConfiguration.toneMappingType = e;
  }
  /**
   * Gets contrast used in the effect.
   */
  get contrast() {
    return this.imageProcessingConfiguration.contrast;
  }
  /**
   * Sets contrast used in the effect.
   */
  set contrast(e) {
    this.imageProcessingConfiguration.contrast = e;
  }
  /**
   * Gets Vignette stretch size.
   */
  get vignetteStretch() {
    return this.imageProcessingConfiguration.vignetteStretch;
  }
  /**
   * Sets Vignette stretch size.
   */
  set vignetteStretch(e) {
    this.imageProcessingConfiguration.vignetteStretch = e;
  }
  /**
   * Gets Vignette center X Offset.
   * @deprecated use vignetteCenterX instead
   */
  get vignetteCentreX() {
    return this.imageProcessingConfiguration.vignetteCenterX;
  }
  /**
   * Sets Vignette center X Offset.
   * @deprecated use vignetteCenterX instead
   */
  set vignetteCentreX(e) {
    this.imageProcessingConfiguration.vignetteCenterX = e;
  }
  /**
   * Gets Vignette center Y Offset.
   * @deprecated use vignetteCenterY instead
   */
  get vignetteCentreY() {
    return this.imageProcessingConfiguration.vignetteCenterY;
  }
  /**
   * Sets Vignette center Y Offset.
   * @deprecated use vignetteCenterY instead
   */
  set vignetteCentreY(e) {
    this.imageProcessingConfiguration.vignetteCenterY = e;
  }
  /**
   * Vignette center Y Offset.
   */
  get vignetteCenterY() {
    return this.imageProcessingConfiguration.vignetteCenterY;
  }
  set vignetteCenterY(e) {
    this.imageProcessingConfiguration.vignetteCenterY = e;
  }
  /**
   * Vignette center X Offset.
   */
  get vignetteCenterX() {
    return this.imageProcessingConfiguration.vignetteCenterX;
  }
  set vignetteCenterX(e) {
    this.imageProcessingConfiguration.vignetteCenterX = e;
  }
  /**
   * Gets Vignette weight or intensity of the vignette effect.
   */
  get vignetteWeight() {
    return this.imageProcessingConfiguration.vignetteWeight;
  }
  /**
   * Sets Vignette weight or intensity of the vignette effect.
   */
  set vignetteWeight(e) {
    this.imageProcessingConfiguration.vignetteWeight = e;
  }
  /**
   * Gets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)
   * if vignetteEnabled is set to true.
   */
  get vignetteColor() {
    return this.imageProcessingConfiguration.vignetteColor;
  }
  /**
   * Sets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)
   * if vignetteEnabled is set to true.
   */
  set vignetteColor(e) {
    this.imageProcessingConfiguration.vignetteColor = e;
  }
  /**
   * Gets Camera field of view used by the Vignette effect.
   */
  get vignetteCameraFov() {
    return this.imageProcessingConfiguration.vignetteCameraFov;
  }
  /**
   * Sets Camera field of view used by the Vignette effect.
   */
  set vignetteCameraFov(e) {
    this.imageProcessingConfiguration.vignetteCameraFov = e;
  }
  /**
   * Gets the vignette blend mode allowing different kind of effect.
   */
  get vignetteBlendMode() {
    return this.imageProcessingConfiguration.vignetteBlendMode;
  }
  /**
   * Sets the vignette blend mode allowing different kind of effect.
   */
  set vignetteBlendMode(e) {
    this.imageProcessingConfiguration.vignetteBlendMode = e;
  }
  /**
   * Gets whether the vignette effect is enabled.
   */
  get vignetteEnabled() {
    return this.imageProcessingConfiguration.vignetteEnabled;
  }
  /**
   * Sets whether the vignette effect is enabled.
   */
  set vignetteEnabled(e) {
    this.imageProcessingConfiguration.vignetteEnabled = e;
  }
  /**
   * Gets intensity of the dithering effect.
   */
  get ditheringIntensity() {
    return this.imageProcessingConfiguration.ditheringIntensity;
  }
  /**
   * Sets intensity of the dithering effect.
   */
  set ditheringIntensity(e) {
    this.imageProcessingConfiguration.ditheringIntensity = e;
  }
  /**
   * Gets whether the dithering effect is enabled.
   */
  get ditheringEnabled() {
    return this.imageProcessingConfiguration.ditheringEnabled;
  }
  /**
   * Sets whether the dithering effect is enabled.
   */
  set ditheringEnabled(e) {
    this.imageProcessingConfiguration.ditheringEnabled = e;
  }
  /**
   * Gets whether the input of the processing is in Gamma or Linear Space.
   */
  get fromLinearSpace() {
    return this._fromLinearSpace;
  }
  /**
   * Sets whether the input of the processing is in Gamma or Linear Space.
   */
  set fromLinearSpace(e) {
    this._fromLinearSpace !== e && (this._fromLinearSpace = e, this._updateParameters());
  }
  constructor(e, t, r = null, n, i, s, a = 0, f) {
    super(e, "imageProcessing", [], [], t, r, n, i, s, null, a, "postprocess", null, !0), this._fromLinearSpace = !0, this._defines = {
      IMAGEPROCESSING: !1,
      VIGNETTE: !1,
      VIGNETTEBLENDMODEMULTIPLY: !1,
      VIGNETTEBLENDMODEOPAQUE: !1,
      TONEMAPPING: !1,
      TONEMAPPING_ACES: !1,
      CONTRAST: !1,
      COLORCURVES: !1,
      COLORGRADING: !1,
      COLORGRADING3D: !1,
      FROMLINEARSPACE: !1,
      SAMPLER3DGREENDEPTH: !1,
      SAMPLER3DBGRMAP: !1,
      DITHER: !1,
      IMAGEPROCESSINGPOSTPROCESS: !1,
      EXPOSURE: !1,
      SKIPFINALCOLORCLAMP: !1
    }, f ? (f.applyByPostProcess = !0, this._attachImageProcessingConfiguration(f, !0), this._updateParameters()) : (this._attachImageProcessingConfiguration(null, !0), this.imageProcessingConfiguration.applyByPostProcess = !0), this.onApply = (o) => {
      this.imageProcessingConfiguration.bind(o, this.aspectRatio);
    };
  }
  /**
   *  "ImageProcessingPostProcess"
   * @returns "ImageProcessingPostProcess"
   */
  getClassName() {
    return "ImageProcessingPostProcess";
  }
  /**
   * @internal
   */
  _updateParameters() {
    this._defines.FROMLINEARSPACE = this._fromLinearSpace, this.imageProcessingConfiguration.prepareDefines(this._defines, !0);
    let e = "";
    for (const n in this._defines)
      this._defines[n] && (e += `#define ${n};
`);
    const t = ["textureSampler"], r = ["scale"];
    Ui && (Ui.PrepareSamplers(t, this._defines), Ui.PrepareUniforms(r, this._defines)), this.updateEffect(e, r, t);
  }
  dispose(e) {
    super.dispose(e), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration && (this.imageProcessingConfiguration.applyByPostProcess = !1);
  }
}
C([
  M()
], Uy.prototype, "_fromLinearSpace", void 0);
const Q0e = "mrtFragmentDeclaration", Y0e = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
layout(location=0) out vec4 glFragData[{X}];
#endif
`;
Le.IncludesShadersStore[Q0e] = Y0e;
const M0e = "geometryPixelShader", L0e = `#extension GL_EXT_draw_buffers : require
#if defined(BUMP) || !defined(NORMAL)
#extension GL_OES_standard_derivatives : enable
#endif
precision highp float;
#ifdef BUMP
varying mat4 vWorldView;varying vec3 vNormalW;
#else
varying vec3 vNormalV;
#endif
varying vec4 vViewPos;
#if defined(POSITION) || defined(BUMP)
varying vec3 vPositionW;
#endif
#ifdef VELOCITY
varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;
#endif
#ifdef NEED_UV
varying vec2 vUV;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;
#endif
#if defined(REFLECTIVITY)
#if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
uniform sampler2D reflectivitySampler;varying vec2 vReflectivityUV;
#endif
#ifdef ALBEDOTEXTURE
varying vec2 vAlbedoUV;uniform sampler2D albedoSampler;
#endif
#ifdef REFLECTIVITYCOLOR
uniform vec3 reflectivityColor;
#endif
#ifdef ALBEDOCOLOR
uniform vec3 albedoColor;
#endif
#ifdef METALLIC
uniform float metallic;
#endif
#if defined(ROUGHNESS) || defined(GLOSSINESS)
uniform float glossiness;
#endif
#endif
#if defined(ALPHATEST) && defined(NEED_UV)
uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
#include<mrtFragmentDeclaration>[RENDER_TARGET_COUNT]
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#include<helperFunctions>
void main() {
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
#endif
vec3 normalOutput;
#ifdef BUMP
vec3 normalW=normalize(vNormalW);
#include<bumpFragment>
#ifdef NORMAL_WORLDSPACE
normalOutput=normalW;
#else
normalOutput=normalize(vec3(vWorldView*vec4(normalW,0.0)));
#endif
#else
normalOutput=normalize(vNormalV);
#endif
#ifdef PREPASS
#ifdef PREPASS_DEPTH
gl_FragData[DEPTH_INDEX]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);
#endif
#ifdef PREPASS_NORMAL
gl_FragData[NORMAL_INDEX]=vec4(normalOutput,1.0);
#endif
#else
gl_FragData[0]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);gl_FragData[1]=vec4(normalOutput,1.0);
#endif
#ifdef POSITION
gl_FragData[POSITION_INDEX]=vec4(vPositionW,1.0);
#endif
#ifdef VELOCITY
vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);
#endif
#ifdef REFLECTIVITY
vec4 reflectivity=vec4(0.0,0.0,0.0,1.0);
#ifdef METALLICWORKFLOW
float metal=1.0;float roughness=1.0;
#ifdef ORMTEXTURE
metal*=texture2D(reflectivitySampler,vReflectivityUV).b;roughness*=texture2D(reflectivitySampler,vReflectivityUV).g;
#endif
#ifdef METALLIC
metal*=metallic;
#endif
#ifdef ROUGHNESS
roughness*=(1.0-glossiness); 
#endif
reflectivity.a-=roughness;vec3 color=vec3(1.0);
#ifdef ALBEDOTEXTURE
color=texture2D(albedoSampler,vAlbedoUV).rgb;
#ifdef GAMMAALBEDO
color=toLinearSpace(color);
#endif
#endif
#ifdef ALBEDOCOLOR
color*=albedoColor.xyz;
#endif
reflectivity.rgb=mix(vec3(0.04),color,metal);
#else
#if defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
reflectivity=texture2D(reflectivitySampler,vReflectivityUV);
#ifdef GAMMAREFLECTIVITYTEXTURE
reflectivity.rgb=toLinearSpace(reflectivity.rgb);
#endif
#else 
#ifdef REFLECTIVITYCOLOR
reflectivity.rgb=toLinearSpace(reflectivityColor.xyz);reflectivity.a=1.0;
#endif
#endif
#ifdef GLOSSINESSS
reflectivity.a*=glossiness; 
#endif
#endif
gl_FragData[REFLECTIVITY_INDEX]=reflectivity;
#endif
}
`;
Le.ShadersStore[M0e] = L0e;
const K0e = "geometryVertexDeclaration", J0e = "uniform mat4 viewProjection;uniform mat4 view;";
Le.IncludesShadersStore[K0e] = J0e;
const z0e = "geometryUboDeclaration", G0e = `#include<sceneUboDeclaration>
`;
Le.IncludesShadersStore[z0e] = G0e;
const Z0e = "geometryVertexShader", _0e = `precision highp float;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
#include<__decl__geometryVertex>
#include<clipPlaneVertexDeclaration>
attribute vec3 position;attribute vec3 normal;
#ifdef NEED_UV
varying vec2 vUV;
#ifdef ALPHATEST
uniform mat4 diffuseMatrix;
#endif
#ifdef BUMP
uniform mat4 bumpMatrix;varying vec2 vBumpUV;
#endif
#ifdef REFLECTIVITY
uniform mat4 reflectivityMatrix;uniform mat4 albedoMatrix;varying vec2 vReflectivityUV;varying vec2 vAlbedoUV;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#ifdef BUMP
varying mat4 vWorldView;
#endif
#ifdef BUMP
varying vec3 vNormalW;
#else
varying vec3 vNormalV;
#endif
varying vec4 vViewPos;
#if defined(POSITION) || defined(BUMP)
varying vec3 vPositionW;
#endif
#ifdef VELOCITY
uniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;vec3 normalUpdated=normal;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#if defined(VELOCITY) && !defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=vec4(finalWorld*vec4(positionUpdated,1.0));
#ifdef BUMP
vWorldView=view*finalWorld;vNormalW=normalUpdated;
#else
#ifdef NORMAL_WORLDSPACE
vNormalV=normalize(vec3(finalWorld*vec4(normalUpdated,0.0)));
#else
vNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0)));
#endif
#endif
vViewPos=view*worldPos;
#if defined(VELOCITY) && defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);
#if NUM_BONE_INFLUENCERS>0
mat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);
#else
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#endif
#if defined(POSITION) || defined(BUMP)
vPositionW=worldPos.xyz/worldPos.w;
#endif
gl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);
#include<clipPlaneVertex>
#ifdef NEED_UV
#ifdef UV1
#if defined(ALPHATEST) && defined(ALPHATEST_UV1)
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#else
vUV=uv;
#endif
#ifdef BUMP_UV1
vBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef REFLECTIVITY_UV1
vReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef ALBEDO_UV1
vAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#endif
#ifdef UV2
#if defined(ALPHATEST) && defined(ALPHATEST_UV2)
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#else
vUV=uv2;
#endif
#ifdef BUMP_UV2
vBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));
#endif
#ifdef REFLECTIVITY_UV2
vReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));
#endif
#ifdef ALBEDO_UV2
vAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#endif
#include<bumpVertex>
}
`;
Le.ShadersStore[Z0e] = _0e;
const tie = [
  "world",
  "mBones",
  "viewProjection",
  "diffuseMatrix",
  "view",
  "previousWorld",
  "previousViewProjection",
  "mPreviousBones",
  "bumpMatrix",
  "reflectivityMatrix",
  "albedoMatrix",
  "reflectivityColor",
  "albedoColor",
  "metallic",
  "glossiness",
  "vTangentSpaceParams",
  "vBumpInfos",
  "morphTargetInfluences",
  "morphTargetTextureInfo",
  "morphTargetTextureIndices",
  "boneTextureWidth"
];
Mf(tie);
class po {
  /**
   * @internal
   * Sets up internal structures to share outputs with PrePassRenderer
   * This method should only be called by the PrePassRenderer itself
   */
  _linkPrePassRenderer(e) {
    this._linkedWithPrePass = !0, this._prePassRenderer = e, this._multiRenderTarget && (this._multiRenderTarget.onClearObservable.clear(), this._multiRenderTarget.onClearObservable.add(() => {
    }));
  }
  /**
   * @internal
   * Separates internal structures from PrePassRenderer so the geometry buffer can now operate by itself.
   * This method should only be called by the PrePassRenderer itself
   */
  _unlinkPrePassRenderer() {
    this._linkedWithPrePass = !1, this._createRenderTargets();
  }
  /**
   * @internal
   * Resets the geometry buffer layout
   */
  _resetLayout() {
    this._enablePosition = !1, this._enableReflectivity = !1, this._enableVelocity = !1, this._attachmentsFromPrePass = [];
  }
  /**
   * @internal
   * Replaces a texture in the geometry buffer renderer
   * Useful when linking textures of the prepass renderer
   */
  _forceTextureType(e, t) {
    e === po.POSITION_TEXTURE_TYPE ? (this._positionIndex = t, this._enablePosition = !0) : e === po.VELOCITY_TEXTURE_TYPE ? (this._velocityIndex = t, this._enableVelocity = !0) : e === po.REFLECTIVITY_TEXTURE_TYPE ? (this._reflectivityIndex = t, this._enableReflectivity = !0) : e === po.DEPTH_TEXTURE_TYPE ? this._depthIndex = t : e === po.NORMAL_TEXTURE_TYPE && (this._normalIndex = t);
  }
  /**
   * @internal
   * Sets texture attachments
   * Useful when linking textures of the prepass renderer
   */
  _setAttachments(e) {
    this._attachmentsFromPrePass = e;
  }
  /**
   * @internal
   * Replaces the first texture which is hard coded as a depth texture in the geometry buffer
   * Useful when linking textures of the prepass renderer
   */
  _linkInternalTexture(e) {
    this._multiRenderTarget.setInternalTexture(e, 0, !1);
  }
  /**
   * Gets the render list (meshes to be rendered) used in the G buffer.
   */
  get renderList() {
    return this._multiRenderTarget.renderList;
  }
  /**
   * Set the render list (meshes to be rendered) used in the G buffer.
   */
  set renderList(e) {
    this._multiRenderTarget.renderList = e;
  }
  /**
   * Gets whether or not G buffer are supported by the running hardware.
   * This requires draw buffer supports
   */
  get isSupported() {
    return this._multiRenderTarget.isSupported;
  }
  /**
   * Returns the index of the given texture type in the G-Buffer textures array
   * @param textureType The texture type constant. For example GeometryBufferRenderer.POSITION_TEXTURE_INDEX
   * @returns the index of the given texture type in the G-Buffer textures array
   */
  getTextureIndex(e) {
    switch (e) {
      case po.POSITION_TEXTURE_TYPE:
        return this._positionIndex;
      case po.VELOCITY_TEXTURE_TYPE:
        return this._velocityIndex;
      case po.REFLECTIVITY_TEXTURE_TYPE:
        return this._reflectivityIndex;
      case po.DEPTH_TEXTURE_TYPE:
        return this._linkedWithPrePass ? this._depthIndex : 0;
      case po.NORMAL_TEXTURE_TYPE:
        return this._linkedWithPrePass ? this._normalIndex : 1;
      default:
        return -1;
    }
  }
  /**
   * Gets a boolean indicating if objects positions are enabled for the G buffer.
   */
  get enablePosition() {
    return this._enablePosition;
  }
  /**
   * Sets whether or not objects positions are enabled for the G buffer.
   */
  set enablePosition(e) {
    this._enablePosition = e, this._linkedWithPrePass || (this.dispose(), this._createRenderTargets());
  }
  /**
   * Gets a boolean indicating if objects velocities are enabled for the G buffer.
   */
  get enableVelocity() {
    return this._enableVelocity;
  }
  /**
   * Sets whether or not objects velocities are enabled for the G buffer.
   */
  set enableVelocity(e) {
    this._enableVelocity = e, e || (this._previousTransformationMatrices = {}), this._linkedWithPrePass || (this.dispose(), this._createRenderTargets()), this._scene.needsPreviousWorldMatrices = e;
  }
  /**
   * Gets a boolean indicating if objects reflectivity are enabled in the G buffer.
   */
  get enableReflectivity() {
    return this._enableReflectivity;
  }
  /**
   * Sets whether or not objects reflectivity are enabled for the G buffer.
   * For Metallic-Roughness workflow with ORM texture, we assume that ORM texture is defined according to the default layout:
   * pbr.useRoughnessFromMetallicTextureAlpha = false;
   * pbr.useRoughnessFromMetallicTextureGreen = true;
   * pbr.useMetallnessFromMetallicTextureBlue = true;
   */
  set enableReflectivity(e) {
    this._enableReflectivity = e, this._linkedWithPrePass || (this.dispose(), this._createRenderTargets());
  }
  /**
   * Gets the scene associated with the buffer.
   */
  get scene() {
    return this._scene;
  }
  /**
   * Gets the ratio used by the buffer during its creation.
   * How big is the buffer related to the main canvas.
   */
  get ratio() {
    return typeof this._ratioOrDimensions == "object" ? 1 : this._ratioOrDimensions;
  }
  /**
   * Creates a new G Buffer for the scene
   * @param scene The scene the buffer belongs to
   * @param ratioOrDimensions How big is the buffer related to the main canvas (default: 1). You can also directly pass a width and height for the generated textures @since
   * @param depthFormat Format of the depth texture (default: 15)
   */
  constructor(e, t = 1, r = 15) {
    this._previousTransformationMatrices = {}, this._previousBonesTransformationMatrices = {}, this.excludedSkinnedMeshesFromVelocity = [], this.renderTransparentMeshes = !0, this.generateNormalsInWorldSpace = !1, this._resizeObserver = null, this._enablePosition = !1, this._enableVelocity = !1, this._enableReflectivity = !1, this._clearColor = new xt(0, 0, 0, 0), this._clearDepthColor = new xt(1e8, 0, 0, 1), this._positionIndex = -1, this._velocityIndex = -1, this._reflectivityIndex = -1, this._depthIndex = -1, this._normalIndex = -1, this._linkedWithPrePass = !1, this.useSpecificClearForDepthTexture = !1, this._scene = e, this._ratioOrDimensions = t, this._useUbo = e.getEngine().supportsUniformBuffers, this._depthFormat = r, po._SceneComponentInitialization(this._scene), this._createRenderTargets();
  }
  /**
   * Checks whether everything is ready to render a submesh to the G buffer.
   * @param subMesh the submesh to check readiness for
   * @param useInstances is the mesh drawn using instance or not
   * @returns true if ready otherwise false
   */
  isReady(e, t) {
    const r = e.getMaterial();
    if (r && r.disableDepthWrite)
      return !1;
    const n = [], i = [J.PositionKind, J.NormalKind], s = e.getMesh();
    if (r) {
      let l = !1;
      if (r.needAlphaTesting() && r.getAlphaTestTexture() && (n.push("#define ALPHATEST"), n.push(`#define ALPHATEST_UV${r.getAlphaTestTexture().coordinatesIndex + 1}`), l = !0), r.bumpTexture && Dt.BumpTextureEnabled && (n.push("#define BUMP"), n.push(`#define BUMP_UV${r.bumpTexture.coordinatesIndex + 1}`), l = !0), this._enableReflectivity) {
        let P = !1;
        r.getClassName() === "PBRMetallicRoughnessMaterial" ? (r.metallicRoughnessTexture !== null && (n.push("#define ORMTEXTURE"), n.push(`#define REFLECTIVITY_UV${r.metallicRoughnessTexture.coordinatesIndex + 1}`), n.push("#define METALLICWORKFLOW"), l = !0, P = !0), r.metallic !== null && (n.push("#define METALLIC"), n.push("#define METALLICWORKFLOW"), P = !0), r.roughness !== null && (n.push("#define ROUGHNESS"), n.push("#define METALLICWORKFLOW"), P = !0), P && (r.baseTexture !== null && (n.push("#define ALBEDOTEXTURE"), n.push(`#define ALBEDO_UV${r.baseTexture.coordinatesIndex + 1}`), r.baseTexture.gammaSpace && n.push("#define GAMMAALBEDO"), l = !0), r.baseColor !== null && n.push("#define ALBEDOCOLOR"))) : r.getClassName() === "PBRSpecularGlossinessMaterial" ? (r.specularGlossinessTexture !== null ? (n.push("#define SPECULARGLOSSINESSTEXTURE"), n.push(`#define REFLECTIVITY_UV${r.specularGlossinessTexture.coordinatesIndex + 1}`), l = !0, r.specularGlossinessTexture.gammaSpace && n.push("#define GAMMAREFLECTIVITYTEXTURE")) : r.specularColor !== null && n.push("#define REFLECTIVITYCOLOR"), r.glossiness !== null && n.push("#define GLOSSINESS")) : r.getClassName() === "PBRMaterial" ? (r.metallicTexture !== null && (n.push("#define ORMTEXTURE"), n.push(`#define REFLECTIVITY_UV${r.metallicTexture.coordinatesIndex + 1}`), n.push("#define METALLICWORKFLOW"), l = !0, P = !0), r.metallic !== null && (n.push("#define METALLIC"), n.push("#define METALLICWORKFLOW"), P = !0), r.roughness !== null && (n.push("#define ROUGHNESS"), n.push("#define METALLICWORKFLOW"), P = !0), P ? (r.albedoTexture !== null && (n.push("#define ALBEDOTEXTURE"), n.push(`#define ALBEDO_UV${r.albedoTexture.coordinatesIndex + 1}`), r.albedoTexture.gammaSpace && n.push("#define GAMMAALBEDO"), l = !0), r.albedoColor !== null && n.push("#define ALBEDOCOLOR")) : (r.reflectivityTexture !== null ? (n.push("#define SPECULARGLOSSINESSTEXTURE"), n.push(`#define REFLECTIVITY_UV${r.reflectivityTexture.coordinatesIndex + 1}`), r.reflectivityTexture.gammaSpace && n.push("#define GAMMAREFLECTIVITYTEXTURE"), l = !0) : r.reflectivityColor !== null && n.push("#define REFLECTIVITYCOLOR"), r.microSurface !== null && n.push("#define GLOSSINESS"))) : r.getClassName() === "StandardMaterial" && (r.specularTexture !== null && (n.push("#define REFLECTIVITYTEXTURE"), n.push(`#define REFLECTIVITY_UV${r.specularTexture.coordinatesIndex + 1}`), r.specularTexture.gammaSpace && n.push("#define GAMMAREFLECTIVITYTEXTURE"), l = !0), r.specularColor !== null && n.push("#define REFLECTIVITYCOLOR"));
      }
      l && (n.push("#define NEED_UV"), s.isVerticesDataPresent(J.UVKind) && (i.push(J.UVKind), n.push("#define UV1")), s.isVerticesDataPresent(J.UV2Kind) && (i.push(J.UV2Kind), n.push("#define UV2")));
    }
    this._linkedWithPrePass && (n.push("#define PREPASS"), this._depthIndex !== -1 && (n.push("#define DEPTH_INDEX " + this._depthIndex), n.push("#define PREPASS_DEPTH")), this._normalIndex !== -1 && (n.push("#define NORMAL_INDEX " + this._normalIndex), n.push("#define PREPASS_NORMAL"))), this._enablePosition && (n.push("#define POSITION"), n.push("#define POSITION_INDEX " + this._positionIndex)), this._enableVelocity && (n.push("#define VELOCITY"), n.push("#define VELOCITY_INDEX " + this._velocityIndex), this.excludedSkinnedMeshesFromVelocity.indexOf(s) === -1 && n.push("#define BONES_VELOCITY_ENABLED")), this._enableReflectivity && (n.push("#define REFLECTIVITY"), n.push("#define REFLECTIVITY_INDEX " + this._reflectivityIndex)), this.generateNormalsInWorldSpace && n.push("#define NORMAL_WORLDSPACE"), s.useBones && s.computeBonesUsingShaders && s.skeleton ? (i.push(J.MatricesIndicesKind), i.push(J.MatricesWeightsKind), s.numBoneInfluencers > 4 && (i.push(J.MatricesIndicesExtraKind), i.push(J.MatricesWeightsExtraKind)), n.push("#define NUM_BONE_INFLUENCERS " + s.numBoneInfluencers), n.push("#define BONETEXTURE " + s.skeleton.isUsingTextureForMatrices), n.push("#define BonesPerMesh " + (s.skeleton.bones.length + 1))) : (n.push("#define NUM_BONE_INFLUENCERS 0"), n.push("#define BONETEXTURE false"), n.push("#define BonesPerMesh 0"));
    const a = s.morphTargetManager;
    let f = 0;
    a && a.numInfluencers > 0 && (f = a.numInfluencers, n.push("#define MORPHTARGETS"), n.push("#define NUM_MORPH_INFLUENCERS " + f), a.isUsingTextureForTargets && n.push("#define MORPHTARGETS_TEXTURE"), Ye.PrepareAttributesForMorphTargetsInfluencers(i, s, f)), t && (n.push("#define INSTANCES"), Ye.PushAttributesForInstances(i, this._enableVelocity), e.getRenderingMesh().hasThinInstances && n.push("#define THIN_INSTANCES")), this._linkedWithPrePass ? n.push("#define RENDER_TARGET_COUNT " + this._attachmentsFromPrePass.length) : n.push("#define RENDER_TARGET_COUNT " + this._multiRenderTarget.textures.length), xq(r, this._scene, n);
    const o = this._scene.getEngine(), d = e._getDrawWrapper(void 0, !0), v = d.defines, u = n.join(`
`);
    return v !== u && d.setEffect(o.createEffect("geometry", {
      attributes: i,
      uniformsNames: tie,
      samplers: ["diffuseSampler", "bumpSampler", "reflectivitySampler", "albedoSampler", "morphTargets", "boneSampler"],
      defines: u,
      onCompiled: null,
      fallbacks: null,
      onError: null,
      uniformBuffersNames: ["Scene"],
      indexParameters: { buffersCount: this._multiRenderTarget.textures.length - 1, maxSimultaneousMorphTargets: f }
    }, o), u), d.effect.isReady();
  }
  /**
   * Gets the current underlying G Buffer.
   * @returns the buffer
   */
  getGBuffer() {
    return this._multiRenderTarget;
  }
  /**
   * Gets the number of samples used to render the buffer (anti aliasing).
   */
  get samples() {
    return this._multiRenderTarget.samples;
  }
  /**
   * Sets the number of samples used to render the buffer (anti aliasing).
   */
  set samples(e) {
    this._multiRenderTarget.samples = e;
  }
  /**
   * Disposes the renderer and frees up associated resources.
   */
  dispose() {
    this._resizeObserver && (this._scene.getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this.getGBuffer().dispose();
  }
  _assignRenderTargetIndices() {
    const e = [];
    let t = 2;
    return e.push("gBuffer_Depth", "gBuffer_Normal"), this._enablePosition && (this._positionIndex = t, t++, e.push("gBuffer_Position")), this._enableVelocity && (this._velocityIndex = t, t++, e.push("gBuffer_Velocity")), this._enableReflectivity && (this._reflectivityIndex = t, t++, e.push("gBuffer_Reflectivity")), [t, e];
  }
  _createRenderTargets() {
    const e = this._scene.getEngine(), [t, r] = this._assignRenderTargetIndices();
    let n = 0;
    e._caps.textureFloat && e._caps.textureFloatLinearFiltering ? n = 1 : e._caps.textureHalfFloat && e._caps.textureHalfFloatLinearFiltering && (n = 2);
    const i = this._ratioOrDimensions.width !== void 0 ? this._ratioOrDimensions : { width: e.getRenderWidth() * this._ratioOrDimensions, height: e.getRenderHeight() * this._ratioOrDimensions };
    if (this._multiRenderTarget = new Zx("gBuffer", i, t, this._scene, { generateMipMaps: !1, generateDepthTexture: !0, defaultType: n, depthTextureFormat: this._depthFormat }, r.concat("gBuffer_DepthBuffer")), !this.isSupported)
      return;
    this._multiRenderTarget.wrapU = We.CLAMP_ADDRESSMODE, this._multiRenderTarget.wrapV = We.CLAMP_ADDRESSMODE, this._multiRenderTarget.refreshRate = 1, this._multiRenderTarget.renderParticles = !1, this._multiRenderTarget.renderList = null;
    const s = [!0], a = [!1], f = [!0];
    for (let l = 1; l < t; ++l)
      s.push(!0), f.push(!1), a.push(!0);
    const o = e.buildTextureLayout(s), d = e.buildTextureLayout(a), v = e.buildTextureLayout(f);
    this._multiRenderTarget.onClearObservable.add((l) => {
      l.bindAttachments(this.useSpecificClearForDepthTexture ? d : o), l.clear(this._clearColor, !0, !0, !0), this.useSpecificClearForDepthTexture && (l.bindAttachments(v), l.clear(this._clearDepthColor, !0, !0, !0)), l.bindAttachments(o);
    }), this._resizeObserver = e.onResizeObservable.add(() => {
      if (this._multiRenderTarget) {
        const l = this._ratioOrDimensions.width !== void 0 ? this._ratioOrDimensions : { width: e.getRenderWidth() * this._ratioOrDimensions, height: e.getRenderHeight() * this._ratioOrDimensions };
        this._multiRenderTarget.resize(l);
      }
    });
    const u = (l) => {
      const P = l.getRenderingMesh(), p = l.getEffectiveMesh(), c = this._scene, H = c.getEngine(), T = l.getMaterial();
      if (!T)
        return;
      if (p._internalAbstractMeshDataInfo._isActiveIntermediate = !1, this._enableVelocity && !this._previousTransformationMatrices[p.uniqueId] && (this._previousTransformationMatrices[p.uniqueId] = {
        world: he.Identity(),
        viewProjection: c.getTransformMatrix()
      }, P.skeleton)) {
        const w = P.skeleton.getTransformMatrices(P);
        this._previousBonesTransformationMatrices[P.uniqueId] = this._copyBonesTransformationMatrices(w, new Float32Array(w.length));
      }
      const q = P._getInstancesRenderList(l._id, !!l.getReplacementMesh());
      if (q.mustReturn)
        return;
      const b = H.getCaps().instancedArrays && (q.visibleInstances[l._id] !== null || P.hasThinInstances), j = p.getWorldMatrix();
      if (this.isReady(l, b)) {
        const w = l._getDrawWrapper();
        if (!w)
          return;
        const m = w.effect;
        H.enableEffect(w), b || P._bind(l, m, T.fillMode), this._useUbo ? (Ye.BindSceneUniformBuffer(m, this._scene.getSceneUniformBuffer()), this._scene.finalizeSceneUbo()) : (m.setMatrix("viewProjection", c.getTransformMatrix()), m.setMatrix("view", c.getViewMatrix()));
        let I;
        const N = P._instanceDataStorage;
        if (!N.isFrozen && (T.backFaceCulling || P.overrideMaterialSideOrientation !== null)) {
          const k = p._getWorldMatrixDeterminant();
          I = P.overrideMaterialSideOrientation, I === null && (I = T.sideOrientation), k < 0 && (I = I === gt.ClockWiseSideOrientation ? gt.CounterClockWiseSideOrientation : gt.ClockWiseSideOrientation);
        } else
          I = N.sideOrientation;
        if (T._preBind(w, I), T.needAlphaTesting()) {
          const k = T.getAlphaTestTexture();
          k && (m.setTexture("diffuseSampler", k), m.setMatrix("diffuseMatrix", k.getTextureMatrix()));
        }
        if (T.bumpTexture && c.getEngine().getCaps().standardDerivatives && Dt.BumpTextureEnabled && (m.setFloat3("vBumpInfos", T.bumpTexture.coordinatesIndex, 1 / T.bumpTexture.level, T.parallaxScaleBias), m.setMatrix("bumpMatrix", T.bumpTexture.getTextureMatrix()), m.setTexture("bumpSampler", T.bumpTexture), m.setFloat2("vTangentSpaceParams", T.invertNormalMapX ? -1 : 1, T.invertNormalMapY ? -1 : 1)), this._enableReflectivity && (T.getClassName() === "PBRMetallicRoughnessMaterial" ? (T.metallicRoughnessTexture !== null && (m.setTexture("reflectivitySampler", T.metallicRoughnessTexture), m.setMatrix("reflectivityMatrix", T.metallicRoughnessTexture.getTextureMatrix())), T.metallic !== null && m.setFloat("metallic", T.metallic), T.roughness !== null && m.setFloat("glossiness", 1 - T.roughness), T.baseTexture !== null && (m.setTexture("albedoSampler", T.baseTexture), m.setMatrix("albedoMatrix", T.baseTexture.getTextureMatrix())), T.baseColor !== null && m.setColor3("albedoColor", T.baseColor)) : T.getClassName() === "PBRSpecularGlossinessMaterial" ? (T.specularGlossinessTexture !== null ? (m.setTexture("reflectivitySampler", T.specularGlossinessTexture), m.setMatrix("reflectivityMatrix", T.specularGlossinessTexture.getTextureMatrix())) : T.specularColor !== null && m.setColor3("reflectivityColor", T.specularColor), T.glossiness !== null && m.setFloat("glossiness", T.glossiness)) : T.getClassName() === "PBRMaterial" ? (T.metallicTexture !== null && (m.setTexture("reflectivitySampler", T.metallicTexture), m.setMatrix("reflectivityMatrix", T.metallicTexture.getTextureMatrix())), T.metallic !== null && m.setFloat("metallic", T.metallic), T.roughness !== null && m.setFloat("glossiness", 1 - T.roughness), T.roughness !== null || T.metallic !== null || T.metallicTexture !== null ? (T.albedoTexture !== null && (m.setTexture("albedoSampler", T.albedoTexture), m.setMatrix("albedoMatrix", T.albedoTexture.getTextureMatrix())), T.albedoColor !== null && m.setColor3("albedoColor", T.albedoColor)) : (T.reflectivityTexture !== null ? (m.setTexture("reflectivitySampler", T.reflectivityTexture), m.setMatrix("reflectivityMatrix", T.reflectivityTexture.getTextureMatrix())) : T.reflectivityColor !== null && m.setColor3("reflectivityColor", T.reflectivityColor), T.microSurface !== null && m.setFloat("glossiness", T.microSurface))) : T.getClassName() === "StandardMaterial" && (T.specularTexture !== null && (m.setTexture("reflectivitySampler", T.specularTexture), m.setMatrix("reflectivityMatrix", T.specularTexture.getTextureMatrix())), T.specularColor !== null && m.setColor3("reflectivityColor", T.specularColor))), Df(m, T, this._scene), P.useBones && P.computeBonesUsingShaders && P.skeleton) {
          const k = P.skeleton;
          if (k.isUsingTextureForMatrices && m.getUniformIndex("boneTextureWidth") > -1) {
            const R = k.getTransformMatrixTexture(P);
            m.setTexture("boneSampler", R), m.setFloat("boneTextureWidth", 4 * (k.bones.length + 1));
          } else
            m.setMatrices("mBones", P.skeleton.getTransformMatrices(P));
          this._enableVelocity && m.setMatrices("mPreviousBones", this._previousBonesTransformationMatrices[P.uniqueId]);
        }
        Ye.BindMorphTargetParameters(P, m), P.morphTargetManager && P.morphTargetManager.isUsingTextureForTargets && P.morphTargetManager._bind(m), this._enableVelocity && (m.setMatrix("previousWorld", this._previousTransformationMatrices[p.uniqueId].world), m.setMatrix("previousViewProjection", this._previousTransformationMatrices[p.uniqueId].viewProjection)), b && P.hasThinInstances && m.setMatrix("world", j), P._processRendering(p, l, m, T.fillMode, q, b, (k, R) => {
          k || m.setMatrix("world", R);
        });
      }
      this._enableVelocity && (this._previousTransformationMatrices[p.uniqueId].world = j.clone(), this._previousTransformationMatrices[p.uniqueId].viewProjection = this._scene.getTransformMatrix().clone(), P.skeleton && this._copyBonesTransformationMatrices(P.skeleton.getTransformMatrices(P), this._previousBonesTransformationMatrices[p.uniqueId]));
    };
    this._multiRenderTarget.customIsReadyFunction = (l, P, p) => {
      if ((p || P === 0) && l.subMeshes)
        for (let c = 0; c < l.subMeshes.length; ++c) {
          const H = l.subMeshes[c], T = H.getMaterial(), q = H.getRenderingMesh();
          if (!T)
            continue;
          const b = q._getInstancesRenderList(H._id, !!H.getReplacementMesh()), j = e.getCaps().instancedArrays && (b.visibleInstances[H._id] !== null || q.hasThinInstances);
          if (!this.isReady(H, j))
            return !1;
        }
      return !0;
    }, this._multiRenderTarget.customRenderFunction = (l, P, p, c) => {
      let H;
      if (this._linkedWithPrePass) {
        if (!this._prePassRenderer.enabled)
          return;
        this._scene.getEngine().bindAttachments(this._attachmentsFromPrePass);
      }
      if (c.length) {
        for (e.setColorWrite(!1), H = 0; H < c.length; H++)
          u(c.data[H]);
        e.setColorWrite(!0);
      }
      for (H = 0; H < l.length; H++)
        u(l.data[H]);
      for (e.setDepthWrite(!1), H = 0; H < P.length; H++)
        u(P.data[H]);
      if (this.renderTransparentMeshes)
        for (H = 0; H < p.length; H++)
          u(p.data[H]);
      e.setDepthWrite(!0);
    };
  }
  // Copies the bones transformation matrices into the target array and returns the target's reference
  _copyBonesTransformationMatrices(e, t) {
    for (let r = 0; r < e.length; r++)
      t[r] = e[r];
    return t;
  }
}
po.DEPTH_TEXTURE_TYPE = 0;
po.NORMAL_TEXTURE_TYPE = 1;
po.POSITION_TEXTURE_TYPE = 2;
po.VELOCITY_TEXTURE_TYPE = 3;
po.REFLECTIVITY_TEXTURE_TYPE = 4;
po._SceneComponentInitialization = (A) => {
  throw qn("GeometryBufferRendererSceneComponent");
};
class $0e {
  constructor() {
    this.enabled = !1, this.name = "motionBlur", this.texturesRequired = [2];
  }
}
Object.defineProperty(sr.prototype, "geometryBufferRenderer", {
  get: function() {
    return this._geometryBufferRenderer;
  },
  set: function(A) {
    A && A.isSupported && (this._geometryBufferRenderer = A);
  },
  enumerable: !0,
  configurable: !0
});
sr.prototype.enableGeometryBufferRenderer = function(A = 1, e = 15) {
  return this._geometryBufferRenderer ? this._geometryBufferRenderer : (this._geometryBufferRenderer = new po(this, A, e), this._geometryBufferRenderer.isSupported || (this._geometryBufferRenderer = null), this._geometryBufferRenderer);
};
sr.prototype.disableGeometryBufferRenderer = function() {
  this._geometryBufferRenderer && (this._geometryBufferRenderer.dispose(), this._geometryBufferRenderer = null);
};
class rie {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_GEOMETRYBUFFERRENDERER, this.scene = e;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._gatherRenderTargetsStage.registerStep(Ot.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER, this, this._gatherRenderTargets);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources
   */
  dispose() {
  }
  _gatherRenderTargets(e) {
    this.scene._geometryBufferRenderer && e.push(this.scene._geometryBufferRenderer.getGBuffer());
  }
}
po._SceneComponentInitialization = (A) => {
  let e = A._getComponent(Ot.NAME_GEOMETRYBUFFERRENDERER);
  e || (e = new rie(A), A._addComponent(e));
};
const e7e = "motionBlurPixelShader", t7e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float motionStrength;uniform float motionScale;uniform vec2 screenSize;
#ifdef OBJECT_BASED
uniform sampler2D velocitySampler;
#else
uniform sampler2D depthSampler;uniform mat4 inverseViewProjection;uniform mat4 prevViewProjection;uniform mat4 projection;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#ifdef GEOMETRY_SUPPORTED
#ifdef OBJECT_BASED
vec2 texelSize=1.0/screenSize;vec4 velocityColor=texture2D(velocitySampler,vUV);velocityColor.rg=velocityColor.rg*2.0-vec2(1.0);vec2 velocity=vec2(pow(velocityColor.r,3.0),pow(velocityColor.g,3.0))*velocityColor.a;velocity*=motionScale*motionStrength;float speed=length(velocity/texelSize);int samplesCount=int(clamp(speed,1.0,SAMPLES));velocity=normalize(velocity)*texelSize;float hlim=float(-samplesCount)*0.5+0.5;vec4 result=texture2D(textureSampler,vUV);for (int i=1; i<int(SAMPLES); ++i)
{if (i>=samplesCount)
break;vec2 offset=vUV+velocity*(hlim+float(i));
#if defined(WEBGPU)
result+=texture2DLodEXT(textureSampler,offset,0.0);
#else
result+=texture2D(textureSampler,offset);
#endif
}
gl_FragColor=result/float(samplesCount);gl_FragColor.a=1.0;
#else
vec2 texelSize=1.0/screenSize;float depth=texture2D(depthSampler,vUV).r;depth=projection[2].z+projection[3].z/depth; 
vec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);cpos=inverseViewProjection*cpos;cpos/=cpos.w;vec4 ppos=prevViewProjection*cpos;ppos/=ppos.w;ppos.xy=ppos.xy*0.5+0.5;vec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;float speed=length(velocity/texelSize);int nSamples=int(clamp(speed,1.0,SAMPLES));vec4 result=texture2D(textureSampler,vUV);for (int i=1; i<int(SAMPLES); ++i) {if (i>=nSamples)
break;vec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);
#if defined(WEBGPU)
result+=texture2DLodEXT(textureSampler,offset1,0.0);
#else
result+=texture2D(textureSampler,offset1);
#endif
}
gl_FragColor=result/float(nSamples);
#endif
#else
gl_FragColor=texture2D(textureSampler,vUV);
#endif
}
`;
Le.ShadersStore[e7e] = t7e;
class BD extends kr {
  /**
   * Gets the number of iterations are used for motion blur quality. Default value is equal to 32
   */
  get motionBlurSamples() {
    return this._motionBlurSamples;
  }
  /**
   * Sets the number of iterations to be used for motion blur quality
   */
  set motionBlurSamples(e) {
    this._motionBlurSamples = e, this._updateEffect();
  }
  /**
   * Gets whether or not the motion blur post-process is in object based mode.
   */
  get isObjectBased() {
    return this._isObjectBased;
  }
  /**
   * Sets whether or not the motion blur post-process is in object based mode.
   */
  set isObjectBased(e) {
    this._isObjectBased !== e && (this._isObjectBased = e, this._applyMode());
  }
  get _geometryBufferRenderer() {
    return this._forceGeometryBuffer ? this._scene.geometryBufferRenderer : null;
  }
  get _prePassRenderer() {
    return this._forceGeometryBuffer ? null : this._scene.prePassRenderer;
  }
  /**
   * Gets a string identifying the name of the class
   * @returns "MotionBlurPostProcess" string
   */
  getClassName() {
    return "MotionBlurPostProcess";
  }
  /**
   * Creates a new instance MotionBlurPostProcess
   * @param name The name of the effect.
   * @param scene The scene containing the objects to blur according to their velocity.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: true)
   * @param forceGeometryBuffer If this post process should use geometry buffer instead of prepass (default: false)
   */
  constructor(e, t, r, n, i, s, a, f = 0, o = !1, d = !1) {
    super(e, "motionBlur", ["motionStrength", "motionScale", "screenSize", "inverseViewProjection", "prevViewProjection", "projection"], ["velocitySampler", "depthSampler"], r, n, i, s, a, `#define GEOMETRY_SUPPORTED
#define SAMPLES 64.0
#define OBJECT_BASED`, f, void 0, null, o), this.motionStrength = 1, this._motionBlurSamples = 32, this._isObjectBased = !0, this._forceGeometryBuffer = !1, this._invViewProjection = null, this._previousViewProjection = null, this._forceGeometryBuffer = d, this._forceGeometryBuffer ? (t.enableGeometryBufferRenderer(), this._geometryBufferRenderer && (this._geometryBufferRenderer.enableVelocity = this._isObjectBased)) : (t.enablePrePassRenderer(), this._prePassRenderer && (this._prePassRenderer.markAsDirty(), this._prePassEffectConfiguration = new $0e())), this._applyMode();
  }
  /**
   * Excludes the given skinned mesh from computing bones velocities.
   * Computing bones velocities can have a cost and that cost. The cost can be saved by calling this function and by passing the skinned mesh reference to ignore.
   * @param skinnedMesh The mesh containing the skeleton to ignore when computing the velocity map.
   */
  excludeSkinnedMesh(e) {
    if (e.skeleton) {
      let t;
      if (this._geometryBufferRenderer)
        t = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;
      else if (this._prePassRenderer)
        t = this._prePassRenderer.excludedSkinnedMesh;
      else
        return;
      t.push(e);
    }
  }
  /**
   * Removes the given skinned mesh from the excluded meshes to integrate bones velocities while rendering the velocity map.
   * @param skinnedMesh The mesh containing the skeleton that has been ignored previously.
   * @see excludeSkinnedMesh to exclude a skinned mesh from bones velocity computation.
   */
  removeExcludedSkinnedMesh(e) {
    if (e.skeleton) {
      let t;
      if (this._geometryBufferRenderer)
        t = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;
      else if (this._prePassRenderer)
        t = this._prePassRenderer.excludedSkinnedMesh;
      else
        return;
      const r = t.indexOf(e);
      r !== -1 && t.splice(r, 1);
    }
  }
  /**
   * Disposes the post process.
   * @param camera The camera to dispose the post process on.
   */
  dispose(e) {
    this._geometryBufferRenderer && (this._geometryBufferRenderer._previousTransformationMatrices = {}, this._geometryBufferRenderer._previousBonesTransformationMatrices = {}, this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity = []), super.dispose(e);
  }
  /**
   * Called on the mode changed (object based or screen based).
   */
  _applyMode() {
    if (!this._geometryBufferRenderer && !this._prePassRenderer)
      return Se.Warn("Multiple Render Target support needed to compute object based motion blur"), this.updateEffect();
    this._geometryBufferRenderer && (this._geometryBufferRenderer.enableVelocity = this._isObjectBased), this._updateEffect(), this._invViewProjection = null, this._previousViewProjection = null, this.isObjectBased ? (this._prePassRenderer && this._prePassEffectConfiguration && (this._prePassEffectConfiguration.texturesRequired[0] = 2), this.onApply = (e) => this._onApplyObjectBased(e)) : (this._invViewProjection = he.Identity(), this._previousViewProjection = this._scene.getTransformMatrix().clone(), this._prePassRenderer && this._prePassEffectConfiguration && (this._prePassEffectConfiguration.texturesRequired[0] = 5), this.onApply = (e) => this._onApplyScreenBased(e));
  }
  /**
   * Called on the effect is applied when the motion blur post-process is in object based mode.
   * @param effect
   */
  _onApplyObjectBased(e) {
    if (e.setVector2("screenSize", new at(this.width, this.height)), e.setFloat("motionScale", this._scene.getAnimationRatio()), e.setFloat("motionStrength", this.motionStrength), this._geometryBufferRenderer) {
      const t = this._geometryBufferRenderer.getTextureIndex(po.VELOCITY_TEXTURE_TYPE);
      e.setTexture("velocitySampler", this._geometryBufferRenderer.getGBuffer().textures[t]);
    } else if (this._prePassRenderer) {
      const t = this._prePassRenderer.getIndex(2);
      e.setTexture("velocitySampler", this._prePassRenderer.getRenderTarget().textures[t]);
    }
  }
  /**
   * Called on the effect is applied when the motion blur post-process is in screen based mode.
   * @param effect
   */
  _onApplyScreenBased(e) {
    const t = ue.Matrix[0];
    if (t.copyFrom(this._scene.getTransformMatrix()), t.invertToRef(this._invViewProjection), e.setMatrix("inverseViewProjection", this._invViewProjection), e.setMatrix("prevViewProjection", this._previousViewProjection), this._previousViewProjection.copyFrom(t), e.setMatrix("projection", this._scene.getProjectionMatrix()), e.setVector2("screenSize", new at(this.width, this.height)), e.setFloat("motionScale", this._scene.getAnimationRatio()), e.setFloat("motionStrength", this.motionStrength), this._geometryBufferRenderer) {
      const r = this._geometryBufferRenderer.getTextureIndex(po.DEPTH_TEXTURE_TYPE);
      e.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[r]);
    } else if (this._prePassRenderer) {
      const r = this._prePassRenderer.getIndex(5);
      e.setTexture("depthSampler", this._prePassRenderer.getRenderTarget().textures[r]);
    }
  }
  /**
   * Called on the effect must be updated (changed mode, samples count, etc.).
   */
  _updateEffect() {
    if (this._geometryBufferRenderer || this._prePassRenderer) {
      const e = [
        "#define GEOMETRY_SUPPORTED",
        "#define SAMPLES " + this._motionBlurSamples.toFixed(1),
        this._isObjectBased ? "#define OBJECT_BASED" : "#define SCREEN_BASED"
      ];
      this.updateEffect(e.join(`
`));
    }
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new BD(e.name, r, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable, e.textureType, !1), e, r, n);
  }
}
C([
  M()
], BD.prototype, "motionStrength", void 0);
C([
  M()
], BD.prototype, "motionBlurSamples", null);
C([
  M()
], BD.prototype, "isObjectBased", null);
Ue("BABYLON.MotionBlurPostProcess", BD);
const r7e = "refractionPixelShader", n7e = "varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D refractionSampler;uniform vec3 baseColor;uniform float depth;uniform float colorLevel;void main() {float ref=1.0-texture2D(refractionSampler,vUV).r;vec2 uv=vUV-vec2(0.5);vec2 offset=uv*depth*ref;vec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;gl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);}";
Le.ShadersStore[r7e] = n7e;
class WD extends kr {
  /**
   * Gets or sets the refraction texture
   * Please note that you are responsible for disposing the texture if you set it manually
   */
  get refractionTexture() {
    return this._refTexture;
  }
  set refractionTexture(e) {
    this._refTexture && this._ownRefractionTexture && this._refTexture.dispose(), this._refTexture = e, this._ownRefractionTexture = !1;
  }
  /**
   * Gets a string identifying the name of the class
   * @returns "RefractionPostProcess" string
   */
  getClassName() {
    return "RefractionPostProcess";
  }
  /**
   * Initializes the RefractionPostProcess
   * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#refraction
   * @param name The name of the effect.
   * @param refractionTextureUrl Url of the refraction texture to use
   * @param color the base color of the refraction (used to taint the rendering)
   * @param depth simulated refraction depth
   * @param colorLevel the coefficient of the base color (0 to remove base color tainting)
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   */
  constructor(e, t, r, n, i, s, a, f, o, d) {
    super(e, "refraction", ["baseColor", "depth", "colorLevel"], ["refractionSampler"], s, a, f, o, d), this._ownRefractionTexture = !0, this.color = r, this.depth = n, this.colorLevel = i, this.refractionTextureUrl = t, this.onActivateObservable.add((v) => {
      this._refTexture = this._refTexture || new We(t, v.getScene());
    }), this.onApplyObservable.add((v) => {
      v.setColor3("baseColor", this.color), v.setFloat("depth", this.depth), v.setFloat("colorLevel", this.colorLevel), v.setTexture("refractionSampler", this._refTexture);
    });
  }
  // Methods
  /**
   * Disposes of the post process
   * @param camera Camera to dispose post process on
   */
  dispose(e) {
    this._refTexture && this._ownRefractionTexture && (this._refTexture.dispose(), this._refTexture = null), super.dispose(e);
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new WD(e.name, e.refractionTextureUrl, e.color, e.depth, e.colorLevel, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.reusable), e, r, n);
  }
}
C([
  M()
], WD.prototype, "color", void 0);
C([
  M()
], WD.prototype, "depth", void 0);
C([
  M()
], WD.prototype, "colorLevel", void 0);
C([
  M()
], WD.prototype, "refractionTextureUrl", void 0);
Ue("BABYLON.RefractionPostProcess", WD);
const i7e = "sharpenPixelShader", s7e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 sharpnessAmounts;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec2 onePixel=vec2(1.0,1.0)/screenSize;vec4 color=texture2D(textureSampler,vUV);vec4 edgeDetection=texture2D(textureSampler,vUV+onePixel*vec2(0,-1)) +
texture2D(textureSampler,vUV+onePixel*vec2(-1,0)) +
texture2D(textureSampler,vUV+onePixel*vec2(1,0)) +
texture2D(textureSampler,vUV+onePixel*vec2(0,1)) -
color*4.0;gl_FragColor=max(vec4(color.rgb*sharpnessAmounts.y,color.a)-(sharpnessAmounts.x*vec4(edgeDetection.rgb,0)),0.);}`;
Le.ShadersStore[i7e] = s7e;
class Em extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "SharpenPostProcess" string
   */
  getClassName() {
    return "SharpenPostProcess";
  }
  /**
   * Creates a new instance ConvolutionPostProcess
   * @param name The name of the effect.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r, n, i, s, a = 0, f = !1) {
    super(e, "sharpen", ["sharpnessAmounts", "screenSize"], null, t, r, n, i, s, null, a, void 0, null, f), this.colorAmount = 1, this.edgeAmount = 0.3, this.onApply = (o) => {
      o.setFloat2("screenSize", this.width, this.height), o.setFloat2("sharpnessAmounts", this.edgeAmount, this.colorAmount);
    };
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new Em(e.name, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.textureType, e.reusable), e, r, n);
  }
}
C([
  M()
], Em.prototype, "colorAmount", void 0);
C([
  M()
], Em.prototype, "edgeAmount", void 0);
Ue("BABYLON.SharpenPostProcess", Em);
class SD {
  /**
   * Gets pipeline name
   */
  get name() {
    return this._name;
  }
  /** Gets the list of attached cameras */
  get cameras() {
    return this._cameras;
  }
  /**
   * Initializes a PostProcessRenderPipeline
   * @param _engine engine to add the pipeline to
   * @param name name of the pipeline
   */
  constructor(e, t) {
    this._engine = e, this._name = t, this._renderEffects = {}, this._renderEffectsForIsolatedPass = new Array(), this._cameras = [];
  }
  /**
   * Gets the class name
   * @returns "PostProcessRenderPipeline"
   */
  getClassName() {
    return "PostProcessRenderPipeline";
  }
  /**
   * If all the render effects in the pipeline are supported
   */
  get isSupported() {
    for (const e in this._renderEffects)
      if (Object.prototype.hasOwnProperty.call(this._renderEffects, e) && !this._renderEffects[e].isSupported)
        return !1;
    return !0;
  }
  /**
   * Adds an effect to the pipeline
   * @param renderEffect the effect to add
   */
  addEffect(e) {
    this._renderEffects[e._name] = e;
  }
  // private
  /** @internal */
  _rebuild() {
  }
  /**
   * @internal
   */
  _enableEffect(e, t) {
    const r = this._renderEffects[e];
    r && r._enable(ye.MakeArray(t || this._cameras));
  }
  /**
   * @internal
   */
  _disableEffect(e, t) {
    const r = this._renderEffects[e];
    r && r._disable(ye.MakeArray(t || this._cameras));
  }
  /**
   * @internal
   */
  _attachCameras(e, t) {
    const r = ye.MakeArray(e || this._cameras);
    if (!r)
      return;
    const n = [];
    let i;
    for (i = 0; i < r.length; i++) {
      const s = r[i];
      s && (this._cameras.indexOf(s) === -1 ? this._cameras.push(s) : t && n.push(i));
    }
    for (i = 0; i < n.length; i++)
      r.splice(n[i], 1);
    for (const s in this._renderEffects)
      Object.prototype.hasOwnProperty.call(this._renderEffects, s) && this._renderEffects[s]._attachCameras(r);
  }
  /**
   * @internal
   */
  _detachCameras(e) {
    const t = ye.MakeArray(e || this._cameras);
    if (t) {
      for (const r in this._renderEffects)
        Object.prototype.hasOwnProperty.call(this._renderEffects, r) && this._renderEffects[r]._detachCameras(t);
      for (let r = 0; r < t.length; r++)
        this._cameras.splice(this._cameras.indexOf(t[r]), 1);
    }
  }
  /** @internal */
  _update() {
    for (const e in this._renderEffects)
      Object.prototype.hasOwnProperty.call(this._renderEffects, e) && this._renderEffects[e]._update();
    for (let e = 0; e < this._cameras.length; e++) {
      if (!this._cameras[e])
        continue;
      const t = this._cameras[e].name;
      this._renderEffectsForIsolatedPass[t] && this._renderEffectsForIsolatedPass[t]._update();
    }
  }
  /** @internal */
  _reset() {
    this._renderEffects = {}, this._renderEffectsForIsolatedPass = new Array();
  }
  _enableMSAAOnFirstPostProcess(e) {
    if (!this._engine._features.supportMSAA)
      return !1;
    const t = Object.keys(this._renderEffects);
    if (t.length > 0) {
      const r = this._renderEffects[t[0]].getPostProcesses();
      r && (r[0].samples = e);
    }
    return !0;
  }
  /**
   * Ensures that all post processes in the pipeline are the correct size according to the
   * the viewport's required size
   */
  _adaptPostProcessesToViewPort() {
    const e = Object.keys(this._renderEffects);
    for (const t of e) {
      const r = this._renderEffects[t].getPostProcesses();
      if (r)
        for (const n of r)
          n.adaptScaleToCurrentViewport = !0;
    }
  }
  /**
   * Sets the required values to the prepass renderer.
   * @param prePassRenderer defines the prepass renderer to setup.
   * @returns true if the pre pass is needed.
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  setPrePassRenderer(e) {
    return !1;
  }
  /**
   * Disposes of the pipeline
   */
  dispose() {
  }
}
C([
  M()
], SD.prototype, "_name", void 0);
class nie {
  /**
   * Initializes a PostProcessRenderPipelineManager
   * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/postProcessRenderPipeline
   */
  constructor() {
    this._renderPipelines = {};
  }
  /**
   * Gets the list of supported render pipelines
   */
  get supportedPipelines() {
    const e = [];
    for (const t in this._renderPipelines)
      if (Object.prototype.hasOwnProperty.call(this._renderPipelines, t)) {
        const r = this._renderPipelines[t];
        r.isSupported && e.push(r);
      }
    return e;
  }
  /**
   * Adds a pipeline to the manager
   * @param renderPipeline The pipeline to add
   */
  addPipeline(e) {
    this._renderPipelines[e._name] = e;
  }
  /**
   * Remove the pipeline from the manager
   * @param renderPipelineName the name of the pipeline to remove
   */
  removePipeline(e) {
    delete this._renderPipelines[e];
  }
  /**
   * Attaches a camera to the pipeline
   * @param renderPipelineName The name of the pipeline to attach to
   * @param cameras the camera to attach
   * @param unique if the camera can be attached multiple times to the pipeline
   */
  attachCamerasToRenderPipeline(e, t, r = !1) {
    const n = this._renderPipelines[e];
    n && n._attachCameras(t, r);
  }
  /**
   * Detaches a camera from the pipeline
   * @param renderPipelineName The name of the pipeline to detach from
   * @param cameras the camera to detach
   */
  detachCamerasFromRenderPipeline(e, t) {
    const r = this._renderPipelines[e];
    r && r._detachCameras(t);
  }
  /**
   * Enables an effect by name on a pipeline
   * @param renderPipelineName the name of the pipeline to enable the effect in
   * @param renderEffectName the name of the effect to enable
   * @param cameras the cameras that the effect should be enabled on
   */
  enableEffectInPipeline(e, t, r) {
    const n = this._renderPipelines[e];
    n && n._enableEffect(t, r);
  }
  /**
   * Disables an effect by name on a pipeline
   * @param renderPipelineName the name of the pipeline to disable the effect in
   * @param renderEffectName the name of the effect to disable
   * @param cameras the cameras that the effect should be disabled on
   */
  disableEffectInPipeline(e, t, r) {
    const n = this._renderPipelines[e];
    n && n._disableEffect(t, r);
  }
  /**
   * Updates the state of all contained render pipelines and disposes of any non supported pipelines
   */
  update() {
    for (const e in this._renderPipelines)
      if (Object.prototype.hasOwnProperty.call(this._renderPipelines, e)) {
        const t = this._renderPipelines[e];
        t.isSupported ? t._update() : (t.dispose(), delete this._renderPipelines[e]);
      }
  }
  /** @internal */
  _rebuild() {
    for (const e in this._renderPipelines)
      Object.prototype.hasOwnProperty.call(this._renderPipelines, e) && this._renderPipelines[e]._rebuild();
  }
  /**
   * Disposes of the manager and pipelines
   */
  dispose() {
    for (const e in this._renderPipelines)
      Object.prototype.hasOwnProperty.call(this._renderPipelines, e) && this._renderPipelines[e].dispose();
  }
}
Object.defineProperty(sr.prototype, "postProcessRenderPipelineManager", {
  get: function() {
    if (!this._postProcessRenderPipelineManager) {
      let A = this._getComponent(Ot.NAME_POSTPROCESSRENDERPIPELINEMANAGER);
      A || (A = new iie(this), this._addComponent(A)), this._postProcessRenderPipelineManager = new nie();
    }
    return this._postProcessRenderPipelineManager;
  },
  enumerable: !0,
  configurable: !0
});
class iie {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_POSTPROCESSRENDERPIPELINEMANAGER, this.scene = e;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._gatherRenderTargetsStage.registerStep(Ot.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER, this, this._gatherRenderTargets);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
    this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager._rebuild();
  }
  /**
   * Disposes the component and the associated resources
   */
  dispose() {
    this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager.dispose();
  }
  _gatherRenderTargets() {
    this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager.update();
  }
}
class K9 extends SD {
  /**
   * Enable or disable automatic building of the pipeline when effects are enabled and disabled.
   * If false, you will have to manually call prepare() to update the pipeline.
   */
  get automaticBuild() {
    return this._buildAllowed;
  }
  set automaticBuild(e) {
    this._buildAllowed = e;
  }
  /**
   * Gets active scene
   */
  get scene() {
    return this._scene;
  }
  /**
   * Enable or disable the sharpen process from the pipeline
   */
  set sharpenEnabled(e) {
    this._sharpenEnabled !== e && (this._sharpenEnabled = e, this._buildPipeline());
  }
  get sharpenEnabled() {
    return this._sharpenEnabled;
  }
  /**
   * Specifies the size of the bloom blur kernel, relative to the final output size
   */
  get bloomKernel() {
    return this._bloomKernel;
  }
  set bloomKernel(e) {
    this._bloomKernel = e, this.bloom.kernel = e / this._hardwareScaleLevel;
  }
  /**
   * The strength of the bloom.
   */
  set bloomWeight(e) {
    this._bloomWeight !== e && (this.bloom.weight = e, this._bloomWeight = e);
  }
  get bloomWeight() {
    return this._bloomWeight;
  }
  /**
   * The luminance threshold to find bright areas of the image to bloom.
   */
  set bloomThreshold(e) {
    this._bloomThreshold !== e && (this.bloom.threshold = e, this._bloomThreshold = e);
  }
  get bloomThreshold() {
    return this._bloomThreshold;
  }
  /**
   * The scale of the bloom, lower value will provide better performance.
   */
  set bloomScale(e) {
    this._bloomScale !== e && (this._bloomScale = e, this._rebuildBloom(), this._buildPipeline());
  }
  get bloomScale() {
    return this._bloomScale;
  }
  /**
   * Enable or disable the bloom from the pipeline
   */
  set bloomEnabled(e) {
    this._bloomEnabled !== e && (this._bloomEnabled = e, this._buildPipeline());
  }
  get bloomEnabled() {
    return this._bloomEnabled;
  }
  _rebuildBloom() {
    const e = this.bloom;
    this.bloom = new DF(this._scene, this.bloomScale, this._bloomWeight, this.bloomKernel / this._hardwareScaleLevel, this._defaultPipelineTextureType, !1), this.bloom.threshold = e.threshold;
    for (let t = 0; t < this._cameras.length; t++)
      e.disposeEffects(this._cameras[t]);
  }
  /**
   * If the depth of field is enabled.
   */
  get depthOfFieldEnabled() {
    return this._depthOfFieldEnabled;
  }
  set depthOfFieldEnabled(e) {
    this._depthOfFieldEnabled !== e && (this._depthOfFieldEnabled = e, this._buildPipeline());
  }
  /**
   * Blur level of the depth of field effect. (Higher blur will effect performance)
   */
  get depthOfFieldBlurLevel() {
    return this._depthOfFieldBlurLevel;
  }
  set depthOfFieldBlurLevel(e) {
    if (this._depthOfFieldBlurLevel === e)
      return;
    this._depthOfFieldBlurLevel = e;
    const t = this.depthOfField;
    this.depthOfField = new jF(this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, !1), this.depthOfField.focalLength = t.focalLength, this.depthOfField.focusDistance = t.focusDistance, this.depthOfField.fStop = t.fStop, this.depthOfField.lensSize = t.lensSize;
    for (let r = 0; r < this._cameras.length; r++)
      t.disposeEffects(this._cameras[r]);
    this._buildPipeline();
  }
  /**
   * If the anti aliasing is enabled.
   */
  set fxaaEnabled(e) {
    this._fxaaEnabled !== e && (this._fxaaEnabled = e, this._buildPipeline());
  }
  get fxaaEnabled() {
    return this._fxaaEnabled;
  }
  /**
   * MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)
   */
  set samples(e) {
    this._samples !== e && (this._samples = e, this._buildPipeline());
  }
  get samples() {
    return this._samples;
  }
  /**
   * If image processing is enabled.
   */
  set imageProcessingEnabled(e) {
    this._imageProcessingEnabled !== e && (this._scene.imageProcessingConfiguration.isEnabled = e);
  }
  get imageProcessingEnabled() {
    return this._imageProcessingEnabled;
  }
  /**
   * If glow layer is enabled. (Adds a glow effect to emmissive materials)
   */
  set glowLayerEnabled(e) {
    e && !this._glowLayer ? this._glowLayer = new zl("", this._scene) : !e && this._glowLayer && (this._glowLayer.dispose(), this._glowLayer = null);
  }
  get glowLayerEnabled() {
    return this._glowLayer != null;
  }
  /**
   * Gets the glow layer (or null if not defined)
   */
  get glowLayer() {
    return this._glowLayer;
  }
  /**
   * Enable or disable the chromaticAberration process from the pipeline
   */
  set chromaticAberrationEnabled(e) {
    this._chromaticAberrationEnabled !== e && (this._chromaticAberrationEnabled = e, this._buildPipeline());
  }
  get chromaticAberrationEnabled() {
    return this._chromaticAberrationEnabled;
  }
  /**
   * Enable or disable the grain process from the pipeline
   */
  set grainEnabled(e) {
    this._grainEnabled !== e && (this._grainEnabled = e, this._buildPipeline());
  }
  get grainEnabled() {
    return this._grainEnabled;
  }
  /**
   * Instantiates a DefaultRenderingPipeline.
   * @param name The rendering pipeline name (default: "")
   * @param hdr If high dynamic range textures should be used (default: true)
   * @param scene The scene linked to this pipeline (default: the last created scene)
   * @param cameras The array of cameras that the rendering pipeline will be attached to (default: scene.cameras)
   * @param automaticBuild If false, you will have to manually call prepare() to update the pipeline (default: true)
   */
  constructor(e = "", t = !0, r = gr.LastCreatedScene, n, i = !0) {
    super(r.getEngine(), e), this._camerasToBeAttached = [], this.SharpenPostProcessId = "SharpenPostProcessEffect", this.ImageProcessingPostProcessId = "ImageProcessingPostProcessEffect", this.FxaaPostProcessId = "FxaaPostProcessEffect", this.ChromaticAberrationPostProcessId = "ChromaticAberrationPostProcessEffect", this.GrainPostProcessId = "GrainPostProcessEffect", this._glowLayer = null, this.animations = [], this._imageProcessingConfigurationObserver = null, this._sharpenEnabled = !1, this._bloomEnabled = !1, this._depthOfFieldEnabled = !1, this._depthOfFieldBlurLevel = am.Low, this._fxaaEnabled = !1, this._imageProcessingEnabled = !0, this._bloomScale = 0.5, this._chromaticAberrationEnabled = !1, this._grainEnabled = !1, this._buildAllowed = !0, this.onBuildObservable = new Oe(), this._resizeObserver = null, this._hardwareScaleLevel = 1, this._bloomKernel = 64, this._bloomWeight = 0.15, this._bloomThreshold = 0.9, this._samples = 1, this._hasCleared = !1, this._prevPostProcess = null, this._prevPrevPostProcess = null, this._depthOfFieldSceneObserver = null, this._activeCameraChangedObserver = null, this._activeCamerasChangedObserver = null, this._cameras = n || r.cameras, this._cameras = this._cameras.slice(), this._camerasToBeAttached = this._cameras.slice(), this._buildAllowed = i, this._scene = r;
    const s = this._scene.getEngine().getCaps();
    this._hdr = t && (s.textureHalfFloatRender || s.textureFloatRender), this._hdr ? s.textureHalfFloatRender ? this._defaultPipelineTextureType = 2 : s.textureFloatRender && (this._defaultPipelineTextureType = 1) : this._defaultPipelineTextureType = 0, r.postProcessRenderPipelineManager.addPipeline(this);
    const a = this._scene.getEngine();
    this.sharpen = new Em("sharpen", 1, null, We.BILINEAR_SAMPLINGMODE, a, !1, this._defaultPipelineTextureType, !0), this._sharpenEffect = new gs(a, this.SharpenPostProcessId, () => this.sharpen, !0), this.depthOfField = new jF(this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, !0), this._hardwareScaleLevel = a.getHardwareScalingLevel(), this._resizeObserver = a.onResizeObservable.add(() => {
      this._hardwareScaleLevel = a.getHardwareScalingLevel(), this.bloomKernel = this._bloomKernel;
    }), this.bloom = new DF(this._scene, this._bloomScale, this._bloomWeight, this.bloomKernel / this._hardwareScaleLevel, this._defaultPipelineTextureType, !0), this.chromaticAberration = new Pg("ChromaticAberration", a.getRenderWidth(), a.getRenderHeight(), 1, null, We.BILINEAR_SAMPLINGMODE, a, !1, this._defaultPipelineTextureType, !0), this._chromaticAberrationEffect = new gs(a, this.ChromaticAberrationPostProcessId, () => this.chromaticAberration, !0), this.grain = new km("Grain", 1, null, We.BILINEAR_SAMPLINGMODE, a, !1, this._defaultPipelineTextureType, !0), this._grainEffect = new gs(a, this.GrainPostProcessId, () => this.grain, !0);
    let f = !0;
    this._imageProcessingConfigurationObserver = this._scene.imageProcessingConfiguration.onUpdateParameters.add(() => {
      this.bloom._downscale._exposure = this._scene.imageProcessingConfiguration.exposure, this.imageProcessingEnabled !== this._scene.imageProcessingConfiguration.isEnabled && (this._imageProcessingEnabled = this._scene.imageProcessingConfiguration.isEnabled, f ? ye.SetImmediate(() => {
        this._buildPipeline();
      }) : this._buildPipeline());
    }), this._buildPipeline(), f = !1;
  }
  /**
   * Get the class name
   * @returns "DefaultRenderingPipeline"
   */
  getClassName() {
    return "DefaultRenderingPipeline";
  }
  /**
   * Force the compilation of the entire pipeline.
   */
  prepare() {
    const e = this._buildAllowed;
    this._buildAllowed = !0, this._buildPipeline(), this._buildAllowed = e;
  }
  _setAutoClearAndTextureSharing(e, t = !1) {
    this._hasCleared ? e.autoClear = !1 : (e.autoClear = !0, this._scene.autoClear = !1, this._hasCleared = !0), t || (this._prevPrevPostProcess ? e.shareOutputWith(this._prevPrevPostProcess) : e.useOwnOutput(), this._prevPostProcess && (this._prevPrevPostProcess = this._prevPostProcess), this._prevPostProcess = e);
  }
  _buildPipeline() {
    if (!this._buildAllowed)
      return;
    this._scene.autoClear = !0;
    const e = this._scene.getEngine();
    if (this._disposePostProcesses(), this._cameras !== null && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()), this._reset(), this._prevPostProcess = null, this._prevPrevPostProcess = null, this._hasCleared = !1, this.depthOfFieldEnabled) {
      if (this._cameras.length > 1) {
        for (const t of this._cameras) {
          const r = this._scene.enableDepthRenderer(t);
          r.useOnlyInActiveCamera = !0;
        }
        this._depthOfFieldSceneObserver = this._scene.onAfterRenderTargetsRenderObservable.add((t) => {
          this._cameras.indexOf(t.activeCamera) > -1 && (this.depthOfField.depthTexture = t.enableDepthRenderer(t.activeCamera).getDepthMap());
        });
      } else {
        this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);
        const t = this._scene.enableDepthRenderer(this._cameras[0]);
        this.depthOfField.depthTexture = t.getDepthMap();
      }
      this.depthOfField._isReady() || this.depthOfField._updateEffects(), this.addEffect(this.depthOfField), this._setAutoClearAndTextureSharing(this.depthOfField._effects[0], !0);
    } else
      this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);
    this.bloomEnabled && (this.bloom._isReady() || this.bloom._updateEffects(), this.addEffect(this.bloom), this._setAutoClearAndTextureSharing(this.bloom._effects[0], !0)), this._imageProcessingEnabled && (this.imageProcessing = new Uy("imageProcessing", 1, null, We.BILINEAR_SAMPLINGMODE, e, !1, this._defaultPipelineTextureType, this.scene.imageProcessingConfiguration), this._hdr ? (this.addEffect(new gs(e, this.ImageProcessingPostProcessId, () => this.imageProcessing, !0)), this._setAutoClearAndTextureSharing(this.imageProcessing)) : this._scene.imageProcessingConfiguration.applyByPostProcess = !1, (!this._cameras || this._cameras.length === 0) && (this._scene.imageProcessingConfiguration.applyByPostProcess = !1), this.imageProcessing.getEffect() || this.imageProcessing._updateParameters()), this.sharpenEnabled && (this.sharpen.isReady() || this.sharpen.updateEffect(), this.addEffect(this._sharpenEffect), this._setAutoClearAndTextureSharing(this.sharpen)), this.grainEnabled && (this.grain.isReady() || this.grain.updateEffect(), this.addEffect(this._grainEffect), this._setAutoClearAndTextureSharing(this.grain)), this.chromaticAberrationEnabled && (this.chromaticAberration.isReady() || this.chromaticAberration.updateEffect(), this.addEffect(this._chromaticAberrationEffect), this._setAutoClearAndTextureSharing(this.chromaticAberration)), this.fxaaEnabled && (this.fxaa = new ym("fxaa", 1, null, We.BILINEAR_SAMPLINGMODE, e, !1, this._defaultPipelineTextureType), this.addEffect(new gs(e, this.FxaaPostProcessId, () => this.fxaa, !0)), this._setAutoClearAndTextureSharing(this.fxaa, !0)), this._cameras !== null && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras), (this._scene.activeCameras && this._scene.activeCameras.length > 1 || this._scene.activeCamera && this._cameras.indexOf(this._scene.activeCamera) === -1) && (this._scene.autoClear = !0), this._activeCameraChangedObserver || (this._activeCameraChangedObserver = this._scene.onActiveCameraChanged.add(() => {
      this._scene.activeCamera && this._cameras.indexOf(this._scene.activeCamera) === -1 && (this._scene.autoClear = !0);
    })), this._activeCamerasChangedObserver || (this._activeCamerasChangedObserver = this._scene.onActiveCamerasChanged.add(() => {
      this._scene.activeCameras && this._scene.activeCameras.length > 1 && (this._scene.autoClear = !0);
    })), this._adaptPostProcessesToViewPort(), !this._enableMSAAOnFirstPostProcess(this.samples) && this.samples > 1 && Se.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0"), this.onBuildObservable.notifyObservers(this);
  }
  _disposePostProcesses(e = !1) {
    for (let t = 0; t < this._cameras.length; t++) {
      const r = this._cameras[t];
      this.imageProcessing && this.imageProcessing.dispose(r), this.fxaa && this.fxaa.dispose(r), e && (this.sharpen && this.sharpen.dispose(r), this.depthOfField && (this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver), this.depthOfField.disposeEffects(r)), this.bloom && this.bloom.disposeEffects(r), this.chromaticAberration && this.chromaticAberration.dispose(r), this.grain && this.grain.dispose(r), this._glowLayer && this._glowLayer.dispose());
    }
    this.imageProcessing = null, this.fxaa = null, e && (this.sharpen = null, this._sharpenEffect = null, this.depthOfField = null, this.bloom = null, this.chromaticAberration = null, this._chromaticAberrationEffect = null, this.grain = null, this._grainEffect = null, this._glowLayer = null);
  }
  /**
   * Adds a camera to the pipeline
   * @param camera the camera to be added
   */
  addCamera(e) {
    this._camerasToBeAttached.push(e), this._buildPipeline();
  }
  /**
   * Removes a camera from the pipeline
   * @param camera the camera to remove
   */
  removeCamera(e) {
    const t = this._camerasToBeAttached.indexOf(e);
    this._camerasToBeAttached.splice(t, 1), this._buildPipeline();
  }
  /**
   * Dispose of the pipeline and stop all post processes
   */
  dispose() {
    this._buildAllowed = !1, this.onBuildObservable.clear(), this._disposePostProcesses(!0), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._scene._postProcessRenderPipelineManager.removePipeline(this.name), this._scene.autoClear = !0, this._resizeObserver && (this._scene.getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this._scene.onActiveCameraChanged.remove(this._activeCameraChangedObserver), this._scene.onActiveCamerasChanged.remove(this._activeCamerasChangedObserver), this._scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigurationObserver), super.dispose();
  }
  /**
   * Serialize the rendering pipeline (Used when exporting)
   * @returns the serialized object
   */
  serialize() {
    const e = jt.Serialize(this);
    return e.customType = "DefaultRenderingPipeline", e;
  }
  /**
   * Parse the serialized pipeline
   * @param source Source pipeline.
   * @param scene The scene to load the pipeline to.
   * @param rootUrl The URL of the serialized pipeline.
   * @returns An instantiated pipeline from the serialized object.
   */
  static Parse(e, t, r) {
    return jt.Parse(() => new K9(e._name, e._name._hdr, t), e, t, r);
  }
}
C([
  M()
], K9.prototype, "sharpenEnabled", null);
C([
  M()
], K9.prototype, "bloomKernel", null);
C([
  M()
], K9.prototype, "_bloomWeight", void 0);
C([
  M()
], K9.prototype, "_bloomThreshold", void 0);
C([
  M()
], K9.prototype, "_hdr", void 0);
C([
  M()
], K9.prototype, "bloomWeight", null);
C([
  M()
], K9.prototype, "bloomThreshold", null);
C([
  M()
], K9.prototype, "bloomScale", null);
C([
  M()
], K9.prototype, "bloomEnabled", null);
C([
  M()
], K9.prototype, "depthOfFieldEnabled", null);
C([
  M()
], K9.prototype, "depthOfFieldBlurLevel", null);
C([
  M()
], K9.prototype, "fxaaEnabled", null);
C([
  M()
], K9.prototype, "samples", null);
C([
  M()
], K9.prototype, "imageProcessingEnabled", null);
C([
  M()
], K9.prototype, "glowLayerEnabled", null);
C([
  M()
], K9.prototype, "chromaticAberrationEnabled", null);
C([
  M()
], K9.prototype, "grainEnabled", null);
Ue("BABYLON.DefaultRenderingPipeline", K9);
const a7e = "lensHighlightsPixelShader", o7e = `uniform sampler2D textureSampler; 
uniform float gain;uniform float threshold;uniform float screen_width;uniform float screen_height;varying vec2 vUV;vec4 highlightColor(vec4 color) {vec4 highlight=color;float luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));float lum_threshold;if (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }
else { lum_threshold=0.5+0.44*threshold; }
luminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);highlight*=luminance*gain;highlight.a=1.0;return highlight;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec4 original=texture2D(textureSampler,vUV);if (gain==-1.0) {gl_FragColor=vec4(0.0,0.0,0.0,1.0);return;}
float w=2.0/screen_width;float h=2.0/screen_height;float weight=1.0;vec4 blurred=vec4(0.0,0.0,0.0,0.0);
#ifdef PENTAGON
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));
#else
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));
#endif
blurred/=39.0;gl_FragColor=blurred;}`;
Le.ShadersStore[a7e] = o7e;
const f7e = "depthOfFieldPixelShader", A7e = `uniform sampler2D textureSampler;uniform sampler2D highlightsSampler;uniform sampler2D depthSampler;uniform sampler2D grainSampler;uniform float grain_amount;uniform bool blur_noise;uniform float screen_width;uniform float screen_height;uniform float distortion;uniform bool dof_enabled;uniform float screen_distance; 
uniform float aperture;uniform float darken;uniform float edge_blur;uniform bool highlights;uniform float near;uniform float far;varying vec2 vUV;
#define PI 3.14159265
#define TWOPI 6.28318530
#define inverse_focal_length 0.1 
vec2 centered_screen_pos;vec2 distorted_coords;float radius2;float radius;vec2 rand(vec2 co)
{float noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));float noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));return clamp(vec2(noise1,noise2),0.0,1.0);}
vec2 getDistortedCoords(vec2 coords) {if (distortion==0.0) { return coords; }
vec2 direction=1.0*normalize(centered_screen_pos);vec2 dist_coords=vec2(0.5,0.5);dist_coords.x=0.5+direction.x*radius2*1.0;dist_coords.y=0.5+direction.y*radius2*1.0;float dist_amount=clamp(distortion*0.23,0.0,1.0);dist_coords=mix(coords,dist_coords,dist_amount);return dist_coords;}
float sampleScreen(inout vec4 color,in vec2 offset,in float weight) {vec2 coords=distorted_coords;float angle=rand(coords*100.0).x*TWOPI;coords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));color+=texture2D(textureSampler,coords)*weight;return weight;}
float getBlurLevel(float size) {return min(3.0,ceil(size/1.0));}
vec4 getBlurColor(float size) {vec4 col=texture2D(textureSampler,distorted_coords);float blur_level=getBlurLevel(size);float w=(size/screen_width);float h=(size/screen_height);float total_weight=1.0;vec2 sample_coords;total_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);total_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);total_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);total_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);total_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);total_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);total_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);total_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);total_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);total_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);if (blur_level>1.0) {total_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);total_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);total_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);total_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);total_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);total_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);total_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);total_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);total_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);total_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);}
if (blur_level>2.0) {total_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);total_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);total_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);total_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);total_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);total_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);total_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);total_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);total_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);}
col/=total_weight; 
if (darken>0.0) {col.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);}
return col;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{centered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);radius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;radius=sqrt(radius2);distorted_coords=getDistortedCoords(vUV); 
vec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height); 
float depth=texture2D(depthSampler,distorted_coords).r; 
float distance=near+(far-near)*depth; 
vec4 color=texture2D(textureSampler,vUV); 
float coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));if (dof_enabled==false || coc<0.07) { coc=0.0; }
float edge_blur_amount=0.0;if (edge_blur>0.0) {edge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;}
float blur_amount=max(edge_blur_amount,coc);if (blur_amount==0.0) {gl_FragColor=texture2D(textureSampler,distorted_coords);}
else {gl_FragColor=getBlurColor(blur_amount*1.7);if (highlights) {gl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;}
if (blur_noise) {vec2 noise=rand(distorted_coords)*0.01*blur_amount;vec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);gl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;}}
if (grain_amount>0.0) {vec4 grain_color=texture2D(grainSampler,texels_coords*0.003);gl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;}}
`;
Le.ShadersStore[f7e] = A7e;
class d7e extends SD {
  /**
   * @constructor
   *
   * Effect parameters are as follow:
   * {
   *      chromatic_aberration: number;       // from 0 to x (1 for realism)
   *      edge_blur: number;                  // from 0 to x (1 for realism)
   *      distortion: number;                 // from 0 to x (1 for realism), note that this will effect the pointer position precision
   *      grain_amount: number;               // from 0 to 1
   *      grain_texture: BABYLON.Texture;     // texture to use for grain effect; if unset, use random B&W noise
   *      dof_focus_distance: number;         // depth-of-field: focus distance; unset to disable (disabled by default)
   *      dof_aperture: number;               // depth-of-field: focus blur bias (default: 1)
   *      dof_darken: number;                 // depth-of-field: darken that which is out of focus (from 0 to 1, disabled by default)
   *      dof_pentagon: boolean;              // depth-of-field: makes a pentagon-like "bokeh" effect
   *      dof_gain: number;                   // depth-of-field: highlights gain; unset to disable (disabled by default)
   *      dof_threshold: number;              // depth-of-field: highlights threshold (default: 1)
   *      blur_noise: boolean;                // add a little bit of noise to the blur (default: true)
   * }
   * Note: if an effect parameter is unset, effect is disabled
   *
   * @param name The rendering pipeline name
   * @param parameters - An object containing all parameters (see above)
   * @param scene The scene linked to this pipeline
   * @param ratio The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5)
   * @param cameras The array of cameras that the rendering pipeline will be attached to
   */
  constructor(e, t, r, n = 1, i) {
    super(r.getEngine(), e), this.LensChromaticAberrationEffect = "LensChromaticAberrationEffect", this.HighlightsEnhancingEffect = "HighlightsEnhancingEffect", this.LensDepthOfFieldEffect = "LensDepthOfFieldEffect", this._pentagonBokehIsEnabled = !1, this._scene = r, this._depthTexture = r.enableDepthRenderer().getDepthMap(), t.grain_texture ? this._grainTexture = t.grain_texture : this._createGrainTexture(), this._edgeBlur = t.edge_blur ? t.edge_blur : 0, this._grainAmount = t.grain_amount ? t.grain_amount : 0, this._chromaticAberration = t.chromatic_aberration ? t.chromatic_aberration : 0, this._distortion = t.distortion ? t.distortion : 0, this._highlightsGain = t.dof_gain !== void 0 ? t.dof_gain : -1, this._highlightsThreshold = t.dof_threshold ? t.dof_threshold : 1, this._dofDistance = t.dof_focus_distance !== void 0 ? t.dof_focus_distance : -1, this._dofAperture = t.dof_aperture ? t.dof_aperture : 1, this._dofDarken = t.dof_darken ? t.dof_darken : 0, this._dofPentagon = t.dof_pentagon !== void 0 ? t.dof_pentagon : !0, this._blurNoise = t.blur_noise !== void 0 ? t.blur_noise : !0, this._createChromaticAberrationPostProcess(n), this._createHighlightsPostProcess(n), this._createDepthOfFieldPostProcess(n / 4), this.addEffect(new gs(r.getEngine(), this.LensChromaticAberrationEffect, () => this._chromaticAberrationPostProcess, !0)), this.addEffect(new gs(r.getEngine(), this.HighlightsEnhancingEffect, () => this._highlightsPostProcess, !0)), this.addEffect(new gs(r.getEngine(), this.LensDepthOfFieldEffect, () => this._depthOfFieldPostProcess, !0)), this._highlightsGain === -1 && this._disableEffect(this.HighlightsEnhancingEffect, null), r.postProcessRenderPipelineManager.addPipeline(this), i && r.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e, i);
  }
  /**
   * Get the class name
   * @returns "LensRenderingPipeline"
   */
  getClassName() {
    return "LensRenderingPipeline";
  }
  // Properties
  /**
   * Gets associated scene
   */
  get scene() {
    return this._scene;
  }
  /**
   * Gets or sets the edge blur
   */
  get edgeBlur() {
    return this._edgeBlur;
  }
  set edgeBlur(e) {
    this.setEdgeBlur(e);
  }
  /**
   * Gets or sets the grain amount
   */
  get grainAmount() {
    return this._grainAmount;
  }
  set grainAmount(e) {
    this.setGrainAmount(e);
  }
  /**
   * Gets or sets the chromatic aberration amount
   */
  get chromaticAberration() {
    return this._chromaticAberration;
  }
  set chromaticAberration(e) {
    this.setChromaticAberration(e);
  }
  /**
   * Gets or sets the depth of field aperture
   */
  get dofAperture() {
    return this._dofAperture;
  }
  set dofAperture(e) {
    this.setAperture(e);
  }
  /**
   * Gets or sets the edge distortion
   */
  get edgeDistortion() {
    return this._distortion;
  }
  set edgeDistortion(e) {
    this.setEdgeDistortion(e);
  }
  /**
   * Gets or sets the depth of field distortion
   */
  get dofDistortion() {
    return this._dofDistance;
  }
  set dofDistortion(e) {
    this.setFocusDistance(e);
  }
  /**
   * Gets or sets the darken out of focus amount
   */
  get darkenOutOfFocus() {
    return this._dofDarken;
  }
  set darkenOutOfFocus(e) {
    this.setDarkenOutOfFocus(e);
  }
  /**
   * Gets or sets a boolean indicating if blur noise is enabled
   */
  get blurNoise() {
    return this._blurNoise;
  }
  set blurNoise(e) {
    this._blurNoise = e;
  }
  /**
   * Gets or sets a boolean indicating if pentagon bokeh is enabled
   */
  get pentagonBokeh() {
    return this._pentagonBokehIsEnabled;
  }
  set pentagonBokeh(e) {
    e ? this.enablePentagonBokeh() : this.disablePentagonBokeh();
  }
  /**
   * Gets or sets the highlight grain amount
   */
  get highlightsGain() {
    return this._highlightsGain;
  }
  set highlightsGain(e) {
    this.setHighlightsGain(e);
  }
  /**
   * Gets or sets the highlight threshold
   */
  get highlightsThreshold() {
    return this._highlightsThreshold;
  }
  set highlightsThreshold(e) {
    this.setHighlightsThreshold(e);
  }
  // public methods (self explanatory)
  /**
   * Sets the amount of blur at the edges
   * @param amount blur amount
   */
  setEdgeBlur(e) {
    this._edgeBlur = e;
  }
  /**
   * Sets edge blur to 0
   */
  disableEdgeBlur() {
    this._edgeBlur = 0;
  }
  /**
   * Sets the amount of grain
   * @param amount Amount of grain
   */
  setGrainAmount(e) {
    this._grainAmount = e;
  }
  /**
   * Set grain amount to 0
   */
  disableGrain() {
    this._grainAmount = 0;
  }
  /**
   * Sets the chromatic aberration amount
   * @param amount amount of chromatic aberration
   */
  setChromaticAberration(e) {
    this._chromaticAberration = e;
  }
  /**
   * Sets chromatic aberration amount to 0
   */
  disableChromaticAberration() {
    this._chromaticAberration = 0;
  }
  /**
   * Sets the EdgeDistortion amount
   * @param amount amount of EdgeDistortion
   */
  setEdgeDistortion(e) {
    this._distortion = e;
  }
  /**
   * Sets edge distortion to 0
   */
  disableEdgeDistortion() {
    this._distortion = 0;
  }
  /**
   * Sets the FocusDistance amount
   * @param amount amount of FocusDistance
   */
  setFocusDistance(e) {
    this._dofDistance = e;
  }
  /**
   * Disables depth of field
   */
  disableDepthOfField() {
    this._dofDistance = -1;
  }
  /**
   * Sets the Aperture amount
   * @param amount amount of Aperture
   */
  setAperture(e) {
    this._dofAperture = e;
  }
  /**
   * Sets the DarkenOutOfFocus amount
   * @param amount amount of DarkenOutOfFocus
   */
  setDarkenOutOfFocus(e) {
    this._dofDarken = e;
  }
  /**
   * Creates a pentagon bokeh effect
   */
  enablePentagonBokeh() {
    this._highlightsPostProcess.updateEffect(`#define PENTAGON
`), this._pentagonBokehIsEnabled = !0;
  }
  /**
   * Disables the pentagon bokeh effect
   */
  disablePentagonBokeh() {
    this._pentagonBokehIsEnabled = !1, this._highlightsPostProcess.updateEffect();
  }
  /**
   * Enables noise blur
   */
  enableNoiseBlur() {
    this._blurNoise = !0;
  }
  /**
   * Disables noise blur
   */
  disableNoiseBlur() {
    this._blurNoise = !1;
  }
  /**
   * Sets the HighlightsGain amount
   * @param amount amount of HighlightsGain
   */
  setHighlightsGain(e) {
    this._highlightsGain = e;
  }
  /**
   * Sets the HighlightsThreshold amount
   * @param amount amount of HighlightsThreshold
   */
  setHighlightsThreshold(e) {
    this._highlightsGain === -1 && (this._highlightsGain = 1), this._highlightsThreshold = e;
  }
  /**
   * Disables highlights
   */
  disableHighlights() {
    this._highlightsGain = -1;
  }
  /**
   * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
   * @param disableDepthRender If the scene's depth rendering should be disabled (default: false)
   */
  dispose(e = !1) {
    this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), this._chromaticAberrationPostProcess = null, this._highlightsPostProcess = null, this._depthOfFieldPostProcess = null, this._grainTexture.dispose(), e && this._scene.disableDepthRenderer();
  }
  // colors shifting and distortion
  _createChromaticAberrationPostProcess(e) {
    this._chromaticAberrationPostProcess = new kr(
      "LensChromaticAberration",
      "chromaticAberration",
      ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"],
      // uniforms
      [],
      // samplers
      e,
      null,
      We.TRILINEAR_SAMPLINGMODE,
      this._scene.getEngine(),
      !1
    ), this._chromaticAberrationPostProcess.onApply = (t) => {
      t.setFloat("chromatic_aberration", this._chromaticAberration), t.setFloat("screen_width", this._scene.getEngine().getRenderWidth()), t.setFloat("screen_height", this._scene.getEngine().getRenderHeight()), t.setFloat("radialIntensity", 1), t.setFloat2("direction", 17, 17), t.setFloat2("centerPosition", 0.5, 0.5);
    };
  }
  // highlights enhancing
  _createHighlightsPostProcess(e) {
    this._highlightsPostProcess = new kr(
      "LensHighlights",
      "lensHighlights",
      ["gain", "threshold", "screen_width", "screen_height"],
      // uniforms
      [],
      // samplers
      e,
      null,
      We.TRILINEAR_SAMPLINGMODE,
      this._scene.getEngine(),
      !1,
      this._dofPentagon ? `#define PENTAGON
` : ""
    ), this._highlightsPostProcess.externalTextureSamplerBinding = !0, this._highlightsPostProcess.onApply = (t) => {
      t.setFloat("gain", this._highlightsGain), t.setFloat("threshold", this._highlightsThreshold), t.setTextureFromPostProcess("textureSampler", this._chromaticAberrationPostProcess), t.setFloat("screen_width", this._scene.getEngine().getRenderWidth()), t.setFloat("screen_height", this._scene.getEngine().getRenderHeight());
    };
  }
  // colors shifting and distortion
  _createDepthOfFieldPostProcess(e) {
    this._depthOfFieldPostProcess = new kr("LensDepthOfField", "depthOfField", [
      "grain_amount",
      "blur_noise",
      "screen_width",
      "screen_height",
      "distortion",
      "dof_enabled",
      "screen_distance",
      "aperture",
      "darken",
      "edge_blur",
      "highlights",
      "near",
      "far"
    ], ["depthSampler", "grainSampler", "highlightsSampler"], e, null, We.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._depthOfFieldPostProcess.externalTextureSamplerBinding = !0, this._depthOfFieldPostProcess.onApply = (t) => {
      t.setTexture("depthSampler", this._depthTexture), t.setTexture("grainSampler", this._grainTexture), t.setTextureFromPostProcess("textureSampler", this._highlightsPostProcess), t.setTextureFromPostProcess("highlightsSampler", this._depthOfFieldPostProcess), t.setFloat("grain_amount", this._grainAmount), t.setBool("blur_noise", this._blurNoise), t.setFloat("screen_width", this._scene.getEngine().getRenderWidth()), t.setFloat("screen_height", this._scene.getEngine().getRenderHeight()), t.setFloat("distortion", this._distortion), t.setBool("dof_enabled", this._dofDistance !== -1), t.setFloat("screen_distance", 1 / (0.1 - 1 / this._dofDistance)), t.setFloat("aperture", this._dofAperture), t.setFloat("darken", this._dofDarken), t.setFloat("edge_blur", this._edgeBlur), t.setBool("highlights", this._highlightsGain !== -1), this._scene.activeCamera && (t.setFloat("near", this._scene.activeCamera.minZ), t.setFloat("far", this._scene.activeCamera.maxZ));
    };
  }
  // creates a black and white random noise texture, 512x512
  _createGrainTexture() {
    const t = new Uint8Array(1048576);
    for (let n = 0; n < t.length; ) {
      const i = Math.floor(Xt.RandomRange(0.42, 0.58) * 255);
      t[n++] = i, t[n++] = i, t[n++] = i, t[n++] = 255;
    }
    const r = Bo.CreateRGBATexture(t, 512, 512, this._scene, !1, !1, 2);
    r.name = "LensNoiseTexture", r.wrapU = We.WRAP_ADDRESSMODE, r.wrapV = We.WRAP_ADDRESSMODE, this._grainTexture = r;
  }
}
class v7e {
  constructor() {
    this.enabled = !1, this.name = "ssao2", this.texturesRequired = [6, 5];
  }
}
const u7e = "ssao2PixelShader", l7e = `precision highp float;uniform sampler2D textureSampler;varying vec2 vUV;
#ifdef SSAO
float scales[16]=float[16](
0.1,
0.11406250000000001,
0.131640625,
0.15625,
0.187890625,
0.2265625,
0.272265625,
0.325,
0.384765625,
0.4515625,
0.525390625,
0.60625,
0.694140625,
0.7890625,
0.891015625,
1.0
);uniform float near;uniform float radius;uniform sampler2D depthSampler;uniform sampler2D randomSampler;uniform sampler2D normalSampler;uniform float randTextureTiles;uniform float samplesFactor;uniform vec3 sampleSphere[SAMPLES];uniform float totalStrength;uniform float base;uniform float xViewport;uniform float yViewport;uniform mat3 depthProjection;uniform float maxZ;uniform float minZAspect;uniform vec2 texelSize;uniform mat4 projection;void main()
{vec3 random=textureLod(randomSampler,vUV*randTextureTiles,0.0).rgb;float depth=textureLod(depthSampler,vUV,0.0).r;float depthSign=depth/abs(depth);depth=depth*depthSign;vec3 normal=textureLod(normalSampler,vUV,0.0).rgb;float occlusion=0.0;float correctedRadius=min(radius,minZAspect*depth/near);vec3 vViewRay=vec3((vUV.x*2.0-1.0)*xViewport,(vUV.y*2.0-1.0)*yViewport,depthSign);vec3 vDepthFactor=depthProjection*vec3(1.0,1.0,depth);vec3 origin=vViewRay*vDepthFactor;vec3 rvec=random*2.0-1.0;rvec.z=0.0;float dotProduct=dot(rvec,normal);rvec=1.0-abs(dotProduct)>1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);vec3 tangent=normalize(rvec-normal*dot(rvec,normal));vec3 bitangent=cross(normal,tangent);mat3 tbn=mat3(tangent,bitangent,normal);float difference;for (int i=0; i<SAMPLES; ++i) {vec3 samplePosition=scales[(i+int(random.x*16.0)) % 16]*tbn*sampleSphere[(i+int(random.y*16.0)) % 16];samplePosition=samplePosition*correctedRadius+origin;vec4 offset=vec4(samplePosition,1.0);offset=projection*offset;offset.xyz/=offset.w;offset.xy=offset.xy*0.5+0.5;if (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {continue;}
float sampleDepth=abs(textureLod(depthSampler,offset.xy,0.0).r);difference=depthSign*samplePosition.z-sampleDepth;float rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);occlusion+=step(EPSILON,difference)*rangeCheck;}
occlusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));float ao=1.0-totalStrength*occlusion*samplesFactor;float result=clamp(ao+base,0.0,1.0);gl_FragColor=vec4(vec3(result),1.0);}
#endif
#ifdef BLUR
uniform float outSize;uniform float soften;uniform float tolerance;uniform int samples;
#ifndef BLUR_BYPASS
uniform sampler2D depthSampler;
#ifdef BLUR_LEGACY
#define inline
float blur13Bilateral(sampler2D image,vec2 uv,vec2 step) {float result=0.0;vec2 off1=vec2(1.411764705882353)*step;vec2 off2=vec2(3.2941176470588234)*step;vec2 off3=vec2(5.176470588235294)*step;float compareDepth=abs(textureLod(depthSampler,uv,0.0).r);float sampleDepth;float weight;float weightSum=30.0;result+=textureLod(image,uv,0.0).r*30.0;sampleDepth=abs(textureLod(depthSampler,uv+off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureLod(image,uv+off1,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureLod(image,uv-off1,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv+off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv+off2,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv-off2,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv+off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv+off3,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv-off3,0.0).r*weight;return result/weightSum;}
#endif
#endif
void main()
{float result=0.0;
#ifdef BLUR_BYPASS
result=textureLod(textureSampler,vUV,0.0).r;
#else
#ifdef BLUR_H
vec2 step=vec2(1.0/outSize,0.0);
#else
vec2 step=vec2(0.0,1.0/outSize);
#endif
#ifdef BLUR_LEGACY
result=blur13Bilateral(textureSampler,vUV,step);
#else
float compareDepth=abs(textureLod(depthSampler,vUV,0.0).r);float weightSum=0.0;for (int i=-samples; i<samples; i+=2)
{vec2 samplePos=vUV+step*(float(i)+0.5);float sampleDepth=abs(textureLod(depthSampler,samplePos,0.0).r);float falloff=smoothstep(0.0,
float(samples),
float(samples)-abs(float(i))*soften);float minDivider=tolerance*0.5+0.003;float weight=falloff/( minDivider+abs(compareDepth-sampleDepth));result+=textureLod(textureSampler,samplePos,0.0).r*weight;weightSum+=weight;}
result/=weightSum;
#endif
#endif
gl_FragColor.rgb=vec3(result);gl_FragColor.a=1.0;}
#endif
`;
Le.ShadersStore[u7e] = l7e;
const P7e = "ssaoCombinePixelShader", c7e = `uniform sampler2D textureSampler;uniform sampler2D originalColor;uniform vec4 viewport;varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 ssaoColor=texture2D(textureSampler,viewport.xy+vUV*viewport.zw);vec4 sceneColor=texture2D(originalColor,vUV);gl_FragColor=sceneColor*ssaoColor;
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[P7e] = c7e;
class H9 extends SD {
  /**
   * Used in SSAO calculations to compensate for accuracy issues with depth values. Default 0.02.
   *
   * Normally you do not need to change this value, but you can experiment with it if you get a lot of in false self-occlusion on flat surfaces when using fewer than 16 samples. Useful range is normally [0..0.1] but higher values is allowed.
   */
  set epsilon(e) {
    this._epsilon = e, this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO());
  }
  get epsilon() {
    return this._epsilon;
  }
  /**
   * Number of samples used for the SSAO calculations. Default value is 8.
   */
  set samples(e) {
    this._samples = e, this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO()), this._sampleSphere = this._generateHemisphere();
  }
  get samples() {
    return this._samples;
  }
  /**
   * Number of samples to use for antialiasing.
   */
  set textureSamples(e) {
    this._textureSamples = e, this._prePassRenderer ? this._prePassRenderer.samples = e : this._originalColorPostProcess.samples = e;
  }
  get textureSamples() {
    return this._textureSamples;
  }
  get _geometryBufferRenderer() {
    return this._forceGeometryBuffer ? this._scene.geometryBufferRenderer : null;
  }
  get _prePassRenderer() {
    return this._forceGeometryBuffer ? null : this._scene.prePassRenderer;
  }
  /**
   * Skips the denoising (blur) stage of the SSAO calculations.
   *
   * Useful to temporarily set while experimenting with the other SSAO2 settings.
   */
  set bypassBlur(e) {
    const t = this._getDefinesForBlur(this.expensiveBlur, e), r = this._getSamplersForBlur(e);
    this._blurHPostProcess.updateEffect(t.h, null, r), this._blurVPostProcess.updateEffect(t.v, null, r), this._bypassBlur = e;
  }
  get bypassBlur() {
    return this._bypassBlur;
  }
  /**
   * Enables the configurable bilateral denoising (blurring) filter. Default is true.
   * Set to false to instead use a legacy bilateral filter that can't be configured.
   *
   * The denoising filter runs after the SSAO calculations and is a very important step. Both options results in a so called bilateral being used, but the "expensive" one can be
   * configured in several ways to fit your scene.
   */
  set expensiveBlur(e) {
    const t = this._getDefinesForBlur(e, this._bypassBlur);
    this._blurHPostProcess.updateEffect(t.h), this._blurVPostProcess.updateEffect(t.v), this._expensiveBlur = e;
  }
  get expensiveBlur() {
    return this._expensiveBlur;
  }
  /**
   *  Support test.
   */
  static get IsSupported() {
    const e = gr.LastCreatedEngine;
    return e ? e._features.supportSSAO2 : !1;
  }
  /**
   * Gets active scene
   */
  get scene() {
    return this._scene;
  }
  /**
   * @constructor
   * @param name The rendering pipeline name
   * @param scene The scene linked to this pipeline
   * @param ratio The size of the postprocesses. Can be a number shared between passes or an object for more precision: { ssaoRatio: 0.5, blurRatio: 1.0 }
   * @param cameras The array of cameras that the rendering pipeline will be attached to
   * @param forceGeometryBuffer Set to true if you want to use the legacy geometry buffer renderer
   * @param textureType The texture type used by the different post processes created by SSAO (default: 0)
   */
  constructor(e, t, r, n, i = !1, s = 0) {
    var a, f;
    if (super(t.getEngine(), e), this.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect", this.SSAORenderEffect = "SSAORenderEffect", this.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect", this.SSAOBlurVRenderEffect = "SSAOBlurVRenderEffect", this.SSAOCombineRenderEffect = "SSAOCombineRenderEffect", this.totalStrength = 1, this.maxZ = 100, this.minZAspect = 0.2, this._epsilon = 0.02, this._samples = 8, this._textureSamples = 1, this._forceGeometryBuffer = !1, this.radius = 2, this.base = 0, this._bypassBlur = !1, this._expensiveBlur = !0, this.bilateralSamples = 16, this.bilateralSoften = 0, this.bilateralTolerance = 0, this._bits = new Uint32Array(1), this._scene = t, this._ratio = r, this._textureType = s, this._forceGeometryBuffer = i, !this.isSupported) {
      Se.Error("The current engine does not support SSAO 2.");
      return;
    }
    const o = this._ratio.ssaoRatio || r, d = this._ratio.blurRatio || r;
    this._forceGeometryBuffer ? (t.enableGeometryBufferRenderer(), !((a = t.geometryBufferRenderer) === null || a === void 0) && a.generateNormalsInWorldSpace && console.error("SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!")) : (t.enablePrePassRenderer(), !((f = t.prePassRenderer) === null || f === void 0) && f.generateNormalsInWorldSpace && console.error("SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the prepass renderer!")), this._createRandomTexture(), this._originalColorPostProcess = new lg("SSAOOriginalSceneColor", 1, null, We.BILINEAR_SAMPLINGMODE, t.getEngine(), void 0, this._textureType), this._originalColorPostProcess.samples = this.textureSamples, this._createSSAOPostProcess(1, s), this._createBlurPostProcess(o, d, this._textureType), this._createSSAOCombinePostProcess(d, this._textureType), this.addEffect(new gs(t.getEngine(), this.SSAOOriginalSceneColorEffect, () => this._originalColorPostProcess, !0)), this.addEffect(new gs(t.getEngine(), this.SSAORenderEffect, () => this._ssaoPostProcess, !0)), this.addEffect(new gs(t.getEngine(), this.SSAOBlurHRenderEffect, () => this._blurHPostProcess, !0)), this.addEffect(new gs(t.getEngine(), this.SSAOBlurVRenderEffect, () => this._blurVPostProcess, !0)), this.addEffect(new gs(t.getEngine(), this.SSAOCombineRenderEffect, () => this._ssaoCombinePostProcess, !0)), t.postProcessRenderPipelineManager.addPipeline(this), n && t.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e, n);
  }
  // Public Methods
  /**
   * Get the class name
   * @returns "SSAO2RenderingPipeline"
   */
  getClassName() {
    return "SSAO2RenderingPipeline";
  }
  /**
   * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
   * @param disableGeometryBufferRenderer
   */
  dispose(e = !1) {
    for (let t = 0; t < this._scene.cameras.length; t++) {
      const r = this._scene.cameras[t];
      this._originalColorPostProcess.dispose(r), this._ssaoPostProcess.dispose(r), this._blurHPostProcess.dispose(r), this._blurVPostProcess.dispose(r), this._ssaoCombinePostProcess.dispose(r);
    }
    this._randomTexture.dispose(), e && this._scene.disableGeometryBufferRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), super.dispose();
  }
  // Private Methods
  /** @internal */
  _rebuild() {
    super._rebuild();
  }
  _getSamplersForBlur(e) {
    return e ? ["textureSampler"] : ["textureSampler", "depthSampler"];
  }
  _getDefinesForBlur(e, t) {
    let r = `#define BLUR
`;
    return t && (r += `#define BLUR_BYPASS
`), e || (r += `#define BLUR_LEGACY
`), { h: r + `#define BLUR_H
`, v: r };
  }
  _createBlurPostProcess(e, t, r) {
    const n = this._getDefinesForBlur(this.expensiveBlur, this.bypassBlur), i = this._getSamplersForBlur(this.bypassBlur);
    this._blurHPostProcess = this._createBlurFilter("BlurH", i, e, n.h, r, !0), this._blurVPostProcess = this._createBlurFilter("BlurV", i, t, n.v, r, !1);
  }
  _createBlurFilter(e, t, r, n, i, s) {
    const a = new kr(e, "ssao2", ["outSize", "samples", "soften", "tolerance"], t, r, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, n, i);
    return a.onApply = (f) => {
      if (!this._scene.activeCamera)
        return;
      const o = s ? this._ssaoCombinePostProcess.width : this._ssaoCombinePostProcess.height, d = s ? this._originalColorPostProcess.width : this._originalColorPostProcess.height;
      f.setFloat("outSize", o > 0 ? o : d), f.setInt("samples", this.bilateralSamples), f.setFloat("soften", this.bilateralSoften), f.setFloat("tolerance", this.bilateralTolerance), this._geometryBufferRenderer ? f.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[0]) : this._prePassRenderer && f.setTexture("depthSampler", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]);
    }, a.samples = this.textureSamples, a;
  }
  //Van der Corput radical inverse
  _radicalInverse_VdC(e) {
    return this._bits[0] = e, this._bits[0] = (this._bits[0] << 16 | this._bits[0] >> 16) >>> 0, this._bits[0] = (this._bits[0] & 1431655765) << 1 | (this._bits[0] & 2863311530) >>> 1 >>> 0, this._bits[0] = (this._bits[0] & 858993459) << 2 | (this._bits[0] & 3435973836) >>> 2 >>> 0, this._bits[0] = (this._bits[0] & 252645135) << 4 | (this._bits[0] & 4042322160) >>> 4 >>> 0, this._bits[0] = (this._bits[0] & 16711935) << 8 | (this._bits[0] & 4278255360) >>> 8 >>> 0, this._bits[0] * 23283064365386963e-26;
  }
  _hammersley(e, t) {
    return [e / t, this._radicalInverse_VdC(e)];
  }
  _hemisphereSample_uniform(e, t) {
    const r = t * 2 * Math.PI, n = 1 - e * 0.85, i = Math.sqrt(1 - n * n);
    return new S(Math.cos(r) * i, Math.sin(r) * i, n);
  }
  _generateHemisphere() {
    const e = this.samples, t = [];
    let r, n = 0;
    for (; n < e; ) {
      if (e < 16)
        r = this._hemisphereSample_uniform(Math.random(), Math.random());
      else {
        const i = this._hammersley(n, e);
        r = this._hemisphereSample_uniform(i[0], i[1]);
      }
      t.push(r.x, r.y, r.z), n++;
    }
    return t;
  }
  _getDefinesForSSAO() {
    return `#define SSAO
#define SAMPLES ${this.samples}
#define EPSILON ${this.epsilon.toFixed(4)}`;
  }
  _createSSAOPostProcess(e, t) {
    this._sampleSphere = this._generateHemisphere();
    const r = this._getDefinesForSSAO(), n = ["randomSampler", "depthSampler", "normalSampler"];
    this._ssaoPostProcess = new kr("ssao2", "ssao2", [
      "sampleSphere",
      "samplesFactor",
      "randTextureTiles",
      "totalStrength",
      "radius",
      "base",
      "range",
      "projection",
      "near",
      "texelSize",
      "xViewport",
      "yViewport",
      "maxZ",
      "minZAspect",
      "depthProjection"
    ], n, e, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, r, t), this._ssaoPostProcess.onApply = (i) => {
      var s, a, f, o;
      if (this._scene.activeCamera) {
        if (i.setArray3("sampleSphere", this._sampleSphere), i.setFloat("randTextureTiles", 32), i.setFloat("samplesFactor", 1 / this.samples), i.setFloat("totalStrength", this.totalStrength), i.setFloat2("texelSize", 1 / this._ssaoPostProcess.width, 1 / this._ssaoPostProcess.height), i.setFloat("radius", this.radius), i.setFloat("maxZ", this.maxZ), i.setFloat("minZAspect", this.minZAspect), i.setFloat("base", this.base), i.setFloat("near", this._scene.activeCamera.minZ), this._scene.activeCamera.mode === Tr.PERSPECTIVE_CAMERA)
          i.setMatrix3x3("depthProjection", H9.PERSPECTIVE_DEPTH_PROJECTION), i.setFloat("xViewport", Math.tan(this._scene.activeCamera.fov / 2) * this._scene.getEngine().getAspectRatio(this._scene.activeCamera, !0)), i.setFloat("yViewport", Math.tan(this._scene.activeCamera.fov / 2));
        else {
          const d = this._scene.getEngine().getRenderWidth() / 2, v = this._scene.getEngine().getRenderHeight() / 2, u = (s = this._scene.activeCamera.orthoLeft) !== null && s !== void 0 ? s : -d, l = (a = this._scene.activeCamera.orthoRight) !== null && a !== void 0 ? a : d, P = (f = this._scene.activeCamera.orthoBottom) !== null && f !== void 0 ? f : -v, p = (o = this._scene.activeCamera.orthoTop) !== null && o !== void 0 ? o : v;
          i.setMatrix3x3("depthProjection", H9.ORTHO_DEPTH_PROJECTION), i.setFloat("xViewport", (l - u) * 0.5), i.setFloat("yViewport", (p - P) * 0.5);
        }
        i.setMatrix("projection", this._scene.getProjectionMatrix()), this._geometryBufferRenderer ? (i.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[0]), i.setTexture("normalSampler", this._geometryBufferRenderer.getGBuffer().textures[1])) : this._prePassRenderer && (i.setTexture("depthSampler", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]), i.setTexture("normalSampler", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(6)])), i.setTexture("randomSampler", this._randomTexture);
      }
    }, this._ssaoPostProcess.samples = this.textureSamples, this._forceGeometryBuffer || (this._ssaoPostProcess._prePassEffectConfiguration = new v7e());
  }
  _createSSAOCombinePostProcess(e, t) {
    this._ssaoCombinePostProcess = new kr("ssaoCombine", "ssaoCombine", [], ["originalColor", "viewport"], e, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, void 0, t), this._ssaoCombinePostProcess.onApply = (r) => {
      const n = this._scene.activeCamera.viewport;
      r.setVector4("viewport", ue.Vector4[0].copyFromFloats(n.x, n.y, n.width, n.height)), r.setTextureFromPostProcessOutput("originalColor", this._originalColorPostProcess);
    }, this._ssaoCombinePostProcess.samples = this.textureSamples;
  }
  _createRandomTexture() {
    const t = new Uint8Array(65536), r = at.Zero();
    for (let i = 0; i < t.length; )
      r.set(Xt.RandomRange(0, 1), Xt.RandomRange(0, 1)).normalize().scaleInPlace(255), t[i++] = Math.floor(r.x), t[i++] = Math.floor(r.y), t[i++] = 0, t[i++] = 255;
    const n = Bo.CreateRGBATexture(t, 128, 128, this._scene, !1, !1, 2);
    n.name = "SSAORandomTexture", n.wrapU = We.WRAP_ADDRESSMODE, n.wrapV = We.WRAP_ADDRESSMODE, this._randomTexture = n;
  }
  /**
   * Serialize the rendering pipeline (Used when exporting)
   * @returns the serialized object
   */
  serialize() {
    const e = jt.Serialize(this);
    return e.customType = "SSAO2RenderingPipeline", e;
  }
  /**
   * Parse the serialized pipeline
   * @param source Source pipeline.
   * @param scene The scene to load the pipeline to.
   * @param rootUrl The URL of the serialized pipeline.
   * @returns An instantiated pipeline from the serialized object.
   */
  static Parse(e, t, r) {
    return jt.Parse(() => new H9(e._name, t, e._ratio, void 0, e._forceGeometryBuffer, e._textureType), e, t, r);
  }
}
H9.ORTHO_DEPTH_PROJECTION = [1, 0, 0, 0, 1, 0, 0, 0, 1];
H9.PERSPECTIVE_DEPTH_PROJECTION = [0, 0, 0, 0, 0, 0, 1, 1, 1];
C([
  M()
], H9.prototype, "totalStrength", void 0);
C([
  M()
], H9.prototype, "maxZ", void 0);
C([
  M()
], H9.prototype, "minZAspect", void 0);
C([
  M("epsilon")
], H9.prototype, "_epsilon", void 0);
C([
  M("samples")
], H9.prototype, "_samples", void 0);
C([
  M("textureSamples")
], H9.prototype, "_textureSamples", void 0);
C([
  M()
], H9.prototype, "_forceGeometryBuffer", void 0);
C([
  M()
], H9.prototype, "_ratio", void 0);
C([
  M()
], H9.prototype, "_textureType", void 0);
C([
  M()
], H9.prototype, "radius", void 0);
C([
  M()
], H9.prototype, "base", void 0);
C([
  M("bypassBlur")
], H9.prototype, "_bypassBlur", void 0);
C([
  M("expensiveBlur")
], H9.prototype, "_expensiveBlur", void 0);
C([
  M()
], H9.prototype, "bilateralSamples", void 0);
C([
  M()
], H9.prototype, "bilateralSoften", void 0);
C([
  M()
], H9.prototype, "bilateralTolerance", void 0);
Ue("BABYLON.SSAO2RenderingPipeline", H9);
const p7e = "ssaoPixelShader", h7e = `uniform sampler2D textureSampler;varying vec2 vUV;
#ifdef SSAO
uniform sampler2D randomSampler;uniform float randTextureTiles;uniform float samplesFactor;uniform vec3 sampleSphere[SAMPLES];uniform float totalStrength;uniform float radius;uniform float area;uniform float fallOff;uniform float base;vec3 normalFromDepth(float depth,vec2 coords)
{vec2 offset1=vec2(0.0,radius);vec2 offset2=vec2(radius,0.0);float depth1=texture2D(textureSampler,coords+offset1).r;float depth2=texture2D(textureSampler,coords+offset2).r;vec3 p1=vec3(offset1,depth1-depth);vec3 p2=vec3(offset2,depth2-depth);vec3 normal=cross(p1,p2);normal.z=-normal.z;return normalize(normal);}
void main()
{vec3 random=normalize(texture2D(randomSampler,vUV*randTextureTiles).rgb);float depth=texture2D(textureSampler,vUV).r;vec3 position=vec3(vUV,depth);vec3 normal=normalFromDepth(depth,vUV);float radiusDepth=radius/depth;float occlusion=0.0;vec3 ray;vec3 hemiRay;float occlusionDepth;float difference;for (int i=0; i<SAMPLES; i++)
{ray=radiusDepth*reflect(sampleSphere[i],random);hemiRay=position+sign(dot(ray,normal))*ray;occlusionDepth=texture2D(textureSampler,clamp(hemiRay.xy,vec2(0.001,0.001),vec2(0.999,0.999))).r;difference=depth-occlusionDepth;occlusion+=step(fallOff,difference)*(1.0-smoothstep(fallOff,area,difference));}
float ao=1.0-totalStrength*occlusion*samplesFactor;float result=clamp(ao+base,0.0,1.0);gl_FragColor.r=result;gl_FragColor.g=result;gl_FragColor.b=result;gl_FragColor.a=1.0;}
#endif
`;
Le.ShadersStore[p7e] = h7e;
class pU extends SD {
  /**
   * Gets active scene
   */
  get scene() {
    return this._scene;
  }
  /**
   * @constructor
   * @param name - The rendering pipeline name
   * @param scene - The scene linked to this pipeline
   * @param ratio - The size of the postprocesses. Can be a number shared between passes or an object for more precision: { ssaoRatio: 0.5, combineRatio: 1.0 }
   * @param cameras - The array of cameras that the rendering pipeline will be attached to
   */
  constructor(e, t, r, n) {
    super(t.getEngine(), e), this.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect", this.SSAORenderEffect = "SSAORenderEffect", this.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect", this.SSAOBlurVRenderEffect = "SSAOBlurVRenderEffect", this.SSAOCombineRenderEffect = "SSAOCombineRenderEffect", this.totalStrength = 1, this.radius = 1e-4, this.area = 75e-4, this.fallOff = 1e-6, this.base = 0.5, this._firstUpdate = !0, this._scene = t, this._createRandomTexture();
    const i = r.ssaoRatio || r, s = r.combineRatio || r;
    this._originalColorPostProcess = new lg("SSAOOriginalSceneColor", s, null, We.BILINEAR_SAMPLINGMODE, t.getEngine(), !1), this._createSSAOPostProcess(i), this._createBlurPostProcess(i), this._createSSAOCombinePostProcess(s), this.addEffect(new gs(t.getEngine(), this.SSAOOriginalSceneColorEffect, () => this._originalColorPostProcess, !0)), this.addEffect(new gs(t.getEngine(), this.SSAORenderEffect, () => this._ssaoPostProcess, !0)), this.addEffect(new gs(t.getEngine(), this.SSAOBlurHRenderEffect, () => this._blurHPostProcess, !0)), this.addEffect(new gs(t.getEngine(), this.SSAOBlurVRenderEffect, () => this._blurVPostProcess, !0)), this.addEffect(new gs(t.getEngine(), this.SSAOCombineRenderEffect, () => this._ssaoCombinePostProcess, !0)), t.postProcessRenderPipelineManager.addPipeline(this), n && t.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e, n);
  }
  /**
   * @internal
   */
  _attachCameras(e, t) {
    super._attachCameras(e, t);
    for (const r of this._cameras)
      this._scene.enableDepthRenderer(r).getDepthMap();
  }
  // Public Methods
  /**
   * Get the class name
   * @returns "SSAORenderingPipeline"
   */
  getClassName() {
    return "SSAORenderingPipeline";
  }
  /**
   * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
   * @param disableDepthRender
   */
  dispose(e = !1) {
    for (let t = 0; t < this._scene.cameras.length; t++) {
      const r = this._scene.cameras[t];
      this._originalColorPostProcess.dispose(r), this._ssaoPostProcess.dispose(r), this._blurHPostProcess.dispose(r), this._blurVPostProcess.dispose(r), this._ssaoCombinePostProcess.dispose(r);
    }
    this._randomTexture.dispose(), e && this._scene.disableDepthRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), super.dispose();
  }
  // Private Methods
  _createBlurPostProcess(e) {
    this._blurHPostProcess = new c9("BlurH", new at(1, 0), 16, e, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, 0), this._blurVPostProcess = new c9("BlurV", new at(0, 1), 16, e, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, 0), this._blurHPostProcess.onActivateObservable.add(() => {
      const r = this._blurHPostProcess.width / this._scene.getEngine().getRenderWidth();
      this._blurHPostProcess.kernel = 16 * r;
    }), this._blurVPostProcess.onActivateObservable.add(() => {
      const r = this._blurVPostProcess.height / this._scene.getEngine().getRenderHeight();
      this._blurVPostProcess.kernel = 16 * r;
    });
  }
  /** @internal */
  _rebuild() {
    this._firstUpdate = !0, super._rebuild();
  }
  _createSSAOPostProcess(e) {
    const r = [
      0.5381,
      0.1856,
      -0.4319,
      0.1379,
      0.2486,
      0.443,
      0.3371,
      0.5679,
      -57e-4,
      -0.6999,
      -0.0451,
      -19e-4,
      0.0689,
      -0.1598,
      -0.8547,
      0.056,
      69e-4,
      -0.1843,
      -0.0146,
      0.1402,
      0.0762,
      0.01,
      -0.1924,
      -0.0344,
      -0.3577,
      -0.5301,
      -0.4358,
      -0.3169,
      0.1063,
      0.0158,
      0.0103,
      -0.5869,
      46e-4,
      -0.0897,
      -0.494,
      0.3287,
      0.7119,
      -0.0154,
      -0.0918,
      -0.0533,
      0.0596,
      -0.5411,
      0.0352,
      -0.0631,
      0.546,
      -0.4776,
      0.2847,
      -0.0271
    ], n = 1 / 16;
    this._ssaoPostProcess = new kr("ssao", "ssao", ["sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius", "area", "fallOff", "base", "range", "viewport"], ["randomSampler"], e, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, `#define SAMPLES 16
#define SSAO`), this._ssaoPostProcess.externalTextureSamplerBinding = !0, this._ssaoPostProcess.onApply = (i) => {
      this._firstUpdate && (i.setArray3("sampleSphere", r), i.setFloat("samplesFactor", n), i.setFloat("randTextureTiles", 4)), i.setFloat("totalStrength", this.totalStrength), i.setFloat("radius", this.radius), i.setFloat("area", this.area), i.setFloat("fallOff", this.fallOff), i.setFloat("base", this.base), i.setTexture("textureSampler", this._scene.enableDepthRenderer(this._scene.activeCamera).getDepthMap()), i.setTexture("randomSampler", this._randomTexture);
    };
  }
  _createSSAOCombinePostProcess(e) {
    this._ssaoCombinePostProcess = new kr("ssaoCombine", "ssaoCombine", [], ["originalColor", "viewport"], e, null, We.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._ssaoCombinePostProcess.onApply = (t) => {
      t.setVector4("viewport", ue.Vector4[0].copyFromFloats(0, 0, 1, 1)), t.setTextureFromPostProcess("originalColor", this._originalColorPostProcess);
    };
  }
  _createRandomTexture() {
    const t = new Uint8Array(1048576);
    for (let n = 0; n < t.length; )
      t[n++] = Math.floor(Math.max(0, Xt.RandomRange(-1, 1)) * 255), t[n++] = Math.floor(Math.max(0, Xt.RandomRange(-1, 1)) * 255), t[n++] = Math.floor(Math.max(0, Xt.RandomRange(-1, 1)) * 255), t[n++] = 255;
    const r = Bo.CreateRGBATexture(t, 512, 512, this._scene, !1, !1, 2);
    r.name = "SSAORandomTexture", r.wrapU = We.WRAP_ADDRESSMODE, r.wrapV = We.WRAP_ADDRESSMODE, this._randomTexture = r;
  }
}
C([
  M()
], pU.prototype, "totalStrength", void 0);
C([
  M()
], pU.prototype, "radius", void 0);
C([
  M()
], pU.prototype, "area", void 0);
C([
  M()
], pU.prototype, "fallOff", void 0);
C([
  M()
], pU.prototype, "base", void 0);
class H7e {
  constructor() {
    this.enabled = !1, this.name = "screenSpaceReflections", this.texturesRequired = [6, 3, 1];
  }
}
const g7e = "screenSpaceReflectionPixelShader", X7e = `uniform sampler2D textureSampler;
#ifdef SSR_SUPPORTED
uniform sampler2D reflectivitySampler;uniform sampler2D normalSampler;uniform sampler2D positionSampler;
#endif
uniform mat4 view;uniform mat4 projection;uniform float stepSize;uniform float strength;uniform float threshold;uniform float roughnessFactor;uniform float reflectionSpecularFalloffExponent;varying vec2 vUV;
#ifdef SSR_SUPPORTED
struct ReflectionInfo {vec3 color;vec4 coords;};/**
* According to specular,see https:
*/
vec3 fresnelSchlick(float cosTheta,vec3 F0)
{return F0+(1.0-F0)*pow(1.0-cosTheta,5.0);}
/**
* Once the pixel's coordinates has been found,let's adjust (smooth) a little bit
* by sampling multiple reflection pixels.
*/
ReflectionInfo smoothReflectionInfo(vec3 dir,vec3 hitCoord)
{ReflectionInfo info;info.color=vec3(0.0);vec4 projectedCoord;float sampledDepth;for(int i=0; i<SMOOTH_STEPS; i++)
{projectedCoord=projection*vec4(hitCoord,1.0);projectedCoord.xy/=projectedCoord.w;projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);sampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;float depth=sampledDepth-hitCoord.z;dir*=0.5;if(depth>0.0)
hitCoord-=dir;else
hitCoord+=dir;info.color+=texture2D(textureSampler,projectedCoord.xy).rgb;}
projectedCoord=projection*vec4(hitCoord,1.0);projectedCoord.xy/=projectedCoord.w;projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);info.coords=vec4(projectedCoord.xy,sampledDepth,1.0);info.color+=texture2D(textureSampler,projectedCoord.xy).rgb;info.color/=float(SMOOTH_STEPS+1);return info;}
/**
* Tests the given world position (hitCoord) according to the given reflection vector (dir)
* until it finds a collision (means that depth is enough close to say "it's the pixel to sample!").
*/
ReflectionInfo getReflectionInfo(vec3 dir,vec3 hitCoord)
{ReflectionInfo info;vec4 projectedCoord;float sampledDepth;dir*=stepSize;for(int i=0; i<REFLECTION_SAMPLES; i++)
{hitCoord+=dir;projectedCoord=projection*vec4(hitCoord,1.0);projectedCoord.xy/=projectedCoord.w;projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);sampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;float depth=sampledDepth-hitCoord.z;
#ifdef RIGHT_HANDED_SCENE
depth*=-1.0;
#endif
if(((depth-dir.z)<threshold) && depth<=0.0)
{
#ifdef ENABLE_SMOOTH_REFLECTIONS
return smoothReflectionInfo(dir,hitCoord);
#else
info.color=texture2D(textureSampler,projectedCoord.xy).rgb;info.coords=vec4(projectedCoord.xy,sampledDepth,0.0);return info;
#endif
}}
info.color=texture2D(textureSampler,projectedCoord.xy).rgb;info.coords=vec4(projectedCoord.xy,sampledDepth,0.0);return info;}
vec3 hash(vec3 a)
{a=fract(a*0.8);a+=dot(a,a.yxz+19.19);return fract((a.xxy+a.yxx)*a.zyx);}
#endif
void main()
{
#ifdef SSR_SUPPORTED
vec4 albedoFull=texture2D(textureSampler,vUV);vec3 albedo=albedoFull.rgb;float spec=texture2D(reflectivitySampler,vUV).r;if (spec==0.0) {gl_FragColor=albedoFull;return;}
vec3 normal=(texture2D(normalSampler,vUV)).xyz;vec3 position=(view*texture2D(positionSampler,vUV)).xyz;vec3 reflected=normalize(reflect(normalize(position),normalize(normal)));float roughness=1.0-texture2D(reflectivitySampler,vUV).a;vec3 jitt=mix(vec3(0.0),hash(position),roughness)*roughnessFactor;ReflectionInfo info=getReflectionInfo(jitt+reflected,position);vec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-info.coords.xy));float screenEdgefactor=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);vec3 F0=vec3(0.04);F0 =mix(F0,albedo,spec);vec3 fresnel=fresnelSchlick(max(dot(normalize(normal),normalize(position)),0.0),F0);
#ifdef RIGHT_HANDED_SCENE
reflected.z*=-1.0;
#endif
float reflectionMultiplier=clamp(pow(spec*strength,reflectionSpecularFalloffExponent)*screenEdgefactor*reflected.z,0.0,0.9);float albedoMultiplier=1.0-reflectionMultiplier;vec3 SSR=info.color*fresnel;gl_FragColor=vec4((albedo*albedoMultiplier)+(SSR*reflectionMultiplier),albedoFull.a);
#else
gl_FragColor=texture2D(textureSampler,vUV);
#endif
}
`;
Le.ShadersStore[g7e] = X7e;
class jp extends kr {
  get _geometryBufferRenderer() {
    return this._forceGeometryBuffer ? this._scene.geometryBufferRenderer : null;
  }
  get _prePassRenderer() {
    return this._forceGeometryBuffer ? null : this._scene.prePassRenderer;
  }
  /**
   * Gets a string identifying the name of the class
   * @returns "ScreenSpaceReflectionPostProcess" string
   */
  getClassName() {
    return "ScreenSpaceReflectionPostProcess";
  }
  /**
   * Creates a new instance of ScreenSpaceReflectionPostProcess.
   * @param name The name of the effect.
   * @param scene The scene containing the objects to calculate reflections.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: true)
   * @param forceGeometryBuffer If this post process should use geometry buffer instead of prepass (default: false)
   */
  constructor(e, t, r, n, i, s, a, f = 0, o = !1, d = !1) {
    if (super(e, "screenSpaceReflection", ["projection", "view", "threshold", "reflectionSpecularFalloffExponent", "strength", "stepSize", "roughnessFactor"], ["textureSampler", "normalSampler", "positionSampler", "reflectivitySampler"], r, n, i, s, a, `#define SSR_SUPPORTED
#define REFLECTION_SAMPLES 64
#define SMOOTH_STEPS 5
`, f, void 0, null, o), this.threshold = 1.2, this.strength = 1, this.reflectionSpecularFalloffExponent = 3, this.step = 1, this.roughnessFactor = 0.2, this._forceGeometryBuffer = !1, this._enableSmoothReflections = !1, this._reflectionSamples = 64, this._smoothSteps = 5, this._forceGeometryBuffer = d, this._forceGeometryBuffer) {
      const v = t.enableGeometryBufferRenderer();
      v && v.isSupported && (v.enablePosition = !0, v.enableReflectivity = !0, v.generateNormalsInWorldSpace && console.error("ScreenSpaceReflectionPostProcess does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!"));
    } else {
      const v = t.enablePrePassRenderer();
      v == null || v.markAsDirty(), v != null && v.generateNormalsInWorldSpace && console.error("ScreenSpaceReflectionPostProcess does not support generateNormalsInWorldSpace=true for the prepass renderer!"), this._prePassEffectConfiguration = new H7e();
    }
    this._updateEffectDefines(), this.onApply = (v) => {
      const u = this._geometryBufferRenderer, l = this._prePassRenderer;
      if (!l && !u)
        return;
      if (u) {
        const H = u.getTextureIndex(po.POSITION_TEXTURE_TYPE), T = u.getTextureIndex(po.REFLECTIVITY_TEXTURE_TYPE);
        v.setTexture("normalSampler", u.getGBuffer().textures[1]), v.setTexture("positionSampler", u.getGBuffer().textures[H]), v.setTexture("reflectivitySampler", u.getGBuffer().textures[T]);
      } else if (l) {
        const H = l.getIndex(1), T = l.getIndex(3), q = l.getIndex(6);
        v.setTexture("normalSampler", l.getRenderTarget().textures[q]), v.setTexture("positionSampler", l.getRenderTarget().textures[H]), v.setTexture("reflectivitySampler", l.getRenderTarget().textures[T]);
      }
      const P = t.activeCamera;
      if (!P)
        return;
      const p = P.getViewMatrix(!0), c = P.getProjectionMatrix(!0);
      v.setMatrix("projection", c), v.setMatrix("view", p), v.setFloat("threshold", this.threshold), v.setFloat("reflectionSpecularFalloffExponent", this.reflectionSpecularFalloffExponent), v.setFloat("strength", this.strength), v.setFloat("stepSize", this.step), v.setFloat("roughnessFactor", this.roughnessFactor);
    }, this._isSceneRightHanded = t.useRightHandedSystem;
  }
  /**
   * Gets whether or not smoothing reflections is enabled.
   * Enabling smoothing will require more GPU power and can generate a drop in FPS.
   */
  get enableSmoothReflections() {
    return this._enableSmoothReflections;
  }
  /**
   * Sets whether or not smoothing reflections is enabled.
   * Enabling smoothing will require more GPU power and can generate a drop in FPS.
   */
  set enableSmoothReflections(e) {
    e !== this._enableSmoothReflections && (this._enableSmoothReflections = e, this._updateEffectDefines());
  }
  /**
   * Gets the number of samples taken while computing reflections. More samples count is high,
   * more the post-process wil require GPU power and can generate a drop in FPS. Basically in interval [25, 100].
   */
  get reflectionSamples() {
    return this._reflectionSamples;
  }
  /**
   * Sets the number of samples taken while computing reflections. More samples count is high,
   * more the post-process wil require GPU power and can generate a drop in FPS. Basically in interval [25, 100].
   */
  set reflectionSamples(e) {
    e !== this._reflectionSamples && (this._reflectionSamples = e, this._updateEffectDefines());
  }
  /**
   * Gets the number of samples taken while smoothing reflections. More samples count is high,
   * more the post-process will require GPU power and can generate a drop in FPS.
   * Default value (5.0) work pretty well in all cases but can be adjusted.
   */
  get smoothSteps() {
    return this._smoothSteps;
  }
  /*
   * Sets the number of samples taken while smoothing reflections. More samples count is high,
   * more the post-process will require GPU power and can generate a drop in FPS.
   * Default value (5.0) work pretty well in all cases but can be adjusted.
   */
  set smoothSteps(e) {
    e !== this._smoothSteps && (this._smoothSteps = e, this._updateEffectDefines());
  }
  _updateEffectDefines() {
    const e = [];
    (this._geometryBufferRenderer || this._prePassRenderer) && e.push("#define SSR_SUPPORTED"), this._enableSmoothReflections && e.push("#define ENABLE_SMOOTH_REFLECTIONS"), this._isSceneRightHanded && e.push("#define RIGHT_HANDED_SCENE"), e.push("#define REFLECTION_SAMPLES " + (this._reflectionSamples >> 0)), e.push("#define SMOOTH_STEPS " + (this._smoothSteps >> 0)), this.updateEffect(e.join(`
`));
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new jp(e.name, r, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.textureType, e.reusable), e, r, n);
  }
}
C([
  M()
], jp.prototype, "threshold", void 0);
C([
  M()
], jp.prototype, "strength", void 0);
C([
  M()
], jp.prototype, "reflectionSpecularFalloffExponent", void 0);
C([
  M()
], jp.prototype, "step", void 0);
C([
  M()
], jp.prototype, "roughnessFactor", void 0);
C([
  M()
], jp.prototype, "enableSmoothReflections", null);
C([
  M()
], jp.prototype, "reflectionSamples", null);
C([
  M()
], jp.prototype, "smoothSteps", null);
Ue("BABYLON.ScreenSpaceReflectionPostProcess", jp);
const T7e = "standardPixelShader", q7e = `uniform sampler2D textureSampler;varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
#if defined(PASS_POST_PROCESS)
void main(void)
{vec4 color=texture2D(textureSampler,vUV);gl_FragColor=color;}
#endif
#if defined(DOWN_SAMPLE_X4)
uniform vec2 dsOffsets[16];void main(void)
{vec4 average=vec4(0.0,0.0,0.0,0.0);average=texture2D(textureSampler,vUV+dsOffsets[0]);average+=texture2D(textureSampler,vUV+dsOffsets[1]);average+=texture2D(textureSampler,vUV+dsOffsets[2]);average+=texture2D(textureSampler,vUV+dsOffsets[3]);average+=texture2D(textureSampler,vUV+dsOffsets[4]);average+=texture2D(textureSampler,vUV+dsOffsets[5]);average+=texture2D(textureSampler,vUV+dsOffsets[6]);average+=texture2D(textureSampler,vUV+dsOffsets[7]);average+=texture2D(textureSampler,vUV+dsOffsets[8]);average+=texture2D(textureSampler,vUV+dsOffsets[9]);average+=texture2D(textureSampler,vUV+dsOffsets[10]);average+=texture2D(textureSampler,vUV+dsOffsets[11]);average+=texture2D(textureSampler,vUV+dsOffsets[12]);average+=texture2D(textureSampler,vUV+dsOffsets[13]);average+=texture2D(textureSampler,vUV+dsOffsets[14]);average+=texture2D(textureSampler,vUV+dsOffsets[15]);average/=16.0;gl_FragColor=average;}
#endif
#if defined(BRIGHT_PASS)
uniform vec2 dsOffsets[4];uniform float brightThreshold;void main(void)
{vec4 average=vec4(0.0,0.0,0.0,0.0);average=texture2D(textureSampler,vUV+vec2(dsOffsets[0].x,dsOffsets[0].y));average+=texture2D(textureSampler,vUV+vec2(dsOffsets[1].x,dsOffsets[1].y));average+=texture2D(textureSampler,vUV+vec2(dsOffsets[2].x,dsOffsets[2].y));average+=texture2D(textureSampler,vUV+vec2(dsOffsets[3].x,dsOffsets[3].y));average*=0.25;float luminance=length(average.rgb);if (luminance<brightThreshold) {average=vec4(0.0,0.0,0.0,1.0);}
gl_FragColor=average;}
#endif
#if defined(TEXTURE_ADDER)
uniform sampler2D otherSampler;uniform sampler2D lensSampler;uniform float exposure;void main(void)
{vec3 colour=texture2D(textureSampler,vUV).rgb;colour*=exposure;vec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);vec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);colour=retColor*retColor;colour+=colour*texture2D(lensSampler,vUV).rgb;vec4 finalColor=vec4(colour.rgb,1.0)+texture2D(otherSampler,vUV);gl_FragColor=finalColor;}
#endif
#if defined(VLS)
#define PI 3.1415926535897932384626433832795
uniform mat4 shadowViewProjection;uniform mat4 lightWorld;uniform vec3 cameraPosition;uniform vec3 sunDirection;uniform vec3 sunColor;uniform vec2 depthValues;uniform float scatteringCoefficient;uniform float scatteringPower;uniform sampler2D shadowMapSampler;uniform sampler2D positionSampler;float computeScattering(float lightDotView)
{float result=1.0-scatteringCoefficient*scatteringCoefficient;result/=(4.0*PI*pow(1.0+scatteringCoefficient*scatteringCoefficient-(2.0*scatteringCoefficient)*lightDotView,1.5));return result;}
void main(void)
{vec3 worldPos=texture2D(positionSampler,vUV).rgb;vec3 startPosition=cameraPosition;vec3 rayVector=worldPos-startPosition;float rayLength=length(rayVector);vec3 rayDirection=rayVector/rayLength;float stepLength=rayLength/NB_STEPS;vec3 stepL=rayDirection*stepLength;vec3 currentPosition=startPosition;vec3 accumFog=vec3(0.0);for (int i=0; i<int(NB_STEPS); i++)
{vec4 worldInShadowCameraSpace=shadowViewProjection*vec4(currentPosition,1.0);float depthMetric= (worldInShadowCameraSpace.z+depthValues.x)/(depthValues.y);float shadowPixelDepth=clamp(depthMetric,0.0,1.0);worldInShadowCameraSpace.xyz/=worldInShadowCameraSpace.w;worldInShadowCameraSpace.xyz=0.5*worldInShadowCameraSpace.xyz+vec3(0.5);float shadowMapValue=texture2D(shadowMapSampler,worldInShadowCameraSpace.xy).r;if (shadowMapValue>shadowPixelDepth)
accumFog+=sunColor*computeScattering(dot(rayDirection,sunDirection));currentPosition+=stepL;}
accumFog/=NB_STEPS;vec3 color=accumFog*scatteringPower;gl_FragColor=vec4(color*exp(color) ,1.0);}
#endif
#if defined(VLSMERGE)
uniform sampler2D originalSampler;void main(void)
{gl_FragColor=texture2D(originalSampler,vUV)+texture2D(textureSampler,vUV);}
#endif
#if defined(LUMINANCE)
uniform vec2 lumOffsets[4];void main()
{float average=0.0;vec4 color=vec4(0.0);float maximum=-1e20;vec3 weight=vec3(0.299,0.587,0.114);for (int i=0; i<4; i++)
{color=texture2D(textureSampler,vUV+ lumOffsets[i]);float GreyValue=dot(color.rgb,vec3(0.33,0.33,0.33));
#ifdef WEIGHTED_AVERAGE
float GreyValue=dot(color.rgb,weight);
#endif
#ifdef BRIGHTNESS
float GreyValue=max(color.r,max(color.g,color.b));
#endif
#ifdef HSL_COMPONENT
float GreyValue=0.5*(max(color.r,max(color.g,color.b))+min(color.r,min(color.g,color.b)));
#endif
#ifdef MAGNITUDE
float GreyValue=length(color.rgb);
#endif
maximum=max(maximum,GreyValue);average+=(0.25*log(1e-5+GreyValue));}
average=exp(average);gl_FragColor=vec4(average,maximum,0.0,1.0);}
#endif
#if defined(LUMINANCE_DOWN_SAMPLE)
uniform vec2 dsOffsets[9];uniform float halfDestPixelSize;
#ifdef FINAL_DOWN_SAMPLER
#include<packingFunctions>
#endif
void main()
{vec4 color=vec4(0.0);float average=0.0;for (int i=0; i<9; i++)
{color=texture2D(textureSampler,vUV+vec2(halfDestPixelSize,halfDestPixelSize)+dsOffsets[i]);average+=color.r;}
average/=9.0;
#ifdef FINAL_DOWN_SAMPLER
gl_FragColor=pack(average);
#else
gl_FragColor=vec4(average,average,0.0,1.0);
#endif
}
#endif
#if defined(HDR)
uniform sampler2D textureAdderSampler;uniform float averageLuminance;void main()
{vec4 color=texture2D(textureAdderSampler,vUV);
#ifndef AUTO_EXPOSURE
vec4 adjustedColor=color/averageLuminance;color=adjustedColor;color.a=1.0;
#endif
gl_FragColor=color;}
#endif
#if defined(LENS_FLARE)
#define GHOSTS 3
uniform sampler2D lensColorSampler;uniform float strength;uniform float ghostDispersal;uniform float haloWidth;uniform vec2 resolution;uniform float distortionStrength;float hash(vec2 p)
{float h=dot(p,vec2(127.1,311.7));return -1.0+2.0*fract(sin(h)*43758.5453123);}
float noise(in vec2 p)
{vec2 i=floor(p);vec2 f=fract(p);vec2 u=f*f*(3.0-2.0*f);return mix(mix(hash(i+vec2(0.0,0.0)),
hash(i+vec2(1.0,0.0)),u.x),
mix(hash(i+vec2(0.0,1.0)),
hash(i+vec2(1.0,1.0)),u.x),u.y);}
float fbm(vec2 p)
{float f=0.0;f+=0.5000*noise(p); p*=2.02;f+=0.2500*noise(p); p*=2.03;f+=0.1250*noise(p); p*=2.01;f+=0.0625*noise(p); p*=2.04;f/=0.9375;return f;}
vec3 pattern(vec2 uv)
{vec2 p=-1.0+2.0*uv;float p2=dot(p,p);float f=fbm(vec2(15.0*p2))/2.0;float r=0.2+0.6*sin(12.5*length(uv-vec2(0.5)));float g=0.2+0.6*sin(20.5*length(uv-vec2(0.5)));float b=0.2+0.6*sin(17.2*length(uv-vec2(0.5)));return (1.0-f)*vec3(r,g,b);}
float luminance(vec3 color)
{return dot(color.rgb,vec3(0.2126,0.7152,0.0722));}
vec4 textureDistorted(sampler2D tex,vec2 texcoord,vec2 direction,vec3 distortion)
{return vec4(
texture2D(tex,texcoord+direction*distortion.r).r,
texture2D(tex,texcoord+direction*distortion.g).g,
texture2D(tex,texcoord+direction*distortion.b).b,
1.0
);}
void main(void)
{vec2 uv=-vUV+vec2(1.0);vec2 ghostDir=(vec2(0.5)-uv)*ghostDispersal;vec2 texelSize=1.0/resolution;vec3 distortion=vec3(-texelSize.x*distortionStrength,0.0,texelSize.x*distortionStrength);vec4 result=vec4(0.0);float ghostIndice=1.0;for (int i=0; i<GHOSTS; ++i)
{vec2 offset=fract(uv+ghostDir*ghostIndice);float weight=length(vec2(0.5)-offset)/length(vec2(0.5));weight=pow(1.0-weight,10.0);result+=textureDistorted(textureSampler,offset,normalize(ghostDir),distortion)*weight*strength;ghostIndice+=1.0;}
vec2 haloVec=normalize(ghostDir)*haloWidth;float weight=length(vec2(0.5)-fract(uv+haloVec))/length(vec2(0.5));weight=pow(1.0-weight,10.0);result+=textureDistorted(textureSampler,fract(uv+haloVec),normalize(ghostDir),distortion)*weight*strength;result*=texture2D(lensColorSampler,vec2(length(vec2(0.5)-uv)/length(vec2(0.5))));gl_FragColor=result;}
#endif
#if defined(LENS_FLARE_COMPOSE)
uniform sampler2D otherSampler;uniform sampler2D lensDirtSampler;uniform sampler2D lensStarSampler;uniform mat4 lensStarMatrix;void main(void)
{vec2 lensFlareCoords=(lensStarMatrix*vec4(vUV,1.0,1.0)).xy;vec4 lensMod=texture2D(lensDirtSampler,vUV);lensMod+=texture2D(lensStarSampler,vUV/*lensFlareCoords*/);vec4 result=texture2D(textureSampler,vUV)*lensMod;gl_FragColor=texture2D(otherSampler,vUV)+result;}
#endif
#if defined(DEPTH_OF_FIELD)
uniform sampler2D otherSampler;uniform sampler2D depthSampler;uniform float distance;void main(void)
{vec4 sharp=texture2D(otherSampler,vUV);vec4 blur=texture2D(textureSampler,vUV);float dist=clamp(texture2D(depthSampler,vUV).r*distance,0.0,1.0);float factor=0.0;if (dist<0.05)
factor=1.0;else if (dist<0.1)
factor=20.0*(0.1-dist);else if (dist<0.5)
factor=0.0;else
factor=2.0*(dist-0.5);factor=clamp(factor,0.0,0.90);gl_FragColor=mix(sharp,blur,factor);}
#endif
#if defined(MOTION_BLUR)
uniform mat4 inverseViewProjection;uniform mat4 prevViewProjection;uniform vec2 screenSize;uniform float motionScale;uniform float motionStrength;uniform sampler2D depthSampler;void main(void)
{vec2 texelSize=1.0/screenSize;float depth=texture2D(depthSampler,vUV).r;vec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);cpos=cpos*inverseViewProjection;vec4 ppos=cpos*prevViewProjection;ppos.xyz/=ppos.w;ppos.xy=ppos.xy*0.5+0.5;vec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;float speed=length(velocity/texelSize);int nSamples=int(clamp(speed,1.0,MAX_MOTION_SAMPLES));vec4 result=texture2D(textureSampler,vUV);for (int i=1; i<int(MAX_MOTION_SAMPLES); ++i) {if (i>=nSamples)
break;vec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);result+=texture2D(textureSampler,offset1);}
gl_FragColor=result/float(nSamples);}
#endif
`;
Le.ShadersStore[T7e] = q7e;
class Ss extends SD {
  /**
   * Gets the overall exposure used by the pipeline
   */
  get exposure() {
    return this._fixedExposure;
  }
  /**
   * Sets the overall exposure used by the pipeline
   */
  set exposure(e) {
    this._fixedExposure = e, this._currentExposure = e;
  }
  /**
   * Gets whether or not the exposure of the overall pipeline should be automatically adjusted by the HDR post-process
   */
  get hdrAutoExposure() {
    return this._hdrAutoExposure;
  }
  /**
   * Sets whether or not the exposure of the overall pipeline should be automatically adjusted by the HDR post-process
   */
  set hdrAutoExposure(e) {
    if (this._hdrAutoExposure = e, this.hdrPostProcess) {
      const t = ["#define HDR"];
      e && t.push("#define AUTO_EXPOSURE"), this.hdrPostProcess.updateEffect(t.join(`
`));
    }
  }
  /**
   * Gets how much the image is blurred by the movement while using the motion blur post-process
   */
  get motionStrength() {
    return this._motionStrength;
  }
  /**
   * Sets how much the image is blurred by the movement while using the motion blur post-process
   */
  set motionStrength(e) {
    this._motionStrength = e, this._isObjectBasedMotionBlur && this.motionBlurPostProcess && (this.motionBlurPostProcess.motionStrength = e);
  }
  /**
   * Gets whether or not the motion blur post-process is object based or screen based.
   */
  get objectBasedMotionBlur() {
    return this._isObjectBasedMotionBlur;
  }
  /**
   * Sets whether or not the motion blur post-process should be object based or screen based
   */
  set objectBasedMotionBlur(e) {
    const t = this._isObjectBasedMotionBlur !== e;
    this._isObjectBasedMotionBlur = e, t && this._buildPipeline();
  }
  /**
   * @ignore
   * Specifies if the bloom pipeline is enabled
   */
  get BloomEnabled() {
    return this._bloomEnabled;
  }
  set BloomEnabled(e) {
    this._bloomEnabled !== e && (this._bloomEnabled = e, this._buildPipeline());
  }
  /**
   * @ignore
   * Specifies if the depth of field pipeline is enabled
   */
  get DepthOfFieldEnabled() {
    return this._depthOfFieldEnabled;
  }
  set DepthOfFieldEnabled(e) {
    this._depthOfFieldEnabled !== e && (this._depthOfFieldEnabled = e, this._buildPipeline());
  }
  /**
   * @ignore
   * Specifies if the lens flare pipeline is enabled
   */
  get LensFlareEnabled() {
    return this._lensFlareEnabled;
  }
  set LensFlareEnabled(e) {
    this._lensFlareEnabled !== e && (this._lensFlareEnabled = e, this._buildPipeline());
  }
  /**
   * @ignore
   * Specifies if the HDR pipeline is enabled
   */
  get HDREnabled() {
    return this._hdrEnabled;
  }
  set HDREnabled(e) {
    this._hdrEnabled !== e && (this._hdrEnabled = e, this._buildPipeline());
  }
  /**
   * @ignore
   * Specifies if the volumetric lights scattering effect is enabled
   */
  get VLSEnabled() {
    return this._vlsEnabled;
  }
  // eslint-disable-next-line @typescript-eslint/naming-convention
  set VLSEnabled(e) {
    if (this._vlsEnabled !== e) {
      if (e && !this._scene.enableGeometryBufferRenderer()) {
        Se.Warn("Geometry renderer is not supported, cannot create volumetric lights in Standard Rendering Pipeline");
        return;
      }
      this._vlsEnabled = e, this._buildPipeline();
    }
  }
  /**
   * @ignore
   * Specifies if the motion blur effect is enabled
   */
  get MotionBlurEnabled() {
    return this._motionBlurEnabled;
  }
  set MotionBlurEnabled(e) {
    this._motionBlurEnabled !== e && (this._motionBlurEnabled = e, this._buildPipeline());
  }
  /**
   * Specifies if anti-aliasing is enabled
   */
  get fxaaEnabled() {
    return this._fxaaEnabled;
  }
  set fxaaEnabled(e) {
    this._fxaaEnabled !== e && (this._fxaaEnabled = e, this._buildPipeline());
  }
  /**
   * Specifies if screen space reflections are enabled.
   */
  get screenSpaceReflectionsEnabled() {
    return this._screenSpaceReflectionsEnabled;
  }
  set screenSpaceReflectionsEnabled(e) {
    this._screenSpaceReflectionsEnabled !== e && (this._screenSpaceReflectionsEnabled = e, this._buildPipeline());
  }
  /**
   * Specifies the number of steps used to calculate the volumetric lights
   * Typically in interval [50, 200]
   */
  get volumetricLightStepsCount() {
    return this._volumetricLightStepsCount;
  }
  set volumetricLightStepsCount(e) {
    this.volumetricLightPostProcess && this.volumetricLightPostProcess.updateEffect(`#define VLS
#define NB_STEPS ` + e.toFixed(1)), this._volumetricLightStepsCount = e;
  }
  /**
   * Specifies the number of samples used for the motion blur effect
   * Typically in interval [16, 64]
   */
  get motionBlurSamples() {
    return this._motionBlurSamples;
  }
  set motionBlurSamples(e) {
    this.motionBlurPostProcess && (this._isObjectBasedMotionBlur ? this.motionBlurPostProcess.motionBlurSamples = e : this.motionBlurPostProcess.updateEffect(`#define MOTION_BLUR
#define MAX_MOTION_SAMPLES ` + e.toFixed(1))), this._motionBlurSamples = e;
  }
  /**
   * Specifies MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)
   */
  get samples() {
    return this._samples;
  }
  set samples(e) {
    this._samples !== e && (this._samples = e, this._buildPipeline());
  }
  /**
   * Default pipeline should be used going forward but the standard pipeline will be kept for backwards compatibility.
   * @constructor
   * @param name The rendering pipeline name
   * @param scene The scene linked to this pipeline
   * @param ratio The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5)
   * @param originalPostProcess the custom original color post-process. Must be "reusable". Can be null.
   * @param cameras The array of cameras that the rendering pipeline will be attached to
   */
  constructor(e, t, r, n = null, i) {
    super(t.getEngine(), e), this.downSampleX4PostProcess = null, this.brightPassPostProcess = null, this.blurHPostProcesses = [], this.blurVPostProcesses = [], this.textureAdderPostProcess = null, this.volumetricLightPostProcess = null, this.volumetricLightSmoothXPostProcess = null, this.volumetricLightSmoothYPostProcess = null, this.volumetricLightMergePostProces = null, this.volumetricLightFinalPostProcess = null, this.luminancePostProcess = null, this.luminanceDownSamplePostProcesses = [], this.hdrPostProcess = null, this.textureAdderFinalPostProcess = null, this.lensFlareFinalPostProcess = null, this.hdrFinalPostProcess = null, this.lensFlarePostProcess = null, this.lensFlareComposePostProcess = null, this.motionBlurPostProcess = null, this.depthOfFieldPostProcess = null, this.fxaaPostProcess = null, this.screenSpaceReflectionPostProcess = null, this.brightThreshold = 1, this.blurWidth = 512, this.horizontalBlur = !1, this.lensTexture = null, this.volumetricLightCoefficient = 0.2, this.volumetricLightPower = 4, this.volumetricLightBlurScale = 64, this.sourceLight = null, this.hdrMinimumLuminance = 1, this.hdrDecreaseRate = 0.5, this.hdrIncreaseRate = 0.5, this.lensColorTexture = null, this.lensFlareStrength = 20, this.lensFlareGhostDispersal = 1.4, this.lensFlareHaloWidth = 0.7, this.lensFlareDistortionStrength = 16, this.lensFlareBlurWidth = 512, this.lensStarTexture = null, this.lensFlareDirtTexture = null, this.depthOfFieldDistance = 10, this.depthOfFieldBlurWidth = 64, this.animations = [], this._currentDepthOfFieldSource = null, this._fixedExposure = 1, this._currentExposure = 1, this._hdrAutoExposure = !1, this._hdrCurrentLuminance = 1, this._motionStrength = 1, this._isObjectBasedMotionBlur = !1, this._camerasToBeAttached = [], this._bloomEnabled = !1, this._depthOfFieldEnabled = !1, this._vlsEnabled = !1, this._lensFlareEnabled = !1, this._hdrEnabled = !1, this._motionBlurEnabled = !1, this._fxaaEnabled = !1, this._screenSpaceReflectionsEnabled = !1, this._motionBlurSamples = 64, this._volumetricLightStepsCount = 50, this._samples = 1, this._cameras = i || t.cameras, this._cameras = this._cameras.slice(), this._camerasToBeAttached = this._cameras.slice(), this._scene = t, this._basePostProcess = n, this._ratio = r, this._floatTextureType = t.getEngine().getCaps().textureFloatRender ? 1 : 2, t.postProcessRenderPipelineManager.addPipeline(this), this._buildPipeline();
  }
  _buildPipeline() {
    const e = this._ratio, t = this._scene;
    this._disposePostProcesses(), this._cameras !== null && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()), this._reset(), this._screenSpaceReflectionsEnabled && (this.screenSpaceReflectionPostProcess = new jp("HDRPass", t, e, null, We.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, this._floatTextureType), this.screenSpaceReflectionPostProcess.onApplyObservable.add(() => {
      this._currentDepthOfFieldSource = this.screenSpaceReflectionPostProcess;
    }), this.addEffect(new gs(t.getEngine(), "HDRScreenSpaceReflections", () => this.screenSpaceReflectionPostProcess, !0))), this._basePostProcess ? this.originalPostProcess = this._basePostProcess : this.originalPostProcess = new kr("HDRPass", "standard", [], [], e, null, We.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, "#define PASS_POST_PROCESS", this._floatTextureType), this.originalPostProcess.autoClear = !this.screenSpaceReflectionPostProcess, this.originalPostProcess.onApplyObservable.add(() => {
      this._currentDepthOfFieldSource = this.originalPostProcess;
    }), this.addEffect(new gs(t.getEngine(), "HDRPassPostProcess", () => this.originalPostProcess, !0)), this._bloomEnabled && (this._createDownSampleX4PostProcess(t, e / 4), this._createBrightPassPostProcess(t, e / 4), this._createBlurPostProcesses(t, e / 4, 1), this._createTextureAdderPostProcess(t, e), this.textureAdderFinalPostProcess = new kr("HDRDepthOfFieldSource", "standard", [], [], e, null, We.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, "#define PASS_POST_PROCESS", 0), this.addEffect(new gs(t.getEngine(), "HDRBaseDepthOfFieldSource", () => this.textureAdderFinalPostProcess, !0))), this._vlsEnabled && (this._createVolumetricLightPostProcess(t, e), this.volumetricLightFinalPostProcess = new kr("HDRVLSFinal", "standard", [], [], e, null, We.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, "#define PASS_POST_PROCESS", 0), this.addEffect(new gs(t.getEngine(), "HDRVLSFinal", () => this.volumetricLightFinalPostProcess, !0))), this._lensFlareEnabled && (this._createLensFlarePostProcess(t, e), this.lensFlareFinalPostProcess = new kr("HDRPostLensFlareDepthOfFieldSource", "standard", [], [], e, null, We.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, "#define PASS_POST_PROCESS", 0), this.addEffect(new gs(t.getEngine(), "HDRPostLensFlareDepthOfFieldSource", () => this.lensFlareFinalPostProcess, !0))), this._hdrEnabled && (this._createLuminancePostProcesses(t, this._floatTextureType), this._createHdrPostProcess(t, e), this.hdrFinalPostProcess = new kr("HDRPostHDReDepthOfFieldSource", "standard", [], [], e, null, We.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, "#define PASS_POST_PROCESS", 0), this.addEffect(new gs(t.getEngine(), "HDRPostHDReDepthOfFieldSource", () => this.hdrFinalPostProcess, !0))), this._depthOfFieldEnabled && (this._createBlurPostProcesses(t, e / 2, 3, "depthOfFieldBlurWidth"), this._createDepthOfFieldPostProcess(t, e)), this._motionBlurEnabled && this._createMotionBlurPostProcess(t, e), this._fxaaEnabled && (this.fxaaPostProcess = new ym("fxaa", 1, null, We.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, 0), this.addEffect(new gs(t.getEngine(), "HDRFxaa", () => this.fxaaPostProcess, !0))), this._cameras !== null && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras), !this._enableMSAAOnFirstPostProcess(this._samples) && this._samples > 1 && Se.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");
  }
  // Down Sample X4 Post-Process
  _createDownSampleX4PostProcess(e, t) {
    const r = new Array(32);
    this.downSampleX4PostProcess = new kr("HDRDownSampleX4", "standard", ["dsOffsets"], [], t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define DOWN_SAMPLE_X4", this._floatTextureType), this.downSampleX4PostProcess.onApply = (n) => {
      let i = 0;
      const s = this.downSampleX4PostProcess.width, a = this.downSampleX4PostProcess.height;
      for (let f = -2; f < 2; f++)
        for (let o = -2; o < 2; o++)
          r[i] = (f + 0.5) * (1 / s), r[i + 1] = (o + 0.5) * (1 / a), i += 2;
      n.setArray2("dsOffsets", r);
    }, this.addEffect(new gs(e.getEngine(), "HDRDownSampleX4", () => this.downSampleX4PostProcess, !0));
  }
  // Brightpass Post-Process
  _createBrightPassPostProcess(e, t) {
    const r = new Array(8);
    this.brightPassPostProcess = new kr("HDRBrightPass", "standard", ["dsOffsets", "brightThreshold"], [], t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define BRIGHT_PASS", this._floatTextureType), this.brightPassPostProcess.onApply = (n) => {
      const i = 1 / this.brightPassPostProcess.width, s = 1 / this.brightPassPostProcess.height;
      r[0] = -0.5 * i, r[1] = 0.5 * s, r[2] = 0.5 * i, r[3] = 0.5 * s, r[4] = -0.5 * i, r[5] = -0.5 * s, r[6] = 0.5 * i, r[7] = -0.5 * s, n.setArray2("dsOffsets", r), n.setFloat("brightThreshold", this.brightThreshold);
    }, this.addEffect(new gs(e.getEngine(), "HDRBrightPass", () => this.brightPassPostProcess, !0));
  }
  // Create blur H&V post-processes
  _createBlurPostProcesses(e, t, r, n = "blurWidth") {
    const i = e.getEngine(), s = new c9("HDRBlurH_" + r, new at(1, 0), this[n], t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, this._floatTextureType), a = new c9("HDRBlurV_" + r, new at(0, 1), this[n], t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, this._floatTextureType);
    s.onActivateObservable.add(() => {
      const f = s.width / i.getRenderWidth();
      s.kernel = this[n] * f;
    }), a.onActivateObservable.add(() => {
      const f = a.height / i.getRenderHeight();
      a.kernel = this.horizontalBlur ? 64 * f : this[n] * f;
    }), this.addEffect(new gs(e.getEngine(), "HDRBlurH" + r, () => s, !0)), this.addEffect(new gs(e.getEngine(), "HDRBlurV" + r, () => a, !0)), this.blurHPostProcesses.push(s), this.blurVPostProcesses.push(a);
  }
  // Create texture adder post-process
  _createTextureAdderPostProcess(e, t) {
    this.textureAdderPostProcess = new kr("HDRTextureAdder", "standard", ["exposure"], ["otherSampler", "lensSampler"], t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define TEXTURE_ADDER", this._floatTextureType), this.textureAdderPostProcess.onApply = (r) => {
      r.setTextureFromPostProcess("otherSampler", this._vlsEnabled ? this._currentDepthOfFieldSource : this.originalPostProcess), r.setTexture("lensSampler", this.lensTexture), r.setFloat("exposure", this._currentExposure), this._currentDepthOfFieldSource = this.textureAdderFinalPostProcess;
    }, this.addEffect(new gs(e.getEngine(), "HDRTextureAdder", () => this.textureAdderPostProcess, !0));
  }
  _createVolumetricLightPostProcess(e, t) {
    const r = e.enableGeometryBufferRenderer();
    r.enablePosition = !0;
    const n = r.getGBuffer();
    this.volumetricLightPostProcess = new kr("HDRVLS", "standard", ["shadowViewProjection", "cameraPosition", "sunDirection", "sunColor", "scatteringCoefficient", "scatteringPower", "depthValues"], ["shadowMapSampler", "positionSampler"], t / 8, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, `#define VLS
#define NB_STEPS ` + this._volumetricLightStepsCount.toFixed(1));
    const i = at.Zero();
    this.volumetricLightPostProcess.onApply = (s) => {
      if (this.sourceLight && this.sourceLight.getShadowGenerator() && this._scene.activeCamera) {
        const a = this.sourceLight.getShadowGenerator();
        s.setTexture("shadowMapSampler", a.getShadowMap()), s.setTexture("positionSampler", n.textures[2]), s.setColor3("sunColor", this.sourceLight.diffuse), s.setVector3("sunDirection", this.sourceLight.getShadowDirection()), s.setVector3("cameraPosition", this._scene.activeCamera.globalPosition), s.setMatrix("shadowViewProjection", a.getTransformMatrix()), s.setFloat("scatteringCoefficient", this.volumetricLightCoefficient), s.setFloat("scatteringPower", this.volumetricLightPower), i.x = this.sourceLight.getDepthMinZ(this._scene.activeCamera), i.y = this.sourceLight.getDepthMaxZ(this._scene.activeCamera), s.setVector2("depthValues", i);
      }
    }, this.addEffect(new gs(e.getEngine(), "HDRVLS", () => this.volumetricLightPostProcess, !0)), this._createBlurPostProcesses(e, t / 4, 0, "volumetricLightBlurScale"), this.volumetricLightMergePostProces = new kr("HDRVLSMerge", "standard", [], ["originalSampler"], t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define VLSMERGE"), this.volumetricLightMergePostProces.onApply = (s) => {
      s.setTextureFromPostProcess("originalSampler", this._bloomEnabled ? this.textureAdderFinalPostProcess : this.originalPostProcess), this._currentDepthOfFieldSource = this.volumetricLightFinalPostProcess;
    }, this.addEffect(new gs(e.getEngine(), "HDRVLSMerge", () => this.volumetricLightMergePostProces, !0));
  }
  // Create luminance
  _createLuminancePostProcesses(e, t) {
    let r = Math.pow(3, Ss.LuminanceSteps);
    this.luminancePostProcess = new kr("HDRLuminance", "standard", ["lumOffsets"], [], { width: r, height: r }, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define LUMINANCE", t);
    const n = [];
    this.luminancePostProcess.onApply = (s) => {
      const a = 1 / this.luminancePostProcess.width, f = 1 / this.luminancePostProcess.height;
      n[0] = -0.5 * a, n[1] = 0.5 * f, n[2] = 0.5 * a, n[3] = 0.5 * f, n[4] = -0.5 * a, n[5] = -0.5 * f, n[6] = 0.5 * a, n[7] = -0.5 * f, s.setArray2("lumOffsets", n);
    }, this.addEffect(new gs(e.getEngine(), "HDRLuminance", () => this.luminancePostProcess, !0));
    for (let s = Ss.LuminanceSteps - 1; s >= 0; s--) {
      r = Math.pow(3, s);
      let a = `#define LUMINANCE_DOWN_SAMPLE
`;
      s === 0 && (a += "#define FINAL_DOWN_SAMPLER");
      const f = new kr("HDRLuminanceDownSample" + s, "standard", ["dsOffsets", "halfDestPixelSize"], [], { width: r, height: r }, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, a, t);
      this.luminanceDownSamplePostProcesses.push(f);
    }
    let i = this.luminancePostProcess;
    this.luminanceDownSamplePostProcesses.forEach((s, a) => {
      const f = new Array(18);
      s.onApply = (o) => {
        if (!i)
          return;
        let d = 0;
        for (let v = -1; v < 2; v++)
          for (let u = -1; u < 2; u++)
            f[d] = v / i.width, f[d + 1] = u / i.height, d += 2;
        o.setArray2("dsOffsets", f), o.setFloat("halfDestPixelSize", 0.5 / i.width), a === this.luminanceDownSamplePostProcesses.length - 1 ? i = this.luminancePostProcess : i = s;
      }, a === this.luminanceDownSamplePostProcesses.length - 1 && (s.onAfterRender = () => {
        const o = e.getEngine().readPixels(0, 0, 1, 1), d = new Ir(1 / (255 * 255 * 255), 1 / (255 * 255), 1 / 255, 1);
        o.then((v) => {
          const u = new Uint8Array(v.buffer);
          this._hdrCurrentLuminance = (u[0] * d.x + u[1] * d.y + u[2] * d.z + u[3] * d.w) / 100;
        });
      }), this.addEffect(new gs(e.getEngine(), "HDRLuminanceDownSample" + a, () => s, !0));
    });
  }
  // Create HDR post-process
  _createHdrPostProcess(e, t) {
    const r = ["#define HDR"];
    this._hdrAutoExposure && r.push("#define AUTO_EXPOSURE"), this.hdrPostProcess = new kr("HDR", "standard", ["averageLuminance"], ["textureAdderSampler"], t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, r.join(`
`), 0);
    let n = 1, i = 0, s = 0;
    this.hdrPostProcess.onApply = (a) => {
      if (a.setTextureFromPostProcess("textureAdderSampler", this._currentDepthOfFieldSource), i += e.getEngine().getDeltaTime(), n < 0)
        n = this._hdrCurrentLuminance;
      else {
        const f = (s - i) / 1e3;
        this._hdrCurrentLuminance < n + this.hdrDecreaseRate * f ? n += this.hdrDecreaseRate * f : this._hdrCurrentLuminance > n - this.hdrIncreaseRate * f ? n -= this.hdrIncreaseRate * f : n = this._hdrCurrentLuminance;
      }
      this.hdrAutoExposure ? this._currentExposure = this._fixedExposure / n : (n = Xt.Clamp(n, this.hdrMinimumLuminance, 1e20), a.setFloat("averageLuminance", n)), s = i, this._currentDepthOfFieldSource = this.hdrFinalPostProcess;
    }, this.addEffect(new gs(e.getEngine(), "HDR", () => this.hdrPostProcess, !0));
  }
  // Create lens flare post-process
  _createLensFlarePostProcess(e, t) {
    this.lensFlarePostProcess = new kr("HDRLensFlare", "standard", ["strength", "ghostDispersal", "haloWidth", "resolution", "distortionStrength"], ["lensColorSampler"], t / 2, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define LENS_FLARE", 0), this.addEffect(new gs(e.getEngine(), "HDRLensFlare", () => this.lensFlarePostProcess, !0)), this._createBlurPostProcesses(e, t / 4, 2, "lensFlareBlurWidth"), this.lensFlareComposePostProcess = new kr("HDRLensFlareCompose", "standard", ["lensStarMatrix"], ["otherSampler", "lensDirtSampler", "lensStarSampler"], t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define LENS_FLARE_COMPOSE", 0), this.addEffect(new gs(e.getEngine(), "HDRLensFlareCompose", () => this.lensFlareComposePostProcess, !0));
    const r = new at(0, 0);
    this.lensFlarePostProcess.externalTextureSamplerBinding = !0, this.lensFlarePostProcess.onApply = (s) => {
      s.setTextureFromPostProcess("textureSampler", this._bloomEnabled ? this.blurHPostProcesses[0] : this.originalPostProcess), s.setTexture("lensColorSampler", this.lensColorTexture), s.setFloat("strength", this.lensFlareStrength), s.setFloat("ghostDispersal", this.lensFlareGhostDispersal), s.setFloat("haloWidth", this.lensFlareHaloWidth), r.x = this.lensFlarePostProcess.width, r.y = this.lensFlarePostProcess.height, s.setVector2("resolution", r), s.setFloat("distortionStrength", this.lensFlareDistortionStrength);
    };
    const n = he.FromValues(2, 0, -1, 0, 0, 2, -1, 0, 0, 0, 1, 0, 0, 0, 0, 1), i = he.FromValues(0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    this.lensFlareComposePostProcess.onApply = (s) => {
      if (!this._scene.activeCamera)
        return;
      s.setTextureFromPostProcess("otherSampler", this.lensFlarePostProcess), s.setTexture("lensDirtSampler", this.lensFlareDirtTexture), s.setTexture("lensStarSampler", this.lensStarTexture);
      const a = this._scene.activeCamera.getViewMatrix().getRow(0), f = this._scene.activeCamera.getViewMatrix().getRow(2);
      let o = S.Dot(a.toVector3(), new S(1, 0, 0)) + S.Dot(f.toVector3(), new S(0, 0, 1));
      o *= 4;
      const d = he.FromValues(Math.cos(o) * 0.5, -Math.sin(o), 0, 0, Math.sin(o), Math.cos(o) * 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), v = i.multiply(d).multiply(n);
      s.setMatrix("lensStarMatrix", v), this._currentDepthOfFieldSource = this.lensFlareFinalPostProcess;
    };
  }
  // Create depth-of-field post-process
  _createDepthOfFieldPostProcess(e, t) {
    this.depthOfFieldPostProcess = new kr("HDRDepthOfField", "standard", ["distance"], ["otherSampler", "depthSampler"], t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define DEPTH_OF_FIELD", 0), this.depthOfFieldPostProcess.onApply = (r) => {
      r.setTextureFromPostProcess("otherSampler", this._currentDepthOfFieldSource), r.setTexture("depthSampler", this._getDepthTexture()), r.setFloat("distance", this.depthOfFieldDistance);
    }, this.addEffect(new gs(e.getEngine(), "HDRDepthOfField", () => this.depthOfFieldPostProcess, !0));
  }
  // Create motion blur post-process
  _createMotionBlurPostProcess(e, t) {
    if (this._isObjectBasedMotionBlur) {
      const r = new BD("HDRMotionBlur", e, t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, 0);
      r.motionStrength = this.motionStrength, r.motionBlurSamples = this.motionBlurSamples, this.motionBlurPostProcess = r;
    } else {
      this.motionBlurPostProcess = new kr("HDRMotionBlur", "standard", ["inverseViewProjection", "prevViewProjection", "screenSize", "motionScale", "motionStrength"], ["depthSampler"], t, null, We.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, `#define MOTION_BLUR
#define MAX_MOTION_SAMPLES ` + this.motionBlurSamples.toFixed(1), 0);
      let r = 0, n = he.Identity();
      const i = he.Identity();
      let s = he.Identity();
      const a = at.Zero();
      this.motionBlurPostProcess.onApply = (f) => {
        s = e.getProjectionMatrix().multiply(e.getViewMatrix()), s.invertToRef(i), f.setMatrix("inverseViewProjection", i), f.setMatrix("prevViewProjection", n), n = s, a.x = this.motionBlurPostProcess.width, a.y = this.motionBlurPostProcess.height, f.setVector2("screenSize", a), r = e.getEngine().getFps() / 60, f.setFloat("motionScale", r), f.setFloat("motionStrength", this.motionStrength), f.setTexture("depthSampler", this._getDepthTexture());
      };
    }
    this.addEffect(new gs(e.getEngine(), "HDRMotionBlur", () => this.motionBlurPostProcess, !0));
  }
  _getDepthTexture() {
    return this._scene.getEngine().getCaps().drawBuffersExtension ? this._scene.enableGeometryBufferRenderer().getGBuffer().textures[0] : this._scene.enableDepthRenderer().getDepthMap();
  }
  _disposePostProcesses() {
    for (let e = 0; e < this._cameras.length; e++) {
      const t = this._cameras[e];
      this.originalPostProcess && this.originalPostProcess.dispose(t), this.screenSpaceReflectionPostProcess && this.screenSpaceReflectionPostProcess.dispose(t), this.downSampleX4PostProcess && this.downSampleX4PostProcess.dispose(t), this.brightPassPostProcess && this.brightPassPostProcess.dispose(t), this.textureAdderPostProcess && this.textureAdderPostProcess.dispose(t), this.volumetricLightPostProcess && this.volumetricLightPostProcess.dispose(t), this.volumetricLightSmoothXPostProcess && this.volumetricLightSmoothXPostProcess.dispose(t), this.volumetricLightSmoothYPostProcess && this.volumetricLightSmoothYPostProcess.dispose(t), this.volumetricLightMergePostProces && this.volumetricLightMergePostProces.dispose(t), this.volumetricLightFinalPostProcess && this.volumetricLightFinalPostProcess.dispose(t), this.lensFlarePostProcess && this.lensFlarePostProcess.dispose(t), this.lensFlareComposePostProcess && this.lensFlareComposePostProcess.dispose(t);
      for (let r = 0; r < this.luminanceDownSamplePostProcesses.length; r++)
        this.luminanceDownSamplePostProcesses[r].dispose(t);
      this.luminancePostProcess && this.luminancePostProcess.dispose(t), this.hdrPostProcess && this.hdrPostProcess.dispose(t), this.hdrFinalPostProcess && this.hdrFinalPostProcess.dispose(t), this.depthOfFieldPostProcess && this.depthOfFieldPostProcess.dispose(t), this.motionBlurPostProcess && this.motionBlurPostProcess.dispose(t), this.fxaaPostProcess && this.fxaaPostProcess.dispose(t);
      for (let r = 0; r < this.blurHPostProcesses.length; r++)
        this.blurHPostProcesses[r].dispose(t);
      for (let r = 0; r < this.blurVPostProcesses.length; r++)
        this.blurVPostProcesses[r].dispose(t);
    }
    this.originalPostProcess = null, this.downSampleX4PostProcess = null, this.brightPassPostProcess = null, this.textureAdderPostProcess = null, this.textureAdderFinalPostProcess = null, this.volumetricLightPostProcess = null, this.volumetricLightSmoothXPostProcess = null, this.volumetricLightSmoothYPostProcess = null, this.volumetricLightMergePostProces = null, this.volumetricLightFinalPostProcess = null, this.lensFlarePostProcess = null, this.lensFlareComposePostProcess = null, this.luminancePostProcess = null, this.hdrPostProcess = null, this.hdrFinalPostProcess = null, this.depthOfFieldPostProcess = null, this.motionBlurPostProcess = null, this.fxaaPostProcess = null, this.screenSpaceReflectionPostProcess = null, this.luminanceDownSamplePostProcesses.length = 0, this.blurHPostProcesses.length = 0, this.blurVPostProcesses.length = 0;
  }
  /**
   * Dispose of the pipeline and stop all post processes
   */
  dispose() {
    this._disposePostProcesses(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), super.dispose();
  }
  /**
   * Serialize the rendering pipeline (Used when exporting)
   * @returns the serialized object
   */
  serialize() {
    const e = jt.Serialize(this);
    return this.sourceLight && (e.sourceLightId = this.sourceLight.id), this.screenSpaceReflectionPostProcess && (e.screenSpaceReflectionPostProcess = jt.Serialize(this.screenSpaceReflectionPostProcess)), e.customType = "StandardRenderingPipeline", e;
  }
  /**
   * Parse the serialized pipeline
   * @param source Source pipeline.
   * @param scene The scene to load the pipeline to.
   * @param rootUrl The URL of the serialized pipeline.
   * @returns An instantiated pipeline from the serialized object.
   */
  static Parse(e, t, r) {
    const n = jt.Parse(() => new Ss(e._name, t, e._ratio), e, t, r);
    return e.sourceLightId && (n.sourceLight = t.getLightById(e.sourceLightId)), e.screenSpaceReflectionPostProcess && jt.Parse(() => n.screenSpaceReflectionPostProcess, e.screenSpaceReflectionPostProcess, t, r), n;
  }
}
Ss.LuminanceSteps = 6;
C([
  M()
], Ss.prototype, "brightThreshold", void 0);
C([
  M()
], Ss.prototype, "blurWidth", void 0);
C([
  M()
], Ss.prototype, "horizontalBlur", void 0);
C([
  M()
], Ss.prototype, "exposure", null);
C([
  en("lensTexture")
], Ss.prototype, "lensTexture", void 0);
C([
  M()
], Ss.prototype, "volumetricLightCoefficient", void 0);
C([
  M()
], Ss.prototype, "volumetricLightPower", void 0);
C([
  M()
], Ss.prototype, "volumetricLightBlurScale", void 0);
C([
  M()
], Ss.prototype, "hdrMinimumLuminance", void 0);
C([
  M()
], Ss.prototype, "hdrDecreaseRate", void 0);
C([
  M()
], Ss.prototype, "hdrIncreaseRate", void 0);
C([
  M()
], Ss.prototype, "hdrAutoExposure", null);
C([
  en("lensColorTexture")
], Ss.prototype, "lensColorTexture", void 0);
C([
  M()
], Ss.prototype, "lensFlareStrength", void 0);
C([
  M()
], Ss.prototype, "lensFlareGhostDispersal", void 0);
C([
  M()
], Ss.prototype, "lensFlareHaloWidth", void 0);
C([
  M()
], Ss.prototype, "lensFlareDistortionStrength", void 0);
C([
  M()
], Ss.prototype, "lensFlareBlurWidth", void 0);
C([
  en("lensStarTexture")
], Ss.prototype, "lensStarTexture", void 0);
C([
  en("lensFlareDirtTexture")
], Ss.prototype, "lensFlareDirtTexture", void 0);
C([
  M()
], Ss.prototype, "depthOfFieldDistance", void 0);
C([
  M()
], Ss.prototype, "depthOfFieldBlurWidth", void 0);
C([
  M()
], Ss.prototype, "motionStrength", null);
C([
  M()
], Ss.prototype, "objectBasedMotionBlur", null);
C([
  M()
], Ss.prototype, "_ratio", void 0);
C([
  M()
], Ss.prototype, "BloomEnabled", null);
C([
  M()
], Ss.prototype, "DepthOfFieldEnabled", null);
C([
  M()
], Ss.prototype, "LensFlareEnabled", null);
C([
  M()
], Ss.prototype, "HDREnabled", null);
C([
  M()
  // eslint-disable-next-line @typescript-eslint/naming-convention
], Ss.prototype, "VLSEnabled", null);
C([
  M()
], Ss.prototype, "MotionBlurEnabled", null);
C([
  M()
], Ss.prototype, "fxaaEnabled", null);
C([
  M()
], Ss.prototype, "screenSpaceReflectionsEnabled", null);
C([
  M()
], Ss.prototype, "volumetricLightStepsCount", null);
C([
  M()
], Ss.prototype, "motionBlurSamples", null);
C([
  M()
], Ss.prototype, "samples", null);
Ue("BABYLON.StandardRenderingPipeline", Ss);
class b7e {
  constructor() {
    this.enabled = !1, this.name = "screenSpaceReflections2", this.texturesRequired = [6, 3, 5];
  }
}
const x7e = "screenSpaceRayTrace", D7e = `float distanceSquared(vec2 a,vec2 b) { a-=b; return dot(a,a); }
/**
param csOrigin Camera-space ray origin,which must be 
within the view volume and must have z>0.01 and project within the valid screen rectangle
param csDirection Unit length camera-space ray direction
param projectToPixelMatrix A projection matrix that maps to **pixel** coordinates 
(**not** [-1,+1] normalized device coordinates).
param csZBuffer The camera-space Z buffer
param csZBufferSize Dimensions of csZBuffer
param csZThickness Camera space csZThickness to ascribe to each pixel in the depth buffer
param nearPlaneZ Positive number. Doesn't have to be THE actual near plane,just a reasonable value
for clipping rays headed towards the camera
param stride Step in horizontal or vertical pixels between samples. This is a float
because integer math is slow on GPUs,but should be set to an integer>=1
param jitterFraction Number between 0 and 1 for how far to bump the ray in stride units
to conceal banding artifacts,plus the stride ray offset.
param maxSteps Maximum number of iterations. Higher gives better images but may be slow
param maxRayTraceDistance Maximum camera-space distance to trace before returning a miss
param selfCollisionNumSkip Number of steps to skip at start when raytracing to avoid self collisions.
1 is a reasonable value,depending on the scene you may need to set this value to 2
param hitPixel Pixel coordinates of the first intersection with the scene
param numIterations number of iterations performed
param csHitPoint Camera space location of the ray hit
*/
#define inline
bool traceScreenSpaceRay1(
vec3 csOrigin,
vec3 csDirection,
mat4 projectToPixelMatrix,
sampler2D csZBuffer,
vec2 csZBufferSize,
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
sampler2D csZBackBuffer,
float csZBackSizeFactor,
#endif
float csZThickness,
float nearPlaneZ,
float stride,
float jitterFraction,
float maxSteps,
float maxRayTraceDistance,
float selfCollisionNumSkip,
out vec2 startPixel,
out vec2 hitPixel,
out vec3 csHitPoint,
out float numIterations
#ifdef SSRAYTRACE_DEBUG
,out vec3 debugColor
#endif
)
{
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
float rayLength=(csOrigin.z+csDirection.z*maxRayTraceDistance)>-nearPlaneZ ? (-nearPlaneZ-csOrigin.z)/csDirection.z : maxRayTraceDistance;
#else
float rayLength=(csOrigin.z+csDirection.z*maxRayTraceDistance)<nearPlaneZ ? (nearPlaneZ-csOrigin.z)/csDirection.z : maxRayTraceDistance;
#endif
vec3 csEndPoint=csOrigin+csDirection*rayLength;hitPixel=vec2(-1.0,-1.0);vec4 H0=projectToPixelMatrix*vec4(csOrigin,1.0);vec4 H1=projectToPixelMatrix*vec4(csEndPoint,1.0);float k0=1.0/H0.w;float k1=1.0/H1.w;vec3 Q0=csOrigin*k0;vec3 Q1=csEndPoint*k1;vec2 P0=H0.xy*k0;vec2 P1=H1.xy*k1;
#ifdef SSRAYTRACE_CLIP_TO_FRUSTUM
float xMax=csZBufferSize.x-0.5,xMin=0.5,yMax=csZBufferSize.y-0.5,yMin=0.5;float alpha=0.0;if ((P1.y>yMax) || (P1.y<yMin)) {alpha=(P1.y-((P1.y>yMax) ? yMax : yMin))/(P1.y-P0.y);}
if ((P1.x>xMax) || (P1.x<xMin)) {alpha=max(alpha,(P1.x-((P1.x>xMax) ? xMax : xMin))/(P1.x-P0.x));}
P1=mix(P1,P0,alpha); k1=mix(k1,k0,alpha); Q1=mix(Q1,Q0,alpha);
#endif
P1+=vec2((distanceSquared(P0,P1)<0.0001) ? 0.01 : 0.0);vec2 delta=P1-P0;bool permute=false;if (abs(delta.x)<abs(delta.y)) { 
permute=true;delta=delta.yx;P0=P0.yx;P1=P1.yx; }
float stepDirection=sign(delta.x);float invdx=stepDirection/delta.x;vec2 dP=vec2(stepDirection,delta.y*invdx);vec3 dQ=(Q1-Q0)*invdx;float dk=(k1-k0)*invdx;float zMin=min(csEndPoint.z,csOrigin.z);float zMax=max(csEndPoint.z,csOrigin.z);dP*=stride; dQ*=stride; dk*=stride;P0+=dP*jitterFraction; Q0+=dQ*jitterFraction; k0+=dk*jitterFraction;vec4 pqk=vec4(P0,Q0.z,k0);vec4 dPQK=vec4(dP,dQ.z,dk);startPixel=permute ? P0.yx : P0.xy;float prevZMaxEstimate=csOrigin.z;float rayZMin=prevZMaxEstimate,rayZMax=prevZMaxEstimate;float sceneZMax=rayZMax+1e4;float end=P1.x*stepDirection;bool hit=false;float stepCount;for (stepCount=0.0;stepCount<=selfCollisionNumSkip ||
(pqk.x*stepDirection)<=end &&
stepCount<maxSteps &&
!hit &&
sceneZMax != 0.0; 
pqk+=dPQK,++stepCount)
{hitPixel=permute ? pqk.yx : pqk.xy;rayZMin=prevZMaxEstimate;rayZMax=(dPQK.z*0.5+pqk.z)/(dPQK.w*0.5+pqk.w);rayZMax=clamp(rayZMax,zMin,zMax);prevZMaxEstimate=rayZMax;if (rayZMin>rayZMax) { 
float t=rayZMin; rayZMin=rayZMax; rayZMax=t;}
sceneZMax=texelFetch(csZBuffer,ivec2(hitPixel),0).r;
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
float sceneBackZ=texelFetch(csZBackBuffer,ivec2(hitPixel/csZBackSizeFactor),0).r;hit=(rayZMax>=sceneBackZ-csZThickness) && (rayZMin<=sceneZMax);
#else
hit=(rayZMax>=sceneZMax-csZThickness) && (rayZMin<=sceneZMax);
#endif
#else
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
float sceneBackZ=texelFetch(csZBackBuffer,ivec2(hitPixel/csZBackSizeFactor),0).r;hit=(rayZMin<=sceneBackZ+csZThickness) && (rayZMax>=sceneZMax) && (sceneZMax != 0.0);
#else
hit=(rayZMin<=sceneZMax+csZThickness) && (rayZMax>=sceneZMax);
#endif
#endif
}
pqk-=dPQK;stepCount-=1.0;if (((pqk.x+dPQK.x)*stepDirection)>end || (stepCount+1.0)>=maxSteps || sceneZMax==0.0) {hit=false;}
#ifdef SSRAYTRACE_ENABLE_REFINEMENT
if (stride>1.0 && hit) {pqk-=dPQK;stepCount-=1.0;float invStride=1.0/stride;dPQK*=invStride;float refinementStepCount=0.0;prevZMaxEstimate=pqk.z/pqk.w;rayZMax=prevZMaxEstimate;sceneZMax=rayZMax+1e7;for (;refinementStepCount<=1.0 ||
(refinementStepCount<=stride*1.4) &&
(rayZMax<sceneZMax) && (sceneZMax != 0.0);pqk+=dPQK,refinementStepCount+=1.0)
{rayZMin=prevZMaxEstimate;rayZMax=(dPQK.z*0.5+pqk.z)/(dPQK.w*0.5+pqk.w);rayZMax=clamp(rayZMax,zMin,zMax);prevZMaxEstimate=rayZMax;rayZMax=max(rayZMax,rayZMin);hitPixel=permute ? pqk.yx : pqk.xy;sceneZMax=texelFetch(csZBuffer,ivec2(hitPixel),0).r;}
pqk-=dPQK;refinementStepCount-=1.0;stepCount+=refinementStepCount/stride;}
#endif
Q0.xy+=dQ.xy*stepCount;Q0.z=pqk.z;csHitPoint=Q0/pqk.w;numIterations=stepCount+1.0;
#ifdef SSRAYTRACE_DEBUG
if (((pqk.x+dPQK.x)*stepDirection)>end) {debugColor=vec3(0,0,1);} else if ((stepCount+1.0)>=maxSteps) {debugColor=vec3(1,0,0);} else if (sceneZMax==0.0) {debugColor=vec3(1,1,0);} else {debugColor=vec3(0,stepCount/maxSteps,0);}
#endif
return hit;}
/**
texCoord: in the [0,1] range
depth: depth in view space (range [znear,zfar]])
*/
vec3 computeViewPosFromUVDepth(vec2 texCoord,float depth,mat4 projection,mat4 invProjectionMatrix) {vec4 ndc;ndc.xy=texCoord*2.0-1.0;
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
ndc.z=-projection[2].z-projection[3].z/depth;
#else
ndc.z=projection[2].z+projection[3].z/depth;
#endif
ndc.w=1.0;vec4 eyePos=invProjectionMatrix*ndc;eyePos.xyz/=eyePos.w;return eyePos.xyz;}
`;
Le.IncludesShadersStore[x7e] = D7e;
const j7e = "screenSpaceReflection2PixelShader", w7e = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)
#define TEXTURECUBEFUNC(s,c,lod) textureLod(s,c,lod)
#else
#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)
#define TEXTURECUBEFUNC(s,c,bias) textureCube(s,c,bias)
#endif
uniform sampler2D textureSampler;varying vec2 vUV;
#ifdef SSR_SUPPORTED
uniform sampler2D reflectivitySampler;uniform sampler2D normalSampler;uniform sampler2D depthSampler;
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
uniform sampler2D backDepthSampler;uniform float backSizeFactor;
#endif
#ifdef SSR_USE_ENVIRONMENT_CUBE
uniform samplerCube envCubeSampler;
#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC
uniform vec3 vReflectionPosition;uniform vec3 vReflectionSize;
#endif
#endif
uniform mat4 view;uniform mat4 invView;uniform mat4 projection;uniform mat4 invProjectionMatrix;uniform mat4 projectionPixel;uniform float nearPlaneZ;uniform float stepSize;uniform float maxSteps;uniform float strength;uniform float thickness;uniform float roughnessFactor;uniform float reflectionSpecularFalloffExponent;uniform float maxDistance;uniform float selfCollisionNumSkip;uniform float reflectivityThreshold;
#include<helperFunctions>
#include<pbrBRDFFunctions>
#include<screenSpaceRayTrace>
vec3 hash(vec3 a)
{a=fract(a*0.8);a+=dot(a,a.yxz+19.19);return fract((a.xxy+a.yxx)*a.zyx);}
float computeAttenuationForIntersection(ivec2 hitPixel,vec2 hitUV,vec3 vsRayOrigin,vec3 vsHitPoint,vec3 reflectionVector,float maxRayDistance,float numIterations) {float attenuation=1.0;
#ifdef SSR_ATTENUATE_SCREEN_BORDERS
vec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-hitUV.xy));attenuation*=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);
#endif
#ifdef SSR_ATTENUATE_INTERSECTION_DISTANCE
attenuation*=1.0-clamp(distance(vsRayOrigin,vsHitPoint)/maxRayDistance,0.0,1.0);
#endif
#ifdef SSR_ATTENUATE_INTERSECTION_NUMITERATIONS
attenuation*=1.0-(numIterations/maxSteps);
#endif
#ifdef SSR_ATTENUATE_BACKFACE_REFLECTION
vec3 reflectionNormal=texelFetch(normalSampler,hitPixel,0).xyz;float directionBasedAttenuation=smoothstep(-0.17,0.0,dot(reflectionNormal,-reflectionVector));attenuation*=directionBasedAttenuation;
#endif
return attenuation;}
#endif
void main()
{
#ifdef SSR_SUPPORTED
vec4 colorFull=TEXTUREFUNC(textureSampler,vUV,0.0);vec3 color=colorFull.rgb;vec4 reflectivity=TEXTUREFUNC(reflectivitySampler,vUV,0.0);
#ifndef SSR_DISABLE_REFLECTIVITY_TEST
if (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=reflectivityThreshold) {
#ifdef SSR_USE_BLUR
gl_FragColor=vec4(0.);
#else
gl_FragColor=colorFull;
#endif
return;}
#endif
#ifdef SSR_INPUT_IS_GAMMA_SPACE
color=toLinearSpace(color);
#endif
vec2 texSize=vec2(textureSize(depthSampler,0));vec3 csNormal=texelFetch(normalSampler,ivec2(vUV*texSize),0).xyz; 
float depth=texelFetch(depthSampler,ivec2(vUV*texSize),0).r;vec3 csPosition=computeViewPosFromUVDepth(vUV,depth,projection,invProjectionMatrix);vec3 csViewDirection=normalize(csPosition);vec3 csReflectedVector=reflect(csViewDirection,csNormal);
#ifdef SSR_USE_ENVIRONMENT_CUBE
vec3 wReflectedVector=vec3(invView*vec4(csReflectedVector,0.0));
#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC
vec4 worldPos=invView*vec4(csPosition,1.0);wReflectedVector=parallaxCorrectNormal(worldPos.xyz,normalize(wReflectedVector),vReflectionSize,vReflectionPosition);
#endif
#ifdef SSR_INVERTCUBICMAP
wReflectedVector.y*=-1.0;
#endif
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
wReflectedVector.z*=-1.0;
#endif
vec3 envColor=TEXTURECUBEFUNC(envCubeSampler,wReflectedVector,0.0).xyz;
#ifdef SSR_ENVIRONMENT_CUBE_IS_GAMMASPACE
envColor=toLinearSpace(envColor);
#endif
#else
vec3 envColor=color;
#endif
float reflectionAttenuation=1.0;bool rayHasHit=false;vec2 startPixel;vec2 hitPixel;vec3 hitPoint;float numIterations;
#ifdef SSRAYTRACE_DEBUG
vec3 debugColor;
#endif
#ifdef SSR_ATTENUATE_FACING_CAMERA
reflectionAttenuation*=1.0-smoothstep(0.25,0.5,dot(-csViewDirection,csReflectedVector));
#endif
if (reflectionAttenuation>0.0) {
#ifdef SSR_USE_BLUR
vec3 jitt=vec3(0.);
#else
float roughness=1.0-reflectivity.a;vec3 jitt=mix(vec3(0.0),hash(csPosition)-vec3(0.5),roughness)*roughnessFactor; 
#endif
vec2 uv2=vUV*texSize;float c=(uv2.x+uv2.y)*0.25;float jitter=mod(c,1.0); 
rayHasHit=traceScreenSpaceRay1(
csPosition,
normalize(csReflectedVector+jitt),
projectionPixel,
depthSampler,
texSize,
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
backDepthSampler,
backSizeFactor,
#endif
thickness,
nearPlaneZ,
stepSize,
jitter,
maxSteps,
maxDistance,
selfCollisionNumSkip,
startPixel,
hitPixel,
hitPoint,
numIterations
#ifdef SSRAYTRACE_DEBUG
,debugColor
#endif
);}
#ifdef SSRAYTRACE_DEBUG
gl_FragColor=vec4(debugColor,1.);return;
#endif
vec3 F0=reflectivity.rgb;vec3 fresnel=fresnelSchlickGGX(max(dot(csNormal,-csViewDirection),0.0),F0,vec3(1.));vec3 SSR=envColor;if (rayHasHit) {vec3 reflectedColor=texelFetch(textureSampler,ivec2(hitPixel),0).rgb;
#ifdef SSR_INPUT_IS_GAMMA_SPACE
reflectedColor=toLinearSpace(reflectedColor);
#endif
reflectionAttenuation*=computeAttenuationForIntersection(ivec2(hitPixel),hitPixel/texSize,csPosition,hitPoint,csReflectedVector,maxDistance,numIterations);SSR=reflectedColor*reflectionAttenuation+(1.0-reflectionAttenuation)*envColor;}
#ifndef SSR_BLEND_WITH_FRESNEL
SSR*=fresnel;
#endif
#ifdef SSR_USE_BLUR
float blur_radius=0.0;float roughness=1.0-reflectivity.a*(1.0-roughnessFactor);if (roughness>0.001) {float cone_angle=min(roughness,0.999)*3.14159265*0.5;float cone_len=distance(startPixel,hitPixel);float op_len=2.0*tan(cone_angle)*cone_len; 
float a=op_len;float h=cone_len;float a2=a*a;float fh2=4.0f*h*h;blur_radius=(a*(sqrt(a2+fh2)-a))/(4.0f*h);}
gl_FragColor=vec4(SSR,blur_radius/255.0); 
#else
#ifdef SSR_BLEND_WITH_FRESNEL
vec3 reflectionMultiplier=clamp(pow(fresnel*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);
#else
vec3 reflectionMultiplier=clamp(pow(reflectivity.rgb*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);
#endif
vec3 colorMultiplier=1.0-reflectionMultiplier;vec3 finalColor=(color*colorMultiplier)+(SSR*reflectionMultiplier);
#ifdef SSR_OUTPUT_IS_GAMMA_SPACE
finalColor=toGammaSpace(finalColor);
#endif
gl_FragColor=vec4(finalColor,colorFull.a);
#endif
#else
gl_FragColor=TEXTUREFUNC(textureSampler,vUV,0.0);
#endif
}
`;
Le.ShadersStore[j7e] = w7e;
const m7e = "screenSpaceReflection2BlurPixelShader", B7e = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)
#else
#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)
#endif
uniform sampler2D textureSampler;varying vec2 vUV;uniform vec2 texelOffsetScale;const float weights[8]=float[8] (0.071303,0.131514,0.189879,0.321392,0.452906, 0.584419,0.715932,0.847445);void processSample(vec2 uv,float i,vec2 stepSize,inout vec4 accumulator,inout float denominator)
{vec2 offsetUV=stepSize*i+uv;float coefficient=weights[int(2.0-abs(i))];accumulator+=TEXTUREFUNC(textureSampler,offsetUV,0.0)*coefficient;denominator+=coefficient;}
void main()
{vec4 colorFull=TEXTUREFUNC(textureSampler,vUV,0.0);if (dot(colorFull,vec4(1.0))==0.0) {gl_FragColor=colorFull;return;}
float blurRadius=colorFull.a*255.0; 
vec2 stepSize=texelOffsetScale.xy*blurRadius;vec4 accumulator=TEXTUREFUNC(textureSampler,vUV,0.0)*0.214607;float denominator=0.214607;processSample(vUV,1.0,stepSize,accumulator,denominator);processSample(vUV,1.0*0.2,stepSize,accumulator,denominator);processSample(vUV,1.0*0.4,stepSize,accumulator,denominator);processSample(vUV,1.0*0.6,stepSize,accumulator,denominator);processSample(vUV,1.0*0.8,stepSize,accumulator,denominator);processSample(vUV,1.0*1.2,stepSize,accumulator,denominator);processSample(vUV,1.0*1.4,stepSize,accumulator,denominator);processSample(vUV,1.0*1.6,stepSize,accumulator,denominator);processSample(vUV,1.0*1.8,stepSize,accumulator,denominator);processSample(vUV,1.0*2.0,stepSize,accumulator,denominator);processSample(vUV,-1.0,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.2,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.4,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.6,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.8,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.2,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.4,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.6,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.8,stepSize,accumulator,denominator);processSample(vUV,-1.0*2.0,stepSize,accumulator,denominator);gl_FragColor=vec4(accumulator.rgb/denominator,colorFull.a);}
`;
Le.ShadersStore[m7e] = B7e;
const W7e = "screenSpaceReflection2BlurCombinerPixelShader", S7e = `uniform sampler2D textureSampler; 
uniform sampler2D mainSampler;uniform sampler2D reflectivitySampler;uniform float strength;uniform float reflectionSpecularFalloffExponent;uniform float reflectivityThreshold;varying vec2 vUV;
#include<helperFunctions>
#ifdef SSR_BLEND_WITH_FRESNEL
#include<pbrBRDFFunctions>
#include<screenSpaceRayTrace>
uniform mat4 projection;uniform mat4 invProjectionMatrix;uniform sampler2D normalSampler;uniform sampler2D depthSampler;
#endif
void main()
{
#ifdef SSRAYTRACE_DEBUG
gl_FragColor=texture2D(textureSampler,vUV);
#else
vec3 SSR=texture2D(textureSampler,vUV).rgb;vec4 color=texture2D(mainSampler,vUV);vec4 reflectivity=texture2D(reflectivitySampler,vUV);
#ifndef SSR_DISABLE_REFLECTIVITY_TEST
if (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=reflectivityThreshold) {gl_FragColor=color;return;}
#endif
#ifdef SSR_INPUT_IS_GAMMA_SPACE
color=toLinearSpace(color);
#endif
#ifdef SSR_BLEND_WITH_FRESNEL
vec2 texSize=vec2(textureSize(depthSampler,0));vec3 csNormal=texelFetch(normalSampler,ivec2(vUV*texSize),0).xyz;float depth=texelFetch(depthSampler,ivec2(vUV*texSize),0).r;vec3 csPosition=computeViewPosFromUVDepth(vUV,depth,projection,invProjectionMatrix);vec3 csViewDirection=normalize(csPosition);vec3 F0=reflectivity.rgb;vec3 fresnel=fresnelSchlickGGX(max(dot(csNormal,-csViewDirection),0.0),F0,vec3(1.));vec3 reflectionMultiplier=clamp(pow(fresnel*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);
#else
vec3 reflectionMultiplier=clamp(pow(reflectivity.rgb*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);
#endif
vec3 colorMultiplier=1.0-reflectionMultiplier;vec3 finalColor=(color.rgb*colorMultiplier)+(SSR*reflectionMultiplier);
#ifdef SSR_OUTPUT_IS_GAMMA_SPACE
finalColor=toGammaSpace(finalColor);
#endif
gl_FragColor=vec4(finalColor,color.a);
#endif
}
`;
Le.ShadersStore[W7e] = S7e;
const U7e = he.Compose(new S(0.5, 0.5, 0.5), Ze.Identity(), new S(0.5, 0.5, 0.5)), I7e = he.Compose(new S(0.5, 0.5, 1), Ze.Identity(), new S(0.5, 0.5, 0));
class Wa extends SD {
  /**
   * MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)
   */
  set samples(e) {
    this._samples !== e && (this._samples = e, this._buildPipeline());
  }
  get samples() {
    return this._samples;
  }
  /**
   * Gets or sets the minimum value for one of the reflectivity component of the material to consider it for SSR (default: 0.04).
   * If all r/g/b components of the reflectivity is below or equal this value, the pixel will not be considered reflective and SSR won't be applied.
   */
  get reflectivityThreshold() {
    return this._reflectivityThreshold;
  }
  set reflectivityThreshold(e) {
    e !== this._reflectivityThreshold && (e === 0 && this._reflectivityThreshold !== 0 || e !== 0 && this._reflectivityThreshold === 0 ? (this._reflectivityThreshold = e, this._buildPipeline()) : this._reflectivityThreshold = e);
  }
  /**
   * Gets or sets the downsample factor used to reduce the size of the texture used to compute the SSR contribution (default: 0).
   * Use 0 to render the SSR contribution at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.
   * Note that it is used only when blurring is enabled (blurDispersionStrength \> 0), because in that mode the SSR contribution is generated in a separate texture.
   */
  get ssrDownsample() {
    return this._ssrDownsample;
  }
  set ssrDownsample(e) {
    e !== this._ssrDownsample && (this._ssrDownsample = e, this._buildPipeline());
  }
  /**
   * Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring (default: 0.05)
   * The reflections are blurred based on the roughness of the surface and the distance between the pixel shaded and the reflected pixel: the higher the distance the more blurry the reflection is.
   * blurDispersionStrength allows to increase or decrease this effect.
   */
  get blurDispersionStrength() {
    return this._blurDispersionStrength;
  }
  set blurDispersionStrength(e) {
    if (e === this._blurDispersionStrength)
      return;
    const t = e === 0 && this._blurDispersionStrength !== 0 || e !== 0 && this._blurDispersionStrength === 0;
    this._blurDispersionStrength = e, t && this._buildPipeline();
  }
  _useBlur() {
    return this._blurDispersionStrength > 0;
  }
  /**
   * Gets or sets the downsample factor used to reduce the size of the textures used to blur the reflection effect (default: 0).
   * Use 0 to blur at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.
   */
  get blurDownsample() {
    return this._blurDownsample;
  }
  set blurDownsample(e) {
    e !== this._blurDownsample && (this._blurDownsample = e, this._buildPipeline());
  }
  /**
   * Gets or sets whether or not smoothing reflections is enabled (default: false)
   * Enabling smoothing will require more GPU power.
   * Note that this setting has no effect if step = 1: it's only used if step \> 1.
   */
  get enableSmoothReflections() {
    return this._enableSmoothReflections;
  }
  set enableSmoothReflections(e) {
    e !== this._enableSmoothReflections && (this._enableSmoothReflections = e, this._updateEffectDefines());
  }
  /**
   * Gets or sets the environment cube texture used to define the reflection when the reflected rays of SSR leave the view space or when the maxDistance/maxSteps is reached.
   */
  get environmentTexture() {
    return this._environmentTexture;
  }
  set environmentTexture(e) {
    this._environmentTexture = e, this._updateEffectDefines();
  }
  /**
   * Gets or sets the boolean defining if the environment texture is a standard cubemap (false) or a probe (true). Default value is false.
   * Note: a probe cube texture is treated differently than an ordinary cube texture because the Y axis is reversed.
   */
  get environmentTextureIsProbe() {
    return this._environmentTextureIsProbe;
  }
  set environmentTextureIsProbe(e) {
    this._environmentTextureIsProbe = e, this._updateEffectDefines();
  }
  /**
   * Gets or sets a boolean indicating if the reflections should be attenuated at the screen borders (default: true).
   */
  get attenuateScreenBorders() {
    return this._attenuateScreenBorders;
  }
  set attenuateScreenBorders(e) {
    this._attenuateScreenBorders !== e && (this._attenuateScreenBorders = e, this._updateEffectDefines());
  }
  /**
   * Gets or sets a boolean indicating if the reflections should be attenuated according to the distance of the intersection (default: true).
   */
  get attenuateIntersectionDistance() {
    return this._attenuateIntersectionDistance;
  }
  set attenuateIntersectionDistance(e) {
    this._attenuateIntersectionDistance !== e && (this._attenuateIntersectionDistance = e, this._updateEffectDefines());
  }
  /**
   * Gets or sets a boolean indicating if the reflections should be attenuated according to the number of iterations performed to find the intersection (default: true).
   */
  get attenuateIntersectionIterations() {
    return this._attenuateIntersectionIterations;
  }
  set attenuateIntersectionIterations(e) {
    this._attenuateIntersectionIterations !== e && (this._attenuateIntersectionIterations = e, this._updateEffectDefines());
  }
  /**
   * Gets or sets a boolean indicating if the reflections should be attenuated when the reflection ray is facing the camera (the view direction) (default: false).
   */
  get attenuateFacingCamera() {
    return this._attenuateFacingCamera;
  }
  set attenuateFacingCamera(e) {
    this._attenuateFacingCamera !== e && (this._attenuateFacingCamera = e, this._updateEffectDefines());
  }
  /**
   * Gets or sets a boolean indicating if the backface reflections should be attenuated (default: false).
   */
  get attenuateBackfaceReflection() {
    return this._attenuateBackfaceReflection;
  }
  set attenuateBackfaceReflection(e) {
    this._attenuateBackfaceReflection !== e && (this._attenuateBackfaceReflection = e, this._updateEffectDefines());
  }
  /**
   * Gets or sets a boolean indicating if the ray should be clipped to the frustum (default: true).
   * You can try to set this parameter to false to save some performances: it may produce some artefacts in some cases, but generally they won't really be visible
   */
  get clipToFrustum() {
    return this._clipToFrustum;
  }
  set clipToFrustum(e) {
    this._clipToFrustum !== e && (this._clipToFrustum = e, this._updateEffectDefines());
  }
  /**
   * Gets or sets a boolean indicating whether the blending between the current color pixel and the reflection color should be done with a Fresnel coefficient (default: false).
   * It is more physically accurate to use the Fresnel coefficient (otherwise it uses the reflectivity of the material for blending), but it is also more expensive when you use blur (when blurDispersionStrength \> 0).
   */
  get useFresnel() {
    return this._useFresnel;
  }
  set useFresnel(e) {
    this._useFresnel !== e && (this._useFresnel = e, this._buildPipeline());
  }
  /**
   * Gets or sets a boolean defining if geometry thickness should be computed automatically (default: false).
   * When enabled, a depth renderer is created which will render the back faces of the scene to a depth texture (meaning additional work for the GPU).
   * In that mode, the "thickness" property is still used as an offset to compute the ray intersection, but you can typically use a much lower
   * value than when enableAutomaticThicknessComputation is false (it's even possible to use a value of 0 when using low values for "step")
   * Note that for performance reasons, this option will only apply to the first camera to which the rendering pipeline is attached!
   */
  get enableAutomaticThicknessComputation() {
    return this._enableAutomaticThicknessComputation;
  }
  set enableAutomaticThicknessComputation(e) {
    this._enableAutomaticThicknessComputation !== e && (this._enableAutomaticThicknessComputation = e, this._buildPipeline());
  }
  /**
   * Gets the depth renderer used to render the back faces of the scene to a depth texture.
   */
  get backfaceDepthRenderer() {
    return this._depthRenderer;
  }
  /**
   * Gets or sets the downsample factor (default: 0) used to create the backface depth texture - used only if enableAutomaticThicknessComputation = true.
   * Use 0 to render the depth at full resolution, 1 to render at half resolution, 2 to render at 1/4 resolution, etc.
   * Note that you will get rendering artefacts when using a value different from 0: it's a tradeoff between image quality and performances.
   */
  get backfaceDepthTextureDownsample() {
    return this._backfaceDepthTextureDownsample;
  }
  set backfaceDepthTextureDownsample(e) {
    this._backfaceDepthTextureDownsample !== e && (this._backfaceDepthTextureDownsample = e, this._resizeDepthRenderer());
  }
  /**
   * Gets or sets a boolean (default: true) indicating if the depth of transparent meshes should be written to the backface depth texture (when automatic thickness computation is enabled).
   */
  get backfaceForceDepthWriteTransparentMeshes() {
    return this._backfaceForceDepthWriteTransparentMeshes;
  }
  set backfaceForceDepthWriteTransparentMeshes(e) {
    this._backfaceForceDepthWriteTransparentMeshes !== e && (this._backfaceForceDepthWriteTransparentMeshes = e, this._depthRenderer && (this._depthRenderer.forceDepthWriteTransparentMeshes = e));
  }
  /**
   * Gets or sets a boolean indicating if the effect is enabled (default: true).
   */
  get isEnabled() {
    return this._isEnabled;
  }
  set isEnabled(e) {
    this._isEnabled !== e && (this._isEnabled = e, e ? e && (this._isDirty ? this._buildPipeline() : this._cameras !== null && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras)) : this._cameras !== null && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()));
  }
  /**
   * Gets or sets a boolean defining if the input color texture is in gamma space (default: true)
   * The SSR effect works in linear space, so if the input texture is in gamma space, we must convert the texture to linear space before applying the effect
   */
  get inputTextureColorIsInGammaSpace() {
    return this._inputTextureColorIsInGammaSpace;
  }
  set inputTextureColorIsInGammaSpace(e) {
    this._inputTextureColorIsInGammaSpace !== e && (this._inputTextureColorIsInGammaSpace = e, this._buildPipeline());
  }
  /**
   * Gets or sets a boolean defining if the output color texture generated by the SSR pipeline should be in gamma space (default: true)
   * If you have a post-process that comes after the SSR and that post-process needs the input to be in a linear space, you must disable generateOutputInGammaSpace
   */
  get generateOutputInGammaSpace() {
    return this._generateOutputInGammaSpace;
  }
  set generateOutputInGammaSpace(e) {
    this._generateOutputInGammaSpace !== e && (this._generateOutputInGammaSpace = e, this._buildPipeline());
  }
  /**
   * Gets or sets a boolean indicating if the effect should be rendered in debug mode (default: false).
   * In this mode, colors have this meaning:
   *   - blue: the ray hit the max distance (we reached maxDistance)
   *   - red: the ray ran out of steps (we reached maxSteps)
   *   - yellow: the ray went off screen
   *   - green: the ray hit a surface. The brightness of the green color is proportional to the distance between the ray origin and the intersection point: A brighter green means more computation than a darker green.
   * In the first 3 cases, the final color is calculated by mixing the skybox color with the pixel color (if environmentTexture is defined), otherwise the pixel color is not modified
   * You should try to get as few blue/red/yellow pixels as possible, as this means that the ray has gone further than if it had hit a surface.
   */
  get debug() {
    return this._debug;
  }
  set debug(e) {
    this._debug !== e && (this._debug = e, this._buildPipeline());
  }
  /**
   * Gets the scene the effect belongs to.
   * @returns the scene the effect belongs to.
   */
  getScene() {
    return this._scene;
  }
  get _geometryBufferRenderer() {
    return this._forceGeometryBuffer ? this._scene.geometryBufferRenderer : null;
  }
  get _prePassRenderer() {
    return this._forceGeometryBuffer ? null : this._scene.prePassRenderer;
  }
  /**
   * Gets active scene
   */
  get scene() {
    return this._scene;
  }
  /**
   * Returns true if SSR is supported by the running hardware
   */
  get isSupported() {
    const e = this._scene.getEngine().getCaps();
    return e.drawBuffersExtension && e.texelFetch;
  }
  /**
   * Constructor of the SSR rendering pipeline
   * @param name The rendering pipeline name
   * @param scene The scene linked to this pipeline
   * @param cameras The array of cameras that the rendering pipeline will be attached to (default: scene.cameras)
   * @param forceGeometryBuffer Set to true if you want to use the legacy geometry buffer renderer (default: false)
   * @param textureType The texture type used by the different post processes created by SSR (default: 0)
   */
  constructor(e, t, r, n = !1, i = 0) {
    if (super(t.getEngine(), e), this.SSRRenderEffect = "SSRRenderEffect", this.SSRBlurRenderEffect = "SSRBlurRenderEffect", this.SSRCombineRenderEffect = "SSRCombineRenderEffect", this._samples = 1, this.maxDistance = 1e3, this.step = 1, this.thickness = 0.5, this.strength = 1, this.reflectionSpecularFalloffExponent = 1, this.maxSteps = 1e3, this.roughnessFactor = 0.2, this.selfCollisionNumSkip = 1, this._reflectivityThreshold = 0.04, this._ssrDownsample = 0, this._blurDispersionStrength = 0.03, this._blurDownsample = 0, this._enableSmoothReflections = !1, this._environmentTextureIsProbe = !1, this._attenuateScreenBorders = !0, this._attenuateIntersectionDistance = !0, this._attenuateIntersectionIterations = !0, this._attenuateFacingCamera = !1, this._attenuateBackfaceReflection = !1, this._clipToFrustum = !0, this._useFresnel = !1, this._enableAutomaticThicknessComputation = !1, this._backfaceDepthTextureDownsample = 0, this._backfaceForceDepthWriteTransparentMeshes = !0, this._isEnabled = !0, this._inputTextureColorIsInGammaSpace = !0, this._generateOutputInGammaSpace = !0, this._debug = !1, this._forceGeometryBuffer = !1, this._isDirty = !1, this._camerasToBeAttached = [], this._cameras = r || t.cameras, this._cameras = this._cameras.slice(), this._camerasToBeAttached = this._cameras.slice(), this._scene = t, this._textureType = i, this._forceGeometryBuffer = n, this.isSupported) {
      if (t.postProcessRenderPipelineManager.addPipeline(this), this._forceGeometryBuffer) {
        const s = t.enableGeometryBufferRenderer();
        s && (s.enableReflectivity = !0, s.useSpecificClearForDepthTexture = !0, s.generateNormalsInWorldSpace && console.error("SSRRenderingPipeline does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!"));
      } else {
        const s = t.enablePrePassRenderer();
        s && (s.useSpecificClearForDepthTexture = !0, s.markAsDirty(), s.generateNormalsInWorldSpace && console.error("SSRRenderingPipeline does not support generateNormalsInWorldSpace=true for the prepass renderer!"));
      }
      this._buildPipeline();
    }
  }
  /**
   * Get the class name
   * @returns "SSRRenderingPipeline"
   */
  getClassName() {
    return "SSRRenderingPipeline";
  }
  /**
   * Adds a camera to the pipeline
   * @param camera the camera to be added
   */
  addCamera(e) {
    this._camerasToBeAttached.push(e), this._buildPipeline();
  }
  /**
   * Removes a camera from the pipeline
   * @param camera the camera to remove
   */
  removeCamera(e) {
    const t = this._camerasToBeAttached.indexOf(e);
    this._camerasToBeAttached.splice(t, 1), this._buildPipeline();
  }
  /**
   * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
   * @param disableGeometryBufferRenderer
   */
  dispose(e = !1) {
    this._disposeDepthRenderer(), this._disposePostProcesses(), e && this._scene.disableGeometryBufferRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), super.dispose();
  }
  _getTextureSize() {
    var e, t;
    const r = this._scene.getEngine(), n = this._prePassRenderer;
    let i = { width: r.getRenderWidth(), height: r.getRenderHeight() };
    if (n && ((e = this._scene.activeCamera) === null || e === void 0 ? void 0 : e._getFirstPostProcess()) === this._ssrPostProcess) {
      const s = n.getRenderTarget();
      s && s.textures && (i = s.textures[n.getIndex(4)].getSize());
    } else
      !((t = this._ssrPostProcess) === null || t === void 0) && t.inputTexture && (i.width = this._ssrPostProcess.inputTexture.width, i.height = this._ssrPostProcess.inputTexture.height);
    return i;
  }
  _updateEffectDefines() {
    var e;
    const t = [];
    (this._geometryBufferRenderer || this._prePassRenderer) && t.push("#define SSR_SUPPORTED"), this._enableSmoothReflections && t.push("#define SSRAYTRACE_ENABLE_REFINEMENT"), this._scene.useRightHandedSystem && t.push("#define SSRAYTRACE_RIGHT_HANDED_SCENE"), this._environmentTexture && (t.push("#define SSR_USE_ENVIRONMENT_CUBE"), this._environmentTexture.boundingBoxSize && t.push("#define SSR_USE_LOCAL_REFLECTIONMAP_CUBIC"), this._environmentTexture.gammaSpace && t.push("#define SSR_ENVIRONMENT_CUBE_IS_GAMMASPACE")), this._environmentTextureIsProbe && t.push("#define SSR_INVERTCUBICMAP"), this._enableAutomaticThicknessComputation && t.push("#define SSRAYTRACE_USE_BACK_DEPTHBUFFER"), this._attenuateScreenBorders && t.push("#define SSR_ATTENUATE_SCREEN_BORDERS"), this._attenuateIntersectionDistance && t.push("#define SSR_ATTENUATE_INTERSECTION_DISTANCE"), this._attenuateIntersectionIterations && t.push("#define SSR_ATTENUATE_INTERSECTION_NUMITERATIONS"), this._attenuateFacingCamera && t.push("#define SSR_ATTENUATE_FACING_CAMERA"), this._attenuateBackfaceReflection && t.push("#define SSR_ATTENUATE_BACKFACE_REFLECTION"), this._clipToFrustum && t.push("#define SSRAYTRACE_CLIP_TO_FRUSTUM"), this._useBlur() && t.push("#define SSR_USE_BLUR"), this._debug && t.push("#define SSRAYTRACE_DEBUG"), this._inputTextureColorIsInGammaSpace && t.push("#define SSR_INPUT_IS_GAMMA_SPACE"), this._generateOutputInGammaSpace && t.push("#define SSR_OUTPUT_IS_GAMMA_SPACE"), this._useFresnel && t.push("#define SSR_BLEND_WITH_FRESNEL"), this._reflectivityThreshold === 0 && t.push("#define SSR_DISABLE_REFLECTIVITY_TEST"), (e = this._ssrPostProcess) === null || e === void 0 || e.updateEffect(t.join(`
`));
  }
  _buildPipeline() {
    var e;
    if (!this.isSupported)
      return;
    if (!this._isEnabled) {
      this._isDirty = !0;
      return;
    }
    this._isDirty = !1;
    const t = this._scene.getEngine();
    if (this._disposeDepthRenderer(), this._disposePostProcesses(), this._cameras !== null && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()), this._reset(), this._enableAutomaticThicknessComputation) {
      const r = (e = this._cameras) === null || e === void 0 ? void 0 : e[0];
      r && (this._depthRendererCamera = r, this._depthRenderer = new jD(this._scene, void 0, void 0, void 0, 1, !0, "SSRBackDepth"), this._depthRenderer.clearColor.r = 1e8, this._depthRenderer.reverseCulling = !0, this._depthRenderer.forceDepthWriteTransparentMeshes = this._backfaceForceDepthWriteTransparentMeshes, this._resizeDepthRenderer(), r.customRenderTargets.push(this._depthRenderer.getDepthMap()));
    }
    this._createSSRPostProcess(), this.addEffect(new gs(t, this.SSRRenderEffect, () => this._ssrPostProcess, !0)), this._useBlur() && (this._createBlurAndCombinerPostProcesses(), this.addEffect(new gs(t, this.SSRBlurRenderEffect, () => [this._blurPostProcessX, this._blurPostProcessY], !0)), this.addEffect(new gs(t, this.SSRCombineRenderEffect, () => this._blurCombinerPostProcess, !0))), this._cameras !== null && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
  }
  _resizeDepthRenderer() {
    if (!this._depthRenderer)
      return;
    const e = this._getTextureSize(), t = this._depthRenderer.getDepthMap().getSize(), r = Math.floor(e.width / (this._backfaceDepthTextureDownsample + 1)), n = Math.floor(e.height / (this._backfaceDepthTextureDownsample + 1));
    (t.width !== r || t.height !== n) && this._depthRenderer.getDepthMap().resize({ width: r, height: n });
  }
  _disposeDepthRenderer() {
    var e;
    if (this._depthRenderer) {
      if (this._depthRendererCamera) {
        const t = (e = this._depthRendererCamera.customRenderTargets.indexOf(this._depthRenderer.getDepthMap())) !== null && e !== void 0 ? e : -1;
        t !== -1 && this._depthRendererCamera.customRenderTargets.splice(t, 1);
      }
      this._depthRendererCamera = null, this._depthRenderer.getDepthMap().dispose();
    }
    this._depthRenderer = null;
  }
  _disposePostProcesses() {
    var e, t, r, n;
    for (let i = 0; i < this._cameras.length; i++) {
      const s = this._cameras[i];
      (e = this._ssrPostProcess) === null || e === void 0 || e.dispose(s), (t = this._blurPostProcessX) === null || t === void 0 || t.dispose(s), (r = this._blurPostProcessY) === null || r === void 0 || r.dispose(s), (n = this._blurCombinerPostProcess) === null || n === void 0 || n.dispose(s);
    }
    this._ssrPostProcess = null, this._blurPostProcessX = null, this._blurPostProcessY = null, this._blurCombinerPostProcess = null;
  }
  _createSSRPostProcess() {
    this._ssrPostProcess = new kr("ssr", "screenSpaceReflection2", [
      "projection",
      "invProjectionMatrix",
      "view",
      "invView",
      "thickness",
      "reflectionSpecularFalloffExponent",
      "strength",
      "stepSize",
      "maxSteps",
      "roughnessFactor",
      "projectionPixel",
      "nearPlaneZ",
      "maxDistance",
      "selfCollisionNumSkip",
      "vReflectionPosition",
      "vReflectionSize",
      "backSizeFactor",
      "reflectivityThreshold"
    ], ["textureSampler", "normalSampler", "reflectivitySampler", "depthSampler", "envCubeSampler", "backDepthSampler"], 1, null, this._textureType, this._scene.getEngine(), !1, "", this._textureType), this._updateEffectDefines(), this._ssrPostProcess.onApply = (e) => {
      this._resizeDepthRenderer();
      const t = this._geometryBufferRenderer, r = this._prePassRenderer;
      if (!r && !t)
        return;
      if (t) {
        const f = t.getTextureIndex(po.REFLECTIVITY_TEXTURE_TYPE);
        e.setTexture("normalSampler", t.getGBuffer().textures[1]), e.setTexture("reflectivitySampler", t.getGBuffer().textures[f]), e.setTexture("depthSampler", t.getGBuffer().textures[0]);
      } else if (r) {
        const f = r.getIndex(5), o = r.getIndex(3), d = r.getIndex(6);
        e.setTexture("normalSampler", r.getRenderTarget().textures[d]), e.setTexture("depthSampler", r.getRenderTarget().textures[f]), e.setTexture("reflectivitySampler", r.getRenderTarget().textures[o]);
      }
      this._enableAutomaticThicknessComputation && this._depthRenderer && (e.setTexture("backDepthSampler", this._depthRenderer.getDepthMap()), e.setFloat("backSizeFactor", this._backfaceDepthTextureDownsample + 1));
      const n = this._scene.activeCamera;
      if (!n)
        return;
      const i = n.getViewMatrix(!0), s = n.getProjectionMatrix(!0);
      s.invertToRef(ue.Matrix[0]), i.invertToRef(ue.Matrix[1]), e.setMatrix("projection", s), e.setMatrix("view", i), e.setMatrix("invView", ue.Matrix[1]), e.setMatrix("invProjectionMatrix", ue.Matrix[0]), e.setFloat("thickness", this.thickness), e.setFloat("reflectionSpecularFalloffExponent", this.reflectionSpecularFalloffExponent), e.setFloat("strength", this.strength), e.setFloat("stepSize", this.step), e.setFloat("maxSteps", this.maxSteps), e.setFloat("roughnessFactor", this.roughnessFactor), e.setFloat("nearPlaneZ", n.minZ), e.setFloat("maxDistance", this.maxDistance), e.setFloat("selfCollisionNumSkip", this.selfCollisionNumSkip), e.setFloat("reflectivityThreshold", this._reflectivityThreshold);
      const a = this._getTextureSize();
      he.ScalingToRef(a.width, a.height, 1, ue.Matrix[2]), s.multiplyToRef(this._scene.getEngine().isWebGPU ? I7e : U7e, ue.Matrix[3]), ue.Matrix[3].multiplyToRef(ue.Matrix[2], ue.Matrix[4]), e.setMatrix("projectionPixel", ue.Matrix[4]), this._environmentTexture && (e.setTexture("envCubeSampler", this._environmentTexture), this._environmentTexture.boundingBoxSize && (e.setVector3("vReflectionPosition", this._environmentTexture.boundingBoxPosition), e.setVector3("vReflectionSize", this._environmentTexture.boundingBoxSize)));
    }, this._ssrPostProcess.samples = this.samples, this._forceGeometryBuffer || (this._ssrPostProcess._prePassEffectConfiguration = new b7e());
  }
  _createBlurAndCombinerPostProcesses() {
    const e = this._scene.getEngine();
    this._blurPostProcessX = new kr("SSRblurX", "screenSpaceReflection2Blur", ["texelOffsetScale"], ["textureSampler"], this._useBlur() ? 1 / (this._ssrDownsample + 1) : 1, null, 2, e, !1, "", this._textureType), this._blurPostProcessX.autoClear = !1, this._blurPostProcessX.onApplyObservable.add((i) => {
      var s, a;
      const f = (a = (s = this._blurPostProcessX) === null || s === void 0 ? void 0 : s.inputTexture.width) !== null && a !== void 0 ? a : this._scene.getEngine().getRenderWidth();
      i.setFloat2("texelOffsetScale", this._blurDispersionStrength / f, 0);
    }), this._blurPostProcessY = new kr("SSRblurY", "screenSpaceReflection2Blur", ["texelOffsetScale"], ["textureSampler"], this._useBlur() ? 1 / (this._blurDownsample + 1) : 1, null, 2, e, !1, "", this._textureType), this._blurPostProcessY.autoClear = !1, this._blurPostProcessY.onApplyObservable.add((i) => {
      var s, a;
      const f = (a = (s = this._blurPostProcessY) === null || s === void 0 ? void 0 : s.inputTexture.height) !== null && a !== void 0 ? a : this._scene.getEngine().getRenderHeight();
      i.setFloat2("texelOffsetScale", 0, this._blurDispersionStrength / f);
    });
    const t = ["strength", "reflectionSpecularFalloffExponent", "reflectivityThreshold"], r = ["textureSampler", "mainSampler", "reflectivitySampler"];
    let n = "";
    this._debug && (n += `#define SSRAYTRACE_DEBUG
`), this._inputTextureColorIsInGammaSpace && (n += `#define SSR_INPUT_IS_GAMMA_SPACE
`), this._generateOutputInGammaSpace && (n += `#define SSR_OUTPUT_IS_GAMMA_SPACE
`), this.useFresnel && (n += `#define SSR_BLEND_WITH_FRESNEL
`, t.push("projection", "invProjectionMatrix"), r.push("depthSampler", "normalSampler")), this._reflectivityThreshold === 0 && (n += "#define SSR_DISABLE_REFLECTIVITY_TEST"), this._blurCombinerPostProcess = new kr("SSRblurCombiner", "screenSpaceReflection2BlurCombiner", t, r, this._useBlur() ? 1 / (this._blurDownsample + 1) : 1, null, 1, e, !1, n, this._textureType), this._blurCombinerPostProcess.autoClear = !1, this._blurCombinerPostProcess.onApplyObservable.add((i) => {
      var s;
      const a = this._geometryBufferRenderer, f = this._prePassRenderer;
      if (!(!f && !a)) {
        if (f && ((s = this._scene.activeCamera) === null || s === void 0 ? void 0 : s._getFirstPostProcess()) === this._ssrPostProcess) {
          const o = f.getRenderTarget();
          o && o.textures && i.setTexture("mainSampler", o.textures[f.getIndex(4)]);
        } else
          i.setTextureFromPostProcess("mainSampler", this._ssrPostProcess);
        if (a) {
          const o = a.getTextureIndex(po.REFLECTIVITY_TEXTURE_TYPE);
          i.setTexture("reflectivitySampler", a.getGBuffer().textures[o]), this.useFresnel && (i.setTexture("normalSampler", a.getGBuffer().textures[1]), i.setTexture("depthSampler", a.getGBuffer().textures[0]));
        } else if (f) {
          const o = f.getIndex(3);
          if (i.setTexture("reflectivitySampler", f.getRenderTarget().textures[o]), this.useFresnel) {
            const d = f.getIndex(5), v = f.getIndex(6);
            i.setTexture("normalSampler", f.getRenderTarget().textures[v]), i.setTexture("depthSampler", f.getRenderTarget().textures[d]);
          }
        }
        if (i.setFloat("strength", this.strength), i.setFloat("reflectionSpecularFalloffExponent", this.reflectionSpecularFalloffExponent), i.setFloat("reflectivityThreshold", this._reflectivityThreshold), this.useFresnel) {
          const o = this._scene.activeCamera;
          if (o) {
            const d = o.getProjectionMatrix();
            d.invertToRef(ue.Matrix[0]), i.setMatrix("projection", d), i.setMatrix("invProjectionMatrix", ue.Matrix[0]);
          }
        }
      }
    });
  }
  /**
   * Serializes the rendering pipeline (Used when exporting)
   * @returns the serialized object
   */
  serialize() {
    const e = jt.Serialize(this);
    return e.customType = "SSRRenderingPipeline", e;
  }
  /**
   * Parse the serialized pipeline
   * @param source Source pipeline.
   * @param scene The scene to load the pipeline to.
   * @param rootUrl The URL of the serialized pipeline.
   * @returns An instantiated pipeline from the serialized object.
   */
  static Parse(e, t, r) {
    return jt.Parse(() => new Wa(e._name, t, e._ratio), e, t, r);
  }
}
C([
  M()
], Wa.prototype, "samples", null);
C([
  M()
], Wa.prototype, "maxDistance", void 0);
C([
  M()
], Wa.prototype, "step", void 0);
C([
  M()
], Wa.prototype, "thickness", void 0);
C([
  M()
], Wa.prototype, "strength", void 0);
C([
  M()
], Wa.prototype, "reflectionSpecularFalloffExponent", void 0);
C([
  M()
], Wa.prototype, "maxSteps", void 0);
C([
  M()
], Wa.prototype, "roughnessFactor", void 0);
C([
  M()
], Wa.prototype, "selfCollisionNumSkip", void 0);
C([
  M()
], Wa.prototype, "_reflectivityThreshold", void 0);
C([
  M("_ssrDownsample")
], Wa.prototype, "_ssrDownsample", void 0);
C([
  M()
], Wa.prototype, "ssrDownsample", null);
C([
  M("blurDispersionStrength")
], Wa.prototype, "_blurDispersionStrength", void 0);
C([
  M("blurDownsample")
], Wa.prototype, "_blurDownsample", void 0);
C([
  M("enableSmoothReflections")
], Wa.prototype, "_enableSmoothReflections", void 0);
C([
  M("environmentTexture")
], Wa.prototype, "_environmentTexture", void 0);
C([
  M("environmentTextureIsProbe")
], Wa.prototype, "_environmentTextureIsProbe", void 0);
C([
  M("attenuateScreenBorders")
], Wa.prototype, "_attenuateScreenBorders", void 0);
C([
  M("attenuateIntersectionDistance")
], Wa.prototype, "_attenuateIntersectionDistance", void 0);
C([
  M("attenuateIntersectionIterations")
], Wa.prototype, "_attenuateIntersectionIterations", void 0);
C([
  M("attenuateFacingCamera")
], Wa.prototype, "_attenuateFacingCamera", void 0);
C([
  M("attenuateBackfaceReflection")
], Wa.prototype, "_attenuateBackfaceReflection", void 0);
C([
  M("clipToFrustum")
], Wa.prototype, "_clipToFrustum", void 0);
C([
  M("useFresnel")
], Wa.prototype, "_useFresnel", void 0);
C([
  M("enableAutomaticThicknessComputation")
], Wa.prototype, "_enableAutomaticThicknessComputation", void 0);
C([
  M("backfaceDepthTextureDownsample")
], Wa.prototype, "_backfaceDepthTextureDownsample", void 0);
C([
  M("backfaceForceDepthWriteTransparentMeshes")
], Wa.prototype, "_backfaceForceDepthWriteTransparentMeshes", void 0);
C([
  M("isEnabled")
], Wa.prototype, "_isEnabled", void 0);
C([
  M("inputTextureColorIsInGammaSpace")
], Wa.prototype, "_inputTextureColorIsInGammaSpace", void 0);
C([
  M("generateOutputInGammaSpace")
], Wa.prototype, "_generateOutputInGammaSpace", void 0);
C([
  M("debug")
], Wa.prototype, "_debug", void 0);
Ue("BABYLON.SSRRenderingPipeline", Wa);
const R7e = "tonemapPixelShader", V7e = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float _ExposureAdjustment;
#if defined(HABLE_TONEMAPPING)
const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;const float W=11.2;
#endif
float Luminance(vec3 c)
{return dot(c,vec3(0.22,0.707,0.071));}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{vec3 colour=texture2D(textureSampler,vUV).rgb;
#if defined(REINHARD_TONEMAPPING)
float lum=Luminance(colour.rgb); 
float lumTm=lum*_ExposureAdjustment;float scale=lumTm/(1.0+lumTm); 
colour*=scale/lum;
#elif defined(HABLE_TONEMAPPING)
colour*=_ExposureAdjustment;const float ExposureBias=2.0;vec3 x=ExposureBias*colour;vec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;x=vec3(W,W,W);vec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);colour=curr*whiteScale;
#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)
colour*=_ExposureAdjustment;vec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);vec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);colour=retColor*retColor;
#elif defined(PHOTOGRAPHIC_TONEMAPPING)
colour= vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);
#endif
gl_FragColor=vec4(colour.rgb,1.0);}`;
Le.ShadersStore[R7e] = V7e;
var _w;
(function(A) {
  A[A.Hable = 0] = "Hable", A[A.Reinhard = 1] = "Reinhard", A[A.HejiDawson = 2] = "HejiDawson", A[A.Photographic = 3] = "Photographic";
})(_w || (_w = {}));
class C7e extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "TonemapPostProcess" string
   */
  getClassName() {
    return "TonemapPostProcess";
  }
  /**
   * Creates a new TonemapPostProcess
   * @param name defines the name of the postprocess
   * @param _operator defines the operator to use
   * @param exposureAdjustment defines the required exposure adjustment
   * @param camera defines the camera to use (can be null)
   * @param samplingMode defines the required sampling mode (BABYLON.Texture.BILINEAR_SAMPLINGMODE by default)
   * @param engine defines the hosting engine (can be ignore if camera is set)
   * @param textureFormat defines the texture format to use (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   */
  constructor(e, t, r, n, i = 2, s, a = 0, f) {
    super(e, "tonemap", ["_ExposureAdjustment"], null, 1, n, i, s, f, null, a), this._operator = t, this.exposureAdjustment = r;
    let o = "#define ";
    this._operator === _w.Hable ? o += "HABLE_TONEMAPPING" : this._operator === _w.Reinhard ? o += "REINHARD_TONEMAPPING" : this._operator === _w.HejiDawson ? o += "OPTIMIZED_HEJIDAWSON_TONEMAPPING" : this._operator === _w.Photographic && (o += "PHOTOGRAPHIC_TONEMAPPING"), this.updateEffect(o), this.onApply = (d) => {
      d.setFloat("_ExposureAdjustment", this.exposureAdjustment);
    };
  }
}
const O7e = "volumetricLightScatteringPixelShader", y7e = `uniform sampler2D textureSampler;uniform sampler2D lightScatteringSampler;uniform float decay;uniform float exposure;uniform float weight;uniform float density;uniform vec2 meshPositionOnScreen;varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec2 tc=vUV;vec2 deltaTexCoord=(tc-meshPositionOnScreen.xy);deltaTexCoord*=1.0/float(NUM_SAMPLES)*density;float illuminationDecay=1.0;vec4 color=texture2D(lightScatteringSampler,tc)*0.4;for(int i=0; i<NUM_SAMPLES; i++) {tc-=deltaTexCoord;vec4 dataSample=texture2D(lightScatteringSampler,tc)*0.4;dataSample*=illuminationDecay*weight;color+=dataSample;illuminationDecay*=decay;}
vec4 realColor=texture2D(textureSampler,vUV);gl_FragColor=((vec4((vec3(color.r,color.g,color.b)*exposure),1))+(realColor*(1.5-0.4)));
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[O7e] = y7e;
const k7e = "volumetricLightScatteringPassVertexShader", E7e = `attribute vec3 position;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
uniform mat4 viewProjection;uniform vec2 depthValues;
#if defined(ALPHATEST) || defined(NEED_UV)
varying vec2 vUV;uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;
#if (defined(ALPHATEST) || defined(NEED_UV)) && defined(UV1)
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
gl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);
#if defined(ALPHATEST) || defined(BASIC_RENDER)
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
}
`;
Le.ShadersStore[k7e] = E7e;
const F7e = "volumetricLightScatteringPassPixelShader", N7e = `#if defined(ALPHATEST) || defined(NEED_UV)
varying vec2 vUV;
#endif
#if defined(ALPHATEST)
uniform sampler2D diffuseSampler;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#if defined(ALPHATEST)
vec4 diffuseColor=texture2D(diffuseSampler,vUV);if (diffuseColor.a<0.4)
discard;
#endif
gl_FragColor=vec4(0.0,0.0,0.0,1.0);}
`;
Le.ShadersStore[F7e] = N7e;
class Bc extends kr {
  /**
   * @internal
   * VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead
   */
  get useDiffuseColor() {
    return Se.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead"), !1;
  }
  set useDiffuseColor(e) {
    Se.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead");
  }
  /**
   * @constructor
   * @param name The post-process name
   * @param ratio The size of the post-process and/or internal pass (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5)
   * @param camera The camera that the post-process will be attached to
   * @param mesh The mesh used to create the light scattering
   * @param samples The post-process quality, default 100
   * @param samplingMode The post-process filtering mode
   * @param engine The babylon engine
   * @param reusable If the post-process is reusable
   * @param scene The constructor needs a scene reference to initialize internal components. If "camera" is null a "scene" must be provided
   */
  constructor(e, t, r, n, i = 100, s = We.BILINEAR_SAMPLINGMODE, a, f, o) {
    var d, v;
    super(e, "volumetricLightScattering", ["decay", "exposure", "weight", "meshPositionOnScreen", "density"], ["lightScatteringSampler"], t.postProcessRatio || t, r, s, a, f, "#define NUM_SAMPLES " + i), this._screenCoordinates = at.Zero(), this.customMeshPosition = S.Zero(), this.useCustomMeshPosition = !1, this.invert = !0, this.excludedMeshes = [], this.includedMeshes = [], this.exposure = 0.3, this.decay = 0.96815, this.weight = 0.58767, this.density = 0.926, o = (v = (d = r == null ? void 0 : r.getScene()) !== null && d !== void 0 ? d : o) !== null && v !== void 0 ? v : this._scene, a = o.getEngine(), this._viewPort = new WA(0, 0, 1, 1).toGlobal(a.getRenderWidth(), a.getRenderHeight()), this.mesh = n ?? Bc.CreateDefaultMesh("VolumetricLightScatteringMesh", o), this._createPass(o, t.passRatio || t), this.onActivate = (u) => {
      this.isSupported || this.dispose(u), this.onActivate = null;
    }, this.onApplyObservable.add((u) => {
      this._updateMeshScreenCoordinates(o), u.setTexture("lightScatteringSampler", this._volumetricLightScatteringRTT), u.setFloat("exposure", this.exposure), u.setFloat("decay", this.decay), u.setFloat("weight", this.weight), u.setFloat("density", this.density), u.setVector2("meshPositionOnScreen", this._screenCoordinates);
    });
  }
  /**
   * Returns the string "VolumetricLightScatteringPostProcess"
   * @returns "VolumetricLightScatteringPostProcess"
   */
  getClassName() {
    return "VolumetricLightScatteringPostProcess";
  }
  _isReady(e, t) {
    var r;
    const n = e.getMesh();
    if (n === this.mesh && n.material)
      return n.material.isReady(n);
    const i = (r = n._internalAbstractMeshDataInfo._materialForRenderPass) === null || r === void 0 ? void 0 : r[this._scene.getEngine().currentRenderPassId];
    if (i)
      return i.isReadyForSubMesh(n, e, t);
    const s = [], a = [J.PositionKind], f = e.getMaterial();
    f && (f.needAlphaTesting() && s.push("#define ALPHATEST"), n.isVerticesDataPresent(J.UVKind) && (a.push(J.UVKind), s.push("#define UV1")), n.isVerticesDataPresent(J.UV2Kind) && (a.push(J.UV2Kind), s.push("#define UV2"))), n.useBones && n.computeBonesUsingShaders ? (a.push(J.MatricesIndicesKind), a.push(J.MatricesWeightsKind), s.push("#define NUM_BONE_INFLUENCERS " + n.numBoneInfluencers), s.push("#define BonesPerMesh " + (n.skeleton ? n.skeleton.bones.length + 1 : 0))) : s.push("#define NUM_BONE_INFLUENCERS 0"), t && (s.push("#define INSTANCES"), Ye.PushAttributesForInstances(a), e.getRenderingMesh().hasThinInstances && s.push("#define THIN_INSTANCES"));
    const o = e._getDrawWrapper(void 0, !0), d = o.defines, v = s.join(`
`);
    return d !== v && o.setEffect(n.getScene().getEngine().createEffect("volumetricLightScatteringPass", a, ["world", "mBones", "viewProjection", "diffuseMatrix"], ["diffuseSampler"], v, void 0, void 0, void 0, { maxSimultaneousMorphTargets: n.numBoneInfluencers }), v), o.effect.isReady();
  }
  /**
   * Sets the new light position for light scattering effect
   * @param position The new custom light position
   */
  setCustomMeshPosition(e) {
    this.customMeshPosition = e;
  }
  /**
   * Returns the light position for light scattering effect
   * @returns Vector3 The custom light position
   */
  getCustomMeshPosition() {
    return this.customMeshPosition;
  }
  /**
   * Disposes the internal assets and detaches the post-process from the camera
   * @param camera
   */
  dispose(e) {
    const t = e.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT);
    t !== -1 && e.getScene().customRenderTargets.splice(t, 1), this._volumetricLightScatteringRTT.dispose(), super.dispose(e);
  }
  /**
   * Returns the render target texture used by the post-process
   * @returns the render target texture used by the post-process
   */
  getPass() {
    return this._volumetricLightScatteringRTT;
  }
  // Private methods
  _meshExcluded(e) {
    return this.includedMeshes.length > 0 && this.includedMeshes.indexOf(e) === -1 || this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(e) !== -1;
  }
  _createPass(e, t) {
    const r = e.getEngine();
    this._volumetricLightScatteringRTT = new Ta("volumetricLightScatteringMap", { width: r.getRenderWidth() * t, height: r.getRenderHeight() * t }, e, !1, !0, 0), this._volumetricLightScatteringRTT.wrapU = We.CLAMP_ADDRESSMODE, this._volumetricLightScatteringRTT.wrapV = We.CLAMP_ADDRESSMODE, this._volumetricLightScatteringRTT.renderList = null, this._volumetricLightScatteringRTT.renderParticles = !1, this._volumetricLightScatteringRTT.ignoreCameraViewport = !0;
    const n = this.getCamera();
    n ? n.customRenderTargets.push(this._volumetricLightScatteringRTT) : e.customRenderTargets.push(this._volumetricLightScatteringRTT);
    const i = (f) => {
      var o;
      const d = f.getRenderingMesh(), v = f.getEffectiveMesh();
      if (this._meshExcluded(d))
        return;
      v._internalAbstractMeshDataInfo._isActiveIntermediate = !1;
      const u = f.getMaterial();
      if (!u)
        return;
      const l = d.getScene(), P = l.getEngine();
      P.setState(u.backFaceCulling, void 0, void 0, void 0, u.cullBackFaces);
      const p = d._getInstancesRenderList(f._id, !!f.getReplacementMesh());
      if (p.mustReturn)
        return;
      const c = P.getCaps().instancedArrays && (p.visibleInstances[f._id] !== null || d.hasThinInstances);
      if (this._isReady(f, c)) {
        const H = (o = v._internalAbstractMeshDataInfo._materialForRenderPass) === null || o === void 0 ? void 0 : o[P.currentRenderPassId];
        let T = f._getDrawWrapper();
        if (d === this.mesh && !T && (T = u._getDrawWrapper()), !T)
          return;
        const q = T.effect;
        if (P.enableEffect(T), c || d._bind(f, q, u.fillMode), d === this.mesh)
          u.bind(v.getWorldMatrix(), d);
        else if (H)
          H.bindForSubMesh(v.getWorldMatrix(), v, f);
        else {
          if (q.setMatrix("viewProjection", l.getTransformMatrix()), u && u.needAlphaTesting()) {
            const b = u.getAlphaTestTexture();
            q.setTexture("diffuseSampler", b), b && q.setMatrix("diffuseMatrix", b.getTextureMatrix());
          }
          d.useBones && d.computeBonesUsingShaders && d.skeleton && q.setMatrices("mBones", d.skeleton.getTransformMatrices(d));
        }
        c && d.hasThinInstances && q.setMatrix("world", v.getWorldMatrix()), d._processRendering(v, f, q, gt.TriangleFillMode, p, c, (b, j) => {
          b || q.setMatrix("world", j);
        });
      }
    };
    let s;
    const a = new xt(0, 0, 0, 1);
    this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(() => {
      s = e.clearColor, e.clearColor = a;
    }), this._volumetricLightScatteringRTT.onAfterRenderObservable.add(() => {
      e.clearColor = s;
    }), this._volumetricLightScatteringRTT.customIsReadyFunction = (f, o, d) => {
      if ((d || o === 0) && f.subMeshes)
        for (let v = 0; v < f.subMeshes.length; ++v) {
          const u = f.subMeshes[v], l = u.getMaterial(), P = u.getRenderingMesh();
          if (!l)
            continue;
          const p = P._getInstancesRenderList(u._id, !!u.getReplacementMesh()), c = r.getCaps().instancedArrays && (p.visibleInstances[u._id] !== null || P.hasThinInstances);
          if (!this._isReady(u, c))
            return !1;
        }
      return !0;
    }, this._volumetricLightScatteringRTT.customRenderFunction = (f, o, d, v) => {
      const u = e.getEngine();
      let l;
      if (v.length) {
        for (u.setColorWrite(!1), l = 0; l < v.length; l++)
          i(v.data[l]);
        u.setColorWrite(!0);
      }
      for (l = 0; l < f.length; l++)
        i(f.data[l]);
      for (l = 0; l < o.length; l++)
        i(o.data[l]);
      if (d.length) {
        for (l = 0; l < d.length; l++) {
          const p = d.data[l], c = p.getBoundingInfo();
          c && e.activeCamera && (p._alphaIndex = p.getMesh().alphaIndex, p._distanceToCamera = c.boundingSphere.centerWorld.subtract(e.activeCamera.position).length());
        }
        const P = d.data.slice(0, d.length);
        for (P.sort((p, c) => p._alphaIndex > c._alphaIndex ? 1 : p._alphaIndex < c._alphaIndex ? -1 : p._distanceToCamera < c._distanceToCamera ? 1 : p._distanceToCamera > c._distanceToCamera ? -1 : 0), u.setAlphaMode(2), l = 0; l < P.length; l++)
          i(P[l]);
        u.setAlphaMode(0);
      }
    };
  }
  _updateMeshScreenCoordinates(e) {
    const t = e.getTransformMatrix();
    let r;
    this.useCustomMeshPosition ? r = this.customMeshPosition : this.attachedNode ? r = this.attachedNode.position : r = this.mesh.parent ? this.mesh.getAbsolutePosition() : this.mesh.position;
    const n = S.Project(r, he.Identity(), t, this._viewPort);
    this._screenCoordinates.x = n.x / this._viewPort.width, this._screenCoordinates.y = n.y / this._viewPort.height, this.invert && (this._screenCoordinates.y = 1 - this._screenCoordinates.y);
  }
  // Static methods
  /**
   * Creates a default mesh for the Volumeric Light Scattering post-process
   * @param name The mesh name
   * @param scene The scene where to create the mesh
   * @returns the default mesh
   */
  static CreateDefaultMesh(e, t) {
    const r = u4(e, { size: 1 }, t);
    r.billboardMode = jn.BILLBOARDMODE_ALL;
    const n = new Wt(e + "Material", t);
    return n.emissiveColor = new Ne(1, 1, 1), r.material = n, r;
  }
}
C([
  fo()
], Bc.prototype, "customMeshPosition", void 0);
C([
  M()
], Bc.prototype, "useCustomMeshPosition", void 0);
C([
  M()
], Bc.prototype, "invert", void 0);
C([
  tU()
], Bc.prototype, "mesh", void 0);
C([
  M()
], Bc.prototype, "excludedMeshes", void 0);
C([
  M()
], Bc.prototype, "includedMeshes", void 0);
C([
  M()
], Bc.prototype, "exposure", void 0);
C([
  M()
], Bc.prototype, "decay", void 0);
C([
  M()
], Bc.prototype, "weight", void 0);
C([
  M()
], Bc.prototype, "density", void 0);
Ue("BABYLON.VolumetricLightScatteringPostProcess", Bc);
const Q7e = "screenSpaceCurvaturePixelShader", Y7e = `precision highp float;varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D normalSampler;uniform float curvature_ridge;uniform float curvature_valley;
#ifndef CURVATURE_OFFSET
#define CURVATURE_OFFSET 1
#endif
float curvature_soft_clamp(float curvature,float control)
{if (curvature<0.5/control)
return curvature*(1.0-curvature*control);return 0.25/control;}
float calculate_curvature(ivec2 texel,float ridge,float valley)
{vec2 normal_up =texelFetch(normalSampler,texel+ivec2(0, CURVATURE_OFFSET),0).rb;vec2 normal_down =texelFetch(normalSampler,texel+ivec2(0,-CURVATURE_OFFSET),0).rb;vec2 normal_left =texelFetch(normalSampler,texel+ivec2(-CURVATURE_OFFSET,0),0).rb;vec2 normal_right=texelFetch(normalSampler,texel+ivec2( CURVATURE_OFFSET,0),0).rb;float normal_diff=((normal_up.g-normal_down.g)+(normal_right.r-normal_left.r));if (normal_diff<0.0)
return -2.0*curvature_soft_clamp(-normal_diff,valley);return 2.0*curvature_soft_clamp(normal_diff,ridge);}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{ivec2 texel=ivec2(gl_FragCoord.xy);vec4 baseColor=texture2D(textureSampler,vUV);float curvature=calculate_curvature(texel,curvature_ridge,curvature_valley);baseColor.rgb*=curvature+1.0;gl_FragColor=baseColor;}`;
Le.ShadersStore[Q7e] = Y7e;
class hU extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "ScreenSpaceCurvaturePostProcess" string
   */
  getClassName() {
    return "ScreenSpaceCurvaturePostProcess";
  }
  /**
   * Creates a new instance ScreenSpaceCurvaturePostProcess
   * @param name The name of the effect.
   * @param scene The scene containing the objects to blur according to their velocity.
   * @param options The required width/height ratio to downsize to before computing the render pass.
   * @param camera The camera to apply the render pass to.
   * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
   * @param engine The engine which the post process will be applied. (default: current engine)
   * @param reusable If the post process can be reused on the same frame. (default: false)
   * @param textureType Type of textures used when performing the post process. (default: 0)
   * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
   */
  constructor(e, t, r, n, i, s, a, f = 0, o = !1) {
    super(e, "screenSpaceCurvature", ["curvature_ridge", "curvature_valley"], ["textureSampler", "normalSampler"], r, n, i, s, a, void 0, f, void 0, null, o), this.ridge = 1, this.valley = 1, this._geometryBufferRenderer = t.enableGeometryBufferRenderer(), this._geometryBufferRenderer ? (this._geometryBufferRenderer.generateNormalsInWorldSpace && console.error("ScreenSpaceCurvaturePostProcess does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!"), this.onApply = (d) => {
      d.setFloat("curvature_ridge", 0.5 / Math.max(this.ridge * this.ridge, 1e-4)), d.setFloat("curvature_valley", 0.7 / Math.max(this.valley * this.valley, 1e-4));
      const v = this._geometryBufferRenderer.getGBuffer().textures[1];
      d.setTexture("normalSampler", v);
    }) : Se.Error("Multiple Render Target support needed for screen space curvature post process. Please use IsSupported test first.");
  }
  /**
   * Support test.
   */
  static get IsSupported() {
    const e = gr.LastCreatedEngine;
    return e ? e.getCaps().drawBuffersExtension : !1;
  }
  /**
   * @internal
   */
  static _Parse(e, t, r, n) {
    return jt.Parse(() => new hU(e.name, r, e.options, t, e.renderTargetSamplingMode, r.getEngine(), e.textureType, e.reusable), e, r, n);
  }
}
C([
  M()
], hU.prototype, "ridge", void 0);
C([
  M()
], hU.prototype, "valley", void 0);
Ue("BABYLON.ScreenSpaceCurvaturePostProcess", hU);
const M7e = "boundingBoxRendererFragmentDeclaration", L7e = `uniform vec4 color;
`;
Le.IncludesShadersStore[M7e] = L7e;
const K7e = "boundingBoxRendererUboDeclaration", J7e = `#ifdef WEBGL2
uniform vec4 color;uniform mat4 world;uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
#else
layout(std140,column_major) uniform;uniform BoundingBoxRenderer {vec4 color;mat4 world;mat4 viewProjection;mat4 viewProjectionR;};
#endif
`;
Le.IncludesShadersStore[K7e] = J7e;
const z7e = "boundingBoxRendererPixelShader", G7e = `#include<__decl__boundingBoxRendererFragment>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[z7e] = G7e;
const Z7e = "boundingBoxRendererVertexDeclaration", _7e = `uniform mat4 world;uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
`;
Le.IncludesShadersStore[Z7e] = _7e;
const $7e = "boundingBoxRendererVertexShader", eHe = `attribute vec3 position;
#include<__decl__boundingBoxRendererVertex>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec4 worldPos=world*vec4(position,1.0);
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}
#else
gl_Position=viewProjection*worldPos;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[$7e] = eHe;
Object.defineProperty(sr.prototype, "forceShowBoundingBoxes", {
  get: function() {
    return this._forceShowBoundingBoxes || !1;
  },
  set: function(A) {
    this._forceShowBoundingBoxes = A, A && this.getBoundingBoxRenderer();
  },
  enumerable: !0,
  configurable: !0
});
sr.prototype.getBoundingBoxRenderer = function() {
  return this._boundingBoxRenderer || (this._boundingBoxRenderer = new sie(this)), this._boundingBoxRenderer;
};
Object.defineProperty(jn.prototype, "showBoundingBox", {
  get: function() {
    return this._showBoundingBox || !1;
  },
  set: function(A) {
    this._showBoundingBox = A, A && this.getScene().getBoundingBoxRenderer();
  },
  enumerable: !0,
  configurable: !0
});
class sie {
  /**
   * Instantiates a new bounding box renderer in a scene.
   * @param scene the scene the  renderer renders in
   */
  constructor(e) {
    this.name = Ot.NAME_BOUNDINGBOXRENDERER, this.frontColor = new Ne(1, 1, 1), this.backColor = new Ne(0.1, 0.1, 0.1), this.showBackLines = !0, this.onBeforeBoxRenderingObservable = new Oe(), this.onAfterBoxRenderingObservable = new Oe(), this.onResourcesReadyObservable = new Oe(), this.enabled = !0, this.renderList = new qf(32), this._vertexBuffers = {}, this._fillIndexBuffer = null, this._fillIndexData = null, this.scene = e, e._addComponent(this), this._uniformBufferFront = new yr(this.scene.getEngine(), void 0, void 0, "BoundingBoxRendererFront", !this.scene.getEngine().isWebGPU), this._buildUniformLayout(this._uniformBufferFront), this._uniformBufferBack = new yr(this.scene.getEngine(), void 0, void 0, "BoundingBoxRendererBack", !this.scene.getEngine().isWebGPU), this._buildUniformLayout(this._uniformBufferBack);
  }
  _buildUniformLayout(e) {
    e.addUniform("color", 4), e.addUniform("world", 16), e.addUniform("viewProjection", 16), e.addUniform("viewProjectionR", 16), e.create();
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._beforeEvaluateActiveMeshStage.registerStep(Ot.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER, this, this.reset), this.scene._preActiveMeshStage.registerStep(Ot.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER, this, this._preActiveMesh), this.scene._evaluateSubMeshStage.registerStep(Ot.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER, this, this._evaluateSubMesh), this.scene._afterRenderingGroupDrawStage.registerStep(Ot.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER, this, this.render);
  }
  _evaluateSubMesh(e, t) {
    if (e.showSubMeshesBoundingBox) {
      const r = t.getBoundingInfo();
      r != null && (r.boundingBox._tag = e.renderingGroupId, this.renderList.push(r.boundingBox));
    }
  }
  _preActiveMesh(e) {
    if (e.showBoundingBox || this.scene.forceShowBoundingBoxes) {
      const t = e.getBoundingInfo();
      t.boundingBox._tag = e.renderingGroupId, this.renderList.push(t.boundingBox);
    }
  }
  _prepareResources() {
    if (this._colorShader)
      return;
    this._colorShader = new Zo("colorShader", this.scene, "boundingBoxRenderer", {
      attributes: [J.PositionKind],
      uniforms: ["world", "viewProjection", "viewProjectionR", "color"],
      uniformBuffers: ["BoundingBoxRenderer"]
    }, !1), this._colorShader.doNotSerialize = !0, this._colorShader.reservedDataStore = {
      hidden: !0
    }, this._colorShaderForOcclusionQuery = new Zo("colorShaderOccQuery", this.scene, "boundingBoxRenderer", {
      attributes: [J.PositionKind],
      uniforms: ["world", "viewProjection", "viewProjectionR", "color"],
      uniformBuffers: ["BoundingBoxRenderer"]
    }, !0), this._colorShaderForOcclusionQuery.doNotSerialize = !0, this._colorShaderForOcclusionQuery.reservedDataStore = {
      hidden: !0
    };
    const e = this.scene.getEngine(), t = LO({ size: 1 });
    this._vertexBuffers[J.PositionKind] = new J(e, t.positions, J.PositionKind, !1), this._createIndexBuffer(), this._fillIndexData = t.indices, this.onResourcesReadyObservable.notifyObservers(this);
  }
  _createIndexBuffer() {
    const e = this.scene.getEngine();
    this._indexBuffer = e.createIndexBuffer([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 7, 1, 6, 2, 5, 3, 4]);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
    const e = this._vertexBuffers[J.PositionKind];
    e && e._rebuild(), this._createIndexBuffer();
  }
  /**
   * @internal
   */
  reset() {
    this.renderList.reset();
  }
  /**
   * Render the bounding boxes of a specific rendering group
   * @param renderingGroupId defines the rendering group to render
   */
  render(e) {
    var t, r;
    if (this.renderList.length === 0 || !this.enabled || (this._prepareResources(), !this._colorShader.isReady()))
      return;
    const n = this.scene.getEngine();
    n.setDepthWrite(!1);
    const i = this.scene.getTransformMatrix();
    for (let s = 0; s < this.renderList.length; s++) {
      const a = this.renderList.data[s];
      if (a._tag !== e)
        continue;
      this._createWrappersForBoundingBox(a), this.onBeforeBoxRenderingObservable.notifyObservers(a);
      const f = a.minimum, d = a.maximum.subtract(f), v = f.add(d.scale(0.5)), u = he.Scaling(d.x, d.y, d.z).multiply(he.Translation(v.x, v.y, v.z)).multiply(a.getWorldMatrix()), l = n.useReverseDepthBuffer;
      if (this.showBackLines) {
        const p = (t = a._drawWrapperBack) !== null && t !== void 0 ? t : this._colorShader._getDrawWrapper();
        this._colorShader._preBind(p), n.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect()), l ? n.setDepthFunctionToLessOrEqual() : n.setDepthFunctionToGreaterOrEqual(), this._uniformBufferBack.bindToEffect(p.effect, "BoundingBoxRenderer"), this._uniformBufferBack.updateColor4("color", this.backColor, 1), this._uniformBufferBack.updateMatrix("world", u), this._uniformBufferBack.updateMatrix("viewProjection", i), this._uniformBufferBack.update(), n.drawElementsType(gt.LineListDrawMode, 0, 24);
      }
      const P = (r = a._drawWrapperFront) !== null && r !== void 0 ? r : this._colorShader._getDrawWrapper();
      this._colorShader._preBind(P), n.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect()), l ? n.setDepthFunctionToGreater() : n.setDepthFunctionToLess(), this._uniformBufferFront.bindToEffect(P.effect, "BoundingBoxRenderer"), this._uniformBufferFront.updateColor4("color", this.frontColor, 1), this._uniformBufferFront.updateMatrix("world", u), this._uniformBufferFront.updateMatrix("viewProjection", i), this._uniformBufferFront.update(), n.drawElementsType(gt.LineListDrawMode, 0, 24), this.onAfterBoxRenderingObservable.notifyObservers(a);
    }
    this._colorShader.unbind(), n.setDepthFunctionToLessOrEqual(), n.setDepthWrite(!0);
  }
  _createWrappersForBoundingBox(e) {
    if (!e._drawWrapperFront) {
      const t = this.scene.getEngine();
      e._drawWrapperFront = new zo(t), e._drawWrapperBack = new zo(t), e._drawWrapperFront.setEffect(this._colorShader.getEffect()), e._drawWrapperBack.setEffect(this._colorShader.getEffect());
    }
  }
  /**
   * In case of occlusion queries, we can render the occlusion bounding box through this method
   * @param mesh Define the mesh to render the occlusion bounding box for
   */
  renderOcclusionBoundingBox(e) {
    const t = this.scene.getEngine();
    this._renderPassIdForOcclusionQuery === void 0 && (this._renderPassIdForOcclusionQuery = t.createRenderPassId("Render pass for occlusion query"));
    const r = t.currentRenderPassId;
    t.currentRenderPassId = this._renderPassIdForOcclusionQuery, this._prepareResources();
    const n = e.subMeshes[0];
    if (!this._colorShaderForOcclusionQuery.isReady(e, void 0, n) || !e.hasBoundingInfo) {
      t.currentRenderPassId = r;
      return;
    }
    this._fillIndexBuffer || (this._fillIndexBuffer = t.createIndexBuffer(this._fillIndexData));
    const i = t.useReverseDepthBuffer;
    t.setDepthWrite(!1), t.setColorWrite(!1);
    const s = e.getBoundingInfo().boundingBox, a = s.minimum, o = s.maximum.subtract(a), d = a.add(o.scale(0.5)), v = he.Scaling(o.x, o.y, o.z).multiply(he.Translation(d.x, d.y, d.z)).multiply(s.getWorldMatrix()), u = n._drawWrapper;
    this._colorShaderForOcclusionQuery._preBind(u), t.bindBuffers(this._vertexBuffers, this._fillIndexBuffer, u.effect), i ? t.setDepthFunctionToGreater() : t.setDepthFunctionToLess(), this.scene.resetCachedMaterial(), this._uniformBufferFront.bindToEffect(u.effect, "BoundingBoxRenderer"), this._uniformBufferFront.updateMatrix("world", v), this._uniformBufferFront.updateMatrix("viewProjection", this.scene.getTransformMatrix()), this._uniformBufferFront.update(), t.drawElementsType(gt.TriangleFillMode, 0, 36), this._colorShaderForOcclusionQuery.unbind(), t.setDepthFunctionToLessOrEqual(), t.setDepthWrite(!0), t.setColorWrite(!0), t.currentRenderPassId = r;
  }
  /**
   * Dispose and release the resources attached to this renderer.
   */
  dispose() {
    if (this._renderPassIdForOcclusionQuery !== void 0 && (this.scene.getEngine().releaseRenderPassId(this._renderPassIdForOcclusionQuery), this._renderPassIdForOcclusionQuery = void 0), !this._colorShader)
      return;
    this.onBeforeBoxRenderingObservable.clear(), this.onAfterBoxRenderingObservable.clear(), this.onResourcesReadyObservable.clear(), this.renderList.dispose(), this._colorShader.dispose(), this._colorShaderForOcclusionQuery.dispose(), this._uniformBufferFront.dispose(), this._uniformBufferBack.dispose();
    const e = this._vertexBuffers[J.PositionKind];
    e && (e.dispose(), this._vertexBuffers[J.PositionKind] = null), this.scene.getEngine()._releaseBuffer(this._indexBuffer), this._fillIndexBuffer && (this.scene.getEngine()._releaseBuffer(this._fillIndexBuffer), this._fillIndexBuffer = null);
  }
}
sr.prototype.enableDepthRenderer = function(A, e = !1, t = !1, r = 3, n = !1) {
  if (A = A || this.activeCamera, !A)
    throw "No camera available to enable depth renderer";
  if (this._depthRenderer || (this._depthRenderer = {}), !this._depthRenderer[A.id]) {
    const i = !!this.getEngine().getCaps().textureFloatRender;
    let s = 0;
    this.getEngine().getCaps().textureHalfFloatRender && (!t || !i) ? s = 2 : i ? s = 1 : s = 0, this._depthRenderer[A.id] = new jD(this, s, A, e, r, n);
  }
  return this._depthRenderer[A.id];
};
sr.prototype.disableDepthRenderer = function(A) {
  A = A || this.activeCamera, !(!A || !this._depthRenderer || !this._depthRenderer[A.id]) && this._depthRenderer[A.id].dispose();
};
class aie {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_DEPTHRENDERER, this.scene = e;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._gatherRenderTargetsStage.registerStep(Ot.STEP_GATHERRENDERTARGETS_DEPTHRENDERER, this, this._gatherRenderTargets), this.scene._gatherActiveCameraRenderTargetsStage.registerStep(Ot.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER, this, this._gatherActiveCameraRenderTargets);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources
   */
  dispose() {
    for (const e in this.scene._depthRenderer)
      this.scene._depthRenderer[e].dispose();
  }
  _gatherRenderTargets(e) {
    if (this.scene._depthRenderer)
      for (const t in this.scene._depthRenderer) {
        const r = this.scene._depthRenderer[t];
        r.enabled && !r.useOnlyInActiveCamera && e.push(r.getDepthMap());
      }
  }
  _gatherActiveCameraRenderTargets(e) {
    if (this.scene._depthRenderer)
      for (const t in this.scene._depthRenderer) {
        const r = this.scene._depthRenderer[t];
        r.enabled && r.useOnlyInActiveCamera && this.scene.activeCamera.id === t && e.push(r.getDepthMap());
      }
  }
}
jD._SceneComponentInitialization = (A) => {
  let e = A._getComponent(Ot.NAME_DEPTHRENDERER);
  e || (e = new aie(A), A._addComponent(e));
};
const tHe = "oitFinalPixelShader", rHe = `precision highp float;uniform sampler2D uFrontColor;uniform sampler2D uBackColor;void main() {ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec4 frontColor=texelFetch(uFrontColor,fragCoord,0);vec4 backColor=texelFetch(uBackColor,fragCoord,0);float alphaMultiplier=1.0-frontColor.a;glFragColor=vec4(
frontColor.rgb+alphaMultiplier*backColor.rgb,
frontColor.a+backColor.a
);}`;
Le.ShadersStore[tHe] = rHe;
const nHe = "oitBackBlendPixelShader", iHe = `precision highp float;uniform sampler2D uBackColor;void main() {glFragColor=texelFetch(uBackColor,ivec2(gl_FragCoord.xy),0);if (glFragColor.a==0.0) { 
discard;}}`;
Le.ShadersStore[nHe] = iHe;
class sHe {
  constructor() {
    this.enabled = !0, this.name = "depthPeeling", this.texturesRequired = [4];
  }
}
class J2 {
  /**
   * Number of depth peeling passes. As we are using dual depth peeling, each pass two levels of transparency are processed.
   */
  get passCount() {
    return this._passCount;
  }
  set passCount(e) {
    this._passCount !== e && (this._passCount = e, this._createRenderPassIds());
  }
  /**
   * Instructs the renderer to use render passes. It is an optimization that makes the rendering faster for some engines (like WebGPU) but that consumes more memory, so it is disabled by default.
   */
  get useRenderPasses() {
    return this._useRenderPasses;
  }
  set useRenderPasses(e) {
    this._useRenderPasses !== e && (this._useRenderPasses = e, this._createRenderPassIds());
  }
  /**
   * Add a mesh in the exclusion list to prevent it to be handled by the depth peeling renderer
   * @param mesh The mesh to exclude from the depth peeling renderer
   */
  addExcludedMesh(e) {
    this._excludedMeshes.indexOf(e.uniqueId) === -1 && this._excludedMeshes.push(e.uniqueId);
  }
  /**
   * Remove a mesh from the exclusion list of the depth peeling renderer
   * @param mesh The mesh to remove
   */
  removeExcludedMesh(e) {
    const t = this._excludedMeshes.indexOf(e.uniqueId);
    t !== -1 && this._excludedMeshes.splice(t, 1);
  }
  /**
   * Instanciates the depth peeling renderer
   * @param scene Scene to attach to
   * @param passCount Number of depth layers to peel
   * @returns The depth peeling renderer
   */
  constructor(e, t = 5) {
    if (this._thinTextures = [], this._currentPingPongState = 0, this._layoutCacheFormat = [[!0], [!0, !0], [!0, !0, !0]], this._layoutCache = [], this._candidateSubMeshes = new qf(10), this._excludedSubMeshes = new qf(10), this._excludedMeshes = [], this._colorCache = [
      new xt(J2._DEPTH_CLEAR_VALUE, J2._DEPTH_CLEAR_VALUE, 0, 0),
      new xt(-J2._MIN_DEPTH, J2._MAX_DEPTH, 0, 0),
      new xt(0, 0, 0, 0)
    ], this._scene = e, this._engine = e.getEngine(), this._passCount = t, !e.enablePrePassRenderer()) {
      Se.Warn("Depth peeling for order independant transparency could not enable PrePass, aborting.");
      return;
    }
    for (let r = 0; r < this._layoutCacheFormat.length; ++r)
      this._layoutCache[r] = this._engine.buildTextureLayout(this._layoutCacheFormat[r]);
    this._renderPassIds = [], this.useRenderPasses = !1, this._prePassEffectConfiguration = new sHe(), this._createTextures(), this._createEffects();
  }
  _createRenderPassIds() {
    if (this._releaseRenderPassIds(), this._useRenderPasses)
      for (let e = 0; e < this._passCount + 1; ++e)
        this._renderPassIds[e] || (this._renderPassIds[e] = this._engine.createRenderPassId(`DepthPeelingRenderer - pass #${e}`));
  }
  _releaseRenderPassIds() {
    for (let e = 0; e < this._renderPassIds.length; ++e)
      this._engine.releaseRenderPassId(this._renderPassIds[e]);
    this._renderPassIds = [];
  }
  _createTextures() {
    const e = {
      width: this._engine.getRenderWidth(),
      height: this._engine.getRenderHeight()
    };
    this._depthMrts = [
      new Zx("depthPeelingDepth0MRT", e, 3, this._scene, void 0, [
        "depthPeelingDepth0MRT_depth",
        "depthPeelingDepth0MRT_frontColor",
        "depthPeelingDepth0MRT_backColor"
      ]),
      new Zx("depthPeelingDepth1MRT", e, 3, this._scene, void 0, [
        "depthPeelingDepth1MRT_depth",
        "depthPeelingDepth1MRT_frontColor",
        "depthPeelingDepth1MRT_backColor"
      ])
    ], this._colorMrts = [
      new Zx("depthPeelingColor0MRT", e, 2, this._scene, { generateDepthBuffer: !1 }, [
        "depthPeelingColor0MRT_frontColor",
        "depthPeelingColor0MRT_backColor"
      ]),
      new Zx("depthPeelingColor1MRT", e, 2, this._scene, { generateDepthBuffer: !1 }, [
        "depthPeelingColor1MRT_frontColor",
        "depthPeelingColor1MRT_backColor"
      ])
    ], this._blendBackMrt = new Zx("depthPeelingBackMRT", e, 1, this._scene, { generateDepthBuffer: !1 }, ["depthPeelingBackMRT_blendBack"]), this._outputRT = new Ta("depthPeelingOutputRTT", e, this._scene, !1);
    const t = [
      {
        format: 7,
        samplingMode: 1,
        type: this._engine.getCaps().textureFloatLinearFiltering ? 1 : 2,
        label: "DepthPeelingRenderer-DepthTexture"
      },
      {
        format: 5,
        samplingMode: 1,
        type: 2,
        label: "DepthPeelingRenderer-ColorTexture"
      }
    ];
    for (let r = 0; r < 2; r++) {
      const n = this._engine._createInternalTexture(e, t[0], !1), i = this._engine._createInternalTexture(e, t[1], !1), s = this._engine._createInternalTexture(e, t[1], !1);
      this._depthMrts[r].setInternalTexture(n, 0), this._depthMrts[r].setInternalTexture(i, 1), this._depthMrts[r].setInternalTexture(s, 2), this._colorMrts[r].setInternalTexture(i, 0), this._colorMrts[r].setInternalTexture(s, 1), this._thinTextures.push(new nq(n), new nq(i), new nq(s));
    }
  }
  // TODO : explore again MSAA with depth peeling when
  // we are able to fetch individual samples in a multisampled renderbuffer
  // public set samples(value: number) {
  //     for (let i = 0; i < 2; i++) {
  //         this._depthMrts[i].samples = value;
  //         this._colorMrts[i].samples = value;
  //     }
  //     this._scene.prePassRenderer!.samples = value;
  // }
  _disposeTextures() {
    for (let e = 0; e < this._thinTextures.length; e++)
      e !== 6 && this._thinTextures[e].dispose();
    for (let e = 0; e < 2; e++)
      this._depthMrts[e].dispose(!0), this._colorMrts[e].dispose(!0), this._blendBackMrt.dispose(!0);
    this._outputRT.dispose(), this._thinTextures = [], this._colorMrts = [], this._depthMrts = [];
  }
  _updateTextures() {
    return (this._depthMrts[0].getSize().width !== this._engine.getRenderWidth() || this._depthMrts[0].getSize().height !== this._engine.getRenderHeight()) && (this._disposeTextures(), this._createTextures()), this._updateTextureReferences();
  }
  _updateTextureReferences() {
    var e;
    const t = this._scene.prePassRenderer;
    if (!t)
      return !1;
    const r = t.getIndex(4), n = !((e = t.defaultRT.textures) === null || e === void 0) && e.length ? t.defaultRT.textures[r].getInternalTexture() : null;
    return n ? (this._blendBackTexture !== n && (this._blendBackTexture = n, this._blendBackMrt.setInternalTexture(this._blendBackTexture, 0), this._thinTextures[6] && this._thinTextures[6].dispose(), this._thinTextures[6] = new nq(this._blendBackTexture), t.defaultRT.renderTarget._shareDepth(this._depthMrts[0].renderTarget)), !0) : !1;
  }
  _createEffects() {
    this._blendBackEffectWrapper = new ng({
      fragmentShader: "oitBackBlend",
      useShaderStore: !0,
      engine: this._engine,
      samplerNames: ["uBackColor"],
      uniformNames: []
    }), this._blendBackEffectWrapperPingPong = new ng({
      fragmentShader: "oitBackBlend",
      useShaderStore: !0,
      engine: this._engine,
      samplerNames: ["uBackColor"],
      uniformNames: []
    }), this._finalEffectWrapper = new ng({
      fragmentShader: "oitFinal",
      useShaderStore: !0,
      engine: this._engine,
      samplerNames: ["uFrontColor", "uBackColor"],
      uniformNames: []
    }), this._effectRenderer = new fU(this._engine);
  }
  /**
   * Links to the prepass renderer
   * @param prePassRenderer The scene PrePassRenderer
   */
  setPrePassRenderer(e) {
    e.addEffectConfiguration(this._prePassEffectConfiguration);
  }
  /**
   * Binds depth peeling textures on an effect
   * @param effect The effect to bind textures on
   */
  bind(e) {
    e.setTexture("oitDepthSampler", this._thinTextures[this._currentPingPongState * 3]), e.setTexture("oitFrontColorSampler", this._thinTextures[this._currentPingPongState * 3 + 1]);
  }
  _renderSubMeshes(e) {
    let t;
    this._useRenderPasses && (t = {});
    for (let r = 0; r < e.length; r++) {
      const n = e.data[r].getMaterial();
      let i = !0, s = !1;
      const a = e.data[r];
      let f, o = !1;
      if (this._useRenderPasses && (f = a._getDrawWrapper(), o = !f), n && (i = n.allowShaderHotSwapping, s = n.backFaceCulling, n.allowShaderHotSwapping = !1, n.backFaceCulling = !1), a.render(!1), o && (f = a._getDrawWrapper(), f.materialContext)) {
        let d = t[f.materialContext.uniqueId];
        d || (d = t[f.materialContext.uniqueId] = this._engine.createMaterialContext()), a._getDrawWrapper().materialContext = d;
      }
      n && (n.allowShaderHotSwapping = i, n.backFaceCulling = s);
    }
  }
  _finalCompose(e) {
    var t;
    ((t = this._scene.prePassRenderer) === null || t === void 0 ? void 0 : t.setCustomOutput(this._outputRT)) ? this._engine.bindFramebuffer(this._outputRT.renderTarget) : this._engine.restoreDefaultFramebuffer(), this._engine.setAlphaMode(0), this._engine.applyStates(), this._engine.enableEffect(this._finalEffectWrapper._drawWrapper), this._finalEffectWrapper.effect.setTexture("uFrontColor", this._thinTextures[e * 3 + 1]), this._finalEffectWrapper.effect.setTexture("uBackColor", this._thinTextures[6]), this._effectRenderer.render(this._finalEffectWrapper);
  }
  /**
   * Checks if the depth peeling renderer is ready to render transparent meshes
   * @returns true if the depth peeling renderer is ready to render the transparent meshes
   */
  isReady() {
    return this._blendBackEffectWrapper.effect.isReady() && this._blendBackEffectWrapperPingPong.effect.isReady() && this._finalEffectWrapper.effect.isReady() && this._updateTextures();
  }
  /**
   * Renders transparent submeshes with depth peeling
   * @param transparentSubMeshes List of transparent meshes to render
   * @returns The array of submeshes that could not be handled by this renderer
   */
  render(e) {
    if (this._candidateSubMeshes.length = 0, this._excludedSubMeshes.length = 0, !this.isReady())
      return this._excludedSubMeshes;
    this._scene.activeCamera && this._engine.setViewport(this._scene.activeCamera.viewport);
    for (let i = 0; i < e.length; i++) {
      const s = e.data[i], a = s.getMaterial(), f = a && s.getRenderingMesh()._getRenderingFillMode(a.fillMode);
      a && (f === gt.TriangleFanDrawMode || f === gt.TriangleFillMode || f === gt.TriangleStripDrawMode) && this._excludedMeshes.indexOf(s.getMesh().uniqueId) === -1 ? this._candidateSubMeshes.push(s) : this._excludedSubMeshes.push(s);
    }
    if (!this._candidateSubMeshes.length)
      return this._engine.bindFramebuffer(this._colorMrts[1].renderTarget), this._engine.bindAttachments(this._layoutCache[1]), this._engine.clear(this._colorCache[2], !0, !1, !1), this._engine.unBindFramebuffer(this._colorMrts[1].renderTarget), this._finalCompose(1), this._excludedSubMeshes;
    const t = this._engine.currentRenderPassId;
    this._scene.prePassRenderer._enabled = !1, this._useRenderPasses && (this._engine.currentRenderPassId = this._renderPassIds[0]), this._engine.bindFramebuffer(this._depthMrts[0].renderTarget), this._engine.bindAttachments(this._layoutCache[0]), this._engine.clear(this._colorCache[0], !0, !1, !1), this._engine.unBindFramebuffer(this._depthMrts[0].renderTarget), this._engine.bindFramebuffer(this._depthMrts[1].renderTarget), this._engine.bindAttachments(this._layoutCache[0]), this._engine.clear(this._colorCache[1], !0, !1, !1), this._engine.unBindFramebuffer(this._depthMrts[1].renderTarget), this._engine.bindFramebuffer(this._colorMrts[0].renderTarget), this._engine.bindAttachments(this._layoutCache[1]), this._engine.clear(this._colorCache[2], !0, !1, !1), this._engine.unBindFramebuffer(this._colorMrts[0].renderTarget), this._engine.bindFramebuffer(this._colorMrts[1].renderTarget), this._engine.bindAttachments(this._layoutCache[1]), this._engine.clear(this._colorCache[2], !0, !1, !1), this._engine.unBindFramebuffer(this._colorMrts[1].renderTarget), this._engine.bindFramebuffer(this._depthMrts[0].renderTarget), this._engine.bindAttachments(this._layoutCache[0]), this._engine.setAlphaMode(11), this._engine.setAlphaEquation(3), this._engine.depthCullingState.depthMask = !1, this._engine.depthCullingState.depthTest = !0, this._engine.applyStates(), this._currentPingPongState = 1, this._renderSubMeshes(this._candidateSubMeshes), this._engine.unBindFramebuffer(this._depthMrts[0].renderTarget), this._scene.resetCachedMaterial();
    let r = 0, n = 0;
    for (let i = 0; i < this._passCount; i++) {
      r = i % 2, n = 1 - r, this._currentPingPongState = r, this._useRenderPasses && (this._engine.currentRenderPassId = this._renderPassIds[i + 1]), this._scene.activeCamera && this._engine.setViewport(this._scene.activeCamera.viewport), this._engine.bindFramebuffer(this._depthMrts[n].renderTarget), this._engine.bindAttachments(this._layoutCache[0]), this._engine.clear(this._colorCache[0], !0, !1, !1), this._engine.unBindFramebuffer(this._depthMrts[n].renderTarget), this._engine.bindFramebuffer(this._colorMrts[n].renderTarget), this._engine.bindAttachments(this._layoutCache[1]), this._engine.clear(this._colorCache[2], !0, !1, !1), this._engine.unBindFramebuffer(this._colorMrts[n].renderTarget), this._engine.bindFramebuffer(this._depthMrts[n].renderTarget), this._engine.bindAttachments(this._layoutCache[2]), this._engine.setAlphaMode(11), this._engine.setAlphaEquation(3), this._engine.depthCullingState.depthTest = !1, this._engine.applyStates(), this._renderSubMeshes(this._candidateSubMeshes), this._engine.unBindFramebuffer(this._depthMrts[n].renderTarget), this._scene.resetCachedMaterial(), this._engine.bindFramebuffer(this._blendBackMrt.renderTarget), this._engine.bindAttachments(this._layoutCache[0]), this._engine.setAlphaEquation(0), this._engine.setAlphaMode(17), this._engine.applyStates();
      const s = n === 0 || !this._useRenderPasses ? this._blendBackEffectWrapper : this._blendBackEffectWrapperPingPong;
      this._engine.enableEffect(s._drawWrapper), s.effect.setTexture("uBackColor", this._thinTextures[n * 3 + 2]), this._effectRenderer.render(s), this._engine.unBindFramebuffer(this._blendBackMrt.renderTarget);
    }
    return this._engine.currentRenderPassId = t, this._finalCompose(n), this._scene.prePassRenderer._enabled = !0, this._engine.depthCullingState.depthMask = !0, this._engine.depthCullingState.depthTest = !0, this._excludedSubMeshes;
  }
  /**
   * Disposes the depth peeling renderer and associated ressources
   */
  dispose() {
    this._disposeTextures(), this._blendBackEffectWrapper.dispose(), this._finalEffectWrapper.dispose(), this._effectRenderer.dispose(), this._releaseRenderPassIds();
  }
}
J2._DEPTH_CLEAR_VALUE = -99999;
J2._MIN_DEPTH = 0;
J2._MAX_DEPTH = 1;
Object.defineProperty(sr.prototype, "depthPeelingRenderer", {
  get: function() {
    if (!this._depthPeelingRenderer) {
      let A = this._getComponent(Ot.NAME_DEPTHPEELINGRENDERER);
      A || (A = new oie(this), this._addComponent(A));
    }
    return this._depthPeelingRenderer;
  },
  set: function(A) {
    this._depthPeelingRenderer = A;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(sr.prototype, "useOrderIndependentTransparency", {
  get: function() {
    return this._useOrderIndependentTransparency;
  },
  set: function(A) {
    var e;
    this._useOrderIndependentTransparency !== A && (this._useOrderIndependentTransparency = A, this.markAllMaterialsAsDirty(63), (e = this.prePassRenderer) === null || e === void 0 || e.markAsDirty());
  },
  enumerable: !0,
  configurable: !0
});
class oie {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_DEPTHPEELINGRENDERER, this.scene = e, e.depthPeelingRenderer = new J2(e);
  }
  /**
   * Registers the component in a given scene
   */
  register() {
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources.
   */
  dispose() {
    var e;
    (e = this.scene.depthPeelingRenderer) === null || e === void 0 || e.dispose(), this.scene.depthPeelingRenderer = null;
  }
}
const aHe = "linePixelShader", oHe = `#include<clipPlaneFragmentDeclaration>
uniform vec4 color;
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<logDepthFragment>
#include<clipPlaneFragment>
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[aHe] = oHe;
const fHe = "lineVertexShader", AHe = `#include<instancesDeclaration>
#include<clipPlaneVertexDeclaration>
attribute vec3 position;attribute vec4 normal;uniform mat4 viewProjection;uniform float width;uniform float aspectRatio;
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
mat4 worldViewProjection=viewProjection*finalWorld;vec4 viewPosition=worldViewProjection*vec4(position,1.0);vec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);vec2 currentScreen=viewPosition.xy/viewPosition.w;vec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;currentScreen.x*=aspectRatio;nextScreen.x*=aspectRatio;vec2 dir=normalize(nextScreen-currentScreen);vec2 normalDir=vec2(-dir.y,dir.x);normalDir*=width/2.0;normalDir.x/=aspectRatio;vec4 offset=vec4(normalDir*normal.w,0.0,0.0);gl_Position=viewPosition+offset;
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
vec4 worldPos=finalWorld*vec4(position,1.0);
#include<clipPlaneVertex>
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[fHe] = AHe;
jn.prototype.disableEdgesRendering = function() {
  return this._edgesRenderer && (this._edgesRenderer.dispose(), this._edgesRenderer = null), this;
};
jn.prototype.enableEdgesRendering = function(A = 0.95, e = !1, t) {
  return this.disableEdgesRendering(), this._edgesRenderer = new uV(this, A, e, !0, t), this;
};
Object.defineProperty(jn.prototype, "edgesRenderer", {
  get: function() {
    return this._edgesRenderer;
  },
  enumerable: !0,
  configurable: !0
});
Tp.prototype.enableEdgesRendering = function(A = 0.95, e = !1) {
  return this.disableEdgesRendering(), this._edgesRenderer = new fie(this, A, e), this;
};
SQ.prototype.enableEdgesRendering = function(A = 0.95, e = !1) {
  return Tp.prototype.enableEdgesRendering.apply(this, arguments), this;
};
class dHe {
  constructor() {
    this.edges = [], this.edgesConnectedCount = 0;
  }
}
class uV {
  /** Gets the vertices generated by the edge renderer */
  get linesPositions() {
    return this._linesPositions;
  }
  /** Gets the normals generated by the edge renderer */
  get linesNormals() {
    return this._linesNormals;
  }
  /** Gets the indices generated by the edge renderer */
  get linesIndices() {
    return this._linesIndices;
  }
  /**
   * Gets or sets the shader used to draw the lines
   */
  get lineShader() {
    return this._lineShader;
  }
  set lineShader(e) {
    this._lineShader = e;
  }
  static _GetShader(e) {
    if (!e._edgeRenderLineShader) {
      const t = new Zo("lineShader", e, "line", {
        attributes: ["position", "normal"],
        uniforms: ["world", "viewProjection", "color", "width", "aspectRatio"]
      }, !1);
      t.disableDepthWrite = !0, t.backFaceCulling = !1, t.checkReadyOnEveryCall = e.getEngine().isWebGPU, e._edgeRenderLineShader = t;
    }
    return e._edgeRenderLineShader;
  }
  /**
   * Creates an instance of the EdgesRenderer. It is primarily use to display edges of a mesh.
   * Beware when you use this class with complex objects as the adjacencies computation can be really long
   * @param  source Mesh used to create edges
   * @param  epsilon sum of angles in adjacency to check for edge
   * @param  checkVerticesInsteadOfIndices bases the edges detection on vertices vs indices. Note that this parameter is not used if options.useAlternateEdgeFinder = true
   * @param  generateEdgesLines - should generate Lines or only prepare resources.
   * @param  options The options to apply when generating the edges
   */
  constructor(e, t = 0.95, r = !1, n = !0, i) {
    var s;
    this.edgesWidthScalerForOrthographic = 1e3, this.edgesWidthScalerForPerspective = 50, this._linesPositions = new Array(), this._linesNormals = new Array(), this._linesIndices = new Array(), this._buffers = {}, this._buffersForInstances = {}, this._checkVerticesInsteadOfIndices = !1, this.isEnabled = !0, this.customInstances = new qf(32), this._source = e, this._checkVerticesInsteadOfIndices = r, this._options = i ?? null, this._epsilon = t, this._source.getScene().getEngine().isWebGPU && (this._drawWrapper = new zo(e.getEngine())), this._prepareRessources(), n && (!((s = i == null ? void 0 : i.useAlternateEdgeFinder) !== null && s !== void 0) || s ? this._generateEdgesLinesAlternate() : this._generateEdgesLines()), this._meshRebuildObserver = this._source.onRebuildObservable.add(() => {
      this._rebuild();
    }), this._meshDisposeObserver = this._source.onDisposeObservable.add(() => {
      this.dispose();
    });
  }
  _prepareRessources() {
    this._lineShader || (this._lineShader = uV._GetShader(this._source.getScene()));
  }
  /** @internal */
  _rebuild() {
    let e = this._buffers[J.PositionKind];
    e && e._rebuild(), e = this._buffers[J.NormalKind], e && e._rebuild();
    const r = this._source.getScene().getEngine();
    this._ib = r.createIndexBuffer(this._linesIndices);
  }
  /**
   * Releases the required resources for the edges renderer
   */
  dispose() {
    var e;
    this._source.onRebuildObservable.remove(this._meshRebuildObserver), this._source.onDisposeObservable.remove(this._meshDisposeObserver);
    let t = this._buffers[J.PositionKind];
    t && (t.dispose(), this._buffers[J.PositionKind] = null), t = this._buffers[J.NormalKind], t && (t.dispose(), this._buffers[J.NormalKind] = null), this._ib && this._source.getScene().getEngine()._releaseBuffer(this._ib), this._lineShader.dispose(), (e = this._drawWrapper) === null || e === void 0 || e.dispose();
  }
  _processEdgeForAdjacencies(e, t, r, n, i) {
    return e === r && t === n || e === n && t === r ? 0 : e === n && t === i || e === i && t === n ? 1 : e === i && t === r || e === r && t === i ? 2 : -1;
  }
  _processEdgeForAdjacenciesWithVertices(e, t, r, n, i) {
    return e.equalsWithEpsilon(r, 1e-10) && t.equalsWithEpsilon(n, 1e-10) || e.equalsWithEpsilon(n, 1e-10) && t.equalsWithEpsilon(r, 1e-10) ? 0 : e.equalsWithEpsilon(n, 1e-10) && t.equalsWithEpsilon(i, 1e-10) || e.equalsWithEpsilon(i, 1e-10) && t.equalsWithEpsilon(n, 1e-10) ? 1 : e.equalsWithEpsilon(i, 1e-10) && t.equalsWithEpsilon(r, 1e-10) || e.equalsWithEpsilon(r, 1e-10) && t.equalsWithEpsilon(i, 1e-10) ? 2 : -1;
  }
  /**
   * Checks if the pair of p0 and p1 is en edge
   * @param faceIndex
   * @param edge
   * @param faceNormals
   * @param  p0
   * @param  p1
   * @private
   */
  _checkEdge(e, t, r, n, i) {
    let s;
    t === void 0 ? s = !0 : s = S.Dot(r[e], r[t]) < this._epsilon, s && this.createLine(n, i, this._linesPositions.length / 3);
  }
  /**
   * push line into the position, normal and index buffer
   * @param p0
   * @param p1
   * @param offset
   * @protected
   */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  createLine(e, t, r) {
    this._linesPositions.push(e.x, e.y, e.z, e.x, e.y, e.z, t.x, t.y, t.z, t.x, t.y, t.z), this._linesNormals.push(t.x, t.y, t.z, -1, t.x, t.y, t.z, 1, e.x, e.y, e.z, -1, e.x, e.y, e.z, 1), this._linesIndices.push(r, r + 1, r + 2, r, r + 2, r + 3);
  }
  /**
   * See https://playground.babylonjs.com/#R3JR6V#1 for a visual display of the algorithm
   * @param edgePoints
   * @param indexTriangle
   * @param indices
   * @param remapVertexIndices
   */
  _tessellateTriangle(e, t, r, n) {
    const i = (I, N, k) => {
      k >= 0 && N.push(k);
      for (let R = 0; R < I.length; ++R)
        N.push(I[R][0]);
    };
    let s = 0;
    e[1].length >= e[0].length && e[1].length >= e[2].length ? s = 1 : e[2].length >= e[0].length && e[2].length >= e[1].length && (s = 2);
    for (let I = 0; I < 3; ++I)
      I === s ? e[I].sort((N, k) => N[1] < k[1] ? -1 : N[1] > k[1] ? 1 : 0) : e[I].sort((N, k) => N[1] > k[1] ? -1 : N[1] < k[1] ? 1 : 0);
    const a = [], f = [];
    i(e[s], a, -1);
    const o = a.length;
    for (let I = s + 2; I >= s + 1; --I)
      i(e[I % 3], f, I !== s + 2 ? n[r[t + (I + 1) % 3]] : -1);
    const d = f.length, v = 0, u = 0;
    r.push(n[r[t + s]], a[0], f[0]), r.push(n[r[t + (s + 1) % 3]], f[d - 1], a[o - 1]);
    const l = o <= d, P = l ? o : d, p = l ? d : o, c = l ? o - 1 : d - 1, H = l ? 0 : 1;
    let T = o + d - 2, q = l ? v : u, b = l ? u : v;
    const j = l ? a : f, w = l ? f : a;
    let m = 0;
    for (; T-- > 0; ) {
      H ? r.push(j[q], w[b]) : r.push(w[b], j[q]), m += P;
      let I;
      m >= p && q < c ? (I = j[++q], m -= p) : I = w[++b], r.push(I);
    }
    r[t + 0] = r[r.length - 3], r[t + 1] = r[r.length - 2], r[t + 2] = r[r.length - 1], r.length = r.length - 3;
  }
  _generateEdgesLinesAlternate() {
    var e, t, r, n, i, s, a, f, o, d;
    const v = this._source.getVerticesData(J.PositionKind);
    let u = this._source.getIndices();
    if (!u || !v)
      return;
    Array.isArray(u) || (u = Array.from(u));
    const l = (t = (e = this._options) === null || e === void 0 ? void 0 : e.useFastVertexMerger) !== null && t !== void 0 ? t : !0, P = l ? Math.round(-Math.log((n = (r = this._options) === null || r === void 0 ? void 0 : r.epsilonVertexMerge) !== null && n !== void 0 ? n : 1e-6) / Math.log(10)) : (s = (i = this._options) === null || i === void 0 ? void 0 : i.epsilonVertexMerge) !== null && s !== void 0 ? s : 1e-6, p = [], c = [];
    if (l) {
      const q = {};
      for (let b = 0; b < v.length; b += 3) {
        const j = v[b + 0], w = v[b + 1], m = v[b + 2], I = j.toFixed(P) + "|" + w.toFixed(P) + "|" + m.toFixed(P);
        if (q[I] !== void 0)
          p.push(q[I]);
        else {
          const N = b / 3;
          q[I] = N, p.push(N), c.push(N);
        }
      }
    } else
      for (let q = 0; q < v.length; q += 3) {
        const b = v[q + 0], j = v[q + 1], w = v[q + 2];
        let m = !1;
        for (let I = 0; I < q && !m; I += 3) {
          const N = v[I + 0], k = v[I + 1], R = v[I + 2];
          if (Math.abs(b - N) < P && Math.abs(j - k) < P && Math.abs(w - R) < P) {
            p.push(I / 3), m = !0;
            break;
          }
        }
        m || (p.push(q / 3), c.push(q / 3));
      }
    if (!((a = this._options) === null || a === void 0) && a.applyTessellation) {
      const q = (o = (f = this._options) === null || f === void 0 ? void 0 : f.epsilonVertexAligned) !== null && o !== void 0 ? o : 1e-6, b = [];
      for (let j = 0; j < u.length; j += 3) {
        let w;
        for (let m = 0; m < 3; ++m) {
          const I = p[u[j + m]], N = p[u[j + (m + 1) % 3]], k = p[u[j + (m + 2) % 3]];
          if (I === N)
            continue;
          const R = v[I * 3 + 0], y = v[I * 3 + 1], O = v[I * 3 + 2], Y = v[N * 3 + 0], ee = v[N * 3 + 1], Z = v[N * 3 + 2], te = Math.sqrt((Y - R) * (Y - R) + (ee - y) * (ee - y) + (Z - O) * (Z - O));
          for (let fe = 0; fe < c.length - 1; fe++) {
            const _ = c[fe];
            if (_ === I || _ === N || _ === k)
              continue;
            const G = v[_ * 3 + 0], L = v[_ * 3 + 1], $ = v[_ * 3 + 2], ae = Math.sqrt((G - R) * (G - R) + (L - y) * (L - y) + ($ - O) * ($ - O)), Pe = Math.sqrt((G - Y) * (G - Y) + (L - ee) * (L - ee) + ($ - Z) * ($ - Z));
            Math.abs(ae + Pe - te) < q && (w || (w = {
              index: j,
              edgesPoints: [[], [], []]
            }, b.push(w)), w.edgesPoints[m].push([_, ae]));
          }
        }
      }
      for (let j = 0; j < b.length; ++j) {
        const w = b[j];
        this._tessellateTriangle(w.edgesPoints, w.index, u, p);
      }
      b.length = 0;
    }
    const H = {};
    for (let q = 0; q < u.length; q += 3) {
      let b;
      for (let j = 0; j < 3; ++j) {
        let w = p[u[q + j]], m = p[u[q + (j + 1) % 3]];
        const I = p[u[q + (j + 2) % 3]];
        if (w === m || (w === I || m === I) && (!((d = this._options) === null || d === void 0) && d.removeDegeneratedTriangles))
          continue;
        if (ue.Vector3[0].copyFromFloats(v[w * 3 + 0], v[w * 3 + 1], v[w * 3 + 2]), ue.Vector3[1].copyFromFloats(v[m * 3 + 0], v[m * 3 + 1], v[m * 3 + 2]), ue.Vector3[2].copyFromFloats(v[I * 3 + 0], v[I * 3 + 1], v[I * 3 + 2]), b || (ue.Vector3[1].subtractToRef(ue.Vector3[0], ue.Vector3[3]), ue.Vector3[2].subtractToRef(ue.Vector3[1], ue.Vector3[4]), b = S.Cross(ue.Vector3[3], ue.Vector3[4]), b.normalize()), w > m) {
          const R = w;
          w = m, m = R;
        }
        const N = w + "_" + m, k = H[N];
        k ? k.done || (S.Dot(b, k.normal) < this._epsilon && this.createLine(ue.Vector3[0], ue.Vector3[1], this._linesPositions.length / 3), k.done = !0) : H[N] = { normal: b, done: !1, index: q, i: j };
      }
    }
    for (const q in H) {
      const b = H[q];
      if (!b.done) {
        const j = p[u[b.index + b.i]], w = p[u[b.index + (b.i + 1) % 3]];
        ue.Vector3[0].copyFromFloats(v[j * 3 + 0], v[j * 3 + 1], v[j * 3 + 2]), ue.Vector3[1].copyFromFloats(v[w * 3 + 0], v[w * 3 + 1], v[w * 3 + 2]), this.createLine(ue.Vector3[0], ue.Vector3[1], this._linesPositions.length / 3);
      }
    }
    const T = this._source.getScene().getEngine();
    this._buffers[J.PositionKind] = new J(T, this._linesPositions, J.PositionKind, !1), this._buffers[J.NormalKind] = new J(T, this._linesNormals, J.NormalKind, !1, !1, 4), this._buffersForInstances[J.PositionKind] = this._buffers[J.PositionKind], this._buffersForInstances[J.NormalKind] = this._buffers[J.NormalKind], this._ib = T.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;
  }
  /**
   * Generates lines edges from adjacencjes
   * @private
   */
  _generateEdgesLines() {
    const e = this._source.getVerticesData(J.PositionKind), t = this._source.getIndices();
    if (!t || !e)
      return;
    const r = [], n = [];
    let i, s;
    for (i = 0; i < t.length; i += 3) {
      s = new dHe();
      const f = t[i], o = t[i + 1], d = t[i + 2];
      s.p0 = new S(e[f * 3], e[f * 3 + 1], e[f * 3 + 2]), s.p1 = new S(e[o * 3], e[o * 3 + 1], e[o * 3 + 2]), s.p2 = new S(e[d * 3], e[d * 3 + 1], e[d * 3 + 2]);
      const v = S.Cross(s.p1.subtract(s.p0), s.p2.subtract(s.p1));
      v.normalize(), n.push(v), r.push(s);
    }
    for (i = 0; i < r.length; i++) {
      s = r[i];
      for (let f = i + 1; f < r.length; f++) {
        const o = r[f];
        if (s.edgesConnectedCount === 3)
          break;
        if (o.edgesConnectedCount === 3)
          continue;
        const d = t[f * 3], v = t[f * 3 + 1], u = t[f * 3 + 2];
        for (let l = 0; l < 3; l++) {
          let P = 0;
          if (s.edges[l] === void 0) {
            switch (l) {
              case 0:
                this._checkVerticesInsteadOfIndices ? P = this._processEdgeForAdjacenciesWithVertices(s.p0, s.p1, o.p0, o.p1, o.p2) : P = this._processEdgeForAdjacencies(t[i * 3], t[i * 3 + 1], d, v, u);
                break;
              case 1:
                this._checkVerticesInsteadOfIndices ? P = this._processEdgeForAdjacenciesWithVertices(s.p1, s.p2, o.p0, o.p1, o.p2) : P = this._processEdgeForAdjacencies(t[i * 3 + 1], t[i * 3 + 2], d, v, u);
                break;
              case 2:
                this._checkVerticesInsteadOfIndices ? P = this._processEdgeForAdjacenciesWithVertices(s.p2, s.p0, o.p0, o.p1, o.p2) : P = this._processEdgeForAdjacencies(t[i * 3 + 2], t[i * 3], d, v, u);
                break;
            }
            if (P !== -1 && (s.edges[l] = f, o.edges[P] = i, s.edgesConnectedCount++, o.edgesConnectedCount++, s.edgesConnectedCount === 3))
              break;
          }
        }
      }
    }
    for (i = 0; i < r.length; i++) {
      const f = r[i];
      this._checkEdge(i, f.edges[0], n, f.p0, f.p1), this._checkEdge(i, f.edges[1], n, f.p1, f.p2), this._checkEdge(i, f.edges[2], n, f.p2, f.p0);
    }
    const a = this._source.getScene().getEngine();
    this._buffers[J.PositionKind] = new J(a, this._linesPositions, J.PositionKind, !1), this._buffers[J.NormalKind] = new J(a, this._linesNormals, J.NormalKind, !1, !1, 4), this._buffersForInstances[J.PositionKind] = this._buffers[J.PositionKind], this._buffersForInstances[J.NormalKind] = this._buffers[J.NormalKind], this._ib = a.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;
  }
  /**
   * Checks whether or not the edges renderer is ready to render.
   * @returns true if ready, otherwise false.
   */
  isReady() {
    return this._lineShader.isReady(this._source, this._source.hasInstances && this.customInstances.length > 0 || this._source.hasThinInstances);
  }
  /**
   * Renders the edges of the attached mesh,
   */
  render() {
    const e = this._source.getScene(), t = this._lineShader._getDrawWrapper();
    if (this._drawWrapper && this._lineShader._setDrawWrapper(this._drawWrapper), !this.isReady() || !e.activeCamera) {
      this._lineShader._setDrawWrapper(t);
      return;
    }
    const r = this._source.hasInstances && this.customInstances.length > 0, n = r || this._source.hasThinInstances;
    let i = 0;
    if (n)
      if (this._buffersForInstances.world0 = this._source.getVertexBuffer("world0"), this._buffersForInstances.world1 = this._source.getVertexBuffer("world1"), this._buffersForInstances.world2 = this._source.getVertexBuffer("world2"), this._buffersForInstances.world3 = this._source.getVertexBuffer("world3"), r) {
        const a = this._source._instanceDataStorage;
        if (i = this.customInstances.length, !a.instancesData) {
          this._source.getScene()._activeMeshesFrozen || this.customInstances.reset();
          return;
        }
        if (!a.isFrozen) {
          let f = 0;
          for (let o = 0; o < i; ++o)
            this.customInstances.data[o].copyToArray(a.instancesData, f), f += 16;
          a.instancesBuffer.updateDirectly(a.instancesData, 0, i);
        }
      } else
        i = this._source.thinInstanceCount;
    const s = e.getEngine();
    this._lineShader._preBind(), this._source.edgesColor.a !== 1 ? s.setAlphaMode(2) : s.setAlphaMode(0), s.bindBuffers(n ? this._buffersForInstances : this._buffers, this._ib, this._lineShader.getEffect()), e.resetCachedMaterial(), this._lineShader.setColor4("color", this._source.edgesColor), e.activeCamera.mode === Tr.ORTHOGRAPHIC_CAMERA ? this._lineShader.setFloat("width", this._source.edgesWidth / this.edgesWidthScalerForOrthographic) : this._lineShader.setFloat("width", this._source.edgesWidth / this.edgesWidthScalerForPerspective), this._lineShader.setFloat("aspectRatio", s.getAspectRatio(e.activeCamera)), this._lineShader.bind(this._source.getWorldMatrix()), s.drawElementsType(gt.TriangleFillMode, 0, this._indicesCount, i), this._lineShader.unbind(), n && s.unbindInstanceAttributes(), this._source.getScene()._activeMeshesFrozen || this.customInstances.reset(), this._lineShader._setDrawWrapper(t);
  }
}
class fie extends uV {
  /**
   * This constructor turns off auto generating edges line in Edges Renderer to make it here.
   * @param  source LineMesh used to generate edges
   * @param  epsilon not important (specified angle for edge detection)
   * @param  checkVerticesInsteadOfIndices not important for LineMesh
   */
  constructor(e, t = 0.95, r = !1) {
    super(e, t, r, !1), this._generateEdgesLines();
  }
  /**
   * Generate edges for each line in LinesMesh. Every Line should be rendered as edge.
   */
  _generateEdgesLines() {
    const e = this._source.getVerticesData(J.PositionKind), t = this._source.getIndices();
    if (!t || !e)
      return;
    const r = ue.Vector3[0], n = ue.Vector3[1], i = t.length - 1;
    for (let a = 0, f = 0; a < i; a += 2, f += 4)
      S.FromArrayToRef(e, 3 * t[a], r), S.FromArrayToRef(e, 3 * t[a + 1], n), this.createLine(r, n, f);
    const s = this._source.getScene().getEngine();
    this._buffers[J.PositionKind] = new J(s, this._linesPositions, J.PositionKind, !1), this._buffers[J.NormalKind] = new J(s, this._linesNormals, J.NormalKind, !1, !1, 4), this._ib = s.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;
  }
}
class vHe extends Zx {
  constructor(e, t, r, n, i, s) {
    super(e, r, n, i, s), this._beforeCompositionPostProcesses = [], this._internalTextureDirty = !1, this.enabled = !1, this.renderTargetTexture = null, this.renderTargetTexture = t;
  }
  /**
   * Creates a composition effect for this RT
   * @internal
   */
  _createCompositionEffect() {
    this.imageProcessingPostProcess = new Uy("prePassComposition", 1, null, void 0, this._engine), this.imageProcessingPostProcess._updateParameters();
  }
  /**
   * Checks that the size of this RT is still adapted to the desired render size.
   * @internal
   */
  _checkSize() {
    const e = this._engine.getRenderWidth(!0), t = this._engine.getRenderHeight(!0), r = this.getRenderWidth(), n = this.getRenderHeight();
    (r !== e || n !== t) && (this.resize({ width: e, height: t }), this._internalTextureDirty = !0);
  }
  /**
   * Changes the number of render targets in this MRT
   * Be careful as it will recreate all the data in the new texture.
   * @param count new texture count
   * @param options Specifies texture types and sampling modes for new textures
   * @param textureNames Specifies the names of the textures (optional)
   */
  updateCount(e, t, r) {
    super.updateCount(e, t, r), this._internalTextureDirty = !0;
  }
  /**
   * Resets the post processes chains applied to this RT.
   * @internal
   */
  _resetPostProcessChain() {
    this._beforeCompositionPostProcesses.length = 0;
  }
  /**
   * Diposes this render target
   */
  dispose() {
    const e = this._scene;
    if (super.dispose(), e && e.prePassRenderer) {
      const t = e.prePassRenderer.renderTargets.indexOf(this);
      t !== -1 && e.prePassRenderer.renderTargets.splice(t, 1);
    }
    this.imageProcessingPostProcess && this.imageProcessingPostProcess.dispose(), this.renderTargetTexture && (this.renderTargetTexture._prePassRenderTarget = null), this._outputPostProcess && (this._outputPostProcess.autoClear = !0, this._outputPostProcess.restoreDefaultInputTexture());
  }
}
class mA {
  /**
   * Indicates if the prepass renderer is generating normals in world space or camera space (default: camera space)
   */
  get generateNormalsInWorldSpace() {
    return this._generateNormalsInWorldSpace;
  }
  set generateNormalsInWorldSpace(e) {
    this._generateNormalsInWorldSpace !== e && (this._generateNormalsInWorldSpace = e, this._markAllMaterialsAsPrePassDirty());
  }
  /**
   * Returns the index of a texture in the multi render target texture array.
   * @param type Texture type
   * @returns The index
   */
  getIndex(e) {
    return this._textureIndices[e];
  }
  /**
   * How many samples are used for MSAA of the scene render target
   */
  get samples() {
    return this.defaultRT.samples;
  }
  set samples(e) {
    this.defaultRT.samples = e;
  }
  /**
   * If set to true (default: false), the depth texture will be cleared with the depth value corresponding to the far plane (1 in normal mode, 0 in reverse depth buffer mode)
   * If set to false, the depth texture is always cleared with 0.
   */
  get useSpecificClearForDepthTexture() {
    return this._useSpecificClearForDepthTexture;
  }
  set useSpecificClearForDepthTexture(e) {
    this._useSpecificClearForDepthTexture !== e && (this._useSpecificClearForDepthTexture = e, this._isDirty = !0);
  }
  /**
   * @returns the prepass render target for the rendering pass.
   * If we are currently rendering a render target, it returns the PrePassRenderTarget
   * associated with that render target. Otherwise, it returns the scene default PrePassRenderTarget
   */
  getRenderTarget() {
    return this._currentTarget;
  }
  /**
   * @internal
   * Managed by the scene component
   * @param prePassRenderTarget
   */
  _setRenderTarget(e) {
    var t, r;
    e ? this._currentTarget = e : (this._currentTarget = this.defaultRT, this._engine.currentRenderPassId = (r = (t = this._scene.activeCamera) === null || t === void 0 ? void 0 : t.renderPassId) !== null && r !== void 0 ? r : this._currentTarget.renderPassId);
  }
  /**
   * Returns true if the currently rendered prePassRenderTarget is the one
   * associated with the scene.
   */
  get currentRTisSceneRT() {
    return this._currentTarget === this.defaultRT;
  }
  _refreshGeometryBufferRendererLink() {
    if (this.doNotUseGeometryRendererFallback)
      this._geometryBuffer && this._geometryBuffer._unlinkPrePassRenderer(), this._geometryBuffer = null, this._scene.disableGeometryBufferRenderer();
    else {
      if (this._geometryBuffer = this._scene.enableGeometryBufferRenderer(), !this._geometryBuffer) {
        this.doNotUseGeometryRendererFallback = !0;
        return;
      }
      this._geometryBuffer._linkPrePassRenderer(this);
    }
  }
  /**
   * Indicates if the prepass is enabled
   */
  get enabled() {
    return this._enabled;
  }
  /**
   * Instantiates a prepass renderer
   * @param scene The scene
   */
  constructor(e) {
    this.excludedSkinnedMesh = [], this.excludedMaterials = [], this.mrtCount = 0, this._mrtTypes = [], this._mrtFormats = [], this._mrtLayout = [], this._mrtNames = [], this._textureIndices = [], this._generateNormalsInWorldSpace = !1, this._useSpecificClearForDepthTexture = !1, this._isDirty = !0, this._effectConfigurations = [], this.doNotUseGeometryRendererFallback = !0, this.renderTargets = [], this._clearColor = new xt(0, 0, 0, 0), this._clearDepthColor = new xt(1e8, 0, 0, 1), this._enabled = !1, this._needsCompositionForThisPass = !1, this.disableGammaTransform = !1, this._scene = e, this._engine = e.getEngine();
    let t = 0;
    this._engine._caps.textureFloat && this._engine._caps.textureFloatLinearFiltering ? t = 1 : this._engine._caps.textureHalfFloat && this._engine._caps.textureHalfFloatLinearFiltering && (t = 2);
    for (let r = 0; r < mA.TextureFormats.length; ++r) {
      const n = mA.TextureFormats[r].format;
      mA.TextureFormats[r].type === 1 && (mA.TextureFormats[5].type = t, (n === 6 || n === 7 || n === 5) && !this._engine._caps.supportFloatTexturesResolve && (mA.TextureFormats[5].type = 2));
    }
    mA._SceneComponentInitialization(this._scene), this.defaultRT = this._createRenderTarget("sceneprePassRT", null), this._currentTarget = this.defaultRT;
  }
  /**
   * Creates a new PrePassRenderTarget
   * This should be the only way to instantiate a `PrePassRenderTarget`
   * @param name Name of the `PrePassRenderTarget`
   * @param renderTargetTexture RenderTarget the `PrePassRenderTarget` will be attached to.
   * Can be `null` if the created `PrePassRenderTarget` is attached to the scene (default framebuffer).
   * @internal
   */
  _createRenderTarget(e, t) {
    const r = new vHe(e, t, { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, 0, this._scene, {
      generateMipMaps: !1,
      generateStencilBuffer: this._engine.isStencilEnable,
      defaultType: 0,
      types: [],
      drawOnlyOnFirstAttachmentByDefault: !0
    });
    return this.renderTargets.push(r), this._enabled && this._update(), r;
  }
  /**
   * Indicates if rendering a prepass is supported
   */
  get isSupported() {
    return this._scene.getEngine().getCaps().drawBuffersExtension;
  }
  /**
   * Sets the proper output textures to draw in the engine.
   * @param effect The effect that is drawn. It can be or not be compatible with drawing to several output textures.
   * @param subMesh Submesh on which the effect is applied
   */
  bindAttachmentsForEffect(e, t) {
    const r = t.getMaterial(), n = r && r.isPrePassCapable, i = r && this.excludedMaterials.indexOf(r) !== -1;
    this.enabled && this._currentTarget.enabled && (e._multiTarget && n && !i ? this._engine.bindAttachments(this._multiRenderAttachments) : (this._engine._currentRenderTarget ? this._engine.bindAttachments(this._defaultAttachments) : this._engine.restoreSingleAttachment(), this._geometryBuffer && this.currentRTisSceneRT && !i && this._geometryBuffer.renderList.push(t.getRenderingMesh())));
  }
  _reinitializeAttachments() {
    const e = [], t = [!1], r = [!1], n = [!0];
    for (let i = 0; i < this.mrtCount; i++)
      e.push(!0), i > 0 && (this._useSpecificClearForDepthTexture && this._mrtLayout[i] === 5 ? (t.push(!1), r.push(!0)) : (t.push(!0), r.push(!1)), n.push(!1));
    this._multiRenderAttachments = this._engine.buildTextureLayout(e), this._clearAttachments = this._engine.buildTextureLayout(t), this._clearDepthAttachments = this._engine.buildTextureLayout(r), this._defaultAttachments = this._engine.buildTextureLayout(n);
  }
  _resetLayout() {
    for (let e = 0; e < mA.TextureFormats.length; e++)
      this._textureIndices[mA.TextureFormats[e].purpose] = -1;
    this._textureIndices[4] = 0, this._mrtLayout = [4], this._mrtTypes = [mA.TextureFormats[4].type], this._mrtFormats = [mA.TextureFormats[4].format], this._mrtNames = [mA.TextureFormats[4].name], this.mrtCount = 1;
  }
  _updateGeometryBufferLayout() {
    if (this._refreshGeometryBufferRendererLink(), this._geometryBuffer) {
      this._geometryBuffer._resetLayout();
      const e = [];
      for (let r = 0; r < this._mrtLayout.length; r++)
        e.push(!1);
      this._geometryBuffer._linkInternalTexture(this.defaultRT.getInternalTexture());
      const t = [
        {
          prePassConstant: 5,
          geometryBufferConstant: po.DEPTH_TEXTURE_TYPE
        },
        {
          prePassConstant: 6,
          geometryBufferConstant: po.NORMAL_TEXTURE_TYPE
        },
        {
          prePassConstant: 1,
          geometryBufferConstant: po.POSITION_TEXTURE_TYPE
        },
        {
          prePassConstant: 3,
          geometryBufferConstant: po.REFLECTIVITY_TEXTURE_TYPE
        },
        {
          prePassConstant: 2,
          geometryBufferConstant: po.VELOCITY_TEXTURE_TYPE
        }
      ];
      for (let r = 0; r < t.length; r++) {
        const n = this._mrtLayout.indexOf(t[r].prePassConstant);
        n !== -1 && (this._geometryBuffer._forceTextureType(t[r].geometryBufferConstant, n), e[n] = !0);
      }
      this._geometryBuffer._setAttachments(this._engine.buildTextureLayout(e));
    }
  }
  /**
   * Restores attachments for single texture draw.
   */
  restoreAttachments() {
    this.enabled && this._currentTarget.enabled && this._defaultAttachments && (this._engine._currentRenderTarget ? this._engine.bindAttachments(this._defaultAttachments) : this._engine.restoreSingleAttachment());
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _beforeDraw(e, t, r) {
    this._isDirty && this._update(), !(!this._enabled || !this._currentTarget.enabled) && (this._geometryBuffer && (this._geometryBuffer.renderList = []), this._setupOutputForThisPass(this._currentTarget, e));
  }
  _prepareFrame(e, t, r) {
    e.renderTargetTexture ? e.renderTargetTexture._prepareFrame(this._scene, t, r, e.renderTargetTexture.useCameraPostProcesses) : this._postProcessesSourceForThisPass.length ? this._scene.postProcessManager._prepareFrame() : this._engine.restoreDefaultFramebuffer();
  }
  /**
   * Sets an intermediary texture between prepass and postprocesses. This texture
   * will be used as input for post processes
   * @param rt
   * @returns true if there are postprocesses that will use this texture,
   * false if there is no postprocesses - and the function has no effect
   */
  setCustomOutput(e) {
    const t = this._postProcessesSourceForThisPass[0];
    return t ? (t.inputTexture = e.renderTarget, !0) : !1;
  }
  _renderPostProcesses(e, t) {
    var r;
    const n = this._postProcessesSourceForThisPass[0], i = n ? n.inputTexture : e.renderTargetTexture ? e.renderTargetTexture.renderTarget : null;
    let s = this._currentTarget._beforeCompositionPostProcesses;
    this._needsCompositionForThisPass && (s = s.concat([this._currentTarget.imageProcessingPostProcess])), s.length && (this._scene.postProcessManager._prepareFrame((r = this._currentTarget.renderTarget) === null || r === void 0 ? void 0 : r.texture, s), this._scene.postProcessManager.directRender(s, i, !1, t));
  }
  /**
   * @internal
   */
  _afterDraw(e, t) {
    this._enabled && this._currentTarget.enabled && (this._prepareFrame(this._currentTarget, e, t), this._renderPostProcesses(this._currentTarget, e));
  }
  /**
   * Clears the current prepass render target (in the sense of settings pixels to the scene clear color value)
   * @internal
   */
  _clear() {
    this._enabled && this._currentTarget.enabled && (this._bindFrameBuffer(), this._engine.bindAttachments(this._clearAttachments), this._engine.clear(this._clearColor, !0, !1, !1), this._useSpecificClearForDepthTexture && (this._engine.bindAttachments(this._clearDepthAttachments), this._engine.clear(this._clearDepthColor, !0, !1, !1)), this._engine.bindAttachments(this._defaultAttachments));
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _bindFrameBuffer() {
    if (this._enabled && this._currentTarget.enabled) {
      this._currentTarget._checkSize();
      const e = this._currentTarget.renderTarget;
      e && this._engine.bindFramebuffer(e);
    }
  }
  _setEnabled(e) {
    this._enabled = e;
  }
  _setRenderTargetEnabled(e, t) {
    e.enabled = t, t || this._unlinkInternalTexture(e);
  }
  /**
   * Adds an effect configuration to the prepass render target.
   * If an effect has already been added, it won't add it twice and will return the configuration
   * already present.
   * @param cfg the effect configuration
   * @returns the effect configuration now used by the prepass
   */
  addEffectConfiguration(e) {
    for (let t = 0; t < this._effectConfigurations.length; t++)
      if (this._effectConfigurations[t].name === e.name)
        return this._effectConfigurations[t];
    return this._effectConfigurations.push(e), e;
  }
  /**
   * Retrieves an effect configuration by name
   * @param name
   * @returns the effect configuration, or null if not present
   */
  getEffectConfiguration(e) {
    for (let t = 0; t < this._effectConfigurations.length; t++)
      if (this._effectConfigurations[t].name === e)
        return this._effectConfigurations[t];
    return null;
  }
  _enable() {
    const e = this.mrtCount;
    for (let t = 0; t < this._effectConfigurations.length; t++)
      this._effectConfigurations[t].enabled && this._enableTextures(this._effectConfigurations[t].texturesRequired);
    for (let t = 0; t < this.renderTargets.length; t++) {
      (this.mrtCount !== e || this.renderTargets[t].count !== this.mrtCount) && this.renderTargets[t].updateCount(this.mrtCount, { types: this._mrtTypes, formats: this._mrtFormats }, this._mrtNames.concat("prePass_DepthBuffer")), this.renderTargets[t]._resetPostProcessChain();
      for (let r = 0; r < this._effectConfigurations.length; r++)
        this._effectConfigurations[r].enabled && (!this._effectConfigurations[r].postProcess && this._effectConfigurations[r].createPostProcess && this._effectConfigurations[r].createPostProcess(), this._effectConfigurations[r].postProcess && this.renderTargets[t]._beforeCompositionPostProcesses.push(this._effectConfigurations[r].postProcess));
    }
    this._reinitializeAttachments(), this._setEnabled(!0), this._updateGeometryBufferLayout();
  }
  _disable() {
    this._setEnabled(!1);
    for (let e = 0; e < this.renderTargets.length; e++)
      this._setRenderTargetEnabled(this.renderTargets[e], !1);
    this._resetLayout();
    for (let e = 0; e < this._effectConfigurations.length; e++)
      this._effectConfigurations[e].enabled = !1;
  }
  _getPostProcessesSource(e, t) {
    if (t)
      return t._postProcesses;
    if (e.renderTargetTexture)
      if (e.renderTargetTexture.useCameraPostProcesses) {
        const r = e.renderTargetTexture.activeCamera ? e.renderTargetTexture.activeCamera : this._scene.activeCamera;
        return r ? r._postProcesses : [];
      } else
        return e.renderTargetTexture.postProcesses ? e.renderTargetTexture.postProcesses : [];
    else
      return this._scene.activeCamera ? this._scene.activeCamera._postProcesses : [];
  }
  _setupOutputForThisPass(e, t) {
    const r = t && this._scene.activeCameras && !!this._scene.activeCameras.length && this._scene.activeCameras.indexOf(t) !== 0;
    this._postProcessesSourceForThisPass = this._getPostProcessesSource(e, t), this._postProcessesSourceForThisPass = this._postProcessesSourceForThisPass.filter((f) => f != null), this._scene.autoClear = !0;
    const n = this._hasImageProcessing(this._postProcessesSourceForThisPass);
    this._needsCompositionForThisPass = !n && !this.disableGammaTransform && this._needsImageProcessing() && !r;
    const i = this._getFirstPostProcess(this._postProcessesSourceForThisPass), s = e._beforeCompositionPostProcesses && e._beforeCompositionPostProcesses[0];
    let a = null;
    this._scene.imageProcessingConfiguration.applyByPostProcess = this._needsCompositionForThisPass || n, this._needsCompositionForThisPass && !e.imageProcessingPostProcess && e._createCompositionEffect(), s ? a = s : this._needsCompositionForThisPass ? a = e.imageProcessingPostProcess : i && (a = i), this._bindFrameBuffer(), this._linkInternalTexture(e, a);
  }
  _linkInternalTexture(e, t) {
    t && (t.autoClear = !1, t.inputTexture = e.renderTarget), e._outputPostProcess !== t && (e._outputPostProcess && this._unlinkInternalTexture(e), e._outputPostProcess = t), e._internalTextureDirty && (this._updateGeometryBufferLayout(), e._internalTextureDirty = !1);
  }
  /**
   * @internal
   */
  _unlinkInternalTexture(e) {
    e._outputPostProcess && (e._outputPostProcess.autoClear = !0, e._outputPostProcess.restoreDefaultInputTexture(), e._outputPostProcess = null);
  }
  _needsImageProcessing() {
    for (let e = 0; e < this._effectConfigurations.length; e++)
      if (this._effectConfigurations[e].enabled && this._effectConfigurations[e].needsImageProcessing)
        return !0;
    return !1;
  }
  _hasImageProcessing(e) {
    var t;
    let r = !1;
    if (e) {
      for (let n = 0; n < e.length; n++)
        if (((t = e[n]) === null || t === void 0 ? void 0 : t.getClassName()) === "ImageProcessingPostProcess") {
          r = !0;
          break;
        }
    }
    return r;
  }
  /**
   * Internal, gets the first post proces.
   * @param postProcesses
   * @returns the first post process to be run on this camera.
   */
  _getFirstPostProcess(e) {
    for (let t = 0; t < e.length; t++)
      if (e[t] !== null)
        return e[t];
    return null;
  }
  /**
   * Marks the prepass renderer as dirty, triggering a check if the prepass is necessary for the next rendering.
   */
  markAsDirty() {
    this._isDirty = !0;
  }
  /**
   * Enables a texture on the MultiRenderTarget for prepass
   * @param types
   */
  _enableTextures(e) {
    this._scene.needsPreviousWorldMatrices = !1;
    for (let t = 0; t < e.length; t++) {
      const r = e[t];
      this._textureIndices[r] === -1 && (this._textureIndices[r] = this._mrtLayout.length, this._mrtLayout.push(r), this._mrtTypes.push(mA.TextureFormats[r].type), this._mrtFormats.push(mA.TextureFormats[r].format), this._mrtNames.push(mA.TextureFormats[r].name), this.mrtCount++), r === 2 && (this._scene.needsPreviousWorldMatrices = !0);
    }
  }
  /**
   * Makes sure that the prepass renderer is up to date if it has been dirtified.
   */
  update() {
    this._isDirty && this._update();
  }
  _update() {
    this._disable();
    let e = !1;
    this._scene.imageProcessingConfiguration.applyByPostProcess = !1, this._scene._depthPeelingRenderer && this._scene.useOrderIndependentTransparency && (this._scene._depthPeelingRenderer.setPrePassRenderer(this), e = !0);
    for (let r = 0; r < this._scene.materials.length; r++)
      this._scene.materials[r].setPrePassRenderer(this) && (e = !0);
    e && this._setRenderTargetEnabled(this.defaultRT, !0);
    let t;
    for (let r = 0; r < this.renderTargets.length; r++) {
      if (this.renderTargets[r].renderTargetTexture)
        t = this._getPostProcessesSource(this.renderTargets[r]);
      else {
        const n = this._scene.activeCamera;
        if (!n)
          continue;
        t = n._postProcesses;
      }
      if (t && (t = t.filter((n) => n != null), t)) {
        for (let n = 0; n < t.length; n++)
          t[n].setPrePassRenderer(this) && (this._setRenderTargetEnabled(this.renderTargets[r], !0), e = !0);
        this._hasImageProcessing(t) && (this._scene.imageProcessingConfiguration.applyByPostProcess = !0);
      }
    }
    this._markAllMaterialsAsPrePassDirty(), this._isDirty = !1, e && this._enable();
  }
  _markAllMaterialsAsPrePassDirty() {
    const e = this._scene.materials;
    for (let t = 0; t < e.length; t++)
      e[t].markAsDirty(gt.PrePassDirtyFlag);
  }
  /**
   * Disposes the prepass renderer.
   */
  dispose() {
    for (let e = this.renderTargets.length - 1; e >= 0; e--)
      this.renderTargets[e].dispose();
    for (let e = 0; e < this._effectConfigurations.length; e++)
      this._effectConfigurations[e].dispose && this._effectConfigurations[e].dispose();
  }
}
mA._SceneComponentInitialization = (A) => {
  throw qn("PrePassRendererSceneComponent");
};
mA.TextureFormats = [
  {
    purpose: 0,
    type: 2,
    format: 5,
    name: "prePass_Irradiance"
  },
  {
    purpose: 1,
    type: 2,
    format: 5,
    name: "prePass_Position"
  },
  {
    purpose: 2,
    type: 0,
    format: 5,
    name: "prePass_Velocity"
  },
  {
    purpose: 3,
    type: 0,
    format: 5,
    name: "prePass_Reflectivity"
  },
  {
    purpose: 4,
    type: 2,
    format: 5,
    name: "prePass_Color"
  },
  {
    purpose: 5,
    type: 1,
    format: 6,
    name: "prePass_Depth"
  },
  {
    purpose: 6,
    type: 2,
    format: 5,
    name: "prePass_Normal"
  },
  {
    purpose: 7,
    type: 0,
    format: 5,
    name: "prePass_Albedo"
  }
];
Object.defineProperty(sr.prototype, "prePassRenderer", {
  get: function() {
    return this._prePassRenderer;
  },
  set: function(A) {
    A && A.isSupported && (this._prePassRenderer = A);
  },
  enumerable: !0,
  configurable: !0
});
sr.prototype.enablePrePassRenderer = function() {
  return this._prePassRenderer ? this._prePassRenderer : (this._prePassRenderer = new mA(this), this._prePassRenderer.isSupported || (this._prePassRenderer = null, Se.Error(`PrePassRenderer needs WebGL 2 support.
Maybe you tried to use the following features that need the PrePassRenderer :
 + Subsurface Scattering`)), this._prePassRenderer);
};
sr.prototype.disablePrePassRenderer = function() {
  this._prePassRenderer && (this._prePassRenderer.dispose(), this._prePassRenderer = null);
};
class Aie {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_PREPASSRENDERER, this.scene = e;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._beforeCameraDrawStage.registerStep(Ot.STEP_BEFORECAMERADRAW_PREPASS, this, this._beforeCameraDraw), this.scene._afterCameraDrawStage.registerStep(Ot.STEP_AFTERCAMERADRAW_PREPASS, this, this._afterCameraDraw), this.scene._beforeRenderTargetDrawStage.registerStep(Ot.STEP_BEFORERENDERTARGETDRAW_PREPASS, this, this._beforeRenderTargetDraw), this.scene._afterRenderTargetDrawStage.registerStep(Ot.STEP_AFTERCAMERADRAW_PREPASS, this, this._afterRenderTargetDraw), this.scene._beforeClearStage.registerStep(Ot.STEP_BEFORECLEAR_PREPASS, this, this._beforeClearStage), this.scene._beforeRenderTargetClearStage.registerStep(Ot.STEP_BEFORERENDERTARGETCLEAR_PREPASS, this, this._beforeRenderTargetClearStage), this.scene._beforeRenderingMeshStage.registerStep(Ot.STEP_BEFORERENDERINGMESH_PREPASS, this, this._beforeRenderingMeshStage), this.scene._afterRenderingMeshStage.registerStep(Ot.STEP_AFTERRENDERINGMESH_PREPASS, this, this._afterRenderingMeshStage);
  }
  _beforeRenderTargetDraw(e, t, r) {
    this.scene.prePassRenderer && !e.noPrePassRenderer && (this.scene.prePassRenderer._setRenderTarget(e._prePassRenderTarget), this.scene.prePassRenderer._beforeDraw(void 0, t, r));
  }
  _afterRenderTargetDraw(e, t, r) {
    this.scene.prePassRenderer && !e.noPrePassRenderer && this.scene.prePassRenderer._afterDraw(t, r);
  }
  _beforeRenderTargetClearStage(e) {
    this.scene.prePassRenderer && !e.noPrePassRenderer && (e._prePassRenderTarget || (e._prePassRenderTarget = this.scene.prePassRenderer._createRenderTarget(e.name + "_prePassRTT", e)), this.scene.prePassRenderer._setRenderTarget(e._prePassRenderTarget), this.scene.prePassRenderer._clear());
  }
  _beforeCameraDraw(e) {
    this.scene.prePassRenderer && (this.scene.prePassRenderer._setRenderTarget(null), this.scene.prePassRenderer._beforeDraw(e));
  }
  _afterCameraDraw() {
    this.scene.prePassRenderer && this.scene.prePassRenderer._afterDraw();
  }
  _beforeClearStage() {
    this.scene.prePassRenderer && (this.scene.prePassRenderer._setRenderTarget(null), this.scene.prePassRenderer._clear());
  }
  _beforeRenderingMeshStage(e, t, r, n) {
    if (!n)
      return;
    const i = e.getScene();
    i.prePassRenderer && i.prePassRenderer.bindAttachmentsForEffect(n, t);
  }
  _afterRenderingMeshStage(e) {
    const t = e.getScene();
    t.prePassRenderer && t.prePassRenderer.restoreAttachments();
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
    this.scene.disablePrePassRenderer(), this.scene.enablePrePassRenderer();
  }
  /**
   * Disposes the component and the associated resources
   */
  dispose() {
    this.scene.disablePrePassRenderer();
  }
}
mA._SceneComponentInitialization = (A) => {
  let e = A._getComponent(Ot.NAME_PREPASSRENDERER);
  e || (e = new Aie(A), A._addComponent(e));
};
const uHe = "fibonacci", lHe = `#define rcp(x) 1./x
#define GOLDEN_RATIO 1.618033988749895
#define TWO_PI 6.2831855
vec2 Golden2dSeq(int i,float n)
{return vec2(float(i)/n+(0.5/n),fract(float(i)*rcp(GOLDEN_RATIO)));}
vec2 SampleDiskGolden(int i,int sampleCount)
{vec2 f=Golden2dSeq(i,float(sampleCount));return vec2(sqrt(f.x),TWO_PI*f.y);}`;
Le.IncludesShadersStore[uHe] = lHe;
const PHe = "diffusionProfile", cHe = "uniform vec3 diffusionS[5];uniform float diffusionD[5];uniform float filterRadii[5];";
Le.IncludesShadersStore[PHe] = cHe;
const pHe = "subSurfaceScatteringPixelShader", hHe = `#include<fibonacci>
#include<helperFunctions>
#include<subSurfaceScatteringFunctions>
#include<diffusionProfile>
varying vec2 vUV;uniform vec2 texelSize;uniform sampler2D textureSampler;uniform sampler2D irradianceSampler;uniform sampler2D depthSampler;uniform sampler2D albedoSampler;uniform vec2 viewportSize;uniform float metersPerUnit;const float LOG2_E=1.4426950408889634;const float SSS_PIXELS_PER_SAMPLE=4.;const int _SssSampleBudget=40;
#define rcp(x) 1./x
#define Sq(x) x*x
#define SSS_BILATERAL_FILTER true
vec3 EvalBurleyDiffusionProfile(float r,vec3 S)
{vec3 exp_13=exp2(((LOG2_E*(-1.0/3.0))*r)*S); 
vec3 expSum=exp_13*(1.+exp_13*exp_13); 
return (S*rcp(8.*PI))*expSum; }
vec2 SampleBurleyDiffusionProfile(float u,float rcpS)
{u=1.-u; 
float g=1.+(4.*u)*(2.*u+sqrt(1.+(4.*u)*u));float n=exp2(log2(g)*(-1.0/3.0)); 
float p=(g*n)*n; 
float c=1.+p+n; 
float d=(3./LOG2_E*2.)+(3./LOG2_E)*log2(u); 
float x=(3./LOG2_E)*log2(c)-d; 
float rcpExp=((c*c)*c)*rcp((4.*u)*((c*c)+(4.*u)*(4.*u)));float r=x*rcpS;float rcpPdf=(8.*PI*rcpS)*rcpExp; 
return vec2(r,rcpPdf);}
vec3 ComputeBilateralWeight(float xy2,float z,float mmPerUnit,vec3 S,float rcpPdf)
{
#ifndef SSS_BILATERAL_FILTER
z=0.;
#endif
float r=sqrt(xy2+(z*mmPerUnit)*(z*mmPerUnit));float area=rcpPdf;
#if SSS_CLAMP_ARTIFACT
return clamp(EvalBurleyDiffusionProfile(r,S)*area,0.0,1.0);
#else
return EvalBurleyDiffusionProfile(r,S)*area;
#endif
}
void EvaluateSample(int i,int n,vec3 S,float d,vec3 centerPosVS,float mmPerUnit,float pixelsPerMm,
float phase,inout vec3 totalIrradiance,inout vec3 totalWeight)
{float scale =rcp(float(n));float offset=rcp(float(n))*0.5;float sinPhase,cosPhase;sinPhase=sin(phase);cosPhase=cos(phase);vec2 bdp=SampleBurleyDiffusionProfile(float(i)*scale+offset,d);float r=bdp.x;float rcpPdf=bdp.y;float phi=SampleDiskGolden(i,n).y;float sinPhi,cosPhi;sinPhi=sin(phi);cosPhi=cos(phi);float sinPsi=cosPhase*sinPhi+sinPhase*cosPhi; 
float cosPsi=cosPhase*cosPhi-sinPhase*sinPhi; 
vec2 vec=r*vec2(cosPsi,sinPsi);vec2 position; 
float xy2;position=vUV+round((pixelsPerMm*r)*vec2(cosPsi,sinPsi))*texelSize;xy2 =r*r;vec4 textureSample=texture2D(irradianceSampler,position);float viewZ=texture2D(depthSampler,position).r;vec3 irradiance =textureSample.rgb;if (testLightingForSSS(textureSample.a))
{float relZ=viewZ-centerPosVS.z;vec3 weight=ComputeBilateralWeight(xy2,relZ,mmPerUnit,S,rcpPdf);totalIrradiance+=weight*irradiance;totalWeight +=weight;}
else
{}}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{vec4 irradianceAndDiffusionProfile =texture2D(irradianceSampler,vUV);vec3 centerIrradiance=irradianceAndDiffusionProfile.rgb;int diffusionProfileIndex=int(round(irradianceAndDiffusionProfile.a*255.));float centerDepth =0.;vec4 inputColor=texture2D(textureSampler,vUV);bool passedStencilTest=testLightingForSSS(irradianceAndDiffusionProfile.a);if (passedStencilTest)
{centerDepth=texture2D(depthSampler,vUV).r;}
if (!passedStencilTest) { 
gl_FragColor=inputColor;return;}
float distScale =1.;vec3 S =diffusionS[diffusionProfileIndex];float d =diffusionD[diffusionProfileIndex];float filterRadius=filterRadii[diffusionProfileIndex];vec2 centerPosNDC=vUV;vec2 cornerPosNDC=vUV+0.5*texelSize;vec3 centerPosVS =vec3(centerPosNDC*viewportSize,1.0)*centerDepth; 
vec3 cornerPosVS =vec3(cornerPosNDC*viewportSize,1.0)*centerDepth; 
float mmPerUnit =1000.*(metersPerUnit*rcp(distScale));float unitsPerMm=rcp(mmPerUnit);float unitsPerPixel=2.*abs(cornerPosVS.x-centerPosVS.x);float pixelsPerMm =rcp(unitsPerPixel)*unitsPerMm;float filterArea =PI*Sq(filterRadius*pixelsPerMm);int sampleCount =int(filterArea*rcp(SSS_PIXELS_PER_SAMPLE));int sampleBudget=_SssSampleBudget;int texturingMode=0;vec3 albedo =texture2D(albedoSampler,vUV).rgb;if (distScale==0. || sampleCount<1)
{
#ifdef DEBUG_SSS_SAMPLES
vec3 green=vec3(0.,1.,0.);gl_FragColor=vec4(green,1.0);return;
#endif
gl_FragColor=vec4(inputColor.rgb+albedo*centerIrradiance,1.0);return;}
#ifdef DEBUG_SSS_SAMPLES
vec3 red =vec3(1.,0.,0.);vec3 blue=vec3(0.,0.,1.);gl_FragColor=vec4(mix(blue,red,clamp(float(sampleCount)/float(sampleBudget),0.0,1.0)),1.0);return;
#endif
float phase=0.;int n=min(sampleCount,sampleBudget);vec3 centerWeight =vec3(0.); 
vec3 totalIrradiance=vec3(0.);vec3 totalWeight =vec3(0.);for (int i=0; i<n; i++)
{EvaluateSample(i,n,S,d,centerPosVS,mmPerUnit,pixelsPerMm,
phase,totalIrradiance,totalWeight);}
totalWeight=max(totalWeight,HALF_MIN);gl_FragColor=vec4(inputColor.rgb+albedo*max(totalIrradiance/totalWeight,vec3(0.0)),1.);}`;
Le.ShadersStore[pHe] = hHe;
class HHe extends kr {
  /**
   * Gets a string identifying the name of the class
   * @returns "SubSurfaceScatteringPostProcess" string
   */
  getClassName() {
    return "SubSurfaceScatteringPostProcess";
  }
  constructor(e, t, r, n = null, i, s, a, f = 0) {
    super(e, "subSurfaceScattering", ["texelSize", "viewportSize", "metersPerUnit"], ["diffusionS", "diffusionD", "filterRadii", "irradianceSampler", "depthSampler", "albedoSampler"], r, n, i || We.BILINEAR_SAMPLINGMODE, s, a, null, f, "postprocess", void 0, !0), this._scene = t, this.updateEffect(), this.onApplyObservable.add((o) => {
      if (!t.prePassRenderer || !t.subSurfaceConfiguration) {
        Se.Error("PrePass and subsurface configuration needs to be enabled for subsurface scattering.");
        return;
      }
      const d = this.texelSize;
      o.setFloat("metersPerUnit", t.subSurfaceConfiguration.metersPerUnit), o.setFloat2("texelSize", d.x, d.y), o.setTexture("irradianceSampler", t.prePassRenderer.getRenderTarget().textures[t.prePassRenderer.getIndex(0)]), o.setTexture("depthSampler", t.prePassRenderer.getRenderTarget().textures[t.prePassRenderer.getIndex(5)]), o.setTexture("albedoSampler", t.prePassRenderer.getRenderTarget().textures[t.prePassRenderer.getIndex(7)]), o.setFloat2("viewportSize", Math.tan(t.activeCamera.fov / 2) * t.getEngine().getAspectRatio(t.activeCamera, !0), Math.tan(t.activeCamera.fov / 2)), o.setArray3("diffusionS", t.subSurfaceConfiguration.ssDiffusionS), o.setArray("diffusionD", t.subSurfaceConfiguration.ssDiffusionD), o.setArray("filterRadii", t.subSurfaceConfiguration.ssFilterRadii);
    });
  }
}
class lV {
  /**
   * Diffusion profile color for subsurface scattering
   */
  get ssDiffusionS() {
    return this._ssDiffusionS;
  }
  /**
   * Diffusion profile max color channel value for subsurface scattering
   */
  get ssDiffusionD() {
    return this._ssDiffusionD;
  }
  /**
   * Diffusion profile filter radius for subsurface scattering
   */
  get ssFilterRadii() {
    return this._ssFilterRadii;
  }
  /**
   * Builds a subsurface configuration object
   * @param scene The scene
   */
  constructor(e) {
    this._ssDiffusionS = [], this._ssFilterRadii = [], this._ssDiffusionD = [], this.enabled = !1, this.needsImageProcessing = !0, this.name = Ot.NAME_SUBSURFACE, this.ssDiffusionProfileColors = [], this.metersPerUnit = 1, this.texturesRequired = [
      5,
      7,
      4,
      0
    ], this.addDiffusionProfile(new Ne(1, 1, 1)), this._scene = e, lV._SceneComponentInitialization(this._scene);
  }
  /**
   * Adds a new diffusion profile.
   * Useful for more realistic subsurface scattering on diverse materials.
   * @param color The color of the diffusion profile. Should be the average color of the material.
   * @returns The index of the diffusion profile for the material subsurface configuration
   */
  addDiffusionProfile(e) {
    if (this.ssDiffusionD.length >= 5)
      return Se.Error("You already reached the maximum number of diffusion profiles."), 0;
    for (let t = 0; t < this._ssDiffusionS.length / 3; t++)
      if (this._ssDiffusionS[t * 3] === e.r && this._ssDiffusionS[t * 3 + 1] === e.g && this._ssDiffusionS[t * 3 + 2] === e.b)
        return t;
    return this._ssDiffusionS.push(e.r, e.b, e.g), this._ssDiffusionD.push(Math.max(Math.max(e.r, e.b), e.g)), this._ssFilterRadii.push(this.getDiffusionProfileParameters(e)), this.ssDiffusionProfileColors.push(e), this._ssDiffusionD.length - 1;
  }
  /**
   * Creates the sss post process
   * @returns The created post process
   */
  createPostProcess() {
    return this.postProcess = new HHe("subSurfaceScattering", this._scene, 1, null, void 0, this._scene.getEngine()), this.postProcess.autoClear = !1, this.postProcess;
  }
  /**
   * Deletes all diffusion profiles.
   * Note that in order to render subsurface scattering, you should have at least 1 diffusion profile.
   */
  clearAllDiffusionProfiles() {
    this._ssDiffusionD = [], this._ssDiffusionS = [], this._ssFilterRadii = [], this.ssDiffusionProfileColors = [];
  }
  /**
   * Disposes this object
   */
  dispose() {
    this.clearAllDiffusionProfiles(), this.postProcess && this.postProcess.dispose();
  }
  /**
   * @internal
   * https://zero-radiance.github.io/post/sampling-diffusion/
   *
   * Importance sample the normalized diffuse reflectance profile for the computed value of 's'.
   * ------------------------------------------------------------------------------------
   * R[r, phi, s]   = s * (Exp[-r * s] + Exp[-r * s / 3]) / (8 * Pi * r)
   * PDF[r, phi, s] = r * R[r, phi, s]
   * CDF[r, s]      = 1 - 1/4 * Exp[-r * s] - 3/4 * Exp[-r * s / 3]
   * ------------------------------------------------------------------------------------
   * We importance sample the color channel with the widest scattering distance.
   */
  getDiffusionProfileParameters(e) {
    const r = Math.max(e.r, e.g, e.b);
    return this._sampleBurleyDiffusionProfile(0.997, r);
  }
  /**
   * Performs sampling of a Normalized Burley diffusion profile in polar coordinates.
   * 'u' is the random number (the value of the CDF): [0, 1).
   * rcp(s) = 1 / ShapeParam = ScatteringDistance.
   * Returns the sampled radial distance, s.t. (u = 0 -> r = 0) and (u = 1 -> r = Inf).
   * @param u
   * @param rcpS
   */
  _sampleBurleyDiffusionProfile(e, t) {
    e = 1 - e;
    const r = 1 + 4 * e * (2 * e + Math.sqrt(1 + 4 * e * e)), n = Math.pow(r, -1 / 3), s = 1 + r * n * n + n;
    return 3 * Math.log(s / (4 * e)) * t;
  }
}
lV._SceneComponentInitialization = (A) => {
  throw qn("SubSurfaceSceneComponent");
};
J1.AddParser(Ot.NAME_SUBSURFACE, (A, e) => {
  if (A.ssDiffusionProfileColors !== void 0 && A.ssDiffusionProfileColors !== null && (e.enableSubSurfaceForPrePass(), e.subSurfaceConfiguration))
    for (let t = 0, r = A.ssDiffusionProfileColors.length; t < r; t++) {
      const n = A.ssDiffusionProfileColors[t];
      e.subSurfaceConfiguration.addDiffusionProfile(new Ne(n.r, n.g, n.b));
    }
});
Object.defineProperty(sr.prototype, "subSurfaceConfiguration", {
  get: function() {
    return this._subSurfaceConfiguration;
  },
  set: function(A) {
    A && this.enablePrePassRenderer() && (this._subSurfaceConfiguration = A);
  },
  enumerable: !0,
  configurable: !0
});
sr.prototype.enableSubSurfaceForPrePass = function() {
  if (this._subSurfaceConfiguration)
    return this._subSurfaceConfiguration;
  const A = this.enablePrePassRenderer();
  return A ? (this._subSurfaceConfiguration = new lV(this), A.addEffectConfiguration(this._subSurfaceConfiguration), this._subSurfaceConfiguration) : null;
};
sr.prototype.disableSubSurfaceForPrePass = function() {
  this._subSurfaceConfiguration && (this._subSurfaceConfiguration.dispose(), this._subSurfaceConfiguration = null);
};
class die {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_PREPASSRENDERER, this.scene = e;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
  }
  /**
   * Serializes the component data to the specified json object
   * @param serializationObject The object to serialize to
   */
  serialize(e) {
    if (!this.scene.subSurfaceConfiguration)
      return;
    const t = this.scene.subSurfaceConfiguration.ssDiffusionProfileColors;
    e.ssDiffusionProfileColors = [];
    for (let r = 0; r < t.length; r++)
      e.ssDiffusionProfileColors.push({
        r: t[r].r,
        g: t[r].g,
        b: t[r].b
      });
  }
  /**
   * Adds all the elements from the container to the scene
   */
  addFromContainer() {
  }
  /**
   * Removes all the elements in the container from the scene
   */
  removeFromContainer() {
    this.scene.prePassRenderer && this.scene.subSurfaceConfiguration && this.scene.subSurfaceConfiguration.clearAllDiffusionProfiles();
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources
   */
  dispose() {
  }
}
lV._SceneComponentInitialization = (A) => {
  let e = A._getComponent(Ot.NAME_SUBSURFACE);
  e || (e = new die(A), A._addComponent(e));
};
const gHe = "outlinePixelShader", XHe = `#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
uniform vec4 color;
#ifdef ALPHATEST
varying vec2 vUV;uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
#endif
#include<logDepthFragment>
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[gHe] = XHe;
const THe = "outlineVertexShader", qHe = `attribute vec3 position;attribute vec3 normal;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
uniform float offset;
#include<instancesDeclaration>
uniform mat4 viewProjection;
#ifdef ALPHATEST
varying vec2 vUV;uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;vec3 normalUpdated=normal;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
vec3 offsetPosition=positionUpdated+(normalUpdated*offset);
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(offsetPosition,1.0);gl_Position=viewProjection*worldPos;
#ifdef ALPHATEST
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
}
`;
Le.ShadersStore[THe] = qHe;
sr.prototype.getOutlineRenderer = function() {
  return this._outlineRenderer || (this._outlineRenderer = new MS(this)), this._outlineRenderer;
};
Object.defineProperty(Ee.prototype, "renderOutline", {
  get: function() {
    return this._renderOutline;
  },
  set: function(A) {
    A && this.getScene().getOutlineRenderer(), this._renderOutline = A;
  },
  enumerable: !0,
  configurable: !0
});
Object.defineProperty(Ee.prototype, "renderOverlay", {
  get: function() {
    return this._renderOverlay;
  },
  set: function(A) {
    A && this.getScene().getOutlineRenderer(), this._renderOverlay = A;
  },
  enumerable: !0,
  configurable: !0
});
class MS {
  /**
   * Instantiates a new outline renderer. (There could be only one per scene).
   * @param scene Defines the scene it belongs to
   */
  constructor(e) {
    this.name = Ot.NAME_OUTLINERENDERER, this.zOffset = 1, this.zOffsetUnits = 4, this.scene = e, this._engine = e.getEngine(), this.scene._addComponent(this), this._passIdForDrawWrapper = [];
    for (let t = 0; t < 4; ++t)
      this._passIdForDrawWrapper[t] = this._engine.createRenderPassId(`Outline Renderer (${t})`);
  }
  /**
   * Register the component to one instance of a scene.
   */
  register() {
    this.scene._beforeRenderingMeshStage.registerStep(Ot.STEP_BEFORERENDERINGMESH_OUTLINE, this, this._beforeRenderingMesh), this.scene._afterRenderingMeshStage.registerStep(Ot.STEP_AFTERRENDERINGMESH_OUTLINE, this, this._afterRenderingMesh);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources.
   */
  dispose() {
    for (let e = 0; e < this._passIdForDrawWrapper.length; ++e)
      this._engine.releaseRenderPassId(this._passIdForDrawWrapper[e]);
  }
  /**
   * Renders the outline in the canvas.
   * @param subMesh Defines the sumesh to render
   * @param batch Defines the batch of meshes in case of instances
   * @param useOverlay Defines if the rendering is for the overlay or the outline
   * @param renderPassId Render pass id to use to render the mesh
   */
  render(e, t, r = !1, n) {
    n = n ?? this._passIdForDrawWrapper[0];
    const i = this.scene, s = i.getEngine(), a = s.getCaps().instancedArrays && (t.visibleInstances[e._id] !== null && t.visibleInstances[e._id] !== void 0 || e.getRenderingMesh().hasThinInstances);
    if (!this.isReady(e, a, n))
      return;
    const f = e.getMesh(), o = f._internalAbstractMeshDataInfo._actAsRegularMesh ? f : null, d = e.getRenderingMesh(), v = o || d, u = e.getMaterial();
    if (!u || !i.activeCamera)
      return;
    const l = e._getDrawWrapper(n), P = zo.GetEffect(l);
    if (s.enableEffect(l), u.useLogarithmicDepth && P.setFloat("logarithmicDepthConstant", 2 / (Math.log(i.activeCamera.maxZ + 1) / Math.LN2)), P.setFloat("offset", r ? 0 : d.outlineWidth), P.setColor4("color", r ? d.overlayColor : d.outlineColor, r ? d.overlayAlpha : u.alpha), P.setMatrix("viewProjection", i.getTransformMatrix()), P.setMatrix("world", v.getWorldMatrix()), d.useBones && d.computeBonesUsingShaders && d.skeleton && P.setMatrices("mBones", d.skeleton.getTransformMatrices(d)), d.morphTargetManager && d.morphTargetManager.isUsingTextureForTargets && d.morphTargetManager._bind(P), Ye.BindMorphTargetParameters(d, P), a || d._bind(e, P, u.fillMode), u && u.needAlphaTesting()) {
      const p = u.getAlphaTestTexture();
      p && (P.setTexture("diffuseSampler", p), P.setMatrix("diffuseMatrix", p.getTextureMatrix()));
    }
    Df(P, u, i), s.setZOffset(-this.zOffset), s.setZOffsetUnits(-this.zOffsetUnits), d._processRendering(v, e, P, u.fillMode, t, a, (p, c) => {
      P.setMatrix("world", c);
    }), s.setZOffset(0), s.setZOffsetUnits(0);
  }
  /**
   * Returns whether or not the outline renderer is ready for a given submesh.
   * All the dependencies e.g. submeshes, texture, effect... mus be ready
   * @param subMesh Defines the submesh to check readiness for
   * @param useInstances Defines whether wee are trying to render instances or not
   * @param renderPassId Render pass id to use to render the mesh
   * @returns true if ready otherwise false
   */
  isReady(e, t, r) {
    r = r ?? this._passIdForDrawWrapper[0];
    const n = [], i = [J.PositionKind, J.NormalKind], s = e.getMesh(), a = e.getMaterial();
    if (!a)
      return !1;
    const f = s.getScene();
    a.needAlphaTesting() && (n.push("#define ALPHATEST"), s.isVerticesDataPresent(J.UVKind) && (i.push(J.UVKind), n.push("#define UV1")), s.isVerticesDataPresent(J.UV2Kind) && (i.push(J.UV2Kind), n.push("#define UV2"))), a.useLogarithmicDepth && n.push("#define LOGARITHMICDEPTH"), xq(a, f, n), s.useBones && s.computeBonesUsingShaders ? (i.push(J.MatricesIndicesKind), i.push(J.MatricesWeightsKind), s.numBoneInfluencers > 4 && (i.push(J.MatricesIndicesExtraKind), i.push(J.MatricesWeightsExtraKind)), n.push("#define NUM_BONE_INFLUENCERS " + s.numBoneInfluencers), n.push("#define BonesPerMesh " + (s.skeleton ? s.skeleton.bones.length + 1 : 0))) : n.push("#define NUM_BONE_INFLUENCERS 0");
    const o = s.morphTargetManager;
    let d = 0;
    o && o.numInfluencers > 0 && (d = o.numInfluencers, n.push("#define MORPHTARGETS"), n.push("#define NUM_MORPH_INFLUENCERS " + d), o.isUsingTextureForTargets && n.push("#define MORPHTARGETS_TEXTURE"), Ye.PrepareAttributesForMorphTargetsInfluencers(i, s, d)), t && (n.push("#define INSTANCES"), Ye.PushAttributesForInstances(i), e.getRenderingMesh().hasThinInstances && n.push("#define THIN_INSTANCES"));
    const v = e._getDrawWrapper(r, !0), u = v.defines, l = n.join(`
`);
    if (u !== l) {
      const P = [
        "world",
        "mBones",
        "viewProjection",
        "diffuseMatrix",
        "offset",
        "color",
        "logarithmicDepthConstant",
        "morphTargetInfluences",
        "morphTargetTextureInfo",
        "morphTargetTextureIndices"
      ];
      Mf(P), v.setEffect(this.scene.getEngine().createEffect("outline", i, P, ["diffuseSampler", "morphTargets"], l, void 0, void 0, void 0, {
        maxSimultaneousMorphTargets: d
      }), l);
    }
    return v.effect.isReady();
  }
  _beforeRenderingMesh(e, t, r) {
    if (this._savedDepthWrite = this._engine.getDepthWrite(), e.renderOutline) {
      const n = t.getMaterial();
      n && n.needAlphaBlendingForMesh(e) && (this._engine.cacheStencilState(), this._engine.setDepthWrite(!1), this._engine.setColorWrite(!1), this._engine.setStencilBuffer(!0), this._engine.setStencilOperationPass(7681), this._engine.setStencilFunction(519), this._engine.setStencilMask(MS._StencilReference), this._engine.setStencilFunctionReference(MS._StencilReference), this._engine.stencilStateComposer.useStencilGlobalOnly = !0, this.render(
        t,
        r,
        /* This sets offset to 0 */
        !0,
        this._passIdForDrawWrapper[1]
      ), this._engine.setColorWrite(!0), this._engine.setStencilFunction(517)), this._engine.setDepthWrite(!1), this.render(t, r, !1, this._passIdForDrawWrapper[0]), this._engine.setDepthWrite(this._savedDepthWrite), n && n.needAlphaBlendingForMesh(e) && (this._engine.stencilStateComposer.useStencilGlobalOnly = !1, this._engine.restoreStencilState());
    }
  }
  _afterRenderingMesh(e, t, r) {
    if (e.renderOverlay) {
      const n = this._engine.getAlphaMode(), i = this._engine.alphaState.alphaBlend;
      this._engine.setAlphaMode(2), this.render(t, r, !0, this._passIdForDrawWrapper[3]), this._engine.setAlphaMode(n), this._engine.setDepthWrite(this._savedDepthWrite), this._engine.alphaState.alphaBlend = i;
    }
    e.renderOutline && this._savedDepthWrite && (this._engine.setDepthWrite(!0), this._engine.setColorWrite(!1), this.render(t, r, !1, this._passIdForDrawWrapper[2]), this._engine.setColorWrite(!0));
  }
}
MS._StencilReference = 4;
class LY {
  /** Gets or sets the size of the particle */
  get particleSize() {
    return this._particleSize;
  }
  set particleSize(e) {
    e !== this._particleSize && (this._particleSize = e, this.onParticleSizeChanged.notifyObservers(this));
  }
  /** Indicates if the object uses instancing or not */
  get useInstancing() {
    return !this.indexBuffer;
  }
  /** Indicates if velocity of particles should be used when rendering the object. The vertex buffer set must contain a "velocity" buffer for this to work! */
  get useVelocity() {
    return this._useVelocity;
  }
  set useVelocity(e) {
    this._useVelocity === e || !this._hasVelocity() || (this._useVelocity = e, this._effectsAreDirty = !0);
  }
  _hasVelocity() {
    var e;
    return !!(!((e = this.vertexBuffers) === null || e === void 0) && e.velocity);
  }
  /**
   * Gets the index buffer (or null if the object is using instancing)
   */
  get indexBuffer() {
    return null;
  }
  /**
   * Gets the name of the class
   */
  getClassName() {
    return "FluidRenderingObject";
  }
  /**
   * Instantiates a fluid rendering object
   * @param scene The scene the object is part of
   */
  constructor(e) {
    this.priority = 0, this._particleSize = 0.1, this.onParticleSizeChanged = new Oe(), this.particleThicknessAlpha = 0.05, this._useVelocity = !1, this._scene = e, this._engine = e.getEngine(), this._effectsAreDirty = !0, this._depthEffectWrapper = null, this._thicknessEffectWrapper = null;
  }
  _createEffects() {
    const e = ["view", "projection", "particleRadius", "size"], t = ["position", "offset"], r = [];
    this._effectsAreDirty = !1, this.useVelocity && (t.push("velocity"), r.push("#define FLUIDRENDERING_VELOCITY")), this._scene.useRightHandedSystem && r.push("#define FLUIDRENDERING_RHS"), this._depthEffectWrapper = new ng({
      engine: this._engine,
      useShaderStore: !0,
      vertexShader: "fluidRenderingParticleDepth",
      fragmentShader: "fluidRenderingParticleDepth",
      attributeNames: t,
      uniformNames: e,
      samplerNames: [],
      defines: r
    }), e.push("particleAlpha"), this._thicknessEffectWrapper = new ng({
      engine: this._engine,
      useShaderStore: !0,
      vertexShader: "fluidRenderingParticleThickness",
      fragmentShader: "fluidRenderingParticleThickness",
      attributeNames: ["position", "offset"],
      uniformNames: e,
      samplerNames: []
    });
  }
  /**
   * Indicates if the object is ready to be rendered
   * @returns True if everything is ready for the object to be rendered, otherwise false
   */
  isReady() {
    if (this._effectsAreDirty && this._createEffects(), !this._depthEffectWrapper || !this._thicknessEffectWrapper)
      return !1;
    const e = this._depthEffectWrapper._drawWrapper.effect, t = this._thicknessEffectWrapper._drawWrapper.effect;
    return e.isReady() && t.isReady();
  }
  /**
   * Render the depth texture for this object
   */
  renderDepthTexture() {
    const e = this.numParticles;
    if (!this._depthEffectWrapper || e === 0)
      return;
    const t = this._depthEffectWrapper._drawWrapper, r = t.effect;
    this._engine.enableEffect(t), this._engine.bindBuffers(this.vertexBuffers, this.indexBuffer, r), r.setMatrix("view", this._scene.getViewMatrix()), r.setMatrix("projection", this._scene.getProjectionMatrix()), r.setFloat2("size", this._particleSize, this._particleSize), r.setFloat("particleRadius", this._particleSize / 2), this.useInstancing ? this._engine.drawArraysType(7, 0, 4, e) : this._engine.drawElementsType(0, 0, e);
  }
  /**
   * Render the thickness texture for this object
   */
  renderThicknessTexture() {
    const e = this.numParticles;
    if (!this._thicknessEffectWrapper || e === 0)
      return;
    const t = this._thicknessEffectWrapper._drawWrapper, r = t.effect;
    this._engine.setAlphaMode(6), this._engine.setDepthWrite(!1), this._engine.enableEffect(t), this._engine.bindBuffers(this.vertexBuffers, this.indexBuffer, r), r.setMatrix("view", this._scene.getViewMatrix()), r.setMatrix("projection", this._scene.getProjectionMatrix()), r.setFloat("particleAlpha", this.particleThicknessAlpha), r.setFloat2("size", this._particleSize, this._particleSize), this.useInstancing ? this._engine.drawArraysType(7, 0, 4, e) : this._engine.drawElementsType(0, 0, e), this._engine.setDepthWrite(!0), this._engine.setAlphaMode(0);
  }
  /**
   * Render the diffuse texture for this object
   */
  renderDiffuseTexture() {
  }
  /**
   * Releases the ressources used by the class
   */
  dispose() {
    var e, t;
    (e = this._depthEffectWrapper) === null || e === void 0 || e.dispose(), (t = this._thicknessEffectWrapper) === null || t === void 0 || t.dispose();
  }
}
class vie extends LY {
  /** Gets the particle system */
  get particleSystem() {
    return this._particleSystem;
  }
  /**
   * Gets the name of the class
   */
  getClassName() {
    return "FluidRenderingObjectParticleSystem";
  }
  /**
   * Gets or sets a boolean indicating that the diffuse texture should be generated based on the regular rendering of the particle system (default: true).
   * Sometimes, generating the diffuse texture this way may be sub-optimal. In that case, you can disable this property, in which case the particle system will be
   * rendered using a ALPHA_COMBINE mode instead of the one used by the particle system.
   */
  get useTrueRenderingForDiffuseTexture() {
    return this._useTrueRenderingForDiffuseTexture;
  }
  set useTrueRenderingForDiffuseTexture(e) {
    this._useTrueRenderingForDiffuseTexture !== e && (this._useTrueRenderingForDiffuseTexture = e, e ? (this._particleSystem.blendMode = this._blendMode, this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver), this._onBeforeDrawParticleObserver = null) : (this._particleSystem.blendMode = -1, this._onBeforeDrawParticleObserver = this._particleSystem.onBeforeDrawParticlesObservable.add(() => {
      this._engine.setAlphaMode(2);
    })));
  }
  /**
   * Gets the vertex buffers
   */
  get vertexBuffers() {
    return this._particleSystem.vertexBuffers;
  }
  /**
   * Gets the index buffer (or null if the object is using instancing)
   */
  get indexBuffer() {
    return this._particleSystem.indexBuffer;
  }
  /**
   * Creates a new instance of the class
   * @param scene The scene the particle system is part of
   * @param ps The particle system
   */
  constructor(e, t) {
    super(e), this._useTrueRenderingForDiffuseTexture = !0, this._particleSystem = t, this._originalRender = t.render.bind(t), this._blendMode = t.blendMode, this._onBeforeDrawParticleObserver = null, this._updateInAnimate = this._particleSystem.updateInAnimate, this._particleSystem.updateInAnimate = !0, this._particleSystem.render = () => 0, this.particleSize = (t.minSize + t.maxSize) / 2, this.useTrueRenderingForDiffuseTexture = !1;
  }
  /**
   * Indicates if the object is ready to be rendered
   * @returns True if everything is ready for the object to be rendered, otherwise false
   */
  isReady() {
    return super.isReady() && this._particleSystem.isReady();
  }
  /**
   * Gets the number of particles in this particle system
   * @returns The number of particles
   */
  get numParticles() {
    return this._particleSystem.getActiveCount();
  }
  /**
   * Render the diffuse texture for this object
   */
  renderDiffuseTexture() {
    this._originalRender();
  }
  /**
   * Releases the ressources used by the class
   */
  dispose() {
    super.dispose(), this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver), this._onBeforeDrawParticleObserver = null, this._particleSystem.render = this._originalRender, this._particleSystem.blendMode = this._blendMode, this._particleSystem.updateInAnimate = this._updateInAnimate;
  }
}
class IE {
  get blurNumIterations() {
    return this._blurNumIterations;
  }
  set blurNumIterations(e) {
    if (this._blurNumIterations !== e && (this._blurNumIterations = e, this._blurPostProcesses !== null)) {
      const t = this._blurPostProcesses[0], r = this._blurPostProcesses[1];
      this._blurPostProcesses = [];
      for (let n = 0; n < this._blurNumIterations * 2; ++n)
        this._blurPostProcesses[n] = n & 1 ? r : t;
    }
  }
  get renderTarget() {
    return this._rt;
  }
  get renderTargetBlur() {
    return this._rtBlur;
  }
  get texture() {
    return this._texture;
  }
  get textureBlur() {
    return this._textureBlurred;
  }
  constructor(e, t, r, n, i, s, a = 1, f = 6, o = 1, d = 6, v = !1, u = null, l = !0, P = 1) {
    this.enableBlur = !0, this.blurSizeDivisor = 1, this.blurFilterSize = 7, this._blurNumIterations = 3, this.blurMaxFilterSize = 100, this.blurDepthScale = 10, this.particleSize = 0.02, this.onDisposeObservable = new Oe(), this._name = e, this._scene = t, this._camera = u, this._engine = t.getEngine(), this._width = r, this._height = n, this._blurTextureSizeX = i, this._blurTextureSizeY = s, this._textureType = a, this._textureFormat = f, this._blurTextureType = o, this._blurTextureFormat = d, this._useStandardBlur = v, this._generateDepthBuffer = l, this._samples = P, this._postProcessRunningIndex = 0, this.enableBlur = i !== 0 && s !== 0, this._rt = null, this._texture = null, this._rtBlur = null, this._textureBlurred = null, this._blurPostProcesses = null;
  }
  initialize() {
    if (this.dispose(), this._createRenderTarget(), this.enableBlur && this._texture) {
      const [e, t, r] = this._createBlurPostProcesses(this._texture, this._blurTextureType, this._blurTextureFormat, this.blurSizeDivisor, this._name, this._useStandardBlur);
      this._rtBlur = e, this._textureBlurred = t, this._blurPostProcesses = r;
    }
  }
  applyBlurPostProcesses() {
    this.enableBlur && this._blurPostProcesses && (this._postProcessRunningIndex = 0, this._scene.postProcessManager.directRender(this._blurPostProcesses, this._rtBlur, !0), this._engine.unBindFramebuffer(this._rtBlur));
  }
  _createRenderTarget() {
    this._rt = this._engine.createRenderTargetTexture({ width: this._width, height: this._height }, {
      generateMipMaps: !1,
      type: this._textureType,
      format: this._textureFormat,
      samplingMode: 1,
      generateDepthBuffer: this._generateDepthBuffer,
      generateStencilBuffer: !1,
      samples: this._samples,
      label: `FluidRenderingRTT-${this._name}`
    });
    const e = this._rt.texture;
    e.incrementReferences(), this._texture = new We(null, this._scene), this._texture.name = "rtt" + this._name, this._texture._texture = e, this._texture.wrapU = We.CLAMP_ADDRESSMODE, this._texture.wrapV = We.CLAMP_ADDRESSMODE, this._texture.anisotropicFilteringLevel = 1;
  }
  _createBlurPostProcesses(e, t, r, n, i, s = !1) {
    const a = this._scene.getEngine(), f = new at(Math.floor(this._blurTextureSizeX / n), Math.floor(this._blurTextureSizeY / n)), o = t === 1 && a.getCaps().textureFloatLinearFiltering || t === 2 && a.getCaps().textureHalfFloatLinearFiltering, d = this._engine.createRenderTargetTexture({ width: f.x, height: f.y }, {
      generateMipMaps: !1,
      type: t,
      format: r,
      samplingMode: o ? 2 : 1,
      generateDepthBuffer: !1,
      generateStencilBuffer: !1,
      samples: this._samples,
      label: `FluidRenderingRTTBlur-${i}`
    }), v = d.texture;
    v.incrementReferences();
    const u = new We(null, this._scene);
    if (u.name = "rttBlurred" + i, u._texture = v, u.wrapU = We.CLAMP_ADDRESSMODE, u.wrapV = We.CLAMP_ADDRESSMODE, u.anisotropicFilteringLevel = 1, s) {
      const l = new kr("BilateralBlurX", "fluidRenderingStandardBlur", ["filterSize", "blurDir"], null, 1, null, 1, a, !0, null, t, void 0, void 0, void 0, r);
      l.samples = this._samples, l.externalTextureSamplerBinding = !0, l.onApplyObservable.add((c) => {
        this._postProcessRunningIndex === 0 ? c.setTexture("textureSampler", e) : c._bindTexture("textureSampler", l.inputTexture.texture), c.setInt("filterSize", this.blurFilterSize), c.setFloat2("blurDir", 1 / this._blurTextureSizeX, 0), this._postProcessRunningIndex++;
      }), l.onSizeChangedObservable.add(() => {
        l._textures.forEach((c) => {
          c.texture.wrapU = We.CLAMP_ADDRESSMODE, c.texture.wrapV = We.CLAMP_ADDRESSMODE;
        });
      }), this._fixReusablePostProcess(l);
      const P = new kr("BilateralBlurY", "fluidRenderingStandardBlur", ["filterSize", "blurDir"], null, 1, null, 1, a, !0, null, t, void 0, void 0, void 0, r);
      P.samples = this._samples, P.onApplyObservable.add((c) => {
        c.setInt("filterSize", this.blurFilterSize), c.setFloat2("blurDir", 0, 1 / this._blurTextureSizeY), this._postProcessRunningIndex++;
      }), P.onSizeChangedObservable.add(() => {
        P._textures.forEach((c) => {
          c.texture.wrapU = We.CLAMP_ADDRESSMODE, c.texture.wrapV = We.CLAMP_ADDRESSMODE;
        });
      }), this._fixReusablePostProcess(P), l.autoClear = !1, P.autoClear = !1;
      const p = [];
      for (let c = 0; c < this._blurNumIterations * 2; ++c)
        p[c] = c & 1 ? P : l;
      return [d, u, p];
    } else {
      const l = ["maxFilterSize", "blurDir", "projectedParticleConstant", "depthThreshold"], P = new kr("BilateralBlurX", "fluidRenderingBilateralBlur", l, null, 1, null, 1, a, !0, null, t, void 0, void 0, void 0, r);
      P.samples = this._samples, P.externalTextureSamplerBinding = !0, P.onApplyObservable.add((H) => {
        this._postProcessRunningIndex === 0 ? H.setTexture("textureSampler", e) : H._bindTexture("textureSampler", P.inputTexture.texture), H.setInt("maxFilterSize", this.blurMaxFilterSize), H.setFloat2("blurDir", 1 / this._blurTextureSizeX, 0), H.setFloat("projectedParticleConstant", this._getProjectedParticleConstant()), H.setFloat("depthThreshold", this._getDepthThreshold()), this._postProcessRunningIndex++;
      }), P.onSizeChangedObservable.add(() => {
        P._textures.forEach((H) => {
          H.texture.wrapU = We.CLAMP_ADDRESSMODE, H.texture.wrapV = We.CLAMP_ADDRESSMODE;
        });
      }), this._fixReusablePostProcess(P);
      const p = new kr("BilateralBlurY", "fluidRenderingBilateralBlur", l, null, 1, null, 1, a, !0, null, t, void 0, void 0, void 0, r);
      p.samples = this._samples, p.onApplyObservable.add((H) => {
        H.setInt("maxFilterSize", this.blurMaxFilterSize), H.setFloat2("blurDir", 0, 1 / this._blurTextureSizeY), H.setFloat("projectedParticleConstant", this._getProjectedParticleConstant()), H.setFloat("depthThreshold", this._getDepthThreshold()), this._postProcessRunningIndex++;
      }), p.onSizeChangedObservable.add(() => {
        p._textures.forEach((H) => {
          H.texture.wrapU = We.CLAMP_ADDRESSMODE, H.texture.wrapV = We.CLAMP_ADDRESSMODE;
        });
      }), this._fixReusablePostProcess(p), P.autoClear = !1, p.autoClear = !1;
      const c = [];
      for (let H = 0; H < this._blurNumIterations * 2; ++H)
        c[H] = H & 1 ? p : P;
      return [d, u, c];
    }
  }
  _fixReusablePostProcess(e) {
    e.isReusable() && (e.onActivateObservable.add(() => {
      e._currentRenderTextureInd = (e._currentRenderTextureInd + 1) % 2;
    }), e.onApplyObservable.add(() => {
      e._currentRenderTextureInd = (e._currentRenderTextureInd + 1) % 2;
    }));
  }
  _getProjectedParticleConstant() {
    var e, t;
    return this.blurFilterSize * this.particleSize * 0.05 * (this._height / 2) / Math.tan(((t = (e = this._camera) === null || e === void 0 ? void 0 : e.fov) !== null && t !== void 0 ? t : 45 * Math.PI / 180) / 2);
  }
  _getDepthThreshold() {
    return this.particleSize / 2 * this.blurDepthScale;
  }
  dispose() {
    var e, t, r, n;
    this.onDisposeObservable.hasObservers() && this.onDisposeObservable.notifyObservers(this), (e = this._rt) === null || e === void 0 || e.dispose(), this._rt = null, (t = this._texture) === null || t === void 0 || t.dispose(), this._texture = null, (r = this._rtBlur) === null || r === void 0 || r.dispose(), this._rtBlur = null, (n = this._textureBlurred) === null || n === void 0 || n.dispose(), this._textureBlurred = null, this._blurPostProcesses && (this._blurPostProcesses[0].dispose(), this._blurPostProcesses[1].dispose()), this._blurPostProcesses = null;
  }
}
var Pc;
(function(A) {
  A[A.DepthTexture = 0] = "DepthTexture", A[A.DepthBlurredTexture = 1] = "DepthBlurredTexture", A[A.ThicknessTexture = 2] = "ThicknessTexture", A[A.ThicknessBlurredTexture = 3] = "ThicknessBlurredTexture", A[A.DiffuseTexture = 4] = "DiffuseTexture", A[A.Normals = 5] = "Normals", A[A.DiffuseRendering = 6] = "DiffuseRendering";
})(Pc || (Pc = {}));
class wF {
  /**
   * Returns true if the class needs to be reinitialized (because of changes in parameterization)
   */
  get needInitialization() {
    return this._needInitialization;
  }
  /**
   * Gets or sets a boolean indicating that the diffuse texture should be generated and used for the rendering
   */
  get generateDiffuseTexture() {
    return this._generateDiffuseTexture;
  }
  set generateDiffuseTexture(e) {
    this._generateDiffuseTexture !== e && (this._generateDiffuseTexture = e, this._needInitialization = !0);
  }
  /**
   * Gets or sets the feature (texture) to be debugged. Not used if debug is false
   */
  get debugFeature() {
    return this._debugFeature;
  }
  set debugFeature(e) {
    this._debugFeature !== e && (this._needInitialization = !0, this._debugFeature = e);
  }
  /**
   * Gets or sets a boolean indicating if we should display a specific texture (given by debugFeature) for debugging purpose
   */
  get debug() {
    return this._debug;
  }
  set debug(e) {
    this._debug !== e && (this._debug = e, this._needInitialization = !0);
  }
  /**
   * Gets or sets the environment map used for the reflection part of the shading
   * If null, no map will be used. If undefined, the scene.environmentMap will be used (if defined)
   */
  get environmentMap() {
    return this._environmentMap;
  }
  set environmentMap(e) {
    this._environmentMap !== e && (this._needInitialization = !0, this._environmentMap = e);
  }
  /**
   * Gets or sets a boolean indicating that the depth texture should be blurred
   */
  get enableBlurDepth() {
    return this._enableBlurDepth;
  }
  set enableBlurDepth(e) {
    this._enableBlurDepth !== e && (this._enableBlurDepth = e, this._needInitialization = !0);
  }
  /**
   * Gets or sets the depth size divisor (positive number, generally between 1 and 4), which is used as a divisor when creating the texture used for blurring the depth
   * For eg. if blurDepthSizeDivisor=2, the texture used to blur the depth will be half the size of the depth texture
   */
  get blurDepthSizeDivisor() {
    return this._blurDepthSizeDivisor;
  }
  set blurDepthSizeDivisor(e) {
    this._blurDepthSizeDivisor !== e && (this._blurDepthSizeDivisor = e, this._needInitialization = !0);
  }
  /**
   * Size of the kernel used to filter the depth blur texture (positive number, generally between 1 and 20 - higher values will require more processing power from the GPU)
   */
  get blurDepthFilterSize() {
    return this._blurDepthFilterSize;
  }
  set blurDepthFilterSize(e) {
    this._blurDepthFilterSize !== e && (this._blurDepthFilterSize = e, this._setBlurParameters());
  }
  /**
   * Number of blurring iterations used to generate the depth blur texture (positive number, generally between 1 and 10 - higher values will require more processing power from the GPU)
   */
  get blurDepthNumIterations() {
    return this._blurDepthNumIterations;
  }
  set blurDepthNumIterations(e) {
    this._blurDepthNumIterations !== e && (this._blurDepthNumIterations = e, this._setBlurParameters());
  }
  /**
   * Maximum size of the kernel used to blur the depth texture (positive number, generally between 1 and 200 - higher values will require more processing power from the GPU when the particles are larger on screen)
   */
  get blurDepthMaxFilterSize() {
    return this._blurDepthMaxFilterSize;
  }
  set blurDepthMaxFilterSize(e) {
    this._blurDepthMaxFilterSize !== e && (this._blurDepthMaxFilterSize = e, this._setBlurParameters());
  }
  /**
   * Depth weight in the calculation when applying the bilateral blur to generate the depth blur texture (positive number, generally between 0 and 100)
   */
  get blurDepthDepthScale() {
    return this._blurDepthDepthScale;
  }
  set blurDepthDepthScale(e) {
    this._blurDepthDepthScale !== e && (this._blurDepthDepthScale = e, this._setBlurParameters());
  }
  /**
   * Gets or sets a boolean indicating that the thickness texture should be blurred
   */
  get enableBlurThickness() {
    return this._enableBlurThickness;
  }
  set enableBlurThickness(e) {
    this._enableBlurThickness !== e && (this._enableBlurThickness = e, this._needInitialization = !0);
  }
  /**
   * Gets or sets the thickness size divisor (positive number, generally between 1 and 4), which is used as a divisor when creating the texture used for blurring the thickness
   * For eg. if blurThicknessSizeDivisor=2, the texture used to blur the thickness will be half the size of the thickness texture
   */
  get blurThicknessSizeDivisor() {
    return this._blurThicknessSizeDivisor;
  }
  set blurThicknessSizeDivisor(e) {
    this._blurThicknessSizeDivisor !== e && (this._blurThicknessSizeDivisor = e, this._needInitialization = !0);
  }
  /**
   * Size of the kernel used to filter the thickness blur texture (positive number, generally between 1 and 20 - higher values will require more processing power from the GPU)
   */
  get blurThicknessFilterSize() {
    return this._blurThicknessFilterSize;
  }
  set blurThicknessFilterSize(e) {
    this._blurThicknessFilterSize !== e && (this._blurThicknessFilterSize = e, this._setBlurParameters());
  }
  /**
   * Number of blurring iterations used to generate the thickness blur texture (positive number, generally between 1 and 10 - higher values will require more processing power from the GPU)
   */
  get blurThicknessNumIterations() {
    return this._blurThicknessNumIterations;
  }
  set blurThicknessNumIterations(e) {
    this._blurThicknessNumIterations !== e && (this._blurThicknessNumIterations = e, this._setBlurParameters());
  }
  /**
   * Gets or sets a boolean indicating that a fixed thickness should be used instead of generating a thickness texture
   */
  get useFixedThickness() {
    return this._useFixedThickness;
  }
  set useFixedThickness(e) {
    this._useFixedThickness !== e && (this._useFixedThickness = e, this._needInitialization = !0);
  }
  /**
   * Gets or sets a boolean indicating that the velocity should be used when rendering the particles as a fluid.
   * Note: the vertex buffers must contain a "velocity" buffer for this to work!
   */
  get useVelocity() {
    return this._useVelocity;
  }
  set useVelocity(e) {
    this._useVelocity !== e && (this._useVelocity = e, this._needInitialization = !0, this._onUseVelocityChanged.notifyObservers(this));
  }
  /**
   * Defines the size of the depth texture.
   * If null, the texture will have the size of the screen
   */
  get depthMapSize() {
    return this._depthMapSize;
  }
  set depthMapSize(e) {
    this._depthMapSize !== e && (this._depthMapSize = e, this._needInitialization = !0);
  }
  /**
   * Defines the size of the thickness texture.
   * If null, the texture will have the size of the screen
   */
  get thicknessMapSize() {
    return this._thicknessMapSize;
  }
  set thicknessMapSize(e) {
    this._thicknessMapSize !== e && (this._thicknessMapSize = e, this._needInitialization = !0);
  }
  /**
   * Defines the size of the diffuse texture.
   * If null, the texture will have the size of the screen
   */
  get diffuseMapSize() {
    return this._diffuseMapSize;
  }
  set diffuseMapSize(e) {
    this._diffuseMapSize !== e && (this._diffuseMapSize = e, this._needInitialization = !0);
  }
  /**
   * Gets or sets the number of samples used by MSAA
   * Note: changing this value in WebGL does not work because depth/stencil textures can't be created with MSAA (see https://github.com/BabylonJS/Babylon.js/issues/12444)
   */
  get samples() {
    return this._samples;
  }
  set samples(e) {
    this._samples !== e && (this._samples = e, this._needInitialization = !0);
  }
  /**
   * Gets the camera used for the rendering
   */
  get camera() {
    return this._camera;
  }
  /**
   * Creates an instance of the class
   * @param scene Scene used to render the fluid object into
   * @param camera Camera used to render the fluid object. If not provided, use the active camera of the scene instead
   */
  constructor(e, t) {
    this._generateDiffuseTexture = !1, this.fluidColor = new Ne(0.085, 0.6375, 0.765), this.density = 2, this.refractionStrength = 0.1, this.fresnelClamp = 1, this.specularPower = 250, this.minimumThickness = 0, this.dirLight = new S(-2, -1, 1).normalize(), this._debugFeature = Pc.DepthBlurredTexture, this._debug = !1, this._enableBlurDepth = !0, this._blurDepthSizeDivisor = 1, this._blurDepthFilterSize = 7, this._blurDepthNumIterations = 3, this._blurDepthMaxFilterSize = 100, this._blurDepthDepthScale = 10, this._enableBlurThickness = !0, this._blurThicknessSizeDivisor = 1, this._blurThicknessFilterSize = 5, this._blurThicknessNumIterations = 1, this._useFixedThickness = !1, this._onUseVelocityChanged = new Oe(), this._useVelocity = !1, this._depthMapSize = null, this._thicknessMapSize = null, this._diffuseMapSize = null, this._samples = 1, this._scene = e, this._engine = e.getEngine(), this._camera = t ?? e.activeCamera, this._needInitialization = !0, this._bgDepthTexture = null, this._invProjectionMatrix = new he(), this._depthClearColor = new xt(1e6, 1e6, 1e6, 1), this._thicknessClearColor = new xt(0, 0, 0, 1), this._depthRenderTarget = null, this._diffuseRenderTarget = null, this._thicknessRenderTarget = null, this._renderPostProcess = null;
  }
  /** @internal */
  _initialize() {
    var e, t, r;
    this.dispose(), this._needInitialization = !1;
    const n = (e = this._depthMapSize) !== null && e !== void 0 ? e : this._engine.getRenderWidth(), i = this._depthMapSize !== null ? Math.round(this._depthMapSize * this._engine.getRenderHeight() / this._engine.getRenderWidth()) : this._engine.getRenderHeight();
    if (this._depthRenderTarget = new IE("Depth", this._scene, n, i, n, i, 1, 7, 1, 7, !1, this._camera, !0, this._samples), this._initializeRenderTarget(this._depthRenderTarget), this.generateDiffuseTexture) {
      const f = (t = this._diffuseMapSize) !== null && t !== void 0 ? t : this._engine.getRenderWidth(), o = this._diffuseMapSize !== null ? Math.round(this._diffuseMapSize * this._engine.getRenderHeight() / this._engine.getRenderWidth()) : this._engine.getRenderHeight();
      this._diffuseRenderTarget = new IE("Diffuse", this._scene, f, o, 0, 0, 0, 5, 0, 5, !0, this._camera, !0, this._samples), this._initializeRenderTarget(this._diffuseRenderTarget);
    }
    const s = (r = this._thicknessMapSize) !== null && r !== void 0 ? r : this._engine.getRenderWidth(), a = this._thicknessMapSize !== null ? Math.round(this._thicknessMapSize * this._engine.getRenderHeight() / this._engine.getRenderWidth()) : this._engine.getRenderHeight();
    this._useFixedThickness || (this._thicknessRenderTarget = new IE("Thickness", this._scene, s, a, s, a, 2, 6, 2, 6, !0, this._camera, !1, this._samples), this._initializeRenderTarget(this._thicknessRenderTarget)), this._createLiquidRenderingPostProcess();
  }
  _setBlurParameters(e = null) {
    (e === null || e === this._depthRenderTarget) && this._setBlurDepthParameters(), (e === null || e === this._thicknessRenderTarget) && this._setBlurThicknessParameters();
  }
  _setBlurDepthParameters() {
    this._depthRenderTarget && (this._depthRenderTarget.blurFilterSize = this.blurDepthFilterSize, this._depthRenderTarget.blurMaxFilterSize = this.blurDepthMaxFilterSize, this._depthRenderTarget.blurNumIterations = this.blurDepthNumIterations, this._depthRenderTarget.blurDepthScale = this.blurDepthDepthScale);
  }
  _setBlurThicknessParameters() {
    this._thicknessRenderTarget && (this._thicknessRenderTarget.blurFilterSize = this.blurThicknessFilterSize, this._thicknessRenderTarget.blurNumIterations = this.blurThicknessNumIterations);
  }
  _initializeRenderTarget(e) {
    e !== this._diffuseRenderTarget && (e.enableBlur = e === this._depthRenderTarget ? this.enableBlurDepth : this.enableBlurThickness, e.blurSizeDivisor = e === this._depthRenderTarget ? this.blurDepthSizeDivisor : this.blurThicknessSizeDivisor), this._setBlurParameters(e), e.initialize();
  }
  _createLiquidRenderingPostProcess() {
    var e;
    const t = this._scene.getEngine(), r = [
      "viewMatrix",
      "projectionMatrix",
      "invProjectionMatrix",
      "texelSize",
      "dirLight",
      "cameraFar",
      "density",
      "refractionStrength",
      "fresnelClamp",
      "specularPower"
    ], n = ["depthSampler"], i = [];
    if (this.dispose(!0), !this._camera)
      return;
    const s = this._depthRenderTarget.enableBlur ? this._depthRenderTarget.textureBlur : this._depthRenderTarget.texture, a = new at(1 / s.getSize().width, 1 / s.getSize().height);
    this._scene.useRightHandedSystem && i.push("#define FLUIDRENDERING_RHS"), this._environmentMap !== null && ((e = this._environmentMap) !== null && e !== void 0 ? e : this._scene.environmentTexture) && (n.push("reflectionSampler"), i.push("#define FLUIDRENDERING_ENVIRONMENT")), this._diffuseRenderTarget ? (n.push("diffuseSampler"), i.push("#define FLUIDRENDERING_DIFFUSETEXTURE")) : r.push("diffuseColor"), this._useVelocity && (n.push("velocitySampler"), i.push("#define FLUIDRENDERING_VELOCITY")), this._useFixedThickness ? (r.push("thickness"), n.push("bgDepthSampler"), i.push("#define FLUIDRENDERING_FIXED_THICKNESS")) : (r.push("minimumThickness"), n.push("thicknessSampler")), this._debug && (i.push("#define FLUIDRENDERING_DEBUG"), this._debugFeature === Pc.Normals ? i.push("#define FLUIDRENDERING_DEBUG_SHOWNORMAL") : this._debugFeature === Pc.DiffuseRendering ? i.push("#define FLUIDRENDERING_DEBUG_DIFFUSERENDERING") : (i.push("#define FLUIDRENDERING_DEBUG_TEXTURE"), n.push("debugSampler"), (this._debugFeature === Pc.DepthTexture || this._debugFeature === Pc.DepthBlurredTexture) && i.push("#define FLUIDRENDERING_DEBUG_DEPTH"))), this._renderPostProcess = new kr("FluidRendering", "fluidRenderingRender", r, n, 1, null, 2, t, !1, null, 0, void 0, void 0, !0, void 0), this._renderPostProcess.updateEffect(i.join(`
`)), this._renderPostProcess.samples = this._samples, this._renderPostProcess.onApplyObservable.add((f) => {
      var o, d, v, u, l, P, p, c, H, T, q, b, j, w, m, I, N, k, R, y, O, Y, ee;
      if (this._invProjectionMatrix.copyFrom(this._scene.getProjectionMatrix()), this._invProjectionMatrix.invert(), t.isWebGPU && f.setTextureSampler("textureSamplerSampler", this._renderPostProcess.inputTexture.texture), this._depthRenderTarget.enableBlur ? (f.setTexture("depthSampler", this._depthRenderTarget.textureBlur), t.isWebGPU && f.setTextureSampler("depthSamplerSampler", (u = (v = this._depthRenderTarget.textureBlur) === null || v === void 0 ? void 0 : v.getInternalTexture()) !== null && u !== void 0 ? u : null)) : (f.setTexture("depthSampler", this._depthRenderTarget.texture), t.isWebGPU && f.setTextureSampler("depthSamplerSampler", (d = (o = this._depthRenderTarget.texture) === null || o === void 0 ? void 0 : o.getInternalTexture()) !== null && d !== void 0 ? d : null)), this._diffuseRenderTarget ? this._diffuseRenderTarget.enableBlur ? (f.setTexture("diffuseSampler", this._diffuseRenderTarget.textureBlur), t.isWebGPU && f.setTextureSampler("diffuseSamplerSampler", (c = (p = this._diffuseRenderTarget.textureBlur) === null || p === void 0 ? void 0 : p.getInternalTexture()) !== null && c !== void 0 ? c : null)) : (f.setTexture("diffuseSampler", this._diffuseRenderTarget.texture), t.isWebGPU && f.setTextureSampler("diffuseSamplerSampler", (P = (l = this._diffuseRenderTarget.texture) === null || l === void 0 ? void 0 : l.getInternalTexture()) !== null && P !== void 0 ? P : null)) : f.setColor3("diffuseColor", this.fluidColor), this._useFixedThickness ? (f.setFloat("thickness", this.minimumThickness), f._bindTexture("bgDepthSampler", this._bgDepthTexture), t.isWebGPU && f.setTextureSampler("bgDepthSamplerSampler", (H = this._bgDepthTexture) !== null && H !== void 0 ? H : null)) : (this._thicknessRenderTarget.enableBlur ? (f.setTexture("thicknessSampler", this._thicknessRenderTarget.textureBlur), t.isWebGPU && f.setTextureSampler("thicknessSamplerSampler", (j = (b = this._thicknessRenderTarget.textureBlur) === null || b === void 0 ? void 0 : b.getInternalTexture()) !== null && j !== void 0 ? j : null)) : (f.setTexture("thicknessSampler", this._thicknessRenderTarget.texture), t.isWebGPU && f.setTextureSampler("thicknessSamplerSampler", (q = (T = this._thicknessRenderTarget.texture) === null || T === void 0 ? void 0 : T.getInternalTexture()) !== null && q !== void 0 ? q : null)), f.setFloat("minimumThickness", this.minimumThickness)), this._environmentMap !== null) {
        const Z = (w = this._environmentMap) !== null && w !== void 0 ? w : this._scene.environmentTexture;
        Z && (f.setTexture("reflectionSampler", Z), t.isWebGPU && f.setTextureSampler("reflectionSamplerSampler", (m = Z == null ? void 0 : Z.getInternalTexture()) !== null && m !== void 0 ? m : null));
      }
      if (f.setMatrix("viewMatrix", this._scene.getViewMatrix()), f.setMatrix("invProjectionMatrix", this._invProjectionMatrix), f.setMatrix("projectionMatrix", this._scene.getProjectionMatrix()), f.setVector2("texelSize", a), f.setFloat("density", this.density), f.setFloat("refractionStrength", this.refractionStrength), f.setFloat("fresnelClamp", this.fresnelClamp), f.setFloat("specularPower", this.specularPower), f.setVector3("dirLight", this.dirLight), f.setFloat("cameraFar", this._camera.maxZ), this._debug) {
        let Z = null;
        switch (this._debugFeature) {
          case Pc.DepthTexture:
            Z = this._depthRenderTarget.texture;
            break;
          case Pc.DepthBlurredTexture:
            Z = this._depthRenderTarget.enableBlur ? this._depthRenderTarget.textureBlur : this._depthRenderTarget.texture;
            break;
          case Pc.ThicknessTexture:
            Z = (N = (I = this._thicknessRenderTarget) === null || I === void 0 ? void 0 : I.texture) !== null && N !== void 0 ? N : null;
            break;
          case Pc.ThicknessBlurredTexture:
            Z = !((k = this._thicknessRenderTarget) === null || k === void 0) && k.enableBlur ? (y = (R = this._thicknessRenderTarget) === null || R === void 0 ? void 0 : R.textureBlur) !== null && y !== void 0 ? y : null : (Y = (O = this._thicknessRenderTarget) === null || O === void 0 ? void 0 : O.texture) !== null && Y !== void 0 ? Y : null;
            break;
          case Pc.DiffuseTexture:
            this._diffuseRenderTarget && (Z = this._diffuseRenderTarget.texture);
            break;
        }
        this._debugFeature !== Pc.Normals && (f.setTexture("debugSampler", Z), t.isWebGPU && f.setTextureSampler("debugSamplerSampler", (ee = Z == null ? void 0 : Z.getInternalTexture()) !== null && ee !== void 0 ? ee : null));
      }
    });
  }
  /** @internal */
  _clearTargets() {
    var e, t, r;
    !((e = this._depthRenderTarget) === null || e === void 0) && e.renderTarget && (this._engine.bindFramebuffer(this._depthRenderTarget.renderTarget), this._engine.clear(this._depthClearColor, !0, !0, !1), this._engine.unBindFramebuffer(this._depthRenderTarget.renderTarget)), !((t = this._diffuseRenderTarget) === null || t === void 0) && t.renderTarget && (this._engine.bindFramebuffer(this._diffuseRenderTarget.renderTarget), this._engine.clear(this._thicknessClearColor, !0, !0, !1), this._engine.unBindFramebuffer(this._diffuseRenderTarget.renderTarget)), !((r = this._thicknessRenderTarget) === null || r === void 0) && r.renderTarget && (this._engine.bindFramebuffer(this._thicknessRenderTarget.renderTarget), this._engine.clear(this._thicknessClearColor, !0, !1, !1), this._engine.unBindFramebuffer(this._thicknessRenderTarget.renderTarget));
  }
  /** @internal */
  _render(e) {
    var t, r, n, i, s, a;
    if (this._needInitialization || !e.isReady())
      return;
    const f = this._engine._currentRenderTarget;
    this._engine.setState(!1, void 0, void 0, void 0, !0), this._engine.setDepthBuffer(!0), this._engine.setDepthWrite(!0), this._engine.setAlphaMode(0), !((t = this._depthRenderTarget) === null || t === void 0) && t.renderTarget && (this._engine.bindFramebuffer(this._depthRenderTarget.renderTarget), e.renderDepthTexture(), this._engine.unbindInstanceAttributes(), this._engine.unBindFramebuffer(this._depthRenderTarget.renderTarget)), !((r = this._diffuseRenderTarget) === null || r === void 0) && r.renderTarget && (this._engine.bindFramebuffer(this._diffuseRenderTarget.renderTarget), e.renderDiffuseTexture(), this._engine.unbindInstanceAttributes(), this._engine.unBindFramebuffer(this._diffuseRenderTarget.renderTarget)), !((n = this._thicknessRenderTarget) === null || n === void 0) && n.renderTarget && (this._engine.bindFramebuffer(this._thicknessRenderTarget.renderTarget), e.renderThicknessTexture(), this._engine.unbindInstanceAttributes(), this._engine.unBindFramebuffer(this._thicknessRenderTarget.renderTarget)), (i = this._depthRenderTarget) === null || i === void 0 || i.applyBlurPostProcesses(), (s = this._diffuseRenderTarget) === null || s === void 0 || s.applyBlurPostProcesses(), (a = this._thicknessRenderTarget) === null || a === void 0 || a.applyBlurPostProcesses(), f && this._engine.bindFramebuffer(f);
  }
  /**
   * Releases all the ressources used by the class
   * @param onlyPostProcesses If true, releases only the ressources used by the render post processes
   */
  dispose(e = !1) {
    var t, r, n, i;
    e || ((t = this._depthRenderTarget) === null || t === void 0 || t.dispose(), this._depthRenderTarget = null, (r = this._diffuseRenderTarget) === null || r === void 0 || r.dispose(), this._diffuseRenderTarget = null, (n = this._thicknessRenderTarget) === null || n === void 0 || n.dispose(), this._thicknessRenderTarget = null), this._renderPostProcess && this._camera && this._camera.detachPostProcess(this._renderPostProcess), (i = this._renderPostProcess) === null || i === void 0 || i.dispose(), this._renderPostProcess = null, this._needInitialization = !1;
  }
}
class uie extends LY {
  /**
   * Gets the name of the class
   */
  getClassName() {
    return "FluidRenderingObjectCustomParticles";
  }
  /**
   * Gets the vertex buffers
   */
  get vertexBuffers() {
    return this._vertexBuffers;
  }
  /**
   * Creates a new instance of the class
   * @param scene The scene the particles should be rendered into
   * @param buffers The list of buffers (must contain at least one "position" buffer!). Note that you don't have to pass all (or any!) buffers at once in the constructor, you can use the addBuffers method to add more later.
   * @param numParticles Number of vertices to take into account from the buffers
   */
  constructor(e, t, r) {
    super(e), this._numParticles = r, this._diffuseEffectWrapper = null, this._vertexBuffers = {}, this.addBuffers(t);
  }
  /**
   * Add some new buffers
   * @param buffers List of buffers
   */
  addBuffers(e) {
    for (const t in e) {
      let r, n = !0;
      switch (t) {
        case "velocity":
          r = 3;
          break;
        case "offset":
          n = !1;
          break;
      }
      this._vertexBuffers[t] = new J(this._engine, e[t], t, !0, !1, r, n);
    }
  }
  _createEffects() {
    super._createEffects();
    const e = ["view", "projection", "size"], t = ["position", "offset", "color"];
    this._diffuseEffectWrapper = new ng({
      engine: this._engine,
      useShaderStore: !0,
      vertexShader: "fluidRenderingParticleDiffuse",
      fragmentShader: "fluidRenderingParticleDiffuse",
      attributeNames: t,
      uniformNames: e,
      samplerNames: []
    });
  }
  /**
   * Indicates if the object is ready to be rendered
   * @returns True if everything is ready for the object to be rendered, otherwise false
   */
  isReady() {
    var e, t;
    return this._vertexBuffers.offset || (this._vertexBuffers.offset = new J(this._engine, [0, 0, 1, 0, 0, 1, 1, 1], "offset", !1, !1, 2)), super.isReady() && ((t = (e = this._diffuseEffectWrapper) === null || e === void 0 ? void 0 : e.effect.isReady()) !== null && t !== void 0 ? t : !1);
  }
  /**
   * Gets the number of particles in this object
   * @returns The number of particles
   */
  get numParticles() {
    return this._numParticles;
  }
  /**
   * Sets the number of particles in this object
   * @param num The number of particles to take into account
   */
  setNumParticles(e) {
    this._numParticles = e;
  }
  /**
   * Render the diffuse texture for this object
   */
  renderDiffuseTexture() {
    const e = this.numParticles;
    if (!this._diffuseEffectWrapper || e === 0)
      return;
    const t = this._diffuseEffectWrapper._drawWrapper, r = t.effect;
    this._engine.enableEffect(t), this._engine.bindBuffers(this.vertexBuffers, this.indexBuffer, r), r.setMatrix("view", this._scene.getViewMatrix()), r.setMatrix("projection", this._scene.getProjectionMatrix()), this._particleSize !== null && r.setFloat2("size", this._particleSize, this._particleSize), this.useInstancing ? this._engine.drawArraysType(7, 0, 4, e) : this._engine.drawElementsType(0, 0, e);
  }
  /**
   * Releases the ressources used by the class
   */
  dispose() {
    var e;
    super.dispose(), (e = this._diffuseEffectWrapper) === null || e === void 0 || e.dispose();
    for (const t in this._vertexBuffers)
      this._vertexBuffers[t].dispose();
    this._vertexBuffers = {};
  }
}
const bHe = "copyTextureToTexturePixelShader", xHe = `uniform float conversion;uniform sampler2D textureSampler;varying vec2 vUV;
#include<helperFunctions>
void main(void) 
{vec4 color=texture2D(textureSampler,vUV);
#ifdef DEPTH_TEXTURE
gl_FragDepth=color.r;
#else
if (conversion==1.) {color=toLinearSpace(color);} else if (conversion==2.) {color=toGammaSpace(color);}
gl_FragColor=color;
#endif
}
`;
Le.ShadersStore[bHe] = xHe;
var dO;
(function(A) {
  A[A.None = 0] = "None", A[A.ToLinearSpace = 1] = "ToLinearSpace", A[A.ToGammaSpace = 2] = "ToGammaSpace";
})(dO || (dO = {}));
class lie {
  _textureIsInternal(e) {
    return e.getInternalTexture === void 0;
  }
  /**
   * Constructs a new instance of the class
   * @param engine The engine to use for the copy
   * @param isDepthTexture True means that we should write (using gl_FragDepth) into the depth texture attached to the destination (default: false)
   */
  constructor(e, t = !1) {
    this._engine = e, this._isDepthTexture = t, this._renderer = new fU(e), this._effectWrapper = new ng({
      engine: e,
      name: "CopyTextureToTexture",
      fragmentShader: "copyTextureToTexture",
      useShaderStore: !0,
      uniformNames: ["conversion"],
      samplerNames: ["textureSampler"],
      defines: t ? ["#define DEPTH_TEXTURE"] : []
    }), this._effectWrapper.onApplyObservable.add(() => {
      t && (e.setState(!1), e.setDepthBuffer(!0), e.depthCullingState.depthMask = !0, e.depthCullingState.depthFunc = 519), this._textureIsInternal(this._source) ? this._effectWrapper.effect._bindTexture("textureSampler", this._source) : this._effectWrapper.effect.setTexture("textureSampler", this._source), this._effectWrapper.effect.setFloat("conversion", this._conversion);
    });
  }
  /**
   * Indicates if the effect is ready to be used for the copy
   * @returns true if "copy" can be called without delay, else false
   */
  isReady() {
    return this._effectWrapper.effect.isReady();
  }
  /**
   * Copy one texture into another
   * @param source The source texture
   * @param destination The destination texture
   * @param conversion The conversion mode that should be applied when copying
   * @returns
   */
  copy(e, t, r = dO.None) {
    if (!this.isReady())
      return !1;
    this._source = e, this._conversion = r;
    const n = this._engine.depthCullingState.depthFunc;
    return this._renderer.render(this._effectWrapper, t), this._isDepthTexture && n && (this._engine.depthCullingState.depthFunc = n), !0;
  }
  /**
   * Releases all the resources used by the class
   */
  dispose() {
    this._effectWrapper.dispose(), this._renderer.dispose();
  }
}
class DHe {
  get depthRTWrapper() {
    return this._depthRTWrapper;
  }
  constructor(e, t, r, n = 1) {
    this._engine = e, this._copyTextureToTexture = new lie(e, !0), this._depthRTWrapper = this._engine.createRenderTargetTexture({ width: t, height: r }, {
      generateMipMaps: !1,
      type: 0,
      format: 6,
      samplingMode: 1,
      generateDepthBuffer: !0,
      generateStencilBuffer: !1,
      samples: n,
      noColorAttachment: !0,
      label: "FluidRenderingDepthTextureCopyRTT"
    });
    const i = this._depthRTWrapper.createDepthStencilTexture(0, !1, !1, 1, void 0, "FluidRenderingDepthTextureCopyRTTDepthStencil");
    i.label = `FluidDepthTextureCopy${t}x${r}x${n}`;
  }
  copy(e) {
    return this._copyTextureToTexture.copy(e, this._depthRTWrapper);
  }
  dispose() {
    this._depthRTWrapper.dispose(), this._copyTextureToTexture.dispose();
  }
}
const jHe = "fluidRenderingParticleDepthVertexShader", wHe = `attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius;
#ifdef FLUIDRENDERING_VELOCITY
attribute vec3 velocity;varying float velocityNorm;
#endif
void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;viewPos=(view*vec4(position,1.0)).xyz;gl_Position=projection*vec4(viewPos+cornerPos,1.0);uv=offset;sphereRadius=size.x/2.0;
#ifdef FLUIDRENDERING_VELOCITY
velocityNorm=length(velocity);
#endif
}
`;
Le.ShadersStore[jHe] = wHe;
const mHe = "fluidRenderingParticleDepthPixelShader", BHe = `uniform mat4 projection;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius;
#ifdef FLUIDRENDERING_VELOCITY
varying float velocityNorm;
#endif
void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;normal.z=sqrt(1.0-r2);
#ifndef FLUIDRENDERING_RHS
normal.z=-normal.z;
#endif
vec4 realViewPos=vec4(viewPos+normal*sphereRadius,1.0);vec4 clipSpacePos=projection*realViewPos;
#ifdef WEBGPU
gl_FragDepth=clipSpacePos.z/clipSpacePos.w;
#else
gl_FragDepth=(clipSpacePos.z/clipSpacePos.w)*0.5+0.5;
#endif
#ifdef FLUIDRENDERING_RHS
realViewPos.z=-realViewPos.z;
#endif
#ifdef FLUIDRENDERING_VELOCITY
glFragColor=vec4(realViewPos.z,velocityNorm,0.,1.);
#else
glFragColor=vec4(realViewPos.z,0.,0.,1.);
#endif
}
`;
Le.ShadersStore[mHe] = BHe;
const WHe = "fluidRenderingParticleThicknessVertexShader", SHe = `attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;gl_Position=projection*vec4(viewPos,1.0);uv=offset;}
`;
Le.ShadersStore[WHe] = SHe;
const UHe = "fluidRenderingParticleThicknessPixelShader", IHe = `uniform float particleAlpha;varying vec2 uv;void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;float thickness=sqrt(1.0-r2);glFragColor=vec4(vec3(particleAlpha*thickness),1.0);}
`;
Le.ShadersStore[UHe] = IHe;
const RHe = "fluidRenderingParticleDiffuseVertexShader", VHe = `attribute vec3 position;attribute vec2 offset;attribute vec4 color;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 diffuseColor;void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;gl_Position=projection*vec4(viewPos,1.0);uv=offset;diffuseColor=color.rgb;}
`;
Le.ShadersStore[RHe] = VHe;
const CHe = "fluidRenderingParticleDiffusePixelShader", OHe = `uniform float particleAlpha;varying vec2 uv;varying vec3 diffuseColor;void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;glFragColor=vec4(diffuseColor,1.0);}
`;
Le.ShadersStore[CHe] = OHe;
const yHe = "fluidRenderingBilateralBlurPixelShader", kHe = `uniform sampler2D textureSampler;uniform int maxFilterSize;uniform vec2 blurDir;uniform float projectedParticleConstant;uniform float depthThreshold;varying vec2 vUV;void main(void) {float depth=textureLod(textureSampler,vUV,0.).x;if (depth>=1e6 || depth<=0.) {glFragColor=vec4(vec3(depth),1.);return;}
int filterSize=min(maxFilterSize,int(ceil(projectedParticleConstant/depth)));float sigma=float(filterSize)/3.0;float two_sigma2=2.0*sigma*sigma;float sigmaDepth=depthThreshold/3.0;float two_sigmaDepth2=2.0*sigmaDepth*sigmaDepth;float sum=0.;float wsum=0.;float sumVel=0.;for (int x=-filterSize; x<=filterSize; ++x) {vec2 coords=vec2(x);vec2 sampleDepthVel=textureLod(textureSampler,vUV+coords*blurDir,0.).rg;float r=dot(coords,coords);float w=exp(-r/two_sigma2);float rDepth=sampleDepthVel.r-depth;float wd=exp(-rDepth*rDepth/two_sigmaDepth2);sum+=sampleDepthVel.r*w*wd;sumVel+=sampleDepthVel.g*w*wd;wsum+=w*wd;}
glFragColor=vec4(sum/wsum,sumVel/wsum,0.,1.);}
`;
Le.ShadersStore[yHe] = kHe;
const EHe = "fluidRenderingStandardBlurPixelShader", FHe = `uniform sampler2D textureSampler;uniform int filterSize;uniform vec2 blurDir;varying vec2 vUV;void main(void) {vec4 s=textureLod(textureSampler,vUV,0.);if (s.r==0.) {glFragColor=vec4(0.,0.,0.,1.);return;}
float sigma=float(filterSize)/3.0;float twoSigma2=2.0*sigma*sigma;vec4 sum=vec4(0.);float wsum=0.;for (int x=-filterSize; x<=filterSize; ++x) {vec2 coords=vec2(x);vec4 sampl=textureLod(textureSampler,vUV+coords*blurDir,0.);float w=exp(-coords.x*coords.x/twoSigma2);sum+=sampl*w;wsum+=w;}
sum/=wsum;glFragColor=vec4(sum.rgb,1.);}
`;
Le.ShadersStore[EHe] = FHe;
const NHe = "fluidRenderingRenderPixelShader", QHe = `/* disable_uniformity_analysis */
#define IOR 1.333
#define ETA 1.0/IOR
#define F0 0.02
uniform sampler2D textureSampler;uniform sampler2D depthSampler;
#ifdef FLUIDRENDERING_DIFFUSETEXTURE
uniform sampler2D diffuseSampler;
#else
uniform vec3 diffuseColor;
#endif
#ifdef FLUIDRENDERING_FIXED_THICKNESS
uniform float thickness;uniform sampler2D bgDepthSampler;
#else
uniform float minimumThickness;uniform sampler2D thicknessSampler;
#endif
#ifdef FLUIDRENDERING_ENVIRONMENT
uniform samplerCube reflectionSampler;
#endif
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)
uniform sampler2D debugSampler;
#endif
uniform mat4 viewMatrix;uniform mat4 projectionMatrix;uniform mat4 invProjectionMatrix;uniform vec2 texelSize;uniform vec3 dirLight;uniform float cameraFar;uniform float density;uniform float refractionStrength;uniform float fresnelClamp;uniform float specularPower;varying vec2 vUV;vec3 computeViewPosFromUVDepth(vec2 texCoord,float depth) {vec4 ndc;ndc.xy=texCoord*2.0-1.0;
#ifdef FLUIDRENDERING_RHS
ndc.z=-projectionMatrix[2].z+projectionMatrix[3].z/depth;
#else
ndc.z=projectionMatrix[2].z+projectionMatrix[3].z/depth;
#endif
ndc.w=1.0;vec4 eyePos=invProjectionMatrix*ndc;eyePos.xyz/=eyePos.w;return eyePos.xyz;}
vec3 getViewPosFromTexCoord(vec2 texCoord) {float depth=textureLod(depthSampler,texCoord,0.).x;return computeViewPosFromUVDepth(texCoord,depth);}
void main(void) {vec2 texCoord=vUV;
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)
vec4 color=texture2D(debugSampler,texCoord);
#ifdef FLUIDRENDERING_DEBUG_DEPTH
glFragColor=vec4(color.rgb/vec3(2.0),1.);if (color.r>0.999 && color.g>0.999) {glFragColor=texture2D(textureSampler,texCoord);}
#else
glFragColor=vec4(color.rgb,1.);if (color.r<0.001 && color.g<0.001 && color.b<0.001) {glFragColor=texture2D(textureSampler,texCoord);}
#endif
return;
#endif
vec2 depthVel=textureLod(depthSampler,texCoord,0.).rg;float depth=depthVel.r;
#ifndef FLUIDRENDERING_FIXED_THICKNESS
float thickness=texture2D(thicknessSampler,texCoord).x;
#else
float bgDepth=texture2D(bgDepthSampler,texCoord).x;float depthNonLinear=projectionMatrix[2].z+projectionMatrix[3].z/depth;depthNonLinear=depthNonLinear*0.5+0.5;
#endif
vec4 backColor=texture2D(textureSampler,texCoord);
#ifndef FLUIDRENDERING_FIXED_THICKNESS
if (depth>=cameraFar || depth<=0. || thickness<=minimumThickness) {
#else
if (depth>=cameraFar || depth<=0. || bgDepth<=depthNonLinear) {
#endif
glFragColor=backColor;return;}
vec3 viewPos=computeViewPosFromUVDepth(texCoord,depth);vec3 ddx=getViewPosFromTexCoord(texCoord+vec2(texelSize.x,0.))-viewPos;vec3 ddy=getViewPosFromTexCoord(texCoord+vec2(0.,texelSize.y))-viewPos;vec3 ddx2=viewPos-getViewPosFromTexCoord(texCoord+vec2(-texelSize.x,0.));if (abs(ddx.z)>abs(ddx2.z)) {ddx=ddx2;}
vec3 ddy2=viewPos-getViewPosFromTexCoord(texCoord+vec2(0.,-texelSize.y));if (abs(ddy.z)>abs(ddy2.z)) {ddy=ddy2;}
vec3 normal=normalize(cross(ddy,ddx));
#ifdef FLUIDRENDERING_RHS
normal=-normal;
#endif
#ifndef WEBGPU
if(isnan(normal.x) || isnan(normal.y) || isnan(normal.z) || isinf(normal.x) || isinf(normal.y) || isinf(normal.z)) {normal=vec3(0.,0.,-1.);}
#endif
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_SHOWNORMAL)
glFragColor=vec4(normal*0.5+0.5,1.0);return;
#endif
vec3 rayDir=normalize(viewPos); 
#ifdef FLUIDRENDERING_DIFFUSETEXTURE
vec3 diffuseColor=textureLod(diffuseSampler,texCoord,0.0).rgb;
#endif
vec3 lightDir=normalize(vec3(viewMatrix*vec4(-dirLight,0.)));vec3 H =normalize(lightDir-rayDir);float specular=pow(max(0.0,dot(H,normal)),specularPower);
#ifdef FLUIDRENDERING_DEBUG_DIFFUSERENDERING
float diffuse =max(0.0,dot(lightDir,normal))*1.0;glFragColor=vec4(vec3(0.1) /*ambient*/+vec3(0.42,0.50,1.00)*diffuse+vec3(0,0,0.2)+specular,1.);return;
#endif
vec3 refractionDir=refract(rayDir,normal,ETA);vec4 transmitted=textureLod(textureSampler,vec2(texCoord+refractionDir.xy*thickness*refractionStrength),0.0);vec3 transmittance=exp(-density*thickness*(1.0-diffuseColor)); 
vec3 refractionColor=transmitted.rgb*transmittance;
#ifdef FLUIDRENDERING_ENVIRONMENT
vec3 reflectionDir=reflect(rayDir,normal);vec3 reflectionColor=(textureCube(reflectionSampler,reflectionDir).rgb);float fresnel=clamp(F0+(1.0-F0)*pow(1.0-dot(normal,-rayDir),5.0),0.,fresnelClamp);vec3 finalColor=mix(refractionColor,reflectionColor,fresnel)+specular;
#else
vec3 finalColor=refractionColor+specular;
#endif
#ifdef FLUIDRENDERING_VELOCITY
float velocity=depthVel.g;finalColor=mix(finalColor,vec3(1.0),smoothstep(0.3,1.0,velocity/6.0));
#endif
glFragColor=vec4(finalColor,transmitted.a);}
`;
Le.ShadersStore[NHe] = QHe;
Object.defineProperty(sr.prototype, "fluidRenderer", {
  get: function() {
    return this._fluidRenderer;
  },
  set: function(A) {
    this._fluidRenderer = A;
  },
  enumerable: !0,
  configurable: !0
});
sr.prototype.enableFluidRenderer = function() {
  return this._fluidRenderer ? this._fluidRenderer : (this._fluidRenderer = new Iy(this), this._fluidRenderer);
};
sr.prototype.disableFluidRenderer = function() {
  var A;
  (A = this._fluidRenderer) === null || A === void 0 || A.dispose(), this._fluidRenderer = null;
};
function YHe(A) {
  return !!A.particleSystem;
}
class Pie {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_FLUIDRENDERER, this.scene = e;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._gatherActiveCameraRenderTargetsStage.registerStep(Ot.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER, this, this._gatherActiveCameraRenderTargets), this.scene._afterCameraDrawStage.registerStep(Ot.STEP_AFTERCAMERADRAW_FLUIDRENDERER, this, this._afterCameraDraw);
  }
  _gatherActiveCameraRenderTargets(e) {
    var t;
    (t = this.scene.fluidRenderer) === null || t === void 0 || t._prepareRendering();
  }
  _afterCameraDraw(e) {
    var t;
    (t = this.scene.fluidRenderer) === null || t === void 0 || t._render(e);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
    this.scene._fluidRenderer && (this.scene.disableFluidRenderer(), this.scene.enableFluidRenderer());
  }
  /**
   * Disposes the component and the associated resources
   */
  dispose() {
    this.scene.disableFluidRenderer();
  }
}
class Iy {
  /** @internal */
  static _SceneComponentInitialization(e) {
    let t = e._getComponent(Ot.NAME_FLUIDRENDERER);
    t || (t = new Pie(e), e._addComponent(t));
  }
  /**
   * Initializes the class
   * @param scene Scene in which the objects are part of
   */
  constructor(e) {
    this._scene = e, this._engine = e.getEngine(), this._onEngineResizeObserver = null, this.renderObjects = [], this.targetRenderers = [], this._cameras = /* @__PURE__ */ new Map(), Iy._SceneComponentInitialization(this._scene), this._onEngineResizeObserver = this._engine.onResizeObservable.add(() => {
      this._initialize();
    });
  }
  /**
   * Reinitializes the class
   * Can be used if you change the object priority (FluidRenderingObject.priority), to make sure the objects are rendered in the right order
   */
  recreate() {
    this._sortRenderingObjects(), this._initialize();
  }
  /**
   * Gets the render object corresponding to a particle system (null if the particle system is not rendered as a fluid)
   * @param ps The particle system
   * @returns the render object corresponding to this particle system if any, otherwise null
   */
  getRenderObjectFromParticleSystem(e) {
    const t = this._getParticleSystemIndex(e);
    return t !== -1 ? this.renderObjects[t] : null;
  }
  /**
   * Adds a particle system to the fluid renderer.
   * @param ps particle system
   * @param generateDiffuseTexture True if you want to generate a diffuse texture from the particle system and use it as part of the fluid rendering (default: false)
   * @param targetRenderer The target renderer used to display the particle system as a fluid. If not provided, the method will create a new one
   * @param camera The camera used by the target renderer (if the target renderer is created by the method)
   * @returns the render object corresponding to the particle system
   */
  addParticleSystem(e, t, r, n) {
    const i = new vie(this._scene, e);
    i.onParticleSizeChanged.add(() => this._setParticleSizeForRenderTargets()), r || (r = new wF(this._scene, n), this.targetRenderers.push(r)), r._onUseVelocityChanged.hasObservers() || r._onUseVelocityChanged.add(() => this._setUseVelocityForRenderObject()), t !== void 0 && (r.generateDiffuseTexture = t);
    const s = { object: i, targetRenderer: r };
    return this.renderObjects.push(s), this._sortRenderingObjects(), this._setParticleSizeForRenderTargets(), s;
  }
  /**
   * Adds a custom particle set to the fluid renderer.
   * @param buffers The list of buffers (should contain at least a "position" buffer!)
   * @param numParticles Number of particles in each buffer
   * @param generateDiffuseTexture True if you want to generate a diffuse texture from buffers and use it as part of the fluid rendering (default: false). For the texture to be generated correctly, you need a "color" buffer in the set!
   * @param targetRenderer The target renderer used to display the particle system as a fluid. If not provided, the method will create a new one
   * @param camera The camera used by the target renderer (if the target renderer is created by the method)
   * @returns the render object corresponding to the custom particle set
   */
  addCustomParticles(e, t, r, n, i) {
    const s = new uie(this._scene, e, t);
    s.onParticleSizeChanged.add(() => this._setParticleSizeForRenderTargets()), n || (n = new wF(this._scene, i), this.targetRenderers.push(n)), n._onUseVelocityChanged.hasObservers() || n._onUseVelocityChanged.add(() => this._setUseVelocityForRenderObject()), r !== void 0 && (n.generateDiffuseTexture = r);
    const a = { object: s, targetRenderer: n };
    return this.renderObjects.push(a), this._sortRenderingObjects(), this._setParticleSizeForRenderTargets(), a;
  }
  /**
   * Removes a render object from the fluid renderer
   * @param renderObject the render object to remove
   * @param removeUnusedTargetRenderer True to remove/dispose of the target renderer if it's not used anymore (default: true)
   * @returns True if the render object has been found and released, else false
   */
  removeRenderObject(e, t = !0) {
    const r = this.renderObjects.indexOf(e);
    return r === -1 ? !1 : (e.object.dispose(), this.renderObjects.splice(r, 1), t && this._removeUnusedTargetRenderers() ? this._initialize() : this._setParticleSizeForRenderTargets(), !0);
  }
  _sortRenderingObjects() {
    this.renderObjects.sort((e, t) => e.object.priority < t.object.priority ? -1 : e.object.priority > t.object.priority ? 1 : 0);
  }
  _removeUnusedTargetRenderers() {
    const e = {};
    for (let n = 0; n < this.renderObjects.length; ++n) {
      const i = this.renderObjects[n].targetRenderer;
      e[this.targetRenderers.indexOf(i)] = !0;
    }
    let t = !1;
    const r = [];
    for (let n = 0; n < this.targetRenderers.length; ++n)
      e[n] ? r.push(this.targetRenderers[n]) : (this.targetRenderers[n].dispose(), t = !0);
    return t && (this.targetRenderers.length = 0, this.targetRenderers.push(...r)), t;
  }
  _getParticleSystemIndex(e) {
    for (let t = 0; t < this.renderObjects.length; ++t) {
      const r = this.renderObjects[t].object;
      if (YHe(r) && r.particleSystem === e)
        return t;
    }
    return -1;
  }
  _initialize() {
    for (let r = 0; r < this.targetRenderers.length; ++r)
      this.targetRenderers[r].dispose();
    const e = /* @__PURE__ */ new Map();
    for (let r = 0; r < this.targetRenderers.length; ++r) {
      const n = this.targetRenderers[r];
      if (n._initialize(), n.camera && n._renderPostProcess) {
        let i = e.get(n.camera);
        i || (i = [[], {}], e.set(n.camera, i)), i[0].push(n), n.camera.attachPostProcess(n._renderPostProcess, r);
      }
    }
    let t = e.keys();
    for (let r = t.next(); r.done !== !0; r = t.next()) {
      const n = r.value, i = e.get(n), s = n._getFirstPostProcess();
      if (!s)
        continue;
      const [a, f] = i;
      s.onSizeChangedObservable.add(() => {
        var o;
        s.inputTexture.depthStencilTexture || s.inputTexture.createDepthStencilTexture(0, !0, this._engine.isStencilEnable, a[0].samples, this._engine.isStencilEnable ? 13 : 14, `PostProcessRTTDepthStencil-${s.name}`);
        for (const d of a) {
          const v = (o = d._thicknessRenderTarget) === null || o === void 0 ? void 0 : o.renderTarget, u = v == null ? void 0 : v.texture;
          if (v && u) {
            const l = u.width + "_" + u.height;
            let P = f[l];
            P || (P = f[l] = new DHe(this._engine, u.width, u.height)), P.depthRTWrapper._shareDepth(v);
          }
        }
      });
    }
    t = this._cameras.keys();
    for (let r = t.next(); r.done !== !0; r = t.next()) {
      const n = r.value, s = this._cameras.get(n)[1], a = e.get(n);
      if (a)
        for (const f in s)
          a[1][f] || s[f].dispose();
      else
        for (const f in s)
          s[f].dispose();
    }
    this._cameras.clear(), this._cameras = e, this._setParticleSizeForRenderTargets();
  }
  _setParticleSizeForRenderTargets() {
    const e = /* @__PURE__ */ new Map();
    for (let t = 0; t < this.renderObjects.length; ++t) {
      const r = this.renderObjects[t];
      let n = e.get(r.targetRenderer);
      n === void 0 && (n = 0), e.set(r.targetRenderer, Math.max(n, r.object.particleSize));
    }
    e.forEach((t, r) => {
      r._depthRenderTarget && (r._depthRenderTarget.particleSize = t);
    });
  }
  _setUseVelocityForRenderObject() {
    for (const e of this.renderObjects)
      e.object.useVelocity = e.targetRenderer.useVelocity;
  }
  /** @internal */
  _prepareRendering() {
    for (const e of this.targetRenderers)
      if (e.needInitialization) {
        this._initialize();
        return;
      }
  }
  /** @internal */
  _render(e) {
    var t;
    for (let n = 0; n < this.targetRenderers.length; ++n)
      (!e || this.targetRenderers[n].camera === e) && this.targetRenderers[n]._clearTargets();
    const r = this._cameras.keys();
    for (let n = r.next(); n.done !== !0; n = r.next()) {
      const i = n.value, s = this._cameras.get(i);
      if (e && i !== e)
        continue;
      const a = i._getFirstPostProcess();
      if (!a)
        continue;
      const f = (t = a.inputTexture) === null || t === void 0 ? void 0 : t.depthStencilTexture;
      if (f) {
        const [o, d] = s;
        for (const v of o)
          v._bgDepthTexture = f;
        for (const v in d)
          d[v].copy(f);
      }
    }
    for (let n = 0; n < this.renderObjects.length; ++n) {
      const i = this.renderObjects[n];
      (!e || i.targetRenderer.camera === e) && i.targetRenderer._render(i.object);
    }
  }
  /**
   * Disposes of all the ressources used by the class
   */
  dispose() {
    this._engine.onResizeObservable.remove(this._onEngineResizeObserver), this._onEngineResizeObserver = null;
    for (let e = 0; e < this.renderObjects.length; ++e)
      this.renderObjects[e].object.dispose();
    for (let e = 0; e < this.targetRenderers.length; ++e)
      this.targetRenderers[e].dispose();
    this._cameras.forEach((e) => {
      const t = e[1];
      for (const r in t)
        t[r].dispose();
    }), this.renderObjects = [], this.targetRenderers = [], this._cameras.clear();
  }
}
class Fd {
  /**
   * Return the number of splattings used
   */
  get vertexCount() {
    return this._vertexCount;
  }
  /**
   * Shader material with alpha blending
   * @param scene parent scene
   */
  _createMaterial(e) {
    An.ShadersStore.customVertexShader = Fd._VertexShaderSource, An.ShadersStore.customFragmentShader = Fd._FragmentShaderSource;
    const t = new Zo("GaussianSplattingShader", e, {
      vertex: "custom",
      fragment: "custom"
    }, {
      attributes: ["position"],
      uniforms: ["projection", "modelView"]
    });
    t.backFaceCulling = !1, t.alpha = 0.9999, this._material = t;
  }
  /**
   *
   * @param scene parent scene
   * @returns A simple 2 triangles quad
   */
  _getMesh(e) {
    const t = new Ee(this.name, e), r = new Ut();
    return r.positions = [-2, -2, 0, 2, -2, 0, 2, 2, 0, -2, 2, 0], r.indices = [0, 1, 2, 0, 2, 3], r.applyToMesh(t), t.material = this._material, t.alwaysSelectAsActiveMesh = !0, t;
  }
  _setData(e) {
    this._vertexCount = e.length / 32;
    const r = this._vertexCount;
    this._positions = new Float32Array(3 * r), this._covA = new Float32Array(3 * r), this._covB = new Float32Array(3 * r);
    const n = new Float32Array(e.buffer);
    this._uBuffer = new Uint8Array(e.buffer);
    const i = he.Zero(), s = he.Zero(), a = Ze.Identity();
    for (let f = 0; f < r; f++) {
      this._positions[3 * f + 0] = n[8 * f + 0], this._positions[3 * f + 1] = -n[8 * f + 1], this._positions[3 * f + 2] = n[8 * f + 2], a.set((this._uBuffer[32 * f + 28 + 1] - 128) / 128, (this._uBuffer[32 * f + 28 + 2] - 128) / 128, (this._uBuffer[32 * f + 28 + 3] - 128) / 128, -(this._uBuffer[32 * f + 28 + 0] - 128) / 128), a.toRotationMatrix(i), he.ScalingToRef(n[8 * f + 3 + 0] * 2, n[8 * f + 3 + 1] * 2, n[8 * f + 3 + 2] * 2, s);
      const o = i.multiplyToRef(s, ue.Matrix[0]).m;
      this._covA[f * 3 + 0] = o[0] * o[0] + o[1] * o[1] + o[2] * o[2], this._covA[f * 3 + 1] = o[0] * o[4] + o[1] * o[5] + o[2] * o[6], this._covA[f * 3 + 2] = o[0] * o[8] + o[1] * o[9] + o[2] * o[10], this._covB[f * 3 + 0] = o[4] * o[4] + o[5] * o[5] + o[6] * o[6], this._covB[f * 3 + 1] = o[4] * o[8] + o[5] * o[9] + o[6] * o[10], this._covB[f * 3 + 2] = o[8] * o[8] + o[9] * o[9] + o[10] * o[10];
    }
  }
  /**
   * Construct a Gaussian Splatting proxy object
   * @param name name of the mesh used for rendering
   * @param scene scene it belongs to
   */
  constructor(e, t) {
    var r;
    this._vertexCount = 0, this._modelViewMatrix = he.Identity(), this.scene = t, this.name = e, this._createMaterial(t), (r = Fd._Worker) === null || r === void 0 || r.terminate(), Fd._Worker = null;
  }
  /**
   * Loads a .splat Gaussian Splatting file asynchronously
   * @param url path to the splat file to load
   * @returns a promise that resolves when the operation is complete
   */
  loadAsync(e) {
    return ye.LoadFileAsync(e, !0).then((t) => {
      this.mesh && this.dispose(), this._setData(new Uint8Array(t));
      const r = new Float32Array(this.vertexCount * 16), n = (i) => {
        var s;
        for (let a = 0; a < this.vertexCount; a++) {
          const f = i[2 * a], o = a * 16;
          r[o + 0] = this._positions[f * 3 + 0], r[o + 1] = this._positions[f * 3 + 1], r[o + 2] = this._positions[f * 3 + 2], r[o + 4] = this._uBuffer[32 * f + 24 + 0] / 255, r[o + 5] = this._uBuffer[32 * f + 24 + 1] / 255, r[o + 6] = this._uBuffer[32 * f + 24 + 2] / 255, r[o + 7] = this._uBuffer[32 * f + 24 + 3] / 255, r[o + 8] = this._covA[f * 3 + 0], r[o + 9] = this._covA[f * 3 + 1], r[o + 10] = this._covA[f * 3 + 2], r[o + 12] = this._covB[f * 3 + 0], r[o + 13] = this._covB[f * 3 + 1], r[o + 14] = this._covB[f * 3 + 2];
        }
        (s = this.mesh) === null || s === void 0 || s.thinInstanceBufferUpdated("matrix");
      };
      this.mesh = this._getMesh(this.scene), this.mesh.thinInstanceSetBuffer("matrix", r, 16, !1), Fd._Worker && (console.warn("Only one web worker possible. Previous Gaussian Splatting instance might not be rendered correctly."), Fd._Worker.terminate()), Fd._Worker = new Worker(URL.createObjectURL(new Blob(["(", Fd._CreateWorker.toString(), ")(self)"], {
        type: "application/javascript"
      }))), Fd._Worker.onmessage = (i) => {
        const s = new Uint32Array(i.data.depthMix.buffer);
        n(s);
      }, this._sceneBeforeRenderObserver = this.scene.onBeforeRenderObservable.add(() => {
        var i;
        const s = this.scene.getEngine();
        this._material.setVector2("viewport", new at(s.getRenderWidth(), s.getRenderHeight())), this.mesh.getWorldMatrix().multiplyToRef(this.scene.activeCamera.getViewMatrix(), this._modelViewMatrix), this._material.setMatrix("modelView", this._modelViewMatrix), (i = Fd._Worker) === null || i === void 0 || i.postMessage({ view: this._modelViewMatrix.m, positions: this._positions });
      }), this._sceneDisposeObserver = this.scene.onDisposeObservable.add(() => {
        this.dispose();
      });
    });
  }
  /**
   * Clear datas used for Gaussian Splatting and associated resources
   */
  dispose() {
    var e, t;
    this.scene.onDisposeObservable.remove(this._sceneDisposeObserver), this.scene.onBeforeRenderObservable.remove(this._sceneBeforeRenderObserver), (e = Fd._Worker) === null || e === void 0 || e.terminate(), Fd._Worker = null, (t = this.mesh) === null || t === void 0 || t.dispose(), this.mesh = null;
  }
}
Fd._Worker = null;
Fd._VertexShaderSource = `
        precision mediump float;
        attribute vec2 position;

        attribute vec4 world0;
        attribute vec4 world1;
        attribute vec4 world2;
        attribute vec4 world3;

        uniform mat4 projection, modelView;
        uniform vec2 viewport;

        varying vec4 vColor;
        varying vec2 vPosition;
        void main () {
        vec3 center = world0.xyz;
        vec4 color = world1;
        vec3 covA = world2.xyz;
        vec3 covB = world3.xyz;

        vec4 camspace = modelView * vec4(center, 1);
        vec4 pos2d = projection * camspace;

        float bounds = 1.2 * pos2d.w;
        if (pos2d.z < -pos2d.w || pos2d.x < -bounds || pos2d.x > bounds
            || pos2d.y < -bounds || pos2d.y > bounds) {
            gl_Position = vec4(0.0, 0.0, 2.0, 1.0);
            return;
        }

        mat3 Vrk = mat3(
            covA.x, covA.y, covA.z, 
            covA.y, covB.x, covB.y,
            covA.z, covB.y, covB.z
        );
        vec2 focal = vec2(1132., 1132.);
        mat3 J = mat3(
            focal.x / camspace.z, 0., -(focal.x * camspace.x) / (camspace.z * camspace.z), 
            0., focal.y / camspace.z, -(focal.y * camspace.y) / (camspace.z * camspace.z), 
            0., 0., 0.
        );

        mat3 invy = mat3(1,0,0, 0,-1,0,0,0,1);

        mat3 T = invy * transpose(mat3(modelView)) * J;
        mat3 cov2d = transpose(T) * Vrk * T;

        float mid = (cov2d[0][0] + cov2d[1][1]) / 2.0;
        float radius = length(vec2((cov2d[0][0] - cov2d[1][1]) / 2.0, cov2d[0][1]));
        float lambda1 = mid + radius, lambda2 = mid - radius;

        if(lambda2 < 0.0) return;
        vec2 diagonalVector = normalize(vec2(cov2d[0][1], lambda1 - cov2d[0][0]));
        vec2 majorAxis = min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector;
        vec2 minorAxis = min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x);

        vColor = color;
        vPosition = position;
        vec2 vCenter = vec2(pos2d);
        gl_Position = vec4(
            vCenter 
            + (position.x * majorAxis * 1. / viewport 
            + position.y * minorAxis * 1. / viewport) * pos2d.w, pos2d.zw);
        }`;
Fd._FragmentShaderSource = `
        precision highp float;
        varying vec4 vColor;
        varying vec2 vPosition;
        void main () {    
        float A = -dot(vPosition, vPosition);
        if (A < -4.0) discard;
        float B = exp(A) * vColor.a;
        gl_FragColor = vec4(vColor.rgb, B);
        }`;
Fd._CreateWorker = function(A) {
  let e, t = [], r = 0, n;
  const i = (f) => {
    r = n.length;
    const o = new BigInt64Array(r), d = new Uint32Array(o.buffer);
    for (let u = 0; u < r; u++)
      d[2 * u] = u;
    const v = new Float32Array(o.buffer);
    for (let u = 0; u < r; u++)
      v[2 * u + 1] = 1e4 - (f[2] * n[3 * u + 0] + f[6] * n[3 * u + 1] + f[10] * n[3 * u + 2]);
    t = f, o.sort(), A.postMessage({ depthMix: o }, [o.buffer]);
  };
  let s = !1;
  const a = () => {
    if (!s) {
      s = !0;
      const f = e;
      i(f), setTimeout(() => {
        s = !1, f !== e && a();
      }, 0);
    }
  };
  A.onmessage = (f) => {
    e = f.data.view;
    const o = t[2] * e[2] + t[6] * e[6] + t[10] * e[10];
    Math.abs(o - 1) < 0.01 || (n = f.data.positions, a());
  };
};
class MHe {
  /**
   * Returns a boolean indicating if the animation is started
   */
  get animationStarted() {
    return this._animationStarted;
  }
  /** Gets the initial key for the animation (setting it will restart the animation)  */
  get fromIndex() {
    return this._fromIndex;
  }
  /** Gets or sets the end key for the animation (setting it will restart the animation)  */
  get toIndex() {
    return this._toIndex;
  }
  /** Gets or sets a boolean indicating if the animation is looping (setting it will restart the animation)  */
  get loopAnimation() {
    return this._loopAnimation;
  }
  /** Gets or sets the delay between cell changes (setting it will restart the animation)  */
  get delay() {
    return Math.max(this._delay, 1);
  }
  /**
   * Creates a new Thin Sprite
   */
  constructor() {
    this.width = 1, this.height = 1, this.angle = 0, this.invertU = !1, this.invertV = !1, this.isVisible = !0, this._animationStarted = !1, this._loopAnimation = !1, this._fromIndex = 0, this._toIndex = 0, this._delay = 0, this._direction = 1, this._time = 0, this._onBaseAnimationEnd = null, this.position = { x: 1, y: 1, z: 1 }, this.color = { r: 1, g: 1, b: 1, a: 1 };
  }
  /**
   * Starts an animation
   * @param from defines the initial key
   * @param to defines the end key
   * @param loop defines if the animation must loop
   * @param delay defines the start delay (in ms)
   * @param onAnimationEnd defines a callback for when the animation ends
   */
  playAnimation(e, t, r, n, i) {
    this._fromIndex = e, this._toIndex = t, this._loopAnimation = r, this._delay = n || 1, this._animationStarted = !0, this._onBaseAnimationEnd = i, e < t ? this._direction = 1 : (this._direction = -1, this._toIndex = e, this._fromIndex = t), this.cellIndex = e, this._time = 0;
  }
  /** Stops current animation (if any) */
  stopAnimation() {
    this._animationStarted = !1;
  }
  /**
   * @internal
   */
  _animate(e) {
    this._animationStarted && (this._time += e, this._time > this._delay && (this._time = this._time % this._delay, this.cellIndex += this._direction, (this._direction > 0 && this.cellIndex > this._toIndex || this._direction < 0 && this.cellIndex < this._fromIndex) && (this._loopAnimation ? this.cellIndex = this._direction > 0 ? this._fromIndex : this._toIndex : (this.cellIndex = this._toIndex, this._animationStarted = !1, this._onBaseAnimationEnd && this._onBaseAnimationEnd()))));
  }
}
class Ry extends MHe {
  /**
   * Gets or sets the sprite size
   */
  get size() {
    return this.width;
  }
  set size(e) {
    this.width = e, this.height = e;
  }
  /**
   * Gets the manager of this sprite
   */
  get manager() {
    return this._manager;
  }
  /**
   * Creates a new Sprite
   * @param name defines the name
   * @param manager defines the manager
   */
  constructor(e, t) {
    super(), this.name = e, this.animations = new Array(), this.isPickable = !1, this.useAlphaForPicking = !1, this.onDisposeObservable = new Oe(), this._onAnimationEnd = null, this._endAnimation = () => {
      this._onAnimationEnd && this._onAnimationEnd(), this.disposeWhenFinishedAnimating && this.dispose();
    }, this.color = new xt(1, 1, 1, 1), this.position = S.Zero(), this._manager = t, this._manager.sprites.push(this), this.uniqueId = this._manager.scene.getUniqueId();
  }
  /**
   * Returns the string "Sprite"
   * @returns "Sprite"
   */
  getClassName() {
    return "Sprite";
  }
  /** Gets or sets the initial key for the animation (setting it will restart the animation)  */
  get fromIndex() {
    return this._fromIndex;
  }
  set fromIndex(e) {
    this.playAnimation(e, this._toIndex, this._loopAnimation, this._delay, this._onAnimationEnd);
  }
  /** Gets or sets the end key for the animation (setting it will restart the animation)  */
  get toIndex() {
    return this._toIndex;
  }
  set toIndex(e) {
    this.playAnimation(this._fromIndex, e, this._loopAnimation, this._delay, this._onAnimationEnd);
  }
  /** Gets or sets a boolean indicating if the animation is looping (setting it will restart the animation)  */
  get loopAnimation() {
    return this._loopAnimation;
  }
  set loopAnimation(e) {
    this.playAnimation(this._fromIndex, this._toIndex, e, this._delay, this._onAnimationEnd);
  }
  /** Gets or sets the delay between cell changes (setting it will restart the animation)  */
  get delay() {
    return Math.max(this._delay, 1);
  }
  set delay(e) {
    this.playAnimation(this._fromIndex, this._toIndex, this._loopAnimation, e, this._onAnimationEnd);
  }
  /**
   * Starts an animation
   * @param from defines the initial key
   * @param to defines the end key
   * @param loop defines if the animation must loop
   * @param delay defines the start delay (in ms)
   * @param onAnimationEnd defines a callback to call when animation ends
   */
  playAnimation(e, t, r, n, i = null) {
    this._onAnimationEnd = i, super.playAnimation(e, t, r, n, this._endAnimation);
  }
  /** Release associated resources */
  dispose() {
    for (let e = 0; e < this._manager.sprites.length; e++)
      this._manager.sprites[e] == this && this._manager.sprites.splice(e, 1);
    this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();
  }
  /**
   * Serializes the sprite to a JSON object
   * @returns the JSON object
   */
  serialize() {
    const e = {};
    return e.name = this.name, e.position = this.position.asArray(), e.color = this.color.asArray(), e.width = this.width, e.height = this.height, e.angle = this.angle, e.cellIndex = this.cellIndex, e.cellRef = this.cellRef, e.invertU = this.invertU, e.invertV = this.invertV, e.disposeWhenFinishedAnimating = this.disposeWhenFinishedAnimating, e.isPickable = this.isPickable, e.isVisible = this.isVisible, e.useAlphaForPicking = this.useAlphaForPicking, e.animationStarted = this.animationStarted, e.fromIndex = this.fromIndex, e.toIndex = this.toIndex, e.loopAnimation = this.loopAnimation, e.delay = this.delay, e;
  }
  /**
   * Parses a JSON object to create a new sprite
   * @param parsedSprite The JSON object to parse
   * @param manager defines the hosting manager
   * @returns the new sprite
   */
  static Parse(e, t) {
    const r = new Ry(e.name, t);
    return r.position = S.FromArray(e.position), r.color = xt.FromArray(e.color), r.width = e.width, r.height = e.height, r.angle = e.angle, r.cellIndex = e.cellIndex, r.cellRef = e.cellRef, r.invertU = e.invertU, r.invertV = e.invertV, r.disposeWhenFinishedAnimating = e.disposeWhenFinishedAnimating, r.isPickable = e.isPickable, r.isVisible = e.isVisible, r.useAlphaForPicking = e.useAlphaForPicking, r._fromIndex = e.fromIndex, r._toIndex = e.toIndex, r._loopAnimation = e.loopAnimation, r._delay = e.delay, e.animationStarted && r.playAnimation(r.fromIndex, r.toIndex, r.loopAnimation, r.delay), r;
  }
}
sr.prototype._internalPickSprites = function(A, e, t, r) {
  if (!F9)
    return null;
  let n = null;
  if (!r) {
    if (!this.activeCamera)
      return null;
    r = this.activeCamera;
  }
  if (this.spriteManagers && this.spriteManagers.length > 0)
    for (let i = 0; i < this.spriteManagers.length; i++) {
      const s = this.spriteManagers[i];
      if (!s.isPickable)
        continue;
      const a = s.intersects(A, r, e, t);
      if (!(!a || !a.hit) && !(!t && n != null && a.distance >= n.distance) && (n = a, t))
        break;
    }
  return n || new F9();
};
sr.prototype._internalMultiPickSprites = function(A, e, t) {
  if (!F9)
    return null;
  let r = [];
  if (!t) {
    if (!this.activeCamera)
      return null;
    t = this.activeCamera;
  }
  if (this.spriteManagers && this.spriteManagers.length > 0)
    for (let n = 0; n < this.spriteManagers.length; n++) {
      const i = this.spriteManagers[n];
      if (!i.isPickable)
        continue;
      const s = i.multiIntersects(A, t, e);
      s !== null && (r = r.concat(s));
    }
  return r;
};
sr.prototype.pickSprite = function(A, e, t, r, n) {
  if (!this._tempSpritePickingRay)
    return null;
  this.createPickingRayInCameraSpaceToRef(A, e, this._tempSpritePickingRay, n);
  const i = this._internalPickSprites(this._tempSpritePickingRay, t, r, n);
  return i && (i.ray = this.createPickingRayInCameraSpace(A, e, n)), i;
};
sr.prototype.pickSpriteWithRay = function(A, e, t, r) {
  if (!this._tempSpritePickingRay)
    return null;
  if (!r) {
    if (!this.activeCamera)
      return null;
    r = this.activeCamera;
  }
  Hi.TransformToRef(A, r.getViewMatrix(), this._tempSpritePickingRay);
  const n = this._internalPickSprites(this._tempSpritePickingRay, e, t, r);
  return n && (n.ray = A), n;
};
sr.prototype.multiPickSprite = function(A, e, t, r) {
  return this.createPickingRayInCameraSpaceToRef(A, e, this._tempSpritePickingRay, r), this._internalMultiPickSprites(this._tempSpritePickingRay, t, r);
};
sr.prototype.multiPickSpriteWithRay = function(A, e, t) {
  if (!this._tempSpritePickingRay)
    return null;
  if (!t) {
    if (!this.activeCamera)
      return null;
    t = this.activeCamera;
  }
  return Hi.TransformToRef(A, t.getViewMatrix(), this._tempSpritePickingRay), this._internalMultiPickSprites(this._tempSpritePickingRay, e, t);
};
sr.prototype.setPointerOverSprite = function(A) {
  this._pointerOverSprite !== A && (this._pointerOverSprite && this._pointerOverSprite.actionManager && this._pointerOverSprite.actionManager.processTrigger(10, mo.CreateNewFromSprite(this._pointerOverSprite, this)), this._pointerOverSprite = A, this._pointerOverSprite && this._pointerOverSprite.actionManager && this._pointerOverSprite.actionManager.processTrigger(9, mo.CreateNewFromSprite(this._pointerOverSprite, this)));
};
sr.prototype.getPointerOverSprite = function() {
  return this._pointerOverSprite;
};
class cie {
  /**
   * Creates a new instance of the component for the given scene
   * @param scene Defines the scene to register the component in
   */
  constructor(e) {
    this.name = Ot.NAME_SPRITE, this.scene = e, this.scene.spriteManagers = [], this.scene._tempSpritePickingRay = Hi ? Hi.Zero() : null, this.scene.onBeforeSpritesRenderingObservable = new Oe(), this.scene.onAfterSpritesRenderingObservable = new Oe(), this._spritePredicate = (t) => t.actionManager ? t.isPickable && t.actionManager.hasPointerTriggers : !1;
  }
  /**
   * Registers the component in a given scene
   */
  register() {
    this.scene._pointerMoveStage.registerStep(Ot.STEP_POINTERMOVE_SPRITE, this, this._pointerMove), this.scene._pointerDownStage.registerStep(Ot.STEP_POINTERDOWN_SPRITE, this, this._pointerDown), this.scene._pointerUpStage.registerStep(Ot.STEP_POINTERUP_SPRITE, this, this._pointerUp);
  }
  /**
   * Rebuilds the elements related to this component in case of
   * context lost for instance.
   */
  rebuild() {
  }
  /**
   * Disposes the component and the associated resources.
   */
  dispose() {
    this.scene.onBeforeSpritesRenderingObservable.clear(), this.scene.onAfterSpritesRenderingObservable.clear();
    const e = this.scene.spriteManagers;
    if (e)
      for (; e.length; )
        e[0].dispose();
  }
  _pickSpriteButKeepRay(e, t, r, n, i) {
    const s = this.scene.pickSprite(t, r, this._spritePredicate, n, i);
    return s && (s.ray = e ? e.ray : null), s;
  }
  _pointerMove(e, t, r, n, i) {
    const s = this.scene;
    return n ? s.setPointerOverSprite(null) : (r = this._pickSpriteButKeepRay(r, e, t, !1, s.cameraToUseForPointers || void 0), r && r.hit && r.pickedSprite ? (s.setPointerOverSprite(r.pickedSprite), !s.doNotHandleCursors && i && (s._pointerOverSprite && s._pointerOverSprite.actionManager && s._pointerOverSprite.actionManager.hoverCursor ? i.style.cursor = s._pointerOverSprite.actionManager.hoverCursor : i.style.cursor = s.hoverCursor)) : s.setPointerOverSprite(null)), r;
  }
  _pointerDown(e, t, r, n) {
    const i = this.scene;
    if (i._pickedDownSprite = null, i.spriteManagers && i.spriteManagers.length > 0 && (r = i.pickSprite(e, t, this._spritePredicate, !1, i.cameraToUseForPointers || void 0), r && r.hit && r.pickedSprite && r.pickedSprite.actionManager)) {
      switch (i._pickedDownSprite = r.pickedSprite, n.button) {
        case 0:
          r.pickedSprite.actionManager.processTrigger(2, mo.CreateNewFromSprite(r.pickedSprite, i, n));
          break;
        case 1:
          r.pickedSprite.actionManager.processTrigger(4, mo.CreateNewFromSprite(r.pickedSprite, i, n));
          break;
        case 2:
          r.pickedSprite.actionManager.processTrigger(3, mo.CreateNewFromSprite(r.pickedSprite, i, n));
          break;
      }
      r.pickedSprite.actionManager && r.pickedSprite.actionManager.processTrigger(5, mo.CreateNewFromSprite(r.pickedSprite, i, n));
    }
    return r;
  }
  _pointerUp(e, t, r, n, i) {
    const s = this.scene;
    if (s.spriteManagers && s.spriteManagers.length > 0) {
      const a = s.pickSprite(e, t, this._spritePredicate, !1, s.cameraToUseForPointers || void 0);
      a && (a.hit && a.pickedSprite && a.pickedSprite.actionManager && (a.pickedSprite.actionManager.processTrigger(7, mo.CreateNewFromSprite(a.pickedSprite, s, n)), a.pickedSprite.actionManager && (this.scene._inputManager._isPointerSwiping() || a.pickedSprite.actionManager.processTrigger(1, mo.CreateNewFromSprite(a.pickedSprite, s, n)), i && a.pickedSprite.actionManager.processTrigger(6, mo.CreateNewFromSprite(a.pickedSprite, s, n)))), s._pickedDownSprite && s._pickedDownSprite.actionManager && s._pickedDownSprite !== a.pickedSprite && s._pickedDownSprite.actionManager.processTrigger(16, mo.CreateNewFromSprite(s._pickedDownSprite, s, n)));
    }
    return r;
  }
}
const LHe = "imageProcessingCompatibility", KHe = `#ifdef IMAGEPROCESSINGPOSTPROCESS
gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(2.2));
#endif
`;
Le.IncludesShadersStore[LHe] = KHe;
const JHe = "spritesPixelShader", zHe = `uniform bool alphaTest;varying vec4 vColor;varying vec2 vUV;uniform sampler2D diffuseSampler;
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
#ifdef PIXEL_PERFECT
vec2 uvPixelPerfect(vec2 uv) {vec2 res=vec2(textureSize(diffuseSampler,0));uv=uv*res;vec2 seam=floor(uv+0.5);uv=seam+clamp((uv-seam)/fwidth(uv),-0.5,0.5);return uv/res;}
#endif
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#ifdef PIXEL_PERFECT
vec2 uv=uvPixelPerfect(vUV);
#else
vec2 uv=vUV;
#endif
vec4 color=texture2D(diffuseSampler,uv);float fAlphaTest=float(alphaTest);if (fAlphaTest != 0.)
{if (color.a<0.95)
discard;}
color*=vColor;
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[JHe] = zHe;
const GHe = "spritesVertexShader", ZHe = `attribute vec4 position;attribute vec2 options;attribute vec2 offsets;attribute vec2 inverts;attribute vec4 cellInfo;attribute vec4 color;uniform mat4 view;uniform mat4 projection;varying vec2 vUV;varying vec4 vColor;
#include<fogVertexDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 viewPos=(view*vec4(position.xyz,1.0)).xyz; 
vec2 cornerPos;float angle=position.w;vec2 size=vec2(options.x,options.y);vec2 offset=offsets.xy;cornerPos=vec2(offset.x-0.5,offset.y -0.5)*size;vec3 rotatedCorner;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;viewPos+=rotatedCorner;gl_Position=projection*vec4(viewPos,1.0); 
vColor=color;vec2 uvOffset=vec2(abs(offset.x-inverts.x),abs(1.0-offset.y-inverts.y));vec2 uvPlace=cellInfo.xy;vec2 uvSize=cellInfo.zw;vUV.x=uvPlace.x+uvSize.x*uvOffset.x;vUV.y=uvPlace.y+uvSize.y*uvOffset.y;
#ifdef FOG
vFogDistance=viewPos;
#endif
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[GHe] = ZHe;
class _He {
  /**
   * Gets the capacity of the manager
   */
  get capacity() {
    return this._capacity;
  }
  /**
   * Gets or sets a boolean indicating if the renderer must render sprites with pixel perfect rendering
   * Note that pixel perfect mode is not supported in WebGL 1
   */
  get pixelPerfect() {
    return this._pixelPerfect;
  }
  set pixelPerfect(e) {
    this._pixelPerfect !== e && (this._pixelPerfect = e, this._createEffects());
  }
  /**
   * Creates a new sprite Renderer
   * @param engine defines the engine the renderer works with
   * @param capacity defines the maximum allowed number of sprites
   * @param epsilon defines the epsilon value to align texture (0.01 by default)
   * @param scene defines the hosting scene
   */
  constructor(e, t, r = 0.01, n = null) {
    this.blendMode = 2, this.autoResetAlpha = !0, this.disableDepthWrite = !1, this.fogEnabled = !0, this._pixelPerfect = !1, this._useVAO = !1, this._useInstancing = !1, this._vertexBuffers = {}, this._capacity = t, this._epsilon = r, this._engine = e, this._useInstancing = e.getCaps().instancedArrays && e._features.supportSpriteInstancing, this._useVAO = e.getCaps().vertexArrayObject && !e.disableVertexArrayObjects, this._scene = n, this._useInstancing || this._buildIndexBuffer(), this._vertexBufferSize = this._useInstancing ? 16 : 18, this._vertexData = new Float32Array(t * this._vertexBufferSize * (this._useInstancing ? 1 : 4)), this._buffer = new P9(e, this._vertexData, !0, this._vertexBufferSize);
    const i = this._buffer.createVertexBuffer(J.PositionKind, 0, 4, this._vertexBufferSize, this._useInstancing), s = this._buffer.createVertexBuffer("options", 4, 2, this._vertexBufferSize, this._useInstancing);
    let a = 6, f;
    if (this._useInstancing) {
      const u = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]);
      this._spriteBuffer = new P9(e, u, !1, 2), f = this._spriteBuffer.createVertexBuffer("offsets", 0, 2);
    } else
      f = this._buffer.createVertexBuffer("offsets", a, 2, this._vertexBufferSize, this._useInstancing), a += 2;
    const o = this._buffer.createVertexBuffer("inverts", a, 2, this._vertexBufferSize, this._useInstancing), d = this._buffer.createVertexBuffer("cellInfo", a + 2, 4, this._vertexBufferSize, this._useInstancing), v = this._buffer.createVertexBuffer(J.ColorKind, a + 6, 4, this._vertexBufferSize, this._useInstancing);
    this._vertexBuffers[J.PositionKind] = i, this._vertexBuffers.options = s, this._vertexBuffers.offsets = f, this._vertexBuffers.inverts = o, this._vertexBuffers.cellInfo = d, this._vertexBuffers[J.ColorKind] = v, this._createEffects();
  }
  _createEffects() {
    var e, t, r, n;
    (e = this._drawWrapperBase) === null || e === void 0 || e.dispose(), (t = this._drawWrapperFog) === null || t === void 0 || t.dispose(), (r = this._drawWrapperDepth) === null || r === void 0 || r.dispose(), (n = this._drawWrapperFogDepth) === null || n === void 0 || n.dispose(), this._drawWrapperBase = new zo(this._engine), this._drawWrapperFog = new zo(this._engine), this._drawWrapperDepth = new zo(this._engine, !1), this._drawWrapperFogDepth = new zo(this._engine, !1), this._drawWrapperBase.drawContext && (this._drawWrapperBase.drawContext.useInstancing = this._useInstancing), this._drawWrapperFog.drawContext && (this._drawWrapperFog.drawContext.useInstancing = this._useInstancing), this._drawWrapperDepth.drawContext && (this._drawWrapperDepth.drawContext.useInstancing = this._useInstancing), this._drawWrapperFogDepth.drawContext && (this._drawWrapperFogDepth.drawContext.useInstancing = this._useInstancing);
    const i = this._pixelPerfect ? `#define PIXEL_PERFECT
` : "";
    this._drawWrapperBase.effect = this._engine.createEffect("sprites", [J.PositionKind, "options", "offsets", "inverts", "cellInfo", J.ColorKind], ["view", "projection", "textureInfos", "alphaTest"], ["diffuseSampler"], i), this._drawWrapperDepth.effect = this._drawWrapperBase.effect, this._drawWrapperDepth.materialContext = this._drawWrapperBase.materialContext, this._scene && (this._drawWrapperFog.effect = this._scene.getEngine().createEffect("sprites", [J.PositionKind, "options", "offsets", "inverts", "cellInfo", J.ColorKind], ["view", "projection", "textureInfos", "alphaTest", "vFogInfos", "vFogColor"], ["diffuseSampler"], i + "#define FOG"), this._drawWrapperFogDepth.effect = this._drawWrapperFog.effect, this._drawWrapperFogDepth.materialContext = this._drawWrapperFog.materialContext);
  }
  /**
   * Render all child sprites
   * @param sprites defines the list of sprites to render
   * @param deltaTime defines the time since last frame
   * @param viewMatrix defines the viewMatrix to use to render the sprites
   * @param projectionMatrix defines the projectionMatrix to use to render the sprites
   * @param customSpriteUpdate defines a custom function to update the sprites data before they render
   */
  render(e, t, r, n, i = null) {
    if (!this.texture || !this.texture.isReady() || !e.length)
      return;
    let s = this._drawWrapperBase, a = this._drawWrapperDepth, f = !1;
    this.fogEnabled && this._scene && this._scene.fogEnabled && this._scene.fogMode !== 0 && (s = this._drawWrapperFog, a = this._drawWrapperFogDepth, f = !0);
    const o = s.effect;
    if (!o.isReady())
      return;
    const d = this._engine, v = !!(this._scene && this._scene.useRightHandedSystem), u = this.texture.getBaseSize(), l = Math.min(this._capacity, e.length);
    let P = 0, p = !0;
    for (let q = 0; q < l; q++) {
      const b = e[q];
      !b || !b.isVisible || (p = !1, b._animate(t), this._appendSpriteVertex(P++, b, 0, 0, u, v, i), this._useInstancing || (this._appendSpriteVertex(P++, b, 1, 0, u, v, i), this._appendSpriteVertex(P++, b, 1, 1, u, v, i), this._appendSpriteVertex(P++, b, 0, 1, u, v, i)));
    }
    if (p)
      return;
    this._buffer.update(this._vertexData);
    const c = !!d.depthCullingState.cull, H = d.depthCullingState.zOffset, T = d.depthCullingState.zOffsetUnits;
    if (d.setState(c, H, !1, !1, void 0, void 0, T), d.enableEffect(s), o.setTexture("diffuseSampler", this.texture), o.setMatrix("view", r), o.setMatrix("projection", n), f) {
      const q = this._scene;
      o.setFloat4("vFogInfos", q.fogMode, q.fogStart, q.fogEnd, q.fogDensity), o.setColor3("vFogColor", q.fogColor);
    }
    this._useVAO ? (this._vertexArrayObject || (this._vertexArrayObject = d.recordVertexArrayObject(this._vertexBuffers, this._indexBuffer, o)), d.bindVertexArrayObject(this._vertexArrayObject, this._indexBuffer)) : d.bindBuffers(this._vertexBuffers, this._indexBuffer, o), d.depthCullingState.depthFunc = d.useReverseDepthBuffer ? 518 : 515, this.disableDepthWrite || (o.setBool("alphaTest", !0), d.setColorWrite(!1), d.enableEffect(a), this._useInstancing ? d.drawArraysType(7, 0, 4, P) : d.drawElementsType(0, 0, P / 4 * 6), d.enableEffect(s), d.setColorWrite(!0), o.setBool("alphaTest", !1)), d.setAlphaMode(this.blendMode), this._useInstancing ? d.drawArraysType(7, 0, 4, P) : d.drawElementsType(0, 0, P / 4 * 6), this.autoResetAlpha && d.setAlphaMode(0), v && this._scene.getEngine().setState(c, H, !1, !0, void 0, void 0, T), d.unbindInstanceAttributes();
  }
  _appendSpriteVertex(e, t, r, n, i, s, a) {
    let f = e * this._vertexBufferSize;
    if (r === 0 ? r = this._epsilon : r === 1 && (r = 1 - this._epsilon), n === 0 ? n = this._epsilon : n === 1 && (n = 1 - this._epsilon), a)
      a(t, i);
    else {
      t.cellIndex || (t.cellIndex = 0);
      const o = i.width / this.cellWidth, d = t.cellIndex / o >> 0;
      t._xOffset = (t.cellIndex - d * o) * this.cellWidth / i.width, t._yOffset = d * this.cellHeight / i.height, t._xSize = this.cellWidth, t._ySize = this.cellHeight;
    }
    this._vertexData[f] = t.position.x, this._vertexData[f + 1] = t.position.y, this._vertexData[f + 2] = t.position.z, this._vertexData[f + 3] = t.angle, this._vertexData[f + 4] = t.width, this._vertexData[f + 5] = t.height, this._useInstancing ? f -= 2 : (this._vertexData[f + 6] = r, this._vertexData[f + 7] = n), s ? this._vertexData[f + 8] = t.invertU ? 0 : 1 : this._vertexData[f + 8] = t.invertU ? 1 : 0, this._vertexData[f + 9] = t.invertV ? 1 : 0, this._vertexData[f + 10] = t._xOffset, this._vertexData[f + 11] = t._yOffset, this._vertexData[f + 12] = t._xSize / i.width, this._vertexData[f + 13] = t._ySize / i.height, this._vertexData[f + 14] = t.color.r, this._vertexData[f + 15] = t.color.g, this._vertexData[f + 16] = t.color.b, this._vertexData[f + 17] = t.color.a;
  }
  _buildIndexBuffer() {
    const e = [];
    let t = 0;
    for (let r = 0; r < this._capacity; r++)
      e.push(t), e.push(t + 1), e.push(t + 2), e.push(t), e.push(t + 2), e.push(t + 3), t += 4;
    this._indexBuffer = this._engine.createIndexBuffer(e);
  }
  /**
   * Rebuilds the renderer (after a context lost, for eg)
   */
  rebuild() {
    var e;
    this._indexBuffer && this._buildIndexBuffer(), this._useVAO && (this._vertexArrayObject = void 0), this._buffer._rebuild();
    for (const t in this._vertexBuffers)
      this._vertexBuffers[t]._rebuild();
    (e = this._spriteBuffer) === null || e === void 0 || e._rebuild();
  }
  /**
   * Release associated resources
   */
  dispose() {
    this._buffer && (this._buffer.dispose(), this._buffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._indexBuffer && (this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), this.texture && (this.texture.dispose(), this.texture = null), this._drawWrapperBase.dispose(), this._drawWrapperFog.dispose(), this._drawWrapperDepth.dispose(), this._drawWrapperFogDepth.dispose();
  }
}
class z2 {
  /**
   * Callback called when the manager is disposed
   */
  set onDispose(e) {
    this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);
  }
  /**
   * Gets the array of sprites
   */
  get children() {
    return this.sprites;
  }
  /**
   * Gets the hosting scene
   */
  get scene() {
    return this._scene;
  }
  /**
   * Gets the capacity of the manager
   */
  get capacity() {
    return this._spriteRenderer.capacity;
  }
  /**
   * Gets or sets the spritesheet texture
   */
  get texture() {
    return this._spriteRenderer.texture;
  }
  set texture(e) {
    e.wrapU = We.CLAMP_ADDRESSMODE, e.wrapV = We.CLAMP_ADDRESSMODE, this._spriteRenderer.texture = e, this._textureContent = null;
  }
  /** Defines the default width of a cell in the spritesheet */
  get cellWidth() {
    return this._spriteRenderer.cellWidth;
  }
  set cellWidth(e) {
    this._spriteRenderer.cellWidth = e;
  }
  /** Defines the default height of a cell in the spritesheet */
  get cellHeight() {
    return this._spriteRenderer.cellHeight;
  }
  set cellHeight(e) {
    this._spriteRenderer.cellHeight = e;
  }
  /** Gets or sets a boolean indicating if the manager must consider scene fog when rendering */
  get fogEnabled() {
    return this._spriteRenderer.fogEnabled;
  }
  set fogEnabled(e) {
    this._spriteRenderer.fogEnabled = e;
  }
  /**
   * Blend mode use to render the particle, it can be any of
   * the static undefined properties provided in this class.
   * Default value is 2
   */
  get blendMode() {
    return this._spriteRenderer.blendMode;
  }
  set blendMode(e) {
    this._spriteRenderer.blendMode = e;
  }
  /** Disables writing to the depth buffer when rendering the sprites.
   *  It can be handy to disable depth writing when using textures without alpha channel
   *  and setting some specific blend modes.
   */
  get disableDepthWrite() {
    return this._disableDepthWrite;
  }
  set disableDepthWrite(e) {
    this._disableDepthWrite = e, this._spriteRenderer.disableDepthWrite = e;
  }
  /**
   * Gets or sets a boolean indicating if the renderer must render sprites with pixel perfect rendering
   * In this mode, sprites are rendered as "pixel art", which means that they appear as pixelated but remain stable when moving or when rotated or scaled.
   * Note that for this mode to work as expected, the sprite texture must use the BILINEAR sampling mode, not NEAREST!
   */
  get pixelPerfect() {
    return this._spriteRenderer.pixelPerfect;
  }
  set pixelPerfect(e) {
    this._spriteRenderer.pixelPerfect = e, e && this.texture.samplingMode !== 3 && this.texture.updateSamplingMode(3);
  }
  /**
   * Creates a new sprite manager
   * @param name defines the manager's name
   * @param imgUrl defines the sprite sheet url
   * @param capacity defines the maximum allowed number of sprites
   * @param cellSize defines the size of a sprite cell
   * @param scene defines the hosting scene
   * @param epsilon defines the epsilon value to align texture (0.01 by default)
   * @param samplingMode defines the sampling mode to use with spritesheet
   * @param fromPacked set to false; do not alter
   * @param spriteJSON null otherwise a JSON object defining sprite sheet data; do not alter
   */
  constructor(e, t, r, n, i, s = 0.01, a = We.TRILINEAR_SAMPLINGMODE, f = !1, o = null) {
    this.name = e, this.sprites = [], this.renderingGroupId = 0, this.layerMask = 268435455, this.isPickable = !1, this.metadata = null, this._wasDispatched = !1, this.onDisposeObservable = new Oe(), this._disableDepthWrite = !1, this._packedAndReady = !1, this._customUpdate = (v, u) => {
      v.cellRef || (v.cellIndex = 0);
      const l = v.cellIndex;
      typeof l == "number" && isFinite(l) && Math.floor(l) === l && (v.cellRef = this._spriteMap[v.cellIndex]), v._xOffset = this._cellData[v.cellRef].frame.x / u.width, v._yOffset = this._cellData[v.cellRef].frame.y / u.height, v._xSize = this._cellData[v.cellRef].frame.w, v._ySize = this._cellData[v.cellRef].frame.h;
    }, i || (i = gr.LastCreatedScene), i._getComponent(Ot.NAME_SPRITE) || i._addComponent(new cie(i)), this._fromPacked = f, this._scene = i;
    const d = this._scene.getEngine();
    if (this._spriteRenderer = new _He(d, r, s, i), n.width && n.height)
      this.cellWidth = n.width, this.cellHeight = n.height;
    else if (n !== void 0)
      this.cellWidth = n, this.cellHeight = n;
    else {
      this._spriteRenderer = null;
      return;
    }
    this._scene.spriteManagers && this._scene.spriteManagers.push(this), this.uniqueId = this.scene.getUniqueId(), t && (this.texture = new We(t, i, !0, !1, a)), this._fromPacked && this._makePacked(t, o);
  }
  /**
   * Returns the string "SpriteManager"
   * @returns "SpriteManager"
   */
  getClassName() {
    return "SpriteManager";
  }
  _makePacked(e, t) {
    if (t !== null)
      try {
        let r;
        if (typeof t == "string" ? r = JSON.parse(t) : r = t, r.frames.length) {
          const i = {};
          for (let s = 0; s < r.frames.length; s++) {
            const a = r.frames[s];
            if (typeof Object.keys(a)[0] != "string")
              throw new Error("Invalid JSON Format.  Check the frame values and make sure the name is the first parameter.");
            const f = a[Object.keys(a)[0]];
            i[f] = a;
          }
          r.frames = i;
        }
        const n = Reflect.ownKeys(r.frames);
        this._spriteMap = n, this._packedAndReady = !0, this._cellData = r.frames;
      } catch {
        throw this._fromPacked = !1, this._packedAndReady = !1, new Error("Invalid JSON from string. Spritesheet managed with constant cell size.");
      }
    else {
      const r = /\./g;
      let n;
      do
        n = r.lastIndex, r.test(e);
      while (r.lastIndex > 0);
      const i = e.substring(0, n - 1) + ".json", s = () => {
        Se.Error("JSON ERROR: Unable to load JSON file."), this._fromPacked = !1, this._packedAndReady = !1;
      }, a = (f) => {
        try {
          const o = JSON.parse(f), d = Reflect.ownKeys(o.frames);
          this._spriteMap = d, this._packedAndReady = !0, this._cellData = o.frames;
        } catch {
          throw this._fromPacked = !1, this._packedAndReady = !1, new Error("Invalid JSON format. Please check documentation for format specifications.");
        }
      };
      ye.LoadFile(i, a, void 0, void 0, !1, s);
    }
  }
  _checkTextureAlpha(e, t, r, n, i) {
    if (!e.useAlphaForPicking || !this.texture)
      return !0;
    const s = this.texture.getSize();
    this._textureContent || (this._textureContent = new Uint8Array(s.width * s.height * 4), this.texture.readPixels(0, 0, this._textureContent));
    const a = ue.Vector3[0];
    a.copyFrom(t.direction), a.normalize(), a.scaleInPlace(r), a.addInPlace(t.origin);
    const f = (a.x - n.x) / (i.x - n.x), o = 1 - (a.y - n.y) / (i.y - n.y), d = e._xOffset * s.width + f * e._xSize | 0, v = e._yOffset * s.height + o * e._ySize | 0;
    return this._textureContent[(d + v * s.width) * 4 + 3] > 0.5;
  }
  /**
   * Intersects the sprites with a ray
   * @param ray defines the ray to intersect with
   * @param camera defines the current active camera
   * @param predicate defines a predicate used to select candidate sprites
   * @param fastCheck defines if a fast check only must be done (the first potential sprite is will be used and not the closer)
   * @returns null if no hit or a PickingInfo
   */
  intersects(e, t, r, n) {
    const i = Math.min(this.capacity, this.sprites.length), s = S.Zero(), a = S.Zero();
    let f = Number.MAX_VALUE, o = null;
    const d = ue.Vector3[0], v = ue.Vector3[1], u = t.getViewMatrix();
    let l = e, P = e;
    for (let p = 0; p < i; p++) {
      const c = this.sprites[p];
      if (c) {
        if (r) {
          if (!r(c))
            continue;
        } else if (!c.isPickable)
          continue;
        if (S.TransformCoordinatesToRef(c.position, u, v), c.angle ? (he.TranslationToRef(-v.x, -v.y, 0, ue.Matrix[1]), he.TranslationToRef(v.x, v.y, 0, ue.Matrix[2]), he.RotationZToRef(-c.angle, ue.Matrix[3]), ue.Matrix[1].multiplyToRef(ue.Matrix[3], ue.Matrix[4]), ue.Matrix[4].multiplyToRef(ue.Matrix[2], ue.Matrix[0]), l = e.clone(), S.TransformCoordinatesToRef(e.origin, ue.Matrix[0], l.origin), S.TransformNormalToRef(e.direction, ue.Matrix[0], l.direction)) : l = e, s.copyFromFloats(v.x - c.width / 2, v.y - c.height / 2, v.z), a.copyFromFloats(v.x + c.width / 2, v.y + c.height / 2, v.z), l.intersectsBoxMinMax(s, a)) {
          const H = S.Distance(v, l.origin);
          if (f > H) {
            if (!this._checkTextureAlpha(c, l, H, s, a))
              continue;
            if (P = l, f = H, o = c, n)
              break;
          }
        }
      }
    }
    if (o) {
      const p = new F9();
      u.invertToRef(ue.Matrix[0]), p.hit = !0, p.pickedSprite = o, p.distance = f;
      const c = ue.Vector3[2];
      return c.copyFrom(P.direction), c.normalize(), c.scaleInPlace(f), P.origin.addToRef(c, d), p.pickedPoint = S.TransformCoordinates(d, ue.Matrix[0]), p;
    }
    return null;
  }
  /**
   * Intersects the sprites with a ray
   * @param ray defines the ray to intersect with
   * @param camera defines the current active camera
   * @param predicate defines a predicate used to select candidate sprites
   * @returns null if no hit or a PickingInfo array
   */
  multiIntersects(e, t, r) {
    const n = Math.min(this.capacity, this.sprites.length), i = S.Zero(), s = S.Zero();
    let a;
    const f = [], o = ue.Vector3[0].copyFromFloats(0, 0, 0), d = ue.Vector3[1].copyFromFloats(0, 0, 0), v = t.getViewMatrix();
    for (let u = 0; u < n; u++) {
      const l = this.sprites[u];
      if (l) {
        if (r) {
          if (!r(l))
            continue;
        } else if (!l.isPickable)
          continue;
        if (S.TransformCoordinatesToRef(l.position, v, d), i.copyFromFloats(d.x - l.width / 2, d.y - l.height / 2, d.z), s.copyFromFloats(d.x + l.width / 2, d.y + l.height / 2, d.z), e.intersectsBoxMinMax(i, s)) {
          if (a = S.Distance(d, e.origin), !this._checkTextureAlpha(l, e, a, i, s))
            continue;
          const P = new F9();
          f.push(P), v.invertToRef(ue.Matrix[0]), P.hit = !0, P.pickedSprite = l, P.distance = a;
          const p = ue.Vector3[2];
          p.copyFrom(e.direction), p.normalize(), p.scaleInPlace(a), e.origin.addToRef(p, o), P.pickedPoint = S.TransformCoordinates(o, ue.Matrix[0]);
        }
      }
    }
    return f;
  }
  /**
   * Render all child sprites
   */
  render() {
    if (this._fromPacked && (!this._packedAndReady || !this._spriteMap || !this._cellData))
      return;
    const t = this._scene.getEngine().getDeltaTime();
    this._packedAndReady ? this._spriteRenderer.render(this.sprites, t, this._scene.getViewMatrix(), this._scene.getProjectionMatrix(), this._customUpdate) : this._spriteRenderer.render(this.sprites, t, this._scene.getViewMatrix(), this._scene.getProjectionMatrix());
  }
  /**
   * Rebuilds the manager (after a context lost, for eg)
   */
  rebuild() {
    var e;
    (e = this._spriteRenderer) === null || e === void 0 || e.rebuild();
  }
  /**
   * Release associated resources
   */
  dispose() {
    if (this._spriteRenderer && (this._spriteRenderer.dispose(), this._spriteRenderer = null), this._textureContent = null, this._scene.spriteManagers) {
      const e = this._scene.spriteManagers.indexOf(this);
      this._scene.spriteManagers.splice(e, 1);
    }
    this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.metadata = null;
  }
  /**
   * Serializes the sprite manager to a JSON object
   * @param serializeTexture defines if the texture must be serialized as well
   * @returns the JSON object
   */
  serialize(e = !1) {
    const t = {};
    t.name = this.name, t.capacity = this.capacity, t.cellWidth = this.cellWidth, t.cellHeight = this.cellHeight, t.fogEnabled = this.fogEnabled, t.blendMode = this.blendMode, t.disableDepthWrite = this.disableDepthWrite, t.pixelPerfect = this.pixelPerfect, this.texture && (e ? t.texture = this.texture.serialize() : (t.textureUrl = this.texture.name, t.invertY = this.texture._invertY)), t.sprites = [];
    for (const r of this.sprites)
      t.sprites.push(r.serialize());
    return t.metadata = this.metadata, t;
  }
  /**
   * Parses a JSON object to create a new sprite manager.
   * @param parsedManager The JSON object to parse
   * @param scene The scene to create the sprite manager
   * @param rootUrl The root url to use to load external dependencies like texture
   * @returns the new sprite manager
   */
  static Parse(e, t, r) {
    const n = new z2(e.name, "", e.capacity, {
      width: e.cellWidth,
      height: e.cellHeight
    }, t);
    e.fogEnabled !== void 0 && (n.fogEnabled = e.fogEnabled), e.blendMode !== void 0 && (n.blendMode = e.blendMode), e.disableDepthWrite !== void 0 && (n.disableDepthWrite = e.disableDepthWrite), e.pixelPerfect !== void 0 && (n.pixelPerfect = e.pixelPerfect), e.metadata !== void 0 && (n.metadata = e.metadata), e.texture ? n.texture = We.Parse(e.texture, t, r) : e.textureName && (n.texture = new We(r + e.textureUrl, t, !1, e.invertY !== void 0 ? e.invertY : !0));
    for (const i of e.sprites)
      Ry.Parse(i, n);
    return n;
  }
  /**
   * Creates a sprite manager from a snippet saved in a remote file
   * @param name defines the name of the sprite manager to create (can be null or empty to use the one from the json data)
   * @param url defines the url to load from
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a promise that will resolve to the new sprite manager
   */
  static ParseFromFileAsync(e, t, r, n = "") {
    return new Promise((i, s) => {
      const a = new ho();
      a.addEventListener("readystatechange", () => {
        if (a.readyState == 4)
          if (a.status == 200) {
            const f = JSON.parse(a.responseText), o = z2.Parse(f, r || gr.LastCreatedScene, n);
            e && (o.name = e), i(o);
          } else
            s("Unable to load the sprite manager");
      }), a.open("GET", t), a.send();
    });
  }
  /**
   * Creates a sprite manager from a snippet saved by the sprite editor
   * @param snippetId defines the snippet to load (can be set to _BLANK to create a default one)
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a promise that will resolve to the new sprite manager
   */
  static ParseFromSnippetAsync(e, t, r = "") {
    return e === "_BLANK" ? Promise.resolve(new z2("Default sprite manager", "//playground.babylonjs.com/textures/player.png", 500, 64, t)) : new Promise((n, i) => {
      const s = new ho();
      s.addEventListener("readystatechange", () => {
        if (s.readyState == 4)
          if (s.status == 200) {
            const a = JSON.parse(JSON.parse(s.responseText).jsonPayload), f = JSON.parse(a.spriteManager), o = z2.Parse(f, t || gr.LastCreatedScene, r);
            o.snippetId = e, n(o);
          } else
            i("Unable to load the snippet " + e);
      }), s.open("GET", this.SnippetUrl + "/" + e.replace(/#/g, "/")), s.send();
    });
  }
}
z2.SnippetUrl = "https://snippet.babylonjs.com";
z2.CreateFromSnippetAsync = z2.ParseFromSnippetAsync;
const $He = "spriteMapPixelShader", ege = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)
#else
#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)
#endif
precision highp float;varying vec3 vPosition;varying vec2 vUV;varying vec2 tUV;uniform float time;uniform float spriteCount;uniform sampler2D spriteSheet;uniform vec2 spriteMapSize;uniform vec2 outputSize;uniform vec2 stageSize;uniform sampler2D frameMap;uniform sampler2D tileMaps[LAYERS];uniform sampler2D animationMap;uniform vec3 colorMul;float mt;const float fdStep=1./4.;const float aFrameSteps=1./MAX_ANIMATION_FRAMES;mat4 getFrameData(float frameID){float fX=frameID/spriteCount;return mat4(
texture2D(frameMap,vec2(fX,0.),0.),
texture2D(frameMap,vec2(fX,fdStep*1.),0.),
texture2D(frameMap,vec2(fX,fdStep*2.),0.),
vec4(0.)
);}
void main(){vec4 color=vec4(0.);vec2 tileUV=fract(tUV);
#ifdef FLIPU
tileUV.y=1.0-tileUV.y;
#endif
vec2 tileID=floor(tUV);vec2 sheetUnits=1./spriteMapSize;float spriteUnits=1./spriteCount;vec2 stageUnits=1./stageSize;for(int i=0; i<LAYERS; i++) {float frameID;
#define LAYER_ID_SWITCH
vec4 animationData=TEXTUREFUNC(animationMap,vec2((frameID+0.5)/spriteCount,0.),0.);if(animationData.y>0.) {mt=mod(time*animationData.z,1.0);for(float f=0.; f<MAX_ANIMATION_FRAMES; f++){if(animationData.y>mt){frameID=animationData.x;break;}
animationData=TEXTUREFUNC(animationMap,vec2((frameID+0.5)/spriteCount,aFrameSteps*f),0.);}}
mat4 frameData=getFrameData(frameID+0.5);vec2 frameSize=(frameData[0].zw)/spriteMapSize;vec2 offset=frameData[0].xy*sheetUnits;vec2 ratio=frameData[2].xy/frameData[0].zw;if (frameData[2].z==1.){tileUV.xy=tileUV.yx;}
vec4 nc=texture2D(spriteSheet,tileUV*frameSize+offset);if (i==0){color=nc;} else {float alpha=min(color.a+nc.a,1.0);vec3 mixed=mix(color.xyz,nc.xyz,nc.a);color=vec4(mixed,alpha);}}
color.xyz*=colorMul;gl_FragColor=color;}`;
Le.ShadersStore[$He] = ege;
const tge = "spriteMapVertexShader", rge = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;varying vec3 vPosition;varying vec2 vUV;varying vec2 tUV;varying vec2 stageUnits;varying vec2 levelUnits;varying vec2 tileID;uniform float time;uniform mat4 worldViewProjection;uniform vec2 outputSize;uniform vec2 stageSize;uniform vec2 spriteMapSize;uniform float stageScale;void main() {vec4 p=vec4( position,1. );vPosition=p.xyz;vUV=uv;tUV=uv*stageSize; 
gl_Position=worldViewProjection*p;}`;
Le.ShadersStore[tge] = rge;
class nge {
  /** Returns the Number of Sprites in the System */
  get spriteCount() {
    return this.sprites.length;
  }
  /** Returns the Position of Output Plane*/
  get position() {
    return this._output.position;
  }
  /** Returns the Position of Output Plane*/
  set position(e) {
    this._output.position = e;
  }
  /** Returns the Rotation of Output Plane*/
  get rotation() {
    return this._output.rotation;
  }
  /** Returns the Rotation of Output Plane*/
  set rotation(e) {
    this._output.rotation = e;
  }
  /** Sets the AnimationMap*/
  get animationMap() {
    return this._animationMap;
  }
  /** Sets the AnimationMap*/
  set animationMap(e) {
    const t = e._texture._bufferView, r = this._createTileAnimationBuffer(t);
    this._animationMap.dispose(), this._animationMap = r, this._material.setTexture("animationMap", this._animationMap);
  }
  /**
   * Creates a new SpriteMap
   * @param name defines the SpriteMaps Name
   * @param atlasJSON is the JSON file that controls the Sprites Frames and Meta
   * @param spriteSheet is the Texture that the Sprites are on.
   * @param options a basic deployment configuration
   * @param scene The Scene that the map is deployed on
   */
  constructor(e, t, r, n, i) {
    this.name = e, this.sprites = [], this.atlasJSON = t, this.sprites = this.atlasJSON.frames, this.spriteSheet = r, this.options = n, n.stageSize = n.stageSize || new at(1, 1), n.outputSize = n.outputSize || n.stageSize, n.outputPosition = n.outputPosition || S.Zero(), n.outputRotation = n.outputRotation || S.Zero(), n.layerCount = n.layerCount || 1, n.maxAnimationFrames = n.maxAnimationFrames || 0, n.baseTile = n.baseTile || 0, n.flipU = n.flipU || !1, n.colorMultiply = n.colorMultiply || new S(1, 1, 1), this._scene = i, this._frameMap = this._createFrameBuffer(), this._tileMaps = new Array();
    for (let u = 0; u < n.layerCount; u++)
      this._tileMaps.push(this._createTileBuffer(null, u));
    this._animationMap = this._createTileAnimationBuffer(null);
    const s = [];
    s.push("#define LAYERS " + n.layerCount), n.flipU && s.push("#define FLIPU"), s.push(`#define MAX_ANIMATION_FRAMES ${n.maxAnimationFrames}.0`);
    const a = An.ShadersStore.spriteMapPixelShader;
    let f;
    if (i.getEngine()._features.supportSwitchCaseInShader) {
      f = "switch(i) {";
      for (let u = 0; u < n.layerCount; u++)
        f += "case " + u + " : frameID = texture(tileMaps[" + u + "], (tileID + 0.5) / stageSize, 0.).x;", f += "break;";
      f += "}";
    } else {
      f = "";
      for (let u = 0; u < n.layerCount; u++)
        f += `if (${u} == i) { frameID = texture2D(tileMaps[${u}], (tileID + 0.5) / stageSize, 0.).x; }`;
    }
    An.ShadersStore["spriteMap" + this.name + "PixelShader"] = a.replace("#define LAYER_ID_SWITCH", f), this._material = new Zo("spriteMap:" + this.name, this._scene, {
      vertex: "spriteMap",
      fragment: "spriteMap" + this.name
    }, {
      defines: s,
      attributes: ["position", "normal", "uv"],
      uniforms: ["worldViewProjection", "time", "stageSize", "outputSize", "spriteMapSize", "spriteCount", "time", "colorMul", "mousePosition", "curTile", "flipU"],
      samplers: ["spriteSheet", "frameMap", "tileMaps", "animationMap"],
      needAlphaBlending: !0
    }), this._time = 0, this._material.setFloat("spriteCount", this.spriteCount), this._material.setVector2("stageSize", n.stageSize), this._material.setVector2("outputSize", n.outputSize), this._material.setTexture("spriteSheet", this.spriteSheet), this._material.setVector2("spriteMapSize", new at(1, 1)), this._material.setVector3("colorMul", n.colorMultiply);
    let o = 0;
    const d = () => {
      if (this.spriteSheet && this.spriteSheet.isReady() && this.spriteSheet._texture) {
        this._material.setVector2("spriteMapSize", new at(this.spriteSheet._texture.baseWidth || 1, this.spriteSheet._texture.baseHeight || 1));
        return;
      }
      o < 100 && setTimeout(() => {
        o++, d();
      }, 100);
    };
    d(), this._material.setVector3("colorMul", n.colorMultiply), this._material.setTexture("frameMap", this._frameMap), this._material.setTextureArray("tileMaps", this._tileMaps), this._material.setTexture("animationMap", this._animationMap), this._material.setFloat("time", this._time), this._output = u4(e + ":output", { size: 1, updatable: !0 }, i), this._output.scaling.x = n.outputSize.x, this._output.scaling.y = n.outputSize.y, this.position = n.outputPosition, this.rotation = n.outputRotation;
    const v = () => {
      this._time += this._scene.getEngine().getDeltaTime(), this._material.setFloat("time", this._time);
    };
    this._scene.onBeforeRenderObservable.add(v), this._output.material = this._material;
  }
  /**
   * Returns tileID location
   * @returns Vector2 the cell position ID
   */
  getTileID() {
    const e = this.getMousePosition();
    return e.multiplyInPlace(this.options.stageSize || at.Zero()), e.x = Math.floor(e.x), e.y = Math.floor(e.y), e;
  }
  /**
   * Gets the UV location of the mouse over the SpriteMap.
   * @returns Vector2 the UV position of the mouse interaction
   */
  getMousePosition() {
    const e = this._output, t = this._scene.pick(this._scene.pointerX, this._scene.pointerY, (n) => n === e);
    if (!t || !t.hit || !t.getTextureCoordinates)
      return new at(-1, -1);
    const r = t.getTextureCoordinates();
    return r || new at(-1, -1);
  }
  /**
   * Creates the "frame" texture Buffer
   * -------------------------------------
   * Structure of frames
   *  "filename": "Falling-Water-2.png",
   * "frame": {"x":69,"y":103,"w":24,"h":32},
   * "rotated": true,
   * "trimmed": true,
   * "spriteSourceSize": {"x":4,"y":0,"w":24,"h":32},
   * "sourceSize": {"w":32,"h":32}
   * @returns RawTexture of the frameMap
   */
  _createFrameBuffer() {
    const e = [];
    for (let n = 0; n < this.spriteCount; n++)
      e.push(0, 0, 0, 0), e.push(0, 0, 0, 0), e.push(0, 0, 0, 0), e.push(0, 0, 0, 0);
    for (let n = 0; n < this.spriteCount; n++) {
      const i = this.sprites[n].frame, s = this.sprites[n].spriteSourceSize, a = this.sprites[n].sourceSize, f = this.sprites[n].rotated ? 1 : 0, o = this.sprites[n].trimmed ? 1 : 0;
      e[n * 4] = i.x, e[n * 4 + 1] = i.y, e[n * 4 + 2] = i.w, e[n * 4 + 3] = i.h, e[n * 4 + this.spriteCount * 4] = s.x, e[n * 4 + 1 + this.spriteCount * 4] = s.y, e[n * 4 + 3 + this.spriteCount * 4] = s.h, e[n * 4 + this.spriteCount * 8] = a.w, e[n * 4 + 1 + this.spriteCount * 8] = a.h, e[n * 4 + 2 + this.spriteCount * 8] = f, e[n * 4 + 3 + this.spriteCount * 8] = o;
    }
    const t = new Float32Array(e);
    return Bo.CreateRGBATexture(t, this.spriteCount, 4, this._scene, !1, !1, We.NEAREST_NEAREST, Ge.TEXTURETYPE_FLOAT);
  }
  /**
   * Creates the tileMap texture Buffer
   * @param buffer normally and array of numbers, or a false to generate from scratch
   * @param _layer indicates what layer for a logic trigger dealing with the baseTile.  The system uses this
   * @returns RawTexture of the tileMap
   */
  _createTileBuffer(e, t = 0) {
    let r = [];
    const n = this.options.stageSize.y || 0, i = this.options.stageSize.x || 0;
    if (e)
      r = e;
    else {
      let f = this.options.baseTile;
      t != 0 && (f = 0);
      for (let o = 0; o < n; o++)
        for (let d = 0; d < i * 4; d += 4)
          r.push(f, 0, 0, 0);
    }
    const s = new Float32Array(r);
    return Bo.CreateRGBATexture(s, i, n, this._scene, !1, !1, We.NEAREST_NEAREST, Ge.TEXTURETYPE_FLOAT);
  }
  /**
   * Modifies the data of the tileMaps
   * @param _layer is the ID of the layer you want to edit on the SpriteMap
   * @param pos is the iVector2 Coordinates of the Tile
   * @param tile The SpriteIndex of the new Tile
   */
  changeTiles(e = 0, t, r = 0) {
    const n = this._tileMaps[e]._texture._bufferView;
    if (n === null)
      return;
    let i = [];
    t instanceof at ? i.push(t) : i = t;
    const s = this.options.stageSize.x || 0;
    for (let f = 0; f < i.length; f++) {
      const o = i[f];
      o.x = Math.floor(o.x), o.y = Math.floor(o.y);
      const d = o.x * 4 + o.y * (s * 4);
      n[d] = r;
    }
    const a = this._createTileBuffer(n);
    this._tileMaps[e].dispose(), this._tileMaps[e] = a, this._material.setTextureArray("tileMap", this._tileMaps);
  }
  /**
   * Creates the animationMap texture Buffer
   * @param buffer normally and array of numbers, or a false to generate from scratch
   * @returns RawTexture of the animationMap
   */
  _createTileAnimationBuffer(e) {
    const t = [];
    let r;
    if (e)
      r = e;
    else {
      for (let i = 0; i < this.spriteCount; i++) {
        t.push(0, 0, 0, 0);
        let s = 1;
        for (; s < (this.options.maxAnimationFrames || 4); )
          t.push(0, 0, 0, 0), s++;
      }
      r = new Float32Array(t);
    }
    return Bo.CreateRGBATexture(r, this.spriteCount, this.options.maxAnimationFrames || 4, this._scene, !1, !1, We.NEAREST_NEAREST, Ge.TEXTURETYPE_FLOAT);
  }
  /**
   * Modifies the data of the animationMap
   * @param cellID is the Index of the Sprite
   * @param _frame is the target Animation frame
   * @param toCell is the Target Index of the next frame of the animation
   * @param time is a value between 0-1 that is the trigger for when the frame should change tiles
   * @param speed is a global scalar of the time variable on the map.
   */
  addAnimationToTile(e = 0, t = 0, r = 0, n = 0, i = 1) {
    const s = this._animationMap._texture._bufferView, a = e * 4 + this.spriteCount * 4 * t;
    if (!s)
      return;
    s[a] = r, s[a + 1] = n, s[a + 2] = i;
    const f = this._createTileAnimationBuffer(s);
    this._animationMap.dispose(), this._animationMap = f, this._material.setTexture("animationMap", this._animationMap);
  }
  /**
   * Exports the .tilemaps file
   */
  saveTileMaps() {
    let e = "";
    for (let r = 0; r < this._tileMaps.length; r++)
      r > 0 && (e += `
\r`), e += this._tileMaps[r]._texture._bufferView.toString();
    const t = document.createElement("a");
    t.href = "data:octet/stream;charset=utf-8," + encodeURI(e), t.target = "_blank", t.download = this.name + ".tilemaps", t.click(), t.remove();
  }
  /**
   * Imports the .tilemaps file
   * @param url of the .tilemaps file
   */
  loadTileMaps(e) {
    const t = new XMLHttpRequest();
    t.open("GET", e);
    const r = this.options.layerCount || 0;
    t.onload = () => {
      const n = t.response.split(`
\r`);
      for (let i = 0; i < r; i++) {
        const s = n[i].split(",").map(Number), a = this._createTileBuffer(s);
        this._tileMaps[i].dispose(), this._tileMaps[i] = a;
      }
      this._material.setTextureArray("tileMap", this._tileMaps);
    }, t.send();
  }
  /**
   * Release associated resources
   */
  dispose() {
    this._output.dispose(), this._material.dispose(), this._animationMap.dispose(), this._tileMaps.forEach((e) => {
      e.dispose();
    }), this._frameMap.dispose();
  }
}
class ige extends z2 {
  /**
   * Creates a new sprite manager from a packed sprite sheet
   * @param name defines the manager's name
   * @param imgUrl defines the sprite sheet url
   * @param capacity defines the maximum allowed number of sprites
   * @param scene defines the hosting scene
   * @param spriteJSON null otherwise a JSON object defining sprite sheet data
   * @param epsilon defines the epsilon value to align texture (0.01 by default)
   * @param samplingMode defines the sampling mode to use with spritesheet
   * @param fromPacked set to true; do not alter
   */
  constructor(e, t, r, n, i = null, s = 0.01, a = We.TRILINEAR_SAMPLINGMODE) {
    super(e, t, r, 64, n, s, a, !0, i), this.name = e;
  }
}
var Y2;
(function(A) {
  A[A.INIT = 0] = "INIT", A[A.RUNNING = 1] = "RUNNING", A[A.DONE = 2] = "DONE", A[A.ERROR = 3] = "ERROR";
})(Y2 || (Y2 = {}));
class pg {
  /**
   * Creates a new AssetsManager
   * @param name defines the name of the task
   */
  constructor(e) {
    this.name = e, this._isCompleted = !1, this._taskState = Y2.INIT;
  }
  /**
   * Get if the task is completed
   */
  get isCompleted() {
    return this._isCompleted;
  }
  /**
   * Gets the current state of the task
   */
  get taskState() {
    return this._taskState;
  }
  /**
   * Gets the current error object (if task is in error)
   */
  get errorObject() {
    return this._errorObject;
  }
  /**
   * Internal only
   * @internal
   */
  _setErrorObject(e, t) {
    this._errorObject || (this._errorObject = {
      message: e,
      exception: t
    });
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  run(e, t, r) {
    this._taskState = Y2.RUNNING, this.runTask(e, () => {
      this._onDoneCallback(t, r);
    }, (n, i) => {
      this._onErrorCallback(r, n, i);
    });
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  runTask(e, t, r) {
    throw new Error("runTask is not implemented");
  }
  /**
   * Reset will set the task state back to INIT, so the next load call of the assets manager will execute this task again.
   * This can be used with failed tasks that have the reason for failure fixed.
   */
  reset() {
    this._taskState = Y2.INIT;
  }
  _onErrorCallback(e, t, r) {
    this._taskState = Y2.ERROR, this._errorObject = {
      message: t,
      exception: r
    }, this.onError && this.onError(this, t, r), e();
  }
  _onDoneCallback(e, t) {
    try {
      this._taskState = Y2.DONE, this._isCompleted = !0, this.onSuccess && this.onSuccess(this), e();
    } catch (r) {
      this._onErrorCallback(t, "Task is done, error executing success callback(s)", r);
    }
  }
}
class pie {
  /**
   * Creates a AssetsProgressEvent
   * @param remainingCount defines the number of remaining tasks to process
   * @param totalCount defines the total number of tasks
   * @param task defines the task that was just processed
   */
  constructor(e, t, r) {
    this.remainingCount = e, this.totalCount = t, this.task = r;
  }
}
class hie extends pg {
  /**
   * Creates a new ContainerAssetTask
   * @param name defines the name of the task
   * @param meshesNames defines the list of mesh's names you want to load
   * @param rootUrl defines the root url to use as a base to load your meshes and associated resources
   * @param sceneFilename defines the filename or File of the scene to load from
   */
  constructor(e, t, r, n, i) {
    super(e), this.name = e, this.meshesNames = t, this.rootUrl = r, this.sceneFilename = n, this.extension = i;
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  runTask(e, t, r) {
    Hn.LoadAssetContainer(this.rootUrl, this.sceneFilename, e, (n) => {
      this.loadedContainer = n, this.loadedMeshes = n.meshes, this.loadedTransformNodes = n.transformNodes, this.loadedParticleSystems = n.particleSystems, this.loadedSkeletons = n.skeletons, this.loadedAnimationGroups = n.animationGroups, t();
    }, null, (n, i, s) => {
      r(i, s);
    }, this.extension);
  }
}
class Hie extends pg {
  /**
   * Creates a new MeshAssetTask
   * @param name defines the name of the task
   * @param meshesNames defines the list of mesh's names you want to load
   * @param rootUrl defines the root url to use as a base to load your meshes and associated resources
   * @param sceneFilename defines the filename or File of the scene to load from
   */
  constructor(e, t, r, n, i) {
    super(e), this.name = e, this.meshesNames = t, this.rootUrl = r, this.sceneFilename = n, this.extension = i;
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  runTask(e, t, r) {
    Hn.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, e, (n, i, s, a, f) => {
      this.loadedMeshes = n, this.loadedTransformNodes = f, this.loadedParticleSystems = i, this.loadedSkeletons = s, this.loadedAnimationGroups = a, t();
    }, null, (n, i, s) => {
      r(i, s);
    }, this.extension);
  }
}
class sge extends pg {
  /**
   * Creates a new AnimationAssetTask
   * @param name defines the name of the task
   * @param rootUrl defines the root url to use as a base to load your meshes and associated resources
   * @param filename defines the filename or File of the scene to load from
   * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
   */
  constructor(e, t, r, n, i) {
    super(e), this.name = e, this.rootUrl = t, this.filename = r, this.targetConverter = n, this.extension = i;
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  runTask(e, t, r) {
    const n = e.animatables.length, i = e.animationGroups.length;
    this.loadedAnimatables = [], this.loadedAnimationGroups = [], Hn.ImportAnimations(this.rootUrl, this.filename, e, !1, O2.NoSync, this.targetConverter, () => {
      this.loadedAnimatables = e.animatables.slice(n), this.loadedAnimationGroups = e.animationGroups.slice(i), t();
    }, null, (s, a, f) => {
      r(a, f);
    }, this.extension);
  }
}
class gie extends pg {
  /**
   * Creates a new TextFileAssetTask object
   * @param name defines the name of the task
   * @param url defines the location of the file to load
   */
  constructor(e, t) {
    super(e), this.name = e, this.url = t;
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  runTask(e, t, r) {
    e._loadFile(this.url, (n) => {
      this.text = n, t();
    }, void 0, !1, !1, (n, i) => {
      n && r(n.status + " " + n.statusText, i);
    });
  }
}
class Xie extends pg {
  /**
   * Creates a new BinaryFileAssetTask object
   * @param name defines the name of the new task
   * @param url defines the location of the file to load
   */
  constructor(e, t) {
    super(e), this.name = e, this.url = t;
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  runTask(e, t, r) {
    e._loadFile(this.url, (n) => {
      this.data = n, t();
    }, void 0, !0, !0, (n, i) => {
      n && r(n.status + " " + n.statusText, i);
    });
  }
}
class Tie extends pg {
  /**
   * Creates a new ImageAssetTask
   * @param name defines the name of the task
   * @param url defines the location of the image to load
   */
  constructor(e, t) {
    super(e), this.name = e, this.url = t;
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  runTask(e, t, r) {
    const n = new Image();
    ye.SetCorsBehavior(this.url, n), n.onload = () => {
      this.image = n, t();
    }, n.onerror = (i) => {
      r("Error loading image", i);
    }, n.src = this.url;
  }
}
class qie extends pg {
  /**
   * Creates a new TextureAssetTask object
   * @param name defines the name of the task
   * @param url defines the location of the file to load
   * @param noMipmap defines if mipmap should not be generated (default is false)
   * @param invertY defines if texture must be inverted on Y axis (default is true)
   * @param samplingMode defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)
   */
  constructor(e, t, r, n = !0, i = We.TRILINEAR_SAMPLINGMODE) {
    super(e), this.name = e, this.url = t, this.noMipmap = r, this.invertY = n, this.samplingMode = i;
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  runTask(e, t, r) {
    const n = () => {
      t();
    }, i = (s, a) => {
      r(s, a);
    };
    this.texture = new We(this.url, e, this.noMipmap, this.invertY, this.samplingMode, n, i);
  }
}
class bie extends pg {
  /**
   * Creates a new CubeTextureAssetTask
   * @param name defines the name of the task
   * @param url defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)
   * @param extensions defines the extensions to use to load files (["_px", "_py", "_pz", "_nx", "_ny", "_nz"] by default)
   * @param noMipmap defines if mipmaps should not be generated (default is false)
   * @param files defines the explicit list of files (undefined by default)
   * @param prefiltered
   */
  constructor(e, t, r, n, i, s) {
    super(e), this.name = e, this.url = t, this.extensions = r, this.noMipmap = n, this.files = i, this.prefiltered = s;
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  runTask(e, t, r) {
    const n = () => {
      t();
    }, i = (s, a) => {
      r(s, a);
    };
    this.texture = new v1(this.url, e, this.extensions, this.noMipmap, this.files, n, i, void 0, this.prefiltered);
  }
}
class xie extends pg {
  /**
   * Creates a new HDRCubeTextureAssetTask object
   * @param name defines the name of the task
   * @param url defines the location of the file to load
   * @param size defines the desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.
   * @param noMipmap defines if mipmaps should not be generated (default is false)
   * @param generateHarmonics specifies whether you want to extract the polynomial harmonics during the generation process (default is true)
   * @param gammaSpace specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)
   * @param reserved Internal use only
   */
  constructor(e, t, r, n = !1, i = !0, s = !1, a = !1) {
    super(e), this.name = e, this.url = t, this.size = r, this.noMipmap = n, this.generateHarmonics = i, this.gammaSpace = s, this.reserved = a;
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  runTask(e, t, r) {
    const n = () => {
      t();
    }, i = (s, a) => {
      r(s, a);
    };
    this.texture = new _2(this.url, e, this.size, this.noMipmap, this.generateHarmonics, this.gammaSpace, this.reserved, n, i);
  }
}
class Die extends pg {
  /**
   * Creates a new EquiRectangularCubeTextureAssetTask object
   * @param name defines the name of the task
   * @param url defines the location of the file to load
   * @param size defines the desired size (the more it increases the longer the generation will be)
   * If the size is omitted this implies you are using a preprocessed cubemap.
   * @param noMipmap defines if mipmaps should not be generated (default is false)
   * @param gammaSpace specifies if the texture will be used in gamma or linear space
   * (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)
   * (default is true)
   */
  constructor(e, t, r, n = !1, i = !0) {
    super(e), this.name = e, this.url = t, this.size = r, this.noMipmap = n, this.gammaSpace = i;
  }
  /**
   * Execute the current task
   * @param scene defines the scene where you want your assets to be loaded
   * @param onSuccess is a callback called when the task is successfully executed
   * @param onError is a callback called if an error occurs
   */
  runTask(e, t, r) {
    const n = () => {
      t();
    }, i = (s, a) => {
      r(s, a);
    };
    this.texture = new VS(this.url, e, this.size, this.noMipmap, this.gammaSpace, n, i);
  }
}
class age {
  /**
   * Creates a new AssetsManager
   * @param scene defines the scene to work on
   */
  constructor(e) {
    this._isLoading = !1, this._tasks = new Array(), this._waitingTasksCount = 0, this._totalTasksCount = 0, this.onTaskSuccessObservable = new Oe(), this.onTaskErrorObservable = new Oe(), this.onTasksDoneObservable = new Oe(), this.onProgressObservable = new Oe(), this.useDefaultLoadingScreen = !0, this.autoHideLoadingUI = !0, this._scene = e || gr.LastCreatedScene;
  }
  /**
   * Add a ContainerAssetTask to the list of active tasks
   * @param taskName defines the name of the new task
   * @param meshesNames defines the name of meshes to load
   * @param rootUrl defines the root url to use to locate files
   * @param sceneFilename defines the filename of the scene file or the File itself
   * @param extension defines the extension to use to load the file
   * @returns a new ContainerAssetTask object
   */
  addContainerTask(e, t, r, n, i) {
    const s = new hie(e, t, r, n, i);
    return this._tasks.push(s), s;
  }
  /**
   * Add a MeshAssetTask to the list of active tasks
   * @param taskName defines the name of the new task
   * @param meshesNames defines the name of meshes to load
   * @param rootUrl defines the root url to use to locate files
   * @param sceneFilename defines the filename of the scene file or the File itself
   * @param extension defines the extension to use to load the file
   * @returns a new MeshAssetTask object
   */
  addMeshTask(e, t, r, n, i) {
    const s = new Hie(e, t, r, n, i);
    return this._tasks.push(s), s;
  }
  /**
   * Add a TextFileAssetTask to the list of active tasks
   * @param taskName defines the name of the new task
   * @param url defines the url of the file to load
   * @returns a new TextFileAssetTask object
   */
  addTextFileTask(e, t) {
    const r = new gie(e, t);
    return this._tasks.push(r), r;
  }
  /**
   * Add a BinaryFileAssetTask to the list of active tasks
   * @param taskName defines the name of the new task
   * @param url defines the url of the file to load
   * @returns a new BinaryFileAssetTask object
   */
  addBinaryFileTask(e, t) {
    const r = new Xie(e, t);
    return this._tasks.push(r), r;
  }
  /**
   * Add a ImageAssetTask to the list of active tasks
   * @param taskName defines the name of the new task
   * @param url defines the url of the file to load
   * @returns a new ImageAssetTask object
   */
  addImageTask(e, t) {
    const r = new Tie(e, t);
    return this._tasks.push(r), r;
  }
  /**
   * Add a TextureAssetTask to the list of active tasks
   * @param taskName defines the name of the new task
   * @param url defines the url of the file to load
   * @param noMipmap defines if the texture must not receive mipmaps (false by default)
   * @param invertY defines if you want to invert Y axis of the loaded texture (true by default)
   * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)
   * @returns a new TextureAssetTask object
   */
  addTextureTask(e, t, r, n, i = We.TRILINEAR_SAMPLINGMODE) {
    const s = new qie(e, t, r, n, i);
    return this._tasks.push(s), s;
  }
  /**
   * Add a CubeTextureAssetTask to the list of active tasks
   * @param taskName defines the name of the new task
   * @param url defines the url of the file to load
   * @param extensions defines the extension to use to load the cube map (can be null)
   * @param noMipmap defines if the texture must not receive mipmaps (false by default)
   * @param files defines the list of files to load (can be null)
   * @param prefiltered defines the prefiltered texture option (default is false)
   * @returns a new CubeTextureAssetTask object
   */
  addCubeTextureTask(e, t, r, n, i, s) {
    const a = new bie(e, t, r, n, i, s);
    return this._tasks.push(a), a;
  }
  /**
   *
   * Add a HDRCubeTextureAssetTask to the list of active tasks
   * @param taskName defines the name of the new task
   * @param url defines the url of the file to load
   * @param size defines the size you want for the cubemap (can be null)
   * @param noMipmap defines if the texture must not receive mipmaps (false by default)
   * @param generateHarmonics defines if you want to automatically generate (true by default)
   * @param gammaSpace specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)
   * @param reserved Internal use only
   * @returns a new HDRCubeTextureAssetTask object
   */
  addHDRCubeTextureTask(e, t, r, n = !1, i = !0, s = !1, a = !1) {
    const f = new xie(e, t, r, n, i, s, a);
    return this._tasks.push(f), f;
  }
  /**
   *
   * Add a EquiRectangularCubeTextureAssetTask to the list of active tasks
   * @param taskName defines the name of the new task
   * @param url defines the url of the file to load
   * @param size defines the size you want for the cubemap (can be null)
   * @param noMipmap defines if the texture must not receive mipmaps (false by default)
   * @param gammaSpace Specifies if the texture will be used in gamma or linear space
   * (the PBR material requires those textures in linear space, but the standard material would require them in Gamma space)
   * @returns a new EquiRectangularCubeTextureAssetTask object
   */
  addEquiRectangularCubeTextureAssetTask(e, t, r, n = !1, i = !0) {
    const s = new Die(e, t, r, n, i);
    return this._tasks.push(s), s;
  }
  /**
   * Remove a task from the assets manager.
   * @param task the task to remove
   */
  removeTask(e) {
    const t = this._tasks.indexOf(e);
    t > -1 && this._tasks.splice(t, 1);
  }
  _decreaseWaitingTasksCount(e) {
    this._waitingTasksCount--;
    try {
      this.onProgress && this.onProgress(this._waitingTasksCount, this._totalTasksCount, e), this.onProgressObservable.notifyObservers(new pie(this._waitingTasksCount, this._totalTasksCount, e));
    } catch (t) {
      Se.Error("Error running progress callbacks."), console.log(t);
    }
    if (this._waitingTasksCount === 0) {
      try {
        const t = this._tasks.slice();
        this.onFinish && this.onFinish(t);
        for (const r of t)
          if (r.taskState === Y2.DONE) {
            const n = this._tasks.indexOf(r);
            n > -1 && this._tasks.splice(n, 1);
          }
        this.onTasksDoneObservable.notifyObservers(this._tasks);
      } catch (t) {
        Se.Error("Error running tasks-done callbacks."), console.log(t);
      }
      this._isLoading = !1, this.autoHideLoadingUI && this._scene.getEngine().hideLoadingUI();
    }
  }
  _runTask(e) {
    const t = () => {
      try {
        this.onTaskSuccess && this.onTaskSuccess(e), this.onTaskSuccessObservable.notifyObservers(e), this._decreaseWaitingTasksCount(e);
      } catch (n) {
        r("Error executing task success callbacks", n);
      }
    }, r = (n, i) => {
      e._setErrorObject(n, i), this.onTaskError ? this.onTaskError(e) : e.onError || Se.Error(this._formatTaskErrorMessage(e)), this.onTaskErrorObservable.notifyObservers(e), this._decreaseWaitingTasksCount(e);
    };
    e.run(this._scene, t, r);
  }
  _formatTaskErrorMessage(e) {
    let t = "Unable to complete task " + e.name;
    return e.errorObject.message && (t += `: ${e.errorObject.message}`), e.errorObject.exception && (t += `: ${e.errorObject.exception}`), t;
  }
  /**
   * Reset the AssetsManager and remove all tasks
   * @returns the current instance of the AssetsManager
   */
  reset() {
    return this._isLoading = !1, this._tasks = new Array(), this;
  }
  /**
   * Start the loading process
   * @returns the current instance of the AssetsManager
   */
  load() {
    if (this._isLoading)
      return this;
    if (this._isLoading = !0, this._waitingTasksCount = this._tasks.length, this._totalTasksCount = this._tasks.length, this._waitingTasksCount === 0)
      return this._isLoading = !1, this.onFinish && this.onFinish(this._tasks), this.onTasksDoneObservable.notifyObservers(this._tasks), this;
    this.useDefaultLoadingScreen && this._scene.getEngine().displayLoadingUI();
    for (let e = 0; e < this._tasks.length; e++) {
      const t = this._tasks[e];
      t.taskState === Y2.INIT && this._runTask(t);
    }
    return this;
  }
  /**
   * Start the loading process as an async operation
   * @returns a promise returning the list of failed tasks
   */
  loadAsync() {
    return new Promise((e, t) => {
      if (this._isLoading) {
        e();
        return;
      }
      this.onTasksDoneObservable.addOnce((r) => {
        r && r.length ? t(r) : e();
      }), this.load();
    });
  }
}
class MW {
  /**
   * The resolve method of the promise associated with this deferred object.
   */
  get resolve() {
    return this._resolve;
  }
  /**
   * The reject method of the promise associated with this deferred object.
   */
  get reject() {
    return this._reject;
  }
  /**
   * Constructor for this deferred object.
   */
  constructor() {
    this.promise = new Promise((e, t) => {
      this._resolve = e, this._reject = t;
    });
  }
}
class oge {
  /**
   * Explodes meshes from a center mesh.
   * @param meshes The meshes to explode.
   * @param centerMesh The mesh to be center of explosion.
   */
  constructor(e, t) {
    this._meshesOrigins = [], this._toCenterVectors = [], this._scaledDirection = new S(1, 1, 1), this._newPosition = S.Zero(), this._centerPosition = S.Zero(), this._meshes = e.slice(), t ? this._centerMesh = t : this._setCenterMesh(), this._centerMesh.computeWorldMatrix(!0);
    const r = this._meshes.indexOf(this._centerMesh);
    r >= 0 && this._meshes.splice(r, 1), this._centerPosition = this._centerMesh.getAbsolutePosition().clone();
    for (let n = 0; n < this._meshes.length; n++)
      if (this._meshes[n]) {
        const i = this._meshes[n];
        this._meshesOrigins[n] = i.getAbsolutePosition().clone(), this._toCenterVectors[n] = S.Zero(), i.hasBoundingInfo && this._centerMesh.hasBoundingInfo && (i.computeWorldMatrix(!0), i.getBoundingInfo().boundingBox.centerWorld.subtractToRef(this._centerMesh.getBoundingInfo().boundingBox.centerWorld, this._toCenterVectors[n]));
      }
  }
  _setCenterMesh() {
    let e = S.Zero();
    const t = S.Zero();
    let r = Number.MAX_VALUE;
    for (let n = 0; n < this._meshes.length; n++)
      if (this._meshes[n]) {
        const s = this._meshes[n].getBoundingInfo();
        s && t.addInPlace(s.boundingBox.centerWorld);
      }
    e = t.scale(1 / this._meshes.length);
    for (let n = 0; n < this._meshes.length; n++)
      if (this._meshes[n]) {
        const i = this._meshes[n], s = i.getBoundingInfo();
        if (s) {
          const a = s.boundingBox.centerWorld.subtract(e).lengthSquared();
          a < r && (this._centerMesh = i, r = a);
        }
      }
  }
  /**
   * Get class name
   * @returns "MeshExploder"
   */
  getClassName() {
    return "MeshExploder";
  }
  /**
   * "Exploded meshes"
   * @returns Array of meshes with the centerMesh at index 0.
   */
  getMeshes() {
    const e = this._meshes.slice();
    return e.unshift(this._centerMesh), e;
  }
  /**
   * Explodes meshes giving a specific direction
   * @param direction Number to multiply distance of each mesh's origin from center. Use a negative number to implode, or zero to reset.
   */
  explode(e = 1) {
    for (let t = 0; t < this._meshes.length; t++)
      this._meshes[t] && this._meshesOrigins[t] && this._toCenterVectors[t] && (this._toCenterVectors[t].scaleToRef(e, this._scaledDirection), this._meshesOrigins[t].addToRef(this._scaledDirection, this._newPosition), this._meshes[t].setAbsolutePosition(this._newPosition));
    this._centerMesh.setAbsolutePosition(this._centerPosition);
  }
}
class KY {
  /**
   * List of files ready to be loaded
   */
  static get FilesToLoad() {
    return em.FilesToLoad;
  }
  /**
   * Creates a new FilesInput
   * @param engine defines the rendering engine
   * @param scene defines the hosting scene
   * @param sceneLoadedCallback callback called when scene (files provided) is loaded
   * @param progressCallback callback called to track progress
   * @param additionalRenderLoopLogicCallback callback called to add user logic to the rendering loop
   * @param textureLoadingCallback callback called when a texture is loading
   * @param startingProcessingFilesCallback callback called when the system is about to process all files
   * @param onReloadCallback callback called when a reload is requested
   * @param errorCallback callback call if an error occurs
   * @param useAppend defines if the file loaded must be appended (true) or have the scene replaced (false, default behavior)
   */
  constructor(e, t, r, n, i, s, a, f, o, d = !1) {
    this.useAppend = d, this.onProcessFileCallback = () => !0, this.displayLoadingUI = !0, this.loadAsync = (v, u) => this.useAppend ? Hn.AppendAsync("file:", v, this._currentScene, u) : Hn.LoadAsync("file:", v, this._engine, u), this._engine = e, this._currentScene = t, this._sceneLoadedCallback = r, this._progressCallback = n, this._additionalRenderLoopLogicCallback = i, this._textureLoadingCallback = s, this._startingProcessingFilesCallback = a, this._onReloadCallback = f, this._errorCallback = o;
  }
  /**
   * Calls this function to listen to drag'n'drop events on a specific DOM element
   * @param elementToMonitor defines the DOM element to track
   */
  monitorElementForDragNDrop(e) {
    e && (this._elementToMonitor = e, this._dragEnterHandler = (t) => {
      this._drag(t);
    }, this._dragOverHandler = (t) => {
      this._drag(t);
    }, this._dropHandler = (t) => {
      this._drop(t);
    }, this._elementToMonitor.addEventListener("dragenter", this._dragEnterHandler, !1), this._elementToMonitor.addEventListener("dragover", this._dragOverHandler, !1), this._elementToMonitor.addEventListener("drop", this._dropHandler, !1));
  }
  /** Gets the current list of files to load */
  get filesToLoad() {
    return this._filesToLoad;
  }
  /**
   * Release all associated resources
   */
  dispose() {
    this._elementToMonitor && (this._elementToMonitor.removeEventListener("dragenter", this._dragEnterHandler), this._elementToMonitor.removeEventListener("dragover", this._dragOverHandler), this._elementToMonitor.removeEventListener("drop", this._dropHandler));
  }
  _renderFunction() {
    if (this._additionalRenderLoopLogicCallback && this._additionalRenderLoopLogicCallback(), this._currentScene) {
      if (this._textureLoadingCallback) {
        const e = this._currentScene.getWaitingItemsCount();
        e > 0 && this._textureLoadingCallback(e);
      }
      this._currentScene.render();
    }
  }
  _drag(e) {
    e.stopPropagation(), e.preventDefault();
  }
  _drop(e) {
    e.stopPropagation(), e.preventDefault(), this.loadFiles(e);
  }
  _traverseFolder(e, t, r, n) {
    const i = e.createReader(), s = e.fullPath.replace(/^\//, "").replace(/(.+?)\/?$/, "$1/");
    i.readEntries((a) => {
      r.count += a.length;
      for (const f of a)
        f.isFile ? f.file((o) => {
          o.correctName = s + o.name, t.push(o), --r.count === 0 && n();
        }) : f.isDirectory && this._traverseFolder(f, t, r, n);
      --r.count === 0 && n();
    });
  }
  _processFiles(e) {
    for (let t = 0; t < e.length; t++) {
      const r = e[t].correctName.toLowerCase(), n = r.split(".").pop();
      this.onProcessFileCallback(e[t], r, n, (i) => this._sceneFileToLoad = i) && (Hn.IsPluginForExtensionAvailable("." + n) && (this._sceneFileToLoad = e[t]), KY.FilesToLoad[r] = e[t]);
    }
  }
  /**
   * Load files from a drop event
   * @param event defines the drop event to use as source
   */
  loadFiles(e) {
    if (e && e.dataTransfer && e.dataTransfer.files && (this._filesToLoad = e.dataTransfer.files), e && e.target && e.target.files && (this._filesToLoad = e.target.files), !(!this._filesToLoad || this._filesToLoad.length === 0) && (this._startingProcessingFilesCallback && this._startingProcessingFilesCallback(this._filesToLoad), this._filesToLoad && this._filesToLoad.length > 0)) {
      const t = [], r = [], n = e.dataTransfer ? e.dataTransfer.items : null;
      for (let i = 0; i < this._filesToLoad.length; i++) {
        const s = this._filesToLoad[i], a = s.name.toLowerCase();
        let f;
        if (s.correctName = a, n) {
          const o = n[i];
          o.getAsEntry ? f = o.getAsEntry() : o.webkitGetAsEntry && (f = o.webkitGetAsEntry());
        }
        f && f.isDirectory ? r.push(f) : t.push(s);
      }
      if (r.length === 0)
        this._processFiles(t), this._processReload();
      else {
        const i = { count: r.length };
        for (const s of r)
          this._traverseFolder(s, t, i, () => {
            this._processFiles(t), i.count === 0 && this._processReload();
          });
      }
    }
  }
  _processReload() {
    this._onReloadCallback ? this._onReloadCallback(this._sceneFileToLoad) : this.reload();
  }
  /**
   * Reload the current scene from the loaded files
   */
  reload() {
    this._sceneFileToLoad ? (this.useAppend || this._currentScene && (Se.errorsCount > 0 && Se.ClearLogCache(), this._engine.stopRenderLoop()), Hn.ShowLoadingScreen = !1, this.displayLoadingUI && this._engine.displayLoadingUI(), this.loadAsync(this._sceneFileToLoad, this._progressCallback).then((e) => {
      this.useAppend ? this.displayLoadingUI && this._engine.hideLoadingUI() : (this._currentScene && this._currentScene.dispose(), this._currentScene = e, this._currentScene.executeWhenReady(() => {
        this.displayLoadingUI && this._engine.hideLoadingUI(), this._engine.runRenderLoop(() => {
          this._renderFunction();
        });
      })), this._sceneLoadedCallback && this._currentScene && this._sceneLoadedCallback(this._sceneFileToLoad, this._currentScene);
    }).catch((e) => {
      this.displayLoadingUI && this._engine.hideLoadingUI(), this._errorCallback && this._errorCallback(this._sceneFileToLoad, this._currentScene, e.message);
    })) : Se.Error("Please provide a valid .babylon file.");
  }
}
class JY {
  /**
   * Release associated resources
   */
  dispose() {
    if (this._observers && this._observables)
      for (let e = 0; e < this._observers.length; e++)
        this._observables[e].remove(this._observers[e]);
    this._observers = null, this._observables = null;
  }
  /**
   * Raise a callback when one of the observable will notify
   * @param observables defines a list of observables to watch
   * @param callback defines the callback to call on notification
   * @param mask defines the mask used to filter notifications
   * @param scope defines the current scope used to restore the JS context
   * @returns the new MultiObserver
   */
  static Watch(e, t, r = -1, n = null) {
    const i = new JY();
    i._observers = new Array(), i._observables = e;
    for (const s of e) {
      const a = s.add(t, r, !1, n);
      a && i._observers.push(a);
    }
    return i;
  }
}
Oe.prototype.notifyObserversWithPromise = async function(A, e = -1, t, r, n) {
  let i = Promise.resolve(A);
  if (!this.observers.length)
    return i;
  const s = this._eventState;
  return s.mask = e, s.target = t, s.currentTarget = r, s.skipNextObservers = !1, s.userInfo = n, this.observers.forEach((a) => {
    s.skipNextObservers || a._willBeUnregistered || a.mask & e && (a.scope ? i = i.then((f) => (s.lastReturnValue = f, a.callback.apply(a.scope, [A, s]))) : i = i.then((f) => (s.lastReturnValue = f, a.callback(A, s))), a.unregisterOnNextCall && this._deferUnregister(a));
  }), await i, A;
};
class c4 {
  /**
   * Gets a string describing the action executed by the current optimization
   * @returns description string
   */
  getDescription() {
    return "";
  }
  /**
   * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
   * @param scene defines the current scene where to apply this optimization
   * @param optimizer defines the current optimizer
   * @returns true if everything that can be done was applied
   */
  apply(e, t) {
    return !0;
  }
  /**
   * Creates the SceneOptimization object
   * @param priority defines the priority of this optimization (0 by default which means first in the list)
   */
  constructor(e = 0) {
    this.priority = e;
  }
}
class SC extends c4 {
  /**
   * Gets a string describing the action executed by the current optimization
   * @returns description string
   */
  getDescription() {
    return "Reducing render target texture size to " + this.maximumSize;
  }
  /**
   * Creates the TextureOptimization object
   * @param priority defines the priority of this optimization (0 by default which means first in the list)
   * @param maximumSize defines the maximum sized allowed for textures (1024 is the default value). If a texture is bigger, it will be scaled down using a factor defined by the step parameter
   * @param step defines the factor (0.5 by default) used to scale down textures bigger than maximum sized allowed.
   */
  constructor(e = 0, t = 1024, r = 0.5) {
    super(e), this.priority = e, this.maximumSize = t, this.step = r;
  }
  /**
   * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
   * @param scene defines the current scene where to apply this optimization
   * @param optimizer defines the current optimizer
   * @returns true if everything that can be done was applied
   */
  apply(e, t) {
    let r = !0;
    for (let n = 0; n < e.textures.length; n++) {
      const i = e.textures[n];
      if (!i.canRescale || i.getContext)
        continue;
      const s = i.getSize();
      Math.max(s.width, s.height) > this.maximumSize && (i.scale(this.step), r = !1);
    }
    return r;
  }
}
class mF extends c4 {
  /**
   * Gets a string describing the action executed by the current optimization
   * @returns description string
   */
  getDescription() {
    return "Setting hardware scaling level to " + this._currentScale;
  }
  /**
   * Creates the HardwareScalingOptimization object
   * @param priority defines the priority of this optimization (0 by default which means first in the list)
   * @param maximumScale defines the maximum scale to use (2 by default)
   * @param step defines the step to use between two passes (0.5 by default)
   */
  constructor(e = 0, t = 2, r = 0.25) {
    super(e), this.priority = e, this.maximumScale = t, this.step = r, this._currentScale = -1, this._directionOffset = 1;
  }
  /**
   * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
   * @param scene defines the current scene where to apply this optimization
   * @param optimizer defines the current optimizer
   * @returns true if everything that can be done was applied
   */
  apply(e, t) {
    return this._currentScale === -1 && (this._currentScale = e.getEngine().getHardwareScalingLevel(), this._currentScale > this.maximumScale && (this._directionOffset = -1)), this._currentScale += this._directionOffset * this.step, e.getEngine().setHardwareScalingLevel(this._currentScale), this._directionOffset === 1 ? this._currentScale >= this.maximumScale : this._currentScale <= this.maximumScale;
  }
}
class UC extends c4 {
  /**
   * Gets a string describing the action executed by the current optimization
   * @returns description string
   */
  getDescription() {
    return "Turning shadows on/off";
  }
  /**
   * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
   * @param scene defines the current scene where to apply this optimization
   * @param optimizer defines the current optimizer
   * @returns true if everything that can be done was applied
   */
  apply(e, t) {
    return e.shadowsEnabled = t.isInImprovementMode, !0;
  }
}
class IC extends c4 {
  /**
   * Gets a string describing the action executed by the current optimization
   * @returns description string
   */
  getDescription() {
    return "Turning post-processes on/off";
  }
  /**
   * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
   * @param scene defines the current scene where to apply this optimization
   * @param optimizer defines the current optimizer
   * @returns true if everything that can be done was applied
   */
  apply(e, t) {
    return e.postProcessesEnabled = t.isInImprovementMode, !0;
  }
}
class RC extends c4 {
  /**
   * Gets a string describing the action executed by the current optimization
   * @returns description string
   */
  getDescription() {
    return "Turning lens flares on/off";
  }
  /**
   * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
   * @param scene defines the current scene where to apply this optimization
   * @param optimizer defines the current optimizer
   * @returns true if everything that can be done was applied
   */
  apply(e, t) {
    return e.lensFlaresEnabled = t.isInImprovementMode, !0;
  }
}
class jie extends c4 {
  /**
   * Gets a string describing the action executed by the current optimization
   * @returns description string
   */
  getDescription() {
    return this.onGetDescription ? this.onGetDescription() : "Running user defined callback";
  }
  /**
   * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
   * @param scene defines the current scene where to apply this optimization
   * @param optimizer defines the current optimizer
   * @returns true if everything that can be done was applied
   */
  apply(e, t) {
    return this.onApply ? this.onApply(e, t) : !0;
  }
}
class VC extends c4 {
  /**
   * Gets a string describing the action executed by the current optimization
   * @returns description string
   */
  getDescription() {
    return "Turning particles on/off";
  }
  /**
   * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
   * @param scene defines the current scene where to apply this optimization
   * @param optimizer defines the current optimizer
   * @returns true if everything that can be done was applied
   */
  apply(e, t) {
    return e.particlesEnabled = t.isInImprovementMode, !0;
  }
}
class BF extends c4 {
  /**
   * Gets a string describing the action executed by the current optimization
   * @returns description string
   */
  getDescription() {
    return "Turning render targets off";
  }
  /**
   * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
   * @param scene defines the current scene where to apply this optimization
   * @param optimizer defines the current optimizer
   * @returns true if everything that can be done was applied
   */
  apply(e, t) {
    return e.renderTargetsEnabled = t.isInImprovementMode, !0;
  }
}
class uq extends c4 {
  constructor() {
    super(...arguments), this._canBeMerged = (e) => {
      if (!(e instanceof Ee))
        return !1;
      const t = e;
      return !(t.isDisposed() || !t.isVisible || !t.isEnabled() || t.instances.length > 0 || t.skeleton || t.hasLODLevels || t.getTotalVertices() === 0);
    };
  }
  /**
   * Gets or sets a boolean which defines if optimization octree has to be updated
   */
  static get UpdateSelectionTree() {
    return uq._UpdateSelectionTree;
  }
  /**
   * Gets or sets a boolean which defines if optimization octree has to be updated
   */
  static set UpdateSelectionTree(e) {
    uq._UpdateSelectionTree = e;
  }
  /**
   * Gets a string describing the action executed by the current optimization
   * @returns description string
   */
  getDescription() {
    return "Merging similar meshes together";
  }
  /**
   * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
   * @param scene defines the current scene where to apply this optimization
   * @param optimizer defines the current optimizer
   * @param updateSelectionTree defines that the selection octree has to be updated (false by default)
   * @returns true if everything that can be done was applied
   */
  apply(e, t, r) {
    const n = e.meshes.slice(0);
    let i = n.length;
    for (let a = 0; a < i; a++) {
      const f = [], o = n[a];
      if (this._canBeMerged(o)) {
        f.push(o);
        for (let d = a + 1; d < i; d++) {
          const v = n[d];
          this._canBeMerged(v) && v.material === o.material && v.checkCollisions === o.checkCollisions && (f.push(v), i--, n.splice(d, 1), d--);
        }
        f.length < 2 || Ee.MergeMeshes(f, void 0, !0);
      }
    }
    const s = e;
    return s.createOrUpdateSelectionOctree && (r != null ? r && s.createOrUpdateSelectionOctree() : uq.UpdateSelectionTree && s.createOrUpdateSelectionOctree()), !0;
  }
}
uq._UpdateSelectionTree = !1;
class om {
  /**
   * Creates a new list of options used by SceneOptimizer
   * @param targetFrameRate defines the target frame rate to reach (60 by default)
   * @param trackerDuration defines the interval between two checks (2000ms by default)
   */
  constructor(e = 60, t = 2e3) {
    this.targetFrameRate = e, this.trackerDuration = t, this.optimizations = [];
  }
  /**
   * Add a new optimization
   * @param optimization defines the SceneOptimization to add to the list of active optimizations
   * @returns the current SceneOptimizerOptions
   */
  addOptimization(e) {
    return this.optimizations.push(e), this;
  }
  /**
   * Add a new custom optimization
   * @param onApply defines the callback called to apply the custom optimization (true if everything that can be done was applied)
   * @param onGetDescription defines the callback called to get the description attached with the optimization.
   * @param priority defines the priority of this optimization (0 by default which means first in the list)
   * @returns the current SceneOptimizerOptions
   */
  addCustomOptimization(e, t, r = 0) {
    const n = new jie(r);
    return n.onApply = e, n.onGetDescription = t, this.optimizations.push(n), this;
  }
  /**
   * Creates a list of pre-defined optimizations aimed to reduce the visual impact on the scene
   * @param targetFrameRate defines the target frame rate (60 by default)
   * @returns a SceneOptimizerOptions object
   */
  static LowDegradationAllowed(e) {
    const t = new om(e);
    let r = 0;
    return t.addOptimization(new uq(r)), t.addOptimization(new UC(r)), t.addOptimization(new RC(r)), r++, t.addOptimization(new IC(r)), t.addOptimization(new VC(r)), r++, t.addOptimization(new SC(r, 1024)), t;
  }
  /**
   * Creates a list of pre-defined optimizations aimed to have a moderate impact on the scene visual
   * @param targetFrameRate defines the target frame rate (60 by default)
   * @returns a SceneOptimizerOptions object
   */
  static ModerateDegradationAllowed(e) {
    const t = new om(e);
    let r = 0;
    return t.addOptimization(new uq(r)), t.addOptimization(new UC(r)), t.addOptimization(new RC(r)), r++, t.addOptimization(new IC(r)), t.addOptimization(new VC(r)), r++, t.addOptimization(new SC(r, 512)), r++, t.addOptimization(new BF(r)), r++, t.addOptimization(new mF(r, 2)), t;
  }
  /**
   * Creates a list of pre-defined optimizations aimed to have a big impact on the scene visual
   * @param targetFrameRate defines the target frame rate (60 by default)
   * @returns a SceneOptimizerOptions object
   */
  static HighDegradationAllowed(e) {
    const t = new om(e);
    let r = 0;
    return t.addOptimization(new uq(r)), t.addOptimization(new UC(r)), t.addOptimization(new RC(r)), r++, t.addOptimization(new IC(r)), t.addOptimization(new VC(r)), r++, t.addOptimization(new SC(r, 256)), r++, t.addOptimization(new BF(r)), r++, t.addOptimization(new mF(r, 4)), t;
  }
}
class zY {
  /**
   * Gets or sets a boolean indicating if the optimizer is in improvement mode
   */
  get isInImprovementMode() {
    return this._improvementMode;
  }
  set isInImprovementMode(e) {
    this._improvementMode = e;
  }
  /**
   * Gets the current priority level (0 at start)
   */
  get currentPriorityLevel() {
    return this._currentPriorityLevel;
  }
  /**
   * Gets the current frame rate checked by the SceneOptimizer
   */
  get currentFrameRate() {
    return this._currentFrameRate;
  }
  /**
   * Gets or sets the current target frame rate (60 by default)
   */
  get targetFrameRate() {
    return this._targetFrameRate;
  }
  /**
   * Gets or sets the current target frame rate (60 by default)
   */
  set targetFrameRate(e) {
    this._targetFrameRate = e;
  }
  /**
   * Gets or sets the current interval between two checks (every 2000ms by default)
   */
  get trackerDuration() {
    return this._trackerDuration;
  }
  /**
   * Gets or sets the current interval between two checks (every 2000ms by default)
   */
  set trackerDuration(e) {
    this._trackerDuration = e;
  }
  /**
   * Gets the list of active optimizations
   */
  get optimizations() {
    return this._options.optimizations;
  }
  /**
   * Creates a new SceneOptimizer
   * @param scene defines the scene to work on
   * @param options defines the options to use with the SceneOptimizer
   * @param autoGeneratePriorities defines if priorities must be generated and not read from SceneOptimization property (true by default)
   * @param improvementMode defines if the scene optimizer must run the maximum optimization while staying over a target frame instead of trying to reach the target framerate (false by default)
   */
  constructor(e, t, r = !0, n = !1) {
    if (this._isRunning = !1, this._currentPriorityLevel = 0, this._targetFrameRate = 60, this._trackerDuration = 2e3, this._currentFrameRate = 0, this._improvementMode = !1, this.onSuccessObservable = new Oe(), this.onNewOptimizationAppliedObservable = new Oe(), this.onFailureObservable = new Oe(), t ? this._options = t : this._options = new om(), this._options.targetFrameRate && (this._targetFrameRate = this._options.targetFrameRate), this._options.trackerDuration && (this._trackerDuration = this._options.trackerDuration), r) {
      let i = 0;
      for (const s of this._options.optimizations)
        s.priority = i++;
    }
    this._improvementMode = n, this._scene = e || gr.LastCreatedScene, this._sceneDisposeObserver = this._scene.onDisposeObservable.add(() => {
      this._sceneDisposeObserver = null, this.dispose();
    });
  }
  /**
   * Stops the current optimizer
   */
  stop() {
    this._isRunning = !1;
  }
  /**
   * Reset the optimizer to initial step (current priority level = 0)
   */
  reset() {
    this._currentPriorityLevel = 0;
  }
  /**
   * Start the optimizer. By default it will try to reach a specific framerate
   * but if the optimizer is set with improvementMode === true then it will run all optimization while frame rate is above the target frame rate
   */
  start() {
    this._isRunning || (this._isRunning = !0, this._scene.executeWhenReady(() => {
      setTimeout(() => {
        this._checkCurrentState();
      }, this._trackerDuration);
    }));
  }
  _checkCurrentState() {
    if (!this._isRunning)
      return;
    const e = this._scene, t = this._options;
    if (this._currentFrameRate = Math.round(e.getEngine().getFps()), this._improvementMode && this._currentFrameRate <= this._targetFrameRate || !this._improvementMode && this._currentFrameRate >= this._targetFrameRate) {
      this._isRunning = !1, this.onSuccessObservable.notifyObservers(this);
      return;
    }
    let r = !0, n = !0;
    for (let i = 0; i < t.optimizations.length; i++) {
      const s = t.optimizations[i];
      s.priority === this._currentPriorityLevel && (n = !1, r = r && s.apply(e, this), this.onNewOptimizationAppliedObservable.notifyObservers(s));
    }
    if (n) {
      this._isRunning = !1, this.onFailureObservable.notifyObservers(this);
      return;
    }
    r && this._currentPriorityLevel++, e.executeWhenReady(() => {
      setTimeout(() => {
        this._checkCurrentState();
      }, this._trackerDuration);
    });
  }
  /**
   * Release all resources
   */
  dispose() {
    this.stop(), this.onSuccessObservable.clear(), this.onFailureObservable.clear(), this.onNewOptimizationAppliedObservable.clear(), this._sceneDisposeObserver && this._scene.onDisposeObservable.remove(this._sceneDisposeObserver);
  }
  /**
   * Helper function to create a SceneOptimizer with one single line of code
   * @param scene defines the scene to work on
   * @param options defines the options to use with the SceneOptimizer
   * @param onSuccess defines a callback to call on success
   * @param onFailure defines a callback to call on failure
   * @returns the new SceneOptimizer object
   */
  static OptimizeAsync(e, t, r, n) {
    const i = new zY(e, t || om.ModerateDegradationAllowed(), !1);
    return r && i.onSuccessObservable.add(() => {
      r();
    }), n && i.onFailureObservable.add(() => {
      n();
    }), i.start(), i;
  }
}
let WF = [];
const GY = (A, e) => {
  A.doNotSerialize || (e.vertexData.push(A.serializeVerticeData()), WF[A.id] = !0);
}, wie = (A, e) => {
  const t = {}, r = A._geometry;
  return r && (A.getScene().getGeometryById(r.id) || GY(r, e.geometries)), A.serialize && A.serialize(t), t;
}, fge = (A, e) => {
  if (A._isMesh) {
    const t = A;
    if (t.delayLoadState === 1 || t.delayLoadState === 0) {
      const r = (i) => {
        e.materials = e.materials || [], t.material && !e.materials.some((s) => s.id === t.material.id) && e.materials.push(i.serialize());
      };
      if (t.material && !t.material.doNotSerialize)
        if (t.material instanceof Dc) {
          if (e.multiMaterials = e.multiMaterials || [], !e.multiMaterials.some((i) => i.id === t.material.id)) {
            e.multiMaterials.push(t.material.serialize());
            for (const i of t.material.subMaterials)
              i && r(i);
          }
        } else
          r(t.material);
      else
        t.material || r(t.getScene().defaultMaterial);
      const n = t._geometry;
      n && (e.geometries || (e.geometries = {}, e.geometries.boxes = [], e.geometries.spheres = [], e.geometries.cylinders = [], e.geometries.toruses = [], e.geometries.grounds = [], e.geometries.planes = [], e.geometries.torusKnots = [], e.geometries.vertexData = []), GY(n, e.geometries)), t.skeleton && !t.skeleton.doNotSerialize && (e.skeletons = e.skeletons || [], e.skeletons.push(t.skeleton.serialize())), e.meshes = e.meshes || [], e.meshes.push(wie(t, e));
    }
  } else if (A.getClassName() === "TransformNode") {
    const t = A;
    e.transformNodes.push(t.serialize());
  } else if (A.getClassName().indexOf("Camera") !== -1) {
    const t = A;
    e.cameras.push(t.serialize());
  } else if (A.getClassName().indexOf("Light") !== -1) {
    const t = A;
    e.lights.push(t.serialize());
  }
};
class G2 {
  /**
   * Clear cache used by a previous serialization
   */
  static ClearCache() {
    WF = [];
  }
  /**
   * Serialize a scene into a JSON compatible object
   * Note that if the current engine does not support synchronous texture reading (like WebGPU), you should use SerializeAsync instead
   * as else you may not retrieve the proper base64 encoded texture data (when using the Texture.ForceSerializeBuffers flag)
   * @param scene defines the scene to serialize
   * @returns a JSON compatible object
   */
  static Serialize(e) {
    return G2._Serialize(e);
  }
  static _Serialize(e, t = !0) {
    const r = {};
    if (t && !e.getEngine()._features.supportSyncTextureRead && We.ForceSerializeBuffers && console.warn("The serialization object may not contain the proper base64 encoded texture data! You should use the SerializeAsync method instead."), G2.ClearCache(), r.useDelayedTextureLoading = e.useDelayedTextureLoading, r.autoClear = e.autoClear, r.clearColor = e.clearColor.asArray(), r.ambientColor = e.ambientColor.asArray(), r.gravity = e.gravity.asArray(), r.collisionsEnabled = e.collisionsEnabled, r.useRightHandedSystem = e.useRightHandedSystem, e.fogMode && e.fogMode !== 0 && (r.fogMode = e.fogMode, r.fogColor = e.fogColor.asArray(), r.fogStart = e.fogStart, r.fogEnd = e.fogEnd, r.fogDensity = e.fogDensity), e.isPhysicsEnabled && e.isPhysicsEnabled()) {
      const f = e.getPhysicsEngine();
      f && (r.physicsEnabled = !0, r.physicsGravity = f.gravity.asArray(), r.physicsEngine = f.getPhysicsPluginName());
    }
    e.metadata && (r.metadata = e.metadata), r.morphTargetManagers = [];
    for (const f of e.meshes) {
      const o = f.morphTargetManager;
      o && r.morphTargetManagers.push(o.serialize());
    }
    r.lights = [];
    let n, i;
    for (n = 0; n < e.lights.length; n++)
      i = e.lights[n], i.doNotSerialize || r.lights.push(i.serialize());
    for (r.cameras = [], n = 0; n < e.cameras.length; n++) {
      const f = e.cameras[n];
      f.doNotSerialize || r.cameras.push(f.serialize());
    }
    if (e.activeCamera && (r.activeCameraID = e.activeCamera.id), jt.AppendSerializedAnimations(e, r), e.animationGroups && e.animationGroups.length > 0) {
      r.animationGroups = [];
      for (let f = 0; f < e.animationGroups.length; f++) {
        const o = e.animationGroups[f];
        r.animationGroups.push(o.serialize());
      }
    }
    if (e.reflectionProbes && e.reflectionProbes.length > 0)
      for (r.reflectionProbes = [], n = 0; n < e.reflectionProbes.length; n++) {
        const f = e.reflectionProbes[n];
        r.reflectionProbes.push(f.serialize());
      }
    r.materials = [], r.multiMaterials = [];
    let s;
    for (n = 0; n < e.materials.length; n++)
      s = e.materials[n], s.doNotSerialize || r.materials.push(s.serialize());
    for (r.multiMaterials = [], n = 0; n < e.multiMaterials.length; n++) {
      const f = e.multiMaterials[n];
      r.multiMaterials.push(f.serialize());
    }
    for (e.environmentTexture && (e.environmentTexture._files ? r.environmentTexture = e.environmentTexture.serialize() : (r.environmentTexture = e.environmentTexture.name, r.environmentTextureRotationY = e.environmentTexture.rotationY)), r.environmentIntensity = e.environmentIntensity, r.skeletons = [], n = 0; n < e.skeletons.length; n++) {
      const f = e.skeletons[n];
      f.doNotSerialize || r.skeletons.push(f.serialize());
    }
    for (r.transformNodes = [], n = 0; n < e.transformNodes.length; n++)
      e.transformNodes[n].doNotSerialize || r.transformNodes.push(e.transformNodes[n].serialize());
    r.geometries = {}, r.geometries.boxes = [], r.geometries.spheres = [], r.geometries.cylinders = [], r.geometries.toruses = [], r.geometries.grounds = [], r.geometries.planes = [], r.geometries.torusKnots = [], r.geometries.vertexData = [], WF = [];
    const a = e.getGeometries();
    for (n = 0; n < a.length; n++) {
      const f = a[n];
      f.isReady() && GY(f, r.geometries);
    }
    for (r.meshes = [], n = 0; n < e.meshes.length; n++) {
      const f = e.meshes[n];
      if (f instanceof Ee) {
        const o = f;
        o.doNotSerialize || (o.delayLoadState === 1 || o.delayLoadState === 0) && r.meshes.push(wie(o, r));
      }
    }
    for (r.particleSystems = [], n = 0; n < e.particleSystems.length; n++)
      r.particleSystems.push(e.particleSystems[n].serialize(!1));
    for (r.postProcesses = [], n = 0; n < e.postProcesses.length; n++)
      r.postProcesses.push(e.postProcesses[n].serialize());
    e.actionManager && (r.actions = e.actionManager.serialize("scene"));
    for (const f of e._serializableComponents)
      f.serialize(r);
    return r;
  }
  /**
   * Serialize a scene into a JSON compatible object
   * @param scene defines the scene to serialize
   * @returns a JSON promise compatible object
   */
  static SerializeAsync(e) {
    const t = G2._Serialize(e, !1), r = [];
    return this._CollectPromises(t, r), Promise.all(r).then(() => t);
  }
  static _CollectPromises(e, t) {
    if (Array.isArray(e))
      for (let r = 0; r < e.length; ++r) {
        const n = e[r];
        n instanceof Promise ? t.push(n.then((i) => e[r] = i)) : (n instanceof Object || Array.isArray(n)) && this._CollectPromises(n, t);
      }
    else if (e instanceof Object) {
      for (const r in e)
        if (Object.prototype.hasOwnProperty.call(e, r)) {
          const n = e[r];
          n instanceof Promise ? t.push(n.then((i) => e[r] = i)) : (n instanceof Object || Array.isArray(n)) && this._CollectPromises(n, t);
        }
    }
  }
  /**
   * Serialize a mesh into a JSON compatible object
   * @param toSerialize defines the mesh to serialize
   * @param withParents defines if parents must be serialized as well
   * @param withChildren defines if children must be serialized as well
   * @returns a JSON compatible object
   */
  static SerializeMesh(e, t = !1, r = !1) {
    const n = {};
    if (n.meshes = [], n.transformNodes = [], n.cameras = [], n.lights = [], G2.ClearCache(), e = e instanceof Array ? e : [e], t || r)
      for (let i = 0; i < e.length; ++i)
        r && e[i].getDescendants().forEach((s) => {
          e.indexOf(s) < 0 && !s.doNotSerialize && e.push(s);
        }), t && e[i].parent && e.indexOf(e[i].parent) < 0 && !e[i].parent.doNotSerialize && e.push(e[i].parent);
    return e.forEach((i) => {
      fge(i, n);
    }), n;
  }
}
class aR {
  /**
   * Returns whether or not the VideoRecorder is available in your browser.
   * @param engine Defines the Babylon Engine.
   * @returns true if supported otherwise false.
   */
  static IsSupported(e) {
    const t = e.getRenderingCanvas();
    return !!t && typeof t.captureStream == "function";
  }
  /**
   * True when a recording is already in progress.
   */
  get isRecording() {
    return !!this._canvas && this._canvas.isRecording;
  }
  /**
   * Create a new VideoCapture object which can help converting what you see in Babylon to a video file.
   * @param engine Defines the BabylonJS Engine you wish to record.
   * @param options Defines options that can be used to customize the capture.
   */
  constructor(e, t = {}) {
    if (!aR.IsSupported(e))
      throw "Your browser does not support recording so far.";
    const r = e.getRenderingCanvas();
    if (!r)
      throw "The babylon engine must have a canvas to be recorded";
    this._canvas = r, this._canvas.isRecording = !1, this._options = Object.assign(Object.assign({}, aR._DefaultOptions), t);
    const n = this._canvas.captureStream(this._options.fps);
    if (this._options.audioTracks)
      for (const i of this._options.audioTracks)
        n.addTrack(i);
    this._mediaRecorder = new MediaRecorder(n, { mimeType: this._options.mimeType }), this._mediaRecorder.ondataavailable = (i) => this._handleDataAvailable(i), this._mediaRecorder.onerror = (i) => this._handleError(i), this._mediaRecorder.onstop = () => this._handleStop();
  }
  /**
   * Stops the current recording before the default capture timeout passed in the startRecording function.
   */
  stopRecording() {
    !this._canvas || !this._mediaRecorder || this.isRecording && (this._canvas.isRecording = !1, this._mediaRecorder.stop());
  }
  /**
   * Starts recording the canvas for a max duration specified in parameters.
   * @param fileName Defines the name of the file to be downloaded when the recording stop.
   * If null no automatic download will start and you can rely on the promise to get the data back.
   * @param maxDuration Defines the maximum recording time in seconds.
   * It defaults to 7 seconds. A value of zero will not stop automatically, you would need to call stopRecording manually.
   * @returns A promise callback at the end of the recording with the video data in Blob.
   */
  startRecording(e = "babylonjs.webm", t = 7) {
    if (!this._canvas || !this._mediaRecorder)
      throw "Recorder has already been disposed";
    if (this.isRecording)
      throw "Recording already in progress";
    return t > 0 && setTimeout(() => {
      this.stopRecording();
    }, t * 1e3), this._fileName = e, this._recordedChunks = [], this._resolve = null, this._reject = null, this._canvas.isRecording = !0, this._mediaRecorder.start(this._options.recordChunckSize), new Promise((r, n) => {
      this._resolve = r, this._reject = n;
    });
  }
  /**
   * Releases internal resources used during the recording.
   */
  dispose() {
    this._canvas = null, this._mediaRecorder = null, this._recordedChunks = [], this._fileName = null, this._resolve = null, this._reject = null;
  }
  _handleDataAvailable(e) {
    e.data.size > 0 && this._recordedChunks.push(e.data);
  }
  _handleError(e) {
    if (this.stopRecording(), this._reject)
      this._reject(e.error);
    else
      throw new e.error();
  }
  _handleStop() {
    this.stopRecording();
    const e = new Blob(this._recordedChunks);
    this._resolve && this._resolve(e), window.URL.createObjectURL(e), this._fileName && ye.Download(e, this._fileName);
  }
}
aR._DefaultOptions = {
  mimeType: "video/webm",
  fps: 25,
  recordChunckSize: 3e3
};
let Ex = null;
function PV(A, e, t, r, n = "image/png", i = !1, s) {
  const { height: a, width: f } = Bie(A, e, t);
  if (!(a && f)) {
    Se.Error("Invalid 'size' parameter !");
    return;
  }
  Ex || (Ex = document.createElement("canvas")), Ex.width = f, Ex.height = a;
  const o = Ex.getContext("2d"), d = A.getRenderWidth() / A.getRenderHeight();
  let v = f, u = v / d;
  u > a && (u = a, v = u * d);
  const l = Math.max(0, f - v) / 2, P = Math.max(0, a - u) / 2;
  e.getScene().activeCamera !== e ? cV(A, e, t, (c) => {
    if (i) {
      const H = new Blob([c]);
      ye.DownloadBlob(H), r && r("");
    } else
      r && r(c);
  }, n, 1, A.getCreationOptions().antialias, void 0, void 0, void 0, void 0, s) : A.onEndFrameObservable.addOnce(() => {
    const c = A.getRenderingCanvas();
    o && c && o.drawImage(c, l, P, v, u), Ex && (i ? (ye.EncodeScreenshotCanvasData(Ex, void 0, n, void 0, s), r && r("")) : ye.EncodeScreenshotCanvasData(Ex, r, n, void 0, s));
  });
}
function ZY(A, e, t, r = "image/png", n) {
  return new Promise((i, s) => {
    PV(A, e, t, (a) => {
      typeof a < "u" ? i(a) : s(new Error("Data is undefined"));
    }, r, void 0, n);
  });
}
function mie(A, e, t, r, n = "image/png", i) {
  return new Promise((s) => {
    PV(A, e, { width: t, height: r }, () => {
      s();
    }, n, !0, i);
  });
}
function cV(A, e, t, r, n = "image/png", i = 1, s = !1, a, f = !1, o = !1, d = !0, v, u) {
  const { height: l, width: P, finalWidth: p, finalHeight: c } = Bie(A, e, t), H = { width: P, height: l };
  if (!(l && P)) {
    Se.Error("Invalid 'size' parameter !");
    return;
  }
  const T = { width: A.getRenderWidth(), height: A.getRenderHeight() };
  A.setSize(P, l);
  const q = e.getScene(), b = new Ta("screenShot", H, q, !1, !1, 0, !1, We.BILINEAR_SAMPLINGMODE, void 0, o, void 0, void 0, void 0, i);
  b.renderList = q.meshes.slice(), b.samples = i, b.renderSprites = f, b.activeCamera = e, b.forceLayerMaskCheck = d, u == null || u(b);
  const j = () => {
    b.isReadyForRendering() && e.isReady(!0) ? (A.onEndFrameObservable.addOnce(() => {
      p === P && c === l ? b.readPixels(void 0, void 0, void 0, !1).then((m) => {
        eA.DumpData(P, l, m, r, n, a, !0, void 0, v), b.dispose();
      }) : ty("pass", b.getInternalTexture(), q, void 0, void 0, void 0, p, c).then((m) => {
        A._readTexturePixels(m, p, c, -1, 0, null, !0, !1, 0, 0).then((I) => {
          eA.DumpData(p, c, I, r, n, a, !0, void 0, v), m.dispose();
        });
      });
    }), b.render(!0), q.incrementRenderId(), q.resetCachedMaterial(), A.setSize(T.width, T.height), e.getProjectionMatrix(!0), q.render()) : setTimeout(j, 16);
  }, w = () => {
    q.incrementRenderId(), q.resetCachedMaterial(), j();
  };
  if (s) {
    const m = new ym("antialiasing", 1, q.activeCamera);
    b.addPostProcess(m), m.getEffect().isReady() ? w() : m.getEffect().onCompiled = () => {
      w();
    };
  } else
    w();
}
function _Y(A, e, t, r = "image/png", n = 1, i = !1, s, a = !1, f = !1, o = !0, d) {
  return new Promise((v, u) => {
    cV(A, e, t, (l) => {
      typeof l < "u" ? v(l) : u(new Error("Data is undefined"));
    }, r, n, i, s, a, f, o, d);
  });
}
function Bie(A, e, t) {
  let r = 0, n = 0, i = 0, s = 0;
  if (typeof t == "object") {
    const a = t.precision ? Math.abs(t.precision) : 1;
    t.width && t.height ? (r = t.height * a, n = t.width * a) : t.width && !t.height ? (n = t.width * a, r = Math.round(n / A.getAspectRatio(e))) : t.height && !t.width ? (r = t.height * a, n = Math.round(r * A.getAspectRatio(e))) : (n = Math.round(A.getRenderWidth() * a), r = Math.round(n / A.getAspectRatio(e))), t.finalWidth && t.finalHeight ? (s = t.finalHeight, i = t.finalWidth) : t.finalWidth && !t.finalHeight ? (i = t.finalWidth, s = Math.round(i / A.getAspectRatio(e))) : t.finalHeight && !t.finalWidth ? (s = t.finalHeight, i = Math.round(s * A.getAspectRatio(e))) : (i = n, s = r);
  } else
    isNaN(t) || (r = t, n = t, i = t, s = t);
  return n && (n = Math.floor(n)), r && (r = Math.floor(r)), i && (i = Math.floor(i)), s && (s = Math.floor(s)), { height: r | 0, width: n | 0, finalWidth: i | 0, finalHeight: s | 0 };
}
const Age = {
  /**
   * Captures a screenshot of the current rendering
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
   * @param engine defines the rendering engine
   * @param camera defines the source camera
   * @param size This parameter can be set to a single number or to an object with the
   * following (optional) properties: precision, width, height. If a single number is passed,
   * it will be used for both width and height. If an object is passed, the screenshot size
   * will be derived from the parameters. The precision property is a multiplier allowing
   * rendering at a higher or lower resolution
   * @param successCallback defines the callback receives a single parameter which contains the
   * screenshot as a string of base64-encoded characters. This string can be assigned to the
   * src parameter of an <img> to display it
   * @param mimeType defines the MIME type of the screenshot image (default: image/png).
   * Check your browser for supported MIME types
   * @param forceDownload force the system to download the image even if a successCallback is provided
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   */
  CreateScreenshot: PV,
  /**
   * Captures a screenshot of the current rendering
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
   * @param engine defines the rendering engine
   * @param camera defines the source camera
   * @param size This parameter can be set to a single number or to an object with the
   * following (optional) properties: precision, width, height. If a single number is passed,
   * it will be used for both width and height. If an object is passed, the screenshot size
   * will be derived from the parameters. The precision property is a multiplier allowing
   * rendering at a higher or lower resolution
   * @param mimeType defines the MIME type of the screenshot image (default: image/png).
   * Check your browser for supported MIME types
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   * @returns screenshot as a string of base64-encoded characters. This string can be assigned
   * to the src parameter of an <img> to display it
   */
  CreateScreenshotAsync: ZY,
  /**
   * Captures a screenshot of the current rendering for a specific size. This will render the entire canvas but will generate a blink (due to canvas resize)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
   * @param engine defines the rendering engine
   * @param camera defines the source camera
   * @param width defines the expected width
   * @param height defines the expected height
   * @param mimeType defines the MIME type of the screenshot image (default: image/png).
   * Check your browser for supported MIME types
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   * @returns screenshot as a string of base64-encoded characters. This string can be assigned
   * to the src parameter of an <img> to display it
   */
  CreateScreenshotWithResizeAsync: mie,
  /**
   * Generates an image screenshot from the specified camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
   * @param engine The engine to use for rendering
   * @param camera The camera to use for rendering
   * @param size This parameter can be set to a single number or to an object with the
   * following (optional) properties: precision, width, height. If a single number is passed,
   * it will be used for both width and height. If an object is passed, the screenshot size
   * will be derived from the parameters. The precision property is a multiplier allowing
   * rendering at a higher or lower resolution
   * @param successCallback The callback receives a single parameter which contains the
   * screenshot as a string of base64-encoded characters. This string can be assigned to the
   * src parameter of an <img> to display it
   * @param mimeType The MIME type of the screenshot image (default: image/png).
   * Check your browser for supported MIME types
   * @param samples Texture samples (default: 1)
   * @param antialiasing Whether antialiasing should be turned on or not (default: false)
   * @param fileName A name for for the downloaded file.
   * @param renderSprites Whether the sprites should be rendered or not (default: false)
   * @param enableStencilBuffer Whether the stencil buffer should be enabled or not (default: false)
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   */
  CreateScreenshotUsingRenderTarget: cV,
  /**
   * Generates an image screenshot from the specified camera.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
   * @param engine The engine to use for rendering
   * @param camera The camera to use for rendering
   * @param size This parameter can be set to a single number or to an object with the
   * following (optional) properties: precision, width, height. If a single number is passed,
   * it will be used for both width and height. If an object is passed, the screenshot size
   * will be derived from the parameters. The precision property is a multiplier allowing
   * rendering at a higher or lower resolution
   * @param mimeType The MIME type of the screenshot image (default: image/png).
   * Check your browser for supported MIME types
   * @param samples Texture samples (default: 1)
   * @param antialiasing Whether antialiasing should be turned on or not (default: false)
   * @param fileName A name for for the downloaded file.
   * @param renderSprites Whether the sprites should be rendered or not (default: false)
   * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
   * @returns screenshot as a string of base64-encoded characters. This string can be assigned
   * to the src parameter of an <img> to display it
   */
  CreateScreenshotUsingRenderTargetAsync: _Y
}, dge = () => {
  ye.CreateScreenshot = PV, ye.CreateScreenshotAsync = ZY, ye.CreateScreenshotUsingRenderTarget = cV, ye.CreateScreenshotUsingRenderTargetAsync = _Y;
};
dge();
var SF;
(function(A) {
  A[A.Checkbox = 0] = "Checkbox", A[A.Slider = 1] = "Slider", A[A.Vector3 = 2] = "Vector3", A[A.Quaternion = 3] = "Quaternion", A[A.Color3 = 4] = "Color3", A[A.String = 5] = "String", A[A.Button = 6] = "Button", A[A.Options = 7] = "Options", A[A.Tab = 8] = "Tab", A[A.FileButton = 9] = "FileButton", A[A.Vector2 = 10] = "Vector2";
})(SF || (SF = {}));
class gI {
  /**
   * Constructor
   * @param buffer The buffer to read
   */
  constructor(e) {
    this.byteOffset = 0, this.buffer = e;
  }
  /**
   * Loads the given byte length.
   * @param byteLength The byte length to load
   * @returns A promise that resolves when the load is complete
   */
  loadAsync(e) {
    return this.buffer.readAsync(this.byteOffset, e).then((t) => {
      this._dataView = new DataView(t.buffer, t.byteOffset, t.byteLength), this._dataByteOffset = 0;
    });
  }
  /**
   * Read a unsigned 32-bit integer from the currently loaded data range.
   * @returns The 32-bit integer read
   */
  readUint32() {
    const e = this._dataView.getUint32(this._dataByteOffset, !0);
    return this._dataByteOffset += 4, this.byteOffset += 4, e;
  }
  /**
   * Read a byte array from the currently loaded data range.
   * @param byteLength The byte length to read
   * @returns The byte array read
   */
  readUint8Array(e) {
    const t = new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + this._dataByteOffset, e);
    return this._dataByteOffset += e, this.byteOffset += e, t;
  }
  /**
   * Read a string from the currently loaded data range.
   * @param byteLength The byte length to read
   * @returns The string read
   */
  readString(e) {
    return QN(this.readUint8Array(e));
  }
  /**
   * Skips the given byte length the currently loaded data range.
   * @param byteLength The byte length to skip
   */
  skipBytes(e) {
    this._dataByteOffset += e, this.byteOffset += e;
  }
}
class UF {
  static _GetStorage() {
    try {
      return localStorage.setItem("test", ""), localStorage.removeItem("test"), localStorage;
    } catch {
      const t = {};
      return {
        getItem: (r) => {
          const n = t[r];
          return n === void 0 ? null : n;
        },
        setItem: (r, n) => {
          t[r] = n;
        }
      };
    }
  }
  /**
   * Reads a string from the data storage
   * @param key The key to read
   * @param defaultValue The value if the key doesn't exist
   * @returns The string value
   */
  static ReadString(e, t) {
    const r = this._Storage.getItem(e);
    return r !== null ? r : t;
  }
  /**
   * Writes a string to the data storage
   * @param key The key to write
   * @param value The value to write
   */
  static WriteString(e, t) {
    this._Storage.setItem(e, t);
  }
  /**
   * Reads a boolean from the data storage
   * @param key The key to read
   * @param defaultValue The value if the key doesn't exist
   * @returns The boolean value
   */
  static ReadBoolean(e, t) {
    const r = this._Storage.getItem(e);
    return r !== null ? r === "true" : t;
  }
  /**
   * Writes a boolean to the data storage
   * @param key The key to write
   * @param value The value to write
   */
  static WriteBoolean(e, t) {
    this._Storage.setItem(e, t ? "true" : "false");
  }
  /**
   * Reads a number from the data storage
   * @param key The key to read
   * @param defaultValue The value if the key doesn't exist
   * @returns The number value
   */
  static ReadNumber(e, t) {
    const r = this._Storage.getItem(e);
    return r !== null ? parseFloat(r) : t;
  }
  /**
   * Writes a number to the data storage
   * @param key The key to write
   * @param value The value to write
   */
  static WriteNumber(e, t) {
    this._Storage.setItem(e, t.toString());
  }
}
UF._Storage = UF._GetStorage();
class vge {
  constructor() {
    this._trackedScene = null;
  }
  /**
   * Track a given scene. This means the current scene state will be considered the original state
   * @param scene defines the scene to track
   */
  track(e) {
    this._trackedScene = e, jt.AllowLoadingUniqueId = !0, this._savedJSON = G2.Serialize(e), jt.AllowLoadingUniqueId = !1;
  }
  /**
   * Get the delta between current state and original state
   * @returns a any containing the delta
   */
  getDelta() {
    if (!this._trackedScene)
      return null;
    const e = We.ForceSerializeBuffers;
    We.ForceSerializeBuffers = !1, jt.AllowLoadingUniqueId = !0;
    const t = G2.Serialize(this._trackedScene);
    jt.AllowLoadingUniqueId = !1;
    const r = {};
    for (const n in t)
      this._compareCollections(n, this._savedJSON[n], t[n], r);
    return We.ForceSerializeBuffers = e, r;
  }
  _compareArray(e, t, r, n) {
    if (t.length === 0 && r.length === 0)
      return !0;
    if (t.length && !isNaN(t[0]) || r.length && !isNaN(r[0])) {
      if (t.length !== r.length)
        return !1;
      if (t.length === 0)
        return !0;
      for (let s = 0; s < t.length; s++)
        if (t[s] !== r[s])
          return n[e] = r, !1;
      return !0;
    }
    const i = [];
    for (let s = 0; s < t.length; s++) {
      const a = t[s], f = a.uniqueId;
      i.push(f);
      const o = r.filter((d) => d.uniqueId === f);
      if (o.length) {
        const d = o[0], v = {};
        this._compareObjects(a, d, v) || (n[e] || (n[e] = []), v.__state = {
          id: d.id || d.name
        }, n[e].push(v));
      } else {
        const d = {
          __state: {
            deleteId: a.id || a.name
          }
        };
        n[e] || (n[e] = []), n[e].push(d);
      }
    }
    for (let s = 0; s < r.length; s++) {
      const a = r[s], f = a.uniqueId;
      i.indexOf(f) === -1 && (n[e] || (n[e] = []), n[e].push(a));
    }
    return !0;
  }
  _compareObjects(e, t, r) {
    let n = !1;
    for (const i in e) {
      if (!Object.prototype.hasOwnProperty.call(e, i))
        continue;
      const s = e[i], a = t[i];
      let f = !1;
      if (Array.isArray(s))
        f = JSON.stringify(s) !== JSON.stringify(a);
      else if (!isNaN(s) || Object.prototype.toString.call(s) == "[object String]")
        f = s !== a;
      else if (typeof s == "object" && typeof a == "object") {
        const o = {};
        this._compareObjects(s, a, o) || (r[i] = o, n = !0);
      }
      f && (n = !0, r[i] = a);
    }
    return !n;
  }
  _compareCollections(e, t, r, n) {
    if (t !== r && t && r) {
      if (Array.isArray(t) && Array.isArray(r)) {
        if (this._compareArray(e, t, r, n))
          return;
      } else if (typeof t == "object" && typeof r == "object") {
        const i = {};
        this._compareObjects(t, r, i) || (n[e] = i);
        return;
      }
    }
  }
  static GetShadowGeneratorById(e, t) {
    const r = e.lights.map((n) => n.getShadowGenerators());
    for (const n of r)
      if (n) {
        const i = n.values();
        for (let s = i.next(); s.done !== !0; s = i.next()) {
          const a = s.value;
          if (a && a.id === t)
            return a;
        }
      }
    return null;
  }
  /**
   * Apply a given delta to a given scene
   * @param deltaJSON defines the JSON containing the delta
   * @param scene defines the scene to apply the delta to
   */
  static ApplyDelta(e, t) {
    typeof e == "string" && (e = JSON.parse(e));
    const r = t;
    for (const n in e) {
      const i = e[n], s = r[n];
      if (Array.isArray(s) || n === "shadowGenerators")
        switch (n) {
          case "cameras":
            this._ApplyDeltaForEntity(i, t, t.getCameraById.bind(t), (a) => Tr.Parse(a, t));
            break;
          case "lights":
            this._ApplyDeltaForEntity(i, t, t.getLightById.bind(t), (a) => ci.Parse(a, t));
            break;
          case "shadowGenerators":
            this._ApplyDeltaForEntity(i, t, (a) => this.GetShadowGeneratorById(t, a), (a) => ln.Parse(a, t));
            break;
          case "meshes":
            this._ApplyDeltaForEntity(i, t, t.getMeshById.bind(t), (a) => Ee.Parse(a, t, ""));
            break;
          case "skeletons":
            this._ApplyDeltaForEntity(i, t, t.getSkeletonById.bind(t), (a) => r4.Parse(a, t));
            break;
          case "materials":
            this._ApplyDeltaForEntity(i, t, t.getMaterialById.bind(t), (a) => gt.Parse(a, t, ""));
            break;
          case "multiMaterials":
            this._ApplyDeltaForEntity(i, t, t.getMaterialById.bind(t), (a) => Dc.Parse(a, t, ""));
            break;
          case "transformNodes":
            this._ApplyDeltaForEntity(i, t, t.getTransformNodeById.bind(t), (a) => Hr.Parse(a, t, ""));
            break;
          case "particleSystems":
            this._ApplyDeltaForEntity(i, t, t.getParticleSystemById.bind(t), (a) => ti.Parse(a, t, ""));
            break;
          case "morphTargetManagers":
            this._ApplyDeltaForEntity(i, t, t.getMorphTargetById.bind(t), (a) => U0.Parse(a, t));
            break;
          case "postProcesses":
            this._ApplyDeltaForEntity(i, t, t.getPostProcessByName.bind(t), (a) => kr.Parse(a, t, ""));
            break;
        }
      else
        isNaN(s) ? s.fromArray && s.fromArray(i) : r[n] = i;
    }
  }
  static _ApplyPropertiesToEntity(e, t) {
    for (const r in e) {
      const n = e[r], i = t[r];
      i !== void 0 && (!isNaN(i) || Array.isArray(i) ? t[r] = n : i.fromArray ? i.fromArray(n) : typeof i == "object" && i !== null && this._ApplyPropertiesToEntity(n, i));
    }
  }
  static _ApplyDeltaForEntity(e, t, r, n) {
    for (const i of e)
      if (i.__state && i.__state.id !== void 0) {
        const s = r(i.__state.id);
        s && (this._ApplyPropertiesToEntity(i, s), jt.ParseProperties(i, s, t, null));
      } else if (i.__state && i.__state.deleteId !== void 0) {
        const s = r(i.__state.deleteId);
        s == null || s.dispose();
      } else
        n(i);
  }
}
var LS;
(function(A) {
  class e {
    /**
     * Serialize the Alphabet to JSON string.
     * @returns JSON serialization
     */
    serialize() {
      const n = {}, i = new Array(this._characterToIdx.size);
      return this._characterToIdx.forEach((s, a) => {
        i[s] = a;
      }), n.characters = i, n.insertionCosts = this._insertionCosts, n.deletionCosts = this._deletionCosts, n.substitutionCosts = this._substitutionCosts, JSON.stringify(n);
    }
    /**
     * Parse an Alphabet from a JSON serialization.
     * @param json JSON string to deserialize
     * @returns deserialized Alphabet
     */
    static Deserialize(n) {
      const i = JSON.parse(n), s = new e(i.characters);
      return s._insertionCosts = i.insertionCosts, s._deletionCosts = i.deletionCosts, s._substitutionCosts = i.substitutionCosts, s;
    }
    /**
     * Create a new Alphabet.
     * @param characters characters of the alphabet
     * @param charToInsertionCost function mapping characters to insertion costs
     * @param charToDeletionCost function mapping characters to deletion costs
     * @param charsToSubstitutionCost function mapping character pairs to substitution costs
     */
    constructor(n, i = null, s = null, a = null) {
      i = i ?? (() => 1), s = s ?? (() => 1), a = a ?? ((o, d) => o === d ? 0 : 1), this._characterToIdx = /* @__PURE__ */ new Map(), this._insertionCosts = new Array(n.length), this._deletionCosts = new Array(n.length), this._substitutionCosts = new Array(n.length);
      let f;
      for (let o = 0; o < n.length; ++o) {
        f = n[o], this._characterToIdx.set(f, o), this._insertionCosts[o] = i(f), this._deletionCosts[o] = s(f), this._substitutionCosts[o] = new Array(n.length);
        for (let d = o; d < n.length; ++d)
          this._substitutionCosts[o][d] = a(f, n[d]);
      }
    }
    /**
     * Get the index (internally-assigned number) for a character.
     * @param char character
     * @returns index
     */
    getCharacterIdx(n) {
      return this._characterToIdx.get(n);
    }
    /**
     * Get the insertion cost of a character from its index.
     * @param idx character index
     * @returns insertion cost
     */
    getInsertionCost(n) {
      return this._insertionCosts[n];
    }
    /**
     * Get the deletion cost of a character from its index.
     * @param idx character index
     * @returns deletion cost
     */
    getDeletionCost(n) {
      return this._deletionCosts[n];
    }
    /**
     * Gets the cost to substitute two characters. NOTE: this cost is
     * required to be bi-directional, meaning it cannot matter which of
     * the provided characters is being removed and which is being inserted.
     * @param idx1 the first character index
     * @param idx2 the second character index
     * @returns substitution cost
     */
    getSubstitutionCost(n, i) {
      const s = Math.min(n, i), a = Math.max(n, i);
      return this._substitutionCosts[s][a];
    }
  }
  A.Alphabet = e;
  class t {
    /**
     * Serialize to JSON string. JSON representation does NOT include the Alphabet
     * from which this Sequence was created; Alphabet must be independently
     * serialized.
     * @returns JSON string
     */
    serialize() {
      return JSON.stringify(this._characters);
    }
    /**
     * Deserialize from JSON string and Alphabet. This should be the same Alphabet
     * from which the Sequence was originally created, which must be serialized and
     * deserialized independently so that it can be passed in here.
     * @param json JSON string representation of Sequence
     * @param alphabet Alphabet from which Sequence was originally created
     * @returns Sequence
     */
    static Deserialize(n, i) {
      const s = new t([], i);
      return s._characters = JSON.parse(n), s;
    }
    /**
     * Create a new Sequence.
     * @param characters characters in the new Sequence
     * @param alphabet Alphabet, which must include all used characters
     */
    constructor(n, i) {
      if (n.length > t._MAX_SEQUENCE_LENGTH)
        throw new Error("Sequences longer than " + t._MAX_SEQUENCE_LENGTH + " not supported.");
      this._alphabet = i, this._characters = n.map((s) => this._alphabet.getCharacterIdx(s));
    }
    /**
     * Get the distance between this Sequence and another.
     * @param other sequence to compare to
     * @returns Levenshtein distance
     */
    distance(n) {
      return t._Distance(this, n);
    }
    /**
     * Compute the Levenshtein distance between two Sequences.
     * @param a first Sequence
     * @param b second Sequence
     * @returns Levenshtein distance
     */
    static _Distance(n, i) {
      const s = n._alphabet;
      if (s !== i._alphabet)
        throw new Error("Cannot Levenshtein compare Sequences built from different alphabets.");
      const a = n._characters, f = i._characters, o = a.length, d = f.length, v = t._CostMatrix;
      v[0][0] = 0;
      for (let u = 0; u < o; ++u)
        v[u + 1][0] = v[u][0] + s.getInsertionCost(a[u]);
      for (let u = 0; u < d; ++u)
        v[0][u + 1] = v[0][u] + s.getInsertionCost(f[u]);
      for (let u = 0; u < o; ++u)
        for (let l = 0; l < d; ++l)
          t._InsertionCost = v[u + 1][l] + s.getInsertionCost(f[l]), t._DeletionCost = v[u][l + 1] + s.getDeletionCost(a[u]), t._SubstitutionCost = v[u][l] + s.getSubstitutionCost(a[u], f[l]), v[u + 1][l + 1] = Math.min(t._InsertionCost, t._DeletionCost, t._SubstitutionCost);
      return v[o][d];
    }
  }
  t._MAX_SEQUENCE_LENGTH = 256, t._CostMatrix = [...Array(t._MAX_SEQUENCE_LENGTH + 1)].map(() => new Array(t._MAX_SEQUENCE_LENGTH + 1)), A.Sequence = t;
})(LS || (LS = {}));
class fa {
  /**
   * Serialize to JSON.
   * @returns serialized JSON string
   */
  serialize() {
    return JSON.stringify(this);
  }
  /**
   * Deserialize from JSON.
   * @param json serialized JSON string
   * @returns deserialized Trajectory
   */
  static Deserialize(e) {
    const t = JSON.parse(e), r = new fa(t._segmentLength);
    return r._points = t._points.map((n) => new S(n._x, n._y, n._z)), r;
  }
  /**
   * Create a new empty Trajectory.
   * @param segmentLength radius of discretization for Trajectory points
   */
  constructor(e = 0.01) {
    this._points = [], this._segmentLength = e;
  }
  /**
   * Get the length of the Trajectory.
   * @returns length of the Trajectory
   */
  getLength() {
    return this._points.length * this._segmentLength;
  }
  /**
   * Append a new point to the Trajectory.
   * NOTE: This implementation has many allocations.
   * @param point point to append to the Trajectory
   */
  add(e) {
    let t = this._points.length;
    if (t === 0)
      this._points.push(e.clone());
    else {
      const r = () => this._segmentLength / S.Distance(this._points[t - 1], e);
      for (let n = r(); n <= 1; n = r()) {
        const i = this._points[t - 1].scale(1 - n);
        e.scaleAndAddToRef(n, i), this._points.push(i), ++t;
      }
    }
  }
  /**
   * Create a new Trajectory with a segment length chosen to make it
   * probable that the new Trajectory will have a specified number of
   * segments. This operation is imprecise.
   * @param targetResolution number of segments desired
   * @returns new Trajectory with approximately the requested number of segments
   */
  resampleAtTargetResolution(e) {
    const t = new fa(this.getLength() / e);
    return this._points.forEach((r) => {
      t.add(r);
    }), t;
  }
  /**
   * Convert Trajectory segments into tokenized representation. This
   * representation is an array of numbers where each nth number is the
   * index of the token which is most similar to the nth segment of the
   * Trajectory.
   * @param tokens list of vectors which serve as discrete tokens
   * @returns list of indices of most similar token per segment
   */
  tokenize(e) {
    const t = [], r = new S();
    for (let n = 2; n < this._points.length; ++n)
      fa._TransformSegmentDirToRef(this._points[n - 2], this._points[n - 1], this._points[n], r) && t.push(fa._TokenizeSegment(r, e));
    return t;
  }
  /**
   * Transform the rotation (i.e., direction) of a segment to isolate
   * the relative transformation represented by the segment. This operation
   * may or may not succeed due to singularities in the equations that define
   * motion relativity in this context.
   * @param priorVec the origin of the prior segment
   * @param fromVec the origin of the current segment
   * @param toVec the destination of the current segment
   * @param result reference to output variable
   * @returns whether or not transformation was successful
   */
  static _TransformSegmentDirToRef(e, t, r, n) {
    return t.subtractToRef(e, fa._ForwardDir), fa._ForwardDir.normalize(), t.scaleToRef(-1, fa._InverseFromVec), fa._InverseFromVec.normalize(), Math.abs(S.Dot(fa._ForwardDir, fa._InverseFromVec)) > 0.98 ? !1 : (S.CrossToRef(fa._ForwardDir, fa._InverseFromVec, fa._UpDir), fa._UpDir.normalize(), he.LookAtLHToRef(e, t, fa._UpDir, fa._LookMatrix), r.subtractToRef(t, fa._FromToVec), fa._FromToVec.normalize(), S.TransformNormalToRef(fa._FromToVec, fa._LookMatrix, n), !0);
  }
  /**
   * Determine which token vector is most similar to the
   * segment vector.
   * @param segment segment vector
   * @param tokens token vector list
   * @returns index of the most similar token to the segment
   */
  static _TokenizeSegment(e, t) {
    fa._BestMatch = 0, fa._Score = S.Dot(e, t[0]), fa._BestScore = fa._Score;
    for (let r = 1; r < t.length; ++r)
      fa._Score = S.Dot(e, t[r]), fa._Score > fa._BestScore && (fa._BestMatch = r, fa._BestScore = fa._Score);
    return fa._BestMatch;
  }
}
fa._ForwardDir = new S();
fa._InverseFromVec = new S();
fa._UpDir = new S();
fa._FromToVec = new S();
fa._LookMatrix = new he();
class oR {
  /**
   * Helper method to create new "spikeball" Vector3Alphabets. Uses a naive
   * optimize-from-random strategy to space points around the unit sphere
   * surface as a simple alternative to really doing the math to tile the
   * sphere.
   * @param alphabetSize size of the desired alphabet
   * @param iterations number of iterations over which to optimize the "spikeball"
   * @param startingStepSize distance factor to move points in early optimization iterations
   * @param endingStepSize distance factor to move points in late optimization iterations
   * @param fixedValues alphabet "characters" that are required and cannot be moved by optimization
   * @returns a new randomly generated and optimized Vector3Alphabet of the specified size
   */
  static Generate(e = 64, t = 256, r = 0.1, n = 1e-3, i = []) {
    const f = new oR(e);
    for (let P = 0; P < e; ++P)
      f.chars[P] = new S(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5), f.chars[P].normalize();
    for (let P = 0; P < i.length; ++P)
      f.chars[P].copyFrom(i[P]);
    let o, d;
    const v = new S(), u = new S(), l = (P, p, c) => (1 - c) * P + c * p;
    for (let P = 0; P < t; ++P) {
      o = l(r, n, P / (t - 1));
      for (let p = i.length; p < f.chars.length; ++p)
        v.copyFromFloats(0, 0, 0), f.chars.forEach((c) => {
          f.chars[p].subtractToRef(c, u), d = u.lengthSquared(), d > 1e-6 && u.scaleAndAddToRef(1 / (u.lengthSquared() * d), v);
        }), v.scaleInPlace(o), f.chars[p].addInPlace(v), f.chars[p].normalize();
    }
    return f;
  }
  /**
   * Serialize to JSON.
   * @returns JSON serialization
   */
  serialize() {
    return JSON.stringify(this.chars);
  }
  /**
   * Deserialize from JSON.
   * @param json JSON serialization
   * @returns deserialized Vector3Alphabet
   */
  static Deserialize(e) {
    const t = JSON.parse(e), r = new oR(t.length);
    for (let n = 0; n < t.length; ++n)
      r.chars[n] = new S(t[n]._x, t[n]._y, t[n]._z);
    return r;
  }
  constructor(e) {
    this.chars = new Array(e);
  }
}
class M2 {
  /**
   * Serialize to JSON.
   * @returns JSON serialization
   */
  serialize() {
    return JSON.stringify(this._sequences.map((e) => e.serialize()));
  }
  /**
   * Deserialize from JSON string and Alphabet. This should be the same Alphabet
   * from which the descriptor was originally created, which must be serialized and
   * deserialized independently so that it can be passed in here.
   * @param json JSON serialization
   * @param alphabet Alphabet from which descriptor was originally created
   * @returns deserialized TrajectoryDescriptor
   */
  static Deserialize(e, t) {
    const r = new M2();
    return r._sequences = JSON.parse(e).map((n) => LS.Sequence.Deserialize(n, t)), r;
  }
  /**
   * Create a new TrajectoryDescriptor to describe a provided Trajectory according
   * to the provided alphabets.
   * @param trajectory Trajectory to be described
   * @param vector3Alphabet Vector3Alphabet to be used to tokenize the Trajectory
   * @param levenshteinAlphabet Levenshtein.Alphabet to be used as basis for comparison with other descriptors
   * @returns TrajectoryDescriptor describing provided Trajectory
   */
  static CreateFromTrajectory(e, t, r) {
    return M2.CreateFromTokenizationPyramid(M2._GetTokenizationPyramid(e, t), r);
  }
  /**
   * Create a new TrajectoryDescriptor from a pre-existing pyramid of tokens.
   * NOTE: This function exists to support an outdated serialization mechanism and should
   * be deleted if it is no longer useful.
   * @param pyramid tokenization pyramid
   * @param levenshteinAlphabet Levenshtein.Alphabet to be uses as basis for comparison with other descriptors
   * @returns TrajectoryDescriptor describing the Trajectory from which the pyramid was built
   */
  static CreateFromTokenizationPyramid(e, t) {
    const r = new M2();
    return r._sequences = e.map((n) => new LS.Sequence(n, t)), r;
  }
  constructor() {
    this._sequences = [];
  }
  /**
   * Create the tokenization pyramid for the provided Trajectory according to the given
   * Vector3Alphabet.
   * @param trajectory Trajectory to be tokenized
   * @param alphabet Vector3Alphabet containing tokens
   * @param targetResolution finest resolution of descriptor
   * @returns tokenization pyramid for Trajectory
   */
  static _GetTokenizationPyramid(e, t, r = M2._FINEST_DESCRIPTOR_RESOLUTION) {
    const n = [];
    for (let i = r; i > 4; i = Math.floor(i / 2))
      n.push(e.resampleAtTargetResolution(i).tokenize(t.chars));
    return n;
  }
  /**
   * Calculate a distance metric between this TrajectoryDescriptor and another. This is
   * essentially a similarity score and does not directly represent Euclidean distance,
   * edit distance, or any other formal distance metric.
   * @param other TrajectoryDescriptor from which to determine distance
   * @returns distance, a nonnegative similarity score where larger values indicate dissimilarity
   */
  distance(e) {
    let t = 0, r;
    for (let n = 0; n < this._sequences.length; ++n)
      r = Math.pow(2, n), t += r * this._sequences[n].distance(e._sequences[n]);
    return t;
  }
}
M2._FINEST_DESCRIPTOR_RESOLUTION = 32;
class KS {
  /**
   * Serialize to JSON.
   * @returns JSON serialization
   */
  serialize() {
    const e = {};
    return e.descriptors = this._descriptors.map((t) => t.serialize()), e.centroidIdx = this._centroidIdx, e.averageDistance = this._averageDistance, JSON.stringify(e);
  }
  /**
   * Deserialize from JSON string and Alphabet. This should be the same Alphabet
   * from which the descriptors were originally created, which must be serialized and
   * deserialized independently so that it can be passed in here.
   * @param json JSON string representation
   * @param alphabet Alphabet from which TrajectoryDescriptors were originally created
   * @returns deserialized TrajectoryDescriptor
   */
  static Deserialize(e, t) {
    const r = JSON.parse(e), n = new KS();
    return n._descriptors = r.descriptors.map((i) => M2.Deserialize(i, t)), n._centroidIdx = r.centroidIdx, n._averageDistance = r.averageDistance, n;
  }
  /**
   * Create a new DescribedTrajectory.
   * @param descriptors currently-known TrajectoryDescriptors, if any
   */
  constructor(e = []) {
    this._descriptors = e, this._centroidIdx = -1, this._averageDistance = 0, this._refreshDescription();
  }
  /**
   * Add a new TrajectoryDescriptor to the list of descriptors known to describe
   * this same DescribedTrajectory.
   * @param descriptor descriptor to be added
   */
  add(e) {
    this._descriptors.push(e), this._refreshDescription();
  }
  /**
   * Compute the cost, which is inversely related to the likelihood that the provided
   * TrajectoryDescriptor describes a Trajectory that is considered to be the same as
   * the class represented by this DescribedTrajectory.
   * @param descriptor the descriptor to be costed
   * @returns cost of the match, which is a nonnegative similarity metric where larger values indicate dissimilarity
   */
  getMatchCost(e) {
    return e.distance(this._descriptors[this._centroidIdx]) / this._averageDistance;
  }
  /**
   * Compute the minimum distance between the queried TrajectoryDescriptor and a
   * descriptor which is a member of this collection. This is an alternative way of
   * conceptualizing match cost from getMatchCost(), and it serves a different function.
   * @param descriptor the descriptor to find the minimum distance to
   * @returns minimum descriptor distance to a member descriptor of this DescribedTrajectory
   */
  getMatchMinimumDistance(e) {
    return Math.min(...this._descriptors.map((t) => t.distance(e)));
  }
  /**
   * Refreshes the internal representation of this DescribedTrajectory.
   */
  _refreshDescription() {
    this._centroidIdx = -1;
    let e;
    const t = this._descriptors.map((r) => (e = 0, this._descriptors.forEach((n) => {
      e += r.distance(n);
    }), e));
    for (let r = 0; r < t.length; ++r)
      (this._centroidIdx < 0 || t[r] < t[this._centroidIdx]) && (this._centroidIdx = r);
    this._averageDistance = 0, this._descriptors.forEach((r) => {
      this._averageDistance += r.distance(this._descriptors[this._centroidIdx]);
    }), this._descriptors.length > 0 && (this._averageDistance = Math.max(this._averageDistance / this._descriptors.length, KS._MIN_AVERAGE_DISTANCE));
  }
}
KS._MIN_AVERAGE_DISTANCE = 1;
class vO {
  /**
   * Serialize to JSON.
   * @returns JSON serialization
   */
  serialize() {
    const e = {};
    return e.maximumAllowableMatchCost = this._maximumAllowableMatchCost, e.vector3Alphabet = this._vector3Alphabet.serialize(), e.levenshteinAlphabet = this._levenshteinAlphabet.serialize(), e.nameToDescribedTrajectory = [], this._nameToDescribedTrajectory.forEach((t, r) => {
      e.nameToDescribedTrajectory.push(r), e.nameToDescribedTrajectory.push(t.serialize());
    }), JSON.stringify(e);
  }
  /**
   * Deserialize from JSON.
   * @param json JSON serialization
   * @returns deserialized TrajectorySet
   */
  static Deserialize(e) {
    const t = JSON.parse(e), r = new vO();
    r._maximumAllowableMatchCost = t.maximumAllowableMatchCost, r._vector3Alphabet = oR.Deserialize(t.vector3Alphabet), r._levenshteinAlphabet = LS.Alphabet.Deserialize(t.levenshteinAlphabet);
    for (let n = 0; n < t.nameToDescribedTrajectory.length; n += 2)
      r._nameToDescribedTrajectory.set(t.nameToDescribedTrajectory[n], KS.Deserialize(t.nameToDescribedTrajectory[n + 1], r._levenshteinAlphabet));
    return r;
  }
  /**
   * Initialize a new empty TrajectorySet with auto-generated Alphabets.
   * VERY naive, need to be generating these things from known
   * sets. Better version later, probably eliminating this one.
   * @returns auto-generated TrajectorySet
   */
  static Generate() {
    const e = oR.Generate(64, 256, 0.1, 1e-3, [S.Forward()]), t = new Array(e.chars.length);
    for (let i = 0; i < t.length; ++i)
      t[i] = i;
    const r = new LS.Alphabet(t, (i) => i === 0 ? 0 : 1, (i) => i === 0 ? 0 : 1, (i, s) => Math.min(1 - S.Dot(e.chars[i], e.chars[s]), 1)), n = new vO();
    return n._vector3Alphabet = e, n._levenshteinAlphabet = r, n;
  }
  constructor() {
    this._maximumAllowableMatchCost = 4, this._nameToDescribedTrajectory = /* @__PURE__ */ new Map();
  }
  /**
   * Add a new Trajectory to the set with a given name.
   * @param trajectory new Trajectory to be added
   * @param classification name to which to add the Trajectory
   */
  addTrajectoryToClassification(e, t) {
    this._nameToDescribedTrajectory.has(t) || this._nameToDescribedTrajectory.set(t, new KS()), this._nameToDescribedTrajectory.get(t).add(M2.CreateFromTrajectory(e, this._vector3Alphabet, this._levenshteinAlphabet));
  }
  /**
   * Remove a known named trajectory and all Trajectories associated with it.
   * @param classification name to remove
   * @returns whether anything was removed
   */
  deleteClassification(e) {
    return this._nameToDescribedTrajectory.delete(e);
  }
  /**
   * Attempt to recognize a Trajectory from among all the classifications
   * already known to the classifier.
   * @param trajectory Trajectory to be recognized
   * @returns classification of Trajectory if recognized, null otherwise
   */
  classifyTrajectory(e) {
    const t = M2.CreateFromTrajectory(e, this._vector3Alphabet, this._levenshteinAlphabet), r = [];
    if (this._nameToDescribedTrajectory.forEach((a, f) => {
      a.getMatchCost(t) < this._maximumAllowableMatchCost && r.push(f);
    }), r.length === 0)
      return null;
    let n = 0, i = this._nameToDescribedTrajectory.get(r[n]).getMatchMinimumDistance(t), s;
    for (let a = 0; a < r.length; ++a)
      s = this._nameToDescribedTrajectory.get(r[a]).getMatchMinimumDistance(t), s < i && (i = s, n = a);
    return r[n];
  }
}
class fR {
  /**
   * Constructs a reflector object.
   * @param scene The scene to use
   * @param hostname The hostname of the reflector bridge
   * @param port The port of the reflector bridge
   */
  constructor(e, t, r) {
    this._scene = e, Se.Log(`[Reflector] Connecting to ws://${t}:${r}`), this._webSocket = new WebSocket(`ws://${t}:${r}`), this._webSocket.onmessage = (n) => {
      const i = n.data;
      if (i.startsWith(fR._SERVER_PREFIX)) {
        const s = i.substr(fR._SERVER_PREFIX.length);
        Se.Log(`[Reflector] Received server message: ${s.substr(0, 64)}`), this._handleServerMessage(s);
        return;
      } else
        Se.Log(`[Reflector] Received client message: ${i.substr(0, 64)}`), this._handleClientMessage();
    }, this._webSocket.onclose = (n) => {
      Se.Log(`[Reflector] Disconnected ${n.code} ${n.reason}`);
    };
  }
  /**
   * Closes the reflector connection
   */
  close() {
    this._webSocket.close();
  }
  _handleServerMessage(e) {
    switch (e) {
      case "connected": {
        G2.SerializeAsync(this._scene).then((t) => {
          this._webSocket.send(`load|${JSON.stringify(t)}`);
        });
        break;
      }
    }
  }
  _handleClientMessage() {
  }
}
fR._SERVER_PREFIX = "$$";
class Vy {
  /**
   * A pressure observer will call this callback, whenever these thresholds are met.
   * @param options An object containing the thresholds used to decide what value to to return for each update property (average of start and end of a threshold boundary).
   */
  constructor(e) {
    this._observer = null, this._currentState = [], this.onPressureChanged = new Oe(), Vy.IsAvailable && (this._observer = new PressureObserver((t) => {
      this._currentState = t, this.onPressureChanged.notifyObservers(t);
    }, e));
  }
  /**
   * Returns true if PressureObserver is available for use, false otherwise.
   */
  static get IsAvailable() {
    return typeof PressureObserver < "u" && PressureObserver.supportedSources.includes("cpu");
  }
  /**
   * Method that must be called to begin observing changes, and triggering callbacks.
   * @param source defines the source to observe
   */
  observe(e) {
    var t;
    try {
      (t = this._observer) === null || t === void 0 || t.observe(e), this.onPressureChanged.notifyObservers(this._currentState);
    } catch {
    }
  }
  /**
   * Method that must be called to stop observing changes and triggering callbacks (cleanup function).
   * @param source defines the source to unobserve
   */
  unobserve(e) {
    var t;
    try {
      (t = this._observer) === null || t === void 0 || t.unobserve(e);
    } catch {
    }
  }
  /**
   * Release the associated resources.
   */
  dispose() {
    var e;
    (e = this._observer) === null || e === void 0 || e.disconnect(), this._observer = null, this.onPressureChanged.clear();
  }
}
const uge = 1.5;
class M8 {
  /**
   * Creates a new DynamicFloat32Array with the desired item capacity.
   * @param itemCapacity The initial item capacity you would like to set for the array.
   */
  constructor(e) {
    this._view = new Float32Array(e), this._itemLength = 0;
  }
  /**
   * The number of items currently in the array.
   */
  get itemLength() {
    return this._itemLength;
  }
  /**
   * Gets value at index, NaN if no such index exists.
   * @param index the index to get the value at.
   * @returns the value at the index provided.
   */
  at(e) {
    return e < 0 || e >= this._itemLength ? NaN : this._view[e];
  }
  /**
   * Gets a view of the original array from start to end (exclusive of end).
   * @param start starting index.
   * @param end ending index.
   * @returns a subarray of the original array.
   */
  subarray(e, t) {
    return e >= t || e < 0 ? new Float32Array(0) : (t > this._itemLength && (t = this._itemLength), this._view.subarray(e, t));
  }
  /**
   * Pushes items to the end of the array.
   * @param item The item to push into the array.
   */
  push(e) {
    this._view[this._itemLength] = e, this._itemLength++, this._itemLength >= this._view.length && this._growArray();
  }
  /**
   * Grows the array by the growth factor when necessary.
   */
  _growArray() {
    const e = Math.floor(this._view.length * uge), t = new Float32Array(e);
    t.set(this._view), this._view = t;
  }
}
const Fx = 1800, lge = 24, Pge = "0", $G = "timestamp", eZ = "numPoints", cge = /\r/g, RE = "@";
class b0 {
  /**
   * The offset for when actual data values start appearing inside a slice.
   */
  static get SliceDataOffset() {
    return 2;
  }
  /**
   * The offset for the value of the number of points inside a slice.
   */
  static get NumberOfPointsOffset() {
    return 1;
  }
  /**
   * Handles the creation of a performance viewer collector.
   * @param _scene the scene to collect on.
   * @param _enabledStrategyCallbacks the list of data to collect with callbacks for initialization purposes.
   */
  constructor(e, t) {
    this._scene = e, this._collectDataAtFrame = () => {
      const r = Yi.Now - this._startingTimestamp, n = this.datasets.ids.length, i = this.datasets.startingIndices.itemLength;
      let s = 0;
      if (i > 0) {
        const a = this.datasets.startingIndices.at(i - 1);
        s = a + this.datasets.data.at(a + b0.NumberOfPointsOffset) + b0.SliceDataOffset;
      }
      if (this.datasets.startingIndices.push(s), this.datasets.data.push(r), this.datasets.data.push(n), this.datasets.ids.forEach((a) => {
        const f = this._strategies.get(a);
        f && this.datasets.data.push(f.getData());
      }), this.datasetObservable.hasObservers()) {
        const a = [r, n];
        for (let f = 0; f < n; f++)
          a.push(this.datasets.data.at(s + b0.SliceDataOffset + f));
        this.datasetObservable.notifyObservers(a);
      }
    }, this.datasets = {
      ids: [],
      data: new M8(Fx),
      startingIndices: new M8(Fx)
    }, this._strategies = /* @__PURE__ */ new Map(), this._datasetMeta = /* @__PURE__ */ new Map(), this._eventRestoreSet = /* @__PURE__ */ new Set(), this._customEventObservable = new Oe(), this.datasetObservable = new Oe(), this.metadataObservable = new Oe((r) => r.callback(this._datasetMeta, new IN(0))), t && this.addCollectionStrategies(...t);
  }
  /**
   * Registers a custom string event which will be callable via sendEvent. This method returns an event object which will contain the id of the event.
   * The user can set a value optionally, which will be used in the sendEvent method. If the value is set, we will record this value at the end of each frame,
   * if not we will increment our counter and record the value of the counter at the end of each frame. The value recorded is 0 if no sendEvent method is called, within a frame.
   * @param name The name of the event to register
   * @param forceUpdate if the code should force add an event, and replace the last one.
   * @param category the category for that event
   * @returns The event registered, used in sendEvent
   */
  registerEvent(e, t, r) {
    var n;
    if (this._strategies.has(e) && !t)
      return;
    this._strategies.has(e) && t && ((n = this._strategies.get(e)) === null || n === void 0 || n.dispose(), this._strategies.delete(e));
    const i = (a) => {
      let f = 0, o = 0;
      const d = a.onAfterRenderObservable.add(() => {
        o = f, f = 0;
      }), v = this._customEventObservable.add((u) => {
        e === u.name && (u.value !== void 0 ? f = u.value : f++);
      });
      return {
        id: e,
        getData: () => o,
        dispose: () => {
          a.onAfterRenderObservable.remove(d), this._customEventObservable.remove(v);
        }
      };
    }, s = {
      name: e
    };
    return this._eventRestoreSet.add(e), this.addCollectionStrategies({ strategyCallback: i, category: r }), s;
  }
  /**
   * Lets the perf collector handle an event, occurences or event value depending on if the event.value params is set.
   * @param event the event to handle an occurence for
   */
  sendEvent(e) {
    this._customEventObservable.notifyObservers(e);
  }
  /**
   * This event restores all custom string events if necessary.
   */
  _restoreStringEvents() {
    this._eventRestoreSet.size !== this._customEventObservable.observers.length && this._eventRestoreSet.forEach((e) => {
      this.registerEvent(e, !0);
    });
  }
  /**
   * This method adds additional collection strategies for data collection purposes.
   * @param strategyCallbacks the list of data to collect with callbacks.
   */
  addCollectionStrategies(...e) {
    for (let { strategyCallback: t, category: r, hidden: n } of e) {
      const i = t(this._scene);
      if (this._strategies.has(i.id)) {
        i.dispose();
        continue;
      }
      this.datasets.ids.push(i.id), r && (r = r.replace(new RegExp(RE, "g"), "")), this._datasetMeta.set(i.id, {
        color: this._getHexColorFromId(i.id),
        category: r,
        hidden: n
      }), this._strategies.set(i.id, i);
    }
    this.metadataObservable.notifyObservers(this._datasetMeta);
  }
  /**
   * Gets a 6 character hexcode representing the colour from a passed in string.
   * @param id the string to get a hex code for.
   * @returns a hexcode hashed from the id.
   */
  _getHexColorFromId(e) {
    let t = 0;
    for (let n = 0; n < e.length; n++)
      t = e.charCodeAt(n) + ((t << 5) - t);
    let r = "#";
    for (let n = 0; n < lge; n += 8) {
      const i = t >> n & 255;
      r += (Pge + i.toString(16)).substr(-2);
    }
    return r;
  }
  /**
   * Collects and then sends the latest slice to any observers by using the appropriate strategy when the user wants.
   * The slice will be of the form [timestamp, numberOfPoints, value1, value2...]
   * This method does not add onto the collected data accessible via the datasets variable.
   */
  getCurrentSlice() {
    const e = Yi.Now - this._startingTimestamp, t = this.datasets.ids.length, r = [e, t];
    this.datasets.ids.forEach((n) => {
      const i = this._strategies.get(n);
      i && this.datasetObservable.hasObservers() && r.push(i.getData());
    }), this.datasetObservable.hasObservers() && this.datasetObservable.notifyObservers(r);
  }
  /**
   * Updates a property for a dataset's metadata with the value provided.
   * @param id the id of the dataset which needs its metadata updated.
   * @param prop the property to update.
   * @param value the value to update the property with.
   */
  updateMetadata(e, t, r) {
    const n = this._datasetMeta.get(e);
    n && (n[t] = r, this.metadataObservable.notifyObservers(this._datasetMeta));
  }
  /**
   * Completely clear, data, ids, and strategies saved to this performance collector.
   * @param preserveStringEventsRestore if it should preserve the string events, by default will clear string events registered when called.
   */
  clear(e) {
    this.datasets.data = new M8(Fx), this.datasets.ids.length = 0, this.datasets.startingIndices = new M8(Fx), this._datasetMeta.clear(), this._strategies.forEach((t) => t.dispose()), this._strategies.clear(), e || this._eventRestoreSet.clear(), this._hasLoadedData = !1;
  }
  /**
   * Accessor which lets the caller know if the performance collector has data loaded from a file or not!
   * Call clear() to reset this value.
   * @returns true if the data is loaded from a file, false otherwise.
   */
  get hasLoadedData() {
    return this._hasLoadedData;
  }
  /**
   * Given a string containing file data, this function parses the file data into the datasets object.
   * It returns a boolean to indicate if this object was successfully loaded with the data.
   * @param data string content representing the file data.
   * @param keepDatasetMeta if it should use reuse the existing dataset metadata
   * @returns true if the data was successfully loaded, false otherwise.
   */
  loadFromFileData(e, t) {
    const r = e.replace(cge, "").split(`
`).map((v) => v.split(",").filter((u) => u.length > 0)).filter((v) => v.length > 0), n = 0, i = b0.NumberOfPointsOffset;
    if (r.length < 2)
      return !1;
    const s = {
      ids: [],
      data: new M8(Fx),
      startingIndices: new M8(Fx)
    }, [a, ...f] = r;
    if (a.length < 2 || a[n] !== $G || a[i] !== eZ)
      return !1;
    const o = /* @__PURE__ */ new Map();
    for (let v = b0.SliceDataOffset; v < a.length; v++) {
      const [u, l] = a[v].split(RE);
      s.ids.push(u), o.set(u, l);
    }
    let d = 0;
    for (const v of f) {
      if (v.length < 2)
        return !1;
      const u = parseFloat(v[n]), l = parseInt(v[i]);
      if (isNaN(l) || isNaN(u) || (s.data.push(u), s.data.push(l), l + b0.SliceDataOffset !== v.length))
        return !1;
      for (let P = b0.SliceDataOffset; P < v.length; P++) {
        const p = parseFloat(v[P]);
        if (isNaN(p))
          return !1;
        s.data.push(p);
      }
      s.startingIndices.push(d), d += v.length;
    }
    if (this.datasets.ids = s.ids, this.datasets.data = s.data, this.datasets.startingIndices = s.startingIndices, t || this._datasetMeta.clear(), this._strategies.forEach((v) => v.dispose()), this._strategies.clear(), !t)
      for (const v of this.datasets.ids) {
        const u = o.get(v);
        this._datasetMeta.set(v, { category: u, color: this._getHexColorFromId(v) });
      }
    return this.metadataObservable.notifyObservers(this._datasetMeta), this._hasLoadedData = !0, !0;
  }
  /**
   * Exports the datasets inside of the collector to a csv.
   */
  exportDataToCsv() {
    let e = "";
    e += `${$G},${eZ}`;
    for (let r = 0; r < this.datasets.ids.length; r++)
      if (e += `,${this.datasets.ids[r]}`, this._datasetMeta) {
        const n = this._datasetMeta.get(this.datasets.ids[r]);
        n != null && n.category && (e += `${RE}${n.category}`);
      }
    e += `
`;
    for (let r = 0; r < this.datasets.startingIndices.itemLength; r++) {
      const n = this.datasets.startingIndices.at(r), i = this.datasets.data.at(n), s = this.datasets.data.at(n + b0.NumberOfPointsOffset);
      e += `${i},${s}`;
      for (let a = 0; a < s; a++)
        e += `,${this.datasets.data.at(n + b0.SliceDataOffset + a)}`;
      for (let a = 0; a < this.datasets.ids.length - s; a++)
        e += ",";
      e += `
`;
    }
    const t = `${(/* @__PURE__ */ new Date()).toISOString()}-perfdata.csv`;
    ye.Download(new Blob([e], { type: "text/csv" }), t);
  }
  /**
   * Starts the realtime collection of data.
   * @param shouldPreserve optional boolean param, if set will preserve the dataset between calls of start.
   */
  start(e) {
    e ? this._startingTimestamp === void 0 && (this._startingTimestamp = Yi.Now) : (this.datasets.data = new M8(Fx), this.datasets.startingIndices = new M8(Fx), this._startingTimestamp = Yi.Now), this._scene.onAfterRenderObservable.add(this._collectDataAtFrame), this._restoreStringEvents(), this._isStarted = !0;
  }
  /**
   * Stops the collection of data.
   */
  stop() {
    this._scene.onAfterRenderObservable.removeCallback(this._collectDataAtFrame), this._isStarted = !1;
  }
  /**
   * Returns if the perf collector has been started or not.
   */
  get isStarted() {
    return this._isStarted;
  }
  /**
   * Disposes of the object
   */
  dispose() {
    this._scene.onAfterRenderObservable.removeCallback(this._collectDataAtFrame), this._datasetMeta.clear(), this._strategies.forEach((e) => {
      e.dispose();
    }), this.datasetObservable.clear(), this.metadataObservable.clear(), this._isStarted = !1, this.datasets = null;
  }
}
const h0 = () => {
};
class pge {
  /**
   * Gets the initializer for the strategy used for collection of fps metrics
   * @returns the initializer for the fps strategy
   */
  static FpsStrategy() {
    return (e) => {
      const t = e.getEngine();
      return {
        id: "FPS",
        getData: () => t.getFps(),
        dispose: h0
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of thermal utilization metrics.
   * Needs the experimental pressure API.
   * @returns the initializer for the thermal utilization strategy
   */
  static ThermalStrategy() {
    return this._PressureStrategy("Thermal utilization", "thermal");
  }
  /**
   * Gets the initializer for the strategy used for collection of power supply utilization metrics.
   * Needs the experimental pressure API.
   * @returns the initializer for the power supply utilization strategy
   */
  static PowerSupplyStrategy() {
    return this._PressureStrategy("Power supply utilization", "power-supply");
  }
  /**
   * Gets the initializer for the strategy used for collection of pressure metrics.
   * Needs the experimental pressure API.
   * @returns the initializer for the pressure strategy
   */
  static PressureStrategy() {
    return this._PressureStrategy("Pressure");
  }
  static _PressureStrategy(e, t = null) {
    return () => {
      let r = 0;
      const n = new Vy();
      return n.observe("cpu"), n.onPressureChanged.add((i) => {
        var s, a;
        for (const f of i)
          if (t && f.factors.includes(t) || !t && ((a = (s = f.factors) === null || s === void 0 ? void 0 : s.length) !== null && a !== void 0 ? a : 0) === 0)
            switch (f.state) {
              case "nominal":
                r = 0;
                break;
              case "fair":
                r = 0.25;
                break;
              case "serious":
                r = 0.5;
                break;
              case "critical":
                r = 1;
                break;
            }
      }), {
        id: e,
        getData: () => r,
        dispose: () => n.dispose()
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of total meshes metrics.
   * @returns the initializer for the total meshes strategy
   */
  static TotalMeshesStrategy() {
    return (e) => ({
      id: "Total meshes",
      getData: () => e.meshes.length,
      dispose: h0
    });
  }
  /**
   * Gets the initializer for the strategy used for collection of active meshes metrics.
   * @returns the initializer for the active meshes strategy
   */
  static ActiveMeshesStrategy() {
    return (e) => ({
      id: "Active meshes",
      getData: () => e.getActiveMeshes().length,
      dispose: h0
    });
  }
  /**
   * Gets the initializer for the strategy used for collection of active indices metrics.
   * @returns the initializer for the active indices strategy
   */
  static ActiveIndicesStrategy() {
    return (e) => ({
      id: "Active indices",
      getData: () => e.getActiveIndices(),
      dispose: h0
    });
  }
  /**
   * Gets the initializer for the strategy used for collection of active faces metrics.
   * @returns the initializer for the active faces strategy
   */
  static ActiveFacesStrategy() {
    return (e) => ({
      id: "Active faces",
      getData: () => e.getActiveIndices() / 3,
      dispose: h0
    });
  }
  /**
   * Gets the initializer for the strategy used for collection of active bones metrics.
   * @returns the initializer for the active bones strategy
   */
  static ActiveBonesStrategy() {
    return (e) => ({
      id: "Active bones",
      getData: () => e.getActiveBones(),
      dispose: h0
    });
  }
  /**
   * Gets the initializer for the strategy used for collection of active particles metrics.
   * @returns the initializer for the active particles strategy
   */
  static ActiveParticlesStrategy() {
    return (e) => ({
      id: "Active particles",
      getData: () => e.getActiveParticles(),
      dispose: h0
    });
  }
  /**
   * Gets the initializer for the strategy used for collection of draw calls metrics.
   * @returns the initializer for the draw calls strategy
   */
  static DrawCallsStrategy() {
    return (e) => {
      let t = 0;
      const r = e.onBeforeAnimationsObservable.add(() => {
        e.getEngine()._drawCalls.fetchNewFrame();
      }), n = e.onAfterRenderObservable.add(() => {
        t = e.getEngine()._drawCalls.current;
      });
      return {
        id: "Draw calls",
        getData: () => t,
        dispose: () => {
          e.onBeforeAnimationsObservable.remove(r), e.onAfterRenderObservable.remove(n);
        }
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of total lights metrics.
   * @returns the initializer for the total lights strategy
   */
  static TotalLightsStrategy() {
    return (e) => ({
      id: "Total lights",
      getData: () => e.lights.length,
      dispose: h0
    });
  }
  /**
   * Gets the initializer for the strategy used for collection of total vertices metrics.
   * @returns the initializer for the total vertices strategy
   */
  static TotalVerticesStrategy() {
    return (e) => ({
      id: "Total vertices",
      getData: () => e.getTotalVertices(),
      dispose: h0
    });
  }
  /**
   * Gets the initializer for the strategy used for collection of total materials metrics.
   * @returns the initializer for the total materials strategy
   */
  static TotalMaterialsStrategy() {
    return (e) => ({
      id: "Total materials",
      getData: () => e.materials.length,
      dispose: h0
    });
  }
  /**
   * Gets the initializer for the strategy used for collection of total textures metrics.
   * @returns the initializer for the total textures strategy
   */
  static TotalTexturesStrategy() {
    return (e) => ({
      id: "Total textures",
      getData: () => e.textures.length,
      dispose: h0
    });
  }
  /**
   * Gets the initializer for the strategy used for collection of absolute fps metrics.
   * @returns the initializer for the absolute fps strategy
   */
  static AbsoluteFpsStrategy() {
    return (e) => {
      const t = new Fte(e);
      return t.captureFrameTime = !0, {
        id: "Absolute FPS",
        getData: () => 1e3 / t.frameTimeCounter.lastSecAverage,
        dispose: h0
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of meshes selection time metrics.
   * @returns the initializer for the meshes selection time strategy
   */
  static MeshesSelectionStrategy() {
    return (e) => {
      let t = Yi.Now, r = 0;
      const n = e.onBeforeActiveMeshesEvaluationObservable.add(() => {
        t = Yi.Now;
      }), i = e.onAfterActiveMeshesEvaluationObservable.add(() => {
        r = Yi.Now - t;
      });
      return {
        id: "Meshes Selection",
        getData: () => r,
        dispose: () => {
          e.onBeforeActiveMeshesEvaluationObservable.remove(n), e.onAfterActiveMeshesEvaluationObservable.remove(i);
        }
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of render targets time metrics.
   * @returns the initializer for the render targets time strategy
   */
  static RenderTargetsStrategy() {
    return (e) => {
      let t = Yi.Now, r = 0;
      const n = e.onBeforeRenderTargetsRenderObservable.add(() => {
        t = Yi.Now;
      }), i = e.onAfterRenderTargetsRenderObservable.add(() => {
        r = Yi.Now - t;
      });
      return {
        id: "Render Targets",
        getData: () => r,
        dispose: () => {
          e.onBeforeRenderTargetsRenderObservable.remove(n), e.onAfterRenderTargetsRenderObservable.remove(i);
        }
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of particles time metrics.
   * @returns the initializer for the particles time strategy
   */
  static ParticlesStrategy() {
    return (e) => {
      let t = Yi.Now, r = 0;
      const n = e.onBeforeParticlesRenderingObservable.add(() => {
        t = Yi.Now;
      }), i = e.onAfterParticlesRenderingObservable.add(() => {
        r = Yi.Now - t;
      });
      return {
        id: "Particles",
        getData: () => r,
        dispose: () => {
          e.onBeforeParticlesRenderingObservable.remove(n), e.onAfterParticlesRenderingObservable.remove(i);
        }
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of sprites time metrics.
   * @returns the initializer for the sprites time strategy
   */
  static SpritesStrategy() {
    return (e) => {
      var t, r;
      let n = Yi.Now, i = 0;
      const s = (t = e.onBeforeSpritesRenderingObservable) === null || t === void 0 ? void 0 : t.add(() => {
        n = Yi.Now;
      }), a = (r = e.onAfterSpritesRenderingObservable) === null || r === void 0 ? void 0 : r.add(() => {
        i = Yi.Now - n;
      });
      return {
        id: "Sprites",
        getData: () => i,
        dispose: () => {
          var f, o;
          (f = e.onBeforeSpritesRenderingObservable) === null || f === void 0 || f.remove(s), (o = e.onAfterSpritesRenderingObservable) === null || o === void 0 || o.remove(a);
        }
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of animations time metrics.
   * @returns the initializer for the animations time strategy
   */
  static AnimationsStrategy() {
    return (e) => {
      let t = Yi.Now, r = 0;
      const n = e.onBeforeAnimationsObservable.add(() => {
        t = Yi.Now;
      }), i = e.onAfterAnimationsObservable.add(() => {
        r = Yi.Now - t;
      });
      return {
        id: "Animations",
        getData: () => r,
        dispose: () => {
          e.onBeforeAnimationsObservable.remove(n), e.onAfterAnimationsObservable.remove(i);
        }
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of physics time metrics.
   * @returns the initializer for the physics time strategy
   */
  static PhysicsStrategy() {
    return (e) => {
      var t, r;
      let n = Yi.Now, i = 0;
      const s = (t = e.onBeforePhysicsObservable) === null || t === void 0 ? void 0 : t.add(() => {
        n = Yi.Now;
      }), a = (r = e.onAfterPhysicsObservable) === null || r === void 0 ? void 0 : r.add(() => {
        i = Yi.Now - n;
      });
      return {
        id: "Physics",
        getData: () => i,
        dispose: () => {
          var f, o;
          (f = e.onBeforePhysicsObservable) === null || f === void 0 || f.remove(s), (o = e.onAfterPhysicsObservable) === null || o === void 0 || o.remove(a);
        }
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of render time metrics.
   * @returns the initializer for the render time strategy
   */
  static RenderStrategy() {
    return (e) => {
      let t = Yi.Now, r = 0;
      const n = e.onBeforeDrawPhaseObservable.add(() => {
        t = Yi.Now;
      }), i = e.onAfterDrawPhaseObservable.add(() => {
        r = Yi.Now - t;
      });
      return {
        id: "Render",
        getData: () => r,
        dispose: () => {
          e.onBeforeDrawPhaseObservable.remove(n), e.onAfterDrawPhaseObservable.remove(i);
        }
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of total frame time metrics.
   * @returns the initializer for the total frame time strategy
   */
  static FrameTotalStrategy() {
    return (e) => {
      let t = Yi.Now, r = 0;
      const n = e.onBeforeAnimationsObservable.add(() => {
        t = Yi.Now;
      }), i = e.onAfterRenderObservable.add(() => {
        r = Yi.Now - t;
      });
      return {
        id: "Frame Total",
        getData: () => r,
        dispose: () => {
          e.onBeforeAnimationsObservable.remove(n), e.onAfterRenderObservable.remove(i);
        }
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of inter-frame time metrics.
   * @returns the initializer for the inter-frame time strategy
   */
  static InterFrameStrategy() {
    return (e) => {
      let t = Yi.Now, r = 0;
      const n = e.onBeforeAnimationsObservable.add(() => {
        r = Yi.Now - t;
      }), i = e.onAfterRenderObservable.add(() => {
        t = Yi.Now;
      });
      return {
        id: "Inter-frame",
        getData: () => r,
        dispose: () => {
          e.onBeforeAnimationsObservable.remove(n), e.onAfterRenderObservable.remove(i);
        }
      };
    };
  }
  /**
   * Gets the initializer for the strategy used for collection of gpu frame time metrics.
   * @returns the initializer for the gpu frame time strategy
   */
  static GpuFrameTimeStrategy() {
    return (e) => {
      const t = new Ete(e.getEngine());
      return t.captureGPUFrameTime = !0, {
        id: "GPU frame time",
        getData: () => Math.max(t.gpuFrameTimeCounter.current * 1e-6, 0),
        dispose: () => {
          t.dispose();
        }
      };
    };
  }
}
sr.prototype.getPerfCollector = function() {
  return this._perfCollector || (this._perfCollector = new b0(this)), this._perfCollector;
};
function hge(A) {
  const e = new Array(), t = new Array(), r = new Array(), n = A.add(() => {
    const s = e.length;
    for (let a = 0; a < s; a++)
      FI(e.shift(), t.shift(), r.shift());
  });
  return {
    scheduler: (s, a, f) => {
      e.push(s), t.push(a), r.push(f);
    },
    dispose: () => {
      A.remove(n);
    }
  };
}
Oe.prototype.runCoroutineAsync = function(A) {
  if (!this._coroutineScheduler) {
    const e = hge(this);
    this._coroutineScheduler = e.scheduler, this._coroutineSchedulerDispose = e.dispose;
  }
  return BO(A, this._coroutineScheduler);
};
Oe.prototype.cancelAllCoroutines = function() {
  this._coroutineSchedulerDispose && this._coroutineSchedulerDispose(), this._coroutineScheduler = void 0, this._coroutineSchedulerDispose = void 0;
};
const Hge = "equirectangularPanoramaPixelShader", gge = `#ifdef GL_ES
precision highp float;
#endif
#define M_PI 3.1415926535897932384626433832795
varying vec2 vUV;uniform samplerCube cubeMap;void main(void) {vec2 uv=vUV;float longitude=uv.x*2.*M_PI-M_PI+M_PI/2.;float latitude=(1.-uv.y)*M_PI;vec3 dir=vec3(
- sin( longitude )*sin( latitude ),
cos( latitude ),
- cos( longitude )*sin( latitude )
);normalize( dir );gl_FragColor=textureCube( cubeMap,dir );}`;
Le.ShadersStore[Hge] = gge;
async function Xge(A, e) {
  var t, r;
  const n = (t = e.probe) !== null && t !== void 0 ? t : new Im("tempProbe", e.size, A), i = !!e.probe;
  i || (e.position ? n.position = e.position.clone() : A.activeCamera && (n.position = A.activeCamera.position.clone()));
  const s = e.meshesFilter ? A.meshes.filter(e.meshesFilter) : A.meshes;
  (r = n.renderList) === null || r === void 0 || r.push(...s), n.refreshRate = Ta.REFRESHRATE_RENDER_ONCE, n.cubeTexture.render();
  const a = new rre("tempProceduralTexture", "equirectangularPanorama", { width: e.size * 2, height: e.size }, A);
  return a.setTexture("cubeMap", n.cubeTexture), new Promise((f, o) => {
    a.onGeneratedObservable.addOnce(() => {
      const d = a.readPixels();
      if (!d) {
        o(new Error("No Pixel Data found on procedural texture")), a.dispose(), i || n.dispose();
        return;
      }
      d.then((v) => {
        a.dispose(), i || n.dispose(), e.filename ? (eA.DumpData(e.size * 2, e.size, v, void 0, "image/png", e.filename), f(null)) : f(v);
      });
    });
  });
}
class lq extends L9 {
  /**
   * Creates a new instance of the (legacy version) hit test feature
   * @param _xrSessionManager an instance of WebXRSessionManager
   * @param options options to use when constructing this feature
   */
  constructor(e, t = {}) {
    super(e), this.options = t, this._direction = new S(0, 0, -1), this._mat = new he(), this._onSelectEnabled = !1, this._origin = new S(0, 0, 0), this.lastNativeXRHitResults = [], this.onHitTestResultObservable = new Oe(), this._onHitTestResults = (r) => {
      const n = r.map((i) => {
        const s = he.FromArray(i.hitMatrix);
        return this._xrSessionManager.scene.useRightHandedSystem || s.toggleModelMatrixHandInPlace(), this.options.worldParentNode && s.multiplyToRef(this.options.worldParentNode.getWorldMatrix(), s), {
          xrHitResult: i,
          transformationMatrix: s
        };
      });
      this.lastNativeXRHitResults = r, this.onHitTestResultObservable.notifyObservers(n);
    }, this._onSelect = (r) => {
      this._onSelectEnabled && lq.XRHitTestWithSelectEvent(r, this._xrSessionManager.referenceSpace);
    }, this.xrNativeFeatureName = "hit-test", ye.Warn("A newer version of this plugin is available");
  }
  /**
   * execute a hit test with an XR Ray
   *
   * @param xrSession a native xrSession that will execute this hit test
   * @param xrRay the ray (position and direction) to use for ray-casting
   * @param referenceSpace native XR reference space to use for the hit-test
   * @param filter filter function that will filter the results
   * @returns a promise that resolves with an array of native XR hit result in xr coordinates system
   */
  static XRHitTestWithRay(e, t, r, n) {
    return e.requestHitTest(t, r).then((i) => {
      const s = n || ((a) => !!a.hitMatrix);
      return i.filter(s);
    });
  }
  /**
   * Execute a hit test on the current running session using a select event returned from a transient input (such as touch)
   * @param event the (select) event to use to select with
   * @param referenceSpace the reference space to use for this hit test
   * @returns a promise that resolves with an array of native XR hit result in xr coordinates system
   */
  static XRHitTestWithSelectEvent(e, t) {
    const r = e.frame.getPose(e.inputSource.targetRaySpace, t);
    if (!r)
      return Promise.resolve([]);
    const n = new XRRay(r.transform);
    return this.XRHitTestWithRay(e.frame.session, n, t);
  }
  /**
   * attach this feature
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  attach() {
    return super.attach() ? (this.options.testOnPointerDownOnly && this._xrSessionManager.session.addEventListener("select", this._onSelect, !1), !0) : !1;
  }
  /**
   * detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    return super.detach() ? (this._onSelectEnabled = !1, this._xrSessionManager.session.removeEventListener("select", this._onSelect), !0) : !1;
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    super.dispose(), this.onHitTestResultObservable.clear();
  }
  _onXRFrame(e) {
    if (!this.attached || this.options.testOnPointerDownOnly)
      return;
    const t = e.getViewerPose(this._xrSessionManager.referenceSpace);
    if (!t)
      return;
    he.FromArrayToRef(t.transform.matrix, 0, this._mat), S.TransformCoordinatesFromFloatsToRef(0, 0, 0, this._mat, this._origin), S.TransformCoordinatesFromFloatsToRef(0, 0, -1, this._mat, this._direction), this._direction.subtractInPlace(this._origin), this._direction.normalize();
    const r = new XRRay({ x: this._origin.x, y: this._origin.y, z: this._origin.z, w: 0 }, { x: this._direction.x, y: this._direction.y, z: this._direction.z, w: 0 });
    lq.XRHitTestWithRay(this._xrSessionManager.session, r, this._xrSessionManager.referenceSpace).then(this._onHitTestResults);
  }
}
lq.Name = Gi.HIT_TEST;
lq.Version = 1;
So.AddWebXRFeature(lq.Name, (A, e) => () => new lq(A, e), lq.Version, !1);
let Tge = 0;
class aS extends L9 {
  /**
   * Set the reference space to use for anchor creation, when not using a hit test.
   * Will default to the session's reference space if not defined
   */
  set referenceSpaceForFrameAnchors(e) {
    this._referenceSpaceForFrameAnchors = e;
  }
  /**
   * constructs a new anchor system
   * @param _xrSessionManager an instance of WebXRSessionManager
   * @param _options configuration object for this feature
   */
  constructor(e, t = {}) {
    super(e), this._options = t, this._lastFrameDetected = /* @__PURE__ */ new Set(), this._trackedAnchors = [], this._futureAnchors = [], this.onAnchorAddedObservable = new Oe(), this.onAnchorRemovedObservable = new Oe(), this.onAnchorUpdatedObservable = new Oe(), this._tmpVector = new S(), this._tmpQuaternion = new Ze(), this.xrNativeFeatureName = "anchors";
  }
  _populateTmpTransformation(e, t) {
    return this._tmpVector.copyFrom(e), this._tmpQuaternion.copyFrom(t), this._xrSessionManager.scene.useRightHandedSystem || (this._tmpVector.z *= -1, this._tmpQuaternion.z *= -1, this._tmpQuaternion.w *= -1), {
      position: this._tmpVector,
      rotationQuaternion: this._tmpQuaternion
    };
  }
  /**
   * Create a new anchor point using a hit test result at a specific point in the scene
   * An anchor is tracked only after it is added to the trackerAnchors in xrFrame. The promise returned here does not yet guaranty that.
   * Use onAnchorAddedObservable to get newly added anchors if you require tracking guaranty.
   *
   * @param hitTestResult The hit test result to use for this anchor creation
   * @param position an optional position offset for this anchor
   * @param rotationQuaternion an optional rotation offset for this anchor
   * @returns A promise that fulfills when babylon has created the corresponding WebXRAnchor object and tracking has begun
   */
  async addAnchorPointUsingHitTestResultAsync(e, t = new S(), r = new Ze()) {
    this._populateTmpTransformation(t, r);
    const n = new XRRigidTransform({ x: this._tmpVector.x, y: this._tmpVector.y, z: this._tmpVector.z }, { x: this._tmpQuaternion.x, y: this._tmpQuaternion.y, z: this._tmpQuaternion.z, w: this._tmpQuaternion.w });
    if (e.xrHitResult.createAnchor)
      try {
        const i = await e.xrHitResult.createAnchor(n);
        return new Promise((s, a) => {
          this._futureAnchors.push({
            nativeAnchor: i,
            resolved: !1,
            submitted: !0,
            xrTransformation: n,
            resolve: s,
            reject: a
          });
        });
      } catch (i) {
        throw new Error(i);
      }
    else
      throw this.detach(), new Error("Anchors not enabled in this environment/browser");
  }
  /**
   * Add a new anchor at a specific position and rotation
   * This function will add a new anchor per default in the next available frame. Unless forced, the createAnchor function
   * will be called in the next xrFrame loop to make sure that the anchor can be created correctly.
   * An anchor is tracked only after it is added to the trackerAnchors in xrFrame. The promise returned here does not yet guaranty that.
   * Use onAnchorAddedObservable to get newly added anchors if you require tracking guaranty.
   *
   * @param position the position in which to add an anchor
   * @param rotationQuaternion an optional rotation for the anchor transformation
   * @param forceCreateInCurrentFrame force the creation of this anchor in the current frame. Must be called inside xrFrame loop!
   * @returns A promise that fulfills when babylon has created the corresponding WebXRAnchor object and tracking has begun
   */
  async addAnchorAtPositionAndRotationAsync(e, t = new Ze(), r = !1) {
    this._populateTmpTransformation(e, t);
    const n = new XRRigidTransform({ x: this._tmpVector.x, y: this._tmpVector.y, z: this._tmpVector.z }, { x: this._tmpQuaternion.x, y: this._tmpQuaternion.y, z: this._tmpQuaternion.z, w: this._tmpQuaternion.w }), i = r && this.attached && this._xrSessionManager.currentFrame ? await this._createAnchorAtTransformation(n, this._xrSessionManager.currentFrame) : void 0;
    return new Promise((s, a) => {
      this._futureAnchors.push({
        nativeAnchor: i,
        resolved: !1,
        submitted: !1,
        xrTransformation: n,
        resolve: s,
        reject: a
      });
    });
  }
  /**
   * Get the list of anchors currently being tracked by the system
   */
  get anchors() {
    return this._trackedAnchors;
  }
  /**
   * detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    if (!super.detach())
      return !1;
    if (!this._options.doNotRemoveAnchorsOnSessionEnded)
      for (; this._trackedAnchors.length; ) {
        const e = this._trackedAnchors.pop();
        if (e) {
          try {
            e.remove();
          } catch {
          }
          this.onAnchorRemovedObservable.notifyObservers(e);
        }
      }
    return !0;
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    this._futureAnchors.length = 0, super.dispose(), this.onAnchorAddedObservable.clear(), this.onAnchorRemovedObservable.clear(), this.onAnchorUpdatedObservable.clear();
  }
  _onXRFrame(e) {
    if (!this.attached || !e)
      return;
    const t = e.trackedAnchors;
    if (t) {
      const r = this._trackedAnchors.filter((i) => !t.has(i.xrAnchor)).map((i) => this._trackedAnchors.indexOf(i));
      let n = 0;
      r.forEach((i) => {
        const s = this._trackedAnchors.splice(i - n, 1)[0];
        this.onAnchorRemovedObservable.notifyObservers(s), n++;
      }), t.forEach((i) => {
        if (this._lastFrameDetected.has(i)) {
          const s = this._findIndexInAnchorArray(i), a = this._trackedAnchors[s];
          try {
            this._updateAnchorWithXRFrame(i, a, e), a.attachedNode && (a.attachedNode.rotationQuaternion = a.attachedNode.rotationQuaternion || new Ze(), a.transformationMatrix.decompose(a.attachedNode.scaling, a.attachedNode.rotationQuaternion, a.attachedNode.position)), this.onAnchorUpdatedObservable.notifyObservers(a);
          } catch {
            ye.Warn("Anchor could not be updated");
          }
        } else {
          const s = {
            id: Tge++,
            xrAnchor: i,
            remove: () => i.delete()
          }, a = this._updateAnchorWithXRFrame(i, s, e);
          this._trackedAnchors.push(a), this.onAnchorAddedObservable.notifyObservers(a);
          const o = this._futureAnchors.filter((d) => d.nativeAnchor === i)[0];
          o && (o.resolve(a), o.resolved = !0);
        }
      }), this._lastFrameDetected = t;
    }
    this._futureAnchors.forEach((r) => {
      !r.resolved && !r.submitted && (this._createAnchorAtTransformation(r.xrTransformation, e).then((n) => {
        r.nativeAnchor = n;
      }, (n) => {
        r.resolved = !0, r.reject(n);
      }), r.submitted = !0);
    });
  }
  /**
   * avoiding using Array.find for global support.
   * @param xrAnchor the plane to find in the array
   */
  _findIndexInAnchorArray(e) {
    for (let t = 0; t < this._trackedAnchors.length; ++t)
      if (this._trackedAnchors[t].xrAnchor === e)
        return t;
    return -1;
  }
  _updateAnchorWithXRFrame(e, t, r) {
    const n = r.getPose(e.anchorSpace, this._xrSessionManager.referenceSpace);
    if (n) {
      const i = t.transformationMatrix || new he();
      he.FromArrayToRef(n.transform.matrix, 0, i), this._xrSessionManager.scene.useRightHandedSystem || i.toggleModelMatrixHandInPlace(), t.transformationMatrix = i, this._options.worldParentNode && i.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), i);
    }
    return t;
  }
  async _createAnchorAtTransformation(e, t) {
    var r;
    if (t.createAnchor)
      try {
        return t.createAnchor(e, (r = this._referenceSpaceForFrameAnchors) !== null && r !== void 0 ? r : this._xrSessionManager.referenceSpace);
      } catch (n) {
        throw new Error(n);
      }
    else
      throw this.detach(), new Error("Anchors are not enabled in your browser");
  }
}
aS.Name = Gi.ANCHOR_SYSTEM;
aS.Version = 1;
So.AddWebXRFeature(aS.Name, (A, e) => () => new aS(A, e), aS.Version);
let qge = 0;
class oS extends L9 {
  /**
   * construct a new Plane Detector
   * @param _xrSessionManager an instance of xr Session manager
   * @param _options configuration to use when constructing this feature
   */
  constructor(e, t = {}) {
    super(e), this._options = t, this._detectedPlanes = [], this._enabled = !1, this._lastFrameDetected = /* @__PURE__ */ new Set(), this.onPlaneAddedObservable = new Oe(), this.onPlaneRemovedObservable = new Oe(), this.onPlaneUpdatedObservable = new Oe(), this.xrNativeFeatureName = "plane-detection", this._xrSessionManager.session ? this._init() : this._xrSessionManager.onXRSessionInit.addOnce(() => {
      this._init();
    });
  }
  /**
   * detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    if (!super.detach())
      return !1;
    if (!this._options.doNotRemovePlanesOnSessionEnded)
      for (; this._detectedPlanes.length; ) {
        const e = this._detectedPlanes.pop();
        e && this.onPlaneRemovedObservable.notifyObservers(e);
      }
    return !0;
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    super.dispose(), this.onPlaneAddedObservable.clear(), this.onPlaneRemovedObservable.clear(), this.onPlaneUpdatedObservable.clear();
  }
  /**
   * Check if the needed objects are defined.
   * This does not mean that the feature is enabled, but that the objects needed are well defined.
   */
  isCompatible() {
    return typeof XRPlane < "u";
  }
  /**
   * Enable room capture mode.
   * When enabled and supported by the system,
   * the detectedPlanes array will be populated with the detected room boundaries
   * @see https://immersive-web.github.io/real-world-geometry/plane-detection.html#dom-xrsession-initiateroomcapture
   * @returns true if plane detection is enabled and supported. Will reject if not supported.
   */
  async initiateRoomCapture() {
    return this._xrSessionManager.session.initiateRoomCapture ? this._xrSessionManager.session.initiateRoomCapture() : Promise.reject("initiateRoomCapture is not supported on this session");
  }
  _onXRFrame(e) {
    var t;
    if (!this.attached || !this._enabled || !e)
      return;
    const r = e.detectedPlanes || ((t = e.worldInformation) === null || t === void 0 ? void 0 : t.detectedPlanes);
    if (r) {
      for (let n = 0; n < this._detectedPlanes.length; n++) {
        const i = this._detectedPlanes[n];
        r.has(i.xrPlane) || (this._detectedPlanes.splice(n--, 1), this.onPlaneRemovedObservable.notifyObservers(i));
      }
      r.forEach((n) => {
        if (this._lastFrameDetected.has(n)) {
          if (n.lastChangedTime === this._xrSessionManager.currentTimestamp) {
            const i = this._findIndexInPlaneArray(n), s = this._detectedPlanes[i];
            this._updatePlaneWithXRPlane(n, s, e), this.onPlaneUpdatedObservable.notifyObservers(s);
          }
        } else {
          const i = {
            id: qge++,
            xrPlane: n,
            polygonDefinition: []
          }, s = this._updatePlaneWithXRPlane(n, i, e);
          this._detectedPlanes.push(s), this.onPlaneAddedObservable.notifyObservers(s);
        }
      }), this._lastFrameDetected = r;
    }
  }
  _init() {
    const e = () => {
      this._enabled = !0, this._detectedPlanes.length && (this._detectedPlanes.length = 0);
    };
    if (this._xrSessionManager.isNative && this._options.preferredDetectorOptions && this._xrSessionManager.session.trySetPreferredPlaneDetectorOptions && this._xrSessionManager.session.trySetPreferredPlaneDetectorOptions(this._options.preferredDetectorOptions), !this._xrSessionManager.session.updateWorldTrackingState) {
      e();
      return;
    }
    this._xrSessionManager.session.updateWorldTrackingState({ planeDetectionState: { enabled: !0 } }), e();
  }
  _updatePlaneWithXRPlane(e, t, r) {
    t.polygonDefinition = e.polygon.map((i) => {
      const s = this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1;
      return new S(i.x, i.y, i.z * s);
    });
    const n = r.getPose(e.planeSpace, this._xrSessionManager.referenceSpace);
    if (n) {
      const i = t.transformationMatrix || new he();
      he.FromArrayToRef(n.transform.matrix, 0, i), this._xrSessionManager.scene.useRightHandedSystem || i.toggleModelMatrixHandInPlace(), t.transformationMatrix = i, this._options.worldParentNode && i.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), i);
    }
    return t;
  }
  /**
   * avoiding using Array.find for global support.
   * @param xrPlane the plane to find in the array
   */
  _findIndexInPlaneArray(e) {
    for (let t = 0; t < this._detectedPlanes.length; ++t)
      if (this._detectedPlanes[t].xrPlane === e)
        return t;
    return -1;
  }
}
oS.Name = Gi.PLANE_DETECTION;
oS.Version = 1;
So.AddWebXRFeature(oS.Name, (A, e) => () => new oS(A, e), oS.Version);
class fS extends L9 {
  /**
   * constructs a new background remover module
   * @param _xrSessionManager the session manager for this module
   * @param options read-only options to be used in this module
   */
  constructor(e, t = {}) {
    super(e), this.options = t, this.onBackgroundStateChangedObservable = new Oe();
  }
  /**
   * attach this feature
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  attach() {
    return this._setBackgroundState(!1), super.attach();
  }
  /**
   * detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    return this._setBackgroundState(!0), super.detach();
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    super.dispose(), this.onBackgroundStateChangedObservable.clear();
  }
  _onXRFrame(e) {
  }
  _setBackgroundState(e) {
    const t = this._xrSessionManager.scene;
    if (!this.options.ignoreEnvironmentHelper)
      if (this.options.environmentHelperRemovalFlags) {
        if (this.options.environmentHelperRemovalFlags.skyBox) {
          const r = t.getMeshByName("BackgroundSkybox");
          r && r.setEnabled(e);
        }
        if (this.options.environmentHelperRemovalFlags.ground) {
          const r = t.getMeshByName("BackgroundPlane");
          r && r.setEnabled(e);
        }
      } else {
        const r = t.getMeshByName("BackgroundHelper");
        r && r.setEnabled(e);
      }
    this.options.backgroundMeshes && this.options.backgroundMeshes.forEach((r) => r.setEnabled(e)), this.onBackgroundStateChangedObservable.notifyObservers(e);
  }
}
fS.Name = Gi.BACKGROUND_REMOVER;
fS.Version = 1;
So.AddWebXRFeature(fS.Name, (A, e) => () => new fS(A, e), fS.Version, !0);
class bge {
}
class AS extends L9 {
  _createPhysicsImpostor(e) {
    const t = this._options.physicsProperties.impostorType || tn.SphereImpostor, r = this._options.physicsProperties.impostorSize || 0.1, n = UA("impostor-mesh-" + e.uniqueId, {
      diameterX: typeof r == "number" ? r : r.width,
      diameterY: typeof r == "number" ? r : r.height,
      diameterZ: typeof r == "number" ? r : r.depth
    });
    n.isVisible = this._debugMode, n.isPickable = !1, n.rotationQuaternion = new Ze();
    const i = e.grip || e.pointer;
    n.position.copyFrom(i.position), n.rotationQuaternion.copyFrom(i.rotationQuaternion);
    const s = new tn(n, t, Object.assign({ mass: 0 }, this._options.physicsProperties));
    this._controllers[e.uniqueId] = {
      xrController: e,
      impostor: s,
      impostorMesh: n
    };
  }
  /**
   * Construct a new Controller Physics Feature
   * @param _xrSessionManager the corresponding xr session manager
   * @param _options options to create this feature with
   */
  constructor(e, t) {
    super(e), this._options = t, this._attachController = (r) => {
      this._controllers[r.uniqueId] || (this._xrSessionManager.scene.isPhysicsEnabled() || Se.Warn("physics engine not enabled, skipped. Please add this controller manually."), this._options.physicsProperties.useControllerMesh && r.inputSource.gamepad ? r.onMotionControllerInitObservable.addOnce((n) => {
        n._doNotLoadControllerMesh ? this._createPhysicsImpostor(r) : n.onModelLoadedObservable.addOnce(() => {
          const i = new tn(n.rootMesh, tn.MeshImpostor, Object.assign({ mass: 0 }, this._options.physicsProperties)), s = r.grip || r.pointer;
          this._controllers[r.uniqueId] = {
            xrController: r,
            impostor: i,
            oldPos: s.position.clone(),
            oldRotation: s.rotationQuaternion.clone()
          };
        });
      }) : this._createPhysicsImpostor(r));
    }, this._controllers = {}, this._debugMode = !1, this._delta = 0, this._lastTimestamp = 0, this._tmpQuaternion = new Ze(), this._tmpVector = new S(), this._options.physicsProperties || (this._options.physicsProperties = {});
  }
  /**
   * @internal
   * enable debugging - will show console outputs and the impostor mesh
   */
  _enablePhysicsDebug() {
    this._debugMode = !0, Object.keys(this._controllers).forEach((e) => {
      const t = this._controllers[e];
      t.impostorMesh && (t.impostorMesh.isVisible = !0);
    });
  }
  /**
   * Manually add a controller (if no xrInput was provided or physics engine was not enabled)
   * @param xrController the controller to add
   */
  addController(e) {
    this._attachController(e);
  }
  /**
   * attach this feature
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  attach() {
    if (!super.attach())
      return !1;
    if (!this._options.xrInput)
      return !0;
    if (this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (e) => {
      this._detachController(e.uniqueId);
    }), this._options.enableHeadsetImpostor) {
      const e = this._options.headsetImpostorParams || {
        impostorType: tn.SphereImpostor,
        restitution: 0.8,
        impostorSize: 0.3
      }, t = e.impostorSize || 0.3;
      this._headsetMesh = UA("headset-mesh", {
        diameterX: typeof t == "number" ? t : t.width,
        diameterY: typeof t == "number" ? t : t.height,
        diameterZ: typeof t == "number" ? t : t.depth
      }), this._headsetMesh.rotationQuaternion = new Ze(), this._headsetMesh.isVisible = !1, this._headsetImpostor = new tn(this._headsetMesh, e.impostorType, Object.assign({ mass: 0 }, e));
    }
    return !0;
  }
  /**
   * detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    return super.detach() ? (Object.keys(this._controllers).forEach((e) => {
      this._detachController(e);
    }), this._headsetMesh && this._headsetMesh.dispose(), !0) : !1;
  }
  /**
   * Get the headset impostor, if enabled
   * @returns the impostor
   */
  getHeadsetImpostor() {
    return this._headsetImpostor;
  }
  /**
   * Get the physics impostor of a specific controller.
   * The impostor is not attached to a mesh because a mesh for each controller is not obligatory
   * @param controller the controller or the controller id of which to get the impostor
   * @returns the impostor or null
   */
  getImpostorForController(e) {
    const t = typeof e == "string" ? e : e.uniqueId;
    return this._controllers[t] ? this._controllers[t].impostor : null;
  }
  /**
   * Update the physics properties provided in the constructor
   * @param newProperties the new properties object
   * @param newProperties.impostorType
   * @param newProperties.impostorSize
   * @param newProperties.friction
   * @param newProperties.restitution
   */
  setPhysicsProperties(e) {
    this._options.physicsProperties = Object.assign(Object.assign({}, this._options.physicsProperties), e);
  }
  _onXRFrame(e) {
    var t, r;
    if (this._delta = this._xrSessionManager.currentTimestamp - this._lastTimestamp, this._lastTimestamp = this._xrSessionManager.currentTimestamp, this._headsetMesh && this._headsetImpostor) {
      if (this._headsetMesh.position.copyFrom(this._options.xrInput.xrCamera.globalPosition), this._headsetMesh.rotationQuaternion.copyFrom(this._options.xrInput.xrCamera.absoluteRotation), !((t = this._options.xrInput.xrCamera._lastXRViewerPose) === null || t === void 0) && t.linearVelocity) {
        const n = this._options.xrInput.xrCamera._lastXRViewerPose.linearVelocity;
        this._tmpVector.set(n.x, n.y, n.z), this._headsetImpostor.setLinearVelocity(this._tmpVector);
      }
      if (!((r = this._options.xrInput.xrCamera._lastXRViewerPose) === null || r === void 0) && r.angularVelocity) {
        const n = this._options.xrInput.xrCamera._lastXRViewerPose.angularVelocity;
        this._tmpVector.set(n.x, n.y, n.z), this._headsetImpostor.setAngularVelocity(this._tmpVector);
      }
    }
    Object.keys(this._controllers).forEach((n) => {
      var i, s;
      const a = this._controllers[n], f = a.xrController.grip || a.xrController.pointer, o = a.oldPos || a.impostorMesh.position;
      if (!((i = a.xrController._lastXRPose) === null || i === void 0) && i.linearVelocity) {
        const v = a.xrController._lastXRPose.linearVelocity;
        this._tmpVector.set(v.x, v.y, v.z), a.impostor.setLinearVelocity(this._tmpVector);
      } else
        f.position.subtractToRef(o, this._tmpVector), this._tmpVector.scaleInPlace(1e3 / this._delta), a.impostor.setLinearVelocity(this._tmpVector);
      o.copyFrom(f.position), this._debugMode && console.log(this._tmpVector, "linear");
      const d = a.oldRotation || a.impostorMesh.rotationQuaternion;
      if (!((s = a.xrController._lastXRPose) === null || s === void 0) && s.angularVelocity) {
        const v = a.xrController._lastXRPose.angularVelocity;
        this._tmpVector.set(v.x, v.y, v.z), a.impostor.setAngularVelocity(this._tmpVector);
      } else if (!d.equalsWithEpsilon(f.rotationQuaternion)) {
        d.conjugateInPlace().multiplyToRef(f.rotationQuaternion, this._tmpQuaternion);
        const v = Math.sqrt(this._tmpQuaternion.x * this._tmpQuaternion.x + this._tmpQuaternion.y * this._tmpQuaternion.y + this._tmpQuaternion.z * this._tmpQuaternion.z);
        if (this._tmpVector.set(this._tmpQuaternion.x, this._tmpQuaternion.y, this._tmpQuaternion.z), v < 1e-3)
          this._tmpVector.scaleInPlace(2);
        else {
          const u = 2 * Math.atan2(v, this._tmpQuaternion.w);
          this._tmpVector.scaleInPlace(u / (v * (this._delta / 1e3)));
        }
        a.impostor.setAngularVelocity(this._tmpVector);
      }
      d.copyFrom(f.rotationQuaternion), this._debugMode && console.log(this._tmpVector, this._tmpQuaternion, "angular");
    });
  }
  _detachController(e) {
    const t = this._controllers[e];
    t && (t.impostorMesh && t.impostorMesh.dispose(), delete this._controllers[e]);
  }
}
AS.Name = Gi.PHYSICS_CONTROLLERS;
AS.Version = 1;
So.AddWebXRFeature(AS.Name, (A, e) => () => new AS(A, e), AS.Version, !0);
class dS extends L9 {
  /**
   * Creates a new instance of the hit test feature
   * @param _xrSessionManager an instance of WebXRSessionManager
   * @param options options to use when constructing this feature
   */
  constructor(e, t = {}) {
    super(e), this.options = t, this._tmpMat = new he(), this._tmpPos = new S(), this._tmpQuat = new Ze(), this._initHitTestSource = (r) => {
      if (!r)
        return;
      const n = new XRRay(this.options.offsetRay || {}), i = {
        space: this.options.useReferenceSpace ? r : this._xrSessionManager.viewerReferenceSpace,
        offsetRay: n
      };
      if (this.options.entityTypes && (i.entityTypes = this.options.entityTypes), !i.space) {
        ye.Warn("waiting for viewer reference space to initialize");
        return;
      }
      this._xrSessionManager.session.requestHitTestSource(i).then((s) => {
        this._xrHitTestSource && this._xrHitTestSource.cancel(), this._xrHitTestSource = s;
      });
    }, this.autoCloneTransformation = !1, this.onHitTestResultObservable = new Oe(), this.paused = !1, this.xrNativeFeatureName = "hit-test", ye.Warn("Hit test is an experimental and unstable feature.");
  }
  /**
   * attach this feature
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  attach() {
    if (!super.attach() || !this._xrSessionManager.session.requestHitTestSource)
      return !1;
    if (this.options.disablePermanentHitTest || (this._xrSessionManager.referenceSpace && this._initHitTestSource(this._xrSessionManager.referenceSpace), this._xrSessionManager.onXRReferenceSpaceChanged.add(this._initHitTestSource)), this.options.enableTransientHitTest) {
      const e = new XRRay(this.options.transientOffsetRay || {});
      this._xrSessionManager.session.requestHitTestSourceForTransientInput({
        profile: this.options.transientHitTestProfile || "generic-touchscreen",
        offsetRay: e,
        entityTypes: this.options.entityTypes
      }).then((t) => {
        this._transientXrHitTestSource = t;
      });
    }
    return !0;
  }
  /**
   * detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    return super.detach() ? (this._xrHitTestSource && (this._xrHitTestSource.cancel(), this._xrHitTestSource = null), this._xrSessionManager.onXRReferenceSpaceChanged.removeCallback(this._initHitTestSource), this._transientXrHitTestSource && (this._transientXrHitTestSource.cancel(), this._transientXrHitTestSource = null), !0) : !1;
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    super.dispose(), this.onHitTestResultObservable.clear();
  }
  _onXRFrame(e) {
    if (!(!this.attached || this.paused)) {
      if (this._xrHitTestSource) {
        const t = e.getHitTestResults(this._xrHitTestSource);
        this._processWebXRHitTestResult(t);
      }
      this._transientXrHitTestSource && e.getHitTestResultsForTransientInput(this._transientXrHitTestSource).forEach((r) => {
        this._processWebXRHitTestResult(r.results, r.inputSource);
      });
    }
  }
  _processWebXRHitTestResult(e, t) {
    const r = [];
    e.forEach((n) => {
      const i = n.getPose(this._xrSessionManager.referenceSpace);
      if (!i)
        return;
      const s = i.transform.position, a = i.transform.orientation;
      this._tmpPos.set(s.x, s.y, s.z), this._tmpQuat.set(a.x, a.y, a.z, a.w), he.FromFloat32ArrayToRefScaled(i.transform.matrix, 0, 1, this._tmpMat), this._xrSessionManager.scene.useRightHandedSystem || (this._tmpPos.z *= -1, this._tmpQuat.z *= -1, this._tmpQuat.w *= -1, this._tmpMat.toggleModelMatrixHandInPlace());
      const f = {
        position: this.autoCloneTransformation ? this._tmpPos.clone() : this._tmpPos,
        rotationQuaternion: this.autoCloneTransformation ? this._tmpQuat.clone() : this._tmpQuat,
        transformationMatrix: this.autoCloneTransformation ? this._tmpMat.clone() : this._tmpMat,
        inputSource: t,
        isTransient: !!t,
        xrHitResult: n
      };
      r.push(f);
    }), this.onHitTestResultObservable.notifyObservers(r);
  }
}
dS.Name = Gi.HIT_TEST;
dS.Version = 2;
So.AddWebXRFeature(dS.Name, (A, e) => () => new dS(A, e), dS.Version, !1);
class vS extends L9 {
  /**
   * The current feature point cloud maintained across frames.
   */
  get featurePointCloud() {
    return this._featurePointCloud;
  }
  /**
   * construct the feature point system
   * @param _xrSessionManager an instance of xr Session manager
   */
  constructor(e) {
    super(e), this._enabled = !1, this._featurePointCloud = [], this.onFeaturePointsAddedObservable = new Oe(), this.onFeaturePointsUpdatedObservable = new Oe(), this.xrNativeFeatureName = "bjsfeature-points", this._xrSessionManager.session ? this._init() : this._xrSessionManager.onXRSessionInit.addOnce(() => {
      this._init();
    });
  }
  /**
   * Detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    return super.detach() ? (this.featurePointCloud.length = 0, !0) : !1;
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    super.dispose(), this._featurePointCloud.length = 0, this.onFeaturePointsUpdatedObservable.clear(), this.onFeaturePointsAddedObservable.clear();
  }
  /**
   * On receiving a new XR frame if this feature is attached notify observers new feature point data is available.
   * @param frame
   */
  _onXRFrame(e) {
    if (!this.attached || !this._enabled || !e)
      return;
    const t = e.featurePointCloud;
    if (!(!t || t.length === 0)) {
      if (t.length % 5 !== 0)
        throw new Error("Received malformed feature point cloud of length: " + t.length);
      const r = t.length / 5, n = [], i = [];
      for (let s = 0; s < r; s++) {
        const a = s * 5, f = t[a + 4];
        this._featurePointCloud[f] ? n.push(f) : (this._featurePointCloud[f] = { position: new S(), confidenceValue: 0 }, i.push(f)), this._featurePointCloud[f].position.x = t[a], this._featurePointCloud[f].position.y = t[a + 1], this._featurePointCloud[f].position.z = t[a + 2], this._featurePointCloud[f].confidenceValue = t[a + 3];
      }
      i.length > 0 && this.onFeaturePointsAddedObservable.notifyObservers(i), n.length > 0 && this.onFeaturePointsUpdatedObservable.notifyObservers(n);
    }
  }
  /**
   * Initializes the feature. If the feature point feature is not available for this environment do not mark the feature as enabled.
   */
  _init() {
    !this._xrSessionManager.session.trySetFeaturePointCloudEnabled || !this._xrSessionManager.session.trySetFeaturePointCloudEnabled(!0) || (this._enabled = !0);
  }
}
vS.Name = Gi.FEATURE_POINTS;
vS.Version = 1;
So.AddWebXRFeature(vS.Name, (A) => () => new vS(A), vS.Version);
let xge = 0;
class uS extends L9 {
  constructor(e, t = {}) {
    super(e), this._options = t, this._detectedMeshes = /* @__PURE__ */ new Map(), this.onMeshAddedObservable = new Oe(), this.onMeshRemovedObservable = new Oe(), this.onMeshUpdatedObservable = new Oe(), this.xrNativeFeatureName = "mesh-detection", this._xrSessionManager.session ? this._init() : this._xrSessionManager.onXRSessionInit.addOnce(() => {
      this._init();
    });
  }
  detach() {
    return super.detach() ? (this._xrSessionManager.isNative && this._xrSessionManager.session.trySetMeshDetectorEnabled && this._xrSessionManager.session.trySetMeshDetectorEnabled(!1), this._options.doNotRemoveMeshesOnSessionEnded || (this._detectedMeshes.forEach((e) => {
      this.onMeshRemovedObservable.notifyObservers(e);
    }), this._detectedMeshes.clear()), !0) : !1;
  }
  dispose() {
    super.dispose(), this.onMeshAddedObservable.clear(), this.onMeshRemovedObservable.clear(), this.onMeshUpdatedObservable.clear();
  }
  _onXRFrame(e) {
    var t;
    try {
      if (!this.attached || !e)
        return;
      const r = (t = e.worldInformation) === null || t === void 0 ? void 0 : t.detectedMeshes;
      if (r) {
        const n = /* @__PURE__ */ new Set();
        this._detectedMeshes.forEach((i, s) => {
          r.has(s) || n.add(s);
        }), n.forEach((i) => {
          const s = this._detectedMeshes.get(i);
          s && (this.onMeshRemovedObservable.notifyObservers(s), this._detectedMeshes.delete(i));
        }), r.forEach((i) => {
          if (this._detectedMeshes.has(i)) {
            if (i.lastChangedTime === this._xrSessionManager.currentTimestamp) {
              const s = this._detectedMeshes.get(i);
              s && (this._updateVertexDataWithXRMesh(i, s, e), this.onMeshUpdatedObservable.notifyObservers(s));
            }
          } else {
            const s = {
              id: xge++,
              xrMesh: i
            }, a = this._updateVertexDataWithXRMesh(i, s, e);
            this._detectedMeshes.set(i, a), this.onMeshAddedObservable.notifyObservers(a);
          }
        });
      }
    } catch (r) {
      console.log(r.stack);
    }
  }
  _init() {
    this._xrSessionManager.isNative && (this._xrSessionManager.session.trySetMeshDetectorEnabled && this._xrSessionManager.session.trySetMeshDetectorEnabled(!0), this._options.preferredDetectorOptions && this._xrSessionManager.session.trySetPreferredMeshDetectorOptions && this._xrSessionManager.session.trySetPreferredMeshDetectorOptions(this._options.preferredDetectorOptions));
  }
  _updateVertexDataWithXRMesh(e, t, r) {
    if (t.xrMesh = e, t.worldParentNode = this._options.worldParentNode, this._options.convertCoordinateSystems) {
      if (this._xrSessionManager.scene.useRightHandedSystem)
        t.positions = e.positions, t.normals = e.normals;
      else {
        t.positions = new Float32Array(e.positions.length);
        for (let i = 0; i < e.positions.length; i += 3)
          t.positions[i] = e.positions[i], t.positions[i + 1] = e.positions[i + 1], t.positions[i + 2] = -1 * e.positions[i + 2];
        if (e.normals) {
          t.normals = new Float32Array(e.normals.length);
          for (let i = 0; i < e.normals.length; i += 3)
            t.normals[i] = e.normals[i], t.normals[i + 1] = e.normals[i + 1], t.normals[i + 2] = -1 * e.normals[i + 2];
        }
      }
      t.indices = e.indices;
      const n = r.getPose(e.meshSpace, this._xrSessionManager.referenceSpace);
      if (n) {
        const i = t.transformationMatrix || new he();
        he.FromArrayToRef(n.transform.matrix, 0, i), this._xrSessionManager.scene.useRightHandedSystem || i.toggleModelMatrixHandInPlace(), t.transformationMatrix = i, this._options.worldParentNode && i.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), i);
      }
    }
    return t;
  }
}
uS.Name = Gi.MESH_DETECTION;
uS.Version = 1;
So.AddWebXRFeature(uS.Name, (A, e) => () => new uS(A, e), uS.Version, !1);
var W2;
(function(A) {
  A[A.NotReceived = 0] = "NotReceived", A[A.Waiting = 1] = "Waiting", A[A.Received = 2] = "Received";
})(W2 || (W2 = {}));
class lS extends L9 {
  /**
   * constructs the image tracking feature
   * @param _xrSessionManager the session manager for this module
   * @param options read-only options to be used in this module
   */
  constructor(e, t) {
    super(e), this.options = t, this.onUntrackableImageFoundObservable = new Oe(), this.onTrackableImageFoundObservable = new Oe(), this.onTrackedImageUpdatedObservable = new Oe(), this._trackableScoreStatus = W2.NotReceived, this._trackedImages = [], this.xrNativeFeatureName = "image-tracking";
  }
  /**
   * attach this feature
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  attach() {
    return super.attach();
  }
  /**
   * detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    return super.detach();
  }
  /**
   * Get a tracked image by its ID.
   *
   * @param id the id of the image to load (position in the init array)
   * @returns a trackable image, if exists in this location
   */
  getTrackedImageById(e) {
    return this._trackedImages[e] || null;
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    super.dispose(), this._trackedImages.forEach((e) => {
      e.originalBitmap.close();
    }), this._trackedImages.length = 0, this.onTrackableImageFoundObservable.clear(), this.onUntrackableImageFoundObservable.clear(), this.onTrackedImageUpdatedObservable.clear();
  }
  /**
   * Extends the session init object if needed
   * @returns augmentation object fo the xr session init object.
   */
  async getXRSessionInitExtension() {
    if (!this.options.images || !this.options.images.length)
      return {};
    const e = this.options.images.map((t) => typeof t.src == "string" ? this._xrSessionManager.scene.getEngine()._createImageBitmapFromSource(t.src) : Promise.resolve(t.src));
    try {
      const t = await Promise.all(e);
      return this._originalTrackingRequest = t.map((r, n) => ({
        image: r,
        widthInMeters: this.options.images[n].estimatedRealWorldWidth
      })), {
        trackedImages: this._originalTrackingRequest
      };
    } catch {
      return ye.Error("Error loading images for tracking, WebXRImageTracking disabled for this session."), {};
    }
  }
  _onXRFrame(e) {
    if (!e.getImageTrackingResults || this._trackableScoreStatus === W2.Waiting)
      return;
    if (this._trackableScoreStatus === W2.NotReceived) {
      this._checkScoresAsync();
      return;
    }
    const t = e.getImageTrackingResults();
    for (const r of t) {
      let n = !1;
      const i = r.index, s = this._trackedImages[i];
      if (!s)
        continue;
      s.xrTrackingResult = r, s.realWorldWidth !== r.measuredWidthInMeters && (s.realWorldWidth = r.measuredWidthInMeters, n = !0);
      const a = e.getPose(r.imageSpace, this._xrSessionManager.referenceSpace);
      if (a) {
        const d = s.transformationMatrix;
        he.FromArrayToRef(a.transform.matrix, 0, d), this._xrSessionManager.scene.useRightHandedSystem || d.toggleModelMatrixHandInPlace(), n = !0;
      }
      const o = r.trackingState === "emulated";
      s.emulated !== o && (s.emulated = o, n = !0), n && this.onTrackedImageUpdatedObservable.notifyObservers(s);
    }
  }
  async _checkScoresAsync() {
    if (!this._xrSessionManager.session.getTrackedImageScores || this._trackableScoreStatus !== W2.NotReceived)
      return;
    this._trackableScoreStatus = W2.Waiting;
    const e = await this._xrSessionManager.session.getTrackedImageScores();
    if (!e || e.length === 0) {
      this._trackableScoreStatus = W2.NotReceived;
      return;
    }
    for (let t = 0; t < e.length; ++t)
      if (e[t] == "untrackable")
        this.onUntrackableImageFoundObservable.notifyObservers(t);
      else {
        const r = this._originalTrackingRequest[t].image, n = {
          id: t,
          originalBitmap: r,
          transformationMatrix: new he(),
          ratio: r.width / r.height
        };
        this._trackedImages[t] = n, this.onTrackableImageFoundObservable.notifyObservers(n);
      }
    this._trackableScoreStatus = e.length > 0 ? W2.Received : W2.NotReceived;
  }
}
lS.Name = Gi.IMAGE_TRACKING;
lS.Version = 1;
So.AddWebXRFeature(lS.Name, (A, e) => () => new lS(A, e), lS.Version, !1);
class PS extends L9 {
  /**
   * Creates a new instance of the dom-overlay feature
   * @param _xrSessionManager an instance of WebXRSessionManager
   * @param options options to use when constructing this feature
   */
  constructor(e, t) {
    super(e), this.options = t, this._domOverlayType = null, this._beforeXRSelectListener = null, this._element = null, this.xrNativeFeatureName = "dom-overlay", ye.Warn("dom-overlay is an experimental and unstable feature.");
  }
  /**
   * attach this feature
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  attach() {
    return !super.attach() || !this._xrSessionManager.session.domOverlayState || this._xrSessionManager.session.domOverlayState.type === null ? !1 : (this._domOverlayType = this._xrSessionManager.session.domOverlayState.type, this._element !== null && this.options.supressXRSelectEvents === !0 && (this._beforeXRSelectListener = (e) => {
      e.preventDefault();
    }, this._element.addEventListener("beforexrselect", this._beforeXRSelectListener)), !0);
  }
  /**
   * The type of DOM overlay (null when not supported).  Provided by UA and remains unchanged for duration of session.
   */
  get domOverlayType() {
    return this._domOverlayType;
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    super.dispose(), this._element !== null && this._beforeXRSelectListener && this._element.removeEventListener("beforexrselect", this._beforeXRSelectListener);
  }
  _onXRFrame(e) {
  }
  /**
   * Extends the session init object if needed
   * @returns augmentation object for the xr session init object.
   */
  async getXRSessionInitExtension() {
    if (this.options.element === void 0)
      return ye.Warn('"element" option must be provided to attach xr-dom-overlay feature.'), {};
    if (typeof this.options.element == "string") {
      const e = document.querySelector(this.options.element);
      if (e === null)
        return ye.Warn(`element not found '${this.options.element}' (not requesting xr-dom-overlay)`), {};
      this._element = e;
    } else
      this._element = this.options.element;
    return {
      domOverlay: {
        root: this._element
      }
    };
  }
}
PS.Name = Gi.DOM_OVERLAY;
PS.Version = 1;
So.AddWebXRFeature(PS.Name, (A, e) => () => new PS(A, e), PS.Version, !1);
class Pq extends L9 {
  /**
   * Current movement direction.  Will be null before XR Frames have been processed.
   */
  get movementDirection() {
    return this._movementDirection;
  }
  /**
   * Is movement enabled
   */
  get movementEnabled() {
    return this._featureContext.movementEnabled;
  }
  /**
   * Sets whether movement is enabled or not
   * @param enabled is movement enabled
   */
  set movementEnabled(e) {
    this._featureContext.movementEnabled = e;
  }
  /**
   * If movement follows viewer pose
   */
  get movementOrientationFollowsViewerPose() {
    return this._featureContext.movementOrientationFollowsViewerPose;
  }
  /**
   * Sets whether movement follows viewer pose
   * @param followsPose is movement should follow viewer pose
   */
  set movementOrientationFollowsViewerPose(e) {
    this._featureContext.movementOrientationFollowsViewerPose = e;
  }
  /**
   * Gets movement speed
   */
  get movementSpeed() {
    return this._featureContext.movementSpeed;
  }
  /**
   * Sets movement speed
   * @param movementSpeed movement speed
   */
  set movementSpeed(e) {
    this._featureContext.movementSpeed = e;
  }
  /**
   * Gets minimum threshold the controller's thumbstick/touchpad must pass before being recognized for movement (avoids jitter/unintentional movement)
   */
  get movementThreshold() {
    return this._featureContext.movementThreshold;
  }
  /**
   * Sets minimum threshold the controller's thumbstick/touchpad must pass before being recognized for movement (avoids jitter/unintentional movement)
   * @param movementThreshold new threshold
   */
  set movementThreshold(e) {
    this._featureContext.movementThreshold = e;
  }
  /**
   * Is rotation enabled
   */
  get rotationEnabled() {
    return this._featureContext.rotationEnabled;
  }
  /**
   * Sets whether rotation is enabled or not
   * @param enabled is rotation enabled
   */
  set rotationEnabled(e) {
    this._featureContext.rotationEnabled = e;
  }
  /**
   * Gets rotation speed factor
   */
  get rotationSpeed() {
    return this._featureContext.rotationSpeed;
  }
  /**
   * Sets rotation speed factor (1.0 is default)
   * @param rotationSpeed new rotation speed factor
   */
  set rotationSpeed(e) {
    this._featureContext.rotationSpeed = e;
  }
  /**
   * Gets minimum threshold the controller's thumbstick/touchpad must pass before being recognized for rotation (avoids jitter/unintentional rotation)
   */
  get rotationThreshold() {
    return this._featureContext.rotationThreshold;
  }
  /**
   * Sets minimum threshold the controller's thumbstick/touchpad must pass before being recognized for rotation (avoids jitter/unintentional rotation)
   * @param threshold new threshold
   */
  set rotationThreshold(e) {
    this._featureContext.rotationThreshold = e;
  }
  /**
   * constructs a new movement controller system
   * @param _xrSessionManager an instance of WebXRSessionManager
   * @param options configuration object for this feature
   */
  constructor(e, t) {
    var r, n, i, s, a, f;
    if (super(e), this._controllers = {}, this._currentRegistrationConfigurations = [], this._movementDirection = new Ze(), this._tmpRotationMatrix = he.Identity(), this._tmpTranslationDirection = new S(), this._tmpMovementTranslation = new S(), this._tempCacheQuaternion = new Ze(), this._attachController = (o) => {
      if (this._controllers[o.uniqueId])
        return;
      this._controllers[o.uniqueId] = {
        xrController: o,
        registeredComponents: []
      };
      const d = this._controllers[o.uniqueId];
      if (d.xrController.inputSource.targetRayMode === "tracked-pointer" && d.xrController.inputSource.gamepad) {
        const v = () => {
          if (o.motionController)
            for (const u of this._currentRegistrationConfigurations) {
              let l = null;
              if (u.allowedComponentTypes)
                for (const p of u.allowedComponentTypes) {
                  const c = o.motionController.getComponentOfType(p);
                  if (c !== null) {
                    l = c;
                    break;
                  }
                }
              if (u.mainComponentOnly) {
                const p = o.motionController.getMainComponent();
                if (p === null)
                  continue;
                l = p;
              }
              if (typeof u.componentSelectionPredicate == "function" && (l = u.componentSelectionPredicate(o)), l && u.forceHandedness && o.inputSource.handedness !== u.forceHandedness || l === null)
                continue;
              const P = {
                registrationConfiguration: u,
                component: l
              };
              d.registeredComponents.push(P), "axisChangedHandler" in u && (P.onAxisChangedObserver = l.onAxisValueChangedObservable.add((p) => {
                u.axisChangedHandler(p, this._movementState, this._featureContext, this._xrInput);
              })), "buttonChangedhandler" in u && (P.onButtonChangedObserver = l.onButtonStateChangedObservable.add(() => {
                l.changes.pressed && u.buttonChangedhandler(l.changes.pressed, this._movementState, this._featureContext, this._xrInput);
              }));
            }
        };
        o.motionController ? v() : o.onMotionControllerInitObservable.addOnce(() => {
          v();
        });
      }
    }, !t || t.xrInput === void 0) {
      ye.Error('WebXRControllerMovement feature requires "xrInput" option.');
      return;
    }
    Array.isArray(t.customRegistrationConfigurations) ? this._currentRegistrationConfigurations = t.customRegistrationConfigurations : this._currentRegistrationConfigurations = Pq.REGISTRATIONS.default, this._featureContext = {
      movementEnabled: t.movementEnabled || !0,
      movementOrientationFollowsViewerPose: (r = t.movementOrientationFollowsViewerPose) !== null && r !== void 0 ? r : !0,
      movementSpeed: (n = t.movementSpeed) !== null && n !== void 0 ? n : 1,
      movementThreshold: (i = t.movementThreshold) !== null && i !== void 0 ? i : 0.25,
      rotationEnabled: (s = t.rotationEnabled) !== null && s !== void 0 ? s : !0,
      rotationSpeed: (a = t.rotationSpeed) !== null && a !== void 0 ? a : 1,
      rotationThreshold: (f = t.rotationThreshold) !== null && f !== void 0 ? f : 0.25
    }, this._movementState = {
      moveX: 0,
      moveY: 0,
      rotateX: 0,
      rotateY: 0
    }, this._xrInput = t.xrInput;
  }
  attach() {
    return super.attach() ? (this._xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._xrInput.onControllerRemovedObservable, (e) => {
      this._detachController(e.uniqueId);
    }), !0) : !1;
  }
  detach() {
    return super.detach() ? (Object.keys(this._controllers).forEach((e) => {
      this._detachController(e);
    }), this._controllers = {}, !0) : !1;
  }
  /**
   * Occurs on every XR frame.
   * @param _xrFrame
   */
  _onXRFrame(e) {
    if (this.attached) {
      if (this._movementState.rotateX !== 0 && this._featureContext.rotationEnabled) {
        const r = this._xrSessionManager.scene.getEngine().getDeltaTime() * 1e-3 * this._featureContext.rotationSpeed * this._movementState.rotateX * (this._xrSessionManager.scene.useRightHandedSystem ? -1 : 1);
        this._featureContext.movementOrientationFollowsViewerPose ? (this._xrInput.xrCamera.cameraRotation.y += r, Ze.RotationYawPitchRollToRef(r, 0, 0, this._tempCacheQuaternion), this._xrInput.xrCamera.rotationQuaternion.multiplyToRef(this._tempCacheQuaternion, this._movementDirection)) : (Ze.RotationYawPitchRollToRef(r * 3, 0, 0, this._tempCacheQuaternion), this._movementDirection.multiplyInPlace(this._tempCacheQuaternion));
      } else
        this._featureContext.movementOrientationFollowsViewerPose && this._movementDirection.copyFrom(this._xrInput.xrCamera.rotationQuaternion);
      (this._movementState.moveX || this._movementState.moveY) && this._featureContext.movementEnabled && (he.FromQuaternionToRef(this._movementDirection, this._tmpRotationMatrix), this._tmpTranslationDirection.set(this._movementState.moveX, 0, this._movementState.moveY * (this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1)), S.TransformCoordinatesToRef(this._tmpTranslationDirection, this._tmpRotationMatrix, this._tmpMovementTranslation), this._tmpMovementTranslation.scaleInPlace(this._xrInput.xrCamera._computeLocalCameraSpeed() * this._featureContext.movementSpeed), this._xrInput.xrCamera.cameraDirection.addInPlace(this._tmpMovementTranslation));
    }
  }
  _detachController(e) {
    const t = this._controllers[e];
    if (t) {
      for (const r of t.registeredComponents)
        r.onAxisChangedObserver && r.component.onAxisValueChangedObservable.remove(r.onAxisChangedObserver), r.onButtonChangedObserver && r.component.onButtonStateChangedObservable.remove(r.onButtonChangedObserver);
      delete this._controllers[e];
    }
  }
}
Pq.Name = Gi.MOVEMENT;
Pq.REGISTRATIONS = {
  default: [
    {
      allowedComponentTypes: [Jl.THUMBSTICK_TYPE, Jl.TOUCHPAD_TYPE],
      forceHandedness: "left",
      axisChangedHandler: (A, e, t) => {
        e.rotateX = Math.abs(A.x) > t.rotationThreshold ? A.x : 0, e.rotateY = Math.abs(A.y) > t.rotationThreshold ? A.y : 0;
      }
    },
    {
      allowedComponentTypes: [Jl.THUMBSTICK_TYPE, Jl.TOUCHPAD_TYPE],
      forceHandedness: "right",
      axisChangedHandler: (A, e, t) => {
        e.moveX = Math.abs(A.x) > t.movementThreshold ? A.x : 0, e.moveY = Math.abs(A.y) > t.movementThreshold ? A.y : 0;
      }
    }
  ]
};
Pq.Version = 1;
So.AddWebXRFeature(Pq.Name, (A, e) => () => new Pq(A, e), Pq.Version, !0);
class cS extends L9 {
  /**
   * Creates a new instance of the light estimation feature
   * @param _xrSessionManager an instance of WebXRSessionManager
   * @param options options to use when constructing this feature
   */
  constructor(e, t) {
    super(e), this.options = t, this._canvasContext = null, this._reflectionCubeMap = null, this._xrLightEstimate = null, this._xrLightProbe = null, this._xrWebGLBinding = null, this._lightDirection = S.Up().negateInPlace(), this._lightColor = Ne.White(), this._intensity = 1, this._sphericalHarmonics = new HD(), this._cubeMapPollTime = Date.now(), this._lightEstimationPollTime = Date.now(), this._reflectionCubeMapTextureSize = 16, this.directionalLight = null, this.onReflectionCubeMapUpdatedObservable = new Oe(), this._updateReflectionCubeMap = () => {
      var r;
      if (!this._xrLightProbe)
        return;
      if (this.options.cubeMapPollInterval) {
        const i = Date.now();
        if (i - this._cubeMapPollTime < this.options.cubeMapPollInterval)
          return;
        this._cubeMapPollTime = i;
      }
      const n = this._getXRGLBinding().getReflectionCubeMap(this._xrLightProbe);
      if (n && this._reflectionCubeMap) {
        if (this._reflectionCubeMap._texture)
          (r = this._reflectionCubeMap._texture._hardwareTexture) === null || r === void 0 || r.set(n), this._reflectionCubeMap._texture.getEngine().resetTextureCache();
        else {
          const i = new As(this._xrSessionManager.scene.getEngine(), ri.Unknown);
          i.isCube = !0, i.invertY = !1, i._useSRGBBuffer = this.options.reflectionFormat === "srgba8", i.format = 5, i.generateMipMaps = !0, i.type = this.options.reflectionFormat !== "srgba8" ? 2 : 0, i.samplingMode = 3, i.width = this._reflectionCubeMapTextureSize, i.height = this._reflectionCubeMapTextureSize, i._cachedWrapU = 1, i._cachedWrapV = 1, i._hardwareTexture = new jm(n, this._getCanvasContext()), this._reflectionCubeMap._texture = i;
        }
        this._reflectionCubeMap._texture.isReady = !0, this.options.disablePreFiltering ? (this._xrSessionManager.scene.markAllMaterialsAsDirty(1), this.onReflectionCubeMapUpdatedObservable.notifyObservers(this._reflectionCubeMap)) : (this._xrLightProbe.removeEventListener("reflectionchange", this._updateReflectionCubeMap), this._hdrFilter.prefilter(this._reflectionCubeMap).then(() => {
          this._xrSessionManager.scene.markAllMaterialsAsDirty(1), this.onReflectionCubeMapUpdatedObservable.notifyObservers(this._reflectionCubeMap), this._xrLightProbe.addEventListener("reflectionchange", this._updateReflectionCubeMap);
        }));
      }
    }, this.xrNativeFeatureName = "light-estimation", this.options.createDirectionalLightSource && (this.directionalLight = new IA("light estimation directional", this._lightDirection, this._xrSessionManager.scene), this.directionalLight.position = new S(0, 8, 0), this.directionalLight.intensity = 0, this.directionalLight.falloffType = ra.FALLOFF_GLTF), this._hdrFilter = new _Q(this._xrSessionManager.scene.getEngine()), ye.Warn("light-estimation is an experimental and unstable feature.");
  }
  /**
   * While the estimated cube map is expected to update over time to better reflect the user's environment as they move around those changes are unlikely to happen with every XRFrame.
   * Since creating and processing the cube map is potentially expensive, especially if mip maps are needed, you can listen to the onReflectionCubeMapUpdatedObservable to determine
   * when it has been updated.
   */
  get reflectionCubeMapTexture() {
    return this._reflectionCubeMap;
  }
  /**
   * The most recent light estimate.  Available starting on the first frame where the device provides a light probe.
   */
  get xrLightingEstimate() {
    return this._xrLightEstimate ? {
      lightColor: this._lightColor,
      lightDirection: this._lightDirection,
      lightIntensity: this._intensity,
      sphericalHarmonics: this._sphericalHarmonics
    } : this._xrLightEstimate;
  }
  _getCanvasContext() {
    return this._canvasContext === null && (this._canvasContext = this._xrSessionManager.scene.getEngine()._gl), this._canvasContext;
  }
  _getXRGLBinding() {
    if (this._xrWebGLBinding === null) {
      const e = this._getCanvasContext();
      this._xrWebGLBinding = new XRWebGLBinding(this._xrSessionManager.session, e);
    }
    return this._xrWebGLBinding;
  }
  /**
   * attach this feature
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  attach() {
    var e;
    if (!super.attach())
      return !1;
    const t = (e = this.options.reflectionFormat) !== null && e !== void 0 ? e : this._xrSessionManager.session.preferredReflectionFormat || "srgba8";
    return this.options.reflectionFormat = t, this._xrSessionManager.session.requestLightProbe({
      reflectionFormat: t
    }).then((r) => {
      this._xrLightProbe = r, this.options.disableCubeMapReflection || (this._reflectionCubeMap || (this._reflectionCubeMap = new ls(this._xrSessionManager.scene), this._reflectionCubeMap._isCube = !0, this._reflectionCubeMap.coordinatesMode = 3, this.options.setSceneEnvironmentTexture && (this._xrSessionManager.scene.environmentTexture = this._reflectionCubeMap)), this._xrLightProbe.addEventListener("reflectionchange", this._updateReflectionCubeMap));
    }), !0;
  }
  /**
   * detach this feature.
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  detach() {
    const e = super.detach();
    return this._xrLightProbe !== null && !this.options.disableCubeMapReflection && (this._xrLightProbe.removeEventListener("reflectionchange", this._updateReflectionCubeMap), this._xrLightProbe = null), this._canvasContext = null, this._xrLightEstimate = null, this._xrWebGLBinding = null, e;
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    super.dispose(), this.onReflectionCubeMapUpdatedObservable.clear(), this.directionalLight && (this.directionalLight.dispose(), this.directionalLight = null), this._reflectionCubeMap !== null && (this._reflectionCubeMap._texture && this._reflectionCubeMap._texture.dispose(), this._reflectionCubeMap.dispose(), this._reflectionCubeMap = null);
  }
  _onXRFrame(e) {
    var t;
    if (this._xrLightProbe !== null) {
      if (this.options.lightEstimationPollInterval) {
        const r = Date.now();
        if (r - this._lightEstimationPollTime < this.options.lightEstimationPollInterval)
          return;
        this._lightEstimationPollTime = r;
      }
      if (this._xrLightEstimate = e.getLightEstimate(this._xrLightProbe), this._xrLightEstimate) {
        this._intensity = Math.max(1, this._xrLightEstimate.primaryLightIntensity.x, this._xrLightEstimate.primaryLightIntensity.y, this._xrLightEstimate.primaryLightIntensity.z);
        const r = this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1;
        this.options.disableVectorReuse && (this._lightDirection = new S(), this._lightColor = new Ne(), this.directionalLight && (this.directionalLight.direction = this._lightDirection, this.directionalLight.diffuse = this._lightColor)), this._lightDirection.copyFromFloats(this._xrLightEstimate.primaryLightDirection.x, this._xrLightEstimate.primaryLightDirection.y, this._xrLightEstimate.primaryLightDirection.z * r), this._lightColor.copyFromFloats(this._xrLightEstimate.primaryLightIntensity.x / this._intensity, this._xrLightEstimate.primaryLightIntensity.y / this._intensity, this._xrLightEstimate.primaryLightIntensity.z / this._intensity), this._sphericalHarmonics.updateFromFloatsArray(this._xrLightEstimate.sphericalHarmonicsCoefficients), this._reflectionCubeMap && !this.options.disableSphericalPolynomial && (this._reflectionCubeMap.sphericalPolynomial = this._reflectionCubeMap.sphericalPolynomial || new i4(), (t = this._reflectionCubeMap.sphericalPolynomial) === null || t === void 0 || t.updateFromHarmonics(this._sphericalHarmonics)), this._lightDirection.negateInPlace(), this.directionalLight && (this.directionalLight.direction.copyFrom(this._lightDirection), this.directionalLight.intensity = Math.min(this._intensity, 1), this.directionalLight.diffuse.copyFrom(this._lightColor));
      }
    }
  }
}
cS.Name = Gi.LIGHT_ESTIMATION;
cS.Version = 1;
So.AddWebXRFeature(cS.Name, (A, e) => () => new cS(A, e), cS.Version, !1);
class pS extends L9 {
  /**
   * Creates a new instance of the XR eye tracking feature.
   * @param _xrSessionManager An instance of WebXRSessionManager.
   */
  constructor(e) {
    super(e), this.onEyeTrackingStartedObservable = new Oe(), this.onEyeTrackingEndedObservable = new Oe(), this.onEyeTrackingFrameUpdateObservable = new Oe(), this._eyeTrackingStartListener = (t) => {
      this._latestEyeSpace = t.gazeSpace, this._gazeRay = new Hi(S.Zero(), S.Forward()), this.onEyeTrackingStartedObservable.notifyObservers(this._gazeRay);
    }, this._eyeTrackingEndListener = () => {
      this._latestEyeSpace = null, this._gazeRay = null, this.onEyeTrackingEndedObservable.notifyObservers();
    }, this.xrNativeFeatureName = "eye-tracking", this._xrSessionManager.session ? this._init() : this._xrSessionManager.onXRSessionInit.addOnce(() => {
      this._init();
    });
  }
  /**
   * Dispose this feature and all of the resources attached.
   */
  dispose() {
    super.dispose(), this._xrSessionManager.session.removeEventListener("eyetrackingstart", this._eyeTrackingStartListener), this._xrSessionManager.session.removeEventListener("eyetrackingend", this._eyeTrackingEndListener), this.onEyeTrackingStartedObservable.clear(), this.onEyeTrackingEndedObservable.clear(), this.onEyeTrackingFrameUpdateObservable.clear();
  }
  /**
   * Returns whether the gaze data is valid or not
   * @returns true if the data is valid
   */
  get isEyeGazeValid() {
    return !!this._gazeRay;
  }
  /**
   * Get a reference to the gaze ray. This data is valid while eye tracking persists, and will be set to null when gaze data is no longer available
   * @returns a reference to the gaze ray if it exists and is valid, returns null otherwise.
   */
  getEyeGaze() {
    return this._gazeRay;
  }
  _onXRFrame(e) {
    if (!(!this.attached || !e) && this._latestEyeSpace && this._gazeRay) {
      const t = e.getPose(this._latestEyeSpace, this._xrSessionManager.referenceSpace);
      if (t) {
        this._gazeRay.origin.set(t.transform.position.x, t.transform.position.y, t.transform.position.z);
        const r = t.transform.orientation;
        ue.Quaternion[0].set(r.x, r.y, r.z, r.w), this._xrSessionManager.scene.useRightHandedSystem ? S.RightHandedForwardReadOnly.rotateByQuaternionToRef(ue.Quaternion[0], this._gazeRay.direction) : (this._gazeRay.origin.z *= -1, ue.Quaternion[0].z *= -1, ue.Quaternion[0].w *= -1, S.LeftHandedForwardReadOnly.rotateByQuaternionToRef(ue.Quaternion[0], this._gazeRay.direction)), this.onEyeTrackingFrameUpdateObservable.notifyObservers(this._gazeRay);
      }
    }
  }
  _init() {
    this._xrSessionManager.isNative && (this._xrSessionManager.session.addEventListener("eyetrackingstart", this._eyeTrackingStartListener), this._xrSessionManager.session.addEventListener("eyetrackingend", this._eyeTrackingEndListener));
  }
}
pS.Name = Gi.EYE_TRACKING;
pS.Version = 1;
So.AddWebXRFeature(pS.Name, (A) => () => new pS(A), pS.Version, !1);
class Dge {
  constructor(e, t) {
    this._samples = [], this._idx = 0;
    for (let r = 0; r < e; ++r)
      this._samples.push(t ? t() : at.Zero());
  }
  get length() {
    return this._samples.length;
  }
  push(e, t) {
    this._idx = (this._idx + this._samples.length - 1) % this._samples.length, this.at(0).copyFromFloats(e, t);
  }
  at(e) {
    if (e >= this._samples.length)
      throw new Error("Index out of bounds");
    return this._samples[(this._idx + e) % this._samples.length];
  }
}
class jge {
  constructor() {
    this._samples = new Dge(20), this._entropy = 0, this.onFirstStepDetected = new Oe();
  }
  update(e, t, r, n) {
    this._samples.push(e, t);
    const i = this._samples.at(0);
    if (this._entropy *= this._entropyDecayFactor, this._entropy += at.Distance(i, this._samples.at(1)), this._entropy > this._entropyThreshold)
      return;
    let s;
    for (s = this._samePointCheckStartIdx; s < this._samples.length && !(at.DistanceSquared(i, this._samples.at(s)) < this._samePointSquaredDistanceThreshold); ++s)
      ;
    if (s === this._samples.length)
      return;
    let a = -1, f = 0;
    for (let b, j = 1; j < s; ++j)
      b = at.DistanceSquared(i, this._samples.at(j)), b > a && (f = j, a = b);
    if (a < this._apexSquaredDistanceThreshold)
      return;
    const o = this._samples.at(f), d = o.subtract(i);
    d.normalize();
    const v = ue.Vector2[0];
    let u, l, P = 0;
    for (let b = 1; b < s; ++b)
      l = this._samples.at(b), l.subtractToRef(i, v), u = at.Dot(d, v), P += v.lengthSquared() - u * u;
    if (P > s * this._squaredProjectionDistanceThreshold)
      return;
    const p = ue.Vector3[0];
    p.set(r, n, 0);
    const c = ue.Vector3[1];
    c.set(d.x, d.y, 0);
    const H = S.Cross(p, c).z > 0, T = i.clone(), q = i.clone();
    o.subtractToRef(i, d), H ? (d.scaleAndAddToRef(this._axisToApexShrinkFactor, T), d.scaleAndAddToRef(this._axisToApexExtendFactor, q)) : (d.scaleAndAddToRef(this._axisToApexExtendFactor, T), d.scaleAndAddToRef(this._axisToApexShrinkFactor, q)), this.onFirstStepDetected.notifyObservers({
      leftApex: T,
      rightApex: q,
      currentPosition: i,
      currentStepDirection: H ? "right" : "left"
    });
  }
  reset() {
    for (let e = 0; e < this._samples.length; ++e)
      this._samples.at(e).copyFromFloats(0, 0);
  }
  get _samePointCheckStartIdx() {
    return Math.floor(this._samples.length / 3);
  }
  get _samePointSquaredDistanceThreshold() {
    return 0.03 * 0.03;
  }
  get _apexSquaredDistanceThreshold() {
    return 0.09 * 0.09;
  }
  get _squaredProjectionDistanceThreshold() {
    return 0.03 * 0.03;
  }
  get _axisToApexShrinkFactor() {
    return 0.8;
  }
  get _axisToApexExtendFactor() {
    return -1.6;
  }
  get _entropyDecayFactor() {
    return 0.93;
  }
  get _entropyThreshold() {
    return 0.4;
  }
}
class wge {
  constructor(e, t, r, n) {
    this._leftApex = new at(), this._rightApex = new at(), this._currentPosition = new at(), this._axis = new at(), this._axisLength = -1, this._forward = new at(), this._steppingLeft = !1, this._t = -1, this._maxT = -1, this._maxTPosition = new at(), this._vitality = 0, this.onMovement = new Oe(), this.onFootfall = new Oe(), this._reset(e, t, r, n === "left");
  }
  _reset(e, t, r, n) {
    this._leftApex.copyFrom(e), this._rightApex.copyFrom(t), this._steppingLeft = n, this._steppingLeft ? (this._leftApex.subtractToRef(this._rightApex, this._axis), this._forward.copyFromFloats(-this._axis.y, this._axis.x)) : (this._rightApex.subtractToRef(this._leftApex, this._axis), this._forward.copyFromFloats(this._axis.y, -this._axis.x)), this._axisLength = this._axis.length(), this._forward.scaleInPlace(1 / this._axisLength), this._updateTAndVitality(r.x, r.y), this._maxT = this._t, this._maxTPosition.copyFrom(r), this._vitality = 1;
  }
  _updateTAndVitality(e, t) {
    this._currentPosition.copyFromFloats(e, t), this._steppingLeft ? this._currentPosition.subtractInPlace(this._rightApex) : this._currentPosition.subtractInPlace(this._leftApex);
    const r = this._t, n = at.Dot(this._currentPosition, this._axis);
    this._t = n / (this._axisLength * this._axisLength);
    const i = this._currentPosition.lengthSquared() - n / this._axisLength * (n / this._axisLength);
    this._vitality *= 0.92 - 100 * Math.max(i - 16e-4, 0) + Math.max(this._t - r, 0);
  }
  update(e, t) {
    if (this._vitality < this._vitalityThreshold)
      return !1;
    const r = this._t;
    return this._updateTAndVitality(e, t), this._t > this._maxT && (this._maxT = this._t, this._maxTPosition.copyFromFloats(e, t)), !(this._vitality < this._vitalityThreshold || (this._t > r && (this.onMovement.notifyObservers({ deltaT: this._t - r }), r < 0.5 && this._t >= 0.5 && this.onFootfall.notifyObservers({ foot: this._steppingLeft ? "left" : "right" })), this._t < 0.95 * this._maxT && (this._currentPosition.copyFromFloats(e, t), this._steppingLeft ? this._leftApex.copyFrom(this._maxTPosition) : this._rightApex.copyFrom(this._maxTPosition), this._reset(this._leftApex, this._rightApex, this._currentPosition, !this._steppingLeft)), this._axisLength < 0.03));
  }
  get _vitalityThreshold() {
    return 0.1;
  }
  get forward() {
    return this._forward;
  }
}
class UI {
  static get _MillisecondsPerUpdate() {
    return 1e3 / 15;
  }
  constructor(e) {
    this._detector = new jge(), this._walker = null, this._movement = new at(), this._millisecondsSinceLastUpdate = UI._MillisecondsPerUpdate, this.movementThisFrame = S.Zero(), this._engine = e, this._detector.onFirstStepDetected.add((t) => {
      this._walker || (this._walker = new wge(t.leftApex, t.rightApex, t.currentPosition, t.currentStepDirection), this._walker.onFootfall.add(() => {
        console.log("Footfall!");
      }), this._walker.onMovement.add((r) => {
        this._walker.forward.scaleAndAddToRef(0.024 * r.deltaT, this._movement);
      }));
    });
  }
  update(e, t) {
    t.y = 0, t.normalize(), this._millisecondsSinceLastUpdate += this._engine.getDeltaTime(), this._millisecondsSinceLastUpdate >= UI._MillisecondsPerUpdate && (this._millisecondsSinceLastUpdate -= UI._MillisecondsPerUpdate, this._detector.update(e.x, e.z, t.x, t.z), this._walker && (this._walker.update(e.x, e.z) || (this._walker = null)), this._movement.scaleInPlace(0.85)), this.movementThisFrame.set(this._movement.x, 0, this._movement.y);
  }
}
class CC extends L9 {
  /**
   * The module's name.
   */
  static get Name() {
    return Gi.WALKING_LOCOMOTION;
  }
  /**
   * The (Babylon) version of this module.
   * This is an integer representing the implementation version.
   * This number has no external basis.
   */
  static get Version() {
    return 1;
  }
  /**
   * The target to be articulated by walking locomotion.
   * When the walking locomotion feature detects walking in place, this element's
   * X and Z coordinates will be modified to reflect locomotion. This target should
   * be either the XR space's origin (i.e., the parent node of the WebXRCamera) or
   * the WebXRCamera itself. Note that the WebXRCamera path will modify the position
   * of the WebXRCamera directly and is thus discouraged.
   */
  get locomotionTarget() {
    return this._locomotionTarget;
  }
  /**
   * The target to be articulated by walking locomotion.
   * When the walking locomotion feature detects walking in place, this element's
   * X and Z coordinates will be modified to reflect locomotion. This target should
   * be either the XR space's origin (i.e., the parent node of the WebXRCamera) or
   * the WebXRCamera itself. Note that the WebXRCamera path will modify the position
   * of the WebXRCamera directly and is thus discouraged.
   */
  set locomotionTarget(e) {
    this._locomotionTarget = e, this._isLocomotionTargetWebXRCamera = this._locomotionTarget.getClassName() === "WebXRCamera";
  }
  /**
   * Construct a new Walking Locomotion feature.
   * @param sessionManager manager for the current XR session
   * @param options creation options, prominently including the vector target for locomotion
   */
  constructor(e, t) {
    super(e), this._up = new S(), this._forward = new S(), this._position = new S(), this._movement = new S(), this._sessionManager = e, this.locomotionTarget = t.locomotionTarget, this._isLocomotionTargetWebXRCamera && Se.Warn("Using walking locomotion directly on a WebXRCamera may have unintended interactions with other XR techniques. Using an XR space parent is highly recommended");
  }
  /**
   * Checks whether this feature is compatible with the current WebXR session.
   * Walking locomotion is only compatible with "immersive-vr" sessions.
   * @returns true if compatible, false otherwise
   */
  isCompatible() {
    return this._sessionManager.sessionMode === void 0 || this._sessionManager.sessionMode === "immersive-vr";
  }
  /**
   * Attaches the feature.
   * Typically called automatically by the features manager.
   * @returns true if attach succeeded, false otherwise
   */
  attach() {
    return !this.isCompatible || !super.attach() ? !1 : (this._walker = new UI(this._sessionManager.scene.getEngine()), !0);
  }
  /**
   * Detaches the feature.
   * Typically called automatically by the features manager.
   * @returns true if detach succeeded, false otherwise
   */
  detach() {
    return super.detach() ? (this._walker = null, !0) : !1;
  }
  _onXRFrame(e) {
    const t = e.getViewerPose(this._sessionManager.baseReferenceSpace);
    if (!t)
      return;
    const r = this.locomotionTarget.getScene().useRightHandedSystem ? 1 : -1, n = t.transform.matrix;
    this._up.copyFromFloats(n[4], n[5], r * n[6]), this._forward.copyFromFloats(n[8], n[9], r * n[10]), this._position.copyFromFloats(n[12], n[13], r * n[14]), this._forward.scaleAndAddToRef(0.05, this._position), this._up.scaleAndAddToRef(-0.05, this._position), this._walker.update(this._position, this._forward), this._movement.copyFrom(this._walker.movementThisFrame), this._isLocomotionTargetWebXRCamera || S.TransformNormalToRef(this._movement, this.locomotionTarget.getWorldMatrix(), this._movement), this.locomotionTarget.position.addInPlace(this._movement);
  }
}
So.AddWebXRFeature(CC.Name, (A, e) => () => new CC(A, e), CC.Version, !1);
class Wie extends XQ {
  constructor(e, t, r, n, i, s) {
    super(e, t, r, n, s), this.getWidth = e, this.getHeight = t, this.layer = r, this.layerType = n, this.isMultiview = i, this.createRTTProvider = s;
  }
}
class mge extends TQ {
  constructor(e, t, r) {
    super(e.scene, r), this._xrSessionManager = e, this._xrWebGLBinding = t, this.layerWrapper = r, this._lastSubImages = /* @__PURE__ */ new Map(), this._compositionLayer = r.layer;
  }
  _getRenderTargetForSubImage(e, t) {
    var r, n, i, s;
    const a = this._lastSubImages.get(t), f = t == "left" ? 0 : 1, o = (r = e.colorTextureWidth) !== null && r !== void 0 ? r : e.textureWidth, d = (n = e.colorTextureHeight) !== null && n !== void 0 ? n : e.textureHeight;
    if (!this._renderTargetTextures[f] || (a == null ? void 0 : a.textureWidth) !== o || (a == null ? void 0 : a.textureHeight) !== d) {
      let v;
      const u = (i = e.depthStencilTextureWidth) !== null && i !== void 0 ? i : o, l = (s = e.depthStencilTextureHeight) !== null && s !== void 0 ? s : d;
      (o === u || d === l) && (v = e.depthStencilTexture), this._renderTargetTextures[f] = this._createRenderTargetTexture(o, d, null, e.colorTexture, v, this.layerWrapper.isMultiview), this._framebufferDimensions = {
        framebufferWidth: o,
        framebufferHeight: d
      };
    }
    return this._lastSubImages.set(t, e), this._renderTargetTextures[f];
  }
  _getSubImageForEye(e) {
    const t = this._xrSessionManager.currentFrame;
    return t ? this._xrWebGLBinding.getSubImage(this._compositionLayer, t, e) : null;
  }
  getRenderTargetTextureForEye(e) {
    const t = this._getSubImageForEye(e);
    return t ? this._getRenderTargetForSubImage(t, e) : null;
  }
  getRenderTargetTextureForView(e) {
    return this.getRenderTargetTextureForEye(e.eye);
  }
  _setViewportForSubImage(e, t) {
    var r, n;
    const i = (r = t.colorTextureWidth) !== null && r !== void 0 ? r : t.textureWidth, s = (n = t.colorTextureWidth) !== null && n !== void 0 ? n : t.textureHeight, a = t.viewport;
    e.x = a.x / i, e.y = a.y / s, e.width = a.width / i, e.height = a.height / s;
  }
  trySetViewportForView(e, t) {
    const r = this._lastSubImages.get(t.eye) || this._getSubImageForEye(t.eye);
    return r ? (this._setViewportForSubImage(e, r), !0) : !1;
  }
}
class Sie extends Wie {
  constructor(e, t, r) {
    super(() => e.textureWidth, () => e.textureHeight, e, "XRProjectionLayer", t, (n) => new Bge(n, r, this)), this.layer = e;
  }
}
class Bge extends mge {
  constructor(e, t, r) {
    super(e, t, r), this.layerWrapper = r, this._projectionLayer = r.layer;
  }
  _getSubImageForView(e) {
    return this._xrWebGLBinding.getViewSubImage(this._projectionLayer, e);
  }
  getRenderTargetTextureForView(e) {
    return this._getRenderTargetForSubImage(this._getSubImageForView(e), e.eye);
  }
  getRenderTargetTextureForEye(e) {
    const t = this._lastSubImages.get(e);
    return t ? this._getRenderTargetForSubImage(t, e) : null;
  }
  trySetViewportForView(e, t) {
    const r = this._lastSubImages.get(t.eye) || this._getSubImageForView(t);
    return r ? (this._setViewportForSubImage(e, r), !0) : !1;
  }
}
const Wge = {}, tZ = {
  textureType: "texture",
  colorFormat: 6408,
  depthFormat: 35056,
  scaleFactor: 1
};
class hS extends L9 {
  constructor(e, t = {}) {
    super(e), this._options = t, this._existingLayers = [], this.xrNativeFeatureName = "layers";
  }
  /**
   * Attach this feature.
   * Will usually be called by the features manager.
   *
   * @returns true if successful.
   */
  attach() {
    if (!super.attach())
      return !1;
    const e = this._xrSessionManager.scene.getEngine();
    this._glContext = e._gl, this._xrWebGLBinding = new XRWebGLBinding(this._xrSessionManager.session, this._glContext), this._existingLayers.length = 0;
    const t = Object.assign({}, tZ), r = this._options.preferMultiviewOnInit && e.getCaps().multiview;
    return r && (t.textureType = "texture-array"), this.addXRSessionLayer(this.createProjectionLayer(t, r)), !0;
  }
  detach() {
    return super.detach() ? (this._existingLayers.length = 0, !0) : !1;
  }
  /**
   * Creates a new XRWebGLLayer.
   * @param params an object providing configuration options for the new XRWebGLLayer
   * @returns the XRWebGLLayer
   */
  createXRWebGLLayer(e = Wge) {
    const t = new XRWebGLLayer(this._xrSessionManager.session, this._glContext, e);
    return new qQ(t);
  }
  /**
   * Creates a new XRProjectionLayer.
   * @param params an object providing configuration options for the new XRProjectionLayer.
   * @param multiview whether the projection layer should render with multiview.
   * @returns the projection layer
   */
  createProjectionLayer(e = tZ, t = !1) {
    if (t && e.textureType !== "texture-array")
      throw new Error("Projection layers can only be made multiview if they use texture arrays. Set the textureType parameter to 'texture-array'.");
    if (!t && e.textureType === "texture-array")
      throw new Error("We currently only support multiview rendering when the textureType parameter is set to 'texture-array'.");
    const r = this._xrWebGLBinding.createProjectionLayer(e);
    return new Sie(r, t, this._xrWebGLBinding);
  }
  /**
   * Add a new layer to the already-existing list of layers
   * @param wrappedLayer the new layer to add to the existing ones
   */
  addXRSessionLayer(e) {
    this.setXRSessionLayers([...this._existingLayers, e]);
  }
  /**
   * Sets the layers to be used by the XR session.
   * Note that you must call this function with any layers you wish to render to
   * since it adds them to the XR session's render state
   * (replacing any layers that were added in a previous call to setXRSessionLayers or updateRenderState).
   * This method also sets up the session manager's render target texture provider
   * as the first layer in the array, which feeds the WebXR camera(s) attached to the session.
   * @param wrappedLayers An array of WebXRLayerWrapper, usually returned from the WebXRLayers createLayer functions.
   */
  setXRSessionLayers(e) {
    this._existingLayers = e;
    const t = Object.assign({}, this._xrSessionManager.session.renderState);
    t.baseLayer = void 0, t.layers = e.map((r) => r.layer), this._xrSessionManager.updateRenderState(t), this._xrSessionManager._setBaseLayerWrapper(e.length > 0 ? e[0] : null);
  }
  isCompatible() {
    return !this._xrSessionManager.isNative && typeof XRWebGLBinding < "u" && !!XRWebGLBinding.prototype.createProjectionLayer;
  }
  /**
   * Dispose this feature and all of the resources attached.
   */
  dispose() {
    super.dispose();
  }
  _onXRFrame(e) {
  }
}
hS.Name = Gi.LAYERS;
hS.Version = 1;
So.AddWebXRFeature(hS.Name, (A, e) => () => new hS(A, e), hS.Version, !1);
class HS extends L9 {
  /**
   * Width of depth data. If depth data is not exist, returns null.
   */
  get width() {
    return this._width;
  }
  /**
   * Height of depth data. If depth data is not exist, returns null.
   */
  get height() {
    return this._height;
  }
  /**
   * Scale factor by which the raw depth values must be multiplied in order to get the depths in meters.
   */
  get rawValueToMeters() {
    return this._rawValueToMeters;
  }
  /**
   * An XRRigidTransform that needs to be applied when indexing into the depth buffer.
   */
  get normDepthBufferFromNormView() {
    return this._normDepthBufferFromNormView;
  }
  /**
   * Describes which depth-sensing usage ("cpu" or "gpu") is used.
   */
  get depthUsage() {
    switch (this._xrSessionManager.session.depthUsage) {
      case "cpu-optimized":
        return "cpu";
      case "gpu-optimized":
        return "gpu";
    }
  }
  /**
   * Describes which depth sensing data format ("ushort" or "float") is used.
   */
  get depthDataFormat() {
    switch (this._xrSessionManager.session.depthDataFormat) {
      case "luminance-alpha":
        return "ushort";
      case "float32":
        return "float";
    }
  }
  /**
   * Latest cached InternalTexture which containing depth buffer information.
   * This can be used when the depth usage is "gpu".
   */
  get latestInternalTexture() {
    var e, t;
    if (!this._cachedWebGLTexture)
      return null;
    const r = this._xrSessionManager.scene.getEngine(), n = new As(r, ri.Unknown);
    return n.isCube = !1, n.invertY = !1, n._useSRGBBuffer = !1, n.format = this.depthDataFormat === "ushort" ? 2 : 5, n.generateMipMaps = !1, n.type = this.depthDataFormat === "ushort" ? 5 : 1, n.samplingMode = 7, n.width = (e = this.width) !== null && e !== void 0 ? e : 0, n.height = (t = this.height) !== null && t !== void 0 ? t : 0, n._cachedWrapU = 1, n._cachedWrapV = 1, n._hardwareTexture = new jm(this._cachedWebGLTexture, r._gl), n;
  }
  /**
   * cached depth buffer
   */
  get latestDepthBuffer() {
    return this._cachedDepthBuffer ? this.depthDataFormat === "ushort" ? new Uint16Array(this._cachedDepthBuffer) : new Float32Array(this._cachedDepthBuffer) : null;
  }
  /**
   * Latest cached Texture of depth image which is made from the depth buffer data.
   */
  get latestDepthImageTexture() {
    return this._cachedDepthImageTexture;
  }
  /**
   * Creates a new instance of the depth sensing feature
   * @param _xrSessionManager the WebXRSessionManager
   * @param options options for WebXR Depth Sensing Feature
   */
  constructor(e, t) {
    super(e), this.options = t, this._width = null, this._height = null, this._rawValueToMeters = null, this._normDepthBufferFromNormView = null, this._cachedDepthBuffer = null, this._cachedWebGLTexture = null, this._cachedDepthImageTexture = null, this.onGetDepthInMetersAvailable = new Oe(), this.xrNativeFeatureName = "depth-sensing", ye.Warn("depth-sensing is an experimental and unstable feature.");
  }
  /**
   * attach this feature
   * Will usually be called by the features manager
   *
   * @returns true if successful.
   */
  attach(e) {
    return !super.attach(e) || this._xrSessionManager.session.depthDataFormat == null || this._xrSessionManager.session.depthUsage == null ? !1 : (this._glBinding = new XRWebGLBinding(this._xrSessionManager.session, this._xrSessionManager.scene.getEngine()._gl), !0);
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    var e;
    (e = this._cachedDepthImageTexture) === null || e === void 0 || e.dispose();
  }
  _onXRFrame(e) {
    const t = this._xrSessionManager.referenceSpace, r = e.getViewerPose(t);
    if (r != null)
      for (const n of r.views)
        switch (this.depthUsage) {
          case "cpu":
            this._updateDepthInformationAndTextureCPUDepthUsage(e, n, this.depthDataFormat);
            break;
          case "gpu":
            if (!this._glBinding)
              break;
            this._updateDepthInformationAndTextureWebGLDepthUsage(this._glBinding, n, this.depthDataFormat);
            break;
          default:
            ye.Error("Unknown depth usage"), this.detach();
            break;
        }
  }
  _updateDepthInformationAndTextureCPUDepthUsage(e, t, r) {
    const n = e.getDepthInformation(t);
    if (n === null)
      return;
    const { data: i, width: s, height: a, rawValueToMeters: f, getDepthInMeters: o } = n;
    switch (this._width = s, this._height = a, this._rawValueToMeters = f, this._cachedDepthBuffer = i, this.onGetDepthInMetersAvailable.notifyObservers(o.bind(n)), this._cachedDepthImageTexture || (this._cachedDepthImageTexture = Bo.CreateRTexture(null, s, a, this._xrSessionManager.scene, !1, !0, We.NEAREST_SAMPLINGMODE, Ge.TEXTURETYPE_FLOAT)), r) {
      case "ushort":
        this._cachedDepthImageTexture.update(Float32Array.from(new Uint16Array(i)).map((d) => d * f));
        break;
      case "float":
        this._cachedDepthImageTexture.update(new Float32Array(i).map((d) => d * f));
        break;
    }
  }
  _updateDepthInformationAndTextureWebGLDepthUsage(e, t, r) {
    const n = e.getDepthInformation(t);
    if (n === null)
      return;
    const { texture: i, width: s, height: a } = n;
    this._width = s, this._height = a, this._cachedWebGLTexture = i;
    const f = this._xrSessionManager.scene, d = f.getEngine().wrapWebGLTexture(i);
    this._cachedDepthImageTexture || (this._cachedDepthImageTexture = Bo.CreateRTexture(null, s, a, f, !1, !0, We.NEAREST_SAMPLINGMODE, r === "ushort" ? Ge.TEXTURETYPE_UNSIGNED_BYTE : Ge.TEXTURETYPE_FLOAT)), this._cachedDepthImageTexture._texture = d;
  }
  /**
   * Extends the session init object if needed
   * @returns augmentation object for the xr session init object.
   */
  getXRSessionInitExtension() {
    const e = this.options.usagePreference != null && this.options.usagePreference.length !== 0, t = this.options.dataFormatPreference != null && this.options.dataFormatPreference.length !== 0;
    return new Promise((r) => {
      if (e && t) {
        const n = this.options.usagePreference.map((s) => {
          switch (s) {
            case "cpu":
              return "cpu-optimized";
            case "gpu":
              return "gpu-optimized";
          }
        }), i = this.options.dataFormatPreference.map((s) => {
          switch (s) {
            case "ushort":
              return "luminance-alpha";
            case "float":
              return "float32";
          }
        });
        r({
          depthSensing: {
            usagePreference: n,
            dataFormatPreference: i
          }
        });
      } else
        r({});
    });
  }
}
HS.Name = Gi.DEPTH_SENSING;
HS.Version = 1;
So.AddWebXRFeature(HS.Name, (A, e) => () => new HS(A, e), HS.Version, !1);
const Sge = "velocityPixelShader", Uge = `precision highp float;
#define CUSTOM_FRAGMENT_BEGIN
varying vec4 clipPos;varying vec4 previousClipPos;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
highp vec4 motionVector=( clipPos/clipPos.w-previousClipPos/previousClipPos.w );gl_FragColor=motionVector;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[Sge] = Uge;
const Ige = "velocityVertexShader", Rge = `#define CUSTOM_VERTEX_BEGIN
#define VELOCITY
attribute vec3 position;
#include<instancesDeclaration>
uniform mat4 viewProjection;uniform mat4 previousViewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;uniform mat4 previousViewProjectionR;
#endif
varying vec4 clipPos;varying vec4 previousClipPos;
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 positionUpdated=position;
#include<instancesVertex>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);vec4 previousWorldPos=finalPreviousWorld*vec4(positionUpdated,1.0);
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousWorldPos;gl_Position=clipPos;} else {clipPos=viewProjectionR*worldPos;previousClipPos=previousViewProjectionR*previousWorldPos;gl_Position=clipPos;}
#elif
clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousWorldPos;gl_Position=clipPos;
#endif
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[Ige] = Rge;
class Uie extends Ta {
  /**
   * Creates a Space Warp render target
   * @param motionVectorTexture WebGLTexture provided by WebGLSubImage
   * @param depthStencilTexture WebGLTexture provided by WebGLSubImage
   * @param scene scene used with the render target
   * @param size the size of the render target (used for each view)
   */
  constructor(e, t, r, n = 512) {
    super("spacewarp rtt", n, r, !1, !0, 2, !1, void 0, !1, !1, !0, void 0, !0), this._originalPairing = [], this._previousWorldMatrices = [], this._previousTransforms = [he.Identity(), he.Identity()], this._renderTarget = this.getScene().getEngine().createMultiviewRenderTargetTexture(this.getRenderWidth(), this.getRenderHeight(), e, t), this._renderTarget._disposeOnlyFramebuffers = !0, this._texture = this._renderTarget.texture, this._texture.isMultiview = !0, this._texture.format = 5, r && (this._velocityMaterial = new Zo("velocity shader material", r, {
      vertex: "velocity",
      fragment: "velocity"
    }, {
      uniforms: ["world", "previousWorld", "viewProjection", "viewProjectionR", "previousViewProjection", "previousViewProjectionR"]
    }), this._velocityMaterial._materialHelperNeedsPreviousMatrices = !0, this._velocityMaterial.onBindObservable.add((i) => {
      this._previousWorldMatrices[i.uniqueId] = this._previousWorldMatrices[i.uniqueId] || i.getWorldMatrix(), this._velocityMaterial.getEffect().setMatrix("previousWorld", this._previousWorldMatrices[i.uniqueId]), this._previousWorldMatrices[i.uniqueId] = i.getWorldMatrix(), this._velocityMaterial.getEffect().setMatrix("previousViewProjection", this._previousTransforms[0]), this._velocityMaterial.getEffect().setMatrix("previousViewProjectionR", this._previousTransforms[1]), this._previousTransforms[0].copyFrom(r.getTransformMatrix()), this._previousTransforms[1].copyFrom(r._transformMatrixR);
    }), this._velocityMaterial.freeze());
  }
  /**
   * {@inheritDoc}
   */
  render(e = !1, t = !1) {
    this._originalPairing.length = 0;
    const r = this.getScene();
    r && this._velocityMaterial && r.getActiveMeshes().forEach((n) => {
      this._originalPairing.push([n, n.material]), n.material = this._velocityMaterial;
    }), super.render(e, t), this._originalPairing.forEach((n) => {
      n[0].material = n[1];
    });
  }
  /**
   * @internal
   */
  _bindFrameBuffer() {
    this._renderTarget && this.getScene().getEngine().bindSpaceWarpFramebuffer(this._renderTarget);
  }
  /**
   * Gets the number of views the corresponding to the texture (eg. a SpaceWarpRenderTarget will have > 1)
   * @returns the view count
   */
  getViewCount() {
    return 2;
  }
  /**
   * {@inheritdoc}
   */
  dispose() {
    super.dispose(), this._velocityMaterial.dispose(), this._previousTransforms.length = 0, this._previousWorldMatrices.length = 0, this._originalPairing.length = 0;
  }
}
class Iie {
  constructor(e, t, r) {
    this._scene = e, this._xrSessionManager = t, this._xrWebGLBinding = r, this._lastSubImages = /* @__PURE__ */ new Map(), this._renderTargetTextures = /* @__PURE__ */ new Map(), this._engine = e.getEngine();
  }
  _getSubImageForView(e) {
    const t = this._xrSessionManager._getBaseLayerWrapper();
    if (!t)
      throw new Error("For Space Warp, the base layer should be a WebXR Projection Layer.");
    if (t.layerType !== "XRProjectionLayer")
      throw new Error('For Space Warp, the base layer type should "XRProjectionLayer".');
    const r = t.layer;
    return this._xrWebGLBinding.getViewSubImage(r, e);
  }
  _setViewportForSubImage(e, t) {
    e.x = 0, e.y = 0, e.width = t.motionVectorTextureWidth, e.height = t.motionVectorTextureHeight;
  }
  _createRenderTargetTexture(e, t, r, n, i) {
    if (!this._engine)
      throw new Error("Engine is disposed");
    const s = { width: e, height: t }, a = new Uie(n, i, this._scene, s), f = a.renderTarget;
    return r && (f._framebuffer = r), f._colorTextureArray = n, f._depthStencilTextureArray = i, a.disableRescaling(), a.renderListPredicate = () => !0, a;
  }
  _getRenderTargetForSubImage(e, t) {
    const r = this._lastSubImages.get(t);
    let n = this._renderTargetTextures.get(t.eye);
    const i = e.motionVectorTextureWidth, s = e.motionVectorTextureHeight;
    return (!n || (r == null ? void 0 : r.textureWidth) !== i || (r == null ? void 0 : r.textureHeight) != s) && (n = this._createRenderTargetTexture(i, s, null, e.motionVectorTexture, e.depthStencilTexture), this._renderTargetTextures.set(t.eye, n), this._framebufferDimensions = {
      framebufferWidth: i,
      framebufferHeight: s
    }), this._lastSubImages.set(t, e), n;
  }
  /**
   * {@inheritDoc}
   */
  trySetViewportForView(e, t) {
    const r = this._lastSubImages.get(t) || this._getSubImageForView(t);
    return r ? (this._setViewportForSubImage(e, r), !0) : !1;
  }
  /**
   * Access the motion vector (which will turn on Space Warp)
   * @param view the view to access the motion vector texture for
   */
  accessMotionVector(e) {
    const t = this._getSubImageForView(e);
    t && (t.motionVectorTexture, t.depthStencilTexture);
  }
  /**
   * {@inheritDoc}
   */
  getRenderTargetTextureForEye(e) {
    return null;
  }
  /**
   * {@inheritDoc}
   */
  getRenderTargetTextureForView(e) {
    const t = this._getSubImageForView(e);
    return t ? this._getRenderTargetForSubImage(t, e) : null;
  }
  /**
   * {@inheritDoc}
   */
  dispose() {
    this._renderTargetTextures.forEach((e) => e.dispose()), this._renderTargetTextures.clear();
  }
}
class gS extends L9 {
  /**
   * constructor for the space warp feature
   * @param _xrSessionManager the xr session manager for this feature
   */
  constructor(e) {
    super(e), this._onAfterRenderObserver = null, this.dependsOn = [Gi.LAYERS], this.xrNativeFeatureName = "space-warp", this._xrSessionManager.scene.needsPreviousWorldMatrices = !0;
  }
  /**
   * Attach this feature.
   * Will usually be called by the features manager.
   *
   * @returns true if successful.
   */
  attach() {
    if (!super.attach())
      return !1;
    const e = this._xrSessionManager.scene.getEngine();
    return this._glContext = e._gl, this._xrWebGLBinding = new XRWebGLBinding(this._xrSessionManager.session, this._glContext), this.spaceWarpRTTProvider = new Iie(this._xrSessionManager.scene, this._xrSessionManager, this._xrWebGLBinding), this._onAfterRenderObserver = this._xrSessionManager.scene.onAfterRenderObservable.add(() => this._onAfterRender()), !0;
  }
  detach() {
    return this._xrSessionManager.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver), super.detach();
  }
  _onAfterRender() {
    this.attached && this._renderTargetTexture && this._renderTargetTexture.render(!1, !1);
  }
  /**
   * {@inheritdoc}
   */
  isCompatible() {
    return this._xrSessionManager.scene.getEngine().getCaps().colorBufferHalfFloat || !1;
  }
  /**
   * {@inheritdoc}
   */
  dispose() {
    super.dispose();
  }
  _onXRFrame(e) {
    const t = e.getViewerPose(this._xrSessionManager.referenceSpace);
    if (!t)
      return;
    const r = t.views[0];
    this._renderTargetTexture = this._renderTargetTexture || this.spaceWarpRTTProvider.getRenderTargetTextureForView(r), this.spaceWarpRTTProvider.accessMotionVector(r);
  }
}
gS.Name = Gi.SPACE_WARP;
gS.Version = 1;
So.AddWebXRFeature(gS.Name, (A) => () => new gS(A), gS.Version, !1);
class XS extends L9 {
  /**
   * Creates a new instance of the feature
   * @param _xrSessionManager the WebXRSessionManager
   * @param options options for the Feature
   */
  constructor(e, t = {}) {
    super(e), this.options = t, this._cachedInternalTextures = [], this.texturesData = [], this.viewIndex = [], this.cameraIntrinsics = [], this.onTexturesUpdatedObservable = new Oe(), this.xrNativeFeatureName = "camera-access";
  }
  attach(e) {
    return super.attach(e) ? (this._glContext = this._xrSessionManager.scene.getEngine()._gl, this._glBinding = new XRWebGLBinding(this._xrSessionManager.session, this._glContext), !0) : !1;
  }
  detach() {
    return super.detach() ? (this._glBinding = void 0, this.options.doNotDisposeOnDetach || (this._cachedInternalTextures.forEach((e) => e.dispose()), this.texturesData.forEach((e) => e.dispose()), this._cachedInternalTextures.length = 0, this.texturesData.length = 0, this.cameraIntrinsics.length = 0), !0) : !1;
  }
  /**
   * Dispose this feature and all of the resources attached
   */
  dispose() {
    super.dispose(), this.onTexturesUpdatedObservable.clear();
  }
  /**
   * @see https://github.com/immersive-web/raw-camera-access/blob/main/explainer.md
   */
  _updateCameraIntrinsics(e, t) {
    const r = {
      width: e.camera.width,
      height: e.camera.height,
      x: 0,
      y: 0
    }, n = e.projectionMatrix, i = (1 - n[8]) * r.width / 2 + r.x, s = (1 - n[9]) * r.height / 2 + r.y, a = r.width / 2 * n[0], f = r.height / 2 * n[5], o = r.width / 2 * n[4];
    this.cameraIntrinsics[t] = {
      u0: i,
      v0: s,
      ax: a,
      ay: f,
      gamma: o,
      width: r.width,
      height: r.height,
      viewportX: r.x,
      viewportY: r.y
    };
  }
  _updateInternalTextures(e, t = 0) {
    var r, n;
    if (!e.camera)
      return !1;
    this.viewIndex[t] = e.eye;
    const i = (r = this._glBinding) === null || r === void 0 ? void 0 : r.getCameraImage(e.camera);
    if (this._cachedInternalTextures[t])
      (n = this._cachedInternalTextures[t]._hardwareTexture) === null || n === void 0 || n.set(i);
    else {
      const s = new As(this._xrSessionManager.scene.getEngine(), ri.Unknown, !0);
      s.isCube = !0, s.invertY = !1, s.format = 5, s.generateMipMaps = !0, s.type = 1, s.samplingMode = 3, s.width = e.camera.width, s.height = e.camera.height, s._cachedWrapU = 1, s._cachedWrapV = 1, s._hardwareTexture = new jm(i, this._glContext), this._cachedInternalTextures[t] = s;
      const a = new ls(this._xrSessionManager.scene);
      a.name = `WebXR Raw Camera Access (${t})`, a._texture = this._cachedInternalTextures[t], this.texturesData[t] = a, this._updateCameraIntrinsics(e, t);
    }
    return this._cachedInternalTextures[t].isReady = !0, !0;
  }
  _onXRFrame(e) {
    const t = this._xrSessionManager.referenceSpace, r = e.getViewerPose(t);
    if (!r || !r.views)
      return;
    let n = !0;
    r.views.forEach((i, s) => {
      n = n && this._updateInternalTextures(i, s);
    }), n && this.onTexturesUpdatedObservable.notifyObservers(this.texturesData);
  }
}
XS.Name = Gi.RAW_CAMERA_ACCESS;
XS.Version = 1;
So.AddWebXRFeature(XS.Name, (A, e) => () => new XS(A, e), XS.Version, !1);
class Rie extends Um {
  /**
   * Create a new hand controller object, without loading a controller model
   * @param scene the scene to use to create this controller
   * @param gamepadObject the corresponding gamepad object
   * @param handedness the handedness of the controller
   */
  constructor(e, t, r) {
    super(e, Vge[r], t, r, !0), this.profileId = "generic-hand-select-grasp";
  }
  _getFilenameAndPath() {
    return {
      filename: "generic.babylon",
      path: "https://controllers.babylonjs.com/generic/"
    };
  }
  _getModelLoadingConstraints() {
    return !0;
  }
  _processLoadedModel(e) {
  }
  _setRootMesh(e) {
  }
  _updateModel() {
  }
}
E9.RegisterController("generic-hand-select-grasp", (A, e) => new Rie(e, A.gamepad, A.handedness));
const Vge = {
  left: {
    selectComponentId: "xr-standard-trigger",
    components: {
      // eslint-disable-next-line @typescript-eslint/naming-convention
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr-standard-trigger",
        visualResponses: {}
      },
      grasp: {
        type: "trigger",
        gamepadIndices: {
          button: 4
        },
        rootNodeName: "grasp",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "generic-hand-select-grasp-left",
    assetPath: "left.glb"
  },
  right: {
    selectComponentId: "xr-standard-trigger",
    components: {
      // eslint-disable-next-line @typescript-eslint/naming-convention
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr-standard-trigger",
        visualResponses: {}
      },
      grasp: {
        type: "trigger",
        gamepadIndices: {
          button: 4
        },
        rootNodeName: "grasp",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "generic-hand-select-grasp-right",
    assetPath: "right.glb"
  },
  none: {
    selectComponentId: "xr-standard-trigger",
    components: {
      // eslint-disable-next-line @typescript-eslint/naming-convention
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr-standard-trigger",
        visualResponses: {}
      },
      grasp: {
        type: "trigger",
        gamepadIndices: {
          button: 4
        },
        rootNodeName: "grasp",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "generic-hand-select-grasp-none",
    assetPath: "none.glb"
  }
};
class cq extends Um {
  constructor(e, t, r) {
    super(e, Cge["left-right"], t, r), this._mapping = {
      defaultButton: {
        valueNodeName: "VALUE",
        unpressedNodeName: "UNPRESSED",
        pressedNodeName: "PRESSED"
      },
      defaultAxis: {
        valueNodeName: "VALUE",
        minNodeName: "MIN",
        maxNodeName: "MAX"
      },
      buttons: {
        "xr-standard-trigger": {
          rootNodeName: "SELECT",
          componentProperty: "button",
          states: ["default", "touched", "pressed"]
        },
        "xr-standard-squeeze": {
          rootNodeName: "GRASP",
          componentProperty: "state",
          states: ["pressed"]
        },
        "xr-standard-touchpad": {
          rootNodeName: "TOUCHPAD_PRESS",
          labelAnchorNodeName: "squeeze-label",
          touchPointNodeName: "TOUCH"
          // TODO - use this for visual feedback
        },
        "xr-standard-thumbstick": {
          rootNodeName: "THUMBSTICK_PRESS",
          componentProperty: "state",
          states: ["pressed"]
        }
      },
      axes: {
        "xr-standard-touchpad": {
          "x-axis": {
            rootNodeName: "TOUCHPAD_TOUCH_X"
          },
          "y-axis": {
            rootNodeName: "TOUCHPAD_TOUCH_Y"
          }
        },
        "xr-standard-thumbstick": {
          "x-axis": {
            rootNodeName: "THUMBSTICK_X"
          },
          "y-axis": {
            rootNodeName: "THUMBSTICK_Y"
          }
        }
      }
    }, this.profileId = "microsoft-mixed-reality";
  }
  _getFilenameAndPath() {
    let e = "";
    this.handedness === "left" ? e = cq.MODEL_LEFT_FILENAME : e = cq.MODEL_RIGHT_FILENAME;
    const t = "default", r = cq.MODEL_BASE_URL + t + "/";
    return {
      filename: e,
      path: r
    };
  }
  _getModelLoadingConstraints() {
    const e = Hn.IsPluginForExtensionAvailable(".glb");
    return e || Se.Warn("glTF / glb loaded was not registered, using generic controller instead"), e;
  }
  _processLoadedModel(e) {
    this.rootMesh && (this.getComponentIds().forEach((t, r) => {
      if (!this.disableAnimation && t && this.rootMesh) {
        const n = this._mapping.buttons[t], i = n.rootNodeName;
        if (!i) {
          Se.Log("Skipping unknown button at index: " + r + " with mapped name: " + t);
          return;
        }
        const s = this._getChildByName(this.rootMesh, i);
        if (!s) {
          Se.Warn("Missing button mesh with name: " + i);
          return;
        }
        if (n.valueMesh = this._getImmediateChildByName(s, this._mapping.defaultButton.valueNodeName), n.pressedMesh = this._getImmediateChildByName(s, this._mapping.defaultButton.pressedNodeName), n.unpressedMesh = this._getImmediateChildByName(s, this._mapping.defaultButton.unpressedNodeName), n.valueMesh && n.pressedMesh && n.unpressedMesh) {
          const a = this.getComponent(t);
          a && a.onButtonStateChangedObservable.add((f) => {
            this._lerpTransform(n, f.value);
          }, void 0, !0);
        } else
          Se.Warn("Missing button submesh under mesh with name: " + i);
      }
    }), this.getComponentIds().forEach((t) => {
      const r = this.getComponent(t);
      r.isAxes() && ["x-axis", "y-axis"].forEach((n) => {
        if (!this.rootMesh)
          return;
        const i = this._mapping.axes[t][n], s = this._getChildByName(this.rootMesh, i.rootNodeName);
        if (!s) {
          Se.Warn("Missing axis mesh with name: " + i.rootNodeName);
          return;
        }
        i.valueMesh = this._getImmediateChildByName(s, this._mapping.defaultAxis.valueNodeName), i.minMesh = this._getImmediateChildByName(s, this._mapping.defaultAxis.minNodeName), i.maxMesh = this._getImmediateChildByName(s, this._mapping.defaultAxis.maxNodeName), i.valueMesh && i.minMesh && i.maxMesh ? r && r.onAxisValueChangedObservable.add((a) => {
          const f = n === "x-axis" ? a.x : a.y;
          this._lerpTransform(i, f, !0);
        }, void 0, !0) : Se.Warn("Missing axis submesh under mesh with name: " + i.rootNodeName);
      });
    }));
  }
  _setRootMesh(e) {
    this.rootMesh = new Ee(this.profileId + " " + this.handedness, this.scene), this.rootMesh.isPickable = !1;
    let t;
    for (let r = 0; r < e.length; r++) {
      const n = e[r];
      n.isPickable = !1, n.parent || (t = n);
    }
    t && t.setParent(this.rootMesh), this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = Ze.FromEulerAngles(0, Math.PI, 0));
  }
  _updateModel() {
  }
}
cq.MODEL_BASE_URL = "https://controllers.babylonjs.com/microsoft/";
cq.MODEL_LEFT_FILENAME = "left.glb";
cq.MODEL_RIGHT_FILENAME = "right.glb";
E9.RegisterController("windows-mixed-reality", (A, e) => new cq(e, A.gamepad, A.handedness));
const Cge = {
  left: {
    selectComponentId: "xr-standard-trigger",
    components: {
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr_standard_trigger",
        visualResponses: {
          xr_standard_trigger_pressed: {
            componentProperty: "button",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_trigger_pressed_value",
            minNodeName: "xr_standard_trigger_pressed_min",
            maxNodeName: "xr_standard_trigger_pressed_max"
          }
        }
      },
      "xr-standard-squeeze": {
        type: "squeeze",
        gamepadIndices: {
          button: 1
        },
        rootNodeName: "xr_standard_squeeze",
        visualResponses: {
          xr_standard_squeeze_pressed: {
            componentProperty: "button",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_squeeze_pressed_value",
            minNodeName: "xr_standard_squeeze_pressed_min",
            maxNodeName: "xr_standard_squeeze_pressed_max"
          }
        }
      },
      "xr-standard-touchpad": {
        type: "touchpad",
        gamepadIndices: {
          button: 2,
          xAxis: 0,
          yAxis: 1
        },
        rootNodeName: "xr_standard_touchpad",
        visualResponses: {
          xr_standard_touchpad_pressed: {
            componentProperty: "button",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_touchpad_pressed_value",
            minNodeName: "xr_standard_touchpad_pressed_min",
            maxNodeName: "xr_standard_touchpad_pressed_max"
          },
          xr_standard_touchpad_xaxis_pressed: {
            componentProperty: "xAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_touchpad_xaxis_pressed_value",
            minNodeName: "xr_standard_touchpad_xaxis_pressed_min",
            maxNodeName: "xr_standard_touchpad_xaxis_pressed_max"
          },
          xr_standard_touchpad_yaxis_pressed: {
            componentProperty: "yAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_touchpad_yaxis_pressed_value",
            minNodeName: "xr_standard_touchpad_yaxis_pressed_min",
            maxNodeName: "xr_standard_touchpad_yaxis_pressed_max"
          },
          xr_standard_touchpad_xaxis_touched: {
            componentProperty: "xAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_touchpad_xaxis_touched_value",
            minNodeName: "xr_standard_touchpad_xaxis_touched_min",
            maxNodeName: "xr_standard_touchpad_xaxis_touched_max"
          },
          xr_standard_touchpad_yaxis_touched: {
            componentProperty: "yAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_touchpad_yaxis_touched_value",
            minNodeName: "xr_standard_touchpad_yaxis_touched_min",
            maxNodeName: "xr_standard_touchpad_yaxis_touched_max"
          },
          xr_standard_touchpad_axes_touched: {
            componentProperty: "state",
            states: ["touched", "pressed"],
            valueNodeProperty: "visibility",
            valueNodeName: "xr_standard_touchpad_axes_touched_value"
          }
        },
        touchPointNodeName: "xr_standard_touchpad_axes_touched_value"
      },
      "xr-standard-thumbstick": {
        type: "thumbstick",
        gamepadIndices: {
          button: 3,
          xAxis: 2,
          yAxis: 3
        },
        rootNodeName: "xr_standard_thumbstick",
        visualResponses: {
          xr_standard_thumbstick_pressed: {
            componentProperty: "button",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_thumbstick_pressed_value",
            minNodeName: "xr_standard_thumbstick_pressed_min",
            maxNodeName: "xr_standard_thumbstick_pressed_max"
          },
          xr_standard_thumbstick_xaxis_pressed: {
            componentProperty: "xAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value",
            minNodeName: "xr_standard_thumbstick_xaxis_pressed_min",
            maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max"
          },
          xr_standard_thumbstick_yaxis_pressed: {
            componentProperty: "yAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value",
            minNodeName: "xr_standard_thumbstick_yaxis_pressed_min",
            maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max"
          }
        }
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "microsoft-mixed-reality-left",
    assetPath: "left.glb"
  },
  right: {
    selectComponentId: "xr-standard-trigger",
    components: {
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr_standard_trigger",
        visualResponses: {
          xr_standard_trigger_pressed: {
            componentProperty: "button",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_trigger_pressed_value",
            minNodeName: "xr_standard_trigger_pressed_min",
            maxNodeName: "xr_standard_trigger_pressed_max"
          }
        }
      },
      "xr-standard-squeeze": {
        type: "squeeze",
        gamepadIndices: {
          button: 1
        },
        rootNodeName: "xr_standard_squeeze",
        visualResponses: {
          xr_standard_squeeze_pressed: {
            componentProperty: "button",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_squeeze_pressed_value",
            minNodeName: "xr_standard_squeeze_pressed_min",
            maxNodeName: "xr_standard_squeeze_pressed_max"
          }
        }
      },
      "xr-standard-touchpad": {
        type: "touchpad",
        gamepadIndices: {
          button: 2,
          xAxis: 0,
          yAxis: 1
        },
        rootNodeName: "xr_standard_touchpad",
        visualResponses: {
          xr_standard_touchpad_pressed: {
            componentProperty: "button",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_touchpad_pressed_value",
            minNodeName: "xr_standard_touchpad_pressed_min",
            maxNodeName: "xr_standard_touchpad_pressed_max"
          },
          xr_standard_touchpad_xaxis_pressed: {
            componentProperty: "xAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_touchpad_xaxis_pressed_value",
            minNodeName: "xr_standard_touchpad_xaxis_pressed_min",
            maxNodeName: "xr_standard_touchpad_xaxis_pressed_max"
          },
          xr_standard_touchpad_yaxis_pressed: {
            componentProperty: "yAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_touchpad_yaxis_pressed_value",
            minNodeName: "xr_standard_touchpad_yaxis_pressed_min",
            maxNodeName: "xr_standard_touchpad_yaxis_pressed_max"
          },
          xr_standard_touchpad_xaxis_touched: {
            componentProperty: "xAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_touchpad_xaxis_touched_value",
            minNodeName: "xr_standard_touchpad_xaxis_touched_min",
            maxNodeName: "xr_standard_touchpad_xaxis_touched_max"
          },
          xr_standard_touchpad_yaxis_touched: {
            componentProperty: "yAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_touchpad_yaxis_touched_value",
            minNodeName: "xr_standard_touchpad_yaxis_touched_min",
            maxNodeName: "xr_standard_touchpad_yaxis_touched_max"
          },
          xr_standard_touchpad_axes_touched: {
            componentProperty: "state",
            states: ["touched", "pressed"],
            valueNodeProperty: "visibility",
            valueNodeName: "xr_standard_touchpad_axes_touched_value"
          }
        },
        touchPointNodeName: "xr_standard_touchpad_axes_touched_value"
      },
      "xr-standard-thumbstick": {
        type: "thumbstick",
        gamepadIndices: {
          button: 3,
          xAxis: 2,
          yAxis: 3
        },
        rootNodeName: "xr_standard_thumbstick",
        visualResponses: {
          xr_standard_thumbstick_pressed: {
            componentProperty: "button",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_thumbstick_pressed_value",
            minNodeName: "xr_standard_thumbstick_pressed_min",
            maxNodeName: "xr_standard_thumbstick_pressed_max"
          },
          xr_standard_thumbstick_xaxis_pressed: {
            componentProperty: "xAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value",
            minNodeName: "xr_standard_thumbstick_xaxis_pressed_min",
            maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max"
          },
          xr_standard_thumbstick_yaxis_pressed: {
            componentProperty: "yAxis",
            states: ["default", "touched", "pressed"],
            valueNodeProperty: "transform",
            valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value",
            minNodeName: "xr_standard_thumbstick_yaxis_pressed_min",
            maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max"
          }
        }
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "microsoft-mixed-reality-right",
    assetPath: "right.glb"
  }
};
class R0 extends Um {
  constructor(e, t, r, n = !1, i = !1) {
    super(e, Oge[r], t, r), this._forceLegacyControllers = i, this.profileId = "oculus-touch";
  }
  _getFilenameAndPath() {
    let e = "";
    this.handedness === "left" ? e = R0.MODEL_LEFT_FILENAME : e = R0.MODEL_RIGHT_FILENAME;
    const t = this._isQuest() ? R0.QUEST_MODEL_BASE_URL : R0.MODEL_BASE_URL;
    return {
      filename: e,
      path: t
    };
  }
  _getModelLoadingConstraints() {
    return !0;
  }
  _processLoadedModel(e) {
    const t = this._isQuest(), r = this.handedness === "right" ? -1 : 1;
    this.getComponentIds().forEach((n) => {
      const i = n && this.getComponent(n);
      i && i.onButtonStateChangedObservable.add((s) => {
        if (!(!this.rootMesh || this.disableAnimation))
          switch (n) {
            case "xr-standard-trigger":
              t || (this._modelRootNode.getChildren()[3].rotation.x = -s.value * 0.2, this._modelRootNode.getChildren()[3].position.y = -s.value * 5e-3, this._modelRootNode.getChildren()[3].position.z = -s.value * 5e-3);
              return;
            case "xr-standard-squeeze":
              t || (this._modelRootNode.getChildren()[4].position.x = r * s.value * 35e-4);
              return;
            case "xr-standard-thumbstick":
              return;
            case "a-button":
            case "x-button":
              t || (s.pressed ? this._modelRootNode.getChildren()[1].position.y = -1e-3 : this._modelRootNode.getChildren()[1].position.y = 0);
              return;
            case "b-button":
            case "y-button":
              t || (s.pressed ? this._modelRootNode.getChildren()[2].position.y = -1e-3 : this._modelRootNode.getChildren()[2].position.y = 0);
              return;
          }
      }, void 0, !0);
    });
  }
  _setRootMesh(e) {
    this.rootMesh = new Ee(this.profileId + " " + this.handedness, this.scene), this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = Ze.FromEulerAngles(0, Math.PI, 0)), e.forEach((t) => {
      t.isPickable = !1;
    }), this._isQuest() ? this._modelRootNode = e[0] : (this._modelRootNode = e[1], this.rootMesh.position.y = 0.034, this.rootMesh.position.z = 0.052), this._modelRootNode.parent = this.rootMesh;
  }
  _updateModel() {
  }
  /**
   * Is this the new type of oculus touch. At the moment both have the same profile and it is impossible to differentiate
   * between the touch and touch 2.
   */
  _isQuest() {
    return !!navigator.userAgent.match(/Quest/gi) && !this._forceLegacyControllers;
  }
}
R0.MODEL_BASE_URL = "https://controllers.babylonjs.com/oculus/";
R0.MODEL_LEFT_FILENAME = "left.babylon";
R0.MODEL_RIGHT_FILENAME = "right.babylon";
R0.QUEST_MODEL_BASE_URL = "https://controllers.babylonjs.com/oculusQuest/";
E9.RegisterController("oculus-touch", (A, e) => new R0(e, A.gamepad, A.handedness));
E9.RegisterController("oculus-touch-legacy", (A, e) => new R0(e, A.gamepad, A.handedness, !0));
const Oge = {
  left: {
    selectComponentId: "xr-standard-trigger",
    components: {
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr_standard_trigger",
        visualResponses: {}
      },
      "xr-standard-squeeze": {
        type: "squeeze",
        gamepadIndices: {
          button: 1
        },
        rootNodeName: "xr_standard_squeeze",
        visualResponses: {}
      },
      "xr-standard-thumbstick": {
        type: "thumbstick",
        gamepadIndices: {
          button: 3,
          xAxis: 2,
          yAxis: 3
        },
        rootNodeName: "xr_standard_thumbstick",
        visualResponses: {}
      },
      "x-button": {
        type: "button",
        gamepadIndices: {
          button: 4
        },
        rootNodeName: "x_button",
        visualResponses: {}
      },
      "y-button": {
        type: "button",
        gamepadIndices: {
          button: 5
        },
        rootNodeName: "y_button",
        visualResponses: {}
      },
      thumbrest: {
        type: "button",
        gamepadIndices: {
          button: 6
        },
        rootNodeName: "thumbrest",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "oculus-touch-v2-left",
    assetPath: "left.glb"
  },
  right: {
    selectComponentId: "xr-standard-trigger",
    components: {
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr_standard_trigger",
        visualResponses: {}
      },
      "xr-standard-squeeze": {
        type: "squeeze",
        gamepadIndices: {
          button: 1
        },
        rootNodeName: "xr_standard_squeeze",
        visualResponses: {}
      },
      "xr-standard-thumbstick": {
        type: "thumbstick",
        gamepadIndices: {
          button: 3,
          xAxis: 2,
          yAxis: 3
        },
        rootNodeName: "xr_standard_thumbstick",
        visualResponses: {}
      },
      "a-button": {
        type: "button",
        gamepadIndices: {
          button: 4
        },
        rootNodeName: "a_button",
        visualResponses: {}
      },
      "b-button": {
        type: "button",
        gamepadIndices: {
          button: 5
        },
        rootNodeName: "b_button",
        visualResponses: {}
      },
      thumbrest: {
        type: "button",
        gamepadIndices: {
          button: 6
        },
        rootNodeName: "thumbrest",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "oculus-touch-v2-right",
    assetPath: "right.glb"
  }
};
class qm extends Um {
  /**
   * Create a new Vive motion controller object
   * @param scene the scene to use to create this controller
   * @param gamepadObject the corresponding gamepad object
   * @param handedness the handedness of the controller
   */
  constructor(e, t, r) {
    super(e, yge[r], t, r), this.profileId = "htc-vive";
  }
  _getFilenameAndPath() {
    const e = qm.MODEL_FILENAME, t = qm.MODEL_BASE_URL;
    return {
      filename: e,
      path: t
    };
  }
  _getModelLoadingConstraints() {
    return !0;
  }
  _processLoadedModel(e) {
    this.getComponentIds().forEach((t) => {
      const r = t && this.getComponent(t);
      r && r.onButtonStateChangedObservable.add((n) => {
        if (!(!this.rootMesh || this.disableAnimation))
          switch (t) {
            case "xr-standard-trigger":
              this._modelRootNode.getChildren()[6].rotation.x = -n.value * 0.15;
              return;
            case "xr-standard-touchpad":
              return;
            case "xr-standard-squeeze":
              return;
          }
      }, void 0, !0);
    });
  }
  _setRootMesh(e) {
    this.rootMesh = new Ee(this.profileId + " " + this.handedness, this.scene), e.forEach((t) => {
      t.isPickable = !1;
    }), this._modelRootNode = e[1], this._modelRootNode.parent = this.rootMesh, this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = Ze.FromEulerAngles(0, Math.PI, 0));
  }
  _updateModel() {
  }
}
qm.MODEL_BASE_URL = "https://controllers.babylonjs.com/vive/";
qm.MODEL_FILENAME = "wand.babylon";
E9.RegisterController("htc-vive", (A, e) => new qm(e, A.gamepad, A.handedness));
const yge = {
  left: {
    selectComponentId: "xr-standard-trigger",
    components: {
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr_standard_trigger",
        visualResponses: {}
      },
      "xr-standard-squeeze": {
        type: "squeeze",
        gamepadIndices: {
          button: 1
        },
        rootNodeName: "xr_standard_squeeze",
        visualResponses: {}
      },
      "xr-standard-touchpad": {
        type: "touchpad",
        gamepadIndices: {
          button: 2,
          xAxis: 0,
          yAxis: 1
        },
        rootNodeName: "xr_standard_touchpad",
        visualResponses: {}
      },
      menu: {
        type: "button",
        gamepadIndices: {
          button: 4
        },
        rootNodeName: "menu",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "htc_vive_none",
    assetPath: "none.glb"
  },
  right: {
    selectComponentId: "xr-standard-trigger",
    components: {
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr_standard_trigger",
        visualResponses: {}
      },
      "xr-standard-squeeze": {
        type: "squeeze",
        gamepadIndices: {
          button: 1
        },
        rootNodeName: "xr_standard_squeeze",
        visualResponses: {}
      },
      "xr-standard-touchpad": {
        type: "touchpad",
        gamepadIndices: {
          button: 2,
          xAxis: 0,
          yAxis: 1
        },
        rootNodeName: "xr_standard_touchpad",
        visualResponses: {}
      },
      menu: {
        type: "button",
        gamepadIndices: {
          button: 4
        },
        rootNodeName: "menu",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "htc_vive_none",
    assetPath: "none.glb"
  },
  none: {
    selectComponentId: "xr-standard-trigger",
    components: {
      "xr-standard-trigger": {
        type: "trigger",
        gamepadIndices: {
          button: 0
        },
        rootNodeName: "xr_standard_trigger",
        visualResponses: {}
      },
      "xr-standard-squeeze": {
        type: "squeeze",
        gamepadIndices: {
          button: 1
        },
        rootNodeName: "xr_standard_squeeze",
        visualResponses: {}
      },
      "xr-standard-touchpad": {
        type: "touchpad",
        gamepadIndices: {
          button: 2,
          xAxis: 0,
          yAxis: 1
        },
        rootNodeName: "xr_standard_touchpad",
        visualResponses: {}
      },
      menu: {
        type: "button",
        gamepadIndices: {
          button: 4
        },
        rootNodeName: "menu",
        visualResponses: {}
      }
    },
    gamepadMapping: "xr-standard",
    rootNodeName: "htc-vive-none",
    assetPath: "none.glb"
  }
};
class Vie {
  get session() {
    return this._nativeImpl.session;
  }
  constructor(e) {
    this._nativeImpl = e, this._xrTransform = new XRRigidTransform(), this._xrPose = {
      transform: this._xrTransform,
      emulatedPosition: !1
    }, this._xrPoseVectorData = new Float32Array(8), this.fillPoses = this._nativeImpl.fillPoses.bind(this._nativeImpl), this.getViewerPose = this._nativeImpl.getViewerPose.bind(this._nativeImpl), this.getHitTestResults = this._nativeImpl.getHitTestResults.bind(this._nativeImpl), this.getHitTestResultsForTransientInput = () => {
      throw new Error("XRFrame.getHitTestResultsForTransientInput not supported on native.");
    }, this.createAnchor = this._nativeImpl.createAnchor.bind(this._nativeImpl), this.getJointPose = this._nativeImpl.getJointPose.bind(this._nativeImpl), this.fillJointRadii = this._nativeImpl.fillJointRadii.bind(this._nativeImpl), this.getLightEstimate = () => {
      throw new Error("XRFrame.getLightEstimate not supported on native.");
    }, this.getImageTrackingResults = () => {
      var t;
      return (t = this._nativeImpl._imageTrackingResults) !== null && t !== void 0 ? t : [];
    };
  }
  getPose(e, t) {
    if (!this._nativeImpl.getPoseData(e, t, this._xrPoseVectorData.buffer, this._xrTransform.matrix.buffer))
      return;
    const r = this._xrTransform.position;
    r.x = this._xrPoseVectorData[0], r.y = this._xrPoseVectorData[1], r.z = this._xrPoseVectorData[2], r.w = this._xrPoseVectorData[3];
    const n = this._xrTransform.orientation;
    return n.x = this._xrPoseVectorData[4], n.y = this._xrPoseVectorData[5], n.z = this._xrPoseVectorData[6], n.w = this._xrPoseVectorData[7], this._xrPose;
  }
  get trackedAnchors() {
    return this._nativeImpl.trackedAnchors;
  }
  get worldInformation() {
    return this._nativeImpl.worldInformation;
  }
  get detectedPlanes() {
    return this._nativeImpl.detectedPlanes;
  }
  get featurePointCloud() {
    return this._nativeImpl.featurePointCloud;
  }
  getDepthInformation(e) {
    throw new Error("This function is not available in Babylon Native");
  }
}
gte("NativeXRFrame", Vie);
var f4;
(function(A) {
  A[A.Input = 0] = "Input", A[A.Output = 1] = "Output";
})(f4 || (f4 = {}));
class IF {
  constructor(e, t, r) {
    this._ownerBlock = r, this._connectedPoint = [], this.uniqueId = v4(), this.connectedPointIds = [], this.name = e, this._connectionType = t;
  }
  /**
   * The type of the connection
   */
  get connectionType() {
    return this._connectionType;
  }
  /**
   * @internal
   * Override this to indicate if a point can connect to more than one point.
   */
  _isSingularConnection() {
    return !0;
  }
  /**
   * Returns if a point is connected to any other point.
   * @returns boolean indicating if the point is connected.
   */
  isConnected() {
    return this._connectedPoint.length > 0;
  }
  /**
   * Connects two points together.
   * @param point
   */
  connectTo(e) {
    if (this._connectionType === e._connectionType)
      throw new Error(`Cannot connect two points of type ${this.connectionType}`);
    if (this._isSingularConnection() && this._connectedPoint.length > 0 || e._isSingularConnection() && e._connectedPoint.length > 0)
      throw new Error("Max number of connections for point reached");
    this._connectedPoint.push(e), e._connectedPoint.push(this);
  }
  /**
   * Saves the connection to a JSON object.
   */
  serialize(e = {}) {
    e.uniqueId = this.uniqueId, e.name = this.name, e._connectionType = this._connectionType, e.connectedPointIds = [], e.className = this.getClassName();
    for (const t of this._connectedPoint)
      e.connectedPointIds.push(t.uniqueId);
  }
  getClassName() {
    return "FGConnection";
  }
  /**
   * Deserialize from a object into this
   * @param serializationObject
   */
  deserialize(e) {
    this.uniqueId = e.uniqueId, this.name = e.name, this._connectionType = e._connectionType, this.connectedPointIds = e.connectedPointIds;
  }
  /**
   * Parses a connection from an object
   * @param serializationObject
   * @param ownerBlock
   * @returns
   */
  static Parse(e = {}, t) {
    const r = ye.Instantiate(e.className), n = new r(e.name, e._connectionType, t);
    return n.deserialize(e), n;
  }
}
class Zl {
  constructor(e, t) {
    this.typeName = e, this.defaultValue = t;
  }
  serialize(e) {
    e.typeName = this.typeName, e.defaultValue = this.defaultValue;
  }
  static Parse(e) {
    return new Zl(e.typeName, e.defaultValue);
  }
}
const w6 = new Zl("any", void 0), pV = new Zl("string", ""), Yt = new Zl("number", 0), m6 = new Zl("boolean", !1), Y9 = new Zl("Vector2", at.Zero()), ma = new Zl("Vector3", S.Zero()), iA = new Zl("Vector4", Ir.Zero()), D1 = new Zl("Matrix", he.Identity()), Cie = new Zl("Color3", Ne.Black()), Oie = new Zl("Color4", new xt(0, 0, 0, 0)), hV = new Zl("Quaternion", Ze.Identity());
function yie(A) {
  switch (typeof A) {
    case "string":
      return pV;
    case "number":
      return Yt;
    case "boolean":
      return m6;
    case "object":
      return A instanceof at ? Y9 : A instanceof S ? ma : A instanceof Ir ? iA : A instanceof Ne ? Cie : A instanceof xt ? Oie : A instanceof Ze ? hV : w6;
    default:
      return w6;
  }
}
class RF extends IF {
  /**
   * Create a new data connection point.
   * @param name
   * @param connectionType
   * @param ownerBlock
   * @param richType
   */
  constructor(e, t, r, n) {
    super(e, t, r), this.richType = n;
  }
  /**
   * An output data block can connect to multiple input data blocks,
   * but an input data block can only connect to one output data block.
   */
  _isSingularConnection() {
    return this.connectionType === f4.Input;
  }
  /**
   * Set the value of the connection in a specific context.
   * @param value the value to set
   * @param context the context to which the value is set
   */
  setValue(e, t) {
    t._setConnectionValue(this, e);
  }
  connectTo(e) {
    super.connectTo(e);
  }
  _getValueOrDefault(e) {
    return e._hasConnectionValue(this) ? e._getConnectionValue(this) : this.richType.defaultValue;
  }
  /**
   * Gets the value of the connection in a specific context.
   * @param context the context from which the value is retrieved
   * @returns the value of the connection
   */
  getValue(e) {
    return this.connectionType === f4.Output ? (e._notifyExecuteNode(this._ownerBlock), this._ownerBlock._updateOutputs(e), this._getValueOrDefault(e)) : this.isConnected() ? this._connectedPoint[0].getValue(e) : this._getValueOrDefault(e);
  }
  getClassName() {
    return "FGDataConnection";
  }
  serialize(e = {}) {
    super.serialize(e), e.richType = {}, this.richType.serialize(e.richType);
  }
  static Parse(e, t) {
    const r = IF.Parse(e, t);
    return r.richType = Zl.Parse(e.richType), r;
  }
}
Ue("FGDataConnection", RF);
class CA {
  /** Constructor is protected so only subclasses can be instantiated */
  constructor(e) {
    this.config = e, this.uniqueId = v4(), this.configure();
  }
  configure() {
    var e, t;
    this.name = (t = (e = this.config) === null || e === void 0 ? void 0 : e.name) !== null && t !== void 0 ? t : this.getClassName(), this.dataInputs = [], this.dataOutputs = [];
  }
  /**
   * @internal
   */
  _updateOutputs(e) {
  }
  registerDataInput(e, t) {
    const r = new RF(e, f4.Input, this, t);
    return this.dataInputs.push(r), r;
  }
  registerDataOutput(e, t) {
    const r = new RF(e, f4.Output, this, t);
    return this.dataOutputs.push(r), r;
  }
  getDataInput(e) {
    return this.dataInputs.find((t) => t.name === e);
  }
  serialize(e = {}) {
    e.uniqueId = this.uniqueId, e.config = {}, this.config && (e.config.name = this.config.name), e.dataInputs = [], e.dataOutputs = [], e.className = this.getClassName();
    for (const t of this.dataInputs) {
      const r = {};
      t.serialize(r), e.dataInputs.push(r);
    }
    for (const t of this.dataOutputs) {
      const r = {};
      t.serialize(r), e.dataOutputs.push(r);
    }
  }
  getClassName() {
    return "FGBlock";
  }
  static Parse(e) {
    const t = ye.Instantiate(e.className), r = {};
    if (e.config)
      for (const i in e.config) {
        const s = e.config[i];
        if (s && s.className) {
          const a = ye.Instantiate(s.className);
          r[i] = a.prototype.Parse(s);
        } else
          r[i] = s;
      }
    const n = new t(r);
    n.uniqueId = e.uniqueId;
    for (let i = 0; i < e.dataInputs.length; i++)
      n.dataInputs[i].deserialize(e.dataInputs[i]);
    for (let i = 0; i < e.dataOutputs.length; i++)
      n.dataOutputs[i].deserialize(e.dataOutputs[i]);
    if (n instanceof og) {
      for (let i = 0; i < e.signalInputs.length; i++)
        n.signalInputs[i].deserialize(e.signalInputs[i]);
      for (let i = 0; i < e.signalOutputs.length; i++)
        n.signalOutputs[i].deserialize(e.signalOutputs[i]);
    }
    return n;
  }
}
class uO extends IF {
  /**
   * A signal input can be connected to more than one signal output,
   * but a signal output can only connect to one signal input
   */
  _isSingularConnection() {
    return this.connectionType === f4.Output;
  }
  /**
   * @internal
   */
  _activateSignal(e) {
    var t;
    this.connectionType === f4.Input ? (e._notifyExecuteNode(this._ownerBlock), this._ownerBlock._execute(e, this), e._increaseExecutionId()) : (t = this._connectedPoint[0]) === null || t === void 0 || t._activateSignal(e);
  }
}
Ue("FlowGraphSignalConnection", uO);
class og extends CA {
  constructor(e) {
    super(e), this.onStart = this._registerSignalInput("onStart");
  }
  configure() {
    super.configure(), this.signalInputs = [], this.signalOutputs = [];
  }
  _registerSignalInput(e) {
    const t = new uO(e, f4.Input, this);
    return this.signalInputs.push(t), t;
  }
  _registerSignalOutput(e) {
    const t = new uO(e, f4.Output, this);
    return this.signalOutputs.push(t), t;
  }
  serialize(e = {}) {
    super.serialize(e), e.signalInputs = [], e.signalOutputs = [];
    for (const t of this.signalInputs) {
      const r = {};
      t.serialize(r), e.signalInputs.push(r);
    }
    for (const t of this.signalOutputs) {
      const r = {};
      t.serialize(r), e.signalOutputs.push(r);
    }
  }
  getClassName() {
    return "FGExecutionBlock";
  }
  static Parse(e = {}) {
    const t = super.Parse(e);
    for (let r = 0; r < e.signalInputs.length; r++)
      t.signalInputs[r].deserialize(e.signalInputs[r]);
    for (let r = 0; r < e.signalOutputs.length; r++)
      t.signalOutputs[r].deserialize(e.signalOutputs[r]);
    return t;
  }
}
class $Y extends og {
  constructor(e) {
    super(e), this.onDone = this._registerSignalOutput("onDone");
  }
  /**
   * @internal
   * @param context
   */
  _startPendingTasks(e) {
    this._preparePendingTasks(e), e._addPendingBlock(this);
  }
}
class HU extends $Y {
  /**
   * @internal
   */
  _execute(e) {
    e._notifyExecuteNode(this), this.onDone._activateSignal(e);
  }
}
function kie(A) {
  return A === "Mesh" || A === "AbstractMesh" || A === "GroundMesh" || A === "InstanceMesh" || A === "LinesMesh" || A === "GoldbergMesh" || A === "GreasedLineMesh" || A === "TrailMesh";
}
function Eie(A) {
  return A === "Vector2" || A === "Vector3" || A === "Vector4" || A === "Quaternion";
}
function kge(A, e) {
  if (A === "Vector2")
    return at.FromArray(e);
  if (A === "Vector3")
    return S.FromArray(e);
  if (A === "Vector4")
    return Ir.FromArray(e);
  if (A === "Quaternion")
    return Ze.FromArray(e);
  throw new Error(`Unknown vector class name ${A}`);
}
function Ege(A, e, t) {
  var r, n;
  const i = (n = (r = e == null ? void 0 : e.getClassName) === null || r === void 0 ? void 0 : r.call(e)) !== null && n !== void 0 ? n : "";
  kie(i) ? t[A] = {
    name: e.name,
    className: i
  } : Eie(i) ? t[A] = {
    value: e.asArray(),
    className: i
  } : t[A] = e;
}
function Fge(A, e, t) {
  const r = e[A];
  let n;
  const i = r == null ? void 0 : r.className;
  return kie(i) ? n = t.getMeshByName(r.name) : Eie(i) ? n = kge(i, r.value) : n = r, n;
}
class lO {
  constructor(e) {
    this.uniqueId = v4(), this._userVariables = {}, this._executionVariables = {}, this._connectionValues = {}, this._pendingBlocks = [], this._executionId = 0, this.onNodeExecutedObservable = new Oe(), this._configuration = e;
  }
  /**
   * Check if a user-defined variable is defined.
   * @param name
   * @returns
   */
  hasVariable(e) {
    return e in this._userVariables;
  }
  /**
   * Set a user-defined variable.
   * @param name
   * @param value
   */
  setVariable(e, t) {
    this._userVariables[e] = t;
  }
  /**
   * Get a user-defined variable.
   * @param name
   * @returns
   */
  getVariable(e) {
    return this._userVariables[e];
  }
  _getUniqueIdPrefixedName(e, t) {
    return `${e.uniqueId}_${t}`;
  }
  /**
   * Set an internal execution variable
   * @internal
   * @param name
   * @param value
   */
  _setExecutionVariable(e, t, r) {
    this._executionVariables[this._getUniqueIdPrefixedName(e, t)] = r;
  }
  /**
   * Get an internal execution variable
   * @internal
   * @param name
   * @returns
   */
  _getExecutionVariable(e, t, r) {
    return this._hasExecutionVariable(e, t) ? this._executionVariables[this._getUniqueIdPrefixedName(e, t)] : r;
  }
  /**
   * Delete an internal execution variable
   * @internal
   * @param block
   * @param name
   */
  _deleteExecutionVariable(e, t) {
    delete this._executionVariables[this._getUniqueIdPrefixedName(e, t)];
  }
  /**
   * Check if an internal execution variable is defined
   * @internal
   * @param block
   * @param name
   * @returns
   */
  _hasExecutionVariable(e, t) {
    return this._getUniqueIdPrefixedName(e, t) in this._executionVariables;
  }
  /**
   * Check if a connection value is defined
   * @internal
   * @param connectionPoint
   * @returns
   */
  _hasConnectionValue(e) {
    return e.uniqueId in this._connectionValues;
  }
  /**
   * Set a connection value
   * @internal
   * @param connectionPoint
   * @param value
   */
  _setConnectionValue(e, t) {
    this._connectionValues[e.uniqueId] = t;
  }
  /**
   * Get a connection value
   * @internal
   * @param connectionPoint
   * @returns
   */
  _getConnectionValue(e) {
    return this._connectionValues[e.uniqueId];
  }
  /**
   * Get the configuration
   * @internal
   * @param name
   * @param value
   */
  get configuration() {
    return this._configuration;
  }
  /**
   * Add a block to the list of blocks that have pending tasks.
   * @internal
   * @param block
   */
  _addPendingBlock(e) {
    this._pendingBlocks.push(e);
  }
  /**
   * Remove a block from the list of blocks that have pending tasks.
   * @internal
   * @param block
   */
  _removePendingBlock(e) {
    const t = this._pendingBlocks.indexOf(e);
    t !== -1 && this._pendingBlocks.splice(t, 1);
  }
  /**
   * Clear all pending blocks.
   * @internal
   */
  _clearPendingBlocks() {
    for (const e of this._pendingBlocks)
      e._cancelPendingTasks(this);
    this._pendingBlocks.length = 0;
  }
  /**
   * @internal
   * Function that notifies the node executed observable
   * @param node
   */
  _notifyExecuteNode(e) {
    this.onNodeExecutedObservable.notifyObservers(e);
  }
  /**
   * @internal
   */
  _increaseExecutionId() {
    this._executionId++;
  }
  /**
   * A monotonically increasing ID for each execution.
   * Incremented for every block executed.
   */
  get executionId() {
    return this._executionId;
  }
  /**
   * Serializes a context
   * @param serializationObject the object to write the values in
   * @param valueSerializationFunction a function to serialize complex values
   */
  serialize(e = {}, t = Ege) {
    e.uniqueId = this.uniqueId, e._userVariables = {};
    for (const r in this._userVariables)
      t(r, this._userVariables[r], e._userVariables);
    e._connectionValues = {};
    for (const r in this._connectionValues)
      t(r, this._connectionValues[r], e._connectionValues);
  }
  getClassName() {
    return "FGContext";
  }
  /**
   * Parses a context
   * @param serializationObject the object containing the context serialization values
   * @param graph the graph to which the context should belong
   * @param valueParseFunction a function to parse complex values
   * @returns
   */
  static Parse(e = {}, t, r = Fge) {
    const n = t.createContext();
    n.uniqueId = e.uniqueId;
    for (const i in e._userVariables) {
      const s = r(i, e._userVariables, n._configuration.scene);
      n._userVariables[i] = s;
    }
    for (const i in e._connectionValues) {
      const s = r(i, e._connectionValues, n._configuration.scene);
      n._connectionValues[i] = s;
    }
    return n;
  }
}
C([
  M()
], lO.prototype, "uniqueId", void 0);
function eM(A, e) {
  return !!(A.parent && (A.parent === e || eM(A.parent, e)));
}
class bm extends HU {
  constructor(e) {
    e.path.hasTemplateStrings && ye.Warn("Template strings are not supported in the path of mesh pick event blocks."), super(e), this.config = e;
  }
  _getReferencedMesh(e) {
    return this.config.path.getProperty(e);
  }
  /**
   * @internal
   */
  _preparePendingTasks(e) {
    let t = e._getExecutionVariable(this, "meshPickObserver");
    if (!t) {
      const r = this.config.path.getProperty(e);
      if (!r || !(r instanceof jn))
        throw new Error("Mesh pick event block requires a valid mesh");
      e._setExecutionVariable(this, "mesh", r), t = r.getScene().onPointerObservable.add((i) => {
        var s, a, f;
        i.type === ir.POINTERPICK && (!((s = i.pickInfo) === null || s === void 0) && s.pickedMesh) && (((a = i.pickInfo) === null || a === void 0 ? void 0 : a.pickedMesh) === r || eM((f = i.pickInfo) === null || f === void 0 ? void 0 : f.pickedMesh, r)) && this._execute(e);
      });
      const n = r.onDisposeObservable.add(() => this._onDispose);
      e._setExecutionVariable(this, "meshPickObserver", t), e._setExecutionVariable(this, "meshDisposeObserver", n);
    }
  }
  _onDispose(e) {
    this._cancelPendingTasks(e), e._removePendingBlock(this);
  }
  /**
   * @internal
   */
  _cancelPendingTasks(e) {
    const t = e._getExecutionVariable(this, "mesh"), r = e._getExecutionVariable(this, "meshPickObserver"), n = e._getExecutionVariable(this, "meshDisposeObserver");
    t.getScene().onPointerObservable.remove(r), t.onDisposeObservable.remove(n), e._deleteExecutionVariable(this, "mesh"), e._deleteExecutionVariable(this, "meshPickObserver"), e._deleteExecutionVariable(this, "meshDisposeObserver");
  }
  getClassName() {
    return bm.ClassName;
  }
  serialize(e) {
    super.serialize(e), e.config.path = this.config.path.serialize();
  }
}
bm.ClassName = "FGMeshPickEventBlock";
Ue(bm.ClassName, bm);
var $x;
(function(A) {
  A[A.Stopped = 0] = "Stopped", A[A.Started = 1] = "Started";
})($x || ($x = {}));
class JS {
  /**
   * Construct a Flow Graph
   * @param params construction parameters. currently only the scene
   */
  constructor(e) {
    this._eventBlocks = [], this._executionContexts = [], this.state = $x.Stopped, this._scene = e.scene, this._coordinator = e.coordinator, this._sceneDisposeObserver = this._scene.onDisposeObservable.add(() => this.dispose());
  }
  /**
   * Create a context. A context represents one self contained execution for the graph, with its own variables.
   * @returns the context, where you can get and set variables
   */
  createContext() {
    const e = new lO({ scene: this._scene, coordinator: this._coordinator });
    return this._executionContexts.push(e), e;
  }
  /**
   * Add an event block. When the graph is started, it will start listening to events
   * from the block and execute the graph when they are triggered.
   * @param block
   */
  addEventBlock(e) {
    this._eventBlocks.push(e);
  }
  /**
   * Starts the flow graph. Initializes the event blocks and starts listening to events.
   */
  start() {
    if (this.state !== $x.Started) {
      this.state = $x.Started, this._executionContexts.length === 0 && this.createContext();
      for (const e of this._executionContexts) {
        const t = this._getContextualOrder(e);
        for (const r of t)
          r._startPendingTasks(e);
      }
    }
  }
  _getContextualOrder(e) {
    const t = [];
    for (const r of this._eventBlocks)
      if (r.getClassName() === bm.ClassName) {
        const n = r._getReferencedMesh(e);
        let i = 0;
        for (; i < t.length; i++) {
          const a = t[i]._getReferencedMesh(e);
          if (n && a && eM(n, a))
            break;
        }
        t.splice(i, 0, r);
      } else
        t.push(r);
    return t;
  }
  /**
   * Disposes of the flow graph. Cancels any pending tasks and removes all event listeners.
   */
  dispose() {
    if (this.state !== $x.Stopped) {
      this.state = $x.Stopped;
      for (const e of this._executionContexts)
        e._clearPendingBlocks();
      this._executionContexts.length = 0, this._eventBlocks.length = 0, this._scene.onDisposeObservable.remove(this._sceneDisposeObserver), this._sceneDisposeObserver = null;
    }
  }
  /**
   * Executes a function in all blocks of a flow graph, starting with the event blocks.
   * @param visitor the function to execute.
   */
  visitAllBlocks(e) {
    const t = [], r = /* @__PURE__ */ new Set();
    for (const n of this._eventBlocks)
      t.push(n), r.add(n.uniqueId);
    for (; t.length > 0; ) {
      const n = t.pop();
      e(n);
      for (const i of n.dataInputs)
        for (const s of i._connectedPoint)
          r.has(s._ownerBlock.uniqueId) || (t.push(s._ownerBlock), r.add(s._ownerBlock.uniqueId));
      if (n instanceof og)
        for (const i of n.signalOutputs)
          for (const s of i._connectedPoint)
            r.has(s._ownerBlock.uniqueId) || (t.push(s._ownerBlock), r.add(s._ownerBlock.uniqueId));
    }
  }
  /**
   * Serializes a graph
   * @param serializationObject the object to write the values in
   * @param valueSerializeFunction a function to serialize complex values
   */
  serialize(e = {}, t) {
    e.variableDefinitions = {}, e.allBlocks = [], this.visitAllBlocks((r) => {
      const n = {};
      r.serialize(n), e.allBlocks.push(n);
    }), e.executionContexts = [];
    for (const r of this._executionContexts) {
      const n = {};
      r.serialize(n, t), e.executionContexts.push(n);
    }
  }
  /**
   * Given a list of blocks, find an output data connection that has a specific unique id
   * @param blocks
   * @param uniqueId
   * @returns
   */
  static GetDataOutConnectionByUniqueId(e, t) {
    for (const r of e)
      for (const n of r.dataOutputs)
        if (n.uniqueId === t)
          return n;
    throw new Error("Could not find data out connection with unique id " + t);
  }
  /**
   * Given a list of blocks, find an input signal connection that has a specific unique id
   * @param blocks
   * @param uniqueId
   * @returns
   */
  static GetSignalInConnectionByUniqueId(e, t) {
    for (const r of e)
      if (r instanceof og) {
        for (const n of r.signalInputs)
          if (n.uniqueId === t)
            return n;
      }
    throw new Error("Could not find signal in connection with unique id " + t);
  }
  /**
   * Parses a graph from a given serialization object
   * @param serializationObject the object where the values are written
   * @param coordinator the flow graph coordinator
   * @param valueParseFunction a function to parse complex values in a scene
   * @returns
   */
  static Parse(e, t, r) {
    const n = t.createGraph(), i = [];
    for (const s of e.allBlocks) {
      const a = CA.Parse(s);
      i.push(a), a instanceof HU && n.addEventBlock(a);
    }
    for (const s of i) {
      for (const a of s.dataInputs)
        for (const f of a.connectedPointIds) {
          const o = JS.GetDataOutConnectionByUniqueId(i, f);
          a.connectTo(o);
        }
      if (s instanceof og)
        for (const a of s.signalOutputs)
          for (const f of a.connectedPointIds) {
            const o = JS.GetSignalInConnectionByUniqueId(i, f);
            a.connectTo(o);
          }
    }
    for (const s of e.executionContexts)
      lO.Parse(s, n, r);
    return n;
  }
}
class Nge {
}
class TS {
  constructor(e) {
    var t;
    this._config = e, this._flowGraphs = [], this._customEventsMap = /* @__PURE__ */ new Map(), this._config.scene.onDisposeObservable.add(() => {
      this.dispose();
    }), ((t = TS.SceneCoordinators.get(this._config.scene)) !== null && t !== void 0 ? t : []).push(this);
  }
  /**
   * Creates a new flow graph and adds it to the list of existing flow graphs
   * @returns a new flow graph
   */
  createGraph() {
    const e = new JS({ scene: this._config.scene, coordinator: this });
    return this._flowGraphs.push(e), e;
  }
  /**
   * Removes a flow graph from the list of existing flow graphs and disposes it
   * @param graph the graph to remove
   */
  removeGraph(e) {
    const t = this._flowGraphs.indexOf(e);
    t !== -1 && (e.dispose(), this._flowGraphs.splice(t, 1));
  }
  /**
   * Starts all graphs
   */
  start() {
    this._flowGraphs.forEach((e) => e.start());
  }
  /**
   * Disposes all graphs
   */
  dispose() {
    var e;
    this._flowGraphs.forEach((n) => n.dispose()), this._flowGraphs.length = 0;
    const t = (e = TS.SceneCoordinators.get(this._config.scene)) !== null && e !== void 0 ? e : [], r = t.indexOf(this);
    r !== -1 && t.splice(r, 1);
  }
  serialize(e, t) {
    e._flowGraphs = [], this._flowGraphs.forEach((r) => {
      const n = {};
      r.serialize(n, t), e._flowGraphs.push(n);
    });
  }
  static Parse(e, t, r) {
    var n;
    const i = new TS({ scene: t });
    return (n = e._flowGraphs) === null || n === void 0 || n.forEach((s) => {
      JS.Parse(s, i, r);
    }), i;
  }
  /**
   * Get an observable that will be notified when the event with the given id is fired.
   * @param id the id of the event
   * @returns the observable for the event
   */
  getCustomEventObservable(e) {
    let t = this._customEventsMap.get(e);
    return t || (t = new Oe(), this._customEventsMap.set(e, t)), t;
  }
  /**
   * Notifies the observable for the given event id with the given data.
   * @param id the id of the event
   * @param data the data to send with the event
   */
  notifyCustomEvent(e, t) {
    const r = this._customEventsMap.get(e);
    r && r.notifyObservers(t);
  }
}
TS.SceneCoordinators = /* @__PURE__ */ new Map();
class Qge {
  constructor(e) {
    this._context = e, this._context.onNodeExecutedObservable.add((t) => {
      ye.Log(`Node executed: ${t.getClassName()}`);
    });
  }
}
const Yge = /([./])({?\w+}?)/g;
class Cy {
  constructor(e) {
    this._templateSubstitutions = {}, this._pathParts = [], this._templateStrings = [], this.hasTemplateStrings = !1, this._path = e;
    const { pathParts: t, templateStrings: r } = this._getPathPartsAndTemplateStrings(e);
    this._pathParts = t, this._templateStrings = r, this.hasTemplateStrings = r.length > 0;
  }
  _getPathPartsAndTemplateStrings(e) {
    const t = e.matchAll(Yge), r = [], n = [];
    let i = t.next();
    for (; !i.done; ) {
      const s = i.value, [, a, f] = s;
      let o = f, d = !1;
      f.startsWith("{") && f.endsWith("}") && (d = !0, o = f.slice(1, f.length - 1), n.indexOf(o) === -1 && n.push(o)), r.push({
        value: f,
        isTemplate: d,
        valueWithoutBraces: o,
        separator: a
      }), i = t.next();
    }
    return { pathParts: r, templateStrings: n };
  }
  /**
   * Gets the template strings in this path.
   * @returns an array containing the template strings in this path.
   */
  getTemplateStrings() {
    return this._templateStrings;
  }
  setTemplateSubstitution(e, t) {
    if (this._templateStrings.indexOf(e) === -1)
      throw new Error(`Template string ${e} does not exist in path ${this._path}`);
    this._templateSubstitutions[e] = t;
  }
  _evaluateTemplates() {
    for (const e of this._pathParts)
      if (e.isTemplate) {
        const t = this._templateSubstitutions[e.valueWithoutBraces];
        if (t === void 0)
          throw new Error(`Template string ${e.value} was not substituted`);
        e.replacedValue = t.toString();
      }
  }
  _getFinalPath() {
    let e = "";
    for (const t of this._pathParts)
      e += t.separator, t.isTemplate ? e += t.replacedValue : e += t.value;
    return e;
  }
  /*
   * Breaks the path into a chain of entities, for example,
   * /x/y/z would be split into [context._userVariables.x, context._userVariables.x.y, context._userVariables.x.y.z],
   * and the path that was split, i.e. /x/y/z, would be split into ["x", "y", "z"].
   */
  _evaluatePath(e) {
    this._evaluateTemplates();
    const t = [], r = [];
    let n = e._userVariables;
    for (const i of this._pathParts) {
      if (n === void 0)
        throw new Error(`Could not find path ${this._getFinalPath()} in target context`);
      const s = i.isTemplate ? i.replacedValue : i.value;
      if (!s)
        throw new Error(`Invalid path ${this._getFinalPath()}`);
      n = n[s], t.push(n), r.push(s);
    }
    return { entityChain: t, splitPath: r };
  }
  getProperty(e) {
    const { entityChain: t } = this._evaluatePath(e);
    return t[t.length - 1];
  }
  setProperty(e, t) {
    const { entityChain: r, splitPath: n } = this._evaluatePath(e), i = r[r.length - 2], s = n[n.length - 1];
    i[s] = t;
  }
  getClassName() {
    return "FGPath";
  }
  serialize(e = {}) {
    return e.path = this._path, e.className = this.getClassName(), e;
  }
  Parse(e) {
    return new Cy(e.path);
  }
}
Ue("FGPath", Cy);
class _l extends og {
  constructor(e) {
    super(e), this.onDone = this._registerSignalOutput("onDone");
  }
}
class Fie extends _l {
  constructor(e) {
    super(e), this.message = this.registerDataInput("message", w6);
  }
  /**
   * @internal
   */
  _execute(e) {
    const t = this.message.getValue(e);
    console.log(t), this.onDone._activateSignal(e);
  }
  getClassName() {
    return "FGLogBlock";
  }
}
Ue("FGLogBlock", Fie);
class Nie extends _l {
  constructor(e) {
    super(e), this.variableName = this.registerDataInput("variableName", pV), this.input = this.registerDataInput("input", w6);
  }
  _execute(e) {
    const t = this.variableName.getValue(e), r = this.input.getValue(e);
    e.setVariable(t, r), this.onDone._activateSignal(e);
  }
  getClassName() {
    return "FGSetVariableBlock";
  }
}
Ue("FGSetVariableBlock", Nie);
class VF {
  constructor(e, t) {
    this.templateStringInputs = [], this.path = e, this.ownerBlock = t;
    for (const r of e.getTemplateStrings())
      this.templateStringInputs.push(this.ownerBlock.registerDataInput(r, Yt));
  }
  /**
   * Get the inputs of all of the numeric data inputs and use them to fill in the
   * template strings in the path.
   * @param context the context to use to get the values of the numeric data inputs
   * @returns the path with the template strings filled in
   */
  substitutePath(e) {
    for (const t of this.templateStringInputs) {
      const r = t.getValue(e), n = t.name;
      this.path.setTemplateSubstitution(n, r);
    }
    return this.path;
  }
  /**
   * Substitutes the template strings in the path and gets the property on the target object.
   * @param context
   * @returns
   */
  getProperty(e) {
    return this.substitutePath(e), this.path.getProperty(e);
  }
  /**
   * Substitutes the template strings in the path and sets the property on the target object.
   * @param context
   * @param value
   */
  setProperty(e, t) {
    this.substitutePath(e), this.path.setProperty(e, t);
  }
}
class Qie extends _l {
  constructor(e) {
    super(e), this.config = e, this.value = this.registerDataInput("value", w6), this.templateComponent = new VF(e.path, this);
  }
  _execute(e) {
    const t = this.value.getValue(e);
    this.templateComponent.setProperty(e, t), this.onDone._activateSignal(e);
  }
  serialize(e = {}) {
    super.serialize(e), e.config.path = this.config.path.serialize();
  }
  getClassName() {
    return "FGSetPropertyBlock";
  }
}
Ue("FGSetPropertyBlock", Qie);
class Yie extends _l {
  constructor(e) {
    super(e), this.eventId = this.registerDataInput("eventId", pV), this.eventData = this.registerDataInput("eventData", w6);
  }
  _execute(e) {
    const t = this.eventId.getValue(e), r = this.eventData.getValue(e);
    e.configuration.coordinator.notifyCustomEvent(t, r), this.onDone._activateSignal(e);
  }
  getClassName() {
    return "FGSendCustomEventBlock";
  }
}
Ue("FGSendCustomEventBlock", Yie);
class Mie extends og {
  constructor(e) {
    super(e), this.condition = this.registerDataInput("condition", m6), this.onTrue = this._registerSignalOutput("onTrue"), this.onFalse = this._registerSignalOutput("onFalse");
  }
  _execute(e) {
    this.condition.getValue(e) ? this.onTrue._activateSignal(e) : this.onFalse._activateSignal(e);
  }
  getClassName() {
    return "FGBranchBlock";
  }
}
Ue("FGBranchBlock", Mie);
class Lie extends _l {
  constructor(e) {
    super(e), this.reset = this._registerSignalInput("reset"), this.maxNumberOfExecutions = this.registerDataInput("numberOfExecutions", Yt), this.currentCount = this.registerDataOutput("currentCount", Yt);
  }
  _execute(e, t) {
    if (t === this.reset)
      this.currentCount.setValue(0, e);
    else {
      const r = this.currentCount.getValue(e);
      r < this.maxNumberOfExecutions.getValue(e) && (this.currentCount.setValue(r + 1, e), this.onDone._activateSignal(e));
    }
  }
  getClassName() {
    return "FGDoNBlock";
  }
}
Ue("FGDoNBlock", Lie);
class Kie extends _l {
  constructor(e) {
    super(e), this.startIndex = this.registerDataInput("startIndex", Yt), this.endIndex = this.registerDataInput("endIndex", Yt), this.step = this.registerDataInput("step", Yt), this.index = this.registerDataOutput("index", Yt), this.onLoop = this._registerSignalOutput("onLoop"), this.onDone = this._registerSignalOutput("onDone");
  }
  _executeLoop(e) {
    let t = e._getExecutionVariable(this, "index");
    const r = e._getExecutionVariable(this, "endIndex");
    if (t < r) {
      this.index.setValue(t, e), this.onLoop._activateSignal(e);
      const n = e._getExecutionVariable(this, "step", 1);
      t += n, e._setExecutionVariable(this, "index", t), this._executeLoop(e);
    } else
      this.onDone._activateSignal(e);
  }
  /**
   * @internal
   */
  _execute(e) {
    const t = this.startIndex.getValue(e), r = this.endIndex.getValue(e), n = this.step.getValue(e);
    e._setExecutionVariable(this, "index", t), e._setExecutionVariable(this, "endIndex", r), e._setExecutionVariable(this, "step", n), this._executeLoop(e);
  }
  getClassName() {
    return "FGForLoopBlock";
  }
}
Ue("FGForLoopBlock", Kie);
class Jie extends _l {
  constructor(e) {
    super(e), this.reset = this._registerSignalInput("reset"), this.duration = this.registerDataInput("duration", Yt), this.timeRemaining = this.registerDataOutput("timeRemaining", Yt);
  }
  _execute(e, t) {
    const r = e._getExecutionVariable(this, "lastExecutedTime"), n = this.duration.getValue(e), i = Date.now();
    if (t === this.reset || r === void 0 || i - r > n)
      this.timeRemaining.setValue(0, e), this.onDone._activateSignal(e), e._setExecutionVariable(this, "lastExecutedTime", i);
    else {
      const s = n - (i - r);
      this.timeRemaining.setValue(s, e);
    }
  }
  getClassName() {
    return "FGThrottleBlock";
  }
}
Ue("FGThrottleBlock", Jie);
class zie extends $Y {
  constructor(e) {
    super(e), this.timeout = this.registerDataInput("timeout", Yt), this.onTimerDone = this._registerSignalOutput("onTimerDone");
  }
  _preparePendingTasks(e) {
    const t = this.timeout.getValue(e);
    if (t !== void 0 && t >= 0) {
      const r = e._getExecutionVariable(this, "runningTimers") || [], n = e.configuration.scene, i = new kte({
        timeout: t,
        contextObservable: n.onBeforeRenderObservable,
        onEnded: () => this._onEnded(i, e)
      });
      i.start(), r.push(i), e._setExecutionVariable(this, "runningTimers", r);
    }
  }
  /**
   * @internal
   */
  _execute(e) {
    this._startPendingTasks(e), this.onDone._activateSignal(e);
  }
  _onEnded(e, t) {
    const r = t._getExecutionVariable(this, "runningTimers") || [], n = r.indexOf(e);
    n !== -1 ? r.splice(n, 1) : ye.Warn("FlowGraphTimerBlock: Timer ended but was not found in the running timers list"), t._removePendingBlock(this), this.onTimerDone._activateSignal(t);
  }
  _cancelPendingTasks(e) {
    const t = e._getExecutionVariable(this, "runningTimers") || [];
    for (const r of t)
      r.dispose();
    e._deleteExecutionVariable(this, "runningTimers");
  }
  getClassName() {
    return "FGTimerBlock";
  }
}
Ue("FGTimerBlock", zie);
class Gie extends og {
  constructor(e) {
    super(e), this.config = e, this._cachedUnusedIndexes = [], this.reset = this._registerSignalInput("reset"), this.currentIndex = this.registerDataOutput("currentIndex", Yt);
  }
  configure() {
    super.configure(), this.config.startIndex = this.config.startIndex !== void 0 ? this.config.startIndex : 0, this.config.startIndex = Math.max(0, Math.min(this.config.startIndex, this.config.numberOutputFlows - 1)), this.outFlows = [];
    for (let e = 0; e < this.config.numberOutputFlows; e++)
      this.outFlows.push(this._registerSignalOutput(`out${e}`));
  }
  _getUnusedIndexes(e) {
    const t = this._cachedUnusedIndexes;
    if (t.length = 0, e._hasExecutionVariable(this, "unusedIndexes")) {
      const r = e._getExecutionVariable(this, "unusedIndexes");
      for (let n = 0; n < r.length; n++)
        t.push(r[n]);
    } else
      for (let r = 0; r < this.config.numberOutputFlows; r++)
        t.push(r);
    return t;
  }
  _getNextOutput(e, t) {
    if (this.config.isRandom) {
      const r = Math.floor(Math.random() * t.length);
      return t[r];
    } else
      return e + 1;
  }
  _execute(e, t) {
    var r;
    const n = (r = e._getExecutionVariable(this, "currentIndex")) !== null && r !== void 0 ? r : this.config.startIndex - 1;
    let i = this._getUnusedIndexes(e);
    if (t === this.reset) {
      e._deleteExecutionVariable(this, "currentIndex"), e._deleteExecutionVariable(this, "unusedIndexes");
      return;
    }
    let s = this._getNextOutput(n, i);
    if (s >= this.config.numberOutputFlows && this.config.loop)
      s = 0;
    else if (s >= this.config.numberOutputFlows && !this.config.loop)
      return;
    if (i = i.filter((a) => a !== s), i.length === 0)
      for (let a = 0; a < this.config.numberOutputFlows; a++)
        i.push(a);
    e._setExecutionVariable(this, "unusedIndexes", i), e._setExecutionVariable(this, "currentIndex", s), this.currentIndex.setValue(s, e), this.outFlows[s]._activateSignal(e);
  }
  getClassName() {
    return "FGMultiGateBlock";
  }
  serialize(e) {
    super.serialize(e), e.config.numberOutputFlows = this.config.numberOutputFlows, e.config.isRandom = this.config.isRandom, e.config.loop = this.config.loop, e.config.startIndex = this.config.startIndex;
  }
}
Ue("FGMultiGateBlock", Gie);
class Zie extends og {
  constructor(e) {
    super(e), this.config = e, this.selection = this.registerDataInput("selection", w6);
  }
  configure() {
    super.configure(), this.outputFlows = [];
    for (let e = 0; e <= this.config.cases.length; e++)
      this.outputFlows.push(this._registerSignalOutput(`out${e}`));
  }
  _execute(e, t) {
    const r = this.selection.getValue(e);
    for (let n = 0; n < this.config.cases.length; n++)
      if (r === this.config.cases[n]) {
        this.outputFlows[n]._activateSignal(e);
        return;
      }
    this.outputFlows[this.outputFlows.length - 1]._activateSignal(e);
  }
  getClassName() {
    return "FGSwitchBlock";
  }
  serialize(e) {
    super.serialize(e), e.cases = this.config.cases;
  }
}
Ue("FGSwitchBlock", Zie);
class _ie extends _l {
  constructor(e) {
    super(e), this.config = e, this.inFlows = [], this._cachedActivationState = [], this.reset = this._registerSignalInput("reset");
  }
  configure() {
    for (let e = 1; e < this.config.numberInputFlows; e++)
      this.inFlows.push(this._registerSignalInput(`in${e}`));
  }
  _getCurrentActivationState(e) {
    const t = this._cachedActivationState;
    if (t.length = 0, e._hasExecutionVariable(this, "activationState")) {
      const r = e._getExecutionVariable(this, "activationState");
      for (let n = 0; n < r.length; n++)
        t.push(r[n]);
    } else
      for (let r = 0; r < this.config.numberInputFlows; r++)
        t.push(!1);
    return t;
  }
  _execute(e, t) {
    const r = this._getCurrentActivationState(e);
    if (t === this.reset)
      for (let n = 0; n < this.config.numberInputFlows; n++)
        r[n] = !1;
    else if (t === this.onStart)
      r[0] = !0;
    else {
      const n = this.inFlows.indexOf(t);
      n >= 0 && (r[n + 1] = !0);
    }
    if (e._setExecutionVariable(this, "activationState", r.slice()), r.every((n) => n)) {
      this.onDone._activateSignal(e);
      for (let n = 0; n < this.config.numberInputFlows; n++)
        r[n] = !1;
    }
  }
  getClassName() {
    return "FGWaitAllBlock";
  }
  serialize(e) {
    super.serialize(e), e.config.numberInputFlows = this.config.numberInputFlows;
  }
}
Ue("FGWaitAllBlock", _ie);
class $ie extends _l {
  constructor(e) {
    super(e), this.count = this.registerDataOutput("count", Yt), this.reset = this._registerSignalInput("reset");
  }
  _execute(e, t) {
    var r;
    if (t === this.reset) {
      e._setExecutionVariable(this, "count", 0), this.count.setValue(0, e);
      return;
    }
    const n = ((r = e._getExecutionVariable(this, "count")) !== null && r !== void 0 ? r : 0) + 1;
    e._setExecutionVariable(this, "count", n), this.count.setValue(n, e), this.onDone._activateSignal(e);
  }
  getClassName() {
    return "FGCounterBlock";
  }
}
Ue("FGCounterBlock", $ie);
class ese extends _l {
  constructor(e) {
    super(e), this.config = e, this.condition = this.registerDataInput("condition", m6), this.loopBody = this._registerSignalOutput("loopBody");
  }
  _execute(e, t) {
    var r;
    let n = this.condition.getValue(e);
    for (!((r = this.config) === null || r === void 0) && r.isDo && !n && this.loopBody._activateSignal(e); n; )
      this.loopBody._activateSignal(e), n = this.condition.getValue(e);
    this.onDone._activateSignal(e);
  }
  getClassName() {
    return "FGWhileLoopBlock";
  }
  serialize(e) {
    var t;
    super.serialize(e), e.isDo = (t = this.config) === null || t === void 0 ? void 0 : t.isDo;
  }
}
Ue("FGWhileLoopBlock", ese);
class tse extends _l {
  constructor(e) {
    super(e), this.count = this.registerDataInput("count", Yt), this.reset = this._registerSignalInput("reset"), this.currentCount = this.registerDataOutput("currentCount", Yt);
  }
  _execute(e, t) {
    if (t === this.reset) {
      e._setExecutionVariable(this, "debounceCount", 0);
      return;
    }
    const r = this.count.getValue(e), i = e._getExecutionVariable(this, "debounceCount", 0) + 1;
    this.currentCount.setValue(i, e), e._setExecutionVariable(this, "debounceCount", i), i >= r && (this.onDone._activateSignal(e), e._setExecutionVariable(this, "debounceCount", 0));
  }
  getClassName() {
    return "FGDebounceBlock";
  }
}
Ue("FGDebounceBlock", tse);
class rse extends og {
  constructor(e) {
    super(e), this.onOn = this._registerSignalOutput("onOn"), this.onOff = this._registerSignalOutput("onOff"), this.isOn = this.registerDataOutput("isOn", m6);
  }
  _execute(e, t) {
    let r = e._getExecutionVariable(this, "value", !1);
    r = !r, e._setExecutionVariable(this, "value", r), this.isOn.setValue(r, e), r ? this.onOn._activateSignal(e) : this.onOff._activateSignal(e);
  }
  getClassName() {
    return "FGFlipFlopBlock";
  }
}
Ue("FGFlipFlopBlock", rse);
class nse extends $Y {
  constructor(e) {
    super(e), this.config = e, this.templateTargetComponent = new VF(e.targetPath, this), this.templateAnimationComponent = new VF(e.animationPath, this), this.speed = this.registerDataInput("speed", Yt), this.loop = this.registerDataInput("loop", m6), this.from = this.registerDataInput("from", Yt), this.to = this.registerDataInput("to", Yt), this.onAnimationEnd = this._registerSignalOutput("onAnimationEnd"), this.runningAnimatable = this.registerDataOutput("runningAnimatable", w6);
  }
  /**
   * @internal
   * @param context
   */
  _preparePendingTasks(e) {
    var t;
    const r = this.templateTargetComponent.getProperty(e), n = this.templateAnimationComponent.getProperty(e);
    if (!r || !n)
      throw new Error("Cannot play animation without target or animation");
    const i = (t = e._getExecutionVariable(this, "runningAnimatables")) !== null && t !== void 0 ? t : [], s = this.runningAnimatable.getValue(e);
    if (s && s.paused)
      s.restart();
    else {
      const f = e.configuration.scene.beginDirectAnimation(r, [n], this.from.getValue(e), this.to.getValue(e), this.loop.getValue(e), this.speed.getValue(e), () => this._onAnimationEnd(f, e));
      this.runningAnimatable.setValue(f, e), i.push(f);
    }
    e._setExecutionVariable(this, "runningAnimatables", i);
  }
  _execute(e) {
    this._startPendingTasks(e), this.onDone._activateSignal(e);
  }
  _onAnimationEnd(e, t) {
    var r;
    const n = (r = t._getExecutionVariable(this, "runningAnimatables")) !== null && r !== void 0 ? r : [], i = n.indexOf(e);
    i !== -1 && n.splice(i, 1), t._removePendingBlock(this), this.onAnimationEnd._activateSignal(t);
  }
  /**
   * @internal
   * Stop any currently running animations.
   */
  _cancelPendingTasks(e) {
    var t;
    const r = (t = e._getExecutionVariable(this, "runningAnimatables")) !== null && t !== void 0 ? t : [];
    for (const n of r)
      n.stop();
    e._deleteExecutionVariable(this, "runningAnimatables");
  }
  getClassName() {
    return "FGPlayAnimationBlock";
  }
  serialize(e = {}) {
    super.serialize(e), e.config.targetPath = this.config.targetPath.serialize(), e.config.animationPath = this.config.animationPath.serialize();
  }
}
Ue("FGPlayAnimationBlock", nse);
class ise extends _l {
  constructor(e) {
    super(e), this.animationToStop = this.registerDataInput("animationToStop", w6);
  }
  _execute(e) {
    this.animationToStop.getValue(e).stop(), this.onDone._activateSignal(e);
  }
  getClassName() {
    return "FGStopAnimationBlock";
  }
}
Ue("FGStopAnimationBlock", ise);
class sse extends _l {
  constructor(e) {
    super(e), this.animationToPause = this.registerDataInput("animationToPause", w6);
  }
  _execute(e) {
    this.animationToPause.getValue(e).pause(), this.onDone._activateSignal(e);
  }
  getClassName() {
    return "FGPauseAnimationBlock";
  }
}
Ue("FGPauseAnimationBlock", sse);
class ase extends _l {
  constructor(e) {
    super(e), this.audio = this.registerDataInput("audio", w6);
  }
  _execute(e, t) {
    const r = this.audio.getValue(e);
    r instanceof qc && r.play(), this.onDone._activateSignal(e);
  }
  getClassName() {
    return "FGPlayAudioBlock";
  }
}
Ue("FGPlayAudioBlock", ase);
class ose extends _l {
  constructor(e) {
    super(e), this.audio = this.registerDataInput("audio", w6);
  }
  _execute(e, t) {
    const r = this.audio.getValue(e);
    r instanceof qc && r.stop();
  }
  getClassName() {
    return "FGStopAudioBlock";
  }
}
Ue("FGStopAudioBlock", ose);
class fse extends CA {
  constructor(e) {
    super(e), this.condition = this.registerDataInput("condition", m6), this.trueValue = this.registerDataInput("trueValue", w6), this.falseValue = this.registerDataInput("falseValue", w6), this.output = this.registerDataOutput("output", w6);
  }
  /**
   * @internal
   */
  _updateOutputs(e) {
    this.output.setValue(this.condition.getValue(e) ? this.trueValue.getValue(e) : this.falseValue.getValue(e), e);
  }
  getClassName() {
    return "FGConditionalDataBlock";
  }
}
Ue("FGConditionalDataBlock", fse);
class Ase extends CA {
  /**
   * Construct a FlowGraphGetVariableBlock.
   * @param params optional construction parameters
   */
  constructor(e) {
    super(e), this.variableName = this.registerDataInput("variableName", pV), this.output = this.registerDataOutput("output", w6);
  }
  /**
   * @internal
   */
  _updateOutputs(e) {
    const t = this.variableName.getValue(e);
    e.hasVariable(t) && this.output.setValue(e.getVariable(t), e);
  }
  getClassName() {
    return "FGGetVariableBlock";
  }
}
Ue("FGGetVariableBlock", Ase);
class dse extends CA {
  /**
   * Creates a new FlowGraphCoordinateTransformBlock
   */
  constructor(e) {
    super(e), this.sourceSystem = this.registerDataInput("sourceSystem", w6), this.destinationSystem = this.registerDataInput("destinationSystem", w6), this.inputCoordinates = this.registerDataInput("inputCoordinates", ma), this.outputCoordinates = this.registerDataOutput("outputCoordinates", ma);
  }
  _updateOutputs(e) {
    const t = this.sourceSystem.getValue(e), r = this.destinationSystem.getValue(e), n = this.inputCoordinates.getValue(e), i = t.getWorldMatrix(), s = r.getWorldMatrix(), a = ue.Matrix[0].copyFrom(s);
    a.invert();
    const f = ue.Matrix[1];
    a.multiplyToRef(i, f);
    const o = this.outputCoordinates.getValue(e);
    S.TransformCoordinatesToRef(n, f, o);
  }
  getClassName() {
    return "FGCoordinateTransformBlock";
  }
}
Ue("FGCoordinateTransformBlock", dse);
class vse extends CA {
  constructor(e) {
    super(e), this.config = e, this.output = this.registerDataOutput("output", yie(e.value));
  }
  _updateOutputs(e) {
    this.output.setValue(this.config.value, e);
  }
  getClassName() {
    return "FGConstantBlock";
  }
}
Ue("FGConstantBlock", vse);
const rZ = "cachedOperationValue", nZ = "cachedExecutionId";
class tM extends CA {
  constructor(e, t) {
    super(t), this.output = this.registerDataOutput("output", e);
  }
  _updateOutputs(e) {
    const t = e._getExecutionVariable(this, nZ), r = e._getExecutionVariable(this, rZ);
    if (r !== void 0 && t === e.executionId)
      this.output.setValue(r, e);
    else {
      const n = this._doOperation(e);
      e._setExecutionVariable(this, rZ, n), e._setExecutionVariable(this, nZ, e.executionId), this.output.setValue(n, e);
    }
  }
}
class ns extends tM {
  constructor(e, t, r, n, i, s) {
    super(r, s), this._operation = n, this._className = i, this.leftInput = this.registerDataInput("leftInput", e), this.rightInput = this.registerDataInput("rightInput", t);
  }
  _doOperation(e) {
    return this._operation(this.leftInput.getValue(e), this.rightInput.getValue(e));
  }
  getClassName() {
    return this._className;
  }
}
class p1 extends tM {
  constructor(e, t, r, n, i) {
    super(t, i), this._operation = r, this._className = n, this.input = this.registerDataInput("input", e);
  }
  _doOperation(e) {
    return this._operation(this.input.getValue(e));
  }
  getClassName() {
    return this._className;
  }
}
const Fu = "FGBitwise", use = "AndBlock", lse = "OrBlock", Pse = "XorBlock", cse = "NotBlock", pse = "LeftShiftBlock", hse = "RightShiftBlock", Hse = "CountLeadingZerosBlock", gse = "CountTrailingZerosBlock";
class Xse extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t & r, `${Fu}${use}`, e);
  }
}
Ue(`${Fu}${use}`, Xse);
class Tse extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t | r, `${Fu}${lse}`, e);
  }
}
Ue(`${Fu}${lse}`, Tse);
class qse extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t ^ r, `${Fu}${Pse}`, e);
  }
}
Ue(`${Fu}${Pse}`, qse);
class bse extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => ~t, `${Fu}${cse}`, e);
  }
}
Ue(`${Fu}${cse}`, bse);
class xse extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t << r, `${Fu}${pse}`, e);
  }
}
Ue(`${Fu}${pse}`, xse);
class Dse extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t >> r, `${Fu}${hse}`, e);
  }
}
Ue(`${Fu}${hse}`, Dse);
class jse extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.clz32(t), `${Fu}${Hse}`, e);
  }
}
Ue(`${Fu}${Hse}`, jse);
class wse extends p1 {
  // from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32#implementing_count_leading_ones_and_beyond
  _ctrz(e) {
    return e >>>= 0, e === 0 ? 32 : (e &= -e, 31 - Math.clz32(e));
  }
  constructor(e) {
    super(Yt, Yt, (t) => this._ctrz(t), `${Fu}${gse}`, e);
  }
}
Ue(`${Fu}${gse}`, wse);
const gU = "FGLogic", mse = "AndBlock", Bse = "OrBlock", Wse = "NotBlock";
class Sse extends ns {
  constructor(e) {
    super(m6, m6, m6, (t, r) => t && r, `${gU}${mse}`, e);
  }
}
Ue(`${gU}${mse}`, Sse);
class Use extends ns {
  constructor(e) {
    super(m6, m6, m6, (t, r) => t || r, `${gU}${Bse}`, e);
  }
}
Ue(`${gU}${Bse}`, Use);
class Ise extends p1 {
  constructor(e) {
    super(m6, m6, (t) => !t, `${gU}${Wse}`, e);
  }
}
Ue(`${gU}${Wse}`, Ise);
class Rse extends tM {
  constructor(e, t, r, n) {
    super(e, n), this._operation = t, this._className = r;
  }
  _doOperation(e) {
    return this._operation();
  }
  getClassName() {
    return this._className;
  }
}
const Vse = "FGAddNumberBlock";
class Cse extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t + r, Vse, e);
  }
}
Ue(Vse, Cse);
const Ose = "FGSubtractNumberBlock";
class yse extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t - r, Ose, e);
  }
}
Ue(Ose, yse);
const kse = "FGMultiplyNumberBlock";
class Ese extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t * r, kse, e);
  }
}
Ue(kse, Ese);
const Fse = "FGDivideNumberBlock";
class Nse extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t / r, Fse, e);
  }
}
Ue(Fse, Nse);
const Qse = "FGModNumberBlock";
class Yse extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t % r, Qse, e);
  }
}
Ue(Qse, Yse);
const Mse = "FGPowNumberBlock";
class Lse extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => Math.pow(t, r), Mse, e);
  }
}
Ue(Mse, Lse);
const Kse = "FGIsNaNNumberBlock";
class Jse extends p1 {
  constructor(e) {
    super(Yt, m6, (t) => isNaN(t), Kse, e);
  }
}
Ue(Kse, Jse);
const zse = "FGIsInfinityNumberBlock";
class Gse extends p1 {
  constructor(e) {
    super(Yt, m6, (t) => !isFinite(t), zse, e);
  }
}
Ue(zse, Gse);
const Zse = "FGSqrtNumberBlock";
class _se extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.sqrt(t), Zse, e);
  }
}
Ue(Zse, _se);
const $se = "FGAbsNumberBlock";
class eae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.abs(t), $se, e);
  }
}
Ue($se, eae);
const tae = "FGNegateNumberBlock";
class rae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => -t, tae, e);
  }
}
Ue(tae, rae);
const nae = "FGFloorNumberBlock";
class iae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.floor(t), nae, e);
  }
}
Ue(nae, iae);
const sae = "FGCeilNumberBlock";
class aae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.ceil(t), sae, e);
  }
}
Ue(sae, aae);
const oae = "FGRoundNumberBlock";
class fae extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => Math.round(t / Math.pow(10, r)) / Math.pow(10, r), oae, e);
  }
}
Ue(oae, fae);
const Aae = "FGTruncNumberBlock";
class dae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.trunc(t), Aae, e);
  }
}
Ue(Aae, dae);
const vae = "FGExpNumberBlock";
class uae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.exp(t), vae, e);
  }
}
Ue(vae, uae);
const lae = "FGLog10NumberBlock";
class Pae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.log10(t), lae, e);
  }
}
Ue(lae, Pae);
const cae = "FGLogNumberBlock";
class pae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.log(t), cae, e);
  }
}
Ue(cae, pae);
const hae = "FGLnNumberBlock";
class Hae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.log(t) / Math.LN2, hae, e);
  }
}
Ue(hae, Hae);
const gae = "FGSineNumberBlock";
class Xae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.sin(t), gae, e);
  }
}
Ue(gae, Xae);
const Tae = "FGCosNumberBlock";
class qae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.cos(t), Tae, e);
  }
}
Ue(Tae, qae);
const bae = "FGTanNumberBlock";
class xae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.tan(t), bae, e);
  }
}
Ue(bae, xae);
const Dae = "FGASineNumberBlock";
class jae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.asin(t), Dae, e);
  }
}
Ue(Dae, jae);
const wae = "FGACosNumberBlock";
class mae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.acos(t), wae, e);
  }
}
Ue(wae, mae);
const Bae = "FGATanNumberBlock";
class Wae extends p1 {
  constructor(e) {
    super(Yt, Yt, (t) => Math.atan(t), Bae, e);
  }
}
Ue(Bae, Wae);
const Sae = "FGENumberBlock";
class Uae extends Rse {
  constructor(e) {
    super(Yt, () => Math.E, Sae, e);
  }
}
Ue(Sae, Uae);
const Iae = "FGPiNumberBlock";
class Rae extends Rse {
  constructor(e) {
    super(Yt, () => Math.PI, Iae, e);
  }
}
Ue(Iae, Rae);
const Vae = "FGATan2NumberBlock";
class Cae extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => Math.atan2(t, r), Vae, e);
  }
}
Ue(Vae, Cae);
const Oae = "FGRandomNumberBlock";
class yae extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => t + Math.random() * (r - t), Oae, e);
  }
}
Ue(Oae, yae);
const kae = "FGMinNumberBlock";
class Eae extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => Math.min(t, r), kae, e);
  }
}
Ue(kae, Eae);
const Fae = "FGMaxNumberBlock";
class Nae extends ns {
  constructor(e) {
    super(Yt, Yt, Yt, (t, r) => Math.max(t, r), Fae, e);
  }
}
Ue(Fae, Nae);
const Qae = "FGEqualsNumberBlock";
class Yae extends ns {
  constructor(e) {
    super(Yt, Yt, m6, (t, r) => t === r, Qae, e);
  }
}
Ue(Qae, Yae);
const Mae = "FGGreaterThanNumberBlock";
class Lae extends ns {
  constructor(e) {
    super(Yt, Yt, m6, (t, r) => t > r, Mae, e);
  }
}
Ue(Mae, Lae);
const Kae = "FGGreaterThanOrEqualsNumberBlock";
class Jae extends ns {
  constructor(e) {
    super(Yt, Yt, m6, (t, r) => t >= r, Kae, e);
  }
}
Ue(Kae, Jae);
const zae = "FGLessThanNumberBlock";
class Gae extends ns {
  constructor(e) {
    super(Yt, Yt, m6, (t, r) => t < r, zae, e);
  }
}
Ue(zae, Gae);
const Zae = "FGLessThanOrEqualsNumberBlock";
class _ae extends ns {
  constructor(e) {
    super(Yt, Yt, m6, (t, r) => t <= r, Zae, e);
  }
}
Ue(Zae, _ae);
const $ae = "FGMixNumberBlock";
class eoe extends CA {
  constructor(e) {
    super(e), this.leftInput = this.registerDataInput("leftInput", Yt), this.rightInput = this.registerDataInput("rightInput", Yt), this.alphaInput = this.registerDataInput("alphaInput", Yt), this.resultOutput = this.registerDataOutput("resultOutput", Yt);
  }
  _updateOutputs(e) {
    const t = this.leftInput.getValue(e), r = this.rightInput.getValue(e), n = this.alphaInput.getValue(e), i = t + (r - t) * n;
    this.resultOutput.setValue(i, e);
  }
  getClassName() {
    return $ae;
  }
}
Ue($ae, eoe);
const toe = "FGAddVector2Block";
class roe extends ns {
  constructor(e) {
    super(Y9, Y9, Y9, (t, r) => t.add(r), toe, e);
  }
}
Ue(toe, roe);
const noe = "FGSubtractVector2Block";
class ioe extends ns {
  constructor(e) {
    super(Y9, Y9, Y9, (t, r) => t.subtract(r), noe, e);
  }
}
Ue(noe, ioe);
const soe = "FGMultiplyVector2Block";
class aoe extends ns {
  constructor(e) {
    super(Y9, Y9, Y9, (t, r) => t.multiply(r), soe, e);
  }
}
Ue(soe, aoe);
const ooe = "FGDivideVector2Block";
class foe extends ns {
  constructor(e) {
    super(Y9, Y9, Y9, (t, r) => t.divide(r), ooe, e);
  }
}
Ue(ooe, foe);
const Aoe = "FGScaleVector2Block";
class doe extends ns {
  constructor(e) {
    super(Y9, Yt, Y9, (t, r) => t.scale(r), Aoe, e);
  }
}
Ue(Aoe, doe);
const voe = "FGLengthVector2Block";
class uoe extends p1 {
  constructor(e) {
    super(Y9, Yt, (t) => t.length(), voe, e);
  }
}
Ue(voe, uoe);
const loe = "FGNormalizeVector2Block";
class Poe extends p1 {
  constructor(e) {
    super(Y9, Y9, (t) => {
      const r = t.clone();
      return r.normalize(), r;
    }, loe, e);
  }
}
Ue(loe, Poe);
const Mge = "FGCreateVector2Block";
class coe extends CA {
  constructor(e) {
    super(e), this._cachedVector = at.Zero(), this.x = this.registerDataInput("x", Yt), this.y = this.registerDataInput("y", Yt), this.vector = this.registerDataOutput("vector", Y9);
  }
  _updateOutputs(e) {
    this._cachedVector.x = this.x.getValue(e), this._cachedVector.y = this.y.getValue(e), this.vector.setValue(this._cachedVector, e);
  }
}
Ue(Mge, coe);
const Lge = "FGSplitVector2Block";
class poe extends CA {
  constructor(e) {
    super(e), this.vector = this.registerDataInput("vector", Y9), this.x = this.registerDataOutput("x", Yt), this.y = this.registerDataOutput("y", Yt);
  }
  _updateOutputs(e) {
    const t = this.vector.getValue(e);
    this.x.setValue(t.x, e), this.y.setValue(t.y, e);
  }
}
Ue(Lge, poe);
const Kge = "FGRotate2dVector2Block";
class hoe extends CA {
  constructor(e) {
    super(e), this._cachedVector = at.Zero(), this.input = this.registerDataInput("input", Y9), this.angle = this.registerDataInput("angle", Yt), this.output = this.registerDataOutput("output", Y9);
  }
  _updateOutputs(e) {
    const t = this.input.getValue(e), r = this.angle.getValue(e);
    this._cachedVector.x = t.x * Math.cos(r) - t.y * Math.sin(r), this._cachedVector.y = t.x * Math.sin(r) + t.y * Math.cos(r), this.output.setValue(this._cachedVector, e);
  }
}
Ue(Kge, hoe);
const Hoe = "FGAddVector3Block";
class goe extends ns {
  constructor(e) {
    super(ma, ma, ma, (t, r) => t.add(r), Hoe, e);
  }
}
Ue(Hoe, goe);
const Xoe = "FGSubtractVector3Block";
class Toe extends ns {
  constructor(e) {
    super(ma, ma, ma, (t, r) => t.subtract(r), Xoe, e);
  }
}
Ue(Xoe, Toe);
const qoe = "FGMultiplyVector3Block";
class boe extends ns {
  constructor(e) {
    super(ma, ma, ma, (t, r) => t.multiply(r), qoe, e);
  }
}
Ue(qoe, boe);
const xoe = "FGDivideVector3Block";
class Doe extends ns {
  constructor(e) {
    super(ma, ma, ma, (t, r) => t.divide(r), xoe, e);
  }
}
Ue(xoe, Doe);
const joe = "FGScaleVector3Block";
class woe extends ns {
  constructor(e) {
    super(ma, Yt, ma, (t, r) => t.scale(r), joe, e);
  }
}
Ue(joe, woe);
const moe = "FGLengthVector3Block";
class Boe extends p1 {
  constructor(e) {
    super(ma, Yt, (t) => t.length(), moe, e);
  }
}
Ue(moe, Boe);
const Woe = "FGNormalizeVector3Block";
class Soe extends p1 {
  constructor(e) {
    super(ma, ma, (t) => t.normalizeToNew(), Woe, e);
  }
}
Ue(Woe, Soe);
const Uoe = "FGDotVector3Block";
class Ioe extends ns {
  constructor(e) {
    super(ma, ma, Yt, (t, r) => S.Dot(t, r), Uoe, e);
  }
}
Ue(Uoe, Ioe);
const Roe = "FGCrossVector3Block";
class Voe extends ns {
  constructor(e) {
    super(ma, ma, ma, (t, r) => S.Cross(t, r), Roe, e);
  }
}
Ue(Roe, Voe);
const Coe = "FGCreateVector3Block";
class Ooe extends CA {
  constructor(e) {
    super(e), this._cachedVector = S.Zero(), this.x = this.registerDataInput("x", Yt), this.y = this.registerDataInput("y", Yt), this.z = this.registerDataInput("y", Yt), this.vector = this.registerDataOutput("vector", ma);
  }
  _updateOutputs(e) {
    this._cachedVector.x = this.x.getValue(e), this._cachedVector.y = this.y.getValue(e), this._cachedVector.z = this.z.getValue(e), this.vector.setValue(this._cachedVector, e);
  }
  getClassName() {
    return Coe;
  }
}
Ue(Coe, Ooe);
const yoe = "FGSplitVector3Block";
class koe extends CA {
  constructor(e) {
    super(e), this.vector = this.registerDataInput("vector", ma), this.x = this.registerDataOutput("x", Yt), this.y = this.registerDataOutput("y", Yt), this.z = this.registerDataOutput("z", Yt);
  }
  _updateOutputs(e) {
    const t = this.vector.getValue(e);
    this.x.setValue(t.x, e), this.y.setValue(t.y, e), this.z.setValue(t.z, e);
  }
  getClassName() {
    return yoe;
  }
}
Ue(yoe, koe);
const Eoe = "FGRotateVector3Block";
class Foe extends CA {
  constructor(e) {
    super(e), this._cachedQuaternion = new Ze(), this.input = this.registerDataInput("input", ma), this.angle = this.registerDataInput("angle", Yt), this.output = this.registerDataOutput("output", ma);
  }
  _updateOutputs(e) {
    const t = Ze.RotationAxisToRef(this.axis.getValue(e), this.angle.getValue(e), this._cachedQuaternion), r = this.input.getValue(e), n = this.output.getValue(e);
    r.applyRotationQuaternionToRef(t, n);
  }
  getClassName() {
    return Eoe;
  }
}
Ue(Eoe, Foe);
const Noe = "FGTransformVector3Block";
class Qoe extends ns {
  constructor(e) {
    super(D1, ma, ma, (t, r) => S.TransformCoordinatesToRef(r, t, this._cachedResult), Noe, e), this._cachedResult = S.Zero();
  }
}
Ue(Noe, Qoe);
const Yoe = "FGAddVector4Block";
class Moe extends ns {
  constructor(e) {
    super(iA, iA, iA, (t, r) => t.add(r), Yoe, e);
  }
}
Ue(Yoe, Moe);
const Loe = "FGSubtractVector4Block";
class Koe extends ns {
  constructor(e) {
    super(iA, iA, iA, (t, r) => t.subtract(r), Loe, e);
  }
}
Ue(Loe, Koe);
const Joe = "FGMultiplyVector4Block";
class zoe extends ns {
  constructor(e) {
    super(iA, iA, iA, (t, r) => t.multiply(r), Joe, e);
  }
}
Ue(Joe, zoe);
const Goe = "FGDivideVector4Block";
class Zoe extends ns {
  constructor(e) {
    super(iA, iA, iA, (t, r) => t.divide(r), Goe, e);
  }
}
Ue(Goe, Zoe);
const _oe = "FGScaleVector4Block";
class $oe extends ns {
  constructor(e) {
    super(iA, Yt, iA, (t, r) => t.scale(r), _oe, e);
  }
}
Ue(_oe, $oe);
const e1e = "FGLengthVector4Block";
class t1e extends p1 {
  constructor(e) {
    super(iA, Yt, (t) => t.length(), e1e, e);
  }
}
Ue(e1e, t1e);
const CF = "FGNormalizeVector4Block";
class r1e extends p1 {
  constructor(e) {
    super(iA, iA, (t) => {
      const r = t.clone();
      return r.normalize(), r;
    }, CF, e);
  }
  getClassName() {
    return CF;
  }
}
Ue(CF, r1e);
const n1e = "FGCreateVector4Block";
class i1e extends CA {
  constructor(e) {
    super(e), this._cachedVector = Ir.Zero(), this.x = this.registerDataInput("x", Yt), this.y = this.registerDataInput("y", Yt), this.z = this.registerDataInput("y", Yt), this.w = this.registerDataInput("w", Yt), this.vector = this.registerDataOutput("vector", iA);
  }
  _updateOutputs(e) {
    this._cachedVector.x = this.x.getValue(e), this._cachedVector.y = this.y.getValue(e), this._cachedVector.z = this.z.getValue(e), this._cachedVector.w = this.w.getValue(e), this.vector.setValue(this._cachedVector, e);
  }
  getClassName() {
    return n1e;
  }
}
Ue(n1e, i1e);
const s1e = "FGSplitVector4Block";
class a1e extends CA {
  constructor(e) {
    super(e), this.vector = this.registerDataInput("vector", iA), this.x = this.registerDataOutput("x", Yt), this.y = this.registerDataOutput("y", Yt), this.z = this.registerDataOutput("z", Yt), this.w = this.registerDataOutput("w", Yt);
  }
  _updateOutputs(e) {
    const t = this.vector.getValue(e);
    this.x.setValue(t.x, e), this.y.setValue(t.y, e), this.z.setValue(t.z, e), this.w.setValue(t.w, e);
  }
  getClassName() {
    return s1e;
  }
}
Ue(s1e, a1e);
const o1e = "FGAddMatrixBlock";
class f1e extends ns {
  constructor(e) {
    super(D1, D1, D1, (t, r) => t.addToRef(r, this._cachedMatrix), o1e, e), this._cachedMatrix = he.Zero();
  }
}
Ue(o1e, f1e);
const A1e = "FGAddMatrixAndNumberBlock";
class d1e extends ns {
  constructor(e) {
    super(D1, Yt, D1, (t, r) => {
      for (let n = 0; n < t.m.length; n++)
        this._cachedArray[n] = t.m[n] + r;
      return he.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);
    }, A1e, e), this._cachedArray = new Float32Array(16), this._cachedMatrix = he.Zero();
  }
}
Ue(A1e, d1e);
const v1e = "FGSubtractMatrixBlock";
class u1e extends ns {
  constructor(e) {
    super(D1, D1, D1, (t, r) => t.addToRef(r.scaleToRef(-1, ue.Matrix[0]), this._cachedMatrix), v1e, e), this._cachedMatrix = he.Zero();
  }
}
Ue(v1e, u1e);
const l1e = "FGSubtractMatrixAndNumberBlock";
class P1e extends ns {
  constructor(e) {
    super(D1, Yt, D1, (t, r) => {
      for (let n = 0; n < t.m.length; n++)
        this._cachedArray[n] = t.m[n] - r;
      return he.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);
    }, l1e, e), this._cachedArray = new Float32Array(16), this._cachedMatrix = he.Zero();
  }
}
Ue(l1e, P1e);
const c1e = "FGMultiplyMatrixBlock";
class p1e extends ns {
  constructor(e) {
    super(D1, D1, D1, (t, r) => t.multiplyToRef(r, this._cachedMatrix), c1e, e), this._cachedMatrix = he.Zero();
  }
}
Ue(c1e, p1e);
const h1e = "FGDivideMatrixBlock";
class H1e extends ns {
  constructor(e) {
    super(D1, D1, D1, (t, r) => t.multiplyToRef(r.invertToRef(ue.Matrix[0]), this._cachedResultMatrix), h1e, e), this._cachedResultMatrix = he.Zero();
  }
}
Ue(h1e, H1e);
const g1e = "FGDivideMatrixAndNumberBlock";
class X1e extends ns {
  constructor(e) {
    super(D1, Yt, D1, (t, r) => {
      for (let n = 0; n < t.m.length; n++)
        this._cachedArray[n] = t.m[n] / r;
      return he.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);
    }, g1e, e), this._cachedArray = new Float32Array(16), this._cachedMatrix = he.Zero();
  }
}
Ue(g1e, X1e);
const T1e = "FGScaleMatrixBlock";
class q1e extends ns {
  constructor(e) {
    super(D1, Yt, D1, (t, r) => t.scaleToRef(r, this._cachedMatrix), T1e, e), this._cachedMatrix = he.Zero();
  }
}
Ue(T1e, q1e);
const b1e = "FGClampMatrixBlock";
class x1e extends CA {
  constructor(e) {
    super(e), this._cachedArray = new Float32Array(16), this._cachedMatrix = he.Identity(), this.input = this.registerDataInput("input", D1), this.min = this.registerDataInput("min", Yt), this.max = this.registerDataInput("max", Yt), this.output = this.registerDataOutput("output", D1);
  }
  _updateOutputs(e) {
    const t = this.input.getValue(e), r = this.min.getValue(e), n = this.max.getValue(e);
    for (let i = 0; i < t.m.length; i++)
      this._cachedArray[i] = Math.min(Math.max(t.m[i], r), n);
    he.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix), this.output.setValue(this._cachedMatrix, e);
  }
  getClassName() {
    return b1e;
  }
}
Ue(b1e, x1e);
const D1e = "FGDecomposeMatrixBlock";
class j1e extends CA {
  constructor(e) {
    super(e), this._cachedTranslation = new S(), this._cachedRotation = new Ze(), this._cachedScale = new S(), this.input = this.registerDataInput("input", D1), this.translation = this.registerDataOutput("translation", ma), this.rotation = this.registerDataOutput("rotation", hV), this.scale = this.registerDataOutput("scale", ma);
  }
  _updateOutputs(e) {
    this.input.getValue(e).decompose(this._cachedScale, this._cachedRotation, this._cachedTranslation), this.translation.setValue(this._cachedTranslation, e), this.rotation.setValue(this._cachedRotation, e), this.scale.setValue(this._cachedScale, e);
  }
  getClassName() {
    return D1e;
  }
}
Ue(D1e, j1e);
const w1e = "FGComposeMatrixBlock";
class m1e extends CA {
  constructor(e) {
    super(e), this._cachedMatrix = new he(), this.output = this.registerDataOutput("input", D1), this.translation = this.registerDataInput("translation", ma), this.rotation = this.registerDataInput("rotation", hV), this.scale = this.registerDataInput("scale", ma);
  }
  _updateOutputs(e) {
    const t = this.translation.getValue(e), r = this.rotation.getValue(e), n = this.scale.getValue(e);
    he.ComposeToRef(n, r, t, this._cachedMatrix), this.output.setValue(this._cachedMatrix, e);
  }
  getClassName() {
    return w1e;
  }
}
Ue(w1e, m1e);
const B1e = "FGQuaternionToRotationMatrixBlock";
class W1e extends p1 {
  constructor(e) {
    super(hV, D1, (t) => he.FromQuaternionToRef(t, this._cachedMatrix), B1e, e), this._cachedMatrix = new he();
  }
}
Ue(B1e, W1e);
const S1e = "FGGetTransformationMatrixBlock";
class U1e extends ns {
  constructor(e) {
    super(w6, w6, D1, (t, r) => {
      const n = t.getWorldMatrix();
      return r.getWorldMatrix().invertToRef(ue.Matrix[0]).multiplyToRef(n, this._cachedResult);
    }, S1e, e), this._cachedResult = he.Zero();
  }
}
Ue(S1e, U1e);
class I1e extends HU {
  /**
   * @internal
   */
  _preparePendingTasks(e) {
    if (!e._getExecutionVariable(this, "sceneReadyObserver")) {
      const r = e.configuration.scene.onReadyObservable.add(() => {
        this._execute(e);
      });
      e._setExecutionVariable(this, "sceneReadyObserver", r);
    }
  }
  /**
   * @internal
   */
  _cancelPendingTasks(e) {
    const t = e._getExecutionVariable(this, "sceneReadyObserver");
    e.configuration.scene.onReadyObservable.remove(t), e._deleteExecutionVariable(this, "sceneReadyObserver");
  }
  getClassName() {
    return "FGSceneReadyEventBlock";
  }
}
Ue("FGSceneReadyEventBlock", I1e);
class R1e extends HU {
  constructor(e) {
    super(e), this.config = e, this.eventData = this.registerDataOutput("eventData", w6);
  }
  _preparePendingTasks(e) {
    const t = e.configuration.coordinator.getCustomEventObservable(this.config.eventId);
    this._eventObserver = t.add((r) => {
      this.eventData.setValue(r, e), this._execute(e);
    });
  }
  _cancelPendingTasks(e) {
    const t = e.configuration.coordinator.getCustomEventObservable(this.config.eventId);
    t ? t.remove(this._eventObserver) : ye.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this.config.eventId}`);
  }
  getClassName() {
    return "FGReceiveCustomEventBlock";
  }
  serialize(e) {
    super.serialize(e), e.eventId = this.config.eventId;
  }
}
Ue("FGReceiveCustomEventBlock", R1e);
class V1e extends HU {
  /**
   * @internal
   */
  _preparePendingTasks(e) {
    if (!e._getExecutionVariable(this, "sceneBeforeRender")) {
      const r = e.configuration.scene.onBeforeRenderObservable.add(() => {
        this._execute(e);
      });
      e._setExecutionVariable(this, "sceneBeforeRender", r);
    }
  }
  /**
   * @internal
   */
  _cancelPendingTasks(e) {
    const t = e._getExecutionVariable(this, "sceneBeforeRender");
    e.configuration.scene.onBeforeRenderObservable.remove(t), e._deleteExecutionVariable(this, "sceneBeforeRender");
  }
  getClassName() {
    return "FGSceneTickEventBlock";
  }
}
Ue("FGSceneTickEventBlock", V1e);
const Jge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  AbstractActionManager: Ml,
  AbstractAssetTask: pg,
  AbstractMesh: jn,
  AbstractScene: J1,
  AcquireNativeObjectAsync: Hte,
  Action: wa,
  ActionEvent: mo,
  ActionManager: Rs,
  AddBlock: qre,
  get AddressMode() {
    return zw;
  },
  AdvancedTimer: kte,
  AlignBlock: Une,
  AlphaState: k$,
  AmmoJSPlugin: eg,
  AnaglyphArcRotateCamera: Uee,
  AnaglyphFreeCamera: Iee,
  AnaglyphGamepadCamera: Ree,
  AnaglyphPostProcess: HQ,
  AnaglyphUniversalCamera: Vee,
  Analyser: H6e,
  AndOrNotEvaluator: Mx,
  Angle: JH,
  Animatable: ZN,
  get AnimatedInputBlockTypes() {
    return tq;
  },
  Animation: st,
  AnimationAssetTask: sge,
  AnimationEvent: wO,
  AnimationGroup: w0,
  AnimationGroupMask: d6e,
  get AnimationGroupMaskMode() {
    return EI;
  },
  get AnimationKeyInterpolation() {
    return CI;
  },
  AnimationPropertiesOverride: t6e,
  AnimationRange: Am,
  AnisotropyBlock: fV,
  ApplyPostProcess: ty,
  Arc2: G$,
  ArcFollowCamera: wee,
  ArcRotateCamera: ps,
  ArcRotateCameraGamepadInput: VR,
  ArcRotateCameraInputsManager: CO,
  ArcRotateCameraKeyboardMoveInput: M0,
  ArcRotateCameraMouseWheelInput: AU,
  ArcRotateCameraPointersInput: ku,
  ArcRotateCameraVRDeviceOrientationInput: lQ,
  ArcTan2Block: Nre,
  AssetContainer: xR,
  get AssetTaskState() {
    return Y2;
  },
  AssetsManager: age,
  AssetsProgressEvent: pie,
  AsyncLoop: up,
  AttachToBoxBehavior: T6e,
  AudioEngine: vee,
  AudioSceneComponent: yu,
  get AutoLayoutMode() {
    return SS;
  },
  AutoReleaseWorkerPool: lU,
  AutoRotationBehavior: hee,
  AxesViewer: aq,
  Axis: bf,
  AxisDragGizmo: lp,
  AxisScaleGizmo: Pp,
  BRDFTextureTools: bPe,
  BabylonFileLoaderConfiguration: SI,
  BackEase: _$,
  BackgroundMaterial: Vi,
  BakedVertexAnimationManager: mm,
  BallAndSocketConstraint: $he,
  BaseCameraMouseWheelInput: IR,
  BaseCameraPointersInput: VO,
  BaseError: dm,
  BaseParticleSystem: N0,
  BaseSixDofDragBehavior: C2,
  BaseTexture: ls,
  BasisTools: py,
  BasisToolsOptions: qq,
  BasisTranscodeConfiguration: Npe,
  BezierCurve: z$,
  BezierCurveEase: f6e,
  BiPlanarBlock: one,
  BinaryFileAssetTask: Xie,
  BlackAndWhitePostProcess: AV,
  get BlendFactor() {
    return ad;
  },
  get BlendOperation() {
    return Z8;
  },
  BloomEffect: DF,
  BloomMergePostProcess: Wy,
  BlurPostProcess: c9,
  Bone: da,
  BoneAxesViewer: Bve,
  BoneIKController: hc,
  BoneLookController: wA,
  BonesBlock: nre,
  BooleanGeometryBlock: Dy,
  get BooleanGeometryOperations() {
    return ZH;
  },
  BounceEase: r6e,
  BouncingBehavior: fD,
  BoundingBlock: Qne,
  BoundingBox: cp,
  BoundingBoxGizmo: zQ,
  BoundingBoxRenderer: sie,
  BoundingInfo: Md,
  BoundingSphere: rg,
  BoxBlock: Xy,
  BoxBuilder: Wve,
  BoxParticleEmitter: AD,
  Buffer: P9,
  get BufferBindingType() {
    return dq;
  },
  get BufferMapState() {
    return aF;
  },
  get BufferUsage() {
    return ga;
  },
  CSG: YH,
  Camera: Tr,
  CameraGizmo: rS,
  CameraInputTypes: VA,
  CameraInputsManager: RR,
  CannonJSPlugin: sO,
  get CanvasAlphaMode() {
    return JI;
  },
  CapsuleBlock: gY,
  CapsuleBuilder: Uve,
  CascadedShadowGenerator: X6,
  ChromaticAberrationPostProcess: Pg,
  CircleEase: Z$,
  CircleOfConfusionPostProcess: Om,
  ClampBlock: Hy,
  ClearCoatBlock: Xm,
  ClipPlanesBlock: Hre,
  ClipboardEventTypes: qp,
  ClipboardInfo: wC,
  CloudBlock: oY,
  CloudPoint: Zne,
  Collider: LR,
  Color3: Ne,
  Color3Gradient: Jne,
  Color4: xt,
  ColorCorrectionPostProcess: dV,
  ColorCurves: so,
  ColorGradient: yY,
  ColorGradingTexture: PD,
  ColorMergerBlock: mre,
  ColorSplitterBlock: vQ,
  get ColorWrite() {
    return dF;
  },
  CombineAction: j$,
  get CompareFunction() {
    return q6;
  },
  CompatibilityOptions: us,
  get CompilationMessageType() {
    return fF;
  },
  CompleteGreasedLineColorTable: gne,
  CompleteGreasedLineWidthTable: Hne,
  get ComputeBindingType() {
    return io;
  },
  ComputeEffect: Pm,
  ComputeNormalsBlock: Dne,
  get ComputePassTimestampLocation() {
    return vF;
  },
  ComputeShader: vU,
  ComputeShaderParticleSystem: Kne,
  Condition: DS,
  ConditionBlock: jY,
  get ConditionBlockTests() {
    return y9;
  },
  ConditionalBlock: ine,
  get ConditionalBlockConditions() {
    return lc;
  },
  ConeParticleEmitter: wR,
  Constants: et,
  ContainerAssetTask: hie,
  get ConversionMode() {
    return dO;
  },
  ConvolutionPostProcess: cg,
  get Coordinate() {
    return Lx;
  },
  CopyTextureToTexture: lie,
  CopyTools: g6e,
  CreateBox: k0,
  CreateBoxVertexData: LO,
  CreateCapsule: KR,
  CreateCapsuleVertexData: JO,
  CreateCylinder: Ld,
  CreateCylinderVertexData: MO,
  CreateDashedLines: ZO,
  CreateDashedLinesVertexData: IQ,
  CreateDecal: ey,
  CreateDisc: uU,
  CreateDiscVertexData: zO,
  CreateEnvTextureAsync: cte,
  CreateGeodesic: rte,
  CreateGoldberg: ite,
  CreateGoldbergVertexData: nte,
  CreateGreasedLine: mhe,
  CreateGreasedLineMaterial: hne,
  CreateGround: Wm,
  CreateGroundFromHeightMap: NO,
  CreateGroundFromHeightMapVertexData: xQ,
  CreateGroundVertexData: y2,
  CreateHemisphere: zI,
  CreateIcoSphere: UR,
  CreateIcoSphereVertexData: RO,
  CreateImageDataArrayBufferViews: ny,
  CreateLathe: _O,
  CreateLineSystem: rm,
  CreateLineSystemVertexData: UQ,
  CreateLines: ka,
  CreatePlane: u4,
  CreatePlaneVertexData: UO,
  CreatePolygon: JR,
  CreatePolygonVertexData: RQ,
  CreatePolyhedron: hm,
  CreatePolyhedronVertexData: VQ,
  CreateResizedCopy: ute,
  CreateRibbon: n4,
  CreateRibbonVertexData: jQ,
  CreateScreenshot: PV,
  CreateScreenshotAsync: ZY,
  CreateScreenshotUsingRenderTarget: cV,
  CreateScreenshotUsingRenderTargetAsync: _Y,
  CreateScreenshotWithResizeAsync: mie,
  CreateSegmentedBoxVertexData: $ee,
  CreateSphere: UA,
  CreateSphereVertexData: KO,
  CreateText: ste,
  CreateTextShapePaths: OQ,
  CreateTiledBox: BQ,
  CreateTiledBoxVertexData: mQ,
  CreateTiledGround: FO,
  CreateTiledGroundVertexData: bQ,
  CreateTiledPlane: wQ,
  CreateTiledPlaneVertexData: $W,
  CreateTorus: Ag,
  CreateTorusKnot: GO,
  CreateTorusKnotVertexData: WQ,
  CreateTorusVertexData: QO,
  CreateTube: $O,
  CrossBlock: xre,
  CubeMapToSphericalPolynomialTools: Sm,
  CubeTexture: v1,
  CubeTextureAssetTask: bie,
  CubicEase: n6e,
  get CullMode() {
    return eS;
  },
  CurrentScreenBlock: oQ,
  Curve3: j0,
  CurveBlock: dne,
  get CurveBlockTypes() {
    return no;
  },
  CustomBlock: Dre,
  CustomOptimization: jie,
  CustomParticleEmitter: dD,
  CustomProceduralTexture: rre,
  CylinderBlock: HY,
  CylinderBuilder: mve,
  CylinderDirectedParticleEmitter: mR,
  CylinderParticleEmitter: aU,
  DDSTools: Aa,
  DataBuffer: tg,
  DataReader: gI,
  DataStorage: UF,
  Database: Cv,
  DebugBlock: yne,
  DebugLayer: pm,
  get DebugLayerTab() {
    return rF;
  },
  DecalBuilder: rue,
  DecalMapConfiguration: cU,
  DecalMapDefines: vne,
  Decode: QN,
  DecodeBase64ToBinary: TR,
  DecodeBase64ToString: bO,
  DecodeBase64UrlToBinary: iU,
  DecodeBase64UrlToString: zN,
  DeepCopier: sA,
  DefaultCollisionCoordinator: _ee,
  DefaultKTX2DecoderOptions: Ite,
  DefaultLoadingScreen: oq,
  DefaultRenderingPipeline: K9,
  Deferred: MW,
  DepthCullingState: YN,
  DepthOfFieldBlurPostProcess: sR,
  DepthOfFieldEffect: jF,
  get DepthOfFieldEffectBlurLevel() {
    return am;
  },
  DepthOfFieldMergePostProcess: eie,
  DepthPeelingRenderer: J2,
  DepthPeelingSceneComponent: oie,
  DepthReducer: Kte,
  DepthRenderer: jD,
  DepthRendererSceneComponent: aie,
  DepthSortedParticle: zne,
  DerivativeBlock: fre,
  DesaturateBlock: tne,
  DetailMapConfiguration: l4,
  get DeviceInputEventType() {
    return z5;
  },
  get DeviceLostReason() {
    return lF;
  },
  DeviceOrientationCamera: OO,
  DeviceSource: G5,
  DeviceSourceManager: J$,
  get DeviceType() {
    return vn;
  },
  DirectionalLight: IA,
  DirectionalLightFrustumViewer: aue,
  DiscBlock: XY,
  DiscBuilder: Rve,
  DiscardBlock: are,
  DisplayPassPostProcess: Sy,
  DistanceBlock: Ore,
  DistanceConstraint: e0e,
  DistanceJoint: w6e,
  DivideBlock: Sre,
  DoNothingAction: RN,
  DomManagement: I9e,
  DotBlock: jre,
  DracoCompression: Yd,
  DrawWrapper: zo,
  get DualSenseInput() {
    return L5;
  },
  get DualShockButton() {
    return dp;
  },
  get DualShockDpad() {
    return Kw;
  },
  get DualShockInput() {
    return M5;
  },
  DualShockPad: Bee,
  DumpTools: eA,
  DynamicFloat32Array: M8,
  DynamicTexture: Xp,
  EasingFunction: u1,
  EdgesRenderer: uV,
  Effect: An,
  EffectFallbacks: c1,
  EffectLayer: mc,
  EffectLayerSceneComponent: Nte,
  EffectRenderer: fU,
  EffectWrapper: ng,
  ElasticEase: i6e,
  ElbowBlock: ane,
  EncodeArrayBufferToBase64: XR,
  EndsWith: C$,
  Engine: Ge,
  EngineFactory: Kle,
  get EngineFormat() {
    return nO;
  },
  EngineInstrumentation: Ete,
  EngineStore: gr,
  EngineView: fue,
  EnvironmentHelper: gD,
  EnvironmentTextureTools: hue,
  Epsilon: Dn,
  EquiRectangularCubeTexture: VS,
  EquiRectangularCubeTextureAssetTask: Die,
  ErrorCodes: Z2,
  get ErrorFilter() {
    return PF;
  },
  EventConstants: wm,
  EventState: IN,
  ExecuteCodeAction: w$,
  ExponentialEase: $$,
  ExternalTexture: FQ,
  ExtractHighlightsPostProcess: By,
  ExtrudePolygon: zR,
  ExtrudeShape: GR,
  ExtrudeShapeCustom: ZR,
  FactorGradient: kY,
  FadeInOutBehavior: q6e,
  get FeatureName() {
    return k2;
  },
  get FileTools() {
    return kW;
  },
  FileToolsOptions: A9,
  FilesInput: KY,
  FilesInputStore: em,
  get FilterMode() {
    return Ji;
  },
  FilterPostProcess: vV,
  FlowGraph: JS,
  FlowGraphACosNumberBlock: mae,
  FlowGraphASinNumberBlock: jae,
  FlowGraphATan2NumberBlock: Cae,
  FlowGraphATanNumberBlock: Wae,
  FlowGraphAbsNumberBlock: eae,
  FlowGraphAddMatrixAndNumberBlock: d1e,
  FlowGraphAddMatrixBlock: f1e,
  FlowGraphAddNumberBlock: Cse,
  FlowGraphAddVector2Block: roe,
  FlowGraphAddVector3Block: goe,
  FlowGraphAddVector4Block: Moe,
  FlowGraphBitwiseAndBlock: Xse,
  FlowGraphBitwiseLeftShiftBlock: xse,
  FlowGraphBitwiseNotBlock: bse,
  FlowGraphBitwiseOrBlock: Tse,
  FlowGraphBitwiseRightShiftBlock: Dse,
  FlowGraphBitwiseXorBlock: qse,
  FlowGraphBlock: CA,
  FlowGraphBranchBlock: Mie,
  FlowGraphCeilNumberBlock: aae,
  FlowGraphClampMatrixBlock: x1e,
  FlowGraphComposeMatrixBlock: m1e,
  FlowGraphConditionalDataBlock: fse,
  FlowGraphConstantBlock: vse,
  FlowGraphContext: lO,
  FlowGraphContextLogger: Qge,
  FlowGraphCoordinateTransformBlock: dse,
  FlowGraphCoordinator: TS,
  FlowGraphCosNumberBlock: qae,
  FlowGraphCountLeadingZerosBlock: jse,
  FlowGraphCountTrailingZerosBlock: wse,
  FlowGraphCounterBlock: $ie,
  FlowGraphCreateVector2Block: coe,
  FlowGraphCreateVector3Block: Ooe,
  FlowGraphCreateVector4Block: i1e,
  FlowGraphCrossVector3Block: Voe,
  FlowGraphDebounceBlock: tse,
  FlowGraphDecomposeMatrixBlock: j1e,
  FlowGraphDivideMatrixAndNumberBlock: X1e,
  FlowGraphDivideMatrixBlock: H1e,
  FlowGraphDivideNumberBlock: Nse,
  FlowGraphDivideVector2Block: foe,
  FlowGraphDivideVector3Block: Doe,
  FlowGraphDivideVector4Block: Zoe,
  FlowGraphDoNBlock: Lie,
  FlowGraphDotVector3Block: Ioe,
  FlowGraphENumberBlock: Uae,
  FlowGraphEqualsNumberBlock: Yae,
  FlowGraphEventBlock: HU,
  FlowGraphExecutionBlock: og,
  FlowGraphExpNumberBlock: uae,
  FlowGraphFlipFlopBlock: rse,
  FlowGraphFloorNumberBlock: iae,
  FlowGraphForLoopBlock: Kie,
  FlowGraphGetTransformationMatrixBlock: U1e,
  FlowGraphGetVariableBlock: Ase,
  FlowGraphGreaterThanNumberBlock: Lae,
  FlowGraphGreaterThanOrEqualsNumberBlock: Jae,
  FlowGraphIsInfinityNumberBlock: Gse,
  FlowGraphIsNaNNumberBlock: Jse,
  FlowGraphLengthVector2Block: uoe,
  FlowGraphLengthVector3Block: Boe,
  FlowGraphLengthVector4Block: t1e,
  FlowGraphLessThanNumberBlock: Gae,
  FlowGraphLessThanOrEqualsNumberBlock: _ae,
  FlowGraphLnNumberBlock: Hae,
  FlowGraphLog10NumberBlock: Pae,
  FlowGraphLogBlock: Fie,
  FlowGraphLogNumberBlock: pae,
  FlowGraphLogicAndBlock: Sse,
  FlowGraphLogicNotBlock: Ise,
  FlowGraphLogicOrBlock: Use,
  FlowGraphMaxNumberBlock: Nae,
  FlowGraphMeshPickEventBlock: bm,
  FlowGraphMinNumberBlock: Eae,
  FlowGraphMixNumberBlock: eoe,
  FlowGraphModNumberBlock: Yse,
  FlowGraphMultiGateBlock: Gie,
  FlowGraphMultiplyMatrixBlock: p1e,
  FlowGraphMultiplyNumberBlock: Ese,
  FlowGraphMultiplyVector2Block: aoe,
  FlowGraphMultiplyVector3Block: boe,
  FlowGraphMultiplyVector4Block: zoe,
  FlowGraphNegateNumberBlock: rae,
  FlowGraphNormalizeVector2Block: Poe,
  FlowGraphNormalizeVector3Block: Soe,
  FlowGraphNormalizeVector4Block: r1e,
  FlowGraphPath: Cy,
  FlowGraphPauseAnimationBlock: sse,
  FlowGraphPiNumberBlock: Rae,
  FlowGraphPlayAnimationBlock: nse,
  FlowGraphPlayAudioBlock: ase,
  FlowGraphPowNumberBlock: Lse,
  FlowGraphQuaternionToRotationMatrixBlock: W1e,
  FlowGraphRandomNumberBlock: yae,
  FlowGraphReceiveCustomEventBlock: R1e,
  FlowGraphRotate2dVector2Block: hoe,
  FlowGraphRotate3dVector3Block: Foe,
  FlowGraphRoundNumberBlock: fae,
  FlowGraphScaleMatrixBlock: q1e,
  FlowGraphScaleVector2Block: doe,
  FlowGraphScaleVector3Block: woe,
  FlowGraphScaleVector4Block: $oe,
  FlowGraphSceneReadyEventBlock: I1e,
  FlowGraphSceneTickEventBlock: V1e,
  FlowGraphSendCustomEventBlock: Yie,
  FlowGraphSetPropertyBlock: Qie,
  FlowGraphSetVariableBlock: Nie,
  FlowGraphSignalConnection: uO,
  FlowGraphSinNumberBlock: Xae,
  FlowGraphSplitVector2Block: poe,
  FlowGraphSplitVector3Block: koe,
  FlowGraphSplitVector4Block: a1e,
  FlowGraphSqrtNumberBlock: _se,
  get FlowGraphState() {
    return $x;
  },
  FlowGraphStopAnimationBlock: ise,
  FlowGraphStopAudioBlock: ose,
  FlowGraphSubtractMatrixAndNumberBlock: P1e,
  FlowGraphSubtractMatrixBlock: u1e,
  FlowGraphSubtractNumberBlock: yse,
  FlowGraphSubtractVector2Block: ioe,
  FlowGraphSubtractVector3Block: Toe,
  FlowGraphSubtractVector4Block: Koe,
  FlowGraphSwitchBlock: Zie,
  FlowGraphTanNumberBlock: xae,
  FlowGraphThrottleBlock: Jie,
  FlowGraphTimerBlock: zie,
  FlowGraphTransformVector3Block: Qoe,
  FlowGraphTruncNumberBlock: dae,
  FlowGraphWaitAllBlock: _ie,
  FlowGraphWhileLoopBlock: ese,
  FluidRenderer: Iy,
  FluidRendererSceneComponent: Pie,
  get FluidRenderingDebug() {
    return Pc;
  },
  FluidRenderingObject: LY,
  FluidRenderingObjectCustomParticles: uie,
  FluidRenderingObjectParticleSystem: vie,
  FluidRenderingTargetRenderer: wF,
  FlyCamera: FR,
  FlyCameraInputsManager: Dee,
  FlyCameraKeyboardInput: jq,
  FlyCameraMouseInput: CR,
  FogBlock: pre,
  FollowBehavior: j6e,
  FollowCamera: Fv,
  FollowCameraInputsManager: jee,
  FollowCameraKeyboardMoveInput: aA,
  FollowCameraMouseWheelInput: qD,
  FollowCameraPointersInput: Eu,
  FragCoordBlock: Are,
  FragDepthBlock: lre,
  FragmentOutputBlock: iq,
  FramingBehavior: Vu,
  FreeCamera: SA,
  FreeCameraDeviceOrientationInput: PQ,
  FreeCameraGamepadInput: ER,
  FreeCameraInputsManager: kR,
  FreeCameraKeyboardMoveInput: wc,
  FreeCameraMouseInput: OR,
  FreeCameraMouseWheelInput: L0,
  FreeCameraTouchInput: yR,
  FreeCameraVirtualJoystickInput: cQ,
  FresnelBlock: Rre,
  FresnelParameters: GI,
  FromHalfFloat: QH,
  get FrontFace() {
    return MI;
  },
  FrontFacingBlock: ore,
  Frustum: Xc,
  FxaaPostProcess: ym,
  GPUParticleSystem: bc,
  GUID: z9e,
  Gamepad: N9,
  GamepadCamera: yO,
  GamepadManager: Wee,
  GamepadSystemSceneComponent: See,
  GaussianSplatting: Fd,
  GenerateBase64StringFromPixelData: SO,
  GenerateBase64StringFromTexture: rQ,
  GenerateBase64StringFromTextureAsync: nQ,
  GenericPad: xee,
  GeodesicData: _R,
  Geometry: Tf,
  GeometryBufferRenderer: po,
  GeometryBufferRendererSceneComponent: rie,
  GeometryCollectionBlock: BY,
  GeometryElbowBlock: xne,
  GeometryInfoBlock: kne,
  GeometryInputBlock: xf,
  GeometryOptimizeBlock: Ty,
  GeometryOutputBlock: vY,
  GeometryTextureBlock: CY,
  GeometryTextureFetchBlock: OY,
  GeometryTransformBlock: UY,
  GeometryTrigonometryBlock: SY,
  get GeometryTrigonometryBlockOperations() {
    return Bs;
  },
  GetClass: Jo,
  GetDOMTextContent: gR,
  GetEnvInfo: ry,
  GetEnvironmentBRDFTexture: nV,
  GetInternalFormatFromBasisFormat: ere,
  GetTGAHeader: sV,
  GetTextureDataAsync: lte,
  Gizmo: Lo,
  get GizmoAnchorPoint() {
    return QI;
  },
  get GizmoCoordinatesMode() {
    return pD;
  },
  GizmoManager: Jle,
  GlowLayer: zl,
  GoldbergMesh: $R,
  GradientBlock: Jre,
  GradientBlockColorStep: mC,
  GradientHelper: kl,
  GrainPostProcess: km,
  GreasedLineBaseMesh: dY,
  GreasedLineMaterialDefaults: D6,
  GreasedLineMesh: T1,
  get GreasedLineMeshColorDistribution() {
    return E2;
  },
  get GreasedLineMeshColorDistributionType() {
    return K2;
  },
  get GreasedLineMeshColorMode() {
    return Tc;
  },
  get GreasedLineMeshMaterialType() {
    return OS;
  },
  get GreasedLineMeshWidthDistribution() {
    return rq;
  },
  GreasedLinePluginMaterial: o4,
  get GreasedLineRibbonAutoDirectionMode() {
    return cD;
  },
  get GreasedLineRibbonFacesMode() {
    return kS;
  },
  GreasedLineRibbonMesh: L1,
  get GreasedLineRibbonPointsMode() {
    return m0;
  },
  GreasedLineSimpleMaterial: AY,
  GreasedLineTools: Qs,
  GridBlock: pY,
  GroundBuilder: xve,
  GroundMesh: dU,
  HDRCubeTexture: _2,
  HDRCubeTextureAssetTask: xie,
  HDRFiltering: _Q,
  HDRTools: iO,
  HandConstraintBehavior: E6e,
  get HandConstraintOrientation() {
    return z8;
  },
  get HandConstraintVisibility() {
    return Jx;
  },
  get HandConstraintZone() {
    return Kx;
  },
  get HandPart() {
    return J8;
  },
  HardwareScalingOptimization: mF,
  HavokPlugin: f0e,
  HeightToNormalBlock: aV,
  HemisphereBuilder: zle,
  HemisphericLight: y0,
  HemisphericParticleEmitter: BR,
  HighlightLayer: Ad,
  HighlightsPostProcess: E0e,
  Hinge2Joint: B6e,
  HingeConstraint: t0e,
  HingeJoint: m6e,
  HtmlElementTexture: cy,
  IFlowGraphCoordinatorConfiguration: Nge,
  IWebXRControllerPhysicsOptions: bge,
  IcoSphereBlock: PY,
  IcoSphereBuilder: y6e,
  ImageAssetTask: Tie,
  ImageProcessingBlock: nY,
  ImageProcessingConfiguration: Ui,
  ImageProcessingConfigurationDefines: M$,
  ImageProcessingPostProcess: Uy,
  ImageSourceBlock: E0,
  IncrementValueAction: b$,
  get IndexFormat() {
    return Tq;
  },
  InputBlock: gi,
  get InspectableType() {
    return SF;
  },
  InstancedLinesMesh: SQ,
  InstancedMesh: bp,
  InstancesBlock: ire,
  InstantiateBlock: Rne,
  InstantiateLinearBlock: Vne,
  InstantiateOnFacesBlock: IY,
  InstantiateOnVerticesBlock: by,
  InstantiateOnVolumeBlock: RY,
  InstantiateRadialBlock: Cne,
  InstantiatedEntries: dee,
  IntFloatConverterBlock: One,
  InternalTexture: As,
  get InternalTextureSource() {
    return ri;
  },
  InterpolateValueAction: I$,
  IntersectionInfo: LC,
  IsBase64DataUrl: qR,
  IsDocumentAvailable: $w,
  IsFileURL: JN,
  IsNavigatorAvailable: Mw,
  IsWindowObjectExist: u9,
  get JoystickAxis() {
    return V9;
  },
  KeepAssets: Aee,
  KeyboardEventTypes: t4,
  KeyboardInfo: MC,
  KeyboardInfoPre: Y5,
  KhronosTextureContainer: yv,
  KhronosTextureContainer2: H6,
  LatheBuilder: Kve,
  Layer: Yte,
  LayerSceneComponent: Qte,
  LengthBlock: yre,
  LensFlare: ly,
  LensFlareSystem: gm,
  LensFlareSystemSceneComponent: Mte,
  LensFlaresOptimization: RC,
  LensRenderingPipeline: d7e,
  LerpBlock: Wre,
  Light: ci,
  LightBlock: AO,
  LightGizmo: D0,
  LightInformationBlock: sre,
  LineEdgesRenderer: fie,
  LinesBuilder: Nve,
  LinesMesh: Tp,
  LoadFile: gq,
  LoadFileError: mS,
  LoadImage: nU,
  get LoadOp() {
    return f9;
  },
  LoadTextureFromTranscodeResult: fO,
  LockConstraint: n0e,
  Logger: Se,
  get MapMode() {
    return vD;
  },
  MapRangeBlock: qne,
  MappingBlock: VY,
  get MappingTypes() {
    return GH;
  },
  Material: gt,
  MaterialAnisotropicDefines: wte,
  MaterialClearCoatDefines: Dte,
  MaterialDefines: na,
  MaterialDetailMapDefines: Lee,
  MaterialFlags: Dt,
  MaterialGreasedLineDefines: une,
  MaterialHelper: Ye,
  MaterialIridescenceDefines: jte,
  MaterialPluginBase: Gl,
  get MaterialPluginEvent() {
    return x6;
  },
  MaterialPluginManager: sq,
  MaterialSheenDefines: mte,
  MaterialSubSurfaceDefines: Bte,
  MathBlock: DY,
  get MathBlockOperations() {
    return Ov;
  },
  Matrix: he,
  MatrixBuilderBlock: nne,
  MatrixComposeBlock: Ene,
  MatrixDeterminantBlock: fne,
  MatrixTransposeBlock: Ane,
  MaxBlock: Vre,
  MergeGeometryBlock: mY,
  MergeMeshesOptimization: uq,
  Mesh: Ee,
  MeshAssetTask: Hie,
  MeshAttributeExistsBlock: fY,
  get MeshAttributeExistsBlockTypes() {
    return xa;
  },
  MeshBlock: lY,
  MeshBuilder: Ef,
  get MeshDebugMode() {
    return im;
  },
  MeshDebugPluginMaterial: Q9,
  MeshExploder: oge,
  MeshLODLevel: fee,
  MeshParticleEmitter: IO,
  MeshUVSpaceRenderer: Qw,
  MeshoptCompression: Q2,
  MinBlock: Cre,
  MinMaxReducer: Lte,
  get MipmapFilterMode() {
    return oF;
  },
  MirrorTexture: uD,
  ModBlock: rne,
  ModelShape: xF,
  MorphTarget: lD,
  MorphTargetManager: U0,
  MorphTargetsBlock: rY,
  MotionBlurPostProcess: BD,
  MotorEnabledJoint: iQ,
  MultiMaterial: Dc,
  MultiObserver: JY,
  MultiPointerScaleBehavior: x6e,
  MultiRenderTarget: Zx,
  MultiplyBlock: zC,
  NLerpBlock: zre,
  NativeDataStream: hD,
  NativeEngine: Hm,
  get NativePointerInput() {
    return kI;
  },
  NativeXRFrame: Vie,
  NativeXRLayerRenderTargetTextureProvider: Gee,
  NativeXRLayerWrapper: zee,
  NativeXRRenderTarget: Zee,
  NegateBlock: kre,
  Node: Cs,
  NodeGeometry: Ql,
  NodeGeometryBlock: yi,
  get NodeGeometryBlockConnectionPointTypes() {
    return Me;
  },
  NodeGeometryBuildState: Xne,
  NodeGeometryConnectionPoint: qF,
  get NodeGeometryConnectionPointCompatibilityStates() {
    return $8;
  },
  get NodeGeometryConnectionPointDirection() {
    return ES;
  },
  get NodeGeometryContextualSources() {
    return Ws;
  },
  NodeMaterial: ja,
  NodeMaterialBlock: Mr,
  get NodeMaterialBlockConnectionPointMode() {
    return jA;
  },
  get NodeMaterialBlockConnectionPointTypes() {
    return de;
  },
  get NodeMaterialBlockTargets() {
    return Ve;
  },
  NodeMaterialConnectionPoint: um,
  get NodeMaterialConnectionPointCompatibilityStates() {
    return pc;
  },
  NodeMaterialConnectionPointCustomObject: Ko,
  get NodeMaterialConnectionPointDirection() {
    return ao;
  },
  NodeMaterialDefines: HI,
  get NodeMaterialModes() {
    return Vv;
  },
  NodeMaterialOptimizer: _pe,
  get NodeMaterialSystemValues() {
    return Bi;
  },
  NodeMaterialTeleportInBlock: Xre,
  NodeMaterialTeleportOutBlock: Tre,
  NoiseBlock: bne,
  NoiseProceduralTexture: ZI,
  NormalBlendBlock: Zre,
  NormalizeBlock: wre,
  NormalizeVectorBlock: wne,
  NullBlock: Tne,
  NullEngine: ote,
  NullEngineOptions: ate,
  Observable: Oe,
  Observer: c$,
  OcclusionMaterial: bpe,
  Octree: cm,
  OctreeBlock: NI,
  OctreeSceneComponent: DQ,
  OimoJSPlugin: gF,
  OnAfterEnteringVRObservableEvent: jve,
  OneMinusBlock: iY,
  get Orientation() {
    return tm;
  },
  OutlineRenderer: MS,
  PBRAnisotropicConfiguration: DD,
  PBRBaseMaterial: fs,
  PBRBaseSimpleMaterial: Yv,
  PBRClearCoatConfiguration: h9,
  PBRIridescenceConfiguration: dd,
  PBRMaterial: mr,
  PBRMaterialDefines: cF,
  PBRMetallicRoughnessBlock: g9,
  PBRMetallicRoughnessMaterial: s4,
  PBRSheenConfiguration: K0,
  PBRSpecularGlossinessMaterial: a4,
  PBRSubSurfaceConfiguration: _o,
  PHI: kf,
  PadNumber: y$,
  PanoramaToCubeMapTools: wq,
  Particle: FS,
  ParticleBlendMultiplyBlock: dQ,
  ParticleHelper: Tm,
  ParticleRampGradientBlock: AQ,
  ParticleSystem: ti,
  ParticleSystemSet: bq,
  ParticleTextureBlock: fQ,
  ParticlesOptimization: VC,
  PassCubePostProcess: hQ,
  PassPostProcess: lg,
  Path2: sU,
  Path3D: vm,
  PathCursor: A6e,
  PerfCollectionStrategy: pge,
  PerfCounter: v9,
  PerformanceConfigurator: k9,
  PerformanceMonitor: iee,
  PerformanceViewerCollector: b0,
  PerturbNormalBlock: PU,
  PhotoDome: US,
  Physics6DoFConstraint: $ne,
  Physics6DoFLimit: _he,
  PhysicsAggregate: a0e,
  PhysicsBody: wy,
  PhysicsConstraint: mD,
  get PhysicsConstraintAxis() {
    return MH;
  },
  get PhysicsConstraintAxisLimitMode() {
    return I2;
  },
  get PhysicsConstraintMotorType() {
    return _x;
  },
  get PhysicsConstraintType() {
    return kv;
  },
  PhysicsEngine: $Q,
  PhysicsEngineV2: jy,
  get PhysicsEventType() {
    return q0;
  },
  PhysicsHelper: d0e,
  PhysicsImpostor: tn,
  PhysicsJoint: ta,
  get PhysicsMaterialCombineMode() {
    return R2;
  },
  get PhysicsMotionType() {
    return W0;
  },
  PhysicsRadialExplosionEventOptions: sS,
  get PhysicsRadialImpulseFalloff() {
    return iR;
  },
  PhysicsRaycastResult: iV,
  PhysicsShape: P4,
  PhysicsShapeBox: QY,
  PhysicsShapeCapsule: FY,
  PhysicsShapeContainer: Zhe,
  PhysicsShapeConvexHull: zhe,
  PhysicsShapeCylinder: NY,
  PhysicsShapeMesh: Ghe,
  PhysicsShapeSphere: EY,
  get PhysicsShapeType() {
    return Ff;
  },
  PhysicsUpdraftEventOptions: YY,
  get PhysicsUpdraftMode() {
    return YS;
  },
  PhysicsViewer: sue,
  PhysicsVortexEventOptions: MY,
  PickingInfo: F9,
  get PipelineErrorReason() {
    return AF;
  },
  PivotTools: Vs,
  Plane: BA,
  PlaneBlock: uY,
  PlaneBuilder: b6e,
  PlaneDragGizmo: tS,
  PlaneRotationGizmo: S0,
  PlayAnimationAction: x$,
  PlaySoundAction: m$,
  get PointColor() {
    return Iv;
  },
  PointLight: ag,
  PointParticleEmitter: WR,
  PointerDragBehavior: O9,
  PointerEventTypes: ir,
  PointerInfo: vp,
  PointerInfoBase: GN,
  PointerInfoPre: K$,
  get PointerInput() {
    return Yn;
  },
  PointsCloudSystem: _ne,
  PointsGroup: WC,
  Polar: g0,
  Polygon: Yve,
  PolygonBuilder: Mve,
  PolygonMeshBuilder: ete,
  PolyhedronBuilder: zve,
  PolyhedronData: _C,
  PositionGizmo: oy,
  PositionNormalTextureVertex: aQ,
  PositionNormalVertex: sQ,
  PostProcess: kr,
  PostProcessManager: yI,
  PostProcessRenderEffect: gs,
  PostProcessRenderPipeline: SD,
  PostProcessRenderPipelineManager: nie,
  PostProcessRenderPipelineManagerSceneComponent: iie,
  PostProcessesOptimization: IC,
  PosterizeBlock: Lre,
  PowBlock: Ere,
  PowerEase: s6e,
  get PowerPreference() {
    return sF;
  },
  PrePassOutputBlock: cre,
  PrePassRenderer: mA,
  PrePassRendererSceneComponent: Aie,
  PrePassTextureBlock: gre,
  PrecisionDate: Yi,
  PredicateCondition: H$,
  PressureObserverWrapper: Vy,
  get PrimitiveTopology() {
    return Fl;
  },
  PrismaticConstraint: i0e,
  ProceduralTexture: Y0,
  ProceduralTextureSceneComponent: Tee,
  get PropertyTypeForEdition() {
    return Gr;
  },
  PushMaterial: P1,
  QuadraticEase: _N,
  QuadraticErrorSimplification: cne,
  QuarticEase: a6e,
  Quaternion: Ze,
  get QueryType() {
    return KI;
  },
  QuinticEase: o6e,
  RGBDTextureTools: $C,
  RandomBlock: wY,
  get RandomBlockLocks() {
    return B0;
  },
  RandomGUID: v4,
  RandomNumberBlock: Fre,
  RawCubeTexture: hy,
  RawTexture: Bo,
  RawTexture2DArray: Py,
  RawTexture3D: zpe,
  Ray: Hi,
  RayHelper: yQ,
  ReadFile: BS,
  ReadFileError: xO,
  RecastJSCrowd: Yne,
  RecastJSPlugin: Bhe,
  ReciprocalBlock: Yre,
  ReflectBlock: $re,
  ReflectionBlock: Cm,
  ReflectionProbe: Im,
  ReflectionTextureBlock: hre,
  Reflector: fR,
  RefractBlock: ene,
  RefractionBlock: wD,
  RefractionPostProcess: WD,
  RefractionTexture: tY,
  RegisterClass: Ue,
  RegisterMaterialPlugin: Tve,
  RegisterNativeTypeAsync: gte,
  RemapBlock: jR,
  get RenderPassTimestampLocation() {
    return uF;
  },
  RenderTargetTexture: Ta,
  RenderTargetWrapper: DR,
  RenderTargetsOptimization: BF,
  RenderingGroup: x0,
  RenderingGroupInfo: L$,
  RenderingManager: $6,
  ReplaceColorBlock: Mre,
  RequestFile: jO,
  RequestFileError: OI,
  RetryStrategy: V$,
  RibbonBuilder: Ive,
  RichType: Zl,
  RichTypeAny: w6,
  RichTypeBoolean: m6,
  RichTypeColor3: Cie,
  RichTypeColor4: Oie,
  RichTypeMatrix: D1,
  RichTypeNumber: Yt,
  RichTypeQuaternion: hV,
  RichTypeString: pV,
  RichTypeVector2: Y9,
  RichTypeVector3: ma,
  RichTypeVector4: iA,
  RollingAverage: see,
  Rotate2dBlock: _re,
  RotationGizmo: GQ,
  RotationXBlock: mne,
  RotationYBlock: Bne,
  RotationZBlock: Wne,
  RuntimeAnimation: R$,
  RuntimeError: O0,
  SSAO2RenderingPipeline: H9,
  SSAORenderingPipeline: pU,
  SSRRenderingPipeline: Wa,
  get SamplerBindingType() {
    return Xq;
  },
  Scalar: Xt,
  ScaleBlock: bre,
  ScaleGizmo: ZQ,
  ScalingBlock: Sne,
  Scene: sr,
  SceneComponentConstants: Ot,
  SceneDepthBlock: oV,
  SceneInstrumentation: Fte,
  SceneLoader: Hn,
  get SceneLoaderAnimationGroupLoadingMode() {
    return O2;
  },
  SceneLoaderFlags: l9,
  SceneOptimization: c4,
  SceneOptimizer: zY,
  SceneOptimizerOptions: om,
  get ScenePerformancePriority() {
    return $H;
  },
  SceneRecorder: vge,
  SceneSerializer: G2,
  ScreenSizeBlock: dre,
  ScreenSpaceBlock: vre,
  ScreenSpaceCurvaturePostProcess: hU,
  ScreenSpaceReflectionPostProcess: jp,
  ScreenshotTools: Age,
  SerializationHelper: jt,
  SetColorsBlock: bY,
  SetCorsBehavior: DO,
  SetMaterialIDBlock: WY,
  SetNormalsBlock: qY,
  SetParentAction: VN,
  SetPositionsBlock: TY,
  SetStateAction: T$,
  SetTangentsBlock: xY,
  SetUVsBlock: qy,
  SetValueAction: q$,
  ShaderCodeInliner: Aq,
  get ShaderLanguage() {
    return za;
  },
  ShaderMaterial: Zo,
  get ShaderStage() {
    return G8;
  },
  ShaderStore: Le,
  ShadowDepthWrapper: ehe,
  ShadowGenerator: ln,
  ShadowGeneratorSceneComponent: Jte,
  ShadowLight: xD,
  ShadowMapBlock: Pre,
  ShadowsOptimization: UC,
  ShapeBuilder: Lve,
  SharpenPostProcess: Em,
  SheenBlock: Vm,
  SimplexPerlin3DBlock: Gre,
  SimplicationQueueSceneComponent: pne,
  SimplificationQueue: Pne,
  SimplificationSettings: xhe,
  get SimplificationType() {
    return nR;
  },
  SineEase: $N,
  SixDofDragBehavior: Hee,
  Size: Qd,
  Skeleton: r4,
  SkeletonViewer: Ru,
  SliderConstraint: r0e,
  SmartArray: qf,
  SmartArrayNoDuplicate: K8,
  SmoothStepBlock: Qre,
  SolidParticle: bF,
  SolidParticleSystem: Jhe,
  SolidParticleVertex: Gne,
  Sound: qc,
  SoundTrack: uee,
  get SourceTextureFormat() {
    return pF;
  },
  get Space() {
    return ai;
  },
  SphereBlock: cY,
  SphereBuilder: Sve,
  SphereDirectedParticleEmitter: SR,
  SphereParticleEmitter: oU,
  Spherical: X0,
  SphericalHarmonics: HD,
  SphericalPolynomial: i4,
  SpotLight: nA,
  SpringConstraint: s0e,
  Sprite: Ry,
  SpriteManager: z2,
  SpriteMap: nge,
  SpritePackedManager: ige,
  SpriteSceneComponent: cie,
  Stage: Y1,
  StandardMaterial: Wt,
  StandardMaterialDefines: Kee,
  StandardRenderingPipeline: Ss,
  StartsWith: O$,
  StateCondition: g$,
  get StencilOperation() {
    return T0;
  },
  StencilState: L2,
  StencilStateComposer: KN,
  StepBlock: Ire,
  StereoscopicArcRotateCamera: Oee,
  StereoscopicFreeCamera: yee,
  StereoscopicGamepadCamera: kee,
  StereoscopicInterlacePostProcess: z6e,
  StereoscopicInterlacePostProcessI: Cee,
  StereoscopicScreenUniversalCamera: G6e,
  StereoscopicUniversalCamera: Eee,
  StickValues: F6e,
  StopAnimationAction: D$,
  StopSoundAction: B$,
  StorageBuffer: bee,
  get StorageTextureAccess() {
    return eO;
  },
  get StoreOp() {
    return Hc;
  },
  StringDictionary: YC,
  StringTools: R9e,
  SubEmitter: vq,
  get SubEmitterType() {
    return NS;
  },
  SubMesh: rA,
  SubSurfaceBlock: CS,
  SubSurfaceSceneComponent: die,
  SubtractBlock: Ure,
  SurfaceMagnetismBehavior: D6e,
  SwitchBooleanAction: X$,
  get SwitchInput() {
    return J5;
  },
  TBNBlock: Rm,
  TGATools: Zte,
  Tags: Zi,
  TargetCamera: b1,
  TargetedAnimation: eee,
  TeleportInBlock: Fne,
  TeleportOutBlock: Nne,
  TestBase64DataUrl: Q$,
  TextFileAssetTask: gie,
  Texture: We,
  get TextureAspect() {
    return zH;
  },
  TextureAssetTask: qie,
  TextureBlock: _I,
  get TextureDimension() {
    return Hp;
  },
  get TextureFormat() {
    return we;
  },
  TextureOptimization: SC,
  TexturePacker: I0,
  TexturePackerFrame: XF,
  get TextureSampleType() {
    return Ll;
  },
  TextureSampler: MN,
  TextureTools: Pte,
  get TextureUsage() {
    return Po;
  },
  get TextureViewDimension() {
    return Da;
  },
  ThinEngine: hr,
  ThinRenderTargetTexture: Gpe,
  ThinTexture: nq,
  TiledBoxBuilder: Cve,
  TiledPlaneBuilder: Vve,
  get TimerState() {
    return Gx;
  },
  TmpColors: Hs,
  TmpVectors: ue,
  ToGammaSpace: JW,
  ToHalfFloat: LH,
  ToLinearSpace: xI,
  TonemapPostProcess: C7e,
  get TonemappingOperator() {
    return _w;
  },
  Tools: ye,
  TorusBlock: hY,
  TorusBuilder: Dve,
  TorusKnotBuilder: Ove,
  TouchCamera: pQ,
  TrailMesh: rR,
  Trajectory: fa,
  TrajectoryClassifier: vO,
  TranscodeAsync: oO,
  get TranscodeTarget() {
    return nS;
  },
  TransformBlock: JC,
  TransformNode: Hr,
  TranslationBlock: Ine,
  TriPlanarBlock: gy,
  TrigonometryBlock: uQ,
  get TrigonometryBlockOperations() {
    return o9;
  },
  TubeBuilder: Jve,
  TwirlBlock: ure,
  UniformBuffer: yr,
  UniversalCamera: bD,
  UnregisterAllMaterialPlugins: gQ,
  UnregisterMaterialPlugin: qve,
  UploadContent: eY,
  UploadEnvLevelsAsync: EQ,
  UploadEnvSpherical: iy,
  UploadLevelsAsync: YI,
  UtilityLayerRenderer: Ds,
  VRCameraMetrics: Bm,
  VRDeviceOrientationArcRotateCamera: Yee,
  VRDeviceOrientationFreeCamera: EO,
  VRDeviceOrientationGamepadCamera: Mee,
  VRDistortionCorrectionPostProcess: _5,
  VRExperienceHelper: lm,
  VRMultiviewToSingleviewPostProcess: Qee,
  ValidatedNativeDataStream: Xte,
  ValueCondition: C9,
  Vector2: at,
  Vector3: S,
  Vector4: Ir,
  VectorConverterBlock: jne,
  VectorMergerBlock: BI,
  VectorSplitterBlock: Bre,
  VertexAnimationBaker: X6e,
  VertexBuffer: J,
  VertexData: Ut,
  VertexDataMaterialInfo: wI,
  get VertexFormat() {
    return jo;
  },
  VertexOutputBlock: mI,
  get VertexStepMode() {
    return LI;
  },
  VideoDome: uy,
  VideoRecorder: aR,
  VideoTexture: xc,
  ViewDirectionBlock: sY,
  Viewport: WA,
  VirtualJoystick: $r,
  VirtualJoysticksCamera: Fee,
  VolumetricLightScatteringPostProcess: Bc,
  VoronoiNoiseBlock: sne,
  WaveBlock: Kre,
  get WaveBlockKind() {
    return Gw;
  },
  WebGL2ParticleSystem: Lne,
  WebGL2ShaderProcessor: LN,
  WebGLDataBuffer: jS,
  WebGLHardwareTexture: jm,
  WebGLPipelineContext: E$,
  WebGPUCacheBindGroups: d1,
  WebGPUCacheRenderPipeline: co,
  WebGPUCacheRenderPipelineTree: N2,
  WebGPUCacheSampler: rD,
  WebGPUDataBuffer: qte,
  WebGPUDrawContext: tV,
  WebGPUEngine: wn,
  WebGPUTintWASM: Nl,
  WebRequest: ho,
  WebXRAbstractFeature: L9,
  WebXRAbstractMotionController: Um,
  WebXRAnchorSystem: aS,
  WebXRBackgroundRemover: fS,
  WebXRCamera: IS,
  WebXRCompositionLayerWrapper: Wie,
  WebXRControllerComponent: Jl,
  WebXRControllerMovement: Pq,
  WebXRControllerPhysics: AS,
  WebXRControllerPointerSelection: ig,
  WebXRDefaultExperience: vy,
  WebXRDefaultExperienceOptions: P3e,
  WebXRDepthSensing: HS,
  WebXRDomOverlay: PS,
  WebXREnterExitUI: dy,
  WebXREnterExitUIButton: yte,
  WebXREnterExitUIOptions: l3e,
  WebXRExperienceHelper: Ay,
  WebXREyeTracking: pS,
  WebXRFeatureName: Gi,
  WebXRFeaturePointSystem: vS,
  WebXRFeaturesManager: So,
  WebXRGenericHandController: Rie,
  WebXRGenericTriggerMotionController: RS,
  WebXRHTCViveMotionController: qm,
  WebXRHand: qee,
  get WebXRHandJoint() {
    return gn;
  },
  WebXRHandTracking: va,
  WebXRHitTest: dS,
  WebXRHitTestLegacy: lq,
  WebXRImageTracking: lS,
  WebXRInput: Ote,
  WebXRInputSource: Cte,
  WebXRLayers: hS,
  WebXRLightEstimation: cS,
  WebXRManagedOutputCanvas: Jee,
  WebXRManagedOutputCanvasOptions: YR,
  WebXRMeshDetector: uS,
  WebXRMicrosoftMixedRealityController: cq,
  WebXRMotionControllerManager: E9,
  WebXRMotionControllerTeleportation: nm,
  get WebXRNearControllerMode() {
    return zx;
  },
  WebXRNearInteraction: sg,
  WebXROculusTouchMotionController: R0,
  WebXRPlaneDetector: oS,
  WebXRProfiledMotionController: Vte,
  WebXRProjectionLayerWrapper: Sie,
  WebXRRawCameraAccess: XS,
  WebXRSessionManager: MR,
  WebXRSpaceWarp: gS,
  WebXRSpaceWarpRenderTargetTextureProvider: Iie,
  get WebXRState() {
    return d9;
  },
  get WebXRTrackingState() {
    return Jw;
  },
  WebXRWalkingLocomotion: CC,
  WeightedSound: lee,
  WorkerPool: Ute,
  WorleyNoise3DBlock: aY,
  XRSpaceWarpRenderTarget: Uie,
  get Xbox360Button() {
    return El;
  },
  get Xbox360Dpad() {
    return Lw;
  },
  Xbox360Pad: mee,
  get XboxInput() {
    return K5;
  },
  _BabylonLoaderRegistered: Tpe,
  _BasisTextureLoader: tre,
  _CreationDataStorage: tQ,
  _DDSTextureLoader: Wte,
  _ENVTextureLoader: Ste,
  _HDRTextureLoader: $te,
  _InstancesBatch: Z5,
  _KTXTextureLoader: Rte,
  _MeshCollisionData: aee,
  _OcclusionDataStorage: Ate,
  _PrimaryIsoTriangle: CQ,
  _TGATextureLoader: _te,
  _TimeToken: fte,
  _UpdateRGBDAsync: pte,
  _forceSceneHelpersToBundle: c3e,
  _forceTransformFeedbackToBundle: oue,
  _injectLTSFileTools: Y$,
  _staticOffsetValueColor3: FN,
  _staticOffsetValueColor4: NN,
  _staticOffsetValueQuaternion: ON,
  _staticOffsetValueSize: EN,
  _staticOffsetValueVector2: kN,
  _staticOffsetValueVector3: yN,
  addClipPlaneUniforms: Mf,
  allocateAndCopyTypedBuffer: KC,
  bindClipPlane: Df,
  captureEquirectangularFromScene: Xge,
  className: G9e,
  createDetailMapPlugin: ohe,
  createPBRAnisotropicPlugin: the,
  createPBRBRDFPlugin: rhe,
  createPBRClearCoatPlugin: nhe,
  createPBRIridescencePlugin: ihe,
  createPBRSheenPlugin: she,
  createPBRSubSurfacePlugin: ahe,
  createYieldingScheduler: tee,
  editableInPropertyPage: rn,
  expandToProperty: At,
  extractMinAndMax: WS,
  extractMinAndMaxIndexed: nee,
  getRichTypeFromValue: yie,
  inlineScheduler: FI,
  makeAsyncFunction: v6e,
  makeSyncFunction: ree,
  nativeOverride: Hq,
  normalizeEnvInfo: eV,
  prepareDefinesForClipPlanes: oee,
  prepareStringDefinesForClipPlanes: xq,
  runCoroutine: eQ,
  runCoroutineAsync: BO,
  runCoroutineSync: mO,
  serialize: M,
  serializeAsCameraReference: U$,
  serializeAsColor3: Oi,
  serializeAsColor4: rU,
  serializeAsColorCurves: W$,
  serializeAsFresnelParameters: eU,
  serializeAsImageProcessingConfiguration: CN,
  serializeAsMatrix: qO,
  serializeAsMeshReference: tU,
  serializeAsQuaternion: S$,
  serializeAsTexture: en,
  serializeAsVector2: HR,
  serializeAsVector3: fo,
  setAndStartTimer: HF,
  setStereoscopicAnaglyphRigMode: NR,
  setStereoscopicRigMode: QR,
  setVRRigMode: kO
}, Symbol.toStringTag, { value: "Module" })), iZ = Object.getOwnPropertyDescriptor(jn.prototype, "visibility");
Object.defineProperty(jn.prototype, "visibility", {
  get() {
    return iZ.get.call(this);
  },
  set(A) {
    iZ.set.call(this, A), this.getChildren().forEach((e) => {
      e instanceof Hr && (e.visibility = A);
    });
  }
});
Object.defineProperties(Hr.prototype, {
  _visibility: {
    value: 1,
    writable: !0
  },
  visibility: {
    get() {
      return this._visibility;
    },
    set(A) {
      this._visibility = A, this.getChildren().forEach((e) => {
        e instanceof Hr && (e.visibility = A);
      });
    }
  }
});
const zge = "data:application/javascript;base64,[encoded data, 670444 characters]", Gge = "data:application/wasm;base64,[encoded data, 251712 characters]", Zge = "data:application/javascript;base64,[encoded data, 77872 characters]", C1e = "data:application/octet-stream;base64,[encoded data, 121660 characters]", O1e = "data:application/octet-stream;base64,[encoded data, 353708 characters]", y1e = "data:application/octet-stream;base64,[encoded data, 141940 characters]", k1e = "data:application/octet-stream;base64,[encoded data, 115472 characters]", E1e = "data:application/octet-stream;base64,[encoded data, 152352 characters]", wSe = "data:image/png;base64,[encoded data, 59720 characters]", F1e = "data:image/jpeg;base64,[encoded data, 2554208 characters]", N1e = "data:image/jpeg;base64,[encoded data, 3214848 characters]", Q1e = "data:image/jpeg;base64,[encoded data, 3187948 characters]", Y1e = "data:image/jpeg;base64,[encoded data, 3495340 characters]";
function OF(A, e, t, r) {
  const n = {
    externalResourceFunction: (i) => r(i).then((s) => new Uint8Array(s))
  };
  return t && (n.uri = e === "file:" ? t : e + t), A instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(A), n) : GLTFValidator.validateString(A, n);
}
function _ge() {
  const A = [];
  onmessage = (e) => {
    const t = e.data;
    switch (t.id) {
      case "init": {
        importScripts(t.url);
        break;
      }
      case "validate": {
        OF(t.data, t.rootUrl, t.fileName, (r) => new Promise((n, i) => {
          const s = A.length;
          A.push({ resolve: n, reject: i }), postMessage({ id: "getExternalResource", index: s, uri: r });
        })).then((r) => {
          postMessage({ id: "validate.resolve", value: r });
        }, (r) => {
          postMessage({ id: "validate.reject", reason: r });
        });
        break;
      }
      case "getExternalResource.resolve": {
        A[t.index].resolve(t.value);
        break;
      }
      case "getExternalResource.reject": {
        A[t.index].reject(t.reason);
        break;
      }
    }
  };
}
class M1e {
  /**
   * Validate a glTF asset using the glTF-Validator.
   * @param data The JSON of a glTF or the array buffer of a binary glTF
   * @param rootUrl The root url for the glTF
   * @param fileName The file name for the glTF
   * @param getExternalResource The callback to get external resources for the glTF validator
   * @returns A promise that resolves with the glTF validation results once complete
   */
  static ValidateAsync(e, t, r, n) {
    const i = ArrayBuffer.isView(e) ? e.slice().buffer : e;
    return typeof Worker == "function" ? new Promise((s, a) => {
      const f = `${OF}(${_ge})()`, o = URL.createObjectURL(new Blob([f], { type: "application/javascript" })), d = new Worker(o), v = (l) => {
        d.removeEventListener("error", v), d.removeEventListener("message", u), a(l);
      }, u = (l) => {
        const P = l.data;
        switch (P.id) {
          case "getExternalResource": {
            n(P.uri).then((p) => {
              d.postMessage({ id: "getExternalResource.resolve", index: P.index, value: p }, [p]);
            }, (p) => {
              d.postMessage({ id: "getExternalResource.reject", index: P.index, reason: p });
            });
            break;
          }
          case "validate.resolve": {
            d.removeEventListener("error", v), d.removeEventListener("message", u), s(P.value), d.terminate();
            break;
          }
          case "validate.reject":
            d.removeEventListener("error", v), d.removeEventListener("message", u), a(P.reason), d.terminate();
        }
      };
      d.addEventListener("error", v), d.addEventListener("message", u), d.postMessage({ id: "init", url: ye.GetBabylonScriptURL(this.Configuration.url) }), d.postMessage({ id: "validate", data: i, rootUrl: t, fileName: r });
    }) : (this._LoadScriptPromise || (this._LoadScriptPromise = ye.LoadBabylonScriptAsync(this.Configuration.url)), this._LoadScriptPromise.then(() => OF(i, t, r, n)));
  }
}
M1e.Configuration = {
  url: `${ye._DefaultCdnUrl}/gltf_validator.js`
};
function sZ(A, e, t) {
  try {
    return Promise.resolve(new Uint8Array(A, e, t));
  } catch (r) {
    return Promise.reject(r);
  }
}
function $ge(A, e, t) {
  try {
    if (e < 0 || e >= A.byteLength)
      throw new RangeError("Offset is out of range.");
    if (e + t > A.byteLength)
      throw new RangeError("Length is out of range.");
    return Promise.resolve(new Uint8Array(A.buffer, A.byteOffset + e, t));
  } catch (r) {
    return Promise.reject(r);
  }
}
var AR;
(function(A) {
  A[A.AUTO = 0] = "AUTO", A[A.FORCE_RIGHT_HANDED = 1] = "FORCE_RIGHT_HANDED";
})(AR || (AR = {}));
var qS;
(function(A) {
  A[A.NONE = 0] = "NONE", A[A.FIRST = 1] = "FIRST", A[A.ALL = 2] = "ALL";
})(qS || (qS = {}));
var cc;
(function(A) {
  A[A.LOADING = 0] = "LOADING", A[A.READY = 1] = "READY", A[A.COMPLETE = 2] = "COMPLETE";
})(cc || (cc = {}));
class q1 {
  constructor() {
    this.onParsedObservable = new Oe(), this.coordinateSystemMode = AR.AUTO, this.animationStartMode = qS.FIRST, this.compileMaterials = !1, this.useClipPlane = !1, this.compileShadowGenerators = !1, this.transparencyAsCoverage = !1, this.useRangeRequests = !1, this.createInstances = !0, this.alwaysComputeBoundingBox = !1, this.loadAllMaterials = !1, this.loadOnlyMaterials = !1, this.skipMaterials = !1, this.useSRGBBuffers = !0, this.targetFps = 60, this.alwaysComputeSkeletonRootNode = !1, this.preprocessUrlAsync = (e) => Promise.resolve(e), this.onMeshLoadedObservable = new Oe(), this.onSkinLoadedObservable = new Oe(), this.onTextureLoadedObservable = new Oe(), this.onMaterialLoadedObservable = new Oe(), this.onCameraLoadedObservable = new Oe(), this.onCompleteObservable = new Oe(), this.onErrorObservable = new Oe(), this.onDisposeObservable = new Oe(), this.onExtensionLoadedObservable = new Oe(), this.validate = !1, this.onValidatedObservable = new Oe(), this._loader = null, this._state = null, this._requests = new Array(), this.name = "gltf", this.extensions = {
      ".gltf": { isBinary: !1 },
      ".glb": { isBinary: !0 }
    }, this.onLoaderStateChangedObservable = new Oe(), this._logIndentLevel = 0, this._loggingEnabled = !1, this._log = this._logDisabled, this._capturePerformanceCounters = !1, this._startPerformanceCounter = this._startPerformanceCounterDisabled, this._endPerformanceCounter = this._endPerformanceCounterDisabled;
  }
  /**
   * Raised when the asset has been parsed
   */
  set onParsed(e) {
    this._onParsedObserver && this.onParsedObservable.remove(this._onParsedObserver), this._onParsedObserver = this.onParsedObservable.add(e);
  }
  /**
   * Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.
   * Note that the callback is called as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
   */
  set onMeshLoaded(e) {
    this._onMeshLoadedObserver && this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver), this._onMeshLoadedObserver = this.onMeshLoadedObservable.add(e);
  }
  /**
   * Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
   */
  set onTextureLoaded(e) {
    this._onTextureLoadedObserver && this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver), this._onTextureLoadedObserver = this.onTextureLoadedObservable.add(e);
  }
  /**
   * Callback raised when the loader creates a material after parsing the glTF properties of the material.
   */
  set onMaterialLoaded(e) {
    this._onMaterialLoadedObserver && this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver), this._onMaterialLoadedObserver = this.onMaterialLoadedObservable.add(e);
  }
  /**
   * Callback raised when the loader creates a camera after parsing the glTF properties of the camera.
   */
  set onCameraLoaded(e) {
    this._onCameraLoadedObserver && this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver), this._onCameraLoadedObserver = this.onCameraLoadedObservable.add(e);
  }
  /**
   * Callback raised when the asset is completely loaded, immediately before the loader is disposed.
   * For assets with LODs, raised when all of the LODs are complete.
   * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
   */
  set onComplete(e) {
    this._onCompleteObserver && this.onCompleteObservable.remove(this._onCompleteObserver), this._onCompleteObserver = this.onCompleteObservable.add(e);
  }
  /**
   * Callback raised when an error occurs.
   */
  set onError(e) {
    this._onErrorObserver && this.onErrorObservable.remove(this._onErrorObserver), this._onErrorObserver = this.onErrorObservable.add(e);
  }
  /**
   * Callback raised after the loader is disposed.
   */
  set onDispose(e) {
    this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);
  }
  /**
   * Callback raised after a loader extension is created.
   */
  set onExtensionLoaded(e) {
    this._onExtensionLoadedObserver && this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver), this._onExtensionLoadedObserver = this.onExtensionLoadedObservable.add(e);
  }
  /**
   * Defines if the loader logging is enabled.
   */
  get loggingEnabled() {
    return this._loggingEnabled;
  }
  set loggingEnabled(e) {
    this._loggingEnabled !== e && (this._loggingEnabled = e, this._loggingEnabled ? this._log = this._logEnabled : this._log = this._logDisabled);
  }
  /**
   * Defines if the loader should capture performance counters.
   */
  get capturePerformanceCounters() {
    return this._capturePerformanceCounters;
  }
  set capturePerformanceCounters(e) {
    this._capturePerformanceCounters !== e && (this._capturePerformanceCounters = e, this._capturePerformanceCounters ? (this._startPerformanceCounter = this._startPerformanceCounterEnabled, this._endPerformanceCounter = this._endPerformanceCounterEnabled) : (this._startPerformanceCounter = this._startPerformanceCounterDisabled, this._endPerformanceCounter = this._endPerformanceCounterDisabled));
  }
  /**
   * Callback raised after a loader extension is created.
   */
  set onValidated(e) {
    this._onValidatedObserver && this.onValidatedObservable.remove(this._onValidatedObserver), this._onValidatedObserver = this.onValidatedObservable.add(e);
  }
  /**
   * Disposes the loader, releases resources during load, and cancels any outstanding requests.
   */
  dispose() {
    this._loader && (this._loader.dispose(), this._loader = null);
    for (const e of this._requests)
      e.abort();
    this._requests.length = 0, delete this._progressCallback, this.preprocessUrlAsync = (e) => Promise.resolve(e), this.onMeshLoadedObservable.clear(), this.onSkinLoadedObservable.clear(), this.onTextureLoadedObservable.clear(), this.onMaterialLoadedObservable.clear(), this.onCameraLoadedObservable.clear(), this.onCompleteObservable.clear(), this.onExtensionLoadedObservable.clear(), this.onDisposeObservable.notifyObservers(void 0), this.onDisposeObservable.clear();
  }
  /**
   * @internal
   */
  loadFile(e, t, r, n, i, s, a, f) {
    if (ArrayBuffer.isView(t))
      return this._loadBinary(e, t, r, n, a, f), null;
    this._progressCallback = i;
    const o = t.name || ye.GetFilename(t);
    if (s) {
      if (this.useRangeRequests) {
        this.validate && Se.Warn("glTF validation is not supported when range requests are enabled");
        const d = {
          abort: () => {
          },
          onCompleteObservable: new Oe()
        }, v = {
          readAsync: (u, l) => new Promise((P, p) => {
            this._loadFile(e, t, (c) => {
              P(new Uint8Array(c));
            }, !0, (c) => {
              p(c);
            }, (c) => {
              c.setRequestHeader("Range", `bytes=${u}-${u + l - 1}`);
            });
          }),
          byteLength: 0
        };
        return this._unpackBinaryAsync(new gI(v)).then((u) => {
          d.onCompleteObservable.notifyObservers(d), n(u);
        }, a ? (u) => a(void 0, u) : void 0), d;
      }
      return this._loadFile(e, t, (d) => {
        this._validate(e, new Uint8Array(d), r, o), this._unpackBinaryAsync(new gI({
          readAsync: (v, u) => sZ(d, v, u),
          byteLength: d.byteLength
        })).then((v) => {
          n(v);
        }, a ? (v) => a(void 0, v) : void 0);
      }, !0, a);
    }
    return this._loadFile(e, t, (d) => {
      this._validate(e, new Uint8Array(d), r, o), n({ json: this._parseJson(d) });
    }, s, a);
  }
  _loadBinary(e, t, r, n, i, s) {
    this._validate(e, t, r, s), this._unpackBinaryAsync(new gI({
      readAsync: (a, f) => $ge(t, a, f),
      byteLength: t.byteLength
    })).then((a) => {
      n(a);
    }, i ? (a) => i(void 0, a) : void 0);
  }
  /**
   * @internal
   */
  importMeshAsync(e, t, r, n, i, s) {
    return Promise.resolve().then(() => (this.onParsedObservable.notifyObservers(r), this.onParsedObservable.clear(), this._log(`Loading ${s || ""}`), this._loader = this._getLoader(r), this._loader.importMeshAsync(e, t, null, r, n, i, s)));
  }
  /**
   * @internal
   */
  loadAsync(e, t, r, n, i) {
    return Promise.resolve().then(() => (this.onParsedObservable.notifyObservers(t), this.onParsedObservable.clear(), this._log(`Loading ${i || ""}`), this._loader = this._getLoader(t), this._loader.loadAsync(e, t, r, n, i)));
  }
  /**
   * @internal
   */
  loadAssetContainerAsync(e, t, r, n, i) {
    return Promise.resolve().then(() => {
      this.onParsedObservable.notifyObservers(t), this.onParsedObservable.clear(), this._log(`Loading ${i || ""}`), this._loader = this._getLoader(t);
      const s = new xR(e), a = [];
      this.onMaterialLoadedObservable.add((v) => {
        a.push(v);
      });
      const f = [];
      this.onTextureLoadedObservable.add((v) => {
        f.push(v);
      });
      const o = [];
      this.onCameraLoadedObservable.add((v) => {
        o.push(v);
      });
      const d = [];
      return this.onMeshLoadedObservable.add((v) => {
        v.morphTargetManager && d.push(v.morphTargetManager);
      }), this._loader.importMeshAsync(null, e, s, t, r, n, i).then((v) => (Array.prototype.push.apply(s.geometries, v.geometries), Array.prototype.push.apply(s.meshes, v.meshes), Array.prototype.push.apply(s.particleSystems, v.particleSystems), Array.prototype.push.apply(s.skeletons, v.skeletons), Array.prototype.push.apply(s.animationGroups, v.animationGroups), Array.prototype.push.apply(s.materials, a), Array.prototype.push.apply(s.textures, f), Array.prototype.push.apply(s.lights, v.lights), Array.prototype.push.apply(s.transformNodes, v.transformNodes), Array.prototype.push.apply(s.cameras, o), Array.prototype.push.apply(s.morphTargetManagers, d), s));
    });
  }
  /**
   * @internal
   */
  canDirectLoad(e) {
    return e.indexOf("asset") !== -1 && e.indexOf("version") !== -1 || e.startsWith("data:base64," + q1._MagicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.
    e.startsWith("data:;base64," + q1._MagicBase64Encoded) || e.startsWith("data:application/octet-stream;base64," + q1._MagicBase64Encoded) || e.startsWith("data:model/gltf-binary;base64," + q1._MagicBase64Encoded);
  }
  /**
   * @internal
   */
  directLoad(e, t) {
    if (t.startsWith("base64," + q1._MagicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.
    t.startsWith(";base64," + q1._MagicBase64Encoded) || t.startsWith("application/octet-stream;base64," + q1._MagicBase64Encoded) || t.startsWith("model/gltf-binary;base64," + q1._MagicBase64Encoded)) {
      const r = iU(t);
      return this._validate(e, new Uint8Array(r)), this._unpackBinaryAsync(new gI({
        readAsync: (n, i) => sZ(r, n, i),
        byteLength: r.byteLength
      }));
    }
    return this._validate(e, t), Promise.resolve({ json: this._parseJson(t) });
  }
  /** @internal */
  createPlugin() {
    return new q1();
  }
  /**
   * The loader state or null if the loader is not active.
   */
  get loaderState() {
    return this._state;
  }
  /**
   * Returns a promise that resolves when the asset is completely loaded.
   * @returns a promise that resolves when the asset is completely loaded.
   */
  whenCompleteAsync() {
    return new Promise((e, t) => {
      this.onCompleteObservable.addOnce(() => {
        e();
      }), this.onErrorObservable.addOnce((r) => {
        t(r);
      });
    });
  }
  /**
   * @internal
   */
  _setState(e) {
    this._state !== e && (this._state = e, this.onLoaderStateChangedObservable.notifyObservers(this._state), this._log(cc[this._state]));
  }
  /**
   * @internal
   */
  _loadFile(e, t, r, n, i, s) {
    const a = e._loadFile(t, r, (f) => {
      this._onProgress(f, a);
    }, !0, n, i, s);
    return a.onCompleteObservable.add((f) => {
      this._requests.splice(this._requests.indexOf(f), 1);
    }), this._requests.push(a), a;
  }
  _onProgress(e, t) {
    if (!this._progressCallback)
      return;
    t._lengthComputable = e.lengthComputable, t._loaded = e.loaded, t._total = e.total;
    let r = !0, n = 0, i = 0;
    for (const s of this._requests) {
      if (s._lengthComputable === void 0 || s._loaded === void 0 || s._total === void 0)
        return;
      r = r && s._lengthComputable, n += s._loaded, i += s._total;
    }
    this._progressCallback({
      lengthComputable: r,
      loaded: n,
      total: r ? i : 0
    });
  }
  _validate(e, t, r = "", n = "") {
    this.validate && (this._startPerformanceCounter("Validate JSON"), M1e.ValidateAsync(t, r, n, (i) => this.preprocessUrlAsync(r + i).then((s) => e._loadFileAsync(s, void 0, !0, !0))).then((i) => {
      this._endPerformanceCounter("Validate JSON"), this.onValidatedObservable.notifyObservers(i), this.onValidatedObservable.clear();
    }, (i) => {
      this._endPerformanceCounter("Validate JSON"), ye.Warn(`Failed to validate: ${i.message}`), this.onValidatedObservable.clear();
    }));
  }
  _getLoader(e) {
    const t = e.json.asset || {};
    this._log(`Asset version: ${t.version}`), t.minVersion && this._log(`Asset minimum version: ${t.minVersion}`), t.generator && this._log(`Asset generator: ${t.generator}`);
    const r = q1._parseVersion(t.version);
    if (!r)
      throw new Error("Invalid version: " + t.version);
    if (t.minVersion !== void 0) {
      const s = q1._parseVersion(t.minVersion);
      if (!s)
        throw new Error("Invalid minimum version: " + t.minVersion);
      if (q1._compareVersion(s, { major: 2, minor: 0 }) > 0)
        throw new Error("Incompatible minimum version: " + t.minVersion);
    }
    const i = {
      1: q1._CreateGLTF1Loader,
      2: q1._CreateGLTF2Loader
    }[r.major];
    if (!i)
      throw new Error("Unsupported version: " + t.version);
    return i(this);
  }
  _parseJson(e) {
    this._startPerformanceCounter("Parse JSON"), this._log(`JSON length: ${e.length}`);
    const t = JSON.parse(e);
    return this._endPerformanceCounter("Parse JSON"), t;
  }
  _unpackBinaryAsync(e) {
    return this._startPerformanceCounter("Unpack Binary"), e.loadAsync(20).then(() => {
      const t = {
        Magic: 1179937895
      }, r = e.readUint32();
      if (r !== t.Magic)
        throw new O0("Unexpected magic: " + r, Z2.GLTFLoaderUnexpectedMagicError);
      const n = e.readUint32();
      this.loggingEnabled && this._log(`Binary version: ${n}`);
      const i = e.readUint32();
      !this.useRangeRequests && i !== e.buffer.byteLength && Se.Warn(`Length in header does not match actual data length: ${i} != ${e.buffer.byteLength}`);
      let s;
      switch (n) {
        case 1: {
          s = this._unpackBinaryV1Async(e, i);
          break;
        }
        case 2: {
          s = this._unpackBinaryV2Async(e, i);
          break;
        }
        default:
          throw new Error("Unsupported version: " + n);
      }
      return this._endPerformanceCounter("Unpack Binary"), s;
    });
  }
  _unpackBinaryV1Async(e, t) {
    const r = {
      JSON: 0
    }, n = e.readUint32(), i = e.readUint32();
    if (i !== r.JSON)
      throw new Error(`Unexpected content format: ${i}`);
    const s = t - e.byteOffset, a = { json: this._parseJson(e.readString(n)), bin: null };
    if (s !== 0) {
      const f = e.byteOffset;
      a.bin = {
        readAsync: (o, d) => e.buffer.readAsync(f + o, d),
        byteLength: s
      };
    }
    return Promise.resolve(a);
  }
  _unpackBinaryV2Async(e, t) {
    const r = {
      JSON: 1313821514,
      BIN: 5130562
    }, n = e.readUint32();
    if (e.readUint32() !== r.JSON)
      throw new Error("First chunk format is not JSON");
    return e.byteOffset + n === t ? e.loadAsync(n).then(() => ({ json: this._parseJson(e.readString(n)), bin: null })) : e.loadAsync(n + 8).then(() => {
      const s = { json: this._parseJson(e.readString(n)), bin: null }, a = () => {
        const f = e.readUint32();
        switch (e.readUint32()) {
          case r.JSON:
            throw new Error("Unexpected JSON chunk");
          case r.BIN: {
            const d = e.byteOffset;
            s.bin = {
              readAsync: (v, u) => e.buffer.readAsync(d + v, u),
              byteLength: f
            }, e.skipBytes(f);
            break;
          }
          default: {
            e.skipBytes(f);
            break;
          }
        }
        return e.byteOffset !== t ? e.loadAsync(8).then(a) : Promise.resolve(s);
      };
      return a();
    });
  }
  static _parseVersion(e) {
    if (e === "1.0" || e === "1.0.1")
      return {
        major: 1,
        minor: 0
      };
    const t = (e + "").match(/^(\d+)\.(\d+)/);
    return t ? {
      major: parseInt(t[1]),
      minor: parseInt(t[2])
    } : null;
  }
  static _compareVersion(e, t) {
    return e.major > t.major ? 1 : e.major < t.major ? -1 : e.minor > t.minor ? 1 : e.minor < t.minor ? -1 : 0;
  }
  /**
   * @internal
   */
  _logOpen(e) {
    this._log(e), this._logIndentLevel++;
  }
  /** @internal */
  _logClose() {
    --this._logIndentLevel;
  }
  _logEnabled(e) {
    const t = q1._logSpaces.substr(0, this._logIndentLevel * 2);
    Se.Log(`${t}${e}`);
  }
  _logDisabled(e) {
  }
  _startPerformanceCounterEnabled(e) {
    ye.StartPerformanceCounter(e);
  }
  _startPerformanceCounterDisabled(e) {
  }
  _endPerformanceCounterEnabled(e) {
    ye.EndPerformanceCounter(e);
  }
  _endPerformanceCounterDisabled(e) {
  }
}
q1.IncrementalLoading = !0;
q1.HomogeneousCoordinates = !1;
q1._MagicBase64Encoded = "Z2xURg";
q1._logSpaces = "                                ";
Hn && Hn.RegisterPlugin(new q1());
var iD;
(function(A) {
  A[A.BYTE = 5120] = "BYTE", A[A.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", A[A.SHORT = 5122] = "SHORT", A[A.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", A[A.FLOAT = 5126] = "FLOAT";
})(iD || (iD = {}));
var yF;
(function(A) {
  A[A.FRAGMENT = 35632] = "FRAGMENT", A[A.VERTEX = 35633] = "VERTEX";
})(yF || (yF = {}));
var Yl;
(function(A) {
  A[A.BYTE = 5120] = "BYTE", A[A.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", A[A.SHORT = 5122] = "SHORT", A[A.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", A[A.INT = 5124] = "INT", A[A.UNSIGNED_INT = 5125] = "UNSIGNED_INT", A[A.FLOAT = 5126] = "FLOAT", A[A.FLOAT_VEC2 = 35664] = "FLOAT_VEC2", A[A.FLOAT_VEC3 = 35665] = "FLOAT_VEC3", A[A.FLOAT_VEC4 = 35666] = "FLOAT_VEC4", A[A.INT_VEC2 = 35667] = "INT_VEC2", A[A.INT_VEC3 = 35668] = "INT_VEC3", A[A.INT_VEC4 = 35669] = "INT_VEC4", A[A.BOOL = 35670] = "BOOL", A[A.BOOL_VEC2 = 35671] = "BOOL_VEC2", A[A.BOOL_VEC3 = 35672] = "BOOL_VEC3", A[A.BOOL_VEC4 = 35673] = "BOOL_VEC4", A[A.FLOAT_MAT2 = 35674] = "FLOAT_MAT2", A[A.FLOAT_MAT3 = 35675] = "FLOAT_MAT3", A[A.FLOAT_MAT4 = 35676] = "FLOAT_MAT4", A[A.SAMPLER_2D = 35678] = "SAMPLER_2D";
})(Yl || (Yl = {}));
var II;
(function(A) {
  A[A.CLAMP_TO_EDGE = 33071] = "CLAMP_TO_EDGE", A[A.MIRRORED_REPEAT = 33648] = "MIRRORED_REPEAT", A[A.REPEAT = 10497] = "REPEAT";
})(II || (II = {}));
var _H;
(function(A) {
  A[A.NEAREST = 9728] = "NEAREST", A[A.LINEAR = 9728] = "LINEAR", A[A.NEAREST_MIPMAP_NEAREST = 9984] = "NEAREST_MIPMAP_NEAREST", A[A.LINEAR_MIPMAP_NEAREST = 9985] = "LINEAR_MIPMAP_NEAREST", A[A.NEAREST_MIPMAP_LINEAR = 9986] = "NEAREST_MIPMAP_LINEAR", A[A.LINEAR_MIPMAP_LINEAR = 9987] = "LINEAR_MIPMAP_LINEAR";
})(_H || (_H = {}));
var aZ;
(function(A) {
  A[A.ALPHA = 6406] = "ALPHA", A[A.RGB = 6407] = "RGB", A[A.RGBA = 6408] = "RGBA", A[A.LUMINANCE = 6409] = "LUMINANCE", A[A.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA";
})(aZ || (aZ = {}));
var kF;
(function(A) {
  A[A.FRONT = 1028] = "FRONT", A[A.BACK = 1029] = "BACK", A[A.FRONT_AND_BACK = 1032] = "FRONT_AND_BACK";
})(kF || (kF = {}));
var Hf;
(function(A) {
  A[A.ZERO = 0] = "ZERO", A[A.ONE = 1] = "ONE", A[A.SRC_COLOR = 768] = "SRC_COLOR", A[A.ONE_MINUS_SRC_COLOR = 769] = "ONE_MINUS_SRC_COLOR", A[A.DST_COLOR = 774] = "DST_COLOR", A[A.ONE_MINUS_DST_COLOR = 775] = "ONE_MINUS_DST_COLOR", A[A.SRC_ALPHA = 770] = "SRC_ALPHA", A[A.ONE_MINUS_SRC_ALPHA = 771] = "ONE_MINUS_SRC_ALPHA", A[A.DST_ALPHA = 772] = "DST_ALPHA", A[A.ONE_MINUS_DST_ALPHA = 773] = "ONE_MINUS_DST_ALPHA", A[A.CONSTANT_COLOR = 32769] = "CONSTANT_COLOR", A[A.ONE_MINUS_CONSTANT_COLOR = 32770] = "ONE_MINUS_CONSTANT_COLOR", A[A.CONSTANT_ALPHA = 32771] = "CONSTANT_ALPHA", A[A.ONE_MINUS_CONSTANT_ALPHA = 32772] = "ONE_MINUS_CONSTANT_ALPHA", A[A.SRC_ALPHA_SATURATE = 776] = "SRC_ALPHA_SATURATE";
})(Hf || (Hf = {}));
class j6 {
  /**
   * Sets the given "parameter" matrix
   * @param scene the Scene object
   * @param source the source node where to pick the matrix
   * @param parameter the GLTF technique parameter
   * @param uniformName the name of the shader's uniform
   * @param shaderMaterial the shader material
   */
  static SetMatrix(e, t, r, n, i) {
    let s = null;
    if (r.semantic === "MODEL" ? s = t.getWorldMatrix() : r.semantic === "PROJECTION" ? s = e.getProjectionMatrix() : r.semantic === "VIEW" ? s = e.getViewMatrix() : r.semantic === "MODELVIEWINVERSETRANSPOSE" ? s = he.Transpose(t.getWorldMatrix().multiply(e.getViewMatrix()).invert()) : r.semantic === "MODELVIEW" ? s = t.getWorldMatrix().multiply(e.getViewMatrix()) : r.semantic === "MODELVIEWPROJECTION" ? s = t.getWorldMatrix().multiply(e.getTransformMatrix()) : r.semantic === "MODELINVERSE" ? s = t.getWorldMatrix().invert() : r.semantic === "VIEWINVERSE" ? s = e.getViewMatrix().invert() : r.semantic === "PROJECTIONINVERSE" ? s = e.getProjectionMatrix().invert() : r.semantic === "MODELVIEWINVERSE" ? s = t.getWorldMatrix().multiply(e.getViewMatrix()).invert() : r.semantic === "MODELVIEWPROJECTIONINVERSE" ? s = t.getWorldMatrix().multiply(e.getTransformMatrix()).invert() : r.semantic === "MODELINVERSETRANSPOSE" && (s = he.Transpose(t.getWorldMatrix().invert())), s)
      switch (r.type) {
        case Yl.FLOAT_MAT2:
          i.setMatrix2x2(n, he.GetAsMatrix2x2(s));
          break;
        case Yl.FLOAT_MAT3:
          i.setMatrix3x3(n, he.GetAsMatrix3x3(s));
          break;
        case Yl.FLOAT_MAT4:
          i.setMatrix(n, s);
          break;
      }
  }
  /**
   * Sets the given "parameter" matrix
   * @param shaderMaterial the shader material
   * @param uniform the name of the shader's uniform
   * @param value the value of the uniform
   * @param type the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)
   */
  static SetUniform(e, t, r, n) {
    switch (n) {
      case Yl.FLOAT:
        return e.setFloat(t, r), !0;
      case Yl.FLOAT_VEC2:
        return e.setVector2(t, at.FromArray(r)), !0;
      case Yl.FLOAT_VEC3:
        return e.setVector3(t, S.FromArray(r)), !0;
      case Yl.FLOAT_VEC4:
        return e.setVector4(t, Ir.FromArray(r)), !0;
      default:
        return !1;
    }
  }
  /**
   * Returns the wrap mode of the texture
   * @param mode the mode value
   */
  static GetWrapMode(e) {
    switch (e) {
      case II.CLAMP_TO_EDGE:
        return We.CLAMP_ADDRESSMODE;
      case II.MIRRORED_REPEAT:
        return We.MIRROR_ADDRESSMODE;
      case II.REPEAT:
        return We.WRAP_ADDRESSMODE;
      default:
        return We.WRAP_ADDRESSMODE;
    }
  }
  /**
   * Returns the byte stride giving an accessor
   * @param accessor the GLTF accessor objet
   */
  static GetByteStrideFromType(e) {
    switch (e.type) {
      case "VEC2":
        return 2;
      case "VEC3":
        return 3;
      case "VEC4":
        return 4;
      case "MAT2":
        return 4;
      case "MAT3":
        return 9;
      case "MAT4":
        return 16;
      default:
        return 1;
    }
  }
  /**
   * Returns the texture filter mode giving a mode value
   * @param mode the filter mode value
   * @returns the filter mode (TODO - needs to be a type?)
   */
  static GetTextureFilterMode(e) {
    switch (e) {
      case _H.LINEAR:
      case _H.LINEAR_MIPMAP_NEAREST:
      case _H.LINEAR_MIPMAP_LINEAR:
        return We.TRILINEAR_SAMPLINGMODE;
      case _H.NEAREST:
      case _H.NEAREST_MIPMAP_NEAREST:
        return We.NEAREST_SAMPLINGMODE;
      default:
        return We.BILINEAR_SAMPLINGMODE;
    }
  }
  static GetBufferFromBufferView(e, t, r, n, i) {
    r = t.byteOffset + r;
    const s = e.loadedBufferViews[t.buffer];
    if (r + n > s.byteLength)
      throw new Error("Buffer access is out of range");
    const a = s.buffer;
    switch (r += s.byteOffset, i) {
      case iD.BYTE:
        return new Int8Array(a, r, n);
      case iD.UNSIGNED_BYTE:
        return new Uint8Array(a, r, n);
      case iD.SHORT:
        return new Int16Array(a, r, n);
      case iD.UNSIGNED_SHORT:
        return new Uint16Array(a, r, n);
      default:
        return new Float32Array(a, r, n);
    }
  }
  /**
   * Returns a buffer from its accessor
   * @param gltfRuntime the GLTF runtime
   * @param accessor the GLTF accessor
   */
  static GetBufferFromAccessor(e, t) {
    const r = e.bufferViews[t.bufferView], n = t.count * j6.GetByteStrideFromType(t);
    return j6.GetBufferFromBufferView(e, r, t.byteOffset, n, t.componentType);
  }
  /**
   * Decodes a buffer view into a string
   * @param view the buffer view
   */
  static DecodeBufferToText(e) {
    let t = "";
    const r = e.byteLength;
    for (let n = 0; n < r; ++n)
      t += String.fromCharCode(e[n]);
    return t;
  }
  /**
   * Returns the default material of gltf. Related to
   * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material
   * @param scene the Babylon.js scene
   */
  static GetDefaultMaterial(e) {
    if (!j6._DefaultMaterial) {
      An.ShadersStore.GLTFDefaultMaterialVertexShader = [
        "precision highp float;",
        "",
        "uniform mat4 worldView;",
        "uniform mat4 projection;",
        "",
        "attribute vec3 position;",
        "",
        "void main(void)",
        "{",
        "    gl_Position = projection * worldView * vec4(position, 1.0);",
        "}"
      ].join(`
`), An.ShadersStore.GLTFDefaultMaterialPixelShader = [
        "precision highp float;",
        "",
        "uniform vec4 u_emission;",
        "",
        "void main(void)",
        "{",
        "    gl_FragColor = u_emission;",
        "}"
      ].join(`
`);
      const t = {
        vertex: "GLTFDefaultMaterial",
        fragment: "GLTFDefaultMaterial"
      }, r = {
        attributes: ["position"],
        uniforms: ["worldView", "projection", "u_emission"],
        samplers: new Array(),
        needAlphaBlending: !1
      };
      j6._DefaultMaterial = new Zo("GLTFDefaultMaterial", e, t, r), j6._DefaultMaterial.setColor4("u_emission", new xt(0.5, 0.5, 0.5, 1));
    }
    return j6._DefaultMaterial;
  }
}
j6._DefaultMaterial = null;
var sD;
(function(A) {
  A[A.IDENTIFIER = 1] = "IDENTIFIER", A[A.UNKNOWN = 2] = "UNKNOWN", A[A.END_OF_INPUT = 3] = "END_OF_INPUT";
})(sD || (sD = {}));
class oZ {
  constructor(e) {
    this._pos = 0, this.currentToken = sD.UNKNOWN, this.currentIdentifier = "", this.currentString = "", this.isLetterOrDigitPattern = /^[a-zA-Z0-9]+$/, this._toParse = e, this._maxPos = e.length;
  }
  getNextToken() {
    if (this.isEnd())
      return sD.END_OF_INPUT;
    if (this.currentString = this.read(), this.currentToken = sD.UNKNOWN, this.currentString === "_" || this.isLetterOrDigitPattern.test(this.currentString))
      for (this.currentToken = sD.IDENTIFIER, this.currentIdentifier = this.currentString; !this.isEnd() && (this.isLetterOrDigitPattern.test(this.currentString = this.peek()) || this.currentString === "_"); )
        this.currentIdentifier += this.currentString, this.forward();
    return this.currentToken;
  }
  peek() {
    return this._toParse[this._pos];
  }
  read() {
    return this._toParse[this._pos++];
  }
  forward() {
    this._pos++;
  }
  isEnd() {
    return this._pos >= this._maxPos;
  }
}
const L1e = ["MODEL", "VIEW", "PROJECTION", "MODELVIEW", "MODELVIEWPROJECTION", "JOINTMATRIX"], K1e = ["world", "view", "projection", "worldView", "worldViewProjection", "mBones"], eXe = ["translation", "rotation", "scale"], tXe = ["position", "rotationQuaternion", "scaling"], rXe = (A, e) => {
  for (const t in A) {
    const r = A[t];
    e.buffers[t] = r, e.buffersCount++;
  }
}, nXe = (A, e) => {
  for (const t in A) {
    const r = A[t];
    e.shaders[t] = r, e.shaderscount++;
  }
}, Su = (A, e, t) => {
  for (const r in A) {
    const n = A[r];
    t[e][r] = n;
  }
}, iXe = (A) => {
  if (A)
    for (let e = 0; e < A.length / 2; e++)
      A[e * 2 + 1] = 1 - A[e * 2 + 1];
}, fZ = (A) => {
  if (A.semantic === "NORMAL")
    return "normal";
  if (A.semantic === "POSITION")
    return "position";
  if (A.semantic === "JOINT")
    return "matricesIndices";
  if (A.semantic === "WEIGHT")
    return "matricesWeights";
  if (A.semantic === "COLOR")
    return "color";
  if (A.semantic && A.semantic.indexOf("TEXCOORD_") !== -1) {
    const e = Number(A.semantic.split("_")[1]);
    return "uv" + (e === 0 ? "" : e + 1);
  }
  return null;
}, sXe = (A) => {
  for (const e in A.animations) {
    const t = A.animations[e];
    if (!t.channels || !t.samplers)
      continue;
    let r = null;
    for (let n = 0; n < t.channels.length; n++) {
      const i = t.channels[n], s = t.samplers[i.sampler];
      if (!s)
        continue;
      let a = null, f = null;
      t.parameters ? (a = t.parameters[s.input], f = t.parameters[s.output]) : (a = s.input, f = s.output);
      const o = j6.GetBufferFromAccessor(A, A.accessors[a]), d = j6.GetBufferFromAccessor(A, A.accessors[f]), v = i.target.id;
      let u = A.scene.getNodeById(v);
      if (u === null && (u = A.scene.getNodeByName(v)), u === null) {
        ye.Warn("Creating animation named " + e + ". But cannot find node named " + v + " to attach to");
        continue;
      }
      const l = u instanceof da;
      let P = i.target.path;
      const p = eXe.indexOf(P);
      p !== -1 && (P = tXe[p]);
      let c = st.ANIMATIONTYPE_MATRIX;
      l || (P === "rotationQuaternion" ? (c = st.ANIMATIONTYPE_QUATERNION, u.rotationQuaternion = new Ze()) : c = st.ANIMATIONTYPE_VECTOR3);
      let H = null;
      const T = [];
      let q = 0, b = !1;
      l && r && r.getKeys().length === o.length && (H = r, b = !0), b || (A.scene._blockEntityCollection = !!A.assetContainer, H = new st(e, l ? "_matrix" : P, 1, c, st.ANIMATIONLOOPMODE_CYCLE), A.scene._blockEntityCollection = !1);
      for (let j = 0; j < o.length; j++) {
        let w = null;
        if (P === "rotationQuaternion" ? (w = Ze.FromArray([d[q], d[q + 1], d[q + 2], d[q + 3]]), q += 4) : (w = S.FromArray([d[q], d[q + 1], d[q + 2]]), q += 3), l) {
          const m = u;
          let I = S.Zero(), N = new Ze(), k = S.Zero(), R = m.getBaseMatrix();
          b && r && (R = r.getKeys()[j].value), R.decompose(k, N, I), P === "position" ? I = w : P === "rotationQuaternion" ? N = w : k = w, w = he.Compose(k, N, I);
        }
        b ? r && (r.getKeys()[j].value = w) : T.push({
          frame: o[j],
          value: w
        });
      }
      !b && H && (H.setKeys(T), u.animations.push(H)), r = H, A.scene.stopAnimation(u), A.scene.beginAnimation(u, 0, o[o.length - 1], !0, 1);
    }
  }
}, rM = (A) => {
  let e = null;
  if (A.translation || A.rotation || A.scale) {
    const t = S.FromArray(A.scale || [1, 1, 1]), r = Ze.FromArray(A.rotation || [0, 0, 0, 1]), n = S.FromArray(A.translation || [0, 0, 0]);
    e = he.Compose(t, r, n);
  } else
    e = he.FromArray(A.matrix);
  return e;
}, J1e = (A, e, t, r) => {
  for (let i = 0; i < r.bones.length; i++)
    if (r.bones[i].name === t)
      return r.bones[i];
  const n = A.nodes;
  for (const i in n) {
    const s = n[i];
    if (!s.jointName)
      continue;
    const a = s.children;
    for (let f = 0; f < a.length; f++) {
      const o = A.nodes[a[f]];
      if (o.jointName && o.jointName === t) {
        const d = rM(s), v = new da(s.name || "", r, J1e(A, e, s.jointName, r), d);
        return v.id = i, v;
      }
    }
  }
  return null;
}, aXe = (A, e) => {
  for (let t = 0; t < A.length; t++) {
    const r = A[t];
    for (let n = 0; n < r.node.children.length; n++)
      if (r.node.children[n] === e)
        return r.bone;
  }
  return null;
}, VE = (A, e) => {
  const t = A.nodes;
  let r = t[e];
  if (r)
    return {
      node: r,
      id: e
    };
  for (const n in t)
    if (r = t[n], r.jointName === e)
      return {
        node: r,
        id: n
      };
  return null;
}, oXe = (A, e) => {
  for (let t = 0; t < A.jointNames.length; t++)
    if (A.jointNames[t] === e)
      return !0;
  return !1;
}, fXe = (A, e, t, r) => {
  for (const n in A.nodes) {
    const i = A.nodes[n], s = n;
    if (!i.jointName || oXe(t, i.jointName))
      continue;
    const a = rM(i), f = new da(i.name || "", e, null, a);
    f.id = s, r.push({ bone: f, node: i, id: s });
  }
  for (let n = 0; n < r.length; n++) {
    const i = r[n], s = i.node.children;
    for (let a = 0; a < s.length; a++) {
      let f = null;
      for (let o = 0; o < r.length; o++)
        if (r[o].id === s[a]) {
          f = r[o];
          break;
        }
      f && (f.bone._parent = i.bone, i.bone.children.push(f.bone));
    }
  }
}, AXe = (A, e, t, r) => {
  if (r || (r = new r4(e.name || "", "", A.scene)), !e.babylonSkeleton)
    return r;
  const n = [], i = [];
  fXe(A, r, e, n), r.bones = [];
  for (let a = 0; a < e.jointNames.length; a++) {
    const f = VE(A, e.jointNames[a]);
    if (!f)
      continue;
    const o = f.node;
    if (!o) {
      ye.Warn("Joint named " + e.jointNames[a] + " does not exist");
      continue;
    }
    const d = f.id, v = A.scene.getBoneById(d);
    if (v) {
      r.bones.push(v);
      continue;
    }
    let u = !1, l = null;
    for (let c = 0; c < a; c++) {
      const H = VE(A, e.jointNames[c]);
      if (!H)
        continue;
      const T = H.node;
      if (!T) {
        ye.Warn("Joint named " + e.jointNames[c] + " does not exist when looking for parent");
        continue;
      }
      const q = T.children;
      if (q) {
        u = !1;
        for (let b = 0; b < q.length; b++)
          if (q[b] === d) {
            l = J1e(A, e, e.jointNames[c], r), u = !0;
            break;
          }
        if (u)
          break;
      }
    }
    const P = rM(o);
    !l && n.length > 0 && (l = aXe(n, d), l && i.indexOf(l) === -1 && i.push(l));
    const p = new da(o.jointName || "", r, l, P);
    p.id = d;
  }
  const s = r.bones;
  r.bones = [];
  for (let a = 0; a < e.jointNames.length; a++) {
    const f = VE(A, e.jointNames[a]);
    if (f) {
      for (let o = 0; o < s.length; o++)
        if (s[o].id === f.id) {
          r.bones.push(s[o]);
          break;
        }
    }
  }
  r.prepare();
  for (let a = 0; a < i.length; a++)
    r.bones.push(i[a]);
  return r;
}, AZ = (A, e, t, r, n) => {
  if (n || (A.scene._blockEntityCollection = !!A.assetContainer, n = new Ee(e.name || "", A.scene), n._parentContainer = A.assetContainer, A.scene._blockEntityCollection = !1, n.id = r), !e.babylonNode)
    return n;
  const i = [];
  let s = null;
  const a = [], f = [], o = [], d = [];
  for (let l = 0; l < t.length; l++) {
    const P = t[l], p = A.meshes[P];
    if (p)
      for (let c = 0; c < p.primitives.length; c++) {
        const H = new Ut(), T = p.primitives[c];
        T.mode;
        const q = T.attributes;
        let b = null, j = null;
        for (const m in q)
          if (b = A.accessors[q[m]], j = j6.GetBufferFromAccessor(A, b), m === "NORMAL")
            H.normals = new Float32Array(j.length), H.normals.set(j);
          else if (m === "POSITION") {
            if (q1.HomogeneousCoordinates) {
              H.positions = new Float32Array(j.length - j.length / 4);
              for (let I = 0; I < j.length; I += 4)
                H.positions[I] = j[I], H.positions[I + 1] = j[I + 1], H.positions[I + 2] = j[I + 2];
            } else
              H.positions = new Float32Array(j.length), H.positions.set(j);
            f.push(H.positions.length);
          } else if (m.indexOf("TEXCOORD_") !== -1) {
            const I = Number(m.split("_")[1]), N = J.UVKind + (I === 0 ? "" : I + 1), k = new Float32Array(j.length);
            k.set(j), iXe(k), H.set(k, N);
          } else
            m === "JOINT" ? (H.matricesIndices = new Float32Array(j.length), H.matricesIndices.set(j)) : m === "WEIGHT" ? (H.matricesWeights = new Float32Array(j.length), H.matricesWeights.set(j)) : m === "COLOR" && (H.colors = new Float32Array(j.length), H.colors.set(j));
        if (b = A.accessors[T.indices], b)
          j = j6.GetBufferFromAccessor(A, b), H.indices = new Int32Array(j.length), H.indices.set(j), d.push(H.indices.length);
        else {
          const m = [];
          for (let I = 0; I < H.positions.length / 3; I++)
            m.push(I);
          H.indices = new Int32Array(m), d.push(H.indices.length);
        }
        s ? s.merge(H) : s = H;
        const w = A.scene.getMaterialById(T.material);
        i.push(w === null ? j6.GetDefaultMaterial(A.scene) : w), a.push(a.length === 0 ? 0 : a[a.length - 1] + f[f.length - 2]), o.push(o.length === 0 ? 0 : o[o.length - 1] + d[d.length - 2]);
      }
  }
  let v;
  A.scene._blockEntityCollection = !!A.assetContainer, i.length > 1 ? (v = new Dc("multimat" + r, A.scene), v.subMaterials = i) : v = new Wt("multimat" + r, A.scene), i.length === 1 && (v = i[0]), v._parentContainer = A.assetContainer, n.material || (n.material = v), new Tf(r, A.scene, s, !1, n), n.computeWorldMatrix(!0), A.scene._blockEntityCollection = !1, n.subMeshes = [];
  let u = 0;
  for (let l = 0; l < t.length; l++) {
    const P = t[l], p = A.meshes[P];
    if (p)
      for (let c = 0; c < p.primitives.length; c++)
        p.primitives[c].mode, rA.AddToMesh(u, a[u], f[u], o[u], d[u], n, n, !0), u++;
  }
  return n;
}, EF = (A, e, t, r) => {
  A.position && (A.position = e), (A.rotationQuaternion || A.rotation) && (A.rotationQuaternion = t), A.scaling && (A.scaling = r);
}, dXe = (A, e) => {
  if (e.matrix) {
    const t = new S(0, 0, 0), r = new Ze(), n = new S(0, 0, 0);
    he.FromArray(e.matrix).decompose(n, r, t), EF(A, t, r, n);
  } else
    e.translation && e.rotation && e.scale && EF(A, S.FromArray(e.translation), Ze.FromArray(e.rotation), S.FromArray(e.scale));
  A.computeWorldMatrix(!0);
}, vXe = (A, e, t) => {
  let r = null;
  if (A.importOnlyMeshes && (e.skin || e.meshes) && A.importMeshesNames && A.importMeshesNames.length > 0 && A.importMeshesNames.indexOf(e.name || "") === -1)
    return null;
  if (e.skin) {
    if (e.meshes) {
      const n = A.skins[e.skin], i = AZ(A, e, e.meshes, t, e.babylonNode);
      i.skeleton = A.scene.getLastSkeletonById(e.skin), i.skeleton === null && (i.skeleton = AXe(A, n, i, n.babylonSkeleton), n.babylonSkeleton || (n.babylonSkeleton = i.skeleton)), r = i;
    }
  } else if (e.meshes)
    r = AZ(A, e, e.mesh ? [e.mesh] : e.meshes, t, e.babylonNode);
  else if (e.light && !e.babylonNode && !A.importOnlyMeshes) {
    const n = A.lights[e.light];
    if (n) {
      if (n.type === "ambient") {
        const i = n[n.type], s = new y0(e.light, S.Zero(), A.scene);
        s.name = e.name || "", i.color && (s.diffuse = Ne.FromArray(i.color)), r = s;
      } else if (n.type === "directional") {
        const i = n[n.type], s = new IA(e.light, S.Zero(), A.scene);
        s.name = e.name || "", i.color && (s.diffuse = Ne.FromArray(i.color)), r = s;
      } else if (n.type === "point") {
        const i = n[n.type], s = new ag(e.light, S.Zero(), A.scene);
        s.name = e.name || "", i.color && (s.diffuse = Ne.FromArray(i.color)), r = s;
      } else if (n.type === "spot") {
        const i = n[n.type], s = new nA(e.light, S.Zero(), S.Zero(), 0, 0, A.scene);
        s.name = e.name || "", i.color && (s.diffuse = Ne.FromArray(i.color)), i.fallOfAngle && (s.angle = i.fallOfAngle), i.fallOffExponent && (s.exponent = i.fallOffExponent), r = s;
      }
    }
  } else if (e.camera && !e.babylonNode && !A.importOnlyMeshes) {
    const n = A.cameras[e.camera];
    if (n) {
      if (A.scene._blockEntityCollection = !!A.assetContainer, n.type === "orthographic") {
        const i = new SA(e.camera, S.Zero(), A.scene, !1);
        i.name = e.name || "", i.mode = Tr.ORTHOGRAPHIC_CAMERA, i.attachControl(), r = i, i._parentContainer = A.assetContainer;
      } else if (n.type === "perspective") {
        const i = n[n.type], s = new SA(e.camera, S.Zero(), A.scene, !1);
        s.name = e.name || "", s.attachControl(), i.aspectRatio || (i.aspectRatio = A.scene.getEngine().getRenderWidth() / A.scene.getEngine().getRenderHeight()), i.znear && i.zfar && (s.maxZ = i.zfar, s.minZ = i.znear), r = s, s._parentContainer = A.assetContainer;
      }
      A.scene._blockEntityCollection = !1;
    }
  }
  if (!e.jointName) {
    if (e.babylonNode)
      return e.babylonNode;
    if (r === null) {
      A.scene._blockEntityCollection = !!A.assetContainer;
      const n = new Ee(e.name || "", A.scene);
      n._parentContainer = A.assetContainer, A.scene._blockEntityCollection = !1, e.babylonNode = n, r = n;
    }
  }
  if (r !== null) {
    if (e.matrix && r instanceof Ee)
      dXe(r, e);
    else {
      const n = e.translation || [0, 0, 0], i = e.rotation || [0, 0, 0, 1], s = e.scale || [1, 1, 1];
      EF(r, S.FromArray(n), Ze.FromArray(i), S.FromArray(s));
    }
    r.updateCache(!0), e.babylonNode = r;
  }
  return r;
}, dR = (A, e, t, r = !1) => {
  const n = A.nodes[e];
  let i = null;
  if (A.importOnlyMeshes && !r && A.importMeshesNames ? A.importMeshesNames.indexOf(n.name || "") !== -1 || A.importMeshesNames.length === 0 ? r = !0 : r = !1 : r = !0, !n.jointName && r && (i = vXe(A, n, e), i !== null && (i.id = e, i.parent = t)), n.children)
    for (let s = 0; s < n.children.length; s++)
      dR(A, n.children[s], i, r);
}, dZ = (A) => {
  let e = A.currentScene;
  if (e)
    for (let t = 0; t < e.nodes.length; t++)
      dR(A, e.nodes[t], null);
  else
    for (const t in A.scenes) {
      e = A.scenes[t];
      for (let r = 0; r < e.nodes.length; r++)
        dR(A, e.nodes[r], null);
    }
  sXe(A);
  for (let t = 0; t < A.scene.skeletons.length; t++) {
    const r = A.scene.skeletons[t];
    A.scene.beginAnimation(r, 0, Number.MAX_VALUE, !0, 1);
  }
}, uXe = (A, e, t, r, n, i, s) => {
  const a = i.values || n.parameters;
  for (const f in t) {
    const o = t[f], d = o.type;
    if (d === Yl.FLOAT_MAT2 || d === Yl.FLOAT_MAT3 || d === Yl.FLOAT_MAT4) {
      if (o.semantic && !o.source && !o.node)
        j6.SetMatrix(e.scene, A, o, f, r.getEffect());
      else if (o.semantic && (o.source || o.node)) {
        let v = e.scene.getNodeByName(o.source || o.node || "");
        if (v === null && (v = e.scene.getNodeById(o.source || o.node || "")), v === null)
          continue;
        j6.SetMatrix(e.scene, v, o, f, r.getEffect());
      }
    } else {
      const v = a[n.uniforms[f]];
      if (!v)
        continue;
      if (d === Yl.SAMPLER_2D) {
        const u = e.textures[i.values ? v : o.value].babylonTexture;
        if (u == null)
          continue;
        r.getEffect().setTexture(f, u);
      } else
        j6.SetUniform(r.getEffect(), f, v, d);
    }
  }
  s(r);
}, lXe = (A, e, t, r, n) => {
  const i = r.values || t.parameters, s = t.uniforms;
  for (const a in n) {
    const f = n[a], o = f.type;
    let d = i[s[a]];
    if (d === void 0 && (d = f.value), !d)
      continue;
    const v = (u) => (l) => {
      f.value && u && (e.setTexture(u, l), delete n[u]);
    };
    o === Yl.SAMPLER_2D ? od.LoadTextureAsync(A, r.values ? d : f.value, v(a), () => v(null)) : f.value && j6.SetUniform(e, a, r.values ? d : f.value, o) && delete n[a];
  }
}, PXe = (A, e, t) => (r, n) => {
  e.dispose(!0), t("Cannot compile program named " + A.name + ". Error: " + n + ". Default material will be applied");
}, cXe = (A, e, t, r, n, i) => (s) => {
  lXe(A, e, t, r, n), e.onBind = (a) => {
    uXe(a, A, n, e, t, r, i);
  };
}, vZ = (A, e, t) => {
  for (const r in e.uniforms) {
    const n = e.uniforms[r], i = e.parameters[n];
    if (A.currentIdentifier === r && i.semantic && !i.source && !i.node) {
      const s = L1e.indexOf(i.semantic);
      if (s !== -1)
        return delete t[r], K1e[s];
    }
  }
  return A.currentIdentifier;
}, uZ = (A) => {
  for (const e in A.materials)
    od.LoadMaterialAsync(A, e, () => {
    }, () => {
    });
};
class eq {
  static CreateRuntime(e, t, r) {
    const n = {
      extensions: {},
      accessors: {},
      buffers: {},
      bufferViews: {},
      meshes: {},
      lights: {},
      cameras: {},
      nodes: {},
      images: {},
      textures: {},
      shaders: {},
      programs: {},
      samplers: {},
      techniques: {},
      materials: {},
      animations: {},
      skins: {},
      extensionsUsed: [],
      scenes: {},
      buffersCount: 0,
      shaderscount: 0,
      scene: t,
      rootUrl: r,
      loadedBufferCount: 0,
      loadedBufferViews: {},
      loadedShaderCount: 0,
      importOnlyMeshes: !1,
      dummyNodes: [],
      assetContainer: null
    };
    return e.extensions && Su(e.extensions, "extensions", n), e.extensionsUsed && Su(e.extensionsUsed, "extensionsUsed", n), e.buffers && rXe(e.buffers, n), e.bufferViews && Su(e.bufferViews, "bufferViews", n), e.accessors && Su(e.accessors, "accessors", n), e.meshes && Su(e.meshes, "meshes", n), e.lights && Su(e.lights, "lights", n), e.cameras && Su(e.cameras, "cameras", n), e.nodes && Su(e.nodes, "nodes", n), e.images && Su(e.images, "images", n), e.textures && Su(e.textures, "textures", n), e.shaders && nXe(e.shaders, n), e.programs && Su(e.programs, "programs", n), e.samplers && Su(e.samplers, "samplers", n), e.techniques && Su(e.techniques, "techniques", n), e.materials && Su(e.materials, "materials", n), e.animations && Su(e.animations, "animations", n), e.skins && Su(e.skins, "skins", n), e.scenes && (n.scenes = e.scenes), e.scene && e.scenes && (n.currentScene = e.scenes[e.scene]), n;
  }
  static LoadBufferAsync(e, t, r, n, i) {
    const s = e.buffers[t];
    ye.IsBase64(s.uri) ? setTimeout(() => r(new Uint8Array(ye.DecodeBase64(s.uri)))) : ye.LoadFile(e.rootUrl + s.uri, (a) => r(new Uint8Array(a)), i, void 0, !0, (a) => {
      a && n(a.status + " " + a.statusText);
    });
  }
  static LoadTextureBufferAsync(e, t, r, n) {
    const i = e.textures[t];
    if (!i || !i.source) {
      n("");
      return;
    }
    if (i.babylonTexture) {
      r(null);
      return;
    }
    const s = e.images[i.source];
    ye.IsBase64(s.uri) ? setTimeout(() => r(new Uint8Array(ye.DecodeBase64(s.uri)))) : ye.LoadFile(e.rootUrl + s.uri, (a) => r(new Uint8Array(a)), void 0, void 0, !0, (a) => {
      a && n(a.status + " " + a.statusText);
    });
  }
  static CreateTextureAsync(e, t, r, n) {
    const i = e.textures[t];
    if (i.babylonTexture) {
      n(i.babylonTexture);
      return;
    }
    const s = e.samplers[i.sampler], a = s.minFilter === _H.NEAREST_MIPMAP_NEAREST || s.minFilter === _H.NEAREST_MIPMAP_LINEAR || s.minFilter === _H.LINEAR_MIPMAP_NEAREST || s.minFilter === _H.LINEAR_MIPMAP_LINEAR, f = We.BILINEAR_SAMPLINGMODE, o = r == null ? new Blob() : new Blob([r]), d = URL.createObjectURL(o), v = () => URL.revokeObjectURL(d), u = new We(d, e.scene, !a, !0, f, v, v);
    s.wrapS !== void 0 && (u.wrapU = j6.GetWrapMode(s.wrapS)), s.wrapT !== void 0 && (u.wrapV = j6.GetWrapMode(s.wrapT)), u.name = t, i.babylonTexture = u, n(u);
  }
  static LoadShaderStringAsync(e, t, r, n) {
    const i = e.shaders[t];
    if (ye.IsBase64(i.uri)) {
      const s = atob(i.uri.split(",")[1]);
      r && r(s);
    } else
      ye.LoadFile(e.rootUrl + i.uri, r, void 0, void 0, !1, (s) => {
        s && n && n(s.status + " " + s.statusText);
      });
  }
  static LoadMaterialAsync(e, t, r, n) {
    const i = e.materials[t];
    if (!i.technique) {
      n && n("No technique found.");
      return;
    }
    const s = e.techniques[i.technique];
    if (!s) {
      e.scene._blockEntityCollection = !!e.assetContainer;
      const w = new Wt(t, e.scene);
      w._parentContainer = e.assetContainer, e.scene._blockEntityCollection = !1, w.diffuseColor = new Ne(0.5, 0.5, 0.5), w.sideOrientation = gt.CounterClockWiseSideOrientation, r(w);
      return;
    }
    const a = e.programs[s.program], f = s.states, o = An.ShadersStore[a.vertexShader + "VertexShader"], d = An.ShadersStore[a.fragmentShader + "PixelShader"];
    let v = "", u = "";
    const l = new oZ(o), P = new oZ(d), p = {}, c = [], H = [], T = [];
    for (const w in s.uniforms) {
      const m = s.uniforms[w], I = s.parameters[m];
      if (p[w] = I, I.semantic && !I.node && !I.source) {
        const N = L1e.indexOf(I.semantic);
        N !== -1 ? (c.push(K1e[N]), delete p[w]) : c.push(w);
      } else
        I.type === Yl.SAMPLER_2D ? T.push(w) : c.push(w);
    }
    for (const w in s.attributes) {
      const m = s.attributes[w], I = s.parameters[m];
      if (I.semantic) {
        const N = fZ(I);
        N && H.push(N);
      }
    }
    for (; !l.isEnd() && l.getNextToken(); ) {
      if (l.currentToken !== sD.IDENTIFIER) {
        v += l.currentString;
        continue;
      }
      let m = !1;
      for (const I in s.attributes) {
        const N = s.attributes[I], k = s.parameters[N];
        if (l.currentIdentifier === I && k.semantic) {
          v += fZ(k), m = !0;
          break;
        }
      }
      m || (v += vZ(l, s, p));
    }
    for (; !P.isEnd() && P.getNextToken(); ) {
      if (P.currentToken !== sD.IDENTIFIER) {
        u += P.currentString;
        continue;
      }
      u += vZ(P, s, p);
    }
    const q = {
      vertex: a.vertexShader + t,
      fragment: a.fragmentShader + t
    }, b = {
      attributes: H,
      uniforms: c,
      samplers: T,
      needAlphaBlending: f && f.enable && f.enable.indexOf(3042) !== -1
    };
    An.ShadersStore[a.vertexShader + t + "VertexShader"] = v, An.ShadersStore[a.fragmentShader + t + "PixelShader"] = u;
    const j = new Zo(t, e.scene, q, b);
    if (j.onError = PXe(a, j, n), j.onCompiled = cXe(e, j, s, i, p, r), j.sideOrientation = gt.CounterClockWiseSideOrientation, f && f.functions) {
      const w = f.functions;
      w.cullFace && w.cullFace[0] !== kF.BACK && (j.backFaceCulling = !1);
      const m = w.blendFuncSeparate;
      m && (m[0] === Hf.SRC_ALPHA && m[1] === Hf.ONE_MINUS_SRC_ALPHA && m[2] === Hf.ONE && m[3] === Hf.ONE ? j.alphaMode = et.ALPHA_COMBINE : m[0] === Hf.ONE && m[1] === Hf.ONE && m[2] === Hf.ZERO && m[3] === Hf.ONE ? j.alphaMode = et.ALPHA_ONEONE : m[0] === Hf.SRC_ALPHA && m[1] === Hf.ONE && m[2] === Hf.ZERO && m[3] === Hf.ONE ? j.alphaMode = et.ALPHA_ADD : m[0] === Hf.ZERO && m[1] === Hf.ONE_MINUS_SRC_COLOR && m[2] === Hf.ONE && m[3] === Hf.ONE ? j.alphaMode = et.ALPHA_SUBTRACT : m[0] === Hf.DST_COLOR && m[1] === Hf.ZERO && m[2] === Hf.ONE && m[3] === Hf.ONE ? j.alphaMode = et.ALPHA_MULTIPLY : m[0] === Hf.SRC_ALPHA && m[1] === Hf.ONE_MINUS_SRC_COLOR && m[2] === Hf.ONE && m[3] === Hf.ONE && (j.alphaMode = et.ALPHA_MAXIMIZED));
    }
  }
}
let zS = class FF {
  static RegisterExtension(e) {
    if (FF.Extensions[e.name]) {
      ye.Error('Tool with the same name "' + e.name + '" already exists');
      return;
    }
    FF.Extensions[e.name] = e;
  }
  dispose() {
  }
  _importMeshAsync(e, t, r, n, i, s, a, f) {
    return t.useRightHandedSystem = !0, od.LoadRuntimeAsync(t, r, n, (o) => {
      o.assetContainer = i, o.importOnlyMeshes = !0, e === "" ? o.importMeshesNames = [] : typeof e == "string" ? o.importMeshesNames = [e] : e && !(e instanceof Array) ? o.importMeshesNames = [e] : (o.importMeshesNames = [], ye.Warn("Argument meshesNames must be of type string or string[]")), this._createNodes(o);
      const d = [], v = [];
      for (const u in o.nodes) {
        const l = o.nodes[u];
        l.babylonNode instanceof jn && d.push(l.babylonNode);
      }
      for (const u in o.skins) {
        const l = o.skins[u];
        l.babylonSkeleton instanceof r4 && v.push(l.babylonSkeleton);
      }
      this._loadBuffersAsync(o, () => {
        this._loadShadersAsync(o, () => {
          uZ(o), dZ(o), !q1.IncrementalLoading && s && s(d, v);
        });
      }), q1.IncrementalLoading && s && s(d, v);
    }, f), !0;
  }
  /**
   * Imports one or more meshes from a loaded gltf file and adds them to the scene
   * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
   * @param scene the scene the meshes should be added to
   * @param assetContainer defines the asset container to use (can be null)
   * @param data gltf data containing information of the meshes in a loaded file
   * @param rootUrl root url to load from
   * @param onProgress event that fires when loading progress has occured
   * @returns a promise containg the loaded meshes, particles, skeletons and animations
   */
  importMeshAsync(e, t, r, n, i, s) {
    return new Promise((a, f) => {
      this._importMeshAsync(e, t, n, i, r, (o, d) => {
        a({
          meshes: o,
          particleSystems: [],
          skeletons: d,
          animationGroups: [],
          lights: [],
          transformNodes: [],
          geometries: []
        });
      }, s, (o) => {
        f(new Error(o));
      });
    });
  }
  _loadAsync(e, t, r, n, i, s) {
    e.useRightHandedSystem = !0, od.LoadRuntimeAsync(e, t, r, (a) => {
      od.LoadRuntimeExtensionsAsync(a, () => {
        this._createNodes(a), this._loadBuffersAsync(a, () => {
          this._loadShadersAsync(a, () => {
            uZ(a), dZ(a), q1.IncrementalLoading || n();
          });
        }), q1.IncrementalLoading && n();
      }, s);
    }, s);
  }
  /**
   * Imports all objects from a loaded gltf file and adds them to the scene
   * @param scene the scene the objects should be added to
   * @param data gltf data containing information of the meshes in a loaded file
   * @param rootUrl root url to load from
   * @param onProgress event that fires when loading progress has occured
   * @returns a promise which completes when objects have been loaded to the scene
   */
  loadAsync(e, t, r, n) {
    return new Promise((i, s) => {
      this._loadAsync(e, t, r, () => {
        i();
      }, n, (a) => {
        s(new Error(a));
      });
    });
  }
  _loadShadersAsync(e, t) {
    let r = !1;
    const n = (i, s) => {
      od.LoadShaderStringAsync(e, i, (a) => {
        a instanceof ArrayBuffer || (e.loadedShaderCount++, a && (An.ShadersStore[i + (s.type === yF.VERTEX ? "VertexShader" : "PixelShader")] = a), e.loadedShaderCount === e.shaderscount && t());
      }, () => {
        ye.Error("Error when loading shader program named " + i + " located at " + s.uri);
      });
    };
    for (const i in e.shaders) {
      r = !0;
      const s = e.shaders[i];
      s ? n.bind(this, i, s)() : ye.Error("No shader named: " + i);
    }
    r || t();
  }
  _loadBuffersAsync(e, t) {
    let r = !1;
    const n = (i, s) => {
      od.LoadBufferAsync(e, i, (a) => {
        e.loadedBufferCount++, a && (a.byteLength != e.buffers[i].byteLength && ye.Error("Buffer named " + i + " is length " + a.byteLength + ". Expected: " + s.byteLength), e.loadedBufferViews[i] = a), e.loadedBufferCount === e.buffersCount && t();
      }, () => {
        ye.Error("Error when loading buffer named " + i + " located at " + s.uri);
      });
    };
    for (const i in e.buffers) {
      r = !0;
      const s = e.buffers[i];
      s ? n.bind(this, i, s)() : ye.Error("No buffer named: " + i);
    }
    r || t();
  }
  _createNodes(e) {
    let t = e.currentScene;
    if (t)
      for (let r = 0; r < t.nodes.length; r++)
        dR(e, t.nodes[r], null);
    else
      for (const r in e.scenes) {
        t = e.scenes[r];
        for (let n = 0; n < t.nodes.length; n++)
          dR(e, t.nodes[n], null);
      }
  }
};
zS.Extensions = {};
class od {
  constructor(e) {
    this._name = e;
  }
  get name() {
    return this._name;
  }
  /**
   * Defines an override for loading the runtime
   * Return true to stop further extensions from loading the runtime
   * @param scene
   * @param data
   * @param rootUrl
   * @param onSuccess
   * @param onError
   */
  loadRuntimeAsync(e, t, r, n, i) {
    return !1;
  }
  /**
   * Defines an onverride for creating gltf runtime
   * Return true to stop further extensions from creating the runtime
   * @param gltfRuntime
   * @param onSuccess
   * @param onError
   */
  loadRuntimeExtensionsAsync(e, t, r) {
    return !1;
  }
  /**
   * Defines an override for loading buffers
   * Return true to stop further extensions from loading this buffer
   * @param gltfRuntime
   * @param id
   * @param onSuccess
   * @param onError
   * @param onProgress
   */
  loadBufferAsync(e, t, r, n, i) {
    return !1;
  }
  /**
   * Defines an override for loading texture buffers
   * Return true to stop further extensions from loading this texture data
   * @param gltfRuntime
   * @param id
   * @param onSuccess
   * @param onError
   */
  loadTextureBufferAsync(e, t, r, n) {
    return !1;
  }
  /**
   * Defines an override for creating textures
   * Return true to stop further extensions from loading this texture
   * @param gltfRuntime
   * @param id
   * @param buffer
   * @param onSuccess
   * @param onError
   */
  createTextureAsync(e, t, r, n, i) {
    return !1;
  }
  /**
   * Defines an override for loading shader strings
   * Return true to stop further extensions from loading this shader data
   * @param gltfRuntime
   * @param id
   * @param onSuccess
   * @param onError
   */
  loadShaderStringAsync(e, t, r, n) {
    return !1;
  }
  /**
   * Defines an override for loading materials
   * Return true to stop further extensions from loading this material
   * @param gltfRuntime
   * @param id
   * @param onSuccess
   * @param onError
   */
  loadMaterialAsync(e, t, r, n) {
    return !1;
  }
  // ---------
  // Utilities
  // ---------
  static LoadRuntimeAsync(e, t, r, n, i) {
    od._ApplyExtensions((s) => s.loadRuntimeAsync(e, t, r, n, i), () => {
      setTimeout(() => {
        n && n(eq.CreateRuntime(t.json, e, r));
      });
    });
  }
  static LoadRuntimeExtensionsAsync(e, t, r) {
    od._ApplyExtensions((n) => n.loadRuntimeExtensionsAsync(e, t, r), () => {
      setTimeout(() => {
        t();
      });
    });
  }
  static LoadBufferAsync(e, t, r, n, i) {
    od._ApplyExtensions((s) => s.loadBufferAsync(e, t, r, n, i), () => {
      eq.LoadBufferAsync(e, t, r, n, i);
    });
  }
  static LoadTextureAsync(e, t, r, n) {
    od._LoadTextureBufferAsync(e, t, (i) => {
      i && od._CreateTextureAsync(e, t, i, r, n);
    }, n);
  }
  static LoadShaderStringAsync(e, t, r, n) {
    od._ApplyExtensions((i) => i.loadShaderStringAsync(e, t, r, n), () => {
      eq.LoadShaderStringAsync(e, t, r, n);
    });
  }
  static LoadMaterialAsync(e, t, r, n) {
    od._ApplyExtensions((i) => i.loadMaterialAsync(e, t, r, n), () => {
      eq.LoadMaterialAsync(e, t, r, n);
    });
  }
  static _LoadTextureBufferAsync(e, t, r, n) {
    od._ApplyExtensions((i) => i.loadTextureBufferAsync(e, t, r, n), () => {
      eq.LoadTextureBufferAsync(e, t, r, n);
    });
  }
  static _CreateTextureAsync(e, t, r, n, i) {
    od._ApplyExtensions((s) => s.createTextureAsync(e, t, r, n, i), () => {
      eq.CreateTextureAsync(e, t, r, n);
    });
  }
  static _ApplyExtensions(e, t) {
    for (const r in zS.Extensions) {
      const n = zS.Extensions[r];
      if (e(n))
        return;
    }
    t();
  }
}
q1._CreateGLTF1Loader = () => new zS();
const pXe = "binary_glTF";
class hXe extends od {
  constructor() {
    super("KHR_binary_glTF");
  }
  loadRuntimeAsync(e, t, r, n) {
    const i = t.json.extensionsUsed;
    return !i || i.indexOf(this.name) === -1 || !t.bin ? !1 : (this._bin = t.bin, n(eq.CreateRuntime(t.json, e, r)), !0);
  }
  loadBufferAsync(e, t, r, n) {
    return e.extensionsUsed.indexOf(this.name) === -1 || t !== pXe ? !1 : (this._bin.readAsync(0, this._bin.byteLength).then(r, (i) => n(i.message)), !0);
  }
  loadTextureBufferAsync(e, t, r) {
    const n = e.textures[t], i = e.images[n.source];
    if (!i.extensions || !(this.name in i.extensions))
      return !1;
    const s = i.extensions[this.name], a = e.bufferViews[s.bufferView], f = j6.GetBufferFromBufferView(e, a, 0, a.byteLength, iD.UNSIGNED_BYTE);
    return r(f), !0;
  }
  loadShaderStringAsync(e, t, r) {
    const n = e.shaders[t];
    if (!n.extensions || !(this.name in n.extensions))
      return !1;
    const i = n.extensions[this.name], s = e.bufferViews[i.bufferView], a = j6.GetBufferFromBufferView(e, s, 0, s.byteLength, iD.UNSIGNED_BYTE);
    return setTimeout(() => {
      const f = j6.DecodeBufferToText(a);
      r(f);
    }), !0;
  }
}
zS.RegisterExtension(new hXe());
class HXe extends od {
  constructor() {
    super("KHR_materials_common");
  }
  loadRuntimeExtensionsAsync(e) {
    if (!e.extensions)
      return !1;
    const t = e.extensions[this.name];
    if (!t)
      return !1;
    const r = t.lights;
    if (r)
      for (const n in r) {
        const i = r[n];
        switch (i.type) {
          case "ambient": {
            const s = new y0(i.name, new S(0, 1, 0), e.scene), a = i.ambient;
            a && (s.diffuse = Ne.FromArray(a.color || [1, 1, 1]));
            break;
          }
          case "point": {
            const s = new ag(i.name, new S(10, 10, 10), e.scene), a = i.point;
            a && (s.diffuse = Ne.FromArray(a.color || [1, 1, 1]));
            break;
          }
          case "directional": {
            const s = new IA(i.name, new S(0, -1, 0), e.scene), a = i.directional;
            a && (s.diffuse = Ne.FromArray(a.color || [1, 1, 1]));
            break;
          }
          case "spot": {
            const s = i.spot;
            if (s) {
              const a = new nA(i.name, new S(0, 10, 0), new S(0, -1, 0), s.fallOffAngle || Math.PI, s.fallOffExponent || 0, e.scene);
              a.diffuse = Ne.FromArray(s.color || [1, 1, 1]);
            }
            break;
          }
          default:
            ye.Warn('GLTF Material Common extension: light type "' + i.type + "” not supported");
            break;
        }
      }
    return !1;
  }
  loadMaterialAsync(e, t, r, n) {
    const i = e.materials[t];
    if (!i || !i.extensions)
      return !1;
    const s = i.extensions[this.name];
    if (!s)
      return !1;
    const a = new Wt(t, e.scene);
    return a.sideOrientation = gt.CounterClockWiseSideOrientation, s.technique === "CONSTANT" && (a.disableLighting = !0), a.backFaceCulling = s.doubleSided === void 0 ? !1 : !s.doubleSided, a.alpha = s.values.transparency === void 0 ? 1 : s.values.transparency, a.specularPower = s.values.shininess === void 0 ? 0 : s.values.shininess, typeof s.values.ambient == "string" ? this._loadTexture(e, s.values.ambient, a, "ambientTexture", n) : a.ambientColor = Ne.FromArray(s.values.ambient || [0, 0, 0]), typeof s.values.diffuse == "string" ? this._loadTexture(e, s.values.diffuse, a, "diffuseTexture", n) : a.diffuseColor = Ne.FromArray(s.values.diffuse || [0, 0, 0]), typeof s.values.emission == "string" ? this._loadTexture(e, s.values.emission, a, "emissiveTexture", n) : a.emissiveColor = Ne.FromArray(s.values.emission || [0, 0, 0]), typeof s.values.specular == "string" ? this._loadTexture(e, s.values.specular, a, "specularTexture", n) : a.specularColor = Ne.FromArray(s.values.specular || [0, 0, 0]), !0;
  }
  _loadTexture(e, t, r, n, i) {
    eq.LoadTextureBufferAsync(e, t, (s) => {
      eq.CreateTextureAsync(e, t, s, (a) => r[n] = a);
    }, i);
  }
}
zS.RegisterExtension(new HXe());
function lZ(A, e, t, r) {
  return S.FromArray(e, t).scaleInPlace(r);
}
function gXe(A, e, t, r) {
  return Ze.FromArray(e, t).scaleInPlace(r);
}
function XXe(A, e, t, r) {
  const n = new Array(A._numMorphTargets);
  for (let i = 0; i < n.length; i++)
    n[i] = e[t++] * r;
  return n;
}
class HV {
  /** @internal */
  constructor(e, t, r, n) {
    this.type = e, this.name = t, this.getValue = r, this.getStride = n;
  }
  _buildAnimation(e, t, r) {
    const n = new st(e, this.name, t, this.type);
    return n.setKeys(r), n;
  }
}
class CE extends HV {
  /** @internal */
  buildAnimations(e, t, r, n, i) {
    i(e._babylonTransformNode, this._buildAnimation(t, r, n));
  }
}
class TXe extends HV {
  buildAnimations(e, t, r, n, i) {
    if (e._numMorphTargets)
      for (let s = 0; s < e._numMorphTargets; s++) {
        const a = new st(`${t}_${s}`, this.name, r, this.type);
        if (a.setKeys(n.map((f) => ({
          frame: f.frame,
          inTangent: f.inTangent ? f.inTangent[s] : void 0,
          value: f.value[s],
          outTangent: f.outTangent ? f.outTangent[s] : void 0,
          interpolation: f.interpolation
        }))), e._primitiveBabylonMeshes) {
          for (const f of e._primitiveBabylonMeshes)
            if (f.morphTargetManager) {
              const o = f.morphTargetManager.getTarget(s), d = a.clone();
              o.animations.push(d), i(o, d);
            }
        }
      }
  }
}
const XI = {
  translation: [new CE(st.ANIMATIONTYPE_VECTOR3, "position", lZ, () => 3)],
  rotation: [new CE(st.ANIMATIONTYPE_QUATERNION, "rotationQuaternion", gXe, () => 4)],
  scale: [new CE(st.ANIMATIONTYPE_VECTOR3, "scaling", lZ, () => 3)],
  weights: [new TXe(st.ANIMATIONTYPE_FLOAT, "influence", XXe, (A) => A._numMorphTargets)]
};
function z1e(...A) {
  const e = (t) => t && typeof t == "object";
  return A.reduce((t, r) => (Object.keys(r).forEach((n) => {
    const i = t[n], s = r[n];
    Array.isArray(i) && Array.isArray(s) ? t[n] = i.concat(...s) : e(i) && e(s) ? t[n] = z1e(i, s) : t[n] = s;
  }), t), {});
}
class ei {
  /**
   * Gets an item from the given array.
   * @param context The context when loading the asset
   * @param array The array to get the item from
   * @param index The index to the array
   * @returns The array item
   */
  static Get(e, t, r) {
    if (!t || r == null || !t[r])
      throw new Error(`${e}: Failed to find index (${r})`);
    return t[r];
  }
  /**
   * Gets an item from the given array or returns null if not available.
   * @param array The array to get the item from
   * @param index The index to the array
   * @returns The array item or null
   */
  static TryGet(e, t) {
    return !e || t == null || !e[t] ? null : e[t];
  }
  /**
   * Assign an `index` field to each item of the given array.
   * @param array The array of items
   */
  static Assign(e) {
    if (e)
      for (let t = 0; t < e.length; t++)
        e[t].index = t;
  }
}
class Jr {
  /**
   * Registers a loader extension.
   * @param name The name of the loader extension.
   * @param factory The factory function that creates the loader extension.
   */
  static RegisterExtension(e, t) {
    Jr.UnregisterExtension(e) && Se.Warn(`Extension with the name '${e}' already exists`), Jr._RegisteredExtensions[e] = {
      factory: t
    };
  }
  /**
   * Unregisters a loader extension.
   * @param name The name of the loader extension.
   * @returns A boolean indicating whether the extension has been unregistered
   */
  static UnregisterExtension(e) {
    return Jr._RegisteredExtensions[e] ? (delete Jr._RegisteredExtensions[e], !0) : !1;
  }
  /**
   * The object that represents the glTF JSON.
   */
  get gltf() {
    if (!this._gltf)
      throw new Error("glTF JSON is not available");
    return this._gltf;
  }
  /**
   * The BIN chunk of a binary glTF.
   */
  get bin() {
    return this._bin;
  }
  /**
   * The parent file loader.
   */
  get parent() {
    return this._parent;
  }
  /**
   * The Babylon scene when loading the asset.
   */
  get babylonScene() {
    if (!this._babylonScene)
      throw new Error("Scene is not available");
    return this._babylonScene;
  }
  /**
   * The root Babylon mesh when loading the asset.
   */
  get rootBabylonMesh() {
    return this._rootBabylonMesh;
  }
  /**
   * @internal
   */
  constructor(e) {
    this._completePromises = new Array(), this._assetContainer = null, this._babylonLights = [], this._disableInstancedMesh = 0, this._allMaterialsDirtyRequired = !1, this._extensions = new Array(), this._disposed = !1, this._rootUrl = null, this._fileName = null, this._uniqueRootUrl = null, this._bin = null, this._rootBabylonMesh = null, this._defaultBabylonMaterialData = {}, this._postSceneLoadActions = new Array(), this._parent = e;
  }
  /** @internal */
  dispose() {
    this._disposed || (this._disposed = !0, this._completePromises.length = 0, this._extensions.forEach((e) => e.dispose && e.dispose()), this._extensions.length = 0, this._gltf = null, this._bin = null, this._babylonScene = null, this._rootBabylonMesh = null, this._defaultBabylonMaterialData = {}, this._postSceneLoadActions.length = 0, this._parent.dispose());
  }
  /**
   * @internal
   */
  importMeshAsync(e, t, r, n, i, s, a = "") {
    return Promise.resolve().then(() => {
      this._babylonScene = t, this._assetContainer = r, this._loadData(n);
      let f = null;
      if (e) {
        const o = {};
        if (this._gltf.nodes)
          for (const v of this._gltf.nodes)
            v.name && (o[v.name] = v.index);
        f = (e instanceof Array ? e : [e]).map((v) => {
          const u = o[v];
          if (u === void 0)
            throw new Error(`Failed to find node '${v}'`);
          return u;
        });
      }
      return this._loadAsync(i, a, f, () => ({
        meshes: this._getMeshes(),
        particleSystems: [],
        skeletons: this._getSkeletons(),
        animationGroups: this._getAnimationGroups(),
        lights: this._babylonLights,
        transformNodes: this._getTransformNodes(),
        geometries: this._getGeometries()
      }));
    });
  }
  /**
   * @internal
   */
  loadAsync(e, t, r, n, i = "") {
    return Promise.resolve().then(() => (this._babylonScene = e, this._loadData(t), this._loadAsync(r, i, null, () => {
    })));
  }
  _loadAsync(e, t, r, n) {
    return Promise.resolve().then(() => {
      this._rootUrl = e, this._uniqueRootUrl = !e.startsWith("file:") && t ? e : `${e}${Date.now()}/`, this._fileName = t, this._allMaterialsDirtyRequired = !1, this._loadExtensions(), this._checkExtensions();
      const i = `${cc[cc.LOADING]} => ${cc[cc.READY]}`, s = `${cc[cc.LOADING]} => ${cc[cc.COMPLETE]}`;
      this._parent._startPerformanceCounter(i), this._parent._startPerformanceCounter(s), this._parent._setState(cc.LOADING), this._extensionsOnLoading();
      const a = new Array(), f = this._babylonScene.blockMaterialDirtyMechanism;
      if (this._babylonScene.blockMaterialDirtyMechanism = !0, !this.parent.loadOnlyMaterials) {
        if (r)
          a.push(this.loadSceneAsync("/nodes", { nodes: r, index: -1 }));
        else if (this._gltf.scene != null || this._gltf.scenes && this._gltf.scenes[0]) {
          const d = ei.Get("/scene", this._gltf.scenes, this._gltf.scene || 0);
          a.push(this.loadSceneAsync(`/scenes/${d.index}`, d));
        }
      }
      if (!this.parent.skipMaterials && this.parent.loadAllMaterials && this._gltf.materials)
        for (let d = 0; d < this._gltf.materials.length; ++d) {
          const v = this._gltf.materials[d], u = "/materials/" + d, l = gt.TriangleFillMode;
          a.push(this._loadMaterialAsync(u, v, null, l, () => {
          }));
        }
      return this._allMaterialsDirtyRequired ? this._babylonScene.blockMaterialDirtyMechanism = f : this._babylonScene._forceBlockMaterialDirtyMechanism(f), this._parent.compileMaterials && a.push(this._compileMaterialsAsync()), this._parent.compileShadowGenerators && a.push(this._compileShadowGeneratorsAsync()), Promise.all(a).then(() => (this._rootBabylonMesh && this._rootBabylonMesh.setEnabled(!0), this._extensionsOnReady(), this._parent._setState(cc.READY), this._startAnimations(), n())).then((d) => (this._parent._endPerformanceCounter(i), ye.SetImmediate(() => {
        this._disposed || Promise.all(this._completePromises).then(() => {
          this._parent._endPerformanceCounter(s), this._parent._setState(cc.COMPLETE), this._parent.onCompleteObservable.notifyObservers(void 0), this._parent.onCompleteObservable.clear(), this.dispose();
        }, (v) => {
          this._parent.onErrorObservable.notifyObservers(v), this._parent.onErrorObservable.clear(), this.dispose();
        });
      }), d));
    }).catch((i) => {
      throw this._disposed || (this._parent.onErrorObservable.notifyObservers(i), this._parent.onErrorObservable.clear(), this.dispose()), i;
    });
  }
  _loadData(e) {
    if (this._gltf = e.json, this._setupData(), e.bin) {
      const t = this._gltf.buffers;
      if (t && t[0] && !t[0].uri) {
        const r = t[0];
        (r.byteLength < e.bin.byteLength - 3 || r.byteLength > e.bin.byteLength) && Se.Warn(`Binary buffer length (${r.byteLength}) from JSON does not match chunk length (${e.bin.byteLength})`), this._bin = e.bin;
      } else
        Se.Warn("Unexpected BIN chunk");
    }
  }
  _setupData() {
    if (ei.Assign(this._gltf.accessors), ei.Assign(this._gltf.animations), ei.Assign(this._gltf.buffers), ei.Assign(this._gltf.bufferViews), ei.Assign(this._gltf.cameras), ei.Assign(this._gltf.images), ei.Assign(this._gltf.materials), ei.Assign(this._gltf.meshes), ei.Assign(this._gltf.nodes), ei.Assign(this._gltf.samplers), ei.Assign(this._gltf.scenes), ei.Assign(this._gltf.skins), ei.Assign(this._gltf.textures), this._gltf.nodes) {
      const e = {};
      for (const r of this._gltf.nodes)
        if (r.children)
          for (const n of r.children)
            e[n] = r.index;
      const t = this._createRootNode();
      for (const r of this._gltf.nodes) {
        const n = e[r.index];
        r.parent = n === void 0 ? t : this._gltf.nodes[n];
      }
    }
  }
  _loadExtensions() {
    for (const e in Jr._RegisteredExtensions) {
      const t = Jr._RegisteredExtensions[e].factory(this);
      t.name !== e && Se.Warn(`The name of the glTF loader extension instance does not match the registered name: ${t.name} !== ${e}`), this._extensions.push(t), this._parent.onExtensionLoadedObservable.notifyObservers(t);
    }
    this._extensions.sort((e, t) => (e.order || Number.MAX_VALUE) - (t.order || Number.MAX_VALUE)), this._parent.onExtensionLoadedObservable.clear();
  }
  _checkExtensions() {
    if (this._gltf.extensionsRequired) {
      for (const e of this._gltf.extensionsRequired)
        if (!this._extensions.some((r) => r.name === e && r.enabled))
          throw new Error(`Required extension ${e} is not available`);
    }
  }
  _createRootNode() {
    this._babylonScene._blockEntityCollection = !!this._assetContainer, this._rootBabylonMesh = new Ee("__root__", this._babylonScene), this._rootBabylonMesh._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, this._rootBabylonMesh.setEnabled(!1);
    const e = {
      _babylonTransformNode: this._rootBabylonMesh,
      index: -1
    };
    switch (this._parent.coordinateSystemMode) {
      case AR.AUTO: {
        this._babylonScene.useRightHandedSystem || (e.rotation = [0, 1, 0, 0], e.scale = [1, 1, -1], Jr._LoadTransform(e, this._rootBabylonMesh));
        break;
      }
      case AR.FORCE_RIGHT_HANDED: {
        this._babylonScene.useRightHandedSystem = !0;
        break;
      }
      default:
        throw new Error(`Invalid coordinate system mode (${this._parent.coordinateSystemMode})`);
    }
    return this._parent.onMeshLoadedObservable.notifyObservers(this._rootBabylonMesh), e;
  }
  /**
   * Loads a glTF scene.
   * @param context The context when loading the asset
   * @param scene The glTF scene property
   * @returns A promise that resolves when the load is complete
   */
  loadSceneAsync(e, t) {
    const r = this._extensionsLoadSceneAsync(e, t);
    if (r)
      return r;
    const n = new Array();
    if (this.logOpen(`${e} ${t.name || ""}`), t.nodes)
      for (const i of t.nodes) {
        const s = ei.Get(`${e}/nodes/${i}`, this._gltf.nodes, i);
        n.push(this.loadNodeAsync(`/nodes/${s.index}`, s, (a) => {
          a.parent = this._rootBabylonMesh;
        }));
      }
    for (const i of this._postSceneLoadActions)
      i();
    return n.push(this._loadAnimationsAsync()), this.logClose(), Promise.all(n).then(() => {
    });
  }
  _forEachPrimitive(e, t) {
    if (e._primitiveBabylonMeshes)
      for (const r of e._primitiveBabylonMeshes)
        t(r);
  }
  _getGeometries() {
    const e = [], t = this._gltf.nodes;
    if (t)
      for (const r of t)
        this._forEachPrimitive(r, (n) => {
          const i = n.geometry;
          i && e.indexOf(i) === -1 && e.push(i);
        });
    return e;
  }
  _getMeshes() {
    const e = [];
    this._rootBabylonMesh && e.push(this._rootBabylonMesh);
    const t = this._gltf.nodes;
    if (t)
      for (const r of t)
        this._forEachPrimitive(r, (n) => {
          e.push(n);
        });
    return e;
  }
  _getTransformNodes() {
    const e = [], t = this._gltf.nodes;
    if (t)
      for (const r of t)
        r._babylonTransformNode && r._babylonTransformNode.getClassName() === "TransformNode" && e.push(r._babylonTransformNode), r._babylonTransformNodeForSkin && e.push(r._babylonTransformNodeForSkin);
    return e;
  }
  _getSkeletons() {
    const e = [], t = this._gltf.skins;
    if (t)
      for (const r of t)
        r._data && e.push(r._data.babylonSkeleton);
    return e;
  }
  _getAnimationGroups() {
    const e = [], t = this._gltf.animations;
    if (t)
      for (const r of t)
        r._babylonAnimationGroup && e.push(r._babylonAnimationGroup);
    return e;
  }
  _startAnimations() {
    switch (this._parent.animationStartMode) {
      case qS.NONE:
        break;
      case qS.FIRST: {
        const e = this._getAnimationGroups();
        e.length !== 0 && e[0].start(!0);
        break;
      }
      case qS.ALL: {
        const e = this._getAnimationGroups();
        for (const t of e)
          t.start(!0);
        break;
      }
      default: {
        Se.Error(`Invalid animation start mode (${this._parent.animationStartMode})`);
        return;
      }
    }
  }
  /**
   * Loads a glTF node.
   * @param context The context when loading the asset
   * @param node The glTF node property
   * @param assign A function called synchronously after parsing the glTF properties
   * @returns A promise that resolves with the loaded Babylon mesh when the load is complete
   */
  loadNodeAsync(e, t, r = () => {
  }) {
    const n = this._extensionsLoadNodeAsync(e, t, r);
    if (n)
      return n;
    if (t._babylonTransformNode)
      throw new Error(`${e}: Invalid recursive node hierarchy`);
    const i = new Array();
    this.logOpen(`${e} ${t.name || ""}`);
    const s = (a) => {
      if (Jr.AddPointerMetadata(a, e), Jr._LoadTransform(t, a), t.camera != null) {
        const f = ei.Get(`${e}/camera`, this._gltf.cameras, t.camera);
        i.push(this.loadCameraAsync(`/cameras/${f.index}`, f, (o) => {
          o.parent = a;
        }));
      }
      if (t.children)
        for (const f of t.children) {
          const o = ei.Get(`${e}/children/${f}`, this._gltf.nodes, f);
          i.push(this.loadNodeAsync(`/nodes/${o.index}`, o, (d) => {
            d.parent = a;
          }));
        }
      r(a);
    };
    if (t.mesh == null || t.skin != null) {
      const a = t.name || `node${t.index}`;
      this._babylonScene._blockEntityCollection = !!this._assetContainer;
      const f = new Hr(a, this._babylonScene);
      f._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, t.mesh == null ? t._babylonTransformNode = f : t._babylonTransformNodeForSkin = f, s(f);
    }
    if (t.mesh != null)
      if (t.skin == null) {
        const a = ei.Get(`${e}/mesh`, this._gltf.meshes, t.mesh);
        i.push(this._loadMeshAsync(`/meshes/${a.index}`, t, a, s));
      } else {
        const a = ei.Get(`${e}/mesh`, this._gltf.meshes, t.mesh);
        i.push(this._loadMeshAsync(`/meshes/${a.index}`, t, a, (f) => {
          const o = t._babylonTransformNodeForSkin;
          f.metadata = z1e(o.metadata, f.metadata || {});
          const d = ei.Get(`${e}/skin`, this._gltf.skins, t.skin);
          i.push(this._loadSkinAsync(`/skins/${d.index}`, t, d, (v) => {
            this._forEachPrimitive(t, (u) => {
              u.skeleton = v;
            }), this._postSceneLoadActions.push(() => {
              if (d.skeleton != null) {
                const u = ei.Get(`/skins/${d.index}/skeleton`, this._gltf.nodes, d.skeleton).parent;
                t.index === u.index ? f.parent = o.parent : f.parent = u._babylonTransformNode;
              } else
                f.parent = this._rootBabylonMesh;
              this._parent.onSkinLoadedObservable.notifyObservers({ node: o, skinnedNode: f });
            });
          }));
        }));
      }
    return this.logClose(), Promise.all(i).then(() => (this._forEachPrimitive(t, (a) => {
      a.geometry && a.geometry.useBoundingInfoFromGeometry ? a._updateBoundingInfo() : a.refreshBoundingInfo(!0);
    }), t._babylonTransformNode));
  }
  _loadMeshAsync(e, t, r, n) {
    const i = r.primitives;
    if (!i || !i.length)
      throw new Error(`${e}: Primitives are missing`);
    i[0].index == null && ei.Assign(i);
    const s = new Array();
    this.logOpen(`${e} ${r.name || ""}`);
    const a = t.name || `node${t.index}`;
    if (i.length === 1) {
      const f = r.primitives[0];
      s.push(this._loadMeshPrimitiveAsync(`${e}/primitives/${f.index}`, a, t, r, f, (o) => {
        t._babylonTransformNode = o, t._primitiveBabylonMeshes = [o];
      }));
    } else {
      this._babylonScene._blockEntityCollection = !!this._assetContainer, t._babylonTransformNode = new Hr(a, this._babylonScene), t._babylonTransformNode._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, t._primitiveBabylonMeshes = [];
      for (const f of i)
        s.push(this._loadMeshPrimitiveAsync(`${e}/primitives/${f.index}`, `${a}_primitive${f.index}`, t, r, f, (o) => {
          o.parent = t._babylonTransformNode, t._primitiveBabylonMeshes.push(o);
        }));
    }
    return n(t._babylonTransformNode), this.logClose(), Promise.all(s).then(() => t._babylonTransformNode);
  }
  /**
   * @internal Define this method to modify the default behavior when loading data for mesh primitives.
   * @param context The context when loading the asset
   * @param name The mesh name when loading the asset
   * @param node The glTF node when loading the asset
   * @param mesh The glTF mesh when loading the asset
   * @param primitive The glTF mesh primitive property
   * @param assign A function called synchronously after parsing the glTF properties
   * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled
   */
  _loadMeshPrimitiveAsync(e, t, r, n, i, s) {
    const a = this._extensionsLoadMeshPrimitiveAsync(e, t, r, n, i, s);
    if (a)
      return a;
    this.logOpen(`${e}`);
    const f = this._disableInstancedMesh === 0 && this._parent.createInstances && r.skin == null && !n.primitives[0].targets;
    let o, d;
    if (f && i._instanceData)
      this._babylonScene._blockEntityCollection = !!this._assetContainer, o = i._instanceData.babylonSourceMesh.createInstance(t), o._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, d = i._instanceData.promise;
    else {
      const v = new Array();
      this._babylonScene._blockEntityCollection = !!this._assetContainer;
      const u = new Ee(t, this._babylonScene);
      u._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, u.overrideMaterialSideOrientation = this._babylonScene.useRightHandedSystem ? gt.CounterClockWiseSideOrientation : gt.ClockWiseSideOrientation, this._createMorphTargets(e, r, n, i, u), v.push(this._loadVertexDataAsync(e, i, u).then((P) => this._loadMorphTargetsAsync(e, i, u, P).then(() => {
        this._disposed || (this._babylonScene._blockEntityCollection = !!this._assetContainer, P.applyToMesh(u), P._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1);
      })));
      const l = Jr._GetDrawMode(e, i.mode);
      if (i.material == null) {
        let P = this._defaultBabylonMaterialData[l];
        P || (P = this._createDefaultMaterial("__GLTFLoader._default", l), this._parent.onMaterialLoadedObservable.notifyObservers(P), this._defaultBabylonMaterialData[l] = P), u.material = P;
      } else if (!this.parent.skipMaterials) {
        const P = ei.Get(`${e}/material`, this._gltf.materials, i.material);
        v.push(this._loadMaterialAsync(`/materials/${P.index}`, P, u, l, (p) => {
          u.material = p;
        }));
      }
      d = Promise.all(v), f && (i._instanceData = {
        babylonSourceMesh: u,
        promise: d
      }), o = u;
    }
    return Jr.AddPointerMetadata(o, e), this._parent.onMeshLoadedObservable.notifyObservers(o), s(o), this.logClose(), d.then(() => o);
  }
  _loadVertexDataAsync(e, t, r) {
    const n = this._extensionsLoadVertexDataAsync(e, t, r);
    if (n)
      return n;
    const i = t.attributes;
    if (!i)
      throw new Error(`${e}: Attributes are missing`);
    const s = new Array(), a = new Tf(r.name, this._babylonScene);
    if (t.indices == null)
      r.isUnIndexed = !0;
    else {
      const o = ei.Get(`${e}/indices`, this._gltf.accessors, t.indices);
      s.push(this._loadIndicesAccessorAsync(`/accessors/${o.index}`, o).then((d) => {
        a.setIndices(d);
      }));
    }
    const f = (o, d, v) => {
      if (i[o] == null)
        return;
      r._delayInfo = r._delayInfo || [], r._delayInfo.indexOf(d) === -1 && r._delayInfo.push(d);
      const u = ei.Get(`${e}/attributes/${o}`, this._gltf.accessors, i[o]);
      s.push(this._loadVertexAccessorAsync(`/accessors/${u.index}`, u, d).then((l) => {
        if (l.getKind() === J.PositionKind && !this.parent.alwaysComputeBoundingBox && !r.skeleton && u.min && u.max) {
          const P = ue.Vector3[0].copyFromFloats(...u.min), p = ue.Vector3[1].copyFromFloats(...u.max);
          if (u.normalized && u.componentType !== 5126) {
            let c = 1;
            switch (u.componentType) {
              case 5120:
                c = 127;
                break;
              case 5121:
                c = 255;
                break;
              case 5122:
                c = 32767;
                break;
              case 5123:
                c = 65535;
                break;
            }
            const H = 1 / c;
            P.scaleInPlace(H), p.scaleInPlace(H);
          }
          a._boundingInfo = new Md(P, p), a.useBoundingInfoFromGeometry = !0;
        }
        a.setVerticesBuffer(l, u.count);
      })), d == J.MatricesIndicesExtraKind && (r.numBoneInfluencers = 8), v && v(u);
    };
    return f("POSITION", J.PositionKind), f("NORMAL", J.NormalKind), f("TANGENT", J.TangentKind), f("TEXCOORD_0", J.UVKind), f("TEXCOORD_1", J.UV2Kind), f("TEXCOORD_2", J.UV3Kind), f("TEXCOORD_3", J.UV4Kind), f("TEXCOORD_4", J.UV5Kind), f("TEXCOORD_5", J.UV6Kind), f("JOINTS_0", J.MatricesIndicesKind), f("WEIGHTS_0", J.MatricesWeightsKind), f("JOINTS_1", J.MatricesIndicesExtraKind), f("WEIGHTS_1", J.MatricesWeightsExtraKind), f("COLOR_0", J.ColorKind, (o) => {
      o.type === "VEC4" && (r.hasVertexAlpha = !0);
    }), Promise.all(s).then(() => a);
  }
  _createMorphTargets(e, t, r, n, i) {
    if (!n.targets)
      return;
    if (t._numMorphTargets == null)
      t._numMorphTargets = n.targets.length;
    else if (n.targets.length !== t._numMorphTargets)
      throw new Error(`${e}: Primitives do not have the same number of targets`);
    const s = r.extras ? r.extras.targetNames : null;
    this._babylonScene._blockEntityCollection = !!this._assetContainer, i.morphTargetManager = new U0(this._babylonScene), i.morphTargetManager._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, i.morphTargetManager.areUpdatesFrozen = !0;
    for (let a = 0; a < n.targets.length; a++) {
      const f = t.weights ? t.weights[a] : r.weights ? r.weights[a] : 0, o = s ? s[a] : `morphTarget${a}`;
      i.morphTargetManager.addTarget(new lD(o, f, i.getScene()));
    }
  }
  _loadMorphTargetsAsync(e, t, r, n) {
    if (!t.targets)
      return Promise.resolve();
    const i = new Array(), s = r.morphTargetManager;
    for (let a = 0; a < s.numTargets; a++) {
      const f = s.getTarget(a);
      i.push(this._loadMorphTargetVertexDataAsync(`${e}/targets/${a}`, n, t.targets[a], f));
    }
    return Promise.all(i).then(() => {
      s.areUpdatesFrozen = !1;
    });
  }
  _loadMorphTargetVertexDataAsync(e, t, r, n) {
    const i = new Array(), s = (a, f, o) => {
      if (r[a] == null)
        return;
      const d = t.getVertexBuffer(f);
      if (!d)
        return;
      const v = ei.Get(`${e}/${a}`, this._gltf.accessors, r[a]);
      i.push(this._loadFloatAccessorAsync(`/accessors/${v.index}`, v).then((u) => {
        o(d, u);
      }));
    };
    return s("POSITION", J.PositionKind, (a, f) => {
      const o = new Float32Array(f.length);
      a.forEach(f.length, (d, v) => {
        o[v] = f[v] + d;
      }), n.setPositions(o);
    }), s("NORMAL", J.NormalKind, (a, f) => {
      const o = new Float32Array(f.length);
      a.forEach(o.length, (d, v) => {
        o[v] = f[v] + d;
      }), n.setNormals(o);
    }), s("TANGENT", J.TangentKind, (a, f) => {
      const o = new Float32Array(f.length / 3 * 4);
      let d = 0;
      a.forEach(f.length / 3 * 4, (v, u) => {
        (u + 1) % 4 !== 0 && (o[d] = f[d] + v, d++);
      }), n.setTangents(o);
    }), Promise.all(i).then(() => {
    });
  }
  static _LoadTransform(e, t) {
    if (e.skin != null)
      return;
    let r = S.Zero(), n = Ze.Identity(), i = S.One();
    e.matrix ? he.FromArray(e.matrix).decompose(i, n, r) : (e.translation && (r = S.FromArray(e.translation)), e.rotation && (n = Ze.FromArray(e.rotation)), e.scale && (i = S.FromArray(e.scale))), t.position = r, t.rotationQuaternion = n, t.scaling = i;
  }
  _loadSkinAsync(e, t, r, n) {
    const i = this._extensionsLoadSkinAsync(e, t, r);
    if (i)
      return i;
    if (r._data)
      return n(r._data.babylonSkeleton), r._data.promise;
    const s = `skeleton${r.index}`;
    this._babylonScene._blockEntityCollection = !!this._assetContainer;
    const a = new r4(r.name || s, s, this._babylonScene);
    a._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, this._loadBones(e, r, a);
    const f = this._loadSkinInverseBindMatricesDataAsync(e, r).then((o) => {
      this._updateBoneMatrices(a, o);
    });
    return r._data = {
      babylonSkeleton: a,
      promise: f
    }, n(a), f;
  }
  _loadBones(e, t, r) {
    if (t.skeleton == null || this._parent.alwaysComputeSkeletonRootNode) {
      const i = this._findSkeletonRootNode(`${e}/joints`, t.joints);
      if (i)
        if (t.skeleton === void 0)
          t.skeleton = i.index;
        else {
          const s = (f, o) => {
            for (; o.parent; o = o.parent)
              if (o.parent === f)
                return !0;
            return !1;
          }, a = ei.Get(`${e}/skeleton`, this._gltf.nodes, t.skeleton);
          a !== i && !s(a, i) && (Se.Warn(`${e}/skeleton: Overriding with nearest common ancestor as skeleton node is not a common root`), t.skeleton = i.index);
        }
      else
        Se.Warn(`${e}: Failed to find common root`);
    }
    const n = {};
    for (const i of t.joints) {
      const s = ei.Get(`${e}/joints/${i}`, this._gltf.nodes, i);
      this._loadBone(s, t, r, n);
    }
  }
  _findSkeletonRootNode(e, t) {
    if (t.length === 0)
      return null;
    const r = {};
    for (const i of t) {
      const s = [];
      let a = ei.Get(`${e}/${i}`, this._gltf.nodes, i);
      for (; a.index !== -1; )
        s.unshift(a), a = a.parent;
      r[i] = s;
    }
    let n = null;
    for (let i = 0; ; ++i) {
      let s = r[t[0]];
      if (i >= s.length)
        return n;
      const a = s[i];
      for (let f = 1; f < t.length; ++f)
        if (s = r[t[f]], i >= s.length || a !== s[i])
          return n;
      n = a;
    }
  }
  _loadBone(e, t, r, n) {
    let i = n[e.index];
    if (i)
      return i;
    let s = null;
    e.index !== t.skeleton && (e.parent && e.parent.index !== -1 ? s = this._loadBone(e.parent, t, r, n) : t.skeleton !== void 0 && Se.Warn(`/skins/${t.index}/skeleton: Skeleton node is not a common root`));
    const a = t.joints.indexOf(e.index);
    return i = new da(e.name || `joint${e.index}`, r, s, this._getNodeMatrix(e), null, null, a), n[e.index] = i, this._postSceneLoadActions.push(() => {
      i.linkTransformNode(e._babylonTransformNode);
    }), i;
  }
  _loadSkinInverseBindMatricesDataAsync(e, t) {
    if (t.inverseBindMatrices == null)
      return Promise.resolve(null);
    const r = ei.Get(`${e}/inverseBindMatrices`, this._gltf.accessors, t.inverseBindMatrices);
    return this._loadFloatAccessorAsync(`/accessors/${r.index}`, r);
  }
  _updateBoneMatrices(e, t) {
    for (const r of e.bones) {
      const n = he.Identity(), i = r._index;
      t && i !== -1 && (he.FromArrayToRef(t, i * 16, n), n.invertToRef(n));
      const s = r.getParent();
      s && n.multiplyToRef(s.getAbsoluteInverseBindMatrix(), n), r.updateMatrix(n, !1, !1), r._updateAbsoluteBindMatrices(void 0, !1);
    }
  }
  _getNodeMatrix(e) {
    return e.matrix ? he.FromArray(e.matrix) : he.Compose(e.scale ? S.FromArray(e.scale) : S.One(), e.rotation ? Ze.FromArray(e.rotation) : Ze.Identity(), e.translation ? S.FromArray(e.translation) : S.Zero());
  }
  /**
   * Loads a glTF camera.
   * @param context The context when loading the asset
   * @param camera The glTF camera property
   * @param assign A function called synchronously after parsing the glTF properties
   * @returns A promise that resolves with the loaded Babylon camera when the load is complete
   */
  loadCameraAsync(e, t, r = () => {
  }) {
    const n = this._extensionsLoadCameraAsync(e, t, r);
    if (n)
      return n;
    const i = new Array();
    this.logOpen(`${e} ${t.name || ""}`), this._babylonScene._blockEntityCollection = !!this._assetContainer;
    const s = new SA(t.name || `camera${t.index}`, S.Zero(), this._babylonScene, !1);
    switch (s._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, s.ignoreParentScaling = !0, t._babylonCamera = s, s.rotation.set(0, Math.PI, 0), t.type) {
      case "perspective": {
        const a = t.perspective;
        if (!a)
          throw new Error(`${e}: Camera perspective properties are missing`);
        s.fov = a.yfov, s.minZ = a.znear, s.maxZ = a.zfar || 0;
        break;
      }
      case "orthographic": {
        if (!t.orthographic)
          throw new Error(`${e}: Camera orthographic properties are missing`);
        s.mode = Tr.ORTHOGRAPHIC_CAMERA, s.orthoLeft = -t.orthographic.xmag, s.orthoRight = t.orthographic.xmag, s.orthoBottom = -t.orthographic.ymag, s.orthoTop = t.orthographic.ymag, s.minZ = t.orthographic.znear, s.maxZ = t.orthographic.zfar;
        break;
      }
      default:
        throw new Error(`${e}: Invalid camera type (${t.type})`);
    }
    return Jr.AddPointerMetadata(s, e), this._parent.onCameraLoadedObservable.notifyObservers(s), r(s), this.logClose(), Promise.all(i).then(() => s);
  }
  _loadAnimationsAsync() {
    const e = this._gltf.animations;
    if (!e)
      return Promise.resolve();
    const t = new Array();
    for (let r = 0; r < e.length; r++) {
      const n = e[r];
      t.push(this.loadAnimationAsync(`/animations/${n.index}`, n).then((i) => {
        i.targetedAnimations.length === 0 && i.dispose();
      }));
    }
    return Promise.all(t).then(() => {
    });
  }
  /**
   * Loads a glTF animation.
   * @param context The context when loading the asset
   * @param animation The glTF animation property
   * @returns A promise that resolves with the loaded Babylon animation group when the load is complete
   */
  loadAnimationAsync(e, t) {
    const r = this._extensionsLoadAnimationAsync(e, t);
    if (r)
      return r;
    this._babylonScene._blockEntityCollection = !!this._assetContainer;
    const n = new w0(t.name || `animation${t.index}`, this._babylonScene);
    n._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, t._babylonAnimationGroup = n;
    const i = new Array();
    ei.Assign(t.channels), ei.Assign(t.samplers);
    for (const s of t.channels)
      i.push(this._loadAnimationChannelAsync(`${e}/channels/${s.index}`, e, t, s, (a, f) => {
        a.animations = a.animations || [], a.animations.push(f), n.addTargetedAnimation(f, a);
      }));
    return Promise.all(i).then(() => (n.normalize(0), n));
  }
  /**
   * @hidden
   * Loads a glTF animation channel.
   * @param context The context when loading the asset
   * @param animationContext The context of the animation when loading the asset
   * @param animation The glTF animation property
   * @param channel The glTF animation channel property
   * @param onLoad Called for each animation loaded
   * @returns A void promise that resolves when the load is complete
   */
  _loadAnimationChannelAsync(e, t, r, n, i) {
    const s = this._extensionsLoadAnimationChannelAsync(e, t, r, n, i);
    if (s)
      return s;
    if (n.target.node == null)
      return Promise.resolve();
    const a = ei.Get(`${e}/target/node`, this._gltf.nodes, n.target.node);
    if (n.target.path === "weights" && !a._numMorphTargets || n.target.path !== "weights" && !a._babylonTransformNode)
      return Promise.resolve();
    let f;
    switch (n.target.path) {
      case "translation": {
        f = XI.translation;
        break;
      }
      case "rotation": {
        f = XI.rotation;
        break;
      }
      case "scale": {
        f = XI.scale;
        break;
      }
      case "weights": {
        f = XI.weights;
        break;
      }
      default:
        throw new Error(`${e}/target/path: Invalid value (${n.target.path})`);
    }
    const o = {
      target: a,
      properties: f
    };
    return this._loadAnimationChannelFromTargetInfoAsync(e, t, r, n, o, i);
  }
  /**
   * @hidden
   * Loads a glTF animation channel.
   * @param context The context when loading the asset
   * @param animationContext The context of the animation when loading the asset
   * @param animation The glTF animation property
   * @param channel The glTF animation channel property
   * @param targetInfo The glTF target and properties
   * @param onLoad Called for each animation loaded
   * @returns A void promise that resolves when the load is complete
   */
  _loadAnimationChannelFromTargetInfoAsync(e, t, r, n, i, s) {
    const a = this.parent.targetFps, f = 1 / a, o = ei.Get(`${e}/sampler`, r.samplers, n.sampler);
    return this._loadAnimationSamplerAsync(`${t}/samplers/${n.sampler}`, o).then((d) => {
      let v = 0;
      for (const u of i.properties) {
        const l = u.getStride(i.target), P = d.input, p = d.output, c = new Array(P.length);
        let H = 0;
        switch (d.interpolation) {
          case "STEP": {
            for (let T = 0; T < P.length; T++) {
              const q = u.getValue(i.target, p, H, 1);
              H += l, c[T] = {
                frame: P[T] * a,
                value: q,
                interpolation: CI.STEP
              };
            }
            break;
          }
          case "CUBICSPLINE": {
            for (let T = 0; T < P.length; T++) {
              const q = u.getValue(i.target, p, H, f);
              H += l;
              const b = u.getValue(i.target, p, H, 1);
              H += l;
              const j = u.getValue(i.target, p, H, f);
              H += l, c[T] = {
                frame: P[T] * a,
                inTangent: q,
                value: b,
                outTangent: j
              };
            }
            break;
          }
          case "LINEAR": {
            for (let T = 0; T < P.length; T++) {
              const q = u.getValue(i.target, p, H, 1);
              H += l, c[T] = {
                frame: P[T] * a,
                value: q
              };
            }
            break;
          }
        }
        if (H > 0) {
          const T = `${r.name || `animation${r.index}`}_channel${n.index}_${v}`;
          u.buildAnimations(i.target, T, a, c, (q, b) => {
            ++v, s(q, b);
          });
        }
      }
    });
  }
  _loadAnimationSamplerAsync(e, t) {
    if (t._data)
      return t._data;
    const r = t.interpolation || "LINEAR";
    switch (r) {
      case "STEP":
      case "LINEAR":
      case "CUBICSPLINE":
        break;
      default:
        throw new Error(`${e}/interpolation: Invalid value (${t.interpolation})`);
    }
    const n = ei.Get(`${e}/input`, this._gltf.accessors, t.input), i = ei.Get(`${e}/output`, this._gltf.accessors, t.output);
    return t._data = Promise.all([
      this._loadFloatAccessorAsync(`/accessors/${n.index}`, n),
      this._loadFloatAccessorAsync(`/accessors/${i.index}`, i)
    ]).then(([s, a]) => ({
      input: s,
      interpolation: r,
      output: a
    })), t._data;
  }
  /**
   * Loads a glTF buffer.
   * @param context The context when loading the asset
   * @param buffer The glTF buffer property
   * @param byteOffset The byte offset to use
   * @param byteLength The byte length to use
   * @returns A promise that resolves with the loaded data when the load is complete
   */
  loadBufferAsync(e, t, r, n) {
    const i = this._extensionsLoadBufferAsync(e, t, r, n);
    if (i)
      return i;
    if (!t._data)
      if (t.uri)
        t._data = this.loadUriAsync(`${e}/uri`, t, t.uri);
      else {
        if (!this._bin)
          throw new Error(`${e}: Uri is missing or the binary glTF is missing its binary chunk`);
        t._data = this._bin.readAsync(0, t.byteLength);
      }
    return t._data.then((s) => {
      try {
        return new Uint8Array(s.buffer, s.byteOffset + r, n);
      } catch (a) {
        throw new Error(`${e}: ${a.message}`);
      }
    });
  }
  /**
   * Loads a glTF buffer view.
   * @param context The context when loading the asset
   * @param bufferView The glTF buffer view property
   * @returns A promise that resolves with the loaded data when the load is complete
   */
  loadBufferViewAsync(e, t) {
    const r = this._extensionsLoadBufferViewAsync(e, t);
    if (r)
      return r;
    if (t._data)
      return t._data;
    const n = ei.Get(`${e}/buffer`, this._gltf.buffers, t.buffer);
    return t._data = this.loadBufferAsync(`/buffers/${n.index}`, n, t.byteOffset || 0, t.byteLength), t._data;
  }
  _loadAccessorAsync(e, t, r) {
    if (t._data)
      return t._data;
    const n = Jr._GetNumComponents(e, t.type), i = n * J.GetTypeByteLength(t.componentType), s = n * t.count;
    if (t.bufferView == null)
      t._data = Promise.resolve(new r(s));
    else {
      const a = ei.Get(`${e}/bufferView`, this._gltf.bufferViews, t.bufferView);
      t._data = this.loadBufferViewAsync(`/bufferViews/${a.index}`, a).then((f) => {
        if (t.componentType === 5126 && !t.normalized && (!a.byteStride || a.byteStride === i))
          return Jr._GetTypedArray(e, t.componentType, f, t.byteOffset, s);
        {
          const o = new r(s);
          return J.ForEach(f, t.byteOffset || 0, a.byteStride || i, n, t.componentType, o.length, t.normalized || !1, (d, v) => {
            o[v] = d;
          }), o;
        }
      });
    }
    if (t.sparse) {
      const a = t.sparse;
      t._data = t._data.then((f) => {
        const o = f, d = ei.Get(`${e}/sparse/indices/bufferView`, this._gltf.bufferViews, a.indices.bufferView), v = ei.Get(`${e}/sparse/values/bufferView`, this._gltf.bufferViews, a.values.bufferView);
        return Promise.all([
          this.loadBufferViewAsync(`/bufferViews/${d.index}`, d),
          this.loadBufferViewAsync(`/bufferViews/${v.index}`, v)
        ]).then(([u, l]) => {
          const P = Jr._GetTypedArray(`${e}/sparse/indices`, a.indices.componentType, u, a.indices.byteOffset, a.count), p = n * a.count;
          let c;
          if (t.componentType === 5126 && !t.normalized)
            c = Jr._GetTypedArray(`${e}/sparse/values`, t.componentType, l, a.values.byteOffset, p);
          else {
            const T = Jr._GetTypedArray(`${e}/sparse/values`, t.componentType, l, a.values.byteOffset, p);
            c = new r(p), J.ForEach(T, 0, i, n, t.componentType, c.length, t.normalized || !1, (q, b) => {
              c[b] = q;
            });
          }
          let H = 0;
          for (let T = 0; T < P.length; T++) {
            let q = P[T] * n;
            for (let b = 0; b < n; b++)
              o[q++] = c[H++];
          }
          return o;
        });
      });
    }
    return t._data;
  }
  /**
   * @internal
   */
  _loadFloatAccessorAsync(e, t) {
    return this._loadAccessorAsync(e, t, Float32Array);
  }
  /**
   * @internal
   */
  _loadIndicesAccessorAsync(e, t) {
    if (t.type !== "SCALAR")
      throw new Error(`${e}/type: Invalid value ${t.type}`);
    if (t.componentType !== 5121 && t.componentType !== 5123 && t.componentType !== 5125)
      throw new Error(`${e}/componentType: Invalid value ${t.componentType}`);
    if (t._data)
      return t._data;
    if (t.sparse) {
      const r = Jr._GetTypedArrayConstructor(`${e}/componentType`, t.componentType);
      t._data = this._loadAccessorAsync(e, t, r);
    } else {
      const r = ei.Get(`${e}/bufferView`, this._gltf.bufferViews, t.bufferView);
      t._data = this.loadBufferViewAsync(`/bufferViews/${r.index}`, r).then((n) => Jr._GetTypedArray(e, t.componentType, n, t.byteOffset, t.count));
    }
    return t._data;
  }
  /**
   * @internal
   */
  _loadVertexBufferViewAsync(e) {
    if (e._babylonBuffer)
      return e._babylonBuffer;
    const t = this._babylonScene.getEngine();
    return e._babylonBuffer = this.loadBufferViewAsync(`/bufferViews/${e.index}`, e).then((r) => new P9(t, r, !1)), e._babylonBuffer;
  }
  /**
   * @internal
   */
  _loadVertexAccessorAsync(e, t, r) {
    var n;
    if (!((n = t._babylonVertexBuffer) === null || n === void 0) && n[r])
      return t._babylonVertexBuffer[r];
    t._babylonVertexBuffer || (t._babylonVertexBuffer = {});
    const i = this._babylonScene.getEngine();
    if (t.sparse || t.bufferView == null)
      t._babylonVertexBuffer[r] = this._loadFloatAccessorAsync(e, t).then((s) => new J(i, s, r, !1));
    else {
      const s = ei.Get(`${e}/bufferView`, this._gltf.bufferViews, t.bufferView);
      t._babylonVertexBuffer[r] = this._loadVertexBufferViewAsync(s).then((a) => {
        const f = Jr._GetNumComponents(e, t.type);
        return new J(i, a, r, !1, void 0, s.byteStride, void 0, t.byteOffset, f, t.componentType, t.normalized, !0, void 0, !0);
      });
    }
    return t._babylonVertexBuffer[r];
  }
  _loadMaterialMetallicRoughnessPropertiesAsync(e, t, r) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const n = new Array();
    return t && (t.baseColorFactor ? (r.albedoColor = Ne.FromArray(t.baseColorFactor), r.alpha = t.baseColorFactor[3]) : r.albedoColor = Ne.White(), r.metallic = t.metallicFactor == null ? 1 : t.metallicFactor, r.roughness = t.roughnessFactor == null ? 1 : t.roughnessFactor, t.baseColorTexture && n.push(this.loadTextureInfoAsync(`${e}/baseColorTexture`, t.baseColorTexture, (i) => {
      i.name = `${r.name} (Base Color)`, r.albedoTexture = i;
    })), t.metallicRoughnessTexture && (t.metallicRoughnessTexture.nonColorData = !0, n.push(this.loadTextureInfoAsync(`${e}/metallicRoughnessTexture`, t.metallicRoughnessTexture, (i) => {
      i.name = `${r.name} (Metallic Roughness)`, r.metallicTexture = i;
    })), r.useMetallnessFromMetallicTextureBlue = !0, r.useRoughnessFromMetallicTextureGreen = !0, r.useRoughnessFromMetallicTextureAlpha = !1)), Promise.all(n).then(() => {
    });
  }
  /**
   * @internal
   */
  _loadMaterialAsync(e, t, r, n, i = () => {
  }) {
    const s = this._extensionsLoadMaterialAsync(e, t, r, n, i);
    if (s)
      return s;
    t._data = t._data || {};
    let a = t._data[n];
    if (!a) {
      this.logOpen(`${e} ${t.name || ""}`);
      const f = this.createMaterial(e, t, n);
      a = {
        babylonMaterial: f,
        babylonMeshes: [],
        promise: this.loadMaterialPropertiesAsync(e, t, f)
      }, t._data[n] = a, Jr.AddPointerMetadata(f, e), this._parent.onMaterialLoadedObservable.notifyObservers(f), this.logClose();
    }
    return r && (a.babylonMeshes.push(r), r.onDisposeObservable.addOnce(() => {
      const f = a.babylonMeshes.indexOf(r);
      f !== -1 && a.babylonMeshes.splice(f, 1);
    })), i(a.babylonMaterial), a.promise.then(() => a.babylonMaterial);
  }
  _createDefaultMaterial(e, t) {
    this._babylonScene._blockEntityCollection = !!this._assetContainer;
    const r = new mr(e, this._babylonScene);
    return r._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, r.fillMode = t, r.enableSpecularAntiAliasing = !0, r.useRadianceOverAlpha = !this._parent.transparencyAsCoverage, r.useSpecularOverAlpha = !this._parent.transparencyAsCoverage, r.transparencyMode = mr.PBRMATERIAL_OPAQUE, r.metallic = 1, r.roughness = 1, r;
  }
  /**
   * Creates a Babylon material from a glTF material.
   * @param context The context when loading the asset
   * @param material The glTF material property
   * @param babylonDrawMode The draw mode for the Babylon material
   * @returns The Babylon material
   */
  createMaterial(e, t, r) {
    const n = this._extensionsCreateMaterial(e, t, r);
    if (n)
      return n;
    const i = t.name || `material${t.index}`;
    return this._createDefaultMaterial(i, r);
  }
  /**
   * Loads properties from a glTF material into a Babylon material.
   * @param context The context when loading the asset
   * @param material The glTF material property
   * @param babylonMaterial The Babylon material
   * @returns A promise that resolves when the load is complete
   */
  loadMaterialPropertiesAsync(e, t, r) {
    const n = this._extensionsLoadMaterialPropertiesAsync(e, t, r);
    if (n)
      return n;
    const i = new Array();
    return i.push(this.loadMaterialBasePropertiesAsync(e, t, r)), t.pbrMetallicRoughness && i.push(this._loadMaterialMetallicRoughnessPropertiesAsync(`${e}/pbrMetallicRoughness`, t.pbrMetallicRoughness, r)), this.loadMaterialAlphaProperties(e, t, r), Promise.all(i).then(() => {
    });
  }
  /**
   * Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
   * @param context The context when loading the asset
   * @param material The glTF material property
   * @param babylonMaterial The Babylon material
   * @returns A promise that resolves when the load is complete
   */
  loadMaterialBasePropertiesAsync(e, t, r) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const n = new Array();
    return r.emissiveColor = t.emissiveFactor ? Ne.FromArray(t.emissiveFactor) : new Ne(0, 0, 0), t.doubleSided && (r.backFaceCulling = !1, r.twoSidedLighting = !0), t.normalTexture && (t.normalTexture.nonColorData = !0, n.push(this.loadTextureInfoAsync(`${e}/normalTexture`, t.normalTexture, (i) => {
      i.name = `${r.name} (Normal)`, r.bumpTexture = i;
    })), r.invertNormalMapX = !this._babylonScene.useRightHandedSystem, r.invertNormalMapY = this._babylonScene.useRightHandedSystem, t.normalTexture.scale != null && r.bumpTexture && (r.bumpTexture.level = t.normalTexture.scale), r.forceIrradianceInFragment = !0), t.occlusionTexture && (t.occlusionTexture.nonColorData = !0, n.push(this.loadTextureInfoAsync(`${e}/occlusionTexture`, t.occlusionTexture, (i) => {
      i.name = `${r.name} (Occlusion)`, r.ambientTexture = i;
    })), r.useAmbientInGrayScale = !0, t.occlusionTexture.strength != null && (r.ambientTextureStrength = t.occlusionTexture.strength)), t.emissiveTexture && n.push(this.loadTextureInfoAsync(`${e}/emissiveTexture`, t.emissiveTexture, (i) => {
      i.name = `${r.name} (Emissive)`, r.emissiveTexture = i;
    })), Promise.all(n).then(() => {
    });
  }
  /**
   * Loads the alpha properties from a glTF material into a Babylon material.
   * Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
   * @param context The context when loading the asset
   * @param material The glTF material property
   * @param babylonMaterial The Babylon material
   */
  loadMaterialAlphaProperties(e, t, r) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    switch (t.alphaMode || "OPAQUE") {
      case "OPAQUE": {
        r.transparencyMode = mr.PBRMATERIAL_OPAQUE;
        break;
      }
      case "MASK": {
        r.transparencyMode = mr.PBRMATERIAL_ALPHATEST, r.alphaCutOff = t.alphaCutoff == null ? 0.5 : t.alphaCutoff, r.albedoTexture && (r.albedoTexture.hasAlpha = !0);
        break;
      }
      case "BLEND": {
        r.transparencyMode = mr.PBRMATERIAL_ALPHABLEND, r.albedoTexture && (r.albedoTexture.hasAlpha = !0, r.useAlphaFromAlbedoTexture = !0);
        break;
      }
      default:
        throw new Error(`${e}/alphaMode: Invalid value (${t.alphaMode})`);
    }
  }
  /**
   * Loads a glTF texture info.
   * @param context The context when loading the asset
   * @param textureInfo The glTF texture info property
   * @param assign A function called synchronously after parsing the glTF properties
   * @returns A promise that resolves with the loaded Babylon texture when the load is complete
   */
  loadTextureInfoAsync(e, t, r = () => {
  }) {
    const n = this._extensionsLoadTextureInfoAsync(e, t, r);
    if (n)
      return n;
    if (this.logOpen(`${e}`), t.texCoord >= 6)
      throw new Error(`${e}/texCoord: Invalid value (${t.texCoord})`);
    const i = ei.Get(`${e}/index`, this._gltf.textures, t.index);
    i._textureInfo = t;
    const s = this._loadTextureAsync(`/textures/${t.index}`, i, (a) => {
      a.coordinatesIndex = t.texCoord || 0, Jr.AddPointerMetadata(a, e), this._parent.onTextureLoadedObservable.notifyObservers(a), r(a);
    });
    return this.logClose(), s;
  }
  /**
   * @internal
   */
  _loadTextureAsync(e, t, r = () => {
  }) {
    const n = this._extensionsLoadTextureAsync(e, t, r);
    if (n)
      return n;
    this.logOpen(`${e} ${t.name || ""}`);
    const i = t.sampler == null ? Jr.DefaultSampler : ei.Get(`${e}/sampler`, this._gltf.samplers, t.sampler), s = ei.Get(`${e}/source`, this._gltf.images, t.source), a = this._createTextureAsync(e, i, s, r, void 0, !t._textureInfo.nonColorData);
    return this.logClose(), a;
  }
  /**
   * @internal
   */
  _createTextureAsync(e, t, r, n = () => {
  }, i, s) {
    const a = this._loadSampler(`/samplers/${t.index}`, t), f = new Array(), o = new MW();
    this._babylonScene._blockEntityCollection = !!this._assetContainer;
    const d = {
      noMipmap: a.noMipMaps,
      invertY: !1,
      samplingMode: a.samplingMode,
      onLoad: () => {
        this._disposed || o.resolve();
      },
      onError: (u, l) => {
        this._disposed || o.reject(new Error(`${e}: ${l && l.message ? l.message : u || "Failed to load texture"}`));
      },
      mimeType: r.mimeType,
      loaderOptions: i,
      useSRGBBuffer: !!s && this._parent.useSRGBBuffers
    }, v = new We(null, this._babylonScene, d);
    return v._parentContainer = this._assetContainer, this._babylonScene._blockEntityCollection = !1, f.push(o.promise), f.push(this.loadImageAsync(`/images/${r.index}`, r).then((u) => {
      const l = r.uri || `${this._fileName}#image${r.index}`, P = `data:${this._uniqueRootUrl}${l}`;
      v.updateURL(P, u);
    })), v.wrapU = a.wrapU, v.wrapV = a.wrapV, n(v), Promise.all(f).then(() => v);
  }
  _loadSampler(e, t) {
    return t._data || (t._data = {
      noMipMaps: t.minFilter === 9728 || t.minFilter === 9729,
      samplingMode: Jr._GetTextureSamplingMode(e, t),
      wrapU: Jr._GetTextureWrapMode(`${e}/wrapS`, t.wrapS),
      wrapV: Jr._GetTextureWrapMode(`${e}/wrapT`, t.wrapT)
    }), t._data;
  }
  /**
   * Loads a glTF image.
   * @param context The context when loading the asset
   * @param image The glTF image property
   * @returns A promise that resolves with the loaded data when the load is complete
   */
  loadImageAsync(e, t) {
    if (!t._data) {
      if (this.logOpen(`${e} ${t.name || ""}`), t.uri)
        t._data = this.loadUriAsync(`${e}/uri`, t, t.uri);
      else {
        const r = ei.Get(`${e}/bufferView`, this._gltf.bufferViews, t.bufferView);
        t._data = this.loadBufferViewAsync(`/bufferViews/${r.index}`, r);
      }
      this.logClose();
    }
    return t._data;
  }
  /**
   * Loads a glTF uri.
   * @param context The context when loading the asset
   * @param property The glTF property associated with the uri
   * @param uri The base64 or relative uri
   * @returns A promise that resolves with the loaded data when the load is complete
   */
  loadUriAsync(e, t, r) {
    const n = this._extensionsLoadUriAsync(e, t, r);
    if (n)
      return n;
    if (!Jr._ValidateUri(r))
      throw new Error(`${e}: '${r}' is invalid`);
    if (qR(r)) {
      const i = new Uint8Array(iU(r));
      return this.log(`${e}: Decoded ${r.substr(0, 64)}... (${i.length} bytes)`), Promise.resolve(i);
    }
    return this.log(`${e}: Loading ${r}`), this._parent.preprocessUrlAsync(this._rootUrl + r).then((i) => new Promise((s, a) => {
      this._parent._loadFile(this._babylonScene, i, (f) => {
        this._disposed || (this.log(`${e}: Loaded ${r} (${f.byteLength} bytes)`), s(new Uint8Array(f)));
      }, !0, (f) => {
        a(new mS(`${e}: Failed to load '${r}'${f ? ": " + f.status + " " + f.statusText : ""}`, f));
      });
    }));
  }
  /**
   * Adds a JSON pointer to the _internalMetadata of the Babylon object at `<object>._internalMetadata.gltf.pointers`.
   * @param babylonObject the Babylon object with _internalMetadata
   * @param pointer the JSON pointer
   */
  static AddPointerMetadata(e, t) {
    e.metadata = e.metadata || {};
    const r = e._internalMetadata = e._internalMetadata || {}, n = r.gltf = r.gltf || {};
    (n.pointers = n.pointers || []).push(t);
  }
  static _GetTextureWrapMode(e, t) {
    switch (t = t ?? 10497, t) {
      case 33071:
        return We.CLAMP_ADDRESSMODE;
      case 33648:
        return We.MIRROR_ADDRESSMODE;
      case 10497:
        return We.WRAP_ADDRESSMODE;
      default:
        return Se.Warn(`${e}: Invalid value (${t})`), We.WRAP_ADDRESSMODE;
    }
  }
  static _GetTextureSamplingMode(e, t) {
    const r = t.magFilter == null ? 9729 : t.magFilter, n = t.minFilter == null ? 9987 : t.minFilter;
    if (r === 9729)
      switch (n) {
        case 9728:
          return We.LINEAR_NEAREST;
        case 9729:
          return We.LINEAR_LINEAR;
        case 9984:
          return We.LINEAR_NEAREST_MIPNEAREST;
        case 9985:
          return We.LINEAR_LINEAR_MIPNEAREST;
        case 9986:
          return We.LINEAR_NEAREST_MIPLINEAR;
        case 9987:
          return We.LINEAR_LINEAR_MIPLINEAR;
        default:
          return Se.Warn(`${e}/minFilter: Invalid value (${n})`), We.LINEAR_LINEAR_MIPLINEAR;
      }
    else
      switch (r !== 9728 && Se.Warn(`${e}/magFilter: Invalid value (${r})`), n) {
        case 9728:
          return We.NEAREST_NEAREST;
        case 9729:
          return We.NEAREST_LINEAR;
        case 9984:
          return We.NEAREST_NEAREST_MIPNEAREST;
        case 9985:
          return We.NEAREST_LINEAR_MIPNEAREST;
        case 9986:
          return We.NEAREST_NEAREST_MIPLINEAR;
        case 9987:
          return We.NEAREST_LINEAR_MIPLINEAR;
        default:
          return Se.Warn(`${e}/minFilter: Invalid value (${n})`), We.NEAREST_NEAREST_MIPNEAREST;
      }
  }
  static _GetTypedArrayConstructor(e, t) {
    switch (t) {
      case 5120:
        return Int8Array;
      case 5121:
        return Uint8Array;
      case 5122:
        return Int16Array;
      case 5123:
        return Uint16Array;
      case 5125:
        return Uint32Array;
      case 5126:
        return Float32Array;
      default:
        throw new Error(`${e}: Invalid component type ${t}`);
    }
  }
  static _GetTypedArray(e, t, r, n, i) {
    const s = r.buffer;
    n = r.byteOffset + (n || 0);
    const a = Jr._GetTypedArrayConstructor(`${e}/componentType`, t), f = J.GetTypeByteLength(t);
    return n % f !== 0 ? (Se.Warn(`${e}: Copying buffer as byte offset (${n}) is not a multiple of component type byte length (${f})`), new a(s.slice(n, n + i * f), 0)) : new a(s, n, i);
  }
  static _GetNumComponents(e, t) {
    switch (t) {
      case "SCALAR":
        return 1;
      case "VEC2":
        return 2;
      case "VEC3":
        return 3;
      case "VEC4":
        return 4;
      case "MAT2":
        return 4;
      case "MAT3":
        return 9;
      case "MAT4":
        return 16;
    }
    throw new Error(`${e}: Invalid type (${t})`);
  }
  static _ValidateUri(e) {
    return ye.IsBase64(e) || e.indexOf("..") === -1;
  }
  /**
   * @internal
   */
  static _GetDrawMode(e, t) {
    switch (t == null && (t = 4), t) {
      case 0:
        return gt.PointListDrawMode;
      case 1:
        return gt.LineListDrawMode;
      case 2:
        return gt.LineLoopDrawMode;
      case 3:
        return gt.LineStripDrawMode;
      case 4:
        return gt.TriangleFillMode;
      case 5:
        return gt.TriangleStripDrawMode;
      case 6:
        return gt.TriangleFanDrawMode;
    }
    throw new Error(`${e}: Invalid mesh primitive mode (${t})`);
  }
  _compileMaterialsAsync() {
    this._parent._startPerformanceCounter("Compile materials");
    const e = new Array();
    if (this._gltf.materials) {
      for (const t of this._gltf.materials)
        if (t._data)
          for (const r in t._data) {
            const n = t._data[r];
            for (const i of n.babylonMeshes) {
              i.computeWorldMatrix(!0);
              const s = n.babylonMaterial;
              e.push(s.forceCompilationAsync(i)), e.push(s.forceCompilationAsync(i, { useInstances: !0 })), this._parent.useClipPlane && (e.push(s.forceCompilationAsync(i, { clipPlane: !0 })), e.push(s.forceCompilationAsync(i, { clipPlane: !0, useInstances: !0 })));
            }
          }
    }
    return Promise.all(e).then(() => {
      this._parent._endPerformanceCounter("Compile materials");
    });
  }
  _compileShadowGeneratorsAsync() {
    this._parent._startPerformanceCounter("Compile shadow generators");
    const e = new Array(), t = this._babylonScene.lights;
    for (const r of t) {
      const n = r.getShadowGenerator();
      n && e.push(n.forceCompilationAsync());
    }
    return Promise.all(e).then(() => {
      this._parent._endPerformanceCounter("Compile shadow generators");
    });
  }
  _forEachExtensions(e) {
    for (const t of this._extensions)
      t.enabled && e(t);
  }
  _applyExtensions(e, t, r) {
    for (const n of this._extensions)
      if (n.enabled) {
        const i = `${n.name}.${t}`, s = e;
        s._activeLoaderExtensionFunctions = s._activeLoaderExtensionFunctions || {};
        const a = s._activeLoaderExtensionFunctions;
        if (!a[i]) {
          a[i] = !0;
          try {
            const f = r(n);
            if (f)
              return f;
          } finally {
            delete a[i];
          }
        }
      }
    return null;
  }
  _extensionsOnLoading() {
    this._forEachExtensions((e) => e.onLoading && e.onLoading());
  }
  _extensionsOnReady() {
    this._forEachExtensions((e) => e.onReady && e.onReady());
  }
  _extensionsLoadSceneAsync(e, t) {
    return this._applyExtensions(t, "loadScene", (r) => r.loadSceneAsync && r.loadSceneAsync(e, t));
  }
  _extensionsLoadNodeAsync(e, t, r) {
    return this._applyExtensions(t, "loadNode", (n) => n.loadNodeAsync && n.loadNodeAsync(e, t, r));
  }
  _extensionsLoadCameraAsync(e, t, r) {
    return this._applyExtensions(t, "loadCamera", (n) => n.loadCameraAsync && n.loadCameraAsync(e, t, r));
  }
  _extensionsLoadVertexDataAsync(e, t, r) {
    return this._applyExtensions(t, "loadVertexData", (n) => n._loadVertexDataAsync && n._loadVertexDataAsync(e, t, r));
  }
  _extensionsLoadMeshPrimitiveAsync(e, t, r, n, i, s) {
    return this._applyExtensions(i, "loadMeshPrimitive", (a) => a._loadMeshPrimitiveAsync && a._loadMeshPrimitiveAsync(e, t, r, n, i, s));
  }
  _extensionsLoadMaterialAsync(e, t, r, n, i) {
    return this._applyExtensions(t, "loadMaterial", (s) => s._loadMaterialAsync && s._loadMaterialAsync(e, t, r, n, i));
  }
  _extensionsCreateMaterial(e, t, r) {
    return this._applyExtensions(t, "createMaterial", (n) => n.createMaterial && n.createMaterial(e, t, r));
  }
  _extensionsLoadMaterialPropertiesAsync(e, t, r) {
    return this._applyExtensions(t, "loadMaterialProperties", (n) => n.loadMaterialPropertiesAsync && n.loadMaterialPropertiesAsync(e, t, r));
  }
  _extensionsLoadTextureInfoAsync(e, t, r) {
    return this._applyExtensions(t, "loadTextureInfo", (n) => n.loadTextureInfoAsync && n.loadTextureInfoAsync(e, t, r));
  }
  _extensionsLoadTextureAsync(e, t, r) {
    return this._applyExtensions(t, "loadTexture", (n) => n._loadTextureAsync && n._loadTextureAsync(e, t, r));
  }
  _extensionsLoadAnimationAsync(e, t) {
    return this._applyExtensions(t, "loadAnimation", (r) => r.loadAnimationAsync && r.loadAnimationAsync(e, t));
  }
  _extensionsLoadAnimationChannelAsync(e, t, r, n, i) {
    return this._applyExtensions(r, "loadAnimationChannel", (s) => s._loadAnimationChannelAsync && s._loadAnimationChannelAsync(e, t, r, n, i));
  }
  _extensionsLoadSkinAsync(e, t, r) {
    return this._applyExtensions(r, "loadSkin", (n) => n._loadSkinAsync && n._loadSkinAsync(e, t, r));
  }
  _extensionsLoadUriAsync(e, t, r) {
    return this._applyExtensions(t, "loadUri", (n) => n._loadUriAsync && n._loadUriAsync(e, t, r));
  }
  _extensionsLoadBufferViewAsync(e, t) {
    return this._applyExtensions(t, "loadBufferView", (r) => r.loadBufferViewAsync && r.loadBufferViewAsync(e, t));
  }
  _extensionsLoadBufferAsync(e, t, r, n) {
    return this._applyExtensions(t, "loadBuffer", (i) => i.loadBufferAsync && i.loadBufferAsync(e, t, r, n));
  }
  /**
   * Helper method called by a loader extension to load an glTF extension.
   * @param context The context when loading the asset
   * @param property The glTF property to load the extension from
   * @param extensionName The name of the extension to load
   * @param actionAsync The action to run
   * @returns The promise returned by actionAsync or null if the extension does not exist
   */
  static LoadExtensionAsync(e, t, r, n) {
    if (!t.extensions)
      return null;
    const s = t.extensions[r];
    return s ? n(`${e}/extensions/${r}`, s) : null;
  }
  /**
   * Helper method called by a loader extension to load a glTF extra.
   * @param context The context when loading the asset
   * @param property The glTF property to load the extra from
   * @param extensionName The name of the extension to load
   * @param actionAsync The action to run
   * @returns The promise returned by actionAsync or null if the extra does not exist
   */
  static LoadExtraAsync(e, t, r, n) {
    if (!t.extras)
      return null;
    const s = t.extras[r];
    return s ? n(`${e}/extras/${r}`, s) : null;
  }
  /**
   * Checks for presence of an extension.
   * @param name The name of the extension to check
   * @returns A boolean indicating the presence of the given extension name in `extensionsUsed`
   */
  isExtensionUsed(e) {
    return !!this._gltf.extensionsUsed && this._gltf.extensionsUsed.indexOf(e) !== -1;
  }
  /**
   * Increments the indentation level and logs a message.
   * @param message The message to log
   */
  logOpen(e) {
    this._parent._logOpen(e);
  }
  /**
   * Decrements the indentation level.
   */
  logClose() {
    this._parent._logClose();
  }
  /**
   * Logs a message
   * @param message The message to log
   */
  log(e) {
    this._parent._log(e);
  }
  /**
   * Starts a performance counter.
   * @param counterName The name of the performance counter
   */
  startPerformanceCounter(e) {
    this._parent._startPerformanceCounter(e);
  }
  /**
   * Ends a performance counter.
   * @param counterName The name of the performance counter
   */
  endPerformanceCounter(e) {
    this._parent._endPerformanceCounter(e);
  }
}
Jr._RegisteredExtensions = {};
Jr.DefaultSampler = { index: -1 };
q1._CreateGLTF2Loader = (A) => new Jr(A);
const NF = "EXT_lights_image_based";
class qXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = NF, this._loader = e, this.enabled = this._loader.isExtensionUsed(NF);
  }
  /** @internal */
  dispose() {
    this._loader = null, delete this._lights;
  }
  /** @internal */
  onLoading() {
    const e = this._loader.gltf.extensions;
    if (e && e[this.name]) {
      const t = e[this.name];
      this._lights = t.lights;
    }
  }
  /**
   * @internal
   */
  loadSceneAsync(e, t) {
    return Jr.LoadExtensionAsync(e, t, this.name, (r, n) => {
      this._loader._allMaterialsDirtyRequired = !0;
      const i = new Array();
      i.push(this._loader.loadSceneAsync(e, t)), this._loader.logOpen(`${r}`);
      const s = ei.Get(`${r}/light`, this._lights, n.light);
      return i.push(this._loadLightAsync(`/extensions/${this.name}/lights/${n.light}`, s).then((a) => {
        this._loader.babylonScene.environmentTexture = a;
      })), this._loader.logClose(), Promise.all(i).then(() => {
      });
    });
  }
  _loadLightAsync(e, t) {
    if (!t._loaded) {
      const r = new Array();
      this._loader.logOpen(`${e}`);
      const n = new Array(t.specularImages.length);
      for (let i = 0; i < t.specularImages.length; i++) {
        const s = t.specularImages[i];
        n[i] = new Array(s.length);
        for (let a = 0; a < s.length; a++) {
          const f = `${e}/specularImages/${i}/${a}`;
          this._loader.logOpen(`${f}`);
          const o = s[a], d = ei.Get(f, this._loader.gltf.images, o);
          r.push(this._loader.loadImageAsync(`/images/${o}`, d).then((v) => {
            n[i][a] = v;
          })), this._loader.logClose();
        }
      }
      this._loader.logClose(), t._loaded = Promise.all(r).then(() => {
        const i = new hy(this._loader.babylonScene, null, t.specularImageSize);
        if (i.name = t.name || "environment", t._babylonTexture = i, t.intensity != null && (i.level = t.intensity), t.rotation) {
          let o = Ze.FromArray(t.rotation);
          this._loader.babylonScene.useRightHandedSystem || (o = Ze.Inverse(o)), he.FromQuaternionToRef(o, i.getReflectionTextureMatrix());
        }
        if (!t.irradianceCoefficients)
          throw new Error(`${e}: Irradiance coefficients are missing`);
        const s = HD.FromArray(t.irradianceCoefficients);
        s.scaleInPlace(t.intensity), s.convertIrradianceToLambertianRadiance();
        const a = i4.FromHarmonics(s), f = (n.length - 1) / Xt.Log2(t.specularImageSize);
        return i.updateRGBDAsync(n, a, f);
      });
    }
    return t._loaded.then(() => t._babylonTexture);
  }
}
Jr.RegisterExtension(NF, (A) => new qXe(A));
const QF = "EXT_mesh_gpu_instancing";
class bXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = QF, this._loader = e, this.enabled = this._loader.isExtensionUsed(QF);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadNodeAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      this._loader._disableInstancedMesh++;
      const s = this._loader.loadNodeAsync(`/nodes/${t.index}`, t, r);
      if (this._loader._disableInstancedMesh--, !t._primitiveBabylonMeshes)
        return s;
      const a = new Array();
      let f = 0;
      const o = (d) => {
        if (i.attributes[d] == null) {
          a.push(Promise.resolve(null));
          return;
        }
        const v = ei.Get(`${n}/attributes/${d}`, this._loader.gltf.accessors, i.attributes[d]);
        if (a.push(this._loader._loadFloatAccessorAsync(`/accessors/${v.bufferView}`, v)), f === 0)
          f = v.count;
        else if (f !== v.count)
          throw new Error(`${n}/attributes: Instance buffer accessors do not have the same count.`);
      };
      return o("TRANSLATION"), o("ROTATION"), o("SCALE"), s.then((d) => Promise.all(a).then(([v, u, l]) => {
        const P = new Float32Array(f * 16);
        ue.Vector3[0].copyFromFloats(0, 0, 0), ue.Quaternion[0].copyFromFloats(0, 0, 0, 1), ue.Vector3[1].copyFromFloats(1, 1, 1);
        for (let p = 0; p < f; ++p)
          v && S.FromArrayToRef(v, p * 3, ue.Vector3[0]), u && Ze.FromArrayToRef(u, p * 4, ue.Quaternion[0]), l && S.FromArrayToRef(l, p * 3, ue.Vector3[1]), he.ComposeToRef(ue.Vector3[1], ue.Quaternion[0], ue.Vector3[0], ue.Matrix[0]), ue.Matrix[0].copyToArray(P, p * 16);
        for (const p of t._primitiveBabylonMeshes)
          p.thinInstanceSetBuffer("matrix", P, 16, !0);
        return d;
      }));
    });
  }
}
Jr.RegisterExtension(QF, (A) => new bXe(A));
const YF = "EXT_meshopt_compression";
class xXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = YF, this.enabled = e.isExtensionUsed(YF), this._loader = e;
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadBufferViewAsync(e, t) {
    return Jr.LoadExtensionAsync(e, t, this.name, (r, n) => {
      const i = t;
      if (i._meshOptData)
        return i._meshOptData;
      const s = ei.Get(`${e}/buffer`, this._loader.gltf.buffers, n.buffer);
      return i._meshOptData = this._loader.loadBufferAsync(`/buffers/${s.index}`, s, n.byteOffset || 0, n.byteLength).then((a) => Q2.Default.decodeGltfBufferAsync(a, n.count, n.byteStride, n.mode, n.filter)), i._meshOptData;
    });
  }
}
Jr.RegisterExtension(YF, (A) => new xXe(A));
const MF = "EXT_texture_webp";
class DXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = MF, this._loader = e, this.enabled = e.isExtensionUsed(MF);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  _loadTextureAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = t.sampler == null ? Jr.DefaultSampler : ei.Get(`${e}/sampler`, this._loader.gltf.samplers, t.sampler), a = ei.Get(`${n}/source`, this._loader.gltf.images, i.source);
      return this._loader._createTextureAsync(e, s, a, (f) => {
        r(f);
      }, void 0, !t._textureInfo.nonColorData);
    });
  }
}
Jr.RegisterExtension(MF, (A) => new DXe(A));
const LF = "KHR_draco_mesh_compression";
class jXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = LF, this.useNormalizedFlagFromAccessor = !0, this._loader = e, this.enabled = Yd.DecoderAvailable && this._loader.isExtensionUsed(LF);
  }
  /** @internal */
  dispose() {
    delete this.dracoCompression, this._loader = null;
  }
  /**
   * @internal
   */
  _loadVertexDataAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      if (t.mode != null) {
        if (t.mode !== 5 && t.mode !== 4)
          throw new Error(`${e}: Unsupported mode ${t.mode}`);
        if (t.mode === 5)
          throw new Error(`${e}: Mode ${t.mode} is not currently supported`);
      }
      const s = {}, a = {}, f = (d, v) => {
        const u = i.attributes[d];
        if (u != null && (r._delayInfo = r._delayInfo || [], r._delayInfo.indexOf(v) === -1 && r._delayInfo.push(v), s[v] = u, this.useNormalizedFlagFromAccessor)) {
          const l = ei.TryGet(this._loader.gltf.accessors, t.attributes[d]);
          l && (a[v] = l.normalized || !1);
        }
      };
      f("POSITION", J.PositionKind), f("NORMAL", J.NormalKind), f("TANGENT", J.TangentKind), f("TEXCOORD_0", J.UVKind), f("TEXCOORD_1", J.UV2Kind), f("TEXCOORD_2", J.UV3Kind), f("TEXCOORD_3", J.UV4Kind), f("TEXCOORD_4", J.UV5Kind), f("TEXCOORD_5", J.UV6Kind), f("JOINTS_0", J.MatricesIndicesKind), f("WEIGHTS_0", J.MatricesWeightsKind), f("COLOR_0", J.ColorKind);
      const o = ei.Get(n, this._loader.gltf.bufferViews, i.bufferView);
      return o._dracoBabylonGeometry || (o._dracoBabylonGeometry = this._loader.loadBufferViewAsync(`/bufferViews/${o.index}`, o).then((d) => (this.dracoCompression || Yd.Default)._decodeMeshToGeometryForGltfAsync(r.name, this._loader.babylonScene, d, s, a).catch((u) => {
        throw new Error(`${e}: ${u.message}`);
      }))), o._dracoBabylonGeometry;
    });
  }
}
Jr.RegisterExtension(LF, (A) => new jXe(A));
const KF = "KHR_lights_punctual";
class wXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = KF, this._loader = e, this.enabled = this._loader.isExtensionUsed(KF);
  }
  /** @internal */
  dispose() {
    this._loader = null, delete this._lights;
  }
  /** @internal */
  onLoading() {
    const e = this._loader.gltf.extensions;
    if (e && e[this.name]) {
      const t = e[this.name];
      this._lights = t.lights, ei.Assign(this._lights);
    }
  }
  /**
   * @internal
   */
  loadNodeAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => (this._loader._allMaterialsDirtyRequired = !0, this._loader.loadNodeAsync(e, t, (s) => {
      let a;
      const f = ei.Get(n, this._lights, i.light), o = f.name || s.name;
      switch (this._loader.babylonScene._blockEntityCollection = !!this._loader._assetContainer, f.type) {
        case "directional": {
          const d = new IA(o, S.Backward(), this._loader.babylonScene);
          d.position.setAll(0), a = d;
          break;
        }
        case "point": {
          a = new ag(o, S.Zero(), this._loader.babylonScene);
          break;
        }
        case "spot": {
          const d = new nA(o, S.Zero(), S.Backward(), 0, 1, this._loader.babylonScene);
          d.angle = (f.spot && f.spot.outerConeAngle || Math.PI / 4) * 2, d.innerAngle = (f.spot && f.spot.innerConeAngle || 0) * 2, a = d;
          break;
        }
        default:
          throw this._loader.babylonScene._blockEntityCollection = !1, new Error(`${n}: Invalid light type (${f.type})`);
      }
      a._parentContainer = this._loader._assetContainer, this._loader.babylonScene._blockEntityCollection = !1, f._babylonLight = a, a.falloffType = ci.FALLOFF_GLTF, a.diffuse = f.color ? Ne.FromArray(f.color) : Ne.White(), a.intensity = f.intensity == null ? 1 : f.intensity, a.range = f.range == null ? Number.MAX_VALUE : f.range, a.parent = s, this._loader._babylonLights.push(a), Jr.AddPointerMetadata(a, n), r(s);
    })));
  }
}
Jr.RegisterExtension(KF, (A) => new wXe(A));
const JF = "KHR_materials_pbrSpecularGlossiness";
class mXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = JF, this.order = 200, this._loader = e, this.enabled = this._loader.isExtensionUsed(JF);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialBasePropertiesAsync(e, t, r)), s.push(this._loadSpecularGlossinessPropertiesAsync(n, t, i, r)), this._loader.loadMaterialAlphaProperties(e, t, r), Promise.all(s).then(() => {
      });
    });
  }
  _loadSpecularGlossinessPropertiesAsync(e, t, r, n) {
    if (!(n instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const i = new Array();
    return n.metallic = null, n.roughness = null, r.diffuseFactor ? (n.albedoColor = Ne.FromArray(r.diffuseFactor), n.alpha = r.diffuseFactor[3]) : n.albedoColor = Ne.White(), n.reflectivityColor = r.specularFactor ? Ne.FromArray(r.specularFactor) : Ne.White(), n.microSurface = r.glossinessFactor == null ? 1 : r.glossinessFactor, r.diffuseTexture && i.push(this._loader.loadTextureInfoAsync(`${e}/diffuseTexture`, r.diffuseTexture, (s) => {
      s.name = `${n.name} (Diffuse)`, n.albedoTexture = s;
    })), r.specularGlossinessTexture && (i.push(this._loader.loadTextureInfoAsync(`${e}/specularGlossinessTexture`, r.specularGlossinessTexture, (s) => {
      s.name = `${n.name} (Specular Glossiness)`, n.reflectivityTexture = s, n.reflectivityTexture.hasAlpha = !0;
    })), n.useMicroSurfaceFromReflectivityMapAlpha = !0), Promise.all(i).then(() => {
    });
  }
}
Jr.RegisterExtension(JF, (A) => new mXe(A));
const zF = "KHR_materials_unlit";
class BXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = zF, this.order = 210, this._loader = e, this.enabled = this._loader.isExtensionUsed(zF);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, () => this._loadUnlitPropertiesAsync(e, t, r));
  }
  _loadUnlitPropertiesAsync(e, t, r) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const n = new Array();
    r.unlit = !0;
    const i = t.pbrMetallicRoughness;
    return i && (i.baseColorFactor ? (r.albedoColor = Ne.FromArray(i.baseColorFactor), r.alpha = i.baseColorFactor[3]) : r.albedoColor = Ne.White(), i.baseColorTexture && n.push(this._loader.loadTextureInfoAsync(`${e}/baseColorTexture`, i.baseColorTexture, (s) => {
      s.name = `${r.name} (Base Color)`, r.albedoTexture = s;
    }))), t.doubleSided && (r.backFaceCulling = !1, r.twoSidedLighting = !0), this._loader.loadMaterialAlphaProperties(e, t, r), Promise.all(n).then(() => {
    });
  }
}
Jr.RegisterExtension(zF, (A) => new BXe(A));
const GF = "KHR_materials_clearcoat";
class WXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = GF, this.order = 190, this._loader = e, this.enabled = this._loader.isExtensionUsed(GF);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialPropertiesAsync(e, t, r)), s.push(this._loadClearCoatPropertiesAsync(n, i, r)), Promise.all(s).then(() => {
      });
    });
  }
  _loadClearCoatPropertiesAsync(e, t, r) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const n = new Array();
    return r.clearCoat.isEnabled = !0, r.clearCoat.useRoughnessFromMainTexture = !1, r.clearCoat.remapF0OnInterfaceChange = !1, t.clearcoatFactor != null ? r.clearCoat.intensity = t.clearcoatFactor : r.clearCoat.intensity = 0, t.clearcoatTexture && n.push(this._loader.loadTextureInfoAsync(`${e}/clearcoatTexture`, t.clearcoatTexture, (i) => {
      i.name = `${r.name} (ClearCoat Intensity)`, r.clearCoat.texture = i;
    })), t.clearcoatRoughnessFactor != null ? r.clearCoat.roughness = t.clearcoatRoughnessFactor : r.clearCoat.roughness = 0, t.clearcoatRoughnessTexture && (t.clearcoatRoughnessTexture.nonColorData = !0, n.push(this._loader.loadTextureInfoAsync(`${e}/clearcoatRoughnessTexture`, t.clearcoatRoughnessTexture, (i) => {
      i.name = `${r.name} (ClearCoat Roughness)`, r.clearCoat.textureRoughness = i;
    }))), t.clearcoatNormalTexture && (t.clearcoatNormalTexture.nonColorData = !0, n.push(this._loader.loadTextureInfoAsync(`${e}/clearcoatNormalTexture`, t.clearcoatNormalTexture, (i) => {
      i.name = `${r.name} (ClearCoat Normal)`, r.clearCoat.bumpTexture = i;
    })), r.invertNormalMapX = !r.getScene().useRightHandedSystem, r.invertNormalMapY = r.getScene().useRightHandedSystem, t.clearcoatNormalTexture.scale != null && (r.clearCoat.bumpTexture.level = t.clearcoatNormalTexture.scale)), Promise.all(n).then(() => {
    });
  }
}
Jr.RegisterExtension(GF, (A) => new WXe(A));
const ZF = "KHR_materials_iridescence";
class SXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = ZF, this.order = 195, this._loader = e, this.enabled = this._loader.isExtensionUsed(ZF);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialPropertiesAsync(e, t, r)), s.push(this._loadIridescencePropertiesAsync(n, i, r)), Promise.all(s).then(() => {
      });
    });
  }
  _loadIridescencePropertiesAsync(e, t, r) {
    var n, i, s, a, f;
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const o = new Array();
    return r.iridescence.isEnabled = !0, r.iridescence.intensity = (n = t.iridescenceFactor) !== null && n !== void 0 ? n : 0, r.iridescence.indexOfRefraction = (s = (i = t.iridescenceIor) !== null && i !== void 0 ? i : t.iridescenceIOR) !== null && s !== void 0 ? s : 1.3, r.iridescence.minimumThickness = (a = t.iridescenceThicknessMinimum) !== null && a !== void 0 ? a : 100, r.iridescence.maximumThickness = (f = t.iridescenceThicknessMaximum) !== null && f !== void 0 ? f : 400, t.iridescenceTexture && o.push(this._loader.loadTextureInfoAsync(`${e}/iridescenceTexture`, t.iridescenceTexture, (d) => {
      d.name = `${r.name} (Iridescence Intensity)`, r.iridescence.texture = d;
    })), t.iridescenceThicknessTexture && o.push(this._loader.loadTextureInfoAsync(`${e}/iridescenceThicknessTexture`, t.iridescenceThicknessTexture, (d) => {
      d.name = `${r.name} (Iridescence Thickness)`, r.iridescence.thicknessTexture = d;
    })), Promise.all(o).then(() => {
    });
  }
}
Jr.RegisterExtension(ZF, (A) => new SXe(A));
const _F = "KHR_materials_anisotropy";
class UXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = _F, this.order = 195, this._loader = e, this.enabled = this._loader.isExtensionUsed(_F);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialPropertiesAsync(e, t, r)), s.push(this._loadIridescencePropertiesAsync(n, i, r)), Promise.all(s).then(() => {
      });
    });
  }
  _loadIridescencePropertiesAsync(e, t, r) {
    var n, i;
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const s = new Array();
    return r.anisotropy.isEnabled = !0, r.anisotropy.intensity = (n = t.anisotropyStrength) !== null && n !== void 0 ? n : 0, r.anisotropy.angle = (i = t.anisotropyRotation) !== null && i !== void 0 ? i : 0, t.anisotropyTexture && s.push(this._loader.loadTextureInfoAsync(`${e}/anisotropyTexture`, t.anisotropyTexture, (a) => {
      a.name = `${r.name} (Anisotropy Intensity)`, r.anisotropy.texture = a;
    })), Promise.all(s).then(() => {
    });
  }
}
Jr.RegisterExtension(_F, (A) => new UXe(A));
const $F = "KHR_materials_emissive_strength";
class IXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = $F, this.order = 170, this._loader = e, this.enabled = this._loader.isExtensionUsed($F);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => this._loader.loadMaterialPropertiesAsync(e, t, r).then(() => {
      this._loadEmissiveProperties(n, i, r);
    }));
  }
  _loadEmissiveProperties(e, t, r) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    t.emissiveStrength !== void 0 && r.emissiveColor.scaleToRef(t.emissiveStrength, r.emissiveColor);
  }
}
Jr.RegisterExtension($F, (A) => new IXe(A));
const eN = "KHR_materials_sheen";
class RXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = eN, this.order = 190, this._loader = e, this.enabled = this._loader.isExtensionUsed(eN);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialPropertiesAsync(e, t, r)), s.push(this._loadSheenPropertiesAsync(n, i, r)), Promise.all(s).then(() => {
      });
    });
  }
  _loadSheenPropertiesAsync(e, t, r) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const n = new Array();
    return r.sheen.isEnabled = !0, r.sheen.intensity = 1, t.sheenColorFactor != null ? r.sheen.color = Ne.FromArray(t.sheenColorFactor) : r.sheen.color = Ne.Black(), t.sheenColorTexture && n.push(this._loader.loadTextureInfoAsync(`${e}/sheenColorTexture`, t.sheenColorTexture, (i) => {
      i.name = `${r.name} (Sheen Color)`, r.sheen.texture = i;
    })), t.sheenRoughnessFactor !== void 0 ? r.sheen.roughness = t.sheenRoughnessFactor : r.sheen.roughness = 0, t.sheenRoughnessTexture && (t.sheenRoughnessTexture.nonColorData = !0, n.push(this._loader.loadTextureInfoAsync(`${e}/sheenRoughnessTexture`, t.sheenRoughnessTexture, (i) => {
      i.name = `${r.name} (Sheen Roughness)`, r.sheen.textureRoughness = i;
    }))), r.sheen.albedoScaling = !0, r.sheen.useRoughnessFromMainTexture = !1, Promise.all(n).then(() => {
    });
  }
}
Jr.RegisterExtension(eN, (A) => new RXe(A));
const tN = "KHR_materials_specular";
class VXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = tN, this.order = 190, this._loader = e, this.enabled = this._loader.isExtensionUsed(tN);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialPropertiesAsync(e, t, r)), s.push(this._loadSpecularPropertiesAsync(n, i, r)), Promise.all(s).then(() => {
      });
    });
  }
  _loadSpecularPropertiesAsync(e, t, r) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const n = new Array();
    return t.specularFactor !== void 0 && (r.metallicF0Factor = t.specularFactor), t.specularColorFactor !== void 0 && (r.metallicReflectanceColor = Ne.FromArray(t.specularColorFactor)), t.specularTexture && (t.specularTexture.nonColorData = !0, n.push(this._loader.loadTextureInfoAsync(`${e}/specularTexture`, t.specularTexture, (i) => {
      i.name = `${r.name} (Specular F0 Strength)`, r.metallicReflectanceTexture = i, r.useOnlyMetallicFromMetallicReflectanceTexture = !0;
    }))), t.specularColorTexture && n.push(this._loader.loadTextureInfoAsync(`${e}/specularColorTexture`, t.specularColorTexture, (i) => {
      i.name = `${r.name} (Specular F0 Color)`, r.reflectanceTexture = i;
    })), Promise.all(n).then(() => {
    });
  }
}
Jr.RegisterExtension(tN, (A) => new VXe(A));
const rN = "KHR_materials_ior";
class Oy {
  /**
   * @internal
   */
  constructor(e) {
    this.name = rN, this.order = 180, this._loader = e, this.enabled = this._loader.isExtensionUsed(rN);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialPropertiesAsync(e, t, r)), s.push(this._loadIorPropertiesAsync(n, i, r)), Promise.all(s).then(() => {
      });
    });
  }
  _loadIorPropertiesAsync(e, t, r) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    return t.ior !== void 0 ? r.indexOfRefraction = t.ior : r.indexOfRefraction = Oy._DEFAULT_IOR, Promise.resolve();
  }
}
Oy._DEFAULT_IOR = 1.5;
Jr.RegisterExtension(rN, (A) => new Oy(A));
const yl = "KHR_materials_variants";
class Qx {
  /**
   * @internal
   */
  constructor(e) {
    this.name = yl, this._loader = e, this.enabled = this._loader.isExtensionUsed(yl);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * Gets the list of available variant names for this asset.
   * @param rootMesh The glTF root mesh
   * @returns the list of all the variant names for this model
   */
  static GetAvailableVariants(e) {
    const t = this._GetExtensionMetadata(e);
    return t ? Object.keys(t.variants) : [];
  }
  /**
   * Gets the list of available variant names for this asset.
   * @param rootMesh The glTF root mesh
   * @returns the list of all the variant names for this model
   */
  getAvailableVariants(e) {
    return Qx.GetAvailableVariants(e);
  }
  /**
   * Select a variant given a variant name or a list of variant names.
   * @param rootMesh The glTF root mesh
   * @param variantName The variant name(s) to select.
   */
  static SelectVariant(e, t) {
    const r = this._GetExtensionMetadata(e);
    if (!r)
      throw new Error(`Cannot select variant on a glTF mesh that does not have the ${yl} extension`);
    const n = (i) => {
      const s = r.variants[i];
      if (s)
        for (const a of s)
          a.mesh.material = a.material;
    };
    if (t instanceof Array)
      for (const i of t)
        n(i);
    else
      n(t);
    r.lastSelected = t;
  }
  /**
   * Select a variant given a variant name or a list of variant names.
   * @param rootMesh The glTF root mesh
   * @param variantName The variant name(s) to select.
   */
  selectVariant(e, t) {
    return Qx.SelectVariant(e, t);
  }
  /**
   * Reset back to the original before selecting a variant.
   * @param rootMesh The glTF root mesh
   */
  static Reset(e) {
    const t = this._GetExtensionMetadata(e);
    if (!t)
      throw new Error(`Cannot reset on a glTF mesh that does not have the ${yl} extension`);
    for (const r of t.original)
      r.mesh.material = r.material;
    t.lastSelected = null;
  }
  /**
   * Reset back to the original before selecting a variant.
   * @param rootMesh The glTF root mesh
   */
  reset(e) {
    return Qx.Reset(e);
  }
  /**
   * Gets the last selected variant name(s) or null if original.
   * @param rootMesh The glTF root mesh
   * @returns The selected variant name(s).
   */
  static GetLastSelectedVariant(e) {
    const t = this._GetExtensionMetadata(e);
    if (!t)
      throw new Error(`Cannot get the last selected variant on a glTF mesh that does not have the ${yl} extension`);
    return t.lastSelected;
  }
  /**
   * Gets the last selected variant name(s) or null if original.
   * @param rootMesh The glTF root mesh
   * @returns The selected variant name(s).
   */
  getLastSelectedVariant(e) {
    return Qx.GetLastSelectedVariant(e);
  }
  static _GetExtensionMetadata(e) {
    var t, r;
    return ((r = (t = e == null ? void 0 : e._internalMetadata) === null || t === void 0 ? void 0 : t.gltf) === null || r === void 0 ? void 0 : r[yl]) || null;
  }
  /** @internal */
  onLoading() {
    const e = this._loader.gltf.extensions;
    if (e && e[this.name]) {
      const t = e[this.name];
      this._variants = t.variants;
    }
  }
  /**
   * @internal
   */
  _loadMeshPrimitiveAsync(e, t, r, n, i, s) {
    return Jr.LoadExtensionAsync(e, i, this.name, (a, f) => {
      const o = new Array();
      return o.push(this._loader._loadMeshPrimitiveAsync(e, t, r, n, i, (d) => {
        if (s(d), d instanceof Ee) {
          const v = Jr._GetDrawMode(e, i.mode), u = this._loader.rootBabylonMesh, l = u ? u._internalMetadata = u._internalMetadata || {} : {}, P = l.gltf = l.gltf || {}, p = P[yl] = P[yl] || { lastSelected: null, original: [], variants: {} };
          p.original.push({ mesh: d, material: d.material });
          for (let c = 0; c < f.mappings.length; ++c) {
            const H = f.mappings[c], T = ei.Get(`${a}/mappings/${c}/material`, this._loader.gltf.materials, H.material);
            o.push(this._loader._loadMaterialAsync(`#/materials/${H.material}`, T, d, v, (q) => {
              for (let b = 0; b < H.variants.length; ++b) {
                const j = H.variants[b], w = ei.Get(`/extensions/${yl}/variants/${j}`, this._variants, j);
                p.variants[w.name] = p.variants[w.name] || [], p.variants[w.name].push({
                  mesh: d,
                  material: q
                }), d.onClonedObservable.add((m) => {
                  const I = m;
                  let N = null, k = I;
                  do {
                    if (k = k.parent, !k)
                      return;
                    N = Qx._GetExtensionMetadata(k);
                  } while (N === null);
                  if (u && N === Qx._GetExtensionMetadata(u)) {
                    k._internalMetadata = {};
                    for (const R in u._internalMetadata)
                      k._internalMetadata[R] = u._internalMetadata[R];
                    k._internalMetadata.gltf = [];
                    for (const R in u._internalMetadata.gltf)
                      k._internalMetadata.gltf[R] = u._internalMetadata.gltf[R];
                    k._internalMetadata.gltf[yl] = { lastSelected: null, original: [], variants: {} };
                    for (const R of N.original)
                      k._internalMetadata.gltf[yl].original.push({
                        mesh: R.mesh,
                        material: R.material
                      });
                    for (const R in N.variants)
                      if (Object.prototype.hasOwnProperty.call(N.variants, R)) {
                        k._internalMetadata.gltf[yl].variants[R] = [];
                        for (const y of N.variants[R])
                          k._internalMetadata.gltf[yl].variants[R].push({
                            mesh: y.mesh,
                            material: y.material
                          });
                      }
                    N = k._internalMetadata.gltf[yl];
                  }
                  for (const R of N.original)
                    R.mesh === d && (R.mesh = I);
                  for (const R of N.variants[w.name])
                    R.mesh === d && (R.mesh = I);
                });
              }
            }));
          }
        }
      })), Promise.all(o).then(([d]) => d);
    });
  }
}
Jr.RegisterExtension(yl, (A) => new Qx(A));
class nM {
  /**
   * Creates the default options for the helper.
   */
  static _GetDefaultOptions() {
    return {
      renderSize: 1024,
      samples: 4,
      lodGenerationScale: 1,
      lodGenerationOffset: -4,
      renderTargetTextureType: et.TEXTURETYPE_HALF_FLOAT,
      generateMipmaps: !0
    };
  }
  /**
   * constructor
   * @param options Defines the options we want to customize the helper
   * @param scene The scene to add the material to
   */
  constructor(e, t) {
    this._opaqueRenderTarget = null, this._opaqueMeshesCache = [], this._transparentMeshesCache = [], this._materialObservers = {}, this._options = {
      ...nM._GetDefaultOptions(),
      ...e
    }, this._scene = t, this._scene._transmissionHelper = this, this.onErrorObservable = new Oe(), this._scene.onDisposeObservable.addOnce(() => {
      this.dispose();
    }), this._parseScene(), this._setupRenderTargets();
  }
  /**
   * Updates the background according to the new options
   * @param options
   */
  updateOptions(e) {
    if (!Object.keys(e).filter((i) => this._options[i] !== e[i]).length)
      return;
    const r = {
      ...this._options,
      ...e
    }, n = this._options;
    this._options = r, r.renderSize !== n.renderSize || r.renderTargetTextureType !== n.renderTargetTextureType || r.generateMipmaps !== n.generateMipmaps || !this._opaqueRenderTarget ? this._setupRenderTargets() : (this._opaqueRenderTarget.samples = r.samples, this._opaqueRenderTarget.lodGenerationScale = r.lodGenerationScale, this._opaqueRenderTarget.lodGenerationOffset = r.lodGenerationOffset);
  }
  /**
   * Gets the opaque render target texture or null if not available.
   */
  getOpaqueTarget() {
    return this._opaqueRenderTarget;
  }
  _shouldRenderAsTransmission(e) {
    return e ? !!(e instanceof mr && e.subSurface.isRefractionEnabled) : !1;
  }
  _addMesh(e) {
    this._materialObservers[e.uniqueId] = e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)), ye.SetImmediate(() => {
      this._shouldRenderAsTransmission(e.material) ? (e.material.refractionTexture = this._opaqueRenderTarget, this._transparentMeshesCache.indexOf(e) === -1 && this._transparentMeshesCache.push(e)) : this._opaqueMeshesCache.indexOf(e) === -1 && this._opaqueMeshesCache.push(e);
    });
  }
  _removeMesh(e) {
    e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]), delete this._materialObservers[e.uniqueId];
    let t = this._transparentMeshesCache.indexOf(e);
    t !== -1 && this._transparentMeshesCache.splice(t, 1), t = this._opaqueMeshesCache.indexOf(e), t !== -1 && this._opaqueMeshesCache.splice(t, 1);
  }
  _parseScene() {
    this._scene.meshes.forEach(this._addMesh.bind(this)), this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)), this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this));
  }
  // When one of the meshes in the scene has its material changed, make sure that it's in the correct cache list.
  _onMeshMaterialChanged(e) {
    const t = this._transparentMeshesCache.indexOf(e), r = this._opaqueMeshesCache.indexOf(e);
    this._shouldRenderAsTransmission(e.material) ? (e.material instanceof mr && (e.material.subSurface.refractionTexture = this._opaqueRenderTarget), r !== -1 ? (this._opaqueMeshesCache.splice(r, 1), this._transparentMeshesCache.push(e)) : t === -1 && this._transparentMeshesCache.push(e)) : t !== -1 ? (this._transparentMeshesCache.splice(t, 1), this._opaqueMeshesCache.push(e)) : r === -1 && this._opaqueMeshesCache.push(e);
  }
  /**
   * @internal
   * Check if the opaque render target has not been disposed and can still be used.
   * @returns
   */
  _isRenderTargetValid() {
    var e;
    return ((e = this._opaqueRenderTarget) === null || e === void 0 ? void 0 : e.getInternalTexture()) !== null;
  }
  /**
   * @internal
   * Setup the render targets according to the specified options.
   */
  _setupRenderTargets() {
    var e, t;
    this._opaqueRenderTarget && this._opaqueRenderTarget.dispose(), this._opaqueRenderTarget = new Ta("opaqueSceneTexture", this._options.renderSize, this._scene, this._options.generateMipmaps, void 0, this._options.renderTargetTextureType), this._opaqueRenderTarget.ignoreCameraViewport = !0, this._opaqueRenderTarget.renderList = this._opaqueMeshesCache, this._opaqueRenderTarget.clearColor = (t = (e = this._options.clearColor) === null || e === void 0 ? void 0 : e.clone()) !== null && t !== void 0 ? t : this._scene.clearColor.clone(), this._opaqueRenderTarget.gammaSpace = !1, this._opaqueRenderTarget.lodGenerationScale = this._options.lodGenerationScale, this._opaqueRenderTarget.lodGenerationOffset = this._options.lodGenerationOffset, this._opaqueRenderTarget.samples = this._options.samples, this._opaqueRenderTarget.renderSprites = !0, this._opaqueRenderTarget.renderParticles = !0;
    let r, n;
    this._opaqueRenderTarget.onBeforeBindObservable.add((i) => {
      n = this._scene.environmentIntensity, this._scene.environmentIntensity = 1, r = this._scene.imageProcessingConfiguration.applyByPostProcess, this._options.clearColor ? i.clearColor.copyFrom(this._options.clearColor) : this._scene.clearColor.toLinearSpaceToRef(i.clearColor, this._scene.getEngine().useExactSrgbConversions), this._scene.imageProcessingConfiguration._applyByPostProcess = !0;
    }), this._opaqueRenderTarget.onAfterUnbindObservable.add(() => {
      this._scene.environmentIntensity = n, this._scene.imageProcessingConfiguration._applyByPostProcess = r;
    }), this._transparentMeshesCache.forEach((i) => {
      this._shouldRenderAsTransmission(i.material) && (i.material.refractionTexture = this._opaqueRenderTarget);
    });
  }
  /**
   * Dispose all the elements created by the Helper.
   */
  dispose() {
    this._scene._transmissionHelper = void 0, this._opaqueRenderTarget && (this._opaqueRenderTarget.dispose(), this._opaqueRenderTarget = null), this._transparentMeshesCache = [], this._opaqueMeshesCache = [];
  }
}
const nN = "KHR_materials_transmission";
class CXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = nN, this.order = 175, this._loader = e, this.enabled = this._loader.isExtensionUsed(nN), this.enabled && (e.parent.transparencyAsCoverage = !0);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialBasePropertiesAsync(e, t, r)), s.push(this._loader.loadMaterialPropertiesAsync(e, t, r)), s.push(this._loadTransparentPropertiesAsync(n, t, r, i)), Promise.all(s).then(() => {
      });
    });
  }
  _loadTransparentPropertiesAsync(e, t, r, n) {
    var i, s;
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const a = r;
    if (a.subSurface.isRefractionEnabled = !0, a.subSurface.volumeIndexOfRefraction = 1, a.subSurface.useAlbedoToTintRefraction = !0, n.transmissionFactor !== void 0) {
      a.subSurface.refractionIntensity = n.transmissionFactor;
      const f = a.getScene();
      a.subSurface.refractionIntensity && !f._transmissionHelper ? new nM({}, a.getScene()) : a.subSurface.refractionIntensity && !(!((i = f._transmissionHelper) === null || i === void 0) && i._isRenderTargetValid()) && ((s = f._transmissionHelper) === null || s === void 0 || s._setupRenderTargets());
    } else
      return a.subSurface.refractionIntensity = 0, a.subSurface.isRefractionEnabled = !1, Promise.resolve();
    return a.subSurface.minimumThickness = 0, a.subSurface.maximumThickness = 0, n.transmissionTexture ? (n.transmissionTexture.nonColorData = !0, this._loader.loadTextureInfoAsync(`${e}/transmissionTexture`, n.transmissionTexture, void 0).then((f) => {
      a.subSurface.refractionIntensityTexture = f, a.subSurface.useGltfStyleTextures = !0;
    })) : Promise.resolve();
  }
}
Jr.RegisterExtension(nN, (A) => new CXe(A));
const iN = "KHR_materials_translucency";
class OXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = iN, this.order = 174, this._loader = e, this.enabled = this._loader.isExtensionUsed(iN), this.enabled && (e.parent.transparencyAsCoverage = !0);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialBasePropertiesAsync(e, t, r)), s.push(this._loader.loadMaterialPropertiesAsync(e, t, r)), s.push(this._loadTranslucentPropertiesAsync(n, t, r, i)), Promise.all(s).then(() => {
      });
    });
  }
  _loadTranslucentPropertiesAsync(e, t, r, n) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    const i = r;
    if (i.subSurface.isTranslucencyEnabled = !0, i.subSurface.volumeIndexOfRefraction = 1, i.subSurface.minimumThickness = 0, i.subSurface.maximumThickness = 0, i.subSurface.useAlbedoToTintTranslucency = !0, n.translucencyFactor !== void 0)
      i.subSurface.translucencyIntensity = n.translucencyFactor;
    else
      return i.subSurface.translucencyIntensity = 0, i.subSurface.isTranslucencyEnabled = !1, Promise.resolve();
    return n.translucencyTexture ? (n.translucencyTexture.nonColorData = !0, this._loader.loadTextureInfoAsync(`${e}/translucencyTexture`, n.translucencyTexture).then((s) => {
      i.subSurface.translucencyIntensityTexture = s;
    })) : Promise.resolve();
  }
}
Jr.RegisterExtension(iN, (A) => new OXe(A));
const sN = "KHR_materials_volume";
class yXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = sN, this.order = 173, this._loader = e, this.enabled = this._loader.isExtensionUsed(sN), this.enabled && this._loader._disableInstancedMesh++;
  }
  /** @internal */
  dispose() {
    this.enabled && this._loader._disableInstancedMesh--, this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialBasePropertiesAsync(e, t, r)), s.push(this._loader.loadMaterialPropertiesAsync(e, t, r)), s.push(this._loadVolumePropertiesAsync(n, t, r, i)), Promise.all(s).then(() => {
      });
    });
  }
  _loadVolumePropertiesAsync(e, t, r, n) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    if (!r.subSurface.isRefractionEnabled && !r.subSurface.isTranslucencyEnabled || !n.thicknessFactor)
      return Promise.resolve();
    r.subSurface.volumeIndexOfRefraction = r.indexOfRefraction;
    const i = n.attenuationDistance !== void 0 ? n.attenuationDistance : Number.MAX_VALUE;
    return r.subSurface.tintColorAtDistance = i, n.attenuationColor !== void 0 && n.attenuationColor.length == 3 && r.subSurface.tintColor.copyFromFloats(n.attenuationColor[0], n.attenuationColor[1], n.attenuationColor[2]), r.subSurface.minimumThickness = 0, r.subSurface.maximumThickness = n.thicknessFactor, r.subSurface.useThicknessAsDepth = !0, n.thicknessTexture ? (n.thicknessTexture.nonColorData = !0, this._loader.loadTextureInfoAsync(`${e}/thicknessTexture`, n.thicknessTexture).then((s) => {
      r.subSurface.thicknessTexture = s, r.subSurface.useGltfStyleTextures = !0;
    })) : Promise.resolve();
  }
}
Jr.RegisterExtension(sN, (A) => new yXe(A));
const aN = "KHR_materials_dispersion";
class kXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = aN, this.order = 174, this._loader = e, this.enabled = this._loader.isExtensionUsed(aN);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return s.push(this._loader.loadMaterialBasePropertiesAsync(e, t, r)), s.push(this._loader.loadMaterialPropertiesAsync(e, t, r)), s.push(this._loadDispersionPropertiesAsync(n, t, r, i)), Promise.all(s).then(() => {
      });
    });
  }
  _loadDispersionPropertiesAsync(e, t, r, n) {
    if (!(r instanceof mr))
      throw new Error(`${e}: Material type not supported`);
    return !r.subSurface.isRefractionEnabled || !n.dispersion || (r.subSurface.isDispersionEnabled = !0, r.subSurface.dispersion = n.dispersion), Promise.resolve();
  }
}
Jr.RegisterExtension(aN, (A) => new kXe(A));
const oN = "KHR_mesh_quantization";
class EXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = oN, this.enabled = e.isExtensionUsed(oN);
  }
  /** @internal */
  dispose() {
  }
}
Jr.RegisterExtension(oN, (A) => new EXe(A));
const fN = "KHR_texture_basisu";
class FXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = fN, this._loader = e, this.enabled = e.isExtensionUsed(fN);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  _loadTextureAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = t.sampler == null ? Jr.DefaultSampler : ei.Get(`${e}/sampler`, this._loader.gltf.samplers, t.sampler), a = ei.Get(`${n}/source`, this._loader.gltf.images, i.source);
      return this._loader._createTextureAsync(e, s, a, (f) => {
        r(f);
      }, t._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: !0 } : void 0, !t._textureInfo.nonColorData);
    });
  }
}
Jr.RegisterExtension(fN, (A) => new FXe(A));
const AN = "KHR_texture_transform";
class NXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = AN, this._loader = e, this.enabled = this._loader.isExtensionUsed(AN);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadTextureInfoAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => this._loader.loadTextureInfoAsync(e, t, (s) => {
      if (!(s instanceof We))
        throw new Error(`${n}: Texture type not supported`);
      i.offset && (s.uOffset = i.offset[0], s.vOffset = i.offset[1]), s.uRotationCenter = 0, s.vRotationCenter = 0, i.rotation && (s.wAng = -i.rotation), i.scale && (s.uScale = i.scale[0], s.vScale = i.scale[1]), i.texCoord != null && (s.coordinatesIndex = i.texCoord), r(s);
    }));
  }
}
Jr.RegisterExtension(AN, (A) => new NXe(A));
const dN = "KHR_xmp_json_ld";
class QXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = dN, this.order = 100, this._loader = e, this.enabled = this._loader.isExtensionUsed(dN);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * Called after the loader state changes to LOADING.
   */
  onLoading() {
    var e, t, r;
    if (this._loader.rootBabylonMesh === null)
      return;
    const n = (e = this._loader.gltf.extensions) === null || e === void 0 ? void 0 : e.KHR_xmp_json_ld, i = (r = (t = this._loader.gltf.asset) === null || t === void 0 ? void 0 : t.extensions) === null || r === void 0 ? void 0 : r.KHR_xmp_json_ld;
    if (n && i) {
      const s = +i.packet;
      n.packets && s < n.packets.length && (this._loader.rootBabylonMesh.metadata = this._loader.rootBabylonMesh.metadata || {}, this._loader.rootBabylonMesh.metadata.xmp = n.packets[s]);
    }
  }
}
Jr.RegisterExtension(dN, (A) => new QXe(A));
function FW(A, e, t, r) {
  return Ne.FromArray(e, t).scale(r);
}
function YXe(A, e, t, r) {
  return e[t + 3] * r;
}
function A1(A, e, t, r) {
  return e[t] * r;
}
function vN(A, e, t, r) {
  return -e[t] * r;
}
function PO(A, e, t, r) {
  return e[t + 1] * r;
}
function PZ(A, e, t, r) {
  return e[t] * r * 2;
}
function OE(A) {
  return {
    scale: [
      new wo(st.ANIMATIONTYPE_FLOAT, `${A}.uScale`, A1, () => 2),
      new wo(st.ANIMATIONTYPE_FLOAT, `${A}.vScale`, PO, () => 2)
    ],
    offset: [
      new wo(st.ANIMATIONTYPE_FLOAT, `${A}.uOffset`, A1, () => 2),
      new wo(st.ANIMATIONTYPE_FLOAT, `${A}.vOffset`, PO, () => 2)
    ],
    rotation: [new wo(st.ANIMATIONTYPE_FLOAT, `${A}.wAng`, vN, () => 1)]
  };
}
class Q8 extends HV {
  /** @internal */
  buildAnimations(e, t, r, n, i) {
    i(e._babylonCamera, this._buildAnimation(t, r, n));
  }
}
class wo extends HV {
  /** @internal */
  buildAnimations(e, t, r, n, i) {
    for (const s in e._data)
      i(e._data[s].babylonMaterial, this._buildAnimation(t, r, n));
  }
}
class dI extends HV {
  /** @internal */
  buildAnimations(e, t, r, n, i) {
    i(e._babylonLight, this._buildAnimation(t, r, n));
  }
}
const MXe = {
  __array__: {
    __target__: !0,
    ...XI
  }
}, LXe = {
  __array__: {
    __target__: !0,
    orthographic: {
      xmag: [
        new Q8(st.ANIMATIONTYPE_FLOAT, "orthoLeft", vN, () => 1),
        new Q8(st.ANIMATIONTYPE_FLOAT, "orthoRight", PO, () => 1)
      ],
      ymag: [
        new Q8(st.ANIMATIONTYPE_FLOAT, "orthoBottom", vN, () => 1),
        new Q8(st.ANIMATIONTYPE_FLOAT, "orthoTop", PO, () => 1)
      ],
      zfar: [new Q8(st.ANIMATIONTYPE_FLOAT, "maxZ", A1, () => 1)],
      znear: [new Q8(st.ANIMATIONTYPE_FLOAT, "minZ", A1, () => 1)]
    },
    perspective: {
      yfov: [new Q8(st.ANIMATIONTYPE_FLOAT, "fov", A1, () => 1)],
      zfar: [new Q8(st.ANIMATIONTYPE_FLOAT, "maxZ", A1, () => 1)],
      znear: [new Q8(st.ANIMATIONTYPE_FLOAT, "minZ", A1, () => 1)]
    }
  }
}, KXe = {
  __array__: {
    __target__: !0,
    pbrMetallicRoughness: {
      baseColorFactor: [
        new wo(st.ANIMATIONTYPE_COLOR3, "albedoColor", FW, () => 4),
        new wo(st.ANIMATIONTYPE_FLOAT, "alpha", YXe, () => 4)
      ],
      metallicFactor: [new wo(st.ANIMATIONTYPE_FLOAT, "metallic", A1, () => 1)],
      roughnessFactor: [new wo(st.ANIMATIONTYPE_FLOAT, "roughness", A1, () => 1)],
      baseColorTexture: {
        extensions: {
          KHR_texture_transform: OE("albedoTexture")
        }
      }
    },
    emissiveFactor: [new wo(st.ANIMATIONTYPE_COLOR3, "emissiveColor", FW, () => 3)],
    normalTexture: {
      scale: [new wo(st.ANIMATIONTYPE_FLOAT, "bumpTexture.level", A1, () => 1)]
    },
    occlusionTexture: {
      strength: [new wo(st.ANIMATIONTYPE_FLOAT, "ambientTextureStrength", A1, () => 1)],
      extensions: {
        KHR_texture_transform: OE("ambientTexture")
      }
    },
    emissiveTexture: {
      extensions: {
        KHR_texture_transform: OE("emissiveTexture")
      }
    },
    extensions: {
      KHR_materials_ior: {
        ior: [new wo(st.ANIMATIONTYPE_FLOAT, "indexOfRefraction", A1, () => 1)]
      },
      KHR_materials_clearcoat: {
        clearcoatFactor: [new wo(st.ANIMATIONTYPE_FLOAT, "clearCoat.intensity", A1, () => 1)],
        clearcoatRoughnessFactor: [new wo(st.ANIMATIONTYPE_FLOAT, "clearCoat.roughness", A1, () => 1)]
      },
      KHR_materials_sheen: {
        sheenColorFactor: [new wo(st.ANIMATIONTYPE_COLOR3, "sheen.color", FW, () => 3)],
        sheenRoughnessFactor: [new wo(st.ANIMATIONTYPE_FLOAT, "sheen.roughness", A1, () => 1)]
      },
      KHR_materials_specular: {
        specularFactor: [new wo(st.ANIMATIONTYPE_FLOAT, "metallicF0Factor", A1, () => 1)],
        specularColorFactor: [new wo(st.ANIMATIONTYPE_COLOR3, "metallicReflectanceColor", FW, () => 3)]
      },
      KHR_materials_emissive_strength: {
        emissiveStrength: [new wo(st.ANIMATIONTYPE_FLOAT, "emissiveIntensity", A1, () => 1)]
      },
      KHR_materials_transmission: {
        transmissionFactor: [new wo(st.ANIMATIONTYPE_FLOAT, "subSurface.refractionIntensity", A1, () => 1)]
      },
      KHR_materials_volume: {
        attenuationColor: [new wo(st.ANIMATIONTYPE_COLOR3, "subSurface.tintColor", FW, () => 3)],
        attenuationDistance: [new wo(st.ANIMATIONTYPE_FLOAT, "subSurface.tintColorAtDistance", A1, () => 1)],
        thicknessFactor: [new wo(st.ANIMATIONTYPE_FLOAT, "subSurface.maximumThickness", A1, () => 1)]
      },
      KHR_materials_dispersion: {
        dispersion: [new wo(st.ANIMATIONTYPE_FLOAT, "subSurface.dispersion", A1, () => 1)]
      },
      KHR_materials_iridescence: {
        iridescenceFactor: [new wo(st.ANIMATIONTYPE_FLOAT, "iridescence.intensity", A1, () => 1)],
        iridescenceIor: [new wo(st.ANIMATIONTYPE_FLOAT, "iridescence.indexOfRefraction", A1, () => 1)],
        iridescenceThicknessMinimum: [new wo(st.ANIMATIONTYPE_FLOAT, "iridescence.minimumThickness", A1, () => 1)],
        iridescenceThicknessMaximum: [new wo(st.ANIMATIONTYPE_FLOAT, "iridescence.maximumThickness", A1, () => 1)]
      },
      KHR_materials_anisotropy: {
        anisotropyStrength: [new wo(st.ANIMATIONTYPE_FLOAT, "anisotropy.intensity", A1, () => 1)],
        anisotropyRotation: [new wo(st.ANIMATIONTYPE_FLOAT, "anisotropy.angle", A1, () => 1)]
      }
    }
  }
}, JXe = {
  KHR_lights_punctual: {
    lights: {
      __array__: {
        __target__: !0,
        color: [new dI(st.ANIMATIONTYPE_COLOR3, "diffuse", FW, () => 3)],
        intensity: [new dI(st.ANIMATIONTYPE_FLOAT, "intensity", A1, () => 1)],
        range: [new dI(st.ANIMATIONTYPE_FLOAT, "range", A1, () => 1)],
        spot: {
          innerConeAngle: [new dI(st.ANIMATIONTYPE_FLOAT, "innerAngle", PZ, () => 1)],
          outerConeAngle: [new dI(st.ANIMATIONTYPE_FLOAT, "angle", PZ, () => 1)]
        }
      }
    }
  }
}, zXe = {
  nodes: MXe,
  materials: KXe,
  cameras: LXe,
  extensions: JXe
}, uN = "KHR_animation_pointer";
class GXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = uN, this._loader = e;
  }
  /**
   * Defines whether this extension is enabled.
   */
  get enabled() {
    return this._loader.isExtensionUsed(uN);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * Loads a glTF animation channel.
   * @param context The context when loading the asset
   * @param animationContext The context of the animation when loading the asset
   * @param animation The glTF animation property
   * @param channel The glTF animation channel property
   * @param onLoad Called for each animation loaded
   * @returns A void promise that resolves when the load is complete or null if not handled
   */
  _loadAnimationChannelAsync(e, t, r, n, i) {
    var s;
    const a = (s = n.target.extensions) === null || s === void 0 ? void 0 : s.KHR_animation_pointer;
    if (!a)
      return null;
    n.target.path !== "pointer" && Se.Warn(`${e}/target/path: Value (${n.target.path}) must be (pointer) when using the ${this.name} extension`), n.target.node != null && Se.Warn(`${e}/target/node: Value (${n.target.node}) must not be present when using the ${this.name} extension`);
    const f = `${e}/extensions/${this.name}`, o = a.pointer;
    if (!o)
      throw new Error(`${f}: Pointer is missing`);
    const d = this._parseAnimationPointer(`${f}/pointer`, o);
    return d ? this._loader._loadAnimationChannelFromTargetInfoAsync(e, t, r, n, d, i) : (Se.Warn(`${f}/pointer: Invalid pointer (${o}) skipped`), null);
  }
  /**
   * The pointer string is represented by a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901).
   * <animationPointer> := /<rootNode>/<assetIndex>/<propertyPath>
   * <rootNode> := "nodes" | "materials" | "meshes" | "cameras" | "extensions"
   * <assetIndex> := <digit> | <name>
   * <propertyPath> := <extensionPath> | <standardPath>
   * <extensionPath> := "extensions"/<name>/<standardPath>
   * <standardPath> := <name> | <name>/<standardPath>
   * <name> := W+
   * <digit> := D+
   *
   * Examples:
   *  - "/nodes/0/rotation"
   *  - "/materials/2/emissiveFactor"
   *  - "/materials/2/pbrMetallicRoughness/baseColorFactor"
   *  - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
   */
  _parseAnimationPointer(e, t) {
    if (!t.startsWith("/"))
      return Se.Warn(`${e}: Value (${t}) must start with a slash`), null;
    const r = t.split("/");
    r.shift();
    let n = zXe, i = this._loader.gltf, s;
    for (const a of r) {
      if (n.__array__)
        n = n.__array__;
      else if (n = n[a], !n)
        return null;
      i = i && i[a], n.__target__ && (s = i);
    }
    return !s || !Array.isArray(n) ? null : {
      target: s,
      properties: n
    };
  }
}
Jr.RegisterExtension(uN, (A) => new GXe(A));
const lN = "MSFT_audio_emitter";
class ZXe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = lN, this._loader = e, this.enabled = this._loader.isExtensionUsed(lN);
  }
  /** @internal */
  dispose() {
    this._loader = null, this._clips = null, this._emitters = null;
  }
  /** @internal */
  onLoading() {
    const e = this._loader.gltf.extensions;
    if (e && e[this.name]) {
      const t = e[this.name];
      this._clips = t.clips, this._emitters = t.emitters, ei.Assign(this._clips), ei.Assign(this._emitters);
    }
  }
  /**
   * @internal
   */
  loadSceneAsync(e, t) {
    return Jr.LoadExtensionAsync(e, t, this.name, (r, n) => {
      const i = new Array();
      i.push(this._loader.loadSceneAsync(e, t));
      for (const s of n.emitters) {
        const a = ei.Get(`${r}/emitters`, this._emitters, s);
        if (a.refDistance != null || a.maxDistance != null || a.rolloffFactor != null || a.distanceModel != null || a.innerAngle != null || a.outerAngle != null)
          throw new Error(`${r}: Direction or Distance properties are not allowed on emitters attached to a scene`);
        i.push(this._loadEmitterAsync(`${r}/emitters/${a.index}`, a));
      }
      return Promise.all(i).then(() => {
      });
    });
  }
  /**
   * @internal
   */
  loadNodeAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      const s = new Array();
      return this._loader.loadNodeAsync(n, t, (a) => {
        for (const f of i.emitters) {
          const o = ei.Get(`${n}/emitters`, this._emitters, f);
          s.push(this._loadEmitterAsync(`${n}/emitters/${o.index}`, o).then(() => {
            for (const d of o._babylonSounds)
              d.attachToMesh(a), (o.innerAngle != null || o.outerAngle != null) && (d.setLocalDirectionToMesh(S.Forward()), d.setDirectionalCone(2 * ye.ToDegrees(o.innerAngle == null ? Math.PI : o.innerAngle), 2 * ye.ToDegrees(o.outerAngle == null ? Math.PI : o.outerAngle), 0));
          }));
        }
        r(a);
      }).then((a) => Promise.all(s).then(() => a));
    });
  }
  /**
   * @internal
   */
  loadAnimationAsync(e, t) {
    return Jr.LoadExtensionAsync(e, t, this.name, (r, n) => this._loader.loadAnimationAsync(e, t).then((i) => {
      const s = new Array();
      ei.Assign(n.events);
      for (const a of n.events)
        s.push(this._loadAnimationEventAsync(`${r}/events/${a.index}`, e, t, a, i));
      return Promise.all(s).then(() => i);
    }));
  }
  _loadClipAsync(e, t) {
    if (t._objectURL)
      return t._objectURL;
    let r;
    if (t.uri)
      r = this._loader.loadUriAsync(e, t, t.uri);
    else {
      const n = ei.Get(`${e}/bufferView`, this._loader.gltf.bufferViews, t.bufferView);
      r = this._loader.loadBufferViewAsync(`/bufferViews/${n.index}`, n);
    }
    return t._objectURL = r.then((n) => URL.createObjectURL(new Blob([n], { type: t.mimeType }))), t._objectURL;
  }
  _loadEmitterAsync(e, t) {
    if (t._babylonSounds = t._babylonSounds || [], !t._babylonData) {
      const r = new Array(), n = t.name || `emitter${t.index}`, i = {
        loop: !1,
        autoplay: !1,
        volume: t.volume == null ? 1 : t.volume
      };
      for (let a = 0; a < t.clips.length; a++) {
        const f = `/extensions/${this.name}/clips`, o = ei.Get(f, this._clips, t.clips[a].clip);
        r.push(this._loadClipAsync(`${f}/${t.clips[a].clip}`, o).then((d) => {
          const v = t._babylonSounds[a] = new qc(n, d, this._loader.babylonScene, null, i);
          v.refDistance = t.refDistance || 1, v.maxDistance = t.maxDistance || 256, v.rolloffFactor = t.rolloffFactor || 1, v.distanceModel = t.distanceModel || "exponential";
        }));
      }
      const s = Promise.all(r).then(() => {
        const a = t.clips.map((o) => o.weight || 1), f = new lee(t.loop || !1, t._babylonSounds, a);
        t.innerAngle && (f.directionalConeInnerAngle = 2 * ye.ToDegrees(t.innerAngle)), t.outerAngle && (f.directionalConeOuterAngle = 2 * ye.ToDegrees(t.outerAngle)), t.volume && (f.volume = t.volume), t._babylonData.sound = f;
      });
      t._babylonData = {
        loaded: s
      };
    }
    return t._babylonData.loaded;
  }
  _getEventAction(e, t, r, n, i) {
    switch (r) {
      case "play":
        return (s) => {
          const a = (i || 0) + (s - n);
          t.play(a);
        };
      case "stop":
        return () => {
          t.stop();
        };
      case "pause":
        return () => {
          t.pause();
        };
      default:
        throw new Error(`${e}: Unsupported action ${r}`);
    }
  }
  _loadAnimationEventAsync(e, t, r, n, i) {
    if (i.targetedAnimations.length == 0)
      return Promise.resolve();
    const s = i.targetedAnimations[0], a = n.emitter, f = ei.Get(`/extensions/${this.name}/emitters`, this._emitters, a);
    return this._loadEmitterAsync(e, f).then(() => {
      const o = f._babylonData.sound;
      if (o) {
        const d = new wO(n.time, this._getEventAction(e, o, n.action, n.time, n.startOffset));
        s.animation.addEvent(d), i.onAnimationGroupEndObservable.add(() => {
          o.stop();
        }), i.onAnimationGroupPauseObservable.add(() => {
          o.pause();
        });
      }
    });
  }
}
Jr.RegisterExtension(lN, (A) => new ZXe(A));
const PN = "MSFT_lod";
class _Xe {
  /**
   * @internal
   */
  constructor(e) {
    this.name = PN, this.order = 100, this.maxLODsToLoad = 10, this.onNodeLODsLoadedObservable = new Oe(), this.onMaterialLODsLoadedObservable = new Oe(), this._bufferLODs = new Array(), this._nodeIndexLOD = null, this._nodeSignalLODs = new Array(), this._nodePromiseLODs = new Array(), this._nodeBufferLODs = new Array(), this._materialIndexLOD = null, this._materialSignalLODs = new Array(), this._materialPromiseLODs = new Array(), this._materialBufferLODs = new Array(), this._loader = e, this.enabled = this._loader.isExtensionUsed(PN);
  }
  /** @internal */
  dispose() {
    this._loader = null, this._nodeIndexLOD = null, this._nodeSignalLODs.length = 0, this._nodePromiseLODs.length = 0, this._nodeBufferLODs.length = 0, this._materialIndexLOD = null, this._materialSignalLODs.length = 0, this._materialPromiseLODs.length = 0, this._materialBufferLODs.length = 0, this.onMaterialLODsLoadedObservable.clear(), this.onNodeLODsLoadedObservable.clear();
  }
  /** @internal */
  onReady() {
    for (let e = 0; e < this._nodePromiseLODs.length; e++) {
      const t = Promise.all(this._nodePromiseLODs[e]).then(() => {
        e !== 0 && (this._loader.endPerformanceCounter(`Node LOD ${e}`), this._loader.log(`Loaded node LOD ${e}`)), this.onNodeLODsLoadedObservable.notifyObservers(e), e !== this._nodePromiseLODs.length - 1 && (this._loader.startPerformanceCounter(`Node LOD ${e + 1}`), this._loadBufferLOD(this._nodeBufferLODs, e + 1), this._nodeSignalLODs[e] && this._nodeSignalLODs[e].resolve());
      });
      this._loader._completePromises.push(t);
    }
    for (let e = 0; e < this._materialPromiseLODs.length; e++) {
      const t = Promise.all(this._materialPromiseLODs[e]).then(() => {
        e !== 0 && (this._loader.endPerformanceCounter(`Material LOD ${e}`), this._loader.log(`Loaded material LOD ${e}`)), this.onMaterialLODsLoadedObservable.notifyObservers(e), e !== this._materialPromiseLODs.length - 1 && (this._loader.startPerformanceCounter(`Material LOD ${e + 1}`), this._loadBufferLOD(this._materialBufferLODs, e + 1), this._materialSignalLODs[e] && this._materialSignalLODs[e].resolve());
      });
      this._loader._completePromises.push(t);
    }
  }
  /**
   * @internal
   */
  loadSceneAsync(e, t) {
    const r = this._loader.loadSceneAsync(e, t);
    return this._loadBufferLOD(this._bufferLODs, 0), r;
  }
  /**
   * @internal
   */
  loadNodeAsync(e, t, r) {
    return Jr.LoadExtensionAsync(e, t, this.name, (n, i) => {
      let s;
      const a = this._getLODs(n, t, this._loader.gltf.nodes, i.ids);
      this._loader.logOpen(`${n}`);
      for (let f = 0; f < a.length; f++) {
        const o = a[f];
        f !== 0 && (this._nodeIndexLOD = f, this._nodeSignalLODs[f] = this._nodeSignalLODs[f] || new MW());
        const d = (u) => {
          r(u), u.setEnabled(!1);
        }, v = this._loader.loadNodeAsync(`/nodes/${o.index}`, o, d).then((u) => {
          if (f !== 0) {
            const l = a[f - 1];
            l._babylonTransformNode && (this._disposeTransformNode(l._babylonTransformNode), delete l._babylonTransformNode);
          }
          return u.setEnabled(!0), u;
        });
        this._nodePromiseLODs[f] = this._nodePromiseLODs[f] || [], f === 0 ? s = v : (this._nodeIndexLOD = null, this._nodePromiseLODs[f].push(v));
      }
      return this._loader.logClose(), s;
    });
  }
  /**
   * @internal
   */
  _loadMaterialAsync(e, t, r, n, i) {
    return this._nodeIndexLOD ? null : Jr.LoadExtensionAsync(e, t, this.name, (s, a) => {
      let f;
      const o = this._getLODs(s, t, this._loader.gltf.materials, a.ids);
      this._loader.logOpen(`${s}`);
      for (let d = 0; d < o.length; d++) {
        const v = o[d];
        d !== 0 && (this._materialIndexLOD = d);
        const u = this._loader._loadMaterialAsync(`/materials/${v.index}`, v, r, n, (l) => {
          d === 0 && i(l);
        }).then((l) => {
          if (d !== 0) {
            i(l);
            const P = o[d - 1]._data;
            P[n] && (this._disposeMaterials([P[n].babylonMaterial]), delete P[n]);
          }
          return l;
        });
        this._materialPromiseLODs[d] = this._materialPromiseLODs[d] || [], d === 0 ? f = u : (this._materialIndexLOD = null, this._materialPromiseLODs[d].push(u));
      }
      return this._loader.logClose(), f;
    });
  }
  /**
   * @internal
   */
  _loadUriAsync(e, t, r) {
    if (this._nodeIndexLOD !== null) {
      this._loader.log("deferred");
      const n = this._nodeIndexLOD - 1;
      return this._nodeSignalLODs[n] = this._nodeSignalLODs[n] || new MW(), this._nodeSignalLODs[this._nodeIndexLOD - 1].promise.then(() => this._loader.loadUriAsync(e, t, r));
    } else if (this._materialIndexLOD !== null) {
      this._loader.log("deferred");
      const n = this._materialIndexLOD - 1;
      return this._materialSignalLODs[n] = this._materialSignalLODs[n] || new MW(), this._materialSignalLODs[n].promise.then(() => this._loader.loadUriAsync(e, t, r));
    }
    return null;
  }
  /**
   * @internal
   */
  loadBufferAsync(e, t, r, n) {
    if (this._loader.parent.useRangeRequests && !t.uri) {
      if (!this._loader.bin)
        throw new Error(`${e}: Uri is missing or the binary glTF is missing its binary chunk`);
      const i = (s, a) => {
        const f = r, o = f + n - 1;
        let d = s[a];
        return d ? (d.start = Math.min(d.start, f), d.end = Math.max(d.end, o)) : (d = { start: f, end: o, loaded: new MW() }, s[a] = d), d.loaded.promise.then((v) => new Uint8Array(v.buffer, v.byteOffset + r - d.start, n));
      };
      return this._loader.log("deferred"), this._nodeIndexLOD !== null ? i(this._nodeBufferLODs, this._nodeIndexLOD) : this._materialIndexLOD !== null ? i(this._materialBufferLODs, this._materialIndexLOD) : i(this._bufferLODs, 0);
    }
    return null;
  }
  _loadBufferLOD(e, t) {
    const r = e[t];
    r && (this._loader.log(`Loading buffer range [${r.start}-${r.end}]`), this._loader.bin.readAsync(r.start, r.end - r.start + 1).then((n) => {
      r.loaded.resolve(n);
    }, (n) => {
      r.loaded.reject(n);
    }));
  }
  /**
   * Gets an array of LOD properties from lowest to highest.
   * @param context
   * @param property
   * @param array
   * @param ids
   */
  _getLODs(e, t, r, n) {
    if (this.maxLODsToLoad <= 0)
      throw new Error("maxLODsToLoad must be greater than zero");
    const i = [];
    for (let s = n.length - 1; s >= 0; s--)
      if (i.push(ei.Get(`${e}/ids/${n[s]}`, r, n[s])), i.length === this.maxLODsToLoad)
        return i;
    return i.push(t), i;
  }
  _disposeTransformNode(e) {
    const t = [], r = e.material;
    r && t.push(r);
    for (const i of e.getChildMeshes())
      i.material && t.push(i.material);
    e.dispose();
    const n = t.filter((i) => this._loader.babylonScene.meshes.every((s) => s.material != i));
    this._disposeMaterials(n);
  }
  _disposeMaterials(e) {
    const t = {};
    for (const r of e) {
      for (const n of r.getActiveTextures())
        t[n.uniqueId] = n;
      r.dispose();
    }
    for (const r in t)
      for (const n of this._loader.babylonScene.materials)
        n.hasTexture(t[r]) && delete t[r];
    for (const r in t)
      t[r].dispose();
  }
}
Jr.RegisterExtension(PN, (A) => new _Xe(A));
const cN = "MSFT_minecraftMesh";
class $Xe {
  /** @internal */
  constructor(e) {
    this.name = cN, this._loader = e, this.enabled = this._loader.isExtensionUsed(cN);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /** @internal */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtraAsync(e, t, this.name, (n, i) => {
      if (i) {
        if (!(r instanceof mr))
          throw new Error(`${n}: Material type not supported`);
        const s = this._loader.loadMaterialPropertiesAsync(e, t, r);
        return r.needAlphaBlending() && (r.forceDepthWrite = !0, r.separateCullingPass = !0), r.backFaceCulling = r.forceDepthWrite, r.twoSidedLighting = !0, s;
      }
      return null;
    });
  }
}
Jr.RegisterExtension(cN, (A) => new $Xe(A));
const pN = "MSFT_sRGBFactors";
class e2e {
  /** @internal */
  constructor(e) {
    this.name = pN, this._loader = e, this.enabled = this._loader.isExtensionUsed(pN);
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /** @internal */
  loadMaterialPropertiesAsync(e, t, r) {
    return Jr.LoadExtraAsync(e, t, this.name, (n, i) => {
      if (i) {
        if (!(r instanceof mr))
          throw new Error(`${n}: Material type not supported`);
        const s = this._loader.loadMaterialPropertiesAsync(e, t, r), a = r.getScene().getEngine().useExactSrgbConversions;
        return r.albedoTexture || r.albedoColor.toLinearSpaceToRef(r.albedoColor, a), r.reflectivityTexture || r.reflectivityColor.toLinearSpaceToRef(r.reflectivityColor, a), s;
      }
      return null;
    });
  }
}
Jr.RegisterExtension(pN, (A) => new e2e(A));
const G1e = "ExtrasAsMetadata";
class t2e {
  _assignExtras(e, t) {
    if (t.extras && Object.keys(t.extras).length > 0) {
      const r = e.metadata = e.metadata || {}, n = r.gltf = r.gltf || {};
      n.extras = t.extras;
    }
  }
  /**
   * @internal
   */
  constructor(e) {
    this.name = G1e, this.enabled = !0, this._loader = e;
  }
  /** @internal */
  dispose() {
    this._loader = null;
  }
  /**
   * @internal
   */
  loadNodeAsync(e, t, r) {
    return this._loader.loadNodeAsync(e, t, (n) => {
      this._assignExtras(n, t), r(n);
    });
  }
  /**
   * @internal
   */
  loadCameraAsync(e, t, r) {
    return this._loader.loadCameraAsync(e, t, (n) => {
      this._assignExtras(n, t), r(n);
    });
  }
  /**
   * @internal
   */
  createMaterial(e, t, r) {
    const n = this._loader.createMaterial(e, t, r);
    return this._assignExtras(n, t), n;
  }
}
Jr.RegisterExtension(G1e, (A) => new t2e(A));
class KH {
  constructor() {
    this.materials = [];
  }
  /**
   * This function will read the mtl file and create each material described inside
   * This function could be improve by adding :
   * -some component missing (Ni, Tf...)
   * -including the specific options available
   *
   * @param scene defines the scene the material will be created in
   * @param data defines the mtl data to parse
   * @param rootUrl defines the rooturl to use in order to load relative dependencies
   * @param assetContainer defines the asset container to store the material in (can be null)
   */
  parseMTL(e, t, r, n) {
    if (t instanceof ArrayBuffer)
      return;
    const i = t.split(`
`), s = /\s+/;
    let a, f = null;
    for (let o = 0; o < i.length; o++) {
      const d = i[o].trim();
      if (d.length === 0 || d.charAt(0) === "#")
        continue;
      const v = d.indexOf(" ");
      let u = v >= 0 ? d.substring(0, v) : d;
      u = u.toLowerCase();
      const l = v >= 0 ? d.substring(v + 1).trim() : "";
      if (u === "newmtl")
        f && this.materials.push(f), e._blockEntityCollection = !!n, f = new Wt(l, e), f._parentContainer = n, e._blockEntityCollection = !1;
      else if (u === "kd" && f)
        a = l.split(s, 3).map(parseFloat), f.diffuseColor = Ne.FromArray(a);
      else if (u === "ka" && f)
        a = l.split(s, 3).map(parseFloat), f.ambientColor = Ne.FromArray(a);
      else if (u === "ks" && f)
        a = l.split(s, 3).map(parseFloat), f.specularColor = Ne.FromArray(a);
      else if (u === "ke" && f)
        a = l.split(s, 3).map(parseFloat), f.emissiveColor = Ne.FromArray(a);
      else if (u === "ns" && f)
        f.specularPower = parseFloat(l);
      else if (u === "d" && f)
        f.alpha = parseFloat(l);
      else if (u === "map_ka" && f)
        f.ambientTexture = KH._GetTexture(r, l, e);
      else if (u === "map_kd" && f)
        f.diffuseTexture = KH._GetTexture(r, l, e);
      else if (u === "map_ks" && f)
        f.specularTexture = KH._GetTexture(r, l, e);
      else if (u !== "map_ns")
        if (u === "map_bump" && f) {
          const P = l.split(s), p = P.indexOf("-bm");
          let c = null;
          p >= 0 && (c = P[p + 1], P.splice(p, 2)), f.bumpTexture = KH._GetTexture(r, P.join(" "), e), f.bumpTexture && c !== null && (f.bumpTexture.level = parseFloat(c));
        } else
          u === "map_d" && f && (f.opacityTexture = KH._GetTexture(r, l, e));
    }
    f && this.materials.push(f);
  }
  /**
   * Gets the texture for the material.
   *
   * If the material is imported from input file,
   * We sanitize the url to ensure it takes the texture from aside the material.
   *
   * @param rootUrl The root url to load from
   * @param value The value stored in the mtl
   * @param scene
   * @returns The Texture
   */
  static _GetTexture(e, t, r) {
    if (!t)
      return null;
    let n = e;
    if (e === "file:") {
      let i = t.lastIndexOf("\\");
      i === -1 && (i = t.lastIndexOf("/")), i > -1 ? n += t.substr(i + 1) : n += t;
    } else
      n += t;
    return new We(n, r, !1, KH.INVERT_TEXTURE_Y);
  }
}
KH.INVERT_TEXTURE_Y = !0;
class ya {
  /**
   * Creates a new SolidParser
   * @param materialToUse defines the array to fill with the list of materials to use (it will be filled by the parse function)
   * @param babylonMeshesArray defines the array to fill with the list of loaded meshes (it will be filled by the parse function)
   * @param loadingOptions defines the loading options to use
   */
  constructor(e, t, r) {
    this._positions = [], this._normals = [], this._uvs = [], this._colors = [], this._meshesFromObj = [], this._indicesForBabylon = [], this._wrappedPositionForBabylon = [], this._wrappedUvsForBabylon = [], this._wrappedColorsForBabylon = [], this._wrappedNormalsForBabylon = [], this._tuplePosNorm = [], this._curPositionInIndices = 0, this._hasMeshes = !1, this._unwrappedPositionsForBabylon = [], this._unwrappedColorsForBabylon = [], this._unwrappedNormalsForBabylon = [], this._unwrappedUVForBabylon = [], this._triangles = [], this._materialNameFromObj = "", this._objMeshName = "", this._increment = 1, this._isFirstMaterial = !0, this._grayColor = new xt(0.5, 0.5, 0.5, 1), this._materialToUse = e, this._babylonMeshesArray = t, this._loadingOptions = r;
  }
  /**
   * Search for obj in the given array.
   * This function is called to check if a couple of data already exists in an array.
   *
   * If found, returns the index of the founded tuple index. Returns -1 if not found
   * @param arr Array<{ normals: Array<number>, idx: Array<number> }>
   * @param obj Array<number>
   * @returns {boolean}
   */
  _isInArray(e, t) {
    e[t[0]] || (e[t[0]] = { normals: [], idx: [] });
    const r = e[t[0]].normals.indexOf(t[1]);
    return r === -1 ? -1 : e[t[0]].idx[r];
  }
  _isInArrayUV(e, t) {
    e[t[0]] || (e[t[0]] = { normals: [], idx: [], uv: [] });
    const r = e[t[0]].normals.indexOf(t[1]);
    return r != 1 && t[2] === e[t[0]].uv[r] ? e[t[0]].idx[r] : -1;
  }
  /**
   * This function set the data for each triangle.
   * Data are position, normals and uvs
   * If a tuple of (position, normal) is not set, add the data into the corresponding array
   * If the tuple already exist, add only their indice
   *
   * @param indicePositionFromObj Integer The index in positions array
   * @param indiceUvsFromObj Integer The index in uvs array
   * @param indiceNormalFromObj Integer The index in normals array
   * @param positionVectorFromOBJ Vector3 The value of position at index objIndice
   * @param textureVectorFromOBJ Vector3 The value of uvs
   * @param normalsVectorFromOBJ Vector3 The value of normals at index objNormale
   * @param positionColorsFromOBJ
   */
  _setData(e, t, r, n, i, s, a) {
    let f;
    this._loadingOptions.optimizeWithUV ? f = this._isInArrayUV(this._tuplePosNorm, [e, r, t]) : f = this._isInArray(this._tuplePosNorm, [e, r]), f === -1 ? (this._indicesForBabylon.push(this._wrappedPositionForBabylon.length), this._wrappedPositionForBabylon.push(n), this._wrappedUvsForBabylon.push(i), this._wrappedNormalsForBabylon.push(s), a !== void 0 && this._wrappedColorsForBabylon.push(a), this._tuplePosNorm[e].normals.push(r), this._tuplePosNorm[e].idx.push(this._curPositionInIndices++), this._loadingOptions.optimizeWithUV && this._tuplePosNorm[e].uv.push(t)) : this._indicesForBabylon.push(f);
  }
  /**
   * Transform Vector() and BABYLON.Color() objects into numbers in an array
   */
  _unwrapData() {
    for (let e = 0; e < this._wrappedPositionForBabylon.length; e++)
      this._unwrappedPositionsForBabylon.push(this._wrappedPositionForBabylon[e].x, this._wrappedPositionForBabylon[e].y, this._wrappedPositionForBabylon[e].z), this._unwrappedNormalsForBabylon.push(this._wrappedNormalsForBabylon[e].x, this._wrappedNormalsForBabylon[e].y, this._wrappedNormalsForBabylon[e].z), this._unwrappedUVForBabylon.push(this._wrappedUvsForBabylon[e].x, this._wrappedUvsForBabylon[e].y), this._loadingOptions.importVertexColors && this._unwrappedColorsForBabylon.push(this._wrappedColorsForBabylon[e].r, this._wrappedColorsForBabylon[e].g, this._wrappedColorsForBabylon[e].b, this._wrappedColorsForBabylon[e].a);
    this._wrappedPositionForBabylon.length = 0, this._wrappedNormalsForBabylon.length = 0, this._wrappedUvsForBabylon.length = 0, this._wrappedColorsForBabylon.length = 0, this._tuplePosNorm.length = 0, this._curPositionInIndices = 0;
  }
  /**
   * Create triangles from polygons
   * It is important to notice that a triangle is a polygon
   * We get 5 patterns of face defined in OBJ File :
   * facePattern1 = ["1","2","3","4","5","6"]
   * facePattern2 = ["1/1","2/2","3/3","4/4","5/5","6/6"]
   * facePattern3 = ["1/1/1","2/2/2","3/3/3","4/4/4","5/5/5","6/6/6"]
   * facePattern4 = ["1//1","2//2","3//3","4//4","5//5","6//6"]
   * facePattern5 = ["-1/-1/-1","-2/-2/-2","-3/-3/-3","-4/-4/-4","-5/-5/-5","-6/-6/-6"]
   * Each pattern is divided by the same method
   * @param faces Array[String] The indices of elements
   * @param v Integer The variable to increment
   */
  _getTriangles(e, t) {
    for (let r = t; r < e.length - 1; r++)
      this._triangles.push(e[0], e[r], e[r + 1]);
  }
  /**
   * Create triangles and push the data for each polygon for the pattern 1
   * In this pattern we get vertice positions
   * @param face
   * @param v
   */
  _setDataForCurrentFaceWithPattern1(e, t) {
    this._getTriangles(e, t);
    for (let r = 0; r < this._triangles.length; r++) {
      const n = parseInt(this._triangles[r]) - 1;
      this._setData(
        n,
        0,
        0,
        // In the pattern 1, normals and uvs are not defined
        this._positions[n],
        // Get the vectors data
        at.Zero(),
        S.Up(),
        // Create default vectors
        this._loadingOptions.importVertexColors ? this._colors[n] : void 0
      );
    }
    this._triangles.length = 0;
  }
  /**
   * Create triangles and push the data for each polygon for the pattern 2
   * In this pattern we get vertice positions and uvs
   * @param face
   * @param v
   */
  _setDataForCurrentFaceWithPattern2(e, t) {
    this._getTriangles(e, t);
    for (let r = 0; r < this._triangles.length; r++) {
      const n = this._triangles[r].split("/"), i = parseInt(n[0]) - 1, s = parseInt(n[1]) - 1;
      this._setData(
        i,
        s,
        0,
        //Default value for normals
        this._positions[i],
        //Get the values for each element
        this._uvs[s],
        S.Up(),
        //Default value for normals
        this._loadingOptions.importVertexColors ? this._colors[i] : void 0
      );
    }
    this._triangles.length = 0;
  }
  /**
   * Create triangles and push the data for each polygon for the pattern 3
   * In this pattern we get vertice positions, uvs and normals
   * @param face
   * @param v
   */
  _setDataForCurrentFaceWithPattern3(e, t) {
    this._getTriangles(e, t);
    for (let r = 0; r < this._triangles.length; r++) {
      const n = this._triangles[r].split("/"), i = parseInt(n[0]) - 1, s = parseInt(n[1]) - 1, a = parseInt(n[2]) - 1;
      this._setData(
        i,
        s,
        a,
        this._positions[i],
        this._uvs[s],
        this._normals[a]
        //Set the vector for each component
      );
    }
    this._triangles.length = 0;
  }
  /**
   * Create triangles and push the data for each polygon for the pattern 4
   * In this pattern we get vertice positions and normals
   * @param face
   * @param v
   */
  _setDataForCurrentFaceWithPattern4(e, t) {
    this._getTriangles(e, t);
    for (let r = 0; r < this._triangles.length; r++) {
      const n = this._triangles[r].split("//"), i = parseInt(n[0]) - 1, s = parseInt(n[1]) - 1;
      this._setData(
        i,
        1,
        //Default value for uv
        s,
        this._positions[i],
        //Get each vector of data
        at.Zero(),
        this._normals[s],
        this._loadingOptions.importVertexColors ? this._colors[i] : void 0
      );
    }
    this._triangles.length = 0;
  }
  /*
   * Create triangles and push the data for each polygon for the pattern 3
   * In this pattern we get vertice positions, uvs and normals
   * @param face
   * @param v
   */
  _setDataForCurrentFaceWithPattern5(e, t) {
    this._getTriangles(e, t);
    for (let r = 0; r < this._triangles.length; r++) {
      const n = this._triangles[r].split("/"), i = this._positions.length + parseInt(n[0]), s = this._uvs.length + parseInt(n[1]), a = this._normals.length + parseInt(n[2]);
      this._setData(
        i,
        s,
        a,
        this._positions[i],
        this._uvs[s],
        this._normals[a],
        //Set the vector for each component
        this._loadingOptions.importVertexColors ? this._colors[i] : void 0
      );
    }
    this._triangles.length = 0;
  }
  _addPreviousObjMesh() {
    this._meshesFromObj.length > 0 && (this._handledMesh = this._meshesFromObj[this._meshesFromObj.length - 1], this._unwrapData(), this._indicesForBabylon.reverse(), this._handledMesh.indices = this._indicesForBabylon.slice(), this._handledMesh.positions = this._unwrappedPositionsForBabylon.slice(), this._handledMesh.normals = this._unwrappedNormalsForBabylon.slice(), this._handledMesh.uvs = this._unwrappedUVForBabylon.slice(), this._loadingOptions.importVertexColors && (this._handledMesh.colors = this._unwrappedColorsForBabylon.slice()), this._indicesForBabylon.length = 0, this._unwrappedPositionsForBabylon.length = 0, this._unwrappedColorsForBabylon.length = 0, this._unwrappedNormalsForBabylon.length = 0, this._unwrappedUVForBabylon.length = 0);
  }
  _optimizeNormals(e) {
    const t = e.getVerticesData(J.PositionKind), r = e.getVerticesData(J.NormalKind), n = {};
    if (!t || !r)
      return;
    for (let s = 0; s < t.length / 3; s++) {
      const a = t[s * 3 + 0], f = t[s * 3 + 1], o = t[s * 3 + 2], d = a + "_" + f + "_" + o;
      let v = n[d];
      v || (v = [], n[d] = v), v.push(s);
    }
    const i = new S();
    for (const s in n) {
      const a = n[s];
      if (a.length < 2)
        continue;
      const f = a[0];
      for (let o = 1; o < a.length; ++o) {
        const d = a[o];
        r[f * 3 + 0] += r[d * 3 + 0], r[f * 3 + 1] += r[d * 3 + 1], r[f * 3 + 2] += r[d * 3 + 2];
      }
      i.copyFromFloats(r[f * 3 + 0], r[f * 3 + 1], r[f * 3 + 2]), i.normalize();
      for (let o = 0; o < a.length; ++o) {
        const d = a[o];
        r[d * 3 + 0] = i.x, r[d * 3 + 1] = i.y, r[d * 3 + 2] = i.z;
      }
    }
    e.setVerticesData(J.NormalKind, r);
  }
  /**
   * Function used to parse an OBJ string
   * @param meshesNames defines the list of meshes to load (all if not defined)
   * @param data defines the OBJ string
   * @param scene defines the hosting scene
   * @param assetContainer defines the asset container to load data in
   * @param onFileToLoadFound defines a callback that will be called if a MTL file is found
   */
  parse(e, t, r, n, i) {
    var s;
    const a = t.split(`
`);
    for (let f = 0; f < a.length; f++) {
      const o = a[f].trim().replace(/\s\s/g, " ");
      let d;
      if (!(o.length === 0 || o.charAt(0) === "#"))
        if (ya.VertexPattern.test(o)) {
          if (d = o.match(/[^ ]+/g), this._positions.push(new S(parseFloat(d[1]), parseFloat(d[2]), parseFloat(d[3]))), this._loadingOptions.importVertexColors)
            if (d.length >= 7) {
              const v = parseFloat(d[4]), u = parseFloat(d[5]), l = parseFloat(d[6]);
              this._colors.push(new xt(v > 1 ? v / 255 : v, u > 1 ? u / 255 : u, l > 1 ? l / 255 : l, d.length === 7 || d[7] === void 0 ? 1 : parseFloat(d[7])));
            } else
              this._colors.push(this._grayColor);
        } else if ((d = ya.NormalPattern.exec(o)) !== null)
          this._normals.push(new S(parseFloat(d[1]), parseFloat(d[2]), parseFloat(d[3])));
        else if ((d = ya.UVPattern.exec(o)) !== null)
          this._uvs.push(new at(parseFloat(d[1]) * this._loadingOptions.UVScaling.x, parseFloat(d[2]) * this._loadingOptions.UVScaling.y));
        else if ((d = ya.FacePattern3.exec(o)) !== null)
          this._setDataForCurrentFaceWithPattern3(
            d[1].trim().split(" "),
            // ["1/1/1", "2/2/2", "3/3/3"]
            1
          );
        else if ((d = ya.FacePattern4.exec(o)) !== null)
          this._setDataForCurrentFaceWithPattern4(
            d[1].trim().split(" "),
            // ["1//1", "2//2", "3//3"]
            1
          );
        else if ((d = ya.FacePattern5.exec(o)) !== null)
          this._setDataForCurrentFaceWithPattern5(
            d[1].trim().split(" "),
            // ["-1/-1/-1", "-2/-2/-2", "-3/-3/-3"]
            1
          );
        else if ((d = ya.FacePattern2.exec(o)) !== null)
          this._setDataForCurrentFaceWithPattern2(
            d[1].trim().split(" "),
            // ["1/1", "2/2", "3/3"]
            1
          );
        else if ((d = ya.FacePattern1.exec(o)) !== null)
          this._setDataForCurrentFaceWithPattern1(
            d[1].trim().split(" "),
            // ["1", "2", "3"]
            1
          );
        else if ((d = ya.LinePattern1.exec(o)) !== null)
          this._setDataForCurrentFaceWithPattern1(
            d[1].trim().split(" "),
            // ["1", "2"]
            0
          );
        else if ((d = ya.LinePattern2.exec(o)) !== null)
          this._setDataForCurrentFaceWithPattern2(
            d[1].trim().split(" "),
            // ["1/1", "2/2"]
            0
          );
        else if ((d = ya.LinePattern3.exec(o)) !== null)
          this._setDataForCurrentFaceWithPattern3(
            d[1].trim().split(" "),
            // ["1/1/1", "2/2/2"]
            0
          );
        else if (ya.GroupDescriptor.test(o) || ya.ObjectDescriptor.test(o)) {
          const v = {
            name: o.substring(2).trim(),
            indices: void 0,
            positions: void 0,
            normals: void 0,
            uvs: void 0,
            colors: void 0,
            materialName: this._materialNameFromObj,
            isObject: ya.ObjectDescriptor.test(o)
          };
          this._addPreviousObjMesh(), this._meshesFromObj.push(v), this._hasMeshes = !0, this._isFirstMaterial = !0, this._increment = 1;
        } else if (ya.UseMtlDescriptor.test(o)) {
          if (this._materialNameFromObj = o.substring(7).trim(), !this._isFirstMaterial || !this._hasMeshes) {
            this._addPreviousObjMesh();
            const v = (
              //Set the name of the current obj mesh
              {
                name: (this._objMeshName || "mesh") + "_mm" + this._increment.toString(),
                indices: void 0,
                positions: void 0,
                normals: void 0,
                uvs: void 0,
                colors: void 0,
                materialName: this._materialNameFromObj,
                isObject: !1
              }
            );
            this._increment++, this._meshesFromObj.push(v), this._hasMeshes = !0;
          }
          this._hasMeshes && this._isFirstMaterial && (this._meshesFromObj[this._meshesFromObj.length - 1].materialName = this._materialNameFromObj, this._isFirstMaterial = !1);
        } else
          ya.MtlLibGroupDescriptor.test(o) ? i(o.substring(7).trim()) : ya.SmoothDescriptor.test(o) || console.log("Unhandled expression at line : " + o);
    }
    if (this._hasMeshes && (this._handledMesh = this._meshesFromObj[this._meshesFromObj.length - 1], this._indicesForBabylon.reverse(), this._unwrapData(), this._handledMesh.indices = this._indicesForBabylon, this._handledMesh.positions = this._unwrappedPositionsForBabylon, this._handledMesh.normals = this._unwrappedNormalsForBabylon, this._handledMesh.uvs = this._unwrappedUVForBabylon, this._loadingOptions.importVertexColors && (this._handledMesh.colors = this._unwrappedColorsForBabylon)), !this._hasMeshes) {
      let f = null;
      if (this._indicesForBabylon.length)
        this._indicesForBabylon.reverse(), this._unwrapData();
      else {
        for (const o of this._positions)
          this._unwrappedPositionsForBabylon.push(o.x, o.y, o.z);
        if (this._normals.length)
          for (const o of this._normals)
            this._unwrappedNormalsForBabylon.push(o.x, o.y, o.z);
        if (this._uvs.length)
          for (const o of this._uvs)
            this._unwrappedUVForBabylon.push(o.x, o.y);
        if (this._colors.length)
          for (const o of this._colors)
            this._unwrappedColorsForBabylon.push(o.r, o.g, o.b, o.a);
        this._materialNameFromObj || (f = new Wt(Tf.RandomId(), r), f.pointsCloud = !0, this._materialNameFromObj = f.name, this._normals.length || (f.disableLighting = !0, f.emissiveColor = Ne.White()));
      }
      this._meshesFromObj.push({
        name: Tf.RandomId(),
        indices: this._indicesForBabylon,
        positions: this._unwrappedPositionsForBabylon,
        colors: this._unwrappedColorsForBabylon,
        normals: this._unwrappedNormalsForBabylon,
        uvs: this._unwrappedUVForBabylon,
        materialName: this._materialNameFromObj,
        directMaterial: f,
        isObject: !0
      });
    }
    for (let f = 0; f < this._meshesFromObj.length; f++) {
      if (e && this._meshesFromObj[f].name) {
        if (e instanceof Array) {
          if (e.indexOf(this._meshesFromObj[f].name) === -1)
            continue;
        } else if (this._meshesFromObj[f].name !== e)
          continue;
      }
      this._handledMesh = this._meshesFromObj[f], r._blockEntityCollection = !!n;
      const o = new Ee(this._meshesFromObj[f].name, r);
      if (o._parentContainer = n, r._blockEntityCollection = !1, this._handledMesh._babylonMesh = o, !this._handledMesh.isObject) {
        for (let v = f - 1; v >= 0; --v)
          if (this._meshesFromObj[v].isObject && this._meshesFromObj[v]._babylonMesh) {
            o.parent = this._meshesFromObj[v]._babylonMesh;
            break;
          }
      }
      if (this._materialToUse.push(this._meshesFromObj[f].materialName), ((s = this._handledMesh.positions) === null || s === void 0 ? void 0 : s.length) === 0) {
        this._babylonMeshesArray.push(o);
        continue;
      }
      const d = new Ut();
      if (d.uvs = this._handledMesh.uvs, d.indices = this._handledMesh.indices, d.positions = this._handledMesh.positions, this._loadingOptions.computeNormals) {
        const v = new Array();
        Ut.ComputeNormals(this._handledMesh.positions, this._handledMesh.indices, v), d.normals = v;
      } else
        d.normals = this._handledMesh.normals;
      this._loadingOptions.importVertexColors && (d.colors = this._handledMesh.colors), d.applyToMesh(o), this._loadingOptions.invertY && (o.scaling.y *= -1), this._loadingOptions.optimizeNormals && this._optimizeNormals(o), this._babylonMeshesArray.push(o), this._handledMesh.directMaterial && (o.material = this._handledMesh.directMaterial);
    }
  }
}
ya.ObjectDescriptor = /^o/;
ya.GroupDescriptor = /^g/;
ya.MtlLibGroupDescriptor = /^mtllib /;
ya.UseMtlDescriptor = /^usemtl /;
ya.SmoothDescriptor = /^s /;
ya.VertexPattern = /^v(\s+[\d|.|+|\-|e|E]+){3,7}/;
ya.NormalPattern = /^vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;
ya.UVPattern = /^vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;
ya.FacePattern1 = /^f\s+(([\d]{1,}[\s]?){3,})+/;
ya.FacePattern2 = /^f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;
ya.FacePattern3 = /^f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;
ya.FacePattern4 = /^f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/;
ya.FacePattern5 = /^f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;
ya.LinePattern1 = /^l\s+(([\d]{1,}[\s]?){2,})+/;
ya.LinePattern2 = /^l\s+((([\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;
ya.LinePattern3 = /^l\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;
class T6 {
  /**
   * Invert Y-Axis of referenced textures on load
   */
  static get INVERT_TEXTURE_Y() {
    return KH.INVERT_TEXTURE_Y;
  }
  static set INVERT_TEXTURE_Y(e) {
    KH.INVERT_TEXTURE_Y = e;
  }
  /**
   * Creates loader for .OBJ files
   *
   * @param loadingOptions options for loading and parsing OBJ/MTL files.
   */
  constructor(e) {
    this.name = "obj", this.extensions = ".obj", this._assetContainer = null, this._loadingOptions = e || T6._DefaultLoadingOptions;
  }
  static get _DefaultLoadingOptions() {
    return {
      computeNormals: T6.COMPUTE_NORMALS,
      optimizeNormals: T6.OPTIMIZE_NORMALS,
      importVertexColors: T6.IMPORT_VERTEX_COLORS,
      invertY: T6.INVERT_Y,
      invertTextureY: T6.INVERT_TEXTURE_Y,
      // eslint-disable-next-line @typescript-eslint/naming-convention
      UVScaling: T6.UV_SCALING,
      materialLoadingFailsSilently: T6.MATERIAL_LOADING_FAILS_SILENTLY,
      optimizeWithUV: T6.OPTIMIZE_WITH_UV,
      skipMaterials: T6.SKIP_MATERIALS
    };
  }
  /**
   * Calls synchronously the MTL file attached to this obj.
   * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
   * Without this function materials are not displayed in the first frame (but displayed after).
   * In consequence it is impossible to get material information in your HTML file
   *
   * @param url The URL of the MTL file
   * @param rootUrl defines where to load data from
   * @param onSuccess Callback function to be called when the MTL file is loaded
   * @param onFailure
   */
  _loadMTL(e, t, r, n) {
    const i = t + e;
    ye.LoadFile(i, r, void 0, void 0, !1, (s, a) => {
      n(i, a);
    });
  }
  /**
   * Instantiates a OBJ file loader plugin.
   * @returns the created plugin
   */
  createPlugin() {
    return new T6(T6._DefaultLoadingOptions);
  }
  /**
   * If the data string can be loaded directly.
   * @returns if the data can be loaded directly
   */
  canDirectLoad() {
    return !1;
  }
  /**
   * Imports one or more meshes from the loaded OBJ data and adds them to the scene
   * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
   * @param scene the scene the meshes should be added to
   * @param data the OBJ data to load
   * @param rootUrl root url to load from
   * @returns a promise containing the loaded meshes, particles, skeletons and animations
   */
  importMeshAsync(e, t, r, n) {
    return this._parseSolid(e, t, r, n).then((i) => ({
      meshes: i,
      particleSystems: [],
      skeletons: [],
      animationGroups: [],
      transformNodes: [],
      geometries: [],
      lights: []
    }));
  }
  /**
   * Imports all objects from the loaded OBJ data and adds them to the scene
   * @param scene the scene the objects should be added to
   * @param data the OBJ data to load
   * @param rootUrl root url to load from
   * @returns a promise which completes when objects have been loaded to the scene
   */
  loadAsync(e, t, r) {
    return this.importMeshAsync(null, e, t, r).then(() => {
    });
  }
  /**
   * Load into an asset container.
   * @param scene The scene to load into
   * @param data The data to import
   * @param rootUrl The root url for scene and resources
   * @returns The loaded asset container
   */
  loadAssetContainerAsync(e, t, r) {
    const n = new xR(e);
    return this._assetContainer = n, this.importMeshAsync(null, e, t, r).then((i) => (i.meshes.forEach((s) => n.meshes.push(s)), i.meshes.forEach((s) => {
      const a = s.material;
      a && n.materials.indexOf(a) == -1 && (n.materials.push(a), a.getActiveTextures().forEach((o) => {
        n.textures.indexOf(o) == -1 && n.textures.push(o);
      }));
    }), this._assetContainer = null, n)).catch((i) => {
      throw this._assetContainer = null, i;
    });
  }
  /**
   * Read the OBJ file and create an Array of meshes.
   * Each mesh contains all information given by the OBJ and the MTL file.
   * i.e. vertices positions and indices, optional normals values, optional UV values, optional material
   * @param meshesNames defines a string or array of strings of the mesh names that should be loaded from the file
   * @param scene defines the scene where are displayed the data
   * @param data defines the content of the obj file
   * @param rootUrl defines the path to the folder
   * @returns the list of loaded meshes
   */
  _parseSolid(e, t, r, n) {
    let i = "";
    const s = new KH(), a = [], f = [];
    new ya(a, f, this._loadingOptions).parse(e, r, t, this._assetContainer, (v) => {
      i = v;
    });
    const d = [];
    return i !== "" && !this._loadingOptions.skipMaterials && d.push(new Promise((v, u) => {
      this._loadMTL(i, n, (l) => {
        try {
          s.parseMTL(t, l, n, this._assetContainer);
          for (let P = 0; P < s.materials.length; P++) {
            let p = 0;
            const c = [];
            let H;
            for (; (H = a.indexOf(s.materials[P].name, p)) > -1; )
              c.push(H), p = H + 1;
            if (H === -1 && c.length === 0)
              s.materials[P].dispose();
            else
              for (let T = 0; T < c.length; T++) {
                const q = f[c[T]], b = s.materials[P];
                q.material = b, q.getTotalIndices() || (b.pointsCloud = !0);
              }
          }
          v();
        } catch (P) {
          ye.Warn(`Error processing MTL file: '${i}'`), this._loadingOptions.materialLoadingFailsSilently ? v() : u(P);
        }
      }, (l, P) => {
        ye.Warn(`Error downloading MTL file: '${i}'`), this._loadingOptions.materialLoadingFailsSilently ? v() : u(P);
      });
    })), Promise.all(d).then(() => f);
  }
}
T6.OPTIMIZE_WITH_UV = !0;
T6.INVERT_Y = !1;
T6.IMPORT_VERTEX_COLORS = !1;
T6.COMPUTE_NORMALS = !1;
T6.OPTIMIZE_NORMALS = !1;
T6.UV_SCALING = new at(1, 1);
T6.SKIP_MATERIALS = !1;
T6.MATERIAL_LOADING_FAILS_SILENTLY = !0;
Hn && Hn.RegisterPlugin(new T6());
class aD {
  constructor() {
    this.solidPattern = /solid (\S*)([\S\s]*?)endsolid[ ]*(\S*)/g, this.facetsPattern = /facet([\s\S]*?)endfacet/g, this.normalPattern = /normal[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g, this.vertexPattern = /vertex[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g, this.name = "stl", this.extensions = {
      ".stl": { isBinary: !0 }
    };
  }
  /**
   * Import meshes into a scene.
   * @param meshesNames An array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
   * @param scene The scene to import into
   * @param data The data to import
   * @param rootUrl The root url for scene and resources
   * @param meshes The meshes array to import into
   * @returns True if successful or false otherwise
   */
  importMesh(e, t, r, n, i) {
    let s;
    if (typeof r != "string") {
      if (this._isBinary(r)) {
        const a = new Ee("stlmesh", t);
        return this._parseBinary(a, r), i && i.push(a), !0;
      }
      r = new TextDecoder().decode(new Uint8Array(r));
    }
    for (; s = this.solidPattern.exec(r); ) {
      let a = s[1];
      const f = s[3];
      if (f && a != f)
        return ye.Error("Error in STL, solid name != endsolid name"), !1;
      if (e && a) {
        if (e instanceof Array) {
          if (!e.indexOf(a))
            continue;
        } else if (a !== e)
          continue;
      }
      a = a || "stlmesh";
      const o = new Ee(a, t);
      this._parseASCII(o, s[2]), i && i.push(o);
    }
    return !0;
  }
  /**
   * Load into a scene.
   * @param scene The scene to load into
   * @param data The data to import
   * @param rootUrl The root url for scene and resources
   * @returns true if successful or false otherwise
   */
  load(e, t, r) {
    return this.importMesh(null, e, t, r, null);
  }
  /**
   * Load into an asset container.
   * @param scene The scene to load into
   * @param data The data to import
   * @param rootUrl The root url for scene and resources
   * @returns The loaded asset container
   */
  loadAssetContainer(e, t, r) {
    const n = new xR(e);
    return e._blockEntityCollection = !0, this.importMesh(null, e, t, r, n.meshes), e._blockEntityCollection = !1, n;
  }
  _isBinary(e) {
    const t = new DataView(e);
    if (t.byteLength <= 80)
      return !1;
    const r = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8, n = t.getUint32(80, !0);
    if (80 + 32 / 8 + n * r === t.byteLength)
      return !0;
    const i = [115, 111, 108, 105, 100];
    for (let s = 0; s < 5; s++)
      if (t.getUint8(s) !== i[s])
        return !0;
    return !1;
  }
  _parseBinary(e, t) {
    const r = new DataView(t), n = r.getUint32(80, !0), i = 84, s = 12 * 4 + 2;
    let a = 0;
    const f = new Float32Array(n * 3 * 3), o = new Float32Array(n * 3 * 3), d = new Uint32Array(n * 3);
    let v = 0;
    for (let u = 0; u < n; u++) {
      const l = i + u * s, P = r.getFloat32(l, !0), p = r.getFloat32(l + 4, !0), c = r.getFloat32(l + 8, !0);
      for (let H = 1; H <= 3; H++) {
        const T = l + H * 12;
        f[a] = r.getFloat32(T, !0), o[a] = P, aD.DO_NOT_ALTER_FILE_COORDINATES ? (f[a + 1] = r.getFloat32(T + 4, !0), f[a + 2] = r.getFloat32(T + 8, !0), o[a + 1] = p, o[a + 2] = c) : (f[a + 2] = r.getFloat32(T + 4, !0), f[a + 1] = r.getFloat32(T + 8, !0), o[a + 2] = p, o[a + 1] = c), a += 3;
      }
      aD.DO_NOT_ALTER_FILE_COORDINATES ? (d[v] = v, d[v + 1] = v + 2, d[v + 2] = v + 1, v += 3) : (d[v] = v++, d[v] = v++, d[v] = v++);
    }
    e.setVerticesData(J.PositionKind, f), e.setVerticesData(J.NormalKind, o), e.setIndices(d), e.computeWorldMatrix(!0);
  }
  _parseASCII(e, t) {
    const r = [], n = [], i = [];
    let s = 0, a;
    for (; a = this.facetsPattern.exec(t); ) {
      const f = a[1], o = this.normalPattern.exec(f);
      if (this.normalPattern.lastIndex = 0, !o)
        continue;
      const d = [Number(o[1]), Number(o[5]), Number(o[3])];
      let v;
      for (; v = this.vertexPattern.exec(f); )
        aD.DO_NOT_ALTER_FILE_COORDINATES ? (r.push(Number(v[1]), Number(v[3]), Number(v[5])), n.push(d[0], d[2], d[1])) : (r.push(Number(v[1]), Number(v[5]), Number(v[3])), n.push(d[0], d[1], d[2]));
      aD.DO_NOT_ALTER_FILE_COORDINATES ? (i.push(s, s + 2, s + 1), s += 3) : i.push(s++, s++, s++), this.vertexPattern.lastIndex = 0;
    }
    this.facetsPattern.lastIndex = 0, e.setVerticesData(J.PositionKind, r), e.setVerticesData(J.NormalKind, n), e.setIndices(i), e.computeWorldMatrix(!0);
  }
}
aD.DO_NOT_ALTER_FILE_COORDINATES = !1;
Hn && Hn.RegisterPlugin(new aD());
function r2e(A) {
  return { all: A = A || /* @__PURE__ */ new Map(), on: function(e, t) {
    var r = A.get(e);
    r ? r.push(t) : A.set(e, [t]);
  }, off: function(e, t) {
    var r = A.get(e);
    r && (t ? r.splice(r.indexOf(t) >>> 0, 1) : A.set(e, []));
  }, emit: function(e, t) {
    var r = A.get(e);
    r && r.slice().map(function(n) {
      n(t);
    }), (r = A.get("*")) && r.slice().map(function(n) {
      n(e, t);
    });
  } };
}
const OC = {
  CopyMeshes: {
    buttons: [
      {
        code: "c",
        keyDown: !1,
        ctrlKey: !0,
        shiftKey: !0
      },
      {
        code: "c",
        keyDown: !1,
        ctrlKey: !0,
        shiftKey: !1
      }
    ],
    callback(A, e) {
      const t = A.getSelectedNodes(), r = e.shiftKey;
      t.length && A.copyNodes(t, {
        instanced: r,
        onSuccess: (n) => {
          A.selectNodes(n);
        }
      });
    }
  },
  DeselectMesh: {
    buttons: [
      {
        code: "escape",
        keyDown: !1
      }
    ],
    callback(A, e) {
      A.selectNodes([]);
    }
  },
  DeleteMesh: {
    buttons: [
      {
        code: "delete",
        keyDown: !1
      },
      {
        code: "backspace",
        keyDown: !1
      }
    ],
    callback(A, e) {
      const t = A.getSelectedNodes();
      A.deleteNodes(t);
    }
  },
  Undo: {
    buttons: {
      code: "z",
      ctrlKey: !0
    },
    callback(A) {
      A.undo();
    }
  },
  Redo: {
    buttons: {
      code: "z",
      ctrlKey: !0,
      shiftKey: !0
    },
    callback(A) {
      A.redo();
    }
  },
  SwitchGizmo: {
    buttons: [
      {
        code: "1"
      },
      {
        code: "2"
      },
      {
        code: "3"
      }
    ],
    callback(A, e) {
      const t = {
        1: "position",
        2: "scaling",
        3: "rotation"
      }[e.code];
      A.root.setOptions({ selectorType: t });
    }
  }
};
var Mo = /* @__PURE__ */ ((A) => (A[A.String = 0] = "String", A[A.Number = 1] = "Number", A[A.Boolean = 2] = "Boolean", A))(Mo || {}), gV = /* @__PURE__ */ ((A) => (A[A.Value = 0] = "Value", A[A.DynamicData = 1] = "DynamicData", A))(gV || {}), $2 = /* @__PURE__ */ ((A) => (A.None = "None", A.PX_PY_PZ = "PX_PY_PZ", A.PX_CY_PZ = "PX_CY_PZ", A.PX_NY_PZ = "PX_NY_PZ", A.PX_PY_CZ = "PX_PY_CZ", A.PX_PY_NZ = "PX_PY_NZ", A.PX_CY_CZ = "PX_CY_CZ", A.PX_CY_NZ = "PX_CY_NZ", A.PX_NY_CZ = "PX_NY_CZ", A.PX_NY_NZ = "PX_NY_NZ", A.CX_PY_PZ = "CX_PY_PZ", A.CX_CY_PZ = "CX_CY_PZ", A.CX_NY_PZ = "CX_NY_PZ", A.CX_PY_CZ = "CX_PY_CZ", A.CX_PY_NZ = "CX_PY_NZ", A.CX_CY_CZ = "CX_CY_CZ", A.CX_CY_NZ = "CX_CY_NZ", A.CX_NY_CZ = "CX_NY_CZ", A.CX_NY_NZ = "CX_NY_NZ", A.NX_PY_PZ = "NX_PY_PZ", A.NX_CY_PZ = "NX_CY_PZ", A.NX_NY_PZ = "NX_NY_PZ", A.NX_PY_CZ = "NX_PY_CZ", A.NX_PY_NZ = "NX_PY_NZ", A.NX_CY_CZ = "NX_CY_CZ", A.NX_CY_NZ = "NX_CY_NZ", A.NX_NY_CZ = "NX_NY_CZ", A.NX_NY_NZ = "NX_NY_NZ", A))($2 || {});
const zd = "le5le", Z1e = zd + "_arcRotateCamera", n2e = zd + "_arcRotateCamera", mSe = zd + "_freeCamera", i2e = zd + "_highlight", yC = zd + "_skybox", s2e = zd + "_ground", iM = zd + "_auxiliaryMesh", XV = iM + "_light", hN = XV + "_range_point", HN = XV + "_range_direction", gN = XV + "_range_spot", a2e = iM + "_camera", BSe = zd + "_alignLine", sM = zd + "_route", o2e = sM + "_line", f2e = sM + "_point", WSe = zd + "_boudingMesh", SSe = zd + "_mainLight", USe = zd + "_fillLight", A2e = zd + "_placeholder", _1e = zd + "_targetMesh", d2e = zd + "_selectorMesh", ISe = zd + "_activeMesh", v2e = "https://drive.le5lecdn.com/2023/0713/1/1/flare.4d7eaf70.png";
var se = /* @__PURE__ */ ((A) => (A[A.Number = 0] = "Number", A[A.Vector3 = 1] = "Vector3", A[A.Quaternion = 2] = "Quaternion", A[A.Matrix = 3] = "Matrix", A[A.Color3 = 4] = "Color3", A[A.Vector2 = 5] = "Vector2", A[A.Size = 6] = "Size", A[A.Color4 = 7] = "Color4", A[A.String = 8] = "String", A[A.Boolean = 9] = "Boolean", A[A.Null = 10] = "Null", A[A.Void = 11] = "Void", A[A.Unknown = 12] = "Unknown", A[A.Texture = 13] = "Texture", A[A.VideoTexture = 14] = "VideoTexture", A[A.CubeTexture = 15] = "CubeTexture", A[A.StandardMaterial = 16] = "StandardMaterial", A[A.PBRMaterial = 17] = "PBRMaterial", A[A.GradientMaterial = 18] = "GradientMaterial", A[A.Object = 19] = "Object", A[A.Array = 20] = "Array", A[A.GridMaterial = 21] = "GridMaterial", A[A.Vector4 = 23] = "Vector4", A[A.ShaderMaterial = 24] = "ShaderMaterial", A[A.NodeMaterial = 25] = "NodeMaterial", A[A.MirrorTexture = 26] = "MirrorTexture", A[A.WaterMaterial = 27] = "WaterMaterial", A[A.CityMaterial = 28] = "CityMaterial", A[A.Scene = 1e3] = "Scene", A[A.TransformNode = 1001] = "TransformNode", A[A.AbstractMesh = 1002] = "AbstractMesh", A[A.Mesh = 1003] = "Mesh", A[A.InstancedMesh = 1004] = "InstancedMesh", A[A.PointLight = 1005] = "PointLight", A[A.SpotLight = 1006] = "SpotLight", A[A.HemisphericLight = 1007] = "HemisphericLight", A[A.DirectionalLight = 1008] = "DirectionalLight", A[A.ArcRotateCamera = 1009] = "ArcRotateCamera", A[A.FollowCamera = 1010] = "FollowCamera", A[A.FreeCamera = 1011] = "FreeCamera", A[A.OrthographicCamera = 1012] = "OrthographicCamera", A))(se || {});
function RSe(A) {
  const e = {}, t = [], r = [];
  A.forEach((n) => {
    e[n.name] ? e[n.name]++ : e[n.name] = 0;
  }), Object.keys(e).forEach((n) => {
    e[n] ? t.push(n) : r.push(n);
  }), console.log("map: ", e), console.log("same: ", t), console.log("diff: ", r);
}
function VSe(A) {
  return Object.keys(A).map((e) => [e, A[e]]);
}
function CSe(A) {
  console.log("x: ", A.x, "y: ", A.y, "z: ", A.z);
}
function fq(A, e = (t) => {
}) {
  try {
    A && A();
  } catch (t) {
    console.error(t), e(t);
  }
}
function u2e(A) {
  return A == null || A === "";
}
function Zn(A) {
  return `${A || ""}${ye.RandomId()}`;
}
function OSe() {
  return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
}
function ySe(A, e) {
  for (let t = 0; t < e; t++) {
    const r = A.clone("clone", null);
    r.name = Zn();
    const n = Math.random() >= 0.5, i = Math.random() >= 0.5, s = Math.random() * 200, a = Math.random() * 200, f = new S(n ? s : -s, 0, i ? a : -a);
    r.position = f;
  }
}
function kSe(A) {
  const e = {};
  [...A.meshes, ...A.transformNodes].forEach((t) => {
    const r = t.name;
    typeof e[r] != "number" && (e[r] = 0), e[r]++;
  }), console.log(e);
}
const l2e = (A) => Object.prototype.toString.call(A) === "[object Number]", P2e = (A) => Object.prototype.toString.call(A) === "[object String]", c2e = (A) => Object.prototype.toString.call(A) === "[object Boolean]", XN = (A) => Object.prototype.toString.call(A) === "[object Array]", V0 = (A) => Object.prototype.toString.call(A) === "[object Object]", ESe = (A) => Object.prototype.toString.call(A) === "[object Function]", FSe = (A) => Object.prototype.toString.call(A) === "[object Undefined]", NSe = (A) => Object.prototype.toString.call(A) === "[object Null]", FH = (A, e) => {
  const t = {
    [Mo.Boolean]: "boolean",
    [Mo.Number]: "number",
    [Mo.String]: "string"
  }[e];
  if (typeof A === t)
    return A;
  if (t === "boolean")
    return !!A;
  if (t === "number") {
    let r = Number(A);
    return !isNaN(r) || (r = parseFloat(A), !isNaN(r)) ? r : 0;
  }
  if (t === "string")
    return A == null ? "" : String(A);
}, p2e = (A, e) => {
  if (e === se.Array)
    return XN(A) ? A : [];
  if (e === se.Object)
    return V0(A) ? A : {};
  if (e === se.String)
    return P2e(A) ? A : A == null ? "" : String(A);
  if (e === se.Number)
    return l2e(A) && !isNaN(A) || (A = Number(A), !isNaN(A)) || (A = parseFloat(A), !isNaN(A)) ? A : 0;
  if (e === se.Boolean)
    return c2e(A) ? A : !1;
}, h2e = (A) => ({
  string: Mo.String,
  integer: Mo.Number,
  float: Mo.Number,
  bool: Mo.Boolean
})[A] || Mo.String;
var H2e = typeof global == "object" && global && global.Object === Object && global;
const $1e = H2e;
var g2e = typeof self == "object" && self && self.Object === Object && self, X2e = $1e || g2e || Function("return this")();
const hg = X2e;
var T2e = hg.Symbol;
const XD = T2e;
var efe = Object.prototype, q2e = efe.hasOwnProperty, b2e = efe.toString, vI = XD ? XD.toStringTag : void 0;
function x2e(A) {
  var e = q2e.call(A, vI), t = A[vI];
  try {
    A[vI] = void 0;
    var r = !0;
  } catch {
  }
  var n = b2e.call(A);
  return r && (e ? A[vI] = t : delete A[vI]), n;
}
var D2e = Object.prototype, j2e = D2e.toString;
function w2e(A) {
  return j2e.call(A);
}
var m2e = "[object Null]", B2e = "[object Undefined]", cZ = XD ? XD.toStringTag : void 0;
function XU(A) {
  return A == null ? A === void 0 ? B2e : m2e : cZ && cZ in Object(A) ? x2e(A) : w2e(A);
}
function TU(A) {
  return A != null && typeof A == "object";
}
var W2e = "[object Symbol]";
function tfe(A) {
  return typeof A == "symbol" || TU(A) && XU(A) == W2e;
}
function S2e(A, e) {
  for (var t = -1, r = A == null ? 0 : A.length, n = Array(r); ++t < r; )
    n[t] = e(A[t], t, A);
  return n;
}
var U2e = Array.isArray;
const yy = U2e;
var I2e = 1 / 0, pZ = XD ? XD.prototype : void 0, hZ = pZ ? pZ.toString : void 0;
function rfe(A) {
  if (typeof A == "string")
    return A;
  if (yy(A))
    return S2e(A, rfe) + "";
  if (tfe(A))
    return hZ ? hZ.call(A) : "";
  var e = A + "";
  return e == "0" && 1 / A == -I2e ? "-0" : e;
}
var R2e = /\s/;
function V2e(A) {
  for (var e = A.length; e-- && R2e.test(A.charAt(e)); )
    ;
  return e;
}
var C2e = /^\s+/;
function O2e(A) {
  return A && A.slice(0, V2e(A) + 1).replace(C2e, "");
}
function xm(A) {
  var e = typeof A;
  return A != null && (e == "object" || e == "function");
}
var HZ = NaN, y2e = /^[-+]0x[0-9a-f]+$/i, k2e = /^0b[01]+$/i, E2e = /^0o[0-7]+$/i, F2e = parseInt;
function nfe(A) {
  if (typeof A == "number")
    return A;
  if (tfe(A))
    return HZ;
  if (xm(A)) {
    var e = typeof A.valueOf == "function" ? A.valueOf() : A;
    A = xm(e) ? e + "" : e;
  }
  if (typeof A != "string")
    return A === 0 ? A : +A;
  A = O2e(A);
  var t = k2e.test(A);
  return t || E2e.test(A) ? F2e(A.slice(2), t ? 2 : 8) : y2e.test(A) ? HZ : +A;
}
var gZ = 1 / 0, N2e = 17976931348623157e292;
function Q2e(A) {
  if (!A)
    return A === 0 ? A : 0;
  if (A = nfe(A), A === gZ || A === -gZ) {
    var e = A < 0 ? -1 : 1;
    return e * N2e;
  }
  return A === A ? A : 0;
}
function Y2e(A) {
  var e = Q2e(A), t = e % 1;
  return e === e ? t ? e - t : e : 0;
}
var M2e = "[object AsyncFunction]", L2e = "[object Function]", K2e = "[object GeneratorFunction]", J2e = "[object Proxy]";
function ife(A) {
  if (!xm(A))
    return !1;
  var e = XU(A);
  return e == L2e || e == K2e || e == M2e || e == J2e;
}
var z2e = hg["__core-js_shared__"];
const yE = z2e;
var XZ = function() {
  var A = /[^.]+$/.exec(yE && yE.keys && yE.keys.IE_PROTO || "");
  return A ? "Symbol(src)_1." + A : "";
}();
function G2e(A) {
  return !!XZ && XZ in A;
}
var Z2e = Function.prototype, _2e = Z2e.toString;
function Fm(A) {
  if (A != null) {
    try {
      return _2e.call(A);
    } catch {
    }
    try {
      return A + "";
    } catch {
    }
  }
  return "";
}
var $2e = /[\\^$.*+?()[\]{}|]/g, e4e = /^\[object .+?Constructor\]$/, t4e = Function.prototype, r4e = Object.prototype, n4e = t4e.toString, i4e = r4e.hasOwnProperty, s4e = RegExp(
  "^" + n4e.call(i4e).replace($2e, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function a4e(A) {
  if (!xm(A) || G2e(A))
    return !1;
  var e = ife(A) ? s4e : e4e;
  return e.test(Fm(A));
}
function o4e(A, e) {
  return A == null ? void 0 : A[e];
}
function Nm(A, e) {
  var t = o4e(A, e);
  return a4e(t) ? t : void 0;
}
var f4e = Nm(hg, "WeakMap");
const TN = f4e;
var TZ = Object.create, A4e = /* @__PURE__ */ function() {
  function A() {
  }
  return function(e) {
    if (!xm(e))
      return {};
    if (TZ)
      return TZ(e);
    A.prototype = e;
    var t = new A();
    return A.prototype = void 0, t;
  };
}();
const d4e = A4e;
function v4e(A, e) {
  var t = -1, r = A.length;
  for (e || (e = Array(r)); ++t < r; )
    e[t] = A[t];
  return e;
}
var u4e = function() {
  try {
    var A = Nm(Object, "defineProperty");
    return A({}, "", {}), A;
  } catch {
  }
}();
const qZ = u4e;
function l4e(A, e) {
  for (var t = -1, r = A == null ? 0 : A.length; ++t < r && e(A[t], t, A) !== !1; )
    ;
  return A;
}
var P4e = 9007199254740991, c4e = /^(?:0|[1-9]\d*)$/;
function p4e(A, e) {
  var t = typeof A;
  return e = e ?? P4e, !!e && (t == "number" || t != "symbol" && c4e.test(A)) && A > -1 && A % 1 == 0 && A < e;
}
function sfe(A, e, t) {
  e == "__proto__" && qZ ? qZ(A, e, {
    configurable: !0,
    enumerable: !0,
    value: t,
    writable: !0
  }) : A[e] = t;
}
function afe(A, e) {
  return A === e || A !== A && e !== e;
}
var h4e = Object.prototype, H4e = h4e.hasOwnProperty;
function ofe(A, e, t) {
  var r = A[e];
  (!(H4e.call(A, e) && afe(r, t)) || t === void 0 && !(e in A)) && sfe(A, e, t);
}
function ky(A, e, t, r) {
  var n = !t;
  t || (t = {});
  for (var i = -1, s = e.length; ++i < s; ) {
    var a = e[i], f = r ? r(t[a], A[a], a, t, A) : void 0;
    f === void 0 && (f = A[a]), n ? sfe(t, a, f) : ofe(t, a, f);
  }
  return t;
}
var g4e = 9007199254740991;
function ffe(A) {
  return typeof A == "number" && A > -1 && A % 1 == 0 && A <= g4e;
}
function Afe(A) {
  return A != null && ffe(A.length) && !ife(A);
}
var X4e = Object.prototype;
function aM(A) {
  var e = A && A.constructor, t = typeof e == "function" && e.prototype || X4e;
  return A === t;
}
function T4e(A, e) {
  for (var t = -1, r = Array(A); ++t < A; )
    r[t] = e(t);
  return r;
}
var q4e = "[object Arguments]";
function bZ(A) {
  return TU(A) && XU(A) == q4e;
}
var dfe = Object.prototype, b4e = dfe.hasOwnProperty, x4e = dfe.propertyIsEnumerable, D4e = bZ(/* @__PURE__ */ function() {
  return arguments;
}()) ? bZ : function(A) {
  return TU(A) && b4e.call(A, "callee") && !x4e.call(A, "callee");
};
const j4e = D4e;
function w4e() {
  return !1;
}
var vfe = typeof exports == "object" && exports && !exports.nodeType && exports, xZ = vfe && typeof module == "object" && module && !module.nodeType && module, m4e = xZ && xZ.exports === vfe, DZ = m4e ? hg.Buffer : void 0, B4e = DZ ? DZ.isBuffer : void 0, W4e = B4e || w4e;
const ufe = W4e;
var S4e = "[object Arguments]", U4e = "[object Array]", I4e = "[object Boolean]", R4e = "[object Date]", V4e = "[object Error]", C4e = "[object Function]", O4e = "[object Map]", y4e = "[object Number]", k4e = "[object Object]", E4e = "[object RegExp]", F4e = "[object Set]", N4e = "[object String]", Q4e = "[object WeakMap]", Y4e = "[object ArrayBuffer]", M4e = "[object DataView]", L4e = "[object Float32Array]", K4e = "[object Float64Array]", J4e = "[object Int8Array]", z4e = "[object Int16Array]", G4e = "[object Int32Array]", Z4e = "[object Uint8Array]", _4e = "[object Uint8ClampedArray]", $4e = "[object Uint16Array]", eTe = "[object Uint32Array]", yf = {};
yf[L4e] = yf[K4e] = yf[J4e] = yf[z4e] = yf[G4e] = yf[Z4e] = yf[_4e] = yf[$4e] = yf[eTe] = !0;
yf[S4e] = yf[U4e] = yf[Y4e] = yf[I4e] = yf[M4e] = yf[R4e] = yf[V4e] = yf[C4e] = yf[O4e] = yf[y4e] = yf[k4e] = yf[E4e] = yf[F4e] = yf[N4e] = yf[Q4e] = !1;
function tTe(A) {
  return TU(A) && ffe(A.length) && !!yf[XU(A)];
}
function oM(A) {
  return function(e) {
    return A(e);
  };
}
var lfe = typeof exports == "object" && exports && !exports.nodeType && exports, RI = lfe && typeof module == "object" && module && !module.nodeType && module, rTe = RI && RI.exports === lfe, kE = rTe && $1e.process, nTe = function() {
  try {
    var A = RI && RI.require && RI.require("util").types;
    return A || kE && kE.binding && kE.binding("util");
  } catch {
  }
}();
const GS = nTe;
var jZ = GS && GS.isTypedArray, iTe = jZ ? oM(jZ) : tTe;
const sTe = iTe;
var aTe = Object.prototype, oTe = aTe.hasOwnProperty;
function Pfe(A, e) {
  var t = yy(A), r = !t && j4e(A), n = !t && !r && ufe(A), i = !t && !r && !n && sTe(A), s = t || r || n || i, a = s ? T4e(A.length, String) : [], f = a.length;
  for (var o in A)
    (e || oTe.call(A, o)) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
    (o == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    n && (o == "offset" || o == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    i && (o == "buffer" || o == "byteLength" || o == "byteOffset") || // Skip index properties.
    p4e(o, f))) && a.push(o);
  return a;
}
function cfe(A, e) {
  return function(t) {
    return A(e(t));
  };
}
var fTe = cfe(Object.keys, Object);
const ATe = fTe;
var dTe = Object.prototype, vTe = dTe.hasOwnProperty;
function uTe(A) {
  if (!aM(A))
    return ATe(A);
  var e = [];
  for (var t in Object(A))
    vTe.call(A, t) && t != "constructor" && e.push(t);
  return e;
}
function fM(A) {
  return Afe(A) ? Pfe(A) : uTe(A);
}
function lTe(A) {
  var e = [];
  if (A != null)
    for (var t in Object(A))
      e.push(t);
  return e;
}
var PTe = Object.prototype, cTe = PTe.hasOwnProperty;
function pTe(A) {
  if (!xm(A))
    return lTe(A);
  var e = aM(A), t = [];
  for (var r in A)
    r == "constructor" && (e || !cTe.call(A, r)) || t.push(r);
  return t;
}
function AM(A) {
  return Afe(A) ? Pfe(A, !0) : pTe(A);
}
var hTe = Nm(Object, "create");
const vR = hTe;
function HTe() {
  this.__data__ = vR ? vR(null) : {}, this.size = 0;
}
function gTe(A) {
  var e = this.has(A) && delete this.__data__[A];
  return this.size -= e ? 1 : 0, e;
}
var XTe = "__lodash_hash_undefined__", TTe = Object.prototype, qTe = TTe.hasOwnProperty;
function bTe(A) {
  var e = this.__data__;
  if (vR) {
    var t = e[A];
    return t === XTe ? void 0 : t;
  }
  return qTe.call(e, A) ? e[A] : void 0;
}
var xTe = Object.prototype, DTe = xTe.hasOwnProperty;
function jTe(A) {
  var e = this.__data__;
  return vR ? e[A] !== void 0 : DTe.call(e, A);
}
var wTe = "__lodash_hash_undefined__";
function mTe(A, e) {
  var t = this.__data__;
  return this.size += this.has(A) ? 0 : 1, t[A] = vR && e === void 0 ? wTe : e, this;
}
function Dm(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.clear(); ++e < t; ) {
    var r = A[e];
    this.set(r[0], r[1]);
  }
}
Dm.prototype.clear = HTe;
Dm.prototype.delete = gTe;
Dm.prototype.get = bTe;
Dm.prototype.has = jTe;
Dm.prototype.set = mTe;
function BTe() {
  this.__data__ = [], this.size = 0;
}
function Ey(A, e) {
  for (var t = A.length; t--; )
    if (afe(A[t][0], e))
      return t;
  return -1;
}
var WTe = Array.prototype, STe = WTe.splice;
function UTe(A) {
  var e = this.__data__, t = Ey(e, A);
  if (t < 0)
    return !1;
  var r = e.length - 1;
  return t == r ? e.pop() : STe.call(e, t, 1), --this.size, !0;
}
function ITe(A) {
  var e = this.__data__, t = Ey(e, A);
  return t < 0 ? void 0 : e[t][1];
}
function RTe(A) {
  return Ey(this.__data__, A) > -1;
}
function VTe(A, e) {
  var t = this.__data__, r = Ey(t, A);
  return r < 0 ? (++this.size, t.push([A, e])) : t[r][1] = e, this;
}
function mq(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.clear(); ++e < t; ) {
    var r = A[e];
    this.set(r[0], r[1]);
  }
}
mq.prototype.clear = BTe;
mq.prototype.delete = UTe;
mq.prototype.get = ITe;
mq.prototype.has = RTe;
mq.prototype.set = VTe;
var CTe = Nm(hg, "Map");
const uR = CTe;
function OTe() {
  this.size = 0, this.__data__ = {
    hash: new Dm(),
    map: new (uR || mq)(),
    string: new Dm()
  };
}
function yTe(A) {
  var e = typeof A;
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? A !== "__proto__" : A === null;
}
function Fy(A, e) {
  var t = A.__data__;
  return yTe(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
}
function kTe(A) {
  var e = Fy(this, A).delete(A);
  return this.size -= e ? 1 : 0, e;
}
function ETe(A) {
  return Fy(this, A).get(A);
}
function FTe(A) {
  return Fy(this, A).has(A);
}
function NTe(A, e) {
  var t = Fy(this, A), r = t.size;
  return t.set(A, e), this.size += t.size == r ? 0 : 1, this;
}
function qU(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.clear(); ++e < t; ) {
    var r = A[e];
    this.set(r[0], r[1]);
  }
}
qU.prototype.clear = OTe;
qU.prototype.delete = kTe;
qU.prototype.get = ETe;
qU.prototype.has = FTe;
qU.prototype.set = NTe;
function wZ(A) {
  return A == null ? "" : rfe(A);
}
function pfe(A, e) {
  for (var t = -1, r = e.length, n = A.length; ++t < r; )
    A[n + t] = e[t];
  return A;
}
var QTe = cfe(Object.getPrototypeOf, Object);
const hfe = QTe;
var YTe = hg.isFinite, MTe = Math.min;
function LTe(A) {
  var e = Math[A];
  return function(t, r) {
    if (t = nfe(t), r = r == null ? 0 : MTe(Y2e(r), 292), r && YTe(t)) {
      var n = (wZ(t) + "e").split("e"), i = e(n[0] + "e" + (+n[1] + r));
      return n = (wZ(i) + "e").split("e"), +(n[0] + "e" + (+n[1] - r));
    }
    return e(t);
  };
}
function KTe() {
  this.__data__ = new mq(), this.size = 0;
}
function JTe(A) {
  var e = this.__data__, t = e.delete(A);
  return this.size = e.size, t;
}
function zTe(A) {
  return this.__data__.get(A);
}
function GTe(A) {
  return this.__data__.has(A);
}
var ZTe = 200;
function _Te(A, e) {
  var t = this.__data__;
  if (t instanceof mq) {
    var r = t.__data__;
    if (!uR || r.length < ZTe - 1)
      return r.push([A, e]), this.size = ++t.size, this;
    t = this.__data__ = new qU(r);
  }
  return t.set(A, e), this.size = t.size, this;
}
function bU(A) {
  var e = this.__data__ = new mq(A);
  this.size = e.size;
}
bU.prototype.clear = KTe;
bU.prototype.delete = JTe;
bU.prototype.get = zTe;
bU.prototype.has = GTe;
bU.prototype.set = _Te;
function $Te(A, e) {
  return A && ky(e, fM(e), A);
}
function e8e(A, e) {
  return A && ky(e, AM(e), A);
}
var Hfe = typeof exports == "object" && exports && !exports.nodeType && exports, mZ = Hfe && typeof module == "object" && module && !module.nodeType && module, t8e = mZ && mZ.exports === Hfe, BZ = t8e ? hg.Buffer : void 0, WZ = BZ ? BZ.allocUnsafe : void 0;
function r8e(A, e) {
  if (e)
    return A.slice();
  var t = A.length, r = WZ ? WZ(t) : new A.constructor(t);
  return A.copy(r), r;
}
function n8e(A, e) {
  for (var t = -1, r = A == null ? 0 : A.length, n = 0, i = []; ++t < r; ) {
    var s = A[t];
    e(s, t, A) && (i[n++] = s);
  }
  return i;
}
function gfe() {
  return [];
}
var i8e = Object.prototype, s8e = i8e.propertyIsEnumerable, SZ = Object.getOwnPropertySymbols, a8e = SZ ? function(A) {
  return A == null ? [] : (A = Object(A), n8e(SZ(A), function(e) {
    return s8e.call(A, e);
  }));
} : gfe;
const dM = a8e;
function o8e(A, e) {
  return ky(A, dM(A), e);
}
var f8e = Object.getOwnPropertySymbols, A8e = f8e ? function(A) {
  for (var e = []; A; )
    pfe(e, dM(A)), A = hfe(A);
  return e;
} : gfe;
const Xfe = A8e;
function d8e(A, e) {
  return ky(A, Xfe(A), e);
}
function Tfe(A, e, t) {
  var r = e(A);
  return yy(A) ? r : pfe(r, t(A));
}
function v8e(A) {
  return Tfe(A, fM, dM);
}
function u8e(A) {
  return Tfe(A, AM, Xfe);
}
var l8e = Nm(hg, "DataView");
const qN = l8e;
var P8e = Nm(hg, "Promise");
const bN = P8e;
var c8e = Nm(hg, "Set");
const xN = c8e;
var UZ = "[object Map]", p8e = "[object Object]", IZ = "[object Promise]", RZ = "[object Set]", VZ = "[object WeakMap]", CZ = "[object DataView]", h8e = Fm(qN), H8e = Fm(uR), g8e = Fm(bN), X8e = Fm(xN), T8e = Fm(TN), Nw = XU;
(qN && Nw(new qN(new ArrayBuffer(1))) != CZ || uR && Nw(new uR()) != UZ || bN && Nw(bN.resolve()) != IZ || xN && Nw(new xN()) != RZ || TN && Nw(new TN()) != VZ) && (Nw = function(A) {
  var e = XU(A), t = e == p8e ? A.constructor : void 0, r = t ? Fm(t) : "";
  if (r)
    switch (r) {
      case h8e:
        return CZ;
      case H8e:
        return UZ;
      case g8e:
        return IZ;
      case X8e:
        return RZ;
      case T8e:
        return VZ;
    }
  return e;
});
const vM = Nw;
var q8e = Object.prototype, b8e = q8e.hasOwnProperty;
function x8e(A) {
  var e = A.length, t = new A.constructor(e);
  return e && typeof A[0] == "string" && b8e.call(A, "index") && (t.index = A.index, t.input = A.input), t;
}
var D8e = hg.Uint8Array;
const OZ = D8e;
function uM(A) {
  var e = new A.constructor(A.byteLength);
  return new OZ(e).set(new OZ(A)), e;
}
function j8e(A, e) {
  var t = e ? uM(A.buffer) : A.buffer;
  return new A.constructor(t, A.byteOffset, A.byteLength);
}
var w8e = /\w*$/;
function m8e(A) {
  var e = new A.constructor(A.source, w8e.exec(A));
  return e.lastIndex = A.lastIndex, e;
}
var yZ = XD ? XD.prototype : void 0, kZ = yZ ? yZ.valueOf : void 0;
function B8e(A) {
  return kZ ? Object(kZ.call(A)) : {};
}
function W8e(A, e) {
  var t = e ? uM(A.buffer) : A.buffer;
  return new A.constructor(t, A.byteOffset, A.length);
}
var S8e = "[object Boolean]", U8e = "[object Date]", I8e = "[object Map]", R8e = "[object Number]", V8e = "[object RegExp]", C8e = "[object Set]", O8e = "[object String]", y8e = "[object Symbol]", k8e = "[object ArrayBuffer]", E8e = "[object DataView]", F8e = "[object Float32Array]", N8e = "[object Float64Array]", Q8e = "[object Int8Array]", Y8e = "[object Int16Array]", M8e = "[object Int32Array]", L8e = "[object Uint8Array]", K8e = "[object Uint8ClampedArray]", J8e = "[object Uint16Array]", z8e = "[object Uint32Array]";
function G8e(A, e, t) {
  var r = A.constructor;
  switch (e) {
    case k8e:
      return uM(A);
    case S8e:
    case U8e:
      return new r(+A);
    case E8e:
      return j8e(A, t);
    case F8e:
    case N8e:
    case Q8e:
    case Y8e:
    case M8e:
    case L8e:
    case K8e:
    case J8e:
    case z8e:
      return W8e(A, t);
    case I8e:
      return new r();
    case R8e:
    case O8e:
      return new r(A);
    case V8e:
      return m8e(A);
    case C8e:
      return new r();
    case y8e:
      return B8e(A);
  }
}
function Z8e(A) {
  return typeof A.constructor == "function" && !aM(A) ? d4e(hfe(A)) : {};
}
var _8e = "[object Map]";
function $8e(A) {
  return TU(A) && vM(A) == _8e;
}
var EZ = GS && GS.isMap, eqe = EZ ? oM(EZ) : $8e;
const tqe = eqe;
var rqe = "[object Set]";
function nqe(A) {
  return TU(A) && vM(A) == rqe;
}
var FZ = GS && GS.isSet, iqe = FZ ? oM(FZ) : nqe;
const sqe = iqe;
var aqe = 1, oqe = 2, fqe = 4, qfe = "[object Arguments]", Aqe = "[object Array]", dqe = "[object Boolean]", vqe = "[object Date]", uqe = "[object Error]", bfe = "[object Function]", lqe = "[object GeneratorFunction]", Pqe = "[object Map]", cqe = "[object Number]", xfe = "[object Object]", pqe = "[object RegExp]", hqe = "[object Set]", Hqe = "[object String]", gqe = "[object Symbol]", Xqe = "[object WeakMap]", Tqe = "[object ArrayBuffer]", qqe = "[object DataView]", bqe = "[object Float32Array]", xqe = "[object Float64Array]", Dqe = "[object Int8Array]", jqe = "[object Int16Array]", wqe = "[object Int32Array]", mqe = "[object Uint8Array]", Bqe = "[object Uint8ClampedArray]", Wqe = "[object Uint16Array]", Sqe = "[object Uint32Array]", gf = {};
gf[qfe] = gf[Aqe] = gf[Tqe] = gf[qqe] = gf[dqe] = gf[vqe] = gf[bqe] = gf[xqe] = gf[Dqe] = gf[jqe] = gf[wqe] = gf[Pqe] = gf[cqe] = gf[xfe] = gf[pqe] = gf[hqe] = gf[Hqe] = gf[gqe] = gf[mqe] = gf[Bqe] = gf[Wqe] = gf[Sqe] = !0;
gf[uqe] = gf[bfe] = gf[Xqe] = !1;
function kC(A, e, t, r, n, i) {
  var s, a = e & aqe, f = e & oqe, o = e & fqe;
  if (t && (s = n ? t(A, r, n, i) : t(A)), s !== void 0)
    return s;
  if (!xm(A))
    return A;
  var d = yy(A);
  if (d) {
    if (s = x8e(A), !a)
      return v4e(A, s);
  } else {
    var v = vM(A), u = v == bfe || v == lqe;
    if (ufe(A))
      return r8e(A, a);
    if (v == xfe || v == qfe || u && !n) {
      if (s = f || u ? {} : Z8e(A), !a)
        return f ? d8e(A, e8e(s, A)) : o8e(A, $Te(s, A));
    } else {
      if (!gf[v])
        return n ? A : {};
      s = G8e(A, v, a);
    }
  }
  i || (i = new bU());
  var l = i.get(A);
  if (l)
    return l;
  i.set(A, s), sqe(A) ? A.forEach(function(c) {
    s.add(kC(c, e, t, c, A, i));
  }) : tqe(A) && A.forEach(function(c, H) {
    s.set(H, kC(c, e, t, H, A, i));
  });
  var P = o ? f ? u8e : v8e : f ? AM : fM, p = d ? void 0 : P(A);
  return l4e(p || A, function(c, H) {
    p && (H = c, c = A[H]), ofe(s, H, kC(c, e, t, H, A, i));
  }), s;
}
var Uqe = 1, Iqe = 4;
function M9(A) {
  return kC(A, Uqe | Iqe);
}
var Rqe = LTe("round");
const Vqe = Rqe;
function QSe(A, e, t) {
  const r = A.getScene();
  let n = [], i = A.material, s = r.getMaterialById("le5le_alarmMat");
  A.material instanceof Wt || A.material instanceof mr ? A.material instanceof Wt ? n = A.material.diffuseColor.asArray() : n = A.material.albedoColor.asArray() : s || (s = new Wt("le5le_alarmMat", r), A.material = s, n = s.diffuseColor.asArray());
  const a = A4(e);
  let f;
  i instanceof mr ? f = new st(
    "alarm",
    "albedoColor",
    60,
    st.ANIMATIONTYPE_COLOR3,
    st.ANIMATIONLOOPMODE_CYCLE
  ) : f = new st(
    "alarm",
    "diffuseColor",
    60,
    st.ANIMATIONTYPE_COLOR3,
    st.ANIMATIONLOOPMODE_CYCLE
  );
  const o = [];
  o.push({
    frame: 0,
    value: Ne.FromArray(n)
  }), o.push({
    frame: t / 2,
    value: a
  }), o.push({
    frame: t,
    value: Ne.FromArray(n)
  }), f.setKeys(o);
  const d = r.beginDirectAnimation(
    A.material,
    [f],
    0,
    t,
    !0
  );
  return d.disposeOnEnd = !0, d.onAnimationEndObservable.add(() => {
  }), d.onAnimationLoopObservable.add(() => {
    d.stop();
  }), d;
}
class YSe {
  constructor(e, t = []) {
    this.materials = /* @__PURE__ */ new Map(), this.addMaterial = (r) => {
      r.id = r.id || Zn();
      const { type: n, id: i } = r;
      return this.materials.get(n) || this.materials.set(n, /* @__PURE__ */ new Map()), this.materials.get(n).set(i, r), r;
    }, this.getMaterial = (r) => {
      for (const [, n] of this.materials)
        if (n.has(r))
          return n.get(r);
    }, this.data = () => M9(this.allMaterials()), this.matDispose = (r, n) => {
      let i = n.getMaterialByName(r);
      i && (i.diffuseColor && (i.diffuseColor = null), i.diffuseTexture && i.diffuseTexture.dispose(), i.emissiveColor && (i.diffuseColor = null), i.emissiveTexture && i.emissiveTexture.dispose(), i.diffuseTexture && i.diffuseTexture.name === "video" && i.diffuseTexture.video.pause(), i.dispose());
    }, this.dispose = () => {
    }, this.root = e, this.materials.set("image", /* @__PURE__ */ new Map()), this.materials.set("video", /* @__PURE__ */ new Map()), t.forEach(([r, n]) => {
      this.materials.get(r) || this.materials.set(r, /* @__PURE__ */ new Map());
      const i = this.materials.get(r);
      n.forEach((s) => {
        const { id: a } = s;
        i.set(a, s);
      });
    });
  }
  //删除某一条材质信息
  removeMaterial(e) {
    for (const [, t] of this.materials)
      if (t.get(e))
        return this.root.getAllScenes().forEach((r) => {
          this.matDispose(e, r.scene.scene);
        }), t.delete(e);
  }
  //-----------
  updateMaterial(e) {
    this.materials.forEach((t) => {
      t.get(e.id) && (t.delete(e.id), this.addMaterial(e), this.root.getAllScenes().forEach((r) => {
        let n = r.scene.scene.getMaterialByName(e.id);
        if (n) {
          let i = e.type === "image" ? this.createMatImage(e, r.scene.scene) : this.createMatVideo(e, r.scene.scene);
          r.scene.scene.meshes.forEach((s) => {
            s.material && s.material.name && s.material.name === n.name && (s.material = i);
          }), n.dispose();
        }
      }));
    });
  }
  //获取this.materials列表的信息；
  allMaterials() {
    return [...this.materials].map(([e, t]) => [
      e,
      [...t].map(([, r]) => r)
    ]);
  }
  //将材质绑定在Mesh上
  bindMaterialToMesh(e, t) {
    if (e && e.length > 0) {
      let r = e, n = r[0].getScene(), i = n.getMaterialByName(t);
      if (i)
        r.forEach((s) => {
          s.material = null, s.material = i;
        });
      else {
        let s = this.getMaterial(t), a = s.type === "image" ? this.createMatImage(s, n) : this.createMatVideo(s, n);
        r.forEach((f) => {
          f.material = null, f.material = a;
        });
      }
    }
  }
  //将Mat解绑
  removeMatToMesh(e) {
    let t = null;
    if (e && e.length > 0) {
      e.forEach((i) => {
        t = i.material, i.material = null;
      });
      let n = !0;
      this.root.getAllScenes().forEach((i) => {
        let s = i.scene;
        s.meshes.forEach((a) => {
          t && a.material && a.material.name && t.name && a.material.name === t.name && (n = !1);
        }), n && t && t.name && this.matDispose(t.name, s);
      });
    }
  }
  //创建一个图片贴图类型的材质；
  createMatImage(e, t) {
    let r = new Wt("standardMaterial", t);
    return r.name = e.id, this.matImage(r, e, t), r;
  }
  /**
   * 根据前端UI的交互传过来的materialData修改material的属性(img)；
   * @param mat StandardMaterial 材质实例对象；
   * @param data MaterialData 信息
   * @param scene Scene 当前场景
   */
  matImage(e, t, r) {
    t.diffuseColor && (e.diffuseColor = A4(t.diffuseColor)), t.emissiveColor && (e.emissiveColor = A4(t.emissiveColor)), t.type === "image" && (t.diffuseTexture && (e.diffuseTexture = new We(t.diffuseTexture, r)), t.emissiveTexture && (e.emissiveTexture = new We(t.emissiveTexture, r)));
  }
  /**
   * 创建一个视频贴图类的材质
   * @param data 属性数据
   * @param scene 当前的场景
   * @returns 实例化材质
   */
  createMatVideo(e, t) {
    let r = new Wt("standardMaterial", t);
    return this.matVideo(r, e, t), r.name = e.id, r;
  }
  /**
   * 根据前端UI的交互传过来的materialData修改material的属性(video)；
   * @param videoMat  材质实例对象；
   * @param data  信息
   * @param scene  当前场景
   */
  matVideo(e, t, r) {
    t.diffuseVideo && (e.diffuseTexture = new xc(
      "video",
      t.diffuseVideo,
      r
    ));
    let n = e.diffuseTexture;
    n.video.autoplay = !1, n.coordinatesIndex = 0, e.emissiveColor = Ne.White();
  }
  /**
   * 修改实例材质信息
   * @param mat 实例材质
   * @param data 属性数据
   */
  chargeMaterialProp(e, t) {
    this.root.getAllScenes().forEach((r) => {
      let n = r.scene;
      t.type == "image" ? (e.diffuseColor && (e.diffuseColor = null), e.diffuseTexture && e.diffuseTexture.dispose(), e.emissiveColor && (e.diffuseColor = null), e.emissiveTexture && e.emissiveTexture.dispose(), this.matImage(e, t, n)) : (e.diffuseTexture && e.diffuseTexture.dispose(), this.matVideo(e, t, n));
    });
  }
}
var Rv = /* @__PURE__ */ ((A) => (A.Grad = "Grad", A.OutLine = "OutLine", A))(Rv || {});
function MSe(A, e, t) {
  const r = A.getScene();
  An.ShadersStore[A.name + "VertexShader"] = `\r
precision highp float;\r
//attribute\r
attribute vec3 position;\r
attribute vec2 uv;\r
attribute vec3 normal;\r
//uniform\r
uniform mat4 worldViewProjection;\r
//varying\r
varying vec3 vPosition;\r
varying vec2 vUV;\r
void main(void) {\r
   gl_Position = worldViewProjection*vec4(position,1.0);\r
   vPosition = position;\r
   vUV = uv;\r
}\r
`, An.ShadersStore[A.name + "ragmentShader"] = `\r
precision highp float;\r
varying vec3 vPosition;\r
uniform float distance;\r
uniform vec3 changeColor;\r
uniform vec3 center;\r
uniform float pow;\r
float distanceTwoVec3(vec3 p1,vec3 p2){\r
   float d = sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y)+(p1.z-p2.z)*(p1.z-p2.z));\r
   return d;\r
}\r
void main(void) {\r
   float alpha = distanceTwoVec3(center,vPosition)*0.8/distance;\r
   gl_FragColor = vec4(changeColor,pow(alpha,pow);\r
}\r
`;
  let n = new Zo(
    A.name,
    r,
    {
      vertex: "custom",
      fragment: "custom"
    },
    {
      attributes: ["normals", "position", "uv"],
      uniforms: [
        "world",
        "worldView",
        "worldViewProjection",
        "view",
        "projection"
      ],
      needAlphaBlending: !0,
      needAlphaTesting: !0
    }
  );
  n.name = "shader" + A.name;
  const i = Ne.FromHexString(e), s = t || 2, a = A.getBoundingInfo().boundingBox.center, f = A.getBoundingInfo().boundingBox.maximum, o = S.Distance(a, f);
  n.setFloat("distance", o), n.setColor3("changeColor", i), n.setVector3("center", a), n.setFloat("pow", s);
  const d = [];
  return d.push({ name: "pow", unifrom: s }), d.push({ name: "changeColor", unifrom: i }), {
    mat: n,
    rtList: d
  };
}
function Cqe(A, e) {
  An.ShadersStore[A + "VertexShader"] = `\r
precision highp float;\r
//attribute\r
attribute vec3 position;\r
attribute vec2 uv;\r
attribute vec3 normal;\r
//uniform\r
uniform mat4 worldViewProjection;\r
//varying\r
varying vec3 vPosition;\r
varying vec2 vUV;\r
varying vec3 vNormal;\r
void main(void) {\r
   gl_Position = worldViewProjection*vec4(position,1.0);\r
   vPosition = position;\r
   vUV = uv;\r
   vNormal = normal;\r
}\r
`, An.ShadersStore[A + "FragmentShader"] = `\r
precision highp float;\r
varying vec3 vPosition;\r
varying vec3 vNormal;\r
uniform float distance;\r
uniform vec3 changeColor;\r
uniform vec3 center;\r
uniform float power;\r
uniform float k;\r
uniform vec3 viewPoint;\r
float distanceTwoVec3(vec3 p1,vec3 p2){\r
   float d = sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y)+(p1.z-p2.z)*(p1.z-p2.z));\r
   return d;\r
}\r
void main(void) {\r
   float modelDot = abs(dot(viewPoint,vNormal)/(length(viewPoint)*length(vNormal)));\r
   float alpha = distanceTwoVec3(center,vPosition)*k /distance;\r
   vec3 color = changeColor;\r
   alpha = modelDot * pow(alpha,power);\r
   gl_FragColor = vec4(color,alpha);\r
}\r
`;
  let t = new Zo(
    "effectGlShader" + A,
    e,
    {
      vertex: A,
      fragment: A
    },
    {
      attributes: ["normal", "position", "uv"],
      uniforms: [
        "world",
        "worldView",
        "worldViewProjection",
        "view",
        "projection"
      ],
      needAlphaBlending: !0,
      needAlphaTesting: !0
    }
  );
  return t.onBind = (r) => {
    const n = r.getBoundingInfo().boundingBox, i = S.Normalize(n.centerWorld), s = S.Distance(n.centerWorld, n.maximumWorld);
    t.setFloat("distance", s), t.setVector3("center", i), t.setVector3("viewPoint", S.Normalize(r.getScene().activeCamera.position)), t.onBind = null;
  }, t.setFloat("distance", 20), t.setVector3("center", new S(10, 10 * Math.random(), 10)), t.setVector3("viewPoint", new S(10, 10 * Math.random(), 10)), t;
}
function Oqe(A, e) {
  return An.ShadersStore["gradient" + A + "VertexShader"] = `\r
precision highp float;\r
//attribute\r
attribute vec3 position;\r
attribute vec2 uv;\r
attribute vec3 normal;\r
//uniform\r
uniform mat4 worldViewProjection;\r
//varying\r
varying vec3 vPosition;\r
varying vec2 vUV;\r
varying vec3 vNormal;\r
void main(void) {\r
   gl_Position = worldViewProjection*vec4(position,1.0);\r
   vPosition = position;\r
   vUV = uv;\r
   vNormal = normal;\r
}\r
`, An.ShadersStore["gradient" + A + "FragmentShader"] = `\r
precision highp float;\r
varying vec3 vPosition;\r
float distanceTwoVec3(vec3 p1,vec3 p2){\r
   float d = sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y)+(p1.z-p2.z)*(p1.z-p2.z));\r
   return d;\r
}\r
uniform vec3 mainColor;\r
uniform float maxHeight;\r
uniform float minHeight;\r
uniform float alphaK;\r
void main(void) {\r
   float height = maxHeight - minHeight;\r
   vec3 color = mainColor;\r
   float alpha = (vPosition.y-minHeight)/height;\r
   gl_FragColor = vec4(color,alphaK+pow(alpha,0.5)*alpha*(1.0-alphaK));\r
}\r
`, new Zo(
    "effectGradAlpha" + A,
    e,
    {
      vertex: "gradient" + A,
      fragment: "gradient" + A
    },
    {
      attributes: ["normal", "position", "uv"],
      uniforms: [
        "world",
        "worldView",
        "worldViewProjection",
        "view",
        "projection"
      ],
      needAlphaBlending: !0,
      needAlphaTesting: !0
    }
  );
}
var zi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Dfe(A) {
  return A && A.__esModule && Object.prototype.hasOwnProperty.call(A, "default") ? A.default : A;
}
function jfe(A) {
  if (A.__esModule)
    return A;
  var e = A.default;
  if (typeof e == "function") {
    var t = function r() {
      return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
    };
    t.prototype = e.prototype;
  } else
    t = {};
  return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(A).forEach(function(r) {
    var n = Object.getOwnPropertyDescriptor(A, r);
    Object.defineProperty(t, r, n.get ? n : {
      enumerable: !0,
      get: function() {
        return A[r];
      }
    });
  }), t;
}
var wfe = { exports: {} };
const yqe = /* @__PURE__ */ jfe(Jge);
(function(A, e) {
  (function(r, n) {
    A.exports = n(yqe);
  })(typeof self < "u" ? self : zi, (t) => (
    /******/
    (() => {
      var r = {
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss": (
          /*!**********************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss ***!
            \**********************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.color-picker-container {
  width: 320px;
  height: 300px;
  background-color: white;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 50% 50px 60px 40px 1fr auto;
  font-family: "acumin-pro-condensed";
  font-weight: normal;
  font-size: 14px;
}
.color-picker-container.with-hints {
  height: 380px;
}
.color-picker-container .color-picker-saturation {
  grid-row: 1;
  grid-column: 1;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 100%;
  position: relative;
  cursor: pointer;
}
.color-picker-container .color-picker-saturation .color-picker-saturation-white {
  grid-row: 1;
  grid-column: 1;
  background: -webkit-linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}
.color-picker-container .color-picker-saturation .color-picker-saturation-black {
  grid-row: 1;
  grid-column: 1;
  background: -webkit-linear-gradient(to top, #000, rgba(0, 0, 0, 0));
  background: linear-gradient(to top, #000, rgba(0, 0, 0, 0));
}
.color-picker-container .color-picker-saturation .color-picker-saturation-cursor {
  pointer-events: none;
  width: 4px;
  height: 4px;
  box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0, 0, 0, 0.3), 0 0 1px 2px rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  transform: translate(-2px, -2px);
  position: absolute;
}
.color-picker-container .color-picker-hue {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  margin: 10px;
  grid-template-columns: 24% 76%;
  grid-template-rows: 100%;
}
.color-picker-container .color-picker-hue .color-picker-hue-color {
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  justify-self: center;
  width: 30px;
  height: 30px;
  border-radius: 15px;
  border: 1px solid black;
}
.color-picker-container .color-picker-hue .color-picker-hue-slider {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  height: 16px;
  position: relative;
  cursor: pointer;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
  background: -webkit-linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.color-picker-container .color-picker-hue .color-picker-hue-slider .color-picker-hue-cursor {
  pointer-events: none;
  width: 8px;
  height: 18px;
  transform: translate(-4px, -2px);
  background-color: rgb(248, 248, 248);
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
  position: absolute;
}
.color-picker-container .color-picker-component {
  display: grid;
  margin: 5px;
  grid-template-columns: 100%;
  grid-template-rows: 50% 50%;
}
.color-picker-container .color-picker-component .color-picker-component-value {
  justify-self: center;
  align-self: center;
  grid-row: 1;
  grid-column: 1;
  margin-bottom: 4px;
}
.color-picker-container .color-picker-component .color-picker-component-value input {
  width: 50px;
}
.color-picker-container .color-picker-component .color-picker-component-label {
  justify-self: center;
  align-self: center;
  grid-row: 2;
  grid-column: 1;
  color: black;
}
.color-picker-container .color-picker-rgb {
  grid-row: 3;
  grid-column: 1;
  display: grid;
  margin: 10px;
  grid-template-columns: 20% 6.66% 20% 6.66% 20% 6.66% 20%;
  grid-template-rows: 100%;
}
.color-picker-container .red {
  grid-row: 1;
  grid-column: 1;
}
.color-picker-container .green {
  grid-row: 1;
  grid-column: 3;
}
.color-picker-container .blue {
  grid-row: 1;
  grid-column: 5;
}
.color-picker-container .alpha {
  grid-row: 1;
  grid-column: 7;
}
.color-picker-container .alpha.grayed {
  opacity: 0.5;
}
.color-picker-container .color-picker-hex {
  grid-row: 4;
  grid-column: 1;
  display: grid;
  grid-template-columns: 20% 80%;
  grid-template-rows: 100%;
}
.color-picker-container .color-picker-hex .color-picker-hex-label {
  justify-self: center;
  align-self: center;
  grid-row: 1;
  grid-column: 1;
  margin-left: 10px;
  color: black;
}
.color-picker-container .color-picker-hex .color-picker-hex-value {
  justify-self: left;
  align-self: center;
  grid-row: 1;
  grid-column: 2;
  margin-left: 10px;
  margin-right: 10px;
}
.color-picker-container .color-picker-hex .color-picker-hex-value input {
  width: 70px;
}
.color-picker-container .color-picker-warning {
  color: black;
  font-size: 11px;
  padding: 4px;
  justify-self: left;
  align-self: center;
  grid-row: 6;
  grid-column: 1;
}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss"], names: [], mappings: "AAAA;EACI,YAAA;EACA,aAAA;EACA,uBAAA;EACA,aAAA;EACA,2BAAA;EACA,+CAAA;EACA,mCAAA;EACA,mBAAA;EACA,eAAA;AACJ;AACI;EACI,aAAA;AACR;AAEI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,2BAAA;EACA,wBAAA;EACA,kBAAA;EACA,eAAA;AAAR;AAEQ;EACI,WAAA;EACA,cAAA;EAEA,2EAAA;EACA,mEAAA;AADZ;AAIQ;EACI,WAAA;EACA,cAAA;EAEA,mEAAA;EACA,2DAAA;AAHZ;AAMQ;EACI,oBAAA;EACA,UAAA;EACA,WAAA;EACA,kGACI;EAGJ,kBAAA;EACA,gCAAA;EACA,kBAAA;AAPZ;AAWI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,YAAA;EACA,8BAAA;EACA,wBAAA;AATR;AAWQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,oBAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,uBAAA;AATZ;AAYQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;EAEA,2GAAA;EACA,mHAAA;AAXZ;AAaY;EACI,oBAAA;EACA,UAAA;EACA,YAAA;EACA,gCAAA;EACA,oCAAA;EACA,2CAAA;EACA,kBAAA;AAXhB;AAgBI;EACI,aAAA;EACA,WAAA;EACA,2BAAA;EACA,2BAAA;AAdR;AAgBQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;AAdZ;AAgBY;EACI,WAAA;AAdhB;AAkBQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,YAAA;AAhBZ;AAoBI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,YAAA;EACA,wDAAA;EACA,wBAAA;AAlBR;AAqBI;EACI,WAAA;EACA,cAAA;AAnBR;AAsBI;EACI,WAAA;EACA,cAAA;AApBR;AAuBI;EACI,WAAA;EACA,cAAA;AArBR;AAwBI;EACI,WAAA;EACA,cAAA;AAtBR;AAwBQ;EACI,YAAA;AAtBZ;AA0BI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,8BAAA;EACA,wBAAA;AAxBR;AA0BQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,YAAA;AAxBZ;AA2BQ;EACI,kBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AAzBZ;AA2BY;EACI,WAAA;AAzBhB;AA8BI;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,kBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;AA5BR", sourcesContent: [`.color-picker-container {\r
    width: 320px;\r
    height: 300px;\r
    background-color: white;\r
    display: grid;\r
    grid-template-columns: 100%;\r
    grid-template-rows: 50% 50px 60px 40px 1fr auto;\r
    font-family: "acumin-pro-condensed";\r
    font-weight: normal;\r
    font-size: 14px;\r
\r
    &.with-hints {\r
        height: 380px;\r
    }\r
\r
    .color-picker-saturation {\r
        grid-row: 1;\r
        grid-column: 1;\r
        display: grid;\r
        grid-template-columns: 100%;\r
        grid-template-rows: 100%;\r
        position: relative;\r
        cursor: pointer;\r
\r
        .color-picker-saturation-white {\r
            grid-row: 1;\r
            grid-column: 1;\r
\r
            background: -webkit-linear-gradient(to right, #fff, rgba(255, 255, 255, 0));\r
            background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));\r
        }\r
\r
        .color-picker-saturation-black {\r
            grid-row: 1;\r
            grid-column: 1;\r
\r
            background: -webkit-linear-gradient(to top, #000, rgba(0, 0, 0, 0));\r
            background: linear-gradient(to top, #000, rgba(0, 0, 0, 0));\r
        }\r
\r
        .color-picker-saturation-cursor {\r
            pointer-events: none;\r
            width: 4px;\r
            height: 4px;\r
            box-shadow:\r
                0 0 0 1.5px #fff,\r
                inset 0 0 1px 1px rgba(0, 0, 0, 0.3),\r
                0 0 1px 2px rgba(0, 0, 0, 0.4);\r
            border-radius: 50%;\r
            transform: translate(-2px, -2px);\r
            position: absolute;\r
        }\r
    }\r
\r
    .color-picker-hue {\r
        grid-row: 2;\r
        grid-column: 1;\r
        display: grid;\r
        margin: 10px;\r
        grid-template-columns: 24% 76%;\r
        grid-template-rows: 100%;\r
\r
        .color-picker-hue-color {\r
            grid-row: 1;\r
            grid-column: 1;\r
            align-self: center;\r
            justify-self: center;\r
            width: 30px;\r
            height: 30px;\r
            border-radius: 15px;\r
            border: 1px solid black;\r
        }\r
\r
        .color-picker-hue-slider {\r
            grid-row: 1;\r
            grid-column: 2;\r
            align-self: center;\r
            height: 16px;\r
            position: relative;\r
            cursor: pointer;\r
\r
            background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\r
            background: -webkit-linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\r
\r
            .color-picker-hue-cursor {\r
                pointer-events: none;\r
                width: 8px;\r
                height: 18px;\r
                transform: translate(-4px, -2px);\r
                background-color: rgb(248, 248, 248);\r
                box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);\r
                position: absolute;\r
            }\r
        }\r
    }\r
\r
    .color-picker-component {\r
        display: grid;\r
        margin: 5px;\r
        grid-template-columns: 100%;\r
        grid-template-rows: 50% 50%;\r
\r
        .color-picker-component-value {\r
            justify-self: center;\r
            align-self: center;\r
            grid-row: 1;\r
            grid-column: 1;\r
            margin-bottom: 4px;\r
\r
            input {\r
                width: 50px;\r
            }\r
        }\r
\r
        .color-picker-component-label {\r
            justify-self: center;\r
            align-self: center;\r
            grid-row: 2;\r
            grid-column: 1;\r
            color: black;\r
        }\r
    }\r
\r
    .color-picker-rgb {\r
        grid-row: 3;\r
        grid-column: 1;\r
        display: grid;\r
        margin: 10px;\r
        grid-template-columns: 20% 6.66% 20% 6.66% 20% 6.66% 20%;\r
        grid-template-rows: 100%;\r
    }\r
\r
    .red {\r
        grid-row: 1;\r
        grid-column: 1;\r
    }\r
\r
    .green {\r
        grid-row: 1;\r
        grid-column: 3;\r
    }\r
\r
    .blue {\r
        grid-row: 1;\r
        grid-column: 5;\r
    }\r
\r
    .alpha {\r
        grid-row: 1;\r
        grid-column: 7;\r
\r
        &.grayed {\r
            opacity: 0.5;\r
        }\r
    }\r
\r
    .color-picker-hex {\r
        grid-row: 4;\r
        grid-column: 1;\r
        display: grid;\r
        grid-template-columns: 20% 80%;\r
        grid-template-rows: 100%;\r
\r
        .color-picker-hex-label {\r
            justify-self: center;\r
            align-self: center;\r
            grid-row: 1;\r
            grid-column: 1;\r
            margin-left: 10px;\r
            color: black;\r
        }\r
\r
        .color-picker-hex-value {\r
            justify-self: left;\r
            align-self: center;\r
            grid-row: 1;\r
            grid-column: 2;\r
            margin-left: 10px;\r
            margin-right: 10px;\r
\r
            input {\r
                width: 70px;\r
            }\r
        }\r
    }\r
\r
    .color-picker-warning {\r
        color: black;\r
        font-size: 11px;\r
        padding: 4px;\r
        justify-self: left;\r
        align-self: center;\r
        grid-row: 6;\r
        grid-column: 1;\r
    }\r
}\r
`], sourceRoot: "" }]), P.locals = {};
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/searchBox.scss": (
          /*!************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/searchBox.scss ***!
            \************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `#graph-search-container {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}
#graph-search-container #graph-search-picking-blocker {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  cursor: default;
}
#graph-search-container #graph-search-box {
  width: 300px;
  height: 400px;
  position: absolute;
  left: calc(50% - 150px);
  top: calc(50% - 200px);
  background: rgb(72, 72, 72);
  border: 2px solid black;
  z-index: 100;
  cursor: auto;
  display: grid;
  grid-template-rows: auto auto 1fr;
}
#graph-search-container #graph-search-box .graph-search-box-title {
  border-bottom: 1px solid rgb(40, 40, 40);
  margin: 4px;
  padding-bottom: 4px;
  color: white;
  grid-row: 1;
}
#graph-search-container #graph-search-box .graph-search-box-filter {
  margin: 4px;
  padding-bottom: 4px;
  border-radius: 4px;
  width: calc(100% - 16px);
  grid-row: 2;
}
#graph-search-container #graph-search-box .graph-search-box-list {
  grid-row: 3;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
#graph-search-container #graph-search-box .graph-search-box-list .graph-search-box-list-item {
  margin-left: 4px;
  cursor: pointer;
  color: white;
  margin-top: 4px;
  margin-bottom: 4px;
}
#graph-search-container #graph-search-box .graph-search-box-list .graph-search-box-list-item:hover {
  background: rgb(30, 30, 30);
}
#graph-search-container #graph-search-box .graph-search-box-list .graph-search-box-list-item.selected {
  background: rgb(230, 230, 230);
  color: black;
}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/nodeGraphSystem/searchBox.scss"], names: [], mappings: "AAAA;EACI,kBAAA;EACA,WAAA;EACA,YAAA;EACA,OAAA;EACA,MAAA;AACJ;AACI;EACI,kBAAA;EACA,WAAA;EACA,YAAA;EACA,OAAA;EACA,MAAA;EACA,eAAA;AACR;AAEI;EACI,YAAA;EACA,aAAA;EACA,kBAAA;EACA,uBAAA;EACA,sBAAA;EACA,2BAAA;EACA,uBAAA;EACA,YAAA;EACA,YAAA;EACA,aAAA;EACA,iCAAA;AAAR;AAEQ;EACI,wCAAA;EACA,WAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;AAAZ;AAGQ;EACI,WAAA;EACA,mBAAA;EACA,kBAAA;EACA,wBAAA;EACA,WAAA;AADZ;AAIQ;EACI,WAAA;EACA,gBAAA;EACA,aAAA;EACA,sBAAA;AAFZ;AAIY;EACI,gBAAA;EACA,eAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;AAFhB;AAIgB;EACI,2BAAA;AAFpB;AAKgB;EACI,8BAAA;EACA,YAAA;AAHpB", sourcesContent: [`#graph-search-container {\r
    position: absolute;\r
    width: 100%;\r
    height: 100%;\r
    left: 0;\r
    top: 0;\r
\r
    #graph-search-picking-blocker {\r
        position: absolute;\r
        width: 100%;\r
        height: 100%;\r
        left: 0;\r
        top: 0;\r
        cursor: default;\r
    }\r
\r
    #graph-search-box {\r
        width: 300px;\r
        height: 400px;\r
        position: absolute;\r
        left: calc(50% - 150px);\r
        top: calc(50% - 200px);\r
        background: rgb(72, 72, 72);\r
        border: 2px solid black;\r
        z-index: 100;\r
        cursor: auto;\r
        display: grid;\r
        grid-template-rows: auto auto 1fr;\r
\r
        .graph-search-box-title {\r
            border-bottom: 1px solid rgb(40, 40, 40);\r
            margin: 4px;\r
            padding-bottom: 4px;\r
            color: white;\r
            grid-row: 1;\r
        }\r
\r
        .graph-search-box-filter {\r
            margin: 4px;\r
            padding-bottom: 4px;\r
            border-radius: 4px;\r
            width: calc(100% - 16px);\r
            grid-row: 2;\r
        }\r
\r
        .graph-search-box-list {\r
            grid-row: 3;\r
            overflow-y: auto;\r
            display: flex;\r
            flex-direction: column;\r
\r
            .graph-search-box-list-item {\r
                margin-left: 4px;\r
                cursor: pointer;\r
                color: white;\r
                margin-top: 4px;\r
                margin-bottom: 4px;\r
\r
                &:hover {\r
                    background: rgb(30, 30, 30);\r
                }\r
\r
                &.selected {\r
                    background: rgb(230, 230, 230);\r
                    color: black;\r
                }\r
            }\r
        }\r
    }\r
}\r
`], sourceRoot: "" }]), P.locals = {};
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/components/log/log.scss": (
          /*!***********************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/components/log/log.scss ***!
            \***********************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `#nme-log-console {
  background: #333333;
  height: 120px;
  box-sizing: border-box;
  margin: 0;
  padding: 10px;
  width: 100%;
  overflow: hidden;
  overflow-y: auto;
  grid-row: 2;
  grid-column: 3;
}
#nme-log-console .log {
  color: white;
  font-size: 14px;
  font-family: "Courier New", Courier, monospace;
}
#nme-log-console .log.error {
  color: red;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/components/log/log.scss"], names: [], mappings: "AAAA;EACI,mBAAA;EACA,aAAA;EACA,sBAAA;EACA,SAAA;EACA,aAAA;EACA,WAAA;EACA,gBAAA;EACA,gBAAA;EACA,WAAA;EACA,cAAA;AACJ;AACI;EACI,YAAA;EACA,eAAA;EACA,8CAAA;AACR;AACQ;EACI,UAAA;AACZ", sourcesContent: [`#nme-log-console {\r
    background: #333333;\r
    height: 120px;\r
    box-sizing: border-box;\r
    margin: 0;\r
    padding: 10px;\r
    width: 100%;\r
    overflow: hidden;\r
    overflow-y: auto;\r
    grid-row: 2;\r
    grid-column: 3;\r
\r
    .log {\r
        color: white;\r
        font-size: 14px;\r
        font-family: "Courier New", Courier, monospace;\r
\r
        &.error {\r
            color: red;\r
        }\r
    }\r
}\r
`], sourceRoot: "" }]), P.locals = {};
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/components/nodeList/nodeList.scss": (
          /*!*********************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/components/nodeList/nodeList.scss ***!
            \*********************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `#nmeNodeList {
  background: #333333;
  height: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  width: 100%;
  overflow: hidden;
}
#nmeNodeList .panes {
  overflow: hidden;
}
#nmeNodeList .panes .pane {
  color: white;
  overflow: hidden;
  height: 100%;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
#nmeNodeList .panes .pane .filter {
  display: flex;
  align-items: stretch;
}
#nmeNodeList .panes .pane .filter input {
  width: 100%;
  margin: 10px 10px 5px 10px;
  display: block;
  border: none;
  padding: 0;
  border-bottom: solid 1px rgb(51, 122, 183);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, rgb(51, 122, 183) 4%);
  background-position: -1000px 0;
  background-size: 1000px 100%;
  background-repeat: no-repeat;
  color: white;
}
#nmeNodeList .panes .pane .filter input:focus {
  box-shadow: none;
  outline: none;
  background-position: 0 0;
}
#nmeNodeList .panes .pane .filter input::placeholder {
  color: gray;
}
#nmeNodeList .panes .pane .list-container {
  overflow-x: hidden;
  overflow-y: auto;
  height: calc(100% - 32px);
}
#nmeNodeList .panes .pane .list-container .underline {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.5);
}
#nmeNodeList .panes .pane .list-container .draggableLine {
  height: 30px;
  display: grid;
  align-items: center;
  justify-items: stretch;
  background: #222222;
  cursor: grab;
  text-align: center;
  margin: 0;
  box-sizing: border-box;
}
#nmeNodeList .panes .pane .list-container .draggableLine:hover {
  background: rgb(51, 122, 183);
  color: white;
}
#nmeNodeList .panes .pane .list-container .nonDraggableLine {
  height: 30px;
  display: grid;
  align-items: center;
  justify-items: stretch;
  background: #222222;
  text-align: center;
  margin: 0;
  box-sizing: border-box;
}
#nmeNodeList .panes .pane .list-container .withButton {
  height: 30px;
  position: relative;
}
#nmeNodeList .panes .pane .list-container .withButton .icon {
  position: absolute;
  right: 4px;
  top: 5px;
}
#nmeNodeList .panes .pane .list-container .withButton .icon:hover {
  cursor: pointer;
}
#nmeNodeList .panes .pane .list-container .withButton .icon .img {
  height: 17px;
  width: 17px;
}
#nmeNodeList .panes .pane .list-container .withButton .buttonLine {
  height: 30px;
  display: grid;
  align-items: center;
  justify-items: stretch;
  padding-bottom: 5px;
  position: absolute;
  right: 0px;
  top: 2px;
}
#nmeNodeList .panes .pane .list-container .withButton .buttonLine input[type=file] {
  display: none;
}
#nmeNodeList .panes .pane .list-container .withButton .buttonLine .file-upload {
  background: transparent;
  border: transparent;
  padding: 15px 200px;
  opacity: 0.9;
  cursor: pointer;
  text-align: center;
}
#nmeNodeList .panes .pane .list-container .withButton .buttonLine .file-upload:hover {
  opacity: 1;
}
#nmeNodeList .panes .pane .list-container .withButton .buttonLine .file-upload:active {
  transform: scale(0.98);
  transform-origin: 0.5 0.5;
}
#nmeNodeList .panes .pane .list-container .withButton .buttonLine button {
  background: transparent;
  border: transparent;
  margin: 5px 10px 5px 10px;
  color: white;
  padding: 4px 5px;
  opacity: 0.9;
}
#nmeNodeList .panes .pane .list-container .withButton .buttonLine button:hover {
  opacity: 0;
}
#nmeNodeList .panes .pane .list-container .withButton .buttonLine button:active {
  background: transparent;
}
#nmeNodeList .panes .pane .list-container .withButton .buttonLine button:focus {
  border: transparent;
  outline: 0px;
}
#nmeNodeList .panes .pane .list-container .paneContainer {
  margin-top: 3px;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
}
#nmeNodeList .panes .pane .list-container .paneContainer .paneContainer-content {
  grid-row: 1;
  grid-column: 1;
}
#nmeNodeList .panes .pane .list-container .paneContainer .paneContainer-content .header {
  display: grid;
  grid-template-columns: 1fr auto;
  background: #555555;
  height: 30px;
  padding-right: 5px;
  cursor: pointer;
}
#nmeNodeList .panes .pane .list-container .paneContainer .paneContainer-content .header .title {
  border-left: 3px solid transparent;
  padding-left: 5px;
  grid-column: 1;
  display: flex;
  align-items: center;
}
#nmeNodeList .panes .pane .list-container .paneContainer .paneContainer-content .header .collapse {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-items: center;
  transform-origin: center;
}
#nmeNodeList .panes .pane .list-container .paneContainer .paneContainer-content .header .collapse.closed {
  transform: rotate(180deg);
}
#nmeNodeList .panes .pane .list-container .paneContainer .paneContainer-content .paneList > div:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/components/nodeList/nodeList.scss"], names: [], mappings: "AAAA;EACI,mBAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,aAAA;EACA,WAAA;EACA,gBAAA;AACJ;AACI;EACI,gBAAA;AACR;AACQ;EACI,YAAA;EAEA,gBAAA;EACA,YAAA;EAEA,yBAAA;EACA,sBAAA;EACA,qBAAA;EACA,iBAAA;AADZ;AAGY;EACI,aAAA;EACA,oBAAA;AADhB;AAGgB;EACI,WAAA;EACA,0BAAA;EACA,cAAA;EACA,YAAA;EACA,UAAA;EACA,0CAAA;EACA,wFAAA;EACA,8BAAA;EACA,4BAAA;EACA,4BAAA;EACA,YAAA;AADpB;AAIgB;EACI,gBAAA;EACA,aAAA;EACA,wBAAA;AAFpB;AAKgB;EACI,WAAA;AAHpB;AAOY;EACI,kBAAA;EACA,gBAAA;EACA,yBAAA;AALhB;AAOgB;EACI,mDAAA;AALpB;AAQgB;EACI,YAAA;EACA,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,mBAAA;EACA,YAAA;EACA,kBAAA;EACA,SAAA;EACA,sBAAA;AANpB;AAQoB;EACI,6BAAA;EACA,YAAA;AANxB;AAUgB;EACI,YAAA;EACA,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,mBAAA;EACA,kBAAA;EACA,SAAA;EACA,sBAAA;AARpB;AAWgB;EACI,YAAA;EACA,kBAAA;AATpB;AAUoB;EACI,kBAAA;EACA,UAAA;EACA,QAAA;AARxB;AASwB;EACI,eAAA;AAP5B;AAUwB;EACI,YAAA;EACA,WAAA;AAR5B;AAYoB;EACI,YAAA;EACA,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,mBAAA;EACA,kBAAA;EACA,UAAA;EACA,QAAA;AAVxB;AAWwB;EACI,aAAA;AAT5B;AAYwB;EACI,uBAAA;EACA,mBAAA;EACA,mBAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;AAV5B;AAawB;EACI,UAAA;AAX5B;AAcwB;EACI,sBAAA;EACA,yBAAA;AAZ5B;AAewB;EACI,uBAAA;EACA,mBAAA;EACA,yBAAA;EACA,YAAA;EACA,gBAAA;EACA,YAAA;AAb5B;AAgBwB;EACI,UAAA;AAd5B;AAiBwB;EACI,uBAAA;AAf5B;AAkBwB;EACI,mBAAA;EACA,YAAA;AAhB5B;AAqBgB;EACI,eAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;AAnBpB;AAqBoB;EACI,WAAA;EACA,cAAA;AAnBxB;AAqBwB;EACI,aAAA;EACA,+BAAA;EACA,mBAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;AAnB5B;AAqB4B;EACI,kCAAA;EACA,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;AAnBhC;AAsB4B;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,wBAAA;AApBhC;AAsBgC;EACI,yBAAA;AApBpC;AAyBwB;EACI,iDAAA;AAvB5B", sourcesContent: [`#nmeNodeList {\r
    background: #333333;\r
    height: 100%;\r
    margin: 0;\r
    padding: 0;\r
    display: grid;\r
    width: 100%;\r
    overflow: hidden;\r
\r
    .panes {\r
        overflow: hidden;\r
\r
        .pane {\r
            color: white;\r
\r
            overflow: hidden;\r
            height: 100%;\r
\r
            -webkit-user-select: none;\r
            -moz-user-select: none;\r
            -ms-user-select: none;\r
            user-select: none;\r
\r
            .filter {\r
                display: flex;\r
                align-items: stretch;\r
\r
                input {\r
                    width: 100%;\r
                    margin: 10px 10px 5px 10px;\r
                    display: block;\r
                    border: none;\r
                    padding: 0;\r
                    border-bottom: solid 1px rgb(51, 122, 183);\r
                    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, rgb(51, 122, 183) 4%);\r
                    background-position: -1000px 0;\r
                    background-size: 1000px 100%;\r
                    background-repeat: no-repeat;\r
                    color: white;\r
                }\r
\r
                input:focus {\r
                    box-shadow: none;\r
                    outline: none;\r
                    background-position: 0 0;\r
                }\r
\r
                input::placeholder {\r
                    color: gray;\r
                }\r
            }\r
\r
            .list-container {\r
                overflow-x: hidden;\r
                overflow-y: auto;\r
                height: calc(100% - 32px);\r
\r
                .underline {\r
                    border-bottom: 0.5px solid rgba(255, 255, 255, 0.5);\r
                }\r
\r
                .draggableLine {\r
                    height: 30px;\r
                    display: grid;\r
                    align-items: center;\r
                    justify-items: stretch;\r
                    background: #222222;\r
                    cursor: grab;\r
                    text-align: center;\r
                    margin: 0;\r
                    box-sizing: border-box;\r
\r
                    &:hover {\r
                        background: rgb(51, 122, 183);\r
                        color: white;\r
                    }\r
                }\r
\r
                .nonDraggableLine {\r
                    height: 30px;\r
                    display: grid;\r
                    align-items: center;\r
                    justify-items: stretch;\r
                    background: #222222;\r
                    text-align: center;\r
                    margin: 0;\r
                    box-sizing: border-box;\r
                }\r
\r
                .withButton {\r
                    height: 30px;\r
                    position: relative;\r
                    .icon {\r
                        position: absolute;\r
                        right: 4px;\r
                        top: 5px;\r
                        &:hover {\r
                            cursor: pointer;\r
                        }\r
\r
                        .img {\r
                            height: 17px;\r
                            width: 17px;\r
                        }\r
                    }\r
\r
                    .buttonLine {\r
                        height: 30px;\r
                        display: grid;\r
                        align-items: center;\r
                        justify-items: stretch;\r
                        padding-bottom: 5px;\r
                        position: absolute;\r
                        right: 0px;\r
                        top: 2px;\r
                        input[type="file"] {\r
                            display: none;\r
                        }\r
\r
                        .file-upload {\r
                            background: transparent;\r
                            border: transparent;\r
                            padding: 15px 200px;\r
                            opacity: 0.9;\r
                            cursor: pointer;\r
                            text-align: center;\r
                        }\r
\r
                        .file-upload:hover {\r
                            opacity: 1;\r
                        }\r
\r
                        .file-upload:active {\r
                            transform: scale(0.98);\r
                            transform-origin: 0.5 0.5;\r
                        }\r
\r
                        button {\r
                            background: transparent;\r
                            border: transparent;\r
                            margin: 5px 10px 5px 10px;\r
                            color: white;\r
                            padding: 4px 5px;\r
                            opacity: 0.9;\r
                        }\r
\r
                        button:hover {\r
                            opacity: 0;\r
                        }\r
\r
                        button:active {\r
                            background: transparent;\r
                        }\r
\r
                        button:focus {\r
                            border: transparent;\r
                            outline: 0px;\r
                        }\r
                    }\r
                }\r
\r
                .paneContainer {\r
                    margin-top: 3px;\r
                    display: grid;\r
                    grid-template-rows: 100%;\r
                    grid-template-columns: 100%;\r
\r
                    .paneContainer-content {\r
                        grid-row: 1;\r
                        grid-column: 1;\r
\r
                        .header {\r
                            display: grid;\r
                            grid-template-columns: 1fr auto;\r
                            background: #555555;\r
                            height: 30px;\r
                            padding-right: 5px;\r
                            cursor: pointer;\r
\r
                            .title {\r
                                border-left: 3px solid transparent;\r
                                padding-left: 5px;\r
                                grid-column: 1;\r
                                display: flex;\r
                                align-items: center;\r
                            }\r
\r
                            .collapse {\r
                                grid-column: 2;\r
                                display: flex;\r
                                align-items: center;\r
                                justify-items: center;\r
                                transform-origin: center;\r
\r
                                &.closed {\r
                                    transform: rotate(180deg);\r
                                }\r
                            }\r
                        }\r
\r
                        .paneList > div:not(:last-child) {\r
                            border-bottom: 1px solid rgba(255, 255, 255, 0.3);\r
                        }\r
                    }\r
                }\r
            }\r
        }\r
    }\r
}\r
`], sourceRoot: "" }]), P.locals = {};
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/components/propertyTab/propertyTab.scss": (
          /*!***************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/components/propertyTab/propertyTab.scss ***!
            \***************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.nme-right-panel #propertyTab {
  color: white;
  background: #333333;
}
.nme-right-panel #propertyTab #header {
  height: 30px;
  font-size: 16px;
  color: white;
  background: #222222;
  grid-row: 1;
  text-align: center;
  display: grid;
  grid-template-columns: 30px 1fr;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.nme-right-panel #propertyTab #header #logo {
  position: relative;
  grid-column: 1;
  width: 24px;
  height: 24px;
  left: 0;
  display: flex;
  align-self: center;
  justify-self: center;
}
.nme-right-panel #propertyTab #header #title {
  grid-column: 2;
  display: grid;
  align-items: center;
  text-align: center;
}
.nme-right-panel #propertyTab .range {
  -webkit-appearance: none;
  width: 120px;
  height: 6px;
  background: #d3d3d3;
  border-radius: 5px;
  outline: none;
  opacity: 0.7;
  -webkit-transition: 0.2s;
  transition: opacity 0.2s;
}
.nme-right-panel #propertyTab .range:hover {
  opacity: 1;
}
.nme-right-panel #propertyTab .range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgb(51, 122, 183);
  cursor: pointer;
}
.nme-right-panel #propertyTab .range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgb(51, 122, 183);
  cursor: pointer;
}
.nme-right-panel #propertyTab input[type=color] {
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0;
  width: 30px;
  height: 20px;
}
.nme-right-panel #propertyTab input[type=color]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.nme-right-panel #propertyTab input[type=color]::-webkit-color-swatch {
  border: none;
}
.nme-right-panel #propertyTab .sliderLine {
  padding-left: 5px;
  height: 30px;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 1fr 50px auto;
}
.nme-right-panel #propertyTab .sliderLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .sliderLine .slider {
  grid-column: 3;
  grid-row: 1;
  margin-right: 5px;
  width: 90%;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .sliderLine .floatLine {
  grid-column: 2;
  padding-left: 5px;
}
.nme-right-panel #propertyTab .sliderLine .floatLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .sliderLine .floatLine .short {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .sliderLine .floatLine .short input {
  width: 35px;
}
.nme-right-panel #propertyTab .sliderLine .floatLine .short input::-webkit-outer-spin-button,
.nme-right-panel #propertyTab .sliderLine .floatLine .short input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.nme-right-panel #propertyTab .sliderLine .floatLine .short input[type=number] {
  -moz-appearance: textfield;
}
.nme-right-panel #propertyTab .textInputLine {
  padding-left: 5px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr 120px auto;
}
.nme-right-panel #propertyTab .textInputLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .textInputLine .value {
  display: flex;
  align-items: center;
  grid-column: 2;
}
.nme-right-panel #propertyTab .textInputLine .value input {
  width: calc(100% - 5px);
  margin-right: 5px;
}
.nme-right-panel #propertyTab .textInputArea {
  padding-left: 5px;
  height: 50px;
  display: grid;
  grid-template-columns: 1fr 120px;
}
.nme-right-panel #propertyTab .textInputArea .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .textInputArea textarea {
  margin-right: 5px;
  margin-left: -50%;
  height: 40px;
  resize: none;
}
.nme-right-panel #propertyTab .textInputArea .value {
  display: flex;
  align-items: center;
  grid-column: 2;
}
.nme-right-panel #propertyTab .paneContainer {
  margin-top: 3px;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
}
.nme-right-panel #propertyTab .paneContainer .paneList {
  border-left: 3px solid transparent;
}
.nme-right-panel #propertyTab .paneContainer:hover .paneList {
  border-left: 3px solid rgba(51, 122, 183, 0.8);
}
.nme-right-panel #propertyTab .paneContainer:hover .paneContainer-content .header .title {
  border-left: 3px solid rgb(51, 122, 183);
}
.nme-right-panel #propertyTab .paneContainer .paneContainer-highlight-border {
  grid-row: 1;
  grid-column: 1;
  opacity: 1;
  border: 3px solid red;
  transition: opacity 250ms;
  pointer-events: none;
}
.nme-right-panel #propertyTab .paneContainer .paneContainer-highlight-border.transparent {
  opacity: 0;
}
.nme-right-panel #propertyTab .paneContainer .paneContainer-content {
  grid-row: 1;
  grid-column: 1;
}
.nme-right-panel #propertyTab .paneContainer .paneContainer-content .header {
  display: grid;
  grid-template-columns: 1fr auto;
  background: #555555;
  height: 30px;
  padding-right: 5px;
  cursor: pointer;
}
.nme-right-panel #propertyTab .paneContainer .paneContainer-content .header .title {
  border-left: 3px solid transparent;
  padding-left: 5px;
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .paneContainer .paneContainer-content .header .collapse {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-items: center;
  transform-origin: center;
}
.nme-right-panel #propertyTab .paneContainer .paneContainer-content .header .collapse.closed {
  transform: rotate(180deg);
}
.nme-right-panel #propertyTab .paneContainer .paneContainer-content .paneList > div:not(:last-child) {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}
.nme-right-panel #propertyTab .paneContainer .paneContainer-content .fragment > div:not(:last-child) {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}
.nme-right-panel #propertyTab .color-picker {
  height: calc(100% - 8px);
  margin: 4px;
  width: calc(100% - 8px);
}
.nme-right-panel #propertyTab .color-picker .color-rect {
  height: calc(100% - 4px);
  border: 2px white solid;
  cursor: pointer;
  min-height: 18px;
}
.nme-right-panel #propertyTab .color-picker .color-picker-cover {
  position: fixed;
  top: 0px;
  right: 0px;
  bottom: 0px;
  left: 0px;
  z-index: 1;
}
.nme-right-panel #propertyTab .color-picker .color-picker-float {
  z-index: 2;
  position: absolute;
}
.nme-right-panel #propertyTab .gradient-step {
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 20px 30px 40px auto 20px 30px;
  padding-top: 5px;
  padding-left: 5px;
  padding-bottom: 5px;
}
.nme-right-panel #propertyTab .gradient-step .step {
  grid-row: 1;
  grid-column: 1;
}
.nme-right-panel #propertyTab .gradient-step .color {
  grid-row: 1;
  grid-column: 2;
  cursor: pointer;
}
.nme-right-panel #propertyTab .gradient-step .step-value {
  margin-left: 5px;
  grid-row: 1;
  grid-column: 3;
  text-align: right;
  margin-right: 5px;
}
.nme-right-panel #propertyTab .gradient-step .step-slider {
  grid-row: 1;
  grid-column: 4;
  display: grid;
  justify-content: stretch;
  align-content: center;
  margin-right: -5px;
  padding-left: 12px;
}
.nme-right-panel #propertyTab .gradient-step .step-slider input {
  width: 90%;
}
.nme-right-panel #propertyTab .gradient-step .gradient-copy {
  grid-row: 1;
  grid-column: 5;
  display: grid;
  align-content: center;
  justify-content: center;
}
.nme-right-panel #propertyTab .gradient-step .gradient-copy .img {
  height: 20px;
  width: 20px;
}
.nme-right-panel #propertyTab .gradient-step .gradient-copy .img:hover {
  cursor: pointer;
}
.nme-right-panel #propertyTab .gradient-step .gradient-delete {
  grid-row: 1;
  grid-column: 6;
  display: grid;
  align-content: center;
  justify-content: center;
}
.nme-right-panel #propertyTab .gradient-step .gradient-delete .img {
  height: 20px;
  width: 20px;
}
.nme-right-panel #propertyTab .gradient-step .gradient-delete .img:hover {
  cursor: pointer;
}
.nme-right-panel #propertyTab .floatLine {
  padding-left: 5px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr 120px;
}
.nme-right-panel #propertyTab .floatLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .floatLine .value {
  grid-column: 2;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .floatLine .value input {
  width: 110px;
}
.nme-right-panel #propertyTab .floatLine .short {
  grid-column: 2;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .floatLine .short input {
  width: 27px;
}
.nme-right-panel #propertyTab .floatLine .short input::-webkit-outer-spin-button,
.nme-right-panel #propertyTab .floatLine .short input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.nme-right-panel #propertyTab .floatLine .short input[type=number] {
  -moz-appearance: textfield;
}
.nme-right-panel #propertyTab .vector3Line {
  padding-left: 5px;
  display: grid;
}
.nme-right-panel #propertyTab .vector3Line .firstLine {
  display: grid;
  grid-template-columns: 1fr auto 20px;
  height: 30px;
}
.nme-right-panel #propertyTab .vector3Line .firstLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .vector3Line .firstLine .vector {
  grid-column: 2;
  display: flex;
  align-items: center;
  text-align: right;
  opacity: 0.8;
}
.nme-right-panel #propertyTab .vector3Line .firstLine .expand {
  grid-column: 3;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
.nme-right-panel #propertyTab .vector3Line .secondLine {
  display: grid;
  padding-right: 5px;
  border-left: 1px solid rgb(51, 122, 183);
}
.nme-right-panel #propertyTab .vector3Line .secondLine .no-right-margin {
  margin-right: 0;
}
.nme-right-panel #propertyTab .vector3Line .secondLine .numeric {
  display: grid;
  grid-template-columns: 1fr auto;
}
.nme-right-panel #propertyTab .vector3Line .secondLine .numeric-label {
  text-align: right;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-self: right;
  margin-right: 10px;
}
.nme-right-panel #propertyTab .vector3Line .secondLine .numeric-value {
  width: 120px;
  grid-column: 2;
  display: flex;
  align-items: center;
  border: 1px solid rgb(51, 122, 183);
}
.nme-right-panel #propertyTab .buttonLine {
  height: 30px;
  display: grid;
  align-items: center;
  justify-items: stretch;
  padding-bottom: 5px;
}
.nme-right-panel #propertyTab .buttonLine.disabled {
  opacity: 0.3;
}
.nme-right-panel #propertyTab .buttonLine input[type=file] {
  display: none;
}
.nme-right-panel #propertyTab .buttonLine .file-upload {
  background: #222222;
  border: 1px solid rgb(51, 122, 183);
  margin: 5px 10px;
  color: white;
  padding: 4px 5px;
  padding-top: 0px;
  opacity: 0.9;
  cursor: pointer;
  text-align: center;
}
.nme-right-panel #propertyTab .buttonLine .file-upload:hover {
  opacity: 1;
}
.nme-right-panel #propertyTab .buttonLine .file-upload:active {
  transform: scale(0.98);
  transform-origin: 0.5 0.5;
}
.nme-right-panel #propertyTab .buttonLine button {
  background: #222222;
  border: 1px solid rgb(51, 122, 183);
  margin: 5px 10px 5px 10px;
  color: white;
  padding: 4px 5px;
  opacity: 0.9;
}
.nme-right-panel #propertyTab .buttonLine button:hover {
  opacity: 1;
}
.nme-right-panel #propertyTab .buttonLine button:active {
  background: #282828;
}
.nme-right-panel #propertyTab .buttonLine button:focus {
  border: 1px solid rgb(51, 122, 183);
  outline: 0px;
}
.nme-right-panel #propertyTab .checkBoxLine {
  padding-left: 5px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
}
.nme-right-panel #propertyTab .checkBoxLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .checkBoxLine .checkBox {
  grid-column: 2;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .checkBoxLine .checkBox .lbl {
  position: relative;
  display: block;
  height: 14px;
  width: 34px;
  margin-right: 5px;
  background: #898989;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.nme-right-panel #propertyTab .checkBoxLine .checkBox .lbl:after {
  position: absolute;
  left: 3px;
  top: 2px;
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 100px;
  background: #fff;
  box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.05);
  content: "";
  transition: all 0.15s ease;
}
.nme-right-panel #propertyTab .checkBoxLine .checkBox .lbl:active:after {
  transform: scale(1.15, 0.85);
}
.nme-right-panel #propertyTab .checkBoxLine .checkBox .cbx:checked ~ label {
  background: rgb(51, 122, 183);
}
.nme-right-panel #propertyTab .checkBoxLine .checkBox .cbx:checked ~ label:after {
  left: 20px;
  background: rgb(22, 73, 117);
}
.nme-right-panel #propertyTab .checkBoxLine .checkBox .cbx:checked ~ label.disabled {
  background: rgb(22, 73, 117);
  cursor: pointer;
}
.nme-right-panel #propertyTab .checkBoxLine .checkBox .cbx:checked ~ label.disabled:after {
  left: 20px;
  background: rgb(85, 85, 85);
  cursor: pointer;
}
.nme-right-panel #propertyTab .checkBoxLine .checkBox .cbx ~ label.disabled {
  background: rgb(85, 85, 85);
  cursor: pointer;
}
.nme-right-panel #propertyTab .checkBoxLine .checkBox .hidden {
  display: none;
}
.nme-right-panel #propertyTab .listLine {
  padding-left: 5px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
}
.nme-right-panel #propertyTab .listLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .listLine .options {
  grid-column: 2;
  display: flex;
  align-items: center;
  margin-right: 5px;
}
.nme-right-panel #propertyTab .listLine .options select {
  width: 115px;
}
.nme-right-panel #propertyTab .color3Line {
  padding-left: 5px;
  display: grid;
}
.nme-right-panel #propertyTab .color3Line .firstLine {
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto 0px 20px 20px;
}
.nme-right-panel #propertyTab .color3Line .firstLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .color3Line .firstLine .textInputLine {
  display: none;
}
.nme-right-panel #propertyTab .color3Line .firstLine .color3 {
  grid-column: 2;
  width: 50px;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .color3Line .firstLine .color3 input {
  margin-right: 5px;
}
.nme-right-panel #propertyTab .color3Line .firstLine .copy {
  grid-column: 4;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
.nme-right-panel #propertyTab .color3Line .firstLine .copy img {
  height: 100%;
  width: 24px;
}
.nme-right-panel #propertyTab .color3Line .firstLine .expand {
  grid-column: 5;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
.nme-right-panel #propertyTab .color3Line .firstLine .expand img {
  height: 100%;
  width: 20px;
}
.nme-right-panel #propertyTab .color3Line .secondLine {
  display: grid;
  padding-right: 5px;
  border-left: 1px solid rgb(51, 122, 183);
}
.nme-right-panel #propertyTab .color3Line .secondLine .numeric {
  display: grid;
  grid-template-columns: 1fr auto;
}
.nme-right-panel #propertyTab .color3Line .secondLine .numeric-label {
  text-align: right;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-self: right;
  margin-right: 10px;
}
.nme-right-panel #propertyTab .color3Line .secondLine .numeric-value {
  width: 120px;
  grid-column: 2;
  display: flex;
  align-items: center;
  border: 1px solid rgb(51, 122, 183);
}
.nme-right-panel #propertyTab .textLine {
  padding-left: 5px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
}
.nme-right-panel #propertyTab .textLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
.nme-right-panel #propertyTab .textLine .link-value {
  grid-column: 2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: end;
  opacity: 0.8;
  margin: 5px;
  margin-top: 6px;
  max-width: 140px;
  text-decoration: underline;
  cursor: pointer;
}
.nme-right-panel #propertyTab .textLine .value {
  grid-column: 2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: end;
  opacity: 0.8;
  margin: 5px;
  margin-top: 6px;
  max-width: 200px;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}
.nme-right-panel #propertyTab .textLine .value.check {
  color: green;
}
.nme-right-panel #propertyTab .textLine .value.uncheck {
  color: red;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/components/propertyTab/propertyTab.scss"], names: [], mappings: "AACI;EAEI,YAAA;EACA,mBAAA;AADR;AAGQ;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,mBAAA;EACA,WAAA;EACA,kBAAA;EACA,aAAA;EACA,+BAAA;EACA,yBAAA;EACA,sBAAA;EACA,qBAAA;EACA,iBAAA;AADZ;AAGY;EACI,kBAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,OAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;AADhB;AAIY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;AAFhB;AAMQ;EACI,wBAAA;EACA,YAAA;EACA,WAAA;EACA,mBAAA;EACA,kBAAA;EACA,aAAA;EACA,YAAA;EACA,wBAAA;EACA,wBAAA;AAJZ;AAOQ;EACI,UAAA;AALZ;AAQQ;EACI,wBAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,6BAAA;EACA,eAAA;AANZ;AASQ;EACI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,6BAAA;EACA,eAAA;AAPZ;AAUQ;EACI,wBAAA;EACA,0CAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;AARZ;AAUQ;EACI,UAAA;AARZ;AAUQ;EACI,YAAA;AARZ;AAWQ;EACI,iBAtFgB;EAuFhB,YAAA;EACA,aAAA;EACA,wBAAA;EACA,oCAAA;AATZ;AAWY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAThB;AAYY;EACI,cAAA;EACA,WAAA;EACA,iBAAA;EACA,UAAA;EACA,aAAA;EACA,mBAAA;AAVhB;AAaY;EACI,cAAA;EACA,iBA7GY;AAkG5B;AAagB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAXpB;AAcgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAZpB;AAcoB;EACI,WAAA;AAZxB;AAeoB;;EAEI,wBAAA;EACA,SAAA;AAbxB;AAgBoB;EACI,0BAAA;AAdxB;AAoBQ;EACI,iBA5IgB;EA6IhB,YAAA;EACA,aAAA;EACA,qCAAA;AAlBZ;AAoBY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAlBhB;AAqBY;EACI,aAAA;EACA,mBAAA;EACA,cAAA;AAnBhB;AAqBgB;EACI,uBAAA;EACA,iBAAA;AAnBpB;AAwBQ;EACI,iBApKgB;EAqKhB,YAAA;EACA,aAAA;EACA,gCAAA;AAtBZ;AAwBY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAtBhB;AAyBY;EACI,iBAAA;EACA,iBAAA;EACA,YAAA;EACA,YAAA;AAvBhB;AA0BY;EACI,aAAA;EACA,mBAAA;EACA,cAAA;AAxBhB;AA4BQ;EACI,eAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;AA1BZ;AA4BY;EACI,kCAAA;AA1BhB;AA8BgB;EACI,8CAAA;AA5BpB;AAiCwB;EACI,wCAAA;AA/B5B;AAqCY;EACI,WAAA;EACA,cAAA;EACA,UAAA;EACA,qBAAA;EACA,yBAAA;EACA,oBAAA;AAnChB;AAqCgB;EACI,UAAA;AAnCpB;AAuCY;EACI,WAAA;EACA,cAAA;AArChB;AAuCgB;EACI,aAAA;EACA,+BAAA;EACA,mBAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;AArCpB;AAuCoB;EACI,kCAAA;EACA,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;AArCxB;AAwCoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,wBAAA;AAtCxB;AAwCwB;EACI,yBAAA;AAtC5B;AA2CgB;EACI,mDAAA;AAzCpB;AA4CgB;EACI,mDAAA;AA1CpB;AA+CQ;EACI,wBAAA;EACA,WAAA;EACA,uBAAA;AA7CZ;AA+CY;EACI,wBAAA;EACA,uBAAA;EACA,eAAA;EACA,gBAAA;AA7ChB;AAgDY;EACI,eAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,UAAA;AA9ChB;AAiDY;EACI,UAAA;EACA,kBAAA;AA/ChB;AAmDQ;EACI,aAAA;EACA,wBAAA;EACA,oDAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;AAjDZ;AAmDY;EACI,WAAA;EACA,cAAA;AAjDhB;AAoDY;EACI,WAAA;EACA,cAAA;EACA,eAAA;AAlDhB;AAqDY;EACI,gBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,iBAAA;AAnDhB;AAsDY;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,qBAAA;EACA,kBAAA;EACA,kBAAA;AApDhB;AAsDgB;EACI,UAAA;AApDpB;AAwDY;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AAtDhB;AAwDgB;EACI,YAAA;EACA,WAAA;AAtDpB;AAwDgB;EACI,eAAA;AAtDpB;AAyDY;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AAvDhB;AAwDgB;EACI,YAAA;EACA,WAAA;AAtDpB;AAwDgB;EACI,eAAA;AAtDpB;AA2DQ;EACI,iBAjXgB;EAkXhB,YAAA;EACA,aAAA;EACA,gCAAA;AAzDZ;AA2DY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAzDhB;AA4DY;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;AA3DhB;AA6DgB;EACI,YAAA;AA3DpB;AA+DY;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;AA9DhB;AAgEgB;EACI,WAAA;AA9DpB;AAiEgB;;EAEI,wBAAA;EACA,SAAA;AA/DpB;AAkEgB;EACI,0BAAA;AAhEpB;AAqEQ;EACI,iBA9ZgB;EA+ZhB,aAAA;AAnEZ;AAqEY;EACI,aAAA;EACA,oCAAA;EACA,YAAA;AAnEhB;AAqEgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAnEpB;AAsEgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,iBAAA;EACA,YAAA;AApEpB;AAuEgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AArEpB;AAyEY;EACI,aAAA;EACA,kBAAA;EACA,wCAAA;AAvEhB;AAyEgB;EACI,eAAA;AAvEpB;AA0EgB;EACI,aAAA;EACA,+BAAA;AAxEpB;AA2EgB;EACI,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;AAzEpB;AA4EgB;EACI,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mCAAA;AA1EpB;AA+EQ;EACI,YAAA;EACA,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,mBAAA;AA7EZ;AA+EY;EACI,YAAA;AA7EhB;AAgFY;EACI,aAAA;AA9EhB;AAiFY;EACI,mBAAA;EACA,mCAAA;EACA,gBAAA;EACA,YAAA;EACA,gBAAA;EACA,gBAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;AA/EhB;AAkFY;EACI,UAAA;AAhFhB;AAmFY;EACI,sBAAA;EACA,yBAAA;AAjFhB;AAoFY;EACI,mBAAA;EACA,mCAAA;EACA,yBAAA;EACA,YAAA;EACA,gBAAA;EACA,YAAA;AAlFhB;AAqFY;EACI,UAAA;AAnFhB;AAsFY;EACI,mBAAA;AApFhB;AAuFY;EACI,mCAAA;EACA,YAAA;AArFhB;AAyFQ;EACI,iBA1hBgB;EA2hBhB,YAAA;EACA,aAAA;EACA,+BAAA;AAvFZ;AAyFY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAvFhB;AA0FY;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;AAzFhB;AA2FgB;EACI,kBAAA;EACA,cAAA;EACA,YAAA;EACA,WAAA;EACA,iBAAA;EACA,mBAAA;EACA,oBAAA;EACA,eAAA;EACA,yBAAA;AAzFpB;AA4FgB;EACI,kBAAA;EACA,SAAA;EACA,QAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,oBAAA;EACA,gBAAA;EACA,2CAAA;EACA,WAAA;EACA,0BAAA;AA1FpB;AA6FgB;EACI,4BAAA;AA3FpB;AA8FgB;EACI,6BAAA;AA5FpB;AA+FgB;EACI,UAAA;EACA,4BAAA;AA7FpB;AAgGgB;EACI,4BAAA;EACA,eAAA;AA9FpB;AAiGgB;EACI,UAAA;EACA,2BAAA;EACA,eAAA;AA/FpB;AAkGgB;EACI,2BAAA;EACA,eAAA;AAhGpB;AAmGgB;EACI,aAAA;AAjGpB;AAsGQ;EACI,iBAzmBgB;EA0mBhB,YAAA;EACA,aAAA;EACA,+BAAA;AApGZ;AAsGY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AApGhB;AAuGY;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;EACA,iBAAA;AAtGhB;AAwGgB;EACI,YAAA;AAtGpB;AA2GQ;EACI,iBAloBgB;EAmoBhB,aAAA;AAzGZ;AA2GY;EACI,YAAA;EACA,aAAA;EACA,6CAAA;AAzGhB;AA2GgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAzGpB;AA4GgB;EACI,aAAA;AA1GpB;AA6GgB;EACI,cAAA;EACA,WAAA;EAEA,aAAA;EACA,mBAAA;AA5GpB;AA8GoB;EACI,iBAAA;AA5GxB;AAgHgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AA9GpB;AAgHoB;EACI,YAAA;EACA,WAAA;AA9GxB;AAkHgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAhHpB;AAkHoB;EACI,YAAA;EACA,WAAA;AAhHxB;AAqHY;EACI,aAAA;EACA,kBAAA;EACA,wCAAA;AAnHhB;AAqHgB;EACI,aAAA;EACA,+BAAA;AAnHpB;AAsHgB;EACI,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;AApHpB;AAuHgB;EACI,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mCAAA;AArHpB;AA0HQ;EACI,iBAztBgB;EA0tBhB,YAAA;EACA,aAAA;EACA,+BAAA;AAxHZ;AA0HY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAxHhB;AA2HY;EACI,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,eAAA;EACA,gBAAA;EACA,0BAAA;EACA,eAAA;AAzHhB;AA4HY;EACI,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,eAAA;EACA,gBAAA;EACA,yBAAA;EACA,sBAAA;EACA,qBAAA;EACA,iBAAA;AA1HhB;AA4HgB;EACI,YAAA;AA1HpB;AA6HgB;EACI,UAAA;AA3HpB", sourcesContent: [`.nme-right-panel {\r
    #propertyTab {\r
        $line-padding-left: 5px;\r
        color: white;\r
        background: #333333;\r
\r
        #header {\r
            height: 30px;\r
            font-size: 16px;\r
            color: white;\r
            background: #222222;\r
            grid-row: 1;\r
            text-align: center;\r
            display: grid;\r
            grid-template-columns: 30px 1fr;\r
            -webkit-user-select: none;\r
            -moz-user-select: none;\r
            -ms-user-select: none;\r
            user-select: none;\r
\r
            #logo {\r
                position: relative;\r
                grid-column: 1;\r
                width: 24px;\r
                height: 24px;\r
                left: 0;\r
                display: flex;\r
                align-self: center;\r
                justify-self: center;\r
            }\r
\r
            #title {\r
                grid-column: 2;\r
                display: grid;\r
                align-items: center;\r
                text-align: center;\r
            }\r
        }\r
\r
        .range {\r
            -webkit-appearance: none;\r
            width: 120px;\r
            height: 6px;\r
            background: #d3d3d3;\r
            border-radius: 5px;\r
            outline: none;\r
            opacity: 0.7;\r
            -webkit-transition: 0.2s;\r
            transition: opacity 0.2s;\r
        }\r
\r
        .range:hover {\r
            opacity: 1;\r
        }\r
\r
        .range::-webkit-slider-thumb {\r
            -webkit-appearance: none;\r
            appearance: none;\r
            width: 14px;\r
            height: 14px;\r
            border-radius: 50%;\r
            background: rgb(51, 122, 183);\r
            cursor: pointer;\r
        }\r
\r
        .range::-moz-range-thumb {\r
            width: 14px;\r
            height: 14px;\r
            border-radius: 50%;\r
            background: rgb(51, 122, 183);\r
            cursor: pointer;\r
        }\r
\r
        input[type="color"] {\r
            -webkit-appearance: none;\r
            border: 1px solid rgba(255, 255, 255, 0.5);\r
            padding: 0;\r
            width: 30px;\r
            height: 20px;\r
        }\r
        input[type="color"]::-webkit-color-swatch-wrapper {\r
            padding: 0;\r
        }\r
        input[type="color"]::-webkit-color-swatch {\r
            border: none;\r
        }\r
\r
        .sliderLine {\r
            padding-left: $line-padding-left;\r
            height: 30px;\r
            display: grid;\r
            grid-template-rows: 100%;\r
            grid-template-columns: 1fr 50px auto;\r
\r
            .label {\r
                grid-column: 1;\r
                display: flex;\r
                align-items: center;\r
            }\r
\r
            .slider {\r
                grid-column: 3;\r
                grid-row: 1;\r
                margin-right: 5px;\r
                width: 90%;\r
                display: flex;\r
                align-items: center;\r
            }\r
\r
            .floatLine {\r
                grid-column: 2;\r
                padding-left: $line-padding-left;\r
\r
                .label {\r
                    grid-column: 1;\r
                    display: flex;\r
                    align-items: center;\r
                }\r
\r
                .short {\r
                    grid-column: 1;\r
                    display: flex;\r
                    align-items: center;\r
\r
                    input {\r
                        width: 35px;\r
                    }\r
\r
                    input::-webkit-outer-spin-button,\r
                    input::-webkit-inner-spin-button {\r
                        -webkit-appearance: none;\r
                        margin: 0;\r
                    }\r
\r
                    input[type="number"] {\r
                        -moz-appearance: textfield;\r
                    }\r
                }\r
            }\r
        }\r
\r
        .textInputLine {\r
            padding-left: $line-padding-left;\r
            height: 30px;\r
            display: grid;\r
            grid-template-columns: 1fr 120px auto;\r
\r
            .label {\r
                grid-column: 1;\r
                display: flex;\r
                align-items: center;\r
            }\r
\r
            .value {\r
                display: flex;\r
                align-items: center;\r
                grid-column: 2;\r
\r
                input {\r
                    width: calc(100% - 5px);\r
                    margin-right: 5px;\r
                }\r
            }\r
        }\r
\r
        .textInputArea {\r
            padding-left: $line-padding-left;\r
            height: 50px;\r
            display: grid;\r
            grid-template-columns: 1fr 120px;\r
\r
            .label {\r
                grid-column: 1;\r
                display: flex;\r
                align-items: center;\r
            }\r
\r
            textarea {\r
                margin-right: 5px;\r
                margin-left: -50%;\r
                height: 40px;\r
                resize: none;\r
            }\r
\r
            .value {\r
                display: flex;\r
                align-items: center;\r
                grid-column: 2;\r
            }\r
        }\r
\r
        .paneContainer {\r
            margin-top: 3px;\r
            display: grid;\r
            grid-template-rows: 100%;\r
            grid-template-columns: 100%;\r
\r
            .paneList {\r
                border-left: 3px solid transparent;\r
            }\r
\r
            &:hover {\r
                .paneList {\r
                    border-left: 3px solid rgba(51, 122, 183, 0.8);\r
                }\r
\r
                .paneContainer-content {\r
                    .header {\r
                        .title {\r
                            border-left: 3px solid rgb(51, 122, 183);\r
                        }\r
                    }\r
                }\r
            }\r
\r
            .paneContainer-highlight-border {\r
                grid-row: 1;\r
                grid-column: 1;\r
                opacity: 1;\r
                border: 3px solid red;\r
                transition: opacity 250ms;\r
                pointer-events: none;\r
\r
                &.transparent {\r
                    opacity: 0;\r
                }\r
            }\r
\r
            .paneContainer-content {\r
                grid-row: 1;\r
                grid-column: 1;\r
\r
                .header {\r
                    display: grid;\r
                    grid-template-columns: 1fr auto;\r
                    background: #555555;\r
                    height: 30px;\r
                    padding-right: 5px;\r
                    cursor: pointer;\r
\r
                    .title {\r
                        border-left: 3px solid transparent;\r
                        padding-left: 5px;\r
                        grid-column: 1;\r
                        display: flex;\r
                        align-items: center;\r
                    }\r
\r
                    .collapse {\r
                        grid-column: 2;\r
                        display: flex;\r
                        align-items: center;\r
                        justify-items: center;\r
                        transform-origin: center;\r
\r
                        &.closed {\r
                            transform: rotate(180deg);\r
                        }\r
                    }\r
                }\r
\r
                .paneList > div:not(:last-child) {\r
                    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);\r
                }\r
\r
                .fragment > div:not(:last-child) {\r
                    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);\r
                }\r
            }\r
        }\r
\r
        .color-picker {\r
            height: calc(100% - 8px);\r
            margin: 4px;\r
            width: calc(100% - 8px);\r
\r
            .color-rect {\r
                height: calc(100% - 4px);\r
                border: 2px white solid;\r
                cursor: pointer;\r
                min-height: 18px;\r
            }\r
\r
            .color-picker-cover {\r
                position: fixed;\r
                top: 0px;\r
                right: 0px;\r
                bottom: 0px;\r
                left: 0px;\r
                z-index: 1;\r
            }\r
\r
            .color-picker-float {\r
                z-index: 2;\r
                position: absolute;\r
            }\r
        }\r
\r
        .gradient-step {\r
            display: grid;\r
            grid-template-rows: 100%;\r
            grid-template-columns: 20px 30px 40px auto 20px 30px;\r
            padding-top: 5px;\r
            padding-left: 5px;\r
            padding-bottom: 5px;\r
\r
            .step {\r
                grid-row: 1;\r
                grid-column: 1;\r
            }\r
\r
            .color {\r
                grid-row: 1;\r
                grid-column: 2;\r
                cursor: pointer;\r
            }\r
\r
            .step-value {\r
                margin-left: 5px;\r
                grid-row: 1;\r
                grid-column: 3;\r
                text-align: right;\r
                margin-right: 5px;\r
            }\r
\r
            .step-slider {\r
                grid-row: 1;\r
                grid-column: 4;\r
                display: grid;\r
                justify-content: stretch;\r
                align-content: center;\r
                margin-right: -5px;\r
                padding-left: 12px;\r
\r
                input {\r
                    width: 90%;\r
                }\r
            }\r
\r
            .gradient-copy {\r
                grid-row: 1;\r
                grid-column: 5;\r
                display: grid;\r
                align-content: center;\r
                justify-content: center;\r
\r
                .img {\r
                    height: 20px;\r
                    width: 20px;\r
                }\r
                .img:hover {\r
                    cursor: pointer;\r
                }\r
            }\r
            .gradient-delete {\r
                grid-row: 1;\r
                grid-column: 6;\r
                display: grid;\r
                align-content: center;\r
                justify-content: center;\r
                .img {\r
                    height: 20px;\r
                    width: 20px;\r
                }\r
                .img:hover {\r
                    cursor: pointer;\r
                }\r
            }\r
        }\r
\r
        .floatLine {\r
            padding-left: $line-padding-left;\r
            height: 30px;\r
            display: grid;\r
            grid-template-columns: 1fr 120px;\r
\r
            .label {\r
                grid-column: 1;\r
                display: flex;\r
                align-items: center;\r
            }\r
\r
            .value {\r
                grid-column: 2;\r
\r
                display: flex;\r
                align-items: center;\r
\r
                input {\r
                    width: 110px;\r
                }\r
            }\r
\r
            .short {\r
                grid-column: 2;\r
\r
                display: flex;\r
                align-items: center;\r
\r
                input {\r
                    width: 27px;\r
                }\r
\r
                input::-webkit-outer-spin-button,\r
                input::-webkit-inner-spin-button {\r
                    -webkit-appearance: none;\r
                    margin: 0;\r
                }\r
\r
                input[type="number"] {\r
                    -moz-appearance: textfield;\r
                }\r
            }\r
        }\r
\r
        .vector3Line {\r
            padding-left: $line-padding-left;\r
            display: grid;\r
\r
            .firstLine {\r
                display: grid;\r
                grid-template-columns: 1fr auto 20px;\r
                height: 30px;\r
\r
                .label {\r
                    grid-column: 1;\r
                    display: flex;\r
                    align-items: center;\r
                }\r
\r
                .vector {\r
                    grid-column: 2;\r
                    display: flex;\r
                    align-items: center;\r
                    text-align: right;\r
                    opacity: 0.8;\r
                }\r
\r
                .expand {\r
                    grid-column: 3;\r
                    display: grid;\r
                    align-items: center;\r
                    justify-items: center;\r
                    cursor: pointer;\r
                }\r
            }\r
\r
            .secondLine {\r
                display: grid;\r
                padding-right: 5px;\r
                border-left: 1px solid rgb(51, 122, 183);\r
\r
                .no-right-margin {\r
                    margin-right: 0;\r
                }\r
\r
                .numeric {\r
                    display: grid;\r
                    grid-template-columns: 1fr auto;\r
                }\r
\r
                .numeric-label {\r
                    text-align: right;\r
                    grid-column: 1;\r
                    display: flex;\r
                    align-items: center;\r
                    justify-self: right;\r
                    margin-right: 10px;\r
                }\r
\r
                .numeric-value {\r
                    width: 120px;\r
                    grid-column: 2;\r
                    display: flex;\r
                    align-items: center;\r
                    border: 1px solid rgb(51, 122, 183);\r
                }\r
            }\r
        }\r
\r
        .buttonLine {\r
            height: 30px;\r
            display: grid;\r
            align-items: center;\r
            justify-items: stretch;\r
            padding-bottom: 5px;\r
\r
            &.disabled {\r
                opacity: 0.3;\r
            }\r
\r
            input[type="file"] {\r
                display: none;\r
            }\r
\r
            .file-upload {\r
                background: #222222;\r
                border: 1px solid rgb(51, 122, 183);\r
                margin: 5px 10px;\r
                color: white;\r
                padding: 4px 5px;\r
                padding-top: 0px;\r
                opacity: 0.9;\r
                cursor: pointer;\r
                text-align: center;\r
            }\r
\r
            .file-upload:hover {\r
                opacity: 1;\r
            }\r
\r
            .file-upload:active {\r
                transform: scale(0.98);\r
                transform-origin: 0.5 0.5;\r
            }\r
\r
            button {\r
                background: #222222;\r
                border: 1px solid rgb(51, 122, 183);\r
                margin: 5px 10px 5px 10px;\r
                color: white;\r
                padding: 4px 5px;\r
                opacity: 0.9;\r
            }\r
\r
            button:hover {\r
                opacity: 1;\r
            }\r
\r
            button:active {\r
                background: #282828;\r
            }\r
\r
            button:focus {\r
                border: 1px solid rgb(51, 122, 183);\r
                outline: 0px;\r
            }\r
        }\r
\r
        .checkBoxLine {\r
            padding-left: $line-padding-left;\r
            height: 30px;\r
            display: grid;\r
            grid-template-columns: 1fr auto;\r
\r
            .label {\r
                grid-column: 1;\r
                display: flex;\r
                align-items: center;\r
            }\r
\r
            .checkBox {\r
                grid-column: 2;\r
\r
                display: flex;\r
                align-items: center;\r
\r
                .lbl {\r
                    position: relative;\r
                    display: block;\r
                    height: 14px;\r
                    width: 34px;\r
                    margin-right: 5px;\r
                    background: #898989;\r
                    border-radius: 100px;\r
                    cursor: pointer;\r
                    transition: all 0.3s ease;\r
                }\r
\r
                .lbl:after {\r
                    position: absolute;\r
                    left: 3px;\r
                    top: 2px;\r
                    display: block;\r
                    width: 10px;\r
                    height: 10px;\r
                    border-radius: 100px;\r
                    background: #fff;\r
                    box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.05);\r
                    content: "";\r
                    transition: all 0.15s ease;\r
                }\r
\r
                .lbl:active:after {\r
                    transform: scale(1.15, 0.85);\r
                }\r
\r
                .cbx:checked ~ label {\r
                    background: rgb(51, 122, 183);\r
                }\r
\r
                .cbx:checked ~ label:after {\r
                    left: 20px;\r
                    background: rgb(22, 73, 117);\r
                }\r
\r
                .cbx:checked ~ label.disabled {\r
                    background: rgb(22, 73, 117);\r
                    cursor: pointer;\r
                }\r
\r
                .cbx:checked ~ label.disabled:after {\r
                    left: 20px;\r
                    background: rgb(85, 85, 85);\r
                    cursor: pointer;\r
                }\r
\r
                .cbx ~ label.disabled {\r
                    background: rgb(85, 85, 85);\r
                    cursor: pointer;\r
                }\r
\r
                .hidden {\r
                    display: none;\r
                }\r
            }\r
        }\r
\r
        .listLine {\r
            padding-left: $line-padding-left;\r
            height: 30px;\r
            display: grid;\r
            grid-template-columns: 1fr auto;\r
\r
            .label {\r
                grid-column: 1;\r
                display: flex;\r
                align-items: center;\r
            }\r
\r
            .options {\r
                grid-column: 2;\r
\r
                display: flex;\r
                align-items: center;\r
                margin-right: 5px;\r
\r
                select {\r
                    width: 115px;\r
                }\r
            }\r
        }\r
\r
        .color3Line {\r
            padding-left: $line-padding-left;\r
            display: grid;\r
\r
            .firstLine {\r
                height: 30px;\r
                display: grid;\r
                grid-template-columns: 1fr auto 0px 20px 20px;\r
\r
                .label {\r
                    grid-column: 1;\r
                    display: flex;\r
                    align-items: center;\r
                }\r
\r
                .textInputLine {\r
                    display: none;\r
                }\r
\r
                .color3 {\r
                    grid-column: 2;\r
                    width: 50px;\r
\r
                    display: flex;\r
                    align-items: center;\r
\r
                    input {\r
                        margin-right: 5px;\r
                    }\r
                }\r
\r
                .copy {\r
                    grid-column: 4;\r
                    display: grid;\r
                    align-items: center;\r
                    justify-items: center;\r
                    cursor: pointer;\r
\r
                    img {\r
                        height: 100%;\r
                        width: 24px;\r
                    }\r
                }\r
\r
                .expand {\r
                    grid-column: 5;\r
                    display: grid;\r
                    align-items: center;\r
                    justify-items: center;\r
                    cursor: pointer;\r
\r
                    img {\r
                        height: 100%;\r
                        width: 20px;\r
                    }\r
                }\r
            }\r
\r
            .secondLine {\r
                display: grid;\r
                padding-right: 5px;\r
                border-left: 1px solid rgb(51, 122, 183);\r
\r
                .numeric {\r
                    display: grid;\r
                    grid-template-columns: 1fr auto;\r
                }\r
\r
                .numeric-label {\r
                    text-align: right;\r
                    grid-column: 1;\r
                    display: flex;\r
                    align-items: center;\r
                    justify-self: right;\r
                    margin-right: 10px;\r
                }\r
\r
                .numeric-value {\r
                    width: 120px;\r
                    grid-column: 2;\r
                    display: flex;\r
                    align-items: center;\r
                    border: 1px solid rgb(51, 122, 183);\r
                }\r
            }\r
        }\r
\r
        .textLine {\r
            padding-left: $line-padding-left;\r
            height: 30px;\r
            display: grid;\r
            grid-template-columns: 1fr auto;\r
\r
            .label {\r
                grid-column: 1;\r
                display: flex;\r
                align-items: center;\r
            }\r
\r
            .link-value {\r
                grid-column: 2;\r
                white-space: nowrap;\r
                text-overflow: ellipsis;\r
                overflow: hidden;\r
                text-align: end;\r
                opacity: 0.8;\r
                margin: 5px;\r
                margin-top: 6px;\r
                max-width: 140px;\r
                text-decoration: underline;\r
                cursor: pointer;\r
            }\r
\r
            .value {\r
                grid-column: 2;\r
                white-space: nowrap;\r
                text-overflow: ellipsis;\r
                overflow: hidden;\r
                text-align: end;\r
                opacity: 0.8;\r
                margin: 5px;\r
                margin-top: 6px;\r
                max-width: 200px;\r
                -webkit-user-select: text;\r
                -moz-user-select: text;\r
                -ms-user-select: text;\r
                user-select: text;\r
\r
                &.check {\r
                    color: green;\r
                }\r
\r
                &.uncheck {\r
                    color: red;\r
                }\r
            }\r
        }\r
    }\r
}\r
`], sourceRoot: "" }]), P.locals = {};
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/main.scss": (
          /*!*********************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/main.scss ***!
            \*********************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `#node-editor-graph-root {
  display: grid;
  grid-template-rows: calc(100% - 120px) 120px;
  height: 100%;
  width: 100%;
  background: #464646;
  font: 14px "acumin-pro";
}
#node-editor-graph-root.popup {
  grid-template-columns: 100%;
  overflow: hidden;
}
#node-editor-graph-root .wait-screen {
  display: grid;
  justify-content: center;
  align-content: center;
  height: 100%;
  width: 100%;
  background: #464646;
  opacity: 0.95;
  color: white;
  font: 24px "acumin-pro";
  position: absolute;
  top: 0;
  left: 0;
}
#node-editor-graph-root .wait-screen.hidden {
  visibility: hidden;
}
#node-editor-graph-root #nmeNodeList {
  grid-row: 1/span 2;
  grid-column: 1;
}
#node-editor-graph-root #leftGrab {
  grid-row: 1/span 2;
  grid-column: 2;
  cursor: ew-resize;
}
#node-editor-graph-root #rightGrab {
  grid-row: 1/span 2;
  grid-column: 4;
  cursor: ew-resize;
}
#node-editor-graph-root .diagram-container {
  grid-row: 1;
  grid-column: 3;
  background: #5f5b60;
  width: 100%;
  height: 100%;
}
#node-editor-graph-root .diagram-container .diagram {
  display: none;
  width: 100%;
  height: 100%;
}
#node-editor-graph-root .nme-right-panel {
  grid-row: 1/span 2;
  grid-column: 5;
  display: grid;
  grid-template-rows: 1fr 40px auto 40px;
  grid-template-columns: 100%;
  height: 100%;
  overflow-y: auto;
}
#node-editor-graph-root #propertyTab {
  grid-row: 1;
  grid-column: 1;
}
#node-editor-graph-root .button {
  display: grid;
  justify-content: center;
  align-content: center;
  height: auto;
  width: 14.2857142857%;
  cursor: pointer;
}
#node-editor-graph-root .button:hover {
  background: rgb(51, 122, 183);
  color: white;
  opacity: 0.8;
}
#node-editor-graph-root .button.selected {
  background: rgb(51, 122, 183);
  color: white;
}
#node-editor-graph-root .button.align {
  justify-content: stretch;
  text-align: center;
}
#node-editor-graph-root #preview-mesh-bar {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  grid-template-columns: auto 1fr 40px 40px 40px;
  align-items: center;
  font-size: 18px;
  background-color: #555555;
}
#node-editor-graph-root #preview-mesh-bar #file-picker {
  display: none;
}
#node-editor-graph-root #preview-mesh-bar .listLine {
  grid-column: 1;
  height: 40px;
  display: grid;
  grid-template-columns: 0px 1fr;
}
#node-editor-graph-root #preview-mesh-bar .listLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
  font-size: 14px;
}
#node-editor-graph-root #preview-mesh-bar .listLine .options {
  grid-column: 2;
  display: flex;
  align-items: center;
  margin-left: 5px;
}
#node-editor-graph-root #preview-mesh-bar .listLine .options select {
  width: 115px;
}
#node-editor-graph-root #preview-mesh-bar .button {
  color: #ffffff;
  width: 40px;
  height: 40px;
  transform-origin: 50% 50%;
}
#node-editor-graph-root #preview-mesh-bar .button:active {
  transform: scale(0.9);
}
#node-editor-graph-root #preview-mesh-bar .button:hover {
  background: #3f3461;
}
#node-editor-graph-root #preview-mesh-bar .button.selected {
  background: #9379e6;
}
#node-editor-graph-root #preview-mesh-bar .button img {
  height: 24px;
  width: 24px;
}
#node-editor-graph-root #preview-mesh-bar #play-button {
  grid-column: 3;
}
#node-editor-graph-root #preview-mesh-bar #color-picker-button {
  grid-column: 4;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 100%;
}
#node-editor-graph-root #preview-mesh-bar #color-picker-button img {
  height: 24px;
  width: 24px;
}
#node-editor-graph-root #preview-mesh-bar #color-picker-button #color-picker-image {
  padding-left: 7px;
  padding-top: 8px;
}
#node-editor-graph-root #preview-mesh-bar #color-picker-button #color-picker {
  transform: scale(0);
  grid-column: 1;
  grid-row: 1;
}
#node-editor-graph-root #preview-mesh-bar #color-picker-button #color-picker-label {
  width: 100%;
  background: transparent;
  cursor: pointer;
}
#node-editor-graph-root #preview-mesh-bar #preview-new-window {
  grid-column: 5;
}
#node-editor-graph-root #preview-mesh-bar select {
  background-color: #a3a3a3;
  color: #333333;
}
#node-editor-graph-root #preview-config-bar {
  grid-row: 4;
  grid-column: 1;
  display: grid;
  grid-template-columns: 40px 40px 40px 1fr 40px 40px;
  color: white;
  align-items: center;
  font-size: 18px;
}
#node-editor-graph-root #preview-config-bar.extended {
  grid-template-columns: 1fr;
}
#node-editor-graph-root #preview-config-bar .listLine {
  padding-left: 5px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
}
#node-editor-graph-root #preview-config-bar .listLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
  font-size: 14px;
}
#node-editor-graph-root #preview-config-bar .listLine .options {
  grid-column: 2;
  display: flex;
  align-items: center;
  margin-right: 5px;
}
#node-editor-graph-root #preview-config-bar .listLine .options select {
  width: 115px;
}
#node-editor-graph-root #preview-config-bar .button {
  width: 40px;
  grid-row: 1;
  height: 40px;
  transform-origin: 50% 50%;
}
#node-editor-graph-root #preview-config-bar .button:hover {
  background: #3f3461;
}
#node-editor-graph-root #preview-config-bar .button.selected {
  background: #9379e6;
}
#node-editor-graph-root #preview-config-bar .button:active {
  transform: scale(0.9);
}
#node-editor-graph-root #preview-config-bar .button img {
  height: auto;
  width: 100%;
}
#node-editor-graph-root #preview-config-bar .button.back-face {
  grid-column: 6;
}
#node-editor-graph-root #preview-config-bar .button.depth-pass {
  grid-column: 5/6;
}
#node-editor-graph-root #preview-config-bar .button.hemispheric-light {
  grid-column: 3/4;
}
#node-editor-graph-root #preview-config-bar .button.direction-light-1 {
  grid-column: 2/3;
}
#node-editor-graph-root #preview-config-bar .button.direction-light-0 {
  grid-column: 1/2;
}
#node-editor-graph-root #preview {
  border-top: 1px solid rgb(85, 85, 85);
  grid-row: 3;
  grid-column: 1;
  width: 100%;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 100%;
  outline: 0 !important;
  padding: 0 !important;
  user-select: none;
  overflow: hidden;
}
#node-editor-graph-root #preview #preview-canvas {
  width: 100%;
  height: 100%;
  outline: 0 !important;
  padding: 0 !important;
  grid-row: 1;
  grid-column: 1;
}
#node-editor-graph-root #preview .waitPanel {
  width: 100%;
  height: 100%;
  grid-row: 1;
  grid-column: 1;
  color: white;
  font-size: 18px;
  align-content: center;
  justify-content: center;
  background: rgba(20, 20, 20, 0.95);
  z-index: 10;
  display: grid;
  transition: opacity 250ms;
}
#node-editor-graph-root #preview .waitPanel.hidden {
  opacity: 0;
  pointer-events: none;
}
#node-editor-graph-root .blocker {
  visibility: hidden;
  position: absolute;
  width: calc(100% - 40px);
  height: 100%;
  top: 0;
  left: 0;
  background: rgba(20, 20, 20, 0.95);
  font-family: "acumin-pro";
  color: white;
  font-size: 24px;
  display: grid;
  align-content: center;
  justify-content: center;
  user-select: none;
  padding: 20px;
  text-align: center;
}
#node-editor-graph-root #log-console {
  grid-row: 2;
  grid-column: 3;
}
#node-editor-graph-root .LightInformationBlock {
  width: 280px;
}
#node-editor-graph-root .InputBlock {
  width: 250px;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/main.scss"], names: [], mappings: "AAAA;EACI,aAAA;EACA,4CAAA;EACA,YAAA;EACA,WAAA;EACA,mBAAA;EACA,uBAAA;AACJ;AACI;EACI,2BAAA;EACA,gBAAA;AACR;AAEI;EACI,aAAA;EACA,uBAAA;EACA,qBAAA;EACA,YAAA;EACA,WAAA;EACA,mBAAA;EACA,aAAA;EACA,YAAA;EACA,uBAAA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;AAAR;AAEQ;EACI,kBAAA;AAAZ;AAII;EACI,kBAAA;EACA,cAAA;AAFR;AAKI;EACI,kBAAA;EACA,cAAA;EACA,iBAAA;AAHR;AAMI;EACI,kBAAA;EACA,cAAA;EACA,iBAAA;AAJR;AAOI;EACI,WAAA;EACA,cAAA;EACA,mBAAA;EACA,WAAA;EACA,YAAA;AALR;AAOQ;EACI,aAAA;EACA,WAAA;EACA,YAAA;AALZ;AASI;EACI,kBAAA;EACA,cAAA;EACA,aAAA;EACA,sCAAA;EACA,2BAAA;EACA,YAAA;EACA,gBAAA;AAPR;AAUI;EACI,WAAA;EACA,cAAA;AARR;AAWI;EACI,aAAA;EACA,uBAAA;EACA,qBAAA;EACA,YAAA;EACA,qBAAA;EACA,eAAA;AATR;AAWQ;EACI,6BAAA;EACA,YAAA;EACA,YAAA;AATZ;AAYQ;EACI,6BAAA;EACA,YAAA;AAVZ;AAaQ;EACI,wBAAA;EACA,kBAAA;AAXZ;AAeI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,8CAAA;EACA,mBAAA;EACA,eAAA;EACA,yBAAA;AAbR;AAeQ;EACI,aAAA;AAbZ;AAgBQ;EACI,cAAA;EACA,YAAA;EACA,aAAA;EACA,8BAAA;AAdZ;AAgBY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;AAdhB;AAiBY;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;EACA,gBAAA;AAhBhB;AAkBgB;EACI,YAAA;AAhBpB;AAqBQ;EACI,cAAA;EACA,WAAA;EACA,YAAA;EACA,yBAAA;AAnBZ;AAqBY;EACI,qBAAA;AAnBhB;AAsBY;EACI,mBAAA;AApBhB;AAuBY;EACI,mBAAA;AArBhB;AAwBY;EACI,YAAA;EACA,WAAA;AAtBhB;AA0BQ;EACI,cAAA;AAxBZ;AA2BQ;EACI,cAAA;EACA,aAAA;EACA,2BAAA;EACA,wBAAA;AAzBZ;AA2BY;EACI,YAAA;EACA,WAAA;AAzBhB;AA2BY;EACI,iBAAA;EACA,gBAAA;AAzBhB;AA4BY;EACI,mBAAA;EACA,cAAA;EACA,WAAA;AA1BhB;AA6BY;EACI,WAAA;EACA,uBAAA;EACA,eAAA;AA3BhB;AA+BQ;EACI,cAAA;AA7BZ;AAgCQ;EACI,yBAAA;EACA,cAAA;AA9BZ;AAkCI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,mDAAA;EACA,YAAA;EACA,mBAAA;EACA,eAAA;AAhCR;AAkCQ;EACI,0BAAA;AAhCZ;AAmCQ;EACI,iBAAA;EACA,YAAA;EACA,aAAA;EACA,+BAAA;AAjCZ;AAmCY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;AAjChB;AAoCY;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;EACA,iBAAA;AAnChB;AAqCgB;EACI,YAAA;AAnCpB;AAwCQ;EACI,WAAA;EACA,WAAA;EACA,YAAA;EACA,yBAAA;AAtCZ;AAwCY;EACI,mBAAA;AAtChB;AAyCY;EACI,mBAAA;AAvChB;AA0CY;EACI,qBAAA;AAxChB;AA2CY;EACI,YAAA;EACA,WAAA;AAzChB;AA4CY;EACI,cAAA;AA1ChB;AA6CY;EACI,gBAAA;AA3ChB;AA8CY;EACI,gBAAA;AA5ChB;AA8CY;EACI,gBAAA;AA5ChB;AA8CY;EACI,gBAAA;AA5ChB;AAiDI;EACI,qCAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;EACA,aAAA;EACA,2BAAA;EACA,wBAAA;EACA,qBAAA;EACA,qBAAA;EACA,iBAAA;EACA,gBAAA;AA/CR;AAiDQ;EACI,WAAA;EACA,YAAA;EACA,qBAAA;EACA,qBAAA;EACA,WAAA;EACA,cAAA;AA/CZ;AAkDQ;EACI,WAAA;EACA,YAAA;EACA,WAAA;EACA,cAAA;EACA,YAAA;EACA,eAAA;EACA,qBAAA;EACA,uBAAA;EACA,kCAAA;EACA,WAAA;EACA,aAAA;EACA,yBAAA;AAhDZ;AAkDY;EACI,UAAA;EACA,oBAAA;AAhDhB;AAqDI;EACI,kBAAA;EACA,kBAAA;EACA,wBAAA;EACA,YAAA;EACA,MAAA;EACA,OAAA;EAEA,kCAAA;EACA,yBAAA;EACA,YAAA;EACA,eAAA;EAEA,aAAA;EACA,qBAAA;EACA,uBAAA;EAEA,iBAAA;EAEA,aAAA;EACA,kBAAA;AAvDR;AA0DI;EACI,WAAA;EACA,cAAA;AAxDR;AA2DI;EACI,YAAA;AAzDR;AA4DI;EACI,YAAA;AA1DR", sourcesContent: [`#node-editor-graph-root {\r
    display: grid;\r
    grid-template-rows: calc(100% - 120px) 120px;\r
    height: 100%;\r
    width: 100%;\r
    background: #464646;\r
    font: 14px "acumin-pro";\r
\r
    &.popup {\r
        grid-template-columns: 100%;\r
        overflow: hidden;\r
    }\r
\r
    .wait-screen {\r
        display: grid;\r
        justify-content: center;\r
        align-content: center;\r
        height: 100%;\r
        width: 100%;\r
        background: #464646;\r
        opacity: 0.95;\r
        color: white;\r
        font: 24px "acumin-pro";\r
        position: absolute;\r
        top: 0;\r
        left: 0;\r
\r
        &.hidden {\r
            visibility: hidden;\r
        }\r
    }\r
\r
    #nmeNodeList {\r
        grid-row: 1 / span 2;\r
        grid-column: 1;\r
    }\r
\r
    #leftGrab {\r
        grid-row: 1 / span 2;\r
        grid-column: 2;\r
        cursor: ew-resize;\r
    }\r
\r
    #rightGrab {\r
        grid-row: 1 / span 2;\r
        grid-column: 4;\r
        cursor: ew-resize;\r
    }\r
\r
    .diagram-container {\r
        grid-row: 1;\r
        grid-column: 3;\r
        background: #5f5b60;\r
        width: 100%;\r
        height: 100%;\r
\r
        .diagram {\r
            display: none;\r
            width: 100%;\r
            height: 100%;\r
        }\r
    }\r
\r
    .nme-right-panel {\r
        grid-row: 1 / span 2;\r
        grid-column: 5;\r
        display: grid;\r
        grid-template-rows: 1fr 40px auto 40px;\r
        grid-template-columns: 100%;\r
        height: 100%;\r
        overflow-y: auto;\r
    }\r
\r
    #propertyTab {\r
        grid-row: 1;\r
        grid-column: 1;\r
    }\r
\r
    .button {\r
        display: grid;\r
        justify-content: center;\r
        align-content: center;\r
        height: auto;\r
        width: calc(100% / 7);\r
        cursor: pointer;\r
\r
        &:hover {\r
            background: rgb(51, 122, 183);\r
            color: white;\r
            opacity: 0.8;\r
        }\r
\r
        &.selected {\r
            background: rgb(51, 122, 183);\r
            color: white;\r
        }\r
\r
        &.align {\r
            justify-content: stretch;\r
            text-align: center;\r
        }\r
    }\r
\r
    #preview-mesh-bar {\r
        grid-row: 2;\r
        grid-column: 1;\r
        display: grid;\r
        grid-template-columns: auto 1fr 40px 40px 40px;\r
        align-items: center;\r
        font-size: 18px;\r
        background-color: #555555;\r
\r
        #file-picker {\r
            display: none;\r
        }\r
\r
        .listLine {\r
            grid-column: 1;\r
            height: 40px;\r
            display: grid;\r
            grid-template-columns: 0px 1fr;\r
\r
            .label {\r
                grid-column: 1;\r
                display: flex;\r
                align-items: center;\r
                font-size: 14px;\r
            }\r
\r
            .options {\r
                grid-column: 2;\r
\r
                display: flex;\r
                align-items: center;\r
                margin-left: 5px;\r
\r
                select {\r
                    width: 115px;\r
                }\r
            }\r
        }\r
\r
        .button {\r
            color: #ffffff;\r
            width: 40px;\r
            height: 40px;\r
            transform-origin: 50% 50%;\r
\r
            &:active {\r
                transform: scale(0.9);\r
            }\r
\r
            &:hover {\r
                background: #3f3461;\r
            }\r
\r
            &.selected {\r
                background: #9379e6;\r
            }\r
\r
            img {\r
                height: 24px;\r
                width: 24px;\r
            }\r
        }\r
\r
        #play-button {\r
            grid-column: 3;\r
        }\r
\r
        #color-picker-button {\r
            grid-column: 4;\r
            display: grid;\r
            grid-template-columns: 100%;\r
            grid-template-rows: 100%;\r
\r
            img {\r
                height: 24px;\r
                width: 24px;\r
            }\r
            #color-picker-image {\r
                padding-left: 7px;\r
                padding-top: 8px;\r
            }\r
\r
            #color-picker {\r
                transform: scale(0);\r
                grid-column: 1;\r
                grid-row: 1;\r
            }\r
\r
            #color-picker-label {\r
                width: 100%;\r
                background: transparent;\r
                cursor: pointer;\r
            }\r
        }\r
\r
        #preview-new-window {\r
            grid-column: 5;\r
        }\r
\r
        select {\r
            background-color: #a3a3a3;\r
            color: #333333;\r
        }\r
    }\r
\r
    #preview-config-bar {\r
        grid-row: 4;\r
        grid-column: 1;\r
        display: grid;\r
        grid-template-columns: 40px 40px 40px 1fr 40px 40px;\r
        color: white;\r
        align-items: center;\r
        font-size: 18px;\r
\r
        &.extended {\r
            grid-template-columns: 1fr;\r
        }\r
\r
        .listLine {\r
            padding-left: 5px;\r
            height: 30px;\r
            display: grid;\r
            grid-template-columns: 1fr auto;\r
\r
            .label {\r
                grid-column: 1;\r
                display: flex;\r
                align-items: center;\r
                font-size: 14px;\r
            }\r
\r
            .options {\r
                grid-column: 2;\r
\r
                display: flex;\r
                align-items: center;\r
                margin-right: 5px;\r
\r
                select {\r
                    width: 115px;\r
                }\r
            }\r
        }\r
\r
        .button {\r
            width: 40px;\r
            grid-row: 1;\r
            height: 40px;\r
            transform-origin: 50% 50%;\r
\r
            &:hover {\r
                background: #3f3461;\r
            }\r
\r
            &.selected {\r
                background: #9379e6;\r
            }\r
\r
            &:active {\r
                transform: scale(0.9);\r
            }\r
\r
            img {\r
                height: auto;\r
                width: 100%;\r
            }\r
\r
            &.back-face {\r
                grid-column: 6;\r
            }\r
\r
            &.depth-pass {\r
                grid-column: 5 / 6;\r
            }\r
\r
            &.hemispheric-light {\r
                grid-column: 3 / 4;\r
            }\r
            &.direction-light-1 {\r
                grid-column: 2 / 3;\r
            }\r
            &.direction-light-0 {\r
                grid-column: 1 / 2;\r
            }\r
        }\r
    }\r
\r
    #preview {\r
        border-top: 1px solid rgb(85, 85, 85);\r
        grid-row: 3;\r
        grid-column: 1;\r
        width: 100%;\r
        display: grid;\r
        grid-template-columns: 100%;\r
        grid-template-rows: 100%;\r
        outline: 0 !important;\r
        padding: 0 !important;\r
        user-select: none;\r
        overflow: hidden;\r
\r
        #preview-canvas {\r
            width: 100%;\r
            height: 100%;\r
            outline: 0 !important;\r
            padding: 0 !important;\r
            grid-row: 1;\r
            grid-column: 1;\r
        }\r
\r
        .waitPanel {\r
            width: 100%;\r
            height: 100%;\r
            grid-row: 1;\r
            grid-column: 1;\r
            color: white;\r
            font-size: 18px;\r
            align-content: center;\r
            justify-content: center;\r
            background: rgba(20, 20, 20, 0.95);\r
            z-index: 10;\r
            display: grid;\r
            transition: opacity 250ms;\r
\r
            &.hidden {\r
                opacity: 0;\r
                pointer-events: none;\r
            }\r
        }\r
    }\r
\r
    .blocker {\r
        visibility: hidden;\r
        position: absolute;\r
        width: calc(100% - 40px);\r
        height: 100%;\r
        top: 0;\r
        left: 0;\r
\r
        background: rgba(20, 20, 20, 0.95);\r
        font-family: "acumin-pro";\r
        color: white;\r
        font-size: 24px;\r
\r
        display: grid;\r
        align-content: center;\r
        justify-content: center;\r
\r
        user-select: none;\r
\r
        padding: 20px;\r
        text-align: center;\r
    }\r
\r
    #log-console {\r
        grid-row: 2;\r
        grid-column: 3;\r
    }\r
\r
    .LightInformationBlock {\r
        width: 280px;\r
    }\r
\r
    .InputBlock {\r
        width: 250px;\r
    }\r
}\r
`], sourceRoot: "" }]), P.locals = {};
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/MessageDialog.modules.scss": (
          /*!*******************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/MessageDialog.modules.scss ***!
            \*******************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  font-family: "acumin-pro";
  top: 0;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog {
  align-self: center;
  justify-self: center;
  min-height: 140px;
  max-width: 400px;
  border-radius: 10px;
  background: white;
  padding: 10px;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 1fr 50px;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-message {
  grid-row: 1;
  grid-column: 1;
  margin-top: 20px;
  padding: 10px;
  font-size: 18px;
  color: black;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-buttons {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
  color: white;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-buttons .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-button-ok {
  cursor: pointer;
  justify-self: center;
  background: green;
  min-width: 80px;
  justify-content: center;
  display: grid;
  align-content: center;
  align-self: center;
  height: 35px;
  border-radius: 10px;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-buttons .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-button-ok:hover {
  opacity: 0.8;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-buttons .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-button-ok.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__error {
  background: red;
}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/components/MessageDialog.modules.scss"], names: [], mappings: "AAAA;EACI,kBAAA;EACA,WAAA;EACA,YAAA;EACA,8BAAA;EACA,aAAA;EACA,yBAAA;EACA,MAAA;AACJ;AACI;EACI,kBAAA;EACA,oBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,iBAAA;EACA,aAAA;EAEA,aAAA;EACA,2BAAA;EACA,4BAAA;AAAR;AAEQ;EACI,WAAA;EACA,cAAA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,YAAA;AAAZ;AAGQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;EACA,YAAA;AADZ;AAGY;EACI,eAAA;EACA,oBAAA;EACA,iBAAA;EACA,eAAA;EACA,uBAAA;EACA,aAAA;EACA,qBAAA;EACA,kBAAA;EACA,YAAA;EACA,mBAAA;AADhB;AAGgB;EACI,YAAA;AADpB;AAIgB;EACI,eAAA;AAFpB", sourcesContent: [`:local .dialog-container {\r
    position: absolute;\r
    width: 100%;\r
    height: 100%;\r
    background: rgba(0.1, 0.1, 0.1, 0.6);\r
    display: grid;\r
    font-family: "acumin-pro";\r
    top: 0;\r
\r
    .dialog {\r
        align-self: center;\r
        justify-self: center;\r
        min-height: 140px;\r
        max-width: 400px;\r
        border-radius: 10px;\r
        background: white;\r
        padding: 10px;\r
\r
        display: grid;\r
        grid-template-columns: 100%;\r
        grid-template-rows: 1fr 50px;\r
\r
        .dialog-message {\r
            grid-row: 1;\r
            grid-column: 1;\r
            margin-top: 20px;\r
            padding: 10px;\r
            font-size: 18px;\r
            color: black;\r
        }\r
\r
        .dialog-buttons {\r
            grid-row: 2;\r
            grid-column: 1;\r
            display: grid;\r
            grid-template-rows: 100%;\r
            grid-template-columns: 100%;\r
            color: white;\r
\r
            .dialog-button-ok {\r
                cursor: pointer;\r
                justify-self: center;\r
                background: green;\r
                min-width: 80px;\r
                justify-content: center;\r
                display: grid;\r
                align-content: center;\r
                align-self: center;\r
                height: 35px;\r
                border-radius: 10px;\r
\r
                &:hover {\r
                    opacity: 0.8;\r
                }\r
\r
                &.error {\r
                    background: red;\r
                }\r
            }\r
        }\r
    }\r
}\r
`], sourceRoot: "" }]), P.locals = {
              "dialog-container": "---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container",
              dialog: "---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog",
              "dialog-message": "---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-message",
              "dialog-buttons": "---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-buttons",
              "dialog-button-ok": "---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-button-ok",
              error: "---------dev-sharedUiComponents-dist-components-MessageDialog-modules__error"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss": (
          /*!*****************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss ***!
            \*****************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__hidden {
  display: none !important;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port {
  border-radius: 20px;
  width: 20px;
  height: 20px;
  align-self: center;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 100%;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__img {
  width: 100%;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port:hover, .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__selected {
  filter: brightness(2);
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__portLine {
  height: 24px;
  display: grid;
  grid-template-rows: 100%;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port-label {
  align-items: center;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__inputsContainer {
  grid-row: 1;
  grid-column: 1;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__inputsContainer .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__portLine {
  grid-template-columns: 12px calc(100% - 15px);
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__inputsContainer .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__portLine .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port-label {
  grid-row: 1;
  grid-column: 2;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__inputsContainer .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__portLine .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port {
  grid-row: 1;
  grid-column: 1;
  transform: translateX(-12px);
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__outputsContainer {
  grid-row: 1;
  grid-column: 2;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__outputsContainer .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__portLine {
  grid-template-columns: calc(100% - 10px) 12px;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__outputsContainer .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__portLine .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port-label {
  grid-row: 1;
  grid-column: 1;
  text-align: right;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__outputsContainer .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__portLine .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port {
  grid-row: 1;
  grid-column: 2;
  transform: translateX(2px);
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__frame-box {
  position: absolute;
  background: rgba(72, 72, 72, 0.7);
  display: grid;
  grid-template-rows: 40px calc(100% - 40px);
  grid-template-columns: 100%;
  box-sizing: border-box;
}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss"], names: [], mappings: "AAAA;EACI,wBAAA;AACJ;;AAEA;EACI,mBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,aAAA;EACA,2BAAA;EACA,wBAAA;AACJ;AACI;EACI,WAAA;AACR;AAEI;EAEI,qBAAA;AADR;;AAKA;EACI,YAAA;EACA,aAAA;EACA,wBAAA;AAFJ;;AAKA;EACI,mBAAA;AAFJ;;AAKA;EACI,WAAA;EACA,cAAA;AAFJ;AAII;EACI,6CAAA;AAFR;AAIQ;EACI,WAAA;EACA,cAAA;AAFZ;AAKQ;EACI,WAAA;EACA,cAAA;EACA,4BAAA;AAHZ;;AAQA;EACI,WAAA;EACA,cAAA;AALJ;AAOI;EACI,6CAAA;AALR;AAOQ;EACI,WAAA;EACA,cAAA;EACA,iBAAA;AALZ;AAQQ;EACI,WAAA;EACA,cAAA;EACA,0BAAA;AANZ;;AAWA;EACI,kBAAA;EACA,iCAAA;EACA,aAAA;EACA,0CAAA;EACA,2BAAA;EACA,sBAAA;AARJ", sourcesContent: [`.hidden {\r
    display: none !important;\r
}\r
\r
.port {\r
    border-radius: 20px;\r
    width: 20px;\r
    height: 20px;\r
    align-self: center;\r
    display: grid;\r
    grid-template-columns: 100%;\r
    grid-template-rows: 100%;\r
\r
    .img {\r
        width: 100%;\r
    }\r
\r
    &:hover,\r
    &.selected {\r
        filter: brightness(2);\r
    }\r
}\r
\r
.portLine {\r
    height: 24px;\r
    display: grid;\r
    grid-template-rows: 100%;\r
}\r
\r
.port-label {\r
    align-items: center;\r
}\r
\r
.inputsContainer {\r
    grid-row: 1;\r
    grid-column: 1;\r
\r
    .portLine {\r
        grid-template-columns: 12px calc(100% - 15px);\r
\r
        .port-label {\r
            grid-row: 1;\r
            grid-column: 2;\r
        }\r
\r
        .port {\r
            grid-row: 1;\r
            grid-column: 1;\r
            transform: translateX(-12px);\r
        }\r
    }\r
}\r
\r
.outputsContainer {\r
    grid-row: 1;\r
    grid-column: 2;\r
\r
    .portLine {\r
        grid-template-columns: calc(100% - 10px) 12px;\r
\r
        .port-label {\r
            grid-row: 1;\r
            grid-column: 1;\r
            text-align: right;\r
        }\r
\r
        .port {\r
            grid-row: 1;\r
            grid-column: 2;\r
            transform: translateX(2px);\r
        }\r
    }\r
}\r
\r
.frame-box {\r
    position: absolute;\r
    background: rgba(72, 72, 72, 0.7);\r
    display: grid;\r
    grid-template-rows: 40px calc(100% - 40px);\r
    grid-template-columns: 100%;\r
    box-sizing: border-box;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              hidden: "---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__hidden",
              port: "---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port",
              img: "---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__img",
              selected: "---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__selected",
              portLine: "---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__portLine",
              "port-label": "---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__port-label",
              inputsContainer: "---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__inputsContainer",
              outputsContainer: "---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__outputsContainer",
              "frame-box": "---------dev-sharedUiComponents-dist-nodeGraphSystem-common-modules__frame-box"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphCanvas.modules.scss": (
          /*!**********************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphCanvas.modules.scss ***!
            \**********************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__graph-canvas {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font: 14px "acumin-pro";
  user-select: none;
  overflow: hidden;
  cursor: move;
  position: relative;
  background-image: linear-gradient(to right, #4f4e4f 1px, transparent 1px), linear-gradient(to bottom, #4f4e4f 1px, transparent 1px);
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__graph-container {
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  transform-origin: left top;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__frame-container {
  overflow: visible;
  grid-row: 1;
  grid-column: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__graph-svg-container {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(7px 6px 2px rgba(0, 0, 0, 0.2));
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__graph-canvas-container {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__selection-container {
  pointer-events: none;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__selection-box {
  z-index: 10;
  position: absolute;
  background: rgba(72, 72, 196, 0.5);
  border: blue solid 2px;
}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphCanvas.modules.scss"], names: [], mappings: "AAAA;EACI,WAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,uBAAA;EACA,iBAAA;EACA,gBAAA;EACA,YAAA;EACA,kBAAA;EACA,mIAAA;AACJ;;AAEA;EACI,WAAA;EACA,YAAA;EACA,OAAA;EACA,MAAA;EACA,0BAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;AACJ;;AAEA;EACI,iBAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;AACJ;;AAEA;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,oBAAA;EACA,UAAA;EACA,mDAAA;AACJ;;AAEA;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;AACJ;;AAEA;EACI,oBAAA;AACJ;;AAEA;EACI,WAAA;EACA,kBAAA;EACA,kCAAA;EACA,sBAAA;AACJ", sourcesContent: [`.graph-canvas {\r
    width: 100%;\r
    height: 100%;\r
    margin: 0;\r
    padding: 0;\r
    font: 14px "acumin-pro";\r
    user-select: none;\r
    overflow: hidden;\r
    cursor: move;\r
    position: relative;\r
    background-image: linear-gradient(to right, #4f4e4f 1px, transparent 1px), linear-gradient(to bottom, #4f4e4f 1px, transparent 1px);\r
}\r
\r
.graph-container {\r
    width: 100%;\r
    height: 100%;\r
    left: 0;\r
    top: 0;\r
    transform-origin: left top;\r
    display: grid;\r
    grid-template-rows: 100%;\r
    grid-template-columns: 100%;\r
}\r
\r
.frame-container {\r
    overflow: visible;\r
    grid-row: 1;\r
    grid-column: 1;\r
    position: relative;\r
    width: 100%;\r
    height: 100%;\r
}\r
\r
.graph-svg-container {\r
    grid-row: 1;\r
    grid-column: 1;\r
    position: relative;\r
    width: 100%;\r
    height: 100%;\r
    overflow: visible;\r
    pointer-events: none;\r
    z-index: 2;\r
    filter: drop-shadow(7px 6px 2px rgba(0, 0, 0, 0.2));\r
}\r
\r
.graph-canvas-container {\r
    grid-row: 1;\r
    grid-column: 1;\r
    position: relative;\r
    width: 100%;\r
    height: 100%;\r
}\r
\r
.selection-container {\r
    pointer-events: none;\r
}\r
\r
.selection-box {\r
    z-index: 10;\r
    position: absolute;\r
    background: rgba(72, 72, 196, 0.5);\r
    border: blue solid 2px;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              "graph-canvas": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__graph-canvas",
              "graph-container": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__graph-container",
              "frame-container": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__frame-container",
              "graph-svg-container": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__graph-svg-container",
              "graph-canvas-container": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__graph-canvas-container",
              "selection-container": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__selection-container",
              "selection-box": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphCanvas-modules__selection-box"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.modules.scss": (
          /*!*********************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.modules.scss ***!
            \*********************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__port-container {
  margin-top: 6px;
  margin-bottom: 6px;
  margin-left: 4px;
  margin-right: 4px;
  color: white;
  grid-row: 2;
  grid-column: 1;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 50% 50%;
  z-index: 2;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-border {
  grid-row: 1/span 2;
  grid-column: 1;
  width: 100%;
  height: 100%;
  border: transparent solid 4px;
  pointer-events: none;
  box-sizing: border-box;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-comments {
  display: grid;
  grid-row: 2;
  grid-column: 1;
  padding: 0 10px;
  font-style: italic;
  word-wrap: break-word;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__selected.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-border {
  border-color: white;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header {
  grid-row: 1;
  grid-column: 1;
  background: rgb(72, 72, 72);
  color: white;
  text-align: center;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: calc(100% - 74px) 30px 7px 30px 7px;
  align-content: center;
  overflow: hidden;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header-button {
  cursor: pointer;
  align-self: center;
  transform-origin: 50% 50%;
  transform: scale(1);
  stroke: transparent;
  fill: white;
  display: grid;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header-button.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__down {
  transform: scale(0.9);
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header-collapse {
  grid-column: 2;
  grid-row: 1;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header-close {
  grid-column: 4;
  grid-row: 1;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header-title {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  height: 100%;
  width: 100%;
  align-self: stretch;
  align-items: center;
  margin-top: -2px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__right-handle {
  grid-area: 1/2/3/2;
  width: 4px;
  background-color: transparent;
  cursor: ew-resize;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__right-handle::after {
  content: "";
  width: 8px;
  position: absolute;
  top: 0;
  bottom: 0;
  margin-left: -4px;
  cursor: ew-resize;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__top-right-corner-handle {
  background-color: transparent;
  height: 4px;
  z-index: 21;
  cursor: ne-resize;
  width: 4px;
  margin-left: -6px;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__top-right-corner-handle::after {
  background-color: transparent;
  cursor: ne-resize;
  margin-left: unset;
  top: -4px;
  height: 10px;
  width: 10px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__bottom-right-corner-handle {
  background-color: transparent;
  height: 0px;
  z-index: 21;
  cursor: nw-resize;
  grid-area: 4/2/4/2;
  margin-left: -2px;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__bottom-right-corner-handle::after {
  background-color: transparent;
  height: 10px;
  cursor: nw-resize;
  top: unset;
  bottom: -4px;
  width: 10px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__left-handle {
  grid-area: 1/1/3/1;
  width: 4px;
  background-color: transparent;
  cursor: ew-resize;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__left-handle::before {
  content: "";
  width: 8px;
  position: absolute;
  top: 0;
  bottom: 0;
  margin-left: -4px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__top-left-corner-handle {
  background-color: transparent;
  height: 4px;
  z-index: 21;
  cursor: nw-resize;
  width: 4px;
  margin-left: -4px;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__top-left-corner-handle::before {
  background-color: transparent;
  cursor: nw-resize;
  margin-left: unset;
  top: -4px;
  height: 10px;
  width: 10px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__bottom-left-corner-handle {
  background-color: transparent;
  height: 0px;
  z-index: 21;
  cursor: sw-resize;
  grid-area: 4/1/4/1;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__bottom-left-corner-handle::before {
  background-color: transparent;
  height: 10px;
  cursor: sw-resize;
  top: unset;
  bottom: -4px;
  width: 10px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__top-handle {
  grid-area: 1/1/1/1;
  background-color: transparent;
  height: 4px;
  cursor: ns-resize;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__top-handle::before {
  content: "";
  width: 100%;
  position: absolute;
  top: -4px;
  bottom: 100%;
  right: 0;
  left: 0;
  margin-bottom: -8px;
  cursor: ns-resize;
  height: 8px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__bottom-handle {
  grid-area: 3/1/3/1;
  background-color: transparent;
  height: 4px;
  cursor: ns-resize;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__bottom-handle::after {
  content: "";
  width: 100%;
  position: absolute;
  top: 100%;
  bottom: 0;
  right: 0;
  left: 0;
  margin-top: -8px;
  cursor: ns-resize;
  height: 12px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__expanded {
  font-size: 24px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__collapsed {
  height: auto !important;
  width: 200px !important;
  z-index: 3;
  font-size: 16px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__collapsedHeader {
  grid-template-columns: calc(100% - 37px) 30px 7px;
}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.modules.scss"], names: [], mappings: "AAAA;EACI,eAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,YAAA;EACA,WAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,8BAAA;EACA,UAAA;AACJ;;AAEA;EACI,kBAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,6BAAA;EACA,oBAAA;EACA,sBAAA;AACJ;;AAEA;EACI,aAAA;EACA,WAAA;EACA,cAAA;EACA,eAAA;EACA,kBAAA;EACA,qBAAA;AACJ;;AAEA;EACI,mBAAA;AACJ;;AAEA;EACI,WAAA;EACA,cAAA;EACA,2BAAA;EACA,YAAA;EACA,kBAAA;EACA,aAAA;EACA,wBAAA;EACA,0DAAA;EACA,qBAAA;EACA,gBAAA;AACJ;;AAEA;EACI,eAAA;EACA,kBAAA;EACA,yBAAA;EACA,mBAAA;EACA,mBAAA;EACA,WAAA;EACA,aAAA;AACJ;AACI;EACI,qBAAA;AACR;;AAGA;EACI,cAAA;EACA,WAAA;AAAJ;;AAGA;EACI,cAAA;EACA,WAAA;AAAJ;;AAGA;EACI,cAAA;EACA,WAAA;EACA,aAAA;EACA,YAAA;EACA,WAAA;EACA,mBAAA;EACA,mBAAA;EACA,gBAAA;AAAJ;;AAGA;EACI,kBAAA;EACA,UAAA;EACA,6BAAA;EACA,iBAAA;AAAJ;AAEI;EACI,WAAA;EACA,UAAA;EACA,kBAAA;EACA,MAAA;EACA,SAAA;EACA,iBAAA;EACA,iBAAA;AAAR;;AAIA;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,UAAA;EACA,iBAAA;AADJ;AAGI;EACI,6BAAA;EACA,iBAAA;EACA,kBAAA;EACA,SAAA;EACA,YAAA;EACA,WAAA;AADR;;AAKA;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;EACA,iBAAA;AAFJ;AAII;EACI,6BAAA;EACA,YAAA;EACA,iBAAA;EACA,UAAA;EACA,YAAA;EACA,WAAA;AAFR;;AAMA;EACI,kBAAA;EACA,UAAA;EACA,6BAAA;EACA,iBAAA;AAHJ;AAKI;EACI,WAAA;EACA,UAAA;EACA,kBAAA;EACA,MAAA;EACA,SAAA;EACA,iBAAA;AAHR;;AAOA;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,UAAA;EACA,iBAAA;AAJJ;AAMI;EACI,6BAAA;EACA,iBAAA;EACA,kBAAA;EACA,SAAA;EACA,YAAA;EACA,WAAA;AAJR;;AAQA;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;AALJ;AAOI;EACI,6BAAA;EACA,YAAA;EACA,iBAAA;EACA,UAAA;EACA,YAAA;EACA,WAAA;AALR;;AASA;EACI,kBAAA;EACA,6BAAA;EACA,WAAA;EACA,iBAAA;AANJ;AAQI;EACI,WAAA;EACA,WAAA;EACA,kBAAA;EACA,SAAA;EACA,YAAA;EACA,QAAA;EACA,OAAA;EACA,mBAAA;EACA,iBAAA;EACA,WAAA;AANR;;AAUA;EACI,kBAAA;EACA,6BAAA;EACA,WAAA;EACA,iBAAA;AAPJ;AASI;EACI,WAAA;EACA,WAAA;EACA,kBAAA;EACA,SAAA;EACA,SAAA;EACA,QAAA;EACA,OAAA;EACA,gBAAA;EACA,iBAAA;EACA,YAAA;AAPR;;AAWA;EACI,eAAA;AARJ;;AAWA;EACI,uBAAA;EACA,uBAAA;EACA,UAAA;EACA,eAAA;AARJ;;AAWA;EACI,iDAAA;AARJ", sourcesContent: [`.port-container {\r
    margin-top: 6px;\r
    margin-bottom: 6px;\r
    margin-left: 4px;\r
    margin-right: 4px;\r
    color: white;\r
    grid-row: 2;\r
    grid-column: 1;\r
    display: grid;\r
    grid-template-rows: 100%;\r
    grid-template-columns: 50% 50%;\r
    z-index: 2;\r
}\r
\r
.frame-box-border {\r
    grid-row: 1 / span 2;\r
    grid-column: 1;\r
    width: 100%;\r
    height: 100%;\r
    border: transparent solid 4px;\r
    pointer-events: none;\r
    box-sizing: border-box;\r
}\r
\r
.frame-comments {\r
    display: grid;\r
    grid-row: 2;\r
    grid-column: 1;\r
    padding: 0 10px;\r
    font-style: italic;\r
    word-wrap: break-word;\r
}\r
\r
.selected.frame-box-border {\r
    border-color: white;\r
}\r
\r
.frame-box-header {\r
    grid-row: 1;\r
    grid-column: 1;\r
    background: rgba(72, 72, 72, 1);\r
    color: white;\r
    text-align: center;\r
    display: grid;\r
    grid-template-rows: 100%;\r
    grid-template-columns: calc(100% - 74px) 30px 7px 30px 7px;\r
    align-content: center;\r
    overflow: hidden;\r
}\r
\r
.frame-box-header-button {\r
    cursor: pointer;\r
    align-self: center;\r
    transform-origin: 50% 50%;\r
    transform: scale(1);\r
    stroke: transparent;\r
    fill: white;\r
    display: grid;\r
\r
    &.down {\r
        transform: scale(0.9);\r
    }\r
}\r
\r
.frame-box-header-collapse {\r
    grid-column: 2;\r
    grid-row: 1;\r
}\r
\r
.frame-box-header-close {\r
    grid-column: 4;\r
    grid-row: 1;\r
}\r
\r
.frame-box-header-title {\r
    grid-column: 1;\r
    grid-row: 1;\r
    display: grid;\r
    height: 100%;\r
    width: 100%;\r
    align-self: stretch;\r
    align-items: center;\r
    margin-top: -2px;\r
}\r
\r
.right-handle {\r
    grid-area: 1 / 2 / 3 / 2;\r
    width: 4px;\r
    background-color: transparent;\r
    cursor: ew-resize;\r
\r
    &::after {\r
        content: "";\r
        width: 8px;\r
        position: absolute;\r
        top: 0;\r
        bottom: 0;\r
        margin-left: -4px;\r
        cursor: ew-resize;\r
    }\r
}\r
\r
.top-right-corner-handle {\r
    background-color: transparent;\r
    height: 4px;\r
    z-index: 21;\r
    cursor: ne-resize;\r
    width: 4px;\r
    margin-left: -6px;\r
\r
    &::after {\r
        background-color: transparent;\r
        cursor: ne-resize;\r
        margin-left: unset;\r
        top: -4px;\r
        height: 10px;\r
        width: 10px;\r
    }\r
}\r
\r
.bottom-right-corner-handle {\r
    background-color: transparent;\r
    height: 0px;\r
    z-index: 21;\r
    cursor: nw-resize;\r
    grid-area: 4 / 2 / 4 / 2;\r
    margin-left: -2px;\r
\r
    &::after {\r
        background-color: transparent;\r
        height: 10px;\r
        cursor: nw-resize;\r
        top: unset;\r
        bottom: -4px;\r
        width: 10px;\r
    }\r
}\r
\r
.left-handle {\r
    grid-area: 1 / 1 / 3 / 1;\r
    width: 4px;\r
    background-color: transparent;\r
    cursor: ew-resize;\r
\r
    &::before {\r
        content: "";\r
        width: 8px;\r
        position: absolute;\r
        top: 0;\r
        bottom: 0;\r
        margin-left: -4px;\r
    }\r
}\r
\r
.top-left-corner-handle {\r
    background-color: transparent;\r
    height: 4px;\r
    z-index: 21;\r
    cursor: nw-resize;\r
    width: 4px;\r
    margin-left: -4px;\r
\r
    &::before {\r
        background-color: transparent;\r
        cursor: nw-resize;\r
        margin-left: unset;\r
        top: -4px;\r
        height: 10px;\r
        width: 10px;\r
    }\r
}\r
\r
.bottom-left-corner-handle {\r
    background-color: transparent;\r
    height: 0px;\r
    z-index: 21;\r
    cursor: sw-resize;\r
    grid-area: 4 / 1 / 4 / 1;\r
\r
    &::before {\r
        background-color: transparent;\r
        height: 10px;\r
        cursor: sw-resize;\r
        top: unset;\r
        bottom: -4px;\r
        width: 10px;\r
    }\r
}\r
\r
.top-handle {\r
    grid-area: 1 / 1 / 1 / 1;\r
    background-color: transparent;\r
    height: 4px;\r
    cursor: ns-resize;\r
\r
    &::before {\r
        content: "";\r
        width: 100%;\r
        position: absolute;\r
        top: -4px;\r
        bottom: 100%;\r
        right: 0;\r
        left: 0;\r
        margin-bottom: -8px;\r
        cursor: ns-resize;\r
        height: 8px;\r
    }\r
}\r
\r
.bottom-handle {\r
    grid-area: 3 / 1 / 3 / 1;\r
    background-color: transparent;\r
    height: 4px;\r
    cursor: ns-resize;\r
\r
    &::after {\r
        content: "";\r
        width: 100%;\r
        position: absolute;\r
        top: 100%;\r
        bottom: 0;\r
        right: 0;\r
        left: 0;\r
        margin-top: -8px;\r
        cursor: ns-resize;\r
        height: 12px;\r
    }\r
}\r
\r
.expanded {\r
    font-size: 24px;\r
}\r
\r
.collapsed {\r
    height: auto !important;\r
    width: 200px !important;\r
    z-index: 3;\r
    font-size: 16px;\r
}\r
\r
.collapsedHeader {\r
    grid-template-columns: calc(100% - 37px) 30px 7px;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              "port-container": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__port-container",
              "frame-box-border": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-border",
              "frame-comments": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-comments",
              selected: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__selected",
              "frame-box-header": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header",
              "frame-box-header-button": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header-button",
              down: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__down",
              "frame-box-header-collapse": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header-collapse",
              "frame-box-header-close": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header-close",
              "frame-box-header-title": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__frame-box-header-title",
              "right-handle": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__right-handle",
              "top-right-corner-handle": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__top-right-corner-handle",
              "bottom-right-corner-handle": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__bottom-right-corner-handle",
              "left-handle": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__left-handle",
              "top-left-corner-handle": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__top-left-corner-handle",
              "bottom-left-corner-handle": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__bottom-left-corner-handle",
              "top-handle": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__top-handle",
              "bottom-handle": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__bottom-handle",
              expanded: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__expanded",
              collapsed: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__collapsed",
              collapsedHeader: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphFrame-modules__collapsedHeader"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.modules.scss": (
          /*!********************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.modules.scss ***!
            \********************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__visual {
  z-index: 4;
  width: 200px;
  position: absolute;
  left: 0;
  top: 0;
  background: gray;
  border: 4px solid black;
  border-radius: 12px;
  display: grid;
  grid-template-rows: 30px auto;
  grid-template-columns: 100%;
  color: white;
  box-shadow: 7px 6px 2px rgba(0, 0, 0, 0.2);
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__highlighted {
  animation: \\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__glow 0.5s infinite alternate;
}
@keyframes \\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__glow {
  to {
    border-color: white;
  }
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__header-container {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  border: 4px solid black;
  border-top-right-radius: 7px;
  border-top-left-radius: 7px;
  background: black;
  color: white;
  transform: scaleX(1.01) translateY(-0.5px);
  transform-origin: center;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 100%;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__headerIcon {
  z-index: 10;
  align-self: center;
  user-select: none;
  pointer-events: none;
  width: 20px;
  display: grid;
  margin-left: 6px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__header {
  font-size: 16px;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__headerWithIcon {
  margin-left: calc(20px + 6px);
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__connections {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  grid-template-columns: 50% 50%;
  transform: scale(1);
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__content {
  min-height: 20px;
  grid-row: 3;
  grid-column: 1;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__comments {
  position: absolute;
  top: -50px;
  width: 200px;
  height: 45px;
  overflow: hidden;
  font-style: italic;
  opacity: 0.8;
  display: grid;
  align-items: flex-end;
  pointer-events: none;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__executionTime {
  position: absolute;
  bottom: 1px;
  width: 195px;
  height: 20px;
  overflow: hidden;
  font-size: 11px;
  opacity: 0.5;
  display: grid;
  align-items: flex-end;
  justify-content: end;
  pointer-events: none;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__selected {
  border-color: white !important;
}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.modules.scss"], names: [], mappings: "AAAA;EACI,UAAA;EACA,YAAA;EACA,kBAAA;EACA,OAAA;EACA,MAAA;EACA,gBAAA;EACA,uBAAA;EACA,mBAAA;EACA,aAAA;EACA,6BAAA;EACA,2BAAA;EACA,YAAA;EACA,0CAAA;AACJ;;AAEA;EAMI,gHAAA;AAJJ;AADI;EACI;IACI,mBAAA;EAGV;AACF;;AAEA;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,uBAAA;EACA,4BAAA;EACA,2BAAA;EACA,iBAAA;EACA,YAAA;EACA,0CAAA;EACA,wBAAA;EACA,aAAA;EACA,+BAAA;EACA,wBAAA;AACJ;;AAKA;EACI,WAAA;EACA,kBAAA;EACA,iBAAA;EACA,oBAAA;EACA,WARO;EASP,aAAA;EACA,gBATS;AAOb;;AAKA;EACI,eAAA;EACA,kBAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;AAFJ;;AAKA;EACI,6BAAA;AAFJ;;AAKA;EACI,WAAA;EACA,cAAA;EAEA,aAAA;EACA,8BAAA;EACA,mBAAA;AAHJ;;AAMA;EACI,gBAAA;EACA,WAAA;EACA,cAAA;AAHJ;;AAMA;EACI,kBAAA;EACA,UAAA;EACA,YAAA;EACA,YAAA;EACA,gBAAA;EACA,kBAAA;EACA,YAAA;EACA,aAAA;EACA,qBAAA;EACA,oBAAA;AAHJ;;AAMA;EACI,kBAAA;EACA,WAAA;EACA,YAAA;EACA,YAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;EACA,aAAA;EACA,qBAAA;EACA,oBAAA;EACA,oBAAA;AAHJ;;AAMA;EACI,8BAAA;AAHJ", sourcesContent: [`.visual {\r
    z-index: 4;\r
    width: 200px;\r
    position: absolute;\r
    left: 0;\r
    top: 0;\r
    background: gray;\r
    border: 4px solid black;\r
    border-radius: 12px;\r
    display: grid;\r
    grid-template-rows: 30px auto;\r
    grid-template-columns: 100%;\r
    color: white;\r
    box-shadow: 7px 6px 2px rgba(0, 0, 0, 0.2);\r
}\r
\r
.highlighted {\r
    @keyframes glow {\r
        to {\r
            border-color: white;\r
        }\r
    }\r
    animation: glow 0.5s infinite alternate;\r
}\r
\r
.header-container {\r
    grid-row: 1;\r
    grid-column: 1;\r
    position: relative;\r
    border: 4px solid black;\r
    border-top-right-radius: 7px;\r
    border-top-left-radius: 7px;\r
    background: black;\r
    color: white;\r
    transform: scaleX(1.01) translateY(-0.5px);\r
    transform-origin: center;\r
    display: grid;\r
    grid-template-columns: 1fr auto;\r
    grid-template-rows: 100%;\r
}\r
\r
$iconSize: 20px;\r
$iconMargin: 6px;\r
\r
.headerIcon {\r
    z-index: 10;\r
    align-self: center;\r
    user-select: none;\r
    pointer-events: none;\r
    width: $iconSize;\r
    display: grid;\r
    margin-left: $iconMargin;\r
}\r
\r
.header {\r
    font-size: 16px;\r
    text-align: center;\r
    white-space: nowrap;\r
    text-overflow: ellipsis;\r
    overflow: hidden;\r
}\r
\r
.headerWithIcon {\r
    margin-left: calc(#{$iconSize} + #{$iconMargin});\r
}\r
\r
.connections {\r
    grid-row: 2;\r
    grid-column: 1;\r
\r
    display: grid;\r
    grid-template-columns: 50% 50%;\r
    transform: scale(1);\r
}\r
\r
.content {\r
    min-height: 20px;\r
    grid-row: 3;\r
    grid-column: 1;\r
}\r
\r
.comments {\r
    position: absolute;\r
    top: -50px;\r
    width: 200px;\r
    height: 45px;\r
    overflow: hidden;\r
    font-style: italic;\r
    opacity: 0.8;\r
    display: grid;\r
    align-items: flex-end;\r
    pointer-events: none;\r
}\r
\r
.executionTime {\r
    position: absolute;\r
    bottom: 1px;\r
    width: 195px;\r
    height: 20px;\r
    overflow: hidden;\r
    font-size: 11px;\r
    opacity: 0.5;\r
    display: grid;\r
    align-items: flex-end;\r
    justify-content: end;\r
    pointer-events: none;\r
}\r
\r
.selected {\r
    border-color: white !important;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              visual: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__visual",
              highlighted: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__highlighted",
              glow: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__glow",
              "header-container": "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__header-container",
              headerIcon: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__headerIcon",
              header: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__header",
              headerWithIcon: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__headerWithIcon",
              connections: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__connections",
              content: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__content",
              comments: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__comments",
              executionTime: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__executionTime",
              selected: "---------dev-sharedUiComponents-dist-nodeGraphSystem-graphNode-modules__selected"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLink.modules.scss": (
          /*!*******************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLink.modules.scss ***!
            \*******************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__link {
  stroke-width: 4px;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__link.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__selected {
  stroke: white !important;
  stroke-dasharray: 10, 2;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__target-candidate {
  filter: brightness(1.5);
  stroke-width: 6px;
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__selection-link {
  pointer-events: all;
  stroke-width: 16px;
  opacity: 0;
  transition: opacity 75ms;
  stroke: transparent;
  cursor: pointer;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__selection-link:hover, .\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__selection-link.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__selected {
  stroke: white !important;
  opacity: 0.4;
}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLink.modules.scss"], names: [], mappings: "AAAA;EACI,iBAAA;AACJ;AAAI;EACI,wBAAA;EACA,uBAAA;AAER;;AAEA;EACI,uBAAA;EACA,iBAAA;AACJ;;AAEA;EACI,mBAAA;EACA,kBAAA;EACA,UAAA;EACA,wBAAA;EACA,mBAAA;EACA,eAAA;AACJ;AACI;EAEI,wBAAA;EACA,YAAA;AAAR", sourcesContent: [`.link {\r
    stroke-width: 4px;\r
    &.selected {\r
        stroke: white !important;\r
        stroke-dasharray: 10, 2;\r
    }\r
}\r
\r
.target-candidate {\r
    filter: brightness(1.5);\r
    stroke-width: 6px;\r
}\r
\r
.selection-link {\r
    pointer-events: all;\r
    stroke-width: 16px;\r
    opacity: 0;\r
    transition: opacity 75ms;\r
    stroke: transparent;\r
    cursor: pointer;\r
\r
    &:hover,\r
    &.selected {\r
        stroke: white !important;\r
        opacity: 0.4;\r
    }\r
}\r
`], sourceRoot: "" }]), P.locals = {
              link: "---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__link",
              selected: "---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__selected",
              "target-candidate": "---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__target-candidate",
              "selection-link": "---------dev-sharedUiComponents-dist-nodeGraphSystem-nodeLink-modules__selection-link"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.modules.scss": (
          /*!*******************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.modules.scss ***!
            \*******************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodePort-modules__selected {
  filter: brightness(2);
}

.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodePort-modules__pip {
  background: green;
  width: 6px;
  height: 6px;
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  justify-self: center;
  border-radius: 7px;
  border: 2px solid black;
}
.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodePort-modules__pip.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodePort-modules__hidden {
  display: none;
}

img {
  grid-row: 1;
  grid-column: 1;
}

img.\\---------dev-sharedUiComponents-dist-nodeGraphSystem-nodePort-modules__selected {
  box-shadow: 0 0 0 2px;
  border-radius: 50%;
}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.modules.scss"], names: [], mappings: "AAAA;EACI,qBAAA;AACJ;;AAEA;EACI,iBAAA;EACA,UAAA;EACA,WAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;EACA,oBAAA;EACA,kBAAA;EACA,uBAAA;AACJ;AACI;EACI,aAAA;AACR;;AAGA;EACI,WAAA;EACA,cAAA;AAAJ;;AAGA;EACI,qBAAA;EACA,kBAAA;AAAJ", sourcesContent: [`.selected {\r
    filter: brightness(2);\r
}\r
\r
.pip {\r
    background: green;\r
    width: 6px;\r
    height: 6px;\r
    grid-row: 1;\r
    grid-column: 1;\r
    align-self: center;\r
    justify-self: center;\r
    border-radius: 7px;\r
    border: 2px solid black;\r
\r
    &.hidden {\r
        display: none;\r
    }\r
}\r
\r
img {\r
    grid-row: 1;\r
    grid-column: 1;\r
}\r
\r
img.selected {\r
    box-shadow: 0 0 0 2px;\r
    border-radius: 50%;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              selected: "---------dev-sharedUiComponents-dist-nodeGraphSystem-nodePort-modules__selected",
              pip: "---------dev-sharedUiComponents-dist-nodeGraphSystem-nodePort-modules__pip",
              hidden: "---------dev-sharedUiComponents-dist-nodeGraphSystem-nodePort-modules__hidden"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/blockNodeData.modules.scss": (
          /*!**************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/blockNodeData.modules.scss ***!
            \**************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-blockNodeData-modules__hidden {
  display: none !important;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/blockNodeData.modules.scss"], names: [], mappings: "AAAA;EACI,wBAAA;AACJ", sourcesContent: [`.hidden {\r
    display: none !important;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              hidden: "---------tools-nodeEditor-dist-graphSystem-blockNodeData-modules__hidden"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/clampDisplayManager.modules.scss": (
          /*!****************************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/clampDisplayManager.modules.scss ***!
            \****************************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-display-clampDisplayManager-modules__clampBlock {
  grid-row: 2;
  height: 34px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin: 0 10px;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/display/clampDisplayManager.modules.scss"], names: [], mappings: "AAAA;EACI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;EACA,iBAAA;EACA,cAAA;AACJ", sourcesContent: [`.clampBlock {\r
    grid-row: 2;\r
    height: 34px;\r
    text-align: center;\r
    font-size: 18px;\r
    font-weight: bold;\r
    margin: 0 10px;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              clampBlock: "---------tools-nodeEditor-dist-graphSystem-display-clampDisplayManager-modules__clampBlock"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/common.modules.scss": (
          /*!***************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/common.modules.scss ***!
            \***************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-display-common-modules__texture-block {
  grid-row: 2;
  height: 140px;
  width: 140px;
  overflow: hidden;
  border-bottom-left-radius: 7px;
  border: black 4px solid;
  border-left: 0px;
  border-bottom: 0px;
}
.\\---------tools-nodeEditor-dist-graphSystem-display-common-modules__texture-block img {
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.\\---------tools-nodeEditor-dist-graphSystem-display-common-modules__texture-block img.\\---------tools-nodeEditor-dist-graphSystem-display-common-modules__empty {
  display: none;
}

.\\---------tools-nodeEditor-dist-graphSystem-display-common-modules__empty {
  display: none;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/display/common.modules.scss"], names: [], mappings: "AAAA;EACI,WAAA;EACA,aAAA;EACA,YAAA;EACA,gBAAA;EACA,8BAAA;EACA,uBAAA;EACA,gBAAA;EACA,kBAAA;AACJ;AACI;EACI,WAAA;EACA,YAAA;EACA,oBAAA;AACR;AACQ;EACI,aAAA;AACZ;;AAIA;EACI,aAAA;AADJ", sourcesContent: [`.texture-block {\r
    grid-row: 2;\r
    height: 140px;\r
    width: 140px;\r
    overflow: hidden;\r
    border-bottom-left-radius: 7px;\r
    border: black 4px solid;\r
    border-left: 0px;\r
    border-bottom: 0px;\r
\r
    img {\r
        width: 100%;\r
        height: 100%;\r
        pointer-events: none;\r
\r
        &.empty {\r
            display: none;\r
        }\r
    }\r
}\r
\r
.empty {\r
    display: none;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              "texture-block": "---------tools-nodeEditor-dist-graphSystem-display-common-modules__texture-block",
              empty: "---------tools-nodeEditor-dist-graphSystem-display-common-modules__empty"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/curveDisplayManager.modules.scss": (
          /*!****************************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/curveDisplayManager.modules.scss ***!
            \****************************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-display-curveDisplayManager-modules__curve-block {
  grid-row: 2;
  height: 34px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin: 0 10px;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/display/curveDisplayManager.modules.scss"], names: [], mappings: "AAAA;EACI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;EACA,iBAAA;EACA,cAAA;AACJ", sourcesContent: [`.curve-block {\r
    grid-row: 2;\r
    height: 34px;\r
    text-align: center;\r
    font-size: 18px;\r
    font-weight: bold;\r
    margin: 0 10px;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              "curve-block": "---------tools-nodeEditor-dist-graphSystem-display-curveDisplayManager-modules__curve-block"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.modules.scss": (
          /*!****************************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.modules.scss ***!
            \****************************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-display-elbowDisplayManager-modules__elbowBlock {
  width: 40px;
  grid-template-rows: 0px 40px 0px;
  border-radius: 40px;
  transform: translateY(-7px);
}

.\\---------tools-nodeEditor-dist-graphSystem-display-elbowDisplayManager-modules__hidden {
  display: none;
}

.\\---------tools-nodeEditor-dist-graphSystem-display-elbowDisplayManager-modules__translatedConnections {
  transform: translateY(7px);
}

.\\---------tools-nodeEditor-dist-graphSystem-display-elbowDisplayManager-modules__roundSelectionBorder {
  border-radius: 40px;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.modules.scss"], names: [], mappings: "AAAA;EACI,WAAA;EACA,gCAAA;EACA,mBAAA;EACA,2BAAA;AACJ;;AAEA;EACI,aAAA;AACJ;;AAEA;EACI,0BAAA;AACJ;;AAEA;EACI,mBAAA;AACJ", sourcesContent: [`.elbowBlock {\r
    width: 40px;\r
    grid-template-rows: 0px 40px 0px;\r
    border-radius: 40px;\r
    transform: translateY(-7px);\r
}\r
\r
.hidden {\r
    display: none;\r
}\r
\r
.translatedConnections {\r
    transform: translateY(7px);\r
}\r
\r
.roundSelectionBorder {\r
    border-radius: 40px;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              elbowBlock: "---------tools-nodeEditor-dist-graphSystem-display-elbowDisplayManager-modules__elbowBlock",
              hidden: "---------tools-nodeEditor-dist-graphSystem-display-elbowDisplayManager-modules__hidden",
              translatedConnections: "---------tools-nodeEditor-dist-graphSystem-display-elbowDisplayManager-modules__translatedConnections",
              roundSelectionBorder: "---------tools-nodeEditor-dist-graphSystem-display-elbowDisplayManager-modules__roundSelectionBorder"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/gradientDisplayManager.modules.scss": (
          /*!*******************************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/gradientDisplayManager.modules.scss ***!
            \*******************************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-display-gradientDisplayManager-modules__gradientBlock {
  grid-row: 2;
  height: 34px;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/display/gradientDisplayManager.modules.scss"], names: [], mappings: "AAAA;EACI,WAAA;EACA,YAAA;AACJ", sourcesContent: [`.gradientBlock {\r
    grid-row: 2;\r
    height: 34px;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              gradientBlock: "---------tools-nodeEditor-dist-graphSystem-display-gradientDisplayManager-modules__gradientBlock"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.modules.scss": (
          /*!**********************************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.modules.scss ***!
            \**********************************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-display-imageSourceDisplayManager-modules__image-source-block {
  margin-top: 5px;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.modules.scss"], names: [], mappings: "AAAA;EACI,eAAA;AACJ", sourcesContent: [`.image-source-block {\r
    margin-top: 5px;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              "image-source-block": "---------tools-nodeEditor-dist-graphSystem-display-imageSourceDisplayManager-modules__image-source-block"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/inputDisplayManager.modules.scss": (
          /*!****************************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/inputDisplayManager.modules.scss ***!
            \****************************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-display-inputDisplayManager-modules__input-block {
  grid-row: 2;
  min-height: 34px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin: 0 10px 5px;
  display: grid;
  align-content: center;
}
.\\---------tools-nodeEditor-dist-graphSystem-display-inputDisplayManager-modules__input-block.\\---------tools-nodeEditor-dist-graphSystem-display-inputDisplayManager-modules__small-font {
  font-size: 17px;
}

.\\---------tools-nodeEditor-dist-graphSystem-display-inputDisplayManager-modules__constant {
  border-color: #464348;
  background: #464348;
}

.\\---------tools-nodeEditor-dist-graphSystem-display-inputDisplayManager-modules__inspector {
  border-color: #66491b;
  background: #66491b;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/display/inputDisplayManager.modules.scss"], names: [], mappings: "AAAA;EACI,WAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;EACA,iBAAA;EACA,kBAAA;EACA,aAAA;EACA,qBAAA;AACJ;AACI;EACI,eAAA;AACR;;AAGA;EACI,qBAAA;EACA,mBAAA;AAAJ;;AAGA;EACI,qBAAA;EACA,mBAAA;AAAJ", sourcesContent: [`.input-block {\r
    grid-row: 2;\r
    min-height: 34px;\r
    text-align: center;\r
    font-size: 18px;\r
    font-weight: bold;\r
    margin: 0 10px 5px;\r
    display: grid;\r
    align-content: center;\r
\r
    &.small-font {\r
        font-size: 17px;\r
    }\r
}\r
\r
.constant {\r
    border-color: #464348;\r
    background: #464348;\r
}\r
\r
.inspector {\r
    border-color: #66491b;\r
    background: #66491b;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              "input-block": "---------tools-nodeEditor-dist-graphSystem-display-inputDisplayManager-modules__input-block",
              "small-font": "---------tools-nodeEditor-dist-graphSystem-display-inputDisplayManager-modules__small-font",
              constant: "---------tools-nodeEditor-dist-graphSystem-display-inputDisplayManager-modules__constant",
              inspector: "---------tools-nodeEditor-dist-graphSystem-display-inputDisplayManager-modules__inspector"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/remapDisplayManager.modules.scss": (
          /*!****************************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/remapDisplayManager.modules.scss ***!
            \****************************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-display-remapDisplayManager-modules__remap-block {
  height: 34px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin: 0 10px;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/display/remapDisplayManager.modules.scss"], names: [], mappings: "AAAA;EACI,YAAA;EACA,kBAAA;EACA,eAAA;EACA,iBAAA;EACA,cAAA;AACJ", sourcesContent: [`.remap-block {\r
    height: 34px;\r
    text-align: center;\r
    font-size: 18px;\r
    font-weight: bold;\r
    margin: 0 10px;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              "remap-block": "---------tools-nodeEditor-dist-graphSystem-display-remapDisplayManager-modules__remap-block"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/textureDisplayManager.modules.scss": (
          /*!******************************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/textureDisplayManager.modules.scss ***!
            \******************************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-display-textureDisplayManager-modules__regular-texture-block {
  margin-top: 80px;
}

.\\---------tools-nodeEditor-dist-graphSystem-display-textureDisplayManager-modules__reduced-texture-block {
  margin-top: 30px;
}

.\\---------tools-nodeEditor-dist-graphSystem-display-textureDisplayManager-modules__reflection-block {
  grid-row: 3 !important;
}

.\\---------tools-nodeEditor-dist-graphSystem-display-textureDisplayManager-modules__triplanar-texture-block {
  margin-top: 155px;
}

.\\---------tools-nodeEditor-dist-graphSystem-display-textureDisplayManager-modules__refraction-texture-block {
  margin-top: 80px;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/display/textureDisplayManager.modules.scss"], names: [], mappings: "AAAA;EACI,gBAAA;AACJ;;AAEA;EACI,gBAAA;AACJ;;AAEA;EACI,sBAAA;AACJ;;AAEA;EACI,iBAAA;AACJ;;AAEA;EACI,gBAAA;AACJ", sourcesContent: [`.regular-texture-block {\r
    margin-top: 80px;\r
}\r
\r
.reduced-texture-block {\r
    margin-top: 30px;\r
}\r
\r
.reflection-block {\r
    grid-row: 3 !important;\r
}\r
\r
.triplanar-texture-block {\r
    margin-top: 155px;\r
}\r
\r
.refraction-texture-block {\r
    margin-top: 80px;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              "regular-texture-block": "---------tools-nodeEditor-dist-graphSystem-display-textureDisplayManager-modules__regular-texture-block",
              "reduced-texture-block": "---------tools-nodeEditor-dist-graphSystem-display-textureDisplayManager-modules__reduced-texture-block",
              "reflection-block": "---------tools-nodeEditor-dist-graphSystem-display-textureDisplayManager-modules__reflection-block",
              "triplanar-texture-block": "---------tools-nodeEditor-dist-graphSystem-display-textureDisplayManager-modules__triplanar-texture-block",
              "refraction-texture-block": "---------tools-nodeEditor-dist-graphSystem-display-textureDisplayManager-modules__refraction-texture-block"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/trigonometryDisplayManager.modules.scss": (
          /*!***********************************************************************************************************************************************************************************************************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/trigonometryDisplayManager.modules.scss ***!
            \***********************************************************************************************************************************************************************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => p
              /* harmony export */
            });
            var d = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */
              "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */
              "../../../../node_modules/css-loader/dist/runtime/api.js"
            ), l = /* @__PURE__ */ o.n(u), P = l()(v());
            P.push([a.id, `.\\---------tools-nodeEditor-dist-graphSystem-display-trigonometryDisplayManager-modules__trigonometry-block {
  grid-row: 2;
  height: 34px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin: 0 10px;
}`, "", { version: 3, sources: ["webpack://./../../../tools/nodeEditor/dist/graphSystem/display/trigonometryDisplayManager.modules.scss"], names: [], mappings: "AAAA;EACI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;EACA,iBAAA;EACA,cAAA;AACJ", sourcesContent: [`.trigonometry-block {\r
    grid-row: 2;\r
    height: 34px;\r
    text-align: center;\r
    font-size: 18px;\r
    font-weight: bold;\r
    margin: 0 10px;\r
}\r
`], sourceRoot: "" }]), P.locals = {
              "trigonometry-block": "---------tools-nodeEditor-dist-graphSystem-display-trigonometryDisplayManager-modules__trigonometry-block"
            };
            const p = P;
          }
        ),
        /***/
        "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js": (
          /*!***************************************************************************!*\
            !*** ../../../../node_modules/@fortawesome/react-fontawesome/index.es.js ***!
            \***************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              FontAwesomeIcon: () => (
                /* binding */
                L
              )
              /* harmony export */
            });
            var d = o(
              /*! @fortawesome/fontawesome-svg-core */
              "../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs"
            ), v = o(
              /*! prop-types */
              "../../../../node_modules/prop-types/index.js"
            ), u = /* @__PURE__ */ o.n(v), l = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            function P(ae, Pe) {
              var ge = Object.keys(ae);
              if (Object.getOwnPropertySymbols) {
                var me = Object.getOwnPropertySymbols(ae);
                Pe && (me = me.filter(function(Xe) {
                  return Object.getOwnPropertyDescriptor(ae, Xe).enumerable;
                })), ge.push.apply(ge, me);
              }
              return ge;
            }
            function p(ae) {
              for (var Pe = 1; Pe < arguments.length; Pe++) {
                var ge = arguments[Pe] != null ? arguments[Pe] : {};
                Pe % 2 ? P(Object(ge), !0).forEach(function(me) {
                  H(ae, me, ge[me]);
                }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(ae, Object.getOwnPropertyDescriptors(ge)) : P(Object(ge)).forEach(function(me) {
                  Object.defineProperty(ae, me, Object.getOwnPropertyDescriptor(ge, me));
                });
              }
              return ae;
            }
            function c(ae) {
              "@babel/helpers - typeof";
              return c = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(Pe) {
                return typeof Pe;
              } : function(Pe) {
                return Pe && typeof Symbol == "function" && Pe.constructor === Symbol && Pe !== Symbol.prototype ? "symbol" : typeof Pe;
              }, c(ae);
            }
            function H(ae, Pe, ge) {
              return Pe in ae ? Object.defineProperty(ae, Pe, {
                value: ge,
                enumerable: !0,
                configurable: !0,
                writable: !0
              }) : ae[Pe] = ge, ae;
            }
            function T(ae, Pe) {
              if (ae == null)
                return {};
              var ge = {}, me = Object.keys(ae), Xe, De;
              for (De = 0; De < me.length; De++)
                Xe = me[De], !(Pe.indexOf(Xe) >= 0) && (ge[Xe] = ae[Xe]);
              return ge;
            }
            function q(ae, Pe) {
              if (ae == null)
                return {};
              var ge = T(ae, Pe), me, Xe;
              if (Object.getOwnPropertySymbols) {
                var De = Object.getOwnPropertySymbols(ae);
                for (Xe = 0; Xe < De.length; Xe++)
                  me = De[Xe], !(Pe.indexOf(me) >= 0) && Object.prototype.propertyIsEnumerable.call(ae, me) && (ge[me] = ae[me]);
              }
              return ge;
            }
            function b(ae) {
              return j(ae) || w(ae) || m(ae) || N();
            }
            function j(ae) {
              if (Array.isArray(ae))
                return I(ae);
            }
            function w(ae) {
              if (typeof Symbol < "u" && ae[Symbol.iterator] != null || ae["@@iterator"] != null)
                return Array.from(ae);
            }
            function m(ae, Pe) {
              if (ae) {
                if (typeof ae == "string")
                  return I(ae, Pe);
                var ge = Object.prototype.toString.call(ae).slice(8, -1);
                if (ge === "Object" && ae.constructor && (ge = ae.constructor.name), ge === "Map" || ge === "Set")
                  return Array.from(ae);
                if (ge === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ge))
                  return I(ae, Pe);
              }
            }
            function I(ae, Pe) {
              (Pe == null || Pe > ae.length) && (Pe = ae.length);
              for (var ge = 0, me = new Array(Pe); ge < Pe; ge++)
                me[ge] = ae[ge];
              return me;
            }
            function N() {
              throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
            }
            function k(ae) {
              var Pe, ge = ae.beat, me = ae.fade, Xe = ae.beatFade, De = ae.bounce, ne = ae.shake, re = ae.flash, ve = ae.spin, qe = ae.spinPulse, ke = ae.spinReverse, be = ae.pulse, Fe = ae.fixedWidth, Ke = ae.inverse, nt = ae.border, ut = ae.listItem, bt = ae.flip, wt = ae.size, Tt = ae.rotation, lr = ae.pull, Qt = (Pe = {
                "fa-beat": ge,
                "fa-fade": me,
                "fa-beat-fade": Xe,
                "fa-bounce": De,
                "fa-shake": ne,
                "fa-flash": re,
                "fa-spin": ve,
                "fa-spin-reverse": ke,
                "fa-spin-pulse": qe,
                "fa-pulse": be,
                "fa-fw": Fe,
                "fa-inverse": Ke,
                "fa-border": nt,
                "fa-li": ut,
                "fa-flip": bt === !0,
                "fa-flip-horizontal": bt === "horizontal" || bt === "both",
                "fa-flip-vertical": bt === "vertical" || bt === "both"
              }, H(Pe, "fa-".concat(wt), typeof wt < "u" && wt !== null), H(Pe, "fa-rotate-".concat(Tt), typeof Tt < "u" && Tt !== null && Tt !== 0), H(Pe, "fa-pull-".concat(lr), typeof lr < "u" && lr !== null), H(Pe, "fa-swap-opacity", ae.swapOpacity), Pe);
              return Object.keys(Qt).map(function(tr) {
                return Qt[tr] ? tr : null;
              }).filter(function(tr) {
                return tr;
              });
            }
            function R(ae) {
              return ae = ae - 0, ae === ae;
            }
            function y(ae) {
              return R(ae) ? ae : (ae = ae.replace(/[\-_\s]+(.)?/g, function(Pe, ge) {
                return ge ? ge.toUpperCase() : "";
              }), ae.substr(0, 1).toLowerCase() + ae.substr(1));
            }
            var O = ["style"];
            function Y(ae) {
              return ae.charAt(0).toUpperCase() + ae.slice(1);
            }
            function ee(ae) {
              return ae.split(";").map(function(Pe) {
                return Pe.trim();
              }).filter(function(Pe) {
                return Pe;
              }).reduce(function(Pe, ge) {
                var me = ge.indexOf(":"), Xe = y(ge.slice(0, me)), De = ge.slice(me + 1).trim();
                return Xe.startsWith("webkit") ? Pe[Y(Xe)] = De : Pe[Xe] = De, Pe;
              }, {});
            }
            function Z(ae, Pe) {
              var ge = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
              if (typeof Pe == "string")
                return Pe;
              var me = (Pe.children || []).map(function(ve) {
                return Z(ae, ve);
              }), Xe = Object.keys(Pe.attributes || {}).reduce(function(ve, qe) {
                var ke = Pe.attributes[qe];
                switch (qe) {
                  case "class":
                    ve.attrs.className = ke, delete Pe.attributes.class;
                    break;
                  case "style":
                    ve.attrs.style = ee(ke);
                    break;
                  default:
                    qe.indexOf("aria-") === 0 || qe.indexOf("data-") === 0 ? ve.attrs[qe.toLowerCase()] = ke : ve.attrs[y(qe)] = ke;
                }
                return ve;
              }, {
                attrs: {}
              }), De = ge.style, ne = De === void 0 ? {} : De, re = q(ge, O);
              return Xe.attrs.style = p(p({}, Xe.attrs.style), ne), ae.apply(void 0, [Pe.tag, p(p({}, Xe.attrs), re)].concat(b(me)));
            }
            var te = !1;
            try {
              te = !1;
            } catch {
            }
            function fe() {
              if (!te && console && typeof console.error == "function") {
                var ae;
                (ae = console).error.apply(ae, arguments);
              }
            }
            function _(ae) {
              if (ae && c(ae) === "object" && ae.prefix && ae.iconName && ae.icon)
                return ae;
              if (d.parse.icon)
                return d.parse.icon(ae);
              if (ae === null)
                return null;
              if (ae && c(ae) === "object" && ae.prefix && ae.iconName)
                return ae;
              if (Array.isArray(ae) && ae.length === 2)
                return {
                  prefix: ae[0],
                  iconName: ae[1]
                };
              if (typeof ae == "string")
                return {
                  prefix: "fas",
                  iconName: ae
                };
            }
            function G(ae, Pe) {
              return Array.isArray(Pe) && Pe.length > 0 || !Array.isArray(Pe) && Pe ? H({}, ae, Pe) : {};
            }
            var L = /* @__PURE__ */ l.forwardRef(function(ae, Pe) {
              var ge = ae.icon, me = ae.mask, Xe = ae.symbol, De = ae.className, ne = ae.title, re = ae.titleId, ve = ae.maskId, qe = _(ge), ke = G("classes", [].concat(b(k(ae)), b(De.split(" ")))), be = G("transform", typeof ae.transform == "string" ? d.parse.transform(ae.transform) : ae.transform), Fe = G("mask", _(me)), Ke = (0, d.icon)(qe, p(p(p(p({}, ke), be), Fe), {}, {
                symbol: Xe,
                title: ne,
                titleId: re,
                maskId: ve
              }));
              if (!Ke)
                return fe("Could not find icon", qe), null;
              var nt = Ke.abstract, ut = {
                ref: Pe
              };
              return Object.keys(ae).forEach(function(bt) {
                L.defaultProps.hasOwnProperty(bt) || (ut[bt] = ae[bt]);
              }), $(nt[0], ut);
            });
            L.displayName = "FontAwesomeIcon", L.propTypes = {
              beat: u().bool,
              border: u().bool,
              beatFade: u().bool,
              bounce: u().bool,
              className: u().string,
              fade: u().bool,
              flash: u().bool,
              mask: u().oneOfType([u().object, u().array, u().string]),
              maskId: u().string,
              fixedWidth: u().bool,
              inverse: u().bool,
              flip: u().oneOf([!0, !1, "horizontal", "vertical", "both"]),
              icon: u().oneOfType([u().object, u().array, u().string]),
              listItem: u().bool,
              pull: u().oneOf(["right", "left"]),
              pulse: u().bool,
              rotation: u().oneOf([0, 90, 180, 270]),
              shake: u().bool,
              size: u().oneOf(["2xs", "xs", "sm", "lg", "xl", "2xl", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x"]),
              spin: u().bool,
              spinPulse: u().bool,
              spinReverse: u().bool,
              symbol: u().oneOfType([u().bool, u().string]),
              title: u().string,
              titleId: u().string,
              transform: u().oneOfType([u().string, u().object]),
              swapOpacity: u().bool
            }, L.defaultProps = {
              border: !1,
              className: "",
              mask: null,
              maskId: null,
              fixedWidth: !1,
              inverse: !1,
              flip: !1,
              icon: null,
              listItem: !1,
              pull: null,
              pulse: !1,
              rotation: null,
              size: null,
              spin: !1,
              spinPulse: !1,
              spinReverse: !1,
              beat: !1,
              fade: !1,
              beatFade: !1,
              bounce: !1,
              shake: !1,
              symbol: !1,
              title: "",
              titleId: null,
              transform: null,
              swapOpacity: !1
            };
            var $ = Z.bind(null, l.createElement);
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/runtime/api.js": (
          /*!***************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/runtime/api.js ***!
            \***************************************************************/
          /***/
          (a) => {
            a.exports = function(f) {
              var o = [];
              return o.toString = function() {
                return this.map(function(v) {
                  var u = "", l = typeof v[5] < "u";
                  return v[4] && (u += "@supports (".concat(v[4], ") {")), v[2] && (u += "@media ".concat(v[2], " {")), l && (u += "@layer".concat(v[5].length > 0 ? " ".concat(v[5]) : "", " {")), u += f(v), l && (u += "}"), v[2] && (u += "}"), v[4] && (u += "}"), u;
                }).join("");
              }, o.i = function(v, u, l, P, p) {
                typeof v == "string" && (v = [[null, v, void 0]]);
                var c = {};
                if (l)
                  for (var H = 0; H < this.length; H++) {
                    var T = this[H][0];
                    T != null && (c[T] = !0);
                  }
                for (var q = 0; q < v.length; q++) {
                  var b = [].concat(v[q]);
                  l && c[b[0]] || (typeof p < "u" && (typeof b[5] > "u" || (b[1] = "@layer".concat(b[5].length > 0 ? " ".concat(b[5]) : "", " {").concat(b[1], "}")), b[5] = p), u && (b[2] && (b[1] = "@media ".concat(b[2], " {").concat(b[1], "}")), b[2] = u), P && (b[4] ? (b[1] = "@supports (".concat(b[4], ") {").concat(b[1], "}"), b[4] = P) : b[4] = "".concat(P)), o.push(b));
                }
              }, o;
            };
          }
        ),
        /***/
        "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js": (
          /*!**********************************************************************!*\
            !*** ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js ***!
            \**********************************************************************/
          /***/
          (a) => {
            a.exports = function(f) {
              var o = f[1], d = f[3];
              if (!d)
                return o;
              if (typeof btoa == "function") {
                var v = btoa(unescape(encodeURIComponent(JSON.stringify(d)))), u = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(v), l = "/*# ".concat(u, " */");
                return [o].concat([l]).join(`
`);
              }
              return [o].join(`
`);
            };
          }
        ),
        /***/
        "../../../../node_modules/dagre/index.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/dagre/index.js ***!
            \***********************************************/
          /***/
          (a, f, o) => {
            a.exports = {
              graphlib: o(
                /*! ./lib/graphlib */
                "../../../../node_modules/dagre/lib/graphlib.js"
              ),
              layout: o(
                /*! ./lib/layout */
                "../../../../node_modules/dagre/lib/layout.js"
              ),
              debug: o(
                /*! ./lib/debug */
                "../../../../node_modules/dagre/lib/debug.js"
              ),
              util: {
                time: o(
                  /*! ./lib/util */
                  "../../../../node_modules/dagre/lib/util.js"
                ).time,
                notime: o(
                  /*! ./lib/util */
                  "../../../../node_modules/dagre/lib/util.js"
                ).notime
              },
              version: o(
                /*! ./lib/version */
                "../../../../node_modules/dagre/lib/version.js"
              )
            };
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/acyclic.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/dagre/lib/acyclic.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./greedy-fas */
              "../../../../node_modules/dagre/lib/greedy-fas.js"
            );
            a.exports = {
              run: u,
              undo: P
            };
            function u(p) {
              var c = p.graph().acyclicer === "greedy" ? v(p, H(p)) : l(p);
              d.forEach(c, function(T) {
                var q = p.edge(T);
                p.removeEdge(T), q.forwardName = T.name, q.reversed = !0, p.setEdge(T.w, T.v, q, d.uniqueId("rev"));
              });
              function H(T) {
                return function(q) {
                  return T.edge(q).weight;
                };
              }
            }
            function l(p) {
              var c = [], H = {}, T = {};
              function q(b) {
                d.has(T, b) || (T[b] = !0, H[b] = !0, d.forEach(p.outEdges(b), function(j) {
                  d.has(H, j.w) ? c.push(j) : q(j.w);
                }), delete H[b]);
              }
              return d.forEach(p.nodes(), q), c;
            }
            function P(p) {
              d.forEach(p.edges(), function(c) {
                var H = p.edge(c);
                if (H.reversed) {
                  p.removeEdge(c);
                  var T = H.forwardName;
                  delete H.reversed, delete H.forwardName, p.setEdge(c.w, c.v, H, T);
                }
              });
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/add-border-segments.js": (
          /*!*****************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/add-border-segments.js ***!
            \*****************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/util.js"
            );
            a.exports = u;
            function u(P) {
              function p(c) {
                var H = P.children(c), T = P.node(c);
                if (H.length && d.forEach(H, p), d.has(T, "minRank")) {
                  T.borderLeft = [], T.borderRight = [];
                  for (var q = T.minRank, b = T.maxRank + 1; q < b; ++q)
                    l(P, "borderLeft", "_bl", c, T, q), l(P, "borderRight", "_br", c, T, q);
                }
              }
              d.forEach(P.children(), p);
            }
            function l(P, p, c, H, T, q) {
              var b = { width: 0, height: 0, rank: q, borderType: p }, j = T[p][q - 1], w = v.addDummyNode(P, "border", b, c);
              T[p][q] = w, P.setParent(w, H), j && P.setEdge(j, w, { weight: 1 });
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/coordinate-system.js": (
          /*!***************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/coordinate-system.js ***!
            \***************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            );
            a.exports = {
              adjust: v,
              undo: u
            };
            function v(q) {
              var b = q.graph().rankdir.toLowerCase();
              (b === "lr" || b === "rl") && l(q);
            }
            function u(q) {
              var b = q.graph().rankdir.toLowerCase();
              (b === "bt" || b === "rl") && p(q), (b === "lr" || b === "rl") && (H(q), l(q));
            }
            function l(q) {
              d.forEach(q.nodes(), function(b) {
                P(q.node(b));
              }), d.forEach(q.edges(), function(b) {
                P(q.edge(b));
              });
            }
            function P(q) {
              var b = q.width;
              q.width = q.height, q.height = b;
            }
            function p(q) {
              d.forEach(q.nodes(), function(b) {
                c(q.node(b));
              }), d.forEach(q.edges(), function(b) {
                var j = q.edge(b);
                d.forEach(j.points, c), d.has(j, "y") && c(j);
              });
            }
            function c(q) {
              q.y = -q.y;
            }
            function H(q) {
              d.forEach(q.nodes(), function(b) {
                T(q.node(b));
              }), d.forEach(q.edges(), function(b) {
                var j = q.edge(b);
                d.forEach(j.points, T), d.has(j, "x") && T(j);
              });
            }
            function T(q) {
              var b = q.x;
              q.x = q.y, q.y = b;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/data/list.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/dagre/lib/data/list.js ***!
            \*******************************************************/
          /***/
          (a) => {
            a.exports = f;
            function f() {
              var v = {};
              v._next = v._prev = v, this._sentinel = v;
            }
            f.prototype.dequeue = function() {
              var v = this._sentinel, u = v._prev;
              if (u !== v)
                return o(u), u;
            }, f.prototype.enqueue = function(v) {
              var u = this._sentinel;
              v._prev && v._next && o(v), v._next = u._next, u._next._prev = v, u._next = v, v._prev = u;
            }, f.prototype.toString = function() {
              for (var v = [], u = this._sentinel, l = u._prev; l !== u; )
                v.push(JSON.stringify(l, d)), l = l._prev;
              return "[" + v.join(", ") + "]";
            };
            function o(v) {
              v._prev._next = v._next, v._next._prev = v._prev, delete v._next, delete v._prev;
            }
            function d(v, u) {
              if (v !== "_next" && v !== "_prev")
                return u;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/debug.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/dagre/lib/debug.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/util.js"
            ), u = o(
              /*! ./graphlib */
              "../../../../node_modules/dagre/lib/graphlib.js"
            ).Graph;
            a.exports = {
              debugOrdering: l
            };
            function l(P) {
              var p = v.buildLayerMatrix(P), c = new u({ compound: !0, multigraph: !0 }).setGraph({});
              return d.forEach(P.nodes(), function(H) {
                c.setNode(H, { label: H }), c.setParent(H, "layer" + P.node(H).rank);
              }), d.forEach(P.edges(), function(H) {
                c.setEdge(H.v, H.w, {}, H.name);
              }), d.forEach(p, function(H, T) {
                var q = "layer" + T;
                c.setNode(q, { rank: "same" }), d.reduce(H, function(b, j) {
                  return c.setEdge(b, j, { style: "invis" }), j;
                });
              }), c;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/graphlib.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/dagre/lib/graphlib.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d;
            try {
              d = o(
                /*! graphlib */
                "../../../../node_modules/graphlib/index.js"
              );
            } catch {
            }
            d || (d = window.graphlib), a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/greedy-fas.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/dagre/lib/greedy-fas.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./graphlib */
              "../../../../node_modules/dagre/lib/graphlib.js"
            ).Graph, u = o(
              /*! ./data/list */
              "../../../../node_modules/dagre/lib/data/list.js"
            );
            a.exports = P;
            var l = d.constant(1);
            function P(q, b) {
              if (q.nodeCount() <= 1)
                return [];
              var j = H(q, b || l), w = p(j.graph, j.buckets, j.zeroIdx);
              return d.flatten(d.map(w, function(m) {
                return q.outEdges(m.v, m.w);
              }), !0);
            }
            function p(q, b, j) {
              for (var w = [], m = b[b.length - 1], I = b[0], N; q.nodeCount(); ) {
                for (; N = I.dequeue(); )
                  c(q, b, j, N);
                for (; N = m.dequeue(); )
                  c(q, b, j, N);
                if (q.nodeCount()) {
                  for (var k = b.length - 2; k > 0; --k)
                    if (N = b[k].dequeue(), N) {
                      w = w.concat(c(q, b, j, N, !0));
                      break;
                    }
                }
              }
              return w;
            }
            function c(q, b, j, w, m) {
              var I = m ? [] : void 0;
              return d.forEach(q.inEdges(w.v), function(N) {
                var k = q.edge(N), R = q.node(N.v);
                m && I.push({ v: N.v, w: N.w }), R.out -= k, T(b, j, R);
              }), d.forEach(q.outEdges(w.v), function(N) {
                var k = q.edge(N), R = N.w, y = q.node(R);
                y.in -= k, T(b, j, y);
              }), q.removeNode(w.v), I;
            }
            function H(q, b) {
              var j = new v(), w = 0, m = 0;
              d.forEach(q.nodes(), function(k) {
                j.setNode(k, { v: k, in: 0, out: 0 });
              }), d.forEach(q.edges(), function(k) {
                var R = j.edge(k.v, k.w) || 0, y = b(k), O = R + y;
                j.setEdge(k.v, k.w, O), m = Math.max(m, j.node(k.v).out += y), w = Math.max(w, j.node(k.w).in += y);
              });
              var I = d.range(m + w + 3).map(function() {
                return new u();
              }), N = w + 1;
              return d.forEach(j.nodes(), function(k) {
                T(I, N, j.node(k));
              }), { graph: j, buckets: I, zeroIdx: N };
            }
            function T(q, b, j) {
              j.out ? j.in ? q[j.out - j.in + b].enqueue(j) : q[q.length - 1].enqueue(j) : q[0].enqueue(j);
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/layout.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/dagre/lib/layout.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./acyclic */
              "../../../../node_modules/dagre/lib/acyclic.js"
            ), u = o(
              /*! ./normalize */
              "../../../../node_modules/dagre/lib/normalize.js"
            ), l = o(
              /*! ./rank */
              "../../../../node_modules/dagre/lib/rank/index.js"
            ), P = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/util.js"
            ).normalizeRanks, p = o(
              /*! ./parent-dummy-chains */
              "../../../../node_modules/dagre/lib/parent-dummy-chains.js"
            ), c = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/util.js"
            ).removeEmptyRanks, H = o(
              /*! ./nesting-graph */
              "../../../../node_modules/dagre/lib/nesting-graph.js"
            ), T = o(
              /*! ./add-border-segments */
              "../../../../node_modules/dagre/lib/add-border-segments.js"
            ), q = o(
              /*! ./coordinate-system */
              "../../../../node_modules/dagre/lib/coordinate-system.js"
            ), b = o(
              /*! ./order */
              "../../../../node_modules/dagre/lib/order/index.js"
            ), j = o(
              /*! ./position */
              "../../../../node_modules/dagre/lib/position/index.js"
            ), w = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/util.js"
            ), m = o(
              /*! ./graphlib */
              "../../../../node_modules/dagre/lib/graphlib.js"
            ).Graph;
            a.exports = I;
            function I(be, Fe) {
              var Ke = Fe && Fe.debugTiming ? w.time : w.notime;
              Ke("layout", function() {
                var nt = Ke("  buildLayoutGraph", function() {
                  return _(be);
                });
                Ke("  runLayout", function() {
                  N(nt, Ke);
                }), Ke("  updateInputGraph", function() {
                  k(be, nt);
                });
              });
            }
            function N(be, Fe) {
              Fe("    makeSpaceForEdgeLabels", function() {
                G(be);
              }), Fe("    removeSelfEdges", function() {
                ne(be);
              }), Fe("    acyclic", function() {
                v.run(be);
              }), Fe("    nestingGraph.run", function() {
                H.run(be);
              }), Fe("    rank", function() {
                l(w.asNonCompoundGraph(be));
              }), Fe("    injectEdgeLabelProxies", function() {
                L(be);
              }), Fe("    removeEmptyRanks", function() {
                c(be);
              }), Fe("    nestingGraph.cleanup", function() {
                H.cleanup(be);
              }), Fe("    normalizeRanks", function() {
                P(be);
              }), Fe("    assignRankMinMax", function() {
                $(be);
              }), Fe("    removeEdgeLabelProxies", function() {
                ae(be);
              }), Fe("    normalize.run", function() {
                u.run(be);
              }), Fe("    parentDummyChains", function() {
                p(be);
              }), Fe("    addBorderSegments", function() {
                T(be);
              }), Fe("    order", function() {
                b(be);
              }), Fe("    insertSelfEdges", function() {
                re(be);
              }), Fe("    adjustCoordinateSystem", function() {
                q.adjust(be);
              }), Fe("    position", function() {
                j(be);
              }), Fe("    positionSelfEdges", function() {
                ve(be);
              }), Fe("    removeBorderNodes", function() {
                De(be);
              }), Fe("    normalize.undo", function() {
                u.undo(be);
              }), Fe("    fixupEdgeLabelCoords", function() {
                me(be);
              }), Fe("    undoCoordinateSystem", function() {
                q.undo(be);
              }), Fe("    translateGraph", function() {
                Pe(be);
              }), Fe("    assignNodeIntersects", function() {
                ge(be);
              }), Fe("    reversePoints", function() {
                Xe(be);
              }), Fe("    acyclic.undo", function() {
                v.undo(be);
              });
            }
            function k(be, Fe) {
              d.forEach(be.nodes(), function(Ke) {
                var nt = be.node(Ke), ut = Fe.node(Ke);
                nt && (nt.x = ut.x, nt.y = ut.y, Fe.children(Ke).length && (nt.width = ut.width, nt.height = ut.height));
              }), d.forEach(be.edges(), function(Ke) {
                var nt = be.edge(Ke), ut = Fe.edge(Ke);
                nt.points = ut.points, d.has(ut, "x") && (nt.x = ut.x, nt.y = ut.y);
              }), be.graph().width = Fe.graph().width, be.graph().height = Fe.graph().height;
            }
            var R = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], y = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, O = ["acyclicer", "ranker", "rankdir", "align"], Y = ["width", "height"], ee = { width: 0, height: 0 }, Z = ["minlen", "weight", "width", "height", "labeloffset"], te = {
              minlen: 1,
              weight: 1,
              width: 0,
              height: 0,
              labeloffset: 10,
              labelpos: "r"
            }, fe = ["labelpos"];
            function _(be) {
              var Fe = new m({ multigraph: !0, compound: !0 }), Ke = ke(be.graph());
              return Fe.setGraph(d.merge(
                {},
                y,
                qe(Ke, R),
                d.pick(Ke, O)
              )), d.forEach(be.nodes(), function(nt) {
                var ut = ke(be.node(nt));
                Fe.setNode(nt, d.defaults(qe(ut, Y), ee)), Fe.setParent(nt, be.parent(nt));
              }), d.forEach(be.edges(), function(nt) {
                var ut = ke(be.edge(nt));
                Fe.setEdge(nt, d.merge(
                  {},
                  te,
                  qe(ut, Z),
                  d.pick(ut, fe)
                ));
              }), Fe;
            }
            function G(be) {
              var Fe = be.graph();
              Fe.ranksep /= 2, d.forEach(be.edges(), function(Ke) {
                var nt = be.edge(Ke);
                nt.minlen *= 2, nt.labelpos.toLowerCase() !== "c" && (Fe.rankdir === "TB" || Fe.rankdir === "BT" ? nt.width += nt.labeloffset : nt.height += nt.labeloffset);
              });
            }
            function L(be) {
              d.forEach(be.edges(), function(Fe) {
                var Ke = be.edge(Fe);
                if (Ke.width && Ke.height) {
                  var nt = be.node(Fe.v), ut = be.node(Fe.w), bt = { rank: (ut.rank - nt.rank) / 2 + nt.rank, e: Fe };
                  w.addDummyNode(be, "edge-proxy", bt, "_ep");
                }
              });
            }
            function $(be) {
              var Fe = 0;
              d.forEach(be.nodes(), function(Ke) {
                var nt = be.node(Ke);
                nt.borderTop && (nt.minRank = be.node(nt.borderTop).rank, nt.maxRank = be.node(nt.borderBottom).rank, Fe = d.max(Fe, nt.maxRank));
              }), be.graph().maxRank = Fe;
            }
            function ae(be) {
              d.forEach(be.nodes(), function(Fe) {
                var Ke = be.node(Fe);
                Ke.dummy === "edge-proxy" && (be.edge(Ke.e).labelRank = Ke.rank, be.removeNode(Fe));
              });
            }
            function Pe(be) {
              var Fe = Number.POSITIVE_INFINITY, Ke = 0, nt = Number.POSITIVE_INFINITY, ut = 0, bt = be.graph(), wt = bt.marginx || 0, Tt = bt.marginy || 0;
              function lr(Qt) {
                var tr = Qt.x, br = Qt.y, Xn = Qt.width, qr = Qt.height;
                Fe = Math.min(Fe, tr - Xn / 2), Ke = Math.max(Ke, tr + Xn / 2), nt = Math.min(nt, br - qr / 2), ut = Math.max(ut, br + qr / 2);
              }
              d.forEach(be.nodes(), function(Qt) {
                lr(be.node(Qt));
              }), d.forEach(be.edges(), function(Qt) {
                var tr = be.edge(Qt);
                d.has(tr, "x") && lr(tr);
              }), Fe -= wt, nt -= Tt, d.forEach(be.nodes(), function(Qt) {
                var tr = be.node(Qt);
                tr.x -= Fe, tr.y -= nt;
              }), d.forEach(be.edges(), function(Qt) {
                var tr = be.edge(Qt);
                d.forEach(tr.points, function(br) {
                  br.x -= Fe, br.y -= nt;
                }), d.has(tr, "x") && (tr.x -= Fe), d.has(tr, "y") && (tr.y -= nt);
              }), bt.width = Ke - Fe + wt, bt.height = ut - nt + Tt;
            }
            function ge(be) {
              d.forEach(be.edges(), function(Fe) {
                var Ke = be.edge(Fe), nt = be.node(Fe.v), ut = be.node(Fe.w), bt, wt;
                Ke.points ? (bt = Ke.points[0], wt = Ke.points[Ke.points.length - 1]) : (Ke.points = [], bt = ut, wt = nt), Ke.points.unshift(w.intersectRect(nt, bt)), Ke.points.push(w.intersectRect(ut, wt));
              });
            }
            function me(be) {
              d.forEach(be.edges(), function(Fe) {
                var Ke = be.edge(Fe);
                if (d.has(Ke, "x"))
                  switch ((Ke.labelpos === "l" || Ke.labelpos === "r") && (Ke.width -= Ke.labeloffset), Ke.labelpos) {
                    case "l":
                      Ke.x -= Ke.width / 2 + Ke.labeloffset;
                      break;
                    case "r":
                      Ke.x += Ke.width / 2 + Ke.labeloffset;
                      break;
                  }
              });
            }
            function Xe(be) {
              d.forEach(be.edges(), function(Fe) {
                var Ke = be.edge(Fe);
                Ke.reversed && Ke.points.reverse();
              });
            }
            function De(be) {
              d.forEach(be.nodes(), function(Fe) {
                if (be.children(Fe).length) {
                  var Ke = be.node(Fe), nt = be.node(Ke.borderTop), ut = be.node(Ke.borderBottom), bt = be.node(d.last(Ke.borderLeft)), wt = be.node(d.last(Ke.borderRight));
                  Ke.width = Math.abs(wt.x - bt.x), Ke.height = Math.abs(ut.y - nt.y), Ke.x = bt.x + Ke.width / 2, Ke.y = nt.y + Ke.height / 2;
                }
              }), d.forEach(be.nodes(), function(Fe) {
                be.node(Fe).dummy === "border" && be.removeNode(Fe);
              });
            }
            function ne(be) {
              d.forEach(be.edges(), function(Fe) {
                if (Fe.v === Fe.w) {
                  var Ke = be.node(Fe.v);
                  Ke.selfEdges || (Ke.selfEdges = []), Ke.selfEdges.push({ e: Fe, label: be.edge(Fe) }), be.removeEdge(Fe);
                }
              });
            }
            function re(be) {
              var Fe = w.buildLayerMatrix(be);
              d.forEach(Fe, function(Ke) {
                var nt = 0;
                d.forEach(Ke, function(ut, bt) {
                  var wt = be.node(ut);
                  wt.order = bt + nt, d.forEach(wt.selfEdges, function(Tt) {
                    w.addDummyNode(be, "selfedge", {
                      width: Tt.label.width,
                      height: Tt.label.height,
                      rank: wt.rank,
                      order: bt + ++nt,
                      e: Tt.e,
                      label: Tt.label
                    }, "_se");
                  }), delete wt.selfEdges;
                });
              });
            }
            function ve(be) {
              d.forEach(be.nodes(), function(Fe) {
                var Ke = be.node(Fe);
                if (Ke.dummy === "selfedge") {
                  var nt = be.node(Ke.e.v), ut = nt.x + nt.width / 2, bt = nt.y, wt = Ke.x - ut, Tt = nt.height / 2;
                  be.setEdge(Ke.e, Ke.label), be.removeNode(Fe), Ke.label.points = [
                    { x: ut + 2 * wt / 3, y: bt - Tt },
                    { x: ut + 5 * wt / 6, y: bt - Tt },
                    { x: ut + wt, y: bt },
                    { x: ut + 5 * wt / 6, y: bt + Tt },
                    { x: ut + 2 * wt / 3, y: bt + Tt }
                  ], Ke.label.x = Ke.x, Ke.label.y = Ke.y;
                }
              });
            }
            function qe(be, Fe) {
              return d.mapValues(d.pick(be, Fe), Number);
            }
            function ke(be) {
              var Fe = {};
              return d.forEach(be, function(Ke, nt) {
                Fe[nt.toLowerCase()] = Ke;
              }), Fe;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/lodash.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/dagre/lib/lodash.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d;
            try {
              d = {
                cloneDeep: o(
                  /*! lodash/cloneDeep */
                  "../../../../node_modules/lodash/cloneDeep.js"
                ),
                constant: o(
                  /*! lodash/constant */
                  "../../../../node_modules/lodash/constant.js"
                ),
                defaults: o(
                  /*! lodash/defaults */
                  "../../../../node_modules/lodash/defaults.js"
                ),
                each: o(
                  /*! lodash/each */
                  "../../../../node_modules/lodash/each.js"
                ),
                filter: o(
                  /*! lodash/filter */
                  "../../../../node_modules/lodash/filter.js"
                ),
                find: o(
                  /*! lodash/find */
                  "../../../../node_modules/lodash/find.js"
                ),
                flatten: o(
                  /*! lodash/flatten */
                  "../../../../node_modules/lodash/flatten.js"
                ),
                forEach: o(
                  /*! lodash/forEach */
                  "../../../../node_modules/lodash/forEach.js"
                ),
                forIn: o(
                  /*! lodash/forIn */
                  "../../../../node_modules/lodash/forIn.js"
                ),
                has: o(
                  /*! lodash/has */
                  "../../../../node_modules/lodash/has.js"
                ),
                isUndefined: o(
                  /*! lodash/isUndefined */
                  "../../../../node_modules/lodash/isUndefined.js"
                ),
                last: o(
                  /*! lodash/last */
                  "../../../../node_modules/lodash/last.js"
                ),
                map: o(
                  /*! lodash/map */
                  "../../../../node_modules/lodash/map.js"
                ),
                mapValues: o(
                  /*! lodash/mapValues */
                  "../../../../node_modules/lodash/mapValues.js"
                ),
                max: o(
                  /*! lodash/max */
                  "../../../../node_modules/lodash/max.js"
                ),
                merge: o(
                  /*! lodash/merge */
                  "../../../../node_modules/lodash/merge.js"
                ),
                min: o(
                  /*! lodash/min */
                  "../../../../node_modules/lodash/min.js"
                ),
                minBy: o(
                  /*! lodash/minBy */
                  "../../../../node_modules/lodash/minBy.js"
                ),
                now: o(
                  /*! lodash/now */
                  "../../../../node_modules/lodash/now.js"
                ),
                pick: o(
                  /*! lodash/pick */
                  "../../../../node_modules/lodash/pick.js"
                ),
                range: o(
                  /*! lodash/range */
                  "../../../../node_modules/lodash/range.js"
                ),
                reduce: o(
                  /*! lodash/reduce */
                  "../../../../node_modules/lodash/reduce.js"
                ),
                sortBy: o(
                  /*! lodash/sortBy */
                  "../../../../node_modules/lodash/sortBy.js"
                ),
                uniqueId: o(
                  /*! lodash/uniqueId */
                  "../../../../node_modules/lodash/uniqueId.js"
                ),
                values: o(
                  /*! lodash/values */
                  "../../../../node_modules/lodash/values.js"
                ),
                zipObject: o(
                  /*! lodash/zipObject */
                  "../../../../node_modules/lodash/zipObject.js"
                )
              };
            } catch {
            }
            d || (d = window._), a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/nesting-graph.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/dagre/lib/nesting-graph.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/util.js"
            );
            a.exports = {
              run: u,
              cleanup: c
            };
            function u(H) {
              var T = v.addDummyNode(H, "root", {}, "_root"), q = P(H), b = d.max(d.values(q)) - 1, j = 2 * b + 1;
              H.graph().nestingRoot = T, d.forEach(H.edges(), function(m) {
                H.edge(m).minlen *= j;
              });
              var w = p(H) + 1;
              d.forEach(H.children(), function(m) {
                l(H, T, j, w, b, q, m);
              }), H.graph().nodeRankFactor = j;
            }
            function l(H, T, q, b, j, w, m) {
              var I = H.children(m);
              if (!I.length) {
                m !== T && H.setEdge(T, m, { weight: 0, minlen: q });
                return;
              }
              var N = v.addBorderNode(H, "_bt"), k = v.addBorderNode(H, "_bb"), R = H.node(m);
              H.setParent(N, m), R.borderTop = N, H.setParent(k, m), R.borderBottom = k, d.forEach(I, function(y) {
                l(H, T, q, b, j, w, y);
                var O = H.node(y), Y = O.borderTop ? O.borderTop : y, ee = O.borderBottom ? O.borderBottom : y, Z = O.borderTop ? b : 2 * b, te = Y !== ee ? 1 : j - w[m] + 1;
                H.setEdge(N, Y, {
                  weight: Z,
                  minlen: te,
                  nestingEdge: !0
                }), H.setEdge(ee, k, {
                  weight: Z,
                  minlen: te,
                  nestingEdge: !0
                });
              }), H.parent(m) || H.setEdge(T, N, { weight: 0, minlen: j + w[m] });
            }
            function P(H) {
              var T = {};
              function q(b, j) {
                var w = H.children(b);
                w && w.length && d.forEach(w, function(m) {
                  q(m, j + 1);
                }), T[b] = j;
              }
              return d.forEach(H.children(), function(b) {
                q(b, 1);
              }), T;
            }
            function p(H) {
              return d.reduce(H.edges(), function(T, q) {
                return T + H.edge(q).weight;
              }, 0);
            }
            function c(H) {
              var T = H.graph();
              H.removeNode(T.nestingRoot), delete T.nestingRoot, d.forEach(H.edges(), function(q) {
                var b = H.edge(q);
                b.nestingEdge && H.removeEdge(q);
              });
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/normalize.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/dagre/lib/normalize.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/util.js"
            );
            a.exports = {
              run: u,
              undo: P
            };
            function u(p) {
              p.graph().dummyChains = [], d.forEach(p.edges(), function(c) {
                l(p, c);
              });
            }
            function l(p, c) {
              var H = c.v, T = p.node(H).rank, q = c.w, b = p.node(q).rank, j = c.name, w = p.edge(c), m = w.labelRank;
              if (b !== T + 1) {
                p.removeEdge(c);
                var I, N, k;
                for (k = 0, ++T; T < b; ++k, ++T)
                  w.points = [], N = {
                    width: 0,
                    height: 0,
                    edgeLabel: w,
                    edgeObj: c,
                    rank: T
                  }, I = v.addDummyNode(p, "edge", N, "_d"), T === m && (N.width = w.width, N.height = w.height, N.dummy = "edge-label", N.labelpos = w.labelpos), p.setEdge(H, I, { weight: w.weight }, j), k === 0 && p.graph().dummyChains.push(I), H = I;
                p.setEdge(H, q, { weight: w.weight }, j);
              }
            }
            function P(p) {
              d.forEach(p.graph().dummyChains, function(c) {
                var H = p.node(c), T = H.edgeLabel, q;
                for (p.setEdge(H.edgeObj, T); H.dummy; )
                  q = p.successors(c)[0], p.removeNode(c), T.points.push({ x: H.x, y: H.y }), H.dummy === "edge-label" && (T.x = H.x, T.y = H.y, T.width = H.width, T.height = H.height), c = q, H = p.node(c);
              });
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/order/add-subgraph-constraints.js": (
          /*!****************************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/order/add-subgraph-constraints.js ***!
            \****************************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            );
            a.exports = v;
            function v(u, l, P) {
              var p = {}, c;
              d.forEach(P, function(H) {
                for (var T = u.parent(H), q, b; T; ) {
                  if (q = u.parent(T), q ? (b = p[q], p[q] = T) : (b = c, c = T), b && b !== T) {
                    l.setEdge(b, T);
                    return;
                  }
                  T = q;
                }
              });
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/order/barycenter.js": (
          /*!**************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/order/barycenter.js ***!
            \**************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            );
            a.exports = v;
            function v(u, l) {
              return d.map(l, function(P) {
                var p = u.inEdges(P);
                if (p.length) {
                  var c = d.reduce(p, function(H, T) {
                    var q = u.edge(T), b = u.node(T.v);
                    return {
                      sum: H.sum + q.weight * b.order,
                      weight: H.weight + q.weight
                    };
                  }, { sum: 0, weight: 0 });
                  return {
                    v: P,
                    barycenter: c.sum / c.weight,
                    weight: c.weight
                  };
                } else
                  return { v: P };
              });
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/order/build-layer-graph.js": (
          /*!*********************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/order/build-layer-graph.js ***!
            \*********************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ../graphlib */
              "../../../../node_modules/dagre/lib/graphlib.js"
            ).Graph;
            a.exports = u;
            function u(P, p, c) {
              var H = l(P), T = new v({ compound: !0 }).setGraph({ root: H }).setDefaultNodeLabel(function(q) {
                return P.node(q);
              });
              return d.forEach(P.nodes(), function(q) {
                var b = P.node(q), j = P.parent(q);
                (b.rank === p || b.minRank <= p && p <= b.maxRank) && (T.setNode(q), T.setParent(q, j || H), d.forEach(P[c](q), function(w) {
                  var m = w.v === q ? w.w : w.v, I = T.edge(m, q), N = d.isUndefined(I) ? 0 : I.weight;
                  T.setEdge(m, q, { weight: P.edge(w).weight + N });
                }), d.has(b, "minRank") && T.setNode(q, {
                  borderLeft: b.borderLeft[p],
                  borderRight: b.borderRight[p]
                }));
              }), T;
            }
            function l(P) {
              for (var p; P.hasNode(p = d.uniqueId("_root")); )
                ;
              return p;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/order/cross-count.js": (
          /*!***************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/order/cross-count.js ***!
            \***************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            );
            a.exports = v;
            function v(l, P) {
              for (var p = 0, c = 1; c < P.length; ++c)
                p += u(l, P[c - 1], P[c]);
              return p;
            }
            function u(l, P, p) {
              for (var c = d.zipObject(
                p,
                d.map(p, function(w, m) {
                  return m;
                })
              ), H = d.flatten(d.map(P, function(w) {
                return d.sortBy(d.map(l.outEdges(w), function(m) {
                  return { pos: c[m.w], weight: l.edge(m).weight };
                }), "pos");
              }), !0), T = 1; T < p.length; )
                T <<= 1;
              var q = 2 * T - 1;
              T -= 1;
              var b = d.map(new Array(q), function() {
                return 0;
              }), j = 0;
              return d.forEach(H.forEach(function(w) {
                var m = w.pos + T;
                b[m] += w.weight;
                for (var I = 0; m > 0; )
                  m % 2 && (I += b[m + 1]), m = m - 1 >> 1, b[m] += w.weight;
                j += w.weight * I;
              })), j;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/order/index.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/dagre/lib/order/index.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./init-order */
              "../../../../node_modules/dagre/lib/order/init-order.js"
            ), u = o(
              /*! ./cross-count */
              "../../../../node_modules/dagre/lib/order/cross-count.js"
            ), l = o(
              /*! ./sort-subgraph */
              "../../../../node_modules/dagre/lib/order/sort-subgraph.js"
            ), P = o(
              /*! ./build-layer-graph */
              "../../../../node_modules/dagre/lib/order/build-layer-graph.js"
            ), p = o(
              /*! ./add-subgraph-constraints */
              "../../../../node_modules/dagre/lib/order/add-subgraph-constraints.js"
            ), c = o(
              /*! ../graphlib */
              "../../../../node_modules/dagre/lib/graphlib.js"
            ).Graph, H = o(
              /*! ../util */
              "../../../../node_modules/dagre/lib/util.js"
            );
            a.exports = T;
            function T(w) {
              var m = H.maxRank(w), I = q(w, d.range(1, m + 1), "inEdges"), N = q(w, d.range(m - 1, -1, -1), "outEdges"), k = v(w);
              j(w, k);
              for (var R = Number.POSITIVE_INFINITY, y, O = 0, Y = 0; Y < 4; ++O, ++Y) {
                b(O % 2 ? I : N, O % 4 >= 2), k = H.buildLayerMatrix(w);
                var ee = u(w, k);
                ee < R && (Y = 0, y = d.cloneDeep(k), R = ee);
              }
              j(w, y);
            }
            function q(w, m, I) {
              return d.map(m, function(N) {
                return P(w, N, I);
              });
            }
            function b(w, m) {
              var I = new c();
              d.forEach(w, function(N) {
                var k = N.graph().root, R = l(N, k, I, m);
                d.forEach(R.vs, function(y, O) {
                  N.node(y).order = O;
                }), p(N, I, R.vs);
              });
            }
            function j(w, m) {
              d.forEach(m, function(I) {
                d.forEach(I, function(N, k) {
                  w.node(N).order = k;
                });
              });
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/order/init-order.js": (
          /*!**************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/order/init-order.js ***!
            \**************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            );
            a.exports = v;
            function v(u) {
              var l = {}, P = d.filter(u.nodes(), function(q) {
                return !u.children(q).length;
              }), p = d.max(d.map(P, function(q) {
                return u.node(q).rank;
              })), c = d.map(d.range(p + 1), function() {
                return [];
              });
              function H(q) {
                if (!d.has(l, q)) {
                  l[q] = !0;
                  var b = u.node(q);
                  c[b.rank].push(q), d.forEach(u.successors(q), H);
                }
              }
              var T = d.sortBy(P, function(q) {
                return u.node(q).rank;
              });
              return d.forEach(T, H), c;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/order/resolve-conflicts.js": (
          /*!*********************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/order/resolve-conflicts.js ***!
            \*********************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            );
            a.exports = v;
            function v(P, p) {
              var c = {};
              d.forEach(P, function(T, q) {
                var b = c[T.v] = {
                  indegree: 0,
                  in: [],
                  out: [],
                  vs: [T.v],
                  i: q
                };
                d.isUndefined(T.barycenter) || (b.barycenter = T.barycenter, b.weight = T.weight);
              }), d.forEach(p.edges(), function(T) {
                var q = c[T.v], b = c[T.w];
                !d.isUndefined(q) && !d.isUndefined(b) && (b.indegree++, q.out.push(c[T.w]));
              });
              var H = d.filter(c, function(T) {
                return !T.indegree;
              });
              return u(H);
            }
            function u(P) {
              var p = [];
              function c(q) {
                return function(b) {
                  b.merged || (d.isUndefined(b.barycenter) || d.isUndefined(q.barycenter) || b.barycenter >= q.barycenter) && l(q, b);
                };
              }
              function H(q) {
                return function(b) {
                  b.in.push(q), --b.indegree === 0 && P.push(b);
                };
              }
              for (; P.length; ) {
                var T = P.pop();
                p.push(T), d.forEach(T.in.reverse(), c(T)), d.forEach(T.out, H(T));
              }
              return d.map(
                d.filter(p, function(q) {
                  return !q.merged;
                }),
                function(q) {
                  return d.pick(q, ["vs", "i", "barycenter", "weight"]);
                }
              );
            }
            function l(P, p) {
              var c = 0, H = 0;
              P.weight && (c += P.barycenter * P.weight, H += P.weight), p.weight && (c += p.barycenter * p.weight, H += p.weight), P.vs = p.vs.concat(P.vs), P.barycenter = c / H, P.weight = H, P.i = Math.min(p.i, P.i), p.merged = !0;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/order/sort-subgraph.js": (
          /*!*****************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/order/sort-subgraph.js ***!
            \*****************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./barycenter */
              "../../../../node_modules/dagre/lib/order/barycenter.js"
            ), u = o(
              /*! ./resolve-conflicts */
              "../../../../node_modules/dagre/lib/order/resolve-conflicts.js"
            ), l = o(
              /*! ./sort */
              "../../../../node_modules/dagre/lib/order/sort.js"
            );
            a.exports = P;
            function P(H, T, q, b) {
              var j = H.children(T), w = H.node(T), m = w ? w.borderLeft : void 0, I = w ? w.borderRight : void 0, N = {};
              m && (j = d.filter(j, function(ee) {
                return ee !== m && ee !== I;
              }));
              var k = v(H, j);
              d.forEach(k, function(ee) {
                if (H.children(ee.v).length) {
                  var Z = P(H, ee.v, q, b);
                  N[ee.v] = Z, d.has(Z, "barycenter") && c(ee, Z);
                }
              });
              var R = u(k, q);
              p(R, N);
              var y = l(R, b);
              if (m && (y.vs = d.flatten([m, y.vs, I], !0), H.predecessors(m).length)) {
                var O = H.node(H.predecessors(m)[0]), Y = H.node(H.predecessors(I)[0]);
                d.has(y, "barycenter") || (y.barycenter = 0, y.weight = 0), y.barycenter = (y.barycenter * y.weight + O.order + Y.order) / (y.weight + 2), y.weight += 2;
              }
              return y;
            }
            function p(H, T) {
              d.forEach(H, function(q) {
                q.vs = d.flatten(q.vs.map(function(b) {
                  return T[b] ? T[b].vs : b;
                }), !0);
              });
            }
            function c(H, T) {
              d.isUndefined(H.barycenter) ? (H.barycenter = T.barycenter, H.weight = T.weight) : (H.barycenter = (H.barycenter * H.weight + T.barycenter * T.weight) / (H.weight + T.weight), H.weight += T.weight);
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/order/sort.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/dagre/lib/order/sort.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ../util */
              "../../../../node_modules/dagre/lib/util.js"
            );
            a.exports = u;
            function u(p, c) {
              var H = v.partition(p, function(N) {
                return d.has(N, "barycenter");
              }), T = H.lhs, q = d.sortBy(H.rhs, function(N) {
                return -N.i;
              }), b = [], j = 0, w = 0, m = 0;
              T.sort(P(!!c)), m = l(b, q, m), d.forEach(T, function(N) {
                m += N.vs.length, b.push(N.vs), j += N.barycenter * N.weight, w += N.weight, m = l(b, q, m);
              });
              var I = { vs: d.flatten(b, !0) };
              return w && (I.barycenter = j / w, I.weight = w), I;
            }
            function l(p, c, H) {
              for (var T; c.length && (T = d.last(c)).i <= H; )
                c.pop(), p.push(T.vs), H++;
              return H;
            }
            function P(p) {
              return function(c, H) {
                return c.barycenter < H.barycenter ? -1 : c.barycenter > H.barycenter ? 1 : p ? H.i - c.i : c.i - H.i;
              };
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/parent-dummy-chains.js": (
          /*!*****************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/parent-dummy-chains.js ***!
            \*****************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            );
            a.exports = v;
            function v(P) {
              var p = l(P);
              d.forEach(P.graph().dummyChains, function(c) {
                for (var H = P.node(c), T = H.edgeObj, q = u(P, p, T.v, T.w), b = q.path, j = q.lca, w = 0, m = b[w], I = !0; c !== T.w; ) {
                  if (H = P.node(c), I) {
                    for (; (m = b[w]) !== j && P.node(m).maxRank < H.rank; )
                      w++;
                    m === j && (I = !1);
                  }
                  if (!I) {
                    for (; w < b.length - 1 && P.node(m = b[w + 1]).minRank <= H.rank; )
                      w++;
                    m = b[w];
                  }
                  P.setParent(c, m), c = P.successors(c)[0];
                }
              });
            }
            function u(P, p, c, H) {
              var T = [], q = [], b = Math.min(p[c].low, p[H].low), j = Math.max(p[c].lim, p[H].lim), w, m;
              w = c;
              do
                w = P.parent(w), T.push(w);
              while (w && (p[w].low > b || j > p[w].lim));
              for (m = w, w = H; (w = P.parent(w)) !== m; )
                q.push(w);
              return { path: T.concat(q.reverse()), lca: m };
            }
            function l(P) {
              var p = {}, c = 0;
              function H(T) {
                var q = c;
                d.forEach(P.children(T), H), p[T] = { low: q, lim: c++ };
              }
              return d.forEach(P.children(), H), p;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/position/bk.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/dagre/lib/position/bk.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ../graphlib */
              "../../../../node_modules/dagre/lib/graphlib.js"
            ).Graph, u = o(
              /*! ../util */
              "../../../../node_modules/dagre/lib/util.js"
            );
            a.exports = {
              positionX: I,
              findType1Conflicts: l,
              findType2Conflicts: P,
              addConflict: c,
              hasConflict: H,
              verticalAlignment: T,
              horizontalCompaction: q,
              alignCoordinates: w,
              findSmallestWidthAlignment: j,
              balance: m
            };
            function l(R, y) {
              var O = {};
              function Y(ee, Z) {
                var te = 0, fe = 0, _ = ee.length, G = d.last(Z);
                return d.forEach(Z, function(L, $) {
                  var ae = p(R, L), Pe = ae ? R.node(ae).order : _;
                  (ae || L === G) && (d.forEach(Z.slice(fe, $ + 1), function(ge) {
                    d.forEach(R.predecessors(ge), function(me) {
                      var Xe = R.node(me), De = Xe.order;
                      (De < te || Pe < De) && !(Xe.dummy && R.node(ge).dummy) && c(O, me, ge);
                    });
                  }), fe = $ + 1, te = Pe);
                }), Z;
              }
              return d.reduce(y, Y), O;
            }
            function P(R, y) {
              var O = {};
              function Y(Z, te, fe, _, G) {
                var L;
                d.forEach(d.range(te, fe), function($) {
                  L = Z[$], R.node(L).dummy && d.forEach(R.predecessors(L), function(ae) {
                    var Pe = R.node(ae);
                    Pe.dummy && (Pe.order < _ || Pe.order > G) && c(O, ae, L);
                  });
                });
              }
              function ee(Z, te) {
                var fe = -1, _, G = 0;
                return d.forEach(te, function(L, $) {
                  if (R.node(L).dummy === "border") {
                    var ae = R.predecessors(L);
                    ae.length && (_ = R.node(ae[0]).order, Y(te, G, $, fe, _), G = $, fe = _);
                  }
                  Y(te, G, te.length, _, Z.length);
                }), te;
              }
              return d.reduce(y, ee), O;
            }
            function p(R, y) {
              if (R.node(y).dummy)
                return d.find(R.predecessors(y), function(O) {
                  return R.node(O).dummy;
                });
            }
            function c(R, y, O) {
              if (y > O) {
                var Y = y;
                y = O, O = Y;
              }
              var ee = R[y];
              ee || (R[y] = ee = {}), ee[O] = !0;
            }
            function H(R, y, O) {
              if (y > O) {
                var Y = y;
                y = O, O = Y;
              }
              return d.has(R[y], O);
            }
            function T(R, y, O, Y) {
              var ee = {}, Z = {}, te = {};
              return d.forEach(y, function(fe) {
                d.forEach(fe, function(_, G) {
                  ee[_] = _, Z[_] = _, te[_] = G;
                });
              }), d.forEach(y, function(fe) {
                var _ = -1;
                d.forEach(fe, function(G) {
                  var L = Y(G);
                  if (L.length) {
                    L = d.sortBy(L, function(me) {
                      return te[me];
                    });
                    for (var $ = (L.length - 1) / 2, ae = Math.floor($), Pe = Math.ceil($); ae <= Pe; ++ae) {
                      var ge = L[ae];
                      Z[G] === G && _ < te[ge] && !H(O, G, ge) && (Z[ge] = G, Z[G] = ee[G] = ee[ge], _ = te[ge]);
                    }
                  }
                });
              }), { root: ee, align: Z };
            }
            function q(R, y, O, Y, ee) {
              var Z = {}, te = b(R, y, O, ee), fe = ee ? "borderLeft" : "borderRight";
              function _($, ae) {
                for (var Pe = te.nodes(), ge = Pe.pop(), me = {}; ge; )
                  me[ge] ? $(ge) : (me[ge] = !0, Pe.push(ge), Pe = Pe.concat(ae(ge))), ge = Pe.pop();
              }
              function G($) {
                Z[$] = te.inEdges($).reduce(function(ae, Pe) {
                  return Math.max(ae, Z[Pe.v] + te.edge(Pe));
                }, 0);
              }
              function L($) {
                var ae = te.outEdges($).reduce(function(ge, me) {
                  return Math.min(ge, Z[me.w] - te.edge(me));
                }, Number.POSITIVE_INFINITY), Pe = R.node($);
                ae !== Number.POSITIVE_INFINITY && Pe.borderType !== fe && (Z[$] = Math.max(Z[$], ae));
              }
              return _(G, te.predecessors.bind(te)), _(L, te.successors.bind(te)), d.forEach(Y, function($) {
                Z[$] = Z[O[$]];
              }), Z;
            }
            function b(R, y, O, Y) {
              var ee = new v(), Z = R.graph(), te = N(Z.nodesep, Z.edgesep, Y);
              return d.forEach(y, function(fe) {
                var _;
                d.forEach(fe, function(G) {
                  var L = O[G];
                  if (ee.setNode(L), _) {
                    var $ = O[_], ae = ee.edge($, L);
                    ee.setEdge($, L, Math.max(te(R, G, _), ae || 0));
                  }
                  _ = G;
                });
              }), ee;
            }
            function j(R, y) {
              return d.minBy(d.values(y), function(O) {
                var Y = Number.NEGATIVE_INFINITY, ee = Number.POSITIVE_INFINITY;
                return d.forIn(O, function(Z, te) {
                  var fe = k(R, te) / 2;
                  Y = Math.max(Z + fe, Y), ee = Math.min(Z - fe, ee);
                }), Y - ee;
              });
            }
            function w(R, y) {
              var O = d.values(y), Y = d.min(O), ee = d.max(O);
              d.forEach(["u", "d"], function(Z) {
                d.forEach(["l", "r"], function(te) {
                  var fe = Z + te, _ = R[fe], G;
                  if (_ !== y) {
                    var L = d.values(_);
                    G = te === "l" ? Y - d.min(L) : ee - d.max(L), G && (R[fe] = d.mapValues(_, function($) {
                      return $ + G;
                    }));
                  }
                });
              });
            }
            function m(R, y) {
              return d.mapValues(R.ul, function(O, Y) {
                if (y)
                  return R[y.toLowerCase()][Y];
                var ee = d.sortBy(d.map(R, Y));
                return (ee[1] + ee[2]) / 2;
              });
            }
            function I(R) {
              var y = u.buildLayerMatrix(R), O = d.merge(
                l(R, y),
                P(R, y)
              ), Y = {}, ee;
              d.forEach(["u", "d"], function(te) {
                ee = te === "u" ? y : d.values(y).reverse(), d.forEach(["l", "r"], function(fe) {
                  fe === "r" && (ee = d.map(ee, function($) {
                    return d.values($).reverse();
                  }));
                  var _ = (te === "u" ? R.predecessors : R.successors).bind(R), G = T(R, ee, O, _), L = q(
                    R,
                    ee,
                    G.root,
                    G.align,
                    fe === "r"
                  );
                  fe === "r" && (L = d.mapValues(L, function($) {
                    return -$;
                  })), Y[te + fe] = L;
                });
              });
              var Z = j(R, Y);
              return w(Y, Z), m(Y, R.graph().align);
            }
            function N(R, y, O) {
              return function(Y, ee, Z) {
                var te = Y.node(ee), fe = Y.node(Z), _ = 0, G;
                if (_ += te.width / 2, d.has(te, "labelpos"))
                  switch (te.labelpos.toLowerCase()) {
                    case "l":
                      G = -te.width / 2;
                      break;
                    case "r":
                      G = te.width / 2;
                      break;
                  }
                if (G && (_ += O ? G : -G), G = 0, _ += (te.dummy ? y : R) / 2, _ += (fe.dummy ? y : R) / 2, _ += fe.width / 2, d.has(fe, "labelpos"))
                  switch (fe.labelpos.toLowerCase()) {
                    case "l":
                      G = fe.width / 2;
                      break;
                    case "r":
                      G = -fe.width / 2;
                      break;
                  }
                return G && (_ += O ? G : -G), G = 0, _;
              };
            }
            function k(R, y) {
              return R.node(y).width;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/position/index.js": (
          /*!************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/position/index.js ***!
            \************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ../util */
              "../../../../node_modules/dagre/lib/util.js"
            ), u = o(
              /*! ./bk */
              "../../../../node_modules/dagre/lib/position/bk.js"
            ).positionX;
            a.exports = l;
            function l(p) {
              p = v.asNonCompoundGraph(p), P(p), d.forEach(u(p), function(c, H) {
                p.node(H).x = c;
              });
            }
            function P(p) {
              var c = v.buildLayerMatrix(p), H = p.graph().ranksep, T = 0;
              d.forEach(c, function(q) {
                var b = d.max(d.map(q, function(j) {
                  return p.node(j).height;
                }));
                d.forEach(q, function(j) {
                  p.node(j).y = T + b / 2;
                }), T += b + H;
              });
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/rank/feasible-tree.js": (
          /*!****************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/rank/feasible-tree.js ***!
            \****************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ../graphlib */
              "../../../../node_modules/dagre/lib/graphlib.js"
            ).Graph, u = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/rank/util.js"
            ).slack;
            a.exports = l;
            function l(H) {
              var T = new v({ directed: !1 }), q = H.nodes()[0], b = H.nodeCount();
              T.setNode(q, {});
              for (var j, w; P(T, H) < b; )
                j = p(T, H), w = T.hasNode(j.v) ? u(H, j) : -u(H, j), c(T, H, w);
              return T;
            }
            function P(H, T) {
              function q(b) {
                d.forEach(T.nodeEdges(b), function(j) {
                  var w = j.v, m = b === w ? j.w : w;
                  !H.hasNode(m) && !u(T, j) && (H.setNode(m, {}), H.setEdge(b, m, {}), q(m));
                });
              }
              return d.forEach(H.nodes(), q), H.nodeCount();
            }
            function p(H, T) {
              return d.minBy(T.edges(), function(q) {
                if (H.hasNode(q.v) !== H.hasNode(q.w))
                  return u(T, q);
              });
            }
            function c(H, T, q) {
              d.forEach(H.nodes(), function(b) {
                T.node(b).rank += q;
              });
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/rank/index.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/dagre/lib/rank/index.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/rank/util.js"
            ), v = d.longestPath, u = o(
              /*! ./feasible-tree */
              "../../../../node_modules/dagre/lib/rank/feasible-tree.js"
            ), l = o(
              /*! ./network-simplex */
              "../../../../node_modules/dagre/lib/rank/network-simplex.js"
            );
            a.exports = P;
            function P(T) {
              switch (T.graph().ranker) {
                case "network-simplex":
                  H(T);
                  break;
                case "tight-tree":
                  c(T);
                  break;
                case "longest-path":
                  p(T);
                  break;
                default:
                  H(T);
              }
            }
            var p = v;
            function c(T) {
              v(T), u(T);
            }
            function H(T) {
              l(T);
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/rank/network-simplex.js": (
          /*!******************************************************************!*\
            !*** ../../../../node_modules/dagre/lib/rank/network-simplex.js ***!
            \******************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./feasible-tree */
              "../../../../node_modules/dagre/lib/rank/feasible-tree.js"
            ), u = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/rank/util.js"
            ).slack, l = o(
              /*! ./util */
              "../../../../node_modules/dagre/lib/rank/util.js"
            ).longestPath, P = o(
              /*! ../graphlib */
              "../../../../node_modules/dagre/lib/graphlib.js"
            ).alg.preorder, p = o(
              /*! ../graphlib */
              "../../../../node_modules/dagre/lib/graphlib.js"
            ).alg.postorder, c = o(
              /*! ../util */
              "../../../../node_modules/dagre/lib/util.js"
            ).simplify;
            a.exports = H, H.initLowLimValues = j, H.initCutValues = T, H.calcCutValue = b, H.leaveEdge = m, H.enterEdge = I, H.exchangeEdges = N;
            function H(O) {
              O = c(O), l(O);
              var Y = v(O);
              j(Y), T(Y, O);
              for (var ee, Z; ee = m(Y); )
                Z = I(Y, O, ee), N(Y, O, ee, Z);
            }
            function T(O, Y) {
              var ee = p(O, O.nodes());
              ee = ee.slice(0, ee.length - 1), d.forEach(ee, function(Z) {
                q(O, Y, Z);
              });
            }
            function q(O, Y, ee) {
              var Z = O.node(ee), te = Z.parent;
              O.edge(ee, te).cutvalue = b(O, Y, ee);
            }
            function b(O, Y, ee) {
              var Z = O.node(ee), te = Z.parent, fe = !0, _ = Y.edge(ee, te), G = 0;
              return _ || (fe = !1, _ = Y.edge(te, ee)), G = _.weight, d.forEach(Y.nodeEdges(ee), function(L) {
                var $ = L.v === ee, ae = $ ? L.w : L.v;
                if (ae !== te) {
                  var Pe = $ === fe, ge = Y.edge(L).weight;
                  if (G += Pe ? ge : -ge, R(O, ee, ae)) {
                    var me = O.edge(ee, ae).cutvalue;
                    G += Pe ? -me : me;
                  }
                }
              }), G;
            }
            function j(O, Y) {
              arguments.length < 2 && (Y = O.nodes()[0]), w(O, {}, 1, Y);
            }
            function w(O, Y, ee, Z, te) {
              var fe = ee, _ = O.node(Z);
              return Y[Z] = !0, d.forEach(O.neighbors(Z), function(G) {
                d.has(Y, G) || (ee = w(O, Y, ee, G, Z));
              }), _.low = fe, _.lim = ee++, te ? _.parent = te : delete _.parent, ee;
            }
            function m(O) {
              return d.find(O.edges(), function(Y) {
                return O.edge(Y).cutvalue < 0;
              });
            }
            function I(O, Y, ee) {
              var Z = ee.v, te = ee.w;
              Y.hasEdge(Z, te) || (Z = ee.w, te = ee.v);
              var fe = O.node(Z), _ = O.node(te), G = fe, L = !1;
              fe.lim > _.lim && (G = _, L = !0);
              var $ = d.filter(Y.edges(), function(ae) {
                return L === y(O, O.node(ae.v), G) && L !== y(O, O.node(ae.w), G);
              });
              return d.minBy($, function(ae) {
                return u(Y, ae);
              });
            }
            function N(O, Y, ee, Z) {
              var te = ee.v, fe = ee.w;
              O.removeEdge(te, fe), O.setEdge(Z.v, Z.w, {}), j(O), T(O, Y), k(O, Y);
            }
            function k(O, Y) {
              var ee = d.find(O.nodes(), function(te) {
                return !Y.node(te).parent;
              }), Z = P(O, ee);
              Z = Z.slice(1), d.forEach(Z, function(te) {
                var fe = O.node(te).parent, _ = Y.edge(te, fe), G = !1;
                _ || (_ = Y.edge(fe, te), G = !0), Y.node(te).rank = Y.node(fe).rank + (G ? _.minlen : -_.minlen);
              });
            }
            function R(O, Y, ee) {
              return O.hasEdge(Y, ee);
            }
            function y(O, Y, ee) {
              return ee.low <= Y.lim && Y.lim <= ee.lim;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/rank/util.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/dagre/lib/rank/util.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            );
            a.exports = {
              longestPath: v,
              slack: u
            };
            function v(l) {
              var P = {};
              function p(c) {
                var H = l.node(c);
                if (d.has(P, c))
                  return H.rank;
                P[c] = !0;
                var T = d.min(d.map(l.outEdges(c), function(q) {
                  return p(q.w) - l.edge(q).minlen;
                }));
                return (T === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3
                T === void 0 || // return value of _.map([]) for Lodash 4
                T === null) && (T = 0), H.rank = T;
              }
              d.forEach(l.sources(), p);
            }
            function u(l, P) {
              return l.node(P.w).rank - l.node(P.v).rank - l.edge(P).minlen;
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/util.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/dagre/lib/util.js ***!
            \**************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/dagre/lib/lodash.js"
            ), v = o(
              /*! ./graphlib */
              "../../../../node_modules/dagre/lib/graphlib.js"
            ).Graph;
            a.exports = {
              addDummyNode: u,
              simplify: l,
              asNonCompoundGraph: P,
              successorWeights: p,
              predecessorWeights: c,
              intersectRect: H,
              buildLayerMatrix: T,
              normalizeRanks: q,
              removeEmptyRanks: b,
              addBorderNode: j,
              maxRank: w,
              partition: m,
              time: I,
              notime: N
            };
            function u(k, R, y, O) {
              var Y;
              do
                Y = d.uniqueId(O);
              while (k.hasNode(Y));
              return y.dummy = R, k.setNode(Y, y), Y;
            }
            function l(k) {
              var R = new v().setGraph(k.graph());
              return d.forEach(k.nodes(), function(y) {
                R.setNode(y, k.node(y));
              }), d.forEach(k.edges(), function(y) {
                var O = R.edge(y.v, y.w) || { weight: 0, minlen: 1 }, Y = k.edge(y);
                R.setEdge(y.v, y.w, {
                  weight: O.weight + Y.weight,
                  minlen: Math.max(O.minlen, Y.minlen)
                });
              }), R;
            }
            function P(k) {
              var R = new v({ multigraph: k.isMultigraph() }).setGraph(k.graph());
              return d.forEach(k.nodes(), function(y) {
                k.children(y).length || R.setNode(y, k.node(y));
              }), d.forEach(k.edges(), function(y) {
                R.setEdge(y, k.edge(y));
              }), R;
            }
            function p(k) {
              var R = d.map(k.nodes(), function(y) {
                var O = {};
                return d.forEach(k.outEdges(y), function(Y) {
                  O[Y.w] = (O[Y.w] || 0) + k.edge(Y).weight;
                }), O;
              });
              return d.zipObject(k.nodes(), R);
            }
            function c(k) {
              var R = d.map(k.nodes(), function(y) {
                var O = {};
                return d.forEach(k.inEdges(y), function(Y) {
                  O[Y.v] = (O[Y.v] || 0) + k.edge(Y).weight;
                }), O;
              });
              return d.zipObject(k.nodes(), R);
            }
            function H(k, R) {
              var y = k.x, O = k.y, Y = R.x - y, ee = R.y - O, Z = k.width / 2, te = k.height / 2;
              if (!Y && !ee)
                throw new Error("Not possible to find intersection inside of the rectangle");
              var fe, _;
              return Math.abs(ee) * Z > Math.abs(Y) * te ? (ee < 0 && (te = -te), fe = te * Y / ee, _ = te) : (Y < 0 && (Z = -Z), fe = Z, _ = Z * ee / Y), { x: y + fe, y: O + _ };
            }
            function T(k) {
              var R = d.map(d.range(w(k) + 1), function() {
                return [];
              });
              return d.forEach(k.nodes(), function(y) {
                var O = k.node(y), Y = O.rank;
                d.isUndefined(Y) || (R[Y][O.order] = y);
              }), R;
            }
            function q(k) {
              var R = d.min(d.map(k.nodes(), function(y) {
                return k.node(y).rank;
              }));
              d.forEach(k.nodes(), function(y) {
                var O = k.node(y);
                d.has(O, "rank") && (O.rank -= R);
              });
            }
            function b(k) {
              var R = d.min(d.map(k.nodes(), function(ee) {
                return k.node(ee).rank;
              })), y = [];
              d.forEach(k.nodes(), function(ee) {
                var Z = k.node(ee).rank - R;
                y[Z] || (y[Z] = []), y[Z].push(ee);
              });
              var O = 0, Y = k.graph().nodeRankFactor;
              d.forEach(y, function(ee, Z) {
                d.isUndefined(ee) && Z % Y !== 0 ? --O : O && d.forEach(ee, function(te) {
                  k.node(te).rank += O;
                });
              });
            }
            function j(k, R, y, O) {
              var Y = {
                width: 0,
                height: 0
              };
              return arguments.length >= 4 && (Y.rank = y, Y.order = O), u(k, "border", Y, R);
            }
            function w(k) {
              return d.max(d.map(k.nodes(), function(R) {
                var y = k.node(R).rank;
                if (!d.isUndefined(y))
                  return y;
              }));
            }
            function m(k, R) {
              var y = { lhs: [], rhs: [] };
              return d.forEach(k, function(O) {
                R(O) ? y.lhs.push(O) : y.rhs.push(O);
              }), y;
            }
            function I(k, R) {
              var y = d.now();
              try {
                return R();
              } finally {
                console.log(k + " time: " + (d.now() - y) + "ms");
              }
            }
            function N(k, R) {
              return R();
            }
          }
        ),
        /***/
        "../../../../node_modules/dagre/lib/version.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/dagre/lib/version.js ***!
            \*****************************************************/
          /***/
          (a) => {
            a.exports = "0.8.5";
          }
        ),
        /***/
        "../../../../node_modules/graphlib/index.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/graphlib/index.js ***!
            \**************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lib */
              "../../../../node_modules/graphlib/lib/index.js"
            );
            a.exports = {
              Graph: d.Graph,
              json: o(
                /*! ./lib/json */
                "../../../../node_modules/graphlib/lib/json.js"
              ),
              alg: o(
                /*! ./lib/alg */
                "../../../../node_modules/graphlib/lib/alg/index.js"
              ),
              version: d.version
            };
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/components.js": (
          /*!***************************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/components.js ***!
            \***************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            );
            a.exports = v;
            function v(u) {
              var l = {}, P = [], p;
              function c(H) {
                d.has(l, H) || (l[H] = !0, p.push(H), d.each(u.successors(H), c), d.each(u.predecessors(H), c));
              }
              return d.each(u.nodes(), function(H) {
                p = [], c(H), p.length && P.push(p);
              }), P;
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/dfs.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/dfs.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            );
            a.exports = v;
            function v(l, P, p) {
              d.isArray(P) || (P = [P]);
              var c = (l.isDirected() ? l.successors : l.neighbors).bind(l), H = [], T = {};
              return d.each(P, function(q) {
                if (!l.hasNode(q))
                  throw new Error("Graph does not have node: " + q);
                u(l, q, p === "post", T, c, H);
              }), H;
            }
            function u(l, P, p, c, H, T) {
              d.has(c, P) || (c[P] = !0, p || T.push(P), d.each(H(P), function(q) {
                u(l, q, p, c, H, T);
              }), p && T.push(P));
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/dijkstra-all.js": (
          /*!*****************************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/dijkstra-all.js ***!
            \*****************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./dijkstra */
              "../../../../node_modules/graphlib/lib/alg/dijkstra.js"
            ), v = o(
              /*! ../lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            );
            a.exports = u;
            function u(l, P, p) {
              return v.transform(l.nodes(), function(c, H) {
                c[H] = d(l, H, P, p);
              }, {});
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/dijkstra.js": (
          /*!*************************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/dijkstra.js ***!
            \*************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            ), v = o(
              /*! ../data/priority-queue */
              "../../../../node_modules/graphlib/lib/data/priority-queue.js"
            );
            a.exports = l;
            var u = d.constant(1);
            function l(p, c, H, T) {
              return P(
                p,
                String(c),
                H || u,
                T || function(q) {
                  return p.outEdges(q);
                }
              );
            }
            function P(p, c, H, T) {
              var q = {}, b = new v(), j, w, m = function(I) {
                var N = I.v !== j ? I.v : I.w, k = q[N], R = H(I), y = w.distance + R;
                if (R < 0)
                  throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + I + " Weight: " + R);
                y < k.distance && (k.distance = y, k.predecessor = j, b.decrease(N, y));
              };
              for (p.nodes().forEach(function(I) {
                var N = I === c ? 0 : Number.POSITIVE_INFINITY;
                q[I] = { distance: N }, b.add(I, N);
              }); b.size() > 0 && (j = b.removeMin(), w = q[j], w.distance !== Number.POSITIVE_INFINITY); )
                T(j).forEach(m);
              return q;
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/find-cycles.js": (
          /*!****************************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/find-cycles.js ***!
            \****************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            ), v = o(
              /*! ./tarjan */
              "../../../../node_modules/graphlib/lib/alg/tarjan.js"
            );
            a.exports = u;
            function u(l) {
              return d.filter(v(l), function(P) {
                return P.length > 1 || P.length === 1 && l.hasEdge(P[0], P[0]);
              });
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/floyd-warshall.js": (
          /*!*******************************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/floyd-warshall.js ***!
            \*******************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            );
            a.exports = u;
            var v = d.constant(1);
            function u(P, p, c) {
              return l(
                P,
                p || v,
                c || function(H) {
                  return P.outEdges(H);
                }
              );
            }
            function l(P, p, c) {
              var H = {}, T = P.nodes();
              return T.forEach(function(q) {
                H[q] = {}, H[q][q] = { distance: 0 }, T.forEach(function(b) {
                  q !== b && (H[q][b] = { distance: Number.POSITIVE_INFINITY });
                }), c(q).forEach(function(b) {
                  var j = b.v === q ? b.w : b.v, w = p(b);
                  H[q][j] = { distance: w, predecessor: q };
                });
              }), T.forEach(function(q) {
                var b = H[q];
                T.forEach(function(j) {
                  var w = H[j];
                  T.forEach(function(m) {
                    var I = w[q], N = b[m], k = w[m], R = I.distance + N.distance;
                    R < k.distance && (k.distance = R, k.predecessor = N.predecessor);
                  });
                });
              }), H;
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/index.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/index.js ***!
            \**********************************************************/
          /***/
          (a, f, o) => {
            a.exports = {
              components: o(
                /*! ./components */
                "../../../../node_modules/graphlib/lib/alg/components.js"
              ),
              dijkstra: o(
                /*! ./dijkstra */
                "../../../../node_modules/graphlib/lib/alg/dijkstra.js"
              ),
              dijkstraAll: o(
                /*! ./dijkstra-all */
                "../../../../node_modules/graphlib/lib/alg/dijkstra-all.js"
              ),
              findCycles: o(
                /*! ./find-cycles */
                "../../../../node_modules/graphlib/lib/alg/find-cycles.js"
              ),
              floydWarshall: o(
                /*! ./floyd-warshall */
                "../../../../node_modules/graphlib/lib/alg/floyd-warshall.js"
              ),
              isAcyclic: o(
                /*! ./is-acyclic */
                "../../../../node_modules/graphlib/lib/alg/is-acyclic.js"
              ),
              postorder: o(
                /*! ./postorder */
                "../../../../node_modules/graphlib/lib/alg/postorder.js"
              ),
              preorder: o(
                /*! ./preorder */
                "../../../../node_modules/graphlib/lib/alg/preorder.js"
              ),
              prim: o(
                /*! ./prim */
                "../../../../node_modules/graphlib/lib/alg/prim.js"
              ),
              tarjan: o(
                /*! ./tarjan */
                "../../../../node_modules/graphlib/lib/alg/tarjan.js"
              ),
              topsort: o(
                /*! ./topsort */
                "../../../../node_modules/graphlib/lib/alg/topsort.js"
              )
            };
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/is-acyclic.js": (
          /*!***************************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/is-acyclic.js ***!
            \***************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./topsort */
              "../../../../node_modules/graphlib/lib/alg/topsort.js"
            );
            a.exports = v;
            function v(u) {
              try {
                d(u);
              } catch (l) {
                if (l instanceof d.CycleException)
                  return !1;
                throw l;
              }
              return !0;
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/postorder.js": (
          /*!**************************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/postorder.js ***!
            \**************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./dfs */
              "../../../../node_modules/graphlib/lib/alg/dfs.js"
            );
            a.exports = v;
            function v(u, l) {
              return d(u, l, "post");
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/preorder.js": (
          /*!*************************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/preorder.js ***!
            \*************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./dfs */
              "../../../../node_modules/graphlib/lib/alg/dfs.js"
            );
            a.exports = v;
            function v(u, l) {
              return d(u, l, "pre");
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/prim.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/prim.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            ), v = o(
              /*! ../graph */
              "../../../../node_modules/graphlib/lib/graph.js"
            ), u = o(
              /*! ../data/priority-queue */
              "../../../../node_modules/graphlib/lib/data/priority-queue.js"
            );
            a.exports = l;
            function l(P, p) {
              var c = new v(), H = {}, T = new u(), q;
              function b(w) {
                var m = w.v === q ? w.w : w.v, I = T.priority(m);
                if (I !== void 0) {
                  var N = p(w);
                  N < I && (H[m] = q, T.decrease(m, N));
                }
              }
              if (P.nodeCount() === 0)
                return c;
              d.each(P.nodes(), function(w) {
                T.add(w, Number.POSITIVE_INFINITY), c.setNode(w);
              }), T.decrease(P.nodes()[0], 0);
              for (var j = !1; T.size() > 0; ) {
                if (q = T.removeMin(), d.has(H, q))
                  c.setEdge(q, H[q]);
                else {
                  if (j)
                    throw new Error("Input graph is not connected: " + P);
                  j = !0;
                }
                P.nodeEdges(q).forEach(b);
              }
              return c;
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/tarjan.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/tarjan.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            );
            a.exports = v;
            function v(u) {
              var l = 0, P = [], p = {}, c = [];
              function H(T) {
                var q = p[T] = {
                  onStack: !0,
                  lowlink: l,
                  index: l++
                };
                if (P.push(T), u.successors(T).forEach(function(w) {
                  d.has(p, w) ? p[w].onStack && (q.lowlink = Math.min(q.lowlink, p[w].index)) : (H(w), q.lowlink = Math.min(q.lowlink, p[w].lowlink));
                }), q.lowlink === q.index) {
                  var b = [], j;
                  do
                    j = P.pop(), p[j].onStack = !1, b.push(j);
                  while (T !== j);
                  c.push(b);
                }
              }
              return u.nodes().forEach(function(T) {
                d.has(p, T) || H(T);
              }), c;
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/alg/topsort.js": (
          /*!************************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/alg/topsort.js ***!
            \************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            );
            a.exports = v, v.CycleException = u;
            function v(l) {
              var P = {}, p = {}, c = [];
              function H(T) {
                if (d.has(p, T))
                  throw new u();
                d.has(P, T) || (p[T] = !0, P[T] = !0, d.each(l.predecessors(T), H), delete p[T], c.push(T));
              }
              if (d.each(l.sinks(), H), d.size(P) !== l.nodeCount())
                throw new u();
              return c;
            }
            function u() {
            }
            u.prototype = new Error();
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/data/priority-queue.js": (
          /*!********************************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/data/priority-queue.js ***!
            \********************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ../lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            );
            a.exports = v;
            function v() {
              this._arr = [], this._keyIndices = {};
            }
            v.prototype.size = function() {
              return this._arr.length;
            }, v.prototype.keys = function() {
              return this._arr.map(function(u) {
                return u.key;
              });
            }, v.prototype.has = function(u) {
              return d.has(this._keyIndices, u);
            }, v.prototype.priority = function(u) {
              var l = this._keyIndices[u];
              if (l !== void 0)
                return this._arr[l].priority;
            }, v.prototype.min = function() {
              if (this.size() === 0)
                throw new Error("Queue underflow");
              return this._arr[0].key;
            }, v.prototype.add = function(u, l) {
              var P = this._keyIndices;
              if (u = String(u), !d.has(P, u)) {
                var p = this._arr, c = p.length;
                return P[u] = c, p.push({ key: u, priority: l }), this._decrease(c), !0;
              }
              return !1;
            }, v.prototype.removeMin = function() {
              this._swap(0, this._arr.length - 1);
              var u = this._arr.pop();
              return delete this._keyIndices[u.key], this._heapify(0), u.key;
            }, v.prototype.decrease = function(u, l) {
              var P = this._keyIndices[u];
              if (l > this._arr[P].priority)
                throw new Error("New priority is greater than current priority. Key: " + u + " Old: " + this._arr[P].priority + " New: " + l);
              this._arr[P].priority = l, this._decrease(P);
            }, v.prototype._heapify = function(u) {
              var l = this._arr, P = 2 * u, p = P + 1, c = u;
              P < l.length && (c = l[P].priority < l[c].priority ? P : c, p < l.length && (c = l[p].priority < l[c].priority ? p : c), c !== u && (this._swap(u, c), this._heapify(c)));
            }, v.prototype._decrease = function(u) {
              for (var l = this._arr, P = l[u].priority, p; u !== 0 && (p = u >> 1, !(l[p].priority < P)); )
                this._swap(u, p), u = p;
            }, v.prototype._swap = function(u, l) {
              var P = this._arr, p = this._keyIndices, c = P[u], H = P[l];
              P[u] = H, P[l] = c, p[H.key] = u, p[c.key] = l;
            };
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/graph.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/graph.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            );
            a.exports = P;
            var v = "\0", u = "\0", l = "";
            function P(b) {
              this._isDirected = d.has(b, "directed") ? b.directed : !0, this._isMultigraph = d.has(b, "multigraph") ? b.multigraph : !1, this._isCompound = d.has(b, "compound") ? b.compound : !1, this._label = void 0, this._defaultNodeLabelFn = d.constant(void 0), this._defaultEdgeLabelFn = d.constant(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[u] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {};
            }
            P.prototype._nodeCount = 0, P.prototype._edgeCount = 0, P.prototype.isDirected = function() {
              return this._isDirected;
            }, P.prototype.isMultigraph = function() {
              return this._isMultigraph;
            }, P.prototype.isCompound = function() {
              return this._isCompound;
            }, P.prototype.setGraph = function(b) {
              return this._label = b, this;
            }, P.prototype.graph = function() {
              return this._label;
            }, P.prototype.setDefaultNodeLabel = function(b) {
              return d.isFunction(b) || (b = d.constant(b)), this._defaultNodeLabelFn = b, this;
            }, P.prototype.nodeCount = function() {
              return this._nodeCount;
            }, P.prototype.nodes = function() {
              return d.keys(this._nodes);
            }, P.prototype.sources = function() {
              var b = this;
              return d.filter(this.nodes(), function(j) {
                return d.isEmpty(b._in[j]);
              });
            }, P.prototype.sinks = function() {
              var b = this;
              return d.filter(this.nodes(), function(j) {
                return d.isEmpty(b._out[j]);
              });
            }, P.prototype.setNodes = function(b, j) {
              var w = arguments, m = this;
              return d.each(b, function(I) {
                w.length > 1 ? m.setNode(I, j) : m.setNode(I);
              }), this;
            }, P.prototype.setNode = function(b, j) {
              return d.has(this._nodes, b) ? (arguments.length > 1 && (this._nodes[b] = j), this) : (this._nodes[b] = arguments.length > 1 ? j : this._defaultNodeLabelFn(b), this._isCompound && (this._parent[b] = u, this._children[b] = {}, this._children[u][b] = !0), this._in[b] = {}, this._preds[b] = {}, this._out[b] = {}, this._sucs[b] = {}, ++this._nodeCount, this);
            }, P.prototype.node = function(b) {
              return this._nodes[b];
            }, P.prototype.hasNode = function(b) {
              return d.has(this._nodes, b);
            }, P.prototype.removeNode = function(b) {
              var j = this;
              if (d.has(this._nodes, b)) {
                var w = function(m) {
                  j.removeEdge(j._edgeObjs[m]);
                };
                delete this._nodes[b], this._isCompound && (this._removeFromParentsChildList(b), delete this._parent[b], d.each(this.children(b), function(m) {
                  j.setParent(m);
                }), delete this._children[b]), d.each(d.keys(this._in[b]), w), delete this._in[b], delete this._preds[b], d.each(d.keys(this._out[b]), w), delete this._out[b], delete this._sucs[b], --this._nodeCount;
              }
              return this;
            }, P.prototype.setParent = function(b, j) {
              if (!this._isCompound)
                throw new Error("Cannot set parent in a non-compound graph");
              if (d.isUndefined(j))
                j = u;
              else {
                j += "";
                for (var w = j; !d.isUndefined(w); w = this.parent(w))
                  if (w === b)
                    throw new Error("Setting " + j + " as parent of " + b + " would create a cycle");
                this.setNode(j);
              }
              return this.setNode(b), this._removeFromParentsChildList(b), this._parent[b] = j, this._children[j][b] = !0, this;
            }, P.prototype._removeFromParentsChildList = function(b) {
              delete this._children[this._parent[b]][b];
            }, P.prototype.parent = function(b) {
              if (this._isCompound) {
                var j = this._parent[b];
                if (j !== u)
                  return j;
              }
            }, P.prototype.children = function(b) {
              if (d.isUndefined(b) && (b = u), this._isCompound) {
                var j = this._children[b];
                if (j)
                  return d.keys(j);
              } else {
                if (b === u)
                  return this.nodes();
                if (this.hasNode(b))
                  return [];
              }
            }, P.prototype.predecessors = function(b) {
              var j = this._preds[b];
              if (j)
                return d.keys(j);
            }, P.prototype.successors = function(b) {
              var j = this._sucs[b];
              if (j)
                return d.keys(j);
            }, P.prototype.neighbors = function(b) {
              var j = this.predecessors(b);
              if (j)
                return d.union(j, this.successors(b));
            }, P.prototype.isLeaf = function(b) {
              var j;
              return this.isDirected() ? j = this.successors(b) : j = this.neighbors(b), j.length === 0;
            }, P.prototype.filterNodes = function(b) {
              var j = new this.constructor({
                directed: this._isDirected,
                multigraph: this._isMultigraph,
                compound: this._isCompound
              });
              j.setGraph(this.graph());
              var w = this;
              d.each(this._nodes, function(N, k) {
                b(k) && j.setNode(k, N);
              }), d.each(this._edgeObjs, function(N) {
                j.hasNode(N.v) && j.hasNode(N.w) && j.setEdge(N, w.edge(N));
              });
              var m = {};
              function I(N) {
                var k = w.parent(N);
                return k === void 0 || j.hasNode(k) ? (m[N] = k, k) : k in m ? m[k] : I(k);
              }
              return this._isCompound && d.each(j.nodes(), function(N) {
                j.setParent(N, I(N));
              }), j;
            }, P.prototype.setDefaultEdgeLabel = function(b) {
              return d.isFunction(b) || (b = d.constant(b)), this._defaultEdgeLabelFn = b, this;
            }, P.prototype.edgeCount = function() {
              return this._edgeCount;
            }, P.prototype.edges = function() {
              return d.values(this._edgeObjs);
            }, P.prototype.setPath = function(b, j) {
              var w = this, m = arguments;
              return d.reduce(b, function(I, N) {
                return m.length > 1 ? w.setEdge(I, N, j) : w.setEdge(I, N), N;
              }), this;
            }, P.prototype.setEdge = function() {
              var b, j, w, m, I = !1, N = arguments[0];
              typeof N == "object" && N !== null && "v" in N ? (b = N.v, j = N.w, w = N.name, arguments.length === 2 && (m = arguments[1], I = !0)) : (b = N, j = arguments[1], w = arguments[3], arguments.length > 2 && (m = arguments[2], I = !0)), b = "" + b, j = "" + j, d.isUndefined(w) || (w = "" + w);
              var k = H(this._isDirected, b, j, w);
              if (d.has(this._edgeLabels, k))
                return I && (this._edgeLabels[k] = m), this;
              if (!d.isUndefined(w) && !this._isMultigraph)
                throw new Error("Cannot set a named edge when isMultigraph = false");
              this.setNode(b), this.setNode(j), this._edgeLabels[k] = I ? m : this._defaultEdgeLabelFn(b, j, w);
              var R = T(this._isDirected, b, j, w);
              return b = R.v, j = R.w, Object.freeze(R), this._edgeObjs[k] = R, p(this._preds[j], b), p(this._sucs[b], j), this._in[j][k] = R, this._out[b][k] = R, this._edgeCount++, this;
            }, P.prototype.edge = function(b, j, w) {
              var m = arguments.length === 1 ? q(this._isDirected, arguments[0]) : H(this._isDirected, b, j, w);
              return this._edgeLabels[m];
            }, P.prototype.hasEdge = function(b, j, w) {
              var m = arguments.length === 1 ? q(this._isDirected, arguments[0]) : H(this._isDirected, b, j, w);
              return d.has(this._edgeLabels, m);
            }, P.prototype.removeEdge = function(b, j, w) {
              var m = arguments.length === 1 ? q(this._isDirected, arguments[0]) : H(this._isDirected, b, j, w), I = this._edgeObjs[m];
              return I && (b = I.v, j = I.w, delete this._edgeLabels[m], delete this._edgeObjs[m], c(this._preds[j], b), c(this._sucs[b], j), delete this._in[j][m], delete this._out[b][m], this._edgeCount--), this;
            }, P.prototype.inEdges = function(b, j) {
              var w = this._in[b];
              if (w) {
                var m = d.values(w);
                return j ? d.filter(m, function(I) {
                  return I.v === j;
                }) : m;
              }
            }, P.prototype.outEdges = function(b, j) {
              var w = this._out[b];
              if (w) {
                var m = d.values(w);
                return j ? d.filter(m, function(I) {
                  return I.w === j;
                }) : m;
              }
            }, P.prototype.nodeEdges = function(b, j) {
              var w = this.inEdges(b, j);
              if (w)
                return w.concat(this.outEdges(b, j));
            };
            function p(b, j) {
              b[j] ? b[j]++ : b[j] = 1;
            }
            function c(b, j) {
              --b[j] || delete b[j];
            }
            function H(b, j, w, m) {
              var I = "" + j, N = "" + w;
              if (!b && I > N) {
                var k = I;
                I = N, N = k;
              }
              return I + l + N + l + (d.isUndefined(m) ? v : m);
            }
            function T(b, j, w, m) {
              var I = "" + j, N = "" + w;
              if (!b && I > N) {
                var k = I;
                I = N, N = k;
              }
              var R = { v: I, w: N };
              return m && (R.name = m), R;
            }
            function q(b, j) {
              return H(b, j.v, j.w, j.name);
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/index.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/index.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            a.exports = {
              Graph: o(
                /*! ./graph */
                "../../../../node_modules/graphlib/lib/graph.js"
              ),
              version: o(
                /*! ./version */
                "../../../../node_modules/graphlib/lib/version.js"
              )
            };
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/json.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/json.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./lodash */
              "../../../../node_modules/graphlib/lib/lodash.js"
            ), v = o(
              /*! ./graph */
              "../../../../node_modules/graphlib/lib/graph.js"
            );
            a.exports = {
              write: u,
              read: p
            };
            function u(c) {
              var H = {
                options: {
                  directed: c.isDirected(),
                  multigraph: c.isMultigraph(),
                  compound: c.isCompound()
                },
                nodes: l(c),
                edges: P(c)
              };
              return d.isUndefined(c.graph()) || (H.value = d.clone(c.graph())), H;
            }
            function l(c) {
              return d.map(c.nodes(), function(H) {
                var T = c.node(H), q = c.parent(H), b = { v: H };
                return d.isUndefined(T) || (b.value = T), d.isUndefined(q) || (b.parent = q), b;
              });
            }
            function P(c) {
              return d.map(c.edges(), function(H) {
                var T = c.edge(H), q = { v: H.v, w: H.w };
                return d.isUndefined(H.name) || (q.name = H.name), d.isUndefined(T) || (q.value = T), q;
              });
            }
            function p(c) {
              var H = new v(c.options).setGraph(c.value);
              return d.each(c.nodes, function(T) {
                H.setNode(T.v, T.value), T.parent && H.setParent(T.v, T.parent);
              }), d.each(c.edges, function(T) {
                H.setEdge({ v: T.v, w: T.w, name: T.name }, T.value);
              }), H;
            }
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/lodash.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/lodash.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d;
            try {
              d = {
                clone: o(
                  /*! lodash/clone */
                  "../../../../node_modules/lodash/clone.js"
                ),
                constant: o(
                  /*! lodash/constant */
                  "../../../../node_modules/lodash/constant.js"
                ),
                each: o(
                  /*! lodash/each */
                  "../../../../node_modules/lodash/each.js"
                ),
                filter: o(
                  /*! lodash/filter */
                  "../../../../node_modules/lodash/filter.js"
                ),
                has: o(
                  /*! lodash/has */
                  "../../../../node_modules/lodash/has.js"
                ),
                isArray: o(
                  /*! lodash/isArray */
                  "../../../../node_modules/lodash/isArray.js"
                ),
                isEmpty: o(
                  /*! lodash/isEmpty */
                  "../../../../node_modules/lodash/isEmpty.js"
                ),
                isFunction: o(
                  /*! lodash/isFunction */
                  "../../../../node_modules/lodash/isFunction.js"
                ),
                isUndefined: o(
                  /*! lodash/isUndefined */
                  "../../../../node_modules/lodash/isUndefined.js"
                ),
                keys: o(
                  /*! lodash/keys */
                  "../../../../node_modules/lodash/keys.js"
                ),
                map: o(
                  /*! lodash/map */
                  "../../../../node_modules/lodash/map.js"
                ),
                reduce: o(
                  /*! lodash/reduce */
                  "../../../../node_modules/lodash/reduce.js"
                ),
                size: o(
                  /*! lodash/size */
                  "../../../../node_modules/lodash/size.js"
                ),
                transform: o(
                  /*! lodash/transform */
                  "../../../../node_modules/lodash/transform.js"
                ),
                union: o(
                  /*! lodash/union */
                  "../../../../node_modules/lodash/union.js"
                ),
                values: o(
                  /*! lodash/values */
                  "../../../../node_modules/lodash/values.js"
                )
              };
            } catch {
            }
            d || (d = window._), a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/graphlib/lib/version.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/graphlib/lib/version.js ***!
            \********************************************************/
          /***/
          (a) => {
            a.exports = "2.1.8";
          }
        ),
        /***/
        "../../../../node_modules/lodash/_DataView.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_DataView.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getNative */
              "../../../../node_modules/lodash/_getNative.js"
            ), v = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), u = d(v, "DataView");
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_Hash.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/_Hash.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_hashClear */
              "../../../../node_modules/lodash/_hashClear.js"
            ), v = o(
              /*! ./_hashDelete */
              "../../../../node_modules/lodash/_hashDelete.js"
            ), u = o(
              /*! ./_hashGet */
              "../../../../node_modules/lodash/_hashGet.js"
            ), l = o(
              /*! ./_hashHas */
              "../../../../node_modules/lodash/_hashHas.js"
            ), P = o(
              /*! ./_hashSet */
              "../../../../node_modules/lodash/_hashSet.js"
            );
            function p(c) {
              var H = -1, T = c == null ? 0 : c.length;
              for (this.clear(); ++H < T; ) {
                var q = c[H];
                this.set(q[0], q[1]);
              }
            }
            p.prototype.clear = d, p.prototype.delete = v, p.prototype.get = u, p.prototype.has = l, p.prototype.set = P, a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_ListCache.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_ListCache.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_listCacheClear */
              "../../../../node_modules/lodash/_listCacheClear.js"
            ), v = o(
              /*! ./_listCacheDelete */
              "../../../../node_modules/lodash/_listCacheDelete.js"
            ), u = o(
              /*! ./_listCacheGet */
              "../../../../node_modules/lodash/_listCacheGet.js"
            ), l = o(
              /*! ./_listCacheHas */
              "../../../../node_modules/lodash/_listCacheHas.js"
            ), P = o(
              /*! ./_listCacheSet */
              "../../../../node_modules/lodash/_listCacheSet.js"
            );
            function p(c) {
              var H = -1, T = c == null ? 0 : c.length;
              for (this.clear(); ++H < T; ) {
                var q = c[H];
                this.set(q[0], q[1]);
              }
            }
            p.prototype.clear = d, p.prototype.delete = v, p.prototype.get = u, p.prototype.has = l, p.prototype.set = P, a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_Map.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/lodash/_Map.js ***!
            \***********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getNative */
              "../../../../node_modules/lodash/_getNative.js"
            ), v = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), u = d(v, "Map");
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_MapCache.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_MapCache.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_mapCacheClear */
              "../../../../node_modules/lodash/_mapCacheClear.js"
            ), v = o(
              /*! ./_mapCacheDelete */
              "../../../../node_modules/lodash/_mapCacheDelete.js"
            ), u = o(
              /*! ./_mapCacheGet */
              "../../../../node_modules/lodash/_mapCacheGet.js"
            ), l = o(
              /*! ./_mapCacheHas */
              "../../../../node_modules/lodash/_mapCacheHas.js"
            ), P = o(
              /*! ./_mapCacheSet */
              "../../../../node_modules/lodash/_mapCacheSet.js"
            );
            function p(c) {
              var H = -1, T = c == null ? 0 : c.length;
              for (this.clear(); ++H < T; ) {
                var q = c[H];
                this.set(q[0], q[1]);
              }
            }
            p.prototype.clear = d, p.prototype.delete = v, p.prototype.get = u, p.prototype.has = l, p.prototype.set = P, a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_Promise.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_Promise.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getNative */
              "../../../../node_modules/lodash/_getNative.js"
            ), v = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), u = d(v, "Promise");
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_Set.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/lodash/_Set.js ***!
            \***********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getNative */
              "../../../../node_modules/lodash/_getNative.js"
            ), v = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), u = d(v, "Set");
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_SetCache.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_SetCache.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_MapCache */
              "../../../../node_modules/lodash/_MapCache.js"
            ), v = o(
              /*! ./_setCacheAdd */
              "../../../../node_modules/lodash/_setCacheAdd.js"
            ), u = o(
              /*! ./_setCacheHas */
              "../../../../node_modules/lodash/_setCacheHas.js"
            );
            function l(P) {
              var p = -1, c = P == null ? 0 : P.length;
              for (this.__data__ = new d(); ++p < c; )
                this.add(P[p]);
            }
            l.prototype.add = l.prototype.push = v, l.prototype.has = u, a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_Stack.js": (
          /*!*************************************************!*\
            !*** ../../../../node_modules/lodash/_Stack.js ***!
            \*************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_ListCache */
              "../../../../node_modules/lodash/_ListCache.js"
            ), v = o(
              /*! ./_stackClear */
              "../../../../node_modules/lodash/_stackClear.js"
            ), u = o(
              /*! ./_stackDelete */
              "../../../../node_modules/lodash/_stackDelete.js"
            ), l = o(
              /*! ./_stackGet */
              "../../../../node_modules/lodash/_stackGet.js"
            ), P = o(
              /*! ./_stackHas */
              "../../../../node_modules/lodash/_stackHas.js"
            ), p = o(
              /*! ./_stackSet */
              "../../../../node_modules/lodash/_stackSet.js"
            );
            function c(H) {
              var T = this.__data__ = new d(H);
              this.size = T.size;
            }
            c.prototype.clear = v, c.prototype.delete = u, c.prototype.get = l, c.prototype.has = P, c.prototype.set = p, a.exports = c;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_Symbol.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/lodash/_Symbol.js ***!
            \**************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), v = d.Symbol;
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_Uint8Array.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_Uint8Array.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), v = d.Uint8Array;
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_WeakMap.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_WeakMap.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getNative */
              "../../../../node_modules/lodash/_getNative.js"
            ), v = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), u = d(v, "WeakMap");
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_apply.js": (
          /*!*************************************************!*\
            !*** ../../../../node_modules/lodash/_apply.js ***!
            \*************************************************/
          /***/
          (a) => {
            function f(o, d, v) {
              switch (v.length) {
                case 0:
                  return o.call(d);
                case 1:
                  return o.call(d, v[0]);
                case 2:
                  return o.call(d, v[0], v[1]);
                case 3:
                  return o.call(d, v[0], v[1], v[2]);
              }
              return o.apply(d, v);
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_arrayEach.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_arrayEach.js ***!
            \*****************************************************/
          /***/
          (a) => {
            function f(o, d) {
              for (var v = -1, u = o == null ? 0 : o.length; ++v < u && d(o[v], v, o) !== !1; )
                ;
              return o;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_arrayFilter.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_arrayFilter.js ***!
            \*******************************************************/
          /***/
          (a) => {
            function f(o, d) {
              for (var v = -1, u = o == null ? 0 : o.length, l = 0, P = []; ++v < u; ) {
                var p = o[v];
                d(p, v, o) && (P[l++] = p);
              }
              return P;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_arrayIncludes.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_arrayIncludes.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseIndexOf */
              "../../../../node_modules/lodash/_baseIndexOf.js"
            );
            function v(u, l) {
              var P = u == null ? 0 : u.length;
              return !!P && d(u, l, 0) > -1;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_arrayIncludesWith.js": (
          /*!*************************************************************!*\
            !*** ../../../../node_modules/lodash/_arrayIncludesWith.js ***!
            \*************************************************************/
          /***/
          (a) => {
            function f(o, d, v) {
              for (var u = -1, l = o == null ? 0 : o.length; ++u < l; )
                if (v(d, o[u]))
                  return !0;
              return !1;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_arrayLikeKeys.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_arrayLikeKeys.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseTimes */
              "../../../../node_modules/lodash/_baseTimes.js"
            ), v = o(
              /*! ./isArguments */
              "../../../../node_modules/lodash/isArguments.js"
            ), u = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), l = o(
              /*! ./isBuffer */
              "../../../../node_modules/lodash/isBuffer.js"
            ), P = o(
              /*! ./_isIndex */
              "../../../../node_modules/lodash/_isIndex.js"
            ), p = o(
              /*! ./isTypedArray */
              "../../../../node_modules/lodash/isTypedArray.js"
            ), c = Object.prototype, H = c.hasOwnProperty;
            function T(q, b) {
              var j = u(q), w = !j && v(q), m = !j && !w && l(q), I = !j && !w && !m && p(q), N = j || w || m || I, k = N ? d(q.length, String) : [], R = k.length;
              for (var y in q)
                (b || H.call(q, y)) && !(N && // Safari 9 has enumerable `arguments.length` in strict mode.
                (y == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
                m && (y == "offset" || y == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
                I && (y == "buffer" || y == "byteLength" || y == "byteOffset") || // Skip index properties.
                P(y, R))) && k.push(y);
              return k;
            }
            a.exports = T;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_arrayMap.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_arrayMap.js ***!
            \****************************************************/
          /***/
          (a) => {
            function f(o, d) {
              for (var v = -1, u = o == null ? 0 : o.length, l = Array(u); ++v < u; )
                l[v] = d(o[v], v, o);
              return l;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_arrayPush.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_arrayPush.js ***!
            \*****************************************************/
          /***/
          (a) => {
            function f(o, d) {
              for (var v = -1, u = d.length, l = o.length; ++v < u; )
                o[l + v] = d[v];
              return o;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_arrayReduce.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_arrayReduce.js ***!
            \*******************************************************/
          /***/
          (a) => {
            function f(o, d, v, u) {
              var l = -1, P = o == null ? 0 : o.length;
              for (u && P && (v = o[++l]); ++l < P; )
                v = d(v, o[l], l, o);
              return v;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_arraySome.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_arraySome.js ***!
            \*****************************************************/
          /***/
          (a) => {
            function f(o, d) {
              for (var v = -1, u = o == null ? 0 : o.length; ++v < u; )
                if (d(o[v], v, o))
                  return !0;
              return !1;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_asciiSize.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_asciiSize.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseProperty */
              "../../../../node_modules/lodash/_baseProperty.js"
            ), v = d("length");
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_assignMergeValue.js": (
          /*!************************************************************!*\
            !*** ../../../../node_modules/lodash/_assignMergeValue.js ***!
            \************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseAssignValue */
              "../../../../node_modules/lodash/_baseAssignValue.js"
            ), v = o(
              /*! ./eq */
              "../../../../node_modules/lodash/eq.js"
            );
            function u(l, P, p) {
              (p !== void 0 && !v(l[P], p) || p === void 0 && !(P in l)) && d(l, P, p);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_assignValue.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_assignValue.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseAssignValue */
              "../../../../node_modules/lodash/_baseAssignValue.js"
            ), v = o(
              /*! ./eq */
              "../../../../node_modules/lodash/eq.js"
            ), u = Object.prototype, l = u.hasOwnProperty;
            function P(p, c, H) {
              var T = p[c];
              (!(l.call(p, c) && v(T, H)) || H === void 0 && !(c in p)) && d(p, c, H);
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_assocIndexOf.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_assocIndexOf.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./eq */
              "../../../../node_modules/lodash/eq.js"
            );
            function v(u, l) {
              for (var P = u.length; P--; )
                if (d(u[P][0], l))
                  return P;
              return -1;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseAssign.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseAssign.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_copyObject */
              "../../../../node_modules/lodash/_copyObject.js"
            ), v = o(
              /*! ./keys */
              "../../../../node_modules/lodash/keys.js"
            );
            function u(l, P) {
              return l && d(P, v(P), l);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseAssignIn.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseAssignIn.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_copyObject */
              "../../../../node_modules/lodash/_copyObject.js"
            ), v = o(
              /*! ./keysIn */
              "../../../../node_modules/lodash/keysIn.js"
            );
            function u(l, P) {
              return l && d(P, v(P), l);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseAssignValue.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseAssignValue.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_defineProperty */
              "../../../../node_modules/lodash/_defineProperty.js"
            );
            function v(u, l, P) {
              l == "__proto__" && d ? d(u, l, {
                configurable: !0,
                enumerable: !0,
                value: P,
                writable: !0
              }) : u[l] = P;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseClone.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseClone.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Stack */
              "../../../../node_modules/lodash/_Stack.js"
            ), v = o(
              /*! ./_arrayEach */
              "../../../../node_modules/lodash/_arrayEach.js"
            ), u = o(
              /*! ./_assignValue */
              "../../../../node_modules/lodash/_assignValue.js"
            ), l = o(
              /*! ./_baseAssign */
              "../../../../node_modules/lodash/_baseAssign.js"
            ), P = o(
              /*! ./_baseAssignIn */
              "../../../../node_modules/lodash/_baseAssignIn.js"
            ), p = o(
              /*! ./_cloneBuffer */
              "../../../../node_modules/lodash/_cloneBuffer.js"
            ), c = o(
              /*! ./_copyArray */
              "../../../../node_modules/lodash/_copyArray.js"
            ), H = o(
              /*! ./_copySymbols */
              "../../../../node_modules/lodash/_copySymbols.js"
            ), T = o(
              /*! ./_copySymbolsIn */
              "../../../../node_modules/lodash/_copySymbolsIn.js"
            ), q = o(
              /*! ./_getAllKeys */
              "../../../../node_modules/lodash/_getAllKeys.js"
            ), b = o(
              /*! ./_getAllKeysIn */
              "../../../../node_modules/lodash/_getAllKeysIn.js"
            ), j = o(
              /*! ./_getTag */
              "../../../../node_modules/lodash/_getTag.js"
            ), w = o(
              /*! ./_initCloneArray */
              "../../../../node_modules/lodash/_initCloneArray.js"
            ), m = o(
              /*! ./_initCloneByTag */
              "../../../../node_modules/lodash/_initCloneByTag.js"
            ), I = o(
              /*! ./_initCloneObject */
              "../../../../node_modules/lodash/_initCloneObject.js"
            ), N = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), k = o(
              /*! ./isBuffer */
              "../../../../node_modules/lodash/isBuffer.js"
            ), R = o(
              /*! ./isMap */
              "../../../../node_modules/lodash/isMap.js"
            ), y = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            ), O = o(
              /*! ./isSet */
              "../../../../node_modules/lodash/isSet.js"
            ), Y = o(
              /*! ./keys */
              "../../../../node_modules/lodash/keys.js"
            ), ee = o(
              /*! ./keysIn */
              "../../../../node_modules/lodash/keysIn.js"
            ), Z = 1, te = 2, fe = 4, _ = "[object Arguments]", G = "[object Array]", L = "[object Boolean]", $ = "[object Date]", ae = "[object Error]", Pe = "[object Function]", ge = "[object GeneratorFunction]", me = "[object Map]", Xe = "[object Number]", De = "[object Object]", ne = "[object RegExp]", re = "[object Set]", ve = "[object String]", qe = "[object Symbol]", ke = "[object WeakMap]", be = "[object ArrayBuffer]", Fe = "[object DataView]", Ke = "[object Float32Array]", nt = "[object Float64Array]", ut = "[object Int8Array]", bt = "[object Int16Array]", wt = "[object Int32Array]", Tt = "[object Uint8Array]", lr = "[object Uint8ClampedArray]", Qt = "[object Uint16Array]", tr = "[object Uint32Array]", br = {};
            br[_] = br[G] = br[be] = br[Fe] = br[L] = br[$] = br[Ke] = br[nt] = br[ut] = br[bt] = br[wt] = br[me] = br[Xe] = br[De] = br[ne] = br[re] = br[ve] = br[qe] = br[Tt] = br[lr] = br[Qt] = br[tr] = !0, br[ae] = br[Pe] = br[ke] = !1;
            function Xn(qr, En, Bn, Fi, Gt, xr) {
              var Br, nn = En & Z, sn = En & te, Pn = En & fe;
              if (Bn && (Br = Gt ? Bn(qr, Fi, Gt, xr) : Bn(qr)), Br !== void 0)
                return Br;
              if (!y(qr))
                return qr;
              var an = N(qr);
              if (an) {
                if (Br = w(qr), !nn)
                  return c(qr, Br);
              } else {
                var Wn = j(qr), rr = Wn == Pe || Wn == ge;
                if (k(qr))
                  return p(qr, nn);
                if (Wn == De || Wn == _ || rr && !Gt) {
                  if (Br = sn || rr ? {} : I(qr), !nn)
                    return sn ? T(qr, P(Br, qr)) : H(qr, l(Br, qr));
                } else {
                  if (!br[Wn])
                    return Gt ? qr : {};
                  Br = m(qr, Wn, nn);
                }
              }
              xr || (xr = new d());
              var Sr = xr.get(qr);
              if (Sr)
                return Sr;
              xr.set(qr, Br), O(qr) ? qr.forEach(function(Rn) {
                Br.add(Xn(Rn, En, Bn, Rn, qr, xr));
              }) : R(qr) && qr.forEach(function(Rn, Vn) {
                Br.set(Vn, Xn(Rn, En, Bn, Vn, qr, xr));
              });
              var nr = Pn ? sn ? b : q : sn ? ee : Y, Er = an ? void 0 : nr(qr);
              return v(Er || qr, function(Rn, Vn) {
                Er && (Vn = Rn, Rn = qr[Vn]), u(Br, Vn, Xn(Rn, En, Bn, Vn, qr, xr));
              }), Br;
            }
            a.exports = Xn;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseCreate.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseCreate.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            ), v = Object.create, u = /* @__PURE__ */ function() {
              function l() {
              }
              return function(P) {
                if (!d(P))
                  return {};
                if (v)
                  return v(P);
                l.prototype = P;
                var p = new l();
                return l.prototype = void 0, p;
              };
            }();
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseEach.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseEach.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseForOwn */
              "../../../../node_modules/lodash/_baseForOwn.js"
            ), v = o(
              /*! ./_createBaseEach */
              "../../../../node_modules/lodash/_createBaseEach.js"
            ), u = v(d);
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseExtremum.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseExtremum.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isSymbol */
              "../../../../node_modules/lodash/isSymbol.js"
            );
            function v(u, l, P) {
              for (var p = -1, c = u.length; ++p < c; ) {
                var H = u[p], T = l(H);
                if (T != null && (q === void 0 ? T === T && !d(T) : P(T, q)))
                  var q = T, b = H;
              }
              return b;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseFilter.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseFilter.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseEach */
              "../../../../node_modules/lodash/_baseEach.js"
            );
            function v(u, l) {
              var P = [];
              return d(u, function(p, c, H) {
                l(p, c, H) && P.push(p);
              }), P;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseFindIndex.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseFindIndex.js ***!
            \*********************************************************/
          /***/
          (a) => {
            function f(o, d, v, u) {
              for (var l = o.length, P = v + (u ? 1 : -1); u ? P-- : ++P < l; )
                if (d(o[P], P, o))
                  return P;
              return -1;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseFlatten.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseFlatten.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayPush */
              "../../../../node_modules/lodash/_arrayPush.js"
            ), v = o(
              /*! ./_isFlattenable */
              "../../../../node_modules/lodash/_isFlattenable.js"
            );
            function u(l, P, p, c, H) {
              var T = -1, q = l.length;
              for (p || (p = v), H || (H = []); ++T < q; ) {
                var b = l[T];
                P > 0 && p(b) ? P > 1 ? u(b, P - 1, p, c, H) : d(H, b) : c || (H[H.length] = b);
              }
              return H;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseFor.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_baseFor.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_createBaseFor */
              "../../../../node_modules/lodash/_createBaseFor.js"
            ), v = d();
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseForOwn.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseForOwn.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseFor */
              "../../../../node_modules/lodash/_baseFor.js"
            ), v = o(
              /*! ./keys */
              "../../../../node_modules/lodash/keys.js"
            );
            function u(l, P) {
              return l && d(l, P, v);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseGet.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_baseGet.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_castPath */
              "../../../../node_modules/lodash/_castPath.js"
            ), v = o(
              /*! ./_toKey */
              "../../../../node_modules/lodash/_toKey.js"
            );
            function u(l, P) {
              P = d(P, l);
              for (var p = 0, c = P.length; l != null && p < c; )
                l = l[v(P[p++])];
              return p && p == c ? l : void 0;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseGetAllKeys.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseGetAllKeys.js ***!
            \**********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayPush */
              "../../../../node_modules/lodash/_arrayPush.js"
            ), v = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            );
            function u(l, P, p) {
              var c = P(l);
              return v(l) ? c : d(c, p(l));
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseGetTag.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseGetTag.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Symbol */
              "../../../../node_modules/lodash/_Symbol.js"
            ), v = o(
              /*! ./_getRawTag */
              "../../../../node_modules/lodash/_getRawTag.js"
            ), u = o(
              /*! ./_objectToString */
              "../../../../node_modules/lodash/_objectToString.js"
            ), l = "[object Null]", P = "[object Undefined]", p = d ? d.toStringTag : void 0;
            function c(H) {
              return H == null ? H === void 0 ? P : l : p && p in Object(H) ? v(H) : u(H);
            }
            a.exports = c;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseGt.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/lodash/_baseGt.js ***!
            \**************************************************/
          /***/
          (a) => {
            function f(o, d) {
              return o > d;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseHas.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_baseHas.js ***!
            \***************************************************/
          /***/
          (a) => {
            var f = Object.prototype, o = f.hasOwnProperty;
            function d(v, u) {
              return v != null && o.call(v, u);
            }
            a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseHasIn.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseHasIn.js ***!
            \*****************************************************/
          /***/
          (a) => {
            function f(o, d) {
              return o != null && d in Object(o);
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIndexOf.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIndexOf.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseFindIndex */
              "../../../../node_modules/lodash/_baseFindIndex.js"
            ), v = o(
              /*! ./_baseIsNaN */
              "../../../../node_modules/lodash/_baseIsNaN.js"
            ), u = o(
              /*! ./_strictIndexOf */
              "../../../../node_modules/lodash/_strictIndexOf.js"
            );
            function l(P, p, c) {
              return p === p ? u(P, p, c) : d(P, v, c);
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIsArguments.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIsArguments.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGetTag */
              "../../../../node_modules/lodash/_baseGetTag.js"
            ), v = o(
              /*! ./isObjectLike */
              "../../../../node_modules/lodash/isObjectLike.js"
            ), u = "[object Arguments]";
            function l(P) {
              return v(P) && d(P) == u;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIsEqual.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIsEqual.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseIsEqualDeep */
              "../../../../node_modules/lodash/_baseIsEqualDeep.js"
            ), v = o(
              /*! ./isObjectLike */
              "../../../../node_modules/lodash/isObjectLike.js"
            );
            function u(l, P, p, c, H) {
              return l === P ? !0 : l == null || P == null || !v(l) && !v(P) ? l !== l && P !== P : d(l, P, p, c, u, H);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIsEqualDeep.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIsEqualDeep.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Stack */
              "../../../../node_modules/lodash/_Stack.js"
            ), v = o(
              /*! ./_equalArrays */
              "../../../../node_modules/lodash/_equalArrays.js"
            ), u = o(
              /*! ./_equalByTag */
              "../../../../node_modules/lodash/_equalByTag.js"
            ), l = o(
              /*! ./_equalObjects */
              "../../../../node_modules/lodash/_equalObjects.js"
            ), P = o(
              /*! ./_getTag */
              "../../../../node_modules/lodash/_getTag.js"
            ), p = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), c = o(
              /*! ./isBuffer */
              "../../../../node_modules/lodash/isBuffer.js"
            ), H = o(
              /*! ./isTypedArray */
              "../../../../node_modules/lodash/isTypedArray.js"
            ), T = 1, q = "[object Arguments]", b = "[object Array]", j = "[object Object]", w = Object.prototype, m = w.hasOwnProperty;
            function I(N, k, R, y, O, Y) {
              var ee = p(N), Z = p(k), te = ee ? b : P(N), fe = Z ? b : P(k);
              te = te == q ? j : te, fe = fe == q ? j : fe;
              var _ = te == j, G = fe == j, L = te == fe;
              if (L && c(N)) {
                if (!c(k))
                  return !1;
                ee = !0, _ = !1;
              }
              if (L && !_)
                return Y || (Y = new d()), ee || H(N) ? v(N, k, R, y, O, Y) : u(N, k, te, R, y, O, Y);
              if (!(R & T)) {
                var $ = _ && m.call(N, "__wrapped__"), ae = G && m.call(k, "__wrapped__");
                if ($ || ae) {
                  var Pe = $ ? N.value() : N, ge = ae ? k.value() : k;
                  return Y || (Y = new d()), O(Pe, ge, R, y, Y);
                }
              }
              return L ? (Y || (Y = new d()), l(N, k, R, y, O, Y)) : !1;
            }
            a.exports = I;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIsMap.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIsMap.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getTag */
              "../../../../node_modules/lodash/_getTag.js"
            ), v = o(
              /*! ./isObjectLike */
              "../../../../node_modules/lodash/isObjectLike.js"
            ), u = "[object Map]";
            function l(P) {
              return v(P) && d(P) == u;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIsMatch.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIsMatch.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Stack */
              "../../../../node_modules/lodash/_Stack.js"
            ), v = o(
              /*! ./_baseIsEqual */
              "../../../../node_modules/lodash/_baseIsEqual.js"
            ), u = 1, l = 2;
            function P(p, c, H, T) {
              var q = H.length, b = q, j = !T;
              if (p == null)
                return !b;
              for (p = Object(p); q--; ) {
                var w = H[q];
                if (j && w[2] ? w[1] !== p[w[0]] : !(w[0] in p))
                  return !1;
              }
              for (; ++q < b; ) {
                w = H[q];
                var m = w[0], I = p[m], N = w[1];
                if (j && w[2]) {
                  if (I === void 0 && !(m in p))
                    return !1;
                } else {
                  var k = new d();
                  if (T)
                    var R = T(I, N, m, p, c, k);
                  if (!(R === void 0 ? v(N, I, u | l, T, k) : R))
                    return !1;
                }
              }
              return !0;
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIsNaN.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIsNaN.js ***!
            \*****************************************************/
          /***/
          (a) => {
            function f(o) {
              return o !== o;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIsNative.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIsNative.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isFunction */
              "../../../../node_modules/lodash/isFunction.js"
            ), v = o(
              /*! ./_isMasked */
              "../../../../node_modules/lodash/_isMasked.js"
            ), u = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            ), l = o(
              /*! ./_toSource */
              "../../../../node_modules/lodash/_toSource.js"
            ), P = /[\\^$.*+?()[\]{}|]/g, p = /^\[object .+?Constructor\]$/, c = Function.prototype, H = Object.prototype, T = c.toString, q = H.hasOwnProperty, b = RegExp(
              "^" + T.call(q).replace(P, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
            );
            function j(w) {
              if (!u(w) || v(w))
                return !1;
              var m = d(w) ? b : p;
              return m.test(l(w));
            }
            a.exports = j;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIsSet.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIsSet.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getTag */
              "../../../../node_modules/lodash/_getTag.js"
            ), v = o(
              /*! ./isObjectLike */
              "../../../../node_modules/lodash/isObjectLike.js"
            ), u = "[object Set]";
            function l(P) {
              return v(P) && d(P) == u;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIsTypedArray.js": (
          /*!************************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIsTypedArray.js ***!
            \************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGetTag */
              "../../../../node_modules/lodash/_baseGetTag.js"
            ), v = o(
              /*! ./isLength */
              "../../../../node_modules/lodash/isLength.js"
            ), u = o(
              /*! ./isObjectLike */
              "../../../../node_modules/lodash/isObjectLike.js"
            ), l = "[object Arguments]", P = "[object Array]", p = "[object Boolean]", c = "[object Date]", H = "[object Error]", T = "[object Function]", q = "[object Map]", b = "[object Number]", j = "[object Object]", w = "[object RegExp]", m = "[object Set]", I = "[object String]", N = "[object WeakMap]", k = "[object ArrayBuffer]", R = "[object DataView]", y = "[object Float32Array]", O = "[object Float64Array]", Y = "[object Int8Array]", ee = "[object Int16Array]", Z = "[object Int32Array]", te = "[object Uint8Array]", fe = "[object Uint8ClampedArray]", _ = "[object Uint16Array]", G = "[object Uint32Array]", L = {};
            L[y] = L[O] = L[Y] = L[ee] = L[Z] = L[te] = L[fe] = L[_] = L[G] = !0, L[l] = L[P] = L[k] = L[p] = L[R] = L[c] = L[H] = L[T] = L[q] = L[b] = L[j] = L[w] = L[m] = L[I] = L[N] = !1;
            function $(ae) {
              return u(ae) && v(ae.length) && !!L[d(ae)];
            }
            a.exports = $;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseIteratee.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseIteratee.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseMatches */
              "../../../../node_modules/lodash/_baseMatches.js"
            ), v = o(
              /*! ./_baseMatchesProperty */
              "../../../../node_modules/lodash/_baseMatchesProperty.js"
            ), u = o(
              /*! ./identity */
              "../../../../node_modules/lodash/identity.js"
            ), l = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), P = o(
              /*! ./property */
              "../../../../node_modules/lodash/property.js"
            );
            function p(c) {
              return typeof c == "function" ? c : c == null ? u : typeof c == "object" ? l(c) ? v(c[0], c[1]) : d(c) : P(c);
            }
            a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseKeys.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseKeys.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_isPrototype */
              "../../../../node_modules/lodash/_isPrototype.js"
            ), v = o(
              /*! ./_nativeKeys */
              "../../../../node_modules/lodash/_nativeKeys.js"
            ), u = Object.prototype, l = u.hasOwnProperty;
            function P(p) {
              if (!d(p))
                return v(p);
              var c = [];
              for (var H in Object(p))
                l.call(p, H) && H != "constructor" && c.push(H);
              return c;
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseKeysIn.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseKeysIn.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            ), v = o(
              /*! ./_isPrototype */
              "../../../../node_modules/lodash/_isPrototype.js"
            ), u = o(
              /*! ./_nativeKeysIn */
              "../../../../node_modules/lodash/_nativeKeysIn.js"
            ), l = Object.prototype, P = l.hasOwnProperty;
            function p(c) {
              if (!d(c))
                return u(c);
              var H = v(c), T = [];
              for (var q in c)
                q == "constructor" && (H || !P.call(c, q)) || T.push(q);
              return T;
            }
            a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseLt.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/lodash/_baseLt.js ***!
            \**************************************************/
          /***/
          (a) => {
            function f(o, d) {
              return o < d;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseMap.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_baseMap.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseEach */
              "../../../../node_modules/lodash/_baseEach.js"
            ), v = o(
              /*! ./isArrayLike */
              "../../../../node_modules/lodash/isArrayLike.js"
            );
            function u(l, P) {
              var p = -1, c = v(l) ? Array(l.length) : [];
              return d(l, function(H, T, q) {
                c[++p] = P(H, T, q);
              }), c;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseMatches.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseMatches.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseIsMatch */
              "../../../../node_modules/lodash/_baseIsMatch.js"
            ), v = o(
              /*! ./_getMatchData */
              "../../../../node_modules/lodash/_getMatchData.js"
            ), u = o(
              /*! ./_matchesStrictComparable */
              "../../../../node_modules/lodash/_matchesStrictComparable.js"
            );
            function l(P) {
              var p = v(P);
              return p.length == 1 && p[0][2] ? u(p[0][0], p[0][1]) : function(c) {
                return c === P || d(c, P, p);
              };
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseMatchesProperty.js": (
          /*!***************************************************************!*\
            !*** ../../../../node_modules/lodash/_baseMatchesProperty.js ***!
            \***************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseIsEqual */
              "../../../../node_modules/lodash/_baseIsEqual.js"
            ), v = o(
              /*! ./get */
              "../../../../node_modules/lodash/get.js"
            ), u = o(
              /*! ./hasIn */
              "../../../../node_modules/lodash/hasIn.js"
            ), l = o(
              /*! ./_isKey */
              "../../../../node_modules/lodash/_isKey.js"
            ), P = o(
              /*! ./_isStrictComparable */
              "../../../../node_modules/lodash/_isStrictComparable.js"
            ), p = o(
              /*! ./_matchesStrictComparable */
              "../../../../node_modules/lodash/_matchesStrictComparable.js"
            ), c = o(
              /*! ./_toKey */
              "../../../../node_modules/lodash/_toKey.js"
            ), H = 1, T = 2;
            function q(b, j) {
              return l(b) && P(j) ? p(c(b), j) : function(w) {
                var m = v(w, b);
                return m === void 0 && m === j ? u(w, b) : d(j, m, H | T);
              };
            }
            a.exports = q;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseMerge.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseMerge.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Stack */
              "../../../../node_modules/lodash/_Stack.js"
            ), v = o(
              /*! ./_assignMergeValue */
              "../../../../node_modules/lodash/_assignMergeValue.js"
            ), u = o(
              /*! ./_baseFor */
              "../../../../node_modules/lodash/_baseFor.js"
            ), l = o(
              /*! ./_baseMergeDeep */
              "../../../../node_modules/lodash/_baseMergeDeep.js"
            ), P = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            ), p = o(
              /*! ./keysIn */
              "../../../../node_modules/lodash/keysIn.js"
            ), c = o(
              /*! ./_safeGet */
              "../../../../node_modules/lodash/_safeGet.js"
            );
            function H(T, q, b, j, w) {
              T !== q && u(q, function(m, I) {
                if (w || (w = new d()), P(m))
                  l(T, q, I, b, H, j, w);
                else {
                  var N = j ? j(c(T, I), m, I + "", T, q, w) : void 0;
                  N === void 0 && (N = m), v(T, I, N);
                }
              }, p);
            }
            a.exports = H;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseMergeDeep.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseMergeDeep.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_assignMergeValue */
              "../../../../node_modules/lodash/_assignMergeValue.js"
            ), v = o(
              /*! ./_cloneBuffer */
              "../../../../node_modules/lodash/_cloneBuffer.js"
            ), u = o(
              /*! ./_cloneTypedArray */
              "../../../../node_modules/lodash/_cloneTypedArray.js"
            ), l = o(
              /*! ./_copyArray */
              "../../../../node_modules/lodash/_copyArray.js"
            ), P = o(
              /*! ./_initCloneObject */
              "../../../../node_modules/lodash/_initCloneObject.js"
            ), p = o(
              /*! ./isArguments */
              "../../../../node_modules/lodash/isArguments.js"
            ), c = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), H = o(
              /*! ./isArrayLikeObject */
              "../../../../node_modules/lodash/isArrayLikeObject.js"
            ), T = o(
              /*! ./isBuffer */
              "../../../../node_modules/lodash/isBuffer.js"
            ), q = o(
              /*! ./isFunction */
              "../../../../node_modules/lodash/isFunction.js"
            ), b = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            ), j = o(
              /*! ./isPlainObject */
              "../../../../node_modules/lodash/isPlainObject.js"
            ), w = o(
              /*! ./isTypedArray */
              "../../../../node_modules/lodash/isTypedArray.js"
            ), m = o(
              /*! ./_safeGet */
              "../../../../node_modules/lodash/_safeGet.js"
            ), I = o(
              /*! ./toPlainObject */
              "../../../../node_modules/lodash/toPlainObject.js"
            );
            function N(k, R, y, O, Y, ee, Z) {
              var te = m(k, y), fe = m(R, y), _ = Z.get(fe);
              if (_) {
                d(k, y, _);
                return;
              }
              var G = ee ? ee(te, fe, y + "", k, R, Z) : void 0, L = G === void 0;
              if (L) {
                var $ = c(fe), ae = !$ && T(fe), Pe = !$ && !ae && w(fe);
                G = fe, $ || ae || Pe ? c(te) ? G = te : H(te) ? G = l(te) : ae ? (L = !1, G = v(fe, !0)) : Pe ? (L = !1, G = u(fe, !0)) : G = [] : j(fe) || p(fe) ? (G = te, p(te) ? G = I(te) : (!b(te) || q(te)) && (G = P(fe))) : L = !1;
              }
              L && (Z.set(fe, G), Y(G, fe, O, ee, Z), Z.delete(fe)), d(k, y, G);
            }
            a.exports = N;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseOrderBy.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseOrderBy.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayMap */
              "../../../../node_modules/lodash/_arrayMap.js"
            ), v = o(
              /*! ./_baseGet */
              "../../../../node_modules/lodash/_baseGet.js"
            ), u = o(
              /*! ./_baseIteratee */
              "../../../../node_modules/lodash/_baseIteratee.js"
            ), l = o(
              /*! ./_baseMap */
              "../../../../node_modules/lodash/_baseMap.js"
            ), P = o(
              /*! ./_baseSortBy */
              "../../../../node_modules/lodash/_baseSortBy.js"
            ), p = o(
              /*! ./_baseUnary */
              "../../../../node_modules/lodash/_baseUnary.js"
            ), c = o(
              /*! ./_compareMultiple */
              "../../../../node_modules/lodash/_compareMultiple.js"
            ), H = o(
              /*! ./identity */
              "../../../../node_modules/lodash/identity.js"
            ), T = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            );
            function q(b, j, w) {
              j.length ? j = d(j, function(N) {
                return T(N) ? function(k) {
                  return v(k, N.length === 1 ? N[0] : N);
                } : N;
              }) : j = [H];
              var m = -1;
              j = d(j, p(u));
              var I = l(b, function(N, k, R) {
                var y = d(j, function(O) {
                  return O(N);
                });
                return { criteria: y, index: ++m, value: N };
              });
              return P(I, function(N, k) {
                return c(N, k, w);
              });
            }
            a.exports = q;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_basePick.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_basePick.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_basePickBy */
              "../../../../node_modules/lodash/_basePickBy.js"
            ), v = o(
              /*! ./hasIn */
              "../../../../node_modules/lodash/hasIn.js"
            );
            function u(l, P) {
              return d(l, P, function(p, c) {
                return v(l, c);
              });
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_basePickBy.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_basePickBy.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGet */
              "../../../../node_modules/lodash/_baseGet.js"
            ), v = o(
              /*! ./_baseSet */
              "../../../../node_modules/lodash/_baseSet.js"
            ), u = o(
              /*! ./_castPath */
              "../../../../node_modules/lodash/_castPath.js"
            );
            function l(P, p, c) {
              for (var H = -1, T = p.length, q = {}; ++H < T; ) {
                var b = p[H], j = d(P, b);
                c(j, b) && v(q, u(b, P), j);
              }
              return q;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseProperty.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseProperty.js ***!
            \********************************************************/
          /***/
          (a) => {
            function f(o) {
              return function(d) {
                return d == null ? void 0 : d[o];
              };
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_basePropertyDeep.js": (
          /*!************************************************************!*\
            !*** ../../../../node_modules/lodash/_basePropertyDeep.js ***!
            \************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGet */
              "../../../../node_modules/lodash/_baseGet.js"
            );
            function v(u) {
              return function(l) {
                return d(l, u);
              };
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseRange.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseRange.js ***!
            \*****************************************************/
          /***/
          (a) => {
            var f = Math.ceil, o = Math.max;
            function d(v, u, l, P) {
              for (var p = -1, c = o(f((u - v) / (l || 1)), 0), H = Array(c); c--; )
                H[P ? c : ++p] = v, v += l;
              return H;
            }
            a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseReduce.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseReduce.js ***!
            \******************************************************/
          /***/
          (a) => {
            function f(o, d, v, u, l) {
              return l(o, function(P, p, c) {
                v = u ? (u = !1, P) : d(v, P, p, c);
              }), v;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseRest.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseRest.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./identity */
              "../../../../node_modules/lodash/identity.js"
            ), v = o(
              /*! ./_overRest */
              "../../../../node_modules/lodash/_overRest.js"
            ), u = o(
              /*! ./_setToString */
              "../../../../node_modules/lodash/_setToString.js"
            );
            function l(P, p) {
              return u(v(P, p, d), P + "");
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseSet.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_baseSet.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_assignValue */
              "../../../../node_modules/lodash/_assignValue.js"
            ), v = o(
              /*! ./_castPath */
              "../../../../node_modules/lodash/_castPath.js"
            ), u = o(
              /*! ./_isIndex */
              "../../../../node_modules/lodash/_isIndex.js"
            ), l = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            ), P = o(
              /*! ./_toKey */
              "../../../../node_modules/lodash/_toKey.js"
            );
            function p(c, H, T, q) {
              if (!l(c))
                return c;
              H = v(H, c);
              for (var b = -1, j = H.length, w = j - 1, m = c; m != null && ++b < j; ) {
                var I = P(H[b]), N = T;
                if (I === "__proto__" || I === "constructor" || I === "prototype")
                  return c;
                if (b != w) {
                  var k = m[I];
                  N = q ? q(k, I, m) : void 0, N === void 0 && (N = l(k) ? k : u(H[b + 1]) ? [] : {});
                }
                d(m, I, N), m = m[I];
              }
              return c;
            }
            a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseSetToString.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseSetToString.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./constant */
              "../../../../node_modules/lodash/constant.js"
            ), v = o(
              /*! ./_defineProperty */
              "../../../../node_modules/lodash/_defineProperty.js"
            ), u = o(
              /*! ./identity */
              "../../../../node_modules/lodash/identity.js"
            ), l = v ? function(P, p) {
              return v(P, "toString", {
                configurable: !0,
                enumerable: !1,
                value: d(p),
                writable: !0
              });
            } : u;
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseSortBy.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseSortBy.js ***!
            \******************************************************/
          /***/
          (a) => {
            function f(o, d) {
              var v = o.length;
              for (o.sort(d); v--; )
                o[v] = o[v].value;
              return o;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseTimes.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseTimes.js ***!
            \*****************************************************/
          /***/
          (a) => {
            function f(o, d) {
              for (var v = -1, u = Array(o); ++v < o; )
                u[v] = d(v);
              return u;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseToString.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseToString.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Symbol */
              "../../../../node_modules/lodash/_Symbol.js"
            ), v = o(
              /*! ./_arrayMap */
              "../../../../node_modules/lodash/_arrayMap.js"
            ), u = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), l = o(
              /*! ./isSymbol */
              "../../../../node_modules/lodash/isSymbol.js"
            ), P = 1 / 0, p = d ? d.prototype : void 0, c = p ? p.toString : void 0;
            function H(T) {
              if (typeof T == "string")
                return T;
              if (u(T))
                return v(T, H) + "";
              if (l(T))
                return c ? c.call(T) : "";
              var q = T + "";
              return q == "0" && 1 / T == -P ? "-0" : q;
            }
            a.exports = H;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseTrim.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseTrim.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_trimmedEndIndex */
              "../../../../node_modules/lodash/_trimmedEndIndex.js"
            ), v = /^\s+/;
            function u(l) {
              return l && l.slice(0, d(l) + 1).replace(v, "");
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseUnary.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseUnary.js ***!
            \*****************************************************/
          /***/
          (a) => {
            function f(o) {
              return function(d) {
                return o(d);
              };
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseUniq.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_baseUniq.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_SetCache */
              "../../../../node_modules/lodash/_SetCache.js"
            ), v = o(
              /*! ./_arrayIncludes */
              "../../../../node_modules/lodash/_arrayIncludes.js"
            ), u = o(
              /*! ./_arrayIncludesWith */
              "../../../../node_modules/lodash/_arrayIncludesWith.js"
            ), l = o(
              /*! ./_cacheHas */
              "../../../../node_modules/lodash/_cacheHas.js"
            ), P = o(
              /*! ./_createSet */
              "../../../../node_modules/lodash/_createSet.js"
            ), p = o(
              /*! ./_setToArray */
              "../../../../node_modules/lodash/_setToArray.js"
            ), c = 200;
            function H(T, q, b) {
              var j = -1, w = v, m = T.length, I = !0, N = [], k = N;
              if (b)
                I = !1, w = u;
              else if (m >= c) {
                var R = q ? null : P(T);
                if (R)
                  return p(R);
                I = !1, w = l, k = new d();
              } else
                k = q ? [] : N;
              e:
                for (; ++j < m; ) {
                  var y = T[j], O = q ? q(y) : y;
                  if (y = b || y !== 0 ? y : 0, I && O === O) {
                    for (var Y = k.length; Y--; )
                      if (k[Y] === O)
                        continue e;
                    q && k.push(O), N.push(y);
                  } else
                    w(k, O, b) || (k !== N && k.push(O), N.push(y));
                }
              return N;
            }
            a.exports = H;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseValues.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_baseValues.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayMap */
              "../../../../node_modules/lodash/_arrayMap.js"
            );
            function v(u, l) {
              return d(l, function(P) {
                return u[P];
              });
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_baseZipObject.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_baseZipObject.js ***!
            \*********************************************************/
          /***/
          (a) => {
            function f(o, d, v) {
              for (var u = -1, l = o.length, P = d.length, p = {}; ++u < l; ) {
                var c = u < P ? d[u] : void 0;
                v(p, o[u], c);
              }
              return p;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_cacheHas.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_cacheHas.js ***!
            \****************************************************/
          /***/
          (a) => {
            function f(o, d) {
              return o.has(d);
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_castFunction.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_castFunction.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./identity */
              "../../../../node_modules/lodash/identity.js"
            );
            function v(u) {
              return typeof u == "function" ? u : d;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_castPath.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_castPath.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), v = o(
              /*! ./_isKey */
              "../../../../node_modules/lodash/_isKey.js"
            ), u = o(
              /*! ./_stringToPath */
              "../../../../node_modules/lodash/_stringToPath.js"
            ), l = o(
              /*! ./toString */
              "../../../../node_modules/lodash/toString.js"
            );
            function P(p, c) {
              return d(p) ? p : v(p, c) ? [p] : u(l(p));
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_cloneArrayBuffer.js": (
          /*!************************************************************!*\
            !*** ../../../../node_modules/lodash/_cloneArrayBuffer.js ***!
            \************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Uint8Array */
              "../../../../node_modules/lodash/_Uint8Array.js"
            );
            function v(u) {
              var l = new u.constructor(u.byteLength);
              return new d(l).set(new d(u)), l;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_cloneBuffer.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_cloneBuffer.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            a = o.nmd(a);
            var d = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), v = f && !f.nodeType && f, u = v && !0 && a && !a.nodeType && a, l = u && u.exports === v, P = l ? d.Buffer : void 0, p = P ? P.allocUnsafe : void 0;
            function c(H, T) {
              if (T)
                return H.slice();
              var q = H.length, b = p ? p(q) : new H.constructor(q);
              return H.copy(b), b;
            }
            a.exports = c;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_cloneDataView.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_cloneDataView.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_cloneArrayBuffer */
              "../../../../node_modules/lodash/_cloneArrayBuffer.js"
            );
            function v(u, l) {
              var P = l ? d(u.buffer) : u.buffer;
              return new u.constructor(P, u.byteOffset, u.byteLength);
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_cloneRegExp.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_cloneRegExp.js ***!
            \*******************************************************/
          /***/
          (a) => {
            var f = /\w*$/;
            function o(d) {
              var v = new d.constructor(d.source, f.exec(d));
              return v.lastIndex = d.lastIndex, v;
            }
            a.exports = o;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_cloneSymbol.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_cloneSymbol.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Symbol */
              "../../../../node_modules/lodash/_Symbol.js"
            ), v = d ? d.prototype : void 0, u = v ? v.valueOf : void 0;
            function l(P) {
              return u ? Object(u.call(P)) : {};
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_cloneTypedArray.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/lodash/_cloneTypedArray.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_cloneArrayBuffer */
              "../../../../node_modules/lodash/_cloneArrayBuffer.js"
            );
            function v(u, l) {
              var P = l ? d(u.buffer) : u.buffer;
              return new u.constructor(P, u.byteOffset, u.length);
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_compareAscending.js": (
          /*!************************************************************!*\
            !*** ../../../../node_modules/lodash/_compareAscending.js ***!
            \************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isSymbol */
              "../../../../node_modules/lodash/isSymbol.js"
            );
            function v(u, l) {
              if (u !== l) {
                var P = u !== void 0, p = u === null, c = u === u, H = d(u), T = l !== void 0, q = l === null, b = l === l, j = d(l);
                if (!q && !j && !H && u > l || H && T && b && !q && !j || p && T && b || !P && b || !c)
                  return 1;
                if (!p && !H && !j && u < l || j && P && c && !p && !H || q && P && c || !T && c || !b)
                  return -1;
              }
              return 0;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_compareMultiple.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/lodash/_compareMultiple.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_compareAscending */
              "../../../../node_modules/lodash/_compareAscending.js"
            );
            function v(u, l, P) {
              for (var p = -1, c = u.criteria, H = l.criteria, T = c.length, q = P.length; ++p < T; ) {
                var b = d(c[p], H[p]);
                if (b) {
                  if (p >= q)
                    return b;
                  var j = P[p];
                  return b * (j == "desc" ? -1 : 1);
                }
              }
              return u.index - l.index;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_copyArray.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_copyArray.js ***!
            \*****************************************************/
          /***/
          (a) => {
            function f(o, d) {
              var v = -1, u = o.length;
              for (d || (d = Array(u)); ++v < u; )
                d[v] = o[v];
              return d;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_copyObject.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_copyObject.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_assignValue */
              "../../../../node_modules/lodash/_assignValue.js"
            ), v = o(
              /*! ./_baseAssignValue */
              "../../../../node_modules/lodash/_baseAssignValue.js"
            );
            function u(l, P, p, c) {
              var H = !p;
              p || (p = {});
              for (var T = -1, q = P.length; ++T < q; ) {
                var b = P[T], j = c ? c(p[b], l[b], b, p, l) : void 0;
                j === void 0 && (j = l[b]), H ? v(p, b, j) : d(p, b, j);
              }
              return p;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_copySymbols.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_copySymbols.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_copyObject */
              "../../../../node_modules/lodash/_copyObject.js"
            ), v = o(
              /*! ./_getSymbols */
              "../../../../node_modules/lodash/_getSymbols.js"
            );
            function u(l, P) {
              return d(l, v(l), P);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_copySymbolsIn.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_copySymbolsIn.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_copyObject */
              "../../../../node_modules/lodash/_copyObject.js"
            ), v = o(
              /*! ./_getSymbolsIn */
              "../../../../node_modules/lodash/_getSymbolsIn.js"
            );
            function u(l, P) {
              return d(l, v(l), P);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_coreJsData.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_coreJsData.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), v = d["__core-js_shared__"];
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_createAssigner.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/lodash/_createAssigner.js ***!
            \**********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseRest */
              "../../../../node_modules/lodash/_baseRest.js"
            ), v = o(
              /*! ./_isIterateeCall */
              "../../../../node_modules/lodash/_isIterateeCall.js"
            );
            function u(l) {
              return d(function(P, p) {
                var c = -1, H = p.length, T = H > 1 ? p[H - 1] : void 0, q = H > 2 ? p[2] : void 0;
                for (T = l.length > 3 && typeof T == "function" ? (H--, T) : void 0, q && v(p[0], p[1], q) && (T = H < 3 ? void 0 : T, H = 1), P = Object(P); ++c < H; ) {
                  var b = p[c];
                  b && l(P, b, c, T);
                }
                return P;
              });
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_createBaseEach.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/lodash/_createBaseEach.js ***!
            \**********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isArrayLike */
              "../../../../node_modules/lodash/isArrayLike.js"
            );
            function v(u, l) {
              return function(P, p) {
                if (P == null)
                  return P;
                if (!d(P))
                  return u(P, p);
                for (var c = P.length, H = l ? c : -1, T = Object(P); (l ? H-- : ++H < c) && p(T[H], H, T) !== !1; )
                  ;
                return P;
              };
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_createBaseFor.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_createBaseFor.js ***!
            \*********************************************************/
          /***/
          (a) => {
            function f(o) {
              return function(d, v, u) {
                for (var l = -1, P = Object(d), p = u(d), c = p.length; c--; ) {
                  var H = p[o ? c : ++l];
                  if (v(P[H], H, P) === !1)
                    break;
                }
                return d;
              };
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_createFind.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_createFind.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseIteratee */
              "../../../../node_modules/lodash/_baseIteratee.js"
            ), v = o(
              /*! ./isArrayLike */
              "../../../../node_modules/lodash/isArrayLike.js"
            ), u = o(
              /*! ./keys */
              "../../../../node_modules/lodash/keys.js"
            );
            function l(P) {
              return function(p, c, H) {
                var T = Object(p);
                if (!v(p)) {
                  var q = d(c, 3);
                  p = u(p), c = function(j) {
                    return q(T[j], j, T);
                  };
                }
                var b = P(p, c, H);
                return b > -1 ? T[q ? p[b] : b] : void 0;
              };
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_createRange.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_createRange.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseRange */
              "../../../../node_modules/lodash/_baseRange.js"
            ), v = o(
              /*! ./_isIterateeCall */
              "../../../../node_modules/lodash/_isIterateeCall.js"
            ), u = o(
              /*! ./toFinite */
              "../../../../node_modules/lodash/toFinite.js"
            );
            function l(P) {
              return function(p, c, H) {
                return H && typeof H != "number" && v(p, c, H) && (c = H = void 0), p = u(p), c === void 0 ? (c = p, p = 0) : c = u(c), H = H === void 0 ? p < c ? 1 : -1 : u(H), d(p, c, H, P);
              };
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_createSet.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_createSet.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Set */
              "../../../../node_modules/lodash/_Set.js"
            ), v = o(
              /*! ./noop */
              "../../../../node_modules/lodash/noop.js"
            ), u = o(
              /*! ./_setToArray */
              "../../../../node_modules/lodash/_setToArray.js"
            ), l = 1 / 0, P = d && 1 / u(new d([, -0]))[1] == l ? function(p) {
              return new d(p);
            } : v;
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_defineProperty.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/lodash/_defineProperty.js ***!
            \**********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getNative */
              "../../../../node_modules/lodash/_getNative.js"
            ), v = function() {
              try {
                var u = d(Object, "defineProperty");
                return u({}, "", {}), u;
              } catch {
              }
            }();
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_equalArrays.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_equalArrays.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_SetCache */
              "../../../../node_modules/lodash/_SetCache.js"
            ), v = o(
              /*! ./_arraySome */
              "../../../../node_modules/lodash/_arraySome.js"
            ), u = o(
              /*! ./_cacheHas */
              "../../../../node_modules/lodash/_cacheHas.js"
            ), l = 1, P = 2;
            function p(c, H, T, q, b, j) {
              var w = T & l, m = c.length, I = H.length;
              if (m != I && !(w && I > m))
                return !1;
              var N = j.get(c), k = j.get(H);
              if (N && k)
                return N == H && k == c;
              var R = -1, y = !0, O = T & P ? new d() : void 0;
              for (j.set(c, H), j.set(H, c); ++R < m; ) {
                var Y = c[R], ee = H[R];
                if (q)
                  var Z = w ? q(ee, Y, R, H, c, j) : q(Y, ee, R, c, H, j);
                if (Z !== void 0) {
                  if (Z)
                    continue;
                  y = !1;
                  break;
                }
                if (O) {
                  if (!v(H, function(te, fe) {
                    if (!u(O, fe) && (Y === te || b(Y, te, T, q, j)))
                      return O.push(fe);
                  })) {
                    y = !1;
                    break;
                  }
                } else if (!(Y === ee || b(Y, ee, T, q, j))) {
                  y = !1;
                  break;
                }
              }
              return j.delete(c), j.delete(H), y;
            }
            a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_equalByTag.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_equalByTag.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Symbol */
              "../../../../node_modules/lodash/_Symbol.js"
            ), v = o(
              /*! ./_Uint8Array */
              "../../../../node_modules/lodash/_Uint8Array.js"
            ), u = o(
              /*! ./eq */
              "../../../../node_modules/lodash/eq.js"
            ), l = o(
              /*! ./_equalArrays */
              "../../../../node_modules/lodash/_equalArrays.js"
            ), P = o(
              /*! ./_mapToArray */
              "../../../../node_modules/lodash/_mapToArray.js"
            ), p = o(
              /*! ./_setToArray */
              "../../../../node_modules/lodash/_setToArray.js"
            ), c = 1, H = 2, T = "[object Boolean]", q = "[object Date]", b = "[object Error]", j = "[object Map]", w = "[object Number]", m = "[object RegExp]", I = "[object Set]", N = "[object String]", k = "[object Symbol]", R = "[object ArrayBuffer]", y = "[object DataView]", O = d ? d.prototype : void 0, Y = O ? O.valueOf : void 0;
            function ee(Z, te, fe, _, G, L, $) {
              switch (fe) {
                case y:
                  if (Z.byteLength != te.byteLength || Z.byteOffset != te.byteOffset)
                    return !1;
                  Z = Z.buffer, te = te.buffer;
                case R:
                  return !(Z.byteLength != te.byteLength || !L(new v(Z), new v(te)));
                case T:
                case q:
                case w:
                  return u(+Z, +te);
                case b:
                  return Z.name == te.name && Z.message == te.message;
                case m:
                case N:
                  return Z == te + "";
                case j:
                  var ae = P;
                case I:
                  var Pe = _ & c;
                  if (ae || (ae = p), Z.size != te.size && !Pe)
                    return !1;
                  var ge = $.get(Z);
                  if (ge)
                    return ge == te;
                  _ |= H, $.set(Z, te);
                  var me = l(ae(Z), ae(te), _, G, L, $);
                  return $.delete(Z), me;
                case k:
                  if (Y)
                    return Y.call(Z) == Y.call(te);
              }
              return !1;
            }
            a.exports = ee;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_equalObjects.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_equalObjects.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getAllKeys */
              "../../../../node_modules/lodash/_getAllKeys.js"
            ), v = 1, u = Object.prototype, l = u.hasOwnProperty;
            function P(p, c, H, T, q, b) {
              var j = H & v, w = d(p), m = w.length, I = d(c), N = I.length;
              if (m != N && !j)
                return !1;
              for (var k = m; k--; ) {
                var R = w[k];
                if (!(j ? R in c : l.call(c, R)))
                  return !1;
              }
              var y = b.get(p), O = b.get(c);
              if (y && O)
                return y == c && O == p;
              var Y = !0;
              b.set(p, c), b.set(c, p);
              for (var ee = j; ++k < m; ) {
                R = w[k];
                var Z = p[R], te = c[R];
                if (T)
                  var fe = j ? T(te, Z, R, c, p, b) : T(Z, te, R, p, c, b);
                if (!(fe === void 0 ? Z === te || q(Z, te, H, T, b) : fe)) {
                  Y = !1;
                  break;
                }
                ee || (ee = R == "constructor");
              }
              if (Y && !ee) {
                var _ = p.constructor, G = c.constructor;
                _ != G && "constructor" in p && "constructor" in c && !(typeof _ == "function" && _ instanceof _ && typeof G == "function" && G instanceof G) && (Y = !1);
              }
              return b.delete(p), b.delete(c), Y;
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_flatRest.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_flatRest.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./flatten */
              "../../../../node_modules/lodash/flatten.js"
            ), v = o(
              /*! ./_overRest */
              "../../../../node_modules/lodash/_overRest.js"
            ), u = o(
              /*! ./_setToString */
              "../../../../node_modules/lodash/_setToString.js"
            );
            function l(P) {
              return u(v(P, void 0, d), P + "");
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_freeGlobal.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_freeGlobal.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = typeof o.g == "object" && o.g && o.g.Object === Object && o.g;
            a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getAllKeys.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_getAllKeys.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGetAllKeys */
              "../../../../node_modules/lodash/_baseGetAllKeys.js"
            ), v = o(
              /*! ./_getSymbols */
              "../../../../node_modules/lodash/_getSymbols.js"
            ), u = o(
              /*! ./keys */
              "../../../../node_modules/lodash/keys.js"
            );
            function l(P) {
              return d(P, u, v);
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getAllKeysIn.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_getAllKeysIn.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGetAllKeys */
              "../../../../node_modules/lodash/_baseGetAllKeys.js"
            ), v = o(
              /*! ./_getSymbolsIn */
              "../../../../node_modules/lodash/_getSymbolsIn.js"
            ), u = o(
              /*! ./keysIn */
              "../../../../node_modules/lodash/keysIn.js"
            );
            function l(P) {
              return d(P, u, v);
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getMapData.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_getMapData.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_isKeyable */
              "../../../../node_modules/lodash/_isKeyable.js"
            );
            function v(u, l) {
              var P = u.__data__;
              return d(l) ? P[typeof l == "string" ? "string" : "hash"] : P.map;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getMatchData.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_getMatchData.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_isStrictComparable */
              "../../../../node_modules/lodash/_isStrictComparable.js"
            ), v = o(
              /*! ./keys */
              "../../../../node_modules/lodash/keys.js"
            );
            function u(l) {
              for (var P = v(l), p = P.length; p--; ) {
                var c = P[p], H = l[c];
                P[p] = [c, H, d(H)];
              }
              return P;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getNative.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_getNative.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseIsNative */
              "../../../../node_modules/lodash/_baseIsNative.js"
            ), v = o(
              /*! ./_getValue */
              "../../../../node_modules/lodash/_getValue.js"
            );
            function u(l, P) {
              var p = v(l, P);
              return d(p) ? p : void 0;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getPrototype.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_getPrototype.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_overArg */
              "../../../../node_modules/lodash/_overArg.js"
            ), v = d(Object.getPrototypeOf, Object);
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getRawTag.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_getRawTag.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Symbol */
              "../../../../node_modules/lodash/_Symbol.js"
            ), v = Object.prototype, u = v.hasOwnProperty, l = v.toString, P = d ? d.toStringTag : void 0;
            function p(c) {
              var H = u.call(c, P), T = c[P];
              try {
                c[P] = void 0;
                var q = !0;
              } catch {
              }
              var b = l.call(c);
              return q && (H ? c[P] = T : delete c[P]), b;
            }
            a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getSymbols.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_getSymbols.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayFilter */
              "../../../../node_modules/lodash/_arrayFilter.js"
            ), v = o(
              /*! ./stubArray */
              "../../../../node_modules/lodash/stubArray.js"
            ), u = Object.prototype, l = u.propertyIsEnumerable, P = Object.getOwnPropertySymbols, p = P ? function(c) {
              return c == null ? [] : (c = Object(c), d(P(c), function(H) {
                return l.call(c, H);
              }));
            } : v;
            a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getSymbolsIn.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_getSymbolsIn.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayPush */
              "../../../../node_modules/lodash/_arrayPush.js"
            ), v = o(
              /*! ./_getPrototype */
              "../../../../node_modules/lodash/_getPrototype.js"
            ), u = o(
              /*! ./_getSymbols */
              "../../../../node_modules/lodash/_getSymbols.js"
            ), l = o(
              /*! ./stubArray */
              "../../../../node_modules/lodash/stubArray.js"
            ), P = Object.getOwnPropertySymbols, p = P ? function(c) {
              for (var H = []; c; )
                d(H, u(c)), c = v(c);
              return H;
            } : l;
            a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getTag.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/lodash/_getTag.js ***!
            \**************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_DataView */
              "../../../../node_modules/lodash/_DataView.js"
            ), v = o(
              /*! ./_Map */
              "../../../../node_modules/lodash/_Map.js"
            ), u = o(
              /*! ./_Promise */
              "../../../../node_modules/lodash/_Promise.js"
            ), l = o(
              /*! ./_Set */
              "../../../../node_modules/lodash/_Set.js"
            ), P = o(
              /*! ./_WeakMap */
              "../../../../node_modules/lodash/_WeakMap.js"
            ), p = o(
              /*! ./_baseGetTag */
              "../../../../node_modules/lodash/_baseGetTag.js"
            ), c = o(
              /*! ./_toSource */
              "../../../../node_modules/lodash/_toSource.js"
            ), H = "[object Map]", T = "[object Object]", q = "[object Promise]", b = "[object Set]", j = "[object WeakMap]", w = "[object DataView]", m = c(d), I = c(v), N = c(u), k = c(l), R = c(P), y = p;
            (d && y(new d(new ArrayBuffer(1))) != w || v && y(new v()) != H || u && y(u.resolve()) != q || l && y(new l()) != b || P && y(new P()) != j) && (y = function(O) {
              var Y = p(O), ee = Y == T ? O.constructor : void 0, Z = ee ? c(ee) : "";
              if (Z)
                switch (Z) {
                  case m:
                    return w;
                  case I:
                    return H;
                  case N:
                    return q;
                  case k:
                    return b;
                  case R:
                    return j;
                }
              return Y;
            }), a.exports = y;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_getValue.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_getValue.js ***!
            \****************************************************/
          /***/
          (a) => {
            function f(o, d) {
              return o == null ? void 0 : o[d];
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_hasPath.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_hasPath.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_castPath */
              "../../../../node_modules/lodash/_castPath.js"
            ), v = o(
              /*! ./isArguments */
              "../../../../node_modules/lodash/isArguments.js"
            ), u = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), l = o(
              /*! ./_isIndex */
              "../../../../node_modules/lodash/_isIndex.js"
            ), P = o(
              /*! ./isLength */
              "../../../../node_modules/lodash/isLength.js"
            ), p = o(
              /*! ./_toKey */
              "../../../../node_modules/lodash/_toKey.js"
            );
            function c(H, T, q) {
              T = d(T, H);
              for (var b = -1, j = T.length, w = !1; ++b < j; ) {
                var m = p(T[b]);
                if (!(w = H != null && q(H, m)))
                  break;
                H = H[m];
              }
              return w || ++b != j ? w : (j = H == null ? 0 : H.length, !!j && P(j) && l(m, j) && (u(H) || v(H)));
            }
            a.exports = c;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_hasUnicode.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_hasUnicode.js ***!
            \******************************************************/
          /***/
          (a) => {
            var f = "\\ud800-\\udfff", o = "\\u0300-\\u036f", d = "\\ufe20-\\ufe2f", v = "\\u20d0-\\u20ff", u = o + d + v, l = "\\ufe0e\\ufe0f", P = "\\u200d", p = RegExp("[" + P + f + u + l + "]");
            function c(H) {
              return p.test(H);
            }
            a.exports = c;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_hashClear.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_hashClear.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_nativeCreate */
              "../../../../node_modules/lodash/_nativeCreate.js"
            );
            function v() {
              this.__data__ = d ? d(null) : {}, this.size = 0;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_hashDelete.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_hashDelete.js ***!
            \******************************************************/
          /***/
          (a) => {
            function f(o) {
              var d = this.has(o) && delete this.__data__[o];
              return this.size -= d ? 1 : 0, d;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_hashGet.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_hashGet.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_nativeCreate */
              "../../../../node_modules/lodash/_nativeCreate.js"
            ), v = "__lodash_hash_undefined__", u = Object.prototype, l = u.hasOwnProperty;
            function P(p) {
              var c = this.__data__;
              if (d) {
                var H = c[p];
                return H === v ? void 0 : H;
              }
              return l.call(c, p) ? c[p] : void 0;
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_hashHas.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_hashHas.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_nativeCreate */
              "../../../../node_modules/lodash/_nativeCreate.js"
            ), v = Object.prototype, u = v.hasOwnProperty;
            function l(P) {
              var p = this.__data__;
              return d ? p[P] !== void 0 : u.call(p, P);
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_hashSet.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_hashSet.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_nativeCreate */
              "../../../../node_modules/lodash/_nativeCreate.js"
            ), v = "__lodash_hash_undefined__";
            function u(l, P) {
              var p = this.__data__;
              return this.size += this.has(l) ? 0 : 1, p[l] = d && P === void 0 ? v : P, this;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_initCloneArray.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/lodash/_initCloneArray.js ***!
            \**********************************************************/
          /***/
          (a) => {
            var f = Object.prototype, o = f.hasOwnProperty;
            function d(v) {
              var u = v.length, l = new v.constructor(u);
              return u && typeof v[0] == "string" && o.call(v, "index") && (l.index = v.index, l.input = v.input), l;
            }
            a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_initCloneByTag.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/lodash/_initCloneByTag.js ***!
            \**********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_cloneArrayBuffer */
              "../../../../node_modules/lodash/_cloneArrayBuffer.js"
            ), v = o(
              /*! ./_cloneDataView */
              "../../../../node_modules/lodash/_cloneDataView.js"
            ), u = o(
              /*! ./_cloneRegExp */
              "../../../../node_modules/lodash/_cloneRegExp.js"
            ), l = o(
              /*! ./_cloneSymbol */
              "../../../../node_modules/lodash/_cloneSymbol.js"
            ), P = o(
              /*! ./_cloneTypedArray */
              "../../../../node_modules/lodash/_cloneTypedArray.js"
            ), p = "[object Boolean]", c = "[object Date]", H = "[object Map]", T = "[object Number]", q = "[object RegExp]", b = "[object Set]", j = "[object String]", w = "[object Symbol]", m = "[object ArrayBuffer]", I = "[object DataView]", N = "[object Float32Array]", k = "[object Float64Array]", R = "[object Int8Array]", y = "[object Int16Array]", O = "[object Int32Array]", Y = "[object Uint8Array]", ee = "[object Uint8ClampedArray]", Z = "[object Uint16Array]", te = "[object Uint32Array]";
            function fe(_, G, L) {
              var $ = _.constructor;
              switch (G) {
                case m:
                  return d(_);
                case p:
                case c:
                  return new $(+_);
                case I:
                  return v(_, L);
                case N:
                case k:
                case R:
                case y:
                case O:
                case Y:
                case ee:
                case Z:
                case te:
                  return P(_, L);
                case H:
                  return new $();
                case T:
                case j:
                  return new $(_);
                case q:
                  return u(_);
                case b:
                  return new $();
                case w:
                  return l(_);
              }
            }
            a.exports = fe;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_initCloneObject.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/lodash/_initCloneObject.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseCreate */
              "../../../../node_modules/lodash/_baseCreate.js"
            ), v = o(
              /*! ./_getPrototype */
              "../../../../node_modules/lodash/_getPrototype.js"
            ), u = o(
              /*! ./_isPrototype */
              "../../../../node_modules/lodash/_isPrototype.js"
            );
            function l(P) {
              return typeof P.constructor == "function" && !u(P) ? d(v(P)) : {};
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_isFlattenable.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_isFlattenable.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Symbol */
              "../../../../node_modules/lodash/_Symbol.js"
            ), v = o(
              /*! ./isArguments */
              "../../../../node_modules/lodash/isArguments.js"
            ), u = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), l = d ? d.isConcatSpreadable : void 0;
            function P(p) {
              return u(p) || v(p) || !!(l && p && p[l]);
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_isIndex.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_isIndex.js ***!
            \***************************************************/
          /***/
          (a) => {
            var f = 9007199254740991, o = /^(?:0|[1-9]\d*)$/;
            function d(v, u) {
              var l = typeof v;
              return u = u ?? f, !!u && (l == "number" || l != "symbol" && o.test(v)) && v > -1 && v % 1 == 0 && v < u;
            }
            a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_isIterateeCall.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/lodash/_isIterateeCall.js ***!
            \**********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./eq */
              "../../../../node_modules/lodash/eq.js"
            ), v = o(
              /*! ./isArrayLike */
              "../../../../node_modules/lodash/isArrayLike.js"
            ), u = o(
              /*! ./_isIndex */
              "../../../../node_modules/lodash/_isIndex.js"
            ), l = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            );
            function P(p, c, H) {
              if (!l(H))
                return !1;
              var T = typeof c;
              return (T == "number" ? v(H) && u(c, H.length) : T == "string" && c in H) ? d(H[c], p) : !1;
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_isKey.js": (
          /*!*************************************************!*\
            !*** ../../../../node_modules/lodash/_isKey.js ***!
            \*************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), v = o(
              /*! ./isSymbol */
              "../../../../node_modules/lodash/isSymbol.js"
            ), u = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, l = /^\w*$/;
            function P(p, c) {
              if (d(p))
                return !1;
              var H = typeof p;
              return H == "number" || H == "symbol" || H == "boolean" || p == null || v(p) ? !0 : l.test(p) || !u.test(p) || c != null && p in Object(c);
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_isKeyable.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/_isKeyable.js ***!
            \*****************************************************/
          /***/
          (a) => {
            function f(o) {
              var d = typeof o;
              return d == "string" || d == "number" || d == "symbol" || d == "boolean" ? o !== "__proto__" : o === null;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_isMasked.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_isMasked.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_coreJsData */
              "../../../../node_modules/lodash/_coreJsData.js"
            ), v = function() {
              var l = /[^.]+$/.exec(d && d.keys && d.keys.IE_PROTO || "");
              return l ? "Symbol(src)_1." + l : "";
            }();
            function u(l) {
              return !!v && v in l;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_isPrototype.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_isPrototype.js ***!
            \*******************************************************/
          /***/
          (a) => {
            var f = Object.prototype;
            function o(d) {
              var v = d && d.constructor, u = typeof v == "function" && v.prototype || f;
              return d === u;
            }
            a.exports = o;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_isStrictComparable.js": (
          /*!**************************************************************!*\
            !*** ../../../../node_modules/lodash/_isStrictComparable.js ***!
            \**************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            );
            function v(u) {
              return u === u && !d(u);
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_listCacheClear.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/lodash/_listCacheClear.js ***!
            \**********************************************************/
          /***/
          (a) => {
            function f() {
              this.__data__ = [], this.size = 0;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_listCacheDelete.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/lodash/_listCacheDelete.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_assocIndexOf */
              "../../../../node_modules/lodash/_assocIndexOf.js"
            ), v = Array.prototype, u = v.splice;
            function l(P) {
              var p = this.__data__, c = d(p, P);
              if (c < 0)
                return !1;
              var H = p.length - 1;
              return c == H ? p.pop() : u.call(p, c, 1), --this.size, !0;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_listCacheGet.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_listCacheGet.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_assocIndexOf */
              "../../../../node_modules/lodash/_assocIndexOf.js"
            );
            function v(u) {
              var l = this.__data__, P = d(l, u);
              return P < 0 ? void 0 : l[P][1];
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_listCacheHas.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_listCacheHas.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_assocIndexOf */
              "../../../../node_modules/lodash/_assocIndexOf.js"
            );
            function v(u) {
              return d(this.__data__, u) > -1;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_listCacheSet.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_listCacheSet.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_assocIndexOf */
              "../../../../node_modules/lodash/_assocIndexOf.js"
            );
            function v(u, l) {
              var P = this.__data__, p = d(P, u);
              return p < 0 ? (++this.size, P.push([u, l])) : P[p][1] = l, this;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_mapCacheClear.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_mapCacheClear.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_Hash */
              "../../../../node_modules/lodash/_Hash.js"
            ), v = o(
              /*! ./_ListCache */
              "../../../../node_modules/lodash/_ListCache.js"
            ), u = o(
              /*! ./_Map */
              "../../../../node_modules/lodash/_Map.js"
            );
            function l() {
              this.size = 0, this.__data__ = {
                hash: new d(),
                map: new (u || v)(),
                string: new d()
              };
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_mapCacheDelete.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/lodash/_mapCacheDelete.js ***!
            \**********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getMapData */
              "../../../../node_modules/lodash/_getMapData.js"
            );
            function v(u) {
              var l = d(this, u).delete(u);
              return this.size -= l ? 1 : 0, l;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_mapCacheGet.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_mapCacheGet.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getMapData */
              "../../../../node_modules/lodash/_getMapData.js"
            );
            function v(u) {
              return d(this, u).get(u);
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_mapCacheHas.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_mapCacheHas.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getMapData */
              "../../../../node_modules/lodash/_getMapData.js"
            );
            function v(u) {
              return d(this, u).has(u);
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_mapCacheSet.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_mapCacheSet.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getMapData */
              "../../../../node_modules/lodash/_getMapData.js"
            );
            function v(u, l) {
              var P = d(this, u), p = P.size;
              return P.set(u, l), this.size += P.size == p ? 0 : 1, this;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_mapToArray.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_mapToArray.js ***!
            \******************************************************/
          /***/
          (a) => {
            function f(o) {
              var d = -1, v = Array(o.size);
              return o.forEach(function(u, l) {
                v[++d] = [l, u];
              }), v;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_matchesStrictComparable.js": (
          /*!*******************************************************************!*\
            !*** ../../../../node_modules/lodash/_matchesStrictComparable.js ***!
            \*******************************************************************/
          /***/
          (a) => {
            function f(o, d) {
              return function(v) {
                return v == null ? !1 : v[o] === d && (d !== void 0 || o in Object(v));
              };
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_memoizeCapped.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_memoizeCapped.js ***!
            \*********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./memoize */
              "../../../../node_modules/lodash/memoize.js"
            ), v = 500;
            function u(l) {
              var P = d(l, function(c) {
                return p.size === v && p.clear(), c;
              }), p = P.cache;
              return P;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_nativeCreate.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_nativeCreate.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_getNative */
              "../../../../node_modules/lodash/_getNative.js"
            ), v = d(Object, "create");
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_nativeKeys.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_nativeKeys.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_overArg */
              "../../../../node_modules/lodash/_overArg.js"
            ), v = d(Object.keys, Object);
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_nativeKeysIn.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_nativeKeysIn.js ***!
            \********************************************************/
          /***/
          (a) => {
            function f(o) {
              var d = [];
              if (o != null)
                for (var v in Object(o))
                  d.push(v);
              return d;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_nodeUtil.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_nodeUtil.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            a = o.nmd(a);
            var d = o(
              /*! ./_freeGlobal */
              "../../../../node_modules/lodash/_freeGlobal.js"
            ), v = f && !f.nodeType && f, u = v && !0 && a && !a.nodeType && a, l = u && u.exports === v, P = l && d.process, p = function() {
              try {
                var c = u && u.require && u.require("util").types;
                return c || P && P.binding && P.binding("util");
              } catch {
              }
            }();
            a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_objectToString.js": (
          /*!**********************************************************!*\
            !*** ../../../../node_modules/lodash/_objectToString.js ***!
            \**********************************************************/
          /***/
          (a) => {
            var f = Object.prototype, o = f.toString;
            function d(v) {
              return o.call(v);
            }
            a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_overArg.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_overArg.js ***!
            \***************************************************/
          /***/
          (a) => {
            function f(o, d) {
              return function(v) {
                return o(d(v));
              };
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_overRest.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_overRest.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_apply */
              "../../../../node_modules/lodash/_apply.js"
            ), v = Math.max;
            function u(l, P, p) {
              return P = v(P === void 0 ? l.length - 1 : P, 0), function() {
                for (var c = arguments, H = -1, T = v(c.length - P, 0), q = Array(T); ++H < T; )
                  q[H] = c[P + H];
                H = -1;
                for (var b = Array(P + 1); ++H < P; )
                  b[H] = c[H];
                return b[P] = p(q), d(l, this, b);
              };
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_root.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/_root.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_freeGlobal */
              "../../../../node_modules/lodash/_freeGlobal.js"
            ), v = typeof self == "object" && self && self.Object === Object && self, u = d || v || Function("return this")();
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_safeGet.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/_safeGet.js ***!
            \***************************************************/
          /***/
          (a) => {
            function f(o, d) {
              if (!(d === "constructor" && typeof o[d] == "function") && d != "__proto__")
                return o[d];
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_setCacheAdd.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_setCacheAdd.js ***!
            \*******************************************************/
          /***/
          (a) => {
            var f = "__lodash_hash_undefined__";
            function o(d) {
              return this.__data__.set(d, f), this;
            }
            a.exports = o;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_setCacheHas.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_setCacheHas.js ***!
            \*******************************************************/
          /***/
          (a) => {
            function f(o) {
              return this.__data__.has(o);
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_setToArray.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_setToArray.js ***!
            \******************************************************/
          /***/
          (a) => {
            function f(o) {
              var d = -1, v = Array(o.size);
              return o.forEach(function(u) {
                v[++d] = u;
              }), v;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_setToString.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_setToString.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseSetToString */
              "../../../../node_modules/lodash/_baseSetToString.js"
            ), v = o(
              /*! ./_shortOut */
              "../../../../node_modules/lodash/_shortOut.js"
            ), u = v(d);
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_shortOut.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_shortOut.js ***!
            \****************************************************/
          /***/
          (a) => {
            var f = 800, o = 16, d = Date.now;
            function v(u) {
              var l = 0, P = 0;
              return function() {
                var p = d(), c = o - (p - P);
                if (P = p, c > 0) {
                  if (++l >= f)
                    return arguments[0];
                } else
                  l = 0;
                return u.apply(void 0, arguments);
              };
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_stackClear.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_stackClear.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_ListCache */
              "../../../../node_modules/lodash/_ListCache.js"
            );
            function v() {
              this.__data__ = new d(), this.size = 0;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_stackDelete.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_stackDelete.js ***!
            \*******************************************************/
          /***/
          (a) => {
            function f(o) {
              var d = this.__data__, v = d.delete(o);
              return this.size = d.size, v;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_stackGet.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_stackGet.js ***!
            \****************************************************/
          /***/
          (a) => {
            function f(o) {
              return this.__data__.get(o);
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_stackHas.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_stackHas.js ***!
            \****************************************************/
          /***/
          (a) => {
            function f(o) {
              return this.__data__.has(o);
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_stackSet.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_stackSet.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_ListCache */
              "../../../../node_modules/lodash/_ListCache.js"
            ), v = o(
              /*! ./_Map */
              "../../../../node_modules/lodash/_Map.js"
            ), u = o(
              /*! ./_MapCache */
              "../../../../node_modules/lodash/_MapCache.js"
            ), l = 200;
            function P(p, c) {
              var H = this.__data__;
              if (H instanceof d) {
                var T = H.__data__;
                if (!v || T.length < l - 1)
                  return T.push([p, c]), this.size = ++H.size, this;
                H = this.__data__ = new u(T);
              }
              return H.set(p, c), this.size = H.size, this;
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_strictIndexOf.js": (
          /*!*********************************************************!*\
            !*** ../../../../node_modules/lodash/_strictIndexOf.js ***!
            \*********************************************************/
          /***/
          (a) => {
            function f(o, d, v) {
              for (var u = v - 1, l = o.length; ++u < l; )
                if (o[u] === d)
                  return u;
              return -1;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_stringSize.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/_stringSize.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_asciiSize */
              "../../../../node_modules/lodash/_asciiSize.js"
            ), v = o(
              /*! ./_hasUnicode */
              "../../../../node_modules/lodash/_hasUnicode.js"
            ), u = o(
              /*! ./_unicodeSize */
              "../../../../node_modules/lodash/_unicodeSize.js"
            );
            function l(P) {
              return v(P) ? u(P) : d(P);
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_stringToPath.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/_stringToPath.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_memoizeCapped */
              "../../../../node_modules/lodash/_memoizeCapped.js"
            ), v = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, u = /\\(\\)?/g, l = d(function(P) {
              var p = [];
              return P.charCodeAt(0) === 46 && p.push(""), P.replace(v, function(c, H, T, q) {
                p.push(T ? q.replace(u, "$1") : H || c);
              }), p;
            });
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_toKey.js": (
          /*!*************************************************!*\
            !*** ../../../../node_modules/lodash/_toKey.js ***!
            \*************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isSymbol */
              "../../../../node_modules/lodash/isSymbol.js"
            ), v = 1 / 0;
            function u(l) {
              if (typeof l == "string" || d(l))
                return l;
              var P = l + "";
              return P == "0" && 1 / l == -v ? "-0" : P;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_toSource.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/_toSource.js ***!
            \****************************************************/
          /***/
          (a) => {
            var f = Function.prototype, o = f.toString;
            function d(v) {
              if (v != null) {
                try {
                  return o.call(v);
                } catch {
                }
                try {
                  return v + "";
                } catch {
                }
              }
              return "";
            }
            a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_trimmedEndIndex.js": (
          /*!***********************************************************!*\
            !*** ../../../../node_modules/lodash/_trimmedEndIndex.js ***!
            \***********************************************************/
          /***/
          (a) => {
            var f = /\s/;
            function o(d) {
              for (var v = d.length; v-- && f.test(d.charAt(v)); )
                ;
              return v;
            }
            a.exports = o;
          }
        ),
        /***/
        "../../../../node_modules/lodash/_unicodeSize.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/_unicodeSize.js ***!
            \*******************************************************/
          /***/
          (a) => {
            var f = "\\ud800-\\udfff", o = "\\u0300-\\u036f", d = "\\ufe20-\\ufe2f", v = "\\u20d0-\\u20ff", u = o + d + v, l = "\\ufe0e\\ufe0f", P = "[" + f + "]", p = "[" + u + "]", c = "\\ud83c[\\udffb-\\udfff]", H = "(?:" + p + "|" + c + ")", T = "[^" + f + "]", q = "(?:\\ud83c[\\udde6-\\uddff]){2}", b = "[\\ud800-\\udbff][\\udc00-\\udfff]", j = "\\u200d", w = H + "?", m = "[" + l + "]?", I = "(?:" + j + "(?:" + [T, q, b].join("|") + ")" + m + w + ")*", N = m + w + I, k = "(?:" + [T + p + "?", p, q, b, P].join("|") + ")", R = RegExp(c + "(?=" + c + ")|" + k + N, "g");
            function y(O) {
              for (var Y = R.lastIndex = 0; R.test(O); )
                ++Y;
              return Y;
            }
            a.exports = y;
          }
        ),
        /***/
        "../../../../node_modules/lodash/clone.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/clone.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseClone */
              "../../../../node_modules/lodash/_baseClone.js"
            ), v = 4;
            function u(l) {
              return d(l, v);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/cloneDeep.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/cloneDeep.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseClone */
              "../../../../node_modules/lodash/_baseClone.js"
            ), v = 1, u = 4;
            function l(P) {
              return d(P, v | u);
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/constant.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/constant.js ***!
            \***************************************************/
          /***/
          (a) => {
            function f(o) {
              return function() {
                return o;
              };
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/defaults.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/defaults.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseRest */
              "../../../../node_modules/lodash/_baseRest.js"
            ), v = o(
              /*! ./eq */
              "../../../../node_modules/lodash/eq.js"
            ), u = o(
              /*! ./_isIterateeCall */
              "../../../../node_modules/lodash/_isIterateeCall.js"
            ), l = o(
              /*! ./keysIn */
              "../../../../node_modules/lodash/keysIn.js"
            ), P = Object.prototype, p = P.hasOwnProperty, c = d(function(H, T) {
              H = Object(H);
              var q = -1, b = T.length, j = b > 2 ? T[2] : void 0;
              for (j && u(T[0], T[1], j) && (b = 1); ++q < b; )
                for (var w = T[q], m = l(w), I = -1, N = m.length; ++I < N; ) {
                  var k = m[I], R = H[k];
                  (R === void 0 || v(R, P[k]) && !p.call(H, k)) && (H[k] = w[k]);
                }
              return H;
            });
            a.exports = c;
          }
        ),
        /***/
        "../../../../node_modules/lodash/each.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/lodash/each.js ***!
            \***********************************************/
          /***/
          (a, f, o) => {
            a.exports = o(
              /*! ./forEach */
              "../../../../node_modules/lodash/forEach.js"
            );
          }
        ),
        /***/
        "../../../../node_modules/lodash/eq.js": (
          /*!*********************************************!*\
            !*** ../../../../node_modules/lodash/eq.js ***!
            \*********************************************/
          /***/
          (a) => {
            function f(o, d) {
              return o === d || o !== o && d !== d;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/filter.js": (
          /*!*************************************************!*\
            !*** ../../../../node_modules/lodash/filter.js ***!
            \*************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayFilter */
              "../../../../node_modules/lodash/_arrayFilter.js"
            ), v = o(
              /*! ./_baseFilter */
              "../../../../node_modules/lodash/_baseFilter.js"
            ), u = o(
              /*! ./_baseIteratee */
              "../../../../node_modules/lodash/_baseIteratee.js"
            ), l = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            );
            function P(p, c) {
              var H = l(p) ? d : v;
              return H(p, u(c, 3));
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/find.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/lodash/find.js ***!
            \***********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_createFind */
              "../../../../node_modules/lodash/_createFind.js"
            ), v = o(
              /*! ./findIndex */
              "../../../../node_modules/lodash/findIndex.js"
            ), u = d(v);
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/findIndex.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/findIndex.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseFindIndex */
              "../../../../node_modules/lodash/_baseFindIndex.js"
            ), v = o(
              /*! ./_baseIteratee */
              "../../../../node_modules/lodash/_baseIteratee.js"
            ), u = o(
              /*! ./toInteger */
              "../../../../node_modules/lodash/toInteger.js"
            ), l = Math.max;
            function P(p, c, H) {
              var T = p == null ? 0 : p.length;
              if (!T)
                return -1;
              var q = H == null ? 0 : u(H);
              return q < 0 && (q = l(T + q, 0)), d(p, v(c, 3), q);
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/flatten.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/lodash/flatten.js ***!
            \**************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseFlatten */
              "../../../../node_modules/lodash/_baseFlatten.js"
            );
            function v(u) {
              var l = u == null ? 0 : u.length;
              return l ? d(u, 1) : [];
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/forEach.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/lodash/forEach.js ***!
            \**************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayEach */
              "../../../../node_modules/lodash/_arrayEach.js"
            ), v = o(
              /*! ./_baseEach */
              "../../../../node_modules/lodash/_baseEach.js"
            ), u = o(
              /*! ./_castFunction */
              "../../../../node_modules/lodash/_castFunction.js"
            ), l = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            );
            function P(p, c) {
              var H = l(p) ? d : v;
              return H(p, u(c));
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/forIn.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/forIn.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseFor */
              "../../../../node_modules/lodash/_baseFor.js"
            ), v = o(
              /*! ./_castFunction */
              "../../../../node_modules/lodash/_castFunction.js"
            ), u = o(
              /*! ./keysIn */
              "../../../../node_modules/lodash/keysIn.js"
            );
            function l(P, p) {
              return P == null ? P : d(P, v(p), u);
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/get.js": (
          /*!**********************************************!*\
            !*** ../../../../node_modules/lodash/get.js ***!
            \**********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGet */
              "../../../../node_modules/lodash/_baseGet.js"
            );
            function v(u, l, P) {
              var p = u == null ? void 0 : d(u, l);
              return p === void 0 ? P : p;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/has.js": (
          /*!**********************************************!*\
            !*** ../../../../node_modules/lodash/has.js ***!
            \**********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseHas */
              "../../../../node_modules/lodash/_baseHas.js"
            ), v = o(
              /*! ./_hasPath */
              "../../../../node_modules/lodash/_hasPath.js"
            );
            function u(l, P) {
              return l != null && v(l, P, d);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/hasIn.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/hasIn.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseHasIn */
              "../../../../node_modules/lodash/_baseHasIn.js"
            ), v = o(
              /*! ./_hasPath */
              "../../../../node_modules/lodash/_hasPath.js"
            );
            function u(l, P) {
              return l != null && v(l, P, d);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/identity.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/identity.js ***!
            \***************************************************/
          /***/
          (a) => {
            function f(o) {
              return o;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isArguments.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/isArguments.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseIsArguments */
              "../../../../node_modules/lodash/_baseIsArguments.js"
            ), v = o(
              /*! ./isObjectLike */
              "../../../../node_modules/lodash/isObjectLike.js"
            ), u = Object.prototype, l = u.hasOwnProperty, P = u.propertyIsEnumerable, p = d(/* @__PURE__ */ function() {
              return arguments;
            }()) ? d : function(c) {
              return v(c) && l.call(c, "callee") && !P.call(c, "callee");
            };
            a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isArray.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/lodash/isArray.js ***!
            \**************************************************/
          /***/
          (a) => {
            var f = Array.isArray;
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isArrayLike.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/isArrayLike.js ***!
            \******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isFunction */
              "../../../../node_modules/lodash/isFunction.js"
            ), v = o(
              /*! ./isLength */
              "../../../../node_modules/lodash/isLength.js"
            );
            function u(l) {
              return l != null && v(l.length) && !d(l);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isArrayLikeObject.js": (
          /*!************************************************************!*\
            !*** ../../../../node_modules/lodash/isArrayLikeObject.js ***!
            \************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./isArrayLike */
              "../../../../node_modules/lodash/isArrayLike.js"
            ), v = o(
              /*! ./isObjectLike */
              "../../../../node_modules/lodash/isObjectLike.js"
            );
            function u(l) {
              return v(l) && d(l);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isBuffer.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/isBuffer.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            a = o.nmd(a);
            var d = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), v = o(
              /*! ./stubFalse */
              "../../../../node_modules/lodash/stubFalse.js"
            ), u = f && !f.nodeType && f, l = u && !0 && a && !a.nodeType && a, P = l && l.exports === u, p = P ? d.Buffer : void 0, c = p ? p.isBuffer : void 0, H = c || v;
            a.exports = H;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isEmpty.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/lodash/isEmpty.js ***!
            \**************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseKeys */
              "../../../../node_modules/lodash/_baseKeys.js"
            ), v = o(
              /*! ./_getTag */
              "../../../../node_modules/lodash/_getTag.js"
            ), u = o(
              /*! ./isArguments */
              "../../../../node_modules/lodash/isArguments.js"
            ), l = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), P = o(
              /*! ./isArrayLike */
              "../../../../node_modules/lodash/isArrayLike.js"
            ), p = o(
              /*! ./isBuffer */
              "../../../../node_modules/lodash/isBuffer.js"
            ), c = o(
              /*! ./_isPrototype */
              "../../../../node_modules/lodash/_isPrototype.js"
            ), H = o(
              /*! ./isTypedArray */
              "../../../../node_modules/lodash/isTypedArray.js"
            ), T = "[object Map]", q = "[object Set]", b = Object.prototype, j = b.hasOwnProperty;
            function w(m) {
              if (m == null)
                return !0;
              if (P(m) && (l(m) || typeof m == "string" || typeof m.splice == "function" || p(m) || H(m) || u(m)))
                return !m.length;
              var I = v(m);
              if (I == T || I == q)
                return !m.size;
              if (c(m))
                return !d(m).length;
              for (var N in m)
                if (j.call(m, N))
                  return !1;
              return !0;
            }
            a.exports = w;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isFunction.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/lodash/isFunction.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGetTag */
              "../../../../node_modules/lodash/_baseGetTag.js"
            ), v = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            ), u = "[object AsyncFunction]", l = "[object Function]", P = "[object GeneratorFunction]", p = "[object Proxy]";
            function c(H) {
              if (!v(H))
                return !1;
              var T = d(H);
              return T == l || T == P || T == u || T == p;
            }
            a.exports = c;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isLength.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/isLength.js ***!
            \***************************************************/
          /***/
          (a) => {
            var f = 9007199254740991;
            function o(d) {
              return typeof d == "number" && d > -1 && d % 1 == 0 && d <= f;
            }
            a.exports = o;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isMap.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/isMap.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseIsMap */
              "../../../../node_modules/lodash/_baseIsMap.js"
            ), v = o(
              /*! ./_baseUnary */
              "../../../../node_modules/lodash/_baseUnary.js"
            ), u = o(
              /*! ./_nodeUtil */
              "../../../../node_modules/lodash/_nodeUtil.js"
            ), l = u && u.isMap, P = l ? v(l) : d;
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isObject.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/isObject.js ***!
            \***************************************************/
          /***/
          (a) => {
            function f(o) {
              var d = typeof o;
              return o != null && (d == "object" || d == "function");
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isObjectLike.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/isObjectLike.js ***!
            \*******************************************************/
          /***/
          (a) => {
            function f(o) {
              return o != null && typeof o == "object";
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isPlainObject.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/isPlainObject.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGetTag */
              "../../../../node_modules/lodash/_baseGetTag.js"
            ), v = o(
              /*! ./_getPrototype */
              "../../../../node_modules/lodash/_getPrototype.js"
            ), u = o(
              /*! ./isObjectLike */
              "../../../../node_modules/lodash/isObjectLike.js"
            ), l = "[object Object]", P = Function.prototype, p = Object.prototype, c = P.toString, H = p.hasOwnProperty, T = c.call(Object);
            function q(b) {
              if (!u(b) || d(b) != l)
                return !1;
              var j = v(b);
              if (j === null)
                return !0;
              var w = H.call(j, "constructor") && j.constructor;
              return typeof w == "function" && w instanceof w && c.call(w) == T;
            }
            a.exports = q;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isSet.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/isSet.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseIsSet */
              "../../../../node_modules/lodash/_baseIsSet.js"
            ), v = o(
              /*! ./_baseUnary */
              "../../../../node_modules/lodash/_baseUnary.js"
            ), u = o(
              /*! ./_nodeUtil */
              "../../../../node_modules/lodash/_nodeUtil.js"
            ), l = u && u.isSet, P = l ? v(l) : d;
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isString.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/isString.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGetTag */
              "../../../../node_modules/lodash/_baseGetTag.js"
            ), v = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), u = o(
              /*! ./isObjectLike */
              "../../../../node_modules/lodash/isObjectLike.js"
            ), l = "[object String]";
            function P(p) {
              return typeof p == "string" || !v(p) && u(p) && d(p) == l;
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isSymbol.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/isSymbol.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseGetTag */
              "../../../../node_modules/lodash/_baseGetTag.js"
            ), v = o(
              /*! ./isObjectLike */
              "../../../../node_modules/lodash/isObjectLike.js"
            ), u = "[object Symbol]";
            function l(P) {
              return typeof P == "symbol" || v(P) && d(P) == u;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isTypedArray.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/lodash/isTypedArray.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseIsTypedArray */
              "../../../../node_modules/lodash/_baseIsTypedArray.js"
            ), v = o(
              /*! ./_baseUnary */
              "../../../../node_modules/lodash/_baseUnary.js"
            ), u = o(
              /*! ./_nodeUtil */
              "../../../../node_modules/lodash/_nodeUtil.js"
            ), l = u && u.isTypedArray, P = l ? v(l) : d;
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/isUndefined.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/lodash/isUndefined.js ***!
            \******************************************************/
          /***/
          (a) => {
            function f(o) {
              return o === void 0;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/keys.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/lodash/keys.js ***!
            \***********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayLikeKeys */
              "../../../../node_modules/lodash/_arrayLikeKeys.js"
            ), v = o(
              /*! ./_baseKeys */
              "../../../../node_modules/lodash/_baseKeys.js"
            ), u = o(
              /*! ./isArrayLike */
              "../../../../node_modules/lodash/isArrayLike.js"
            );
            function l(P) {
              return u(P) ? d(P) : v(P);
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/keysIn.js": (
          /*!*************************************************!*\
            !*** ../../../../node_modules/lodash/keysIn.js ***!
            \*************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayLikeKeys */
              "../../../../node_modules/lodash/_arrayLikeKeys.js"
            ), v = o(
              /*! ./_baseKeysIn */
              "../../../../node_modules/lodash/_baseKeysIn.js"
            ), u = o(
              /*! ./isArrayLike */
              "../../../../node_modules/lodash/isArrayLike.js"
            );
            function l(P) {
              return u(P) ? d(P, !0) : v(P);
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/last.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/lodash/last.js ***!
            \***********************************************/
          /***/
          (a) => {
            function f(o) {
              var d = o == null ? 0 : o.length;
              return d ? o[d - 1] : void 0;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/map.js": (
          /*!**********************************************!*\
            !*** ../../../../node_modules/lodash/map.js ***!
            \**********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayMap */
              "../../../../node_modules/lodash/_arrayMap.js"
            ), v = o(
              /*! ./_baseIteratee */
              "../../../../node_modules/lodash/_baseIteratee.js"
            ), u = o(
              /*! ./_baseMap */
              "../../../../node_modules/lodash/_baseMap.js"
            ), l = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            );
            function P(p, c) {
              var H = l(p) ? d : u;
              return H(p, v(c, 3));
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/mapValues.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/mapValues.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseAssignValue */
              "../../../../node_modules/lodash/_baseAssignValue.js"
            ), v = o(
              /*! ./_baseForOwn */
              "../../../../node_modules/lodash/_baseForOwn.js"
            ), u = o(
              /*! ./_baseIteratee */
              "../../../../node_modules/lodash/_baseIteratee.js"
            );
            function l(P, p) {
              var c = {};
              return p = u(p, 3), v(P, function(H, T, q) {
                d(c, T, p(H, T, q));
              }), c;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/max.js": (
          /*!**********************************************!*\
            !*** ../../../../node_modules/lodash/max.js ***!
            \**********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseExtremum */
              "../../../../node_modules/lodash/_baseExtremum.js"
            ), v = o(
              /*! ./_baseGt */
              "../../../../node_modules/lodash/_baseGt.js"
            ), u = o(
              /*! ./identity */
              "../../../../node_modules/lodash/identity.js"
            );
            function l(P) {
              return P && P.length ? d(P, u, v) : void 0;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/memoize.js": (
          /*!**************************************************!*\
            !*** ../../../../node_modules/lodash/memoize.js ***!
            \**************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_MapCache */
              "../../../../node_modules/lodash/_MapCache.js"
            ), v = "Expected a function";
            function u(l, P) {
              if (typeof l != "function" || P != null && typeof P != "function")
                throw new TypeError(v);
              var p = function() {
                var c = arguments, H = P ? P.apply(this, c) : c[0], T = p.cache;
                if (T.has(H))
                  return T.get(H);
                var q = l.apply(this, c);
                return p.cache = T.set(H, q) || T, q;
              };
              return p.cache = new (u.Cache || d)(), p;
            }
            u.Cache = d, a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/merge.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/merge.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseMerge */
              "../../../../node_modules/lodash/_baseMerge.js"
            ), v = o(
              /*! ./_createAssigner */
              "../../../../node_modules/lodash/_createAssigner.js"
            ), u = v(function(l, P, p) {
              d(l, P, p);
            });
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/min.js": (
          /*!**********************************************!*\
            !*** ../../../../node_modules/lodash/min.js ***!
            \**********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseExtremum */
              "../../../../node_modules/lodash/_baseExtremum.js"
            ), v = o(
              /*! ./_baseLt */
              "../../../../node_modules/lodash/_baseLt.js"
            ), u = o(
              /*! ./identity */
              "../../../../node_modules/lodash/identity.js"
            );
            function l(P) {
              return P && P.length ? d(P, u, v) : void 0;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/minBy.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/minBy.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseExtremum */
              "../../../../node_modules/lodash/_baseExtremum.js"
            ), v = o(
              /*! ./_baseIteratee */
              "../../../../node_modules/lodash/_baseIteratee.js"
            ), u = o(
              /*! ./_baseLt */
              "../../../../node_modules/lodash/_baseLt.js"
            );
            function l(P, p) {
              return P && P.length ? d(P, v(p, 2), u) : void 0;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/noop.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/lodash/noop.js ***!
            \***********************************************/
          /***/
          (a) => {
            function f() {
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/now.js": (
          /*!**********************************************!*\
            !*** ../../../../node_modules/lodash/now.js ***!
            \**********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_root */
              "../../../../node_modules/lodash/_root.js"
            ), v = function() {
              return d.Date.now();
            };
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/pick.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/lodash/pick.js ***!
            \***********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_basePick */
              "../../../../node_modules/lodash/_basePick.js"
            ), v = o(
              /*! ./_flatRest */
              "../../../../node_modules/lodash/_flatRest.js"
            ), u = v(function(l, P) {
              return l == null ? {} : d(l, P);
            });
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/property.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/property.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseProperty */
              "../../../../node_modules/lodash/_baseProperty.js"
            ), v = o(
              /*! ./_basePropertyDeep */
              "../../../../node_modules/lodash/_basePropertyDeep.js"
            ), u = o(
              /*! ./_isKey */
              "../../../../node_modules/lodash/_isKey.js"
            ), l = o(
              /*! ./_toKey */
              "../../../../node_modules/lodash/_toKey.js"
            );
            function P(p) {
              return u(p) ? d(l(p)) : v(p);
            }
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/range.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/range.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_createRange */
              "../../../../node_modules/lodash/_createRange.js"
            ), v = d();
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/reduce.js": (
          /*!*************************************************!*\
            !*** ../../../../node_modules/lodash/reduce.js ***!
            \*************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayReduce */
              "../../../../node_modules/lodash/_arrayReduce.js"
            ), v = o(
              /*! ./_baseEach */
              "../../../../node_modules/lodash/_baseEach.js"
            ), u = o(
              /*! ./_baseIteratee */
              "../../../../node_modules/lodash/_baseIteratee.js"
            ), l = o(
              /*! ./_baseReduce */
              "../../../../node_modules/lodash/_baseReduce.js"
            ), P = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            );
            function p(c, H, T) {
              var q = P(c) ? d : l, b = arguments.length < 3;
              return q(c, u(H, 4), T, b, v);
            }
            a.exports = p;
          }
        ),
        /***/
        "../../../../node_modules/lodash/size.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/lodash/size.js ***!
            \***********************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseKeys */
              "../../../../node_modules/lodash/_baseKeys.js"
            ), v = o(
              /*! ./_getTag */
              "../../../../node_modules/lodash/_getTag.js"
            ), u = o(
              /*! ./isArrayLike */
              "../../../../node_modules/lodash/isArrayLike.js"
            ), l = o(
              /*! ./isString */
              "../../../../node_modules/lodash/isString.js"
            ), P = o(
              /*! ./_stringSize */
              "../../../../node_modules/lodash/_stringSize.js"
            ), p = "[object Map]", c = "[object Set]";
            function H(T) {
              if (T == null)
                return 0;
              if (u(T))
                return l(T) ? P(T) : T.length;
              var q = v(T);
              return q == p || q == c ? T.size : d(T).length;
            }
            a.exports = H;
          }
        ),
        /***/
        "../../../../node_modules/lodash/sortBy.js": (
          /*!*************************************************!*\
            !*** ../../../../node_modules/lodash/sortBy.js ***!
            \*************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseFlatten */
              "../../../../node_modules/lodash/_baseFlatten.js"
            ), v = o(
              /*! ./_baseOrderBy */
              "../../../../node_modules/lodash/_baseOrderBy.js"
            ), u = o(
              /*! ./_baseRest */
              "../../../../node_modules/lodash/_baseRest.js"
            ), l = o(
              /*! ./_isIterateeCall */
              "../../../../node_modules/lodash/_isIterateeCall.js"
            ), P = u(function(p, c) {
              if (p == null)
                return [];
              var H = c.length;
              return H > 1 && l(p, c[0], c[1]) ? c = [] : H > 2 && l(c[0], c[1], c[2]) && (c = [c[0]]), v(p, d(c, 1), []);
            });
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/stubArray.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/stubArray.js ***!
            \****************************************************/
          /***/
          (a) => {
            function f() {
              return [];
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/stubFalse.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/stubFalse.js ***!
            \****************************************************/
          /***/
          (a) => {
            function f() {
              return !1;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/lodash/toFinite.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/toFinite.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./toNumber */
              "../../../../node_modules/lodash/toNumber.js"
            ), v = 1 / 0, u = 17976931348623157e292;
            function l(P) {
              if (!P)
                return P === 0 ? P : 0;
              if (P = d(P), P === v || P === -v) {
                var p = P < 0 ? -1 : 1;
                return p * u;
              }
              return P === P ? P : 0;
            }
            a.exports = l;
          }
        ),
        /***/
        "../../../../node_modules/lodash/toInteger.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/toInteger.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./toFinite */
              "../../../../node_modules/lodash/toFinite.js"
            );
            function v(u) {
              var l = d(u), P = l % 1;
              return l === l ? P ? l - P : l : 0;
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/toNumber.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/toNumber.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseTrim */
              "../../../../node_modules/lodash/_baseTrim.js"
            ), v = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            ), u = o(
              /*! ./isSymbol */
              "../../../../node_modules/lodash/isSymbol.js"
            ), l = NaN, P = /^[-+]0x[0-9a-f]+$/i, p = /^0b[01]+$/i, c = /^0o[0-7]+$/i, H = parseInt;
            function T(q) {
              if (typeof q == "number")
                return q;
              if (u(q))
                return l;
              if (v(q)) {
                var b = typeof q.valueOf == "function" ? q.valueOf() : q;
                q = v(b) ? b + "" : b;
              }
              if (typeof q != "string")
                return q === 0 ? q : +q;
              q = d(q);
              var j = p.test(q);
              return j || c.test(q) ? H(q.slice(2), j ? 2 : 8) : P.test(q) ? l : +q;
            }
            a.exports = T;
          }
        ),
        /***/
        "../../../../node_modules/lodash/toPlainObject.js": (
          /*!********************************************************!*\
            !*** ../../../../node_modules/lodash/toPlainObject.js ***!
            \********************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_copyObject */
              "../../../../node_modules/lodash/_copyObject.js"
            ), v = o(
              /*! ./keysIn */
              "../../../../node_modules/lodash/keysIn.js"
            );
            function u(l) {
              return d(l, v(l));
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/toString.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/toString.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseToString */
              "../../../../node_modules/lodash/_baseToString.js"
            );
            function v(u) {
              return u == null ? "" : d(u);
            }
            a.exports = v;
          }
        ),
        /***/
        "../../../../node_modules/lodash/transform.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/transform.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_arrayEach */
              "../../../../node_modules/lodash/_arrayEach.js"
            ), v = o(
              /*! ./_baseCreate */
              "../../../../node_modules/lodash/_baseCreate.js"
            ), u = o(
              /*! ./_baseForOwn */
              "../../../../node_modules/lodash/_baseForOwn.js"
            ), l = o(
              /*! ./_baseIteratee */
              "../../../../node_modules/lodash/_baseIteratee.js"
            ), P = o(
              /*! ./_getPrototype */
              "../../../../node_modules/lodash/_getPrototype.js"
            ), p = o(
              /*! ./isArray */
              "../../../../node_modules/lodash/isArray.js"
            ), c = o(
              /*! ./isBuffer */
              "../../../../node_modules/lodash/isBuffer.js"
            ), H = o(
              /*! ./isFunction */
              "../../../../node_modules/lodash/isFunction.js"
            ), T = o(
              /*! ./isObject */
              "../../../../node_modules/lodash/isObject.js"
            ), q = o(
              /*! ./isTypedArray */
              "../../../../node_modules/lodash/isTypedArray.js"
            );
            function b(j, w, m) {
              var I = p(j), N = I || c(j) || q(j);
              if (w = l(w, 4), m == null) {
                var k = j && j.constructor;
                N ? m = I ? new k() : [] : T(j) ? m = H(k) ? v(P(j)) : {} : m = {};
              }
              return (N ? d : u)(j, function(R, y, O) {
                return w(m, R, y, O);
              }), m;
            }
            a.exports = b;
          }
        ),
        /***/
        "../../../../node_modules/lodash/union.js": (
          /*!************************************************!*\
            !*** ../../../../node_modules/lodash/union.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseFlatten */
              "../../../../node_modules/lodash/_baseFlatten.js"
            ), v = o(
              /*! ./_baseRest */
              "../../../../node_modules/lodash/_baseRest.js"
            ), u = o(
              /*! ./_baseUniq */
              "../../../../node_modules/lodash/_baseUniq.js"
            ), l = o(
              /*! ./isArrayLikeObject */
              "../../../../node_modules/lodash/isArrayLikeObject.js"
            ), P = v(function(p) {
              return u(d(p, 1, l, !0));
            });
            a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/lodash/uniqueId.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/lodash/uniqueId.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./toString */
              "../../../../node_modules/lodash/toString.js"
            ), v = 0;
            function u(l) {
              var P = ++v;
              return d(l) + P;
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/values.js": (
          /*!*************************************************!*\
            !*** ../../../../node_modules/lodash/values.js ***!
            \*************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_baseValues */
              "../../../../node_modules/lodash/_baseValues.js"
            ), v = o(
              /*! ./keys */
              "../../../../node_modules/lodash/keys.js"
            );
            function u(l) {
              return l == null ? [] : d(l, v(l));
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/lodash/zipObject.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/lodash/zipObject.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! ./_assignValue */
              "../../../../node_modules/lodash/_assignValue.js"
            ), v = o(
              /*! ./_baseZipObject */
              "../../../../node_modules/lodash/_baseZipObject.js"
            );
            function u(l, P) {
              return v(l || [], P || [], d);
            }
            a.exports = u;
          }
        ),
        /***/
        "../../../../node_modules/object-assign/index.js": (
          /*!*******************************************************!*\
            !*** ../../../../node_modules/object-assign/index.js ***!
            \*******************************************************/
          /***/
          (a) => {
            /*
            object-assign
            (c) Sindre Sorhus
            @license MIT
            */
            var f = Object.getOwnPropertySymbols, o = Object.prototype.hasOwnProperty, d = Object.prototype.propertyIsEnumerable;
            function v(l) {
              if (l == null)
                throw new TypeError("Object.assign cannot be called with null or undefined");
              return Object(l);
            }
            function u() {
              try {
                if (!Object.assign)
                  return !1;
                var l = new String("abc");
                if (l[5] = "de", Object.getOwnPropertyNames(l)[0] === "5")
                  return !1;
                for (var P = {}, p = 0; p < 10; p++)
                  P["_" + String.fromCharCode(p)] = p;
                var c = Object.getOwnPropertyNames(P).map(function(T) {
                  return P[T];
                });
                if (c.join("") !== "0123456789")
                  return !1;
                var H = {};
                return "abcdefghijklmnopqrst".split("").forEach(function(T) {
                  H[T] = T;
                }), Object.keys(Object.assign({}, H)).join("") === "abcdefghijklmnopqrst";
              } catch {
                return !1;
              }
            }
            a.exports = u() ? Object.assign : function(l, P) {
              for (var p, c = v(l), H, T = 1; T < arguments.length; T++) {
                p = Object(arguments[T]);
                for (var q in p)
                  o.call(p, q) && (c[q] = p[q]);
                if (f) {
                  H = f(p);
                  for (var b = 0; b < H.length; b++)
                    d.call(p, H[b]) && (c[H[b]] = p[H[b]]);
                }
              }
              return c;
            };
          }
        ),
        /***/
        "../../../../node_modules/prop-types/checkPropTypes.js": (
          /*!*************************************************************!*\
            !*** ../../../../node_modules/prop-types/checkPropTypes.js ***!
            \*************************************************************/
          /***/
          (a, f, o) => {
            var d = function() {
            };
            {
              var v = o(
                /*! ./lib/ReactPropTypesSecret */
                "../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js"
              ), u = {}, l = o(
                /*! ./lib/has */
                "../../../../node_modules/prop-types/lib/has.js"
              );
              d = function(p) {
                var c = "Warning: " + p;
                typeof console < "u" && console.error(c);
                try {
                  throw new Error(c);
                } catch {
                }
              };
            }
            function P(p, c, H, T, q) {
              for (var b in p)
                if (l(p, b)) {
                  var j;
                  try {
                    if (typeof p[b] != "function") {
                      var w = Error(
                        (T || "React class") + ": " + H + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof p[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
                      );
                      throw w.name = "Invariant Violation", w;
                    }
                    j = p[b](c, b, T, H, null, v);
                  } catch (I) {
                    j = I;
                  }
                  if (j && !(j instanceof Error) && d(
                    (T || "React class") + ": type specification of " + H + " `" + b + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof j + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
                  ), j instanceof Error && !(j.message in u)) {
                    u[j.message] = !0;
                    var m = q ? q() : "";
                    d(
                      "Failed " + H + " type: " + j.message + (m ?? "")
                    );
                  }
                }
            }
            P.resetWarningCache = function() {
              u = {};
            }, a.exports = P;
          }
        ),
        /***/
        "../../../../node_modules/prop-types/factoryWithTypeCheckers.js": (
          /*!**********************************************************************!*\
            !*** ../../../../node_modules/prop-types/factoryWithTypeCheckers.js ***!
            \**********************************************************************/
          /***/
          (a, f, o) => {
            var d = o(
              /*! react-is */
              "../../../../node_modules/prop-types/node_modules/react-is/index.js"
            ), v = o(
              /*! object-assign */
              "../../../../node_modules/object-assign/index.js"
            ), u = o(
              /*! ./lib/ReactPropTypesSecret */
              "../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js"
            ), l = o(
              /*! ./lib/has */
              "../../../../node_modules/prop-types/lib/has.js"
            ), P = o(
              /*! ./checkPropTypes */
              "../../../../node_modules/prop-types/checkPropTypes.js"
            ), p = function() {
            };
            p = function(H) {
              var T = "Warning: " + H;
              typeof console < "u" && console.error(T);
              try {
                throw new Error(T);
              } catch {
              }
            };
            function c() {
              return null;
            }
            a.exports = function(H, T) {
              var q = typeof Symbol == "function" && Symbol.iterator, b = "@@iterator";
              function j(re) {
                var ve = re && (q && re[q] || re[b]);
                if (typeof ve == "function")
                  return ve;
              }
              var w = "<<anonymous>>", m = {
                array: R("array"),
                bigint: R("bigint"),
                bool: R("boolean"),
                func: R("function"),
                number: R("number"),
                object: R("object"),
                string: R("string"),
                symbol: R("symbol"),
                any: y(),
                arrayOf: O,
                element: Y(),
                elementType: ee(),
                instanceOf: Z,
                node: G(),
                objectOf: fe,
                oneOf: te,
                oneOfType: _,
                shape: $,
                exact: ae
              };
              function I(re, ve) {
                return re === ve ? re !== 0 || 1 / re === 1 / ve : re !== re && ve !== ve;
              }
              function N(re, ve) {
                this.message = re, this.data = ve && typeof ve == "object" ? ve : {}, this.stack = "";
              }
              N.prototype = Error.prototype;
              function k(re) {
                var ve = {}, qe = 0;
                function ke(Fe, Ke, nt, ut, bt, wt, Tt) {
                  if (ut = ut || w, wt = wt || nt, Tt !== u) {
                    if (T) {
                      var lr = new Error(
                        "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
                      );
                      throw lr.name = "Invariant Violation", lr;
                    } else if (typeof console < "u") {
                      var Qt = ut + ":" + nt;
                      !ve[Qt] && // Avoid spamming the console because they are often not actionable except for lib authors
                      qe < 3 && (p(
                        "You are manually calling a React.PropTypes validation function for the `" + wt + "` prop on `" + ut + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
                      ), ve[Qt] = !0, qe++);
                    }
                  }
                  return Ke[nt] == null ? Fe ? Ke[nt] === null ? new N("The " + bt + " `" + wt + "` is marked as required " + ("in `" + ut + "`, but its value is `null`.")) : new N("The " + bt + " `" + wt + "` is marked as required in " + ("`" + ut + "`, but its value is `undefined`.")) : null : re(Ke, nt, ut, bt, wt);
                }
                var be = ke.bind(null, !1);
                return be.isRequired = ke.bind(null, !0), be;
              }
              function R(re) {
                function ve(qe, ke, be, Fe, Ke, nt) {
                  var ut = qe[ke], bt = me(ut);
                  if (bt !== re) {
                    var wt = Xe(ut);
                    return new N(
                      "Invalid " + Fe + " `" + Ke + "` of type " + ("`" + wt + "` supplied to `" + be + "`, expected ") + ("`" + re + "`."),
                      { expectedType: re }
                    );
                  }
                  return null;
                }
                return k(ve);
              }
              function y() {
                return k(c);
              }
              function O(re) {
                function ve(qe, ke, be, Fe, Ke) {
                  if (typeof re != "function")
                    return new N("Property `" + Ke + "` of component `" + be + "` has invalid PropType notation inside arrayOf.");
                  var nt = qe[ke];
                  if (!Array.isArray(nt)) {
                    var ut = me(nt);
                    return new N("Invalid " + Fe + " `" + Ke + "` of type " + ("`" + ut + "` supplied to `" + be + "`, expected an array."));
                  }
                  for (var bt = 0; bt < nt.length; bt++) {
                    var wt = re(nt, bt, be, Fe, Ke + "[" + bt + "]", u);
                    if (wt instanceof Error)
                      return wt;
                  }
                  return null;
                }
                return k(ve);
              }
              function Y() {
                function re(ve, qe, ke, be, Fe) {
                  var Ke = ve[qe];
                  if (!H(Ke)) {
                    var nt = me(Ke);
                    return new N("Invalid " + be + " `" + Fe + "` of type " + ("`" + nt + "` supplied to `" + ke + "`, expected a single ReactElement."));
                  }
                  return null;
                }
                return k(re);
              }
              function ee() {
                function re(ve, qe, ke, be, Fe) {
                  var Ke = ve[qe];
                  if (!d.isValidElementType(Ke)) {
                    var nt = me(Ke);
                    return new N("Invalid " + be + " `" + Fe + "` of type " + ("`" + nt + "` supplied to `" + ke + "`, expected a single ReactElement type."));
                  }
                  return null;
                }
                return k(re);
              }
              function Z(re) {
                function ve(qe, ke, be, Fe, Ke) {
                  if (!(qe[ke] instanceof re)) {
                    var nt = re.name || w, ut = ne(qe[ke]);
                    return new N("Invalid " + Fe + " `" + Ke + "` of type " + ("`" + ut + "` supplied to `" + be + "`, expected ") + ("instance of `" + nt + "`."));
                  }
                  return null;
                }
                return k(ve);
              }
              function te(re) {
                if (!Array.isArray(re))
                  return arguments.length > 1 ? p(
                    "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
                  ) : p("Invalid argument supplied to oneOf, expected an array."), c;
                function ve(qe, ke, be, Fe, Ke) {
                  for (var nt = qe[ke], ut = 0; ut < re.length; ut++)
                    if (I(nt, re[ut]))
                      return null;
                  var bt = JSON.stringify(re, function(Tt, lr) {
                    var Qt = Xe(lr);
                    return Qt === "symbol" ? String(lr) : lr;
                  });
                  return new N("Invalid " + Fe + " `" + Ke + "` of value `" + String(nt) + "` " + ("supplied to `" + be + "`, expected one of " + bt + "."));
                }
                return k(ve);
              }
              function fe(re) {
                function ve(qe, ke, be, Fe, Ke) {
                  if (typeof re != "function")
                    return new N("Property `" + Ke + "` of component `" + be + "` has invalid PropType notation inside objectOf.");
                  var nt = qe[ke], ut = me(nt);
                  if (ut !== "object")
                    return new N("Invalid " + Fe + " `" + Ke + "` of type " + ("`" + ut + "` supplied to `" + be + "`, expected an object."));
                  for (var bt in nt)
                    if (l(nt, bt)) {
                      var wt = re(nt, bt, be, Fe, Ke + "." + bt, u);
                      if (wt instanceof Error)
                        return wt;
                    }
                  return null;
                }
                return k(ve);
              }
              function _(re) {
                if (!Array.isArray(re))
                  return p("Invalid argument supplied to oneOfType, expected an instance of array."), c;
                for (var ve = 0; ve < re.length; ve++) {
                  var qe = re[ve];
                  if (typeof qe != "function")
                    return p(
                      "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + De(qe) + " at index " + ve + "."
                    ), c;
                }
                function ke(be, Fe, Ke, nt, ut) {
                  for (var bt = [], wt = 0; wt < re.length; wt++) {
                    var Tt = re[wt], lr = Tt(be, Fe, Ke, nt, ut, u);
                    if (lr == null)
                      return null;
                    lr.data && l(lr.data, "expectedType") && bt.push(lr.data.expectedType);
                  }
                  var Qt = bt.length > 0 ? ", expected one of type [" + bt.join(", ") + "]" : "";
                  return new N("Invalid " + nt + " `" + ut + "` supplied to " + ("`" + Ke + "`" + Qt + "."));
                }
                return k(ke);
              }
              function G() {
                function re(ve, qe, ke, be, Fe) {
                  return Pe(ve[qe]) ? null : new N("Invalid " + be + " `" + Fe + "` supplied to " + ("`" + ke + "`, expected a ReactNode."));
                }
                return k(re);
              }
              function L(re, ve, qe, ke, be) {
                return new N(
                  (re || "React class") + ": " + ve + " type `" + qe + "." + ke + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + be + "`."
                );
              }
              function $(re) {
                function ve(qe, ke, be, Fe, Ke) {
                  var nt = qe[ke], ut = me(nt);
                  if (ut !== "object")
                    return new N("Invalid " + Fe + " `" + Ke + "` of type `" + ut + "` " + ("supplied to `" + be + "`, expected `object`."));
                  for (var bt in re) {
                    var wt = re[bt];
                    if (typeof wt != "function")
                      return L(be, Fe, Ke, bt, Xe(wt));
                    var Tt = wt(nt, bt, be, Fe, Ke + "." + bt, u);
                    if (Tt)
                      return Tt;
                  }
                  return null;
                }
                return k(ve);
              }
              function ae(re) {
                function ve(qe, ke, be, Fe, Ke) {
                  var nt = qe[ke], ut = me(nt);
                  if (ut !== "object")
                    return new N("Invalid " + Fe + " `" + Ke + "` of type `" + ut + "` " + ("supplied to `" + be + "`, expected `object`."));
                  var bt = v({}, qe[ke], re);
                  for (var wt in bt) {
                    var Tt = re[wt];
                    if (l(re, wt) && typeof Tt != "function")
                      return L(be, Fe, Ke, wt, Xe(Tt));
                    if (!Tt)
                      return new N(
                        "Invalid " + Fe + " `" + Ke + "` key `" + wt + "` supplied to `" + be + "`.\nBad object: " + JSON.stringify(qe[ke], null, "  ") + `
Valid keys: ` + JSON.stringify(Object.keys(re), null, "  ")
                      );
                    var lr = Tt(nt, wt, be, Fe, Ke + "." + wt, u);
                    if (lr)
                      return lr;
                  }
                  return null;
                }
                return k(ve);
              }
              function Pe(re) {
                switch (typeof re) {
                  case "number":
                  case "string":
                  case "undefined":
                    return !0;
                  case "boolean":
                    return !re;
                  case "object":
                    if (Array.isArray(re))
                      return re.every(Pe);
                    if (re === null || H(re))
                      return !0;
                    var ve = j(re);
                    if (ve) {
                      var qe = ve.call(re), ke;
                      if (ve !== re.entries) {
                        for (; !(ke = qe.next()).done; )
                          if (!Pe(ke.value))
                            return !1;
                      } else
                        for (; !(ke = qe.next()).done; ) {
                          var be = ke.value;
                          if (be && !Pe(be[1]))
                            return !1;
                        }
                    } else
                      return !1;
                    return !0;
                  default:
                    return !1;
                }
              }
              function ge(re, ve) {
                return re === "symbol" ? !0 : ve ? ve["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && ve instanceof Symbol : !1;
              }
              function me(re) {
                var ve = typeof re;
                return Array.isArray(re) ? "array" : re instanceof RegExp ? "object" : ge(ve, re) ? "symbol" : ve;
              }
              function Xe(re) {
                if (typeof re > "u" || re === null)
                  return "" + re;
                var ve = me(re);
                if (ve === "object") {
                  if (re instanceof Date)
                    return "date";
                  if (re instanceof RegExp)
                    return "regexp";
                }
                return ve;
              }
              function De(re) {
                var ve = Xe(re);
                switch (ve) {
                  case "array":
                  case "object":
                    return "an " + ve;
                  case "boolean":
                  case "date":
                  case "regexp":
                    return "a " + ve;
                  default:
                    return ve;
                }
              }
              function ne(re) {
                return !re.constructor || !re.constructor.name ? w : re.constructor.name;
              }
              return m.checkPropTypes = P, m.resetWarningCache = P.resetWarningCache, m.PropTypes = m, m;
            };
          }
        ),
        /***/
        "../../../../node_modules/prop-types/index.js": (
          /*!****************************************************!*\
            !*** ../../../../node_modules/prop-types/index.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            {
              var d = o(
                /*! react-is */
                "../../../../node_modules/prop-types/node_modules/react-is/index.js"
              ), v = !0;
              a.exports = o(
                /*! ./factoryWithTypeCheckers */
                "../../../../node_modules/prop-types/factoryWithTypeCheckers.js"
              )(d.isElement, v);
            }
          }
        ),
        /***/
        "../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js": (
          /*!***********************************************************************!*\
            !*** ../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
            \***********************************************************************/
          /***/
          (a) => {
            var f = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/prop-types/lib/has.js": (
          /*!******************************************************!*\
            !*** ../../../../node_modules/prop-types/lib/has.js ***!
            \******************************************************/
          /***/
          (a) => {
            a.exports = Function.call.bind(Object.prototype.hasOwnProperty);
          }
        ),
        /***/
        "../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js": (
          /*!*********************************************************************************************!*\
            !*** ../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***!
            \*********************************************************************************************/
          /***/
          (a, f) => {
            /** @license React v16.13.1
             * react-is.development.js
             *
             * Copyright (c) Facebook, Inc. and its affiliates.
             *
             * This source code is licensed under the MIT license found in the
             * LICENSE file in the root directory of this source tree.
             */
            (function() {
              var o = typeof Symbol == "function" && Symbol.for, d = o ? Symbol.for("react.element") : 60103, v = o ? Symbol.for("react.portal") : 60106, u = o ? Symbol.for("react.fragment") : 60107, l = o ? Symbol.for("react.strict_mode") : 60108, P = o ? Symbol.for("react.profiler") : 60114, p = o ? Symbol.for("react.provider") : 60109, c = o ? Symbol.for("react.context") : 60110, H = o ? Symbol.for("react.async_mode") : 60111, T = o ? Symbol.for("react.concurrent_mode") : 60111, q = o ? Symbol.for("react.forward_ref") : 60112, b = o ? Symbol.for("react.suspense") : 60113, j = o ? Symbol.for("react.suspense_list") : 60120, w = o ? Symbol.for("react.memo") : 60115, m = o ? Symbol.for("react.lazy") : 60116, I = o ? Symbol.for("react.block") : 60121, N = o ? Symbol.for("react.fundamental") : 60117, k = o ? Symbol.for("react.responder") : 60118, R = o ? Symbol.for("react.scope") : 60119;
              function y(Tt) {
                return typeof Tt == "string" || typeof Tt == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
                Tt === u || Tt === T || Tt === P || Tt === l || Tt === b || Tt === j || typeof Tt == "object" && Tt !== null && (Tt.$$typeof === m || Tt.$$typeof === w || Tt.$$typeof === p || Tt.$$typeof === c || Tt.$$typeof === q || Tt.$$typeof === N || Tt.$$typeof === k || Tt.$$typeof === R || Tt.$$typeof === I);
              }
              function O(Tt) {
                if (typeof Tt == "object" && Tt !== null) {
                  var lr = Tt.$$typeof;
                  switch (lr) {
                    case d:
                      var Qt = Tt.type;
                      switch (Qt) {
                        case H:
                        case T:
                        case u:
                        case P:
                        case l:
                        case b:
                          return Qt;
                        default:
                          var tr = Qt && Qt.$$typeof;
                          switch (tr) {
                            case c:
                            case q:
                            case m:
                            case w:
                            case p:
                              return tr;
                            default:
                              return lr;
                          }
                      }
                    case v:
                      return lr;
                  }
                }
              }
              var Y = H, ee = T, Z = c, te = p, fe = d, _ = q, G = u, L = m, $ = w, ae = v, Pe = P, ge = l, me = b, Xe = !1;
              function De(Tt) {
                return Xe || (Xe = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), ne(Tt) || O(Tt) === H;
              }
              function ne(Tt) {
                return O(Tt) === T;
              }
              function re(Tt) {
                return O(Tt) === c;
              }
              function ve(Tt) {
                return O(Tt) === p;
              }
              function qe(Tt) {
                return typeof Tt == "object" && Tt !== null && Tt.$$typeof === d;
              }
              function ke(Tt) {
                return O(Tt) === q;
              }
              function be(Tt) {
                return O(Tt) === u;
              }
              function Fe(Tt) {
                return O(Tt) === m;
              }
              function Ke(Tt) {
                return O(Tt) === w;
              }
              function nt(Tt) {
                return O(Tt) === v;
              }
              function ut(Tt) {
                return O(Tt) === P;
              }
              function bt(Tt) {
                return O(Tt) === l;
              }
              function wt(Tt) {
                return O(Tt) === b;
              }
              f.AsyncMode = Y, f.ConcurrentMode = ee, f.ContextConsumer = Z, f.ContextProvider = te, f.Element = fe, f.ForwardRef = _, f.Fragment = G, f.Lazy = L, f.Memo = $, f.Portal = ae, f.Profiler = Pe, f.StrictMode = ge, f.Suspense = me, f.isAsyncMode = De, f.isConcurrentMode = ne, f.isContextConsumer = re, f.isContextProvider = ve, f.isElement = qe, f.isForwardRef = ke, f.isFragment = be, f.isLazy = Fe, f.isMemo = Ke, f.isPortal = nt, f.isProfiler = ut, f.isStrictMode = bt, f.isSuspense = wt, f.isValidElementType = y, f.typeOf = O;
            })();
          }
        ),
        /***/
        "../../../../node_modules/prop-types/node_modules/react-is/index.js": (
          /*!**************************************************************************!*\
            !*** ../../../../node_modules/prop-types/node_modules/react-is/index.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            a.exports = o(
              /*! ./cjs/react-is.development.js */
              "../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"
            );
          }
        ),
        /***/
        "../../../../node_modules/react-dom/cjs/react-dom.development.js": (
          /*!***********************************************************************!*\
            !*** ../../../../node_modules/react-dom/cjs/react-dom.development.js ***!
            \***********************************************************************/
          /***/
          (a, f, o) => {
            /** @license React v17.0.2
             * react-dom.development.js
             *
             * Copyright (c) Facebook, Inc. and its affiliates.
             *
             * This source code is licensed under the MIT license found in the
             * LICENSE file in the root directory of this source tree.
             */
            (function() {
              var d = o(
                /*! react */
                "../../../../node_modules/react/index.js"
              ), v = o(
                /*! object-assign */
                "../../../../node_modules/object-assign/index.js"
              ), u = o(
                /*! scheduler */
                "../../../../node_modules/scheduler/index.js"
              ), l = o(
                /*! scheduler/tracing */
                "../../../../node_modules/scheduler/tracing.js"
              ), P = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
              function p(g) {
                {
                  for (var x = arguments.length, U = new Array(x > 1 ? x - 1 : 0), F = 1; F < x; F++)
                    U[F - 1] = arguments[F];
                  H("warn", g, U);
                }
              }
              function c(g) {
                {
                  for (var x = arguments.length, U = new Array(x > 1 ? x - 1 : 0), F = 1; F < x; F++)
                    U[F - 1] = arguments[F];
                  H("error", g, U);
                }
              }
              function H(g, x, U) {
                {
                  var F = P.ReactDebugCurrentFrame, K = F.getStackAddendum();
                  K !== "" && (x += "%s", U = U.concat([K]));
                  var oe = U.map(function(ce) {
                    return "" + ce;
                  });
                  oe.unshift("Warning: " + x), Function.prototype.apply.call(console[g], console, oe);
                }
              }
              if (!d)
                throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
              var T = 0, q = 1, b = 2, j = 3, w = 4, m = 5, I = 6, N = 7, k = 8, R = 9, y = 10, O = 11, Y = 12, ee = 13, Z = 14, te = 15, fe = 16, _ = 17, G = 18, L = 19, $ = 20, ae = 21, Pe = 22, ge = 23, me = 24, Xe = !0, De = !1, ne = !1, re = !1, ve = /* @__PURE__ */ new Set(), qe = {}, ke = {};
              function be(g, x) {
                Fe(g, x), Fe(g + "Capture", x);
              }
              function Fe(g, x) {
                qe[g] && c("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", g), qe[g] = x;
                {
                  var U = g.toLowerCase();
                  ke[U] = g, g === "onDoubleClick" && (ke.ondblclick = g);
                }
                for (var F = 0; F < x.length; F++)
                  ve.add(x[F]);
              }
              var Ke = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", nt = 0, ut = 1, bt = 2, wt = 3, Tt = 4, lr = 5, Qt = 6, tr = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", br = tr + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040", Xn = "data-reactroot", qr = new RegExp("^[" + tr + "][" + br + "]*$"), En = Object.prototype.hasOwnProperty, Bn = {}, Fi = {};
              function Gt(g) {
                return En.call(Fi, g) ? !0 : En.call(Bn, g) ? !1 : qr.test(g) ? (Fi[g] = !0, !0) : (Bn[g] = !0, c("Invalid attribute name: `%s`", g), !1);
              }
              function xr(g, x, U) {
                return x !== null ? x.type === nt : U ? !1 : g.length > 2 && (g[0] === "o" || g[0] === "O") && (g[1] === "n" || g[1] === "N");
              }
              function Br(g, x, U, F) {
                if (U !== null && U.type === nt)
                  return !1;
                switch (typeof x) {
                  case "function":
                  case "symbol":
                    return !0;
                  case "boolean": {
                    if (F)
                      return !1;
                    if (U !== null)
                      return !U.acceptsBooleans;
                    var K = g.toLowerCase().slice(0, 5);
                    return K !== "data-" && K !== "aria-";
                  }
                  default:
                    return !1;
                }
              }
              function nn(g, x, U, F) {
                if (x === null || typeof x > "u" || Br(g, x, U, F))
                  return !0;
                if (F)
                  return !1;
                if (U !== null)
                  switch (U.type) {
                    case wt:
                      return !x;
                    case Tt:
                      return x === !1;
                    case lr:
                      return isNaN(x);
                    case Qt:
                      return isNaN(x) || x < 1;
                  }
                return !1;
              }
              function sn(g) {
                return an.hasOwnProperty(g) ? an[g] : null;
              }
              function Pn(g, x, U, F, K, oe, ce) {
                this.acceptsBooleans = x === bt || x === wt || x === Tt, this.attributeName = F, this.attributeNamespace = K, this.mustUseProperty = U, this.propertyName = g, this.type = x, this.sanitizeURL = oe, this.removeEmptyString = ce;
              }
              var an = {}, Wn = [
                "children",
                "dangerouslySetInnerHTML",
                // TODO: This prevents the assignment of defaultValue to regular
                // elements (not just inputs). Now that ReactDOMInput assigns to the
                // defaultValue property -- do we need this?
                "defaultValue",
                "defaultChecked",
                "innerHTML",
                "suppressContentEditableWarning",
                "suppressHydrationWarning",
                "style"
              ];
              Wn.forEach(function(g) {
                an[g] = new Pn(
                  g,
                  nt,
                  !1,
                  // mustUseProperty
                  g,
                  // attributeName
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(g) {
                var x = g[0], U = g[1];
                an[x] = new Pn(
                  x,
                  ut,
                  !1,
                  // mustUseProperty
                  U,
                  // attributeName
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(g) {
                an[g] = new Pn(
                  g,
                  bt,
                  !1,
                  // mustUseProperty
                  g.toLowerCase(),
                  // attributeName
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(g) {
                an[g] = new Pn(
                  g,
                  bt,
                  !1,
                  // mustUseProperty
                  g,
                  // attributeName
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              }), [
                "allowFullScreen",
                "async",
                // Note: there is a special case that prevents it from being written to the DOM
                // on the client side because the browsers are inconsistent. Instead we call focus().
                "autoFocus",
                "autoPlay",
                "controls",
                "default",
                "defer",
                "disabled",
                "disablePictureInPicture",
                "disableRemotePlayback",
                "formNoValidate",
                "hidden",
                "loop",
                "noModule",
                "noValidate",
                "open",
                "playsInline",
                "readOnly",
                "required",
                "reversed",
                "scoped",
                "seamless",
                // Microdata
                "itemScope"
              ].forEach(function(g) {
                an[g] = new Pn(
                  g,
                  wt,
                  !1,
                  // mustUseProperty
                  g.toLowerCase(),
                  // attributeName
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              }), [
                "checked",
                // Note: `option.selected` is not updated if `select.multiple` is
                // disabled with `removeAttribute`. We have special logic for handling this.
                "multiple",
                "muted",
                "selected"
                // NOTE: if you add a camelCased prop to this list,
                // you'll need to set attributeName to name.toLowerCase()
                // instead in the assignment below.
              ].forEach(function(g) {
                an[g] = new Pn(
                  g,
                  wt,
                  !0,
                  // mustUseProperty
                  g,
                  // attributeName
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              }), [
                "capture",
                "download"
                // NOTE: if you add a camelCased prop to this list,
                // you'll need to set attributeName to name.toLowerCase()
                // instead in the assignment below.
              ].forEach(function(g) {
                an[g] = new Pn(
                  g,
                  Tt,
                  !1,
                  // mustUseProperty
                  g,
                  // attributeName
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              }), [
                "cols",
                "rows",
                "size",
                "span"
                // NOTE: if you add a camelCased prop to this list,
                // you'll need to set attributeName to name.toLowerCase()
                // instead in the assignment below.
              ].forEach(function(g) {
                an[g] = new Pn(
                  g,
                  Qt,
                  !1,
                  // mustUseProperty
                  g,
                  // attributeName
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              }), ["rowSpan", "start"].forEach(function(g) {
                an[g] = new Pn(
                  g,
                  lr,
                  !1,
                  // mustUseProperty
                  g.toLowerCase(),
                  // attributeName
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              });
              var rr = /[\-\:]([a-z])/g, Sr = function(g) {
                return g[1].toUpperCase();
              };
              [
                "accent-height",
                "alignment-baseline",
                "arabic-form",
                "baseline-shift",
                "cap-height",
                "clip-path",
                "clip-rule",
                "color-interpolation",
                "color-interpolation-filters",
                "color-profile",
                "color-rendering",
                "dominant-baseline",
                "enable-background",
                "fill-opacity",
                "fill-rule",
                "flood-color",
                "flood-opacity",
                "font-family",
                "font-size",
                "font-size-adjust",
                "font-stretch",
                "font-style",
                "font-variant",
                "font-weight",
                "glyph-name",
                "glyph-orientation-horizontal",
                "glyph-orientation-vertical",
                "horiz-adv-x",
                "horiz-origin-x",
                "image-rendering",
                "letter-spacing",
                "lighting-color",
                "marker-end",
                "marker-mid",
                "marker-start",
                "overline-position",
                "overline-thickness",
                "paint-order",
                "panose-1",
                "pointer-events",
                "rendering-intent",
                "shape-rendering",
                "stop-color",
                "stop-opacity",
                "strikethrough-position",
                "strikethrough-thickness",
                "stroke-dasharray",
                "stroke-dashoffset",
                "stroke-linecap",
                "stroke-linejoin",
                "stroke-miterlimit",
                "stroke-opacity",
                "stroke-width",
                "text-anchor",
                "text-decoration",
                "text-rendering",
                "underline-position",
                "underline-thickness",
                "unicode-bidi",
                "unicode-range",
                "units-per-em",
                "v-alphabetic",
                "v-hanging",
                "v-ideographic",
                "v-mathematical",
                "vector-effect",
                "vert-adv-y",
                "vert-origin-x",
                "vert-origin-y",
                "word-spacing",
                "writing-mode",
                "xmlns:xlink",
                "x-height"
                // NOTE: if you add a camelCased prop to this list,
                // you'll need to set attributeName to name.toLowerCase()
                // instead in the assignment below.
              ].forEach(function(g) {
                var x = g.replace(rr, Sr);
                an[x] = new Pn(
                  x,
                  ut,
                  !1,
                  // mustUseProperty
                  g,
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              }), [
                "xlink:actuate",
                "xlink:arcrole",
                "xlink:role",
                "xlink:show",
                "xlink:title",
                "xlink:type"
                // NOTE: if you add a camelCased prop to this list,
                // you'll need to set attributeName to name.toLowerCase()
                // instead in the assignment below.
              ].forEach(function(g) {
                var x = g.replace(rr, Sr);
                an[x] = new Pn(
                  x,
                  ut,
                  !1,
                  // mustUseProperty
                  g,
                  "http://www.w3.org/1999/xlink",
                  !1,
                  // sanitizeURL
                  !1
                );
              }), [
                "xml:base",
                "xml:lang",
                "xml:space"
                // NOTE: if you add a camelCased prop to this list,
                // you'll need to set attributeName to name.toLowerCase()
                // instead in the assignment below.
              ].forEach(function(g) {
                var x = g.replace(rr, Sr);
                an[x] = new Pn(
                  x,
                  ut,
                  !1,
                  // mustUseProperty
                  g,
                  "http://www.w3.org/XML/1998/namespace",
                  !1,
                  // sanitizeURL
                  !1
                );
              }), ["tabIndex", "crossOrigin"].forEach(function(g) {
                an[g] = new Pn(
                  g,
                  ut,
                  !1,
                  // mustUseProperty
                  g.toLowerCase(),
                  // attributeName
                  null,
                  // attributeNamespace
                  !1,
                  // sanitizeURL
                  !1
                );
              });
              var nr = "xlinkHref";
              an[nr] = new Pn(
                "xlinkHref",
                ut,
                !1,
                // mustUseProperty
                "xlink:href",
                "http://www.w3.org/1999/xlink",
                !0,
                // sanitizeURL
                !1
              ), ["src", "href", "action", "formAction"].forEach(function(g) {
                an[g] = new Pn(
                  g,
                  ut,
                  !1,
                  // mustUseProperty
                  g.toLowerCase(),
                  // attributeName
                  null,
                  // attributeNamespace
                  !0,
                  // sanitizeURL
                  !0
                );
              });
              var Er = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i, Rn = !1;
              function Vn(g) {
                !Rn && Er.test(g) && (Rn = !0, c("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(g)));
              }
              function ki(g, x, U, F) {
                if (F.mustUseProperty) {
                  var K = F.propertyName;
                  return g[K];
                } else {
                  F.sanitizeURL && Vn("" + U);
                  var oe = F.attributeName, ce = null;
                  if (F.type === Tt) {
                    if (g.hasAttribute(oe)) {
                      var Te = g.getAttribute(oe);
                      return Te === "" ? !0 : nn(x, U, F, !1) ? Te : Te === "" + U ? U : Te;
                    }
                  } else if (g.hasAttribute(oe)) {
                    if (nn(x, U, F, !1))
                      return g.getAttribute(oe);
                    if (F.type === wt)
                      return U;
                    ce = g.getAttribute(oe);
                  }
                  return nn(x, U, F, !1) ? ce === null ? U : ce : ce === "" + U ? U : ce;
                }
              }
              function as(g, x, U) {
                {
                  if (!Gt(x))
                    return;
                  if (AX(U))
                    return U;
                  if (!g.hasAttribute(x))
                    return U === void 0 ? void 0 : null;
                  var F = g.getAttribute(x);
                  return F === "" + U ? U : F;
                }
              }
              function Rr(g, x, U, F) {
                var K = sn(x);
                if (!xr(x, K, F)) {
                  if (nn(x, U, K, F) && (U = null), F || K === null) {
                    if (Gt(x)) {
                      var oe = x;
                      U === null ? g.removeAttribute(oe) : g.setAttribute(oe, "" + U);
                    }
                    return;
                  }
                  var ce = K.mustUseProperty;
                  if (ce) {
                    var Te = K.propertyName;
                    if (U === null) {
                      var Ce = K.type;
                      g[Te] = Ce === wt ? !1 : "";
                    } else
                      g[Te] = U;
                    return;
                  }
                  var tt = K.attributeName, ft = K.attributeNamespace;
                  if (U === null)
                    g.removeAttribute(tt);
                  else {
                    var Rt = K.type, ct;
                    Rt === wt || Rt === Tt && U === !0 ? ct = "" : (ct = "" + U, K.sanitizeURL && Vn(ct.toString())), ft ? g.setAttributeNS(ft, tt, ct) : g.setAttribute(tt, ct);
                  }
                }
              }
              var Ii = 60103, is = 60106, ji = 60107, _i = 60108, oi = 60114, vr = 60109, Fr = 60110, pr = 60112, ds = 60113, it = 60120, $t = 60115, Ur = 60116, $e = 60121, Kt = 60119, cr = 60128, Vr = 60129, Lr = 60130, pi = 60131;
              if (typeof Symbol == "function" && Symbol.for) {
                var zr = Symbol.for;
                Ii = zr("react.element"), is = zr("react.portal"), ji = zr("react.fragment"), _i = zr("react.strict_mode"), oi = zr("react.profiler"), vr = zr("react.provider"), Fr = zr("react.context"), pr = zr("react.forward_ref"), ds = zr("react.suspense"), it = zr("react.suspense_list"), $t = zr("react.memo"), Ur = zr("react.lazy"), $e = zr("react.block"), zr("react.server.block"), zr("react.fundamental"), Kt = zr("react.scope"), cr = zr("react.opaque.id"), Vr = zr("react.debug_trace_mode"), Lr = zr("react.offscreen"), pi = zr("react.legacy_hidden");
              }
              var Cn = typeof Symbol == "function" && Symbol.iterator, Mi = "@@iterator";
              function li(g) {
                if (g === null || typeof g != "object")
                  return null;
                var x = Cn && g[Cn] || g[Mi];
                return typeof x == "function" ? x : null;
              }
              var Xs = 0, Ri, j1, w1, di, jf, B6, W6;
              function S6() {
              }
              S6.__reactDisabledLog = !0;
              function qa() {
                {
                  if (Xs === 0) {
                    Ri = console.log, j1 = console.info, w1 = console.warn, di = console.error, jf = console.group, B6 = console.groupCollapsed, W6 = console.groupEnd;
                    var g = {
                      configurable: !0,
                      enumerable: !0,
                      value: S6,
                      writable: !0
                    };
                    Object.defineProperties(console, {
                      info: g,
                      log: g,
                      warn: g,
                      error: g,
                      group: g,
                      groupCollapsed: g,
                      groupEnd: g
                    });
                  }
                  Xs++;
                }
              }
              function m1() {
                {
                  if (Xs--, Xs === 0) {
                    var g = {
                      configurable: !0,
                      enumerable: !0,
                      writable: !0
                    };
                    Object.defineProperties(console, {
                      log: v({}, g, {
                        value: Ri
                      }),
                      info: v({}, g, {
                        value: j1
                      }),
                      warn: v({}, g, {
                        value: w1
                      }),
                      error: v({}, g, {
                        value: di
                      }),
                      group: v({}, g, {
                        value: jf
                      }),
                      groupCollapsed: v({}, g, {
                        value: B6
                      }),
                      groupEnd: v({}, g, {
                        value: W6
                      })
                    });
                  }
                  Xs < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
                }
              }
              var Ho = P.ReactCurrentDispatcher, X9;
              function $o(g, x, U) {
                {
                  if (X9 === void 0)
                    try {
                      throw Error();
                    } catch (K) {
                      var F = K.stack.trim().match(/\n( *(at )?)/);
                      X9 = F && F[1] || "";
                    }
                  return `
` + X9 + g;
                }
              }
              var T9 = !1, q9;
              {
                var wf = typeof WeakMap == "function" ? WeakMap : Map;
                q9 = new wf();
              }
              function mf(g, x) {
                if (!g || T9)
                  return "";
                {
                  var U = q9.get(g);
                  if (U !== void 0)
                    return U;
                }
                var F;
                T9 = !0;
                var K = Error.prepareStackTrace;
                Error.prepareStackTrace = void 0;
                var oe;
                oe = Ho.current, Ho.current = null, qa();
                try {
                  if (x) {
                    var ce = function() {
                      throw Error();
                    };
                    if (Object.defineProperty(ce.prototype, "props", {
                      set: function() {
                        throw Error();
                      }
                    }), typeof Reflect == "object" && Reflect.construct) {
                      try {
                        Reflect.construct(ce, []);
                      } catch (wr) {
                        F = wr;
                      }
                      Reflect.construct(g, [], ce);
                    } else {
                      try {
                        ce.call();
                      } catch (wr) {
                        F = wr;
                      }
                      g.call(ce.prototype);
                    }
                  } else {
                    try {
                      throw Error();
                    } catch (wr) {
                      F = wr;
                    }
                    g();
                  }
                } catch (wr) {
                  if (wr && F && typeof wr.stack == "string") {
                    for (var Te = wr.stack.split(`
`), Ce = F.stack.split(`
`), tt = Te.length - 1, ft = Ce.length - 1; tt >= 1 && ft >= 0 && Te[tt] !== Ce[ft]; )
                      ft--;
                    for (; tt >= 1 && ft >= 0; tt--, ft--)
                      if (Te[tt] !== Ce[ft]) {
                        if (tt !== 1 || ft !== 1)
                          do
                            if (tt--, ft--, ft < 0 || Te[tt] !== Ce[ft]) {
                              var Rt = `
` + Te[tt].replace(" at new ", " at ");
                              return typeof g == "function" && q9.set(g, Rt), Rt;
                            }
                          while (tt >= 1 && ft >= 0);
                        break;
                      }
                  }
                } finally {
                  T9 = !1, Ho.current = oe, m1(), Error.prepareStackTrace = K;
                }
                var ct = g ? g.displayName || g.name : "", Ft = ct ? $o(ct) : "";
                return typeof g == "function" && q9.set(g, Ft), Ft;
              }
              function B1(g, x, U) {
                return mf(g, !0);
              }
              function h1(g, x, U) {
                return mf(g, !1);
              }
              function U6(g) {
                var x = g.prototype;
                return !!(x && x.isReactComponent);
              }
              function b9(g, x, U) {
                if (g == null)
                  return "";
                if (typeof g == "function")
                  return mf(g, U6(g));
                if (typeof g == "string")
                  return $o(g);
                switch (g) {
                  case ds:
                    return $o("Suspense");
                  case it:
                    return $o("SuspenseList");
                }
                if (typeof g == "object")
                  switch (g.$$typeof) {
                    case pr:
                      return h1(g.render);
                    case $t:
                      return b9(g.type, x, U);
                    case $e:
                      return h1(g._render);
                    case Ur: {
                      var F = g, K = F._payload, oe = F._init;
                      try {
                        return b9(oe(K), x, U);
                      } catch {
                      }
                    }
                  }
                return "";
              }
              function J9(g) {
                switch (g._debugOwner && g._debugOwner.type, g._debugSource, g.tag) {
                  case m:
                    return $o(g.type);
                  case fe:
                    return $o("Lazy");
                  case ee:
                    return $o("Suspense");
                  case L:
                    return $o("SuspenseList");
                  case T:
                  case b:
                  case te:
                    return h1(g.type);
                  case O:
                    return h1(g.type.render);
                  case Pe:
                    return h1(g.type._render);
                  case q:
                    return B1(g.type);
                  default:
                    return "";
                }
              }
              function OA(g) {
                try {
                  var x = "", U = g;
                  do
                    x += J9(U), U = U.return;
                  while (U);
                  return x;
                } catch (F) {
                  return `
Error generating stack: ` + F.message + `
` + F.stack;
                }
              }
              function z1(g, x, U) {
                var F = x.displayName || x.name || "";
                return g.displayName || (F !== "" ? U + "(" + F + ")" : U);
              }
              function Zd(g) {
                return g.displayName || "Context";
              }
              function Zr(g) {
                if (g == null)
                  return null;
                if (typeof g.tag == "number" && c("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."), typeof g == "function")
                  return g.displayName || g.name || null;
                if (typeof g == "string")
                  return g;
                switch (g) {
                  case ji:
                    return "Fragment";
                  case is:
                    return "Portal";
                  case oi:
                    return "Profiler";
                  case _i:
                    return "StrictMode";
                  case ds:
                    return "Suspense";
                  case it:
                    return "SuspenseList";
                }
                if (typeof g == "object")
                  switch (g.$$typeof) {
                    case Fr:
                      var x = g;
                      return Zd(x) + ".Consumer";
                    case vr:
                      var U = g;
                      return Zd(U._context) + ".Provider";
                    case pr:
                      return z1(g, g.render, "ForwardRef");
                    case $t:
                      return Zr(g.type);
                    case $e:
                      return Zr(g._render);
                    case Ur: {
                      var F = g, K = F._payload, oe = F._init;
                      try {
                        return Zr(oe(K));
                      } catch {
                        return null;
                      }
                    }
                  }
                return null;
              }
              var Ts = P.ReactDebugCurrentFrame, go = null, G1 = !1;
              function z9() {
                {
                  if (go === null)
                    return null;
                  var g = go._debugOwner;
                  if (g !== null && typeof g < "u")
                    return Zr(g.type);
                }
                return null;
              }
              function Li() {
                return go === null ? "" : OA(go);
              }
              function Fa() {
                Ts.getCurrentStack = null, go = null, G1 = !1;
              }
              function Sa(g) {
                Ts.getCurrentStack = Li, go = g, G1 = !1;
              }
              function Fn(g) {
                G1 = g;
              }
              function I6() {
                return G1;
              }
              function $i(g) {
                return "" + g;
              }
              function Ga(g) {
                switch (typeof g) {
                  case "boolean":
                  case "number":
                  case "object":
                  case "string":
                  case "undefined":
                    return g;
                  default:
                    return "";
                }
              }
              var e1 = {
                button: !0,
                checkbox: !0,
                image: !0,
                hidden: !0,
                radio: !0,
                reset: !0,
                submit: !0
              };
              function Lf(g, x) {
                e1[x.type] || x.onChange || x.onInput || x.readOnly || x.disabled || x.value == null || c("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."), x.onChange || x.readOnly || x.disabled || x.checked == null || c("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
              }
              function Ua(g) {
                var x = g.type, U = g.nodeName;
                return U && U.toLowerCase() === "input" && (x === "checkbox" || x === "radio");
              }
              function vs(g) {
                return g._valueTracker;
              }
              function R6(g) {
                g._valueTracker = null;
              }
              function Bf(g) {
                var x = "";
                return g && (Ua(g) ? x = g.checked ? "true" : "false" : x = g.value), x;
              }
              function Ie(g) {
                var x = Ua(g) ? "checked" : "value", U = Object.getOwnPropertyDescriptor(g.constructor.prototype, x), F = "" + g[x];
                if (!(g.hasOwnProperty(x) || typeof U > "u" || typeof U.get != "function" || typeof U.set != "function")) {
                  var K = U.get, oe = U.set;
                  Object.defineProperty(g, x, {
                    configurable: !0,
                    get: function() {
                      return K.call(this);
                    },
                    set: function(Te) {
                      F = "" + Te, oe.call(this, Te);
                    }
                  }), Object.defineProperty(g, x, {
                    enumerable: U.enumerable
                  });
                  var ce = {
                    getValue: function() {
                      return F;
                    },
                    setValue: function(Te) {
                      F = "" + Te;
                    },
                    stopTracking: function() {
                      R6(g), delete g[x];
                    }
                  };
                  return ce;
                }
              }
              function Pt(g) {
                vs(g) || (g._valueTracker = Ie(g));
              }
              function Et(g) {
                if (!g)
                  return !1;
                var x = vs(g);
                if (!x)
                  return !0;
                var U = x.getValue(), F = Bf(g);
                return F !== U ? (x.setValue(F), !0) : !1;
              }
              function er(g) {
                if (g = g || (typeof document < "u" ? document : void 0), typeof g > "u")
                  return null;
                try {
                  return g.activeElement || g.body;
                } catch {
                  return g.body;
                }
              }
              var _r = !1, Xi = !1, Mn = !1, _n = !1;
              function Ps(g) {
                var x = g.type === "checkbox" || g.type === "radio";
                return x ? g.checked != null : g.value != null;
              }
              function qi(g, x) {
                var U = g, F = x.checked, K = v({}, x, {
                  defaultChecked: void 0,
                  defaultValue: void 0,
                  value: void 0,
                  checked: F ?? U._wrapperState.initialChecked
                });
                return K;
              }
              function Gs(g, x) {
                Lf("input", x), x.checked !== void 0 && x.defaultChecked !== void 0 && !Xi && (c("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", z9() || "A component", x.type), Xi = !0), x.value !== void 0 && x.defaultValue !== void 0 && !_r && (c("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", z9() || "A component", x.type), _r = !0);
                var U = g, F = x.defaultValue == null ? "" : x.defaultValue;
                U._wrapperState = {
                  initialChecked: x.checked != null ? x.checked : x.defaultChecked,
                  initialValue: Ga(x.value != null ? x.value : F),
                  controlled: Ps(x)
                };
              }
              function ks(g, x) {
                var U = g, F = x.checked;
                F != null && Rr(U, "checked", F, !1);
              }
              function Na(g, x) {
                var U = g;
                {
                  var F = Ps(x);
                  !U._wrapperState.controlled && F && !_n && (c("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"), _n = !0), U._wrapperState.controlled && !F && !Mn && (c("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"), Mn = !0);
                }
                ks(g, x);
                var K = Ga(x.value), oe = x.type;
                if (K != null)
                  oe === "number" ? (K === 0 && U.value === "" || // We explicitly want to coerce to number here if possible.
                  // eslint-disable-next-line
                  U.value != K) && (U.value = $i(K)) : U.value !== $i(K) && (U.value = $i(K));
                else if (oe === "submit" || oe === "reset") {
                  U.removeAttribute("value");
                  return;
                }
                x.hasOwnProperty("value") ? W1(U, x.type, K) : x.hasOwnProperty("defaultValue") && W1(U, x.type, Ga(x.defaultValue)), x.checked == null && x.defaultChecked != null && (U.defaultChecked = !!x.defaultChecked);
              }
              function Ao(g, x, U) {
                var F = g;
                if (x.hasOwnProperty("value") || x.hasOwnProperty("defaultValue")) {
                  var K = x.type, oe = K === "submit" || K === "reset";
                  if (oe && (x.value === void 0 || x.value === null))
                    return;
                  var ce = $i(F._wrapperState.initialValue);
                  U || ce !== F.value && (F.value = ce), F.defaultValue = ce;
                }
                var Te = F.name;
                Te !== "" && (F.name = ""), F.defaultChecked = !F.defaultChecked, F.defaultChecked = !!F._wrapperState.initialChecked, Te !== "" && (F.name = Te);
              }
              function Ro(g, x) {
                var U = g;
                Na(U, x), oA(U, x);
              }
              function oA(g, x) {
                var U = x.name;
                if (x.type === "radio" && U != null) {
                  for (var F = g; F.parentNode; )
                    F = F.parentNode;
                  for (var K = F.querySelectorAll("input[name=" + JSON.stringify("" + U) + '][type="radio"]'), oe = 0; oe < K.length; oe++) {
                    var ce = K[oe];
                    if (!(ce === g || ce.form !== g.form)) {
                      var Te = lX(ce);
                      if (!Te)
                        throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
                      Et(ce), Na(ce, Te);
                    }
                  }
                }
              }
              function W1(g, x, U) {
                // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
                (x !== "number" || er(g.ownerDocument) !== g) && (U == null ? g.defaultValue = $i(g._wrapperState.initialValue) : g.defaultValue !== $i(U) && (g.defaultValue = $i(U)));
              }
              var je = !1, dt = !1;
              function kt(g) {
                var x = "";
                return d.Children.forEach(g, function(U) {
                  U != null && (x += U);
                }), x;
              }
              function _t(g, x) {
                typeof x.children == "object" && x.children !== null && d.Children.forEach(x.children, function(U) {
                  U != null && (typeof U == "string" || typeof U == "number" || typeof U.type == "string" && (dt || (dt = !0, c("Only strings and numbers are supported as <option> children."))));
                }), x.selected != null && !je && (c("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."), je = !0);
              }
              function Cr(g, x) {
                x.value != null && g.setAttribute("value", $i(Ga(x.value)));
              }
              function fi(g, x) {
                var U = v({
                  children: void 0
                }, x), F = kt(x.children);
                return F && (U.children = F), U;
              }
              var on;
              on = !1;
              function si() {
                var g = z9();
                return g ? `

Check the render method of \`` + g + "`." : "";
              }
              var ss = ["value", "defaultValue"];
              function hs(g) {
                {
                  Lf("select", g);
                  for (var x = 0; x < ss.length; x++) {
                    var U = ss[x];
                    if (g[U] != null) {
                      var F = Array.isArray(g[U]);
                      g.multiple && !F ? c("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", U, si()) : !g.multiple && F && c("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", U, si());
                    }
                  }
                }
              }
              function js(g, x, U, F) {
                var K = g.options;
                if (x) {
                  for (var oe = U, ce = {}, Te = 0; Te < oe.length; Te++)
                    ce["$" + oe[Te]] = !0;
                  for (var Ce = 0; Ce < K.length; Ce++) {
                    var tt = ce.hasOwnProperty("$" + K[Ce].value);
                    K[Ce].selected !== tt && (K[Ce].selected = tt), tt && F && (K[Ce].defaultSelected = !0);
                  }
                } else {
                  for (var ft = $i(Ga(U)), Rt = null, ct = 0; ct < K.length; ct++) {
                    if (K[ct].value === ft) {
                      K[ct].selected = !0, F && (K[ct].defaultSelected = !0);
                      return;
                    }
                    Rt === null && !K[ct].disabled && (Rt = K[ct]);
                  }
                  Rt !== null && (Rt.selected = !0);
                }
              }
              function ws(g, x) {
                return v({}, x, {
                  value: void 0
                });
              }
              function Zs(g, x) {
                var U = g;
                hs(x), U._wrapperState = {
                  wasMultiple: !!x.multiple
                }, x.value !== void 0 && x.defaultValue !== void 0 && !on && (c("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"), on = !0);
              }
              function Ia(g, x) {
                var U = g;
                U.multiple = !!x.multiple;
                var F = x.value;
                F != null ? js(U, !!x.multiple, F, !1) : x.defaultValue != null && js(U, !!x.multiple, x.defaultValue, !0);
              }
              function cs(g, x) {
                var U = g, F = U._wrapperState.wasMultiple;
                U._wrapperState.wasMultiple = !!x.multiple;
                var K = x.value;
                K != null ? js(U, !!x.multiple, K, !1) : F !== !!x.multiple && (x.defaultValue != null ? js(U, !!x.multiple, x.defaultValue, !0) : js(U, !!x.multiple, x.multiple ? [] : "", !1));
              }
              function ud(g, x) {
                var U = g, F = x.value;
                F != null && js(U, !!x.multiple, F, !1);
              }
              var Lv = !1;
              function Kv(g, x) {
                var U = g;
                if (x.dangerouslySetInnerHTML != null)
                  throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
                var F = v({}, x, {
                  value: void 0,
                  defaultValue: void 0,
                  children: $i(U._wrapperState.initialValue)
                });
                return F;
              }
              function $l(g, x) {
                var U = g;
                Lf("textarea", x), x.value !== void 0 && x.defaultValue !== void 0 && !Lv && (c("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", z9() || "A component"), Lv = !0);
                var F = x.value;
                if (F == null) {
                  var K = x.children, oe = x.defaultValue;
                  if (K != null) {
                    c("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
                    {
                      if (oe != null)
                        throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
                      if (Array.isArray(K)) {
                        if (!(K.length <= 1))
                          throw Error("<textarea> can only have at most one child.");
                        K = K[0];
                      }
                      oe = K;
                    }
                  }
                  oe == null && (oe = ""), F = oe;
                }
                U._wrapperState = {
                  initialValue: Ga(F)
                };
              }
              function V6(g, x) {
                var U = g, F = Ga(x.value), K = Ga(x.defaultValue);
                if (F != null) {
                  var oe = $i(F);
                  oe !== U.value && (U.value = oe), x.defaultValue == null && U.defaultValue !== oe && (U.defaultValue = oe);
                }
                K != null && (U.defaultValue = $i(K));
              }
              function ld(g, x) {
                var U = g, F = U.textContent;
                F === U._wrapperState.initialValue && F !== "" && F !== null && (U.value = F);
              }
              function Jv(g, x) {
                V6(g, x);
              }
              var zv = "http://www.w3.org/1999/xhtml", Wc = "http://www.w3.org/1998/Math/MathML", Sc = "http://www.w3.org/2000/svg", Gv = {
                html: zv,
                mathml: Wc,
                svg: Sc
              };
              function _d(g) {
                switch (g) {
                  case "svg":
                    return Sc;
                  case "math":
                    return Wc;
                  default:
                    return zv;
                }
              }
              function eP(g, x) {
                return g == null || g === zv ? _d(x) : g === Sc && x === "foreignObject" ? zv : g;
              }
              var J0 = function(g) {
                return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(x, U, F, K) {
                  MSApp.execUnsafeLocalFunction(function() {
                    return g(x, U, F, K);
                  });
                } : g;
              }, Nu, Uc = J0(function(g, x) {
                if (g.namespaceURI === Gv.svg && !("innerHTML" in g)) {
                  Nu = Nu || document.createElement("div"), Nu.innerHTML = "<svg>" + x.valueOf().toString() + "</svg>";
                  for (var U = Nu.firstChild; g.firstChild; )
                    g.removeChild(g.firstChild);
                  for (; U.firstChild; )
                    g.appendChild(U.firstChild);
                  return;
                }
                g.innerHTML = x;
              }), t1 = 1, Pd = 3, Z1 = 8, fA = 9, tP = 11, AA = function(g, x) {
                if (x) {
                  var U = g.firstChild;
                  if (U && U === g.lastChild && U.nodeType === Pd) {
                    U.nodeValue = x;
                    return;
                  }
                }
                g.textContent = x;
              }, rP = {
                animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
                background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
                backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
                border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
                borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
                borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
                borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
                borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
                borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
                borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
                borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
                borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
                borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
                borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
                borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
                borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
                borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
                columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
                columns: ["columnCount", "columnWidth"],
                flex: ["flexBasis", "flexGrow", "flexShrink"],
                flexFlow: ["flexDirection", "flexWrap"],
                font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
                fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
                gap: ["columnGap", "rowGap"],
                grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
                gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
                gridColumn: ["gridColumnEnd", "gridColumnStart"],
                gridColumnGap: ["columnGap"],
                gridGap: ["columnGap", "rowGap"],
                gridRow: ["gridRowEnd", "gridRowStart"],
                gridRowGap: ["rowGap"],
                gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
                listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
                margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
                marker: ["markerEnd", "markerMid", "markerStart"],
                mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
                maskPosition: ["maskPositionX", "maskPositionY"],
                outline: ["outlineColor", "outlineStyle", "outlineWidth"],
                overflow: ["overflowX", "overflowY"],
                padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
                placeContent: ["alignContent", "justifyContent"],
                placeItems: ["alignItems", "justifyItems"],
                placeSelf: ["alignSelf", "justifySelf"],
                textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
                textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
                transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
                wordWrap: ["overflowWrap"]
              }, Qu = {
                animationIterationCount: !0,
                borderImageOutset: !0,
                borderImageSlice: !0,
                borderImageWidth: !0,
                boxFlex: !0,
                boxFlexGroup: !0,
                boxOrdinalGroup: !0,
                columnCount: !0,
                columns: !0,
                flex: !0,
                flexGrow: !0,
                flexPositive: !0,
                flexShrink: !0,
                flexNegative: !0,
                flexOrder: !0,
                gridArea: !0,
                gridRow: !0,
                gridRowEnd: !0,
                gridRowSpan: !0,
                gridRowStart: !0,
                gridColumn: !0,
                gridColumnEnd: !0,
                gridColumnSpan: !0,
                gridColumnStart: !0,
                fontWeight: !0,
                lineClamp: !0,
                lineHeight: !0,
                opacity: !0,
                order: !0,
                orphans: !0,
                tabSize: !0,
                widows: !0,
                zIndex: !0,
                zoom: !0,
                // SVG-related properties
                fillOpacity: !0,
                floodOpacity: !0,
                stopOpacity: !0,
                strokeDasharray: !0,
                strokeDashoffset: !0,
                strokeMiterlimit: !0,
                strokeOpacity: !0,
                strokeWidth: !0
              };
              function Kf(g, x) {
                return g + x.charAt(0).toUpperCase() + x.substring(1);
              }
              var cd = ["Webkit", "ms", "Moz", "O"];
              Object.keys(Qu).forEach(function(g) {
                cd.forEach(function(x) {
                  Qu[Kf(x, g)] = Qu[g];
                });
              });
              function Xo(g, x, U) {
                var F = x == null || typeof x == "boolean" || x === "";
                return F ? "" : !U && typeof x == "number" && x !== 0 && !(Qu.hasOwnProperty(g) && Qu[g]) ? x + "px" : ("" + x).trim();
              }
              var C6 = /([A-Z])/g, Zv = /^ms-/;
              function nP(g) {
                return g.replace(C6, "-$1").toLowerCase().replace(Zv, "-ms-");
              }
              var mp = function() {
              };
              {
                var $d = /^(?:webkit|moz|o)[A-Z]/, z0 = /^-ms-/, Ic = /-(.)/g, iP = /;\s*$/, dA = {}, Rc = {}, G0 = !1, Vc = !1, Z0 = function(g) {
                  return g.replace(Ic, function(x, U) {
                    return U.toUpperCase();
                  });
                }, Cc = function(g) {
                  dA.hasOwnProperty(g) && dA[g] || (dA[g] = !0, c(
                    "Unsupported style property %s. Did you mean %s?",
                    g,
                    // As Andi Smith suggests
                    // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
                    // is converted to lowercase `ms`.
                    Z0(g.replace(z0, "ms-"))
                  ));
                }, sP = function(g) {
                  dA.hasOwnProperty(g) && dA[g] || (dA[g] = !0, c("Unsupported vendor-prefixed style property %s. Did you mean %s?", g, g.charAt(0).toUpperCase() + g.slice(1)));
                }, ev = function(g, x) {
                  Rc.hasOwnProperty(x) && Rc[x] || (Rc[x] = !0, c(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, g, x.replace(iP, "")));
                }, tv = function(g, x) {
                  G0 || (G0 = !0, c("`NaN` is an invalid value for the `%s` css style property.", g));
                }, Yu = function(g, x) {
                  Vc || (Vc = !0, c("`Infinity` is an invalid value for the `%s` css style property.", g));
                };
                mp = function(g, x) {
                  g.indexOf("-") > -1 ? Cc(g) : $d.test(g) ? sP(g) : iP.test(x) && ev(g, x), typeof x == "number" && (isNaN(x) ? tv(g, x) : isFinite(x) || Yu(g, x));
                };
              }
              var Bp = mp;
              function Wp(g) {
                {
                  var x = "", U = "";
                  for (var F in g)
                    if (g.hasOwnProperty(F)) {
                      var K = g[F];
                      if (K != null) {
                        var oe = F.indexOf("--") === 0;
                        x += U + (oe ? F : nP(F)) + ":", x += Xo(F, K, oe), U = ";";
                      }
                    }
                  return x || null;
                }
              }
              function aP(g, x) {
                var U = g.style;
                for (var F in x)
                  if (x.hasOwnProperty(F)) {
                    var K = F.indexOf("--") === 0;
                    K || Bp(F, x[F]);
                    var oe = Xo(F, x[F], K);
                    F === "float" && (F = "cssFloat"), K ? U.setProperty(F, oe) : U[F] = oe;
                  }
              }
              function Sp(g) {
                return g == null || typeof g == "boolean" || g === "";
              }
              function Up(g) {
                var x = {};
                for (var U in g)
                  for (var F = rP[U] || [U], K = 0; K < F.length; K++)
                    x[F[K]] = U;
                return x;
              }
              function Ip(g, x) {
                {
                  if (!x)
                    return;
                  var U = Up(g), F = Up(x), K = {};
                  for (var oe in U) {
                    var ce = U[oe], Te = F[oe];
                    if (Te && ce !== Te) {
                      var Ce = ce + "," + Te;
                      if (K[Ce])
                        continue;
                      K[Ce] = !0, c("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", Sp(g[ce]) ? "Removing" : "Updating", ce, Te);
                    }
                  }
                }
              }
              var _0 = {
                area: !0,
                base: !0,
                br: !0,
                col: !0,
                embed: !0,
                hr: !0,
                img: !0,
                input: !0,
                keygen: !0,
                link: !0,
                meta: !0,
                param: !0,
                source: !0,
                track: !0,
                wbr: !0
                // NOTE: menuitem's close tag should be omitted, but that causes problems.
              }, gg = v({
                menuitem: !0
              }, _0), $0 = "__html";
              function Rp(g, x) {
                if (x) {
                  if (gg[g] && !(x.children == null && x.dangerouslySetInnerHTML == null))
                    throw Error(g + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
                  if (x.dangerouslySetInnerHTML != null) {
                    if (x.children != null)
                      throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
                    if (!(typeof x.dangerouslySetInnerHTML == "object" && $0 in x.dangerouslySetInnerHTML))
                      throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
                  }
                  if (!x.suppressContentEditableWarning && x.contentEditable && x.children != null && c("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."), !(x.style == null || typeof x.style == "object"))
                    throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
                }
              }
              function rv(g, x) {
                if (g.indexOf("-") === -1)
                  return typeof x.is == "string";
                switch (g) {
                  case "annotation-xml":
                  case "color-profile":
                  case "font-face":
                  case "font-face-src":
                  case "font-face-uri":
                  case "font-face-format":
                  case "font-face-name":
                  case "missing-glyph":
                    return !1;
                  default:
                    return !0;
                }
              }
              var Oc = {
                // HTML
                accept: "accept",
                acceptcharset: "acceptCharset",
                "accept-charset": "acceptCharset",
                accesskey: "accessKey",
                action: "action",
                allowfullscreen: "allowFullScreen",
                alt: "alt",
                as: "as",
                async: "async",
                autocapitalize: "autoCapitalize",
                autocomplete: "autoComplete",
                autocorrect: "autoCorrect",
                autofocus: "autoFocus",
                autoplay: "autoPlay",
                autosave: "autoSave",
                capture: "capture",
                cellpadding: "cellPadding",
                cellspacing: "cellSpacing",
                challenge: "challenge",
                charset: "charSet",
                checked: "checked",
                children: "children",
                cite: "cite",
                class: "className",
                classid: "classID",
                classname: "className",
                cols: "cols",
                colspan: "colSpan",
                content: "content",
                contenteditable: "contentEditable",
                contextmenu: "contextMenu",
                controls: "controls",
                controlslist: "controlsList",
                coords: "coords",
                crossorigin: "crossOrigin",
                dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
                data: "data",
                datetime: "dateTime",
                default: "default",
                defaultchecked: "defaultChecked",
                defaultvalue: "defaultValue",
                defer: "defer",
                dir: "dir",
                disabled: "disabled",
                disablepictureinpicture: "disablePictureInPicture",
                disableremoteplayback: "disableRemotePlayback",
                download: "download",
                draggable: "draggable",
                enctype: "encType",
                enterkeyhint: "enterKeyHint",
                for: "htmlFor",
                form: "form",
                formmethod: "formMethod",
                formaction: "formAction",
                formenctype: "formEncType",
                formnovalidate: "formNoValidate",
                formtarget: "formTarget",
                frameborder: "frameBorder",
                headers: "headers",
                height: "height",
                hidden: "hidden",
                high: "high",
                href: "href",
                hreflang: "hrefLang",
                htmlfor: "htmlFor",
                httpequiv: "httpEquiv",
                "http-equiv": "httpEquiv",
                icon: "icon",
                id: "id",
                innerhtml: "innerHTML",
                inputmode: "inputMode",
                integrity: "integrity",
                is: "is",
                itemid: "itemID",
                itemprop: "itemProp",
                itemref: "itemRef",
                itemscope: "itemScope",
                itemtype: "itemType",
                keyparams: "keyParams",
                keytype: "keyType",
                kind: "kind",
                label: "label",
                lang: "lang",
                list: "list",
                loop: "loop",
                low: "low",
                manifest: "manifest",
                marginwidth: "marginWidth",
                marginheight: "marginHeight",
                max: "max",
                maxlength: "maxLength",
                media: "media",
                mediagroup: "mediaGroup",
                method: "method",
                min: "min",
                minlength: "minLength",
                multiple: "multiple",
                muted: "muted",
                name: "name",
                nomodule: "noModule",
                nonce: "nonce",
                novalidate: "noValidate",
                open: "open",
                optimum: "optimum",
                pattern: "pattern",
                placeholder: "placeholder",
                playsinline: "playsInline",
                poster: "poster",
                preload: "preload",
                profile: "profile",
                radiogroup: "radioGroup",
                readonly: "readOnly",
                referrerpolicy: "referrerPolicy",
                rel: "rel",
                required: "required",
                reversed: "reversed",
                role: "role",
                rows: "rows",
                rowspan: "rowSpan",
                sandbox: "sandbox",
                scope: "scope",
                scoped: "scoped",
                scrolling: "scrolling",
                seamless: "seamless",
                selected: "selected",
                shape: "shape",
                size: "size",
                sizes: "sizes",
                span: "span",
                spellcheck: "spellCheck",
                src: "src",
                srcdoc: "srcDoc",
                srclang: "srcLang",
                srcset: "srcSet",
                start: "start",
                step: "step",
                style: "style",
                summary: "summary",
                tabindex: "tabIndex",
                target: "target",
                title: "title",
                type: "type",
                usemap: "useMap",
                value: "value",
                width: "width",
                wmode: "wmode",
                wrap: "wrap",
                // SVG
                about: "about",
                accentheight: "accentHeight",
                "accent-height": "accentHeight",
                accumulate: "accumulate",
                additive: "additive",
                alignmentbaseline: "alignmentBaseline",
                "alignment-baseline": "alignmentBaseline",
                allowreorder: "allowReorder",
                alphabetic: "alphabetic",
                amplitude: "amplitude",
                arabicform: "arabicForm",
                "arabic-form": "arabicForm",
                ascent: "ascent",
                attributename: "attributeName",
                attributetype: "attributeType",
                autoreverse: "autoReverse",
                azimuth: "azimuth",
                basefrequency: "baseFrequency",
                baselineshift: "baselineShift",
                "baseline-shift": "baselineShift",
                baseprofile: "baseProfile",
                bbox: "bbox",
                begin: "begin",
                bias: "bias",
                by: "by",
                calcmode: "calcMode",
                capheight: "capHeight",
                "cap-height": "capHeight",
                clip: "clip",
                clippath: "clipPath",
                "clip-path": "clipPath",
                clippathunits: "clipPathUnits",
                cliprule: "clipRule",
                "clip-rule": "clipRule",
                color: "color",
                colorinterpolation: "colorInterpolation",
                "color-interpolation": "colorInterpolation",
                colorinterpolationfilters: "colorInterpolationFilters",
                "color-interpolation-filters": "colorInterpolationFilters",
                colorprofile: "colorProfile",
                "color-profile": "colorProfile",
                colorrendering: "colorRendering",
                "color-rendering": "colorRendering",
                contentscripttype: "contentScriptType",
                contentstyletype: "contentStyleType",
                cursor: "cursor",
                cx: "cx",
                cy: "cy",
                d: "d",
                datatype: "datatype",
                decelerate: "decelerate",
                descent: "descent",
                diffuseconstant: "diffuseConstant",
                direction: "direction",
                display: "display",
                divisor: "divisor",
                dominantbaseline: "dominantBaseline",
                "dominant-baseline": "dominantBaseline",
                dur: "dur",
                dx: "dx",
                dy: "dy",
                edgemode: "edgeMode",
                elevation: "elevation",
                enablebackground: "enableBackground",
                "enable-background": "enableBackground",
                end: "end",
                exponent: "exponent",
                externalresourcesrequired: "externalResourcesRequired",
                fill: "fill",
                fillopacity: "fillOpacity",
                "fill-opacity": "fillOpacity",
                fillrule: "fillRule",
                "fill-rule": "fillRule",
                filter: "filter",
                filterres: "filterRes",
                filterunits: "filterUnits",
                floodopacity: "floodOpacity",
                "flood-opacity": "floodOpacity",
                floodcolor: "floodColor",
                "flood-color": "floodColor",
                focusable: "focusable",
                fontfamily: "fontFamily",
                "font-family": "fontFamily",
                fontsize: "fontSize",
                "font-size": "fontSize",
                fontsizeadjust: "fontSizeAdjust",
                "font-size-adjust": "fontSizeAdjust",
                fontstretch: "fontStretch",
                "font-stretch": "fontStretch",
                fontstyle: "fontStyle",
                "font-style": "fontStyle",
                fontvariant: "fontVariant",
                "font-variant": "fontVariant",
                fontweight: "fontWeight",
                "font-weight": "fontWeight",
                format: "format",
                from: "from",
                fx: "fx",
                fy: "fy",
                g1: "g1",
                g2: "g2",
                glyphname: "glyphName",
                "glyph-name": "glyphName",
                glyphorientationhorizontal: "glyphOrientationHorizontal",
                "glyph-orientation-horizontal": "glyphOrientationHorizontal",
                glyphorientationvertical: "glyphOrientationVertical",
                "glyph-orientation-vertical": "glyphOrientationVertical",
                glyphref: "glyphRef",
                gradienttransform: "gradientTransform",
                gradientunits: "gradientUnits",
                hanging: "hanging",
                horizadvx: "horizAdvX",
                "horiz-adv-x": "horizAdvX",
                horizoriginx: "horizOriginX",
                "horiz-origin-x": "horizOriginX",
                ideographic: "ideographic",
                imagerendering: "imageRendering",
                "image-rendering": "imageRendering",
                in2: "in2",
                in: "in",
                inlist: "inlist",
                intercept: "intercept",
                k1: "k1",
                k2: "k2",
                k3: "k3",
                k4: "k4",
                k: "k",
                kernelmatrix: "kernelMatrix",
                kernelunitlength: "kernelUnitLength",
                kerning: "kerning",
                keypoints: "keyPoints",
                keysplines: "keySplines",
                keytimes: "keyTimes",
                lengthadjust: "lengthAdjust",
                letterspacing: "letterSpacing",
                "letter-spacing": "letterSpacing",
                lightingcolor: "lightingColor",
                "lighting-color": "lightingColor",
                limitingconeangle: "limitingConeAngle",
                local: "local",
                markerend: "markerEnd",
                "marker-end": "markerEnd",
                markerheight: "markerHeight",
                markermid: "markerMid",
                "marker-mid": "markerMid",
                markerstart: "markerStart",
                "marker-start": "markerStart",
                markerunits: "markerUnits",
                markerwidth: "markerWidth",
                mask: "mask",
                maskcontentunits: "maskContentUnits",
                maskunits: "maskUnits",
                mathematical: "mathematical",
                mode: "mode",
                numoctaves: "numOctaves",
                offset: "offset",
                opacity: "opacity",
                operator: "operator",
                order: "order",
                orient: "orient",
                orientation: "orientation",
                origin: "origin",
                overflow: "overflow",
                overlineposition: "overlinePosition",
                "overline-position": "overlinePosition",
                overlinethickness: "overlineThickness",
                "overline-thickness": "overlineThickness",
                paintorder: "paintOrder",
                "paint-order": "paintOrder",
                panose1: "panose1",
                "panose-1": "panose1",
                pathlength: "pathLength",
                patterncontentunits: "patternContentUnits",
                patterntransform: "patternTransform",
                patternunits: "patternUnits",
                pointerevents: "pointerEvents",
                "pointer-events": "pointerEvents",
                points: "points",
                pointsatx: "pointsAtX",
                pointsaty: "pointsAtY",
                pointsatz: "pointsAtZ",
                prefix: "prefix",
                preservealpha: "preserveAlpha",
                preserveaspectratio: "preserveAspectRatio",
                primitiveunits: "primitiveUnits",
                property: "property",
                r: "r",
                radius: "radius",
                refx: "refX",
                refy: "refY",
                renderingintent: "renderingIntent",
                "rendering-intent": "renderingIntent",
                repeatcount: "repeatCount",
                repeatdur: "repeatDur",
                requiredextensions: "requiredExtensions",
                requiredfeatures: "requiredFeatures",
                resource: "resource",
                restart: "restart",
                result: "result",
                results: "results",
                rotate: "rotate",
                rx: "rx",
                ry: "ry",
                scale: "scale",
                security: "security",
                seed: "seed",
                shaperendering: "shapeRendering",
                "shape-rendering": "shapeRendering",
                slope: "slope",
                spacing: "spacing",
                specularconstant: "specularConstant",
                specularexponent: "specularExponent",
                speed: "speed",
                spreadmethod: "spreadMethod",
                startoffset: "startOffset",
                stddeviation: "stdDeviation",
                stemh: "stemh",
                stemv: "stemv",
                stitchtiles: "stitchTiles",
                stopcolor: "stopColor",
                "stop-color": "stopColor",
                stopopacity: "stopOpacity",
                "stop-opacity": "stopOpacity",
                strikethroughposition: "strikethroughPosition",
                "strikethrough-position": "strikethroughPosition",
                strikethroughthickness: "strikethroughThickness",
                "strikethrough-thickness": "strikethroughThickness",
                string: "string",
                stroke: "stroke",
                strokedasharray: "strokeDasharray",
                "stroke-dasharray": "strokeDasharray",
                strokedashoffset: "strokeDashoffset",
                "stroke-dashoffset": "strokeDashoffset",
                strokelinecap: "strokeLinecap",
                "stroke-linecap": "strokeLinecap",
                strokelinejoin: "strokeLinejoin",
                "stroke-linejoin": "strokeLinejoin",
                strokemiterlimit: "strokeMiterlimit",
                "stroke-miterlimit": "strokeMiterlimit",
                strokewidth: "strokeWidth",
                "stroke-width": "strokeWidth",
                strokeopacity: "strokeOpacity",
                "stroke-opacity": "strokeOpacity",
                suppresscontenteditablewarning: "suppressContentEditableWarning",
                suppresshydrationwarning: "suppressHydrationWarning",
                surfacescale: "surfaceScale",
                systemlanguage: "systemLanguage",
                tablevalues: "tableValues",
                targetx: "targetX",
                targety: "targetY",
                textanchor: "textAnchor",
                "text-anchor": "textAnchor",
                textdecoration: "textDecoration",
                "text-decoration": "textDecoration",
                textlength: "textLength",
                textrendering: "textRendering",
                "text-rendering": "textRendering",
                to: "to",
                transform: "transform",
                typeof: "typeof",
                u1: "u1",
                u2: "u2",
                underlineposition: "underlinePosition",
                "underline-position": "underlinePosition",
                underlinethickness: "underlineThickness",
                "underline-thickness": "underlineThickness",
                unicode: "unicode",
                unicodebidi: "unicodeBidi",
                "unicode-bidi": "unicodeBidi",
                unicoderange: "unicodeRange",
                "unicode-range": "unicodeRange",
                unitsperem: "unitsPerEm",
                "units-per-em": "unitsPerEm",
                unselectable: "unselectable",
                valphabetic: "vAlphabetic",
                "v-alphabetic": "vAlphabetic",
                values: "values",
                vectoreffect: "vectorEffect",
                "vector-effect": "vectorEffect",
                version: "version",
                vertadvy: "vertAdvY",
                "vert-adv-y": "vertAdvY",
                vertoriginx: "vertOriginX",
                "vert-origin-x": "vertOriginX",
                vertoriginy: "vertOriginY",
                "vert-origin-y": "vertOriginY",
                vhanging: "vHanging",
                "v-hanging": "vHanging",
                videographic: "vIdeographic",
                "v-ideographic": "vIdeographic",
                viewbox: "viewBox",
                viewtarget: "viewTarget",
                visibility: "visibility",
                vmathematical: "vMathematical",
                "v-mathematical": "vMathematical",
                vocab: "vocab",
                widths: "widths",
                wordspacing: "wordSpacing",
                "word-spacing": "wordSpacing",
                writingmode: "writingMode",
                "writing-mode": "writingMode",
                x1: "x1",
                x2: "x2",
                x: "x",
                xchannelselector: "xChannelSelector",
                xheight: "xHeight",
                "x-height": "xHeight",
                xlinkactuate: "xlinkActuate",
                "xlink:actuate": "xlinkActuate",
                xlinkarcrole: "xlinkArcrole",
                "xlink:arcrole": "xlinkArcrole",
                xlinkhref: "xlinkHref",
                "xlink:href": "xlinkHref",
                xlinkrole: "xlinkRole",
                "xlink:role": "xlinkRole",
                xlinkshow: "xlinkShow",
                "xlink:show": "xlinkShow",
                xlinktitle: "xlinkTitle",
                "xlink:title": "xlinkTitle",
                xlinktype: "xlinkType",
                "xlink:type": "xlinkType",
                xmlbase: "xmlBase",
                "xml:base": "xmlBase",
                xmllang: "xmlLang",
                "xml:lang": "xmlLang",
                xmlns: "xmlns",
                "xml:space": "xmlSpace",
                xmlnsxlink: "xmlnsXlink",
                "xmlns:xlink": "xmlnsXlink",
                xmlspace: "xmlSpace",
                y1: "y1",
                y2: "y2",
                y: "y",
                ychannelselector: "yChannelSelector",
                z: "z",
                zoomandpan: "zoomAndPan"
              }, G9 = {
                "aria-current": 0,
                // state
                "aria-details": 0,
                "aria-disabled": 0,
                // state
                "aria-hidden": 0,
                // state
                "aria-invalid": 0,
                // state
                "aria-keyshortcuts": 0,
                "aria-label": 0,
                "aria-roledescription": 0,
                // Widget Attributes
                "aria-autocomplete": 0,
                "aria-checked": 0,
                "aria-expanded": 0,
                "aria-haspopup": 0,
                "aria-level": 0,
                "aria-modal": 0,
                "aria-multiline": 0,
                "aria-multiselectable": 0,
                "aria-orientation": 0,
                "aria-placeholder": 0,
                "aria-pressed": 0,
                "aria-readonly": 0,
                "aria-required": 0,
                "aria-selected": 0,
                "aria-sort": 0,
                "aria-valuemax": 0,
                "aria-valuemin": 0,
                "aria-valuenow": 0,
                "aria-valuetext": 0,
                // Live Region Attributes
                "aria-atomic": 0,
                "aria-busy": 0,
                "aria-live": 0,
                "aria-relevant": 0,
                // Drag-and-Drop Attributes
                "aria-dropeffect": 0,
                "aria-grabbed": 0,
                // Relationship Attributes
                "aria-activedescendant": 0,
                "aria-colcount": 0,
                "aria-colindex": 0,
                "aria-colspan": 0,
                "aria-controls": 0,
                "aria-describedby": 0,
                "aria-errormessage": 0,
                "aria-flowto": 0,
                "aria-labelledby": 0,
                "aria-owns": 0,
                "aria-posinset": 0,
                "aria-rowcount": 0,
                "aria-rowindex": 0,
                "aria-rowspan": 0,
                "aria-setsize": 0
              }, yA = {}, e7 = new RegExp("^(aria)-[" + br + "]*$"), Be = new RegExp("^(aria)[A-Z][" + br + "]*$"), Qe = Object.prototype.hasOwnProperty;
              function ze(g, x) {
                {
                  if (Qe.call(yA, x) && yA[x])
                    return !0;
                  if (Be.test(x)) {
                    var U = "aria-" + x.slice(4).toLowerCase(), F = G9.hasOwnProperty(U) ? U : null;
                    if (F == null)
                      return c("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", x), yA[x] = !0, !0;
                    if (x !== F)
                      return c("Invalid ARIA attribute `%s`. Did you mean `%s`?", x, F), yA[x] = !0, !0;
                  }
                  if (e7.test(x)) {
                    var K = x.toLowerCase(), oe = G9.hasOwnProperty(K) ? K : null;
                    if (oe == null)
                      return yA[x] = !0, !1;
                    if (x !== oe)
                      return c("Unknown ARIA attribute `%s`. Did you mean `%s`?", x, oe), yA[x] = !0, !0;
                  }
                }
                return !0;
              }
              function rt(g, x) {
                {
                  var U = [];
                  for (var F in x) {
                    var K = ze(g, F);
                    K || U.push(F);
                  }
                  var oe = U.map(function(ce) {
                    return "`" + ce + "`";
                  }).join(", ");
                  U.length === 1 ? c("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", oe, g) : U.length > 1 && c("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", oe, g);
                }
              }
              function vt(g, x) {
                rv(g, x) || rt(g, x);
              }
              var yt = !1;
              function Bt(g, x) {
                {
                  if (g !== "input" && g !== "textarea" && g !== "select")
                    return;
                  x != null && x.value === null && !yt && (yt = !0, g === "select" && x.multiple ? c("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", g) : c("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", g));
                }
              }
              var ar = function() {
              };
              {
                var Pr = {}, Sn = Object.prototype.hasOwnProperty, cn = /^on./, Gn = /^on[^A-Z]/, es = new RegExp("^(aria)-[" + br + "]*$"), Ys = new RegExp("^(aria)[A-Z][" + br + "]*$");
                ar = function(g, x, U, F) {
                  if (Sn.call(Pr, x) && Pr[x])
                    return !0;
                  var K = x.toLowerCase();
                  if (K === "onfocusin" || K === "onfocusout")
                    return c("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."), Pr[x] = !0, !0;
                  if (F != null) {
                    var oe = F.registrationNameDependencies, ce = F.possibleRegistrationNames;
                    if (oe.hasOwnProperty(x))
                      return !0;
                    var Te = ce.hasOwnProperty(K) ? ce[K] : null;
                    if (Te != null)
                      return c("Invalid event handler property `%s`. Did you mean `%s`?", x, Te), Pr[x] = !0, !0;
                    if (cn.test(x))
                      return c("Unknown event handler property `%s`. It will be ignored.", x), Pr[x] = !0, !0;
                  } else if (cn.test(x))
                    return Gn.test(x) && c("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", x), Pr[x] = !0, !0;
                  if (es.test(x) || Ys.test(x))
                    return !0;
                  if (K === "innerhtml")
                    return c("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."), Pr[x] = !0, !0;
                  if (K === "aria")
                    return c("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."), Pr[x] = !0, !0;
                  if (K === "is" && U !== null && U !== void 0 && typeof U != "string")
                    return c("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof U), Pr[x] = !0, !0;
                  if (typeof U == "number" && isNaN(U))
                    return c("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", x), Pr[x] = !0, !0;
                  var Ce = sn(x), tt = Ce !== null && Ce.type === nt;
                  if (Oc.hasOwnProperty(K)) {
                    var ft = Oc[K];
                    if (ft !== x)
                      return c("Invalid DOM property `%s`. Did you mean `%s`?", x, ft), Pr[x] = !0, !0;
                  } else if (!tt && x !== K)
                    return c("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", x, K), Pr[x] = !0, !0;
                  return typeof U == "boolean" && Br(x, U, Ce, !1) ? (U ? c('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', U, x, x, U, x) : c('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', U, x, x, U, x, x, x), Pr[x] = !0, !0) : tt ? !0 : Br(x, U, Ce, !1) ? (Pr[x] = !0, !1) : ((U === "false" || U === "true") && Ce !== null && Ce.type === wt && (c("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", U, x, U === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', x, U), Pr[x] = !0), !0);
                };
              }
              var S1 = function(g, x, U) {
                {
                  var F = [];
                  for (var K in x) {
                    var oe = ar(g, K, x[K], U);
                    oe || F.push(K);
                  }
                  var ce = F.map(function(Te) {
                    return "`" + Te + "`";
                  }).join(", ");
                  F.length === 1 ? c("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", ce, g) : F.length > 1 && c("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", ce, g);
                }
              };
              function ia(g, x, U) {
                rv(g, x) || S1(g, x, U);
              }
              var x9 = 1, Jf = 2, Vo = 4, U1 = 16, vA = x9 | Jf | Vo;
              function Wf(g) {
                var x = g.target || g.srcElement || window;
                return x.correspondingUseElement && (x = x.correspondingUseElement), x.nodeType === Pd ? x.parentNode : x;
              }
              var _1 = null, $1 = null, D9 = null;
              function kA(g) {
                var x = xd(g);
                if (x) {
                  if (typeof _1 != "function")
                    throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
                  var U = x.stateNode;
                  if (U) {
                    var F = lX(U);
                    _1(x.stateNode, x.type, F);
                  }
                }
              }
              function oP(g) {
                _1 = g;
              }
              function yc(g) {
                $1 ? D9 ? D9.push(g) : D9 = [g] : $1 = g;
              }
              function Bq() {
                return $1 !== null || D9 !== null;
              }
              function Xg() {
                if ($1) {
                  var g = $1, x = D9;
                  if ($1 = null, D9 = null, kA(g), x)
                    for (var U = 0; U < x.length; U++)
                      kA(x[U]);
                }
              }
              var kc = function(g, x) {
                return g(x);
              }, Pa = function(g, x, U, F, K) {
                return g(x, U, F, K);
              }, nv = function() {
              }, iv = kc, O6 = !1, t7 = !1;
              function Ec() {
                var g = Bq();
                g && (nv(), Xg());
              }
              function Vp(g, x) {
                if (O6)
                  return g(x);
                O6 = !0;
                try {
                  return kc(g, x);
                } finally {
                  O6 = !1, Ec();
                }
              }
              function Fc(g, x, U) {
                if (t7)
                  return g(x, U);
                t7 = !0;
                try {
                  return iv(g, x, U);
                } finally {
                  t7 = !1, Ec();
                }
              }
              function fP(g, x, U, F, K) {
                var oe = O6;
                O6 = !0;
                try {
                  return Pa(g, x, U, F, K);
                } finally {
                  O6 = oe, O6 || Ec();
                }
              }
              function r7(g) {
                O6 || nv();
              }
              function Tg(g, x, U, F) {
                kc = g, Pa = x, nv = U, iv = F;
              }
              function Wq(g) {
                return g === "button" || g === "input" || g === "select" || g === "textarea";
              }
              function qg(g, x, U) {
                switch (g) {
                  case "onClick":
                  case "onClickCapture":
                  case "onDoubleClick":
                  case "onDoubleClickCapture":
                  case "onMouseDown":
                  case "onMouseDownCapture":
                  case "onMouseMove":
                  case "onMouseMoveCapture":
                  case "onMouseUp":
                  case "onMouseUpCapture":
                  case "onMouseEnter":
                    return !!(U.disabled && Wq(x));
                  default:
                    return !1;
                }
              }
              function Mu(g, x) {
                var U = g.stateNode;
                if (U === null)
                  return null;
                var F = lX(U);
                if (F === null)
                  return null;
                var K = F[x];
                if (qg(x, g.type, F))
                  return null;
                if (!(!K || typeof K == "function"))
                  throw Error("Expected `" + x + "` listener to be a function, instead got a value of `" + typeof K + "` type.");
                return K;
              }
              var Nc = !1;
              if (Ke)
                try {
                  var Lu = {};
                  Object.defineProperty(Lu, "passive", {
                    get: function() {
                      Nc = !0;
                    }
                  }), window.addEventListener("test", Lu, Lu), window.removeEventListener("test", Lu, Lu);
                } catch {
                  Nc = !1;
                }
              function Ku(g, x, U, F, K, oe, ce, Te, Ce) {
                var tt = Array.prototype.slice.call(arguments, 3);
                try {
                  x.apply(U, tt);
                } catch (ft) {
                  this.onError(ft);
                }
              }
              var Qc = Ku;
              if (typeof window < "u" && typeof window.dispatchEvent == "function" && typeof document < "u" && typeof document.createEvent == "function") {
                var sv = document.createElement("react");
                Qc = function(x, U, F, K, oe, ce, Te, Ce, tt) {
                  if (!(typeof document < "u"))
                    throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
                  var ft = document.createEvent("Event"), Rt = !1, ct = !0, Ft = window.event, wr = Object.getOwnPropertyDescriptor(window, "event");
                  function Yr() {
                    sv.removeEventListener(dr, os, !1), typeof window.event < "u" && window.hasOwnProperty("event") && (window.event = Ft);
                  }
                  var Si = Array.prototype.slice.call(arguments, 3);
                  function os() {
                    Rt = !0, Yr(), U.apply(F, Si), ct = !1;
                  }
                  var Ci, ea = !1, to = !1;
                  function Nt(ht) {
                    if (Ci = ht.error, ea = !0, Ci === null && ht.colno === 0 && ht.lineno === 0 && (to = !0), ht.defaultPrevented && Ci != null && typeof Ci == "object")
                      try {
                        Ci._suppressLogging = !0;
                      } catch {
                      }
                  }
                  var dr = "react-" + (x || "invokeguardedcallback");
                  if (window.addEventListener("error", Nt), sv.addEventListener(dr, os, !1), ft.initEvent(dr, !1, !1), sv.dispatchEvent(ft), wr && Object.defineProperty(window, "event", wr), Rt && ct && (ea ? to && (Ci = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")) : Ci = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`), this.onError(Ci)), window.removeEventListener("error", Nt), !Rt)
                    return Yr(), Ku.apply(this, arguments);
                };
              }
              var p4 = Qc, Ju = !1, AP = null, n7 = !1, av = null, pd = {
                onError: function(g) {
                  Ju = !0, AP = g;
                }
              };
              function Z9(g, x, U, F, K, oe, ce, Te, Ce) {
                Ju = !1, AP = null, p4.apply(pd, arguments);
              }
              function zu(g, x, U, F, K, oe, ce, Te, Ce) {
                if (Z9.apply(this, arguments), Ju) {
                  var tt = Sf();
                  n7 || (n7 = !0, av = tt);
                }
              }
              function EA() {
                if (n7) {
                  var g = av;
                  throw n7 = !1, av = null, g;
                }
              }
              function _9() {
                return Ju;
              }
              function Sf() {
                if (Ju) {
                  var g = AP;
                  return Ju = !1, AP = null, g;
                } else
                  throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
              }
              function Gu(g) {
                return g._reactInternals;
              }
              function Sq(g) {
                return g._reactInternals !== void 0;
              }
              function bg(g, x) {
                g._reactInternals = x;
              }
              var Es = (
                /*                      */
                0
              ), FA = (
                /*                */
                1
              ), Qa = (
                /*                    */
                2
              ), fn = (
                /*                       */
                4
              ), Zu = (
                /*           */
                6
              ), Ms = (
                /*                     */
                8
              ), Ni = (
                /*                 */
                16
              ), _s = (
                /*                     */
                32
              ), bi = (
                /*                   */
                64
              ), uA = (
                /*                          */
                128
              ), xi = (
                /*                     */
                256
              ), Ya = (
                /*                      */
                512
              ), Uf = (
                /*     */
                8192
              ), I1 = (
                /*                    */
                1024
              ), vo = (
                /*           */
                1028
              ), NA = (
                /*          */
                932
              ), _u = (
                /*               */
                2047
              ), ov = (
                /*                   */
                2048
              ), QA = (
                /*                */
                4096
              ), dP = (
                /* */
                16384
              ), lA = P.ReactCurrentOwner;
              function To(g) {
                var x = g, U = g;
                if (g.alternate)
                  for (; x.return; )
                    x = x.return;
                else {
                  var F = x;
                  do
                    x = F, (x.flags & (Qa | I1)) !== Es && (U = x.return), F = x.return;
                  while (F);
                }
                return x.tag === j ? U : null;
              }
              function Yc(g) {
                if (g.tag === ee) {
                  var x = g.memoizedState;
                  if (x === null) {
                    var U = g.alternate;
                    U !== null && (x = U.memoizedState);
                  }
                  if (x !== null)
                    return x.dehydrated;
                }
                return null;
              }
              function i7(g) {
                return g.tag === j ? g.stateNode.containerInfo : null;
              }
              function xg(g) {
                return To(g) === g;
              }
              function $9(g) {
                {
                  var x = lA.current;
                  if (x !== null && x.tag === q) {
                    var U = x, F = U.stateNode;
                    F._warnedAboutRefsInRender || c("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", Zr(U.type) || "A component"), F._warnedAboutRefsInRender = !0;
                  }
                }
                var K = Gu(g);
                return K ? To(K) === K : !1;
              }
              function _v(g) {
                if (To(g) !== g)
                  throw Error("Unable to find node on an unmounted component.");
              }
              function e6(g) {
                var x = g.alternate;
                if (!x) {
                  var U = To(g);
                  if (U === null)
                    throw Error("Unable to find node on an unmounted component.");
                  return U !== g ? null : g;
                }
                for (var F = g, K = x; ; ) {
                  var oe = F.return;
                  if (oe === null)
                    break;
                  var ce = oe.alternate;
                  if (ce === null) {
                    var Te = oe.return;
                    if (Te !== null) {
                      F = K = Te;
                      continue;
                    }
                    break;
                  }
                  if (oe.child === ce.child) {
                    for (var Ce = oe.child; Ce; ) {
                      if (Ce === F)
                        return _v(oe), g;
                      if (Ce === K)
                        return _v(oe), x;
                      Ce = Ce.sibling;
                    }
                    throw Error("Unable to find node on an unmounted component.");
                  }
                  if (F.return !== K.return)
                    F = oe, K = ce;
                  else {
                    for (var tt = !1, ft = oe.child; ft; ) {
                      if (ft === F) {
                        tt = !0, F = oe, K = ce;
                        break;
                      }
                      if (ft === K) {
                        tt = !0, K = oe, F = ce;
                        break;
                      }
                      ft = ft.sibling;
                    }
                    if (!tt) {
                      for (ft = ce.child; ft; ) {
                        if (ft === F) {
                          tt = !0, F = ce, K = oe;
                          break;
                        }
                        if (ft === K) {
                          tt = !0, K = ce, F = oe;
                          break;
                        }
                        ft = ft.sibling;
                      }
                      if (!tt)
                        throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
                    }
                  }
                  if (F.alternate !== K)
                    throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
                }
                if (F.tag !== j)
                  throw Error("Unable to find node on an unmounted component.");
                return F.stateNode.current === F ? g : x;
              }
              function $u(g) {
                var x = e6(g);
                if (!x)
                  return null;
                for (var U = x; ; ) {
                  if (U.tag === m || U.tag === I)
                    return U;
                  if (U.child) {
                    U.child.return = U, U = U.child;
                    continue;
                  }
                  if (U === x)
                    return null;
                  for (; !U.sibling; ) {
                    if (!U.return || U.return === x)
                      return null;
                    U = U.return;
                  }
                  U.sibling.return = U.return, U = U.sibling;
                }
                return null;
              }
              function Mc(g) {
                var x = e6(g);
                if (!x)
                  return null;
                for (var U = x; ; ) {
                  if (U.tag === m || U.tag === I || De)
                    return U;
                  if (U.child && U.tag !== w) {
                    U.child.return = U, U = U.child;
                    continue;
                  }
                  if (U === x)
                    return null;
                  for (; !U.sibling; ) {
                    if (!U.return || U.return === x)
                      return null;
                    U = U.return;
                  }
                  U.sibling.return = U.return, U = U.sibling;
                }
                return null;
              }
              function t6(g, x) {
                for (var U = x, F = g.alternate; U !== null; ) {
                  if (U === g || U === F)
                    return !0;
                  U = U.return;
                }
                return !1;
              }
              var zf;
              function PA(g) {
                zf = g;
              }
              var ef;
              function $v(g) {
                ef = g;
              }
              var r6;
              function Dg(g) {
                r6 = g;
              }
              var Cp;
              function jg(g) {
                Cp = g;
              }
              var n6 = !1, r1 = [], Us = null, tf = null, fv = null, Lc = /* @__PURE__ */ new Map(), el = /* @__PURE__ */ new Map(), eu = [];
              function h4() {
                return r1.length > 0;
              }
              var s7 = [
                "mousedown",
                "mouseup",
                "touchcancel",
                "touchend",
                "touchstart",
                "auxclick",
                "dblclick",
                "pointercancel",
                "pointerdown",
                "pointerup",
                "dragend",
                "dragstart",
                "drop",
                "compositionend",
                "compositionstart",
                "keydown",
                "keypress",
                "keyup",
                "input",
                "textInput",
                // Intentionally camelCase
                "copy",
                "cut",
                "paste",
                "click",
                "change",
                "contextmenu",
                "reset",
                "submit"
              ];
              function wg(g) {
                return s7.indexOf(g) > -1;
              }
              function qo(g, x, U, F, K) {
                return {
                  blockedOn: g,
                  domEventName: x,
                  eventSystemFlags: U | U1,
                  nativeEvent: K,
                  targetContainers: [F]
                };
              }
              function a7(g, x, U, F, K) {
                var oe = qo(g, x, U, F, K);
                r1.push(oe);
              }
              function Op(g, x) {
                switch (g) {
                  case "focusin":
                  case "focusout":
                    Us = null;
                    break;
                  case "dragenter":
                  case "dragleave":
                    tf = null;
                    break;
                  case "mouseover":
                  case "mouseout":
                    fv = null;
                    break;
                  case "pointerover":
                  case "pointerout": {
                    var U = x.pointerId;
                    Lc.delete(U);
                    break;
                  }
                  case "gotpointercapture":
                  case "lostpointercapture": {
                    var F = x.pointerId;
                    el.delete(F);
                    break;
                  }
                }
              }
              function Gf(g, x, U, F, K, oe) {
                if (g === null || g.nativeEvent !== oe) {
                  var ce = qo(x, U, F, K, oe);
                  if (x !== null) {
                    var Te = xd(x);
                    Te !== null && ef(Te);
                  }
                  return ce;
                }
                g.eventSystemFlags |= F;
                var Ce = g.targetContainers;
                return K !== null && Ce.indexOf(K) === -1 && Ce.push(K), g;
              }
              function Av(g, x, U, F, K) {
                switch (x) {
                  case "focusin": {
                    var oe = K;
                    return Us = Gf(Us, g, x, U, F, oe), !0;
                  }
                  case "dragenter": {
                    var ce = K;
                    return tf = Gf(tf, g, x, U, F, ce), !0;
                  }
                  case "mouseover": {
                    var Te = K;
                    return fv = Gf(fv, g, x, U, F, Te), !0;
                  }
                  case "pointerover": {
                    var Ce = K, tt = Ce.pointerId;
                    return Lc.set(tt, Gf(Lc.get(tt) || null, g, x, U, F, Ce)), !0;
                  }
                  case "gotpointercapture": {
                    var ft = K, Rt = ft.pointerId;
                    return el.set(Rt, Gf(el.get(Rt) || null, g, x, U, F, ft)), !0;
                  }
                }
                return !1;
              }
              function o7(g) {
                var x = ll(g.target);
                if (x !== null) {
                  var U = To(x);
                  if (U !== null) {
                    var F = U.tag;
                    if (F === ee) {
                      var K = Yc(U);
                      if (K !== null) {
                        g.blockedOn = K, Cp(g.lanePriority, function() {
                          u.unstable_runWithPriority(g.priority, function() {
                            r6(U);
                          });
                        });
                        return;
                      }
                    } else if (F === j) {
                      var oe = U.stateNode;
                      if (oe.hydrate) {
                        g.blockedOn = i7(U);
                        return;
                      }
                    }
                  }
                }
                g.blockedOn = null;
              }
              function hd(g) {
                if (g.blockedOn !== null)
                  return !1;
                for (var x = g.targetContainers; x.length > 0; ) {
                  var U = x[0], F = eh(g.domEventName, g.eventSystemFlags, U, g.nativeEvent);
                  if (F !== null) {
                    var K = xd(F);
                    return K !== null && ef(K), g.blockedOn = F, !1;
                  }
                  x.shift();
                }
                return !0;
              }
              function f7(g, x, U) {
                hd(g) && U.delete(x);
              }
              function mg() {
                for (n6 = !1; r1.length > 0; ) {
                  var g = r1[0];
                  if (g.blockedOn !== null) {
                    var x = xd(g.blockedOn);
                    x !== null && zf(x);
                    break;
                  }
                  for (var U = g.targetContainers; U.length > 0; ) {
                    var F = U[0], K = eh(g.domEventName, g.eventSystemFlags, F, g.nativeEvent);
                    if (K !== null) {
                      g.blockedOn = K;
                      break;
                    }
                    U.shift();
                  }
                  g.blockedOn === null && r1.shift();
                }
                Us !== null && hd(Us) && (Us = null), tf !== null && hd(tf) && (tf = null), fv !== null && hd(fv) && (fv = null), Lc.forEach(f7), el.forEach(f7);
              }
              function YA(g, x) {
                g.blockedOn === x && (g.blockedOn = null, n6 || (n6 = !0, u.unstable_scheduleCallback(u.unstable_NormalPriority, mg)));
              }
              function n1(g) {
                if (r1.length > 0) {
                  YA(r1[0], g);
                  for (var x = 1; x < r1.length; x++) {
                    var U = r1[x];
                    U.blockedOn === g && (U.blockedOn = null);
                  }
                }
                Us !== null && YA(Us, g), tf !== null && YA(tf, g), fv !== null && YA(fv, g);
                var F = function(Te) {
                  return YA(Te, g);
                };
                Lc.forEach(F), el.forEach(F);
                for (var K = 0; K < eu.length; K++) {
                  var oe = eu[K];
                  oe.blockedOn === g && (oe.blockedOn = null);
                }
                for (; eu.length > 0; ) {
                  var ce = eu[0];
                  if (ce.blockedOn !== null)
                    break;
                  o7(ce), ce.blockedOn === null && eu.shift();
                }
              }
              var dn = 0, i1 = 1, rf = 2;
              function Kc(g, x) {
                var U = {};
                return U[g.toLowerCase()] = x.toLowerCase(), U["Webkit" + g] = "webkit" + x, U["Moz" + g] = "moz" + x, U;
              }
              var vP = {
                animationend: Kc("Animation", "AnimationEnd"),
                animationiteration: Kc("Animation", "AnimationIteration"),
                animationstart: Kc("Animation", "AnimationStart"),
                transitionend: Kc("Transition", "TransitionEnd")
              }, MA = {}, tu = {};
              Ke && (tu = document.createElement("div").style, "AnimationEvent" in window || (delete vP.animationend.animation, delete vP.animationiteration.animation, delete vP.animationstart.animation), "TransitionEvent" in window || delete vP.transitionend.transition);
              function uP(g) {
                if (MA[g])
                  return MA[g];
                if (!vP[g])
                  return g;
                var x = vP[g];
                for (var U in x)
                  if (x.hasOwnProperty(U) && U in tu)
                    return MA[g] = x[U];
                return g;
              }
              var R1 = uP("animationend"), dv = uP("animationiteration"), ru = uP("animationstart"), yp = uP("transitionend"), A7 = /* @__PURE__ */ new Map(), vv = /* @__PURE__ */ new Map(), lP = [
                "cancel",
                "cancel",
                "click",
                "click",
                "close",
                "close",
                "contextmenu",
                "contextMenu",
                "copy",
                "copy",
                "cut",
                "cut",
                "auxclick",
                "auxClick",
                "dblclick",
                "doubleClick",
                // Careful!
                "dragend",
                "dragEnd",
                "dragstart",
                "dragStart",
                "drop",
                "drop",
                "focusin",
                "focus",
                // Careful!
                "focusout",
                "blur",
                // Careful!
                "input",
                "input",
                "invalid",
                "invalid",
                "keydown",
                "keyDown",
                "keypress",
                "keyPress",
                "keyup",
                "keyUp",
                "mousedown",
                "mouseDown",
                "mouseup",
                "mouseUp",
                "paste",
                "paste",
                "pause",
                "pause",
                "play",
                "play",
                "pointercancel",
                "pointerCancel",
                "pointerdown",
                "pointerDown",
                "pointerup",
                "pointerUp",
                "ratechange",
                "rateChange",
                "reset",
                "reset",
                "seeked",
                "seeked",
                "submit",
                "submit",
                "touchcancel",
                "touchCancel",
                "touchend",
                "touchEnd",
                "touchstart",
                "touchStart",
                "volumechange",
                "volumeChange"
              ], H4 = ["change", "selectionchange", "textInput", "compositionstart", "compositionend", "compositionupdate"], Bg = ["drag", "drag", "dragenter", "dragEnter", "dragexit", "dragExit", "dragleave", "dragLeave", "dragover", "dragOver", "mousemove", "mouseMove", "mouseout", "mouseOut", "mouseover", "mouseOver", "pointermove", "pointerMove", "pointerout", "pointerOut", "pointerover", "pointerOver", "scroll", "scroll", "toggle", "toggle", "touchmove", "touchMove", "wheel", "wheel"], d7 = ["abort", "abort", R1, "animationEnd", dv, "animationIteration", ru, "animationStart", "canplay", "canPlay", "canplaythrough", "canPlayThrough", "durationchange", "durationChange", "emptied", "emptied", "encrypted", "encrypted", "ended", "ended", "error", "error", "gotpointercapture", "gotPointerCapture", "load", "load", "loadeddata", "loadedData", "loadedmetadata", "loadedMetadata", "loadstart", "loadStart", "lostpointercapture", "lostPointerCapture", "playing", "playing", "progress", "progress", "seeking", "seeking", "stalled", "stalled", "suspend", "suspend", "timeupdate", "timeUpdate", yp, "transitionEnd", "waiting", "waiting"];
              function v7(g, x) {
                for (var U = 0; U < g.length; U += 2) {
                  var F = g[U], K = g[U + 1], oe = K[0].toUpperCase() + K.slice(1), ce = "on" + oe;
                  vv.set(F, x), A7.set(F, ce), be(ce, [F]);
                }
              }
              function Wg(g, x) {
                for (var U = 0; U < g.length; U++)
                  vv.set(g[U], x);
              }
              function g4(g) {
                var x = vv.get(g);
                return x === void 0 ? rf : x;
              }
              function kp() {
                v7(lP, dn), v7(Bg, i1), v7(d7, rf), Wg(H4, dn);
              }
              var Jc = u.unstable_now;
              if (!(l.__interactionsRef != null && l.__interactionsRef.current != null))
                throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");
              var Ep = 99, Sg = 98, Ug = 97, zc = 96, Gc = 95, Fp = 90;
              Jc();
              var j9 = 15, tl = 14, rl = 13, uv = 12, u7 = 11, y6 = 10, Di = 9, Ki = 8, wi = 7, Za = 6, k6 = 5, Zc = 4, Np = 3, _c = 2, nu = 1, sa = 0, Ar = 31, Zt = (
                /*                        */
                0
              ), Ln = (
                /*                          */
                0
              ), qs = (
                /*                        */
                1
              ), Zf = (
                /*                 */
                2
              ), iu = (
                /*      */
                4
              ), Ra = (
                /*                    */
                24
              ), nl = (
                /*           */
                32
              ), su = (
                /*                  */
                192
              ), il = (
                /*            */
                256
              ), E6 = (
                /*                   */
                3584
              ), i6 = (
                /*                */
                4096
              ), LA = (
                /*                       */
                4186112
              ), au = (
                /*                            */
                62914560
              ), lv = (
                /*                  */
                33554432
              ), $c = (
                /*          */
                67108864
              ), Qp = (
                /*                                 */
                134217727
              ), e3 = (
                /*               */
                134217728
              ), t3 = (
                /*                             */
                805306368
              ), cA = (
                /*                   */
                1073741824
              ), _a = -1;
              function Ig(g) {
              }
              var ba = Ki;
              function KA(g) {
                if ((qs & g) !== Zt)
                  return ba = j9, qs;
                if ((Zf & g) !== Zt)
                  return ba = tl, Zf;
                if ((iu & g) !== Zt)
                  return ba = rl, iu;
                var x = Ra & g;
                if (x !== Zt)
                  return ba = uv, x;
                if ((g & nl) !== Zt)
                  return ba = u7, nl;
                var U = su & g;
                if (U !== Zt)
                  return ba = y6, U;
                if ((g & il) !== Zt)
                  return ba = Di, il;
                var F = E6 & g;
                if (F !== Zt)
                  return ba = Ki, F;
                if ((g & i6) !== Zt)
                  return ba = wi, i6;
                var K = LA & g;
                if (K !== Zt)
                  return ba = Za, K;
                var oe = au & g;
                if (oe !== Zt)
                  return ba = k6, oe;
                if (g & $c)
                  return ba = Zc, $c;
                if ((g & e3) !== Zt)
                  return ba = Np, e3;
                var ce = t3 & g;
                return ce !== Zt ? (ba = _c, ce) : (cA & g) !== Zt ? (ba = nu, cA) : (c("Should have found matching lanes. This is a bug in React."), ba = Ki, g);
              }
              function l7(g) {
                switch (g) {
                  case Ep:
                    return j9;
                  case Sg:
                    return y6;
                  case Ug:
                  case zc:
                    return Ki;
                  case Gc:
                    return _c;
                  default:
                    return sa;
                }
              }
              function PP(g) {
                switch (g) {
                  case j9:
                  case tl:
                    return Ep;
                  case rl:
                  case uv:
                  case u7:
                  case y6:
                    return Sg;
                  case Di:
                  case Ki:
                  case wi:
                  case Za:
                  case Zc:
                  case k6:
                    return Ug;
                  case Np:
                  case _c:
                  case nu:
                    return Gc;
                  case sa:
                    return Fp;
                  default:
                    throw Error("Invalid update priority: " + g + ". This is a bug in React.");
                }
              }
              function pA(g, x) {
                var U = g.pendingLanes;
                if (U === Zt)
                  return ba = sa, Zt;
                var F = Zt, K = sa, oe = g.expiredLanes, ce = g.suspendedLanes, Te = g.pingedLanes;
                if (oe !== Zt)
                  F = oe, K = ba = j9;
                else {
                  var Ce = U & Qp;
                  if (Ce !== Zt) {
                    var tt = Ce & ~ce;
                    if (tt !== Zt)
                      F = KA(tt), K = ba;
                    else {
                      var ft = Ce & Te;
                      ft !== Zt && (F = KA(ft), K = ba);
                    }
                  } else {
                    var Rt = U & ~ce;
                    Rt !== Zt ? (F = KA(Rt), K = ba) : Te !== Zt && (F = KA(Te), K = ba);
                  }
                }
                if (F === Zt)
                  return Zt;
                if (F = U & c7(F), x !== Zt && x !== F && // If we already suspended with a delay, then interrupting is fine. Don't
                // bother waiting until the root is complete.
                (x & ce) === Zt) {
                  KA(x);
                  var ct = ba;
                  if (K <= ct)
                    return x;
                  ba = K;
                }
                var Ft = g.entangledLanes;
                if (Ft !== Zt)
                  for (var wr = g.entanglements, Yr = F & Ft; Yr > 0; ) {
                    var Si = gd(Yr), os = 1 << Si;
                    F |= wr[Si], Yr &= ~os;
                  }
                return F;
              }
              function Yp(g, x) {
                for (var U = g.eventTimes, F = _a; x > 0; ) {
                  var K = gd(x), oe = 1 << K, ce = U[K];
                  ce > F && (F = ce), x &= ~oe;
                }
                return F;
              }
              function Mp(g, x) {
                KA(g);
                var U = ba;
                return U >= y6 ? x + 250 : U >= Za ? x + 5e3 : _a;
              }
              function Lp(g, x) {
                for (var U = g.pendingLanes, F = g.suspendedLanes, K = g.pingedLanes, oe = g.expirationTimes, ce = U; ce > 0; ) {
                  var Te = gd(ce), Ce = 1 << Te, tt = oe[Te];
                  tt === _a ? ((Ce & F) === Zt || (Ce & K) !== Zt) && (oe[Te] = Mp(Ce, x)) : tt <= x && (g.expiredLanes |= Ce), ce &= ~Ce;
                }
              }
              function Kp(g) {
                var x = g.pendingLanes & ~cA;
                return x !== Zt ? x : x & cA ? cA : Zt;
              }
              function Rg() {
                return ba;
              }
              function sl(g) {
                return (g & Qp) !== Zt;
              }
              function Jp(g) {
                return (g & au) === g;
              }
              function cP(g) {
                return (g & LA) === g;
              }
              function Hd(g, x) {
                switch (g) {
                  case sa:
                    break;
                  case j9:
                    return qs;
                  case tl:
                    return Zf;
                  case uv: {
                    var U = V1(Ra & ~x);
                    return U === Ln ? Hd(y6, x) : U;
                  }
                  case y6: {
                    var F = V1(su & ~x);
                    return F === Ln ? Hd(Ki, x) : F;
                  }
                  case Ki: {
                    var K = V1(E6 & ~x);
                    return K === Ln && (K = V1(LA & ~x), K === Ln && (K = V1(E6))), K;
                  }
                  case Za:
                  case k6:
                    break;
                  case _c:
                    var oe = V1(t3 & ~x);
                    return oe === Ln && (oe = V1(t3)), oe;
                }
                throw Error("Invalid update priority: " + g + ". This is a bug in React.");
              }
              function s6(g, x) {
                var U = V1(LA & ~x);
                return U === Ln && (U = V1(LA & ~g), U === Ln && (U = V1(LA))), U;
              }
              function Uq(g) {
                var x = V1(au & ~g);
                return x === Ln && (x = V1(au)), x;
              }
              function Ma(g) {
                return g & -g;
              }
              function P7(g) {
                var x = 31 - O1(g);
                return x < 0 ? Zt : 1 << x;
              }
              function c7(g) {
                return (P7(g) << 1) - 1;
              }
              function V1(g) {
                return Ma(g);
              }
              function gd(g) {
                return 31 - O1(g);
              }
              function X4(g) {
                return gd(g);
              }
              function nf(g, x) {
                return (g & x) !== Zt;
              }
              function pP(g, x) {
                return (g & x) === x;
              }
              function ca(g, x) {
                return g | x;
              }
              function hP(g, x) {
                return g & ~x;
              }
              function zp(g) {
                return g;
              }
              function r3(g, x) {
                return g !== Ln && g < x ? g : x;
              }
              function n3(g) {
                for (var x = [], U = 0; U < Ar; U++)
                  x.push(g);
                return x;
              }
              function Gp(g, x, U) {
                g.pendingLanes |= x;
                var F = x - 1;
                g.suspendedLanes &= F, g.pingedLanes &= F;
                var K = g.eventTimes, oe = X4(x);
                K[oe] = U;
              }
              function T4(g, x) {
                g.suspendedLanes |= x, g.pingedLanes &= ~x;
                for (var U = g.expirationTimes, F = x; F > 0; ) {
                  var K = gd(F), oe = 1 << K;
                  U[K] = _a, F &= ~oe;
                }
              }
              function i3(g, x, U) {
                g.pingedLanes |= g.suspendedLanes & x;
              }
              function q4(g) {
                g.expiredLanes |= Ra & g.pendingLanes;
              }
              function Vg(g) {
                return (g & Ra) !== Zt;
              }
              function Zp(g, x) {
                g.mutableReadLanes |= x & g.pendingLanes;
              }
              function Iq(g, x) {
                var U = g.pendingLanes & ~x;
                g.pendingLanes = x, g.suspendedLanes = 0, g.pingedLanes = 0, g.expiredLanes &= x, g.mutableReadLanes &= x, g.entangledLanes &= x;
                for (var F = g.entanglements, K = g.eventTimes, oe = g.expirationTimes, ce = U; ce > 0; ) {
                  var Te = gd(ce), Ce = 1 << Te;
                  F[Te] = Zt, K[Te] = _a, oe[Te] = _a, ce &= ~Ce;
                }
              }
              function C1(g, x) {
                g.entangledLanes |= x;
                for (var U = g.entanglements, F = x; F > 0; ) {
                  var K = gd(F), oe = 1 << K;
                  U[K] |= x, F &= ~oe;
                }
              }
              var O1 = Math.clz32 ? Math.clz32 : F6, al = Math.log, _p = Math.LN2;
              function F6(g) {
                return g === 0 ? 32 : 31 - (al(g) / _p | 0) | 0;
              }
              var HP = u.unstable_UserBlockingPriority, ts = u.unstable_runWithPriority, ou = !0;
              function p7(g) {
                ou = !!g;
              }
              function Cg() {
                return ou;
              }
              function b4(g, x, U) {
                var F = g4(x), K;
                switch (F) {
                  case dn:
                    K = h7;
                    break;
                  case i1:
                    K = gP;
                    break;
                  case rf:
                  default:
                    K = $p;
                    break;
                }
                return K.bind(null, x, U, g);
              }
              function h7(g, x, U, F) {
                r7(F.timeStamp), fP($p, g, x, U, F);
              }
              function gP(g, x, U, F) {
                ts(HP, $p.bind(null, g, x, U, F));
              }
              function $p(g, x, U, F) {
                if (ou) {
                  var K = !0;
                  if (K = (x & Vo) === 0, K && h4() && wg(g)) {
                    a7(
                      null,
                      // Flags that we're not actually blocked on anything as far as we know.
                      g,
                      x,
                      U,
                      F
                    );
                    return;
                  }
                  var oe = eh(g, x, U, F);
                  if (oe === null) {
                    K && Op(g, F);
                    return;
                  }
                  if (K) {
                    if (wg(g)) {
                      a7(oe, g, x, U, F);
                      return;
                    }
                    if (Av(oe, g, x, U, F))
                      return;
                    Op(g, F);
                  }
                  E(g, x, F, null, U);
                }
              }
              function eh(g, x, U, F) {
                var K = Wf(F), oe = ll(K);
                if (oe !== null) {
                  var ce = To(oe);
                  if (ce === null)
                    oe = null;
                  else {
                    var Te = ce.tag;
                    if (Te === ee) {
                      var Ce = Yc(ce);
                      if (Ce !== null)
                        return Ce;
                      oe = null;
                    } else if (Te === j) {
                      var tt = ce.stateNode;
                      if (tt.hydrate)
                        return i7(ce);
                      oe = null;
                    } else
                      ce !== oe && (oe = null);
                  }
                }
                return E(g, x, F, oe, U), null;
              }
              function Og(g, x, U) {
                return g.addEventListener(x, U, !1), U;
              }
              function s3(g, x, U) {
                return g.addEventListener(x, U, !0), U;
              }
              function x4(g, x, U, F) {
                return g.addEventListener(x, U, {
                  capture: !0,
                  passive: F
                }), U;
              }
              function yg(g, x, U, F) {
                return g.addEventListener(x, U, {
                  passive: F
                }), U;
              }
              var fu = null, th = null, H1 = null;
              function _f(g) {
                return fu = g, th = ol(), !0;
              }
              function Au() {
                fu = null, th = null, H1 = null;
              }
              function XP() {
                if (H1)
                  return H1;
                var g, x = th, U = x.length, F, K = ol(), oe = K.length;
                for (g = 0; g < U && x[g] === K[g]; g++)
                  ;
                var ce = U - g;
                for (F = 1; F <= ce && x[U - F] === K[oe - F]; F++)
                  ;
                var Te = F > 1 ? 1 - F : void 0;
                return H1 = K.slice(g, Te), H1;
              }
              function ol() {
                return "value" in fu ? fu.value : fu.textContent;
              }
              function a6(g) {
                var x, U = g.keyCode;
                return "charCode" in g ? (x = g.charCode, x === 0 && U === 13 && (x = 13)) : x = U, x === 10 && (x = 13), x >= 32 || x === 13 ? x : 0;
              }
              function Co() {
                return !0;
              }
              function a3() {
                return !1;
              }
              function Va(g) {
                function x(U, F, K, oe, ce) {
                  this._reactName = U, this._targetInst = K, this.type = F, this.nativeEvent = oe, this.target = ce, this.currentTarget = null;
                  for (var Te in g)
                    if (g.hasOwnProperty(Te)) {
                      var Ce = g[Te];
                      Ce ? this[Te] = Ce(oe) : this[Te] = oe[Te];
                    }
                  var tt = oe.defaultPrevented != null ? oe.defaultPrevented : oe.returnValue === !1;
                  return tt ? this.isDefaultPrevented = Co : this.isDefaultPrevented = a3, this.isPropagationStopped = a3, this;
                }
                return v(x.prototype, {
                  preventDefault: function() {
                    this.defaultPrevented = !0;
                    var U = this.nativeEvent;
                    U && (U.preventDefault ? U.preventDefault() : typeof U.returnValue != "unknown" && (U.returnValue = !1), this.isDefaultPrevented = Co);
                  },
                  stopPropagation: function() {
                    var U = this.nativeEvent;
                    U && (U.stopPropagation ? U.stopPropagation() : typeof U.cancelBubble != "unknown" && (U.cancelBubble = !0), this.isPropagationStopped = Co);
                  },
                  /**
                   * We release all dispatched `SyntheticEvent`s after each event loop, adding
                   * them back into the pool. This allows a way to hold onto a reference that
                   * won't be added back into the pool.
                   */
                  persist: function() {
                  },
                  /**
                   * Checks if this event should be released back into the pool.
                   *
                   * @return {boolean} True if this should not be released, false otherwise.
                   */
                  isPersistent: Co
                }), x;
              }
              var TP = {
                eventPhase: 0,
                bubbles: 0,
                cancelable: 0,
                timeStamp: function(g) {
                  return g.timeStamp || Date.now();
                },
                defaultPrevented: 0,
                isTrusted: 0
              }, rh = Va(TP), du = v({}, TP, {
                view: 0,
                detail: 0
              }), sf = Va(du), nh, Un, Xd;
              function ih(g) {
                g !== Xd && (Xd && g.type === "mousemove" ? (nh = g.screenX - Xd.screenX, Un = g.screenY - Xd.screenY) : (nh = 0, Un = 0), Xd = g);
              }
              var o3 = v({}, du, {
                screenX: 0,
                screenY: 0,
                clientX: 0,
                clientY: 0,
                pageX: 0,
                pageY: 0,
                ctrlKey: 0,
                shiftKey: 0,
                altKey: 0,
                metaKey: 0,
                getModifierState: g7,
                button: 0,
                buttons: 0,
                relatedTarget: function(g) {
                  return g.relatedTarget === void 0 ? g.fromElement === g.srcElement ? g.toElement : g.fromElement : g.relatedTarget;
                },
                movementX: function(g) {
                  return "movementX" in g ? g.movementX : (ih(g), nh);
                },
                movementY: function(g) {
                  return "movementY" in g ? g.movementY : Un;
                }
              }), kg = Va(o3), sh = v({}, o3, {
                dataTransfer: 0
              }), ah = Va(sh), Eg = v({}, du, {
                relatedTarget: 0
              }), oh = Va(Eg), Fg = v({}, TP, {
                animationName: 0,
                elapsedTime: 0,
                pseudoElement: 0
              }), H7 = Va(Fg), f3 = v({}, TP, {
                clipboardData: function(g) {
                  return "clipboardData" in g ? g.clipboardData : window.clipboardData;
                }
              }), Pv = Va(f3), bo = v({}, TP, {
                data: 0
              }), af = Va(bo), JA = af, A3 = {
                Esc: "Escape",
                Spacebar: " ",
                Left: "ArrowLeft",
                Up: "ArrowUp",
                Right: "ArrowRight",
                Down: "ArrowDown",
                Del: "Delete",
                Win: "OS",
                Menu: "ContextMenu",
                Apps: "ContextMenu",
                Scroll: "ScrollLock",
                MozPrintableKey: "Unidentified"
              }, vu = {
                8: "Backspace",
                9: "Tab",
                12: "Clear",
                13: "Enter",
                16: "Shift",
                17: "Control",
                18: "Alt",
                19: "Pause",
                20: "CapsLock",
                27: "Escape",
                32: " ",
                33: "PageUp",
                34: "PageDown",
                35: "End",
                36: "Home",
                37: "ArrowLeft",
                38: "ArrowUp",
                39: "ArrowRight",
                40: "ArrowDown",
                45: "Insert",
                46: "Delete",
                112: "F1",
                113: "F2",
                114: "F3",
                115: "F4",
                116: "F5",
                117: "F6",
                118: "F7",
                119: "F8",
                120: "F9",
                121: "F10",
                122: "F11",
                123: "F12",
                144: "NumLock",
                145: "ScrollLock",
                224: "Meta"
              };
              function zA(g) {
                if (g.key) {
                  var x = A3[g.key] || g.key;
                  if (x !== "Unidentified")
                    return x;
                }
                if (g.type === "keypress") {
                  var U = a6(g);
                  return U === 13 ? "Enter" : String.fromCharCode(U);
                }
                return g.type === "keydown" || g.type === "keyup" ? vu[g.keyCode] || "Unidentified" : "";
              }
              var D4 = {
                Alt: "altKey",
                Control: "ctrlKey",
                Meta: "metaKey",
                Shift: "shiftKey"
              };
              function Td(g) {
                var x = this, U = x.nativeEvent;
                if (U.getModifierState)
                  return U.getModifierState(g);
                var F = D4[g];
                return F ? !!U[F] : !1;
              }
              function g7(g) {
                return Td;
              }
              var d3 = v({}, du, {
                key: zA,
                code: 0,
                location: 0,
                ctrlKey: 0,
                shiftKey: 0,
                altKey: 0,
                metaKey: 0,
                repeat: 0,
                locale: 0,
                getModifierState: g7,
                // Legacy Interface
                charCode: function(g) {
                  return g.type === "keypress" ? a6(g) : 0;
                },
                keyCode: function(g) {
                  return g.type === "keydown" || g.type === "keyup" ? g.keyCode : 0;
                },
                which: function(g) {
                  return g.type === "keypress" ? a6(g) : g.type === "keydown" || g.type === "keyup" ? g.keyCode : 0;
                }
              }), j4 = Va(d3), X7 = v({}, o3, {
                pointerId: 0,
                width: 0,
                height: 0,
                pressure: 0,
                tangentialPressure: 0,
                tiltX: 0,
                tiltY: 0,
                twist: 0,
                pointerType: 0,
                isPrimary: 0
              }), Ng = Va(X7), v3 = v({}, du, {
                touches: 0,
                targetTouches: 0,
                changedTouches: 0,
                altKey: 0,
                metaKey: 0,
                ctrlKey: 0,
                shiftKey: 0,
                getModifierState: g7
              }), fh = Va(v3), Qg = v({}, TP, {
                propertyName: 0,
                elapsedTime: 0,
                pseudoElement: 0
              }), $f = Va(Qg), bs = v({}, o3, {
                deltaX: function(g) {
                  return "deltaX" in g ? g.deltaX : (
                    // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
                    "wheelDeltaX" in g ? -g.wheelDeltaX : 0
                  );
                },
                deltaY: function(g) {
                  return "deltaY" in g ? g.deltaY : (
                    // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
                    "wheelDeltaY" in g ? -g.wheelDeltaY : (
                      // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
                      "wheelDelta" in g ? -g.wheelDelta : 0
                    )
                  );
                },
                deltaZ: 0,
                // Browsers without "deltaMode" is reporting in raw wheel delta where one
                // notch on the scroll is always +/- 120, roughly equivalent to pixels.
                // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
                // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
                deltaMode: 0
              }), Oo = Va(bs), yo = [9, 13, 27, 32], of = 229, o6 = Ke && "CompositionEvent" in window, cv = null;
              Ke && "documentMode" in document && (cv = document.documentMode);
              var ff = Ke && "TextEvent" in window && !cv, u3 = Ke && (!o6 || cv && cv > 8 && cv <= 11), pv = 32, Ah = String.fromCharCode(pv);
              function l3() {
                be("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), be("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]), be("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]), be("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
              }
              var uu = !1;
              function f6(g) {
                return (g.ctrlKey || g.altKey || g.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
                !(g.ctrlKey && g.altKey);
              }
              function T7(g) {
                switch (g) {
                  case "compositionstart":
                    return "onCompositionStart";
                  case "compositionend":
                    return "onCompositionEnd";
                  case "compositionupdate":
                    return "onCompositionUpdate";
                }
              }
              function P3(g, x) {
                return g === "keydown" && x.keyCode === of;
              }
              function hv(g, x) {
                switch (g) {
                  case "keyup":
                    return yo.indexOf(x.keyCode) !== -1;
                  case "keydown":
                    return x.keyCode !== of;
                  case "keypress":
                  case "mousedown":
                  case "focusout":
                    return !0;
                  default:
                    return !1;
                }
              }
              function c3(g) {
                var x = g.detail;
                return typeof x == "object" && "data" in x ? x.data : null;
              }
              function fl(g) {
                return g.locale === "ko";
              }
              var A6 = !1;
              function lu(g, x, U, F, K) {
                var oe, ce;
                if (o6 ? oe = T7(x) : A6 ? hv(x, F) && (oe = "onCompositionEnd") : P3(x, F) && (oe = "onCompositionStart"), !oe)
                  return null;
                u3 && !fl(F) && (!A6 && oe === "onCompositionStart" ? A6 = _f(K) : oe === "onCompositionEnd" && A6 && (ce = XP()));
                var Te = pe(U, oe);
                if (Te.length > 0) {
                  var Ce = new af(oe, x, null, F, K);
                  if (g.push({
                    event: Ce,
                    listeners: Te
                  }), ce)
                    Ce.data = ce;
                  else {
                    var tt = c3(F);
                    tt !== null && (Ce.data = tt);
                  }
                }
              }
              function Al(g, x) {
                switch (g) {
                  case "compositionend":
                    return c3(x);
                  case "keypress":
                    var U = x.which;
                    return U !== pv ? null : (uu = !0, Ah);
                  case "textInput":
                    var F = x.data;
                    return F === Ah && uu ? null : F;
                  default:
                    return null;
                }
              }
              function q7(g, x) {
                if (A6) {
                  if (g === "compositionend" || !o6 && hv(g, x)) {
                    var U = XP();
                    return Au(), A6 = !1, U;
                  }
                  return null;
                }
                switch (g) {
                  case "paste":
                    return null;
                  case "keypress":
                    if (!f6(x)) {
                      if (x.char && x.char.length > 1)
                        return x.char;
                      if (x.which)
                        return String.fromCharCode(x.which);
                    }
                    return null;
                  case "compositionend":
                    return u3 && !fl(x) ? null : x.data;
                  default:
                    return null;
                }
              }
              function p3(g, x, U, F, K) {
                var oe;
                if (ff ? oe = Al(x, F) : oe = q7(x, F), !oe)
                  return null;
                var ce = pe(U, "onBeforeInput");
                if (ce.length > 0) {
                  var Te = new JA("onBeforeInput", "beforeinput", null, F, K);
                  g.push({
                    event: Te,
                    listeners: ce
                  }), Te.data = oe;
                }
              }
              function b7(g, x, U, F, K, oe, ce) {
                lu(g, x, U, F, K), p3(g, x, U, F, K);
              }
              var qP = {
                color: !0,
                date: !0,
                datetime: !0,
                "datetime-local": !0,
                email: !0,
                month: !0,
                number: !0,
                password: !0,
                range: !0,
                search: !0,
                tel: !0,
                text: !0,
                time: !0,
                url: !0,
                week: !0
              };
              function dl(g) {
                var x = g && g.nodeName && g.nodeName.toLowerCase();
                return x === "input" ? !!qP[g.type] : x === "textarea";
              }
              /**
               * Checks if an event is supported in the current execution environment.
               *
               * NOTE: This will not work correctly for non-generic events such as `change`,
               * `reset`, `load`, `error`, and `select`.
               *
               * Borrows from Modernizr.
               *
               * @param {string} eventNameSuffix Event name, e.g. "click".
               * @return {boolean} True if the event is supported.
               * @internal
               * @license Modernizr 3.0.0pre (Custom Build) | MIT
               */
              function w9(g) {
                if (!Ke)
                  return !1;
                var x = "on" + g, U = x in document;
                if (!U) {
                  var F = document.createElement("div");
                  F.setAttribute(x, "return;"), U = typeof F[x] == "function";
                }
                return U;
              }
              function y1() {
                be("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
              }
              function If(g, x, U, F) {
                yc(F);
                var K = pe(x, "onChange");
                if (K.length > 0) {
                  var oe = new rh("onChange", "change", null, U, F);
                  g.push({
                    event: oe,
                    listeners: K
                  });
                }
              }
              var k1 = null, qd = null;
              function Yg(g) {
                var x = g.nodeName && g.nodeName.toLowerCase();
                return x === "select" || x === "input" && g.type === "file";
              }
              function h3(g) {
                var x = [];
                If(x, qd, g, Wf(g)), Vp(Mg, x);
              }
              function Mg(g) {
                C4(g, 0);
              }
              function d6(g) {
                var x = Pl(g);
                if (Et(x))
                  return g;
              }
              function Lg(g, x) {
                if (g === "change")
                  return x;
              }
              var bP = !1;
              Ke && (bP = w9("input") && (!document.documentMode || document.documentMode > 9));
              function Pu(g, x) {
                k1 = g, qd = x, k1.attachEvent("onpropertychange", vl);
              }
              function x7() {
                k1 && (k1.detachEvent("onpropertychange", vl), k1 = null, qd = null);
              }
              function vl(g) {
                g.propertyName === "value" && d6(qd) && h3(g);
              }
              function w4(g, x, U) {
                g === "focusin" ? (x7(), Pu(x, U)) : g === "focusout" && x7();
              }
              function dh(g, x) {
                if (g === "selectionchange" || g === "keyup" || g === "keydown")
                  return d6(qd);
              }
              function Kg(g) {
                var x = g.nodeName;
                return x && x.toLowerCase() === "input" && (g.type === "checkbox" || g.type === "radio");
              }
              function D7(g, x) {
                if (g === "click")
                  return d6(x);
              }
              function Rq(g, x) {
                if (g === "input" || g === "change")
                  return d6(x);
              }
              function Vq(g) {
                var x = g._wrapperState;
                !x || !x.controlled || g.type !== "number" || W1(g, "number", g.value);
              }
              function Jg(g, x, U, F, K, oe, ce) {
                var Te = U ? Pl(U) : window, Ce, tt;
                if (Yg(Te) ? Ce = Lg : dl(Te) ? bP ? Ce = Rq : (Ce = dh, tt = w4) : Kg(Te) && (Ce = D7), Ce) {
                  var ft = Ce(x, U);
                  if (ft) {
                    If(g, ft, F, K);
                    return;
                  }
                }
                tt && tt(x, Te, U), x === "focusout" && Vq(Te);
              }
              function zg() {
                Fe("onMouseEnter", ["mouseout", "mouseover"]), Fe("onMouseLeave", ["mouseout", "mouseover"]), Fe("onPointerEnter", ["pointerout", "pointerover"]), Fe("onPointerLeave", ["pointerout", "pointerover"]);
              }
              function xP(g, x, U, F, K, oe, ce) {
                var Te = x === "mouseover" || x === "pointerover", Ce = x === "mouseout" || x === "pointerout";
                if (Te && !(oe & U1)) {
                  var tt = F.relatedTarget || F.fromElement;
                  if (tt && (ll(tt) || bh(tt)))
                    return;
                }
                if (!(!Ce && !Te)) {
                  var ft;
                  if (K.window === K)
                    ft = K;
                  else {
                    var Rt = K.ownerDocument;
                    Rt ? ft = Rt.defaultView || Rt.parentWindow : ft = window;
                  }
                  var ct, Ft;
                  if (Ce) {
                    var wr = F.relatedTarget || F.toElement;
                    if (ct = U, Ft = wr ? ll(wr) : null, Ft !== null) {
                      var Yr = To(Ft);
                      (Ft !== Yr || Ft.tag !== m && Ft.tag !== I) && (Ft = null);
                    }
                  } else
                    ct = null, Ft = U;
                  if (ct !== Ft) {
                    var Si = kg, os = "onMouseLeave", Ci = "onMouseEnter", ea = "mouse";
                    (x === "pointerout" || x === "pointerover") && (Si = Ng, os = "onPointerLeave", Ci = "onPointerEnter", ea = "pointer");
                    var to = ct == null ? ft : Pl(ct), Nt = Ft == null ? ft : Pl(Ft), dr = new Si(os, ea + "leave", ct, F, K);
                    dr.target = to, dr.relatedTarget = Nt;
                    var ht = null, Or = ll(K);
                    if (Or === U) {
                      var hn = new Si(Ci, ea + "enter", Ft, F, K);
                      hn.target = Nt, hn.relatedTarget = to, ht = hn;
                    }
                    Jt(g, dr, ht, ct, Ft);
                  }
                }
              }
              function Cq(g, x) {
                return g === x && (g !== 0 || 1 / g === 1 / x) || g !== g && x !== x;
              }
              var e9 = typeof Object.is == "function" ? Object.is : Cq, m4 = Object.prototype.hasOwnProperty;
              function $a(g, x) {
                if (e9(g, x))
                  return !0;
                if (typeof g != "object" || g === null || typeof x != "object" || x === null)
                  return !1;
                var U = Object.keys(g), F = Object.keys(x);
                if (U.length !== F.length)
                  return !1;
                for (var K = 0; K < U.length; K++)
                  if (!m4.call(x, U[K]) || !e9(g[U[K]], x[U[K]]))
                    return !1;
                return !0;
              }
              function B4(g) {
                for (; g && g.firstChild; )
                  g = g.firstChild;
                return g;
              }
              function j7(g) {
                for (; g; ) {
                  if (g.nextSibling)
                    return g.nextSibling;
                  g = g.parentNode;
                }
              }
              function W4(g, x) {
                for (var U = B4(g), F = 0, K = 0; U; ) {
                  if (U.nodeType === Pd) {
                    if (K = F + U.textContent.length, F <= x && K >= x)
                      return {
                        node: U,
                        offset: x - F
                      };
                    F = K;
                  }
                  U = B4(j7(U));
                }
              }
              function Oq(g) {
                var x = g.ownerDocument, U = x && x.defaultView || window, F = U.getSelection && U.getSelection();
                if (!F || F.rangeCount === 0)
                  return null;
                var K = F.anchorNode, oe = F.anchorOffset, ce = F.focusNode, Te = F.focusOffset;
                try {
                  K.nodeType, ce.nodeType;
                } catch {
                  return null;
                }
                return S4(g, K, oe, ce, Te);
              }
              function S4(g, x, U, F, K) {
                var oe = 0, ce = -1, Te = -1, Ce = 0, tt = 0, ft = g, Rt = null;
                e:
                  for (; ; ) {
                    for (var ct = null; ft === x && (U === 0 || ft.nodeType === Pd) && (ce = oe + U), ft === F && (K === 0 || ft.nodeType === Pd) && (Te = oe + K), ft.nodeType === Pd && (oe += ft.nodeValue.length), (ct = ft.firstChild) !== null; )
                      Rt = ft, ft = ct;
                    for (; ; ) {
                      if (ft === g)
                        break e;
                      if (Rt === x && ++Ce === U && (ce = oe), Rt === F && ++tt === K && (Te = oe), (ct = ft.nextSibling) !== null)
                        break;
                      ft = Rt, Rt = ft.parentNode;
                    }
                    ft = ct;
                  }
                return ce === -1 || Te === -1 ? null : {
                  start: ce,
                  end: Te
                };
              }
              function Gg(g, x) {
                var U = g.ownerDocument || document, F = U && U.defaultView || window;
                if (F.getSelection) {
                  var K = F.getSelection(), oe = g.textContent.length, ce = Math.min(x.start, oe), Te = x.end === void 0 ? ce : Math.min(x.end, oe);
                  if (!K.extend && ce > Te) {
                    var Ce = Te;
                    Te = ce, ce = Ce;
                  }
                  var tt = W4(g, ce), ft = W4(g, Te);
                  if (tt && ft) {
                    if (K.rangeCount === 1 && K.anchorNode === tt.node && K.anchorOffset === tt.offset && K.focusNode === ft.node && K.focusOffset === ft.offset)
                      return;
                    var Rt = U.createRange();
                    Rt.setStart(tt.node, tt.offset), K.removeAllRanges(), ce > Te ? (K.addRange(Rt), K.extend(ft.node, ft.offset)) : (Rt.setEnd(ft.node, ft.offset), K.addRange(Rt));
                  }
                }
              }
              function U4(g) {
                return g && g.nodeType === Pd;
              }
              function N6(g, x) {
                return !g || !x ? !1 : g === x ? !0 : U4(g) ? !1 : U4(x) ? N6(g, x.parentNode) : "contains" in g ? g.contains(x) : g.compareDocumentPosition ? !!(g.compareDocumentPosition(x) & 16) : !1;
              }
              function Zg(g) {
                return g && g.ownerDocument && N6(g.ownerDocument.documentElement, g);
              }
              function w7(g) {
                try {
                  return typeof g.contentWindow.location.href == "string";
                } catch {
                  return !1;
                }
              }
              function cu() {
                for (var g = window, x = er(); x instanceof g.HTMLIFrameElement; ) {
                  if (w7(x))
                    g = x.contentWindow;
                  else
                    return x;
                  x = er(g.document);
                }
                return x;
              }
              function H3(g) {
                var x = g && g.nodeName && g.nodeName.toLowerCase();
                return x && (x === "input" && (g.type === "text" || g.type === "search" || g.type === "tel" || g.type === "url" || g.type === "password") || x === "textarea" || g.contentEditable === "true");
              }
              function DP() {
                var g = cu();
                return {
                  focusedElem: g,
                  selectionRange: H3(g) ? vh(g) : null
                };
              }
              function g3(g) {
                var x = cu(), U = g.focusedElem, F = g.selectionRange;
                if (x !== U && Zg(U)) {
                  F !== null && H3(U) && jP(U, F);
                  for (var K = [], oe = U; oe = oe.parentNode; )
                    oe.nodeType === t1 && K.push({
                      element: oe,
                      left: oe.scrollLeft,
                      top: oe.scrollTop
                    });
                  typeof U.focus == "function" && U.focus();
                  for (var ce = 0; ce < K.length; ce++) {
                    var Te = K[ce];
                    Te.element.scrollLeft = Te.left, Te.element.scrollTop = Te.top;
                  }
                }
              }
              function vh(g) {
                var x;
                return "selectionStart" in g ? x = {
                  start: g.selectionStart,
                  end: g.selectionEnd
                } : x = Oq(g), x || {
                  start: 0,
                  end: 0
                };
              }
              function jP(g, x) {
                var U = x.start, F = x.end;
                F === void 0 && (F = U), "selectionStart" in g ? (g.selectionStart = U, g.selectionEnd = Math.min(F, g.value.length)) : Gg(g, x);
              }
              var yq = Ke && "documentMode" in document && document.documentMode <= 11;
              function m7() {
                be("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
              }
              var wP = null, X3 = null, T3 = null, mP = !1;
              function uh(g) {
                if ("selectionStart" in g && H3(g))
                  return {
                    start: g.selectionStart,
                    end: g.selectionEnd
                  };
                var x = g.ownerDocument && g.ownerDocument.defaultView || window, U = x.getSelection();
                return {
                  anchorNode: U.anchorNode,
                  anchorOffset: U.anchorOffset,
                  focusNode: U.focusNode,
                  focusOffset: U.focusOffset
                };
              }
              function I4(g) {
                return g.window === g ? g.document : g.nodeType === fA ? g : g.ownerDocument;
              }
              function B7(g, x, U) {
                var F = I4(U);
                if (!(mP || wP == null || wP !== er(F))) {
                  var K = uh(wP);
                  if (!T3 || !$a(T3, K)) {
                    T3 = K;
                    var oe = pe(X3, "onSelect");
                    if (oe.length > 0) {
                      var ce = new rh("onSelect", "select", null, x, U);
                      g.push({
                        event: ce,
                        listeners: oe
                      }), ce.target = wP;
                    }
                  }
                }
              }
              function R4(g, x, U, F, K, oe, ce) {
                var Te = U ? Pl(U) : window;
                switch (x) {
                  case "focusin":
                    (dl(Te) || Te.contentEditable === "true") && (wP = Te, X3 = U, T3 = null);
                    break;
                  case "focusout":
                    wP = null, X3 = null, T3 = null;
                    break;
                  case "mousedown":
                    mP = !0;
                    break;
                  case "contextmenu":
                  case "mouseup":
                  case "dragend":
                    mP = !1, B7(g, F, K);
                    break;
                  case "selectionchange":
                    if (yq)
                      break;
                  case "keydown":
                  case "keyup":
                    B7(g, F, K);
                }
              }
              function W7(g, x, U, F, K, oe, ce) {
                var Te = A7.get(x);
                if (Te !== void 0) {
                  var Ce = rh, tt = x;
                  switch (x) {
                    case "keypress":
                      if (a6(F) === 0)
                        return;
                    case "keydown":
                    case "keyup":
                      Ce = j4;
                      break;
                    case "focusin":
                      tt = "focus", Ce = oh;
                      break;
                    case "focusout":
                      tt = "blur", Ce = oh;
                      break;
                    case "beforeblur":
                    case "afterblur":
                      Ce = oh;
                      break;
                    case "click":
                      if (F.button === 2)
                        return;
                    case "auxclick":
                    case "dblclick":
                    case "mousedown":
                    case "mousemove":
                    case "mouseup":
                    case "mouseout":
                    case "mouseover":
                    case "contextmenu":
                      Ce = kg;
                      break;
                    case "drag":
                    case "dragend":
                    case "dragenter":
                    case "dragexit":
                    case "dragleave":
                    case "dragover":
                    case "dragstart":
                    case "drop":
                      Ce = ah;
                      break;
                    case "touchcancel":
                    case "touchend":
                    case "touchmove":
                    case "touchstart":
                      Ce = fh;
                      break;
                    case R1:
                    case dv:
                    case ru:
                      Ce = H7;
                      break;
                    case yp:
                      Ce = $f;
                      break;
                    case "scroll":
                      Ce = sf;
                      break;
                    case "wheel":
                      Ce = Oo;
                      break;
                    case "copy":
                    case "cut":
                    case "paste":
                      Ce = Pv;
                      break;
                    case "gotpointercapture":
                    case "lostpointercapture":
                    case "pointercancel":
                    case "pointerdown":
                    case "pointermove":
                    case "pointerout":
                    case "pointerover":
                    case "pointerup":
                      Ce = Ng;
                      break;
                  }
                  var ft = (oe & Vo) !== 0;
                  {
                    var Rt = !ft && // TODO: ideally, we'd eventually add all events from
                    // nonDelegatedEvents list in DOMPluginEventSystem.
                    // Then we can remove this special list.
                    // This is a breaking change that can wait until React 18.
                    x === "scroll", ct = Ae(U, Te, F.type, ft, Rt);
                    if (ct.length > 0) {
                      var Ft = new Ce(Te, tt, null, F, K);
                      g.push({
                        event: Ft,
                        listeners: ct
                      });
                    }
                  }
                }
              }
              kp(), zg(), y1(), m7(), l3();
              function S7(g, x, U, F, K, oe, ce) {
                W7(g, x, U, F, K, oe);
                var Te = (oe & vA) === 0;
                Te && (xP(g, x, U, F, K, oe), Jg(g, x, U, F, K), R4(g, x, U, F, K), b7(g, x, U, F, K));
              }
              var hA = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"], lh = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(hA));
              function Ph(g, x, U) {
                var F = g.type || "unknown-event";
                g.currentTarget = U, zu(F, x, void 0, g), g.currentTarget = null;
              }
              function V4(g, x, U) {
                var F;
                if (U)
                  for (var K = x.length - 1; K >= 0; K--) {
                    var oe = x[K], ce = oe.instance, Te = oe.currentTarget, Ce = oe.listener;
                    if (ce !== F && g.isPropagationStopped())
                      return;
                    Ph(g, Ce, Te), F = ce;
                  }
                else
                  for (var tt = 0; tt < x.length; tt++) {
                    var ft = x[tt], Rt = ft.instance, ct = ft.currentTarget, Ft = ft.listener;
                    if (Rt !== F && g.isPropagationStopped())
                      return;
                    Ph(g, Ft, ct), F = Rt;
                  }
              }
              function C4(g, x) {
                for (var U = (x & Vo) !== 0, F = 0; F < g.length; F++) {
                  var K = g[F], oe = K.event, ce = K.listeners;
                  V4(oe, ce, U);
                }
                EA();
              }
              function q3(g, x, U, F, K) {
                var oe = Wf(U), ce = [];
                S7(ce, g, F, U, oe, x), C4(ce, x);
              }
              function uo(g, x) {
                var U = !1, F = K4(x), K = Wr(g, U);
                F.has(K) || (D(x, g, Jf, U), F.add(K));
              }
              var BP = "_reactListening" + Math.random().toString(36).slice(2);
              function O4(g) {
                {
                  if (g[BP])
                    return;
                  g[BP] = !0, ve.forEach(function(x) {
                    lh.has(x) || b3(x, !1, g, null), b3(x, !0, g, null);
                  });
                }
              }
              function b3(g, x, U, F) {
                var K = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0, oe = U;
                if (g === "selectionchange" && U.nodeType !== fA && (oe = U.ownerDocument), F !== null && !x && lh.has(g)) {
                  if (g !== "scroll")
                    return;
                  K |= Jf, oe = F;
                }
                var ce = K4(oe), Te = Wr(g, x);
                ce.has(Te) || (x && (K |= Vo), D(oe, g, K, x), ce.add(Te));
              }
              function D(g, x, U, F, K) {
                var oe = b4(g, x, U), ce = void 0;
                Nc && (x === "touchstart" || x === "touchmove" || x === "wheel") && (ce = !0), g = g, F ? ce !== void 0 ? x4(g, x, oe, ce) : s3(g, x, oe) : ce !== void 0 ? yg(g, x, oe, ce) : Og(g, x, oe);
              }
              function B(g, x) {
                return g === x || g.nodeType === Z1 && g.parentNode === x;
              }
              function E(g, x, U, F, K) {
                var oe = F;
                if (!(x & x9) && !(x & Jf)) {
                  var ce = K;
                  if (F !== null) {
                    var Te = F;
                    e:
                      for (; ; ) {
                        if (Te === null)
                          return;
                        var Ce = Te.tag;
                        if (Ce === j || Ce === w) {
                          var tt = Te.stateNode.containerInfo;
                          if (B(tt, ce))
                            break;
                          if (Ce === w)
                            for (var ft = Te.return; ft !== null; ) {
                              var Rt = ft.tag;
                              if (Rt === j || Rt === w) {
                                var ct = ft.stateNode.containerInfo;
                                if (B(ct, ce))
                                  return;
                              }
                              ft = ft.return;
                            }
                          for (; tt !== null; ) {
                            var Ft = ll(tt);
                            if (Ft === null)
                              return;
                            var wr = Ft.tag;
                            if (wr === m || wr === I) {
                              Te = oe = Ft;
                              continue e;
                            }
                            tt = tt.parentNode;
                          }
                        }
                        Te = Te.return;
                      }
                  }
                }
                Fc(function() {
                  return q3(g, x, U, oe);
                });
              }
              function z(g, x, U) {
                return {
                  instance: g,
                  listener: x,
                  currentTarget: U
                };
              }
              function Ae(g, x, U, F, K) {
                for (var oe = x !== null ? x + "Capture" : null, ce = F ? oe : x, Te = [], Ce = g, tt = null; Ce !== null; ) {
                  var ft = Ce, Rt = ft.stateNode, ct = ft.tag;
                  if (ct === m && Rt !== null && (tt = Rt, ce !== null)) {
                    var Ft = Mu(Ce, ce);
                    Ft != null && Te.push(z(Ce, Ft, tt));
                  }
                  if (K)
                    break;
                  Ce = Ce.return;
                }
                return Te;
              }
              function pe(g, x) {
                for (var U = x + "Capture", F = [], K = g; K !== null; ) {
                  var oe = K, ce = oe.stateNode, Te = oe.tag;
                  if (Te === m && ce !== null) {
                    var Ce = ce, tt = Mu(K, U);
                    tt != null && F.unshift(z(K, tt, Ce));
                    var ft = Mu(K, x);
                    ft != null && F.push(z(K, ft, Ce));
                  }
                  K = K.return;
                }
                return F;
              }
              function Re(g) {
                if (g === null)
                  return null;
                do
                  g = g.return;
                while (g && g.tag !== m);
                return g || null;
              }
              function ot(g, x) {
                for (var U = g, F = x, K = 0, oe = U; oe; oe = Re(oe))
                  K++;
                for (var ce = 0, Te = F; Te; Te = Re(Te))
                  ce++;
                for (; K - ce > 0; )
                  U = Re(U), K--;
                for (; ce - K > 0; )
                  F = Re(F), ce--;
                for (var Ce = K; Ce--; ) {
                  if (U === F || F !== null && U === F.alternate)
                    return U;
                  U = Re(U), F = Re(F);
                }
                return null;
              }
              function lt(g, x, U, F, K) {
                for (var oe = x._reactName, ce = [], Te = U; Te !== null && Te !== F; ) {
                  var Ce = Te, tt = Ce.alternate, ft = Ce.stateNode, Rt = Ce.tag;
                  if (tt !== null && tt === F)
                    break;
                  if (Rt === m && ft !== null) {
                    var ct = ft;
                    if (K) {
                      var Ft = Mu(Te, oe);
                      Ft != null && ce.unshift(z(Te, Ft, ct));
                    } else if (!K) {
                      var wr = Mu(Te, oe);
                      wr != null && ce.push(z(Te, wr, ct));
                    }
                  }
                  Te = Te.return;
                }
                ce.length !== 0 && g.push({
                  event: x,
                  listeners: ce
                });
              }
              function Jt(g, x, U, F, K) {
                var oe = F && K ? ot(F, K) : null;
                F !== null && lt(g, x, F, oe, !1), K !== null && U !== null && lt(g, U, K, oe, !0);
              }
              function Wr(g, x) {
                return g + "__" + (x ? "capture" : "bubble");
              }
              var Xr = !1, Dr = "dangerouslySetInnerHTML", Tn = "suppressContentEditableWarning", In = "suppressHydrationWarning", Kn = "autoFocus", La = "children", mt = "style", pt = "__html", It = Gv.html, Qr, Jn, On, vi, Wi, Af, xs, pu, ch, RD;
              {
                Qr = {
                  // There are working polyfills for <dialog>. Let people use it.
                  dialog: !0,
                  // Electron ships a custom <webview> tag to display external web content in
                  // an isolated frame and process.
                  // This tag is not present in non Electron environments such as JSDom which
                  // is often used for testing purposes.
                  // @see https://electronjs.org/docs/api/webview-tag
                  webview: !0
                }, On = function(g, x) {
                  vt(g, x), Bt(g, x), ia(g, x, {
                    registrationNameDependencies: qe,
                    possibleRegistrationNames: ke
                  });
                }, pu = Ke && !document.documentMode;
                var kq = /\r\n?/g, VD = /\u0000|\uFFFD/g;
                ch = function(g) {
                  var x = typeof g == "string" ? g : "" + g;
                  return x.replace(kq, `
`).replace(VD, "");
                }, vi = function(g, x) {
                  if (!Xr) {
                    var U = ch(x), F = ch(g);
                    F !== U && (Xr = !0, c('Text content did not match. Server: "%s" Client: "%s"', F, U));
                  }
                }, Wi = function(g, x, U) {
                  if (!Xr) {
                    var F = ch(U), K = ch(x);
                    K !== F && (Xr = !0, c("Prop `%s` did not match. Server: %s Client: %s", g, JSON.stringify(K), JSON.stringify(F)));
                  }
                }, Af = function(g) {
                  if (!Xr) {
                    Xr = !0;
                    var x = [];
                    g.forEach(function(U) {
                      x.push(U);
                    }), c("Extra attributes from the server: %s", x);
                  }
                }, xs = function(g, x) {
                  x === !1 ? c("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", g, g, g) : c("Expected `%s` listener to be a function, instead got a value of `%s` type.", g, typeof x);
                }, RD = function(g, x) {
                  var U = g.namespaceURI === It ? g.ownerDocument.createElement(g.tagName) : g.ownerDocument.createElementNS(g.namespaceURI, g.tagName);
                  return U.innerHTML = x, U.innerHTML;
                };
              }
              function CD(g) {
                return g.nodeType === fA ? g : g.ownerDocument;
              }
              function OD() {
              }
              function _g(g) {
                g.onclick = OD;
              }
              function y4(g, x, U, F, K) {
                for (var oe in F)
                  if (F.hasOwnProperty(oe)) {
                    var ce = F[oe];
                    if (oe === mt)
                      ce && Object.freeze(ce), aP(x, ce);
                    else if (oe === Dr) {
                      var Te = ce ? ce[pt] : void 0;
                      Te != null && Uc(x, Te);
                    } else if (oe === La)
                      if (typeof ce == "string") {
                        var Ce = g !== "textarea" || ce !== "";
                        Ce && AA(x, ce);
                      } else
                        typeof ce == "number" && AA(x, "" + ce);
                    else
                      oe === Tn || oe === In || oe === Kn || (qe.hasOwnProperty(oe) ? ce != null && (typeof ce != "function" && xs(oe, ce), oe === "onScroll" && uo("scroll", x)) : ce != null && Rr(x, oe, ce, K));
                  }
              }
              function Jm(g, x, U, F) {
                for (var K = 0; K < x.length; K += 2) {
                  var oe = x[K], ce = x[K + 1];
                  oe === mt ? aP(g, ce) : oe === Dr ? Uc(g, ce) : oe === La ? AA(g, ce) : Rr(g, oe, ce, F);
                }
              }
              function zm(g, x, U, F) {
                var K, oe = CD(U), ce, Te = F;
                if (Te === It && (Te = _d(g)), Te === It) {
                  if (K = rv(g, x), !K && g !== g.toLowerCase() && c("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", g), g === "script") {
                    var Ce = oe.createElement("div");
                    Ce.innerHTML = "<script><\/script>";
                    var tt = Ce.firstChild;
                    ce = Ce.removeChild(tt);
                  } else if (typeof x.is == "string")
                    ce = oe.createElement(g, {
                      is: x.is
                    });
                  else if (ce = oe.createElement(g), g === "select") {
                    var ft = ce;
                    x.multiple ? ft.multiple = !0 : x.size && (ft.size = x.size);
                  }
                } else
                  ce = oe.createElementNS(Te, g);
                return Te === It && !K && Object.prototype.toString.call(ce) === "[object HTMLUnknownElement]" && !Object.prototype.hasOwnProperty.call(Qr, g) && (Qr[g] = !0, c("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", g)), ce;
              }
              function yD(g, x) {
                return CD(x).createTextNode(g);
              }
              function Gm(g, x, U, F) {
                var K = rv(x, U);
                On(x, U);
                var oe;
                switch (x) {
                  case "dialog":
                    uo("cancel", g), uo("close", g), oe = U;
                    break;
                  case "iframe":
                  case "object":
                  case "embed":
                    uo("load", g), oe = U;
                    break;
                  case "video":
                  case "audio":
                    for (var ce = 0; ce < hA.length; ce++)
                      uo(hA[ce], g);
                    oe = U;
                    break;
                  case "source":
                    uo("error", g), oe = U;
                    break;
                  case "img":
                  case "image":
                  case "link":
                    uo("error", g), uo("load", g), oe = U;
                    break;
                  case "details":
                    uo("toggle", g), oe = U;
                    break;
                  case "input":
                    Gs(g, U), oe = qi(g, U), uo("invalid", g);
                    break;
                  case "option":
                    _t(g, U), oe = fi(g, U);
                    break;
                  case "select":
                    Zs(g, U), oe = ws(g, U), uo("invalid", g);
                    break;
                  case "textarea":
                    $l(g, U), oe = Kv(g, U), uo("invalid", g);
                    break;
                  default:
                    oe = U;
                }
                switch (Rp(x, oe), y4(x, g, F, oe, K), x) {
                  case "input":
                    Pt(g), Ao(g, U, !1);
                    break;
                  case "textarea":
                    Pt(g), ld(g);
                    break;
                  case "option":
                    Cr(g, U);
                    break;
                  case "select":
                    Ia(g, U);
                    break;
                  default:
                    typeof oe.onClick == "function" && _g(g);
                    break;
                }
              }
              function kD(g, x, U, F, K) {
                On(x, F);
                var oe = null, ce, Te;
                switch (x) {
                  case "input":
                    ce = qi(g, U), Te = qi(g, F), oe = [];
                    break;
                  case "option":
                    ce = fi(g, U), Te = fi(g, F), oe = [];
                    break;
                  case "select":
                    ce = ws(g, U), Te = ws(g, F), oe = [];
                    break;
                  case "textarea":
                    ce = Kv(g, U), Te = Kv(g, F), oe = [];
                    break;
                  default:
                    ce = U, Te = F, typeof ce.onClick != "function" && typeof Te.onClick == "function" && _g(g);
                    break;
                }
                Rp(x, Te);
                var Ce, tt, ft = null;
                for (Ce in ce)
                  if (!(Te.hasOwnProperty(Ce) || !ce.hasOwnProperty(Ce) || ce[Ce] == null))
                    if (Ce === mt) {
                      var Rt = ce[Ce];
                      for (tt in Rt)
                        Rt.hasOwnProperty(tt) && (ft || (ft = {}), ft[tt] = "");
                    } else
                      Ce === Dr || Ce === La || Ce === Tn || Ce === In || Ce === Kn || (qe.hasOwnProperty(Ce) ? oe || (oe = []) : (oe = oe || []).push(Ce, null));
                for (Ce in Te) {
                  var ct = Te[Ce], Ft = ce != null ? ce[Ce] : void 0;
                  if (!(!Te.hasOwnProperty(Ce) || ct === Ft || ct == null && Ft == null))
                    if (Ce === mt)
                      if (ct && Object.freeze(ct), Ft) {
                        for (tt in Ft)
                          Ft.hasOwnProperty(tt) && (!ct || !ct.hasOwnProperty(tt)) && (ft || (ft = {}), ft[tt] = "");
                        for (tt in ct)
                          ct.hasOwnProperty(tt) && Ft[tt] !== ct[tt] && (ft || (ft = {}), ft[tt] = ct[tt]);
                      } else
                        ft || (oe || (oe = []), oe.push(Ce, ft)), ft = ct;
                    else if (Ce === Dr) {
                      var wr = ct ? ct[pt] : void 0, Yr = Ft ? Ft[pt] : void 0;
                      wr != null && Yr !== wr && (oe = oe || []).push(Ce, wr);
                    } else
                      Ce === La ? (typeof ct == "string" || typeof ct == "number") && (oe = oe || []).push(Ce, "" + ct) : Ce === Tn || Ce === In || (qe.hasOwnProperty(Ce) ? (ct != null && (typeof ct != "function" && xs(Ce, ct), Ce === "onScroll" && uo("scroll", g)), !oe && Ft !== ct && (oe = [])) : typeof ct == "object" && ct !== null && ct.$$typeof === cr ? ct.toString() : (oe = oe || []).push(Ce, ct));
                }
                return ft && (Ip(ft, Te[mt]), (oe = oe || []).push(mt, ft)), oe;
              }
              function Zm(g, x, U, F, K) {
                U === "input" && K.type === "radio" && K.name != null && ks(g, K);
                var oe = rv(U, F), ce = rv(U, K);
                switch (Jm(g, x, oe, ce), U) {
                  case "input":
                    Na(g, K);
                    break;
                  case "textarea":
                    V6(g, K);
                    break;
                  case "select":
                    cs(g, K);
                    break;
                }
              }
              function ph(g) {
                {
                  var x = g.toLowerCase();
                  return Oc.hasOwnProperty(x) && Oc[x] || null;
                }
              }
              function Eq(g, x, U, F, K) {
                var oe, ce;
                switch (Jn = U[In] === !0, oe = rv(x, U), On(x, U), x) {
                  case "dialog":
                    uo("cancel", g), uo("close", g);
                    break;
                  case "iframe":
                  case "object":
                  case "embed":
                    uo("load", g);
                    break;
                  case "video":
                  case "audio":
                    for (var Te = 0; Te < hA.length; Te++)
                      uo(hA[Te], g);
                    break;
                  case "source":
                    uo("error", g);
                    break;
                  case "img":
                  case "image":
                  case "link":
                    uo("error", g), uo("load", g);
                    break;
                  case "details":
                    uo("toggle", g);
                    break;
                  case "input":
                    Gs(g, U), uo("invalid", g);
                    break;
                  case "option":
                    _t(g, U);
                    break;
                  case "select":
                    Zs(g, U), uo("invalid", g);
                    break;
                  case "textarea":
                    $l(g, U), uo("invalid", g);
                    break;
                }
                Rp(x, U);
                {
                  ce = /* @__PURE__ */ new Set();
                  for (var Ce = g.attributes, tt = 0; tt < Ce.length; tt++) {
                    var ft = Ce[tt].name.toLowerCase();
                    switch (ft) {
                      case "data-reactroot":
                        break;
                      case "value":
                        break;
                      case "checked":
                        break;
                      case "selected":
                        break;
                      default:
                        ce.add(Ce[tt].name);
                    }
                  }
                }
                var Rt = null;
                for (var ct in U)
                  if (U.hasOwnProperty(ct)) {
                    var Ft = U[ct];
                    if (ct === La)
                      typeof Ft == "string" ? g.textContent !== Ft && (Jn || vi(g.textContent, Ft), Rt = [La, Ft]) : typeof Ft == "number" && g.textContent !== "" + Ft && (Jn || vi(g.textContent, Ft), Rt = [La, "" + Ft]);
                    else if (qe.hasOwnProperty(ct))
                      Ft != null && (typeof Ft != "function" && xs(ct, Ft), ct === "onScroll" && uo("scroll", g));
                    else if (
                      // Convince Flow we've calculated it (it's DEV-only in this method.)
                      typeof oe == "boolean"
                    ) {
                      var wr = void 0, Yr = sn(ct);
                      if (!Jn) {
                        if (!(ct === Tn || ct === In || // Controlled attributes are not validated
                        // TODO: Only ignore them on controlled tags.
                        ct === "value" || ct === "checked" || ct === "selected")) {
                          if (ct === Dr) {
                            var Si = g.innerHTML, os = Ft ? Ft[pt] : void 0;
                            if (os != null) {
                              var Ci = RD(g, os);
                              Ci !== Si && Wi(ct, Si, Ci);
                            }
                          } else if (ct === mt) {
                            if (ce.delete(ct), pu) {
                              var ea = Wp(Ft);
                              wr = g.getAttribute("style"), ea !== wr && Wi(ct, wr, ea);
                            }
                          } else if (oe)
                            ce.delete(ct.toLowerCase()), wr = as(g, ct, Ft), Ft !== wr && Wi(ct, wr, Ft);
                          else if (!xr(ct, Yr, oe) && !nn(ct, Ft, Yr, oe)) {
                            var to = !1;
                            if (Yr !== null)
                              ce.delete(Yr.attributeName), wr = ki(g, ct, Ft, Yr);
                            else {
                              var Nt = F;
                              if (Nt === It && (Nt = _d(x)), Nt === It)
                                ce.delete(ct.toLowerCase());
                              else {
                                var dr = ph(ct);
                                dr !== null && dr !== ct && (to = !0, ce.delete(dr)), ce.delete(ct);
                              }
                              wr = as(g, ct, Ft);
                            }
                            Ft !== wr && !to && Wi(ct, wr, Ft);
                          }
                        }
                      }
                    }
                  }
                switch (ce.size > 0 && !Jn && Af(ce), x) {
                  case "input":
                    Pt(g), Ao(g, U, !0);
                    break;
                  case "textarea":
                    Pt(g), ld(g);
                    break;
                  case "select":
                  case "option":
                    break;
                  default:
                    typeof U.onClick == "function" && _g(g);
                    break;
                }
                return Rt;
              }
              function $g(g, x) {
                var U = g.nodeValue !== x;
                return U;
              }
              function k4(g, x) {
                vi(g.nodeValue, x);
              }
              function ED(g, x) {
                {
                  if (Xr)
                    return;
                  Xr = !0, c("Did not expect server HTML to contain a <%s> in <%s>.", x.nodeName.toLowerCase(), g.nodeName.toLowerCase());
                }
              }
              function FD(g, x) {
                {
                  if (Xr)
                    return;
                  Xr = !0, c('Did not expect server HTML to contain the text node "%s" in <%s>.', x.nodeValue, g.nodeName.toLowerCase());
                }
              }
              function Fq(g, x, U) {
                {
                  if (Xr)
                    return;
                  Xr = !0, c("Expected server HTML to contain a matching <%s> in <%s>.", x, g.nodeName.toLowerCase());
                }
              }
              function ND(g, x) {
                {
                  if (x === "" || Xr)
                    return;
                  Xr = !0, c('Expected server HTML to contain a matching text node for "%s" in <%s>.', x, g.nodeName.toLowerCase());
                }
              }
              function hh(g, x, U) {
                switch (x) {
                  case "input":
                    Ro(g, U);
                    return;
                  case "textarea":
                    Jv(g, U);
                    return;
                  case "select":
                    ud(g, U);
                    return;
                }
              }
              var ul = function() {
              }, Hh = function() {
              };
              {
                var QD = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"], eX = [
                  "applet",
                  "caption",
                  "html",
                  "table",
                  "td",
                  "th",
                  "marquee",
                  "object",
                  "template",
                  // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
                  // TODO: Distinguish by namespace here -- for <title>, including it here
                  // errs on the side of fewer warnings
                  "foreignObject",
                  "desc",
                  "title"
                ], YD = eX.concat(["button"]), E4 = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"], Nq = {
                  current: null,
                  formTag: null,
                  aTagInScope: null,
                  buttonTagInScope: null,
                  nobrTagInScope: null,
                  pTagInButtonScope: null,
                  listItemTagAutoclosing: null,
                  dlItemTagAutoclosing: null
                };
                Hh = function(g, x) {
                  var U = v({}, g || Nq), F = {
                    tag: x
                  };
                  return eX.indexOf(x) !== -1 && (U.aTagInScope = null, U.buttonTagInScope = null, U.nobrTagInScope = null), YD.indexOf(x) !== -1 && (U.pTagInButtonScope = null), QD.indexOf(x) !== -1 && x !== "address" && x !== "div" && x !== "p" && (U.listItemTagAutoclosing = null, U.dlItemTagAutoclosing = null), U.current = F, x === "form" && (U.formTag = F), x === "a" && (U.aTagInScope = F), x === "button" && (U.buttonTagInScope = F), x === "nobr" && (U.nobrTagInScope = F), x === "p" && (U.pTagInButtonScope = F), x === "li" && (U.listItemTagAutoclosing = F), (x === "dd" || x === "dt") && (U.dlItemTagAutoclosing = F), U;
                };
                var MD = function(g, x) {
                  switch (x) {
                    case "select":
                      return g === "option" || g === "optgroup" || g === "#text";
                    case "optgroup":
                      return g === "option" || g === "#text";
                    case "option":
                      return g === "#text";
                    case "tr":
                      return g === "th" || g === "td" || g === "style" || g === "script" || g === "template";
                    case "tbody":
                    case "thead":
                    case "tfoot":
                      return g === "tr" || g === "style" || g === "script" || g === "template";
                    case "colgroup":
                      return g === "col" || g === "template";
                    case "table":
                      return g === "caption" || g === "colgroup" || g === "tbody" || g === "tfoot" || g === "thead" || g === "style" || g === "script" || g === "template";
                    case "head":
                      return g === "base" || g === "basefont" || g === "bgsound" || g === "link" || g === "meta" || g === "title" || g === "noscript" || g === "noframes" || g === "style" || g === "script" || g === "template";
                    case "html":
                      return g === "head" || g === "body" || g === "frameset";
                    case "frameset":
                      return g === "frame";
                    case "#document":
                      return g === "html";
                  }
                  switch (g) {
                    case "h1":
                    case "h2":
                    case "h3":
                    case "h4":
                    case "h5":
                    case "h6":
                      return x !== "h1" && x !== "h2" && x !== "h3" && x !== "h4" && x !== "h5" && x !== "h6";
                    case "rp":
                    case "rt":
                      return E4.indexOf(x) === -1;
                    case "body":
                    case "caption":
                    case "col":
                    case "colgroup":
                    case "frameset":
                    case "frame":
                    case "head":
                    case "html":
                    case "tbody":
                    case "td":
                    case "tfoot":
                    case "th":
                    case "thead":
                    case "tr":
                      return x == null;
                  }
                  return !0;
                }, Qq = function(g, x) {
                  switch (g) {
                    case "address":
                    case "article":
                    case "aside":
                    case "blockquote":
                    case "center":
                    case "details":
                    case "dialog":
                    case "dir":
                    case "div":
                    case "dl":
                    case "fieldset":
                    case "figcaption":
                    case "figure":
                    case "footer":
                    case "header":
                    case "hgroup":
                    case "main":
                    case "menu":
                    case "nav":
                    case "ol":
                    case "p":
                    case "section":
                    case "summary":
                    case "ul":
                    case "pre":
                    case "listing":
                    case "table":
                    case "hr":
                    case "xmp":
                    case "h1":
                    case "h2":
                    case "h3":
                    case "h4":
                    case "h5":
                    case "h6":
                      return x.pTagInButtonScope;
                    case "form":
                      return x.formTag || x.pTagInButtonScope;
                    case "li":
                      return x.listItemTagAutoclosing;
                    case "dd":
                    case "dt":
                      return x.dlItemTagAutoclosing;
                    case "button":
                      return x.buttonTagInScope;
                    case "a":
                      return x.aTagInScope;
                    case "nobr":
                      return x.nobrTagInScope;
                  }
                  return null;
                }, Yq = {};
                ul = function(g, x, U) {
                  U = U || Nq;
                  var F = U.current, K = F && F.tag;
                  x != null && (g != null && c("validateDOMNesting: when childText is passed, childTag should be null"), g = "#text");
                  var oe = MD(g, K) ? null : F, ce = oe ? null : Qq(g, U), Te = oe || ce;
                  if (Te) {
                    var Ce = Te.tag, tt = !!oe + "|" + g + "|" + Ce;
                    if (!Yq[tt]) {
                      Yq[tt] = !0;
                      var ft = g, Rt = "";
                      if (g === "#text" ? /\S/.test(x) ? ft = "Text nodes" : (ft = "Whitespace text nodes", Rt = " Make sure you don't have any extra whitespace between tags on each line of your source code.") : ft = "<" + g + ">", oe) {
                        var ct = "";
                        Ce === "table" && g === "tr" && (ct += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."), c("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", ft, Ce, Rt, ct);
                      } else
                        c("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", ft, Ce);
                    }
                  }
                };
              }
              var bd;
              bd = "suppressHydrationWarning";
              var Mq = "$", LD = "/$", Lq = "$?", x3 = "$!", Kq = "style", tX = null, Jq = null;
              function zq(g, x) {
                switch (g) {
                  case "button":
                  case "input":
                  case "select":
                  case "textarea":
                    return !!x.autoFocus;
                }
                return !1;
              }
              function _m(g) {
                var x, U, F = g.nodeType;
                switch (F) {
                  case fA:
                  case tP: {
                    x = F === fA ? "#document" : "#fragment";
                    var K = g.documentElement;
                    U = K ? K.namespaceURI : eP(null, "");
                    break;
                  }
                  default: {
                    var oe = F === Z1 ? g.parentNode : g, ce = oe.namespaceURI || null;
                    x = oe.tagName, U = eP(ce, x);
                    break;
                  }
                }
                {
                  var Te = x.toLowerCase(), Ce = Hh(null, Te);
                  return {
                    namespace: U,
                    ancestorInfo: Ce
                  };
                }
              }
              function ko(g, x, U) {
                {
                  var F = g, K = eP(F.namespace, x), oe = Hh(F.ancestorInfo, x);
                  return {
                    namespace: K,
                    ancestorInfo: oe
                  };
                }
              }
              function F4(g) {
                return g;
              }
              function N4(g) {
                tX = Cg(), Jq = DP();
                var x = null;
                return p7(!1), x;
              }
              function rX(g) {
                g3(Jq), p7(tX), tX = null, Jq = null;
              }
              function Q4(g, x, U, F, K) {
                var oe;
                {
                  var ce = F;
                  if (ul(g, null, ce.ancestorInfo), typeof x.children == "string" || typeof x.children == "number") {
                    var Te = "" + x.children, Ce = Hh(ce.ancestorInfo, g);
                    ul(null, Te, Ce);
                  }
                  oe = ce.namespace;
                }
                var tt = zm(g, x, U, oe);
                return L4(K, tt), PX(tt, x), tt;
              }
              function KD(g, x) {
                g.appendChild(x);
              }
              function Gq(g, x, U, F, K) {
                return Gm(g, x, U, F), zq(x, U);
              }
              function nX(g, x, U, F, K, oe) {
                {
                  var ce = oe;
                  if (typeof F.children != typeof U.children && (typeof F.children == "string" || typeof F.children == "number")) {
                    var Te = "" + F.children, Ce = Hh(ce.ancestorInfo, x);
                    ul(null, Te, Ce);
                  }
                }
                return kD(g, x, U, F);
              }
              function Zq(g, x) {
                return g === "textarea" || g === "option" || g === "noscript" || typeof x.children == "string" || typeof x.children == "number" || typeof x.dangerouslySetInnerHTML == "object" && x.dangerouslySetInnerHTML !== null && x.dangerouslySetInnerHTML.__html != null;
              }
              function Y4(g, x, U, F) {
                {
                  var K = U;
                  ul(null, g, K.ancestorInfo);
                }
                var oe = yD(g, x);
                return L4(F, oe), oe;
              }
              var gh = typeof setTimeout == "function" ? setTimeout : void 0, $m = typeof clearTimeout == "function" ? clearTimeout : void 0, iX = -1;
              function eB(g, x, U, F) {
                zq(x, U) && g.focus();
              }
              function JD(g, x, U, F, K, oe) {
                PX(g, K), Zm(g, x, U, F, K);
              }
              function HA(g) {
                AA(g, "");
              }
              function sX(g, x, U) {
                g.nodeValue = U;
              }
              function aX(g, x) {
                g.appendChild(x);
              }
              function D3(g, x) {
                var U;
                g.nodeType === Z1 ? (U = g.parentNode, U.insertBefore(x, g)) : (U = g, U.appendChild(x));
                var F = g._reactRootContainer;
                F == null && U.onclick === null && _g(U);
              }
              function zD(g, x, U) {
                g.insertBefore(x, U);
              }
              function Xh(g, x, U) {
                g.nodeType === Z1 ? g.parentNode.insertBefore(x, U) : g.insertBefore(x, U);
              }
              function Th(g, x) {
                g.removeChild(x);
              }
              function U7(g, x) {
                g.nodeType === Z1 ? g.parentNode.removeChild(x) : g.removeChild(x);
              }
              function _q(g) {
                g = g;
                var x = g.style;
                typeof x.setProperty == "function" ? x.setProperty("display", "none", "important") : x.display = "none";
              }
              function M4(g) {
                g.nodeValue = "";
              }
              function I7(g, x) {
                g = g;
                var U = x[Kq], F = U != null && U.hasOwnProperty("display") ? U.display : null;
                g.style.display = Xo("display", F);
              }
              function GD(g, x) {
                g.nodeValue = x;
              }
              function qh(g) {
                if (g.nodeType === t1)
                  g.textContent = "";
                else if (g.nodeType === fA) {
                  var x = g.body;
                  x != null && (x.textContent = "");
                }
              }
              function ZD(g, x, U) {
                return g.nodeType !== t1 || x.toLowerCase() !== g.nodeName.toLowerCase() ? null : g;
              }
              function $q(g, x) {
                return x === "" || g.nodeType !== Pd ? null : g;
              }
              function tB(g) {
                return g.data === Lq;
              }
              function rB(g) {
                return g.data === x3;
              }
              function oX(g) {
                for (; g != null; g = g.nextSibling) {
                  var x = g.nodeType;
                  if (x === t1 || x === Pd)
                    break;
                }
                return g;
              }
              function j3(g) {
                return oX(g.nextSibling);
              }
              function eb(g) {
                return oX(g.firstChild);
              }
              function nB(g, x, U, F, K, oe) {
                L4(oe, g), PX(g, U);
                var ce;
                {
                  var Te = K;
                  ce = Te.namespace;
                }
                return Eq(g, x, U, ce);
              }
              function R7(g, x, U) {
                return L4(U, g), $g(g, x);
              }
              function iB(g) {
                for (var x = g.nextSibling, U = 0; x; ) {
                  if (x.nodeType === Z1) {
                    var F = x.data;
                    if (F === LD) {
                      if (U === 0)
                        return j3(x);
                      U--;
                    } else
                      (F === Mq || F === x3 || F === Lq) && U++;
                  }
                  x = x.nextSibling;
                }
                return null;
              }
              function _D(g) {
                for (var x = g.previousSibling, U = 0; x; ) {
                  if (x.nodeType === Z1) {
                    var F = x.data;
                    if (F === Mq || F === x3 || F === Lq) {
                      if (U === 0)
                        return x;
                      U--;
                    } else
                      F === LD && U++;
                  }
                  x = x.previousSibling;
                }
                return null;
              }
              function sB(g) {
                n1(g);
              }
              function $D(g) {
                n1(g);
              }
              function aB(g, x, U) {
                k4(x, U);
              }
              function ej(g, x, U, F, K) {
                x[bd] !== !0 && k4(F, K);
              }
              function oB(g, x) {
                x.nodeType === t1 ? ED(g, x) : x.nodeType === Z1 || FD(g, x);
              }
              function fB(g, x, U, F) {
                x[bd] !== !0 && (F.nodeType === t1 ? ED(U, F) : F.nodeType === Z1 || FD(U, F));
              }
              function tj(g, x, U) {
                Fq(g, x);
              }
              function AB(g, x) {
                ND(g, x);
              }
              function tb(g, x, U, F, K) {
                x[bd] !== !0 && Fq(U, F);
              }
              function rb(g, x, U, F) {
                x[bd] !== !0 && ND(U, F);
              }
              function fX(g, x, U) {
                x[bd];
              }
              var nb = 0;
              function dB(g) {
                var x = "r:" + (nb++).toString(36);
                return {
                  toString: function() {
                    return g(), x;
                  },
                  valueOf: function() {
                    return g(), x;
                  }
                };
              }
              function AX(g) {
                return g !== null && typeof g == "object" && g.$$typeof === cr;
              }
              function dX(g) {
                return {
                  $$typeof: cr,
                  toString: g,
                  valueOf: g
                };
              }
              function vB(g) {
                O4(g);
              }
              var V7 = Math.random().toString(36).slice(2), vX = "__reactFiber$" + V7, ib = "__reactProps$" + V7, C7 = "__reactContainer$" + V7, rj = "__reactEvents$" + V7;
              function L4(g, x) {
                x[vX] = g;
              }
              function nj(g, x) {
                x[C7] = g;
              }
              function uX(g) {
                g[C7] = null;
              }
              function bh(g) {
                return !!g[C7];
              }
              function ll(g) {
                var x = g[vX];
                if (x)
                  return x;
                for (var U = g.parentNode; U; ) {
                  if (x = U[C7] || U[vX], x) {
                    var F = x.alternate;
                    if (x.child !== null || F !== null && F.child !== null)
                      for (var K = _D(g); K !== null; ) {
                        var oe = K[vX];
                        if (oe)
                          return oe;
                        K = _D(K);
                      }
                    return x;
                  }
                  g = U, U = g.parentNode;
                }
                return null;
              }
              function xd(g) {
                var x = g[vX] || g[C7];
                return x && (x.tag === m || x.tag === I || x.tag === ee || x.tag === j) ? x : null;
              }
              function Pl(g) {
                if (g.tag === m || g.tag === I)
                  return g.stateNode;
                throw Error("getNodeFromInstance: Invalid argument.");
              }
              function lX(g) {
                return g[ib] || null;
              }
              function PX(g, x) {
                g[ib] = x;
              }
              function K4(g) {
                var x = g[rj];
                return x === void 0 && (x = g[rj] = /* @__PURE__ */ new Set()), x;
              }
              var sb = {}, ij = P.ReactDebugCurrentFrame;
              function ab(g) {
                if (g) {
                  var x = g._owner, U = b9(g.type, g._source, x ? x.type : null);
                  ij.setExtraStackFrame(U);
                } else
                  ij.setExtraStackFrame(null);
              }
              function hu(g, x, U, F, K) {
                {
                  var oe = Function.call.bind(Object.prototype.hasOwnProperty);
                  for (var ce in g)
                    if (oe(g, ce)) {
                      var Te = void 0;
                      try {
                        if (typeof g[ce] != "function") {
                          var Ce = Error((F || "React class") + ": " + U + " type `" + ce + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof g[ce] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                          throw Ce.name = "Invariant Violation", Ce;
                        }
                        Te = g[ce](x, ce, F, U, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                      } catch (tt) {
                        Te = tt;
                      }
                      Te && !(Te instanceof Error) && (ab(K), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", F || "React class", U, ce, typeof Te), ab(null)), Te instanceof Error && !(Te.message in sb) && (sb[Te.message] = !0, ab(K), c("Failed %s type: %s", U, Te.message), ab(null));
                    }
                }
              }
              var ob = [], J4;
              J4 = [];
              var WP = -1;
              function w3(g) {
                return {
                  current: g
                };
              }
              function Q6(g, x) {
                if (WP < 0) {
                  c("Unexpected pop.");
                  return;
                }
                x !== J4[WP] && c("Unexpected Fiber popped."), g.current = ob[WP], ob[WP] = null, J4[WP] = null, WP--;
              }
              function t9(g, x, U) {
                WP++, ob[WP] = g.current, J4[WP] = U, g.current = x;
              }
              var fb;
              fb = {};
              var Dd = {};
              Object.freeze(Dd);
              var Hu = w3(Dd), gu = w3(!1), cX = Dd;
              function m3(g, x, U) {
                return U && cl(x) ? cX : Hu.current;
              }
              function sj(g, x, U) {
                {
                  var F = g.stateNode;
                  F.__reactInternalMemoizedUnmaskedChildContext = x, F.__reactInternalMemoizedMaskedChildContext = U;
                }
              }
              function O7(g, x) {
                {
                  var U = g.type, F = U.contextTypes;
                  if (!F)
                    return Dd;
                  var K = g.stateNode;
                  if (K && K.__reactInternalMemoizedUnmaskedChildContext === x)
                    return K.__reactInternalMemoizedMaskedChildContext;
                  var oe = {};
                  for (var ce in F)
                    oe[ce] = x[ce];
                  {
                    var Te = Zr(U) || "Unknown";
                    hu(F, oe, "context", Te);
                  }
                  return K && sj(g, x, oe), oe;
                }
              }
              function z4() {
                return gu.current;
              }
              function cl(g) {
                {
                  var x = g.childContextTypes;
                  return x != null;
                }
              }
              function y7(g) {
                Q6(gu, g), Q6(Hu, g);
              }
              function Ab(g) {
                Q6(gu, g), Q6(Hu, g);
              }
              function db(g, x, U) {
                {
                  if (Hu.current !== Dd)
                    throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
                  t9(Hu, x, g), t9(gu, U, g);
                }
              }
              function aj(g, x, U) {
                {
                  var F = g.stateNode, K = x.childContextTypes;
                  if (typeof F.getChildContext != "function") {
                    {
                      var oe = Zr(x) || "Unknown";
                      fb[oe] || (fb[oe] = !0, c("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", oe, oe));
                    }
                    return U;
                  }
                  var ce = F.getChildContext();
                  for (var Te in ce)
                    if (!(Te in K))
                      throw Error((Zr(x) || "Unknown") + '.getChildContext(): key "' + Te + '" is not defined in childContextTypes.');
                  {
                    var Ce = Zr(x) || "Unknown";
                    hu(K, ce, "child context", Ce);
                  }
                  return v({}, U, ce);
                }
              }
              function G4(g) {
                {
                  var x = g.stateNode, U = x && x.__reactInternalMemoizedMergedChildContext || Dd;
                  return cX = Hu.current, t9(Hu, U, g), t9(gu, gu.current, g), !0;
                }
              }
              function oj(g, x, U) {
                {
                  var F = g.stateNode;
                  if (!F)
                    throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
                  if (U) {
                    var K = aj(g, x, cX);
                    F.__reactInternalMemoizedMergedChildContext = K, Q6(gu, g), Q6(Hu, g), t9(Hu, K, g), t9(gu, U, g);
                  } else
                    Q6(gu, g), t9(gu, U, g);
                }
              }
              function fj(g) {
                {
                  if (!(xg(g) && g.tag === q))
                    throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
                  var x = g;
                  do {
                    switch (x.tag) {
                      case j:
                        return x.stateNode.context;
                      case q: {
                        var U = x.type;
                        if (cl(U))
                          return x.stateNode.__reactInternalMemoizedMergedChildContext;
                        break;
                      }
                    }
                    x = x.return;
                  } while (x !== null);
                  throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              var vb = 0, k7 = 1, Aj = 2, Z4 = null, pl = null, xh = !1, uB = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u";
              function lB(g) {
                if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u")
                  return !1;
                var x = __REACT_DEVTOOLS_GLOBAL_HOOK__;
                if (x.isDisabled)
                  return !0;
                if (!x.supportsFiber)
                  return c("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"), !0;
                try {
                  Z4 = x.inject(g), pl = x;
                } catch (U) {
                  c("React instrumentation encountered an error: %s.", U);
                }
                return !0;
              }
              function PB(g, x) {
                if (pl && typeof pl.onScheduleFiberRoot == "function")
                  try {
                    pl.onScheduleFiberRoot(Z4, g, x);
                  } catch (U) {
                    xh || (xh = !0, c("React instrumentation encountered an error: %s", U));
                  }
              }
              function cB(g, x) {
                if (pl && typeof pl.onCommitFiberRoot == "function")
                  try {
                    var U = (g.current.flags & bi) === bi;
                    Xe && pl.onCommitFiberRoot(Z4, g, x, U);
                  } catch (F) {
                    xh || (xh = !0, c("React instrumentation encountered an error: %s", F));
                  }
              }
              function dj(g) {
                if (pl && typeof pl.onCommitFiberUnmount == "function")
                  try {
                    pl.onCommitFiberUnmount(Z4, g);
                  } catch (x) {
                    xh || (xh = !0, c("React instrumentation encountered an error: %s", x));
                  }
              }
              var vj = u.unstable_runWithPriority, pX = u.unstable_scheduleCallback, uj = u.unstable_cancelCallback, pB = u.unstable_shouldYield, E7 = u.unstable_requestPaint, Dh = u.unstable_now, hB = u.unstable_getCurrentPriorityLevel, _4 = u.unstable_ImmediatePriority, lj = u.unstable_UserBlockingPriority, Pj = u.unstable_NormalPriority, ub = u.unstable_LowPriority, cj = u.unstable_IdlePriority;
              if (!(l.__interactionsRef != null && l.__interactionsRef.current != null))
                throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");
              var pj = {}, GA = 99, jh = 98, SP = 97, hj = 96, lb = 95, Pb = 90, HB = pB, cb = (
                // Fall back gracefully if we're running an older version of Scheduler.
                E7 !== void 0 ? E7 : function() {
                }
              ), UP = null, $4 = null, pb = !1, Hj = Dh(), Y6 = Hj < 1e4 ? Dh : function() {
                return Dh() - Hj;
              };
              function F7() {
                switch (hB()) {
                  case _4:
                    return GA;
                  case lj:
                    return jh;
                  case Pj:
                    return SP;
                  case ub:
                    return hj;
                  case cj:
                    return lb;
                  default:
                    throw Error("Unknown priority level.");
                }
              }
              function gj(g) {
                switch (g) {
                  case GA:
                    return _4;
                  case jh:
                    return lj;
                  case SP:
                    return Pj;
                  case hj:
                    return ub;
                  case lb:
                    return cj;
                  default:
                    throw Error("Unknown priority level.");
                }
              }
              function B3(g, x) {
                var U = gj(g);
                return vj(U, x);
              }
              function W3(g, x, U) {
                var F = gj(g);
                return pX(F, x, U);
              }
              function N7(g) {
                return UP === null ? (UP = [g], $4 = pX(_4, Q7)) : UP.push(g), pj;
              }
              function S3(g) {
                g !== pj && uj(g);
              }
              function Hv() {
                if ($4 !== null) {
                  var g = $4;
                  $4 = null, uj(g);
                }
                Q7();
              }
              function Q7() {
                if (!pb && UP !== null) {
                  pb = !0;
                  var g = 0;
                  try {
                    var x = !0, U = UP;
                    B3(GA, function() {
                      for (; g < U.length; g++) {
                        var F = U[g];
                        do
                          F = F(x);
                        while (F !== null);
                      }
                    }), UP = null;
                  } catch (F) {
                    throw UP !== null && (UP = UP.slice(g + 1)), pX(_4, Hv), F;
                  } finally {
                    pb = !1;
                  }
                }
              }
              var eT = "17.0.2", s1 = 0, E1 = 1, ZA = 2, Xu = 4, v6 = 8, Xj = 16, hX = P.ReactCurrentBatchConfig, wh = 0;
              function IP() {
                return hX.transition;
              }
              var M6 = {
                recordUnsafeLifecycleWarnings: function(g, x) {
                },
                flushPendingUnsafeLifecycleWarnings: function() {
                },
                recordLegacyContextWarning: function(g, x) {
                },
                flushLegacyContextWarning: function() {
                },
                discardPendingWarnings: function() {
                }
              };
              {
                var tT = function(g) {
                  for (var x = null, U = g; U !== null; )
                    U.mode & E1 && (x = U), U = U.return;
                  return x;
                }, RP = function(g) {
                  var x = [];
                  return g.forEach(function(U) {
                    x.push(U);
                  }), x.sort().join(", ");
                }, mh = [], Y7 = [], M7 = [], U3 = [], L6 = [], Bh = [], hl = /* @__PURE__ */ new Set();
                M6.recordUnsafeLifecycleWarnings = function(g, x) {
                  hl.has(g.type) || (typeof x.componentWillMount == "function" && // Don't warn about react-lifecycles-compat polyfilled components.
                  x.componentWillMount.__suppressDeprecationWarning !== !0 && mh.push(g), g.mode & E1 && typeof x.UNSAFE_componentWillMount == "function" && Y7.push(g), typeof x.componentWillReceiveProps == "function" && x.componentWillReceiveProps.__suppressDeprecationWarning !== !0 && M7.push(g), g.mode & E1 && typeof x.UNSAFE_componentWillReceiveProps == "function" && U3.push(g), typeof x.componentWillUpdate == "function" && x.componentWillUpdate.__suppressDeprecationWarning !== !0 && L6.push(g), g.mode & E1 && typeof x.UNSAFE_componentWillUpdate == "function" && Bh.push(g));
                }, M6.flushPendingUnsafeLifecycleWarnings = function() {
                  var g = /* @__PURE__ */ new Set();
                  mh.length > 0 && (mh.forEach(function(ct) {
                    g.add(Zr(ct.type) || "Component"), hl.add(ct.type);
                  }), mh = []);
                  var x = /* @__PURE__ */ new Set();
                  Y7.length > 0 && (Y7.forEach(function(ct) {
                    x.add(Zr(ct.type) || "Component"), hl.add(ct.type);
                  }), Y7 = []);
                  var U = /* @__PURE__ */ new Set();
                  M7.length > 0 && (M7.forEach(function(ct) {
                    U.add(Zr(ct.type) || "Component"), hl.add(ct.type);
                  }), M7 = []);
                  var F = /* @__PURE__ */ new Set();
                  U3.length > 0 && (U3.forEach(function(ct) {
                    F.add(Zr(ct.type) || "Component"), hl.add(ct.type);
                  }), U3 = []);
                  var K = /* @__PURE__ */ new Set();
                  L6.length > 0 && (L6.forEach(function(ct) {
                    K.add(Zr(ct.type) || "Component"), hl.add(ct.type);
                  }), L6 = []);
                  var oe = /* @__PURE__ */ new Set();
                  if (Bh.length > 0 && (Bh.forEach(function(ct) {
                    oe.add(Zr(ct.type) || "Component"), hl.add(ct.type);
                  }), Bh = []), x.size > 0) {
                    var ce = RP(x);
                    c(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.

Please update the following components: %s`, ce);
                  }
                  if (F.size > 0) {
                    var Te = RP(F);
                    c(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state

Please update the following components: %s`, Te);
                  }
                  if (oe.size > 0) {
                    var Ce = RP(oe);
                    c(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.

Please update the following components: %s`, Ce);
                  }
                  if (g.size > 0) {
                    var tt = RP(g);
                    p(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`, tt);
                  }
                  if (U.size > 0) {
                    var ft = RP(U);
                    p(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`, ft);
                  }
                  if (K.size > 0) {
                    var Rt = RP(K);
                    p(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`, Rt);
                  }
                };
                var jd = /* @__PURE__ */ new Map(), VP = /* @__PURE__ */ new Set();
                M6.recordLegacyContextWarning = function(g, x) {
                  var U = tT(g);
                  if (U === null) {
                    c("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
                    return;
                  }
                  if (!VP.has(g.type)) {
                    var F = jd.get(U);
                    (g.type.contextTypes != null || g.type.childContextTypes != null || x !== null && typeof x.getChildContext == "function") && (F === void 0 && (F = [], jd.set(U, F)), F.push(g));
                  }
                }, M6.flushLegacyContextWarning = function() {
                  jd.forEach(function(g, x) {
                    if (g.length !== 0) {
                      var U = g[0], F = /* @__PURE__ */ new Set();
                      g.forEach(function(oe) {
                        F.add(Zr(oe.type) || "Component"), VP.add(oe.type);
                      });
                      var K = RP(F);
                      try {
                        Sa(U), c(`Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: %s

Learn more about this warning here: https://reactjs.org/link/legacy-context`, K);
                      } finally {
                        Fa();
                      }
                    }
                  });
                }, M6.discardPendingWarnings = function() {
                  mh = [], Y7 = [], M7 = [], U3 = [], L6 = [], Bh = [], jd = /* @__PURE__ */ new Map();
                };
              }
              function xo(g, x) {
                if (g && g.defaultProps) {
                  var U = v({}, x), F = g.defaultProps;
                  for (var K in F)
                    U[K] === void 0 && (U[K] = F[K]);
                  return U;
                }
                return x;
              }
              var Rf = 1073741823, HX = w3(null), gA;
              gA = {};
              var gv = null, K6 = null, L7 = null, CP = !1;
              function gX() {
                gv = null, K6 = null, L7 = null, CP = !1;
              }
              function Wh() {
                CP = !0;
              }
              function XX() {
                CP = !1;
              }
              function Xv(g, x) {
                var U = g.type._context;
                t9(HX, U._currentValue, g), U._currentValue = x, U._currentRenderer !== void 0 && U._currentRenderer !== null && U._currentRenderer !== gA && c("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."), U._currentRenderer = gA;
              }
              function K7(g) {
                var x = HX.current;
                Q6(HX, g);
                var U = g.type._context;
                U._currentValue = x;
              }
              function hb(g, x, U) {
                if (e9(U, x))
                  return 0;
                var F = typeof g._calculateChangedBits == "function" ? g._calculateChangedBits(U, x) : Rf;
                return (F & Rf) !== F && c("calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s", F), F | 0;
              }
              function Hb(g, x) {
                for (var U = g; U !== null; ) {
                  var F = U.alternate;
                  if (!pP(U.childLanes, x))
                    U.childLanes = ca(U.childLanes, x), F !== null && (F.childLanes = ca(F.childLanes, x));
                  else if (F !== null && !pP(F.childLanes, x))
                    F.childLanes = ca(F.childLanes, x);
                  else
                    break;
                  U = U.return;
                }
              }
              function Tj(g, x, U, F) {
                var K = g.child;
                for (K !== null && (K.return = g); K !== null; ) {
                  var oe = void 0, ce = K.dependencies;
                  if (ce !== null) {
                    oe = K.child;
                    for (var Te = ce.firstContext; Te !== null; ) {
                      if (Te.context === x && Te.observedBits & U) {
                        if (K.tag === q) {
                          var Ce = XA(_a, V1(F));
                          Ce.tag = Sh, wd(K, Ce);
                        }
                        K.lanes = ca(K.lanes, F);
                        var tt = K.alternate;
                        tt !== null && (tt.lanes = ca(tt.lanes, F)), Hb(K.return, F), ce.lanes = ca(ce.lanes, F);
                        break;
                      }
                      Te = Te.next;
                    }
                  } else
                    K.tag === y ? oe = K.type === g.type ? null : K.child : oe = K.child;
                  if (oe !== null)
                    oe.return = K;
                  else
                    for (oe = K; oe !== null; ) {
                      if (oe === g) {
                        oe = null;
                        break;
                      }
                      var ft = oe.sibling;
                      if (ft !== null) {
                        ft.return = oe.return, oe = ft;
                        break;
                      }
                      oe = oe.return;
                    }
                  K = oe;
                }
              }
              function OP(g, x) {
                gv = g, K6 = null, L7 = null;
                var U = g.dependencies;
                if (U !== null) {
                  var F = U.firstContext;
                  F !== null && (nf(U.lanes, x) && KX(), U.firstContext = null);
                }
              }
              function F1(g, x) {
                if (CP && c("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."), L7 !== g) {
                  if (!(x === !1 || x === 0)) {
                    var U;
                    typeof x != "number" || x === Rf ? (L7 = g, U = Rf) : U = x;
                    var F = {
                      context: g,
                      observedBits: U,
                      next: null
                    };
                    if (K6 === null) {
                      if (gv === null)
                        throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
                      K6 = F, gv.dependencies = {
                        lanes: Zt,
                        firstContext: F,
                        responders: null
                      };
                    } else
                      K6 = K6.next = F;
                  }
                }
                return g._currentValue;
              }
              var qj = 0, yP = 1, Sh = 2, Tv = 3, J7 = !1, z7, TX;
              z7 = !1, TX = null;
              function gb(g) {
                var x = {
                  baseState: g.memoizedState,
                  firstBaseUpdate: null,
                  lastBaseUpdate: null,
                  shared: {
                    pending: null
                  },
                  effects: null
                };
                g.updateQueue = x;
              }
              function rT(g, x) {
                var U = x.updateQueue, F = g.updateQueue;
                if (U === F) {
                  var K = {
                    baseState: F.baseState,
                    firstBaseUpdate: F.firstBaseUpdate,
                    lastBaseUpdate: F.lastBaseUpdate,
                    shared: F.shared,
                    effects: F.effects
                  };
                  x.updateQueue = K;
                }
              }
              function XA(g, x) {
                var U = {
                  eventTime: g,
                  lane: x,
                  tag: qj,
                  payload: null,
                  callback: null,
                  next: null
                };
                return U;
              }
              function wd(g, x) {
                var U = g.updateQueue;
                if (U !== null) {
                  var F = U.shared, K = F.pending;
                  K === null ? x.next = x : (x.next = K.next, K.next = x), F.pending = x, TX === F && !z7 && (c("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."), z7 = !0);
                }
              }
              function I3(g, x) {
                var U = g.updateQueue, F = g.alternate;
                if (F !== null) {
                  var K = F.updateQueue;
                  if (U === K) {
                    var oe = null, ce = null, Te = U.firstBaseUpdate;
                    if (Te !== null) {
                      var Ce = Te;
                      do {
                        var tt = {
                          eventTime: Ce.eventTime,
                          lane: Ce.lane,
                          tag: Ce.tag,
                          payload: Ce.payload,
                          callback: Ce.callback,
                          next: null
                        };
                        ce === null ? oe = ce = tt : (ce.next = tt, ce = tt), Ce = Ce.next;
                      } while (Ce !== null);
                      ce === null ? oe = ce = x : (ce.next = x, ce = x);
                    } else
                      oe = ce = x;
                    U = {
                      baseState: K.baseState,
                      firstBaseUpdate: oe,
                      lastBaseUpdate: ce,
                      shared: K.shared,
                      effects: K.effects
                    }, g.updateQueue = U;
                    return;
                  }
                }
                var ft = U.lastBaseUpdate;
                ft === null ? U.firstBaseUpdate = x : ft.next = x, U.lastBaseUpdate = x;
              }
              function nT(g, x, U, F, K, oe) {
                switch (U.tag) {
                  case yP: {
                    var ce = U.payload;
                    if (typeof ce == "function") {
                      Wh();
                      var Te = ce.call(oe, F, K);
                      {
                        if (g.mode & E1) {
                          qa();
                          try {
                            ce.call(oe, F, K);
                          } finally {
                            m1();
                          }
                        }
                        XX();
                      }
                      return Te;
                    }
                    return ce;
                  }
                  case Tv:
                    g.flags = g.flags & ~QA | bi;
                  case qj: {
                    var Ce = U.payload, tt;
                    if (typeof Ce == "function") {
                      Wh(), tt = Ce.call(oe, F, K);
                      {
                        if (g.mode & E1) {
                          qa();
                          try {
                            Ce.call(oe, F, K);
                          } finally {
                            m1();
                          }
                        }
                        XX();
                      }
                    } else
                      tt = Ce;
                    return tt == null ? F : v({}, F, tt);
                  }
                  case Sh:
                    return J7 = !0, F;
                }
                return F;
              }
              function R3(g, x, U, F) {
                var K = g.updateQueue;
                J7 = !1, TX = K.shared;
                var oe = K.firstBaseUpdate, ce = K.lastBaseUpdate, Te = K.shared.pending;
                if (Te !== null) {
                  K.shared.pending = null;
                  var Ce = Te, tt = Ce.next;
                  Ce.next = null, ce === null ? oe = tt : ce.next = tt, ce = Ce;
                  var ft = g.alternate;
                  if (ft !== null) {
                    var Rt = ft.updateQueue, ct = Rt.lastBaseUpdate;
                    ct !== ce && (ct === null ? Rt.firstBaseUpdate = tt : ct.next = tt, Rt.lastBaseUpdate = Ce);
                  }
                }
                if (oe !== null) {
                  var Ft = K.baseState, wr = Zt, Yr = null, Si = null, os = null, Ci = oe;
                  do {
                    var ea = Ci.lane, to = Ci.eventTime;
                    if (pP(F, ea)) {
                      if (os !== null) {
                        var dr = {
                          eventTime: to,
                          // This update is going to be committed so we never want uncommit
                          // it. Using NoLane works because 0 is a subset of all bitmasks, so
                          // this will never be skipped by the check above.
                          lane: Ln,
                          tag: Ci.tag,
                          payload: Ci.payload,
                          callback: Ci.callback,
                          next: null
                        };
                        os = os.next = dr;
                      }
                      Ft = nT(g, K, Ci, Ft, x, U);
                      var ht = Ci.callback;
                      if (ht !== null) {
                        g.flags |= _s;
                        var Or = K.effects;
                        Or === null ? K.effects = [Ci] : Or.push(Ci);
                      }
                    } else {
                      var Nt = {
                        eventTime: to,
                        lane: ea,
                        tag: Ci.tag,
                        payload: Ci.payload,
                        callback: Ci.callback,
                        next: null
                      };
                      os === null ? (Si = os = Nt, Yr = Ft) : os = os.next = Nt, wr = ca(wr, ea);
                    }
                    if (Ci = Ci.next, Ci === null) {
                      if (Te = K.shared.pending, Te === null)
                        break;
                      var hn = Te, Nn = hn.next;
                      hn.next = null, Ci = Nn, K.lastBaseUpdate = hn, K.shared.pending = null;
                    }
                  } while (!0);
                  os === null && (Yr = Ft), K.baseState = Yr, K.firstBaseUpdate = Si, K.lastBaseUpdate = os, Cf(wr), g.lanes = wr, g.memoizedState = Ft;
                }
                TX = null;
              }
              function qv(g, x) {
                if (typeof g != "function")
                  throw Error("Invalid argument passed as callback. Expected a function. Instead received: " + g);
                g.call(x);
              }
              function J6() {
                J7 = !1;
              }
              function Hl() {
                return J7;
              }
              function gl(g, x, U) {
                var F = x.effects;
                if (x.effects = null, F !== null)
                  for (var K = 0; K < F.length; K++) {
                    var oe = F[K], ce = oe.callback;
                    ce !== null && (oe.callback = null, qv(ce, U));
                  }
              }
              var Tu = {}, gB = Array.isArray, bj = new d.Component().refs, Xb, kP, iT, qX, G7, xj, Z7, sT, Tb, EP;
              {
                Xb = /* @__PURE__ */ new Set(), kP = /* @__PURE__ */ new Set(), iT = /* @__PURE__ */ new Set(), qX = /* @__PURE__ */ new Set(), sT = /* @__PURE__ */ new Set(), G7 = /* @__PURE__ */ new Set(), Tb = /* @__PURE__ */ new Set(), EP = /* @__PURE__ */ new Set();
                var r9 = /* @__PURE__ */ new Set();
                Z7 = function(g, x) {
                  if (!(g === null || typeof g == "function")) {
                    var U = x + "_" + g;
                    r9.has(U) || (r9.add(U), c("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", x, g));
                  }
                }, xj = function(g, x) {
                  if (x === void 0) {
                    var U = Zr(g) || "Component";
                    G7.has(U) || (G7.add(U), c("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", U));
                  }
                }, Object.defineProperty(Tu, "_processChildContext", {
                  enumerable: !1,
                  value: function() {
                    throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
                  }
                }), Object.freeze(Tu);
              }
              function TA(g, x, U, F) {
                var K = g.memoizedState;
                if (g.mode & E1) {
                  qa();
                  try {
                    U(F, K);
                  } finally {
                    m1();
                  }
                }
                var oe = U(F, K);
                xj(x, oe);
                var ce = oe == null ? K : v({}, K, oe);
                if (g.memoizedState = ce, g.lanes === Zt) {
                  var Te = g.updateQueue;
                  Te.baseState = ce;
                }
              }
              var md = {
                isMounted: $9,
                enqueueSetState: function(g, x, U) {
                  var F = Gu(g), K = Vd(), oe = $3(F), ce = XA(K, oe);
                  ce.payload = x, U != null && (Z7(U, "setState"), ce.callback = U), wd(F, ce), W9(F, oe, K);
                },
                enqueueReplaceState: function(g, x, U) {
                  var F = Gu(g), K = Vd(), oe = $3(F), ce = XA(K, oe);
                  ce.tag = yP, ce.payload = x, U != null && (Z7(U, "replaceState"), ce.callback = U), wd(F, ce), W9(F, oe, K);
                },
                enqueueForceUpdate: function(g, x) {
                  var U = Gu(g), F = Vd(), K = $3(U), oe = XA(F, K);
                  oe.tag = Sh, x != null && (Z7(x, "forceUpdate"), oe.callback = x), wd(U, oe), W9(U, K, F);
                }
              };
              function V3(g, x, U, F, K, oe, ce) {
                var Te = g.stateNode;
                if (typeof Te.shouldComponentUpdate == "function") {
                  if (g.mode & E1) {
                    qa();
                    try {
                      Te.shouldComponentUpdate(F, oe, ce);
                    } finally {
                      m1();
                    }
                  }
                  var Ce = Te.shouldComponentUpdate(F, oe, ce);
                  return Ce === void 0 && c("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", Zr(x) || "Component"), Ce;
                }
                return x.prototype && x.prototype.isPureReactComponent ? !$a(U, F) || !$a(K, oe) : !0;
              }
              function C3(g, x, U) {
                var F = g.stateNode;
                {
                  var K = Zr(x) || "Component", oe = F.render;
                  oe || (x.prototype && typeof x.prototype.render == "function" ? c("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", K) : c("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", K)), F.getInitialState && !F.getInitialState.isReactClassApproved && !F.state && c("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", K), F.getDefaultProps && !F.getDefaultProps.isReactClassApproved && c("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", K), F.propTypes && c("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", K), F.contextType && c("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", K), F.contextTypes && c("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", K), x.contextType && x.contextTypes && !Tb.has(x) && (Tb.add(x), c("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", K)), typeof F.componentShouldUpdate == "function" && c("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", K), x.prototype && x.prototype.isPureReactComponent && typeof F.shouldComponentUpdate < "u" && c("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", Zr(x) || "A pure component"), typeof F.componentDidUnmount == "function" && c("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", K), typeof F.componentDidReceiveProps == "function" && c("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", K), typeof F.componentWillRecieveProps == "function" && c("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", K), typeof F.UNSAFE_componentWillRecieveProps == "function" && c("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", K);
                  var ce = F.props !== U;
                  F.props !== void 0 && ce && c("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", K, K), F.defaultProps && c("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", K, K), typeof F.getSnapshotBeforeUpdate == "function" && typeof F.componentDidUpdate != "function" && !iT.has(x) && (iT.add(x), c("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", Zr(x))), typeof F.getDerivedStateFromProps == "function" && c("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", K), typeof F.getDerivedStateFromError == "function" && c("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", K), typeof x.getSnapshotBeforeUpdate == "function" && c("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", K);
                  var Te = F.state;
                  Te && (typeof Te != "object" || gB(Te)) && c("%s.state: must be set to an object or null", K), typeof F.getChildContext == "function" && typeof x.childContextTypes != "object" && c("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", K);
                }
              }
              function Dj(g, x) {
                x.updater = md, g.stateNode = x, bg(x, g), x._reactInternalInstance = Tu;
              }
              function aT(g, x, U) {
                var F = !1, K = Dd, oe = Dd, ce = x.contextType;
                if ("contextType" in x) {
                  var Te = (
                    // Allow null for conditional declaration
                    ce === null || ce !== void 0 && ce.$$typeof === Fr && ce._context === void 0
                  );
                  if (!Te && !EP.has(x)) {
                    EP.add(x);
                    var Ce = "";
                    ce === void 0 ? Ce = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : typeof ce != "object" ? Ce = " However, it is set to a " + typeof ce + "." : ce.$$typeof === vr ? Ce = " Did you accidentally pass the Context.Provider instead?" : ce._context !== void 0 ? Ce = " Did you accidentally pass the Context.Consumer instead?" : Ce = " However, it is set to an object with keys {" + Object.keys(ce).join(", ") + "}.", c("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", Zr(x) || "Component", Ce);
                  }
                }
                if (typeof ce == "object" && ce !== null)
                  oe = F1(ce);
                else {
                  K = m3(g, x, !0);
                  var tt = x.contextTypes;
                  F = tt != null, oe = F ? O7(g, K) : Dd;
                }
                if (g.mode & E1) {
                  qa();
                  try {
                    new x(U, oe);
                  } finally {
                    m1();
                  }
                }
                var ft = new x(U, oe), Rt = g.memoizedState = ft.state !== null && ft.state !== void 0 ? ft.state : null;
                Dj(g, ft);
                {
                  if (typeof x.getDerivedStateFromProps == "function" && Rt === null) {
                    var ct = Zr(x) || "Component";
                    kP.has(ct) || (kP.add(ct), c("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", ct, ft.state === null ? "null" : "undefined", ct));
                  }
                  if (typeof x.getDerivedStateFromProps == "function" || typeof ft.getSnapshotBeforeUpdate == "function") {
                    var Ft = null, wr = null, Yr = null;
                    if (typeof ft.componentWillMount == "function" && ft.componentWillMount.__suppressDeprecationWarning !== !0 ? Ft = "componentWillMount" : typeof ft.UNSAFE_componentWillMount == "function" && (Ft = "UNSAFE_componentWillMount"), typeof ft.componentWillReceiveProps == "function" && ft.componentWillReceiveProps.__suppressDeprecationWarning !== !0 ? wr = "componentWillReceiveProps" : typeof ft.UNSAFE_componentWillReceiveProps == "function" && (wr = "UNSAFE_componentWillReceiveProps"), typeof ft.componentWillUpdate == "function" && ft.componentWillUpdate.__suppressDeprecationWarning !== !0 ? Yr = "componentWillUpdate" : typeof ft.UNSAFE_componentWillUpdate == "function" && (Yr = "UNSAFE_componentWillUpdate"), Ft !== null || wr !== null || Yr !== null) {
                      var Si = Zr(x) || "Component", os = typeof x.getDerivedStateFromProps == "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
                      qX.has(Si) || (qX.add(Si), c(`Unsafe legacy lifecycles will not be called for components using new component APIs.

%s uses %s but also contains the following legacy lifecycles:%s%s%s

The above lifecycles should be removed. Learn more about this warning here:
https://reactjs.org/link/unsafe-component-lifecycles`, Si, os, Ft !== null ? `
  ` + Ft : "", wr !== null ? `
  ` + wr : "", Yr !== null ? `
  ` + Yr : ""));
                    }
                  }
                }
                return F && sj(g, K, oe), ft;
              }
              function XB(g, x) {
                var U = x.state;
                typeof x.componentWillMount == "function" && x.componentWillMount(), typeof x.UNSAFE_componentWillMount == "function" && x.UNSAFE_componentWillMount(), U !== x.state && (c("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", Zr(g.type) || "Component"), md.enqueueReplaceState(x, x.state, null));
              }
              function jj(g, x, U, F) {
                var K = x.state;
                if (typeof x.componentWillReceiveProps == "function" && x.componentWillReceiveProps(U, F), typeof x.UNSAFE_componentWillReceiveProps == "function" && x.UNSAFE_componentWillReceiveProps(U, F), x.state !== K) {
                  {
                    var oe = Zr(g.type) || "Component";
                    Xb.has(oe) || (Xb.add(oe), c("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", oe));
                  }
                  md.enqueueReplaceState(x, x.state, null);
                }
              }
              function oT(g, x, U, F) {
                C3(g, x, U);
                var K = g.stateNode;
                K.props = U, K.state = g.memoizedState, K.refs = bj, gb(g);
                var oe = x.contextType;
                if (typeof oe == "object" && oe !== null)
                  K.context = F1(oe);
                else {
                  var ce = m3(g, x, !0);
                  K.context = O7(g, ce);
                }
                {
                  if (K.state === U) {
                    var Te = Zr(x) || "Component";
                    sT.has(Te) || (sT.add(Te), c("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", Te));
                  }
                  g.mode & E1 && M6.recordLegacyContextWarning(g, K), M6.recordUnsafeLifecycleWarnings(g, K);
                }
                R3(g, U, K, F), K.state = g.memoizedState;
                var Ce = x.getDerivedStateFromProps;
                typeof Ce == "function" && (TA(g, x, Ce, U), K.state = g.memoizedState), typeof x.getDerivedStateFromProps != "function" && typeof K.getSnapshotBeforeUpdate != "function" && (typeof K.UNSAFE_componentWillMount == "function" || typeof K.componentWillMount == "function") && (XB(g, K), R3(g, U, K, F), K.state = g.memoizedState), typeof K.componentDidMount == "function" && (g.flags |= fn);
              }
              function wj(g, x, U, F) {
                var K = g.stateNode, oe = g.memoizedProps;
                K.props = oe;
                var ce = K.context, Te = x.contextType, Ce = Dd;
                if (typeof Te == "object" && Te !== null)
                  Ce = F1(Te);
                else {
                  var tt = m3(g, x, !0);
                  Ce = O7(g, tt);
                }
                var ft = x.getDerivedStateFromProps, Rt = typeof ft == "function" || typeof K.getSnapshotBeforeUpdate == "function";
                !Rt && (typeof K.UNSAFE_componentWillReceiveProps == "function" || typeof K.componentWillReceiveProps == "function") && (oe !== U || ce !== Ce) && jj(g, K, U, Ce), J6();
                var ct = g.memoizedState, Ft = K.state = ct;
                if (R3(g, U, K, F), Ft = g.memoizedState, oe === U && ct === Ft && !z4() && !Hl())
                  return typeof K.componentDidMount == "function" && (g.flags |= fn), !1;
                typeof ft == "function" && (TA(g, x, ft, U), Ft = g.memoizedState);
                var wr = Hl() || V3(g, x, oe, U, ct, Ft, Ce);
                return wr ? (!Rt && (typeof K.UNSAFE_componentWillMount == "function" || typeof K.componentWillMount == "function") && (typeof K.componentWillMount == "function" && K.componentWillMount(), typeof K.UNSAFE_componentWillMount == "function" && K.UNSAFE_componentWillMount()), typeof K.componentDidMount == "function" && (g.flags |= fn)) : (typeof K.componentDidMount == "function" && (g.flags |= fn), g.memoizedProps = U, g.memoizedState = Ft), K.props = U, K.state = Ft, K.context = Ce, wr;
              }
              function qb(g, x, U, F, K) {
                var oe = x.stateNode;
                rT(g, x);
                var ce = x.memoizedProps, Te = x.type === x.elementType ? ce : xo(x.type, ce);
                oe.props = Te;
                var Ce = x.pendingProps, tt = oe.context, ft = U.contextType, Rt = Dd;
                if (typeof ft == "object" && ft !== null)
                  Rt = F1(ft);
                else {
                  var ct = m3(x, U, !0);
                  Rt = O7(x, ct);
                }
                var Ft = U.getDerivedStateFromProps, wr = typeof Ft == "function" || typeof oe.getSnapshotBeforeUpdate == "function";
                !wr && (typeof oe.UNSAFE_componentWillReceiveProps == "function" || typeof oe.componentWillReceiveProps == "function") && (ce !== Ce || tt !== Rt) && jj(x, oe, F, Rt), J6();
                var Yr = x.memoizedState, Si = oe.state = Yr;
                if (R3(x, F, oe, K), Si = x.memoizedState, ce === Ce && Yr === Si && !z4() && !Hl())
                  return typeof oe.componentDidUpdate == "function" && (ce !== g.memoizedProps || Yr !== g.memoizedState) && (x.flags |= fn), typeof oe.getSnapshotBeforeUpdate == "function" && (ce !== g.memoizedProps || Yr !== g.memoizedState) && (x.flags |= xi), !1;
                typeof Ft == "function" && (TA(x, U, Ft, F), Si = x.memoizedState);
                var os = Hl() || V3(x, U, Te, F, Yr, Si, Rt);
                return os ? (!wr && (typeof oe.UNSAFE_componentWillUpdate == "function" || typeof oe.componentWillUpdate == "function") && (typeof oe.componentWillUpdate == "function" && oe.componentWillUpdate(F, Si, Rt), typeof oe.UNSAFE_componentWillUpdate == "function" && oe.UNSAFE_componentWillUpdate(F, Si, Rt)), typeof oe.componentDidUpdate == "function" && (x.flags |= fn), typeof oe.getSnapshotBeforeUpdate == "function" && (x.flags |= xi)) : (typeof oe.componentDidUpdate == "function" && (ce !== g.memoizedProps || Yr !== g.memoizedState) && (x.flags |= fn), typeof oe.getSnapshotBeforeUpdate == "function" && (ce !== g.memoizedProps || Yr !== g.memoizedState) && (x.flags |= xi), x.memoizedProps = F, x.memoizedState = Si), oe.props = F, oe.state = Si, oe.context = Rt, os;
              }
              var bX, xX, fT, DX, jX, AT = function(g, x) {
              };
              bX = !1, xX = !1, fT = {}, DX = {}, jX = {}, AT = function(g, x) {
                if (!(g === null || typeof g != "object") && !(!g._store || g._store.validated || g.key != null)) {
                  if (typeof g._store != "object")
                    throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
                  g._store.validated = !0;
                  var U = Zr(x.type) || "Component";
                  DX[U] || (DX[U] = !0, c('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'));
                }
              };
              var dT = Array.isArray;
              function _7(g, x, U) {
                var F = U.ref;
                if (F !== null && typeof F != "function" && typeof F != "object") {
                  if ((g.mode & E1 || re) && // We warn in ReactElement.js if owner and self are equal for string refs
                  // because these cannot be automatically converted to an arrow function
                  // using a codemod. Therefore, we don't have to warn about string refs again.
                  !(U._owner && U._self && U._owner.stateNode !== U._self)) {
                    var K = Zr(g.type) || "Component";
                    fT[K] || (c('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', F), fT[K] = !0);
                  }
                  if (U._owner) {
                    var oe = U._owner, ce;
                    if (oe) {
                      var Te = oe;
                      if (Te.tag !== q)
                        throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
                      ce = Te.stateNode;
                    }
                    if (!ce)
                      throw Error("Missing owner for string ref " + F + ". This error is likely caused by a bug in React. Please file an issue.");
                    var Ce = "" + F;
                    if (x !== null && x.ref !== null && typeof x.ref == "function" && x.ref._stringRef === Ce)
                      return x.ref;
                    var tt = function(ft) {
                      var Rt = ce.refs;
                      Rt === bj && (Rt = ce.refs = {}), ft === null ? delete Rt[Ce] : Rt[Ce] = ft;
                    };
                    return tt._stringRef = Ce, tt;
                  } else {
                    if (typeof F != "string")
                      throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
                    if (!U._owner)
                      throw Error("Element ref was specified as a string (" + F + `) but no owner was set. This could happen for one of the following reasons:
1. You may be adding a ref to a function component
2. You may be adding a ref to a component that was not created inside a component's render method
3. You have multiple copies of React loaded
See https://reactjs.org/link/refs-must-have-owner for more information.`);
                  }
                }
                return F;
              }
              function vT(g, x) {
                if (g.type !== "textarea")
                  throw Error("Objects are not valid as a React child (found: " + (Object.prototype.toString.call(x) === "[object Object]" ? "object with keys {" + Object.keys(x).join(", ") + "}" : x) + "). If you meant to render a collection of children, use an array instead.");
              }
              function uT(g) {
                {
                  var x = Zr(g.type) || "Component";
                  if (jX[x])
                    return;
                  jX[x] = !0, c("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
                }
              }
              function bb(g) {
                function x(Nt, dr) {
                  if (g) {
                    var ht = Nt.lastEffect;
                    ht !== null ? (ht.nextEffect = dr, Nt.lastEffect = dr) : Nt.firstEffect = Nt.lastEffect = dr, dr.nextEffect = null, dr.flags = Ms;
                  }
                }
                function U(Nt, dr) {
                  if (!g)
                    return null;
                  for (var ht = dr; ht !== null; )
                    x(Nt, ht), ht = ht.sibling;
                  return null;
                }
                function F(Nt, dr) {
                  for (var ht = /* @__PURE__ */ new Map(), Or = dr; Or !== null; )
                    Or.key !== null ? ht.set(Or.key, Or) : ht.set(Or.index, Or), Or = Or.sibling;
                  return ht;
                }
                function K(Nt, dr) {
                  var ht = nc(Nt, dr);
                  return ht.index = 0, ht.sibling = null, ht;
                }
                function oe(Nt, dr, ht) {
                  if (Nt.index = ht, !g)
                    return dr;
                  var Or = Nt.alternate;
                  if (Or !== null) {
                    var hn = Or.index;
                    return hn < dr ? (Nt.flags = Qa, dr) : hn;
                  } else
                    return Nt.flags = Qa, dr;
                }
                function ce(Nt) {
                  return g && Nt.alternate === null && (Nt.flags = Qa), Nt;
                }
                function Te(Nt, dr, ht, Or) {
                  if (dr === null || dr.tag !== I) {
                    var hn = f0(ht, Nt.mode, Or);
                    return hn.return = Nt, hn;
                  } else {
                    var Nn = K(dr, ht);
                    return Nn.return = Nt, Nn;
                  }
                }
                function Ce(Nt, dr, ht, Or) {
                  if (dr !== null && (dr.elementType === ht.type || // Keep this check inline so it only runs on the false path:
                  pw(dr, ht))) {
                    var hn = K(dr, ht.props);
                    return hn.ref = _7(Nt, dr, ht), hn.return = Nt, hn._debugSource = ht._source, hn._debugOwner = ht._owner, hn;
                  }
                  var Nn = j8(ht, Nt.mode, Or);
                  return Nn.ref = _7(Nt, dr, ht), Nn.return = Nt, Nn;
                }
                function tt(Nt, dr, ht, Or) {
                  if (dr === null || dr.tag !== w || dr.stateNode.containerInfo !== ht.containerInfo || dr.stateNode.implementation !== ht.implementation) {
                    var hn = T2(ht, Nt.mode, Or);
                    return hn.return = Nt, hn;
                  } else {
                    var Nn = K(dr, ht.children || []);
                    return Nn.return = Nt, Nn;
                  }
                }
                function ft(Nt, dr, ht, Or, hn) {
                  if (dr === null || dr.tag !== N) {
                    var Nn = g1(ht, Nt.mode, Or, hn);
                    return Nn.return = Nt, Nn;
                  } else {
                    var Fs = K(dr, ht);
                    return Fs.return = Nt, Fs;
                  }
                }
                function Rt(Nt, dr, ht) {
                  if (typeof dr == "string" || typeof dr == "number") {
                    var Or = f0("" + dr, Nt.mode, ht);
                    return Or.return = Nt, Or;
                  }
                  if (typeof dr == "object" && dr !== null) {
                    switch (dr.$$typeof) {
                      case Ii: {
                        var hn = j8(dr, Nt.mode, ht);
                        return hn.ref = _7(Nt, null, dr), hn.return = Nt, hn;
                      }
                      case is: {
                        var Nn = T2(dr, Nt.mode, ht);
                        return Nn.return = Nt, Nn;
                      }
                    }
                    if (dT(dr) || li(dr)) {
                      var Fs = g1(dr, Nt.mode, ht, null);
                      return Fs.return = Nt, Fs;
                    }
                    vT(Nt, dr);
                  }
                  return typeof dr == "function" && uT(Nt), null;
                }
                function ct(Nt, dr, ht, Or) {
                  var hn = dr !== null ? dr.key : null;
                  if (typeof ht == "string" || typeof ht == "number")
                    return hn !== null ? null : Te(Nt, dr, "" + ht, Or);
                  if (typeof ht == "object" && ht !== null) {
                    switch (ht.$$typeof) {
                      case Ii:
                        return ht.key === hn ? ht.type === ji ? ft(Nt, dr, ht.props.children, Or, hn) : Ce(Nt, dr, ht, Or) : null;
                      case is:
                        return ht.key === hn ? tt(Nt, dr, ht, Or) : null;
                    }
                    if (dT(ht) || li(ht))
                      return hn !== null ? null : ft(Nt, dr, ht, Or, null);
                    vT(Nt, ht);
                  }
                  return typeof ht == "function" && uT(Nt), null;
                }
                function Ft(Nt, dr, ht, Or, hn) {
                  if (typeof Or == "string" || typeof Or == "number") {
                    var Nn = Nt.get(ht) || null;
                    return Te(dr, Nn, "" + Or, hn);
                  }
                  if (typeof Or == "object" && Or !== null) {
                    switch (Or.$$typeof) {
                      case Ii: {
                        var Fs = Nt.get(Or.key === null ? ht : Or.key) || null;
                        return Or.type === ji ? ft(dr, Fs, Or.props.children, hn, Or.key) : Ce(dr, Fs, Or, hn);
                      }
                      case is: {
                        var Do = Nt.get(Or.key === null ? ht : Or.key) || null;
                        return tt(dr, Do, Or, hn);
                      }
                    }
                    if (dT(Or) || li(Or)) {
                      var o1 = Nt.get(ht) || null;
                      return ft(dr, o1, Or, hn, null);
                    }
                    vT(dr, Or);
                  }
                  return typeof Or == "function" && uT(dr), null;
                }
                function wr(Nt, dr, ht) {
                  {
                    if (typeof Nt != "object" || Nt === null)
                      return dr;
                    switch (Nt.$$typeof) {
                      case Ii:
                      case is:
                        AT(Nt, ht);
                        var Or = Nt.key;
                        if (typeof Or != "string")
                          break;
                        if (dr === null) {
                          dr = /* @__PURE__ */ new Set(), dr.add(Or);
                          break;
                        }
                        if (!dr.has(Or)) {
                          dr.add(Or);
                          break;
                        }
                        c("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.", Or);
                        break;
                    }
                  }
                  return dr;
                }
                function Yr(Nt, dr, ht, Or) {
                  for (var hn = null, Nn = 0; Nn < ht.length; Nn++) {
                    var Fs = ht[Nn];
                    hn = wr(Fs, hn, Nt);
                  }
                  for (var Do = null, o1 = null, pa = dr, pf = 0, Ls = 0, lo = null; pa !== null && Ls < ht.length; Ls++) {
                    pa.index > Ls ? (lo = pa, pa = null) : lo = pa.sibling;
                    var s9 = ct(Nt, pa, ht[Ls], Or);
                    if (s9 === null) {
                      pa === null && (pa = lo);
                      break;
                    }
                    g && pa && s9.alternate === null && x(Nt, pa), pf = oe(s9, pf, Ls), o1 === null ? Do = s9 : o1.sibling = s9, o1 = s9, pa = lo;
                  }
                  if (Ls === ht.length)
                    return U(Nt, pa), Do;
                  if (pa === null) {
                    for (; Ls < ht.length; Ls++) {
                      var Yo = Rt(Nt, ht[Ls], Or);
                      Yo !== null && (pf = oe(Yo, pf, Ls), o1 === null ? Do = Yo : o1.sibling = Yo, o1 = Yo);
                    }
                    return Do;
                  }
                  for (var Rl = F(Nt, pa); Ls < ht.length; Ls++) {
                    var Q1 = Ft(Rl, Nt, Ls, ht[Ls], Or);
                    Q1 !== null && (g && Q1.alternate !== null && Rl.delete(Q1.key === null ? Ls : Q1.key), pf = oe(Q1, pf, Ls), o1 === null ? Do = Q1 : o1.sibling = Q1, o1 = Q1);
                  }
                  return g && Rl.forEach(function(Sv) {
                    return x(Nt, Sv);
                  }), Do;
                }
                function Si(Nt, dr, ht, Or) {
                  var hn = li(ht);
                  if (typeof hn != "function")
                    throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
                  {
                    typeof Symbol == "function" && // $FlowFixMe Flow doesn't know about toStringTag
                    ht[Symbol.toStringTag] === "Generator" && (xX || c("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."), xX = !0), ht.entries === hn && (bX || c("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), bX = !0);
                    var Nn = hn.call(ht);
                    if (Nn)
                      for (var Fs = null, Do = Nn.next(); !Do.done; Do = Nn.next()) {
                        var o1 = Do.value;
                        Fs = wr(o1, Fs, Nt);
                      }
                  }
                  var pa = hn.call(ht);
                  if (pa == null)
                    throw Error("An iterable object provided no iterator.");
                  for (var pf = null, Ls = null, lo = dr, s9 = 0, Yo = 0, Rl = null, Q1 = pa.next(); lo !== null && !Q1.done; Yo++, Q1 = pa.next()) {
                    lo.index > Yo ? (Rl = lo, lo = null) : Rl = lo.sibling;
                    var Sv = ct(Nt, lo, Q1.value, Or);
                    if (Sv === null) {
                      lo === null && (lo = Rl);
                      break;
                    }
                    g && lo && Sv.alternate === null && x(Nt, lo), s9 = oe(Sv, s9, Yo), Ls === null ? pf = Sv : Ls.sibling = Sv, Ls = Sv, lo = Rl;
                  }
                  if (Q1.done)
                    return U(Nt, lo), pf;
                  if (lo === null) {
                    for (; !Q1.done; Yo++, Q1 = pa.next()) {
                      var P0 = Rt(Nt, Q1.value, Or);
                      P0 !== null && (s9 = oe(P0, s9, Yo), Ls === null ? pf = P0 : Ls.sibling = P0, Ls = P0);
                    }
                    return pf;
                  }
                  for (var op = F(Nt, lo); !Q1.done; Yo++, Q1 = pa.next()) {
                    var Vl = Ft(op, Nt, Yo, Q1.value, Or);
                    Vl !== null && (g && Vl.alternate !== null && op.delete(Vl.key === null ? Yo : Vl.key), s9 = oe(Vl, s9, Yo), Ls === null ? pf = Vl : Ls.sibling = Vl, Ls = Vl);
                  }
                  return g && op.forEach(function(Ix) {
                    return x(Nt, Ix);
                  }), pf;
                }
                function os(Nt, dr, ht, Or) {
                  if (dr !== null && dr.tag === I) {
                    U(Nt, dr.sibling);
                    var hn = K(dr, ht);
                    return hn.return = Nt, hn;
                  }
                  U(Nt, dr);
                  var Nn = f0(ht, Nt.mode, Or);
                  return Nn.return = Nt, Nn;
                }
                function Ci(Nt, dr, ht, Or) {
                  for (var hn = ht.key, Nn = dr; Nn !== null; ) {
                    if (Nn.key === hn) {
                      switch (Nn.tag) {
                        case N: {
                          if (ht.type === ji) {
                            U(Nt, Nn.sibling);
                            var Fs = K(Nn, ht.props.children);
                            return Fs.return = Nt, Fs._debugSource = ht._source, Fs._debugOwner = ht._owner, Fs;
                          }
                          break;
                        }
                        case Pe:
                        default: {
                          if (Nn.elementType === ht.type || // Keep this check inline so it only runs on the false path:
                          pw(Nn, ht)) {
                            U(Nt, Nn.sibling);
                            var Do = K(Nn, ht.props);
                            return Do.ref = _7(Nt, Nn, ht), Do.return = Nt, Do._debugSource = ht._source, Do._debugOwner = ht._owner, Do;
                          }
                          break;
                        }
                      }
                      U(Nt, Nn);
                      break;
                    } else
                      x(Nt, Nn);
                    Nn = Nn.sibling;
                  }
                  if (ht.type === ji) {
                    var o1 = g1(ht.props.children, Nt.mode, Or, ht.key);
                    return o1.return = Nt, o1;
                  } else {
                    var pa = j8(ht, Nt.mode, Or);
                    return pa.ref = _7(Nt, dr, ht), pa.return = Nt, pa;
                  }
                }
                function ea(Nt, dr, ht, Or) {
                  for (var hn = ht.key, Nn = dr; Nn !== null; ) {
                    if (Nn.key === hn)
                      if (Nn.tag === w && Nn.stateNode.containerInfo === ht.containerInfo && Nn.stateNode.implementation === ht.implementation) {
                        U(Nt, Nn.sibling);
                        var Fs = K(Nn, ht.children || []);
                        return Fs.return = Nt, Fs;
                      } else {
                        U(Nt, Nn);
                        break;
                      }
                    else
                      x(Nt, Nn);
                    Nn = Nn.sibling;
                  }
                  var Do = T2(ht, Nt.mode, Or);
                  return Do.return = Nt, Do;
                }
                function to(Nt, dr, ht, Or) {
                  var hn = typeof ht == "object" && ht !== null && ht.type === ji && ht.key === null;
                  hn && (ht = ht.props.children);
                  var Nn = typeof ht == "object" && ht !== null;
                  if (Nn)
                    switch (ht.$$typeof) {
                      case Ii:
                        return ce(Ci(Nt, dr, ht, Or));
                      case is:
                        return ce(ea(Nt, dr, ht, Or));
                    }
                  if (typeof ht == "string" || typeof ht == "number")
                    return ce(os(Nt, dr, "" + ht, Or));
                  if (dT(ht))
                    return Yr(Nt, dr, ht, Or);
                  if (li(ht))
                    return Si(Nt, dr, ht, Or);
                  if (Nn && vT(Nt, ht), typeof ht == "function" && uT(Nt), typeof ht > "u" && !hn)
                    switch (Nt.tag) {
                      case q: {
                        var Fs = Nt.stateNode;
                        if (Fs.render._isMockFunction)
                          break;
                      }
                      case Pe:
                      case T:
                      case O:
                      case te:
                        throw Error((Zr(Nt.type) || "Component") + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
                    }
                  return U(Nt, dr);
                }
                return to;
              }
              var O3 = bb(!0), mj = bb(!1);
              function Bj(g, x) {
                if (!(g === null || x.child === g.child))
                  throw Error("Resuming work not yet implemented.");
                if (x.child !== null) {
                  var U = x.child, F = nc(U, U.pendingProps);
                  for (x.child = F, F.return = x; U.sibling !== null; )
                    U = U.sibling, F = F.sibling = nc(U, U.pendingProps), F.return = x;
                  F.sibling = null;
                }
              }
              function Uh(g, x) {
                for (var U = g.child; U !== null; )
                  h6(U, x), U = U.sibling;
              }
              var $7 = {}, a1 = w3($7), Ih = w3($7), lT = w3($7);
              function PT(g) {
                if (g === $7)
                  throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
                return g;
              }
              function Wj() {
                var g = PT(lT.current);
                return g;
              }
              function Bd(g, x) {
                t9(lT, x, g), t9(Ih, g, g), t9(a1, $7, g);
                var U = _m(x);
                Q6(a1, g), t9(a1, U, g);
              }
              function Rh(g) {
                Q6(a1, g), Q6(Ih, g), Q6(lT, g);
              }
              function FP() {
                var g = PT(a1.current);
                return g;
              }
              function eH(g) {
                PT(lT.current);
                var x = PT(a1.current), U = ko(x, g.type);
                x !== U && (t9(Ih, g, g), t9(a1, U, g));
              }
              function Vh(g) {
                Ih.current === g && (Q6(a1, g), Q6(Ih, g));
              }
              var wX = 0, tH = 1, Ch = 1, NP = 2, u6 = w3(wX);
              function Oh(g, x) {
                return (g & x) !== 0;
              }
              function rH(g) {
                return g & tH;
              }
              function Wd(g, x) {
                return g & tH | x;
              }
              function xb(g, x) {
                return g | x;
              }
              function QP(g, x) {
                t9(u6, x, g);
              }
              function Xl(g) {
                Q6(u6, g);
              }
              function nH(g, x) {
                var U = g.memoizedState;
                if (U !== null)
                  return U.dehydrated !== null;
                var F = g.memoizedProps;
                return F.fallback === void 0 ? !1 : F.unstable_avoidThisFallback !== !0 ? !0 : !x;
              }
              function yh(g) {
                for (var x = g; x !== null; ) {
                  if (x.tag === ee) {
                    var U = x.memoizedState;
                    if (U !== null) {
                      var F = U.dehydrated;
                      if (F === null || tB(F) || rB(F))
                        return x;
                    }
                  } else if (x.tag === L && // revealOrder undefined can't be trusted because it don't
                  // keep track of whether it suspended or not.
                  x.memoizedProps.revealOrder !== void 0) {
                    var K = (x.flags & bi) !== Es;
                    if (K)
                      return x;
                  } else if (x.child !== null) {
                    x.child.return = x, x = x.child;
                    continue;
                  }
                  if (x === g)
                    return null;
                  for (; x.sibling === null; ) {
                    if (x.return === null || x.return === g)
                      return null;
                    x = x.return;
                  }
                  x.sibling.return = x.return, x = x.sibling;
                }
                return null;
              }
              var iH = (
                /*  */
                0
              ), Tl = (
                /* */
                1
              ), kh = (
                /*    */
                2
              ), sH = (
                /*   */
                4
              ), _A = null, YP = null, ql = !1;
              function Sj(g) {
                var x = g.stateNode.containerInfo;
                return YP = eb(x), _A = g, ql = !0, !0;
              }
              function Uj(g, x) {
                switch (g.tag) {
                  case j:
                    oB(g.stateNode.containerInfo, x);
                    break;
                  case m:
                    fB(g.type, g.memoizedProps, g.stateNode, x);
                    break;
                }
                var U = Tw();
                U.stateNode = x, U.return = g, U.flags = Ms, g.lastEffect !== null ? (g.lastEffect.nextEffect = U, g.lastEffect = U) : g.firstEffect = g.lastEffect = U;
              }
              function y3(g, x) {
                switch (x.flags = x.flags & ~I1 | Qa, g.tag) {
                  case j: {
                    var U = g.stateNode.containerInfo;
                    switch (x.tag) {
                      case m:
                        var F = x.type;
                        x.pendingProps, tj(U, F);
                        break;
                      case I:
                        var K = x.pendingProps;
                        AB(U, K);
                        break;
                    }
                    break;
                  }
                  case m: {
                    var oe = g.type, ce = g.memoizedProps, Te = g.stateNode;
                    switch (x.tag) {
                      case m:
                        var Ce = x.type;
                        x.pendingProps, tb(oe, ce, Te, Ce);
                        break;
                      case I:
                        var tt = x.pendingProps;
                        rb(oe, ce, Te, tt);
                        break;
                      case ee:
                        fX(oe, ce);
                        break;
                    }
                    break;
                  }
                  default:
                    return;
                }
              }
              function df(g, x) {
                switch (g.tag) {
                  case m: {
                    var U = g.type;
                    g.pendingProps;
                    var F = ZD(x, U);
                    return F !== null ? (g.stateNode = F, !0) : !1;
                  }
                  case I: {
                    var K = g.pendingProps, oe = $q(x, K);
                    return oe !== null ? (g.stateNode = oe, !0) : !1;
                  }
                  case ee:
                    return !1;
                  default:
                    return !1;
                }
              }
              function MP(g) {
                if (ql) {
                  var x = YP;
                  if (!x) {
                    y3(_A, g), ql = !1, _A = g;
                    return;
                  }
                  var U = x;
                  if (!df(g, x)) {
                    if (x = j3(U), !x || !df(g, x)) {
                      y3(_A, g), ql = !1, _A = g;
                      return;
                    }
                    Uj(_A, U);
                  }
                  _A = g, YP = eb(x);
                }
              }
              function Db(g, x, U) {
                var F = g.stateNode, K = nB(F, g.type, g.memoizedProps, x, U, g);
                return g.updateQueue = K, K !== null;
              }
              function TB(g) {
                var x = g.stateNode, U = g.memoizedProps, F = R7(x, U, g);
                if (F) {
                  var K = _A;
                  if (K !== null)
                    switch (K.tag) {
                      case j: {
                        var oe = K.stateNode.containerInfo;
                        aB(oe, x, U);
                        break;
                      }
                      case m: {
                        var ce = K.type, Te = K.memoizedProps, Ce = K.stateNode;
                        ej(ce, Te, Ce, x, U);
                        break;
                      }
                    }
                }
                return F;
              }
              function jb(g) {
                var x = g.memoizedState, U = x !== null ? x.dehydrated : null;
                if (!U)
                  throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
                return iB(U);
              }
              function Ij(g) {
                for (var x = g.return; x !== null && x.tag !== m && x.tag !== j && x.tag !== ee; )
                  x = x.return;
                _A = x;
              }
              function cT(g) {
                if (g !== _A)
                  return !1;
                if (!ql)
                  return Ij(g), ql = !0, !1;
                var x = g.type;
                if (g.tag !== m || x !== "head" && x !== "body" && !Zq(x, g.memoizedProps))
                  for (var U = YP; U; )
                    Uj(g, U), U = j3(U);
                return Ij(g), g.tag === ee ? YP = jb(g) : YP = _A ? j3(g.stateNode) : null, !0;
              }
              function l6() {
                _A = null, YP = null, ql = !1;
              }
              function wb() {
                return ql;
              }
              var k3 = [], mX;
              mX = {};
              function Rj(g) {
                k3.push(g);
              }
              function aH() {
                for (var g = 0; g < k3.length; g++) {
                  var x = k3[g];
                  x._workInProgressVersionPrimary = null;
                }
                k3.length = 0;
              }
              function mb(g) {
                return g._workInProgressVersionPrimary;
              }
              function BX(g, x) {
                g._workInProgressVersionPrimary = x, k3.push(g);
              }
              function Bb(g) {
                g._currentPrimaryRenderer == null ? g._currentPrimaryRenderer = mX : g._currentPrimaryRenderer !== mX && c("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.");
              }
              var pn = P.ReactCurrentDispatcher, $A = P.ReactCurrentBatchConfig, pT, Sd;
              Sd = {}, pT = /* @__PURE__ */ new Set();
              var bv = Zt, Ca = null, m9 = null, B9 = null, E3 = !1, WX = !1, Vj = 25, jr = null, Ud = null, bl = -1, SX = !1;
              function Oa() {
                {
                  var g = jr;
                  Ud === null ? Ud = [g] : Ud.push(g);
                }
              }
              function bn() {
                {
                  var g = jr;
                  Ud !== null && (bl++, Ud[bl] !== g && Wb(g));
                }
              }
              function Eh(g) {
                g != null && !Array.isArray(g) && c("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", jr, typeof g);
              }
              function Wb(g) {
                {
                  var x = Zr(Ca.type);
                  if (!pT.has(x) && (pT.add(x), Ud !== null)) {
                    for (var U = "", F = 30, K = 0; K <= bl; K++) {
                      for (var oe = Ud[K], ce = K === bl ? g : oe, Te = K + 1 + ". " + oe; Te.length < F; )
                        Te += " ";
                      Te += ce + `
`, U += Te;
                    }
                    c(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks

   Previous render            Next render
   ------------------------------------------------------
%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`, x, U);
                  }
                }
              }
              function P6() {
                throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);
              }
              function hT(g, x) {
                if (SX)
                  return !1;
                if (x === null)
                  return c("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", jr), !1;
                g.length !== x.length && c(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.

Previous: %s
Incoming: %s`, jr, "[" + x.join(", ") + "]", "[" + g.join(", ") + "]");
                for (var U = 0; U < x.length && U < g.length; U++)
                  if (!e9(g[U], x[U]))
                    return !1;
                return !0;
              }
              function xl(g, x, U, F, K, oe) {
                bv = oe, Ca = x, Ud = g !== null ? g._debugHookTypes : null, bl = -1, SX = g !== null && g.type !== x.type, x.memoizedState = null, x.updateQueue = null, x.lanes = Zt, g !== null && g.memoizedState !== null ? pn.current = Mh : Ud !== null ? pn.current = zP : pn.current = wT;
                var ce = U(F, K);
                if (WX) {
                  var Te = 0;
                  do {
                    if (WX = !1, !(Te < Vj))
                      throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
                    Te += 1, SX = !1, m9 = null, B9 = null, x.updateQueue = null, bl = -1, pn.current = yj, ce = U(F, K);
                  } while (WX);
                }
                pn.current = lH, x._debugHookTypes = Ud;
                var Ce = m9 !== null && m9.next !== null;
                if (bv = Zt, Ca = null, m9 = null, B9 = null, jr = null, Ud = null, bl = -1, E3 = !1, Ce)
                  throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
                return ce;
              }
              function HT(g, x, U) {
                x.updateQueue = g.updateQueue, x.flags &= ~(Ya | fn), g.lanes = hP(g.lanes, U);
              }
              function UX() {
                if (pn.current = lH, E3) {
                  for (var g = Ca.memoizedState; g !== null; ) {
                    var x = g.queue;
                    x !== null && (x.pending = null), g = g.next;
                  }
                  E3 = !1;
                }
                bv = Zt, Ca = null, m9 = null, B9 = null, Ud = null, bl = -1, jr = null, jT = !1, WX = !1;
              }
              function LP() {
                var g = {
                  memoizedState: null,
                  baseState: null,
                  baseQueue: null,
                  queue: null,
                  next: null
                };
                return B9 === null ? Ca.memoizedState = B9 = g : B9 = B9.next = g, B9;
              }
              function F3() {
                var g;
                if (m9 === null) {
                  var x = Ca.alternate;
                  x !== null ? g = x.memoizedState : g = null;
                } else
                  g = m9.next;
                var U;
                if (B9 === null ? U = Ca.memoizedState : U = B9.next, U !== null)
                  B9 = U, U = B9.next, m9 = g;
                else {
                  if (g === null)
                    throw Error("Rendered more hooks than during the previous render.");
                  m9 = g;
                  var F = {
                    memoizedState: m9.memoizedState,
                    baseState: m9.baseState,
                    baseQueue: m9.baseQueue,
                    queue: m9.queue,
                    next: null
                  };
                  B9 === null ? Ca.memoizedState = B9 = F : B9 = B9.next = F;
                }
                return B9;
              }
              function Sb() {
                return {
                  lastEffect: null
                };
              }
              function Fh(g, x) {
                return typeof x == "function" ? x(g) : x;
              }
              function gT(g, x, U) {
                var F = LP(), K;
                U !== void 0 ? K = U(x) : K = x, F.memoizedState = F.baseState = K;
                var oe = F.queue = {
                  pending: null,
                  dispatch: null,
                  lastRenderedReducer: g,
                  lastRenderedState: K
                }, ce = oe.dispatch = L3.bind(null, Ca, oe);
                return [F.memoizedState, ce];
              }
              function XT(g, x, U) {
                var F = F3(), K = F.queue;
                if (K === null)
                  throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
                K.lastRenderedReducer = g;
                var oe = m9, ce = oe.baseQueue, Te = K.pending;
                if (Te !== null) {
                  if (ce !== null) {
                    var Ce = ce.next, tt = Te.next;
                    ce.next = tt, Te.next = Ce;
                  }
                  oe.baseQueue !== ce && c("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."), oe.baseQueue = ce = Te, K.pending = null;
                }
                if (ce !== null) {
                  var ft = ce.next, Rt = oe.baseState, ct = null, Ft = null, wr = null, Yr = ft;
                  do {
                    var Si = Yr.lane;
                    if (pP(bv, Si)) {
                      if (wr !== null) {
                        var Ci = {
                          // This update is going to be committed so we never want uncommit
                          // it. Using NoLane works because 0 is a subset of all bitmasks, so
                          // this will never be skipped by the check above.
                          lane: Ln,
                          action: Yr.action,
                          eagerReducer: Yr.eagerReducer,
                          eagerState: Yr.eagerState,
                          next: null
                        };
                        wr = wr.next = Ci;
                      }
                      if (Yr.eagerReducer === g)
                        Rt = Yr.eagerState;
                      else {
                        var ea = Yr.action;
                        Rt = g(Rt, ea);
                      }
                    } else {
                      var os = {
                        lane: Si,
                        action: Yr.action,
                        eagerReducer: Yr.eagerReducer,
                        eagerState: Yr.eagerState,
                        next: null
                      };
                      wr === null ? (Ft = wr = os, ct = Rt) : wr = wr.next = os, Ca.lanes = ca(Ca.lanes, Si), Cf(Si);
                    }
                    Yr = Yr.next;
                  } while (Yr !== null && Yr !== ft);
                  wr === null ? ct = Rt : wr.next = Ft, e9(Rt, F.memoizedState) || KX(), F.memoizedState = Rt, F.baseState = ct, F.baseQueue = wr, K.lastRenderedState = Rt;
                }
                var to = K.dispatch;
                return [F.memoizedState, to];
              }
              function TT(g, x, U) {
                var F = F3(), K = F.queue;
                if (K === null)
                  throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
                K.lastRenderedReducer = g;
                var oe = K.dispatch, ce = K.pending, Te = F.memoizedState;
                if (ce !== null) {
                  K.pending = null;
                  var Ce = ce.next, tt = Ce;
                  do {
                    var ft = tt.action;
                    Te = g(Te, ft), tt = tt.next;
                  } while (tt !== Ce);
                  e9(Te, F.memoizedState) || KX(), F.memoizedState = Te, F.baseQueue === null && (F.baseState = Te), K.lastRenderedState = Te;
                }
                return [Te, oe];
              }
              function Ub(g, x, U) {
                Bb(x);
                var F = x._getVersion, K = F(x._source), oe = !1, ce = mb(x);
                if (ce !== null ? oe = ce === K : (oe = pP(bv, g.mutableReadLanes), oe && BX(x, K)), oe) {
                  var Te = U(x._source);
                  return typeof Te == "function" && c("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."), Te;
                } else
                  throw Rj(x), Error("Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.");
              }
              function Cj(g, x, U, F) {
                var K = v8();
                if (K === null)
                  throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
                var oe = x._getVersion, ce = oe(x._source), Te = pn.current, Ce = Te.useState(function() {
                  return Ub(K, x, U);
                }), tt = Ce[0], ft = Ce[1], Rt = tt, ct = B9, Ft = g.memoizedState, wr = Ft.refs, Yr = wr.getSnapshot, Si = Ft.source, os = Ft.subscribe, Ci = Ca;
                if (g.memoizedState = {
                  refs: wr,
                  source: x,
                  subscribe: F
                }, Te.useEffect(function() {
                  wr.getSnapshot = U, wr.setSnapshot = ft;
                  var to = oe(x._source);
                  if (!e9(ce, to)) {
                    var Nt = U(x._source);
                    if (typeof Nt == "function" && c("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."), !e9(Rt, Nt)) {
                      ft(Nt);
                      var dr = $3(Ci);
                      Zp(K, dr);
                    }
                    C1(K, K.mutableReadLanes);
                  }
                }, [U, x, F]), Te.useEffect(function() {
                  var to = function() {
                    var dr = wr.getSnapshot, ht = wr.setSnapshot;
                    try {
                      ht(dr(x._source));
                      var Or = $3(Ci);
                      Zp(K, Or);
                    } catch (hn) {
                      ht(function() {
                        throw hn;
                      });
                    }
                  }, Nt = F(x._source, to);
                  return typeof Nt != "function" && c("Mutable source subscribe function must return an unsubscribe function."), Nt;
                }, [x, F]), !e9(Yr, U) || !e9(Si, x) || !e9(os, F)) {
                  var ea = {
                    pending: null,
                    dispatch: null,
                    lastRenderedReducer: Fh,
                    lastRenderedState: Rt
                  };
                  ea.dispatch = ft = L3.bind(null, Ca, ea), ct.queue = ea, ct.baseQueue = null, Rt = Ub(K, x, U), ct.memoizedState = ct.baseState = Rt;
                }
                return Rt;
              }
              function qT(g, x, U) {
                var F = LP();
                return F.memoizedState = {
                  refs: {
                    getSnapshot: x,
                    setSnapshot: null
                  },
                  source: g,
                  subscribe: U
                }, Cj(F, g, x, U);
              }
              function oH(g, x, U) {
                var F = F3();
                return Cj(F, g, x, U);
              }
              function N3(g) {
                var x = LP();
                typeof g == "function" && (g = g()), x.memoizedState = x.baseState = g;
                var U = x.queue = {
                  pending: null,
                  dispatch: null,
                  lastRenderedReducer: Fh,
                  lastRenderedState: g
                }, F = U.dispatch = L3.bind(null, Ca, U);
                return [x.memoizedState, F];
              }
              function IX(g) {
                return XT(Fh);
              }
              function Dl(g) {
                return TT(Fh);
              }
              function fH(g, x, U, F) {
                var K = {
                  tag: g,
                  create: x,
                  destroy: U,
                  deps: F,
                  // Circular
                  next: null
                }, oe = Ca.updateQueue;
                if (oe === null)
                  oe = Sb(), Ca.updateQueue = oe, oe.lastEffect = K.next = K;
                else {
                  var ce = oe.lastEffect;
                  if (ce === null)
                    oe.lastEffect = K.next = K;
                  else {
                    var Te = ce.next;
                    ce.next = K, K.next = Te, oe.lastEffect = K;
                  }
                }
                return K;
              }
              function AH(g) {
                var x = LP(), U = {
                  current: g
                };
                return Object.seal(U), x.memoizedState = U, U;
              }
              function Q3(g) {
                var x = F3();
                return x.memoizedState;
              }
              function RX(g, x, U, F) {
                var K = LP(), oe = F === void 0 ? null : F;
                Ca.flags |= g, K.memoizedState = fH(Tl | x, U, void 0, oe);
              }
              function VX(g, x, U, F) {
                var K = F3(), oe = F === void 0 ? null : F, ce = void 0;
                if (m9 !== null) {
                  var Te = m9.memoizedState;
                  if (ce = Te.destroy, oe !== null) {
                    var Ce = Te.deps;
                    if (hT(oe, Ce)) {
                      fH(x, U, ce, oe);
                      return;
                    }
                  }
                }
                Ca.flags |= g, K.memoizedState = fH(Tl | x, U, ce, oe);
              }
              function Y3(g, x) {
                return typeof jest < "u" && dw(Ca), RX(fn | Ya, sH, g, x);
              }
              function KP(g, x) {
                return typeof jest < "u" && dw(Ca), VX(fn | Ya, sH, g, x);
              }
              function dH(g, x) {
                return RX(fn, kh, g, x);
              }
              function CX(g, x) {
                return VX(fn, kh, g, x);
              }
              function Ib(g, x) {
                if (typeof x == "function") {
                  var U = x, F = g();
                  return U(F), function() {
                    U(null);
                  };
                } else if (x != null) {
                  var K = x;
                  K.hasOwnProperty("current") || c("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(K).join(", ") + "}");
                  var oe = g();
                  return K.current = oe, function() {
                    K.current = null;
                  };
                }
              }
              function JP(g, x, U) {
                typeof x != "function" && c("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", x !== null ? typeof x : "null");
                var F = U != null ? U.concat([g]) : null;
                return RX(fn, kh, Ib.bind(null, x, g), F);
              }
              function OX(g, x, U) {
                typeof x != "function" && c("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", x !== null ? typeof x : "null");
                var F = U != null ? U.concat([g]) : null;
                return VX(fn, kh, Ib.bind(null, x, g), F);
              }
              function qB(g, x) {
              }
              var yX = qB;
              function Nh(g, x) {
                var U = LP(), F = x === void 0 ? null : x;
                return U.memoizedState = [g, F], g;
              }
              function qu(g, x) {
                var U = F3(), F = x === void 0 ? null : x, K = U.memoizedState;
                if (K !== null && F !== null) {
                  var oe = K[1];
                  if (hT(F, oe))
                    return K[0];
                }
                return U.memoizedState = [g, F], g;
              }
              function Qh(g, x) {
                var U = LP(), F = x === void 0 ? null : x, K = g();
                return U.memoizedState = [K, F], K;
              }
              function M3(g, x) {
                var U = F3(), F = x === void 0 ? null : x, K = U.memoizedState;
                if (K !== null && F !== null) {
                  var oe = K[1];
                  if (hT(F, oe))
                    return K[0];
                }
                var ce = g();
                return U.memoizedState = [ce, F], ce;
              }
              function vH(g) {
                var x = N3(g), U = x[0], F = x[1];
                return Y3(function() {
                  var K = $A.transition;
                  $A.transition = 1;
                  try {
                    F(g);
                  } finally {
                    $A.transition = K;
                  }
                }, [g]), U;
              }
              function bT(g) {
                var x = IX(), U = x[0], F = x[1];
                return KP(function() {
                  var K = $A.transition;
                  $A.transition = 1;
                  try {
                    F(g);
                  } finally {
                    $A.transition = K;
                  }
                }, [g]), U;
              }
              function xT(g) {
                var x = Dl(), U = x[0], F = x[1];
                return KP(function() {
                  var K = $A.transition;
                  $A.transition = 1;
                  try {
                    F(g);
                  } finally {
                    $A.transition = K;
                  }
                }, [g]), U;
              }
              function uH(g, x) {
                var U = F7();
                B3(U < jh ? jh : U, function() {
                  g(!0);
                }), B3(U > SP ? SP : U, function() {
                  var F = $A.transition;
                  $A.transition = 1;
                  try {
                    g(!1), x();
                  } finally {
                    $A.transition = F;
                  }
                });
              }
              function kX() {
                var g = N3(!1), x = g[0], U = g[1], F = uH.bind(null, U);
                return AH(F), [F, x];
              }
              function Rb() {
                var g = IX(), x = g[0], U = Q3(), F = U.current;
                return [F, x];
              }
              function DT() {
                var g = Dl(), x = g[0], U = Q3(), F = U.current;
                return [F, x];
              }
              var jT = !1;
              function Oj() {
                return jT;
              }
              function Vb(g) {
                {
                  var x = Zr(g.type) || "Unknown";
                  I6() && !Sd[x] && (c("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly."), Sd[x] = !0);
                }
              }
              function Yh() {
                var g = dB.bind(null, Vb.bind(null, Ca));
                if (wb()) {
                  var x = !1, U = Ca, F = function() {
                    throw x || (x = !0, jT = !0, oe(g()), jT = !1, Vb(U)), Error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.");
                  }, K = dX(F), oe = N3(K)[1];
                  return (Ca.mode & ZA) === s1 && (Ca.flags |= fn | Ya, fH(Tl | sH, function() {
                    oe(g());
                  }, void 0, null)), K;
                } else {
                  var ce = g();
                  return N3(ce), ce;
                }
              }
              function xv() {
                var g = IX()[0];
                return g;
              }
              function EX() {
                var g = Dl()[0];
                return g;
              }
              function L3(g, x, U) {
                typeof arguments[3] == "function" && c("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
                var F = Vd(), K = $3(g), oe = {
                  lane: K,
                  action: U,
                  eagerReducer: null,
                  eagerState: null,
                  next: null
                }, ce = x.pending;
                ce === null ? oe.next = oe : (oe.next = ce.next, ce.next = oe), x.pending = oe;
                var Te = g.alternate;
                if (g === Ca || Te !== null && Te === Ca)
                  WX = E3 = !0;
                else {
                  if (g.lanes === Zt && (Te === null || Te.lanes === Zt)) {
                    var Ce = x.lastRenderedReducer;
                    if (Ce !== null) {
                      var tt;
                      tt = pn.current, pn.current = Eo;
                      try {
                        var ft = x.lastRenderedState, Rt = Ce(ft, U);
                        if (oe.eagerReducer = Ce, oe.eagerState = Rt, e9(Rt, ft))
                          return;
                      } catch {
                      } finally {
                        pn.current = tt;
                      }
                    }
                  }
                  typeof jest < "u" && (gx(g), vw(g)), W9(g, K, F);
                }
              }
              var lH = {
                readContext: F1,
                useCallback: P6,
                useContext: P6,
                useEffect: P6,
                useImperativeHandle: P6,
                useLayoutEffect: P6,
                useMemo: P6,
                useReducer: P6,
                useRef: P6,
                useState: P6,
                useDebugValue: P6,
                useDeferredValue: P6,
                useTransition: P6,
                useMutableSource: P6,
                useOpaqueIdentifier: P6,
                unstable_isNewReconciler: ne
              }, wT = null, zP = null, Mh = null, yj = null, Id = null, Eo = null, N1 = null;
              {
                var ed = function() {
                  c("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
                }, ui = function() {
                  c("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
                };
                wT = {
                  readContext: function(g, x) {
                    return F1(g, x);
                  },
                  useCallback: function(g, x) {
                    return jr = "useCallback", Oa(), Eh(x), Nh(g, x);
                  },
                  useContext: function(g, x) {
                    return jr = "useContext", Oa(), F1(g, x);
                  },
                  useEffect: function(g, x) {
                    return jr = "useEffect", Oa(), Eh(x), Y3(g, x);
                  },
                  useImperativeHandle: function(g, x, U) {
                    return jr = "useImperativeHandle", Oa(), Eh(U), JP(g, x, U);
                  },
                  useLayoutEffect: function(g, x) {
                    return jr = "useLayoutEffect", Oa(), Eh(x), dH(g, x);
                  },
                  useMemo: function(g, x) {
                    jr = "useMemo", Oa(), Eh(x);
                    var U = pn.current;
                    pn.current = Id;
                    try {
                      return Qh(g, x);
                    } finally {
                      pn.current = U;
                    }
                  },
                  useReducer: function(g, x, U) {
                    jr = "useReducer", Oa();
                    var F = pn.current;
                    pn.current = Id;
                    try {
                      return gT(g, x, U);
                    } finally {
                      pn.current = F;
                    }
                  },
                  useRef: function(g) {
                    return jr = "useRef", Oa(), AH(g);
                  },
                  useState: function(g) {
                    jr = "useState", Oa();
                    var x = pn.current;
                    pn.current = Id;
                    try {
                      return N3(g);
                    } finally {
                      pn.current = x;
                    }
                  },
                  useDebugValue: function(g, x) {
                    return jr = "useDebugValue", Oa(), void 0;
                  },
                  useDeferredValue: function(g) {
                    return jr = "useDeferredValue", Oa(), vH(g);
                  },
                  useTransition: function() {
                    return jr = "useTransition", Oa(), kX();
                  },
                  useMutableSource: function(g, x, U) {
                    return jr = "useMutableSource", Oa(), qT(g, x, U);
                  },
                  useOpaqueIdentifier: function() {
                    return jr = "useOpaqueIdentifier", Oa(), Yh();
                  },
                  unstable_isNewReconciler: ne
                }, zP = {
                  readContext: function(g, x) {
                    return F1(g, x);
                  },
                  useCallback: function(g, x) {
                    return jr = "useCallback", bn(), Nh(g, x);
                  },
                  useContext: function(g, x) {
                    return jr = "useContext", bn(), F1(g, x);
                  },
                  useEffect: function(g, x) {
                    return jr = "useEffect", bn(), Y3(g, x);
                  },
                  useImperativeHandle: function(g, x, U) {
                    return jr = "useImperativeHandle", bn(), JP(g, x, U);
                  },
                  useLayoutEffect: function(g, x) {
                    return jr = "useLayoutEffect", bn(), dH(g, x);
                  },
                  useMemo: function(g, x) {
                    jr = "useMemo", bn();
                    var U = pn.current;
                    pn.current = Id;
                    try {
                      return Qh(g, x);
                    } finally {
                      pn.current = U;
                    }
                  },
                  useReducer: function(g, x, U) {
                    jr = "useReducer", bn();
                    var F = pn.current;
                    pn.current = Id;
                    try {
                      return gT(g, x, U);
                    } finally {
                      pn.current = F;
                    }
                  },
                  useRef: function(g) {
                    return jr = "useRef", bn(), AH(g);
                  },
                  useState: function(g) {
                    jr = "useState", bn();
                    var x = pn.current;
                    pn.current = Id;
                    try {
                      return N3(g);
                    } finally {
                      pn.current = x;
                    }
                  },
                  useDebugValue: function(g, x) {
                    return jr = "useDebugValue", bn(), void 0;
                  },
                  useDeferredValue: function(g) {
                    return jr = "useDeferredValue", bn(), vH(g);
                  },
                  useTransition: function() {
                    return jr = "useTransition", bn(), kX();
                  },
                  useMutableSource: function(g, x, U) {
                    return jr = "useMutableSource", bn(), qT(g, x, U);
                  },
                  useOpaqueIdentifier: function() {
                    return jr = "useOpaqueIdentifier", bn(), Yh();
                  },
                  unstable_isNewReconciler: ne
                }, Mh = {
                  readContext: function(g, x) {
                    return F1(g, x);
                  },
                  useCallback: function(g, x) {
                    return jr = "useCallback", bn(), qu(g, x);
                  },
                  useContext: function(g, x) {
                    return jr = "useContext", bn(), F1(g, x);
                  },
                  useEffect: function(g, x) {
                    return jr = "useEffect", bn(), KP(g, x);
                  },
                  useImperativeHandle: function(g, x, U) {
                    return jr = "useImperativeHandle", bn(), OX(g, x, U);
                  },
                  useLayoutEffect: function(g, x) {
                    return jr = "useLayoutEffect", bn(), CX(g, x);
                  },
                  useMemo: function(g, x) {
                    jr = "useMemo", bn();
                    var U = pn.current;
                    pn.current = Eo;
                    try {
                      return M3(g, x);
                    } finally {
                      pn.current = U;
                    }
                  },
                  useReducer: function(g, x, U) {
                    jr = "useReducer", bn();
                    var F = pn.current;
                    pn.current = Eo;
                    try {
                      return XT(g, x, U);
                    } finally {
                      pn.current = F;
                    }
                  },
                  useRef: function(g) {
                    return jr = "useRef", bn(), Q3();
                  },
                  useState: function(g) {
                    jr = "useState", bn();
                    var x = pn.current;
                    pn.current = Eo;
                    try {
                      return IX(g);
                    } finally {
                      pn.current = x;
                    }
                  },
                  useDebugValue: function(g, x) {
                    return jr = "useDebugValue", bn(), yX();
                  },
                  useDeferredValue: function(g) {
                    return jr = "useDeferredValue", bn(), bT(g);
                  },
                  useTransition: function() {
                    return jr = "useTransition", bn(), Rb();
                  },
                  useMutableSource: function(g, x, U) {
                    return jr = "useMutableSource", bn(), oH(g, x, U);
                  },
                  useOpaqueIdentifier: function() {
                    return jr = "useOpaqueIdentifier", bn(), xv();
                  },
                  unstable_isNewReconciler: ne
                }, yj = {
                  readContext: function(g, x) {
                    return F1(g, x);
                  },
                  useCallback: function(g, x) {
                    return jr = "useCallback", bn(), qu(g, x);
                  },
                  useContext: function(g, x) {
                    return jr = "useContext", bn(), F1(g, x);
                  },
                  useEffect: function(g, x) {
                    return jr = "useEffect", bn(), KP(g, x);
                  },
                  useImperativeHandle: function(g, x, U) {
                    return jr = "useImperativeHandle", bn(), OX(g, x, U);
                  },
                  useLayoutEffect: function(g, x) {
                    return jr = "useLayoutEffect", bn(), CX(g, x);
                  },
                  useMemo: function(g, x) {
                    jr = "useMemo", bn();
                    var U = pn.current;
                    pn.current = N1;
                    try {
                      return M3(g, x);
                    } finally {
                      pn.current = U;
                    }
                  },
                  useReducer: function(g, x, U) {
                    jr = "useReducer", bn();
                    var F = pn.current;
                    pn.current = N1;
                    try {
                      return TT(g, x, U);
                    } finally {
                      pn.current = F;
                    }
                  },
                  useRef: function(g) {
                    return jr = "useRef", bn(), Q3();
                  },
                  useState: function(g) {
                    jr = "useState", bn();
                    var x = pn.current;
                    pn.current = N1;
                    try {
                      return Dl(g);
                    } finally {
                      pn.current = x;
                    }
                  },
                  useDebugValue: function(g, x) {
                    return jr = "useDebugValue", bn(), yX();
                  },
                  useDeferredValue: function(g) {
                    return jr = "useDeferredValue", bn(), xT(g);
                  },
                  useTransition: function() {
                    return jr = "useTransition", bn(), DT();
                  },
                  useMutableSource: function(g, x, U) {
                    return jr = "useMutableSource", bn(), oH(g, x, U);
                  },
                  useOpaqueIdentifier: function() {
                    return jr = "useOpaqueIdentifier", bn(), EX();
                  },
                  unstable_isNewReconciler: ne
                }, Id = {
                  readContext: function(g, x) {
                    return ed(), F1(g, x);
                  },
                  useCallback: function(g, x) {
                    return jr = "useCallback", ui(), Oa(), Nh(g, x);
                  },
                  useContext: function(g, x) {
                    return jr = "useContext", ui(), Oa(), F1(g, x);
                  },
                  useEffect: function(g, x) {
                    return jr = "useEffect", ui(), Oa(), Y3(g, x);
                  },
                  useImperativeHandle: function(g, x, U) {
                    return jr = "useImperativeHandle", ui(), Oa(), JP(g, x, U);
                  },
                  useLayoutEffect: function(g, x) {
                    return jr = "useLayoutEffect", ui(), Oa(), dH(g, x);
                  },
                  useMemo: function(g, x) {
                    jr = "useMemo", ui(), Oa();
                    var U = pn.current;
                    pn.current = Id;
                    try {
                      return Qh(g, x);
                    } finally {
                      pn.current = U;
                    }
                  },
                  useReducer: function(g, x, U) {
                    jr = "useReducer", ui(), Oa();
                    var F = pn.current;
                    pn.current = Id;
                    try {
                      return gT(g, x, U);
                    } finally {
                      pn.current = F;
                    }
                  },
                  useRef: function(g) {
                    return jr = "useRef", ui(), Oa(), AH(g);
                  },
                  useState: function(g) {
                    jr = "useState", ui(), Oa();
                    var x = pn.current;
                    pn.current = Id;
                    try {
                      return N3(g);
                    } finally {
                      pn.current = x;
                    }
                  },
                  useDebugValue: function(g, x) {
                    return jr = "useDebugValue", ui(), Oa(), void 0;
                  },
                  useDeferredValue: function(g) {
                    return jr = "useDeferredValue", ui(), Oa(), vH(g);
                  },
                  useTransition: function() {
                    return jr = "useTransition", ui(), Oa(), kX();
                  },
                  useMutableSource: function(g, x, U) {
                    return jr = "useMutableSource", ui(), Oa(), qT(g, x, U);
                  },
                  useOpaqueIdentifier: function() {
                    return jr = "useOpaqueIdentifier", ui(), Oa(), Yh();
                  },
                  unstable_isNewReconciler: ne
                }, Eo = {
                  readContext: function(g, x) {
                    return ed(), F1(g, x);
                  },
                  useCallback: function(g, x) {
                    return jr = "useCallback", ui(), bn(), qu(g, x);
                  },
                  useContext: function(g, x) {
                    return jr = "useContext", ui(), bn(), F1(g, x);
                  },
                  useEffect: function(g, x) {
                    return jr = "useEffect", ui(), bn(), KP(g, x);
                  },
                  useImperativeHandle: function(g, x, U) {
                    return jr = "useImperativeHandle", ui(), bn(), OX(g, x, U);
                  },
                  useLayoutEffect: function(g, x) {
                    return jr = "useLayoutEffect", ui(), bn(), CX(g, x);
                  },
                  useMemo: function(g, x) {
                    jr = "useMemo", ui(), bn();
                    var U = pn.current;
                    pn.current = Eo;
                    try {
                      return M3(g, x);
                    } finally {
                      pn.current = U;
                    }
                  },
                  useReducer: function(g, x, U) {
                    jr = "useReducer", ui(), bn();
                    var F = pn.current;
                    pn.current = Eo;
                    try {
                      return XT(g, x, U);
                    } finally {
                      pn.current = F;
                    }
                  },
                  useRef: function(g) {
                    return jr = "useRef", ui(), bn(), Q3();
                  },
                  useState: function(g) {
                    jr = "useState", ui(), bn();
                    var x = pn.current;
                    pn.current = Eo;
                    try {
                      return IX(g);
                    } finally {
                      pn.current = x;
                    }
                  },
                  useDebugValue: function(g, x) {
                    return jr = "useDebugValue", ui(), bn(), yX();
                  },
                  useDeferredValue: function(g) {
                    return jr = "useDeferredValue", ui(), bn(), bT(g);
                  },
                  useTransition: function() {
                    return jr = "useTransition", ui(), bn(), Rb();
                  },
                  useMutableSource: function(g, x, U) {
                    return jr = "useMutableSource", ui(), bn(), oH(g, x, U);
                  },
                  useOpaqueIdentifier: function() {
                    return jr = "useOpaqueIdentifier", ui(), bn(), xv();
                  },
                  unstable_isNewReconciler: ne
                }, N1 = {
                  readContext: function(g, x) {
                    return ed(), F1(g, x);
                  },
                  useCallback: function(g, x) {
                    return jr = "useCallback", ui(), bn(), qu(g, x);
                  },
                  useContext: function(g, x) {
                    return jr = "useContext", ui(), bn(), F1(g, x);
                  },
                  useEffect: function(g, x) {
                    return jr = "useEffect", ui(), bn(), KP(g, x);
                  },
                  useImperativeHandle: function(g, x, U) {
                    return jr = "useImperativeHandle", ui(), bn(), OX(g, x, U);
                  },
                  useLayoutEffect: function(g, x) {
                    return jr = "useLayoutEffect", ui(), bn(), CX(g, x);
                  },
                  useMemo: function(g, x) {
                    jr = "useMemo", ui(), bn();
                    var U = pn.current;
                    pn.current = Eo;
                    try {
                      return M3(g, x);
                    } finally {
                      pn.current = U;
                    }
                  },
                  useReducer: function(g, x, U) {
                    jr = "useReducer", ui(), bn();
                    var F = pn.current;
                    pn.current = Eo;
                    try {
                      return TT(g, x, U);
                    } finally {
                      pn.current = F;
                    }
                  },
                  useRef: function(g) {
                    return jr = "useRef", ui(), bn(), Q3();
                  },
                  useState: function(g) {
                    jr = "useState", ui(), bn();
                    var x = pn.current;
                    pn.current = Eo;
                    try {
                      return Dl(g);
                    } finally {
                      pn.current = x;
                    }
                  },
                  useDebugValue: function(g, x) {
                    return jr = "useDebugValue", ui(), bn(), yX();
                  },
                  useDeferredValue: function(g) {
                    return jr = "useDeferredValue", ui(), bn(), xT(g);
                  },
                  useTransition: function() {
                    return jr = "useTransition", ui(), bn(), DT();
                  },
                  useMutableSource: function(g, x, U) {
                    return jr = "useMutableSource", ui(), bn(), oH(g, x, U);
                  },
                  useOpaqueIdentifier: function() {
                    return jr = "useOpaqueIdentifier", ui(), bn(), EX();
                  },
                  unstable_isNewReconciler: ne
                };
              }
              var Vf = u.unstable_now, mT = 0, Lh = -1;
              function kj() {
                return mT;
              }
              function xn() {
                mT = Vf();
              }
              function Kh(g) {
                Lh = Vf(), g.actualStartTime < 0 && (g.actualStartTime = Vf());
              }
              function BT(g) {
                Lh = -1;
              }
              function GP(g, x) {
                if (Lh >= 0) {
                  var U = Vf() - Lh;
                  g.actualDuration += U, x && (g.selfBaseDuration = U), Lh = -1;
                }
              }
              function ZP(g) {
                for (var x = g.child; x; )
                  g.actualDuration += x.actualDuration, x = x.sibling;
              }
              var $s = P.ReactCurrentOwner, eo = !1, vf, K3, Jh, zh, Cb, Gh, ur, z6;
              vf = {}, K3 = {}, Jh = {}, zh = {}, Cb = {}, Gh = !1, ur = {}, z6 = {};
              function uf(g, x, U, F) {
                g === null ? x.child = mj(x, null, U, F) : x.child = O3(x, g.child, U, F);
              }
              function WT(g, x, U, F) {
                x.child = O3(x, g.child, null, F), x.child = O3(x, null, U, F);
              }
              function aa(g, x, U, F, K) {
                if (x.type !== x.elementType) {
                  var oe = U.propTypes;
                  oe && hu(
                    oe,
                    F,
                    // Resolved props
                    "prop",
                    Zr(U)
                  );
                }
                var ce = U.render, Te = x.ref, Ce;
                OP(x, K);
                {
                  if ($s.current = x, Fn(!0), Ce = xl(g, x, ce, F, Te, K), x.mode & E1) {
                    qa();
                    try {
                      Ce = xl(g, x, ce, F, Te, K);
                    } finally {
                      m1();
                    }
                  }
                  Fn(!1);
                }
                return g !== null && !eo ? (HT(g, x, K), Rd(g, x, K)) : (x.flags |= FA, uf(g, x, Ce, K), x.child);
              }
              function un(g, x, U, F, K, oe) {
                if (g === null) {
                  var ce = U.type;
                  if (Xw(ce) && U.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
                  U.defaultProps === void 0) {
                    var Te = ce;
                    return Te = UH(ce), x.tag = te, x.type = Te, NX(x, ce), J3(g, x, Te, F, K, oe);
                  }
                  {
                    var Ce = ce.propTypes;
                    Ce && hu(
                      Ce,
                      F,
                      // Resolved props
                      "prop",
                      Zr(ce)
                    );
                  }
                  var tt = Pf(U.type, null, F, x, x.mode, oe);
                  return tt.ref = x.ref, tt.return = x, x.child = tt, tt;
                }
                {
                  var ft = U.type, Rt = ft.propTypes;
                  Rt && hu(
                    Rt,
                    F,
                    // Resolved props
                    "prop",
                    Zr(ft)
                  );
                }
                var ct = g.child;
                if (!nf(K, oe)) {
                  var Ft = ct.memoizedProps, wr = U.compare;
                  if (wr = wr !== null ? wr : $a, wr(Ft, F) && g.ref === x.ref)
                    return Rd(g, x, oe);
                }
                x.flags |= FA;
                var Yr = nc(ct, F);
                return Yr.ref = x.ref, Yr.return = x, x.child = Yr, Yr;
              }
              function J3(g, x, U, F, K, oe) {
                if (x.type !== x.elementType) {
                  var ce = x.elementType;
                  if (ce.$$typeof === Ur) {
                    var Te = ce, Ce = Te._payload, tt = Te._init;
                    try {
                      ce = tt(Ce);
                    } catch {
                      ce = null;
                    }
                    var ft = ce && ce.propTypes;
                    ft && hu(
                      ft,
                      F,
                      // Resolved (SimpleMemoComponent has no defaultProps)
                      "prop",
                      Zr(ce)
                    );
                  }
                }
                if (g !== null) {
                  var Rt = g.memoizedProps;
                  if ($a(Rt, F) && g.ref === x.ref && // Prevent bailout if the implementation changed due to hot reload.
                  x.type === g.type)
                    if (eo = !1, nf(oe, K))
                      (g.flags & dP) !== Es && (eo = !0);
                    else
                      return x.lanes = g.lanes, Rd(g, x, oe);
                }
                return FX(g, x, U, F, oe);
              }
              function Ob(g, x, U) {
                var F = x.pendingProps, K = F.children, oe = g !== null ? g.memoizedState : null;
                if (F.mode === "hidden" || F.mode === "unstable-defer-without-hiding")
                  if ((x.mode & Xu) === s1) {
                    var ce = {
                      baseLanes: Zt
                    };
                    x.memoizedState = ce, P8(x, U);
                  } else if (nf(U, cA)) {
                    var ft = {
                      baseLanes: Zt
                    };
                    x.memoizedState = ft;
                    var Rt = oe !== null ? oe.baseLanes : U;
                    P8(x, Rt);
                  } else {
                    var Te;
                    if (oe !== null) {
                      var Ce = oe.baseLanes;
                      Te = ca(Ce, U);
                    } else
                      Te = U;
                    Cd(cA), x.lanes = x.childLanes = cA;
                    var tt = {
                      baseLanes: Te
                    };
                    return x.memoizedState = tt, P8(x, Te), null;
                  }
                else {
                  var ct;
                  oe !== null ? (ct = ca(oe.baseLanes, U), x.memoizedState = null) : ct = U, P8(x, ct);
                }
                return uf(g, x, K, U), x.child;
              }
              var G6 = Ob;
              function ST(g, x, U) {
                var F = x.pendingProps;
                return uf(g, x, F, U), x.child;
              }
              function PH(g, x, U) {
                var F = x.pendingProps.children;
                return uf(g, x, F, U), x.child;
              }
              function cH(g, x, U) {
                {
                  x.flags |= fn;
                  var F = x.stateNode;
                  F.effectDuration = 0, F.passiveEffectDuration = 0;
                }
                var K = x.pendingProps, oe = K.children;
                return uf(g, x, oe, U), x.child;
              }
              function yb(g, x) {
                var U = x.ref;
                (g === null && U !== null || g !== null && g.ref !== U) && (x.flags |= uA);
              }
              function FX(g, x, U, F, K) {
                if (x.type !== x.elementType) {
                  var oe = U.propTypes;
                  oe && hu(
                    oe,
                    F,
                    // Resolved props
                    "prop",
                    Zr(U)
                  );
                }
                var ce;
                {
                  var Te = m3(x, U, !0);
                  ce = O7(x, Te);
                }
                var Ce;
                OP(x, K);
                {
                  if ($s.current = x, Fn(!0), Ce = xl(g, x, U, F, ce, K), x.mode & E1) {
                    qa();
                    try {
                      Ce = xl(g, x, U, F, ce, K);
                    } finally {
                      m1();
                    }
                  }
                  Fn(!1);
                }
                return g !== null && !eo ? (HT(g, x, K), Rd(g, x, K)) : (x.flags |= FA, uf(g, x, Ce, K), x.child);
              }
              function bu(g, x, U, F, K) {
                if (x.type !== x.elementType) {
                  var oe = U.propTypes;
                  oe && hu(
                    oe,
                    F,
                    // Resolved props
                    "prop",
                    Zr(U)
                  );
                }
                var ce;
                cl(U) ? (ce = !0, G4(x)) : ce = !1, OP(x, K);
                var Te = x.stateNode, Ce;
                Te === null ? (g !== null && (g.alternate = null, x.alternate = null, x.flags |= Qa), aT(x, U, F), oT(x, U, F, K), Ce = !0) : g === null ? Ce = wj(x, U, F, K) : Ce = qb(g, x, U, F, K);
                var tt = td(g, x, U, Ce, ce, K);
                {
                  var ft = x.stateNode;
                  Ce && ft.props !== F && (Gh || c("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", Zr(x.type) || "a component"), Gh = !0);
                }
                return tt;
              }
              function td(g, x, U, F, K, oe) {
                yb(g, x);
                var ce = (x.flags & bi) !== Es;
                if (!F && !ce)
                  return K && oj(x, U, !1), Rd(g, x, oe);
                var Te = x.stateNode;
                $s.current = x;
                var Ce;
                if (ce && typeof U.getDerivedStateFromError != "function")
                  Ce = null, BT();
                else {
                  if (Fn(!0), Ce = Te.render(), x.mode & E1) {
                    qa();
                    try {
                      Te.render();
                    } finally {
                      m1();
                    }
                  }
                  Fn(!1);
                }
                return x.flags |= FA, g !== null && ce ? WT(g, x, Ce, oe) : uf(g, x, Ce, oe), x.memoizedState = Te.state, K && oj(x, U, !0), x.child;
              }
              function UT(g) {
                var x = g.stateNode;
                x.pendingContext ? db(g, x.pendingContext, x.pendingContext !== x.context) : x.context && db(g, x.context, !1), Bd(g, x.containerInfo);
              }
              function kb(g, x, U) {
                UT(x);
                var F = x.updateQueue;
                if (!(g !== null && F !== null))
                  throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");
                var K = x.pendingProps, oe = x.memoizedState, ce = oe !== null ? oe.element : null;
                rT(g, x), R3(x, K, null, U);
                var Te = x.memoizedState, Ce = Te.element;
                if (Ce === ce)
                  return l6(), Rd(g, x, U);
                var tt = x.stateNode;
                if (tt.hydrate && Sj(x)) {
                  {
                    var ft = tt.mutableSourceEagerHydrationData;
                    if (ft != null)
                      for (var Rt = 0; Rt < ft.length; Rt += 2) {
                        var ct = ft[Rt], Ft = ft[Rt + 1];
                        BX(ct, Ft);
                      }
                  }
                  var wr = mj(x, null, Ce, U);
                  x.child = wr;
                  for (var Yr = wr; Yr; )
                    Yr.flags = Yr.flags & ~Qa | I1, Yr = Yr.sibling;
                } else
                  uf(g, x, Ce, U), l6();
                return x.child;
              }
              function IT(g, x, U) {
                eH(x), g === null && MP(x);
                var F = x.type, K = x.pendingProps, oe = g !== null ? g.memoizedProps : null, ce = K.children, Te = Zq(F, K);
                return Te ? ce = null : oe !== null && Zq(F, oe) && (x.flags |= Ni), yb(g, x), uf(g, x, ce, U), x.child;
              }
              function Eb(g, x) {
                return g === null && MP(x), null;
              }
              function RT(g, x, U, F, K) {
                g !== null && (g.alternate = null, x.alternate = null, x.flags |= Qa);
                var oe = x.pendingProps, ce = U, Te = ce._payload, Ce = ce._init, tt = Ce(Te);
                x.type = tt;
                var ft = x.tag = bx(tt), Rt = xo(tt, oe), ct;
                switch (ft) {
                  case T:
                    return NX(x, tt), x.type = tt = UH(tt), ct = FX(null, x, tt, Rt, K), ct;
                  case q:
                    return x.type = tt = b8(tt), ct = bu(null, x, tt, Rt, K), ct;
                  case O:
                    return x.type = tt = Tx(tt), ct = aa(null, x, tt, Rt, K), ct;
                  case Z: {
                    if (x.type !== x.elementType) {
                      var Ft = tt.propTypes;
                      Ft && hu(
                        Ft,
                        Rt,
                        // Resolved for outer only
                        "prop",
                        Zr(tt)
                      );
                    }
                    return ct = un(
                      null,
                      x,
                      tt,
                      xo(tt.type, Rt),
                      // The inner type can have defaults too
                      F,
                      K
                    ), ct;
                  }
                }
                var wr = "";
                throw tt !== null && typeof tt == "object" && tt.$$typeof === Ur && (wr = " Did you wrap a component in React.lazy() more than once?"), Error("Element type is invalid. Received a promise that resolves to: " + tt + ". Lazy element type must resolve to a class or function." + wr);
              }
              function wU(g, x, U, F, K) {
                g !== null && (g.alternate = null, x.alternate = null, x.flags |= Qa), x.tag = q;
                var oe;
                return cl(U) ? (oe = !0, G4(x)) : oe = !1, OP(x, K), aT(x, U, F), oT(x, U, F, K), td(null, x, U, !0, oe, K);
              }
              function bB(g, x, U, F) {
                g !== null && (g.alternate = null, x.alternate = null, x.flags |= Qa);
                var K = x.pendingProps, oe;
                {
                  var ce = m3(x, U, !1);
                  oe = O7(x, ce);
                }
                OP(x, F);
                var Te;
                {
                  if (U.prototype && typeof U.prototype.render == "function") {
                    var Ce = Zr(U) || "Unknown";
                    vf[Ce] || (c("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", Ce, Ce), vf[Ce] = !0);
                  }
                  x.mode & E1 && M6.recordLegacyContextWarning(x, null), Fn(!0), $s.current = x, Te = xl(null, x, U, K, oe, F), Fn(!1);
                }
                if (x.flags |= FA, typeof Te == "object" && Te !== null && typeof Te.render == "function" && Te.$$typeof === void 0) {
                  var tt = Zr(U) || "Unknown";
                  K3[tt] || (c("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", tt, tt, tt), K3[tt] = !0);
                }
                if (
                  // Run these checks in production only if the flag is off.
                  // Eventually we'll delete this branch altogether.
                  typeof Te == "object" && Te !== null && typeof Te.render == "function" && Te.$$typeof === void 0
                ) {
                  {
                    var ft = Zr(U) || "Unknown";
                    K3[ft] || (c("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", ft, ft, ft), K3[ft] = !0);
                  }
                  x.tag = q, x.memoizedState = null, x.updateQueue = null;
                  var Rt = !1;
                  cl(U) ? (Rt = !0, G4(x)) : Rt = !1, x.memoizedState = Te.state !== null && Te.state !== void 0 ? Te.state : null, gb(x);
                  var ct = U.getDerivedStateFromProps;
                  return typeof ct == "function" && TA(x, U, ct, K), Dj(x, Te), oT(x, U, K, F), td(null, x, U, !0, Rt, F);
                } else {
                  if (x.tag = T, x.mode & E1) {
                    qa();
                    try {
                      Te = xl(null, x, U, K, oe, F);
                    } finally {
                      m1();
                    }
                  }
                  return uf(null, x, Te, F), NX(x, U), x.child;
                }
              }
              function NX(g, x) {
                {
                  if (x && x.childContextTypes && c("%s(...): childContextTypes cannot be defined on a function component.", x.displayName || x.name || "Component"), g.ref !== null) {
                    var U = "", F = z9();
                    F && (U += `

Check the render method of \`` + F + "`.");
                    var K = F || g._debugID || "", oe = g._debugSource;
                    oe && (K = oe.fileName + ":" + oe.lineNumber), Cb[K] || (Cb[K] = !0, c("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", U));
                  }
                  if (typeof x.getDerivedStateFromProps == "function") {
                    var ce = Zr(x) || "Unknown";
                    zh[ce] || (c("%s: Function components do not support getDerivedStateFromProps.", ce), zh[ce] = !0);
                  }
                  if (typeof x.contextType == "object" && x.contextType !== null) {
                    var Te = Zr(x) || "Unknown";
                    Jh[Te] || (c("%s: Function components do not support contextType.", Te), Jh[Te] = !0);
                  }
                }
              }
              var Zh = {
                dehydrated: null,
                retryLane: Ln
              };
              function QX(g) {
                return {
                  baseLanes: g
                };
              }
              function Fb(g, x) {
                return {
                  baseLanes: ca(g.baseLanes, x)
                };
              }
              function Ej(g, x, U, F) {
                if (x !== null) {
                  var K = x.memoizedState;
                  if (K === null)
                    return !1;
                }
                return Oh(g, NP);
              }
              function Nb(g, x) {
                return hP(g.childLanes, x);
              }
              function Qb(g, x, U) {
                var F = x.pendingProps;
                m8(x) && (x.flags |= bi);
                var K = u6.current, oe = !1, ce = (x.flags & bi) !== Es;
                if (ce || Ej(K, g) ? (oe = !0, x.flags &= ~bi) : (g === null || g.memoizedState !== null) && F.fallback !== void 0 && F.unstable_avoidThisFallback !== !0 && (K = xb(K, Ch)), K = rH(K), QP(x, K), g === null) {
                  F.fallback !== void 0 && MP(x);
                  var Te = F.children, Ce = F.fallback;
                  if (oe) {
                    var tt = CT(x, Te, Ce, U), ft = x.child;
                    return ft.memoizedState = QX(U), x.memoizedState = Zh, tt;
                  } else if (typeof F.unstable_expectedLoadTime == "number") {
                    var Rt = CT(x, Te, Ce, U), ct = x.child;
                    return ct.memoizedState = QX(U), x.memoizedState = Zh, x.lanes = lv, Cd(lv), Rt;
                  } else
                    return VT(x, Te, U);
                } else {
                  var Ft = g.memoizedState;
                  if (Ft !== null)
                    if (oe) {
                      var wr = F.fallback, Yr = F.children, Si = OT(g, x, Yr, wr, U), os = x.child, Ci = g.child.memoizedState;
                      return os.memoizedState = Ci === null ? QX(U) : Fb(Ci, U), os.childLanes = Nb(g, U), x.memoizedState = Zh, Si;
                    } else {
                      var ea = F.children, to = hH(g, x, ea, U);
                      return x.memoizedState = null, to;
                    }
                  else if (oe) {
                    var Nt = F.fallback, dr = F.children, ht = OT(g, x, dr, Nt, U), Or = x.child, hn = g.child.memoizedState;
                    return Or.memoizedState = hn === null ? QX(U) : Fb(hn, U), Or.childLanes = Nb(g, U), x.memoizedState = Zh, ht;
                  } else {
                    var Nn = F.children, Fs = hH(g, x, Nn, U);
                    return x.memoizedState = null, Fs;
                  }
                }
              }
              function VT(g, x, U) {
                var F = g.mode, K = {
                  mode: "visible",
                  children: x
                }, oe = sc(K, F, U, null);
                return oe.return = g, g.child = oe, oe;
              }
              function CT(g, x, U, F) {
                var K = g.mode, oe = g.child, ce = {
                  mode: "hidden",
                  children: x
                }, Te, Ce;
                return (K & ZA) === s1 && oe !== null ? (Te = oe, Te.childLanes = Zt, Te.pendingProps = ce, g.mode & v6 && (Te.actualDuration = 0, Te.actualStartTime = -1, Te.selfBaseDuration = 0, Te.treeBaseDuration = 0), Ce = g1(U, K, F, null)) : (Te = sc(ce, K, Zt, null), Ce = g1(U, K, F, null)), Te.return = g, Ce.return = g, Te.sibling = Ce, g.child = Te, Ce;
              }
              function pH(g, x) {
                return nc(g, x);
              }
              function hH(g, x, U, F) {
                var K = g.child, oe = K.sibling, ce = pH(K, {
                  mode: "visible",
                  children: U
                });
                return (x.mode & ZA) === s1 && (ce.lanes = F), ce.return = x, ce.sibling = null, oe !== null && (oe.nextEffect = null, oe.flags = Ms, x.firstEffect = x.lastEffect = oe), x.child = ce, ce;
              }
              function OT(g, x, U, F, K) {
                var oe = x.mode, ce = g.child, Te = ce.sibling, Ce = {
                  mode: "hidden",
                  children: U
                }, tt;
                if (
                  // In legacy mode, we commit the primary tree as if it successfully
                  // completed, even though it's in an inconsistent state.
                  (oe & ZA) === s1 && // Make sure we're on the second pass, i.e. the primary child fragment was
                  // already cloned. In legacy mode, the only case where this isn't true is
                  // when DevTools forces us to display a fallback; we skip the first render
                  // pass entirely and go straight to rendering the fallback. (In Concurrent
                  // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
                  // only codepath.)
                  x.child !== ce
                ) {
                  var ft = x.child;
                  tt = ft, tt.childLanes = Zt, tt.pendingProps = Ce, x.mode & v6 && (tt.actualDuration = 0, tt.actualStartTime = -1, tt.selfBaseDuration = ce.selfBaseDuration, tt.treeBaseDuration = ce.treeBaseDuration);
                  var Rt = tt.lastEffect;
                  Rt !== null ? (x.firstEffect = tt.firstEffect, x.lastEffect = Rt, Rt.nextEffect = null) : x.firstEffect = x.lastEffect = null;
                } else
                  tt = pH(ce, Ce);
                var ct;
                return Te !== null ? ct = nc(Te, F) : (ct = g1(F, oe, K, null), ct.flags |= Qa), ct.return = x, tt.return = x, tt.sibling = ct, x.child = tt, ct;
              }
              function YX(g, x) {
                g.lanes = ca(g.lanes, x);
                var U = g.alternate;
                U !== null && (U.lanes = ca(U.lanes, x)), Hb(g.return, x);
              }
              function HH(g, x, U) {
                for (var F = x; F !== null; ) {
                  if (F.tag === ee) {
                    var K = F.memoizedState;
                    K !== null && YX(F, U);
                  } else if (F.tag === L)
                    YX(F, U);
                  else if (F.child !== null) {
                    F.child.return = F, F = F.child;
                    continue;
                  }
                  if (F === g)
                    return;
                  for (; F.sibling === null; ) {
                    if (F.return === null || F.return === g)
                      return;
                    F = F.return;
                  }
                  F.sibling.return = F.return, F = F.sibling;
                }
              }
              function yT(g) {
                for (var x = g, U = null; x !== null; ) {
                  var F = x.alternate;
                  F !== null && yh(F) === null && (U = x), x = x.sibling;
                }
                return U;
              }
              function kT(g) {
                if (g !== void 0 && g !== "forwards" && g !== "backwards" && g !== "together" && !ur[g])
                  if (ur[g] = !0, typeof g == "string")
                    switch (g.toLowerCase()) {
                      case "together":
                      case "forwards":
                      case "backwards": {
                        c('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', g, g.toLowerCase());
                        break;
                      }
                      case "forward":
                      case "backward": {
                        c('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', g, g.toLowerCase());
                        break;
                      }
                      default:
                        c('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', g);
                        break;
                    }
                  else
                    c('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', g);
              }
              function MX(g, x) {
                g !== void 0 && !z6[g] && (g !== "collapsed" && g !== "hidden" ? (z6[g] = !0, c('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', g)) : x !== "forwards" && x !== "backwards" && (z6[g] = !0, c('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', g)));
              }
              function ET(g, x) {
                {
                  var U = Array.isArray(g), F = !U && typeof li(g) == "function";
                  if (U || F) {
                    var K = U ? "array" : "iterable";
                    return c("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", K, x, K), !1;
                  }
                }
                return !0;
              }
              function FT(g, x) {
                if ((x === "forwards" || x === "backwards") && g !== void 0 && g !== null && g !== !1)
                  if (Array.isArray(g)) {
                    for (var U = 0; U < g.length; U++)
                      if (!ET(g[U], U))
                        return;
                  } else {
                    var F = li(g);
                    if (typeof F == "function") {
                      var K = F.call(g);
                      if (K)
                        for (var oe = K.next(), ce = 0; !oe.done; oe = K.next()) {
                          if (!ET(oe.value, ce))
                            return;
                          ce++;
                        }
                    } else
                      c('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', x);
                  }
              }
              function gH(g, x, U, F, K, oe) {
                var ce = g.memoizedState;
                ce === null ? g.memoizedState = {
                  isBackwards: x,
                  rendering: null,
                  renderingStartTime: 0,
                  last: F,
                  tail: U,
                  tailMode: K,
                  lastEffect: oe
                } : (ce.isBackwards = x, ce.rendering = null, ce.renderingStartTime = 0, ce.last = F, ce.tail = U, ce.tailMode = K, ce.lastEffect = oe);
              }
              function LX(g, x, U) {
                var F = x.pendingProps, K = F.revealOrder, oe = F.tail, ce = F.children;
                kT(K), MX(oe, K), FT(ce, K), uf(g, x, ce, U);
                var Te = u6.current, Ce = Oh(Te, NP);
                if (Ce)
                  Te = Wd(Te, NP), x.flags |= bi;
                else {
                  var tt = g !== null && (g.flags & bi) !== Es;
                  tt && HH(x, x.child, U), Te = rH(Te);
                }
                if (QP(x, Te), (x.mode & ZA) === s1)
                  x.memoizedState = null;
                else
                  switch (K) {
                    case "forwards": {
                      var ft = yT(x.child), Rt;
                      ft === null ? (Rt = x.child, x.child = null) : (Rt = ft.sibling, ft.sibling = null), gH(
                        x,
                        !1,
                        // isBackwards
                        Rt,
                        ft,
                        oe,
                        x.lastEffect
                      );
                      break;
                    }
                    case "backwards": {
                      var ct = null, Ft = x.child;
                      for (x.child = null; Ft !== null; ) {
                        var wr = Ft.alternate;
                        if (wr !== null && yh(wr) === null) {
                          x.child = Ft;
                          break;
                        }
                        var Yr = Ft.sibling;
                        Ft.sibling = ct, ct = Ft, Ft = Yr;
                      }
                      gH(
                        x,
                        !0,
                        // isBackwards
                        ct,
                        null,
                        // last
                        oe,
                        x.lastEffect
                      );
                      break;
                    }
                    case "together": {
                      gH(
                        x,
                        !1,
                        // isBackwards
                        null,
                        // tail
                        null,
                        // last
                        void 0,
                        x.lastEffect
                      );
                      break;
                    }
                    default:
                      x.memoizedState = null;
                  }
                return x.child;
              }
              function Fj(g, x, U) {
                Bd(x, x.stateNode.containerInfo);
                var F = x.pendingProps;
                return g === null ? x.child = O3(x, null, F, U) : uf(g, x, F, U), x.child;
              }
              var NT = !1;
              function QT(g, x, U) {
                var F = x.type, K = F._context, oe = x.pendingProps, ce = x.memoizedProps, Te = oe.value;
                {
                  "value" in oe || NT || (NT = !0, c("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));
                  var Ce = x.type.propTypes;
                  Ce && hu(Ce, oe, "prop", "Context.Provider");
                }
                if (Xv(x, Te), ce !== null) {
                  var tt = ce.value, ft = hb(K, Te, tt);
                  if (ft === 0) {
                    if (ce.children === oe.children && !z4())
                      return Rd(g, x, U);
                  } else
                    Tj(x, K, ft, U);
                }
                var Rt = oe.children;
                return uf(g, x, Rt, U), x.child;
              }
              var Nj = !1;
              function YT(g, x, U) {
                var F = x.type;
                F._context === void 0 ? F !== F.Consumer && (Nj || (Nj = !0, c("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))) : F = F._context;
                var K = x.pendingProps, oe = K.children;
                typeof oe != "function" && c("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."), OP(x, U);
                var ce = F1(F, K.unstable_observedBits), Te;
                return $s.current = x, Fn(!0), Te = oe(ce), Fn(!1), x.flags |= FA, uf(g, x, Te, U), x.child;
              }
              function KX() {
                eo = !0;
              }
              function Rd(g, x, U) {
                return g !== null && (x.dependencies = g.dependencies), BT(), Cf(x.lanes), nf(U, x.childLanes) ? (Bj(g, x), x.child) : null;
              }
              function Yb(g, x, U) {
                {
                  var F = x.return;
                  if (F === null)
                    throw new Error("Cannot swap the root fiber.");
                  if (g.alternate = null, x.alternate = null, U.index = x.index, U.sibling = x.sibling, U.return = x.return, U.ref = x.ref, x === F.child)
                    F.child = U;
                  else {
                    var K = F.child;
                    if (K === null)
                      throw new Error("Expected parent to have a child.");
                    for (; K.sibling !== x; )
                      if (K = K.sibling, K === null)
                        throw new Error("Expected to find the previous sibling.");
                    K.sibling = U;
                  }
                  var oe = F.lastEffect;
                  return oe !== null ? (oe.nextEffect = g, F.lastEffect = g) : F.firstEffect = F.lastEffect = g, g.nextEffect = null, g.flags = Ms, U.flags |= Qa, U;
                }
              }
              function JX(g, x, U) {
                var F = x.lanes;
                if (x._debugNeedsRemount && g !== null)
                  return Yb(g, x, Pf(x.type, x.key, x.pendingProps, x._debugOwner || null, x.mode, x.lanes));
                if (g !== null) {
                  var K = g.memoizedProps, oe = x.pendingProps;
                  if (K !== oe || z4() || // Force a re-render if the implementation changed due to hot reload:
                  x.type !== g.type)
                    eo = !0;
                  else if (nf(U, F))
                    (g.flags & dP) !== Es ? eo = !0 : eo = !1;
                  else {
                    switch (eo = !1, x.tag) {
                      case j:
                        UT(x), l6();
                        break;
                      case m:
                        eH(x);
                        break;
                      case q: {
                        var ce = x.type;
                        cl(ce) && G4(x);
                        break;
                      }
                      case w:
                        Bd(x, x.stateNode.containerInfo);
                        break;
                      case y: {
                        var Te = x.memoizedProps.value;
                        Xv(x, Te);
                        break;
                      }
                      case Y:
                        {
                          var Ce = nf(U, x.childLanes);
                          Ce && (x.flags |= fn);
                          var tt = x.stateNode;
                          tt.effectDuration = 0, tt.passiveEffectDuration = 0;
                        }
                        break;
                      case ee: {
                        var ft = x.memoizedState;
                        if (ft !== null) {
                          var Rt = x.child, ct = Rt.childLanes;
                          if (nf(U, ct))
                            return Qb(g, x, U);
                          QP(x, rH(u6.current));
                          var Ft = Rd(g, x, U);
                          return Ft !== null ? Ft.sibling : null;
                        } else
                          QP(x, rH(u6.current));
                        break;
                      }
                      case L: {
                        var wr = (g.flags & bi) !== Es, Yr = nf(U, x.childLanes);
                        if (wr) {
                          if (Yr)
                            return LX(g, x, U);
                          x.flags |= bi;
                        }
                        var Si = x.memoizedState;
                        if (Si !== null && (Si.rendering = null, Si.tail = null, Si.lastEffect = null), QP(x, u6.current), Yr)
                          break;
                        return null;
                      }
                      case ge:
                      case me:
                        return x.lanes = Zt, Ob(g, x, U);
                    }
                    return Rd(g, x, U);
                  }
                } else
                  eo = !1;
                switch (x.lanes = Zt, x.tag) {
                  case b:
                    return bB(g, x, x.type, U);
                  case fe: {
                    var os = x.elementType;
                    return RT(g, x, os, F, U);
                  }
                  case T: {
                    var Ci = x.type, ea = x.pendingProps, to = x.elementType === Ci ? ea : xo(Ci, ea);
                    return FX(g, x, Ci, to, U);
                  }
                  case q: {
                    var Nt = x.type, dr = x.pendingProps, ht = x.elementType === Nt ? dr : xo(Nt, dr);
                    return bu(g, x, Nt, ht, U);
                  }
                  case j:
                    return kb(g, x, U);
                  case m:
                    return IT(g, x, U);
                  case I:
                    return Eb(g, x);
                  case ee:
                    return Qb(g, x, U);
                  case w:
                    return Fj(g, x, U);
                  case O: {
                    var Or = x.type, hn = x.pendingProps, Nn = x.elementType === Or ? hn : xo(Or, hn);
                    return aa(g, x, Or, Nn, U);
                  }
                  case N:
                    return ST(g, x, U);
                  case k:
                    return PH(g, x, U);
                  case Y:
                    return cH(g, x, U);
                  case y:
                    return QT(g, x, U);
                  case R:
                    return YT(g, x, U);
                  case Z: {
                    var Fs = x.type, Do = x.pendingProps, o1 = xo(Fs, Do);
                    if (x.type !== x.elementType) {
                      var pa = Fs.propTypes;
                      pa && hu(
                        pa,
                        o1,
                        // Resolved for outer only
                        "prop",
                        Zr(Fs)
                      );
                    }
                    return o1 = xo(Fs.type, o1), un(g, x, Fs, o1, F, U);
                  }
                  case te:
                    return J3(g, x, x.type, x.pendingProps, F, U);
                  case _: {
                    var pf = x.type, Ls = x.pendingProps, lo = x.elementType === pf ? Ls : xo(pf, Ls);
                    return wU(g, x, pf, lo, U);
                  }
                  case L:
                    return LX(g, x, U);
                  case $:
                    break;
                  case ae:
                    break;
                  case Pe:
                    break;
                  case ge:
                    return Ob(g, x, U);
                  case me:
                    return G6(g, x, U);
                }
                throw Error("Unknown unit of work tag (" + x.tag + "). This error is likely caused by a bug in React. Please file an issue.");
              }
              function _P(g) {
                g.flags |= fn;
              }
              function Mb(g) {
                g.flags |= uA;
              }
              var MT, LT, Qj, zX;
              MT = function(g, x, U, F) {
                for (var K = x.child; K !== null; ) {
                  if (K.tag === m || K.tag === I)
                    KD(g, K.stateNode);
                  else if (K.tag !== w) {
                    if (K.child !== null) {
                      K.child.return = K, K = K.child;
                      continue;
                    }
                  }
                  if (K === x)
                    return;
                  for (; K.sibling === null; ) {
                    if (K.return === null || K.return === x)
                      return;
                    K = K.return;
                  }
                  K.sibling.return = K.return, K = K.sibling;
                }
              }, LT = function(g) {
              }, Qj = function(g, x, U, F, K) {
                var oe = g.memoizedProps;
                if (oe !== F) {
                  var ce = x.stateNode, Te = FP(), Ce = nX(ce, U, oe, F, K, Te);
                  x.updateQueue = Ce, Ce && _P(x);
                }
              }, zX = function(g, x, U, F) {
                U !== F && _P(x);
              };
              function XH(g, x) {
                if (!wb())
                  switch (g.tailMode) {
                    case "hidden": {
                      for (var U = g.tail, F = null; U !== null; )
                        U.alternate !== null && (F = U), U = U.sibling;
                      F === null ? g.tail = null : F.sibling = null;
                      break;
                    }
                    case "collapsed": {
                      for (var K = g.tail, oe = null; K !== null; )
                        K.alternate !== null && (oe = K), K = K.sibling;
                      oe === null ? !x && g.tail !== null ? g.tail.sibling = null : g.tail = null : oe.sibling = null;
                      break;
                    }
                  }
              }
              function Lb(g, x, U) {
                var F = x.pendingProps;
                switch (x.tag) {
                  case b:
                  case fe:
                  case te:
                  case T:
                  case O:
                  case N:
                  case k:
                  case Y:
                  case R:
                  case Z:
                    return null;
                  case q: {
                    var K = x.type;
                    return cl(K) && y7(x), null;
                  }
                  case j: {
                    Rh(x), Ab(x), aH();
                    var oe = x.stateNode;
                    if (oe.pendingContext && (oe.context = oe.pendingContext, oe.pendingContext = null), g === null || g.child === null) {
                      var ce = cT(x);
                      ce ? _P(x) : oe.hydrate || (x.flags |= xi);
                    }
                    return LT(x), null;
                  }
                  case m: {
                    Vh(x);
                    var Te = Wj(), Ce = x.type;
                    if (g !== null && x.stateNode != null)
                      Qj(g, x, Ce, F, Te), g.ref !== x.ref && Mb(x);
                    else {
                      if (!F) {
                        if (x.stateNode === null)
                          throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                        return null;
                      }
                      var tt = FP(), ft = cT(x);
                      if (ft)
                        Db(x, Te, tt) && _P(x);
                      else {
                        var Rt = Q4(Ce, F, Te, tt, x);
                        MT(Rt, x, !1, !1), x.stateNode = Rt, Gq(Rt, Ce, F, Te) && _P(x);
                      }
                      x.ref !== null && Mb(x);
                    }
                    return null;
                  }
                  case I: {
                    var ct = F;
                    if (g && x.stateNode != null) {
                      var Ft = g.memoizedProps;
                      zX(g, x, Ft, ct);
                    } else {
                      if (typeof ct != "string" && x.stateNode === null)
                        throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                      var wr = Wj(), Yr = FP(), Si = cT(x);
                      Si ? TB(x) && _P(x) : x.stateNode = Y4(ct, wr, Yr, x);
                    }
                    return null;
                  }
                  case ee: {
                    Xl(x);
                    var os = x.memoizedState;
                    if ((x.flags & bi) !== Es)
                      return x.lanes = U, (x.mode & v6) !== s1 && ZP(x), x;
                    var Ci = os !== null, ea = !1;
                    if (g === null)
                      x.memoizedProps.fallback !== void 0 && cT(x);
                    else {
                      var to = g.memoizedState;
                      ea = to !== null;
                    }
                    if (Ci && !ea && (x.mode & ZA) !== s1) {
                      var Nt = g === null && x.memoizedProps.unstable_avoidThisFallback !== !0;
                      Nt || Oh(u6.current, Ch) ? BB() : sw();
                    }
                    return (Ci || ea) && (x.flags |= fn), null;
                  }
                  case w:
                    return Rh(x), LT(x), g === null && vB(x.stateNode.containerInfo), null;
                  case y:
                    return K7(x), null;
                  case _: {
                    var dr = x.type;
                    return cl(dr) && y7(x), null;
                  }
                  case L: {
                    Xl(x);
                    var ht = x.memoizedState;
                    if (ht === null)
                      return null;
                    var Or = (x.flags & bi) !== Es, hn = ht.rendering;
                    if (hn === null)
                      if (Or)
                        XH(ht, !1);
                      else {
                        var Nn = Px() && (g === null || (g.flags & bi) === Es);
                        if (!Nn)
                          for (var Fs = x.child; Fs !== null; ) {
                            var Do = yh(Fs);
                            if (Do !== null) {
                              Or = !0, x.flags |= bi, XH(ht, !1);
                              var o1 = Do.updateQueue;
                              return o1 !== null && (x.updateQueue = o1, x.flags |= fn), ht.lastEffect === null && (x.firstEffect = null), x.lastEffect = ht.lastEffect, Uh(x, U), QP(x, Wd(u6.current, NP)), x.child;
                            }
                            Fs = Fs.sibling;
                          }
                        ht.tail !== null && Y6() > o8() && (x.flags |= bi, Or = !0, XH(ht, !1), x.lanes = lv, Cd(lv));
                      }
                    else {
                      if (!Or) {
                        var pa = yh(hn);
                        if (pa !== null) {
                          x.flags |= bi, Or = !0;
                          var pf = pa.updateQueue;
                          if (pf !== null && (x.updateQueue = pf, x.flags |= fn), XH(ht, !0), ht.tail === null && ht.tailMode === "hidden" && !hn.alternate && !wb()) {
                            var Ls = x.lastEffect = ht.lastEffect;
                            return Ls !== null && (Ls.nextEffect = null), null;
                          }
                        } else
                          // The time it took to render last row is greater than the remaining
                          // time we have to render. So rendering one more row would likely
                          // exceed it.
                          Y6() * 2 - ht.renderingStartTime > o8() && U !== cA && (x.flags |= bi, Or = !0, XH(ht, !1), x.lanes = lv, Cd(lv));
                      }
                      if (ht.isBackwards)
                        hn.sibling = x.child, x.child = hn;
                      else {
                        var lo = ht.last;
                        lo !== null ? lo.sibling = hn : x.child = hn, ht.last = hn;
                      }
                    }
                    if (ht.tail !== null) {
                      var s9 = ht.tail;
                      ht.rendering = s9, ht.tail = s9.sibling, ht.lastEffect = x.lastEffect, ht.renderingStartTime = Y6(), s9.sibling = null;
                      var Yo = u6.current;
                      return Or ? Yo = Wd(Yo, NP) : Yo = rH(Yo), QP(x, Yo), s9;
                    }
                    return null;
                  }
                  case $:
                    break;
                  case ae:
                    break;
                  case Pe:
                    break;
                  case ge:
                  case me: {
                    if (c8(x), g !== null) {
                      var Rl = x.memoizedState, Q1 = g.memoizedState, Sv = Q1 !== null, P0 = Rl !== null;
                      Sv !== P0 && F.mode !== "unstable-defer-without-hiding" && (x.flags |= fn);
                    }
                    return null;
                  }
                }
                throw Error("Unknown unit of work tag (" + x.tag + "). This error is likely caused by a bug in React. Please file an issue.");
              }
              function Yj(g, x) {
                switch (g.tag) {
                  case q: {
                    var U = g.type;
                    cl(U) && y7(g);
                    var F = g.flags;
                    return F & QA ? (g.flags = F & ~QA | bi, (g.mode & v6) !== s1 && ZP(g), g) : null;
                  }
                  case j: {
                    Rh(g), Ab(g), aH();
                    var K = g.flags;
                    if ((K & bi) !== Es)
                      throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");
                    return g.flags = K & ~QA | bi, g;
                  }
                  case m:
                    return Vh(g), null;
                  case ee: {
                    Xl(g);
                    var oe = g.flags;
                    return oe & QA ? (g.flags = oe & ~QA | bi, (g.mode & v6) !== s1 && ZP(g), g) : null;
                  }
                  case L:
                    return Xl(g), null;
                  case w:
                    return Rh(g), null;
                  case y:
                    return K7(g), null;
                  case ge:
                  case me:
                    return c8(g), null;
                  default:
                    return null;
                }
              }
              function Mj(g) {
                switch (g.tag) {
                  case q: {
                    var x = g.type.childContextTypes;
                    x != null && y7(g);
                    break;
                  }
                  case j: {
                    Rh(g), Ab(g), aH();
                    break;
                  }
                  case m: {
                    Vh(g);
                    break;
                  }
                  case w:
                    Rh(g);
                    break;
                  case ee:
                    Xl(g);
                    break;
                  case L:
                    Xl(g);
                    break;
                  case y:
                    K7(g);
                    break;
                  case ge:
                  case me:
                    c8(g);
                    break;
                }
              }
              function GX(g, x) {
                return {
                  value: g,
                  source: x,
                  stack: OA(x)
                };
              }
              function TH(g, x) {
                return !0;
              }
              function Kb(g, x) {
                try {
                  var U = TH(g, x);
                  if (U === !1)
                    return;
                  var F = x.value, K = x.source, oe = x.stack, ce = oe !== null ? oe : "";
                  if (F != null && F._suppressLogging) {
                    if (g.tag === q)
                      return;
                    console.error(F);
                  }
                  var Te = K ? Zr(K.type) : null, Ce = Te ? "The above error occurred in the <" + Te + "> component:" : "The above error occurred in one of your React components:", tt, ft = Zr(g.type);
                  ft ? tt = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + ft + ".") : tt = `Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;
                  var Rt = Ce + `
` + ce + `

` + ("" + tt);
                  console.error(Rt);
                } catch (ct) {
                  setTimeout(function() {
                    throw ct;
                  });
                }
              }
              var xB = typeof WeakMap == "function" ? WeakMap : Map;
              function KT(g, x, U) {
                var F = XA(_a, U);
                F.tag = Tv, F.payload = {
                  element: null
                };
                var K = x.value;
                return F.callback = function() {
                  mu(K), Kb(g, x);
                }, F;
              }
              function Jb(g, x, U) {
                var F = XA(_a, U);
                F.tag = Tv;
                var K = g.type.getDerivedStateFromError;
                if (typeof K == "function") {
                  var oe = x.value;
                  F.payload = function() {
                    return Kb(g, x), K(oe);
                  };
                }
                var ce = g.stateNode;
                return ce !== null && typeof ce.componentDidCatch == "function" ? F.callback = function() {
                  hw(g), typeof K != "function" && (VB(this), Kb(g, x));
                  var Ce = x.value, tt = x.stack;
                  this.componentDidCatch(Ce, {
                    componentStack: tt !== null ? tt : ""
                  }), typeof K != "function" && (nf(g.lanes, qs) || c("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", Zr(g.type) || "Unknown"));
                } : F.callback = function() {
                  hw(g);
                }, F;
              }
              function Lj(g, x, U) {
                var F = g.pingCache, K;
                if (F === null ? (F = g.pingCache = new xB(), K = /* @__PURE__ */ new Set(), F.set(x, K)) : (K = F.get(x), K === void 0 && (K = /* @__PURE__ */ new Set(), F.set(x, K))), !K.has(U)) {
                  K.add(U);
                  var oe = hx.bind(null, g, x, U);
                  x.then(oe, oe);
                }
              }
              function Kj(g, x, U, F, K) {
                if (U.flags |= ov, U.firstEffect = U.lastEffect = null, F !== null && typeof F == "object" && typeof F.then == "function") {
                  var oe = F;
                  if ((U.mode & ZA) === s1) {
                    var ce = U.alternate;
                    ce ? (U.updateQueue = ce.updateQueue, U.memoizedState = ce.memoizedState, U.lanes = ce.lanes) : (U.updateQueue = null, U.memoizedState = null);
                  }
                  var Te = Oh(u6.current, Ch), Ce = x;
                  do {
                    if (Ce.tag === ee && nH(Ce, Te)) {
                      var tt = Ce.updateQueue;
                      if (tt === null) {
                        var ft = /* @__PURE__ */ new Set();
                        ft.add(oe), Ce.updateQueue = ft;
                      } else
                        tt.add(oe);
                      if ((Ce.mode & ZA) === s1) {
                        if (Ce.flags |= bi, U.flags |= dP, U.flags &= ~(NA | ov), U.tag === q) {
                          var Rt = U.alternate;
                          if (Rt === null)
                            U.tag = _;
                          else {
                            var ct = XA(_a, qs);
                            ct.tag = Sh, wd(U, ct);
                          }
                        }
                        U.lanes = ca(U.lanes, qs);
                        return;
                      }
                      Lj(g, oe, K), Ce.flags |= QA, Ce.lanes = K;
                      return;
                    }
                    Ce = Ce.return;
                  } while (Ce !== null);
                  F = new Error((Zr(U.type) || "A React component") + ` suspended while rendering, but no fallback UI was specified.

Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`);
                }
                WB(), F = GX(F, U);
                var Ft = x;
                do {
                  switch (Ft.tag) {
                    case j: {
                      var wr = F;
                      Ft.flags |= QA;
                      var Yr = V1(K);
                      Ft.lanes = ca(Ft.lanes, Yr);
                      var Si = KT(Ft, wr, Yr);
                      I3(Ft, Si);
                      return;
                    }
                    case q:
                      var os = F, Ci = Ft.type, ea = Ft.stateNode;
                      if ((Ft.flags & bi) === Es && (typeof Ci.getDerivedStateFromError == "function" || ea !== null && typeof ea.componentDidCatch == "function" && !px(ea))) {
                        Ft.flags |= QA;
                        var to = V1(K);
                        Ft.lanes = ca(Ft.lanes, to);
                        var Nt = Jb(Ft, os, to);
                        I3(Ft, Nt);
                        return;
                      }
                      break;
                  }
                  Ft = Ft.return;
                } while (Ft !== null);
              }
              var ZX = null;
              ZX = /* @__PURE__ */ new Set();
              var zb = typeof WeakSet == "function" ? WeakSet : Set, Jj = function(g, x) {
                x.props = g.memoizedProps, x.state = g.memoizedState, x.componentWillUnmount();
              };
              function zj(g, x) {
                if (Z9(null, Jj, null, g, x), _9()) {
                  var U = Sf();
                  tp(g, U);
                }
              }
              function Gb(g) {
                var x = g.ref;
                if (x !== null)
                  if (typeof x == "function") {
                    if (Z9(null, x, null, null), _9()) {
                      var U = Sf();
                      tp(g, U);
                    }
                  } else
                    x.current = null;
              }
              function jl(g, x) {
                if (Z9(null, x, null), _9()) {
                  var U = Sf();
                  tp(g, U);
                }
              }
              function xu(g, x) {
                switch (x.tag) {
                  case T:
                  case O:
                  case te:
                  case Pe:
                    return;
                  case q: {
                    if (x.flags & xi && g !== null) {
                      var U = g.memoizedProps, F = g.memoizedState, K = x.stateNode;
                      x.type === x.elementType && !Gh && (K.props !== x.memoizedProps && c("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Zr(x.type) || "instance"), K.state !== x.memoizedState && c("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Zr(x.type) || "instance"));
                      var oe = K.getSnapshotBeforeUpdate(x.elementType === x.type ? U : xo(x.type, U), F);
                      {
                        var ce = ZX;
                        oe === void 0 && !ce.has(x.type) && (ce.add(x.type), c("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", Zr(x.type)));
                      }
                      K.__reactInternalSnapshotBeforeUpdate = oe;
                    }
                    return;
                  }
                  case j: {
                    if (x.flags & xi) {
                      var Te = x.stateNode;
                      qh(Te.containerInfo);
                    }
                    return;
                  }
                  case m:
                  case I:
                  case w:
                  case _:
                    return;
                }
                throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
              function JT(g, x) {
                var U = x.updateQueue, F = U !== null ? U.lastEffect : null;
                if (F !== null) {
                  var K = F.next, oe = K;
                  do {
                    if ((oe.tag & g) === g) {
                      var ce = oe.destroy;
                      oe.destroy = void 0, ce !== void 0 && ce();
                    }
                    oe = oe.next;
                  } while (oe !== K);
                }
              }
              function Zb(g, x) {
                var U = x.updateQueue, F = U !== null ? U.lastEffect : null;
                if (F !== null) {
                  var K = F.next, oe = K;
                  do {
                    if ((oe.tag & g) === g) {
                      var ce = oe.create;
                      oe.destroy = ce();
                      {
                        var Te = oe.destroy;
                        if (Te !== void 0 && typeof Te != "function") {
                          var Ce = void 0;
                          Te === null ? Ce = " You returned null. If your effect does not require clean up, return undefined (or nothing)." : typeof Te.then == "function" ? Ce = `

It looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:

useEffect(() => {
  async function fetchData() {
    // You can await here
    const response = await MyAPI.getData(someId);
    // ...
  }
  fetchData();
}, [someId]); // Or [] if effect doesn't need props or state

Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching` : Ce = " You returned: " + Te, c("An effect function must not return anything besides a function, which is used for clean-up.%s", Ce);
                        }
                      }
                    }
                    oe = oe.next;
                  } while (oe !== K);
                }
              }
              function Qi(g) {
                var x = g.updateQueue, U = x !== null ? x.lastEffect : null;
                if (U !== null) {
                  var F = U.next, K = F;
                  do {
                    var oe = K, ce = oe.next, Te = oe.tag;
                    (Te & sH) !== iH && (Te & Tl) !== iH && (h2(g, K), BH(g, K)), K = ce;
                  } while (K !== F);
                }
              }
              function wl(g, x, U, F) {
                switch (U.tag) {
                  case T:
                  case O:
                  case te:
                  case Pe: {
                    Zb(kh | Tl, U), Qi(U);
                    return;
                  }
                  case q: {
                    var K = U.stateNode;
                    if (U.flags & fn)
                      if (x === null)
                        U.type === U.elementType && !Gh && (K.props !== U.memoizedProps && c("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Zr(U.type) || "instance"), K.state !== U.memoizedState && c("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Zr(U.type) || "instance")), K.componentDidMount();
                      else {
                        var oe = U.elementType === U.type ? x.memoizedProps : xo(U.type, x.memoizedProps), ce = x.memoizedState;
                        U.type === U.elementType && !Gh && (K.props !== U.memoizedProps && c("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Zr(U.type) || "instance"), K.state !== U.memoizedState && c("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Zr(U.type) || "instance")), K.componentDidUpdate(oe, ce, K.__reactInternalSnapshotBeforeUpdate);
                      }
                    var Te = U.updateQueue;
                    Te !== null && (U.type === U.elementType && !Gh && (K.props !== U.memoizedProps && c("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Zr(U.type) || "instance"), K.state !== U.memoizedState && c("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Zr(U.type) || "instance")), gl(U, Te, K));
                    return;
                  }
                  case j: {
                    var Ce = U.updateQueue;
                    if (Ce !== null) {
                      var tt = null;
                      if (U.child !== null)
                        switch (U.child.tag) {
                          case m:
                            tt = U.child.stateNode;
                            break;
                          case q:
                            tt = U.child.stateNode;
                            break;
                        }
                      gl(U, Ce, tt);
                    }
                    return;
                  }
                  case m: {
                    var ft = U.stateNode;
                    if (x === null && U.flags & fn) {
                      var Rt = U.type, ct = U.memoizedProps;
                      eB(ft, Rt, ct);
                    }
                    return;
                  }
                  case I:
                    return;
                  case w:
                    return;
                  case Y: {
                    {
                      var Ft = U.memoizedProps;
                      Ft.onCommit;
                      var wr = Ft.onRender;
                      U.stateNode.effectDuration;
                      var Yr = kj();
                      typeof wr == "function" && wr(U.memoizedProps.id, x === null ? "mount" : "update", U.actualDuration, U.treeBaseDuration, U.actualStartTime, Yr, g.memoizedInteractions);
                    }
                    return;
                  }
                  case ee: {
                    ex(g, U);
                    return;
                  }
                  case L:
                  case _:
                  case $:
                  case ae:
                  case ge:
                  case me:
                    return;
                }
                throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
              function _b(g, x) {
                for (var U = g; ; ) {
                  if (U.tag === m) {
                    var F = U.stateNode;
                    x ? _q(F) : I7(U.stateNode, U.memoizedProps);
                  } else if (U.tag === I) {
                    var K = U.stateNode;
                    x ? M4(K) : GD(K, U.memoizedProps);
                  } else if (!((U.tag === ge || U.tag === me) && U.memoizedState !== null && U !== g)) {
                    if (U.child !== null) {
                      U.child.return = U, U = U.child;
                      continue;
                    }
                  }
                  if (U === g)
                    return;
                  for (; U.sibling === null; ) {
                    if (U.return === null || U.return === g)
                      return;
                    U = U.return;
                  }
                  U.sibling.return = U.return, U = U.sibling;
                }
              }
              function zT(g) {
                var x = g.ref;
                if (x !== null) {
                  var U = g.stateNode, F;
                  switch (g.tag) {
                    case m:
                      F = U;
                      break;
                    default:
                      F = U;
                  }
                  typeof x == "function" ? x(F) : (x.hasOwnProperty("current") || c("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", Zr(g.type)), x.current = F);
                }
              }
              function _X(g) {
                var x = g.ref;
                x !== null && (typeof x == "function" ? x(null) : x.current = null);
              }
              function $X(g, x, U) {
                switch (dj(x), x.tag) {
                  case T:
                  case O:
                  case Z:
                  case te:
                  case Pe: {
                    var F = x.updateQueue;
                    if (F !== null) {
                      var K = F.lastEffect;
                      if (K !== null) {
                        var oe = K.next, ce = oe;
                        do {
                          var Te = ce, Ce = Te.destroy, tt = Te.tag;
                          Ce !== void 0 && ((tt & sH) !== iH ? h2(x, ce) : jl(x, Ce)), ce = ce.next;
                        } while (ce !== oe);
                      }
                    }
                    return;
                  }
                  case q: {
                    Gb(x);
                    var ft = x.stateNode;
                    typeof ft.componentWillUnmount == "function" && zj(x, ft);
                    return;
                  }
                  case m: {
                    Gb(x);
                    return;
                  }
                  case w: {
                    ZT(g, x);
                    return;
                  }
                  case $:
                    return;
                  case G:
                    return;
                  case ae:
                    return;
                }
              }
              function _h(g, x, U) {
                for (var F = x; ; ) {
                  if ($X(g, F), F.child !== null && // If we use mutation we drill down into portals using commitUnmount above.
                  // If we don't use mutation we drill down into portals here instead.
                  F.tag !== w) {
                    F.child.return = F, F = F.child;
                    continue;
                  }
                  if (F === x)
                    return;
                  for (; F.sibling === null; ) {
                    if (F.return === null || F.return === x)
                      return;
                    F = F.return;
                  }
                  F.sibling.return = F.return, F = F.sibling;
                }
              }
              function e2(g) {
                g.alternate = null, g.child = null, g.dependencies = null, g.firstEffect = null, g.lastEffect = null, g.memoizedProps = null, g.memoizedState = null, g.pendingProps = null, g.return = null, g.updateQueue = null, g._debugOwner = null;
              }
              function Gj(g) {
                for (var x = g.return; x !== null; ) {
                  if (Zj(x))
                    return x;
                  x = x.return;
                }
                throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
              }
              function Zj(g) {
                return g.tag === m || g.tag === j || g.tag === w;
              }
              function DB(g) {
                var x = g;
                e:
                  for (; ; ) {
                    for (; x.sibling === null; ) {
                      if (x.return === null || Zj(x.return))
                        return null;
                      x = x.return;
                    }
                    for (x.sibling.return = x.return, x = x.sibling; x.tag !== m && x.tag !== I && x.tag !== G; ) {
                      if (x.flags & Qa || x.child === null || x.tag === w)
                        continue e;
                      x.child.return = x, x = x.child;
                    }
                    if (!(x.flags & Qa))
                      return x.stateNode;
                  }
              }
              function $b(g) {
                var x = Gj(g), U, F, K = x.stateNode;
                switch (x.tag) {
                  case m:
                    U = K, F = !1;
                    break;
                  case j:
                    U = K.containerInfo, F = !0;
                    break;
                  case w:
                    U = K.containerInfo, F = !0;
                    break;
                  case $:
                  default:
                    throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
                }
                x.flags & Ni && (HA(U), x.flags &= ~Ni);
                var oe = DB(g);
                F ? GT(g, oe, U) : t2(g, oe, U);
              }
              function GT(g, x, U) {
                var F = g.tag, K = F === m || F === I;
                if (K || De) {
                  var oe = K ? g.stateNode : g.stateNode.instance;
                  x ? Xh(U, oe, x) : D3(U, oe);
                } else if (F !== w) {
                  var ce = g.child;
                  if (ce !== null) {
                    GT(ce, x, U);
                    for (var Te = ce.sibling; Te !== null; )
                      GT(Te, x, U), Te = Te.sibling;
                  }
                }
              }
              function t2(g, x, U) {
                var F = g.tag, K = F === m || F === I;
                if (K || De) {
                  var oe = K ? g.stateNode : g.stateNode.instance;
                  x ? zD(U, oe, x) : aX(U, oe);
                } else if (F !== w) {
                  var ce = g.child;
                  if (ce !== null) {
                    t2(ce, x, U);
                    for (var Te = ce.sibling; Te !== null; )
                      t2(Te, x, U), Te = Te.sibling;
                  }
                }
              }
              function ZT(g, x, U) {
                for (var F = x, K = !1, oe, ce; ; ) {
                  if (!K) {
                    var Te = F.return;
                    e:
                      for (; ; ) {
                        if (Te === null)
                          throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
                        var Ce = Te.stateNode;
                        switch (Te.tag) {
                          case m:
                            oe = Ce, ce = !1;
                            break e;
                          case j:
                            oe = Ce.containerInfo, ce = !0;
                            break e;
                          case w:
                            oe = Ce.containerInfo, ce = !0;
                            break e;
                        }
                        Te = Te.return;
                      }
                    K = !0;
                  }
                  if (F.tag === m || F.tag === I)
                    _h(g, F), ce ? U7(oe, F.stateNode) : Th(oe, F.stateNode);
                  else if (F.tag === w) {
                    if (F.child !== null) {
                      oe = F.stateNode.containerInfo, ce = !0, F.child.return = F, F = F.child;
                      continue;
                    }
                  } else if ($X(g, F), F.child !== null) {
                    F.child.return = F, F = F.child;
                    continue;
                  }
                  if (F === x)
                    return;
                  for (; F.sibling === null; ) {
                    if (F.return === null || F.return === x)
                      return;
                    F = F.return, F.tag === w && (K = !1);
                  }
                  F.sibling.return = F.return, F = F.sibling;
                }
              }
              function _j(g, x, U) {
                ZT(g, x);
                var F = x.alternate;
                e2(x), F !== null && e2(F);
              }
              function $h(g, x) {
                switch (x.tag) {
                  case T:
                  case O:
                  case Z:
                  case te:
                  case Pe: {
                    JT(kh | Tl, x);
                    return;
                  }
                  case q:
                    return;
                  case m: {
                    var U = x.stateNode;
                    if (U != null) {
                      var F = x.memoizedProps, K = g !== null ? g.memoizedProps : F, oe = x.type, ce = x.updateQueue;
                      x.updateQueue = null, ce !== null && JD(U, ce, oe, K, F);
                    }
                    return;
                  }
                  case I: {
                    if (x.stateNode === null)
                      throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
                    var Te = x.stateNode, Ce = x.memoizedProps, tt = g !== null ? g.memoizedProps : Ce;
                    sX(Te, tt, Ce);
                    return;
                  }
                  case j: {
                    {
                      var ft = x.stateNode;
                      ft.hydrate && (ft.hydrate = !1, sB(ft.containerInfo));
                    }
                    return;
                  }
                  case Y:
                    return;
                  case ee: {
                    ml(x), Du(x);
                    return;
                  }
                  case L: {
                    Du(x);
                    return;
                  }
                  case _:
                    return;
                  case $:
                    break;
                  case ae:
                    break;
                  case ge:
                  case me: {
                    var Rt = x.memoizedState, ct = Rt !== null;
                    _b(x, ct);
                    return;
                  }
                }
                throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
              function ml(g) {
                var x = g.memoizedState;
                if (x !== null) {
                  p2();
                  {
                    var U = g.child;
                    _b(U, !0);
                  }
                }
              }
              function ex(g, x) {
                var U = x.memoizedState;
                if (U === null) {
                  var F = x.alternate;
                  if (F !== null) {
                    var K = F.memoizedState;
                    if (K !== null) {
                      var oe = K.dehydrated;
                      oe !== null && $D(oe);
                    }
                  }
                }
              }
              function Du(g) {
                var x = g.updateQueue;
                if (x !== null) {
                  g.updateQueue = null;
                  var U = g.stateNode;
                  U === null && (U = g.stateNode = new zb()), x.forEach(function(F) {
                    var K = OB.bind(null, g, F);
                    U.has(F) || (F.__reactDoNotTraceInteractions !== !0 && (K = l.unstable_wrap(K)), U.add(F), F.then(K, K));
                  });
                }
              }
              function _T(g, x) {
                if (g !== null) {
                  var U = g.memoizedState;
                  if (U === null || U.dehydrated !== null) {
                    var F = x.memoizedState;
                    return F !== null && F.dehydrated === null;
                  }
                }
                return !1;
              }
              function tx(g) {
                HA(g.stateNode);
              }
              if (typeof Symbol == "function" && Symbol.for) {
                var ju = Symbol.for;
                ju("selector.component"), ju("selector.has_pseudo_class"), ju("selector.role"), ju("selector.test_id"), ju("selector.text");
              }
              var rx = [];
              function $j() {
                rx.forEach(function(g) {
                  return g();
                });
              }
              var nx = Math.ceil, $T = P.ReactCurrentDispatcher, e8 = P.ReactCurrentOwner, r2 = P.IsSomeRendererActing, Fo = (
                /*             */
                0
              ), t8 = (
                /*               */
                1
              ), jB = (
                /*                 */
                2
              ), n2 = (
                /*         */
                4
              ), r8 = (
                /*       */
                8
              ), rd = (
                /*                */
                16
              ), Bl = (
                /*                */
                32
              ), e0 = (
                /*       */
                64
              ), n9 = 0, qH = 1, z3 = 2, t0 = 3, bH = 4, i2 = 5, Ti = Fo, c6 = null, No = null, Ka = Zt, Wl = Zt, n8 = w3(Zt), lf = n9, s2 = null, G3 = Zt, i8 = Zt, Z3 = Zt, s8 = Zt, a2 = null, o2 = 0, ix = 500, a8 = 1 / 0, ew = 500;
              function xH() {
                a8 = Y6() + ew;
              }
              function o8() {
                return a8;
              }
              var zn = null, f8 = !1, sx = null, DH = null, $P = !1, ec = null, r0 = Pb, f2 = Zt, A8 = [], ax = [], Sl = null, tw = 50, _3 = 0, ox = null, fx = 50, A2 = 0, n0 = null, d2 = _a, Dv = Zt, d8 = Zt, Ax = !1, jH = null, v2 = !1;
              function v8() {
                return c6;
              }
              function Vd() {
                return (Ti & (rd | Bl)) !== Fo ? Y6() : (d2 !== _a || (d2 = Y6()), d2);
              }
              function $3(g) {
                var x = g.mode;
                if ((x & ZA) === s1)
                  return qs;
                if ((x & Xu) === s1)
                  return F7() === GA ? qs : Zf;
                Dv === Zt && (Dv = G3);
                var U = IP() !== wh;
                if (U)
                  return d8 !== Zt && (d8 = a2 !== null ? a2.pendingLanes : Zt), s6(Dv, d8);
                var F = F7(), K;
                if (
                  // TODO: Temporary. We're removing the concept of discrete updates.
                  (Ti & n2) !== Fo && F === jh
                )
                  K = Hd(uv, Dv);
                else {
                  var oe = l7(F);
                  K = Hd(oe, Dv);
                }
                return K;
              }
              function wB(g) {
                var x = g.mode;
                return (x & ZA) === s1 ? qs : (x & Xu) === s1 ? F7() === GA ? qs : Zf : (Dv === Zt && (Dv = G3), Uq(Dv));
              }
              function W9(g, x, U) {
                yB(), EB(g);
                var F = u8(g, x);
                if (F === null)
                  return kB(g), null;
                Gp(F, x, U), F === c6 && (Z3 = ca(Z3, x), lf === bH && i0(F, Ka));
                var K = F7();
                x === qs ? /* Check if we're inside unbatchedUpdates */ (Ti & r8) !== Fo && // Check if we're not already rendering
                (Ti & (rd | Bl)) === Fo ? (rc(F, x), vx(F)) : (nd(F, U), rc(F, x), Ti === Fo && (xH(), Hv())) : ((Ti & n2) !== Fo && // Only updates at user-blocking priority or greater are considered
                // discrete, even inside a discrete event.
                (K === jh || K === GA) && (Sl === null ? Sl = /* @__PURE__ */ new Set([F]) : Sl.add(F)), nd(F, U), rc(F, x)), a2 = F;
              }
              function u8(g, x) {
                g.lanes = ca(g.lanes, x);
                var U = g.alternate;
                U !== null && (U.lanes = ca(U.lanes, x)), U === null && (g.flags & (Qa | I1)) !== Es && Hx(g);
                for (var F = g, K = g.return; K !== null; )
                  K.childLanes = ca(K.childLanes, x), U = K.alternate, U !== null ? U.childLanes = ca(U.childLanes, x) : (K.flags & (Qa | I1)) !== Es && Hx(g), F = K, K = K.return;
                if (F.tag === j) {
                  var oe = F.stateNode;
                  return oe;
                } else
                  return null;
              }
              function nd(g, x) {
                var U = g.callbackNode;
                Lp(g, x);
                var F = pA(g, g === c6 ? Ka : Zt), K = Rg();
                if (F === Zt) {
                  U !== null && (S3(U), g.callbackNode = null, g.callbackPriority = sa);
                  return;
                }
                if (U !== null) {
                  var oe = g.callbackPriority;
                  if (oe === K)
                    return;
                  S3(U);
                }
                var ce;
                if (K === j9)
                  ce = N7(vx.bind(null, g));
                else if (K === tl)
                  ce = W3(GA, vx.bind(null, g));
                else {
                  var Te = PP(K);
                  ce = W3(Te, dx.bind(null, g));
                }
                g.callbackPriority = K, g.callbackNode = ce;
              }
              function dx(g) {
                if (d2 = _a, Dv = Zt, d8 = Zt, (Ti & (rd | Bl)) !== Fo)
                  throw Error("Should not already be working.");
                var x = g.callbackNode, U = jv();
                if (U && g.callbackNode !== x)
                  return null;
                var F = pA(g, g === c6 ? Ka : Zt);
                if (F === Zt)
                  return null;
                var K = p6(g, F);
                if (nf(G3, Z3))
                  wu(g, Zt);
                else if (K !== n9) {
                  if (K === z3 && (Ti |= e0, g.hydrate && (g.hydrate = !1, qh(g.containerInfo)), F = Kp(g), F !== Zt && (K = wH(g, F))), K === qH) {
                    var oe = s2;
                    throw wu(g, Zt), i0(g, F), nd(g, Y6()), oe;
                  }
                  var ce = g.current.alternate;
                  g.finishedWork = ce, g.finishedLanes = F, rw(g, K, F);
                }
                return nd(g, Y6()), g.callbackNode === x ? dx.bind(null, g) : null;
              }
              function rw(g, x, U) {
                switch (x) {
                  case n9:
                  case qH:
                    throw Error("Root did not complete. This is a bug in React.");
                  case z3: {
                    a0(g);
                    break;
                  }
                  case t0: {
                    if (i0(g, U), Jp(U) && // do not delay if we're inside an act() scope
                    !Xx()) {
                      var F = o2 + ix - Y6();
                      if (F > 10) {
                        var K = pA(g, Zt);
                        if (K !== Zt)
                          break;
                        var oe = g.suspendedLanes;
                        if (!pP(oe, U)) {
                          Vd(), i3(g, oe);
                          break;
                        }
                        g.timeoutHandle = gh(a0.bind(null, g), F);
                        break;
                      }
                    }
                    a0(g);
                    break;
                  }
                  case bH: {
                    if (i0(g, U), cP(U))
                      break;
                    {
                      var ce = Yp(g, U), Te = ce, Ce = Y6() - Te, tt = Aw(Ce) - Ce;
                      if (tt > 10) {
                        g.timeoutHandle = gh(a0.bind(null, g), tt);
                        break;
                      }
                    }
                    a0(g);
                    break;
                  }
                  case i2: {
                    a0(g);
                    break;
                  }
                  default:
                    throw Error("Unknown root exit status.");
                }
              }
              function i0(g, x) {
                x = hP(x, s8), x = hP(x, Z3), T4(g, x);
              }
              function vx(g) {
                if ((Ti & (rd | Bl)) !== Fo)
                  throw Error("Should not already be working.");
                jv();
                var x, U;
                if (g === c6 && nf(g.expiredLanes, Ka) ? (x = Ka, U = wH(g, x), nf(G3, Z3) && (x = pA(g, x), U = wH(g, x))) : (x = pA(g, Zt), U = wH(g, x)), g.tag !== vb && U === z3 && (Ti |= e0, g.hydrate && (g.hydrate = !1, qh(g.containerInfo)), x = Kp(g), x !== Zt && (U = wH(g, x))), U === qH) {
                  var F = s2;
                  throw wu(g, Zt), i0(g, x), nd(g, Y6()), F;
                }
                var K = g.current.alternate;
                return g.finishedWork = K, g.finishedLanes = x, a0(g), nd(g, Y6()), null;
              }
              function nw() {
                if ((Ti & (t8 | rd | Bl)) !== Fo) {
                  (Ti & rd) !== Fo && c("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");
                  return;
                }
                mB(), jv();
              }
              function mB() {
                if (Sl !== null) {
                  var g = Sl;
                  Sl = null, g.forEach(function(x) {
                    q4(x), nd(x, Y6());
                  });
                }
                Hv();
              }
              function s0(g, x) {
                var U = Ti;
                Ti |= t8;
                try {
                  return g(x);
                } finally {
                  Ti = U, Ti === Fo && (xH(), Hv());
                }
              }
              function l8(g, x) {
                var U = Ti;
                Ti |= jB;
                try {
                  return g(x);
                } finally {
                  Ti = U, Ti === Fo && (xH(), Hv());
                }
              }
              function tc(g, x, U, F, K) {
                var oe = Ti;
                Ti |= n2;
                try {
                  return B3(jh, g.bind(null, x, U, F, K));
                } finally {
                  Ti = oe, Ti === Fo && (xH(), Hv());
                }
              }
              function iw(g, x) {
                var U = Ti;
                Ti &= ~t8, Ti |= r8;
                try {
                  return g(x);
                } finally {
                  Ti = U, Ti === Fo && (xH(), Hv());
                }
              }
              function u2(g, x) {
                var U = Ti;
                if ((U & (rd | Bl)) !== Fo)
                  return c("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."), g(x);
                Ti |= t8;
                try {
                  return g ? B3(GA, g.bind(null, x)) : void 0;
                } finally {
                  Ti = U, Hv();
                }
              }
              function P8(g, x) {
                t9(n8, Wl, g), Wl = ca(Wl, x), G3 = ca(G3, x);
              }
              function c8(g) {
                Wl = n8.current, Q6(n8, g);
              }
              function wu(g, x) {
                g.finishedWork = null, g.finishedLanes = Zt;
                var U = g.timeoutHandle;
                if (U !== iX && (g.timeoutHandle = iX, $m(U)), No !== null)
                  for (var F = No.return; F !== null; )
                    Mj(F), F = F.return;
                c6 = g, No = nc(g.current, null), Ka = Wl = G3 = x, lf = n9, s2 = null, i8 = Zt, Z3 = Zt, s8 = Zt, n0 = null, M6.discardPendingWarnings();
              }
              function ux(g, x) {
                do {
                  var U = No;
                  try {
                    if (gX(), UX(), Fa(), e8.current = null, U === null || U.return === null) {
                      lf = qH, s2 = x, No = null;
                      return;
                    }
                    Xe && U.mode & v6 && GP(U, !0), Kj(g, U.return, U, x, Ka), ep(U);
                  } catch (F) {
                    x = F, No === U && U !== null ? (U = U.return, No = U) : U = No;
                    continue;
                  }
                  return;
                } while (!0);
              }
              function lx() {
                var g = $T.current;
                return $T.current = lH, g === null ? lH : g;
              }
              function l2(g) {
                $T.current = g;
              }
              function P2(g) {
                {
                  var x = l.__interactionsRef.current;
                  return l.__interactionsRef.current = g.memoizedInteractions, x;
                }
              }
              function c2(g) {
                l.__interactionsRef.current = g;
              }
              function p2() {
                o2 = Y6();
              }
              function Cf(g) {
                i8 = ca(g, i8);
              }
              function BB() {
                lf === n9 && (lf = t0);
              }
              function sw() {
                (lf === n9 || lf === t0) && (lf = bH), c6 !== null && (sl(i8) || sl(Z3)) && i0(c6, Ka);
              }
              function WB() {
                lf !== i2 && (lf = z3);
              }
              function Px() {
                return lf === n9;
              }
              function wH(g, x) {
                var U = Ti;
                Ti |= rd;
                var F = lx();
                (c6 !== g || Ka !== x) && (wu(g, x), q8(g, x));
                var K = P2(g);
                do
                  try {
                    p8();
                    break;
                  } catch (oe) {
                    ux(g, oe);
                  }
                while (!0);
                if (gX(), c2(K), Ti = U, l2(F), No !== null)
                  throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
                return c6 = null, Ka = Zt, lf;
              }
              function p8() {
                for (; No !== null; )
                  Qn(No);
              }
              function p6(g, x) {
                var U = Ti;
                Ti |= rd;
                var F = lx();
                (c6 !== g || Ka !== x) && (xH(), wu(g, x), q8(g, x));
                var K = P2(g);
                do
                  try {
                    SB();
                    break;
                  } catch (oe) {
                    ux(g, oe);
                  }
                while (!0);
                return gX(), c2(K), l2(F), Ti = U, No !== null ? n9 : (c6 = null, Ka = Zt, lf);
              }
              function SB() {
                for (; No !== null && !HB(); )
                  Qn(No);
              }
              function Qn(g) {
                var x = g.alternate;
                Sa(g);
                var U;
                (g.mode & v6) !== s1 ? (Kh(g), U = H2(x, g, Wl), GP(g, !0)) : U = H2(x, g, Wl), Fa(), g.memoizedProps = g.pendingProps, U === null ? ep(g) : No = U, e8.current = null;
              }
              function ep(g) {
                var x = g;
                do {
                  var U = x.alternate, F = x.return;
                  if ((x.flags & ov) === Es) {
                    Sa(x);
                    var K = void 0;
                    if ((x.mode & v6) === s1 ? K = Lb(U, x, Wl) : (Kh(x), K = Lb(U, x, Wl), GP(x, !1)), Fa(), K !== null) {
                      No = K;
                      return;
                    }
                    if (mH(x), F !== null && // Do not append effects to parents if a sibling failed to complete
                    (F.flags & ov) === Es) {
                      F.firstEffect === null && (F.firstEffect = x.firstEffect), x.lastEffect !== null && (F.lastEffect !== null && (F.lastEffect.nextEffect = x.firstEffect), F.lastEffect = x.lastEffect);
                      var oe = x.flags;
                      oe > FA && (F.lastEffect !== null ? F.lastEffect.nextEffect = x : F.firstEffect = x, F.lastEffect = x);
                    }
                  } else {
                    var ce = Yj(x);
                    if (ce !== null) {
                      ce.flags &= _u, No = ce;
                      return;
                    }
                    if ((x.mode & v6) !== s1) {
                      GP(x, !1);
                      for (var Te = x.actualDuration, Ce = x.child; Ce !== null; )
                        Te += Ce.actualDuration, Ce = Ce.sibling;
                      x.actualDuration = Te;
                    }
                    F !== null && (F.firstEffect = F.lastEffect = null, F.flags |= ov);
                  }
                  var tt = x.sibling;
                  if (tt !== null) {
                    No = tt;
                    return;
                  }
                  x = F, No = x;
                } while (x !== null);
                lf === n9 && (lf = i2);
              }
              function mH(g) {
                if (
                  // TODO: Move this check out of the hot path by moving `resetChildLanes`
                  // to switch statement in `completeWork`.
                  !((g.tag === me || g.tag === ge) && g.memoizedState !== null && !nf(Wl, cA) && (g.mode & Xu) !== Zt)
                ) {
                  var x = Zt;
                  if ((g.mode & v6) !== s1) {
                    for (var U = g.actualDuration, F = g.selfBaseDuration, K = g.alternate === null || g.child !== g.alternate.child, oe = g.child; oe !== null; )
                      x = ca(x, ca(oe.lanes, oe.childLanes)), K && (U += oe.actualDuration), F += oe.treeBaseDuration, oe = oe.sibling;
                    var ce = g.tag === ee && g.memoizedState !== null;
                    if (ce) {
                      var Te = g.child;
                      Te !== null && (F -= Te.treeBaseDuration);
                    }
                    g.actualDuration = U, g.treeBaseDuration = F;
                  } else
                    for (var Ce = g.child; Ce !== null; )
                      x = ca(x, ca(Ce.lanes, Ce.childLanes)), Ce = Ce.sibling;
                  g.childLanes = x;
                }
              }
              function a0(g) {
                var x = F7();
                return B3(GA, UB.bind(null, g, x)), null;
              }
              function UB(g, x) {
                do
                  jv();
                while (ec !== null);
                if (h8(), (Ti & (rd | Bl)) !== Fo)
                  throw Error("Should not already be working.");
                var U = g.finishedWork, F = g.finishedLanes;
                if (U === null)
                  return null;
                if (g.finishedWork = null, g.finishedLanes = Zt, U === g.current)
                  throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
                g.callbackNode = null;
                var K = ca(U.lanes, U.childLanes);
                Iq(g, K), Sl !== null && !Vg(K) && Sl.has(g) && Sl.delete(g), g === c6 && (c6 = null, No = null, Ka = Zt);
                var oe;
                if (U.flags > FA ? U.lastEffect !== null ? (U.lastEffect.nextEffect = U, oe = U.firstEffect) : oe = U : oe = U.firstEffect, oe !== null) {
                  var ce = Ti;
                  Ti |= Bl;
                  var Te = P2(g);
                  e8.current = null, jH = N4(g.containerInfo), v2 = !1, zn = oe;
                  do
                    if (Z9(null, aw, null), _9()) {
                      if (zn === null)
                        throw Error("Should be working on an effect.");
                      var Ce = Sf();
                      tp(zn, Ce), zn = zn.nextEffect;
                    }
                  while (zn !== null);
                  jH = null, xn(), zn = oe;
                  do
                    if (Z9(null, cx, null, g, x), _9()) {
                      if (zn === null)
                        throw Error("Should be working on an effect.");
                      var tt = Sf();
                      tp(zn, tt), zn = zn.nextEffect;
                    }
                  while (zn !== null);
                  rX(g.containerInfo), g.current = U, zn = oe;
                  do
                    if (Z9(null, IB, null, g, F), _9()) {
                      if (zn === null)
                        throw Error("Should be working on an effect.");
                      var ft = Sf();
                      tp(zn, ft), zn = zn.nextEffect;
                    }
                  while (zn !== null);
                  zn = null, cb(), c2(Te), Ti = ce;
                } else
                  g.current = U, xn();
                var Rt = $P;
                if ($P)
                  $P = !1, ec = g, f2 = F, r0 = x;
                else
                  for (zn = oe; zn !== null; ) {
                    var ct = zn.nextEffect;
                    zn.nextEffect = null, zn.flags & Ms && g2(zn), zn = ct;
                  }
                if (K = g.pendingLanes, K !== Zt) {
                  if (n0 !== null) {
                    var Ft = n0;
                    n0 = null;
                    for (var wr = 0; wr < Ft.length; wr++)
                      lw(g, Ft[wr], g.memoizedInteractions);
                  }
                  rc(g, K);
                } else
                  DH = null;
                if (Rt || Pw(g, F), K === qs ? g === ox ? _3++ : (_3 = 0, ox = g) : _3 = 0, cB(U.stateNode, x), $j(), nd(g, Y6()), f8) {
                  f8 = !1;
                  var Yr = sx;
                  throw sx = null, Yr;
                }
                return (Ti & r8) !== Fo || Hv(), null;
              }
              function aw() {
                for (; zn !== null; ) {
                  var g = zn.alternate;
                  !v2 && jH !== null && ((zn.flags & Ms) !== Es ? t6(zn, jH) && (v2 = !0) : zn.tag === ee && _T(g, zn) && t6(zn, jH) && (v2 = !0));
                  var x = zn.flags;
                  (x & xi) !== Es && (Sa(zn), xu(g, zn), Fa()), (x & Ya) !== Es && ($P || ($P = !0, W3(SP, function() {
                    return jv(), null;
                  }))), zn = zn.nextEffect;
                }
              }
              function cx(g, x) {
                for (; zn !== null; ) {
                  Sa(zn);
                  var U = zn.flags;
                  if (U & Ni && tx(zn), U & uA) {
                    var F = zn.alternate;
                    F !== null && _X(F);
                  }
                  var K = U & (Qa | fn | Ms | I1);
                  switch (K) {
                    case Qa: {
                      $b(zn), zn.flags &= ~Qa;
                      break;
                    }
                    case Zu: {
                      $b(zn), zn.flags &= ~Qa;
                      var oe = zn.alternate;
                      $h(oe, zn);
                      break;
                    }
                    case I1: {
                      zn.flags &= ~I1;
                      break;
                    }
                    case vo: {
                      zn.flags &= ~I1;
                      var ce = zn.alternate;
                      $h(ce, zn);
                      break;
                    }
                    case fn: {
                      var Te = zn.alternate;
                      $h(Te, zn);
                      break;
                    }
                    case Ms: {
                      _j(g, zn);
                      break;
                    }
                  }
                  Fa(), zn = zn.nextEffect;
                }
              }
              function IB(g, x) {
                for (; zn !== null; ) {
                  Sa(zn);
                  var U = zn.flags;
                  if (U & (fn | _s)) {
                    var F = zn.alternate;
                    wl(g, F, zn);
                  }
                  U & uA && zT(zn), Fa(), zn = zn.nextEffect;
                }
              }
              function jv() {
                if (r0 !== Pb) {
                  var g = r0 > SP ? SP : r0;
                  return r0 = Pb, B3(g, RB);
                }
                return !1;
              }
              function BH(g, x) {
                A8.push(x, g), $P || ($P = !0, W3(SP, function() {
                  return jv(), null;
                }));
              }
              function h2(g, x) {
                ax.push(x, g);
                {
                  g.flags |= Uf;
                  var U = g.alternate;
                  U !== null && (U.flags |= Uf);
                }
                $P || ($P = !0, W3(SP, function() {
                  return jv(), null;
                }));
              }
              function ow(g) {
                var x = g.create;
                g.destroy = x();
              }
              function RB() {
                if (ec === null)
                  return !1;
                var g = ec, x = f2;
                if (ec = null, f2 = Zt, (Ti & (rd | Bl)) !== Fo)
                  throw Error("Cannot flush passive effects while already rendering.");
                Ax = !0;
                var U = Ti;
                Ti |= Bl;
                var F = P2(g), K = ax;
                ax = [];
                for (var oe = 0; oe < K.length; oe += 2) {
                  var ce = K[oe], Te = K[oe + 1], Ce = ce.destroy;
                  ce.destroy = void 0;
                  {
                    Te.flags &= ~Uf;
                    var tt = Te.alternate;
                    tt !== null && (tt.flags &= ~Uf);
                  }
                  if (typeof Ce == "function") {
                    if (Sa(Te), Z9(null, Ce, null), _9()) {
                      if (Te === null)
                        throw Error("Should be working on an effect.");
                      var ft = Sf();
                      tp(Te, ft);
                    }
                    Fa();
                  }
                }
                var Rt = A8;
                A8 = [];
                for (var ct = 0; ct < Rt.length; ct += 2) {
                  var Ft = Rt[ct], wr = Rt[ct + 1];
                  {
                    if (Sa(wr), Z9(null, ow, null, Ft), _9()) {
                      if (wr === null)
                        throw Error("Should be working on an effect.");
                      var Yr = Sf();
                      tp(wr, Yr);
                    }
                    Fa();
                  }
                }
                for (var Si = g.current.firstEffect; Si !== null; ) {
                  var os = Si.nextEffect;
                  Si.nextEffect = null, Si.flags & Ms && g2(Si), Si = os;
                }
                return c2(F), Pw(g, x), Ax = !1, Ti = U, Hv(), A2 = ec === null ? 0 : A2 + 1, !0;
              }
              function px(g) {
                return DH !== null && DH.has(g);
              }
              function VB(g) {
                DH === null ? DH = /* @__PURE__ */ new Set([g]) : DH.add(g);
              }
              function fw(g) {
                f8 || (f8 = !0, sx = g);
              }
              var mu = fw;
              function Ul(g, x, U) {
                var F = GX(U, x), K = KT(g, F, qs);
                wd(g, K);
                var oe = Vd(), ce = u8(g, qs);
                ce !== null && (Gp(ce, qs, oe), nd(ce, oe), rc(ce, qs));
              }
              function tp(g, x) {
                if (g.tag === j) {
                  Ul(g, g, x);
                  return;
                }
                for (var U = g.return; U !== null; ) {
                  if (U.tag === j) {
                    Ul(U, g, x);
                    return;
                  } else if (U.tag === q) {
                    var F = U.type, K = U.stateNode;
                    if (typeof F.getDerivedStateFromError == "function" || typeof K.componentDidCatch == "function" && !px(K)) {
                      var oe = GX(x, g), ce = Jb(U, oe, qs);
                      wd(U, ce);
                      var Te = Vd(), Ce = u8(U, qs);
                      if (Ce !== null)
                        Gp(Ce, qs, Te), nd(Ce, Te), rc(Ce, qs);
                      else if (typeof K.componentDidCatch == "function" && !px(K))
                        try {
                          K.componentDidCatch(x, oe);
                        } catch {
                        }
                      return;
                    }
                  }
                  U = U.return;
                }
              }
              function hx(g, x, U) {
                var F = g.pingCache;
                F !== null && F.delete(x);
                var K = Vd();
                i3(g, U), c6 === g && pP(Ka, U) && (lf === bH || lf === t0 && Jp(Ka) && Y6() - o2 < ix ? wu(g, Zt) : s8 = ca(s8, U)), nd(g, K), rc(g, U);
              }
              function CB(g, x) {
                x === Ln && (x = wB(g));
                var U = Vd(), F = u8(g, x);
                F !== null && (Gp(F, x, U), nd(F, U), rc(F, x));
              }
              function OB(g, x) {
                var U = Ln, F;
                F = g.stateNode, F !== null && F.delete(x), CB(g, U);
              }
              function Aw(g) {
                return g < 120 ? 120 : g < 480 ? 480 : g < 1080 ? 1080 : g < 1920 ? 1920 : g < 3e3 ? 3e3 : g < 4320 ? 4320 : nx(g / 1960) * 1960;
              }
              function yB() {
                if (_3 > tw)
                  throw _3 = 0, ox = null, Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
                A2 > fx && (A2 = 0, c("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."));
              }
              function h8() {
                M6.flushLegacyContextWarning(), M6.flushPendingUnsafeLifecycleWarnings();
              }
              var H8 = null;
              function Hx(g) {
                {
                  if ((Ti & rd) !== Fo || !(g.mode & (ZA | Xu)))
                    return;
                  var x = g.tag;
                  if (x !== b && x !== j && x !== q && x !== T && x !== O && x !== Z && x !== te && x !== Pe)
                    return;
                  var U = Zr(g.type) || "ReactComponent";
                  if (H8 !== null) {
                    if (H8.has(U))
                      return;
                    H8.add(U);
                  } else
                    H8 = /* @__PURE__ */ new Set([U]);
                  var F = go;
                  try {
                    Sa(g), c("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
                  } finally {
                    F ? Sa(g) : Fa();
                  }
                }
              }
              var WH = null;
              function kB(g) {
                {
                  var x = g.tag;
                  if (x !== j && x !== q && x !== T && x !== O && x !== Z && x !== te && x !== Pe || (g.flags & Uf) !== Es)
                    return;
                  var U = Zr(g.type) || "ReactComponent";
                  if (WH !== null) {
                    if (WH.has(U))
                      return;
                    WH.add(U);
                  } else
                    WH = /* @__PURE__ */ new Set([U]);
                  if (!Ax) {
                    var F = go;
                    try {
                      Sa(g), c("Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.", x === q ? "the componentWillUnmount method" : "a useEffect cleanup function");
                    } finally {
                      F ? Sa(g) : Fa();
                    }
                  }
                }
              }
              var H2;
              {
                var g8 = null;
                H2 = function(g, x, U) {
                  var F = ms(g8, x);
                  try {
                    return JX(g, x, U);
                  } catch (oe) {
                    if (oe !== null && typeof oe == "object" && typeof oe.then == "function")
                      throw oe;
                    if (gX(), UX(), Mj(x), ms(x, F), x.mode & v6 && Kh(x), Z9(null, JX, null, g, x, U), _9()) {
                      var K = Sf();
                      throw K;
                    } else
                      throw oe;
                  }
                };
              }
              var S9 = !1, id;
              id = /* @__PURE__ */ new Set();
              function EB(g) {
                if (G1 && (Ti & rd) !== Fo && !Oj())
                  switch (g.tag) {
                    case T:
                    case O:
                    case te: {
                      var x = No && Zr(No.type) || "Unknown", U = x;
                      if (!id.has(U)) {
                        id.add(U);
                        var F = Zr(g.type) || "Unknown";
                        c("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", F, x, x);
                      }
                      break;
                    }
                    case q: {
                      S9 || (c("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."), S9 = !0);
                      break;
                    }
                  }
              }
              var wv = {
                current: !1
              };
              function gx(g) {
                if (r2.current === !0 && wv.current !== !0) {
                  var x = go;
                  try {
                    Sa(g), c(`It looks like you're using the wrong act() around your test interactions.
Be sure to use the matching version of act() corresponding to your renderer:

// for react-dom:
import {act} from 'react-dom/test-utils';
// ...
act(() => ...);

// for react-test-renderer:
import TestRenderer from react-test-renderer';
const {act} = TestRenderer;
// ...
act(() => ...);`);
                  } finally {
                    x ? Sa(g) : Fa();
                  }
                }
              }
              function dw(g) {
                (g.mode & E1) !== s1 && r2.current === !1 && wv.current === !1 && c(`An update to %s ran an effect, but was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`, Zr(g.type));
              }
              function X8(g) {
                if (Ti === Fo && r2.current === !1 && wv.current === !1) {
                  var x = go;
                  try {
                    Sa(g), c(`An update to %s inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`, Zr(g.type));
                  } finally {
                    x ? Sa(g) : Fa();
                  }
                }
              }
              var vw = X8, uw = !1;
              function Bu(g) {
                uw === !1 && u.unstable_flushAllWithoutAsserting === void 0 && (g.mode & ZA || g.mode & Xu) && (uw = !0, c(`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest: 
jest.mock('scheduler', () => require('scheduler/unstable_mock'));

For more info, visit https://reactjs.org/link/mock-scheduler`));
              }
              function T8(g, x) {
                return x * 1e3 + g.interactionThreadID;
              }
              function Cd(g) {
                n0 === null ? n0 = [g] : n0.push(g);
              }
              function lw(g, x, U) {
                if (U.size > 0) {
                  var F = g.pendingInteractionMap, K = F.get(x);
                  K != null ? U.forEach(function(Te) {
                    K.has(Te) || Te.__count++, K.add(Te);
                  }) : (F.set(x, new Set(U)), U.forEach(function(Te) {
                    Te.__count++;
                  }));
                  var oe = l.__subscriberRef.current;
                  if (oe !== null) {
                    var ce = T8(g, x);
                    oe.onWorkScheduled(U, ce);
                  }
                }
              }
              function rc(g, x) {
                lw(g, x, l.__interactionsRef.current);
              }
              function q8(g, x) {
                var U = /* @__PURE__ */ new Set();
                if (g.pendingInteractionMap.forEach(function(oe, ce) {
                  nf(x, ce) && oe.forEach(function(Te) {
                    return U.add(Te);
                  });
                }), g.memoizedInteractions = U, U.size > 0) {
                  var F = l.__subscriberRef.current;
                  if (F !== null) {
                    var K = T8(g, x);
                    try {
                      F.onWorkStarted(U, K);
                    } catch (oe) {
                      W3(GA, function() {
                        throw oe;
                      });
                    }
                  }
                }
              }
              function Pw(g, x) {
                var U = g.pendingLanes, F;
                try {
                  if (F = l.__subscriberRef.current, F !== null && g.memoizedInteractions.size > 0) {
                    var K = T8(g, x);
                    F.onWorkStopped(g.memoizedInteractions, K);
                  }
                } catch (ce) {
                  W3(GA, function() {
                    throw ce;
                  });
                } finally {
                  var oe = g.pendingInteractionMap;
                  oe.forEach(function(ce, Te) {
                    nf(U, Te) || (oe.delete(Te), ce.forEach(function(Ce) {
                      if (Ce.__count--, F !== null && Ce.__count === 0)
                        try {
                          F.onInteractionScheduledWorkCompleted(Ce);
                        } catch (tt) {
                          W3(GA, function() {
                            throw tt;
                          });
                        }
                    }));
                  });
                }
              }
              function Xx() {
                return FB > 0;
              }
              var FB = 0;
              function g2(g) {
                g.sibling = null, g.stateNode = null;
              }
              var mv = null, SH = null, cw = function(g) {
                mv = g;
              };
              function UH(g) {
                {
                  if (mv === null)
                    return g;
                  var x = mv(g);
                  return x === void 0 ? g : x.current;
                }
              }
              function b8(g) {
                return UH(g);
              }
              function Tx(g) {
                {
                  if (mv === null)
                    return g;
                  var x = mv(g);
                  if (x === void 0) {
                    if (g != null && typeof g.render == "function") {
                      var U = UH(g.render);
                      if (g.render !== U) {
                        var F = {
                          $$typeof: pr,
                          render: U
                        };
                        return g.displayName !== void 0 && (F.displayName = g.displayName), F;
                      }
                    }
                    return g;
                  }
                  return x.current;
                }
              }
              function pw(g, x) {
                {
                  if (mv === null)
                    return !1;
                  var U = g.elementType, F = x.type, K = !1, oe = typeof F == "object" && F !== null ? F.$$typeof : null;
                  switch (g.tag) {
                    case q: {
                      typeof F == "function" && (K = !0);
                      break;
                    }
                    case T: {
                      (typeof F == "function" || oe === Ur) && (K = !0);
                      break;
                    }
                    case O: {
                      (oe === pr || oe === Ur) && (K = !0);
                      break;
                    }
                    case Z:
                    case te: {
                      (oe === $t || oe === Ur) && (K = !0);
                      break;
                    }
                    default:
                      return !1;
                  }
                  if (K) {
                    var ce = mv(U);
                    if (ce !== void 0 && ce === mv(F))
                      return !0;
                  }
                  return !1;
                }
              }
              function hw(g) {
                {
                  if (mv === null || typeof WeakSet != "function")
                    return;
                  SH === null && (SH = /* @__PURE__ */ new WeakSet()), SH.add(g);
                }
              }
              var NB = function(g, x) {
                {
                  if (mv === null)
                    return;
                  var U = x.staleFamilies, F = x.updatedFamilies;
                  jv(), u2(function() {
                    qx(g.current, F, U);
                  });
                }
              }, Hw = function(g, x) {
                {
                  if (g.context !== Dd)
                    return;
                  jv(), u2(function() {
                    np(x, g, null, null);
                  });
                }
              };
              function qx(g, x, U) {
                {
                  var F = g.alternate, K = g.child, oe = g.sibling, ce = g.tag, Te = g.type, Ce = null;
                  switch (ce) {
                    case T:
                    case te:
                    case q:
                      Ce = Te;
                      break;
                    case O:
                      Ce = Te.render;
                      break;
                  }
                  if (mv === null)
                    throw new Error("Expected resolveFamily to be set during hot reload.");
                  var tt = !1, ft = !1;
                  if (Ce !== null) {
                    var Rt = mv(Ce);
                    Rt !== void 0 && (U.has(Rt) ? ft = !0 : x.has(Rt) && (ce === q ? ft = !0 : tt = !0));
                  }
                  SH !== null && (SH.has(g) || F !== null && SH.has(F)) && (ft = !0), ft && (g._debugNeedsRemount = !0), (ft || tt) && W9(g, qs, _a), K !== null && !ft && qx(K, x, U), oe !== null && qx(oe, x, U);
                }
              }
              var QB = function(g, x) {
                {
                  var U = /* @__PURE__ */ new Set(), F = new Set(x.map(function(K) {
                    return K.current;
                  }));
                  return x8(g.current, F, U), U;
                }
              };
              function x8(g, x, U) {
                {
                  var F = g.child, K = g.sibling, oe = g.tag, ce = g.type, Te = null;
                  switch (oe) {
                    case T:
                    case te:
                    case q:
                      Te = ce;
                      break;
                    case O:
                      Te = ce.render;
                      break;
                  }
                  var Ce = !1;
                  Te !== null && x.has(Te) && (Ce = !0), Ce ? YB(g, U) : F !== null && x8(F, x, U), K !== null && x8(K, x, U);
                }
              }
              function YB(g, x) {
                {
                  var U = MB(g, x);
                  if (U)
                    return;
                  for (var F = g; ; ) {
                    switch (F.tag) {
                      case m:
                        x.add(F.stateNode);
                        return;
                      case w:
                        x.add(F.stateNode.containerInfo);
                        return;
                      case j:
                        x.add(F.stateNode.containerInfo);
                        return;
                    }
                    if (F.return === null)
                      throw new Error("Expected to reach root first.");
                    F = F.return;
                  }
                }
              }
              function MB(g, x) {
                for (var U = g, F = !1; ; ) {
                  if (U.tag === m)
                    F = !0, x.add(U.stateNode);
                  else if (U.child !== null) {
                    U.child.return = U, U = U.child;
                    continue;
                  }
                  if (U === g)
                    return F;
                  for (; U.sibling === null; ) {
                    if (U.return === null || U.return === g)
                      return F;
                    U = U.return;
                  }
                  U.sibling.return = U.return, U = U.sibling;
                }
                return !1;
              }
              var o0;
              {
                o0 = !1;
                try {
                  var gw = Object.preventExtensions({});
                } catch {
                  o0 = !0;
                }
              }
              var LB = 1;
              function KB(g, x, U, F) {
                this.tag = g, this.key = U, this.elementType = null, this.type = null, this.stateNode = null, this.return = null, this.child = null, this.sibling = null, this.index = 0, this.ref = null, this.pendingProps = x, this.memoizedProps = null, this.updateQueue = null, this.memoizedState = null, this.dependencies = null, this.mode = F, this.flags = Es, this.nextEffect = null, this.firstEffect = null, this.lastEffect = null, this.lanes = Zt, this.childLanes = Zt, this.alternate = null, this.actualDuration = Number.NaN, this.actualStartTime = Number.NaN, this.selfBaseDuration = Number.NaN, this.treeBaseDuration = Number.NaN, this.actualDuration = 0, this.actualStartTime = -1, this.selfBaseDuration = 0, this.treeBaseDuration = 0, this._debugID = LB++, this._debugSource = null, this._debugOwner = null, this._debugNeedsRemount = !1, this._debugHookTypes = null, !o0 && typeof Object.preventExtensions == "function" && Object.preventExtensions(this);
              }
              var Od = function(g, x, U, F) {
                return new KB(g, x, U, F);
              };
              function D8(g) {
                var x = g.prototype;
                return !!(x && x.isReactComponent);
              }
              function Xw(g) {
                return typeof g == "function" && !D8(g) && g.defaultProps === void 0;
              }
              function bx(g) {
                if (typeof g == "function")
                  return D8(g) ? q : T;
                if (g != null) {
                  var x = g.$$typeof;
                  if (x === pr)
                    return O;
                  if (x === $t)
                    return Z;
                }
                return b;
              }
              function nc(g, x) {
                var U = g.alternate;
                U === null ? (U = Od(g.tag, x, g.key, g.mode), U.elementType = g.elementType, U.type = g.type, U.stateNode = g.stateNode, U._debugID = g._debugID, U._debugSource = g._debugSource, U._debugOwner = g._debugOwner, U._debugHookTypes = g._debugHookTypes, U.alternate = g, g.alternate = U) : (U.pendingProps = x, U.type = g.type, U.flags = Es, U.nextEffect = null, U.firstEffect = null, U.lastEffect = null, U.actualDuration = 0, U.actualStartTime = -1), U.childLanes = g.childLanes, U.lanes = g.lanes, U.child = g.child, U.memoizedProps = g.memoizedProps, U.memoizedState = g.memoizedState, U.updateQueue = g.updateQueue;
                var F = g.dependencies;
                switch (U.dependencies = F === null ? null : {
                  lanes: F.lanes,
                  firstContext: F.firstContext
                }, U.sibling = g.sibling, U.index = g.index, U.ref = g.ref, U.selfBaseDuration = g.selfBaseDuration, U.treeBaseDuration = g.treeBaseDuration, U._debugNeedsRemount = g._debugNeedsRemount, U.tag) {
                  case b:
                  case T:
                  case te:
                    U.type = UH(g.type);
                    break;
                  case q:
                    U.type = b8(g.type);
                    break;
                  case O:
                    U.type = Tx(g.type);
                    break;
                }
                return U;
              }
              function h6(g, x) {
                g.flags &= Qa, g.nextEffect = null, g.firstEffect = null, g.lastEffect = null;
                var U = g.alternate;
                if (U === null)
                  g.childLanes = Zt, g.lanes = x, g.child = null, g.memoizedProps = null, g.memoizedState = null, g.updateQueue = null, g.dependencies = null, g.stateNode = null, g.selfBaseDuration = 0, g.treeBaseDuration = 0;
                else {
                  g.childLanes = U.childLanes, g.lanes = U.lanes, g.child = U.child, g.memoizedProps = U.memoizedProps, g.memoizedState = U.memoizedState, g.updateQueue = U.updateQueue, g.type = U.type;
                  var F = U.dependencies;
                  g.dependencies = F === null ? null : {
                    lanes: F.lanes,
                    firstContext: F.firstContext
                  }, g.selfBaseDuration = U.selfBaseDuration, g.treeBaseDuration = U.treeBaseDuration;
                }
                return g;
              }
              function Bv(g) {
                var x;
                return g === Aj ? x = Xu | ZA | E1 : g === k7 ? x = ZA | E1 : x = s1, uB && (x |= v6), Od(j, null, null, x);
              }
              function Pf(g, x, U, F, K, oe) {
                var ce = b, Te = g;
                if (typeof g == "function")
                  D8(g) ? (ce = q, Te = b8(Te)) : Te = UH(Te);
                else if (typeof g == "string")
                  ce = m;
                else
                  e:
                    switch (g) {
                      case ji:
                        return g1(U.children, K, oe, x);
                      case Vr:
                        ce = k, K |= Xj;
                        break;
                      case _i:
                        ce = k, K |= E1;
                        break;
                      case oi:
                        return Wv(U, K, oe, x);
                      case ds:
                        return ic(U, K, oe, x);
                      case it:
                        return X2(U, K, oe, x);
                      case Lr:
                        return sc(U, K, oe, x);
                      case pi:
                        return rp(U, K, oe, x);
                      case Kt:
                      default: {
                        if (typeof g == "object" && g !== null)
                          switch (g.$$typeof) {
                            case vr:
                              ce = y;
                              break e;
                            case Fr:
                              ce = R;
                              break e;
                            case pr:
                              ce = O, Te = Tx(Te);
                              break e;
                            case $t:
                              ce = Z;
                              break e;
                            case Ur:
                              ce = fe, Te = null;
                              break e;
                            case $e:
                              ce = Pe;
                              break e;
                          }
                        var Ce = "";
                        {
                          (g === void 0 || typeof g == "object" && g !== null && Object.keys(g).length === 0) && (Ce += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
                          var tt = F ? Zr(F.type) : null;
                          tt && (Ce += `

Check the render method of \`` + tt + "`.");
                        }
                        throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (g == null ? g : typeof g) + "." + Ce);
                      }
                    }
                var ft = Od(ce, U, x, K);
                return ft.elementType = g, ft.type = Te, ft.lanes = oe, ft._debugOwner = F, ft;
              }
              function j8(g, x, U) {
                var F = null;
                F = g._owner;
                var K = g.type, oe = g.key, ce = g.props, Te = Pf(K, oe, ce, F, x, U);
                return Te._debugSource = g._source, Te._debugOwner = g._owner, Te;
              }
              function g1(g, x, U, F) {
                var K = Od(N, g, F, x);
                return K.lanes = U, K;
              }
              function Wv(g, x, U, F) {
                typeof g.id != "string" && c('Profiler must specify an "id" as a prop');
                var K = Od(Y, g, F, x | v6);
                return K.elementType = oi, K.type = oi, K.lanes = U, K.stateNode = {
                  effectDuration: 0,
                  passiveEffectDuration: 0
                }, K;
              }
              function ic(g, x, U, F) {
                var K = Od(ee, g, F, x);
                return K.type = ds, K.elementType = ds, K.lanes = U, K;
              }
              function X2(g, x, U, F) {
                var K = Od(L, g, F, x);
                return K.type = it, K.elementType = it, K.lanes = U, K;
              }
              function sc(g, x, U, F) {
                var K = Od(ge, g, F, x);
                return K.type = Lr, K.elementType = Lr, K.lanes = U, K;
              }
              function rp(g, x, U, F) {
                var K = Od(me, g, F, x);
                return K.type = pi, K.elementType = pi, K.lanes = U, K;
              }
              function f0(g, x, U) {
                var F = Od(I, g, null, x);
                return F.lanes = U, F;
              }
              function Tw() {
                var g = Od(m, null, null, s1);
                return g.elementType = "DELETED", g.type = "DELETED", g;
              }
              function T2(g, x, U) {
                var F = g.children !== null ? g.children : [], K = Od(w, F, g.key, x);
                return K.lanes = U, K.stateNode = {
                  containerInfo: g.containerInfo,
                  pendingChildren: null,
                  // Used by persistent updates
                  implementation: g.implementation
                }, K;
              }
              function ms(g, x) {
                return g === null && (g = Od(b, null, null, s1)), g.tag = x.tag, g.key = x.key, g.elementType = x.elementType, g.type = x.type, g.stateNode = x.stateNode, g.return = x.return, g.child = x.child, g.sibling = x.sibling, g.index = x.index, g.ref = x.ref, g.pendingProps = x.pendingProps, g.memoizedProps = x.memoizedProps, g.updateQueue = x.updateQueue, g.memoizedState = x.memoizedState, g.dependencies = x.dependencies, g.mode = x.mode, g.flags = x.flags, g.nextEffect = x.nextEffect, g.firstEffect = x.firstEffect, g.lastEffect = x.lastEffect, g.lanes = x.lanes, g.childLanes = x.childLanes, g.alternate = x.alternate, g.actualDuration = x.actualDuration, g.actualStartTime = x.actualStartTime, g.selfBaseDuration = x.selfBaseDuration, g.treeBaseDuration = x.treeBaseDuration, g._debugID = x._debugID, g._debugSource = x._debugSource, g._debugOwner = x._debugOwner, g._debugNeedsRemount = x._debugNeedsRemount, g._debugHookTypes = x._debugHookTypes, g;
              }
              function U9(g, x, U) {
                switch (this.tag = x, this.containerInfo = g, this.pendingChildren = null, this.current = null, this.pingCache = null, this.finishedWork = null, this.timeoutHandle = iX, this.context = null, this.pendingContext = null, this.hydrate = U, this.callbackNode = null, this.callbackPriority = sa, this.eventTimes = n3(Zt), this.expirationTimes = n3(_a), this.pendingLanes = Zt, this.suspendedLanes = Zt, this.pingedLanes = Zt, this.expiredLanes = Zt, this.mutableReadLanes = Zt, this.finishedLanes = Zt, this.entangledLanes = Zt, this.entanglements = n3(Zt), this.mutableSourceEagerHydrationData = null, this.interactionThreadID = l.unstable_getThreadID(), this.memoizedInteractions = /* @__PURE__ */ new Set(), this.pendingInteractionMap = /* @__PURE__ */ new Map(), x) {
                  case k7:
                    this._debugRootType = "createBlockingRoot()";
                    break;
                  case Aj:
                    this._debugRootType = "createRoot()";
                    break;
                  case vb:
                    this._debugRootType = "createLegacyRoot()";
                    break;
                }
              }
              function X1(g, x, U, F) {
                var K = new U9(g, x, U), oe = Bv(x);
                return K.current = oe, oe.stateNode = K, gb(oe), K;
              }
              function i9(g, x) {
                var U = x._getVersion, F = U(x._source);
                g.mutableSourceEagerHydrationData == null ? g.mutableSourceEagerHydrationData = [x, F] : g.mutableSourceEagerHydrationData.push(x, F);
              }
              function Il(g, x, U) {
                var F = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
                return {
                  // This tag allow us to uniquely identify this as a React Portal
                  $$typeof: is,
                  key: F == null ? null : "" + F,
                  children: g,
                  containerInfo: x,
                  implementation: U
                };
              }
              var q2, cf;
              q2 = !1, cf = {};
              function IH(g) {
                if (!g)
                  return Dd;
                var x = Gu(g), U = fj(x);
                if (x.tag === q) {
                  var F = x.type;
                  if (cl(F))
                    return aj(x, F, U);
                }
                return U;
              }
              function w8(g, x) {
                {
                  var U = Gu(g);
                  if (U === void 0)
                    throw typeof g.render == "function" ? Error("Unable to find node on an unmounted component.") : Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(g));
                  var F = $u(U);
                  if (F === null)
                    return null;
                  if (F.mode & E1) {
                    var K = Zr(U.type) || "Component";
                    if (!cf[K]) {
                      cf[K] = !0;
                      var oe = go;
                      try {
                        Sa(F), U.mode & E1 ? c("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", x, x, K) : c("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", x, x, K);
                      } finally {
                        oe ? Sa(oe) : Fa();
                      }
                    }
                  }
                  return F.stateNode;
                }
              }
              function b2(g, x, U, F) {
                return X1(g, x, U);
              }
              function np(g, x, U, F) {
                PB(x, g);
                var K = x.current, oe = Vd();
                typeof jest < "u" && (Bu(K), gx(K));
                var ce = $3(K), Te = IH(U);
                x.context === null ? x.context = Te : x.pendingContext = Te, G1 && go !== null && !q2 && (q2 = !0, c(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.

Check the render method of %s.`, Zr(go.type) || "Unknown"));
                var Ce = XA(oe, ce);
                return Ce.payload = {
                  element: g
                }, F = F === void 0 ? null : F, F !== null && (typeof F != "function" && c("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", F), Ce.callback = F), wd(K, Ce), W9(K, ce, oe), ce;
              }
              function A0(g) {
                var x = g.current;
                if (!x.child)
                  return null;
                switch (x.child.tag) {
                  case m:
                    return x.child.stateNode;
                  default:
                    return x.child.stateNode;
                }
              }
              function Z6(g, x) {
                var U = g.memoizedState;
                U !== null && U.dehydrated !== null && (U.retryLane = r3(U.retryLane, x));
              }
              function x2(g, x) {
                Z6(g, x);
                var U = g.alternate;
                U && Z6(U, x);
              }
              function qw(g) {
                if (g.tag === ee) {
                  var x = Vd(), U = iu;
                  W9(g, U, x), x2(g, U);
                }
              }
              function bw(g) {
                if (g.tag === ee) {
                  var x = Vd(), U = $c;
                  W9(g, U, x), x2(g, U);
                }
              }
              function xx(g) {
                if (g.tag === ee) {
                  var x = Vd(), U = $3(g);
                  W9(g, U, x), x2(g, U);
                }
              }
              function ac(g, x) {
                try {
                  return x();
                } finally {
                }
              }
              function RH(g) {
                var x = Mc(g);
                return x === null ? null : x.tag === $ ? x.stateNode.instance : x.stateNode;
              }
              var Dx = function(g) {
                return !1;
              };
              function m8(g) {
                return Dx(g);
              }
              var B8 = null, d0 = null, ip = null, oc = null, VH = null, D2 = null, W8 = null, xw = null;
              {
                var v0 = function(g, x, U) {
                  var F = x[U], K = Array.isArray(g) ? g.slice() : v({}, g);
                  return U + 1 === x.length ? (Array.isArray(K) ? K.splice(F, 1) : delete K[F], K) : (K[F] = v0(g[F], x, U + 1), K);
                }, S8 = function(g, x) {
                  return v0(g, x, 0);
                }, U8 = function(g, x, U, F) {
                  var K = x[F], oe = Array.isArray(g) ? g.slice() : v({}, g);
                  if (F + 1 === x.length) {
                    var ce = U[F];
                    oe[ce] = oe[K], Array.isArray(oe) ? oe.splice(K, 1) : delete oe[K];
                  } else
                    oe[K] = U8(
                      // $FlowFixMe number or string is fine here
                      g[K],
                      x,
                      U,
                      F + 1
                    );
                  return oe;
                }, CH = function(g, x, U) {
                  if (x.length !== U.length) {
                    p("copyWithRename() expects paths of the same length");
                    return;
                  } else
                    for (var F = 0; F < U.length - 1; F++)
                      if (x[F] !== U[F]) {
                        p("copyWithRename() expects paths to be the same except for the deepest key");
                        return;
                      }
                  return U8(g, x, U, 0);
                }, Dw = function(g, x, U, F) {
                  if (U >= x.length)
                    return F;
                  var K = x[U], oe = Array.isArray(g) ? g.slice() : v({}, g);
                  return oe[K] = Dw(g[K], x, U + 1, F), oe;
                }, u0 = function(g, x, U) {
                  return Dw(g, x, 0, U);
                }, OH = function(g, x) {
                  for (var U = g.memoizedState; U !== null && x > 0; )
                    U = U.next, x--;
                  return U;
                };
                B8 = function(g, x, U, F) {
                  var K = OH(g, x);
                  if (K !== null) {
                    var oe = u0(K.memoizedState, U, F);
                    K.memoizedState = oe, K.baseState = oe, g.memoizedProps = v({}, g.memoizedProps), W9(g, qs, _a);
                  }
                }, d0 = function(g, x, U) {
                  var F = OH(g, x);
                  if (F !== null) {
                    var K = S8(F.memoizedState, U);
                    F.memoizedState = K, F.baseState = K, g.memoizedProps = v({}, g.memoizedProps), W9(g, qs, _a);
                  }
                }, ip = function(g, x, U, F) {
                  var K = OH(g, x);
                  if (K !== null) {
                    var oe = CH(K.memoizedState, U, F);
                    K.memoizedState = oe, K.baseState = oe, g.memoizedProps = v({}, g.memoizedProps), W9(g, qs, _a);
                  }
                }, oc = function(g, x, U) {
                  g.pendingProps = u0(g.memoizedProps, x, U), g.alternate && (g.alternate.pendingProps = g.pendingProps), W9(g, qs, _a);
                }, VH = function(g, x) {
                  g.pendingProps = S8(g.memoizedProps, x), g.alternate && (g.alternate.pendingProps = g.pendingProps), W9(g, qs, _a);
                }, D2 = function(g, x, U) {
                  g.pendingProps = CH(g.memoizedProps, x, U), g.alternate && (g.alternate.pendingProps = g.pendingProps), W9(g, qs, _a);
                }, W8 = function(g) {
                  W9(g, qs, _a);
                }, xw = function(g) {
                  Dx = g;
                };
              }
              function j2(g) {
                var x = $u(g);
                return x === null ? null : x.stateNode;
              }
              function I8(g) {
                return null;
              }
              function jx() {
                return go;
              }
              function R8(g) {
                var x = g.findFiberByHostInstance, U = P.ReactCurrentDispatcher;
                return lB({
                  bundleType: g.bundleType,
                  version: g.version,
                  rendererPackageName: g.rendererPackageName,
                  rendererConfig: g.rendererConfig,
                  overrideHookState: B8,
                  overrideHookStateDeletePath: d0,
                  overrideHookStateRenamePath: ip,
                  overrideProps: oc,
                  overridePropsDeletePath: VH,
                  overridePropsRenamePath: D2,
                  setSuspenseHandler: xw,
                  scheduleUpdate: W8,
                  currentDispatcherRef: U,
                  findHostInstanceByFiber: j2,
                  findFiberByHostInstance: x || I8,
                  // React Refresh
                  findHostInstancesForRefresh: QB,
                  scheduleRefresh: NB,
                  scheduleRoot: Hw,
                  setRefreshHandler: cw,
                  // Enables DevTools to append owner stacks to error messages in DEV mode.
                  getCurrentFiber: jx
                });
              }
              function I9(g, x, U) {
                this._internalRoot = sp(g, x, U);
              }
              I9.prototype.render = function(g) {
                var x = this._internalRoot;
                {
                  typeof arguments[1] == "function" && c("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
                  var U = x.containerInfo;
                  if (U.nodeType !== Z1) {
                    var F = RH(x.current);
                    F && F.parentNode !== U && c("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
                  }
                }
                np(g, x, null, null);
              }, I9.prototype.unmount = function() {
                typeof arguments[0] == "function" && c("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
                var g = this._internalRoot, x = g.containerInfo;
                np(null, g, null, function() {
                  uX(x);
                });
              };
              function sp(g, x, U) {
                var F = U != null && U.hydrate === !0;
                U != null && U.hydrationOptions;
                var K = U != null && U.hydrationOptions != null && U.hydrationOptions.mutableSources || null, oe = b2(g, x, F);
                nj(oe.current, g), g.nodeType;
                {
                  var ce = g.nodeType === Z1 ? g.parentNode : g;
                  O4(ce);
                }
                if (K)
                  for (var Te = 0; Te < K.length; Te++) {
                    var Ce = K[Te];
                    i9(oe, Ce);
                  }
                return oe;
              }
              function JB(g, x) {
                return new I9(g, vb, x);
              }
              function Qo(g) {
                return !!(g && (g.nodeType === t1 || g.nodeType === fA || g.nodeType === tP || g.nodeType === Z1 && g.nodeValue === " react-mount-point-unstable "));
              }
              var zB = P.ReactCurrentOwner, jw, qA = !1;
              jw = function(g) {
                if (g._reactRootContainer && g.nodeType !== Z1) {
                  var x = RH(g._reactRootContainer._internalRoot.current);
                  x && x.parentNode !== g && c("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
                }
                var U = !!g._reactRootContainer, F = w2(g), K = !!(F && xd(F));
                K && !U && c("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."), g.nodeType === t1 && g.tagName && g.tagName.toUpperCase() === "BODY" && c("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
              };
              function w2(g) {
                return g ? g.nodeType === fA ? g.documentElement : g.firstChild : null;
              }
              function mx(g) {
                var x = w2(g);
                return !!(x && x.nodeType === t1 && x.hasAttribute(Xn));
              }
              function ww(g, x) {
                var U = x || mx(g);
                if (!U)
                  for (var F = !1, K; K = g.lastChild; )
                    !F && K.nodeType === t1 && K.hasAttribute(Xn) && (F = !0, c("render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup.")), g.removeChild(K);
                return U && !x && !qA && (qA = !0, p("render(): Calling ReactDOM.render() to hydrate server-rendered markup will stop working in React v18. Replace the ReactDOM.render() call with ReactDOM.hydrate() if you want React to attach to the server HTML.")), JB(g, U ? {
                  hydrate: !0
                } : void 0);
              }
              function mw(g, x) {
                g !== null && typeof g != "function" && c("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", x, g);
              }
              function V8(g, x, U, F, K) {
                jw(U), mw(K === void 0 ? null : K, "render");
                var oe = U._reactRootContainer, ce;
                if (oe) {
                  if (ce = oe._internalRoot, typeof K == "function") {
                    var Ce = K;
                    K = function() {
                      var tt = A0(ce);
                      Ce.call(tt);
                    };
                  }
                  np(x, ce, g, K);
                } else {
                  if (oe = U._reactRootContainer = ww(U, F), ce = oe._internalRoot, typeof K == "function") {
                    var Te = K;
                    K = function() {
                      var tt = A0(ce);
                      Te.call(tt);
                    };
                  }
                  iw(function() {
                    np(x, ce, g, K);
                  });
                }
                return A0(ce);
              }
              function ap(g) {
                {
                  var x = zB.current;
                  if (x !== null && x.stateNode !== null) {
                    var U = x.stateNode._warnedAboutRefsInRender;
                    U || c("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", Zr(x.type) || "A component"), x.stateNode._warnedAboutRefsInRender = !0;
                  }
                }
                return g == null ? null : g.nodeType === t1 ? g : w8(g, "findDOMNode");
              }
              function Bw(g, x, U) {
                if (!Qo(x))
                  throw Error("Target container is not a DOM element.");
                {
                  var F = bh(x) && x._reactRootContainer === void 0;
                  F && c("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call createRoot(container, {hydrate: true}).render(element)?");
                }
                return V8(null, g, x, !0, U);
              }
              function Ww(g, x, U) {
                if (!Qo(x))
                  throw Error("Target container is not a DOM element.");
                {
                  var F = bh(x) && x._reactRootContainer === void 0;
                  F && c("You are calling ReactDOM.render() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.render(element)?");
                }
                return V8(null, g, x, !1, U);
              }
              function Bx(g, x, U, F) {
                if (!Qo(U))
                  throw Error("Target container is not a DOM element.");
                if (!(g != null && Sq(g)))
                  throw Error("parentComponent must be a valid React Component");
                return V8(g, x, U, !1, F);
              }
              function GB(g) {
                if (!Qo(g))
                  throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");
                {
                  var x = bh(g) && g._reactRootContainer === void 0;
                  x && c("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?");
                }
                if (g._reactRootContainer) {
                  {
                    var U = w2(g), F = U && !xd(U);
                    F && c("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
                  }
                  return iw(function() {
                    V8(null, null, g, !1, function() {
                      g._reactRootContainer = null, uX(g);
                    });
                  }), !0;
                } else {
                  {
                    var K = w2(g), oe = !!(K && xd(K)), ce = g.nodeType === t1 && Qo(g.parentNode) && !!g.parentNode._reactRootContainer;
                    oe && c("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", ce ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
                  }
                  return !1;
                }
              }
              PA(qw), $v(bw), Dg(xx), jg(ac);
              var yd = !1;
              (typeof Map != "function" || // $FlowIssue Flow incorrectly thinks Map has no prototype
              Map.prototype == null || typeof Map.prototype.forEach != "function" || typeof Set != "function" || // $FlowIssue Flow incorrectly thinks Set has no prototype
              Set.prototype == null || typeof Set.prototype.clear != "function" || typeof Set.prototype.forEach != "function") && c("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), oP(hh), Tg(s0, tc, nw, l8);
              function Wx(g, x) {
                var U = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
                if (!Qo(x))
                  throw Error("Target container is not a DOM element.");
                return Il(g, x, null, U);
              }
              function C8(g, x, U, F) {
                return Bx(g, x, U, F);
              }
              function Sx(g, x) {
                var U = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
                return yd || (yd = !0, p('The ReactDOM.unstable_createPortal() alias has been deprecated, and will be removed in React 18+. Update your code to use ReactDOM.createPortal() instead. It has the exact same API, but without the "unstable_" prefix.')), Wx(g, x, U);
              }
              var l0 = {
                // Keep in sync with ReactTestUtils.js, and ReactTestUtilsAct.js.
                // This is an array for better minification.
                Events: [
                  xd,
                  Pl,
                  lX,
                  yc,
                  Xg,
                  jv,
                  // TODO: This is related to `act`, not events. Move to separate key?
                  wv
                ]
              }, Sw = R8({
                findFiberByHostInstance: ll,
                bundleType: 1,
                version: eT,
                rendererPackageName: "react-dom"
              });
              if (!Sw && Ke && window.top === window.self && (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1)) {
                var Ux = window.location.protocol;
                /^(https?|file):$/.test(Ux) && console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (Ux === "file:" ? `
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq` : ""), "font-weight:bold");
              }
              f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = l0, f.createPortal = Wx, f.findDOMNode = ap, f.flushSync = u2, f.hydrate = Bw, f.render = Ww, f.unmountComponentAtNode = GB, f.unstable_batchedUpdates = s0, f.unstable_createPortal = Sx, f.unstable_renderSubtreeIntoContainer = C8, f.version = eT;
            })();
          }
        ),
        /***/
        "../../../../node_modules/react-dom/index.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/react-dom/index.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            a.exports = o(
              /*! ./cjs/react-dom.development.js */
              "../../../../node_modules/react-dom/cjs/react-dom.development.js"
            );
          }
        ),
        /***/
        "../../../../node_modules/react/cjs/react-jsx-runtime.development.js": (
          /*!***************************************************************************!*\
            !*** ../../../../node_modules/react/cjs/react-jsx-runtime.development.js ***!
            \***************************************************************************/
          /***/
          (a, f, o) => {
            /** @license React v17.0.2
             * react-jsx-runtime.development.js
             *
             * Copyright (c) Facebook, Inc. and its affiliates.
             *
             * This source code is licensed under the MIT license found in the
             * LICENSE file in the root directory of this source tree.
             */
            (function() {
              var d = o(
                /*! react */
                "../../../../node_modules/react/index.js"
              ), v = o(
                /*! object-assign */
                "../../../../node_modules/object-assign/index.js"
              ), u = 60103, l = 60106;
              f.Fragment = 60107;
              var P = 60108, p = 60114, c = 60109, H = 60110, T = 60112, q = 60113, b = 60120, j = 60115, w = 60116, m = 60121, I = 60122, N = 60117, k = 60129, R = 60131;
              if (typeof Symbol == "function" && Symbol.for) {
                var y = Symbol.for;
                u = y("react.element"), l = y("react.portal"), f.Fragment = y("react.fragment"), P = y("react.strict_mode"), p = y("react.profiler"), c = y("react.provider"), H = y("react.context"), T = y("react.forward_ref"), q = y("react.suspense"), b = y("react.suspense_list"), j = y("react.memo"), w = y("react.lazy"), m = y("react.block"), I = y("react.server.block"), N = y("react.fundamental"), y("react.scope"), y("react.opaque.id"), k = y("react.debug_trace_mode"), y("react.offscreen"), R = y("react.legacy_hidden");
              }
              var O = typeof Symbol == "function" && Symbol.iterator, Y = "@@iterator";
              function ee($e) {
                if ($e === null || typeof $e != "object")
                  return null;
                var Kt = O && $e[O] || $e[Y];
                return typeof Kt == "function" ? Kt : null;
              }
              var Z = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
              function te($e) {
                {
                  for (var Kt = arguments.length, cr = new Array(Kt > 1 ? Kt - 1 : 0), Vr = 1; Vr < Kt; Vr++)
                    cr[Vr - 1] = arguments[Vr];
                  fe("error", $e, cr);
                }
              }
              function fe($e, Kt, cr) {
                {
                  var Vr = Z.ReactDebugCurrentFrame, Lr = Vr.getStackAddendum();
                  Lr !== "" && (Kt += "%s", cr = cr.concat([Lr]));
                  var pi = cr.map(function(zr) {
                    return "" + zr;
                  });
                  pi.unshift("Warning: " + Kt), Function.prototype.apply.call(console[$e], console, pi);
                }
              }
              var _ = !1;
              function G($e) {
                return !!(typeof $e == "string" || typeof $e == "function" || $e === f.Fragment || $e === p || $e === k || $e === P || $e === q || $e === b || $e === R || _ || typeof $e == "object" && $e !== null && ($e.$$typeof === w || $e.$$typeof === j || $e.$$typeof === c || $e.$$typeof === H || $e.$$typeof === T || $e.$$typeof === N || $e.$$typeof === m || $e[0] === I));
              }
              function L($e, Kt, cr) {
                var Vr = Kt.displayName || Kt.name || "";
                return $e.displayName || (Vr !== "" ? cr + "(" + Vr + ")" : cr);
              }
              function $($e) {
                return $e.displayName || "Context";
              }
              function ae($e) {
                if ($e == null)
                  return null;
                if (typeof $e.tag == "number" && te("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."), typeof $e == "function")
                  return $e.displayName || $e.name || null;
                if (typeof $e == "string")
                  return $e;
                switch ($e) {
                  case f.Fragment:
                    return "Fragment";
                  case l:
                    return "Portal";
                  case p:
                    return "Profiler";
                  case P:
                    return "StrictMode";
                  case q:
                    return "Suspense";
                  case b:
                    return "SuspenseList";
                }
                if (typeof $e == "object")
                  switch ($e.$$typeof) {
                    case H:
                      var Kt = $e;
                      return $(Kt) + ".Consumer";
                    case c:
                      var cr = $e;
                      return $(cr._context) + ".Provider";
                    case T:
                      return L($e, $e.render, "ForwardRef");
                    case j:
                      return ae($e.type);
                    case m:
                      return ae($e._render);
                    case w: {
                      var Vr = $e, Lr = Vr._payload, pi = Vr._init;
                      try {
                        return ae(pi(Lr));
                      } catch {
                        return null;
                      }
                    }
                  }
                return null;
              }
              var Pe = 0, ge, me, Xe, De, ne, re, ve;
              function qe() {
              }
              qe.__reactDisabledLog = !0;
              function ke() {
                {
                  if (Pe === 0) {
                    ge = console.log, me = console.info, Xe = console.warn, De = console.error, ne = console.group, re = console.groupCollapsed, ve = console.groupEnd;
                    var $e = {
                      configurable: !0,
                      enumerable: !0,
                      value: qe,
                      writable: !0
                    };
                    Object.defineProperties(console, {
                      info: $e,
                      log: $e,
                      warn: $e,
                      error: $e,
                      group: $e,
                      groupCollapsed: $e,
                      groupEnd: $e
                    });
                  }
                  Pe++;
                }
              }
              function be() {
                {
                  if (Pe--, Pe === 0) {
                    var $e = {
                      configurable: !0,
                      enumerable: !0,
                      writable: !0
                    };
                    Object.defineProperties(console, {
                      log: v({}, $e, {
                        value: ge
                      }),
                      info: v({}, $e, {
                        value: me
                      }),
                      warn: v({}, $e, {
                        value: Xe
                      }),
                      error: v({}, $e, {
                        value: De
                      }),
                      group: v({}, $e, {
                        value: ne
                      }),
                      groupCollapsed: v({}, $e, {
                        value: re
                      }),
                      groupEnd: v({}, $e, {
                        value: ve
                      })
                    });
                  }
                  Pe < 0 && te("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
                }
              }
              var Fe = Z.ReactCurrentDispatcher, Ke;
              function nt($e, Kt, cr) {
                {
                  if (Ke === void 0)
                    try {
                      throw Error();
                    } catch (Lr) {
                      var Vr = Lr.stack.trim().match(/\n( *(at )?)/);
                      Ke = Vr && Vr[1] || "";
                    }
                  return `
` + Ke + $e;
                }
              }
              var ut = !1, bt;
              {
                var wt = typeof WeakMap == "function" ? WeakMap : Map;
                bt = new wt();
              }
              function Tt($e, Kt) {
                if (!$e || ut)
                  return "";
                {
                  var cr = bt.get($e);
                  if (cr !== void 0)
                    return cr;
                }
                var Vr;
                ut = !0;
                var Lr = Error.prepareStackTrace;
                Error.prepareStackTrace = void 0;
                var pi;
                pi = Fe.current, Fe.current = null, ke();
                try {
                  if (Kt) {
                    var zr = function() {
                      throw Error();
                    };
                    if (Object.defineProperty(zr.prototype, "props", {
                      set: function() {
                        throw Error();
                      }
                    }), typeof Reflect == "object" && Reflect.construct) {
                      try {
                        Reflect.construct(zr, []);
                      } catch (di) {
                        Vr = di;
                      }
                      Reflect.construct($e, [], zr);
                    } else {
                      try {
                        zr.call();
                      } catch (di) {
                        Vr = di;
                      }
                      $e.call(zr.prototype);
                    }
                  } else {
                    try {
                      throw Error();
                    } catch (di) {
                      Vr = di;
                    }
                    $e();
                  }
                } catch (di) {
                  if (di && Vr && typeof di.stack == "string") {
                    for (var Cn = di.stack.split(`
`), Mi = Vr.stack.split(`
`), li = Cn.length - 1, Xs = Mi.length - 1; li >= 1 && Xs >= 0 && Cn[li] !== Mi[Xs]; )
                      Xs--;
                    for (; li >= 1 && Xs >= 0; li--, Xs--)
                      if (Cn[li] !== Mi[Xs]) {
                        if (li !== 1 || Xs !== 1)
                          do
                            if (li--, Xs--, Xs < 0 || Cn[li] !== Mi[Xs]) {
                              var Ri = `
` + Cn[li].replace(" at new ", " at ");
                              return typeof $e == "function" && bt.set($e, Ri), Ri;
                            }
                          while (li >= 1 && Xs >= 0);
                        break;
                      }
                  }
                } finally {
                  ut = !1, Fe.current = pi, be(), Error.prepareStackTrace = Lr;
                }
                var j1 = $e ? $e.displayName || $e.name : "", w1 = j1 ? nt(j1) : "";
                return typeof $e == "function" && bt.set($e, w1), w1;
              }
              function lr($e, Kt, cr) {
                return Tt($e, !1);
              }
              function Qt($e) {
                var Kt = $e.prototype;
                return !!(Kt && Kt.isReactComponent);
              }
              function tr($e, Kt, cr) {
                if ($e == null)
                  return "";
                if (typeof $e == "function")
                  return Tt($e, Qt($e));
                if (typeof $e == "string")
                  return nt($e);
                switch ($e) {
                  case q:
                    return nt("Suspense");
                  case b:
                    return nt("SuspenseList");
                }
                if (typeof $e == "object")
                  switch ($e.$$typeof) {
                    case T:
                      return lr($e.render);
                    case j:
                      return tr($e.type, Kt, cr);
                    case m:
                      return lr($e._render);
                    case w: {
                      var Vr = $e, Lr = Vr._payload, pi = Vr._init;
                      try {
                        return tr(pi(Lr), Kt, cr);
                      } catch {
                      }
                    }
                  }
                return "";
              }
              var br = {}, Xn = Z.ReactDebugCurrentFrame;
              function qr($e) {
                if ($e) {
                  var Kt = $e._owner, cr = tr($e.type, $e._source, Kt ? Kt.type : null);
                  Xn.setExtraStackFrame(cr);
                } else
                  Xn.setExtraStackFrame(null);
              }
              function En($e, Kt, cr, Vr, Lr) {
                {
                  var pi = Function.call.bind(Object.prototype.hasOwnProperty);
                  for (var zr in $e)
                    if (pi($e, zr)) {
                      var Cn = void 0;
                      try {
                        if (typeof $e[zr] != "function") {
                          var Mi = Error((Vr || "React class") + ": " + cr + " type `" + zr + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof $e[zr] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                          throw Mi.name = "Invariant Violation", Mi;
                        }
                        Cn = $e[zr](Kt, zr, Vr, cr, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                      } catch (li) {
                        Cn = li;
                      }
                      Cn && !(Cn instanceof Error) && (qr(Lr), te("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Vr || "React class", cr, zr, typeof Cn), qr(null)), Cn instanceof Error && !(Cn.message in br) && (br[Cn.message] = !0, qr(Lr), te("Failed %s type: %s", cr, Cn.message), qr(null));
                    }
                }
              }
              var Bn = Z.ReactCurrentOwner, Fi = Object.prototype.hasOwnProperty, Gt = {
                key: !0,
                ref: !0,
                __self: !0,
                __source: !0
              }, xr, Br, nn;
              nn = {};
              function sn($e) {
                if (Fi.call($e, "ref")) {
                  var Kt = Object.getOwnPropertyDescriptor($e, "ref").get;
                  if (Kt && Kt.isReactWarning)
                    return !1;
                }
                return $e.ref !== void 0;
              }
              function Pn($e) {
                if (Fi.call($e, "key")) {
                  var Kt = Object.getOwnPropertyDescriptor($e, "key").get;
                  if (Kt && Kt.isReactWarning)
                    return !1;
                }
                return $e.key !== void 0;
              }
              function an($e, Kt) {
                if (typeof $e.ref == "string" && Bn.current && Kt && Bn.current.stateNode !== Kt) {
                  var cr = ae(Bn.current.type);
                  nn[cr] || (te('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', ae(Bn.current.type), $e.ref), nn[cr] = !0);
                }
              }
              function Wn($e, Kt) {
                {
                  var cr = function() {
                    xr || (xr = !0, te("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", Kt));
                  };
                  cr.isReactWarning = !0, Object.defineProperty($e, "key", {
                    get: cr,
                    configurable: !0
                  });
                }
              }
              function rr($e, Kt) {
                {
                  var cr = function() {
                    Br || (Br = !0, te("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", Kt));
                  };
                  cr.isReactWarning = !0, Object.defineProperty($e, "ref", {
                    get: cr,
                    configurable: !0
                  });
                }
              }
              var Sr = function($e, Kt, cr, Vr, Lr, pi, zr) {
                var Cn = {
                  // This tag allows us to uniquely identify this as a React Element
                  $$typeof: u,
                  // Built-in properties that belong on the element
                  type: $e,
                  key: Kt,
                  ref: cr,
                  props: zr,
                  // Record the component responsible for creating this element.
                  _owner: pi
                };
                return Cn._store = {}, Object.defineProperty(Cn._store, "validated", {
                  configurable: !1,
                  enumerable: !1,
                  writable: !0,
                  value: !1
                }), Object.defineProperty(Cn, "_self", {
                  configurable: !1,
                  enumerable: !1,
                  writable: !1,
                  value: Vr
                }), Object.defineProperty(Cn, "_source", {
                  configurable: !1,
                  enumerable: !1,
                  writable: !1,
                  value: Lr
                }), Object.freeze && (Object.freeze(Cn.props), Object.freeze(Cn)), Cn;
              };
              function nr($e, Kt, cr, Vr, Lr) {
                {
                  var pi, zr = {}, Cn = null, Mi = null;
                  cr !== void 0 && (Cn = "" + cr), Pn(Kt) && (Cn = "" + Kt.key), sn(Kt) && (Mi = Kt.ref, an(Kt, Lr));
                  for (pi in Kt)
                    Fi.call(Kt, pi) && !Gt.hasOwnProperty(pi) && (zr[pi] = Kt[pi]);
                  if ($e && $e.defaultProps) {
                    var li = $e.defaultProps;
                    for (pi in li)
                      zr[pi] === void 0 && (zr[pi] = li[pi]);
                  }
                  if (Cn || Mi) {
                    var Xs = typeof $e == "function" ? $e.displayName || $e.name || "Unknown" : $e;
                    Cn && Wn(zr, Xs), Mi && rr(zr, Xs);
                  }
                  return Sr($e, Cn, Mi, Lr, Vr, Bn.current, zr);
                }
              }
              var Er = Z.ReactCurrentOwner, Rn = Z.ReactDebugCurrentFrame;
              function Vn($e) {
                if ($e) {
                  var Kt = $e._owner, cr = tr($e.type, $e._source, Kt ? Kt.type : null);
                  Rn.setExtraStackFrame(cr);
                } else
                  Rn.setExtraStackFrame(null);
              }
              var ki;
              ki = !1;
              function as($e) {
                return typeof $e == "object" && $e !== null && $e.$$typeof === u;
              }
              function Rr() {
                {
                  if (Er.current) {
                    var $e = ae(Er.current.type);
                    if ($e)
                      return `

Check the render method of \`` + $e + "`.";
                  }
                  return "";
                }
              }
              function Ii($e) {
                {
                  if ($e !== void 0) {
                    var Kt = $e.fileName.replace(/^.*[\\\/]/, ""), cr = $e.lineNumber;
                    return `

Check your code at ` + Kt + ":" + cr + ".";
                  }
                  return "";
                }
              }
              var is = {};
              function ji($e) {
                {
                  var Kt = Rr();
                  if (!Kt) {
                    var cr = typeof $e == "string" ? $e : $e.displayName || $e.name;
                    cr && (Kt = `

Check the top-level render call using <` + cr + ">.");
                  }
                  return Kt;
                }
              }
              function _i($e, Kt) {
                {
                  if (!$e._store || $e._store.validated || $e.key != null)
                    return;
                  $e._store.validated = !0;
                  var cr = ji(Kt);
                  if (is[cr])
                    return;
                  is[cr] = !0;
                  var Vr = "";
                  $e && $e._owner && $e._owner !== Er.current && (Vr = " It was passed a child from " + ae($e._owner.type) + "."), Vn($e), te('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', cr, Vr), Vn(null);
                }
              }
              function oi($e, Kt) {
                {
                  if (typeof $e != "object")
                    return;
                  if (Array.isArray($e))
                    for (var cr = 0; cr < $e.length; cr++) {
                      var Vr = $e[cr];
                      as(Vr) && _i(Vr, Kt);
                    }
                  else if (as($e))
                    $e._store && ($e._store.validated = !0);
                  else if ($e) {
                    var Lr = ee($e);
                    if (typeof Lr == "function" && Lr !== $e.entries)
                      for (var pi = Lr.call($e), zr; !(zr = pi.next()).done; )
                        as(zr.value) && _i(zr.value, Kt);
                  }
                }
              }
              function vr($e) {
                {
                  var Kt = $e.type;
                  if (Kt == null || typeof Kt == "string")
                    return;
                  var cr;
                  if (typeof Kt == "function")
                    cr = Kt.propTypes;
                  else if (typeof Kt == "object" && (Kt.$$typeof === T || // Note: Memo only checks outer props here.
                  // Inner props are checked in the reconciler.
                  Kt.$$typeof === j))
                    cr = Kt.propTypes;
                  else
                    return;
                  if (cr) {
                    var Vr = ae(Kt);
                    En(cr, $e.props, "prop", Vr, $e);
                  } else if (Kt.PropTypes !== void 0 && !ki) {
                    ki = !0;
                    var Lr = ae(Kt);
                    te("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Lr || "Unknown");
                  }
                  typeof Kt.getDefaultProps == "function" && !Kt.getDefaultProps.isReactClassApproved && te("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
                }
              }
              function Fr($e) {
                {
                  for (var Kt = Object.keys($e.props), cr = 0; cr < Kt.length; cr++) {
                    var Vr = Kt[cr];
                    if (Vr !== "children" && Vr !== "key") {
                      Vn($e), te("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", Vr), Vn(null);
                      break;
                    }
                  }
                  $e.ref !== null && (Vn($e), te("Invalid attribute `ref` supplied to `React.Fragment`."), Vn(null));
                }
              }
              function pr($e, Kt, cr, Vr, Lr, pi) {
                {
                  var zr = G($e);
                  if (!zr) {
                    var Cn = "";
                    ($e === void 0 || typeof $e == "object" && $e !== null && Object.keys($e).length === 0) && (Cn += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
                    var Mi = Ii(Lr);
                    Mi ? Cn += Mi : Cn += Rr();
                    var li;
                    $e === null ? li = "null" : Array.isArray($e) ? li = "array" : $e !== void 0 && $e.$$typeof === u ? (li = "<" + (ae($e.type) || "Unknown") + " />", Cn = " Did you accidentally export a JSX literal instead of a component?") : li = typeof $e, te("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", li, Cn);
                  }
                  var Xs = nr($e, Kt, cr, Lr, pi);
                  if (Xs == null)
                    return Xs;
                  if (zr) {
                    var Ri = Kt.children;
                    if (Ri !== void 0)
                      if (Vr)
                        if (Array.isArray(Ri)) {
                          for (var j1 = 0; j1 < Ri.length; j1++)
                            oi(Ri[j1], $e);
                          Object.freeze && Object.freeze(Ri);
                        } else
                          te("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
                      else
                        oi(Ri, $e);
                  }
                  return $e === f.Fragment ? Fr(Xs) : vr(Xs), Xs;
                }
              }
              function ds($e, Kt, cr) {
                return pr($e, Kt, cr, !0);
              }
              function it($e, Kt, cr) {
                return pr($e, Kt, cr, !1);
              }
              var $t = it, Ur = ds;
              f.jsx = $t, f.jsxs = Ur;
            })();
          }
        ),
        /***/
        "../../../../node_modules/react/cjs/react.development.js": (
          /*!***************************************************************!*\
            !*** ../../../../node_modules/react/cjs/react.development.js ***!
            \***************************************************************/
          /***/
          (a, f, o) => {
            /** @license React v17.0.2
             * react.development.js
             *
             * Copyright (c) Facebook, Inc. and its affiliates.
             *
             * This source code is licensed under the MIT license found in the
             * LICENSE file in the root directory of this source tree.
             */
            (function() {
              var d = o(
                /*! object-assign */
                "../../../../node_modules/object-assign/index.js"
              ), v = "17.0.2", u = 60103, l = 60106;
              f.Fragment = 60107, f.StrictMode = 60108, f.Profiler = 60114;
              var P = 60109, p = 60110, c = 60112;
              f.Suspense = 60113;
              var H = 60120, T = 60115, q = 60116, b = 60121, j = 60122, w = 60117, m = 60129, I = 60131;
              if (typeof Symbol == "function" && Symbol.for) {
                var N = Symbol.for;
                u = N("react.element"), l = N("react.portal"), f.Fragment = N("react.fragment"), f.StrictMode = N("react.strict_mode"), f.Profiler = N("react.profiler"), P = N("react.provider"), p = N("react.context"), c = N("react.forward_ref"), f.Suspense = N("react.suspense"), H = N("react.suspense_list"), T = N("react.memo"), q = N("react.lazy"), b = N("react.block"), j = N("react.server.block"), w = N("react.fundamental"), N("react.scope"), N("react.opaque.id"), m = N("react.debug_trace_mode"), N("react.offscreen"), I = N("react.legacy_hidden");
              }
              var k = typeof Symbol == "function" && Symbol.iterator, R = "@@iterator";
              function y(Ie) {
                if (Ie === null || typeof Ie != "object")
                  return null;
                var Pt = k && Ie[k] || Ie[R];
                return typeof Pt == "function" ? Pt : null;
              }
              var O = {
                /**
                 * @internal
                 * @type {ReactComponent}
                 */
                current: null
              }, Y = {
                transition: 0
              }, ee = {
                /**
                 * @internal
                 * @type {ReactComponent}
                 */
                current: null
              }, Z = {}, te = null;
              function fe(Ie) {
                te = Ie;
              }
              Z.setExtraStackFrame = function(Ie) {
                te = Ie;
              }, Z.getCurrentStack = null, Z.getStackAddendum = function() {
                var Ie = "";
                te && (Ie += te);
                var Pt = Z.getCurrentStack;
                return Pt && (Ie += Pt() || ""), Ie;
              };
              var _ = {
                current: !1
              }, G = {
                ReactCurrentDispatcher: O,
                ReactCurrentBatchConfig: Y,
                ReactCurrentOwner: ee,
                IsSomeRendererActing: _,
                // Used by renderers to avoid bundling object-assign twice in UMD bundles:
                assign: d
              };
              G.ReactDebugCurrentFrame = Z;
              function L(Ie) {
                {
                  for (var Pt = arguments.length, Et = new Array(Pt > 1 ? Pt - 1 : 0), er = 1; er < Pt; er++)
                    Et[er - 1] = arguments[er];
                  ae("warn", Ie, Et);
                }
              }
              function $(Ie) {
                {
                  for (var Pt = arguments.length, Et = new Array(Pt > 1 ? Pt - 1 : 0), er = 1; er < Pt; er++)
                    Et[er - 1] = arguments[er];
                  ae("error", Ie, Et);
                }
              }
              function ae(Ie, Pt, Et) {
                {
                  var er = G.ReactDebugCurrentFrame, _r = er.getStackAddendum();
                  _r !== "" && (Pt += "%s", Et = Et.concat([_r]));
                  var Xi = Et.map(function(Mn) {
                    return "" + Mn;
                  });
                  Xi.unshift("Warning: " + Pt), Function.prototype.apply.call(console[Ie], console, Xi);
                }
              }
              var Pe = {};
              function ge(Ie, Pt) {
                {
                  var Et = Ie.constructor, er = Et && (Et.displayName || Et.name) || "ReactClass", _r = er + "." + Pt;
                  if (Pe[_r])
                    return;
                  $("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", Pt, er), Pe[_r] = !0;
                }
              }
              var me = {
                /**
                 * Checks whether or not this composite component is mounted.
                 * @param {ReactClass} publicInstance The instance we want to test.
                 * @return {boolean} True if mounted, false otherwise.
                 * @protected
                 * @final
                 */
                isMounted: function(Ie) {
                  return !1;
                },
                /**
                 * Forces an update. This should only be invoked when it is known with
                 * certainty that we are **not** in a DOM transaction.
                 *
                 * You may want to call this when you know that some deeper aspect of the
                 * component's state has changed but `setState` was not called.
                 *
                 * This will not invoke `shouldComponentUpdate`, but it will invoke
                 * `componentWillUpdate` and `componentDidUpdate`.
                 *
                 * @param {ReactClass} publicInstance The instance that should rerender.
                 * @param {?function} callback Called after component is updated.
                 * @param {?string} callerName name of the calling function in the public API.
                 * @internal
                 */
                enqueueForceUpdate: function(Ie, Pt, Et) {
                  ge(Ie, "forceUpdate");
                },
                /**
                 * Replaces all of the state. Always use this or `setState` to mutate state.
                 * You should treat `this.state` as immutable.
                 *
                 * There is no guarantee that `this.state` will be immediately updated, so
                 * accessing `this.state` after calling this method may return the old value.
                 *
                 * @param {ReactClass} publicInstance The instance that should rerender.
                 * @param {object} completeState Next state.
                 * @param {?function} callback Called after component is updated.
                 * @param {?string} callerName name of the calling function in the public API.
                 * @internal
                 */
                enqueueReplaceState: function(Ie, Pt, Et, er) {
                  ge(Ie, "replaceState");
                },
                /**
                 * Sets a subset of the state. This only exists because _pendingState is
                 * internal. This provides a merging strategy that is not available to deep
                 * properties which is confusing. TODO: Expose pendingState or don't use it
                 * during the merge.
                 *
                 * @param {ReactClass} publicInstance The instance that should rerender.
                 * @param {object} partialState Next partial state to be merged with state.
                 * @param {?function} callback Called after component is updated.
                 * @param {?string} Name of the calling function in the public API.
                 * @internal
                 */
                enqueueSetState: function(Ie, Pt, Et, er) {
                  ge(Ie, "setState");
                }
              }, Xe = {};
              Object.freeze(Xe);
              function De(Ie, Pt, Et) {
                this.props = Ie, this.context = Pt, this.refs = Xe, this.updater = Et || me;
              }
              De.prototype.isReactComponent = {}, De.prototype.setState = function(Ie, Pt) {
                if (!(typeof Ie == "object" || typeof Ie == "function" || Ie == null))
                  throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
                this.updater.enqueueSetState(this, Ie, Pt, "setState");
              }, De.prototype.forceUpdate = function(Ie) {
                this.updater.enqueueForceUpdate(this, Ie, "forceUpdate");
              };
              {
                var ne = {
                  isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
                  replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
                }, re = function(Ie, Pt) {
                  Object.defineProperty(De.prototype, Ie, {
                    get: function() {
                      L("%s(...) is deprecated in plain JavaScript React classes. %s", Pt[0], Pt[1]);
                    }
                  });
                };
                for (var ve in ne)
                  ne.hasOwnProperty(ve) && re(ve, ne[ve]);
              }
              function qe() {
              }
              qe.prototype = De.prototype;
              function ke(Ie, Pt, Et) {
                this.props = Ie, this.context = Pt, this.refs = Xe, this.updater = Et || me;
              }
              var be = ke.prototype = new qe();
              be.constructor = ke, d(be, De.prototype), be.isPureReactComponent = !0;
              function Fe() {
                var Ie = {
                  current: null
                };
                return Object.seal(Ie), Ie;
              }
              function Ke(Ie, Pt, Et) {
                var er = Pt.displayName || Pt.name || "";
                return Ie.displayName || (er !== "" ? Et + "(" + er + ")" : Et);
              }
              function nt(Ie) {
                return Ie.displayName || "Context";
              }
              function ut(Ie) {
                if (Ie == null)
                  return null;
                if (typeof Ie.tag == "number" && $("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."), typeof Ie == "function")
                  return Ie.displayName || Ie.name || null;
                if (typeof Ie == "string")
                  return Ie;
                switch (Ie) {
                  case f.Fragment:
                    return "Fragment";
                  case l:
                    return "Portal";
                  case f.Profiler:
                    return "Profiler";
                  case f.StrictMode:
                    return "StrictMode";
                  case f.Suspense:
                    return "Suspense";
                  case H:
                    return "SuspenseList";
                }
                if (typeof Ie == "object")
                  switch (Ie.$$typeof) {
                    case p:
                      var Pt = Ie;
                      return nt(Pt) + ".Consumer";
                    case P:
                      var Et = Ie;
                      return nt(Et._context) + ".Provider";
                    case c:
                      return Ke(Ie, Ie.render, "ForwardRef");
                    case T:
                      return ut(Ie.type);
                    case b:
                      return ut(Ie._render);
                    case q: {
                      var er = Ie, _r = er._payload, Xi = er._init;
                      try {
                        return ut(Xi(_r));
                      } catch {
                        return null;
                      }
                    }
                  }
                return null;
              }
              var bt = Object.prototype.hasOwnProperty, wt = {
                key: !0,
                ref: !0,
                __self: !0,
                __source: !0
              }, Tt, lr, Qt;
              Qt = {};
              function tr(Ie) {
                if (bt.call(Ie, "ref")) {
                  var Pt = Object.getOwnPropertyDescriptor(Ie, "ref").get;
                  if (Pt && Pt.isReactWarning)
                    return !1;
                }
                return Ie.ref !== void 0;
              }
              function br(Ie) {
                if (bt.call(Ie, "key")) {
                  var Pt = Object.getOwnPropertyDescriptor(Ie, "key").get;
                  if (Pt && Pt.isReactWarning)
                    return !1;
                }
                return Ie.key !== void 0;
              }
              function Xn(Ie, Pt) {
                var Et = function() {
                  Tt || (Tt = !0, $("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", Pt));
                };
                Et.isReactWarning = !0, Object.defineProperty(Ie, "key", {
                  get: Et,
                  configurable: !0
                });
              }
              function qr(Ie, Pt) {
                var Et = function() {
                  lr || (lr = !0, $("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", Pt));
                };
                Et.isReactWarning = !0, Object.defineProperty(Ie, "ref", {
                  get: Et,
                  configurable: !0
                });
              }
              function En(Ie) {
                if (typeof Ie.ref == "string" && ee.current && Ie.__self && ee.current.stateNode !== Ie.__self) {
                  var Pt = ut(ee.current.type);
                  Qt[Pt] || ($('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', Pt, Ie.ref), Qt[Pt] = !0);
                }
              }
              var Bn = function(Ie, Pt, Et, er, _r, Xi, Mn) {
                var _n = {
                  // This tag allows us to uniquely identify this as a React Element
                  $$typeof: u,
                  // Built-in properties that belong on the element
                  type: Ie,
                  key: Pt,
                  ref: Et,
                  props: Mn,
                  // Record the component responsible for creating this element.
                  _owner: Xi
                };
                return _n._store = {}, Object.defineProperty(_n._store, "validated", {
                  configurable: !1,
                  enumerable: !1,
                  writable: !0,
                  value: !1
                }), Object.defineProperty(_n, "_self", {
                  configurable: !1,
                  enumerable: !1,
                  writable: !1,
                  value: er
                }), Object.defineProperty(_n, "_source", {
                  configurable: !1,
                  enumerable: !1,
                  writable: !1,
                  value: _r
                }), Object.freeze && (Object.freeze(_n.props), Object.freeze(_n)), _n;
              };
              function Fi(Ie, Pt, Et) {
                var er, _r = {}, Xi = null, Mn = null, _n = null, Ps = null;
                if (Pt != null) {
                  tr(Pt) && (Mn = Pt.ref, En(Pt)), br(Pt) && (Xi = "" + Pt.key), _n = Pt.__self === void 0 ? null : Pt.__self, Ps = Pt.__source === void 0 ? null : Pt.__source;
                  for (er in Pt)
                    bt.call(Pt, er) && !wt.hasOwnProperty(er) && (_r[er] = Pt[er]);
                }
                var qi = arguments.length - 2;
                if (qi === 1)
                  _r.children = Et;
                else if (qi > 1) {
                  for (var Gs = Array(qi), ks = 0; ks < qi; ks++)
                    Gs[ks] = arguments[ks + 2];
                  Object.freeze && Object.freeze(Gs), _r.children = Gs;
                }
                if (Ie && Ie.defaultProps) {
                  var Na = Ie.defaultProps;
                  for (er in Na)
                    _r[er] === void 0 && (_r[er] = Na[er]);
                }
                if (Xi || Mn) {
                  var Ao = typeof Ie == "function" ? Ie.displayName || Ie.name || "Unknown" : Ie;
                  Xi && Xn(_r, Ao), Mn && qr(_r, Ao);
                }
                return Bn(Ie, Xi, Mn, _n, Ps, ee.current, _r);
              }
              function Gt(Ie, Pt) {
                var Et = Bn(Ie.type, Pt, Ie.ref, Ie._self, Ie._source, Ie._owner, Ie.props);
                return Et;
              }
              function xr(Ie, Pt, Et) {
                if (Ie == null)
                  throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + Ie + ".");
                var er, _r = d({}, Ie.props), Xi = Ie.key, Mn = Ie.ref, _n = Ie._self, Ps = Ie._source, qi = Ie._owner;
                if (Pt != null) {
                  tr(Pt) && (Mn = Pt.ref, qi = ee.current), br(Pt) && (Xi = "" + Pt.key);
                  var Gs;
                  Ie.type && Ie.type.defaultProps && (Gs = Ie.type.defaultProps);
                  for (er in Pt)
                    bt.call(Pt, er) && !wt.hasOwnProperty(er) && (Pt[er] === void 0 && Gs !== void 0 ? _r[er] = Gs[er] : _r[er] = Pt[er]);
                }
                var ks = arguments.length - 2;
                if (ks === 1)
                  _r.children = Et;
                else if (ks > 1) {
                  for (var Na = Array(ks), Ao = 0; Ao < ks; Ao++)
                    Na[Ao] = arguments[Ao + 2];
                  _r.children = Na;
                }
                return Bn(Ie.type, Xi, Mn, _n, Ps, qi, _r);
              }
              function Br(Ie) {
                return typeof Ie == "object" && Ie !== null && Ie.$$typeof === u;
              }
              var nn = ".", sn = ":";
              function Pn(Ie) {
                var Pt = /[=:]/g, Et = {
                  "=": "=0",
                  ":": "=2"
                }, er = Ie.replace(Pt, function(_r) {
                  return Et[_r];
                });
                return "$" + er;
              }
              var an = !1, Wn = /\/+/g;
              function rr(Ie) {
                return Ie.replace(Wn, "$&/");
              }
              function Sr(Ie, Pt) {
                return typeof Ie == "object" && Ie !== null && Ie.key != null ? Pn("" + Ie.key) : Pt.toString(36);
              }
              function nr(Ie, Pt, Et, er, _r) {
                var Xi = typeof Ie;
                (Xi === "undefined" || Xi === "boolean") && (Ie = null);
                var Mn = !1;
                if (Ie === null)
                  Mn = !0;
                else
                  switch (Xi) {
                    case "string":
                    case "number":
                      Mn = !0;
                      break;
                    case "object":
                      switch (Ie.$$typeof) {
                        case u:
                        case l:
                          Mn = !0;
                      }
                  }
                if (Mn) {
                  var _n = Ie, Ps = _r(_n), qi = er === "" ? nn + Sr(_n, 0) : er;
                  if (Array.isArray(Ps)) {
                    var Gs = "";
                    qi != null && (Gs = rr(qi) + "/"), nr(Ps, Pt, Gs, "", function(fi) {
                      return fi;
                    });
                  } else
                    Ps != null && (Br(Ps) && (Ps = Gt(
                      Ps,
                      // Keep both the (mapped) and old keys if they differ, just as
                      // traverseAllChildren used to do for objects as children
                      Et + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
                      (Ps.key && (!_n || _n.key !== Ps.key) ? (
                        // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
                        rr("" + Ps.key) + "/"
                      ) : "") + qi
                    )), Pt.push(Ps));
                  return 1;
                }
                var ks, Na, Ao = 0, Ro = er === "" ? nn : er + sn;
                if (Array.isArray(Ie))
                  for (var oA = 0; oA < Ie.length; oA++)
                    ks = Ie[oA], Na = Ro + Sr(ks, oA), Ao += nr(ks, Pt, Et, Na, _r);
                else {
                  var W1 = y(Ie);
                  if (typeof W1 == "function") {
                    var je = Ie;
                    W1 === je.entries && (an || L("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), an = !0);
                    for (var dt = W1.call(je), kt, _t = 0; !(kt = dt.next()).done; )
                      ks = kt.value, Na = Ro + Sr(ks, _t++), Ao += nr(ks, Pt, Et, Na, _r);
                  } else if (Xi === "object") {
                    var Cr = "" + Ie;
                    throw Error("Objects are not valid as a React child (found: " + (Cr === "[object Object]" ? "object with keys {" + Object.keys(Ie).join(", ") + "}" : Cr) + "). If you meant to render a collection of children, use an array instead.");
                  }
                }
                return Ao;
              }
              function Er(Ie, Pt, Et) {
                if (Ie == null)
                  return Ie;
                var er = [], _r = 0;
                return nr(Ie, er, "", "", function(Xi) {
                  return Pt.call(Et, Xi, _r++);
                }), er;
              }
              function Rn(Ie) {
                var Pt = 0;
                return Er(Ie, function() {
                  Pt++;
                }), Pt;
              }
              function Vn(Ie, Pt, Et) {
                Er(Ie, function() {
                  Pt.apply(this, arguments);
                }, Et);
              }
              function ki(Ie) {
                return Er(Ie, function(Pt) {
                  return Pt;
                }) || [];
              }
              function as(Ie) {
                if (!Br(Ie))
                  throw Error("React.Children.only expected to receive a single React element child.");
                return Ie;
              }
              function Rr(Ie, Pt) {
                Pt === void 0 ? Pt = null : Pt !== null && typeof Pt != "function" && $("createContext: Expected the optional second argument to be a function. Instead received: %s", Pt);
                var Et = {
                  $$typeof: p,
                  _calculateChangedBits: Pt,
                  // As a workaround to support multiple concurrent renderers, we categorize
                  // some renderers as primary and others as secondary. We only expect
                  // there to be two concurrent renderers at most: React Native (primary) and
                  // Fabric (secondary); React DOM (primary) and React ART (secondary).
                  // Secondary renderers store their context values on separate fields.
                  _currentValue: Ie,
                  _currentValue2: Ie,
                  // Used to track how many concurrent renderers this context currently
                  // supports within in a single renderer. Such as parallel server rendering.
                  _threadCount: 0,
                  // These are circular
                  Provider: null,
                  Consumer: null
                };
                Et.Provider = {
                  $$typeof: P,
                  _context: Et
                };
                var er = !1, _r = !1, Xi = !1;
                {
                  var Mn = {
                    $$typeof: p,
                    _context: Et,
                    _calculateChangedBits: Et._calculateChangedBits
                  };
                  Object.defineProperties(Mn, {
                    Provider: {
                      get: function() {
                        return _r || (_r = !0, $("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")), Et.Provider;
                      },
                      set: function(_n) {
                        Et.Provider = _n;
                      }
                    },
                    _currentValue: {
                      get: function() {
                        return Et._currentValue;
                      },
                      set: function(_n) {
                        Et._currentValue = _n;
                      }
                    },
                    _currentValue2: {
                      get: function() {
                        return Et._currentValue2;
                      },
                      set: function(_n) {
                        Et._currentValue2 = _n;
                      }
                    },
                    _threadCount: {
                      get: function() {
                        return Et._threadCount;
                      },
                      set: function(_n) {
                        Et._threadCount = _n;
                      }
                    },
                    Consumer: {
                      get: function() {
                        return er || (er = !0, $("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")), Et.Consumer;
                      }
                    },
                    displayName: {
                      get: function() {
                        return Et.displayName;
                      },
                      set: function(_n) {
                        Xi || (L("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", _n), Xi = !0);
                      }
                    }
                  }), Et.Consumer = Mn;
                }
                return Et._currentRenderer = null, Et._currentRenderer2 = null, Et;
              }
              var Ii = -1, is = 0, ji = 1, _i = 2;
              function oi(Ie) {
                if (Ie._status === Ii) {
                  var Pt = Ie._result, Et = Pt(), er = Ie;
                  er._status = is, er._result = Et, Et.then(function(_r) {
                    if (Ie._status === is) {
                      var Xi = _r.default;
                      Xi === void 0 && $(`lazy: Expected the result of a dynamic import() call. Instead received: %s

Your code should look like: 
  const MyComponent = lazy(() => import('./MyComponent'))`, _r);
                      var Mn = Ie;
                      Mn._status = ji, Mn._result = Xi;
                    }
                  }, function(_r) {
                    if (Ie._status === is) {
                      var Xi = Ie;
                      Xi._status = _i, Xi._result = _r;
                    }
                  });
                }
                if (Ie._status === ji)
                  return Ie._result;
                throw Ie._result;
              }
              function vr(Ie) {
                var Pt = {
                  // We use these fields to store the result.
                  _status: -1,
                  _result: Ie
                }, Et = {
                  $$typeof: q,
                  _payload: Pt,
                  _init: oi
                };
                {
                  var er, _r;
                  Object.defineProperties(Et, {
                    defaultProps: {
                      configurable: !0,
                      get: function() {
                        return er;
                      },
                      set: function(Xi) {
                        $("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), er = Xi, Object.defineProperty(Et, "defaultProps", {
                          enumerable: !0
                        });
                      }
                    },
                    propTypes: {
                      configurable: !0,
                      get: function() {
                        return _r;
                      },
                      set: function(Xi) {
                        $("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), _r = Xi, Object.defineProperty(Et, "propTypes", {
                          enumerable: !0
                        });
                      }
                    }
                  });
                }
                return Et;
              }
              function Fr(Ie) {
                Ie != null && Ie.$$typeof === T ? $("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : typeof Ie != "function" ? $("forwardRef requires a render function but was given %s.", Ie === null ? "null" : typeof Ie) : Ie.length !== 0 && Ie.length !== 2 && $("forwardRef render functions accept exactly two parameters: props and ref. %s", Ie.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."), Ie != null && (Ie.defaultProps != null || Ie.propTypes != null) && $("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
                var Pt = {
                  $$typeof: c,
                  render: Ie
                };
                {
                  var Et;
                  Object.defineProperty(Pt, "displayName", {
                    enumerable: !1,
                    configurable: !0,
                    get: function() {
                      return Et;
                    },
                    set: function(er) {
                      Et = er, Ie.displayName == null && (Ie.displayName = er);
                    }
                  });
                }
                return Pt;
              }
              var pr = !1;
              function ds(Ie) {
                return !!(typeof Ie == "string" || typeof Ie == "function" || Ie === f.Fragment || Ie === f.Profiler || Ie === m || Ie === f.StrictMode || Ie === f.Suspense || Ie === H || Ie === I || pr || typeof Ie == "object" && Ie !== null && (Ie.$$typeof === q || Ie.$$typeof === T || Ie.$$typeof === P || Ie.$$typeof === p || Ie.$$typeof === c || Ie.$$typeof === w || Ie.$$typeof === b || Ie[0] === j));
              }
              function it(Ie, Pt) {
                ds(Ie) || $("memo: The first argument must be a component. Instead received: %s", Ie === null ? "null" : typeof Ie);
                var Et = {
                  $$typeof: T,
                  type: Ie,
                  compare: Pt === void 0 ? null : Pt
                };
                {
                  var er;
                  Object.defineProperty(Et, "displayName", {
                    enumerable: !1,
                    configurable: !0,
                    get: function() {
                      return er;
                    },
                    set: function(_r) {
                      er = _r, Ie.displayName == null && (Ie.displayName = _r);
                    }
                  });
                }
                return Et;
              }
              function $t() {
                var Ie = O.current;
                if (Ie === null)
                  throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);
                return Ie;
              }
              function Ur(Ie, Pt) {
                var Et = $t();
                if (Pt !== void 0 && $("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s", Pt, typeof Pt == "number" && Array.isArray(arguments[2]) ? `

Did you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://reactjs.org/link/rules-of-hooks` : ""), Ie._context !== void 0) {
                  var er = Ie._context;
                  er.Consumer === Ie ? $("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?") : er.Provider === Ie && $("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
                }
                return Et.useContext(Ie, Pt);
              }
              function $e(Ie) {
                var Pt = $t();
                return Pt.useState(Ie);
              }
              function Kt(Ie, Pt, Et) {
                var er = $t();
                return er.useReducer(Ie, Pt, Et);
              }
              function cr(Ie) {
                var Pt = $t();
                return Pt.useRef(Ie);
              }
              function Vr(Ie, Pt) {
                var Et = $t();
                return Et.useEffect(Ie, Pt);
              }
              function Lr(Ie, Pt) {
                var Et = $t();
                return Et.useLayoutEffect(Ie, Pt);
              }
              function pi(Ie, Pt) {
                var Et = $t();
                return Et.useCallback(Ie, Pt);
              }
              function zr(Ie, Pt) {
                var Et = $t();
                return Et.useMemo(Ie, Pt);
              }
              function Cn(Ie, Pt, Et) {
                var er = $t();
                return er.useImperativeHandle(Ie, Pt, Et);
              }
              function Mi(Ie, Pt) {
                {
                  var Et = $t();
                  return Et.useDebugValue(Ie, Pt);
                }
              }
              var li = 0, Xs, Ri, j1, w1, di, jf, B6;
              function W6() {
              }
              W6.__reactDisabledLog = !0;
              function S6() {
                {
                  if (li === 0) {
                    Xs = console.log, Ri = console.info, j1 = console.warn, w1 = console.error, di = console.group, jf = console.groupCollapsed, B6 = console.groupEnd;
                    var Ie = {
                      configurable: !0,
                      enumerable: !0,
                      value: W6,
                      writable: !0
                    };
                    Object.defineProperties(console, {
                      info: Ie,
                      log: Ie,
                      warn: Ie,
                      error: Ie,
                      group: Ie,
                      groupCollapsed: Ie,
                      groupEnd: Ie
                    });
                  }
                  li++;
                }
              }
              function qa() {
                {
                  if (li--, li === 0) {
                    var Ie = {
                      configurable: !0,
                      enumerable: !0,
                      writable: !0
                    };
                    Object.defineProperties(console, {
                      log: d({}, Ie, {
                        value: Xs
                      }),
                      info: d({}, Ie, {
                        value: Ri
                      }),
                      warn: d({}, Ie, {
                        value: j1
                      }),
                      error: d({}, Ie, {
                        value: w1
                      }),
                      group: d({}, Ie, {
                        value: di
                      }),
                      groupCollapsed: d({}, Ie, {
                        value: jf
                      }),
                      groupEnd: d({}, Ie, {
                        value: B6
                      })
                    });
                  }
                  li < 0 && $("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
                }
              }
              var m1 = G.ReactCurrentDispatcher, Ho;
              function X9(Ie, Pt, Et) {
                {
                  if (Ho === void 0)
                    try {
                      throw Error();
                    } catch (_r) {
                      var er = _r.stack.trim().match(/\n( *(at )?)/);
                      Ho = er && er[1] || "";
                    }
                  return `
` + Ho + Ie;
                }
              }
              var $o = !1, T9;
              {
                var q9 = typeof WeakMap == "function" ? WeakMap : Map;
                T9 = new q9();
              }
              function wf(Ie, Pt) {
                if (!Ie || $o)
                  return "";
                {
                  var Et = T9.get(Ie);
                  if (Et !== void 0)
                    return Et;
                }
                var er;
                $o = !0;
                var _r = Error.prepareStackTrace;
                Error.prepareStackTrace = void 0;
                var Xi;
                Xi = m1.current, m1.current = null, S6();
                try {
                  if (Pt) {
                    var Mn = function() {
                      throw Error();
                    };
                    if (Object.defineProperty(Mn.prototype, "props", {
                      set: function() {
                        throw Error();
                      }
                    }), typeof Reflect == "object" && Reflect.construct) {
                      try {
                        Reflect.construct(Mn, []);
                      } catch (Ro) {
                        er = Ro;
                      }
                      Reflect.construct(Ie, [], Mn);
                    } else {
                      try {
                        Mn.call();
                      } catch (Ro) {
                        er = Ro;
                      }
                      Ie.call(Mn.prototype);
                    }
                  } else {
                    try {
                      throw Error();
                    } catch (Ro) {
                      er = Ro;
                    }
                    Ie();
                  }
                } catch (Ro) {
                  if (Ro && er && typeof Ro.stack == "string") {
                    for (var _n = Ro.stack.split(`
`), Ps = er.stack.split(`
`), qi = _n.length - 1, Gs = Ps.length - 1; qi >= 1 && Gs >= 0 && _n[qi] !== Ps[Gs]; )
                      Gs--;
                    for (; qi >= 1 && Gs >= 0; qi--, Gs--)
                      if (_n[qi] !== Ps[Gs]) {
                        if (qi !== 1 || Gs !== 1)
                          do
                            if (qi--, Gs--, Gs < 0 || _n[qi] !== Ps[Gs]) {
                              var ks = `
` + _n[qi].replace(" at new ", " at ");
                              return typeof Ie == "function" && T9.set(Ie, ks), ks;
                            }
                          while (qi >= 1 && Gs >= 0);
                        break;
                      }
                  }
                } finally {
                  $o = !1, m1.current = Xi, qa(), Error.prepareStackTrace = _r;
                }
                var Na = Ie ? Ie.displayName || Ie.name : "", Ao = Na ? X9(Na) : "";
                return typeof Ie == "function" && T9.set(Ie, Ao), Ao;
              }
              function mf(Ie, Pt, Et) {
                return wf(Ie, !1);
              }
              function B1(Ie) {
                var Pt = Ie.prototype;
                return !!(Pt && Pt.isReactComponent);
              }
              function h1(Ie, Pt, Et) {
                if (Ie == null)
                  return "";
                if (typeof Ie == "function")
                  return wf(Ie, B1(Ie));
                if (typeof Ie == "string")
                  return X9(Ie);
                switch (Ie) {
                  case f.Suspense:
                    return X9("Suspense");
                  case H:
                    return X9("SuspenseList");
                }
                if (typeof Ie == "object")
                  switch (Ie.$$typeof) {
                    case c:
                      return mf(Ie.render);
                    case T:
                      return h1(Ie.type, Pt, Et);
                    case b:
                      return mf(Ie._render);
                    case q: {
                      var er = Ie, _r = er._payload, Xi = er._init;
                      try {
                        return h1(Xi(_r), Pt, Et);
                      } catch {
                      }
                    }
                  }
                return "";
              }
              var U6 = {}, b9 = G.ReactDebugCurrentFrame;
              function J9(Ie) {
                if (Ie) {
                  var Pt = Ie._owner, Et = h1(Ie.type, Ie._source, Pt ? Pt.type : null);
                  b9.setExtraStackFrame(Et);
                } else
                  b9.setExtraStackFrame(null);
              }
              function OA(Ie, Pt, Et, er, _r) {
                {
                  var Xi = Function.call.bind(Object.prototype.hasOwnProperty);
                  for (var Mn in Ie)
                    if (Xi(Ie, Mn)) {
                      var _n = void 0;
                      try {
                        if (typeof Ie[Mn] != "function") {
                          var Ps = Error((er || "React class") + ": " + Et + " type `" + Mn + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof Ie[Mn] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                          throw Ps.name = "Invariant Violation", Ps;
                        }
                        _n = Ie[Mn](Pt, Mn, er, Et, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                      } catch (qi) {
                        _n = qi;
                      }
                      _n && !(_n instanceof Error) && (J9(_r), $("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", er || "React class", Et, Mn, typeof _n), J9(null)), _n instanceof Error && !(_n.message in U6) && (U6[_n.message] = !0, J9(_r), $("Failed %s type: %s", Et, _n.message), J9(null));
                    }
                }
              }
              function z1(Ie) {
                if (Ie) {
                  var Pt = Ie._owner, Et = h1(Ie.type, Ie._source, Pt ? Pt.type : null);
                  fe(Et);
                } else
                  fe(null);
              }
              var Zd;
              Zd = !1;
              function Zr() {
                if (ee.current) {
                  var Ie = ut(ee.current.type);
                  if (Ie)
                    return `

Check the render method of \`` + Ie + "`.";
                }
                return "";
              }
              function Ts(Ie) {
                if (Ie !== void 0) {
                  var Pt = Ie.fileName.replace(/^.*[\\\/]/, ""), Et = Ie.lineNumber;
                  return `

Check your code at ` + Pt + ":" + Et + ".";
                }
                return "";
              }
              function go(Ie) {
                return Ie != null ? Ts(Ie.__source) : "";
              }
              var G1 = {};
              function z9(Ie) {
                var Pt = Zr();
                if (!Pt) {
                  var Et = typeof Ie == "string" ? Ie : Ie.displayName || Ie.name;
                  Et && (Pt = `

Check the top-level render call using <` + Et + ">.");
                }
                return Pt;
              }
              function Li(Ie, Pt) {
                if (!(!Ie._store || Ie._store.validated || Ie.key != null)) {
                  Ie._store.validated = !0;
                  var Et = z9(Pt);
                  if (!G1[Et]) {
                    G1[Et] = !0;
                    var er = "";
                    Ie && Ie._owner && Ie._owner !== ee.current && (er = " It was passed a child from " + ut(Ie._owner.type) + "."), z1(Ie), $('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', Et, er), z1(null);
                  }
                }
              }
              function Fa(Ie, Pt) {
                if (typeof Ie == "object") {
                  if (Array.isArray(Ie))
                    for (var Et = 0; Et < Ie.length; Et++) {
                      var er = Ie[Et];
                      Br(er) && Li(er, Pt);
                    }
                  else if (Br(Ie))
                    Ie._store && (Ie._store.validated = !0);
                  else if (Ie) {
                    var _r = y(Ie);
                    if (typeof _r == "function" && _r !== Ie.entries)
                      for (var Xi = _r.call(Ie), Mn; !(Mn = Xi.next()).done; )
                        Br(Mn.value) && Li(Mn.value, Pt);
                  }
                }
              }
              function Sa(Ie) {
                {
                  var Pt = Ie.type;
                  if (Pt == null || typeof Pt == "string")
                    return;
                  var Et;
                  if (typeof Pt == "function")
                    Et = Pt.propTypes;
                  else if (typeof Pt == "object" && (Pt.$$typeof === c || // Note: Memo only checks outer props here.
                  // Inner props are checked in the reconciler.
                  Pt.$$typeof === T))
                    Et = Pt.propTypes;
                  else
                    return;
                  if (Et) {
                    var er = ut(Pt);
                    OA(Et, Ie.props, "prop", er, Ie);
                  } else if (Pt.PropTypes !== void 0 && !Zd) {
                    Zd = !0;
                    var _r = ut(Pt);
                    $("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _r || "Unknown");
                  }
                  typeof Pt.getDefaultProps == "function" && !Pt.getDefaultProps.isReactClassApproved && $("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
                }
              }
              function Fn(Ie) {
                {
                  for (var Pt = Object.keys(Ie.props), Et = 0; Et < Pt.length; Et++) {
                    var er = Pt[Et];
                    if (er !== "children" && er !== "key") {
                      z1(Ie), $("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", er), z1(null);
                      break;
                    }
                  }
                  Ie.ref !== null && (z1(Ie), $("Invalid attribute `ref` supplied to `React.Fragment`."), z1(null));
                }
              }
              function I6(Ie, Pt, Et) {
                var er = ds(Ie);
                if (!er) {
                  var _r = "";
                  (Ie === void 0 || typeof Ie == "object" && Ie !== null && Object.keys(Ie).length === 0) && (_r += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
                  var Xi = go(Pt);
                  Xi ? _r += Xi : _r += Zr();
                  var Mn;
                  Ie === null ? Mn = "null" : Array.isArray(Ie) ? Mn = "array" : Ie !== void 0 && Ie.$$typeof === u ? (Mn = "<" + (ut(Ie.type) || "Unknown") + " />", _r = " Did you accidentally export a JSX literal instead of a component?") : Mn = typeof Ie, $("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Mn, _r);
                }
                var _n = Fi.apply(this, arguments);
                if (_n == null)
                  return _n;
                if (er)
                  for (var Ps = 2; Ps < arguments.length; Ps++)
                    Fa(arguments[Ps], Ie);
                return Ie === f.Fragment ? Fn(_n) : Sa(_n), _n;
              }
              var $i = !1;
              function Ga(Ie) {
                var Pt = I6.bind(null, Ie);
                return Pt.type = Ie, $i || ($i = !0, L("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")), Object.defineProperty(Pt, "type", {
                  enumerable: !1,
                  get: function() {
                    return L("Factory.type is deprecated. Access the class directly before passing it to createFactory."), Object.defineProperty(this, "type", {
                      value: Ie
                    }), Ie;
                  }
                }), Pt;
              }
              function e1(Ie, Pt, Et) {
                for (var er = xr.apply(this, arguments), _r = 2; _r < arguments.length; _r++)
                  Fa(arguments[_r], er.type);
                return Sa(er), er;
              }
              try {
                var Lf = Object.freeze({});
              } catch {
              }
              var Ua = I6, vs = e1, R6 = Ga, Bf = {
                map: Er,
                forEach: Vn,
                count: Rn,
                toArray: ki,
                only: as
              };
              f.Children = Bf, f.Component = De, f.PureComponent = ke, f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = G, f.cloneElement = vs, f.createContext = Rr, f.createElement = Ua, f.createFactory = R6, f.createRef = Fe, f.forwardRef = Fr, f.isValidElement = Br, f.lazy = vr, f.memo = it, f.useCallback = pi, f.useContext = Ur, f.useDebugValue = Mi, f.useEffect = Vr, f.useImperativeHandle = Cn, f.useLayoutEffect = Lr, f.useMemo = zr, f.useReducer = Kt, f.useRef = cr, f.useState = $e, f.version = v;
            })();
          }
        ),
        /***/
        "../../../../node_modules/react/index.js": (
          /*!***********************************************!*\
            !*** ../../../../node_modules/react/index.js ***!
            \***********************************************/
          /***/
          (a, f, o) => {
            a.exports = o(
              /*! ./cjs/react.development.js */
              "../../../../node_modules/react/cjs/react.development.js"
            );
          }
        ),
        /***/
        "../../../../node_modules/react/jsx-runtime.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/react/jsx-runtime.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            a.exports = o(
              /*! ./cjs/react-jsx-runtime.development.js */
              "../../../../node_modules/react/cjs/react-jsx-runtime.development.js"
            );
          }
        ),
        /***/
        "../../../../node_modules/scheduler/cjs/scheduler-tracing.development.js": (
          /*!*******************************************************************************!*\
            !*** ../../../../node_modules/scheduler/cjs/scheduler-tracing.development.js ***!
            \*******************************************************************************/
          /***/
          (a, f) => {
            /** @license React v0.20.2
             * scheduler-tracing.development.js
             *
             * Copyright (c) Facebook, Inc. and its affiliates.
             *
             * This source code is licensed under the MIT license found in the
             * LICENSE file in the root directory of this source tree.
             */
            (function() {
              var o = 0, d = 0, v = 0;
              f.__interactionsRef = null, f.__subscriberRef = null, f.__interactionsRef = {
                current: /* @__PURE__ */ new Set()
              }, f.__subscriberRef = {
                current: null
              };
              function u(k) {
                var R = f.__interactionsRef.current;
                f.__interactionsRef.current = /* @__PURE__ */ new Set();
                try {
                  return k();
                } finally {
                  f.__interactionsRef.current = R;
                }
              }
              function l() {
                return f.__interactionsRef.current;
              }
              function P() {
                return ++v;
              }
              function p(k, R, y) {
                var O = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : o, Y = {
                  __count: 1,
                  id: d++,
                  name: k,
                  timestamp: R
                }, ee = f.__interactionsRef.current, Z = new Set(ee);
                Z.add(Y), f.__interactionsRef.current = Z;
                var te = f.__subscriberRef.current, fe;
                try {
                  te !== null && te.onInteractionTraced(Y);
                } finally {
                  try {
                    te !== null && te.onWorkStarted(Z, O);
                  } finally {
                    try {
                      fe = y();
                    } finally {
                      f.__interactionsRef.current = ee;
                      try {
                        te !== null && te.onWorkStopped(Z, O);
                      } finally {
                        Y.__count--, te !== null && Y.__count === 0 && te.onInteractionScheduledWorkCompleted(Y);
                      }
                    }
                  }
                }
                return fe;
              }
              function c(k) {
                var R = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : o, y = f.__interactionsRef.current, O = f.__subscriberRef.current;
                O !== null && O.onWorkScheduled(y, R), y.forEach(function(Z) {
                  Z.__count++;
                });
                var Y = !1;
                function ee() {
                  var Z = f.__interactionsRef.current;
                  f.__interactionsRef.current = y, O = f.__subscriberRef.current;
                  try {
                    var te;
                    try {
                      O !== null && O.onWorkStarted(y, R);
                    } finally {
                      try {
                        te = k.apply(void 0, arguments);
                      } finally {
                        f.__interactionsRef.current = Z, O !== null && O.onWorkStopped(y, R);
                      }
                    }
                    return te;
                  } finally {
                    Y || (Y = !0, y.forEach(function(fe) {
                      fe.__count--, O !== null && fe.__count === 0 && O.onInteractionScheduledWorkCompleted(fe);
                    }));
                  }
                }
                return ee.cancel = function() {
                  O = f.__subscriberRef.current;
                  try {
                    O !== null && O.onWorkCanceled(y, R);
                  } finally {
                    y.forEach(function(te) {
                      te.__count--, O && te.__count === 0 && O.onInteractionScheduledWorkCompleted(te);
                    });
                  }
                }, ee;
              }
              var H = null;
              H = /* @__PURE__ */ new Set();
              function T(k) {
                H.add(k), H.size === 1 && (f.__subscriberRef.current = {
                  onInteractionScheduledWorkCompleted: j,
                  onInteractionTraced: b,
                  onWorkCanceled: N,
                  onWorkScheduled: w,
                  onWorkStarted: m,
                  onWorkStopped: I
                });
              }
              function q(k) {
                H.delete(k), H.size === 0 && (f.__subscriberRef.current = null);
              }
              function b(k) {
                var R = !1, y = null;
                if (H.forEach(function(O) {
                  try {
                    O.onInteractionTraced(k);
                  } catch (Y) {
                    R || (R = !0, y = Y);
                  }
                }), R)
                  throw y;
              }
              function j(k) {
                var R = !1, y = null;
                if (H.forEach(function(O) {
                  try {
                    O.onInteractionScheduledWorkCompleted(k);
                  } catch (Y) {
                    R || (R = !0, y = Y);
                  }
                }), R)
                  throw y;
              }
              function w(k, R) {
                var y = !1, O = null;
                if (H.forEach(function(Y) {
                  try {
                    Y.onWorkScheduled(k, R);
                  } catch (ee) {
                    y || (y = !0, O = ee);
                  }
                }), y)
                  throw O;
              }
              function m(k, R) {
                var y = !1, O = null;
                if (H.forEach(function(Y) {
                  try {
                    Y.onWorkStarted(k, R);
                  } catch (ee) {
                    y || (y = !0, O = ee);
                  }
                }), y)
                  throw O;
              }
              function I(k, R) {
                var y = !1, O = null;
                if (H.forEach(function(Y) {
                  try {
                    Y.onWorkStopped(k, R);
                  } catch (ee) {
                    y || (y = !0, O = ee);
                  }
                }), y)
                  throw O;
              }
              function N(k, R) {
                var y = !1, O = null;
                if (H.forEach(function(Y) {
                  try {
                    Y.onWorkCanceled(k, R);
                  } catch (ee) {
                    y || (y = !0, O = ee);
                  }
                }), y)
                  throw O;
              }
              f.unstable_clear = u, f.unstable_getCurrent = l, f.unstable_getThreadID = P, f.unstable_subscribe = T, f.unstable_trace = p, f.unstable_unsubscribe = q, f.unstable_wrap = c;
            })();
          }
        ),
        /***/
        "../../../../node_modules/scheduler/cjs/scheduler.development.js": (
          /*!***********************************************************************!*\
            !*** ../../../../node_modules/scheduler/cjs/scheduler.development.js ***!
            \***********************************************************************/
          /***/
          (a, f) => {
            /** @license React v0.20.2
             * scheduler.development.js
             *
             * Copyright (c) Facebook, Inc. and its affiliates.
             *
             * This source code is licensed under the MIT license found in the
             * LICENSE file in the root directory of this source tree.
             */
            (function() {
              var o = !1, d = !1, v, u, l, P, p = typeof performance == "object" && typeof performance.now == "function";
              if (p) {
                var c = performance;
                f.unstable_now = function() {
                  return c.now();
                };
              } else {
                var H = Date, T = H.now();
                f.unstable_now = function() {
                  return H.now() - T;
                };
              }
              if (
                // If Scheduler runs in a non-DOM environment, it falls back to a naive
                // implementation using setTimeout.
                typeof window > "u" || // Check if MessageChannel is supported, too.
                typeof MessageChannel != "function"
              ) {
                var q = null, b = null, j = function() {
                  if (q !== null)
                    try {
                      var rr = f.unstable_now(), Sr = !0;
                      q(Sr, rr), q = null;
                    } catch (nr) {
                      throw setTimeout(j, 0), nr;
                    }
                };
                v = function(rr) {
                  q !== null ? setTimeout(v, 0, rr) : (q = rr, setTimeout(j, 0));
                }, u = function(rr, Sr) {
                  b = setTimeout(rr, Sr);
                }, l = function() {
                  clearTimeout(b);
                }, f.unstable_shouldYield = function() {
                  return !1;
                }, P = f.unstable_forceFrameRate = function() {
                };
              } else {
                var w = window.setTimeout, m = window.clearTimeout;
                if (typeof console < "u") {
                  var I = window.requestAnimationFrame, N = window.cancelAnimationFrame;
                  typeof I != "function" && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), typeof N != "function" && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
                }
                var k = !1, R = null, y = -1, O = 5, Y = 0;
                f.unstable_shouldYield = function() {
                  return f.unstable_now() >= Y;
                }, P = function() {
                }, f.unstable_forceFrameRate = function(rr) {
                  if (rr < 0 || rr > 125) {
                    console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
                    return;
                  }
                  rr > 0 ? O = Math.floor(1e3 / rr) : O = 5;
                };
                var ee = function() {
                  if (R !== null) {
                    var rr = f.unstable_now();
                    Y = rr + O;
                    var Sr = !0;
                    try {
                      var nr = R(Sr, rr);
                      nr ? te.postMessage(null) : (k = !1, R = null);
                    } catch (Er) {
                      throw te.postMessage(null), Er;
                    }
                  } else
                    k = !1;
                }, Z = new MessageChannel(), te = Z.port2;
                Z.port1.onmessage = ee, v = function(rr) {
                  R = rr, k || (k = !0, te.postMessage(null));
                }, u = function(rr, Sr) {
                  y = w(function() {
                    rr(f.unstable_now());
                  }, Sr);
                }, l = function() {
                  m(y), y = -1;
                };
              }
              function fe(rr, Sr) {
                var nr = rr.length;
                rr.push(Sr), L(rr, Sr, nr);
              }
              function _(rr) {
                var Sr = rr[0];
                return Sr === void 0 ? null : Sr;
              }
              function G(rr) {
                var Sr = rr[0];
                if (Sr !== void 0) {
                  var nr = rr.pop();
                  return nr !== Sr && (rr[0] = nr, $(rr, nr, 0)), Sr;
                } else
                  return null;
              }
              function L(rr, Sr, nr) {
                for (var Er = nr; ; ) {
                  var Rn = Er - 1 >>> 1, Vn = rr[Rn];
                  if (Vn !== void 0 && ae(Vn, Sr) > 0)
                    rr[Rn] = Sr, rr[Er] = Vn, Er = Rn;
                  else
                    return;
                }
              }
              function $(rr, Sr, nr) {
                for (var Er = nr, Rn = rr.length; Er < Rn; ) {
                  var Vn = (Er + 1) * 2 - 1, ki = rr[Vn], as = Vn + 1, Rr = rr[as];
                  if (ki !== void 0 && ae(ki, Sr) < 0)
                    Rr !== void 0 && ae(Rr, ki) < 0 ? (rr[Er] = Rr, rr[as] = Sr, Er = as) : (rr[Er] = ki, rr[Vn] = Sr, Er = Vn);
                  else if (Rr !== void 0 && ae(Rr, Sr) < 0)
                    rr[Er] = Rr, rr[as] = Sr, Er = as;
                  else
                    return;
                }
              }
              function ae(rr, Sr) {
                var nr = rr.sortIndex - Sr.sortIndex;
                return nr !== 0 ? nr : rr.id - Sr.id;
              }
              var Pe = 1, ge = 2, me = 3, Xe = 4, De = 5;
              function ne(rr, Sr) {
              }
              var re = 1073741823, ve = -1, qe = 250, ke = 5e3, be = 1e4, Fe = re, Ke = [], nt = [], ut = 1, bt = null, wt = me, Tt = !1, lr = !1, Qt = !1;
              function tr(rr) {
                for (var Sr = _(nt); Sr !== null; ) {
                  if (Sr.callback === null)
                    G(nt);
                  else if (Sr.startTime <= rr)
                    G(nt), Sr.sortIndex = Sr.expirationTime, fe(Ke, Sr);
                  else
                    return;
                  Sr = _(nt);
                }
              }
              function br(rr) {
                if (Qt = !1, tr(rr), !lr)
                  if (_(Ke) !== null)
                    lr = !0, v(Xn);
                  else {
                    var Sr = _(nt);
                    Sr !== null && u(br, Sr.startTime - rr);
                  }
              }
              function Xn(rr, Sr) {
                lr = !1, Qt && (Qt = !1, l()), Tt = !0;
                var nr = wt;
                try {
                  var Er;
                  if (!d)
                    return qr(rr, Sr);
                } finally {
                  bt = null, wt = nr, Tt = !1;
                }
              }
              function qr(rr, Sr) {
                var nr = Sr;
                for (tr(nr), bt = _(Ke); bt !== null && !o && !(bt.expirationTime > nr && (!rr || f.unstable_shouldYield())); ) {
                  var Er = bt.callback;
                  if (typeof Er == "function") {
                    bt.callback = null, wt = bt.priorityLevel;
                    var Rn = bt.expirationTime <= nr, Vn = Er(Rn);
                    nr = f.unstable_now(), typeof Vn == "function" ? bt.callback = Vn : bt === _(Ke) && G(Ke), tr(nr);
                  } else
                    G(Ke);
                  bt = _(Ke);
                }
                if (bt !== null)
                  return !0;
                var ki = _(nt);
                return ki !== null && u(br, ki.startTime - nr), !1;
              }
              function En(rr, Sr) {
                switch (rr) {
                  case Pe:
                  case ge:
                  case me:
                  case Xe:
                  case De:
                    break;
                  default:
                    rr = me;
                }
                var nr = wt;
                wt = rr;
                try {
                  return Sr();
                } finally {
                  wt = nr;
                }
              }
              function Bn(rr) {
                var Sr;
                switch (wt) {
                  case Pe:
                  case ge:
                  case me:
                    Sr = me;
                    break;
                  default:
                    Sr = wt;
                    break;
                }
                var nr = wt;
                wt = Sr;
                try {
                  return rr();
                } finally {
                  wt = nr;
                }
              }
              function Fi(rr) {
                var Sr = wt;
                return function() {
                  var nr = wt;
                  wt = Sr;
                  try {
                    return rr.apply(this, arguments);
                  } finally {
                    wt = nr;
                  }
                };
              }
              function Gt(rr, Sr, nr) {
                var Er = f.unstable_now(), Rn;
                if (typeof nr == "object" && nr !== null) {
                  var Vn = nr.delay;
                  typeof Vn == "number" && Vn > 0 ? Rn = Er + Vn : Rn = Er;
                } else
                  Rn = Er;
                var ki;
                switch (rr) {
                  case Pe:
                    ki = ve;
                    break;
                  case ge:
                    ki = qe;
                    break;
                  case De:
                    ki = Fe;
                    break;
                  case Xe:
                    ki = be;
                    break;
                  case me:
                  default:
                    ki = ke;
                    break;
                }
                var as = Rn + ki, Rr = {
                  id: ut++,
                  callback: Sr,
                  priorityLevel: rr,
                  startTime: Rn,
                  expirationTime: as,
                  sortIndex: -1
                };
                return Rn > Er ? (Rr.sortIndex = Rn, fe(nt, Rr), _(Ke) === null && Rr === _(nt) && (Qt ? l() : Qt = !0, u(br, Rn - Er))) : (Rr.sortIndex = as, fe(Ke, Rr), !lr && !Tt && (lr = !0, v(Xn))), Rr;
              }
              function xr() {
              }
              function Br() {
                !lr && !Tt && (lr = !0, v(Xn));
              }
              function nn() {
                return _(Ke);
              }
              function sn(rr) {
                rr.callback = null;
              }
              function Pn() {
                return wt;
              }
              var an = P, Wn = null;
              f.unstable_IdlePriority = De, f.unstable_ImmediatePriority = Pe, f.unstable_LowPriority = Xe, f.unstable_NormalPriority = me, f.unstable_Profiling = Wn, f.unstable_UserBlockingPriority = ge, f.unstable_cancelCallback = sn, f.unstable_continueExecution = Br, f.unstable_getCurrentPriorityLevel = Pn, f.unstable_getFirstCallbackNode = nn, f.unstable_next = Bn, f.unstable_pauseExecution = xr, f.unstable_requestPaint = an, f.unstable_runWithPriority = En, f.unstable_scheduleCallback = Gt, f.unstable_wrapCallback = Fi;
            })();
          }
        ),
        /***/
        "../../../../node_modules/scheduler/index.js": (
          /*!***************************************************!*\
            !*** ../../../../node_modules/scheduler/index.js ***!
            \***************************************************/
          /***/
          (a, f, o) => {
            a.exports = o(
              /*! ./cjs/scheduler.development.js */
              "../../../../node_modules/scheduler/cjs/scheduler.development.js"
            );
          }
        ),
        /***/
        "../../../../node_modules/scheduler/tracing.js": (
          /*!*****************************************************!*\
            !*** ../../../../node_modules/scheduler/tracing.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            a.exports = o(
              /*! ./cjs/scheduler-tracing.development.js */
              "../../../../node_modules/scheduler/cjs/scheduler-tracing.development.js"
            );
          }
        ),
        /***/
        "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": (
          /*!**************************************************************************************!*\
            !*** ../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
            \**************************************************************************************/
          /***/
          (a) => {
            var f = [];
            function o(u) {
              for (var l = -1, P = 0; P < f.length; P++)
                if (f[P].identifier === u) {
                  l = P;
                  break;
                }
              return l;
            }
            function d(u, l) {
              for (var P = {}, p = [], c = 0; c < u.length; c++) {
                var H = u[c], T = l.base ? H[0] + l.base : H[0], q = P[T] || 0, b = "".concat(T, " ").concat(q);
                P[T] = q + 1;
                var j = o(b), w = {
                  css: H[1],
                  media: H[2],
                  sourceMap: H[3],
                  supports: H[4],
                  layer: H[5]
                };
                if (j !== -1)
                  f[j].references++, f[j].updater(w);
                else {
                  var m = v(w, l);
                  l.byIndex = c, f.splice(c, 0, {
                    identifier: b,
                    updater: m,
                    references: 1
                  });
                }
                p.push(b);
              }
              return p;
            }
            function v(u, l) {
              var P = l.domAPI(l);
              P.update(u);
              var p = function(H) {
                if (H) {
                  if (H.css === u.css && H.media === u.media && H.sourceMap === u.sourceMap && H.supports === u.supports && H.layer === u.layer)
                    return;
                  P.update(u = H);
                } else
                  P.remove();
              };
              return p;
            }
            a.exports = function(u, l) {
              l = l || {}, u = u || [];
              var P = d(u, l);
              return function(c) {
                c = c || [];
                for (var H = 0; H < P.length; H++) {
                  var T = P[H], q = o(T);
                  f[q].references--;
                }
                for (var b = d(c, l), j = 0; j < P.length; j++) {
                  var w = P[j], m = o(w);
                  f[m].references === 0 && (f[m].updater(), f.splice(m, 1));
                }
                P = b;
              };
            };
          }
        ),
        /***/
        "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js": (
          /*!******************************************************************************!*\
            !*** ../../../../node_modules/style-loader/dist/runtime/insertBySelector.js ***!
            \******************************************************************************/
          /***/
          (a) => {
            var f = {};
            function o(v) {
              if (typeof f[v] > "u") {
                var u = document.querySelector(v);
                if (window.HTMLIFrameElement && u instanceof window.HTMLIFrameElement)
                  try {
                    u = u.contentDocument.head;
                  } catch {
                    u = null;
                  }
                f[v] = u;
              }
              return f[v];
            }
            function d(v, u) {
              var l = o(v);
              if (!l)
                throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
              l.appendChild(u);
            }
            a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js": (
          /*!********************************************************************************!*\
            !*** ../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
            \********************************************************************************/
          /***/
          (a) => {
            function f(o) {
              var d = document.createElement("style");
              return o.setAttributes(d, o.attributes), o.insert(d, o.options), d;
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js": (
          /*!********************************************************************************************!*\
            !*** ../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
            \********************************************************************************************/
          /***/
          (a, f, o) => {
            function d(v) {
              var u = o.nc;
              u && v.setAttribute("nonce", u);
            }
            a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js": (
          /*!*************************************************************************!*\
            !*** ../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
            \*************************************************************************/
          /***/
          (a) => {
            function f(v, u, l) {
              var P = "";
              l.supports && (P += "@supports (".concat(l.supports, ") {")), l.media && (P += "@media ".concat(l.media, " {"));
              var p = typeof l.layer < "u";
              p && (P += "@layer".concat(l.layer.length > 0 ? " ".concat(l.layer) : "", " {")), P += l.css, p && (P += "}"), l.media && (P += "}"), l.supports && (P += "}");
              var c = l.sourceMap;
              c && typeof btoa < "u" && (P += `
/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(c)))), " */")), u.styleTagTransform(P, v, u.options);
            }
            function o(v) {
              if (v.parentNode === null)
                return !1;
              v.parentNode.removeChild(v);
            }
            function d(v) {
              if (typeof document > "u")
                return {
                  update: function() {
                  },
                  remove: function() {
                  }
                };
              var u = v.insertStyleElement(v);
              return {
                update: function(P) {
                  f(u, v, P);
                },
                remove: function() {
                  o(u);
                }
              };
            }
            a.exports = d;
          }
        ),
        /***/
        "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js": (
          /*!*******************************************************************************!*\
            !*** ../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
            \*******************************************************************************/
          /***/
          (a) => {
            function f(o, d) {
              if (d.styleSheet)
                d.styleSheet.cssText = o;
              else {
                for (; d.firstChild; )
                  d.removeChild(d.firstChild);
                d.appendChild(document.createTextNode(o));
              }
            }
            a.exports = f;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/colorPicker/colorComponentEntry.js": (
          /*!*******************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/colorPicker/colorComponentEntry.js ***!
            \*******************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ColorComponentEntry: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            class u extends v.Component {
              constructor(P) {
                super(P);
              }
              updateValue(P) {
                if (/[^0-9.-]/g.test(P))
                  return;
                let p = parseInt(P);
                isNaN(p) || (this.props.max != null && p > this.props.max && (p = this.props.max), this.props.min != null && p < this.props.min && (p = this.props.min), this.props.onChange(p));
              }
              lock() {
                this.props.lockObject && (this.props.lockObject.lock = !0);
              }
              unlock() {
                this.props.lockObject && (this.props.lockObject.lock = !1);
              }
              render() {
                return (0, d.jsxs)("div", { className: "color-picker-component", children: [(0, d.jsx)("div", { className: "color-picker-component-value", children: (0, d.jsx)("input", { type: "number", step: 1, className: "numeric-input", value: this.props.value, onBlur: () => this.unlock(), onFocus: () => this.lock(), onChange: (P) => this.updateValue(P.target.value), disabled: this.props.disabled }) }), (0, d.jsx)("div", { className: "color-picker-component-label", children: this.props.label })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.js": (
          /*!***********************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.js ***!
            \***********************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ColorPicker: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Maths/math.color */
              "core/Misc/dataStorage"
            ), l = o(
              /*! ./colorComponentEntry */
              "../../../dev/sharedUiComponents/dist/colorPicker/colorComponentEntry.js"
            ), P = o(
              /*! ./hexColor */
              "../../../dev/sharedUiComponents/dist/colorPicker/hexColor.js"
            );
            o(
              /*! ./colorPicker.scss */
              "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss"
            );
            class p extends v.Component {
              constructor(H) {
                super(H), this.props.color instanceof u.Color4 ? this.state = { color: new u.Color3(this.props.color.r, this.props.color.g, this.props.color.b), alpha: this.props.color.a } : this.state = { color: this.props.color.clone(), alpha: 1 }, this._saturationRef = v.createRef(), this._hueRef = v.createRef();
              }
              shouldComponentUpdate(H, T) {
                return H.color.toHexString() !== this.props.color.toHexString() || T.color.toHexString() !== this.props.color.toHexString();
              }
              onSaturationPointerDown(H) {
                this._evaluateSaturation(H), this._isSaturationPointerDown = !0, H.currentTarget.setPointerCapture(H.pointerId);
              }
              onSaturationPointerUp(H) {
                this._isSaturationPointerDown = !1, H.currentTarget.releasePointerCapture(H.pointerId);
              }
              onSaturationPointerMove(H) {
                this._isSaturationPointerDown && this._evaluateSaturation(H);
              }
              onHuePointerDown(H) {
                this._evaluateHue(H), this._isHuePointerDown = !0, H.currentTarget.setPointerCapture(H.pointerId);
              }
              onHuePointerUp(H) {
                this._isHuePointerDown = !1, H.currentTarget.releasePointerCapture(H.pointerId);
              }
              onHuePointerMove(H) {
                this._isHuePointerDown && this._evaluateHue(H);
              }
              _evaluateSaturation(H) {
                const T = H.nativeEvent.offsetX, q = H.nativeEvent.offsetY, b = Math.min(1, Math.max(1e-4, T / this._saturationRef.current.clientWidth)), j = Math.min(1, Math.max(1e-4, 1 - q / this._saturationRef.current.clientHeight));
                this.props.debugMode && (console.log("Saturation: " + b), console.log("Value: " + j));
                const w = this.state.color.toHSV();
                u.Color3.HSVtoRGBToRef(w.r, b, j, this.state.color), this.state.alpha === 0 && this.setState({ alpha: 1 }), this.setState({ color: this.state.color });
              }
              _evaluateHue(H) {
                const T = H.nativeEvent.offsetX, q = 360 * Math.min(0.9999, Math.max(1e-4, T / this._hueRef.current.clientWidth));
                this.props.debugMode && console.log("Hue: " + q);
                const b = this.state.color.toHSV();
                u.Color3.HSVtoRGBToRef(q, Math.max(b.g, 0.01), Math.max(b.b, 0.01), this.state.color), this.setState({ color: this.state.color });
              }
              componentDidUpdate() {
                this.raiseOnColorChanged();
              }
              raiseOnColorChanged() {
                if (this.props.onColorChanged) {
                  if (this.props.color instanceof u.Color4) {
                    const H = u.Color4.FromColor3(this.state.color, this.state.alpha);
                    this.props.onColorChanged(H);
                    return;
                  }
                  this.props.onColorChanged(this.state.color.clone());
                }
              }
              render() {
                const H = u.Color4.FromColor3(this.state.color);
                H.a = this.state.alpha;
                const T = H.toHexString(), q = this.state.color.toHSV(), b = new u.Color3();
                u.Color3.HSVtoRGBToRef(q.r, 1, 1, b);
                const j = b.toHexString(), w = this.props.color instanceof u.Color4;
                return (0, d.jsxs)("div", { className: "color-picker-container" + (this.props.linearhint ? " with-hints" : ""), children: [(0, d.jsxs)("div", { className: "color-picker-saturation", onPointerMove: (m) => this.onSaturationPointerMove(m), onPointerDown: (m) => this.onSaturationPointerDown(m), onPointerUp: (m) => this.onSaturationPointerUp(m), ref: this._saturationRef, style: {
                  background: j
                }, children: [(0, d.jsx)("div", { className: "color-picker-saturation-white" }), (0, d.jsx)("div", { className: "color-picker-saturation-black" }), (0, d.jsx)("div", { className: "color-picker-saturation-cursor", style: {
                  top: `${-(q.b * 100) + 100}%`,
                  left: `${q.g * 100}%`
                } })] }), (0, d.jsxs)("div", { className: "color-picker-hue", children: [(0, d.jsx)("div", { className: "color-picker-hue-color", style: {
                  background: T
                } }), (0, d.jsx)("div", { className: "color-picker-hue-slider", ref: this._hueRef, onPointerMove: (m) => this.onHuePointerMove(m), onPointerDown: (m) => this.onHuePointerDown(m), onPointerUp: (m) => this.onHuePointerUp(m), children: (0, d.jsx)("div", { className: "color-picker-hue-cursor", style: {
                  left: `${q.r / 360 * 100}%`,
                  border: "1px solid " + j
                } }) })] }), (0, d.jsx)("div", { className: "color-picker-alpha" }), (0, d.jsxs)("div", { className: "color-picker-rgb", children: [(0, d.jsx)("div", { className: "red", children: (0, d.jsx)(l.ColorComponentEntry, { lockObject: this.props.lockObject, label: "R", min: 0, max: 255, value: Math.round(this.state.color.r * 255), onChange: (m) => {
                  this.state.color.r = m / 255, this.forceUpdate();
                } }) }), (0, d.jsx)("div", { className: "green", children: (0, d.jsx)(l.ColorComponentEntry, { lockObject: this.props.lockObject, label: "G", min: 0, max: 255, value: Math.round(this.state.color.g * 255), onChange: (m) => {
                  this.state.color.g = m / 255, this.forceUpdate();
                } }) }), (0, d.jsx)("div", { className: "blue", children: (0, d.jsx)(l.ColorComponentEntry, { lockObject: this.props.lockObject, label: "B", min: 0, max: 255, value: Math.round(this.state.color.b * 255), onChange: (m) => {
                  this.state.color.b = m / 255, this.forceUpdate();
                } }) }), (0, d.jsx)("div", { className: "alpha" + (w ? "" : " grayed"), children: (0, d.jsx)(l.ColorComponentEntry, { lockObject: this.props.lockObject, label: "A", min: 0, max: 255, value: Math.round(this.state.alpha * 255), onChange: (m) => {
                  this.setState({ alpha: m / 255 }), this.forceUpdate();
                } }) })] }), (0, d.jsxs)("div", { className: "color-picker-hex", children: [(0, d.jsx)("div", { className: "color-picker-hex-label", children: "Hex" }), (0, d.jsx)("div", { className: "color-picker-hex-value", children: (0, d.jsx)(P.HexColor, { lockObject: this.props.lockObject, expectedLength: w ? 8 : 6, value: T, onChange: (m) => {
                  if (w) {
                    const I = u.Color4.FromHexString(m);
                    this.setState({ color: new u.Color3(I.r, I.g, I.b), alpha: I.a });
                  } else
                    this.setState({ color: u.Color3.FromHexString(m) });
                } }) })] }), this.props.linearhint && (0, d.jsx)("div", { className: "color-picker-warning", children: "(Note: color is stored in linear mode and was converted to gamma to be displayed here (toGammaSpace() / toLinearSpace()))" })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/colorPicker/hexColor.js": (
          /*!********************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/colorPicker/hexColor.js ***!
            \********************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              HexColor: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            class u extends v.Component {
              constructor(P) {
                super(P), this.state = { hex: this.props.value.replace("#", "") };
              }
              shouldComponentUpdate(P, p) {
                return P.value !== this.props.value && (p.hex = P.value.replace("#", "")), !0;
              }
              lock() {
                this.props.lockObject && (this.props.lockObject.lock = !0);
              }
              unlock() {
                this.props.lockObject && (this.props.lockObject.lock = !1);
              }
              updateHexValue(P) {
                if (!(P != "" && /^[0-9A-Fa-f]+$/g.test(P) == !1)) {
                  if (this.setState({ hex: P }), P.length !== this.props.expectedLength)
                    if (this.props.expectedLength === 8 && P.length === 6)
                      P = P + "FF";
                    else if (this.props.expectedLength === 6 && P.length === 8)
                      P = P.substring(0, 6);
                    else
                      return;
                  this.props.onChange("#" + P);
                }
              }
              render() {
                return (0, d.jsx)("input", { type: "string", className: "hex-input", value: this.state.hex, onBlur: () => this.unlock(), onFocus: () => this.lock(), onChange: (P) => this.updateHexValue(P.target.value) });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/components/MessageDialog.js": (
          /*!************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/components/MessageDialog.js ***!
            \************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              MessageDialog: () => (
                /* binding */
                P
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ./classNames */
              "../../../dev/sharedUiComponents/dist/components/classNames.js"
            ), l = o(
              /*! ./MessageDialog.modules.scss */
              "../../../dev/sharedUiComponents/dist/components/MessageDialog.modules.scss"
            );
            const P = (p) => {
              const [c, H] = (0, v.useState)(p.message), [T, q] = (0, v.useState)(p.isError);
              (0, v.useEffect)(() => {
                H(p.message), q(p.isError);
              }, [p]);
              const b = () => {
                H(""), p.onClose && p.onClose();
              };
              return c ? (0, d.jsx)("div", { className: l.default["dialog-container"], children: (0, d.jsxs)("div", { className: l.default.dialog, children: [(0, d.jsx)("div", { className: l.default["dialog-message"], children: c }), (0, d.jsx)("div", { className: l.default["dialog-buttons"], children: (0, d.jsx)("div", { className: (0, u.ClassNames)({ "dialog-button-ok": !0, error: T }, l.default), onClick: b, children: "OK" }) })] }) }) : null;
            };
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/components/classNames.js": (
          /*!*********************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/components/classNames.js ***!
            \*********************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ClassNames: () => (
                /* binding */
                d
              ),
              /* harmony export */
              JoinClassNames: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            function d(u, l) {
              let P = "";
              for (const p in u)
                u[p] && (P += l[p] + " ");
              return P;
            }
            function v(u, ...l) {
              let P = "";
              for (const p of l)
                p && u[p] && (P += u[p] + " ");
              return P;
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js": (
          /*!*************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js ***!
            \*************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ButtonLineComponent: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            class u extends v.Component {
              constructor(P) {
                super(P);
              }
              render() {
                return (0, d.jsxs)("div", { className: "buttonLine" + (this.props.isDisabled ? " disabled" : ""), children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0, d.jsx)("button", { onClick: () => this.props.onClick(), children: this.props.label })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js": (
          /*!*************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js ***!
            \*************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Color3LineComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ./colorLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js"
            );
            class l extends v.Component {
              render() {
                const p = this.props;
                return (0, d.jsx)(u.ColorLineComponent, { disableAlpha: !0, ...p });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js": (
          /*!*************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js ***!
            \*************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Color4LineComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ./colorLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js"
            );
            class l extends v.Component {
              render() {
                const p = this.props;
                return (0, d.jsx)(u.ColorLineComponent, { ...p });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js": (
          /*!************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js ***!
            \************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ColorLineComponent: () => (
                /* binding */
                b
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Maths/math.color */
              "core/Misc/dataStorage"
            ), l = o(
              /*! ./numericInputComponent */
              "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js"
            ), P = o(
              /*! @fortawesome/react-fontawesome */
              "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js"
            ), p = o(
              /*! @fortawesome/free-solid-svg-icons */
              "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs"
            ), c = o(
              /*! ./colorPickerComponent */
              "../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js"
            ), H = o(
              /*! ./targetsProxy */
              "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js"
            ), T = o(
              /*! ./copy.svg */
              "../../../dev/sharedUiComponents/dist/lines/copy.svg"
            );
            const q = new u.Color4(0, 0, 0, 0);
            class b extends v.Component {
              constructor(w) {
                super(w), this.state = { isExpanded: !1, color: this.getValue() };
                const m = this.props.target;
                m._isLinearColor = w.isLinear;
              }
              shouldComponentUpdate(w, m) {
                const I = m.color, N = this.getValue(w);
                return I !== this.state.color ? (m.color = I, !0) : N !== this.state.color ? (m.color = N, !0) : m.isExpanded !== this.state.isExpanded;
              }
              getValue(w = this.props) {
                const I = w.target[w.propertyName];
                return I ? typeof I == "string" ? I === H.conflictingValuesPlaceholder ? q : this._convertToColor(I) : w.isLinear ? I.toGammaSpace() : I.clone() : q;
              }
              setColorFromString(w) {
                const m = this._convertToColor(w);
                this.setColor(m);
              }
              setColor(w) {
                this.setState({ color: w.clone() }), this.props.isLinear && w.toLinearSpaceToRef(w);
                const m = this.props.disableAlpha ? this._toColor3(w) : w, I = this.props.target, N = I[this.props.propertyName], k = typeof I[this.props.propertyName] == "string" ? m.toHexString() : m;
                I[this.props.propertyName] = k, this.props.onPropertyChangedObservable && this.props.onPropertyChangedObservable.notifyObservers({
                  object: I,
                  property: this.props.propertyName,
                  value: k,
                  initialValue: N
                }), this.props.onChange && this.props.onChange();
              }
              switchExpandState() {
                this.setState({ isExpanded: !this.state.isExpanded });
              }
              updateStateR(w) {
                this.setColor(new u.Color4(w, this.state.color.g, this.state.color.b, this.state.color.a));
              }
              updateStateG(w) {
                this.setColor(new u.Color4(this.state.color.r, w, this.state.color.b, this.state.color.a));
              }
              updateStateB(w) {
                this.setColor(new u.Color4(this.state.color.r, this.state.color.g, w, this.state.color.a));
              }
              updateStateA(w) {
                this.props.disableAlpha || this.setColor(new u.Color4(this.state.color.r, this.state.color.g, this.state.color.b, w));
              }
              copyToClipboard() {
                const w = document.createElement("div");
                if (w.textContent = this.state.color.toHexString(), document.body.appendChild(w), window.getSelection) {
                  const m = document.createRange();
                  m.selectNode(w), window.getSelection().removeAllRanges(), window.getSelection().addRange(m);
                }
                document.execCommand("copy"), w.remove();
              }
              _convertToColor(w) {
                if (w === "" || w === "transparent")
                  return q;
                if (w.substring(0, 1) !== "#" || w.length !== 7 && w.length !== 9) {
                  const m = document.createElement("div");
                  m.style.color = w, document.body.append(m);
                  const I = window.getComputedStyle(m).color;
                  document.body.removeChild(m);
                  const N = I.substring(4, I.length - 1).replace(/ /g, "").split(","), k = N.length > 3 ? parseInt(N[3]) / 255 : 1;
                  return new u.Color4(parseInt(N[0]) / 255, parseInt(N[1]) / 255, parseInt(N[2]) / 255, k);
                }
                if (this.props.disableAlpha) {
                  const m = u.Color3.FromHexString(w);
                  return new u.Color4(m.r, m.g, m.b, 1);
                }
                return u.Color4.FromHexString(w);
              }
              _toColor3(w) {
                return new u.Color3(w.r, w.g, w.b);
              }
              render() {
                const w = this.state.isExpanded ? (0, d.jsx)(P.FontAwesomeIcon, { icon: p.faMinus }) : (0, d.jsx)(P.FontAwesomeIcon, { icon: p.faPlus });
                return (0, d.jsxs)("div", { className: "color3Line", children: [(0, d.jsxs)("div", { className: "firstLine", children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0, d.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0, d.jsx)("div", { className: "color3", children: (0, d.jsx)(c.ColorPickerLineComponent, { lockObject: this.props.lockObject, linearHint: this.props.isLinear, value: this.props.disableAlpha ? this._toColor3(this.state.color) : this.state.color, onColorChanged: (m) => {
                  this.setColorFromString(m);
                } }) }), (0, d.jsx)("div", { className: "copy hoverIcon", onClick: () => this.copyToClipboard(), title: "Copy to clipboard", children: (0, d.jsx)("img", { src: T, alt: "Copy" }) }), (0, d.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: w })] }), this.state.isExpanded && (0, d.jsxs)("div", { className: "secondLine", children: [(0, d.jsx)(l.NumericInputComponent, { lockObject: this.props.lockObject, label: "r", value: this.state.color.r, onChange: (m) => this.updateStateR(m) }), (0, d.jsx)(l.NumericInputComponent, { lockObject: this.props.lockObject, label: "g", value: this.state.color.g, onChange: (m) => this.updateStateG(m) }), (0, d.jsx)(l.NumericInputComponent, { lockObject: this.props.lockObject, label: "b", value: this.state.color.b, onChange: (m) => this.updateStateB(m) }), this.props.disableAlpha || (0, d.jsx)(l.NumericInputComponent, { lockObject: this.props.lockObject, label: "a", value: this.state.color.a, onChange: (m) => this.updateStateA(m) })] })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js": (
          /*!**************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ColorPickerLineComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../colorPicker/colorPicker */
              "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.js"
            );
            class l extends v.Component {
              constructor(p) {
                super(p), this.state = { pickerEnabled: !1, color: this.props.value, hex: this.getHexString(p) }, this._floatRef = v.createRef(), this._floatHostRef = v.createRef();
              }
              syncPositions() {
                const p = this._floatRef.current, c = this._floatHostRef.current;
                if (!p || !c)
                  return;
                let H = c.getBoundingClientRect().top;
                const T = p.getBoundingClientRect().height;
                H + T + 10 > window.innerHeight && (H = window.innerHeight - T - 10), p.style.top = H + "px", this.props.shouldPopRight ? p.style.left = c.getBoundingClientRect().left + "px" : p.style.left = c.getBoundingClientRect().left - p.getBoundingClientRect().width + "px";
              }
              shouldComponentUpdate(p, c) {
                const H = this.getHexString(p) !== this.getHexString();
                return H && (c.color = p.value, c.hex = this.getHexString(p)), H || c.hex !== this.state.hex || c.pickerEnabled !== this.state.pickerEnabled;
              }
              getHexString(p = this.props) {
                return p.value.toHexString();
              }
              componentDidUpdate() {
                this.syncPositions();
              }
              componentDidMount() {
                this.syncPositions();
              }
              render() {
                return (0, d.jsxs)("div", { className: "color-picker", children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0, d.jsx)("div", { className: "color-rect-background", ref: this._floatHostRef, onClick: () => this.setState({ pickerEnabled: !0 }), children: (0, d.jsx)("div", { className: "color-rect", style: { background: this.state.hex } }) }), this.state.pickerEnabled && (0, d.jsx)(d.Fragment, { children: (0, d.jsx)("div", { className: "color-picker-cover", onClick: (p) => {
                  var c, H;
                  p.target === ((H = (c = this._floatRef.current) == null ? void 0 : c.ownerDocument) == null ? void 0 : H.querySelector(".color-picker-cover")) && this.setState({ pickerEnabled: !1 });
                }, children: (0, d.jsx)("div", { className: "color-picker-float", ref: this._floatRef, children: (0, d.jsx)(u.ColorPicker, { lockObject: this.props.lockObject || {}, color: this.state.color, linearhint: this.props.linearHint, onColorChanged: (p) => {
                  const c = p.toHexString();
                  this.setState({ hex: c, color: p }), this.props.onColorChanged(c);
                } }) }) }) })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js": (
          /*!************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js ***!
            \************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              FloatLineComponent: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ./sliderLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js"
            ), l = o(
              /*! core/Misc/tools */
              "core/Misc/dataStorage"
            ), P = o(
              /*! ./targetsProxy */
              "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js"
            ), p = o(
              /*! ./inputArrowsComponent */
              "../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js"
            );
            class c extends v.Component {
              constructor(T) {
                super(T), this._localChange = !1;
                const q = this.props.target[this.props.propertyName];
                this.state = { value: this.getValueString(q, this.props), dragging: !1 }, this._store = q;
              }
              componentWillUnmount() {
                this.unlock();
              }
              getValueString(T, q) {
                return T ? T === P.conflictingValuesPlaceholder ? P.conflictingValuesPlaceholder : q.isInteger ? T.toFixed(0) : T.toFixed(q.digits || 4) : "0";
              }
              shouldComponentUpdate(T, q) {
                if (this._localChange)
                  return this._localChange = !1, !0;
                const b = T.target[T.propertyName], j = this.getValueString(b, T);
                return j !== q.value ? (q.value = j, !0) : q.dragging != this.state.dragging || T.unit !== this.props.unit || T.isInteger !== this.props.isInteger;
              }
              raiseOnPropertyChanged(T, q) {
                this.props.onChange && this.props.onChange(T), this.props.onPropertyChangedObservable && this.props.onPropertyChangedObservable.notifyObservers({
                  object: this.props.target,
                  property: this.props.propertyName,
                  value: T,
                  initialValue: q
                });
              }
              updateValue(T) {
                if (/[^0-9.-]/g.test(T))
                  return;
                let q;
                this.props.isInteger ? q = parseInt(T) : q = parseFloat(T), isNaN(q) ? this.props.defaultValue != null && (q = this.props.defaultValue) : (this.props.min !== void 0 && q < this.props.min && (q = this.props.min, T = q.toString()), this.props.max !== void 0 && q > this.props.max && (q = this.props.max, T = q.toString())), this._localChange = !0, this.setState({ value: T }), !isNaN(q) && (this.props.target[this.props.propertyName] = q, this.raiseOnPropertyChanged(q, this._store), this._store = q);
              }
              lock() {
                this.props.lockObject && (this.props.lockObject.lock = !0);
              }
              unlock() {
                this.props.lockObject && (this.props.lockObject.lock = !1);
              }
              incrementValue(T, q = !0) {
                q && this.props.step && (T *= parseFloat(this.props.step));
                let b = parseFloat(this.state.value);
                isNaN(b) && (b = 0), this.updateValue((b + T).toFixed(2));
              }
              onKeyDown(T) {
                const q = parseFloat(this.props.step || this.props.isInteger ? "1" : "0.01"), b = (j) => {
                  T.shiftKey && (j *= 10, (T.ctrlKey || T.metaKey) && (j *= 10)), this.incrementValue(j * q, !1), T.preventDefault();
                };
                T.key === "ArrowUp" ? b(1) : T.key === "ArrowDown" && b(-1), T.key === "Enter" && this.props.onEnter && this.props.onEnter(this._store);
              }
              render() {
                let T;
                this.props.isInteger ? T = parseInt(this.state.value) : T = parseFloat(this.state.value);
                let q = this.props.smallUI ? "short" : "value";
                this.state.dragging && (q += " dragging"), this.props.arrows && (q += " hasArrows");
                const b = this.state.value === P.conflictingValuesPlaceholder ? "" : this.state.value, j = this.state.value === P.conflictingValuesPlaceholder ? P.conflictingValuesPlaceholder : "";
                return (0, d.jsxs)(d.Fragment, { children: [!this.props.useEuler && (0, d.jsxs)("div", { className: this.props.additionalClass ? this.props.additionalClass + " floatLine" : "floatLine", children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (!this.props.icon || this.props.label != "") && (0, d.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0, d.jsxs)("div", { className: q, children: [(0, d.jsx)("input", { type: "number", step: this.props.step || this.props.isInteger ? "1" : "0.01", className: "numeric-input", onKeyDown: (w) => this.onKeyDown(w), value: b, onBlur: () => {
                  this.unlock(), this.props.onEnter && this.props.onEnter(this._store);
                }, placeholder: j, onFocus: () => this.lock(), onChange: (w) => this.updateValue(w.target.value) }), this.props.arrows && (0, d.jsx)(p.InputArrowsComponent, { incrementValue: (w) => this.incrementValue(w), setDragging: (w) => {
                  const m = this.state.dragging;
                  !m && w && this.props.onDragStart ? this.props.onDragStart(T) : m && !w && this.props.onDragStop && this.props.onDragStop(T), this.setState({ dragging: w });
                } })] }), this.props.unit] }), this.props.useEuler && (0, d.jsx)(u.SliderLineComponent, { lockObject: this.props.lockObject, label: this.props.label, minimum: 0, maximum: 360, step: 0.1, directValue: l.Tools.ToDegrees(T), onChange: (w) => this.updateValue(l.Tools.ToRadians(w).toString()) })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js": (
          /*!**************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              InputArrowsComponent: () => (
                /* binding */
                P
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ./valueUpArrowIcon.svg */
              "../../../dev/sharedUiComponents/dist/lines/valueUpArrowIcon.svg"
            ), l = o(
              /*! ./valueDownArrowIcon.svg */
              "../../../dev/sharedUiComponents/dist/lines/valueDownArrowIcon.svg"
            );
            class P extends v.Component {
              constructor() {
                super(...arguments), this._arrowsRef = v.createRef(), this._drag = (c) => {
                  this.props.incrementValue(-c.movementY);
                }, this._releaseListener = () => {
                  var c, H, T, q;
                  this.props.setDragging(!1), (c = this._arrowsRef.current) == null || c.ownerDocument.exitPointerLock(), (H = this._arrowsRef.current) == null || H.ownerDocument.defaultView.removeEventListener("pointerup", this._releaseListener), (T = this._arrowsRef.current) == null || T.ownerDocument.removeEventListener("pointerlockchange", this._lockChangeListener), (q = this._arrowsRef.current) == null || q.ownerDocument.defaultView.removeEventListener("mousemove", this._drag);
                }, this._lockChangeListener = () => {
                  var c;
                  ((c = this._arrowsRef.current) == null ? void 0 : c.ownerDocument.pointerLockElement) !== this._arrowsRef.current && this._releaseListener();
                };
              }
              render() {
                return (0, d.jsxs)("div", { className: "arrows", ref: this._arrowsRef, onPointerDown: () => {
                  var c, H, T, q;
                  (c = this._arrowsRef.current) == null || c.ownerDocument.addEventListener("pointerlockchange", this._lockChangeListener), (H = this._arrowsRef.current) == null || H.ownerDocument.defaultView.addEventListener("pointerup", this._releaseListener), (T = this._arrowsRef.current) == null || T.ownerDocument.defaultView.addEventListener("mousemove", this._drag), this.props.setDragging(!0), (q = this._arrowsRef.current) == null || q.requestPointerLock();
                }, onDragStart: (c) => c.preventDefault(), children: [(0, d.jsx)("img", { className: "upArrowIcon", src: u, alt: "Increase Value" }), (0, d.jsx)("img", { className: "downArrowIcon", src: l, alt: "Increase Value" })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/matrixLineComponent.js": (
          /*!*************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/matrixLineComponent.js ***!
            \*************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              MatrixLineComponent: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Maths/math.vector */
              "core/Misc/dataStorage"
            ), l = o(
              /*! ./vector4LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector4LineComponent.js"
            ), P = o(
              /*! ./optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            ), p = o(
              /*! ./sliderLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js"
            );
            class c extends v.Component {
              constructor(T) {
                super(T), this._localChange = !1;
                const q = this.props.target[this.props.propertyName].clone();
                let b = 0;
                if (this.props.mode) {
                  const j = new u.Quaternion();
                  q.decompose(void 0, j);
                  const w = j.toEulerAngles();
                  switch (this.props.mode) {
                    case 1:
                      b = w.x;
                      break;
                    case 2:
                      b = w.y;
                      break;
                    case 3:
                      b = w.z;
                      break;
                  }
                }
                this.state = { value: q, mode: this.props.mode || 0, angle: b };
              }
              shouldComponentUpdate(T, q) {
                const b = T.target[T.propertyName];
                return !b.equals(q.value) || this._localChange ? (q.value = b.clone(), this._localChange = !1, !0) : q.mode !== this.state.mode || q.angle !== this.state.angle;
              }
              raiseOnPropertyChanged(T) {
                this.props.onChange && this.props.onChange(this.state.value), this.props.onPropertyChangedObservable && this.props.onPropertyChangedObservable.notifyObservers({
                  object: this.props.target,
                  property: this.props.propertyName,
                  value: this.state.value,
                  initialValue: T
                });
              }
              updateMatrix() {
                const T = this.props.target[this.props.propertyName].clone();
                this.props.target[this.props.propertyName] = this.state.value, this.setState({ value: T }), this.raiseOnPropertyChanged(T);
              }
              updateRow(T, q) {
                this._localChange = !0, this.state.value.setRow(q, T), this.updateMatrix();
              }
              updateBasedOnMode(T) {
                switch (this.state.mode) {
                  case 1: {
                    u.Matrix.RotationXToRef(this.state.angle, this.state.value);
                    break;
                  }
                  case 2: {
                    u.Matrix.RotationYToRef(this.state.angle, this.state.value);
                    break;
                  }
                  case 3: {
                    u.Matrix.RotationZToRef(this.state.angle, this.state.value);
                    break;
                  }
                }
                this.updateMatrix(), this.setState({ angle: T });
              }
              render() {
                const T = [
                  { label: "User-defined", value: 0 },
                  { label: "Rotation over X axis", value: 1 },
                  { label: "Rotation over Y axis", value: 2 },
                  { label: "Rotation over Z axis", value: 3 }
                ];
                return (0, d.jsxs)("div", { className: "vector3Line", children: [(0, d.jsx)("div", { className: "firstLine", children: (0, d.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }) }), (0, d.jsx)("div", { className: "secondLine", children: (0, d.jsx)(P.OptionsLineComponent, { label: "Mode", className: "no-right-margin", options: T, target: this, noDirectUpdate: !0, propertyName: "", extractValue: () => this.state.mode, onSelect: (q) => {
                  this.props.target[this.props.propertyName] = u.Matrix.Identity(), u.Matrix.IdentityToRef(this.state.value), this.setState({ mode: q, angle: 0 }), this.updateMatrix(), this.props.onModeChange && this.props.onModeChange(q);
                } }) }), this.state.mode === 0 && (0, d.jsxs)("div", { className: "secondLine", children: [(0, d.jsx)(l.Vector4LineComponent, { lockObject: this.props.lockObject, label: "Row #0", value: this.state.value.getRow(0), onChange: (q) => this.updateRow(q, 0) }), (0, d.jsx)(l.Vector4LineComponent, { lockObject: this.props.lockObject, label: "Row #1", value: this.state.value.getRow(1), onChange: (q) => this.updateRow(q, 1) }), (0, d.jsx)(l.Vector4LineComponent, { lockObject: this.props.lockObject, label: "Row #2", value: this.state.value.getRow(2), onChange: (q) => this.updateRow(q, 2) }), (0, d.jsx)(l.Vector4LineComponent, { lockObject: this.props.lockObject, label: "Row #3", value: this.state.value.getRow(3), onChange: (q) => this.updateRow(q, 3) })] }), this.state.mode !== 0 && (0, d.jsx)("div", { className: "secondLine", children: (0, d.jsx)(p.SliderLineComponent, { label: "Angle", lockObject: this.props.lockObject, minimum: 0, maximum: 2 * Math.PI, useEuler: !0, step: 0.1, directValue: this.state.angle, onChange: (q) => this.updateBasedOnMode(q) }) })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js": (
          /*!***************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js ***!
            \***************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              NumericInputComponent: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            class u extends v.Component {
              constructor(P) {
                super(P), this._localChange = !1, this.state = { value: this.props.value.toFixed(this.props.precision !== void 0 ? this.props.precision : 3) };
              }
              componentWillUnmount() {
                this.props.lockObject && (this.props.lockObject.lock = !1);
              }
              shouldComponentUpdate(P, p) {
                return this._localChange ? !0 : P.value.toString() !== p.value ? (p.value = P.value.toFixed(this.props.precision !== void 0 ? this.props.precision : 3), !0) : !1;
              }
              updateValue(P) {
                if (/[^0-9.-]/g.test(P))
                  return;
                const p = parseFloat(P);
                this._localChange = !0, this.setState({ value: P }), !isNaN(p) && this.props.onChange(p);
              }
              onBlur() {
                this._localChange = !1;
                const P = parseFloat(this.state.value);
                if (this.props.lockObject && (this.props.lockObject.lock = !1), isNaN(P)) {
                  this.props.onChange(this.props.value);
                  return;
                }
                this.props.onChange(P);
              }
              incrementValue(P) {
                let p = parseFloat(this.state.value);
                isNaN(p) && (p = 0), this.updateValue((p + P).toFixed(this.props.precision !== void 0 ? this.props.precision : 3));
              }
              onKeyDown(P) {
                const p = this.props.step || 1, c = (H) => {
                  P.shiftKey && (H *= 10, (P.ctrlKey || P.metaKey) && (H *= 10)), this.incrementValue(H * p), P.preventDefault();
                };
                P.key === "ArrowUp" ? c(1) : P.key === "ArrowDown" && c(-1);
              }
              render() {
                return (0, d.jsxs)("div", { className: "numeric", children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), this.props.label && (0, d.jsx)("div", { className: "numeric-label", title: this.props.label, children: `${this.props.label}: ` }), (0, d.jsx)("input", { type: "number", step: this.props.step, className: "numeric-input", value: this.state.value, onChange: (P) => this.updateValue(P.target.value), onKeyDown: (P) => this.onKeyDown(P), onFocus: () => {
                  this.props.lockObject && (this.props.lockObject.lock = !0);
                }, onBlur: () => this.onBlur() })] });
              }
            }
            u.defaultProps = {
              step: 1
            };
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js": (
          /*!**************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Null_Value: () => (
                /* binding */
                u
              ),
              /* harmony export */
              OptionsLineComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            const u = Number.MAX_SAFE_INTEGER;
            class l extends v.Component {
              _remapValueIn(p) {
                return this.props.allowNullValue && p === null ? u : p;
              }
              _remapValueOut(p) {
                return this.props.allowNullValue && p === u ? null : p;
              }
              _getValue(p) {
                return p.extractValue ? p.extractValue(p.target) : p.target && p.propertyName ? p.target[p.propertyName] : p.options[p.defaultIfNull || 0];
              }
              constructor(p) {
                super(p), this._localChange = !1, this.state = { value: this._remapValueIn(this._getValue(p)) };
              }
              shouldComponentUpdate(p, c) {
                if (this._localChange)
                  return this._localChange = !1, !0;
                const H = this._remapValueIn(p.extractValue ? p.extractValue(this.props.target) : p.target[p.propertyName]);
                return H != null && H !== c.value ? (c.value = H, !0) : !1;
              }
              raiseOnPropertyChanged(p, c) {
                this.props.onPropertyChangedObservable && this.props.onPropertyChangedObservable.notifyObservers({
                  object: this.props.target,
                  property: this.props.propertyName,
                  value: p,
                  initialValue: c,
                  allowNullValue: this.props.allowNullValue
                });
              }
              setValue(p) {
                this.setState({ value: p });
              }
              updateValue(p) {
                const c = this.props.valuesAreStrings ? p : parseInt(p);
                this._localChange = !0;
                const H = this.props.extractValue ? this.props.extractValue(this.props.target) : this.props.target[this.props.propertyName];
                this.props.noDirectUpdate || (this.props.target[this.props.propertyName] = this._remapValueOut(c)), this.setState({ value: c }), this.props.onSelect && this.props.onSelect(c);
                const T = this.props.extractValue ? this.props.extractValue(this.props.target) : this.props.target[this.props.propertyName];
                this.raiseOnPropertyChanged(T, H);
              }
              render() {
                return (0, d.jsxs)("div", { className: "listLine" + (this.props.className ? " " + this.props.className : ""), children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, color: "black", className: "icon" }), (0, d.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0, d.jsx)("div", { className: "options", children: (0, d.jsx)("select", { onChange: (p) => this.updateValue(p.target.value), value: this.state.value ?? "", children: this.props.options.map((p, c) => (0, d.jsx)("option", { selected: p.selected, value: p.value, title: p.label, children: p.label }, p.label + c)) }) })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js": (
          /*!*************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js ***!
            \*************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              SliderLineComponent: () => (
                /* binding */
                P
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Misc/tools */
              "core/Misc/dataStorage"
            ), l = o(
              /*! ./floatLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js"
            );
            class P extends v.Component {
              constructor(c) {
                if (super(c), this._localChange = !1, this.props.directValue !== void 0)
                  this.state = {
                    value: this.props.directValue
                  };
                else {
                  let H = this.props.target[this.props.propertyName];
                  H === void 0 && (H = this.props.maximum), this.state = { value: H };
                }
              }
              shouldComponentUpdate(c, H) {
                if (c.directValue !== void 0)
                  return H.value = c.directValue, !0;
                if (c.label !== this.props.label)
                  return !0;
                let T = c.target[c.propertyName];
                return T === void 0 && (T = c.maximum), T !== H.value || this._localChange || c.maximum !== this.props.maximum || c.minimum !== this.props.minimum ? (H.value = T, this._localChange = !1, !0) : c.unit !== this.props.unit;
              }
              onChange(c) {
                if (c === "—")
                  return;
                this._localChange = !0;
                let H = parseFloat(c);
                this.props.useEuler && (H = u.Tools.ToRadians(H)), this.props.target && (this.props.onPropertyChangedObservable && this.props.onPropertyChangedObservable.notifyObservers({
                  object: this.props.target,
                  property: this.props.propertyName,
                  value: H,
                  initialValue: this.state.value
                }), this.props.target[this.props.propertyName] = H), this.props.onChange && this.props.onChange(H), this.setState({ value: H });
              }
              onInput(c) {
                const H = parseFloat(c);
                this.props.onInput && this.props.onInput(H);
              }
              prepareDataToRead(c) {
                return c === null && (c = 0), this.props.useEuler ? u.Tools.ToDegrees(c) : c;
              }
              render() {
                return (0, d.jsxs)("div", { className: "sliderLine", children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (!this.props.icon || this.props.label != "") && (0, d.jsx)("div", { className: this.props.margin ? "label withMargins" : "label", title: this.props.label, children: this.props.label }), (0, d.jsx)(l.FloatLineComponent, { lockObject: this.props.lockObject, isInteger: this.props.decimalCount === 0, smallUI: !0, label: "", target: this.state, digits: this.props.decimalCount === void 0 ? 4 : this.props.decimalCount, propertyName: "value", min: this.props.minimum, max: this.props.maximum, onEnter: () => {
                  const c = this.prepareDataToRead(this.state.value);
                  this.onChange(c);
                }, onChange: () => {
                  const c = this.prepareDataToRead(this.state.value);
                  this.onChange(c);
                }, onPropertyChangedObservable: this.props.onPropertyChangedObservable, unit: this.props.unit }), (0, d.jsx)("div", { className: "slider", children: (0, d.jsx)("input", { className: "range", type: "range", step: this.props.step, min: this.prepareDataToRead(this.props.minimum), max: this.prepareDataToRead(this.props.maximum), value: this.prepareDataToRead(this.state.value), onInput: (c) => this.onInput(c.target.value), onChange: (c) => this.onChange(c.target.value) }) })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js": (
          /*!******************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/targetsProxy.js ***!
            \******************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              conflictingValuesPlaceholder: () => (
                /* binding */
                d
              ),
              /* harmony export */
              makeTargetsProxy: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            const d = "—";
            function v(u, l, P = (p, c) => p[c]) {
              return new Proxy({}, {
                get(p, c) {
                  const H = c;
                  if (u.length === 0)
                    return d;
                  const T = P(u[0], H);
                  for (const q of u)
                    if (P(q, H) !== T)
                      return d;
                  return T;
                },
                set(p, c, H) {
                  if (H === "—")
                    return !0;
                  const T = c;
                  for (const q of u) {
                    const b = q[T];
                    q[T] = H, l && l.notifyObservers({
                      object: q,
                      property: c,
                      value: q[T],
                      initialValue: b
                    });
                  }
                  return !0;
                }
              });
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js": (
          /*!****************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js ***!
            \****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TextInputLineComponent: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ./targetsProxy */
              "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js"
            ), l = o(
              /*! ./inputArrowsComponent */
              "../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js"
            );
            let P = -1;
            class p extends v.Component {
              constructor(H) {
                super(H), this._localChange = !1;
                const T = this.props.numeric ? "0" : "";
                this.state = {
                  value: (this.props.value !== void 0 ? this.props.value : this.props.target[this.props.propertyName]) || T,
                  dragging: !1
                };
              }
              componentWillUnmount() {
                this.props.lockObject && (this.props.lockObject.lock = !1);
              }
              shouldComponentUpdate(H, T) {
                if (this._localChange)
                  return this._localChange = !1, !0;
                const q = H.value !== void 0 ? H.value : H.target[H.propertyName];
                return q !== T.value ? (T.value = q || "", !0) : T.dragging != this.state.dragging || H.unit !== this.props.unit;
              }
              raiseOnPropertyChanged(H, T) {
                if (this.props.onChange) {
                  this.props.onChange(H);
                  return;
                }
                this.props.onPropertyChangedObservable && this.props.onPropertyChangedObservable.notifyObservers({
                  object: this.props.target,
                  property: this.props.propertyName,
                  value: H,
                  initialValue: T
                });
              }
              getCurrentNumericValue(H) {
                const T = parseFloat(H);
                if (!isNaN(T))
                  return T;
                if (this.props.placeholder !== void 0) {
                  const q = parseFloat(this.props.placeholder);
                  if (!isNaN(q))
                    return q;
                }
                return 0;
              }
              updateValue(H, T) {
                if (this.props.disabled)
                  return;
                if (this.props.numbersOnly) {
                  if (/[^0-9.\p\x%-]/g.test(H))
                    return;
                  H || (H = "0"), H.search(/0+[0-9-]/g) === 0 && (H = H.substr(1));
                }
                if (this.props.numeric) {
                  let b = this.getCurrentNumericValue(H);
                  this.props.roundValues && (b = Math.round(b)), this.props.min !== void 0 && (b = Math.max(this.props.min, b)), this.props.max !== void 0 && (b = Math.min(this.props.max, b)), H = b.toString();
                }
                this._localChange = !0;
                const q = this.props.value !== void 0 ? this.props.value : this.props.target[this.props.propertyName];
                this.props.validator && T && this.props.validator(T) == !1 && (H = q), this.setState({ value: H }), this.props.propertyName && !this.props.delayInput && (this.props.target[this.props.propertyName] = H), this.props.throttlePropertyChangedNotification ? (P >= 0 && window.clearTimeout(P), P = window.setTimeout(() => {
                  this.raiseOnPropertyChanged(H, q);
                }, this.props.throttlePropertyChangedNotificationDelay ?? 200)) : this.raiseOnPropertyChanged(H, q);
              }
              incrementValue(H) {
                if (this.props.step && (H *= this.props.step), this.props.arrowsIncrement) {
                  this.props.arrowsIncrement(H);
                  return;
                }
                const T = this.getCurrentNumericValue(this.state.value);
                this.updateValue((T + H).toFixed(2));
              }
              onKeyDown(H) {
                !this.props.disabled && this.props.arrows && (H.key === "ArrowUp" && (this.incrementValue(1), H.preventDefault()), H.key === "ArrowDown" && (this.incrementValue(-1), H.preventDefault()));
              }
              render() {
                const H = this.state.value === u.conflictingValuesPlaceholder ? "" : this.state.value, T = this.state.value === u.conflictingValuesPlaceholder ? u.conflictingValuesPlaceholder : this.props.placeholder || "", q = this.props.step || (this.props.roundValues ? 1 : 0.01), b = this.props.multilines ? "textInputArea" : this.props.unit !== void 0 ? "textInputLine withUnits" : "textInputLine";
                return (0, d.jsxs)("div", { className: b, children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, color: "black", className: "icon" }), this.props.label !== void 0 && (0, d.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), this.props.multilines && (0, d.jsx)(d.Fragment, { children: (0, d.jsx)("textarea", { className: this.props.disabled ? "disabled" : "", value: this.state.value, onFocus: () => {
                  this.props.lockObject && (this.props.lockObject.lock = !0);
                }, onChange: (j) => this.updateValue(j.target.value), onKeyDown: (j) => {
                  j.keyCode === 13 && this.updateValue(this.state.value);
                }, onBlur: (j) => {
                  this.updateValue(j.target.value, j.target.value), this.props.lockObject && (this.props.lockObject.lock = !1);
                }, disabled: this.props.disabled }) }), !this.props.multilines && (0, d.jsxs)("div", { className: `value${this.props.noUnderline === !0 ? " noUnderline" : ""}${this.props.arrows ? " hasArrows" : ""}${this.state.dragging ? " dragging" : ""}`, children: [(0, d.jsx)("input", { className: this.props.disabled ? "disabled" : "", value: H, onBlur: (j) => {
                  this.props.lockObject && (this.props.lockObject.lock = !1), this.updateValue((this.props.value !== void 0 ? this.props.value : this.props.target[this.props.propertyName]) || "", j.target.value);
                }, onFocus: () => {
                  this.props.lockObject && (this.props.lockObject.lock = !0);
                }, onChange: (j) => this.updateValue(j.target.value), onKeyDown: (j) => this.onKeyDown(j), placeholder: T, type: this.props.numeric ? "number" : "text", step: q, disabled: this.props.disabled }), this.props.arrows && (0, d.jsx)(l.InputArrowsComponent, { incrementValue: (j) => this.incrementValue(j), setDragging: (j) => this.setState({ dragging: j }) })] }), this.props.unit] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js": (
          /*!***********************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/textLineComponent.js ***!
            \***********************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TextLineComponent: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            class u extends v.Component {
              constructor(P) {
                super(P);
              }
              onLink() {
                if (this.props.url) {
                  window.open(this.props.url, "_blank");
                  return;
                }
                this.props.onLink && this.props.onLink();
              }
              renderContent() {
                return this.props.ignoreValue ? null : this.props.onLink || this.props.url ? (0, d.jsx)("div", { className: "link-value", title: this.props.value, onClick: () => this.onLink(), children: this.props.url ? "doc" : this.props.value || "no name" }) : (0, d.jsx)("div", { className: "value", title: this.props.value, style: { color: this.props.color ? this.props.color : "" }, children: this.props.value || "no name" });
              }
              render() {
                return (0, d.jsxs)("div", { className: this.props.underline ? "textLine underline" : "textLine" + (this.props.additionalClass ? " " + this.props.additionalClass : ""), children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0, d.jsx)("div", { className: "label", title: this.props.tooltip ?? this.props.label ?? "", children: this.props.label ?? "" }), this.renderContent()] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js": (
          /*!**************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Vector2LineComponent: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ./numericInputComponent */
              "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js"
            ), l = o(
              /*! @fortawesome/react-fontawesome */
              "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js"
            ), P = o(
              /*! @fortawesome/free-solid-svg-icons */
              "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs"
            );
            class p extends v.Component {
              constructor(H) {
                super(H), this._localChange = !1, this.state = { isExpanded: !1, value: this.props.target[this.props.propertyName].clone() };
              }
              shouldComponentUpdate(H, T) {
                const q = H.target[H.propertyName];
                return !q.equals(T.value) || this._localChange ? (T.value = q.clone(), this._localChange = !1, !0) : !1;
              }
              switchExpandState() {
                this._localChange = !0, this.setState({ isExpanded: !this.state.isExpanded });
              }
              raiseOnPropertyChanged(H) {
                this.props.onChange && this.props.onChange(this.state.value), this.props.onPropertyChangedObservable && this.props.onPropertyChangedObservable.notifyObservers({
                  object: this.props.target,
                  property: this.props.propertyName,
                  value: this.state.value,
                  initialValue: H
                });
              }
              updateStateX(H) {
                this._localChange = !0;
                const T = this.state.value.clone();
                this.props.target[this.props.propertyName].x = H, this.state.value.x = H, this.setState({ value: this.state.value }), this.raiseOnPropertyChanged(T);
              }
              updateStateY(H) {
                this._localChange = !0;
                const T = this.state.value.clone();
                this.props.target[this.props.propertyName].y = H, this.state.value.y = H, this.setState({ value: this.state.value }), this.raiseOnPropertyChanged(T);
              }
              render() {
                const H = this.state.isExpanded ? (0, d.jsx)(l.FontAwesomeIcon, { icon: P.faMinus }) : (0, d.jsx)(l.FontAwesomeIcon, { icon: P.faPlus });
                return (0, d.jsxs)("div", { className: "vector3Line", children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0, d.jsxs)("div", { className: "firstLine", title: this.props.label, children: [(0, d.jsx)("div", { className: "label", children: this.props.label }), (0, d.jsx)("div", { className: "vector", children: `X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}` }), (0, d.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: H })] }), this.state.isExpanded && (0, d.jsxs)("div", { className: "secondLine", children: [(0, d.jsx)(u.NumericInputComponent, { lockObject: this.props.lockObject, label: "x", step: this.props.step, value: this.state.value.x, onChange: (T) => this.updateStateX(T) }), (0, d.jsx)(u.NumericInputComponent, { lockObject: this.props.lockObject, label: "y", step: this.props.step, value: this.state.value.y, onChange: (T) => this.updateStateY(T) })] })] });
              }
            }
            p.defaultProps = {
              step: 1e-3
              // cm
            };
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js": (
          /*!**************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Vector3LineComponent: () => (
                /* binding */
                H
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Misc/tools */
              "core/Misc/dataStorage"
            ), l = o(
              /*! ../lines/numericInputComponent */
              "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js"
            ), P = o(
              /*! @fortawesome/react-fontawesome */
              "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js"
            ), p = o(
              /*! @fortawesome/free-solid-svg-icons */
              "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs"
            ), c = o(
              /*! ../lines/sliderLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js"
            );
            class H extends v.Component {
              constructor(q) {
                super(q), this._localChange = !1;
                const b = this.getCurrentValue();
                this.state = { isExpanded: !1, value: b ? b.clone() : u.Vector3.Zero() };
              }
              getCurrentValue() {
                return this.props.target[this.props.propertyName];
              }
              shouldComponentUpdate(q, b) {
                const j = q.target[q.propertyName];
                return !j.equals(b.value) || this._localChange ? (b.value = j.clone(), this._localChange = !1, !0) : !1;
              }
              switchExpandState() {
                this._localChange = !0, this.setState({ isExpanded: !this.state.isExpanded });
              }
              raiseOnPropertyChanged(q) {
                this.props.onChange && this.props.onChange(this.state.value), this.props.onPropertyChangedObservable && this.props.onPropertyChangedObservable.notifyObservers({
                  object: this.props.target,
                  property: this.props.propertyName,
                  value: this.state.value,
                  initialValue: q
                });
              }
              updateVector3() {
                const q = this.props.target[this.props.propertyName].clone();
                this.props.target[this.props.propertyName] = this.state.value, this.setState({ value: q }), this.raiseOnPropertyChanged(q);
              }
              updateStateX(q) {
                this._localChange = !0, this.state.value.x = q, this.updateVector3();
              }
              updateStateY(q) {
                this._localChange = !0, this.state.value.y = q, this.updateVector3();
              }
              updateStateZ(q) {
                this._localChange = !0, this.state.value.z = q, this.updateVector3();
              }
              render() {
                const q = this.state.isExpanded ? (0, d.jsx)(P.FontAwesomeIcon, { icon: p.faMinus }) : (0, d.jsx)(P.FontAwesomeIcon, { icon: p.faPlus });
                return (0, d.jsxs)("div", { className: "vector3Line", children: [(0, d.jsxs)("div", { className: "firstLine", children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0, d.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0, d.jsxs)("div", { className: "vector", children: [!this.props.useEuler && `X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}`, this.props.useEuler && `X: ${u.Tools.ToDegrees(this.state.value.x).toFixed(2)}, Y: ${u.Tools.ToDegrees(this.state.value.y).toFixed(2)}, Z: ${u.Tools.ToDegrees(this.state.value.z).toFixed(2)}`] }), (0, d.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: q })] }), this.state.isExpanded && !this.props.useEuler && (0, d.jsxs)("div", { className: "secondLine", children: [(0, d.jsx)(l.NumericInputComponent, { label: "x", lockObject: this.props.lockObject, step: this.props.step, value: this.state.value.x, onChange: (b) => this.updateStateX(b) }), (0, d.jsx)(l.NumericInputComponent, { label: "y", lockObject: this.props.lockObject, step: this.props.step, value: this.state.value.y, onChange: (b) => this.updateStateY(b) }), (0, d.jsx)(l.NumericInputComponent, { label: "z", lockObject: this.props.lockObject, step: this.props.step, value: this.state.value.z, onChange: (b) => this.updateStateZ(b) })] }), this.state.isExpanded && this.props.useEuler && !this.props.noSlider && (0, d.jsxs)("div", { className: "secondLine", children: [(0, d.jsx)(c.SliderLineComponent, { lockObject: this.props.lockObject, margin: !0, label: "x", minimum: 0, maximum: 360, step: 0.1, directValue: u.Tools.ToDegrees(this.state.value.x), onChange: (b) => this.updateStateX(u.Tools.ToRadians(b)) }), (0, d.jsx)(c.SliderLineComponent, { lockObject: this.props.lockObject, margin: !0, label: "y", minimum: 0, maximum: 360, step: 0.1, directValue: u.Tools.ToDegrees(this.state.value.y), onChange: (b) => this.updateStateY(u.Tools.ToRadians(b)) }), (0, d.jsx)(c.SliderLineComponent, { lockObject: this.props.lockObject, margin: !0, label: "z", minimum: 0, maximum: 360, step: 0.1, directValue: u.Tools.ToDegrees(this.state.value.z), onChange: (b) => this.updateStateZ(u.Tools.ToRadians(b)) })] }), this.state.isExpanded && this.props.useEuler && this.props.noSlider && (0, d.jsxs)("div", { className: "secondLine", children: [(0, d.jsx)(l.NumericInputComponent, { lockObject: this.props.lockObject, label: "x", step: this.props.step, value: u.Tools.ToDegrees(this.state.value.x), onChange: (b) => this.updateStateX(u.Tools.ToRadians(b)) }), (0, d.jsx)(l.NumericInputComponent, { lockObject: this.props.lockObject, label: "y", step: this.props.step, value: u.Tools.ToDegrees(this.state.value.y), onChange: (b) => this.updateStateY(u.Tools.ToRadians(b)) }), (0, d.jsx)(l.NumericInputComponent, { lockObject: this.props.lockObject, label: "z", step: this.props.step, value: u.Tools.ToDegrees(this.state.value.z), onChange: (b) => this.updateStateZ(u.Tools.ToRadians(b)) })] })] });
              }
            }
            H.defaultProps = {
              step: 1e-3
              // cm
            };
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/vector4LineComponent.js": (
          /*!**************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/vector4LineComponent.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Vector4LineComponent: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ./numericInputComponent */
              "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js"
            ), l = o(
              /*! @fortawesome/react-fontawesome */
              "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js"
            ), P = o(
              /*! @fortawesome/free-solid-svg-icons */
              "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs"
            );
            class p extends v.Component {
              constructor(H) {
                super(H), this._localChange = !1, this.state = { isExpanded: !1, value: this.getCurrentValue().clone() };
              }
              getCurrentValue() {
                return this.props.value || this.props.target[this.props.propertyName];
              }
              shouldComponentUpdate(H, T) {
                const q = H.value || H.target[H.propertyName];
                return !q.equals(T.value) || this._localChange ? (T.value = q.clone(), this._localChange = !1, !0) : !1;
              }
              switchExpandState() {
                this._localChange = !0, this.setState({ isExpanded: !this.state.isExpanded });
              }
              raiseOnPropertyChanged(H) {
                this.props.onChange && this.props.onChange(this.state.value), this.props.onPropertyChangedObservable && this.props.onPropertyChangedObservable.notifyObservers({
                  object: this.props.target,
                  property: this.props.propertyName || "",
                  value: this.state.value,
                  initialValue: H
                });
              }
              updateVector4() {
                const H = this.getCurrentValue().clone();
                this.props.value ? this.props.value.copyFrom(this.state.value) : this.props.target[this.props.propertyName] = this.state.value, this.setState({ value: H }), this.raiseOnPropertyChanged(H);
              }
              updateStateX(H) {
                this._localChange = !0, this.state.value.x = H, this.updateVector4();
              }
              updateStateY(H) {
                this._localChange = !0, this.state.value.y = H, this.updateVector4();
              }
              updateStateZ(H) {
                this._localChange = !0, this.state.value.z = H, this.updateVector4();
              }
              updateStateW(H) {
                this._localChange = !0, this.state.value.w = H, this.updateVector4();
              }
              render() {
                const H = this.state.isExpanded ? (0, d.jsx)(l.FontAwesomeIcon, { icon: P.faMinus }) : (0, d.jsx)(l.FontAwesomeIcon, { icon: P.faPlus });
                return (0, d.jsxs)("div", { className: "vector3Line", children: [(0, d.jsxs)("div", { className: "firstLine", children: [this.props.icon && (0, d.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0, d.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0, d.jsx)("div", { className: "vector", children: `X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}, W: ${this.state.value.w.toFixed(2)}` }), (0, d.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: H })] }), (0, d.jsxs)("div", { className: "secondLine", children: [(0, d.jsx)(u.NumericInputComponent, { lockObject: this.props.lockObject, label: "x", step: this.props.step, value: this.state.value.x, onChange: (T) => this.updateStateX(T) }), (0, d.jsx)(u.NumericInputComponent, { lockObject: this.props.lockObject, label: "y", step: this.props.step, value: this.state.value.y, onChange: (T) => this.updateStateY(T) }), (0, d.jsx)(u.NumericInputComponent, { lockObject: this.props.lockObject, label: "z", step: this.props.step, value: this.state.value.z, onChange: (T) => this.updateStateZ(T) }), (0, d.jsx)(u.NumericInputComponent, { lockObject: this.props.lockObject, label: "w", step: this.props.step, value: this.state.value.w, onChange: (T) => this.updateStateW(T) })] })] });
              }
            }
            p.defaultProps = {
              step: 1e-3
              // cm
            };
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/displayLedger.js": (
          /*!*****************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/displayLedger.js ***!
            \*****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              DisplayLedger: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            class d {
            }
            d.RegisteredControls = {};
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/frameNodePort.js": (
          /*!*****************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/frameNodePort.js ***!
            \*****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              FrameNodePort: () => (
                /* binding */
                P
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Misc/observable */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ./nodePort */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.js"
            ), u = o(
              /*! ./tools */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/tools.js"
            ), l = o(
              /*! ./common.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss"
            );
            class P extends v.NodePort {
              get parentFrameId() {
                return this._parentFrameId;
              }
              get onFramePortPositionChangedObservable() {
                return this._onFramePortPositionChangedObservable;
              }
              get isInput() {
                return this._isInput;
              }
              get framePortId() {
                return this._framePortId;
              }
              get framePortPosition() {
                return this._framePortPosition;
              }
              set framePortPosition(c) {
                this._framePortPosition = c, this.onFramePortPositionChangedObservable.notifyObservers(this);
              }
              constructor(c, H, T, q, b, j, w) {
                super(c, H, T, q), this.portData = H, this.node = T, this._onFramePortPositionChangedObservable = new d.Observable(), this._parentFrameId = w, this._isInput = b, this._framePortId = j, this._onSelectionChangedObserver = q.onSelectionChangedObservable.add((m) => {
                  const { selection: I } = m || {};
                  (0, u.IsFramePortData)(I) && I.port === this ? this._img.classList.add(l.default.selected) : this._img.classList.remove(l.default.selected);
                }), this.refresh();
              }
              static CreateFrameNodePortElement(c, H, T, q, b, j, w, m) {
                const I = T.ownerDocument.createElement("div");
                if (I.classList.add(l.default.portLine), w !== null && (I.dataset.framePortId = `${w}`), T.appendChild(I), !q || q.shouldDisplayPortLabels(c)) {
                  const N = T.ownerDocument.createElement("div");
                  N.classList.add(l.default["port-label"]), N.innerHTML = c.name, I.appendChild(N);
                }
                return new P(I, c, H, b, j, w, m);
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphCanvas.js": (
          /*!***************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphCanvas.js ***!
            \***************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              GraphCanvasComponent: () => (
                /* binding */
                N
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ./graphNode */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.js"
            ), l = o(
              /*! dagre */
              "../../../../node_modules/dagre/index.js"
            ), P = o(
              /*! ./nodeLink */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLink.js"
            ), p = o(
              /*! ./nodePort */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.js"
            ), c = o(
              /*! core/Misc/dataStorage */
              "core/Misc/dataStorage"
            ), H = o(
              /*! ./graphFrame */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.js"
            ), T = o(
              /*! ./frameNodePort */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/frameNodePort.js"
            ), q = o(
              /*! ./interfaces/portData */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/interfaces/portData.js"
            ), b = o(
              /*! ./graphCanvas.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphCanvas.modules.scss"
            ), j = o(
              /*! ./common.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss"
            ), w = o(
              /*! ./typeLedger */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/typeLedger.js"
            ), m = o(
              /*! ./tools */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/tools.js"
            ), I = o(
              /*! ./searchBox */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/searchBox.js"
            );
            class N extends v.Component {
              get gridSize() {
                return this._gridSize;
              }
              set gridSize(R) {
                this._gridSize = R, this.updateTransform();
              }
              get stateManager() {
                return this.props.stateManager;
              }
              get nodes() {
                return this._nodes;
              }
              get links() {
                return this._links;
              }
              get frames() {
                return this._frames;
              }
              get zoom() {
                return this._zoom;
              }
              set zoom(R) {
                this._zoom !== R && (this._zoom = R, this.updateTransform());
              }
              get x() {
                return this._x;
              }
              set x(R) {
                this._x = R, this.updateTransform();
              }
              get y() {
                return this._y;
              }
              set y(R) {
                this._y = R, this.updateTransform();
              }
              get selectedNodes() {
                return this._selectedNodes;
              }
              get selectedLink() {
                return this._selectedLink;
              }
              get selectedFrames() {
                return this._selectedFrames;
              }
              get selectedPort() {
                return this._selectedPort;
              }
              get canvasContainer() {
                return this._graphCanvas;
              }
              get hostCanvas() {
                return this._hostCanvas;
              }
              get svgCanvas() {
                return this._svgCanvas;
              }
              get selectionContainer() {
                return this._selectionContainer;
              }
              get frameContainer() {
                return this._frameContainer;
              }
              // There is a selection conflict between nodes and frames if any selected node is inside any selected frame
              _selectedFrameAndNodesConflict(R, y) {
                for (const O of R)
                  for (const Y of y)
                    if (O.nodes.includes(Y))
                      return !0;
                return !1;
              }
              constructor(R) {
                super(R), this._minZoom = 0.1, this._maxZoom = 4, this._hostCanvasRef = v.createRef(), this._graphCanvasRef = v.createRef(), this._selectionContainerRef = v.createRef(), this._frameContainerRef = v.createRef(), this._svgCanvasRef = v.createRef(), this._rootContainerRef = v.createRef(), this._nodes = [], this._links = [], this._mouseStartPointX = null, this._mouseStartPointY = null, this._dropPointX = 0, this._dropPointY = 0, this._selectionStartX = 0, this._selectionStartY = 0, this._candidateLinkedHasMoved = !1, this._x = 0, this._y = 0, this._zoom = 1, this._selectedNodes = [], this._selectedLink = null, this._selectedPort = null, this._candidateLink = null, this._candidatePort = null, this._gridSize = 20, this._selectionBox = null, this._selectedFrames = [], this._frameCandidate = null, this._frames = [], this._nodeDataContentList = new Array(), this._altKeyIsPressed = !1, this._multiKeyIsPressed = !1, this._oldY = -1, this._frameIsMoving = !1, this._isLoading = !1, this._targetLinkCandidate = null, this._copiedNodes = [], this._copiedFrames = [], R.stateManager.onSelectionChangedObservable.add((y) => {
                  const { selection: O, forceKeepSelection: Y, marqueeSelection: ee = !1 } = y || {};
                  if (!O)
                    this._selectedNodes = [], this._selectedLink = null, this._selectedFrames = [], this._selectedPort = null;
                  else if (O instanceof P.NodeLink)
                    this._selectedNodes = [], this._selectedFrames = [], this._selectedLink = O, this._selectedPort = null;
                  else if (O instanceof p.NodePort)
                    this._selectedNodes = [], this._selectedFrames = [], this._selectedLink = null, this._selectedPort = O;
                  else if (O instanceof T.FrameNodePort)
                    this._selectedNodes = [], this._selectedFrames = [], this._selectedLink = null, this._selectedPort = O;
                  else if (O instanceof u.GraphNode || O instanceof H.GraphFrame)
                    if (ee) {
                      if (O instanceof H.GraphFrame && !this._selectedFrames.includes(O) ? this._selectedFrames.push(O) : O instanceof u.GraphNode && !this._selectedNodes.includes(O) && this._selectedNodes.push(O), this._selectedFrameAndNodesConflict(this.selectedFrames, this.selectedNodes)) {
                        const Z = /* @__PURE__ */ new Set();
                        for (const te of this._selectedNodes)
                          for (const fe of this._selectedFrames)
                            fe.nodes.includes(te) && Z.add(fe);
                        this._selectedFrames = this._selectedFrames.filter((te) => !Z.has(te));
                      }
                    } else
                      O instanceof H.GraphFrame ? this._multiKeyIsPressed || Y ? !this._selectedFrameAndNodesConflict([O], this._selectedNodes) && !this._selectedFrames.includes(O) && this._selectedFrames.push(O) : (this._selectedFrames = [O], this._selectedNodes = [], this._selectedLink = null, this._selectedPort = null) : O instanceof u.GraphNode && (this._multiKeyIsPressed || Y ? !this._selectedFrameAndNodesConflict(this._selectedFrames, [O]) && !this._selectedNodes.includes(O) && this._selectedNodes.push(O) : (this._selectedFrames = [], this._selectedNodes = [O], this._selectedLink = null, this._selectedPort = null));
                }), R.stateManager.onCandidatePortSelectedObservable.add((y) => {
                  this._candidatePort = y;
                }), R.stateManager.onGridSizeChanged.add(() => {
                  this.gridSize = c.DataStorage.ReadNumber("GridSize", 20);
                }), this.props.stateManager.hostDocument.addEventListener("keyup", () => this.onKeyUp(), !1), this.props.stateManager.hostDocument.addEventListener("keydown", (y) => {
                  this._altKeyIsPressed = y.altKey, this._multiKeyIsPressed = y.ctrlKey || y.metaKey;
                }, !1), this.props.stateManager.hostDocument.defaultView.addEventListener("blur", () => {
                  this._altKeyIsPressed = !1, this._multiKeyIsPressed = !1;
                }, !1), this.props.stateManager.storeEditorData = (y, O) => {
                  if (y.frames = [], O)
                    y.frames.push(O.serialize(!1));
                  else {
                    y.x = this.x, y.y = this.y, y.zoom = this.zoom;
                    for (const Y of this._frames)
                      y.frames.push(Y.serialize(!0));
                  }
                };
              }
              populateConnectedEntriesBeforeRemoval(R, y, O, Y) {
                O.push(...R.content.inputs.filter((ee) => ee.isConnected && y.every((Z) => {
                  var te;
                  return Z.content.data !== ((te = ee.connectedPort) == null ? void 0 : te.ownerData);
                })).map((ee) => ee.connectedPort)), Y.push(...R.content.outputs.filter((ee) => ee.isConnected).map((ee) => ee.endpoints).flat().filter((ee) => ee && y.every((Z) => Z.content.data !== ee.ownerData)));
              }
              automaticRewire(R, y, O = !1) {
                let Y = !1;
                y.length && R.length && R.forEach((ee) => {
                  if (Y || !ee)
                    return;
                  const Z = y[0];
                  if (Z && ee.canConnectTo(Z)) {
                    const te = this.findNodeFromData(ee.ownerData), fe = this.findNodeFromData(Z.ownerData);
                    if (this.connectNodes(te, ee, fe, Z), y.shift(), O) {
                      Y = !0;
                      return;
                    }
                  }
                });
              }
              smartAddOverLink(R, y) {
                const O = [], Y = [], ee = [], Z = [], te = y.nodeA, fe = y.nodeB;
                y.dispose(), ee.push(...R.content.inputs.filter((_) => !_.isConnected)), Z.push(...R.content.outputs), O.push(...te.content.outputs), Y.push(...fe.content.inputs.filter((_) => !_.isConnected)), this.automaticRewire(O, ee, !0), this.automaticRewire(Z, Y, !0), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
              }
              smartAddOverNode(R, y) {
                const O = [], Y = [];
                Y.push(...R.content.inputs.filter((ee) => !ee.isConnected)), O.push(...y.content.outputs), this.automaticRewire(O, Y, !0), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
              }
              deleteSelection(R, y = !1) {
                const O = this.selectedNodes, Y = [], ee = [];
                let Z = !1;
                if (O.length > 0) {
                  Z = !0;
                  for (const te of O)
                    y && this.populateConnectedEntriesBeforeRemoval(te, O, Y, ee), te.dispose(), R(te.content), this.removeDataFromCache(te.content.data);
                }
                if (this.selectedLink && (Z = !0, this.selectedLink.dispose()), this.selectedFrames.length) {
                  Z = !0;
                  for (const te of this.selectedFrames) {
                    if (te.isCollapsed) {
                      for (; te.nodes.length > 0; )
                        R(te.nodes[0].content), this.removeDataFromCache(te.nodes[0].content.data), te.nodes[0].dispose();
                      te.isCollapsed = !1;
                    } else
                      te.nodes.forEach((fe) => {
                        fe.enclosingFrameId = -1;
                      });
                    te.dispose();
                  }
                }
                Z && (this.automaticRewire(Y, ee), this.props.stateManager.onSelectionChangedObservable.notifyObservers(null), this.props.stateManager.onRebuildRequiredObservable.notifyObservers());
              }
              handleKeyDown(R, y, O, Y, ee, Z) {
                if (!this.stateManager.modalIsDisplayed) {
                  if (R.code === "Space" && R.target === this.props.stateManager.hostDocument.body) {
                    this.stateManager.modalIsDisplayed = !0, this.props.stateManager.onSearchBoxRequiredObservable.notifyObservers({ x: O, y: Y });
                    return;
                  }
                  if ((R.keyCode === 46 || R.keyCode === 8) && !this.props.stateManager.lockObject.lock) {
                    this.deleteSelection(y, R.altKey);
                    return;
                  }
                  if (!(!R.ctrlKey && !R.metaKey || this.props.stateManager.lockObject.lock)) {
                    if (R.key === "c" || R.key === "C") {
                      if (this._copiedNodes = [], this._copiedFrames = [], this.selectedFrames.length) {
                        for (const _ of this.selectedFrames)
                          _.serialize(!0), this._copiedFrames.push(_);
                        return;
                      }
                      const te = this.selectedNodes;
                      if (!te.length || !te[0].content.data)
                        return;
                      this._copiedNodes = te.slice(0);
                    } else if (R.key === "v" || R.key === "V") {
                      const te = this.zoom;
                      let fe = (Y - Z.offsetTop - this.y - 20) / te;
                      if (this._copiedFrames.length)
                        for (const G of this._copiedFrames) {
                          const L = new H.GraphFrame(null, this, !0);
                          this.frames.push(L), L.width = G.width, L.height = G.height, L.width / 2, L.name = G.name, L.color = G.color;
                          let $ = (O - Z.offsetLeft - this.x) / te;
                          if (L.x = $ - L.width / 2, L.y = fe, G.nodes.length) {
                            $ = L.x + G.nodes[0].x - G.x, fe = L.y + G.nodes[0].y - G.y, this._frameIsMoving = !0;
                            const ae = this.pasteSelection(G.nodes, $, fe, ee);
                            if (ae)
                              for (const Pe of ae)
                                L.syncNode(Pe);
                            this._frameIsMoving = !1;
                          }
                          L.adjustPorts(), G.isCollapsed && (L.isCollapsed = !0), this.props.stateManager.onSelectionChangedObservable.notifyObservers({ selection: L, forceKeepSelection: !0 });
                          return;
                        }
                      if (!this._copiedNodes.length)
                        return;
                      const _ = (O - Z.offsetLeft - this.x - N.NodeWidth) / te;
                      this.pasteSelection(this._copiedNodes, _, fe, ee, !0);
                    }
                  }
                }
              }
              pasteSelection(R, y, O, Y, ee = !1) {
                let Z = null;
                const te = [];
                R = R.slice(), this.props.stateManager.onSelectionChangedObservable.notifyObservers(null);
                for (const _ of R) {
                  if (!_.content.data)
                    continue;
                  const L = Y(_.content);
                  let $ = 0, ae = 0;
                  Z ? ($ = y + _.x - Z.x, ae = O + _.y - Z.y) : (Z = _, $ = y, ae = O), L.x = $, L.y = ae, L.cleanAccumulation(), te.push(L), ee && this.props.stateManager.onSelectionChangedObservable.notifyObservers({ selection: L, forceKeepSelection: !0 });
                }
                const fe = new Array(te.length);
                for (let _ = 0; _ < te.length; _++)
                  this.reconnectNewNodes(_, te, R, fe);
                return te;
              }
              reconnectNewNodes(R, y, O, Y) {
                if (Y[R])
                  return;
                const ee = y[R], Z = O[R];
                for (let te = 0; te < Z.content.inputs.length; te++) {
                  const fe = Z.content.inputs[te], _ = ee.content.inputs[te];
                  if (!fe.isConnected)
                    continue;
                  const G = this.findNodeFromData(fe.connectedPort.ownerData).content, L = O.filter(($) => $.content === G);
                  if (L.length > 0) {
                    const $ = L[0], ae = O.indexOf($);
                    this.reconnectNewNodes(ae, y, O, Y);
                    const Pe = G.outputs.indexOf(fe.connectedPort);
                    y[ae].content.data.outputs[Pe].connectTo(_.data);
                  } else
                    fe.connectedPort.connectTo(_);
                  this.connectPorts(_.connectedPort, _);
                }
                ee.refresh(), Y[R] = !0;
              }
              getCachedData() {
                return this._nodeDataContentList;
              }
              removeDataFromCache(R) {
                const y = this._nodeDataContentList.indexOf(R);
                y > -1 && this._nodeDataContentList.splice(y, 1);
              }
              createNodeFromObject(R, y, O = !0) {
                if (this._nodeDataContentList.indexOf(R.data) !== -1) {
                  if (R.inputs.length && O)
                    for (const ee of R.inputs)
                      ee.isConnected && this.connectPorts(ee.connectedPort, ee);
                  return this.nodes.filter((ee) => ee.content.data === R.data)[0];
                }
                if (y(R.data), R.inputs.length)
                  for (const ee of R.inputs)
                    ee.connectedPort && O && this.createNodeFromObject(w.TypeLedger.NodeDataBuilder(ee.connectedPort.ownerData, this), y);
                const Y = this.appendNode(R);
                if (R.inputs.length && O)
                  for (const ee of R.inputs)
                    ee.isConnected && this.connectPorts(ee.connectedPort, ee);
                return Y;
              }
              getGridPosition(R, y = !1) {
                const O = this.gridSize;
                return O === 0 ? R : y ? O * Math.ceil(R / O) : O * Math.floor(R / O);
              }
              getGridPositionCeil(R) {
                const y = this.gridSize;
                return y === 0 ? R : y * Math.ceil(R / y);
              }
              updateTransform() {
                this._rootContainer.style.transform = `translate(${this._x}px, ${this._y}px) scale(${this._zoom})`, c.DataStorage.ReadBoolean("ShowGrid", !0) ? (this._hostCanvas.style.backgroundSize = `${this._gridSize * this._zoom}px ${this._gridSize * this._zoom}px`, this._hostCanvas.style.backgroundPosition = `${this._x}px ${this._y}px`) : this._hostCanvas.style.backgroundSize = "0";
              }
              onKeyUp() {
                this._altKeyIsPressed = !1, this._multiKeyIsPressed = !1, this._oldY = -1;
              }
              findNodeFromData(R) {
                return this.nodes.filter((y) => y.content.data === R)[0];
              }
              reset() {
                this._nodeDataContentList = [];
                for (const y of this._nodes)
                  y.dispose();
                const R = this._frames.splice(0);
                for (const y of R)
                  y.dispose();
                this._nodes = [], this._frames = [], this._links = [], this._graphCanvas.innerHTML = "", this._svgCanvas.innerHTML = "";
              }
              connectPorts(R, y) {
                if (!R || !y)
                  return;
                const O = R.ownerData, Y = y.ownerData, ee = this.findNodeFromData(O), Z = this.findNodeFromData(Y);
                if (!ee || !Z)
                  return;
                const te = ee.getPortForPortData(R), fe = Z.getPortForPortData(y);
                if (!te || !fe)
                  return;
                for (const G of this._links)
                  if (G.portA === te && G.portB === fe || G.portA === fe && G.portB === te)
                    return;
                const _ = new P.NodeLink(this, te, ee, fe, Z);
                this._links.push(_), ee.links.push(_), Z.links.push(_);
              }
              removeLink(R) {
                const y = this._links.indexOf(R);
                y > -1 && this._links.splice(y, 1), R.dispose();
              }
              appendNode(R) {
                const y = new u.GraphNode(R, this.props.stateManager);
                return y.appendVisual(this._graphCanvas, this), y.addClassToVisual(R.getClassName()), this._nodes.push(y), this._nodeDataContentList.push(R.data), y;
              }
              distributeGraph() {
                this.x = 0, this.y = 0, this.zoom = 1;
                const R = new l.graphlib.Graph();
                R.setGraph({}), R.setDefaultEdgeLabel(() => ({})), R.graph().rankdir = "LR", this._nodes.forEach((O) => {
                  this._frames.some((Y) => Y.nodes.indexOf(O) !== -1) || R.setNode(O.id.toString(), {
                    id: O.id,
                    type: "node",
                    width: O.width,
                    height: O.height
                  });
                }), this._frames.forEach((O) => {
                  R.setNode(O.id.toString(), {
                    id: O.id,
                    type: "frame",
                    width: O.element.clientWidth,
                    height: O.element.clientHeight
                  });
                }), this._nodes.forEach((O) => {
                  O.content.outputs.forEach((Y) => {
                    Y.hasEndpoints && Y.endpoints.forEach((ee) => {
                      const Z = this._frames.filter((G) => G.nodes.indexOf(O) !== -1), te = this._frames.filter((G) => G.nodes.some((L) => L.content.data === ee.ownerData)), fe = Z.length > 0 ? Z[0].id : O.id, _ = te.length > 0 ? te[0].id : ee.ownerData.uniqueId;
                      R.setEdge(fe.toString(), _.toString());
                    });
                  });
                }), l.layout(R), R.nodes().map((O) => R.node(O)).forEach((O) => {
                  if (O) {
                    if (O.type === "node") {
                      for (const Y of this._nodes)
                        if (Y.id === O.id) {
                          Y.x = O.x - O.width / 2, Y.y = O.y - O.height / 2, Y.cleanAccumulation();
                          return;
                        }
                      return;
                    }
                    for (const Y of this._frames)
                      if (Y.id === O.id) {
                        this._frameIsMoving = !0, Y.move(O.x - O.width / 2, O.y - O.height / 2, !1), Y.cleanAccumulation(), this._frameIsMoving = !1;
                        return;
                      }
                  }
                });
              }
              componentDidMount() {
                this._hostCanvas = this._hostCanvasRef.current, this._rootContainer = this._rootContainerRef.current, this._graphCanvas = this._graphCanvasRef.current, this._svgCanvas = this._svgCanvasRef.current, this._selectionContainer = this._selectionContainerRef.current, this._frameContainer = this._frameContainerRef.current, this.gridSize = c.DataStorage.ReadNumber("GridSize", 20), this.updateTransform();
              }
              onMove(R) {
                if (!this.stateManager.modalIsDisplayed) {
                  if (this._selectionBox) {
                    const y = this.canvasContainer.getBoundingClientRect(), O = R.pageX - y.left, Y = R.pageY - y.top;
                    O > this._selectionStartX ? (this._selectionBox.style.left = `${this._selectionStartX / this.zoom}px`, this._selectionBox.style.width = `${(O - this._selectionStartX) / this.zoom}px`) : (this._selectionBox.style.left = `${O / this.zoom}px`, this._selectionBox.style.width = `${(this._selectionStartX - O) / this.zoom}px`), Y > this._selectionStartY ? (this._selectionBox.style.top = `${this._selectionStartY / this.zoom}px`, this._selectionBox.style.height = `${(Y - this._selectionStartY) / this.zoom}px`) : (this._selectionBox.style.top = `${Y / this.zoom}px`, this._selectionBox.style.height = `${(this._selectionStartY - Y) / this.zoom}px`), this.props.stateManager.onSelectionBoxMoved.notifyObservers(this._selectionBox.getBoundingClientRect());
                    return;
                  }
                  if (this._frameCandidate) {
                    const y = this.canvasContainer.getBoundingClientRect(), O = R.pageX - y.left, Y = R.pageY - y.top;
                    O > this._selectionStartX ? (this._frameCandidate.style.left = `${this._selectionStartX / this.zoom}px`, this._frameCandidate.style.width = `${(O - this._selectionStartX) / this.zoom}px`) : (this._frameCandidate.style.left = `${O / this.zoom}px`, this._frameCandidate.style.width = `${(this._selectionStartX - O) / this.zoom}px`), Y > this._selectionStartY ? (this._frameCandidate.style.top = `${this._selectionStartY / this.zoom}px`, this._frameCandidate.style.height = `${(Y - this._selectionStartY) / this.zoom}px`) : (this._frameCandidate.style.top = `${Y / this.zoom}px`, this._frameCandidate.style.height = `${(this._selectionStartY - Y) / this.zoom}px`);
                    return;
                  }
                  if (this._candidateLink) {
                    const y = this.canvasContainer.getBoundingClientRect();
                    this._candidatePort = null, this.props.stateManager.onCandidateLinkMoved.notifyObservers(new c.Vector2(R.pageX, R.pageY)), this._dropPointX = (R.pageX - y.left) / this.zoom, this._dropPointY = (R.pageY - y.top) / this.zoom, this._candidateLink.update(this._dropPointX, this._dropPointY, !0), this._candidateLinkedHasMoved = !0;
                    return;
                  }
                  if (this._altKeyIsPressed && R.buttons === 1) {
                    this._oldY < 0 && (this._oldY = R.pageY);
                    const y = (R.pageY - this._oldY) / 10;
                    if (Math.abs(y) > 5) {
                      const O = this.zoom;
                      this.zoom = Math.max(Math.min(this._maxZoom, this.zoom + y / 100), this._minZoom);
                      const Y = R.currentTarget.getBoundingClientRect(), ee = Y.width, Z = ee * this.zoom - ee * O, fe = (R.clientX - Y.left - this.x) / O / ee;
                      this.x = this.x - Z * fe, this._oldY = R.pageY;
                    }
                    return;
                  }
                  this._rootContainer.style.cursor = "move", !(this._mouseStartPointX === null || this._mouseStartPointY === null) && (this.x += R.clientX - this._mouseStartPointX, this.y += R.clientY - this._mouseStartPointY, this._mouseStartPointX = R.clientX, this._mouseStartPointY = R.clientY);
                }
              }
              onDown(R) {
                if (!this.stateManager.modalIsDisplayed) {
                  if (this._rootContainer.setPointerCapture(R.pointerId), R.nativeEvent.srcElement && R.nativeEvent.srcElement.nodeName === "IMG") {
                    if (!this._candidateLink) {
                      const y = R.nativeEvent.srcElement.parentElement.port;
                      if (this._altKeyIsPressed && (y.portData.isConnected || y.portData.hasEndpoints)) {
                        const O = y.node, Y = O.getLinksForPortData(y.portData);
                        Y.forEach((te) => {
                          te.dispose(!1);
                        });
                        const ee = Y[0].nodeA === O ? Y[0].nodeB : Y[0].nodeA, Z = Y[0].nodeA === O ? Y[0].portB : Y[0].portA;
                        this._candidateLink = new P.NodeLink(this, Z, ee);
                      } else if (this._multiKeyIsPressed && (y.portData.isConnected || y.portData.hasEndpoints)) {
                        const O = y.node, Y = O.getLinksForPortData(y.portData), ee = this._selectedLink || Y[0], Z = ee.nodeA === O ? ee.nodeB : ee.nodeA, te = ee.nodeA === O ? ee.portB : ee.portA;
                        this._candidateLink = new P.NodeLink(this, te, Z);
                      } else
                        this._candidateLink = new P.NodeLink(this, y, y.node);
                      this._candidateLinkedHasMoved = !1;
                    }
                    return;
                  }
                  if (R.currentTarget === this._hostCanvas && this._multiKeyIsPressed) {
                    this._selectionBox = this.props.stateManager.hostDocument.createElement("div"), this._selectionBox.classList.add(b.default["selection-box"]), this._selectionContainer.appendChild(this._selectionBox);
                    const y = this.canvasContainer.getBoundingClientRect();
                    this._selectionStartX = R.pageX - y.left, this._selectionStartY = R.pageY - y.top, this._selectionBox.style.left = `${this._selectionStartX / this.zoom}px`, this._selectionBox.style.top = `${this._selectionStartY / this.zoom}px`, this._selectionBox.style.width = "0px", this._selectionBox.style.height = "0px";
                    return;
                  }
                  if (R.currentTarget === this._hostCanvas && R.shiftKey) {
                    this._frameCandidate = this.props.stateManager.hostDocument.createElement("div"), this._frameCandidate.classList.add(j.default["frame-box"]), this._frameContainer.appendChild(this._frameCandidate);
                    const y = this.canvasContainer.getBoundingClientRect();
                    this._selectionStartX = R.pageX - y.left, this._selectionStartY = R.pageY - y.top, this._frameCandidate.style.left = `${this._selectionStartX / this.zoom}px`, this._frameCandidate.style.top = `${this._selectionStartY / this.zoom}px`, this._frameCandidate.style.width = "0px", this._frameCandidate.style.height = "0px";
                    return;
                  }
                  this.props.stateManager.onSelectionChangedObservable.notifyObservers(null), this._mouseStartPointX = R.clientX, this._mouseStartPointY = R.clientY;
                }
              }
              onUp(R) {
                if (!this.stateManager.modalIsDisplayed) {
                  if (this._mouseStartPointX = null, this._mouseStartPointY = null, this._rootContainer.releasePointerCapture(R.pointerId), this._oldY = -1, this._candidateLink) {
                    if (this._candidateLinkedHasMoved)
                      this.processCandidatePort(), this.props.stateManager.onCandidateLinkMoved.notifyObservers(null);
                    else if (this._candidateLink.portA instanceof T.FrameNodePort) {
                      const y = this._candidateLink.portA, O = this.frames.find((Y) => Y.id === y.parentFrameId);
                      if (O) {
                        const Y = {
                          frame: O,
                          port: y
                        };
                        this.props.stateManager.onSelectionChangedObservable.notifyObservers({ selection: Y });
                      }
                    } else
                      this._candidateLink.portA instanceof p.NodePort && this.props.stateManager.onSelectionChangedObservable.notifyObservers({ selection: this._candidateLink.portA });
                    this._candidateLink.dispose(), this._candidateLink = null, this._candidatePort = null;
                  }
                  if (this._selectionBox && (this._selectionBox.parentElement.removeChild(this._selectionBox), this._selectionBox = null), this._frameCandidate) {
                    const y = new H.GraphFrame(this._frameCandidate, this);
                    this._frames.push(y), this._frameCandidate.parentElement.removeChild(this._frameCandidate), this._frameCandidate = null, this.props.stateManager.onSelectionChangedObservable.notifyObservers({ selection: y });
                  }
                }
              }
              onWheel(R) {
                if (this.stateManager.modalIsDisplayed)
                  return;
                const y = R.deltaY < 0 ? 0.1 : -0.1, O = this.zoom;
                this.zoom = Math.min(Math.max(this._minZoom, this.zoom + y * this.zoom), this._maxZoom);
                const Y = R.currentTarget.getBoundingClientRect(), ee = Y.width, Z = Y.height, te = ee * this.zoom - ee * O, fe = Z * this.zoom - Z * O, _ = R.clientX - Y.left, G = R.clientY - Y.top, L = (_ - this.x) / O / ee, $ = (G - this.y) / O / Z;
                this.x = this.x - te * L, this.y = this.y - fe * $;
              }
              zoomToFit() {
                let R = 0, y = 0;
                this._nodes.forEach((Z) => {
                  this._frames.some((te) => te.nodes.indexOf(Z) !== -1) || (Z.x < R && (R = Z.x), Z.y < y && (y = Z.y));
                }), this._frames.forEach((Z) => {
                  Z.x < R && (R = Z.x), Z.y < y && (y = Z.y);
                }), this._frames.forEach((Z) => {
                  Z.x += -R, Z.y += -y, Z.cleanAccumulation();
                }), this._nodes.forEach((Z) => {
                  Z.x += -R, Z.y += -y, Z.cleanAccumulation();
                });
                const O = this._rootContainer.clientWidth / this._rootContainer.scrollWidth, Y = this._rootContainer.clientHeight / this._rootContainer.scrollHeight, ee = O < Y ? O : Y;
                this.zoom = ee, this.x = 0, this.y = 0;
              }
              processCandidatePort() {
                let R = this._candidateLink.portA.portData, y = this._candidateLink.portA.node, O, Y;
                if (this._candidatePort)
                  O = this._candidatePort.portData, Y = this._candidatePort.node;
                else {
                  if (R.direction === q.PortDataDirection.Output)
                    return;
                  const fe = this.props.stateManager.createDefaultInputData(this.props.stateManager.data, this._candidateLink.portA.portData, this);
                  if (!fe)
                    return;
                  const _ = fe.name, G = fe.data;
                  if (O = G.getPortByName(_), !O) {
                    for (let ae = 0; ae < G.outputs.length; ae++) {
                      const Pe = G.outputs[ae];
                      if (Pe.data._blockType === R.data._blockType) {
                        O = Pe;
                        break;
                      }
                    }
                    if (!O)
                      return;
                  }
                  G.isInput ? Y = this.appendNode(G) : Y = this.props.onEmitNewNode(G), Y.x = this._dropPointX - 200, Y.y = this._dropPointY - 50;
                  const L = Y.x - 250;
                  let $ = Y.y;
                  G.inputs.forEach((ae) => {
                    if (ae.connectedPort) {
                      const ge = this.nodes.filter((me) => {
                        var Xe;
                        return me.content.data === ((Xe = ae.connectedPort) == null ? void 0 : Xe.ownerData);
                      })[0];
                      ge.x === 0 && ge.y === 0 && (ge.x = L, ge.y = $, ge.cleanAccumulation(), $ += 80);
                    }
                  });
                }
                if (O.direction === q.PortDataDirection.Input) {
                  const fe = R;
                  R = O, O = fe;
                  const _ = Y;
                  Y = y, y = _;
                }
                if (R.connectedPort === O || R === O || R.direction === O.direction || R.ownerData === O.ownerData)
                  return;
                let ee = O.checkCompatibilityState(R);
                (O.needDualDirectionValidation || R.needDualDirectionValidation) && !ee && (ee = R.checkCompatibilityState(O));
                const Z = O.getCompatibilityIssueMessage(ee, y, R);
                if (Z) {
                  this.props.stateManager.onErrorMessageDialogRequiredObservable.notifyObservers(Z);
                  return;
                }
                let te = null;
                if (R.isConnected) {
                  const fe = y.getLinksForPortData(R);
                  te = fe.slice(), fe.forEach((_) => {
                    _.dispose(!1);
                  });
                }
                R.ownerData.inputsAreExclusive && R.ownerData.inputs.forEach((fe) => {
                  const _ = y.getLinksForPortData(fe);
                  te ? te.push(..._.slice()) : te = _.slice(), _.forEach((G) => {
                    G.dispose(!1);
                  });
                }), this.connectNodes(Y, O, y, R), te == null || te.forEach((fe) => {
                  fe.onDisposedObservable.notifyObservers(fe), fe.onDisposedObservable.clear();
                }), (!y.content.isConnectedToOutput || y.content.isConnectedToOutput()) && this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
              }
              connectNodes(R, y, O, Y) {
                y.connectTo(Y), this.connectPorts(y, Y);
                const ee = /* @__PURE__ */ new Set([R]), Z = /* @__PURE__ */ new Set([O.links[O.links.length - 1]]);
                (0, m.RefreshNode)(O, ee, Z, this);
              }
              drop(R, y, O, Y, ee) {
                let Z = y - this.x - Y * this.zoom, te = O - this.y - ee * this.zoom;
                R.x = Z / this.zoom, R.y = te / this.zoom, R.cleanAccumulation(), this.props.stateManager.onNewNodeCreatedObservable.notifyObservers(R), this.props.stateManager.onSelectionChangedObservable.notifyObservers(null), this.props.stateManager.onSelectionChangedObservable.notifyObservers({ selection: R }), Z -= N.NodeWidth + 200, R.content.inputs.forEach((fe) => {
                  if (fe.connectedPort) {
                    const G = this.nodes.filter((L) => {
                      var $;
                      return L.content.data === (($ = fe.connectedPort) == null ? void 0 : $.ownerData);
                    })[0];
                    G.x === 0 && G.y === 0 && (G.x = Z / this.zoom, G.y = te / this.zoom, G.cleanAccumulation(), te += 80);
                  }
                });
              }
              processEditorData(R) {
                const y = this._frames.splice(0);
                for (const O of y)
                  O.dispose();
                if (this._frames = [], this.x = R.x || 0, this.y = R.y || 0, this.zoom = R.zoom || 1, R.frames)
                  for (const O of R.frames) {
                    const Y = H.GraphFrame.Parse(O, this, R.map);
                    this._frames.push(Y);
                  }
              }
              reOrganize(R = null, y = !1) {
                if (!R || !R.locations)
                  this.distributeGraph();
                else {
                  for (const O of R.locations)
                    for (const Y of this.nodes) {
                      const ee = Y.content.data;
                      if (ee && ee.uniqueId === O.blockId) {
                        Y.x = O.x, Y.y = O.y, Y.cleanAccumulation();
                        break;
                      }
                    }
                  y || this.processEditorData(R);
                }
                this._isLoading = !1;
                for (const O of this.nodes)
                  O._refreshLinks();
              }
              addFrame(R) {
                const y = H.GraphFrame.Parse(R, this, this.props.stateManager.getEditorDataMap());
                this._frames.push(y), this.stateManager.onSelectionChangedObservable.notifyObservers({ selection: y });
              }
              render() {
                return (0, d.jsxs)("div", { ref: this._hostCanvasRef, id: "graph-canvas", className: b.default["graph-canvas"], onWheel: (R) => this.onWheel(R), onPointerMove: (R) => this.onMove(R), onPointerDown: (R) => this.onDown(R), onPointerUp: (R) => this.onUp(R), children: [(0, d.jsxs)("div", { id: "graph-container", className: b.default["graph-container"], ref: this._rootContainerRef, children: [(0, d.jsx)("div", { id: "graph-canvas-container", className: b.default["graph-canvas-container"], ref: this._graphCanvasRef }), (0, d.jsx)("div", { id: "frame-container", className: b.default["frame-container"], ref: this._frameContainerRef }), (0, d.jsx)("svg", { id: "graph-svg-container", className: b.default["graph-svg-container"], ref: this._svgCanvasRef }), (0, d.jsx)("div", { id: "selection-container", className: b.default["selection-container"], ref: this._selectionContainerRef })] }), (0, d.jsx)(I.SearchBoxComponent, { stateManager: this.stateManager })] });
              }
            }
            N.NodeWidth = 100;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.js": (
          /*!**************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              FramePortPosition: () => (
                /* binding */
                H
              ),
              /* harmony export */
              GraphFrame: () => (
                /* binding */
                T
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Maths/math.color */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ./frameNodePort */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/frameNodePort.js"
            ), u = o(
              /*! ../stringTools */
              "../../../dev/sharedUiComponents/dist/stringTools.js"
            ), l = o(
              /*! ./graphFrame.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.modules.scss"
            ), P = o(
              /*! ./common.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss"
            ), p = o(
              /*! ../components/classNames */
              "../../../dev/sharedUiComponents/dist/components/classNames.js"
            ), c;
            (function(q) {
              q[q.Right = 0] = "Right", q[q.Left = 1] = "Left", q[q.Top = 2] = "Top", q[q.Bottom = 3] = "Bottom", q[q.TopRight = 4] = "TopRight", q[q.TopLeft = 5] = "TopLeft", q[q.BottomRight = 6] = "BottomRight", q[q.BottomLeft = 7] = "BottomLeft";
            })(c || (c = {}));
            var H;
            (function(q) {
              q[q.Top = 0] = "Top", q[q.Middle = 1] = "Middle", q[q.Bottom = 2] = "Bottom";
            })(H || (H = {}));
            class T {
              get id() {
                return this._id;
              }
              get isCollapsed() {
                return this._isCollapsed;
              }
              _createInputPort(b, j) {
                const w = v.FrameNodePort.CreateFrameNodePortElement(b.portData, j, this._inputPortContainer, null, this._ownerCanvas.stateManager, !0, T._FramePortCounter++, this.id);
                this._frameInPorts.push(w), b.delegatedPort = w, this._controlledPorts.push(b), b.exposedPortPosition = this._exposedInPorts.findIndex((m) => m === b), b.exposedPortPosition < 0 && (this._exposedInPorts.push(b), b.exposedPortPosition = this._exposedInPorts.length - 1);
              }
              // Mark ports with FramePortPosition for re-arrangement support
              _markFramePortPositions() {
                if (this._frameInPorts.length == 2)
                  this._frameInPorts[0].framePortPosition = H.Top, this._frameInPorts[1].framePortPosition = H.Bottom;
                else
                  for (let b = 0; b < this._frameInPorts.length; b++) {
                    const j = this._frameInPorts[b];
                    b === 0 ? j.framePortPosition = H.Top : b === this._frameInPorts.length - 1 ? j.framePortPosition = H.Bottom : j.framePortPosition = H.Middle;
                  }
                if (this._frameOutPorts.length == 2)
                  this._frameOutPorts[0].framePortPosition = H.Top, this._frameOutPorts[1].framePortPosition = H.Bottom;
                else
                  for (let b = 0; b < this._frameOutPorts.length; b++) {
                    const j = this._frameOutPorts[b];
                    b === 0 ? j.framePortPosition = H.Top : b === this._frameInPorts.length - 1 ? j.framePortPosition = H.Bottom : j.framePortPosition = H.Middle;
                  }
              }
              _createFramePorts() {
                for (const b of this._nodes)
                  b.isVisible = !1;
                for (let b = 0; b < this._exposedOutPorts.length; ) {
                  const j = this._exposedOutPorts[b];
                  if (j) {
                    if (j.node === null || j.node.enclosingFrameId != this.id) {
                      if (this._removePortFromExposedWithNode(j, this._exposedOutPorts))
                        continue;
                    } else if (!this._createOutputPorts(j, j.node) && this._removePortFromExposedWithNode(j, this._exposedOutPorts))
                      continue;
                  }
                  ++b;
                }
                for (let b = 0; b < this._exposedInPorts.length; ) {
                  const j = this._exposedInPorts[b];
                  if (!j || j.node === null || j.node.enclosingFrameId != this.id) {
                    if (this._removePortFromExposedWithNode(j, this._exposedInPorts))
                      continue;
                  } else if (!this._createInputPorts(j, j.node) && this._removePortFromExposedWithNode(j, this._exposedInPorts))
                    continue;
                  ++b;
                }
                for (const b of this._nodes) {
                  for (const j of b.outputPorts)
                    j.exposedPortPosition = this._exposedOutPorts.findIndex((w) => w === j), j.exposedPortPosition < 0 && this._createOutputPorts(j, b) && (j.node.enclosingFrameId = this.id, this._exposedOutPorts.push(j), j.exposedPortPosition = this._exposedOutPorts.length - 1);
                  for (const j of b.inputPorts)
                    j.exposedPortPosition = this._exposedInPorts.findIndex((w) => w === j), j.exposedPortPosition < 0 && this._createInputPorts(j, b);
                }
              }
              _removePortFromExposedWithNode(b, j) {
                const w = j.findIndex((m) => m === b);
                return w >= 0 ? (j.splice(w, 1), b && (b.exposedPortPosition = -1), !0) : !1;
              }
              _removePortFromExposedWithLink(b, j) {
                const w = j.findIndex((I) => I === b.portA), m = j.findIndex((I) => I === b.portB);
                if (w >= 0) {
                  if (!b.portA.exposedOnFrame)
                    return j.splice(w, 1), b.portA.exposedPortPosition = -1, !0;
                } else if (m >= 0 && b.portB && !b.portB.exposedOnFrame)
                  return j.splice(m, 1), b.portB.exposedPortPosition = -1, !0;
                return !1;
              }
              _createInputPorts(b, j) {
                if (b.portData.isConnected) {
                  let w = !1;
                  for (const m of j.links)
                    if (m.portB === b && this.nodes.indexOf(m.nodeA) === -1) {
                      this._createInputPort(b, j), m.isVisible = !0, w = !0;
                      const I = m.onDisposedObservable.add((N) => {
                        this._removePortFromExposedWithLink(N, this._exposedInPorts) && this.redrawFramePorts();
                      });
                      this._onNodeLinkDisposedObservers.push(I);
                    }
                  if (w)
                    return !0;
                } else if (b.exposedOnFrame)
                  return this._createInputPort(b, j), !0;
                return !1;
              }
              _createOutputPorts(b, j) {
                if (b.portData.hasEndpoints) {
                  let w = !1;
                  for (const m of j.links)
                    if (m.portA === b && this.nodes.indexOf(m.nodeB) === -1) {
                      let I;
                      if (w)
                        this.nodes.indexOf(m.nodeB) === -1 ? (m.isVisible = !0, I = this.ports.filter((N) => N.portData === b.portData)[0]) : I = this.ports.filter((N) => N.portData === b.portData)[0];
                      else {
                        w = !0, I = v.FrameNodePort.CreateFrameNodePortElement(b.portData, m.nodeA, this._outputPortContainer, null, this._ownerCanvas.stateManager, !1, T._FramePortCounter++, this.id), this._frameOutPorts.push(I), m.isVisible = !0;
                        const N = m.onDisposedObservable.add((k) => {
                          this._removePortFromExposedWithLink(k, this._exposedOutPorts) && this.redrawFramePorts();
                        });
                        this._onNodeLinkDisposedObservers.push(N);
                      }
                      b.delegatedPort = I, this._controlledPorts.push(b);
                    } else if (b.exposedPortPosition >= 0 && !w) {
                      const I = v.FrameNodePort.CreateFrameNodePortElement(b.portData, j, this._outputPortContainer, null, this._ownerCanvas.stateManager, !1, T._FramePortCounter++, this.id);
                      this._frameOutPorts.push(I), b.delegatedPort = I, this._controlledPorts.push(b), w = !0;
                    }
                  if (w)
                    return !0;
                } else if (b.exposedOnFrame) {
                  const w = v.FrameNodePort.CreateFrameNodePortElement(b.portData, j, this._outputPortContainer, null, this._ownerCanvas.stateManager, !1, T._FramePortCounter++, this.id);
                  return this._frameOutPorts.push(w), b.delegatedPort = w, this._controlledPorts.push(b), !0;
                }
                return !1;
              }
              redrawFramePorts() {
                this.isCollapsed && (this._outputPortContainer.innerHTML = "", this._inputPortContainer.innerHTML = "", this.ports.forEach((b) => {
                  b.dispose();
                }), this._controlledPorts.forEach((b) => {
                  b.delegatedPort = null, b.refresh();
                }), this._frameInPorts = [], this._frameOutPorts = [], this._controlledPorts = [], this._createFramePorts(), this._markFramePortPositions(), this.ports.forEach((b) => b.node._refreshLinks()));
              }
              set isCollapsed(b) {
                if (this._isCollapsed !== b) {
                  if (this._isCollapsed = b, this._ownerCanvas._frameIsMoving = !0, b)
                    this.element.classList.add(l.default.collapsed), this.element.classList.remove(l.default.expanded), this._headerElement.classList.add(l.default.collapsedHeader), this._moveFrame((this.width - this._collapsedWidth) / 2, 0), this._createFramePorts(), this._markFramePortPositions();
                  else {
                    this.element.classList.add(l.default.expanded), this.element.classList.remove(l.default.collapsed), this._headerElement.classList.remove(l.default.collapsedHeader), this._outputPortContainer.innerHTML = "", this._inputPortContainer.innerHTML = "", this._frameInPorts.forEach((j) => {
                      j.dispose();
                    }), this._frameOutPorts.forEach((j) => {
                      j.dispose();
                    }), this._controlledPorts.forEach((j) => {
                      j.delegatedPort = null, j.refresh();
                    }), this._frameInPorts = [], this._frameOutPorts = [], this._controlledPorts = [], this._onNodeLinkDisposedObservers = [];
                    for (const j of this._nodes)
                      j.isVisible = !0;
                    this._moveFrame(-(this.width - this._collapsedWidth) / 2, 0);
                  }
                  this.cleanAccumulation(), this._ownerCanvas._frameIsMoving = !1, this._isCollapsed ? (this._headerCollapseElement.innerHTML = this._expandSVG, this._headerCollapseElement.title = "Expand") : (this._headerCollapseElement.innerHTML = this._collapseSVG, this._headerCollapseElement.title = "Collapse"), this.onExpandStateChanged.notifyObservers(this);
                }
              }
              get nodes() {
                return this._nodes;
              }
              get ports() {
                return this._frameInPorts.concat(this._frameOutPorts);
              }
              get name() {
                return this._name;
              }
              set name(b) {
                this._name = b, this._headerTextElement.innerHTML = b;
              }
              get color() {
                return this._color;
              }
              set color(b) {
                this._color = b, this._headerElement.style.background = `rgba(${b.r * 255}, ${b.g * 255}, ${b.b * 255}, 1)`, this._headerElement.style.borderColor = `rgba(${b.r * 255}, ${b.g * 255}, ${b.b * 255}, 1)`, this.element.style.background = `rgba(${b.r * 255}, ${b.g * 255}, ${b.b * 255}, 0.7)`;
              }
              get x() {
                return this._x;
              }
              set x(b) {
                this._x !== b && (this._x = b, this._gridAlignedX = this._ownerCanvas.getGridPosition(b), this.element.style.left = `${this._gridAlignedX}px`);
              }
              get y() {
                return this._y;
              }
              set y(b) {
                this._y !== b && (this._y = b, this._gridAlignedY = this._ownerCanvas.getGridPosition(b), this.element.style.top = `${this._gridAlignedY}px`);
              }
              get width() {
                return this._width;
              }
              set width(b) {
                if (this._width === b)
                  return;
                const j = b > this._minFrameWidth ? b : this._minFrameWidth;
                this._width = j;
                const w = this._ownerCanvas.getGridPositionCeil(j + this._gridAlignedX);
                this.element.style.width = `${w - this._gridAlignedX}px`;
              }
              get height() {
                return this._height;
              }
              set height(b) {
                if (this._height === b)
                  return;
                this._height = b;
                const j = this._ownerCanvas.getGridPositionCeil(b + this._gridAlignedY);
                this.element.style.height = `${j - this._gridAlignedY}px`;
              }
              get comments() {
                return this._comments;
              }
              set comments(b) {
                b && !this._comments && b.length > 0 ? (this.element.style.gridTemplateRows = "40px min-content 1fr", this._borderElement.style.gridRow = "1 / span 3", this._portContainer.style.gridRow = "3", this._commentsElement.classList.add("has-comments")) : b || (this.element.style.gridTemplateRows = "40px calc(100% - 40px)", this._borderElement.style.gridRow = "1 / span 2", this._portContainer.style.gridRow = "2", this._commentsElement.classList.remove("has-comments")), (b === "" || b && b.length >= 0) && (this._commentsElement.children[0].innerText = b), this.height = this._borderElement.offsetHeight, this._comments = b, this._updateMinHeightWithComments();
              }
              constructor(b, j, w = !1) {
                this._collapsedWidth = 200, this._x = 0, this._y = 0, this._gridAlignedX = 0, this._gridAlignedY = 0, this._nodes = [], this._mouseStartPointX = null, this._mouseStartPointY = null, this._onNodeLinkDisposedObservers = [], this._isCollapsed = !1, this._frameInPorts = [], this._frameOutPorts = [], this._controlledPorts = [], this._exposedInPorts = [], this._exposedOutPorts = [], this._minFrameHeight = 40, this._minFrameWidth = 220, this.onExpandStateChanged = new d.Observable(), this._closeSVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><g id="Layer_2" data-name="Layer 2"><path d="M16,15l5.85,5.84-1,1L15,15.93,9.15,21.78l-1-1L14,15,8.19,9.12l1-1L15,14l5.84-5.84,1,1Z"/></g></svg>', this._expandSVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><g id="Layer_2" data-name="Layer 2"><path d="M22.31,7.69V22.31H7.69V7.69ZM21.19,8.81H8.81V21.19H21.19Zm-6.75,6.75H11.06V14.44h3.38V11.06h1.12v3.38h3.38v1.12H15.56v3.38H14.44Z"/></g></svg>', this._collapseSVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><g id="Layer_2" data-name="Layer 2"><path d="M22.31,7.69V22.31H7.69V7.69ZM21.19,8.81H8.81V21.19H21.19Zm-2.25,6.75H11.06V14.44h7.88Z"/></g></svg>', this._initResizing = (te) => {
                  te.stopPropagation(), this._mouseStartPointX = te.clientX, this._mouseStartPointY = te.clientY, this._frameIsResizing = !0;
                }, this._cleanUpResizing = (te) => {
                  te.stopPropagation(), this._frameIsResizing = !1, this._resizingDirection = null, this._mouseStartPointX = null, this._mouseStartPointY = null, this._mouseXLimit = null, this.refresh();
                }, this._updateMinHeightWithComments = () => {
                  if (this.comments && this.comments.length > 0) {
                    const te = this._commentsElement.offsetHeight + 40;
                    this._minFrameHeight = te;
                  }
                }, this._onRightHandlePointerDown = (te) => {
                  this.isCollapsed || (this._initResizing(te), this._resizingDirection = c.Right, this._mouseXLimit = te.clientX - (this.width - this._minFrameWidth), this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onRightHandlePointerUp), this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onRightHandlePointerMove));
                }, this._onRightHandlePointerMove = (te) => {
                  const fe = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom, _ = this._mouseStartPointX - fe;
                  this._moveRightHandle(te, _);
                }, this._moveRightHandle = (te, fe) => {
                  if (this._mouseXLimit) {
                    if (!this._isResizingRight() || this._mouseStartPointX === null || this._mouseStartPointY === null || te.clientX < fe)
                      return;
                    if (this._isResizingRight()) {
                      te.stopPropagation();
                      const _ = (te.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
                      this._expandRight(_, te.clientX), this._mouseStartPointX = te.clientX;
                    }
                  }
                }, this._onRightHandlePointerUp = (te) => {
                  this._isResizingRight() && (this.width = parseFloat(this.element.style.width.replace("px", "")), this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onRightHandlePointerUp), this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onRightHandlePointerMove), this._cleanUpResizing(te));
                }, this._onBottomHandlePointerDown = (te) => {
                  this.isCollapsed || (this._initResizing(te), this._resizingDirection = c.Bottom, this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onBottomHandlePointerMove), this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onBottomHandlePointerUp));
                }, this._onBottomHandlePointerMove = (te) => {
                  const fe = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom, _ = this._mouseStartPointY - fe;
                  this._moveBottomHandle(te, _);
                }, this._moveBottomHandle = (te, fe) => {
                  if (!(this._resizingDirection !== c.Bottom || this._mouseStartPointX === null || this._mouseStartPointY === null || te.clientY < fe) && this._resizingDirection === c.Bottom) {
                    te.stopPropagation();
                    const _ = (te.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                    this._expandBottom(_), this._mouseStartPointY = te.clientY;
                  }
                }, this._onBottomHandlePointerUp = (te) => {
                  this._resizingDirection === c.Bottom && (this.height = parseFloat(this.element.style.height.replace("px", "")), this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onBottomHandlePointerMove), this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onBottomHandlePointerUp), this._cleanUpResizing(te));
                }, this._onLeftHandlePointerDown = (te) => {
                  this.isCollapsed || (this._initResizing(te), this._resizingDirection = c.Left, this._mouseXLimit = te.clientX + this.width - this._minFrameWidth, this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onLeftHandlePointerUp), this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onLeftHandlePointerMove));
                }, this._onLeftHandlePointerMove = (te) => {
                  const fe = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom, _ = this._mouseStartPointX + fe;
                  this._moveLeftHandle(te, _);
                }, this._moveLeftHandle = (te, fe) => {
                  if (this._mouseXLimit) {
                    if (this._resizingDirection !== c.Left || this._mouseStartPointX === null || this._mouseStartPointY === null || te.clientX > fe)
                      return;
                    if (this._resizingDirection === c.Left) {
                      te.stopPropagation();
                      const _ = (te.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
                      this._expandLeft(_), this._mouseStartPointX = te.clientX;
                    }
                  }
                }, this._onLeftHandlePointerUp = (te) => {
                  this._resizingDirection === c.Left && (this.x = parseFloat(this.element.style.left.replace("px", "")), this.width = parseFloat(this.element.style.width.replace("px", "")), this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onLeftHandlePointerUp), this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onLeftHandlePointerMove), this._cleanUpResizing(te));
                }, this._onTopHandlePointerDown = (te) => {
                  this.isCollapsed || (this._initResizing(te), this._resizingDirection = c.Top, this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onTopHandlePointerUp), this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onTopHandlePointerMove));
                }, this._onTopHandlePointerMove = (te) => {
                  const fe = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom, _ = this._mouseStartPointY + fe;
                  this._moveTopHandle(te, _);
                }, this._moveTopHandle = (te, fe) => {
                  if (!(!this._isResizingTop() || this._mouseStartPointX === null || this._mouseStartPointY === null || te.clientY > fe) && this._isResizingTop()) {
                    te.stopPropagation();
                    const _ = (te.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                    this._expandTop(_), this._mouseStartPointY = te.clientY;
                  }
                }, this._onTopHandlePointerUp = (te) => {
                  this._isResizingTop() && (this.y = parseFloat(this.element.style.top.replace("px", "")), this.height = parseFloat(this.element.style.height.replace("px", "")), this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onTopHandlePointerUp), this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onTopHandlePointerMove), this._cleanUpResizing(te));
                }, this._onTopRightHandlePointerDown = (te) => {
                  this.isCollapsed || (this._initResizing(te), this._resizingDirection = c.TopRight, this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onTopRightHandlePointerUp), this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onTopRightHandlePointerMove));
                }, this._onTopRightHandlePointerMove = (te) => {
                  const fe = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom, _ = this._mouseStartPointY + fe, G = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom, L = this._mouseStartPointX - G;
                  this._moveTopRightHandle(te, L, _);
                }, this._moveTopRightHandle = (te, fe, _) => {
                  if (!(!(this._isResizingTop() && this._isResizingRight()) || this._mouseStartPointX === null || this._mouseStartPointY === null) && this._isResizingRight() && this._isResizingTop()) {
                    if (te.stopPropagation(), te.clientY < _ && te.clientX > fe) {
                      const G = (te.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
                      this._expandRight(G, te.clientX), this._mouseStartPointX = te.clientX;
                      const L = (te.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                      this._expandTop(L), this._mouseStartPointY = te.clientY;
                    } else if (te.clientY > _ && te.clientX > fe) {
                      const G = (te.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
                      this._expandRight(G, te.clientX), this._mouseStartPointX = te.clientX;
                    } else if (te.clientY < _ && te.clientX < fe) {
                      const G = (te.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                      this._expandTop(G), this._mouseStartPointY = te.clientY;
                    }
                  }
                }, this._onTopRightHandlePointerUp = (te) => {
                  te.stopPropagation(), this._resizingDirection === c.TopRight && (this.y = parseFloat(this.element.style.top.replace("px", "")), this.height = parseFloat(this.element.style.height.replace("px", "")), this.width = parseFloat(this.element.style.width.replace("px", "")), this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onTopRightHandlePointerUp), this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onTopRightHandlePointerMove), this._cleanUpResizing(te));
                }, this._onBottomRightHandlePointerDown = (te) => {
                  this.isCollapsed || (this._initResizing(te), this._resizingDirection = c.BottomRight, this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onBottomRightHandlePointerUp), this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onBottomRightHandlePointerMove));
                }, this._onBottomRightHandlePointerMove = (te) => {
                  const fe = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom, _ = this._mouseStartPointY - fe, G = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom, L = this._mouseStartPointX - G;
                  this._moveBottomRightHandle(te, L, _);
                }, this._moveBottomRightHandle = (te, fe, _) => {
                  if (!(!(this._isResizingBottom() && this._isResizingRight()) || this._mouseStartPointX === null || this._mouseStartPointY === null) && this._isResizingRight() && this._isResizingBottom()) {
                    if (te.stopPropagation(), te.clientY > _ && te.clientX > fe) {
                      const G = (te.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
                      this._expandRight(G, te.clientX), this._mouseStartPointX = te.clientX;
                      const L = (te.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                      this._expandBottom(L), this._mouseStartPointY = te.clientY;
                    } else if (te.clientY < _ && te.clientX > fe) {
                      const G = (te.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
                      this._expandRight(G, te.clientX), this._mouseStartPointX = te.clientX;
                    } else if (te.clientY > _ && te.clientX < fe) {
                      const G = (te.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                      this._expandBottom(G), this._mouseStartPointY = te.clientY;
                    }
                  }
                }, this._onBottomRightHandlePointerUp = (te) => {
                  this._resizingDirection === c.BottomRight && (this.height = parseFloat(this.element.style.height.replace("px", "")), this.width = parseFloat(this.element.style.width.replace("px", "")), this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onBottomRightHandlePointerUp), this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onBottomRightHandlePointerMove), this._cleanUpResizing(te));
                }, this._onBottomLeftHandlePointerDown = (te) => {
                  this.isCollapsed || (this._initResizing(te), this._resizingDirection = c.BottomLeft, this._mouseXLimit = te.clientX + this.width - this._minFrameWidth, this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onBottomLeftHandlePointerUp), this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onBottomLeftHandlePointerMove));
                }, this._onBottomLeftHandlePointerMove = (te) => {
                  const fe = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom, _ = this._mouseStartPointY - fe, G = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom, L = this._mouseStartPointX + G;
                  this._moveBottomLeftHandle(te, L, _);
                }, this._moveBottomLeftHandle = (te, fe, _) => {
                  if (!(!(this._isResizingBottom() && this._isResizingLeft()) || this._mouseStartPointX === null || this._mouseStartPointY === null) && this._isResizingLeft() && this._isResizingBottom()) {
                    if (te.stopPropagation(), te.clientY > _ && te.clientX < fe) {
                      const G = (te.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
                      this._expandLeft(G), this._mouseStartPointX = te.clientX;
                      const L = (te.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                      this._expandBottom(L), this._mouseStartPointY = te.clientY;
                    } else if (te.clientY < _ && te.clientX < fe) {
                      const G = (te.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
                      this._expandLeft(G), this._mouseStartPointX = te.clientX;
                    } else if (te.clientY > _ && te.clientX > fe) {
                      const G = (te.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                      this._expandBottom(G), this._mouseStartPointY = te.clientY;
                    }
                  }
                }, this._onBottomLeftHandlePointerUp = (te) => {
                  te.stopPropagation(), this._resizingDirection === c.BottomLeft && (this.height = parseFloat(this.element.style.height.replace("px", "")), this.x = parseFloat(this.element.style.left.replace("px", "")), this.width = parseFloat(this.element.style.width.replace("px", "")), this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onBottomLeftHandlePointerUp), this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onBottomLeftHandlePointerMove), this._cleanUpResizing(te));
                }, this._onTopLeftHandlePointerDown = (te) => {
                  this.isCollapsed || (this._initResizing(te), this._resizingDirection = c.TopLeft, this._mouseXLimit = te.clientX + this.width - this._minFrameWidth, this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onTopLeftHandlePointerUp), this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onTopLeftHandlePointerMove));
                }, this._onTopLeftHandlePointerMove = (te) => {
                  const fe = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom, _ = this._mouseStartPointY + fe, G = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom, L = this._mouseStartPointX + G;
                  this._moveTopLeftHandle(te, L, _);
                }, this._moveTopLeftHandle = (te, fe, _) => {
                  if (!(!(this._isResizingTop() && this._isResizingLeft()) || this._mouseStartPointX === null || this._mouseStartPointY === null) && this._isResizingLeft() && this._isResizingTop()) {
                    if (te.stopPropagation(), te.clientY < _ && te.clientX < fe) {
                      const G = (te.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
                      this._expandLeft(G), this._mouseStartPointX = te.clientX;
                      const L = (te.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                      this._expandTop(L), this._mouseStartPointY = te.clientY;
                    } else if (te.clientY > _ && te.clientX < fe) {
                      const G = (te.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
                      this._expandLeft(G), this._mouseStartPointX = te.clientX;
                    } else if (te.clientY < _ && te.clientX > fe) {
                      const G = (te.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                      this._expandTop(G), this._mouseStartPointY = te.clientY;
                    }
                  }
                }, this._onTopLeftHandlePointerUp = (te) => {
                  te.stopPropagation(), this._resizingDirection === c.TopLeft && (this.y = parseFloat(this.element.style.top.replace("px", "")), this.height = parseFloat(this.element.style.height.replace("px", "")), this.x = parseFloat(this.element.style.left.replace("px", "")), this.width = parseFloat(this.element.style.width.replace("px", "")), this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onTopLeftHandlePointerUp), this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onTopLeftHandlePointerMove), this._cleanUpResizing(te));
                }, this._id = T._FrameCounter++, this._ownerCanvas = j;
                const m = j.frameContainer;
                this.element = m.ownerDocument.createElement("div"), this.element.classList.add(P.default["frame-box"]), m.appendChild(this.element), this._headerElement = m.ownerDocument.createElement("div"), this._headerElement.classList.add(l.default["frame-box-header"]), this._headerElement.addEventListener("dblclick", () => {
                  this.isCollapsed = !this.isCollapsed;
                }), this.element.appendChild(this._headerElement), this._borderElement = m.ownerDocument.createElement("div"), this._borderElement.classList.add(l.default["frame-box-border"]), this.element.appendChild(this._borderElement), this.element.classList.add(l.default.expanded);
                const I = m.ownerDocument.createElement("div");
                I.className = l.default["right-handle"], this.element.appendChild(I), I.addEventListener("pointerdown", this._onRightHandlePointerDown);
                const N = m.ownerDocument.createElement("div");
                N.className = l.default["left-handle"], this.element.appendChild(N), N.addEventListener("pointerdown", this._onLeftHandlePointerDown);
                const k = m.ownerDocument.createElement("div");
                k.className = l.default["bottom-handle"], this.element.appendChild(k), k.addEventListener("pointerdown", this._onBottomHandlePointerDown);
                const R = m.ownerDocument.createElement("div");
                R.className = l.default["top-handle"], this.element.appendChild(R), R.addEventListener("pointerdown", this._onTopHandlePointerDown);
                const y = m.ownerDocument.createElement("div");
                y.className = (0, p.ClassNames)({ "right-handle": !0, "top-right-corner-handle": !0 }, l.default), this.element.appendChild(y), y.addEventListener("pointerdown", this._onTopRightHandlePointerDown);
                const O = m.ownerDocument.createElement("div");
                O.className = (0, p.ClassNames)({ "right-handle": !0, "bottom-right-corner-handle": !0 }, l.default), this.element.appendChild(O), O.addEventListener("pointerdown", this._onBottomRightHandlePointerDown);
                const Y = m.ownerDocument.createElement("div");
                Y.className = (0, p.ClassNames)({ "left-handle": !0, "top-left-corner-handle": !0 }, l.default), this.element.appendChild(Y), Y.addEventListener("pointerdown", this._onTopLeftHandlePointerDown);
                const ee = m.ownerDocument.createElement("div");
                ee.className = (0, p.ClassNames)({ "left-handle": !0, "bottom-left-corner-handle": !0 }, l.default), this.element.appendChild(ee), ee.addEventListener("pointerdown", this._onBottomLeftHandlePointerDown), this._headerTextElement = m.ownerDocument.createElement("div"), this._headerTextElement.classList.add(l.default["frame-box-header-title"]), this._headerElement.appendChild(this._headerTextElement), this._headerCollapseElement = m.ownerDocument.createElement("div"), this._headerCollapseElement.classList.add(l.default["frame-box-header-collapse"]), this._headerCollapseElement.classList.add(l.default["frame-box-header-button"]), this._headerCollapseElement.title = "Collapse", this._headerCollapseElement.ondragstart = () => !1, this._headerCollapseElement.addEventListener("pointerdown", (te) => {
                  this._headerCollapseElement.classList.add("down"), te.stopPropagation();
                }), this._headerCollapseElement.addEventListener("pointerup", (te) => {
                  te.stopPropagation(), this._headerCollapseElement.classList.remove("down"), this.isCollapsed = !this.isCollapsed;
                }), this._headerCollapseElement.innerHTML = this._collapseSVG, this._headerElement.appendChild(this._headerCollapseElement), this._headerCloseElement = m.ownerDocument.createElement("div"), this._headerCloseElement.classList.add(l.default["frame-box-header-close"]), this._headerCloseElement.classList.add(l.default["frame-box-header-button"]), this._headerCloseElement.title = "Close", this._headerCloseElement.ondragstart = () => !1, this._headerCloseElement.addEventListener("pointerdown", (te) => {
                  te.stopPropagation();
                }), this._headerCloseElement.addEventListener("pointerup", (te) => {
                  te.stopPropagation(), this.dispose();
                }), this._headerCloseElement.innerHTML = this._closeSVG, this._headerElement.appendChild(this._headerCloseElement), this._portContainer = m.ownerDocument.createElement("div"), this._portContainer.classList.add(l.default["port-container"]), this.element.appendChild(this._portContainer), this._outputPortContainer = m.ownerDocument.createElement("div"), this._outputPortContainer.classList.add(P.default.outputsContainer), this._portContainer.appendChild(this._outputPortContainer), this._inputPortContainer = m.ownerDocument.createElement("div"), this._inputPortContainer.classList.add(P.default.inputsContainer), this._portContainer.appendChild(this._inputPortContainer), this.name = "Frame", this.color = d.Color3.FromInts(72, 72, 72), b && (this.x = parseFloat(b.style.left.replace("px", "")), this.y = parseFloat(b.style.top.replace("px", "")), this.width = parseFloat(b.style.width.replace("px", "")), this.height = parseFloat(b.style.height.replace("px", "")), this.cleanAccumulation()), this._headerTextElement.addEventListener("pointerdown", (te) => this._onDown(te)), this._headerTextElement.addEventListener("pointerup", (te) => this._onUp(te)), this._headerTextElement.addEventListener("pointermove", (te) => this._onMove(te)), this._onSelectionChangedObserver = j.stateManager.onSelectionChangedObservable.add(() => {
                  this._ownerCanvas.selectedFrames.indexOf(this) !== -1 ? this._borderElement.classList.add(l.default.selected) : this._borderElement.classList.remove(l.default.selected);
                }), j.stateManager.onSelectionBoxMoved.add((te) => {
                  const fe = this.element.getBoundingClientRect();
                  !(te.right < fe.left || te.left > fe.right || te.bottom < fe.top || te.top > fe.bottom) && j.stateManager.onSelectionChangedObservable.notifyObservers({ selection: this, forceKeepSelection: !0, marqueeSelection: !0 });
                }), this._onGraphNodeRemovalObserver = j.stateManager.onGraphNodeRemovalObservable.add((te) => {
                  const fe = this._nodes.indexOf(te);
                  fe !== -1 && (te.enclosingFrameId = -1, this._nodes.splice(fe, 1));
                }), this._onExposePortOnFrameObserver = j.stateManager.onExposePortOnFrameObservable.add((te) => {
                  this.nodes.indexOf(te) !== -1 && this.redrawFramePorts();
                }), this._commentsElement = document.createElement("div"), this._commentsElement.className = l.default["frame-comments"], this._commentsElement.style.color = "white", this._commentsElement.style.fontSize = "16px";
                const Z = document.createElement("span");
                Z.className = l.default["frame-comment-span"], this._commentsElement.appendChild(Z), this.element.appendChild(this._commentsElement), w || this.refresh();
              }
              refresh() {
                this._nodes = [], this._ownerCanvas.stateManager.onFrameCreatedObservable.notifyObservers(this);
              }
              addNode(b) {
                this.nodes.indexOf(b) === -1 && this.nodes.push(b);
              }
              removeNode(b) {
                const j = this.nodes.indexOf(b);
                j > -1 && (b.enclosingFrameId = -1, this.nodes.splice(j, 1));
              }
              syncNode(b) {
                this.isCollapsed || (b.isOverlappingFrame(this) ? this.addNode(b) : this.removeNode(b));
              }
              cleanAccumulation() {
                for (const b of this._nodes)
                  b.cleanAccumulation();
                this.x = this._ownerCanvas.getGridPosition(this.x), this.y = this._ownerCanvas.getGridPosition(this.y);
              }
              _onDown(b) {
                this._headerTextElement.setPointerCapture(b.pointerId);
                const j = this._ownerCanvas.selectedFrames.indexOf(this);
                j === -1 ? this._ownerCanvas.stateManager.onSelectionChangedObservable.notifyObservers({ selection: this }) : b.ctrlKey && (this._ownerCanvas.selectedFrames.splice(j, 1), this.element.classList.remove("selected")), this._ownerCanvas._frameIsMoving = !0, this._mouseStartPointX = b.clientX, this._mouseStartPointY = b.clientY, b.stopPropagation();
              }
              move(b, j, w = !0) {
                const m = this.x, I = this.y;
                this.x = b, this.y = j;
                for (const N of this._nodes)
                  N.x += this.x - m, N.y += this.y - I, w && N.cleanAccumulation(!0);
              }
              _onUp(b) {
                b.stopPropagation(), this.cleanAccumulation(), this._mouseStartPointX = null, this._mouseStartPointY = null, this._headerTextElement.releasePointerCapture(b.pointerId), this._ownerCanvas._frameIsMoving = !1;
              }
              _moveFrame(b, j) {
                this.x += b, this.y += j;
                for (const w of this._nodes)
                  w.x += b, w.y += j;
              }
              _onMove(b) {
                if (this._mouseStartPointX === null || this._mouseStartPointY === null || b.ctrlKey || this._frameIsResizing)
                  return;
                const j = (b.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom, w = (b.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                for (const m of this._ownerCanvas.selectedFrames)
                  m._moveFrame(j, w);
                for (const m of this._ownerCanvas.selectedNodes)
                  m.x += j, m.y += w;
                this._mouseStartPointX = b.clientX, this._mouseStartPointY = b.clientY, b.stopPropagation();
              }
              moveFramePortUp(b) {
                let j;
                if (b.isInput) {
                  if (this._inputPortContainer.children.length < 2)
                    return;
                  j = Array.from(this._inputPortContainer.childNodes);
                  const w = this._frameInPorts.findIndex((m) => m === b);
                  [this._exposedInPorts[w - 1], this._exposedInPorts[w]] = [
                    this._exposedInPorts[w],
                    this._exposedInPorts[w - 1]
                  ], this._movePortUp(j, b, this._frameInPorts);
                } else {
                  if (this._outputPortContainer.children.length < 2)
                    return;
                  j = Array.from(this._outputPortContainer.childNodes);
                  const w = this._frameOutPorts.findIndex((m) => m === b);
                  [this._exposedOutPorts[w - 1], this._exposedOutPorts[w]] = [
                    this._exposedOutPorts[w],
                    this._exposedOutPorts[w - 1]
                  ], this._movePortUp(j, b, this._frameOutPorts);
                }
                this.ports.forEach((w) => w.node._refreshLinks());
              }
              _movePortUp(b, j, w) {
                var R;
                const m = b.findIndex((y) => y.dataset.framePortId === `${j.framePortId}`);
                if (m === 0)
                  return;
                const I = b[m], N = b[m - 1];
                (R = N.parentElement) == null || R.insertBefore(I, N);
                const k = w.findIndex((y) => y === j);
                [w[k - 1], w[k]] = [w[k], w[k - 1]], w.length == 2 ? (w[1].framePortPosition = H.Bottom, w[0].framePortPosition = H.Top) : m === 1 ? (w[1].framePortPosition = H.Middle, w[0].framePortPosition = H.Top) : k === b.length - 1 ? (w[w.length - 1].framePortPosition = H.Bottom, w[w.length - 2].framePortPosition = H.Middle) : j.framePortPosition = H.Middle;
              }
              moveFramePortDown(b) {
                let j;
                if (b.isInput) {
                  if (this._inputPortContainer.children.length < 2)
                    return;
                  j = Array.from(this._inputPortContainer.childNodes);
                  const w = this._frameInPorts.findIndex((m) => m === b);
                  [this._exposedInPorts[w], this._exposedInPorts[w + 1]] = [
                    this._exposedInPorts[w + 1],
                    this._exposedInPorts[w]
                  ], this._movePortDown(j, b, this._frameInPorts);
                } else {
                  if (this._outputPortContainer.children.length < 2)
                    return;
                  j = Array.from(this._outputPortContainer.childNodes);
                  const w = this._frameOutPorts.findIndex((m) => m === b);
                  [this._exposedOutPorts[w], this._exposedOutPorts[w + 1]] = [
                    this._exposedOutPorts[w + 1],
                    this._exposedOutPorts[w]
                  ], this._movePortDown(j, b, this._frameOutPorts);
                }
                this.ports.forEach((w) => w.node._refreshLinks());
              }
              _movePortDown(b, j, w) {
                var R;
                const m = b.findIndex((y) => y.dataset.framePortId === `${j.framePortId}`);
                if (m === b.length - 1)
                  return;
                const I = b[m], N = b[m + 1];
                (R = I.parentElement) == null || R.insertBefore(N, I);
                const k = w.findIndex((y) => y === j);
                [w[k], w[k + 1]] = [w[k + 1], w[k]], w.length == 2 ? (w[0].framePortPosition = H.Top, w[1].framePortPosition = H.Bottom) : k === b.length - 2 ? (w[b.length - 2].framePortPosition = H.Middle, w[b.length - 1].framePortPosition = H.Bottom) : k === 0 ? (w[0].framePortPosition = H.Top, w[1].framePortPosition = H.Middle) : j.framePortPosition = H.Middle;
              }
              _isResizingTop() {
                return this._resizingDirection === c.Top || this._resizingDirection === c.TopRight || this._resizingDirection === c.TopLeft;
              }
              _isResizingRight() {
                return this._resizingDirection === c.Right || this._resizingDirection === c.TopRight || this._resizingDirection === c.BottomRight;
              }
              _isResizingBottom() {
                return this._resizingDirection === c.Bottom || this._resizingDirection === c.BottomLeft || this._resizingDirection === c.BottomRight;
              }
              _isResizingLeft() {
                return this._resizingDirection === c.Left || this._resizingDirection === c.TopLeft || this._resizingDirection === c.BottomLeft;
              }
              _expandLeft(b) {
                const j = parseFloat(this.element.style.width.replace("px", "")), w = parseFloat(this.element.style.left.replace("px", ""));
                this.element.style.width = `${j - b}px`, this.element.style.left = `${w + b}px`, this._updateMinHeightWithComments();
              }
              _expandTop(b) {
                const j = parseFloat(this.element.style.height.replace("px", "")), w = parseFloat(this.element.style.top.replace("px", ""));
                this.element.style.height = `${j - b}px`, this.element.style.top = `${w + b}px`;
              }
              _expandRight(b, j) {
                const w = parseFloat(this.element.style.width.replace("px", ""));
                w + b > 20 && (this._mouseStartPointX = j, this.element.style.width = `${w + b}px`), this._updateMinHeightWithComments();
              }
              _expandBottom(b) {
                const j = parseFloat(this.element.style.height.replace("px", ""));
                this.element.style.height = `${j + b}px`;
              }
              dispose() {
                var b;
                this._onSelectionChangedObserver && this._ownerCanvas.stateManager.onSelectionChangedObservable.remove(this._onSelectionChangedObserver), this._onGraphNodeRemovalObserver && this._ownerCanvas.stateManager.onGraphNodeRemovalObservable.remove(this._onGraphNodeRemovalObserver), this._onExposePortOnFrameObserver && this._ownerCanvas.stateManager.onExposePortOnFrameObservable.remove(this._onExposePortOnFrameObserver), (b = this.element.parentElement) == null || b.removeChild(this.element), this._ownerCanvas.frames.splice(this._ownerCanvas.frames.indexOf(this), 1), this.onExpandStateChanged.clear();
              }
              _serializePortData(b) {
                if (b.length > 0)
                  for (let j = 0; j < b.length; ++j)
                    b[j] && (b[j].exposedPortPosition = j);
              }
              serialize(b) {
                return this._serializePortData(this._exposedInPorts), this._serializePortData(this._exposedOutPorts), {
                  x: this._x,
                  y: this._y,
                  width: this._width,
                  height: this._height,
                  color: this._color.asArray(),
                  name: this.name,
                  isCollapsed: b ? this.isCollapsed : !0,
                  blocks: this.nodes.map((j) => j.content.uniqueId),
                  comments: this._comments
                };
              }
              export() {
                const b = this._ownerCanvas.stateManager, j = b.exportData(b.data, this);
                u.StringTools.DownloadAsFile(b.hostDocument, j, this._name + ".json");
              }
              adjustPorts() {
                for (const b of this.nodes) {
                  for (const j of b.outputPorts)
                    j.exposedOnFrame && j.exposedPortPosition !== -1 && (this._exposedOutPorts[j.exposedPortPosition] = j);
                  for (const j of b.inputPorts)
                    j.exposedOnFrame && j.exposedPortPosition !== -1 && (this._exposedInPorts[j.exposedPortPosition] = j);
                }
              }
              static Parse(b, j, w) {
                const m = new T(null, j, !0), I = !!b.isCollapsed;
                if (m.x = b.x, m.y = b.y, m.width = b.width, m.height = b.height, m.name = b.name, m.color = d.Color3.FromArray(b.color), m.comments = b.comments, b.blocks && w)
                  for (const N of b.blocks) {
                    const k = w[N], R = j.nodes.filter((y) => y.content.uniqueId === k);
                    R.length && (m.nodes.push(R[0]), R[0].enclosingFrameId = m.id);
                  }
                else
                  m.refresh();
                if (m.adjustPorts(), m.isCollapsed = I, I) {
                  j._frameIsMoving = !0, m._moveFrame(-(m.width - m._collapsedWidth) / 2, 0);
                  const N = b.x - m.x;
                  m._moveFrame(N, 0), m.cleanAccumulation();
                  for (const k of m.nodes)
                    k.refresh();
                  j._frameIsMoving = !1;
                }
                return m;
              }
            }
            T._FrameCounter = 0, T._FramePortCounter = 0;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.js": (
          /*!*************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.js ***!
            \*************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              GraphNode: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            var d = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), v = o(
              /*! ./nodePort */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.js"
            ), u = o(
              /*! ./propertyLedger */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/propertyLedger.js"
            ), l = o(
              /*! ./displayLedger */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/displayLedger.js"
            ), P = o(
              /*! ./graphNode.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.modules.scss"
            ), p = o(
              /*! ./common.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss"
            );
            class c {
              addClassToVisual(T) {
                this._visual.classList.add(T);
              }
              removeClassFromVisual(T) {
                this._visual.classList.remove(T);
              }
              get isVisible() {
                return this._isVisible;
              }
              set isVisible(T) {
                this._isVisible = T, T ? (this._visual.classList.remove(p.default.hidden), this._upateNodePortNames()) : this._visual.classList.add(p.default.hidden);
                for (const q of this._links)
                  q.isVisible = T;
                this._refreshLinks();
              }
              _upateNodePortNames() {
                for (const T of this._inputPorts.concat(this._outputPorts))
                  T.hasLabel() && (T.portName = T.portData.name);
              }
              get outputPorts() {
                return this._outputPorts;
              }
              get inputPorts() {
                return this._inputPorts;
              }
              get links() {
                return this._links;
              }
              get gridAlignedX() {
                return this._gridAlignedX;
              }
              get gridAlignedY() {
                return this._gridAlignedY;
              }
              get x() {
                return this._x;
              }
              set x(T) {
                this._x !== T && (this._x = T, this._gridAlignedX = this._ownerCanvas.getGridPosition(T), this._visual.style.left = `${this._gridAlignedX}px`, this._refreshLinks(), this._refreshFrames());
              }
              get y() {
                return this._y;
              }
              set y(T) {
                this._y !== T && (this._y = T, this._gridAlignedY = this._ownerCanvas.getGridPosition(T), this._visual.style.top = `${this._gridAlignedY}px`, this._refreshLinks(), this._refreshFrames());
              }
              get width() {
                return this._visual.clientWidth;
              }
              get height() {
                return this._visual.clientHeight;
              }
              get id() {
                return this.content.uniqueId;
              }
              get name() {
                return this.content.name;
              }
              get isSelected() {
                return this._isSelected;
              }
              get enclosingFrameId() {
                return this._enclosingFrameId;
              }
              set enclosingFrameId(T) {
                this._enclosingFrameId = T;
              }
              set isSelected(T) {
                this.setIsSelected(T, !1);
              }
              setIsSelected(T, q) {
                if (this._isSelected !== T)
                  if (this._isSelected = T, T)
                    this._stateManager.onSelectionChangedObservable.notifyObservers({ selection: this, marqueeSelection: q });
                  else {
                    this._visual.classList.remove(P.default.selected);
                    const b = this._ownerCanvas.selectedNodes.indexOf(this);
                    b > -1 && this._ownerCanvas.selectedNodes.splice(b, 1);
                  }
              }
              constructor(T, q) {
                this.content = T, this._inputPorts = [], this._outputPorts = [], this._links = [], this._x = 0, this._y = 0, this._gridAlignedX = 0, this._gridAlignedY = 0, this._mouseStartPointX = null, this._mouseStartPointY = null, this._displayManager = null, this._isVisible = !0, this._enclosingFrameId = -1, this._stateManager = q, this._onSelectionChangedObserver = this._stateManager.onSelectionChangedObservable.add((b) => {
                  const { selection: j } = b || {};
                  j === this ? (this._visual.classList.add(P.default.selected), this._displayManager && this._displayManager.onSelectionChanged && this._displayManager.onSelectionChanged(this.content, j.content, this._stateManager)) : this._ownerCanvas.selectedNodes.indexOf(this) === -1 && (this._visual.classList.remove(P.default.selected), this._displayManager && this._displayManager.onSelectionChanged && this._displayManager.onSelectionChanged(this.content, j && j.content ? j.content : null, this._stateManager));
                }), this._onHighlightNodeObserver = this._stateManager.onHighlightNodeObservable.add((b) => {
                  b.data === this.content.data && (b.active ? this._visual.classList.add(P.default.highlighted) : this._visual.classList.remove(P.default.highlighted));
                }), this._onUpdateRequiredObserver = this._stateManager.onUpdateRequiredObservable.add((b) => {
                  b === this.content.data && this.refresh();
                }), this._onSelectionBoxMovedObserver = this._stateManager.onSelectionBoxMoved.add((b) => {
                  const j = this._visual.getBoundingClientRect(), w = !(b.right < j.left || b.left > j.right || b.bottom < j.top || b.top > j.bottom);
                  this.setIsSelected(w, !0);
                }), this._onFrameCreatedObserver = this._stateManager.onFrameCreatedObservable.add((b) => {
                  this._ownerCanvas.frames.some((j) => j.nodes.indexOf(this) !== -1) || this.isOverlappingFrame(b) && b.nodes.push(this);
                });
              }
              isOverlappingFrame(T) {
                const q = this._visual.getBoundingClientRect(), b = T.element.getBoundingClientRect();
                b.width -= 5, b.height -= 5;
                const j = !(b.right < q.left || b.left > q.right || b.bottom < q.top || b.top > q.bottom);
                return j && (this.enclosingFrameId = T.id), j;
              }
              getPortForPortData(T) {
                for (const q of this._inputPorts) {
                  const b = q.portData;
                  if (b === T || b.ownerData === T.ownerData && b.internalName === T.internalName)
                    return q;
                }
                for (const q of this._outputPorts) {
                  const b = q.portData;
                  if (b === T || b.ownerData === T.ownerData && b.internalName === T.internalName)
                    return q;
                }
                return null;
              }
              getPortDataForPortDataContent(T) {
                for (const q of this._inputPorts) {
                  const b = q.portData;
                  if (b.data === T)
                    return b;
                }
                for (const q of this._outputPorts) {
                  const b = q.portData;
                  if (b.data === T)
                    return b;
                }
                return null;
              }
              getLinksForPortDataContent(T) {
                return this._links.filter((q) => q.portA.portData.data === T || q.portB.portData.data === T);
              }
              getLinksForPortData(T) {
                return this._links.filter((q) => q.portA.portData === T || q.portB.portData === T);
              }
              _refreshFrames() {
                if (!(this._ownerCanvas._frameIsMoving || this._ownerCanvas._isLoading))
                  for (const T of this._ownerCanvas.frames)
                    T.syncNode(this);
              }
              _refreshLinks() {
                if (!this._ownerCanvas._isLoading)
                  for (const T of this._links)
                    T.update();
              }
              refresh() {
                if (this._displayManager) {
                  this._header.innerHTML = this._displayManager.getHeaderText(this.content), this._displayManager.updatePreviewContent(this.content, this._content), this._visual.style.background = this._displayManager.getBackgroundColor(this.content);
                  const T = this._displayManager.getHeaderClass(this.content);
                  this._header.classList.value = P.default.header, this._headerContainer.classList.value = P.default["header-container"], T && this._headerContainer.classList.add(T), this._displayManager.updateFullVisualContent && this._displayManager.updateFullVisualContent(this.content, {
                    visual: this._visual,
                    header: this._header,
                    headerContainer: this._headerContainer,
                    headerIcon: this._headerIcon,
                    headerIconImg: this._headerIconImg,
                    comments: this._comments,
                    connections: this._connections,
                    inputsContainer: this._inputsContainer,
                    outputsContainer: this._outputsContainer,
                    content: this._content,
                    selectionBorder: this._selectionBorder
                  });
                } else
                  this._header.innerHTML = this.content.name;
                for (const T of this._inputPorts)
                  T.refresh();
                for (const T of this._outputPorts)
                  T.refresh();
                if (this.enclosingFrameId !== -1) {
                  const T = this._ownerCanvas.frames.findIndex((q) => q.id === this.enclosingFrameId);
                  T >= 0 && this._ownerCanvas.frames[T].isCollapsed && this._ownerCanvas.frames[T].redrawFramePorts();
                }
                this._comments.innerHTML = this.content.comments || "", this._comments.title = this.content.comments || "", this._executionTime.innerHTML = this.content.executionTime ? `${this.content.executionTime.toFixed(2)} ms` : "", this.content.prepareHeaderIcon(this._headerIcon, this._headerIconImg), this._headerIconImg.src && this._header.classList.add(P.default.headerWithIcon);
              }
              _onDown(T) {
                if (T.target && T.target.nodeName === "IMG")
                  return;
                this._ownerCanvas.selectedNodes.indexOf(this) === -1 ? this._stateManager.onSelectionChangedObservable.notifyObservers({ selection: this }) : T.ctrlKey && this.setIsSelected(!1, !1), T.stopPropagation();
                for (const b of this._ownerCanvas.selectedNodes)
                  b.cleanAccumulation();
                this._mouseStartPointX = T.clientX, this._mouseStartPointY = T.clientY, this._visual.setPointerCapture(T.pointerId);
              }
              cleanAccumulation(T = !1) {
                this.x = this._ownerCanvas.getGridPosition(this.x, T), this.y = this._ownerCanvas.getGridPosition(this.y, T);
              }
              _onUp(T) {
                T.stopPropagation();
                for (const O of this._ownerCanvas.selectedNodes)
                  O.cleanAccumulation();
                if (this._mouseStartPointX = null, this._mouseStartPointY = null, this._visual.releasePointerCapture(T.pointerId), !this._ownerCanvas._targetLinkCandidate)
                  return;
                const q = [], b = [], j = [], w = [], m = this._ownerCanvas._targetLinkCandidate.nodeA, I = this._ownerCanvas._targetLinkCandidate.nodeB, N = this._ownerCanvas._targetLinkCandidate.portA.portData, k = this._ownerCanvas._targetLinkCandidate.portB.portData;
                this._ownerCanvas._targetLinkCandidate.dispose(), this._ownerCanvas._targetLinkCandidate = null, j.push(...this.content.inputs.filter((O) => !O.isConnected)), w.push(...this.content.outputs), q.push(...m.content.outputs), b.push(...I.content.inputs.filter((O) => !O.isConnected));
                const R = q.indexOf(N), y = b.indexOf(k);
                R > 0 && (q.splice(R, 1), q.splice(0, 0, N)), y > 0 && (b.splice(y, 1), b.splice(0, 0, k)), this._ownerCanvas.automaticRewire(q, j, !0), this._ownerCanvas.automaticRewire(w, b, !0), this._stateManager.onRebuildRequiredObservable.notifyObservers();
              }
              _onMove(T) {
                if (this._ownerCanvas._targetLinkCandidate = null, this._mouseStartPointX === null || this._mouseStartPointY === null || T.ctrlKey)
                  return;
                const q = (T.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom, b = (T.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
                for (const w of this._ownerCanvas.selectedNodes)
                  w.x += q, w.y += b;
                for (const w of this._ownerCanvas.selectedFrames)
                  w._moveFrame(q, b);
                if (this._mouseStartPointX = T.clientX, this._mouseStartPointY = T.clientY, T.stopPropagation(), this._inputPorts.some((w) => w.portData.isConnected) || this._outputPorts.some((w) => w.portData.hasEndpoints))
                  return;
                const j = this._visual.getBoundingClientRect();
                for (const w of this._ownerCanvas.links) {
                  if (w.portA.node === this || w.portB.node === this) {
                    w.isTargetCandidate = !1;
                    continue;
                  }
                  w.isTargetCandidate = w.intersectsWith(j), w.isTargetCandidate && this._ownerCanvas._targetLinkCandidate !== w && (this._ownerCanvas._targetLinkCandidate && (this._ownerCanvas._targetLinkCandidate.isTargetCandidate = !1), this._ownerCanvas._targetLinkCandidate = w);
                }
              }
              renderProperties() {
                let T = u.PropertyLedger.RegisteredControls[this.content.getClassName()];
                return T || (T = u.PropertyLedger.DefaultControl), d.createElement(T, {
                  stateManager: this._stateManager,
                  nodeData: this.content
                });
              }
              appendVisual(T, q) {
                this._ownerCanvas = q;
                const b = l.DisplayLedger.RegisteredControls[this.content.getClassName()];
                b && (this._displayManager = new b()), this._visual = T.ownerDocument.createElement("div"), this._visual.classList.add(P.default.visual), this._visual.addEventListener("pointerdown", (j) => this._onDown(j)), this._visual.addEventListener("pointerup", (j) => this._onUp(j)), this._visual.addEventListener("pointermove", (j) => this._onMove(j)), this._headerContainer = T.ownerDocument.createElement("div"), this._headerContainer.classList.add(P.default["header-container"]), this._visual.appendChild(this._headerContainer), this._header = T.ownerDocument.createElement("div"), this._header.classList.add(P.default.header), this._headerContainer.appendChild(this._header), this._headerIcon = T.ownerDocument.createElement("div"), this._headerIcon.classList.add(P.default.headerIcon), this._headerIconImg = T.ownerDocument.createElement("img"), this._headerIcon.appendChild(this._headerIconImg), this._headerContainer.appendChild(this._headerIcon), this._selectionBorder = T.ownerDocument.createElement("div"), this._selectionBorder.classList.add("selection-border"), this._visual.appendChild(this._selectionBorder), this._connections = T.ownerDocument.createElement("div"), this._connections.classList.add(P.default.connections), this._visual.appendChild(this._connections), this._inputsContainer = T.ownerDocument.createElement("div"), this._inputsContainer.classList.add(p.default.inputsContainer), this._connections.appendChild(this._inputsContainer), this._outputsContainer = T.ownerDocument.createElement("div"), this._outputsContainer.classList.add(p.default.outputsContainer), this._connections.appendChild(this._outputsContainer), this._content = T.ownerDocument.createElement("div"), this._content.classList.add(P.default.content), this._visual.appendChild(this._content), T.appendChild(this._visual), this._comments = T.ownerDocument.createElement("div"), this._comments.classList.add(P.default.comments), this._visual.appendChild(this._comments), this._executionTime = T.ownerDocument.createElement("div"), this._executionTime.classList.add(P.default.executionTime), this._visual.appendChild(this._executionTime);
                for (const j of this.content.inputs)
                  this._inputPorts.push(v.NodePort.CreatePortElement(j, this, this._inputsContainer, this._displayManager, this._stateManager));
                for (const j of this.content.outputs)
                  this._outputPorts.push(v.NodePort.CreatePortElement(j, this, this._outputsContainer, this._displayManager, this._stateManager));
                this.refresh(), this.content.refreshCallback = () => {
                  this.refresh();
                };
              }
              dispose() {
                this._displayManager && this._displayManager.onDispose && this._displayManager.onDispose(this.content, this._stateManager), this._stateManager.onGraphNodeRemovalObservable.notifyObservers(this), this._onSelectionChangedObserver && this._stateManager.onSelectionChangedObservable.remove(this._onSelectionChangedObserver), this._onUpdateRequiredObserver && this._stateManager.onUpdateRequiredObservable.remove(this._onUpdateRequiredObserver), this._onHighlightNodeObserver && this._stateManager.onHighlightNodeObservable.remove(this._onHighlightNodeObserver), this._onSelectionBoxMovedObserver && this._stateManager.onSelectionBoxMoved.remove(this._onSelectionBoxMovedObserver), this._visual.parentElement && this._visual.parentElement.removeChild(this._visual), this._onFrameCreatedObserver && this._stateManager.onFrameCreatedObservable.remove(this._onFrameCreatedObserver);
                for (const q of this._inputPorts)
                  q.dispose();
                for (const q of this._outputPorts)
                  q.dispose();
                const T = this._links.slice(0);
                for (const q of T)
                  q.dispose();
                this.content.dispose();
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/interfaces/portData.js": (
          /*!***********************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/interfaces/portData.js ***!
            \***********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              PortDataDirection: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var d;
            (function(v) {
              v[v.Input = 0] = "Input", v[v.Output = 1] = "Output";
            })(d || (d = {}));
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLedger.js": (
          /*!**************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLedger.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              NodeLedger: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            class d {
            }
            d.RegisteredNodeNames = [], d.NameFormatter = (v) => v;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLink.js": (
          /*!************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLink.js ***!
            \************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              NodeLink: () => (
                /* binding */
                P
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Misc/observable */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ./tools */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/tools.js"
            ), u = o(
              /*! ./common.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss"
            ), l = o(
              /*! ./nodeLink.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLink.modules.scss"
            );
            class P {
              get isTargetCandidate() {
                return this._isTargetCandidate;
              }
              set isTargetCandidate(c) {
                this._isTargetCandidate !== c && (this._isTargetCandidate = c, c ? this._path.classList.add(l.default["target-candidate"]) : this._path.classList.remove(l.default["target-candidate"]));
              }
              get isVisible() {
                return this._isVisible;
              }
              set isVisible(c) {
                this._isVisible = c, c ? (this._path.classList.remove(u.default.hidden), this._selectionPath.classList.remove(u.default.hidden)) : (this._path.classList.add(u.default.hidden), this._selectionPath.classList.add(u.default.hidden)), this.update();
              }
              get portA() {
                return this._portA;
              }
              get portB() {
                return this._portB;
              }
              get nodeA() {
                return this._nodeA;
              }
              get nodeB() {
                return this._nodeB;
              }
              intersectsWith(c) {
                const H = this._path.getBoundingClientRect();
                if (c.left > H.right || c.right < H.left || c.top > H.bottom || c.bottom < H.top)
                  return !1;
                const T = this._graphCanvas.zoom, b = this._graphCanvas.svgCanvas.getBoundingClientRect(), j = (c.x - b.x) / T, w = (c.y - b.y) / T, m = j + c.width / T, I = w + c.height / T, N = 10;
                for (let k = 0; k < 1; k += 1 / N) {
                  const R = this._path.getPointAtLength(k * this._path.getTotalLength());
                  if (j < R.x && m > R.x && w < R.y && I > R.y)
                    return !0;
                }
                return !1;
              }
              update(c = 0, H = 0, T = !1) {
                const q = this._portA.element.getBoundingClientRect(), b = this._graphCanvas.canvasContainer.getBoundingClientRect(), j = this._graphCanvas.zoom, w = b.left, m = b.top, I = (q.left - w + 0.5 * q.width) / j, N = (q.top - m + 0.5 * q.height) / j;
                if (this._portB) {
                  const k = this._portB.element.getBoundingClientRect();
                  c = (k.left - w + 0.5 * k.width) / j, H = (k.top - m + 0.5 * k.height) / j;
                }
                if (T)
                  this._path.setAttribute("d", `M${I},${N} L${c},${H}`), this._path.setAttribute("stroke-dasharray", "10, 10"), this._path.setAttribute("stroke-linecap", "round");
                else {
                  const k = c - I, R = H - N, y = Math.min(Math.sqrt(k * k + R * R) * 0.5, 300);
                  this._path.setAttribute("d", `M${I},${N} C${I + y},${N} ${c - y},${H} ${c},${H}`), this._selectionPath.setAttribute("d", `M${I},${N} C${I + y},${N} ${c - y},${H} ${c},${H}`);
                }
                this._path.setAttribute("stroke", this._portA.element.style.backgroundColor);
              }
              constructor(c, H, T, q, b) {
                this._isVisible = !0, this._isTargetCandidate = !1, this.onDisposedObservable = new d.Observable(), this._portA = H, this._portB = q, this._nodeA = T, this._nodeB = b, this._graphCanvas = c;
                const j = H.element.ownerDocument, w = c.svgCanvas;
                this._path = j.createElementNS("http://www.w3.org/2000/svg", "path"), this._path.setAttribute("fill", "none"), this._path.classList.add(l.default.link), w.appendChild(this._path), this._selectionPath = j.createElementNS("http://www.w3.org/2000/svg", "path"), this._selectionPath.setAttribute("fill", "none"), this._selectionPath.classList.add(l.default["selection-link"]), w.appendChild(this._selectionPath), this._selectionPath.onmousedown = (m) => this.onClick(m), this._portB && this.update(), this._onSelectionChangedObserver = this._graphCanvas.stateManager.onSelectionChangedObservable.add((m) => {
                  const { selection: I } = m || {};
                  I === this ? (this._path.classList.add(l.default.selected), this._selectionPath.classList.add(l.default.selected)) : (this._path.classList.remove(l.default.selected), this._selectionPath.classList.remove(l.default.selected));
                });
              }
              onClick(c) {
                const H = this._graphCanvas.stateManager, T = this._nodeA, q = this._portA.portData, b = this._nodeB, j = this._portB.portData, w = (m) => {
                  const I = m.content.data;
                  this.dispose(), this._graphCanvas.connectNodes(T, q, m, m.getPortDataForPortDataContent(I.input)), this._graphCanvas.connectNodes(m, m.getPortDataForPortDataContent(I.output), b, j), H.onRebuildRequiredObservable.notifyObservers();
                };
                if (c.altKey) {
                  if (!H.isElbowConnectionAllowed(this._portA, this._portB))
                    return;
                  H.onNewNodeCreatedObservable.addOnce(w), H.onNewBlockRequiredObservable.notifyObservers({
                    type: "ElbowBlock",
                    targetX: c.clientX,
                    targetY: c.clientY,
                    needRepositioning: !0
                  });
                  return;
                }
                if (c.ctrlKey) {
                  if (!H.isDebugConnectionAllowed(this._portA, this._portB))
                    return;
                  H.onNewNodeCreatedObservable.addOnce(w), H.onNewBlockRequiredObservable.notifyObservers({
                    type: "DebugBlock",
                    targetX: c.clientX,
                    targetY: c.clientY,
                    needRepositioning: !0
                  });
                  return;
                }
                H.onSelectionChangedObservable.notifyObservers({ selection: this });
              }
              dispose(c = !0) {
                this._graphCanvas.stateManager.onSelectionChangedObservable.remove(this._onSelectionChangedObserver), this._path.parentElement && this._path.parentElement.removeChild(this._path), this._selectionPath.parentElement && this._selectionPath.parentElement.removeChild(this._selectionPath), this._nodeB && (this._nodeA.links.splice(this._nodeA.links.indexOf(this), 1), this._nodeB.links.splice(this._nodeB.links.indexOf(this), 1), this._graphCanvas.links.splice(this._graphCanvas.links.indexOf(this), 1), this._portA.portData.disconnectFrom(this._portB.portData), (0, v.RefreshNode)(this._nodeB, void 0, void 0, this._graphCanvas)), c && (this.onDisposedObservable.notifyObservers(this), this.onDisposedObservable.clear());
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.js": (
          /*!************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.js ***!
            \************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              NodePort: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! ./common.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss"
            ), v = o(
              /*! ./nodePort.modules.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.modules.scss"
            );
            class u {
              get element() {
                return this.delegatedPort ? this.delegatedPort.element : this._element;
              }
              get portName() {
                return this.portData.name;
              }
              set portName(P) {
                this._portLabelElement && (this.portData.updateDisplayName(P), this._portLabelElement.innerHTML = P);
              }
              get disabled() {
                if (this.portData.isConnected) {
                  if (this._isConnectedToNodeOutsideOfFrame())
                    return !0;
                  {
                    const P = this.node.getLinksForPortData(this.portData);
                    if (P.length && P[0].nodeB === this.node)
                      return !0;
                  }
                } else
                  return !1;
                return !1;
              }
              hasLabel() {
                return !!this._portLabelElement;
              }
              get exposedOnFrame() {
                return !!(this.portData.isExposedOnFrame || this._isConnectedToNodeOutsideOfFrame());
              }
              set exposedOnFrame(P) {
                this.disabled || (this.portData.isExposedOnFrame = P);
              }
              get exposedPortPosition() {
                return this.portData.exposedPortPosition;
              }
              set exposedPortPosition(P) {
                this.portData.exposedPortPosition = P;
              }
              _isConnectedToNodeOutsideOfFrame() {
                const P = this.node.getLinksForPortData(this.portData);
                if (P.length) {
                  for (let p = 0; p < P.length; p++)
                    if (P[p].nodeA.enclosingFrameId !== P[p].nodeB.enclosingFrameId)
                      return !0;
                }
                return !1;
              }
              refresh() {
                this._stateManager.applyNodePortDesign(this.portData, this._element, this._img, this._pip);
              }
              constructor(P, p, c, H) {
                this.portData = p, this.node = c, this.delegatedPort = null, this._element = P.ownerDocument.createElement("div"), this._element.classList.add(d.default.port), P.appendChild(this._element), this._stateManager = H, this._img = P.ownerDocument.createElement("img"), this._element.appendChild(this._img), this._pip = P.ownerDocument.createElement("div"), this._pip.classList.add(v.default.pip), this._pip.style.display = "none", this._element.appendChild(this._pip), P.children[0].className === d.default["port-label"] && (this._portLabelElement = P.children[0]), this._element.port = this, this._element.ondragstart = () => !1, this._onCandidateLinkMovedObserver = H.onCandidateLinkMoved.add((T) => {
                  const q = this._element.getBoundingClientRect();
                  if (!T || q.left > T.x || q.right < T.x || q.top > T.y || q.bottom < T.y) {
                    this._element.classList.remove(v.default.selected);
                    return;
                  }
                  this._element.classList.add(v.default.selected), this._stateManager.onCandidatePortSelectedObservable.notifyObservers(this);
                }), this._onSelectionChangedObserver = this._stateManager.onSelectionChangedObservable.add((T) => {
                  const { selection: q } = T || {};
                  q === this ? this._img.classList.add(v.default.selected) : this._img.classList.remove(v.default.selected);
                }), this.refresh();
              }
              dispose() {
                this._stateManager.onCandidateLinkMoved.remove(this._onCandidateLinkMovedObserver), this._onSelectionChangedObserver && this._stateManager.onSelectionChangedObservable.remove(this._onSelectionChangedObserver);
              }
              static CreatePortElement(P, p, c, H, T) {
                const q = c.ownerDocument.createElement("div");
                if (q.classList.add(d.default.portLine), c.appendChild(q), !H || H.shouldDisplayPortLabels(P)) {
                  const b = c.ownerDocument.createElement("div");
                  b.classList.add(d.default["port-label"]), b.innerHTML = P.name, q.appendChild(b);
                }
                return new u(q, P, p, T);
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/propertyLedger.js": (
          /*!******************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/propertyLedger.js ***!
            \******************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              PropertyLedger: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            class d {
            }
            d.RegisteredControls = {};
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/searchBox.js": (
          /*!*************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/searchBox.js ***!
            \*************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              SearchBoxComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            o(
              /*! ./searchBox.scss */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/searchBox.scss"
            );
            var u = o(
              /*! ./nodeLedger */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLedger.js"
            );
            class l extends v.Component {
              constructor(p) {
                super(p), this.state = { isVisible: !1, filter: "", selectedIndex: 0 }, this._handleEscKey = (c) => {
                  c.key === "Escape" && this.hide();
                }, this.props.stateManager.onSearchBoxRequiredObservable.add((c) => {
                  this._targetX = c.x, this._targetY = c.y, this.setState({ isVisible: !0, filter: "", selectedIndex: 0 }), this.props.stateManager.hostDocument.addEventListener("keydown", this._handleEscKey);
                });
              }
              hide() {
                this.setState({ isVisible: !1 }), this.props.stateManager.modalIsDisplayed = !1, this.props.stateManager.hostDocument.removeEventListener("keydown", this._handleEscKey);
              }
              onFilterChange(p) {
                this.setState({ filter: p.target.value });
              }
              onNewNodeRequested(p) {
                this.props.stateManager.onNewBlockRequiredObservable.notifyObservers({
                  type: p,
                  targetX: this._targetX,
                  targetY: this._targetY,
                  needRepositioning: !0,
                  smartAdd: !0
                }), this.hide();
              }
              onKeyDown(p) {
                if (p.code === "Enter" && this._nodes.length > 0) {
                  this.onNewNodeRequested(this._nodes[this.state.selectedIndex]);
                  return;
                }
                if (p.code === "ArrowDown" && this._nodes.length > 0) {
                  this.setState({ selectedIndex: Math.min(this.state.selectedIndex + 1, this._nodes.length - 1) });
                  return;
                }
                if (p.code === "ArrowUp" && this._nodes.length > 0) {
                  this.setState({ selectedIndex: Math.max(this.state.selectedIndex - 1, 0) });
                  return;
                }
              }
              render() {
                if (!this.state.isVisible)
                  return null;
                const p = 300, c = 400;
                if (this._nodes = Array.from(new Set(u.NodeLedger.RegisteredNodeNames.sort())), this.state.filter) {
                  const j = this.state.filter.toLowerCase().trim();
                  this._nodes = this._nodes.filter((w) => u.NodeLedger.NameFormatter(w).toLowerCase().includes(j));
                }
                const H = this.props.stateManager.hostDocument.getElementById("graph-canvas").getBoundingClientRect(), T = this._targetX - (p / 2 + H.x), q = this._targetY - (c / 2 + H.y), b = {
                  left: T + "px",
                  top: q + "px"
                };
                return T + p > H.width ? b.left = H.width - p - 10 + "px" : T < 10 && (b.left = "10px"), q + c > H.height ? b.top = H.height - c - 10 + "px" : q < 10 && (b.top = "10px"), (0, d.jsxs)("div", { id: "graph-search-container", children: [(0, d.jsx)("div", { id: "graph-search-picking-blocker", onClick: () => this.hide() }), (0, d.jsxs)("div", { id: "graph-search-box", style: b, children: [(0, d.jsx)("div", { className: "graph-search-box-title", children: "Add a node" }), (0, d.jsx)("input", { type: "text", placeholder: "Search...", onChange: (j) => this.onFilterChange(j), onKeyDown: (j) => this.onKeyDown(j), value: this.state.filter, className: "graph-search-box-filter", autoFocus: !0, tabIndex: 0 }), (0, d.jsx)("div", { className: "graph-search-box-list", children: this._nodes.map((j, w) => (0, d.jsx)("div", { className: "graph-search-box-list-item " + (this.state.selectedIndex === w ? "selected " : ""), onClick: () => this.onNewNodeRequested(j), children: u.NodeLedger.NameFormatter(j) }, j)) })] })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/stateManager.js": (
          /*!****************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/stateManager.js ***!
            \****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              StateManager: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Misc/observable */
              "core/Misc/dataStorage"
            );
            class v {
              constructor() {
                this.onSearchBoxRequiredObservable = new d.Observable(), this.onSelectionChangedObservable = new d.Observable(), this.onFrameCreatedObservable = new d.Observable(), this.onUpdateRequiredObservable = new d.Observable(), this.onGraphNodeRemovalObservable = new d.Observable(), this.onSelectionBoxMoved = new d.Observable(), this.onCandidateLinkMoved = new d.Observable(), this.onCandidatePortSelectedObservable = new d.Observable(), this.onNewNodeCreatedObservable = new d.Observable(), this.onRebuildRequiredObservable = new d.Observable(), this.onErrorMessageDialogRequiredObservable = new d.Observable(), this.onExposePortOnFrameObservable = new d.Observable(), this.onGridSizeChanged = new d.Observable(), this.onNewBlockRequiredObservable = new d.Observable(), this.onHighlightNodeObservable = new d.Observable();
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/tools.js": (
          /*!*********************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/tools.js ***!
            \*********************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              IsFramePortData: () => (
                /* binding */
                d
              ),
              /* harmony export */
              RefreshNode: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            const d = (u) => u ? u.port !== void 0 : !1, v = (u, l, P, p) => {
              u.refresh();
              const c = u.links;
              l && c.forEach((T) => {
                const q = T.nodeA, b = T.nodeB;
                l.has(q) || (l.add(q), v(q, l, P)), b && !l.has(b) && (l.add(b), v(b, l, P));
              });
              const H = u.content.invisibleEndpoints;
              if (H && H.length)
                for (const T of H) {
                  const q = p == null ? void 0 : p.findNodeFromData(T);
                  q && (l && l.add(q), v(q, l, P));
                }
              P && c.forEach((T) => {
                P.has(T) || (P.add(T), T.update());
              });
            };
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/typeLedger.js": (
          /*!**************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/typeLedger.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TypeLedger: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            class d {
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/stringTools.js": (
          /*!***********************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/stringTools.js ***!
            \***********************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              StringTools: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            class d {
              /*
               * Based on FileSaver.js
               * A saveAs() FileSaver implementation.
               *
               * By Eli Grey, http://eligrey.com
               *
               * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)
               * source  : http://purl.eligrey.com/github/FileSaver.js
               */
              static _SaveAs(u, l, P) {
                if ("download" in HTMLAnchorElement.prototype) {
                  const q = window.URL || window.webkitURL, b = P.createElement("a");
                  b.download = l, b.rel = "noopener", b.href = q.createObjectURL(u), setTimeout(() => {
                    q.revokeObjectURL(b.href);
                  }, 4e4), setTimeout(() => {
                    this._Click(b, P);
                  }, 0);
                  return;
                }
                let p = open("", "_blank");
                p && (p.document.title = p.document.body.innerText = "downloading...");
                const c = u.type === "application/octet-stream", H = /constructor/i.test(window.HTMLElement) || window.safari, T = /CriOS\/[\d]+/.test(navigator.userAgent);
                if ((T || c && H) && typeof FileReader < "u") {
                  const q = new FileReader();
                  q.onloadend = () => {
                    let b = q.result;
                    b = T ? b : b.replace(/^data:[^;]*;/, "data:attachment/file;"), p ? p.location.href = b : location = b, p = null;
                  }, q.readAsDataURL(u);
                } else {
                  const q = window.URL || window.webkitURL, b = q.createObjectURL(u);
                  p ? p.location.href = b : location.href = b, p = null, setTimeout(function() {
                    q.revokeObjectURL(b);
                  }, 4e4);
                }
              }
              static _Click(u, l) {
                try {
                  u.dispatchEvent(new MouseEvent("click"));
                } catch {
                  const p = l.createEvent("MouseEvents");
                  p.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), u.dispatchEvent(p);
                }
              }
              /**
               * Download a string into a file that will be saved locally by the browser
               * @param document
               * @param content defines the string to download locally as a file
               * @param filename
               */
              static DownloadAsFile(u, l, P) {
                const p = new Blob([l], {
                  type: "application/octet-stream"
                });
                this._SaveAs(p, P, u);
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js": (
          /*!*****************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js ***!
            \*****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              LockObject: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            class d {
              constructor() {
                this.lock = !1;
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/blockTools.js": (
          /*!****************************************************!*\
            !*** ../../../tools/nodeEditor/dist/blockTools.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              BlockTools: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Blocks/Teleport/teleportOutBlock */
              "core/Misc/dataStorage"
            );
            class v {
              static GetBlockFromString(l, P, p) {
                switch (l) {
                  case "TeleportInBlock":
                    return new d.NodeMaterialTeleportInBlock("Teleport In");
                  case "TeleportOutBlock":
                    return new d.NodeMaterialTeleportOutBlock("Teleport Out");
                  case "HeightToNormalBlock":
                    return new d.HeightToNormalBlock("HeightToNormal");
                  case "ElbowBlock":
                    return new d.ElbowBlock("");
                  case "TwirlBlock":
                    return new d.TwirlBlock("Twirl");
                  case "VoronoiNoiseBlock":
                    return new d.VoronoiNoiseBlock("VoronoiNoise");
                  case "ScreenSpaceBlock":
                    return new d.ScreenSpaceBlock("ScreenSpace");
                  case "CloudBlock":
                    return new d.CloudBlock("Cloud");
                  case "MatrixBuilderBlock":
                    return new d.MatrixBuilderBlock("MatrixBuilder");
                  case "DesaturateBlock":
                    return new d.DesaturateBlock("Desaturate");
                  case "RefractBlock":
                    return new d.RefractBlock("Refract");
                  case "ReflectBlock":
                    return new d.ReflectBlock("Reflect");
                  case "DerivativeBlock":
                    return new d.DerivativeBlock("Derivative");
                  case "Rotate2dBlock":
                    return new d.Rotate2dBlock("Rotate2d");
                  case "NormalBlendBlock":
                    return new d.NormalBlendBlock("NormalBlend");
                  case "WorleyNoise3DBlock":
                    return new d.WorleyNoise3DBlock("WorleyNoise3D");
                  case "SimplexPerlin3DBlock":
                    return new d.SimplexPerlin3DBlock("SimplexPerlin3D");
                  case "BonesBlock":
                    return new d.BonesBlock("Bones");
                  case "InstancesBlock":
                    return new d.InstancesBlock("Instances");
                  case "MorphTargetsBlock":
                    return new d.MorphTargetsBlock("MorphTargets");
                  case "DiscardBlock":
                    return new d.DiscardBlock("Discard");
                  case "PrePassTextureBlock":
                    return new d.PrePassTextureBlock("PrePassTexture");
                  case "ImageProcessingBlock":
                    return new d.ImageProcessingBlock("ImageProcessing");
                  case "ColorMergerBlock":
                    return new d.ColorMergerBlock("ColorMerger");
                  case "VectorMergerBlock":
                    return new d.VectorMergerBlock("VectorMerger");
                  case "ColorSplitterBlock":
                    return new d.ColorSplitterBlock("ColorSplitter");
                  case "VectorSplitterBlock":
                    return new d.VectorSplitterBlock("VectorSplitter");
                  case "TextureBlock":
                    return new d.TextureBlock("Texture", p.mode === d.NodeMaterialModes.Particle);
                  case "ReflectionTextureBlock":
                    return new d.ReflectionTextureBlock("Reflection texture");
                  case "LightBlock":
                    return new d.LightBlock("Lights");
                  case "FogBlock":
                    return new d.FogBlock("Fog");
                  case "VertexOutputBlock":
                    return new d.VertexOutputBlock("VertexOutput");
                  case "FragmentOutputBlock":
                    return new d.FragmentOutputBlock("FragmentOutput");
                  case "PrePassOutputBlock":
                    return new d.PrePassOutputBlock("PrePassOutput");
                  case "AddBlock":
                    return new d.AddBlock("Add");
                  case "ClampBlock":
                    return new d.ClampBlock("Clamp");
                  case "ScaleBlock":
                    return new d.ScaleBlock("Scale");
                  case "CrossBlock":
                    return new d.CrossBlock("Cross");
                  case "DotBlock":
                    return new d.DotBlock("Dot");
                  case "PowBlock":
                    return new d.PowBlock("Pow");
                  case "MultiplyBlock":
                    return new d.MultiplyBlock("Multiply");
                  case "TransformBlock":
                    return new d.TransformBlock("Transform");
                  case "TrigonometryBlock":
                    return new d.TrigonometryBlock("Trigonometry");
                  case "RemapBlock":
                    return new d.RemapBlock("Remap");
                  case "NormalizeBlock":
                    return new d.NormalizeBlock("Normalize");
                  case "FresnelBlock":
                    return new d.FresnelBlock("Fresnel");
                  case "LerpBlock":
                    return new d.LerpBlock("Lerp");
                  case "NLerpBlock":
                    return new d.NLerpBlock("NLerp");
                  case "DivideBlock":
                    return new d.DivideBlock("Divide");
                  case "SubtractBlock":
                    return new d.SubtractBlock("Subtract");
                  case "ModBlock":
                    return new d.ModBlock("Mod");
                  case "StepBlock":
                    return new d.StepBlock("Step");
                  case "SmoothStepBlock":
                    return new d.SmoothStepBlock("Smooth step");
                  case "OneMinusBlock":
                    return new d.OneMinusBlock("One minus");
                  case "ReciprocalBlock":
                    return new d.ReciprocalBlock("Reciprocal");
                  case "ViewDirectionBlock":
                    return new d.ViewDirectionBlock("View direction");
                  case "LightInformationBlock": {
                    const c = new d.LightInformationBlock("Light information");
                    return c.light = P.lights.length ? P.lights[0] : null, c;
                  }
                  case "MaxBlock":
                    return new d.MaxBlock("Max");
                  case "MinBlock":
                    return new d.MinBlock("Min");
                  case "LengthBlock":
                    return new d.LengthBlock("Length");
                  case "DistanceBlock":
                    return new d.DistanceBlock("Distance");
                  case "NegateBlock":
                    return new d.NegateBlock("Negate");
                  case "PerturbNormalBlock":
                    return new d.PerturbNormalBlock("Perturb normal");
                  case "TBNBlock":
                    return new d.TBNBlock("TBN");
                  case "RandomNumberBlock":
                    return new d.RandomNumberBlock("Random number");
                  case "ReplaceColorBlock":
                    return new d.ReplaceColorBlock("Replace color");
                  case "PosterizeBlock":
                    return new d.PosterizeBlock("Posterize");
                  case "ArcTan2Block":
                    return new d.ArcTan2Block("ArcTan2");
                  case "GradientBlock":
                    return new d.GradientBlock("Gradient");
                  case "FrontFacingBlock":
                    return new d.FrontFacingBlock("Front facing");
                  case "MeshAttributeExistsBlock":
                    return new d.MeshAttributeExistsBlock("Attribute exists");
                  case "CosBlock": {
                    const c = new d.TrigonometryBlock("Cos");
                    return c.operation = d.TrigonometryBlockOperations.Cos, c;
                  }
                  case "SinBlock": {
                    const c = new d.TrigonometryBlock("Sin");
                    return c.operation = d.TrigonometryBlockOperations.Sin, c;
                  }
                  case "AbsBlock": {
                    const c = new d.TrigonometryBlock("Abs");
                    return c.operation = d.TrigonometryBlockOperations.Abs, c;
                  }
                  case "SqrtBlock": {
                    const c = new d.TrigonometryBlock("Sqrt");
                    return c.operation = d.TrigonometryBlockOperations.Sqrt, c;
                  }
                  case "ArcCosBlock": {
                    const c = new d.TrigonometryBlock("ArcCos");
                    return c.operation = d.TrigonometryBlockOperations.ArcCos, c;
                  }
                  case "ArcSinBlock": {
                    const c = new d.TrigonometryBlock("ArcSin");
                    return c.operation = d.TrigonometryBlockOperations.ArcSin, c;
                  }
                  case "TanBlock": {
                    const c = new d.TrigonometryBlock("Tan");
                    return c.operation = d.TrigonometryBlockOperations.Tan, c;
                  }
                  case "ArcTanBlock": {
                    const c = new d.TrigonometryBlock("ArcTan");
                    return c.operation = d.TrigonometryBlockOperations.ArcTan, c;
                  }
                  case "FractBlock": {
                    const c = new d.TrigonometryBlock("Fract");
                    return c.operation = d.TrigonometryBlockOperations.Fract, c;
                  }
                  case "SignBlock": {
                    const c = new d.TrigonometryBlock("Sign");
                    return c.operation = d.TrigonometryBlockOperations.Sign, c;
                  }
                  case "LogBlock": {
                    const c = new d.TrigonometryBlock("Log");
                    return c.operation = d.TrigonometryBlockOperations.Log, c;
                  }
                  case "ExpBlock": {
                    const c = new d.TrigonometryBlock("Exp");
                    return c.operation = d.TrigonometryBlockOperations.Exp, c;
                  }
                  case "Exp2Block": {
                    const c = new d.TrigonometryBlock("Exp2");
                    return c.operation = d.TrigonometryBlockOperations.Exp2, c;
                  }
                  case "DegreesToRadiansBlock": {
                    const c = new d.TrigonometryBlock("Degrees to radians");
                    return c.operation = d.TrigonometryBlockOperations.Radians, c;
                  }
                  case "RadiansToDegreesBlock": {
                    const c = new d.TrigonometryBlock("Radians to degrees");
                    return c.operation = d.TrigonometryBlockOperations.Degrees, c;
                  }
                  case "RoundBlock": {
                    const c = new d.TrigonometryBlock("Round");
                    return c.operation = d.TrigonometryBlockOperations.Round, c;
                  }
                  case "CeilingBlock": {
                    const c = new d.TrigonometryBlock("Ceiling");
                    return c.operation = d.TrigonometryBlockOperations.Ceiling, c;
                  }
                  case "FloorBlock": {
                    const c = new d.TrigonometryBlock("Floor");
                    return c.operation = d.TrigonometryBlockOperations.Floor, c;
                  }
                  case "SawToothWaveBlock": {
                    const c = new d.WaveBlock("SawTooth wave");
                    return c.kind = d.WaveBlockKind.SawTooth, c;
                  }
                  case "SquareWaveBlock": {
                    const c = new d.WaveBlock("Square wave");
                    return c.kind = d.WaveBlockKind.Square, c;
                  }
                  case "TriangleWaveBlock": {
                    const c = new d.WaveBlock("Triangle wave");
                    return c.kind = d.WaveBlockKind.Triangle, c;
                  }
                  case "WorldMatrixBlock": {
                    const c = new d.InputBlock("World");
                    return c.setAsSystemValue(d.NodeMaterialSystemValues.World), c;
                  }
                  case "WorldViewMatrixBlock": {
                    const c = new d.InputBlock("World x View");
                    return c.setAsSystemValue(d.NodeMaterialSystemValues.WorldView), c;
                  }
                  case "WorldViewProjectionMatrixBlock": {
                    const c = new d.InputBlock("World x View x Projection");
                    return c.setAsSystemValue(d.NodeMaterialSystemValues.WorldViewProjection), c;
                  }
                  case "ViewMatrixBlock": {
                    const c = new d.InputBlock("View");
                    return c.setAsSystemValue(d.NodeMaterialSystemValues.View), c;
                  }
                  case "ViewProjectionMatrixBlock": {
                    const c = new d.InputBlock("View x Projection");
                    return c.setAsSystemValue(d.NodeMaterialSystemValues.ViewProjection), c;
                  }
                  case "ProjectionMatrixBlock": {
                    const c = new d.InputBlock("Projection");
                    return c.setAsSystemValue(d.NodeMaterialSystemValues.Projection), c;
                  }
                  case "CameraPositionBlock": {
                    const c = new d.InputBlock("Camera position");
                    return c.setAsSystemValue(d.NodeMaterialSystemValues.CameraPosition), c;
                  }
                  case "CameraParametersBlock": {
                    const c = new d.InputBlock("Camera parameters");
                    c.setAsSystemValue(d.NodeMaterialSystemValues.CameraParameters);
                    const H = new d.VectorSplitterBlock("Vector splitter");
                    return c.connectTo(H), H;
                  }
                  case "FogColorBlock": {
                    const c = new d.InputBlock("Fog color");
                    return c.setAsSystemValue(d.NodeMaterialSystemValues.FogColor), c;
                  }
                  case "PositionBlock": {
                    const c = new d.InputBlock("position");
                    return c.setAsAttribute("position"), c;
                  }
                  case "ScreenPositionBlock": {
                    const c = new d.InputBlock("position");
                    return c.setAsAttribute("position2d"), c;
                  }
                  case "UVBlock": {
                    const c = new d.InputBlock("uv");
                    return c.setAsAttribute("uv"), c;
                  }
                  case "ColorBlock": {
                    const c = new d.InputBlock("color");
                    return c.setAsAttribute("color"), c;
                  }
                  case "InstanceColorBlock": {
                    const c = new d.InputBlock("Instance Color");
                    return c.setAsAttribute("instanceColor"), c;
                  }
                  case "NormalBlock": {
                    const c = new d.InputBlock("normal");
                    return c.setAsAttribute("normal"), c;
                  }
                  case "TangentBlock": {
                    const c = new d.InputBlock("tangent");
                    return c.setAsAttribute("tangent"), c;
                  }
                  case "MatrixIndicesBlock": {
                    const c = new d.InputBlock("matricesIndices");
                    return c.setAsAttribute("matricesIndices"), c;
                  }
                  case "MatrixWeightsBlock": {
                    const c = new d.InputBlock("matricesWeights");
                    return c.setAsAttribute("matricesWeights"), c;
                  }
                  case "MatrixIndicesExtraBlock": {
                    const c = new d.InputBlock("matricesIndicesExtra");
                    return c.setAsAttribute("matricesIndicesExtra"), c;
                  }
                  case "MatrixWeightsExtraBlock": {
                    const c = new d.InputBlock("matricesWeightsExtra");
                    return c.setAsAttribute("matricesWeightsExtra"), c;
                  }
                  case "TimeBlock": {
                    const c = new d.InputBlock("Time", void 0, d.NodeMaterialBlockConnectionPointTypes.Float);
                    return c.animationType = d.AnimatedInputBlockTypes.Time, c;
                  }
                  case "RealTimeBlock": {
                    const c = new d.InputBlock("RealTime", void 0, d.NodeMaterialBlockConnectionPointTypes.Float);
                    return c.animationType = d.AnimatedInputBlockTypes.RealTime, c;
                  }
                  case "DeltaTimeBlock": {
                    const c = new d.InputBlock("Delta time");
                    return c.setAsSystemValue(d.NodeMaterialSystemValues.DeltaTime), c;
                  }
                  case "MaterialAlphaBlock": {
                    const c = new d.InputBlock("Material alpha");
                    return c.setAsSystemValue(d.NodeMaterialSystemValues.MaterialAlpha), c;
                  }
                  case "WorldPositionBlock": {
                    let c = p.getInputBlockByPredicate((q) => q.isAttribute && q.name === "position");
                    c || (c = new d.InputBlock("position"), c.setAsAttribute("position"));
                    let H = p.getInputBlockByPredicate((q) => q.isSystemValue && q.systemValue === d.NodeMaterialSystemValues.World);
                    H || (H = new d.InputBlock("World"), H.setAsSystemValue(d.NodeMaterialSystemValues.World));
                    const T = new d.TransformBlock("World position");
                    return c.connectTo(T), H.connectTo(T), T;
                  }
                  case "WorldNormalBlock": {
                    let c = p.getInputBlockByPredicate((q) => q.isAttribute && q.name === "normal");
                    c || (c = new d.InputBlock("normal"), c.setAsAttribute("normal"));
                    let H = p.getInputBlockByPredicate((q) => q.isSystemValue && q.systemValue === d.NodeMaterialSystemValues.World);
                    H || (H = new d.InputBlock("World"), H.setAsSystemValue(d.NodeMaterialSystemValues.World));
                    const T = new d.TransformBlock("World normal");
                    return c.connectTo(T), H.connectTo(T), T;
                  }
                  case "WorldTangentBlock": {
                    let c = p.getInputBlockByPredicate((q) => q.isAttribute && q.name === "tangent");
                    c || (c = new d.InputBlock("tangent"), c.setAsAttribute("tangent"));
                    let H = p.getInputBlockByPredicate((q) => q.isSystemValue && q.systemValue === d.NodeMaterialSystemValues.World);
                    H || (H = new d.InputBlock("World"), H.setAsSystemValue(d.NodeMaterialSystemValues.World));
                    const T = new d.TransformBlock("World tangent");
                    return c.connectTo(T), H.connectTo(T), T;
                  }
                  case "PBRMetallicRoughnessBlock":
                    return new d.PBRMetallicRoughnessBlock("PBRMetallicRoughness");
                  case "SheenBlock":
                    return new d.SheenBlock("Sheen");
                  case "AnisotropyBlock":
                    return new d.AnisotropyBlock("Anisotropy");
                  case "ReflectionBlock":
                    return new d.ReflectionBlock("Reflection");
                  case "ClearCoatBlock":
                    return new d.ClearCoatBlock("ClearCoat");
                  case "RefractionBlock":
                    return new d.RefractionBlock("Refraction");
                  case "SubSurfaceBlock":
                    return new d.SubSurfaceBlock("SubSurface");
                  case "CurrentScreenBlock":
                    return new d.CurrentScreenBlock("CurrentScreen");
                  case "ParticleUVBlock": {
                    const c = new d.InputBlock("uv");
                    return c.setAsAttribute("particle_uv"), c;
                  }
                  case "ParticleTextureBlock":
                    return new d.ParticleTextureBlock("ParticleTexture");
                  case "ParticleColorBlock": {
                    const c = new d.InputBlock("Color");
                    return c.setAsAttribute("particle_color"), c;
                  }
                  case "ParticleTextureMaskBlock": {
                    const c = new d.InputBlock("TextureMask");
                    return c.setAsAttribute("particle_texturemask"), c;
                  }
                  case "ParticlePositionWorldBlock": {
                    const c = new d.InputBlock("PositionWorld");
                    return c.setAsAttribute("particle_positionw"), c;
                  }
                  case "ParticleRampGradientBlock":
                    return new d.ParticleRampGradientBlock("ParticleRampGradient");
                  case "ParticleBlendMultiplyBlock":
                    return new d.ParticleBlendMultiplyBlock("ParticleBlendMultiply");
                  case "FragCoordBlock":
                    return new d.FragCoordBlock("FragCoord");
                  case "ScreenSizeBlock":
                    return new d.ScreenSizeBlock("ScreenSize");
                  case "SceneDepthBlock":
                    return new d.SceneDepthBlock("SceneDepth");
                  case "EqualBlock": {
                    const c = new d.ConditionalBlock("Equal");
                    return c.condition = d.ConditionalBlockConditions.Equal, c;
                  }
                  case "NotEqualBlock": {
                    const c = new d.ConditionalBlock("NotEqual");
                    return c.condition = d.ConditionalBlockConditions.NotEqual, c;
                  }
                  case "LessThanBlock": {
                    const c = new d.ConditionalBlock("LessThan");
                    return c.condition = d.ConditionalBlockConditions.LessThan, c;
                  }
                  case "LessOrEqualBlock": {
                    const c = new d.ConditionalBlock("LessOrEqual");
                    return c.condition = d.ConditionalBlockConditions.LessOrEqual, c;
                  }
                  case "GreaterThanBlock": {
                    const c = new d.ConditionalBlock("GreaterThan");
                    return c.condition = d.ConditionalBlockConditions.GreaterThan, c;
                  }
                  case "GreaterOrEqualBlock": {
                    const c = new d.ConditionalBlock("GreaterOrEqual");
                    return c.condition = d.ConditionalBlockConditions.GreaterOrEqual, c;
                  }
                  case "XorBlock": {
                    const c = new d.ConditionalBlock("Xor");
                    return c.condition = d.ConditionalBlockConditions.Xor, c;
                  }
                  case "OrBlock": {
                    const c = new d.ConditionalBlock("Or");
                    return c.condition = d.ConditionalBlockConditions.Or, c;
                  }
                  case "AndBlock": {
                    const c = new d.ConditionalBlock("And");
                    return c.condition = d.ConditionalBlockConditions.And, c;
                  }
                  case "ImageSourceBlock":
                    return new d.ImageSourceBlock("ImageSource");
                  case "ClipPlanesBlock":
                    return new d.ClipPlanesBlock("ClipPlanes");
                  case "FragDepthBlock":
                    return new d.FragDepthBlock("FragDepth");
                  case "ShadowMapBlock":
                    return new d.ShadowMapBlock("ShadowMap");
                  case "TriPlanarBlock":
                    return new d.TriPlanarBlock("TriPlanarTexture");
                  case "BiPlanarBlock":
                    return new d.BiPlanarBlock("BiPlanarTexture");
                  case "MatrixTransposeBlock":
                    return new d.MatrixTransposeBlock("Transpose");
                  case "MatrixDeterminantBlock":
                    return new d.MatrixDeterminantBlock("Determinant");
                  case "CurveBlock":
                    return new d.CurveBlock("Curve");
                }
                return null;
              }
              static GetColorFromConnectionNodeType(l) {
                let P = "#880000";
                switch (l) {
                  case d.NodeMaterialBlockConnectionPointTypes.Float:
                    P = "#cb9e27";
                    break;
                  case d.NodeMaterialBlockConnectionPointTypes.Vector2:
                    P = "#16bcb1";
                    break;
                  case d.NodeMaterialBlockConnectionPointTypes.Vector3:
                  case d.NodeMaterialBlockConnectionPointTypes.Color3:
                    P = "#b786cb";
                    break;
                  case d.NodeMaterialBlockConnectionPointTypes.Vector4:
                  case d.NodeMaterialBlockConnectionPointTypes.Color4:
                    P = "#be5126";
                    break;
                  case d.NodeMaterialBlockConnectionPointTypes.Matrix:
                    P = "#591990";
                    break;
                  case d.NodeMaterialBlockConnectionPointTypes.Object:
                    P = "#6174FA";
                    break;
                }
                return P;
              }
              static GetConnectionNodeTypeFromString(l) {
                switch (l) {
                  case "Float":
                    return d.NodeMaterialBlockConnectionPointTypes.Float;
                  case "Vector2":
                    return d.NodeMaterialBlockConnectionPointTypes.Vector2;
                  case "Vector3":
                    return d.NodeMaterialBlockConnectionPointTypes.Vector3;
                  case "Vector4":
                    return d.NodeMaterialBlockConnectionPointTypes.Vector4;
                  case "Matrix":
                    return d.NodeMaterialBlockConnectionPointTypes.Matrix;
                  case "Color3":
                    return d.NodeMaterialBlockConnectionPointTypes.Color3;
                  case "Color4":
                    return d.NodeMaterialBlockConnectionPointTypes.Color4;
                }
                return d.NodeMaterialBlockConnectionPointTypes.AutoDetect;
              }
              static GetStringFromConnectionNodeType(l) {
                switch (l) {
                  case d.NodeMaterialBlockConnectionPointTypes.Float:
                    return "Float";
                  case d.NodeMaterialBlockConnectionPointTypes.Vector2:
                    return "Vector2";
                  case d.NodeMaterialBlockConnectionPointTypes.Vector3:
                    return "Vector3";
                  case d.NodeMaterialBlockConnectionPointTypes.Vector4:
                    return "Vector4";
                  case d.NodeMaterialBlockConnectionPointTypes.Color3:
                    return "Color3";
                  case d.NodeMaterialBlockConnectionPointTypes.Color4:
                    return "Color4";
                  case d.NodeMaterialBlockConnectionPointTypes.Matrix:
                    return "Matrix";
                }
                return "";
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/log/logComponent.js": (
          /*!*********************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/log/logComponent.js ***!
            \*********************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              LogComponent: () => (
                /* binding */
                l
              ),
              /* harmony export */
              LogEntry: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            o(
              /*! ./log.scss */
              "../../../tools/nodeEditor/dist/components/log/log.scss"
            );
            class u {
              constructor(p, c) {
                this.message = p, this.isError = c, this.time = /* @__PURE__ */ new Date();
              }
            }
            class l extends v.Component {
              constructor(p) {
                super(p), this.state = { logs: [] }, this._logConsoleRef = v.createRef();
              }
              componentDidMount() {
                this.props.globalState.onLogRequiredObservable.add((p) => {
                  const c = this.state.logs;
                  c.push(p), this.setState({ logs: c });
                });
              }
              componentDidUpdate() {
                this._logConsoleRef.current && (this._logConsoleRef.current.scrollTop = this._logConsoleRef.current.scrollHeight);
              }
              render() {
                return (0, d.jsx)("div", { id: "nme-log-console", ref: this._logConsoleRef, children: this.state.logs.map((p, c) => (0, d.jsx)("div", { className: "log" + (p.isError ? " error" : ""), children: p.time.getHours() + ":" + p.time.getMinutes() + ":" + p.time.getSeconds() + ": " + p.message }, c)) });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/nodeList/nodeListComponent.js": (
          /*!*******************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/nodeList/nodeListComponent.js ***!
            \*******************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              NodeListComponent: () => (
                /* binding */
                b
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! ../../sharedComponents/draggableLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/draggableLineComponent.js"
            ), P = o(
              /*! core/Misc/tools */
              "core/Misc/dataStorage"
            ), p = o(
              /*! ../../sharedComponents/draggableLineWithButtonComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/draggableLineWithButtonComponent.js"
            ), c = o(
              /*! ../../sharedComponents/lineWithFileButtonComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineWithFileButtonComponent.js"
            ), H = o(
              /*! ../../imgs/add.svg */
              "../../../tools/nodeEditor/dist/imgs/add.svg"
            ), T = o(
              /*! ../../imgs/delete.svg */
              "../../../tools/nodeEditor/dist/imgs/delete.svg"
            ), q = o(
              /*! shared-ui-components/nodeGraphSystem/nodeLedger */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLedger.js"
            );
            o(
              /*! ./nodeList.scss */
              "../../../tools/nodeEditor/dist/components/nodeList/nodeList.scss"
            );
            class b extends v.Component {
              constructor(w) {
                super(w), this.state = { filter: "" };
                const m = localStorage.getItem("Custom-Frame-List");
                m && (this._customFrameList = JSON.parse(m));
                const I = localStorage.getItem("Custom-Block-List");
                I && (this._customBlockList = JSON.parse(I)), this._onResetRequiredObserver = this.props.globalState.onResetRequiredObservable.add(() => {
                  this.forceUpdate();
                });
              }
              componentWillUnmount() {
                this.props.globalState.onResetRequiredObservable.remove(this._onResetRequiredObserver);
              }
              filterContent(w) {
                this.setState({ filter: w });
              }
              loadCustomFrame(w) {
                P.Tools.ReadFile(w, async (m) => {
                  const I = new TextDecoder("utf-8"), N = JSON.parse(I.decode(m)), k = N.editorData.frames[0].name + "Custom", R = N.editorData.frames[0].comments || "";
                  try {
                    localStorage.setItem(k, JSON.stringify(N));
                  } catch {
                    this.props.globalState.stateManager.onErrorMessageDialogRequiredObservable.notifyObservers("Error Saving Frame");
                    return;
                  }
                  const y = localStorage.getItem("Custom-Frame-List");
                  let O = {};
                  y && (O = JSON.parse(y)), O[k] = R, localStorage.setItem("Custom-Frame-List", JSON.stringify(O)), this._customFrameList = O, this.forceUpdate();
                }, void 0, !0);
              }
              removeItem(w) {
                const m = localStorage.getItem("Custom-Frame-List");
                if (m) {
                  const I = q.NodeLedger.RegisteredNodeNames.indexOf(w);
                  I !== -1 && q.NodeLedger.RegisteredNodeNames.splice(I, 1);
                  const N = JSON.parse(m);
                  delete N[w], localStorage.removeItem(w), localStorage.setItem("Custom-Frame-List", JSON.stringify(N)), this._customFrameList = N, this.forceUpdate();
                }
              }
              loadCustomBlock(w) {
                P.Tools.ReadFile(w, async (m) => {
                  const I = new TextDecoder("utf-8"), N = JSON.parse(I.decode(m)), k = (N.name || "") + "CustomBlock", R = N.comments || "";
                  try {
                    localStorage.setItem(k, JSON.stringify(N));
                  } catch {
                    this.props.globalState.stateManager.onErrorMessageDialogRequiredObservable.notifyObservers("Error Saving Block");
                    return;
                  }
                  const y = localStorage.getItem("Custom-Block-List");
                  let O = {};
                  y && (O = JSON.parse(y)), O[k] = R, localStorage.setItem("Custom-Block-List", JSON.stringify(O)), this._customBlockList = O, this.forceUpdate();
                }, void 0, !0);
              }
              removeCustomBlock(w) {
                const m = localStorage.getItem("Custom-Block-List");
                if (m) {
                  const I = JSON.parse(m);
                  delete I[w], localStorage.removeItem(w), localStorage.setItem("Custom-Block-List", JSON.stringify(I)), this._customBlockList = I, this.forceUpdate();
                }
              }
              render() {
                const w = [];
                for (const k in this._customFrameList)
                  w.push(k);
                const m = [];
                for (const k in this._customBlockList)
                  m.push(k);
                const I = {
                  Custom_Frames: w,
                  Custom_Blocks: m,
                  Animation: ["BonesBlock", "MorphTargetsBlock"],
                  Color_Management: ["ReplaceColorBlock", "PosterizeBlock", "GradientBlock", "DesaturateBlock"],
                  Conversion_Blocks: ["ColorMergerBlock", "ColorSplitterBlock", "VectorMergerBlock", "VectorSplitterBlock"],
                  Inputs: [
                    "Float",
                    "Vector2",
                    "Vector3",
                    "Vector4",
                    "Color3",
                    "Color4",
                    "TextureBlock",
                    "ReflectionTextureBlock",
                    "TimeBlock",
                    "RealTimeBlock",
                    "DeltaTimeBlock",
                    "MaterialAlphaBlock",
                    "FragCoordBlock",
                    "ScreenSizeBlock",
                    "ImageSourceBlock",
                    "TriPlanarBlock",
                    "BiPlanarBlock"
                  ],
                  Interpolation: ["LerpBlock", "StepBlock", "SmoothStepBlock", "NLerpBlock"],
                  Logical: ["EqualBlock", "NotEqualBlock", "LessThanBlock", "LessOrEqualBlock", "GreaterThanBlock", "GreaterOrEqualBlock", "XorBlock", "OrBlock", "AndBlock"],
                  Math__Standard: [
                    "AddBlock",
                    "DivideBlock",
                    "MaxBlock",
                    "MinBlock",
                    "ModBlock",
                    "MultiplyBlock",
                    "NegateBlock",
                    "OneMinusBlock",
                    "ReciprocalBlock",
                    "ScaleBlock",
                    "SignBlock",
                    "SqrtBlock",
                    "SubtractBlock"
                  ],
                  Math__Scientific: [
                    "AbsBlock",
                    "ArcCosBlock",
                    "ArcSinBlock",
                    "ArcTanBlock",
                    "ArcTan2Block",
                    "CosBlock",
                    "CurveBlock",
                    "DegreesToRadiansBlock",
                    "ExpBlock",
                    "Exp2Block",
                    "FractBlock",
                    "LogBlock",
                    "PowBlock",
                    "RadiansToDegreesBlock",
                    "SawToothWaveBlock",
                    "SinBlock",
                    "SquareWaveBlock",
                    "TanBlock",
                    "TriangleWaveBlock"
                  ],
                  Math__Vector: [
                    "CrossBlock",
                    "DerivativeBlock",
                    "DistanceBlock",
                    "DotBlock",
                    "FresnelBlock",
                    "LengthBlock",
                    "ReflectBlock",
                    "RefractBlock",
                    "Rotate2dBlock",
                    "TransformBlock",
                    "ScreenSpaceBlock",
                    "TwirlBlock"
                  ],
                  Matrices: [
                    "Matrix",
                    "WorldMatrixBlock",
                    "WorldViewMatrixBlock",
                    "WorldViewProjectionMatrixBlock",
                    "ViewMatrixBlock",
                    "ViewProjectionMatrixBlock",
                    "ProjectionMatrixBlock",
                    "MatrixBuilderBlock",
                    "MatrixDeterminantBlock",
                    "MatrixTransposeBlock"
                  ],
                  Misc: ["ElbowBlock", "ShadowMapBlock", "TeleportInBlock", "TeleportOutBlock"],
                  Mesh: [
                    "InstancesBlock",
                    "PositionBlock",
                    "UVBlock",
                    "ColorBlock",
                    "InstanceColorBlock",
                    "NormalBlock",
                    "HeightToNormalBlock",
                    "TBNBlock",
                    "PerturbNormalBlock",
                    "NormalBlendBlock",
                    "TangentBlock",
                    "MatrixIndicesBlock",
                    "MatrixWeightsBlock",
                    "MatrixIndicesExtraBlock",
                    "MatrixWeightsExtraBlock",
                    "WorldPositionBlock",
                    "WorldNormalBlock",
                    "WorldTangentBlock",
                    "FrontFacingBlock",
                    "MeshAttributeExistsBlock"
                  ],
                  Noises: ["RandomNumberBlock", "SimplexPerlin3DBlock", "WorleyNoise3DBlock", "CloudBlock", "VoronoiNoiseBlock"],
                  Output_Nodes: ["VertexOutputBlock", "FragmentOutputBlock", "PrePassOutputBlock", "DiscardBlock", "ClipPlanesBlock", "FragDepthBlock"],
                  Particle: [
                    "ParticleBlendMultiplyBlock",
                    "ParticleColorBlock",
                    "ParticlePositionWorldBlock",
                    "ParticleRampGradientBlock",
                    "ParticleTextureBlock",
                    "ParticleTextureMaskBlock",
                    "ParticleUVBlock"
                  ],
                  PBR: ["PBRMetallicRoughnessBlock", "AnisotropyBlock", "ClearCoatBlock", "ReflectionBlock", "RefractionBlock", "SheenBlock", "SubSurfaceBlock"],
                  PostProcess: ["ScreenPositionBlock", "CurrentScreenBlock", "PrePassTextureBlock"],
                  Procedural__Texture: ["ScreenPositionBlock"],
                  Range: ["ClampBlock", "RemapBlock", "NormalizeBlock"],
                  Round: ["RoundBlock", "CeilingBlock", "FloorBlock"],
                  Scene: [
                    "FogBlock",
                    "CameraPositionBlock",
                    "CameraParametersBlock",
                    "FogColorBlock",
                    "ImageProcessingBlock",
                    "LightBlock",
                    "LightInformationBlock",
                    "ViewDirectionBlock",
                    "SceneDepthBlock"
                  ]
                };
                switch (this.props.globalState.mode) {
                  case P.NodeMaterialModes.Material:
                    delete I.PostProcess, delete I.Particle, delete I.Procedural__Texture;
                    break;
                  case P.NodeMaterialModes.PostProcess:
                    delete I.Animation, delete I.Mesh, delete I.Particle, delete I.Procedural__Texture, delete I.PBR, I.Output_Nodes.splice(I.Output_Nodes.indexOf("PrePassOutputBlock"), 1);
                    break;
                  case P.NodeMaterialModes.ProceduralTexture:
                    delete I.Animation, delete I.Mesh, delete I.Particle, delete I.PostProcess, delete I.PBR, I.Output_Nodes.splice(I.Output_Nodes.indexOf("PrePassOutputBlock"), 1);
                    break;
                  case P.NodeMaterialModes.Particle:
                    delete I.Animation, delete I.Mesh, delete I.PostProcess, delete I.Procedural__Texture, delete I.PBR, I.Output_Nodes.splice(I.Output_Nodes.indexOf("VertexOutputBlock"), 1), I.Scene.splice(I.Scene.indexOf("FogBlock"), 1), I.Scene.splice(I.Scene.indexOf("FogColorBlock"), 1), I.Output_Nodes.splice(I.Output_Nodes.indexOf("PrePassOutputBlock"), 1);
                    break;
                }
                const N = [];
                for (const k in I) {
                  const R = I[k].filter((O) => !this.state.filter || O.toLowerCase().indexOf(this.state.filter.toLowerCase()) !== -1).sort((O, Y) => O.localeCompare(Y)).map((O) => k === "Custom_Frames" ? (0, d.jsx)(p.DraggableLineWithButtonComponent, { data: O, tooltip: this._customFrameList[O] || "", iconImage: T, iconTitle: "Delete", onIconClick: (Y) => this.removeItem(Y) }, O) : k === "Custom_Blocks" ? (0, d.jsx)(p.DraggableLineWithButtonComponent, { data: O, tooltip: this._customBlockList[O] || "", iconImage: T, iconTitle: "Delete", onIconClick: (Y) => this.removeCustomBlock(Y), lenSuffixToRemove: 11 }, O) : (0, d.jsx)(l.DraggableLineComponent, { data: O, tooltip: b._Tooltips[O] || "" }, O));
                  if (k === "Custom_Frames") {
                    const O = (0, d.jsx)(c.LineWithFileButtonComponent, { title: "Add Custom Frame", closed: !1, multiple: !0, label: "Add...", uploadName: "custom-frame-upload", iconImage: H, accept: ".json", onIconClick: (Y) => {
                      this.loadCustomFrame(Y);
                    } }, "add...");
                    R.push(O);
                  } else if (k === "Custom_Blocks") {
                    const O = (0, d.jsx)(c.LineWithFileButtonComponent, { title: "Add Custom Block", closed: !1, multiple: !0, label: "Add...", uploadName: "custom-block-upload", iconImage: H, accept: ".json", onIconClick: (Y) => {
                      this.loadCustomBlock(Y);
                    } }, "add...");
                    R.push(O);
                  }
                  R.length && N.push((0, d.jsx)(u.LineContainerComponent, { title: k.replace("__", ": ").replace("_", " "), closed: !1, children: R }, k + " blocks"));
                  const y = q.NodeLedger.RegisteredNodeNames;
                  for (const O in I) {
                    const Y = I[O];
                    if (Y.length)
                      for (const ee of Y)
                        y.includes(ee) || y.push(ee);
                  }
                  q.NodeLedger.NameFormatter = (O) => {
                    let Y = O;
                    if (O.endsWith("Custom")) {
                      const ee = O.lastIndexOf("Custom");
                      Y = O.substring(0, ee), Y += " [custom]";
                    } else
                      Y = O.replace("Block", "");
                    return Y;
                  };
                }
                return (0, d.jsx)("div", { id: "nmeNodeList", children: (0, d.jsx)("div", { className: "panes", children: (0, d.jsxs)("div", { className: "pane", children: [(0, d.jsx)("div", { className: "filter", children: (0, d.jsx)("input", { type: "text", placeholder: "Filter", onFocus: () => this.props.globalState.lockObject.lock = !0, onBlur: () => {
                  this.props.globalState.lockObject.lock = !1;
                }, onChange: (k) => this.filterContent(k.target.value) }) }), (0, d.jsx)("div", { className: "list-container", children: N })] }) }) });
              }
            }
            b._Tooltips = {
              BonesBlock: "Provides a world matrix for each vertex, based on skeletal (bone/joint) animation",
              MorphTargetsBlock: "Provides the final positions, normals, tangents, and uvs based on morph targets in a mesh",
              AddBlock: "Adds the left and right inputs of the same type together",
              DistanceBlock: "Provides a distance vector based on the left and right input vectors",
              DivideBlock: "Divides the left input by the right input of the same type",
              LengthBlock: "Outputs the length of an input vector",
              MaxBlock: "Outputs the largest value between the left and right inputs of the same type",
              MinBlock: "Outputs the smallest value between the left and right inputs of the same type",
              MultiplyBlock: "Multiplies the left and right inputs of the same type together",
              NegateBlock: "Multiplies the input by -1",
              OneMinusBlock: "Subtracts each channel of the input value from 1 (1 - input)",
              RandomNumberBlock: "Provides a random number based on an input seed",
              ReciprocalBlock: "Quotient of 1 divided by the input",
              ScaleBlock: "Multiplies the input channels by a float factor",
              SubtractBlock: "Subtracts the right input from the left input of the same type",
              GradientBlock: "Returns the color in the gradient represented by the target value of the input",
              PosterizeBlock: "Reduces the number of values in each channel to the number in the corresponding channel of steps",
              ReplaceColorBlock: "Outputs the replacement color if the distance between value and reference is less than distance, else outputs the value color",
              ColorMergerBlock: "Combines float input channels into a color",
              ColorSplitterBlock: "Separates color input channels into individual floats",
              VectorMergerBlock: "Combines up to four input floats into a vector",
              VectorSplitterBlock: "Separates vectors input channels into individual floats",
              Color3: "A color made up of red, green, and blue channel values",
              Color4: "A color made up of red, green, blue, and alpha channel values",
              MaterialAlphaBlock: "A float representing the alpha value of the material",
              DeltaTimeBlock: "A float representing the time that has passed since the last frame was rendered",
              Float: "A floating point number representing a value with a fractional component",
              TextureBlock: "A node for reading a linked or embedded texture file",
              PrePassTextureBlock: "A node for reading textures from the prepass",
              TimeBlock: "A float value that represents the time that has passed since the scene was loaded (it is incremented by 0.6 each second)",
              RealTimeBlock: "A float value that represents the number of seconds that have elapsed since the engine was initialized",
              Vector2: "a vector composed of X and Y channels",
              Vector3: "a vector composed of X, Y, and Z channels",
              Vector4: "a vector composed of X, Y, Z, and W channels",
              LerpBlock: "Outputs a value that is a mix of the left and right inputs based on the target value",
              NLerpBlock: "Outputs a value that is a mix of the left and right inputs based on the target's normalized value",
              SmoothStepBlock: "Outputs a value based on a the input value's position on a curve between the two edge values",
              StepBlock: "Outputs 1 for any input value above the edge input, outputs 0 for any input value below the edge input",
              Matrix: "A 4x4 table of related values",
              ProjectionMatrixBlock: "A matrix to remap points in 3D space to 2D plane relative to the screen",
              ViewMatrixBlock: "A matrix to remap points in 3D space to 2D plane relative to the view of the scene camera",
              ViewProjectionMatrixBlock: "A matrix to remap points in 3D space to 2D view space before remapping to 2D screen space",
              WorldMatrixBlock: "A matrix to remap points in 3D local space to 3D world space",
              WorldViewProjectionMatrixBlock: "A matrix to remap points in 3D local space to 3D world space, then to 2D camera space, and ending in 2D screen space",
              ColorBlock: "Outputs the RGBA color of each vertex in the mesh",
              InstanceColorBlock: "Outputs the RGBA color of each instance",
              InstancesBlock: "Provides the world matrix for each instance to apply this material to all instances",
              MatrixIndicesBlock: "A Vector4 representing the vertex to bone skinning assignments",
              MatrixWeightsBlock: "A Vector4 representing the vertex to bone skinning weights",
              MatrixIndicesExtraBlock: "A Vector4 representing the vertex to bone skinning assignments when the number of influences per bone is greater than 4",
              MatrixWeightsExtraBlock: "A Vector4 representing the vertex to bone skinning weights when the number of influences per bone is greater than 4",
              NormalBlock: "A Vector3 representing the normal of each vertex of the attached mesh",
              PositionBlock: "A Vector3 representing the position of each vertex of the attached mesh",
              TangentBlock: "A Vector3 representing the tangent of each vertex of the attached mesh",
              UVBlock: "A Vector2 representing the UV coordinates of each vertex of the attached mesh",
              WorldNormal: "A Vector4 representing the normal of each vertex of the attached mesh transformed into world space",
              WorldTangent: "A Vector4 representing the tangent of each vertex of the attached mesh transformed into world space",
              PerturbNormalBlock: "Creates high-frequency detail normal vectors based on a normal map, the world position, and world normal",
              TBNBlock: "Creates a TBN matrix from normal, tangent, and bitangent vectors",
              NormalBlend: "Outputs the result of blending two normal maps together using a per-channel screen",
              WorldPosition: "A Vector4 representing the position of each vertex of the attached mesh transformed into world space",
              DiscardBlock: "A final node that will not output a pixel below the cutoff value",
              FragmentOutputBlock: "A mandatory final node for outputing the color of each pixel",
              PrePassOutputBlock: "An optional final node for outputing geometry data on prepass textures",
              VertexOutputBlock: "A mandatory final node for outputing the position of each vertex",
              ClampBlock: "Outputs values above the maximum or below minimum as maximum or minimum values respectively",
              NormalizeBlock: "Remaps the length of a vector or color to 1",
              RemapBlock: "Remaps input value between sourceMin and sourceMax to a new range between targetMin and targetMax",
              CeilingBlock: "Outputs fractional values as the next higher whole number",
              FloorBlock: "Outputs fractional values as the next lower whole number",
              RoundBlock: "Outputs fractional values rounded to the nearest whole number",
              ModBlock: "Outputs the value of one parameter modulo another",
              CameraPositionBlock: "Outputs a Vector3 position of the active scene camera",
              CameraParametersBlock: "Outputs a Vector4 containing (-1 for webGL and 1 for webGPU, camera.minZ, camera.maxZ, 1 / camera.maxZ)",
              FogBlock: "Applies fog to the scene with an increasing opacity based on distance from the camera",
              FogColorBlock: "The system value for fog color pulled from the scene",
              ImageProcessingBlock: "Provides access to all of the Babylon image processing properties",
              LightBlock: "Outputs diffuse and specular contributions from one or more scene lights",
              LightInformationBlock: "Provides the direction, color and intensity of a selected light based on its world position",
              ReflectionTextureBlock: "Creates a reflection from the input texture",
              ViewDirectionBlock: "Outputs the direction vector of where the camera is aimed",
              AbsBlock: "Outputs the absolute value of the input value",
              ArcCosBlock: "Outputs the inverse of the cosine value based on the input value",
              ArcSinBlock: "Outputs the inverse of the sine value based on the input value",
              ArcTan2Block: "Outputs the inverse of the tangent value based on the input value",
              ArcTanBlock: "Outputs the inverse of the tangent value based on the input value",
              CosBlock: "Outputs the cosine value based on the input value",
              DegreesToRadiansBlock: "Converts the input degrees value to radians",
              Exp2Block: "Outputs the input value multiplied by itself 1 time. (Exponent of 2)",
              ExpBlock: "Outputs the input value multiplied by itself 9 time. (Exponent of 10)",
              FractBlock: "Outputs only the fractional value of a floating point number",
              LogBlock: "The logarithmic value based on the input value",
              PowBlock: "Outputs the input value multiplied by itself the number of times equal to the power input (Exponent of power)",
              RadiansToDegreesBlock: "Converts the input radians value to degrees",
              SawToothWaveBlock: "Outputs a sawtooth pattern value between -1 and 1 based on the input value",
              SignBlock: "returns 1 if the input is positive, 0 if input is equal to 0, or -1 if the input is negative",
              SinBlock: "Outputs the sine value based on the input value",
              SqrtBlock: "Outputs the square root of the input value",
              SquareWaveBlock: "Outputs a stepped pattern value between -1 and 1 based on the input value",
              TanBlock: "Outputs the tangent value based on the input value",
              TriangleWaveBlock: "Outputs a sawtooth pattern value between 0 and 1 based on the input value",
              CrossBlock: "Outputs a vector that is perpendicular to two input vectors",
              DotBlock: "Outputs the cos of the angle between two vectors",
              FresnelBlock: "Outputs the grazing angle of the surface of the mesh, relative to a camera influenced by the bias and power inputs",
              TransformBlock: "Transforms a input vector based on the input matrix",
              DerivativeBlock: "FRAGMENT SHADER ONLY. Provides the rate of change for an input on a given axis (x,y).",
              DesaturateBlock: "Convert a color input into a grayscale representation.",
              WorldViewMatrixBlock: "A matrix to remap points in 3D local space to 3D world space, and ending in 2D camera space.",
              FrontFacingBlock: "Returns 1 if a mesh triangle faces the normal direction and 0 if it does not.",
              SimplexPerlin3DBlock: "Creates a type of gradient noise with few directional artifacts.",
              WorleyNoise3DBlock: "Creates a random pattern resembling cells.",
              ReflectBlock: "Outputs the direction of the input vector reflected across the surface normal.",
              RefractBlock: "Outputs a direction simulating a deflection of the input vector.",
              Rotate2dBlock: "Rotates UV coordinates around the W axis.",
              PBRMetallicRoughnessBlock: "PBR metallic/roughness material",
              SheenBlock: "PBR Sheen block",
              AnisotropyBlock: "PBR Anisotropy block",
              ReflectionBlock: "PBR Reflection block",
              ClearCoatBlock: "PBR ClearCoat block",
              RefractionBlock: "PBR Refraction block",
              SubSurfaceBlock: "PBR SubSurface block",
              ScreenPositionBlock: "A Vector2 representing the position of each vertex of the screen quad (derived from UV set from the quad used to render)",
              CurrentScreenBlock: "The screen buffer used as input for the post process",
              ParticleUVBlock: "The particle uv texture coordinate",
              ParticleTextureBlock: "The particle texture",
              ParticleColorBlock: "The particle color",
              ParticleTextureMaskBlock: "The particle texture mask",
              ParticleRampGradientBlock: "The particle ramp gradient block",
              ParticleBlendMultiplyBlock: "The particle blend multiply block",
              ParticlePositionWorldBlock: "The world position of the particle",
              FragCoordBlock: "The gl_FragCoord predefined variable that contains the window relative coordinate (x, y, z, 1/w)",
              ScreenSizeBlock: "The size (in pixels) of the screen window",
              SceneDepthBlock: "The scene depth buffer",
              MatrixBuilderBlock: "Converts 4 Vector4 into a matrix",
              EqualBlock: "Return a value if two operands are equals",
              NotEqualBlock: "Return a value if two operands are not equals",
              LessThanBlock: "Return a value if an operand is smaller than a second operand",
              LessOrEqualBlock: "Return a value if an operand is smaller or equal to a second operand",
              GreaterThanBlock: "Return a value if an operand is greater than a second operand",
              GreaterOrEqualBlock: "Return a value if an operand is greater or equal to a second operand",
              XorBlock: "Return a value if (a xor b) > 0",
              OrBlock: "Return a value if (a or b) > 0",
              AndBlock: "Return a value if (a and b) > 0",
              ImageSourceBlock: "Centralize texture access for TextureBlocks",
              CloudBlock: "Generate Fractal Brownian Motion Clouds",
              VoronoiNoiseBlock: "Generate Voronoi Noise",
              ScreenSpaceBlock: "Convert a Vector3 or a Vector4 into screen space",
              TwirlBlock: "Apply a twirl rotation",
              ElbowBlock: "Passthrough block mostly used to organize your graph",
              TeleportInBlock: "Passthrough block mostly used to organize your graph (but without visible lines). It works like a teleportation point for the graph.",
              TeleportOutBlock: "Endpoint for a TeleportInBlock.",
              ClipPlanesBlock: "A node that add clip planes support",
              HeightToNormalBlock: "Convert a height map into a normal map",
              FragDepthBlock: "A final node that sets the fragment depth",
              ShadowMapBlock: "Compute a depth value suitable for shadow map generation",
              TriPlanarBlock: "A node for reading a texture with triplanar mapping",
              BiPlanarBlock: "A node for reading a texture with biplanar mapping",
              MatrixDeterminantBlock: "Compute the determinant of a matrix",
              MatrixTransposeBlock: "Compute the transpose of a matrix",
              MeshAttributeExistsBlock: "Falls back to secondary input if specified attribute doesn't exists on the rendered mesh",
              CurveBlock: "Apply a curve function"
            };
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/previewAreaComponent.js": (
          /*!*********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/previewAreaComponent.js ***!
            \*********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              PreviewAreaComponent: () => (
                /* binding */
                b
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Particles/particleSystem */
              "core/Misc/dataStorage"
            ), l = o(
              /*! ./svgs/doubleSided.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/doubleSided.svg"
            ), P = o(
              /*! ./svgs/depthPass.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/depthPass.svg"
            ), p = o(
              /*! ./svgs/omni.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/omni.svg"
            ), c = o(
              /*! ./svgs/directionalRight.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/directionalRight.svg"
            ), H = o(
              /*! ./svgs/directionalLeft.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/directionalLeft.svg"
            ), T = o(
              /*! ./svgs/icon-ibl.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/icon-ibl.svg"
            ), q = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            );
            class b extends v.Component {
              constructor(w) {
                super(w), this._onPointerOverCanvas = () => {
                  this.props.globalState.pointerOverCanvas = !0;
                }, this._onPointerOutCanvas = () => {
                  this.props.globalState.pointerOverCanvas = !1;
                }, this.state = { isLoading: !0 }, this._onIsLoadingChangedObserver = this.props.globalState.onIsLoadingChanged.add((m) => this.setState({ isLoading: m })), this._onResetRequiredObserver = this.props.globalState.onResetRequiredObservable.add(() => {
                  this.forceUpdate();
                });
              }
              componentWillUnmount() {
                this.props.globalState.onIsLoadingChanged.remove(this._onIsLoadingChangedObserver), this.props.globalState.onResetRequiredObservable.remove(this._onResetRequiredObserver);
              }
              changeBackFaceCulling(w) {
                this.props.globalState.backFaceCulling = w, u.DataStorage.WriteBoolean("BackFaceCulling", w), this.props.globalState.onBackFaceCullingChanged.notifyObservers(), this.forceUpdate();
              }
              changeDepthPrePass(w) {
                this.props.globalState.depthPrePass = w, u.DataStorage.WriteBoolean("DepthPrePass", w), this.props.globalState.onDepthPrePassChanged.notifyObservers(), this.forceUpdate();
              }
              changeParticleSystemBlendMode(w) {
                this.props.globalState.particleSystemBlendMode !== w && (this.props.globalState.particleSystemBlendMode = w, this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(null), u.DataStorage.WriteNumber("DefaultParticleSystemBlendMode", w), this.forceUpdate());
              }
              render() {
                const w = [
                  { label: "Add", value: u.ParticleSystem.BLENDMODE_ADD },
                  { label: "Multiply", value: u.ParticleSystem.BLENDMODE_MULTIPLY },
                  { label: "Multiply Add", value: u.ParticleSystem.BLENDMODE_MULTIPLYADD },
                  { label: "OneOne", value: u.ParticleSystem.BLENDMODE_ONEONE },
                  { label: "Standard", value: u.ParticleSystem.BLENDMODE_STANDARD }
                ];
                return (0, d.jsxs)(d.Fragment, { children: [(0, d.jsxs)("div", { id: "preview", style: { height: this.props.width + "px" }, children: [(0, d.jsx)("canvas", { onPointerOver: this._onPointerOverCanvas, onPointerOut: this._onPointerOutCanvas, id: "preview-canvas" }), (0, d.jsx)("div", { className: "waitPanel" + (this.state.isLoading ? "" : " hidden"), children: "Please wait, loading..." })] }), this.props.globalState.mode === u.NodeMaterialModes.Particle && (0, d.jsx)("div", { id: "preview-config-bar", className: "extended", children: (0, d.jsx)(q.OptionsLineComponent, { label: "Blend mode", options: w, target: this.props.globalState, propertyName: "particleSystemBlendMode", noDirectUpdate: !0, onSelect: (m) => {
                  this.changeParticleSystemBlendMode(m);
                } }) }), this.props.globalState.mode === u.NodeMaterialModes.Material && (0, d.jsx)(d.Fragment, { children: (0, d.jsxs)("div", { id: "preview-config-bar", children: [(0, d.jsx)("div", { title: "Render without back face culling", onClick: () => this.changeBackFaceCulling(!this.props.globalState.backFaceCulling), className: "button back-face" + (this.props.globalState.backFaceCulling ? "" : " selected"), children: (0, d.jsx)("img", { src: l, alt: "" }) }), (0, d.jsx)("div", { title: "Render with depth pre-pass", onClick: () => this.changeDepthPrePass(!this.props.globalState.depthPrePass), className: "button depth-pass" + (this.props.globalState.depthPrePass ? " selected" : ""), children: (0, d.jsx)("img", { src: P, alt: "" }) }), (0, d.jsx)("div", { title: "Turn on/off hemispheric light", onClick: () => {
                  this.props.globalState.hemisphericLight = !this.props.globalState.hemisphericLight, u.DataStorage.WriteBoolean("HemisphericLight", this.props.globalState.hemisphericLight), this.props.globalState.onLightUpdated.notifyObservers(), this.forceUpdate();
                }, className: "button hemispheric-light" + (this.props.globalState.hemisphericLight ? " selected" : ""), children: (0, d.jsx)("img", { src: p, alt: "" }) }), (0, d.jsx)("div", { title: "Turn on/off direction light #1", onClick: () => {
                  this.props.globalState.directionalLight1 = !this.props.globalState.directionalLight1, u.DataStorage.WriteBoolean("DirectionalLight1", this.props.globalState.directionalLight1), this.props.globalState.onLightUpdated.notifyObservers(), this.forceUpdate();
                }, className: "button direction-light-1" + (this.props.globalState.directionalLight1 ? " selected" : ""), children: (0, d.jsx)("img", { src: c, alt: "" }) }), (0, d.jsx)("div", { title: "Turn on/off direction light #0", onClick: () => {
                  this.props.globalState.directionalLight0 = !this.props.globalState.directionalLight0, u.DataStorage.WriteBoolean("DirectionalLight0", this.props.globalState.directionalLight0), this.props.globalState.onLightUpdated.notifyObservers(), this.forceUpdate();
                }, className: "button direction-light-0" + (this.props.globalState.directionalLight0 ? " selected" : ""), children: (0, d.jsx)("img", { src: H, alt: "" }) }), (0, d.jsx)("div", { title: "Turn on/off environment", onClick: () => {
                  this.props.globalState.backgroundHDR = !this.props.globalState.backgroundHDR, u.DataStorage.WriteBoolean("backgroundHDR", this.props.globalState.backgroundHDR), this.props.globalState.onBackgroundHDRUpdated.notifyObservers(), this.forceUpdate();
                }, className: "button " + (this.props.globalState.backgroundHDR ? " selected" : ""), children: (0, d.jsx)("img", { src: T, alt: "" }) })] }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/previewManager.js": (
          /*!***************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/previewManager.js ***!
            \***************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              PreviewManager: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Rendering/depthRendererSceneComponent */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ./previewType */
              "../../../tools/nodeEditor/dist/components/preview/previewType.js"
            ), u = o(
              /*! ../log/logComponent */
              "../../../tools/nodeEditor/dist/components/log/logComponent.js"
            );
            class l {
              _serializeMaterial() {
                var q;
                const p = this._nodeMaterial;
                let c = !1;
                {
                  const b = p.getAllTextureBlocks();
                  for (const j of b) {
                    const w = j.texture;
                    if (!w || j.hasImageSource)
                      continue;
                    let m = !1;
                    for (const I of this._engine.getLoadedTexturesCache())
                      if (I.uniqueId === ((q = w._texture) == null ? void 0 : q.uniqueId)) {
                        m = !0;
                        break;
                      }
                    if (!m) {
                      c = !0;
                      break;
                    }
                  }
                }
                const H = d.Texture.SerializeBuffers;
                d.Texture.SerializeBuffers = c, d.Texture._SerializeInternalTextureUniqueId = !0;
                const T = p.serialize();
                return d.Texture.SerializeBuffers = H, d.Texture._SerializeInternalTextureUniqueId = !1, T;
              }
              constructor(p, c) {
                this._nodeMaterial = c.nodeMaterial, this._globalState = c, this._onBuildObserver = this._nodeMaterial.onBuildObservable.add(() => {
                  this._updatePreview();
                }), this._onPreviewCommandActivatedObserver = c.onPreviewCommandActivated.add((b) => {
                  b && (this._currentType = -1, this._scene.disableDepthRenderer()), this._refreshPreviewMesh();
                }), this._onLightUpdatedObserver = c.onLightUpdated.add(() => {
                  this._prepareLights();
                }), this._onBackgroundHDRUpdatedObserver = c.onBackgroundHDRUpdated.add(() => {
                  this._prepareBackgroundHDR();
                }), this._onUpdateRequiredObserver = c.stateManager.onUpdateRequiredObservable.add(() => {
                  this._updatePreview();
                }), this._onPreviewBackgroundChangedObserver = c.onPreviewBackgroundChanged.add(() => {
                  this._scene.clearColor = this._globalState.backgroundColor;
                }), this._onAnimationCommandActivatedObserver = c.onAnimationCommandActivated.add(() => {
                  this._handleAnimations();
                }), this._onBackFaceCullingChangedObserver = c.onBackFaceCullingChanged.add(() => {
                  this._material.backFaceCulling = this._globalState.backFaceCulling;
                }), this._onDepthPrePassChangedObserver = c.onDepthPrePassChanged.add(() => {
                  this._material.needDepthPrePass = this._globalState.depthPrePass;
                }), this._engine = new d.Engine(p, !0), this._scene = new d.Scene(this._engine), this._scene.clearColor = this._globalState.backgroundColor, this._scene.ambientColor = new d.Color3(1, 1, 1), this._camera = new d.ArcRotateCamera("Camera", 0, 0.8, 4, d.Vector3.Zero(), this._scene), this._camera.lowerRadiusLimit = 3, this._camera.upperRadiusLimit = 10, this._camera.wheelPrecision = 20, this._camera.minZ = 0.1, this._camera.attachControl(!1), this._lightParent = new d.TransformNode("LightParent", this._scene), this._globalState.filesInput = new d.FilesInput(this._engine, this._scene, (b, j) => {
                  this._meshes.push(...j.meshes), this._prepareScene();
                }, null, null, null, null, null, () => {
                  this._reset();
                }, !0);
                const H = this._engine.getRenderingCanvas();
                if (H) {
                  const b = (w) => {
                    w.stopPropagation(), w.preventDefault();
                  };
                  H.addEventListener("dragenter", b, !1), H.addEventListener("dragover", b, !1);
                  const j = (w) => {
                    w.stopPropagation(), w.preventDefault(), this._globalState.onDropEventReceivedObservable.notifyObservers(w);
                  };
                  H.addEventListener("drop", j, !1);
                }
                this._refreshPreviewMesh(), this._engine.runRenderLoop(() => {
                  this._engine.resize(), this._scene.render();
                });
                let T;
                const q = 0.01;
                this._scene.onPointerObservable.add((b) => {
                  if (this._globalState.controlCamera)
                    return;
                  if (b.type === d.PointerEventTypes.POINTERUP) {
                    T = void 0;
                    return;
                  }
                  if (b.event.buttons !== 1)
                    return;
                  T === void 0 && (T = b.event.offsetX);
                  const j = (T - b.event.offsetX) * q;
                  this._lightParent.rotation.y += j, T = b.event.offsetX;
                });
              }
              _reset() {
                this._globalState.envType = v.PreviewType.Room, this._globalState.previewType = v.PreviewType.Box, this._globalState.listOfCustomPreviewFiles = [], this._scene.meshes.forEach((p) => p.dispose()), this._globalState.onRefreshPreviewMeshControlComponentRequiredObservable.notifyObservers(), this._refreshPreviewMesh(!0);
              }
              _handleAnimations() {
                if (this._scene.stopAllAnimations(), this._globalState.rotatePreview)
                  for (const p of this._scene.rootNodes) {
                    const c = p;
                    (c.getClassName() === "TransformNode" || c.getClassName() === "Mesh" || c.getClassName() === "GroundMesh") && (c.rotationQuaternion && (c.rotation = c.rotationQuaternion.toEulerAngles(), c.rotationQuaternion = null), d.Animation.CreateAndStartAnimation("turnTable", p, "rotation.y", 60, 1200, c.rotation.y, c.rotation.y + 2 * Math.PI, 1));
                  }
              }
              _prepareLights() {
                const p = this._scene.lights.slice(0);
                for (const c of p)
                  c.dispose();
                if (this._globalState.hemisphericLight && new d.HemisphericLight("Hemispheric light", new d.Vector3(0, 1, 0), this._scene), this._globalState.directionalLight0) {
                  const c = new d.DirectionalLight("Directional light #0", new d.Vector3(0.841626576496605, -0.2193391004130599, -0.49351298337996535), this._scene);
                  c.intensity = 0.9, c.diffuse = new d.Color3(0.9294117647058824, 0.9725490196078431, 0.996078431372549), c.specular = new d.Color3(0.9294117647058824, 0.9725490196078431, 0.996078431372549), c.parent = this._lightParent;
                }
                if (this._globalState.directionalLight1) {
                  const c = new d.DirectionalLight("Directional light #1", new d.Vector3(-0.9519937437504213, -0.24389315636999764, -0.1849974057546125), this._scene);
                  c.intensity = 1.2, c.specular = new d.Color3(0.9803921568627451, 0.9529411764705882, 0.7725490196078432), c.diffuse = new d.Color3(0.9803921568627451, 0.9529411764705882, 0.7725490196078432), c.parent = this._lightParent;
                }
              }
              _prepareBackgroundHDR() {
                this._scene.environmentTexture = null, this._hdrSkyBox && this._scene.removeMesh(this._hdrSkyBox), this._globalState.backgroundHDR && (this._scene.environmentTexture = this._hdrTexture, this._hdrSkyBox = this._scene.createDefaultSkybox(this._hdrTexture)), this._updatePreview();
              }
              _prepareScene() {
                var p;
                switch (this._camera.useFramingBehavior = this._globalState.mode === d.NodeMaterialModes.Material, this._globalState.mode) {
                  case d.NodeMaterialModes.Material: {
                    this._prepareLights(), this._globalState.envFile || (this._globalState.backgroundHDR = !1), this._prepareBackgroundHDR();
                    const c = this._camera.getBehaviorByName("Framing");
                    setTimeout(() => {
                      if (c.framingTime = 0, c.elevationReturnTime = -1, this._scene.meshes.length) {
                        const H = this._scene.getWorldExtends();
                        this._camera.lowerRadiusLimit = null, this._camera.upperRadiusLimit = null, c.zoomOnBoundingInfo(H.min, H.max);
                      }
                      this._camera.pinchPrecision = 200 / this._camera.radius, this._camera.upperRadiusLimit = 5 * this._camera.radius;
                    }), this._camera.wheelDeltaPercentage = 0.01, this._camera.pinchDeltaPercentage = 0.01, this._handleAnimations();
                    break;
                  }
                  case d.NodeMaterialModes.PostProcess:
                  case d.NodeMaterialModes.ProceduralTexture: {
                    this._camera.radius = 4, this._camera.upperRadiusLimit = 10;
                    break;
                  }
                  case d.NodeMaterialModes.Particle: {
                    this._camera.radius = this._globalState.previewType === v.PreviewType.Explosion ? 50 : this._globalState.previewType === v.PreviewType.DefaultParticleSystem ? 6 : 20, this._camera.upperRadiusLimit = 5e3, this._globalState.particleSystemBlendMode = ((p = this._particleSystem) == null ? void 0 : p.blendMode) ?? d.ParticleSystem.BLENDMODE_STANDARD;
                    break;
                  }
                }
                this._updatePreview();
              }
              _refreshPreviewMesh(p) {
                switch (this._globalState.envType) {
                  case v.PreviewType.Room:
                    this._hdrTexture = new d.CubeTexture(l.DefaultEnvironmentURL, this._scene), this._hdrTexture && this._prepareBackgroundHDR();
                    break;
                  case v.PreviewType.Custom: {
                    const c = new Blob([this._globalState.envFile], { type: "octet/stream" }), H = new FileReader();
                    H.onload = (T) => {
                      const q = T.target.result;
                      this._hdrTexture = new d.CubeTexture(q, this._scene, void 0, !1, void 0, void 0, void 0, void 0, void 0, ".env"), this._prepareBackgroundHDR();
                    }, H.readAsDataURL(c);
                    break;
                  }
                }
                if (this._currentType !== this._globalState.previewType || this._currentType === v.PreviewType.Custom || p) {
                  if (this._currentType = this._globalState.previewType, this._meshes && this._meshes.length)
                    for (const T of this._meshes)
                      T.dispose();
                  this._meshes = [], this._layer && (this._layer.dispose(), this._layer = null);
                  const c = this._scene.lights.slice(0);
                  for (const T of c)
                    T.dispose();
                  this._engine.releaseEffects(), this._particleSystem && (this._particleSystem.onBeforeDrawParticlesObservable.clear(), this._particleSystem.onDisposeObservable.clear(), this._particleSystem.stop(), this._particleSystem.dispose(), this._particleSystem = null), d.SceneLoader.ShowLoadingScreen = !1, this._globalState.onIsLoadingChanged.notifyObservers(!0);
                  const H = (T) => {
                    T.bakeCurrentTransformIntoVertices(), T.refreshBoundingInfo();
                  };
                  if (this._globalState.mode === d.NodeMaterialModes.Material)
                    switch (this._globalState.previewType) {
                      case v.PreviewType.Box:
                        d.SceneLoader.AppendAsync("https://assets.babylonjs.com/meshes/", "roundedCube.glb", this._scene).then(() => {
                          H(this._scene.meshes[1]), this._meshes.push(...this._scene.meshes), this._prepareScene();
                        });
                        return;
                      case v.PreviewType.Sphere:
                        d.SceneLoader.AppendAsync("https://assets.babylonjs.com/meshes/", "previewSphere.glb", this._scene).then(() => {
                          H(this._scene.meshes[1]), this._meshes.push(...this._scene.meshes), this._prepareScene();
                        });
                        break;
                      case v.PreviewType.Torus:
                        this._meshes.push((0, d.CreateTorus)("dummy-torus", {
                          diameter: 2,
                          thickness: 0.5,
                          tessellation: 32
                        }, this._scene));
                        break;
                      case v.PreviewType.Cylinder:
                        d.SceneLoader.AppendAsync("https://assets.babylonjs.com/meshes/", "roundedCylinder.glb", this._scene).then(() => {
                          this._meshes.push(...this._scene.meshes), this._prepareScene();
                        });
                        return;
                      case v.PreviewType.Plane: {
                        d.SceneLoader.AppendAsync("https://assets.babylonjs.com/meshes/", "highPolyPlane.glb", this._scene).then(() => {
                          H(this._scene.meshes[1]), this._meshes.push(...this._scene.meshes), this._prepareScene();
                        });
                        break;
                      }
                      case v.PreviewType.ShaderBall:
                        d.SceneLoader.AppendAsync("https://assets.babylonjs.com/meshes/", "shaderBall.glb", this._scene).then(() => {
                          this._meshes.push(...this._scene.meshes), this._prepareScene();
                        });
                        return;
                      case v.PreviewType.Custom:
                        this._globalState.filesInput.loadFiles({ target: { files: this._globalState.listOfCustomPreviewFiles } });
                        return;
                    }
                  else if (this._globalState.mode === d.NodeMaterialModes.ProceduralTexture)
                    this._layer = new d.Layer("proceduralLayer", null, this._scene);
                  else if (this._globalState.mode === d.NodeMaterialModes.Particle)
                    switch (this._globalState.previewType) {
                      case v.PreviewType.DefaultParticleSystem:
                        this._particleSystem = d.ParticleHelper.CreateDefault(new d.Vector3(0, 0, 0), 500, this._scene), this._particleSystem.blendMode = d.DataStorage.ReadNumber("DefaultParticleSystemBlendMode", d.ParticleSystem.BLENDMODE_ONEONE), this._particleSystem.start();
                        break;
                      case v.PreviewType.Bubbles:
                        this._particleSystem = new d.ParticleSystem("particles", 4e3, this._scene), this._particleSystem.particleTexture = new d.Texture("https://assets.babylonjs.com/particles/textures/explosion/Flare.png", this._scene), this._particleSystem.minSize = 0.1, this._particleSystem.maxSize = 1, this._particleSystem.minLifeTime = 0.5, this._particleSystem.maxLifeTime = 5, this._particleSystem.minEmitPower = 0.5, this._particleSystem.maxEmitPower = 3, this._particleSystem.createBoxEmitter(new d.Vector3(-1, 1, -1), new d.Vector3(1, 1, 1), new d.Vector3(-0.1, -0.1, -0.1), new d.Vector3(0.1, 0.1, 0.1)), this._particleSystem.emitRate = 100, this._particleSystem.blendMode = d.DataStorage.ReadNumber("DefaultParticleSystemBlendMode", d.ParticleSystem.BLENDMODE_ONEONE), this._particleSystem.color1 = new d.Color4(1, 1, 0, 1), this._particleSystem.color2 = new d.Color4(1, 0.5, 0, 1), this._particleSystem.gravity = new d.Vector3(0, -1, 0), this._particleSystem.start();
                        break;
                      case v.PreviewType.Explosion:
                        this._loadParticleSystem(this._globalState.previewType, 1);
                        return;
                      case v.PreviewType.Fire:
                      case v.PreviewType.Rain:
                      case v.PreviewType.Smoke:
                        this._loadParticleSystem(this._globalState.previewType);
                        return;
                      case v.PreviewType.Custom:
                        (0, d.ReadFile)(this._globalState.previewFile, (T) => {
                          this._particleSystem = d.ParticleSystem.Parse(JSON.parse(T), this._scene, ""), this._particleSystem.start(), this._prepareScene();
                        }, void 0, !1, (T) => {
                          console.log(T);
                        });
                        return;
                    }
                  this._prepareScene();
                }
              }
              _loadParticleSystem(p, c = 0, H = !0) {
                let T = "";
                switch (p) {
                  case v.PreviewType.Explosion:
                    T = "explosion";
                    break;
                  case v.PreviewType.Fire:
                    T = "fire";
                    break;
                  case v.PreviewType.Rain:
                    T = "rain";
                    break;
                  case v.PreviewType.Smoke:
                    T = "smoke";
                    break;
                }
                d.ParticleHelper.CreateAsync(T, this._scene).then((q) => {
                  for (let b = 0; b < q.systems.length; ++b)
                    b == c ? (this._particleSystem = q.systems[b], this._particleSystem.disposeOnStop = !0, this._particleSystem.onDisposeObservable.add(() => {
                      this._loadParticleSystem(p, c, !1);
                    }), this._particleSystem.start()) : q.systems[b].dispose();
                  H ? this._prepareScene() : this._updatePreview();
                });
              }
              _forceCompilationAsync(p, c) {
                return p.forceCompilationAsync(c);
              }
              _updatePreview() {
                try {
                  const p = this._serializeMaterial(), c = d.NodeMaterial.IgnoreTexturesAtLoadTime;
                  d.NodeMaterial.IgnoreTexturesAtLoadTime = !1;
                  const H = d.NodeMaterial.Parse(p, this._scene);
                  switch (d.NodeMaterial.IgnoreTexturesAtLoadTime = c, H.backFaceCulling = this._globalState.backFaceCulling, H.needDepthPrePass = this._globalState.depthPrePass, this._postprocess && (this._postprocess.dispose(this._camera), this._postprocess = null), this._proceduralTexture && (this._proceduralTexture.dispose(), this._proceduralTexture = null), this._globalState.mode) {
                    case d.NodeMaterialModes.PostProcess: {
                      this._globalState.onIsLoadingChanged.notifyObservers(!1), this._postprocess = H.createPostProcess(this._camera, 1, d.Constants.TEXTURE_NEAREST_SAMPLINGMODE, this._engine);
                      const T = H.getBlockByPredicate((q) => q instanceof d.CurrentScreenBlock);
                      T && this._postprocess && (this._postprocess.externalTextureSamplerBinding = !0, this._postprocess.onApplyObservable.add((q) => {
                        q.setTexture("textureSampler", T.texture);
                      })), this._material && this._material.dispose(), this._material = H;
                      break;
                    }
                    case d.NodeMaterialModes.ProceduralTexture: {
                      this._globalState.onIsLoadingChanged.notifyObservers(!1), this._proceduralTexture = H.createProceduralTexture(512, this._scene), this._material && this._material.dispose(), this._layer && (this._layer.texture = this._proceduralTexture);
                      break;
                    }
                    case d.NodeMaterialModes.Particle: {
                      this._globalState.onIsLoadingChanged.notifyObservers(!1), this._particleSystem.onBeforeDrawParticlesObservable.clear(), this._particleSystem.onBeforeDrawParticlesObservable.add((T) => {
                        const q = H.getBlockByPredicate((b) => b instanceof d.ParticleTextureBlock);
                        q && q.texture && T && T.setTexture("diffuseSampler", q.texture);
                      }), H.createEffectForParticles(this._particleSystem), this._particleSystem.blendMode = this._globalState.particleSystemBlendMode, this._material && this._material.dispose(), this._material = H;
                      break;
                    }
                    default: {
                      if (this._meshes.length) {
                        const T = this._meshes.map((q) => this._forceCompilationAsync(H, q));
                        Promise.all(T).then(() => {
                          for (const q of this._meshes)
                            q.material = H;
                          this._material && this._material.dispose(), this._material = H, this._globalState.onIsLoadingChanged.notifyObservers(!1);
                        }).catch((q) => {
                          this._globalState.onLogRequiredObservable.notifyObservers(new u.LogEntry(`Shader compilation error:\r
` + q, !0)), this._globalState.onIsLoadingChanged.notifyObservers(!1);
                        });
                      } else
                        this._material = H;
                      break;
                    }
                  }
                } catch {
                  this._globalState.onIsLoadingChanged.notifyObservers(!1);
                }
              }
              dispose() {
                this._nodeMaterial.onBuildObservable.remove(this._onBuildObserver), this._globalState.onPreviewCommandActivated.remove(this._onPreviewCommandActivatedObserver), this._globalState.stateManager.onUpdateRequiredObservable.remove(this._onUpdateRequiredObserver), this._globalState.onAnimationCommandActivated.remove(this._onAnimationCommandActivatedObserver), this._globalState.onPreviewBackgroundChanged.remove(this._onPreviewBackgroundChangedObserver), this._globalState.onBackFaceCullingChanged.remove(this._onBackFaceCullingChangedObserver), this._globalState.onDepthPrePassChanged.remove(this._onDepthPrePassChangedObserver), this._globalState.onLightUpdated.remove(this._onLightUpdatedObserver), this._globalState.onBackgroundHDRUpdated.remove(this._onBackgroundHDRUpdatedObserver), this._material && this._material.dispose(!1, !0), this._camera.dispose();
                for (const p of this._meshes)
                  p.dispose();
                this._scene.dispose(), this._engine.dispose();
              }
            }
            l.DefaultEnvironmentURL = "https://assets.babylonjs.com/environments/environmentSpecular.env";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/previewMeshControlComponent.js": (
          /*!****************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/previewMeshControlComponent.js ***!
            \****************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              PreviewMeshControlComponent: () => (
                /* binding */
                b
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Materials/Node/Enums/nodeMaterialModes */
              "core/Misc/dataStorage"
            ), l = o(
              /*! ./previewType */
              "../../../tools/nodeEditor/dist/components/preview/previewType.js"
            ), P = o(
              /*! ./svgs/popOut.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/popOut.svg"
            ), p = o(
              /*! ./svgs/colorPicker.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/colorPicker.svg"
            ), c = o(
              /*! ./svgs/envPicker.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/envPicker.svg"
            ), H = o(
              /*! ./svgs/pauseIcon.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/pauseIcon.svg"
            ), T = o(
              /*! ./svgs/playIcon.svg */
              "../../../tools/nodeEditor/dist/components/preview/svgs/playIcon.svg"
            ), q = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            );
            class b extends v.Component {
              constructor(w) {
                super(w), this._colorInputRef = v.createRef(), this._filePickerRef = v.createRef(), this._envPickerRef = v.createRef(), this._onResetRequiredObserver = this.props.globalState.onResetRequiredObservable.add(() => {
                  this.forceUpdate();
                }), this._onDropEventObserver = this.props.globalState.onDropEventReceivedObservable.add((m) => {
                  this.useCustomMesh(m);
                }), this._onRefreshPreviewMeshControlComponentRequiredObserver = this.props.globalState.onRefreshPreviewMeshControlComponentRequiredObservable.add(() => {
                  this.forceUpdate();
                });
              }
              componentWillUnmount() {
                this.props.globalState.onResetRequiredObservable.remove(this._onResetRequiredObserver), this.props.globalState.onDropEventReceivedObservable.remove(this._onDropEventObserver), this.props.globalState.onRefreshPreviewMeshControlComponentRequiredObservable.remove(this._onRefreshPreviewMeshControlComponentRequiredObserver);
              }
              changeMeshType(w) {
                this.props.globalState.previewType !== w && (this.props.globalState.previewType = w, this.props.globalState.onPreviewCommandActivated.notifyObservers(!1), u.DataStorage.WriteNumber("PreviewType", w), this.forceUpdate());
              }
              useCustomMesh(w) {
                var I, N;
                const m = ((I = w.target) == null ? void 0 : I.files) || ((N = w.dataTransfer) == null ? void 0 : N.files);
                if (m && m.length) {
                  const k = m[0];
                  this.props.globalState.previewFile = k, this.props.globalState.previewType = l.PreviewType.Custom, this.props.globalState.listOfCustomPreviewFiles = [...m], this.props.globalState.onPreviewCommandActivated.notifyObservers(!1), this.forceUpdate();
                }
                this._filePickerRef.current && (this._filePickerRef.current.value = "");
              }
              useCustomEnv(w) {
                var I, N;
                const m = ((I = w.target) == null ? void 0 : I.files) || ((N = w.dataTransfer) == null ? void 0 : N.files);
                if (m && m.length) {
                  const k = m[0];
                  this.props.globalState.envFile = k, this.props.globalState.envType = l.PreviewType.Custom, this.props.globalState.onPreviewCommandActivated.notifyObservers(!1), this.forceUpdate();
                }
                this._envPickerRef.current && (this._envPickerRef.current.value = "");
              }
              onPopUp() {
                this.props.togglePreviewAreaComponent();
              }
              changeAnimation() {
                this.props.globalState.rotatePreview = !this.props.globalState.rotatePreview, this.props.globalState.onAnimationCommandActivated.notifyObservers(), this.forceUpdate();
              }
              changeBackground(w) {
                const m = u.Color3.FromHexString(w);
                u.DataStorage.WriteNumber("BackgroundColorR", m.r), u.DataStorage.WriteNumber("BackgroundColorG", m.g), u.DataStorage.WriteNumber("BackgroundColorB", m.b);
                const I = u.Color4.FromColor3(m, 1);
                this.props.globalState.backgroundColor = I, this.props.globalState.onPreviewBackgroundChanged.notifyObservers();
              }
              changeBackgroundClick() {
                var w;
                (w = this._colorInputRef.current) == null || w.click();
              }
              render() {
                const w = [
                  { label: "Cube", value: l.PreviewType.Box },
                  { label: "Cylinder", value: l.PreviewType.Cylinder },
                  { label: "Plane", value: l.PreviewType.Plane },
                  { label: "Shader ball", value: l.PreviewType.ShaderBall },
                  { label: "Sphere", value: l.PreviewType.Sphere },
                  { label: "Load...", value: l.PreviewType.Custom + 1 }
                ], m = [
                  { label: "Default", value: l.PreviewType.DefaultParticleSystem },
                  { label: "Bubbles", value: l.PreviewType.Bubbles },
                  { label: "Explosion", value: l.PreviewType.Explosion },
                  { label: "Fire", value: l.PreviewType.Fire },
                  { label: "Rain", value: l.PreviewType.Rain },
                  { label: "Smoke", value: l.PreviewType.Smoke },
                  { label: "Load...", value: l.PreviewType.Custom + 1 }
                ];
                this.props.globalState.listOfCustomPreviewFiles.length > 0 && (w.splice(0, 0, {
                  label: "Custom",
                  value: l.PreviewType.Custom
                }), m.splice(0, 0, {
                  label: "Custom",
                  value: l.PreviewType.Custom
                }));
                const I = this.props.globalState.mode === u.NodeMaterialModes.Particle ? m : w, N = this.props.globalState.mode === u.NodeMaterialModes.Particle ? ".json" : ".*";
                return (0, d.jsxs)("div", { id: "preview-mesh-bar", children: [(this.props.globalState.mode === u.NodeMaterialModes.Material || this.props.globalState.mode === u.NodeMaterialModes.Particle) && (0, d.jsxs)(d.Fragment, { children: [(0, d.jsx)(q.OptionsLineComponent, { label: "", options: I, target: this.props.globalState, propertyName: "previewType", noDirectUpdate: !0, onSelect: (k) => {
                  var R;
                  k !== l.PreviewType.Custom + 1 ? this.changeMeshType(k) : (R = this._filePickerRef.current) == null || R.click();
                } }), (0, d.jsxs)("div", { style: {
                  display: "none"
                }, title: "Preview with a custom mesh", children: [(0, d.jsx)("input", { ref: this._filePickerRef, multiple: !0, id: "file-picker", type: "file", onChange: (k) => this.useCustomMesh(k), accept: N }), (0, d.jsx)("input", { ref: this._envPickerRef, id: "env-picker", accept: ".env", type: "file", onChange: (k) => this.useCustomEnv(k) })] })] }), this.props.globalState.mode === u.NodeMaterialModes.Material && (0, d.jsxs)(d.Fragment, { children: [(0, d.jsx)("div", { id: "env-button", title: "Environment image", className: "button", onClick: (k) => {
                  var R;
                  return (R = this._envPickerRef.current) == null ? void 0 : R.click();
                }, children: (0, d.jsx)("img", { src: c, alt: "", id: "env-picker-image" }) }), (0, d.jsx)("div", { title: "Turn-table animation", onClick: () => this.changeAnimation(), className: "button", id: "play-button", children: this.props.globalState.rotatePreview ? (0, d.jsx)("img", { src: H, alt: "" }) : (0, d.jsx)("img", { src: T, alt: "" }) }), (0, d.jsxs)("div", { id: "color-picker-button", title: "Background color", className: "button align", onClick: (k) => this.changeBackgroundClick(), children: [(0, d.jsx)("img", { src: p, alt: "", id: "color-picker-image" }), (0, d.jsx)("input", { ref: this._colorInputRef, id: "color-picker", type: "color", value: this.props.globalState.backgroundColor.toHexString().slice(0, 7), onChange: (k) => this.changeBackground(k.target.value) })] })] }), (0, d.jsx)("div", { title: "Open preview in new window", id: "preview-new-window", onClick: () => this.onPopUp(), className: "button", children: (0, d.jsx)("img", { src: P, alt: "" }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/previewType.js": (
          /*!************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/previewType.js ***!
            \************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              PreviewType: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var d;
            (function(v) {
              v[v.Sphere = 0] = "Sphere", v[v.Box = 1] = "Box", v[v.Torus = 2] = "Torus", v[v.Cylinder = 3] = "Cylinder", v[v.Plane = 4] = "Plane", v[v.ShaderBall = 5] = "ShaderBall", v[v.DefaultParticleSystem = 6] = "DefaultParticleSystem", v[v.Bubbles = 7] = "Bubbles", v[v.Smoke = 8] = "Smoke", v[v.Rain = 9] = "Rain", v[v.Explosion = 10] = "Explosion", v[v.Fire = 11] = "Fire", v[v.Custom = 12] = "Custom", v[v.Room = 13] = "Room";
            })(d || (d = {}));
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/propertyTab/inputsPropertyTabComponent.js": (
          /*!*******************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/propertyTab/inputsPropertyTabComponent.js ***!
            \*******************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              InputsPropertyTabComponent: () => (
                /* binding */
                w
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! ../../sharedComponents/checkBoxLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/checkBoxLineComponent.js"
            ), P = o(
              /*! core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes */
              "core/Misc/dataStorage"
            );
            o(
              /*! ./propertyTab.scss */
              "../../../tools/nodeEditor/dist/components/propertyTab/propertyTab.scss"
            );
            var p = o(
              /*! shared-ui-components/lines/vector2LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js"
            ), c = o(
              /*! shared-ui-components/lines/vector3LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js"
            ), H = o(
              /*! shared-ui-components/lines/vector4LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector4LineComponent.js"
            ), T = o(
              /*! shared-ui-components/lines/color3LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js"
            ), q = o(
              /*! shared-ui-components/lines/color4LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js"
            ), b = o(
              /*! shared-ui-components/lines/floatLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js"
            ), j = o(
              /*! shared-ui-components/lines/sliderLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js"
            );
            class w extends v.Component {
              constructor(I) {
                super(I);
              }
              processInputBlockUpdate(I) {
                this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(I), I.isConstant && this.props.globalState.stateManager.onRebuildRequiredObservable.notifyObservers();
              }
              renderInputBlock(I) {
                switch (I.type) {
                  case P.NodeMaterialBlockConnectionPointTypes.Float: {
                    const N = isNaN(I.min) || isNaN(I.max) || I.min === I.max;
                    return (0, d.jsxs)("div", { children: [I.isBoolean && (0, d.jsx)(l.CheckBoxLineComponent, { label: I.name, target: I, propertyName: "value", onValueChanged: () => {
                      this.processInputBlockUpdate(I);
                    } }, I.uniqueId), !I.isBoolean && N && (0, d.jsx)(b.FloatLineComponent, { lockObject: this.props.lockObject, label: I.name, target: I, propertyName: "value", onChange: () => this.processInputBlockUpdate(I) }, I.uniqueId), !I.isBoolean && !N && (0, d.jsx)(j.SliderLineComponent, { lockObject: this.props.lockObject, label: I.name, target: I, propertyName: "value", step: (I.max - I.min) / 100, minimum: I.min, maximum: I.max, onChange: () => this.processInputBlockUpdate(I) }, I.uniqueId)] }, I.uniqueId);
                  }
                  case P.NodeMaterialBlockConnectionPointTypes.Color3:
                    return (0, d.jsx)(T.Color3LineComponent, { lockObject: this.props.lockObject, label: I.name, target: I, propertyName: "value", onChange: () => this.processInputBlockUpdate(I) }, I.uniqueId);
                  case P.NodeMaterialBlockConnectionPointTypes.Color4:
                    return (0, d.jsx)(q.Color4LineComponent, { lockObject: this.props.lockObject, label: I.name, target: I, propertyName: "value", onChange: () => this.processInputBlockUpdate(I) }, I.uniqueId);
                  case P.NodeMaterialBlockConnectionPointTypes.Vector2:
                    return (0, d.jsx)(p.Vector2LineComponent, { lockObject: this.props.lockObject, label: I.name, target: I, propertyName: "value", onChange: () => this.processInputBlockUpdate(I) }, I.uniqueId);
                  case P.NodeMaterialBlockConnectionPointTypes.Vector3:
                    return (0, d.jsx)(c.Vector3LineComponent, { lockObject: this.props.lockObject, label: I.name, target: I, propertyName: "value", onChange: () => this.processInputBlockUpdate(I) }, I.uniqueId);
                  case P.NodeMaterialBlockConnectionPointTypes.Vector4:
                    return (0, d.jsx)(H.Vector4LineComponent, { lockObject: this.props.lockObject, label: I.name, target: I, propertyName: "value", onChange: () => this.processInputBlockUpdate(I) }, I.uniqueId);
                }
                return null;
              }
              render() {
                return (0, d.jsx)(u.LineContainerComponent, { title: "INPUTS", children: this.props.inputs.map((I) => !I.isUniform || I.isSystemValue || !I.name ? null : this.renderInputBlock(I)) });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/propertyTab/properties/color3PropertyTabComponent.js": (
          /*!******************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/propertyTab/properties/color3PropertyTabComponent.js ***!
            \******************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Color3PropertyTabComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! shared-ui-components/lines/color3LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js"
            );
            class l extends v.Component {
              render() {
                return (0, d.jsx)(u.Color3LineComponent, { lockObject: this.props.lockObject, label: "Value", target: this.props.inputBlock, propertyName: "value", onChange: () => {
                  this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.inputBlock);
                } });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/propertyTab/properties/color4PropertyTabComponent.js": (
          /*!******************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/propertyTab/properties/color4PropertyTabComponent.js ***!
            \******************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Color4PropertyTabComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! shared-ui-components/lines/color4LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js"
            );
            class l extends v.Component {
              render() {
                return (0, d.jsx)(u.Color4LineComponent, { lockObject: this.props.lockObject, label: "Value", target: this.props.inputBlock, propertyName: "value", onChange: () => {
                  this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.inputBlock);
                } });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/propertyTab/properties/floatPropertyTabComponent.js": (
          /*!*****************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/propertyTab/properties/floatPropertyTabComponent.js ***!
            \*****************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              FloatPropertyTabComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! shared-ui-components/lines/floatLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js"
            );
            class l extends v.Component {
              render() {
                return (0, d.jsx)(u.FloatLineComponent, { lockObject: this.props.globalState.lockObject, label: "Value", target: this.props.inputBlock, propertyName: "value", onChange: () => {
                  this.props.inputBlock.isConstant && this.props.globalState.stateManager.onRebuildRequiredObservable.notifyObservers(), this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.inputBlock);
                } });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/propertyTab/properties/matrixPropertyTabComponent.js": (
          /*!******************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/propertyTab/properties/matrixPropertyTabComponent.js ***!
            \******************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              MatrixPropertyTabComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! shared-ui-components/lines/matrixLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/matrixLineComponent.js"
            );
            class l extends v.Component {
              render() {
                return (0, d.jsx)(u.MatrixLineComponent, { lockObject: this.props.lockObject, label: "Value", target: this.props.inputBlock, propertyName: "value", onChange: () => {
                  this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.inputBlock);
                }, mode: this.props.inputBlock.matrixMode, onModeChange: (p) => {
                  this.props.inputBlock.matrixMode = p;
                } });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/propertyTab/properties/vector2PropertyTabComponent.js": (
          /*!*******************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/propertyTab/properties/vector2PropertyTabComponent.js ***!
            \*******************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Vector2PropertyTabComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! shared-ui-components/lines/vector2LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js"
            );
            class l extends v.Component {
              render() {
                return (0, d.jsx)(u.Vector2LineComponent, { lockObject: this.props.lockObject, label: "Value", target: this.props.inputBlock, propertyName: "value", onChange: () => {
                  this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.inputBlock);
                } });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/propertyTab/properties/vector3PropertyTabComponent.js": (
          /*!*******************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/propertyTab/properties/vector3PropertyTabComponent.js ***!
            \*******************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Vector3PropertyTabComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! shared-ui-components/lines/vector3LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js"
            );
            class l extends v.Component {
              render() {
                return (0, d.jsx)(u.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Value", target: this.props.inputBlock, propertyName: "value", onChange: () => {
                  this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.inputBlock);
                } });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/propertyTab/properties/vector4PropertyTabComponent.js": (
          /*!*******************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/propertyTab/properties/vector4PropertyTabComponent.js ***!
            \*******************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Vector4PropertyTabComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! shared-ui-components/lines/vector4LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector4LineComponent.js"
            );
            class l extends v.Component {
              render() {
                return (0, d.jsx)(u.Vector4LineComponent, { lockObject: this.props.lockObject, label: "Value", target: this.props.inputBlock, propertyName: "value", onChange: () => {
                  this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.inputBlock);
                } });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/propertyTab/propertyTabComponent.js": (
          /*!*************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/propertyTab/propertyTabComponent.js ***!
            \*************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              PropertyTabComponent: () => (
                /* binding */
                ae
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! shared-ui-components/stringTools */
              "../../../dev/sharedUiComponents/dist/stringTools.js"
            ), P = o(
              /*! ../../sharedComponents/fileButtonLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/fileButtonLineComponent.js"
            ), p = o(
              /*! core/Engines/constants */
              "core/Misc/dataStorage"
            ), c = o(
              /*! ../../serializationTools */
              "../../../tools/nodeEditor/dist/serializationTools.js"
            ), H = o(
              /*! ../../sharedComponents/checkBoxLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/checkBoxLineComponent.js"
            ), T = o(
              /*! ../../graphSystem/properties/framePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/framePropertyComponent.js"
            ), q = o(
              /*! ../../graphSystem/properties/frameNodePortPropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/frameNodePortPropertyComponent.js"
            ), b = o(
              /*! ../../graphSystem/properties/nodePortPropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/nodePortPropertyComponent.js"
            ), j = o(
              /*! ../preview/previewType */
              "../../../tools/nodeEditor/dist/components/preview/previewType.js"
            ), w = o(
              /*! ./inputsPropertyTabComponent */
              "../../../tools/nodeEditor/dist/components/propertyTab/inputsPropertyTabComponent.js"
            ), m = o(
              /*! ../log/logComponent */
              "../../../tools/nodeEditor/dist/components/log/logComponent.js"
            );
            o(
              /*! ./propertyTab.scss */
              "../../../tools/nodeEditor/dist/components/propertyTab/propertyTab.scss"
            );
            var I = o(
              /*! shared-ui-components/nodeGraphSystem/graphNode */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.js"
            ), N = o(
              /*! shared-ui-components/nodeGraphSystem/graphFrame */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.js"
            ), k = o(
              /*! shared-ui-components/nodeGraphSystem/nodePort */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.js"
            ), R = o(
              /*! shared-ui-components/nodeGraphSystem/tools */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/tools.js"
            ), y = o(
              /*! shared-ui-components/lines/textInputLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js"
            ), O = o(
              /*! shared-ui-components/lines/vector2LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js"
            ), Y = o(
              /*! shared-ui-components/lines/vector3LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js"
            ), ee = o(
              /*! shared-ui-components/lines/vector4LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector4LineComponent.js"
            ), Z = o(
              /*! shared-ui-components/lines/color3LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js"
            ), te = o(
              /*! shared-ui-components/lines/color4LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js"
            ), fe = o(
              /*! shared-ui-components/lines/buttonLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js"
            ), _ = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            ), G = o(
              /*! shared-ui-components/lines/textLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js"
            ), L = o(
              /*! shared-ui-components/lines/floatLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js"
            ), $ = o(
              /*! shared-ui-components/lines/sliderLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js"
            );
            class ae extends v.Component {
              constructor(ge) {
                super(ge), this.state = { currentNode: null, currentFrame: null, currentFrameNodePort: null, currentNodePort: null, uploadInProgress: !1 }, this._modeSelect = v.createRef();
              }
              componentDidMount() {
                this.props.globalState.stateManager.onSelectionChangedObservable.add((ge) => {
                  const { selection: me } = ge || {};
                  me instanceof I.GraphNode ? this.setState({ currentNode: me, currentFrame: null, currentFrameNodePort: null, currentNodePort: null }) : me instanceof N.GraphFrame ? this.setState({ currentNode: null, currentFrame: me, currentFrameNodePort: null, currentNodePort: null }) : (0, R.IsFramePortData)(me) ? this.setState({ currentNode: null, currentFrame: me.frame, currentFrameNodePort: me.port, currentNodePort: null }) : me instanceof k.NodePort ? this.setState({ currentNode: null, currentFrame: null, currentFrameNodePort: null, currentNodePort: me }) : this.setState({ currentNode: null, currentFrame: null, currentFrameNodePort: null, currentNodePort: null });
                }), this._onBuiltObserver = this.props.globalState.onBuiltObservable.add(() => {
                  this.forceUpdate();
                });
              }
              componentWillUnmount() {
                this.props.globalState.onBuiltObservable.remove(this._onBuiltObserver);
              }
              processInputBlockUpdate(ge) {
                this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(ge), ge.isConstant && this.props.globalState.stateManager.onRebuildRequiredObservable.notifyObservers();
              }
              renderInputBlock(ge) {
                switch (ge.type) {
                  case p.NodeMaterialBlockConnectionPointTypes.Float: {
                    const me = isNaN(ge.min) || isNaN(ge.max) || ge.min === ge.max;
                    return (0, d.jsxs)("div", { children: [ge.isBoolean && (0, d.jsx)(H.CheckBoxLineComponent, { label: ge.name, target: ge, propertyName: "value", onValueChanged: () => {
                      this.processInputBlockUpdate(ge);
                    } }, ge.uniqueId), !ge.isBoolean && me && (0, d.jsx)(L.FloatLineComponent, { lockObject: this.props.lockObject, label: ge.name, target: ge, propertyName: "value", onChange: () => this.processInputBlockUpdate(ge) }, ge.uniqueId), !ge.isBoolean && !me && (0, d.jsx)($.SliderLineComponent, { lockObject: this.props.lockObject, label: ge.name, target: ge, propertyName: "value", step: (ge.max - ge.min) / 100, minimum: ge.min, maximum: ge.max, onChange: () => this.processInputBlockUpdate(ge) }, ge.uniqueId)] }, ge.uniqueId);
                  }
                  case p.NodeMaterialBlockConnectionPointTypes.Color3:
                    return (0, d.jsx)(Z.Color3LineComponent, { lockObject: this.props.lockObject, label: ge.name, target: ge, propertyName: "value", onChange: () => this.processInputBlockUpdate(ge) }, ge.uniqueId);
                  case p.NodeMaterialBlockConnectionPointTypes.Color4:
                    return (0, d.jsx)(te.Color4LineComponent, { lockObject: this.props.lockObject, label: ge.name, target: ge, propertyName: "value", onChange: () => this.processInputBlockUpdate(ge) }, ge.uniqueId);
                  case p.NodeMaterialBlockConnectionPointTypes.Vector2:
                    return (0, d.jsx)(O.Vector2LineComponent, { lockObject: this.props.lockObject, label: ge.name, target: ge, propertyName: "value", onChange: () => this.processInputBlockUpdate(ge) }, ge.uniqueId);
                  case p.NodeMaterialBlockConnectionPointTypes.Vector3:
                    return (0, d.jsx)(Y.Vector3LineComponent, { lockObject: this.props.lockObject, label: ge.name, target: ge, propertyName: "value", onChange: () => this.processInputBlockUpdate(ge) }, ge.uniqueId);
                  case p.NodeMaterialBlockConnectionPointTypes.Vector4:
                    return (0, d.jsx)(ee.Vector4LineComponent, { lockObject: this.props.lockObject, label: ge.name, target: ge, propertyName: "value", onChange: () => this.processInputBlockUpdate(ge) }, ge.uniqueId);
                }
                return null;
              }
              load(ge) {
                p.Tools.ReadFile(ge, (me) => {
                  const Xe = new TextDecoder("utf-8");
                  c.SerializationTools.Deserialize(JSON.parse(Xe.decode(me)), this.props.globalState), this.changeMode(this.props.globalState.nodeMaterial.mode, !0, !1) || this.props.globalState.onResetRequiredObservable.notifyObservers(!1), this.props.globalState.stateManager.onSelectionChangedObservable.notifyObservers(null);
                }, void 0, !0);
              }
              loadFrame(ge) {
                p.Tools.ReadFile(ge, (me) => {
                  const Xe = new TextDecoder("utf-8"), De = JSON.parse(Xe.decode(me));
                  c.SerializationTools.AddFrameToMaterial(De, this.props.globalState, this.props.globalState.nodeMaterial);
                }, void 0, !0);
              }
              save() {
                const ge = c.SerializationTools.Serialize(this.props.globalState.nodeMaterial, this.props.globalState);
                l.StringTools.DownloadAsFile(this.props.globalState.hostDocument, ge, "nodeMaterial.json");
              }
              customSave() {
                this.setState({ uploadInProgress: !0 }), this.props.globalState.onLogRequiredObservable.notifyObservers(new m.LogEntry("Saving your material to Babylon.js snippet server...", !1)), this.props.globalState.customSave.action(c.SerializationTools.Serialize(this.props.globalState.nodeMaterial, this.props.globalState)).then(() => {
                  this.props.globalState.onLogRequiredObservable.notifyObservers(new m.LogEntry("Material saved successfully", !1)), this.setState({ uploadInProgress: !1 });
                }).catch((ge) => {
                  this.props.globalState.onLogRequiredObservable.notifyObservers(new m.LogEntry(ge, !0)), this.setState({ uploadInProgress: !1 });
                });
              }
              saveToSnippetServer() {
                const ge = this.props.globalState.nodeMaterial, me = new XMLHttpRequest(), Xe = c.SerializationTools.Serialize(ge, this.props.globalState);
                me.onreadystatechange = () => {
                  if (me.readyState == 4)
                    if (me.status == 200) {
                      const ne = JSON.parse(me.responseText), re = ge.snippetId;
                      ge.snippetId = ne.id, ne.version && ne.version != "0" && (ge.snippetId += "#" + ne.version), this.forceUpdate(), navigator.clipboard && navigator.clipboard.writeText(ge.snippetId);
                      const ve = window;
                      ve.Playground && re && ve.Playground.onRequestCodeChangeObservable.notifyObservers({
                        regex: new RegExp(re, "g"),
                        replace: ge.snippetId
                      }), this.props.globalState.hostDocument.defaultView.alert("NodeMaterial saved with ID: " + ge.snippetId + " (please note that the id was also saved to your clipboard)");
                    } else
                      this.props.globalState.hostDocument.defaultView.alert(`Unable to save your node material. It may be too large (${(De.payload.length / 1024).toFixed(2)} KB) because of embedded textures. Please reduce texture sizes or point to a specific url instead of embedding them and try again.`);
                }, me.open("POST", p.NodeMaterial.SnippetUrl + (ge.snippetId ? "/" + ge.snippetId : ""), !0), me.setRequestHeader("Content-Type", "application/json");
                const De = {
                  payload: JSON.stringify({
                    nodeMaterial: Xe
                  }),
                  name: "",
                  description: "",
                  tags: ""
                };
                me.send(JSON.stringify(De));
              }
              loadFromSnippet() {
                const ge = this.props.globalState.nodeMaterial, me = ge.getScene(), Xe = this.props.globalState.hostDocument.defaultView.prompt("Please enter the snippet ID to use");
                Xe && (this.props.globalState.stateManager.onSelectionChangedObservable.notifyObservers(null), p.NodeMaterial.ParseFromSnippetAsync(Xe, me, "", ge).then(() => {
                  ge.build(), this.changeMode(this.props.globalState.nodeMaterial.mode, !0, !1) || this.props.globalState.onResetRequiredObservable.notifyObservers(!0);
                }).catch((De) => {
                  this.props.globalState.hostDocument.defaultView.alert("Unable to load your node material: " + De);
                }));
              }
              changeMode(ge, me = !1, Xe = !0) {
                var De, ne;
                if (this.props.globalState.mode === ge)
                  return !1;
                if (!me && !this.props.globalState.hostDocument.defaultView.confirm("Are your sure? You will lose your current changes (if any) if they are not saved!"))
                  return (De = this._modeSelect.current) == null || De.setValue(this.props.globalState.mode), !1;
                if (me && ((ne = this._modeSelect.current) == null || ne.setValue(ge)), Xe)
                  switch (ge) {
                    case p.NodeMaterialModes.Material:
                      this.props.globalState.nodeMaterial.setToDefault();
                      break;
                    case p.NodeMaterialModes.PostProcess:
                      this.props.globalState.nodeMaterial.setToDefaultPostProcess();
                      break;
                    case p.NodeMaterialModes.Particle:
                      this.props.globalState.nodeMaterial.setToDefaultParticle();
                      break;
                    case p.NodeMaterialModes.ProceduralTexture:
                      this.props.globalState.nodeMaterial.setToDefaultProceduralTexture();
                      break;
                  }
                switch (ge) {
                  case p.NodeMaterialModes.Material:
                    this.props.globalState.previewType = j.PreviewType.Sphere;
                    break;
                  case p.NodeMaterialModes.Particle:
                    this.props.globalState.previewType = j.PreviewType.Bubbles;
                    break;
                }
                return this.props.globalState.listOfCustomPreviewFiles = [], this.props.globalState.previewFile = void 0, p.DataStorage.WriteNumber("PreviewType", this.props.globalState.previewType), this.props.globalState.mode = ge, this.props.globalState.onResetRequiredObservable.notifyObservers(!0), this.props.globalState.envFile = void 0, p.DataStorage.WriteNumber("EnvType", this.props.globalState.envType), !0;
              }
              render() {
                var De, ne;
                if (this.state.currentNode)
                  return (0, d.jsxs)("div", { id: "propertyTab", children: [(0, d.jsxs)("div", { id: "header", children: [(0, d.jsx)("img", { id: "logo", src: "https://www.babylonjs.com/Assets/logo-babylonjs-social-twitter.png" }), (0, d.jsx)("div", { id: "title", children: "NODE MATERIAL EDITOR" })] }), ((De = this.state.currentNode) == null ? void 0 : De.renderProperties()) || ((ne = this.state.currentNodePort) == null ? void 0 : ne.node.renderProperties())] });
                if (this.state.currentFrameNodePort && this.state.currentFrame)
                  return (0, d.jsx)(q.FrameNodePortPropertyTabComponent, { globalState: this.props.globalState, stateManager: this.props.globalState.stateManager, frame: this.state.currentFrame, frameNodePort: this.state.currentFrameNodePort });
                if (this.state.currentNodePort)
                  return (0, d.jsx)(b.NodePortPropertyTabComponent, { stateManager: this.props.globalState.stateManager, nodePort: this.state.currentNodePort });
                if (this.state.currentFrame)
                  return (0, d.jsx)(T.FramePropertyTabComponent, { globalState: this.props.globalState, frame: this.state.currentFrame });
                const ge = p.DataStorage.ReadNumber("GridSize", 20), me = [
                  { label: "Material", value: p.NodeMaterialModes.Material },
                  { label: "Post Process", value: p.NodeMaterialModes.PostProcess },
                  { label: "Particle", value: p.NodeMaterialModes.Particle },
                  { label: "Procedural", value: p.NodeMaterialModes.ProceduralTexture }
                ], Xe = [
                  { label: "Combine", value: p.Constants.ALPHA_COMBINE },
                  { label: "One one", value: p.Constants.ALPHA_ONEONE },
                  { label: "Add", value: p.Constants.ALPHA_ADD },
                  { label: "Subtract", value: p.Constants.ALPHA_SUBTRACT },
                  { label: "Multiply", value: p.Constants.ALPHA_MULTIPLY },
                  { label: "Maximized", value: p.Constants.ALPHA_MAXIMIZED },
                  { label: "Pre-multiplied", value: p.Constants.ALPHA_PREMULTIPLIED }
                ];
                return (0, d.jsxs)("div", { id: "propertyTab", children: [(0, d.jsxs)("div", { id: "header", children: [(0, d.jsx)("img", { id: "logo", src: "https://www.babylonjs.com/Assets/logo-babylonjs-social-twitter.png" }), (0, d.jsx)("div", { id: "title", children: "NODE MATERIAL EDITOR" })] }), (0, d.jsxs)("div", { children: [(0, d.jsxs)(u.LineContainerComponent, { title: "GENERAL", children: [(0, d.jsx)(_.OptionsLineComponent, { ref: this._modeSelect, label: "Mode", target: this, extractValue: () => this.props.globalState.mode, options: me, onSelect: (re) => this.changeMode(re), propertyName: "" }), (0, d.jsx)(G.TextLineComponent, { label: "Version", value: p.Engine.Version }), (0, d.jsx)(G.TextLineComponent, { label: "Help", value: "doc.babylonjs.com", underline: !0, onLink: () => this.props.globalState.hostDocument.defaultView.open("https://doc.babylonjs.com/how_to/node_material", "_blank") }), (0, d.jsx)(y.TextInputLineComponent, { label: "Comment", multilines: !0, lockObject: this.props.globalState.lockObject, value: this.props.globalState.nodeMaterial.comment, target: this.props.globalState.nodeMaterial, propertyName: "comment" }), (0, d.jsx)(fe.ButtonLineComponent, { label: "Reset to default", onClick: () => {
                  switch (this.props.globalState.mode) {
                    case p.NodeMaterialModes.Material:
                      this.props.globalState.nodeMaterial.setToDefault();
                      break;
                    case p.NodeMaterialModes.PostProcess:
                      this.props.globalState.nodeMaterial.setToDefaultPostProcess();
                      break;
                    case p.NodeMaterialModes.Particle:
                      this.props.globalState.nodeMaterial.setToDefaultParticle();
                      break;
                    case p.NodeMaterialModes.ProceduralTexture:
                      this.props.globalState.nodeMaterial.setToDefaultProceduralTexture();
                      break;
                  }
                  this.props.globalState.onResetRequiredObservable.notifyObservers(!0);
                } })] }), (0, d.jsxs)(u.LineContainerComponent, { title: "UI", children: [(0, d.jsx)(fe.ButtonLineComponent, { label: "Zoom to fit", onClick: () => {
                  this.props.globalState.onZoomToFitRequiredObservable.notifyObservers();
                } }), (0, d.jsx)(fe.ButtonLineComponent, { label: "Reorganize", onClick: () => {
                  this.props.globalState.onReOrganizedRequiredObservable.notifyObservers();
                } })] }), (0, d.jsxs)(u.LineContainerComponent, { title: "OPTIONS", children: [(0, d.jsx)(H.CheckBoxLineComponent, { label: "Embed textures when saving", isSelected: () => p.DataStorage.ReadBoolean("EmbedTextures", !0), onSelect: (re) => {
                  p.DataStorage.WriteBoolean("EmbedTextures", re);
                } }), (0, d.jsx)($.SliderLineComponent, { lockObject: this.props.lockObject, label: "Grid size", minimum: 0, maximum: 100, step: 5, decimalCount: 0, directValue: ge, onChange: (re) => {
                  p.DataStorage.WriteNumber("GridSize", re), this.props.globalState.stateManager.onGridSizeChanged.notifyObservers(), this.forceUpdate();
                } }), (0, d.jsx)(H.CheckBoxLineComponent, { label: "Show grid", isSelected: () => p.DataStorage.ReadBoolean("ShowGrid", !0), onSelect: (re) => {
                  p.DataStorage.WriteBoolean("ShowGrid", re), this.props.globalState.stateManager.onGridSizeChanged.notifyObservers();
                } })] }), (0, d.jsxs)(u.LineContainerComponent, { title: "FILE", children: [(0, d.jsx)(P.FileButtonLineComponent, { label: "Load", onClick: (re) => this.load(re), accept: ".json" }), (0, d.jsx)(fe.ButtonLineComponent, { label: "Save", onClick: () => {
                  this.save();
                } }), (0, d.jsx)(fe.ButtonLineComponent, { label: "Generate code", onClick: () => {
                  l.StringTools.DownloadAsFile(this.props.globalState.hostDocument, this.props.globalState.nodeMaterial.generateCode(), "code.txt");
                } }), (0, d.jsx)(fe.ButtonLineComponent, { label: "Export shaders", onClick: () => {
                  this.props.globalState.nodeMaterial.build(), l.StringTools.DownloadAsFile(this.props.globalState.hostDocument, this.props.globalState.nodeMaterial.compiledShaders, "shaders.txt");
                } }), this.props.globalState.customSave && (0, d.jsx)(fe.ButtonLineComponent, { label: this.props.globalState.customSave.label, isDisabled: this.state.uploadInProgress, onClick: () => {
                  this.customSave();
                } }), (0, d.jsx)(P.FileButtonLineComponent, { label: "Load Frame", uploadName: "frame-upload", onClick: (re) => this.loadFrame(re), accept: ".json" })] }), !this.props.globalState.customSave && (0, d.jsxs)(u.LineContainerComponent, { title: "SNIPPET", children: [this.props.globalState.nodeMaterial.snippetId && (0, d.jsx)(G.TextLineComponent, { label: "Snippet ID", value: this.props.globalState.nodeMaterial.snippetId }), (0, d.jsx)(fe.ButtonLineComponent, { label: "Load from snippet server", onClick: () => this.loadFromSnippet() }), (0, d.jsx)(fe.ButtonLineComponent, { label: "Save to snippet server", onClick: () => {
                  this.saveToSnippetServer();
                } })] }), (0, d.jsxs)(u.LineContainerComponent, { title: "TRANSPARENCY", children: [(0, d.jsx)(H.CheckBoxLineComponent, { label: "Force alpha blending", target: this.props.globalState.nodeMaterial, propertyName: "forceAlphaBlending", onValueChanged: () => this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(null) }), (0, d.jsx)(_.OptionsLineComponent, { label: "Alpha mode", options: Xe, target: this.props.globalState.nodeMaterial, propertyName: "alphaMode", onSelect: () => this.props.globalState.stateManager.onUpdateRequiredObservable.notifyObservers(null) })] }), (0, d.jsx)(w.InputsPropertyTabComponent, { lockObject: this.props.lockObject, globalState: this.props.globalState, inputs: this.props.globalState.nodeMaterial.getInputBlocks() })] })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/globalState.js": (
          /*!*****************************************************!*\
            !*** ../../../tools/nodeEditor/dist/globalState.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              GlobalState: () => (
                /* binding */
                q
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Particles/particleSystem */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ./components/preview/previewType */
              "../../../tools/nodeEditor/dist/components/preview/previewType.js"
            ), u = o(
              /*! ./graphSystem/registerElbowSupport */
              "../../../tools/nodeEditor/dist/graphSystem/registerElbowSupport.js"
            ), l = o(
              /*! ./graphSystem/registerNodePortDesign */
              "../../../tools/nodeEditor/dist/graphSystem/registerNodePortDesign.js"
            ), P = o(
              /*! shared-ui-components/tabs/propertyGrids/lockObject */
              "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js"
            ), p = o(
              /*! shared-ui-components/nodeGraphSystem/stateManager */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/stateManager.js"
            ), c = o(
              /*! ./graphSystem/registerDefaultInput */
              "../../../tools/nodeEditor/dist/graphSystem/registerDefaultInput.js"
            ), H = o(
              /*! ./graphSystem/registerExportData */
              "../../../tools/nodeEditor/dist/graphSystem/registerExportData.js"
            ), T = o(
              /*! ./graphSystem/registerDebugSupport */
              "../../../tools/nodeEditor/dist/graphSystem/registerDebugSupport.js"
            );
            class q {
              /** Gets the mode */
              get mode() {
                return this._mode;
              }
              /** Sets the mode */
              set mode(j) {
                d.DataStorage.WriteNumber("Mode", j), this._mode = j, this.onPreviewCommandActivated.notifyObservers(!0);
              }
              constructor() {
                this.onBuiltObservable = new d.Observable(), this.onResetRequiredObservable = new d.Observable(), this.onZoomToFitRequiredObservable = new d.Observable(), this.onReOrganizedRequiredObservable = new d.Observable(), this.onLogRequiredObservable = new d.Observable(), this.onIsLoadingChanged = new d.Observable(), this.onPreviewCommandActivated = new d.Observable(), this.onLightUpdated = new d.Observable(), this.onBackgroundHDRUpdated = new d.Observable(), this.onPreviewBackgroundChanged = new d.Observable(), this.onBackFaceCullingChanged = new d.Observable(), this.onDepthPrePassChanged = new d.Observable(), this.onAnimationCommandActivated = new d.Observable(), this.onImportFrameObservable = new d.Observable(), this.onPopupClosedObservable = new d.Observable(), this.onDropEventReceivedObservable = new d.Observable(), this.particleSystemBlendMode = d.ParticleSystem.BLENDMODE_ONEONE, this.listOfCustomPreviewFiles = [], this.lockObject = new P.LockObject(), this.pointerOverCanvas = !1, this.onRefreshPreviewMeshControlComponentRequiredObservable = new d.Observable(), this.previewType = d.DataStorage.ReadNumber("PreviewType", v.PreviewType.Box), this.envType = d.DataStorage.ReadNumber("EnvType", v.PreviewType.Room), this.backFaceCulling = d.DataStorage.ReadBoolean("BackFaceCulling", !0), this.depthPrePass = d.DataStorage.ReadBoolean("DepthPrePass", !1), this.hemisphericLight = d.DataStorage.ReadBoolean("HemisphericLight", !0), this.directionalLight0 = d.DataStorage.ReadBoolean("DirectionalLight0", !1), this.directionalLight1 = d.DataStorage.ReadBoolean("DirectionalLight1", !1), this.backgroundHDR = d.DataStorage.ReadBoolean("backgroundHDR", !1), this.controlCamera = d.DataStorage.ReadBoolean("ControlCamera", !0), this._mode = d.DataStorage.ReadNumber("Mode", d.NodeMaterialModes.Material), this.stateManager = new p.StateManager(), this.stateManager.data = this, this.stateManager.lockObject = this.lockObject, (0, u.RegisterElbowSupport)(this.stateManager), (0, T.RegisterDebugSupport)(this.stateManager), (0, l.RegisterNodePortDesign)(this.stateManager), (0, c.RegisterDefaultInput)(this.stateManager), (0, H.RegisterExportData)(this.stateManager);
                const j = d.DataStorage.ReadNumber("BackgroundColorR", 0.12549019607843137), w = d.DataStorage.ReadNumber("BackgroundColorG", 0.09803921568627451), m = d.DataStorage.ReadNumber("BackgroundColorB", 0.25098039215686274);
                this.backgroundColor = new d.Color4(j, w, m, 1);
              }
              storeEditorData(j, w) {
                this.stateManager.storeEditorData(j, w);
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphEditor.js": (
          /*!*****************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphEditor.js ***!
            \*****************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              GraphEditor: () => (
                /* binding */
                R
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Materials/Node/Blocks/Input/inputBlock */
              "core/Misc/dataStorage"
            ), l = o(
              /*! ./components/nodeList/nodeListComponent */
              "../../../tools/nodeEditor/dist/components/nodeList/nodeListComponent.js"
            ), P = o(
              /*! ./components/propertyTab/propertyTabComponent */
              "../../../tools/nodeEditor/dist/components/propertyTab/propertyTabComponent.js"
            ), p = o(
              /*! ./portal */
              "../../../tools/nodeEditor/dist/portal.js"
            ), c = o(
              /*! ./components/log/logComponent */
              "../../../tools/nodeEditor/dist/components/log/logComponent.js"
            ), H = o(
              /*! shared-ui-components/components/MessageDialog */
              "../../../dev/sharedUiComponents/dist/components/MessageDialog.js"
            ), T = o(
              /*! ./blockTools */
              "../../../tools/nodeEditor/dist/blockTools.js"
            ), q = o(
              /*! ./components/preview/previewManager */
              "../../../tools/nodeEditor/dist/components/preview/previewManager.js"
            ), b = o(
              /*! ./components/preview/previewMeshControlComponent */
              "../../../tools/nodeEditor/dist/components/preview/previewMeshControlComponent.js"
            ), j = o(
              /*! ./components/preview/previewAreaComponent */
              "../../../tools/nodeEditor/dist/components/preview/previewAreaComponent.js"
            ), w = o(
              /*! ./serializationTools */
              "../../../tools/nodeEditor/dist/serializationTools.js"
            ), m = o(
              /*! react-dom */
              "../../../../node_modules/react-dom/index.js"
            ), I = o(
              /*! ./sharedComponents/popup */
              "../../../tools/nodeEditor/dist/sharedComponents/popup.js"
            );
            o(
              /*! ./main.scss */
              "../../../tools/nodeEditor/dist/main.scss"
            );
            var N = o(
              /*! shared-ui-components/nodeGraphSystem/graphCanvas */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphCanvas.js"
            ), k = o(
              /*! shared-ui-components/nodeGraphSystem/typeLedger */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/typeLedger.js"
            );
            class R extends v.Component {
              appendBlock(O, Y = !0) {
                return this._graphCanvas.createNodeFromObject(O instanceof u.NodeMaterialBlock ? k.TypeLedger.NodeDataBuilder(O, this._graphCanvas) : O, (ee) => {
                  this.props.globalState.nodeMaterial.attachedBlocks.indexOf(ee) === -1 && this.props.globalState.nodeMaterial.attachedBlocks.push(ee), ee.isFinalMerger && this.props.globalState.nodeMaterial.addOutputNode(ee);
                }, Y);
              }
              addValueNode(O) {
                const Y = T.BlockTools.GetConnectionNodeTypeFromString(O), ee = new u.InputBlock(O, void 0, Y);
                return this.appendBlock(ee);
              }
              componentDidMount() {
                window.addEventListener("wheel", this.onWheel, { passive: !1 }), this.props.globalState.hostDocument && (this._graphCanvas = this._graphCanvasRef.current, this._diagramContainer = this._diagramContainerRef.current, this._previewManager = new q.PreviewManager(this.props.globalState.hostDocument.getElementById("preview-canvas"), this.props.globalState), this.props.globalState._previewManager = this._previewManager), navigator.userAgent.indexOf("Mobile") !== -1 && ((this.props.globalState.hostDocument || document).querySelector(".blocker").style.visibility = "visible"), this.props.globalState.onPopupClosedObservable.addOnce(() => {
                  this.componentWillUnmount();
                }), this.build();
              }
              componentWillUnmount() {
                window.removeEventListener("wheel", this.onWheel), this.props.globalState.hostDocument && this.props.globalState.hostDocument.removeEventListener("keyup", this._onWidgetKeyUpPointer, !1), this._previewManager && (this._previewManager.dispose(), this._previewManager = null);
              }
              constructor(O) {
                super(O), this._leftWidth = u.DataStorage.ReadNumber("LeftWidth", 200), this._rightWidth = u.DataStorage.ReadNumber("RightWidth", 300), this._mouseLocationX = 0, this._mouseLocationY = 0, this.onWheel = (Y) => {
                  if (this.props.globalState.pointerOverCanvas || Y.ctrlKey)
                    return Y.preventDefault();
                  if (Math.abs(Y.deltaX) < Math.abs(Y.deltaY))
                    return;
                  const ee = Y.currentTarget, Z = ee.scrollWidth - ee.offsetWidth;
                  if (ee.scrollLeft + Y.deltaX < 0 || ee.scrollLeft + Y.deltaX > Z)
                    return Y.preventDefault();
                }, this.handlePopUp = () => {
                  this.setState({
                    showPreviewPopUp: !0
                  }), this.createPopUp(), this.props.globalState.hostWindow.addEventListener("beforeunload", this.handleClosingPopUp);
                }, this.handleClosingPopUp = () => {
                  this._previewManager && this._previewManager.dispose(), this._popUpWindow.close(), this.setState({
                    showPreviewPopUp: !1
                  }, () => this.initiatePreviewArea());
                }, this.initiatePreviewArea = (Y = this.props.globalState.hostDocument.getElementById("preview-canvas")) => {
                  this._previewManager = new q.PreviewManager(Y, this.props.globalState);
                }, this.createPopUp = () => {
                  const ee = {
                    embedHostWidth: "100%",
                    ...{
                      original: !0,
                      popup: !0,
                      overlay: !1,
                      embedMode: !1,
                      enableClose: !0,
                      handleResize: !0,
                      enablePopup: !0
                    }
                  }, Z = this.createPopupWindow("PREVIEW AREA", "_PreviewHostWindow");
                  if (Z) {
                    Z.addEventListener("beforeunload", this.handleClosingPopUp);
                    const te = Z.document.getElementById("node-editor-graph-root");
                    this.createPreviewMeshControlHost(ee, te), this.createPreviewHost(ee, te), te && (this.fixPopUpStyles(te.ownerDocument), this.initiatePreviewArea(te.ownerDocument.getElementById("preview-canvas")));
                  }
                }, this.createPopupWindow = (Y, ee, Z = 500, te = 500) => {
                  const fe = {
                    width: Z,
                    height: te,
                    top: (this.props.globalState.hostWindow.innerHeight - Z) / 2 + window.screenY,
                    left: (this.props.globalState.hostWindow.innerWidth - te) / 2 + window.screenX
                  }, _ = Object.keys(fe).map((ae) => ae + "=" + fe[ae]).join(","), G = this.props.globalState.hostWindow.open("", Y, _);
                  if (!G)
                    return null;
                  const L = G.document;
                  L.title = Y, L.body.style.width = "100%", L.body.style.height = "100%", L.body.style.margin = "0", L.body.style.padding = "0";
                  const $ = L.createElement("div");
                  return $.style.width = "100%", $.style.height = "100%", $.style.margin = "0", $.style.padding = "0", $.style.display = "grid", $.style.gridTemplateRows = "40px auto", $.id = "node-editor-graph-root", $.className = "nme-right-panel popup", G.document.body.appendChild($), I.Popup._CopyStyles(this.props.globalState.hostWindow.document, L), this[ee] = G, this._popUpWindow = G, G;
                }, this.createPreviewMeshControlHost = (Y, ee) => {
                  if (ee) {
                    const Z = ee.ownerDocument.createElement("div");
                    Z.id = "PreviewMeshControl-host", Z.style.width = Y.embedHostWidth || "auto", ee.appendChild(Z);
                    const te = v.createElement(b.PreviewMeshControlComponent, {
                      globalState: this.props.globalState,
                      togglePreviewAreaComponent: this.handlePopUp
                    });
                    m.render(te, Z);
                  }
                }, this.createPreviewHost = (Y, ee) => {
                  if (ee) {
                    const Z = ee.ownerDocument.createElement("div");
                    Z.id = "PreviewAreaComponent-host", Z.style.width = Y.embedHostWidth || "auto", Z.style.height = "100%", Z.style.overflow = "hidden", Z.style.display = "grid", Z.style.gridRow = "2", Z.style.gridTemplateRows = "auto 40px", Z.style.gridTemplateRows = "calc(100% - 40px) 40px", ee.appendChild(Z), this._previewHost = Z, Y.overlay || (this._previewHost.style.position = "relative");
                  }
                  if (this._previewHost) {
                    const Z = v.createElement(j.PreviewAreaComponent, {
                      globalState: this.props.globalState,
                      width: 200
                    });
                    m.render(Z, this._previewHost);
                  }
                }, this.fixPopUpStyles = (Y) => {
                  const ee = Y.getElementById("preview");
                  ee && (ee.style.height = "auto", ee.style.gridRow = "1");
                  const Z = Y.getElementById("preview-config-bar");
                  Z && (Z.style.gridRow = "2");
                  const te = Y.getElementById("preview-new-window");
                  te && (te.style.display = "none");
                  const fe = Y.getElementById("preview-mesh-bar");
                  fe && (fe.style.gridTemplateColumns = "auto 1fr 40px 40px");
                }, this.state = {
                  showPreviewPopUp: !1,
                  message: "",
                  isError: !0
                }, this._graphCanvasRef = v.createRef(), this._diagramContainerRef = v.createRef(), this.props.globalState.stateManager.onNewBlockRequiredObservable.add((Y) => {
                  let ee = Y.targetX, Z = Y.targetY;
                  Y.needRepositioning && (ee = ee - this._diagramContainer.offsetLeft, Z = Z - this._diagramContainer.offsetTop);
                  const te = this._graphCanvas.selectedLink, fe = this._graphCanvas.selectedNodes.length ? this._graphCanvas.selectedNodes[0] : null, _ = this.emitNewBlock(Y.type, ee, Z);
                  _ && Y.smartAdd && (te ? this._graphCanvas.smartAddOverLink(_, te) : fe && this._graphCanvas.smartAddOverNode(_, fe));
                }), this.props.globalState.stateManager.onRebuildRequiredObservable.add(() => {
                  this.props.globalState.nodeMaterial && this.buildMaterial();
                }), this.props.globalState.onResetRequiredObservable.add((Y) => {
                  Y ? (this.props.globalState.nodeMaterial && this.buildMaterial(), this.build(!0)) : (this.build(), this.props.globalState.nodeMaterial && this.buildMaterial());
                }), this.props.globalState.onImportFrameObservable.add((Y) => {
                  const ee = Y.editorData.frames[0];
                  this.props.globalState.nodeMaterial.attachedBlocks.slice(-ee.blocks.length).forEach((Z) => {
                    this.appendBlock(Z);
                  }), this._graphCanvas.addFrame(ee), this.reOrganize(this.props.globalState.nodeMaterial.editorData, !0);
                }), this.props.globalState.onZoomToFitRequiredObservable.add(() => {
                  this.zoomToFit();
                }), this.props.globalState.onReOrganizedRequiredObservable.add(() => {
                  this.reOrganize();
                }), this.props.globalState.onGetNodeFromBlock = (Y) => this._graphCanvas.findNodeFromData(Y), this.props.globalState.hostDocument.addEventListener("keydown", (Y) => {
                  this._graphCanvas.handleKeyDown(Y, (ee) => {
                    this.props.globalState.nodeMaterial.removeBlock(ee.data);
                  }, this._mouseLocationX, this._mouseLocationY, (ee) => {
                    const te = ee.data.clone(this.props.globalState.nodeMaterial.getScene());
                    return te ? this.appendBlock(te, !1) : null;
                  }, this.props.globalState.hostDocument.querySelector(".diagram-container"));
                }), this.props.globalState.stateManager.onErrorMessageDialogRequiredObservable.add((Y) => {
                  this.setState({ message: Y, isError: !0 });
                });
              }
              zoomToFit() {
                this._graphCanvas.zoomToFit();
              }
              buildMaterial() {
                if (this.props.globalState.nodeMaterial) {
                  try {
                    this.props.globalState.nodeMaterial.options.emitComments = !0, this.props.globalState.nodeMaterial.build(!0), this.props.globalState.onLogRequiredObservable.notifyObservers(new c.LogEntry("Node material build successful", !1));
                  } catch (O) {
                    this.props.globalState.onLogRequiredObservable.notifyObservers(new c.LogEntry(O, !0));
                  }
                  w.SerializationTools.UpdateLocations(this.props.globalState.nodeMaterial, this.props.globalState), this.props.globalState.onBuiltObservable.notifyObservers();
                }
              }
              build(O = !1) {
                let Y = O ? null : this.props.globalState.nodeMaterial.editorData;
                this._graphCanvas._isLoading = !0, Y instanceof Array && (Y = {
                  locations: Y
                }), this._graphCanvas.reset(), this.props.globalState.nodeMaterial && this.loadGraph(), this.reOrganize(Y);
              }
              loadGraph() {
                const O = this.props.globalState.nodeMaterial;
                O._vertexOutputNodes.forEach((Y) => {
                  this.appendBlock(Y, !0);
                }), O._fragmentOutputNodes.forEach((Y) => {
                  this.appendBlock(Y, !0);
                }), O.attachedBlocks.forEach((Y) => {
                  this.appendBlock(Y, !0);
                }), O.attachedBlocks.forEach((Y) => {
                  if (Y.inputs.length) {
                    const ee = this._graphCanvas.findNodeFromData(Y);
                    for (const Z of ee.content.inputs)
                      Z.isConnected && this._graphCanvas.connectPorts(Z.connectedPort, Z);
                  }
                });
              }
              showWaitScreen() {
                var O;
                (O = this.props.globalState.hostDocument.querySelector(".wait-screen")) == null || O.classList.remove("hidden");
              }
              hideWaitScreen() {
                var O;
                (O = this.props.globalState.hostDocument.querySelector(".wait-screen")) == null || O.classList.add("hidden");
              }
              reOrganize(O = null, Y = !1) {
                this.showWaitScreen(), this._graphCanvas._isLoading = !0, setTimeout(() => {
                  this._graphCanvas.reOrganize(O, Y), this.hideWaitScreen();
                });
              }
              onPointerDown(O) {
                this._startX = O.clientX, this._moveInProgress = !0, O.currentTarget.setPointerCapture(O.pointerId);
              }
              onPointerUp(O) {
                this._moveInProgress = !1, O.currentTarget.releasePointerCapture(O.pointerId);
              }
              resizeColumns(O, Y = !0) {
                if (!this._moveInProgress)
                  return;
                const ee = O.clientX - this._startX, Z = O.currentTarget.ownerDocument.getElementById("node-editor-graph-root");
                Y ? (this._leftWidth += ee, this._leftWidth = Math.max(150, Math.min(400, this._leftWidth)), u.DataStorage.WriteNumber("LeftWidth", this._leftWidth)) : (this._rightWidth -= ee, this._rightWidth = Math.max(250, Math.min(500, this._rightWidth)), u.DataStorage.WriteNumber("RightWidth", this._rightWidth), Z.ownerDocument.getElementById("preview").style.height = this._rightWidth + "px"), Z.style.gridTemplateColumns = this.buildColumnLayout(), this._startX = O.clientX;
              }
              buildColumnLayout() {
                return `${this._leftWidth}px 4px calc(100% - ${this._leftWidth + 8 + this._rightWidth}px) 4px ${this._rightWidth}px`;
              }
              emitNewBlock(O, Y, ee) {
                let Z, te;
                if (O === "")
                  return;
                if (O.indexOf("CustomBlock") > -1) {
                  const G = localStorage.getItem(O);
                  if (!G) {
                    this.props.globalState.stateManager.onErrorMessageDialogRequiredObservable.notifyObservers("Error loading custom block");
                    return;
                  }
                  if (te = JSON.parse(G), !te) {
                    this.props.globalState.stateManager.onErrorMessageDialogRequiredObservable.notifyObservers("Error parsing custom block");
                    return;
                  }
                } else if (O.indexOf("Custom") > -1) {
                  const G = localStorage.getItem(O);
                  if (G) {
                    const L = JSON.parse(G), $ = (Y - this._graphCanvas.x - N.GraphCanvasComponent.NodeWidth) / this._graphCanvas.zoom, ae = (ee - this._graphCanvas.y - 20) / this._graphCanvas.zoom, Pe = L.editorData.frames[0].x, ge = L.editorData.frames[0].y;
                    L.editorData.frames[0].x = $, L.editorData.frames[0].y = ae;
                    for (const me of L.editorData.locations)
                      me.x += $ - Pe, me.y += ae - ge;
                    w.SerializationTools.AddFrameToMaterial(L, this.props.globalState, this.props.globalState.nodeMaterial), this._graphCanvas.frames[this._graphCanvas.frames.length - 1].cleanAccumulation(), this.forceUpdate();
                    return;
                  }
                }
                if (O.indexOf("Block") === -1)
                  Z = this.addValueNode(O);
                else {
                  let G;
                  if (te ? (G = new u.CustomBlock(""), G.options = te) : G = T.BlockTools.GetBlockFromString(O, this.props.globalState.nodeMaterial.getScene(), this.props.globalState.nodeMaterial), G.isUnique) {
                    const L = G.getClassName();
                    for (const $ of this._graphCanvas.getCachedData())
                      if ($ !== G && $.getClassName() === L) {
                        this.props.globalState.stateManager.onErrorMessageDialogRequiredObservable.notifyObservers(`You can only have one ${L} per graph`);
                        return;
                      }
                  }
                  G.autoConfigure(this.props.globalState.nodeMaterial, (L) => !this._graphCanvas.nodes.some(($) => $.enclosingFrameId >= 0 && $.content.data.uniqueId === L.uniqueId)), Z = this.appendBlock(G), Z.addClassToVisual(G.getClassName());
                }
                let fe = N.GraphCanvasComponent.NodeWidth, _ = 20;
                return O === "ElbowBlock" && (fe = 10, _ = 10), this._graphCanvas.drop(Z, Y, ee, fe, _), this.forceUpdate(), Z;
              }
              dropNewBlock(O) {
                const Y = O.dataTransfer.getData("babylonjs-material-node");
                this.emitNewBlock(Y, O.clientX - this._diagramContainer.offsetLeft, O.clientY - this._diagramContainer.offsetTop);
              }
              render() {
                return (0, d.jsxs)(p.Portal, { globalState: this.props.globalState, children: [(0, d.jsxs)("div", { id: "node-editor-graph-root", style: {
                  gridTemplateColumns: this.buildColumnLayout()
                }, onMouseMove: (O) => {
                  this._mouseLocationX = O.pageX, this._mouseLocationY = O.pageY;
                }, onMouseDown: (O) => {
                  O.target.nodeName !== "INPUT" && (this.props.globalState.lockObject.lock = !1);
                }, children: [(0, d.jsx)(l.NodeListComponent, { globalState: this.props.globalState }), (0, d.jsx)("div", { id: "leftGrab", onPointerDown: (O) => this.onPointerDown(O), onPointerUp: (O) => this.onPointerUp(O), onPointerMove: (O) => this.resizeColumns(O) }), (0, d.jsx)("div", { className: "diagram-container", ref: this._diagramContainerRef, onDrop: (O) => {
                  this.dropNewBlock(O);
                }, onDragOver: (O) => {
                  O.preventDefault();
                }, children: (0, d.jsx)(N.GraphCanvasComponent, { ref: this._graphCanvasRef, stateManager: this.props.globalState.stateManager, onEmitNewNode: (O) => this.appendBlock(O.data) }) }), (0, d.jsx)("div", { id: "rightGrab", onPointerDown: (O) => this.onPointerDown(O), onPointerUp: (O) => this.onPointerUp(O), onPointerMove: (O) => this.resizeColumns(O, !1) }), (0, d.jsxs)("div", { className: "nme-right-panel", children: [(0, d.jsx)(P.PropertyTabComponent, { lockObject: this.props.globalState.lockObject, globalState: this.props.globalState }), this.state.showPreviewPopUp ? null : (0, d.jsx)(b.PreviewMeshControlComponent, { globalState: this.props.globalState, togglePreviewAreaComponent: this.handlePopUp }), this.state.showPreviewPopUp ? null : (0, d.jsx)(j.PreviewAreaComponent, { globalState: this.props.globalState, width: this._rightWidth })] }), (0, d.jsx)(c.LogComponent, { globalState: this.props.globalState })] }), (0, d.jsx)(H.MessageDialog, { message: this.state.message, isError: this.state.isError, onClose: () => this.setState({ message: "" }) }), (0, d.jsx)("div", { className: "blocker", children: "Node Material Editor runs only on desktop" }), (0, d.jsx)("div", { className: "wait-screen hidden", children: "Processing...please wait" })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/blockNodeData.js": (
          /*!*******************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/blockNodeData.js ***!
            \*******************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              BlockNodeData: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Enums/nodeMaterialBlockTargets */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ./connectionPointPortData */
              "../../../tools/nodeEditor/dist/graphSystem/connectionPointPortData.js"
            ), u = o(
              /*! ../imgs/triangle.svg */
              "../../../tools/nodeEditor/dist/imgs/triangle.svg"
            ), l = o(
              /*! ../imgs/square.svg */
              "../../../tools/nodeEditor/dist/imgs/square.svg"
            ), P = o(
              /*! ./blockNodeData.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/blockNodeData.modules.scss"
            );
            class p {
              get uniqueId() {
                return this.data.uniqueId;
              }
              get name() {
                return this.data.name;
              }
              getClassName() {
                return this.data.getClassName();
              }
              get isInput() {
                return this.data.isInput;
              }
              get inputs() {
                return this._inputs;
              }
              get outputs() {
                return this._outputs;
              }
              get comments() {
                return this.data.comments;
              }
              set comments(H) {
                this.data.comments = H;
              }
              getPortByName(H) {
                for (const T of this.inputs)
                  if (T.internalName === H)
                    return T;
                for (const T of this.outputs)
                  if (T.internalName === H)
                    return T;
                return null;
              }
              dispose() {
                this.data.dispose();
              }
              prepareHeaderIcon(H, T) {
                if (this.data.getClassName() === "ElbowBlock") {
                  H.classList.add(P.default.hidden);
                  return;
                }
                if (this.data.target === d.NodeMaterialBlockTargets.Fragment) {
                  H.title = "In the fragment shader", T.src = l;
                  return;
                }
                if (this.data.target === d.NodeMaterialBlockTargets.Vertex) {
                  H.title = "In the vertex shader", T.src = u;
                  return;
                }
                H.classList.add(P.default.hidden);
              }
              get invisibleEndpoints() {
                return this.data.isTeleportIn ? this.data.endpoints : null;
              }
              constructor(H, T) {
                this.data = H, this._inputs = [], this._outputs = [], H.inputs && this.data.inputs.forEach((q) => {
                  this._inputs.push(new v.ConnectionPointPortData(q, T));
                }), H.outputs && this.data.outputs.forEach((q) => {
                  this._outputs.push(new v.ConnectionPointPortData(q, T));
                });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/connectionPointPortData.js": (
          /*!*****************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/connectionPointPortData.js ***!
            \*****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ConnectionPointPortData: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/nodeMaterialBlockConnectionPoint */
              "core/Misc/dataStorage"
            ), v = o(
              /*! shared-ui-components/nodeGraphSystem/interfaces/portData */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/interfaces/portData.js"
            ), u = o(
              /*! shared-ui-components/nodeGraphSystem/typeLedger */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/typeLedger.js"
            );
            class l {
              get name() {
                const p = this.data.ownerBlock;
                let c = this.data.displayName || this.data.name;
                return this.data.ownerBlock.isInput && this.data.ownerBlock.inputs.length === 1 && (c = p.name), c;
              }
              get internalName() {
                return this.data.name;
              }
              get isExposedOnFrame() {
                return this.data.isExposedOnFrame;
              }
              set isExposedOnFrame(p) {
                this.data.isExposedOnFrame = p;
              }
              get exposedPortPosition() {
                return this.data.exposedPortPosition;
              }
              set exposedPortPosition(p) {
                this.data.exposedPortPosition = p;
              }
              get isConnected() {
                return this.data.isConnected;
              }
              get connectedPort() {
                if (!this.isConnected)
                  return null;
                if (!this._connectedPort && this.data.connectedPoint) {
                  const p = this.data.connectedPoint.ownerBlock;
                  let c = this._nodeContainer.nodes.find((H) => H.content.data === p);
                  if (!c) {
                    c = this._nodeContainer.appendNode(u.TypeLedger.NodeDataBuilder(p, this._nodeContainer));
                    const H = this._nodeContainer.stateManager.data;
                    H.nodeMaterial.attachedBlocks.indexOf(p) === -1 && H.nodeMaterial.attachedBlocks.push(p);
                  }
                  this._connectedPort = c.getPortDataForPortDataContent(this.data.connectedPoint);
                }
                return this._connectedPort;
              }
              set connectedPort(p) {
                this._connectedPort = p;
              }
              get direction() {
                switch (this.data.direction) {
                  case d.NodeMaterialConnectionPointDirection.Input:
                    return v.PortDataDirection.Input;
                  default:
                    return v.PortDataDirection.Output;
                }
              }
              get ownerData() {
                return this.data.ownerBlock;
              }
              get needDualDirectionValidation() {
                return this.data.needDualDirectionValidation;
              }
              get hasEndpoints() {
                return this.data.hasEndpoints;
              }
              get endpoints() {
                const p = [];
                return this.data.endpoints.forEach((c) => {
                  const H = c.ownerBlock, T = this._nodeContainer.nodes.find((q) => q.content.data === H);
                  p.push(T.getPortDataForPortDataContent(c));
                }), p;
              }
              constructor(p, c) {
                this._connectedPort = null, this.data = p, this._nodeContainer = c;
              }
              updateDisplayName(p) {
                this.data.displayName = p;
              }
              connectTo(p) {
                this.data.connectTo(p.data), this._connectedPort = p;
              }
              canConnectTo(p) {
                return this.data.canConnectTo(p.data);
              }
              disconnectFrom(p) {
                this.data.disconnectFrom(p.data), p.connectedPort = null;
              }
              checkCompatibilityState(p) {
                const c = this.data.checkCompatibilityState(p.data);
                switch (c) {
                  case d.NodeMaterialConnectionPointCompatibilityStates.Compatible:
                    return 0;
                  default:
                    return c;
                }
              }
              getCompatibilityIssueMessage(p, c, H) {
                if (!p && H.ownerData.getClassName() === "FragmentOutputBlock") {
                  const q = H.ownerData;
                  return H.name === "rgb" && q.rgba.isConnected ? c.getLinksForPortDataContent(q.rgba)[0].dispose() : H.name === "rgba" && q.rgb.isConnected && c.getLinksForPortDataContent(q.rgb)[0].dispose(), "";
                }
                switch (p) {
                  case d.NodeMaterialConnectionPointCompatibilityStates.TypeIncompatible:
                    return "Cannot connect two different connection types";
                  case d.NodeMaterialConnectionPointCompatibilityStates.TargetIncompatible:
                    return "Source block can only work in fragment shader whereas destination block is currently aimed for the vertex shader";
                  case d.NodeMaterialConnectionPointCompatibilityStates.HierarchyIssue:
                    return "Source block cannot be connected with one of its ancestors";
                }
                return "";
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/clampDisplayManager.js": (
          /*!*********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/clampDisplayManager.js ***!
            \*********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ClampDisplayManager: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! ./clampDisplayManager.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/clampDisplayManager.modules.scss"
            );
            class v {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !1;
              }
              getHeaderText(l) {
                return l.data.name;
              }
              getBackgroundColor() {
                return "#4086BB";
              }
              updatePreviewContent(l, P) {
                const p = l.data;
                P.classList.add(d.default.clampBlock), P.innerHTML = `[${p.minimum}, ${p.maximum}]`;
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/conditionalDisplayManager.js": (
          /*!***************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/conditionalDisplayManager.js ***!
            \***************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ConditionalDisplayManager: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Blocks/conditionalBlock */
              "core/Misc/dataStorage"
            );
            class v {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !0;
              }
              getHeaderText(l) {
                const P = l.data;
                let p = "";
                switch (P.condition) {
                  case d.ConditionalBlockConditions.Equal:
                    p = "=";
                    break;
                  case d.ConditionalBlockConditions.NotEqual:
                    p = "!=";
                    break;
                  case d.ConditionalBlockConditions.LessThan:
                    p = "<";
                    break;
                  case d.ConditionalBlockConditions.LessOrEqual:
                    p = "<=";
                    break;
                  case d.ConditionalBlockConditions.GreaterThan:
                    p = ">";
                    break;
                  case d.ConditionalBlockConditions.GreaterOrEqual:
                    p = ">=";
                    break;
                  case d.ConditionalBlockConditions.Xor:
                    p = "xor";
                    break;
                  case d.ConditionalBlockConditions.Or:
                    p = "|";
                    break;
                  case d.ConditionalBlockConditions.And:
                    p = "&";
                    break;
                }
                return P.name + " (" + p + ")";
              }
              getBackgroundColor() {
                return "#00A080";
              }
              updatePreviewContent() {
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/curveDisplayManager.js": (
          /*!*********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/curveDisplayManager.js ***!
            \*********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              CurveDisplayManager: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Blocks/curveBlock */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ./curveDisplayManager.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/curveDisplayManager.modules.scss"
            );
            class u {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !1;
              }
              getHeaderText(P) {
                return P.data.name;
              }
              getBackgroundColor() {
                return "#405C86";
              }
              updatePreviewContent(P, p) {
                const c = P.data;
                p.classList.add(v.default["curve-block"]), p.innerHTML = d.CurveBlockTypes[c.type];
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/discardDisplayManager.js": (
          /*!***********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/discardDisplayManager.js ***!
            \***********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              DiscardDisplayManager: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            class d {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !0;
              }
              getHeaderText(u) {
                return u.data.name;
              }
              getBackgroundColor() {
                return "#540b0b";
              }
              updatePreviewContent(u, l) {
                l.classList.add("discard-block");
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.js": (
          /*!*********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.js ***!
            \*********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ElbowDisplayManager: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! ../../blockTools */
              "../../../tools/nodeEditor/dist/blockTools.js"
            ), v = o(
              /*! ./elbowDisplayManager.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.modules.scss"
            );
            class u {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !1;
              }
              getHeaderText(P) {
                return P.data.name;
              }
              getBackgroundColor(P) {
                const p = P.data;
                return d.BlockTools.GetColorFromConnectionNodeType(p.input.type);
              }
              updatePreviewContent(P, p) {
              }
              updateFullVisualContent(P, p) {
                const c = p.visual, H = p.headerContainer, T = p.content, q = p.connections, b = p.selectionBorder;
                c.classList.add(v.default.elbowBlock), H.classList.add(v.default.hidden), T.classList.add(v.default.hidden), q.classList.add(v.default.translatedConnections), b.classList.add(v.default.roundSelectionBorder);
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/gradientDisplayManager.js": (
          /*!************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/gradientDisplayManager.js ***!
            \************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              GradientDisplayManager: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! ./gradientDisplayManager.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/gradientDisplayManager.modules.scss"
            );
            class v {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !1;
              }
              getHeaderText(l) {
                return l.data.name;
              }
              getBackgroundColor(l) {
                const p = l.data.colorSteps.map((c) => `rgb(${c.color.r * 255}, ${c.color.g * 255}, ${c.color.b * 255}) ${c.step * 100}%`);
                return p.length ? `linear-gradient(90deg, ${p.join(", ")})` : "black";
              }
              updatePreviewContent(l, P) {
                P.classList.add(d.default.gradientBlock);
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.js": (
          /*!***************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.js ***!
            \***************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ImageSourceDisplayManager: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! ../../sharedComponents/textureLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/textureLineComponent.js"
            ), v = o(
              /*! ./imageSourceDisplayManager.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.modules.scss"
            ), u = o(
              /*! ./common.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/common.modules.scss"
            );
            class l {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !0;
              }
              getHeaderText(p) {
                return p.data.name;
              }
              getBackgroundColor() {
                return "#323232";
              }
              updatePreviewContent(p, c) {
                const H = p.data;
                this._previewCanvas || (c.classList.add(u.default["texture-block"]), c.classList.add(v.default["image-source-block"]), this._previewCanvas = c.ownerDocument.createElement("canvas"), this._previewImage = c.ownerDocument.createElement("img"), c.appendChild(this._previewImage), this._previewImage.classList.add(u.default.empty)), H.texture ? d.TextureLineComponent.UpdatePreview(this._previewCanvas, H.texture, 140, {
                  face: 0,
                  displayRed: !0,
                  displayAlpha: !0,
                  displayBlue: !0,
                  displayGreen: !0
                }, () => {
                  this._previewImage.src = this._previewCanvas.toDataURL("image/png"), this._previewImage.classList.remove(u.default.empty);
                }) : this._previewImage.classList.add(u.default.empty);
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/inputDisplayManager.js": (
          /*!*********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/inputDisplayManager.js ***!
            \*********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              InputDisplayManager: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Blocks/Input/animatedInputBlockTypes */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ../../blockTools */
              "../../../tools/nodeEditor/dist/blockTools.js"
            ), u = o(
              /*! ./inputDisplayManager.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/inputDisplayManager.modules.scss"
            );
            const l = {
              position2d: "position",
              particle_uv: "uv",
              particle_color: "color",
              particle_texturemask: "textureMask",
              particle_positionw: "positionW"
            }, P = {
              position2d: "screen",
              particle_uv: "particle",
              particle_color: "particle",
              particle_texturemask: "particle",
              particle_positionw: "particle"
            };
            class p {
              getHeaderClass(H) {
                const T = H.data;
                return T.isConstant ? u.default.constant : T.visibleInInspector ? u.default.inspector : "";
              }
              shouldDisplayPortLabels() {
                return !1;
              }
              getHeaderText(H) {
                const T = H.data;
                let q = `${T.name} (${p.GetBaseType(T.output.type)})`;
                return T.isAttribute && (q = p.GetBaseType(T.output.type)), q;
              }
              static GetBaseType(H) {
                return d.NodeMaterialBlockConnectionPointTypes[H];
              }
              getBackgroundColor(H) {
                let T = "";
                const q = H.data;
                switch (q.type) {
                  case d.NodeMaterialBlockConnectionPointTypes.Color3:
                  case d.NodeMaterialBlockConnectionPointTypes.Color4:
                    if (q.value) {
                      T = q.value.toHexString();
                      break;
                    }
                  default:
                    T = v.BlockTools.GetColorFromConnectionNodeType(q.type);
                    break;
                }
                return T;
              }
              updatePreviewContent(H, T) {
                let q = "";
                const b = H.data;
                if (b.isAttribute) {
                  const j = l[b.name] ?? b.name;
                  q = (P[b.name] ?? "mesh") + "." + j;
                } else if (b.isSystemValue)
                  switch (b.systemValue) {
                    case d.NodeMaterialSystemValues.World:
                      q = "World";
                      break;
                    case d.NodeMaterialSystemValues.WorldView:
                      q = "World x View";
                      break;
                    case d.NodeMaterialSystemValues.WorldViewProjection:
                      q = "World x View x Projection";
                      break;
                    case d.NodeMaterialSystemValues.View:
                      q = "View";
                      break;
                    case d.NodeMaterialSystemValues.ViewProjection:
                      q = "View x Projection";
                      break;
                    case d.NodeMaterialSystemValues.Projection:
                      q = "Projection";
                      break;
                    case d.NodeMaterialSystemValues.CameraPosition:
                      q = "Camera position";
                      break;
                    case d.NodeMaterialSystemValues.FogColor:
                      q = "Fog color";
                      break;
                    case d.NodeMaterialSystemValues.DeltaTime:
                      q = "Delta time";
                      break;
                    case d.NodeMaterialSystemValues.CameraParameters:
                      q = "Camera parameters";
                      break;
                    case d.NodeMaterialSystemValues.MaterialAlpha:
                      q = "Material alpha";
                      break;
                  }
                else
                  switch (b.type) {
                    case d.NodeMaterialBlockConnectionPointTypes.Float:
                      b.animationType !== d.AnimatedInputBlockTypes.None ? q = d.AnimatedInputBlockTypes[b.animationType] : q = b.value.toFixed(4);
                      break;
                    case d.NodeMaterialBlockConnectionPointTypes.Vector2: {
                      const j = b.value;
                      q = `(${j.x.toFixed(2)}, ${j.y.toFixed(2)})`;
                      break;
                    }
                    case d.NodeMaterialBlockConnectionPointTypes.Vector3: {
                      const j = b.value;
                      q = `(${j.x.toFixed(2)}, ${j.y.toFixed(2)}, ${j.z.toFixed(2)})`;
                      break;
                    }
                    case d.NodeMaterialBlockConnectionPointTypes.Vector4: {
                      const j = b.value;
                      q = `(${j.x.toFixed(2)}, ${j.y.toFixed(2)}, ${j.z.toFixed(2)}, ${j.w.toFixed(2)})`;
                      break;
                    }
                  }
                T.innerHTML = q, T.classList.add(u.default["input-block"]);
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/meshAttributeExistsDisplayManager.js": (
          /*!***********************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/meshAttributeExistsDisplayManager.js ***!
            \***********************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              MeshAttributeExistsDisplayManager: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Blocks/meshAttributeExistsBlock */
              "core/Misc/dataStorage"
            );
            class v {
              getHeaderClass(l) {
                return "";
              }
              shouldDisplayPortLabels() {
                return !0;
              }
              getHeaderText(l) {
                const P = l.data;
                let p = P.name, c;
                switch (P.attributeType) {
                  case d.MeshAttributeExistsBlockTypes.VertexColor:
                    c = "Color";
                    break;
                  case d.MeshAttributeExistsBlockTypes.Normal:
                    c = "Normal";
                    break;
                  case d.MeshAttributeExistsBlockTypes.Tangent:
                    c = "Tangent";
                    break;
                  case d.MeshAttributeExistsBlockTypes.UV1:
                    c = "UV";
                    break;
                  case d.MeshAttributeExistsBlockTypes.UV2:
                    c = "UV2";
                    break;
                  case d.MeshAttributeExistsBlockTypes.UV3:
                    c = "UV3";
                    break;
                  case d.MeshAttributeExistsBlockTypes.UV4:
                    c = "UV4";
                    break;
                  case d.MeshAttributeExistsBlockTypes.UV5:
                    c = "UV5";
                    break;
                  case d.MeshAttributeExistsBlockTypes.UV6:
                    c = "UV6";
                    break;
                }
                return c && (p += ` (${c})`), p;
              }
              getBackgroundColor(l) {
                return "";
              }
              updatePreviewContent() {
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/outputDisplayManager.js": (
          /*!**********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/outputDisplayManager.js ***!
            \**********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              OutputDisplayManager: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            class d {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !0;
              }
              getHeaderText(u) {
                return u.data.name;
              }
              getBackgroundColor() {
                return "rgb(106, 44, 131)";
              }
              updatePreviewContent(u, l) {
                l.classList.add("output-block");
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/pbrDisplayManager.js": (
          /*!*******************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/pbrDisplayManager.js ***!
            \*******************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              PBRDisplayManager: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            class d {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !0;
              }
              getHeaderText(u) {
                return u.data.name;
              }
              getBackgroundColor() {
                return "#6174FA";
              }
              updatePreviewContent(u, l) {
                l.classList.add("pbr-block");
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/remapDisplayManager.js": (
          /*!*********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/remapDisplayManager.js ***!
            \*********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              RemapDisplayManager: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! ./remapDisplayManager.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/remapDisplayManager.modules.scss"
            );
            class v {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !0;
              }
              getHeaderText(l) {
                return l.data.name;
              }
              getBackgroundColor() {
                return "#4086BB";
              }
              _extractInputValue(l) {
                const P = l.connectedPoint.ownerBlock;
                if (P.isInput) {
                  const p = P;
                  if (p.isUniform && !p.isSystemValue)
                    return p.value;
                }
                return "?";
              }
              updatePreviewContent(l, P) {
                const p = l.data, c = p.sourceMin.isConnected ? this._extractInputValue(p.sourceMin) : p.sourceRange.x, H = p.sourceMax.isConnected ? this._extractInputValue(p.sourceMax) : p.sourceRange.y, T = p.targetMin.isConnected ? this._extractInputValue(p.targetMin) : p.targetRange.x, q = p.targetMax.isConnected ? this._extractInputValue(p.targetMax) : p.targetRange.y;
                P.classList.add(d.default["remap-block"]), P.innerHTML = `[${c}, ${H}] -> [${T}, ${q}]`;
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/teleportInDisplayManager.js": (
          /*!**************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/teleportInDisplayManager.js ***!
            \**************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TeleportInDisplayManager: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! ../../blockTools */
              "../../../tools/nodeEditor/dist/blockTools.js"
            );
            class v {
              constructor() {
                this._hasHighlights = !1;
              }
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !0;
              }
              getHeaderText(l) {
                return l.data.name;
              }
              getBackgroundColor(l) {
                const P = l.data;
                return `linear-gradient(to right, ${d.BlockTools.GetColorFromConnectionNodeType(P.input.type)}, white)`;
              }
              updatePreviewContent(l, P) {
              }
              onSelectionChanged(l, P, p) {
                const c = l.data;
                if (P !== l) {
                  if (this._hasHighlights) {
                    for (const H of c.endpoints)
                      p.onHighlightNodeObservable.notifyObservers({ data: H, active: !1 });
                    this._hasHighlights = !1;
                  }
                  return;
                }
                for (const H of c.endpoints)
                  p.onHighlightNodeObservable.notifyObservers({ data: H, active: !0 });
                this._hasHighlights = !0;
              }
              onDispose(l, P) {
                const p = l.data;
                for (const c of p.endpoints)
                  P.onHighlightNodeObservable.notifyObservers({ data: c, active: !1 });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/teleportOutDisplayManager.js": (
          /*!***************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/teleportOutDisplayManager.js ***!
            \***************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TeleportOutDisplayManager: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! ../../blockTools */
              "../../../tools/nodeEditor/dist/blockTools.js"
            );
            class v {
              constructor() {
                this._hasHighlights = !1;
              }
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !0;
              }
              getHeaderText(l) {
                return l.data.name;
              }
              getBackgroundColor(l) {
                const P = l.data;
                return `linear-gradient(to right, white, ${d.BlockTools.GetColorFromConnectionNodeType(P.output.type)})`;
              }
              updatePreviewContent(l, P) {
              }
              onSelectionChanged(l, P, p) {
                const c = l.data;
                if (P !== l) {
                  if (this._hasHighlights) {
                    let H;
                    P && P.data.getClassName() === "NodeMaterialTeleportOutBlock" ? H = P.data.entryPoint !== c.entryPoint : H = !0, H && p.onHighlightNodeObservable.notifyObservers({ data: c.entryPoint, active: !1 }), this._hasHighlights = !1;
                  }
                  return;
                }
                c.entryPoint && (p.onHighlightNodeObservable.notifyObservers({ data: c.entryPoint, active: !0 }), this._hasHighlights = !0);
              }
              onDispose(l, P) {
                const p = l.data;
                p.entryPoint && P.onHighlightNodeObservable.notifyObservers({ data: p.entryPoint, active: !1 });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/textureDisplayManager.js": (
          /*!***********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/textureDisplayManager.js ***!
            \***********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TextureDisplayManager: () => (
                /* binding */
                P
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Blocks/triPlanarBlock */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ../../sharedComponents/textureLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/textureLineComponent.js"
            ), u = o(
              /*! ./textureDisplayManager.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/textureDisplayManager.modules.scss"
            ), l = o(
              /*! ./common.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/common.modules.scss"
            );
            class P {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !0;
              }
              getHeaderText(c) {
                return c.data.name;
              }
              getBackgroundColor(c) {
                const H = c.data;
                return H.getClassName() === "RefractionBlock" || H.getClassName() === "ReflectionBlock" ? "#6174FA" : "#323232";
              }
              updatePreviewContent(c, H) {
                const T = c.data, q = T;
                this._previewCanvas || (H.classList.add(l.default["texture-block"]), T instanceof d.TextureBlock && H.classList.add(u.default["regular-texture-block"]), (T instanceof d.ReflectionTextureBlock || T instanceof d.ReflectionBlock) && H.classList.add(u.default["reflection-block"]), (T instanceof d.CurrentScreenBlock || T instanceof d.ParticleTextureBlock) && H.classList.add(u.default["reduced-texture-block"]), T instanceof d.TriPlanarBlock && H.classList.add(u.default["triplanar-texture-block"]), T instanceof d.RefractionBlock && H.classList.add(u.default["refraction-texture-block"]), this._previewCanvas = H.ownerDocument.createElement("canvas"), this._previewImage = H.ownerDocument.createElement("img"), H.appendChild(this._previewImage), this._previewImage.classList.add(l.default.empty)), q.texture ? v.TextureLineComponent.UpdatePreview(this._previewCanvas, q.texture, 140, {
                  face: 0,
                  displayRed: !0,
                  displayAlpha: !0,
                  displayBlue: !0,
                  displayGreen: !0
                }, () => {
                  this._previewImage.src = this._previewCanvas.toDataURL("image/png"), this._previewImage.classList.remove(l.default.empty);
                }) : this._previewImage.classList.add(l.default.empty);
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/trigonometryDisplayManager.js": (
          /*!****************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/trigonometryDisplayManager.js ***!
            \****************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TrigonometryDisplayManager: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Blocks/trigonometryBlock */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ./trigonometryDisplayManager.modules.scss */
              "../../../tools/nodeEditor/dist/graphSystem/display/trigonometryDisplayManager.modules.scss"
            );
            class u {
              getHeaderClass() {
                return "";
              }
              shouldDisplayPortLabels() {
                return !1;
              }
              getHeaderText(P) {
                return P.data.name;
              }
              getBackgroundColor() {
                return "#405C86";
              }
              updatePreviewContent(P, p) {
                const c = P.data;
                p.classList.add(v.default["trigonometry-block"]), p.innerHTML = d.TrigonometryBlockOperations[c.operation];
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/colorMergerPropertyComponent.js": (
          /*!*********************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/colorMergerPropertyComponent.js ***!
            \*********************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ColorMergerPropertyTabComponent: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), P = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            );
            class p extends v.Component {
              constructor(H) {
                super(H);
              }
              render() {
                const H = this.props.nodeData.data, T = [
                  { label: "R", value: "r" },
                  { label: "G", value: "g" },
                  { label: "B", value: "b" },
                  { label: "A", value: "a" }
                ];
                return (0, d.jsxs)("div", { children: [(0, d.jsx)(l.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsxs)(u.LineContainerComponent, { title: "SWIZZLES", children: [(0, d.jsx)(P.OptionsLineComponent, { label: "R", options: T, target: H, propertyName: "rSwizzle", valuesAreStrings: !0, onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(H), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } }), (0, d.jsx)(P.OptionsLineComponent, { label: "G", options: T, target: H, propertyName: "gSwizzle", valuesAreStrings: !0, onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(H), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } }), (0, d.jsx)(P.OptionsLineComponent, { label: "B", options: T, target: H, propertyName: "bSwizzle", valuesAreStrings: !0, onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(H), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } }), (0, d.jsx)(P.OptionsLineComponent, { label: "A", options: T, target: H, propertyName: "aSwizzle", valuesAreStrings: !0, onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(H), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } })] })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/conditionalNodePropertyComponent.js": (
          /*!*************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/conditionalNodePropertyComponent.js ***!
            \*************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ConditionalPropertyTabComponent: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! core/Materials/Node/Blocks/conditionalBlock */
              "core/Misc/dataStorage"
            ), P = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), p = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            );
            class c extends v.Component {
              constructor(T) {
                super(T);
              }
              render() {
                const T = this.props.nodeData.data, q = [
                  { label: "Equal", value: l.ConditionalBlockConditions.Equal },
                  { label: "NotEqual", value: l.ConditionalBlockConditions.NotEqual },
                  { label: "LessThan", value: l.ConditionalBlockConditions.LessThan },
                  { label: "GreaterThan", value: l.ConditionalBlockConditions.GreaterThan },
                  { label: "LessOrEqual", value: l.ConditionalBlockConditions.LessOrEqual },
                  { label: "GreaterOrEqual", value: l.ConditionalBlockConditions.GreaterOrEqual },
                  { label: "Xor", value: l.ConditionalBlockConditions.Xor },
                  { label: "Or", value: l.ConditionalBlockConditions.Or },
                  { label: "And", value: l.ConditionalBlockConditions.And }
                ];
                return q.sort((b, j) => b.label.localeCompare(j.label)), (0, d.jsxs)("div", { children: [(0, d.jsx)(P.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsx)(u.LineContainerComponent, { title: "PROPERTIES", children: (0, d.jsx)(p.OptionsLineComponent, { label: "Condition", options: q, target: T, propertyName: "condition", onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(T), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/curveNodePropertyComponent.js": (
          /*!*******************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/curveNodePropertyComponent.js ***!
            \*******************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              CurvePropertyTabComponent: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), P = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            ), p = o(
              /*! core/Materials/Node/Blocks/curveBlock */
              "core/Misc/dataStorage"
            );
            class c extends v.Component {
              constructor(T) {
                super(T);
              }
              render() {
                const T = this.props.nodeData.data, q = [], b = Object.keys(p.CurveBlockTypes);
                for (const j of b)
                  isNaN(parseInt(j)) && q.push({
                    label: j,
                    value: p.CurveBlockTypes[j]
                  });
                return (0, d.jsxs)("div", { children: [(0, d.jsx)(l.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsx)(u.LineContainerComponent, { title: "PROPERTIES", children: (0, d.jsx)(P.OptionsLineComponent, { label: "Type", options: q, target: T, propertyName: "type", onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(T), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/frameNodePortPropertyComponent.js": (
          /*!***********************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/frameNodePortPropertyComponent.js ***!
            \***********************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              FrameNodePortPropertyTabComponent: () => (
                /* binding */
                H
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! shared-ui-components/lines/textInputLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js"
            ), P = o(
              /*! shared-ui-components/nodeGraphSystem/graphFrame */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.js"
            ), p = o(
              /*! shared-ui-components/nodeGraphSystem/tools */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/tools.js"
            ), c = o(
              /*! shared-ui-components/lines/buttonLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js"
            );
            class H extends v.Component {
              constructor(q) {
                super(q), this.state = {
                  port: this.props.frameNodePort
                }, this._onSelectionChangedObserver = this.props.stateManager.onSelectionChangedObservable.add((b) => {
                  const { selection: j } = b || {};
                  (0, p.IsFramePortData)(j) && (j.port.onFramePortPositionChangedObservable.clear(), this._onFramePortPositionChangedObserver = j.port.onFramePortPositionChangedObservable.add((w) => {
                    this.setState({ port: w });
                  }), this.setState({ port: j.port }));
                }), this._onFramePortPositionChangedObserver = this.props.frameNodePort.onFramePortPositionChangedObservable.add((b) => {
                  this.setState({ port: b });
                });
              }
              componentWillUnmount() {
                this.props.frameNodePort.onFramePortPositionChangedObservable.remove(this._onFramePortPositionChangedObserver), this.props.stateManager.onSelectionChangedObservable.remove(this._onSelectionChangedObserver);
              }
              render() {
                return (0, d.jsxs)("div", { id: "propertyTab", children: [(0, d.jsxs)("div", { id: "header", children: [(0, d.jsx)("img", { id: "logo", src: "https://www.babylonjs.com/Assets/logo-babylonjs-social-twitter.png" }), (0, d.jsx)("div", { id: "title", children: "NODE MATERIAL EDITOR" })] }), (0, d.jsx)("div", { children: (0, d.jsxs)(u.LineContainerComponent, { title: "GENERAL", children: [(0, d.jsx)(l.TextInputLineComponent, { label: "Port Name", lockObject: this.props.stateManager.lockObject, propertyName: "portName", target: this.props.frameNodePort }), this.props.frameNodePort.framePortPosition !== P.FramePortPosition.Top && (0, d.jsx)(c.ButtonLineComponent, { label: "Move Port Up", onClick: () => {
                  this.props.frame.moveFramePortUp(this.props.frameNodePort);
                } }), this.props.frameNodePort.framePortPosition !== P.FramePortPosition.Bottom && (0, d.jsx)(c.ButtonLineComponent, { label: "Move Port Down", onClick: () => {
                  this.props.frame.moveFramePortDown(this.props.frameNodePort);
                } })] }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/framePropertyComponent.js": (
          /*!***************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/framePropertyComponent.js ***!
            \***************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              FramePropertyTabComponent: () => (
                /* binding */
                H
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! ../../components/propertyTab/inputsPropertyTabComponent */
              "../../../tools/nodeEditor/dist/components/propertyTab/inputsPropertyTabComponent.js"
            ), P = o(
              /*! shared-ui-components/lines/textInputLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js"
            ), p = o(
              /*! shared-ui-components/lines/color3LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js"
            ), c = o(
              /*! shared-ui-components/lines/buttonLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js"
            );
            class H extends v.Component {
              constructor(q) {
                super(q);
              }
              componentDidMount() {
                this._onFrameExpandStateChangedObserver = this.props.frame.onExpandStateChanged.add(() => this.forceUpdate());
              }
              componentWillUnmount() {
                this._onFrameExpandStateChangedObserver && (this.props.frame.onExpandStateChanged.remove(this._onFrameExpandStateChangedObserver), this._onFrameExpandStateChangedObserver = null);
              }
              render() {
                let q = [];
                return this.props.frame.nodes.forEach((b) => {
                  const j = b.content.data;
                  j.isInput && j.visibleOnFrame && q.push(j);
                }), q = q.sort((b, j) => b.name.localeCompare(j.name)), (0, d.jsxs)("div", { id: "propertyTab", children: [(0, d.jsxs)("div", { id: "header", children: [(0, d.jsx)("img", { id: "logo", src: "https://www.babylonjs.com/Assets/logo-babylonjs-social-twitter.png" }), (0, d.jsx)("div", { id: "title", children: "NODE MATERIAL EDITOR" })] }), (0, d.jsxs)("div", { children: [(0, d.jsxs)(u.LineContainerComponent, { title: "GENERAL", children: [(0, d.jsx)(P.TextInputLineComponent, { label: "Name", propertyName: "name", lockObject: this.props.globalState.lockObject, target: this.props.frame }), (0, d.jsx)(p.Color3LineComponent, { lockObject: this.props.globalState.lockObject, label: "Color", target: this.props.frame, propertyName: "color" }), (0, d.jsx)(P.TextInputLineComponent, { lockObject: this.props.globalState.lockObject, label: "Comments", propertyName: "comments", target: this.props.frame }), !this.props.frame.isCollapsed && (0, d.jsx)(c.ButtonLineComponent, { label: "Collapse", onClick: () => {
                  this.props.frame.isCollapsed = !0;
                } }), this.props.frame.isCollapsed && (0, d.jsx)(c.ButtonLineComponent, { label: "Expand", onClick: () => {
                  this.props.frame.isCollapsed = !1;
                } }), (0, d.jsx)(c.ButtonLineComponent, { label: "Export", onClick: () => {
                  this.props.frame.export();
                } })] }), (0, d.jsx)(l.InputsPropertyTabComponent, { lockObject: this.props.globalState.lockObject, globalState: this.props.globalState, inputs: q })] })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js": (
          /*!*********************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js ***!
            \*********************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              GeneralPropertyTabComponent: () => (
                /* binding */
                w
              ),
              /* harmony export */
              GenericPropertyComponent: () => (
                /* binding */
                j
              ),
              /* harmony export */
              GenericPropertyTabComponent: () => (
                /* binding */
                m
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! ../../sharedComponents/checkBoxLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/checkBoxLineComponent.js"
            ), P = o(
              /*! core/Materials/Node/Enums/nodeMaterialBlockTargets */
              "core/Misc/dataStorage"
            ), p = o(
              /*! shared-ui-components/lines/textInputLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js"
            ), c = o(
              /*! shared-ui-components/lines/vector2LineComponent */
              "../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js"
            ), H = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            ), T = o(
              /*! shared-ui-components/lines/textLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js"
            ), q = o(
              /*! shared-ui-components/lines/floatLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js"
            ), b = o(
              /*! shared-ui-components/lines/sliderLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js"
            );
            class j extends v.Component {
              constructor(N) {
                super(N);
              }
              render() {
                return (0, d.jsxs)(d.Fragment, { children: [(0, d.jsx)(w, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsx)(m, { stateManager: this.props.stateManager, nodeData: this.props.nodeData })] });
              }
            }
            class w extends v.Component {
              constructor(N) {
                super(N);
              }
              render() {
                const N = [
                  { label: "Neutral", value: P.NodeMaterialBlockTargets.Neutral },
                  { label: "Vertex", value: P.NodeMaterialBlockTargets.Vertex },
                  { label: "Fragment", value: P.NodeMaterialBlockTargets.Fragment }
                ], k = this.props.nodeData.data;
                return (0, d.jsx)(d.Fragment, { children: (0, d.jsxs)(u.LineContainerComponent, { title: "GENERAL", children: [(!k.isInput || !k.isAttribute) && (0, d.jsx)(p.TextInputLineComponent, { label: "Name", propertyName: "name", target: k, lockObject: this.props.stateManager.lockObject, onChange: () => this.props.stateManager.onUpdateRequiredObservable.notifyObservers(k), throttlePropertyChangedNotification: !0, validator: (R) => k.validateBlockName(R) ? !0 : (this.props.stateManager.onErrorMessageDialogRequiredObservable.notifyObservers(`"${R}" is a reserved name, please choose another`), !1) }), k._originalTargetIsNeutral && (0, d.jsx)(H.OptionsLineComponent, { label: "Target", options: N, target: k, propertyName: "target", onSelect: () => {
                  this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(k), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                } }), !k._originalTargetIsNeutral && (0, d.jsx)(T.TextLineComponent, { label: "Target", value: P.NodeMaterialBlockTargets[k.target] }), (0, d.jsx)(T.TextLineComponent, { label: "Type", value: k.getClassName() }), (0, d.jsx)(p.TextInputLineComponent, { label: "Comments", propertyName: "comments", lockObject: this.props.stateManager.lockObject, target: k, onChange: () => this.props.stateManager.onUpdateRequiredObservable.notifyObservers(k), throttlePropertyChangedNotification: !0 })] }) });
              }
            }
            class m extends v.Component {
              constructor(N) {
                super(N);
              }
              forceRebuild(N, k) {
                var y;
                if (k != null && k.onValidation && !(k != null && k.onValidation(this.props.nodeData.data, N)))
                  return;
                (!k || k.update) && this.props.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.nodeData.data), (!k || k.rebuild) && this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), k != null && k.activatePreviewCommand && this.props.stateManager.data.onPreviewCommandActivated.notifyObservers(!0), (((y = k == null ? void 0 : k.callback) == null ? void 0 : y.call(k, this.props.stateManager.data.nodeMaterial.getScene(), this.props.nodeData.data)) ?? !1) && this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
              }
              render() {
                const N = this.props.nodeData.data, k = N._propStore;
                if (!k)
                  return (0, d.jsx)(d.Fragment, {});
                const R = {}, y = [];
                for (const { propertyName: O, displayName: Y, type: ee, groupName: Z, options: te } of k) {
                  let fe = R[Z];
                  switch (fe || (fe = [], R[Z] = fe, y.push(Z)), ee) {
                    case P.PropertyTypeForEdition.Boolean: {
                      fe.push((0, d.jsx)(l.CheckBoxLineComponent, { label: Y, target: N, propertyName: O, onValueChanged: () => this.forceRebuild(O, te.notifiers) }, `checkBox-${O}`));
                      break;
                    }
                    case P.PropertyTypeForEdition.Float: {
                      isNaN(te.min) || isNaN(te.max) || te.min === te.max ? fe.push((0, d.jsx)(q.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: Y, propertyName: O, target: N, onChange: () => this.forceRebuild(O, te.notifiers) }, `float-${O}`)) : fe.push((0, d.jsx)(b.SliderLineComponent, { lockObject: this.props.stateManager.lockObject, label: Y, target: N, propertyName: O, step: Math.abs(te.max - te.min) / 100, minimum: Math.min(te.min, te.max), maximum: te.max, onChange: () => this.forceRebuild(O, te.notifiers) }, `slider-${O}`));
                      break;
                    }
                    case P.PropertyTypeForEdition.Int: {
                      fe.push((0, d.jsx)(q.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, digits: 0, step: "1", isInteger: !0, label: Y, propertyName: O, target: N, onChange: () => this.forceRebuild(O, te.notifiers) }, `int-${O}`));
                      break;
                    }
                    case P.PropertyTypeForEdition.Vector2: {
                      fe.push((0, d.jsx)(c.Vector2LineComponent, { lockObject: this.props.stateManager.lockObject, label: Y, propertyName: O, target: N, onChange: () => this.forceRebuild(O, te.notifiers) }, `vector2-${O}`));
                      break;
                    }
                    case P.PropertyTypeForEdition.List: {
                      fe.push((0, d.jsx)(H.OptionsLineComponent, { label: Y, options: te.options, target: N, propertyName: O, onSelect: () => this.forceRebuild(O, te.notifiers) }, `options-${O}`));
                      break;
                    }
                  }
                }
                return (0, d.jsx)(d.Fragment, { children: y.map((O) => (0, d.jsx)(u.LineContainerComponent, { title: O, children: R[O] }, `group-${O}`)) });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/gradientNodePropertyComponent.js": (
          /*!**********************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/gradientNodePropertyComponent.js ***!
            \**********************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              GradientPropertyTabComponent: () => (
                /* binding */
                T
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! core/Maths/math.color */
              "core/Misc/dataStorage"
            ), P = o(
              /*! ./gradientStepComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/gradientStepComponent.js"
            ), p = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), c = o(
              /*! shared-ui-components/lines/buttonLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js"
            ), H = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            );
            class T extends v.Component {
              constructor(b) {
                super(b);
              }
              componentDidMount() {
                const b = this.props.nodeData.data;
                this._onValueChangedObserver = b.onValueChangedObservable.add(() => {
                  this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(b);
                });
              }
              componentWillUnmount() {
                const b = this.props.nodeData.data;
                this._onValueChangedObserver && (b.onValueChangedObservable.remove(this._onValueChangedObserver), this._onValueChangedObserver = null);
              }
              forceRebuild() {
                this.props.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.nodeData.data), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
              }
              deleteStep(b) {
                const j = this.props.nodeData.data, w = j.colorSteps.indexOf(b);
                w > -1 && (j.colorSteps.splice(w, 1), j.colorStepsUpdated(), this.forceRebuild(), this.forceUpdate());
              }
              copyStep(b) {
                const j = this.props.nodeData.data, w = new l.GradientBlockColorStep(1, b.color);
                j.colorSteps.push(w), j.colorStepsUpdated(), this.forceRebuild(), this.forceUpdate();
              }
              addNewStep() {
                const b = this.props.nodeData.data, j = new l.GradientBlockColorStep(1, l.Color3.White());
                b.colorSteps.push(j), b.colorStepsUpdated(), this.forceRebuild(), this.forceUpdate();
              }
              checkForReOrder() {
                const b = this.props.nodeData.data;
                b.colorSteps.sort((j, w) => j.step === w.step ? 0 : j.step > w.step ? 1 : -1), b.colorStepsUpdated(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(b), this.forceUpdate();
              }
              render() {
                const b = this.props.nodeData.data, j = [
                  { label: "None", value: 0 },
                  { label: "Visible in the inspector", value: 1 }
                ];
                return (0, d.jsxs)("div", { children: [(0, d.jsx)(p.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsx)(u.LineContainerComponent, { title: "PROPERTIES", children: (0, d.jsx)(H.OptionsLineComponent, { label: "Type", options: j, target: b, noDirectUpdate: !0, extractValue: (w) => w.visibleInInspector ? 1 : w.isConstant ? 2 : 0, onSelect: (w) => {
                  switch (w) {
                    case 0:
                      b.visibleInInspector = !1;
                      break;
                    case 1:
                      b.visibleInInspector = !0;
                      break;
                  }
                  this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(b), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                }, propertyName: "" }) }), (0, d.jsxs)(u.LineContainerComponent, { title: "STEPS", children: [(0, d.jsx)(c.ButtonLineComponent, { label: "Add new step", onClick: () => this.addNewStep() }), b.colorSteps.map((w, m) => (0, d.jsx)(P.GradientStepComponent, { stateManager: this.props.stateManager, onCheckForReOrder: () => this.checkForReOrder(), onUpdateStep: () => this.forceRebuild(), lineIndex: m, step: w, onCopy: () => this.copyStep(w), onDelete: () => this.deleteStep(w) }, "step-" + m))] })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/gradientStepComponent.js": (
          /*!**************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/gradientStepComponent.js ***!
            \**************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              GradientStepComponent: () => (
                /* binding */
                H
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Maths/math.color */
              "core/Misc/dataStorage"
            ), l = o(
              /*! ../../imgs/delete.svg */
              "../../../tools/nodeEditor/dist/imgs/delete.svg"
            ), P = o(
              /*! ../../sharedComponents/copy.svg */
              "../../../tools/nodeEditor/dist/sharedComponents/copy.svg"
            ), p = o(
              /*! shared-ui-components/lines/floatLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js"
            ), c = o(
              /*! shared-ui-components/lines/colorPickerComponent */
              "../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js"
            );
            class H extends v.Component {
              constructor(q) {
                super(q), this.state = { gradient: q.step.step };
              }
              updateColor(q) {
                this.props.step.color = u.Color3.FromHexString(q), this.props.onUpdateStep(), this.forceUpdate();
              }
              updateStep(q) {
                this.props.step.step = q, this.setState({ gradient: q }), this.props.onUpdateStep();
              }
              onPointerUp() {
                this.props.onCheckForReOrder();
              }
              render() {
                const q = this.props.step;
                return (0, d.jsxs)("div", { className: "gradient-step", children: [(0, d.jsx)("div", { className: "step", children: `#${this.props.lineIndex}` }), (0, d.jsx)("div", { className: "color", children: (0, d.jsx)(c.ColorPickerLineComponent, { lockObject: this.props.stateManager.lockObject, value: q.color, onColorChanged: (b) => {
                  this.updateColor(b);
                } }) }), (0, d.jsx)("div", { className: "step-value", children: (0, d.jsx)(p.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, smallUI: !0, label: "", target: q, propertyName: "step", min: 0, max: 1, onEnter: () => {
                  this.props.onUpdateStep(), this.props.onCheckForReOrder(), this.forceUpdate();
                } }) }), (0, d.jsx)("div", { className: "step-slider", children: (0, d.jsx)("input", { className: "range", type: "range", step: 0.01, min: 0, max: 1, value: q.step, onPointerUp: () => this.onPointerUp(), onChange: (b) => this.updateStep(parseFloat(b.target.value)) }) }), (0, d.jsx)("div", { className: "gradient-copy", onClick: () => {
                  this.props.onCopy && this.props.onCopy();
                }, title: "Copy Step", children: (0, d.jsx)("img", { className: "img", src: P }) }), (0, d.jsx)("div", { className: "gradient-delete", onClick: () => this.props.onDelete(), title: "Delete Step", children: (0, d.jsx)("img", { className: "img", src: l }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/imageSourcePropertyTabComponent.js": (
          /*!************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/imageSourcePropertyTabComponent.js ***!
            \************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              ImageSourcePropertyTabComponent: () => (
                /* binding */
                w
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/fileButtonLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/fileButtonLineComponent.js"
            ), l = o(
              /*! core/Materials/Textures/texture */
              "core/Misc/dataStorage"
            ), P = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), p = o(
              /*! ../../sharedComponents/checkBoxLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/checkBoxLineComponent.js"
            ), c = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), H = o(
              /*! shared-ui-components/lines/textInputLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js"
            ), T = o(
              /*! shared-ui-components/lines/buttonLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js"
            ), q = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            ), b = o(
              /*! shared-ui-components/lines/floatLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js"
            ), j = o(
              /*! shared-ui-components/lines/sliderLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js"
            );
            class w extends v.Component {
              get imageSourceBlock() {
                return this.props.nodeData.data;
              }
              constructor(I) {
                super(I);
                const N = this.imageSourceBlock.texture;
                this.state = { isEmbedded: !N || N.name.substring(0, 4) === "data" };
              }
              // eslint-disable-next-line @typescript-eslint/naming-convention
              UNSAFE_componentWillUpdate(I, N) {
                if (I.nodeData.data !== this.props.nodeData.data) {
                  const k = I.nodeData.data.texture;
                  N.isEmbedded = !k || k.name.substring(0, 4) === "data", N.loadAsCubeTexture = k && k.isCube;
                }
              }
              _generateRandomForCache() {
                return "xxxxxxxxxxxxxxxxxxxx".replace(/[x]/g, () => (Math.random() * 10 | 0).toString());
              }
              updateAfterTextureLoad() {
                this.props.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.nodeData.data), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
              }
              removeTexture() {
                let I = this.imageSourceBlock.texture;
                I && (I.dispose(), I = null, this.imageSourceBlock.texture = null), this.updateAfterTextureLoad();
              }
              _prepareTexture() {
                let I = this.imageSourceBlock.texture;
                I && (I.dispose(), I = null), I || (this.imageSourceBlock.texture = new l.Texture(null, this.props.stateManager.data.nodeMaterial.getScene(), !1, !1), I = this.imageSourceBlock.texture, I.coordinatesMode = l.Texture.EQUIRECTANGULAR_MODE);
              }
              /**
               * Replaces the texture of the node
               * @param file the file of the texture to use
               */
              replaceTexture(I) {
                this._prepareTexture();
                const N = this.imageSourceBlock.texture;
                l.Tools.ReadFile(I, (k) => {
                  const R = new Blob([k], { type: "octet/stream" }), y = new FileReader();
                  y.readAsDataURL(R), y.onloadend = () => {
                    const O = y.result;
                    let Y;
                    I.name.toLowerCase().indexOf(".dds") > 0 ? Y = ".dds" : I.name.toLowerCase().indexOf(".env") > 0 && (Y = ".env"), N.updateURL(O, Y, () => this.updateAfterTextureLoad());
                  };
                }, void 0, !0);
              }
              replaceTextureWithUrl(I) {
                this._prepareTexture(), this.imageSourceBlock.texture.updateURL(I, null, () => this.updateAfterTextureLoad());
              }
              render() {
                let I = "";
                const N = this.props.nodeData.data, k = this.imageSourceBlock.texture;
                k && k.name && k.name.substring(0, 4) !== "data" && (I = k.name), I = I.replace(/\?nocache=\d+/, "");
                const R = [
                  { label: "Nearest", value: l.Texture.NEAREST_NEAREST },
                  { label: "Linear", value: l.Texture.LINEAR_LINEAR },
                  { label: "Linear & linear mip", value: l.Texture.LINEAR_LINEAR_MIPLINEAR },
                  { label: "Linear & nearest mip", value: l.Texture.LINEAR_LINEAR_MIPNEAREST },
                  { label: "Nearest & linear mip", value: l.Texture.NEAREST_NEAREST_MIPLINEAR },
                  { label: "Nearest & nearest mip", value: l.Texture.NEAREST_NEAREST_MIPNEAREST },
                  { label: "Nearest/Linear", value: l.Texture.NEAREST_LINEAR },
                  { label: "Nearest/Linear & linear mip", value: l.Texture.NEAREST_LINEAR_MIPLINEAR },
                  { label: "Nearest/Linear & nearest mip", value: l.Texture.NEAREST_LINEAR_MIPNEAREST },
                  { label: "Linear/Nearest", value: l.Texture.LINEAR_NEAREST },
                  { label: "Linear/Nearest & linear mip", value: l.Texture.LINEAR_NEAREST_MIPLINEAR },
                  { label: "Linear/Nearest & nearest mip", value: l.Texture.LINEAR_NEAREST_MIPNEAREST }
                  // 9
                ];
                return (0, d.jsxs)("div", { children: [(0, d.jsx)(c.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsxs)(P.LineContainerComponent, { title: "PROPERTIES", children: [k && k.updateSamplingMode && (0, d.jsx)(q.OptionsLineComponent, { label: "Sampling", options: R, target: k, noDirectUpdate: !0, propertyName: "samplingMode", onSelect: (y) => {
                  k.updateSamplingMode(y), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && (0, d.jsx)(p.CheckBoxLineComponent, { label: "Clamp U", isSelected: () => k.wrapU === l.Texture.CLAMP_ADDRESSMODE, onSelect: (y) => {
                  k.wrapU = y ? l.Texture.CLAMP_ADDRESSMODE : l.Texture.WRAP_ADDRESSMODE, this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && (0, d.jsx)(p.CheckBoxLineComponent, { label: "Clamp V", isSelected: () => k.wrapV === l.Texture.CLAMP_ADDRESSMODE, onSelect: (y) => {
                  k.wrapV = y ? l.Texture.CLAMP_ADDRESSMODE : l.Texture.WRAP_ADDRESSMODE, this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && (0, d.jsx)(b.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Offset U", target: k, propertyName: "uOffset", onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && (0, d.jsx)(b.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Offset V", target: k, propertyName: "vOffset", onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && (0, d.jsx)(b.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Scale U", target: k, propertyName: "uScale", onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && (0, d.jsx)(b.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Scale V", target: k, propertyName: "vScale", onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && (0, d.jsx)(j.SliderLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Rotation U", target: k, propertyName: "uAng", minimum: 0, maximum: Math.PI * 2, useEuler: !0, step: 0.1, onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && (0, d.jsx)(j.SliderLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Rotation V", target: k, propertyName: "vAng", minimum: 0, maximum: Math.PI * 2, useEuler: !0, step: 0.1, onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && (0, d.jsx)(j.SliderLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Rotation W", target: k, propertyName: "wAng", minimum: 0, maximum: Math.PI * 2, useEuler: !0, step: 0.1, onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } })] }), (0, d.jsxs)(P.LineContainerComponent, { title: "SOURCE", children: [(0, d.jsx)(p.CheckBoxLineComponent, { label: "Embed static texture", isSelected: () => this.state.isEmbedded, onSelect: (y) => {
                  this.setState({ isEmbedded: y }), this.imageSourceBlock.texture = null, this.updateAfterTextureLoad();
                } }), this.state.isEmbedded && (0, d.jsx)(u.FileButtonLineComponent, { label: "Upload", onClick: (y) => this.replaceTexture(y), accept: ".jpg, .png, .tga, .dds, .env" }), !this.state.isEmbedded && (0, d.jsx)(H.TextInputLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Link", value: I, onChange: (y) => this.replaceTextureWithUrl(y) }), !this.state.isEmbedded && I && (0, d.jsx)(T.ButtonLineComponent, { label: "Refresh", onClick: () => this.replaceTextureWithUrl(I + "?nocache=" + this._generateRandomForCache()) }), k && (0, d.jsx)(T.ButtonLineComponent, { label: "Remove", onClick: () => this.removeTexture() })] }), (0, d.jsx)(c.GenericPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/inputNodePropertyComponent.js": (
          /*!*******************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/inputNodePropertyComponent.js ***!
            \*******************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              InputPropertyTabComponent: () => (
                /* binding */
                R
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../components/propertyTab/properties/floatPropertyTabComponent */
              "../../../tools/nodeEditor/dist/components/propertyTab/properties/floatPropertyTabComponent.js"
            ), l = o(
              /*! ../../components/propertyTab/properties/vector2PropertyTabComponent */
              "../../../tools/nodeEditor/dist/components/propertyTab/properties/vector2PropertyTabComponent.js"
            ), P = o(
              /*! ../../components/propertyTab/properties/color3PropertyTabComponent */
              "../../../tools/nodeEditor/dist/components/propertyTab/properties/color3PropertyTabComponent.js"
            ), p = o(
              /*! ../../components/propertyTab/properties/vector3PropertyTabComponent */
              "../../../tools/nodeEditor/dist/components/propertyTab/properties/vector3PropertyTabComponent.js"
            ), c = o(
              /*! ../../components/propertyTab/properties/vector4PropertyTabComponent */
              "../../../tools/nodeEditor/dist/components/propertyTab/properties/vector4PropertyTabComponent.js"
            ), H = o(
              /*! ../../components/propertyTab/properties/matrixPropertyTabComponent */
              "../../../tools/nodeEditor/dist/components/propertyTab/properties/matrixPropertyTabComponent.js"
            ), T = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), q = o(
              /*! core/Materials/Node/Blocks/Input/animatedInputBlockTypes */
              "core/Misc/dataStorage"
            ), b = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), j = o(
              /*! ../../sharedComponents/checkBoxLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/checkBoxLineComponent.js"
            ), w = o(
              /*! ../../components/propertyTab/properties/color4PropertyTabComponent */
              "../../../tools/nodeEditor/dist/components/propertyTab/properties/color4PropertyTabComponent.js"
            ), m = o(
              /*! shared-ui-components/lines/textInputLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js"
            ), I = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            ), N = o(
              /*! shared-ui-components/lines/floatLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js"
            ), k = o(
              /*! shared-ui-components/lines/sliderLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js"
            );
            class R extends v.Component {
              constructor(O) {
                super(O);
              }
              componentDidMount() {
                const O = this.props.nodeData.data;
                this._onValueChangedObserver = O.onValueChangedObservable.add(() => {
                  this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(O);
                });
              }
              componentWillUnmount() {
                const O = this.props.nodeData.data;
                this._onValueChangedObserver && (O.onValueChangedObservable.remove(this._onValueChangedObserver), this._onValueChangedObserver = null);
              }
              renderValue(O) {
                const Y = this.props.nodeData.data;
                switch (Y.type) {
                  case q.NodeMaterialBlockConnectionPointTypes.Float: {
                    const ee = isNaN(Y.min) || isNaN(Y.max) || Y.min === Y.max;
                    return (0, d.jsxs)(d.Fragment, { children: [(0, d.jsx)(j.CheckBoxLineComponent, { label: "Is boolean", target: Y, propertyName: "isBoolean" }), Y.isBoolean && (0, d.jsx)(j.CheckBoxLineComponent, { label: "Value", isSelected: () => Y.value === 1, onSelect: (Z) => {
                      Y.value = Z ? 1 : 0, Y.isConstant && this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(Y);
                    } }), !Y.isBoolean && (0, d.jsx)(N.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Min", target: Y, propertyName: "min", onChange: () => {
                      Y.value < Y.min && (Y.value = Y.min, Y.isConstant && this.props.stateManager.onRebuildRequiredObservable.notifyObservers()), this.forceUpdate();
                    } }), !Y.isBoolean && (0, d.jsx)(N.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Max", target: Y, propertyName: "max", onChange: () => {
                      Y.value > Y.max && (Y.value = Y.max, Y.isConstant && this.props.stateManager.onRebuildRequiredObservable.notifyObservers()), this.forceUpdate();
                    } }), !Y.isBoolean && ee && (0, d.jsx)(u.FloatPropertyTabComponent, { globalState: O, inputBlock: Y }), !Y.isBoolean && !ee && (0, d.jsx)(k.SliderLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Value", target: Y, propertyName: "value", step: Math.abs(Y.max - Y.min) / 100, minimum: Math.min(Y.min, Y.max), maximum: Y.max, onChange: () => {
                      Y.isConstant && this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(Y);
                    } })] });
                  }
                  case q.NodeMaterialBlockConnectionPointTypes.Vector2:
                    return (0, d.jsx)(l.Vector2PropertyTabComponent, { lockObject: O.lockObject, globalState: O, inputBlock: Y });
                  case q.NodeMaterialBlockConnectionPointTypes.Color3:
                    return (0, d.jsxs)(d.Fragment, { children: [(0, d.jsx)(P.Color3PropertyTabComponent, { lockObject: O.lockObject, globalState: O, inputBlock: Y }), (0, d.jsx)(j.CheckBoxLineComponent, { label: "Convert to gamma space", propertyName: "convertToGammaSpace", target: Y, onValueChanged: () => {
                      this.props.stateManager.onUpdateRequiredObservable.notifyObservers(Y);
                    } }), (0, d.jsx)(j.CheckBoxLineComponent, { label: "Convert to linear space", propertyName: "convertToLinearSpace", target: Y, onValueChanged: () => {
                      this.props.stateManager.onUpdateRequiredObservable.notifyObservers(Y);
                    } })] });
                  case q.NodeMaterialBlockConnectionPointTypes.Color4:
                    return (0, d.jsxs)(d.Fragment, { children: [(0, d.jsx)(w.Color4PropertyTabComponent, { lockObject: O.lockObject, globalState: O, inputBlock: Y }), (0, d.jsx)(j.CheckBoxLineComponent, { label: "Convert to gamma space", propertyName: "convertToGammaSpace", target: Y, onValueChanged: () => {
                      this.props.stateManager.onUpdateRequiredObservable.notifyObservers(Y);
                    } }), (0, d.jsx)(j.CheckBoxLineComponent, { label: "Convert to linear space", propertyName: "convertToLinearSpace", target: Y, onValueChanged: () => {
                      this.props.stateManager.onUpdateRequiredObservable.notifyObservers(Y);
                    } })] });
                  case q.NodeMaterialBlockConnectionPointTypes.Vector3:
                    return (0, d.jsx)(p.Vector3PropertyTabComponent, { lockObject: O.lockObject, globalState: O, inputBlock: Y });
                  case q.NodeMaterialBlockConnectionPointTypes.Vector4:
                    return (0, d.jsx)(c.Vector4PropertyTabComponent, { lockObject: O.lockObject, globalState: O, inputBlock: Y });
                  case q.NodeMaterialBlockConnectionPointTypes.Matrix:
                    return (0, d.jsx)(H.MatrixPropertyTabComponent, { lockObject: O.lockObject, globalState: O, inputBlock: Y });
                }
                return null;
              }
              setDefaultValue() {
                this.props.nodeData.data.setDefaultValue();
              }
              render() {
                const O = this.props.nodeData.data;
                let Y = [], ee = [], Z = [];
                switch (O.type) {
                  case q.NodeMaterialBlockConnectionPointTypes.Float:
                    Z = [
                      { label: "None", value: q.AnimatedInputBlockTypes.None },
                      { label: "Time", value: q.AnimatedInputBlockTypes.Time },
                      { label: "RealTime", value: q.AnimatedInputBlockTypes.RealTime }
                    ], Y = [
                      { label: "Delta time", value: q.NodeMaterialSystemValues.DeltaTime },
                      { label: "Material alpha", value: q.NodeMaterialSystemValues.MaterialAlpha }
                    ];
                    break;
                  case q.NodeMaterialBlockConnectionPointTypes.Matrix:
                    Y = [
                      { label: "World", value: q.NodeMaterialSystemValues.World },
                      { label: "World x View", value: q.NodeMaterialSystemValues.WorldView },
                      { label: "World x View x Projection", value: q.NodeMaterialSystemValues.WorldViewProjection },
                      { label: "View", value: q.NodeMaterialSystemValues.View },
                      { label: "View x Projection", value: q.NodeMaterialSystemValues.ViewProjection },
                      { label: "Projection", value: q.NodeMaterialSystemValues.Projection }
                    ];
                    break;
                  case q.NodeMaterialBlockConnectionPointTypes.Color3:
                    Y = [{ label: "Fog color", value: q.NodeMaterialSystemValues.FogColor }];
                    break;
                  case q.NodeMaterialBlockConnectionPointTypes.Color4:
                    ee = [
                      { label: "color", value: "color" },
                      { label: "Instance Color", value: "instanceColor" }
                    ];
                    break;
                  case q.NodeMaterialBlockConnectionPointTypes.Vector2:
                    ee = [
                      { label: "uv", value: "uv" },
                      { label: "uv2", value: "uv2" },
                      { label: "uv3", value: "uv3" },
                      { label: "uv4", value: "uv4" },
                      { label: "uv5", value: "uv5" },
                      { label: "uv6", value: "uv6" }
                    ];
                    break;
                  case q.NodeMaterialBlockConnectionPointTypes.Vector3:
                    Y = [{ label: "Camera position", value: q.NodeMaterialSystemValues.CameraPosition }], ee = [
                      { label: "position", value: "position" },
                      { label: "normal", value: "normal" }
                    ];
                    break;
                  case q.NodeMaterialBlockConnectionPointTypes.Vector4:
                    ee = [
                      { label: "matricesIndices", value: "matricesIndices" },
                      { label: "matricesWeights", value: "matricesWeights" },
                      { label: "matricesIndicesExtra", value: "matricesIndicesExtra" },
                      { label: "matricesWeightsExtra", value: "matricesWeightsExtra" },
                      { label: "tangent", value: "tangent" }
                    ], Y = [{ label: "Camera parameters", value: q.NodeMaterialSystemValues.CameraParameters }];
                    break;
                }
                const te = [{ label: "User-defined", value: 0 }];
                ee.length > 0 && te.push({ label: "Mesh attribute", value: 1 }), Y.length > 0 && te.push({ label: "System value", value: 2 });
                const fe = [
                  { label: "None", value: 0 },
                  { label: "Visible in the inspector", value: 1 },
                  { label: "Constant", value: 2 }
                ];
                return (0, d.jsxs)("div", { children: [(0, d.jsx)(b.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsxs)(T.LineContainerComponent, { title: "PROPERTIES", children: [O.isUniform && !O.isSystemValue && O.animationType === q.AnimatedInputBlockTypes.None && (0, d.jsx)(I.OptionsLineComponent, { label: "Type", options: fe, target: O, noDirectUpdate: !0, extractValue: () => O.visibleInInspector ? 1 : O.isConstant ? 2 : 0, onSelect: (_) => {
                  switch (_) {
                    case 0:
                      O.visibleInInspector = !1, O.isConstant = !1;
                      break;
                    case 1:
                      O.visibleInInspector = !0, O.isConstant = !1;
                      break;
                    case 2:
                      O.visibleInInspector = !1, O.isConstant = !0;
                      break;
                  }
                  this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(O), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                }, propertyName: "" }), O.visibleInInspector && (0, d.jsx)(m.TextInputLineComponent, { label: "Group", propertyName: "groupInInspector", target: O, lockObject: this.props.stateManager.lockObject, onChange: () => {
                  this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(O), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                }, throttlePropertyChangedNotification: !0 }), (0, d.jsx)(I.OptionsLineComponent, { label: "Mode", options: te, target: O, noDirectUpdate: !0, extractValue: () => O.isAttribute ? 1 : O.isSystemValue ? 2 : 0, onSelect: (_) => {
                  switch (_) {
                    case 0:
                      O.isUniform = !0, O.setAsSystemValue(null), this.setDefaultValue();
                      break;
                    case 1:
                      O.setAsAttribute(ee[0].value);
                      break;
                    case 2:
                      O.setAsSystemValue(Y[0].value);
                      break;
                  }
                  this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(O), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                }, propertyName: "" }), O.isAttribute && (0, d.jsx)(I.OptionsLineComponent, { label: "Attribute", valuesAreStrings: !0, options: ee, target: O, propertyName: "name", onSelect: (_) => {
                  O.setAsAttribute(_), this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(O), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                } }), O.isUniform && Z.length > 0 && (0, d.jsx)(I.OptionsLineComponent, { label: "Animation type", options: Z, target: O, propertyName: "animationType", onSelect: () => {
                  this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(O), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                } }), O.isUniform && !O.isSystemValue && O.animationType === q.AnimatedInputBlockTypes.None && this.renderValue(this.props.stateManager.data), O.isUniform && O.isSystemValue && (0, d.jsx)(I.OptionsLineComponent, { label: "System value", options: Y, target: O, propertyName: "systemValue", onSelect: (_) => {
                  O.setAsSystemValue(_), this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(O), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                } }), O.isUniform && !O.isSystemValue && O.animationType === q.AnimatedInputBlockTypes.None && (0, d.jsx)(j.CheckBoxLineComponent, { label: "Visible on frame", target: O, propertyName: "visibleOnFrame" })] })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/lightInformationPropertyTabComponent.js": (
          /*!*****************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/lightInformationPropertyTabComponent.js ***!
            \*****************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              LightInformationPropertyTabComponent: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), P = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            );
            class p extends v.Component {
              render() {
                const H = this.props.stateManager.data.nodeMaterial.getScene(), T = H.lights.map((b) => ({ label: b.name, value: b.name })), q = this.props.nodeData.data;
                return (0, d.jsxs)("div", { children: [(0, d.jsx)(l.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsx)(u.LineContainerComponent, { title: "PROPERTIES", children: (0, d.jsx)(P.OptionsLineComponent, { label: "Light", noDirectUpdate: !0, valuesAreStrings: !0, options: T, target: q, propertyName: "name", extractValue: (b) => {
                  var j;
                  return ((j = b.light) == null ? void 0 : j.name) ?? "";
                }, onSelect: (b) => {
                  q.light = H.getLightByName(b), this.forceUpdate(), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                } }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/nodePortPropertyComponent.js": (
          /*!******************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/nodePortPropertyComponent.js ***!
            \******************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              NodePortPropertyTabComponent: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! ../../sharedComponents/checkBoxLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/checkBoxLineComponent.js"
            ), P = o(
              /*! shared-ui-components/lines/textInputLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js"
            ), p = o(
              /*! shared-ui-components/lines/textLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js"
            );
            class c extends v.Component {
              constructor(T) {
                super(T);
              }
              toggleExposeOnFrame(T) {
                this.props.nodePort.exposedOnFrame = T, this.props.stateManager.onExposePortOnFrameObservable.notifyObservers(this.props.nodePort.node);
              }
              render() {
                const T = this.props.nodePort.hasLabel() ? (0, d.jsxs)(d.Fragment, { children: [this.props.nodePort.hasLabel() && (0, d.jsx)(P.TextInputLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Port Label", propertyName: "portName", target: this.props.nodePort }), this.props.nodePort.node.enclosingFrameId !== -1 && (0, d.jsx)(l.CheckBoxLineComponent, { label: "Expose Port on Frame", target: this.props.nodePort, isSelected: () => this.props.nodePort.exposedOnFrame, onSelect: (q) => this.toggleExposeOnFrame(q), propertyName: "exposedOnFrame", disabled: this.props.nodePort.disabled })] }) : (0, d.jsx)(p.TextLineComponent, { label: "This node is a constant input node and cannot be exposed to the frame.", value: " " });
                return (0, d.jsxs)("div", { id: "propertyTab", children: [(0, d.jsxs)("div", { id: "header", children: [(0, d.jsx)("img", { id: "logo", src: "https://www.babylonjs.com/Assets/logo-babylonjs-social-twitter.png" }), (0, d.jsx)("div", { id: "title", children: "NODE MATERIAL EDITOR" })] }), (0, d.jsx)("div", { children: (0, d.jsx)(u.LineContainerComponent, { title: "GENERAL", children: T }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/teleportOutNodePropertyComponent.js": (
          /*!*************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/teleportOutNodePropertyComponent.js ***!
            \*************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TeleportOutPropertyTabComponent: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), l = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), P = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            );
            class p extends v.Component {
              constructor(H) {
                super(H);
              }
              componentDidMount() {
                this._onUpdateRequiredObserver = this.props.stateManager.onUpdateRequiredObservable.add(() => {
                  this.forceUpdate();
                });
              }
              componentWillUnmount() {
                this.props.stateManager.onUpdateRequiredObservable.remove(this._onUpdateRequiredObserver);
              }
              render() {
                const H = this.props.nodeData.data, T = [{ label: "None", value: -1 }], q = [], b = this.props.stateManager.data.nodeMaterial;
                for (const j of b.attachedBlocks)
                  j.getClassName() === "NodeMaterialTeleportInBlock" && q.push(j);
                q.sort((j, w) => j.name.localeCompare(w.name));
                for (const j of q)
                  T.push({ label: j.name, value: j.uniqueId });
                return (0, d.jsxs)("div", { children: [(0, d.jsx)(u.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsx)(l.LineContainerComponent, { title: "PROPERTIES", children: (0, d.jsx)(P.OptionsLineComponent, { label: "Entry point", options: T, target: H, propertyName: "entryPoint", noDirectUpdate: !0, onSelect: (j) => {
                  switch (H.entryPoint && this.props.stateManager.onHighlightNodeObservable.notifyObservers({ data: H.entryPoint, active: !1 }), j) {
                    case -1:
                      H.detach();
                      break;
                    default: {
                      const w = q.find((m) => m.uniqueId === j);
                      w == null || w.attachToEndpoint(H);
                    }
                  }
                  H.entryPoint && this.props.stateManager.onHighlightNodeObservable.notifyObservers({ data: H.entryPoint, active: !0 }), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(H), this.forceUpdate();
                }, extractValue: () => {
                  var j;
                  return H.entryPoint ? (j = H.entryPoint) == null ? void 0 : j.uniqueId : -1;
                } }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/texturePropertyTabComponent.js": (
          /*!********************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/texturePropertyTabComponent.js ***!
            \********************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TexturePropertyTabComponent: () => (
                /* binding */
                w
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/fileButtonLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/fileButtonLineComponent.js"
            ), l = o(
              /*! core/Materials/Node/Enums/nodeMaterialModes */
              "core/Misc/dataStorage"
            ), P = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), p = o(
              /*! ../../sharedComponents/checkBoxLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/checkBoxLineComponent.js"
            ), c = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), H = o(
              /*! shared-ui-components/lines/textInputLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js"
            ), T = o(
              /*! shared-ui-components/lines/buttonLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js"
            ), q = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            ), b = o(
              /*! shared-ui-components/lines/floatLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js"
            ), j = o(
              /*! shared-ui-components/lines/sliderLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js"
            );
            class w extends v.Component {
              get textureBlock() {
                return this.props.nodeData.data;
              }
              constructor(I) {
                super(I);
                const N = this.textureBlock.texture;
                this.state = { isEmbedded: !N || N.name.substring(0, 4) === "data", loadAsCubeTexture: N && N.isCube, textureIsPrefiltered: !0 };
              }
              // eslint-disable-next-line @typescript-eslint/naming-convention
              UNSAFE_componentWillUpdate(I, N) {
                if (I.nodeData.data !== this.props.nodeData.data) {
                  const k = I.nodeData.data.texture;
                  N.isEmbedded = !k || k.name.substring(0, 4) === "data", N.loadAsCubeTexture = k && k.isCube;
                }
              }
              _generateRandomForCache() {
                return "xxxxxxxxxxxxxxxxxxxx".replace(/[x]/g, () => (Math.random() * 10 | 0).toString());
              }
              updateAfterTextureLoad() {
                this.props.stateManager.onUpdateRequiredObservable.notifyObservers(this.props.nodeData.data), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
              }
              removeTexture() {
                let I = this.textureBlock.texture;
                I && (I.dispose(), I = null, this.textureBlock.texture = null), this.updateAfterTextureLoad();
              }
              _prepareTexture() {
                let I = this.textureBlock.texture;
                if (I && I.isCube !== this.state.loadAsCubeTexture && (I.dispose(), I = null), !I) {
                  const N = this.props.stateManager.data;
                  this.state.loadAsCubeTexture ? (this.textureBlock.texture = new l.CubeTexture("", N.nodeMaterial.getScene()), I = this.textureBlock.texture, I.coordinatesMode = l.Texture.CUBIC_MODE) : (this.textureBlock.texture = new l.Texture(null, N.nodeMaterial.getScene(), !1, this.textureBlock instanceof l.ReflectionTextureBlock || this.textureBlock instanceof l.ReflectionBlock || this.textureBlock instanceof l.RefractionBlock || N.mode === l.NodeMaterialModes.PostProcess), I = this.textureBlock.texture, I.coordinatesMode = l.Texture.EQUIRECTANGULAR_MODE);
                }
              }
              /**
               * Replaces the texture of the node
               * @param file the file of the texture to use
               */
              replaceTexture(I) {
                this._prepareTexture();
                const N = this.textureBlock.texture;
                l.Tools.ReadFile(I, (k) => {
                  const R = new Blob([k], { type: "octet/stream" }), y = new FileReader();
                  y.readAsDataURL(R), y.onloadend = () => {
                    const O = y.result;
                    let Y;
                    I.name.toLowerCase().indexOf(".dds") > 0 ? Y = ".dds" : I.name.toLowerCase().indexOf(".env") > 0 && (Y = ".env"), N.isCube ? N.updateURL(O, Y, () => this.updateAfterTextureLoad(), this.state.textureIsPrefiltered) : N.updateURL(O, Y, () => this.updateAfterTextureLoad());
                  };
                }, void 0, !0);
              }
              replaceTextureWithUrl(I) {
                this._prepareTexture();
                const N = this.textureBlock.texture;
                if (N.name = I, N.isCube || this.textureBlock instanceof l.ReflectionTextureBlock || this.textureBlock instanceof l.ReflectionBlock || this.textureBlock instanceof l.RefractionBlock) {
                  let k;
                  I.toLowerCase().indexOf(".dds") > 0 ? k = ".dds" : I.toLowerCase().indexOf(".env") > 0 && (k = ".env"), N.updateURL(I, k, () => this.updateAfterTextureLoad(), this.state.textureIsPrefiltered);
                } else
                  N.updateURL(I, null, () => this.updateAfterTextureLoad());
              }
              render() {
                let I = "";
                const N = this.props.nodeData.data, k = this.textureBlock.hasImageSource ? null : this.textureBlock.texture;
                k && k.name && k.name.substring(0, 4) !== "data" && (I = k.name), I = I.replace(/\?nocache=\d+/, "");
                const R = this.textureBlock instanceof l.ReflectionTextureBlock || this.textureBlock instanceof l.ReflectionBlock || this.textureBlock instanceof l.RefractionBlock, y = this.textureBlock instanceof l.CurrentScreenBlock || this.textureBlock instanceof l.ParticleTextureBlock, O = this.textureBlock instanceof l.ReflectionBlock, Y = [
                  {
                    label: "Cubic",
                    value: l.Texture.CUBIC_MODE
                  },
                  {
                    label: "Equirectangular",
                    value: l.Texture.EQUIRECTANGULAR_MODE
                  },
                  {
                    label: "Explicit",
                    value: l.Texture.EXPLICIT_MODE
                  },
                  {
                    label: "Fixed equirectangular",
                    value: l.Texture.FIXED_EQUIRECTANGULAR_MODE
                  },
                  {
                    label: "Fixed mirrored equirectangular",
                    value: l.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE
                  },
                  {
                    label: "Planar",
                    value: l.Texture.PLANAR_MODE
                  },
                  {
                    label: "Projection",
                    value: l.Texture.PROJECTION_MODE
                  },
                  {
                    label: "Skybox",
                    value: l.Texture.SKYBOX_MODE
                  },
                  {
                    label: "Spherical",
                    value: l.Texture.SPHERICAL_MODE
                  }
                ], ee = [
                  { label: "Nearest", value: l.Texture.NEAREST_NEAREST },
                  { label: "Linear", value: l.Texture.LINEAR_LINEAR },
                  { label: "Linear & linear mip", value: l.Texture.LINEAR_LINEAR_MIPLINEAR },
                  { label: "Linear & nearest mip", value: l.Texture.LINEAR_LINEAR_MIPNEAREST },
                  { label: "Nearest & linear mip", value: l.Texture.NEAREST_NEAREST_MIPLINEAR },
                  { label: "Nearest & nearest mip", value: l.Texture.NEAREST_NEAREST_MIPNEAREST },
                  { label: "Nearest/Linear", value: l.Texture.NEAREST_LINEAR },
                  { label: "Nearest/Linear & linear mip", value: l.Texture.NEAREST_LINEAR_MIPLINEAR },
                  { label: "Nearest/Linear & nearest mip", value: l.Texture.NEAREST_LINEAR_MIPNEAREST },
                  { label: "Linear/Nearest", value: l.Texture.LINEAR_NEAREST },
                  { label: "Linear/Nearest & linear mip", value: l.Texture.LINEAR_NEAREST_MIPLINEAR },
                  { label: "Linear/Nearest & nearest mip", value: l.Texture.LINEAR_NEAREST_MIPNEAREST }
                  // 9
                ];
                return (0, d.jsxs)("div", { children: [(0, d.jsx)(c.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsxs)(P.LineContainerComponent, { title: "PROPERTIES", children: [(0, d.jsx)(p.CheckBoxLineComponent, { label: "Auto select UV", propertyName: "autoSelectUV", target: N, onValueChanged: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), !R && (0, d.jsx)(p.CheckBoxLineComponent, { label: "Convert to gamma space", propertyName: "convertToGammaSpace", target: N, onValueChanged: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), !R && (0, d.jsx)(p.CheckBoxLineComponent, { label: "Convert to linear space", propertyName: "convertToLinearSpace", target: N, onValueChanged: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && O && (0, d.jsx)(p.CheckBoxLineComponent, { label: "Is in gamma space", propertyName: "gammaSpace", target: k, onValueChanged: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), (0, d.jsx)(p.CheckBoxLineComponent, { label: "Disable multiplying by level", propertyName: "disableLevelMultiplication", target: N, onValueChanged: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                } }), k && k.updateSamplingMode && (0, d.jsx)(q.OptionsLineComponent, { label: "Sampling", options: ee, target: k, noDirectUpdate: !0, propertyName: "samplingMode", onSelect: (Z) => {
                  k.updateSamplingMode(Z), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && R && (0, d.jsx)(q.OptionsLineComponent, { label: "Reflection mode", options: Y, target: k, propertyName: "coordinatesMode", onSelect: (Z) => {
                  k.coordinatesMode = Z, this.forceUpdate(), this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && !R && !y && (0, d.jsx)(p.CheckBoxLineComponent, { label: "Clamp U", isSelected: () => k.wrapU === l.Texture.CLAMP_ADDRESSMODE, onSelect: (Z) => {
                  k.wrapU = Z ? l.Texture.CLAMP_ADDRESSMODE : l.Texture.WRAP_ADDRESSMODE, this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                } }), k && !R && !y && (0, d.jsx)(p.CheckBoxLineComponent, { label: "Clamp V", isSelected: () => k.wrapV === l.Texture.CLAMP_ADDRESSMODE, onSelect: (Z) => {
                  k.wrapV = Z ? l.Texture.CLAMP_ADDRESSMODE : l.Texture.WRAP_ADDRESSMODE, this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N), this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                } }), k && !R && !y && (0, d.jsx)(b.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Offset U", target: k, propertyName: "uOffset", onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && !R && !y && (0, d.jsx)(b.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Offset V", target: k, propertyName: "vOffset", onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && !R && !y && (0, d.jsx)(b.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Scale U", target: k, propertyName: "uScale", onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && !R && !y && (0, d.jsx)(b.FloatLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Scale V", target: k, propertyName: "vScale", onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && !R && !y && (0, d.jsx)(j.SliderLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Rotation U", target: k, propertyName: "uAng", minimum: 0, maximum: Math.PI * 2, useEuler: !0, step: 0.1, onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && !R && !y && (0, d.jsx)(j.SliderLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Rotation V", target: k, propertyName: "vAng", minimum: 0, maximum: Math.PI * 2, useEuler: !0, step: 0.1, onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } }), k && !R && !y && (0, d.jsx)(j.SliderLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Rotation W", target: k, propertyName: "wAng", minimum: 0, maximum: Math.PI * 2, useEuler: !0, step: 0.1, onChange: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(N);
                } })] }), !this.textureBlock.hasImageSource && (0, d.jsxs)(P.LineContainerComponent, { title: "SOURCE", children: [(0, d.jsx)(p.CheckBoxLineComponent, { label: "Embed static texture", isSelected: () => this.state.isEmbedded, onSelect: (Z) => {
                  this.setState({ isEmbedded: Z }), this.textureBlock.texture = null, this.updateAfterTextureLoad();
                } }), R && (0, d.jsx)(p.CheckBoxLineComponent, { label: "Load as cube texture", isSelected: () => this.state.loadAsCubeTexture, onSelect: (Z) => this.setState({ loadAsCubeTexture: Z }) }), R && this.state.loadAsCubeTexture && (0, d.jsx)(p.CheckBoxLineComponent, { label: "      Texture is prefiltered", isSelected: () => this.state.textureIsPrefiltered, onSelect: (Z) => this.setState({ textureIsPrefiltered: Z }) }), this.state.isEmbedded && (0, d.jsx)(u.FileButtonLineComponent, { label: "Upload", onClick: (Z) => this.replaceTexture(Z), accept: ".jpg, .png, .tga, .dds, .env" }), !this.state.isEmbedded && (0, d.jsx)(H.TextInputLineComponent, { lockObject: this.props.stateManager.lockObject, label: "Link", value: I, onChange: (Z) => this.replaceTextureWithUrl(Z) }), !this.state.isEmbedded && I && (0, d.jsx)(T.ButtonLineComponent, { label: "Refresh", onClick: () => this.replaceTextureWithUrl(I + "?nocache=" + this._generateRandomForCache()) }), k && (0, d.jsx)(T.ButtonLineComponent, { label: "Remove", onClick: () => this.removeTexture() })] }), (0, d.jsx)(c.GenericPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/transformNodePropertyComponent.js": (
          /*!***********************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/transformNodePropertyComponent.js ***!
            \***********************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TransformPropertyTabComponent: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! ../../sharedComponents/checkBoxLineComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/checkBoxLineComponent.js"
            ), P = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            );
            class p extends v.Component {
              constructor(H) {
                super(H);
              }
              render() {
                return (0, d.jsxs)(d.Fragment, { children: [(0, d.jsx)(P.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsx)(u.LineContainerComponent, { title: "PROPERTIES", children: (0, d.jsx)(l.CheckBoxLineComponent, { label: "Transform as direction", onSelect: (H) => {
                  const T = this.props.nodeData.data;
                  H ? T.complementW = 0 : T.complementW = 1, this.props.stateManager.onRebuildRequiredObservable.notifyObservers();
                }, isSelected: () => this.props.nodeData.data.complementW === 0 }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/trigonometryNodePropertyComponent.js": (
          /*!**************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/trigonometryNodePropertyComponent.js ***!
            \**************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TrigonometryPropertyTabComponent: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! core/Materials/Node/Blocks/trigonometryBlock */
              "core/Misc/dataStorage"
            ), P = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), p = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            );
            class c extends v.Component {
              constructor(T) {
                super(T);
              }
              render() {
                const T = this.props.nodeData.data, q = [
                  { label: "Cos", value: l.TrigonometryBlockOperations.Cos },
                  { label: "Sin", value: l.TrigonometryBlockOperations.Sin },
                  { label: "Abs", value: l.TrigonometryBlockOperations.Abs },
                  { label: "Exp", value: l.TrigonometryBlockOperations.Exp },
                  { label: "Exp2", value: l.TrigonometryBlockOperations.Exp2 },
                  { label: "Round", value: l.TrigonometryBlockOperations.Round },
                  { label: "Ceiling", value: l.TrigonometryBlockOperations.Ceiling },
                  { label: "Floor", value: l.TrigonometryBlockOperations.Floor },
                  { label: "Sqrt", value: l.TrigonometryBlockOperations.Sqrt },
                  { label: "ArcCos", value: l.TrigonometryBlockOperations.ArcCos },
                  { label: "ArcSin", value: l.TrigonometryBlockOperations.ArcSin },
                  { label: "ArcTan", value: l.TrigonometryBlockOperations.ArcTan },
                  { label: "Tan", value: l.TrigonometryBlockOperations.Tan },
                  { label: "Log", value: l.TrigonometryBlockOperations.Log },
                  { label: "Fract", value: l.TrigonometryBlockOperations.Fract },
                  { label: "Sign", value: l.TrigonometryBlockOperations.Sign },
                  { label: "Radians to degrees", value: l.TrigonometryBlockOperations.Degrees },
                  { label: "Degrees to radians", value: l.TrigonometryBlockOperations.Radians }
                ];
                return q.sort((b, j) => b.label.localeCompare(j.label)), (0, d.jsxs)("div", { children: [(0, d.jsx)(P.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsx)(u.LineContainerComponent, { title: "PROPERTIES", children: (0, d.jsx)(p.OptionsLineComponent, { label: "Operation", options: q, target: T, propertyName: "operation", onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(T), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/properties/vectorMergerPropertyComponent.js": (
          /*!**********************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/properties/vectorMergerPropertyComponent.js ***!
            \**********************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              VectorMergerPropertyTabComponent: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! ../../sharedComponents/lineContainerComponent */
              "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js"
            ), l = o(
              /*! ./genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), P = o(
              /*! shared-ui-components/lines/optionsLineComponent */
              "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js"
            );
            class p extends v.Component {
              constructor(H) {
                super(H);
              }
              render() {
                const H = this.props.nodeData.data, T = [
                  { label: "X", value: "x" },
                  { label: "Y", value: "y" },
                  { label: "Z", value: "z" },
                  { label: "W", value: "w" }
                ];
                return (0, d.jsxs)("div", { children: [(0, d.jsx)(l.GeneralPropertyTabComponent, { stateManager: this.props.stateManager, nodeData: this.props.nodeData }), (0, d.jsxs)(u.LineContainerComponent, { title: "SWIZZLES", children: [(0, d.jsx)(P.OptionsLineComponent, { label: "X", options: T, target: H, propertyName: "xSwizzle", valuesAreStrings: !0, onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(H), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } }), (0, d.jsx)(P.OptionsLineComponent, { label: "Y", options: T, target: H, propertyName: "ySwizzle", valuesAreStrings: !0, onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(H), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } }), (0, d.jsx)(P.OptionsLineComponent, { label: "Z", options: T, target: H, propertyName: "zSwizzle", valuesAreStrings: !0, onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(H), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } }), (0, d.jsx)(P.OptionsLineComponent, { label: "W", options: T, target: H, propertyName: "wSwizzle", valuesAreStrings: !0, onSelect: () => {
                  this.props.stateManager.onUpdateRequiredObservable.notifyObservers(H), this.props.stateManager.onRebuildRequiredObservable.notifyObservers(), this.forceUpdate();
                } })] })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/registerDebugSupport.js": (
          /*!**************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/registerDebugSupport.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              RegisterDebugSupport: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            const d = (v) => {
              v.isDebugConnectionAllowed = (u, l) => !1;
            };
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/registerDefaultInput.js": (
          /*!**************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/registerDefaultInput.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              RegisterDefaultInput: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ./blockNodeData */
              "../../../tools/nodeEditor/dist/graphSystem/blockNodeData.js"
            );
            const u = (l) => {
              l.createDefaultInputData = (P, p, c) => {
                const H = p.data, T = H.createCustomInputBlock();
                let q = "output", b;
                if (T)
                  [b, q] = T;
                else {
                  if (H.type === d.NodeMaterialBlockConnectionPointTypes.AutoDetect)
                    return null;
                  b = new d.InputBlock(d.NodeMaterialBlockConnectionPointTypes[H.type], void 0, H.type);
                }
                const j = P.nodeMaterial;
                return j.attachedBlocks.push(b), b.isInput || b.autoConfigure(j), {
                  data: new v.BlockNodeData(b, c),
                  name: q
                };
              };
            };
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/registerElbowSupport.js": (
          /*!**************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/registerElbowSupport.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              RegisterElbowSupport: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes */
              "core/Misc/dataStorage"
            );
            const v = (u) => {
              u.isElbowConnectionAllowed = (l, P) => {
                const p = l.portData.data, c = P.portData.data;
                return !(p.type === d.NodeMaterialBlockConnectionPointTypes.Object || c.type === d.NodeMaterialBlockConnectionPointTypes.Object);
              };
            };
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/registerExportData.js": (
          /*!************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/registerExportData.js ***!
            \************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              RegisterExportData: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! ../serializationTools */
              "../../../tools/nodeEditor/dist/serializationTools.js"
            );
            const v = (u) => {
              u.exportData = (l, P) => {
                const p = l.nodeMaterial;
                return d.SerializationTools.Serialize(p, u.data, P);
              }, u.getEditorDataMap = () => u.data.nodeMaterial.editorData.map;
            };
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/registerNodePortDesign.js": (
          /*!****************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/registerNodePortDesign.js ***!
            \****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              RegisterNodePortDesign: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes */
              "core/Misc/dataStorage"
            ), v = o(
              /*! ../blockTools */
              "../../../tools/nodeEditor/dist/blockTools.js"
            );
            const u = (l) => {
              l.applyNodePortDesign = (P, p, c) => {
                const H = P.data.type;
                switch (p.style.background = v.BlockTools.GetColorFromConnectionNodeType(H), H) {
                  case d.NodeMaterialBlockConnectionPointTypes.Float:
                  case d.NodeMaterialBlockConnectionPointTypes.Int:
                    c.src = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMSAyMSI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5WZWN0b3IxPC90aXRsZT48ZyBpZD0iTGF5ZXJfNSIgZGF0YS1uYW1lPSJMYXllciA1Ij48Y2lyY2xlIGNsYXNzPSJjbHMtMSIgY3g9IjEwLjUiIGN5PSIxMC41IiByPSI3LjUiLz48L2c+PC9zdmc+";
                    break;
                  case d.NodeMaterialBlockConnectionPointTypes.Vector2:
                    c.src = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMSAyMSI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5WZWN0b3IyPC90aXRsZT48ZyBpZD0iTGF5ZXJfNSIgZGF0YS1uYW1lPSJMYXllciA1Ij48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0zLDEwLjVhNy41Miw3LjUyLDAsMCwwLDYuNSw3LjQzVjMuMDdBNy41Miw3LjUyLDAsMCwwLDMsMTAuNVoiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xMS41LDMuMDdWMTcuOTNhNy41LDcuNSwwLDAsMCwwLTE0Ljg2WiIvPjwvZz48L3N2Zz4=";
                    break;
                  case d.NodeMaterialBlockConnectionPointTypes.Vector3:
                  case d.NodeMaterialBlockConnectionPointTypes.Color3:
                    c.src = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMSAyMSI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5WZWN0b3IzPC90aXRsZT48ZyBpZD0iTGF5ZXJfNSIgZGF0YS1uYW1lPSJMYXllciA1Ij48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0zLjU3LDEzLjMxLDkuNSw5Ljg5VjNBNy41MSw3LjUxLDAsMCwwLDMsMTAuNDYsNy4zMiw3LjMyLDAsMCwwLDMuNTcsMTMuMzFaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTYuNDMsMTUsMTAuNSwxMS42Miw0LjU3LDE1YTcuNDgsNy40OCwwLDAsMCwxMS44NiwwWiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE4LDEwLjQ2QTcuNTEsNy41MSwwLDAsMCwxMS41LDNWOS44OWw1LjkzLDMuNDJBNy4zMiw3LjMyLDAsMCwwLDE4LDEwLjQ2WiIvPjwvZz48L3N2Zz4=";
                    break;
                  case d.NodeMaterialBlockConnectionPointTypes.Vector4:
                  case d.NodeMaterialBlockConnectionPointTypes.Color4:
                    c.src = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMSAyMSI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5WZWN0b3I0PC90aXRsZT48ZyBpZD0iTGF5ZXJfNSIgZGF0YS1uYW1lPSJMYXllciA1Ij48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xMS41LDExLjV2Ni40M2E3LjUxLDcuNTEsMCwwLDAsNi40My02LjQzWiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTExLjUsMy4wN1Y5LjVoNi40M0E3LjUxLDcuNTEsMCwwLDAsMTEuNSwzLjA3WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTkuNSwxNy45M1YxMS41SDMuMDdBNy41MSw3LjUxLDAsMCwwLDkuNSwxNy45M1oiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik05LjUsMy4wN0E3LjUxLDcuNTEsMCwwLDAsMy4wNyw5LjVIOS41WiIvPjwvZz48L3N2Zz4=";
                    break;
                  case d.NodeMaterialBlockConnectionPointTypes.Matrix:
                    c.src = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMSAyMSI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5NYXRyaXg8L3RpdGxlPjxnIGlkPSJMYXllcl81IiBkYXRhLW5hbWU9IkxheWVyIDUiPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTExLjUsNi4xMVY5LjVoMy4zOUE0LjUxLDQuNTEsMCwwLDAsMTEuNSw2LjExWiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTExLjUsMTQuODlhNC41MSw0LjUxLDAsMCwwLDMuMzktMy4zOUgxMS41WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTExLjUsMy4wN3YyQTUuNTQsNS41NCwwLDAsMSwxNS45Miw5LjVoMkE3LjUxLDcuNTEsMCwwLDAsMTEuNSwzLjA3WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE1LjkyLDExLjVhNS41NCw1LjU0LDAsMCwxLTQuNDIsNC40MnYyYTcuNTEsNy41MSwwLDAsMCw2LjQzLTYuNDNaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNS4wOCwxMS41aC0yQTcuNTEsNy41MSwwLDAsMCw5LjUsMTcuOTN2LTJBNS41NCw1LjU0LDAsMCwxLDUuMDgsMTEuNVoiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik05LjUsMy4wN0E3LjUxLDcuNTEsMCwwLDAsMy4wNyw5LjVoMkE1LjU0LDUuNTQsMCwwLDEsOS41LDUuMDhaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNOS41LDExLjVINi4xMUE0LjUxLDQuNTEsMCwwLDAsOS41LDE0Ljg5WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTkuNSw2LjExQTQuNTEsNC41MSwwLDAsMCw2LjExLDkuNUg5LjVaIi8+PC9nPjwvc3ZnPg==";
                    break;
                  case d.NodeMaterialBlockConnectionPointTypes.Object:
                    c.src = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMSIgaGVpZ2h0PSIyMSIgdmlld0JveD0iMCAwIDIxIDIxIj48Y2lyY2xlIGN4PSI3LjEiIGN5PSIxMy4wOCIgcj0iMy4yNSIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0xMC40OSwzQTcuNTIsNy41MiwwLDAsMCwzLDEwYTUuMTMsNS4xMywwLDEsMSw2LDcuODUsNy42MSw3LjYxLDAsMCwwLDEuNTIuMTYsNy41Miw3LjUyLDAsMCwwLDAtMTVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+", c.style.width = "100%", c.style.height = "100%";
                    break;
                }
              };
            };
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/registerToDisplayLedger.js": (
          /*!*****************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/registerToDisplayLedger.js ***!
            \*****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              RegisterToDisplayManagers: () => (
                /* binding */
                R
              )
              /* harmony export */
            });
            var d = o(
              /*! ./display/inputDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/inputDisplayManager.js"
            ), v = o(
              /*! ./display/outputDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/outputDisplayManager.js"
            ), u = o(
              /*! ./display/clampDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/clampDisplayManager.js"
            ), l = o(
              /*! ./display/gradientDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/gradientDisplayManager.js"
            ), P = o(
              /*! ./display/remapDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/remapDisplayManager.js"
            ), p = o(
              /*! ./display/trigonometryDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/trigonometryDisplayManager.js"
            ), c = o(
              /*! ./display/textureDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/textureDisplayManager.js"
            ), H = o(
              /*! ./display/discardDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/discardDisplayManager.js"
            ), T = o(
              /*! ./display/pbrDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/pbrDisplayManager.js"
            ), q = o(
              /*! ./display/conditionalDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/conditionalDisplayManager.js"
            ), b = o(
              /*! ./display/imageSourceDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.js"
            ), j = o(
              /*! ./display/elbowDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.js"
            ), w = o(
              /*! shared-ui-components/nodeGraphSystem/displayLedger */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/displayLedger.js"
            ), m = o(
              /*! ./display/meshAttributeExistsDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/meshAttributeExistsDisplayManager.js"
            ), I = o(
              /*! ./display/curveDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/curveDisplayManager.js"
            ), N = o(
              /*! ./display/teleportOutDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/teleportOutDisplayManager.js"
            ), k = o(
              /*! ./display/teleportInDisplayManager */
              "../../../tools/nodeEditor/dist/graphSystem/display/teleportInDisplayManager.js"
            );
            const R = () => {
              w.DisplayLedger.RegisteredControls.InputBlock = d.InputDisplayManager, w.DisplayLedger.RegisteredControls.VertexOutputBlock = v.OutputDisplayManager, w.DisplayLedger.RegisteredControls.FragmentOutputBlock = v.OutputDisplayManager, w.DisplayLedger.RegisteredControls.ClampBlock = u.ClampDisplayManager, w.DisplayLedger.RegisteredControls.GradientBlock = l.GradientDisplayManager, w.DisplayLedger.RegisteredControls.RemapBlock = P.RemapDisplayManager, w.DisplayLedger.RegisteredControls.TrigonometryBlock = p.TrigonometryDisplayManager, w.DisplayLedger.RegisteredControls.ConditionalBlock = q.ConditionalDisplayManager, w.DisplayLedger.RegisteredControls.TextureBlock = c.TextureDisplayManager, w.DisplayLedger.RegisteredControls.ReflectionTextureBlock = c.TextureDisplayManager, w.DisplayLedger.RegisteredControls.ReflectionBlock = c.TextureDisplayManager, w.DisplayLedger.RegisteredControls.RefractionBlock = c.TextureDisplayManager, w.DisplayLedger.RegisteredControls.CurrentScreenBlock = c.TextureDisplayManager, w.DisplayLedger.RegisteredControls.ParticleTextureBlock = c.TextureDisplayManager, w.DisplayLedger.RegisteredControls.TriPlanarBlock = c.TextureDisplayManager, w.DisplayLedger.RegisteredControls.BiPlanarBlock = c.TextureDisplayManager, w.DisplayLedger.RegisteredControls.DiscardBlock = H.DiscardDisplayManager, w.DisplayLedger.RegisteredControls.PBRMetallicRoughnessBlock = T.PBRDisplayManager, w.DisplayLedger.RegisteredControls.AnisotropyBlock = T.PBRDisplayManager, w.DisplayLedger.RegisteredControls.ClearCoatBlock = T.PBRDisplayManager, w.DisplayLedger.RegisteredControls.SheenBlock = T.PBRDisplayManager, w.DisplayLedger.RegisteredControls.SubSurfaceBlock = T.PBRDisplayManager, w.DisplayLedger.RegisteredControls.ImageSourceBlock = b.ImageSourceDisplayManager, w.DisplayLedger.RegisteredControls.ElbowBlock = j.ElbowDisplayManager, w.DisplayLedger.RegisteredControls.MeshAttributeExistsBlock = m.MeshAttributeExistsDisplayManager, w.DisplayLedger.RegisteredControls.CurveBlock = I.CurveDisplayManager, w.DisplayLedger.RegisteredControls.NodeMaterialTeleportInBlock = k.TeleportInDisplayManager, w.DisplayLedger.RegisteredControls.NodeMaterialTeleportOutBlock = N.TeleportOutDisplayManager;
            };
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/registerToPropertyLedger.js": (
          /*!******************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/registerToPropertyLedger.js ***!
            \******************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              RegisterToPropertyTabManagers: () => (
                /* binding */
                I
              )
              /* harmony export */
            });
            var d = o(
              /*! shared-ui-components/nodeGraphSystem/propertyLedger */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/propertyLedger.js"
            ), v = o(
              /*! ./properties/colorMergerPropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/colorMergerPropertyComponent.js"
            ), u = o(
              /*! ./properties/conditionalNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/conditionalNodePropertyComponent.js"
            ), l = o(
              /*! ./properties/genericNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/genericNodePropertyComponent.js"
            ), P = o(
              /*! ./properties/gradientNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/gradientNodePropertyComponent.js"
            ), p = o(
              /*! ./properties/imageSourcePropertyTabComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/imageSourcePropertyTabComponent.js"
            ), c = o(
              /*! ./properties/inputNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/inputNodePropertyComponent.js"
            ), H = o(
              /*! ./properties/lightInformationPropertyTabComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/lightInformationPropertyTabComponent.js"
            ), T = o(
              /*! ./properties/texturePropertyTabComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/texturePropertyTabComponent.js"
            ), q = o(
              /*! ./properties/transformNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/transformNodePropertyComponent.js"
            ), b = o(
              /*! ./properties/trigonometryNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/trigonometryNodePropertyComponent.js"
            ), j = o(
              /*! ./properties/vectorMergerPropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/vectorMergerPropertyComponent.js"
            ), w = o(
              /*! ./properties/curveNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/curveNodePropertyComponent.js"
            ), m = o(
              /*! ./properties/teleportOutNodePropertyComponent */
              "../../../tools/nodeEditor/dist/graphSystem/properties/teleportOutNodePropertyComponent.js"
            );
            const I = () => {
              d.PropertyLedger.DefaultControl = l.GenericPropertyComponent, d.PropertyLedger.RegisteredControls.TransformBlock = q.TransformPropertyTabComponent, d.PropertyLedger.RegisteredControls.InputBlock = c.InputPropertyTabComponent, d.PropertyLedger.RegisteredControls.GradientBlock = P.GradientPropertyTabComponent, d.PropertyLedger.RegisteredControls.LightInformationBlock = H.LightInformationPropertyTabComponent, d.PropertyLedger.RegisteredControls.TextureBlock = T.TexturePropertyTabComponent, d.PropertyLedger.RegisteredControls.ReflectionTextureBlock = T.TexturePropertyTabComponent, d.PropertyLedger.RegisteredControls.ReflectionBlock = T.TexturePropertyTabComponent, d.PropertyLedger.RegisteredControls.RefractionBlock = T.TexturePropertyTabComponent, d.PropertyLedger.RegisteredControls.CurrentScreenBlock = T.TexturePropertyTabComponent, d.PropertyLedger.RegisteredControls.ParticleTextureBlock = T.TexturePropertyTabComponent, d.PropertyLedger.RegisteredControls.TriPlanarBlock = T.TexturePropertyTabComponent, d.PropertyLedger.RegisteredControls.BiPlanarBlock = T.TexturePropertyTabComponent, d.PropertyLedger.RegisteredControls.TrigonometryBlock = b.TrigonometryPropertyTabComponent, d.PropertyLedger.RegisteredControls.ConditionalBlock = u.ConditionalPropertyTabComponent, d.PropertyLedger.RegisteredControls.ImageSourceBlock = p.ImageSourcePropertyTabComponent, d.PropertyLedger.RegisteredControls.VectorMergerBlock = j.VectorMergerPropertyTabComponent, d.PropertyLedger.RegisteredControls.ColorMergerBlock = v.ColorMergerPropertyTabComponent, d.PropertyLedger.RegisteredControls.CurveBlock = w.CurvePropertyTabComponent, d.PropertyLedger.RegisteredControls.NodeMaterialTeleportOutBlock = m.TeleportOutPropertyTabComponent;
            };
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/registerToTypeLedger.js": (
          /*!**************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/registerToTypeLedger.js ***!
            \**************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              RegisterTypeLedger: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! shared-ui-components/nodeGraphSystem/typeLedger */
              "../../../dev/sharedUiComponents/dist/nodeGraphSystem/typeLedger.js"
            ), v = o(
              /*! ./blockNodeData */
              "../../../tools/nodeEditor/dist/graphSystem/blockNodeData.js"
            ), u = o(
              /*! ./connectionPointPortData */
              "../../../tools/nodeEditor/dist/graphSystem/connectionPointPortData.js"
            );
            const l = () => {
              d.TypeLedger.PortDataBuilder = (P, p) => new u.ConnectionPointPortData(P.portData.data, p), d.TypeLedger.NodeDataBuilder = (P, p) => new v.BlockNodeData(P, p);
            };
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/index.js": (
          /*!***********************************************!*\
            !*** ../../../tools/nodeEditor/dist/index.js ***!
            \***********************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              NodeEditor: () => (
                /* reexport safe */
                d.NodeEditor
              )
              /* harmony export */
            });
            var d = o(
              /*! ./nodeEditor */
              "../../../tools/nodeEditor/dist/nodeEditor.js"
            );
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/legacy/legacy.js": (
          /*!*******************************************************!*\
            !*** ../../../tools/nodeEditor/dist/legacy/legacy.js ***!
            \*******************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              NodeEditor: () => (
                /* reexport safe */
                d.NodeEditor
              )
              /* harmony export */
            });
            var d = o(
              /*! ../index */
              "../../../tools/nodeEditor/dist/index.js"
            );
            const v = typeof o.g < "u" ? o.g : typeof window < "u" ? window : void 0;
            typeof v < "u" && (v.BABYLON = v.BABYLON || {}, v.BABYLON.NodeEditor = d.NodeEditor);
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/nodeEditor.js": (
          /*!****************************************************!*\
            !*** ../../../tools/nodeEditor/dist/nodeEditor.js ***!
            \****************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              NodeEditor: () => (
                /* binding */
                j
              )
              /* harmony export */
            });
            var d = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), v = o(
              /*! react-dom */
              "../../../../node_modules/react-dom/index.js"
            ), u = o(
              /*! ./globalState */
              "../../../tools/nodeEditor/dist/globalState.js"
            ), l = o(
              /*! ./graphEditor */
              "../../../tools/nodeEditor/dist/graphEditor.js"
            ), P = o(
              /*! ./sharedComponents/popup */
              "../../../tools/nodeEditor/dist/sharedComponents/popup.js"
            ), p = o(
              /*! ./serializationTools */
              "../../../tools/nodeEditor/dist/serializationTools.js"
            ), c = o(
              /*! ./components/preview/previewType */
              "../../../tools/nodeEditor/dist/components/preview/previewType.js"
            ), H = o(
              /*! core/Materials/Node/Enums/nodeMaterialModes */
              "core/Misc/dataStorage"
            ), T = o(
              /*! ./graphSystem/registerToDisplayLedger */
              "../../../tools/nodeEditor/dist/graphSystem/registerToDisplayLedger.js"
            ), q = o(
              /*! ./graphSystem/registerToPropertyLedger */
              "../../../tools/nodeEditor/dist/graphSystem/registerToPropertyLedger.js"
            ), b = o(
              /*! ./graphSystem/registerToTypeLedger */
              "../../../tools/nodeEditor/dist/graphSystem/registerToTypeLedger.js"
            );
            class j {
              /**
               * Show the node editor
               * @param options defines the options to use to configure the node editor
               */
              static Show(m) {
                if ((0, T.RegisterToDisplayManagers)(), (0, q.RegisterToPropertyTabManagers)(), (0, b.RegisterTypeLedger)(), this._CurrentState) {
                  const y = P.Popup["node-editor"];
                  y && y.close();
                }
                let I = m.hostElement;
                I || (I = P.Popup.CreatePopup("BABYLON.JS NODE EDITOR", "node-editor", 1e3, 800));
                const N = new u.GlobalState();
                N.nodeMaterial = m.nodeMaterial, N.mode = m.nodeMaterial.mode, N.hostElement = I, N.hostDocument = I.ownerDocument, N.customSave = m.customSave, N.hostWindow = I.ownerDocument.defaultView, N.stateManager.hostDocument = N.hostDocument, m.backgroundColor && (N.backgroundColor = m.backgroundColor);
                const k = d.createElement(l.GraphEditor, {
                  globalState: N
                });
                v.render(k, I), m.customLoadObservable && m.customLoadObservable.add((y) => {
                  p.SerializationTools.Deserialize(y, N), N.mode = m.nodeMaterial.mode, N.onResetRequiredObservable.notifyObservers(!1), N.onBuiltObservable.notifyObservers();
                }), this._CurrentState = N, N.hostWindow.addEventListener("beforeunload", () => {
                  N.onPopupClosedObservable.notifyObservers();
                });
                const R = P.Popup["node-editor"];
                N.nodeMaterial && R && (N.nodeMaterial.getScene().onDisposeObservable.addOnce(() => {
                  R && R.close();
                }), window.onbeforeunload = () => {
                  const y = P.Popup["node-editor"];
                  y && y.close();
                }), window.addEventListener("beforeunload", () => {
                  H.DataStorage.ReadNumber("PreviewType", c.PreviewType.Box) === c.PreviewType.Custom && H.DataStorage.WriteNumber("PreviewType", N.mode === H.NodeMaterialModes.Material ? c.PreviewType.Box : c.PreviewType.Bubbles);
                });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/portal.js": (
          /*!************************************************!*\
            !*** ../../../tools/nodeEditor/dist/portal.js ***!
            \************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Portal: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), v = o(
              /*! react-dom */
              "../../../../node_modules/react-dom/index.js"
            );
            class u extends d.Component {
              render() {
                return v.createPortal(this.props.children, this.props.globalState.hostElement);
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/serializationTools.js": (
          /*!************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/serializationTools.js ***!
            \************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              SerializationTools: () => (
                /* binding */
                v
              )
              /* harmony export */
            });
            var d = o(
              /*! core/Misc/dataStorage */
              "core/Misc/dataStorage"
            );
            class v {
              static UpdateLocations(l, P, p) {
                l.editorData = {
                  locations: []
                };
                const c = p ? p.nodes.map((H) => H.content.data) : l.attachedBlocks;
                for (const H of c) {
                  const T = P.onGetNodeFromBlock(H);
                  l.editorData.locations.push({
                    blockId: H.uniqueId,
                    x: T ? T.x : 0,
                    y: T ? T.y : 0
                  });
                }
                P.storeEditorData(l.editorData, p);
              }
              static Serialize(l, P, p) {
                const c = d.Texture.SerializeBuffers;
                d.Texture.SerializeBuffers = d.DataStorage.ReadBoolean("EmbedTextures", !0), this.UpdateLocations(l, P, p);
                const H = p ? p.nodes.map((q) => q.content.data) : void 0, T = l.serialize(H);
                return d.Texture.SerializeBuffers = c, JSON.stringify(T, void 0, 2);
              }
              static Deserialize(l, P) {
                P.nodeMaterial.loadFromSerialization(l, ""), P.onIsLoadingChanged.notifyObservers(!1);
              }
              static AddFrameToMaterial(l, P, p) {
                this.UpdateLocations(p, P), P.nodeMaterial.loadFromSerialization(l, "", !0), P.onImportFrameObservable.notifyObservers(l), P.onIsLoadingChanged.notifyObservers(!1);
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/sharedComponents/checkBoxLineComponent.js": (
          /*!********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/sharedComponents/checkBoxLineComponent.js ***!
            \********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              CheckBoxLineComponent: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            class u extends v.Component {
              constructor(P) {
                super(P), this._localChange = !1, this._uniqueId = u._UniqueIdSeed++, this.props.isSelected ? this.state = { isSelected: this.props.isSelected() } : this.state = { isSelected: this.props.target[this.props.propertyName] == !0 }, this.props.disabled && (this.state = { ...this.state, isDisabled: this.props.disabled });
              }
              shouldComponentUpdate(P, p) {
                let c;
                return P.isSelected ? c = P.isSelected() : c = P.target[P.propertyName] == !0, c !== p.isSelected || this._localChange ? (p.isSelected = c, this._localChange = !1, !0) : P.disabled !== !!p.isDisabled ? !0 : P.label !== this.props.label || P.target !== this.props.target;
              }
              onChange() {
                this._localChange = !0, this.props.onSelect ? this.props.onSelect(!this.state.isSelected) : (this.props.onPropertyChangedObservable && this.props.onPropertyChangedObservable.notifyObservers({
                  object: this.props.target,
                  property: this.props.propertyName,
                  value: !this.state.isSelected,
                  initialValue: this.state.isSelected
                }), this.props.target[this.props.propertyName] = !this.state.isSelected), this.props.onValueChanged && this.props.onValueChanged(), this.setState({ isSelected: !this.state.isSelected });
              }
              render() {
                return (0, d.jsxs)("div", { className: "checkBoxLine", children: [(0, d.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0, d.jsxs)("div", { className: "checkBox", children: [(0, d.jsx)("input", { type: "checkbox", id: "checkbox" + this._uniqueId, className: "cbx hidden", checked: this.state.isSelected, onChange: () => this.onChange(), disabled: !!this.props.disabled }), (0, d.jsx)("label", { htmlFor: "checkbox" + this._uniqueId, className: `lbl${this.props.disabled ? " disabled" : ""}` })] })] });
              }
            }
            u._UniqueIdSeed = 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/sharedComponents/draggableLineComponent.js": (
          /*!*********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/sharedComponents/draggableLineComponent.js ***!
            \*********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              DraggableLineComponent: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            class u extends v.Component {
              constructor(P) {
                super(P);
              }
              render() {
                return (0, d.jsx)("div", { className: "draggableLine", title: this.props.tooltip, draggable: !0, onDragStart: (P) => {
                  P.dataTransfer.setData("babylonjs-material-node", this.props.data);
                }, children: this.props.data.replace("Block", "") });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/sharedComponents/draggableLineWithButtonComponent.js": (
          /*!*******************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/sharedComponents/draggableLineWithButtonComponent.js ***!
            \*******************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              DraggableLineWithButtonComponent: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            class u extends v.Component {
              constructor(P) {
                super(P);
              }
              render() {
                return (0, d.jsxs)("div", { className: "draggableLine withButton", title: this.props.tooltip, draggable: !0, onDragStart: (P) => {
                  P.dataTransfer.setData("babylonjs-material-node", this.props.data);
                }, children: [this.props.data.substr(0, this.props.data.length - (this.props.lenSuffixToRemove ?? 6)), (0, d.jsx)("div", { className: "icon", onClick: () => {
                  this.props.onIconClick(this.props.data);
                }, title: this.props.iconTitle, children: (0, d.jsx)("img", { className: "img", title: this.props.iconTitle, src: this.props.iconImage }) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/sharedComponents/fileButtonLineComponent.js": (
          /*!**********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/sharedComponents/fileButtonLineComponent.js ***!
            \**********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              FileButtonLineComponent: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            );
            class u extends v.Component {
              constructor(P) {
                super(P), this._uploadRef = v.createRef();
              }
              onChange(P) {
                const p = P.target.files;
                p && p.length && this.props.onClick(p[0]), P.target.value = "";
              }
              render() {
                return (0, d.jsxs)("div", { className: "buttonLine", children: [(0, d.jsx)("label", { htmlFor: this.props.uploadName ? this.props.uploadName : "file-upload", className: "file-upload", children: this.props.label }), (0, d.jsx)("input", { ref: this._uploadRef, id: this.props.uploadName ? this.props.uploadName : "file-upload", type: "file", accept: this.props.accept, onChange: (P) => this.onChange(P) })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js": (
          /*!*********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/sharedComponents/lineContainerComponent.js ***!
            \*********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              LineContainerComponent: () => (
                /* binding */
                P
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Misc/dataStorage */
              "core/Misc/dataStorage"
            ), l = o(
              /*! ../imgs/downArrow.svg */
              "../../../tools/nodeEditor/dist/imgs/downArrow.svg"
            );
            class P extends v.Component {
              constructor(c) {
                super(c);
                const H = u.DataStorage.ReadBoolean(this.props.title, !this.props.closed);
                this.state = { isExpanded: H };
              }
              switchExpandedState() {
                const c = !this.state.isExpanded;
                u.DataStorage.WriteBoolean(this.props.title, c), this.setState({ isExpanded: c });
              }
              renderHeader() {
                const c = this.state.isExpanded ? "collapse" : "collapse closed";
                return (0, d.jsxs)("div", { className: "header", onClick: () => this.switchExpandedState(), children: [(0, d.jsx)("div", { className: "title", children: this.props.title }), (0, d.jsx)("div", { className: c, children: (0, d.jsx)("img", { className: "img", title: this.props.title, src: l }) })] });
              }
              render() {
                return this.state.isExpanded ? (0, d.jsx)("div", { className: "paneContainer", children: (0, d.jsxs)("div", { className: "paneContainer-content", children: [this.renderHeader(), (0, d.jsx)("div", { className: "paneList", children: this.props.children })] }) }) : (0, d.jsx)("div", { className: "paneContainer", children: (0, d.jsx)("div", { className: "paneContainer-content", children: this.renderHeader() }) });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/sharedComponents/lineWithFileButtonComponent.js": (
          /*!**************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/sharedComponents/lineWithFileButtonComponent.js ***!
            \**************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              LineWithFileButtonComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/Misc/dataStorage */
              "core/Misc/dataStorage"
            );
            class l extends v.Component {
              constructor(p) {
                super(p);
                const c = u.DataStorage.ReadBoolean(this.props.title, !this.props.closed);
                this.state = { isExpanded: c }, this._uploadRef = v.createRef();
              }
              onChange(p) {
                const c = p.target.files;
                if (c && c.length)
                  for (const H of c)
                    this.props.onIconClick(H);
                p.target.value = "";
              }
              switchExpandedState() {
                const p = !this.state.isExpanded;
                u.DataStorage.WriteBoolean(this.props.title, p), this.setState({ isExpanded: p });
              }
              render() {
                return (0, d.jsxs)("div", { className: "nonDraggableLine withButton", children: [this.props.label, (0, d.jsx)("div", { className: "icon", title: this.props.title, children: (0, d.jsx)("img", { className: "img", src: this.props.iconImage }) }), (0, d.jsxs)("div", { className: "buttonLine", title: this.props.title, children: [(0, d.jsx)("label", { htmlFor: this.props.uploadName ? this.props.uploadName : "file-upload", className: "file-upload" }), (0, d.jsx)("input", { ref: this._uploadRef, id: this.props.uploadName ? this.props.uploadName : "file-upload", type: "file", multiple: this.props.multiple, accept: this.props.accept, onChange: (p) => this.onChange(p) })] })] });
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/sharedComponents/popup.js": (
          /*!****************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/sharedComponents/popup.js ***!
            \****************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              Popup: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            class d {
              static CreatePopup(u, l, P = 300, p = 800) {
                const c = {
                  width: P,
                  height: p,
                  top: (window.innerHeight - P) / 2 + window.screenY,
                  left: (window.innerWidth - p) / 2 + window.screenX
                }, H = Object.keys(c).map((w) => w + "=" + c[w]).join(","), T = window.open("", u, H);
                if (!T)
                  return null;
                const q = T.document, b = q.createElement("link");
                b.rel = "stylesheet", b.href = "https://use.typekit.net/cta4xsb.css", q.head.appendChild(b), q.title = u, q.body.style.width = "100%", q.body.style.height = "100%", q.body.style.margin = "0", q.body.style.padding = "0";
                const j = q.createElement("div");
                return j.style.width = "100%", j.style.height = "100%", j.style.margin = "0", j.style.padding = "0", T.document.body.appendChild(j), this._CopyStyles(window.document, q), setTimeout(() => {
                  this._CopyStyles(window.document, q);
                }, 0), this[l] = T, j;
              }
              static _CopyStyles(u, l) {
                for (let P = 0; P < u.styleSheets.length; P++) {
                  const p = u.styleSheets[P];
                  try {
                    if (p.cssRules) {
                      const c = u.createElement("style");
                      for (const H of p.cssRules)
                        c.appendChild(u.createTextNode(H.cssText));
                      l.head.appendChild(c);
                    } else if (p.href) {
                      const c = u.createElement("link");
                      c.rel = "stylesheet", c.href = p.href, l.head.appendChild(c);
                    }
                  } catch {
                  }
                }
              }
            }
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/sharedComponents/textureLineComponent.js": (
          /*!*******************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/sharedComponents/textureLineComponent.js ***!
            \*******************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              TextureLineComponent: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var d = o(
              /*! react/jsx-runtime */
              "../../../../node_modules/react/jsx-runtime.js"
            ), v = o(
              /*! react */
              "../../../../node_modules/react/index.js"
            ), u = o(
              /*! core/PostProcesses/passPostProcess */
              "core/Misc/dataStorage"
            );
            class l extends v.Component {
              constructor(p) {
                super(p), this.state = {
                  displayRed: !0,
                  displayGreen: !0,
                  displayBlue: !0,
                  displayAlpha: !0,
                  face: 0
                }, this._canvasRef = v.createRef();
              }
              shouldComponentUpdate() {
                return !0;
              }
              componentDidMount() {
                this.updatePreview();
              }
              componentDidUpdate() {
                this.updatePreview();
              }
              updatePreview() {
                l.UpdatePreview(this._canvasRef.current, this.props.texture, this.props.width, this.state, void 0, this.props.globalState);
              }
              static async UpdatePreview(p, c, H, T, q, b) {
                !c.isReady() && c._texture && c._texture.onLoadedObservable.addOnce(() => {
                  l.UpdatePreview(p, c, H, T, q, b);
                });
                const j = c.getScene(), w = j.getEngine(), m = c.getSize(), I = m.width / m.height, N = H / I | 1;
                let k;
                if (!c.isCube)
                  k = new u.PassPostProcess("pass", 1, null, u.Texture.NEAREST_SAMPLINGMODE, w, !1, u.Constants.TEXTURETYPE_UNSIGNED_INT);
                else {
                  const O = new u.PassCubePostProcess("pass", 1, null, u.Texture.NEAREST_SAMPLINGMODE, w, !1, u.Constants.TEXTURETYPE_UNSIGNED_INT);
                  O.face = T.face, k = O;
                }
                if (!k.getEffect().isReady()) {
                  k.dispose(), setTimeout(() => l.UpdatePreview(p, c, H, T, q, b), 250);
                  return;
                }
                b && (b.blockMutationUpdates = !0);
                const R = new u.RenderTargetTexture("temp", { width: H, height: N }, j, !1);
                k.externalTextureSamplerBinding = !0, k.onApply = function(O) {
                  O.setTexture("textureSampler", c);
                };
                const y = R.renderTarget;
                if (y) {
                  j.postProcessManager.directRender([k], y, !0);
                  const O = H * 4, Y = N / 2, ee = await w.readPixels(0, 0, H, N), Z = new Uint8Array(ee.buffer, 0, ee.byteLength);
                  if (!c.isCube && (!T.displayRed || !T.displayGreen || !T.displayBlue)) {
                    for (let fe = 0; fe < H * N * 4; fe += 4)
                      if (T.displayRed || (Z[fe] = 0), T.displayGreen || (Z[fe + 1] = 0), T.displayBlue || (Z[fe + 2] = 0), T.displayAlpha) {
                        const _ = Z[fe + 2];
                        Z[fe] = _, Z[fe + 1] = _, Z[fe + 2] = _, Z[fe + 2] = 0;
                      }
                  }
                  if (c.invertY || c.isCube)
                    for (let fe = 0; fe < Y; fe++)
                      for (let _ = 0; _ < O; _++) {
                        const G = _ + fe * O, L = N - fe - 1, $ = _ + L * O, ae = Z[G];
                        Z[G] = Z[$], Z[$] = ae;
                      }
                  p.width = H, p.height = N;
                  const te = p.getContext("2d");
                  if (te) {
                    const fe = te.createImageData(H, N);
                    fe.data.set(Z), te.putImageData(fe, 0, 0), q && q();
                  }
                  w.unBindFramebuffer(y);
                }
                R.dispose(), k.dispose(), p.style.height = N + "px", b && (b.blockMutationUpdates = !1);
              }
              render() {
                const p = this.props.texture;
                return (0, d.jsxs)("div", { className: "textureLine", children: [!this.props.hideChannelSelect && p.isCube && (0, d.jsxs)("div", { className: "control3D", children: [(0, d.jsx)("button", { className: this.state.face === 0 ? "px command selected" : "px command", onClick: () => this.setState({ face: 0 }), children: "PX" }), (0, d.jsx)("button", { className: this.state.face === 1 ? "nx command selected" : "nx command", onClick: () => this.setState({ face: 1 }), children: "NX" }), (0, d.jsx)("button", { className: this.state.face === 2 ? "py command selected" : "py command", onClick: () => this.setState({ face: 2 }), children: "PY" }), (0, d.jsx)("button", { className: this.state.face === 3 ? "ny command selected" : "ny command", onClick: () => this.setState({ face: 3 }), children: "NY" }), (0, d.jsx)("button", { className: this.state.face === 4 ? "pz command selected" : "pz command", onClick: () => this.setState({ face: 4 }), children: "PZ" }), (0, d.jsx)("button", { className: this.state.face === 5 ? "nz command selected" : "nz command", onClick: () => this.setState({ face: 5 }), children: "NZ" })] }), !this.props.hideChannelSelect && !p.isCube && (0, d.jsxs)("div", { className: "control", children: [(0, d.jsx)("button", { className: this.state.displayRed && !this.state.displayGreen ? "red command selected" : "red command", onClick: () => this.setState({ displayRed: !0, displayGreen: !1, displayBlue: !1, displayAlpha: !1 }), children: "R" }), (0, d.jsx)("button", { className: this.state.displayGreen && !this.state.displayBlue ? "green command selected" : "green command", onClick: () => this.setState({ displayRed: !1, displayGreen: !0, displayBlue: !1, displayAlpha: !1 }), children: "G" }), (0, d.jsx)("button", { className: this.state.displayBlue && !this.state.displayAlpha ? "blue command selected" : "blue command", onClick: () => this.setState({ displayRed: !1, displayGreen: !1, displayBlue: !0, displayAlpha: !1 }), children: "B" }), (0, d.jsx)("button", { className: this.state.displayAlpha && !this.state.displayRed ? "alpha command selected" : "alpha command", onClick: () => this.setState({ displayRed: !1, displayGreen: !1, displayBlue: !1, displayAlpha: !0 }), children: "A" }), (0, d.jsx)("button", { className: this.state.displayRed && this.state.displayGreen ? "all command selected" : "all command", onClick: () => this.setState({ displayRed: !0, displayGreen: !0, displayBlue: !0, displayAlpha: !0 }), children: "ALL" })] }), (0, d.jsx)("canvas", { ref: this._canvasRef, className: "preview" })] });
              }
            }
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss": (
          /*!*************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss ***!
            \*************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./colorPicker.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/searchBox.scss": (
          /*!***************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/searchBox.scss ***!
            \***************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./searchBox.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/searchBox.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/log/log.scss": (
          /*!**************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/log/log.scss ***!
            \**************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./log.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/components/log/log.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/nodeList/nodeList.scss": (
          /*!************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/nodeList/nodeList.scss ***!
            \************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./nodeList.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/components/nodeList/nodeList.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/propertyTab/propertyTab.scss": (
          /*!******************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/propertyTab/propertyTab.scss ***!
            \******************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./propertyTab.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/components/propertyTab/propertyTab.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/main.scss": (
          /*!************************************************!*\
            !*** ../../../tools/nodeEditor/dist/main.scss ***!
            \************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./main.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/nodeEditor/dist/main.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/components/MessageDialog.modules.scss": (
          /*!**********************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/components/MessageDialog.modules.scss ***!
            \**********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./MessageDialog.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/MessageDialog.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss": (
          /*!********************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss ***!
            \********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./common.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphCanvas.modules.scss": (
          /*!*************************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphCanvas.modules.scss ***!
            \*************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./graphCanvas.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphCanvas.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.modules.scss": (
          /*!************************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.modules.scss ***!
            \************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./graphFrame.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphFrame.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.modules.scss": (
          /*!***********************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.modules.scss ***!
            \***********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./graphNode.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/graphNode.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLink.modules.scss": (
          /*!**********************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLink.modules.scss ***!
            \**********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./nodeLink.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodeLink.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.modules.scss": (
          /*!**********************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.modules.scss ***!
            \**********************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./nodePort.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/blockNodeData.modules.scss": (
          /*!*****************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/blockNodeData.modules.scss ***!
            \*****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./blockNodeData.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/blockNodeData.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/clampDisplayManager.modules.scss": (
          /*!*******************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/clampDisplayManager.modules.scss ***!
            \*******************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./clampDisplayManager.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/clampDisplayManager.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/common.modules.scss": (
          /*!******************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/common.modules.scss ***!
            \******************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./common.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/common.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/curveDisplayManager.modules.scss": (
          /*!*******************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/curveDisplayManager.modules.scss ***!
            \*******************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./curveDisplayManager.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/curveDisplayManager.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.modules.scss": (
          /*!*******************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.modules.scss ***!
            \*******************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./elbowDisplayManager.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/gradientDisplayManager.modules.scss": (
          /*!**********************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/gradientDisplayManager.modules.scss ***!
            \**********************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./gradientDisplayManager.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/gradientDisplayManager.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.modules.scss": (
          /*!*************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.modules.scss ***!
            \*************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./imageSourceDisplayManager.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/inputDisplayManager.modules.scss": (
          /*!*******************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/inputDisplayManager.modules.scss ***!
            \*******************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./inputDisplayManager.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/inputDisplayManager.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/remapDisplayManager.modules.scss": (
          /*!*******************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/remapDisplayManager.modules.scss ***!
            \*******************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./remapDisplayManager.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/remapDisplayManager.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/textureDisplayManager.modules.scss": (
          /*!*********************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/textureDisplayManager.modules.scss ***!
            \*********************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./textureDisplayManager.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/textureDisplayManager.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/graphSystem/display/trigonometryDisplayManager.modules.scss": (
          /*!**************************************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/graphSystem/display/trigonometryDisplayManager.modules.scss ***!
            \**************************************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              default: () => I
              /* harmony export */
            });
            var d = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
              "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
            ), v = /* @__PURE__ */ o.n(d), u = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */
              "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js"
            ), l = /* @__PURE__ */ o.n(u), P = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */
              "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js"
            ), p = /* @__PURE__ */ o.n(P), c = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */
              "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
            ), H = /* @__PURE__ */ o.n(c), T = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */
              "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js"
            ), q = /* @__PURE__ */ o.n(T), b = o(
              /*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */
              "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js"
            ), j = /* @__PURE__ */ o.n(b), w = o(
              /*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./trigonometryDisplayManager.modules.scss */
              "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../tools/nodeEditor/dist/graphSystem/display/trigonometryDisplayManager.modules.scss"
            ), m = {};
            m.styleTagTransform = j(), m.setAttributes = H(), m.insert = p().bind(null, "head"), m.domAPI = l(), m.insertStyleElement = q(), v()(w.default, m);
            const I = w.default && w.default.locals ? w.default.locals : void 0;
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/copy.svg": (
          /*!***********************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/copy.svg ***!
            \***********************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5jb3B5PC90aXRsZT48ZyBpZD0iVUlfRWxlbWVudHMiIGRhdGEtbmFtZT0iVUkgRWxlbWVudHMiPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTI0LDE0Ljg5SDIyLjc2bC0zLTNIMTIuNDNWMjYuNTloNC4yNnYzaDExLjVWMTlabS4zLDEuNzEsMi4xNCwyLjEzSDI0LjM0Wm0tMTAuOTEsOVYxMi45M2g1LjkzbDIsMkgxNi42OXYxMC43Wm00LjI2LDNWMTUuODloNS42NXYzLjg0aDMuODV2OC44M1oiLz48L2c+PC9zdmc+";
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/valueDownArrowIcon.svg": (
          /*!*************************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/valueDownArrowIcon.svg ***!
            \*************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDE1IDE1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNC4wOSw1LjU1YS42MS42MSwwLDAsMSwuODUsMGwyLDJWMS43OWEuNi42LDAsMSwxLDEuMiwwVjcuNTJsMi0yYS42MS42MSwwLDAsMSwuODUsMCwuNi42LDAsMCwxLDAsLjg0bC0zLDNhLjYuNiwwLDAsMS0uODQsMGwtMy0zQS42LjYsMCwwLDEsNC4wOSw1LjU1WiIvPjwvc3ZnPg==";
          }
        ),
        /***/
        "../../../dev/sharedUiComponents/dist/lines/valueUpArrowIcon.svg": (
          /*!***********************************************************************!*\
            !*** ../../../dev/sharedUiComponents/dist/lines/valueUpArrowIcon.svg ***!
            \***********************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDE1IDE1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNC4wOSw5LjQ1YS42LjYsMCwwLDEsMC0uODRsMy0zYS42LjYsMCwwLDEsLjg0LDBsMywzYS42LjYsMCwwLDEsMCwuODQuNjEuNjEsMCwwLDEtLjg1LDBsLTItMnY1LjczYS42LjYsMCwwLDEtMS4yLDBWNy40OGwtMiwyQS42MS42MSwwLDAsMSw0LjA5LDkuNDVaIi8+PC9zdmc+";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/colorPicker.svg": (
          /*!******************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/colorPicker.svg ***!
            \******************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,[encoded data, 4464 characters]";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/depthPass.svg": (
          /*!****************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/depthPass.svg ***!
            \****************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMjEuMTIsMTgsMTYuMjgsOC4zNWExLjM0LDEuMzQsMCwwLDAtMS4yMS0uNzYsMS4zNiwxLjM2LDAsMCwwLTEsLjQyaDBsLS44Ny0xLjc0QTEuMzUsMS4zNSwwLDAsMCwxMiw1LjUyYTEuMzIsMS4zMiwwLDAsMC0xLC40MmgwbC0uODctMS43NWExLjM2LDEuMzYsMCwwLDAtMS4yMi0uNzUsMS4zNCwxLjM0LDAsMCwwLTEuMjEuNzVMMi44OCwxMy44NmExLjM2LDEuMzYsMCwwLDAsMS4yMiwySDZsMCwuMTFhMS4zNiwxLjM2LDAsMCwwLDEuMjEsMkg5LjA3TDksMThhMS4zNSwxLjM1LDAsMCwwLDEuMjEsMkgxOS45YTEuMzUsMS4zNSwwLDAsMCwxLjIyLTJaTTYuNzUsMTQuMzNINC4zMkw4LjkzLDUuMTFsMS4yMiwyLjQzWm0zLjA3LDIuMDhINy4zOUwxMiw3LjE5bDEuMjIsMi40M1ptLjY0LDIuMDcsNC42MS05LjIxLDQuNjEsOS4yMVoiIHN0eWxlPSJmaWxsOndoaXRlIi8+PC9zdmc+";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/directionalLeft.svg": (
          /*!**********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/directionalLeft.svg ***!
            \**********************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuODEsMTMuNTVhMy4xNiwzLjE2LDAsMCwwLTEsMS42OEwxNC40NSwxN0g5LjU1bC0uMzgtMS43N2EzLjE4LDMuMTgsMCwwLDAtMS0xLjY5QTUuNyw1LjcsMCwwLDEsNi4yNiw5LjU5LDUuOCw1LjgsMCwwLDEsNy44NCw1LjMxLDUuNjcsNS42NywwLDAsMSwxMiwzLjUxLDUuMzUsNS4zNSwwLDAsMSwxNS44NSw1YS43NS43NSwwLDAsMCwxLTEuMUE2LjksNi45LDAsMCwwLDEyLDIsNy4xMyw3LjEzLDAsMCwwLDYuNzUsNC4yOGE3LjI2LDcuMjYsMCwwLDAtMiw1LjQsNy4xOCw3LjE4LDAsMCwwLDIuNDIsNSwxLjYsMS42LDAsMCwxLC41MS44OGwxLDQuNjhBMi4yNiwyLjI2LDAsMCwwLDEwLjkyLDIyaDIuMTZhMi4yNiwyLjI2LDAsMCwwLDIuMTktMS43NmwxLTQuNjhhMS42LDEuNiwwLDAsMSwuNTEtLjg4Ljc2Ljc2LDAsMCwwLC4wNi0xLjA2QS43NS43NSwwLDAsMCwxNS44MSwxMy41NVptLTIuNzMsNi45NEgxMC45MmEuNzYuNzYsMCwwLDEtLjczLS41OWwtLjMxLTEuNGg0LjIzbC0uMywxLjRBLjc2Ljc2LDAsMCwxLDEzLjA4LDIwLjQ5WiIgc3R5bGU9ImZpbGw6d2hpdGUiLz48cGF0aCBkPSJNMjEuNzcsOC44NiwxOS4xMyw2LjIzYS43NS43NSwwLDAsMC0xLjA2LDAsLjc0Ljc0LDAsMCwwLDAsMS4wNmwxLjM1LDEuMzVIMTIuMzFhLjc1Ljc1LDAsMCwwLDAsMS41aDcuMTFsLTEuMzUsMS4zNWEuNzQuNzQsMCwwLDAsMCwxLjA2Ljc1Ljc1LDAsMCwwLC41My4yMi43NC43NCwwLDAsMCwuNTMtLjIybDIuNjQtMi42M2EuNzUuNzUsMCwwLDAsMC0xLjA2WiIgc3R5bGU9ImZpbGw6d2hpdGUiLz48L3N2Zz4=";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/directionalRight.svg": (
          /*!***********************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/directionalRight.svg ***!
            \***********************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNy4xMywxMy42MWEuNzYuNzYsMCwwLDAsLjA2LDEuMDYsMS42LDEuNiwwLDAsMSwuNTEuODhsMSw0LjY4QTIuMjYsMi4yNiwwLDAsMCwxMC45MiwyMmgyLjE2YTIuMjYsMi4yNiwwLDAsMCwyLjE5LTEuNzZsMS00LjY4YTEuNiwxLjYsMCwwLDEsLjUxLS44OCw3LjE4LDcuMTgsMCwwLDAsMi40Mi01LDcuMjYsNy4yNiwwLDAsMC0yLTUuNEE3LjEzLDcuMTMsMCwwLDAsMTIsMiw2LjksNi45LDAsMCwwLDcuMTMsMy45NGEuNzUuNzUsMCwxLDAsMSwxLjFBNS4zNSw1LjM1LDAsMCwxLDEyLDMuNTFhNS42Nyw1LjY3LDAsMCwxLDQuMTYsMS44LDUuOCw1LjgsMCwwLDEsMS41OCw0LjI4LDUuNyw1LjcsMCwwLDEtMS45MywzLjk1LDMuMTgsMy4xOCwwLDAsMC0xLDEuNjlMMTQuNDUsMTdIOS41NWwtLjM4LTEuNzdhMy4xNiwzLjE2LDAsMCwwLTEtMS42OEEuNzUuNzUsMCwwLDAsNy4xMywxMy42MVptMy4wNiw2LjI5LS4zLTEuNGg0LjIzbC0uMzEsMS40YS43Ni43NiwwLDAsMS0uNzMuNTlIMTAuOTJBLjc2Ljc2LDAsMCwxLDEwLjE5LDE5LjlaIiBzdHlsZT0iZmlsbDp3aGl0ZSIvPjxwYXRoIGQ9Ik0yLjIzLDguODYsNC44Nyw2LjIzYS43NS43NSwwLDAsMSwxLjA2LDAsLjc0Ljc0LDAsMCwxLDAsMS4wNkw0LjU4LDguNjRoNy4xMWEuNzUuNzUsMCwwLDEsMCwxLjVINC41OGwxLjM1LDEuMzVhLjc0Ljc0LDAsMCwxLDAsMS4wNi43NS43NSwwLDAsMS0uNTMuMjIuNzQuNzQsMCwwLDEtLjUzLS4yMkwyLjIzLDkuOTJhLjc1Ljc1LDAsMCwxLDAtMS4wNloiIHN0eWxlPSJmaWxsOndoaXRlIi8+PC9zdmc+";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/doubleSided.svg": (
          /*!******************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/doubleSided.svg ***!
            \******************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOC42MiwxMS4ySDMuOTJsMy0zYS43NS43NSwwLDAsMCwwLTEuMDYuNzQuNzQsMCwwLDAtMS4wNiwwTDIuMjQsMTAuNzZhMS42NywxLjY3LDAsMCwwLDAsMi4zN2wzLjU4LDMuNThhLjc1Ljc1LDAsMCwwLDEuMDYsMCwuNzUuNzUsMCwwLDAsMC0xLjA2bC0zLTNoNC43YS43NS43NSwwLDEsMCwwLTEuNVoiIHN0eWxlPSJmaWxsOndoaXRlIi8+PHBhdGggZD0iTTIxLjc2LDEwLjc2LDE4LjE4LDcuMThhLjc0Ljc0LDAsMCwwLTEuMDYsMCwuNzUuNzUsMCwwLDAsMCwxLjA2bDMsM2gtNC43YS43NS43NSwwLDEsMCwwLDEuNWg0LjdsLTMsM2EuNzUuNzUsMCwwLDAsMCwxLjA2Ljc0Ljc0LDAsMCwwLC41My4yMi43My43MywwLDAsMCwuNTMtLjIybDMuNTgtMy41OEExLjY3LDEuNjcsMCwwLDAsMjEuNzYsMTAuNzZaIiBzdHlsZT0iZmlsbDp3aGl0ZSIvPjxwYXRoIGQ9Ik0xMiwzLjY0YS43Ni43NiwwLDAsMC0uNzUuNzVWMTkuNjFhLjc1Ljc1LDAsMCwwLDEuNSwwVjQuMzlBLjc1Ljc1LDAsMCwwLDEyLDMuNjRaIiBzdHlsZT0iZmlsbDp3aGl0ZSIvPjwvc3ZnPg==";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/envPicker.svg": (
          /*!****************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/envPicker.svg ***!
            \****************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyBjbGFzcz0iaWNvbiIgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjQuMDBweCIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGw9IiNmZmZmZmYiIGQ9Ik0zMjAgNjI3LjJsMjkuODY2NjY3LTI5Ljg2NjY2NyAyOS44NjY2NjYgMjkuODY2NjY3IDY0IDY0IDE0OS4zMzMzMzQtMTQ5LjMzMzMzMyAyOS44NjY2NjYtMjkuODY2NjY3IDI5Ljg2NjY2NyAyOS44NjY2NjcgMTk2LjI2NjY2NyAxOTYuMjY2NjY2VjI5OC42NjY2NjdIMjEzLjMzMzMzM3Y0MzUuMmwxMDYuNjY2NjY3LTEwNi42NjY2Njd6IG0yOS44NjY2NjcgMjkuODY2NjY3TDIzOC45MzMzMzMgNzY4aDEzNi41MzMzMzRsLTQuMjY2NjY3LTQuMjY2NjY3IDQyLjY2NjY2Ny00Mi42NjY2NjYtNjQtNjR6TTgyMy40NjY2NjcgNzY4bC0xOTYuMjY2NjY3LTE5Ni4yNjY2NjctMTk2LjI2NjY2NyAxOTYuMjY2NjY3aDM5Mi41MzMzMzR6TTg5NiAyNTZ2NTU0LjY2NjY2N0gxNzAuNjY2NjY3VjI1Nmg3MjUuMzMzMzMzeiIgIC8+PC9zdmc+";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/icon-ibl.svg": (
          /*!***************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/icon-ibl.svg ***!
            \***************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48ZGVmcz48c3R5bGU+LmNscy0xe3N0cm9rZS13aWR0aDowcHg7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0ibTEyLDEuOTdDNi40NiwxLjk3LDEuOTcsNi40NiwxLjk3LDEyczQuNDksMTAuMDMsMTAuMDMsMTAuMDMsMTAuMDMtNC40OSwxMC4wMy0xMC4wM1MxNy41NCwxLjk3LDEyLDEuOTdabTAsMTguNTVjLTQuNzEsMC04LjUyLTMuODItOC41Mi04LjUyUzcuMjksMy40OCwxMiwzLjQ4czguNTIsMy44Miw4LjUyLDguNTItMy44Miw4LjUyLTguNTIsOC41MlptNS4wMS0xMC4zM2MwLTIuNzctMi4yNS01LjAxLTUuMDEtNS4wMXMtNS4wMSwyLjI0LTUuMDEsNS4wMXYuMjdzLjAzLjI2LjAzLjI2Yy4xNCwxLjI3Ljc0LDIuNDIsMS42OCwzLjI0bC4xNS4xMy43NywzLjM4LjA0LjE1Yy4yNi43My45MSwxLjIsMS42NSwxLjJoMS41NHMuMTUtLjAzLjE1LS4wM2MuNy0uMTQsMS4yMy0uNjQsMS4zOC0xLjMxbC43Ny0zLjM4LS4wMy4wM2MxLjItLjk2LDEuOS0yLjM5LDEuOS0zLjkzWm0tNC4xLDYuOTRjLS4wMi4wOS0uMS4xNi0uMi4xOGgtLjA3cy0xLjM0LDAtMS4zNCwwYy0uMSwwLS4xOS0uMDYtLjIyLS4xNWwtLjAyLS4wNy0uMjUtMS4wOGgyLjM1bC0uMjYsMS4xMlptMS4yOC00LjJsLS4xNy4xMy0uMDguMDdjLS4xLjEtLjE3LjIzLS4yLjM2bC0uMjMsMS4wMWgtLjA0cy0yLjk1LDAtMi45NSwwaC0uMDRzLS4yMy0xLjAxLS4yMy0xLjAxYy0uMDQtLjE4LS4xNS0uMzQtLjMtLjQ0LS44Ni0uNjEtMS40LTEuNTgtMS40Ni0yLjY1di0uMjNjMC0xLjkyLDEuNTctMy40OSwzLjUtMy40OXMzLjUxLDEuNTcsMy41MSwzLjUxYzAsMS4wOC0uNDksMi4wOC0xLjMyLDIuNzRaIiBzdHlsZT0iZmlsbDp3aGl0ZSIvPjwvc3ZnPg==";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/omni.svg": (
          /*!***********************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/omni.svg ***!
            \***********************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4NCiAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1OS4xICg4NjE0NCkgLSBodHRwczovL3NrZXRjaC5jb20gLS0+DQogIDx0aXRsZT5pY19mbHVlbnRfbGlnaHRidWxiXzI0X3JlZ3VsYXI8L3RpdGxlPg0KICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4NCiAgPGcgaWQ9IvCflI0tUHJvZHVjdC1JY29ucyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgPGcgaWQ9ImljX2ZsdWVudF9saWdodGJ1bGJfMjRfcmVndWxhciIgZmlsbD0id2hpdGUiIGZpbGwtcnVsZT0ibm9uemVybyI+DQogICAgICA8cGF0aCBkPSJNMTIuMDAwMDA4LDIuMDAxMzk3MzQgQzE2LjAwNDA2MjgsMi4wMDEzOTczNCAxOS4yNDk5OTIsNS4yNDczMzIwOCAxOS4yNDk5OTIsOS4yNTEzOTczNCBDMTkuMjQ5OTkyLDExLjM0NzQ1NjcgMTguMzQ5MzMzMywxMy4yNzExMDU0IDE2LjU4Njk1MzUsMTQuOTkzMzAxMSBDMTYuNTEwMDA1NCwxNS4wNjg1MDA0IDE2LjQ1MDQ0MSwxNS4xNTkwNjE3IDE2LjQxMTg0NTcsMTUuMjU4NjAzMSBMMTYuMzgwMzczLDE1LjM2MDkwMTYgTDE1LjI0OTI5NTcsMjAuMjU2NDk3IEMxNS4wMjY1OTEzLDIxLjIyMDQxOTUgMTQuMjAzNDcwNywyMS45MTg3NjExIDEzLjIzMDI1NTgsMjEuOTkzMzc5NiBMMTMuMDU3MDQ1NiwyMiBMMTAuOTQzMjY4OSwyMiBDOS45NTM3NDk5NywyMiA5LjA4NzkxNDg2LDIxLjM1NDk0OTIgOC43OTYyOTgwOCwyMC40MjMyNTM0IEw4Ljc1MDg4ODc0LDIwLjI1NTkzMzkgTDcuNjIxMzIzOTksMTUuMzYxMTUzMyBDNy41ODkwNDMwNiwxNS4yMjEyNTk1IDcuNTE3MjgzMjEsMTUuMDkzNTY5NSA3LjQxNDU2ODI0LDE0Ljk5MzI1MTcgQzUuNzM1MTYyMDcsMTMuMzUzMDM5OSA0LjgzNzc5MDExLDExLjUzMDE1MTkgNC43NTYxMzQyOSw5LjU0OTY1MTM4IEw0Ljc1MDAwOCw5LjI1MTM5NzM0IEw0Ljc1Mzg4MzIyLDkuMDEyMDgyOTIgQzQuODgwMTQ4NTMsNS4xMTg3OTA0MSA4LjA3NjAyMTM0LDIuMDAxMzk3MzQgMTIuMDAwMDA4LDIuMDAxMzk3MzQgWiBNMTQuMTE1MDA4LDE4LjQ5OTM5NzMgTDkuODg0MDA4LDE4LjQ5OTM5NzMgTDEwLjIxMjQ3NTUsMTkuOTE4NjQ0NiBDMTAuMjgzMTUyOSwyMC4yMjQ5MTMxIDEwLjUzNTY2NzYsMjAuNDUwNzk2MiAxMC44NDAwNjEyLDIwLjQ5MjkxMDEgTDEwLjk0MzI2ODksMjAuNSBMMTMuMDU3MDQ1NiwyMC41IEMxMy4zNzEyOTg1LDIwLjUgMTMuNjQ4MTM2NCwyMC4zMDQ4MjI2IDEzLjc1NzY2MiwyMC4wMTc3NzU2IEwxMy43ODc3OTU2LDE5LjkxODgzMjMgTDE0LjExNTAwOCwxOC40OTkzOTczIFogTTEyLjAwMDAwOCwzLjUwMTM5NzM0IEM4Ljg5ODIxOTIyLDMuNTAxMzk3MzQgNi4zNzAwNzA4Myw1Ljk1NzQxMTExIDYuMjU0MTYwMDgsOS4wMzA4NDEzOSBMNi4yNTAwMDgsOS4yNTEzOTczNCBMNi4yNTY3MjM0Myw5LjUyODQwNjc5IEM2LjMzMjg2OTUzLDExLjA5MTc2OTUgNy4wNTcyMjM1MiwxMi41NDc1MzQyIDguNDYyNjMyMjcsMTMuOTIwMTQzMiBDOC43MjY3NjAxMywxNC4xNzgxMDY4IDguOTIyNjYyNTcsMTQuNDk2NDA3NSA5LjAzNDIzMTM1LDE0Ljg0NjM4MTUgTDkuMDgyOTEzMzYsMTUuMDIzODc1MiBMOS41MzgwMDgsMTYuOTk5Mzk3MyBMMTQuNDYxMDA4LDE2Ljk5OTM5NzMgTDE0LjkxODg3MjksMTUuMDIzMjM3IEMxNS4wMDE5MDExLDE0LjY2Mzg2OTQgMTUuMTcxNzY2NCwxNC4zMzEzNjc3IDE1LjQxMjQyMTUsMTQuMDU0Mjg5MyBMMTUuNTM4NTczOSwxMy45MjA1MDA5IEMxNi45NDMxOTk4LDEyLjU0NzkwMiAxNy42NjcxNzM4LDExLjA5MjAzMzggMTcuNzQzMjgwMSw5LjUyODQ0NzUgTDE3Ljc0OTk5Miw5LjI1MTM5NzM0IEwxNy43NDU4Mzk5LDkuMDMwODQxNTQgQzE3LjYyOTkyOTMsNS45NTc0MTMyIDE1LjEwMTc4MzMsMy41MDEzOTczNCAxMi4wMDAwMDgsMy41MDEzOTczNCBaIiBpZD0i8J+OqC1Db2xvciI+PC9wYXRoPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/pauseIcon.svg": (
          /*!****************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/pauseIcon.svg ***!
            \****************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4NCiAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1OS4xICg4NjE0NCkgLSBodHRwczovL3NrZXRjaC5jb20gLS0+DQogIDx0aXRsZT5pY19mbHVlbnRfcGF1c2VfMjRfcmVndWxhcjwvdGl0bGU+DQogIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPg0KICA8ZyBpZD0i8J+UjS1Qcm9kdWN0LUljb25zIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4NCiAgICA8ZyBpZD0iaWNfZmx1ZW50X3BhdXNlXzI0X3JlZ3VsYXIiIGZpbGw9IndoaXRlIiBmaWxsLXJ1bGU9Im5vbnplcm8iPg0KICAgICAgPHBhdGggZD0iTTguMjUsMiBDOS4yMTY0OTgzMSwyIDEwLDIuNzgzNTAxNjkgMTAsMy43NSBMMTAsMjAuMjUgQzEwLDIxLjIxNjQ5ODMgOS4yMTY0OTgzMSwyMiA4LjI1LDIyIEw0Ljc1LDIyIEMzLjc4MzUwMTY5LDIyIDMsMjEuMjE2NDk4MyAzLDIwLjI1IEwzLDMuNzUgQzMsMi43ODM1MDE2OSAzLjc4MzUwMTY5LDIgNC43NSwyIEw4LjI1LDIgWiBNMTkuMjUsMiBDMjAuMjE2NDk4MywyIDIxLDIuNzgzNTAxNjkgMjEsMy43NSBMMjEsMjAuMjUgQzIxLDIxLjIxNjQ5ODMgMjAuMjE2NDk4MywyMiAxOS4yNSwyMiBMMTUuNzUsMjIgQzE0Ljc4MzUwMTcsMjIgMTQsMjEuMjE2NDk4MyAxNCwyMC4yNSBMMTQsMy43NSBDMTQsMi43ODM1MDE2OSAxNC43ODM1MDE3LDIgMTUuNzUsMiBMMTkuMjUsMiBaIE04LjI1LDMuNSBMNC43NSwzLjUgQzQuNjExOTI4ODEsMy41IDQuNSwzLjYxMTkyODgxIDQuNSwzLjc1IEw0LjUsMjAuMjUgQzQuNSwyMC4zODgwNzEyIDQuNjExOTI4ODEsMjAuNSA0Ljc1LDIwLjUgTDguMjUsMjAuNSBDOC4zODgwNzExOSwyMC41IDguNSwyMC4zODgwNzEyIDguNSwyMC4yNSBMOC41LDMuNzUgQzguNSwzLjYxMTkyODgxIDguMzg4MDcxMTksMy41IDguMjUsMy41IFogTTE5LjI1LDMuNSBMMTUuNzUsMy41IEMxNS42MTE5Mjg4LDMuNSAxNS41LDMuNjExOTI4ODEgMTUuNSwzLjc1IEwxNS41LDIwLjI1IEMxNS41LDIwLjM4ODA3MTIgMTUuNjExOTI4OCwyMC41IDE1Ljc1LDIwLjUgTDE5LjI1LDIwLjUgQzE5LjM4ODA3MTIsMjAuNSAxOS41LDIwLjM4ODA3MTIgMTkuNSwyMC4yNSBMMTkuNSwzLjc1IEMxOS41LDMuNjExOTI4ODEgMTkuMzg4MDcxMiwzLjUgMTkuMjUsMy41IFoiIGlkPSLwn46oLUNvbG9yIj48L3BhdGg+DQogICAgPC9nPg0KICA8L2c+DQo8L3N2Zz4=";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/playIcon.svg": (
          /*!***************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/playIcon.svg ***!
            \***************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4NCiAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1OS4xICg4NjE0NCkgLSBodHRwczovL3NrZXRjaC5jb20gLS0+DQogIDx0aXRsZT5pY19mbHVlbnRfcGxheV8yNF9yZWd1bGFyPC90aXRsZT4NCiAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogIDxnIGlkPSLwn5SNLVByb2R1Y3QtSWNvbnMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPg0KICAgIDxnIGlkPSJpY19mbHVlbnRfcGxheV8yNF9yZWd1bGFyIiBmaWxsPSJ3aGl0ZSIgZmlsbC1ydWxlPSJub256ZXJvIj4NCiAgICAgIDxwYXRoIGQ9Ik02LjMzOTk0OTc2LDIuMjc1MDA5MTIgQzUuMjUyODQ0OTUsMS42NzMwNDY0OSAzLjg4MzU4NTI1LDIuMDY2MzMxOTMgMy4yODE2MjI2MiwzLjE1MzQzNjc0IEMzLjA5NjkwNzM0LDMuNDg3MDIwMzUgMywzLjg2MjA3NTkyIDMsNC4yNDMzODY1IEwzLDE5Ljc1OTEzODggQzMsMjEuMDAxNzc5NSA0LjAwNzM1OTMxLDIyLjAwOTEzODggNS4yNSwyMi4wMDkxMzg4IEM1LjYzMTQwMDUxLDIyLjAwOTEzODggNi4wMDY1NDE1NCwyMS45MTIxODU4IDYuMzQwMTgyMDIsMjEuNzI3Mzg3NiBMMjAuMzQ4NDQ0MywxMy45Njg0MzE0IEMyMS40MzU0NzgxLDEzLjM2NjM0MDUgMjEuODI4NjAxOSwxMS45OTcwMzQ0IDIxLjIyNjUxMSwxMC45MTAwMDA2IEMyMS4wMjE5Mzk2LDEwLjU0MDY2MSAyMC43MTc1NzU4LDEwLjIzNjMzMzEgMjAuMzQ4MjEyLDEwLjAzMTgwNTMgTDYuMzM5OTQ5NzYsMi4yNzUwMDkxMiBaIE0xOS45MTQzNDUyLDExLjYzNjc4ODcgQzIwLjExNTA0MjIsMTEuOTk5MTMzMyAxOS45ODQwMDA5LDEyLjQ1NTU2ODYgMTkuNjIxNjU2MywxMi42NTYyNjU2IEw1LjYxMzM5NDAxLDIwLjQxNTIyMTcgQzUuNTAyMTgwNTEsMjAuNDc2ODIxMSA1LjM3NzEzMzUsMjAuNTA5MTM4OCA1LjI1LDIwLjUwOTEzODggQzQuODM1Nzg2NDQsMjAuNTA5MTM4OCA0LjUsMjAuMTczMzUyNCA0LjUsMTkuNzU5MTM4OCBMNC41LDQuMjQzMzg2NSBDNC41LDQuMTE2MjgyOTggNC41MzIzMDI0NSwzLjk5MTI2NDQ1IDQuNTkzODc0MjEsMy44ODAwNjk5MiBDNC43OTQ1Mjg0MiwzLjUxNzcwMTY1IDUuMjUwOTQ4MzIsMy4zODY2MDY1IDUuNjEzMzE2NTksMy41ODcyNjA3MSBMMTkuNjIxNTc4OSwxMS4zNDQwNTY5IEMxOS43NDQ3MDAxLDExLjQxMjIzMjggMTkuODQ2MTU0NywxMS41MTM2NzU1IDE5LjkxNDM0NTIsMTEuNjM2Nzg4NyBaIiBpZD0i8J+OqC1Db2xvciI+PC9wYXRoPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/components/preview/svgs/popOut.svg": (
          /*!*************************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/components/preview/svgs/popOut.svg ***!
            \*************************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmZmZmY7fTwvc3R5bGU+PC9kZWZzPjxnIGlkPSJfLVN5c3RlbS1JY29ucyIgZGF0YS1uYW1lPSLwn5SNLVN5c3RlbS1JY29ucyI+PGcgaWQ9ImljX2ZsdWVudF93aW5kb3dfbmV3XzIwX3JlZ3VsYXIiIGRhdGEtbmFtZT0iaWMgZmx1ZW50IHdpbmRvdyBuZXcgMjAgcmVndWxhciI+PHBhdGggaWQ9Il8tQ29sb3IiIGRhdGEtbmFtZT0i8J+OqC1Db2xvciIgY2xhc3M9ImNscy0xIiBkPSJNMTguMTQsMi40NGEzLjQyLDMuNDIsMCwwLDEsMy40MSwzLjE5djkuNzhhMy40MSwzLjQxLDAsMCwxLTIuNDEsMy4yNkEzLjQ0LDMuNDQsMCwwLDEsMTYsMjEuNTVINy4yMkE0Ljc4LDQuNzgsMCwwLDEsMi40NSwxN1Y4LjI3QTMuNDIsMy40MiwwLDAsMSw1LjMxLDQuOWEzLjQzLDMuNDMsMCwwLDEsMy0yLjQ1aDkuOFptLTEzLDMuOUEyLDIsMCwwLDAsMy44Miw4LjA2djguNzJBMy40MSwzLjQxLDAsMCwwLDcsMjAuMThoOC43OEEyLDIsMCwwLDAsMTcuNjMsMTlsLjA4LS4xN0g4LjU5YTMuNDIsMy40MiwwLDAsMS0zLjQxLTMuMTlWNi4zNFptMTMtMi41M0g4LjU5YTIuMDUsMi4wNSwwLDAsMC0yLDIuMDV2OS41NWEyLjA1LDIuMDUsMCwwLDAsMi4wNSwyLjA1aDkuNTVhMi4wNSwyLjA1LDAsMCwwLDIuMDUtMi4wNVY1Ljg2QTIuMDUsMi4wNSwwLDAsMCwxOC4xNCwzLjgxWk0xNi43OCw2LjU0YS42OS42OSwwLDAsMSwuNjcuNTZ2NS41NmEuNjguNjgsMCwwLDEtLjY4LjY4LjY3LjY3LDAsMCwxLS42Ny0uNTZWOC44N2wtNS42Niw1LjY2YS42OC42OCwwLDAsMS0xLS44N2wuMDgtLjFMMTUuMTMsNy45SDExLjM0YS42Ny42NywwLDAsMS0uNjgtLjY4LjY5LjY5LDAsMCwxLC41Ni0uNjdoNS41NloiLz48L2c+PC9nPjwvc3ZnPg==";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/imgs/add.svg": (
          /*!***************************************************!*\
            !*** ../../../tools/nodeEditor/dist/imgs/add.svg ***!
            \***************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4NCiAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA2My4xICg5MjQ1MikgLSBodHRwczovL3NrZXRjaC5jb20gLS0+DQogIDx0aXRsZT5pY19mbHVlbnRfYWRkX2NpcmNsZV8yNF9yZWd1bGFyPC90aXRsZT4NCiAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogIDxnIGlkPSLwn5SNLVN5c3RlbS1JY29ucyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgPGcgaWQ9ImljX2ZsdWVudF9hZGRfY2lyY2xlXzI0X3JlZ3VsYXIiIGZpbGw9IndoaXRlIiBmaWxsLXJ1bGU9Im5vbnplcm8iPg0KICAgICAgPHBhdGggZD0iTTEyLDIgQzE3LjUyMjg0NzUsMiAyMiw2LjQ3NzE1MjUgMjIsMTIgQzIyLDE3LjUyMjg0NzUgMTcuNTIyODQ3NSwyMiAxMiwyMiBDNi40NzcxNTI1LDIyIDIsMTcuNTIyODQ3NSAyLDEyIEMyLDYuNDc3MTUyNSA2LjQ3NzE1MjUsMiAxMiwyIFogTTEyLDMuNSBDNy4zMDU1Nzk2MywzLjUgMy41LDcuMzA1NTc5NjMgMy41LDEyIEMzLjUsMTYuNjk0NDIwNCA3LjMwNTU3OTYzLDIwLjUgMTIsMjAuNSBDMTYuNjk0NDIwNCwyMC41IDIwLjUsMTYuNjk0NDIwNCAyMC41LDEyIEMyMC41LDcuMzA1NTc5NjMgMTYuNjk0NDIwNCwzLjUgMTIsMy41IFogTTEyLDcgQzEyLjQxNDIxMzYsNyAxMi43NSw3LjMzNTc4NjQ0IDEyLjc1LDcuNzUgTDEyLjc1LDExLjI1IEwxNi4yNSwxMS4yNSBDMTYuNjY0MjEzNiwxMS4yNSAxNywxMS41ODU3ODY0IDE3LDEyIEMxNywxMi40MTQyMTM2IDE2LjY2NDIxMzYsMTIuNzUgMTYuMjUsMTIuNzUgTDEyLjc1LDEyLjc1IEwxMi43NSwxNi4yNSBDMTIuNzUsMTYuNjY0MjEzNiAxMi40MTQyMTM2LDE3IDEyLDE3IEMxMS41ODU3ODY0LDE3IDExLjI1LDE2LjY2NDIxMzYgMTEuMjUsMTYuMjUgTDExLjI1LDEyLjc1IEw3Ljc1LDEyLjc1IEM3LjMzNTc4NjQ0LDEyLjc1IDcsMTIuNDE0MjEzNiA3LDEyIEM3LDExLjU4NTc4NjQgNy4zMzU3ODY0NCwxMS4yNSA3Ljc1LDExLjI1IEwxMS4yNSwxMS4yNSBMMTEuMjUsNy43NSBDMTEuMjUsNy4zMzU3ODY0NCAxMS41ODU3ODY0LDcgMTIsNyBaIiBpZD0i8J+OqC1Db2xvciI+PC9wYXRoPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/imgs/delete.svg": (
          /*!******************************************************!*\
            !*** ../../../tools/nodeEditor/dist/imgs/delete.svg ***!
            \******************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4NCiAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1OS4xICg4NjE0NCkgLSBodHRwczovL3NrZXRjaC5jb20gLS0+DQogIDx0aXRsZT5pY19mbHVlbnRfZGVsZXRlXzI0X3JlZ3VsYXI8L3RpdGxlPg0KICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4NCiAgPGcgaWQ9IvCflI0tUHJvZHVjdC1JY29ucyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgPGcgaWQ9ImljX2ZsdWVudF9kZWxldGVfMjRfcmVndWxhciIgZmlsbD0id2hpdGUiIGZpbGwtcnVsZT0ibm9uemVybyI+DQogICAgICA8cGF0aCBkPSJNMTIsMS43NSBDMTMuNzMzMDMxNSwxLjc1IDE1LjE0OTI0NTksMy4xMDY0NTQ3NyAxNS4yNDQ4NTUyLDQuODE1NTc2MDkgTDE1LjI1LDUgTDIwLjUsNSBDMjAuOTE0MjEzNiw1IDIxLjI1LDUuMzM1Nzg2NDQgMjEuMjUsNS43NSBDMjEuMjUsNi4xMjk2OTU3NyAyMC45Njc4NDYxLDYuNDQzNDkwOTYgMjAuNjAxNzcwNiw2LjQ5MzE1MzM4IEwyMC41LDYuNSBMMTkuNzA0LDYuNSBMMTguNDIzODYyNywxOS41MTkxOTI3IEMxOC4yOTExNjY2LDIwLjg2ODI2OTYgMTcuMTk4NDMwOSwyMS45MDk5OTYxIDE1Ljg2MjYyNDksMjEuOTk0NDY0NSBMMTUuNjg3MDY5OCwyMiBMOC4zMTI5MzAyMiwyMiBDNi45NTczNDMwMiwyMiA1LjgxMzY1MzUyLDIxLjAxNDQ4NTEgNS41OTg4MzEwNiwxOS42OTMzNjI5IEw1LjU3NjEzNzM0LDE5LjUxOTE5MjcgTDQuMjk1LDYuNSBMMy41LDYuNSBDMy4xMjAzMDQyMyw2LjUgMi44MDY1MDkwNCw2LjIxNzg0NjEyIDIuNzU2ODQ2NjIsNS44NTE3NzA1NiBMMi43NSw1Ljc1IEMyLjc1LDUuMzcwMzA0MjMgMy4wMzIxNTM4OCw1LjA1NjUwOTA0IDMuMzk4MjI5NDQsNS4wMDY4NDY2MiBMMy41LDUgTDguNzUsNSBDOC43NSwzLjIwNTA3NDU2IDEwLjIwNTA3NDYsMS43NSAxMiwxLjc1IFogTTE4LjE5Nyw2LjUgTDUuODAyLDYuNSBMNy4wNjg5MzM0NiwxOS4zNzIzNjAzIEM3LjEyNzY3NjM5LDE5Ljk2OTU4MDEgNy42MDAzMzAxOSwyMC40MzQyODkxIDguMTg1ODQ1MDEsMjAuNDkzNTk2IEw4LjMxMjkzMDIyLDIwLjUgTDE1LjY4NzA2OTgsMjAuNSBDMTYuMjg3MTcxNiwyMC41IDE2Ljc5NTkxNiwyMC4wNzUxMDU3IDE2LjkxMjI1MzEsMTkuNDk4MjA4MyBMMTYuOTMxMDY2NSwxOS4zNzIzNjAzIEwxOC4xOTcsNi41IFogTTEzLjc1LDkuMjUgQzE0LjEyOTY5NTgsOS4yNSAxNC40NDM0OTEsOS41MzIxNTM4OCAxNC40OTMxNTM0LDkuODk4MjI5NDQgTDE0LjUsMTAgTDE0LjUsMTcgQzE0LjUsMTcuNDE0MjEzNiAxNC4xNjQyMTM2LDE3Ljc1IDEzLjc1LDE3Ljc1IEMxMy4zNzAzMDQyLDE3Ljc1IDEzLjA1NjUwOSwxNy40Njc4NDYxIDEzLjAwNjg0NjYsMTcuMTAxNzcwNiBMMTMsMTcgTDEzLDEwIEMxMyw5LjU4NTc4NjQ0IDEzLjMzNTc4NjQsOS4yNSAxMy43NSw5LjI1IFogTTEwLjI1LDkuMjUgQzEwLjYyOTY5NTgsOS4yNSAxMC45NDM0OTEsOS41MzIxNTM4OCAxMC45OTMxNTM0LDkuODk4MjI5NDQgTDExLDEwIEwxMSwxNyBDMTEsMTcuNDE0MjEzNiAxMC42NjQyMTM2LDE3Ljc1IDEwLjI1LDE3Ljc1IEM5Ljg3MDMwNDIzLDE3Ljc1IDkuNTU2NTA5MDQsMTcuNDY3ODQ2MSA5LjUwNjg0NjYyLDE3LjEwMTc3MDYgTDkuNSwxNyBMOS41LDEwIEM5LjUsOS41ODU3ODY0NCA5LjgzNTc4NjQ0LDkuMjUgMTAuMjUsOS4yNSBaIE0xMiwzLjI1IEMxMS4wODE4MjY2LDMuMjUgMTAuMzI4ODA3NywzLjk1NzExMDI3IDEwLjI1NTgwMTIsNC44NTY0NzI3OSBMMTAuMjUsNSBMMTMuNzUsNSBDMTMuNzUsNC4wMzM1MDE2OSAxMi45NjY0OTgzLDMuMjUgMTIsMy4yNSBaIiBpZD0i8J+OqC1Db2xvciI+PC9wYXRoPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/imgs/downArrow.svg": (
          /*!*********************************************************!*\
            !*** ../../../tools/nodeEditor/dist/imgs/downArrow.svg ***!
            \*********************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjE3IiBoZWlnaHQ9IjE3Ij4NCiAgPHBhdGggZD0iTTQuMjE5NjcgOC40Njk2N0M0LjUxMjU2IDguMTc2NzggNC45ODc0NCA4LjE3Njc4IDUuMjgwMzMgOC40Njk2N0wxMiAxNS4xODkzTDE4LjcxOTcgOC40Njk2N0MxOS4wMTI2IDguMTc2NzggMTkuNDg3NCA4LjE3Njc4IDE5Ljc4MDMgOC40Njk2N0MyMC4wNzMyIDguNzYyNTYgMjAuMDczMiA5LjIzNzQ0IDE5Ljc4MDMgOS41MzAzM0wxMi41MzAzIDE2Ljc4MDNDMTIuMjM3NCAxNy4wNzMyIDExLjc2MjYgMTcuMDczMiAxMS40Njk3IDE2Ljc4MDNMNC4yMTk2NyA5LjUzMDMzQzMuOTI2NzggOS4yMzc0NCAzLjkyNjc4IDguNzYyNTYgNC4yMTk2NyA4LjQ2OTY3WiIgZmlsbD0id2hpdGUiIC8+DQo8L3N2Zz4=";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/imgs/square.svg": (
          /*!******************************************************!*\
            !*** ../../../tools/nodeEditor/dist/imgs/square.svg ***!
            \******************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl81IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMy4xMiw1LjYxYzAtMS4zNywxLjExLTIuNDgsMi40OC0yLjQ4SDE0LjM5YzEuMzcsMCwyLjQ4LDEuMTEsMi40OCwyLjQ4VjE0LjM5YzAsMS4zNy0xLjExLDIuNDgtMi40OCwyLjQ4SDUuNjFjLTEuMzcsMC0yLjQ4LTEuMTEtMi40OC0yLjQ4VjUuNjFaIi8+PC9zdmc+";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/imgs/triangle.svg": (
          /*!********************************************************!*\
            !*** ../../../tools/nodeEditor/dist/imgs/triangle.svg ***!
            \********************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl81IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMi42MywxNS4yNmMtLjQ0LC44MywuMTYsMS44NCwxLjExLDEuODRoMTIuNTJjLjk1LDAsMS41NS0xLjAyLDEuMS0xLjg1TDExLjAyLDMuNTZjLS40OC0uODgtMS43NC0uODctMi4yMSwuMDFMMi42MywxNS4yNloiLz48L3N2Zz4=";
          }
        ),
        /***/
        "../../../tools/nodeEditor/dist/sharedComponents/copy.svg": (
          /*!****************************************************************!*\
            !*** ../../../tools/nodeEditor/dist/sharedComponents/copy.svg ***!
            \****************************************************************/
          /***/
          (a) => {
            a.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4NCiAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1OS4xICg4NjE0NCkgLSBodHRwczovL3NrZXRjaC5jb20gLS0+DQogIDx0aXRsZT5pY19mbHVlbnRfY29weV8yNF9yZWd1bGFyPC90aXRsZT4NCiAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogIDxnIGlkPSLwn5SNLVByb2R1Y3QtSWNvbnMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPg0KICAgIDxnIGlkPSJpY19mbHVlbnRfY29weV8yNF9yZWd1bGFyIiBmaWxsPSJ3aGl0ZSIgZmlsbC1ydWxlPSJub256ZXJvIj4NCiAgICAgIDxwYXRoIGQ9Ik01LjUwMjgwMzgxLDQuNjI3MDQwMzggTDUuNSw2Ljc1IEw1LjUsMTcuMjU0MjA4NyBDNS41LDE5LjA0OTEzNDIgNi45NTUwNzQ1NiwyMC41MDQyMDg3IDguNzUsMjAuNTA0MjA4NyBMMTcuMzY2Mjg2OCwyMC41MDQ0NjIyIEMxNy4wNTczMzgsMjEuMzc4MjI0MSAxNi4yMjM5NzUxLDIyLjAwNDIwODcgMTUuMjQ0NDA1NywyMi4wMDQyMDg3IEw4Ljc1LDIyLjAwNDIwODcgQzYuMTI2NjQ3NDQsMjIuMDA0MjA4NyA0LDE5Ljg3NzU2MTMgNCwxNy4yNTQyMDg3IEw0LDYuNzUgQzQsNS43NjkyODg0OCA0LjYyNzQ0NTIzLDQuOTM1MTI0NjQgNS41MDI4MDM4MSw0LjYyNzA0MDM4IFogTTE3Ljc1LDIgQzE4Ljk5MjY0MDcsMiAyMCwzLjAwNzM1OTMxIDIwLDQuMjUgTDIwLDE3LjI1IEMyMCwxOC40OTI2NDA3IDE4Ljk5MjY0MDcsMTkuNSAxNy43NSwxOS41IEw4Ljc1LDE5LjUgQzcuNTA3MzU5MzEsMTkuNSA2LjUsMTguNDkyNjQwNyA2LjUsMTcuMjUgTDYuNSw0LjI1IEM2LjUsMy4wMDczNTkzMSA3LjUwNzM1OTMxLDIgOC43NSwyIEwxNy43NSwyIFogTTE3Ljc1LDMuNSBMOC43NSwzLjUgQzguMzM1Nzg2NDQsMy41IDgsMy44MzU3ODY0NCA4LDQuMjUgTDgsMTcuMjUgQzgsMTcuNjY0MjEzNiA4LjMzNTc4NjQ0LDE4IDguNzUsMTggTDE3Ljc1LDE4IEMxOC4xNjQyMTM2LDE4IDE4LjUsMTcuNjY0MjEzNiAxOC41LDE3LjI1IEwxOC41LDQuMjUgQzE4LjUsMy44MzU3ODY0NCAxOC4xNjQyMTM2LDMuNSAxNy43NSwzLjUgWiIgaWQ9IvCfjqgtQ29sb3IiPjwvcGF0aD4NCiAgICA8L2c+DQogIDwvZz4NCjwvc3ZnPg==";
          }
        ),
        /***/
        "core/Misc/dataStorage": (
          /*!**********************************************************************************************************************!*\
            !*** external {"root":"BABYLON","commonjs":"@babylonjs/core","commonjs2":"@babylonjs/core","amd":"@babylonjs/core"} ***!
            \**********************************************************************************************************************/
          /***/
          (a) => {
            a.exports = t;
          }
        ),
        /***/
        "../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs": (
          /*!****************************************************************************!*\
            !*** ../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs ***!
            \****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              api: () => (
                /* binding */
                qi
              ),
              /* harmony export */
              config: () => (
                /* binding */
                Ip
              ),
              /* harmony export */
              counter: () => (
                /* binding */
                e7
              ),
              /* harmony export */
              dom: () => (
                /* binding */
                gg
              ),
              /* harmony export */
              findIconDefinition: () => (
                /* binding */
                Rp
              ),
              /* harmony export */
              icon: () => (
                /* binding */
                Oc
              ),
              /* harmony export */
              layer: () => (
                /* binding */
                G9
              ),
              /* harmony export */
              library: () => (
                /* binding */
                _0
              ),
              /* harmony export */
              noAuto: () => (
                /* binding */
                Up
              ),
              /* harmony export */
              parse: () => (
                /* binding */
                $0
              ),
              /* harmony export */
              text: () => (
                /* binding */
                yA
              ),
              /* harmony export */
              toHtml: () => (
                /* binding */
                rv
              )
              /* harmony export */
            });
            function d(Be, Qe) {
              var ze = Object.keys(Be);
              if (Object.getOwnPropertySymbols) {
                var rt = Object.getOwnPropertySymbols(Be);
                Qe && (rt = rt.filter(function(vt) {
                  return Object.getOwnPropertyDescriptor(Be, vt).enumerable;
                })), ze.push.apply(ze, rt);
              }
              return ze;
            }
            function v(Be) {
              for (var Qe = 1; Qe < arguments.length; Qe++) {
                var ze = arguments[Qe] != null ? arguments[Qe] : {};
                Qe % 2 ? d(Object(ze), !0).forEach(function(rt) {
                  c(Be, rt, ze[rt]);
                }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(Be, Object.getOwnPropertyDescriptors(ze)) : d(Object(ze)).forEach(function(rt) {
                  Object.defineProperty(Be, rt, Object.getOwnPropertyDescriptor(ze, rt));
                });
              }
              return Be;
            }
            function u(Be) {
              "@babel/helpers - typeof";
              return u = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(Qe) {
                return typeof Qe;
              } : function(Qe) {
                return Qe && typeof Symbol == "function" && Qe.constructor === Symbol && Qe !== Symbol.prototype ? "symbol" : typeof Qe;
              }, u(Be);
            }
            function l(Be, Qe) {
              if (!(Be instanceof Qe))
                throw new TypeError("Cannot call a class as a function");
            }
            function P(Be, Qe) {
              for (var ze = 0; ze < Qe.length; ze++) {
                var rt = Qe[ze];
                rt.enumerable = rt.enumerable || !1, rt.configurable = !0, "value" in rt && (rt.writable = !0), Object.defineProperty(Be, rt.key, rt);
              }
            }
            function p(Be, Qe, ze) {
              return Qe && P(Be.prototype, Qe), ze && P(Be, ze), Object.defineProperty(Be, "prototype", {
                writable: !1
              }), Be;
            }
            function c(Be, Qe, ze) {
              return Qe in Be ? Object.defineProperty(Be, Qe, {
                value: ze,
                enumerable: !0,
                configurable: !0,
                writable: !0
              }) : Be[Qe] = ze, Be;
            }
            function H(Be, Qe) {
              return b(Be) || w(Be, Qe) || m(Be, Qe) || k();
            }
            function T(Be) {
              return q(Be) || j(Be) || m(Be) || N();
            }
            function q(Be) {
              if (Array.isArray(Be))
                return I(Be);
            }
            function b(Be) {
              if (Array.isArray(Be))
                return Be;
            }
            function j(Be) {
              if (typeof Symbol < "u" && Be[Symbol.iterator] != null || Be["@@iterator"] != null)
                return Array.from(Be);
            }
            function w(Be, Qe) {
              var ze = Be == null ? null : typeof Symbol < "u" && Be[Symbol.iterator] || Be["@@iterator"];
              if (ze != null) {
                var rt = [], vt = !0, yt = !1, Bt, ar;
                try {
                  for (ze = ze.call(Be); !(vt = (Bt = ze.next()).done) && (rt.push(Bt.value), !(Qe && rt.length === Qe)); vt = !0)
                    ;
                } catch (Pr) {
                  yt = !0, ar = Pr;
                } finally {
                  try {
                    !vt && ze.return != null && ze.return();
                  } finally {
                    if (yt)
                      throw ar;
                  }
                }
                return rt;
              }
            }
            function m(Be, Qe) {
              if (Be) {
                if (typeof Be == "string")
                  return I(Be, Qe);
                var ze = Object.prototype.toString.call(Be).slice(8, -1);
                if (ze === "Object" && Be.constructor && (ze = Be.constructor.name), ze === "Map" || ze === "Set")
                  return Array.from(Be);
                if (ze === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ze))
                  return I(Be, Qe);
              }
            }
            function I(Be, Qe) {
              (Qe == null || Qe > Be.length) && (Qe = Be.length);
              for (var ze = 0, rt = new Array(Qe); ze < Qe; ze++)
                rt[ze] = Be[ze];
              return rt;
            }
            function N() {
              throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
            }
            function k() {
              throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
            }
            var R = function() {
            }, y = {}, O = {}, Y = null, ee = {
              mark: R,
              measure: R
            };
            try {
              typeof window < "u" && (y = window), typeof document < "u" && (O = document), typeof MutationObserver < "u" && (Y = MutationObserver), typeof performance < "u" && (ee = performance);
            } catch {
            }
            var Z = y.navigator || {}, te = Z.userAgent, fe = te === void 0 ? "" : te, _ = y, G = O, L = Y, $ = ee;
            _.document;
            var ae = !!G.documentElement && !!G.head && typeof G.addEventListener == "function" && typeof G.createElement == "function", Pe = ~fe.indexOf("MSIE") || ~fe.indexOf("Trident/"), ge, me, Xe, De, ne, re = "___FONT_AWESOME___", ve = 16, qe = "fa", ke = "svg-inline--fa", be = "data-fa-i2svg", Fe = "data-fa-pseudo-element", Ke = "data-fa-pseudo-element-pending", nt = "data-prefix", ut = "data-icon", bt = "fontawesome-i2svg", wt = "async", Tt = ["HTML", "HEAD", "STYLE", "SCRIPT"], lr = function() {
              try {
                return !1;
              } catch {
                return !1;
              }
            }(), Qt = "classic", tr = "sharp", br = [Qt, tr];
            function Xn(Be) {
              return new Proxy(Be, {
                get: function(ze, rt) {
                  return rt in ze ? ze[rt] : ze[Qt];
                }
              });
            }
            var qr = Xn((ge = {}, c(ge, Qt, {
              fa: "solid",
              fas: "solid",
              "fa-solid": "solid",
              far: "regular",
              "fa-regular": "regular",
              fal: "light",
              "fa-light": "light",
              fat: "thin",
              "fa-thin": "thin",
              fad: "duotone",
              "fa-duotone": "duotone",
              fab: "brands",
              "fa-brands": "brands",
              fak: "kit",
              "fa-kit": "kit"
            }), c(ge, tr, {
              fa: "solid",
              fass: "solid",
              "fa-solid": "solid",
              fasr: "regular",
              "fa-regular": "regular",
              fasl: "light",
              "fa-light": "light"
            }), ge)), En = Xn((me = {}, c(me, Qt, {
              solid: "fas",
              regular: "far",
              light: "fal",
              thin: "fat",
              duotone: "fad",
              brands: "fab",
              kit: "fak"
            }), c(me, tr, {
              solid: "fass",
              regular: "fasr",
              light: "fasl"
            }), me)), Bn = Xn((Xe = {}, c(Xe, Qt, {
              fab: "fa-brands",
              fad: "fa-duotone",
              fak: "fa-kit",
              fal: "fa-light",
              far: "fa-regular",
              fas: "fa-solid",
              fat: "fa-thin"
            }), c(Xe, tr, {
              fass: "fa-solid",
              fasr: "fa-regular",
              fasl: "fa-light"
            }), Xe)), Fi = Xn((De = {}, c(De, Qt, {
              "fa-brands": "fab",
              "fa-duotone": "fad",
              "fa-kit": "fak",
              "fa-light": "fal",
              "fa-regular": "far",
              "fa-solid": "fas",
              "fa-thin": "fat"
            }), c(De, tr, {
              "fa-solid": "fass",
              "fa-regular": "fasr",
              "fa-light": "fasl"
            }), De)), Gt = /fa(s|r|l|t|d|b|k|ss|sr|sl)?[\-\ ]/, xr = "fa-layers-text", Br = /Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i, nn = Xn((ne = {}, c(ne, Qt, {
              900: "fas",
              400: "far",
              normal: "far",
              300: "fal",
              100: "fat"
            }), c(ne, tr, {
              900: "fass",
              400: "fasr",
              300: "fasl"
            }), ne)), sn = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], Pn = sn.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]), an = ["class", "data-prefix", "data-icon", "data-fa-transform", "data-fa-mask"], Wn = {
              GROUP: "duotone-group",
              SWAP_OPACITY: "swap-opacity",
              PRIMARY: "primary",
              SECONDARY: "secondary"
            }, rr = /* @__PURE__ */ new Set();
            Object.keys(En[Qt]).map(rr.add.bind(rr)), Object.keys(En[tr]).map(rr.add.bind(rr));
            var Sr = [].concat(br, T(rr), ["2xs", "xs", "sm", "lg", "xl", "2xl", "beat", "border", "fade", "beat-fade", "bounce", "flip-both", "flip-horizontal", "flip-vertical", "flip", "fw", "inverse", "layers-counter", "layers-text", "layers", "li", "pull-left", "pull-right", "pulse", "rotate-180", "rotate-270", "rotate-90", "rotate-by", "shake", "spin-pulse", "spin-reverse", "spin", "stack-1x", "stack-2x", "stack", "ul", Wn.GROUP, Wn.SWAP_OPACITY, Wn.PRIMARY, Wn.SECONDARY]).concat(sn.map(function(Be) {
              return "".concat(Be, "x");
            })).concat(Pn.map(function(Be) {
              return "w-".concat(Be);
            })), nr = _.FontAwesomeConfig || {};
            function Er(Be) {
              var Qe = G.querySelector("script[" + Be + "]");
              if (Qe)
                return Qe.getAttribute(Be);
            }
            function Rn(Be) {
              return Be === "" ? !0 : Be === "false" ? !1 : Be === "true" ? !0 : Be;
            }
            if (G && typeof G.querySelector == "function") {
              var Vn = [["data-family-prefix", "familyPrefix"], ["data-css-prefix", "cssPrefix"], ["data-family-default", "familyDefault"], ["data-style-default", "styleDefault"], ["data-replacement-class", "replacementClass"], ["data-auto-replace-svg", "autoReplaceSvg"], ["data-auto-add-css", "autoAddCss"], ["data-auto-a11y", "autoA11y"], ["data-search-pseudo-elements", "searchPseudoElements"], ["data-observe-mutations", "observeMutations"], ["data-mutate-approach", "mutateApproach"], ["data-keep-original-source", "keepOriginalSource"], ["data-measure-performance", "measurePerformance"], ["data-show-missing-icons", "showMissingIcons"]];
              Vn.forEach(function(Be) {
                var Qe = H(Be, 2), ze = Qe[0], rt = Qe[1], vt = Rn(Er(ze));
                vt != null && (nr[rt] = vt);
              });
            }
            var ki = {
              styleDefault: "solid",
              familyDefault: "classic",
              cssPrefix: qe,
              replacementClass: ke,
              autoReplaceSvg: !0,
              autoAddCss: !0,
              autoA11y: !0,
              searchPseudoElements: !1,
              observeMutations: !0,
              mutateApproach: "async",
              keepOriginalSource: !0,
              measurePerformance: !1,
              showMissingIcons: !0
            };
            nr.familyPrefix && (nr.cssPrefix = nr.familyPrefix);
            var as = v(v({}, ki), nr);
            as.autoReplaceSvg || (as.observeMutations = !1);
            var Rr = {};
            Object.keys(ki).forEach(function(Be) {
              Object.defineProperty(Rr, Be, {
                enumerable: !0,
                set: function(ze) {
                  as[Be] = ze, Ii.forEach(function(rt) {
                    return rt(Rr);
                  });
                },
                get: function() {
                  return as[Be];
                }
              });
            }), Object.defineProperty(Rr, "familyPrefix", {
              enumerable: !0,
              set: function(Qe) {
                as.cssPrefix = Qe, Ii.forEach(function(ze) {
                  return ze(Rr);
                });
              },
              get: function() {
                return as.cssPrefix;
              }
            }), _.FontAwesomeConfig = Rr;
            var Ii = [];
            function is(Be) {
              return Ii.push(Be), function() {
                Ii.splice(Ii.indexOf(Be), 1);
              };
            }
            var ji = ve, _i = {
              size: 16,
              x: 0,
              y: 0,
              rotate: 0,
              flipX: !1,
              flipY: !1
            };
            function oi(Be) {
              if (!(!Be || !ae)) {
                var Qe = G.createElement("style");
                Qe.setAttribute("type", "text/css"), Qe.innerHTML = Be;
                for (var ze = G.head.childNodes, rt = null, vt = ze.length - 1; vt > -1; vt--) {
                  var yt = ze[vt], Bt = (yt.tagName || "").toUpperCase();
                  ["STYLE", "LINK"].indexOf(Bt) > -1 && (rt = yt);
                }
                return G.head.insertBefore(Qe, rt), Be;
              }
            }
            var vr = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
            function Fr() {
              for (var Be = 12, Qe = ""; Be-- > 0; )
                Qe += vr[Math.random() * 62 | 0];
              return Qe;
            }
            function pr(Be) {
              for (var Qe = [], ze = (Be || []).length >>> 0; ze--; )
                Qe[ze] = Be[ze];
              return Qe;
            }
            function ds(Be) {
              return Be.classList ? pr(Be.classList) : (Be.getAttribute("class") || "").split(" ").filter(function(Qe) {
                return Qe;
              });
            }
            function it(Be) {
              return "".concat(Be).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
            }
            function $t(Be) {
              return Object.keys(Be || {}).reduce(function(Qe, ze) {
                return Qe + "".concat(ze, '="').concat(it(Be[ze]), '" ');
              }, "").trim();
            }
            function Ur(Be) {
              return Object.keys(Be || {}).reduce(function(Qe, ze) {
                return Qe + "".concat(ze, ": ").concat(Be[ze].trim(), ";");
              }, "");
            }
            function $e(Be) {
              return Be.size !== _i.size || Be.x !== _i.x || Be.y !== _i.y || Be.rotate !== _i.rotate || Be.flipX || Be.flipY;
            }
            function Kt(Be) {
              var Qe = Be.transform, ze = Be.containerWidth, rt = Be.iconWidth, vt = {
                transform: "translate(".concat(ze / 2, " 256)")
              }, yt = "translate(".concat(Qe.x * 32, ", ").concat(Qe.y * 32, ") "), Bt = "scale(".concat(Qe.size / 16 * (Qe.flipX ? -1 : 1), ", ").concat(Qe.size / 16 * (Qe.flipY ? -1 : 1), ") "), ar = "rotate(".concat(Qe.rotate, " 0 0)"), Pr = {
                transform: "".concat(yt, " ").concat(Bt, " ").concat(ar)
              }, Sn = {
                transform: "translate(".concat(rt / 2 * -1, " -256)")
              };
              return {
                outer: vt,
                inner: Pr,
                path: Sn
              };
            }
            function cr(Be) {
              var Qe = Be.transform, ze = Be.width, rt = ze === void 0 ? ve : ze, vt = Be.height, yt = vt === void 0 ? ve : vt, Bt = Be.startCentered, ar = Bt === void 0 ? !1 : Bt, Pr = "";
              return ar && Pe ? Pr += "translate(".concat(Qe.x / ji - rt / 2, "em, ").concat(Qe.y / ji - yt / 2, "em) ") : ar ? Pr += "translate(calc(-50% + ".concat(Qe.x / ji, "em), calc(-50% + ").concat(Qe.y / ji, "em)) ") : Pr += "translate(".concat(Qe.x / ji, "em, ").concat(Qe.y / ji, "em) "), Pr += "scale(".concat(Qe.size / ji * (Qe.flipX ? -1 : 1), ", ").concat(Qe.size / ji * (Qe.flipY ? -1 : 1), ") "), Pr += "rotate(".concat(Qe.rotate, "deg) "), Pr;
            }
            var Vr = `:root, :host {
  --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";
  --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";
  --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";
  --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin";
  --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";
  --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";
  --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";
  --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";
  --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";
}

svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
  overflow: visible;
  box-sizing: content-box;
}

.svg-inline--fa {
  display: var(--fa-display, inline-block);
  height: 1em;
  overflow: visible;
  vertical-align: -0.125em;
}
.svg-inline--fa.fa-2xs {
  vertical-align: 0.1em;
}
.svg-inline--fa.fa-xs {
  vertical-align: 0em;
}
.svg-inline--fa.fa-sm {
  vertical-align: -0.0714285705em;
}
.svg-inline--fa.fa-lg {
  vertical-align: -0.2em;
}
.svg-inline--fa.fa-xl {
  vertical-align: -0.25em;
}
.svg-inline--fa.fa-2xl {
  vertical-align: -0.3125em;
}
.svg-inline--fa.fa-pull-left {
  margin-right: var(--fa-pull-margin, 0.3em);
  width: auto;
}
.svg-inline--fa.fa-pull-right {
  margin-left: var(--fa-pull-margin, 0.3em);
  width: auto;
}
.svg-inline--fa.fa-li {
  width: var(--fa-li-width, 2em);
  top: 0.25em;
}
.svg-inline--fa.fa-fw {
  width: var(--fa-fw-width, 1.25em);
}

.fa-layers svg.svg-inline--fa {
  bottom: 0;
  left: 0;
  margin: auto;
  position: absolute;
  right: 0;
  top: 0;
}

.fa-layers-counter, .fa-layers-text {
  display: inline-block;
  position: absolute;
  text-align: center;
}

.fa-layers {
  display: inline-block;
  height: 1em;
  position: relative;
  text-align: center;
  vertical-align: -0.125em;
  width: 1em;
}
.fa-layers svg.svg-inline--fa {
  -webkit-transform-origin: center center;
          transform-origin: center center;
}

.fa-layers-text {
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  -webkit-transform-origin: center center;
          transform-origin: center center;
}

.fa-layers-counter {
  background-color: var(--fa-counter-background-color, #ff253a);
  border-radius: var(--fa-counter-border-radius, 1em);
  box-sizing: border-box;
  color: var(--fa-inverse, #fff);
  line-height: var(--fa-counter-line-height, 1);
  max-width: var(--fa-counter-max-width, 5em);
  min-width: var(--fa-counter-min-width, 1.5em);
  overflow: hidden;
  padding: var(--fa-counter-padding, 0.25em 0.5em);
  right: var(--fa-right, 0);
  text-overflow: ellipsis;
  top: var(--fa-top, 0);
  -webkit-transform: scale(var(--fa-counter-scale, 0.25));
          transform: scale(var(--fa-counter-scale, 0.25));
  -webkit-transform-origin: top right;
          transform-origin: top right;
}

.fa-layers-bottom-right {
  bottom: var(--fa-bottom, 0);
  right: var(--fa-right, 0);
  top: auto;
  -webkit-transform: scale(var(--fa-layers-scale, 0.25));
          transform: scale(var(--fa-layers-scale, 0.25));
  -webkit-transform-origin: bottom right;
          transform-origin: bottom right;
}

.fa-layers-bottom-left {
  bottom: var(--fa-bottom, 0);
  left: var(--fa-left, 0);
  right: auto;
  top: auto;
  -webkit-transform: scale(var(--fa-layers-scale, 0.25));
          transform: scale(var(--fa-layers-scale, 0.25));
  -webkit-transform-origin: bottom left;
          transform-origin: bottom left;
}

.fa-layers-top-right {
  top: var(--fa-top, 0);
  right: var(--fa-right, 0);
  -webkit-transform: scale(var(--fa-layers-scale, 0.25));
          transform: scale(var(--fa-layers-scale, 0.25));
  -webkit-transform-origin: top right;
          transform-origin: top right;
}

.fa-layers-top-left {
  left: var(--fa-left, 0);
  right: auto;
  top: var(--fa-top, 0);
  -webkit-transform: scale(var(--fa-layers-scale, 0.25));
          transform: scale(var(--fa-layers-scale, 0.25));
  -webkit-transform-origin: top left;
          transform-origin: top left;
}

.fa-1x {
  font-size: 1em;
}

.fa-2x {
  font-size: 2em;
}

.fa-3x {
  font-size: 3em;
}

.fa-4x {
  font-size: 4em;
}

.fa-5x {
  font-size: 5em;
}

.fa-6x {
  font-size: 6em;
}

.fa-7x {
  font-size: 7em;
}

.fa-8x {
  font-size: 8em;
}

.fa-9x {
  font-size: 9em;
}

.fa-10x {
  font-size: 10em;
}

.fa-2xs {
  font-size: 0.625em;
  line-height: 0.1em;
  vertical-align: 0.225em;
}

.fa-xs {
  font-size: 0.75em;
  line-height: 0.0833333337em;
  vertical-align: 0.125em;
}

.fa-sm {
  font-size: 0.875em;
  line-height: 0.0714285718em;
  vertical-align: 0.0535714295em;
}

.fa-lg {
  font-size: 1.25em;
  line-height: 0.05em;
  vertical-align: -0.075em;
}

.fa-xl {
  font-size: 1.5em;
  line-height: 0.0416666682em;
  vertical-align: -0.125em;
}

.fa-2xl {
  font-size: 2em;
  line-height: 0.03125em;
  vertical-align: -0.1875em;
}

.fa-fw {
  text-align: center;
  width: 1.25em;
}

.fa-ul {
  list-style-type: none;
  margin-left: var(--fa-li-margin, 2.5em);
  padding-left: 0;
}
.fa-ul > li {
  position: relative;
}

.fa-li {
  left: calc(var(--fa-li-width, 2em) * -1);
  position: absolute;
  text-align: center;
  width: var(--fa-li-width, 2em);
  line-height: inherit;
}

.fa-border {
  border-color: var(--fa-border-color, #eee);
  border-radius: var(--fa-border-radius, 0.1em);
  border-style: var(--fa-border-style, solid);
  border-width: var(--fa-border-width, 0.08em);
  padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);
}

.fa-pull-left {
  float: left;
  margin-right: var(--fa-pull-margin, 0.3em);
}

.fa-pull-right {
  float: right;
  margin-left: var(--fa-pull-margin, 0.3em);
}

.fa-beat {
  -webkit-animation-name: fa-beat;
          animation-name: fa-beat;
  -webkit-animation-delay: var(--fa-animation-delay, 0s);
          animation-delay: var(--fa-animation-delay, 0s);
  -webkit-animation-direction: var(--fa-animation-direction, normal);
          animation-direction: var(--fa-animation-direction, normal);
  -webkit-animation-duration: var(--fa-animation-duration, 1s);
          animation-duration: var(--fa-animation-duration, 1s);
  -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
          animation-iteration-count: var(--fa-animation-iteration-count, infinite);
  -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);
          animation-timing-function: var(--fa-animation-timing, ease-in-out);
}

.fa-bounce {
  -webkit-animation-name: fa-bounce;
          animation-name: fa-bounce;
  -webkit-animation-delay: var(--fa-animation-delay, 0s);
          animation-delay: var(--fa-animation-delay, 0s);
  -webkit-animation-direction: var(--fa-animation-direction, normal);
          animation-direction: var(--fa-animation-direction, normal);
  -webkit-animation-duration: var(--fa-animation-duration, 1s);
          animation-duration: var(--fa-animation-duration, 1s);
  -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
          animation-iteration-count: var(--fa-animation-iteration-count, infinite);
  -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));
          animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));
}

.fa-fade {
  -webkit-animation-name: fa-fade;
          animation-name: fa-fade;
  -webkit-animation-delay: var(--fa-animation-delay, 0s);
          animation-delay: var(--fa-animation-delay, 0s);
  -webkit-animation-direction: var(--fa-animation-direction, normal);
          animation-direction: var(--fa-animation-direction, normal);
  -webkit-animation-duration: var(--fa-animation-duration, 1s);
          animation-duration: var(--fa-animation-duration, 1s);
  -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
          animation-iteration-count: var(--fa-animation-iteration-count, infinite);
  -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
          animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
}

.fa-beat-fade {
  -webkit-animation-name: fa-beat-fade;
          animation-name: fa-beat-fade;
  -webkit-animation-delay: var(--fa-animation-delay, 0s);
          animation-delay: var(--fa-animation-delay, 0s);
  -webkit-animation-direction: var(--fa-animation-direction, normal);
          animation-direction: var(--fa-animation-direction, normal);
  -webkit-animation-duration: var(--fa-animation-duration, 1s);
          animation-duration: var(--fa-animation-duration, 1s);
  -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
          animation-iteration-count: var(--fa-animation-iteration-count, infinite);
  -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
          animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
}

.fa-flip {
  -webkit-animation-name: fa-flip;
          animation-name: fa-flip;
  -webkit-animation-delay: var(--fa-animation-delay, 0s);
          animation-delay: var(--fa-animation-delay, 0s);
  -webkit-animation-direction: var(--fa-animation-direction, normal);
          animation-direction: var(--fa-animation-direction, normal);
  -webkit-animation-duration: var(--fa-animation-duration, 1s);
          animation-duration: var(--fa-animation-duration, 1s);
  -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
          animation-iteration-count: var(--fa-animation-iteration-count, infinite);
  -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);
          animation-timing-function: var(--fa-animation-timing, ease-in-out);
}

.fa-shake {
  -webkit-animation-name: fa-shake;
          animation-name: fa-shake;
  -webkit-animation-delay: var(--fa-animation-delay, 0s);
          animation-delay: var(--fa-animation-delay, 0s);
  -webkit-animation-direction: var(--fa-animation-direction, normal);
          animation-direction: var(--fa-animation-direction, normal);
  -webkit-animation-duration: var(--fa-animation-duration, 1s);
          animation-duration: var(--fa-animation-duration, 1s);
  -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
          animation-iteration-count: var(--fa-animation-iteration-count, infinite);
  -webkit-animation-timing-function: var(--fa-animation-timing, linear);
          animation-timing-function: var(--fa-animation-timing, linear);
}

.fa-spin {
  -webkit-animation-name: fa-spin;
          animation-name: fa-spin;
  -webkit-animation-delay: var(--fa-animation-delay, 0s);
          animation-delay: var(--fa-animation-delay, 0s);
  -webkit-animation-direction: var(--fa-animation-direction, normal);
          animation-direction: var(--fa-animation-direction, normal);
  -webkit-animation-duration: var(--fa-animation-duration, 2s);
          animation-duration: var(--fa-animation-duration, 2s);
  -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
          animation-iteration-count: var(--fa-animation-iteration-count, infinite);
  -webkit-animation-timing-function: var(--fa-animation-timing, linear);
          animation-timing-function: var(--fa-animation-timing, linear);
}

.fa-spin-reverse {
  --fa-animation-direction: reverse;
}

.fa-pulse,
.fa-spin-pulse {
  -webkit-animation-name: fa-spin;
          animation-name: fa-spin;
  -webkit-animation-direction: var(--fa-animation-direction, normal);
          animation-direction: var(--fa-animation-direction, normal);
  -webkit-animation-duration: var(--fa-animation-duration, 1s);
          animation-duration: var(--fa-animation-duration, 1s);
  -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);
          animation-iteration-count: var(--fa-animation-iteration-count, infinite);
  -webkit-animation-timing-function: var(--fa-animation-timing, steps(8));
          animation-timing-function: var(--fa-animation-timing, steps(8));
}

@media (prefers-reduced-motion: reduce) {
  .fa-beat,
.fa-bounce,
.fa-fade,
.fa-beat-fade,
.fa-flip,
.fa-pulse,
.fa-shake,
.fa-spin,
.fa-spin-pulse {
    -webkit-animation-delay: -1ms;
            animation-delay: -1ms;
    -webkit-animation-duration: 1ms;
            animation-duration: 1ms;
    -webkit-animation-iteration-count: 1;
            animation-iteration-count: 1;
    -webkit-transition-delay: 0s;
            transition-delay: 0s;
    -webkit-transition-duration: 0s;
            transition-duration: 0s;
  }
}
@-webkit-keyframes fa-beat {
  0%, 90% {
    -webkit-transform: scale(1);
            transform: scale(1);
  }
  45% {
    -webkit-transform: scale(var(--fa-beat-scale, 1.25));
            transform: scale(var(--fa-beat-scale, 1.25));
  }
}
@keyframes fa-beat {
  0%, 90% {
    -webkit-transform: scale(1);
            transform: scale(1);
  }
  45% {
    -webkit-transform: scale(var(--fa-beat-scale, 1.25));
            transform: scale(var(--fa-beat-scale, 1.25));
  }
}
@-webkit-keyframes fa-bounce {
  0% {
    -webkit-transform: scale(1, 1) translateY(0);
            transform: scale(1, 1) translateY(0);
  }
  10% {
    -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
            transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
  }
  30% {
    -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
            transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
  }
  50% {
    -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
            transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
  }
  57% {
    -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
            transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
  }
  64% {
    -webkit-transform: scale(1, 1) translateY(0);
            transform: scale(1, 1) translateY(0);
  }
  100% {
    -webkit-transform: scale(1, 1) translateY(0);
            transform: scale(1, 1) translateY(0);
  }
}
@keyframes fa-bounce {
  0% {
    -webkit-transform: scale(1, 1) translateY(0);
            transform: scale(1, 1) translateY(0);
  }
  10% {
    -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
            transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
  }
  30% {
    -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
            transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
  }
  50% {
    -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
            transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
  }
  57% {
    -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
            transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
  }
  64% {
    -webkit-transform: scale(1, 1) translateY(0);
            transform: scale(1, 1) translateY(0);
  }
  100% {
    -webkit-transform: scale(1, 1) translateY(0);
            transform: scale(1, 1) translateY(0);
  }
}
@-webkit-keyframes fa-fade {
  50% {
    opacity: var(--fa-fade-opacity, 0.4);
  }
}
@keyframes fa-fade {
  50% {
    opacity: var(--fa-fade-opacity, 0.4);
  }
}
@-webkit-keyframes fa-beat-fade {
  0%, 100% {
    opacity: var(--fa-beat-fade-opacity, 0.4);
    -webkit-transform: scale(1);
            transform: scale(1);
  }
  50% {
    opacity: 1;
    -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));
            transform: scale(var(--fa-beat-fade-scale, 1.125));
  }
}
@keyframes fa-beat-fade {
  0%, 100% {
    opacity: var(--fa-beat-fade-opacity, 0.4);
    -webkit-transform: scale(1);
            transform: scale(1);
  }
  50% {
    opacity: 1;
    -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));
            transform: scale(var(--fa-beat-fade-scale, 1.125));
  }
}
@-webkit-keyframes fa-flip {
  50% {
    -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
            transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
  }
}
@keyframes fa-flip {
  50% {
    -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
            transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
  }
}
@-webkit-keyframes fa-shake {
  0% {
    -webkit-transform: rotate(-15deg);
            transform: rotate(-15deg);
  }
  4% {
    -webkit-transform: rotate(15deg);
            transform: rotate(15deg);
  }
  8%, 24% {
    -webkit-transform: rotate(-18deg);
            transform: rotate(-18deg);
  }
  12%, 28% {
    -webkit-transform: rotate(18deg);
            transform: rotate(18deg);
  }
  16% {
    -webkit-transform: rotate(-22deg);
            transform: rotate(-22deg);
  }
  20% {
    -webkit-transform: rotate(22deg);
            transform: rotate(22deg);
  }
  32% {
    -webkit-transform: rotate(-12deg);
            transform: rotate(-12deg);
  }
  36% {
    -webkit-transform: rotate(12deg);
            transform: rotate(12deg);
  }
  40%, 100% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
}
@keyframes fa-shake {
  0% {
    -webkit-transform: rotate(-15deg);
            transform: rotate(-15deg);
  }
  4% {
    -webkit-transform: rotate(15deg);
            transform: rotate(15deg);
  }
  8%, 24% {
    -webkit-transform: rotate(-18deg);
            transform: rotate(-18deg);
  }
  12%, 28% {
    -webkit-transform: rotate(18deg);
            transform: rotate(18deg);
  }
  16% {
    -webkit-transform: rotate(-22deg);
            transform: rotate(-22deg);
  }
  20% {
    -webkit-transform: rotate(22deg);
            transform: rotate(22deg);
  }
  32% {
    -webkit-transform: rotate(-12deg);
            transform: rotate(-12deg);
  }
  36% {
    -webkit-transform: rotate(12deg);
            transform: rotate(12deg);
  }
  40%, 100% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
}
@-webkit-keyframes fa-spin {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}
@keyframes fa-spin {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}
.fa-rotate-90 {
  -webkit-transform: rotate(90deg);
          transform: rotate(90deg);
}

.fa-rotate-180 {
  -webkit-transform: rotate(180deg);
          transform: rotate(180deg);
}

.fa-rotate-270 {
  -webkit-transform: rotate(270deg);
          transform: rotate(270deg);
}

.fa-flip-horizontal {
  -webkit-transform: scale(-1, 1);
          transform: scale(-1, 1);
}

.fa-flip-vertical {
  -webkit-transform: scale(1, -1);
          transform: scale(1, -1);
}

.fa-flip-both,
.fa-flip-horizontal.fa-flip-vertical {
  -webkit-transform: scale(-1, -1);
          transform: scale(-1, -1);
}

.fa-rotate-by {
  -webkit-transform: rotate(var(--fa-rotate-angle, none));
          transform: rotate(var(--fa-rotate-angle, none));
}

.fa-stack {
  display: inline-block;
  vertical-align: middle;
  height: 2em;
  position: relative;
  width: 2.5em;
}

.fa-stack-1x,
.fa-stack-2x {
  bottom: 0;
  left: 0;
  margin: auto;
  position: absolute;
  right: 0;
  top: 0;
  z-index: var(--fa-stack-z-index, auto);
}

.svg-inline--fa.fa-stack-1x {
  height: 1em;
  width: 1.25em;
}
.svg-inline--fa.fa-stack-2x {
  height: 2em;
  width: 2.5em;
}

.fa-inverse {
  color: var(--fa-inverse, #fff);
}

.sr-only,
.fa-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only-focusable:not(:focus),
.fa-sr-only-focusable:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.svg-inline--fa .fa-primary {
  fill: var(--fa-primary-color, currentColor);
  opacity: var(--fa-primary-opacity, 1);
}

.svg-inline--fa .fa-secondary {
  fill: var(--fa-secondary-color, currentColor);
  opacity: var(--fa-secondary-opacity, 0.4);
}

.svg-inline--fa.fa-swap-opacity .fa-primary {
  opacity: var(--fa-secondary-opacity, 0.4);
}

.svg-inline--fa.fa-swap-opacity .fa-secondary {
  opacity: var(--fa-primary-opacity, 1);
}

.svg-inline--fa mask .fa-primary,
.svg-inline--fa mask .fa-secondary {
  fill: black;
}

.fad.fa-inverse,
.fa-duotone.fa-inverse {
  color: var(--fa-inverse, #fff);
}`;
            function Lr() {
              var Be = qe, Qe = ke, ze = Rr.cssPrefix, rt = Rr.replacementClass, vt = Vr;
              if (ze !== Be || rt !== Qe) {
                var yt = new RegExp("\\.".concat(Be, "\\-"), "g"), Bt = new RegExp("\\--".concat(Be, "\\-"), "g"), ar = new RegExp("\\.".concat(Qe), "g");
                vt = vt.replace(yt, ".".concat(ze, "-")).replace(Bt, "--".concat(ze, "-")).replace(ar, ".".concat(rt));
              }
              return vt;
            }
            var pi = !1;
            function zr() {
              Rr.autoAddCss && !pi && (oi(Lr()), pi = !0);
            }
            var Cn = {
              mixout: function() {
                return {
                  dom: {
                    css: Lr,
                    insertCss: zr
                  }
                };
              },
              hooks: function() {
                return {
                  beforeDOMElementCreation: function() {
                    zr();
                  },
                  beforeI2svg: function() {
                    zr();
                  }
                };
              }
            }, Mi = _ || {};
            Mi[re] || (Mi[re] = {}), Mi[re].styles || (Mi[re].styles = {}), Mi[re].hooks || (Mi[re].hooks = {}), Mi[re].shims || (Mi[re].shims = []);
            var li = Mi[re], Xs = [], Ri = function Be() {
              G.removeEventListener("DOMContentLoaded", Be), j1 = 1, Xs.map(function(Qe) {
                return Qe();
              });
            }, j1 = !1;
            ae && (j1 = (G.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(G.readyState), j1 || G.addEventListener("DOMContentLoaded", Ri));
            function w1(Be) {
              ae && (j1 ? setTimeout(Be, 0) : Xs.push(Be));
            }
            function di(Be) {
              var Qe = Be.tag, ze = Be.attributes, rt = ze === void 0 ? {} : ze, vt = Be.children, yt = vt === void 0 ? [] : vt;
              return typeof Be == "string" ? it(Be) : "<".concat(Qe, " ").concat($t(rt), ">").concat(yt.map(di).join(""), "</").concat(Qe, ">");
            }
            function jf(Be, Qe, ze) {
              if (Be && Be[Qe] && Be[Qe][ze])
                return {
                  prefix: Qe,
                  iconName: ze,
                  icon: Be[Qe][ze]
                };
            }
            var B6 = function(Qe, ze) {
              return function(rt, vt, yt, Bt) {
                return Qe.call(ze, rt, vt, yt, Bt);
              };
            }, W6 = function(Qe, ze, rt, vt) {
              var yt = Object.keys(Qe), Bt = yt.length, ar = vt !== void 0 ? B6(ze, vt) : ze, Pr, Sn, cn;
              for (rt === void 0 ? (Pr = 1, cn = Qe[yt[0]]) : (Pr = 0, cn = rt); Pr < Bt; Pr++)
                Sn = yt[Pr], cn = ar(cn, Qe[Sn], Sn, Qe);
              return cn;
            };
            function S6(Be) {
              for (var Qe = [], ze = 0, rt = Be.length; ze < rt; ) {
                var vt = Be.charCodeAt(ze++);
                if (vt >= 55296 && vt <= 56319 && ze < rt) {
                  var yt = Be.charCodeAt(ze++);
                  (yt & 64512) == 56320 ? Qe.push(((vt & 1023) << 10) + (yt & 1023) + 65536) : (Qe.push(vt), ze--);
                } else
                  Qe.push(vt);
              }
              return Qe;
            }
            function qa(Be) {
              var Qe = S6(Be);
              return Qe.length === 1 ? Qe[0].toString(16) : null;
            }
            function m1(Be, Qe) {
              var ze = Be.length, rt = Be.charCodeAt(Qe), vt;
              return rt >= 55296 && rt <= 56319 && ze > Qe + 1 && (vt = Be.charCodeAt(Qe + 1), vt >= 56320 && vt <= 57343) ? (rt - 55296) * 1024 + vt - 56320 + 65536 : rt;
            }
            function Ho(Be) {
              return Object.keys(Be).reduce(function(Qe, ze) {
                var rt = Be[ze], vt = !!rt.icon;
                return vt ? Qe[rt.iconName] = rt.icon : Qe[ze] = rt, Qe;
              }, {});
            }
            function X9(Be, Qe) {
              var ze = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, rt = ze.skipHooks, vt = rt === void 0 ? !1 : rt, yt = Ho(Qe);
              typeof li.hooks.addPack == "function" && !vt ? li.hooks.addPack(Be, Ho(Qe)) : li.styles[Be] = v(v({}, li.styles[Be] || {}), yt), Be === "fas" && X9("fa", Qe);
            }
            var $o, T9, q9, wf = li.styles, mf = li.shims, B1 = ($o = {}, c($o, Qt, Object.values(Bn[Qt])), c($o, tr, Object.values(Bn[tr])), $o), h1 = null, U6 = {}, b9 = {}, J9 = {}, OA = {}, z1 = {}, Zd = (T9 = {}, c(T9, Qt, Object.keys(qr[Qt])), c(T9, tr, Object.keys(qr[tr])), T9);
            function Zr(Be) {
              return ~Sr.indexOf(Be);
            }
            function Ts(Be, Qe) {
              var ze = Qe.split("-"), rt = ze[0], vt = ze.slice(1).join("-");
              return rt === Be && vt !== "" && !Zr(vt) ? vt : null;
            }
            var go = function() {
              var Qe = function(yt) {
                return W6(wf, function(Bt, ar, Pr) {
                  return Bt[Pr] = W6(ar, yt, {}), Bt;
                }, {});
              };
              U6 = Qe(function(vt, yt, Bt) {
                if (yt[3] && (vt[yt[3]] = Bt), yt[2]) {
                  var ar = yt[2].filter(function(Pr) {
                    return typeof Pr == "number";
                  });
                  ar.forEach(function(Pr) {
                    vt[Pr.toString(16)] = Bt;
                  });
                }
                return vt;
              }), b9 = Qe(function(vt, yt, Bt) {
                if (vt[Bt] = Bt, yt[2]) {
                  var ar = yt[2].filter(function(Pr) {
                    return typeof Pr == "string";
                  });
                  ar.forEach(function(Pr) {
                    vt[Pr] = Bt;
                  });
                }
                return vt;
              }), z1 = Qe(function(vt, yt, Bt) {
                var ar = yt[2];
                return vt[Bt] = Bt, ar.forEach(function(Pr) {
                  vt[Pr] = Bt;
                }), vt;
              });
              var ze = "far" in wf || Rr.autoFetchSvg, rt = W6(mf, function(vt, yt) {
                var Bt = yt[0], ar = yt[1], Pr = yt[2];
                return ar === "far" && !ze && (ar = "fas"), typeof Bt == "string" && (vt.names[Bt] = {
                  prefix: ar,
                  iconName: Pr
                }), typeof Bt == "number" && (vt.unicodes[Bt.toString(16)] = {
                  prefix: ar,
                  iconName: Pr
                }), vt;
              }, {
                names: {},
                unicodes: {}
              });
              J9 = rt.names, OA = rt.unicodes, h1 = $i(Rr.styleDefault, {
                family: Rr.familyDefault
              });
            };
            is(function(Be) {
              h1 = $i(Be.styleDefault, {
                family: Rr.familyDefault
              });
            }), go();
            function G1(Be, Qe) {
              return (U6[Be] || {})[Qe];
            }
            function z9(Be, Qe) {
              return (b9[Be] || {})[Qe];
            }
            function Li(Be, Qe) {
              return (z1[Be] || {})[Qe];
            }
            function Fa(Be) {
              return J9[Be] || {
                prefix: null,
                iconName: null
              };
            }
            function Sa(Be) {
              var Qe = OA[Be], ze = G1("fas", Be);
              return Qe || (ze ? {
                prefix: "fas",
                iconName: ze
              } : null) || {
                prefix: null,
                iconName: null
              };
            }
            function Fn() {
              return h1;
            }
            var I6 = function() {
              return {
                prefix: null,
                iconName: null,
                rest: []
              };
            };
            function $i(Be) {
              var Qe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, ze = Qe.family, rt = ze === void 0 ? Qt : ze, vt = qr[rt][Be], yt = En[rt][Be] || En[rt][vt], Bt = Be in li.styles ? Be : null;
              return yt || Bt || null;
            }
            var Ga = (q9 = {}, c(q9, Qt, Object.keys(Bn[Qt])), c(q9, tr, Object.keys(Bn[tr])), q9);
            function e1(Be) {
              var Qe, ze = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, rt = ze.skipLookups, vt = rt === void 0 ? !1 : rt, yt = (Qe = {}, c(Qe, Qt, "".concat(Rr.cssPrefix, "-").concat(Qt)), c(Qe, tr, "".concat(Rr.cssPrefix, "-").concat(tr)), Qe), Bt = null, ar = Qt;
              (Be.includes(yt[Qt]) || Be.some(function(Sn) {
                return Ga[Qt].includes(Sn);
              })) && (ar = Qt), (Be.includes(yt[tr]) || Be.some(function(Sn) {
                return Ga[tr].includes(Sn);
              })) && (ar = tr);
              var Pr = Be.reduce(function(Sn, cn) {
                var Gn = Ts(Rr.cssPrefix, cn);
                if (wf[cn] ? (cn = B1[ar].includes(cn) ? Fi[ar][cn] : cn, Bt = cn, Sn.prefix = cn) : Zd[ar].indexOf(cn) > -1 ? (Bt = cn, Sn.prefix = $i(cn, {
                  family: ar
                })) : Gn ? Sn.iconName = Gn : cn !== Rr.replacementClass && cn !== yt[Qt] && cn !== yt[tr] && Sn.rest.push(cn), !vt && Sn.prefix && Sn.iconName) {
                  var es = Bt === "fa" ? Fa(Sn.iconName) : {}, Ys = Li(Sn.prefix, Sn.iconName);
                  es.prefix && (Bt = null), Sn.iconName = es.iconName || Ys || Sn.iconName, Sn.prefix = es.prefix || Sn.prefix, Sn.prefix === "far" && !wf.far && wf.fas && !Rr.autoFetchSvg && (Sn.prefix = "fas");
                }
                return Sn;
              }, I6());
              return (Be.includes("fa-brands") || Be.includes("fab")) && (Pr.prefix = "fab"), (Be.includes("fa-duotone") || Be.includes("fad")) && (Pr.prefix = "fad"), !Pr.prefix && ar === tr && (wf.fass || Rr.autoFetchSvg) && (Pr.prefix = "fass", Pr.iconName = Li(Pr.prefix, Pr.iconName) || Pr.iconName), (Pr.prefix === "fa" || Bt === "fa") && (Pr.prefix = Fn() || "fas"), Pr;
            }
            var Lf = /* @__PURE__ */ function() {
              function Be() {
                l(this, Be), this.definitions = {};
              }
              return p(Be, [{
                key: "add",
                value: function() {
                  for (var ze = this, rt = arguments.length, vt = new Array(rt), yt = 0; yt < rt; yt++)
                    vt[yt] = arguments[yt];
                  var Bt = vt.reduce(this._pullDefinitions, {});
                  Object.keys(Bt).forEach(function(ar) {
                    ze.definitions[ar] = v(v({}, ze.definitions[ar] || {}), Bt[ar]), X9(ar, Bt[ar]);
                    var Pr = Bn[Qt][ar];
                    Pr && X9(Pr, Bt[ar]), go();
                  });
                }
              }, {
                key: "reset",
                value: function() {
                  this.definitions = {};
                }
              }, {
                key: "_pullDefinitions",
                value: function(ze, rt) {
                  var vt = rt.prefix && rt.iconName && rt.icon ? {
                    0: rt
                  } : rt;
                  return Object.keys(vt).map(function(yt) {
                    var Bt = vt[yt], ar = Bt.prefix, Pr = Bt.iconName, Sn = Bt.icon, cn = Sn[2];
                    ze[ar] || (ze[ar] = {}), cn.length > 0 && cn.forEach(function(Gn) {
                      typeof Gn == "string" && (ze[ar][Gn] = Sn);
                    }), ze[ar][Pr] = Sn;
                  }), ze;
                }
              }]), Be;
            }(), Ua = [], vs = {}, R6 = {}, Bf = Object.keys(R6);
            function Ie(Be, Qe) {
              var ze = Qe.mixoutsTo;
              return Ua = Be, vs = {}, Object.keys(R6).forEach(function(rt) {
                Bf.indexOf(rt) === -1 && delete R6[rt];
              }), Ua.forEach(function(rt) {
                var vt = rt.mixout ? rt.mixout() : {};
                if (Object.keys(vt).forEach(function(Bt) {
                  typeof vt[Bt] == "function" && (ze[Bt] = vt[Bt]), u(vt[Bt]) === "object" && Object.keys(vt[Bt]).forEach(function(ar) {
                    ze[Bt] || (ze[Bt] = {}), ze[Bt][ar] = vt[Bt][ar];
                  });
                }), rt.hooks) {
                  var yt = rt.hooks();
                  Object.keys(yt).forEach(function(Bt) {
                    vs[Bt] || (vs[Bt] = []), vs[Bt].push(yt[Bt]);
                  });
                }
                rt.provides && rt.provides(R6);
              }), ze;
            }
            function Pt(Be, Qe) {
              for (var ze = arguments.length, rt = new Array(ze > 2 ? ze - 2 : 0), vt = 2; vt < ze; vt++)
                rt[vt - 2] = arguments[vt];
              var yt = vs[Be] || [];
              return yt.forEach(function(Bt) {
                Qe = Bt.apply(null, [Qe].concat(rt));
              }), Qe;
            }
            function Et(Be) {
              for (var Qe = arguments.length, ze = new Array(Qe > 1 ? Qe - 1 : 0), rt = 1; rt < Qe; rt++)
                ze[rt - 1] = arguments[rt];
              var vt = vs[Be] || [];
              vt.forEach(function(yt) {
                yt.apply(null, ze);
              });
            }
            function er() {
              var Be = arguments[0], Qe = Array.prototype.slice.call(arguments, 1);
              return R6[Be] ? R6[Be].apply(null, Qe) : void 0;
            }
            function _r(Be) {
              Be.prefix === "fa" && (Be.prefix = "fas");
              var Qe = Be.iconName, ze = Be.prefix || Fn();
              if (Qe)
                return Qe = Li(ze, Qe) || Qe, jf(Xi.definitions, ze, Qe) || jf(li.styles, ze, Qe);
            }
            var Xi = new Lf(), Mn = function() {
              Rr.autoReplaceSvg = !1, Rr.observeMutations = !1, Et("noAuto");
            }, _n = {
              i2svg: function() {
                var Qe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                return ae ? (Et("beforeI2svg", Qe), er("pseudoElements2svg", Qe), er("i2svg", Qe)) : Promise.reject("Operation requires a DOM of some kind.");
              },
              watch: function() {
                var Qe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, ze = Qe.autoReplaceSvgRoot;
                Rr.autoReplaceSvg === !1 && (Rr.autoReplaceSvg = !0), Rr.observeMutations = !0, w1(function() {
                  Gs({
                    autoReplaceSvgRoot: ze
                  }), Et("watch", Qe);
                });
              }
            }, Ps = {
              icon: function(Qe) {
                if (Qe === null)
                  return null;
                if (u(Qe) === "object" && Qe.prefix && Qe.iconName)
                  return {
                    prefix: Qe.prefix,
                    iconName: Li(Qe.prefix, Qe.iconName) || Qe.iconName
                  };
                if (Array.isArray(Qe) && Qe.length === 2) {
                  var ze = Qe[1].indexOf("fa-") === 0 ? Qe[1].slice(3) : Qe[1], rt = $i(Qe[0]);
                  return {
                    prefix: rt,
                    iconName: Li(rt, ze) || ze
                  };
                }
                if (typeof Qe == "string" && (Qe.indexOf("".concat(Rr.cssPrefix, "-")) > -1 || Qe.match(Gt))) {
                  var vt = e1(Qe.split(" "), {
                    skipLookups: !0
                  });
                  return {
                    prefix: vt.prefix || Fn(),
                    iconName: Li(vt.prefix, vt.iconName) || vt.iconName
                  };
                }
                if (typeof Qe == "string") {
                  var yt = Fn();
                  return {
                    prefix: yt,
                    iconName: Li(yt, Qe) || Qe
                  };
                }
              }
            }, qi = {
              noAuto: Mn,
              config: Rr,
              dom: _n,
              parse: Ps,
              library: Xi,
              findIconDefinition: _r,
              toHtml: di
            }, Gs = function() {
              var Qe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, ze = Qe.autoReplaceSvgRoot, rt = ze === void 0 ? G : ze;
              (Object.keys(li.styles).length > 0 || Rr.autoFetchSvg) && ae && Rr.autoReplaceSvg && qi.dom.i2svg({
                node: rt
              });
            };
            function ks(Be, Qe) {
              return Object.defineProperty(Be, "abstract", {
                get: Qe
              }), Object.defineProperty(Be, "html", {
                get: function() {
                  return Be.abstract.map(function(rt) {
                    return di(rt);
                  });
                }
              }), Object.defineProperty(Be, "node", {
                get: function() {
                  if (ae) {
                    var rt = G.createElement("div");
                    return rt.innerHTML = Be.html, rt.children;
                  }
                }
              }), Be;
            }
            function Na(Be) {
              var Qe = Be.children, ze = Be.main, rt = Be.mask, vt = Be.attributes, yt = Be.styles, Bt = Be.transform;
              if ($e(Bt) && ze.found && !rt.found) {
                var ar = ze.width, Pr = ze.height, Sn = {
                  x: ar / Pr / 2,
                  y: 0.5
                };
                vt.style = Ur(v(v({}, yt), {}, {
                  "transform-origin": "".concat(Sn.x + Bt.x / 16, "em ").concat(Sn.y + Bt.y / 16, "em")
                }));
              }
              return [{
                tag: "svg",
                attributes: vt,
                children: Qe
              }];
            }
            function Ao(Be) {
              var Qe = Be.prefix, ze = Be.iconName, rt = Be.children, vt = Be.attributes, yt = Be.symbol, Bt = yt === !0 ? "".concat(Qe, "-").concat(Rr.cssPrefix, "-").concat(ze) : yt;
              return [{
                tag: "svg",
                attributes: {
                  style: "display: none;"
                },
                children: [{
                  tag: "symbol",
                  attributes: v(v({}, vt), {}, {
                    id: Bt
                  }),
                  children: rt
                }]
              }];
            }
            function Ro(Be) {
              var Qe = Be.icons, ze = Qe.main, rt = Qe.mask, vt = Be.prefix, yt = Be.iconName, Bt = Be.transform, ar = Be.symbol, Pr = Be.title, Sn = Be.maskId, cn = Be.titleId, Gn = Be.extra, es = Be.watchable, Ys = es === void 0 ? !1 : es, S1 = rt.found ? rt : ze, ia = S1.width, x9 = S1.height, Jf = vt === "fak", Vo = [Rr.replacementClass, yt ? "".concat(Rr.cssPrefix, "-").concat(yt) : ""].filter(function(kA) {
                return Gn.classes.indexOf(kA) === -1;
              }).filter(function(kA) {
                return kA !== "" || !!kA;
              }).concat(Gn.classes).join(" "), U1 = {
                children: [],
                attributes: v(v({}, Gn.attributes), {}, {
                  "data-prefix": vt,
                  "data-icon": yt,
                  class: Vo,
                  role: Gn.attributes.role || "img",
                  xmlns: "http://www.w3.org/2000/svg",
                  viewBox: "0 0 ".concat(ia, " ").concat(x9)
                })
              }, vA = Jf && !~Gn.classes.indexOf("fa-fw") ? {
                width: "".concat(ia / x9 * 16 * 0.0625, "em")
              } : {};
              Ys && (U1.attributes[be] = ""), Pr && (U1.children.push({
                tag: "title",
                attributes: {
                  id: U1.attributes["aria-labelledby"] || "title-".concat(cn || Fr())
                },
                children: [Pr]
              }), delete U1.attributes.title);
              var Wf = v(v({}, U1), {}, {
                prefix: vt,
                iconName: yt,
                main: ze,
                mask: rt,
                maskId: Sn,
                transform: Bt,
                symbol: ar,
                styles: v(v({}, vA), Gn.styles)
              }), _1 = rt.found && ze.found ? er("generateAbstractMask", Wf) || {
                children: [],
                attributes: {}
              } : er("generateAbstractIcon", Wf) || {
                children: [],
                attributes: {}
              }, $1 = _1.children, D9 = _1.attributes;
              return Wf.children = $1, Wf.attributes = D9, ar ? Ao(Wf) : Na(Wf);
            }
            function oA(Be) {
              var Qe = Be.content, ze = Be.width, rt = Be.height, vt = Be.transform, yt = Be.title, Bt = Be.extra, ar = Be.watchable, Pr = ar === void 0 ? !1 : ar, Sn = v(v(v({}, Bt.attributes), yt ? {
                title: yt
              } : {}), {}, {
                class: Bt.classes.join(" ")
              });
              Pr && (Sn[be] = "");
              var cn = v({}, Bt.styles);
              $e(vt) && (cn.transform = cr({
                transform: vt,
                startCentered: !0,
                width: ze,
                height: rt
              }), cn["-webkit-transform"] = cn.transform);
              var Gn = Ur(cn);
              Gn.length > 0 && (Sn.style = Gn);
              var es = [];
              return es.push({
                tag: "span",
                attributes: Sn,
                children: [Qe]
              }), yt && es.push({
                tag: "span",
                attributes: {
                  class: "sr-only"
                },
                children: [yt]
              }), es;
            }
            function W1(Be) {
              var Qe = Be.content, ze = Be.title, rt = Be.extra, vt = v(v(v({}, rt.attributes), ze ? {
                title: ze
              } : {}), {}, {
                class: rt.classes.join(" ")
              }), yt = Ur(rt.styles);
              yt.length > 0 && (vt.style = yt);
              var Bt = [];
              return Bt.push({
                tag: "span",
                attributes: vt,
                children: [Qe]
              }), ze && Bt.push({
                tag: "span",
                attributes: {
                  class: "sr-only"
                },
                children: [ze]
              }), Bt;
            }
            var je = li.styles;
            function dt(Be) {
              var Qe = Be[0], ze = Be[1], rt = Be.slice(4), vt = H(rt, 1), yt = vt[0], Bt = null;
              return Array.isArray(yt) ? Bt = {
                tag: "g",
                attributes: {
                  class: "".concat(Rr.cssPrefix, "-").concat(Wn.GROUP)
                },
                children: [{
                  tag: "path",
                  attributes: {
                    class: "".concat(Rr.cssPrefix, "-").concat(Wn.SECONDARY),
                    fill: "currentColor",
                    d: yt[0]
                  }
                }, {
                  tag: "path",
                  attributes: {
                    class: "".concat(Rr.cssPrefix, "-").concat(Wn.PRIMARY),
                    fill: "currentColor",
                    d: yt[1]
                  }
                }]
              } : Bt = {
                tag: "path",
                attributes: {
                  fill: "currentColor",
                  d: yt
                }
              }, {
                found: !0,
                width: Qe,
                height: ze,
                icon: Bt
              };
            }
            var kt = {
              found: !1,
              width: 512,
              height: 512
            };
            function _t(Be, Qe) {
              !lr && !Rr.showMissingIcons && Be && console.error('Icon with name "'.concat(Be, '" and prefix "').concat(Qe, '" is missing.'));
            }
            function Cr(Be, Qe) {
              var ze = Qe;
              return Qe === "fa" && Rr.styleDefault !== null && (Qe = Fn()), new Promise(function(rt, vt) {
                if (er("missingIconAbstract"), ze === "fa") {
                  var yt = Fa(Be) || {};
                  Be = yt.iconName || Be, Qe = yt.prefix || Qe;
                }
                if (Be && Qe && je[Qe] && je[Qe][Be]) {
                  var Bt = je[Qe][Be];
                  return rt(dt(Bt));
                }
                _t(Be, Qe), rt(v(v({}, kt), {}, {
                  icon: Rr.showMissingIcons && Be ? er("missingIconAbstract") || {} : {}
                }));
              });
            }
            var fi = function() {
            }, on = Rr.measurePerformance && $ && $.mark && $.measure ? $ : {
              mark: fi,
              measure: fi
            }, si = 'FA "6.4.2"', ss = function(Qe) {
              return on.mark("".concat(si, " ").concat(Qe, " begins")), function() {
                return hs(Qe);
              };
            }, hs = function(Qe) {
              on.mark("".concat(si, " ").concat(Qe, " ends")), on.measure("".concat(si, " ").concat(Qe), "".concat(si, " ").concat(Qe, " begins"), "".concat(si, " ").concat(Qe, " ends"));
            }, js = {
              begin: ss,
              end: hs
            }, ws = function() {
            };
            function Zs(Be) {
              var Qe = Be.getAttribute ? Be.getAttribute(be) : null;
              return typeof Qe == "string";
            }
            function Ia(Be) {
              var Qe = Be.getAttribute ? Be.getAttribute(nt) : null, ze = Be.getAttribute ? Be.getAttribute(ut) : null;
              return Qe && ze;
            }
            function cs(Be) {
              return Be && Be.classList && Be.classList.contains && Be.classList.contains(Rr.replacementClass);
            }
            function ud() {
              if (Rr.autoReplaceSvg === !0)
                return ld.replace;
              var Be = ld[Rr.autoReplaceSvg];
              return Be || ld.replace;
            }
            function Lv(Be) {
              return G.createElementNS("http://www.w3.org/2000/svg", Be);
            }
            function Kv(Be) {
              return G.createElement(Be);
            }
            function $l(Be) {
              var Qe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, ze = Qe.ceFn, rt = ze === void 0 ? Be.tag === "svg" ? Lv : Kv : ze;
              if (typeof Be == "string")
                return G.createTextNode(Be);
              var vt = rt(Be.tag);
              Object.keys(Be.attributes || []).forEach(function(Bt) {
                vt.setAttribute(Bt, Be.attributes[Bt]);
              });
              var yt = Be.children || [];
              return yt.forEach(function(Bt) {
                vt.appendChild($l(Bt, {
                  ceFn: rt
                }));
              }), vt;
            }
            function V6(Be) {
              var Qe = " ".concat(Be.outerHTML, " ");
              return Qe = "".concat(Qe, "Font Awesome fontawesome.com "), Qe;
            }
            var ld = {
              replace: function(Qe) {
                var ze = Qe[0];
                if (ze.parentNode)
                  if (Qe[1].forEach(function(vt) {
                    ze.parentNode.insertBefore($l(vt), ze);
                  }), ze.getAttribute(be) === null && Rr.keepOriginalSource) {
                    var rt = G.createComment(V6(ze));
                    ze.parentNode.replaceChild(rt, ze);
                  } else
                    ze.remove();
              },
              nest: function(Qe) {
                var ze = Qe[0], rt = Qe[1];
                if (~ds(ze).indexOf(Rr.replacementClass))
                  return ld.replace(Qe);
                var vt = new RegExp("".concat(Rr.cssPrefix, "-.*"));
                if (delete rt[0].attributes.id, rt[0].attributes.class) {
                  var yt = rt[0].attributes.class.split(" ").reduce(function(ar, Pr) {
                    return Pr === Rr.replacementClass || Pr.match(vt) ? ar.toSvg.push(Pr) : ar.toNode.push(Pr), ar;
                  }, {
                    toNode: [],
                    toSvg: []
                  });
                  rt[0].attributes.class = yt.toSvg.join(" "), yt.toNode.length === 0 ? ze.removeAttribute("class") : ze.setAttribute("class", yt.toNode.join(" "));
                }
                var Bt = rt.map(function(ar) {
                  return di(ar);
                }).join(`
`);
                ze.setAttribute(be, ""), ze.innerHTML = Bt;
              }
            };
            function Jv(Be) {
              Be();
            }
            function zv(Be, Qe) {
              var ze = typeof Qe == "function" ? Qe : ws;
              if (Be.length === 0)
                ze();
              else {
                var rt = Jv;
                Rr.mutateApproach === wt && (rt = _.requestAnimationFrame || Jv), rt(function() {
                  var vt = ud(), yt = js.begin("mutate");
                  Be.map(vt), yt(), ze();
                });
              }
            }
            var Wc = !1;
            function Sc() {
              Wc = !0;
            }
            function Gv() {
              Wc = !1;
            }
            var _d = null;
            function eP(Be) {
              if (L && Rr.observeMutations) {
                var Qe = Be.treeCallback, ze = Qe === void 0 ? ws : Qe, rt = Be.nodeCallback, vt = rt === void 0 ? ws : rt, yt = Be.pseudoElementsCallback, Bt = yt === void 0 ? ws : yt, ar = Be.observeMutationsRoot, Pr = ar === void 0 ? G : ar;
                _d = new L(function(Sn) {
                  if (!Wc) {
                    var cn = Fn();
                    pr(Sn).forEach(function(Gn) {
                      if (Gn.type === "childList" && Gn.addedNodes.length > 0 && !Zs(Gn.addedNodes[0]) && (Rr.searchPseudoElements && Bt(Gn.target), ze(Gn.target)), Gn.type === "attributes" && Gn.target.parentNode && Rr.searchPseudoElements && Bt(Gn.target.parentNode), Gn.type === "attributes" && Zs(Gn.target) && ~an.indexOf(Gn.attributeName))
                        if (Gn.attributeName === "class" && Ia(Gn.target)) {
                          var es = e1(ds(Gn.target)), Ys = es.prefix, S1 = es.iconName;
                          Gn.target.setAttribute(nt, Ys || cn), S1 && Gn.target.setAttribute(ut, S1);
                        } else
                          cs(Gn.target) && vt(Gn.target);
                    });
                  }
                }), ae && _d.observe(Pr, {
                  childList: !0,
                  attributes: !0,
                  characterData: !0,
                  subtree: !0
                });
              }
            }
            function J0() {
              _d && _d.disconnect();
            }
            function Nu(Be) {
              var Qe = Be.getAttribute("style"), ze = [];
              return Qe && (ze = Qe.split(";").reduce(function(rt, vt) {
                var yt = vt.split(":"), Bt = yt[0], ar = yt.slice(1);
                return Bt && ar.length > 0 && (rt[Bt] = ar.join(":").trim()), rt;
              }, {})), ze;
            }
            function Uc(Be) {
              var Qe = Be.getAttribute("data-prefix"), ze = Be.getAttribute("data-icon"), rt = Be.innerText !== void 0 ? Be.innerText.trim() : "", vt = e1(ds(Be));
              return vt.prefix || (vt.prefix = Fn()), Qe && ze && (vt.prefix = Qe, vt.iconName = ze), vt.iconName && vt.prefix || (vt.prefix && rt.length > 0 && (vt.iconName = z9(vt.prefix, Be.innerText) || G1(vt.prefix, qa(Be.innerText))), !vt.iconName && Rr.autoFetchSvg && Be.firstChild && Be.firstChild.nodeType === Node.TEXT_NODE && (vt.iconName = Be.firstChild.data)), vt;
            }
            function t1(Be) {
              var Qe = pr(Be.attributes).reduce(function(vt, yt) {
                return vt.name !== "class" && vt.name !== "style" && (vt[yt.name] = yt.value), vt;
              }, {}), ze = Be.getAttribute("title"), rt = Be.getAttribute("data-fa-title-id");
              return Rr.autoA11y && (ze ? Qe["aria-labelledby"] = "".concat(Rr.replacementClass, "-title-").concat(rt || Fr()) : (Qe["aria-hidden"] = "true", Qe.focusable = "false")), Qe;
            }
            function Pd() {
              return {
                iconName: null,
                title: null,
                titleId: null,
                prefix: null,
                transform: _i,
                symbol: !1,
                mask: {
                  iconName: null,
                  prefix: null,
                  rest: []
                },
                maskId: null,
                extra: {
                  classes: [],
                  styles: {},
                  attributes: {}
                }
              };
            }
            function Z1(Be) {
              var Qe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
                styleParser: !0
              }, ze = Uc(Be), rt = ze.iconName, vt = ze.prefix, yt = ze.rest, Bt = t1(Be), ar = Pt("parseNodeAttributes", {}, Be), Pr = Qe.styleParser ? Nu(Be) : [];
              return v({
                iconName: rt,
                title: Be.getAttribute("title"),
                titleId: Be.getAttribute("data-fa-title-id"),
                prefix: vt,
                transform: _i,
                mask: {
                  iconName: null,
                  prefix: null,
                  rest: []
                },
                maskId: null,
                symbol: !1,
                extra: {
                  classes: yt,
                  styles: Pr,
                  attributes: Bt
                }
              }, ar);
            }
            var fA = li.styles;
            function tP(Be) {
              var Qe = Rr.autoReplaceSvg === "nest" ? Z1(Be, {
                styleParser: !1
              }) : Z1(Be);
              return ~Qe.extra.classes.indexOf(xr) ? er("generateLayersText", Be, Qe) : er("generateSvgReplacementMutation", Be, Qe);
            }
            var AA = /* @__PURE__ */ new Set();
            br.map(function(Be) {
              AA.add("fa-".concat(Be));
            }), Object.keys(qr[Qt]).map(AA.add.bind(AA)), Object.keys(qr[tr]).map(AA.add.bind(AA)), AA = T(AA);
            function rP(Be) {
              var Qe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
              if (!ae)
                return Promise.resolve();
              var ze = G.documentElement.classList, rt = function(Gn) {
                return ze.add("".concat(bt, "-").concat(Gn));
              }, vt = function(Gn) {
                return ze.remove("".concat(bt, "-").concat(Gn));
              }, yt = Rr.autoFetchSvg ? AA : br.map(function(cn) {
                return "fa-".concat(cn);
              }).concat(Object.keys(fA));
              yt.includes("fa") || yt.push("fa");
              var Bt = [".".concat(xr, ":not([").concat(be, "])")].concat(yt.map(function(cn) {
                return ".".concat(cn, ":not([").concat(be, "])");
              })).join(", ");
              if (Bt.length === 0)
                return Promise.resolve();
              var ar = [];
              try {
                ar = pr(Be.querySelectorAll(Bt));
              } catch {
              }
              if (ar.length > 0)
                rt("pending"), vt("complete");
              else
                return Promise.resolve();
              var Pr = js.begin("onTree"), Sn = ar.reduce(function(cn, Gn) {
                try {
                  var es = tP(Gn);
                  es && cn.push(es);
                } catch (Ys) {
                  lr || Ys.name === "MissingIcon" && console.error(Ys);
                }
                return cn;
              }, []);
              return new Promise(function(cn, Gn) {
                Promise.all(Sn).then(function(es) {
                  zv(es, function() {
                    rt("active"), rt("complete"), vt("pending"), typeof Qe == "function" && Qe(), Pr(), cn();
                  });
                }).catch(function(es) {
                  Pr(), Gn(es);
                });
              });
            }
            function Qu(Be) {
              var Qe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
              tP(Be).then(function(ze) {
                ze && zv([ze], Qe);
              });
            }
            function Kf(Be) {
              return function(Qe) {
                var ze = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, rt = (Qe || {}).icon ? Qe : _r(Qe || {}), vt = ze.mask;
                return vt && (vt = (vt || {}).icon ? vt : _r(vt || {})), Be(rt, v(v({}, ze), {}, {
                  mask: vt
                }));
              };
            }
            var cd = function(Qe) {
              var ze = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, rt = ze.transform, vt = rt === void 0 ? _i : rt, yt = ze.symbol, Bt = yt === void 0 ? !1 : yt, ar = ze.mask, Pr = ar === void 0 ? null : ar, Sn = ze.maskId, cn = Sn === void 0 ? null : Sn, Gn = ze.title, es = Gn === void 0 ? null : Gn, Ys = ze.titleId, S1 = Ys === void 0 ? null : Ys, ia = ze.classes, x9 = ia === void 0 ? [] : ia, Jf = ze.attributes, Vo = Jf === void 0 ? {} : Jf, U1 = ze.styles, vA = U1 === void 0 ? {} : U1;
              if (Qe) {
                var Wf = Qe.prefix, _1 = Qe.iconName, $1 = Qe.icon;
                return ks(v({
                  type: "icon"
                }, Qe), function() {
                  return Et("beforeDOMElementCreation", {
                    iconDefinition: Qe,
                    params: ze
                  }), Rr.autoA11y && (es ? Vo["aria-labelledby"] = "".concat(Rr.replacementClass, "-title-").concat(S1 || Fr()) : (Vo["aria-hidden"] = "true", Vo.focusable = "false")), Ro({
                    icons: {
                      main: dt($1),
                      mask: Pr ? dt(Pr.icon) : {
                        found: !1,
                        width: null,
                        height: null,
                        icon: {}
                      }
                    },
                    prefix: Wf,
                    iconName: _1,
                    transform: v(v({}, _i), vt),
                    symbol: Bt,
                    title: es,
                    maskId: cn,
                    titleId: S1,
                    extra: {
                      attributes: Vo,
                      styles: vA,
                      classes: x9
                    }
                  });
                });
              }
            }, Xo = {
              mixout: function() {
                return {
                  icon: Kf(cd)
                };
              },
              hooks: function() {
                return {
                  mutationObserverCallbacks: function(ze) {
                    return ze.treeCallback = rP, ze.nodeCallback = Qu, ze;
                  }
                };
              },
              provides: function(Qe) {
                Qe.i2svg = function(ze) {
                  var rt = ze.node, vt = rt === void 0 ? G : rt, yt = ze.callback, Bt = yt === void 0 ? function() {
                  } : yt;
                  return rP(vt, Bt);
                }, Qe.generateSvgReplacementMutation = function(ze, rt) {
                  var vt = rt.iconName, yt = rt.title, Bt = rt.titleId, ar = rt.prefix, Pr = rt.transform, Sn = rt.symbol, cn = rt.mask, Gn = rt.maskId, es = rt.extra;
                  return new Promise(function(Ys, S1) {
                    Promise.all([Cr(vt, ar), cn.iconName ? Cr(cn.iconName, cn.prefix) : Promise.resolve({
                      found: !1,
                      width: 512,
                      height: 512,
                      icon: {}
                    })]).then(function(ia) {
                      var x9 = H(ia, 2), Jf = x9[0], Vo = x9[1];
                      Ys([ze, Ro({
                        icons: {
                          main: Jf,
                          mask: Vo
                        },
                        prefix: ar,
                        iconName: vt,
                        transform: Pr,
                        symbol: Sn,
                        maskId: Gn,
                        title: yt,
                        titleId: Bt,
                        extra: es,
                        watchable: !0
                      })]);
                    }).catch(S1);
                  });
                }, Qe.generateAbstractIcon = function(ze) {
                  var rt = ze.children, vt = ze.attributes, yt = ze.main, Bt = ze.transform, ar = ze.styles, Pr = Ur(ar);
                  Pr.length > 0 && (vt.style = Pr);
                  var Sn;
                  return $e(Bt) && (Sn = er("generateAbstractTransformGrouping", {
                    main: yt,
                    transform: Bt,
                    containerWidth: yt.width,
                    iconWidth: yt.width
                  })), rt.push(Sn || yt.icon), {
                    children: rt,
                    attributes: vt
                  };
                };
              }
            }, C6 = {
              mixout: function() {
                return {
                  layer: function(ze) {
                    var rt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, vt = rt.classes, yt = vt === void 0 ? [] : vt;
                    return ks({
                      type: "layer"
                    }, function() {
                      Et("beforeDOMElementCreation", {
                        assembler: ze,
                        params: rt
                      });
                      var Bt = [];
                      return ze(function(ar) {
                        Array.isArray(ar) ? ar.map(function(Pr) {
                          Bt = Bt.concat(Pr.abstract);
                        }) : Bt = Bt.concat(ar.abstract);
                      }), [{
                        tag: "span",
                        attributes: {
                          class: ["".concat(Rr.cssPrefix, "-layers")].concat(T(yt)).join(" ")
                        },
                        children: Bt
                      }];
                    });
                  }
                };
              }
            }, Zv = {
              mixout: function() {
                return {
                  counter: function(ze) {
                    var rt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, vt = rt.title, yt = vt === void 0 ? null : vt, Bt = rt.classes, ar = Bt === void 0 ? [] : Bt, Pr = rt.attributes, Sn = Pr === void 0 ? {} : Pr, cn = rt.styles, Gn = cn === void 0 ? {} : cn;
                    return ks({
                      type: "counter",
                      content: ze
                    }, function() {
                      return Et("beforeDOMElementCreation", {
                        content: ze,
                        params: rt
                      }), W1({
                        content: ze.toString(),
                        title: yt,
                        extra: {
                          attributes: Sn,
                          styles: Gn,
                          classes: ["".concat(Rr.cssPrefix, "-layers-counter")].concat(T(ar))
                        }
                      });
                    });
                  }
                };
              }
            }, nP = {
              mixout: function() {
                return {
                  text: function(ze) {
                    var rt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, vt = rt.transform, yt = vt === void 0 ? _i : vt, Bt = rt.title, ar = Bt === void 0 ? null : Bt, Pr = rt.classes, Sn = Pr === void 0 ? [] : Pr, cn = rt.attributes, Gn = cn === void 0 ? {} : cn, es = rt.styles, Ys = es === void 0 ? {} : es;
                    return ks({
                      type: "text",
                      content: ze
                    }, function() {
                      return Et("beforeDOMElementCreation", {
                        content: ze,
                        params: rt
                      }), oA({
                        content: ze,
                        transform: v(v({}, _i), yt),
                        title: ar,
                        extra: {
                          attributes: Gn,
                          styles: Ys,
                          classes: ["".concat(Rr.cssPrefix, "-layers-text")].concat(T(Sn))
                        }
                      });
                    });
                  }
                };
              },
              provides: function(Qe) {
                Qe.generateLayersText = function(ze, rt) {
                  var vt = rt.title, yt = rt.transform, Bt = rt.extra, ar = null, Pr = null;
                  if (Pe) {
                    var Sn = parseInt(getComputedStyle(ze).fontSize, 10), cn = ze.getBoundingClientRect();
                    ar = cn.width / Sn, Pr = cn.height / Sn;
                  }
                  return Rr.autoA11y && !vt && (Bt.attributes["aria-hidden"] = "true"), Promise.resolve([ze, oA({
                    content: ze.innerHTML,
                    width: ar,
                    height: Pr,
                    transform: yt,
                    title: vt,
                    extra: Bt,
                    watchable: !0
                  })]);
                };
              }
            }, mp = new RegExp('"', "ug"), $d = [1105920, 1112319];
            function z0(Be) {
              var Qe = Be.replace(mp, ""), ze = m1(Qe, 0), rt = ze >= $d[0] && ze <= $d[1], vt = Qe.length === 2 ? Qe[0] === Qe[1] : !1;
              return {
                value: qa(vt ? Qe[0] : Qe),
                isSecondary: rt || vt
              };
            }
            function Ic(Be, Qe) {
              var ze = "".concat(Ke).concat(Qe.replace(":", "-"));
              return new Promise(function(rt, vt) {
                if (Be.getAttribute(ze) !== null)
                  return rt();
                var yt = pr(Be.children), Bt = yt.filter(function($1) {
                  return $1.getAttribute(Fe) === Qe;
                })[0], ar = _.getComputedStyle(Be, Qe), Pr = ar.getPropertyValue("font-family").match(Br), Sn = ar.getPropertyValue("font-weight"), cn = ar.getPropertyValue("content");
                if (Bt && !Pr)
                  return Be.removeChild(Bt), rt();
                if (Pr && cn !== "none" && cn !== "") {
                  var Gn = ar.getPropertyValue("content"), es = ~["Sharp"].indexOf(Pr[2]) ? tr : Qt, Ys = ~["Solid", "Regular", "Light", "Thin", "Duotone", "Brands", "Kit"].indexOf(Pr[2]) ? En[es][Pr[2].toLowerCase()] : nn[es][Sn], S1 = z0(Gn), ia = S1.value, x9 = S1.isSecondary, Jf = Pr[0].startsWith("FontAwesome"), Vo = G1(Ys, ia), U1 = Vo;
                  if (Jf) {
                    var vA = Sa(ia);
                    vA.iconName && vA.prefix && (Vo = vA.iconName, Ys = vA.prefix);
                  }
                  if (Vo && !x9 && (!Bt || Bt.getAttribute(nt) !== Ys || Bt.getAttribute(ut) !== U1)) {
                    Be.setAttribute(ze, U1), Bt && Be.removeChild(Bt);
                    var Wf = Pd(), _1 = Wf.extra;
                    _1.attributes[Fe] = Qe, Cr(Vo, Ys).then(function($1) {
                      var D9 = Ro(v(v({}, Wf), {}, {
                        icons: {
                          main: $1,
                          mask: I6()
                        },
                        prefix: Ys,
                        iconName: U1,
                        extra: _1,
                        watchable: !0
                      })), kA = G.createElementNS("http://www.w3.org/2000/svg", "svg");
                      Qe === "::before" ? Be.insertBefore(kA, Be.firstChild) : Be.appendChild(kA), kA.outerHTML = D9.map(function(oP) {
                        return di(oP);
                      }).join(`
`), Be.removeAttribute(ze), rt();
                    }).catch(vt);
                  } else
                    rt();
                } else
                  rt();
              });
            }
            function iP(Be) {
              return Promise.all([Ic(Be, "::before"), Ic(Be, "::after")]);
            }
            function dA(Be) {
              return Be.parentNode !== document.head && !~Tt.indexOf(Be.tagName.toUpperCase()) && !Be.getAttribute(Fe) && (!Be.parentNode || Be.parentNode.tagName !== "svg");
            }
            function Rc(Be) {
              if (ae)
                return new Promise(function(Qe, ze) {
                  var rt = pr(Be.querySelectorAll("*")).filter(dA).map(iP), vt = js.begin("searchPseudoElements");
                  Sc(), Promise.all(rt).then(function() {
                    vt(), Gv(), Qe();
                  }).catch(function() {
                    vt(), Gv(), ze();
                  });
                });
            }
            var G0 = {
              hooks: function() {
                return {
                  mutationObserverCallbacks: function(ze) {
                    return ze.pseudoElementsCallback = Rc, ze;
                  }
                };
              },
              provides: function(Qe) {
                Qe.pseudoElements2svg = function(ze) {
                  var rt = ze.node, vt = rt === void 0 ? G : rt;
                  Rr.searchPseudoElements && Rc(vt);
                };
              }
            }, Vc = !1, Z0 = {
              mixout: function() {
                return {
                  dom: {
                    unwatch: function() {
                      Sc(), Vc = !0;
                    }
                  }
                };
              },
              hooks: function() {
                return {
                  bootstrap: function() {
                    eP(Pt("mutationObserverCallbacks", {}));
                  },
                  noAuto: function() {
                    J0();
                  },
                  watch: function(ze) {
                    var rt = ze.observeMutationsRoot;
                    Vc ? Gv() : eP(Pt("mutationObserverCallbacks", {
                      observeMutationsRoot: rt
                    }));
                  }
                };
              }
            }, Cc = function(Qe) {
              var ze = {
                size: 16,
                x: 0,
                y: 0,
                flipX: !1,
                flipY: !1,
                rotate: 0
              };
              return Qe.toLowerCase().split(" ").reduce(function(rt, vt) {
                var yt = vt.toLowerCase().split("-"), Bt = yt[0], ar = yt.slice(1).join("-");
                if (Bt && ar === "h")
                  return rt.flipX = !0, rt;
                if (Bt && ar === "v")
                  return rt.flipY = !0, rt;
                if (ar = parseFloat(ar), isNaN(ar))
                  return rt;
                switch (Bt) {
                  case "grow":
                    rt.size = rt.size + ar;
                    break;
                  case "shrink":
                    rt.size = rt.size - ar;
                    break;
                  case "left":
                    rt.x = rt.x - ar;
                    break;
                  case "right":
                    rt.x = rt.x + ar;
                    break;
                  case "up":
                    rt.y = rt.y - ar;
                    break;
                  case "down":
                    rt.y = rt.y + ar;
                    break;
                  case "rotate":
                    rt.rotate = rt.rotate + ar;
                    break;
                }
                return rt;
              }, ze);
            }, sP = {
              mixout: function() {
                return {
                  parse: {
                    transform: function(ze) {
                      return Cc(ze);
                    }
                  }
                };
              },
              hooks: function() {
                return {
                  parseNodeAttributes: function(ze, rt) {
                    var vt = rt.getAttribute("data-fa-transform");
                    return vt && (ze.transform = Cc(vt)), ze;
                  }
                };
              },
              provides: function(Qe) {
                Qe.generateAbstractTransformGrouping = function(ze) {
                  var rt = ze.main, vt = ze.transform, yt = ze.containerWidth, Bt = ze.iconWidth, ar = {
                    transform: "translate(".concat(yt / 2, " 256)")
                  }, Pr = "translate(".concat(vt.x * 32, ", ").concat(vt.y * 32, ") "), Sn = "scale(".concat(vt.size / 16 * (vt.flipX ? -1 : 1), ", ").concat(vt.size / 16 * (vt.flipY ? -1 : 1), ") "), cn = "rotate(".concat(vt.rotate, " 0 0)"), Gn = {
                    transform: "".concat(Pr, " ").concat(Sn, " ").concat(cn)
                  }, es = {
                    transform: "translate(".concat(Bt / 2 * -1, " -256)")
                  }, Ys = {
                    outer: ar,
                    inner: Gn,
                    path: es
                  };
                  return {
                    tag: "g",
                    attributes: v({}, Ys.outer),
                    children: [{
                      tag: "g",
                      attributes: v({}, Ys.inner),
                      children: [{
                        tag: rt.icon.tag,
                        children: rt.icon.children,
                        attributes: v(v({}, rt.icon.attributes), Ys.path)
                      }]
                    }]
                  };
                };
              }
            }, ev = {
              x: 0,
              y: 0,
              width: "100%",
              height: "100%"
            };
            function tv(Be) {
              var Qe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
              return Be.attributes && (Be.attributes.fill || Qe) && (Be.attributes.fill = "black"), Be;
            }
            function Yu(Be) {
              return Be.tag === "g" ? Be.children : [Be];
            }
            var Bp = {
              hooks: function() {
                return {
                  parseNodeAttributes: function(ze, rt) {
                    var vt = rt.getAttribute("data-fa-mask"), yt = vt ? e1(vt.split(" ").map(function(Bt) {
                      return Bt.trim();
                    })) : I6();
                    return yt.prefix || (yt.prefix = Fn()), ze.mask = yt, ze.maskId = rt.getAttribute("data-fa-mask-id"), ze;
                  }
                };
              },
              provides: function(Qe) {
                Qe.generateAbstractMask = function(ze) {
                  var rt = ze.children, vt = ze.attributes, yt = ze.main, Bt = ze.mask, ar = ze.maskId, Pr = ze.transform, Sn = yt.width, cn = yt.icon, Gn = Bt.width, es = Bt.icon, Ys = Kt({
                    transform: Pr,
                    containerWidth: Gn,
                    iconWidth: Sn
                  }), S1 = {
                    tag: "rect",
                    attributes: v(v({}, ev), {}, {
                      fill: "white"
                    })
                  }, ia = cn.children ? {
                    children: cn.children.map(tv)
                  } : {}, x9 = {
                    tag: "g",
                    attributes: v({}, Ys.inner),
                    children: [tv(v({
                      tag: cn.tag,
                      attributes: v(v({}, cn.attributes), Ys.path)
                    }, ia))]
                  }, Jf = {
                    tag: "g",
                    attributes: v({}, Ys.outer),
                    children: [x9]
                  }, Vo = "mask-".concat(ar || Fr()), U1 = "clip-".concat(ar || Fr()), vA = {
                    tag: "mask",
                    attributes: v(v({}, ev), {}, {
                      id: Vo,
                      maskUnits: "userSpaceOnUse",
                      maskContentUnits: "userSpaceOnUse"
                    }),
                    children: [S1, Jf]
                  }, Wf = {
                    tag: "defs",
                    children: [{
                      tag: "clipPath",
                      attributes: {
                        id: U1
                      },
                      children: Yu(es)
                    }, vA]
                  };
                  return rt.push(Wf, {
                    tag: "rect",
                    attributes: v({
                      fill: "currentColor",
                      "clip-path": "url(#".concat(U1, ")"),
                      mask: "url(#".concat(Vo, ")")
                    }, ev)
                  }), {
                    children: rt,
                    attributes: vt
                  };
                };
              }
            }, Wp = {
              provides: function(Qe) {
                var ze = !1;
                _.matchMedia && (ze = _.matchMedia("(prefers-reduced-motion: reduce)").matches), Qe.missingIconAbstract = function() {
                  var rt = [], vt = {
                    fill: "currentColor"
                  }, yt = {
                    attributeType: "XML",
                    repeatCount: "indefinite",
                    dur: "2s"
                  };
                  rt.push({
                    tag: "path",
                    attributes: v(v({}, vt), {}, {
                      d: "M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"
                    })
                  });
                  var Bt = v(v({}, yt), {}, {
                    attributeName: "opacity"
                  }), ar = {
                    tag: "circle",
                    attributes: v(v({}, vt), {}, {
                      cx: "256",
                      cy: "364",
                      r: "28"
                    }),
                    children: []
                  };
                  return ze || ar.children.push({
                    tag: "animate",
                    attributes: v(v({}, yt), {}, {
                      attributeName: "r",
                      values: "28;14;28;28;14;28;"
                    })
                  }, {
                    tag: "animate",
                    attributes: v(v({}, Bt), {}, {
                      values: "1;0;1;1;0;1;"
                    })
                  }), rt.push(ar), rt.push({
                    tag: "path",
                    attributes: v(v({}, vt), {}, {
                      opacity: "1",
                      d: "M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"
                    }),
                    children: ze ? [] : [{
                      tag: "animate",
                      attributes: v(v({}, Bt), {}, {
                        values: "1;0;0;0;0;1;"
                      })
                    }]
                  }), ze || rt.push({
                    tag: "path",
                    attributes: v(v({}, vt), {}, {
                      opacity: "0",
                      d: "M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"
                    }),
                    children: [{
                      tag: "animate",
                      attributes: v(v({}, Bt), {}, {
                        values: "0;0;1;1;0;0;"
                      })
                    }]
                  }), {
                    tag: "g",
                    attributes: {
                      class: "missing"
                    },
                    children: rt
                  };
                };
              }
            }, aP = {
              hooks: function() {
                return {
                  parseNodeAttributes: function(ze, rt) {
                    var vt = rt.getAttribute("data-fa-symbol"), yt = vt === null ? !1 : vt === "" ? !0 : vt;
                    return ze.symbol = yt, ze;
                  }
                };
              }
            }, Sp = [Cn, Xo, C6, Zv, nP, G0, Z0, sP, Bp, Wp, aP];
            Ie(Sp, {
              mixoutsTo: qi
            });
            var Up = qi.noAuto, Ip = qi.config, _0 = qi.library, gg = qi.dom, $0 = qi.parse, Rp = qi.findIconDefinition, rv = qi.toHtml, Oc = qi.icon, G9 = qi.layer, yA = qi.text, e7 = qi.counter;
          }
        ),
        /***/
        "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs": (
          /*!****************************************************************************!*\
            !*** ../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs ***!
            \****************************************************************************/
          /***/
          (a, f, o) => {
            o.r(f), o.d(f, {
              /* harmony export */
              fa0: () => (
                /* binding */
                v
              ),
              /* harmony export */
              fa1: () => (
                /* binding */
                u
              ),
              /* harmony export */
              fa2: () => (
                /* binding */
                l
              ),
              /* harmony export */
              fa3: () => (
                /* binding */
                P
              ),
              /* harmony export */
              fa4: () => (
                /* binding */
                p
              ),
              /* harmony export */
              fa5: () => (
                /* binding */
                c
              ),
              /* harmony export */
              fa6: () => (
                /* binding */
                H
              ),
              /* harmony export */
              fa7: () => (
                /* binding */
                T
              ),
              /* harmony export */
              fa8: () => (
                /* binding */
                q
              ),
              /* harmony export */
              fa9: () => (
                /* binding */
                b
              ),
              /* harmony export */
              faA: () => (
                /* binding */
                Hu
              ),
              /* harmony export */
              faAd: () => (
                /* binding */
                Ab
              ),
              /* harmony export */
              faAdd: () => (
                /* binding */
                KV
              ),
              /* harmony export */
              faAddressBook: () => (
                /* binding */
                S6
              ),
              /* harmony export */
              faAddressCard: () => (
                /* binding */
                E4
              ),
              /* harmony export */
              faAdjust: () => (
                /* binding */
                eI
              ),
              /* harmony export */
              faAirFreshener: () => (
                /* binding */
                Ig
              ),
              /* harmony export */
              faAlignCenter: () => (
                /* binding */
                H2
              ),
              /* harmony export */
              faAlignJustify: () => (
                /* binding */
                A7
              ),
              /* harmony export */
              faAlignLeft: () => (
                /* binding */
                K3
              ),
              /* harmony export */
              faAlignRight: () => (
                /* binding */
                wJ
              ),
              /* harmony export */
              faAllergies: () => (
                /* binding */
                tz
              ),
              /* harmony export */
              faAmbulance: () => (
                /* binding */
                h4
              ),
              /* harmony export */
              faAmericanSignLanguageInterpreting: () => (
                /* binding */
                s2
              ),
              /* harmony export */
              faAnchor: () => (
                /* binding */
                BK
              ),
              /* harmony export */
              faAnchorCircleCheck: () => (
                /* binding */
                ve
              ),
              /* harmony export */
              faAnchorCircleExclamation: () => (
                /* binding */
                wX
              ),
              /* harmony export */
              faAnchorCircleXmark: () => (
                /* binding */
                xw
              ),
              /* harmony export */
              faAnchorLock: () => (
                /* binding */
                u3
              ),
              /* harmony export */
              faAngleDoubleDown: () => (
                /* binding */
                ki
              ),
              /* harmony export */
              faAngleDoubleLeft: () => (
                /* binding */
                hL
              ),
              /* harmony export */
              faAngleDoubleRight: () => (
                /* binding */
                S7
              ),
              /* harmony export */
              faAngleDoubleUp: () => (
                /* binding */
                yT
              ),
              /* harmony export */
              faAngleDown: () => (
                /* binding */
                m8
              ),
              /* harmony export */
              faAngleLeft: () => (
                /* binding */
                zK
              ),
              /* harmony export */
              faAngleRight: () => (
                /* binding */
                o7
              ),
              /* harmony export */
              faAngleUp: () => (
                /* binding */
                Ed
              ),
              /* harmony export */
              faAnglesDown: () => (
                /* binding */
                Vn
              ),
              /* harmony export */
              faAnglesLeft: () => (
                /* binding */
                dk
              ),
              /* harmony export */
              faAnglesRight: () => (
                /* binding */
                W7
              ),
              /* harmony export */
              faAnglesUp: () => (
                /* binding */
                HH
              ),
              /* harmony export */
              faAngry: () => (
                /* binding */
                SK
              ),
              /* harmony export */
              faAnkh: () => (
                /* binding */
                Pr
              ),
              /* harmony export */
              faAppleAlt: () => (
                /* binding */
                nT
              ),
              /* harmony export */
              faAppleWhole: () => (
                /* binding */
                I3
              ),
              /* harmony export */
              faArchive: () => (
                /* binding */
                Ga
              ),
              /* harmony export */
              faArchway: () => (
                /* binding */
                bh
              ),
              /* harmony export */
              faAreaChart: () => (
                /* binding */
                lv
              ),
              /* harmony export */
              faArrowAltCircleDown: () => (
                /* binding */
                x2
              ),
              /* harmony export */
              faArrowAltCircleLeft: () => (
                /* binding */
                nx
              ),
              /* harmony export */
              faArrowAltCircleRight: () => (
                /* binding */
                Bh
              ),
              /* harmony export */
              faArrowAltCircleUp: () => (
                /* binding */
                wj
              ),
              /* harmony export */
              faArrowCircleDown: () => (
                /* binding */
                Gm
              ),
              /* harmony export */
              faArrowCircleLeft: () => (
                /* binding */
                D3
              ),
              /* harmony export */
              faArrowCircleRight: () => (
                /* binding */
                aj
              ),
              /* harmony export */
              faArrowCircleUp: () => (
                /* binding */
                a3
              ),
              /* harmony export */
              faArrowDown: () => (
                /* binding */
                Rt
              ),
              /* harmony export */
              faArrowDown19: () => (
                /* binding */
                TH
              ),
              /* harmony export */
              faArrowDown91: () => (
                /* binding */
                Lf
              ),
              /* harmony export */
              faArrowDownAZ: () => (
                /* binding */
                wl
              ),
              /* harmony export */
              faArrowDownLong: () => (
                /* binding */
                xs
              ),
              /* harmony export */
              faArrowDownShortWide: () => (
                /* binding */
                xx
              ),
              /* harmony export */
              faArrowDownUpAcrossLine: () => (
                /* binding */
                Mi
              ),
              /* harmony export */
              faArrowDownUpLock: () => (
                /* binding */
                _e
              ),
              /* harmony export */
              faArrowDownWideShort: () => (
                /* binding */
                U7
              ),
              /* harmony export */
              faArrowDownZA: () => (
                /* binding */
                EA
              ),
              /* harmony export */
              faArrowLeft: () => (
                /* binding */
                $s
              ),
              /* harmony export */
              faArrowLeftLong: () => (
                /* binding */
                Ti
              ),
              /* harmony export */
              faArrowLeftRotate: () => (
                /* binding */
                e2
              ),
              /* harmony export */
              faArrowPointer: () => (
                /* binding */
                Yp
              ),
              /* harmony export */
              faArrowRight: () => (
                /* binding */
                gv
              ),
              /* harmony export */
              faArrowRightArrowLeft: () => (
                /* binding */
                Xx
              ),
              /* harmony export */
              faArrowRightFromBracket: () => (
                /* binding */
                tv
              ),
              /* harmony export */
              faArrowRightFromFile: () => (
                /* binding */
                TL
              ),
              /* harmony export */
              faArrowRightLong: () => (
                /* binding */
                D2
              ),
              /* harmony export */
              faArrowRightRotate: () => (
                /* binding */
                fH
              ),
              /* harmony export */
              faArrowRightToBracket: () => (
                /* binding */
                r3
              ),
              /* harmony export */
              faArrowRightToCity: () => (
                /* binding */
                MX
              ),
              /* harmony export */
              faArrowRightToFile: () => (
                /* binding */
                Zm
              ),
              /* harmony export */
              faArrowRotateBack: () => (
                /* binding */
                Gj
              ),
              /* harmony export */
              faArrowRotateBackward: () => (
                /* binding */
                Zj
              ),
              /* harmony export */
              faArrowRotateForward: () => (
                /* binding */
                AH
              ),
              /* harmony export */
              faArrowRotateLeft: () => (
                /* binding */
                _h
              ),
              /* harmony export */
              faArrowRotateRight: () => (
                /* binding */
                Dl
              ),
              /* harmony export */
              faArrowTrendDown: () => (
                /* binding */
                IK
              ),
              /* harmony export */
              faArrowTrendUp: () => (
                /* binding */
                rs
              ),
              /* harmony export */
              faArrowTurnDown: () => (
                /* binding */
                fk
              ),
              /* harmony export */
              faArrowTurnRight: () => (
                /* binding */
                HJ
              ),
              /* harmony export */
              faArrowTurnUp: () => (
                /* binding */
                ec
              ),
              /* harmony export */
              faArrowUp: () => (
                /* binding */
                vW
              ),
              /* harmony export */
              faArrowUp19: () => (
                /* binding */
                bT
              ),
              /* harmony export */
              faArrowUp91: () => (
                /* binding */
                gH
              ),
              /* harmony export */
              faArrowUpAZ: () => (
                /* binding */
                H1
              ),
              /* harmony export */
              faArrowUpFromBracket: () => (
                /* binding */
                v7
              ),
              /* harmony export */
              faArrowUpFromGroundWater: () => (
                /* binding */
                U4
              ),
              /* harmony export */
              faArrowUpFromWaterPump: () => (
                /* binding */
                Xz
              ),
              /* harmony export */
              faArrowUpLong: () => (
                /* binding */
                oi
              ),
              /* harmony export */
              faArrowUpRightDots: () => (
                /* binding */
                sL
              ),
              /* harmony export */
              faArrowUpRightFromSquare: () => (
                /* binding */
                lb
              ),
              /* harmony export */
              faArrowUpShortWide: () => (
                /* binding */
                ck
              ),
              /* harmony export */
              faArrowUpWideShort: () => (
                /* binding */
                b8
              ),
              /* harmony export */
              faArrowUpZA: () => (
                /* binding */
                wk
              ),
              /* harmony export */
              faArrows: () => (
                /* binding */
                $V
              ),
              /* harmony export */
              faArrowsAlt: () => (
                /* binding */
                Dh
              ),
              /* harmony export */
              faArrowsAltH: () => (
                /* binding */
                HA
              ),
              /* harmony export */
              faArrowsAltV: () => (
                /* binding */
                aK
              ),
              /* harmony export */
              faArrowsDownToLine: () => (
                /* binding */
                px
              ),
              /* harmony export */
              faArrowsDownToPeople: () => (
                /* binding */
                $m
              ),
              /* harmony export */
              faArrowsH: () => (
                /* binding */
                eb
              ),
              /* harmony export */
              faArrowsLeftRight: () => (
                /* binding */
                j3
              ),
              /* harmony export */
              faArrowsLeftRightToLine: () => (
                /* binding */
                qA
              ),
              /* harmony export */
              faArrowsRotate: () => (
                /* binding */
                fX
              ),
              /* harmony export */
              faArrowsSpin: () => (
                /* binding */
                wz
              ),
              /* harmony export */
              faArrowsSplitUpAndLeft: () => (
                /* binding */
                _K
              ),
              /* harmony export */
              faArrowsToCircle: () => (
                /* binding */
                w
              ),
              /* harmony export */
              faArrowsToDot: () => (
                /* binding */
                uX
              ),
              /* harmony export */
              faArrowsToEye: () => (
                /* binding */
                hb
              ),
              /* harmony export */
              faArrowsTurnRight: () => (
                /* binding */
                Zq
              ),
              /* harmony export */
              faArrowsTurnToDots: () => (
                /* binding */
                qw
              ),
              /* harmony export */
              faArrowsUpDown: () => (
                /* binding */
                Yk
              ),
              /* harmony export */
              faArrowsUpDownLeftRight: () => (
                /* binding */
                sI
              ),
              /* harmony export */
              faArrowsUpToLine: () => (
                /* binding */
                Fe
              ),
              /* harmony export */
              faArrowsV: () => (
                /* binding */
                VJ
              ),
              /* harmony export */
              faAslInterpreting: () => (
                /* binding */
                G3
              ),
              /* harmony export */
              faAssistiveListeningSystems: () => (
                /* binding */
                bV
              ),
              /* harmony export */
              faAsterisk: () => (
                /* binding */
                cn
              ),
              /* harmony export */
              faAt: () => (
                /* binding */
                N
              ),
              /* harmony export */
              faAtlas: () => (
                /* binding */
                C7
              ),
              /* harmony export */
              faAtom: () => (
                /* binding */
                Qt
              ),
              /* harmony export */
              faAudioDescription: () => (
                /* binding */
                aH
              ),
              /* harmony export */
              faAustralSign: () => (
                /* binding */
                Hj
              ),
              /* harmony export */
              faAutomobile: () => (
                /* binding */
                sp
              ),
              /* harmony export */
              faAward: () => (
                /* binding */
                PL
              ),
              /* harmony export */
              faB: () => (
                /* binding */
                lw
              ),
              /* harmony export */
              faBaby: () => (
                /* binding */
                V
              ),
              /* harmony export */
              faBabyCarriage: () => (
                /* binding */
                $y
              ),
              /* harmony export */
              faBackspace: () => (
                /* binding */
                tp
              ),
              /* harmony export */
              faBackward: () => (
                /* binding */
                q9
              ),
              /* harmony export */
              faBackwardFast: () => (
                /* binding */
                r9
              ),
              /* harmony export */
              faBackwardStep: () => (
                /* binding */
                _3
              ),
              /* harmony export */
              faBacon: () => (
                /* binding */
                Bg
              ),
              /* harmony export */
              faBacteria: () => (
                /* binding */
                kx
              ),
              /* harmony export */
              faBacterium: () => (
                /* binding */
                Ub
              ),
              /* harmony export */
              faBagShopping: () => (
                /* binding */
                Z9
              ),
              /* harmony export */
              faBahai: () => (
                /* binding */
                xk
              ),
              /* harmony export */
              faBahtSign: () => (
                /* binding */
                vJ
              ),
              /* harmony export */
              faBalanceScale: () => (
                /* binding */
                CK
              ),
              /* harmony export */
              faBalanceScaleLeft: () => (
                /* binding */
                hT
              ),
              /* harmony export */
              faBalanceScaleRight: () => (
                /* binding */
                Yq
              ),
              /* harmony export */
              faBan: () => (
                /* binding */
                e3
              ),
              /* harmony export */
              faBanSmoking: () => (
                /* binding */
                y3
              ),
              /* harmony export */
              faBandAid: () => (
                /* binding */
                YJ
              ),
              /* harmony export */
              faBandage: () => (
                /* binding */
                zk
              ),
              /* harmony export */
              faBangladeshiTakaSign: () => (
                /* binding */
                n6
              ),
              /* harmony export */
              faBank: () => (
                /* binding */
                Oz
              ),
              /* harmony export */
              faBarChart: () => (
                /* binding */
                bP
              ),
              /* harmony export */
              faBarcode: () => (
                /* binding */
                Zz
              ),
              /* harmony export */
              faBars: () => (
                /* binding */
                Kf
              ),
              /* harmony export */
              faBarsProgress: () => (
                /* binding */
                _A
              ),
              /* harmony export */
              faBarsStaggered: () => (
                /* binding */
                Yo
              ),
              /* harmony export */
              faBaseball: () => (
                /* binding */
                rI
              ),
              /* harmony export */
              faBaseballBall: () => (
                /* binding */
                EV
              ),
              /* harmony export */
              faBaseballBatBall: () => (
                /* binding */
                n0
              ),
              /* harmony export */
              faBasketShopping: () => (
                /* binding */
                jb
              ),
              /* harmony export */
              faBasketball: () => (
                /* binding */
                aT
              ),
              /* harmony export */
              faBasketballBall: () => (
                /* binding */
                XB
              ),
              /* harmony export */
              faBath: () => (
                /* binding */
                $f
              ),
              /* harmony export */
              faBathtub: () => (
                /* binding */
                bs
              ),
              /* harmony export */
              faBattery: () => (
                /* binding */
                oW
              ),
              /* harmony export */
              faBattery0: () => (
                /* binding */
                dr
              ),
              /* harmony export */
              faBattery2: () => (
                /* binding */
                CM
              ),
              /* harmony export */
              faBattery3: () => (
                /* binding */
                i0
              ),
              /* harmony export */
              faBattery4: () => (
                /* binding */
                KK
              ),
              /* harmony export */
              faBattery5: () => (
                /* binding */
                VU
              ),
              /* harmony export */
              faBatteryCar: () => (
                /* binding */
                Al
              ),
              /* harmony export */
              faBatteryEmpty: () => (
                /* binding */
                Nt
              ),
              /* harmony export */
              faBatteryFull: () => (
                /* binding */
                aW
              ),
              /* harmony export */
              faBatteryHalf: () => (
                /* binding */
                rw
              ),
              /* harmony export */
              faBatteryQuarter: () => (
                /* binding */
                _y
              ),
              /* harmony export */
              faBatteryThreeQuarters: () => (
                /* binding */
                Ck
              ),
              /* harmony export */
              faBed: () => (
                /* binding */
                Bw
              ),
              /* harmony export */
              faBedPulse: () => (
                /* binding */
                nh
              ),
              /* harmony export */
              faBeer: () => (
                /* binding */
                ji
              ),
              /* harmony export */
              faBeerMugEmpty: () => (
                /* binding */
                is
              ),
              /* harmony export */
              faBell: () => (
                /* binding */
                l0
              ),
              /* harmony export */
              faBellConcierge: () => (
                /* binding */
                fi
              ),
              /* harmony export */
              faBellSlash: () => (
                /* binding */
                Of
              ),
              /* harmony export */
              faBezierCurve: () => (
                /* binding */
                ha
              ),
              /* harmony export */
              faBible: () => (
                /* binding */
                Ob
              ),
              /* harmony export */
              faBicycle: () => (
                /* binding */
                r1
              ),
              /* harmony export */
              faBiking: () => (
                /* binding */
                FL
              ),
              /* harmony export */
              faBinoculars: () => (
                /* binding */
                dt
              ),
              /* harmony export */
              faBiohazard: () => (
                /* binding */
                RX
              ),
              /* harmony export */
              faBirthdayCake: () => (
                /* binding */
                hH
              ),
              /* harmony export */
              faBitcoinSign: () => (
                /* binding */
                bj
              ),
              /* harmony export */
              faBlackboard: () => (
                /* binding */
                aB
              ),
              /* harmony export */
              faBlender: () => (
                /* binding */
                or
              ),
              /* harmony export */
              faBlenderPhone: () => (
                /* binding */
                C1
              ),
              /* harmony export */
              faBlind: () => (
                /* binding */
                Vl
              ),
              /* harmony export */
              faBlog: () => (
                /* binding */
                Ts
              ),
              /* harmony export */
              faBold: () => (
                /* binding */
                ff
              ),
              /* harmony export */
              faBolt: () => (
                /* binding */
                Bv
              ),
              /* harmony export */
              faBoltLightning: () => (
                /* binding */
                Q7
              ),
              /* harmony export */
              faBomb: () => (
                /* binding */
                eX
              ),
              /* harmony export */
              faBone: () => (
                /* binding */
                Tz
              ),
              /* harmony export */
              faBong: () => (
                /* binding */
                pi
              ),
              /* harmony export */
              faBook: () => (
                /* binding */
                YK
              ),
              /* harmony export */
              faBookAtlas: () => (
                /* binding */
                ib
              ),
              /* harmony export */
              faBookBible: () => (
                /* binding */
                J3
              ),
              /* harmony export */
              faBookBookmark: () => (
                /* binding */
                lT
              ),
              /* harmony export */
              faBookDead: () => (
                /* binding */
                S9
              ),
              /* harmony export */
              faBookJournalWhills: () => (
                /* binding */
                Fk
              ),
              /* harmony export */
              faBookMedical: () => (
                /* binding */
                yj
              ),
              /* harmony export */
              faBookOpen: () => (
                /* binding */
                uJ
              ),
              /* harmony export */
              faBookOpenReader: () => (
                /* binding */
                Qo
              ),
              /* harmony export */
              faBookQuran: () => (
                /* binding */
                Bk
              ),
              /* harmony export */
              faBookReader: () => (
                /* binding */
                zB
              ),
              /* harmony export */
              faBookSkull: () => (
                /* binding */
                g8
              ),
              /* harmony export */
              faBookTanakh: () => (
                /* binding */
                RT
              ),
              /* harmony export */
              faBookmark: () => (
                /* binding */
                yp
              ),
              /* harmony export */
              faBorderAll: () => (
                /* binding */
                WK
              ),
              /* harmony export */
              faBorderNone: () => (
                /* binding */
                NT
              ),
              /* harmony export */
              faBorderStyle: () => (
                /* binding */
                f6
              ),
              /* harmony export */
              faBorderTopLeft: () => (
                /* binding */
                uu
              ),
              /* harmony export */
              faBoreHole: () => (
                /* binding */
                np
              ),
              /* harmony export */
              faBottleDroplet: () => (
                /* binding */
                XJ
              ),
              /* harmony export */
              faBottleWater: () => (
                /* binding */
                gb
              ),
              /* harmony export */
              faBowlFood: () => (
                /* binding */
                Xh
              ),
              /* harmony export */
              faBowlRice: () => (
                /* binding */
                hw
              ),
              /* harmony export */
              faBowlingBall: () => (
                /* binding */
                NJ
              ),
              /* harmony export */
              faBox: () => (
                /* binding */
                PP
              ),
              /* harmony export */
              faBoxArchive: () => (
                /* binding */
                $i
              ),
              /* harmony export */
              faBoxOpen: () => (
                /* binding */
                $g
              ),
              /* harmony export */
              faBoxTissue: () => (
                /* binding */
                _t
              ),
              /* harmony export */
              faBoxes: () => (
                /* binding */
                k8
              ),
              /* harmony export */
              faBoxesAlt: () => (
                /* binding */
                _B
              ),
              /* harmony export */
              faBoxesPacking: () => (
                /* binding */
                sX
              ),
              /* harmony export */
              faBoxesStacked: () => (
                /* binding */
                ZB
              ),
              /* harmony export */
              faBraille: () => (
                /* binding */
                ZX
              ),
              /* harmony export */
              faBrain: () => (
                /* binding */
                QJ
              ),
              /* harmony export */
              faBrazilianRealSign: () => (
                /* binding */
                Vw
              ),
              /* harmony export */
              faBreadSlice: () => (
                /* binding */
                PB
              ),
              /* harmony export */
              faBridge: () => (
                /* binding */
                Bd
              ),
              /* harmony export */
              faBridgeCircleCheck: () => (
                /* binding */
                Bn
              ),
              /* harmony export */
              faBridgeCircleExclamation: () => (
                /* binding */
                Ki
              ),
              /* harmony export */
              faBridgeCircleXmark: () => (
                /* binding */
                I1
              ),
              /* harmony export */
              faBridgeLock: () => (
                /* binding */
                Mu
              ),
              /* harmony export */
              faBridgeWater: () => (
                /* binding */
                jT
              ),
              /* harmony export */
              faBriefcase: () => (
                /* binding */
                tJ
              ),
              /* harmony export */
              faBriefcaseClock: () => (
                /* binding */
                kb
              ),
              /* harmony export */
              faBriefcaseMedical: () => (
                /* binding */
                BM
              ),
              /* harmony export */
              faBroadcastTower: () => (
                /* binding */
                qx
              ),
              /* harmony export */
              faBroom: () => (
                /* binding */
                NL
              ),
              /* harmony export */
              faBroomBall: () => (
                /* binding */
                Fa
              ),
              /* harmony export */
              faBrush: () => (
                /* binding */
                sz
              ),
              /* harmony export */
              faBucket: () => (
                /* binding */
                e9
              ),
              /* harmony export */
              faBug: () => (
                /* binding */
                I8
              ),
              /* harmony export */
              faBugSlash: () => (
                /* binding */
                gz
              ),
              /* harmony export */
              faBugs: () => (
                /* binding */
                bb
              ),
              /* harmony export */
              faBuilding: () => (
                /* binding */
                pL
              ),
              /* harmony export */
              faBuildingCircleArrowRight: () => (
                /* binding */
                qe
              ),
              /* harmony export */
              faBuildingCircleCheck: () => (
                /* binding */
                w9
              ),
              /* harmony export */
              faBuildingCircleExclamation: () => (
                /* binding */
                SP
              ),
              /* harmony export */
              faBuildingCircleXmark: () => (
                /* binding */
                ow
              ),
              /* harmony export */
              faBuildingColumns: () => (
                /* binding */
                jW
              ),
              /* harmony export */
              faBuildingFlag: () => (
                /* binding */
                Xu
              ),
              /* harmony export */
              faBuildingLock: () => (
                /* binding */
                E6
              ),
              /* harmony export */
              faBuildingNgo: () => (
                /* binding */
                pv
              ),
              /* harmony export */
              faBuildingShield: () => (
                /* binding */
                W
              ),
              /* harmony export */
              faBuildingUn: () => (
                /* binding */
                Xe
              ),
              /* harmony export */
              faBuildingUser: () => (
                /* binding */
                _c
              ),
              /* harmony export */
              faBuildingWheat: () => (
                /* binding */
                O1
              ),
              /* harmony export */
              faBullhorn: () => (
                /* binding */
                Ln
              ),
              /* harmony export */
              faBullseye: () => (
                /* binding */
                H4
              ),
              /* harmony export */
              faBurger: () => (
                /* binding */
                _7
              ),
              /* harmony export */
              faBurn: () => (
                /* binding */
                pr
              ),
              /* harmony export */
              faBurst: () => (
                /* binding */
                Lq
              ),
              /* harmony export */
              faBus: () => (
                /* binding */
                m9
              ),
              /* harmony export */
              faBusAlt: () => (
                /* binding */
                wb
              ),
              /* harmony export */
              faBusSimple: () => (
                /* binding */
                l6
              ),
              /* harmony export */
              faBusinessTime: () => (
                /* binding */
                UT
              ),
              /* harmony export */
              faC: () => (
                /* binding */
                su
              ),
              /* harmony export */
              faCab: () => (
                /* binding */
                W3
              ),
              /* harmony export */
              faCableCar: () => (
                /* binding */
                jv
              ),
              /* harmony export */
              faCake: () => (
                /* binding */
                OT
              ),
              /* harmony export */
              faCakeCandles: () => (
                /* binding */
                pH
              ),
              /* harmony export */
              faCalculator: () => (
                /* binding */
                aw
              ),
              /* harmony export */
              faCalendar: () => (
                /* binding */
                fK
              ),
              /* harmony export */
              faCalendarAlt: () => (
                /* binding */
                re
              ),
              /* harmony export */
              faCalendarCheck: () => (
                /* binding */
                Kj
              ),
              /* harmony export */
              faCalendarDay: () => (
                /* binding */
                UJ
              ),
              /* harmony export */
              faCalendarDays: () => (
                /* binding */
                ne
              ),
              /* harmony export */
              faCalendarMinus: () => (
                /* binding */
                MJ
              ),
              /* harmony export */
              faCalendarPlus: () => (
                /* binding */
                ju
              ),
              /* harmony export */
              faCalendarTimes: () => (
                /* binding */
                Nh
              ),
              /* harmony export */
              faCalendarWeek: () => (
                /* binding */
                T8
              ),
              /* harmony export */
              faCalendarXmark: () => (
                /* binding */
                yX
              ),
              /* harmony export */
              faCamera: () => (
                /* binding */
                zX
              ),
              /* harmony export */
              faCameraAlt: () => (
                /* binding */
                XH
              ),
              /* harmony export */
              faCameraRetro: () => (
                /* binding */
                zm
              ),
              /* harmony export */
              faCameraRotate: () => (
                /* binding */
                cA
              ),
              /* harmony export */
              faCampground: () => (
                /* binding */
                Xg
              ),
              /* harmony export */
              faCancel: () => (
                /* binding */
                t3
              ),
              /* harmony export */
              faCandyCane: () => (
                /* binding */
                Th
              ),
              /* harmony export */
              faCannabis: () => (
                /* binding */
                hA
              ),
              /* harmony export */
              faCapsules: () => (
                /* binding */
                vP
              ),
              /* harmony export */
              faCar: () => (
                /* binding */
                I9
              ),
              /* harmony export */
              faCarAlt: () => (
                /* binding */
                IM
              ),
              /* harmony export */
              faCarBattery: () => (
                /* binding */
                lu
              ),
              /* harmony export */
              faCarBurst: () => (
                /* binding */
                PW
              ),
              /* harmony export */
              faCarCrash: () => (
                /* binding */
                JU
              ),
              /* harmony export */
              faCarOn: () => (
                /* binding */
                Mj
              ),
              /* harmony export */
              faCarRear: () => (
                /* binding */
                Zy
              ),
              /* harmony export */
              faCarSide: () => (
                /* binding */
                Qc
              ),
              /* harmony export */
              faCarTunnel: () => (
                /* binding */
                B8
              ),
              /* harmony export */
              faCaravan: () => (
                /* binding */
                nc
              ),
              /* harmony export */
              faCaretDown: () => (
                /* binding */
                Ax
              ),
              /* harmony export */
              faCaretLeft: () => (
                /* binding */
                Z0
              ),
              /* harmony export */
              faCaretRight: () => (
                /* binding */
                wf
              ),
              /* harmony export */
              faCaretSquareDown: () => (
                /* binding */
                fA
              ),
              /* harmony export */
              faCaretSquareLeft: () => (
                /* binding */
                sa
              ),
              /* harmony export */
              faCaretSquareRight: () => (
                /* binding */
                Ia
              ),
              /* harmony export */
              faCaretSquareUp: () => (
                /* binding */
                Mg
              ),
              /* harmony export */
              faCaretUp: () => (
                /* binding */
                j7
              ),
              /* harmony export */
              faCarriageBaby: () => (
                /* binding */
                yM
              ),
              /* harmony export */
              faCarrot: () => (
                /* binding */
                IL
              ),
              /* harmony export */
              faCartArrowDown: () => (
                /* binding */
                BV
              ),
              /* harmony export */
              faCartFlatbed: () => (
                /* binding */
                Sj
              ),
              /* harmony export */
              faCartFlatbedSuitcase: () => (
                /* binding */
                Ek
              ),
              /* harmony export */
              faCartPlus: () => (
                /* binding */
                Wf
              ),
              /* harmony export */
              faCartShopping: () => (
                /* binding */
                o8
              ),
              /* harmony export */
              faCashRegister: () => (
                /* binding */
                CP
              ),
              /* harmony export */
              faCat: () => (
                /* binding */
                Vh
              ),
              /* harmony export */
              faCediSign: () => (
                /* binding */
                hu
              ),
              /* harmony export */
              faCentSign: () => (
                /* binding */
                c8
              ),
              /* harmony export */
              faCertificate: () => (
                /* binding */
                RD
              ),
              /* harmony export */
              faChain: () => (
                /* binding */
                WU
              ),
              /* harmony export */
              faChainBroken: () => (
                /* binding */
                gK
              ),
              /* harmony export */
              faChainSlash: () => (
                /* binding */
                XK
              ),
              /* harmony export */
              faChair: () => (
                /* binding */
                O4
              ),
              /* harmony export */
              faChalkboard: () => (
                /* binding */
                $D
              ),
              /* harmony export */
              faChalkboardTeacher: () => (
                /* binding */
                h
              ),
              /* harmony export */
              faChalkboardUser: () => (
                /* binding */
                DW
              ),
              /* harmony export */
              faChampagneGlasses: () => (
                /* binding */
                Td
              ),
              /* harmony export */
              faChargingStation: () => (
                /* binding */
                Rg
              ),
              /* harmony export */
              faChartArea: () => (
                /* binding */
                au
              ),
              /* harmony export */
              faChartBar: () => (
                /* binding */
                Lg
              ),
              /* harmony export */
              faChartColumn: () => (
                /* binding */
                $L
              ),
              /* harmony export */
              faChartGantt: () => (
                /* binding */
                r2
              ),
              /* harmony export */
              faChartLine: () => (
                /* binding */
                Rf
              ),
              /* harmony export */
              faChartPie: () => (
                /* binding */
                S3
              ),
              /* harmony export */
              faChartSimple: () => (
                /* binding */
                Sg
              ),
              /* harmony export */
              faCheck: () => (
                /* binding */
                LK
              ),
              /* harmony export */
              faCheckCircle: () => (
                /* binding */
                D
              ),
              /* harmony export */
              faCheckDouble: () => (
                /* binding */
                Qi
              ),
              /* harmony export */
              faCheckSquare: () => (
                /* binding */
                es
              ),
              /* harmony export */
              faCheckToSlot: () => (
                /* binding */
                O8
              ),
              /* harmony export */
              faCheese: () => (
                /* binding */
                CL
              ),
              /* harmony export */
              faChess: () => (
                /* binding */
                i2
              ),
              /* harmony export */
              faChessBishop: () => (
                /* binding */
                _u
              ),
              /* harmony export */
              faChessBoard: () => (
                /* binding */
                dl
              ),
              /* harmony export */
              faChessKing: () => (
                /* binding */
                yU
              ),
              /* harmony export */
              faChessKnight: () => (
                /* binding */
                Au
              ),
              /* harmony export */
              faChessPawn: () => (
                /* binding */
                U8
              ),
              /* harmony export */
              faChessQueen: () => (
                /* binding */
                b7
              ),
              /* harmony export */
              faChessRook: () => (
                /* binding */
                s9
              ),
              /* harmony export */
              faChevronCircleDown: () => (
                /* binding */
                Wp
              ),
              /* harmony export */
              faChevronCircleLeft: () => (
                /* binding */
                jL
              ),
              /* harmony export */
              faChevronCircleRight: () => (
                /* binding */
                I
              ),
              /* harmony export */
              faChevronCircleUp: () => (
                /* binding */
                La
              ),
              /* harmony export */
              faChevronDown: () => (
                /* binding */
                IV
              ),
              /* harmony export */
              faChevronLeft: () => (
                /* binding */
                E8
              ),
              /* harmony export */
              faChevronRight: () => (
                /* binding */
                SM
              ),
              /* harmony export */
              faChevronUp: () => (
                /* binding */
                bi
              ),
              /* harmony export */
              faChild: () => (
                /* binding */
                Fb
              ),
              /* harmony export */
              faChildCombatant: () => (
                /* binding */
                bW
              ),
              /* harmony export */
              faChildDress: () => (
                /* binding */
                dH
              ),
              /* harmony export */
              faChildReaching: () => (
                /* binding */
                qu
              ),
              /* harmony export */
              faChildRifle: () => (
                /* binding */
                YV
              ),
              /* harmony export */
              faChildren: () => (
                /* binding */
                sB
              ),
              /* harmony export */
              faChurch: () => (
                /* binding */
                J4
              ),
              /* harmony export */
              faCircle: () => (
                /* binding */
                EP
              ),
              /* harmony export */
              faCircleArrowDown: () => (
                /* binding */
                yD
              ),
              /* harmony export */
              faCircleArrowLeft: () => (
                /* binding */
                aX
              ),
              /* harmony export */
              faCircleArrowRight: () => (
                /* binding */
                db
              ),
              /* harmony export */
              faCircleArrowUp: () => (
                /* binding */
                Co
              ),
              /* harmony export */
              faCircleCheck: () => (
                /* binding */
                b3
              ),
              /* harmony export */
              faCircleChevronDown: () => (
                /* binding */
                Bp
              ),
              /* harmony export */
              faCircleChevronLeft: () => (
                /* binding */
                hk
              ),
              /* harmony export */
              faCircleChevronRight: () => (
                /* binding */
                m
              ),
              /* harmony export */
              faCircleChevronUp: () => (
                /* binding */
                Kn
              ),
              /* harmony export */
              faCircleDollarToSlot: () => (
                /* binding */
                $0
              ),
              /* harmony export */
              faCircleDot: () => (
                /* binding */
                $1
              ),
              /* harmony export */
              faCircleDown: () => (
                /* binding */
                Z6
              ),
              /* harmony export */
              faCircleExclamation: () => (
                /* binding */
                Cc
              ),
              /* harmony export */
              faCircleH: () => (
                /* binding */
                jf
              ),
              /* harmony export */
              faCircleHalfStroke: () => (
                /* binding */
                hW
              ),
              /* harmony export */
              faCircleInfo: () => (
                /* binding */
                MT
              ),
              /* harmony export */
              faCircleLeft: () => (
                /* binding */
                $j
              ),
              /* harmony export */
              faCircleMinus: () => (
                /* binding */
                ut
              ),
              /* harmony export */
              faCircleNodes: () => (
                /* binding */
                QT
              ),
              /* harmony export */
              faCircleNotch: () => (
                /* binding */
                Mn
              ),
              /* harmony export */
              faCirclePause: () => (
                /* binding */
                rT
              ),
              /* harmony export */
              faCirclePlay: () => (
                /* binding */
                lh
              ),
              /* harmony export */
              faCirclePlus: () => (
                /* binding */
                Dk
              ),
              /* harmony export */
              faCircleQuestion: () => (
                /* binding */
                Uh
              ),
              /* harmony export */
              faCircleRadiation: () => (
                /* binding */
                tI
              ),
              /* harmony export */
              faCircleRight: () => (
                /* binding */
                L6
              ),
              /* harmony export */
              faCircleStop: () => (
                /* binding */
                B
              ),
              /* harmony export */
              faCircleUp: () => (
                /* binding */
                oT
              ),
              /* harmony export */
              faCircleUser: () => (
                /* binding */
                lW
              ),
              /* harmony export */
              faCircleXmark: () => (
                /* binding */
                fC
              ),
              /* harmony export */
              faCity: () => (
                /* binding */
                oh
              ),
              /* harmony export */
              faClapperboard: () => (
                /* binding */
                HW
              ),
              /* harmony export */
              faClinicMedical: () => (
                /* binding */
                v2
              ),
              /* harmony export */
              faClipboard: () => (
                /* binding */
                d3
              ),
              /* harmony export */
              faClipboardCheck: () => (
                /* binding */
                AT
              ),
              /* harmony export */
              faClipboardList: () => (
                /* binding */
                b9
              ),
              /* harmony export */
              faClipboardQuestion: () => (
                /* binding */
                NP
              ),
              /* harmony export */
              faClipboardUser: () => (
                /* binding */
                QX
              ),
              /* harmony export */
              faClock: () => (
                /* binding */
                Sl
              ),
              /* harmony export */
              faClockFour: () => (
                /* binding */
                tw
              ),
              /* harmony export */
              faClockRotateLeft: () => (
                /* binding */
                vk
              ),
              /* harmony export */
              faClone: () => (
                /* binding */
                qK
              ),
              /* harmony export */
              faClose: () => (
                /* binding */
                GV
              ),
              /* harmony export */
              faClosedCaptioning: () => (
                /* binding */
                Qn
              ),
              /* harmony export */
              faCloud: () => (
                /* binding */
                Gs
              ),
              /* harmony export */
              faCloudArrowDown: () => (
                /* binding */
                R7
              ),
              /* harmony export */
              faCloudArrowUp: () => (
                /* binding */
                Q4
              ),
              /* harmony export */
              faCloudBolt: () => (
                /* binding */
                I7
              ),
              /* harmony export */
              faCloudDownload: () => (
                /* binding */
                iB
              ),
              /* harmony export */
              faCloudDownloadAlt: () => (
                /* binding */
                _D
              ),
              /* harmony export */
              faCloudMeatball: () => (
                /* binding */
                Qj
              ),
              /* harmony export */
              faCloudMoon: () => (
                /* binding */
                eJ
              ),
              /* harmony export */
              faCloudMoonRain: () => (
                /* binding */
                oK
              ),
              /* harmony export */
              faCloudRain: () => (
                /* binding */
                h2
              ),
              /* harmony export */
              faCloudShowersHeavy: () => (
                /* binding */
                Up
              ),
              /* harmony export */
              faCloudShowersWater: () => (
                /* binding */
                d6
              ),
              /* harmony export */
              faCloudSun: () => (
                /* binding */
                lz
              ),
              /* harmony export */
              faCloudSunRain: () => (
                /* binding */
                vt
              ),
              /* harmony export */
              faCloudUpload: () => (
                /* binding */
                KD
              ),
              /* harmony export */
              faCloudUploadAlt: () => (
                /* binding */
                Gq
              ),
              /* harmony export */
              faClover: () => (
                /* binding */
                Sc
              ),
              /* harmony export */
              faCny: () => (
                /* binding */
                f0
              ),
              /* harmony export */
              faCocktail: () => (
                /* binding */
                J7
              ),
              /* harmony export */
              faCode: () => (
                /* binding */
                pj
              ),
              /* harmony export */
              faCodeBranch: () => (
                /* binding */
                PT
              ),
              /* harmony export */
              faCodeCommit: () => (
                /* binding */
                kL
              ),
              /* harmony export */
              faCodeCompare: () => (
                /* binding */
                CU
              ),
              /* harmony export */
              faCodeFork: () => (
                /* binding */
                Eg
              ),
              /* harmony export */
              faCodeMerge: () => (
                /* binding */
                o0
              ),
              /* harmony export */
              faCodePullRequest: () => (
                /* binding */
                U6
              ),
              /* harmony export */
              faCoffee: () => (
                /* binding */
                iz
              ),
              /* harmony export */
              faCog: () => (
                /* binding */
                s8
              ),
              /* harmony export */
              faCogs: () => (
                /* binding */
                nL
              ),
              /* harmony export */
              faCoins: () => (
                /* binding */
                nw
              ),
              /* harmony export */
              faColonSign: () => (
                /* binding */
                bo
              ),
              /* harmony export */
              faColumns: () => (
                /* binding */
                vh
              ),
              /* harmony export */
              faComment: () => (
                /* binding */
                CT
              ),
              /* harmony export */
              faCommentAlt: () => (
                /* binding */
                te
              ),
              /* harmony export */
              faCommentDollar: () => (
                /* binding */
                td
              ),
              /* harmony export */
              faCommentDots: () => (
                /* binding */
                UX
              ),
              /* harmony export */
              faCommentMedical: () => (
                /* binding */
                Oh
              ),
              /* harmony export */
              faCommentSlash: () => (
                /* binding */
                rt
              ),
              /* harmony export */
              faCommentSms: () => (
                /* binding */
                Vk
              ),
              /* harmony export */
              faCommenting: () => (
                /* binding */
                LP
              ),
              /* harmony export */
              faComments: () => (
                /* binding */
                mf
              ),
              /* harmony export */
              faCommentsDollar: () => (
                /* binding */
                WP
              ),
              /* harmony export */
              faCompactDisc: () => (
                /* binding */
                D8
              ),
              /* harmony export */
              faCompass: () => (
                /* binding */
                Pd
              ),
              /* harmony export */
              faCompassDrafting: () => (
                /* binding */
                z
              ),
              /* harmony export */
              faCompress: () => (
                /* binding */
                yt
              ),
              /* harmony export */
              faCompressAlt: () => (
                /* binding */
                G
              ),
              /* harmony export */
              faCompressArrowsAlt: () => (
                /* binding */
                I4
              ),
              /* harmony export */
              faComputer: () => (
                /* binding */
                zV
              ),
              /* harmony export */
              faComputerMouse: () => (
                /* binding */
                hP
              ),
              /* harmony export */
              faConciergeBell: () => (
                /* binding */
                on
              ),
              /* harmony export */
              faContactBook: () => (
                /* binding */
                qa
              ),
              /* harmony export */
              faContactCard: () => (
                /* binding */
                Nq
              ),
              /* harmony export */
              faCookie: () => (
                /* binding */
                $X
              ),
              /* harmony export */
              faCookieBite: () => (
                /* binding */
                UK
              ),
              /* harmony export */
              faCopy: () => (
                /* binding */
                Ow
              ),
              /* harmony export */
              faCopyright: () => (
                /* binding */
                Mt
              ),
              /* harmony export */
              faCouch: () => (
                /* binding */
                ab
              ),
              /* harmony export */
              faCow: () => (
                /* binding */
                B4
              ),
              /* harmony export */
              faCreditCard: () => (
                /* binding */
                jx
              ),
              /* harmony export */
              faCreditCardAlt: () => (
                /* binding */
                R8
              ),
              /* harmony export */
              faCrop: () => (
                /* binding */
                Rn
              ),
              /* harmony export */
              faCropAlt: () => (
                /* binding */
                r8
              ),
              /* harmony export */
              faCropSimple: () => (
                /* binding */
                n2
              ),
              /* harmony export */
              faCross: () => (
                /* binding */
                l7
              ),
              /* harmony export */
              faCrosshairs: () => (
                /* binding */
                jl
              ),
              /* harmony export */
              faCrow: () => (
                /* binding */
                D7
              ),
              /* harmony export */
              faCrown: () => (
                /* binding */
                $p
              ),
              /* harmony export */
              faCrutch: () => (
                /* binding */
                ko
              ),
              /* harmony export */
              faCruzeiroSign: () => (
                /* binding */
                dX
              ),
              /* harmony export */
              faCube: () => (
                /* binding */
                gB
              ),
              /* harmony export */
              faCubes: () => (
                /* binding */
                mT
              ),
              /* harmony export */
              faCubesStacked: () => (
                /* binding */
                HB
              ),
              /* harmony export */
              faCut: () => (
                /* binding */
                ud
              ),
              /* harmony export */
              faCutlery: () => (
                /* binding */
                UH
              ),
              /* harmony export */
              faD: () => (
                /* binding */
                Qz
              ),
              /* harmony export */
              faDashboard: () => (
                /* binding */
                Fp
              ),
              /* harmony export */
              faDatabase: () => (
                /* binding */
                hJ
              ),
              /* harmony export */
              faDeaf: () => (
                /* binding */
                lA
              ),
              /* harmony export */
              faDeafness: () => (
                /* binding */
                To
              ),
              /* harmony export */
              faDedent: () => (
                /* binding */
                gx
              ),
              /* harmony export */
              faDeleteLeft: () => (
                /* binding */
                Ul
              ),
              /* harmony export */
              faDemocrat: () => (
                /* binding */
                w3
              ),
              /* harmony export */
              faDesktop: () => (
                /* binding */
                Ik
              ),
              /* harmony export */
              faDesktopAlt: () => (
                /* binding */
                EK
              ),
              /* harmony export */
              faDharmachakra: () => (
                /* binding */
                Sv
              ),
              /* harmony export */
              faDiagnoses: () => (
                /* binding */
                rW
              ),
              /* harmony export */
              faDiagramNext: () => (
                /* binding */
                p8
              ),
              /* harmony export */
              faDiagramPredecessor: () => (
                /* binding */
                _i
              ),
              /* harmony export */
              faDiagramProject: () => (
                /* binding */
                Cw
              ),
              /* harmony export */
              faDiagramSuccessor: () => (
                /* binding */
                GK
              ),
              /* harmony export */
              faDiamond: () => (
                /* binding */
                Sb
              ),
              /* harmony export */
              faDiamondTurnRight: () => (
                /* binding */
                Mq
              ),
              /* harmony export */
              faDice: () => (
                /* binding */
                FJ
              ),
              /* harmony export */
              faDiceD20: () => (
                /* binding */
                w2
              ),
              /* harmony export */
              faDiceD6: () => (
                /* binding */
                Jh
              ),
              /* harmony export */
              faDiceFive: () => (
                /* binding */
                xg
              ),
              /* harmony export */
              faDiceFour: () => (
                /* binding */
                fL
              ),
              /* harmony export */
              faDiceOne: () => (
                /* binding */
                q8
              ),
              /* harmony export */
              faDiceSix: () => (
                /* binding */
                Rb
              ),
              /* harmony export */
              faDiceThree: () => (
                /* binding */
                De
              ),
              /* harmony export */
              faDiceTwo: () => (
                /* binding */
                p3
              ),
              /* harmony export */
              faDigging: () => (
                /* binding */
                L3
              ),
              /* harmony export */
              faDigitalTachograph: () => (
                /* binding */
                zv
              ),
              /* harmony export */
              faDirections: () => (
                /* binding */
                LD
              ),
              /* harmony export */
              faDisease: () => (
                /* binding */
                tC
              ),
              /* harmony export */
              faDisplay: () => (
                /* binding */
                LM
              ),
              /* harmony export */
              faDivide: () => (
                /* binding */
                Lh
              ),
              /* harmony export */
              faDizzy: () => (
                /* binding */
                oP
              ),
              /* harmony export */
              faDna: () => (
                /* binding */
                qH
              ),
              /* harmony export */
              faDog: () => (
                /* binding */
                UL
              ),
              /* harmony export */
              faDollar: () => (
                /* binding */
                Sz
              ),
              /* harmony export */
              faDollarSign: () => (
                /* binding */
                dC
              ),
              /* harmony export */
              faDolly: () => (
                /* binding */
                X3
              ),
              /* harmony export */
              faDollyBox: () => (
                /* binding */
                T3
              ),
              /* harmony export */
              faDollyFlatbed: () => (
                /* binding */
                Uj
              ),
              /* harmony export */
              faDonate: () => (
                /* binding */
                Rp
              ),
              /* harmony export */
              faDongSign: () => (
                /* binding */
                Kc
              ),
              /* harmony export */
              faDoorClosed: () => (
                /* binding */
                uH
              ),
              /* harmony export */
              faDoorOpen: () => (
                /* binding */
                wt
              ),
              /* harmony export */
              faDotCircle: () => (
                /* binding */
                D9
              ),
              /* harmony export */
              faDove: () => (
                /* binding */
                to
              ),
              /* harmony export */
              faDownLeftAndUpRightToCenter: () => (
                /* binding */
                _
              ),
              /* harmony export */
              faDownLong: () => (
                /* binding */
                dW
              ),
              /* harmony export */
              faDownload: () => (
                /* binding */
                VB
              ),
              /* harmony export */
              faDraftingCompass: () => (
                /* binding */
                Ae
              ),
              /* harmony export */
              faDragon: () => (
                /* binding */
                uK
              ),
              /* harmony export */
              faDrawPolygon: () => (
                /* binding */
                VK
              ),
              /* harmony export */
              faDriversLicense: () => (
                /* binding */
                EB
              ),
              /* harmony export */
              faDroplet: () => (
                /* binding */
                ct
              ),
              /* harmony export */
              faDropletSlash: () => (
                /* binding */
                a2
              ),
              /* harmony export */
              faDrum: () => (
                /* binding */
                Ix
              ),
              /* harmony export */
              faDrumSteelpan: () => (
                /* binding */
                qT
              ),
              /* harmony export */
              faDrumstickBite: () => (
                /* binding */
                sd
              ),
              /* harmony export */
              faDumbbell: () => (
                /* binding */
                _j
              ),
              /* harmony export */
              faDumpster: () => (
                /* binding */
                k6
              ),
              /* harmony export */
              faDumpsterFire: () => (
                /* binding */
                yP
              ),
              /* harmony export */
              faDungeon: () => (
                /* binding */
                jJ
              ),
              /* harmony export */
              faE: () => (
                /* binding */
                u7
              ),
              /* harmony export */
              faEarDeaf: () => (
                /* binding */
                dP
              ),
              /* harmony export */
              faEarListen: () => (
                /* binding */
                $B
              ),
              /* harmony export */
              faEarth: () => (
                /* binding */
                Si
              ),
              /* harmony export */
              faEarthAfrica: () => (
                /* binding */
                er
              ),
              /* harmony export */
              faEarthAmerica: () => (
                /* binding */
                os
              ),
              /* harmony export */
              faEarthAmericas: () => (
                /* binding */
                Yr
              ),
              /* harmony export */
              faEarthAsia: () => (
                /* binding */
                Gk
              ),
              /* harmony export */
              faEarthEurope: () => (
                /* binding */
                kk
              ),
              /* harmony export */
              faEarthOceania: () => (
                /* binding */
                Tk
              ),
              /* harmony export */
              faEdit: () => (
                /* binding */
                Ku
              ),
              /* harmony export */
              faEgg: () => (
                /* binding */
                yc
              ),
              /* harmony export */
              faEject: () => (
                /* binding */
                U3
              ),
              /* harmony export */
              faElevator: () => (
                /* binding */
                qX
              ),
              /* harmony export */
              faEllipsis: () => (
                /* binding */
                v0
              ),
              /* harmony export */
              faEllipsisH: () => (
                /* binding */
                S8
              ),
              /* harmony export */
              faEllipsisV: () => (
                /* binding */
                P2
              ),
              /* harmony export */
              faEllipsisVertical: () => (
                /* binding */
                l2
              ),
              /* harmony export */
              faEnvelope: () => (
                /* binding */
                YX
              ),
              /* harmony export */
              faEnvelopeCircleCheck: () => (
                /* binding */
                L4
              ),
              /* harmony export */
              faEnvelopeOpen: () => (
                /* binding */
                fB
              ),
              /* harmony export */
              faEnvelopeOpenText: () => (
                /* binding */
                o1
              ),
              /* harmony export */
              faEnvelopeSquare: () => (
                /* binding */
                EJ
              ),
              /* harmony export */
              faEnvelopesBulk: () => (
                /* binding */
                j1
              ),
              /* harmony export */
              faEquals: () => (
                /* binding */
                Lt
              ),
              /* harmony export */
              faEraser: () => (
                /* binding */
                wr
              ),
              /* harmony export */
              faEthernet: () => (
                /* binding */
                C4
              ),
              /* harmony export */
              faEur: () => (
                /* binding */
                uo
              ),
              /* harmony export */
              faEuro: () => (
                /* binding */
                BP
              ),
              /* harmony export */
              faEuroSign: () => (
                /* binding */
                q3
              ),
              /* harmony export */
              faExchange: () => (
                /* binding */
                FB
              ),
              /* harmony export */
              faExchangeAlt: () => (
                /* binding */
                bJ
              ),
              /* harmony export */
              faExclamation: () => (
                /* binding */
                jz
              ),
              /* harmony export */
              faExclamationCircle: () => (
                /* binding */
                sP
              ),
              /* harmony export */
              faExclamationTriangle: () => (
                /* binding */
                cJ
              ),
              /* harmony export */
              faExpand: () => (
                /* binding */
                JV
              ),
              /* harmony export */
              faExpandAlt: () => (
                /* binding */
                zL
              ),
              /* harmony export */
              faExpandArrowsAlt: () => (
                /* binding */
                Kp
              ),
              /* harmony export */
              faExplosion: () => (
                /* binding */
                L
              ),
              /* harmony export */
              faExternalLink: () => (
                /* binding */
                Pb
              ),
              /* harmony export */
              faExternalLinkAlt: () => (
                /* binding */
                uf
              ),
              /* harmony export */
              faExternalLinkSquare: () => (
                /* binding */
                Eq
              ),
              /* harmony export */
              faExternalLinkSquareAlt: () => (
                /* binding */
                z0
              ),
              /* harmony export */
              faEye: () => (
                /* binding */
                k3
              ),
              /* harmony export */
              faEyeDropper: () => (
                /* binding */
                hx
              ),
              /* harmony export */
              faEyeDropperEmpty: () => (
                /* binding */
                CB
              ),
              /* harmony export */
              faEyeLowVision: () => (
                /* binding */
                dh
              ),
              /* harmony export */
              faEyeSlash: () => (
                /* binding */
                Es
              ),
              /* harmony export */
              faEyedropper: () => (
                /* binding */
                OB
              ),
              /* harmony export */
              faF: () => (
                /* binding */
                Y6
              ),
              /* harmony export */
              faFaceAngry: () => (
                /* binding */
                Wk
              ),
              /* harmony export */
              faFaceDizzy: () => (
                /* binding */
                kA
              ),
              /* harmony export */
              faFaceFlushed: () => (
                /* binding */
                Na
              ),
              /* harmony export */
              faFaceFrown: () => (
                /* binding */
                jr
              ),
              /* harmony export */
              faFaceFrownOpen: () => (
                /* binding */
                uP
              ),
              /* harmony export */
              faFaceGrimace: () => (
                /* binding */
                Mk
              ),
              /* harmony export */
              faFaceGrin: () => (
                /* binding */
                fw
              ),
              /* harmony export */
              faFaceGrinBeam: () => (
                /* binding */
                v6
              ),
              /* harmony export */
              faFaceGrinBeamSweat: () => (
                /* binding */
                uk
              ),
              /* harmony export */
              faFaceGrinHearts: () => (
                /* binding */
                ak
              ),
              /* harmony export */
              faFaceGrinSquint: () => (
                /* binding */
                Fh
              ),
              /* harmony export */
              faFaceGrinSquintTears: () => (
                /* binding */
                t2
              ),
              /* harmony export */
              faFaceGrinStars: () => (
                /* binding */
                Vr
              ),
              /* harmony export */
              faFaceGrinTears: () => (
                /* binding */
                JP
              ),
              /* harmony export */
              faFaceGrinTongue: () => (
                /* binding */
                vo
              ),
              /* harmony export */
              faFaceGrinTongueSquint: () => (
                /* binding */
                R6
              ),
              /* harmony export */
              faFaceGrinTongueWink: () => (
                /* binding */
                jk
              ),
              /* harmony export */
              faFaceGrinWide: () => (
                /* binding */
                r6
              ),
              /* harmony export */
              faFaceGrinWink: () => (
                /* binding */
                ov
              ),
              /* harmony export */
              faFaceKiss: () => (
                /* binding */
                Ya
              ),
              /* harmony export */
              faFaceKissBeam: () => (
                /* binding */
                Ic
              ),
              /* harmony export */
              faFaceKissWinkHeart: () => (
                /* binding */
                dj
              ),
              /* harmony export */
              faFaceLaugh: () => (
                /* binding */
                o3
              ),
              /* harmony export */
              faFaceLaughBeam: () => (
                /* binding */
                Xr
              ),
              /* harmony export */
              faFaceLaughSquint: () => (
                /* binding */
                XP
              ),
              /* harmony export */
              faFaceLaughWink: () => (
                /* binding */
                IH
              ),
              /* harmony export */
              faFaceMeh: () => (
                /* binding */
                WH
              ),
              /* harmony export */
              faFaceMehBlank: () => (
                /* binding */
                yh
              ),
              /* harmony export */
              faFaceRollingEyes: () => (
                /* binding */
                jd
              ),
              /* harmony export */
              faFaceSadCry: () => (
                /* binding */
                mX
              ),
              /* harmony export */
              faFaceSadTear: () => (
                /* binding */
                iE
              ),
              /* harmony export */
              faFaceSmile: () => (
                /* binding */
                tk
              ),
              /* harmony export */
              faFaceSmileBeam: () => (
                /* binding */
                an
              ),
              /* harmony export */
              faFaceSmileWink: () => (
                /* binding */
                $q
              ),
              /* harmony export */
              faFaceSurprise: () => (
                /* binding */
                z7
              ),
              /* harmony export */
              faFaceTired: () => (
                /* binding */
                tX
              ),
              /* harmony export */
              faFan: () => (
                /* binding */
                iK
              ),
              /* harmony export */
              faFastBackward: () => (
                /* binding */
                TA
              ),
              /* harmony export */
              faFastForward: () => (
                /* binding */
                nH
              ),
              /* harmony export */
              faFaucet: () => (
                /* binding */
                A2
              ),
              /* harmony export */
              faFaucetDrip: () => (
                /* binding */
                ql
              ),
              /* harmony export */
              faFax: () => (
                /* binding */
                TV
              ),
              /* harmony export */
              faFeather: () => (
                /* binding */
                Be
              ),
              /* harmony export */
              faFeatherAlt: () => (
                /* binding */
                sj
              ),
              /* harmony export */
              faFeatherPointed: () => (
                /* binding */
                m3
              ),
              /* harmony export */
              faFeed: () => (
                /* binding */
                RK
              ),
              /* harmony export */
              faFemale: () => (
                /* binding */
                bu
              ),
              /* harmony export */
              faFerry: () => (
                /* binding */
                gh
              ),
              /* harmony export */
              faFighterJet: () => (
                /* binding */
                zz
              ),
              /* harmony export */
              faFile: () => (
                /* binding */
                Te
              ),
              /* harmony export */
              faFileAlt: () => (
                /* binding */
                ae
              ),
              /* harmony export */
              faFileArchive: () => (
                /* binding */
                PX
              ),
              /* harmony export */
              faFileArrowDown: () => (
                /* binding */
                Xw
              ),
              /* harmony export */
              faFileArrowUp: () => (
                /* binding */
                X7
              ),
              /* harmony export */
              faFileAudio: () => (
                /* binding */
                dT
              ),
              /* harmony export */
              faFileCircleCheck: () => (
                /* binding */
                Aw
              ),
              /* harmony export */
              faFileCircleExclamation: () => (
                /* binding */
                di
              ),
              /* harmony export */
              faFileCircleMinus: () => (
                /* binding */
                Wd
              ),
              /* harmony export */
              faFileCirclePlus: () => (
                /* binding */
                wK
              ),
              /* harmony export */
              faFileCircleQuestion: () => (
                /* binding */
                tP
              ),
              /* harmony export */
              faFileCircleXmark: () => (
                /* binding */
                ww
              ),
              /* harmony export */
              faFileClipboard: () => (
                /* binding */
                h1
              ),
              /* harmony export */
              faFileCode: () => (
                /* binding */
                pT
              ),
              /* harmony export */
              faFileContract: () => (
                /* binding */
                E1
              ),
              /* harmony export */
              faFileCsv: () => (
                /* binding */
                Ur
              ),
              /* harmony export */
              faFileDownload: () => (
                /* binding */
                bx
              ),
              /* harmony export */
              faFileEdit: () => (
                /* binding */
                nW
              ),
              /* harmony export */
              faFileExcel: () => (
                /* binding */
                s1
              ),
              /* harmony export */
              faFileExport: () => (
                /* binding */
                lk
              ),
              /* harmony export */
              faFileImage: () => (
                /* binding */
                Bj
              ),
              /* harmony export */
              faFileImport: () => (
                /* binding */
                kD
              ),
              /* harmony export */
              faFileInvoice: () => (
                /* binding */
                rz
              ),
              /* harmony export */
              faFileInvoiceDollar: () => (
                /* binding */
                gd
              ),
              /* harmony export */
              faFileLines: () => (
                /* binding */
                $
              ),
              /* harmony export */
              faFileMedical: () => (
                /* binding */
                rc
              ),
              /* harmony export */
              faFileMedicalAlt: () => (
                /* binding */
                Jc
              ),
              /* harmony export */
              faFilePdf: () => (
                /* binding */
                un
              ),
              /* harmony export */
              faFilePen: () => (
                /* binding */
                Iw
              ),
              /* harmony export */
              faFilePowerpoint: () => (
                /* binding */
                oX
              ),
              /* harmony export */
              faFilePrescription: () => (
                /* binding */
                s3
              ),
              /* harmony export */
              faFileShield: () => (
                /* binding */
                BX
              ),
              /* harmony export */
              faFileSignature: () => (
                /* binding */
                pB
              ),
              /* harmony export */
              faFileText: () => (
                /* binding */
                Pe
              ),
              /* harmony export */
              faFileUpload: () => (
                /* binding */
                Ng
              ),
              /* harmony export */
              faFileVideo: () => (
                /* binding */
                ur
              ),
              /* harmony export */
              faFileWaveform: () => (
                /* binding */
                kp
              ),
              /* harmony export */
              faFileWord: () => (
                /* binding */
                rB
              ),
              /* harmony export */
              faFileZipper: () => (
                /* binding */
                lX
              ),
              /* harmony export */
              faFill: () => (
                /* binding */
                kd
              ),
              /* harmony export */
              faFillDrip: () => (
                /* binding */
                j
              ),
              /* harmony export */
              faFilm: () => (
                /* binding */
                dA
              ),
              /* harmony export */
              faFilter: () => (
                /* binding */
                pX
              ),
              /* harmony export */
              faFilterCircleDollar: () => (
                /* binding */
                y4
              ),
              /* harmony export */
              faFilterCircleXmark: () => (
                /* binding */
                G4
              ),
              /* harmony export */
              faFingerprint: () => (
                /* binding */
                Gt
              ),
              /* harmony export */
              faFire: () => (
                /* binding */
                sf
              ),
              /* harmony export */
              faFireAlt: () => (
                /* binding */
                DK
              ),
              /* harmony export */
              faFireBurner: () => (
                /* binding */
                G9
              ),
              /* harmony export */
              faFireExtinguisher: () => (
                /* binding */
                AX
              ),
              /* harmony export */
              faFireFlameCurved: () => (
                /* binding */
                mk
              ),
              /* harmony export */
              faFireFlameSimple: () => (
                /* binding */
                Fr
              ),
              /* harmony export */
              faFirstAid: () => (
                /* binding */
                Dw
              ),
              /* harmony export */
              faFish: () => (
                /* binding */
                _U
              ),
              /* harmony export */
              faFishFins: () => (
                /* binding */
                ZA
              ),
              /* harmony export */
              faFistRaised: () => (
                /* binding */
                $K
              ),
              /* harmony export */
              faFlag: () => (
                /* binding */
                yA
              ),
              /* harmony export */
              faFlagCheckered: () => (
                /* binding */
                rr
              ),
              /* harmony export */
              faFlagUsa: () => (
                /* binding */
                sw
              ),
              /* harmony export */
              faFlask: () => (
                /* binding */
                wu
              ),
              /* harmony export */
              faFlaskVial: () => (
                /* binding */
                FA
              ),
              /* harmony export */
              faFloppyDisk: () => (
                /* binding */
                bn
              ),
              /* harmony export */
              faFlorinSign: () => (
                /* binding */
                bw
              ),
              /* harmony export */
              faFlushed: () => (
                /* binding */
                Ao
              ),
              /* harmony export */
              faFolder: () => (
                /* binding */
                Wg
              ),
              /* harmony export */
              faFolderBlank: () => (
                /* binding */
                g4
              ),
              /* harmony export */
              faFolderClosed: () => (
                /* binding */
                Oq
              ),
              /* harmony export */
              faFolderMinus: () => (
                /* binding */
                mn
              ),
              /* harmony export */
              faFolderOpen: () => (
                /* binding */
                sh
              ),
              /* harmony export */
              faFolderPlus: () => (
                /* binding */
                kc
              ),
              /* harmony export */
              faFolderTree: () => (
                /* binding */
                tc
              ),
              /* harmony export */
              faFont: () => (
                /* binding */
                DV
              ),
              /* harmony export */
              faFontAwesome: () => (
                /* binding */
                F4
              ),
              /* harmony export */
              faFontAwesomeFlag: () => (
                /* binding */
                N4
              ),
              /* harmony export */
              faFontAwesomeLogoFull: () => (
                /* binding */
                rX
              ),
              /* harmony export */
              faFootball: () => (
                /* binding */
                Sr
              ),
              /* harmony export */
              faFootballBall: () => (
                /* binding */
                nr
              ),
              /* harmony export */
              faForward: () => (
                /* binding */
                yB
              ),
              /* harmony export */
              faForwardFast: () => (
                /* binding */
                Xl
              ),
              /* harmony export */
              faForwardStep: () => (
                /* binding */
                sn
              ),
              /* harmony export */
              faFrancSign: () => (
                /* binding */
                Wl
              ),
              /* harmony export */
              faFrog: () => (
                /* binding */
                Cq
              ),
              /* harmony export */
              faFrown: () => (
                /* binding */
                Ud
              ),
              /* harmony export */
              faFrownOpen: () => (
                /* binding */
                R1
              ),
              /* harmony export */
              faFunnelDollar: () => (
                /* binding */
                Jm
              ),
              /* harmony export */
              faFutbol: () => (
                /* binding */
                Pa
              ),
              /* harmony export */
              faFutbolBall: () => (
                /* binding */
                nv
              ),
              /* harmony export */
              faG: () => (
                /* binding */
                mg
              ),
              /* harmony export */
              faGamepad: () => (
                /* binding */
                _1
              ),
              /* harmony export */
              faGasPump: () => (
                /* binding */
                Vp
              ),
              /* harmony export */
              faGauge: () => (
                /* binding */
                Gc
              ),
              /* harmony export */
              faGaugeHigh: () => (
                /* binding */
                Nn
              ),
              /* harmony export */
              faGaugeMed: () => (
                /* binding */
                j9
              ),
              /* harmony export */
              faGaugeSimple: () => (
                /* binding */
                wT
              ),
              /* harmony export */
              faGaugeSimpleHigh: () => (
                /* binding */
                nC
              ),
              /* harmony export */
              faGaugeSimpleMed: () => (
                /* binding */
                zP
              ),
              /* harmony export */
              faGavel: () => (
                /* binding */
                W1
              ),
              /* harmony export */
              faGbp: () => (
                /* binding */
                Jn
              ),
              /* harmony export */
              faGear: () => (
                /* binding */
                Z3
              ),
              /* harmony export */
              faGears: () => (
                /* binding */
                sk
              ),
              /* harmony export */
              faGem: () => (
                /* binding */
                wP
              ),
              /* harmony export */
              faGenderless: () => (
                /* binding */
                WM
              ),
              /* harmony export */
              faGhost: () => (
                /* binding */
                x9
              ),
              /* harmony export */
              faGift: () => (
                /* binding */
                q7
              ),
              /* harmony export */
              faGifts: () => (
                /* binding */
                JJ
              ),
              /* harmony export */
              faGlassCheers: () => (
                /* binding */
                g7
              ),
              /* harmony export */
              faGlassMartini: () => (
                /* binding */
                ij
              ),
              /* harmony export */
              faGlassMartiniAlt: () => (
                /* binding */
                Zg
              ),
              /* harmony export */
              faGlassWater: () => (
                /* binding */
                j8
              ),
              /* harmony export */
              faGlassWaterDroplet: () => (
                /* binding */
                MM
              ),
              /* harmony export */
              faGlassWhiskey: () => (
                /* binding */
                jh
              ),
              /* harmony export */
              faGlasses: () => (
                /* binding */
                qP
              ),
              /* harmony export */
              faGlobe: () => (
                /* binding */
                qs
              ),
              /* harmony export */
              faGlobeAfrica: () => (
                /* binding */
                _r
              ),
              /* harmony export */
              faGlobeAmericas: () => (
                /* binding */
                Ci
              ),
              /* harmony export */
              faGlobeAsia: () => (
                /* binding */
                GJ
              ),
              /* harmony export */
              faGlobeEurope: () => (
                /* binding */
                aJ
              ),
              /* harmony export */
              faGlobeOceania: () => (
                /* binding */
                ML
              ),
              /* harmony export */
              faGolfBall: () => (
                /* binding */
                DL
              ),
              /* harmony export */
              faGolfBallTee: () => (
                /* binding */
                pk
              ),
              /* harmony export */
              faGopuram: () => (
                /* binding */
                YL
              ),
              /* harmony export */
              faGraduationCap: () => (
                /* binding */
                uE
              ),
              /* harmony export */
              faGreaterThan: () => (
                /* binding */
                Ce
              ),
              /* harmony export */
              faGreaterThanEqual: () => (
                /* binding */
                vB
              ),
              /* harmony export */
              faGrimace: () => (
                /* binding */
                CJ
              ),
              /* harmony export */
              faGrin: () => (
                /* binding */
                mu
              ),
              /* harmony export */
              faGrinAlt: () => (
                /* binding */
                Dg
              ),
              /* harmony export */
              faGrinBeam: () => (
                /* binding */
                Xj
              ),
              /* harmony export */
              faGrinBeamSweat: () => (
                /* binding */
                XL
              ),
              /* harmony export */
              faGrinHearts: () => (
                /* binding */
                oL
              ),
              /* harmony export */
              faGrinSquint: () => (
                /* binding */
                gT
              ),
              /* harmony export */
              faGrinSquintTears: () => (
                /* binding */
                ZT
              ),
              /* harmony export */
              faGrinStars: () => (
                /* binding */
                Lr
              ),
              /* harmony export */
              faGrinTears: () => (
                /* binding */
                OX
              ),
              /* harmony export */
              faGrinTongue: () => (
                /* binding */
                NA
              ),
              /* harmony export */
              faGrinTongueSquint: () => (
                /* binding */
                Bf
              ),
              /* harmony export */
              faGrinTongueWink: () => (
                /* binding */
                cK
              ),
              /* harmony export */
              faGrinWink: () => (
                /* binding */
                QA
              ),
              /* harmony export */
              faGrip: () => (
                /* binding */
                XW
              ),
              /* harmony export */
              faGripHorizontal: () => (
                /* binding */
                QV
              ),
              /* harmony export */
              faGripLines: () => (
                /* binding */
                ip
              ),
              /* harmony export */
              faGripLinesVertical: () => (
                /* binding */
                P7
              ),
              /* harmony export */
              faGripVertical: () => (
                /* binding */
                $P
              ),
              /* harmony export */
              faGroupArrowsRotate: () => (
                /* binding */
                zD
              ),
              /* harmony export */
              faGuaraniSign: () => (
                /* binding */
                rb
              ),
              /* harmony export */
              faGuitar: () => (
                /* binding */
                cf
              ),
              /* harmony export */
              faGun: () => (
                /* binding */
                MV
              ),
              /* harmony export */
              faH: () => (
                /* binding */
                Wh
              ),
              /* harmony export */
              faHSquare: () => (
                /* binding */
                Bx
              ),
              /* harmony export */
              faHamburger: () => (
                /* binding */
                vT
              ),
              /* harmony export */
              faHammer: () => (
                /* binding */
                ZM
              ),
              /* harmony export */
              faHamsa: () => (
                /* binding */
                P8
              ),
              /* harmony export */
              faHand: () => (
                /* binding */
                Qa
              ),
              /* harmony export */
              faHandBackFist: () => (
                /* binding */
                qd
              ),
              /* harmony export */
              faHandDots: () => (
                /* binding */
                $k
              ),
              /* harmony export */
              faHandFist: () => (
                /* binding */
                Ok
              ),
              /* harmony export */
              faHandHolding: () => (
                /* binding */
                pK
              ),
              /* harmony export */
              faHandHoldingDollar: () => (
                /* binding */
                XT
              ),
              /* harmony export */
              faHandHoldingDroplet: () => (
                /* binding */
                KT
              ),
              /* harmony export */
              faHandHoldingHand: () => (
                /* binding */
                JB
              ),
              /* harmony export */
              faHandHoldingHeart: () => (
                /* binding */
                _4
              ),
              /* harmony export */
              faHandHoldingMedical: () => (
                /* binding */
                tG
              ),
              /* harmony export */
              faHandHoldingUsd: () => (
                /* binding */
                TT
              ),
              /* harmony export */
              faHandHoldingWater: () => (
                /* binding */
                Jb
              ),
              /* harmony export */
              faHandLizard: () => (
                /* binding */
                fp
              ),
              /* harmony export */
              faHandMiddleFinger: () => (
                /* binding */
                NM
              ),
              /* harmony export */
              faHandPaper: () => (
                /* binding */
                fn
              ),
              /* harmony export */
              faHandPeace: () => (
                /* binding */
                _M
              ),
              /* harmony export */
              faHandPointDown: () => (
                /* binding */
                d7
              ),
              /* harmony export */
              faHandPointLeft: () => (
                /* binding */
                Kz
              ),
              /* harmony export */
              faHandPointRight: () => (
                /* binding */
                xr
              ),
              /* harmony export */
              faHandPointUp: () => (
                /* binding */
                dv
              ),
              /* harmony export */
              faHandPointer: () => (
                /* binding */
                Cj
              ),
              /* harmony export */
              faHandRock: () => (
                /* binding */
                Yg
              ),
              /* harmony export */
              faHandScissors: () => (
                /* binding */
                oH
              ),
              /* harmony export */
              faHandSparkles: () => (
                /* binding */
                Cx
              ),
              /* harmony export */
              faHandSpock: () => (
                /* binding */
                uA
              ),
              /* harmony export */
              faHandcuffs: () => (
                /* binding */
                PJ
              ),
              /* harmony export */
              faHands: () => (
                /* binding */
                aC
              ),
              /* harmony export */
              faHandsAmericanSignLanguageInterpreting: () => (
                /* binding */
                i8
              ),
              /* harmony export */
              faHandsAslInterpreting: () => (
                /* binding */
                lf
              ),
              /* harmony export */
              faHandsBound: () => (
                /* binding */
                V1
              ),
              /* harmony export */
              faHandsBubbles: () => (
                /* binding */
                Pu
              ),
              /* harmony export */
              faHandsClapping: () => (
                /* binding */
                GP
              ),
              /* harmony export */
              faHandsHelping: () => (
                /* binding */
                K
              ),
              /* harmony export */
              faHandsHolding: () => (
                /* binding */
                BT
              ),
              /* harmony export */
              faHandsHoldingChild: () => (
                /* binding */
                Sn
              ),
              /* harmony export */
              faHandsHoldingCircle: () => (
                /* binding */
                j2
              ),
              /* harmony export */
              faHandsPraying: () => (
                /* binding */
                N3
              ),
              /* harmony export */
              faHandsWash: () => (
                /* binding */
                x7
              ),
              /* harmony export */
              faHandshake: () => (
                /* binding */
                m7
              ),
              /* harmony export */
              faHandshakeAlt: () => (
                /* binding */
                Jz
              ),
              /* harmony export */
              faHandshakeAltSlash: () => (
                /* binding */
                AB
              ),
              /* harmony export */
              faHandshakeAngle: () => (
                /* binding */
                F
              ),
              /* harmony export */
              faHandshakeSimple: () => (
                /* binding */
                fE
              ),
              /* harmony export */
              faHandshakeSimpleSlash: () => (
                /* binding */
                tj
              ),
              /* harmony export */
              faHandshakeSlash: () => (
                /* binding */
                Ih
              ),
              /* harmony export */
              faHanukiah: () => (
                /* binding */
                e7
              ),
              /* harmony export */
              faHardDrive: () => (
                /* binding */
                $b
              ),
              /* harmony export */
              faHardHat: () => (
                /* binding */
                Y7
              ),
              /* harmony export */
              faHardOfHearing: () => (
                /* binding */
                Yc
              ),
              /* harmony export */
              faHashtag: () => (
                /* binding */
                JL
              ),
              /* harmony export */
              faHatCowboy: () => (
                /* binding */
                Wj
              ),
              /* harmony export */
              faHatCowboySide: () => (
                /* binding */
                Zh
              ),
              /* harmony export */
              faHatHard: () => (
                /* binding */
                M7
              ),
              /* harmony export */
              faHatWizard: () => (
                /* binding */
                Yh
              ),
              /* harmony export */
              faHaykal: () => (
                /* binding */
                dK
              ),
              /* harmony export */
              faHdd: () => (
                /* binding */
                GT
              ),
              /* harmony export */
              faHeadSideCough: () => (
                /* binding */
                d0
              ),
              /* harmony export */
              faHeadSideCoughSlash: () => (
                /* binding */
                el
              ),
              /* harmony export */
              faHeadSideMask: () => (
                /* binding */
                yq
              ),
              /* harmony export */
              faHeadSideVirus: () => (
                /* binding */
                Qh
              ),
              /* harmony export */
              faHeader: () => (
                /* binding */
                ia
              ),
              /* harmony export */
              faHeading: () => (
                /* binding */
                S1
              ),
              /* harmony export */
              faHeadphones: () => (
                /* binding */
                Kh
              ),
              /* harmony export */
              faHeadphonesAlt: () => (
                /* binding */
                _0
              ),
              /* harmony export */
              faHeadphonesSimple: () => (
                /* binding */
                Ip
              ),
              /* harmony export */
              faHeadset: () => (
                /* binding */
                af
              ),
              /* harmony export */
              faHeart: () => (
                /* binding */
                Tj
              ),
              /* harmony export */
              faHeartBroken: () => (
                /* binding */
                mp
              ),
              /* harmony export */
              faHeartCircleBolt: () => (
                /* binding */
                BU
              ),
              /* harmony export */
              faHeartCircleCheck: () => (
                /* binding */
                ll
              ),
              /* harmony export */
              faHeartCircleExclamation: () => (
                /* binding */
                dw
              ),
              /* harmony export */
              faHeartCircleMinus: () => (
                /* binding */
                Ju
              ),
              /* harmony export */
              faHeartCirclePlus: () => (
                /* binding */
                ah
              ),
              /* harmony export */
              faHeartCircleXmark: () => (
                /* binding */
                B9
              ),
              /* harmony export */
              faHeartCrack: () => (
                /* binding */
                nP
              ),
              /* harmony export */
              faHeartMusicCameraBolt: () => (
                /* binding */
                Xn
              ),
              /* harmony export */
              faHeartPulse: () => (
                /* binding */
                ou
              ),
              /* harmony export */
              faHeartbeat: () => (
                /* binding */
                p7
              ),
              /* harmony export */
              faHelicopter: () => (
                /* binding */
                t1
              ),
              /* harmony export */
              faHelicopterSymbol: () => (
                /* binding */
                Tn
              ),
              /* harmony export */
              faHelmetSafety: () => (
                /* binding */
                mh
              ),
              /* harmony export */
              faHelmetUn: () => (
                /* binding */
                lP
              ),
              /* harmony export */
              faHighlighter: () => (
                /* binding */
                Ar
              ),
              /* harmony export */
              faHiking: () => (
                /* binding */
                mH
              ),
              /* harmony export */
              faHillAvalanche: () => (
                /* binding */
                ND
              ),
              /* harmony export */
              faHillRockslide: () => (
                /* binding */
                qJ
              ),
              /* harmony export */
              faHippo: () => (
                /* binding */
                _L
              ),
              /* harmony export */
              faHistory: () => (
                /* binding */
                gL
              ),
              /* harmony export */
              faHockeyPuck: () => (
                /* binding */
                $l
              ),
              /* harmony export */
              faHollyBerry: () => (
                /* binding */
                c0
              ),
              /* harmony export */
              faHome: () => (
                /* binding */
                vw
              ),
              /* harmony export */
              faHomeAlt: () => (
                /* binding */
                uw
              ),
              /* harmony export */
              faHomeLg: () => (
                /* binding */
                WX
              ),
              /* harmony export */
              faHomeLgAlt: () => (
                /* binding */
                Bu
              ),
              /* harmony export */
              faHomeUser: () => (
                /* binding */
                qj
              ),
              /* harmony export */
              faHorse: () => (
                /* binding */
                hd
              ),
              /* harmony export */
              faHorseHead: () => (
                /* binding */
                b2
              ),
              /* harmony export */
              faHospital: () => (
                /* binding */
                pa
              ),
              /* harmony export */
              faHospitalAlt: () => (
                /* binding */
                pf
              ),
              /* harmony export */
              faHospitalSymbol: () => (
                /* binding */
                B6
              ),
              /* harmony export */
              faHospitalUser: () => (
                /* binding */
                Ro
              ),
              /* harmony export */
              faHospitalWide: () => (
                /* binding */
                Ls
              ),
              /* harmony export */
              faHotTub: () => (
                /* binding */
                fP
              ),
              /* harmony export */
              faHotTubPerson: () => (
                /* binding */
                Fc
              ),
              /* harmony export */
              faHotdog: () => (
                /* binding */
                P0
              ),
              /* harmony export */
              faHotel: () => (
                /* binding */
                zJ
              ),
              /* harmony export */
              faHourglass: () => (
                /* binding */
                Rd
              ),
              /* harmony export */
              faHourglass1: () => (
                /* binding */
                Iq
              ),
              /* harmony export */
              faHourglass2: () => (
                /* binding */
                n7
              ),
              /* harmony export */
              faHourglass3: () => (
                /* binding */
                Zv
              ),
              /* harmony export */
              faHourglassEmpty: () => (
                /* binding */
                Yb
              ),
              /* harmony export */
              faHourglassEnd: () => (
                /* binding */
                C6
              ),
              /* harmony export */
              faHourglassHalf: () => (
                /* binding */
                AP
              ),
              /* harmony export */
              faHourglassStart: () => (
                /* binding */
                Zp
              ),
              /* harmony export */
              faHouse: () => (
                /* binding */
                X8
              ),
              /* harmony export */
              faHouseChimney: () => (
                /* binding */
                E3
              ),
              /* harmony export */
              faHouseChimneyCrack: () => (
                /* binding */
                xd
              ),
              /* harmony export */
              faHouseChimneyMedical: () => (
                /* binding */
                jH
              ),
              /* harmony export */
              faHouseChimneyUser: () => (
                /* binding */
                hB
              ),
              /* harmony export */
              faHouseChimneyWindow: () => (
                /* binding */
                wL
              ),
              /* harmony export */
              faHouseCircleCheck: () => (
                /* binding */
                JK
              ),
              /* harmony export */
              faHouseCircleExclamation: () => (
                /* binding */
                j4
              ),
              /* harmony export */
              faHouseCircleXmark: () => (
                /* binding */
                Ni
              ),
              /* harmony export */
              faHouseCrack: () => (
                /* binding */
                Sh
              ),
              /* harmony export */
              faHouseDamage: () => (
                /* binding */
                Pl
              ),
              /* harmony export */
              faHouseFire: () => (
                /* binding */
                J0
              ),
              /* harmony export */
              faHouseFlag: () => (
                /* binding */
                $c
              ),
              /* harmony export */
              faHouseFloodWater: () => (
                /* binding */
                Wq
              ),
              /* harmony export */
              faHouseFloodWaterCircleArrowRight: () => (
                /* binding */
                Z7
              ),
              /* harmony export */
              faHouseLaptop: () => (
                /* binding */
                x3
              ),
              /* harmony export */
              faHouseLock: () => (
                /* binding */
                nB
              ),
              /* harmony export */
              faHouseMedical: () => (
                /* binding */
                xL
              ),
              /* harmony export */
              faHouseMedicalCircleCheck: () => (
                /* binding */
                Du
              ),
              /* harmony export */
              faHouseMedicalCircleExclamation: () => (
                /* binding */
                SB
              ),
              /* harmony export */
              faHouseMedicalCircleXmark: () => (
                /* binding */
                Bq
              ),
              /* harmony export */
              faHouseMedicalFlag: () => (
                /* binding */
                TB
              ),
              /* harmony export */
              faHouseSignal: () => (
                /* binding */
                sH
              ),
              /* harmony export */
              faHouseTsunami: () => (
                /* binding */
                S4
              ),
              /* harmony export */
              faHouseUser: () => (
                /* binding */
                F1
              ),
              /* harmony export */
              faHryvnia: () => (
                /* binding */
                ef
              ),
              /* harmony export */
              faHryvniaSign: () => (
                /* binding */
                PA
              ),
              /* harmony export */
              faHurricane: () => (
                /* binding */
                LB
              ),
              /* harmony export */
              faI: () => (
                /* binding */
                zf
              ),
              /* harmony export */
              faICursor: () => (
                /* binding */
                $u
              ),
              /* harmony export */
              faIceCream: () => (
                /* binding */
                mU
              ),
              /* harmony export */
              faIcicles: () => (
                /* binding */
                Re
              ),
              /* harmony export */
              faIcons: () => (
                /* binding */
                br
              ),
              /* harmony export */
              faIdBadge: () => (
                /* binding */
                Jt
              ),
              /* harmony export */
              faIdCard: () => (
                /* binding */
                id
              ),
              /* harmony export */
              faIdCardAlt: () => (
                /* binding */
                ZJ
              ),
              /* harmony export */
              faIdCardClip: () => (
                /* binding */
                Zk
              ),
              /* harmony export */
              faIgloo: () => (
                /* binding */
                Gf
              ),
              /* harmony export */
              faIls: () => (
                /* binding */
                Pi
              ),
              /* harmony export */
              faImage: () => (
                /* binding */
                m4
              ),
              /* harmony export */
              faImagePortrait: () => (
                /* binding */
                yk
              ),
              /* harmony export */
              faImages: () => (
                /* binding */
                UB
              ),
              /* harmony export */
              faInbox: () => (
                /* binding */
                Or
              ),
              /* harmony export */
              faIndent: () => (
                /* binding */
                YT
              ),
              /* harmony export */
              faIndianRupee: () => (
                /* binding */
                t8
              ),
              /* harmony export */
              faIndianRupeeSign: () => (
                /* binding */
                Fo
              ),
              /* harmony export */
              faIndustry: () => (
                /* binding */
                A0
              ),
              /* harmony export */
              faInfinity: () => (
                /* binding */
                eK
              ),
              /* harmony export */
              faInfo: () => (
                /* binding */
                fe
              ),
              /* harmony export */
              faInfoCircle: () => (
                /* binding */
                LT
              ),
              /* harmony export */
              faInr: () => (
                /* binding */
                jB
              ),
              /* harmony export */
              faInstitution: () => (
                /* binding */
                yz
              ),
              /* harmony export */
              faItalic: () => (
                /* binding */
                ob
              ),
              /* harmony export */
              faJ: () => (
                /* binding */
                Cb
              ),
              /* harmony export */
              faJar: () => (
                /* binding */
                hz
              ),
              /* harmony export */
              faJarWheat: () => (
                /* binding */
                Ri
              ),
              /* harmony export */
              faJedi: () => (
                /* binding */
                hv
              ),
              /* harmony export */
              faJetFighter: () => (
                /* binding */
                AE
              ),
              /* harmony export */
              faJetFighterUp: () => (
                /* binding */
                nI
              ),
              /* harmony export */
              faJoint: () => (
                /* binding */
                Av
              ),
              /* harmony export */
              faJournalWhills: () => (
                /* binding */
                lJ
              ),
              /* harmony export */
              faJpy: () => (
                /* binding */
                Tw
              ),
              /* harmony export */
              faJugDetergent: () => (
                /* binding */
                yV
              ),
              /* harmony export */
              faK: () => (
                /* binding */
                Ho
              ),
              /* harmony export */
              faKaaba: () => (
                /* binding */
                tT
              ),
              /* harmony export */
              faKey: () => (
                /* binding */
                Zt
              ),
              /* harmony export */
              faKeyboard: () => (
                /* binding */
                d8
              ),
              /* harmony export */
              faKhanda: () => (
                /* binding */
                mB
              ),
              /* harmony export */
              faKipSign: () => (
                /* binding */
                Lz
              ),
              /* harmony export */
              faKiss: () => (
                /* binding */
                Uf
              ),
              /* harmony export */
              faKissBeam: () => (
                /* binding */
                iP
              ),
              /* harmony export */
              faKissWinkHeart: () => (
                /* binding */
                vj
              ),
              /* harmony export */
              faKitMedical: () => (
                /* binding */
                CH
              ),
              /* harmony export */
              faKitchenSet: () => (
                /* binding */
                R3
              ),
              /* harmony export */
              faKiwiBird: () => (
                /* binding */
                Pw
              ),
              /* harmony export */
              faKrw: () => (
                /* binding */
                UP
              ),
              /* harmony export */
              faL: () => (
                /* binding */
                du
              ),
              /* harmony export */
              faLadderWater: () => (
                /* binding */
                IJ
              ),
              /* harmony export */
              faLandMineOn: () => (
                /* binding */
                e6
              ),
              /* harmony export */
              faLandmark: () => (
                /* binding */
                zj
              ),
              /* harmony export */
              faLandmarkAlt: () => (
                /* binding */
                EU
              ),
              /* harmony export */
              faLandmarkDome: () => (
                /* binding */
                kU
              ),
              /* harmony export */
              faLandmarkFlag: () => (
                /* binding */
                X9
              ),
              /* harmony export */
              faLanguage: () => (
                /* binding */
                cB
              ),
              /* harmony export */
              faLaptop: () => (
                /* binding */
                $t
              ),
              /* harmony export */
              faLaptopCode: () => (
                /* binding */
                AA
              ),
              /* harmony export */
              faLaptopFile: () => (
                /* binding */
                WB
              ),
              /* harmony export */
              faLaptopHouse: () => (
                /* binding */
                Kq
              ),
              /* harmony export */
              faLaptopMedical: () => (
                /* binding */
                Cd
              ),
              /* harmony export */
              faLariSign: () => (
                /* binding */
                mt
              ),
              /* harmony export */
              faLaugh: () => (
                /* binding */
                kg
              ),
              /* harmony export */
              faLaughBeam: () => (
                /* binding */
                Dr
              ),
              /* harmony export */
              faLaughSquint: () => (
                /* binding */
                ol
              ),
              /* harmony export */
              faLaughWink: () => (
                /* binding */
                w8
              ),
              /* harmony export */
              faLayerGroup: () => (
                /* binding */
                nj
              ),
              /* harmony export */
              faLeaf: () => (
                /* binding */
                F7
              ),
              /* harmony export */
              faLeftLong: () => (
                /* binding */
                e0
              ),
              /* harmony export */
              faLeftRight: () => (
                /* binding */
                JD
              ),
              /* harmony export */
              faLegal: () => (
                /* binding */
                je
              ),
              /* harmony export */
              faLemon: () => (
                /* binding */
                jP
              ),
              /* harmony export */
              faLessThan: () => (
                /* binding */
                Dx
              ),
              /* harmony export */
              faLessThanEqual: () => (
                /* binding */
                vl
              ),
              /* harmony export */
              faLevelDown: () => (
                /* binding */
                uL
              ),
              /* harmony export */
              faLevelDownAlt: () => (
                /* binding */
                yJ
              ),
              /* harmony export */
              faLevelUp: () => (
                /* binding */
                r0
              ),
              /* harmony export */
              faLevelUpAlt: () => (
                /* binding */
                nG
              ),
              /* harmony export */
              faLifeRing: () => (
                /* binding */
                BJ
              ),
              /* harmony export */
              faLightbulb: () => (
                /* binding */
                Vc
              ),
              /* harmony export */
              faLineChart: () => (
                /* binding */
                HX
              ),
              /* harmony export */
              faLinesLeaning: () => (
                /* binding */
                qt
              ),
              /* harmony export */
              faLink: () => (
                /* binding */
                Uw
              ),
              /* harmony export */
              faLinkSlash: () => (
                /* binding */
                aI
              ),
              /* harmony export */
              faLiraSign: () => (
                /* binding */
                Ej
              ),
              /* harmony export */
              faList: () => (
                /* binding */
                Jf
              ),
              /* harmony export */
              faList12: () => (
                /* binding */
                Aj
              ),
              /* harmony export */
              faListAlt: () => (
                /* binding */
                ml
              ),
              /* harmony export */
              faListCheck: () => (
                /* binding */
                QU
              ),
              /* harmony export */
              faListDots: () => (
                /* binding */
                VV
              ),
              /* harmony export */
              faListNumeric: () => (
                /* binding */
                Z4
              ),
              /* harmony export */
              faListOl: () => (
                /* binding */
                k7
              ),
              /* harmony export */
              faListSquares: () => (
                /* binding */
                Vo
              ),
              /* harmony export */
              faListUl: () => (
                /* binding */
                Rw
              ),
              /* harmony export */
              faLitecoinSign: () => (
                /* binding */
                Fj
              ),
              /* harmony export */
              faLocation: () => (
                /* binding */
                Y3
              ),
              /* harmony export */
              faLocationArrow: () => (
                /* binding */
                nl
              ),
              /* harmony export */
              faLocationCrosshairs: () => (
                /* binding */
                VX
              ),
              /* harmony export */
              faLocationDot: () => (
                /* binding */
                oe
              ),
              /* harmony export */
              faLocationPin: () => (
                /* binding */
                IP
              ),
              /* harmony export */
              faLocationPinLock: () => (
                /* binding */
                FD
              ),
              /* harmony export */
              faLock: () => (
                /* binding */
                Ec
              ),
              /* harmony export */
              faLockOpen: () => (
                /* binding */
                iT
              ),
              /* harmony export */
              faLocust: () => (
                /* binding */
                oj
              ),
              /* harmony export */
              faLongArrowAltDown: () => (
                /* binding */
                CV
              ),
              /* harmony export */
              faLongArrowAltLeft: () => (
                /* binding */
                n9
              ),
              /* harmony export */
              faLongArrowAltRight: () => (
                /* binding */
                BB
              ),
              /* harmony export */
              faLongArrowAltUp: () => (
                /* binding */
                YB
              ),
              /* harmony export */
              faLongArrowDown: () => (
                /* binding */
                pu
              ),
              /* harmony export */
              faLongArrowLeft: () => (
                /* binding */
                c6
              ),
              /* harmony export */
              faLongArrowRight: () => (
                /* binding */
                W8
              ),
              /* harmony export */
              faLongArrowUp: () => (
                /* binding */
                vr
              ),
              /* harmony export */
              faLowVision: () => (
                /* binding */
                Kg
              ),
              /* harmony export */
              faLuggageCart: () => (
                /* binding */
                oJ
              ),
              /* harmony export */
              faLungs: () => (
                /* binding */
                FT
              ),
              /* harmony export */
              faLungsVirus: () => (
                /* binding */
                Ib
              ),
              /* harmony export */
              faM: () => (
                /* binding */
                FK
              ),
              /* harmony export */
              faMagic: () => (
                /* binding */
                SL
              ),
              /* harmony export */
              faMagicWandSparkles: () => (
                /* binding */
                uv
              ),
              /* harmony export */
              faMagnet: () => (
                /* binding */
                pz
              ),
              /* harmony export */
              faMagnifyingGlass: () => (
                /* binding */
                SU
              ),
              /* harmony export */
              faMagnifyingGlassArrowRight: () => (
                /* binding */
                ld
              ),
              /* harmony export */
              faMagnifyingGlassChart: () => (
                /* binding */
                hj
              ),
              /* harmony export */
              faMagnifyingGlassDollar: () => (
                /* binding */
                sE
              ),
              /* harmony export */
              faMagnifyingGlassLocation: () => (
                /* binding */
                Br
              ),
              /* harmony export */
              faMagnifyingGlassMinus: () => (
                /* binding */
                tE
              ),
              /* harmony export */
              faMagnifyingGlassPlus: () => (
                /* binding */
                _k
              ),
              /* harmony export */
              faMailBulk: () => (
                /* binding */
                w1
              ),
              /* harmony export */
              faMailForward: () => (
                /* binding */
                gJ
              ),
              /* harmony export */
              faMailReply: () => (
                /* binding */
                _d
              ),
              /* harmony export */
              faMailReplyAll: () => (
                /* binding */
                VD
              ),
              /* harmony export */
              faMale: () => (
                /* binding */
                it
              ),
              /* harmony export */
              faManatSign: () => (
                /* binding */
                Ah
              ),
              /* harmony export */
              faMap: () => (
                /* binding */
                fr
              ),
              /* harmony export */
              faMapLocation: () => (
                /* binding */
                r7
              ),
              /* harmony export */
              faMapLocationDot: () => (
                /* binding */
                T7
              ),
              /* harmony export */
              faMapMarked: () => (
                /* binding */
                Tg
              ),
              /* harmony export */
              faMapMarkedAlt: () => (
                /* binding */
                P3
              ),
              /* harmony export */
              faMapMarker: () => (
                /* binding */
                M6
              ),
              /* harmony export */
              faMapMarkerAlt: () => (
                /* binding */
                ce
              ),
              /* harmony export */
              faMapPin: () => (
                /* binding */
                u2
              ),
              /* harmony export */
              faMapSigns: () => (
                /* binding */
                L7
              ),
              /* harmony export */
              faMarker: () => (
                /* binding */
                Wr
              ),
              /* harmony export */
              faMars: () => (
                /* binding */
                ic
              ),
              /* harmony export */
              faMarsAndVenus: () => (
                /* binding */
                OP
              ),
              /* harmony export */
              faMarsAndVenusBurst: () => (
                /* binding */
                ws
              ),
              /* harmony export */
              faMarsDouble: () => (
                /* binding */
                KP
              ),
              /* harmony export */
              faMarsStroke: () => (
                /* binding */
                Ug
              ),
              /* harmony export */
              faMarsStrokeH: () => (
                /* binding */
                k1
              ),
              /* harmony export */
              faMarsStrokeRight: () => (
                /* binding */
                If
              ),
              /* harmony export */
              faMarsStrokeUp: () => (
                /* binding */
                zA
              ),
              /* harmony export */
              faMarsStrokeV: () => (
                /* binding */
                D4
              ),
              /* harmony export */
              faMartiniGlass: () => (
                /* binding */
                N6
              ),
              /* harmony export */
              faMartiniGlassCitrus: () => (
                /* binding */
                Tv
              ),
              /* harmony export */
              faMartiniGlassEmpty: () => (
                /* binding */
                sb
              ),
              /* harmony export */
              faMask: () => (
                /* binding */
                az
              ),
              /* harmony export */
              faMaskFace: () => (
                /* binding */
                TJ
              ),
              /* harmony export */
              faMaskVentilator: () => (
                /* binding */
                gA
              ),
              /* harmony export */
              faMasksTheater: () => (
                /* binding */
                oE
              ),
              /* harmony export */
              faMattressPillow: () => (
                /* binding */
                tb
              ),
              /* harmony export */
              faMaximize: () => (
                /* binding */
                Lp
              ),
              /* harmony export */
              faMedal: () => (
                /* binding */
                ap
              ),
              /* harmony export */
              faMedkit: () => (
                /* binding */
                PH
              ),
              /* harmony export */
              faMeh: () => (
                /* binding */
                kB
              ),
              /* harmony export */
              faMehBlank: () => (
                /* binding */
                iH
              ),
              /* harmony export */
              faMehRollingEyes: () => (
                /* binding */
                VP
              ),
              /* harmony export */
              faMemory: () => (
                /* binding */
                rv
              ),
              /* harmony export */
              faMenorah: () => (
                /* binding */
                $e
              ),
              /* harmony export */
              faMercury: () => (
                /* binding */
                vL
              ),
              /* harmony export */
              faMessage: () => (
                /* binding */
                Z
              ),
              /* harmony export */
              faMeteor: () => (
                /* binding */
                Yj
              ),
              /* harmony export */
              faMicrochip: () => (
                /* binding */
                gP
              ),
              /* harmony export */
              faMicrophone: () => (
                /* binding */
                $a
              ),
              /* harmony export */
              faMicrophoneAlt: () => (
                /* binding */
                H7
              ),
              /* harmony export */
              faMicrophoneAltSlash: () => (
                /* binding */
                En
              ),
              /* harmony export */
              faMicrophoneLines: () => (
                /* binding */
                Fg
              ),
              /* harmony export */
              faMicrophoneLinesSlash: () => (
                /* binding */
                qr
              ),
              /* harmony export */
              faMicrophoneSlash: () => (
                /* binding */
                kt
              ),
              /* harmony export */
              faMicroscope: () => (
                /* binding */
                av
              ),
              /* harmony export */
              faMillSign: () => (
                /* binding */
                pw
              ),
              /* harmony export */
              faMinimize: () => (
                /* binding */
                uh
              ),
              /* harmony export */
              faMinus: () => (
                /* binding */
                t0
              ),
              /* harmony export */
              faMinusCircle: () => (
                /* binding */
                bt
              ),
              /* harmony export */
              faMinusSquare: () => (
                /* binding */
                Uc
              ),
              /* harmony export */
              faMitten: () => (
                /* binding */
                Gu
              ),
              /* harmony export */
              faMobile: () => (
                /* binding */
                h8
              ),
              /* harmony export */
              faMobileAlt: () => (
                /* binding */
                bX
              ),
              /* harmony export */
              faMobileAndroid: () => (
                /* binding */
                H8
              ),
              /* harmony export */
              faMobileAndroidAlt: () => (
                /* binding */
                u8
              ),
              /* harmony export */
              faMobileButton: () => (
                /* binding */
                Db
              ),
              /* harmony export */
              faMobilePhone: () => (
                /* binding */
                Hx
              ),
              /* harmony export */
              faMobileRetro: () => (
                /* binding */
                Ma
              ),
              /* harmony export */
              faMobileScreen: () => (
                /* binding */
                W9
              ),
              /* harmony export */
              faMobileScreenButton: () => (
                /* binding */
                qb
              ),
              /* harmony export */
              faMoneyBill: () => (
                /* binding */
                ru
              ),
              /* harmony export */
              faMoneyBill1: () => (
                /* binding */
                rd
              ),
              /* harmony export */
              faMoneyBill1Wave: () => (
                /* binding */
                Qk
              ),
              /* harmony export */
              faMoneyBillAlt: () => (
                /* binding */
                Bl
              ),
              /* harmony export */
              faMoneyBillTransfer: () => (
                /* binding */
                G7
              ),
              /* harmony export */
              faMoneyBillTrendUp: () => (
                /* binding */
                xj
              ),
              /* harmony export */
              faMoneyBillWave: () => (
                /* binding */
                LA
              ),
              /* harmony export */
              faMoneyBillWaveAlt: () => (
                /* binding */
                mJ
              ),
              /* harmony export */
              faMoneyBillWheat: () => (
                /* binding */
                _X
              ),
              /* harmony export */
              faMoneyBills: () => (
                /* binding */
                zq
              ),
              /* harmony export */
              faMoneyCheck: () => (
                /* binding */
                Pj
              ),
              /* harmony export */
              faMoneyCheckAlt: () => (
                /* binding */
                uB
              ),
              /* harmony export */
              faMoneyCheckDollar: () => (
                /* binding */
                xh
              ),
              /* harmony export */
              faMonument: () => (
                /* binding */
                B7
              ),
              /* harmony export */
              faMoon: () => (
                /* binding */
                RL
              ),
              /* harmony export */
              faMortarBoard: () => (
                /* binding */
                eG
              ),
              /* harmony export */
              faMortarPestle: () => (
                /* binding */
                qo
              ),
              /* harmony export */
              faMosque: () => (
                /* binding */
                ix
              ),
              /* harmony export */
              faMosquito: () => (
                /* binding */
                a8
              ),
              /* harmony export */
              faMosquitoNet: () => (
                /* binding */
                DT
              ),
              /* harmony export */
              faMotorcycle: () => (
                /* binding */
                Cr
              ),
              /* harmony export */
              faMound: () => (
                /* binding */
                KB
              ),
              /* harmony export */
              faMountain: () => (
                /* binding */
                JX
              ),
              /* harmony export */
              faMountainCity: () => (
                /* binding */
                vx
              ),
              /* harmony export */
              faMountainSun: () => (
                /* binding */
                jw
              ),
              /* harmony export */
              faMouse: () => (
                /* binding */
                zp
              ),
              /* harmony export */
              faMousePointer: () => (
                /* binding */
                Mp
              ),
              /* harmony export */
              faMugHot: () => (
                /* binding */
                A6
              ),
              /* harmony export */
              faMugSaucer: () => (
                /* binding */
                eE
              ),
              /* harmony export */
              faMultiply: () => (
                /* binding */
                xW
              ),
              /* harmony export */
              faMuseum: () => (
                /* binding */
                kz
              ),
              /* harmony export */
              faMusic: () => (
                /* binding */
                yL
              ),
              /* harmony export */
              faN: () => (
                /* binding */
                IB
              ),
              /* harmony export */
              faNairaSign: () => (
                /* binding */
                m2
              ),
              /* harmony export */
              faNavicon: () => (
                /* binding */
                cd
              ),
              /* harmony export */
              faNetworkWired: () => (
                /* binding */
                iw
              ),
              /* harmony export */
              faNeuter: () => (
                /* binding */
                lt
              ),
              /* harmony export */
              faNewspaper: () => (
                /* binding */
                cl
              ),
              /* harmony export */
              faNotEqual: () => (
                /* binding */
                l3
              ),
              /* harmony export */
              faNotdef: () => (
                /* binding */
                eC
              ),
              /* harmony export */
              faNoteSticky: () => (
                /* binding */
                nE
              ),
              /* harmony export */
              faNotesMedical: () => (
                /* binding */
                YA
              ),
              /* harmony export */
              faO: () => (
                /* binding */
                G6
              ),
              /* harmony export */
              faObjectGroup: () => (
                /* binding */
                xo
              ),
              /* harmony export */
              faObjectUngroup: () => (
                /* binding */
                hX
              ),
              /* harmony export */
              faOilCan: () => (
                /* binding */
                GL
              ),
              /* harmony export */
              faOilWell: () => (
                /* binding */
                g1
              ),
              /* harmony export */
              faOm: () => (
                /* binding */
                Zu
              ),
              /* harmony export */
              faOtter: () => (
                /* binding */
                yb
              ),
              /* harmony export */
              faOutdent: () => (
                /* binding */
                wv
              ),
              /* harmony export */
              faP: () => (
                /* binding */
                O7
              ),
              /* harmony export */
              faPager: () => (
                /* binding */
                W6
              ),
              /* harmony export */
              faPaintBrush: () => (
                /* binding */
                t7
              ),
              /* harmony export */
              faPaintRoller: () => (
                /* binding */
                U
              ),
              /* harmony export */
              faPaintbrush: () => (
                /* binding */
                O6
              ),
              /* harmony export */
              faPalette: () => (
                /* binding */
                nX
              ),
              /* harmony export */
              faPallet: () => (
                /* binding */
                fx
              ),
              /* harmony export */
              faPanorama: () => (
                /* binding */
                u6
              ),
              /* harmony export */
              faPaperPlane: () => (
                /* binding */
                xJ
              ),
              /* harmony export */
              faPaperclip: () => (
                /* binding */
                kT
              ),
              /* harmony export */
              faParachuteBox: () => (
                /* binding */
                Nj
              ),
              /* harmony export */
              faParagraph: () => (
                /* binding */
                qV
              ),
              /* harmony export */
              faParking: () => (
                /* binding */
                kh
              ),
              /* harmony export */
              faPassport: () => (
                /* binding */
                ts
              ),
              /* harmony export */
              faPastafarianism: () => (
                /* binding */
                Cn
              ),
              /* harmony export */
              faPaste: () => (
                /* binding */
                B1
              ),
              /* harmony export */
              faPause: () => (
                /* binding */
                Fq
              ),
              /* harmony export */
              faPauseCircle: () => (
                /* binding */
                XA
              ),
              /* harmony export */
              faPaw: () => (
                /* binding */
                qi
              ),
              /* harmony export */
              faPeace: () => (
                /* binding */
                rL
              ),
              /* harmony export */
              faPen: () => (
                /* binding */
                pn
              ),
              /* harmony export */
              faPenAlt: () => (
                /* binding */
                Di
              ),
              /* harmony export */
              faPenClip: () => (
                /* binding */
                y6
              ),
              /* harmony export */
              faPenFancy: () => (
                /* binding */
                xv
              ),
              /* harmony export */
              faPenNib: () => (
                /* binding */
                mL
              ),
              /* harmony export */
              faPenRuler: () => (
                /* binding */
                si
              ),
              /* harmony export */
              faPenSquare: () => (
                /* binding */
                SV
              ),
              /* harmony export */
              faPenToSquare: () => (
                /* binding */
                Lu
              ),
              /* harmony export */
              faPencil: () => (
                /* binding */
                $o
              ),
              /* harmony export */
              faPencilAlt: () => (
                /* binding */
                T9
              ),
              /* harmony export */
              faPencilRuler: () => (
                /* binding */
                ss
              ),
              /* harmony export */
              faPencilSquare: () => (
                /* binding */
                UV
              ),
              /* harmony export */
              faPeopleArrows: () => (
                /* binding */
                hs
              ),
              /* harmony export */
              faPeopleArrowsLeftRight: () => (
                /* binding */
                js
              ),
              /* harmony export */
              faPeopleCarry: () => (
                /* binding */
                b4
              ),
              /* harmony export */
              faPeopleCarryBox: () => (
                /* binding */
                Cg
              ),
              /* harmony export */
              faPeopleGroup: () => (
                /* binding */
                Xo
              ),
              /* harmony export */
              faPeopleLine: () => (
                /* binding */
                Ii
              ),
              /* harmony export */
              faPeoplePulling: () => (
                /* binding */
                cx
              ),
              /* harmony export */
              faPeopleRobbery: () => (
                /* binding */
                G0
              ),
              /* harmony export */
              faPeopleRoof: () => (
                /* binding */
                Rr
              ),
              /* harmony export */
              faPepperHot: () => (
                /* binding */
                f3
              ),
              /* harmony export */
              faPercent: () => (
                /* binding */
                ek
              ),
              /* harmony export */
              faPercentage: () => (
                /* binding */
                QM
              ),
              /* harmony export */
              faPerson: () => (
                /* binding */
                ds
              ),
              /* harmony export */
              faPersonArrowDownToLine: () => (
                /* binding */
                rK
              ),
              /* harmony export */
              faPersonArrowUpFromLine: () => (
                /* binding */
                G1
              ),
              /* harmony export */
              faPersonBiking: () => (
                /* binding */
                Xk
              ),
              /* harmony export */
              faPersonBooth: () => (
                /* binding */
                Oj
              ),
              /* harmony export */
              faPersonBreastfeeding: () => (
                /* binding */
                al
              ),
              /* harmony export */
              faPersonBurst: () => (
                /* binding */
                ea
              ),
              /* harmony export */
              faPersonCane: () => (
                /* binding */
                xu
              ),
              /* harmony export */
              faPersonChalkboard: () => (
                /* binding */
                y1
              ),
              /* harmony export */
              faPersonCircleCheck: () => (
                /* binding */
                rG
              ),
              /* harmony export */
              faPersonCircleExclamation: () => (
                /* binding */
                sW
              ),
              /* harmony export */
              faPersonCircleMinus: () => (
                /* binding */
                Qp
              ),
              /* harmony export */
              faPersonCirclePlus: () => (
                /* binding */
                N7
              ),
              /* harmony export */
              faPersonCircleQuestion: () => (
                /* binding */
                gX
              ),
              /* harmony export */
              faPersonCircleXmark: () => (
                /* binding */
                eo
              ),
              /* harmony export */
              faPersonDigging: () => (
                /* binding */
                EX
              ),
              /* harmony export */
              faPersonDotsFromLine: () => (
                /* binding */
                Uv
              ),
              /* harmony export */
              faPersonDress: () => (
                /* binding */
                FX
              ),
              /* harmony export */
              faPersonDressBurst: () => (
                /* binding */
                pl
              ),
              /* harmony export */
              faPersonDrowning: () => (
                /* binding */
                e1
              ),
              /* harmony export */
              faPersonFalling: () => (
                /* binding */
                rJ
              ),
              /* harmony export */
              faPersonFallingBurst: () => (
                /* binding */
                lL
              ),
              /* harmony export */
              faPersonHalfDress: () => (
                /* binding */
                iu
              ),
              /* harmony export */
              faPersonHarassing: () => (
                /* binding */
                Vx
              ),
              /* harmony export */
              faPersonHiking: () => (
                /* binding */
                ep
              ),
              /* harmony export */
              faPersonMilitaryPointing: () => (
                /* binding */
                Cz
              ),
              /* harmony export */
              faPersonMilitaryRifle: () => (
                /* binding */
                xH
              ),
              /* harmony export */
              faPersonMilitaryToPerson: () => (
                /* binding */
                mb
              ),
              /* harmony export */
              faPersonPraying: () => (
                /* binding */
                nk
              ),
              /* harmony export */
              faPersonPregnant: () => (
                /* binding */
                ux
              ),
              /* harmony export */
              faPersonRays: () => (
                /* binding */
                Sq
              ),
              /* harmony export */
              faPersonRifle: () => (
                /* binding */
                p6
              ),
              /* harmony export */
              faPersonRunning: () => (
                /* binding */
                s6
              ),
              /* harmony export */
              faPersonShelter: () => (
                /* binding */
                ot
              ),
              /* harmony export */
              faPersonSkating: () => (
                /* binding */
                OD
              ),
              /* harmony export */
              faPersonSkiing: () => (
                /* binding */
                t9
              ),
              /* harmony export */
              faPersonSkiingNordic: () => (
                /* binding */
                _T
              ),
              /* harmony export */
              faPersonSnowboarding: () => (
                /* binding */
                cW
              ),
              /* harmony export */
              faPersonSwimming: () => (
                /* binding */
                tt
              ),
              /* harmony export */
              faPersonThroughWindow: () => (
                /* binding */
                u0
              ),
              /* harmony export */
              faPersonWalking: () => (
                /* binding */
                TP
              ),
              /* harmony export */
              faPersonWalkingArrowLoopLeft: () => (
                /* binding */
                bK
              ),
              /* harmony export */
              faPersonWalkingArrowRight: () => (
                /* binding */
                kJ
              ),
              /* harmony export */
              faPersonWalkingDashedLineArrowRight: () => (
                /* binding */
                It
              ),
              /* harmony export */
              faPersonWalkingLuggage: () => (
                /* binding */
                sK
              ),
              /* harmony export */
              faPersonWalkingWithCane: () => (
                /* binding */
                op
              ),
              /* harmony export */
              faPesetaSign: () => (
                /* binding */
                Ys
              ),
              /* harmony export */
              faPesoSign: () => (
                /* binding */
                X
              ),
              /* harmony export */
              faPhone: () => (
                /* binding */
                qB
              ),
              /* harmony export */
              faPhoneAlt: () => (
                /* binding */
                FP
              ),
              /* harmony export */
              faPhoneFlip: () => (
                /* binding */
                Rh
              ),
              /* harmony export */
              faPhoneSlash: () => (
                /* binding */
                x
              ),
              /* harmony export */
              faPhoneSquare: () => (
                /* binding */
                LV
              ),
              /* harmony export */
              faPhoneSquareAlt: () => (
                /* binding */
                vA
              ),
              /* harmony export */
              faPhoneVolume: () => (
                /* binding */
                bB
              ),
              /* harmony export */
              faPhotoFilm: () => (
                /* binding */
                Nr
              ),
              /* harmony export */
              faPhotoVideo: () => (
                /* binding */
                kn
              ),
              /* harmony export */
              faPieChart: () => (
                /* binding */
                Hv
              ),
              /* harmony export */
              faPiggyBank: () => (
                /* binding */
                dx
              ),
              /* harmony export */
              faPills: () => (
                /* binding */
                $v
              ),
              /* harmony export */
              faPingPongPaddleBall: () => (
                /* binding */
                UU
              ),
              /* harmony export */
              faPizzaSlice: () => (
                /* binding */
                i6
              ),
              /* harmony export */
              faPlaceOfWorship: () => (
                /* binding */
                DH
              ),
              /* harmony export */
              faPlane: () => (
                /* binding */
                xz
              ),
              /* harmony export */
              faPlaneArrival: () => (
                /* binding */
                rx
              ),
              /* harmony export */
              faPlaneCircleCheck: () => (
                /* binding */
                hl
              ),
              /* harmony export */
              faPlaneCircleExclamation: () => (
                /* binding */
                X4
              ),
              /* harmony export */
              faPlaneCircleXmark: () => (
                /* binding */
                sc
              ),
              /* harmony export */
              faPlaneDeparture: () => (
                /* binding */
                a1
              ),
              /* harmony export */
              faPlaneLock: () => (
                /* binding */
                Qb
              ),
              /* harmony export */
              faPlaneSlash: () => (
                /* binding */
                C3
              ),
              /* harmony export */
              faPlaneUp: () => (
                /* binding */
                nd
              ),
              /* harmony export */
              faPlantWilt: () => (
                /* binding */
                F3
              ),
              /* harmony export */
              faPlateWheat: () => (
                /* binding */
                pe
              ),
              /* harmony export */
              faPlay: () => (
                /* binding */
                eW
              ),
              /* harmony export */
              faPlayCircle: () => (
                /* binding */
                Ph
              ),
              /* harmony export */
              faPlug: () => (
                /* binding */
                _s
              ),
              /* harmony export */
              faPlugCircleBolt: () => (
                /* binding */
                Hb
              ),
              /* harmony export */
              faPlugCircleCheck: () => (
                /* binding */
                No
              ),
              /* harmony export */
              faPlugCircleExclamation: () => (
                /* binding */
                hK
              ),
              /* harmony export */
              faPlugCircleMinus: () => (
                /* binding */
                ro
              ),
              /* harmony export */
              faPlugCirclePlus: () => (
                /* binding */
                sx
              ),
              /* harmony export */
              faPlugCircleXmark: () => (
                /* binding */
                Ux
              ),
              /* harmony export */
              faPlus: () => (
                /* binding */
                iI
              ),
              /* harmony export */
              faPlusCircle: () => (
                /* binding */
                PK
              ),
              /* harmony export */
              faPlusMinus: () => (
                /* binding */
                _z
              ),
              /* harmony export */
              faPlusSquare: () => (
                /* binding */
                zg
              ),
              /* harmony export */
              faPodcast: () => (
                /* binding */
                GB
              ),
              /* harmony export */
              faPoll: () => (
                /* binding */
                fl
              ),
              /* harmony export */
              faPollH: () => (
                /* binding */
                Tb
              ),
              /* harmony export */
              faPoo: () => (
                /* binding */
                Id
              ),
              /* harmony export */
              faPooBolt: () => (
                /* binding */
                tu
              ),
              /* harmony export */
              faPooStorm: () => (
                /* binding */
                MA
              ),
              /* harmony export */
              faPoop: () => (
                /* binding */
                wh
              ),
              /* harmony export */
              faPortrait: () => (
                /* binding */
                nJ
              ),
              /* harmony export */
              faPoundSign: () => (
                /* binding */
                On
              ),
              /* harmony export */
              faPowerOff: () => (
                /* binding */
                p2
              ),
              /* harmony export */
              faPray: () => (
                /* binding */
                GM
              ),
              /* harmony export */
              faPrayingHands: () => (
                /* binding */
                IX
              ),
              /* harmony export */
              faPrescription: () => (
                /* binding */
                bl
              ),
              /* harmony export */
              faPrescriptionBottle: () => (
                /* binding */
                Qu
              ),
              /* harmony export */
              faPrescriptionBottleAlt: () => (
                /* binding */
                Jj
              ),
              /* harmony export */
              faPrescriptionBottleMedical: () => (
                /* binding */
                zb
              ),
              /* harmony export */
              faPrint: () => (
                /* binding */
                mz
              ),
              /* harmony export */
              faProcedures: () => (
                /* binding */
                Un
              ),
              /* harmony export */
              faProjectDiagram: () => (
                /* binding */
                FV
              ),
              /* harmony export */
              faPumpMedical: () => (
                /* binding */
                Fi
              ),
              /* harmony export */
              faPumpSoap: () => (
                /* binding */
                RM
              ),
              /* harmony export */
              faPuzzlePiece: () => (
                /* binding */
                lj
              ),
              /* harmony export */
              faQ: () => (
                /* binding */
                f7
              ),
              /* harmony export */
              faQrcode: () => (
                /* binding */
                HL
              ),
              /* harmony export */
              faQuestion: () => (
                /* binding */
                uj
              ),
              /* harmony export */
              faQuestionCircle: () => (
                /* binding */
                $7
              ),
              /* harmony export */
              faQuidditch: () => (
                /* binding */
                Sa
              ),
              /* harmony export */
              faQuidditchBroomBall: () => (
                /* binding */
                Fn
              ),
              /* harmony export */
              faQuoteLeft: () => (
                /* binding */
                ie
              ),
              /* harmony export */
              faQuoteLeftAlt: () => (
                /* binding */
                le
              ),
              /* harmony export */
              faQuoteRight: () => (
                /* binding */
                Eo
              ),
              /* harmony export */
              faQuoteRightAlt: () => (
                /* binding */
                N1
              ),
              /* harmony export */
              faQuran: () => (
                /* binding */
                mK
              ),
              /* harmony export */
              faR: () => (
                /* binding */
                qv
              ),
              /* harmony export */
              faRadiation: () => (
                /* binding */
                Ep
              ),
              /* harmony export */
              faRadiationAlt: () => (
                /* binding */
                kV
              ),
              /* harmony export */
              faRadio: () => (
                /* binding */
                OM
              ),
              /* harmony export */
              faRainbow: () => (
                /* binding */
                Xi
              ),
              /* harmony export */
              faRandom: () => (
                /* binding */
                Hd
              ),
              /* harmony export */
              faRankingStar: () => (
                /* binding */
                OU
              ),
              /* harmony export */
              faReceipt: () => (
                /* binding */
                yH
              ),
              /* harmony export */
              faRecordVinyl: () => (
                /* binding */
                cr
              ),
              /* harmony export */
              faRectangleAd: () => (
                /* binding */
                y7
              ),
              /* harmony export */
              faRectangleList: () => (
                /* binding */
                $h
              ),
              /* harmony export */
              faRectangleTimes: () => (
                /* binding */
                fJ
              ),
              /* harmony export */
              faRectangleXmark: () => (
                /* binding */
                oI
              ),
              /* harmony export */
              faRecycle: () => (
                /* binding */
                md
              ),
              /* harmony export */
              faRedo: () => (
                /* binding */
                Q3
              ),
              /* harmony export */
              faRedoAlt: () => (
                /* binding */
                mv
              ),
              /* harmony export */
              faRefresh: () => (
                /* binding */
                nb
              ),
              /* harmony export */
              faRegistered: () => (
                /* binding */
                YD
              ),
              /* harmony export */
              faRemove: () => (
                /* binding */
                ZV
              ),
              /* harmony export */
              faRemoveFormat: () => (
                /* binding */
                ZD
              ),
              /* harmony export */
              faReorder: () => (
                /* binding */
                Rl
              ),
              /* harmony export */
              faRepeat: () => (
                /* binding */
                KA
              ),
              /* harmony export */
              faReply: () => (
                /* binding */
                Gv
              ),
              /* harmony export */
              faReplyAll: () => (
                /* binding */
                kq
              ),
              /* harmony export */
              faRepublican: () => (
                /* binding */
                ZP
              ),
              /* harmony export */
              faRestroom: () => (
                /* binding */
                zh
              ),
              /* harmony export */
              faRetweet: () => (
                /* binding */
                UM
              ),
              /* harmony export */
              faRibbon: () => (
                /* binding */
                ET
              ),
              /* harmony export */
              faRightFromBracket: () => (
                /* binding */
                Tt
              ),
              /* harmony export */
              faRightLeft: () => (
                /* binding */
                Nk
              ),
              /* harmony export */
              faRightLong: () => (
                /* binding */
                Cf
              ),
              /* harmony export */
              faRightToBracket: () => (
                /* binding */
                _p
              ),
              /* harmony export */
              faRing: () => (
                /* binding */
                me
              ),
              /* harmony export */
              faRmb: () => (
                /* binding */
                T2
              ),
              /* harmony export */
              faRoad: () => (
                /* binding */
                gj
              ),
              /* harmony export */
              faRoadBarrier: () => (
                /* binding */
                a7
              ),
              /* harmony export */
              faRoadBridge: () => (
                /* binding */
                Ra
              ),
              /* harmony export */
              faRoadCircleCheck: () => (
                /* binding */
                i7
              ),
              /* harmony export */
              faRoadCircleExclamation: () => (
                /* binding */
                DJ
              ),
              /* harmony export */
              faRoadCircleXmark: () => (
                /* binding */
                A3
              ),
              /* harmony export */
              faRoadLock: () => (
                /* binding */
                Dd
              ),
              /* harmony export */
              faRoadSpikes: () => (
                /* binding */
                Oc
              ),
              /* harmony export */
              faRobot: () => (
                /* binding */
                tL
              ),
              /* harmony export */
              faRocket: () => (
                /* binding */
                Ct
              ),
              /* harmony export */
              faRodAsclepius: () => (
                /* binding */
                tf
              ),
              /* harmony export */
              faRodSnake: () => (
                /* binding */
                fv
              ),
              /* harmony export */
              faRotate: () => (
                /* binding */
                ik
              ),
              /* harmony export */
              faRotateBack: () => (
                /* binding */
                cu
              ),
              /* harmony export */
              faRotateBackward: () => (
                /* binding */
                H3
              ),
              /* harmony export */
              faRotateForward: () => (
                /* binding */
                SH
              ),
              /* harmony export */
              faRotateLeft: () => (
                /* binding */
                w7
              ),
              /* harmony export */
              faRotateRight: () => (
                /* binding */
                g2
              ),
              /* harmony export */
              faRouble: () => (
                /* binding */
                X1
              ),
              /* harmony export */
              faRoute: () => (
                /* binding */
                Ch
              ),
              /* harmony export */
              faRss: () => (
                /* binding */
                Sk
              ),
              /* harmony export */
              faRssSquare: () => (
                /* binding */
                _v
              ),
              /* harmony export */
              faRub: () => (
                /* binding */
                i9
              ),
              /* harmony export */
              faRuble: () => (
                /* binding */
                Il
              ),
              /* harmony export */
              faRubleSign: () => (
                /* binding */
                U9
              ),
              /* harmony export */
              faRug: () => (
                /* binding */
                sJ
              ),
              /* harmony export */
              faRuler: () => (
                /* binding */
                vf
              ),
              /* harmony export */
              faRulerCombined: () => (
                /* binding */
                Ht
              ),
              /* harmony export */
              faRulerHorizontal: () => (
                /* binding */
                Rc
              ),
              /* harmony export */
              faRulerVertical: () => (
                /* binding */
                fz
              ),
              /* harmony export */
              faRunning: () => (
                /* binding */
                Uq
              ),
              /* harmony export */
              faRupee: () => (
                /* binding */
                mj
              ),
              /* harmony export */
              faRupeeSign: () => (
                /* binding */
                O3
              ),
              /* harmony export */
              faRupiahSign: () => (
                /* binding */
                tW
              ),
              /* harmony export */
              faS: () => (
                /* binding */
                d2
              ),
              /* harmony export */
              faSackDollar: () => (
                /* binding */
                Nc
              ),
              /* harmony export */
              faSackXmark: () => (
                /* binding */
                eT
              ),
              /* harmony export */
              faSadCry: () => (
                /* binding */
                Rj
              ),
              /* harmony export */
              faSadTear: () => (
                /* binding */
                bz
              ),
              /* harmony export */
              faSailboat: () => (
                /* binding */
                Rq
              ),
              /* harmony export */
              faSatellite: () => (
                /* binding */
                Nb
              ),
              /* harmony export */
              faSatelliteDish: () => (
                /* binding */
                jj
              ),
              /* harmony export */
              faSave: () => (
                /* binding */
                Eh
              ),
              /* harmony export */
              faScaleBalanced: () => (
                /* binding */
                Uk
              ),
              /* harmony export */
              faScaleUnbalanced: () => (
                /* binding */
                P6
              ),
              /* harmony export */
              faScaleUnbalancedFlip: () => (
                /* binding */
                Qq
              ),
              /* harmony export */
              faSchool: () => (
                /* binding */
                Op
              ),
              /* harmony export */
              faSchoolCircleCheck: () => (
                /* binding */
                Za
              ),
              /* harmony export */
              faSchoolCircleExclamation: () => (
                /* binding */
                Er
              ),
              /* harmony export */
              faSchoolCircleXmark: () => (
                /* binding */
                ev
              ),
              /* harmony export */
              faSchoolFlag: () => (
                /* binding */
                Wu
              ),
              /* harmony export */
              faSchoolLock: () => (
                /* binding */
                fW
              ),
              /* harmony export */
              faScissors: () => (
                /* binding */
                cs
              ),
              /* harmony export */
              faScrewdriver: () => (
                /* binding */
                W4
              ),
              /* harmony export */
              faScrewdriverWrench: () => (
                /* binding */
                Xv
              ),
              /* harmony export */
              faScroll: () => (
                /* binding */
                k4
              ),
              /* harmony export */
              faScrollTorah: () => (
                /* binding */
                z9
              ),
              /* harmony export */
              faSdCard: () => (
                /* binding */
                vK
              ),
              /* harmony export */
              faSearch: () => (
                /* binding */
                jV
              ),
              /* harmony export */
              faSearchDollar: () => (
                /* binding */
                Rz
              ),
              /* harmony export */
              faSearchLocation: () => (
                /* binding */
                nn
              ),
              /* harmony export */
              faSearchMinus: () => (
                /* binding */
                oz
              ),
              /* harmony export */
              faSearchPlus: () => (
                /* binding */
                _J
              ),
              /* harmony export */
              faSection: () => (
                /* binding */
                hn
              ),
              /* harmony export */
              faSeedling: () => (
                /* binding */
                iX
              ),
              /* harmony export */
              faServer: () => (
                /* binding */
                i3
              ),
              /* harmony export */
              faShapes: () => (
                /* binding */
                sl
              ),
              /* harmony export */
              faShare: () => (
                /* binding */
                sC
              ),
              /* harmony export */
              faShareAlt: () => (
                /* binding */
                p4
              ),
              /* harmony export */
              faShareAltSquare: () => (
                /* binding */
                Gz
              ),
              /* harmony export */
              faShareFromSquare: () => (
                /* binding */
                TW
              ),
              /* harmony export */
              faShareNodes: () => (
                /* binding */
                sv
              ),
              /* harmony export */
              faShareSquare: () => (
                /* binding */
                qW
              ),
              /* harmony export */
              faSheetPlastic: () => (
                /* binding */
                Zr
              ),
              /* harmony export */
              faShekel: () => (
                /* binding */
                Ks
              ),
              /* harmony export */
              faShekelSign: () => (
                /* binding */
                hi
              ),
              /* harmony export */
              faSheqel: () => (
                /* binding */
                Is
              ),
              /* harmony export */
              faSheqelSign: () => (
                /* binding */
                Vt
              ),
              /* harmony export */
              faShield: () => (
                /* binding */
                Pk
              ),
              /* harmony export */
              faShieldAlt: () => (
                /* binding */
                vX
              ),
              /* harmony export */
              faShieldBlank: () => (
                /* binding */
                qL
              ),
              /* harmony export */
              faShieldCat: () => (
                /* binding */
                h6
              ),
              /* harmony export */
              faShieldDog: () => (
                /* binding */
                Xb
              ),
              /* harmony export */
              faShieldHalved: () => (
                /* binding */
                V7
              ),
              /* harmony export */
              faShieldHeart: () => (
                /* binding */
                QL
              ),
              /* harmony export */
              faShieldVirus: () => (
                /* binding */
                kX
              ),
              /* harmony export */
              faShip: () => (
                /* binding */
                RB
              ),
              /* harmony export */
              faShippingFast: () => (
                /* binding */
                ZU
              ),
              /* harmony export */
              faShirt: () => (
                /* binding */
                ed
              ),
              /* harmony export */
              faShoePrints: () => (
                /* binding */
                lK
              ),
              /* harmony export */
              faShop: () => (
                /* binding */
                SX
              ),
              /* harmony export */
              faShopLock: () => (
                /* binding */
                Vg
              ),
              /* harmony export */
              faShopSlash: () => (
                /* binding */
                Gp
              ),
              /* harmony export */
              faShoppingBag: () => (
                /* binding */
                zu
              ),
              /* harmony export */
              faShoppingBasket: () => (
                /* binding */
                Ij
              ),
              /* harmony export */
              faShoppingCart: () => (
                /* binding */
                zn
              ),
              /* harmony export */
              faShower: () => (
                /* binding */
                kK
              ),
              /* harmony export */
              faShrimp: () => (
                /* binding */
                NU
              ),
              /* harmony export */
              faShuffle: () => (
                /* binding */
                cP
              ),
              /* harmony export */
              faShuttleSpace: () => (
                /* binding */
                Xd
              ),
              /* harmony export */
              faShuttleVan: () => (
                /* binding */
                Np
              ),
              /* harmony export */
              faSign: () => (
                /* binding */
                a9
              ),
              /* harmony export */
              faSignHanging: () => (
                /* binding */
                oa
              ),
              /* harmony export */
              faSignIn: () => (
                /* binding */
                n3
              ),
              /* harmony export */
              faSignInAlt: () => (
                /* binding */
                F6
              ),
              /* harmony export */
              faSignLanguage: () => (
                /* binding */
                WJ
              ),
              /* harmony export */
              faSignOut: () => (
                /* binding */
                Yu
              ),
              /* harmony export */
              faSignOutAlt: () => (
                /* binding */
                lr
              ),
              /* harmony export */
              faSignal: () => (
                /* binding */
                Sd
              ),
              /* harmony export */
              faSignal5: () => (
                /* binding */
                bv
              ),
              /* harmony export */
              faSignalPerfect: () => (
                /* binding */
                Ca
              ),
              /* harmony export */
              faSignature: () => (
                /* binding */
                o6
              ),
              /* harmony export */
              faSigning: () => (
                /* binding */
                SJ
              ),
              /* harmony export */
              faSignsPost: () => (
                /* binding */
                K6
              ),
              /* harmony export */
              faSimCard: () => (
                /* binding */
                AL
              ),
              /* harmony export */
              faSink: () => (
                /* binding */
                pd
              ),
              /* harmony export */
              faSitemap: () => (
                /* binding */
                gg
              ),
              /* harmony export */
              faSkating: () => (
                /* binding */
                _g
              ),
              /* harmony export */
              faSkiing: () => (
                /* binding */
                fb
              ),
              /* harmony export */
              faSkiingNordic: () => (
                /* binding */
                tx
              ),
              /* harmony export */
              faSkull: () => (
                /* binding */
                NB
              ),
              /* harmony export */
              faSkullCrossbones: () => (
                /* binding */
                RV
              ),
              /* harmony export */
              faSlash: () => (
                /* binding */
                ca
              ),
              /* harmony export */
              faSleigh: () => (
                /* binding */
                GX
              ),
              /* harmony export */
              faSliders: () => (
                /* binding */
                s0
              ),
              /* harmony export */
              faSlidersH: () => (
                /* binding */
                l8
              ),
              /* harmony export */
              faSmile: () => (
                /* binding */
                KM
              ),
              /* harmony export */
              faSmileBeam: () => (
                /* binding */
                Wn
              ),
              /* harmony export */
              faSmileWink: () => (
                /* binding */
                tB
              ),
              /* harmony export */
              faSmog: () => (
                /* binding */
                _m
              ),
              /* harmony export */
              faSmoking: () => (
                /* binding */
                mP
              ),
              /* harmony export */
              faSmokingBan: () => (
                /* binding */
                df
              ),
              /* harmony export */
              faSms: () => (
                /* binding */
                QK
              ),
              /* harmony export */
              faSnowboarding: () => (
                /* binding */
                GU
              ),
              /* harmony export */
              faSnowflake: () => (
                /* binding */
                z4
              ),
              /* harmony export */
              faSnowman: () => (
                /* binding */
                wg
              ),
              /* harmony export */
              faSnowplow: () => (
                /* binding */
                R4
              ),
              /* harmony export */
              faSoap: () => (
                /* binding */
                tr
              ),
              /* harmony export */
              faSoccerBall: () => (
                /* binding */
                iv
              ),
              /* harmony export */
              faSocks: () => (
                /* binding */
                ht
              ),
              /* harmony export */
              faSolarPanel: () => (
                /* binding */
                kP
              ),
              /* harmony export */
              faSort: () => (
                /* binding */
                fj
              ),
              /* harmony export */
              faSortAlphaAsc: () => (
                /* binding */
                _b
              ),
              /* harmony export */
              faSortAlphaDesc: () => (
                /* binding */
                _9
              ),
              /* harmony export */
              faSortAlphaDown: () => (
                /* binding */
                zT
              ),
              /* harmony export */
              faSortAlphaDownAlt: () => (
                /* binding */
                Sf
              ),
              /* harmony export */
              faSortAlphaUp: () => (
                /* binding */
                _f
              ),
              /* harmony export */
              faSortAlphaUpAlt: () => (
                /* binding */
                xK
              ),
              /* harmony export */
              faSortAmountAsc: () => (
                /* binding */
                _q
              ),
              /* harmony export */
              faSortAmountDesc: () => (
                /* binding */
                ac
              ),
              /* harmony export */
              faSortAmountDown: () => (
                /* binding */
                M4
              ),
              /* harmony export */
              faSortAmountDownAlt: () => (
                /* binding */
                RH
              ),
              /* harmony export */
              faSortAmountUp: () => (
                /* binding */
                Tx
              ),
              /* harmony export */
              faSortAmountUpAlt: () => (
                /* binding */
                bL
              ),
              /* harmony export */
              faSortAsc: () => (
                /* binding */
                HT
              ),
              /* harmony export */
              faSortDesc: () => (
                /* binding */
                nt
              ),
              /* harmony export */
              faSortDown: () => (
                /* binding */
                Ke
              ),
              /* harmony export */
              faSortNumericAsc: () => (
                /* binding */
                Kb
              ),
              /* harmony export */
              faSortNumericDesc: () => (
                /* binding */
                Ua
              ),
              /* harmony export */
              faSortNumericDown: () => (
                /* binding */
                xB
              ),
              /* harmony export */
              faSortNumericDownAlt: () => (
                /* binding */
                vs
              ),
              /* harmony export */
              faSortNumericUp: () => (
                /* binding */
                xT
              ),
              /* harmony export */
              faSortNumericUpAlt: () => (
                /* binding */
                LX
              ),
              /* harmony export */
              faSortUp: () => (
                /* binding */
                xl
              ),
              /* harmony export */
              faSpa: () => (
                /* binding */
                ED
              ),
              /* harmony export */
              faSpaceShuttle: () => (
                /* binding */
                ih
              ),
              /* harmony export */
              faSpaghettiMonsterFlying: () => (
                /* binding */
                zr
              ),
              /* harmony export */
              faSpellCheck: () => (
                /* binding */
                pP
              ),
              /* harmony export */
              faSpider: () => (
                /* binding */
                c7
              ),
              /* harmony export */
              faSpinner: () => (
                /* binding */
                eL
              ),
              /* harmony export */
              faSplotch: () => (
                /* binding */
                aL
              ),
              /* harmony export */
              faSpoon: () => (
                /* binding */
                li
              ),
              /* harmony export */
              faSprayCan: () => (
                /* binding */
                Ie
              ),
              /* harmony export */
              faSprayCanSparkles: () => (
                /* binding */
                _a
              ),
              /* harmony export */
              faSprout: () => (
                /* binding */
                eB
              ),
              /* harmony export */
              faSquare: () => (
                /* binding */
                K4
              ),
              /* harmony export */
              faSquareArrowUpRight: () => (
                /* binding */
                ph
              ),
              /* harmony export */
              faSquareCaretDown: () => (
                /* binding */
                Z1
              ),
              /* harmony export */
              faSquareCaretLeft: () => (
                /* binding */
                nu
              ),
              /* harmony export */
              faSquareCaretRight: () => (
                /* binding */
                Zs
              ),
              /* harmony export */
              faSquareCaretUp: () => (
                /* binding */
                h3
              ),
              /* harmony export */
              faSquareCheck: () => (
                /* binding */
                Gn
              ),
              /* harmony export */
              faSquareEnvelope: () => (
                /* binding */
                Jk
              ),
              /* harmony export */
              faSquareFull: () => (
                /* binding */
                cz
              ),
              /* harmony export */
              faSquareH: () => (
                /* binding */
                Ww
              ),
              /* harmony export */
              faSquareMinus: () => (
                /* binding */
                Nu
              ),
              /* harmony export */
              faSquareNfi: () => (
                /* binding */
                Gg
              ),
              /* harmony export */
              faSquareParking: () => (
                /* binding */
                Tl
              ),
              /* harmony export */
              faSquarePen: () => (
                /* binding */
                iW
              ),
              /* harmony export */
              faSquarePersonConfined: () => (
                /* binding */
                Wi
              ),
              /* harmony export */
              faSquarePhone: () => (
                /* binding */
                Ox
              ),
              /* harmony export */
              faSquarePhoneFlip: () => (
                /* binding */
                U1
              ),
              /* harmony export */
              faSquarePlus: () => (
                /* binding */
                Jg
              ),
              /* harmony export */
              faSquarePollHorizontal: () => (
                /* binding */
                sT
              ),
              /* harmony export */
              faSquarePollVertical: () => (
                /* binding */
                c3
              ),
              /* harmony export */
              faSquareRootAlt: () => (
                /* binding */
                ax
              ),
              /* harmony export */
              faSquareRootVariable: () => (
                /* binding */
                A8
              ),
              /* harmony export */
              faSquareRss: () => (
                /* binding */
                $9
              ),
              /* harmony export */
              faSquareShareNodes: () => (
                /* binding */
                dE
              ),
              /* harmony export */
              faSquareUpRight: () => (
                /* binding */
                $d
              ),
              /* harmony export */
              faSquareVirus: () => (
                /* binding */
                Lb
              ),
              /* harmony export */
              faSquareXmark: () => (
                /* binding */
                rC
              ),
              /* harmony export */
              faStaffAesculapius: () => (
                /* binding */
                Lc
              ),
              /* harmony export */
              faStaffSnake: () => (
                /* binding */
                Us
              ),
              /* harmony export */
              faStairs: () => (
                /* binding */
                t6
              ),
              /* harmony export */
              faStamp: () => (
                /* binding */
                Mc
              ),
              /* harmony export */
              faStapler: () => (
                /* binding */
                Yz
              ),
              /* harmony export */
              faStar: () => (
                /* binding */
                ba
              ),
              /* harmony export */
              faStarAndCrescent: () => (
                /* binding */
                eP
              ),
              /* harmony export */
              faStarHalf: () => (
                /* binding */
                y8
              ),
              /* harmony export */
              faStarHalfAlt: () => (
                /* binding */
                cj
              ),
              /* harmony export */
              faStarHalfStroke: () => (
                /* binding */
                ub
              ),
              /* harmony export */
              faStarOfDavid: () => (
                /* binding */
                ew
              ),
              /* harmony export */
              faStarOfLife: () => (
                /* binding */
                g
              ),
              /* harmony export */
              faStepBackward: () => (
                /* binding */
                ox
              ),
              /* harmony export */
              faStepForward: () => (
                /* binding */
                Pn
              ),
              /* harmony export */
              faSterlingSign: () => (
                /* binding */
                Qr
              ),
              /* harmony export */
              faStethoscope: () => (
                /* binding */
                ee
              ),
              /* harmony export */
              faStickyNote: () => (
                /* binding */
                Hz
              ),
              /* harmony export */
              faStop: () => (
                /* binding */
                MB
              ),
              /* harmony export */
              faStopCircle: () => (
                /* binding */
                E
              ),
              /* harmony export */
              faStopwatch: () => (
                /* binding */
                xi
              ),
              /* harmony export */
              faStopwatch20: () => (
                /* binding */
                Pz
              ),
              /* harmony export */
              faStore: () => (
                /* binding */
                Ei
              ),
              /* harmony export */
              faStoreAlt: () => (
                /* binding */
                Oa
              ),
              /* harmony export */
              faStoreAltSlash: () => (
                /* binding */
                T4
              ),
              /* harmony export */
              faStoreSlash: () => (
                /* binding */
                JA
              ),
              /* harmony export */
              faStream: () => (
                /* binding */
                Q1
              ),
              /* harmony export */
              faStreetView: () => (
                /* binding */
                Ka
              ),
              /* harmony export */
              faStrikethrough: () => (
                /* binding */
                m1
              ),
              /* harmony export */
              faStroopwafel: () => (
                /* binding */
                cv
              ),
              /* harmony export */
              faSubscript: () => (
                /* binding */
                bd
              ),
              /* harmony export */
              faSubtract: () => (
                /* binding */
                bH
              ),
              /* harmony export */
              faSubway: () => (
                /* binding */
                e8
              ),
              /* harmony export */
              faSuitcase: () => (
                /* binding */
                CD
              ),
              /* harmony export */
              faSuitcaseMedical: () => (
                /* binding */
                ST
              ),
              /* harmony export */
              faSuitcaseRolling: () => (
                /* binding */
                RU
              ),
              /* harmony export */
              faSun: () => (
                /* binding */
                q2
              ),
              /* harmony export */
              faSunPlantWilt: () => (
                /* binding */
                Lv
              ),
              /* harmony export */
              faSuperscript: () => (
                /* binding */
                Sw
              ),
              /* harmony export */
              faSurprise: () => (
                /* binding */
                TX
              ),
              /* harmony export */
              faSwatchbook: () => (
                /* binding */
                rP
              ),
              /* harmony export */
              faSwimmer: () => (
                /* binding */
                ft
              ),
              /* harmony export */
              faSwimmingPool: () => (
                /* binding */
                RJ
              ),
              /* harmony export */
              faSynagogue: () => (
                /* binding */
                Zf
              ),
              /* harmony export */
              faSync: () => (
                /* binding */
                dB
              ),
              /* harmony export */
              faSyncAlt: () => (
                /* binding */
                $M
              ),
              /* harmony export */
              faSyringe: () => (
                /* binding */
                uz
              ),
              /* harmony export */
              faT: () => (
                /* binding */
                ZL
              ),
              /* harmony export */
              faTShirt: () => (
                /* binding */
                ui
              ),
              /* harmony export */
              faTable: () => (
                /* binding */
                V6
              ),
              /* harmony export */
              faTableCells: () => (
                /* binding */
                WT
              ),
              /* harmony export */
              faTableCellsLarge: () => (
                /* binding */
                IT
              ),
              /* harmony export */
              faTableColumns: () => (
                /* binding */
                g3
              ),
              /* harmony export */
              faTableList: () => (
                /* binding */
                Rk
              ),
              /* harmony export */
              faTableTennis: () => (
                /* binding */
                wV
              ),
              /* harmony export */
              faTableTennisPaddleBall: () => (
                /* binding */
                Rx
              ),
              /* harmony export */
              faTablet: () => (
                /* binding */
                bA
              ),
              /* harmony export */
              faTabletAlt: () => (
                /* binding */
                Ps
              ),
              /* harmony export */
              faTabletAndroid: () => (
                /* binding */
                xA
              ),
              /* harmony export */
              faTabletButton: () => (
                /* binding */
                il
              ),
              /* harmony export */
              faTabletScreenButton: () => (
                /* binding */
                _n
              ),
              /* harmony export */
              faTablets: () => (
                /* binding */
                V4
              ),
              /* harmony export */
              faTachographDigital: () => (
                /* binding */
                Jv
              ),
              /* harmony export */
              faTachometer: () => (
                /* binding */
                OK
              ),
              /* harmony export */
              faTachometerAlt: () => (
                /* binding */
                Fs
              ),
              /* harmony export */
              faTachometerAltAverage: () => (
                /* binding */
                tl
              ),
              /* harmony export */
              faTachometerAltFast: () => (
                /* binding */
                Do
              ),
              /* harmony export */
              faTachometerAverage: () => (
                /* binding */
                Mh
              ),
              /* harmony export */
              faTachometerFast: () => (
                /* binding */
                yK
              ),
              /* harmony export */
              faTag: () => (
                /* binding */
                VT
              ),
              /* harmony export */
              faTags: () => (
                /* binding */
                xb
              ),
              /* harmony export */
              faTanakh: () => (
                /* binding */
                wU
              ),
              /* harmony export */
              faTape: () => (
                /* binding */
                cT
              ),
              /* harmony export */
              faTarp: () => (
                /* binding */
                XX
              ),
              /* harmony export */
              faTarpDroplet: () => (
                /* binding */
                ex
              ),
              /* harmony export */
              faTasks: () => (
                /* binding */
                YU
              ),
              /* harmony export */
              faTasksAlt: () => (
                /* binding */
                YP
              ),
              /* harmony export */
              faTaxi: () => (
                /* binding */
                B3
              ),
              /* harmony export */
              faTeeth: () => (
                /* binding */
                yn
              ),
              /* harmony export */
              faTeethOpen: () => (
                /* binding */
                rH
              ),
              /* harmony export */
              faTeletype: () => (
                /* binding */
                wH
              ),
              /* harmony export */
              faTelevision: () => (
                /* binding */
                OV
              ),
              /* harmony export */
              faTemperature0: () => (
                /* binding */
                ul
              ),
              /* harmony export */
              faTemperature1: () => (
                /* binding */
                Hl
              ),
              /* harmony export */
              faTemperature2: () => (
                /* binding */
                dn
              ),
              /* harmony export */
              faTemperature3: () => (
                /* binding */
                Vd
              ),
              /* harmony export */
              faTemperature4: () => (
                /* binding */
                Wx
              ),
              /* harmony export */
              faTemperatureArrowDown: () => (
                /* binding */
                gu
              ),
              /* harmony export */
              faTemperatureArrowUp: () => (
                /* binding */
                mw
              ),
              /* harmony export */
              faTemperatureDown: () => (
                /* binding */
                cX
              ),
              /* harmony export */
              faTemperatureEmpty: () => (
                /* binding */
                hh
              ),
              /* harmony export */
              faTemperatureFull: () => (
                /* binding */
                yd
              ),
              /* harmony export */
              faTemperatureHalf: () => (
                /* binding */
                n1
              ),
              /* harmony export */
              faTemperatureHigh: () => (
                /* binding */
                h7
              ),
              /* harmony export */
              faTemperatureLow: () => (
                /* binding */
                EL
              ),
              /* harmony export */
              faTemperatureQuarter: () => (
                /* binding */
                J6
              ),
              /* harmony export */
              faTemperatureThreeQuarters: () => (
                /* binding */
                v8
              ),
              /* harmony export */
              faTemperatureUp: () => (
                /* binding */
                V8
              ),
              /* harmony export */
              faTenge: () => (
                /* binding */
                xn
              ),
              /* harmony export */
              faTengeSign: () => (
                /* binding */
                kj
              ),
              /* harmony export */
              faTent: () => (
                /* binding */
                JT
              ),
              /* harmony export */
              faTentArrowDownToLine: () => (
                /* binding */
                ch
              ),
              /* harmony export */
              faTentArrowLeftRight: () => (
                /* binding */
                oA
              ),
              /* harmony export */
              faTentArrowTurnLeft: () => (
                /* binding */
                BL
              ),
              /* harmony export */
              faTentArrowsDown: () => (
                /* binding */
                Dz
              ),
              /* harmony export */
              faTents: () => (
                /* binding */
                WL
              ),
              /* harmony export */
              faTerminal: () => (
                /* binding */
                MP
              ),
              /* harmony export */
              faTextHeight: () => (
                /* binding */
                y
              ),
              /* harmony export */
              faTextSlash: () => (
                /* binding */
                qh
              ),
              /* harmony export */
              faTextWidth: () => (
                /* binding */
                Vb
              ),
              /* harmony export */
              faTh: () => (
                /* binding */
                aa
              ),
              /* harmony export */
              faThLarge: () => (
                /* binding */
                Eb
              ),
              /* harmony export */
              faThList: () => (
                /* binding */
                NK
              ),
              /* harmony export */
              faTheaterMasks: () => (
                /* binding */
                Mz
              ),
              /* harmony export */
              faThermometer: () => (
                /* binding */
                EM
              ),
              /* harmony export */
              faThermometer0: () => (
                /* binding */
                Hh
              ),
              /* harmony export */
              faThermometer1: () => (
                /* binding */
                gl
              ),
              /* harmony export */
              faThermometer2: () => (
                /* binding */
                i1
              ),
              /* harmony export */
              faThermometer3: () => (
                /* binding */
                $3
              ),
              /* harmony export */
              faThermometer4: () => (
                /* binding */
                C8
              ),
              /* harmony export */
              faThermometerEmpty: () => (
                /* binding */
                QD
              ),
              /* harmony export */
              faThermometerFull: () => (
                /* binding */
                Sx
              ),
              /* harmony export */
              faThermometerHalf: () => (
                /* binding */
                rf
              ),
              /* harmony export */
              faThermometerQuarter: () => (
                /* binding */
                Tu
              ),
              /* harmony export */
              faThermometerThreeQuarters: () => (
                /* binding */
                wB
              ),
              /* harmony export */
              faThumbTack: () => (
                /* binding */
                JM
              ),
              /* harmony export */
              faThumbsDown: () => (
                /* binding */
                oc
              ),
              /* harmony export */
              faThumbsUp: () => (
                /* binding */
                $J
              ),
              /* harmony export */
              faThumbtack: () => (
                /* binding */
                rk
              ),
              /* harmony export */
              faThunderstorm: () => (
                /* binding */
                GD
              ),
              /* harmony export */
              faTicket: () => (
                /* binding */
                c2
              ),
              /* harmony export */
              faTicketAlt: () => (
                /* binding */
                cL
              ),
              /* harmony export */
              faTicketSimple: () => (
                /* binding */
                Ak
              ),
              /* harmony export */
              faTimeline: () => (
                /* binding */
                Dv
              ),
              /* harmony export */
              faTimes: () => (
                /* binding */
                _V
              ),
              /* harmony export */
              faTimesCircle: () => (
                /* binding */
                LJ
              ),
              /* harmony export */
              faTimesRectangle: () => (
                /* binding */
                AJ
              ),
              /* harmony export */
              faTimesSquare: () => (
                /* binding */
                LL
              ),
              /* harmony export */
              faTint: () => (
                /* binding */
                Ft
              ),
              /* harmony export */
              faTintSlash: () => (
                /* binding */
                o2
              ),
              /* harmony export */
              faTired: () => (
                /* binding */
                Jq
              ),
              /* harmony export */
              faToggleOff: () => (
                /* binding */
                I6
              ),
              /* harmony export */
              faToggleOn: () => (
                /* binding */
                Va
              ),
              /* harmony export */
              faToilet: () => (
                /* binding */
                X2
              ),
              /* harmony export */
              faToiletPaper: () => (
                /* binding */
                RP
              ),
              /* harmony export */
              faToiletPaperSlash: () => (
                /* binding */
                wd
              ),
              /* harmony export */
              faToiletPortable: () => (
                /* binding */
                Od
              ),
              /* harmony export */
              faToiletsPortable: () => (
                /* binding */
                Kv
              ),
              /* harmony export */
              faToolbox: () => (
                /* binding */
                OH
              ),
              /* harmony export */
              faTools: () => (
                /* binding */
                K7
              ),
              /* harmony export */
              faTooth: () => (
                /* binding */
                Cp
              ),
              /* harmony export */
              faTorah: () => (
                /* binding */
                Li
              ),
              /* harmony export */
              faToriiGate: () => (
                /* binding */
                xP
              ),
              /* harmony export */
              faTornado: () => (
                /* binding */
                jK
              ),
              /* harmony export */
              faTowerBroadcast: () => (
                /* binding */
                Hw
              ),
              /* harmony export */
              faTowerCell: () => (
                /* binding */
                AW
              ),
              /* harmony export */
              faTowerObservation: () => (
                /* binding */
                $A
              ),
              /* harmony export */
              faTractor: () => (
                /* binding */
                He
              ),
              /* harmony export */
              faTrademark: () => (
                /* binding */
                Dj
              ),
              /* harmony export */
              faTrafficLight: () => (
                /* binding */
                kM
              ),
              /* harmony export */
              faTrailer: () => (
                /* binding */
                AK
              ),
              /* harmony export */
              faTrain: () => (
                /* binding */
                w4
              ),
              /* harmony export */
              faTrainSubway: () => (
                /* binding */
                $T
              ),
              /* harmony export */
              faTrainTram: () => (
                /* binding */
                dz
              ),
              /* harmony export */
              faTram: () => (
                /* binding */
                BH
              ),
              /* harmony export */
              faTransgender: () => (
                /* binding */
                ok
              ),
              /* harmony export */
              faTransgenderAlt: () => (
                /* binding */
                dL
              ),
              /* harmony export */
              faTrash: () => (
                /* binding */
                lH
              ),
              /* harmony export */
              faTrashAlt: () => (
                /* binding */
                R
              ),
              /* harmony export */
              faTrashArrowUp: () => (
                /* binding */
                xe
              ),
              /* harmony export */
              faTrashCan: () => (
                /* binding */
                k
              ),
              /* harmony export */
              faTrashCanArrowUp: () => (
                /* binding */
                IU
              ),
              /* harmony export */
              faTrashRestore: () => (
                /* binding */
                Je
              ),
              /* harmony export */
              faTrashRestoreAlt: () => (
                /* binding */
                mV
              ),
              /* harmony export */
              faTree: () => (
                /* binding */
                qg
              ),
              /* harmony export */
              faTreeCity: () => (
                /* binding */
                xV
              ),
              /* harmony export */
              faTriangleCircleSquare: () => (
                /* binding */
                Jp
              ),
              /* harmony export */
              faTriangleExclamation: () => (
                /* binding */
                iC
              ),
              /* harmony export */
              faTrophy: () => (
                /* binding */
                zM
              ),
              /* harmony export */
              faTrowel: () => (
                /* binding */
                Nz
              ),
              /* harmony export */
              faTrowelBricks: () => (
                /* binding */
                ks
              ),
              /* harmony export */
              faTruck: () => (
                /* binding */
                Gb
              ),
              /* harmony export */
              faTruckArrowRight: () => (
                /* binding */
                ZK
              ),
              /* harmony export */
              faTruckDroplet: () => (
                /* binding */
                mx
              ),
              /* harmony export */
              faTruckFast: () => (
                /* binding */
                pW
              ),
              /* harmony export */
              faTruckField: () => (
                /* binding */
                tH
              ),
              /* harmony export */
              faTruckFieldUn: () => (
                /* binding */
                KX
              ),
              /* harmony export */
              faTruckFront: () => (
                /* binding */
                eH
              ),
              /* harmony export */
              faTruckLoading: () => (
                /* binding */
                OA
              ),
              /* harmony export */
              faTruckMedical: () => (
                /* binding */
                eu
              ),
              /* harmony export */
              faTruckMonster: () => (
                /* binding */
                Pt
              ),
              /* harmony export */
              faTruckMoving: () => (
                /* binding */
                YM
              ),
              /* harmony export */
              faTruckPickup: () => (
                /* binding */
                QB
              ),
              /* harmony export */
              faTruckPlane: () => (
                /* binding */
                Kt
              ),
              /* harmony export */
              faTruckRampBox: () => (
                /* binding */
                J9
              ),
              /* harmony export */
              faTry: () => (
                /* binding */
                Bz
              ),
              /* harmony export */
              faTshirt: () => (
                /* binding */
                Vf
              ),
              /* harmony export */
              faTty: () => (
                /* binding */
                Px
              ),
              /* harmony export */
              faTurkishLira: () => (
                /* binding */
                Wz
              ),
              /* harmony export */
              faTurkishLiraSign: () => (
                /* binding */
                AC
              ),
              /* harmony export */
              faTurnDown: () => (
                /* binding */
                Kk
              ),
              /* harmony export */
              faTurnUp: () => (
                /* binding */
                lE
              ),
              /* harmony export */
              faTv: () => (
                /* binding */
                uW
              ),
              /* harmony export */
              faTvAlt: () => (
                /* binding */
                FU
              ),
              /* harmony export */
              faU: () => (
                /* binding */
                f2
              ),
              /* harmony export */
              faUmbrella: () => (
                /* binding */
                Fz
              ),
              /* harmony export */
              faUmbrellaBeach: () => (
                /* binding */
                vv
              ),
              /* harmony export */
              faUnderline: () => (
                /* binding */
                Oo
              ),
              /* harmony export */
              faUndo: () => (
                /* binding */
                DB
              ),
              /* harmony export */
              faUndoAlt: () => (
                /* binding */
                DP
              ),
              /* harmony export */
              faUniversalAccess: () => (
                /* binding */
                In
              ),
              /* harmony export */
              faUniversity: () => (
                /* binding */
                Ez
              ),
              /* harmony export */
              faUnlink: () => (
                /* binding */
                TK
              ),
              /* harmony export */
              faUnlock: () => (
                /* binding */
                Pv
              ),
              /* harmony export */
              faUnlockAlt: () => (
                /* binding */
                Sp
              ),
              /* harmony export */
              faUnlockKeyhole: () => (
                /* binding */
                aP
              ),
              /* harmony export */
              faUnsorted: () => (
                /* binding */
                vb
              ),
              /* harmony export */
              faUpDown: () => (
                /* binding */
                bk
              ),
              /* harmony export */
              faUpDownLeftRight: () => (
                /* binding */
                E7
              ),
              /* harmony export */
              faUpLong: () => (
                /* binding */
                x8
              ),
              /* harmony export */
              faUpRightAndDownLeftFromCenter: () => (
                /* binding */
                qk
              ),
              /* harmony export */
              faUpRightFromSquare: () => (
                /* binding */
                z6
              ),
              /* harmony export */
              faUpload: () => (
                /* binding */
                gw
              ),
              /* harmony export */
              faUsd: () => (
                /* binding */
                Uz
              ),
              /* harmony export */
              faUser: () => (
                /* binding */
                wi
              ),
              /* harmony export */
              faUserAlt: () => (
                /* binding */
                Az
              ),
              /* harmony export */
              faUserAltSlash: () => (
                /* binding */
                oB
              ),
              /* harmony export */
              faUserAstronaut: () => (
                /* binding */
                V3
              ),
              /* harmony export */
              faUserCheck: () => (
                /* binding */
                z1
              ),
              /* harmony export */
              faUserCircle: () => (
                /* binding */
                MU
              ),
              /* harmony export */
              faUserClock: () => (
                /* binding */
                ez
              ),
              /* harmony export */
              faUserCog: () => (
                /* binding */
                vH
              ),
              /* harmony export */
              faUserDoctor: () => (
                /* binding */
                _P
              ),
              /* harmony export */
              faUserEdit: () => (
                /* binding */
                of
              ),
              /* harmony export */
              faUserFriends: () => (
                /* binding */
                th
              ),
              /* harmony export */
              faUserGear: () => (
                /* binding */
                M3
              ),
              /* harmony export */
              faUserGraduate: () => (
                /* binding */
                $U
              ),
              /* harmony export */
              faUserGroup: () => (
                /* binding */
                fu
              ),
              /* harmony export */
              faUserInjured: () => (
                /* binding */
                qz
              ),
              /* harmony export */
              faUserLarge: () => (
                /* binding */
                rE
              ),
              /* harmony export */
              faUserLargeSlash: () => (
                /* binding */
                ej
              ),
              /* harmony export */
              faUserLock: () => (
                /* binding */
                VH
              ),
              /* harmony export */
              faUserMd: () => (
                /* binding */
                Mb
              ),
              /* harmony export */
              faUserMinus: () => (
                /* binding */
                vu
              ),
              /* harmony export */
              faUserNinja: () => (
                /* binding */
                go
              ),
              /* harmony export */
              faUserNurse: () => (
                /* binding */
                vz
              ),
              /* harmony export */
              faUserPen: () => (
                /* binding */
                yo
              ),
              /* harmony export */
              faUserPlus: () => (
                /* binding */
                MK
              ),
              /* harmony export */
              faUserSecret: () => (
                /* binding */
                cH
              ),
              /* harmony export */
              faUserShield: () => (
                /* binding */
                LU
              ),
              /* harmony export */
              faUserSlash: () => (
                /* binding */
                Bb
              ),
              /* harmony export */
              faUserTag: () => (
                /* binding */
                iJ
              ),
              /* harmony export */
              faUserTie: () => (
                /* binding */
                Af
              ),
              /* harmony export */
              faUserTimes: () => (
                /* binding */
                Y
              ),
              /* harmony export */
              faUserXmark: () => (
                /* binding */
                O
              ),
              /* harmony export */
              faUsers: () => (
                /* binding */
                bg
              ),
              /* harmony export */
              faUsersBetweenLines: () => (
                /* binding */
                CX
              ),
              /* harmony export */
              faUsersCog: () => (
                /* binding */
                Vz
              ),
              /* harmony export */
              faUsersGear: () => (
                /* binding */
                aE
              ),
              /* harmony export */
              faUsersLine: () => (
                /* binding */
                Q
              ),
              /* harmony export */
              faUsersRays: () => (
                /* binding */
                DX
              ),
              /* harmony export */
              faUsersRectangle: () => (
                /* binding */
                as
              ),
              /* harmony export */
              faUsersSlash: () => (
                /* binding */
                Wc
              ),
              /* harmony export */
              faUsersViewfinder: () => (
                /* binding */
                Gh
              ),
              /* harmony export */
              faUtensilSpoon: () => (
                /* binding */
                Xs
              ),
              /* harmony export */
              faUtensils: () => (
                /* binding */
                cw
              ),
              /* harmony export */
              faV: () => (
                /* binding */
                jg
              ),
              /* harmony export */
              faVanShuttle: () => (
                /* binding */
                Zc
              ),
              /* harmony export */
              faVault: () => (
                /* binding */
                Wv
              ),
              /* harmony export */
              faVcard: () => (
                /* binding */
                MD
              ),
              /* harmony export */
              faVectorSquare: () => (
                /* binding */
                lB
              ),
              /* harmony export */
              faVenus: () => (
                /* binding */
                HP
              ),
              /* harmony export */
              faVenusDouble: () => (
                /* binding */
                a0
              ),
              /* harmony export */
              faVenusMars: () => (
                /* binding */
                pA
              ),
              /* harmony export */
              faVest: () => (
                /* binding */
                Y4
              ),
              /* harmony export */
              faVestPatches: () => (
                /* binding */
                Zb
              ),
              /* harmony export */
              faVial: () => (
                /* binding */
                zc
              ),
              /* harmony export */
              faVialCircleCheck: () => (
                /* binding */
                tK
              ),
              /* harmony export */
              faVialVirus: () => (
                /* binding */
                Zd
              ),
              /* harmony export */
              faVials: () => (
                /* binding */
                f8
              ),
              /* harmony export */
              faVideo: () => (
                /* binding */
                vE
              ),
              /* harmony export */
              faVideoCamera: () => (
                /* binding */
                $z
              ),
              /* harmony export */
              faVideoSlash: () => (
                /* binding */
                VM
              ),
              /* harmony export */
              faVihara: () => (
                /* binding */
                Wb
              ),
              /* harmony export */
              faVirus: () => (
                /* binding */
                rj
              ),
              /* harmony export */
              faVirusCovid: () => (
                /* binding */
                pb
              ),
              /* harmony export */
              faVirusCovidSlash: () => (
                /* binding */
                q4
              ),
              /* harmony export */
              faVirusSlash: () => (
                /* binding */
                z3
              ),
              /* harmony export */
              faViruses: () => (
                /* binding */
                vi
              ),
              /* harmony export */
              faVoicemail: () => (
                /* binding */
                nK
              ),
              /* harmony export */
              faVolcano: () => (
                /* binding */
                pt
              ),
              /* harmony export */
              faVolleyball: () => (
                /* binding */
                ke
              ),
              /* harmony export */
              faVolleyballBall: () => (
                /* binding */
                be
              ),
              /* harmony export */
              faVolumeControlPhone: () => (
                /* binding */
                NX
              ),
              /* harmony export */
              faVolumeDown: () => (
                /* binding */
                ze
              ),
              /* harmony export */
              faVolumeHigh: () => (
                /* binding */
                xX
              ),
              /* harmony export */
              faVolumeLow: () => (
                /* binding */
                Qe
              ),
              /* harmony export */
              faVolumeMute: () => (
                /* binding */
                NV
              ),
              /* harmony export */
              faVolumeOff: () => (
                /* binding */
                n8
              ),
              /* harmony export */
              faVolumeTimes: () => (
                /* binding */
                yw
              ),
              /* harmony export */
              faVolumeUp: () => (
                /* binding */
                fT
              ),
              /* harmony export */
              faVolumeXmark: () => (
                /* binding */
                gW
              ),
              /* harmony export */
              faVoteYea: () => (
                /* binding */
                Cl
              ),
              /* harmony export */
              faVrCardboard: () => (
                /* binding */
                FM
              ),
              /* harmony export */
              faW: () => (
                /* binding */
                Et
              ),
              /* harmony export */
              faWalkieTalkie: () => (
                /* binding */
                WV
              ),
              /* harmony export */
              faWalking: () => (
                /* binding */
                rh
              ),
              /* harmony export */
              faWallet: () => (
                /* binding */
                jX
              ),
              /* harmony export */
              faWandMagic: () => (
                /* binding */
                Hk
              ),
              /* harmony export */
              faWandMagicSparkles: () => (
                /* binding */
                rl
              ),
              /* harmony export */
              faWandSparkles: () => (
                /* binding */
                lx
              ),
              /* harmony export */
              faWarehouse: () => (
                /* binding */
                iL
              ),
              /* harmony export */
              faWarning: () => (
                /* binding */
                pJ
              ),
              /* harmony export */
              faWater: () => (
                /* binding */
                Lj
              ),
              /* harmony export */
              faWaterLadder: () => (
                /* binding */
                oC
              ),
              /* harmony export */
              faWaveSquare: () => (
                /* binding */
                ge
              ),
              /* harmony export */
              faWeight: () => (
                /* binding */
                yg
              ),
              /* harmony export */
              faWeightHanging: () => (
                /* binding */
                eh
              ),
              /* harmony export */
              faWeightScale: () => (
                /* binding */
                x4
              ),
              /* harmony export */
              faWheatAlt: () => (
                /* binding */
                ar
              ),
              /* harmony export */
              faWheatAwn: () => (
                /* binding */
                Bt
              ),
              /* harmony export */
              faWheatAwnCircleExclamation: () => (
                /* binding */
                s7
              ),
              /* harmony export */
              faWheelchair: () => (
                /* binding */
                a6
              ),
              /* harmony export */
              faWheelchairAlt: () => (
                /* binding */
                OJ
              ),
              /* harmony export */
              faWheelchairMove: () => (
                /* binding */
                Lk
              ),
              /* harmony export */
              faWhiskeyGlass: () => (
                /* binding */
                GA
              ),
              /* harmony export */
              faWifi: () => (
                /* binding */
                v3
              ),
              /* harmony export */
              faWifi3: () => (
                /* binding */
                fh
              ),
              /* harmony export */
              faWifiStrong: () => (
                /* binding */
                Qg
              ),
              /* harmony export */
              faWind: () => (
                /* binding */
                KU
              ),
              /* harmony export */
              faWindowClose: () => (
                /* binding */
                dJ
              ),
              /* harmony export */
              faWindowMaximize: () => (
                /* binding */
                Vj
              ),
              /* harmony export */
              faWindowMinimize: () => (
                /* binding */
                nz
              ),
              /* harmony export */
              faWindowRestore: () => (
                /* binding */
                Vq
              ),
              /* harmony export */
              faWineBottle: () => (
                /* binding */
                lo
              ),
              /* harmony export */
              faWineGlass: () => (
                /* binding */
                QP
              ),
              /* harmony export */
              faWineGlassAlt: () => (
                /* binding */
                VL
              ),
              /* harmony export */
              faWineGlassEmpty: () => (
                /* binding */
                gk
              ),
              /* harmony export */
              faWon: () => (
                /* binding */
                $4
              ),
              /* harmony export */
              faWonSign: () => (
                /* binding */
                cb
              ),
              /* harmony export */
              faWorm: () => (
                /* binding */
                Ms
              ),
              /* harmony export */
              faWrench: () => (
                /* binding */
                uT
              ),
              /* harmony export */
              faX: () => (
                /* binding */
                Iz
              ),
              /* harmony export */
              faXRay: () => (
                /* binding */
                nf
              ),
              /* harmony export */
              faXmark: () => (
                /* binding */
                yx
              ),
              /* harmony export */
              faXmarkCircle: () => (
                /* binding */
                KJ
              ),
              /* harmony export */
              faXmarkSquare: () => (
                /* binding */
                KL
              ),
              /* harmony export */
              faXmarksLines: () => (
                /* binding */
                Og
              ),
              /* harmony export */
              faY: () => (
                /* binding */
                zU
              ),
              /* harmony export */
              faYen: () => (
                /* binding */
                ms
              ),
              /* harmony export */
              faYenSign: () => (
                /* binding */
                rp
              ),
              /* harmony export */
              faYinYang: () => (
                /* binding */
                OL
              ),
              /* harmony export */
              faZ: () => (
                /* binding */
                Q6
              ),
              /* harmony export */
              faZap: () => (
                /* binding */
                Pf
              ),
              /* harmony export */
              fas: () => (
                /* binding */
                D9e
              ),
              /* harmony export */
              prefix: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var d = "fas", v = {
              prefix: "fas",
              iconName: "0",
              icon: [320, 512, [], "30", "M0 192C0 103.6 71.6 32 160 32s160 71.6 160 160V320c0 88.4-71.6 160-160 160S0 408.4 0 320V192zM160 96c-53 0-96 43-96 96V320c0 53 43 96 96 96s96-43 96-96V192c0-53-43-96-96-96z"]
            }, u = {
              prefix: "fas",
              iconName: "1",
              icon: [256, 512, [], "31", "M160 64c0-11.8-6.5-22.6-16.9-28.2s-23-5-32.8 1.6l-96 64C-.5 111.2-4.4 131 5.4 145.8s29.7 18.7 44.4 8.9L96 123.8V416H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h96 96c17.7 0 32-14.3 32-32s-14.3-32-32-32H160V64z"]
            }, l = {
              prefix: "fas",
              iconName: "2",
              icon: [320, 512, [], "32", "M142.9 96c-21.5 0-42.2 8.5-57.4 23.8L54.6 150.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L40.2 74.5C67.5 47.3 104.4 32 142.9 32C223 32 288 97 288 177.1c0 38.5-15.3 75.4-42.5 102.6L109.3 416H288c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L200.2 234.5c15.2-15.2 23.8-35.9 23.8-57.4c0-44.8-36.3-81.1-81.1-81.1z"]
            }, P = {
              prefix: "fas",
              iconName: "3",
              icon: [320, 512, [], "33", "M0 64C0 46.3 14.3 32 32 32H272c13.2 0 25 8.1 29.8 20.4s1.5 26.3-8.2 35.2L162.3 208H184c75.1 0 136 60.9 136 136s-60.9 136-136 136H105.4C63 480 24.2 456 5.3 418.1l-1.9-3.8c-7.9-15.8-1.5-35 14.3-42.9s35-1.5 42.9 14.3l1.9 3.8c8.1 16.3 24.8 26.5 42.9 26.5H184c39.8 0 72-32.2 72-72s-32.2-72-72-72H80c-13.2 0-25-8.1-29.8-20.4s-1.5-26.3 8.2-35.2L189.7 96H32C14.3 96 0 81.7 0 64z"]
            }, p = {
              prefix: "fas",
              iconName: "4",
              icon: [384, 512, [], "34", "M189 77.6c7.5-16 .7-35.1-15.3-42.6s-35.1-.7-42.6 15.3L3 322.4c-4.7 9.9-3.9 21.5 1.9 30.8S21 368 32 368H256v80c0 17.7 14.3 32 32 32s32-14.3 32-32V368h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H320V160c0-17.7-14.3-32-32-32s-32 14.3-32 32V304H82.4L189 77.6z"]
            }, c = {
              prefix: "fas",
              iconName: "5",
              icon: [320, 512, [], "35", "M32.5 58.3C35.3 43.1 48.5 32 64 32H256c17.7 0 32 14.3 32 32s-14.3 32-32 32H90.7L70.3 208H184c75.1 0 136 60.9 136 136s-60.9 136-136 136H100.5c-39.4 0-75.4-22.3-93-57.5l-4.1-8.2c-7.9-15.8-1.5-35 14.3-42.9s35-1.5 42.9 14.3l4.1 8.2c6.8 13.6 20.6 22.1 35.8 22.1H184c39.8 0 72-32.2 72-72s-32.2-72-72-72H32c-9.5 0-18.5-4.2-24.6-11.5s-8.6-16.9-6.9-26.2l32-176z"]
            }, H = {
              prefix: "fas",
              iconName: "6",
              icon: [320, 512, [], "36", "M232.4 84.7c11.4-13.5 9.7-33.7-3.8-45.1s-33.7-9.7-45.1 3.8L38.6 214.7C14.7 242.9 1.1 278.4 .1 315.2c0 1.4-.1 2.9-.1 4.3c0 .2 0 .3 0 .5c0 88.4 71.6 160 160 160s160-71.6 160-160c0-85.5-67.1-155.4-151.5-159.8l63.9-75.6zM256 320A96 96 0 1 1 64 320a96 96 0 1 1 192 0z"]
            }, T = {
              prefix: "fas",
              iconName: "7",
              icon: [320, 512, [], "37", "M0 64C0 46.3 14.3 32 32 32H288c11.5 0 22 6.1 27.7 16.1s5.7 22.2-.1 32.1l-224 384c-8.9 15.3-28.5 20.4-43.8 11.5s-20.4-28.5-11.5-43.8L232.3 96H32C14.3 96 0 81.7 0 64z"]
            }, q = {
              prefix: "fas",
              iconName: "8",
              icon: [320, 512, [], "38", "M304 160c0-70.7-57.3-128-128-128H144C73.3 32 16 89.3 16 160c0 34.6 13.7 66 36 89C20.5 272.3 0 309.8 0 352c0 70.7 57.3 128 128 128h64c70.7 0 128-57.3 128-128c0-42.2-20.5-79.7-52-103c22.3-23 36-54.4 36-89zM176.1 288H192c35.3 0 64 28.7 64 64s-28.7 64-64 64H128c-35.3 0-64-28.7-64-64s28.7-64 64-64h15.9c0 0 .1 0 .1 0h32c0 0 .1 0 .1 0zm0-64c0 0 0 0 0 0H144c0 0 0 0 0 0c-35.3 0-64-28.7-64-64c0-35.3 28.7-64 64-64h32c35.3 0 64 28.7 64 64c0 35.3-28.6 64-64 64z"]
            }, b = {
              prefix: "fas",
              iconName: "9",
              icon: [320, 512, [], "39", "M64 192a96 96 0 1 0 192 0A96 96 0 1 0 64 192zm87.5 159.8C67.1 347.4 0 277.5 0 192C0 103.6 71.6 32 160 32s160 71.6 160 160c0 2.6-.1 5.3-.2 7.9c-1.7 35.7-15.2 70-38.4 97.4l-145 171.4c-11.4 13.5-31.6 15.2-45.1 3.8s-15.2-31.6-3.8-45.1l63.9-75.6z"]
            }, j = {
              prefix: "fas",
              iconName: "fill-drip",
              icon: [576, 512, [], "f576", "M41.4 9.4C53.9-3.1 74.1-3.1 86.6 9.4L168 90.7l53.1-53.1c28.1-28.1 73.7-28.1 101.8 0L474.3 189.1c28.1 28.1 28.1 73.7 0 101.8L283.9 481.4c-37.5 37.5-98.3 37.5-135.8 0L30.6 363.9c-37.5-37.5-37.5-98.3 0-135.8L122.7 136 41.4 54.6c-12.5-12.5-12.5-32.8 0-45.3zm176 221.3L168 181.3 75.9 273.4c-4.2 4.2-7 9.3-8.4 14.6H386.7l42.3-42.3c3.1-3.1 3.1-8.2 0-11.3L277.7 82.9c-3.1-3.1-8.2-3.1-11.3 0L213.3 136l49.4 49.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0zM512 512c-35.3 0-64-28.7-64-64c0-25.2 32.6-79.6 51.2-108.7c6-9.4 19.5-9.4 25.5 0C543.4 368.4 576 422.8 576 448c0 35.3-28.7 64-64 64z"]
            }, w = {
              prefix: "fas",
              iconName: "arrows-to-circle",
              icon: [640, 512, [], "e4bd", "M9.4 9.4C21.9-3.1 42.1-3.1 54.6 9.4L160 114.7V96c0-17.7 14.3-32 32-32s32 14.3 32 32v96c0 4.3-.9 8.5-2.4 12.2c-1.6 3.7-3.8 7.3-6.9 10.3l-.1 .1c-3.1 3-6.6 5.3-10.3 6.9c-3.8 1.6-7.9 2.4-12.2 2.4H96c-17.7 0-32-14.3-32-32s14.3-32 32-32h18.7L9.4 54.6C-3.1 42.1-3.1 21.9 9.4 9.4zM256 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM114.7 352H96c-17.7 0-32-14.3-32-32s14.3-32 32-32h96 0l.1 0c8.8 0 16.7 3.6 22.5 9.3l.1 .1c3 3.1 5.3 6.6 6.9 10.3c1.6 3.8 2.4 7.9 2.4 12.2v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V397.3L54.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L114.7 352zM416 96c0-17.7 14.3-32 32-32s32 14.3 32 32v18.7L585.4 9.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L525.3 160H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H448c-8.8 0-16.8-3.6-22.6-9.3l-.1-.1c-3-3.1-5.3-6.6-6.9-10.3s-2.4-7.8-2.4-12.2l0-.1v0V96zM525.3 352L630.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L480 397.3V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V320v0c0 0 0-.1 0-.1c0-4.3 .9-8.4 2.4-12.2c1.6-3.8 3.9-7.3 6.9-10.4c5.8-5.8 13.7-9.3 22.5-9.4c0 0 .1 0 .1 0h0 96c17.7 0 32 14.3 32 32s-14.3 32-32 32H525.3z"]
            }, m = {
              prefix: "fas",
              iconName: "circle-chevron-right",
              icon: [512, 512, ["chevron-circle-right"], "f138", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM241 377c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l87-87-87-87c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L345 239c9.4 9.4 9.4 24.6 0 33.9L241 377z"]
            }, I = m, N = {
              prefix: "fas",
              iconName: "at",
              icon: [512, 512, [61946], "40", "M256 64C150 64 64 150 64 256s86 192 192 192c17.7 0 32 14.3 32 32s-14.3 32-32 32C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256v32c0 53-43 96-96 96c-29.3 0-55.6-13.2-73.2-33.9C320 371.1 289.5 384 256 384c-70.7 0-128-57.3-128-128s57.3-128 128-128c27.9 0 53.7 8.9 74.7 24.1c5.7-5 13.1-8.1 21.3-8.1c17.7 0 32 14.3 32 32v80 32c0 17.7 14.3 32 32 32s32-14.3 32-32V256c0-106-86-192-192-192zm64 192a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
            }, k = {
              prefix: "fas",
              iconName: "trash-can",
              icon: [448, 512, [61460, "trash-alt"], "f2ed", "M135.2 17.7C140.6 6.8 151.7 0 163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm96 64c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16z"]
            }, R = k, y = {
              prefix: "fas",
              iconName: "text-height",
              icon: [576, 512, [], "f034", "M64 128V96h64l0 320H96c-17.7 0-32 14.3-32 32s14.3 32 32 32H224c17.7 0 32-14.3 32-32s-14.3-32-32-32H192l0-320h64v32c0 17.7 14.3 32 32 32s32-14.3 32-32V80c0-26.5-21.5-48-48-48H160 48C21.5 32 0 53.5 0 80v48c0 17.7 14.3 32 32 32s32-14.3 32-32zM502.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8h32V352H416c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8H512V160h32c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64z"]
            }, O = {
              prefix: "fas",
              iconName: "user-xmark",
              icon: [640, 512, ["user-times"], "f235", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3zM471 143c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
            }, Y = O, ee = {
              prefix: "fas",
              iconName: "stethoscope",
              icon: [576, 512, [129658], "f0f1", "M142.4 21.9c5.6 16.8-3.5 34.9-20.2 40.5L96 71.1V192c0 53 43 96 96 96s96-43 96-96V71.1l-26.1-8.7c-16.8-5.6-25.8-23.7-20.2-40.5s23.7-25.8 40.5-20.2l26.1 8.7C334.4 19.1 352 43.5 352 71.1V192c0 77.2-54.6 141.6-127.3 156.7C231 404.6 278.4 448 336 448c61.9 0 112-50.1 112-112V265.3c-28.3-12.3-48-40.5-48-73.3c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3V336c0 97.2-78.8 176-176 176c-92.9 0-168.9-71.9-175.5-163.1C87.2 334.2 32 269.6 32 192V71.1c0-27.5 17.6-52 43.8-60.7l26.1-8.7c16.8-5.6 34.9 3.5 40.5 20.2zM480 224a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, Z = {
              prefix: "fas",
              iconName: "message",
              icon: [512, 512, ["comment-alt"], "f27a", "M64 0C28.7 0 0 28.7 0 64V352c0 35.3 28.7 64 64 64h96v80c0 6.1 3.4 11.6 8.8 14.3s11.9 2.1 16.8-1.5L309.3 416H448c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64z"]
            }, te = Z, fe = {
              prefix: "fas",
              iconName: "info",
              icon: [192, 512, [], "f129", "M48 80a48 48 0 1 1 96 0A48 48 0 1 1 48 80zM0 224c0-17.7 14.3-32 32-32H96c17.7 0 32 14.3 32 32V448h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H64V256H32c-17.7 0-32-14.3-32-32z"]
            }, _ = {
              prefix: "fas",
              iconName: "down-left-and-up-right-to-center",
              icon: [512, 512, ["compress-alt"], "f422", "M439 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H296c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39L439 7zM72 272H216c13.3 0 24 10.7 24 24V440c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39L73 505c-9.4 9.4-24.6 9.4-33.9 0L7 473c-9.4-9.4-9.4-24.6 0-33.9l87-87L55 313c-6.9-6.9-8.9-17.2-5.2-26.2s12.5-14.8 22.2-14.8z"]
            }, G = _, L = {
              prefix: "fas",
              iconName: "explosion",
              icon: [576, 512, [], "e4e9", "M499.6 11.3c6.7-10.7 20.5-14.5 31.7-8.5s15.8 19.5 10.6 31L404.8 338.6c2.2 2.3 4.3 4.7 6.3 7.1l97.2-54.7c10.5-5.9 23.6-3.1 30.9 6.4s6.3 23-2.2 31.5l-87 87H378.5c-13.2-37.3-48.7-64-90.5-64s-77.4 26.7-90.5 64H117.8L42.3 363.7c-9.7-6.7-13.1-19.6-7.9-30.3s17.4-15.9 28.7-12.4l97.2 30.4c3-3.9 6.1-7.7 9.4-11.3L107.4 236.3c-6.1-10.1-3.9-23.1 5.1-30.7s22.2-7.5 31.1 .1L246 293.6c1.5-.4 3-.8 4.5-1.1l13.6-142.7c1.2-12.3 11.5-21.7 23.9-21.7s22.7 9.4 23.9 21.7l13.5 141.9L499.6 11.3zM64 448v0H512v0h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H64zM288 0c13.3 0 24 10.7 24 24V72c0 13.3-10.7 24-24 24s-24-10.7-24-24V24c0-13.3 10.7-24 24-24z"]
            }, $ = {
              prefix: "fas",
              iconName: "file-lines",
              icon: [384, 512, [128441, 128462, 61686, "file-alt", "file-text"], "f15c", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM112 256H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, ae = $, Pe = $, ge = {
              prefix: "fas",
              iconName: "wave-square",
              icon: [640, 512, [], "f83e", "M128 64c0-17.7 14.3-32 32-32H320c17.7 0 32 14.3 32 32V416h96V256c0-17.7 14.3-32 32-32H608c17.7 0 32 14.3 32 32s-14.3 32-32 32H512V448c0 17.7-14.3 32-32 32H320c-17.7 0-32-14.3-32-32V96H192V256c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32h96V64z"]
            }, me = {
              prefix: "fas",
              iconName: "ring",
              icon: [512, 512, [], "f70b", "M64 208c0 7.8 4.4 18.7 17.1 30.3C126.5 214.1 188.9 200 256 200s129.5 14.1 174.9 38.3C443.6 226.7 448 215.8 448 208c0-12.3-10.8-32-47.9-50.6C364.9 139.8 314 128 256 128s-108.9 11.8-144.1 29.4C74.8 176 64 195.7 64 208zm192 40c-47 0-89.3 7.6-122.9 19.7C166.3 280.2 208.8 288 256 288s89.7-7.8 122.9-20.3C345.3 255.6 303 248 256 248zM0 208c0-49.6 39.4-85.8 83.3-107.8C129.1 77.3 190.3 64 256 64s126.9 13.3 172.7 36.2c43.9 22 83.3 58.2 83.3 107.8v96c0 49.6-39.4 85.8-83.3 107.8C382.9 434.7 321.7 448 256 448s-126.9-13.3-172.7-36.2C39.4 389.8 0 353.6 0 304V208z"]
            }, Xe = {
              prefix: "fas",
              iconName: "building-un",
              icon: [384, 512, [], "e4d9", "M48 0C21.5 0 0 21.5 0 48V464c0 26.5 21.5 48 48 48h96V432c0-26.5 21.5-48 48-48s48 21.5 48 48v80h96c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48H48zM64 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V240zm112-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V240zM237.3 71.1l34.7 52V80c0-8.8 7.2-16 16-16s16 7.2 16 16v96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4l-34.7-52V176c0 8.8-7.2 16-16 16s-16-7.2-16-16V80c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4zM112 80v64c0 8.8 7.2 16 16 16s16-7.2 16-16V80c0-8.8 7.2-16 16-16s16 7.2 16 16v64c0 26.5-21.5 48-48 48s-48-21.5-48-48V80c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
            }, De = {
              prefix: "fas",
              iconName: "dice-three",
              icon: [448, 512, [9858], "f527", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm64 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm128 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, ne = {
              prefix: "fas",
              iconName: "calendar-days",
              icon: [448, 512, ["calendar-alt"], "f073", "M128 0c17.7 0 32 14.3 32 32V64H288V32c0-17.7 14.3-32 32-32s32 14.3 32 32V64h48c26.5 0 48 21.5 48 48v48H0V112C0 85.5 21.5 64 48 64H96V32c0-17.7 14.3-32 32-32zM0 192H448V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V192zm64 80v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zm128 0v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H336zM64 400v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H208zm112 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H336c-8.8 0-16 7.2-16 16z"]
            }, re = ne, ve = {
              prefix: "fas",
              iconName: "anchor-circle-check",
              icon: [640, 512, [], "e4aa", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80H224c-17.7 0-32 14.3-32 32s14.3 32 32 32h32V448H208c-53 0-96-43-96-96v-6.1l7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7V352c0 88.4 71.6 160 160 160h80 80c8.2 0 16.3-.6 24.2-1.8c-22.2-16.2-40.4-37.5-53-62.2H320V368 240h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H341.1zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
            }, qe = {
              prefix: "fas",
              iconName: "building-circle-arrow-right",
              icon: [640, 512, [], "e4d1", "M0 48C0 21.5 21.5 0 48 0H336c26.5 0 48 21.5 48 48V232.2c-39.1 32.3-64 81.1-64 135.8c0 49.5 20.4 94.2 53.3 126.2C364.5 505.1 351.1 512 336 512H240V432c0-26.5-21.5-48-48-48s-48 21.5-48 48v80H48c-26.5 0-48-21.5-48-48V48zM80 224c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H80zm80 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H176c-8.8 0-16 7.2-16 16zm112-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H272zM64 112v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zM176 96c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H176zm80 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H272c-8.8 0-16 7.2-16 16zm96 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm140.7-67.3c-6.2 6.2-6.2 16.4 0 22.6L521.4 352H432c-8.8 0-16 7.2-16 16s7.2 16 16 16h89.4l-28.7 28.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l56-56c6.2-6.2 6.2-16.4 0-22.6l-56-56c-6.2-6.2-16.4-6.2-22.6 0z"]
            }, ke = {
              prefix: "fas",
              iconName: "volleyball",
              icon: [512, 512, [127952, "volleyball-ball"], "f45f", "M511.8 267.4c-26.1 8.7-53.4 13.8-81 15.1c9.2-105.3-31.5-204.2-103.2-272.4C434.1 41.1 512 139.5 512 256c0 3.8-.1 7.6-.2 11.4zm-3.9 34.7c-5.8 32-17.6 62-34.2 88.7c-97.5 48.5-217.7 42.6-311.9-24.5c23.7-36.2 55.4-67.7 94.5-91.8c79.9 43.2 170.1 50.8 251.6 27.6zm-236-55.5c-2.5-90.9-41.1-172.7-101.9-231.7C196.8 5.2 225.8 0 256 0c2.7 0 5.3 0 7.9 .1c90.8 60.2 145.7 167.2 134.7 282.3c-43.1-2.4-86.4-14.1-126.8-35.9zM138 28.8c20.6 18.3 38.7 39.4 53.7 62.6C95.9 136.1 30.6 220.8 7.3 316.9C2.5 297.4 0 277 0 256C0 157.2 56 71.5 138 28.8zm69.6 90.5c19.5 38.6 31 81.9 32.3 127.7C162.5 294.6 110.9 368.9 90.2 451C66 430.4 45.6 405.4 30.4 377.2c6.7-108.7 71.9-209.9 177.1-257.9zM256 512c-50.7 0-98-14.7-137.8-40.2c5.6-27 14.8-53.1 27.4-77.7C232.2 454.6 338.1 468.8 433 441c-46 44-108.3 71-177 71z"]
            }, be = ke, Fe = {
              prefix: "fas",
              iconName: "arrows-up-to-line",
              icon: [576, 512, [], "e4c2", "M32 96l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64S14.3 96 32 96zM9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L96 237.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-210.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0l-96 96zm320 45.3c12.5 12.5 32.8 12.5 45.3 0L416 237.3 416 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-210.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3z"]
            }, Ke = {
              prefix: "fas",
              iconName: "sort-down",
              icon: [320, 512, ["sort-desc"], "f0dd", "M182.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128z"]
            }, nt = Ke, ut = {
              prefix: "fas",
              iconName: "circle-minus",
              icon: [512, 512, ["minus-circle"], "f056", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM184 232H328c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
            }, bt = ut, wt = {
              prefix: "fas",
              iconName: "door-open",
              icon: [576, 512, [], "f52b", "M320 32c0-9.9-4.5-19.2-12.3-25.2S289.8-1.4 280.2 1l-179.9 45C79 51.3 64 70.5 64 92.5V448H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H96 288h32V480 32zM256 256c0 17.7-10.7 32-24 32s-24-14.3-24-32s10.7-32 24-32s24 14.3 24 32zm96-128h96V480c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H512V128c0-35.3-28.7-64-64-64H352v64z"]
            }, Tt = {
              prefix: "fas",
              iconName: "right-from-bracket",
              icon: [512, 512, ["sign-out-alt"], "f2f5", "M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]
            }, lr = Tt, Qt = {
              prefix: "fas",
              iconName: "atom",
              icon: [512, 512, [9883], "f5d2", "M256 398.8c-11.8 5.1-23.4 9.7-34.9 13.5c16.7 33.8 31 35.7 34.9 35.7s18.1-1.9 34.9-35.7c-11.4-3.9-23.1-8.4-34.9-13.5zM446 256c33 45.2 44.3 90.9 23.6 128c-20.2 36.3-62.5 49.3-115.2 43.2c-22 52.1-55.6 84.8-98.4 84.8s-76.4-32.7-98.4-84.8c-52.7 6.1-95-6.8-115.2-43.2C21.7 346.9 33 301.2 66 256c-33-45.2-44.3-90.9-23.6-128c20.2-36.3 62.5-49.3 115.2-43.2C179.6 32.7 213.2 0 256 0s76.4 32.7 98.4 84.8c52.7-6.1 95 6.8 115.2 43.2c20.7 37.1 9.4 82.8-23.6 128zm-65.8 67.4c-1.7 14.2-3.9 28-6.7 41.2c31.8 1.4 38.6-8.7 40.2-11.7c2.3-4.2 7-17.9-11.9-48.1c-6.8 6.3-14 12.5-21.6 18.6zm-6.7-175.9c2.8 13.1 5 26.9 6.7 41.2c7.6 6.1 14.8 12.3 21.6 18.6c18.9-30.2 14.2-44 11.9-48.1c-1.6-2.9-8.4-13-40.2-11.7zM290.9 99.7C274.1 65.9 259.9 64 256 64s-18.1 1.9-34.9 35.7c11.4 3.9 23.1 8.4 34.9 13.5c11.8-5.1 23.4-9.7 34.9-13.5zm-159 88.9c1.7-14.3 3.9-28 6.7-41.2c-31.8-1.4-38.6 8.7-40.2 11.7c-2.3 4.2-7 17.9 11.9 48.1c6.8-6.3 14-12.5 21.6-18.6zM110.2 304.8C91.4 335 96 348.7 98.3 352.9c1.6 2.9 8.4 13 40.2 11.7c-2.8-13.1-5-26.9-6.7-41.2c-7.6-6.1-14.8-12.3-21.6-18.6zM336 256a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zm-80-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, tr = {
              prefix: "fas",
              iconName: "soap",
              icon: [512, 512, [129532], "e06e", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM320 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM416 32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0 160c0 27.6-11.7 52.5-30.4 70.1C422.1 275.7 448 310.8 448 352c0 53-43 96-96 96H160c-53 0-96-43-96-96s43-96 96-96h88.4c-15.2-17-24.4-39.4-24.4-64H96c-53 0-96 43-96 96V416c0 53 43 96 96 96H416c53 0 96-43 96-96V288c0-53-43-96-96-96zM160 288c-35.3 0-64 28.7-64 64s28.7 64 64 64H352c35.3 0 64-28.7 64-64s-28.7-64-64-64H320 160z"]
            }, br = {
              prefix: "fas",
              iconName: "icons",
              icon: [512, 512, ["heart-music-camera-bolt"], "f86d", "M500.3 7.3C507.7 13.3 512 22.4 512 32V176c0 26.5-28.7 48-64 48s-64-21.5-64-48s28.7-48 64-48V71L352 90.2V208c0 26.5-28.7 48-64 48s-64-21.5-64-48s28.7-48 64-48V64c0-15.3 10.8-28.4 25.7-31.4l160-32c9.4-1.9 19.1 .6 26.6 6.6zM74.7 304l11.8-17.8c5.9-8.9 15.9-14.2 26.6-14.2h61.7c10.7 0 20.7 5.3 26.6 14.2L213.3 304H240c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V352c0-26.5 21.5-48 48-48H74.7zM192 408a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM478.7 278.3L440.3 368H496c6.7 0 12.6 4.1 15 10.4s.6 13.3-4.4 17.7l-128 112c-5.6 4.9-13.9 5.3-19.9 .9s-8.2-12.4-5.3-19.2L391.7 400H336c-6.7 0-12.6-4.1-15-10.4s-.6-13.3 4.4-17.7l128-112c5.6-4.9 13.9-5.3 19.9-.9s8.2 12.4 5.3 19.2zm-339-59.2c-6.5 6.5-17 6.5-23 0L19.9 119.2c-28-29-26.5-76.9 5-103.9c27-23.5 68.4-19 93.4 6.5l10 10.5 9.5-10.5c25-25.5 65.9-30 93.9-6.5c31 27 32.5 74.9 4.5 103.9l-96.4 99.9z"]
            }, Xn = br, qr = {
              prefix: "fas",
              iconName: "microphone-lines-slash",
              icon: [640, 512, ["microphone-alt-slash"], "f539", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c15.2-26 23.9-56.3 23.9-88.7V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v24 16c0 21.2-5.1 41.1-14.2 58.7L416 300.8V256H358.9l-34.5-27c2.9-3.1 7-5 11.6-5h80V192H336c-8.8 0-16-7.2-16-16s7.2-16 16-16h80V128H336c-8.8 0-16-7.2-16-16s7.2-16 16-16h80c0-53-43-96-96-96s-96 43-96 96v54.3L38.8 5.1zm362.5 407l-43.1-33.9C346.1 382 333.3 384 320 384c-70.7 0-128-57.3-128-128v-8.7L144.7 210c-.5 1.9-.7 3.9-.7 6v40c0 89.1 66.2 162.7 152 174.4V464H248c-13.3 0-24 10.7-24 24s10.7 24 24 24h72 72c13.3 0 24-10.7 24-24s-10.7-24-24-24H344V430.4c20.4-2.8 39.7-9.1 57.3-18.2z"]
            }, En = qr, Bn = {
              prefix: "fas",
              iconName: "bridge-circle-check",
              icon: [640, 512, [], "e4c9", "M64 32C46.3 32 32 46.3 32 64s14.3 32 32 32h40v64H32V288c53 0 96 43 96 96v64c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V384c0-53 43-96 96-96c6.3 0 12.4 .6 18.3 1.7C367.1 231.8 426.9 192 496 192c42.5 0 81.6 15.1 112 40.2V160H536V96h40c17.7 0 32-14.3 32-32s-14.3-32-32-32H64zM488 96v64H408V96h80zM360 96v64H280V96h80zM232 96v64H152V96h80zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
            }, Fi = {
              prefix: "fas",
              iconName: "pump-medical",
              icon: [448, 512, [], "e06a", "M128 32v96H256V96h60.1c4.2 0 8.3 1.7 11.3 4.7l33.9 33.9c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L372.7 55.4c-15-15-35.4-23.4-56.6-23.4H256c0-17.7-14.3-32-32-32H160c-17.7 0-32 14.3-32 32zM117.4 160c-33.3 0-61 25.5-63.8 58.7L35 442.7C31.9 480 61.3 512 98.8 512H285.2c37.4 0 66.9-32 63.8-69.3l-18.7-224c-2.8-33.2-30.5-58.7-63.8-58.7H117.4zM216 280v32h32c13.3 0 24 10.7 24 24s-10.7 24-24 24H216v32c0 13.3-10.7 24-24 24s-24-10.7-24-24V360H136c-13.3 0-24-10.7-24-24s10.7-24 24-24h32V280c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
            }, Gt = {
              prefix: "fas",
              iconName: "fingerprint",
              icon: [512, 512, [], "f577", "M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256v40c0 13.3 10.7 24 24 24s24-10.7 24-24V256zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1v40c0 13.3 10.7 24 24 24s24-10.7 24-24V256c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128v24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7V256c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256v24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8V256c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96v24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7V256c0-28.7 23.3-52 52-52s52 23.3 52 52v24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1V256c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24v24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9V256z"]
            }, xr = {
              prefix: "fas",
              iconName: "hand-point-right",
              icon: [512, 512, [], "f0a4", "M480 96c17.7 0 32 14.3 32 32s-14.3 32-32 32l-208 0 0-64 208 0zM320 288c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0zm64-64c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l48 0c17.7 0 32 14.3 32 32zM288 384c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0zm-88-96l.6 0c-5.4 9.4-8.6 20.3-8.6 32c0 13.2 4 25.4 10.8 35.6C177.9 364.3 160 388.1 160 416c0 11.7 3.1 22.6 8.6 32l-8.6 0C71.6 448 0 376.4 0 288l0-61.7c0-42.4 16.9-83.1 46.9-113.1l11.6-11.6C82.5 77.5 115.1 64 149 64l27 0c35.3 0 64 28.7 64 64l0 88c0 22.1-17.9 40-40 40s-40-17.9-40-40l0-56c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 56c0 39.8 32.2 72 72 72z"]
            }, Br = {
              prefix: "fas",
              iconName: "magnifying-glass-location",
              icon: [512, 512, ["search-location"], "f689", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM288 176c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 48.8 46.5 111.6 68.6 138.6c6 7.3 16.8 7.3 22.7 0c22.1-27 68.6-89.8 68.6-138.6zm-112 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, nn = Br, sn = {
              prefix: "fas",
              iconName: "forward-step",
              icon: [320, 512, ["step-forward"], "f051", "M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4l192 160L256 241V96c0-17.7 14.3-32 32-32s32 14.3 32 32V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V271l-11.5 9.6-192 160z"]
            }, Pn = sn, an = {
              prefix: "fas",
              iconName: "face-smile-beam",
              icon: [512, 512, [128522, "smile-beam"], "f5b8", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zm53.5-96.7l0 0 0 0-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2 0 0 0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8l0 0 0 0zm160 0l0 0-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2 0 0 0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8l0 0 0 0 0 0z"]
            }, Wn = an, rr = {
              prefix: "fas",
              iconName: "flag-checkered",
              icon: [448, 512, [127937], "f11e", "M32 0C49.7 0 64 14.3 64 32V48l69-17.2c38.1-9.5 78.3-5.1 113.5 12.5c46.3 23.2 100.8 23.2 147.1 0l9.6-4.8C423.8 28.1 448 43.1 448 66.1V345.8c0 13.3-8.3 25.3-20.8 30l-34.7 13c-46.2 17.3-97.6 14.6-141.7-7.4c-37.9-19-81.3-23.7-122.5-13.4L64 384v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V400 334 64 32C0 14.3 14.3 0 32 0zM64 187.1l64-13.9v65.5L64 252.6V318l48.8-12.2c5.1-1.3 10.1-2.4 15.2-3.3V238.7l38.9-8.4c8.3-1.8 16.7-2.5 25.1-2.1l0-64c13.6 .4 27.2 2.6 40.4 6.4l23.6 6.9v66.7l-41.7-12.3c-7.3-2.1-14.8-3.4-22.3-3.8v71.4c21.8 1.9 43.3 6.7 64 14.4V244.2l22.7 6.7c13.5 4 27.3 6.4 41.3 7.4V194c-7.8-.8-15.6-2.3-23.2-4.5l-40.8-12v-62c-13-3.8-25.8-8.8-38.2-15c-8.2-4.1-16.9-7-25.8-8.8v72.4c-13-.4-26 .8-38.7 3.6L128 173.2V98L64 114v73.1zM320 335.7c16.8 1.5 33.9-.7 50-6.8l14-5.2V251.9l-7.9 1.8c-18.4 4.3-37.3 5.7-56.1 4.5v77.4zm64-149.4V115.4c-20.9 6.1-42.4 9.1-64 9.1V194c13.9 1.4 28 .5 41.7-2.6l22.3-5.2z"]
            }, Sr = {
              prefix: "fas",
              iconName: "football",
              icon: [512, 512, [127944, "football-ball"], "f44e", "M247.5 25.4c-13.5 3.3-26.4 7.2-38.6 11.7C142.9 61.6 96.7 103.6 66 153.6c-18.3 29.8-30.9 62.3-39.2 95.4L264.5 486.6c13.5-3.3 26.4-7.2 38.6-11.7c66-24.5 112.2-66.5 142.9-116.5c18.3-29.8 30.9-62.3 39.1-95.3L247.5 25.4zM495.2 205.3c6.1-56.8 1.4-112.2-7.7-156.4c-2.7-12.9-13-22.9-26.1-25.1c-58.2-9.7-109.9-12-155.6-7.9L495.2 205.3zM206.1 496L16.8 306.7c-6.1 56.8-1.4 112.2 7.7 156.4c2.7 12.9 13 22.9 26.1 25.1c58.2 9.7 109.9 12 155.6 7.9zm54.6-331.3c6.2-6.2 16.4-6.2 22.6 0l64 64c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-64-64c-6.2-6.2-6.2-16.4 0-22.6zm-48 48c6.2-6.2 16.4-6.2 22.6 0l64 64c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-64-64c-6.2-6.2-6.2-16.4 0-22.6zm-48 48c6.2-6.2 16.4-6.2 22.6 0l64 64c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-64-64c-6.2-6.2-6.2-16.4 0-22.6z"]
            }, nr = Sr, Er = {
              prefix: "fas",
              iconName: "school-circle-exclamation",
              icon: [640, 512, [], "e56c", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96H48C21.5 96 0 117.5 0 144V464c0 26.5 21.5 48 48 48H320v0H256V416c0-35.3 28.7-64 64-64l.3 0h.5c3.4-37.7 18.7-72.1 42.2-99.1C350.2 260 335.6 264 320 264c-48.6 0-88-39.4-88-88s39.4-88 88-88s88 39.4 88 88c0 18.3-5.6 35.3-15.1 49.4c29-21 64.6-33.4 103.1-33.4c59.5 0 112.1 29.6 144 74.8V144c0-26.5-21.5-48-48-48H473.7L337.8 5.4zM96 192h32c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16V208c0-8.8 7.2-16 16-16zm0 128h32c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16V336c0-8.8 7.2-16 16-16zM320 128c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H336V144c0-8.8-7.2-16-16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16v80c0 8.8-7.2 16-16 16s-16-7.2-16-16V288c0-8.8 7.2-16 16-16z"]
            }, Rn = {
              prefix: "fas",
              iconName: "crop",
              icon: [512, 512, [], "f125", "M448 109.3l54.6-54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L402.7 64 160 64v64l178.7 0L128 338.7V32c0-17.7-14.3-32-32-32S64 14.3 64 32V64H32C14.3 64 0 78.3 0 96s14.3 32 32 32H64V384c0 35.3 28.7 64 64 64H352V384H173.3L384 173.3 384 480c0 17.7 14.3 32 32 32s32-14.3 32-32V448h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H448l0-274.7z"]
            }, Vn = {
              prefix: "fas",
              iconName: "angles-down",
              icon: [448, 512, ["angle-double-down"], "f103", "M246.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-160-160c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L224 402.7 361.4 265.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-160 160zm160-352l-160 160c-12.5 12.5-32.8 12.5-45.3 0l-160-160c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L224 210.7 361.4 73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3z"]
            }, ki = Vn, as = {
              prefix: "fas",
              iconName: "users-rectangle",
              icon: [640, 512, [], "e594", "M96 0C43 0 0 43 0 96V416c0 53 43 96 96 96H544c53 0 96-43 96-96V96c0-53-43-96-96-96H96zM64 96c0-17.7 14.3-32 32-32H544c17.7 0 32 14.3 32 32V416c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V96zm159.8 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM96 309.3c0 14.7 11.9 26.7 26.7 26.7h56.1c8-34.1 32.8-61.7 65.2-73.6c-7.5-4.1-16.2-6.4-25.3-6.4H149.3C119.9 256 96 279.9 96 309.3zM461.2 336h56.1c14.7 0 26.7-11.9 26.7-26.7c0-29.5-23.9-53.3-53.3-53.3H421.3c-9.2 0-17.8 2.3-25.3 6.4c32.4 11.9 57.2 39.5 65.2 73.6zM372 289c-3.9-.7-7.9-1-12-1H280c-4.1 0-8.1 .3-12 1c-26 4.4-47.3 22.7-55.9 47c-2.7 7.5-4.1 15.6-4.1 24c0 13.3 10.7 24 24 24H408c13.3 0 24-10.7 24-24c0-8.4-1.4-16.5-4.1-24c-8.6-24.3-29.9-42.6-55.9-47zM512 176a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM320 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128z"]
            }, Rr = {
              prefix: "fas",
              iconName: "people-roof",
              icon: [640, 512, [], "e537", "M335.5 4l288 160c15.4 8.6 21 28.1 12.4 43.5s-28.1 21-43.5 12.4L320 68.6 47.5 220c-15.4 8.6-34.9 3-43.5-12.4s-3-34.9 12.4-43.5L304.5 4c9.7-5.4 21.4-5.4 31.1 0zM320 160a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM144 256a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm312 40a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM226.9 491.4L200 441.5V480c0 17.7-14.3 32-32 32H120c-17.7 0-32-14.3-32-32V441.5L61.1 491.4c-6.3 11.7-20.8 16-32.5 9.8s-16-20.8-9.8-32.5l37.9-70.3c15.3-28.5 45.1-46.3 77.5-46.3h19.5c16.3 0 31.9 4.5 45.4 12.6l33.6-62.3c15.3-28.5 45.1-46.3 77.5-46.3h19.5c32.4 0 62.1 17.8 77.5 46.3l33.6 62.3c13.5-8.1 29.1-12.6 45.4-12.6h19.5c32.4 0 62.1 17.8 77.5 46.3l37.9 70.3c6.3 11.7 1.9 26.2-9.8 32.5s-26.2 1.9-32.5-9.8L552 441.5V480c0 17.7-14.3 32-32 32H472c-17.7 0-32-14.3-32-32V441.5l-26.9 49.9c-6.3 11.7-20.8 16-32.5 9.8s-16-20.8-9.8-32.5l36.3-67.5c-1.7-1.7-3.2-3.6-4.3-5.8L376 345.5V400c0 17.7-14.3 32-32 32H296c-17.7 0-32-14.3-32-32V345.5l-26.9 49.9c-1.2 2.2-2.6 4.1-4.3 5.8l36.3 67.5c6.3 11.7 1.9 26.2-9.8 32.5s-26.2 1.9-32.5-9.8z"]
            }, Ii = {
              prefix: "fas",
              iconName: "people-line",
              icon: [640, 512, [], "e534", "M360 72a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zM144 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM496 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM200 313.5l26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-36.3-67.5c1.7-1.7 3.2-3.6 4.3-5.8L264 217.5V272c0 17.7 14.3 32 32 32h48c17.7 0 32-14.3 32-32V217.5l26.9 49.9c1.2 2.2 2.6 4.1 4.3 5.8l-36.3 67.5c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L440 313.5V352c0 17.7 14.3 32 32 32h48c17.7 0 32-14.3 32-32V313.5l26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3H486.2c-16.3 0-31.9 4.5-45.4 12.6l-33.6-62.3c-15.3-28.5-45.1-46.3-77.5-46.3H310.2c-32.4 0-62.1 17.8-77.5 46.3l-33.6 62.3c-13.5-8.1-29.1-12.6-45.4-12.6H134.2c-32.4 0-62.1 17.8-77.5 46.3L18.9 340.6c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L88 313.5V352c0 17.7 14.3 32 32 32h48c17.7 0 32-14.3 32-32V313.5z"]
            }, is = {
              prefix: "fas",
              iconName: "beer-mug-empty",
              icon: [512, 512, ["beer"], "f0fc", "M32 64c0-17.7 14.3-32 32-32H352c17.7 0 32 14.3 32 32V96h51.2c42.4 0 76.8 34.4 76.8 76.8V274.9c0 30.4-17.9 57.9-45.6 70.2L384 381.7V416c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V64zM384 311.6l56.4-25.1c4.6-2.1 7.6-6.6 7.6-11.7V172.8c0-7.1-5.7-12.8-12.8-12.8H384V311.6zM160 144c0-8.8-7.2-16-16-16s-16 7.2-16 16V368c0 8.8 7.2 16 16 16s16-7.2 16-16V144zm64 0c0-8.8-7.2-16-16-16s-16 7.2-16 16V368c0 8.8 7.2 16 16 16s16-7.2 16-16V144zm64 0c0-8.8-7.2-16-16-16s-16 7.2-16 16V368c0 8.8 7.2 16 16 16s16-7.2 16-16V144z"]
            }, ji = is, _i = {
              prefix: "fas",
              iconName: "diagram-predecessor",
              icon: [512, 512, [], "e477", "M448 416l0-64L64 352l0 64 384 0zm0 64L64 480c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64zM288 160c0 35.3-28.7 64-64 64L64 224c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l144 0 16 0 144 0c44.2 0 80 35.8 80 80l0 16 38.1 0c21.4 0 32.1 25.9 17 41L433 239c-9.4 9.4-24.6 9.4-33.9 0L329 169c-15.1-15.1-4.4-41 17-41l38.1 0 0-16c0-8.8-7.2-16-16-16l-80 0 0 64z"]
            }, oi = {
              prefix: "fas",
              iconName: "arrow-up-long",
              icon: [384, 512, ["long-arrow-up"], "f176", "M214.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3V480c0 17.7 14.3 32 32 32s32-14.3 32-32V109.3l73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128z"]
            }, vr = oi, Fr = {
              prefix: "fas",
              iconName: "fire-flame-simple",
              icon: [384, 512, ["burn"], "f46a", "M372.5 256.5l-.7-1.9C337.8 160.8 282 76.5 209.1 8.5l-3.3-3C202.1 2 197.1 0 192 0s-10.1 2-13.8 5.5l-3.3 3C102 76.5 46.2 160.8 12.2 254.6l-.7 1.9C3.9 277.3 0 299.4 0 321.6C0 426.7 86.8 512 192 512s192-85.3 192-190.4c0-22.2-3.9-44.2-11.5-65.1zm-90.8 49.5c4.1 9.3 6.2 19.4 6.2 29.5c0 53-43 96.5-96 96.5s-96-43.5-96-96.5c0-10.1 2.1-20.3 6.2-29.5l1.9-4.3c15.8-35.4 37.9-67.7 65.3-95.1l8.9-8.9c3.6-3.6 8.5-5.6 13.6-5.6s10 2 13.6 5.6l8.9 8.9c27.4 27.4 49.6 59.7 65.3 95.1l1.9 4.3z"]
            }, pr = Fr, ds = {
              prefix: "fas",
              iconName: "person",
              icon: [320, 512, [129485, "male"], "f183", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V256.9L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6h29.7c33.7 0 64.9 17.7 82.3 46.6l58.3 97c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9L232 256.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H152z"]
            }, it = ds, $t = {
              prefix: "fas",
              iconName: "laptop",
              icon: [640, 512, [128187], "f109", "M128 32C92.7 32 64 60.7 64 96V352h64V96H512V352h64V96c0-35.3-28.7-64-64-64H128zM19.2 384C8.6 384 0 392.6 0 403.2C0 445.6 34.4 480 76.8 480H563.2c42.4 0 76.8-34.4 76.8-76.8c0-10.6-8.6-19.2-19.2-19.2H19.2z"]
            }, Ur = {
              prefix: "fas",
              iconName: "file-csv",
              icon: [512, 512, [], "f6dd", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V304H176c-35.3 0-64 28.7-64 64V512H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM200 352h16c22.1 0 40 17.9 40 40v8c0 8.8-7.2 16-16 16s-16-7.2-16-16v-8c0-4.4-3.6-8-8-8H200c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h16c4.4 0 8-3.6 8-8v-8c0-8.8 7.2-16 16-16s16 7.2 16 16v8c0 22.1-17.9 40-40 40H200c-22.1 0-40-17.9-40-40V392c0-22.1 17.9-40 40-40zm133.1 0H368c8.8 0 16 7.2 16 16s-7.2 16-16 16H333.1c-7.2 0-13.1 5.9-13.1 13.1c0 5.2 3 9.9 7.8 12l37.4 16.6c16.3 7.2 26.8 23.4 26.8 41.2c0 24.9-20.2 45.1-45.1 45.1H304c-8.8 0-16-7.2-16-16s7.2-16 16-16h42.9c7.2 0 13.1-5.9 13.1-13.1c0-5.2-3-9.9-7.8-12l-37.4-16.6c-16.3-7.2-26.8-23.4-26.8-41.2c0-24.9 20.2-45.1 45.1-45.1zm98.9 0c8.8 0 16 7.2 16 16v31.6c0 23 5.5 45.6 16 66c10.5-20.3 16-42.9 16-66V368c0-8.8 7.2-16 16-16s16 7.2 16 16v31.6c0 34.7-10.3 68.7-29.6 97.6l-5.1 7.7c-3 4.5-8 7.1-13.3 7.1s-10.3-2.7-13.3-7.1l-5.1-7.7c-19.3-28.9-29.6-62.9-29.6-97.6V368c0-8.8 7.2-16 16-16z"]
            }, $e = {
              prefix: "fas",
              iconName: "menorah",
              icon: [640, 512, [], "f676", "M20.8 7.4C22.8 2.9 27.1 0 32 0s9.2 2.9 11.2 7.4L61.3 49.7c1.8 4.1 2.7 8.6 2.7 13.1V64c0 17.7-14.3 32-32 32S0 81.7 0 64V62.8c0-4.5 .9-8.9 2.7-13.1L20.8 7.4zm96 0C118.8 2.9 123.1 0 128 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1V64c0 17.7-14.3 32-32 32s-32-14.3-32-32V62.8c0-4.5 .9-8.9 2.7-13.1L116.8 7.4zm77.8 42.4L212.8 7.4C214.8 2.9 219.1 0 224 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1V64c0 17.7-14.3 32-32 32s-32-14.3-32-32V62.8c0-4.5 .9-8.9 2.7-13.1zM308.8 7.4C310.8 2.9 315.1 0 320 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1V64c0 17.7-14.3 32-32 32s-32-14.3-32-32V62.8c0-4.5 .9-8.9 2.7-13.1L308.8 7.4zm77.8 42.4L404.8 7.4C406.8 2.9 411.1 0 416 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1V64c0 17.7-14.3 32-32 32s-32-14.3-32-32V62.8c0-4.5 .9-8.9 2.7-13.1zM500.8 7.4C502.8 2.9 507.1 0 512 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1V64c0 17.7-14.3 32-32 32s-32-14.3-32-32V62.8c0-4.5 .9-8.9 2.7-13.1L500.8 7.4zm77.8 42.4L596.8 7.4C598.8 2.9 603.1 0 608 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1V64c0 17.7-14.3 32-32 32s-32-14.3-32-32V62.8c0-4.5 .9-8.9 2.7-13.1zM32 128c17.7 0 32 14.3 32 32V288c0 17.7 14.3 32 32 32H288V160c0-17.7 14.3-32 32-32s32 14.3 32 32V320H544c17.7 0 32-14.3 32-32V160c0-17.7 14.3-32 32-32s32 14.3 32 32V288c0 53-43 96-96 96H352v64H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320 160c-17.7 0-32-14.3-32-32s14.3-32 32-32H288V384H96c-53 0-96-43-96-96V160c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32v96 32H96V256 160c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32v96 32H192V256 160c0-17.7 14.3-32 32-32zm192 0c17.7 0 32 14.3 32 32v96 32H384V256 160c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32v96 32H480V256 160c0-17.7 14.3-32 32-32z"]
            }, Kt = {
              prefix: "fas",
              iconName: "truck-plane",
              icon: [640, 512, [], "e58f", "M200 0c-30.6 0-56 54.7-56 86.1V192.5L7.8 274.3C2.9 277.2 0 282.4 0 288v64c0 5.1 2.4 9.8 6.4 12.8s9.3 3.9 14.1 2.5l123.4-37v81.2l-50 40c-3.8 3-6 7.6-6 12.5v32c0 5.1 2.5 10 6.6 13s9.5 3.8 14.4 2.2L200 480.9 290.4 511c-1.6-4.7-2.4-9.8-2.4-15V463.4c-18.2-10.5-30.7-29.7-31.9-51.8l-.1-.1V408 325.5 184l0-1.1 0 0V86.1C256 54.7 231.5 0 200 0zm88 176V400c0 20.9 13.4 38.7 32 45.3V488c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V448H544v40c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V445.3c18.6-6.6 32-24.4 32-45.3V176c0-26.5-21.5-48-48-48H336c-26.5 0-48 21.5-48 48zm79.8 78.7c3.3-8.7 11.2-14.7 20.5-14.7H539.7c9.2 0 17.2 6 20.5 14.7L576 304H352l15.8-49.3zM568 352a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM336 376a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
            }, cr = {
              prefix: "fas",
              iconName: "record-vinyl",
              icon: [512, 512, [], "f8d9", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm0 224a128 128 0 1 0 0-256 128 128 0 1 0 0 256zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, Vr = {
              prefix: "fas",
              iconName: "face-grin-stars",
              icon: [512, 512, [129321, "grin-stars"], "f587", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm407.4 75.5c5-11.8-7-22.5-19.3-18.7c-39.7 12.2-84.5 19-131.8 19s-92.1-6.8-131.8-19c-12.3-3.8-24.3 6.9-19.3 18.7c25 59.1 83.2 100.5 151.1 100.5s126.2-41.4 151.1-100.5zM160 120c-3.1 0-5.9 1.8-7.2 4.6l-16.6 34.7-38.1 5c-3.1 .4-5.6 2.5-6.6 5.5s-.1 6.2 2.1 8.3l27.9 26.5-7 37.8c-.6 3 .7 6.1 3.2 7.9s5.8 2 8.5 .6L160 232.5l33.8 18.3c2.7 1.5 6 1.3 8.5-.6s3.7-4.9 3.2-7.9l-7-37.8L226.4 178c2.2-2.1 3.1-5.3 2.1-8.3s-3.5-5.1-6.6-5.5l-38.1-5-16.6-34.7c-1.3-2.8-4.1-4.6-7.2-4.6zm192 0c-3.1 0-5.9 1.8-7.2 4.6l-16.6 34.7-38.1 5c-3.1 .4-5.6 2.5-6.6 5.5s-.1 6.2 2.1 8.3l27.9 26.5-7 37.8c-.6 3 .7 6.1 3.2 7.9s5.8 2 8.5 .6L352 232.5l33.8 18.3c2.7 1.5 6 1.3 8.5-.6s3.7-4.9 3.2-7.9l-7-37.8L418.4 178c2.2-2.1 3.1-5.3 2.1-8.3s-3.5-5.1-6.6-5.5l-38.1-5-16.6-34.7c-1.3-2.8-4.1-4.6-7.2-4.6z"]
            }, Lr = Vr, pi = {
              prefix: "fas",
              iconName: "bong",
              icon: [448, 512, [], "f55c", "M160 208.5c0 29.1-15.6 53.9-37.2 67.8c-17.2 11.1-31.5 26.1-41.7 43.7H302.9c-10.2-17.6-24.5-32.6-41.7-43.7c-21.6-13.9-37.2-38.7-37.2-67.8V64H160V208.5zM288 64V208.5c0 5.7 3.1 10.9 7.9 14c11.2 7.2 21.5 15.5 30.9 24.8L366.1 208l-7-7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l24 24 24 24c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-7-7-43.3 43.3C374 314.1 384 347.9 384 384c0 39.4-11.9 76.1-32.2 106.5c-9.6 14.4-26.5 21.5-43.8 21.5H76.1c-17.3 0-34.2-7.1-43.8-21.5C11.9 460.1 0 423.4 0 384c0-67.8 35.1-127.3 88.1-161.5c4.8-3.1 7.9-8.3 7.9-14V64C78.3 64 64 49.7 64 32S78.3 0 96 0h16H272h16c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]
            }, zr = {
              prefix: "fas",
              iconName: "spaghetti-monster-flying",
              icon: [640, 512, ["pastafarianism"], "f67b", "M208 64a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 0c0 16.2-6 31.1-16 42.3l15.6 31.2c18.7-6 39.9-9.5 64.4-9.5s45.8 3.5 64.4 9.5L400 106.3C390 95.1 384 80.2 384 64c0-35.3 28.7-64 64-64s64 28.7 64 64s-28.7 64-64 64c-1.7 0-3.4-.1-5.1-.2L427.8 158c21.1 13.6 37.7 30.2 51.4 46.4c7.1 8.3 13.5 16.6 19.3 24l1.4 1.8c6.3 8.1 11.6 14.8 16.7 20.4C527.3 262.3 532.7 264 536 264c2.5 0 4.3-.6 7.1-3.3c3.7-3.5 7.1-8.8 12.5-17.4l.6-.9c4.6-7.4 11-17.6 19.4-25.7c9.7-9.3 22.9-16.7 40.4-16.7c13.3 0 24 10.7 24 24s-10.7 24-24 24c-2.5 0-4.3 .6-7.1 3.3c-3.7 3.5-7.1 8.8-12.5 17.4l-.6 .9c-4.6 7.4-11 17.6-19.4 25.7c-9.7 9.3-22.9 16.7-40.4 16.7c-18.5 0-32.9-8.5-44.3-18.6c-3.1 4-6.6 8.3-10.5 12.7c1.4 4.3 2.8 8.5 4 12.5c.9 3 1.8 5.8 2.6 8.6c3 9.8 5.5 18.2 8.6 25.9c3.9 9.8 7.4 15.4 10.8 18.5c2.6 2.4 5.9 4.3 12.8 4.3c8.7 0 16.9-4.2 33.7-13.2c15-8 35.7-18.8 62.3-18.8c13.3 0 24 10.7 24 24s-10.7 24-24 24c-13.4 0-24.7 5.2-39.7 13.2c-1 .6-2.1 1.1-3.2 1.7C559.9 414 541.4 424 520 424c-18.4 0-33.6-6.1-45.5-17.2c-11.1-10.3-17.9-23.7-22.7-36c-3.6-9-6.7-19.1-9.5-28.5c-16.4 12.3-36.1 23.6-58.9 31.3c3.6 10.8 8.4 23.5 14.4 36.2c7.5 15.9 16.2 30.4 25.8 40.5C433 460.5 441.2 464 448 464c13.3 0 24 10.7 24 24s-10.7 24-24 24c-25.2 0-45-13.5-59.5-28.8c-14.5-15.4-25.7-34.9-34.2-53c-8-17-14.1-33.8-18.3-46.9c-5.2 .4-10.6 .6-16 .6s-10.8-.2-16-.6c-4.2 13-10.3 29.9-18.3 46.9c-8.5 18.1-19.8 37.6-34.2 53C237 498.5 217.2 512 192 512c-13.3 0-24-10.7-24-24s10.7-24 24-24c6.8 0 15-3.5 24.5-13.7c9.5-10.1 18.3-24.6 25.8-40.5c5.9-12.6 10.7-25.4 14.4-36.2c-22.8-7.7-42.5-19-58.9-31.3c-2.9 9.4-6 19.5-9.5 28.5c-4.8 12.2-11.6 25.6-22.7 36C153.6 417.9 138.4 424 120 424c-21.4 0-39.9-10-53.1-17.1l0 0c-1.1-.6-2.2-1.2-3.2-1.7c-15-8-26.3-13.2-39.7-13.2c-13.3 0-24-10.7-24-24s10.7-24 24-24c26.6 0 47.3 10.8 62.3 18.8c16.8 9 25 13.2 33.7 13.2c6.8 0 10.2-1.9 12.8-4.3c3.4-3.2 7-8.8 10.8-18.5c3-7.7 5.6-16.1 8.6-25.9c.8-2.7 1.7-5.6 2.6-8.6c1.2-4 2.6-8.2 4-12.5c-3.9-4.5-7.4-8.8-10.5-12.7C136.9 303.5 122.5 312 104 312c-17.5 0-30.7-7.4-40.4-16.7c-8.4-8.1-14.8-18.3-19.4-25.7l-.6-.9c-5.4-8.6-8.8-13.9-12.5-17.4c-2.8-2.7-4.6-3.3-7.1-3.3c-13.3 0-24-10.7-24-24s10.7-24 24-24c17.5 0 30.7 7.4 40.4 16.7c8.4 8.1 14.8 18.3 19.4 25.7l.6 .9c5.4 8.6 8.8 13.9 12.5 17.4c2.8 2.7 4.6 3.3 7.1 3.3c3.3 0 8.7-1.7 19.4-13.4c5.1-5.6 10.4-12.3 16.7-20.4l1.4-1.8c5.8-7.4 12.2-15.7 19.3-24c13.8-16.2 30.3-32.8 51.4-46.4l-15.1-30.2c-1.7 .1-3.4 .2-5.1 .2c-35.3 0-64-28.7-64-64s28.7-64 64-64s64 28.7 64 64zm208 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
            }, Cn = zr, Mi = {
              prefix: "fas",
              iconName: "arrow-down-up-across-line",
              icon: [576, 512, [], "e4af", "M137.4 502.6c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7V288H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H448V109.3l41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L384 109.3V224H192 128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h96V402.7L86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96zM128 192h64V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V192zM448 320H384V448c0 17.7 14.3 32 32 32s32-14.3 32-32V320z"]
            }, li = {
              prefix: "fas",
              iconName: "spoon",
              icon: [512, 512, [129348, 61873, "utensil-spoon"], "f2e5", "M245.8 220.9c-14.5-17.6-21.8-39.2-21.8-60.8C224 80 320 0 416 0c53 0 96 43 96 96c0 96-80 192-160.2 192c-21.6 0-43.2-7.3-60.8-21.8L54.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L245.8 220.9z"]
            }, Xs = li, Ri = {
              prefix: "fas",
              iconName: "jar-wheat",
              icon: [320, 512, [], "e517", "M32 32C32 14.3 46.3 0 64 0H256c17.7 0 32 14.3 32 32s-14.3 32-32 32H64C46.3 64 32 49.7 32 32zM0 160c0-35.3 28.7-64 64-64H256c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V160zm112 0H69.8c-3.2 0-5.8 2.6-5.8 5.8C64 198 90 224 122.2 224H144h32 21.8c32.1 0 58.2-26 58.2-58.2c0-3.2-2.6-5.8-5.8-5.8H208c-19.1 0-36.3 8.4-48 21.7c-11.7-13.3-28.9-21.7-48-21.7zm48 117.7c-11.7-13.3-28.9-21.7-48-21.7H69.8c-3.2 0-5.8 2.6-5.8 5.8C64 294 90 320 122.2 320H144h32 21.8c32.1 0 58.2-26 58.2-58.2c0-3.2-2.6-5.8-5.8-5.8H208c-19.1 0-36.3 8.4-48 21.7zM112 352H69.8c-3.2 0-5.8 2.6-5.8 5.8C64 390 90 416 122.2 416H144v32c0 8.8 7.2 16 16 16s16-7.2 16-16V416h21.8c32.1 0 58.2-26 58.2-58.2c0-3.2-2.6-5.8-5.8-5.8H208c-19.1 0-36.3 8.4-48 21.7c-11.7-13.3-28.9-21.7-48-21.7z"]
            }, j1 = {
              prefix: "fas",
              iconName: "envelopes-bulk",
              icon: [640, 512, ["mail-bulk"], "f674", "M128 0C110.3 0 96 14.3 96 32V224h96V192c0-35.3 28.7-64 64-64H480V32c0-17.7-14.3-32-32-32H128zM256 160c-17.7 0-32 14.3-32 32v32h96c35.3 0 64 28.7 64 64V416H576c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32H256zm240 64h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H496c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zM64 256c-17.7 0-32 14.3-32 32v13L187.1 415.9c1.4 1 3.1 1.6 4.9 1.6s3.5-.6 4.9-1.6L352 301V288c0-17.7-14.3-32-32-32H64zm288 84.8L216 441.6c-6.9 5.1-15.3 7.9-24 7.9s-17-2.8-24-7.9L32 340.8V480c0 17.7 14.3 32 32 32H320c17.7 0 32-14.3 32-32V340.8z"]
            }, w1 = j1, di = {
              prefix: "fas",
              iconName: "file-circle-exclamation",
              icon: [576, 512, [], "e4eb", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384v38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16v80c0 8.8 7.2 16 16 16s16-7.2 16-16V288c0-8.8-7.2-16-16-16z"]
            }, jf = {
              prefix: "fas",
              iconName: "circle-h",
              icon: [512, 512, [9405, "hospital-symbol"], "f47e", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM368 152V256 360c0 13.3-10.7 24-24 24s-24-10.7-24-24V280H192l0 80c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-208c0-13.3 10.7-24 24-24s24 10.7 24 24v80H320V152c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
            }, B6 = jf, W6 = {
              prefix: "fas",
              iconName: "pager",
              icon: [512, 512, [128223], "f815", "M0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128zm64 32v64c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32V160c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32zM80 320c-13.3 0-24 10.7-24 24s10.7 24 24 24h56c13.3 0 24-10.7 24-24s-10.7-24-24-24H80zm136 0c-13.3 0-24 10.7-24 24s10.7 24 24 24h48c13.3 0 24-10.7 24-24s-10.7-24-24-24H216z"]
            }, S6 = {
              prefix: "fas",
              iconName: "address-book",
              icon: [512, 512, [62138, "contact-book"], "f2b9", "M96 0C60.7 0 32 28.7 32 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H96zM208 288h64c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16H144c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM512 80c0-8.8-7.2-16-16-16s-16 7.2-16 16v64c0 8.8 7.2 16 16 16s16-7.2 16-16V80zM496 192c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm16 144c0-8.8-7.2-16-16-16s-16 7.2-16 16v64c0 8.8 7.2 16 16 16s16-7.2 16-16V336z"]
            }, qa = S6, m1 = {
              prefix: "fas",
              iconName: "strikethrough",
              icon: [512, 512, [], "f0cc", "M161.3 144c3.2-17.2 14-30.1 33.7-38.6c21.1-9 51.8-12.3 88.6-6.5c11.9 1.9 48.8 9.1 60.1 12c17.1 4.5 34.6-5.6 39.2-22.7s-5.6-34.6-22.7-39.2c-14.3-3.8-53.6-11.4-66.6-13.4c-44.7-7-88.3-4.2-123.7 10.9c-36.5 15.6-64.4 44.8-71.8 87.3c-.1 .6-.2 1.1-.2 1.7c-2.8 23.9 .5 45.6 10.1 64.6c4.5 9 10.2 16.9 16.7 23.9H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H270.1c-.1 0-.3-.1-.4-.1l-1.1-.3c-36-10.8-65.2-19.6-85.2-33.1c-9.3-6.3-15-12.6-18.2-19.1c-3.1-6.1-5.2-14.6-3.8-27.4zM348.9 337.2c2.7 6.5 4.4 15.8 1.9 30.1c-3 17.6-13.8 30.8-33.9 39.4c-21.1 9-51.7 12.3-88.5 6.5c-18-2.9-49.1-13.5-74.4-22.1c-5.6-1.9-11-3.7-15.9-5.4c-16.8-5.6-34.9 3.5-40.5 20.3s3.5 34.9 20.3 40.5c3.6 1.2 7.9 2.7 12.7 4.3l0 0 0 0c24.9 8.5 63.6 21.7 87.6 25.6l0 0 .2 0c44.7 7 88.3 4.2 123.7-10.9c36.5-15.6 64.4-44.8 71.8-87.3c3.6-21 2.7-40.4-3.1-58.1H335.1c7 5.6 11.4 11.2 13.9 17.2z"]
            }, Ho = {
              prefix: "fas",
              iconName: "k",
              icon: [320, 512, [107], "4b", "M311 86.3c12.3-12.7 12-32.9-.7-45.2s-32.9-12-45.2 .7l-155.2 160L64 249V64c0-17.7-14.3-32-32-32S0 46.3 0 64V328 448c0 17.7 14.3 32 32 32s32-14.3 32-32V341l64.7-66.7 133 192c10.1 14.5 30 18.1 44.5 8.1s18.1-30 8.1-44.5L174.1 227.4 311 86.3z"]
            }, X9 = {
              prefix: "fas",
              iconName: "landmark-flag",
              icon: [512, 512, [], "e51c", "M272 0h80c8.8 0 16 7.2 16 16V80c0 8.8-7.2 16-16 16H272v32H464c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32s14.3-32 32-32H240V16c0-8.8 7.2-16 16-16h16zM64 224h64V416h40V224h64V416h48V224h64V416h40V224h64V420.3c.6 .3 1.2 .7 1.8 1.1l48 32c11.7 7.8 17 22.4 12.9 35.9S494.1 512 480 512H32c-14.1 0-26.5-9.2-30.6-22.7s1.1-28.1 12.9-35.9l48-32c.6-.4 1.2-.7 1.8-1.1V224z"]
            }, $o = {
              prefix: "fas",
              iconName: "pencil",
              icon: [512, 512, [9999, 61504, "pencil-alt"], "f303", "M410.3 231l11.3-11.3-33.9-33.9-62.1-62.1L291.7 89.8l-11.3 11.3-22.6 22.6L58.6 322.9c-10.4 10.4-18 23.3-22.2 37.4L1 480.7c-2.5 8.4-.2 17.5 6.1 23.7s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L387.7 253.7 410.3 231zM160 399.4l-9.1 22.7c-4 3.1-8.5 5.4-13.3 6.9L59.4 452l23-78.1c1.4-4.9 3.8-9.4 6.9-13.3l22.7-9.1v32c0 8.8 7.2 16 16 16h32zM362.7 18.7L348.3 33.2 325.7 55.8 314.3 67.1l33.9 33.9 62.1 62.1 33.9 33.9 11.3-11.3 22.6-22.6 14.5-14.5c25-25 25-65.5 0-90.5L453.3 18.7c-25-25-65.5-25-90.5 0zm-47.4 168l-144 144c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l144-144c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
            }, T9 = $o, q9 = {
              prefix: "fas",
              iconName: "backward",
              icon: [512, 512, [9194], "f04a", "M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3V256v41.7L459.5 440.6zM256 352V256 128 96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V352z"]
            }, wf = {
              prefix: "fas",
              iconName: "caret-right",
              icon: [256, 512, [], "f0da", "M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"]
            }, mf = {
              prefix: "fas",
              iconName: "comments",
              icon: [640, 512, [128490, 61670], "f086", "M208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 38.6 14.7 74.3 39.6 103.4c-3.5 9.4-8.7 17.7-14.2 24.7c-4.8 6.2-9.7 11-13.3 14.3c-1.8 1.6-3.3 2.9-4.3 3.7c-.5 .4-.9 .7-1.1 .8l-.2 .2 0 0 0 0C1 327.2-1.4 334.4 .8 340.9S9.1 352 16 352c21.8 0 43.8-5.6 62.1-12.5c9.2-3.5 17.8-7.4 25.3-11.4C134.1 343.3 169.8 352 208 352zM448 176c0 112.3-99.1 196.9-216.5 207C255.8 457.4 336.4 512 432 512c38.2 0 73.9-8.7 104.7-23.9c7.5 4 16 7.9 25.2 11.4c18.3 6.9 40.3 12.5 62.1 12.5c6.9 0 13.1-4.5 15.2-11.1c2.1-6.6-.2-13.8-5.8-17.9l0 0 0 0-.2-.2c-.2-.2-.6-.4-1.1-.8c-1-.8-2.5-2-4.3-3.7c-3.6-3.3-8.5-8.1-13.3-14.3c-5.5-7-10.7-15.4-14.2-24.7c24.9-29 39.6-64.7 39.6-103.4c0-92.8-84.9-168.9-192.6-175.5c.4 5.1 .6 10.3 .6 15.5z"]
            }, B1 = {
              prefix: "fas",
              iconName: "paste",
              icon: [512, 512, ["file-clipboard"], "f0ea", "M160 0c-23.7 0-44.4 12.9-55.4 32H48C21.5 32 0 53.5 0 80V400c0 26.5 21.5 48 48 48H192V176c0-44.2 35.8-80 80-80h48V80c0-26.5-21.5-48-48-48H215.4C204.4 12.9 183.7 0 160 0zM272 128c-26.5 0-48 21.5-48 48V448v16c0 26.5 21.5 48 48 48H464c26.5 0 48-21.5 48-48V256H416c-17.7 0-32-14.3-32-32V128H320 272zM160 40a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm256 88v96h96l-96-96z"]
            }, h1 = B1, U6 = {
              prefix: "fas",
              iconName: "code-pull-request",
              icon: [512, 512, [], "e13c", "M305.8 2.1C314.4 5.9 320 14.5 320 24V64h16c70.7 0 128 57.3 128 128V358.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3V192c0-35.3-28.7-64-64-64H320v40c0 9.5-5.6 18.1-14.2 21.9s-18.8 2.3-25.8-4.1l-80-72c-5.1-4.6-7.9-11-7.9-17.8s2.9-13.3 7.9-17.8l80-72c7-6.3 17.2-7.9 25.8-4.1zM104 80A24 24 0 1 0 56 80a24 24 0 1 0 48 0zm8 73.3V358.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3V153.3C19.7 141 0 112.8 0 80C0 35.8 35.8 0 80 0s80 35.8 80 80c0 32.8-19.7 61-48 73.3zM104 432a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm328 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
            }, b9 = {
              prefix: "fas",
              iconName: "clipboard-list",
              icon: [384, 512, [], "f46d", "M192 0c-41.8 0-77.4 26.7-90.5 64H64C28.7 64 0 92.7 0 128V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H282.5C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM72 272a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm104-16H304c8.8 0 16 7.2 16 16s-7.2 16-16 16H176c-8.8 0-16-7.2-16-16s7.2-16 16-16zM72 368a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm88 0c0-8.8 7.2-16 16-16H304c8.8 0 16 7.2 16 16s-7.2 16-16 16H176c-8.8 0-16-7.2-16-16z"]
            }, J9 = {
              prefix: "fas",
              iconName: "truck-ramp-box",
              icon: [640, 512, ["truck-loading"], "f4de", "M640 0V400c0 61.9-50.1 112-112 112c-61 0-110.5-48.7-112-109.3L48.4 502.9c-17.1 4.6-34.6-5.4-39.3-22.5s5.4-34.6 22.5-39.3L352 353.8V64c0-35.3 28.7-64 64-64H640zM576 400a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM23.1 207.7c-4.6-17.1 5.6-34.6 22.6-39.2l46.4-12.4 20.7 77.3c2.3 8.5 11.1 13.6 19.6 11.3l30.9-8.3c8.5-2.3 13.6-11.1 11.3-19.6l-20.7-77.3 46.4-12.4c17.1-4.6 34.6 5.6 39.2 22.6l41.4 154.5c4.6 17.1-5.6 34.6-22.6 39.2L103.7 384.9c-17.1 4.6-34.6-5.6-39.2-22.6L23.1 207.7z"]
            }, OA = J9, z1 = {
              prefix: "fas",
              iconName: "user-check",
              icon: [640, 512, [], "f4fc", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3zM625 177L497 305c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L591 143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
            }, Zd = {
              prefix: "fas",
              iconName: "vial-virus",
              icon: [512, 512, [], "e597", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96V384c0 53 43 96 96 96c28.6 0 54.2-12.5 71.8-32.3c.1-14.2 5.6-28.3 16.4-39.1c.2-.2 .1-.6-.2-.6c-30.9 0-56-25.1-56-56s25.1-56 56-56c.3 0 .4-.4 .2-.6c-21.9-21.9-21.9-57.3 0-79.2c2.4-2.4 5-4.6 7.8-6.5V96c17.7 0 32-14.3 32-32s-14.3-32-32-32H160 96 32zM96 192V96h64v96H96zM216 376c28.8 0 43.2 34.8 22.9 55.2c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0c20.4-20.4 55.2-5.9 55.2 22.9c0 13.3 10.7 24 24 24s24-10.7 24-24c0-28.8 34.8-43.2 55.2-22.9c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9C444.8 410.8 459.2 376 488 376c13.3 0 24-10.7 24-24s-10.7-24-24-24c-28.8 0-43.2-34.8-22.9-55.2c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0C410.8 259.2 376 244.8 376 216c0-13.3-10.7-24-24-24s-24 10.7-24 24c0 28.8-34.8 43.2-55.2 22.9c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9c20.4 20.4 5.9 55.2-22.9 55.2c-13.3 0-24 10.7-24 24s10.7 24 24 24zm104-88a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm40 96a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
            }, Zr = {
              prefix: "fas",
              iconName: "sheet-plastic",
              icon: [384, 512, [], "e571", "M0 448c0 35.3 28.7 64 64 64H224V384c0-17.7 14.3-32 32-32H384V64c0-35.3-28.7-64-64-64H64C28.7 0 0 28.7 0 64V448zM171.3 75.3l-96 96c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l96-96c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6zm96 32l-160 160c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l160-160c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6zM384 384H256V512L384 384z"]
            }, Ts = {
              prefix: "fas",
              iconName: "blog",
              icon: [512, 512, [], "f781", "M192 32c0 17.7 14.3 32 32 32c123.7 0 224 100.3 224 224c0 17.7 14.3 32 32 32s32-14.3 32-32C512 128.9 383.1 0 224 0c-17.7 0-32 14.3-32 32zm0 96c0 17.7 14.3 32 32 32c70.7 0 128 57.3 128 128c0 17.7 14.3 32 32 32s32-14.3 32-32c0-106-86-192-192-192c-17.7 0-32 14.3-32 32zM96 144c0-26.5-21.5-48-48-48S0 117.5 0 144V368c0 79.5 64.5 144 144 144s144-64.5 144-144s-64.5-144-144-144H128v96h16c26.5 0 48 21.5 48 48s-21.5 48-48 48s-48-21.5-48-48V144z"]
            }, go = {
              prefix: "fas",
              iconName: "user-ninja",
              icon: [448, 512, [129399], "f504", "M224 256c-57.2 0-105.6-37.5-122-89.3c-1.1 1.3-2.2 2.6-3.5 3.8c-15.8 15.8-38.8 20.7-53.6 22.1c-8.1 .8-14.6-5.7-13.8-13.8c1.4-14.7 6.3-37.8 22.1-53.6c5.8-5.8 12.6-10.1 19.6-13.4c-7-3.2-13.8-7.6-19.6-13.4C37.4 82.7 32.6 59.7 31.1 44.9c-.8-8.1 5.7-14.6 13.8-13.8c14.7 1.4 37.8 6.3 53.6 22.1c4.8 4.8 8.7 10.4 11.7 16.1C131.4 28.2 174.4 0 224 0c70.7 0 128 57.3 128 128s-57.3 128-128 128zM0 482.3C0 399.5 56.4 330 132.8 309.9c6-1.6 12.2 .9 15.9 5.8l62.5 83.3c6.4 8.5 19.2 8.5 25.6 0l62.5-83.3c3.7-4.9 9.9-7.4 15.9-5.8C391.6 330 448 399.5 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3zM160 96c-8.8 0-16 7.2-16 16s7.2 16 16 16H288c8.8 0 16-7.2 16-16s-7.2-16-16-16H160z"]
            }, G1 = {
              prefix: "fas",
              iconName: "person-arrow-up-from-line",
              icon: [640, 512, [], "e539", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 352V352h16v96H184zm-64 0H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H152h80H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H264V256.9l28.6 47.5c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-58.3-97c-17.4-28.9-48.6-46.6-82.3-46.6H177.1c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9V448zM598.6 121.4l-80-80c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L464 141.3 464 384c0 17.7 14.3 32 32 32s32-14.3 32-32V141.3l25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3z"]
            }, z9 = {
              prefix: "fas",
              iconName: "scroll-torah",
              icon: [640, 512, ["torah"], "f6a0", "M96 480V32C96 14.3 74.5 0 48 0S0 14.3 0 32V480c0 17.7 21.5 32 48 32s48-14.3 48-32zM512 32H128V480H512V32zM592 0c-26.5 0-48 14.3-48 32V480c0 17.7 21.5 32 48 32s48-14.3 48-32V32c0-17.7-21.5-32-48-32zM196 313.7c0-3.2 .9-6.4 2.5-9.2L226.7 256l-28.3-48.5c-1.6-2.8-2.5-6-2.5-9.2c0-10.1 8.2-18.3 18.3-18.3H271l31.4-53.9c3.6-6.3 10.3-10.1 17.6-10.1s13.9 3.8 17.6 10.1L369 180h56.7c10.1 0 18.3 8.2 18.3 18.3c0 3.2-.9 6.4-2.5 9.2L413.3 256l28.3 48.5c1.6 2.8 2.5 6 2.5 9.2c0 10.1-8.2 18.3-18.3 18.3H369l-31.4 53.9c-3.6 6.3-10.3 10.1-17.6 10.1s-13.9-3.8-17.6-10.1L271 332H214.3c-10.1 0-18.3-8.2-18.3-18.3zm124 54.7L341.2 332H298.8L320 368.4zM254.5 256l30.3 52h70.4l30.3-52-30.3-52H284.8l-30.3 52zm144.9 23.8L383 308h32.8l-16.4-28.2zM415.8 204H383l16.4 28.2L415.8 204zM320 143.6L298.8 180h42.4L320 143.6zM224.2 204l16.4 28.2L257 204H224.2zM257 308l-16.4-28.2L224.2 308H257z"]
            }, Li = z9, Fa = {
              prefix: "fas",
              iconName: "broom-ball",
              icon: [576, 512, ["quidditch", "quidditch-broom-ball"], "f458", "M566.6 9.4c12.5 12.5 12.5 32.8 0 45.3l-192 192 34.7 34.7c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6H364.3L256 211.7V182.6c0-12.5 10.1-22.6 22.6-22.6c6 0 11.8 2.4 16 6.6l34.7 34.7 192-192c12.5-12.5 32.8-12.5 45.3 0zm-344 225.5L341.1 353.4c3.7 42.7-11.7 85.2-42.3 115.8C271.4 496.6 234.2 512 195.5 512L22.1 512C9.9 512 0 502.1 0 489.9c0-6.3 2.7-12.3 7.3-16.5L133.7 359.7c4.2-3.7-.4-10.4-5.4-7.9L77.2 377.4c-6.1 3-13.2-1.4-13.2-8.2c0-31.5 12.5-61.7 34.8-84l8-8c30.6-30.6 73.1-45.9 115.8-42.3zM464 352a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
            }, Sa = Fa, Fn = Fa, I6 = {
              prefix: "fas",
              iconName: "toggle-off",
              icon: [576, 512, [], "f204", "M384 128c70.7 0 128 57.3 128 128s-57.3 128-128 128H192c-70.7 0-128-57.3-128-128s57.3-128 128-128H384zM576 256c0-106-86-192-192-192H192C86 64 0 150 0 256S86 448 192 448H384c106 0 192-86 192-192zM192 352a96 96 0 1 0 0-192 96 96 0 1 0 0 192z"]
            }, $i = {
              prefix: "fas",
              iconName: "box-archive",
              icon: [512, 512, ["archive"], "f187", "M32 32H480c17.7 0 32 14.3 32 32V96c0 17.7-14.3 32-32 32H32C14.3 128 0 113.7 0 96V64C0 46.3 14.3 32 32 32zm0 128H480V416c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V160zm128 80c0 8.8 7.2 16 16 16H336c8.8 0 16-7.2 16-16s-7.2-16-16-16H176c-8.8 0-16 7.2-16 16z"]
            }, Ga = $i, e1 = {
              prefix: "fas",
              iconName: "person-drowning",
              icon: [576, 512, [], "e545", "M192 64c0-17.7-14.3-32-32-32s-32 14.3-32 32V96.2c0 54.1 23.5 104 62.2 138.3l-21 146.7c7.8 2.1 15.5 3.3 22.8 3.3c21.1 0 42-8.5 59.2-20.3c22.1-15.5 51.6-15.5 73.7 0c12.4 8.5 26.1 14.8 39.7 18l17.7-97.6c10.7-1.2 21.3-3.1 31.9-5.5l105-23.9c17.2-3.9 28-21.1 24.1-38.3s-21.1-28-38.3-24.1L400 216.6c-41 9.3-83.7 7.5-123.7-5.2c-50.2-16-84.3-62.6-84.3-115.3V64zM320 192a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM306.5 389.9c-11.1-7.9-25.9-7.9-37 0C247 405.4 219.5 416 192 416c-26.9 0-55.3-10.8-77.4-26.1l0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 469.7 159 480 192 480c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7l0 0C439.4 405.2 410.9 416 384 416c-27.5 0-55-10.6-77.5-26.1z"]
            }, Lf = {
              prefix: "fas",
              iconName: "arrow-down-9-1",
              icon: [576, 512, ["sort-numeric-desc", "sort-numeric-down-alt"], "f886", "M160 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L192 365.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V365.7L95.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C142.5 476.2 151 480 160 480zM450.7 294c-8.3-6-19.1-7.7-28.8-4.4l-48 16c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l5.9-2V416H384c-17.7 0-32 14.3-32 32s14.3 32 32 32h48 48c17.7 0 32-14.3 32-32s-14.3-32-32-32H464V320c0-10.3-4.9-19.9-13.3-26zM418.3 91a32 32 0 1 1 27.4 57.9A32 32 0 1 1 418.3 91zM405.1 203.8l-6.8 9.2c-10.5 14.2-7.5 34.2 6.7 44.8s34.2 7.5 44.8-6.7l48.8-65.8c14-18.9 21.5-41.7 21.5-65.2c0-48.6-39.4-88-88-88s-88 39.4-88 88c0 39.2 25.6 72.4 61.1 83.8z"]
            }, Ua = Lf, vs = Lf, R6 = {
              prefix: "fas",
              iconName: "face-grin-tongue-squint",
              icon: [512, 512, [128541, "grin-tongue-squint"], "f58a", "M0 256C0 368.9 73.1 464.7 174.5 498.8C165.3 484 160 466.6 160 448V400.7c-24-17.5-43.1-41.4-54.8-69.2c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19c12.3-3.8 24.3 6.9 19.3 18.7c-11.8 28-31.1 52-55.4 69.6V448c0 18.6-5.3 36-14.5 50.8C438.9 464.7 512 368.9 512 256C512 114.6 397.4 0 256 0S0 114.6 0 256zM116 141.1c0-9 9.6-14.7 17.5-10.5l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6zm262.5-10.5c7.9-4.2 17.5 1.5 17.5 10.5c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9zM320 448V402.6c0-14.7-11.9-26.6-26.6-26.6h-2c-11.3 0-21.1 7.9-23.6 18.9c-2.8 12.6-20.8 12.6-23.6 0c-2.5-11.1-12.3-18.9-23.6-18.9h-2c-14.7 0-26.6 11.9-26.6 26.6V448c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
            }, Bf = R6, Ie = {
              prefix: "fas",
              iconName: "spray-can",
              icon: [512, 512, [], "f5bd", "M128 0h64c17.7 0 32 14.3 32 32v96H96V32c0-17.7 14.3-32 32-32zM0 256c0-53 43-96 96-96H224c53 0 96 43 96 96V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V256zm240 80A80 80 0 1 0 80 336a80 80 0 1 0 160 0zM256 64a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM384 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM448 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM384 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, Pt = {
              prefix: "fas",
              iconName: "truck-monster",
              icon: [640, 512, [], "f63b", "M288 64v64H416L368 64H288zM419.2 25.6L496 128h80c17.7 0 32 14.3 32 32v64c17.7 0 32 14.3 32 32s-14.3 32-32 32c-29.2-38.9-75.7-64-128-64s-98.8 25.1-128 64H288c-29.2-38.9-75.7-64-128-64s-98.8 25.1-128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32V160c0-17.7 14.3-32 32-32H224V48c0-26.5 21.5-48 48-48h96c20.1 0 39.1 9.5 51.2 25.6zM152 256h16c12.1 0 22.1 8.9 23.8 20.6c7.6 2.2 14.9 5.3 21.7 9c9.4-7 22.8-6.3 31.3 2.3l11.3 11.3c8.6 8.6 9.3 21.9 2.3 31.3c3.7 6.8 6.8 14.1 9 21.7c11.6 1.7 20.6 11.7 20.6 23.8v16c0 12.1-8.9 22.1-20.6 23.8c-2.2 7.6-5.3 14.9-9 21.7c7 9.4 6.3 22.8-2.3 31.3l-11.3 11.3c-8.6 8.6-21.9 9.3-31.3 2.2c-6.8 3.7-14.1 6.8-21.7 9C190.1 503.1 180.1 512 168 512H152c-12.1 0-22.1-8.9-23.8-20.6c-7.6-2.2-14.9-5.3-21.7-9c-9.4 7.1-22.8 6.3-31.3-2.2L63.8 468.9c-8.6-8.6-9.3-21.9-2.3-31.3c-3.7-6.9-6.8-14.1-9-21.8C40.9 414.1 32 404.1 32 392V376c0-12.1 8.9-22.1 20.6-23.8c2.2-7.6 5.3-14.9 9-21.8c-7-9.4-6.3-22.8 2.3-31.3l11.3-11.3c8.6-8.6 21.9-9.3 31.3-2.3c6.8-3.7 14.1-6.8 21.7-9c1.7-11.6 11.7-20.6 23.8-20.6zm8 176a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM448.2 276.6c1.7-11.6 11.7-20.6 23.8-20.6h16c12.1 0 22.1 8.9 23.8 20.6c7.6 2.2 14.9 5.3 21.8 9c9.4-7 22.8-6.3 31.3 2.3l11.3 11.3c8.6 8.6 9.3 21.9 2.2 31.3c3.7 6.8 6.8 14.1 9 21.7c11.6 1.7 20.6 11.7 20.6 23.8v16c0 12.1-8.9 22.1-20.6 23.8c-2.2 7.6-5.3 14.9-9 21.7c7 9.4 6.3 22.8-2.2 31.3l-11.3 11.3c-8.6 8.6-21.9 9.3-31.3 2.2c-6.9 3.7-14.1 6.8-21.8 9C510.1 503.1 500.1 512 488 512H472c-12.1 0-22.1-8.9-23.8-20.6c-7.6-2.2-14.9-5.3-21.7-9c-9.4 7.1-22.8 6.3-31.3-2.2l-11.3-11.3c-8.6-8.6-9.3-21.9-2.2-31.3c-3.7-6.9-6.8-14.1-9-21.8C360.9 414.1 352 404.1 352 392V376c0-12.1 8.9-22.1 20.6-23.8c2.2-7.6 5.3-14.9 9-21.8c-7-9.4-6.3-22.8 2.2-31.3l11.3-11.3c8.6-8.6 21.9-9.3 31.3-2.3c6.8-3.7 14.1-6.8 21.7-9zM528 384a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
            }, Et = {
              prefix: "fas",
              iconName: "w",
              icon: [576, 512, [119], "57", "M20.8 34c16.5-6.2 35 2.2 41.2 18.7l110.2 294L257.3 55c4-13.7 16.5-23 30.7-23s26.7 9.4 30.7 23l85.1 291.7L514 52.8c6.2-16.5 24.6-24.9 41.2-18.7s24.9 24.7 18.7 41.2l-144 384c-4.8 12.9-17.4 21.3-31.2 20.7s-25.7-9.8-29.5-23L288 178.3 206.7 457c-3.9 13.2-15.8 22.5-29.5 23s-26.3-7.8-31.2-20.7L2 75.2C-4.2 58.7 4.2 40.2 20.8 34z"]
            }, er = {
              prefix: "fas",
              iconName: "earth-africa",
              icon: [512, 512, [127757, "globe-africa"], "f57c", "M177.8 63.2l10 17.4c2.8 4.8 4.2 10.3 4.2 15.9v41.4c0 3.9 1.6 7.7 4.3 10.4c6.2 6.2 16.5 5.7 22-1.2l13.6-17c4.7-5.9 12.9-7.7 19.6-4.3l15.2 7.6c3.4 1.7 7.2 2.6 11 2.6c6.5 0 12.8-2.6 17.4-7.2l3.9-3.9c2.9-2.9 7.3-3.6 11-1.8l29.2 14.6c7.8 3.9 12.6 11.8 12.6 20.5c0 10.5-7.1 19.6-17.3 22.2l-35.4 8.8c-7.4 1.8-15.1 1.5-22.4-.9l-32-10.7c-3.3-1.1-6.7-1.7-10.2-1.7c-7 0-13.8 2.3-19.4 6.5L176 212c-10.1 7.6-16 19.4-16 32v28c0 26.5 21.5 48 48 48h32c8.8 0 16 7.2 16 16v48c0 17.7 14.3 32 32 32c10.1 0 19.6-4.7 25.6-12.8l25.6-34.1c8.3-11.1 12.8-24.6 12.8-38.4V318.6c0-3.9 2.6-7.3 6.4-8.2l5.3-1.3c11.9-3 20.3-13.7 20.3-26c0-7.1-2.8-13.9-7.8-18.9l-33.5-33.5c-3.7-3.7-3.7-9.7 0-13.4c5.7-5.7 14.1-7.7 21.8-5.1l14.1 4.7c12.3 4.1 25.7-1.5 31.5-13c3.5-7 11.2-10.8 18.9-9.2l27.4 5.5C432 112.4 351.5 48 256 48c-27.7 0-54 5.4-78.2 15.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
            }, _r = er, Xi = {
              prefix: "fas",
              iconName: "rainbow",
              icon: [640, 512, [127752], "f75b", "M320 96C178.6 96 64 210.6 64 352v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V352C0 175.3 143.3 32 320 32s320 143.3 320 320v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V352C576 210.6 461.4 96 320 96zm0 192c-35.3 0-64 28.7-64 64v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V352c0-70.7 57.3-128 128-128s128 57.3 128 128v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V352c0-35.3-28.7-64-64-64zM160 352v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V352c0-123.7 100.3-224 224-224s224 100.3 224 224v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V352c0-88.4-71.6-160-160-160s-160 71.6-160 160z"]
            }, Mn = {
              prefix: "fas",
              iconName: "circle-notch",
              icon: [512, 512, [], "f1ce", "M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z"]
            }, _n = {
              prefix: "fas",
              iconName: "tablet-screen-button",
              icon: [448, 512, ["tablet-alt"], "f3fa", "M0 64C0 28.7 28.7 0 64 0H384c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM256 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM384 64H64V384H384V64z"]
            }, Ps = _n, qi = {
              prefix: "fas",
              iconName: "paw",
              icon: [512, 512, [], "f1b0", "M226.5 92.9c14.3 42.9-.3 86.2-32.6 96.8s-70.1-15.6-84.4-58.5s.3-86.2 32.6-96.8s70.1 15.6 84.4 58.5zM100.4 198.6c18.9 32.4 14.3 70.1-10.2 84.1s-59.7-.9-78.5-33.3S-2.7 179.3 21.8 165.3s59.7 .9 78.5 33.3zM69.2 401.2C121.6 259.9 214.7 224 256 224s134.4 35.9 186.8 177.2c3.6 9.7 5.2 20.1 5.2 30.5v1.6c0 25.8-20.9 46.7-46.7 46.7c-11.5 0-22.9-1.4-34-4.2l-88-22c-15.3-3.8-31.3-3.8-46.6 0l-88 22c-11.1 2.8-22.5 4.2-34 4.2C84.9 480 64 459.1 64 433.3v-1.6c0-10.4 1.6-20.8 5.2-30.5zM421.8 282.7c-24.5-14-29.1-51.7-10.2-84.1s54-47.3 78.5-33.3s29.1 51.7 10.2 84.1s-54 47.3-78.5 33.3zM310.1 189.7c-32.3-10.6-46.9-53.9-32.6-96.8s52.1-69.1 84.4-58.5s46.9 53.9 32.6 96.8s-52.1 69.1-84.4 58.5z"]
            }, Gs = {
              prefix: "fas",
              iconName: "cloud",
              icon: [640, 512, [9729], "f0c2", "M0 336c0 79.5 64.5 144 144 144H512c70.7 0 128-57.3 128-128c0-61.9-44-113.6-102.4-125.4c4.1-10.7 6.4-22.4 6.4-34.6c0-53-43-96-96-96c-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32C167.6 32 96 103.6 96 192c0 2.7 .1 5.4 .2 8.1C40.2 219.8 0 273.2 0 336z"]
            }, ks = {
              prefix: "fas",
              iconName: "trowel-bricks",
              icon: [512, 512, [], "e58a", "M240.8 4.8C250.3 10.6 256 20.9 256 32v72h89c3.6-13.8 16.1-24 31-24h88c26.5 0 48 21.5 48 48s-21.5 48-48 48H376c-14.9 0-27.4-10.2-31-24H256v72c0 11.1-5.7 21.4-15.2 27.2s-21.2 6.4-31.1 1.4l-192-96C6.8 151.2 0 140.1 0 128s6.8-23.2 17.7-28.6l192-96c9.9-5 21.7-4.4 31.1 1.4zM288 256c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H320c-17.7 0-32-14.3-32-32V256zM32 384h96c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32V416c0-17.7 14.3-32 32-32zm192 0H480c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H224c-17.7 0-32-14.3-32-32V416c0-17.7 14.3-32 32-32z"]
            }, Na = {
              prefix: "fas",
              iconName: "face-flushed",
              icon: [512, 512, [128563, "flushed"], "f579", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM176 384c0 8.8 7.2 16 16 16H320c8.8 0 16-7.2 16-16s-7.2-16-16-16H192c-8.8 0-16 7.2-16 16zm-16-88a72 72 0 1 0 0-144 72 72 0 1 0 0 144zm264-72a72 72 0 1 0 -144 0 72 72 0 1 0 144 0zm-288 0a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm192 0a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
            }, Ao = Na, Ro = {
              prefix: "fas",
              iconName: "hospital-user",
              icon: [576, 512, [], "f80d", "M48 0C21.5 0 0 21.5 0 48V256H144c8.8 0 16 7.2 16 16s-7.2 16-16 16H0v64H144c8.8 0 16 7.2 16 16s-7.2 16-16 16H0v80c0 26.5 21.5 48 48 48H265.9c-6.3-10.2-9.9-22.2-9.9-35.1c0-46.9 25.8-87.8 64-109.2V271.8 48c0-26.5-21.5-48-48-48H48zM152 64h16c8.8 0 16 7.2 16 16v24h24c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H184v24c0 8.8-7.2 16-16 16H152c-8.8 0-16-7.2-16-16V152H112c-8.8 0-16-7.2-16-16V120c0-8.8 7.2-16 16-16h24V80c0-8.8 7.2-16 16-16zM512 272a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM288 477.1c0 19.3 15.6 34.9 34.9 34.9H541.1c19.3 0 34.9-15.6 34.9-34.9c0-51.4-41.7-93.1-93.1-93.1H381.1c-51.4 0-93.1 41.7-93.1 93.1z"]
            }, oA = {
              prefix: "fas",
              iconName: "tent-arrow-left-right",
              icon: [576, 512, [], "e57f", "M488.1 6.2c-9.9-8.9-25-8.1-33.9 1.8s-8.1 25 1.8 33.9L489.5 72 86.5 72l33.5-30.2c9.9-8.9 10.7-24 1.8-33.9S97.8-2.7 87.9 6.2l-80 72C2.9 82.7 0 89.2 0 96s2.9 13.3 7.9 17.8l80 72c9.9 8.9 25 8.1 33.9-1.8s8.1-25-1.8-33.9L86.5 120l402.9 0-33.5 30.2c-9.9 8.9-10.7 24-1.8 33.9s24 10.7 33.9 1.8l80-72c5.1-4.6 7.9-11 7.9-17.8s-2.9-13.3-7.9-17.8l-80-72zM307.4 166.5c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S86.7 512 96 512H288V352l96 160h96c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
            }, W1 = {
              prefix: "fas",
              iconName: "gavel",
              icon: [512, 512, ["legal"], "f0e3", "M318.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-120 120c-12.5 12.5-12.5 32.8 0 45.3l16 16c12.5 12.5 32.8 12.5 45.3 0l4-4L325.4 293.4l-4 4c-12.5 12.5-12.5 32.8 0 45.3l16 16c12.5 12.5 32.8 12.5 45.3 0l120-120c12.5-12.5 12.5-32.8 0-45.3l-16-16c-12.5-12.5-32.8-12.5-45.3 0l-4 4L330.6 74.6l4-4c12.5-12.5 12.5-32.8 0-45.3l-16-16zm-152 288c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l48 48c12.5 12.5 32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-1.4-1.4L272 285.3 226.7 240 168 298.7l-1.4-1.4z"]
            }, je = W1, dt = {
              prefix: "fas",
              iconName: "binoculars",
              icon: [512, 512, [], "f1e5", "M128 32h32c17.7 0 32 14.3 32 32V96H96V64c0-17.7 14.3-32 32-32zm64 96V448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32V388.9c0-34.6 9.4-68.6 27.2-98.3C40.9 267.8 49.7 242.4 53 216L60.5 156c2-16 15.6-28 31.8-28H192zm227.8 0c16.1 0 29.8 12 31.8 28L459 216c3.3 26.4 12.1 51.8 25.8 74.6c17.8 29.7 27.2 63.7 27.2 98.3V448c0 17.7-14.3 32-32 32H352c-17.7 0-32-14.3-32-32V128h99.8zM320 64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32V96H320V64zm-32 64V288H224V128h64z"]
            }, kt = {
              prefix: "fas",
              iconName: "microphone-slash",
              icon: [640, 512, [], "f131", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c15.2-26 23.9-56.3 23.9-88.7V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 21.2-5.1 41.1-14.2 58.7L416 300.8V96c0-53-43-96-96-96s-96 43-96 96v54.3L38.8 5.1zM344 430.4c20.4-2.8 39.7-9.1 57.3-18.2l-43.1-33.9C346.1 382 333.3 384 320 384c-70.7 0-128-57.3-128-128v-8.7L144.7 210c-.5 1.9-.7 3.9-.7 6v40c0 89.1 66.2 162.7 152 174.4V464H248c-13.3 0-24 10.7-24 24s10.7 24 24 24h72 72c13.3 0 24-10.7 24-24s-10.7-24-24-24H344V430.4z"]
            }, _t = {
              prefix: "fas",
              iconName: "box-tissue",
              icon: [512, 512, [], "e05b", "M92.5 0H208c40 0 52 24 64 48s24 48 64 48h85.2C436 96 448 108 448 122.8c0 3.4-.7 6.8-1.9 10L409.6 224 384 288H128l-16-64L64.9 35.4c-.6-2.3-.9-4.6-.9-6.9C64 12.8 76.8 0 92.5 0zM79 224l16 64H80c-8.8 0-16 7.2-16 16s7.2 16 16 16h48H384h48c8.8 0 16-7.2 16-16s-7.2-16-16-16H418.5l25.6-64H464c26.5 0 48 21.5 48 48V384H0V272c0-26.5 21.5-48 48-48H79zM0 416H512v48c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V416z"]
            }, Cr = {
              prefix: "fas",
              iconName: "motorcycle",
              icon: [640, 512, [127949], "f21c", "M280 32c-13.3 0-24 10.7-24 24s10.7 24 24 24h57.7l16.4 30.3L256 192l-45.3-45.3c-12-12-28.3-18.7-45.3-18.7H64c-17.7 0-32 14.3-32 32v32h96c88.4 0 160 71.6 160 160c0 11-1.1 21.7-3.2 32h70.4c-2.1-10.3-3.2-21-3.2-32c0-52.2 25-98.6 63.7-127.8l15.4 28.6C402.4 276.3 384 312 384 352c0 70.7 57.3 128 128 128s128-57.3 128-128s-57.3-128-128-128c-13.5 0-26.5 2.1-38.7 6L418.2 128H480c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32H459.6c-7.5 0-14.7 2.6-20.5 7.4L391.7 78.9l-14-26c-7-12.9-20.5-21-35.2-21H280zM462.7 311.2l28.2 52.2c6.3 11.7 20.9 16 32.5 9.7s16-20.9 9.7-32.5l-28.2-52.2c2.3-.3 4.7-.4 7.1-.4c35.3 0 64 28.7 64 64s-28.7 64-64 64s-64-28.7-64-64c0-15.5 5.5-29.7 14.7-40.8zM187.3 376c-9.5 23.5-32.5 40-59.3 40c-35.3 0-64-28.7-64-64s28.7-64 64-64c26.9 0 49.9 16.5 59.3 40h66.4C242.5 268.8 190.5 224 128 224C57.3 224 0 281.3 0 352s57.3 128 128 128c62.5 0 114.5-44.8 125.8-104H187.3zM128 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, fi = {
              prefix: "fas",
              iconName: "bell-concierge",
              icon: [512, 512, [128718, "concierge-bell"], "f562", "M216 64c-13.3 0-24 10.7-24 24s10.7 24 24 24h16v33.3C119.6 157.2 32 252.4 32 368H480c0-115.6-87.6-210.8-200-222.7V112h16c13.3 0 24-10.7 24-24s-10.7-24-24-24H256 216zM24 400c-13.3 0-24 10.7-24 24s10.7 24 24 24H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H24z"]
            }, on = fi, si = {
              prefix: "fas",
              iconName: "pen-ruler",
              icon: [512, 512, ["pencil-ruler"], "f5ae", "M469.3 19.3l23.4 23.4c25 25 25 65.5 0 90.5l-56.4 56.4L322.3 75.7l56.4-56.4c25-25 65.5-25 90.5 0zM44.9 353.2L299.7 98.3 413.7 212.3 158.8 467.1c-6.7 6.7-15.1 11.6-24.2 14.2l-104 29.7c-8.4 2.4-17.4 .1-23.6-6.1s-8.5-15.2-6.1-23.6l29.7-104c2.6-9.2 7.5-17.5 14.2-24.2zM249.4 103.4L103.4 249.4 16 161.9c-18.7-18.7-18.7-49.1 0-67.9L94.1 16c18.7-18.7 49.1-18.7 67.9 0l19.8 19.8c-.3 .3-.7 .6-1 .9l-64 64c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l64-64c.3-.3 .6-.7 .9-1l45.1 45.1zM408.6 262.6l45.1 45.1c-.3 .3-.7 .6-1 .9l-64 64c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l64-64c.3-.3 .6-.7 .9-1L496 350.1c18.7 18.7 18.7 49.1 0 67.9L417.9 496c-18.7 18.7-49.1 18.7-67.9 0l-87.4-87.4L408.6 262.6z"]
            }, ss = si, hs = {
              prefix: "fas",
              iconName: "people-arrows",
              icon: [640, 512, ["people-arrows-left-right"], "e068", "M64 64a64 64 0 1 1 128 0A64 64 0 1 1 64 64zM25.9 233.4C29.3 191.9 64 160 105.6 160h44.8c27 0 51 13.4 65.5 34.1c-2.7 1.9-5.2 4-7.5 6.3l-64 64c-21.9 21.9-21.9 57.3 0 79.2L192 391.2V464c0 26.5-21.5 48-48 48H112c-26.5 0-48-21.5-48-48V348.3c-26.5-9.5-44.7-35.8-42.2-65.6l4.1-49.3zM448 64a64 64 0 1 1 128 0A64 64 0 1 1 448 64zM431.6 200.4c-2.3-2.3-4.9-4.4-7.5-6.3c14.5-20.7 38.6-34.1 65.5-34.1h44.8c41.6 0 76.3 31.9 79.7 73.4l4.1 49.3c2.5 29.8-15.7 56.1-42.2 65.6V464c0 26.5-21.5 48-48 48H496c-26.5 0-48-21.5-48-48V391.2l47.6-47.6c21.9-21.9 21.9-57.3 0-79.2l-64-64zM272 240v32h96V240c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l64 64c9.4 9.4 9.4 24.6 0 33.9l-64 64c-6.9 6.9-17.2 8.9-26.2 5.2s-14.8-12.5-14.8-22.2V336H272v32c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-64-64c-9.4-9.4-9.4-24.6 0-33.9l64-64c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2z"]
            }, js = hs, ws = {
              prefix: "fas",
              iconName: "mars-and-venus-burst",
              icon: [640, 512, [], "e523", "M504 0c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l39 39-22.2 22.2C475.9 78.4 439.6 64 400 64c-88.4 0-160 71.6-160 160c0 80.2 59.1 146.7 136.1 158.2c0 .6-.1 1.2-.1 1.8v.4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .3 .4 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3H352c-13.3 0-24 10.7-24 24s10.7 24 24 24h24v.2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l24 0H376c0 13.3 10.7 24 24 24s24-10.7 24-24H400l24 0v0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1V486 486v-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1V485 485v-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1V484v-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1V483v-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1V481v-.1-.1-.1-.1-.1-.1-.1-.1V480v-.1-.1-.1-.1-.1-.1-.1V479v-.1-.1-.1-.1-.1-.1-.1V478v-.1-.1-.1-.1-.1-.1V477v-.1-.1-.1-.1-.1-.1V476v-.1-.1-.1-.1-.1-.1V475v-.1-.2-.2-.2-.2-.2V474v-.2-.2-.2-.2-.2V473v-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2V470v-.2-.2-.2-.2-.2V469v-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2V467v-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2V463v-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2V459v-.2-.2-.2-.2-.2-.2-.2-.2V457v-.2-.2-.2-.2V456h24c13.3 0 24-10.7 24-24s-10.7-24-24-24H424v-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3V403v-.3-.3V402v-.3-.3V401v-.3-.3V400v-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.4-.3-.4-.4-.4-.4V393v-.4-.4-.4-.4-.4-.4-.4-.4-.4-.4-.4-.4-.4V388v-.4-.4-.4-.4-.4-.4-.4-.4-.4-.4V384c0-.6 0-1.2-.1-1.8c77-11.6 136.1-78 136.1-158.2c0-31.4-9-60.7-24.7-85.4L560 113.9l39 39c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2V24c0-13.3-10.7-24-24-24H504zM400 128a96 96 0 1 1 0 192 96 96 0 1 1 0-192zM190.9 18.1C188.4 12 182.6 8 176 8s-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6L176 286.1l58.6 53.9c4.1 3.8 9.9 5.1 15.2 3.6C223.6 310.8 208 269.2 208 224c0-60.8 28.3-115 72.4-150.2L220.3 92.1l-29.4-74z"]
            }, Zs = {
              prefix: "fas",
              iconName: "square-caret-right",
              icon: [448, 512, ["caret-square-right"], "f152", "M448 96c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320zM320 256c0 6.7-2.8 13-7.7 17.6l-112 104c-7 6.5-17.2 8.2-25.9 4.4s-14.4-12.5-14.4-22l0-208c0-9.5 5.7-18.2 14.4-22s18.9-2.1 25.9 4.4l112 104c4.9 4.5 7.7 10.9 7.7 17.6z"]
            }, Ia = Zs, cs = {
              prefix: "fas",
              iconName: "scissors",
              icon: [512, 512, [9984, 9986, 9988, "cut"], "f0c4", "M256 192l-39.5-39.5c4.9-12.6 7.5-26.2 7.5-40.5C224 50.1 173.9 0 112 0S0 50.1 0 112s50.1 112 112 112c14.3 0 27.9-2.7 40.5-7.5L192 256l-39.5 39.5c-12.6-4.9-26.2-7.5-40.5-7.5C50.1 288 0 338.1 0 400s50.1 112 112 112s112-50.1 112-112c0-14.3-2.7-27.9-7.5-40.5L499.2 76.8c7.1-7.1 7.1-18.5 0-25.6c-28.3-28.3-74.1-28.3-102.4 0L256 192zm22.6 150.6L396.8 460.8c28.3 28.3 74.1 28.3 102.4 0c7.1-7.1 7.1-18.5 0-25.6L342.6 278.6l-64 64zM64 112a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm48 240a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, ud = cs, Lv = {
              prefix: "fas",
              iconName: "sun-plant-wilt",
              icon: [640, 512, [], "e57a", "M160 0c-6.3 0-12 3.7-14.6 9.5L120.6 64.9 63.9 43.2c-5.9-2.3-12.6-.8-17 3.6s-5.9 11.1-3.6 17l21.7 56.7L9.5 145.4C3.7 148 0 153.7 0 160s3.7 12 9.5 14.6l55.4 24.8L43.2 256.1c-2.3 5.9-.8 12.6 3.6 17s11.1 5.9 17 3.6l56.7-21.7 24.8 55.4c2.6 5.8 8.3 9.5 14.6 9.5s12-3.7 14.6-9.5l24.8-55.4 56.7 21.7c5.9 2.3 12.6 .8 17-3.6s5.9-11.1 3.6-17l-21.7-56.7 55.4-24.8c5.8-2.6 9.5-8.3 9.5-14.6s-3.7-12-9.5-14.6l-55.4-24.8 21.7-56.7c2.3-5.9 .8-12.6-3.6-17s-11.1-5.9-17-3.6L199.4 64.9 174.6 9.5C172 3.7 166.3 0 160 0zm0 96a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm312 16c0-17.7 14.3-32 32-32s32 14.3 32 32v53.4c-14.8 7.7-24 23.1-24 44.6c0 16.8 16 44 37.4 67.2c5.8 6.2 15.5 6.2 21.2 0C624 318 640 290.7 640 274c0-21.5-9.2-37-24-44.6V176c0-44.2-35.8-80-80-80s-80 35.8-80 80v22.7c-9.8-4.3-20.6-6.7-32-6.7c-44.2 0-80 35.8-80 80v21.4c-14.8 7.7-24 23.1-24 44.6c0 16.8 16 44 37.4 67.2c5.8 6.2 15.5 6.2 21.2 0C400 382 416 354.7 416 338c0-21.5-9.2-37-24-44.6V272c0-17.7 14.3-32 32-32s32 14.3 32 32v8V448H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H504V280v-8V176z"]
            }, Kv = {
              prefix: "fas",
              iconName: "toilets-portable",
              icon: [576, 512, [], "e584", "M32 0H224c17.7 0 32 14.3 32 32V64H0V32C0 14.3 14.3 0 32 0zM0 96H24 232h24v24V488c0 13.3-10.7 24-24 24s-24-10.7-24-24v-8H48v8c0 13.3-10.7 24-24 24s-24-10.7-24-24V120 96zM192 224c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16s16-7.2 16-16V240c0-8.8-7.2-16-16-16zM352 0H544c17.7 0 32 14.3 32 32V64H320V32c0-17.7 14.3-32 32-32zM320 96h24H552h24v24V488c0 13.3-10.7 24-24 24s-24-10.7-24-24v-8H368v8c0 13.3-10.7 24-24 24s-24-10.7-24-24V120 96zM512 224c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16s16-7.2 16-16V240c0-8.8-7.2-16-16-16z"]
            }, $l = {
              prefix: "fas",
              iconName: "hockey-puck",
              icon: [512, 512, [], "f453", "M256 256C114.6 256 0 213 0 160s114.6-96 256-96s256 43 256 96s-114.6 96-256 96zm192.3 1.8c24.7-9.3 46.9-21 63.7-35.6V352c0 53-114.6 96-256 96S0 405 0 352V222.3c16.8 14.6 39 26.3 63.7 35.6C114.5 276.9 182.5 288 256 288s141.5-11.1 192.3-30.2z"]
            }, V6 = {
              prefix: "fas",
              iconName: "table",
              icon: [512, 512, [], "f0ce", "M64 256V160H224v96H64zm0 64H224v96H64V320zm224 96V320H448v96H288zM448 256H288V160H448v96zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"]
            }, ld = {
              prefix: "fas",
              iconName: "magnifying-glass-arrow-right",
              icon: [512, 512, [], "e521", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM241 119c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31H120c-13.3 0-24 10.7-24 24s10.7 24 24 24H238.1l-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9l-72-72z"]
            }, Jv = {
              prefix: "fas",
              iconName: "tachograph-digital",
              icon: [640, 512, ["digital-tachograph"], "f566", "M64 64C28.7 64 0 92.7 0 128V384c0 35.3 28.7 64 64 64H576c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H64zm32 64H320c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32zM64 368c0-8.8 7.2-16 16-16H336c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16zm320 0c0-8.8 7.2-16 16-16H560c8.8 0 16 7.2 16 16s-7.2 16-16 16H400c-8.8 0-16-7.2-16-16zM80 288a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm80-16a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm80-16a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
            }, zv = Jv, Wc = {
              prefix: "fas",
              iconName: "users-slash",
              icon: [640, 512, [], "e073", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L440.6 320H618.7c11.8 0 21.3-9.6 21.3-21.3C640 239.8 592.2 192 533.3 192H490.7c-15.9 0-31 3.5-44.6 9.7c1.3 7.2 1.9 14.7 1.9 22.3c0 30.2-10.5 58-28 79.9l-25.2-19.7C408.1 267.7 416 246.8 416 224c0-53-43-96-96-96c-31.1 0-58.7 14.8-76.3 37.7l-40.6-31.8c13-14.2 20.9-33.1 20.9-53.9c0-44.2-35.8-80-80-80C116.3 0 91.9 14.1 77.5 35.5L38.8 5.1zM106.7 192C47.8 192 0 239.8 0 298.7C0 310.4 9.6 320 21.3 320H234.7c.2 0 .4 0 .7 0c-20.6-18.2-35.2-42.8-40.8-70.8L121.8 192H106.7zM261.3 352C187.7 352 128 411.7 128 485.3c0 14.7 11.9 26.7 26.7 26.7H485.3c10.5 0 19.5-6 23.9-14.8L324.9 352H261.3zM512 160A80 80 0 1 0 512 0a80 80 0 1 0 0 160z"]
            }, Sc = {
              prefix: "fas",
              iconName: "clover",
              icon: [448, 512, [], "e139", "M173.3 32C139.4 32 112 59.4 112 93.3v4.9c0 12 3.3 23.7 9.4 34l18.8 31.3c1.1 1.8 1.2 3.1 1 4.2c-.2 1.2-.8 2.5-2 3.6s-2.4 1.8-3.6 2c-1 .2-2.4 .1-4.2-1l-31.3-18.8c-10.3-6.2-22-9.4-34-9.4H61.3C27.4 144 0 171.4 0 205.3c0 16.2 6.5 31.8 17.9 43.3l1.2 1.2c3.4 3.4 3.4 9 0 12.4l-1.2 1.2C6.5 274.9 0 290.5 0 306.7C0 340.6 27.4 368 61.3 368h4.9c12 0 23.7-3.3 34-9.4l31.3-18.8c1.8-1.1 3.1-1.2 4.2-1c1.2 .2 2.5 .8 3.6 2s1.8 2.4 2 3.6c.2 1 .1 2.4-1 4.2l-18.8 31.3c-6.2 10.3-9.4 22-9.4 34v4.9c0 33.8 27.4 61.3 61.3 61.3c16.2 0 31.8-6.5 43.3-17.9l1.2-1.2c3.4-3.4 9-3.4 12.4 0l1.2 1.2c11.5 11.5 27.1 17.9 43.3 17.9c33.8 0 61.3-27.4 61.3-61.3v-4.9c0-12-3.3-23.7-9.4-34l-18.8-31.3c-1.1-1.8-1.2-3.1-1-4.2c.2-1.2 .8-2.5 2-3.6s2.4-1.8 3.6-2c1-.2 2.4-.1 4.2 1l31.3 18.8c10.3 6.2 22 9.4 34 9.4h4.9c33.8 0 61.3-27.4 61.3-61.3c0-16.2-6.5-31.8-17.9-43.3l-1.2-1.2c-3.4-3.4-3.4-9 0-12.4l1.2-1.2c11.5-11.5 17.9-27.1 17.9-43.3c0-33.8-27.4-61.3-61.3-61.3h-4.9c-12 0-23.7 3.3-34 9.4l-31.3 18.8c-1.8 1.1-3.1 1.2-4.2 1c-1.2-.2-2.5-.8-3.6-2s-1.8-2.4-2-3.6c-.2-1-.1-2.4 1-4.2l18.8-31.3c6.2-10.3 9.4-22 9.4-34V93.3C336 59.4 308.6 32 274.7 32c-16.2 0-31.8 6.5-43.3 17.9l-1.2 1.2c-3.4 3.4-9 3.4-12.4 0l-1.2-1.2C205.1 38.5 189.5 32 173.3 32z"]
            }, Gv = {
              prefix: "fas",
              iconName: "reply",
              icon: [512, 512, [61714, "mail-reply"], "f3e5", "M205 34.8c11.5 5.1 19 16.6 19 29.2v64H336c97.2 0 176 78.8 176 176c0 113.3-81.5 163.9-100.2 174.1c-2.5 1.4-5.3 1.9-8.1 1.9c-10.9 0-19.7-8.9-19.7-19.7c0-7.5 4.3-14.4 9.8-19.5c9.4-8.8 22.2-26.4 22.2-56.7c0-53-43-96-96-96H224v64c0 12.6-7.4 24.1-19 29.2s-25 3-34.4-5.4l-160-144C3.9 225.7 0 217.1 0 208s3.9-17.7 10.6-23.8l160-144c9.4-8.5 22.9-10.6 34.4-5.4z"]
            }, _d = Gv, eP = {
              prefix: "fas",
              iconName: "star-and-crescent",
              icon: [512, 512, [9770], "f699", "M0 256C0 114.6 114.6 0 256 0c33 0 64.6 6.3 93.6 17.7c7.4 2.9 11.5 10.7 9.8 18.4s-8.8 13-16.7 12.4c-4.8-.3-9.7-.5-14.6-.5c-114.9 0-208 93.1-208 208s93.1 208 208 208c4.9 0 9.8-.2 14.6-.5c7.9-.5 15 4.7 16.7 12.4s-2.4 15.5-9.8 18.4C320.6 505.7 289 512 256 512C114.6 512 0 397.4 0 256zM375.4 137.4c3.5-7.1 13.7-7.1 17.2 0l31.5 63.8c1.4 2.8 4.1 4.8 7.2 5.3l70.4 10.2c7.9 1.1 11 10.8 5.3 16.4l-50.9 49.6c-2.3 2.2-3.3 5.4-2.8 8.5l12 70.1c1.3 7.8-6.9 13.8-13.9 10.1l-63-33.1c-2.8-1.5-6.1-1.5-8.9 0l-63 33.1c-7 3.7-15.3-2.3-13.9-10.1l12-70.1c.5-3.1-.5-6.3-2.8-8.5L261 233.1c-5.7-5.6-2.6-15.2 5.3-16.4l70.4-10.2c3.1-.5 5.8-2.4 7.2-5.3l31.5-63.8z"]
            }, J0 = {
              prefix: "fas",
              iconName: "house-fire",
              icon: [640, 512, [], "e50c", "M288 350.1l0 1.9H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L447.3 128.1c-12.3-1-25 3-34.8 11.7c-35.4 31.6-65.6 67.7-87.3 102.8C304.3 276.5 288 314.9 288 350.1zM453.5 163.8c19.7 17.8 38.2 37 55.5 57.7c7.9-9.9 16.8-20.7 26.5-29.5c5.6-5.1 14.4-5.1 20 0c24.7 22.7 45.6 52.7 60.4 81.1c14.5 28 24.2 58.8 24.2 79C640 440 568.7 512 480 512c-89.7 0-160-72.1-160-159.8c0-26.4 12.7-60.7 32.4-92.6c20-32.4 48.1-66.1 81.4-95.8c2.8-2.5 6.4-3.8 10-3.7c3.5 0 7 1.3 9.8 3.8zM530 433c30-21 38-63 20-96c-2-4-4-8-7-12l-36 42s-58-74-62-79c-30 37-45 58-45 82c0 49 36 78 81 78c18 0 34-5 49-15z"]
            }, Nu = {
              prefix: "fas",
              iconName: "square-minus",
              icon: [448, 512, [61767, "minus-square"], "f146", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm88 200H296c13.3 0 24 10.7 24 24s-10.7 24-24 24H152c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
            }, Uc = Nu, t1 = {
              prefix: "fas",
              iconName: "helicopter",
              icon: [640, 512, [128641], "f533", "M128 32c0-17.7 14.3-32 32-32H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H384v64h32c88.4 0 160 71.6 160 160v64c0 17.7-14.3 32-32 32H384 320c-20.1 0-39.1-9.5-51.2-25.6l-71.4-95.2c-3.5-4.7-8.3-8.3-13.7-10.5L47.2 198.1c-9.5-3.8-16.7-12-19.2-22L5 83.9C2.4 73.8 10.1 64 20.5 64H48c10.1 0 19.6 4.7 25.6 12.8L112 128H320V64H160c-17.7 0-32-14.3-32-32zM384 320H512V288c0-53-43-96-96-96H384V320zM630.6 425.4c12.5 12.5 12.5 32.8 0 45.3l-3.9 3.9c-24 24-56.6 37.5-90.5 37.5H256c-17.7 0-32-14.3-32-32s14.3-32 32-32H536.2c17 0 33.3-6.7 45.3-18.7l3.9-3.9c12.5-12.5 32.8-12.5 45.3 0z"]
            }, Pd = {
              prefix: "fas",
              iconName: "compass",
              icon: [512, 512, [129517], "f14e", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm50.7-186.9L162.4 380.6c-19.4 7.5-38.5-11.6-31-31l55.5-144.3c3.3-8.5 9.9-15.1 18.4-18.4l144.3-55.5c19.4-7.5 38.5 11.6 31 31L325.1 306.7c-3.2 8.5-9.9 15.1-18.4 18.4zM288 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
            }, Z1 = {
              prefix: "fas",
              iconName: "square-caret-down",
              icon: [448, 512, ["caret-square-down"], "f150", "M384 480c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0zM224 352c-6.7 0-13-2.8-17.6-7.7l-104-112c-6.5-7-8.2-17.2-4.4-25.9s12.5-14.4 22-14.4l208 0c9.5 0 18.2 5.7 22 14.4s2.1 18.9-4.4 25.9l-104 112c-4.5 4.9-10.9 7.7-17.6 7.7z"]
            }, fA = Z1, tP = {
              prefix: "fas",
              iconName: "file-circle-question",
              icon: [576, 512, [], "e4ef", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384v38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM368 321.6V328c0 8.8 7.2 16 16 16s16-7.2 16-16v-6.4c0-5.3 4.3-9.6 9.6-9.6h40.5c7.7 0 13.9 6.2 13.9 13.9c0 5.2-2.9 9.9-7.4 12.3l-32 16.8c-5.3 2.8-8.6 8.2-8.6 14.2V384c0 8.8 7.2 16 16 16s16-7.2 16-16v-5.1l23.5-12.3c15.1-7.9 24.5-23.6 24.5-40.6c0-25.4-20.6-45.9-45.9-45.9H409.6c-23 0-41.6 18.6-41.6 41.6z"]
            }, AA = {
              prefix: "fas",
              iconName: "laptop-code",
              icon: [640, 512, [], "f5fc", "M64 96c0-35.3 28.7-64 64-64H512c35.3 0 64 28.7 64 64V352H512V96H128V352H64V96zM0 403.2C0 392.6 8.6 384 19.2 384H620.8c10.6 0 19.2 8.6 19.2 19.2c0 42.4-34.4 76.8-76.8 76.8H76.8C34.4 480 0 445.6 0 403.2zM281 209l-31 31 31 31c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-48-48c-9.4-9.4-9.4-24.6 0-33.9l48-48c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM393 175l48 48c9.4 9.4 9.4 24.6 0 33.9l-48 48c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"]
            }, rP = {
              prefix: "fas",
              iconName: "swatchbook",
              icon: [512, 512, [], "f5c3", "M0 32C0 14.3 14.3 0 32 0H160c17.7 0 32 14.3 32 32V416c0 53-43 96-96 96s-96-43-96-96V32zM223.6 425.9c.3-3.3 .4-6.6 .4-9.9V154l75.4-75.4c12.5-12.5 32.8-12.5 45.3 0l90.5 90.5c12.5 12.5 12.5 32.8 0 45.3L223.6 425.9zM182.8 512l192-192H480c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32H182.8zM128 64H64v64h64V64zM64 192v64h64V192H64zM96 440a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
            }, Qu = {
              prefix: "fas",
              iconName: "prescription-bottle",
              icon: [384, 512, [], "f485", "M0 32C0 14.3 14.3 0 32 0H352c17.7 0 32 14.3 32 32V64c0 17.7-14.3 32-32 32H32C14.3 96 0 81.7 0 64V32zm32 96H352V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V416H144c8.8 0 16-7.2 16-16s-7.2-16-16-16H32V320H144c8.8 0 16-7.2 16-16s-7.2-16-16-16H32V224H144c8.8 0 16-7.2 16-16s-7.2-16-16-16H32V128z"]
            }, Kf = {
              prefix: "fas",
              iconName: "bars",
              icon: [448, 512, ["navicon"], "f0c9", "M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]
            }, cd = Kf, Xo = {
              prefix: "fas",
              iconName: "people-group",
              icon: [640, 512, [], "e533", "M72 88a56 56 0 1 1 112 0A56 56 0 1 1 72 88zM64 245.7C54 256.9 48 271.8 48 288s6 31.1 16 42.3V245.7zm144.4-49.3C178.7 222.7 160 261.2 160 304c0 34.3 12 65.8 32 90.5V416c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V389.2C26.2 371.2 0 332.7 0 288c0-61.9 50.1-112 112-112h32c24 0 46.2 7.5 64.4 20.3zM448 416V394.5c20-24.7 32-56.2 32-90.5c0-42.8-18.7-81.3-48.4-107.7C449.8 183.5 472 176 496 176h32c61.9 0 112 50.1 112 112c0 44.7-26.2 83.2-64 101.2V416c0 17.7-14.3 32-32 32H480c-17.7 0-32-14.3-32-32zm8-328a56 56 0 1 1 112 0A56 56 0 1 1 456 88zM576 245.7v84.7c10-11.3 16-26.1 16-42.3s-6-31.1-16-42.3zM320 32a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM240 304c0 16.2 6 31 16 42.3V261.7c-10 11.3-16 26.1-16 42.3zm144-42.3v84.7c10-11.3 16-26.1 16-42.3s-6-31.1-16-42.3zM448 304c0 44.7-26.2 83.2-64 101.2V448c0 17.7-14.3 32-32 32H288c-17.7 0-32-14.3-32-32V405.2c-37.8-18-64-56.5-64-101.2c0-61.9 50.1-112 112-112h32c61.9 0 112 50.1 112 112z"]
            }, C6 = {
              prefix: "fas",
              iconName: "hourglass-end",
              icon: [384, 512, [8987, "hourglass-3"], "f253", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64V75c0 42.4 16.9 83.1 46.9 113.1L146.7 256 78.9 323.9C48.9 353.9 32 394.6 32 437v11c-17.7 0-32 14.3-32 32s14.3 32 32 32H64 320h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V437c0-42.4-16.9-83.1-46.9-113.1L237.3 256l67.9-67.9c30-30 46.9-70.7 46.9-113.1V64c17.7 0 32-14.3 32-32s-14.3-32-32-32H320 64 32zM96 75V64H288V75c0 25.5-10.1 49.9-28.1 67.9L192 210.7l-67.9-67.9C106.1 124.9 96 100.4 96 75z"]
            }, Zv = C6, nP = {
              prefix: "fas",
              iconName: "heart-crack",
              icon: [512, 512, [128148, "heart-broken"], "f7a9", "M119.4 44.1c23.3-3.9 46.8-1.9 68.6 5.3l49.8 77.5-75.4 75.4c-1.5 1.5-2.4 3.6-2.3 5.8s1 4.2 2.6 5.7l112 104c2.9 2.7 7.4 2.9 10.5 .3s3.8-7 1.7-10.4l-60.4-98.1 90.7-75.6c2.6-2.1 3.5-5.7 2.4-8.8L296.8 61.8c28.5-16.7 62.4-23.2 95.7-17.6C461.5 55.6 512 115.2 512 185.1v5.8c0 41.5-17.2 81.2-47.6 109.5L283.7 469.1c-7.5 7-17.4 10.9-27.7 10.9s-20.2-3.9-27.7-10.9L47.6 300.4C17.2 272.1 0 232.4 0 190.9v-5.8c0-69.9 50.5-129.5 119.4-141z"]
            }, mp = nP, $d = {
              prefix: "fas",
              iconName: "square-up-right",
              icon: [448, 512, [8599, "external-link-square-alt"], "f360", "M384 32c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96C0 60.7 28.7 32 64 32H384zM320 313.4V176c0-8.8-7.2-16-16-16H166.6c-12.5 0-22.6 10.1-22.6 22.6c0 6 2.4 11.8 6.6 16L184 232l-66.3 66.3C114 302 112 306.9 112 312s2 10 5.7 13.7l36.7 36.7c3.6 3.6 8.5 5.7 13.7 5.7s10-2 13.7-5.7L248 296l33.4 33.4c4.2 4.2 10 6.6 16 6.6c12.5 0 22.6-10.1 22.6-22.6z"]
            }, z0 = $d, Ic = {
              prefix: "fas",
              iconName: "face-kiss-beam",
              icon: [512, 512, [128537, "kiss-beam"], "f597", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm48.7-198.3c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C274.7 443.1 257.4 448 240 448c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9l0 0 0 0 0 0 0 0 .2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1 0 0 0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7l0 0 0 0 0 0 0 0 0 0 .2-.1 .3-.2 .6-.4c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1l-.4-.3-.5-.3-.2-.1 0 0 0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4zm-87.1-84.9l0 0 0 0-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2 0 0 0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8l0 0 0 0zm160 0l0 0-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2 0 0 0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8l0 0 0 0 0 0z"]
            }, iP = Ic, dA = {
              prefix: "fas",
              iconName: "film",
              icon: [512, 512, [127902], "f008", "M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM48 368v32c0 8.8 7.2 16 16 16H96c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H64c-8.8 0-16 7.2-16 16zm368-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H416zM48 240v32c0 8.8 7.2 16 16 16H96c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H64c-8.8 0-16 7.2-16 16zm368-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H416zM48 112v32c0 8.8 7.2 16 16 16H96c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H64c-8.8 0-16 7.2-16 16zM416 96c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H416zM160 128v64c0 17.7 14.3 32 32 32H320c17.7 0 32-14.3 32-32V128c0-17.7-14.3-32-32-32H192c-17.7 0-32 14.3-32 32zm32 160c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32H320c17.7 0 32-14.3 32-32V320c0-17.7-14.3-32-32-32H192z"]
            }, Rc = {
              prefix: "fas",
              iconName: "ruler-horizontal",
              icon: [640, 512, [], "f547", "M0 336c0 26.5 21.5 48 48 48l544 0c26.5 0 48-21.5 48-48l0-160c0-26.5-21.5-48-48-48l-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0c-26.5 0-48 21.5-48 48L0 336z"]
            }, G0 = {
              prefix: "fas",
              iconName: "people-robbery",
              icon: [576, 512, [], "e536", "M488.2 59.1C478.1 99.6 441.7 128 400 128s-78.1-28.4-88.2-68.9L303 24.2C298.8 7.1 281.4-3.3 264.2 1S236.7 22.6 241 39.8l8.7 34.9c11 44 40.2 79.6 78.3 99.6V480c0 17.7 14.3 32 32 32s32-14.3 32-32V352h16V480c0 17.7 14.3 32 32 32s32-14.3 32-32V174.3c38.1-20 67.3-55.6 78.3-99.6L559 39.8c4.3-17.1-6.1-34.5-23.3-38.8S501.2 7.1 497 24.2l-8.7 34.9zM400 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM80 96A48 48 0 1 0 80 0a48 48 0 1 0 0 96zm-8 32c-35.3 0-64 28.7-64 64v96l0 .6V480c0 17.7 14.3 32 32 32s32-14.3 32-32V352H88V480c0 17.7 14.3 32 32 32s32-14.3 32-32V252.7l13 20.5c5.9 9.2 16.1 14.9 27 14.9h48c17.7 0 32-14.3 32-32s-14.3-32-32-32H209.6l-37.4-58.9C157.6 142 132.1 128 104.7 128H72z"]
            }, Vc = {
              prefix: "fas",
              iconName: "lightbulb",
              icon: [384, 512, [128161], "f0eb", "M272 384c9.6-31.9 29.5-59.1 49.2-86.2l0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C368 78.8 289.2 0 192 0S16 78.8 16 176c0 37.3 11.6 71.9 31.4 100.3c5 7.2 10.2 14.3 15.4 21.4l0 0c19.8 27.1 39.7 54.4 49.2 86.2H272zM192 512c44.2 0 80-35.8 80-80V416H112v16c0 44.2 35.8 80 80 80zM112 176c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-61.9 50.1-112 112-112c8.8 0 16 7.2 16 16s-7.2 16-16 16c-44.2 0-80 35.8-80 80z"]
            }, Z0 = {
              prefix: "fas",
              iconName: "caret-left",
              icon: [256, 512, [], "f0d9", "M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"]
            }, Cc = {
              prefix: "fas",
              iconName: "circle-exclamation",
              icon: [512, 512, ["exclamation-circle"], "f06a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, sP = Cc, ev = {
              prefix: "fas",
              iconName: "school-circle-xmark",
              icon: [640, 512, [], "e56d", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96H48C21.5 96 0 117.5 0 144V464c0 26.5 21.5 48 48 48H320v0H256V416c0-35.3 28.7-64 64-64l.3 0h.5c3.4-37.7 18.7-72.1 42.2-99.1C350.2 260 335.6 264 320 264c-48.6 0-88-39.4-88-88s39.4-88 88-88s88 39.4 88 88c0 18.3-5.6 35.3-15.1 49.4c29-21 64.6-33.4 103.1-33.4c59.5 0 112.1 29.6 144 74.8V144c0-26.5-21.5-48-48-48H473.7L337.8 5.4zM96 192h32c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16V208c0-8.8 7.2-16 16-16zm0 128h32c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16V336c0-8.8 7.2-16 16-16zM320 128c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H336V144c0-8.8-7.2-16-16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm22.6-144l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L518.6 368z"]
            }, tv = {
              prefix: "fas",
              iconName: "arrow-right-from-bracket",
              icon: [512, 512, ["sign-out"], "f08b", "M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 192 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128zM160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 32C43 32 0 75 0 128L0 384c0 53 43 96 96 96l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l64 0z"]
            }, Yu = tv, Bp = {
              prefix: "fas",
              iconName: "circle-chevron-down",
              icon: [512, 512, ["chevron-circle-down"], "f13a", "M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM135 241c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l87 87 87-87c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 345c-9.4 9.4-24.6 9.4-33.9 0L135 241z"]
            }, Wp = Bp, aP = {
              prefix: "fas",
              iconName: "unlock-keyhole",
              icon: [448, 512, ["unlock-alt"], "f13e", "M224 64c-44.2 0-80 35.8-80 80v48H384c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V256c0-35.3 28.7-64 64-64H80V144C80 64.5 144.5 0 224 0c57.5 0 107 33.7 130.1 82.3c7.6 16 .8 35.1-15.2 42.6s-35.1 .8-42.6-15.2C283.4 82.6 255.9 64 224 64zm32 320c17.7 0 32-14.3 32-32s-14.3-32-32-32H192c-17.7 0-32 14.3-32 32s14.3 32 32 32h64z"]
            }, Sp = aP, Up = {
              prefix: "fas",
              iconName: "cloud-showers-heavy",
              icon: [512, 512, [], "f740", "M96 320c-53 0-96-43-96-96c0-42.5 27.6-78.6 65.9-91.2C64.7 126.1 64 119.1 64 112C64 50.1 114.1 0 176 0c43.1 0 80.5 24.3 99.2 60c14.7-17.1 36.5-28 60.8-28c44.2 0 80 35.8 80 80c0 5.5-.6 10.8-1.6 16c.5 0 1.1 0 1.6 0c53 0 96 43 96 96s-43 96-96 96H96zM81.5 353.9c12.2 5.2 17.8 19.3 12.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6S-3.3 490.7 1.9 478.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6zm120 0c12.2 5.2 17.8 19.3 12.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6s-17.8-19.3-12.6-31.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6zm244.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6s-17.8-19.3-12.6-31.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6s17.8 19.3 12.6 31.5zM313.5 353.9c12.2 5.2 17.8 19.3 12.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6s-17.8-19.3-12.6-31.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6z"]
            }, Ip = {
              prefix: "fas",
              iconName: "headphones-simple",
              icon: [512, 512, ["headphones-alt"], "f58f", "M256 80C141.1 80 48 173.1 48 288V392c0 13.3-10.7 24-24 24s-24-10.7-24-24V288C0 146.6 114.6 32 256 32s256 114.6 256 256V392c0 13.3-10.7 24-24 24s-24-10.7-24-24V288c0-114.9-93.1-208-208-208zM80 352c0-35.3 28.7-64 64-64h16c17.7 0 32 14.3 32 32V448c0 17.7-14.3 32-32 32H144c-35.3 0-64-28.7-64-64V352zm288-64c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64H352c-17.7 0-32-14.3-32-32V320c0-17.7 14.3-32 32-32h16z"]
            }, _0 = Ip, gg = {
              prefix: "fas",
              iconName: "sitemap",
              icon: [576, 512, [], "f0e8", "M208 80c0-26.5 21.5-48 48-48h64c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48h-8v40H464c30.9 0 56 25.1 56 56v32h8c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48H464c-26.5 0-48-21.5-48-48V368c0-26.5 21.5-48 48-48h8V288c0-4.4-3.6-8-8-8H312v40h8c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48H256c-26.5 0-48-21.5-48-48V368c0-26.5 21.5-48 48-48h8V280H112c-4.4 0-8 3.6-8 8v32h8c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V368c0-26.5 21.5-48 48-48h8V288c0-30.9 25.1-56 56-56H264V192h-8c-26.5 0-48-21.5-48-48V80z"]
            }, $0 = {
              prefix: "fas",
              iconName: "circle-dollar-to-slot",
              icon: [512, 512, ["donate"], "f4b9", "M326.7 403.7c-22.1 8-45.9 12.3-70.7 12.3s-48.7-4.4-70.7-12.3c-.3-.1-.5-.2-.8-.3c-30-11-56.8-28.7-78.6-51.4C70 314.6 48 263.9 48 208C48 93.1 141.1 0 256 0S464 93.1 464 208c0 55.9-22 106.6-57.9 144c-1 1-2 2.1-3 3.1c-21.4 21.4-47.4 38.1-76.3 48.6zM256 91.9c-11.1 0-20.1 9-20.1 20.1v6c-5.6 1.2-10.9 2.9-15.9 5.1c-15 6.8-27.9 19.4-31.1 37.7c-1.8 10.2-.8 20 3.4 29c4.2 8.8 10.7 15 17.3 19.5c11.6 7.9 26.9 12.5 38.6 16l2.2 .7c13.9 4.2 23.4 7.4 29.3 11.7c2.5 1.8 3.4 3.2 3.7 4c.3 .8 .9 2.6 .2 6.7c-.6 3.5-2.5 6.4-8 8.8c-6.1 2.6-16 3.9-28.8 1.9c-6-1-16.7-4.6-26.2-7.9l0 0 0 0 0 0c-2.2-.7-4.3-1.5-6.4-2.1c-10.5-3.5-21.8 2.2-25.3 12.7s2.2 21.8 12.7 25.3c1.2 .4 2.7 .9 4.4 1.5c7.9 2.7 20.3 6.9 29.8 9.1V304c0 11.1 9 20.1 20.1 20.1s20.1-9 20.1-20.1v-5.5c5.3-1 10.5-2.5 15.4-4.6c15.7-6.7 28.4-19.7 31.6-38.7c1.8-10.4 1-20.3-3-29.4c-3.9-9-10.2-15.6-16.9-20.5c-12.2-8.8-28.3-13.7-40.4-17.4l-.8-.2c-14.2-4.3-23.8-7.3-29.9-11.4c-2.6-1.8-3.4-3-3.6-3.5c-.2-.3-.7-1.6-.1-5c.3-1.9 1.9-5.2 8.2-8.1c6.4-2.9 16.4-4.5 28.6-2.6c4.3 .7 17.9 3.3 21.7 4.3c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-4.4-1.2-14.4-3.2-21-4.4V112c0-11.1-9-20.1-20.1-20.1zM48 352H64c19.5 25.9 44 47.7 72.2 64H64v32H256 448V416H375.8c28.2-16.3 52.8-38.1 72.2-64h16c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V400c0-26.5 21.5-48 48-48z"]
            }, Rp = $0, rv = {
              prefix: "fas",
              iconName: "memory",
              icon: [576, 512, [], "f538", "M64 64C28.7 64 0 92.7 0 128v7.4c0 6.8 4.4 12.6 10.1 16.3C23.3 160.3 32 175.1 32 192s-8.7 31.7-21.9 40.3C4.4 236 0 241.8 0 248.6V320H576V248.6c0-6.8-4.4-12.6-10.1-16.3C552.7 223.7 544 208.9 544 192s8.7-31.7 21.9-40.3c5.7-3.7 10.1-9.5 10.1-16.3V128c0-35.3-28.7-64-64-64H64zM576 352H0v64c0 17.7 14.3 32 32 32H80V416c0-8.8 7.2-16 16-16s16 7.2 16 16v32h96V416c0-8.8 7.2-16 16-16s16 7.2 16 16v32h96V416c0-8.8 7.2-16 16-16s16 7.2 16 16v32h96V416c0-8.8 7.2-16 16-16s16 7.2 16 16v32h48c17.7 0 32-14.3 32-32V352zM192 160v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V160c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V160c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V160c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
            }, Oc = {
              prefix: "fas",
              iconName: "road-spikes",
              icon: [640, 512, [], "e568", "M64 116.8c0-15.8 20.5-22 29.3-8.9L192 256V116.8c0-15.8 20.5-22 29.3-8.9L320 256V116.8c0-15.8 20.5-22 29.3-8.9L448 256V116.8c0-15.8 20.5-22 29.3-8.9L606.8 302.2c14.2 21.3-1.1 49.7-26.6 49.7H512 448 384 320 256 192 64V116.8zM32 384H608c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, G9 = {
              prefix: "fas",
              iconName: "fire-burner",
              icon: [640, 512, [], "e4f1", "M293.5 3.8c19.7 17.8 38.2 37 55.5 57.7c7.9-9.9 16.8-20.7 26.5-29.5c5.6-5.1 14.4-5.1 20 0c24.7 22.7 45.6 52.7 60.4 81.1c14.5 28 24.2 58.8 24.2 79C480 280 408.7 352 320 352c-89.7 0-160-72.1-160-159.8c0-26.4 12.7-60.7 32.4-92.6c20-32.4 48.1-66.1 81.4-95.8c2.8-2.5 6.4-3.8 10-3.7c3.5 0 7 1.3 9.8 3.8zM370 273c30-21 38-63 20-96c-2-4-4-8-7-12l-36 42s-58-74-62-79c-30 37-45 58-45 82c0 49 36 78 81 78c18 0 34-5 49-15zM32 288c0-17.7 14.3-32 32-32H96c17.7 0 32 14.3 32 32s-14.3 32-32 32v64H544V320c-17.7 0-32-14.3-32-32s14.3-32 32-32h32c17.7 0 32 14.3 32 32v96c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32V416c0-17.7 14.3-32 32-32V288zM320 480a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm160-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM192 480a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, yA = {
              prefix: "fas",
              iconName: "flag",
              icon: [448, 512, [127988, 61725], "f024", "M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32V64 368 480c0 17.7 14.3 32 32 32s32-14.3 32-32V352l64.3-16.1c41.1-10.3 84.6-5.5 122.5 13.4c44.2 22.1 95.5 24.8 141.7 7.4l34.7-13c12.5-4.7 20.8-16.6 20.8-30V66.1c0-23-24.2-38-44.8-27.7l-9.6 4.8c-46.3 23.2-100.8 23.2-147.1 0c-35.1-17.6-75.4-22-113.5-12.5L64 48V32z"]
            }, e7 = {
              prefix: "fas",
              iconName: "hanukiah",
              icon: [640, 512, [128334], "f6e6", "M314.2 3.3C309.1 12.1 296 36.6 296 56c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7C324.6 1.2 322.4 0 320 0s-4.6 1.2-5.8 3.3zm-288 48C21.1 60.1 8 84.6 8 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7C36.6 49.2 34.4 48 32 48s-4.6 1.2-5.8 3.3zM88 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C101.1 60.1 88 84.6 88 104zm82.2-52.7C165.1 60.1 152 84.6 152 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM216 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C229.1 60.1 216 84.6 216 104zM394.2 51.3C389.1 60.1 376 84.6 376 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM440 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C453.1 60.1 440 84.6 440 104zm82.2-52.7C517.1 60.1 504 84.6 504 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM584 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C597.1 60.1 584 84.6 584 104zM112 160c-8.8 0-16 7.2-16 16v96 16h32V272 176c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16v96 16h32V272 176c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16v96 16h32V272 176c0-8.8-7.2-16-16-16zm160 0c-8.8 0-16 7.2-16 16v96 16h32V272 176c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16v96 16h32V272 176c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16v96 16h32V272 176c0-8.8-7.2-16-16-16zM352 144c0-17.7-14.3-32-32-32s-32 14.3-32 32V320H96c-17.7 0-32-14.3-32-32V192c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 53 43 96 96 96H288v64H160c-17.7 0-32 14.3-32 32s14.3 32 32 32H320 480c17.7 0 32-14.3 32-32s-14.3-32-32-32H352V384H544c53 0 96-43 96-96V192c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7-14.3 32-32 32H352V144z"]
            }, Be = {
              prefix: "fas",
              iconName: "feather",
              icon: [512, 512, [129718], "f52d", "M278.5 215.6L23 471c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l57-57h68c49.7 0 97.9-14.4 139-41c11.1-7.2 5.5-23-7.8-23c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l81-24.3c2.5-.8 4.8-2.1 6.7-4l22.4-22.4c10.1-10.1 2.9-27.3-11.3-27.3l-32.2 0c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l112-33.6c4-1.2 7.4-3.9 9.3-7.7C506.4 207.6 512 184.1 512 160c0-41-16.3-80.3-45.3-109.3l-5.5-5.5C432.3 16.3 393 0 352 0s-80.3 16.3-109.3 45.3L139 149C91 197 64 262.1 64 330v55.3L253.6 195.8c6.2-6.2 16.4-6.2 22.6 0c5.4 5.4 6.1 13.6 2.2 19.8z"]
            }, Qe = {
              prefix: "fas",
              iconName: "volume-low",
              icon: [448, 512, [128264, "volume-down"], "f027", "M301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM412.6 181.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5z"]
            }, ze = Qe, rt = {
              prefix: "fas",
              iconName: "comment-slash",
              icon: [640, 512, [], "f4b3", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L512.9 376.7C552.2 340.2 576 292.3 576 240C576 125.1 461.4 32 320 32c-67.7 0-129.3 21.4-175.1 56.3L38.8 5.1zM64 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3 0 0 0 0 0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9c37 0 72.3-6.4 104-17.9L82.9 161.3C70.7 185.6 64 212.2 64 240z"]
            }, vt = {
              prefix: "fas",
              iconName: "cloud-sun-rain",
              icon: [640, 512, [127782], "f743", "M294.2 1.2c5.1 2.1 8.7 6.7 9.6 12.1l10.4 62.4c-23.3 10.8-42.9 28.4-56 50.3c-14.6-9-31.8-14.1-50.2-14.1c-53 0-96 43-96 96c0 35.5 19.3 66.6 48 83.2c.8 31.8 13.2 60.7 33.1 82.7l-56 39.2c-4.5 3.1-10.3 3.8-15.4 1.6s-8.7-6.7-9.6-12.1L98.1 317.9 13.4 303.8c-5.4-.9-10-4.5-12.1-9.6s-1.5-10.9 1.6-15.4L52.5 208 2.9 137.2c-3.2-4.5-3.8-10.3-1.6-15.4s6.7-8.7 12.1-9.6L98.1 98.1l14.1-84.7c.9-5.4 4.5-10 9.6-12.1s10.9-1.5 15.4 1.6L208 52.5 278.8 2.9c4.5-3.2 10.3-3.8 15.4-1.6zM208 144c13.8 0 26.7 4.4 37.1 11.9c-1.2 4.1-2.2 8.3-3 12.6c-37.9 14.6-67.2 46.6-77.8 86.4C151.8 243.1 144 226.5 144 208c0-35.3 28.7-64 64-64zm69.4 276c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm96 0c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm96 0c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm96 0c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm74.5-116.1c0 44.2-35.8 80-80 80H288c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]
            }, yt = {
              prefix: "fas",
              iconName: "compress",
              icon: [448, 512, [], "f066", "M160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V64zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32H96v64c0 17.7 14.3 32 32 32s32-14.3 32-32V352c0-17.7-14.3-32-32-32H32zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H352V64zM320 320c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32s32-14.3 32-32V384h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H320z"]
            }, Bt = {
              prefix: "fas",
              iconName: "wheat-awn",
              icon: [512, 512, ["wheat-alt"], "e2cd", "M505 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L383 95c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l88-88zM305.5 27.3c-6.2-6.2-16.4-6.2-22.6 0L271.5 38.6c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8l-11.3-11.3c-6.2-6.2-16.4-6.2-22.6 0l-11.3 11.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8L101.8 231c-6.2-6.2-16.4-6.2-22.6 0L67.9 242.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4L9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l68.9-68.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-21.8-21.8-49.6-34.1-78.1-36.9l31.9-31.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-21.8-21.8-49.6-34.1-78.1-36.9l31.9-31.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0L486.5 231c6.2-6.2 6.2-16.4 0-22.6L475.2 197c-5.2-5.2-10.6-9.8-16.4-13.9L505 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-59.4 59.4c-20.6-4.4-42-3.7-62.3 2.1c6.1-21.3 6.6-43.8 1.4-65.3L409 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L329.1 52.9c-3.7-5-7.8-9.8-12.4-14.3L305.5 27.3z"]
            }, ar = Bt, Pr = {
              prefix: "fas",
              iconName: "ankh",
              icon: [320, 512, [9765], "f644", "M96 128c0-35.3 28.7-64 64-64s64 28.7 64 64c0 41.6-20.7 76.6-46.6 104.1c-5.9 6.2-11.8 11.8-17.4 16.7c-5.6-4.9-11.5-10.5-17.4-16.7C116.7 204.6 96 169.6 96 128zM160 0C89.3 0 32 57.3 32 128c0 52.4 21.5 95.5 46.8 128H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h96V480c0 17.7 14.3 32 32 32s32-14.3 32-32V320h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H241.2c25.4-32.5 46.8-75.6 46.8-128C288 57.3 230.7 0 160 0z"]
            }, Sn = {
              prefix: "fas",
              iconName: "hands-holding-child",
              icon: [640, 512, [], "e4fa", "M320 0a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm44.7 164.3L375.8 253c1.6 13.2-7.7 25.1-20.8 26.8s-25.1-7.7-26.8-20.8l-4.4-35h-7.6l-4.4 35c-1.6 13.2-13.6 22.5-26.8 20.8s-22.5-13.6-20.8-26.8l11.1-88.8L255.5 181c-10.1 8.6-25.3 7.3-33.8-2.8s-7.3-25.3 2.8-33.8l27.9-23.6C271.3 104.8 295.3 96 320 96s48.7 8.8 67.6 24.7l27.9 23.6c10.1 8.6 11.4 23.7 2.8 33.8s-23.7 11.4-33.8 2.8l-19.8-16.7zM40 64c22.1 0 40 17.9 40 40v40 80 40.2c0 17 6.7 33.3 18.7 45.3l51.1 51.1c8.3 8.3 21.3 9.6 31 3.1c12.9-8.6 14.7-26.9 3.7-37.8l-15.2-15.2-32-32c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l32 32 15.2 15.2 0 0 25.3 25.3c21 21 32.8 49.5 32.8 79.2V464c0 26.5-21.5 48-48 48H173.3c-17 0-33.3-6.7-45.3-18.7L28.1 393.4C10.1 375.4 0 351 0 325.5V224 160 104C0 81.9 17.9 64 40 64zm560 0c22.1 0 40 17.9 40 40v56 64V325.5c0 25.5-10.1 49.9-28.1 67.9L512 493.3c-12 12-28.3 18.7-45.3 18.7H400c-26.5 0-48-21.5-48-48V385.1c0-29.7 11.8-58.2 32.8-79.2l25.3-25.3 0 0 15.2-15.2 32-32c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-32 32-15.2 15.2c-11 11-9.2 29.2 3.7 37.8c9.7 6.5 22.7 5.2 31-3.1l51.1-51.1c12-12 18.7-28.3 18.7-45.3V224 144 104c0-22.1 17.9-40 40-40z"]
            }, cn = {
              prefix: "fas",
              iconName: "asterisk",
              icon: [384, 512, [10033, 61545], "2a", "M192 32c17.7 0 32 14.3 32 32V199.5l111.5-66.9c15.2-9.1 34.8-4.2 43.9 11s4.2 34.8-11 43.9L254.2 256l114.3 68.6c15.2 9.1 20.1 28.7 11 43.9s-28.7 20.1-43.9 11L224 312.5V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V312.5L48.5 379.4c-15.2 9.1-34.8 4.2-43.9-11s-4.2-34.8 11-43.9L129.8 256 15.5 187.4c-15.2-9.1-20.1-28.7-11-43.9s28.7-20.1 43.9-11L160 199.5V64c0-17.7 14.3-32 32-32z"]
            }, Gn = {
              prefix: "fas",
              iconName: "square-check",
              icon: [448, 512, [9745, 9989, 61510, "check-square"], "f14a", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
            }, es = Gn, Ys = {
              prefix: "fas",
              iconName: "peseta-sign",
              icon: [384, 512, [], "e221", "M64 32C46.3 32 32 46.3 32 64v96c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 96V448c0 17.7 14.3 32 32 32s32-14.3 32-32V352h96c77.4 0 142-55 156.8-128H352c17.7 0 32-14.3 32-32s-14.3-32-32-32h-3.2C334 87 269.4 32 192 32H64zM282.5 160H96V96h96c41.8 0 77.4 26.7 90.5 64zM96 224H282.5c-13.2 37.3-48.7 64-90.5 64H96V224z"]
            }, S1 = {
              prefix: "fas",
              iconName: "heading",
              icon: [448, 512, ["header"], "f1dc", "M0 64C0 46.3 14.3 32 32 32H80h48c17.7 0 32 14.3 32 32s-14.3 32-32 32H112V208H336V96H320c-17.7 0-32-14.3-32-32s14.3-32 32-32h48 48c17.7 0 32 14.3 32 32s-14.3 32-32 32H400V240 416h16c17.7 0 32 14.3 32 32s-14.3 32-32 32H368 320c-17.7 0-32-14.3-32-32s14.3-32 32-32h16V272H112V416h16c17.7 0 32 14.3 32 32s-14.3 32-32 32H80 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H48V240 96H32C14.3 96 0 81.7 0 64z"]
            }, ia = S1, x9 = {
              prefix: "fas",
              iconName: "ghost",
              icon: [384, 512, [128123], "f6e2", "M40.1 467.1l-11.2 9c-3.2 2.5-7.1 3.9-11.1 3.9C8 480 0 472 0 462.2V192C0 86 86 0 192 0S384 86 384 192V462.2c0 9.8-8 17.8-17.8 17.8c-4 0-7.9-1.4-11.1-3.9l-11.2-9c-13.4-10.7-32.8-9-44.1 3.9L269.3 506c-3.3 3.8-8.2 6-13.3 6s-9.9-2.2-13.3-6l-26.6-30.5c-12.7-14.6-35.4-14.6-48.2 0L141.3 506c-3.3 3.8-8.2 6-13.3 6s-9.9-2.2-13.3-6L84.2 471c-11.3-12.9-30.7-14.6-44.1-3.9zM160 192a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, Jf = {
              prefix: "fas",
              iconName: "list",
              icon: [512, 512, ["list-squares"], "f03a", "M40 48C26.7 48 16 58.7 16 72v48c0 13.3 10.7 24 24 24H88c13.3 0 24-10.7 24-24V72c0-13.3-10.7-24-24-24H40zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zM16 232v48c0 13.3 10.7 24 24 24H88c13.3 0 24-10.7 24-24V232c0-13.3-10.7-24-24-24H40c-13.3 0-24 10.7-24 24zM40 368c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24H88c13.3 0 24-10.7 24-24V392c0-13.3-10.7-24-24-24H40z"]
            }, Vo = Jf, U1 = {
              prefix: "fas",
              iconName: "square-phone-flip",
              icon: [448, 512, ["phone-square-alt"], "f87b", "M384 32c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96C0 60.7 28.7 32 64 32H384zm-90.7 96.7c-9.7-2.6-19.9 2.3-23.7 11.6l-20 48c-3.4 8.2-1 17.6 5.8 23.2L280 231.7c-16.6 35.2-45.1 63.7-80.3 80.3l-20.2-24.7c-5.6-6.8-15-9.2-23.2-5.8l-48 20c-9.3 3.9-14.2 14-11.6 23.7l12 44C111.1 378 119 384 128 384c123.7 0 224-100.3 224-224c0-9-6-16.9-14.7-19.3l-44-12z"]
            }, vA = U1, Wf = {
              prefix: "fas",
              iconName: "cart-plus",
              icon: [576, 512, [], "f217", "M0 24C0 10.7 10.7 0 24 0H69.5c22 0 41.5 12.8 50.6 32h411c26.3 0 45.5 25 38.6 50.4l-41 152.3c-8.5 31.4-37 53.3-69.5 53.3H170.7l5.4 28.5c2.2 11.3 12.1 19.5 23.6 19.5H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H199.7c-34.6 0-64.3-24.6-70.7-58.5L77.4 54.5c-.7-3.8-4-6.5-7.9-6.5H24C10.7 48 0 37.3 0 24zM128 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm336-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM252 160c0 11 9 20 20 20h44v44c0 11 9 20 20 20s20-9 20-20V180h44c11 0 20-9 20-20s-9-20-20-20H356V96c0-11-9-20-20-20s-20 9-20 20v44H272c-11 0-20 9-20 20z"]
            }, _1 = {
              prefix: "fas",
              iconName: "gamepad",
              icon: [640, 512, [], "f11b", "M192 64C86 64 0 150 0 256S86 448 192 448H448c106 0 192-86 192-192s-86-192-192-192H192zM496 168a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM392 304a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM168 200c0-13.3 10.7-24 24-24s24 10.7 24 24v32h32c13.3 0 24 10.7 24 24s-10.7 24-24 24H216v32c0 13.3-10.7 24-24 24s-24-10.7-24-24V280H136c-13.3 0-24-10.7-24-24s10.7-24 24-24h32V200z"]
            }, $1 = {
              prefix: "fas",
              iconName: "circle-dot",
              icon: [512, 512, [128280, "dot-circle"], "f192", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
            }, D9 = $1, kA = {
              prefix: "fas",
              iconName: "face-dizzy",
              icon: [512, 512, ["dizzy"], "f567", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-224a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM100.7 132.7c6.2-6.2 16.4-6.2 22.6 0L160 169.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L182.6 192l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L160 214.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L137.4 192l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6zm192 0c6.2-6.2 16.4-6.2 22.6 0L352 169.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L374.6 192l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L352 214.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L329.4 192l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6z"]
            }, oP = kA, yc = {
              prefix: "fas",
              iconName: "egg",
              icon: [384, 512, [129370], "f7fb", "M192 496C86 496 0 394 0 288C0 176 64 16 192 16s192 160 192 272c0 106-86 208-192 208zM154.8 134c6.5-6 7-16.1 1-22.6s-16.1-7-22.6-1c-23.9 21.8-41.1 52.7-52.3 84.2C69.7 226.1 64 259.7 64 288c0 8.8 7.2 16 16 16s16-7.2 16-16c0-24.5 5-54.4 15.1-82.8c10.1-28.5 25-54.1 43.7-71.2z"]
            }, Bq = {
              prefix: "fas",
              iconName: "house-medical-circle-xmark",
              icon: [640, 512, [], "e513", "M320 368c0 59.5 29.5 112.1 74.8 144H128.1c-35.3 0-64-28.7-64-64V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L522.1 193.9c-8.5-1.3-17.3-1.9-26.1-1.9c-54.7 0-103.5 24.9-135.8 64H320V208c0-8.8-7.2-16-16-16H272c-8.8 0-16 7.2-16 16v48H208c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h48v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm22.6 144l36.7-36.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L496 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L473.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L496 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L518.6 368z"]
            }, Xg = {
              prefix: "fas",
              iconName: "campground",
              icon: [576, 512, [9978], "f6bb", "M377 52c11-13.8 8.8-33.9-5-45s-33.9-8.8-45 5L288 60.8 249 12c-11-13.8-31.2-16-45-5s-16 31.2-5 45l48 60L12.3 405.4C4.3 415.4 0 427.7 0 440.4V464c0 26.5 21.5 48 48 48H288 528c26.5 0 48-21.5 48-48V440.4c0-12.7-4.3-25.1-12.3-35L329 112l48-60zM288 448H168.5L288 291.7 407.5 448H288z"]
            }, kc = {
              prefix: "fas",
              iconName: "folder-plus",
              icon: [512, 512, [], "f65e", "M512 416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96C0 60.7 28.7 32 64 32H192c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8H448c35.3 0 64 28.7 64 64V416zM232 376c0 13.3 10.7 24 24 24s24-10.7 24-24V312h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V200c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"]
            }, Pa = {
              prefix: "fas",
              iconName: "futbol",
              icon: [512, 512, [9917, "futbol-ball", "soccer-ball"], "f1e3", "M417.3 360.1l-71.6-4.8c-5.2-.3-10.3 1.1-14.5 4.2s-7.2 7.4-8.4 12.5l-17.6 69.6C289.5 445.8 273 448 256 448s-33.5-2.2-49.2-6.4L189.2 372c-1.3-5-4.3-9.4-8.4-12.5s-9.3-4.5-14.5-4.2l-71.6 4.8c-17.6-27.2-28.5-59.2-30.4-93.6L125 228.3c4.4-2.8 7.6-7 9.2-11.9s1.4-10.2-.5-15l-26.7-66.6C128 109.2 155.3 89 186.7 76.9l55.2 46c4 3.3 9 5.1 14.1 5.1s10.2-1.8 14.1-5.1l55.2-46c31.3 12.1 58.7 32.3 79.6 57.9l-26.7 66.6c-1.9 4.8-2.1 10.1-.5 15s4.9 9.1 9.2 11.9l60.7 38.2c-1.9 34.4-12.8 66.4-30.4 93.6zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm14.1-325.7c-8.4-6.1-19.8-6.1-28.2 0L194 221c-8.4 6.1-11.9 16.9-8.7 26.8l18.3 56.3c3.2 9.9 12.4 16.6 22.8 16.6h59.2c10.4 0 19.6-6.7 22.8-16.6l18.3-56.3c3.2-9.9-.3-20.7-8.7-26.8l-47.9-34.8z"]
            }, nv = Pa, iv = Pa, O6 = {
              prefix: "fas",
              iconName: "paintbrush",
              icon: [576, 512, [128396, "paint-brush"], "f1fc", "M339.3 367.1c27.3-3.9 51.9-19.4 67.2-42.9L568.2 74.1c12.6-19.5 9.4-45.3-7.6-61.2S517.7-4.4 499.1 9.6L262.4 187.2c-24 18-38.2 46.1-38.4 76.1L339.3 367.1zm-19.6 25.4l-116-104.4C143.9 290.3 96 339.6 96 400c0 3.9 .2 7.8 .6 11.6C98.4 429.1 86.4 448 68.8 448H64c-17.7 0-32 14.3-32 32s14.3 32 32 32H208c61.9 0 112-50.1 112-112c0-2.5-.1-5-.2-7.5z"]
            }, t7 = O6, Ec = {
              prefix: "fas",
              iconName: "lock",
              icon: [448, 512, [128274], "f023", "M144 144v48H304V144c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192V144C80 64.5 144.5 0 224 0s144 64.5 144 144v48h16c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V256c0-35.3 28.7-64 64-64H80z"]
            }, Vp = {
              prefix: "fas",
              iconName: "gas-pump",
              icon: [512, 512, [9981], "f52f", "M32 64C32 28.7 60.7 0 96 0H256c35.3 0 64 28.7 64 64V256h8c48.6 0 88 39.4 88 88v32c0 13.3 10.7 24 24 24s24-10.7 24-24V222c-27.6-7.1-48-32.2-48-62V96L384 64c-8.8-8.8-8.8-23.2 0-32s23.2-8.8 32 0l77.3 77.3c12 12 18.7 28.3 18.7 45.3V168v24 32V376c0 39.8-32.2 72-72 72s-72-32.2-72-72V344c0-22.1-17.9-40-40-40h-8V448c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32V64zM96 80v96c0 8.8 7.2 16 16 16H240c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H112c-8.8 0-16 7.2-16 16z"]
            }, Fc = {
              prefix: "fas",
              iconName: "hot-tub-person",
              icon: [512, 512, ["hot-tub"], "f593", "M272 24c0-13.3-10.7-24-24-24s-24 10.7-24 24v5.2c0 34 14.4 66.4 39.7 89.2l16.4 14.8c15.2 13.7 23.8 33.1 23.8 53.5V200c0 13.3 10.7 24 24 24s24-10.7 24-24V186.8c0-34-14.4-66.4-39.7-89.2L295.8 82.8C280.7 69.1 272 49.7 272 29.2V24zM0 320v16V448c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V320c0-35.3-28.7-64-64-64H277.3c-13.8 0-27.3-4.5-38.4-12.8l-85.3-64C137 166.7 116.8 160 96 160c-53 0-96 43-96 96v64zm128 16v96c0 8.8-7.2 16-16 16s-16-7.2-16-16V336c0-8.8 7.2-16 16-16s16 7.2 16 16zm80-16c8.8 0 16 7.2 16 16v96c0 8.8-7.2 16-16 16s-16-7.2-16-16V336c0-8.8 7.2-16 16-16zm112 16v96c0 8.8-7.2 16-16 16s-16-7.2-16-16V336c0-8.8 7.2-16 16-16s16 7.2 16 16zm80-16c8.8 0 16 7.2 16 16v96c0 8.8-7.2 16-16 16s-16-7.2-16-16V336c0-8.8 7.2-16 16-16zM360 0c-13.3 0-24 10.7-24 24v5.2c0 34 14.4 66.4 39.7 89.2l16.4 14.8c15.2 13.7 23.8 33.1 23.8 53.5V200c0 13.3 10.7 24 24 24s24-10.7 24-24V186.8c0-34-14.4-66.4-39.7-89.2L407.8 82.8C392.7 69.1 384 49.7 384 29.2V24c0-13.3-10.7-24-24-24zM64 128A64 64 0 1 0 64 0a64 64 0 1 0 0 128z"]
            }, fP = Fc, r7 = {
              prefix: "fas",
              iconName: "map-location",
              icon: [576, 512, ["map-marked"], "f59f", "M302.8 312C334.9 271.9 408 174.6 408 120C408 53.7 354.3 0 288 0S168 53.7 168 120c0 54.6 73.1 151.9 105.2 192c7.7 9.6 22 9.6 29.6 0zM416 503l144.9-58c9.1-3.6 15.1-12.5 15.1-22.3V152c0-17-17.1-28.6-32.9-22.3l-116 46.4c-.5 1.2-1 2.5-1.5 3.7c-2.9 6.8-6.1 13.7-9.6 20.6V503zM15.1 187.3C6 191 0 199.8 0 209.6V480.4c0 17 17.1 28.6 32.9 22.3L160 451.8V200.4c-3.5-6.9-6.7-13.8-9.6-20.6c-5.6-13.2-10.4-27.4-12.8-41.5l-122.6 49zM384 255c-20.5 31.3-42.3 59.6-56.2 77c-20.5 25.6-59.1 25.6-79.6 0c-13.9-17.4-35.7-45.7-56.2-77V449.4l192 54.9V255z"]
            }, Tg = r7, Wq = {
              prefix: "fas",
              iconName: "house-flood-water",
              icon: [576, 512, [], "e50e", "M306.8 6.1C295.6-2 280.4-2 269.2 6.1l-176 128c-11.2 8.2-15.9 22.6-11.6 35.8S98.1 192 112 192h16v73c1.7 1 3.3 2 4.9 3.1c18 12.4 40.1 20.3 59.2 20.3c21.1 0 42-8.5 59.2-20.3c22.1-15.5 51.6-15.5 73.7 0c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c1.5-1 3-2 4.5-2.9l-.3-73.2H464c13.9 0 26.1-8.9 30.4-22.1s-.4-27.6-11.6-35.8l-176-128zM269.5 309.9C247 325.4 219.5 336 192 336c-26.9 0-55.3-10.8-77.4-26.1l0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 389.7 159 400 192 400c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.5-27.3-10.1-39.2-1.7l0 0C439.4 325.2 410.9 336 384 336c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0zM384 448c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1l0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7l0 0C439.4 437.2 410.9 448 384 448z"]
            }, qg = {
              prefix: "fas",
              iconName: "tree",
              icon: [448, 512, [127794], "f1bb", "M210.6 5.9L62 169.4c-3.9 4.2-6 9.8-6 15.5C56 197.7 66.3 208 79.1 208H104L30.6 281.4c-4.2 4.2-6.6 10-6.6 16C24 309.9 34.1 320 46.6 320H80L5.4 409.5C1.9 413.7 0 419 0 424.5c0 13 10.5 23.5 23.5 23.5H192v32c0 17.7 14.3 32 32 32s32-14.3 32-32V448H424.5c13 0 23.5-10.5 23.5-23.5c0-5.5-1.9-10.8-5.4-15L368 320h33.4c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L344 208h24.9c12.7 0 23.1-10.3 23.1-23.1c0-5.7-2.1-11.3-6-15.5L237.4 5.9C234 2.1 229.1 0 224 0s-10 2.1-13.4 5.9z"]
            }, Mu = {
              prefix: "fas",
              iconName: "bridge-lock",
              icon: [640, 512, [], "e4cc", "M32 64c0-17.7 14.3-32 32-32H576c17.7 0 32 14.3 32 32s-14.3 32-32 32H536v64h-8c-61.9 0-112 50.1-112 112v24.6c-9.9 5.8-18.2 14.1-23.8 24.1c-17.6-20-43.4-32.7-72.2-32.7c-53 0-96 43-96 96v64c0 17.7-14.3 32-32 32H160c-17.7 0-32-14.3-32-32V384c0-53-43-96-96-96V160h72V96H64C46.3 96 32 81.7 32 64zM408 96v64h80V96H408zm-48 64V96H280v64h80zM152 96v64h80V96H152zM528 240c-17.7 0-32 14.3-32 32v48h64V272c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80v48c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32H448c-17.7 0-32-14.3-32-32V352c0-17.7 14.3-32 32-32V272z"]
            }, Nc = {
              prefix: "fas",
              iconName: "sack-dollar",
              icon: [512, 512, [128176], "f81d", "M320 96H192L144.6 24.9C137.5 14.2 145.1 0 157.9 0H354.1c12.8 0 20.4 14.2 13.3 24.9L320 96zM192 128H320c3.8 2.5 8.1 5.3 13 8.4C389.7 172.7 512 250.9 512 416c0 53-43 96-96 96H96c-53 0-96-43-96-96C0 250.9 122.3 172.7 179 136.4l0 0 0 0c4.8-3.1 9.2-5.9 13-8.4zm84 88c0-11-9-20-20-20s-20 9-20 20v14c-7.6 1.7-15.2 4.4-22.2 8.5c-13.9 8.3-25.9 22.8-25.8 43.9c.1 20.3 12 33.1 24.7 40.7c11 6.6 24.7 10.8 35.6 14l1.7 .5c12.6 3.8 21.8 6.8 28 10.7c5.1 3.2 5.8 5.4 5.9 8.2c.1 5-1.8 8-5.9 10.5c-5 3.1-12.9 5-21.4 4.7c-11.1-.4-21.5-3.9-35.1-8.5c-2.3-.8-4.7-1.6-7.2-2.4c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3c1.9 .6 4 1.3 6.1 2.1l0 0 0 0c8.3 2.9 17.9 6.2 28.2 8.4V424c0 11 9 20 20 20s20-9 20-20V410.2c8-1.7 16-4.5 23.2-9c14.3-8.9 25.1-24.1 24.8-45c-.3-20.3-11.7-33.4-24.6-41.6c-11.5-7.2-25.9-11.6-37.1-15l0 0-.7-.2c-12.8-3.9-21.9-6.7-28.3-10.5c-5.2-3.1-5.3-4.9-5.3-6.7c0-3.7 1.4-6.5 6.2-9.3c5.4-3.2 13.6-5.1 21.5-5c9.6 .1 20.2 2.2 31.2 5.2c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-6.5-1.7-13.7-3.4-21.1-4.7V216z"]
            }, Lu = {
              prefix: "fas",
              iconName: "pen-to-square",
              icon: [512, 512, ["edit"], "f044", "M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160V416c0 53 43 96 96 96H352c53 0 96-43 96-96V320c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H96z"]
            }, Ku = Lu, Qc = {
              prefix: "fas",
              iconName: "car-side",
              icon: [640, 512, [128663], "f5e4", "M171.3 96H224v96H111.3l30.4-75.9C146.5 104 158.2 96 171.3 96zM272 192V96h81.2c9.7 0 18.9 4.4 25 12l67.2 84H272zm256.2 1L428.2 68c-18.2-22.8-45.8-36-75-36H171.3c-39.3 0-74.6 23.9-89.1 60.3L40.6 196.4C16.8 205.8 0 228.9 0 256V368c0 17.7 14.3 32 32 32H65.3c7.6 45.4 47.1 80 94.7 80s87.1-34.6 94.7-80H385.3c7.6 45.4 47.1 80 94.7 80s87.1-34.6 94.7-80H608c17.7 0 32-14.3 32-32V320c0-65.2-48.8-119-111.8-127zM434.7 368a48 48 0 1 1 90.5 32 48 48 0 1 1 -90.5-32zM160 336a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, sv = {
              prefix: "fas",
              iconName: "share-nodes",
              icon: [448, 512, ["share-alt"], "f1e0", "M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z"]
            }, p4 = sv, Ju = {
              prefix: "fas",
              iconName: "heart-circle-minus",
              icon: [576, 512, [], "e4ff", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-64 0c0 8.8-7.2 16-16 16H368c-8.8 0-16-7.2-16-16s7.2-16 16-16H496c8.8 0 16 7.2 16 16z"]
            }, AP = {
              prefix: "fas",
              iconName: "hourglass-half",
              icon: [384, 512, ["hourglass-2"], "f252", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64V75c0 42.4 16.9 83.1 46.9 113.1L146.7 256 78.9 323.9C48.9 353.9 32 394.6 32 437v11c-17.7 0-32 14.3-32 32s14.3 32 32 32H64 320h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V437c0-42.4-16.9-83.1-46.9-113.1L237.3 256l67.9-67.9c30-30 46.9-70.7 46.9-113.1V64c17.7 0 32-14.3 32-32s-14.3-32-32-32H320 64 32zM96 75V64H288V75c0 19-5.6 37.4-16 53H112c-10.3-15.6-16-34-16-53zm16 309c3.5-5.3 7.6-10.3 12.1-14.9L192 301.3l67.9 67.9c4.6 4.6 8.6 9.6 12.1 14.9H112z"]
            }, n7 = AP, av = {
              prefix: "fas",
              iconName: "microscope",
              icon: [512, 512, [128300], "f610", "M160 32c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32c17.7 0 32 14.3 32 32V288c0 17.7-14.3 32-32 32c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32zM32 448H320c70.7 0 128-57.3 128-128s-57.3-128-128-128V128c106 0 192 86 192 192c0 49.2-18.5 94-48.9 128H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320 32c-17.7 0-32-14.3-32-32s14.3-32 32-32zm80-64H304c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, pd = {
              prefix: "fas",
              iconName: "sink",
              icon: [512, 512, [], "e06d", "M288 96c0-17.7 14.3-32 32-32s32 14.3 32 32s14.3 32 32 32s32-14.3 32-32c0-53-43-96-96-96s-96 43-96 96V288H160V264c0-30.9-25.1-56-56-56H56c-13.3 0-24 10.7-24 24s10.7 24 24 24h48c4.4 0 8 3.6 8 8v24H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H256 480c17.7 0 32-14.3 32-32s-14.3-32-32-32H400V264c0-4.4 3.6-8 8-8h56c13.3 0 24-10.7 24-24s-10.7-24-24-24H408c-30.9 0-56 25.1-56 56v24H288V96zM480 416V384H32v32c0 53 43 96 96 96H384c53 0 96-43 96-96z"]
            }, Z9 = {
              prefix: "fas",
              iconName: "bag-shopping",
              icon: [448, 512, ["shopping-bag"], "f290", "M160 112c0-35.3 28.7-64 64-64s64 28.7 64 64v48H160V112zm-48 48H48c-26.5 0-48 21.5-48 48V416c0 53 43 96 96 96H352c53 0 96-43 96-96V208c0-26.5-21.5-48-48-48H336V112C336 50.1 285.9 0 224 0S112 50.1 112 112v48zm24 48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm152 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
            }, zu = Z9, EA = {
              prefix: "fas",
              iconName: "arrow-down-z-a",
              icon: [576, 512, ["sort-alpha-desc", "sort-alpha-down-alt"], "f881", "M183.6 469.6C177.5 476.2 169 480 160 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L128 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V365.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 64c0-17.7 14.3-32 32-32H480c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9L429.3 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H352c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L402.7 96H352c-17.7 0-32-14.3-32-32zm96 192c12.1 0 23.2 6.8 28.6 17.7l64 128 16 32c7.9 15.8 1.5 35-14.3 42.9s-35 1.5-42.9-14.3L460.2 448H371.8l-7.2 14.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l16-32 64-128c5.4-10.8 16.5-17.7 28.6-17.7zM395.8 400h40.4L416 359.6 395.8 400z"]
            }, _9 = EA, Sf = EA, Gu = {
              prefix: "fas",
              iconName: "mitten",
              icon: [448, 512, [], "f7b5", "M352 384H64L5.4 178.9C1.8 166.4 0 153.4 0 140.3C0 62.8 62.8 0 140.3 0h3.4c66 0 123.5 44.9 139.5 108.9l31.4 125.8 17.6-20.1C344.8 200.2 362.9 192 382 192h2.8c34.9 0 63.3 28.3 63.3 63.3c0 15.9-6 31.2-16.8 42.9L352 384zM32 448c0-17.7 14.3-32 32-32H352c17.7 0 32 14.3 32 32v32c0 17.7-14.3 32-32 32H64c-17.7 0-32-14.3-32-32V448z"]
            }, Sq = {
              prefix: "fas",
              iconName: "person-rays",
              icon: [512, 512, [], "e54d", "M208 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V256.9l-28.6 47.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6h29.7c33.7 0 64.9 17.7 82.3 46.6l58.3 97c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9L328 256.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H248zM7 7C16.4-2.3 31.6-2.3 41 7l80 80c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L7 41C-2.3 31.6-2.3 16.4 7 7zM471 7c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-80 80c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L471 7zM7 505c-9.4-9.4-9.4-24.6 0-33.9l80-80c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L41 505c-9.4 9.4-24.6 9.4-33.9 0zm464 0l-80-80c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l80 80c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0z"]
            }, bg = {
              prefix: "fas",
              iconName: "users",
              icon: [640, 512, [], "f0c0", "M144 0a80 80 0 1 1 0 160A80 80 0 1 1 144 0zM512 0a80 80 0 1 1 0 160A80 80 0 1 1 512 0zM0 298.7C0 239.8 47.8 192 106.7 192h42.7c15.9 0 31 3.5 44.6 9.7c-1.3 7.2-1.9 14.7-1.9 22.3c0 38.2 16.8 72.5 43.3 96c-.2 0-.4 0-.7 0H21.3C9.6 320 0 310.4 0 298.7zM405.3 320c-.2 0-.4 0-.7 0c26.6-23.5 43.3-57.8 43.3-96c0-7.6-.7-15-1.9-22.3c13.6-6.3 28.7-9.7 44.6-9.7h42.7C592.2 192 640 239.8 640 298.7c0 11.8-9.6 21.3-21.3 21.3H405.3zM224 224a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zM128 485.3C128 411.7 187.7 352 261.3 352H378.7C452.3 352 512 411.7 512 485.3c0 14.7-11.9 26.7-26.7 26.7H154.7c-14.7 0-26.7-11.9-26.7-26.7z"]
            }, Es = {
              prefix: "fas",
              iconName: "eye-slash",
              icon: [640, 512, [], "f070", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"]
            }, FA = {
              prefix: "fas",
              iconName: "flask-vial",
              icon: [640, 512, [], "e4f3", "M175 389.4c-9.8 16-15 34.3-15 53.1c-10 3.5-20.8 5.5-32 5.5c-53 0-96-43-96-96V64C14.3 64 0 49.7 0 32S14.3 0 32 0H96h64 64c17.7 0 32 14.3 32 32s-14.3 32-32 32V309.9l-49 79.6zM96 64v96h64V64H96zM352 0H480h32c17.7 0 32 14.3 32 32s-14.3 32-32 32V214.9L629.7 406.2c6.7 10.9 10.3 23.5 10.3 36.4c0 38.3-31.1 69.4-69.4 69.4H261.4c-38.3 0-69.4-31.1-69.4-69.4c0-12.8 3.6-25.4 10.3-36.4L320 214.9V64c-17.7 0-32-14.3-32-32s14.3-32 32-32h32zm32 64V224c0 5.9-1.6 11.7-4.7 16.8L330.5 320h171l-48.8-79.2c-3.1-5-4.7-10.8-4.7-16.8V64H384z"]
            }, Qa = {
              prefix: "fas",
              iconName: "hand",
              icon: [512, 512, [129306, 9995, "hand-paper"], "f256", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V240c0 8.8-7.2 16-16 16s-16-7.2-16-16V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V336c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L124.8 448c43.1 41.1 100.4 64 160 64H304c97.2 0 176-78.8 176-176V128c0-17.7-14.3-32-32-32s-32 14.3-32 32V240c0 8.8-7.2 16-16 16s-16-7.2-16-16V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V240c0 8.8-7.2 16-16 16s-16-7.2-16-16V32z"]
            }, fn = Qa, Zu = {
              prefix: "fas",
              iconName: "om",
              icon: [512, 512, [128329], "f679", "M379.3 4.7c-6.2-6.2-16.4-6.2-22.6 0l-16 16c-6.2 6.2-6.2 16.4 0 22.6l16 16c6.2 6.2 16.4 6.2 22.6 0l16-16c6.2-6.2 6.2-16.4 0-22.6l-16-16zM115.2 169.6c8-6 17.9-9.6 28.8-9.6c26.5 0 48 21.5 48 48s-21.5 48-48 48H109.8c-7.6 0-13.8 6.2-13.8 13.8c0 1.5 .2 2.9 .7 4.4l8 24c4.4 13.1 16.6 21.9 30.4 21.9H144h16c35.3 0 64 28.7 64 64s-28.7 64-64 64c-50.8 0-82.7-21.5-102.2-42.8c-9.9-10.8-16.6-21.6-20.9-29.7c-2.1-4-3.6-7.3-4.5-9.6c-.5-1.1-.8-2-1-2.5l-.2-.5 0-.1c-2.6-7.8-10.7-12.3-18.7-10.5C4.4 354.2-.9 361.8 .1 370L16 368C.1 370 .1 370 .1 370l0 0 0 0 0 .1 .1 .4c0 .3 .1 .8 .2 1.3c.2 1.1 .4 2.7 .8 4.6c.8 3.9 2 9.4 3.9 15.9c3.8 13 10.3 30.4 21.3 48C48.7 476.2 89.4 512 160 512c70.7 0 128-57.3 128-128c0-23.3-6.2-45.2-17.1-64h22.6c25.5 0 49.9-10.1 67.9-28.1l26.5-26.5c6-6 14.1-9.4 22.6-9.4H416c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32c-25.7 0-41.4-12.5-51.2-25.6c-5-6.7-8.4-13.4-10.5-18.6c-1.1-2.5-1.8-4.6-2.2-6c-.2-.7-.4-1.2-.5-1.5l-.1-.3 0 0c0 0 0 0 0 0c-1.9-7.3-8.6-12.4-16.2-12.1c-7.6 .3-13.9 5.9-15.1 13.4L336 368c-15.8-2.6-15.8-2.6-15.8-2.6l0 0 0 0 0 .1-.1 .3c0 .3-.1 .6-.2 1.1c-.1 .9-.3 2.1-.4 3.6c-.3 3-.6 7.3-.6 12.4c0 10.1 1.1 23.9 5.8 38.1c4.8 14.3 13.4 29.3 28.6 40.7C368.7 473.3 389.3 480 416 480c53 0 96-43 96-96V288c0-53-43-96-96-96h-5.5c-25.5 0-49.9 10.1-67.9 28.1l-26.5 26.5c-6 6-14.1 9.4-22.6 9.4H245.2c6.9-14.5 10.8-30.8 10.8-48c0-61.9-50.1-112-112-112c-25.2 0-48.5 8.3-67.2 22.4c-14.1 10.6-17 30.7-6.4 44.8s30.7 17 44.8 6.4zM280.9 66.7c-6-4-14-3.5-19.5 1.3s-7 12.7-3.7 19.2L272 80c-14.3 7.2-14.3 7.2-14.3 7.2l0 0 0 0 0 .1 .1 .2 .4 .7c.3 .6 .8 1.4 1.4 2.4c1.2 2 2.9 4.8 5.1 8.2c4.4 6.7 11.1 15.5 20 24.4C302.4 141.1 330.3 160 368 160c31.2 0 56.6-10.4 73.9-20.2c8.7-5 15.6-9.9 20.4-13.8c2.4-1.9 4.3-3.6 5.7-4.9c.7-.6 1.3-1.2 1.7-1.6l.6-.5 .2-.2 .1-.1 0 0 0 0c0 0 0 0-22.6-22.6l22.6 22.6c12.5-12.5 12.5-32.8 0-45.3c-12.4-12.4-32.6-12.5-45.1-.2c-.1 .1-.2 .2-.5 .4c-.5 .5-1.5 1.3-2.8 2.4c-2.7 2.2-6.8 5.2-12.1 8.2C399.4 90.4 384.8 96 368 96c-20.8 0-42.4-7-59.5-14.6c-8.4-3.7-15.4-7.5-20.3-10.3c-2.4-1.4-4.3-2.5-5.6-3.3c-.6-.4-1.1-.7-1.4-.9l-.3-.2 0 0 0 0 0 0z"]
            }, Ms = {
              prefix: "fas",
              iconName: "worm",
              icon: [512, 512, [], "e599", "M256 96c0-53 43-96 96-96h38.4C439.9 0 480 40.1 480 89.6V176v16V376c0 75.1-60.9 136-136 136s-136-60.9-136-136V296c0-22.1-17.9-40-40-40s-40 17.9-40 40V464c0 26.5-21.5 48-48 48s-48-21.5-48-48V296c0-75.1 60.9-136 136-136s136 60.9 136 136v80c0 22.1 17.9 40 40 40s40-17.9 40-40V192H352c-53 0-96-43-96-96zm144-8a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
            }, Ni = {
              prefix: "fas",
              iconName: "house-circle-xmark",
              icon: [640, 512, [], "e50b", "M320.7 352c8.1-89.7 83.5-160 175.3-160c8.9 0 17.6 .7 26.1 1.9L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1h32v69.7c-.1 .9-.1 1.8-.1 2.8V472c0 22.1 17.9 40 40 40h16c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2H160h24c22.1 0 40-17.9 40-40V448 384c0-17.7 14.3-32 32-32h64l.7 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
            }, _s = {
              prefix: "fas",
              iconName: "plug",
              icon: [384, 512, [128268], "f1e6", "M96 0C78.3 0 64 14.3 64 32v96h64V32c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32v96h64V32c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32v32c0 77.4 55 142 128 156.8V480c0 17.7 14.3 32 32 32s32-14.3 32-32V412.8C297 398 352 333.4 352 256V224c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"]
            }, bi = {
              prefix: "fas",
              iconName: "chevron-up",
              icon: [512, 512, [], "f077", "M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]
            }, uA = {
              prefix: "fas",
              iconName: "hand-spock",
              icon: [576, 512, [128406], "f259", "M246.9 23.7C242.3 6.6 224.8-3.5 207.7 1.1s-27.2 22.1-22.6 39.2L238 237.8c2.5 9.2-4.5 18.2-14 18.2c-6.4 0-12-4.2-13.9-10.3L166.6 102.7c-5.1-16.9-23-26.4-39.9-21.3s-26.4 23-21.3 39.9l62.8 206.4c2.4 7.9-7.2 13.8-13.2 8.1L99.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L156.8 448c43.1 41.1 100.4 64 160 64h10.9 8.2c.1 0 .1-.1 .1-.1v0c0-.1 .1-.1 .1-.1c58.3-3.5 108.6-43.2 125.3-99.7l81.2-275c5-16.9-4.7-34.7-21.6-39.8s-34.7 4.7-39.8 21.6L443.5 247.1c-1.6 5.3-6.4 8.9-12 8.9c-7.9 0-13.8-7.3-12.2-15.1l36-170.3c3.7-17.3-7.4-34.3-24.7-37.9s-34.3 7.4-37.9 24.7L355.1 235.1c-2.6 12.2-13.3 20.9-25.8 20.9c-11.9 0-22.4-8-25.4-19.5l-57-212.8z"]
            }, xi = {
              prefix: "fas",
              iconName: "stopwatch",
              icon: [448, 512, [9201], "f2f2", "M176 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h16V98.4C92.3 113.8 16 200 16 304c0 114.9 93.1 208 208 208s208-93.1 208-208c0-41.8-12.3-80.7-33.5-113.2l24.1-24.1c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L355.7 143c-28.1-23-62.2-38.8-99.7-44.6V64h16c17.7 0 32-14.3 32-32s-14.3-32-32-32H224 176zm72 192V320c0 13.3-10.7 24-24 24s-24-10.7-24-24V192c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
            }, Ya = {
              prefix: "fas",
              iconName: "face-kiss",
              icon: [512, 512, [128535, "kiss"], "f596", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm48.7-198.3c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C274.7 443.1 257.4 448 240 448c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9l0 0 0 0 0 0 0 0 .2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1 0 0 0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7l0 0 0 0 0 0 0 0 0 0 .2-.1 .3-.2 .6-.4c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1l-.4-.3-.5-.3-.2-.1 0 0 0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, Uf = Ya, I1 = {
              prefix: "fas",
              iconName: "bridge-circle-xmark",
              icon: [640, 512, [], "e4cb", "M64 32C46.3 32 32 46.3 32 64s14.3 32 32 32h40v64H32V288c53 0 96 43 96 96v64c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V384c0-53 43-96 96-96c6.3 0 12.4 .6 18.3 1.7C367.1 231.8 426.9 192 496 192c42.5 0 81.6 15.1 112 40.2V160H536V96h40c17.7 0 32-14.3 32-32s-14.3-32-32-32H64zM488 96v64H408V96h80zM360 96v64H280V96h80zM232 96v64H152V96h80zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
            }, vo = {
              prefix: "fas",
              iconName: "face-grin-tongue",
              icon: [512, 512, [128539, "grin-tongue"], "f589", "M0 256C0 368.9 73.1 464.7 174.5 498.8C165.3 484 160 466.6 160 448V400.7c-24-17.5-43.1-41.4-54.8-69.2c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19c12.3-3.8 24.3 6.9 19.3 18.7c-11.8 28-31.1 52-55.4 69.6V448c0 18.6-5.3 36-14.5 50.8C438.9 464.7 512 368.9 512 256C512 114.6 397.4 0 256 0S0 114.6 0 256zm176.4-80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 448V402.6c0-14.7-11.9-26.6-26.6-26.6h-2c-11.3 0-21.1 7.9-23.6 18.9c-2.8 12.6-20.8 12.6-23.6 0c-2.5-11.1-12.3-18.9-23.6-18.9h-2c-14.7 0-26.6 11.9-26.6 26.6V448c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
            }, NA = vo, _u = {
              prefix: "fas",
              iconName: "chess-bishop",
              icon: [320, 512, [9821], "f43a", "M128 0C110.3 0 96 14.3 96 32c0 16.1 11.9 29.4 27.4 31.7C78.4 106.8 8 190 8 288c0 47.4 30.8 72.3 56 84.7V400H256V372.7c25.2-12.5 56-37.4 56-84.7c0-37.3-10.2-72.4-25.3-104.1l-99.4 99.4c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L270.8 154.6c-23.2-38.1-51.8-69.5-74.2-90.9C212.1 61.4 224 48.1 224 32c0-17.7-14.3-32-32-32H128zM48 432L6.6 473.4c-4.2 4.2-6.6 10-6.6 16C0 501.9 10.1 512 22.6 512H297.4c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L272 432H48z"]
            }, ov = {
              prefix: "fas",
              iconName: "face-grin-wink",
              icon: [512, 512, ["grin-wink"], "f58c", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zm-16.9-79.2c-17.6-23.5-52.8-23.5-70.4 0c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, QA = ov, dP = {
              prefix: "fas",
              iconName: "ear-deaf",
              icon: [512, 512, ["deaf", "deafness", "hard-of-hearing"], "f2a4", "M502.6 54.6l-40 40c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l40-40c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zm-320 320l-128 128c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM240 128c-57.6 0-105.1 43.6-111.3 99.5c-1.9 17.6-17.8 30.2-35.3 28.3s-30.2-17.8-28.3-35.3C74.8 132.5 149.4 64 240 64c97.2 0 176 78.8 176 176c0 46-17.7 87.9-46.6 119.3c-12 13-17.4 24.8-17.4 34.7V400c0 61.9-50.1 112-112 112c-17.7 0-32-14.3-32-32s14.3-32 32-32c26.5 0 48-21.5 48-48v-6.1c0-32.9 17.4-59.6 34.4-78c18.4-20 29.6-46.6 29.6-75.9c0-61.9-50.1-112-112-112zm0 80c-17.7 0-32 14.3-32 32c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-44.2 35.8-80 80-80s80 35.8 80 80c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-17.7-14.3-32-32-32z"]
            }, lA = dP, To = dP, Yc = dP, i7 = {
              prefix: "fas",
              iconName: "road-circle-check",
              icon: [640, 512, [], "e564", "M213.2 32H288V96c0 17.7 14.3 32 32 32s32-14.3 32-32V32h74.8c27.1 0 51.3 17.1 60.3 42.6l42.7 120.6c-10.9-2.1-22.2-3.2-33.8-3.2c-59.5 0-112.1 29.6-144 74.8V224c0-17.7-14.3-32-32-32s-32 14.3-32 32v64c0 17.7 14.3 32 32 32c2.3 0 4.6-.3 6.8-.7c-4.5 15.5-6.8 31.8-6.8 48.7c0 5.4 .2 10.7 .7 16l-.7 0c-17.7 0-32 14.3-32 32v64H86.6C56.5 480 32 455.5 32 425.4c0-6.2 1.1-12.4 3.1-18.2L152.9 74.6C162 49.1 186.1 32 213.2 32zM352 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L480 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
            }, xg = {
              prefix: "fas",
              iconName: "dice-five",
              icon: [448, 512, [9860], "f523", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm64 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM96 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM224 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64-64a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 160a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, $9 = {
              prefix: "fas",
              iconName: "square-rss",
              icon: [448, 512, ["rss-square"], "f143", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM96 136c0-13.3 10.7-24 24-24c137 0 248 111 248 248c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-110.5-89.5-200-200-200c-13.3 0-24-10.7-24-24zm0 96c0-13.3 10.7-24 24-24c83.9 0 152 68.1 152 152c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-57.4-46.6-104-104-104c-13.3 0-24-10.7-24-24zm0 120a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, _v = $9, e6 = {
              prefix: "fas",
              iconName: "land-mine-on",
              icon: [640, 512, [], "e51b", "M344 24V168c0 13.3-10.7 24-24 24s-24-10.7-24-24V24c0-13.3 10.7-24 24-24s24 10.7 24 24zM192 320c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32v32H192V320zm-77.3 90.5c8.1-16.3 24.8-26.5 42.9-26.5H482.3c18.2 0 34.8 10.3 42.9 26.5l27.6 55.2C563.5 487 548 512 524.2 512H115.8c-23.8 0-39.3-25-28.6-46.3l27.6-55.2zM36.3 138.3c7.5-10.9 22.5-13.6 33.4-6.1l104 72c10.9 7.5 13.6 22.5 6.1 33.4s-22.5 13.6-33.4 6.1l-104-72c-10.9-7.5-13.6-22.5-6.1-33.4zm534.1-6.1c10.9-7.5 25.8-4.8 33.4 6.1s4.8 25.8-6.1 33.4l-104 72c-10.9 7.5-25.8 4.8-33.4-6.1s-4.8-25.8 6.1-33.4l104-72z"]
            }, $u = {
              prefix: "fas",
              iconName: "i-cursor",
              icon: [256, 512, [], "f246", "M.1 29.3C-1.4 47 11.7 62.4 29.3 63.9l8 .7C70.5 67.3 96 95 96 128.3V224H64c-17.7 0-32 14.3-32 32s14.3 32 32 32H96v95.7c0 33.3-25.5 61-58.7 63.8l-8 .7C11.7 449.6-1.4 465 .1 482.7s16.9 30.7 34.5 29.2l8-.7c34.1-2.8 64.2-18.9 85.4-42.9c21.2 24 51.2 40.1 85.4 42.9l8 .7c17.6 1.5 33.1-11.6 34.5-29.2s-11.6-33.1-29.2-34.5l-8-.7C185.5 444.7 160 417 160 383.7V288h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H160V128.3c0-33.3 25.5-61 58.7-63.8l8-.7c17.6-1.5 30.7-16.9 29.2-34.5S239-1.4 221.3 .1l-8 .7C179.2 3.6 149.2 19.7 128 43.7c-21.2-24-51.2-40-85.4-42.9l-8-.7C17-1.4 1.6 11.7 .1 29.3z"]
            }, Mc = {
              prefix: "fas",
              iconName: "stamp",
              icon: [512, 512, [], "f5bf", "M312 201.8c0-17.4 9.2-33.2 19.9-47C344.5 138.5 352 118.1 352 96c0-53-43-96-96-96s-96 43-96 96c0 22.1 7.5 42.5 20.1 58.8c10.7 13.8 19.9 29.6 19.9 47c0 29.9-24.3 54.2-54.2 54.2H112C50.1 256 0 306.1 0 368c0 20.9 13.4 38.7 32 45.3V464c0 26.5 21.5 48 48 48H432c26.5 0 48-21.5 48-48V413.3c18.6-6.6 32-24.4 32-45.3c0-61.9-50.1-112-112-112H366.2c-29.9 0-54.2-24.3-54.2-54.2zM416 416v32H96V416H416z"]
            }, t6 = {
              prefix: "fas",
              iconName: "stairs",
              icon: [576, 512, [], "e289", "M384 64c0-17.7 14.3-32 32-32H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H448v96c0 17.7-14.3 32-32 32H320v96c0 17.7-14.3 32-32 32H192v96c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32h96V320c0-17.7 14.3-32 32-32h96V192c0-17.7 14.3-32 32-32h96V64z"]
            }, zf = {
              prefix: "fas",
              iconName: "i",
              icon: [320, 512, [105], "49", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96h96V416H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H288c17.7 0 32-14.3 32-32s-14.3-32-32-32H192V96h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H160 32z"]
            }, PA = {
              prefix: "fas",
              iconName: "hryvnia-sign",
              icon: [384, 512, [8372, "hryvnia"], "f6f2", "M121.9 116.2C138.3 103.1 158.7 96 179.6 96H223c27.1 0 49 21.9 49 49c0 11.5-4 22.4-11.1 31H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H155.5l-50.6 28.9c-1.7 1-3.4 2-5.1 3.1H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H52.3c-2.8 9.9-4.3 20.4-4.3 31c0 62.4 50.6 113 113 113h43.4c35.5 0 70-12.1 97.7-34.3L308 441c13.8-11 16-31.2 5-45s-31.2-16-45-5l-5.9 4.7c-16.4 13.1-36.7 20.2-57.7 20.2H161c-27.1 0-49-21.9-49-49c0-11.5 4-22.4 11.1-31H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H228.5l50.6-28.9c1.7-1 3.4-2 5.1-3.1H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H331.7c2.8-10 4.3-20.4 4.3-31c0-62.4-50.6-113-113-113H179.6c-35.5 0-70 12.1-97.7 34.3L76 71c-13.8 11-16 31.2-5 45s31.2 16 45 5l5.9-4.7z"]
            }, ef = PA, $v = {
              prefix: "fas",
              iconName: "pills",
              icon: [576, 512, [], "f484", "M112 96c-26.5 0-48 21.5-48 48V256h96V144c0-26.5-21.5-48-48-48zM0 144C0 82.1 50.1 32 112 32s112 50.1 112 112V368c0 61.9-50.1 112-112 112S0 429.9 0 368V144zM554.9 399.4c-7.1 12.3-23.7 13.1-33.8 3.1L333.5 214.9c-10-10-9.3-26.7 3.1-33.8C360 167.7 387.1 160 416 160c88.4 0 160 71.6 160 160c0 28.9-7.7 56-21.1 79.4zm-59.5 59.5C472 472.3 444.9 480 416 480c-88.4 0-160-71.6-160-160c0-28.9 7.7-56 21.1-79.4c7.1-12.3 23.7-13.1 33.8-3.1L498.5 425.1c10 10 9.3 26.7-3.1 33.8z"]
            }, r6 = {
              prefix: "fas",
              iconName: "face-grin-wide",
              icon: [512, 512, [128515, "grin-alt"], "f581", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM208 192c0 35.3-14.3 64-32 64s-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64zm128 64c-17.7 0-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64s-14.3 64-32 64z"]
            }, Dg = r6, Cp = {
              prefix: "fas",
              iconName: "tooth",
              icon: [448, 512, [129463], "f5c9", "M186.1 52.1C169.3 39.1 148.7 32 127.5 32C74.7 32 32 74.7 32 127.5v6.2c0 15.8 3.7 31.3 10.7 45.5l23.5 47.1c4.5 8.9 7.6 18.4 9.4 28.2l36.7 205.8c2 11.2 11.6 19.4 22.9 19.8s21.4-7.4 24-18.4l28.9-121.3C192.2 323.7 207 312 224 312s31.8 11.7 35.8 28.3l28.9 121.3c2.6 11.1 12.7 18.8 24 18.4s20.9-8.6 22.9-19.8l36.7-205.8c1.8-9.8 4.9-19.3 9.4-28.2l23.5-47.1c7.1-14.1 10.7-29.7 10.7-45.5v-2.1c0-55-44.6-99.6-99.6-99.6c-24.1 0-47.4 8.8-65.6 24.6l-3.2 2.8 19.5 15.2c7 5.4 8.2 15.5 2.8 22.5s-15.5 8.2-22.5 2.8l-24.4-19-37-28.8z"]
            }, jg = {
              prefix: "fas",
              iconName: "v",
              icon: [384, 512, [118], "56", "M19.7 34.5c16.3-6.8 35 .9 41.8 17.2L192 364.8 322.5 51.7c6.8-16.3 25.5-24 41.8-17.2s24 25.5 17.2 41.8l-160 384c-5 11.9-16.6 19.7-29.5 19.7s-24.6-7.8-29.5-19.7L2.5 76.3c-6.8-16.3 .9-35 17.2-41.8z"]
            }, n6 = {
              prefix: "fas",
              iconName: "bangladeshi-taka-sign",
              icon: [384, 512, [], "e2e6", "M36 32.2C18.4 30.1 2.4 42.5 .2 60S10.5 93.6 28 95.8l7.9 1c16 2 28 15.6 28 31.8V160H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H64V384c0 53 43 96 96 96h32c106 0 192-86 192-192V256c0-53-43-96-96-96H272c-17.7 0-32 14.3-32 32s14.3 32 32 32h16c17.7 0 32 14.3 32 32v32c0 70.7-57.3 128-128 128H160c-17.7 0-32-14.3-32-32V224h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H128V128.5c0-48.4-36.1-89.3-84.1-95.3l-7.9-1z"]
            }, r1 = {
              prefix: "fas",
              iconName: "bicycle",
              icon: [640, 512, [128690], "f206", "M312 32c-13.3 0-24 10.7-24 24s10.7 24 24 24h25.7l34.6 64H222.9l-27.4-38C191 99.7 183.7 96 176 96H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h43.7l22.1 30.7-26.6 53.1c-10-2.5-20.5-3.8-31.2-3.8C57.3 224 0 281.3 0 352s57.3 128 128 128c65.3 0 119.1-48.9 127-112h49c8.5 0 16.3-4.5 20.7-11.8l84.8-143.5 21.7 40.1C402.4 276.3 384 312 384 352c0 70.7 57.3 128 128 128s128-57.3 128-128s-57.3-128-128-128c-13.5 0-26.5 2.1-38.7 6L375.4 48.8C369.8 38.4 359 32 347.2 32H312zM458.6 303.7l32.3 59.7c6.3 11.7 20.9 16 32.5 9.7s16-20.9 9.7-32.5l-32.3-59.7c3.6-.6 7.4-.9 11.2-.9c39.8 0 72 32.2 72 72s-32.2 72-72 72s-72-32.2-72-72c0-18.6 7-35.5 18.6-48.3zM133.2 368h65c-7.3 32.1-36 56-70.2 56c-39.8 0-72-32.2-72-72s32.2-72 72-72c1.7 0 3.4 .1 5.1 .2l-24.2 48.5c-9 18.1 4.1 39.4 24.3 39.4zm33.7-48l50.7-101.3 72.9 101.2-.1 .1H166.8zm90.6-128H365.9L317 274.8 257.4 192z"]
            }, Us = {
              prefix: "fas",
              iconName: "staff-snake",
              icon: [384, 512, ["rod-asclepius", "rod-snake", "staff-aesculapius"], "e579", "M222.6 43.2l-.1 4.8H288c53 0 96 43 96 96s-43 96-96 96H248V160h40c8.8 0 16-7.2 16-16s-7.2-16-16-16H248 220l-4.5 144H256c53 0 96 43 96 96s-43 96-96 96H240V384h16c8.8 0 16-7.2 16-16s-7.2-16-16-16H213l-3.1 99.5L208.5 495l0 1c-.3 8.9-7.6 16-16.5 16s-16.2-7.1-16.5-16l0-1-1-31H136c-22.1 0-40-17.9-40-40s17.9-40 40-40h36l-1-32H152c-53 0-96-43-96-96c0-47.6 34.6-87.1 80-94.7V256c0 8.8 7.2 16 16 16h16.5L164 128H136 122.6c-9 18.9-28.3 32-50.6 32H56c-30.9 0-56-25.1-56-56S25.1 48 56 48h8 8 89.5l-.1-4.8L161 32c0-.7 0-1.3 0-1.9c.5-16.6 14.1-30 31-30s30.5 13.4 31 30c0 .6 0 1.3 0 1.9l-.4 11.2zM64 112a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
            }, tf = Us, fv = Us, Lc = Us, el = {
              prefix: "fas",
              iconName: "head-side-cough-slash",
              icon: [640, 512, [], "e062", "M448 325.8l44 34.5c8.1 1.4 14.8 6.8 18 14.1L552.9 408c10.6 .4 19.5 7.6 22.2 17.4l39.1 30.6c.6 0 1.2-.1 1.8-.1c11.1 0 20.4 7.5 23.2 17.8h-3.9c6.2 8.5 6.4 20.4-.4 29c-8.2 10.4-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2S28.4-3.1 38.8 5.1L89.6 44.9C127 16.7 173.5 0 224 0h24c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8H448v0 5.8zM0 224.2c0-38.7 9.8-75.1 27.1-106.9L341.8 365.3l-2.5 .3c-11 1.4-19.2 10.7-19.2 21.8c0 11.6 9 21.2 20.6 21.9l62 3.9 43 33.9C439.3 466.2 421.2 480 400 480H320v8c0 13.3-10.7 24-24 24H256v0H96c-17.7 0-32-14.3-32-32V407.3c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zM616 360a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm-64-48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40-24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
            }, eu = {
              prefix: "fas",
              iconName: "truck-medical",
              icon: [640, 512, [128657, "ambulance"], "f0f9", "M0 48C0 21.5 21.5 0 48 0H368c26.5 0 48 21.5 48 48V96h50.7c17 0 33.3 6.7 45.3 18.7L589.3 192c12 12 18.7 28.3 18.7 45.3V256v32 64c17.7 0 32 14.3 32 32s-14.3 32-32 32H576c0 53-43 96-96 96s-96-43-96-96H256c0 53-43 96-96 96s-96-43-96-96H48c-26.5 0-48-21.5-48-48V48zM416 256H544V237.3L466.7 160H416v96zM160 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM176 80v48l-48 0c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h48v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V192h48c8.8 0 16-7.2 16-16V144c0-8.8-7.2-16-16-16H240V80c0-8.8-7.2-16-16-16H192c-8.8 0-16 7.2-16 16z"]
            }, h4 = eu, s7 = {
              prefix: "fas",
              iconName: "wheat-awn-circle-exclamation",
              icon: [640, 512, [], "e598", "M505 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L383 95c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l88-88zM305.5 27.3c-6.2-6.2-16.4-6.2-22.6 0L271.5 38.6c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8l-11.3-11.3c-6.2-6.2-16.4-6.2-22.6 0l-11.3 11.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8L101.8 231c-6.2-6.2-16.4-6.2-22.6 0L67.9 242.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4L9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l68.9-68.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-21.8-21.8-49.6-34.1-78.1-36.9l31.9-31.9 12.2 12.2c22.5 22.5 53.3 31.5 82.4 27c0-1 0-2.1 0-3.1c0-33.1 9.1-64.1 25-90.6c-15.5-8.7-32.5-13.8-49.8-15.5l31.9-31.9 12.2 12.2c6 6 12.6 11.1 19.7 15.2c27.5-34 67.3-57.5 112.6-63.8c-4.1-3.8-8.4-7.3-12.9-10.5L505 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-59.4 59.4c-20.6-4.4-42-3.7-62.3 2.1c6.1-21.3 6.6-43.8 1.4-65.3L409 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L329.1 52.9c-3.7-5-7.8-9.8-12.4-14.3L305.5 27.3zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16v80c0 8.8-7.2 16-16 16s-16-7.2-16-16V288c0-8.8 7.2-16 16-16z"]
            }, wg = {
              prefix: "fas",
              iconName: "snowman",
              icon: [512, 512, [9731, 9924], "f7d0", "M341.1 140.6c-2 3.9-1.6 8.6 1.2 12c7 8.5 12.9 18.1 17.2 28.4L408 160.2V120c0-13.3 10.7-24 24-24s24 10.7 24 24v19.6l22.5-9.7c12.2-5.2 26.3 .4 31.5 12.6s-.4 26.3-12.6 31.5l-56 24-73.6 31.5c-.5 9.5-2.1 18.6-4.8 27.3c-1.2 3.8-.1 8 2.8 10.8C396.7 296.9 416 338.2 416 384c0 44.7-18.3 85-47.8 114.1c-9.9 9.7-23.7 13.9-37.5 13.9H181.3c-13.9 0-27.7-4.2-37.5-13.9C114.3 469 96 428.7 96 384c0-45.8 19.3-87.1 50.1-116.3c2.9-2.8 4-6.9 2.8-10.8c-2.7-8.7-4.3-17.9-4.8-27.3L70.5 198.1l-56-24C2.4 168.8-3.3 154.7 1.9 142.5s19.3-17.8 31.5-12.6L56 139.6V120c0-13.3 10.7-24 24-24s24 10.7 24 24v40.2L152.6 181c4.3-10.3 10.1-19.9 17.2-28.4c2.8-3.4 3.3-8.1 1.2-12C164 127.2 160 112.1 160 96c0-53 43-96 96-96s96 43 96 96c0 16.1-4 31.2-10.9 44.6zM224 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm48 128a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-16 80a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm16 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zM288 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm-48 24v3.2c0 3.2 .8 6.3 2.3 9l9 16.9c.9 1.7 2.7 2.8 4.7 2.8s3.8-1.1 4.7-2.8l9-16.9c1.5-2.8 2.3-5.9 2.3-9V120c0-8.8-7.2-16-16-16s-16 7.2-16 16z"]
            }, qo = {
              prefix: "fas",
              iconName: "mortar-pestle",
              icon: [512, 512, [], "f5a7", "M504.3 11.1C493.3-1.6 474.5-3.7 461 6.2L252.3 160H397.3L502.6 54.6c11.8-11.8 12.6-30.8 1.6-43.5zM32 192c-17.7 0-32 14.3-32 32s14.3 32 32 32c0 82.5 43.4 147.7 123.9 176.2c-11.1 13.9-19.4 30.3-23.9 48.1C127.6 497.4 142.3 512 160 512H352c17.7 0 32.4-14.6 28.1-31.7c-4.5-17.8-12.8-34.1-23.9-48.1C436.6 403.7 480 338.5 480 256c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"]
            }, a7 = {
              prefix: "fas",
              iconName: "road-barrier",
              icon: [640, 512, [], "e562", "M32 32C14.3 32 0 46.3 0 64V448c0 17.7 14.3 32 32 32s32-14.3 32-32V266.3L149.2 96H64V64c0-17.7-14.3-32-32-32zM405.2 96H330.8l-5.4 10.7L234.8 288h74.3l5.4-10.7L405.2 96zM362.8 288h74.3l5.4-10.7L533.2 96H458.8l-5.4 10.7L362.8 288zM202.8 96l-5.4 10.7L106.8 288h74.3l5.4-10.7L277.2 96H202.8zm288 192H576V448c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v53.7L490.8 288z"]
            }, Op = {
              prefix: "fas",
              iconName: "school",
              icon: [640, 512, [127979], "f549", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96H48C21.5 96 0 117.5 0 144V464c0 26.5 21.5 48 48 48H592c26.5 0 48-21.5 48-48V144c0-26.5-21.5-48-48-48H473.7L337.8 5.4zM256 416c0-35.3 28.7-64 64-64s64 28.7 64 64v96H256V416zM96 192h32c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16V208c0-8.8 7.2-16 16-16zm400 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H512c-8.8 0-16-7.2-16-16V208zM96 320h32c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16V336c0-8.8 7.2-16 16-16zm400 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H512c-8.8 0-16-7.2-16-16V336zM232 176a88 88 0 1 1 176 0 88 88 0 1 1 -176 0zm88-48c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H336V144c0-8.8-7.2-16-16-16z"]
            }, Gf = {
              prefix: "fas",
              iconName: "igloo",
              icon: [576, 512, [], "f7ae", "M320 33.8V160H48.5C100.2 82.8 188.1 32 288 32c10.8 0 21.5 .6 32 1.8zM352 160V39.1C424.9 55.7 487.2 99.8 527.5 160H352zM29.9 192H96V320H0c0-46 10.8-89.4 29.9-128zM192 320H128V192H448V320H384v32H576v80c0 26.5-21.5 48-48 48H352V352c0-35.3-28.7-64-64-64s-64 28.7-64 64V480H48c-26.5 0-48-21.5-48-48V352H192V320zm288 0V192h66.1c19.2 38.6 29.9 82 29.9 128H480z"]
            }, Av = {
              prefix: "fas",
              iconName: "joint",
              icon: [640, 512, [], "f595", "M448 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V43c0 55.2 21.9 108.1 60.9 147.1l21 21c9 9 14.1 21.2 14.1 33.9v11c0 17.7 14.3 32 32 32s32-14.3 32-32V245c0-29.7-11.8-58.2-32.8-79.2l-21-21C463.2 117.8 448 81.2 448 43V32zM576 256c0 17.7 14.3 32 32 32s32-14.3 32-32V245c0-55.2-21.9-108.1-60.9-147.1l-21-21c-9-9-14.1-21.2-14.1-33.9V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V43c0 29.7 11.8 58.2 32.8 79.2l21 21c27 27 42.2 63.6 42.2 101.8v11zM229.8 360c-4.7-2.3-10-2.7-15.2-2c-37.8 5.6-75.2 14.3-106.9 22.8C81.3 388 58.3 395.1 42 400.4c-8.2 2.7-14.7 4.9-19.2 6.5c-2.3 .8-4 1.4-5.2 1.8l-1.3 .5C6.8 412.5 0 421.4 0 432s6.8 19.5 16.3 22.7l1.3 .5c1.2 .4 3 1.1 5.2 1.8c4.5 1.6 11 3.8 19.2 6.5c16.3 5.4 39.2 12.5 65.7 19.6C160.3 497.3 228.8 512 288 512h67.3c4.1 0 6.3-5.1 3.6-8.3L256.5 380.8c-7.4-8.9-16.5-15.9-26.7-20.8zM445 512h19 51.3c4.1 0 6.3-5.1 3.6-8.3L416.5 380.8C401.3 362.5 378.8 352 355 352H336 288c-1.1 0-2.3 0-3.4 0c-4.1 0-6.2 5.1-3.5 8.3L383.5 483.2C398.7 501.5 421.2 512 445 512zm-3.9-151.7L543.5 483.2c14.6 17.5 35.9 27.9 58.6 28.7c21.1-1.1 37.9-18.6 37.9-39.9V392c0-22.1-17.9-40-40-40H444.7c-4.1 0-6.3 5.1-3.6 8.3z"]
            }, o7 = {
              prefix: "fas",
              iconName: "angle-right",
              icon: [320, 512, [8250], "f105", "M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"]
            }, hd = {
              prefix: "fas",
              iconName: "horse",
              icon: [576, 512, [128014], "f6f0", "M448 238.1V160h16l9.8 19.6c12.5 25.1 42.2 36.4 68.3 26c20.5-8.2 33.9-28 33.9-50.1V80c0-19.1-8.4-36.3-21.7-48H560c8.8 0 16-7.2 16-16s-7.2-16-16-16H480 448C377.3 0 320 57.3 320 128H224 203.2 148.8c-30.7 0-57.6 16.3-72.5 40.8C33.2 174.5 0 211.4 0 256v56c0 13.3 10.7 24 24 24s24-10.7 24-24V256c0-13.4 6.6-25.2 16.7-32.5c1.6 13 6.3 25.4 13.6 36.4l28.2 42.4c8.3 12.4 6.4 28.7-1.2 41.6c-16.5 28-20.6 62.2-10 93.9l17.5 52.4c4.4 13.1 16.6 21.9 30.4 21.9h33.7c21.8 0 37.3-21.4 30.4-42.1l-20.8-62.5c-2.1-6.4-.5-13.4 4.3-18.2l12.7-12.7c13.2-13.2 20.6-31.1 20.6-49.7c0-2.3-.1-4.6-.3-6.9l84 24c4.1 1.2 8.2 2.1 12.3 2.8V480c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V315.7c19.2-19.2 31.5-45.7 32-75.7h0v-1.9zM496 64a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
            }, f7 = {
              prefix: "fas",
              iconName: "q",
              icon: [448, 512, [113], "51", "M64 256c0 88.4 71.6 160 160 160c28.9 0 56-7.7 79.4-21.1l-72-86.4c-11.3-13.6-9.5-33.8 4.1-45.1s33.8-9.5 45.1 4.1l70.9 85.1C371.9 325.8 384 292.3 384 256c0-88.4-71.6-160-160-160S64 167.6 64 256zM344.9 444.6C310 467 268.5 480 224 480C100.3 480 0 379.7 0 256S100.3 32 224 32s224 100.3 224 224c0 56.1-20.6 107.4-54.7 146.7l47.3 56.8c11.3 13.6 9.5 33.8-4.1 45.1s-33.8 9.5-45.1-4.1l-46.6-55.9z"]
            }, mg = {
              prefix: "fas",
              iconName: "g",
              icon: [448, 512, [103], "47", "M224 96C135.6 96 64 167.6 64 256s71.6 160 160 160c77.4 0 142-55 156.8-128H256c-17.7 0-32-14.3-32-32s14.3-32 32-32H400c25.8 0 49.6 21.4 47.2 50.6C437.8 389.6 341.4 480 224 480C100.3 480 0 379.7 0 256S100.3 32 224 32c57.4 0 109.7 21.6 149.3 57c13.2 11.8 14.3 32 2.5 45.2s-32 14.3-45.2 2.5C302.3 111.4 265 96 224 96z"]
            }, YA = {
              prefix: "fas",
              iconName: "notes-medical",
              icon: [512, 512, [], "f481", "M96 352V96c0-35.3 28.7-64 64-64H416c35.3 0 64 28.7 64 64V293.5c0 17-6.7 33.3-18.7 45.3l-58.5 58.5c-12 12-28.3 18.7-45.3 18.7H160c-35.3 0-64-28.7-64-64zM272 128c-8.8 0-16 7.2-16 16v48H208c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h48v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V256h48c8.8 0 16-7.2 16-16V208c0-8.8-7.2-16-16-16H320V144c0-8.8-7.2-16-16-16H272zm24 336c13.3 0 24 10.7 24 24s-10.7 24-24 24H136C60.9 512 0 451.1 0 376V152c0-13.3 10.7-24 24-24s24 10.7 24 24l0 224c0 48.6 39.4 88 88 88H296z"]
            }, n1 = {
              prefix: "fas",
              iconName: "temperature-half",
              icon: [320, 512, [127777, "temperature-2", "thermometer-2", "thermometer-half"], "f2c9", "M160 64c-26.5 0-48 21.5-48 48V276.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5V112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112V276.5c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6V112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3V208c0-8.8 7.2-16 16-16s16 7.2 16 16V322.7c18.6 6.6 32 24.4 32 45.3z"]
            }, dn = n1, i1 = n1, rf = n1, Kc = {
              prefix: "fas",
              iconName: "dong-sign",
              icon: [384, 512, [], "e169", "M288 32c-17.7 0-32 14.3-32 32l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h32v49.1c-18.8-10.9-40.7-17.1-64-17.1c-70.7 0-128 57.3-128 128s57.3 128 128 128c24.5 0 47.4-6.9 66.8-18.8c5 11.1 16.2 18.8 29.2 18.8c17.7 0 32-14.3 32-32V288 128c17.7 0 32-14.3 32-32s-14.3-32-32-32c0-17.7-14.3-32-32-32zM128 288a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"]
            }, vP = {
              prefix: "fas",
              iconName: "capsules",
              icon: [576, 512, [], "f46b", "M64 144c0-26.5 21.5-48 48-48s48 21.5 48 48V256H64V144zM0 144V368c0 61.9 50.1 112 112 112s112-50.1 112-112V189.6c1.8 19.1 8.2 38 19.8 54.8L372.3 431.7c35.5 51.7 105.3 64.3 156 28.1s63-107.5 27.5-159.2L427.3 113.3C391.8 61.5 321.9 49 271.3 85.2c-28 20-44.3 50.8-47.3 83V144c0-61.9-50.1-112-112-112S0 82.1 0 144zm296.6 64.2c-16-23.3-10-55.3 11.9-71c21.2-15.1 50.5-10.3 66 12.2l67 97.6L361.6 303l-65-94.8zM491 407.7c-.8 .6-1.6 1.1-2.4 1.6l4-2.8c-.5 .4-1 .8-1.6 1.2z"]
            }, MA = {
              prefix: "fas",
              iconName: "poo-storm",
              icon: [448, 512, ["poo-bolt"], "f75a", "M236.9 .2c-5.5-.7-11 1.4-14.5 5.7s-4.6 10.1-2.8 15.3c2.8 8.2 4.3 16.9 4.3 26.1c0 21.7-8.5 37.2-21.9 47.6c-13.8 10.8-34 17-57.8 17H128c-35.3 0-64 28.7-64 64c0 12.2 3.4 23.5 9.3 33.2C31.7 216.2 0 252.4 0 296c0 41 28 75.4 65.8 85.2c-5.3-18.5 1-38.5 16.2-50.7l160-128c17.6-14.1 42.6-14 60.2 .2s22.8 38.6 12.8 58.8L285.7 320H304c20.4 0 38.5 12.9 45.3 32.1c3.7 10.6 3.5 21.8 0 31.9H360c48.6 0 88-39.4 88-88c0-43.6-31.7-79.8-73.3-86.8c5.9-9.7 9.3-21.1 9.3-33.2c0-35.3-28.7-64-64-64h-1.4c.9-5.4 1.4-10.9 1.4-16.6c0-48.7-36.1-88.9-83.1-95.2zm45.1 227.4c-5.8-4.7-14.2-4.7-20.1-.1l-160 128c-5.3 4.2-7.4 11.4-5.1 17.8s8.3 10.7 15.1 10.7h70.1L129.7 488.8c-3.4 6.7-1.6 14.9 4.3 19.6s14.2 4.7 20.1 .1l160-128c5.3-4.2 7.4-11.4 5.1-17.8s-8.3-10.7-15.1-10.7H233.9l52.4-104.8c3.4-6.7 1.6-14.9-4.3-19.6z"]
            }, tu = MA, uP = {
              prefix: "fas",
              iconName: "face-frown-open",
              icon: [512, 512, [128550, "frown-open"], "f57a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-122 174.5c-12.4 5.2-26.5-4.1-21.1-16.4c16-36.6 52.4-62.1 94.8-62.1s78.8 25.6 94.8 62.1c5.4 12.3-8.7 21.6-21.1 16.4c-22.4-9.5-47.4-14.8-73.7-14.8s-51.3 5.3-73.7 14.8z"]
            }, R1 = uP, dv = {
              prefix: "fas",
              iconName: "hand-point-up",
              icon: [384, 512, [9757], "f0a6", "M32 32C32 14.3 46.3 0 64 0S96 14.3 96 32V240H32V32zM224 192c0-17.7 14.3-32 32-32s32 14.3 32 32v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V192zm-64-64c17.7 0 32 14.3 32 32v48c0 17.7-14.3 32-32 32s-32-14.3-32-32V160c0-17.7 14.3-32 32-32zm160 96c0-17.7 14.3-32 32-32s32 14.3 32 32v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V224zm-96 88l0-.6c9.4 5.4 20.3 8.6 32 8.6c13.2 0 25.4-4 35.6-10.8c8.7 24.9 32.5 42.8 60.4 42.8c11.7 0 22.6-3.1 32-8.6V352c0 88.4-71.6 160-160 160H162.3c-42.4 0-83.1-16.9-113.1-46.9L37.5 453.5C13.5 429.5 0 396.9 0 363V336c0-35.3 28.7-64 64-64h88c22.1 0 40 17.9 40 40s-17.9 40-40 40H96c-8.8 0-16 7.2-16 16s7.2 16 16 16h56c39.8 0 72-32.2 72-72z"]
            }, ru = {
              prefix: "fas",
              iconName: "money-bill",
              icon: [576, 512, [], "f0d6", "M64 64C28.7 64 0 92.7 0 128V384c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H64zm64 320H64V320c35.3 0 64 28.7 64 64zM64 192V128h64c0 35.3-28.7 64-64 64zM448 384c0-35.3 28.7-64 64-64v64H448zm64-192c-35.3 0-64-28.7-64-64h64v64zM288 160a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
            }, yp = {
              prefix: "fas",
              iconName: "bookmark",
              icon: [384, 512, [128278, 61591], "f02e", "M0 48V487.7C0 501.1 10.9 512 24.3 512c5 0 9.9-1.5 14-4.4L192 400 345.7 507.6c4.1 2.9 9 4.4 14 4.4c13.4 0 24.3-10.9 24.3-24.3V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48z"]
            }, A7 = {
              prefix: "fas",
              iconName: "align-justify",
              icon: [448, 512, [], "f039", "M448 64c0-17.7-14.3-32-32-32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32z"]
            }, vv = {
              prefix: "fas",
              iconName: "umbrella-beach",
              icon: [576, 512, [127958], "f5ca", "M346.3 271.8l-60.1-21.9L214 448H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H282.1l64.1-176.2zm121.1-.2l-3.3 9.1 67.7 24.6c18.1 6.6 38-4.2 39.6-23.4c6.5-78.5-23.9-155.5-80.8-208.5c2 8 3.2 16.3 3.4 24.8l.2 6c1.8 57-7.3 113.8-26.8 167.4zM462 99.1c-1.1-34.4-22.5-64.8-54.4-77.4c-.9-.4-1.9-.7-2.8-1.1c-33-11.7-69.8-2.4-93.1 23.8l-4 4.5C272.4 88.3 245 134.2 226.8 184l-3.3 9.1L434 269.7l3.3-9.1c18.1-49.8 26.6-102.5 24.9-155.5l-.2-6zM107.2 112.9c-11.1 15.7-2.8 36.8 15.3 43.4l71 25.8 3.3-9.1c19.5-53.6 49.1-103 87.1-145.5l4-4.5c6.2-6.9 13.1-13 20.5-18.2c-79.6 2.5-154.7 42.2-201.2 108z"]
            }, lP = {
              prefix: "fas",
              iconName: "helmet-un",
              icon: [512, 512, [], "e503", "M479.5 224C471.2 98.9 367.2 0 240 0C107.5 0 0 107.5 0 240v56.3C0 344.8 39.2 384 87.7 384H200h14.9L343.5 505.4c4.5 4.2 10.4 6.6 16.5 6.6h96c13.3 0 24-10.7 24-24s-10.7-24-24-24H369.5l-1.5-1.5V288h80 32c17.7 0 32-14.3 32-32s-14.3-32-32-32h-.5zM320 417.2l-78-73.7L274.4 288H320V417.2zM285.3 103.1l34.7 52V112c0-8.8 7.2-16 16-16s16 7.2 16 16v96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4l-34.7-52V208c0 8.8-7.2 16-16 16s-16-7.2-16-16V112c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4zM160 112v64c0 8.8 7.2 16 16 16s16-7.2 16-16V112c0-8.8 7.2-16 16-16s16 7.2 16 16v64c0 26.5-21.5 48-48 48s-48-21.5-48-48V112c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
            }, H4 = {
              prefix: "fas",
              iconName: "bullseye",
              icon: [512, 512, [], "f140", "M448 256A192 192 0 1 0 64 256a192 192 0 1 0 384 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 80a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zM224 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, Bg = {
              prefix: "fas",
              iconName: "bacon",
              icon: [576, 512, [129363], "f7e5", "M439.2 1.2c11.2-3.2 23.2-.1 31.4 8.1L518 56.7l-26.5 7.9c-58 16.6-98.1 39.6-129.6 67.4c-31.2 27.5-53.2 59.1-75.1 90.9l-2.3 3.3C241.6 288.7 195 356.6 72.8 417.7L37.9 435.2 9.4 406.6c-7.3-7.3-10.6-17.6-9-27.8s8.1-18.9 17.3-23.5C136.1 296.2 180.9 231 223.3 169.3l2.3-3.4c21.8-31.8 44.9-64.9 77.7-93.9c33.4-29.5 75.8-53.6 135.9-70.8zM61.8 459l25.4-12.7c129.5-64.7 179.9-138.1 223.8-202l2.2-3.3c22.1-32.1 42.1-60.5 69.9-85.1c27.5-24.3 63.4-45.2 117.3-60.6l0 0 .2-.1 43.1-12.9 23 23c8 8 11.2 19.7 8.3 30.7s-11.3 19.6-22.2 22.7c-51.9 14.8-85.6 34.7-111.1 57.2c-26.1 23-45.1 49.9-67.3 82.1l-2.2 3.2C327.8 365.9 275.5 442 142.3 508.6c-12.3 6.2-27.2 3.7-36.9-6L61.8 459z"]
            }, d7 = {
              prefix: "fas",
              iconName: "hand-point-down",
              icon: [384, 512, [], "f0a7", "M32 480c0 17.7 14.3 32 32 32s32-14.3 32-32V272H32V480zM224 320c0 17.7 14.3 32 32 32s32-14.3 32-32V256c0-17.7-14.3-32-32-32s-32 14.3-32 32v64zm-64 64c17.7 0 32-14.3 32-32V304c0-17.7-14.3-32-32-32s-32 14.3-32 32v48c0 17.7 14.3 32 32 32zm160-96c0 17.7 14.3 32 32 32s32-14.3 32-32V224c0-17.7-14.3-32-32-32s-32 14.3-32 32v64zm-96-88l0 .6c9.4-5.4 20.3-8.6 32-8.6c13.2 0 25.4 4 35.6 10.8c8.7-24.9 32.5-42.8 60.4-42.8c11.7 0 22.6 3.1 32 8.6V160C384 71.6 312.4 0 224 0H162.3C119.8 0 79.1 16.9 49.1 46.9L37.5 58.5C13.5 82.5 0 115.1 0 149v27c0 35.3 28.7 64 64 64h88c22.1 0 40-17.9 40-40s-17.9-40-40-40H96c-8.8 0-16-7.2-16-16s7.2-16 16-16h56c39.8 0 72 32.2 72 72z"]
            }, v7 = {
              prefix: "fas",
              iconName: "arrow-up-from-bracket",
              icon: [448, 512, [], "e09a", "M246.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 109.3V320c0 17.7 14.3 32 32 32s32-14.3 32-32V109.3l73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64c0 53 43 96 96 96H352c53 0 96-43 96-96V352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V352z"]
            }, Wg = {
              prefix: "fas",
              iconName: "folder",
              icon: [512, 512, [128193, 128447, 61716, "folder-blank"], "f07b", "M64 480H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H288c-10.1 0-19.6-4.7-25.6-12.8L243.2 57.6C231.1 41.5 212.1 32 192 32H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64z"]
            }, g4 = Wg, kp = {
              prefix: "fas",
              iconName: "file-waveform",
              icon: [448, 512, ["file-medical-alt"], "f478", "M96 0C60.7 0 32 28.7 32 64V288H144c6.1 0 11.6 3.4 14.3 8.8L176 332.2l49.7-99.4c2.7-5.4 8.3-8.8 14.3-8.8s11.6 3.4 14.3 8.8L281.9 288H352c8.8 0 16 7.2 16 16s-7.2 16-16 16H272c-6.1 0-11.6-3.4-14.3-8.8L240 275.8l-49.7 99.4c-2.7 5.4-8.3 8.8-14.3 8.8s-11.6-3.4-14.3-8.8L134.1 320H32V448c0 35.3 28.7 64 64 64H352c35.3 0 64-28.7 64-64V160H288c-17.7 0-32-14.3-32-32V0H96zM288 0V128H416L288 0z"]
            }, Jc = kp, Ep = {
              prefix: "fas",
              iconName: "radiation",
              icon: [512, 512, [], "f7b9", "M216 186.7c-23.9 13.8-40 39.7-40 69.3L32 256C14.3 256-.2 241.6 2 224.1C10.7 154 47.8 92.7 101.3 52c14.1-10.7 33.8-5.3 42.7 10l72 124.7zM256 336c14.6 0 28.2-3.9 40-10.7l72 124.8c8.8 15.3 3.7 35.1-12.6 41.9c-30.6 12.9-64.2 20-99.4 20s-68.9-7.1-99.4-20c-16.3-6.9-21.4-26.6-12.6-41.9l72-124.8c11.8 6.8 25.4 10.7 40 10.7zm224-80l-144 0c0-29.6-16.1-55.5-40-69.3L368 62c8.8-15.3 28.6-20.7 42.7-10c53.6 40.7 90.6 102 99.4 172.1c2.2 17.5-12.4 31.9-30 31.9zM256 208a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, Sg = {
              prefix: "fas",
              iconName: "chart-simple",
              icon: [448, 512, [], "e473", "M160 80c0-26.5 21.5-48 48-48h32c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H208c-26.5 0-48-21.5-48-48V80zM0 272c0-26.5 21.5-48 48-48H80c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V272zM368 96h32c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H368c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48z"]
            }, Ug = {
              prefix: "fas",
              iconName: "mars-stroke",
              icon: [512, 512, [9894], "f229", "M376 0c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l33.4 33.4L370.3 96.4 345 71c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l25.4 25.4L307.8 159c-28.4-19.5-62.7-31-99.8-31c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176c0-37-11.4-71.4-31-99.8l28.6-28.6L407 201c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-25.4-25.4 22.1-22.1L471 153c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2V24c0-13.3-10.7-24-24-24H376zm88 48h0v0l0 0zM96 304a112 112 0 1 1 224 0A112 112 0 1 1 96 304z"]
            }, zc = {
              prefix: "fas",
              iconName: "vial",
              icon: [512, 512, [129514], "f492", "M342.6 9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4L28.1 342.6C10.1 360.6 0 385 0 410.5V416c0 53 43 96 96 96h5.5c25.5 0 49.9-10.1 67.9-28.1L448 205.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-32-32-96-96-32-32zM205.3 256L352 109.3 402.7 160l-96 96H205.3z"]
            }, Gc = {
              prefix: "fas",
              iconName: "gauge",
              icon: [512, 512, ["dashboard", "gauge-med", "tachometer-alt-average"], "f624", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm320 96c0-26.9-16.5-49.9-40-59.3V88c0-13.3-10.7-24-24-24s-24 10.7-24 24V292.7c-23.5 9.5-40 32.5-40 59.3c0 35.3 28.7 64 64 64s64-28.7 64-64zM144 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm-16 80a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM400 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
            }, Fp = Gc, j9 = Gc, tl = Gc, rl = {
              prefix: "fas",
              iconName: "wand-magic-sparkles",
              icon: [576, 512, ["magic-wand-sparkles"], "e2ca", "M234.7 42.7L197 56.8c-3 1.1-5 4-5 7.2s2 6.1 5 7.2l37.7 14.1L248.8 123c1.1 3 4 5 7.2 5s6.1-2 7.2-5l14.1-37.7L315 71.2c3-1.1 5-4 5-7.2s-2-6.1-5-7.2L277.3 42.7 263.2 5c-1.1-3-4-5-7.2-5s-6.1 2-7.2 5L234.7 42.7zM46.1 395.4c-18.7 18.7-18.7 49.1 0 67.9l34.6 34.6c18.7 18.7 49.1 18.7 67.9 0L529.9 116.5c18.7-18.7 18.7-49.1 0-67.9L495.3 14.1c-18.7-18.7-49.1-18.7-67.9 0L46.1 395.4zM484.6 82.6l-105 105-23.3-23.3 105-105 23.3 23.3zM7.5 117.2C3 118.9 0 123.2 0 128s3 9.1 7.5 10.8L64 160l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L128 160l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L128 96 106.8 39.5C105.1 35 100.8 32 96 32s-9.1 3-10.8 7.5L64 96 7.5 117.2zm352 256c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L416 416l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L480 416l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L480 352l-21.2-56.5c-1.7-4.5-6-7.5-10.8-7.5s-9.1 3-10.8 7.5L416 352l-56.5 21.2z"]
            }, uv = rl, u7 = {
              prefix: "fas",
              iconName: "e",
              icon: [320, 512, [101], "45", "M64 32C28.7 32 0 60.7 0 96V256 416c0 35.3 28.7 64 64 64H288c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V288H224c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V96H288c17.7 0 32-14.3 32-32s-14.3-32-32-32H64z"]
            }, y6 = {
              prefix: "fas",
              iconName: "pen-clip",
              icon: [512, 512, ["pen-alt"], "f305", "M453.3 19.3l39.4 39.4c25 25 25 65.5 0 90.5l-52.1 52.1 0 0-1-1 0 0-16-16-96-96-17-17 52.1-52.1c25-25 65.5-25 90.5 0zM241 114.9c-9.4-9.4-24.6-9.4-33.9 0L105 217c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L173.1 81c28.1-28.1 73.7-28.1 101.8 0L288 94.1l17 17 96 96 16 16 1 1-17 17L229.5 412.5c-48 48-109.2 80.8-175.8 94.1l-25 5c-7.9 1.6-16-.9-21.7-6.6s-8.1-13.8-6.6-21.7l5-25c13.3-66.6 46.1-127.8 94.1-175.8L254.1 128 241 114.9z"]
            }, Di = y6, Ki = {
              prefix: "fas",
              iconName: "bridge-circle-exclamation",
              icon: [640, 512, [], "e4ca", "M64 32C46.3 32 32 46.3 32 64s14.3 32 32 32h40v64H32V288c53 0 96 43 96 96v64c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V384c0-53 43-96 96-96c6.3 0 12.4 .6 18.3 1.7C367.1 231.8 426.9 192 496 192c42.5 0 81.6 15.1 112 40.2V160H536V96h40c17.7 0 32-14.3 32-32s-14.3-32-32-32H64zM488 96v64H408V96h80zM360 96v64H280V96h80zM232 96v64H152V96h80zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16v80c0 8.8-7.2 16-16 16s-16-7.2-16-16V288c0-8.8 7.2-16 16-16z"]
            }, wi = {
              prefix: "fas",
              iconName: "user",
              icon: [448, 512, [128100, 62144], "f007", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304H178.3z"]
            }, Za = {
              prefix: "fas",
              iconName: "school-circle-check",
              icon: [640, 512, [], "e56b", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96H48C21.5 96 0 117.5 0 144V464c0 26.5 21.5 48 48 48H320v0H256V416c0-35.3 28.7-64 64-64l.3 0h.5c3.4-37.7 18.7-72.1 42.2-99.1C350.2 260 335.6 264 320 264c-48.6 0-88-39.4-88-88s39.4-88 88-88s88 39.4 88 88c0 18.3-5.6 35.3-15.1 49.4c29-21 64.6-33.4 103.1-33.4c59.5 0 112.1 29.6 144 74.8V144c0-26.5-21.5-48-48-48H473.7L337.8 5.4zM96 192h32c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16V208c0-8.8 7.2-16 16-16zm0 128h32c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16V336c0-8.8 7.2-16 16-16zM320 128c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H336V144c0-8.8-7.2-16-16-16zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-99.3-43.3c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7z"]
            }, k6 = {
              prefix: "fas",
              iconName: "dumpster",
              icon: [576, 512, [], "f793", "M49.7 32c-10.5 0-19.8 6.9-22.9 16.9L.9 133c-.6 2-.9 4.1-.9 6.1C0 150.7 9.3 160 20.9 160h94L140.5 32H49.7zM272 160V32H173.1L147.5 160H272zm32 0H428.5L402.9 32H304V160zm157.1 0h94c11.5 0 20.9-9.3 20.9-20.9c0-2.1-.3-4.1-.9-6.1L549.2 48.9C546.1 38.9 536.8 32 526.3 32H435.5l25.6 128zM32 192l4 32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H44L64 448c0 17.7 14.3 32 32 32s32-14.3 32-32H448c0 17.7 14.3 32 32 32s32-14.3 32-32l20-160h12c17.7 0 32-14.3 32-32s-14.3-32-32-32h-4l4-32H32z"]
            }, Zc = {
              prefix: "fas",
              iconName: "van-shuttle",
              icon: [640, 512, [128656, "shuttle-van"], "f5b6", "M64 104v88h96V96H72c-4.4 0-8 3.6-8 8zm482 88L465.1 96H384v96H546zm-226 0V96H224v96h96zM592 384H576c0 53-43 96-96 96s-96-43-96-96H256c0 53-43 96-96 96s-96-43-96-96H48c-26.5 0-48-21.5-48-48V104C0 64.2 32.2 32 72 32H192 352 465.1c18.9 0 36.8 8.3 49 22.8L625 186.5c9.7 11.5 15 26.1 15 41.2V336c0 26.5-21.5 48-48 48zm-64 0a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM160 432a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
            }, Np = Zc, _c = {
              prefix: "fas",
              iconName: "building-user",
              icon: [640, 512, [], "e4da", "M48 0C21.5 0 0 21.5 0 48V464c0 26.5 21.5 48 48 48h96V432c0-26.5 21.5-48 48-48s48 21.5 48 48v80h89.9c-6.3-10.2-9.9-22.2-9.9-35.1c0-46.9 25.8-87.8 64-109.2V271.8 48c0-26.5-21.5-48-48-48H48zM64 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V240zm112-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V240zM80 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V112zM272 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zM576 272a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM352 477.1c0 19.3 15.6 34.9 34.9 34.9H605.1c19.3 0 34.9-15.6 34.9-34.9c0-51.4-41.7-93.1-93.1-93.1H445.1c-51.4 0-93.1 41.7-93.1 93.1z"]
            }, nu = {
              prefix: "fas",
              iconName: "square-caret-left",
              icon: [448, 512, ["caret-square-left"], "f191", "M0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416zM128 256c0-6.7 2.8-13 7.7-17.6l112-104c7-6.5 17.2-8.2 25.9-4.4s14.4 12.5 14.4 22l0 208c0 9.5-5.7 18.2-14.4 22s-18.9 2.1-25.9-4.4l-112-104c-4.9-4.5-7.7-10.9-7.7-17.6z"]
            }, sa = nu, Ar = {
              prefix: "fas",
              iconName: "highlighter",
              icon: [576, 512, [], "f591", "M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5l0 0V248.3c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5H224l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7H24c-13.3 0-24-10.7-24-24v-4.7c0-6.4 2.5-12.5 7-17z"]
            }, Zt = {
              prefix: "fas",
              iconName: "key",
              icon: [512, 512, [128273], "f084", "M336 352c97.2 0 176-78.8 176-176S433.2 0 336 0S160 78.8 160 176c0 18.7 2.9 36.8 8.3 53.7L7 391c-4.5 4.5-7 10.6-7 17v80c0 13.3 10.7 24 24 24h80c13.3 0 24-10.7 24-24V448h40c13.3 0 24-10.7 24-24V384h40c6.4 0 12.5-2.5 17-7l33.3-33.3c16.9 5.4 35 8.3 53.7 8.3zM376 96a40 40 0 1 1 0 80 40 40 0 1 1 0-80z"]
            }, Ln = {
              prefix: "fas",
              iconName: "bullhorn",
              icon: [512, 512, [128226, 128363], "f0a1", "M480 32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9L381.7 53c-48 48-113.1 75-181 75H192 160 64c-35.3 0-64 28.7-64 64v96c0 35.3 28.7 64 64 64l0 128c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32V352l8.7 0c67.9 0 133 27 181 75l43.6 43.6c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6V300.4c18.6-8.8 32-32.5 32-60.4s-13.4-51.6-32-60.4V32zm-64 76.7V240 371.3C357.2 317.8 280.5 288 200.7 288H192V192h8.7c79.8 0 156.5-29.8 215.3-83.3z"]
            }, qs = {
              prefix: "fas",
              iconName: "globe",
              icon: [512, 512, [127760], "f0ac", "M352 256c0 22.2-1.2 43.6-3.3 64H163.3c-2.2-20.4-3.3-41.8-3.3-64s1.2-43.6 3.3-64H348.7c2.2 20.4 3.3 41.8 3.3 64zm28.8-64H503.9c5.3 20.5 8.1 41.9 8.1 64s-2.8 43.5-8.1 64H380.8c2.1-20.6 3.2-42 3.2-64s-1.1-43.4-3.2-64zm112.6-32H376.7c-10-63.9-29.8-117.4-55.3-151.6c78.3 20.7 142 77.5 171.9 151.6zm-149.1 0H167.7c6.1-36.4 15.5-68.6 27-94.7c10.5-23.6 22.2-40.7 33.5-51.5C239.4 3.2 248.7 0 256 0s16.6 3.2 27.8 13.8c11.3 10.8 23 27.9 33.5 51.5c11.6 26 20.9 58.2 27 94.7zm-209 0H18.6C48.6 85.9 112.2 29.1 190.6 8.4C165.1 42.6 145.3 96.1 135.3 160zM8.1 192H131.2c-2.1 20.6-3.2 42-3.2 64s1.1 43.4 3.2 64H8.1C2.8 299.5 0 278.1 0 256s2.8-43.5 8.1-64zM194.7 446.6c-11.6-26-20.9-58.2-27-94.6H344.3c-6.1 36.4-15.5 68.6-27 94.6c-10.5 23.6-22.2 40.7-33.5 51.5C272.6 508.8 263.3 512 256 512s-16.6-3.2-27.8-13.8c-11.3-10.8-23-27.9-33.5-51.5zM135.3 352c10 63.9 29.8 117.4 55.3 151.6C112.2 482.9 48.6 426.1 18.6 352H135.3zm358.1 0c-30 74.1-93.6 130.9-171.9 151.6c25.5-34.2 45.2-87.7 55.3-151.6H493.4z"]
            }, Zf = {
              prefix: "fas",
              iconName: "synagogue",
              icon: [640, 512, [128333], "f69b", "M309.8 3.7c5.9-4.9 14.6-4.9 20.5 0l121 100.8C469.5 119.7 480 142.2 480 166V280.1 512H464 352V416c0-17.7-14.3-32-32-32s-32 14.3-32 32v96H176 160V280.1 166c0-23.7 10.5-46.3 28.8-61.5L309.8 3.7zM512 512V244.5l28.1-31.2c3-3.4 7.4-5.3 11.9-5.3s8.9 1.9 11.9 5.3l63.8 70.9c7.9 8.8 12.3 20.3 12.3 32.1V448c0 35.3-28.7 64-64 64H512zM128 244.5V512H64c-35.3 0-64-28.7-64-64V316.3c0-11.9 4.4-23.3 12.3-32.1l63.8-70.9c3-3.4 7.4-5.3 11.9-5.3s8.9 1.9 11.9 5.3L128 244.5zM327 124.3c-3.1-5.4-10.9-5.4-13.9 0l-15.9 28.1-32.3-.3c-6.2-.1-10.1 6.7-7 12.1L274.3 192l-16.4 27.8c-3.2 5.4 .7 12.1 7 12.1l32.3-.3L313 259.7c3.1 5.4 10.9 5.4 13.9 0l15.9-28.1 32.3 .3c6.2 .1 10.1-6.7 7-12.1L365.7 192l16.4-27.8c3.2-5.4-.7-12.1-7-12.1l-32.3 .3L327 124.3z"]
            }, iu = {
              prefix: "fas",
              iconName: "person-half-dress",
              icon: [320, 512, [], "e548", "M160 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm8 352V128h6.9c33.7 0 64.9 17.7 82.3 46.6l58.3 97c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9L232 256.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V352h0zM58.2 182.3c19.9-33.1 55.3-53.5 93.8-54.3V384h0v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V384H70.2c-10.9 0-18.6-10.7-15.2-21.1L93.3 248.1 59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l53.6-89.2z"]
            }, Ra = {
              prefix: "fas",
              iconName: "road-bridge",
              icon: [640, 512, [], "e563", "M352 0H608c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32H352c-17.7 0-32-14.3-32-32V32c0-17.7 14.3-32 32-32zM480 200c-13.3 0-24 10.7-24 24v64c0 13.3 10.7 24 24 24s24-10.7 24-24V224c0-13.3-10.7-24-24-24zm24 184c0-13.3-10.7-24-24-24s-24 10.7-24 24v64c0 13.3 10.7 24 24 24s24-10.7 24-24V384zM480 40c-13.3 0-24 10.7-24 24v64c0 13.3 10.7 24 24 24s24-10.7 24-24V64c0-13.3-10.7-24-24-24zM32 96H288v64H248v64h40v96c-53 0-96 43-96 96v64c0 17.7-14.3 32-32 32H128c-17.7 0-32-14.3-32-32V416c0-53-43-96-96-96V224H72V160H32c-17.7 0-32-14.3-32-32s14.3-32 32-32zm168 64H120v64h80V160z"]
            }, nl = {
              prefix: "fas",
              iconName: "location-arrow",
              icon: [448, 512, [], "f124", "M429.6 92.1c4.9-11.9 2.1-25.6-7-34.7s-22.8-11.9-34.7-7l-352 144c-14.2 5.8-22.2 20.8-19.3 35.8s16.1 25.8 31.4 25.8H224V432c0 15.3 10.8 28.4 25.8 31.4s30-5.1 35.8-19.3l144-352z"]
            }, su = {
              prefix: "fas",
              iconName: "c",
              icon: [384, 512, [99], "43", "M329.1 142.9c-62.5-62.5-155.8-62.5-218.3 0s-62.5 163.8 0 226.3s155.8 62.5 218.3 0c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3c-87.5 87.5-221.3 87.5-308.8 0s-87.5-229.3 0-316.8s221.3-87.5 308.8 0c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0z"]
            }, il = {
              prefix: "fas",
              iconName: "tablet-button",
              icon: [448, 512, [], "f10a", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM224 400a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, E6 = {
              prefix: "fas",
              iconName: "building-lock",
              icon: [576, 512, [], "e4d6", "M48 0C21.5 0 0 21.5 0 48V464c0 26.5 21.5 48 48 48h96V432c0-26.5 21.5-48 48-48s48 21.5 48 48v80h88.6c-5.4-9.4-8.6-20.3-8.6-32V352c0-23.7 12.9-44.4 32-55.4V272c0-30.5 12.2-58.2 32-78.4V48c0-26.5-21.5-48-48-48H48zM64 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V240zm112-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V240zM80 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V112zM272 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zM464 240c17.7 0 32 14.3 32 32v48H432V272c0-17.7 14.3-32 32-32zm-80 32v48c-17.7 0-32 14.3-32 32V480c0 17.7 14.3 32 32 32H544c17.7 0 32-14.3 32-32V352c0-17.7-14.3-32-32-32V272c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
            }, i6 = {
              prefix: "fas",
              iconName: "pizza-slice",
              icon: [512, 512, [], "f818", "M169.7 .9c-22.8-1.6-41.9 14-47.5 34.7L110.4 80c.5 0 1.1 0 1.6 0c176.7 0 320 143.3 320 320c0 .5 0 1.1 0 1.6l44.4-11.8c20.8-5.5 36.3-24.7 34.7-47.5C498.5 159.5 352.5 13.5 169.7 .9zM399.8 410.2c.1-3.4 .2-6.8 .2-10.2c0-159.1-128.9-288-288-288c-3.4 0-6.8 .1-10.2 .2L.5 491.9c-1.5 5.5 .1 11.4 4.1 15.4s9.9 5.6 15.4 4.1L399.8 410.2zM176 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM96 384a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, LA = {
              prefix: "fas",
              iconName: "money-bill-wave",
              icon: [576, 512, [], "f53a", "M0 112.5V422.3c0 18 10.1 35 27 41.3c87 32.5 174 10.3 261-11.9c79.8-20.3 159.6-40.7 239.3-18.9c23 6.3 48.7-9.5 48.7-33.4V89.7c0-18-10.1-35-27-41.3C462 15.9 375 38.1 288 60.3C208.2 80.6 128.4 100.9 48.7 79.1C25.6 72.8 0 88.6 0 112.5zM288 352c-44.2 0-80-43-80-96s35.8-96 80-96s80 43 80 96s-35.8 96-80 96zM64 352c35.3 0 64 28.7 64 64H64V352zm64-208c0 35.3-28.7 64-64 64V144h64zM512 304v64H448c0-35.3 28.7-64 64-64zM448 96h64v64c-35.3 0-64-28.7-64-64z"]
            }, au = {
              prefix: "fas",
              iconName: "chart-area",
              icon: [512, 512, ["area-chart"], "f1fe", "M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V400c0 44.2 35.8 80 80 80H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H80c-8.8 0-16-7.2-16-16V64zm96 288H448c17.7 0 32-14.3 32-32V251.8c0-7.6-2.7-15-7.7-20.8l-65.8-76.8c-12.1-14.2-33.7-15-46.9-1.8l-21 21c-10 10-26.4 9.2-35.4-1.6l-39.2-47c-12.6-15.1-35.7-15.4-48.7-.6L135.9 215c-5.1 5.8-7.9 13.3-7.9 21.1v84c0 17.7 14.3 32 32 32z"]
            }, lv = au, $c = {
              prefix: "fas",
              iconName: "house-flag",
              icon: [640, 512, [], "e50d", "M480 0c-17.7 0-32 14.3-32 32V192 512h64V192H624c8.8 0 16-7.2 16-16V48c0-8.8-7.2-16-16-16H512c0-17.7-14.3-32-32-32zM416 159L276.8 39.7c-12-10.3-29.7-10.3-41.7 0l-224 192C1 240.4-2.7 254.5 2 267.1S18.6 288 32 288H64V480c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32V384c0-17.7 14.3-32 32-32h64c17.7 0 32 14.3 32 32v96c0 17.7 14.3 32 32 32h64.7l.2 0h-1V159z"]
            }, Qp = {
              prefix: "fas",
              iconName: "person-circle-minus",
              icon: [576, 512, [], "e540", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V256.9L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6h29.7c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H152zm136 16a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm224 0c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16s7.2 16 16 16H496c8.8 0 16-7.2 16-16z"]
            }, e3 = {
              prefix: "fas",
              iconName: "ban",
              icon: [512, 512, [128683, "cancel"], "f05e", "M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
            }, t3 = e3, cA = {
              prefix: "fas",
              iconName: "camera-rotate",
              icon: [640, 512, [], "e0d8", "M213.1 64.8L202.7 96H128c-35.3 0-64 28.7-64 64V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H437.3L426.9 64.8C420.4 45.2 402.1 32 381.4 32H258.6c-20.7 0-39 13.2-45.5 32.8zM448 256c0 8.8-7.2 16-16 16H355.3c-6.2 0-11.3-5.1-11.3-11.3c0-3 1.2-5.9 3.3-8L371 229c-13.6-13.4-31.9-21-51-21c-19.2 0-37.7 7.6-51.3 21.3L249 249c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l19.7-19.7C257.4 172.7 288 160 320 160c31.8 0 62.4 12.6 85 35l23.7-23.7c2.1-2.1 5-3.3 8-3.3c6.2 0 11.3 5.1 11.3 11.3V256zM192 320c0-8.8 7.2-16 16-16h76.7c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8L269 347c13.6 13.4 31.9 21 51 21c19.2 0 37.7-7.6 51.3-21.3L391 327c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-19.7 19.7C382.6 403.3 352 416 320 416c-31.8 0-62.4-12.6-85-35l-23.7 23.7c-2.1 2.1-5 3.3-8 3.3c-6.2 0-11.3-5.1-11.3-11.3V320z"]
            }, _a = {
              prefix: "fas",
              iconName: "spray-can-sparkles",
              icon: [512, 512, ["air-freshener"], "f5d0", "M96 32v96H224V32c0-17.7-14.3-32-32-32H128C110.3 0 96 14.3 96 32zm0 128c-53 0-96 43-96 96V464c0 26.5 21.5 48 48 48H272c26.5 0 48-21.5 48-48V256c0-53-43-96-96-96H96zm64 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM384 48c0-1.4-1-3-2.2-3.6L352 32 339.6 2.2C339 1 337.4 0 336 0s-3 1-3.6 2.2L320 32 290.2 44.4C289 45 288 46.6 288 48c0 1.4 1 3 2.2 3.6L320 64l12.4 29.8C333 95 334.6 96 336 96s3-1 3.6-2.2L352 64l29.8-12.4C383 51 384 49.4 384 48zm76.4 45.8C461 95 462.6 96 464 96s3-1 3.6-2.2L480 64l29.8-12.4C511 51 512 49.4 512 48c0-1.4-1-3-2.2-3.6L480 32 467.6 2.2C467 1 465.4 0 464 0s-3 1-3.6 2.2L448 32 418.2 44.4C417 45 416 46.6 416 48c0 1.4 1 3 2.2 3.6L448 64l12.4 29.8zm7.2 100.4c-.6-1.2-2.2-2.2-3.6-2.2s-3 1-3.6 2.2L448 224l-29.8 12.4c-1.2 .6-2.2 2.2-2.2 3.6c0 1.4 1 3 2.2 3.6L448 256l12.4 29.8c.6 1.2 2.2 2.2 3.6 2.2s3-1 3.6-2.2L480 256l29.8-12.4c1.2-.6 2.2-2.2 2.2-3.6c0-1.4-1-3-2.2-3.6L480 224l-12.4-29.8zM448 144c0-1.4-1-3-2.2-3.6L416 128 403.6 98.2C403 97 401.4 96 400 96s-3 1-3.6 2.2L384 128l-29.8 12.4c-1.2 .6-2.2 2.2-2.2 3.6c0 1.4 1 3 2.2 3.6L384 160l12.4 29.8c.6 1.2 2.2 2.2 3.6 2.2s3-1 3.6-2.2L416 160l29.8-12.4c1.2-.6 2.2-2.2 2.2-3.6z"]
            }, Ig = _a, ba = {
              prefix: "fas",
              iconName: "star",
              icon: [576, 512, [11088, 61446], "f005", "M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"]
            }, KA = {
              prefix: "fas",
              iconName: "repeat",
              icon: [512, 512, [128257], "f363", "M0 224c0 17.7 14.3 32 32 32s32-14.3 32-32c0-53 43-96 96-96H320v32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9S320 19.1 320 32V64H160C71.6 64 0 135.6 0 224zm512 64c0-17.7-14.3-32-32-32s-32 14.3-32 32c0 53-43 96-96 96H192V352c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6V448H352c88.4 0 160-71.6 160-160z"]
            }, l7 = {
              prefix: "fas",
              iconName: "cross",
              icon: [384, 512, [128327, 10013], "f654", "M176 0c-26.5 0-48 21.5-48 48v80H48c-26.5 0-48 21.5-48 48v32c0 26.5 21.5 48 48 48h80V464c0 26.5 21.5 48 48 48h32c26.5 0 48-21.5 48-48V256h80c26.5 0 48-21.5 48-48V176c0-26.5-21.5-48-48-48H256V48c0-26.5-21.5-48-48-48H176z"]
            }, PP = {
              prefix: "fas",
              iconName: "box",
              icon: [448, 512, [128230], "f466", "M50.7 58.5L0 160H208V32H93.7C75.5 32 58.9 42.3 50.7 58.5zM240 160H448L397.3 58.5C389.1 42.3 372.5 32 354.3 32H240V160zm208 32H0V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192z"]
            }, pA = {
              prefix: "fas",
              iconName: "venus-mars",
              icon: [640, 512, [9892], "f228", "M176 288a112 112 0 1 0 0-224 112 112 0 1 0 0 224zM352 176c0 86.3-62.1 158.1-144 173.1V384h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H208v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448H112c-17.7 0-32-14.3-32-32s14.3-32 32-32h32V349.1C62.1 334.1 0 262.3 0 176C0 78.8 78.8 0 176 0s176 78.8 176 176zM271.9 360.6c19.3-10.1 36.9-23.1 52.1-38.4c20 18.5 46.7 29.8 76.1 29.8c61.9 0 112-50.1 112-112s-50.1-112-112-112c-7.2 0-14.3 .7-21.1 2c-4.9-21.5-13-41.7-24-60.2C369.3 66 384.4 64 400 64c37 0 71.4 11.4 99.8 31l20.6-20.6L487 41c-6.9-6.9-8.9-17.2-5.2-26.2S494.3 0 504 0H616c13.3 0 24 10.7 24 24V136c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-33.4-33.4L545 140.2c19.5 28.4 31 62.7 31 99.8c0 97.2-78.8 176-176 176c-50.5 0-96-21.3-128.1-55.4z"]
            }, Yp = {
              prefix: "fas",
              iconName: "arrow-pointer",
              icon: [320, 512, ["mouse-pointer"], "f245", "M0 55.2V426c0 12.2 9.9 22 22 22c6.3 0 12.4-2.7 16.6-7.5L121.2 346l58.1 116.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9L179.8 320H297.9c12.2 0 22.1-9.9 22.1-22.1c0-6.3-2.7-12.3-7.4-16.5L38.6 37.9C34.3 34.1 28.9 32 23.2 32C10.4 32 0 42.4 0 55.2z"]
            }, Mp = Yp, Lp = {
              prefix: "fas",
              iconName: "maximize",
              icon: [512, 512, ["expand-arrows-alt"], "f31e", "M200 32H56C42.7 32 32 42.7 32 56V200c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2l40-40 79 79-79 79L73 295c-6.9-6.9-17.2-8.9-26.2-5.2S32 302.3 32 312V456c0 13.3 10.7 24 24 24H200c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-40-40 79-79 79 79-40 40c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H456c13.3 0 24-10.7 24-24V312c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2l-40 40-79-79 79-79 40 40c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2V56c0-13.3-10.7-24-24-24H312c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l40 40-79 79-79-79 40-40c6.9-6.9 8.9-17.2 5.2-26.2S209.7 32 200 32z"]
            }, Kp = Lp, Rg = {
              prefix: "fas",
              iconName: "charging-station",
              icon: [576, 512, [], "f5e7", "M96 0C60.7 0 32 28.7 32 64V448c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32s-14.3-32-32-32V304h16c22.1 0 40 17.9 40 40v32c0 39.8 32.2 72 72 72s72-32.2 72-72V252.3c32.5-10.2 56-40.5 56-76.3V144c0-8.8-7.2-16-16-16H544V80c0-8.8-7.2-16-16-16s-16 7.2-16 16v48H480V80c0-8.8-7.2-16-16-16s-16 7.2-16 16v48H432c-8.8 0-16 7.2-16 16v32c0 35.8 23.5 66.1 56 76.3V376c0 13.3-10.7 24-24 24s-24-10.7-24-24V344c0-48.6-39.4-88-88-88H320V64c0-35.3-28.7-64-64-64H96zM216.9 82.7c6 4 8.5 11.5 6.3 18.3l-25 74.9H256c6.7 0 12.7 4.2 15 10.4s.5 13.3-4.6 17.7l-112 96c-5.5 4.7-13.4 5.1-19.3 1.1s-8.5-11.5-6.3-18.3l25-74.9H96c-6.7 0-12.7-4.2-15-10.4s-.5-13.3 4.6-17.7l112-96c5.5-4.7 13.4-5.1 19.3-1.1z"]
            }, sl = {
              prefix: "fas",
              iconName: "shapes",
              icon: [512, 512, ["triangle-circle-square"], "f61f", "M315.4 15.5C309.7 5.9 299.2 0 288 0s-21.7 5.9-27.4 15.5l-96 160c-5.9 9.9-6.1 22.2-.4 32.2s16.3 16.2 27.8 16.2H384c11.5 0 22.2-6.2 27.8-16.2s5.5-22.3-.4-32.2l-96-160zM288 312V456c0 22.1 17.9 40 40 40H472c22.1 0 40-17.9 40-40V312c0-22.1-17.9-40-40-40H328c-22.1 0-40 17.9-40 40zM128 512a128 128 0 1 0 0-256 128 128 0 1 0 0 256z"]
            }, Jp = sl, cP = {
              prefix: "fas",
              iconName: "shuffle",
              icon: [512, 512, [128256, "random"], "f074", "M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6V160H352c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96h32V64c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H96c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6V416H352c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H96c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8h32V320c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"]
            }, Hd = cP, s6 = {
              prefix: "fas",
              iconName: "person-running",
              icon: [448, 512, [127939, "running"], "f70c", "M320 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM125.7 175.5c9.9-9.9 23.4-15.5 37.5-15.5c1.9 0 3.8 .1 5.6 .3L137.6 254c-9.3 28 1.7 58.8 26.8 74.5l86.2 53.9-25.4 88.8c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l28.7-100.4c5.9-20.6-2.6-42.6-20.7-53.9L238 299l30.9-82.4 5.1 12.3C289 264.7 323.9 288 362.7 288H384c17.7 0 32-14.3 32-32s-14.3-32-32-32H362.7c-12.9 0-24.6-7.8-29.5-19.7l-6.3-15c-14.6-35.1-44.1-61.9-80.5-73.1l-48.7-15c-11.1-3.4-22.7-5.2-34.4-5.2c-31 0-60.8 12.3-82.7 34.3L57.4 153.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l23.1-23.1zM91.2 352H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h69.6c19 0 36.2-11.2 43.9-28.5L157 361.6l-9.5-6c-17.5-10.9-30.5-26.8-37.9-44.9L91.2 352z"]
            }, Uq = s6, Ma = {
              prefix: "fas",
              iconName: "mobile-retro",
              icon: [320, 512, [], "e527", "M0 64C0 28.7 28.7 0 64 0H256c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zm64 96v64c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V160c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32zM80 352a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 56a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm56-56a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 56a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm56-56a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 56a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM128 48c-8.8 0-16 7.2-16 16s7.2 16 16 16h64c8.8 0 16-7.2 16-16s-7.2-16-16-16H128z"]
            }, P7 = {
              prefix: "fas",
              iconName: "grip-lines-vertical",
              icon: [192, 512, [], "f7a5", "M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V448c0 17.7 14.3 32 32 32s32-14.3 32-32V64zm128 0c0-17.7-14.3-32-32-32s-32 14.3-32 32V448c0 17.7 14.3 32 32 32s32-14.3 32-32V64z"]
            }, c7 = {
              prefix: "fas",
              iconName: "spider",
              icon: [512, 512, [128375], "f717", "M158.4 32.6c4.8-12.4-1.4-26.3-13.8-31s-26.3 1.4-31 13.8L81.1 100c-7.9 20.7-3 44.1 12.7 59.7l57.4 57.4L70.8 190.3c-2.4-.8-4.3-2.7-5.1-5.1L46.8 128.4C42.6 115.8 29 109 16.4 113.2S-3 131 1.2 143.6l18.9 56.8c5.6 16.7 18.7 29.8 35.4 35.4L116.1 256 55.6 276.2c-16.7 5.6-29.8 18.7-35.4 35.4L1.2 368.4C-3 381 3.8 394.6 16.4 398.8s26.2-2.6 30.4-15.2l18.9-56.8c.8-2.4 2.7-4.3 5.1-5.1l80.4-26.8L93.7 352.3C78.1 368 73.1 391.4 81.1 412l32.5 84.6c4.8 12.4 18.6 18.5 31 13.8s18.5-18.6 13.8-31l-32.5-84.6c-1.1-3-.4-6.3 1.8-8.5L160 353.9c1 52.1 43.6 94.1 96 94.1s95-41.9 96-94.1l32.3 32.3c2.2 2.2 2.9 5.6 1.8 8.5l-32.5 84.6c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8L430.9 412c7.9-20.7 3-44.1-12.7-59.7l-57.4-57.4 80.4 26.8c2.4 .8 4.3 2.7 5.1 5.1l18.9 56.8c4.2 12.6 17.8 19.4 30.4 15.2s19.4-17.8 15.2-30.4l-18.9-56.8c-5.6-16.7-18.7-29.8-35.4-35.4L395.9 256l60.5-20.2c16.7-5.6 29.8-18.7 35.4-35.4l18.9-56.8c4.2-12.6-2.6-26.2-15.2-30.4s-26.2 2.6-30.4 15.2l-18.9 56.8c-.8 2.4-2.7 4.3-5.1 5.1l-80.4 26.8 57.4-57.4c15.6-15.6 20.6-39 12.7-59.7L398.4 15.4C393.6 3 379.8-3.2 367.4 1.6s-18.5 18.6-13.8 31l32.5 84.6c1.1 3 .4 6.3-1.8 8.5L336 174.1V160c0-31.8-18.6-59.3-45.5-72.2c-9.1-4.4-18.5 3.3-18.5 13.4V112c0 8.8-7.2 16-16 16s-16-7.2-16-16V101.2c0-10.1-9.4-17.7-18.5-13.4C194.6 100.7 176 128.2 176 160v14.1l-48.3-48.3c-2.2-2.2-2.9-5.6-1.8-8.5l32.5-84.6z"]
            }, V1 = {
              prefix: "fas",
              iconName: "hands-bound",
              icon: [640, 512, [], "e4f9", "M96 32C96 14.3 81.7 0 64 0S32 14.3 32 32V96v59.1 .7V192v21.9c0 14.2 5.1 27.9 14.3 38.7L131.6 352H128c-13.3 0-24 10.7-24 24s10.7 24 24 24h32H288h64H480h32c13.3 0 24-10.7 24-24s-10.7-24-24-24h-3.6l85.3-99.5c9.2-10.8 14.3-24.5 14.3-38.7V192 155.8v-.7V96 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V96v48.8l-69.3 92.4c-5.7 7.6-16.1 9.6-24.2 4.8c-9.7-5.7-12.1-18.7-5.1-27.5L473 180c10.8-13.5 8.9-33.3-4.4-44.5s-33-9.8-44.5 3.2l-46.7 52.5C361 209.7 352 233.4 352 258.1V320v32H288V320 258.1c0-24.6-9-48.4-25.4-66.8l-46.7-52.5c-11.5-13-31.3-14.4-44.5-3.2s-15.2 30.9-4.4 44.5l27.6 34.5c7 8.8 4.7 21.8-5.1 27.5c-8.1 4.8-18.6 2.7-24.2-4.8L96 144.8V96 32zm64 448v32H288V480h64v32H480V480h32c13.3 0 24-10.7 24-24s-10.7-24-24-24H480 352 288 160 128c-13.3 0-24 10.7-24 24s10.7 24 24 24h32z"]
            }, gd = {
              prefix: "fas",
              iconName: "file-invoice-dollar",
              icon: [384, 512, [], "f571", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM64 80c0-8.8 7.2-16 16-16h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16zm128 72c8.8 0 16 7.2 16 16v17.3c8.5 1.2 16.7 3.1 24.1 5.1c8.5 2.3 13.6 11 11.3 19.6s-11 13.6-19.6 11.3c-11.1-3-22-5.2-32.1-5.3c-8.4-.1-17.4 1.8-23.6 5.5c-5.7 3.4-8.1 7.3-8.1 12.8c0 3.7 1.3 6.5 7.3 10.1c6.9 4.1 16.6 7.1 29.2 10.9l.5 .1 0 0 0 0c11.3 3.4 25.3 7.6 36.3 14.6c12.1 7.6 22.4 19.7 22.7 38.2c.3 19.3-9.6 33.3-22.9 41.6c-7.7 4.8-16.4 7.6-25.1 9.1V440c0 8.8-7.2 16-16 16s-16-7.2-16-16V422.2c-11.2-2.1-21.7-5.7-30.9-8.9l0 0c-2.1-.7-4.2-1.4-6.2-2.1c-8.4-2.8-12.9-11.9-10.1-20.2s11.9-12.9 20.2-10.1c2.5 .8 4.8 1.6 7.1 2.4l0 0 0 0 0 0c13.6 4.6 24.6 8.4 36.3 8.7c9.1 .3 17.9-1.7 23.7-5.3c5.1-3.2 7.9-7.3 7.8-14c-.1-4.6-1.8-7.8-7.7-11.6c-6.8-4.3-16.5-7.4-29-11.2l-1.6-.5 0 0c-11-3.3-24.3-7.3-34.8-13.7c-12-7.2-22.6-18.9-22.7-37.3c-.1-19.4 10.8-32.8 23.8-40.5c7.5-4.4 15.8-7.2 24.1-8.7V232c0-8.8 7.2-16 16-16z"]
            }, X4 = {
              prefix: "fas",
              iconName: "plane-circle-exclamation",
              icon: [640, 512, [], "e556", "M256 0c-35 0-64 59.5-64 93.7v84.6L8.1 283.4c-5 2.8-8.1 8.2-8.1 13.9v65.5c0 10.6 10.2 18.3 20.4 15.4l171.6-49 0 70.9-57.6 43.2c-4 3-6.4 7.8-6.4 12.8v42c0 7.8 6.3 14 14 14c1.3 0 2.6-.2 3.9-.5L256 480l110.1 31.5c1.3 .4 2.6 .5 3.9 .5c6 0 11.1-3.7 13.1-9C344.5 470.7 320 422.2 320 368c0-60.6 30.6-114 77.1-145.6L320 178.3V93.7C320 59.5 292 0 256 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16v80c0 8.8-7.2 16-16 16s-16-7.2-16-16V288c0-8.8 7.2-16 16-16z"]
            }, nf = {
              prefix: "fas",
              iconName: "x-ray",
              icon: [512, 512, [], "f497", "M0 64C0 46.3 14.3 32 32 32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32V416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32V96C14.3 96 0 81.7 0 64zM256 96c-8.8 0-16 7.2-16 16v32H160c-8.8 0-16 7.2-16 16s7.2 16 16 16h80v48H128c-8.8 0-16 7.2-16 16s7.2 16 16 16H240v70.6L189.1 307c-5.2-2-10.6-3-16.2-3h-2.1c-23.6 0-42.8 19.2-42.8 42.8c0 9.6 3.2 18.9 9.1 26.4l18.2 23.2c9.7 12.4 24.6 19.6 40.3 19.6H316.4c15.7 0 30.6-7.2 40.3-19.6l18.2-23.2c5.9-7.5 9.1-16.8 9.1-26.4c0-23.6-19.2-42.8-42.8-42.8H339c-5.5 0-11 1-16.2 3L272 326.6V256H384c8.8 0 16-7.2 16-16s-7.2-16-16-16H272V176h80c8.8 0 16-7.2 16-16s-7.2-16-16-16H272V112c0-8.8-7.2-16-16-16zM208 352a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm80 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
            }, pP = {
              prefix: "fas",
              iconName: "spell-check",
              icon: [576, 512, [], "f891", "M112 0C99.1 0 87.4 7.8 82.5 19.7l-66.7 160-13.3 32c-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2L66.7 224h90.7l5.1 12.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8l-13.3-32-66.7-160C136.6 7.8 124.9 0 112 0zm18.7 160H93.3L112 115.2 130.7 160zM256 32v96 96c0 17.7 14.3 32 32 32h80c44.2 0 80-35.8 80-80c0-23.1-9.8-43.8-25.4-58.4c6-11.2 9.4-24 9.4-37.6c0-44.2-35.8-80-80-80H288c-17.7 0-32 14.3-32 32zm96 64H320V64h32c8.8 0 16 7.2 16 16s-7.2 16-16 16zm-32 64h32 16c8.8 0 16 7.2 16 16s-7.2 16-16 16H320V160zM566.6 310.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L352 434.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l192-192z"]
            }, ca = {
              prefix: "fas",
              iconName: "slash",
              icon: [640, 512, [], "f715", "M5.1 9.2C13.3-1.2 28.4-3.1 38.8 5.1l592 464c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2z"]
            }, hP = {
              prefix: "fas",
              iconName: "computer-mouse",
              icon: [384, 512, [128433, "mouse"], "f8cc", "M0 192H176V0H160C71.6 0 0 71.6 0 160v32zm0 32V352c0 88.4 71.6 160 160 160h64c88.4 0 160-71.6 160-160V224H192 0zm384-32V160C384 71.6 312.4 0 224 0H208V192H384z"]
            }, zp = hP, r3 = {
              prefix: "fas",
              iconName: "arrow-right-to-bracket",
              icon: [512, 512, ["sign-in"], "f090", "M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]
            }, n3 = r3, Gp = {
              prefix: "fas",
              iconName: "shop-slash",
              icon: [640, 512, ["store-alt-slash"], "e070", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-54.8-43V224H512V376L384 275.7V224H320v1.5L277.2 192H603.2c20.3 0 36.8-16.5 36.8-36.8c0-7.3-2.2-14.4-6.2-20.4L558.2 21.4C549.3 8 534.4 0 518.3 0H121.7c-16 0-31 8-39.9 21.4L74.1 32.8 38.8 5.1zM36.8 192h85L21 112.5 6.2 134.7c-4 6.1-6.2 13.2-6.2 20.4C0 175.5 16.5 192 36.8 192zM320 384H128V224H64V384v80c0 26.5 21.5 48 48 48H336c26.5 0 48-21.5 48-48V398.5l-64-50.4V384z"]
            }, T4 = Gp, i3 = {
              prefix: "fas",
              iconName: "server",
              icon: [512, 512, [], "f233", "M64 32C28.7 32 0 60.7 0 96v64c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm280 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm48 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM64 288c-35.3 0-64 28.7-64 64v64c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V352c0-35.3-28.7-64-64-64H64zm280 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm56 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
            }, q4 = {
              prefix: "fas",
              iconName: "virus-covid-slash",
              icon: [640, 512, [], "e4a9", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c11.4-19.5 19.1-41.4 22.3-64.7H528v16c0 13.3 10.7 24 24 24s24-10.7 24-24V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v16H494.4c-4.2-30.7-16.3-58.8-34.1-82.3L484 125.9l11.3 11.3c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L472.7 46.7c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9L450.1 92l-23.8 23.8C402.8 97.9 374.7 85.8 344 81.6V48h16c13.3 0 24-10.7 24-24s-10.7-24-24-24H280c-13.3 0-24 10.7-24 24s10.7 24 24 24h16V81.6c-30.7 4.2-58.8 16.3-82.3 34.1L189.9 92l11.3-11.3c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L134.1 79.8 38.8 5.1zM149.2 213.5c-1.5 6-2.7 12.2-3.5 18.5H112V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v80c0 13.3 10.7 24 24 24s24-10.7 24-24V280h33.6c4.2 30.7 16.3 58.8 34.1 82.3L156 386.1l-11.3-11.3c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l56.6 56.6c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L189.9 420l23.8-23.8c23.5 17.9 51.7 29.9 82.3 34.1V464H280c-13.3 0-24 10.7-24 24s10.7 24 24 24h80c13.3 0 24-10.7 24-24s-10.7-24-24-24H344V430.4c20.4-2.8 39.7-9.1 57.3-18.2L149.2 213.5z"]
            }, Vg = {
              prefix: "fas",
              iconName: "shop-lock",
              icon: [640, 512, [], "e4a5", "M36.8 192H449.6c20.2-19.8 47.9-32 78.4-32c30.5 0 58.1 12.2 78.3 31.9c18.9-1.6 33.7-17.4 33.7-36.7c0-7.3-2.2-14.4-6.2-20.4L558.2 21.4C549.3 8 534.4 0 518.3 0H121.7c-16 0-31 8-39.9 21.4L6.2 134.7c-4 6.1-6.2 13.2-6.2 20.4C0 175.5 16.5 192 36.8 192zM384 224H320V384H128V224H64V384v80c0 26.5 21.5 48 48 48H336c26.5 0 48-21.5 48-48V384 352 224zm144 16c17.7 0 32 14.3 32 32v48H496V272c0-17.7 14.3-32 32-32zm-80 32v48c-17.7 0-32 14.3-32 32V480c0 17.7 14.3 32 32 32H608c17.7 0 32-14.3 32-32V352c0-17.7-14.3-32-32-32V272c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
            }, Zp = {
              prefix: "fas",
              iconName: "hourglass-start",
              icon: [384, 512, ["hourglass-1"], "f251", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64V75c0 42.4 16.9 83.1 46.9 113.1L146.7 256 78.9 323.9C48.9 353.9 32 394.6 32 437v11c-17.7 0-32 14.3-32 32s14.3 32 32 32H64 320h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V437c0-42.4-16.9-83.1-46.9-113.1L237.3 256l67.9-67.9c30-30 46.9-70.7 46.9-113.1V64c17.7 0 32-14.3 32-32s-14.3-32-32-32H320 64 32zM288 437v11H96V437c0-25.5 10.1-49.9 28.1-67.9L192 301.3l67.9 67.9c18 18 28.1 42.4 28.1 67.9z"]
            }, Iq = Zp, C1 = {
              prefix: "fas",
              iconName: "blender-phone",
              icon: [576, 512, [], "f6b6", "M224 352L196.8 52.3C194.2 24.2 216.3 0 244.6 0H534.1c21.1 0 36.4 20.1 30.9 40.4L558.5 64H400c-8.8 0-16 7.2-16 16s7.2 16 16 16H549.8l-17.5 64H400c-8.8 0-16 7.2-16 16s7.2 16 16 16H523.6l-17.5 64H400c-8.8 0-16 7.2-16 16s7.2 16 16 16h97.5L480 352H224zm-16 32H496c26.5 0 48 21.5 48 48v32c0 26.5-21.5 48-48 48H208c-26.5 0-48-21.5-48-48V432c0-26.5 21.5-48 48-48zm144 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM147.5 30.7c10.8 6.7 15.3 21 10.6 33.4l-22 57.8c-4.2 10.9-14.5 17.6-25.3 16.4l-33.3-3.6c-13.6 42.2-13.6 88.4 0 130.7l33.3-3.6c10.9-1.2 21.2 5.5 25.3 16.4l22 57.8c4.7 12.4 .2 26.7-10.6 33.4l-44 27.2c-9.7 6-21.9 4.2-29.8-4.3C-24.6 286-24.6 114 73.7 7.8C81.6-.7 93.8-2.5 103.5 3.5l44 27.2z"]
            }, O1 = {
              prefix: "fas",
              iconName: "building-wheat",
              icon: [640, 512, [], "e4db", "M0 48C0 21.5 21.5 0 48 0H336c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H240V432c0-26.5-21.5-48-48-48s-48 21.5-48 48v80H48c-26.5 0-48-21.5-48-48V48zM80 224c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H80zm80 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H176c-8.8 0-16 7.2-16 16zm112-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H272zM64 112v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zM176 96c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H176zm80 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H272c-8.8 0-16 7.2-16 16zm384 80v16c0 44.2-35.8 80-80 80H544V272c0-44.2 35.8-80 80-80h16zm0 128c0 44.2-35.8 80-80 80H544V384c0-44.2 35.8-80 80-80h16v16zm0 112c0 44.2-35.8 80-80 80H544V496c0-44.2 35.8-80 80-80h16v16zM512 496v16H496c-44.2 0-80-35.8-80-80V416h16c44.2 0 80 35.8 80 80zm0-96H496c-44.2 0-80-35.8-80-80V304h16c44.2 0 80 35.8 80 80v16zm0-128v16H496c-44.2 0-80-35.8-80-80V192h16c44.2 0 80 35.8 80 80zM528 32c13.3 0 24 10.7 24 24V160c0 13.3-10.7 24-24 24s-24-10.7-24-24V56c0-13.3 10.7-24 24-24zm96 64v32c0 13.3-10.7 24-24 24s-24-10.7-24-24V96c0-13.3 10.7-24 24-24s24 10.7 24 24zM456 72c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24s-24-10.7-24-24V96c0-13.3 10.7-24 24-24z"]
            }, al = {
              prefix: "fas",
              iconName: "person-breastfeeding",
              icon: [448, 512, [], "e53a", "M224 0a80 80 0 1 1 0 160A80 80 0 1 1 224 0zM436.8 382.8L373.5 462c-16.6 20.7-46.8 24.1-67.5 7.5c-17.6-14.1-22.7-38.1-13.5-57.7l-.8-.1c-38.9-5.6-74.3-25.1-99.7-54.8V320c0-17.7-14.3-32-32-32s-32 14.3-32 32v48c0 .8 0 1.6 .1 2.4l101.4 50.7c23.7 11.9 33.3 40.7 21.5 64.4s-40.7 33.3-64.4 21.5L27.2 427.3c-1.1-.5-2.2-1.1-3.3-1.7c-4.9-2.8-9.2-6.4-12.6-10.6c-4.6-5.4-7.8-11.7-9.6-18.4c-3.3-12-1.9-25.2 4.8-36.6c.6-1.1 1.3-2.2 2-3.2L75.6 256.1c26.7-40.1 71.7-64.1 119.8-64.1h75.2c46.5 0 90.1 22.5 117.2 60.3l50.7 70.9c2.2 3 4 6.1 5.5 9.4c2.9 6.7 4.3 13.8 4 20.8c-.3 10.6-4.2 21-11.2 29.4zM320 332a44 44 0 1 0 -88 0 44 44 0 1 0 88 0z"]
            }, _p = {
              prefix: "fas",
              iconName: "right-to-bracket",
              icon: [512, 512, ["sign-in-alt"], "f2f6", "M217.9 105.9L340.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L217.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1L32 320c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM352 416l64 0c17.7 0 32-14.3 32-32l0-256c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c53 0 96 43 96 96l0 256c0 53-43 96-96 96l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, F6 = _p, HP = {
              prefix: "fas",
              iconName: "venus",
              icon: [384, 512, [9792], "f221", "M80 176a112 112 0 1 1 224 0A112 112 0 1 1 80 176zM224 349.1c81.9-15 144-86.8 144-173.1C368 78.8 289.2 0 192 0S16 78.8 16 176c0 86.3 62.1 158.1 144 173.1V384H128c-17.7 0-32 14.3-32 32s14.3 32 32 32h32v32c0 17.7 14.3 32 32 32s32-14.3 32-32V448h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H224V349.1z"]
            }, ts = {
              prefix: "fas",
              iconName: "passport",
              icon: [448, 512, [], "f5ab", "M0 64C0 28.7 28.7 0 64 0H384c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM183 278.8c-27.9-13.2-48.4-39.4-53.7-70.8h39.1c1.6 30.4 7.7 53.8 14.6 70.8zm41.3 9.2l-.3 0-.3 0c-2.4-3.5-5.7-8.9-9.1-16.5c-6-13.6-12.4-34.3-14.2-63.5h47.1c-1.8 29.2-8.1 49.9-14.2 63.5c-3.4 7.6-6.7 13-9.1 16.5zm40.7-9.2c6.8-17.1 12.9-40.4 14.6-70.8h39.1c-5.3 31.4-25.8 57.6-53.7 70.8zM279.6 176c-1.6-30.4-7.7-53.8-14.6-70.8c27.9 13.2 48.4 39.4 53.7 70.8H279.6zM223.7 96l.3 0 .3 0c2.4 3.5 5.7 8.9 9.1 16.5c6 13.6 12.4 34.3 14.2 63.5H200.5c1.8-29.2 8.1-49.9 14.2-63.5c3.4-7.6 6.7-13 9.1-16.5zM183 105.2c-6.8 17.1-12.9 40.4-14.6 70.8H129.3c5.3-31.4 25.8-57.6 53.7-70.8zM352 192A128 128 0 1 0 96 192a128 128 0 1 0 256 0zM112 384c-8.8 0-16 7.2-16 16s7.2 16 16 16H336c8.8 0 16-7.2 16-16s-7.2-16-16-16H112z"]
            }, ou = {
              prefix: "fas",
              iconName: "heart-pulse",
              icon: [512, 512, ["heartbeat"], "f21e", "M228.3 469.1L47.6 300.4c-4.2-3.9-8.2-8.1-11.9-12.4h87c22.6 0 43-13.6 51.7-34.5l10.5-25.2 49.3 109.5c3.8 8.5 12.1 14 21.4 14.1s17.8-5 22-13.3L320 253.7l1.7 3.4c9.5 19 28.9 31 50.1 31H476.3c-3.7 4.3-7.7 8.5-11.9 12.4L283.7 469.1c-7.5 7-17.4 10.9-27.7 10.9s-20.2-3.9-27.7-10.9zM503.7 240h-132c-3 0-5.8-1.7-7.2-4.4l-23.2-46.3c-4.1-8.1-12.4-13.3-21.5-13.3s-17.4 5.1-21.5 13.3l-41.4 82.8L205.9 158.2c-3.9-8.7-12.7-14.3-22.2-14.1s-18.1 5.9-21.8 14.8l-31.8 76.3c-1.2 3-4.2 4.9-7.4 4.9H16c-2.6 0-5 .4-7.3 1.1C3 225.2 0 208.2 0 190.9v-5.8c0-69.9 50.5-129.5 119.4-141C165 36.5 211.4 51.4 244 84l12 12 12-12c32.6-32.6 79-47.5 124.6-39.9C461.5 55.6 512 115.2 512 185.1v5.8c0 16.9-2.8 33.5-8.3 49.1z"]
            }, p7 = ou, Cg = {
              prefix: "fas",
              iconName: "people-carry-box",
              icon: [640, 512, ["people-carry"], "f4ce", "M80 48a48 48 0 1 1 96 0A48 48 0 1 1 80 48zm64 193.7v65.1l51 51c7.1 7.1 11.8 16.2 13.4 26.1l15.2 90.9c2.9 17.4-8.9 33.9-26.3 36.8s-33.9-8.9-36.8-26.3l-14.3-85.9L66.8 320C54.8 308 48 291.7 48 274.7V186.6c0-32.4 26.2-58.6 58.6-58.6c24.1 0 46.5 12 59.9 32l47.4 71.1 10.1 5V160c0-17.7 14.3-32 32-32H384c17.7 0 32 14.3 32 32v76.2l10.1-5L473.5 160c13.3-20 35.8-32 59.9-32c32.4 0 58.6 26.2 58.6 58.6v88.1c0 17-6.7 33.3-18.7 45.3l-79.4 79.4-14.3 85.9c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8l15.2-90.9c1.6-9.9 6.3-19 13.4-26.1l51-51V241.7l-19 28.5c-4.6 7-11 12.6-18.5 16.3l-59.6 29.8c-2.4 1.3-4.9 2.2-7.6 2.8c-2.6 .6-5.3 .9-7.9 .8H256.7c-2.5 .1-5-.2-7.5-.7c-2.9-.6-5.6-1.6-8.1-3l-59.5-29.8c-7.5-3.7-13.8-9.4-18.5-16.3l-19-28.5zM2.3 468.1L50.1 348.6l49.2 49.2-37.6 94c-6.6 16.4-25.2 24.4-41.6 17.8S-4.3 484.5 2.3 468.1zM512 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm77.9 348.6l47.8 119.5c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8l-37.6-94 49.2-49.2z"]
            }, b4 = Cg, h7 = {
              prefix: "fas",
              iconName: "temperature-high",
              icon: [512, 512, [], "f769", "M416 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 128A96 96 0 1 0 416 0a96 96 0 1 0 0 192zM96 112c0-26.5 21.5-48 48-48s48 21.5 48 48V276.5c0 17.3 7.1 31.9 15.3 42.5C217.8 332.6 224 349.5 224 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9C88.9 308.4 96 293.8 96 276.5V112zM144 0C82.1 0 32 50.2 32 112V276.5c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C11.2 304.2 0 334.8 0 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6V112C256 50.2 205.9 0 144 0zm0 416c26.5 0 48-21.5 48-48c0-20.9-13.4-38.7-32-45.3V112c0-8.8-7.2-16-16-16s-16 7.2-16 16V322.7c-18.6 6.6-32 24.4-32 45.3c0 26.5 21.5 48 48 48z"]
            }, gP = {
              prefix: "fas",
              iconName: "microchip",
              icon: [512, 512, [], "f2db", "M176 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64c-35.3 0-64 28.7-64 64H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H64v56H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H64v56H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H64c0 35.3 28.7 64 64 64v40c0 13.3 10.7 24 24 24s24-10.7 24-24V448h56v40c0 13.3 10.7 24 24 24s24-10.7 24-24V448h56v40c0 13.3 10.7 24 24 24s24-10.7 24-24V448c35.3 0 64-28.7 64-64h40c13.3 0 24-10.7 24-24s-10.7-24-24-24H448V280h40c13.3 0 24-10.7 24-24s-10.7-24-24-24H448V176h40c13.3 0 24-10.7 24-24s-10.7-24-24-24H448c0-35.3-28.7-64-64-64V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H280V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H176V24zM160 128H352c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H160c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32zm192 32H160V352H352V160z"]
            }, $p = {
              prefix: "fas",
              iconName: "crown",
              icon: [576, 512, [128081], "f521", "M309 106c11.4-7 19-19.7 19-34c0-22.1-17.9-40-40-40s-40 17.9-40 40c0 14.4 7.6 27 19 34L209.7 220.6c-9.1 18.2-32.7 23.4-48.6 10.7L72 160c5-6.7 8-15 8-24c0-22.1-17.9-40-40-40S0 113.9 0 136s17.9 40 40 40c.2 0 .5 0 .7 0L86.4 427.4c5.5 30.4 32 52.6 63 52.6H426.6c30.9 0 57.4-22.1 63-52.6L535.3 176c.2 0 .5 0 .7 0c22.1 0 40-17.9 40-40s-17.9-40-40-40s-40 17.9-40 40c0 9 3 17.3 8 24l-89.1 71.3c-15.9 12.7-39.5 7.5-48.6-10.7L309 106z"]
            }, eh = {
              prefix: "fas",
              iconName: "weight-hanging",
              icon: [512, 512, [], "f5cd", "M224 96a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm122.5 32c3.5-10 5.5-20.8 5.5-32c0-53-43-96-96-96s-96 43-96 96c0 11.2 1.9 22 5.5 32H120c-22 0-41.2 15-46.6 36.4l-72 288c-3.6 14.3-.4 29.5 8.7 41.2S33.2 512 48 512H464c14.8 0 28.7-6.8 37.8-18.5s12.3-26.8 8.7-41.2l-72-288C433.2 143 414 128 392 128H346.5z"]
            }, Og = {
              prefix: "fas",
              iconName: "xmarks-lines",
              icon: [640, 512, [], "e59a", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zm0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM7 167c-9.4 9.4-9.4 24.6 0 33.9l55 55L7 311c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55L41 167c-9.4-9.4-24.6-9.4-33.9 0zM265 167c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55zM455 167c-9.4 9.4-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55c-9.4-9.4-24.6-9.4-33.9 0z"]
            }, s3 = {
              prefix: "fas",
              iconName: "file-prescription",
              icon: [384, 512, [], "f572", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM104 196h72c33.1 0 60 26.9 60 60c0 25.5-15.9 47.2-38.3 55.9l43 40.3 33.8-31c8.1-7.5 20.8-6.9 28.3 1.2s6.9 20.8-1.2 28.3L270 379.7l31.7 29.7c8.1 7.6 8.5 20.2 .9 28.3s-20.2 8.5-28.3 .9l-33.9-31.8-34.9 32c-8.1 7.5-20.8 6.9-28.3-1.2s-6.9-20.8 1.2-28.3l32.6-29.9-64.8-60.8c-.9-.8-1.6-1.7-2.3-2.6H124v44c0 11-9 20-20 20s-20-9-20-20V296 216c0-11 9-20 20-20zm72 80c11 0 20-9 20-20s-9-20-20-20H124v40h52z"]
            }, x4 = {
              prefix: "fas",
              iconName: "weight-scale",
              icon: [512, 512, ["weight"], "f496", "M128 176a128 128 0 1 1 256 0 128 128 0 1 1 -256 0zM391.8 64C359.5 24.9 310.7 0 256 0S152.5 24.9 120.2 64H64C28.7 64 0 92.7 0 128V448c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H391.8zM296 224c0-10.6-4.1-20.2-10.9-27.4l33.6-78.3c3.5-8.1-.3-17.5-8.4-21s-17.5 .3-21 8.4L255.7 184c-22 .1-39.7 18-39.7 40c0 22.1 17.9 40 40 40s40-17.9 40-40z"]
            }, yg = x4, fu = {
              prefix: "fas",
              iconName: "user-group",
              icon: [640, 512, [128101, "user-friends"], "f500", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3zM609.3 512H471.4c5.4-9.4 8.6-20.3 8.6-32v-8c0-60.7-27.1-115.2-69.8-151.8c2.4-.1 4.7-.2 7.1-.2h61.4C567.8 320 640 392.2 640 481.3c0 17-13.8 30.7-30.7 30.7zM432 256c-31 0-59-12.6-79.3-32.9C372.4 196.5 384 163.6 384 128c0-26.8-6.6-52.1-18.3-74.3C384.3 40.1 407.2 32 432 32c61.9 0 112 50.1 112 112s-50.1 112-112 112z"]
            }, th = fu, H1 = {
              prefix: "fas",
              iconName: "arrow-up-a-z",
              icon: [576, 512, ["sort-alpha-up"], "f15e", "M183.6 42.4C177.5 35.8 169 32 160 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L128 146.3V448c0 17.7 14.3 32 32 32s32-14.3 32-32V146.3l32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 320c0 17.7 14.3 32 32 32h50.7l-73.4 73.4c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H429.3l73.4-73.4c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8H352c-17.7 0-32 14.3-32 32zM416 32c-12.1 0-23.2 6.8-28.6 17.7l-64 128-16 32c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l7.2-14.3h88.4l7.2 14.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9l-16-32-64-128C439.2 38.8 428.1 32 416 32zM395.8 176L416 135.6 436.2 176H395.8z"]
            }, _f = H1, Au = {
              prefix: "fas",
              iconName: "chess-knight",
              icon: [448, 512, [9822], "f441", "M96 48L82.7 61.3C70.7 73.3 64 89.5 64 106.5V238.9c0 10.7 5.3 20.7 14.2 26.6l10.6 7c14.3 9.6 32.7 10.7 48.1 3l3.2-1.6c2.6-1.3 5-2.8 7.3-4.5l49.4-37c6.6-5 15.7-5 22.3 0c10.2 7.7 9.9 23.1-.7 30.3L90.4 350C73.9 361.3 64 380 64 400H384l28.9-159c2.1-11.3 3.1-22.8 3.1-34.3V192C416 86 330 0 224 0H83.8C72.9 0 64 8.9 64 19.8c0 7.5 4.2 14.3 10.9 17.7L96 48zm24 68a20 20 0 1 1 40 0 20 20 0 1 1 -40 0zM22.6 473.4c-4.2 4.2-6.6 10-6.6 16C16 501.9 26.1 512 38.6 512H409.4c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L384 432H64L22.6 473.4z"]
            }, XP = {
              prefix: "fas",
              iconName: "face-laugh-squint",
              icon: [512, 512, ["laugh-squint"], "f59b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1H393.6c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zm36.7-199.4l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 125.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
            }, ol = XP, a6 = {
              prefix: "fas",
              iconName: "wheelchair",
              icon: [512, 512, [], "f193", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM120.5 247.2c12.4-4.7 18.7-18.5 14-30.9s-18.5-18.7-30.9-14C43.1 225.1 0 283.5 0 352c0 88.4 71.6 160 160 160c61.2 0 114.3-34.3 141.2-84.7c6.2-11.7 1.8-26.2-9.9-32.5s-26.2-1.8-32.5 9.9C240 440 202.8 464 160 464C98.1 464 48 413.9 48 352c0-47.9 30.1-88.8 72.5-104.8zM259.8 176l-1.9-9.7c-4.5-22.3-24-38.3-46.8-38.3c-30.1 0-52.7 27.5-46.8 57l23.1 115.5c6 29.9 32.2 51.4 62.8 51.4h5.1c.4 0 .8 0 1.3 0h94.1c6.7 0 12.6 4.1 15 10.4L402 459.2c6 16.1 23.8 24.6 40.1 19.1l48-16c16.8-5.6 25.8-23.7 20.2-40.5s-23.7-25.8-40.5-20.2l-18.7 6.2-25.5-68c-11.7-31.2-41.6-51.9-74.9-51.9H282.2l-9.6-48H336c17.7 0 32-14.3 32-32s-14.3-32-32-32H259.8z"]
            }, Co = {
              prefix: "fas",
              iconName: "circle-arrow-up",
              icon: [512, 512, ["arrow-circle-up"], "f0aa", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM385 231c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-71-71V376c0 13.3-10.7 24-24 24s-24-10.7-24-24V193.9l-71 71c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 119c9.4-9.4 24.6-9.4 33.9 0L385 231z"]
            }, a3 = Co, Va = {
              prefix: "fas",
              iconName: "toggle-on",
              icon: [576, 512, [], "f205", "M192 64C86 64 0 150 0 256S86 448 192 448H384c106 0 192-86 192-192s-86-192-192-192H192zm192 96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
            }, TP = {
              prefix: "fas",
              iconName: "person-walking",
              icon: [320, 512, [128694, "walking"], "f554", "M160 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM126.5 199.3c-1 .4-1.9 .8-2.9 1.2l-8 3.5c-16.4 7.3-29 21.2-34.7 38.2l-2.6 7.8c-5.6 16.8-23.7 25.8-40.5 20.2s-25.8-23.7-20.2-40.5l2.6-7.8c11.4-34.1 36.6-61.9 69.4-76.5l8-3.5c20.8-9.2 43.3-14 66.1-14c44.6 0 84.8 26.8 101.9 67.9L281 232.7l21.4 10.7c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3L247 287.3c-10.3-5.2-18.4-13.8-22.8-24.5l-9.6-23-19.3 65.5 49.5 54c5.4 5.9 9.2 13 11.2 20.8l23 92.1c4.3 17.1-6.1 34.5-23.3 38.8s-34.5-6.1-38.8-23.3l-22-88.1-70.7-77.1c-14.8-16.1-20.3-38.6-14.7-59.7l16.9-63.5zM68.7 398l25-62.4c2.1 3 4.5 5.8 7 8.6l40.7 44.4-14.5 36.2c-2.4 6-6 11.5-10.6 16.1L54.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L68.7 398z"]
            }, rh = TP, du = {
              prefix: "fas",
              iconName: "l",
              icon: [320, 512, [108], "4c", "M64 32c17.7 0 32 14.3 32 32V416H288c17.7 0 32 14.3 32 32s-14.3 32-32 32H64c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32z"]
            }, sf = {
              prefix: "fas",
              iconName: "fire",
              icon: [448, 512, [128293], "f06d", "M159.3 5.4c7.8-7.3 19.9-7.2 27.7 .1c27.6 25.9 53.5 53.8 77.7 84c11-14.4 23.5-30.1 37-42.9c7.9-7.4 20.1-7.4 28 .1c34.6 33 63.9 76.6 84.5 118c20.3 40.8 33.8 82.5 33.8 111.9C448 404.2 348.2 512 224 512C98.4 512 0 404.1 0 276.5c0-38.4 17.8-85.3 45.4-131.7C73.3 97.7 112.7 48.6 159.3 5.4zM225.7 416c25.3 0 47.7-7 68.8-21c42.1-29.4 53.4-88.2 28.1-134.4c-4.5-9-16-9.6-22.5-2l-25.2 29.3c-6.6 7.6-18.5 7.4-24.7-.5c-16.5-21-46-58.5-62.8-79.8c-6.3-8-18.3-8.1-24.7-.1c-33.8 42.5-50.8 69.3-50.8 99.4C112 375.4 162.6 416 225.7 416z"]
            }, nh = {
              prefix: "fas",
              iconName: "bed-pulse",
              icon: [640, 512, ["procedures"], "f487", "M483.2 9.6L524 64h92c13.3 0 24 10.7 24 24s-10.7 24-24 24H512c-7.6 0-14.7-3.6-19.2-9.6L468.7 70.3l-47 99.9c-3.7 7.8-11.3 13.1-19.9 13.7s-16.9-3.4-21.7-10.6L339.2 112H216c-13.3 0-24-10.7-24-24s10.7-24 24-24H352c8 0 15.5 4 20 10.7l24.4 36.6 45.9-97.5C445.9 6.2 453.2 1 461.6 .1s16.6 2.7 21.6 9.5zM320 160h12.7l20.7 31.1c11.2 16.8 30.6 26.3 50.7 24.8s37.9-13.7 46.5-32L461.9 160H544c53 0 96 43 96 96V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V448H352 320 64v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V96C0 78.3 14.3 64 32 64s32 14.3 32 32V352H288V192c0-17.7 14.3-32 32-32zm-144 0a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
            }, Un = nh, Xd = {
              prefix: "fas",
              iconName: "shuttle-space",
              icon: [640, 512, ["space-shuttle"], "f197", "M130 480c40.6 0 80.4-11 115.2-31.9L352 384l-224 0 0 96h2zM352 128L245.2 63.9C210.4 43 170.6 32 130 32h-2v96l224 0zM96 128l0-96H80C53.5 32 32 53.5 32 80v48h8c-22.1 0-40 17.9-40 40v16V328v16c0 22.1 17.9 40 40 40H32v48c0 26.5 21.5 48 48 48H96l0-96h8c26.2 0 49.4-12.6 64-32H456c69.3 0 135-22.7 179.2-81.6c6.4-8.5 6.4-20.3 0-28.8C591 182.7 525.3 160 456 160H168c-14.6-19.4-37.8-32-64-32l-8 0zM512 243.6v24.9c0 19.6-15.9 35.6-35.6 35.6c-2.5 0-4.4-2-4.4-4.4V212.4c0-2.5 2-4.4 4.4-4.4c19.6 0 35.6 15.9 35.6 35.6z"]
            }, ih = Xd, o3 = {
              prefix: "fas",
              iconName: "face-laugh",
              icon: [512, 512, ["laugh"], "f599", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1H393.6c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zM144.4 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, kg = o3, sh = {
              prefix: "fas",
              iconName: "folder-open",
              icon: [576, 512, [128194, 128449, 61717], "f07c", "M88.7 223.8L0 375.8V96C0 60.7 28.7 32 64 32H181.5c17 0 33.3 6.7 45.3 18.7l26.5 26.5c12 12 28.3 18.7 45.3 18.7H416c35.3 0 64 28.7 64 64v32H144c-22.8 0-43.8 12.1-55.3 31.8zm27.6 16.1C122.1 230 132.6 224 144 224H544c11.5 0 22 6.1 27.7 16.1s5.7 22.2-.1 32.1l-112 192C453.9 474 443.4 480 432 480H32c-11.5 0-22-6.1-27.7-16.1s-5.7-22.2 .1-32.1l112-192z"]
            }, ah = {
              prefix: "fas",
              iconName: "heart-circle-plus",
              icon: [576, 512, [], "e500", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm16-208v48h48c8.8 0 16 7.2 16 16s-7.2 16-16 16H448v48c0 8.8-7.2 16-16 16s-16-7.2-16-16V384H368c-8.8 0-16-7.2-16-16s7.2-16 16-16h48V304c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
            }, Eg = {
              prefix: "fas",
              iconName: "code-fork",
              icon: [448, 512, [], "e13b", "M80 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm80-24c0 32.8-19.7 61-48 73.3V192c0 17.7 14.3 32 32 32H304c17.7 0 32-14.3 32-32V153.3C307.7 141 288 112.8 288 80c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3V192c0 53-43 96-96 96H256v70.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3V288H144c-53 0-96-43-96-96V153.3C19.7 141 0 112.8 0 80C0 35.8 35.8 0 80 0s80 35.8 80 80zm208 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM248 432a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
            }, oh = {
              prefix: "fas",
              iconName: "city",
              icon: [640, 512, [127961], "f64f", "M480 48c0-26.5-21.5-48-48-48H336c-26.5 0-48 21.5-48 48V96H224V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V96H112V24c0-13.3-10.7-24-24-24S64 10.7 64 24V96H48C21.5 96 0 117.5 0 144v96V464c0 26.5 21.5 48 48 48H304h32 96H592c26.5 0 48-21.5 48-48V240c0-26.5-21.5-48-48-48H480V48zm96 320v32c0 8.8-7.2 16-16 16H528c-8.8 0-16-7.2-16-16V368c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16zM240 416H208c-8.8 0-16-7.2-16-16V368c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16zM128 400c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V368c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32zM560 256c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H528c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16h32zM256 176v32c0 8.8-7.2 16-16 16H208c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16zM112 160c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h32zM256 304c0 8.8-7.2 16-16 16H208c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32zM112 320H80c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16zm304-48v32c0 8.8-7.2 16-16 16H368c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16zM400 64c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H368c-8.8 0-16-7.2-16-16V80c0-8.8 7.2-16 16-16h32zm16 112v32c0 8.8-7.2 16-16 16H368c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16z"]
            }, Fg = {
              prefix: "fas",
              iconName: "microphone-lines",
              icon: [384, 512, [127897, "microphone-alt"], "f3c9", "M96 96V256c0 53 43 96 96 96s96-43 96-96H208c-8.8 0-16-7.2-16-16s7.2-16 16-16h80V192H208c-8.8 0-16-7.2-16-16s7.2-16 16-16h80V128H208c-8.8 0-16-7.2-16-16s7.2-16 16-16h80c0-53-43-96-96-96S96 43 96 96zM320 240v16c0 70.7-57.3 128-128 128s-128-57.3-128-128V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h72 72c13.3 0 24-10.7 24-24s-10.7-24-24-24H216V430.4c85.8-11.7 152-85.3 152-174.4V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v24z"]
            }, H7 = Fg, f3 = {
              prefix: "fas",
              iconName: "pepper-hot",
              icon: [512, 512, [127798], "f816", "M428.3 3c11.6-6.4 26.2-2.3 32.6 9.3l4.8 8.7c19.3 34.7 19.8 75.7 3.4 110C495.8 159.6 512 197.9 512 240c0 18.5-3.1 36.3-8.9 52.8c-6.1 17.3-28.5 16.3-36.8-.1l-11.7-23.4c-4.1-8.1-12.4-13.3-21.5-13.3H360c-13.3 0-24-10.7-24-24V152c0-13.3-10.7-24-24-24l-17.1 0c-21.3 0-30-23.9-10.8-32.9C304.7 85.4 327.7 80 352 80c28.3 0 54.8 7.3 77.8 20.2c5.5-18.2 3.7-38.4-6-55.8L419 35.7c-6.4-11.6-2.3-26.2 9.3-32.6zM171.2 345.5L264 160l40 0v80c0 26.5 21.5 48 48 48h76.2l23.9 47.8C372.3 443.9 244.3 512 103.2 512H44.4C19.9 512 0 492.1 0 467.6c0-20.8 14.5-38.8 34.8-43.3l49.8-11.1c37.6-8.4 69.5-33.2 86.7-67.7z"]
            }, Pv = {
              prefix: "fas",
              iconName: "unlock",
              icon: [448, 512, [128275], "f09c", "M144 144c0-44.2 35.8-80 80-80c31.9 0 59.4 18.6 72.3 45.7c7.6 16 26.7 22.8 42.6 15.2s22.8-26.7 15.2-42.6C331 33.7 281.5 0 224 0C144.5 0 80 64.5 80 144v48H64c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V256c0-35.3-28.7-64-64-64H144V144z"]
            }, bo = {
              prefix: "fas",
              iconName: "colon-sign",
              icon: [384, 512, [], "e140", "M255 39.8c4.3-17.1-6.1-34.5-23.3-38.8S197.2 7.1 193 24.2L181.9 68.6C96.1 87.8 32 164.4 32 256c0 58.1 25.8 110.2 66.7 145.4L81 472.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l13-52.1c9 3.4 18.4 6.2 28 8.2L177 472.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l10.4-41.4c33.4-4.4 64.1-17.4 89.8-36.7c14.1-10.6 17-30.7 6.4-44.8s-30.7-17-44.8-6.4c-10.2 7.7-21.7 13.9-34 18.3L321 160c9.4-.3 18.5-4.7 24.6-12.8c10.6-14.1 7.8-34.2-6.4-44.8c-1.1-.8-2.2-1.6-3.3-2.4L351 39.8c4.3-17.1-6.1-34.5-23.3-38.8S293.2 7.1 289 24.2L277.2 71.5c-9.3-2.7-18.8-4.6-28.6-5.9L255 39.8zM163.2 143.3L117.3 326.8C103.9 306.5 96 282.2 96 256c0-48.7 27.2-91 67.2-112.7zm8.6 229.5l61.1-244.6c9.9 .7 19.5 2.5 28.7 5.3l-62 248.1c-9.7-1.9-19-4.8-27.8-8.8z"]
            }, af = {
              prefix: "fas",
              iconName: "headset",
              icon: [512, 512, [], "f590", "M256 48C141.1 48 48 141.1 48 256v40c0 13.3-10.7 24-24 24s-24-10.7-24-24V256C0 114.6 114.6 0 256 0S512 114.6 512 256V400.1c0 48.6-39.4 88-88.1 88L313.6 488c-8.3 14.3-23.8 24-41.6 24H240c-26.5 0-48-21.5-48-48s21.5-48 48-48h32c17.8 0 33.3 9.7 41.6 24l110.4 .1c22.1 0 40-17.9 40-40V256c0-114.9-93.1-208-208-208zM144 208h16c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H144c-35.3 0-64-28.7-64-64V272c0-35.3 28.7-64 64-64zm224 0c35.3 0 64 28.7 64 64v48c0 35.3-28.7 64-64 64H352c-17.7 0-32-14.3-32-32V240c0-17.7 14.3-32 32-32h16z"]
            }, JA = {
              prefix: "fas",
              iconName: "store-slash",
              icon: [640, 512, [], "e071", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-86.8-68V384 252.6c-4 1-8 1.8-12.3 2.3l-.1 0c-5.3 .7-10.7 1.1-16.2 1.1c-12.4 0-24.3-1.9-35.4-5.3V350.9L301.2 210.7c7-4.4 13.3-9.7 18.8-15.7c15.9 17.6 39.1 29 65.2 29c26.2 0 49.3-11.4 65.2-29c16 17.6 39.1 29 65.2 29c4.1 0 8.1-.3 12.1-.8c55.5-7.4 81.8-72.5 52.1-119.4L522.3 13.1C517.2 5 508.1 0 498.4 0H141.6c-9.7 0-18.8 5-23.9 13.1l-22.7 36L38.8 5.1zm73.4 218.1c4 .5 8.1 .8 12.1 .8c11 0 21.4-2 31-5.6L48.9 134.5c-6.1 40.6 19.5 82.8 63.3 88.7zM160 384V250.6c-11.2 3.5-23.2 5.4-35.6 5.4c-5.5 0-11-.4-16.3-1.1l-.1 0c-4.1-.6-8.1-1.3-12-2.3V384v64c0 35.3 28.7 64 64 64H480c12.9 0 24.8-3.8 34.9-10.3L365.5 384H160z"]
            }, A3 = {
              prefix: "fas",
              iconName: "road-circle-xmark",
              icon: [640, 512, [], "e566", "M213.2 32H288V96c0 17.7 14.3 32 32 32s32-14.3 32-32V32h74.8c27.1 0 51.3 17.1 60.3 42.6l42.7 120.6c-10.9-2.1-22.2-3.2-33.8-3.2c-59.5 0-112.1 29.6-144 74.8V224c0-17.7-14.3-32-32-32s-32 14.3-32 32v64c0 17.7 14.3 32 32 32c2.3 0 4.6-.3 6.8-.7c-4.5 15.5-6.8 31.8-6.8 48.7c0 5.4 .2 10.7 .7 16l-.7 0c-17.7 0-32 14.3-32 32v64H86.6C56.5 480 32 455.5 32 425.4c0-6.2 1.1-12.4 3.1-18.2L152.9 74.6C162 49.1 186.1 32 213.2 32zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm22.6 144l36.7-36.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L496 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L473.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L496 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L518.6 368z"]
            }, vu = {
              prefix: "fas",
              iconName: "user-minus",
              icon: [640, 512, [], "f503", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3zM472 200H616c13.3 0 24 10.7 24 24s-10.7 24-24 24H472c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
            }, zA = {
              prefix: "fas",
              iconName: "mars-stroke-up",
              icon: [320, 512, [9896, "mars-stroke-v"], "f22a", "M148.7 4.7c6.2-6.2 16.4-6.2 22.6 0l64 64c4.6 4.6 5.9 11.5 3.5 17.4s-8.3 9.9-14.8 9.9H184v24h32c13.3 0 24 10.7 24 24s-10.7 24-24 24H184v24c0 .6 0 1.2-.1 1.8c77 11.6 136.1 78 136.1 158.2c0 88.4-71.6 160-160 160S0 440.4 0 352c0-80.2 59.1-146.7 136.1-158.2c0-.6-.1-1.2-.1-1.8V168H104c-13.3 0-24-10.7-24-24s10.7-24 24-24h32V96H96c-6.5 0-12.3-3.9-14.8-9.9s-1.1-12.9 3.5-17.4l64-64zM256 352A96 96 0 1 0 64 352a96 96 0 1 0 192 0z"]
            }, D4 = zA, Td = {
              prefix: "fas",
              iconName: "champagne-glasses",
              icon: [640, 512, [129346, "glass-cheers"], "f79f", "M155.6 17.3C163 3 179.9-3.6 195 1.9L320 47.5l125-45.6c15.1-5.5 32 1.1 39.4 15.4l78.8 152.9c28.8 55.8 10.3 122.3-38.5 156.6L556.1 413l41-15c16.6-6 35 2.5 41 19.1s-2.5 35-19.1 41l-71.1 25.9L476.8 510c-16.6 6.1-35-2.5-41-19.1s2.5-35 19.1-41l41-15-31.3-86.2c-59.4 5.2-116.2-34-130-95.2L320 188.8l-14.6 64.7c-13.8 61.3-70.6 100.4-130 95.2l-31.3 86.2 41 15c16.6 6 25.2 24.4 19.1 41s-24.4 25.2-41 19.1L92.2 484.1 21.1 458.2c-16.6-6.1-25.2-24.4-19.1-41s24.4-25.2 41-19.1l41 15 31.3-86.2C66.5 292.5 48.1 226 76.9 170.2L155.6 17.3zm44 54.4l-27.2 52.8L261.6 157l13.1-57.9L199.6 71.7zm240.9 0L365.4 99.1 378.5 157l89.2-32.5L440.5 71.7z"]
            }, g7 = Td, d3 = {
              prefix: "fas",
              iconName: "clipboard",
              icon: [384, 512, [128203], "f328", "M192 0c-41.8 0-77.4 26.7-90.5 64H64C28.7 64 0 92.7 0 128V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H282.5C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM112 192H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, j4 = {
              prefix: "fas",
              iconName: "house-circle-exclamation",
              icon: [640, 512, [], "e50a", "M320.7 352c8.1-89.7 83.5-160 175.3-160c8.9 0 17.6 .7 26.1 1.9L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1h32v69.7c-.1 .9-.1 1.8-.1 2.8V472c0 22.1 17.9 40 40 40h16c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2H160h24c22.1 0 40-17.9 40-40V448 384c0-17.7 14.3-32 32-32h64l.7 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16v80c0 8.8-7.2 16-16 16s-16-7.2-16-16V288c0-8.8 7.2-16 16-16z"]
            }, X7 = {
              prefix: "fas",
              iconName: "file-arrow-up",
              icon: [384, 512, ["file-upload"], "f574", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM216 408c0 13.3-10.7 24-24 24s-24-10.7-24-24V305.9l-31 31c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l72-72c9.4-9.4 24.6-9.4 33.9 0l72 72c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-31-31V408z"]
            }, Ng = X7, v3 = {
              prefix: "fas",
              iconName: "wifi",
              icon: [640, 512, ["wifi-3", "wifi-strong"], "f1eb", "M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
            }, fh = v3, Qg = v3, $f = {
              prefix: "fas",
              iconName: "bath",
              icon: [512, 512, [128705, "bathtub"], "f2cd", "M96 77.3c0-7.3 5.9-13.3 13.3-13.3c3.5 0 6.9 1.4 9.4 3.9l14.9 14.9C130 91.8 128 101.7 128 112c0 19.9 7.2 38 19.2 52c-5.3 9.2-4 21.1 3.8 29c9.4 9.4 24.6 9.4 33.9 0L289 89c9.4-9.4 9.4-24.6 0-33.9c-7.9-7.9-19.8-9.1-29-3.8C246 39.2 227.9 32 208 32c-10.3 0-20.2 2-29.2 5.5L163.9 22.6C149.4 8.1 129.7 0 109.3 0C66.6 0 32 34.6 32 77.3V256c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H96V77.3zM32 352v16c0 28.4 12.4 54 32 71.6V480c0 17.7 14.3 32 32 32s32-14.3 32-32V464H384v16c0 17.7 14.3 32 32 32s32-14.3 32-32V439.6c19.6-17.6 32-43.1 32-71.6V352H32z"]
            }, bs = $f, Oo = {
              prefix: "fas",
              iconName: "underline",
              icon: [448, 512, [], "f0cd", "M16 64c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H128V224c0 53 43 96 96 96s96-43 96-96V96H304c-17.7 0-32-14.3-32-32s14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H384V224c0 88.4-71.6 160-160 160s-160-71.6-160-160V96H48C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32z"]
            }, yo = {
              prefix: "fas",
              iconName: "user-pen",
              icon: [640, 512, ["user-edit"], "f4ff", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H322.8c-3.1-8.8-3.7-18.4-1.4-27.8l15-60.1c2.8-11.3 8.6-21.5 16.8-29.7l40.3-40.3c-32.1-31-75.7-50.1-123.9-50.1H178.3zm435.5-68.3c-15.6-15.6-40.9-15.6-56.6 0l-29.4 29.4 71 71 29.4-29.4c15.6-15.6 15.6-40.9 0-56.6l-14.4-14.4zM375.9 417c-4.1 4.1-7 9.2-8.4 14.9l-15 60.1c-1.4 5.5 .2 11.2 4.2 15.2s9.7 5.6 15.2 4.2l60.1-15c5.6-1.4 10.8-4.3 14.9-8.4L576.1 358.7l-71-71L375.9 417z"]
            }, of = yo, o6 = {
              prefix: "fas",
              iconName: "signature",
              icon: [640, 512, [], "f5b7", "M192 128c0-17.7 14.3-32 32-32s32 14.3 32 32v7.8c0 27.7-2.4 55.3-7.1 82.5l-84.4 25.3c-40.6 12.2-68.4 49.6-68.4 92v71.9c0 40 32.5 72.5 72.5 72.5c26 0 50-13.9 62.9-36.5l13.9-24.3c26.8-47 46.5-97.7 58.4-150.5l94.4-28.3-12.5 37.5c-3.3 9.8-1.6 20.5 4.4 28.8s15.7 13.3 26 13.3H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H460.4l18-53.9c3.8-11.3 .9-23.8-7.4-32.4s-20.7-11.8-32.2-8.4L316.4 198.1c2.4-20.7 3.6-41.4 3.6-62.3V128c0-53-43-96-96-96s-96 43-96 96v32c0 17.7 14.3 32 32 32s32-14.3 32-32V128zm-9.2 177l49-14.7c-10.4 33.8-24.5 66.4-42.1 97.2l-13.9 24.3c-1.5 2.6-4.3 4.3-7.4 4.3c-4.7 0-8.5-3.8-8.5-8.5V335.6c0-14.1 9.3-26.6 22.8-30.7zM24 368c-13.3 0-24 10.7-24 24s10.7 24 24 24H64.3c-.2-2.8-.3-5.6-.3-8.5V368H24zm592 48c13.3 0 24-10.7 24-24s-10.7-24-24-24H305.9c-6.7 16.3-14.2 32.3-22.3 48H616z"]
            }, cv = {
              prefix: "fas",
              iconName: "stroopwafel",
              icon: [512, 512, [], "f551", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM312.6 63.7c-6.2-6.2-16.4-6.2-22.6 0L256 97.6 222.1 63.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l33.9 33.9-45.3 45.3-56.6-56.6c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l56.6 56.6-45.3 45.3L86.3 199.4c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L97.6 256 63.7 289.9c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l33.9-33.9 45.3 45.3-56.6 56.6c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l56.6-56.6 45.3 45.3-33.9 33.9c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L256 414.4l33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-33.9-33.9 45.3-45.3 56.6 56.6c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-56.6-56.6 45.3-45.3 33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L414.4 256l33.9-33.9c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-33.9 33.9-45.3-45.3 56.6-56.6c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-56.6 56.6-45.3-45.3 33.9-33.9c6.2-6.2 6.2-16.4 0-22.6zM142.9 256l45.3-45.3L233.4 256l-45.3 45.3L142.9 256zm67.9 67.9L256 278.6l45.3 45.3L256 369.1l-45.3-45.3zM278.6 256l45.3-45.3L369.1 256l-45.3 45.3L278.6 256zm22.6-67.9L256 233.4l-45.3-45.3L256 142.9l45.3 45.3z"]
            }, ff = {
              prefix: "fas",
              iconName: "bold",
              icon: [384, 512, [], "f032", "M0 64C0 46.3 14.3 32 32 32H80 96 224c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128H96 80 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H48V256 96H32C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64H112V224H224zM112 288V416H256c35.3 0 64-28.7 64-64s-28.7-64-64-64H224 112z"]
            }, u3 = {
              prefix: "fas",
              iconName: "anchor-lock",
              icon: [640, 512, [], "e4ad", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80H224c-17.7 0-32 14.3-32 32s14.3 32 32 32h32V448H208c-53 0-96-43-96-96v-6.1l7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7V352c0 88.4 71.6 160 160 160h80 80c8 0 15.9-.6 23.6-1.7c-4.8-9-7.6-19.3-7.6-30.3V446.7c-5.2 .9-10.5 1.3-16 1.3H320V240h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H341.1zM528 240c17.7 0 32 14.3 32 32v48H496V272c0-17.7 14.3-32 32-32zm-80 32v48c-17.7 0-32 14.3-32 32V480c0 17.7 14.3 32 32 32H608c17.7 0 32-14.3 32-32V352c0-17.7-14.3-32-32-32V272c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
            }, pv = {
              prefix: "fas",
              iconName: "building-ngo",
              icon: [384, 512, [], "e4d7", "M48 0C21.5 0 0 21.5 0 48V464c0 26.5 21.5 48 48 48h96V432c0-26.5 21.5-48 48-48s48 21.5 48 48v80h96c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48H48zM64 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V240zm112-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V240zM168 64h48c8.8 0 16 7.2 16 16s-7.2 16-16 16H184v64h16V144c0-8.8 7.2-16 16-16s16 7.2 16 16v24c0 13.3-10.7 24-24 24H176c-13.3 0-24-10.7-24-24V80c0-8.8 7.2-16 16-16zM304 96c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16s16-7.2 16-16V112c0-8.8-7.2-16-16-16zm-48 16c0-26.5 21.5-48 48-48s48 21.5 48 48v32c0 26.5-21.5 48-48 48s-48-21.5-48-48V112zM61.3 71.1l34.7 52V80c0-8.8 7.2-16 16-16s16 7.2 16 16v96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4L64 132.8V176c0 8.8-7.2 16-16 16s-16-7.2-16-16V80c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4z"]
            }, Ah = {
              prefix: "fas",
              iconName: "manat-sign",
              icon: [384, 512, [], "e1d5", "M192 32c-17.7 0-32 14.3-32 32V98.7C69.2 113.9 0 192.9 0 288V448c0 17.7 14.3 32 32 32s32-14.3 32-32V288c0-59.6 40.8-109.8 96-124V448c0 17.7 14.3 32 32 32s32-14.3 32-32V164c55.2 14.2 96 64.3 96 124V448c0 17.7 14.3 32 32 32s32-14.3 32-32V288c0-95.1-69.2-174.1-160-189.3V64c0-17.7-14.3-32-32-32z"]
            }, l3 = {
              prefix: "fas",
              iconName: "not-equal",
              icon: [448, 512, [], "f53e", "M369.8 37.4c14.7 9.8 18.7 29.7 8.9 44.4L337.1 144H400c17.7 0 32 14.3 32 32s-14.3 32-32 32H294.5l-64 96H400c17.7 0 32 14.3 32 32s-14.3 32-32 32H187.8l-65.2 97.7c-9.8 14.7-29.7 18.7-44.4 8.9s-18.7-29.7-8.9-44.4L110.9 368H48c-17.7 0-32-14.3-32-32s14.3-32 32-32H153.5l64-96H48c-17.7 0-32-14.3-32-32s14.3-32 32-32H260.2l65.2-97.7c9.8-14.7 29.7-18.7 44.4-8.9z"]
            }, uu = {
              prefix: "fas",
              iconName: "border-top-left",
              icon: [448, 512, ["border-style"], "f853", "M0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-336c0-8.8 7.2-16 16-16l336 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32C35.8 32 0 67.8 0 112L0 448zm160 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm192 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm-96 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm192 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm0 32a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, f6 = uu, T7 = {
              prefix: "fas",
              iconName: "map-location-dot",
              icon: [576, 512, ["map-marked-alt"], "f5a0", "M408 120c0 54.6-73.1 151.9-105.2 192c-7.7 9.6-22 9.6-29.6 0C241.1 271.9 168 174.6 168 120C168 53.7 221.7 0 288 0s120 53.7 120 120zm8 80.4c3.5-6.9 6.7-13.8 9.6-20.6c.5-1.2 1-2.5 1.5-3.7l116-46.4C558.9 123.4 576 135 576 152V422.8c0 9.8-6 18.6-15.1 22.3L416 503V200.4zM137.6 138.3c2.4 14.1 7.2 28.3 12.8 41.5c2.9 6.8 6.1 13.7 9.6 20.6V451.8L32.9 502.7C17.1 509 0 497.4 0 480.4V209.6c0-9.8 6-18.6 15.1-22.3l122.6-49zM327.8 332c13.9-17.4 35.7-45.7 56.2-77V504.3L192 449.4V255c20.5 31.3 42.3 59.6 56.2 77c20.5 25.6 59.1 25.6 79.6 0zM288 152a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
            }, P3 = T7, hv = {
              prefix: "fas",
              iconName: "jedi",
              icon: [576, 512, [], "f669", "M246 315.7l-21.2-31.9c-2.1-3.2-1.7-7.4 1-10.1s6.9-3.1 10.1-1l29.5 19.7c2.1 1.4 4.9 0 5-2.6L279.7 8c.1-4.5 3.8-8 8.3-8s8.1 3.5 8.3 8l9.4 281.9c.1 2.5 2.9 3.9 5 2.6l29.5-19.7c3.2-2.1 7.4-1.7 10.1 1s3.1 6.9 1 10.1L330 315.7c-1.3 1.9-.2 4.5 2 4.9l37.6 7.5c3.7 .7 6.4 4 6.4 7.8s-2.7 7.1-6.4 7.8L332 351.4c-2.2 .4-3.3 3-2 4.9l21.2 31.9c2.1 3.2 1.7 7.4-1 10.1s-6.9 3.1-10.1 1l-26.3-17.6c-2.2-1.4-5.1 .2-5 2.8l2.1 61.5C370.6 435.2 416 382.9 416 320c0-37-15.7-70.4-40.8-93.7c-7-6.5-6.5-18.6 1-24.4C410.1 175.5 432 134.3 432 88c0-16.8-2.9-33-8.2-48c-4.6-13 10.2-30 21.4-22c53.5 38 92.7 94.8 107.8 160.7c.5 2.1-.2 4.3-1.7 5.9l-28.4 28.4c-4 4-1.2 10.9 4.5 10.9h26c3.4 0 6.2 2.6 6.3 6c.1 3.3 .2 6.6 .2 10c0 17.5-1.7 34.7-4.8 51.3c-.2 1.2-.9 2.4-1.7 3.3l-46.5 46.5c-4 4-1.2 10.9 4.5 10.9H526c4.6 0 7.7 4.8 5.7 9C487.2 450.5 394.8 512 288 512S88.8 450.5 44.3 361c-2.1-4.2 1-9 5.7-9H64.5c5.7 0 8.6-6.9 4.5-10.9L22.6 294.6c-.9-.9-1.5-2-1.7-3.3C17.7 274.7 16 257.5 16 240c0-3.3 .1-6.7 .2-10c.1-3.4 2.9-6 6.3-6h26c5.7 0 8.6-6.9 4.5-10.9L24.6 184.6c-1.5-1.5-2.2-3.8-1.7-5.9C38.1 112.8 77.3 56 130.8 18c11.3-8 26 8.9 21.4 22c-5.3 15-8.2 31.2-8.2 48c0 46.3 21.9 87.5 55.8 113.9c7.5 5.8 8 17.9 1 24.4C175.7 249.6 160 283 160 320c0 62.9 45.4 115.2 105.1 126l2.1-61.5c.1-2.6-2.8-4.2-5-2.8l-26.3 17.6c-3.2 2.1-7.4 1.7-10.1-1s-3.1-6.9-1-10.1L246 356.3c1.3-1.9 .2-4.5-2-4.9l-37.6-7.5c-3.7-.7-6.4-4-6.4-7.8s2.7-7.1 6.4-7.8l37.6-7.5c2.2-.4 3.3-3 2-4.9z"]
            }, c3 = {
              prefix: "fas",
              iconName: "square-poll-vertical",
              icon: [448, 512, ["poll"], "f681", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm64 192c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V256c0-17.7 14.3-32 32-32zm64-64c0-17.7 14.3-32 32-32s32 14.3 32 32V352c0 17.7-14.3 32-32 32s-32-14.3-32-32V160zM320 288c17.7 0 32 14.3 32 32v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V320c0-17.7 14.3-32 32-32z"]
            }, fl = c3, A6 = {
              prefix: "fas",
              iconName: "mug-hot",
              icon: [512, 512, [9749], "f7b6", "M88 0C74.7 0 64 10.7 64 24c0 38.9 23.4 59.4 39.1 73.1l1.1 1C120.5 112.3 128 119.9 128 136c0 13.3 10.7 24 24 24s24-10.7 24-24c0-38.9-23.4-59.4-39.1-73.1l-1.1-1C119.5 47.7 112 40.1 112 24c0-13.3-10.7-24-24-24zM32 192c-17.7 0-32 14.3-32 32V416c0 53 43 96 96 96H288c53 0 96-43 96-96h16c61.9 0 112-50.1 112-112s-50.1-112-112-112H352 32zm352 64h16c26.5 0 48 21.5 48 48s-21.5 48-48 48H384V256zM224 24c0-13.3-10.7-24-24-24s-24 10.7-24 24c0 38.9 23.4 59.4 39.1 73.1l1.1 1C232.5 112.3 240 119.9 240 136c0 13.3 10.7 24 24 24s24-10.7 24-24c0-38.9-23.4-59.4-39.1-73.1l-1.1-1C231.5 47.7 224 40.1 224 24z"]
            }, lu = {
              prefix: "fas",
              iconName: "car-battery",
              icon: [512, 512, ["battery-car"], "f5df", "M80 96c0-17.7 14.3-32 32-32h64c17.7 0 32 14.3 32 32l96 0c0-17.7 14.3-32 32-32h64c17.7 0 32 14.3 32 32h16c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V160c0-35.3 28.7-64 64-64l16 0zm304 96c0-8.8-7.2-16-16-16s-16 7.2-16 16v32H320c-8.8 0-16 7.2-16 16s7.2 16 16 16h32v32c0 8.8 7.2 16 16 16s16-7.2 16-16V256h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H384V192zM80 240c0 8.8 7.2 16 16 16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H96c-8.8 0-16 7.2-16 16z"]
            }, Al = lu, q7 = {
              prefix: "fas",
              iconName: "gift",
              icon: [512, 512, [127873], "f06b", "M190.5 68.8L225.3 128H224 152c-22.1 0-40-17.9-40-40s17.9-40 40-40h2.2c14.9 0 28.8 7.9 36.3 20.8zM64 88c0 14.4 3.5 28 9.6 40H32c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32H480c17.7 0 32-14.3 32-32V160c0-17.7-14.3-32-32-32H438.4c6.1-12 9.6-25.6 9.6-40c0-48.6-39.4-88-88-88h-2.2c-31.9 0-61.5 16.9-77.7 44.4L256 85.5l-24.1-41C215.7 16.9 186.1 0 154.2 0H152C103.4 0 64 39.4 64 88zm336 0c0 22.1-17.9 40-40 40H288h-1.3l34.8-59.2C329.1 55.9 342.9 48 357.8 48H360c22.1 0 40 17.9 40 40zM32 288V464c0 26.5 21.5 48 48 48H224V288H32zM288 512H432c26.5 0 48-21.5 48-48V288H288V512z"]
            }, p3 = {
              prefix: "fas",
              iconName: "dice-two",
              icon: [448, 512, [9857], "f528", "M0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM352 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, b7 = {
              prefix: "fas",
              iconName: "chess-queen",
              icon: [512, 512, [9819], "f445", "M256 0a56 56 0 1 1 0 112A56 56 0 1 1 256 0zM134.1 143.8c3.3-13 15-23.8 30.2-23.8c12.3 0 22.6 7.2 27.7 17c12 23.2 36.2 39 64 39s52-15.8 64-39c5.1-9.8 15.4-17 27.7-17c15.3 0 27 10.8 30.2 23.8c7 27.8 32.2 48.3 62.1 48.3c10.8 0 21-2.7 29.8-7.4c8.4-4.4 18.9-4.5 27.6 .9c13 8 17.1 25 9.2 38L399.7 400H384 343.6 168.4 128 112.3L5.4 223.6c-7.9-13-3.8-30 9.2-38c8.7-5.3 19.2-5.3 27.6-.9c8.9 4.7 19 7.4 29.8 7.4c29.9 0 55.1-20.5 62.1-48.3zM256 224l0 0 0 0h0zM112 432H400l41.4 41.4c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6H86.6C74.1 512 64 501.9 64 489.4c0-6 2.4-11.8 6.6-16L112 432z"]
            }, qP = {
              prefix: "fas",
              iconName: "glasses",
              icon: [576, 512, [], "f530", "M118.6 80c-11.5 0-21.4 7.9-24 19.1L57 260.3c20.5-6.2 48.3-12.3 78.7-12.3c32.3 0 61.8 6.9 82.8 13.5c10.6 3.3 19.3 6.7 25.4 9.2c3.1 1.3 5.5 2.4 7.3 3.2c.9 .4 1.6 .7 2.1 1l.6 .3 .2 .1 .1 0 0 0 0 0s0 0-6.3 12.7h0l6.3-12.7c5.8 2.9 10.4 7.3 13.5 12.7h40.6c3.1-5.3 7.7-9.8 13.5-12.7l6.3 12.7h0c-6.3-12.7-6.3-12.7-6.3-12.7l0 0 0 0 .1 0 .2-.1 .6-.3c.5-.2 1.2-.6 2.1-1c1.8-.8 4.2-1.9 7.3-3.2c6.1-2.6 14.8-5.9 25.4-9.2c21-6.6 50.4-13.5 82.8-13.5c30.4 0 58.2 6.1 78.7 12.3L481.4 99.1c-2.6-11.2-12.6-19.1-24-19.1c-3.1 0-6.2 .6-9.2 1.8L416.9 94.3c-12.3 4.9-26.3-1.1-31.2-13.4s1.1-26.3 13.4-31.2l31.3-12.5c8.6-3.4 17.7-5.2 27-5.2c33.8 0 63.1 23.3 70.8 56.2l43.9 188c1.7 7.3 2.9 14.7 3.5 22.1c.3 1.9 .5 3.8 .5 5.7v6.7V352v16c0 61.9-50.1 112-112 112H419.7c-59.4 0-108.5-46.4-111.8-105.8L306.6 352H269.4l-1.2 22.2C264.9 433.6 215.8 480 156.3 480H112C50.1 480 0 429.9 0 368V352 310.7 304c0-1.9 .2-3.8 .5-5.7c.6-7.4 1.8-14.8 3.5-22.1l43.9-188C55.5 55.3 84.8 32 118.6 32c9.2 0 18.4 1.8 27 5.2l31.3 12.5c12.3 4.9 18.3 18.9 13.4 31.2s-18.9 18.3-31.2 13.4L127.8 81.8c-2.9-1.2-6-1.8-9.2-1.8zM64 325.4V368c0 26.5 21.5 48 48 48h44.3c25.5 0 46.5-19.9 47.9-45.3l2.5-45.6c-2.3-.8-4.9-1.7-7.5-2.5c-17.2-5.4-39.9-10.5-63.6-10.5c-23.7 0-46.2 5.1-63.2 10.5c-3.1 1-5.9 1.9-8.5 2.9zM512 368V325.4c-2.6-.9-5.5-1.9-8.5-2.9c-17-5.4-39.5-10.5-63.2-10.5c-23.7 0-46.4 5.1-63.6 10.5c-2.7 .8-5.2 1.7-7.5 2.5l2.5 45.6c1.4 25.4 22.5 45.3 47.9 45.3H464c26.5 0 48-21.5 48-48z"]
            }, dl = {
              prefix: "fas",
              iconName: "chess-board",
              icon: [448, 512, [], "f43c", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm64 64v64h64V96h64v64h64V96h64v64H320v64h64v64H320v64h64v64H320V352H256v64H192V352H128v64H64V352h64V288H64V224h64V160H64V96h64zm64 128h64V160H192v64zm0 64V224H128v64h64zm64 0H192v64h64V288zm0 0h64V224H256v64z"]
            }, w9 = {
              prefix: "fas",
              iconName: "building-circle-check",
              icon: [640, 512, [], "e4d2", "M48 0C21.5 0 0 21.5 0 48V464c0 26.5 21.5 48 48 48h96V432c0-26.5 21.5-48 48-48s48 21.5 48 48v80h96c15.1 0 28.5-6.9 37.3-17.8C340.4 462.2 320 417.5 320 368c0-54.7 24.9-103.5 64-135.8V48c0-26.5-21.5-48-48-48H48zM64 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V240zm112-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V240zM80 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V112zM272 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
            }, y1 = {
              prefix: "fas",
              iconName: "person-chalkboard",
              icon: [640, 512, [], "e53d", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 384V352h16V480c0 17.7 14.3 32 32 32s32-14.3 32-32V192h56 64 16c17.7 0 32-14.3 32-32s-14.3-32-32-32H384V64H576V256H384V224H320v48c0 26.5 21.5 48 48 48H592c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48H368c-26.5 0-48 21.5-48 48v80H243.1 177.1c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9V480c0 17.7 14.3 32 32 32s32-14.3 32-32z"]
            }, If = {
              prefix: "fas",
              iconName: "mars-stroke-right",
              icon: [640, 512, [9897, "mars-stroke-h"], "f22b", "M208 368a112 112 0 1 0 0-224 112 112 0 1 0 0 224zm174.4-88C370.7 365.8 297.1 432 208 432c-97.2 0-176-78.8-176-176s78.8-176 176-176c89.1 0 162.7 66.2 174.4 152H416V176c0-13.3 10.7-24 24-24s24 10.7 24 24v56h32V176c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l80 80c9.4 9.4 9.4 24.6 0 33.9l-80 80c-6.9 6.9-17.2 8.9-26.2 5.2s-14.8-12.5-14.8-22.2V280H464v56c0 13.3-10.7 24-24 24s-24-10.7-24-24V280H382.4z"]
            }, k1 = If, qd = {
              prefix: "fas",
              iconName: "hand-back-fist",
              icon: [448, 512, ["hand-rock"], "f255", "M144 0C117.5 0 96 21.5 96 48V96v28.5V176c0 8.8-7.2 16-16 16s-16-7.2-16-16V149.3l-9 7.5C40.4 169 32 187 32 206V244c0 38 16.9 74 46.1 98.3L128 384v96c0 17.7 14.3 32 32 32H320c17.7 0 32-14.3 32-32V374.7c46.9-19 80-65 80-118.7V176 160 144c0-26.5-21.5-48-48-48c-12.4 0-23.6 4.7-32.1 12.3C350 83.5 329.3 64 304 64c-12.4 0-23.6 4.7-32.1 12.3C270 51.5 249.3 32 224 32c-12.4 0-23.6 4.7-32.1 12.3C190 19.5 169.3 0 144 0z"]
            }, Yg = qd, h3 = {
              prefix: "fas",
              iconName: "square-caret-up",
              icon: [448, 512, ["caret-square-up"], "f151", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM224 160c6.7 0 13 2.8 17.6 7.7l104 112c6.5 7 8.2 17.2 4.4 25.9s-12.5 14.4-22 14.4H120c-9.5 0-18.2-5.7-22-14.4s-2.1-18.9 4.4-25.9l104-112c4.5-4.9 10.9-7.7 17.6-7.7z"]
            }, Mg = h3, d6 = {
              prefix: "fas",
              iconName: "cloud-showers-water",
              icon: [576, 512, [], "e4e4", "M224 0c38.6 0 71.9 22.8 87.2 55.7C325.7 41.1 345.8 32 368 32c38.7 0 71 27.5 78.4 64H448c35.3 0 64 28.7 64 64s-28.7 64-64 64H128c-35.3 0-64-28.7-64-64s28.7-64 64-64c0-53 43-96 96-96zM140.6 292.3l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15.1-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2s15.1 21.6 8.2 32.9zm327.8-32.9c11.4 6.8 15 21.6 8.2 32.9l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2zM252.6 292.3l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15.1-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2s15.1 21.6 8.2 32.9zm103.8-32.9c11.4 6.8 15 21.6 8.2 32.9l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15.1-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2zM306.5 421.9C329 437.4 356.5 448 384 448c26.9 0 55.4-10.8 77.4-26.1l0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 501.7 417 512 384 512c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7l0 0C136.7 437.2 165.1 448 192 448c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
            }, Lg = {
              prefix: "fas",
              iconName: "chart-bar",
              icon: [512, 512, ["bar-chart"], "f080", "M32 32c17.7 0 32 14.3 32 32V400c0 8.8 7.2 16 16 16H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H80c-44.2 0-80-35.8-80-80V64C0 46.3 14.3 32 32 32zm96 96c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 64H288c17.7 0 32 14.3 32 32s-14.3 32-32 32H160c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 96H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H160c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, bP = Lg, Pu = {
              prefix: "fas",
              iconName: "hands-bubbles",
              icon: [576, 512, ["hands-wash"], "e05e", "M416 64a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm96 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM160 464a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM32 160l.1 72.6c.1 52.2 24 101 64 133.1c-.1-1.9-.1-3.8-.1-5.7v-8c0-71.8 37-138.6 97.9-176.7l60.2-37.6c8.6-5.4 17.9-8.4 27.3-9.4l45.9-79.5c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8l-78 135.1c-3.3 5.7-10.7 7.7-16.4 4.4s-7.7-10.7-4.4-16.4l62-107.4c6.6-11.5 2.7-26.2-8.8-32.8S214 5 207.4 16.5l-68 117.8 0 0 0 0-43.3 75L96 160c0-17.7-14.4-32-32-32s-32 14.4-32 32zM332.1 88.5L307.5 131c13.9 4.5 26.4 13.7 34.7 27c.9 1.5 1.7 2.9 2.5 4.4l28.9-50c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8zm46.4 63.7l-26.8 46.4c-.6 6-2.1 11.8-4.3 17.4H352h13.3l0 0H397l23-39.8c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8zM315.1 175c-9.4-15-29.1-19.5-44.1-10.2l-60.2 37.6C159.3 234.7 128 291.2 128 352v8c0 8.9 .8 17.6 2.2 26.1c35.4 8.2 61.8 40 61.8 77.9c0 6.3-.7 12.5-2.1 18.4C215.1 501 246.3 512 280 512H456c13.3 0 24-10.7 24-24s-10.7-24-24-24H364c-6.6 0-12-5.4-12-12s5.4-12 12-12H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H364c-6.6 0-12-5.4-12-12s5.4-12 12-12H520c13.3 0 24-10.7 24-24s-10.7-24-24-24H364c-6.6 0-12-5.4-12-12s5.4-12 12-12H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H352l0 0 0 0H258.8L305 219.1c15-9.4 19.5-29.1 10.2-44.1z"]
            }, x7 = Pu, vl = {
              prefix: "fas",
              iconName: "less-than-equal",
              icon: [448, 512, [], "f537", "M395.9 93.7c16.4-6.6 24.4-25.2 17.8-41.6s-25.2-24.4-41.6-17.8l-320 128C40 167.1 32 178.9 32 192s8 24.9 20.1 29.7l320 128c16.4 6.6 35-1.4 41.6-17.8s-1.4-35-17.8-41.6L150.2 192 395.9 93.7zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"]
            }, w4 = {
              prefix: "fas",
              iconName: "train",
              icon: [448, 512, [128646], "f238", "M96 0C43 0 0 43 0 96V352c0 48 35.2 87.7 81.1 94.9l-46 46C28.1 499.9 33.1 512 43 512H82.7c8.5 0 16.6-3.4 22.6-9.4L160 448H288l54.6 54.6c6 6 14.1 9.4 22.6 9.4H405c10 0 15-12.1 7.9-19.1l-46-46c46-7.1 81.1-46.9 81.1-94.9V96c0-53-43-96-96-96H96zM64 96c0-17.7 14.3-32 32-32H352c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V96zM224 288a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, dh = {
              prefix: "fas",
              iconName: "eye-low-vision",
              icon: [640, 512, ["low-vision"], "f2a8", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223 149.5c48.6-44.3 123-50.8 179.3-11.7c60.8 42.4 78.9 123.2 44.2 186.9L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3L223 149.5zm223.1 298L83.1 161.5c-11 14.4-20.5 28.7-28.4 42.2l339 265.7c18.7-5.5 36.2-13 52.6-21.8zM34.5 268.3c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c3.1 0 6.1-.1 9.2-.2L33.1 247.8c-1.8 6.8-1.3 14 1.4 20.5z"]
            }, Kg = dh, D7 = {
              prefix: "fas",
              iconName: "crow",
              icon: [640, 512, [], "f520", "M456 0c-48.6 0-88 39.4-88 88v29.2L12.5 390.6c-14 10.8-16.6 30.9-5.9 44.9s30.9 16.6 44.9 5.9L126.1 384H259.2l46.6 113.1c5 12.3 19.1 18.1 31.3 13.1s18.1-19.1 13.1-31.3L311.1 384H352c1.1 0 2.1 0 3.2 0l46.6 113.2c5 12.3 19.1 18.1 31.3 13.1s18.1-19.1 13.1-31.3l-42-102C484.9 354.1 544 280 544 192V128v-8l80.5-20.1c8.6-2.1 13.8-10.8 11.6-19.4C629 52 603.4 32 574 32H523.9C507.7 12.5 483.3 0 456 0zm0 64a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, Rq = {
              prefix: "fas",
              iconName: "sailboat",
              icon: [576, 512, [], "e445", "M256 16c0-7 4.5-13.2 11.2-15.3s13.9 .4 17.9 6.1l224 320c3.4 4.9 3.8 11.3 1.1 16.6s-8.2 8.6-14.2 8.6H272c-8.8 0-16-7.2-16-16V16zM212.1 96.5c7 1.9 11.9 8.2 11.9 15.5V336c0 8.8-7.2 16-16 16H80c-5.7 0-11-3-13.8-8s-2.9-11-.1-16l128-224c3.6-6.3 11-9.4 18-7.5zM5.7 404.3C2.8 394.1 10.5 384 21.1 384H554.9c10.6 0 18.3 10.1 15.4 20.3l-4 14.3C550.7 473.9 500.4 512 443 512H133C75.6 512 25.3 473.9 9.7 418.7l-4-14.3z"]
            }, Vq = {
              prefix: "fas",
              iconName: "window-restore",
              icon: [512, 512, [], "f2d2", "M432 64H208c-8.8 0-16 7.2-16 16V96H128V80c0-44.2 35.8-80 80-80H432c44.2 0 80 35.8 80 80V304c0 44.2-35.8 80-80 80H416V320h16c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16zM0 192c0-35.3 28.7-64 64-64H320c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V192zm64 32c0 17.7 14.3 32 32 32H288c17.7 0 32-14.3 32-32s-14.3-32-32-32H96c-17.7 0-32 14.3-32 32z"]
            }, Jg = {
              prefix: "fas",
              iconName: "square-plus",
              icon: [448, 512, [61846, "plus-square"], "f0fe", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM200 344V280H136c-13.3 0-24-10.7-24-24s10.7-24 24-24h64V168c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H248v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]
            }, zg = Jg, xP = {
              prefix: "fas",
              iconName: "torii-gate",
              icon: [512, 512, [9961], "f6a1", "M0 80c0 26.5 21.5 48 48 48H64v64h64V128h96v64h64V128h96v64h64V128h16c26.5 0 48-21.5 48-48V13.4C512 6 506 0 498.6 0c-1.7 0-3.4 .3-5 1l-49 19.6C425.7 28.1 405.5 32 385.2 32H126.8c-20.4 0-40.5-3.9-59.4-11.4L18.4 1c-1.6-.6-3.3-1-5-1C6 0 0 6 0 13.4V80zM64 288V480c0 17.7 14.3 32 32 32s32-14.3 32-32V288H384V480c0 17.7 14.3 32 32 32s32-14.3 32-32V288h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H64z"]
            }, Cq = {
              prefix: "fas",
              iconName: "frog",
              icon: [576, 512, [], "f52e", "M368 32c41.7 0 75.9 31.8 79.7 72.5l85.6 26.3c25.4 7.8 42.8 31.3 42.8 57.9c0 21.8-11.7 41.9-30.7 52.7L400.8 323.5 493.3 416H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H480c-8.5 0-16.6-3.4-22.6-9.4L346.9 360.2c11.7-36 3.2-77.1-25.4-105.7c-40.6-40.6-106.3-40.6-146.9-.1L101 324.4c-6.4 6.1-6.7 16.2-.6 22.6s16.2 6.6 22.6 .6l73.8-70.2 .1-.1 .1-.1c3.5-3.5 7.3-6.6 11.3-9.2c27.9-18.5 65.9-15.4 90.5 9.2c24.7 24.7 27.7 62.9 9 90.9c-2.6 3.8-5.6 7.5-9 10.9L261.8 416H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H64c-35.3 0-64-28.7-64-64C0 249.6 127 112.9 289.3 97.5C296.2 60.2 328.8 32 368 32zm0 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
            }, e9 = {
              prefix: "fas",
              iconName: "bucket",
              icon: [448, 512, [], "e4cf", "M96 152v8H48v-8C48 68.1 116.1 0 200 0h48c83.9 0 152 68.1 152 152v8H352v-8c0-57.4-46.6-104-104-104H200C142.6 48 96 94.6 96 152zM0 224c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32h-5.1L388.5 469c-2.6 24.4-23.2 43-47.7 43H107.2c-24.6 0-45.2-18.5-47.7-43L37.1 256H32c-17.7 0-32-14.3-32-32z"]
            }, m4 = {
              prefix: "fas",
              iconName: "image",
              icon: [512, 512, [], "f03e", "M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6h96 32H424c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
            }, $a = {
              prefix: "fas",
              iconName: "microphone",
              icon: [384, 512, [], "f130", "M192 0C139 0 96 43 96 96V256c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h72 72c13.3 0 24-10.7 24-24s-10.7-24-24-24H216V430.4c85.8-11.7 152-85.3 152-174.4V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128s-128-57.3-128-128V216z"]
            }, B4 = {
              prefix: "fas",
              iconName: "cow",
              icon: [640, 512, [128004], "f6c8", "M96 224v32V416c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V327.8c9.9 6.6 20.6 12 32 16.1V368c0 8.8 7.2 16 16 16s16-7.2 16-16V351.1c5.3 .6 10.6 .9 16 .9s10.7-.3 16-.9V368c0 8.8 7.2 16 16 16s16-7.2 16-16V343.8c11.4-4 22.1-9.4 32-16.1V416c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V256l32 32v49.5c0 9.5 2.8 18.7 8.1 26.6L530 427c8.8 13.1 23.5 21 39.3 21c22.5 0 41.9-15.9 46.3-38l20.3-101.6c2.6-13-.3-26.5-8-37.3l-3.9-5.5V184c0-13.3-10.7-24-24-24s-24 10.7-24 24v14.4l-52.9-74.1C496 86.5 452.4 64 405.9 64H272 256 192 144C77.7 64 24 117.7 24 184v54C9.4 249.8 0 267.8 0 288v17.6c0 8 6.4 14.4 14.4 14.4C46.2 320 72 294.2 72 262.4V256 224 184c0-24.3 12.1-45.8 30.5-58.9C98.3 135.9 96 147.7 96 160v64zM560 336a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM166.6 166.6c-4.2-4.2-6.6-10-6.6-16c0-12.5 10.1-22.6 22.6-22.6H361.4c12.5 0 22.6 10.1 22.6 22.6c0 6-2.4 11.8-6.6 16l-23.4 23.4C332.2 211.8 302.7 224 272 224s-60.2-12.2-81.9-33.9l-23.4-23.4z"]
            }, j7 = {
              prefix: "fas",
              iconName: "caret-up",
              icon: [320, 512, [], "f0d8", "M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8H288c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]
            }, W4 = {
              prefix: "fas",
              iconName: "screwdriver",
              icon: [512, 512, [129691], "f54a", "M465 7c-8.5-8.5-22-9.4-31.6-2.1l-104 80c-5.9 4.5-9.4 11.6-9.4 19v54.1l-85.6 85.6c6.7 4.2 13 9.3 18.8 15.1s10.9 12.2 15.1 18.8L353.9 192H408c7.5 0 14.5-3.5 19-9.4l80-104c7.4-9.6 6.5-23.1-2.1-31.6L465 7zM121.4 281.4l-112 112c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l112-112c30.2-30.2 30.2-79.1 0-109.3s-79.1-30.2-109.3 0z"]
            }, Oq = {
              prefix: "fas",
              iconName: "folder-closed",
              icon: [512, 512, [], "e185", "M448 480H64c-35.3 0-64-28.7-64-64V192H512V416c0 35.3-28.7 64-64 64zm64-320H0V96C0 60.7 28.7 32 64 32H192c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8H448c35.3 0 64 28.7 64 64z"]
            }, S4 = {
              prefix: "fas",
              iconName: "house-tsunami",
              icon: [576, 512, [], "e515", "M80.8 136.5C104.9 93.8 152.6 64 209 64c16.9 0 33.1 2.7 48.2 7.7c16.8 5.5 34.9-3.6 40.4-20.4s-3.6-34.9-20.4-40.4C255.8 3.8 232.8 0 209 0C95.2 0 0 88 0 200c0 91.6 53.5 172.1 142.2 194.1c13.4 3.8 27.5 5.9 42.2 5.9c.7 0 1.4 0 2.1-.1c1.8 0 3.7 .1 5.5 .1l0 0c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.5-27.3-10.1-39.2-1.7l0 0C439.4 325.2 410.9 336 384 336c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0c-22.4 15.5-49.9 26.1-77.4 26.1c0 0-.1 0-.1 0c-12.4 0-24-1.5-34.9-4.3C121.6 320.2 96 287 96 248c0-48.5 39.5-88 88.4-88c13.5 0 26.1 3 37.5 8.3c16 7.5 35.1 .6 42.5-15.5s.6-35.1-15.5-42.5C229.3 101.1 207.4 96 184.4 96c-40 0-76.4 15.4-103.6 40.5zm252-18.1c-8.1 6-12.8 15.5-12.8 25.6V265c1.6 1 3.3 2 4.8 3.1c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.3 78.1 3.4c10.6 8.8 24.2 15.6 37.3 18.6c5.8 1.4 11.2 3.4 16.2 6.2c.7-2.7 1.1-5.5 1.1-8.4l-.4-144c0-10-4.7-19.4-12.7-25.5l-95.5-72c-11.4-8.6-27.1-8.6-38.5 0l-96 72zM384 448c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1l0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7l0 0C439.4 437.2 410.9 448 384 448z"]
            }, Gg = {
              prefix: "fas",
              iconName: "square-nfi",
              icon: [448, 512, [], "e576", "M0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zm75.7 64.6C68.8 162.5 64 168.8 64 176V336c0 8.8 7.2 16 16 16s16-7.2 16-16V233.8l66.3 110.5c3.7 6.2 11.1 9.1 18 7.2s11.7-8.2 11.7-15.4V176c0-8.8-7.2-16-16-16s-16 7.2-16 16V278.2L93.7 167.8c-3.7-6.2-11.1-9.1-18-7.2zM224 176v64 96c0 8.8 7.2 16 16 16s16-7.2 16-16V256h48c8.8 0 16-7.2 16-16s-7.2-16-16-16H256V192h48c8.8 0 16-7.2 16-16s-7.2-16-16-16H240c-8.8 0-16 7.2-16 16zm160 0c0-8.8-7.2-16-16-16s-16 7.2-16 16V336c0 8.8 7.2 16 16 16s16-7.2 16-16V176z"]
            }, U4 = {
              prefix: "fas",
              iconName: "arrow-up-from-ground-water",
              icon: [576, 512, [], "e4b5", "M288 352c17.7 0 32-14.3 32-32V109.3l25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-80-80c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L256 109.3V320c0 17.7 14.3 32 32 32zm-18.5 69.9C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1l0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7l0 0C439.4 437.2 410.9 448 384 448c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0zM192 192H48c-26.5 0-48 21.5-48 48V425c5.3-3.1 11.2-5.4 17.5-6.9c13.1-3.1 26.7-9.8 37.3-18.6c22.2-18.7 54.3-20.1 78.1-3.4c18 12.4 40.1 20.3 59.1 20.3V192zm384 48c0-26.5-21.5-48-48-48H384V416.5h0c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.3 78.1 3.4c10.6 8.8 24.2 15.6 37.3 18.6c6.3 1.5 12.1 3.8 17.5 6.9V240z"]
            }, N6 = {
              prefix: "fas",
              iconName: "martini-glass",
              icon: [512, 512, [127864, "glass-martini-alt"], "f57b", "M32 0C19.1 0 7.4 7.8 2.4 19.8s-2.2 25.7 6.9 34.9L224 269.3V448H160c-17.7 0-32 14.3-32 32s14.3 32 32 32h96 96c17.7 0 32-14.3 32-32s-14.3-32-32-32H288V269.3L502.6 54.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 0 480 0H32zM173.3 128l-64-64H402.7l-64 64H173.3z"]
            }, Zg = N6, w7 = {
              prefix: "fas",
              iconName: "rotate-left",
              icon: [512, 512, ["rotate-back", "rotate-backward", "undo-alt"], "f2ea", "M48.5 224H40c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H48.5z"]
            }, cu = w7, H3 = w7, DP = w7, g3 = {
              prefix: "fas",
              iconName: "table-columns",
              icon: [512, 512, ["columns"], "f0db", "M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zm64 64V416H224V160H64zm384 0H288V416H448V160z"]
            }, vh = g3, jP = {
              prefix: "fas",
              iconName: "lemon",
              icon: [448, 512, [127819], "f094", "M448 96c0-35.3-28.7-64-64-64c-6.6 0-13 1-19 2.9c-22.5 7-48.1 14.9-71 9c-75.2-19.1-156.4 11-213.7 68.3S-7.2 250.8 11.9 326c5.8 22.9-2 48.4-9 71C1 403 0 409.4 0 416c0 35.3 28.7 64 64 64c6.6 0 13-1 19.1-2.9c22.5-7 48.1-14.9 71-9c75.2 19.1 156.4-11 213.7-68.3s87.5-138.5 68.3-213.7c-5.8-22.9 2-48.4 9-71c1.9-6 2.9-12.4 2.9-19.1zM212.5 127.4c-54.6 16-101.1 62.5-117.1 117.1C92.9 253 84 257.8 75.5 255.4S62.2 244 64.6 235.5c19.1-65.1 73.7-119.8 138.9-138.9c8.5-2.5 17.4 2.4 19.9 10.9s-2.4 17.4-10.9 19.9z"]
            }, yq = {
              prefix: "fas",
              iconName: "head-side-mask",
              icon: [576, 512, [], "e063", "M32 224.2c0-22.2 3.2-43.6 9.2-63.9L262.2 321c-4 9.5-6.2 20-6.2 31V512H128c-17.7 0-32-14.3-32-32V407.3c0-16.7-6.9-32.5-17.1-45.8C48.6 322.4 32 274.1 32 224.2zm248.3 70.4L53 129.3C88.7 53 166.2 0 256 0h24c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c5.4 6.7 8.6 14.8 9.4 23.2H336c-21.7 0-41.3 8.6-55.7 22.6zM336 304H534l0 0h10l-19.7 64H368c-8.8 0-16 7.2-16 16s7.2 16 16 16H514.5l-9.8 32H368c-8.8 0-16 7.2-16 16s7.2 16 16 16H494.8l-.9 2.8c-8.3 26.9-33.1 45.2-61.2 45.2H288V352c0-14 6-26.7 15.6-35.4c0 0 0 0 0 0c8.5-7.8 19.9-12.6 32.4-12.6zm48-80a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, m7 = {
              prefix: "fas",
              iconName: "handshake",
              icon: [640, 512, [], "f2b5", "M323.4 85.2l-96.8 78.4c-16.1 13-19.2 36.4-7 53.1c12.9 17.8 38 21.3 55.3 7.8l99.3-77.2c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L512 316.8V128h-.7l-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2zm22.8 124.4l-51.7 40.2C263 274.4 217.3 268 193.7 235.6c-22.2-30.5-16.6-73.1 12.7-96.8l83.2-67.3c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-72 48V352h28.2l91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c4.5-4.9 7.8-10.6 9.9-16.5c19.4 13 45.8 10.3 62.1-7.5c17.9-19.5 16.6-49.9-2.9-67.8l-134.2-123zM16 128c-8.8 0-16 7.2-16 16V352c0 17.7 14.3 32 32 32H64c17.7 0 32-14.3 32-32V128H16zM48 320a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM544 128V352c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V144c0-8.8-7.2-16-16-16H544zm32 208a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
            }, wP = {
              prefix: "fas",
              iconName: "gem",
              icon: [512, 512, [128142], "f3a5", "M116.7 33.8c4.5-6.1 11.7-9.8 19.3-9.8H376c7.6 0 14.8 3.6 19.3 9.8l112 152c6.8 9.2 6.1 21.9-1.5 30.4l-232 256c-4.5 5-11 7.9-17.8 7.9s-13.2-2.9-17.8-7.9l-232-256c-7.7-8.5-8.3-21.2-1.5-30.4l112-152zm38.5 39.8c-3.3 2.5-4.2 7-2.1 10.5l57.4 95.6L63.3 192c-4.1 .3-7.3 3.8-7.3 8s3.2 7.6 7.3 8l192 16c.4 0 .9 0 1.3 0l192-16c4.1-.3 7.3-3.8 7.3-8s-3.2-7.6-7.3-8L301.5 179.8l57.4-95.6c2.1-3.5 1.2-8.1-2.1-10.5s-7.9-2-10.7 1L256 172.2 165.9 74.6c-2.8-3-7.4-3.4-10.7-1z"]
            }, X3 = {
              prefix: "fas",
              iconName: "dolly",
              icon: [576, 512, ["dolly-box"], "f472", "M0 32C0 14.3 14.3 0 32 0h72.9c27.5 0 52 17.6 60.7 43.8L257.7 320c30.1 .5 56.8 14.9 74 37l202.1-67.4c16.8-5.6 34.9 3.5 40.5 20.2s-3.5 34.9-20.2 40.5L352 417.7c-.9 52.2-43.5 94.3-96 94.3c-53 0-96-43-96-96c0-30.8 14.5-58.2 37-75.8L104.9 64H32C14.3 64 0 49.7 0 32zM244.8 134.5c-5.5-16.8 3.7-34.9 20.5-40.3L311 79.4l19.8 60.9 60.9-19.8L371.8 59.6l45.7-14.8c16.8-5.5 34.9 3.7 40.3 20.5l49.4 152.2c5.5 16.8-3.7 34.9-20.5 40.3L334.5 307.2c-16.8 5.5-34.9-3.7-40.3-20.5L244.8 134.5z"]
            }, T3 = X3, mP = {
              prefix: "fas",
              iconName: "smoking",
              icon: [640, 512, [128684], "f48d", "M448 32V43c0 38.2 15.2 74.8 42.2 101.8l21 21c21 21 32.8 49.5 32.8 79.2v11c0 17.7-14.3 32-32 32s-32-14.3-32-32V245c0-12.7-5.1-24.9-14.1-33.9l-21-21C405.9 151.1 384 98.1 384 43V32c0-17.7 14.3-32 32-32s32 14.3 32 32zM576 256V245c0-38.2-15.2-74.8-42.2-101.8l-21-21c-21-21-32.8-49.5-32.8-79.2V32c0-17.7 14.3-32 32-32s32 14.3 32 32V43c0 12.7 5.1 24.9 14.1 33.9l21 21c39 39 60.9 91.9 60.9 147.1v11c0 17.7-14.3 32-32 32s-32-14.3-32-32zM0 416c0-35.3 28.7-64 64-64H416c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H64c-35.3 0-64-28.7-64-64V416zm224 0v32H384V416H224zm288-64c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V384c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V384c0-17.7 14.3-32 32-32z"]
            }, uh = {
              prefix: "fas",
              iconName: "minimize",
              icon: [512, 512, ["compress-arrows-alt"], "f78c", "M456 224H312c-13.3 0-24-10.7-24-24V56c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l40 40L442.3 5.7C446 2 450.9 0 456 0s10 2 13.7 5.7l36.7 36.7C510 46 512 50.9 512 56s-2 10-5.7 13.7L433 143l40 40c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8zm0 64c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-40 40 73.4 73.4c3.6 3.6 5.7 8.5 5.7 13.7s-2 10-5.7 13.7l-36.7 36.7C466 510 461.1 512 456 512s-10-2-13.7-5.7L369 433l-40 40c-6.9 6.9-17.2 8.9-26.2 5.2s-14.8-12.5-14.8-22.2V312c0-13.3 10.7-24 24-24H456zm-256 0c13.3 0 24 10.7 24 24V456c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-40-40L69.7 506.3C66 510 61.1 512 56 512s-10-2-13.7-5.7L5.7 469.7C2 466 0 461.1 0 456s2-10 5.7-13.7L79 369 39 329c-6.9-6.9-8.9-17.2-5.2-26.2s12.5-14.8 22.2-14.8H200zM56 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l40-40L5.7 69.7C2 66 0 61.1 0 56s2-10 5.7-13.7L42.3 5.7C46 2 50.9 0 56 0s10 2 13.7 5.7L143 79l40-40c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2V200c0 13.3-10.7 24-24 24H56z"]
            }, I4 = uh, B7 = {
              prefix: "fas",
              iconName: "monument",
              icon: [384, 512, [], "f5a6", "M180.7 4.7c6.2-6.2 16.4-6.2 22.6 0l80 80c2.5 2.5 4.1 5.8 4.6 9.3l40.2 322H55.9L96.1 94c.4-3.5 2-6.8 4.6-9.3l80-80zM152 272c-13.3 0-24 10.7-24 24s10.7 24 24 24h80c13.3 0 24-10.7 24-24s-10.7-24-24-24H152zM32 448H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, R4 = {
              prefix: "fas",
              iconName: "snowplow",
              icon: [640, 512, [], "f7d2", "M298.9 64l68.6 160H256l-64-64V64H298.9zM445.1 242.7l-87.4-204C347.6 15.3 324.5 0 298.9 0H176c-26.5 0-48 21.5-48 48V160H96c-17.7 0-32 14.3-32 32V298.8C26.2 316.8 0 355.3 0 400c0 61.9 50.1 112 112 112H368c61.9 0 112-50.1 112-112c0-17.2-3.9-33.5-10.8-48H512v50.7c0 17 6.7 33.3 18.7 45.3l54.6 54.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L576 402.7V320 235.2L633 164c11-13.8 8.8-33.9-5-45s-33.9-8.8-45 5l-57 71.2c-9.1 11.3-14 25.4-14 40V288H448V256.7c.1-2.4-.2-4.8-.6-7.1s-1.2-4.7-2.2-6.8zM368 352c26.5 0 48 21.5 48 48s-21.5 48-48 48H112c-26.5 0-48-21.5-48-48s21.5-48 48-48H368zM144 400a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm216 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm-56-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM200 424a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
            }, W7 = {
              prefix: "fas",
              iconName: "angles-right",
              icon: [512, 512, [187, "angle-double-right"], "f101", "M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"]
            }, S7 = W7, hA = {
              prefix: "fas",
              iconName: "cannabis",
              icon: [512, 512, [], "f55f", "M256 0c5.3 0 10.3 2.7 13.3 7.1c15.8 23.5 36.7 63.7 49.2 109c7.2 26.4 11.8 55.2 10.4 84c11.5-8.8 23.7-16.7 35.8-23.6c41-23.3 84.4-36.9 112.2-42.5c5.2-1 10.7 .6 14.4 4.4s5.4 9.2 4.4 14.5c-5.6 27.7-19.3 70.9-42.7 111.7c-9.1 15.9-19.9 31.7-32.4 46.3c27.8 6.6 52.4 17.3 67.2 25.5c5.1 2.8 8.2 8.2 8.2 14s-3.2 11.2-8.2 14c-15.2 8.4-40.9 19.5-69.8 26.1c-20.2 4.6-42.9 7.2-65.2 4.6l8.3 33.1c1.5 6.1-.6 12.4-5.5 16.4s-11.6 4.6-17.2 1.9L280 417.2V488c0 13.3-10.7 24-24 24s-24-10.7-24-24V417.2l-58.5 29.1c-5.6 2.8-12.3 2.1-17.2-1.9s-7-10.3-5.5-16.4l8.3-33.1c-22.2 2.6-45 0-65.2-4.6c-28.9-6.6-54.6-17.6-69.8-26.1c-5.1-2.8-8.2-8.2-8.2-14s3.2-11.2 8.2-14c14.8-8.2 39.4-18.8 67.2-25.5C78.9 296.3 68.1 280.5 59 264.6c-23.4-40.8-37.1-84-42.7-111.7c-1.1-5.2 .6-10.7 4.4-14.5s9.2-5.4 14.4-4.4c27.9 5.5 71.2 19.2 112.2 42.5c12.1 6.9 24.3 14.7 35.8 23.6c-1.4-28.7 3.1-57.6 10.4-84c12.5-45.3 33.4-85.5 49.2-109c3-4.4 8-7.1 13.3-7.1z"]
            }, lh = {
              prefix: "fas",
              iconName: "circle-play",
              icon: [512, 512, [61469, "play-circle"], "f144", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9V344c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"]
            }, Ph = lh, V4 = {
              prefix: "fas",
              iconName: "tablets",
              icon: [640, 512, [], "f490", "M614.3 247c16.3-25 25.7-54.9 25.7-87C640 71.6 568.4 0 480 0c-32.1 0-61.9 9.4-87 25.7c-7.9 5.2-8.5 16.2-1.8 22.9L591.4 248.8c6.7 6.7 17.8 6.2 22.9-1.8zM567 294.3c7.9-5.2 8.5-16.2 1.8-22.9L368.6 71.2c-6.7-6.7-17.8-6.2-22.9 1.8c-16.3 25-25.7 54.9-25.7 87c0 88.4 71.6 160 160 160c32.1 0 61.9-9.4 87-25.7zM301.5 368H18.5c-9.5 0-16.9 8.2-15 17.5C18.9 457.8 83.1 512 160 512s141.1-54.2 156.5-126.5c2-9.3-5.5-17.5-15-17.5zm0-32c9.5 0 16.9-8.2 15-17.5C301.1 246.2 236.9 192 160 192S18.9 246.2 3.5 318.5c-2 9.3 5.5 17.5 15 17.5H301.5z"]
            }, C4 = {
              prefix: "fas",
              iconName: "ethernet",
              icon: [512, 512, [], "f796", "M0 224V416c0 17.7 14.3 32 32 32H96V336c0-8.8 7.2-16 16-16s16 7.2 16 16V448h64V336c0-8.8 7.2-16 16-16s16 7.2 16 16V448h64V336c0-8.8 7.2-16 16-16s16 7.2 16 16V448h64V336c0-8.8 7.2-16 16-16s16 7.2 16 16V448h64c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H448V160c0-17.7-14.3-32-32-32H384V96c0-17.7-14.3-32-32-32H160c-17.7 0-32 14.3-32 32v32H96c-17.7 0-32 14.3-32 32v32H32c-17.7 0-32 14.3-32 32z"]
            }, q3 = {
              prefix: "fas",
              iconName: "euro-sign",
              icon: [320, 512, [8364, "eur", "euro"], "f153", "M48.1 240c-.1 2.7-.1 5.3-.1 8v16c0 2.7 0 5.3 .1 8H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H60.3C89.9 419.9 170 480 264 480h24c17.7 0 32-14.3 32-32s-14.3-32-32-32H264c-57.9 0-108.2-32.4-133.9-80H256c17.7 0 32-14.3 32-32s-14.3-32-32-32H112.2c-.1-2.6-.2-5.3-.2-8V248c0-2.7 .1-5.4 .2-8H256c17.7 0 32-14.3 32-32s-14.3-32-32-32H130.1c25.7-47.6 76-80 133.9-80h24c17.7 0 32-14.3 32-32s-14.3-32-32-32H264C170 32 89.9 92.1 60.3 176H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H48.1z"]
            }, uo = q3, BP = q3, O4 = {
              prefix: "fas",
              iconName: "chair",
              icon: [448, 512, [129681], "f6c0", "M248 48V256h48V58.7c23.9 13.8 40 39.7 40 69.3V256h48V128C384 57.3 326.7 0 256 0H192C121.3 0 64 57.3 64 128V256h48V128c0-29.6 16.1-55.5 40-69.3V256h48V48h48zM48 288c-12.1 0-23.2 6.8-28.6 17.7l-16 32c-5 9.9-4.4 21.7 1.4 31.1S20.9 384 32 384l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32V384H352v96c0 17.7 14.3 32 32 32s32-14.3 32-32V384c11.1 0 21.4-5.7 27.2-15.2s6.4-21.2 1.4-31.1l-16-32C423.2 294.8 412.1 288 400 288H48z"]
            }, b3 = {
              prefix: "fas",
              iconName: "circle-check",
              icon: [512, 512, [61533, "check-circle"], "f058", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
            }, D = b3, B = {
              prefix: "fas",
              iconName: "circle-stop",
              icon: [512, 512, [62094, "stop-circle"], "f28d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 160H320c17.7 0 32 14.3 32 32V320c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32z"]
            }, E = B, z = {
              prefix: "fas",
              iconName: "compass-drafting",
              icon: [512, 512, ["drafting-compass"], "f568", "M352 96c0 14.3-3.1 27.9-8.8 40.2L396 227.4c-23.7 25.3-54.2 44.1-88.5 53.6L256 192h0 0l-68 117.5c21.5 6.8 44.3 10.5 68.1 10.5c70.7 0 133.8-32.7 174.9-84c11.1-13.8 31.2-16 45-5s16 31.2 5 45C428.1 341.8 347 384 256 384c-35.4 0-69.4-6.4-100.7-18.1L98.7 463.7C94 471.8 87 478.4 78.6 482.6L23.2 510.3c-5 2.5-10.9 2.2-15.6-.7S0 501.5 0 496V440.6c0-8.4 2.2-16.7 6.5-24.1l60-103.7C53.7 301.6 41.8 289.3 31.2 276c-11.1-13.8-8.8-33.9 5-45s33.9-8.8 45 5c5.7 7.1 11.8 13.8 18.2 20.1l69.4-119.9c-5.6-12.2-8.8-25.8-8.8-40.2c0-53 43-96 96-96s96 43 96 96zm21 297.9c32.6-12.8 62.5-30.8 88.9-52.9l43.7 75.5c4.2 7.3 6.5 15.6 6.5 24.1V496c0 5.5-2.9 10.7-7.6 13.6s-10.6 3.2-15.6 .7l-55.4-27.7c-8.4-4.2-15.4-10.8-20.1-18.9L373 393.9zM256 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, Ae = z, pe = {
              prefix: "fas",
              iconName: "plate-wheat",
              icon: [512, 512, [], "e55a", "M176 32c44.2 0 80 35.8 80 80v16c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80V48c0-8.8 7.2-16 16-16zM56 64h48c13.3 0 24 10.7 24 24s-10.7 24-24 24H56c-13.3 0-24-10.7-24-24s10.7-24 24-24zM24 136H136c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 96c0-13.3 10.7-24 24-24h48c13.3 0 24 10.7 24 24s-10.7 24-24 24H56c-13.3 0-24-10.7-24-24zM272 48c0-8.8 7.2-16 16-16c44.2 0 80 35.8 80 80v16c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80V48zM400 32c44.2 0 80 35.8 80 80v16c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80V48c0-8.8 7.2-16 16-16zm80 160v16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16V256c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM352 176c8.8 0 16 7.2 16 16v16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16V256c0-44.2 35.8-80 80-80zm-96 16v16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16V256c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM3.5 347.6C1.6 332.9 13 320 27.8 320H484.2c14.8 0 26.2 12.9 24.4 27.6C502.3 397.8 464.2 437 416 446v2c0 17.7-14.3 32-32 32H128c-17.7 0-32-14.3-32-32v-2c-48.2-9-86.3-48.2-92.5-98.4z"]
            }, Re = {
              prefix: "fas",
              iconName: "icicles",
              icon: [512, 512, [], "f7ad", "M75.8 304.8L1 35.7c-.7-2.5-1-5-1-7.5C0 12.6 12.6 0 28.2 0H482.4C498.8 0 512 13.2 512 29.6c0 1.6-.1 3.3-.4 4.9L434.6 496.1c-1.5 9.2-9.5 15.9-18.8 15.9c-9.2 0-17.1-6.6-18.7-15.6L336 160 307.2 303.9c-1.9 9.3-10.1 16.1-19.6 16.1c-9.2 0-17.2-6.2-19.4-15.1L240 192 210.6 368.2c-1.5 9.1-9.4 15.8-18.6 15.8s-17.1-6.7-18.6-15.8L144 192 115.9 304.3c-2.3 9.2-10.6 15.7-20.1 15.7c-9.3 0-17.5-6.2-20-15.2z"]
            }, ot = {
              prefix: "fas",
              iconName: "person-shelter",
              icon: [512, 512, [], "e54f", "M271.9 4.2c-9.8-5.6-21.9-5.6-31.8 0l-224 128C6.2 137.9 0 148.5 0 160V480c0 17.7 14.3 32 32 32s32-14.3 32-32V178.6L256 68.9 448 178.6V480c0 17.7 14.3 32 32 32s32-14.3 32-32V160c0-11.5-6.2-22.1-16.1-27.8l-224-128zM256 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zm-8 280V400h16v88c0 13.3 10.7 24 24 24s24-10.7 24-24V313.5l26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3H246.2c-32.4 0-62.1 17.8-77.5 46.3l-37.9 70.3c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L200 313.5V488c0 13.3 10.7 24 24 24s24-10.7 24-24z"]
            }, lt = {
              prefix: "fas",
              iconName: "neuter",
              icon: [384, 512, [9906], "f22c", "M80 176a112 112 0 1 1 224 0A112 112 0 1 1 80 176zM224 349.1c81.9-15 144-86.8 144-173.1C368 78.8 289.2 0 192 0S16 78.8 16 176c0 86.3 62.1 158.1 144 173.1V480c0 17.7 14.3 32 32 32s32-14.3 32-32V349.1z"]
            }, Jt = {
              prefix: "fas",
              iconName: "id-badge",
              icon: [384, 512, [], "f2c1", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zm96 320h64c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM144 64h96c8.8 0 16 7.2 16 16s-7.2 16-16 16H144c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, Wr = {
              prefix: "fas",
              iconName: "marker",
              icon: [512, 512, [], "f5a1", "M481 31C445.1-4.8 386.9-4.8 351 31l-15 15L322.9 33C294.8 4.9 249.2 4.9 221.1 33L135 119c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0L255 66.9c9.4-9.4 24.6-9.4 33.9 0L302.1 80 186.3 195.7 316.3 325.7 481 161c35.9-35.9 35.9-94.1 0-129.9zM293.7 348.3L163.7 218.3 99.5 282.5c-48 48-80.8 109.2-94.1 175.8l-5 25c-1.6 7.9 .9 16 6.6 21.7s13.8 8.1 21.7 6.6l25-5c66.6-13.3 127.8-46.1 175.8-94.1l64.2-64.2z"]
            }, Xr = {
              prefix: "fas",
              iconName: "face-laugh-beam",
              icon: [512, 512, [128513, "laugh-beam"], "f59a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1H393.6c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zM217.6 212.8l0 0 0 0-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2 0 0 0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8l0 0 0 0zm160 0l0 0-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2 0 0 0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8l0 0 0 0 0 0z"]
            }, Dr = Xr, Tn = {
              prefix: "fas",
              iconName: "helicopter-symbol",
              icon: [512, 512, [], "e502", "M445.3 224H510C495.6 108.2 403.8 16.4 288 2V66.7C368.4 80.1 431.9 143.6 445.3 224zM510 288H445.3C431.9 368.4 368.4 431.9 288 445.4V510c115.8-14.4 207.6-106.2 222-222zM2 288C16.4 403.8 108.2 495.6 224 510V445.4C143.6 431.9 80.1 368.4 66.7 288H2zm0-64H66.7C80.1 143.6 143.6 80.1 224 66.7V2C108.2 16.4 16.4 108.2 2 224zm206-64c0-17.7-14.3-32-32-32s-32 14.3-32 32V352c0 17.7 14.3 32 32 32s32-14.3 32-32V288h96v64c0 17.7 14.3 32 32 32s32-14.3 32-32V160c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H208V160z"]
            }, In = {
              prefix: "fas",
              iconName: "universal-access",
              icon: [512, 512, [], "f29a", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm161.5-86.1c-12.2-5.2-26.3 .4-31.5 12.6s.4 26.3 12.6 31.5l11.9 5.1c17.3 7.4 35.2 12.9 53.6 16.3v50.1c0 4.3-.7 8.6-2.1 12.6l-28.7 86.1c-4.2 12.6 2.6 26.2 15.2 30.4s26.2-2.6 30.4-15.2l24.4-73.2c1.3-3.8 4.8-6.4 8.8-6.4s7.6 2.6 8.8 6.4l24.4 73.2c4.2 12.6 17.8 19.4 30.4 15.2s19.4-17.8 15.2-30.4l-28.7-86.1c-1.4-4.1-2.1-8.3-2.1-12.6V235.5c18.4-3.5 36.3-8.9 53.6-16.3l11.9-5.1c12.2-5.2 17.8-19.3 12.6-31.5s-19.3-17.8-31.5-12.6L338.7 175c-26.1 11.2-54.2 17-82.7 17s-56.5-5.8-82.7-17l-11.9-5.1zM256 160a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
            }, Kn = {
              prefix: "fas",
              iconName: "circle-chevron-up",
              icon: [512, 512, ["chevron-circle-up"], "f139", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM377 271c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-87-87-87 87c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 167c9.4-9.4 24.6-9.4 33.9 0L377 271z"]
            }, La = Kn, mt = {
              prefix: "fas",
              iconName: "lari-sign",
              icon: [384, 512, [], "e1c8", "M144 32c17.7 0 32 14.3 32 32V96.7c5.3-.4 10.6-.7 16-.7s10.7 .2 16 .7V64c0-17.7 14.3-32 32-32s32 14.3 32 32v49.4c54.9 25.2 95.8 75.5 108.2 136.2c3.5 17.3-7.7 34.2-25 37.7s-34.2-7.7-37.7-25c-6.1-29.9-22.5-55.9-45.4-74.3V256c0 17.7-14.3 32-32 32s-32-14.3-32-32V161c-5.2-.7-10.6-1-16-1s-10.8 .3-16 1v95c0 17.7-14.3 32-32 32s-32-14.3-32-32V188.1C82.7 211.5 64 247.6 64 288c0 70.7 57.3 128 128 128H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H192 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H48.9C18.5 382 0 337.2 0 288c0-77.5 45.9-144.3 112-174.6V64c0-17.7 14.3-32 32-32z"]
            }, pt = {
              prefix: "fas",
              iconName: "volcano",
              icon: [512, 512, [127755], "f770", "M160 144c-35.3 0-64-28.7-64-64s28.7-64 64-64c15.7 0 30 5.6 41.2 15C212.4 12.4 232.7 0 256 0s43.6 12.4 54.8 31C322 21.6 336.3 16 352 16c35.3 0 64 28.7 64 64s-28.7 64-64 64c-14.7 0-28.3-5-39.1-13.3l-32 48C275.3 187 266 192 256 192s-19.3-5-24.9-13.3l-32-48C188.3 139 174.7 144 160 144zM144 352l48.4-24.2c10.2-5.1 21.6-7.8 33-7.8c19.6 0 38.4 7.8 52.2 21.6l32.5 32.5c6.3 6.3 14.9 9.9 23.8 9.9c11.3 0 21.8-5.6 28-15l9.7-14.6-58.9-66.3c-9.1-10.2-22.2-16.1-35.9-16.1H235.1c-13.7 0-26.8 5.9-35.9 16.1l-59.9 67.4L144 352zm19.4-95.8c18.2-20.5 44.3-32.2 71.8-32.2h41.8c27.4 0 53.5 11.7 71.8 32.2l150.2 169c8.5 9.5 13.2 21.9 13.2 34.7c0 28.8-23.4 52.2-52.2 52.2H52.2C23.4 512 0 488.6 0 459.8c0-12.8 4.7-25.1 13.2-34.7l150.2-169z"]
            }, It = {
              prefix: "fas",
              iconName: "person-walking-dashed-line-arrow-right",
              icon: [640, 512, [], "e553", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM550.6 153.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L530.7 224H384c-17.7 0-32 14.3-32 32s14.3 32 32 32H530.7l-25.4 25.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3l-80-80zM392 0c-13.3 0-24 10.7-24 24V72c0 13.3 10.7 24 24 24s24-10.7 24-24V24c0-13.3-10.7-24-24-24zm24 152c0-13.3-10.7-24-24-24s-24 10.7-24 24v16c0 13.3 10.7 24 24 24s24-10.7 24-24V152zM392 320c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24s24-10.7 24-24V344c0-13.3-10.7-24-24-24zm24 120c0-13.3-10.7-24-24-24s-24 10.7-24 24v48c0 13.3 10.7 24 24 24s24-10.7 24-24V440z"]
            }, Qr = {
              prefix: "fas",
              iconName: "sterling-sign",
              icon: [320, 512, [163, "gbp", "pound-sign"], "f154", "M112 160.4c0-35.5 28.8-64.4 64.4-64.4c6.9 0 13.8 1.1 20.4 3.3l81.2 27.1c16.8 5.6 34.9-3.5 40.5-20.2s-3.5-34.9-20.2-40.5L217 38.6c-13.1-4.4-26.8-6.6-40.6-6.6C105.5 32 48 89.5 48 160.4V224H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H48v44.5c0 17.4-4.7 34.5-13.7 49.4L4.6 431.5c-5.9 9.9-6.1 22.2-.4 32.2S20.5 480 32 480H288c17.7 0 32-14.3 32-32s-14.3-32-32-32H88.5l.7-1.1C104.1 390 112 361.5 112 332.5V288H224c17.7 0 32-14.3 32-32s-14.3-32-32-32H112V160.4z"]
            }, Jn = Qr, On = Qr, vi = {
              prefix: "fas",
              iconName: "viruses",
              icon: [640, 512, [], "e076", "M192 0c13.3 0 24 10.7 24 24V37.5c0 35.6 43.1 53.5 68.3 28.3l9.5-9.5c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-9.5 9.5C293 124.9 310.9 168 346.5 168H360c13.3 0 24 10.7 24 24s-10.7 24-24 24H346.5c-35.6 0-53.5 43.1-28.3 68.3l9.5 9.5c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-9.5-9.5C259.1 293 216 310.9 216 346.5V360c0 13.3-10.7 24-24 24s-24-10.7-24-24V346.5c0-35.6-43.1-53.5-68.3-28.3l-9.5 9.5c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l9.5-9.5C91 259.1 73.1 216 37.5 216H24c-13.3 0-24-10.7-24-24s10.7-24 24-24H37.5c35.6 0 53.5-43.1 28.3-68.3l-9.5-9.5c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l9.5 9.5C124.9 91 168 73.1 168 37.5V24c0-13.3 10.7-24 24-24zm48 224a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm-48-64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm320 80c0 33 39.9 49.5 63.2 26.2c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6C574.5 312.1 591 352 624 352c8.8 0 16 7.2 16 16s-7.2 16-16 16c-33 0-49.5 39.9-26.2 63.2c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0C551.9 446.5 512 463 512 496c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-33-39.9-49.5-63.2-26.2c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6C417.5 423.9 401 384 368 384c-8.8 0-16-7.2-16-16s7.2-16 16-16c33 0 49.5-39.9 26.2-63.2c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0C440.1 289.5 480 273 480 240c0-8.8 7.2-16 16-16s16 7.2 16 16zm0 112a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
            }, Wi = {
              prefix: "fas",
              iconName: "square-person-confined",
              icon: [448, 512, [], "e577", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm96 112a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm80 104c0-30.9 25.1-56 56-56s56 25.1 56 56V350.1c0 36.4-29.5 65.9-65.9 65.9c-17.5 0-34.3-6.9-46.6-19.3L184.8 342l-28.1 56.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l48-96c4.6-9.2 13.3-15.6 23.5-17.3s20.5 1.7 27.8 9L240 306.7V248z"]
            }, Af = {
              prefix: "fas",
              iconName: "user-tie",
              icon: [448, 512, [], "f508", "M224 256A128 128 0 1 1 224 0a128 128 0 1 1 0 256zM209.1 359.2l-18.6-31c-6.4-10.7 1.3-24.2 13.7-24.2H224h19.7c12.4 0 20.1 13.6 13.7 24.2l-18.6 31 33.4 123.9 36-146.9c2-8.1 9.8-13.4 17.9-11.3c70.1 17.6 121.9 81 121.9 156.4c0 17-13.8 30.7-30.7 30.7H285.5c-2.1 0-4-.4-5.8-1.1l.3 1.1H168l.3-1.1c-1.8 .7-3.8 1.1-5.8 1.1H30.7C13.8 512 0 498.2 0 481.3c0-75.5 51.9-138.9 121.9-156.4c8.1-2 15.9 3.3 17.9 11.3l36 146.9 33.4-123.9z"]
            }, xs = {
              prefix: "fas",
              iconName: "arrow-down-long",
              icon: [384, 512, ["long-arrow-down"], "f175", "M169.4 502.6c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 402.7 224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 370.7L86.6 329.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128z"]
            }, pu = xs, ch = {
              prefix: "fas",
              iconName: "tent-arrow-down-to-line",
              icon: [640, 512, [], "e57e", "M241.8 111.9c8.9 9.9 8.1 25-1.8 33.9l-80 72c-9.1 8.2-23 8.2-32.1 0l-80-72c-9.9-8.9-10.7-24-1.8-33.9s24-10.7 33.9-1.8l39.9 36L120 24c0-13.3 10.7-24 24-24s24 10.7 24 24l0 122.1 39.9-36c9.9-8.9 25-8.1 33.9 1.8zm122.8 22.6c11.5-8.7 27.3-8.7 38.8 0l168 128c6.6 5 11 12.5 12.3 20.7l24 160 .7 4.7c17.5 .2 31.6 14.4 31.6 32c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H159.6l.7-4.7 24-160c1.2-8.2 5.6-15.7 12.3-20.7l168-128zM384 448h76.8L384 320V448z"]
            }, RD = {
              prefix: "fas",
              iconName: "certificate",
              icon: [512, 512, [], "f0a3", "M211 7.3C205 1 196-1.4 187.6 .8s-14.9 8.9-17.1 17.3L154.7 80.6l-62-17.5c-8.4-2.4-17.4 0-23.5 6.1s-8.5 15.1-6.1 23.5l17.5 62L18.1 170.6c-8.4 2.1-15 8.7-17.3 17.1S1 205 7.3 211l46.2 45L7.3 301C1 307-1.4 316 .8 324.4s8.9 14.9 17.3 17.1l62.5 15.8-17.5 62c-2.4 8.4 0 17.4 6.1 23.5s15.1 8.5 23.5 6.1l62-17.5 15.8 62.5c2.1 8.4 8.7 15 17.1 17.3s17.3-.2 23.4-6.4l45-46.2 45 46.2c6.1 6.2 15 8.7 23.4 6.4s14.9-8.9 17.1-17.3l15.8-62.5 62 17.5c8.4 2.4 17.4 0 23.5-6.1s8.5-15.1 6.1-23.5l-17.5-62 62.5-15.8c8.4-2.1 15-8.7 17.3-17.1s-.2-17.3-6.4-23.4l-46.2-45 46.2-45c6.2-6.1 8.7-15 6.4-23.4s-8.9-14.9-17.3-17.1l-62.5-15.8 17.5-62c2.4-8.4 0-17.4-6.1-23.5s-15.1-8.5-23.5-6.1l-62 17.5L341.4 18.1c-2.1-8.4-8.7-15-17.1-17.3S307 1 301 7.3L256 53.5 211 7.3z"]
            }, kq = {
              prefix: "fas",
              iconName: "reply-all",
              icon: [576, 512, ["mail-reply-all"], "f122", "M209.4 39.5c-9.1-9.6-24.3-10-33.9-.9L33.8 173.2c-19.9 18.9-19.9 50.7 0 69.6L175.5 377.4c9.6 9.1 24.8 8.7 33.9-.9s8.7-24.8-.9-33.9L66.8 208 208.5 73.4c9.6-9.1 10-24.3 .9-33.9zM352 64c0-12.6-7.4-24.1-19-29.2s-25-3-34.4 5.4l-160 144c-6.7 6.1-10.6 14.7-10.6 23.8s3.9 17.7 10.6 23.8l160 144c9.4 8.5 22.9 10.6 34.4 5.4s19-16.6 19-29.2V288h32c53 0 96 43 96 96c0 30.4-12.8 47.9-22.2 56.7c-5.5 5.1-9.8 12-9.8 19.5c0 10.9 8.8 19.7 19.7 19.7c2.8 0 5.6-.6 8.1-1.9C494.5 467.9 576 417.3 576 304c0-97.2-78.8-176-176-176H352V64z"]
            }, VD = kq, CD = {
              prefix: "fas",
              iconName: "suitcase",
              icon: [512, 512, [129523], "f0f2", "M176 56V96H336V56c0-4.4-3.6-8-8-8H184c-4.4 0-8 3.6-8 8zM128 96V56c0-30.9 25.1-56 56-56H328c30.9 0 56 25.1 56 56V96v32V480H128V128 96zM64 96H96V480H64c-35.3 0-64-28.7-64-64V160c0-35.3 28.7-64 64-64zM448 480H416V96h32c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64z"]
            }, OD = {
              prefix: "fas",
              iconName: "person-skating",
              icon: [448, 512, ["skating"], "f7c5", "M352 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM128 128c0-17.7 14.3-32 32-32H319.4c43.6 0 64.6 53.4 32.8 83.1l-74.4 69.4 60.2 60.2c9 9 14.1 21.2 14.1 33.9V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V349.3l-77.9-77.8c-26.6-26.6-24.6-70.3 4.3-94.4l20.4-17H160c-17.7 0-32-14.3-32-32zM81.4 353.4l86.9-86.9c4.6 10 11 19.3 19.3 27.5l21.8 21.8-82.7 82.7c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3zm322.5 95.1c8.6 2.1 13.8 10.8 11.6 19.4l-.4 1.7c-6.2 24.9-28.6 42.4-54.3 42.4H272c-8.8 0-16-7.2-16-16s7.2-16 16-16h88.8c11 0 20.6-7.5 23.3-18.2l.4-1.7c2.1-8.6 10.8-13.8 19.4-11.6zM135.2 478.3l-6.2 3.1c-21.6 10.8-47.6 6.6-64.6-10.5L4.7 411.3c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l59.6 59.6c7.3 7.3 18.5 9.1 27.7 4.5l6.2-3.1c7.9-4 17.5-.7 21.5 7.2s.7 17.5-7.2 21.5z"]
            }, _g = OD, y4 = {
              prefix: "fas",
              iconName: "filter-circle-dollar",
              icon: [576, 512, ["funnel-dollar"], "f662", "M3.9 22.9C10.5 8.9 24.5 0 40 0H472c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L396.4 195.6C316.2 212.1 256 283 256 368c0 27.4 6.3 53.4 17.5 76.5c-1.6-.8-3.2-1.8-4.7-2.9l-64-48c-8.1-6-12.8-15.5-12.8-25.6V288.9L9 65.3C-.7 53.4-2.8 36.8 3.9 22.9zM288 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm120.8-32.6c.6-.9 1.8-2.1 4.2-3.4c5.1-2.7 12.5-4.1 18.7-4c8.2 .1 17.1 1.8 26.4 4.1c8.6 2.1 17.3-3.1 19.4-11.7s-3.1-17.3-11.7-19.4c-5.6-1.4-11.6-2.7-17.9-3.7V288c0-8.8-7.2-16-16-16s-16 7.2-16 16v9.5c-6.1 1.2-12.3 3.2-18 6.3c-11.8 6.3-23 18.4-21.8 37.2c1 16 11.7 25.3 21.6 30.7c8.8 4.7 19.7 7.8 28.6 10.3l1.8 .5c10.3 2.9 17.9 5.2 23.2 8.3c4.5 2.7 4.7 4.2 4.7 5.6c.1 2.4-.5 3.7-1 4.5c-.6 1-1.8 2.2-4 3.3c-4.7 2.5-11.8 3.8-18.5 3.6c-9.5-.3-18.5-3.1-29.9-6.8c-1.9-.6-3.8-1.2-5.8-1.8c-8.4-2.6-17.4 2.1-20 10.5s2.1 17.4 10.5 20c1.6 .5 3.3 1 5 1.6l0 0 0 0c7 2.3 15.1 4.8 23.7 6.6v11.4c0 8.8 7.2 16 16 16s16-7.2 16-16V438.7c6.2-1.1 12.5-3.1 18.3-6.2c12.1-6.5 22.3-18.7 21.7-36.9c-.5-16.2-10.3-26.3-20.5-32.3c-9.4-5.6-21.2-8.9-30.5-11.5l-.2 0c-10.4-2.9-18.3-5.2-23.9-8.2c-4.8-2.6-4.8-4-4.8-4.5l0-.1c-.1-1.9 .3-2.9 .8-3.6z"]
            }, Jm = y4, zm = {
              prefix: "fas",
              iconName: "camera-retro",
              icon: [512, 512, [128247], "f083", "M220.6 121.2L271.1 96 448 96v96H333.2c-21.9-15.1-48.5-24-77.2-24s-55.2 8.9-77.2 24H64V128H192c9.9 0 19.7-2.3 28.6-6.8zM0 128V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H271.1c-9.9 0-19.7 2.3-28.6 6.8L192 64H160V48c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16l0 16C28.7 64 0 92.7 0 128zM168 304a88 88 0 1 1 176 0 88 88 0 1 1 -176 0z"]
            }, yD = {
              prefix: "fas",
              iconName: "circle-arrow-down",
              icon: [512, 512, ["arrow-circle-down"], "f0ab", "M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM127 281c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l71 71L232 136c0-13.3 10.7-24 24-24s24 10.7 24 24l0 182.1 71-71c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 393c-9.4 9.4-24.6 9.4-33.9 0L127 281z"]
            }, Gm = yD, kD = {
              prefix: "fas",
              iconName: "file-import",
              icon: [512, 512, ["arrow-right-to-file"], "f56f", "M128 64c0-35.3 28.7-64 64-64H352V128c0 17.7 14.3 32 32 32H512V448c0 35.3-28.7 64-64 64H192c-35.3 0-64-28.7-64-64V336H302.1l-39 39c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l39 39H128V64zm0 224v48H24c-13.3 0-24-10.7-24-24s10.7-24 24-24H128zM512 128H384V0L512 128z"]
            }, Zm = kD, ph = {
              prefix: "fas",
              iconName: "square-arrow-up-right",
              icon: [448, 512, ["external-link-square"], "f14c", "M384 32c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96C0 60.7 28.7 32 64 32H384zM160 144c-13.3 0-24 10.7-24 24s10.7 24 24 24h94.1L119 327c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l135-135V328c0 13.3 10.7 24 24 24s24-10.7 24-24V168c0-13.3-10.7-24-24-24H160z"]
            }, Eq = ph, $g = {
              prefix: "fas",
              iconName: "box-open",
              icon: [640, 512, [], "f49e", "M58.9 42.1c3-6.1 9.6-9.6 16.3-8.7L320 64 564.8 33.4c6.7-.8 13.3 2.7 16.3 8.7l41.7 83.4c9 17.9-.6 39.6-19.8 45.1L439.6 217.3c-13.9 4-28.8-1.9-36.2-14.3L320 64 236.6 203c-7.4 12.4-22.3 18.3-36.2 14.3L37.1 170.6c-19.3-5.5-28.8-27.2-19.8-45.1L58.9 42.1zM321.1 128l54.9 91.4c14.9 24.8 44.6 36.6 72.5 28.6L576 211.6v167c0 22-15 41.2-36.4 46.6l-204.1 51c-10.2 2.6-20.9 2.6-31 0l-204.1-51C79 419.7 64 400.5 64 378.5v-167L191.6 248c27.8 8 57.6-3.8 72.5-28.6L318.9 128h2.2z"]
            }, k4 = {
              prefix: "fas",
              iconName: "scroll",
              icon: [576, 512, [128220], "f70e", "M0 80v48c0 17.7 14.3 32 32 32H48 96V80c0-26.5-21.5-48-48-48S0 53.5 0 80zM112 32c10 13.4 16 30 16 48V384c0 35.3 28.7 64 64 64s64-28.7 64-64v-5.3c0-32.4 26.3-58.7 58.7-58.7H480V128c0-53-43-96-96-96H112zM464 480c61.9 0 112-50.1 112-112c0-8.8-7.2-16-16-16H314.7c-14.7 0-26.7 11.9-26.7 26.7V384c0 53-43 96-96 96H368h96z"]
            }, ED = {
              prefix: "fas",
              iconName: "spa",
              icon: [576, 512, [], "f5bb", "M183.1 235.3c33.7 20.7 62.9 48.1 85.8 80.5c7 9.9 13.4 20.3 19.1 31c5.7-10.8 12.1-21.1 19.1-31c22.9-32.4 52.1-59.8 85.8-80.5C437.6 207.8 490.1 192 546 192h9.9c11.1 0 20.1 9 20.1 20.1C576 360.1 456.1 480 308.1 480H288 267.9C119.9 480 0 360.1 0 212.1C0 201 9 192 20.1 192H30c55.9 0 108.4 15.8 153.1 43.3zM301.5 37.6c15.7 16.9 61.1 71.8 84.4 164.6c-38 21.6-71.4 50.8-97.9 85.6c-26.5-34.8-59.9-63.9-97.9-85.6c23.2-92.8 68.6-147.7 84.4-164.6C278 33.9 282.9 32 288 32s10 1.9 13.5 5.6z"]
            }, FD = {
              prefix: "fas",
              iconName: "location-pin-lock",
              icon: [512, 512, [], "e51f", "M215.7 499.2c11-13.8 25.1-31.7 40.3-52.3V352c0-23.7 12.9-44.4 32-55.4V272c0-55.6 40.5-101.7 93.6-110.5C367 70 287.7 0 192 0C86 0 0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM400 240c17.7 0 32 14.3 32 32v48H368V272c0-17.7 14.3-32 32-32zm-80 32v48c-17.7 0-32 14.3-32 32V480c0 17.7 14.3 32 32 32H480c17.7 0 32-14.3 32-32V352c0-17.7-14.3-32-32-32V272c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
            }, Fq = {
              prefix: "fas",
              iconName: "pause",
              icon: [320, 512, [9208], "f04c", "M48 64C21.5 64 0 85.5 0 112V400c0 26.5 21.5 48 48 48H80c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H48zm192 0c-26.5 0-48 21.5-48 48V400c0 26.5 21.5 48 48 48h32c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H240z"]
            }, ND = {
              prefix: "fas",
              iconName: "hill-avalanche",
              icon: [576, 512, [], "e507", "M439.7 401.9c34.2 23.1 81.1 19.5 111.4-10.8c34.4-34.4 34.4-90.1 0-124.4c-27.8-27.8-69.5-33.1-102.6-16c-11.8 6.1-16.4 20.6-10.3 32.3s20.6 16.4 32.3 10.3c15.1-7.8 34-5.3 46.6 7.3c15.6 15.6 15.6 40.9 0 56.6s-40.9 15.6-56.6 0l-81.7-81.7C401.2 261.3 416 236.4 416 208c0-33.9-21.1-62.9-50.9-74.5c1.9-6.8 2.9-14 2.9-21.5c0-44.2-35.8-80-80-80c-27.3 0-51.5 13.7-65.9 34.6C216.3 46.6 197.9 32 176 32c-26.5 0-48 21.5-48 48c0 4 .5 7.9 1.4 11.6L439.7 401.9zM480 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM68.3 87C43.1 61.8 0 79.7 0 115.3V432c0 44.2 35.8 80 80 80H396.7c35.6 0 53.5-43.1 28.3-68.3L68.3 87z"]
            }, hh = {
              prefix: "fas",
              iconName: "temperature-empty",
              icon: [320, 512, ["temperature-0", "thermometer-0", "thermometer-empty"], "f2cb", "M112 112c0-26.5 21.5-48 48-48s48 21.5 48 48V276.5c0 17.3 7.1 31.9 15.3 42.5C233.8 332.6 240 349.5 240 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9c8.2-10.6 15.3-25.2 15.3-42.5V112zM160 0C98.1 0 48 50.2 48 112V276.5c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C27.2 304.2 16 334.8 16 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6V112C272 50.2 221.9 0 160 0zm0 416a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
            }, ul = hh, Hh = hh, QD = hh, eX = {
              prefix: "fas",
              iconName: "bomb",
              icon: [512, 512, [128163], "f1e2", "M459.1 52.4L442.6 6.5C440.7 2.6 436.5 0 432.1 0s-8.5 2.6-10.4 6.5L405.2 52.4l-46 16.8c-4.3 1.6-7.3 5.9-7.2 10.4c0 4.5 3 8.7 7.2 10.2l45.7 16.8 16.8 45.8c1.5 4.4 5.8 7.5 10.4 7.5s8.9-3.1 10.4-7.5l16.5-45.8 45.7-16.8c4.2-1.5 7.2-5.7 7.2-10.2c0-4.6-3-8.9-7.2-10.4L459.1 52.4zm-132.4 53c-12.5-12.5-32.8-12.5-45.3 0l-2.9 2.9C256.5 100.3 232.7 96 208 96C93.1 96 0 189.1 0 304S93.1 512 208 512s208-93.1 208-208c0-24.7-4.3-48.5-12.2-70.5l2.9-2.9c12.5-12.5 12.5-32.8 0-45.3l-80-80zM200 192c-57.4 0-104 46.6-104 104v8c0 8.8-7.2 16-16 16s-16-7.2-16-16v-8c0-75.1 60.9-136 136-136h8c8.8 0 16 7.2 16 16s-7.2 16-16 16h-8z"]
            }, YD = {
              prefix: "fas",
              iconName: "registered",
              icon: [512, 512, [174], "f25d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM160 152c0-13.3 10.7-24 24-24h88c44.2 0 80 35.8 80 80c0 28-14.4 52.7-36.3 67l34.1 75.1c5.5 12.1 .1 26.3-11.9 31.8s-26.3 .1-31.8-11.9L268.9 288H208v72c0 13.3-10.7 24-24 24s-24-10.7-24-24V264 152zm48 88h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H208v64z"]
            }, E4 = {
              prefix: "fas",
              iconName: "address-card",
              icon: [576, 512, [62140, "contact-card", "vcard"], "f2bb", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm80 256h64c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm256-32H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, Nq = E4, MD = E4, Qq = {
              prefix: "fas",
              iconName: "scale-unbalanced-flip",
              icon: [640, 512, ["balance-scale-right"], "f516", "M117.9 62.4c-16.8-5.6-25.8-23.7-20.2-40.5s23.7-25.8 40.5-20.2l113 37.7C265 15.8 290.7 0 320 0c44.2 0 80 35.8 80 80c0 3-.2 5.9-.5 8.8l122.6 40.9c16.8 5.6 25.8 23.7 20.2 40.5s-23.7 25.8-40.5 20.2L366.4 145.2c-4.5 3.2-9.3 5.9-14.4 8.2V480c0 17.7-14.3 32-32 32H128c-17.7 0-32-14.3-32-32s14.3-32 32-32H288V153.3c-21-9.2-37.2-27-44.2-49l-125.9-42zM200.4 288L128 163.8 55.6 288H200.4zM128 384C65.1 384 12.8 350 2 305.1c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1C243.2 350 190.9 384 128 384zm382.8-92.2L438.4 416H583.3L510.8 291.8zm126 141.3C626 478 573.7 512 510.8 512s-115.2-34-126-78.9c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1z"]
            }, Yq = Qq, bd = {
              prefix: "fas",
              iconName: "subscript",
              icon: [512, 512, [], "f12c", "M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32H47.3l89.6 128L47.3 384H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H64c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H304.7L215.1 256l89.6-128H320c17.7 0 32-14.3 32-32s-14.3-32-32-32H288c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64H32zM480 320c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 361.5 404.3 368 416 368v80c-17.7 0-32 14.3-32 32s14.3 32 32 32h32 32c17.7 0 32-14.3 32-32s-14.3-32-32-32V320z"]
            }, Mq = {
              prefix: "fas",
              iconName: "diamond-turn-right",
              icon: [512, 512, ["directions"], "f5eb", "M227.7 11.7c15.6-15.6 40.9-15.6 56.6 0l216 216c15.6 15.6 15.6 40.9 0 56.6l-216 216c-15.6 15.6-40.9 15.6-56.6 0l-216-216c-15.6-15.6-15.6-40.9 0-56.6l216-216zm87.6 137c-4.6-4.6-11.5-5.9-17.4-3.5s-9.9 8.3-9.9 14.8v56H224c-35.3 0-64 28.7-64 64v48c0 13.3 10.7 24 24 24s24-10.7 24-24V280c0-8.8 7.2-16 16-16h64v56c0 6.5 3.9 12.3 9.9 14.8s12.9 1.1 17.4-3.5l80-80c6.2-6.2 6.2-16.4 0-22.6l-80-80z"]
            }, LD = Mq, Lq = {
              prefix: "fas",
              iconName: "burst",
              icon: [512, 512, [], "e4dc", "M37.6 4.2C28-2.3 15.2-1.1 7 7s-9.4 21-2.8 30.5l112 163.3L16.6 233.2C6.7 236.4 0 245.6 0 256s6.7 19.6 16.6 22.8l103.1 33.4L66.8 412.8c-4.9 9.3-3.2 20.7 4.3 28.1s18.8 9.2 28.1 4.3l100.6-52.9 33.4 103.1c3.2 9.9 12.4 16.6 22.8 16.6s19.6-6.7 22.8-16.6l33.4-103.1 100.6 52.9c9.3 4.9 20.7 3.2 28.1-4.3s9.2-18.8 4.3-28.1L392.3 312.2l103.1-33.4c9.9-3.2 16.6-12.4 16.6-22.8s-6.7-19.6-16.6-22.8L388.9 198.7l25.7-70.4c3.2-8.8 1-18.6-5.6-25.2s-16.4-8.8-25.2-5.6l-70.4 25.7L278.8 16.6C275.6 6.7 266.4 0 256 0s-19.6 6.7-22.8 16.6l-32.3 99.6L37.6 4.2z"]
            }, x3 = {
              prefix: "fas",
              iconName: "house-laptop",
              icon: [640, 512, ["laptop-house"], "e066", "M218.3 8.5c12.3-11.3 31.2-11.3 43.4 0l208 192c6.7 6.2 10.3 14.8 10.3 23.5H336c-19.1 0-36.3 8.4-48 21.7V208c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16h64V416H112c-26.5 0-48-21.5-48-48V256H32c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8.1-35.2l208-192zM352 304V448H544V304H352zm-48-16c0-17.7 14.3-32 32-32H560c17.7 0 32 14.3 32 32V448h32c8.8 0 16 7.2 16 16c0 26.5-21.5 48-48 48H544 352 304c-26.5 0-48-21.5-48-48c0-8.8 7.2-16 16-16h32V288z"]
            }, Kq = x3, tX = {
              prefix: "fas",
              iconName: "face-tired",
              icon: [512, 512, [128555, "tired"], "f5c8", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.7 328.7c22-22 53.9-40.7 91.3-40.7s69.3 18.7 91.3 40.7c11.1 11.1 20.1 23.4 26.4 35.4c6.2 11.7 10.3 24.4 10.3 35.9c0 5.2-2.6 10.2-6.9 13.2s-9.8 3.7-14.7 1.8l-20.5-7.7c-26.9-10.1-55.5-15.3-84.3-15.3h-3.2c-28.8 0-57.3 5.2-84.3 15.3L149.6 415c-4.9 1.8-10.4 1.2-14.7-1.8s-6.9-7.9-6.9-13.2c0-11.6 4.2-24.2 10.3-35.9c6.3-12 15.3-24.3 26.4-35.4zm-31.2-182l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 157.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
            }, Jq = tX, zq = {
              prefix: "fas",
              iconName: "money-bills",
              icon: [640, 512, [], "e1f3", "M96 96V320c0 35.3 28.7 64 64 64H576c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H160c-35.3 0-64 28.7-64 64zm64 160c35.3 0 64 28.7 64 64H160V256zM224 96c0 35.3-28.7 64-64 64V96h64zM576 256v64H512c0-35.3 28.7-64 64-64zM512 96h64v64c-35.3 0-64-28.7-64-64zM288 208a80 80 0 1 1 160 0 80 80 0 1 1 -160 0zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120V360c0 66.3 53.7 120 120 120H520c13.3 0 24-10.7 24-24s-10.7-24-24-24H120c-39.8 0-72-32.2-72-72V120z"]
            }, _m = {
              prefix: "fas",
              iconName: "smog",
              icon: [640, 512, [], "f75f", "M32 144c0 79.5 64.5 144 144 144H299.3c22.6 19.9 52.2 32 84.7 32s62.1-12.1 84.7-32H496c61.9 0 112-50.1 112-112s-50.1-112-112-112c-10.7 0-21 1.5-30.8 4.3C443.8 27.7 401.1 0 352 0c-32.6 0-62.4 12.2-85.1 32.3C242.1 12.1 210.5 0 176 0C96.5 0 32 64.5 32 144zM616 368H280c-13.3 0-24 10.7-24 24s10.7 24 24 24H616c13.3 0 24-10.7 24-24s-10.7-24-24-24zm-64 96H440c-13.3 0-24 10.7-24 24s10.7 24 24 24H552c13.3 0 24-10.7 24-24s-10.7-24-24-24zm-192 0H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H360c13.3 0 24-10.7 24-24s-10.7-24-24-24zM224 392c0-13.3-10.7-24-24-24H96c-13.3 0-24 10.7-24 24s10.7 24 24 24H200c13.3 0 24-10.7 24-24z"]
            }, ko = {
              prefix: "fas",
              iconName: "crutch",
              icon: [512, 512, [], "f7f7", "M297.4 9.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0zm-96 144l-34.8 34.8c-12.9 12.9-21.9 29.2-25.8 47.1L116.8 342.9c-1.3 5.9-4.3 11.4-8.6 15.7L9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l98.8-98.8c4.3-4.3 9.7-7.3 15.7-8.6l107.6-23.9c17.8-4 34.1-12.9 47.1-25.8l34.7-34.7c0 0 .1-.1 .1-.1s.1-.1 .1-.1l74.6-74.6-45.3-45.3L336 242.7 269.3 176l52.1-52.1L276.1 78.6l-74.7 74.7zM224 221.3L290.7 288l-12.2 12.2c-4.3 4.3-9.7 7.3-15.7 8.6l-76.7 17 17-76.7c1.3-5.9 4.3-11.4 8.6-15.7L224 221.3z"]
            }, F4 = {
              prefix: "fas",
              iconName: "font-awesome",
              icon: [448, 512, [62501, 62694, "font-awesome-flag", "font-awesome-logo-full"], "f2b4", "M448 48V384c-63.1 22.5-82.3 32-119.5 32c-62.8 0-86.6-32-149.3-32c-20.6 0-36.6 3.6-51.2 8.2v-64c14.6-4.6 30.6-8.2 51.2-8.2c62.7 0 86.5 32 149.3 32c20.4 0 35.6-3 55.5-9.3v-208c-19.9 6.3-35.1 9.3-55.5 9.3c-62.8 0-86.6-32-149.3-32c-50.8 0-74.9 20.6-115.2 28.7V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V64C0 46.3 14.3 32 32 32s32 14.3 32 32V76.7c40.3-8 64.4-28.7 115.2-28.7c62.7 0 86.5 32 149.3 32c37.1 0 56.4-9.5 119.5-32z"]
            }, N4 = F4, rX = F4, Q4 = {
              prefix: "fas",
              iconName: "cloud-arrow-up",
              icon: [640, 512, [62338, "cloud-upload", "cloud-upload-alt"], "f0ee", "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128H144zm79-217c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39V392c0 13.3 10.7 24 24 24s24-10.7 24-24V257.9l39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0l-80 80z"]
            }, KD = Q4, Gq = Q4, nX = {
              prefix: "fas",
              iconName: "palette",
              icon: [512, 512, [127912], "f53f", "M512 256c0 .9 0 1.8 0 2.7c-.4 36.5-33.6 61.3-70.1 61.3H344c-26.5 0-48 21.5-48 48c0 3.4 .4 6.7 1 9.9c2.1 10.2 6.5 20 10.8 29.9c6.1 13.8 12.1 27.5 12.1 42c0 31.8-21.6 60.7-53.4 62c-3.5 .1-7 .2-10.6 .2C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, Zq = {
              prefix: "fas",
              iconName: "arrows-turn-right",
              icon: [448, 512, [], "e4c0", "M297.4 9.4c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L338.7 160H128c-35.3 0-64 28.7-64 64v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V224C0 153.3 57.3 96 128 96H338.7L297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3zm-96 256c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 416H96c-17.7 0-32 14.3-32 32v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448c0-53 43-96 96-96H242.7l-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3z"]
            }, Y4 = {
              prefix: "fas",
              iconName: "vest",
              icon: [448, 512, [], "e085", "M207.1 237.4L151.2 69.7C168.6 79.7 192.6 88 224 88s55.4-8.3 72.8-18.3L226.5 280.6c-1.6 4.9-2.5 10-2.5 15.2V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V270.5c0-9.5-2.8-18.7-8.1-26.6l-47.9-71.8c-5.3-7.9-8.1-17.1-8.1-26.6V128 54.3 48c0-26.5-21.5-48-48-48h-4.5c-.2 0-.4 0-.6 0c-.4 0-.8 0-1.2 0C311 0 295.7 9.7 285.7 18.8C276.4 27.2 257.2 40 224 40s-52.4-12.8-61.7-21.2C152.3 9.7 137 0 118.3 0c-.4 0-.8 0-1.2 0c-.2 0-.4 0-.6 0H112C85.5 0 64 21.5 64 48v6.3V128v17.5c0 9.5-2.8 18.7-8.1 26.6L8.1 243.9C2.8 251.8 0 261.1 0 270.5V464c0 26.5 21.5 48 48 48H176c9.9 0 19-3 26.7-8.1C195.9 492.2 192 478.5 192 464V295.8c0-8.6 1.4-17.1 4.1-25.3l11-33.1zM347.3 356.7l48 48c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-48-48c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0zm-294.6 48l48-48c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-48 48c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6z"]
            }, gh = {
              prefix: "fas",
              iconName: "ferry",
              icon: [576, 512, [], "e4ea", "M224 0H352c17.7 0 32 14.3 32 32h75.1c20.6 0 31.6 24.3 18.1 39.8L456 96H120L98.8 71.8C85.3 56.3 96.3 32 116.9 32H192c0-17.7 14.3-32 32-32zM96 128H480c17.7 0 32 14.3 32 32V283.5c0 13.3-4.2 26.3-11.9 37.2l-51.4 71.9c-1.9 1.1-3.7 2.2-5.5 3.5c-15.5 10.7-34 18-51 19.9H375.6c-17.1-1.8-35-9-50.8-19.9c-22.1-15.5-51.6-15.5-73.7 0c-14.8 10.2-32.5 18-50.6 19.9H183.9c-17-1.8-35.6-9.2-51-19.9c-1.8-1.3-3.7-2.4-5.6-3.5L75.9 320.7C68.2 309.8 64 296.8 64 283.5V160c0-17.7 14.3-32 32-32zm32 64v96H448V192H128zM306.5 421.9C329 437.4 356.5 448 384 448c26.9 0 55.3-10.8 77.4-26.1l0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 501.7 417 512 384 512c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7l0 0C136.7 437.2 165.1 448 192 448c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
            }, $m = {
              prefix: "fas",
              iconName: "arrows-down-to-people",
              icon: [640, 512, [], "e4b9", "M144 0c-13.3 0-24 10.7-24 24V142.1L97 119c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0l64-64c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-23 23V24c0-13.3-10.7-24-24-24zM360 200a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zM184 296a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm312 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM200 441.5l26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-36.3-67.5c1.7-1.7 3.2-3.6 4.3-5.8L264 345.5V400c0 17.7 14.3 32 32 32h48c17.7 0 32-14.3 32-32V345.5l26.9 49.9c1.2 2.2 2.6 4.1 4.3 5.8l-36.3 67.5c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L440 441.5V480c0 17.7 14.3 32 32 32h48c17.7 0 32-14.3 32-32V441.5l26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3H486.2c-16.3 0-31.9 4.5-45.4 12.6l-33.6-62.3c-15.3-28.5-45.1-46.3-77.5-46.3H310.2c-32.4 0-62.1 17.8-77.5 46.3l-33.6 62.3c-13.5-8.1-29.1-12.6-45.4-12.6H134.2c-32.4 0-62.1 17.8-77.5 46.3L18.9 468.6c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L88 441.5V480c0 17.7 14.3 32 32 32h48c17.7 0 32-14.3 32-32V441.5zM415 153l64 64c9.4 9.4 24.6 9.4 33.9 0l64-64c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-23 23V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V142.1l-23-23c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z"]
            }, iX = {
              prefix: "fas",
              iconName: "seedling",
              icon: [512, 512, [127793, "sprout"], "f4d8", "M512 32c0 113.6-84.6 207.5-194.2 222c-7.1-53.4-30.6-101.6-65.3-139.3C290.8 46.3 364 0 448 0h32c17.7 0 32 14.3 32 32zM0 96C0 78.3 14.3 64 32 64H64c123.7 0 224 100.3 224 224v32V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V320C100.3 320 0 219.7 0 96z"]
            }, eB = iX, JD = {
              prefix: "fas",
              iconName: "left-right",
              icon: [512, 512, [8596, "arrows-alt-h"], "f337", "M504.3 273.6c4.9-4.5 7.7-10.9 7.7-17.6s-2.8-13-7.7-17.6l-112-104c-7-6.5-17.2-8.2-25.9-4.4s-14.4 12.5-14.4 22l0 56-192 0 0-56c0-9.5-5.7-18.2-14.4-22s-18.9-2.1-25.9 4.4l-112 104C2.8 243 0 249.3 0 256s2.8 13 7.7 17.6l112 104c7 6.5 17.2 8.2 25.9 4.4s14.4-12.5 14.4-22l0-56 192 0 0 56c0 9.5 5.7 18.2 14.4 22s18.9 2.1 25.9-4.4l112-104z"]
            }, HA = JD, sX = {
              prefix: "fas",
              iconName: "boxes-packing",
              icon: [640, 512, [], "e4c7", "M256 48c0-26.5 21.5-48 48-48H592c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H381.3c1.8-5 2.7-10.4 2.7-16V253.3c18.6-6.6 32-24.4 32-45.3V176c0-26.5-21.5-48-48-48H256V48zM571.3 347.3c6.2-6.2 6.2-16.4 0-22.6l-64-64c-6.2-6.2-16.4-6.2-22.6 0l-64 64c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L480 310.6V432c0 8.8 7.2 16 16 16s16-7.2 16-16V310.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0zM0 176c0-8.8 7.2-16 16-16H368c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H16c-8.8 0-16-7.2-16-16V176zm352 80V480c0 17.7-14.3 32-32 32H64c-17.7 0-32-14.3-32-32V256H352zM144 320c-8.8 0-16 7.2-16 16s7.2 16 16 16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H144z"]
            }, aX = {
              prefix: "fas",
              iconName: "circle-arrow-left",
              icon: [512, 512, ["arrow-circle-left"], "f0a8", "M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM231 127c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-71 71L376 232c13.3 0 24 10.7 24 24s-10.7 24-24 24l-182.1 0 71 71c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L119 273c-9.4-9.4-9.4-24.6 0-33.9L231 127z"]
            }, D3 = aX, zD = {
              prefix: "fas",
              iconName: "group-arrows-rotate",
              icon: [512, 512, [], "e4f6", "M201.1 71.9c16.9-5 26.6-22.9 21.5-39.8s-22.9-26.6-39.8-21.5c-21.5 6.4-41.8 15.5-60.6 27C114.3 34 105.4 32 96 32C60.7 32 32 60.7 32 96c0 9.4 2 18.3 5.6 26.3c-11.5 18.7-20.6 39-27 60.6c-5 16.9 4.6 34.8 21.5 39.8s34.8-4.6 39.8-21.5c4.3-14.6 10.4-28.5 17.9-41.4c2 .2 4.1 .3 6.1 .3c35.3 0 64-28.7 64-64c0-2.1-.1-4.1-.3-6.1c12.9-7.5 26.8-13.6 41.4-17.9zm128-61.3c-16.9-5-34.8 4.6-39.8 21.5s4.6 34.8 21.5 39.8c14.6 4.3 28.5 10.4 41.4 17.9c-.2 2-.3 4.1-.3 6.1c0 35.3 28.7 64 64 64c2.1 0 4.1-.1 6.2-.3c7.5 12.9 13.6 26.8 17.9 41.4c5 16.9 22.9 26.6 39.8 21.5s26.6-22.9 21.5-39.8c-6.4-21.5-15.5-41.8-27-60.6c3.6-8 5.6-16.9 5.6-26.3c0-35.3-28.7-64-64-64c-9.4 0-18.3 2-26.3 5.6c-18.7-11.5-39-20.6-60.6-27zM71.9 310.9c-5-16.9-22.9-26.6-39.8-21.5s-26.6 22.9-21.5 39.8c6.4 21.5 15.5 41.8 27 60.6C34 397.7 32 406.6 32 416c0 35.3 28.7 64 64 64c9.4 0 18.3-2 26.3-5.6c18.7 11.5 39 20.6 60.6 27c16.9 5 34.8-4.6 39.8-21.5s-4.6-34.8-21.5-39.8c-14.6-4.3-28.5-10.4-41.4-17.9c.2-2 .3-4.1 .3-6.2c0-35.3-28.7-64-64-64c-2.1 0-4.1 .1-6.2 .3c-7.5-12.9-13.6-26.8-17.9-41.4zm429.4 18.3c5-16.9-4.6-34.8-21.5-39.8s-34.8 4.6-39.8 21.5c-4.3 14.6-10.4 28.5-17.9 41.4c-2-.2-4.1-.3-6.2-.3c-35.3 0-64 28.7-64 64c0 2.1 .1 4.1 .3 6.2c-12.9 7.5-26.8 13.6-41.4 17.9c-16.9 5-26.6 22.9-21.5 39.8s22.9 26.6 39.8 21.5c21.5-6.4 41.8-15.5 60.6-27c8 3.6 16.9 5.6 26.3 5.6c35.3 0 64-28.7 64-64c0-9.4-2-18.3-5.6-26.3c11.5-18.7 20.6-39 27-60.6zM192.8 256.8c0-15.6 5.6-29.9 14.9-41.1L223 231c6.6 6.6 17.8 1.9 17.8-7.4V163.2c0-5.7-4.7-10.4-10.4-10.4H169.9c-9.3 0-13.9 11.2-7.4 17.8l11.2 11.2c-17.9 19.8-28.9 46.2-28.9 75.1c0 43.6 24.9 81.3 61.1 99.8c11.8 6 26.3 1.4 32.3-10.4s1.4-26.3-10.4-32.3c-20.8-10.6-34.9-32.2-34.9-57zm93.1-58.6c20.8 10.6 34.9 32.2 34.9 57c0 15.6-5.6 29.9-14.9 41.1L290.6 281c-6.6-6.6-17.8-1.9-17.8 7.4v60.5c0 5.7 4.7 10.4 10.4 10.4h60.5c9.3 0 13.9-11.2 7.4-17.8l-11.2-11.2c17.9-19.8 28.9-46.2 28.9-75.1c0-43.6-24.9-81.3-61.1-99.8c-11.8-6-26.3-1.4-32.3 10.4s-1.4 26.3 10.4 32.3z"]
            }, Xh = {
              prefix: "fas",
              iconName: "bowl-food",
              icon: [512, 512, [], "e4c6", "M0 192c0-35.3 28.7-64 64-64c.5 0 1.1 0 1.6 0C73 91.5 105.3 64 144 64c15 0 29 4.1 40.9 11.2C198.2 49.6 225.1 32 256 32s57.8 17.6 71.1 43.2C339 68.1 353 64 368 64c38.7 0 71 27.5 78.4 64c.5 0 1.1 0 1.6 0c35.3 0 64 28.7 64 64c0 11.7-3.1 22.6-8.6 32H8.6C3.1 214.6 0 203.7 0 192zm0 91.4C0 268.3 12.3 256 27.4 256H484.6c15.1 0 27.4 12.3 27.4 27.4c0 70.5-44.4 130.7-106.7 154.1L403.5 452c-2 16-15.6 28-31.8 28H140.2c-16.1 0-29.8-12-31.8-28l-1.8-14.4C44.4 414.1 0 353.9 0 283.4z"]
            }, Th = {
              prefix: "fas",
              iconName: "candy-cane",
              icon: [512, 512, [], "f786", "M348.8 131.5c3.7-2.3 7.9-3.5 12.2-3.5c12.7 0 23 10.3 23 23v5.6c0 9.9-5.1 19.1-13.5 24.3L30.1 393.7C.1 412.5-9 451.9 9.7 481.9s58.2 39.1 88.2 20.4L438.4 289.5c45.8-28.6 73.6-78.8 73.6-132.8V151C512 67.6 444.4 0 361 0c-28.3 0-56 8-80.1 23L254.1 39.7c-30 18.7-39.1 58.2-20.4 88.2s58.2 39.1 88.2 20.4l26.8-16.8zM298.4 49.8c9.2-5.7 19.1-10.1 29.4-13.1L348 97.5c-5.7 1.4-11.2 3.7-16.3 6.8l-12.6 7.9L298.4 49.8zm88.5 52.7l46.2-46.2c8.5 6.5 16.1 14.1 22.6 22.6l-46.2 46.2c-5.1-9.6-13-17.5-22.6-22.6zm28.9 59.3l61.6 20.5c-2.2 10.5-5.8 20.7-10.5 30.2l-62-20.7c6.2-8.8 10.1-19.1 11-30.1zm-86.1 82.5l60.4 37.7-30.2 18.9-60.4-37.7 30.2-18.9zm-107.2 67l60.4 37.7-30.2 18.9-60.4-37.7 30.2-18.9zM119.3 375.7l60.4 37.7-30.2 18.9L89.1 394.6l30.2-18.9z"]
            }, U7 = {
              prefix: "fas",
              iconName: "arrow-down-wide-short",
              icon: [576, 512, ["sort-amount-asc", "sort-amount-down"], "f160", "M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V365.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320z"]
            }, _q = U7, M4 = U7, I7 = {
              prefix: "fas",
              iconName: "cloud-bolt",
              icon: [512, 512, [127785, "thunderstorm"], "f76c", "M0 224c0 53 43 96 96 96h47.2L290 202.5c17.6-14.1 42.6-14 60.2 .2s22.8 38.6 12.8 58.8L333.7 320H352h64c53 0 96-43 96-96s-43-96-96-96c-.5 0-1.1 0-1.6 0c1.1-5.2 1.6-10.5 1.6-16c0-44.2-35.8-80-80-80c-24.3 0-46.1 10.9-60.8 28C256.5 24.3 219.1 0 176 0C114.1 0 64 50.1 64 112c0 7.1 .7 14.1 1.9 20.8C27.6 145.4 0 181.5 0 224zm330.1 3.6c-5.8-4.7-14.2-4.7-20.1-.1l-160 128c-5.3 4.2-7.4 11.4-5.1 17.8s8.3 10.7 15.1 10.7h70.1L177.7 488.8c-3.4 6.7-1.6 14.9 4.3 19.6s14.2 4.7 20.1 .1l160-128c5.3-4.2 7.4-11.4 5.1-17.8s-8.3-10.7-15.1-10.7H281.9l52.4-104.8c3.4-6.7 1.6-14.9-4.2-19.6z"]
            }, GD = I7, qh = {
              prefix: "fas",
              iconName: "text-slash",
              icon: [640, 512, ["remove-format"], "f87d", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L355.7 253.5 400.2 96H503L497 120.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l11-44.1C577.6 61.3 554.7 32 523.5 32H376.1h-.3H204.5c-22 0-41.2 15-46.6 36.4l-6.3 25.2L38.8 5.1zm168 131.7c.1-.3 .2-.7 .3-1L217 96H333.7L301.3 210.8l-94.5-74.1zM243.3 416H192c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H309.8l17.6-62.1L272.9 311 243.3 416z"]
            }, ZD = qh, $q = {
              prefix: "fas",
              iconName: "face-smile-wink",
              icon: [512, 512, [128521, "smile-wink"], "f4da", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm156.4 25.6c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2c-17.6-23.5-52.8-23.5-70.4 0z"]
            }, tB = $q, rB = {
              prefix: "fas",
              iconName: "file-word",
              icon: [384, 512, [], "f1c2", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM111 257.1l26.8 89.2 31.6-90.3c3.4-9.6 12.5-16.1 22.7-16.1s19.3 6.4 22.7 16.1l31.6 90.3L273 257.1c3.8-12.7 17.2-19.9 29.9-16.1s19.9 17.2 16.1 29.9l-48 160c-3 10-12 16.9-22.4 17.1s-19.8-6.2-23.2-16.1L192 336.6l-33.3 95.3c-3.4 9.8-12.8 16.3-23.2 16.1s-19.5-7.1-22.4-17.1l-48-160c-3.8-12.7 3.4-26.1 16.1-29.9s26.1 3.4 29.9 16.1z"]
            }, oX = {
              prefix: "fas",
              iconName: "file-powerpoint",
              icon: [384, 512, [], "f1c4", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM136 240h68c42 0 76 34 76 76s-34 76-76 76H160v32c0 13.3-10.7 24-24 24s-24-10.7-24-24V368 264c0-13.3 10.7-24 24-24zm68 104c15.5 0 28-12.5 28-28s-12.5-28-28-28H160v56h44z"]
            }, j3 = {
              prefix: "fas",
              iconName: "arrows-left-right",
              icon: [512, 512, ["arrows-h"], "f07e", "M406.6 374.6l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224l-293.5 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288l293.5 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"]
            }, eb = j3, nB = {
              prefix: "fas",
              iconName: "house-lock",
              icon: [640, 512, [], "e510", "M384 480c0 11.7 3.1 22.6 8.6 32H392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L490.7 166.3C447.2 181.7 416 223.2 416 272v24.6c-19.1 11.1-32 31.7-32 55.4V480zM528 240c-17.7 0-32 14.3-32 32v48h64V272c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80v48c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32H448c-17.7 0-32-14.3-32-32V352c0-17.7 14.3-32 32-32V272z"]
            }, R7 = {
              prefix: "fas",
              iconName: "cloud-arrow-down",
              icon: [640, 512, [62337, "cloud-download", "cloud-download-alt"], "f0ed", "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128H144zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39V184c0-13.3-10.7-24-24-24s-24 10.7-24 24V318.1l-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z"]
            }, iB = R7, _D = R7, sB = {
              prefix: "fas",
              iconName: "children",
              icon: [640, 512, [], "e4e1", "M160 0a64 64 0 1 1 0 128A64 64 0 1 1 160 0zM88 480V400H70.2c-10.9 0-18.6-10.7-15.2-21.1l31.1-93.4L57.5 323.3c-10.7 14.1-30.8 16.8-44.8 6.2s-16.8-30.7-6.2-44.8L65.4 207c22.4-29.6 57.5-47 94.6-47s72.2 17.4 94.6 47l58.9 77.7c10.7 14.1 7.9 34.2-6.2 44.8s-34.2 7.9-44.8-6.2l-28.6-37.8L265 378.9c3.5 10.4-4.3 21.1-15.2 21.1H232v80c0 17.7-14.3 32-32 32s-32-14.3-32-32V400H152v80c0 17.7-14.3 32-32 32s-32-14.3-32-32zM480 0a64 64 0 1 1 0 128A64 64 0 1 1 480 0zm-8 384v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V300.5L395.1 321c-9.4 15-29.2 19.4-44.1 10s-19.4-29.2-10-44.1l51.7-82.1c17.6-27.9 48.3-44.9 81.2-44.9h12.3c33 0 63.7 16.9 81.2 44.9L619.1 287c9.4 15 4.9 34.7-10 44.1s-34.7 4.9-44.1-10L552 300.5V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V384H472z"]
            }, $D = {
              prefix: "fas",
              iconName: "chalkboard",
              icon: [576, 512, ["blackboard"], "f51b", "M96 32C60.7 32 32 60.7 32 96V384H96V96l384 0V384h64V96c0-35.3-28.7-64-64-64H96zM224 384v32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H416V384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32z"]
            }, aB = $D, ej = {
              prefix: "fas",
              iconName: "user-large-slash",
              icon: [640, 512, ["user-alt-slash"], "f4fa", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L381.9 274c48.5-23.2 82.1-72.7 82.1-130C464 64.5 399.5 0 320 0C250.4 0 192.4 49.3 178.9 114.9L38.8 5.1zM545.5 512H528L284.3 320h-59C136.2 320 64 392.2 64 481.3c0 17 13.8 30.7 30.7 30.7H545.3l.3 0z"]
            }, oB = ej, fB = {
              prefix: "fas",
              iconName: "envelope-open",
              icon: [512, 512, [62135], "f2b6", "M64 208.1L256 65.9 448 208.1v47.4L289.5 373c-9.7 7.2-21.4 11-33.5 11s-23.8-3.9-33.5-11L64 255.5V208.1zM256 0c-12.1 0-23.8 3.9-33.5 11L25.9 156.7C9.6 168.8 0 187.8 0 208.1V448c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V208.1c0-20.3-9.6-39.4-25.9-51.4L289.5 11C279.8 3.9 268.1 0 256 0z"]
            }, tj = {
              prefix: "fas",
              iconName: "handshake-simple-slash",
              icon: [640, 512, ["handshake-alt-slash"], "e05f", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-135-105.8c-1.1-11.3-6.3-22.3-15.3-30.7l-134.2-123-23.4 18.2-26-20.3 77.2-60.1c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L550.2 352H592c26.5 0 48-21.5 48-48V176c0-26.5-21.5-48-48-48H516h-4-.7l-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2l-89.7 72.6-25.8-20.3 81.8-66.2c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-35.5 23.7L38.8 5.1zM413.6 421.9L41.2 128.5C17.9 131.8 0 151.8 0 176V304c0 26.5 21.5 48 48 48H156.2l91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c.8-.8 1.5-1.7 2.2-2.6z"]
            }, AB = tj, tb = {
              prefix: "fas",
              iconName: "mattress-pillow",
              icon: [640, 512, [], "e525", "M256 64H64C28.7 64 0 92.7 0 128V384c0 35.3 28.7 64 64 64H256V64zm32 384H576c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H288V448zM64 160c0-17.7 14.3-32 32-32h64c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V160z"]
            }, rb = {
              prefix: "fas",
              iconName: "guarani-sign",
              icon: [384, 512, [], "e19a", "M192 0c-17.7 0-32 14.3-32 32V66.7C69.2 81.9 0 160.9 0 256s69.2 174.1 160 189.3V480c0 17.7 14.3 32 32 32s32-14.3 32-32V445.3c90.8-15.2 160-94.2 160-189.3c0-17.7-14.3-32-32-32H224V132c22.1 5.7 41.8 17.1 57.6 32.6c12.6 12.4 32.9 12.2 45.3-.4s12.2-32.9-.5-45.3C299 92 263.5 73.3 224 66.7V32c0-17.7-14.3-32-32-32zM160 132V380c-55.2-14.2-96-64.3-96-124s40.8-109.8 96-124zM224 380V288h92c-11.6 45-47 80.4-92 92z"]
            }, fX = {
              prefix: "fas",
              iconName: "arrows-rotate",
              icon: [512, 512, [128472, "refresh", "sync"], "f021", "M105.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L386.3 160H336c-17.7 0-32 14.3-32 32s14.3 32 32 32H463.5c0 0 0 0 0 0h.4c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM39 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1V448c0 17.7 14.3 32 32 32s32-14.3 32-32V396.9l17.6 17.5 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.7c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L125.6 352H176c17.7 0 32-14.3 32-32s-14.3-32-32-32H48.4c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"]
            }, nb = fX, dB = fX, AX = {
              prefix: "fas",
              iconName: "fire-extinguisher",
              icon: [512, 512, [129519], "f134", "M500.3 7.3C507.7 13.3 512 22.4 512 32v96c0 9.6-4.3 18.7-11.7 24.7s-17.2 8.5-26.6 6.6l-160-32C301.5 124.9 292 115.7 289 104H224v34.8c37.8 18 64 56.5 64 101.2V384H64V240c0-44.7 26.2-83.2 64-101.2V110c-36.2 11.1-66 36.9-82.3 70.5c-5.8 11.9-20.2 16.9-32.1 11.1S-3.3 171.4 2.5 159.5C26.7 109.8 72.7 72.6 128 60.4V32c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32V56h65c3-11.7 12.5-20.9 24.7-23.4l160-32c9.4-1.9 19.1 .6 26.6 6.6zM288 416v32c0 35.3-28.7 64-64 64H128c-35.3 0-64-28.7-64-64V416H288zM176 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
            }, dX = {
              prefix: "fas",
              iconName: "cruzeiro-sign",
              icon: [448, 512, [], "e152", "M96 256c0-88.4 71.6-160 160-160c41 0 78.3 15.4 106.7 40.7c13.2 11.8 33.4 10.7 45.2-2.5s10.7-33.4-2.5-45.2c-39.6-35.5-92-57-149.3-57C132.3 32 32 132.3 32 256s100.3 224 224 224c57.4 0 109.7-21.6 149.3-57c13.2-11.8 14.3-32 2.5-45.2s-32-14.3-45.2-2.5C334.3 400.6 297 416 256 416V320v-8.7c0-12.8 10.4-23.3 23.3-23.3c4.6 0 9.1 1.4 12.9 3.9l10.1 6.7c14.7 9.8 34.6 5.8 44.4-8.9s5.8-34.6-8.9-44.4l-10.1-6.7c-14.3-9.6-31.2-14.7-48.4-14.7c-12.4 0-24.2 2.6-34.9 7.3c-5.5-4.5-12.6-7.3-20.3-7.3c-17.7 0-32 14.3-32 32v55.3V320v82.7C135.5 378 96 321.6 96 256z"]
            }, vB = {
              prefix: "fas",
              iconName: "greater-than-equal",
              icon: [448, 512, [], "f532", "M52.1 93.7C35.7 87.1 27.7 68.5 34.3 52.1s25.2-24.4 41.6-17.8l320 128C408 167.1 416 178.9 416 192s-8 24.9-20.1 29.7l-320 128c-16.4 6.6-35-1.4-41.6-17.8s1.4-35 17.8-41.6L297.8 192 52.1 93.7zM416 416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416z"]
            }, V7 = {
              prefix: "fas",
              iconName: "shield-halved",
              icon: [512, 512, ["shield-alt"], "f3ed", "M256 0c4.6 0 9.2 1 13.4 2.9L457.7 82.8c22 9.3 38.4 31 38.3 57.2c-.5 99.2-41.3 280.7-213.6 363.2c-16.7 8-36.1 8-52.8 0C57.3 420.7 16.5 239.2 16 140c-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.8 1 251.4 0 256 0zm0 66.8V444.8C394 378 431.1 230.1 432 141.4L256 66.8l0 0z"]
            }, vX = V7, ib = {
              prefix: "fas",
              iconName: "book-atlas",
              icon: [448, 512, ["atlas"], "f558", "M0 96C0 43 43 0 96 0H384h32c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32v64c17.7 0 32 14.3 32 32s-14.3 32-32 32H384 96c-53 0-96-43-96-96V96zM64 416c0 17.7 14.3 32 32 32H352V384H96c-17.7 0-32 14.3-32 32zM247.4 283.8c-3.7 3.7-6.2 4.2-7.4 4.2s-3.7-.5-7.4-4.2c-3.8-3.7-8-10-11.8-18.9c-6.2-14.5-10.8-34.3-12.2-56.9h63c-1.5 22.6-6 42.4-12.2 56.9c-3.8 8.9-8 15.2-11.8 18.9zm42.7-9.9c7.3-18.3 12-41.1 13.4-65.9h31.1c-4.7 27.9-21.4 51.7-44.5 65.9zm0-163.8c23.2 14.2 39.9 38 44.5 65.9H303.5c-1.4-24.7-6.1-47.5-13.4-65.9zM368 192a128 128 0 1 0 -256 0 128 128 0 1 0 256 0zM145.3 208h31.1c1.4 24.7 6.1 47.5 13.4 65.9c-23.2-14.2-39.9-38-44.5-65.9zm31.1-32H145.3c4.7-27.9 21.4-51.7 44.5-65.9c-7.3 18.3-12 41.1-13.4 65.9zm56.1-75.8c3.7-3.7 6.2-4.2 7.4-4.2s3.7 .5 7.4 4.2c3.8 3.7 8 10 11.8 18.9c6.2 14.5 10.8 34.3 12.2 56.9h-63c1.5-22.6 6-42.4 12.2-56.9c3.8-8.9 8-15.2 11.8-18.9z"]
            }, C7 = ib, rj = {
              prefix: "fas",
              iconName: "virus",
              icon: [512, 512, [], "e074", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V43.5c0 49.9-60.3 74.9-95.6 39.6L120.2 75C107.7 62.5 87.5 62.5 75 75s-12.5 32.8 0 45.3l8.2 8.2C118.4 163.7 93.4 224 43.5 224H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H43.5c49.9 0 74.9 60.3 39.6 95.6L75 391.8c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l8.2-8.2c35.3-35.3 95.6-10.3 95.6 39.6V480c0 17.7 14.3 32 32 32s32-14.3 32-32V468.5c0-49.9 60.3-74.9 95.6-39.6l8.2 8.2c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-8.2-8.2c-35.3-35.3-10.3-95.6 39.6-95.6H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H468.5c-49.9 0-74.9-60.3-39.6-95.6l8.2-8.2c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-8.2 8.2C348.3 118.4 288 93.4 288 43.5V32zM176 224a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm128 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, L4 = {
              prefix: "fas",
              iconName: "envelope-circle-check",
              icon: [640, 512, [], "e4e8", "M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0l57.4-43c23.9-59.8 79.7-103.3 146.3-109.8l13.9-10.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176V384c0 35.3 28.7 64 64 64H360.2C335.1 417.6 320 378.5 320 336c0-5.6 .3-11.1 .8-16.6l-26.4 19.8zM640 336a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 353.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
            }, nj = {
              prefix: "fas",
              iconName: "layer-group",
              icon: [576, 512, [], "f5fd", "M264.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 149.8C37.4 145.8 32 137.3 32 128s5.4-17.9 13.9-21.8L264.5 5.2zM476.9 209.6l53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 277.8C37.4 273.8 32 265.3 32 256s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0l152-70.2zm-152 198.2l152-70.2 53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 405.8C37.4 401.8 32 393.3 32 384s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0z"]
            }, uX = {
              prefix: "fas",
              iconName: "arrows-to-dot",
              icon: [512, 512, [], "e4be", "M256 0c17.7 0 32 14.3 32 32V64h32c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-64 64c-12.5 12.5-32.8 12.5-45.3 0l-64-64c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8h32V32c0-17.7 14.3-32 32-32zM169.4 393.4l64-64c12.5-12.5 32.8-12.5 45.3 0l64 64c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8H288v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448H192c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9zM32 224H64V192c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c12.5 12.5 12.5 32.8 0 45.3l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6V288H32c-17.7 0-32-14.3-32-32s14.3-32 32-32zm297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3l64-64c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6v32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H448v32c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-64-64zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, bh = {
              prefix: "fas",
              iconName: "archway",
              icon: [512, 512, [], "f557", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zm0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32H96h64V352c0-53 43-96 96-96s96 43 96 96V480h64 64c17.7 0 32-14.3 32-32s-14.3-32-32-32V128H32V416z"]
            }, ll = {
              prefix: "fas",
              iconName: "heart-circle-check",
              icon: [576, 512, [], "e4fd", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L416 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
            }, xd = {
              prefix: "fas",
              iconName: "house-chimney-crack",
              icon: [576, 512, ["house-damage"], "f6f1", "M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c.2 35.5-28.5 64.3-64 64.3H326.4L288 448l80.8-67.3c7.8-6.5 7.6-18.6-.4-24.9L250.6 263.2c-14.6-11.5-33.8 7-22.8 22L288 368l-85.5 71.2c-6.1 5-7.5 13.8-3.5 20.5L230.4 512H128.1c-35.3 0-64-28.7-64-64V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L416 100.7V64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32V185l52.8 46.4c8 7 12 15 11 24z"]
            }, Pl = xd, lX = {
              prefix: "fas",
              iconName: "file-zipper",
              icon: [384, 512, ["file-archive"], "f1c6", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM96 48c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16zm-6.3 71.8c3.7-14 16.4-23.8 30.9-23.8h14.8c14.5 0 27.2 9.7 30.9 23.8l23.5 88.2c1.4 5.4 2.1 10.9 2.1 16.4c0 35.2-28.8 63.7-64 63.7s-64-28.5-64-63.7c0-5.5 .7-11.1 2.1-16.4l23.5-88.2zM112 336c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H112z"]
            }, PX = lX, K4 = {
              prefix: "fas",
              iconName: "square",
              icon: [448, 512, [9632, 9723, 9724, 61590], "f0c8", "M0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96z"]
            }, sb = {
              prefix: "fas",
              iconName: "martini-glass-empty",
              icon: [512, 512, ["glass-martini"], "f000", "M32 0C19.1 0 7.4 7.8 2.4 19.8s-2.2 25.7 6.9 34.9L224 269.3V448H160c-17.7 0-32 14.3-32 32s14.3 32 32 32h96 96c17.7 0 32-14.3 32-32s-14.3-32-32-32H288V269.3L502.6 54.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 0 480 0H32zM256 210.7L109.3 64H402.7L256 210.7z"]
            }, ij = sb, ab = {
              prefix: "fas",
              iconName: "couch",
              icon: [640, 512, [], "f4b8", "M64 160C64 89.3 121.3 32 192 32H448c70.7 0 128 57.3 128 128v33.6c-36.5 7.4-64 39.7-64 78.4v48H128V272c0-38.7-27.5-71-64-78.4V160zM544 272c0-20.9 13.4-38.7 32-45.3c5-1.8 10.4-2.7 16-2.7c26.5 0 48 21.5 48 48V448c0 17.7-14.3 32-32 32H576c-17.7 0-32-14.3-32-32H96c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32V272c0-26.5 21.5-48 48-48c5.6 0 11 1 16 2.7c18.6 6.6 32 24.4 32 45.3v48 32h32H512h32V320 272z"]
            }, hu = {
              prefix: "fas",
              iconName: "cedi-sign",
              icon: [384, 512, [], "e0df", "M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V66.7C101.2 81.9 32 160.9 32 256s69.2 174.1 160 189.3V480c0 17.7 14.3 32 32 32s32-14.3 32-32V445.3c30.9-5.2 59.2-17.7 83.2-35.8c14.1-10.6 17-30.7 6.4-44.8s-30.7-17-44.8-6.4c-13.2 9.9-28.3 17.3-44.8 21.6V132c16.4 4.2 31.6 11.6 44.8 21.6c14.1 10.6 34.2 7.8 44.8-6.4s7.8-34.2-6.4-44.8c-24-18-52.4-30.6-83.2-35.8V32zM192 132V380c-55.2-14.2-96-64.3-96-124s40.8-109.8 96-124z"]
            }, ob = {
              prefix: "fas",
              iconName: "italic",
              icon: [384, 512, [], "f033", "M128 64c0-17.7 14.3-32 32-32H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H293.3L160 416h64c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H90.7L224 96H160c-17.7 0-32-14.3-32-32z"]
            }, J4 = {
              prefix: "fas",
              iconName: "church",
              icon: [640, 512, [9962], "f51d", "M344 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V48H264c-13.3 0-24 10.7-24 24s10.7 24 24 24h32v46.4L183.3 210c-14.5 8.7-23.3 24.3-23.3 41.2V512h96V416c0-35.3 28.7-64 64-64s64 28.7 64 64v96h96V251.2c0-16.9-8.8-32.5-23.3-41.2L344 142.4V96h32c13.3 0 24-10.7 24-24s-10.7-24-24-24H344V24zM24.9 330.3C9.5 338.8 0 354.9 0 372.4V464c0 26.5 21.5 48 48 48h80V273.6L24.9 330.3zM592 512c26.5 0 48-21.5 48-48V372.4c0-17.5-9.5-33.6-24.9-42.1L512 273.6V512h80z"]
            }, WP = {
              prefix: "fas",
              iconName: "comments-dollar",
              icon: [640, 512, [], "f653", "M416 176c0 97.2-93.1 176-208 176c-38.2 0-73.9-8.7-104.7-23.9c-7.5 4-16 7.9-25.2 11.4C59.8 346.4 37.8 352 16 352c-6.9 0-13.1-4.5-15.2-11.1s.2-13.8 5.8-17.9l0 0 0 0 .2-.2c.2-.2 .6-.4 1.1-.8c1-.8 2.5-2 4.3-3.7c3.6-3.3 8.5-8.1 13.3-14.3c5.5-7 10.7-15.4 14.2-24.7C14.7 250.3 0 214.6 0 176C0 78.8 93.1 0 208 0S416 78.8 416 176zM231.5 383C348.9 372.9 448 288.3 448 176c0-5.2-.2-10.4-.6-15.5C555.1 167.1 640 243.2 640 336c0 38.6-14.7 74.3-39.6 103.4c3.5 9.4 8.7 17.7 14.2 24.7c4.8 6.2 9.7 11 13.3 14.3c1.8 1.6 3.3 2.9 4.3 3.7c.5 .4 .9 .7 1.1 .8l.2 .2 0 0 0 0c5.6 4.1 7.9 11.3 5.8 17.9c-2.1 6.6-8.3 11.1-15.2 11.1c-21.8 0-43.8-5.6-62.1-12.5c-9.2-3.5-17.8-7.4-25.2-11.4C505.9 503.3 470.2 512 432 512c-95.6 0-176.2-54.6-200.5-129zM228 72c0-11-9-20-20-20s-20 9-20 20V86c-7.6 1.7-15.2 4.4-22.2 8.5c-13.9 8.3-25.9 22.8-25.8 43.9c.1 20.3 12 33.1 24.7 40.7c11 6.6 24.7 10.8 35.6 14l1.7 .5c12.6 3.8 21.8 6.8 28 10.7c5.1 3.2 5.8 5.4 5.9 8.2c.1 5-1.8 8-5.9 10.5c-5 3.1-12.9 5-21.4 4.7c-11.1-.4-21.5-3.9-35.1-8.5c-2.3-.8-4.7-1.6-7.2-2.4c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3c1.9 .6 4 1.3 6.1 2.1l0 0 0 0c8.3 2.9 17.9 6.2 28.2 8.4V280c0 11 9 20 20 20s20-9 20-20V266.2c8-1.7 16-4.5 23.2-9c14.3-8.9 25.1-24.1 24.8-45c-.3-20.3-11.7-33.4-24.6-41.6c-11.5-7.2-25.9-11.6-37.1-15l-.7-.2c-12.8-3.9-21.9-6.7-28.3-10.5c-5.2-3.1-5.3-4.9-5.3-6.7c0-3.7 1.4-6.5 6.2-9.3c5.4-3.2 13.6-5.1 21.5-5c9.6 .1 20.2 2.2 31.2 5.2c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-6.5-1.7-13.7-3.4-21.1-4.7V72z"]
            }, w3 = {
              prefix: "fas",
              iconName: "democrat",
              icon: [640, 512, [], "f747", "M64 32c0-8.9 3.8-20.9 6.2-27.3C71.2 1.8 74 0 77 0c1.9 0 3.8 .7 5.2 2.1L128 45.7 173.8 2.1C175.2 .7 177.1 0 179 0c3 0 5.8 1.8 6.8 4.7c2.4 6.5 6.2 18.4 6.2 27.3c0 26.5-21.9 42-29.5 46.6l76.2 72.6c6 5.7 13.9 8.8 22.1 8.8H480l32 0c40.3 0 78.2 19 102.4 51.2l19.2 25.6c10.6 14.1 7.7 34.2-6.4 44.8s-34.2 7.7-44.8-6.4l-19.2-25.6c-5.3-7-11.8-12.8-19.2-17V320H192l-40.4-94.3c-3.9-9.2-15.3-12.6-23.6-7l-42.1 28c-9.1 6.1-19.7 9.3-30.7 9.3h-2C23.9 256 0 232.1 0 202.7c0-12.1 4.1-23.8 11.7-33.3L87.6 74.6C78.1 67.4 64 53.2 64 32zM448 352h96v64 64c0 17.7-14.3 32-32 32H480c-17.7 0-32-14.3-32-32V416H288v64c0 17.7-14.3 32-32 32H224c-17.7 0-32-14.3-32-32V416 352h96H448zM260.9 210.9c-.9-1.8-2.8-2.9-4.8-2.9s-3.9 1.1-4.8 2.9l-10.5 20.5-23.5 3.3c-2 .3-3.7 1.6-4.3 3.5s-.1 3.9 1.3 5.3l17 16-4 22.6c-.3 1.9 .5 3.9 2.1 5s3.8 1.3 5.6 .4l21-10.7 21 10.7c1.8 .9 4 .8 5.6-.4s2.5-3.1 2.1-5l-4-22.6 17-16c1.5-1.4 2-3.4 1.3-5.3s-2.3-3.2-4.3-3.5l-23.5-3.3-10.5-20.5zM368.1 208c-2 0-3.9 1.1-4.8 2.9l-10.5 20.5-23.5 3.3c-2 .3-3.7 1.6-4.3 3.5s-.1 3.9 1.3 5.3l17 16-4 22.6c-.3 1.9 .5 3.9 2.1 5s3.8 1.3 5.6 .4l21-10.7 21 10.7c1.8 .9 4 .8 5.6-.4s2.5-3.1 2.1-5l-4-22.6 17-16c1.5-1.4 2-3.4 1.4-5.3s-2.3-3.2-4.3-3.5l-23.5-3.3-10.5-20.5c-.9-1.8-2.8-2.9-4.8-2.9zm116.8 2.9c-.9-1.8-2.8-2.9-4.8-2.9s-3.9 1.1-4.8 2.9l-10.5 20.5-23.5 3.3c-2 .3-3.7 1.6-4.3 3.5s-.1 3.9 1.3 5.3l17 16-4 22.6c-.3 1.9 .5 3.9 2.1 5s3.8 1.3 5.6 .4l21-10.7 21 10.7c1.8 .9 4 .8 5.6-.4s2.5-3.1 2.1-5l-4-22.6 17-16c1.5-1.4 2-3.4 1.4-5.3s-2.3-3.2-4.3-3.5l-23.5-3.3-10.5-20.5z"]
            }, Q6 = {
              prefix: "fas",
              iconName: "z",
              icon: [384, 512, [122], "5a", "M0 64C0 46.3 14.3 32 32 32H352c12.4 0 23.7 7.2 29 18.4s3.6 24.5-4.4 34.1L100.3 416H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-12.4 0-23.7-7.2-29-18.4s-3.6-24.5 4.4-34.1L283.7 96H32C14.3 96 0 81.7 0 64z"]
            }, t9 = {
              prefix: "fas",
              iconName: "person-skiing",
              icon: [512, 512, [9975, "skiing"], "f7c9", "M380.7 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM2.7 268.9c6.1-11.8 20.6-16.3 32.4-10.2L232.7 361.3l46.2-69.2-75.1-75.1c-14.6-14.6-20.4-33.9-18.4-52.1l108.8 52 39.3 39.3c16.2 16.2 18.7 41.5 6 60.6L289.8 391l128.7 66.8c13.6 7.1 29.8 7.2 43.6 .3l15.2-7.6c11.9-5.9 26.3-1.1 32.2 10.7s1.1 26.3-10.7 32.2l-15.2 7.6c-27.5 13.7-59.9 13.5-87.2-.7L12.9 301.3C1.2 295.2-3.4 280.7 2.7 268.9zM118.9 65.6L137 74.2l8.7-17.4c4-7.9 13.6-11.1 21.5-7.2s11.1 13.6 7.2 21.5l-8.5 16.9 54.7 26.2c1.5-.7 3.1-1.4 4.7-2.1l83.4-33.4c34.2-13.7 72.8 4.2 84.5 39.2l17.1 51.2 52.1 26.1c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3l-58.1-29c-11.4-5.7-20-15.7-24.1-27.8l-5.8-17.3-27.3 12.1-6.8 3-6.7-3.2L151.5 116.7l-9.2 18.4c-4 7.9-13.6 11.1-21.5 7.2s-11.1-13.6-7.2-21.5l9-18-17.6-8.4c-8-3.8-11.3-13.4-7.5-21.3s13.4-11.3 21.3-7.5z"]
            }, fb = t9, Dd = {
              prefix: "fas",
              iconName: "road-lock",
              icon: [640, 512, [], "e567", "M288 32H213.2c-27.1 0-51.3 17.1-60.3 42.6L35.1 407.2c-2.1 5.9-3.1 12-3.1 18.2C32 455.5 56.5 480 86.6 480H288V416c0-17.7 14.3-32 32-32s32 14.3 32 32v64h32V352c0-23.7 12.9-44.4 32-55.4V272c0-58.3 44.6-106.2 101.5-111.5L487.1 74.6C478 49.1 453.9 32 426.8 32H352V96c0 17.7-14.3 32-32 32s-32-14.3-32-32V32zm64 192v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V224c0-17.7 14.3-32 32-32s32 14.3 32 32zm176 16c17.7 0 32 14.3 32 32v48H496V272c0-17.7 14.3-32 32-32zm-80 32v48c-17.7 0-32 14.3-32 32V480c0 17.7 14.3 32 32 32H608c17.7 0 32-14.3 32-32V352c0-17.7-14.3-32-32-32V272c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
            }, Hu = {
              prefix: "fas",
              iconName: "a",
              icon: [384, 512, [97], "41", "M221.5 51.7C216.6 39.8 204.9 32 192 32s-24.6 7.8-29.5 19.7l-120 288-40 96c-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2L93.3 384H290.7l31.8 76.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8l-40-96-120-288zM264 320H120l72-172.8L264 320z"]
            }, gu = {
              prefix: "fas",
              iconName: "temperature-arrow-down",
              icon: [576, 512, ["temperature-down"], "e03f", "M128 112c0-26.5 21.5-48 48-48s48 21.5 48 48V276.5c0 17.3 7.1 31.9 15.3 42.5C249.8 332.6 256 349.5 256 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9c8.2-10.6 15.3-25.2 15.3-42.5V112zM176 0C114.1 0 64 50.1 64 112V276.4c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C43.2 304.2 32 334.8 32 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6V112C288 50.1 237.9 0 176 0zm0 416c26.5 0 48-21.5 48-48c0-20.9-13.4-38.7-32-45.3V272c0-8.8-7.2-16-16-16s-16 7.2-16 16v50.7c-18.6 6.6-32 24.4-32 45.3c0 26.5 21.5 48 48 48zm336-64H480V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V352H384c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c6 6 14.1 9.4 22.6 9.4s16.6-3.4 22.6-9.4l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8z"]
            }, cX = gu, m3 = {
              prefix: "fas",
              iconName: "feather-pointed",
              icon: [512, 512, ["feather-alt"], "f56b", "M278.5 215.6L23 471c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l74.8-74.8c7.4 4.6 15.3 8.2 23.8 10.5C200.3 452.8 270 454.5 338 409.4c12.2-8.1 5.8-25.4-8.8-25.4l-16.1 0c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l97.7-29.3c3.4-1 6.4-3.1 8.4-6.1c4.4-6.4 8.6-12.9 12.6-19.6c6.2-10.3-1.5-23-13.5-23l-38.6 0c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l80.9-24.3c4.6-1.4 8.4-4.8 10.2-9.3C494.5 163 507.8 86.1 511.9 36.8c.8-9.9-3-19.6-10-26.6s-16.7-10.8-26.6-10C391.5 7 228.5 40.5 137.4 131.6C57.3 211.7 56.7 302.3 71.3 356.4c2.1 7.9 12 9.6 17.8 3.8L253.6 195.8c6.2-6.2 16.4-6.2 22.6 0c5.4 5.4 6.1 13.6 2.2 19.8z"]
            }, sj = m3, O7 = {
              prefix: "fas",
              iconName: "p",
              icon: [320, 512, [112], "50", "M0 96C0 60.7 28.7 32 64 32h96c88.4 0 160 71.6 160 160s-71.6 160-160 160H64v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V320 96zM64 288h96c53 0 96-43 96-96s-43-96-96-96H64V288z"]
            }, z4 = {
              prefix: "fas",
              iconName: "snowflake",
              icon: [448, 512, [10052, 10054], "f2dc", "M224 0c17.7 0 32 14.3 32 32V62.1l15-15c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-49 49v70.3l61.4-35.8 17.7-66.1c3.4-12.8 16.6-20.4 29.4-17s20.4 16.6 17 29.4l-5.2 19.3 23.6-13.8c15.3-8.9 34.9-3.7 43.8 11.5s3.8 34.9-11.5 43.8l-25.3 14.8 21.7 5.8c12.8 3.4 20.4 16.6 17 29.4s-16.6 20.4-29.4 17l-67.7-18.1L287.5 256l60.9 35.5 67.7-18.1c12.8-3.4 26 4.2 29.4 17s-4.2 26-17 29.4l-21.7 5.8 25.3 14.8c15.3 8.9 20.4 28.5 11.5 43.8s-28.5 20.4-43.8 11.5l-23.6-13.8 5.2 19.3c3.4 12.8-4.2 26-17 29.4s-26-4.2-29.4-17l-17.7-66.1L256 311.7v70.3l49 49c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-15-15V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V449.9l-15 15c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l49-49V311.7l-61.4 35.8-17.7 66.1c-3.4 12.8-16.6 20.4-29.4 17s-20.4-16.6-17-29.4l5.2-19.3L48.1 395.6c-15.3 8.9-34.9 3.7-43.8-11.5s-3.7-34.9 11.5-43.8l25.3-14.8-21.7-5.8c-12.8-3.4-20.4-16.6-17-29.4s16.6-20.4 29.4-17l67.7 18.1L160.5 256 99.6 220.5 31.9 238.6c-12.8 3.4-26-4.2-29.4-17s4.2-26 17-29.4l21.7-5.8L15.9 171.6C.6 162.7-4.5 143.1 4.4 127.9s28.5-20.4 43.8-11.5l23.6 13.8-5.2-19.3c-3.4-12.8 4.2-26 17-29.4s26 4.2 29.4 17l17.7 66.1L192 200.3V129.9L143 81c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l15 15V32c0-17.7 14.3-32 32-32z"]
            }, cl = {
              prefix: "fas",
              iconName: "newspaper",
              icon: [512, 512, [128240], "f1ea", "M96 96c0-35.3 28.7-64 64-64H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H80c-44.2 0-80-35.8-80-80V128c0-17.7 14.3-32 32-32s32 14.3 32 32V400c0 8.8 7.2 16 16 16s16-7.2 16-16V96zm64 24v80c0 13.3 10.7 24 24 24H296c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24H184c-13.3 0-24 10.7-24 24zm208-8c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16s-7.2-16-16-16H384c-8.8 0-16 7.2-16 16zm0 96c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16s-7.2-16-16-16H384c-8.8 0-16 7.2-16 16zM160 304c0 8.8 7.2 16 16 16H432c8.8 0 16-7.2 16-16s-7.2-16-16-16H176c-8.8 0-16 7.2-16 16zm0 96c0 8.8 7.2 16 16 16H432c8.8 0 16-7.2 16-16s-7.2-16-16-16H176c-8.8 0-16 7.2-16 16z"]
            }, y7 = {
              prefix: "fas",
              iconName: "rectangle-ad",
              icon: [576, 512, ["ad"], "f641", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM229.5 173.3l72 144c5.9 11.9 1.1 26.3-10.7 32.2s-26.3 1.1-32.2-10.7L253.2 328H162.8l-5.4 10.7c-5.9 11.9-20.3 16.7-32.2 10.7s-16.7-20.3-10.7-32.2l72-144c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3zM208 237.7L186.8 280h42.3L208 237.7zM392 256a24 24 0 1 0 0 48 24 24 0 1 0 0-48zm24-43.9V184c0-13.3 10.7-24 24-24s24 10.7 24 24v96 48c0 13.3-10.7 24-24 24c-6.6 0-12.6-2.7-17-7c-9.4 4.5-19.9 7-31 7c-39.8 0-72-32.2-72-72s32.2-72 72-72c8.4 0 16.5 1.4 24 4.1z"]
            }, Ab = y7, db = {
              prefix: "fas",
              iconName: "circle-arrow-right",
              icon: [512, 512, ["arrow-circle-right"], "f0a9", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM281 385c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l71-71L136 280c-13.3 0-24-10.7-24-24s10.7-24 24-24l182.1 0-71-71c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L393 239c9.4 9.4 9.4 24.6 0 33.9L281 385z"]
            }, aj = db, G4 = {
              prefix: "fas",
              iconName: "filter-circle-xmark",
              icon: [576, 512, [], "e17b", "M3.9 22.9C10.5 8.9 24.5 0 40 0H472c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L396.4 195.6C316.2 212.1 256 283 256 368c0 27.4 6.3 53.4 17.5 76.5c-1.6-.8-3.2-1.8-4.7-2.9l-64-48c-8.1-6-12.8-15.5-12.8-25.6V288.9L9 65.3C-.7 53.4-2.8 36.8 3.9 22.9zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L432 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L409.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L432 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L454.6 368l36.7-36.7z"]
            }, oj = {
              prefix: "fas",
              iconName: "locust",
              icon: [576, 512, [], "e520", "M312 32c-13.3 0-24 10.7-24 24s10.7 24 24 24h16c98.7 0 180.6 71.4 197 165.4c-9-3.5-18.8-5.4-29-5.4H431.8l-41.8-97.5c-3.4-7.9-10.8-13.4-19.3-14.4s-17 2.7-22.1 9.6l-40.9 55.5-21.7-50.7c-3.3-7.8-10.5-13.2-18.9-14.3s-16.7 2.3-22 8.9l-240 304c-8.2 10.4-6.4 25.5 4 33.7s25.5 6.4 33.7-4l79.4-100.5 43 16.4-40.5 55c-7.9 10.7-5.6 25.7 5.1 33.6s25.7 5.6 33.6-5.1L215.1 400h74.5l-29.3 42.3c-7.5 10.9-4.8 25.8 6.1 33.4s25.8 4.8 33.4-6.1L348 400h80.4l38.8 67.9c6.6 11.5 21.2 15.5 32.7 8.9s15.5-21.2 8.9-32.7L483.6 400H496c44.1 0 79.8-35.7 80-79.7c0-.1 0-.2 0-.3V280C576 143 465 32 328 32H312zm50.5 168l17.1 40H333l29.5-40zm-87.7 38.1l-1.4 1.9H225.1l32.7-41.5 16.9 39.5zM88.8 240C57.4 240 32 265.4 32 296.8c0 15.5 6.3 30 16.9 40.4L126.7 240H88.8zM496 288a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
            }, fj = {
              prefix: "fas",
              iconName: "sort",
              icon: [320, 512, ["unsorted"], "f0dc", "M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8H32c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z"]
            }, vb = fj, k7 = {
              prefix: "fas",
              iconName: "list-ol",
              icon: [512, 512, ["list-1-2", "list-numeric"], "f0cb", "M24 56c0-13.3 10.7-24 24-24H80c13.3 0 24 10.7 24 24V176h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H40c-13.3 0-24-10.7-24-24s10.7-24 24-24H56V80H48C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432H120c13.3 0 24 10.7 24 24s-10.7 24-24 24H32c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, Aj = k7, Z4 = k7, pl = {
              prefix: "fas",
              iconName: "person-dress-burst",
              icon: [640, 512, [], "e544", "M528 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM390.2 384H408v96c0 17.7 14.3 32 32 32s32-14.3 32-32V384h16v96c0 17.7 14.3 32 32 32s32-14.3 32-32V384h17.8c10.9 0 18.6-10.7 15.2-21.1L546.7 248.1l33.9 56.3c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-53.6-89.2c-20.2-33.7-56.7-54.3-96-54.3H474.2c-39.3 0-75.7 20.6-96 54.3l-53.6 89.2c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9l33.9-56.3L375 362.9c-3.5 10.4 4.3 21.1 15.2 21.1zM190.9 18.1C188.4 12 182.6 8 176 8s-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6L176 286.1l58.6 53.9c4.8 4.4 11.9 5.5 17.8 2.6s9.5-9 9-15.5l-5.6-79.4 50.5-7.8 24.4-40.5-55.2-38L315 92.2c3.3-5.7 2.7-12.8-1.4-17.9s-10.9-7.2-17.2-5.3L220.3 92.1l-29.4-74z"]
            }, xh = {
              prefix: "fas",
              iconName: "money-check-dollar",
              icon: [576, 512, ["money-check-alt"], "f53d", "M64 64C28.7 64 0 92.7 0 128V384c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H64zM272 192H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H272c-8.8 0-16-7.2-16-16s7.2-16 16-16zM256 304c0-8.8 7.2-16 16-16H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H272c-8.8 0-16-7.2-16-16zM164 152v13.9c7.5 1.2 14.6 2.9 21.1 4.7c10.7 2.8 17 13.8 14.2 24.5s-13.8 17-24.5 14.2c-11-2.9-21.6-5-31.2-5.2c-7.9-.1-16 1.8-21.5 5c-4.8 2.8-6.2 5.6-6.2 9.3c0 1.8 .1 3.5 5.3 6.7c6.3 3.8 15.5 6.7 28.3 10.5l.7 .2c11.2 3.4 25.6 7.7 37.1 15c12.9 8.1 24.3 21.3 24.6 41.6c.3 20.9-10.5 36.1-24.8 45c-7.2 4.5-15.2 7.3-23.2 9V360c0 11-9 20-20 20s-20-9-20-20V345.4c-10.3-2.2-20-5.5-28.2-8.4l0 0 0 0c-2.1-.7-4.1-1.4-6.1-2.1c-10.5-3.5-16.1-14.8-12.6-25.3s14.8-16.1 25.3-12.6c2.5 .8 4.9 1.7 7.2 2.4c13.6 4.6 24 8.1 35.1 8.5c8.6 .3 16.5-1.6 21.4-4.7c4.1-2.5 6-5.5 5.9-10.5c0-2.9-.8-5-5.9-8.2c-6.3-4-15.4-6.9-28-10.7l-1.7-.5c-10.9-3.3-24.6-7.4-35.6-14c-12.7-7.7-24.6-20.5-24.7-40.7c-.1-21.1 11.8-35.7 25.8-43.9c6.9-4.1 14.5-6.8 22.2-8.5V152c0-11 9-20 20-20s20 9 20 20z"]
            }, uB = xh, lB = {
              prefix: "fas",
              iconName: "vector-square",
              icon: [448, 512, [], "f5cb", "M368 80h32v32H368V80zM352 32c-17.7 0-32 14.3-32 32H128c0-17.7-14.3-32-32-32H32C14.3 32 0 46.3 0 64v64c0 17.7 14.3 32 32 32V352c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32H320c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32V384c0-17.7-14.3-32-32-32V160c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32H352zM96 160c17.7 0 32-14.3 32-32H320c0 17.7 14.3 32 32 32V352c-17.7 0-32 14.3-32 32H128c0-17.7-14.3-32-32-32V160zM48 400H80v32H48V400zm320 32V400h32v32H368zM48 112V80H80v32H48z"]
            }, PB = {
              prefix: "fas",
              iconName: "bread-slice",
              icon: [512, 512, [], "f7ec", "M256 32C192 32 0 64 0 192c0 35.3 28.7 64 64 64V432c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V256c35.3 0 64-28.7 64-64C512 64 320 32 256 32z"]
            }, cB = {
              prefix: "fas",
              iconName: "language",
              icon: [640, 512, [], "f1ab", "M0 128C0 92.7 28.7 64 64 64H256h48 16H576c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H320 304 256 64c-35.3 0-64-28.7-64-64V128zm320 0V384H576V128H320zM178.3 175.9c-3.2-7.2-10.4-11.9-18.3-11.9s-15.1 4.7-18.3 11.9l-64 144c-4.5 10.1 .1 21.9 10.2 26.4s21.9-.1 26.4-10.2l8.9-20.1h73.6l8.9 20.1c4.5 10.1 16.3 14.6 26.4 10.2s14.6-16.3 10.2-26.4l-64-144zM160 233.2L179 276H141l19-42.8zM448 164c11 0 20 9 20 20v4h44 16c11 0 20 9 20 20s-9 20-20 20h-2l-1.6 4.5c-8.9 24.4-22.4 46.6-39.6 65.4c.9 .6 1.8 1.1 2.7 1.6l18.9 11.3c9.5 5.7 12.5 18 6.9 27.4s-18 12.5-27.4 6.9l-18.9-11.3c-4.5-2.7-8.8-5.5-13.1-8.5c-10.6 7.5-21.9 14-34 19.4l-3.6 1.6c-10.1 4.5-21.9-.1-26.4-10.2s.1-21.9 10.2-26.4l3.6-1.6c6.4-2.9 12.6-6.1 18.5-9.8l-12.2-12.2c-7.8-7.8-7.8-20.5 0-28.3s20.5-7.8 28.3 0l14.6 14.6 .5 .5c12.4-13.1 22.5-28.3 29.8-45H448 376c-11 0-20-9-20-20s9-20 20-20h52v-4c0-11 9-20 20-20z"]
            }, dj = {
              prefix: "fas",
              iconName: "face-kiss-wink-heart",
              icon: [512, 512, [128536, "kiss-wink-heart"], "f598", "M498 339.7c9.1-26.2 14-54.4 14-83.7C512 114.6 397.4 0 256 0S0 114.6 0 256S114.6 512 256 512c35.4 0 69.1-7.2 99.7-20.2c-4.8-5.5-8.5-12.2-10.4-19.7l-22.9-89.3c-10-39 11.8-80.9 51.8-92.1c37.2-10.4 73.8 10.1 87.5 44c12.7-1.6 25.1 .4 36.2 5zM296 332c0 6.9-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C258.7 443.1 241.4 448 224 448c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9l0 0 0 0 0 0 0 0 .2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1l-.6-.4-.3-.2-.2-.1 0 0 0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7l0 0 0 0 0 0 0 0 0 0 .2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1 0 0 0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm194.8 57.6c-17.6-23.5-52.8-23.5-70.4 0c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2zM434 352.3c-6-23.2-28.8-37-51.1-30.8s-35.4 30.1-29.5 53.4l22.9 89.3c2.2 8.7 11.2 13.9 19.8 11.4l84.9-23.8c22.2-6.2 35.4-30.1 29.5-53.4s-28.8-37-51.1-30.8l-20.2 5.6-5.4-21z"]
            }, vj = dj, pX = {
              prefix: "fas",
              iconName: "filter",
              icon: [512, 512, [], "f0b0", "M3.9 54.9C10.5 40.9 24.5 32 40 32H472c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9V448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6V320.9L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"]
            }, uj = {
              prefix: "fas",
              iconName: "question",
              icon: [320, 512, [10067, 10068, 61736], "3f", "M80 160c0-35.3 28.7-64 64-64h32c35.3 0 64 28.7 64 64v3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74V320c0 17.7 14.3 32 32 32s32-14.3 32-32v-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7V160c0-70.7-57.3-128-128-128H144C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
            }, pB = {
              prefix: "fas",
              iconName: "file-signature",
              icon: [576, 512, [], "f573", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V428.7c-2.7 1.1-5.4 2-8.2 2.7l-60.1 15c-3 .7-6 1.2-9 1.4c-.9 .1-1.8 .2-2.7 .2H240c-6.1 0-11.6-3.4-14.3-8.8l-8.8-17.7c-1.7-3.4-5.1-5.5-8.8-5.5s-7.2 2.1-8.8 5.5l-8.8 17.7c-2.9 5.9-9.2 9.4-15.7 8.8s-12.1-5.1-13.9-11.3L144 381l-9.8 32.8c-6.1 20.3-24.8 34.2-46 34.2H80c-8.8 0-16-7.2-16-16s7.2-16 16-16h8.2c7.1 0 13.3-4.6 15.3-11.4l14.9-49.5c3.4-11.3 13.8-19.1 25.6-19.1s22.2 7.8 25.6 19.1l11.6 38.6c7.4-6.2 16.8-9.7 26.8-9.7c15.9 0 30.4 9 37.5 23.2l4.4 8.8h8.9c-3.1-8.8-3.7-18.4-1.4-27.8l15-60.1c2.8-11.3 8.6-21.5 16.8-29.7L384 203.6V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM549.8 139.7c-15.6-15.6-40.9-15.6-56.6 0l-29.4 29.4 71 71 29.4-29.4c15.6-15.6 15.6-40.9 0-56.6l-14.4-14.4zM311.9 321c-4.1 4.1-7 9.2-8.4 14.9l-15 60.1c-1.4 5.5 .2 11.2 4.2 15.2s9.7 5.6 15.2 4.2l60.1-15c5.6-1.4 10.8-4.3 14.9-8.4L512.1 262.7l-71-71L311.9 321z"]
            }, E7 = {
              prefix: "fas",
              iconName: "up-down-left-right",
              icon: [512, 512, ["arrows-alt"], "f0b2", "M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8h32v96H128V192c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6V288h96v96H192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8H288V288h96v32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6v32H288V128h32c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64z"]
            }, Dh = E7, hB = {
              prefix: "fas",
              iconName: "house-chimney-user",
              icon: [576, 512, [], "e065", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L512 185V64c0-17.7-14.3-32-32-32H448c-17.7 0-32 14.3-32 32v36.7L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1h32V448c0 35.3 28.7 64 64 64H448.5c35.5 0 64.2-28.8 64-64.3l-.7-160.2h32zM288 160a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM176 400c0-44.2 35.8-80 80-80h64c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16H192c-8.8 0-16-7.2-16-16z"]
            }, _4 = {
              prefix: "fas",
              iconName: "hand-holding-heart",
              icon: [576, 512, [], "f4be", "M163.9 136.9c-29.4-29.8-29.4-78.2 0-108s77-29.8 106.4 0l17.7 18 17.7-18c29.4-29.8 77-29.8 106.4 0s29.4 78.2 0 108L310.5 240.1c-6.2 6.3-14.3 9.4-22.5 9.4s-16.3-3.1-22.5-9.4L163.9 136.9zM568.2 336.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5H192 32c-17.7 0-32-14.3-32-32V416c0-17.7 14.3-32 32-32H68.8l44.9-36c22.7-18.2 50.9-28 80-28H272h16 64c17.7 0 32 14.3 32 32s-14.3 32-32 32H288 272c-8.8 0-16 7.2-16 16s7.2 16 16 16H392.6l119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 384l0 0-.9 0c.3 0 .6 0 .9 0z"]
            }, lj = {
              prefix: "fas",
              iconName: "puzzle-piece",
              icon: [512, 512, [129513], "f12e", "M192 104.8c0-9.2-5.8-17.3-13.2-22.8C167.2 73.3 160 61.3 160 48c0-26.5 28.7-48 64-48s64 21.5 64 48c0 13.3-7.2 25.3-18.8 34c-7.4 5.5-13.2 13.6-13.2 22.8v0c0 12.8 10.4 23.2 23.2 23.2H336c26.5 0 48 21.5 48 48v56.8c0 12.8 10.4 23.2 23.2 23.2v0c9.2 0 17.3-5.8 22.8-13.2c8.7-11.6 20.7-18.8 34-18.8c26.5 0 48 28.7 48 64s-21.5 64-48 64c-13.3 0-25.3-7.2-34-18.8c-5.5-7.4-13.6-13.2-22.8-13.2v0c-12.8 0-23.2 10.4-23.2 23.2V464c0 26.5-21.5 48-48 48H279.2c-12.8 0-23.2-10.4-23.2-23.2v0c0-9.2 5.8-17.3 13.2-22.8c11.6-8.7 18.8-20.7 18.8-34c0-26.5-28.7-48-64-48s-64 21.5-64 48c0 13.3 7.2 25.3 18.8 34c7.4 5.5 13.2 13.6 13.2 22.8v0c0 12.8-10.4 23.2-23.2 23.2H48c-26.5 0-48-21.5-48-48V343.2C0 330.4 10.4 320 23.2 320v0c9.2 0 17.3 5.8 22.8 13.2C54.7 344.8 66.7 352 80 352c26.5 0 48-28.7 48-64s-21.5-64-48-64c-13.3 0-25.3 7.2-34 18.8C40.5 250.2 32.4 256 23.2 256v0C10.4 256 0 245.6 0 232.8V176c0-26.5 21.5-48 48-48H168.8c12.8 0 23.2-10.4 23.2-23.2v0z"]
            }, Pj = {
              prefix: "fas",
              iconName: "money-check",
              icon: [576, 512, [], "f53c", "M64 64C28.7 64 0 92.7 0 128V384c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H64zm48 160H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zM96 336c0-8.8 7.2-16 16-16H464c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16zM376 160h80c13.3 0 24 10.7 24 24v48c0 13.3-10.7 24-24 24H376c-13.3 0-24-10.7-24-24V184c0-13.3 10.7-24 24-24z"]
            }, ub = {
              prefix: "fas",
              iconName: "star-half-stroke",
              icon: [640, 512, ["star-half-alt"], "f5c0", "M320 376.4l.1-.1 26.4 14.1 85.2 45.5-16.5-97.6-4.8-28.7 20.7-20.5 70.1-69.3-96.1-14.2-29.3-4.3-12.9-26.6L320.1 86.9l-.1 .3V376.4zm175.1 98.3c2 12-3 24.2-12.9 31.3s-23 8-33.8 2.3L320.1 439.8 191.8 508.3C181 514 167.9 513.1 158 506s-14.9-19.3-12.9-31.3L169.8 329 65.6 225.9c-8.6-8.5-11.7-21.2-7.9-32.7s13.7-19.9 25.7-21.7L227 150.3 291.4 18c5.4-11 16.5-18 28.8-18s23.4 7 28.8 18l64.3 132.3 143.6 21.2c12 1.8 22 10.2 25.7 21.7s.7 24.2-7.9 32.7L470.5 329l24.6 145.7z"]
            }, cj = ub, pj = {
              prefix: "fas",
              iconName: "code",
              icon: [640, 512, [], "f121", "M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"]
            }, GA = {
              prefix: "fas",
              iconName: "whiskey-glass",
              icon: [512, 512, [129347, "glass-whiskey"], "f7a0", "M32 32c-9.3 0-18.1 4-24.2 11.1S-1 59.4 .3 68.6l50 342.9c5.7 39.3 39.4 68.5 79.2 68.5h253c39.7 0 73.4-29.1 79.2-68.5l50-342.9c1.3-9.2-1.4-18.5-7.5-25.5S489.3 32 480 32H32zM87.7 224L69 96H443L424.3 224H87.7z"]
            }, jh = GA, SP = {
              prefix: "fas",
              iconName: "building-circle-exclamation",
              icon: [640, 512, [], "e4d3", "M48 0C21.5 0 0 21.5 0 48V464c0 26.5 21.5 48 48 48h96V432c0-26.5 21.5-48 48-48s48 21.5 48 48v80h96c15.1 0 28.5-6.9 37.3-17.8C340.4 462.2 320 417.5 320 368c0-54.7 24.9-103.5 64-135.8V48c0-26.5-21.5-48-48-48H48zM64 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V240zm112-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V240zM80 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V112zM272 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16v80c0 8.8-7.2 16-16 16s-16-7.2-16-16V288c0-8.8 7.2-16 16-16z"]
            }, hj = {
              prefix: "fas",
              iconName: "magnifying-glass-chart",
              icon: [512, 512, [], "e522", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zm-312 8v64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24zm80-96V280c0 13.3 10.7 24 24 24s24-10.7 24-24V120c0-13.3-10.7-24-24-24s-24 10.7-24 24zm80 64v96c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]
            }, lb = {
              prefix: "fas",
              iconName: "arrow-up-right-from-square",
              icon: [512, 512, ["external-link"], "f08e", "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"]
            }, Pb = lb, HB = {
              prefix: "fas",
              iconName: "cubes-stacked",
              icon: [448, 512, [], "e4e6", "M192 64v64c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32H224c-17.7 0-32 14.3-32 32zM82.7 207c-15.3 8.8-20.5 28.4-11.7 43.7l32 55.4c8.8 15.3 28.4 20.5 43.7 11.7l55.4-32c15.3-8.8 20.5-28.4 11.7-43.7l-32-55.4c-8.8-15.3-28.4-20.5-43.7-11.7L82.7 207zM288 192c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H288zm64 160c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32V384c0-17.7-14.3-32-32-32H352zM160 384v64c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32V384c0-17.7-14.3-32-32-32H192c-17.7 0-32 14.3-32 32zM32 352c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V384c0-17.7-14.3-32-32-32H32z"]
            }, cb = {
              prefix: "fas",
              iconName: "won-sign",
              icon: [512, 512, [8361, "krw", "won"], "f159", "M62.4 53.9C56.8 37.1 38.6 28.1 21.9 33.6S-3.9 57.4 1.6 74.1L51.6 224H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H72.9l56.7 170.1c4.5 13.5 17.4 22.4 31.6 21.9s26.4-10.4 29.8-24.2L233 288h46L321 455.8c3.4 13.8 15.6 23.7 29.8 24.2s27.1-8.4 31.6-21.9L439.1 288H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H460.4l50-149.9c5.6-16.8-3.5-34.9-20.2-40.5s-34.9 3.5-40.5 20.2L392.9 224H329L287 56.2C283.5 42 270.7 32 256 32s-27.5 10-31 24.2L183 224h-64L62.4 53.9zm78 234.1H167l-11.4 45.6L140.4 288zM249 224l7-28.1 7 28.1H249zm96 64h26.6l-15.2 45.6L345 288z"]
            }, UP = cb, $4 = cb, pb = {
              prefix: "fas",
              iconName: "virus-covid",
              icon: [512, 512, [], "e4a8", "M192 24c0-13.3 10.7-24 24-24h80c13.3 0 24 10.7 24 24s-10.7 24-24 24H280V81.6c30.7 4.2 58.8 16.3 82.3 34.1L386.1 92 374.8 80.6c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l56.6 56.6c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L420 125.9l-23.8 23.8c17.9 23.5 29.9 51.7 34.1 82.3H464V216c0-13.3 10.7-24 24-24s24 10.7 24 24v80c0 13.3-10.7 24-24 24s-24-10.7-24-24V280H430.4c-4.2 30.7-16.3 58.8-34.1 82.3L420 386.1l11.3-11.3c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-56.6 56.6c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L386.1 420l-23.8-23.8c-23.5 17.9-51.7 29.9-82.3 34.1V464h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h16V430.4c-30.7-4.2-58.8-16.3-82.3-34.1L125.9 420l11.3 11.3c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L46.7 408.7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L92 386.1l23.8-23.8C97.9 338.8 85.8 310.7 81.6 280H48v16c0 13.3-10.7 24-24 24s-24-10.7-24-24V216c0-13.3 10.7-24 24-24s24 10.7 24 24v16H81.6c4.2-30.7 16.3-58.8 34.1-82.3L92 125.9 80.6 137.2c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l56.6-56.6c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L125.9 92l23.8 23.8c23.5-17.9 51.7-29.9 82.3-34.1V48H216c-13.3 0-24-10.7-24-24zm48 200a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm64 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
            }, Hj = {
              prefix: "fas",
              iconName: "austral-sign",
              icon: [448, 512, [], "e0a9", "M253.5 51.7C248.6 39.8 236.9 32 224 32s-24.6 7.8-29.5 19.7L122.7 224H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H96L82.7 320H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H56L34.5 435.7c-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2L125.3 384H322.7l31.8 76.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8L392 384h24c17.7 0 32-14.3 32-32s-14.3-32-32-32H365.3L352 288h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H325.3L253.5 51.7zM256 224H192l32-76.8L256 224zm-90.7 64H282.7L296 320H152l13.3-32z"]
            }, Y6 = {
              prefix: "fas",
              iconName: "f",
              icon: [320, 512, [102], "46", "M64 32C28.7 32 0 60.7 0 96V256 448c0 17.7 14.3 32 32 32s32-14.3 32-32V288H224c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V96H288c17.7 0 32-14.3 32-32s-14.3-32-32-32H64z"]
            }, F7 = {
              prefix: "fas",
              iconName: "leaf",
              icon: [512, 512, [], "f06c", "M272 96c-78.6 0-145.1 51.5-167.7 122.5c33.6-17 71.5-26.5 111.7-26.5h88c8.8 0 16 7.2 16 16s-7.2 16-16 16H288 216s0 0 0 0c-16.6 0-32.7 1.9-48.2 5.4c-25.9 5.9-50 16.4-71.4 30.7c0 0 0 0 0 0C38.3 298.8 0 364.9 0 440v16c0 13.3 10.7 24 24 24s24-10.7 24-24V440c0-48.7 20.7-92.5 53.8-123.2C121.6 392.3 190.3 448 272 448l1 0c132.1-.7 239-130.9 239-291.4c0-42.6-7.5-83.1-21.1-119.6c-2.6-6.9-12.7-6.6-16.2-.1C455.9 72.1 418.7 96 376 96L272 96z"]
            }, gj = {
              prefix: "fas",
              iconName: "road",
              icon: [576, 512, [128739], "f018", "M256 32H181.2c-27.1 0-51.3 17.1-60.3 42.6L3.1 407.2C1.1 413 0 419.2 0 425.4C0 455.5 24.5 480 54.6 480H256V416c0-17.7 14.3-32 32-32s32 14.3 32 32v64H521.4c30.2 0 54.6-24.5 54.6-54.6c0-6.2-1.1-12.4-3.1-18.2L455.1 74.6C446 49.1 421.9 32 394.8 32H320V96c0 17.7-14.3 32-32 32s-32-14.3-32-32V32zm64 192v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V224c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
            }, B3 = {
              prefix: "fas",
              iconName: "taxi",
              icon: [512, 512, [128662, "cab"], "f1ba", "M192 0c-17.7 0-32 14.3-32 32V64c0 .1 0 .1 0 .2c-38.6 2.2-72.3 27.3-85.2 64.1L39.6 228.8C16.4 238.4 0 261.3 0 288V432v48c0 17.7 14.3 32 32 32H64c17.7 0 32-14.3 32-32V432H416v48c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V432 288c0-26.7-16.4-49.6-39.6-59.2L437.2 128.3c-12.9-36.8-46.6-62-85.2-64.1c0-.1 0-.1 0-.2V32c0-17.7-14.3-32-32-32H192zM165.4 128H346.6c13.6 0 25.7 8.6 30.2 21.4L402.9 224H109.1l26.1-74.6c4.5-12.8 16.6-21.4 30.2-21.4zM96 288a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm288 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, W3 = B3, N7 = {
              prefix: "fas",
              iconName: "person-circle-plus",
              icon: [576, 512, [], "e541", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V256.9L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6h29.7c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H152zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm16 80c0-8.8-7.2-16-16-16s-16 7.2-16 16v48H368c-8.8 0-16 7.2-16 16s7.2 16 16 16h48v48c0 8.8 7.2 16 16 16s16-7.2 16-16V384h48c8.8 0 16-7.2 16-16s-7.2-16-16-16H448V304z"]
            }, S3 = {
              prefix: "fas",
              iconName: "chart-pie",
              icon: [576, 512, ["pie-chart"], "f200", "M304 240V16.6c0-9 7-16.6 16-16.6C443.7 0 544 100.3 544 224c0 9-7.6 16-16.6 16H304zM32 272C32 150.7 122.1 50.3 239 34.3c9.2-1.3 17 6.1 17 15.4V288L412.5 444.5c6.7 6.7 6.2 17.7-1.5 23.1C371.8 495.6 323.8 512 272 512C139.5 512 32 404.6 32 272zm526.4 16c9.3 0 16.6 7.8 15.4 17c-7.7 55.9-34.6 105.6-73.9 142.3c-6 5.6-15.4 5.2-21.2-.7L320 288H558.4z"]
            }, Hv = S3, Q7 = {
              prefix: "fas",
              iconName: "bolt-lightning",
              icon: [384, 512, [], "e0b7", "M0 256L28.5 28c2-16 15.6-28 31.8-28H228.9c15 0 27.1 12.1 27.1 27.1c0 3.2-.6 6.5-1.7 9.5L208 160H347.3c20.2 0 36.7 16.4 36.7 36.7c0 7.4-2.2 14.6-6.4 20.7l-192.2 281c-5.9 8.6-15.6 13.7-25.9 13.7h-2.9c-15.7 0-28.5-12.8-28.5-28.5c0-2.3 .3-4.6 .9-6.9L176 288H32c-17.7 0-32-14.3-32-32z"]
            }, eT = {
              prefix: "fas",
              iconName: "sack-xmark",
              icon: [512, 512, [], "e56a", "M192 96H320l47.4-71.1C374.5 14.2 366.9 0 354.1 0H157.9c-12.8 0-20.4 14.2-13.3 24.9L192 96zm128 32H192c-3.8 2.5-8.1 5.3-13 8.4l0 0 0 0C122.3 172.7 0 250.9 0 416c0 53 43 96 96 96H416c53 0 96-43 96-96c0-165.1-122.3-243.3-179-279.6c-4.8-3.1-9.2-5.9-13-8.4zM289.9 336l47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47z"]
            }, s1 = {
              prefix: "fas",
              iconName: "file-excel",
              icon: [384, 512, [], "f1c3", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM155.7 250.2L192 302.1l36.3-51.9c7.6-10.9 22.6-13.5 33.4-5.9s13.5 22.6 5.9 33.4L221.3 344l46.4 66.2c7.6 10.9 5 25.8-5.9 33.4s-25.8 5-33.4-5.9L192 385.8l-36.3 51.9c-7.6 10.9-22.6 13.5-33.4 5.9s-13.5-22.6-5.9-33.4L162.7 344l-46.4-66.2c-7.6-10.9-5-25.8 5.9-33.4s25.8-5 33.4 5.9z"]
            }, E1 = {
              prefix: "fas",
              iconName: "file-contract",
              icon: [384, 512, [], "f56c", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM80 64h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16s7.2-16 16-16zm54.2 253.8c-6.1 20.3-24.8 34.2-46 34.2H80c-8.8 0-16-7.2-16-16s7.2-16 16-16h8.2c7.1 0 13.3-4.6 15.3-11.4l14.9-49.5c3.4-11.3 13.8-19.1 25.6-19.1s22.2 7.7 25.6 19.1l11.6 38.6c7.4-6.2 16.8-9.7 26.8-9.7c15.9 0 30.4 9 37.5 23.2l4.4 8.8H304c8.8 0 16 7.2 16 16s-7.2 16-16 16H240c-6.1 0-11.6-3.4-14.3-8.8l-8.8-17.7c-1.7-3.4-5.1-5.5-8.8-5.5s-7.2 2.1-8.8 5.5l-8.8 17.7c-2.9 5.9-9.2 9.4-15.7 8.8s-12.1-5.1-13.9-11.3L144 349l-9.8 32.8z"]
            }, ZA = {
              prefix: "fas",
              iconName: "fish-fins",
              icon: [576, 512, [], "e4f2", "M275.2 38.4c-10.6-8-25-8.5-36.3-1.5S222 57.3 224.6 70.3l9.7 48.6c-19.4 9-36.9 19.9-52.4 31.5c-15.3 11.5-29 23.9-40.7 36.3L48.1 132.4c-12.5-7.3-28.4-5.3-38.7 4.9S-3 163.3 4.2 175.9L50 256 4.2 336.1c-7.2 12.6-5 28.4 5.3 38.6s26.1 12.2 38.7 4.9l93.1-54.3c11.8 12.3 25.4 24.8 40.7 36.3c15.5 11.6 33 22.5 52.4 31.5l-9.7 48.6c-2.6 13 3.1 26.3 14.3 33.3s25.6 6.5 36.3-1.5l77.6-58.2c54.9-4 101.5-27 137.2-53.8c39.2-29.4 67.2-64.7 81.6-89.5c5.8-9.9 5.8-22.2 0-32.1c-14.4-24.8-42.5-60.1-81.6-89.5c-35.8-26.8-82.3-49.8-137.2-53.8L275.2 38.4zM384 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, Xu = {
              prefix: "fas",
              iconName: "building-flag",
              icon: [640, 512, [], "e4d5", "M48 0C21.5 0 0 21.5 0 48V464c0 26.5 21.5 48 48 48h96V432c0-26.5 21.5-48 48-48s48 21.5 48 48v80h96c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48H48zM64 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V240zm112-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V240zM80 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V112zM272 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zM448 0c-17.7 0-32 14.3-32 32V512h64V192H624c8.8 0 16-7.2 16-16V48c0-8.8-7.2-16-16-16H480c0-17.7-14.3-32-32-32z"]
            }, v6 = {
              prefix: "fas",
              iconName: "face-grin-beam",
              icon: [512, 512, [128516, "grin-beam"], "f582", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zm-170.5-84l0 0 0 0-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2 0 0 0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8l0 0 0 0zm160 0l0 0-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2 0 0 0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8l0 0 0 0 0 0z"]
            }, Xj = v6, hX = {
              prefix: "fas",
              iconName: "object-ungroup",
              icon: [640, 512, [], "f248", "M32 119.4C12.9 108.4 0 87.7 0 64C0 28.7 28.7 0 64 0c23.7 0 44.4 12.9 55.4 32H328.6C339.6 12.9 360.3 0 384 0c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4V232.6c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H119.4c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V119.4zM119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4V232.6c9.7 5.6 17.8 13.7 23.4 23.4H328.6c5.6-9.7 13.7-17.8 23.4-23.4V119.4c-9.7-5.6-17.8-13.7-23.4-23.4H119.4zm192 384c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V352h64v40.6c9.7 5.6 17.8 13.7 23.4 23.4H520.6c5.6-9.7 13.7-17.8 23.4-23.4V279.4c-9.7-5.6-17.8-13.7-23.4-23.4h-46c-5.4-15.4-14.6-28.9-26.5-39.6V192h72.6c11.1-19.1 31.7-32 55.4-32c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4V392.6c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H311.4z"]
            }, wh = {
              prefix: "fas",
              iconName: "poop",
              icon: [512, 512, [], "f619", "M254.4 6.6c3.5-4.3 9-6.5 14.5-5.7C315.8 7.2 352 47.4 352 96c0 11.2-1.9 22-5.5 32H352c35.3 0 64 28.7 64 64c0 19.1-8.4 36.3-21.7 48H408c39.8 0 72 32.2 72 72c0 23.2-11 43.8-28 57c34.1 5.7 60 35.3 60 71c0 39.8-32.2 72-72 72H72c-39.8 0-72-32.2-72-72c0-35.7 25.9-65.3 60-71c-17-13.2-28-33.8-28-57c0-39.8 32.2-72 72-72h13.7C104.4 228.3 96 211.1 96 192c0-35.3 28.7-64 64-64h16.2c44.1-.1 79.8-35.9 79.8-80c0-9.2-1.5-17.9-4.3-26.1c-1.8-5.2-.8-11.1 2.8-15.4z"]
            }, IP = {
              prefix: "fas",
              iconName: "location-pin",
              icon: [384, 512, ["map-marker"], "f041", "M384 192c0 87.4-117 243-168.3 307.2c-12.3 15.3-35.1 15.3-47.4 0C117 435 0 279.4 0 192C0 86 86 0 192 0S384 86 384 192z"]
            }, M6 = IP, tT = {
              prefix: "fas",
              iconName: "kaaba",
              icon: [576, 512, [128331], "f66b", "M60 120l228 71.2L516 120 288 48.8 60 120zM278.5 1.5c6.2-1.9 12.9-1.9 19.1 0l256 80C566.9 85.6 576 98 576 112v16 0 21.2L292.8 237.7c-3.1 1-6.4 1-9.5 0L0 149.2V128 112C0 98 9.1 85.6 22.5 81.5l256-80zm23.9 266.8L576 182.8v46.5l-52.8 16.5c-8.4 2.6-13.1 11.6-10.5 20s11.6 13.1 20 10.5L576 262.8V400c0 14-9.1 26.4-22.5 30.5l-256 80c-6.2 1.9-12.9 1.9-19.1 0l-256-80C9.1 426.4 0 414 0 400V262.8l43.2 13.5c8.4 2.6 17.4-2.1 20-10.5s-2.1-17.4-10.5-20L0 229.2V182.8l273.7 85.5c9.3 2.9 19.3 2.9 28.6 0zm-185.5-2.6c-8.4-2.6-17.4 2.1-20 10.5s2.1 17.4 10.5 20l64 20c8.4 2.6 17.4-2.1 20-10.5s-2.1-17.4-10.5-20l-64-20zm352 30.5c8.4-2.6 13.1-11.6 10.5-20s-11.6-13.1-20-10.5l-64 20c-8.4 2.6-13.1 11.6-10.5 20s11.6 13.1 20 10.5l64-20zm-224 9.5c-8.4-2.6-17.4 2.1-20 10.5s2.1 17.4 10.5 20l38.5 12c9.3 2.9 19.3 2.9 28.6 0l38.5-12c8.4-2.6 13.1-11.6 10.5-20s-11.6-13.1-20-10.5l-38.5 12c-3.1 1-6.4 1-9.5 0l-38.5-12z"]
            }, RP = {
              prefix: "fas",
              iconName: "toilet-paper",
              icon: [640, 512, [129531], "f71e", "M444.2 0C397.2 49.6 384 126.5 384 192c0 158.8-27.3 247-42.7 283.9c-10 24-33.2 36.1-55.4 36.1H48c-11.5 0-22.2-6.2-27.8-16.2s-5.6-22.3 .4-32.2c9.8-17.7 15.4-38.2 20.5-57.7C52.3 362.8 64 293.5 64 192C64 86 107 0 160 0H444.2zM512 384c-53 0-96-86-96-192S459 0 512 0s96 86 96 192s-43 192-96 192zm0-128c17.7 0 32-28.7 32-64s-14.3-64-32-64s-32 28.7-32 64s14.3 64 32 64zM144 208a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm64 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm80-16a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
            }, mh = {
              prefix: "fas",
              iconName: "helmet-safety",
              icon: [576, 512, ["hard-hat", "hat-hard"], "f807", "M256 32c-17.7 0-32 14.3-32 32v2.3 99.6c0 5.6-4.5 10.1-10.1 10.1c-3.6 0-7-1.9-8.8-5.1L157.1 87C83 123.5 32 199.8 32 288v64H544l0-66.4c-.9-87.2-51.7-162.4-125.1-198.6l-48 83.9c-1.8 3.2-5.2 5.1-8.8 5.1c-5.6 0-10.1-4.5-10.1-10.1V66.3 64c0-17.7-14.3-32-32-32H256zM16.6 384C7.4 384 0 391.4 0 400.6c0 4.7 2 9.2 5.8 11.9C27.5 428.4 111.8 480 288 480s260.5-51.6 282.2-67.5c3.8-2.8 5.8-7.2 5.8-11.9c0-9.2-7.4-16.6-16.6-16.6H16.6z"]
            }, Y7 = mh, M7 = mh, U3 = {
              prefix: "fas",
              iconName: "eject",
              icon: [448, 512, [9167], "f052", "M224 32c13.5 0 26.3 5.6 35.4 15.6l176 192c12.9 14 16.2 34.3 8.6 51.8S419 320 400 320H48c-19 0-36.3-11.2-43.9-28.7s-4.3-37.7 8.6-51.8l176-192C197.7 37.6 210.5 32 224 32zM0 432c0-26.5 21.5-48 48-48H400c26.5 0 48 21.5 48 48s-21.5 48-48 48H48c-26.5 0-48-21.5-48-48z"]
            }, L6 = {
              prefix: "fas",
              iconName: "circle-right",
              icon: [512, 512, [61838, "arrow-alt-circle-right"], "f35a", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM294.6 135.1l99.9 107.1c3.5 3.8 5.5 8.7 5.5 13.8s-2 10.1-5.5 13.8L294.6 376.9c-4.2 4.5-10.1 7.1-16.3 7.1C266 384 256 374 256 361.7l0-57.7-96 0c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32l96 0 0-57.7c0-12.3 10-22.3 22.3-22.3c6.2 0 12.1 2.6 16.3 7.1z"]
            }, Bh = L6, hl = {
              prefix: "fas",
              iconName: "plane-circle-check",
              icon: [640, 512, [], "e555", "M256 0c-35 0-64 59.5-64 93.7v84.6L8.1 283.4c-5 2.8-8.1 8.2-8.1 13.9v65.5c0 10.6 10.2 18.3 20.4 15.4l171.6-49 0 70.9-57.6 43.2c-4 3-6.4 7.8-6.4 12.8v42c0 7.8 6.3 14 14 14c1.3 0 2.6-.2 3.9-.5L256 480l110.1 31.5c1.3 .4 2.6 .5 3.9 .5c6 0 11.1-3.7 13.1-9C344.5 470.7 320 422.2 320 368c0-60.6 30.6-114 77.1-145.6L320 178.3V93.7C320 59.5 292 0 256 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
            }, jd = {
              prefix: "fas",
              iconName: "face-rolling-eyes",
              icon: [512, 512, [128580, "meh-rolling-eyes"], "f5a5", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 368H320c8.8 0 16 7.2 16 16s-7.2 16-16 16H192c-8.8 0-16-7.2-16-16s7.2-16 16-16zm32-144c0 35.3-28.7 64-64 64s-64-28.7-64-64c0-26 15.5-48.4 37.8-58.4c-3.7 5.2-5.8 11.6-5.8 18.4c0 17.7 14.3 32 32 32s32-14.3 32-32c0-6.9-2.2-13.2-5.8-18.4C208.5 175.6 224 198 224 224zm128 64c-35.3 0-64-28.7-64-64c0-26 15.5-48.4 37.8-58.4c-3.7 5.2-5.8 11.6-5.8 18.4c0 17.7 14.3 32 32 32s32-14.3 32-32c0-6.9-2.2-13.2-5.8-18.4C400.5 175.6 416 198 416 224c0 35.3-28.7 64-64 64z"]
            }, VP = jd, xo = {
              prefix: "fas",
              iconName: "object-group",
              icon: [576, 512, [], "f247", "M32 119.4C12.9 108.4 0 87.7 0 64C0 28.7 28.7 0 64 0c23.7 0 44.4 12.9 55.4 32H456.6C467.6 12.9 488.3 0 512 0c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4V392.6c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H119.4c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V119.4zM456.6 96H119.4c-5.6 9.7-13.7 17.8-23.4 23.4V392.6c9.7 5.6 17.8 13.7 23.4 23.4H456.6c5.6-9.7 13.7-17.8 23.4-23.4V119.4c-9.7-5.6-17.8-13.7-23.4-23.4zM128 160c0-17.7 14.3-32 32-32H288c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H160c-17.7 0-32-14.3-32-32V160zM256 320h32c35.3 0 64-28.7 64-64V224h64c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H288c-17.7 0-32-14.3-32-32V320z"]
            }, Rf = {
              prefix: "fas",
              iconName: "chart-line",
              icon: [512, 512, ["line-chart"], "f201", "M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V400c0 44.2 35.8 80 80 80H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H80c-8.8 0-16-7.2-16-16V64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7l-57.4-57.4c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L240 221.3l57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z"]
            }, HX = Rf, gA = {
              prefix: "fas",
              iconName: "mask-ventilator",
              icon: [640, 512, [], "e524", "M159.1 176C139.4 219.2 128 264.7 128 300.8c0 15.9 2.2 31.4 6.3 46l-31.8-7.9C70.5 330.9 48 302.1 48 269V184c0-4.4 3.6-8 8-8H159.1zm26-48H56c-30.9 0-56 25.1-56 56v85c0 55.1 37.5 103.1 90.9 116.4l71.3 17.8c22.7 30.5 55.4 54.1 93.8 66.6V393.3c-19.7-16.4-32-40.3-32-66.9c0-49.5 43-134.4 96-134.4c52.5 0 96 84.9 96 134.4c0 26.7-12.4 50.4-32 66.8v76.6c38-12.6 70.6-36 93.5-66.4l71.6-17.9C602.5 372.1 640 324.1 640 269V184c0-30.9-25.1-56-56-56H454.5C419.7 73.8 372.1 32 320 32c-52.6 0-100.2 41.8-134.9 96zm295.6 48H584c4.4 0 8 3.6 8 8v85c0 33-22.5 61.8-54.5 69.9l-31.8 8c4.2-14.7 6.4-30.1 6.4-46.1c0-36.1-11.6-81.6-31.3-124.8zM288 320V512h64V320c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
            }, gv = {
              prefix: "fas",
              iconName: "arrow-right",
              icon: [448, 512, [8594], "f061", "M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]
            }, K6 = {
              prefix: "fas",
              iconName: "signs-post",
              icon: [512, 512, ["map-signs"], "f277", "M224 32H64C46.3 32 32 46.3 32 64v64c0 17.7 14.3 32 32 32H441.4c4.2 0 8.3-1.7 11.3-4.7l48-48c6.2-6.2 6.2-16.4 0-22.6l-48-48c-3-3-7.1-4.7-11.3-4.7H288c0-17.7-14.3-32-32-32s-32 14.3-32 32zM480 256c0-17.7-14.3-32-32-32H288V192H224v32H70.6c-4.2 0-8.3 1.7-11.3 4.7l-48 48c-6.2 6.2-6.2 16.4 0 22.6l48 48c3 3 7.1 4.7 11.3 4.7H448c17.7 0 32-14.3 32-32V256zM288 480V384H224v96c0 17.7 14.3 32 32 32s32-14.3 32-32z"]
            }, L7 = K6, CP = {
              prefix: "fas",
              iconName: "cash-register",
              icon: [512, 512, [], "f788", "M64 0C46.3 0 32 14.3 32 32V96c0 17.7 14.3 32 32 32h80v32H87c-31.6 0-58.5 23.1-63.3 54.4L1.1 364.1C.4 368.8 0 373.6 0 378.4V448c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V378.4c0-4.8-.4-9.6-1.1-14.4L488.2 214.4C483.5 183.1 456.6 160 425 160H208V128h80c17.7 0 32-14.3 32-32V32c0-17.7-14.3-32-32-32H64zM96 48H256c8.8 0 16 7.2 16 16s-7.2 16-16 16H96c-8.8 0-16-7.2-16-16s7.2-16 16-16zM64 432c0-8.8 7.2-16 16-16H432c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16zm48-168a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm120-24a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM160 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM328 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM256 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM424 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM352 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48z"]
            }, gX = {
              prefix: "fas",
              iconName: "person-circle-question",
              icon: [576, 512, [], "e542", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V256.9L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6h29.7c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H152zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM368 321.6V328c0 8.8 7.2 16 16 16s16-7.2 16-16v-6.4c0-5.3 4.3-9.6 9.6-9.6h40.5c7.7 0 13.9 6.2 13.9 13.9c0 5.2-2.9 9.9-7.4 12.3l-32 16.8c-5.3 2.8-8.6 8.2-8.6 14.2V384c0 8.8 7.2 16 16 16s16-7.2 16-16v-5.1l23.5-12.3c15.1-7.9 24.5-23.6 24.5-40.6c0-25.4-20.6-45.9-45.9-45.9H409.6c-23 0-41.6 18.6-41.6 41.6z"]
            }, Wh = {
              prefix: "fas",
              iconName: "h",
              icon: [384, 512, [104], "48", "M320 256l0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V192L64 192 64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192 256 0z"]
            }, XX = {
              prefix: "fas",
              iconName: "tarp",
              icon: [576, 512, [], "e57b", "M576 128c0-35.3-28.7-64-64-64H64C28.7 64 0 92.7 0 128V384c0 35.3 28.7 64 64 64l352 0 0-128c0-17.7 14.3-32 32-32H576V128zM448 448L576 320H448l0 128zM96 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, Xv = {
              prefix: "fas",
              iconName: "screwdriver-wrench",
              icon: [512, 512, ["tools"], "f7d9", "M78.6 5C69.1-2.4 55.6-1.5 47 7L7 47c-8.5 8.5-9.4 22-2.1 31.6l80 104c4.5 5.9 11.6 9.4 19 9.4h54.1l109 109c-14.7 29-10 65.4 14.3 89.6l112 112c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-112-112c-24.2-24.2-60.6-29-89.6-14.3l-109-109V104c0-7.5-3.5-14.5-9.4-19L78.6 5zM19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L233.7 374.3c-7.8-20.9-9-43.6-3.6-65.1l-61.7-61.7L19.9 396.1zM512 144c0-10.5-1.1-20.7-3.2-30.5c-2.4-11.2-16.1-14.1-24.2-6l-63.9 63.9c-3 3-7.1 4.7-11.3 4.7H352c-8.8 0-16-7.2-16-16V102.6c0-4.2 1.7-8.3 4.7-11.3l63.9-63.9c8.1-8.1 5.2-21.8-6-24.2C388.7 1.1 378.5 0 368 0C288.5 0 224 64.5 224 144l0 .8 85.3 85.3c36-9.1 75.8 .5 104 28.7L429 274.5c49-23 83-72.8 83-130.5zM56 432a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
            }, K7 = Xv, hb = {
              prefix: "fas",
              iconName: "arrows-to-eye",
              icon: [640, 512, [], "e4bf", "M15 15C24.4 5.7 39.6 5.7 49 15l63 63V40c0-13.3 10.7-24 24-24s24 10.7 24 24v96c0 13.3-10.7 24-24 24H40c-13.3 0-24-10.7-24-24s10.7-24 24-24H78.1L15 49C5.7 39.6 5.7 24.4 15 15zM133.5 243.9C158.6 193.6 222.7 112 320 112s161.4 81.6 186.5 131.9c3.8 7.6 3.8 16.5 0 24.2C481.4 318.4 417.3 400 320 400s-161.4-81.6-186.5-131.9c-3.8-7.6-3.8-16.5 0-24.2zM320 320a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM591 15c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-63 63H600c13.3 0 24 10.7 24 24s-10.7 24-24 24H504c-13.3 0-24-10.7-24-24V40c0-13.3 10.7-24 24-24s24 10.7 24 24V78.1l63-63zM15 497c-9.4-9.4-9.4-24.6 0-33.9l63-63H40c-13.3 0-24-10.7-24-24s10.7-24 24-24h96c13.3 0 24 10.7 24 24v96c0 13.3-10.7 24-24 24s-24-10.7-24-24V433.9L49 497c-9.4 9.4-24.6 9.4-33.9 0zm576 0l-63-63V472c0 13.3-10.7 24-24 24s-24-10.7-24-24V376c0-13.3 10.7-24 24-24h96c13.3 0 24 10.7 24 24s-10.7 24-24 24H561.9l63 63c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0z"]
            }, Hb = {
              prefix: "fas",
              iconName: "plug-circle-bolt",
              icon: [576, 512, [], "e55b", "M96 0C78.3 0 64 14.3 64 32v96h64V32c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32v96h64V32c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32v32c0 77.4 55 142 128 156.8V480c0 17.7 14.3 32 32 32s32-14.3 32-32V412.8c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32H32zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm47.9-225c4.3 3.7 5.4 9.9 2.6 14.9L452.4 356H488c5.2 0 9.8 3.3 11.4 8.2s-.1 10.3-4.2 13.4l-96 72c-4.5 3.4-10.8 3.2-15.1-.6s-5.4-9.9-2.6-14.9L411.6 380H376c-5.2 0-9.8-3.3-11.4-8.2s.1-10.3 4.2-13.4l96-72c4.5-3.4 10.8-3.2 15.1 .6z"]
            }, Tj = {
              prefix: "fas",
              iconName: "heart",
              icon: [512, 512, [128153, 128154, 128155, 128156, 128420, 129293, 129294, 129505, 9829, 10084, 61578], "f004", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"]
            }, OP = {
              prefix: "fas",
              iconName: "mars-and-venus",
              icon: [512, 512, [9893], "f224", "M337.8 14.8C341.5 5.8 350.3 0 360 0H472c13.3 0 24 10.7 24 24V136c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-24.7 24.7C407 163.3 416 192.6 416 224c0 80.2-59.1 146.7-136.1 158.2c0 .6 .1 1.2 .1 1.8v.4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .3 .4 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3 .3h24c13.3 0 24 10.7 24 24s-10.7 24-24 24H280v.2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l-24 0-24 0v0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1V486 486v-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1V485 485v-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1V484v-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1V483v-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1V481v-.1-.1-.1-.1-.1-.1-.1-.1V480v-.1-.1-.1-.1-.1-.1-.1V479v-.1-.1-.1-.1-.1-.1-.1V478v-.1-.1-.1-.1-.1-.1V477v-.1-.1-.1-.1-.1-.1V476v-.1-.1-.1-.1-.1-.1V475v-.1-.2-.2-.2-.2-.2V474v-.2-.2-.2-.2-.2V473v-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2V470v-.2-.2-.2-.2-.2V469v-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2V467v-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2V463v-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2-.2V459v-.2-.2-.2-.2-.2-.2-.2-.2V457v-.2-.2-.2-.2V456H208c-13.3 0-24-10.7-24-24s10.7-24 24-24h24v-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3V403v-.3-.3V402v-.3-.3V401v-.3-.3V400v-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.3-.4-.3-.4-.4-.4-.4V393v-.4-.4-.4-.4-.4-.4-.4-.4-.4-.4-.4-.4-.4V388v-.4-.4-.4-.4-.4-.4-.4-.4-.4-.4V384c0-.6 0-1.2 .1-1.8C155.1 370.7 96 304.2 96 224c0-88.4 71.6-160 160-160c39.6 0 75.9 14.4 103.8 38.2L382.1 80 343 41c-6.9-6.9-8.9-17.2-5.2-26.2zM448 48l0 0h0v0zM256 488h24c0 13.3-10.7 24-24 24s-24-10.7-24-24h24zm96-264a96 96 0 1 0 -192 0 96 96 0 1 0 192 0z"]
            }, F1 = {
              prefix: "fas",
              iconName: "house-user",
              icon: [576, 512, ["home-user"], "e1b0", "M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c.2 35.5-28.5 64.3-64 64.3H128.1c-35.3 0-64-28.7-64-64V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24zM352 224a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zm-96 96c-44.2 0-80 35.8-80 80c0 8.8 7.2 16 16 16H384c8.8 0 16-7.2 16-16c0-44.2-35.8-80-80-80H256z"]
            }, qj = F1, yP = {
              prefix: "fas",
              iconName: "dumpster-fire",
              icon: [640, 512, [], "f794", "M49.7 32c-10.5 0-19.8 6.9-22.9 16.9L.9 133c-.6 2-.9 4.1-.9 6.1C0 150.7 9.3 160 20.9 160h94L140.5 32H49.7zM272 160V32H173.1L147.5 160H272zm32 0h58c15.1-18.1 32.1-35.7 50.5-52.1c1.5-1.4 3.2-2.6 4.8-3.8L402.9 32H304V160zm209.9-23.7c17.4-15.8 43.9-16.2 61.7-1.2c-.1-.7-.3-1.4-.5-2.1L549.2 48.9C546.1 38.9 536.8 32 526.3 32H435.5l12.8 64.2c9.6 1 19 4.9 26.6 11.8c11.7 10.6 23 21.6 33.9 33.1c1.6-1.6 3.3-3.2 5-4.8zM325.2 210.7c3.8-6.2 7.9-12.5 12.3-18.7H32l4 32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H44L64 448c0 17.7 14.3 32 32 32s32-14.3 32-32H337.6c-31-34.7-49.6-80.6-49.6-129.9c0-35.2 16.3-73.6 37.2-107.4zm128.4-78.9c-2.8-2.5-6.3-3.7-9.8-3.8c-3.6 0-7.2 1.2-10 3.7c-33.2 29.7-61.4 63.4-81.4 95.8c-19.7 31.9-32.4 66.2-32.4 92.6C320 407.9 390.3 480 480 480c88.7 0 160-72 160-159.8c0-20.2-9.6-50.9-24.2-79c-14.8-28.5-35.7-58.5-60.4-81.1c-5.6-5.1-14.4-5.2-20 0c-9.6 8.8-18.6 19.6-26.5 29.5c-17.3-20.7-35.8-39.9-55.5-57.7zM530 401c-15 10-31 15-49 15c-45 0-81-29-81-78c0-24 15-45 45-82c4 5 62 79 62 79l36-42c3 4 5 8 7 12c18 33 10 75-20 96z"]
            }, Sh = {
              prefix: "fas",
              iconName: "house-crack",
              icon: [576, 512, [], "e3b1", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1h32V448c0 35.3 28.7 64 64 64H230.4l-31.3-52.2c-4.1-6.8-2.6-15.5 3.5-20.5L288 368l-60.2-82.8c-10.9-15 8.2-33.5 22.8-22l117.9 92.6c8 6.3 8.2 18.4 .4 24.9L288 448l38.4 64H448.5c35.5 0 64.2-28.8 64-64.3l-.7-160.2h32z"]
            }, Tv = {
              prefix: "fas",
              iconName: "martini-glass-citrus",
              icon: [576, 512, ["cocktail"], "f561", "M432 240c53 0 96-43 96-96s-43-96-96-96c-35.5 0-66.6 19.3-83.2 48H296.2C316 40.1 369.3 0 432 0c79.5 0 144 64.5 144 144s-64.5 144-144 144c-27.7 0-53.5-7.8-75.5-21.3l35.4-35.4c12.2 5.6 25.8 8.7 40.1 8.7zM1.8 142.8C5.5 133.8 14.3 128 24 128H392c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-177 177V464h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H208 120c-13.3 0-24-10.7-24-24s10.7-24 24-24h64V345.9L7 169c-6.9-6.9-8.9-17.2-5.2-26.2z"]
            }, J7 = Tv, z7 = {
              prefix: "fas",
              iconName: "face-surprise",
              icon: [512, 512, [128558, "surprise"], "f5c2", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM256 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
            }, TX = z7, gb = {
              prefix: "fas",
              iconName: "bottle-water",
              icon: [320, 512, [], "e4c5", "M120 0h80c13.3 0 24 10.7 24 24V64H96V24c0-13.3 10.7-24 24-24zM32 151.7c0-15.6 9-29.8 23.2-36.5l24.4-11.4c11-5.1 23-7.8 35.1-7.8h90.6c12.1 0 24.1 2.7 35.1 7.8l24.4 11.4c14.1 6.6 23.2 20.8 23.2 36.5c0 14.4-7.5 27-18.9 34.1c11.5 8.8 18.9 22.6 18.9 38.2c0 16.7-8.5 31.4-21.5 40c12.9 8.6 21.5 23.3 21.5 40s-8.5 31.4-21.5 40c12.9 8.6 21.5 23.3 21.5 40s-8.5 31.4-21.5 40c12.9 8.6 21.5 23.3 21.5 40c0 26.5-21.5 48-48 48H80c-26.5 0-48-21.5-48-48c0-16.7 8.5-31.4 21.5-40C40.5 415.4 32 400.7 32 384s8.5-31.4 21.5-40C40.5 335.4 32 320.7 32 304s8.5-31.4 21.5-40C40.5 255.4 32 240.7 32 224c0-15.6 7.4-29.4 18.9-38.2C39.5 178.7 32 166.1 32 151.7zM96 240c0 8.8 7.2 16 16 16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H112c-8.8 0-16 7.2-16 16zm16 112c-8.8 0-16 7.2-16 16s7.2 16 16 16h96c8.8 0 16-7.2 16-16s-7.2-16-16-16H112z"]
            }, rT = {
              prefix: "fas",
              iconName: "circle-pause",
              icon: [512, 512, [62092, "pause-circle"], "f28b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM224 192V320c0 17.7-14.3 32-32 32s-32-14.3-32-32V192c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0V320c0 17.7-14.3 32-32 32s-32-14.3-32-32V192c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
            }, XA = rT, wd = {
              prefix: "fas",
              iconName: "toilet-paper-slash",
              icon: [640, 512, [], "e072", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-109.7-86C569.9 374 608 291.9 608 192C608 86 565 0 512 0s-96 86-96 192c0 49.1 9.2 93.9 24.4 127.9l-59-46.2c1.6-24.8 2.6-52 2.6-81.6c0-65.5 13.2-142.4 60.2-192H160c-24.8 0-47.4 18.8-64.4 49.6L38.8 5.1zM367.3 385.4L66.5 148.4C64.9 162.4 64 177 64 192c0 101.5-11.7 170.8-23 213.9c-5.1 19.4-10.7 39.9-20.5 57.7c-5.9 9.9-6.1 22.1-.4 32.2S36.5 512 48 512H285.9c22.3 0 45.4-12.1 55.4-36.1c7.4-17.7 17.5-47.2 26-90.6zM544 192c0 35.3-14.3 64-32 64s-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64z"]
            }, I3 = {
              prefix: "fas",
              iconName: "apple-whole",
              icon: [448, 512, [127822, 127823, "apple-alt"], "f5d1", "M224 112c-8.8 0-16-7.2-16-16V80c0-44.2 35.8-80 80-80h16c8.8 0 16 7.2 16 16V32c0 44.2-35.8 80-80 80H224zM0 288c0-76.3 35.7-160 112-160c27.3 0 59.7 10.3 82.7 19.3c18.8 7.3 39.9 7.3 58.7 0c22.9-8.9 55.4-19.3 82.7-19.3c76.3 0 112 83.7 112 160c0 128-80 224-160 224c-16.5 0-38.1-6.6-51.5-11.3c-8.1-2.8-16.9-2.8-25 0c-13.4 4.7-35 11.3-51.5 11.3C80 512 0 416 0 288z"]
            }, nT = I3, R3 = {
              prefix: "fas",
              iconName: "kitchen-set",
              icon: [576, 512, [], "e51a", "M240 144A96 96 0 1 0 48 144a96 96 0 1 0 192 0zm44.4 32C269.9 240.1 212.5 288 144 288C64.5 288 0 223.5 0 144S64.5 0 144 0c68.5 0 125.9 47.9 140.4 112h71.8c8.8-9.8 21.6-16 35.8-16H496c26.5 0 48 21.5 48 48s-21.5 48-48 48H392c-14.2 0-27-6.2-35.8-16H284.4zM144 80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM400 240c13.3 0 24 10.7 24 24v8h96c13.3 0 24 10.7 24 24s-10.7 24-24 24H280c-13.3 0-24-10.7-24-24s10.7-24 24-24h96v-8c0-13.3 10.7-24 24-24zM288 464V352H512V464c0 26.5-21.5 48-48 48H336c-26.5 0-48-21.5-48-48zM48 320h80 16 32c26.5 0 48 21.5 48 48s-21.5 48-48 48H160c0 17.7-14.3 32-32 32H64c-17.7 0-32-14.3-32-32V336c0-8.8 7.2-16 16-16zm128 64c8.8 0 16-7.2 16-16s-7.2-16-16-16H160v32h16zM24 464H200c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
            }, qv = {
              prefix: "fas",
              iconName: "r",
              icon: [320, 512, [114], "52", "M64 32C28.7 32 0 60.7 0 96V288 448c0 17.7 14.3 32 32 32s32-14.3 32-32V320h95.3L261.8 466.4c10.1 14.5 30.1 18 44.6 7.9s18-30.1 7.9-44.6L230.1 309.5C282.8 288.1 320 236.4 320 176c0-79.5-64.5-144-144-144H64zM176 256H64V96H176c44.2 0 80 35.8 80 80s-35.8 80-80 80z"]
            }, J6 = {
              prefix: "fas",
              iconName: "temperature-quarter",
              icon: [320, 512, ["temperature-1", "thermometer-1", "thermometer-quarter"], "f2ca", "M160 64c-26.5 0-48 21.5-48 48V276.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5V112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112V276.5c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6V112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3V272c0-8.8 7.2-16 16-16s16 7.2 16 16v50.7c18.6 6.6 32 24.4 32 45.3z"]
            }, Hl = J6, gl = J6, Tu = J6, gB = {
              prefix: "fas",
              iconName: "cube",
              icon: [512, 512, [], "f1b2", "M234.5 5.7c13.9-5 29.1-5 43.1 0l192 68.6C495 83.4 512 107.5 512 134.6V377.4c0 27-17 51.2-42.5 60.3l-192 68.6c-13.9 5-29.1 5-43.1 0l-192-68.6C17 428.6 0 404.5 0 377.4V134.6c0-27 17-51.2 42.5-60.3l192-68.6zM256 66L82.3 128 256 190l173.7-62L256 66zm32 368.6l160-57.1v-188L288 246.6v188z"]
            }, bj = {
              prefix: "fas",
              iconName: "bitcoin-sign",
              icon: [320, 512, [], "e0b4", "M48 32C48 14.3 62.3 0 80 0s32 14.3 32 32V64h32V32c0-17.7 14.3-32 32-32s32 14.3 32 32V64c0 1.5-.1 3.1-.3 4.5C254.1 82.2 288 125.1 288 176c0 24.2-7.7 46.6-20.7 64.9c31.7 19.8 52.7 55 52.7 95.1c0 61.9-50.1 112-112 112v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448H112v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448H41.7C18.7 448 0 429.3 0 406.3V288 265.7 224 101.6C0 80.8 16.8 64 37.6 64H48V32zM64 224H176c26.5 0 48-21.5 48-48s-21.5-48-48-48H64v96zm112 64H64v96H208c26.5 0 48-21.5 48-48s-21.5-48-48-48H176z"]
            }, Xb = {
              prefix: "fas",
              iconName: "shield-dog",
              icon: [512, 512, [], "e573", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM160.9 286.2c4.8 1.2 9.9 1.8 15.1 1.8c35.3 0 64-28.7 64-64V160h44.2c12.1 0 23.2 6.8 28.6 17.7L320 192h64c8.8 0 16 7.2 16 16v32c0 44.2-35.8 80-80 80H272v50.7c0 7.3-5.9 13.3-13.3 13.3c-1.8 0-3.6-.4-5.2-1.1l-98.7-42.3c-6.6-2.8-10.8-9.3-10.8-16.4c0-2.8 .6-5.5 1.9-8l15-30zM160 160h40 8v32 32c0 17.7-14.3 32-32 32s-32-14.3-32-32V176c0-8.8 7.2-16 16-16zm128 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
            }, kP = {
              prefix: "fas",
              iconName: "solar-panel",
              icon: [640, 512, [], "f5ba", "M122.2 0C91.7 0 65.5 21.5 59.5 51.4L8.3 307.4C.4 347 30.6 384 71 384H288v64H224c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H352V384H569c40.4 0 70.7-36.9 62.8-76.6l-51.2-256C574.5 21.5 548.3 0 517.8 0H122.2zM260.9 64H379.1l10.4 104h-139L260.9 64zM202.3 168H101.4L122.2 64h90.4L202.3 168zM91.8 216H197.5L187.1 320H71L91.8 216zm153.9 0H394.3l10.4 104-169.4 0 10.4-104zm196.8 0H548.2L569 320h-116L442.5 216zm96-48H437.7L427.3 64h90.4l31.4-6.3L517.8 64l20.8 104z"]
            }, iT = {
              prefix: "fas",
              iconName: "lock-open",
              icon: [576, 512, [], "f3c1", "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80v48c0 17.7 14.3 32 32 32s32-14.3 32-32V144C576 64.5 511.5 0 432 0S288 64.5 288 144v48H64c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V256c0-35.3-28.7-64-64-64H352V144z"]
            }, qX = {
              prefix: "fas",
              iconName: "elevator",
              icon: [512, 512, [], "e16d", "M132.7 4.7l-64 64c-4.6 4.6-5.9 11.5-3.5 17.4s8.3 9.9 14.8 9.9H208c6.5 0 12.3-3.9 14.8-9.9s1.1-12.9-3.5-17.4l-64-64c-6.2-6.2-16.4-6.2-22.6 0zM64 128c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64H64zm96 96a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM80 400c0-26.5 21.5-48 48-48h64c26.5 0 48 21.5 48 48v16c0 17.7-14.3 32-32 32H112c-17.7 0-32-14.3-32-32V400zm192 0c0-26.5 21.5-48 48-48h64c26.5 0 48 21.5 48 48v16c0 17.7-14.3 32-32 32H304c-17.7 0-32-14.3-32-32V400zm32-128a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM356.7 91.3c6.2 6.2 16.4 6.2 22.6 0l64-64c4.6-4.6 5.9-11.5 3.5-17.4S438.5 0 432 0H304c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4l64 64z"]
            }, G7 = {
              prefix: "fas",
              iconName: "money-bill-transfer",
              icon: [640, 512, [], "e528", "M535 41c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l64 64c4.5 4.5 7 10.6 7 17s-2.5 12.5-7 17l-64 64c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l23-23L384 112c-13.3 0-24-10.7-24-24s10.7-24 24-24l174.1 0L535 41zM105 377l-23 23L256 400c13.3 0 24 10.7 24 24s-10.7 24-24 24L81.9 448l23 23c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L7 441c-4.5-4.5-7-10.6-7-17s2.5-12.5 7-17l64-64c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM96 64H337.9c-3.7 7.2-5.9 15.3-5.9 24c0 28.7 23.3 52 52 52l117.4 0c-4 17 .6 35.5 13.8 48.8c20.3 20.3 53.2 20.3 73.5 0L608 169.5V384c0 35.3-28.7 64-64 64H302.1c3.7-7.2 5.9-15.3 5.9-24c0-28.7-23.3-52-52-52l-117.4 0c4-17-.6-35.5-13.8-48.8c-20.3-20.3-53.2-20.3-73.5 0L32 342.5V128c0-35.3 28.7-64 64-64zm64 64H96v64c35.3 0 64-28.7 64-64zM544 320c-35.3 0-64 28.7-64 64h64V320zM320 352a96 96 0 1 0 0-192 96 96 0 1 0 0 192z"]
            }, xj = {
              prefix: "fas",
              iconName: "money-bill-trend-up",
              icon: [512, 512, [], "e529", "M470.7 9.4c3 3.1 5.3 6.6 6.9 10.3s2.4 7.8 2.4 12.2l0 .1v0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32V109.3L310.6 214.6c-11.8 11.8-30.8 12.6-43.5 1.7L176 138.1 84.8 216.3c-13.4 11.5-33.6 9.9-45.1-3.5s-9.9-33.6 3.5-45.1l112-96c12-10.3 29.7-10.3 41.7 0l89.5 76.7L370.7 64H352c-17.7 0-32-14.3-32-32s14.3-32 32-32h96 0c8.8 0 16.8 3.6 22.6 9.3l.1 .1zM0 304c0-26.5 21.5-48 48-48H464c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V304zM48 416v48H96c0-26.5-21.5-48-48-48zM96 304H48v48c26.5 0 48-21.5 48-48zM464 416c-26.5 0-48 21.5-48 48h48V416zM416 304c0 26.5 21.5 48 48 48V304H416zm-96 80a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
            }, Z7 = {
              prefix: "fas",
              iconName: "house-flood-water-circle-arrow-right",
              icon: [640, 512, [], "e50f", "M288 144A144 144 0 1 0 0 144a144 144 0 1 0 288 0zM140.7 76.7c6.2-6.2 16.4-6.2 22.6 0l56 56c6.2 6.2 6.2 16.4 0 22.6l-56 56c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L169.4 160H80c-8.8 0-16-7.2-16-16s7.2-16 16-16h89.4L140.7 99.3c-6.2-6.2-6.2-16.4 0-22.6zM320 144c0 57.3-27.4 108.2-69.8 140.3c11.8-3.6 23-9.4 33-16.2c22.1-15.5 51.6-15.5 73.7 0c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.4 78.1 3.4c2.1 1.7 4.2 3.3 6.5 4.9l-.3-84.4H576c13.9 0 26.1-8.9 30.4-22.1s-.4-27.6-11.6-35.8l-176-128C407.6-2 392.4-2 381.2 6.1L301 64.4c12.1 23.9 19 50.9 19 79.6zm18.5 165.9c-11.1-7.9-25.9-7.9-37 0C279 325.4 251.5 336 224 336c-26.9 0-55.3-10.8-77.4-26.1l0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C158.5 389.7 191 400 224 400c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.6 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.5-27.3-10.1-39.2-1.7l0 0C471.4 325.2 442.9 336 416 336c-27.5 0-55-10.6-77.5-26.1zm0 112c-11.1-7.9-25.9-7.9-37 0C279 437.4 251.5 448 224 448c-26.9 0-55.3-10.8-77.4-26.1l0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C158.5 501.7 191 512 224 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.6 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7l0 0C471.4 437.2 442.9 448 416 448c-27.5 0-55-10.6-77.5-26.1z"]
            }, sT = {
              prefix: "fas",
              iconName: "square-poll-horizontal",
              icon: [448, 512, ["poll-h"], "f682", "M448 96c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320zM256 160c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32zm64 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l192 0zM192 352c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32z"]
            }, Tb = sT, EP = {
              prefix: "fas",
              iconName: "circle",
              icon: [512, 512, [128308, 128309, 128992, 128993, 128994, 128995, 128996, 9679, 9898, 9899, 11044, 61708, 61915], "f111", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"]
            }, r9 = {
              prefix: "fas",
              iconName: "backward-fast",
              icon: [512, 512, [9198, "fast-backward"], "f049", "M493.6 445c-11.2 5.3-24.5 3.6-34.1-4.4L288 297.7V416c0 12.4-7.2 23.7-18.4 29s-24.5 3.6-34.1-4.4L64 297.7V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V96C0 78.3 14.3 64 32 64s32 14.3 32 32V214.3L235.5 71.4c9.5-7.9 22.8-9.7 34.1-4.4S288 83.6 288 96V214.3L459.5 71.4c9.5-7.9 22.8-9.7 34.1-4.4S512 83.6 512 96V416c0 12.4-7.2 23.7-18.4 29z"]
            }, TA = r9, md = {
              prefix: "fas",
              iconName: "recycle",
              icon: [512, 512, [9842, 9850, 9851], "f1b8", "M174.7 45.1C192.2 17 223 0 256 0s63.8 17 81.3 45.1l38.6 61.7 27-15.6c8.4-4.9 18.9-4.2 26.6 1.7s11.1 15.9 8.6 25.3l-23.4 87.4c-3.4 12.8-16.6 20.4-29.4 17l-87.4-23.4c-9.4-2.5-16.3-10.4-17.6-20s3.4-19.1 11.8-23.9l28.4-16.4L283 79c-5.8-9.3-16-15-27-15s-21.2 5.7-27 15l-17.5 28c-9.2 14.8-28.6 19.5-43.6 10.5c-15.3-9.2-20.2-29.2-10.7-44.4l17.5-28zM429.5 251.9c15-9 34.4-4.3 43.6 10.5l24.4 39.1c9.4 15.1 14.4 32.4 14.6 50.2c.3 53.1-42.7 96.4-95.8 96.4L320 448v32c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-64-64c-9.4-9.4-9.4-24.6 0-33.9l64-64c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2v32l96.2 0c17.6 0 31.9-14.4 31.8-32c0-5.9-1.7-11.7-4.8-16.7l-24.4-39.1c-9.5-15.2-4.7-35.2 10.7-44.4zm-364.6-31L36 204.2c-8.4-4.9-13.1-14.3-11.8-23.9s8.2-17.5 17.6-20l87.4-23.4c12.8-3.4 26 4.2 29.4 17L182 241.2c2.5 9.4-.9 19.3-8.6 25.3s-18.2 6.6-26.6 1.7l-26.5-15.3L68.8 335.3c-3.1 5-4.8 10.8-4.8 16.7c-.1 17.6 14.2 32 31.8 32l32.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32.2 0C42.7 448-.3 404.8 0 351.6c.1-17.8 5.1-35.1 14.6-50.2l50.3-80.5z"]
            }, V3 = {
              prefix: "fas",
              iconName: "user-astronaut",
              icon: [448, 512, [], "f4fb", "M370.7 96.1C346.1 39.5 289.7 0 224 0S101.9 39.5 77.3 96.1C60.9 97.5 48 111.2 48 128v64c0 16.8 12.9 30.5 29.3 31.9C101.9 280.5 158.3 320 224 320s122.1-39.5 146.7-96.1c16.4-1.4 29.3-15.1 29.3-31.9V128c0-16.8-12.9-30.5-29.3-31.9zM336 144v16c0 53-43 96-96 96H208c-53 0-96-43-96-96V144c0-26.5 21.5-48 48-48H288c26.5 0 48 21.5 48 48zM189.3 162.7l-6-21.2c-.9-3.3-3.9-5.5-7.3-5.5s-6.4 2.2-7.3 5.5l-6 21.2-21.2 6c-3.3 .9-5.5 3.9-5.5 7.3s2.2 6.4 5.5 7.3l21.2 6 6 21.2c.9 3.3 3.9 5.5 7.3 5.5s6.4-2.2 7.3-5.5l6-21.2 21.2-6c3.3-.9 5.5-3.9 5.5-7.3s-2.2-6.4-5.5-7.3l-21.2-6zM112.7 316.5C46.7 342.6 0 407 0 482.3C0 498.7 13.3 512 29.7 512H128V448c0-17.7 14.3-32 32-32H288c17.7 0 32 14.3 32 32v64l98.3 0c16.4 0 29.7-13.3 29.7-29.7c0-75.3-46.7-139.7-112.7-165.8C303.9 338.8 265.5 352 224 352s-79.9-13.2-111.3-35.5zM176 448c-8.8 0-16 7.2-16 16v48h32V464c0-8.8-7.2-16-16-16zm96 32a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
            }, C3 = {
              prefix: "fas",
              iconName: "plane-slash",
              icon: [640, 512, [], "e069", "M514.3 192c34.2 0 93.7 29 93.7 64c0 36-59.5 64-93.7 64H440.6L630.8 469.1c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2S28.4-3.1 38.8 5.1L238.1 161.3 197.8 20.4C194.9 10.2 202.6 0 213.2 0h56.2c11.5 0 22.1 6.2 27.8 16.1L397.7 192l116.6 0zM41.5 128.7l321 252.9L297.2 495.9c-5.7 10-16.3 16.1-27.8 16.1l-56.2 0c-10.6 0-18.3-10.2-15.4-20.4l49-171.6H144l-43.2 57.6c-3 4-7.8 6.4-12.8 6.4H46c-7.8 0-14-6.3-14-14c0-1.3 .2-2.6 .5-3.9L64 256 32.5 145.9c-.4-1.3-.5-2.6-.5-3.9c0-6.2 4-11.4 9.5-13.3z"]
            }, Dj = {
              prefix: "fas",
              iconName: "trademark",
              icon: [640, 512, [8482], "f25c", "M345.6 108.8c-8.3-11-22.7-15.5-35.7-11.2S288 114.2 288 128V384c0 17.7 14.3 32 32 32s32-14.3 32-32V224l86.4 115.2c6 8.1 15.5 12.8 25.6 12.8s19.6-4.7 25.6-12.8L576 224V384c0 17.7 14.3 32 32 32s32-14.3 32-32V128c0-13.8-8.8-26-21.9-30.4s-27.5 .1-35.7 11.2L464 266.7 345.6 108.8zM0 128c0 17.7 14.3 32 32 32H96V384c0 17.7 14.3 32 32 32s32-14.3 32-32V160h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32C14.3 96 0 110.3 0 128z"]
            }, aT = {
              prefix: "fas",
              iconName: "basketball",
              icon: [512, 512, [127936, "basketball-ball"], "f434", "M86.6 64l85.2 85.2C194.5 121.7 208 86.4 208 48c0-14.7-2-28.9-5.7-42.4C158.6 15 119 35.5 86.6 64zM64 86.6C35.5 119 15 158.6 5.6 202.3C19.1 206 33.3 208 48 208c38.4 0 73.7-13.5 101.3-36.1L64 86.6zM256 0c-7.3 0-14.6 .3-21.8 .9C238 16 240 31.8 240 48c0 47.3-17.1 90.5-45.4 124L256 233.4 425.4 64C380.2 24.2 320.9 0 256 0zM48 240c-16.2 0-32-2-47.1-5.8C.3 241.4 0 248.7 0 256c0 64.9 24.2 124.2 64 169.4L233.4 256 172 194.6C138.5 222.9 95.3 240 48 240zm463.1 37.8c.6-7.2 .9-14.5 .9-21.8c0-64.9-24.2-124.2-64-169.4L278.6 256 340 317.4c33.4-28.3 76.7-45.4 124-45.4c16.2 0 32 2 47.1 5.8zm-4.7 31.9C492.9 306 478.7 304 464 304c-38.4 0-73.7 13.5-101.3 36.1L448 425.4c28.5-32.3 49.1-71.9 58.4-115.7zM340.1 362.7C317.5 390.3 304 425.6 304 464c0 14.7 2 28.9 5.7 42.4C353.4 497 393 476.5 425.4 448l-85.2-85.2zM317.4 340L256 278.6 86.6 448c45.1 39.8 104.4 64 169.4 64c7.3 0 14.6-.3 21.8-.9C274 496 272 480.2 272 464c0-47.3 17.1-90.5 45.4-124z"]
            }, XB = aT, jj = {
              prefix: "fas",
              iconName: "satellite-dish",
              icon: [512, 512, [128225], "f7c0", "M192 32c0-17.7 14.3-32 32-32C383.1 0 512 128.9 512 288c0 17.7-14.3 32-32 32s-32-14.3-32-32C448 164.3 347.7 64 224 64c-17.7 0-32-14.3-32-32zM60.6 220.6L164.7 324.7l28.4-28.4c-.7-2.6-1.1-5.4-1.1-8.3c0-17.7 14.3-32 32-32s32 14.3 32 32s-14.3 32-32 32c-2.9 0-5.6-.4-8.3-1.1l-28.4 28.4L291.4 451.4c14.5 14.5 11.8 38.8-7.3 46.3C260.5 506.9 234.9 512 208 512C93.1 512 0 418.9 0 304c0-26.9 5.1-52.5 14.4-76.1c7.5-19 31.8-21.8 46.3-7.3zM224 96c106 0 192 86 192 192c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-70.7-57.3-128-128-128c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, oT = {
              prefix: "fas",
              iconName: "circle-up",
              icon: [512, 512, [61467, "arrow-alt-circle-up"], "f35b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM135.1 217.4l107.1-99.9c3.8-3.5 8.7-5.5 13.8-5.5s10.1 2 13.8 5.5l107.1 99.9c4.5 4.2 7.1 10.1 7.1 16.3c0 12.3-10 22.3-22.3 22.3H304v96c0 17.7-14.3 32-32 32H240c-17.7 0-32-14.3-32-32V256H150.3C138 256 128 246 128 233.7c0-6.2 2.6-12.1 7.1-16.3z"]
            }, wj = oT, qb = {
              prefix: "fas",
              iconName: "mobile-screen-button",
              icon: [384, 512, ["mobile-alt"], "f3cd", "M16 64C16 28.7 44.7 0 80 0H304c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H80c-35.3 0-64-28.7-64-64V64zM224 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM304 64H80V384H304V64z"]
            }, bX = qb, xX = {
              prefix: "fas",
              iconName: "volume-high",
              icon: [640, 512, [128266, "volume-up"], "f028", "M533.6 32.5C598.5 85.3 640 165.8 640 256s-41.5 170.8-106.4 223.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C557.5 398.2 592 331.2 592 256s-34.5-142.2-88.7-186.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM473.1 107c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C475.3 341.3 496 301.1 496 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3z"]
            }, fT = xX, DX = {
              prefix: "fas",
              iconName: "users-rays",
              icon: [640, 512, [], "e593", "M41 7C31.6-2.3 16.4-2.3 7 7S-2.3 31.6 7 41l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L41 7zM599 7L527 79c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0zM7 505c9.4 9.4 24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L7 471c-9.4 9.4-9.4 24.6 0 33.9zm592 0c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-72-72c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72zM320 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM212.1 336c-2.7 7.5-4.1 15.6-4.1 24c0 13.3 10.7 24 24 24H408c13.3 0 24-10.7 24-24c0-8.4-1.4-16.5-4.1-24c-.5-1.4-1-2.7-1.6-4c-9.4-22.3-29.8-38.9-54.3-43c-3.9-.7-7.9-1-12-1H280c-4.1 0-8.1 .3-12 1c-.8 .1-1.7 .3-2.5 .5c-24.9 5.1-45.1 23-53.4 46.5zM175.8 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-26.5 32C119.9 256 96 279.9 96 309.3c0 14.7 11.9 26.7 26.7 26.7h56.1c8-34.1 32.8-61.7 65.2-73.6c-7.5-4.1-16.2-6.4-25.3-6.4H149.3zm368 80c14.7 0 26.7-11.9 26.7-26.7c0-29.5-23.9-53.3-53.3-53.3H421.3c-9.2 0-17.8 2.3-25.3 6.4c32.4 11.9 57.2 39.5 65.2 73.6h56.1zM464 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
            }, jX = {
              prefix: "fas",
              iconName: "wallet",
              icon: [512, 512, [], "f555", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64H80c-8.8 0-16-7.2-16-16s7.2-16 16-16H448c17.7 0 32-14.3 32-32s-14.3-32-32-32H64zM416 272a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, AT = {
              prefix: "fas",
              iconName: "clipboard-check",
              icon: [384, 512, [], "f46c", "M192 0c-41.8 0-77.4 26.7-90.5 64H64C28.7 64 0 92.7 0 128V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H282.5C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
            }, dT = {
              prefix: "fas",
              iconName: "file-audio",
              icon: [384, 512, [], "f1c7", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zm2 226.3c37.1 22.4 62 63.1 62 109.7s-24.9 87.3-62 109.7c-7.6 4.6-17.4 2.1-22-5.4s-2.1-17.4 5.4-22C269.4 401.5 288 370.9 288 336s-18.6-65.5-46.5-82.3c-7.6-4.6-10-14.4-5.4-22s14.4-10 22-5.4zm-91.9 30.9c6 2.5 9.9 8.3 9.9 14.8V400c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5L113.4 376H80c-8.8 0-16-7.2-16-16V312c0-8.8 7.2-16 16-16h33.4l35.3-35.3c4.6-4.6 11.5-5.9 17.4-3.5zm51 34.9c6.6-5.9 16.7-5.3 22.6 1.3C249.8 304.6 256 319.6 256 336s-6.2 31.4-16.3 42.7c-5.9 6.6-16 7.1-22.6 1.3s-7.1-16-1.3-22.6c5.1-5.7 8.1-13.1 8.1-21.3s-3.1-15.7-8.1-21.3c-5.9-6.6-5.3-16.7 1.3-22.6z"]
            }, _7 = {
              prefix: "fas",
              iconName: "burger",
              icon: [512, 512, ["hamburger"], "f805", "M61.1 224C45 224 32 211 32 194.9c0-1.9 .2-3.7 .6-5.6C37.9 168.3 78.8 32 256 32s218.1 136.3 223.4 157.3c.5 1.9 .6 3.7 .6 5.6c0 16.1-13 29.1-29.1 29.1H61.1zM144 128a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm240 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32zM272 96a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zM16 304c0-26.5 21.5-48 48-48H448c26.5 0 48 21.5 48 48s-21.5 48-48 48H64c-26.5 0-48-21.5-48-48zm16 96c0-8.8 7.2-16 16-16H464c8.8 0 16 7.2 16 16v16c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V400z"]
            }, vT = _7, uT = {
              prefix: "fas",
              iconName: "wrench",
              icon: [512, 512, [128295], "f0ad", "M352 320c88.4 0 160-71.6 160-160c0-15.3-2.2-30.1-6.2-44.2c-3.1-10.8-16.4-13.2-24.3-5.3l-76.8 76.8c-3 3-7.1 4.7-11.3 4.7H336c-8.8 0-16-7.2-16-16V118.6c0-4.2 1.7-8.3 4.7-11.3l76.8-76.8c7.9-7.9 5.4-21.2-5.3-24.3C382.1 2.2 367.3 0 352 0C263.6 0 192 71.6 192 160c0 19.1 3.4 37.5 9.5 54.5L19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L297.5 310.5c17 6.2 35.4 9.5 54.5 9.5zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, bb = {
              prefix: "fas",
              iconName: "bugs",
              icon: [576, 512, [], "e4d0", "M164.5 107.4l33.4-73.5c5.5-12.1 .1-26.3-11.9-31.8s-26.3-.1-31.8 11.9L128 71.7 101.9 14.1C96.4 2 82.1-3.3 70.1 2.1S52.7 21.9 58.1 33.9l33.4 73.5c-10.2 7.1-18.2 17-22.9 28.6h-17l-4.1-20.7c-2.6-13-15.2-21.4-28.2-18.8S-2.1 111.7 .5 124.7l8 40C10.7 175.9 20.6 184 32 184H64v23.3l-37.8 9.5c-9.5 2.4-16.6 10.2-17.9 19.9l-8 56c-1.9 13.1 7.2 25.3 20.4 27.2s25.3-7.2 27.2-20.4l5.7-40 18.4-4.6C82.7 274.6 103.8 288 128 288s45.3-13.4 56.1-33.2l18.4 4.6 5.7 40c1.9 13.1 14 22.2 27.2 20.4s22.2-14 20.4-27.2l-8-56c-1.4-9.7-8.5-17.5-17.9-19.9L192 207.3V184h32c11.4 0 21.3-8.1 23.5-19.3l8-40c2.6-13-5.8-25.6-18.8-28.2s-25.6 5.8-28.2 18.8L204.3 136h-17c-4.7-11.6-12.7-21.5-22.9-28.6zM496 286.5l65.6-47c10.8-7.7 13.3-22.7 5.6-33.5s-22.7-13.3-33.5-5.6l-51.4 36.8 6.1-62.9c1.3-13.2-8.4-24.9-21.6-26.2s-24.9 8.4-26.2 21.6L432.8 250c-12.3 1-24.2 5.6-34.1 13.3L384 254.8l6.8-20c4.2-12.6-2.5-26.2-15-30.4s-26.2 2.5-30.4 15l-13.1 38.6c-3.7 10.8 .8 22.8 10.7 28.5l27.7 16L359 322.7 321.5 312c-9.4-2.7-19.5 .6-25.5 8.3l-34.9 44.5c-8.2 10.4-6.4 25.5 4.1 33.7s25.5 6.4 33.7-4.1l25-31.8 18.2 5.2c-.5 22.6 11 44.7 32 56.8s45.9 11 65.2-.7l13.6 13.2-15.1 37.5c-4.9 12.3 1 26.3 13.3 31.2s26.3-1 31.2-13.3L503.5 440c3.6-9.1 1.4-19.4-5.6-26.2l-28-27.1 11.6-20.1 27.7 16c9.9 5.7 22.5 3.7 30-4.9L566.2 347c8.7-10 7.8-25.1-2.2-33.9s-25.1-7.8-33.9 2.2l-13.9 15.9-14.7-8.5c1.7-12.4-.2-25-5.5-36.2z"]
            }, O3 = {
              prefix: "fas",
              iconName: "rupee-sign",
              icon: [448, 512, [8360, "rupee"], "f156", "M0 64C0 46.3 14.3 32 32 32h80c79.5 0 144 64.5 144 144c0 58.8-35.2 109.3-85.7 131.7l51.4 128.4c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8L106.3 320H64V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V288 64zM64 256h48c44.2 0 80-35.8 80-80s-35.8-80-80-80H64V256zm256.5 16.4c-.9 6 0 8.7 .4 9.8c.4 1.1 1.4 2.6 4.2 4.9c7.2 5.7 18.7 10 37.9 16.8l1.3 .5c16 5.6 38.7 13.6 55.7 28.1c9.5 8.1 17.9 18.6 23.1 32.3c5.1 13.7 6.1 28.5 3.8 44c-4.2 28.1-20.5 49.3-43.8 60.9c-22.1 11-48.1 12.5-73.2 8l-.2 0 0 0c-9.3-1.8-20.5-5.7-29.3-9c-6-2.3-12.6-4.9-17.7-6.9l0 0c-2.5-1-4.6-1.8-6.3-2.5c-16.5-6.4-24.6-25-18.2-41.4s24.9-24.6 41.4-18.2c2.6 1 5.2 2 7.9 3.1l0 0c4.8 1.9 9.8 3.9 15.4 6c8.8 3.3 15.3 5.4 18.7 6c15.7 2.8 26.7 .8 32.9-2.3c5-2.5 8-6 9.1-13c1-6.9 .2-10.5-.5-12.3c-.6-1.7-1.8-3.6-4.5-5.9c-6.9-5.8-18.2-10.4-36.9-17l-3-1.1c-15.5-5.4-37-13-53.3-25.9c-9.5-7.5-18.3-17.6-23.7-31c-5.5-13.4-6.6-28-4.4-43.2c8.4-57.1 67-78 116.9-68.9c6.9 1.3 27.3 5.8 35.4 8.4c16.9 5.2 26.3 23.2 21.1 40.1s-23.2 26.3-40.1 21.1c-4.7-1.4-22.3-5.5-27.9-6.5c-14.6-2.7-25.8-.4-32.6 3.2c-6.3 3.3-8.9 7.6-9.5 12z"]
            }, mj = O3, Bj = {
              prefix: "fas",
              iconName: "file-image",
              icon: [384, 512, [128443], "f1c5", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM64 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm152 32c5.3 0 10.2 2.6 13.2 6.9l88 128c3.4 4.9 3.7 11.3 1 16.5s-8.2 8.6-14.2 8.6H216 176 128 80c-5.8 0-11.1-3.1-13.9-8.1s-2.8-11.2 .2-16.1l48-80c2.9-4.8 8.1-7.8 13.7-7.8s10.8 2.9 13.7 7.8l12.8 21.4 48.3-70.2c3-4.3 7.9-6.9 13.2-6.9z"]
            }, Uh = {
              prefix: "fas",
              iconName: "circle-question",
              icon: [512, 512, [62108, "question-circle"], "f059", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, $7 = Uh, a1 = {
              prefix: "fas",
              iconName: "plane-departure",
              icon: [640, 512, [128747], "f5b0", "M381 114.9L186.1 41.8c-16.7-6.2-35.2-5.3-51.1 2.7L89.1 67.4C78 73 77.2 88.5 87.6 95.2l146.9 94.5L136 240 77.8 214.1c-8.7-3.9-18.8-3.7-27.3 .6L18.3 230.8c-9.3 4.7-11.8 16.8-5 24.7l73.1 85.3c6.1 7.1 15 11.2 24.3 11.2H248.4c5 0 9.9-1.2 14.3-3.4L535.6 212.2c46.5-23.3 82.5-63.3 100.8-112C645.9 75 627.2 48 600.2 48H542.8c-20.2 0-40.2 4.8-58.2 14L381 114.9zM0 480c0 17.7 14.3 32 32 32H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32z"]
            }, Ih = {
              prefix: "fas",
              iconName: "handshake-slash",
              icon: [640, 512, [], "e060", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-135-105.8c-1.1-11.3-6.3-22.3-15.3-30.7l-134.2-123-23.4 18.2-26-20.3 77.2-60.1c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L512 316.8V128h-.7l-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2l-89.7 72.6-25.8-20.3 81.8-66.2c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-35.5 23.7L38.8 5.1zM413.6 421.9L128 196.8V352h28.2l91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c.8-.8 1.5-1.7 2.2-2.6zM96 171.6L40.6 128H16c-8.8 0-16 7.2-16 16V352c0 17.7 14.3 32 32 32H64c17.7 0 32-14.3 32-32V171.6zM48 320a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM544 128V352c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V144c0-8.8-7.2-16-16-16H544zm32 208a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
            }, lT = {
              prefix: "fas",
              iconName: "book-bookmark",
              icon: [448, 512, [], "e0bb", "M0 96C0 43 43 0 96 0h96V190.7c0 13.4 15.5 20.9 26 12.5L272 160l54 43.2c10.5 8.4 26 .9 26-12.5V0h32 32c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32v64c17.7 0 32 14.3 32 32s-14.3 32-32 32H384 96c-53 0-96-43-96-96V96zM64 416c0 17.7 14.3 32 32 32H352V384H96c-17.7 0-32 14.3-32 32z"]
            }, PT = {
              prefix: "fas",
              iconName: "code-branch",
              icon: [448, 512, [], "f126", "M80 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm80-24c0 32.8-19.7 61-48 73.3v87.8c18.8-10.9 40.7-17.1 64-17.1h96c35.3 0 64-28.7 64-64v-6.7C307.7 141 288 112.8 288 80c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3V160c0 70.7-57.3 128-128 128H176c-35.3 0-64 28.7-64 64v6.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3V352 153.3C19.7 141 0 112.8 0 80C0 35.8 35.8 0 80 0s80 35.8 80 80zm232 0a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM80 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
            }, Wj = {
              prefix: "fas",
              iconName: "hat-cowboy",
              icon: [640, 512, [], "f8c0", "M320 64c14.4 0 22.3-7 30.8-14.4C360.4 41.1 370.7 32 392 32c49.3 0 84.4 152.2 97.9 221.9C447.8 272.1 390.9 288 320 288s-127.8-15.9-169.9-34.1C163.6 184.2 198.7 32 248 32c21.3 0 31.6 9.1 41.2 17.6C297.7 57 305.6 64 320 64zM111.1 270.7c47.2 24.5 117.5 49.3 209 49.3s161.8-24.8 208.9-49.3c24.8-12.9 49.8-28.3 70.1-47.7c7.9-7.9 20.2-9.2 29.6-3.3c9.5 5.9 13.5 17.9 9.9 28.5c-13.5 37.7-38.4 72.3-66.1 100.6C523.7 398.9 443.6 448 320 448s-203.6-49.1-252.5-99.2C39.8 320.4 14.9 285.8 1.4 248.1c-3.6-10.6 .4-22.6 9.9-28.5c9.5-5.9 21.7-4.5 29.6 3.3c20.4 19.4 45.3 34.8 70.1 47.7z"]
            }, Bd = {
              prefix: "fas",
              iconName: "bridge",
              icon: [576, 512, [], "e4c8", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96H72v64H0V288c53 0 96 43 96 96v64c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V384c0-53 43-96 96-96s96 43 96 96v64c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V384c0-53 43-96 96-96V160H504V96h40c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM456 96v64H376V96h80zM328 96v64H248V96h80zM200 96v64H120V96h80z"]
            }, Rh = {
              prefix: "fas",
              iconName: "phone-flip",
              icon: [512, 512, [128381, "phone-alt"], "f879", "M347.1 24.6c7.7-18.6 28-28.5 47.4-23.2l88 24C499.9 30.2 512 46 512 64c0 247.4-200.6 448-448 448c-18 0-33.8-12.1-38.6-29.5l-24-88c-5.3-19.4 4.6-39.7 23.2-47.4l96-40c16.3-6.8 35.2-2.1 46.3 11.6L207.3 368c70.4-33.3 127.4-90.3 160.7-160.7L318.7 167c-13.7-11.2-18.4-30-11.6-46.3l40-96z"]
            }, FP = Rh, eH = {
              prefix: "fas",
              iconName: "truck-front",
              icon: [512, 512, [], "e2b7", "M0 80C0 35.8 35.8 0 80 0H432c44.2 0 80 35.8 80 80V368c0 26.2-12.6 49.4-32 64v48c0 17.7-14.3 32-32 32H416c-17.7 0-32-14.3-32-32V448H128v32c0 17.7-14.3 32-32 32H64c-17.7 0-32-14.3-32-32V432C12.6 417.4 0 394.2 0 368V80zm129.9 72.2L112 224H400l-17.9-71.8C378.5 138 365.7 128 351 128H161c-14.7 0-27.5 10-31 24.2zM128 320a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, Vh = {
              prefix: "fas",
              iconName: "cat",
              icon: [576, 512, [128008], "f6be", "M320 192h17.1c22.1 38.3 63.5 64 110.9 64c11 0 21.8-1.4 32-4v4 32V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V339.2L280 448h56c17.7 0 32 14.3 32 32s-14.3 32-32 32H192c-53 0-96-43-96-96V192.5c0-16.1-12-29.8-28-31.8l-7.9-1c-17.5-2.2-30-18.2-27.8-35.7s18.2-30 35.7-27.8l7.9 1c48 6 84.1 46.8 84.1 95.3v85.3c34.4-51.7 93.2-85.8 160-85.8zm160 26.5v0c-10 3.5-20.8 5.5-32 5.5c-28.4 0-54-12.4-71.6-32h0c-3.7-4.1-7-8.5-9.9-13.2C357.3 164 352 146.6 352 128v0V32 12 10.7C352 4.8 356.7 .1 362.6 0h.2c3.3 0 6.4 1.6 8.4 4.2l0 .1L384 21.3l27.2 36.3L416 64h64l4.8-6.4L512 21.3 524.8 4.3l0-.1c2-2.6 5.1-4.2 8.4-4.2h.2C539.3 .1 544 4.8 544 10.7V12 32v96c0 17.3-4.6 33.6-12.6 47.6c-11.3 19.8-29.6 35.2-51.4 42.9zM432 128a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
            }, wX = {
              prefix: "fas",
              iconName: "anchor-circle-exclamation",
              icon: [640, 512, [], "e4ab", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80H224c-17.7 0-32 14.3-32 32s14.3 32 32 32h32V448H208c-53 0-96-43-96-96v-6.1l7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7V352c0 88.4 71.6 160 160 160h80 80c8.2 0 16.3-.6 24.2-1.8c-22.2-16.2-40.4-37.5-53-62.2H320V368 240h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H341.1zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16v80c0 8.8-7.2 16-16 16s-16-7.2-16-16V288c0-8.8 7.2-16 16-16z"]
            }, tH = {
              prefix: "fas",
              iconName: "truck-field",
              icon: [640, 512, [], "e58d", "M32 96c0-35.3 28.7-64 64-64H320c23.7 0 44.4 12.9 55.4 32h51.8c25.3 0 48.2 14.9 58.5 38l52.8 118.8c.5 1.1 .9 2.1 1.3 3.2H544c35.3 0 64 28.7 64 64v32c17.7 0 32 14.3 32 32s-14.3 32-32 32H576c0 53-43 96-96 96s-96-43-96-96H256c0 53-43 96-96 96s-96-43-96-96H32c-17.7 0-32-14.3-32-32s14.3-32 32-32V288c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32V96zM384 224h85.9l-42.7-96H384v96zM160 432a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
            }, Ch = {
              prefix: "fas",
              iconName: "route",
              icon: [512, 512, [], "f4d7", "M512 96c0 50.2-59.1 125.1-84.6 155c-3.8 4.4-9.4 6.1-14.5 5H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c53 0 96 43 96 96s-43 96-96 96H139.6c8.7-9.9 19.3-22.6 30-36.8c6.3-8.4 12.8-17.6 19-27.2H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-53 0-96-43-96-96s43-96 96-96h39.8c-21-31.5-39.8-67.7-39.8-96c0-53 43-96 96-96s96 43 96 96zM117.1 489.1c-3.8 4.3-7.2 8.1-10.1 11.3l-1.8 2-.2-.2c-6 4.6-14.6 4-20-1.8C59.8 473 0 402.5 0 352c0-53 43-96 96-96s96 43 96 96c0 30-21.1 67-43.5 97.9c-10.7 14.7-21.7 28-30.8 38.5l-.6 .7zM128 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, NP = {
              prefix: "fas",
              iconName: "clipboard-question",
              icon: [384, 512, [], "e4e3", "M192 0c-41.8 0-77.4 26.7-90.5 64H64C28.7 64 0 92.7 0 128V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H282.5C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM105.8 229.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L216 328.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V314.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H158.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM160 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, u6 = {
              prefix: "fas",
              iconName: "panorama",
              icon: [640, 512, [], "e209", "M45.6 32C20.4 32 0 52.4 0 77.6V434.4C0 459.6 20.4 480 45.6 480c5.1 0 10-.8 14.7-2.4C74.6 472.8 177.6 440 320 440s245.4 32.8 259.6 37.6c4.7 1.6 9.7 2.4 14.7 2.4c25.2 0 45.6-20.4 45.6-45.6V77.6C640 52.4 619.6 32 594.4 32c-5 0-10 .8-14.7 2.4C565.4 39.2 462.4 72 320 72S74.6 39.2 60.4 34.4C55.6 32.8 50.7 32 45.6 32zM96 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm272 0c7.9 0 15.4 3.9 19.8 10.5L512.3 353c5.4 8 5.6 18.4 .4 26.5s-14.7 12.3-24.2 10.7C442.7 382.4 385.2 376 320 376c-65.6 0-123.4 6.5-169.3 14.4c-9.8 1.7-19.7-2.9-24.7-11.5s-4.3-19.4 1.9-27.2L197.3 265c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l26.4 33.1 87-127.6c4.5-6.6 11.9-10.5 19.8-10.5z"]
            }, Oh = {
              prefix: "fas",
              iconName: "comment-medical",
              icon: [512, 512, [], "f7f5", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3 0 0 0 0 0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM224 160c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v48h48c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H288v48c0 8.8-7.2 16-16 16H240c-8.8 0-16-7.2-16-16V272H176c-8.8 0-16-7.2-16-16V224c0-8.8 7.2-16 16-16h48V160z"]
            }, rH = {
              prefix: "fas",
              iconName: "teeth-open",
              icon: [576, 512, [], "f62f", "M96 32C43 32 0 75 0 128v64c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V128c0-53-43-96-96-96H96zM224 96c26.5 0 48 21.5 48 48v56c0 13.3-10.7 24-24 24H200c-13.3 0-24-10.7-24-24V144c0-26.5 21.5-48 48-48zm80 48c0-26.5 21.5-48 48-48s48 21.5 48 48v56c0 13.3-10.7 24-24 24H328c-13.3 0-24-10.7-24-24V144zM96 128c26.5 0 48 21.5 48 48v24c0 13.3-10.7 24-24 24H72c-13.3 0-24-10.7-24-24V176c0-26.5 21.5-48 48-48zm336 48c0-26.5 21.5-48 48-48s48 21.5 48 48v24c0 13.3-10.7 24-24 24H456c-13.3 0-24-10.7-24-24V176zM96 480H480c53 0 96-43 96-96V352c0-35.3-28.7-64-64-64H64c-35.3 0-64 28.7-64 64v32c0 53 43 96 96 96zm0-64c-26.5 0-48-21.5-48-48V344c0-13.3 10.7-24 24-24h48c13.3 0 24 10.7 24 24v24c0 26.5-21.5 48-48 48zm80-48V344c0-13.3 10.7-24 24-24h48c13.3 0 24 10.7 24 24v24c0 26.5-21.5 48-48 48s-48-21.5-48-48zm176 48c-26.5 0-48-21.5-48-48V344c0-13.3 10.7-24 24-24h48c13.3 0 24 10.7 24 24v24c0 26.5-21.5 48-48 48zm80-48V344c0-13.3 10.7-24 24-24h48c13.3 0 24 10.7 24 24v24c0 26.5-21.5 48-48 48s-48-21.5-48-48z"]
            }, Wd = {
              prefix: "fas",
              iconName: "file-circle-minus",
              icon: [576, 512, [], "e4ed", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384v38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM288 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm224 0c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16s7.2 16 16 16H496c8.8 0 16-7.2 16-16z"]
            }, xb = {
              prefix: "fas",
              iconName: "tags",
              icon: [512, 512, [], "f02c", "M345 39.1L472.8 168.4c52.4 53 52.4 138.2 0 191.2L360.8 472.9c-9.3 9.4-24.5 9.5-33.9 .2s-9.5-24.5-.2-33.9L438.6 325.9c33.9-34.3 33.9-89.4 0-123.7L310.9 72.9c-9.3-9.4-9.2-24.6 .2-33.9s24.6-9.2 33.9 .2zM0 229.5V80C0 53.5 21.5 32 48 32H197.5c17 0 33.3 6.7 45.3 18.7l168 168c25 25 25 65.5 0 90.5L277.3 442.7c-25 25-65.5 25-90.5 0l-168-168C6.7 262.7 0 246.5 0 229.5zM144 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
            }, QP = {
              prefix: "fas",
              iconName: "wine-glass",
              icon: [320, 512, [127863], "f4e3", "M32.1 29.3C33.5 12.8 47.4 0 64 0H256c16.6 0 30.5 12.8 31.9 29.3l14 168.4c6 72-42.5 135.2-109.9 150.6V448h48c17.7 0 32 14.3 32 32s-14.3 32-32 32H160 80c-17.7 0-32-14.3-32-32s14.3-32 32-32h48V348.4C60.6 333 12.1 269.8 18.1 197.8l14-168.4zm56 98.7H231.9l-5.3-64H93.4l-5.3 64z"]
            }, Xl = {
              prefix: "fas",
              iconName: "forward-fast",
              icon: [512, 512, [9197, "fast-forward"], "f050", "M18.4 445c11.2 5.3 24.5 3.6 34.1-4.4L224 297.7V416c0 12.4 7.2 23.7 18.4 29s24.5 3.6 34.1-4.4L448 297.7V416c0 17.7 14.3 32 32 32s32-14.3 32-32V96c0-17.7-14.3-32-32-32s-32 14.3-32 32V214.3L276.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S224 83.6 224 96V214.3L52.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S0 83.6 0 96V416c0 12.4 7.2 23.7 18.4 29z"]
            }, nH = Xl, yh = {
              prefix: "fas",
              iconName: "face-meh-blank",
              icon: [512, 512, [128566, "meh-blank"], "f5a4", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm208.4-48a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm128 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, iH = yh, Tl = {
              prefix: "fas",
              iconName: "square-parking",
              icon: [448, 512, [127359, "parking"], "f540", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM192 256h48c17.7 0 32-14.3 32-32s-14.3-32-32-32H192v64zm48 64H192v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V288 168c0-22.1 17.9-40 40-40h72c53 0 96 43 96 96s-43 96-96 96z"]
            }, kh = Tl, sH = {
              prefix: "fas",
              iconName: "house-signal",
              icon: [576, 512, [], "e012", "M357.7 8.5c-12.3-11.3-31.2-11.3-43.4 0l-208 192c-9.4 8.6-12.7 22-8.5 34c87.1 25.3 155.6 94.2 180.3 181.6H464c26.5 0 48-21.5 48-48V256h32c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8.1-35.2l-208-192zM288 208c0-8.8 7.2-16 16-16h64c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H304c-8.8 0-16-7.2-16-16V208zM24 256c-13.3 0-24 10.7-24 24s10.7 24 24 24c101.6 0 184 82.4 184 184c0 13.3 10.7 24 24 24s24-10.7 24-24c0-128.1-103.9-232-232-232zm8 256a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM0 376c0 13.3 10.7 24 24 24c48.6 0 88 39.4 88 88c0 13.3 10.7 24 24 24s24-10.7 24-24c0-75.1-60.9-136-136-136c-13.3 0-24 10.7-24 24z"]
            }, _A = {
              prefix: "fas",
              iconName: "bars-progress",
              icon: [512, 512, ["tasks-alt"], "f828", "M448 160H320V128H448v32zM48 64C21.5 64 0 85.5 0 112v64c0 26.5 21.5 48 48 48H464c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H48zM448 352v32H192V352H448zM48 288c-26.5 0-48 21.5-48 48v64c0 26.5 21.5 48 48 48H464c26.5 0 48-21.5 48-48V336c0-26.5-21.5-48-48-48H48z"]
            }, YP = _A, ql = {
              prefix: "fas",
              iconName: "faucet-drip",
              icon: [512, 512, [128688], "e006", "M224 0c17.7 0 32 14.3 32 32V44l96-12c17.7 0 32 14.3 32 32s-14.3 32-32 32L256 84l-31-3.9-1-.1-1 .1L192 84 96 96C78.3 96 64 81.7 64 64s14.3-32 32-32l96 12V32c0-17.7 14.3-32 32-32zM0 224c0-17.7 14.3-32 32-32h96l22.6-22.6c6-6 14.1-9.4 22.6-9.4H192V116.2l32-4 32 4V160h18.7c8.5 0 16.6 3.4 22.6 9.4L320 192h32c88.4 0 160 71.6 160 160c0 17.7-14.3 32-32 32H416c-17.7 0-32-14.3-32-32s-14.3-32-32-32H315.9c-20.2 29-53.9 48-91.9 48s-71.7-19-91.9-48H32c-17.7 0-32-14.3-32-32V224zM436.8 423.4c1.9-4.5 6.3-7.4 11.2-7.4s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1V480c0 17.7-14.3 32-32 32s-32-14.3-32-32v-1.2c0-4.5 .9-8.9 2.7-13.1l18.2-42.4z"]
            }, Sj = {
              prefix: "fas",
              iconName: "cart-flatbed",
              icon: [640, 512, ["dolly-flatbed"], "f474", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64H48c8.8 0 16 7.2 16 16V368c0 44.2 35.8 80 80 80h18.7c-1.8 5-2.7 10.4-2.7 16c0 26.5 21.5 48 48 48s48-21.5 48-48c0-5.6-1-11-2.7-16H450.7c-1.8 5-2.7 10.4-2.7 16c0 26.5 21.5 48 48 48s48-21.5 48-48c0-5.6-1-11-2.7-16H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H144c-8.8 0-16-7.2-16-16V80C128 35.8 92.2 0 48 0H32zM192 80V272c0 26.5 21.5 48 48 48H560c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48H464V176c0 5.9-3.2 11.3-8.5 14.1s-11.5 2.5-16.4-.8L400 163.2l-39.1 26.1c-4.9 3.3-11.2 3.6-16.4 .8s-8.5-8.2-8.5-14.1V32H240c-26.5 0-48 21.5-48 48z"]
            }, Uj = Sj, y3 = {
              prefix: "fas",
              iconName: "ban-smoking",
              icon: [512, 512, [128685, "smoking-ban"], "f54d", "M99.5 144.8L178.7 224l96 96 92.5 92.5C335.9 434.9 297.5 448 256 448C150 448 64 362 64 256c0-41.5 13.1-79.9 35.5-111.2zM333.3 288l-32-32H384v32H333.3zm32 32H400c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H269.3L144.8 99.5C176.1 77.1 214.5 64 256 64c106 0 192 86 192 192c0 41.5-13.1 79.9-35.5 111.2L365.3 320zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM272 96c-8.8 0-16 7.2-16 16c0 26.5 21.5 48 48 48h32c8.8 0 16 7.2 16 16s7.2 16 16 16s16-7.2 16-16c0-26.5-21.5-48-48-48H304c-8.8 0-16-7.2-16-16s-7.2-16-16-16zM229.5 320l-96-96H112c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16H229.5z"]
            }, df = y3, MP = {
              prefix: "fas",
              iconName: "terminal",
              icon: [576, 512, [], "f120", "M9.4 86.6C-3.1 74.1-3.1 53.9 9.4 41.4s32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 9.4 86.6zM256 416H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H256c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, Db = {
              prefix: "fas",
              iconName: "mobile-button",
              icon: [384, 512, [], "f10b", "M80 0C44.7 0 16 28.7 16 64V448c0 35.3 28.7 64 64 64H304c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H80zM192 400a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, TB = {
              prefix: "fas",
              iconName: "house-medical-flag",
              icon: [640, 512, [], "e514", "M480 0c17.7 0 32 14.3 32 32H624c8.8 0 16 7.2 16 16V176c0 8.8-7.2 16-16 16H512V512H448V192 32c0-17.7 14.3-32 32-32zM276.8 39.7L416 159V512h1l-.2 0H96c-17.7 0-32-14.3-32-32V288H32c-13.4 0-25.4-8.3-30-20.9s-1-26.7 9.2-35.4l224-192c12-10.3 29.7-10.3 41.7 0zM224 208v48H176c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h48v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320h48c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H288V208c0-8.8-7.2-16-16-16H240c-8.8 0-16 7.2-16 16z"]
            }, jb = {
              prefix: "fas",
              iconName: "basket-shopping",
              icon: [576, 512, ["shopping-basket"], "f291", "M253.3 35.1c6.1-11.8 1.5-26.3-10.2-32.4s-26.3-1.5-32.4 10.2L117.6 192H32c-17.7 0-32 14.3-32 32s14.3 32 32 32L83.9 463.5C91 492 116.6 512 146 512H430c29.4 0 55-20 62.1-48.5L544 256c17.7 0 32-14.3 32-32s-14.3-32-32-32H458.4L365.3 12.9C359.2 1.2 344.7-3.4 332.9 2.7s-16.3 20.6-10.2 32.4L404.3 192H171.7L253.3 35.1zM192 304v96c0 8.8-7.2 16-16 16s-16-7.2-16-16V304c0-8.8 7.2-16 16-16s16 7.2 16 16zm96-16c8.8 0 16 7.2 16 16v96c0 8.8-7.2 16-16 16s-16-7.2-16-16V304c0-8.8 7.2-16 16-16zm128 16v96c0 8.8-7.2 16-16 16s-16-7.2-16-16V304c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
            }, Ij = jb, cT = {
              prefix: "fas",
              iconName: "tape",
              icon: [576, 512, [], "f4db", "M380.8 416c41.5-40.7 67.2-97.3 67.2-160C448 132.3 347.7 32 224 32S0 132.3 0 256S100.3 480 224 480H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H380.8zM224 160a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm64 96a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
            }, l6 = {
              prefix: "fas",
              iconName: "bus-simple",
              icon: [448, 512, ["bus-alt"], "f55e", "M224 0C348.8 0 448 35.2 448 80V96 416c0 17.7-14.3 32-32 32v32c0 17.7-14.3 32-32 32H352c-17.7 0-32-14.3-32-32V448H128v32c0 17.7-14.3 32-32 32H64c-17.7 0-32-14.3-32-32l0-32c-17.7 0-32-14.3-32-32V96 80C0 35.2 99.2 0 224 0zM64 128V256c0 17.7 14.3 32 32 32H352c17.7 0 32-14.3 32-32V128c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32zM80 400a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm288 0a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, wb = l6, k3 = {
              prefix: "fas",
              iconName: "eye",
              icon: [576, 512, [128065], "f06e", "M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"]
            }, mX = {
              prefix: "fas",
              iconName: "face-sad-cry",
              icon: [512, 512, [128557, "sad-cry"], "f5b3", "M352 493.4c-29.6 12-62.1 18.6-96 18.6s-66.4-6.6-96-18.6V288c0-8.8-7.2-16-16-16s-16 7.2-16 16V477.8C51.5 433.5 0 350.8 0 256C0 114.6 114.6 0 256 0S512 114.6 512 256c0 94.8-51.5 177.5-128 221.8V288c0-8.8-7.2-16-16-16s-16 7.2-16 16V493.4zM195.2 233.6c5.3 7.1 15.3 8.5 22.4 3.2s8.5-15.3 3.2-22.4c-30.4-40.5-91.2-40.5-121.6 0c-5.3 7.1-3.9 17.1 3.2 22.4s17.1 3.9 22.4-3.2c17.6-23.5 52.8-23.5 70.4 0zm121.6 0c17.6-23.5 52.8-23.5 70.4 0c5.3 7.1 15.3 8.5 22.4 3.2s8.5-15.3 3.2-22.4c-30.4-40.5-91.2-40.5-121.6 0c-5.3 7.1-3.9 17.1 3.2 22.4s17.1 3.9 22.4-3.2zM208 336v32c0 26.5 21.5 48 48 48s48-21.5 48-48V336c0-26.5-21.5-48-48-48s-48 21.5-48 48z"]
            }, Rj = mX, aH = {
              prefix: "fas",
              iconName: "audio-description",
              icon: [576, 512, [], "f29e", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM213.5 173.3l72 144c5.9 11.9 1.1 26.3-10.7 32.2s-26.3 1.1-32.2-10.7l-9.4-18.9H150.9l-9.4 18.9c-5.9 11.9-20.3 16.7-32.2 10.7s-16.7-20.3-10.7-32.2l72-144c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3zm-.4 106.6L192 237.7l-21.1 42.2h42.2zM304 184c0-13.3 10.7-24 24-24h56c53 0 96 43 96 96s-43 96-96 96H328c-13.3 0-24-10.7-24-24V184zm48 24v96h32c26.5 0 48-21.5 48-48s-21.5-48-48-48H352z"]
            }, mb = {
              prefix: "fas",
              iconName: "person-military-to-person",
              icon: [512, 512, [], "e54c", "M71 12.5c-8.6 1-15 8.2-15 16.8c0 9.3 7.5 16.8 16.7 16.9H184.1c8.8-.1 15.9-7.2 15.9-16V16c0-9.5-8.3-17-17.8-15.9L71 12.5zM189.5 78.1H66.5C64.9 83.8 64 89.8 64 96c0 35.3 28.7 64 64 64s64-28.7 64-64c0-6.2-.9-12.2-2.5-17.9zM32 256v32c0 17.7 14.3 32 32 32H192c1.8 0 3.5-.1 5.2-.4L53 208.6C40.1 220.3 32 237.2 32 256zm190.2 42.5c1.1-3.3 1.8-6.8 1.8-10.5V256c0-35.3-28.7-64-64-64H96c-3.7 0-7.4 .3-10.9 .9L222.2 298.5zM384 160a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32H448c17.7 0 32-14.3 32-32V256c0-35.3-28.7-64-64-64H352zM215.8 450.1c5.2-4.6 8.2-11.1 8.2-18.1s-3-13.5-8.2-18.1l-64-56c-7.1-6.2-17.1-7.7-25.7-3.8S112 366.6 112 376v32l-88 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l88 0v32c0 9.4 5.5 18 14.1 21.9s18.6 2.4 25.7-3.8l64-56zM288 431.9c0 6.9 2.9 13.5 8.1 18.1l64 56.4c7.1 6.2 17.1 7.8 25.7 3.9s14.1-12.4 14.1-21.9l0-32.4 88 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-88 0 0-32c0-9.4-5.5-18-14.1-21.9s-18.6-2.4-25.7 3.8l-64 56c-5.2 4.5-8.2 11.1-8.2 18z"]
            }, BX = {
              prefix: "fas",
              iconName: "file-shield",
              icon: [576, 512, [], "e4f0", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384v47l-92.8 37.1c-21.3 8.5-35.2 29.1-35.2 52c0 56.6 18.9 148 94.2 208.3c-9 4.8-19.3 7.6-30.2 7.6H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zm39.1 97.7c5.7-2.3 12.1-2.3 17.8 0l120 48C570 277.4 576 286.2 576 296c0 63.3-25.9 168.8-134.8 214.2c-5.9 2.5-12.6 2.5-18.5 0C313.9 464.8 288 359.3 288 296c0-9.8 6-18.6 15.1-22.3l120-48zM527.4 312L432 273.8V461.7c68.2-33 91.5-99 95.4-149.7z"]
            }, Bb = {
              prefix: "fas",
              iconName: "user-slash",
              icon: [640, 512, [], "f506", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L353.3 251.6C407.9 237 448 187.2 448 128C448 57.3 390.7 0 320 0C250.2 0 193.5 55.8 192 125.2L38.8 5.1zM264.3 304.3C170.5 309.4 96 387.2 96 482.3c0 16.4 13.3 29.7 29.7 29.7H514.3c3.9 0 7.6-.7 11-2.1l-261-205.6z"]
            }, pn = {
              prefix: "fas",
              iconName: "pen",
              icon: [512, 512, [128394], "f304", "M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"]
            }, $A = {
              prefix: "fas",
              iconName: "tower-observation",
              icon: [512, 512, [], "e586", "M241.7 3.4c9-4.5 19.6-4.5 28.6 0l160 80c15.8 7.9 22.2 27.1 14.3 42.9C439 137.5 427.7 144 416 144v80c0 17.7-14.3 32-32 32h-4.9l32 192H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H384.5c-.4 0-.8 0-1.1 0H128.6c-.4 0-.8 0-1.1 0H32c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l32-192H128c-17.7 0-32-14.3-32-32V144c-11.7 0-23-6.5-28.6-17.7c-7.9-15.8-1.5-35 14.3-42.9l160-80zM314.5 448L256 399.2 197.5 448h117zM197.8 256l-4.7 28.3L256 336.8l62.9-52.5L314.2 256H197.8zm-13.9 83.2l-11.2 67L218.5 368l-34.6-28.8zM293.5 368l45.8 38.1-11.2-67L293.5 368zM176 128c-8.8 0-16 7.2-16 16s7.2 16 16 16H336c8.8 0 16-7.2 16-16s-7.2-16-16-16H176z"]
            }, pT = {
              prefix: "fas",
              iconName: "file-code",
              icon: [384, 512, [], "f1c9", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM153 289l-31 31 31 31c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L71 337c-9.4-9.4-9.4-24.6 0-33.9l48-48c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM265 255l48 48c9.4 9.4 9.4 24.6 0 33.9l-48 48c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"]
            }, Sd = {
              prefix: "fas",
              iconName: "signal",
              icon: [640, 512, [128246, "signal-5", "signal-perfect"], "f012", "M576 0c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V32c0-17.7 14.3-32 32-32zM448 96c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V128c0-17.7 14.3-32 32-32zM352 224V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V224c0-17.7 14.3-32 32-32s32 14.3 32 32zM192 288c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V320c0-17.7 14.3-32 32-32zM96 416v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V416c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
            }, bv = Sd, Ca = Sd, m9 = {
              prefix: "fas",
              iconName: "bus",
              icon: [576, 512, [128653], "f207", "M288 0C422.4 0 512 35.2 512 80V96l0 32c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32l0 160c0 17.7-14.3 32-32 32v32c0 17.7-14.3 32-32 32H416c-17.7 0-32-14.3-32-32V448H192v32c0 17.7-14.3 32-32 32H128c-17.7 0-32-14.3-32-32l0-32c-17.7 0-32-14.3-32-32l0-160c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h0V96h0V80C64 35.2 153.6 0 288 0zM128 160v96c0 17.7 14.3 32 32 32H272V128H160c-17.7 0-32 14.3-32 32zM304 288H416c17.7 0 32-14.3 32-32V160c0-17.7-14.3-32-32-32H304V288zM144 400a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm288 0a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM384 80c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16s7.2 16 16 16H368c8.8 0 16-7.2 16-16z"]
            }, B9 = {
              prefix: "fas",
              iconName: "heart-circle-xmark",
              icon: [576, 512, [], "e501", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L454.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L432 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L409.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L432 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
            }, E3 = {
              prefix: "fas",
              iconName: "house-chimney",
              icon: [576, 512, [63499, "home-lg"], "e3af", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L512 185V64c0-17.7-14.3-32-32-32H448c-17.7 0-32 14.3-32 32v36.7L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1h32v69.7c-.1 .9-.1 1.8-.1 2.8V472c0 22.1 17.9 40 40 40h16c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2H160h24c22.1 0 40-17.9 40-40V448 384c0-17.7 14.3-32 32-32h64c17.7 0 32 14.3 32 32v64 24c0 22.1 17.9 40 40 40h24 32.5c1.4 0 2.8 0 4.2-.1c1.1 .1 2.2 .1 3.3 .1h16c22.1 0 40-17.9 40-40V455.8c.3-2.6 .5-5.3 .5-8.1l-.7-160.2h32z"]
            }, WX = E3, Vj = {
              prefix: "fas",
              iconName: "window-maximize",
              icon: [512, 512, [128470], "f2d0", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM96 96H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, jr = {
              prefix: "fas",
              iconName: "face-frown",
              icon: [512, 512, [9785, "frown"], "f119", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM159.3 388.7c-2.6 8.4-11.6 13.2-20 10.5s-13.2-11.6-10.5-20C145.2 326.1 196.3 288 256 288s110.8 38.1 127.3 91.3c2.6 8.4-2.1 17.4-10.5 20s-17.4-2.1-20-10.5C340.5 349.4 302.1 320 256 320s-84.5 29.4-96.7 68.7zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, Ud = jr, bl = {
              prefix: "fas",
              iconName: "prescription",
              icon: [448, 512, [], "f5b1", "M32 0C14.3 0 0 14.3 0 32V192v96c0 17.7 14.3 32 32 32s32-14.3 32-32V224h50.7l128 128L137.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L288 397.3 393.4 502.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L333.3 352 438.6 246.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 306.7l-85.8-85.8C251.4 209.1 288 164.8 288 112C288 50.1 237.9 0 176 0H32zM176 160H64V64H176c26.5 0 48 21.5 48 48s-21.5 48-48 48z"]
            }, SX = {
              prefix: "fas",
              iconName: "shop",
              icon: [640, 512, ["store-alt"], "f54f", "M36.8 192H603.2c20.3 0 36.8-16.5 36.8-36.8c0-7.3-2.2-14.4-6.2-20.4L558.2 21.4C549.3 8 534.4 0 518.3 0H121.7c-16 0-31 8-39.9 21.4L6.2 134.7c-4 6.1-6.2 13.2-6.2 20.4C0 175.5 16.5 192 36.8 192zM64 224V384v80c0 26.5 21.5 48 48 48H336c26.5 0 48-21.5 48-48V384 224H320V384H128V224H64zm448 0V480c0 17.7 14.3 32 32 32s32-14.3 32-32V224H512z"]
            }, Oa = SX, bn = {
              prefix: "fas",
              iconName: "floppy-disk",
              icon: [448, 512, [128190, 128426, "save"], "f0c7", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V173.3c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32H64zm0 96c0-17.7 14.3-32 32-32H288c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V128zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
            }, Eh = bn, Wb = {
              prefix: "fas",
              iconName: "vihara",
              icon: [640, 512, [], "f6a7", "M281 22L305.8 4.7c1.3-.9 2.7-1.8 4.1-2.4C313.1 .7 316.6 0 320 0s6.9 .7 10.1 2.2c1.4 .7 2.8 1.5 4.1 2.4L359 22C393 45.8 430.8 63.5 470.8 74.4l23 6.3c1.8 .5 3.6 1.1 5.2 2c3.2 1.7 5.9 4 8.1 6.8c3.8 4.9 5.6 11.3 4.7 17.8c-.4 2.8-1.2 5.4-2.5 7.8c-1.7 3.2-4 5.9-6.8 8.1c-4.3 3.2-9.6 5.1-15.1 4.9H480v56.1l6.4 5.1 5.2 4.1c21.1 16.7 45 29.6 70.5 38.1l28.9 9.6c1.6 .5 3.2 1.2 4.6 2c3.1 1.7 5.8 4.1 7.8 6.9s3.5 6.1 4.1 9.6c.5 2.7 .6 5.5 .1 8.3s-1.4 5.4-2.7 7.8c-1.7 3.1-4.1 5.8-6.9 7.8s-6.1 3.5-9.6 4.1c-1.6 .3-3.3 .4-5 .4H544v65.9c20.5 22.8 47.4 39.2 77.4 46.7C632 403 640 412.6 640 424c0 13.3-10.7 24-24 24H576v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448H352v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448H128v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448H24c-13.3 0-24-10.7-24-24c0-11.4 8-21 18.6-23.4c30-7.6 56.9-23.9 77.4-46.7V288H56.6c-1.7 0-3.4-.1-5-.4c-3.5-.7-6.8-2.1-9.6-4.1s-5.2-4.7-7-7.8c-1.3-2.4-2.3-5-2.7-7.8s-.4-5.6 .1-8.3c.7-3.5 2.1-6.8 4.1-9.6s4.7-5.2 7.8-6.9c1.4-.8 3-1.5 4.6-2l28.9-9.6c25.5-8.5 49.4-21.4 70.5-38.1l5.2-4.1 6.4-5.1V176 128h-7.5c-5.5 .1-10.8-1.7-15.1-4.9c-2.8-2.1-5.1-4.8-6.8-8.1c-1.2-2.4-2.1-5-2.5-7.8c-.9-6.5 .9-12.8 4.7-17.8c2.1-2.8 4.8-5.1 8.1-6.8c1.6-.8 3.4-1.5 5.2-2l23-6.3C209.2 63.5 247 45.8 281 22zM416 128H320 224v64h72 48 72V128zM160 288v64H296h24 24H480V288H344 320h0H296 160z"]
            }, P6 = {
              prefix: "fas",
              iconName: "scale-unbalanced",
              icon: [640, 512, ["balance-scale-left"], "f515", "M522.1 62.4c16.8-5.6 25.8-23.7 20.2-40.5S518.6-3.9 501.9 1.6l-113 37.7C375 15.8 349.3 0 320 0c-44.2 0-80 35.8-80 80c0 3 .2 5.9 .5 8.8L117.9 129.6c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l135.5-45.2c4.5 3.2 9.3 5.9 14.4 8.2V480c0 17.7 14.3 32 32 32H512c17.7 0 32-14.3 32-32s-14.3-32-32-32H352V153.3c21-9.2 37.2-27 44.2-49l125.9-42zM439.6 288L512 163.8 584.4 288H439.6zM512 384c62.9 0 115.2-34 126-78.9c2.6-11-1-22.3-6.7-32.1L536.1 109.8c-5-8.6-14.2-13.8-24.1-13.8s-19.1 5.3-24.1 13.8L392.7 273.1c-5.7 9.8-9.3 21.1-6.7 32.1C396.8 350 449.1 384 512 384zM129.2 291.8L201.6 416H56.7l72.4-124.2zM3.2 433.1C14 478 66.3 512 129.2 512s115.2-34 126-78.9c2.6-11-1-22.3-6.7-32.1L153.2 237.8c-5-8.6-14.2-13.8-24.1-13.8s-19.1 5.3-24.1 13.8L9.9 401.1c-5.7 9.8-9.3 21.1-6.7 32.1z"]
            }, hT = P6, xl = {
              prefix: "fas",
              iconName: "sort-up",
              icon: [320, 512, ["sort-asc"], "f0de", "M182.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8H288c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]
            }, HT = xl, UX = {
              prefix: "fas",
              iconName: "comment-dots",
              icon: [512, 512, [128172, 62075, "commenting"], "f4ad", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3 0 0 0 0 0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM128 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, LP = UX, F3 = {
              prefix: "fas",
              iconName: "plant-wilt",
              icon: [512, 512, [], "e5aa", "M288 120c0-30.9 25.1-56 56-56s56 25.1 56 56v13c-29.3 10-48 34.5-48 70.1c0 27.9 25.3 74.8 66 111.6c3.8 3.5 8.9 5.3 14 5.3s10.2-1.8 14-5.3c40.7-36.8 66-83.7 66-111.6c0-35.6-18.7-60.2-48-70.1V120C464 53.7 410.3 0 344 0S224 53.7 224 120v21.8C207.3 133 188.2 128 168 128c-66.3 0-120 53.7-120 120v13c-29.3 10-48 34.5-48 70.1C0 359 25.3 405.9 66 442.7c3.8 3.5 8.9 5.3 14 5.3s10.2-1.8 14-5.3c40.7-36.8 66-83.7 66-111.6c0-35.6-18.7-60.2-48-70.1V248c0-30.9 25.1-56 56-56s56 25.1 56 56v32V480c0 17.7 14.3 32 32 32s32-14.3 32-32V280 248 120z"]
            }, Sb = {
              prefix: "fas",
              iconName: "diamond",
              icon: [512, 512, [9830], "f219", "M284.3 11.7c-15.6-15.6-40.9-15.6-56.6 0l-216 216c-15.6 15.6-15.6 40.9 0 56.6l216 216c15.6 15.6 40.9 15.6 56.6 0l216-216c15.6-15.6 15.6-40.9 0-56.6l-216-216z"]
            }, Fh = {
              prefix: "fas",
              iconName: "face-grin-squint",
              icon: [512, 512, [128518, "grin-squint"], "f585", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM133.5 146.7l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 157.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
            }, gT = Fh, XT = {
              prefix: "fas",
              iconName: "hand-holding-dollar",
              icon: [576, 512, ["hand-holding-usd"], "f4c0", "M312 24V34.5c6.4 1.2 12.6 2.7 18.2 4.2c12.8 3.4 20.4 16.6 17 29.4s-16.6 20.4-29.4 17c-10.9-2.9-21.1-4.9-30.2-5c-7.3-.1-14.7 1.7-19.4 4.4c-2.1 1.3-3.1 2.4-3.5 3c-.3 .5-.7 1.2-.7 2.8c0 .3 0 .5 0 .6c.2 .2 .9 1.2 3.3 2.6c5.8 3.5 14.4 6.2 27.4 10.1l.9 .3c11.1 3.3 25.9 7.8 37.9 15.3c13.7 8.6 26.1 22.9 26.4 44.9c.3 22.5-11.4 38.9-26.7 48.5c-6.7 4.1-13.9 7-21.3 8.8V232c0 13.3-10.7 24-24 24s-24-10.7-24-24V220.6c-9.5-2.3-18.2-5.3-25.6-7.8c-2.1-.7-4.1-1.4-6-2c-12.6-4.2-19.4-17.8-15.2-30.4s17.8-19.4 30.4-15.2c2.6 .9 5 1.7 7.3 2.5c13.6 4.6 23.4 7.9 33.9 8.3c8 .3 15.1-1.6 19.2-4.1c1.9-1.2 2.8-2.2 3.2-2.9c.4-.6 .9-1.8 .8-4.1l0-.2c0-1 0-2.1-4-4.6c-5.7-3.6-14.3-6.4-27.1-10.3l-1.9-.6c-10.8-3.2-25-7.5-36.4-14.4c-13.5-8.1-26.5-22-26.6-44.1c-.1-22.9 12.9-38.6 27.7-47.4c6.4-3.8 13.3-6.4 20.2-8.2V24c0-13.3 10.7-24 24-24s24 10.7 24 24zM568.2 336.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5H192 32c-17.7 0-32-14.3-32-32V416c0-17.7 14.3-32 32-32H68.8l44.9-36c22.7-18.2 50.9-28 80-28H272h16 64c17.7 0 32 14.3 32 32s-14.3 32-32 32H288 272c-8.8 0-16 7.2-16 16s7.2 16 16 16H392.6l119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 384l0 0-.9 0c.3 0 .6 0 .9 0z"]
            }, TT = XT, Ub = {
              prefix: "fas",
              iconName: "bacterium",
              icon: [512, 512, [], "e05a", "M423.1 30.6c3.6-12.7-3.7-26-16.5-29.7s-26 3.7-29.7 16.5l-4.2 14.7c-9.8-.4-19.9 .5-29.9 2.8c-12.1 2.8-23.7 5.9-34.9 9.4l-5.9-13.7c-5.2-12.2-19.3-17.8-31.5-12.6s-17.8 19.3-12.6 31.5l4.9 11.3c-22 9.4-42 20.1-60.2 31.8L196 82.7c-7.4-11-22.3-14-33.3-6.7s-14 22.3-6.7 33.3l7.8 11.6c-18 15-33.7 30.8-47.3 47.1L103 157.3c-10.4-8.3-25.5-6.6-33.7 3.7s-6.6 25.5 3.7 33.7l15 12c-2.1 3.2-4.1 6.5-6 9.7c-9.4 15.7-17 31-23.2 45.3l-9.9-3.9c-12.3-4.9-26.3 1.1-31.2 13.4s1.1 26.3 13.4 31.2l11.6 4.6c-.3 1.1-.6 2.1-.9 3.1c-3.5 12.5-5.7 23.2-7.1 31.3c-.7 4.1-1.2 7.5-1.6 10.3c-.2 1.4-.3 2.6-.4 3.6l-.1 1.4-.1 .6 0 .3 0 .1c0 0 0 .1 39.2 3.7l0 0-39.2-3.6c-.5 5-.6 10-.4 14.9l-14.7 4.2C4.7 380.6-2.7 393.8 .9 406.6s16.9 20.1 29.7 16.5l13.8-3.9c10.6 20.7 27.6 37.8 48.5 48.5l-3.9 13.7c-3.6 12.7 3.7 26 16.5 29.7s26-3.7 29.7-16.5l4.2-14.7c23.8 1 46.3-5.5 65.1-17.6L215 473c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-10.6-10.6c9.1-14.1 15.1-30.5 17-48.3l.1-.8c.3-1.7 1-5.1 2.3-9.8l.2-.8 12.6 5.4c12.2 5.2 26.3-.4 31.5-12.6s-.4-26.3-12.6-31.5l-11.3-4.8c9.9-14.9 24.9-31.6 48.6-46l2.1 7.5c3.6 12.7 16.9 20.1 29.7 16.5s20.1-16.9 16.5-29.7L371 259.2c6.9-2.2 14.3-4.3 22.2-6.1c12.9-3 24.7-8 35.2-14.8L439 249c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-10.6-10.6c12.2-19 18.6-41.6 17.6-65.1l14.7-4.2c12.7-3.6 20.1-16.9 16.5-29.7s-16.9-20.1-29.7-16.5l-13.7 3.9c-10.8-21.2-28-38-48.5-48.5l3.9-13.8zM92.1 363.3l0 0L144 368l-51.9-4.7zM112 320a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM240 184a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, Cj = {
              prefix: "fas",
              iconName: "hand-pointer",
              icon: [448, 512, [], "f25a", "M128 40c0-22.1 17.9-40 40-40s40 17.9 40 40V188.2c8.5-7.6 19.7-12.2 32-12.2c20.6 0 38.2 13 45 31.2c8.8-9.3 21.2-15.2 35-15.2c25.3 0 46 19.5 47.9 44.3c8.5-7.7 19.8-12.3 32.1-12.3c26.5 0 48 21.5 48 48v48 16 48c0 70.7-57.3 128-128 128l-16 0H240l-.1 0h-5.2c-5 0-9.9-.3-14.7-1c-55.3-5.6-106.2-34-140-79L8 336c-13.3-17.7-9.7-42.7 8-56s42.7-9.7 56 8l56 74.7V40zM240 304c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304zm48-16c-8.8 0-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304z"]
            }, qT = {
              prefix: "fas",
              iconName: "drum-steelpan",
              icon: [576, 512, [], "f56a", "M288 32c159.1 0 288 48 288 128V352c0 80-128.9 128-288 128S0 432 0 352V160C0 80 128.9 32 288 32zM528 160c0-9.9-8-29.9-55-49.8c-18.6-7.9-40.9-14.4-66-19.4l-27.8 43.6c-7.3 11.5-11.2 24.8-11.2 38.4c0 17.5 6.4 34.4 18.1 47.5l9.8 11c29.8-5.2 55.9-12.5 77.2-21.5c47.1-19.9 55-39.9 55-49.8zM349.2 237.3c-8-26.2-32.4-45.3-61.2-45.3s-53.3 19.1-61.2 45.3c19.4 1.7 39.9 2.7 61.2 2.7s41.8-.9 61.2-2.7zM169 90.8c-25.2 5-47.4 11.6-66 19.4C56 130.1 48 150.1 48 160s8 29.9 55 49.8c21.3 9 47.4 16.3 77.2 21.5l9.8-11c11.6-13.1 18.1-30 18.1-47.5c0-13.6-3.9-26.9-11.2-38.4L169 90.8zm56.3-8C224.5 87 224 91.5 224 96c0 35.3 28.7 64 64 64s64-28.7 64-64c0-4.5-.5-9-1.4-13.2C330.8 81 309.8 80 288 80s-42.8 1-62.6 2.8z"]
            }, oH = {
              prefix: "fas",
              iconName: "hand-scissors",
              icon: [512, 512, [], "f257", "M40 208c-22.1 0-40 17.9-40 40s17.9 40 40 40l180.2 0c-7.6 8.5-12.2 19.7-12.2 32c0 25.3 19.5 46 44.3 47.9c-7.7 8.5-12.3 19.8-12.3 32.1c0 26.5 21.5 48 48 48l32 0 64 0c70.7 0 128-57.3 128-128l0-113.1c0-40.2-16-78.8-44.4-107.3C444.8 76.8 413.9 64 381.7 64L336 64c-21.3 0-39.3 13.9-45.6 33.1l74.5 23.7c8.4 2.7 13.1 11.7 10.4 20.1s-11.7 13.1-20.1 10.4L288 129.9l0 .1L84 65.8C62.9 59.2 40.5 70.9 33.8 92s5.1 43.5 26.2 50.2L269.5 208 40 208z"]
            }, N3 = {
              prefix: "fas",
              iconName: "hands-praying",
              icon: [640, 512, ["praying-hands"], "f684", "M351.2 4.8c3.2-2 6.6-3.3 10-4.1c4.7-1 9.6-.9 14.1 .1c7.7 1.8 14.8 6.5 19.4 13.6L514.6 194.2c8.8 13.1 13.4 28.6 13.4 44.4v73.5c0 6.9 4.4 13 10.9 15.2l79.2 26.4C631.2 358 640 370.2 640 384v96c0 9.9-4.6 19.3-12.5 25.4s-18.1 8.1-27.7 5.5L431 465.9c-56-14.9-95-65.7-95-123.7V224c0-17.7 14.3-32 32-32s32 14.3 32 32v80c0 8.8 7.2 16 16 16s16-7.2 16-16V219.1c0-7-1.8-13.8-5.3-19.8L340.3 48.1c-1.7-3-2.9-6.1-3.6-9.3c-1-4.7-1-9.6 .1-14.1c1.9-8 6.8-15.2 14.3-19.9zm-62.4 0c7.5 4.6 12.4 11.9 14.3 19.9c1.1 4.6 1.2 9.4 .1 14.1c-.7 3.2-1.9 6.3-3.6 9.3L213.3 199.3c-3.5 6-5.3 12.9-5.3 19.8V304c0 8.8 7.2 16 16 16s16-7.2 16-16V224c0-17.7 14.3-32 32-32s32 14.3 32 32V342.3c0 58-39 108.7-95 123.7l-168.7 45c-9.6 2.6-19.9 .5-27.7-5.5S0 490 0 480V384c0-13.8 8.8-26 21.9-30.4l79.2-26.4c6.5-2.2 10.9-8.3 10.9-15.2V238.5c0-15.8 4.7-31.2 13.4-44.4L245.2 14.5c4.6-7.1 11.7-11.8 19.4-13.6c4.6-1.1 9.4-1.2 14.1-.1c3.5 .8 6.9 2.1 10 4.1z"]
            }, IX = N3, Dl = {
              prefix: "fas",
              iconName: "arrow-rotate-right",
              icon: [512, 512, [8635, "arrow-right-rotate", "arrow-rotate-forward", "redo"], "f01e", "M386.3 160H336c-17.7 0-32 14.3-32 32s14.3 32 32 32H464c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0s-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3s163.8-62.5 226.3 0L386.3 160z"]
            }, fH = Dl, AH = Dl, Q3 = Dl, RX = {
              prefix: "fas",
              iconName: "biohazard",
              icon: [576, 512, [9763], "f780", "M173.2 0c-1.8 0-3.5 .7-4.8 2C138.5 32.3 120 74 120 120c0 26.2 6 50.9 16.6 73c-22 2.4-43.8 9.1-64.2 20.5C37.9 232.8 13.3 262.4 .4 296c-.7 1.7-.5 3.7 .5 5.2c2.2 3.7 7.4 4.3 10.6 1.3C64.2 254.3 158 245.1 205 324s-8.1 153.1-77.6 173.2c-4.2 1.2-6.3 5.9-4.1 9.6c1 1.6 2.6 2.7 4.5 3c36.5 5.9 75.2 .1 109.7-19.2c20.4-11.4 37.4-26.5 50.5-43.8c13.1 17.3 30.1 32.4 50.5 43.8c34.5 19.3 73.3 25.2 109.7 19.2c1.9-.3 3.5-1.4 4.5-3c2.2-3.7 .1-8.4-4.1-9.6C379.1 477.1 324 403 371 324s140.7-69.8 193.5-21.4c3.2 2.9 8.4 2.3 10.6-1.3c1-1.6 1.1-3.5 .5-5.2c-12.9-33.6-37.5-63.2-72.1-82.5c-20.4-11.4-42.2-18.1-64.2-20.5C450 170.9 456 146.2 456 120c0-46-18.5-87.7-48.4-118c-1.3-1.3-3-2-4.8-2c-5 0-8.4 5.2-6.7 9.9C421.7 80.5 385.6 176 288 176S154.3 80.5 179.9 9.9c1.7-4.7-1.6-9.9-6.7-9.9zM240 272a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM181.7 417.6c6.3-11.8 9.8-25.1 8.6-39.8c-19.5-18-34-41.4-41.2-67.8c-12.5-8.1-26.2-11.8-40-12.4c-9-.4-18.1 .6-27.1 2.7c7.8 57.1 38.7 106.8 82.9 139.4c6.8-6.7 12.6-14.1 16.8-22.1zM288 64c-28.8 0-56.3 5.9-81.2 16.5c2 8.3 5 16.2 9 23.5c6.8 12.4 16.7 23.1 30.1 30.3c13.3-4.1 27.5-6.3 42.2-6.3s28.8 2.2 42.2 6.3c13.4-7.2 23.3-17.9 30.1-30.3c4-7.3 7-15.2 9-23.5C344.3 69.9 316.8 64 288 64zM426.9 310c-7.2 26.4-21.7 49.7-41.2 67.8c-1.2 14.7 2.2 28.1 8.6 39.8c4.3 8 10 15.4 16.8 22.1c44.3-32.6 75.2-82.3 82.9-139.4c-9-2.2-18.1-3.1-27.1-2.7c-13.8 .6-27.5 4.4-40 12.4z"]
            }, VX = {
              prefix: "fas",
              iconName: "location-crosshairs",
              icon: [512, 512, ["location"], "f601", "M256 0c17.7 0 32 14.3 32 32V66.7C368.4 80.1 431.9 143.6 445.3 224H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H445.3C431.9 368.4 368.4 431.9 288 445.3V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V445.3C143.6 431.9 80.1 368.4 66.7 288H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H66.7C80.1 143.6 143.6 80.1 224 66.7V32c0-17.7 14.3-32 32-32zM128 256a128 128 0 1 0 256 0 128 128 0 1 0 -256 0zm128-80a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
            }, Y3 = VX, KP = {
              prefix: "fas",
              iconName: "mars-double",
              icon: [640, 512, [9891], "f227", "M312 32c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l33.4 33.4L275.8 159c-28.4-19.5-62.7-31-99.8-31C78.8 128 0 206.8 0 304s78.8 176 176 176s176-78.8 176-176c0-37-11.4-71.4-31-99.8l52.6-52.6L407 185c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2V56c0-13.3-10.7-24-24-24H312zm88 48h0v0l0 0zM64 304a112 112 0 1 1 224 0A112 112 0 1 1 64 304zM368 480c97.2 0 176-78.8 176-176c0-37-11.4-71.4-31-99.8l52.6-52.6L599 185c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2V56c0-13.3-10.7-24-24-24H504c-9.7 0-18.5 5.8-22.2 14.8c-1.2 2.9-1.8 6-1.8 9l0 .2v.2c0 6.2 2.5 12.2 7 16.8l33.4 33.4L480 146.7V168c0 22.6-13.6 43.1-34.6 51.7c-.8 .3-1.7 .7-2.5 1C465.7 241.2 480 270.9 480 304c0 61.9-50.1 112-112 112c-5.4 0-10.8-.4-16-1.1c-12.9 20.4-29.1 38.3-48.1 53.1c19.8 7.8 41.4 12 64 12z"]
            }, dH = {
              prefix: "fas",
              iconName: "child-dress",
              icon: [320, 512, [], "e59c", "M224 64A64 64 0 1 0 96 64a64 64 0 1 0 128 0zM88 400v80c0 17.7 14.3 32 32 32s32-14.3 32-32V400h16v80c0 17.7 14.3 32 32 32s32-14.3 32-32V400h17.8c10.9 0 18.6-10.7 15.2-21.1l-31.1-93.4 28.6 37.8c10.7 14.1 30.8 16.8 44.8 6.2s16.8-30.7 6.2-44.8L254.6 207c-22.4-29.6-57.5-47-94.6-47s-72.2 17.4-94.6 47L6.5 284.7c-10.7 14.1-7.9 34.2 6.2 44.8s34.2 7.9 44.8-6.2l28.7-37.8L55 378.9C51.6 389.3 59.3 400 70.2 400H88z"]
            }, CX = {
              prefix: "fas",
              iconName: "users-between-lines",
              icon: [640, 512, [], "e591", "M0 24C0 10.7 10.7 0 24 0H616c13.3 0 24 10.7 24 24s-10.7 24-24 24H24C10.7 48 0 37.3 0 24zM0 488c0-13.3 10.7-24 24-24H616c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24zM83.2 160a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM32 320c0-35.3 28.7-64 64-64h96c12.2 0 23.7 3.4 33.4 9.4c-37.2 15.1-65.6 47.2-75.8 86.6H64c-17.7 0-32-14.3-32-32zm461.6 32c-10.3-40.1-39.6-72.6-77.7-87.4c9.4-5.5 20.4-8.6 32.1-8.6h96c35.3 0 64 28.7 64 64c0 17.7-14.3 32-32 32H493.6zM391.2 290.4c32.1 7.4 58.1 30.9 68.9 61.6c3.5 10 5.5 20.8 5.5 32c0 17.7-14.3 32-32 32h-224c-17.7 0-32-14.3-32-32c0-11.2 1.9-22 5.5-32c10.5-29.7 35.3-52.8 66.1-60.9c7.8-2.1 16-3.1 24.5-3.1h96c7.4 0 14.7 .8 21.6 2.4zm44-130.4a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM321.6 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
            }, Ib = {
              prefix: "fas",
              iconName: "lungs-virus",
              icon: [640, 512, [], "e067", "M320 0c17.7 0 32 14.3 32 32V156.2c-8.5-7.6-19.7-12.2-32-12.2s-23.5 4.6-32 12.2V32c0-17.7 14.3-32 32-32zM444.5 195.5c-16.4-16.4-41.8-18.5-60.5-6.1V165.3C384 127 415 96 453.3 96c21.7 0 42.8 10.2 55.8 28.8c15.4 22.1 44.3 65.4 71 116.9c26.5 50.9 52.4 112.5 59.6 170.3c.2 1.3 .2 2.6 .2 4v7c0 49.1-39.8 89-89 89c-7.3 0-14.5-.9-21.6-2.7l-72.7-18.2c-20.9-5.2-38.7-17.1-51.5-32.9c14 1.5 28.5-3 39.2-13.8l-22.6-22.6 22.6 22.6c18.7-18.7 18.7-49.1 0-67.9c-1.1-1.1-1.4-2-1.5-2.5c-.1-.8-.1-1.8 .4-2.9s1.2-1.9 1.8-2.3c.5-.3 1.3-.8 2.9-.8c26.5 0 48-21.5 48-48s-21.5-48-48-48c-1.6 0-2.4-.4-2.9-.8c-.6-.4-1.3-1.2-1.8-2.3s-.5-2.2-.4-2.9c.1-.6 .4-1.4 1.5-2.5c18.7-18.7 18.7-49.1 0-67.9zM421.8 421.8c-6.2 6.2-16.4 6.2-22.6 0C375.9 398.5 336 415 336 448c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-33-39.9-49.5-63.2-26.2c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6C241.5 375.9 225 336 192 336c-8.8 0-16-7.2-16-16s7.2-16 16-16c33 0 49.5-39.9 26.2-63.2c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0C264.1 241.5 304 225 304 192c0-8.8 7.2-16 16-16s16 7.2 16 16c0 33 39.9 49.5 63.2 26.2c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6C398.5 264.1 415 304 448 304c8.8 0 16 7.2 16 16s-7.2 16-16 16c-33 0-49.5 39.9-26.2 63.2c6.2 6.2 6.2 16.4 0 22.6zM183.3 491.2l-72.7 18.2c-7.1 1.8-14.3 2.7-21.6 2.7c-49.1 0-89-39.8-89-89v-7c0-1.3 .1-2.7 .2-4c7.2-57.9 33.1-119.4 59.6-170.3c26.8-51.5 55.6-94.8 71-116.9c13-18.6 34-28.8 55.8-28.8C225 96 256 127 256 165.3v24.1c-18.6-12.4-44-10.3-60.5 6.1c-18.7 18.7-18.7 49.1 0 67.9c1.1 1.1 1.4 2 1.5 2.5c.1 .8 .1 1.8-.4 2.9s-1.2 1.9-1.8 2.3c-.5 .3-1.3 .8-2.9 .8c-26.5 0-48 21.5-48 48s21.5 48 48 48c1.6 0 2.4 .4 2.9 .8c.6 .4 1.3 1.2 1.8 2.3s.5 2.2 .4 2.9c-.1 .6-.4 1.4-1.5 2.5c-18.7 18.7-18.7 49.1 0 67.9c10.7 10.7 25.3 15.3 39.2 13.8c-12.8 15.9-30.6 27.7-51.5 32.9zM296 320a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm72 32a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
            }, JP = {
              prefix: "fas",
              iconName: "face-grin-tears",
              icon: [640, 512, [128514, "grin-tears"], "f588", "M548.6 371.4C506.4 454.8 419.9 512 320 512s-186.4-57.2-228.6-140.6c4.5-2.9 8.7-6.3 12.7-10.3c8.1-8.1 13.2-18.6 16.5-26.6c3.6-8.8 6.5-18.4 8.8-27.5c4.6-18.2 7.7-37 9.3-48.2c3.9-26.5-18.8-49.2-45.2-45.4c-6.8 .9-16.2 2.4-26.6 4.4C85.3 94.5 191.6 0 320 0S554.7 94.5 573.2 217.7c-10.3-2-19.8-3.5-26.6-4.4c-26.5-3.9-49.2 18.8-45.2 45.4c1.6 11.3 4.6 30 9.3 48.2c2.3 9.1 5.2 18.8 8.8 27.5c3.3 8.1 8.4 18.5 16.5 26.6c3.9 3.9 8.2 7.4 12.7 10.3zM107 254.1c-3.1 21.5-11.4 70.2-25.5 84.4c-.9 1-1.9 1.8-2.9 2.7C60 356.7 32 355.5 14.3 337.7c-18.7-18.7-19.1-48.8-.7-67.2c8.6-8.6 30.1-15.1 50.5-19.6c13-2.8 25.5-4.8 33.9-6c5.4-.8 9.9 3.7 9 9zm454.5 87.1c-.8-.6-1.5-1.3-2.3-2c-.2-.2-.5-.4-.7-.7c-14.1-14.1-22.5-62.9-25.5-84.4c-.8-5.4 3.7-9.9 9-9c1 .1 2.2 .3 3.3 .5c8.2 1.2 19.2 3 30.6 5.5c20.4 4.4 41.9 10.9 50.5 19.6c18.4 18.4 18 48.5-.7 67.2c-17.7 17.7-45.7 19-64.2 3.4zm-90.1-9.7c5-11.8-7-22.5-19.3-18.7c-39.7 12.2-84.4 19-131.8 19s-92.1-6.8-131.8-19c-12.3-3.8-24.3 6.9-19.3 18.7c25 59.1 83.2 100.5 151.1 100.5s126.2-41.4 151.1-100.5zM281.6 228.8l0 0 0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C190.7 188.4 184 206.1 184 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8l0 0 0 0 0 0 .2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2 0 0zm160 0l0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C350.7 188.4 344 206.1 344 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8l0 0 0 0 0 0 .2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2 0 0 0 0z"]
            }, OX = JP, qB = {
              prefix: "fas",
              iconName: "phone",
              icon: [512, 512, [128222, 128379], "f095", "M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"]
            }, yX = {
              prefix: "fas",
              iconName: "calendar-xmark",
              icon: [512, 512, ["calendar-times"], "f273", "M160 0c17.7 0 32 14.3 32 32V64H320V32c0-17.7 14.3-32 32-32s32 14.3 32 32V64h48c26.5 0 48 21.5 48 48v48H32V112c0-26.5 21.5-48 48-48h48V32c0-17.7 14.3-32 32-32zM32 192H480V464c0 26.5-21.5 48-48 48H80c-26.5 0-48-21.5-48-48V192zM337 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47z"]
            }, Nh = yX, qu = {
              prefix: "fas",
              iconName: "child-reaching",
              icon: [384, 512, [], "e59d", "M256 64A64 64 0 1 0 128 64a64 64 0 1 0 128 0zM152.9 169.3c-23.7-8.4-44.5-24.3-58.8-45.8L74.6 94.2C64.8 79.5 45 75.6 30.2 85.4s-18.7 29.7-8.9 44.4L40.9 159c18.1 27.1 42.8 48.4 71.1 62.4V480c0 17.7 14.3 32 32 32s32-14.3 32-32V384h32v96c0 17.7 14.3 32 32 32s32-14.3 32-32V221.6c29.1-14.2 54.4-36.2 72.7-64.2l18.2-27.9c9.6-14.8 5.4-34.6-9.4-44.3s-34.6-5.5-44.3 9.4L291 122.4c-21.8 33.4-58.9 53.6-98.8 53.6c-12.6 0-24.9-2-36.6-5.8c-.9-.3-1.8-.7-2.7-.9z"]
            }, Qh = {
              prefix: "fas",
              iconName: "head-side-virus",
              icon: [512, 512, [], "e064", "M0 224.2C0 100.6 100.2 0 224 0h24c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8H448v64c0 35.3-28.7 64-64 64H320v32c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V407.3c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zM224 64c-8.8 0-16 7.2-16 16c0 33-39.9 49.5-63.2 26.2c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6C145.5 152.1 129 192 96 192c-8.8 0-16 7.2-16 16s7.2 16 16 16c33 0 49.5 39.9 26.2 63.2c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0C168.1 286.5 208 303 208 336c0 8.8 7.2 16 16 16s16-7.2 16-16c0-33 39.9-49.5 63.2-26.2c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6C302.5 263.9 319 224 352 224c8.8 0 16-7.2 16-16s-7.2-16-16-16c-33 0-49.5-39.9-26.2-63.2c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0C279.9 129.5 240 113 240 80c0-8.8-7.2-16-16-16zm-24 96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40 80a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
            }, M3 = {
              prefix: "fas",
              iconName: "user-gear",
              icon: [640, 512, ["user-cog"], "f4fe", "M224 0a128 128 0 1 1 0 256A128 128 0 1 1 224 0zM178.3 304h91.4c11.8 0 23.4 1.2 34.5 3.3c-2.1 18.5 7.4 35.6 21.8 44.8c-16.6 10.6-26.7 31.6-20 53.3c4 12.9 9.4 25.5 16.4 37.6s15.2 23.1 24.4 33c15.7 16.9 39.6 18.4 57.2 8.7v.9c0 9.2 2.7 18.5 7.9 26.3H29.7C13.3 512 0 498.7 0 482.3C0 383.8 79.8 304 178.3 304zM436 218.2c0-7 4.5-13.3 11.3-14.8c10.5-2.4 21.5-3.7 32.7-3.7s22.2 1.3 32.7 3.7c6.8 1.5 11.3 7.8 11.3 14.8v30.6c7.9 3.4 15.4 7.7 22.3 12.8l24.9-14.3c6.1-3.5 13.7-2.7 18.5 2.4c7.6 8.1 14.3 17.2 20.1 27.2s10.3 20.4 13.5 31c2.1 6.7-1.1 13.7-7.2 17.2l-25 14.4c.4 4 .7 8.1 .7 12.3s-.2 8.2-.7 12.3l25 14.4c6.1 3.5 9.2 10.5 7.2 17.2c-3.3 10.6-7.8 21-13.5 31s-12.5 19.1-20.1 27.2c-4.8 5.1-12.5 5.9-18.5 2.4l-24.9-14.3c-6.9 5.1-14.3 9.4-22.3 12.8l0 30.6c0 7-4.5 13.3-11.3 14.8c-10.5 2.4-21.5 3.7-32.7 3.7s-22.2-1.3-32.7-3.7c-6.8-1.5-11.3-7.8-11.3-14.8V454.8c-8-3.4-15.6-7.7-22.5-12.9l-24.7 14.3c-6.1 3.5-13.7 2.7-18.5-2.4c-7.6-8.1-14.3-17.2-20.1-27.2s-10.3-20.4-13.5-31c-2.1-6.7 1.1-13.7 7.2-17.2l24.8-14.3c-.4-4.1-.7-8.2-.7-12.4s.2-8.3 .7-12.4L343.8 325c-6.1-3.5-9.2-10.5-7.2-17.2c3.3-10.6 7.7-21 13.5-31s12.5-19.1 20.1-27.2c4.8-5.1 12.4-5.9 18.5-2.4l24.8 14.3c6.9-5.1 14.5-9.4 22.5-12.9V218.2zm92.1 133.5a48.1 48.1 0 1 0 -96.1 0 48.1 48.1 0 1 0 96.1 0z"]
            }, vH = M3, bT = {
              prefix: "fas",
              iconName: "arrow-up-1-9",
              icon: [576, 512, ["sort-numeric-up"], "f163", "M450.7 38c8.3 6 13.3 15.7 13.3 26v96h16c17.7 0 32 14.3 32 32s-14.3 32-32 32H432 384c-17.7 0-32-14.3-32-32s14.3-32 32-32h16V108.4l-5.9 2c-16.8 5.6-34.9-3.5-40.5-20.2s3.5-34.9 20.2-40.5l48-16c9.8-3.3 20.5-1.6 28.8 4.4zM160 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L192 146.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V146.3L95.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C142.5 35.8 151 32 160 32zM445.7 364.9A32 32 0 1 0 418.3 307a32 32 0 1 0 27.4 57.9zm-40.7 54.9C369.6 408.4 344 375.2 344 336c0-48.6 39.4-88 88-88s88 39.4 88 88c0 23.5-7.5 46.3-21.5 65.2L449.7 467c-10.5 14.2-30.6 17.2-44.8 6.7s-17.2-30.6-6.7-44.8l6.8-9.2z"]
            }, xT = bT, uH = {
              prefix: "fas",
              iconName: "door-closed",
              icon: [576, 512, [128682], "f52a", "M96 64c0-35.3 28.7-64 64-64H416c35.3 0 64 28.7 64 64V448h64c17.7 0 32 14.3 32 32s-14.3 32-32 32H432 144 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H96V64zM384 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, kX = {
              prefix: "fas",
              iconName: "shield-virus",
              icon: [512, 512, [], "e06c", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM256 112c8.8 0 16 7.2 16 16c0 33 39.9 49.5 63.2 26.2c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6C334.5 200.1 351 240 384 240c8.8 0 16 7.2 16 16s-7.2 16-16 16c-33 0-49.5 39.9-26.2 63.2c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0C311.9 334.5 272 351 272 384c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-33-39.9-49.5-63.2-26.2c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6C177.5 311.9 161 272 128 272c-8.8 0-16-7.2-16-16s7.2-16 16-16c33 0 49.5-39.9 26.2-63.2c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0C200.1 177.5 240 161 240 128c0-8.8 7.2-16 16-16zM232 256a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm72 32a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
            }, Rb = {
              prefix: "fas",
              iconName: "dice-six",
              icon: [448, 512, [9861], "f526", "M0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zm160 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, DT = {
              prefix: "fas",
              iconName: "mosquito-net",
              icon: [640, 512, [], "e52c", "M168.8 462.3c-7.9-4-11.1-13.6-7.2-21.5L192 380.2l0-44.2c0-4.2 1.7-8.3 4.7-11.3L256 265.4V242.2L139.2 344C87.8 395.3 0 358.9 0 286.3c0-41.1 30.6-75.8 71.4-80.9l159.9-23.9-49.6-41.3c-5.1-4.2-7-11.1-4.9-17.4l13.9-41.7-29-58.1c-4-7.9-.7-17.5 7.2-21.5s17.5-.7 21.5 7.2l32 64c1.9 3.8 2.2 8.2 .9 12.2l-12.5 37.6L256 160.5V137.9c0-14.9 10.1-27.3 23.8-31V63.7c0-4.5 3.7-8.2 8.2-8.2s8.2 3.7 8.2 8.2V107c13.7 3.6 23.8 16.1 23.8 31v22.6l45.4-37.8L352.8 85.1c-1.3-4-1-8.4 .9-12.2l32-64c4-7.9 13.6-11.1 21.5-7.2s11.1 13.6 7.2 21.5l-29 58.1 13.9 41.7c2.1 6.2 .1 13.1-4.9 17.4l-49.6 41.3 159.9 23.9c22.5 2.8 41.8 14.6 54.7 31.4c-2.7 2.6-5.2 5.4-7.3 8.6c-8.6-12.9-23.3-21.5-40-21.5s-31.4 8.5-40 21.5c-8.6-12.9-23.3-21.5-40-21.5c-21.7 0-40 14.3-45.9 34.1c-10.7 3.2-19.8 10.1-25.9 19.2l-40.2-35v23.1l32.4 32.4c-.3 2-.4 4.1-.4 6.2c0 16.7 8.5 31.4 21.5 40c-4 2.6-7.5 5.9-10.6 9.5L320 310.6v50c0 17.7-14.3 32-32 32s-32-14.3-32-32v-50l-32 32 0 41.4c0 2.5-.6 4.9-1.7 7.2l-32 64c-4 7.9-13.6 11.1-21.5 7.2zM512 256c8.8 0 16 7.2 16 16v16h48V272c0-8.8 7.2-16 16-16s16 7.2 16 16v16h16c8.8 0 16 7.2 16 16s-7.2 16-16 16H608v48h16c8.8 0 16 7.2 16 16s-7.2 16-16 16H608v48h16c8.8 0 16 7.2 16 16s-7.2 16-16 16H608v16c0 8.8-7.2 16-16 16s-16-7.2-16-16V480H528v16c0 8.8-7.2 16-16 16s-16-7.2-16-16V480H448v16c0 8.8-7.2 16-16 16s-16-7.2-16-16V480H400c-8.8 0-16-7.2-16-16s7.2-16 16-16h16V400H400c-8.8 0-16-7.2-16-16s7.2-16 16-16h16V320H400c-8.8 0-16-7.2-16-16s7.2-16 16-16h16V272c0-8.8 7.2-16 16-16s16 7.2 16 16v16h48V272c0-8.8 7.2-16 16-16zm16 112h48V320H528v48zm0 80h48V400H528v48zM448 320v48h48V320H448zm0 80v48h48V400H448z"]
            }, jT = {
              prefix: "fas",
              iconName: "bridge-water",
              icon: [576, 512, [], "e4ce", "M0 96C0 78.3 14.3 64 32 64H544c17.7 0 32 14.3 32 32v35.6c0 15.7-12.7 28.4-28.4 28.4c-37.3 0-67.6 30.2-67.6 67.6V352.5c-12.9 0-25.8 3.9-36.8 11.7c-18 12.4-40.1 20.3-59.2 20.3h0l0-.5V256c0-53-43-96-96-96s-96 43-96 96V384l0 .5c-19 0-41.2-7.9-59.1-20.3c-11.1-7.8-24-11.7-36.9-11.7V227.6C96 190.2 65.8 160 28.4 160C12.7 160 0 147.3 0 131.6V96zM306.5 389.9C329 405.4 356.5 416 384 416c26.9 0 55.4-10.8 77.4-26.1l0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 469.7 417 480 384 480c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7l0 0C136.7 405.2 165.1 416 192 416c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
            }, Oj = {
              prefix: "fas",
              iconName: "person-booth",
              icon: [576, 512, [], "f756", "M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V192h64V32zm320 0c0-17.7-14.3-32-32-32s-32 14.3-32 32V480c0 17.7 14.3 32 32 32s32-14.3 32-32V32zM224 512c17.7 0 32-14.3 32-32V320H192V480c0 17.7 14.3 32 32 32zM320 0c-9.3 0-18.1 4-24.2 11s-8.8 16.3-7.5 25.5l31.2 218.6L288.6 409.7c-3.5 17.3 7.8 34.2 25.1 37.7s34.2-7.8 37.7-25.1l.7-3.6c1.3 16.4 15.1 29.4 31.9 29.4c17.7 0 32-14.3 32-32c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM112 80A48 48 0 1 0 16 80a48 48 0 1 0 96 0zm0 261.3V269.3l4.7 4.7c9 9 21.2 14.1 33.9 14.1H224c17.7 0 32-14.3 32-32s-14.3-32-32-32H157.3l-41.6-41.6c-14.3-14.3-33.8-22.4-54-22.4C27.6 160 0 187.6 0 221.6v55.7l0 .9V480c0 17.7 14.3 32 32 32s32-14.3 32-32V384l32 42.7V480c0 17.7 14.3 32 32 32s32-14.3 32-32V421.3c0-10.4-3.4-20.5-9.6-28.8L112 341.3z"]
            }, Vb = {
              prefix: "fas",
              iconName: "text-width",
              icon: [448, 512, [], "f035", "M64 128V96H192l0 128H176c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H256l0-128H384v32c0 17.7 14.3 32 32 32s32-14.3 32-32V80c0-26.5-21.5-48-48-48H224 48C21.5 32 0 53.5 0 80v48c0 17.7 14.3 32 32 32s32-14.3 32-32zM9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6V416H320v32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6v32H128V320c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64z"]
            }, Yh = {
              prefix: "fas",
              iconName: "hat-wizard",
              icon: [512, 512, [], "f6e8", "M64 416L168.6 180.7c15.3-34.4 40.3-63.5 72-83.7l146.9-94c3-1.9 6.5-2.9 10-2.9C407.7 0 416 8.3 416 18.6v1.6c0 2.6-.5 5.1-1.4 7.5L354.8 176.9c-1.9 4.7-2.8 9.7-2.8 14.7c0 5.5 1.2 11 3.4 16.1L448 416H240.9l11.8-35.4 40.4-13.5c6.5-2.2 10.9-8.3 10.9-15.2s-4.4-13-10.9-15.2l-40.4-13.5-13.5-40.4C237 276.4 230.9 272 224 272s-13 4.4-15.2 10.9l-13.5 40.4-40.4 13.5C148.4 339 144 345.1 144 352s4.4 13 10.9 15.2l40.4 13.5L207.1 416H64zM279.6 141.5c-1.1-3.3-4.1-5.5-7.6-5.5s-6.5 2.2-7.6 5.5l-6.7 20.2-20.2 6.7c-3.3 1.1-5.5 4.1-5.5 7.6s2.2 6.5 5.5 7.6l20.2 6.7 6.7 20.2c1.1 3.3 4.1 5.5 7.6 5.5s6.5-2.2 7.6-5.5l6.7-20.2 20.2-6.7c3.3-1.1 5.5-4.1 5.5-7.6s-2.2-6.5-5.5-7.6l-20.2-6.7-6.7-20.2zM32 448H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, xv = {
              prefix: "fas",
              iconName: "pen-fancy",
              icon: [512, 512, [128395, 10002], "f5ac", "M373.5 27.1C388.5 9.9 410.2 0 433 0c43.6 0 79 35.4 79 79c0 22.8-9.9 44.6-27.1 59.6L277.7 319l-10.3-10.3-64-64L193 234.3 373.5 27.1zM170.3 256.9l10.4 10.4 64 64 10.4 10.4-19.2 83.4c-3.9 17.1-16.9 30.7-33.8 35.4L24.4 510.3l95.4-95.4c2.6 .7 5.4 1.1 8.3 1.1c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32c0 2.9 .4 5.6 1.1 8.3L1.7 487.6 51.5 310c4.7-16.9 18.3-29.9 35.4-33.8l83.4-19.2z"]
            }, EX = {
              prefix: "fas",
              iconName: "person-digging",
              icon: [576, 512, ["digging"], "f85e", "M208 64a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM9.8 214.8c5.1-12.2 19.1-18 31.4-12.9L60.7 210l22.9-38.1C99.9 144.6 129.3 128 161 128c51.4 0 97 32.9 113.3 81.7l34.6 103.7 79.3 33.1 34.2-45.6c6.4-8.5 16.6-13.3 27.2-12.8s20.3 6.4 25.8 15.5l96 160c5.9 9.9 6.1 22.2 .4 32.2s-16.3 16.2-27.8 16.2H288c-11.1 0-21.4-5.7-27.2-15.2s-6.4-21.2-1.4-31.1l16-32c5.4-10.8 16.5-17.7 28.6-17.7h32l22.5-30L22.8 246.2c-12.2-5.1-18-19.1-12.9-31.4zm82.8 91.8l112 48c11.8 5 19.4 16.6 19.4 29.4v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V405.1l-60.6-26-37 111c-5.6 16.8-23.7 25.8-40.5 20.2S-3.9 486.6 1.6 469.9l48-144 11-33 32 13.7z"]
            }, L3 = EX, lH = {
              prefix: "fas",
              iconName: "trash",
              icon: [448, 512, [], "f1f8", "M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z"]
            }, wT = {
              prefix: "fas",
              iconName: "gauge-simple",
              icon: [512, 512, ["gauge-simple-med", "tachometer-average"], "f629", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm320 96c0-26.9-16.5-49.9-40-59.3V88c0-13.3-10.7-24-24-24s-24 10.7-24 24V292.7c-23.5 9.5-40 32.5-40 59.3c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
            }, zP = wT, Mh = wT, yj = {
              prefix: "fas",
              iconName: "book-medical",
              icon: [448, 512, [], "f7e6", "M0 96C0 43 43 0 96 0H384h32c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32v64c17.7 0 32 14.3 32 32s-14.3 32-32 32H384 96c-53 0-96-43-96-96V96zM64 416c0 17.7 14.3 32 32 32H352V384H96c-17.7 0-32 14.3-32 32zM208 112v48H160c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h48v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V224h48c8.8 0 16-7.2 16-16V176c0-8.8-7.2-16-16-16H272V112c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16z"]
            }, Id = {
              prefix: "fas",
              iconName: "poo",
              icon: [512, 512, [128169], "f2fe", "M268.9 .9c-5.5-.7-11 1.4-14.5 5.7s-4.6 10.1-2.8 15.4c2.8 8.2 4.3 16.9 4.3 26.1c0 44.1-35.7 79.9-79.8 80H160c-35.3 0-64 28.7-64 64c0 19.1 8.4 36.3 21.7 48H104c-39.8 0-72 32.2-72 72c0 23.2 11 43.8 28 57c-34.1 5.7-60 35.3-60 71c0 39.8 32.2 72 72 72H440c39.8 0 72-32.2 72-72c0-35.7-25.9-65.3-60-71c17-13.2 28-33.8 28-57c0-39.8-32.2-72-72-72H394.3c13.3-11.7 21.7-28.9 21.7-48c0-35.3-28.7-64-64-64h-5.5c3.5-10 5.5-20.8 5.5-32c0-48.6-36.2-88.8-83.1-95.1zM192 256a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm64 108.3c0 2.4-.7 4.8-2.2 6.7c-8.2 10.5-39.5 45-93.8 45s-85.6-34.6-93.8-45c-1.5-1.9-2.2-4.3-2.2-6.7c0-6.8 5.5-12.3 12.3-12.3H339.7c6.8 0 12.3 5.5 12.3 12.3z"]
            }, Eo = {
              prefix: "fas",
              iconName: "quote-right",
              icon: [448, 512, [8221, "quote-right-alt"], "f10e", "M448 296c0 66.3-53.7 120-120 120h-8c-17.7 0-32-14.3-32-32s14.3-32 32-32h8c30.9 0 56-25.1 56-56v-8H320c-35.3 0-64-28.7-64-64V160c0-35.3 28.7-64 64-64h64c35.3 0 64 28.7 64 64v32 32 72zm-256 0c0 66.3-53.7 120-120 120H64c-17.7 0-32-14.3-32-32s14.3-32 32-32h8c30.9 0 56-25.1 56-56v-8H64c-35.3 0-64-28.7-64-64V160c0-35.3 28.7-64 64-64h64c35.3 0 64 28.7 64 64v32 32 72z"]
            }, N1 = Eo, ed = {
              prefix: "fas",
              iconName: "shirt",
              icon: [640, 512, [128085, "t-shirt", "tshirt"], "f553", "M211.8 0c7.8 0 14.3 5.7 16.7 13.2C240.8 51.9 277.1 80 320 80s79.2-28.1 91.5-66.8C413.9 5.7 420.4 0 428.2 0h12.6c22.5 0 44.2 7.9 61.5 22.3L628.5 127.4c6.6 5.5 10.7 13.5 11.4 22.1s-2.1 17.1-7.8 23.6l-56 64c-11.4 13.1-31.2 14.6-44.6 3.5L480 197.7V448c0 35.3-28.7 64-64 64H224c-35.3 0-64-28.7-64-64V197.7l-51.5 42.9c-13.3 11.1-33.1 9.6-44.6-3.5l-56-64c-5.7-6.5-8.5-15-7.8-23.6s4.8-16.6 11.4-22.1L137.7 22.3C155 7.9 176.7 0 199.2 0h12.6z"]
            }, ui = ed, Vf = ed, mT = {
              prefix: "fas",
              iconName: "cubes",
              icon: [576, 512, [], "f1b3", "M290.8 48.6l78.4 29.7L288 109.5 206.8 78.3l78.4-29.7c1.8-.7 3.8-.7 5.7 0zM136 92.5V204.7c-1.3 .4-2.6 .8-3.9 1.3l-96 36.4C14.4 250.6 0 271.5 0 294.7V413.9c0 22.2 13.1 42.3 33.5 51.3l96 42.2c14.4 6.3 30.7 6.3 45.1 0L288 457.5l113.5 49.9c14.4 6.3 30.7 6.3 45.1 0l96-42.2c20.3-8.9 33.5-29.1 33.5-51.3V294.7c0-23.3-14.4-44.1-36.1-52.4l-96-36.4c-1.3-.5-2.6-.9-3.9-1.3V92.5c0-23.3-14.4-44.1-36.1-52.4l-96-36.4c-12.8-4.8-26.9-4.8-39.7 0l-96 36.4C150.4 48.4 136 69.3 136 92.5zM392 210.6l-82.4 31.2V152.6L392 121v89.6zM154.8 250.9l78.4 29.7L152 311.7 70.8 280.6l78.4-29.7c1.8-.7 3.8-.7 5.7 0zm18.8 204.4V354.8L256 323.2v95.9l-82.4 36.2zM421.2 250.9c1.8-.7 3.8-.7 5.7 0l78.4 29.7L424 311.7l-81.2-31.1 78.4-29.7zM523.2 421.2l-77.6 34.1V354.8L528 323.2v90.7c0 3.2-1.9 6-4.8 7.3z"]
            }, Lh = {
              prefix: "fas",
              iconName: "divide",
              icon: [448, 512, [10135, 247], "f529", "M272 96a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 320a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM400 288c17.7 0 32-14.3 32-32s-14.3-32-32-32H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H400z"]
            }, kj = {
              prefix: "fas",
              iconName: "tenge-sign",
              icon: [384, 512, [8376, "tenge"], "f7d7", "M0 64C0 46.3 14.3 32 32 32H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64zM0 192c0-17.7 14.3-32 32-32H192 352c17.7 0 32 14.3 32 32s-14.3 32-32 32H224V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V224H32c-17.7 0-32-14.3-32-32z"]
            }, xn = kj, Kh = {
              prefix: "fas",
              iconName: "headphones",
              icon: [512, 512, [127911], "f025", "M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48c-44.2 0-80-35.8-80-80V384 336 288C0 146.6 114.6 32 256 32s256 114.6 256 256v48 48 16c0 44.2-35.8 80-80 80c-26.5 0-48-21.5-48-48V304c0-26.5 21.5-48 48-48c10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80z"]
            }, BT = {
              prefix: "fas",
              iconName: "hands-holding",
              icon: [640, 512, [], "f4c2", "M80 104c0-22.1-17.9-40-40-40S0 81.9 0 104v56 64V325.5c0 25.5 10.1 49.9 28.1 67.9L128 493.3c12 12 28.3 18.7 45.3 18.7H240c26.5 0 48-21.5 48-48V385.1c0-29.7-11.8-58.2-32.8-79.2l-25.3-25.3 0 0-15.2-15.2-32-32c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l32 32 15.2 15.2c11 11 9.2 29.2-3.7 37.8c-9.7 6.5-22.7 5.2-31-3.1L98.7 309.5c-12-12-18.7-28.3-18.7-45.3V224 144 104zm480 0v40 80 40.2c0 17-6.7 33.3-18.7 45.3l-51.1 51.1c-8.3 8.3-21.3 9.6-31 3.1c-12.9-8.6-14.7-26.9-3.7-37.8l15.2-15.2 32-32c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-32 32-15.2 15.2 0 0-25.3 25.3c-21 21-32.8 49.5-32.8 79.2V464c0 26.5 21.5 48 48 48h66.7c17 0 33.3-6.7 45.3-18.7l99.9-99.9c18-18 28.1-42.4 28.1-67.9V224 160 104c0-22.1-17.9-40-40-40s-40 17.9-40 40z"]
            }, GP = {
              prefix: "fas",
              iconName: "hands-clapping",
              icon: [512, 512, [], "e1a8", "M336 16V80c0 8.8-7.2 16-16 16s-16-7.2-16-16V16c0-8.8 7.2-16 16-16s16 7.2 16 16zm-98.7 7.1l32 48c4.9 7.4 2.9 17.3-4.4 22.2s-17.3 2.9-22.2-4.4l-32-48c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4zM135 119c9.4-9.4 24.6-9.4 33.9 0L292.7 242.7c10.1 10.1 27.3 2.9 27.3-11.3V192c0-17.7 14.3-32 32-32s32 14.3 32 32V345.6c0 57.1-30 110-78.9 139.4c-64 38.4-145.8 28.3-198.5-24.4L7 361c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l53 53c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1L23 265c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l93 93c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1L55 185c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l117 117c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1l-93-93c-9.4-9.4-9.4-24.6 0-33.9zM433.1 484.9c-24.2 14.5-50.9 22.1-77.7 23.1c48.1-39.6 76.6-99 76.6-162.4l0-98.1c8.2-.1 16-6.4 16-16V192c0-17.7 14.3-32 32-32s32 14.3 32 32V345.6c0 57.1-30 110-78.9 139.4zM424.9 18.7c7.4 4.9 9.3 14.8 4.4 22.2l-32 48c-4.9 7.4-14.8 9.3-22.2 4.4s-9.3-14.8-4.4-22.2l32-48c4.9-7.4 14.8-9.3 22.2-4.4z"]
            }, ZP = {
              prefix: "fas",
              iconName: "republican",
              icon: [640, 512, [], "f75e", "M0 192C0 103.6 71.6 32 160 32H384c88.4 0 160 71.6 160 160v64H0V192zm415.9-64c-2.4 0-4.7 1.3-5.7 3.4l-12.6 24.6-28.2 4c-2.4 .3-4.4 2-5.2 4.2s-.1 4.7 1.6 6.3l20.4 19.2-4.8 27.1c-.4 2.3 .6 4.7 2.5 6s4.6 1.6 6.7 .5l25.2-12.8 25.2 12.8c2.2 1.1 4.8 .9 6.7-.5s3-3.7 2.5-6l-4.8-27.1L466 170.5c1.7-1.6 2.4-4.1 1.6-6.3s-2.8-3.9-5.2-4.2l-28.2-4-12.6-24.6c-1.1-2.1-3.3-3.4-5.7-3.4zm-138.3 3.4c-1.1-2.1-3.3-3.4-5.7-3.4s-4.7 1.3-5.7 3.4l-12.6 24.6-28.2 4c-2.4 .3-4.4 2-5.2 4.2s-.1 4.7 1.6 6.3l20.4 19.2-4.8 27.1c-.4 2.3 .6 4.7 2.5 6s4.6 1.6 6.7 .5l25.2-12.8 25.2 12.8c2.2 1.1 4.8 .9 6.7-.5s3-3.7 2.5-6l-4.8-27.1L322 170.5c1.7-1.6 2.4-4.1 1.6-6.3s-2.8-3.9-5.2-4.2l-28.2-4-12.6-24.6zM127.9 128c-2.4 0-4.7 1.3-5.7 3.4l-12.6 24.6-28.2 4c-2.4 .3-4.4 2-5.2 4.2s-.1 4.7 1.6 6.3l20.4 19.2-4.8 27.1c-.4 2.3 .6 4.7 2.5 6s4.6 1.6 6.7 .5l25.2-12.8 25.2 12.8c2.2 1.1 4.8 .9 6.7-.5s3-3.7 2.5-6l-4.8-27.1L178 170.5c1.7-1.6 2.4-4.1 1.6-6.3s-2.8-3.9-5.2-4.2l-28.2-4-12.6-24.6c-1.1-2.1-3.3-3.4-5.7-3.4zm.1 160H320h96 32 64 32v32 80c0 8.8 7.2 16 16 16s16-7.2 16-16V352c0-17.7 14.3-32 32-32s32 14.3 32 32v48c0 44.2-35.8 80-80 80s-80-35.8-80-80V352H448v32 64c0 17.7-14.3 32-32 32H352c-17.7 0-32-14.3-32-32V384H128v64c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32V384 288H128z"]
            }, $s = {
              prefix: "fas",
              iconName: "arrow-left",
              icon: [448, 512, [8592], "f060", "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]
            }, eo = {
              prefix: "fas",
              iconName: "person-circle-xmark",
              icon: [576, 512, [], "e543", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V256.9L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6h29.7c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H152zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L432 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L409.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L432 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L454.6 368l36.7-36.7z"]
            }, vf = {
              prefix: "fas",
              iconName: "ruler",
              icon: [512, 512, [128207], "f545", "M177.9 494.1c-18.7 18.7-49.1 18.7-67.9 0L17.9 401.9c-18.7-18.7-18.7-49.1 0-67.9l50.7-50.7 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 50.7-50.7c18.7-18.7 49.1-18.7 67.9 0l92.1 92.1c18.7 18.7 18.7 49.1 0 67.9L177.9 494.1z"]
            }, K3 = {
              prefix: "fas",
              iconName: "align-left",
              icon: [448, 512, [], "f036", "M288 64c0 17.7-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32H256c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H256c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]
            }, Jh = {
              prefix: "fas",
              iconName: "dice-d6",
              icon: [448, 512, [], "f6d1", "M201 10.3c14.3-7.8 31.6-7.8 46 0L422.3 106c5.1 2.8 8.3 8.2 8.3 14s-3.2 11.2-8.3 14L231.7 238c-4.8 2.6-10.5 2.6-15.3 0L25.7 134c-5.1-2.8-8.3-8.2-8.3-14s3.2-11.2 8.3-14L201 10.3zM23.7 170l176 96c5.1 2.8 8.3 8.2 8.3 14V496c0 5.6-3 10.9-7.8 13.8s-10.9 3-15.8 .3L25 423.1C9.6 414.7 0 398.6 0 381V184c0-5.6 3-10.9 7.8-13.8s10.9-3 15.8-.3zm400.7 0c5-2.7 11-2.6 15.8 .3s7.8 8.1 7.8 13.8V381c0 17.6-9.6 33.7-25 42.1L263.7 510c-5 2.7-11 2.6-15.8-.3s-7.8-8.1-7.8-13.8V280c0-5.9 3.2-11.2 8.3-14l176-96z"]
            }, zh = {
              prefix: "fas",
              iconName: "restroom",
              icon: [640, 512, [], "f7bd", "M80 48a48 48 0 1 1 96 0A48 48 0 1 1 80 48zm40 304V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V325.2c-8.1 9.2-21.1 13.2-33.5 9.4c-16.9-5.3-26.3-23.2-21-40.1l30.9-99.1C44.9 155.3 82 128 124 128h8c42 0 79.1 27.3 91.6 67.4l30.9 99.1c5.3 16.9-4.1 34.8-21 40.1c-12.4 3.9-25.4-.2-33.5-9.4V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H120zM320 0c13.3 0 24 10.7 24 24V488c0 13.3-10.7 24-24 24s-24-10.7-24-24V24c0-13.3 10.7-24 24-24zM464 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM440 480V384H422.2c-10.9 0-18.6-10.7-15.2-21.1l9-26.9c-3.2 0-6.4-.5-9.5-1.5c-16.9-5.3-26.3-23.2-21-40.1l29.7-95.2C428.4 156.9 467.6 128 512 128s83.6 28.9 96.8 71.2l29.7 95.2c5.3 16.9-4.1 34.8-21 40.1c-3.2 1-6.4 1.5-9.5 1.5l9 26.9c3.5 10.4-4.3 21.1-15.2 21.1H584v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V384H504v96c0 17.7-14.3 32-32 32s-32-14.3-32-32z"]
            }, Cb = {
              prefix: "fas",
              iconName: "j",
              icon: [320, 512, [106], "4a", "M288 32c17.7 0 32 14.3 32 32V320c0 88.4-71.6 160-160 160S0 408.4 0 320V288c0-17.7 14.3-32 32-32s32 14.3 32 32v32c0 53 43 96 96 96s96-43 96-96V64c0-17.7 14.3-32 32-32z"]
            }, Gh = {
              prefix: "fas",
              iconName: "users-viewfinder",
              icon: [640, 512, [], "e595", "M48 48h88c13.3 0 24-10.7 24-24s-10.7-24-24-24H32C14.3 0 0 14.3 0 32V136c0 13.3 10.7 24 24 24s24-10.7 24-24V48zM175.8 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-26.5 32C119.9 256 96 279.9 96 309.3c0 14.7 11.9 26.7 26.7 26.7h56.1c8-34.1 32.8-61.7 65.2-73.6c-7.5-4.1-16.2-6.4-25.3-6.4H149.3zm368 80c14.7 0 26.7-11.9 26.7-26.7c0-29.5-23.9-53.3-53.3-53.3H421.3c-9.2 0-17.8 2.3-25.3 6.4c32.4 11.9 57.2 39.5 65.2 73.6h56.1zm-89.4 0c-8.6-24.3-29.9-42.6-55.9-47c-3.9-.7-7.9-1-12-1H280c-4.1 0-8.1 .3-12 1c-26 4.4-47.3 22.7-55.9 47c-2.7 7.5-4.1 15.6-4.1 24c0 13.3 10.7 24 24 24H408c13.3 0 24-10.7 24-24c0-8.4-1.4-16.5-4.1-24zM464 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-80-32a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM504 48h88v88c0 13.3 10.7 24 24 24s24-10.7 24-24V32c0-17.7-14.3-32-32-32H504c-13.3 0-24 10.7-24 24s10.7 24 24 24zM48 464V376c0-13.3-10.7-24-24-24s-24 10.7-24 24V480c0 17.7 14.3 32 32 32H136c13.3 0 24-10.7 24-24s-10.7-24-24-24H48zm456 0c-13.3 0-24 10.7-24 24s10.7 24 24 24H608c17.7 0 32-14.3 32-32V376c0-13.3-10.7-24-24-24s-24 10.7-24 24v88H504z"]
            }, ur = {
              prefix: "fas",
              iconName: "file-video",
              icon: [384, 512, [], "f1c8", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM64 288c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V288zM300.9 397.9L256 368V304l44.9-29.9c2-1.3 4.4-2.1 6.8-2.1c6.8 0 12.3 5.5 12.3 12.3V387.7c0 6.8-5.5 12.3-12.3 12.3c-2.4 0-4.8-.7-6.8-2.1z"]
            }, z6 = {
              prefix: "fas",
              iconName: "up-right-from-square",
              icon: [512, 512, ["external-link-alt"], "f35d", "M352 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9L370.7 96 201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 141.3l41.4 41.4c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6V32c0-17.7-14.3-32-32-32H352zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"]
            }, uf = z6, WT = {
              prefix: "fas",
              iconName: "table-cells",
              icon: [512, 512, ["th"], "f00a", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm88 64v64H64V96h88zm56 0h88v64H208V96zm240 0v64H360V96h88zM64 224h88v64H64V224zm232 0v64H208V224h88zm64 0h88v64H360V224zM152 352v64H64V352h88zm56 0h88v64H208V352zm240 0v64H360V352h88z"]
            }, aa = WT, un = {
              prefix: "fas",
              iconName: "file-pdf",
              icon: [512, 512, [], "f1c1", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V304H176c-35.3 0-64 28.7-64 64V512H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM176 352h32c30.9 0 56 25.1 56 56s-25.1 56-56 56H192v32c0 8.8-7.2 16-16 16s-16-7.2-16-16V448 368c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24H192v48h16zm96-80h32c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48H304c-8.8 0-16-7.2-16-16V368c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H320v96h16zm80-112c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16s-7.2 16-16 16H448v32h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H448v48c0 8.8-7.2 16-16 16s-16-7.2-16-16V432 368z"]
            }, J3 = {
              prefix: "fas",
              iconName: "book-bible",
              icon: [448, 512, ["bible"], "f647", "M96 0C43 0 0 43 0 96V416c0 53 43 96 96 96H384h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V384c17.7 0 32-14.3 32-32V32c0-17.7-14.3-32-32-32H384 96zm0 384H352v64H96c-17.7 0-32-14.3-32-32s14.3-32 32-32zM208 80c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v48h48c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272V304c0 8.8-7.2 16-16 16H224c-8.8 0-16-7.2-16-16V192H160c-8.8 0-16-7.2-16-16V144c0-8.8 7.2-16 16-16h48V80z"]
            }, Ob = J3, G6 = {
              prefix: "fas",
              iconName: "o",
              icon: [448, 512, [111], "4f", "M224 96a160 160 0 1 0 0 320 160 160 0 1 0 0-320zM448 256A224 224 0 1 1 0 256a224 224 0 1 1 448 0z"]
            }, ST = {
              prefix: "fas",
              iconName: "suitcase-medical",
              icon: [512, 512, ["medkit"], "f0fa", "M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96v32V480H384V128 96 56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM96 96H64C28.7 96 0 124.7 0 160V416c0 35.3 28.7 64 64 64H96V96zM416 480h32c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H416V480zM224 208c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v48h48c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H288v48c0 8.8-7.2 16-16 16H240c-8.8 0-16-7.2-16-16V320H176c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16h48V208z"]
            }, PH = ST, cH = {
              prefix: "fas",
              iconName: "user-secret",
              icon: [448, 512, [128373], "f21b", "M224 16c-6.7 0-10.8-2.8-15.5-6.1C201.9 5.4 194 0 176 0c-30.5 0-52 43.7-66 89.4C62.7 98.1 32 112.2 32 128c0 14.3 25 27.1 64.6 35.9c-.4 4-.6 8-.6 12.1c0 17 3.3 33.2 9.3 48H45.4C38 224 32 230 32 237.4c0 1.7 .3 3.4 1 5l38.8 96.9C28.2 371.8 0 423.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7c0-58.5-28.2-110.4-71.7-143L415 242.4c.6-1.6 1-3.3 1-5c0-7.4-6-13.4-13.4-13.4H342.7c6-14.8 9.3-31 9.3-48c0-4.1-.2-8.1-.6-12.1C391 155.1 416 142.3 416 128c0-15.8-30.7-29.9-78-38.6C324 43.7 302.5 0 272 0c-18 0-25.9 5.4-32.5 9.9c-4.8 3.3-8.8 6.1-15.5 6.1zm56 208H267.6c-16.5 0-31.1-10.6-36.3-26.2c-2.3-7-12.2-7-14.5 0c-5.2 15.6-19.9 26.2-36.3 26.2H168c-22.1 0-40-17.9-40-40V169.6c28.2 4.1 61 6.4 96 6.4s67.8-2.3 96-6.4V184c0 22.1-17.9 40-40 40zm-88 96l16 32L176 480 128 288l64 32zm128-32L272 480 240 352l16-32 64-32z"]
            }, yb = {
              prefix: "fas",
              iconName: "otter",
              icon: [640, 512, [129446], "f700", "M181.5 197.1l12.9 6.4c5.9 3 12.4 4.5 19.1 4.5c23.5 0 42.6-19.1 42.6-42.6V144c0-35.3-28.7-64-64-64H128c-35.3 0-64 28.7-64 64v21.4c0 23.5 19.1 42.6 42.6 42.6c6.6 0 13.1-1.5 19.1-4.5l12.9-6.4 8.4-4.2L135.1 185c-4.5-3-7.1-8-7.1-13.3V168c0-13.3 10.7-24 24-24h16c13.3 0 24 10.7 24 24v3.7c0 5.3-2.7 10.3-7.1 13.3l-11.8 7.9 8.4 4.2zm-8.6 49.4L160 240l-12.9 6.4c-12.6 6.3-26.5 9.6-40.5 9.6c-3.6 0-7.1-.2-10.6-.6v.6c0 35.3 28.7 64 64 64h64c17.7 0 32 14.3 32 32s-14.3 32-32 32H384V336 320c0-23.7 12.9-44.4 32-55.4c9.4-5.4 20.3-8.6 32-8.6V240c0-26.5 21.5-48 48-48c8.8 0 16 7.2 16 16v32 16 48c0 8.8 7.2 16 16 16s16-7.2 16-16V204.3c0-48.2-30.8-91-76.6-106.3l-8.5-2.8c-8-2.7-12.6-11.1-10.4-19.3s10.3-13.2 18.6-11.6l19.9 4C576 86.1 640 164.2 640 254.9l0 1.1h0c0 123.7-100.3 224-224 224h-1.1H256h-.6C132 480 32 380 32 256.6V256 216.8c-10.1-14.6-16-32.3-16-51.4V144l0-1.4C6.7 139.3 0 130.5 0 120c0-13.3 10.7-24 24-24h2.8C44.8 58.2 83.3 32 128 32h64c44.7 0 83.2 26.2 101.2 64H296c13.3 0 24 10.7 24 24c0 10.5-6.7 19.3-16 22.6l0 1.4v21.4c0 1.4 0 2.8-.1 4.3c12-6.2 25.7-9.6 40.1-9.6h8c17.7 0 32 14.3 32 32s-14.3 32-32 32h-8c-13.3 0-24 10.7-24 24v8h56.4c-15.2 17-24.4 39.4-24.4 64H320c-42.3 0-78.2-27.4-91-65.3c-5.1 .9-10.3 1.3-15.6 1.3c-14.1 0-27.9-3.3-40.5-9.6zM96 128a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm112 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
            }, FX = {
              prefix: "fas",
              iconName: "person-dress",
              icon: [320, 512, ["female"], "f182", "M160 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM88 384H70.2c-10.9 0-18.6-10.7-15.2-21.1L93.3 248.1 59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l53.6-89.2c20.3-33.7 56.7-54.3 96-54.3h11.6c39.3 0 75.7 20.6 96 54.3l53.6 89.2c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9l-33.9-56.3L265 362.9c3.5 10.4-4.3 21.1-15.2 21.1H232v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V384H152v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V384z"]
            }, bu = FX, td = {
              prefix: "fas",
              iconName: "comment-dollar",
              icon: [512, 512, [], "f651", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3 0 0 0 0 0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zm20-312v13.9c7.5 1.2 14.6 2.9 21.1 4.7c10.7 2.8 17 13.8 14.2 24.5s-13.8 17-24.5 14.2c-11-2.9-21.6-5-31.2-5.2c-7.9-.1-16 1.8-21.5 5c-4.8 2.8-6.2 5.6-6.2 9.3c0 1.8 .1 3.5 5.3 6.7c6.3 3.8 15.5 6.7 28.3 10.5l.7 .2c11.2 3.4 25.6 7.7 37.1 15c12.9 8.1 24.3 21.3 24.6 41.6c.3 20.9-10.5 36.1-24.8 45c-7.2 4.5-15.2 7.3-23.2 9V344c0 11-9 20-20 20s-20-9-20-20V329.4c-10.3-2.2-20-5.5-28.2-8.4l0 0 0 0c-2.1-.7-4.1-1.4-6.1-2.1c-10.5-3.5-16.1-14.8-12.6-25.3s14.8-16.1 25.3-12.6c2.5 .8 4.9 1.7 7.2 2.4c13.6 4.6 24 8.1 35.1 8.5c8.6 .3 16.5-1.6 21.4-4.7c4.1-2.5 6-5.5 5.9-10.5c0-2.9-.8-5-5.9-8.2c-6.3-4-15.4-6.9-28-10.7l-1.7-.5c-10.9-3.3-24.6-7.4-35.6-14c-12.7-7.7-24.6-20.5-24.7-40.7c-.1-21.1 11.8-35.7 25.8-43.9c6.9-4.1 14.5-6.8 22.2-8.5V136c0-11 9-20 20-20s20 9 20 20z"]
            }, UT = {
              prefix: "fas",
              iconName: "business-time",
              icon: [640, 512, ["briefcase-clock"], "f64a", "M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 352h8.2c32.3-39.1 81.1-64 135.8-64c5.4 0 10.7 .2 16 .7V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM320 352H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H360.2C335.1 449.6 320 410.5 320 368c0-5.4 .2-10.7 .7-16l-.7 0zm320 16a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM496 288c8.8 0 16 7.2 16 16v48h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H496c-8.8 0-16-7.2-16-16V304c0-8.8 7.2-16 16-16z"]
            }, kb = UT, IT = {
              prefix: "fas",
              iconName: "table-cells-large",
              icon: [512, 512, ["th-large"], "f009", "M448 96V224H288V96H448zm0 192V416H288V288H448zM224 224H64V96H224V224zM64 288H224V416H64V288zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"]
            }, Eb = IT, RT = {
              prefix: "fas",
              iconName: "book-tanakh",
              icon: [448, 512, ["tanakh"], "f827", "M352 0c53 0 96 43 96 96V416c0 53-43 96-96 96H64 32c-17.7 0-32-14.3-32-32s14.3-32 32-32V384c-17.7 0-32-14.3-32-32V32C0 14.3 14.3 0 32 0H64 352zm0 384H96v64H352c17.7 0 32-14.3 32-32s-14.3-32-32-32zM138.7 208l13.9 24H124.9l13.9-24zm-13.9-24L97.1 232c-6.2 10.7 1.5 24 13.9 24h55.4l27.7 48c6.2 10.7 21.6 10.7 27.7 0l27.7-48H305c12.3 0 20-13.3 13.9-24l-27.7-48 27.7-48c6.2-10.7-1.5-24-13.9-24H249.6L221.9 64c-6.2-10.7-21.6-10.7-27.7 0l-27.7 48H111c-12.3 0-20 13.3-13.9 24l27.7 48zm27.7 0l27.7-48h55.4l27.7 48-27.7 48H180.3l-27.7-48zm0-48l-13.9 24-13.9-24h27.7zm41.6-24L208 88l13.9 24H194.1zm69.3 24h27.7l-13.9 24-13.9-24zm13.9 72l13.9 24H263.4l13.9-24zm-55.4 48L208 280l-13.9-24h27.7z"]
            }, wU = RT, bB = {
              prefix: "fas",
              iconName: "phone-volume",
              icon: [512, 512, ["volume-control-phone"], "f2a0", "M280 0C408.1 0 512 103.9 512 232c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-101.6-82.4-184-184-184c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm-32-72c0-13.3 10.7-24 24-24c75.1 0 136 60.9 136 136c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-48.6-39.4-88-88-88c-13.3 0-24-10.7-24-24zM117.5 1.4c19.4-5.3 39.7 4.6 47.4 23.2l40 96c6.8 16.3 2.1 35.2-11.6 46.3L144 207.3c33.3 70.4 90.3 127.4 160.7 160.7L345 318.7c11.2-13.7 30-18.4 46.3-11.6l96 40c18.6 7.7 28.5 28 23.2 47.4l-24 88C481.8 499.9 466 512 448 512C200.6 512 0 311.4 0 64C0 46 12.1 30.2 29.5 25.4l88-24z"]
            }, NX = bB, Zh = {
              prefix: "fas",
              iconName: "hat-cowboy-side",
              icon: [640, 512, [], "f8c1", "M152.7 135.9l-10.4 57.2c6.8-.7 13.6-1.1 20.5-1.1h10.7c39.4 0 77.8 12.1 110.1 34.7L562.4 421.8l35.1 24.6c24.4-6 42.5-28.1 42.5-54.4c0-75.8-94.7-126.6-134.6-144.7L474 83.9C468.2 53.8 441.8 32 411.1 32h-2.7c-5.6 0-11.1 .7-16.5 2.2L199.2 85.5c-23.9 6.4-42 26-46.5 50.4zM0 384c0 35.3 28.7 64 64 64H544L265.3 252.9c-26.9-18.8-58.9-28.9-91.8-28.9H162.9c-60.6 0-116 34.2-143.1 88.4L13.5 325C4.6 342.7 0 362.3 0 382.2V384z"]
            }, QX = {
              prefix: "fas",
              iconName: "clipboard-user",
              icon: [384, 512, [], "f7f3", "M192 0c-41.8 0-77.4 26.7-90.5 64H64C28.7 64 0 92.7 0 128V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H282.5C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM128 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM80 432c0-44.2 35.8-80 80-80h64c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16z"]
            }, Fb = {
              prefix: "fas",
              iconName: "child",
              icon: [320, 512, [], "f1ae", "M96 64a64 64 0 1 1 128 0A64 64 0 1 1 96 64zm48 320v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V287.8L59.1 321c-9.4 15-29.2 19.4-44.1 10S-4.5 301.9 4.9 287l39.9-63.3C69.7 184 113.2 160 160 160s90.3 24 115.2 63.6L315.1 287c9.4 15 4.9 34.7-10 44.1s-34.7 4.9-44.1-10L240 287.8V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V384H144z"]
            }, Ej = {
              prefix: "fas",
              iconName: "lira-sign",
              icon: [320, 512, [8356], "f195", "M112 160.4c0-35.5 28.8-64.4 64.4-64.4c6.9 0 13.8 1.1 20.4 3.3l81.2 27.1c16.8 5.6 34.9-3.5 40.5-20.2s-3.5-34.9-20.2-40.5L217 38.6c-13.1-4.4-26.8-6.6-40.6-6.6C105.5 32 48 89.5 48 160.4V192H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H48v32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H46c-2.2 10.5-6.1 20.6-11.7 29.9L4.6 431.5c-5.9 9.9-6.1 22.2-.4 32.2S20.5 480 32 480H288c17.7 0 32-14.3 32-32s-14.3-32-32-32H88.5l.7-1.1c11.6-19.3 18.9-40.7 21.6-62.9H224c17.7 0 32-14.3 32-32s-14.3-32-32-32H112V256H224c17.7 0 32-14.3 32-32s-14.3-32-32-32H112V160.4z"]
            }, Nb = {
              prefix: "fas",
              iconName: "satellite",
              icon: [512, 512, [128752], "f7bf", "M233 7c-9.4-9.4-24.6-9.4-33.9 0l-96 96c-9.4 9.4-9.4 24.6 0 33.9l89.4 89.4-15.5 15.5C152.3 230.4 124.9 224 96 224c-31.7 0-61.5 7.7-87.8 21.2c-9 4.7-10.3 16.7-3.1 23.8L112.7 376.7 96.3 393.1c-2.6-.7-5.4-1.1-8.3-1.1c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32c0-2.9-.4-5.6-1.1-8.3l16.4-16.4L242.9 506.9c7.2 7.2 19.2 5.9 23.8-3.1C280.3 477.5 288 447.7 288 416c0-28.9-6.4-56.3-17.8-80.9l15.5-15.5L375 409c9.4 9.4 24.6 9.4 33.9 0l96-96c9.4-9.4 9.4-24.6 0-33.9l-89.4-89.4 55-55c12.5-12.5 12.5-32.8 0-45.3l-48-48c-12.5-12.5-32.8-12.5-45.3 0l-55 55L233 7zm159 351l-72.4-72.4 62.1-62.1L454.1 296 392 358.1zM226.3 192.4L153.9 120 216 57.9l72.4 72.4-62.1 62.1z"]
            }, Qb = {
              prefix: "fas",
              iconName: "plane-lock",
              icon: [640, 512, [], "e558", "M192 93.7C192 59.5 221 0 256 0c36 0 64 59.5 64 93.7v84.6l101.8 58.2C418 247.6 416 259.6 416 272v24.6c-17.9 10.4-30.3 29.1-31.8 50.9L320 329.1V400l57.6 43.2c4 3 6.4 7.8 6.4 12.8v24 18c0 7.8-6.3 14-14 14c-1.3 0-2.6-.2-3.9-.5L256 480 145.9 511.5c-1.3 .4-2.6 .5-3.9 .5c-7.8 0-14-6.3-14-14V456c0-5 2.4-9.8 6.4-12.8L192 400l0-70.9-171.6 49C10.2 381.1 0 373.4 0 362.8V297.3c0-5.7 3.1-11 8.1-13.9L192 178.3V93.7zM528 240c-17.7 0-32 14.3-32 32v48h64V272c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80v48c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32H448c-17.7 0-32-14.3-32-32V352c0-17.7 14.3-32 32-32V272z"]
            }, VT = {
              prefix: "fas",
              iconName: "tag",
              icon: [448, 512, [127991], "f02b", "M0 80V229.5c0 17 6.7 33.3 18.7 45.3l176 176c25 25 65.5 25 90.5 0L418.7 317.3c25-25 25-65.5 0-90.5l-176-176c-12-12-28.3-18.7-45.3-18.7H48C21.5 32 0 53.5 0 80zm112 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, CT = {
              prefix: "fas",
              iconName: "comment",
              icon: [512, 512, [128489, 61669], "f075", "M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4l0 0 0 0 0 0 0 0 .3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"]
            }, pH = {
              prefix: "fas",
              iconName: "cake-candles",
              icon: [448, 512, [127874, "birthday-cake", "cake"], "f1fd", "M86.4 5.5L61.8 47.6C58 54.1 56 61.6 56 69.2V72c0 22.1 17.9 40 40 40s40-17.9 40-40V69.2c0-7.6-2-15-5.8-21.6L105.6 5.5C103.6 2.1 100 0 96 0s-7.6 2.1-9.6 5.5zm128 0L189.8 47.6c-3.8 6.5-5.8 14-5.8 21.6V72c0 22.1 17.9 40 40 40s40-17.9 40-40V69.2c0-7.6-2-15-5.8-21.6L233.6 5.5C231.6 2.1 228 0 224 0s-7.6 2.1-9.6 5.5zM317.8 47.6c-3.8 6.5-5.8 14-5.8 21.6V72c0 22.1 17.9 40 40 40s40-17.9 40-40V69.2c0-7.6-2-15-5.8-21.6L361.6 5.5C359.6 2.1 356 0 352 0s-7.6 2.1-9.6 5.5L317.8 47.6zM128 176c0-17.7-14.3-32-32-32s-32 14.3-32 32v48c-35.3 0-64 28.7-64 64v71c8.3 5.2 18.1 9 28.8 9c13.5 0 27.2-6.1 38.4-13.4c5.4-3.5 9.9-7.1 13-9.7c1.5-1.3 2.7-2.4 3.5-3.1c.4-.4 .7-.6 .8-.8l.1-.1 0 0 0 0s0 0 0 0s0 0 0 0c3.1-3.2 7.4-4.9 11.9-4.8s8.6 2.1 11.6 5.4l0 0 0 0 .1 .1c.1 .1 .4 .4 .7 .7c.7 .7 1.7 1.7 3.1 3c2.8 2.6 6.8 6.1 11.8 9.5c10.2 7.1 23 13.1 36.3 13.1s26.1-6 36.3-13.1c5-3.5 9-6.9 11.8-9.5c1.4-1.3 2.4-2.3 3.1-3c.3-.3 .6-.6 .7-.7l.1-.1c3-3.5 7.4-5.4 12-5.4s9 2 12 5.4l.1 .1c.1 .1 .4 .4 .7 .7c.7 .7 1.7 1.7 3.1 3c2.8 2.6 6.8 6.1 11.8 9.5c10.2 7.1 23 13.1 36.3 13.1s26.1-6 36.3-13.1c5-3.5 9-6.9 11.8-9.5c1.4-1.3 2.4-2.3 3.1-3c.3-.3 .6-.6 .7-.7l.1-.1c2.9-3.4 7.1-5.3 11.6-5.4s8.7 1.6 11.9 4.8l0 0 0 0 0 0 .1 .1c.2 .2 .4 .4 .8 .8c.8 .7 1.9 1.8 3.5 3.1c3.1 2.6 7.5 6.2 13 9.7c11.2 7.3 24.9 13.4 38.4 13.4c10.7 0 20.5-3.9 28.8-9V288c0-35.3-28.7-64-64-64V176c0-17.7-14.3-32-32-32s-32 14.3-32 32v48H256V176c0-17.7-14.3-32-32-32s-32 14.3-32 32v48H128V176zM448 394.6c-8.5 3.3-18.2 5.4-28.8 5.4c-22.5 0-42.4-9.9-55.8-18.6c-4.1-2.7-7.8-5.4-10.9-7.8c-2.8 2.4-6.1 5-9.8 7.5C329.8 390 310.6 400 288 400s-41.8-10-54.6-18.9c-3.5-2.4-6.7-4.9-9.4-7.2c-2.7 2.3-5.9 4.7-9.4 7.2C201.8 390 182.6 400 160 400s-41.8-10-54.6-18.9c-3.7-2.6-7-5.2-9.8-7.5c-3.1 2.4-6.8 5.1-10.9 7.8C71.2 390.1 51.3 400 28.8 400c-10.6 0-20.3-2.2-28.8-5.4V480c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32V394.6z"]
            }, hH = pH, OT = pH, YX = {
              prefix: "fas",
              iconName: "envelope",
              icon: [512, 512, [128386, 9993, 61443], "f0e0", "M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"]
            }, HH = {
              prefix: "fas",
              iconName: "angles-up",
              icon: [448, 512, ["angle-double-up"], "f102", "M246.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L224 109.3 361.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160zm160 352l-160-160c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L224 301.3 361.4 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3z"]
            }, yT = HH, kT = {
              prefix: "fas",
              iconName: "paperclip",
              icon: [448, 512, [128206], "f0c6", "M364.2 83.8c-24.4-24.4-64-24.4-88.4 0l-184 184c-42.1 42.1-42.1 110.3 0 152.4s110.3 42.1 152.4 0l152-152c10.9-10.9 28.7-10.9 39.6 0s10.9 28.7 0 39.6l-152 152c-64 64-167.6 64-231.6 0s-64-167.6 0-231.6l184-184c46.3-46.3 121.3-46.3 167.6 0s46.3 121.3 0 167.6l-176 176c-28.6 28.6-75 28.6-103.6 0s-28.6-75 0-103.6l144-144c10.9-10.9 28.7-10.9 39.6 0s10.9 28.7 0 39.6l-144 144c-6.7 6.7-6.7 17.7 0 24.4s17.7 6.7 24.4 0l176-176c24.4-24.4 24.4-64 0-88.4z"]
            }, MX = {
              prefix: "fas",
              iconName: "arrow-right-to-city",
              icon: [640, 512, [], "e4b3", "M288 48c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48V192h40V120c0-13.3 10.7-24 24-24s24 10.7 24 24v72h24c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H432 336c-26.5 0-48-21.5-48-48V48zm64 32v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16zm16 80c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V176c0-8.8-7.2-16-16-16H368zM352 272v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16zm176-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H528zM512 368v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H528c-8.8 0-16 7.2-16 16zM166.6 153.4l80 80c12.5 12.5 12.5 32.8 0 45.3l-80 80c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L146.7 288H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H146.7l-25.4-25.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0z"]
            }, ET = {
              prefix: "fas",
              iconName: "ribbon",
              icon: [448, 512, [127895], "f4d6", "M333.2 322.8l0 0-133.9-146 0 0L146 118.6c7.8-5.1 37-22.6 78-22.6s70.2 17.4 78 22.6L245.7 180l85.6 93.4 27.4-29.8c16.3-17.7 25.3-40.9 25.3-65V149.1c0-19-5.6-37.5-16.1-53.3L327.8 35.6C312.9 13.4 287.9 0 261.2 0h-76c-25.8 0-50.1 12.5-65.1 33.5L81.9 87C70.3 103.2 64 122.8 64 142.8V164c0 23.2 8.4 45.6 23.6 63.1l56 64.2 0 0 83.3 95.6 0 0 91.8 105.3c10 11.5 26.8 14.3 40 6.8l54.5-31.1c17.8-10.2 21.6-34.3 7.7-49.4l-87.7-95.7zM205.2 410.6l-83.3-95.6L27.1 418.5c-13.9 15.1-10.1 39.2 7.7 49.4l55.1 31.5c13 7.4 29.3 4.9 39.4-6.1l75.9-82.6z"]
            }, FT = {
              prefix: "fas",
              iconName: "lungs",
              icon: [640, 512, [129729], "f604", "M320 0c17.7 0 32 14.3 32 32V164.1c0 16.4 8.4 31.7 22.2 40.5l9.8 6.2V165.3C384 127 415 96 453.3 96c21.7 0 42.8 10.2 55.8 28.8c15.4 22.1 44.3 65.4 71 116.9c26.5 50.9 52.4 112.5 59.6 170.3c.2 1.3 .2 2.6 .2 4v7c0 49.1-39.8 89-89 89c-7.3 0-14.5-.9-21.6-2.7l-72.7-18.2C414 480.5 384 442.1 384 398V325l90.5 57.6c7.5 4.7 17.3 2.5 22.1-4.9s2.5-17.3-4.9-22.1L384 287.1v-.4l-44.1-28.1c-7.3-4.6-13.9-10.1-19.9-16.1c-5.9 6-12.6 11.5-19.9 16.1L256 286.7 161.2 347l-13.5 8.6c0 0 0 0-.1 0c-7.4 4.8-9.6 14.6-4.8 22.1c4.7 7.5 14.6 9.7 22.1 4.9l91.1-58V398c0 44.1-30 82.5-72.7 93.1l-72.7 18.2c-7.1 1.8-14.3 2.7-21.6 2.7c-49.1 0-89-39.8-89-89v-7c0-1.3 .1-2.7 .2-4c7.2-57.9 33.1-119.4 59.6-170.3c26.8-51.5 55.6-94.8 71-116.9c13-18.6 34-28.8 55.8-28.8C225 96 256 127 256 165.3v45.5l9.8-6.2c13.8-8.8 22.2-24.1 22.2-40.5V32c0-17.7 14.3-32 32-32z"]
            }, gH = {
              prefix: "fas",
              iconName: "arrow-up-9-1",
              icon: [576, 512, ["sort-numeric-up-alt"], "f887", "M160 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L192 146.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V146.3L95.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C142.5 35.8 151 32 160 32zM450.7 294c8.3 6 13.3 15.7 13.3 26v96h16c17.7 0 32 14.3 32 32s-14.3 32-32 32H432 384c-17.7 0-32-14.3-32-32s14.3-32 32-32h16V364.4l-5.9 2c-16.8 5.6-34.9-3.5-40.5-20.2s3.5-34.9 20.2-40.5l48-16c9.8-3.3 20.5-1.6 28.8 4.4zm-5-145.1A32 32 0 1 0 418.3 91a32 32 0 1 0 27.4 57.9zm-40.7 54.9C369.6 192.4 344 159.2 344 120c0-48.6 39.4-88 88-88s88 39.4 88 88c0 23.5-7.5 46.3-21.5 65.2L449.7 251c-10.5 14.2-30.6 17.2-44.8 6.7s-17.2-30.6-6.7-44.8l6.8-9.2z"]
            }, LX = gH, Fj = {
              prefix: "fas",
              iconName: "litecoin-sign",
              icon: [384, 512, [], "e1d3", "M128 64c0-17.7-14.3-32-32-32S64 46.3 64 64V213.6L23.2 225.2c-17 4.9-26.8 22.6-22 39.6s22.6 26.8 39.6 22L64 280.1V448c0 17.7 14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H128V261.9l136.8-39.1c17-4.9 26.8-22.6 22-39.6s-22.6-26.8-39.6-22L128 195.3V64z"]
            }, NT = {
              prefix: "fas",
              iconName: "border-none",
              icon: [448, 512, [], "f850", "M32 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm96-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM320 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-320a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM224 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0-448a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 96a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 288a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm192 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 320a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM416 192a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64z"]
            }, QT = {
              prefix: "fas",
              iconName: "circle-nodes",
              icon: [512, 512, [], "e4e2", "M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9c0-44.2-35.8-80-80-80c-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128c-44.2 0-80 35.8-80 80s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2c0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z"]
            }, Nj = {
              prefix: "fas",
              iconName: "parachute-box",
              icon: [512, 512, [], "f4cd", "M383.5 192c.3-5.3 .5-10.6 .5-16c0-51-15.9-96-40.2-127.6C319.5 16.9 288.2 0 256 0s-63.5 16.9-87.8 48.4C143.9 80 128 125 128 176c0 5.4 .2 10.7 .5 16H240V320H208c-7 0-13.7 1.5-19.7 4.2L68.2 192H96.5c-.3-5.3-.5-10.6-.5-16c0-64 22.2-121.2 57.1-159.3C62 49.3 18.6 122.6 4.2 173.6C1.5 183.1 9 192 18.9 192h6L165.2 346.3c-3.3 6.5-5.2 13.9-5.2 21.7v96c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48V368c0-7.8-1.9-15.2-5.2-21.7L487.1 192h6c9.9 0 17.4-8.9 14.7-18.4C493.4 122.6 450 49.3 358.9 16.7C393.8 54.8 416 112.1 416 176c0 5.4-.2 10.7-.5 16h28.3L323.7 324.2c-6-2.7-12.7-4.2-19.7-4.2H272V192H383.5z"]
            }, YT = {
              prefix: "fas",
              iconName: "indent",
              icon: [448, 512, [], "f03c", "M0 64C0 46.3 14.3 32 32 32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32zm32 96H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3V176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"]
            }, KX = {
              prefix: "fas",
              iconName: "truck-field-un",
              icon: [640, 512, [], "e58e", "M96 32C60.7 32 32 60.7 32 96v32c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32v32c-17.7 0-32 14.3-32 32s14.3 32 32 32H64c0 53 43 96 96 96s96-43 96-96H384c0 53 43 96 96 96s96-43 96-96h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V288c0-35.3-28.7-64-64-64h-4.2c-.4-1.1-.9-2.1-1.3-3.2L485.7 102c-10.3-23.1-33.2-38-58.5-38H375.4C364.4 44.9 343.7 32 320 32H96zm288 96h43.2l42.7 96H384V128zM112 384a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm368-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM253.3 135.1l34.7 52V144c0-8.8 7.2-16 16-16s16 7.2 16 16v96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4l-34.7-52V240c0 8.8-7.2 16-16 16s-16-7.2-16-16V144c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4zM128 144v64c0 8.8 7.2 16 16 16s16-7.2 16-16V144c0-8.8 7.2-16 16-16s16 7.2 16 16v64c0 26.5-21.5 48-48 48s-48-21.5-48-48V144c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
            }, Rd = {
              prefix: "fas",
              iconName: "hourglass",
              icon: [384, 512, [9203, 62032, "hourglass-empty"], "f254", "M0 32C0 14.3 14.3 0 32 0H64 320h32c17.7 0 32 14.3 32 32s-14.3 32-32 32V75c0 42.4-16.9 83.1-46.9 113.1L237.3 256l67.9 67.9c30 30 46.9 70.7 46.9 113.1v11c17.7 0 32 14.3 32 32s-14.3 32-32 32H320 64 32c-17.7 0-32-14.3-32-32s14.3-32 32-32V437c0-42.4 16.9-83.1 46.9-113.1L146.7 256 78.9 188.1C48.9 158.1 32 117.4 32 75V64C14.3 64 0 49.7 0 32zM96 64V75c0 25.5 10.1 49.9 28.1 67.9L192 210.7l67.9-67.9c18-18 28.1-42.4 28.1-67.9V64H96zm0 384H288V437c0-25.5-10.1-49.9-28.1-67.9L192 301.3l-67.9 67.9c-18 18-28.1 42.4-28.1 67.9v11z"]
            }, Yb = Rd, JX = {
              prefix: "fas",
              iconName: "mountain",
              icon: [512, 512, [127956], "f6fc", "M256 32c12.5 0 24.1 6.4 30.8 17L503.4 394.4c5.6 8.9 8.6 19.2 8.6 29.7c0 30.9-25 55.9-55.9 55.9H55.9C25 480 0 455 0 424.1c0-10.5 3-20.8 8.6-29.7L225.2 49c6.6-10.6 18.3-17 30.8-17zm65 192L256 120.4 176.9 246.5l18.3 24.4c6.4 8.5 19.2 8.5 25.6 0l25.6-34.1c6-8.1 15.5-12.8 25.6-12.8h49z"]
            }, _P = {
              prefix: "fas",
              iconName: "user-doctor",
              icon: [448, 512, ["user-md"], "f0f0", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-96 55.2C54 332.9 0 401.3 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7c0-81-54-149.4-128-171.1V362c27.6 7.1 48 32.2 48 62v40c0 8.8-7.2 16-16 16H336c-8.8 0-16-7.2-16-16s7.2-16 16-16V424c0-17.7-14.3-32-32-32s-32 14.3-32 32v24c8.8 0 16 7.2 16 16s-7.2 16-16 16H256c-8.8 0-16-7.2-16-16V424c0-29.8 20.4-54.9 48-62V304.9c-6-.6-12.1-.9-18.3-.9H178.3c-6.2 0-12.3 .3-18.3 .9v65.4c23.1 6.9 40 28.3 40 53.7c0 30.9-25.1 56-56 56s-56-25.1-56-56c0-25.4 16.9-46.8 40-53.7V311.2zM144 448a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
            }, Mb = _P, MT = {
              prefix: "fas",
              iconName: "circle-info",
              icon: [512, 512, ["info-circle"], "f05a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, LT = MT, Qj = {
              prefix: "fas",
              iconName: "cloud-meatball",
              icon: [512, 512, [], "f73b", "M0 224c0 53 43 96 96 96h44.7c9.5-23.5 32.5-40 59.3-40c2 0 3.9 .1 5.8 .3C217.6 265.5 235.7 256 256 256s38.4 9.5 50.2 24.3c1.9-.2 3.9-.3 5.8-.3c26.9 0 49.9 16.5 59.3 40H416c53 0 96-43 96-96s-43-96-96-96c-.5 0-1.1 0-1.6 0c1.1-5.2 1.6-10.5 1.6-16c0-44.2-35.8-80-80-80c-24.3 0-46.1 10.9-60.8 28C256.5 24.3 219.1 0 176 0C114.1 0 64 50.1 64 112c0 7.1 .7 14.1 1.9 20.8C27.6 145.4 0 181.5 0 224zm288 96c0-17.7-14.3-32-32-32s-32 14.3-32 32c0 1 .1 2.1 .1 3.1c-.7-.8-1.4-1.6-2.1-2.3c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3c.7 .7 1.5 1.4 2.3 2.1c-1-.1-2.1-.1-3.1-.1c-17.7 0-32 14.3-32 32s14.3 32 32 32c1 0 2.1-.1 3.1-.1c-.8 .7-1.6 1.3-2.3 2.1c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0c.7-.7 1.4-1.5 2.1-2.3c-.1 1-.1 2.1-.1 3.1c0 17.7 14.3 32 32 32s32-14.3 32-32c0-1-.1-2.1-.1-3.1c.7 .8 1.3 1.6 2.1 2.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3c-.7-.7-1.5-1.4-2.3-2.1c1 .1 2.1 .1 3.1 .1c17.7 0 32-14.3 32-32s-14.3-32-32-32c-1 0-2.1 .1-3.1 .1c.8-.7 1.6-1.3 2.3-2.1c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-.7 .7-1.4 1.5-2.1 2.3c.1-1 .1-2.1 .1-3.1zM48 448a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm416 0a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
            }, zX = {
              prefix: "fas",
              iconName: "camera",
              icon: [512, 512, [62258, "camera-alt"], "f030", "M149.1 64.8L138.7 96H64C28.7 96 0 124.7 0 160V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H373.3L362.9 64.8C356.4 45.2 338.1 32 317.4 32H194.6c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
            }, XH = zX, Lb = {
              prefix: "fas",
              iconName: "square-virus",
              icon: [448, 512, [], "e578", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM223.8 93.7c13.3 0 24 10.7 24 24c0 29.3 35.4 43.9 56.1 23.2c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-20.7 20.7-6 56.1 23.2 56.1c13.3 0 24 10.7 24 24s-10.7 24-24 24c-29.3 0-43.9 35.4-23.2 56.1c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-20.7-20.7-56.1-6-56.1 23.2c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-29.3-35.4-43.9-56.1-23.2c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9c20.7-20.7 6-56.1-23.2-56.1c-13.3 0-24-10.7-24-24s10.7-24 24-24c29.3 0 43.9-35.4 23.2-56.1c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0c20.7 20.7 56.1 6 56.1-23.2c0-13.3 10.7-24 24-24zM192 256a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm88 32a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
            }, Yj = {
              prefix: "fas",
              iconName: "meteor",
              icon: [512, 512, [9732], "f753", "M493.7 .9L299.4 75.6l2.3-29.3c1-12.8-12.8-21.5-24-15.1L101.3 133.4C38.6 169.7 0 236.6 0 309C0 421.1 90.9 512 203 512c72.4 0 139.4-38.6 175.7-101.3L480.8 234.3c6.5-11.1-2.2-25-15.1-24l-29.3 2.3L511.1 18.3c.6-1.5 .9-3.2 .9-4.8C512 6 506 0 498.5 0c-1.7 0-3.3 .3-4.8 .9zM192 192a128 128 0 1 1 0 256 128 128 0 1 1 0-256zm0 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm16 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
            }, Mj = {
              prefix: "fas",
              iconName: "car-on",
              icon: [512, 512, [], "e4dd", "M280 24c0-13.3-10.7-24-24-24s-24 10.7-24 24v80c0 13.3 10.7 24 24 24s24-10.7 24-24V24zM185.8 224H326.2c6.8 0 12.8 4.3 15.1 10.6L360.3 288H151.7l19.1-53.4c2.3-6.4 8.3-10.6 15.1-10.6zm-75.3-10.9L82.2 292.4C62.1 300.9 48 320.8 48 344v40 64 32c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V448H384v32c0 17.7 14.3 32 32 32h16c17.7 0 32-14.3 32-32V448 384 344c0-23.2-14.1-43.1-34.2-51.6l-28.3-79.3C390.1 181.3 360 160 326.2 160H185.8c-33.8 0-64 21.3-75.3 53.1zM128 344a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm232 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM39 39c-9.4 9.4-9.4 24.6 0 33.9l48 48c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L73 39c-9.4-9.4-24.6-9.4-33.9 0zm400 0L391 87c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l48-48c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0z"]
            }, GX = {
              prefix: "fas",
              iconName: "sleigh",
              icon: [640, 512, [], "f7cc", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96V256c0 53 43 96 96 96v32h64V352H384v32h64V352c53 0 96-43 96-96V160c17.7 0 32-14.3 32-32s-14.3-32-32-32H512 480c-17.7 0-32 14.3-32 32v41.3c0 30.2-24.5 54.7-54.7 54.7c-75.5 0-145.6-38.9-185.6-102.9l-4.3-6.9C174.2 67.6 125 37.6 70.7 32.7c-2.2-.5-4.4-.7-6.7-.7H55 32zM640 384c0-17.7-14.3-32-32-32s-32 14.3-32 32v8c0 13.3-10.7 24-24 24H64c-17.7 0-32 14.3-32 32s14.3 32 32 32H552c48.6 0 88-39.4 88-88v-8z"]
            }, TH = {
              prefix: "fas",
              iconName: "arrow-down-1-9",
              icon: [576, 512, ["sort-numeric-asc", "sort-numeric-down"], "f162", "M450.7 38c-8.3-6-19.1-7.7-28.8-4.4l-48 16c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l5.9-2V160H384c-17.7 0-32 14.3-32 32s14.3 32 32 32h48 48c17.7 0 32-14.3 32-32s-14.3-32-32-32H464V64c0-10.3-4.9-19.9-13.3-26zM160 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L192 365.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V365.7L95.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C142.5 476.2 151 480 160 480zM418.3 307a32 32 0 1 1 27.4 57.9A32 32 0 1 1 418.3 307zM405.1 419.8l-6.8 9.2c-10.5 14.2-7.5 34.2 6.7 44.8s34.2 7.5 44.8-6.7l48.8-65.8c14-18.9 21.5-41.7 21.5-65.2c0-48.6-39.4-88-88-88s-88 39.4-88 88c0 39.2 25.6 72.4 61.1 83.8z"]
            }, Kb = TH, xB = TH, KT = {
              prefix: "fas",
              iconName: "hand-holding-droplet",
              icon: [576, 512, ["hand-holding-water"], "f4c1", "M275.5 6.6C278.3 2.5 283 0 288 0s9.7 2.5 12.5 6.6L366.8 103C378 119.3 384 138.6 384 158.3V160c0 53-43 96-96 96s-96-43-96-96v-1.7c0-19.8 6-39 17.2-55.3L275.5 6.6zM568.2 336.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5H192 32c-17.7 0-32-14.3-32-32V416c0-17.7 14.3-32 32-32H68.8l44.9-36c22.7-18.2 50.9-28 80-28H272h16 64c17.7 0 32 14.3 32 32s-14.3 32-32 32H288 272c-8.8 0-16 7.2-16 16s7.2 16 16 16H392.6l119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 384l0 0-.9 0c.3 0 .6 0 .9 0z"]
            }, Jb = KT, Lj = {
              prefix: "fas",
              iconName: "water",
              icon: [576, 512, [], "f773", "M269.5 69.9c11.1-7.9 25.9-7.9 37 0C329 85.4 356.5 96 384 96c26.9 0 55.4-10.8 77.4-26.1l0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 149.7 417 160 384 160c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4C42.8 92.6 61 83.5 75.3 71.6c11.1-9.5 27.3-10.1 39.2-1.7l0 0C136.7 85.2 165.1 96 192 96c27.5 0 55-10.6 77.5-26.1zm37 288C329 373.4 356.5 384 384 384c26.9 0 55.4-10.8 77.4-26.1l0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 437.7 417 448 384 448c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7l0 0C136.7 373.2 165.1 384 192 384c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0zm0-144C329 229.4 356.5 240 384 240c26.9 0 55.4-10.8 77.4-26.1l0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 293.7 417 304 384 304c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.5 27.3-10.1 39.2-1.7l0 0C136.7 229.2 165.1 240 192 240c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
            }, Kj = {
              prefix: "fas",
              iconName: "calendar-check",
              icon: [448, 512, [], "f274", "M128 0c17.7 0 32 14.3 32 32V64H288V32c0-17.7 14.3-32 32-32s32 14.3 32 32V64h48c26.5 0 48 21.5 48 48v48H0V112C0 85.5 21.5 64 48 64H96V32c0-17.7 14.3-32 32-32zM0 192H448V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V192zM329 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-95 95-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L329 305z"]
            }, ZX = {
              prefix: "fas",
              iconName: "braille",
              icon: [640, 512, [], "f2a1", "M0 96a64 64 0 1 1 128 0A64 64 0 1 1 0 96zM224 272a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm0-80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM80 416a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zM0 416a64 64 0 1 1 128 0A64 64 0 1 1 0 416zm240 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM64 192a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM224 32a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM352 96a64 64 0 1 1 128 0A64 64 0 1 1 352 96zm240 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0A64 64 0 1 1 512 96zm64 176a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm0-80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm16 224a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM416 272a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm0-80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm16 224a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"]
            }, zb = {
              prefix: "fas",
              iconName: "prescription-bottle-medical",
              icon: [384, 512, ["prescription-bottle-alt"], "f486", "M0 32C0 14.3 14.3 0 32 0H352c17.7 0 32 14.3 32 32V64c0 17.7-14.3 32-32 32H32C14.3 96 0 81.7 0 64V32zm32 96H352V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zM160 240v48H112c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h48v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V352h48c8.8 0 16-7.2 16-16V304c0-8.8-7.2-16-16-16H224V240c0-8.8-7.2-16-16-16H176c-8.8 0-16 7.2-16 16z"]
            }, Jj = zb, zj = {
              prefix: "fas",
              iconName: "landmark",
              icon: [512, 512, [127963], "f66f", "M240.1 4.2c9.8-5.6 21.9-5.6 31.8 0l171.8 98.1L448 104l0 .9 47.9 27.4c12.6 7.2 18.8 22 15.1 36s-16.4 23.8-30.9 23.8H32c-14.5 0-27.2-9.8-30.9-23.8s2.5-28.8 15.1-36L64 104.9V104l4.4-1.6L240.1 4.2zM64 224h64V416h40V224h64V416h48V224h64V416h40V224h64V420.3c.6 .3 1.2 .7 1.8 1.1l48 32c11.7 7.8 17 22.4 12.9 35.9S494.1 512 480 512H32c-14.1 0-26.5-9.2-30.6-22.7s1.1-28.1 12.9-35.9l48-32c.6-.4 1.2-.7 1.8-1.1V224z"]
            }, Gb = {
              prefix: "fas",
              iconName: "truck",
              icon: [640, 512, [128666, 9951], "f0d1", "M48 0C21.5 0 0 21.5 0 48V368c0 26.5 21.5 48 48 48H64c0 53 43 96 96 96s96-43 96-96H384c0 53 43 96 96 96s96-43 96-96h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V288 256 237.3c0-17-6.7-33.3-18.7-45.3L512 114.7c-12-12-28.3-18.7-45.3-18.7H416V48c0-26.5-21.5-48-48-48H48zM416 160h50.7L544 237.3V256H416V160zM112 416a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm368-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, jl = {
              prefix: "fas",
              iconName: "crosshairs",
              icon: [512, 512, [], "f05b", "M256 0c17.7 0 32 14.3 32 32V42.4c93.7 13.9 167.7 88 181.6 181.6H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H469.6c-13.9 93.7-88 167.7-181.6 181.6V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V469.6C130.3 455.7 56.3 381.7 42.4 288H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H42.4C56.3 130.3 130.3 56.3 224 42.4V32c0-17.7 14.3-32 32-32zM107.4 288c12.5 58.3 58.4 104.1 116.6 116.6V384c0-17.7 14.3-32 32-32s32 14.3 32 32v20.6c58.3-12.5 104.1-58.4 116.6-116.6H384c-17.7 0-32-14.3-32-32s14.3-32 32-32h20.6C392.1 165.7 346.3 119.9 288 107.4V128c0 17.7-14.3 32-32 32s-32-14.3-32-32V107.4C165.7 119.9 119.9 165.7 107.4 224H128c17.7 0 32 14.3 32 32s-14.3 32-32 32H107.4zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, xu = {
              prefix: "fas",
              iconName: "person-cane",
              icon: [448, 512, [], "e53c", "M272 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm-8 187.3l47.4 57.1c11.3 13.6 31.5 15.5 45.1 4.2s15.5-31.5 4.2-45.1l-73.7-88.9c-18.2-22-45.3-34.7-73.9-34.7H177.1c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9V480c0 17.7 14.3 32 32 32s32-14.3 32-32V352h16V480c0 17.7 14.3 32 32 32s32-14.3 32-32V235.3zM352 376c0-4.4 3.6-8 8-8s8 3.6 8 8V488c0 13.3 10.7 24 24 24s24-10.7 24-24V376c0-30.9-25.1-56-56-56s-56 25.1-56 56v8c0 13.3 10.7 24 24 24s24-10.7 24-24v-8z"]
            }, JT = {
              prefix: "fas",
              iconName: "tent",
              icon: [576, 512, [], "e57d", "M269.4 6C280.5-2 295.5-2 306.6 6l224 160c7.4 5.3 12.2 13.5 13.2 22.5l32 288c1 9-1.9 18.1-8 24.9s-14.7 10.7-23.8 10.7H416L288 288V512H32c-9.1 0-17.8-3.9-23.8-10.7s-9-15.8-8-24.9l32-288c1-9 5.8-17.2 13.2-22.5L269.4 6z"]
            }, Zb = {
              prefix: "fas",
              iconName: "vest-patches",
              icon: [448, 512, [], "e086", "M151.2 69.7l55.9 167.7-11 33.1c-2.7 8.2-4.1 16.7-4.1 25.3V464c0 14.5 3.9 28.2 10.7 39.9C195 509 185.9 512 176 512H48c-26.5 0-48-21.5-48-48V270.5c0-9.5 2.8-18.7 8.1-26.6l47.9-71.8c5.3-7.9 8.1-17.1 8.1-26.6V128 54.3 48C64 21.5 85.5 0 112 0h4.5c.2 0 .4 0 .6 0c.4 0 .8 0 1.2 0c18.8 0 34.1 9.7 44.1 18.8C171.6 27.2 190.8 40 224 40s52.4-12.8 61.7-21.2C295.7 9.7 311 0 329.7 0c.4 0 .8 0 1.2 0c.2 0 .4 0 .6 0H336c26.5 0 48 21.5 48 48v6.3V128v17.5c0 9.5 2.8 18.7 8.1 26.6l47.9 71.8c5.3 7.9 8.1 17.1 8.1 26.6V464c0 26.5-21.5 48-48 48H272c-26.5 0-48-21.5-48-48V295.8c0-5.2 .8-10.3 2.5-15.2L296.8 69.7C279.4 79.7 255.4 88 224 88s-55.4-8.3-72.8-18.3zM96 456a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM63.5 255.5c-4.7 4.7-4.7 12.3 0 17L79 288 63.5 303.5c-4.7 4.7-4.7 12.3 0 17s12.3 4.7 17 0L96 305l15.5 15.5c4.7 4.7 12.3 4.7 17 0s4.7-12.3 0-17L113 288l15.5-15.5c4.7-4.7 4.7-12.3 0-17s-12.3-4.7-17 0L96 271 80.5 255.5c-4.7-4.7-12.3-4.7-17 0zM304 280v8 32c0 8.8 7.2 16 16 16h32 8c13.3 0 24-10.7 24-24s-10.7-24-24-24h-8v-8c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]
            }, Qi = {
              prefix: "fas",
              iconName: "check-double",
              icon: [448, 512, [], "f560", "M342.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 178.7l-57.4-57.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l80 80c12.5 12.5 32.8 12.5 45.3 0l160-160zm96 128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 402.7 54.6 297.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l256-256z"]
            }, wl = {
              prefix: "fas",
              iconName: "arrow-down-a-z",
              icon: [576, 512, ["sort-alpha-asc", "sort-alpha-down"], "f15d", "M183.6 469.6C177.5 476.2 169 480 160 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L128 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V365.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 320c0-17.7 14.3-32 32-32H480c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9L429.3 416H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H352c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L402.7 352H352c-17.7 0-32-14.3-32-32zM416 32c12.1 0 23.2 6.8 28.6 17.7l64 128 16 32c7.9 15.8 1.5 35-14.3 42.9s-35 1.5-42.9-14.3L460.2 224H371.8l-7.2 14.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l16-32 64-128C392.8 38.8 403.9 32 416 32zM395.8 176h40.4L416 135.6 395.8 176z"]
            }, _b = wl, zT = wl, _X = {
              prefix: "fas",
              iconName: "money-bill-wheat",
              icon: [512, 512, [], "e52a", "M176 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80c0-8.8 7.2-16 16-16zM56 16h48c13.3 0 24 10.7 24 24s-10.7 24-24 24H56C42.7 64 32 53.3 32 40s10.7-24 24-24zM24 88H136c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24S10.7 88 24 88zm8 96c0-13.3 10.7-24 24-24h48c13.3 0 24 10.7 24 24s-10.7 24-24 24H56c-13.3 0-24-10.7-24-24zM272 16c0-8.8 7.2-16 16-16c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80zM400 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80c0-8.8 7.2-16 16-16zm80 144c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM352 128c8.8 0 16 7.2 16 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-96 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM0 304c0-26.5 21.5-48 48-48H464c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V304zM48 416v48H96c0-26.5-21.5-48-48-48zM96 304H48v48c26.5 0 48-21.5 48-48zM464 416c-26.5 0-48 21.5-48 48h48V416zM416 304c0 26.5 21.5 48 48 48V304H416zm-96 80a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
            }, $X = {
              prefix: "fas",
              iconName: "cookie",
              icon: [512, 512, [127850], "f563", "M247.2 17c-22.1-3.1-44.6 .9-64.4 11.4l-74 39.5C89.1 78.4 73.2 94.9 63.4 115L26.7 190.6c-9.8 20.1-13 42.9-9.1 64.9l14.5 82.8c3.9 22.1 14.6 42.3 30.7 57.9l60.3 58.4c16.1 15.6 36.6 25.6 58.7 28.7l83 11.7c22.1 3.1 44.6-.9 64.4-11.4l74-39.5c19.7-10.5 35.6-27 45.4-47.2l36.7-75.5c9.8-20.1 13-42.9 9.1-64.9l-14.6-82.8c-3.9-22.1-14.6-42.3-30.7-57.9L388.9 57.5c-16.1-15.6-36.6-25.6-58.7-28.7L247.2 17zM208 144a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM144 336a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm224-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, _h = {
              prefix: "fas",
              iconName: "arrow-rotate-left",
              icon: [512, 512, [8634, "arrow-left-rotate", "arrow-rotate-back", "arrow-rotate-backward", "undo"], "f0e2", "M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"]
            }, e2 = _h, Gj = _h, Zj = _h, DB = _h, $b = {
              prefix: "fas",
              iconName: "hard-drive",
              icon: [512, 512, [128436, "hdd"], "f0a0", "M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V280.4c-17-15.2-39.4-24.4-64-24.4H64c-24.6 0-47 9.2-64 24.4V96zM64 288H448c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V352c0-35.3 28.7-64 64-64zM320 416a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm128-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
            }, GT = $b, t2 = {
              prefix: "fas",
              iconName: "face-grin-squint-tears",
              icon: [512, 512, [129315, "grin-squint-tears"], "f586", "M426.8 14.2C446-5 477.5-4.6 497.1 14.9s20 51 .7 70.3c-6.8 6.8-21.4 12.4-37.4 16.7c-16.3 4.4-34.1 7.5-46.3 9.3c-1.6 .2-3.1 .5-4.6 .6c-4.9 .8-9.1-2.8-9.5-7.4c-.1-.7 0-1.4 .1-2.1c1.6-11.2 4.6-29.6 9-47c.3-1.3 .7-2.6 1-3.9c4.3-15.9 9.8-30.5 16.7-37.4zm-44.7 19c-1.5 4.8-2.9 9.6-4.1 14.3c-4.8 18.9-8 38.5-9.7 50.3c-4 26.8 18.9 49.7 45.7 45.8c11.9-1.6 31.5-4.8 50.4-9.7c4.7-1.2 9.5-2.5 14.3-4.1C534.2 227.5 520.2 353.8 437 437c-83.2 83.2-209.5 97.2-307.2 41.8c1.5-4.8 2.8-9.6 4-14.3c4.8-18.9 8-38.5 9.7-50.3c4-26.8-18.9-49.7-45.7-45.8c-11.9 1.6-31.5 4.8-50.4 9.7c-4.7 1.2-9.5 2.5-14.3 4.1C-22.2 284.5-8.2 158.2 75 75C158.2-8.3 284.5-22.2 382.2 33.2zM51.5 410.1c18.5-5 38.8-8.3 50.9-10c.4-.1 .7-.1 1-.1c5.1-.2 9.2 4.3 8.4 9.6c-1.7 12.1-5 32.4-10 50.9C97.6 476.4 92 491 85.2 497.8C66 517 34.5 516.6 14.9 497.1s-20-51-.7-70.3c6.8-6.8 21.4-12.4 37.4-16.7zM416.9 209c-4.7-11.9-20.8-11-26.8 .3c-19 35.5-45 70.8-77.5 103.3S244.8 371.1 209.3 390c-11.3 6-12.2 22.1-.3 26.8c57.6 22.9 125.8 11 172.3-35.5s58.4-114.8 35.5-172.3zM87.1 285.1c2 2 4.6 3.2 7.3 3.4l56.1 5.1 5.1 56.1c.3 2.8 1.5 5.4 3.4 7.3c6.3 6.3 17.2 3.6 19.8-4.9l29.7-97.4c3.5-11.6-7.3-22.5-19-19L92 265.3c-8.6 2.6-11.3 13.4-4.9 19.8zM265.3 92l-29.7 97.4c-3.5 11.6 7.3 22.5 19 19l97.4-29.7c8.6-2.6 11.3-13.4 4.9-19.8c-2-2-4.6-3.2-7.3-3.4l-56.1-5.1-5.1-56.1c-.3-2.8-1.5-5.4-3.4-7.3c-6.3-6.3-17.2-3.6-19.8 4.9z"]
            }, ZT = t2, _j = {
              prefix: "fas",
              iconName: "dumbbell",
              icon: [640, 512, [], "f44b", "M96 64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32V224v64V448c0 17.7-14.3 32-32 32H128c-17.7 0-32-14.3-32-32V384H64c-17.7 0-32-14.3-32-32V288c-17.7 0-32-14.3-32-32s14.3-32 32-32V160c0-17.7 14.3-32 32-32H96V64zm448 0v64h32c17.7 0 32 14.3 32 32v64c17.7 0 32 14.3 32 32s-14.3 32-32 32v64c0 17.7-14.3 32-32 32H544v64c0 17.7-14.3 32-32 32H480c-17.7 0-32-14.3-32-32V288 224 64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32zM416 224v64H224V224H416z"]
            }, $h = {
              prefix: "fas",
              iconName: "rectangle-list",
              icon: [576, 512, ["list-alt"], "f022", "M0 96C0 60.7 28.7 32 64 32H512c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM128 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32-128a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm96-248c-13.3 0-24 10.7-24 24s10.7 24 24 24H448c13.3 0 24-10.7 24-24s-10.7-24-24-24H224zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24H448c13.3 0 24-10.7 24-24s-10.7-24-24-24H224zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24H448c13.3 0 24-10.7 24-24s-10.7-24-24-24H224z"]
            }, ml = $h, ex = {
              prefix: "fas",
              iconName: "tarp-droplet",
              icon: [576, 512, [], "e57c", "M288 160c-35.3 0-64-26.9-64-60c0-24 33.7-70.1 52.2-93.5c6.1-7.7 17.5-7.7 23.6 0C318.3 29.9 352 76 352 100c0 33.1-28.7 60-64 60zM64 128H197.5c13.2 37.3 48.7 64 90.5 64s77.4-26.7 90.5-64H512c35.3 0 64 28.7 64 64V352H448c-17.7 0-32 14.3-32 32l0 128L64 512c-35.3 0-64-28.7-64-64V192c0-35.3 28.7-64 64-64zM448 512l0-128H576L448 512zM96 256a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, Du = {
              prefix: "fas",
              iconName: "house-medical-circle-check",
              icon: [640, 512, [], "e511", "M320 368c0 59.5 29.5 112.1 74.8 144H128.1c-35.3 0-64-28.7-64-64V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L522.1 193.9c-8.5-1.3-17.3-1.9-26.1-1.9c-54.7 0-103.5 24.9-135.8 64H320V208c0-8.8-7.2-16-16-16H272c-8.8 0-16 7.2-16 16v48H208c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h48v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16zm32 0a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L480 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
            }, _T = {
              prefix: "fas",
              iconName: "person-skiing-nordic",
              icon: [576, 512, ["skiing-nordic"], "f7ca", "M336 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM227.2 160c1.9 0 3.8 .1 5.6 .3L201.6 254c-9.3 28 1.7 58.8 26.8 74.5l86.2 53.9L291.3 464H202.8l41.1-88.1-32.4-20.3c-7.8-4.9-14.7-10.7-20.6-17.3L132.2 464H99.7l54.2-257.6c4.6-1.5 9-4.1 12.7-7.8l23.1-23.1c9.9-9.9 23.4-15.5 37.5-15.5zM121.4 198.6c.4 .4 .8 .8 1.3 1.2L67 464H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H159.3c.4 0 .9 0 1.3 0H319.3c.5 0 1 0 1.4 0H504c39.8 0 72-32.2 72-72v-8c0-13.3-10.7-24-24-24s-24 10.7-24 24v8c0 13.3-10.7 24-24 24H434.6l27.6-179.3c10.5-5.2 17.8-16.1 17.8-28.7c0-17.7-14.3-32-32-32H426.7c-12.9 0-24.6-7.8-29.5-19.7l-6.3-15c-14.6-35.1-44.1-61.9-80.5-73.1l-48.7-15c-11.1-3.4-22.7-5.2-34.4-5.2c-31 0-60.8 12.3-82.7 34.3l-23.1 23.1c-12.5 12.5-12.5 32.8 0 45.3zm308 89.4L402.3 464H357.8l21.6-75.6c5.9-20.6-2.6-42.6-20.7-53.9L302 299l30.9-82.4 5.1 12.3C353 264.7 387.9 288 426.7 288h2.7z"]
            }, tx = _T, ju = {
              prefix: "fas",
              iconName: "calendar-plus",
              icon: [512, 512, [], "f271", "M128 32V64H80c-26.5 0-48 21.5-48 48v48H480V112c0-26.5-21.5-48-48-48H384V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H192V32c0-17.7-14.3-32-32-32s-32 14.3-32 32zM480 192H32V464c0 26.5 21.5 48 48 48H432c26.5 0 48-21.5 48-48V192zM256 248c13.3 0 24 10.7 24 24v56h56c13.3 0 24 10.7 24 24s-10.7 24-24 24H280v56c0 13.3-10.7 24-24 24s-24-10.7-24-24V376H176c-13.3 0-24-10.7-24-24s10.7-24 24-24h56V272c0-13.3 10.7-24 24-24z"]
            }, rx = {
              prefix: "fas",
              iconName: "plane-arrival",
              icon: [640, 512, [128748], "f5af", "M.3 166.9L0 68C0 57.7 9.5 50.1 19.5 52.3l35.6 7.9c10.6 2.3 19.2 9.9 23 20L96 128l127.3 37.6L181.8 20.4C178.9 10.2 186.6 0 197.2 0h40.1c11.6 0 22.2 6.2 27.9 16.3l109 193.8 107.2 31.7c15.9 4.7 30.8 12.5 43.7 22.8l34.4 27.6c24 19.2 18.1 57.3-10.7 68.2c-41.2 15.6-86.2 18.1-128.8 7L121.7 289.8c-11.1-2.9-21.2-8.7-29.3-16.9L9.5 189.4c-5.9-6-9.3-14-9.3-22.5zM32 448H608c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32zm96-80a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm128-16a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, $j = {
              prefix: "fas",
              iconName: "circle-left",
              icon: [512, 512, [61840, "arrow-alt-circle-left"], "f359", "M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM217.4 376.9L117.5 269.8c-3.5-3.8-5.5-8.7-5.5-13.8s2-10.1 5.5-13.8l99.9-107.1c4.2-4.5 10.1-7.1 16.3-7.1c12.3 0 22.3 10 22.3 22.3l0 57.7 96 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32l-96 0 0 57.7c0 12.3-10 22.3-22.3 22.3c-6.2 0-12.1-2.6-16.3-7.1z"]
            }, nx = $j, $T = {
              prefix: "fas",
              iconName: "train-subway",
              icon: [448, 512, ["subway"], "f239", "M96 0C43 0 0 43 0 96V352c0 48 35.2 87.7 81.1 94.9l-46 46C28.1 499.9 33.1 512 43 512H82.7c8.5 0 16.6-3.4 22.6-9.4L160 448H288l54.6 54.6c6 6 14.1 9.4 22.6 9.4H405c10 0 15-12.1 7.9-19.1l-46-46c46-7.1 81.1-46.9 81.1-94.9V96c0-53-43-96-96-96H96zM64 128c0-17.7 14.3-32 32-32h80c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V128zM272 96h80c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H272c-17.7 0-32-14.3-32-32V128c0-17.7 14.3-32 32-32zM64 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm288-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, e8 = $T, r2 = {
              prefix: "fas",
              iconName: "chart-gantt",
              icon: [512, 512, [], "e0e4", "M32 32c17.7 0 32 14.3 32 32V400c0 8.8 7.2 16 16 16H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H80c-44.2 0-80-35.8-80-80V64C0 46.3 14.3 32 32 32zm96 96c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32H160c-17.7 0-32-14.3-32-32zm96 64H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm160 96h64c17.7 0 32 14.3 32 32s-14.3 32-32 32H384c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, Fo = {
              prefix: "fas",
              iconName: "indian-rupee-sign",
              icon: [320, 512, ["indian-rupee", "inr"], "e1bc", "M0 64C0 46.3 14.3 32 32 32H96h16H288c17.7 0 32 14.3 32 32s-14.3 32-32 32H231.8c9.6 14.4 16.7 30.6 20.7 48H288c17.7 0 32 14.3 32 32s-14.3 32-32 32H252.4c-13.2 58.3-61.9 103.2-122.2 110.9L274.6 422c14.4 10.3 17.7 30.3 7.4 44.6s-30.3 17.7-44.6 7.4L13.4 314C2.1 306-2.7 291.5 1.5 278.2S18.1 256 32 256h80c32.8 0 61-19.7 73.3-48H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H185.3C173 115.7 144.8 96 112 96H96 32C14.3 96 0 81.7 0 64z"]
            }, t8 = Fo, jB = Fo, n2 = {
              prefix: "fas",
              iconName: "crop-simple",
              icon: [512, 512, ["crop-alt"], "f565", "M128 32c0-17.7-14.3-32-32-32S64 14.3 64 32V64H32C14.3 64 0 78.3 0 96s14.3 32 32 32H64V384c0 35.3 28.7 64 64 64H352V384H128V32zM384 480c0 17.7 14.3 32 32 32s32-14.3 32-32V448h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H448l0-256c0-35.3-28.7-64-64-64L160 64v64l224 0 0 352z"]
            }, r8 = n2, rd = {
              prefix: "fas",
              iconName: "money-bill-1",
              icon: [576, 512, ["money-bill-alt"], "f3d1", "M64 64C28.7 64 0 92.7 0 128V384c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H64zm64 320H64V320c35.3 0 64 28.7 64 64zM64 192V128h64c0 35.3-28.7 64-64 64zM448 384c0-35.3 28.7-64 64-64v64H448zm64-192c-35.3 0-64-28.7-64-64h64v64zM176 256a112 112 0 1 1 224 0 112 112 0 1 1 -224 0zm76-48c0 9.7 6.9 17.7 16 19.6V276h-4c-11 0-20 9-20 20s9 20 20 20h24 24c11 0 20-9 20-20s-9-20-20-20h-4V208c0-11-9-20-20-20H272c-11 0-20 9-20 20z"]
            }, Bl = rd, e0 = {
              prefix: "fas",
              iconName: "left-long",
              icon: [512, 512, ["long-arrow-alt-left"], "f30a", "M177.5 414c-8.8 3.8-19 2-26-4.6l-144-136C2.7 268.9 0 262.6 0 256s2.7-12.9 7.5-17.4l144-136c7-6.6 17.2-8.4 26-4.6s14.5 12.5 14.5 22l0 72 288 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-288 0 0 72c0 9.6-5.7 18.2-14.5 22z"]
            }, n9 = e0, qH = {
              prefix: "fas",
              iconName: "dna",
              icon: [448, 512, [129516], "f471", "M416 0c17.7 0 32 14.3 32 32c0 59.8-30.3 107.5-69.4 146.6c-28 28-62.5 53.5-97.3 77.4l-2.5 1.7c-11.9 8.1-23.8 16.1-35.5 23.9l0 0 0 0 0 0-1.6 1c-6 4-11.9 7.9-17.8 11.9c-20.9 14-40.8 27.7-59.3 41.5H283.3c-9.8-7.4-20.1-14.7-30.7-22.1l7-4.7 3-2c15.1-10.1 30.9-20.6 46.7-31.6c25 18.1 48.9 37.3 69.4 57.7C417.7 372.5 448 420.2 448 480c0 17.7-14.3 32-32 32s-32-14.3-32-32H64c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-59.8 30.3-107.5 69.4-146.6c28-28 62.5-53.5 97.3-77.4c-34.8-23.9-69.3-49.3-97.3-77.4C30.3 139.5 0 91.8 0 32C0 14.3 14.3 0 32 0S64 14.3 64 32H384c0-17.7 14.3-32 32-32zM338.6 384H109.4c-10.1 10.6-18.6 21.3-25.5 32H364.1c-6.8-10.7-15.3-21.4-25.5-32zM109.4 128H338.6c10.1-10.7 18.6-21.3 25.5-32H83.9c6.8 10.7 15.3 21.3 25.5 32zm55.4 48c18.4 13.8 38.4 27.5 59.3 41.5c20.9-14 40.8-27.7 59.3-41.5H164.7z"]
            }, z3 = {
              prefix: "fas",
              iconName: "virus-slash",
              icon: [640, 512, [], "e075", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-154.3-121c-2-30.1 20.8-60.1 56-60.1H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H532.5c-49.9 0-74.9-60.3-39.6-95.6l8.2-8.2c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-8.2 8.2C412.3 118.4 352 93.4 352 43.5V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V43.5c0 49.9-60.3 74.9-95.6 39.6L184.2 75c-12.5-12.5-32.8-12.5-45.3 0c-1.6 1.6-3.1 3.4-4.3 5.3L38.8 5.1zm225.8 177c6.9-3.9 14.9-6.1 23.4-6.1c26.5 0 48 21.5 48 48c0 4.4-.6 8.7-1.7 12.7l-69.7-54.6zM402 412.7L144.7 210c-9.5 8.5-22.2 14-37.2 14H96c-17.7 0-32 14.3-32 32s14.3 32 32 32h11.5c49.9 0 74.9 60.3 39.6 95.6l-8.2 8.2c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l8.2-8.2c35.3-35.3 95.6-10.3 95.6 39.6V480c0 17.7 14.3 32 32 32s32-14.3 32-32V468.5c0-31.2 23.6-52.7 50-55.7z"]
            }, t0 = {
              prefix: "fas",
              iconName: "minus",
              icon: [448, 512, [8211, 8722, 10134, "subtract"], "f068", "M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"]
            }, bH = t0, i2 = {
              prefix: "fas",
              iconName: "chess",
              icon: [512, 512, [], "f439", "M144 16c0-8.8-7.2-16-16-16s-16 7.2-16 16V32H96c-8.8 0-16 7.2-16 16s7.2 16 16 16h16V96H60.2C49.1 96 40 105.1 40 116.2c0 2.5 .5 4.9 1.3 7.3L73.8 208H72c-13.3 0-24 10.7-24 24s10.7 24 24 24h4L60 384H196L180 256h4c13.3 0 24-10.7 24-24s-10.7-24-24-24h-1.8l32.5-84.5c.9-2.3 1.3-4.8 1.3-7.3c0-11.2-9.1-20.2-20.2-20.2H144V64h16c8.8 0 16-7.2 16-16s-7.2-16-16-16H144V16zM48 416L4.8 473.6C1.7 477.8 0 482.8 0 488c0 13.3 10.7 24 24 24H232c13.3 0 24-10.7 24-24c0-5.2-1.7-10.2-4.8-14.4L208 416H48zm288 0l-43.2 57.6c-3.1 4.2-4.8 9.2-4.8 14.4c0 13.3 10.7 24 24 24H488c13.3 0 24-10.7 24-24c0-5.2-1.7-10.2-4.8-14.4L464 416H336zM304 208v51.9c0 7.8 2.8 15.3 8 21.1L339.2 312 337 384H462.5l-3.3-72 28.3-30.8c5.4-5.9 8.5-13.6 8.5-21.7V208c0-8.8-7.2-16-16-16H464c-8.8 0-16 7.2-16 16v16H424V208c0-8.8-7.2-16-16-16H392c-8.8 0-16 7.2-16 16v16H352V208c0-8.8-7.2-16-16-16H320c-8.8 0-16 7.2-16 16zm80 96c0-8.8 7.2-16 16-16s16 7.2 16 16v32H384V304z"]
            }, Ti = {
              prefix: "fas",
              iconName: "arrow-left-long",
              icon: [512, 512, ["long-arrow-left"], "f177", "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 73.4-73.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-128 128z"]
            }, c6 = Ti, No = {
              prefix: "fas",
              iconName: "plug-circle-check",
              icon: [576, 512, [], "e55c", "M96 0C78.3 0 64 14.3 64 32v96h64V32c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32v96h64V32c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32v32c0 77.4 55 142 128 156.8V480c0 17.7 14.3 32 32 32s32-14.3 32-32V412.8c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32H32zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L416 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
            }, Ka = {
              prefix: "fas",
              iconName: "street-view",
              icon: [512, 512, [], "f21d", "M320 64A64 64 0 1 0 192 64a64 64 0 1 0 128 0zm-96 96c-35.3 0-64 28.7-64 64v48c0 17.7 14.3 32 32 32h1.8l11.1 99.5c1.8 16.2 15.5 28.5 31.8 28.5h38.7c16.3 0 30-12.3 31.8-28.5L318.2 304H320c17.7 0 32-14.3 32-32V224c0-35.3-28.7-64-64-64H224zM132.3 394.2c13-2.4 21.7-14.9 19.3-27.9s-14.9-21.7-27.9-19.3c-32.4 5.9-60.9 14.2-82 24.8c-10.5 5.3-20.3 11.7-27.8 19.6C6.4 399.5 0 410.5 0 424c0 21.4 15.5 36.1 29.1 45c14.7 9.6 34.3 17.3 56.4 23.4C130.2 504.7 190.4 512 256 512s125.8-7.3 170.4-19.6c22.1-6.1 41.8-13.8 56.4-23.4c13.7-8.9 29.1-23.6 29.1-45c0-13.5-6.4-24.5-14-32.6c-7.5-7.9-17.3-14.3-27.8-19.6c-21-10.6-49.5-18.9-82-24.8c-13-2.4-25.5 6.3-27.9 19.3s6.3 25.5 19.3 27.9c30.2 5.5 53.7 12.8 69 20.5c3.2 1.6 5.8 3.1 7.9 4.5c3.6 2.4 3.6 7.2 0 9.6c-8.8 5.7-23.1 11.8-43 17.3C374.3 457 318.5 464 256 464s-118.3-7-157.7-17.9c-19.9-5.5-34.2-11.6-43-17.3c-3.6-2.4-3.6-7.2 0-9.6c2.1-1.4 4.8-2.9 7.9-4.5c15.3-7.7 38.8-14.9 69-20.5z"]
            }, Wl = {
              prefix: "fas",
              iconName: "franc-sign",
              icon: [320, 512, [], "e18f", "M80 32C62.3 32 48 46.3 48 64V224v96H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H48v64c0 17.7 14.3 32 32 32s32-14.3 32-32V384h80c17.7 0 32-14.3 32-32s-14.3-32-32-32H112V256H256c17.7 0 32-14.3 32-32s-14.3-32-32-32H112V96H288c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"]
            }, n8 = {
              prefix: "fas",
              iconName: "volume-off",
              icon: [320, 512, [], "f026", "M320 64c0-12.6-7.4-24-18.9-29.2s-25-3.1-34.4 5.3L131.8 160H64c-35.3 0-64 28.7-64 64v64c0 35.3 28.7 64 64 64h67.8L266.7 471.9c9.4 8.4 22.9 10.4 34.4 5.3S320 460.6 320 448V64z"]
            }, lf = {
              prefix: "fas",
              iconName: "hands-asl-interpreting",
              icon: [640, 512, ["american-sign-language-interpreting", "asl-interpreting", "hands-american-sign-language-interpreting"], "f2a3", "M156.6 46.3c7.9-15.8 1.5-35-14.3-42.9s-35-1.5-42.9 14.3L13.5 189.4C4.6 207.2 0 226.8 0 246.7V256c0 70.7 57.3 128 128 128h72 8v-.3c35.2-2.7 65.4-22.8 82.1-51.7c8.8-15.3 3.6-34.9-11.7-43.7s-34.9-3.6-43.7 11.7c-7 12-19.9 20-34.7 20c-22.1 0-40-17.9-40-40s17.9-40 40-40c14.8 0 27.7 8 34.7 20c8.8 15.3 28.4 20.5 43.7 11.7s20.5-28.4 11.7-43.7c-12.8-22.1-33.6-39.1-58.4-47.1l80.8-22c17-4.6 27.1-22.2 22.5-39.3s-22.2-27.1-39.3-22.5L194.9 124.6l81.6-68c13.6-11.3 15.4-31.5 4.1-45.1S249.1-3.9 235.5 7.4L133.6 92.3l23-46zM483.4 465.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l85.9-171.7c8.9-17.8 13.5-37.4 13.5-57.2V256c0-70.7-57.3-128-128-128H440h-8v.3c-35.2 2.7-65.4 22.8-82.1 51.7c-8.9 15.3-3.6 34.9 11.7 43.7s34.9 3.6 43.7-11.7c7-12 19.9-20 34.7-20c22.1 0 40 17.9 40 40s-17.9 40-40 40c-14.8 0-27.7-8-34.7-20c-8.9-15.3-28.4-20.5-43.7-11.7s-20.5 28.4-11.7 43.7c12.8 22.1 33.6 39.1 58.4 47.1l-80.8 22c-17.1 4.7-27.1 22.2-22.5 39.3s22.2 27.1 39.3 22.5l100.7-27.5-81.6 68c-13.6 11.3-15.4 31.5-4.1 45.1s31.5 15.4 45.1 4.1l101.9-84.9-23 46z"]
            }, s2 = lf, G3 = lf, i8 = lf, Z3 = {
              prefix: "fas",
              iconName: "gear",
              icon: [512, 512, [9881, "cog"], "f013", "M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]
            }, s8 = Z3, a2 = {
              prefix: "fas",
              iconName: "droplet-slash",
              icon: [640, 512, ["tint-slash"], "f5c7", "M320 512c53.2 0 101.4-21.6 136.1-56.6l-298.3-235C140 257.1 128 292.3 128 320c0 106 86 192 192 192zM505.2 370.7c4.4-16.1 6.8-33.1 6.8-50.7c0-91.2-130.2-262.3-166.6-308.3C339.4 4.2 330.5 0 320.9 0h-1.8c-9.6 0-18.5 4.2-24.5 11.7C277.8 33 240.7 81.3 205.8 136L38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L505.2 370.7zM224 336c0 44.2 35.8 80 80 80c8.8 0 16 7.2 16 16s-7.2 16-16 16c-61.9 0-112-50.1-112-112c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
            }, o2 = a2, ix = {
              prefix: "fas",
              iconName: "mosque",
              icon: [640, 512, [128332], "f678", "M400 0c5 0 9.8 2.4 12.8 6.4c34.7 46.3 78.1 74.9 133.5 111.5l0 0 0 0c5.2 3.4 10.5 7 16 10.6c28.9 19.2 45.7 51.7 45.7 86.1c0 28.6-11.3 54.5-29.8 73.4H221.8c-18.4-19-29.8-44.9-29.8-73.4c0-34.4 16.7-66.9 45.7-86.1c5.4-3.6 10.8-7.1 16-10.6l0 0 0 0C309.1 81.3 352.5 52.7 387.2 6.4c3-4 7.8-6.4 12.8-6.4zM288 512V440c0-13.3-10.7-24-24-24s-24 10.7-24 24v72H192c-17.7 0-32-14.3-32-32V352c0-17.7 14.3-32 32-32H608c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32H560V440c0-13.3-10.7-24-24-24s-24 10.7-24 24v72H448V454c0-19-8.4-37-23-49.2L400 384l-25 20.8C360.4 417 352 435 352 454v58H288zM70.4 5.2c5.7-4.3 13.5-4.3 19.2 0l16 12C139.8 42.9 160 83.2 160 126v2H0v-2C0 83.2 20.2 42.9 54.4 17.2l16-12zM0 160H160V296.6c-19.1 11.1-32 31.7-32 55.4V480c0 9.6 2.1 18.6 5.8 26.8c-6.6 3.4-14 5.2-21.8 5.2H48c-26.5 0-48-21.5-48-48V176 160z"]
            }, a8 = {
              prefix: "fas",
              iconName: "mosquito",
              icon: [640, 512, [], "e52b", "M463.7 505.9c9.8-8.9 10.7-24.3 2.1-34.3l-42.1-49 0-54.7c0-5.5-1.8-10.8-5.1-15.1L352 266.3l0-.3L485.4 387.8C542.4 447.6 640 405.2 640 320.6c0-47.9-34-88.3-79.4-94.2l-153-23.9 40.8-40.9c7.8-7.8 9.4-20.1 3.9-29.8L428.5 90.1l38.2-50.9c8-10.6 6.1-25.9-4.3-34.1s-25.2-6.3-33.2 4.4l-48 63.9c-5.9 7.9-6.6 18.6-1.7 27.2L402.2 140 352 190.3l0-38.2c0-14.9-10.2-27.4-24-31l0-57.2c0-4.4-3.6-8-8-8s-8 3.6-8 8l0 57.2c-13.8 3.6-24 16.1-24 31l0 38.1L237.8 140l22.6-39.5c4.9-8.6 4.2-19.3-1.7-27.2l-48-63.9c-8-10.6-22.8-12.6-33.2-4.4s-12.2 23.5-4.3 34.1l38.2 50.9-23.9 41.7c-5.5 9.7-3.9 22 3.9 29.8l40.8 40.9-153 23.9C34 232.3 0 272.7 0 320.6c0 84.6 97.6 127 154.6 67.1L288 266l0 .3-66.5 86.4c-3.3 4.3-5.1 9.6-5.1 15.1l0 54.7-42.1 49c-8.6 10.1-7.7 25.5 2.1 34.3s24.7 7.9 33.4-2.1l48-55.9c3.8-4.4 5.9-10.2 5.9-16.1l0-55.4L288 344.7l0 63.1c0 17.7 14.3 32 32 32s32-14.3 32-32l0-63.1 24.3 31.6 0 55.4c0 5.9 2.1 11.7 5.9 16.1l48 55.9c8.6 10.1 23.6 11 33.4 2.1z"]
            }, ew = {
              prefix: "fas",
              iconName: "star-of-david",
              icon: [512, 512, [10017], "f69a", "M404.2 309.5L383.1 344h42.3l-21.1-34.5zM371.4 256l-54-88H194.6l-54 88 54 88H317.4l54-88zm65.7 0l53.4 87c3.6 5.9 5.5 12.7 5.5 19.6c0 20.7-16.8 37.4-37.4 37.4H348.7l-56.2 91.5C284.8 504.3 270.9 512 256 512s-28.8-7.7-36.6-20.5L163.3 400H53.4C32.8 400 16 383.2 16 362.6c0-6.9 1.9-13.7 5.5-19.6l53.4-87L21.5 169c-3.6-5.9-5.5-12.7-5.5-19.6C16 128.8 32.8 112 53.4 112H163.3l56.2-91.5C227.2 7.7 241.1 0 256 0s28.8 7.7 36.6 20.5L348.7 112H458.6c20.7 0 37.4 16.8 37.4 37.4c0 6.9-1.9 13.7-5.5 19.6l-53.4 87zm-54-88l21.1 34.5L425.4 168H383.1zM283 112L256 68l-27 44h54zM128.9 168H86.6l21.1 34.5L128.9 168zM107.8 309.5L86.6 344h42.3l-21.1-34.5zM229 400l27 44 27-44H229z"]
            }, xH = {
              prefix: "fas",
              iconName: "person-military-rifle",
              icon: [512, 512, [], "e54b", "M160 39c0-13 10-23.8 22.9-24.9L334.7 1.4C344 .7 352 8 352 17.4V48c0 8.8-7.2 16-16 16H185c-13.8 0-25-11.2-25-25zm17.6 57H334.4c1 5.2 1.6 10.5 1.6 16c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-5.5 .6-10.8 1.6-16zm228 364.3L352 369.7V480c0 1.3-.1 2.5-.2 3.8L177.5 234.9c16.6-7.1 34.6-10.9 53.3-10.9h50.4c15.9 0 31.3 2.8 45.8 7.9L421.9 67.7c-7.7-4.4-10.3-14.2-5.9-21.9s14.2-10.3 21.9-5.9l13.9 8 13.9 8c7.7 4.4 10.3 14.2 5.9 21.9L416 173.9l1.6 .9c15.3 8.8 20.6 28.4 11.7 43.7L392.6 282c2 2.8 3.9 5.8 5.7 8.8l76.1 128.8c11.2 19 4.9 43.5-14.1 54.8s-43.5 4.9-54.8-14.1zM320 512H192c-17.7 0-32-14.3-32-32V369.7l-53.6 90.6c-11.2 19-35.8 25.3-54.8 14.1s-25.3-35.8-14.1-54.8l76.1-128.8c9.4-15.8 21.7-29.3 36-40L331.1 510c-3.5 1.3-7.2 2-11.1 2zM296 320a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
            }, o8 = {
              prefix: "fas",
              iconName: "cart-shopping",
              icon: [576, 512, [128722, "shopping-cart"], "f07a", "M0 24C0 10.7 10.7 0 24 0H69.5c22 0 41.5 12.8 50.6 32h411c26.3 0 45.5 25 38.6 50.4l-41 152.3c-8.5 31.4-37 53.3-69.5 53.3H170.7l5.4 28.5c2.2 11.3 12.1 19.5 23.6 19.5H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H199.7c-34.6 0-64.3-24.6-70.7-58.5L77.4 54.5c-.7-3.8-4-6.5-7.9-6.5H24C10.7 48 0 37.3 0 24zM128 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm336-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, zn = o8, f8 = {
              prefix: "fas",
              iconName: "vials",
              icon: [512, 512, [], "f493", "M0 64C0 46.3 14.3 32 32 32H88h48 56c17.7 0 32 14.3 32 32s-14.3 32-32 32V400c0 44.2-35.8 80-80 80s-80-35.8-80-80V96C14.3 96 0 81.7 0 64zM136 96H88V256h48V96zM288 64c0-17.7 14.3-32 32-32h56 48 56c17.7 0 32 14.3 32 32s-14.3 32-32 32V400c0 44.2-35.8 80-80 80s-80-35.8-80-80V96c-17.7 0-32-14.3-32-32zM424 96H376V256h48V96z"]
            }, sx = {
              prefix: "fas",
              iconName: "plug-circle-plus",
              icon: [576, 512, [], "e55f", "M96 0C78.3 0 64 14.3 64 32v96h64V32c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32v96h64V32c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32v32c0 77.4 55 142 128 156.8V480c0 17.7 14.3 32 32 32s32-14.3 32-32V412.8c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32H32zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm16-208v48h48c8.8 0 16 7.2 16 16s-7.2 16-16 16H448v48c0 8.8-7.2 16-16 16s-16-7.2-16-16V384H368c-8.8 0-16-7.2-16-16s7.2-16 16-16h48V304c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
            }, DH = {
              prefix: "fas",
              iconName: "place-of-worship",
              icon: [640, 512, [], "f67f", "M224 109.3V217.6L183.3 242c-14.5 8.7-23.3 24.3-23.3 41.2V512h96V416c0-35.3 28.7-64 64-64s64 28.7 64 64v96h96V283.2c0-16.9-8.8-32.5-23.3-41.2L416 217.6V109.3c0-8.5-3.4-16.6-9.4-22.6L331.3 11.3c-6.2-6.2-16.4-6.2-22.6 0L233.4 86.6c-6 6-9.4 14.1-9.4 22.6zM24.9 330.3C9.5 338.8 0 354.9 0 372.4V464c0 26.5 21.5 48 48 48h80V273.6L24.9 330.3zM592 512c26.5 0 48-21.5 48-48V372.4c0-17.5-9.5-33.6-24.9-42.1L512 273.6V512h80z"]
            }, $P = {
              prefix: "fas",
              iconName: "grip-vertical",
              icon: [320, 512, [], "f58e", "M40 352l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm192 0l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 320c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 192l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 160c-22.1 0-40-17.9-40-40L0 72C0 49.9 17.9 32 40 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40z"]
            }, ec = {
              prefix: "fas",
              iconName: "arrow-turn-up",
              icon: [384, 512, ["level-up"], "f148", "M32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c53 0 96-43 96-96l0-306.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 416c0 17.7-14.3 32-32 32l-96 0z"]
            }, r0 = ec, f2 = {
              prefix: "fas",
              iconName: "u",
              icon: [384, 512, [117], "55", "M32 32c17.7 0 32 14.3 32 32V288c0 70.7 57.3 128 128 128s128-57.3 128-128V64c0-17.7 14.3-32 32-32s32 14.3 32 32V288c0 106-86 192-192 192S0 394 0 288V64C0 46.3 14.3 32 32 32z"]
            }, A8 = {
              prefix: "fas",
              iconName: "square-root-variable",
              icon: [576, 512, ["square-root-alt"], "f698", "M282.6 78.1c8-27.3 33-46.1 61.4-46.1H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H344L238.7 457c-3.6 12.3-14.1 21.2-26.8 22.8s-25.1-4.6-31.5-15.6L77.6 288H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H77.6c22.8 0 43.8 12.1 55.3 31.8l65.2 111.8L282.6 78.1zM393.4 233.4c12.5-12.5 32.8-12.5 45.3 0L480 274.7l41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L525.3 320l41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L480 365.3l-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L434.7 320l-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3z"]
            }, ax = A8, Sl = {
              prefix: "fas",
              iconName: "clock",
              icon: [512, 512, [128339, "clock-four"], "f017", "M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]
            }, tw = Sl, _3 = {
              prefix: "fas",
              iconName: "backward-step",
              icon: [320, 512, ["step-backward"], "f048", "M267.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160L64 241V96c0-17.7-14.3-32-32-32S0 78.3 0 96V416c0 17.7 14.3 32 32 32s32-14.3 32-32V271l11.5 9.6 192 160z"]
            }, ox = _3, fx = {
              prefix: "fas",
              iconName: "pallet",
              icon: [640, 512, [], "f482", "M32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32H64v64H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H96 320 544h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H576V384h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H544 320 96 32zm96 64H288v64H128V384zm224 0H512v64H352V384z"]
            }, A2 = {
              prefix: "fas",
              iconName: "faucet",
              icon: [512, 512, [], "e005", "M192 96v12L96 96c-17.7 0-32 14.3-32 32s14.3 32 32 32l96-12 31-3.9 1-.1 1 .1 31 3.9 96 12c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 12V96c0-17.7-14.3-32-32-32s-32 14.3-32 32zM32 256c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32H132.1c20.2 29 53.9 48 91.9 48s71.7-19 91.9-48H352c17.7 0 32 14.3 32 32s14.3 32 32 32h64c17.7 0 32-14.3 32-32c0-88.4-71.6-160-160-160H320l-22.6-22.6c-6-6-14.1-9.4-22.6-9.4H256V180.2l-32-4-32 4V224H173.3c-8.5 0-16.6 3.4-22.6 9.4L128 256H32z"]
            }, n0 = {
              prefix: "fas",
              iconName: "baseball-bat-ball",
              icon: [512, 512, [], "f432", "M424 0c-12.4 0-24.2 4.9-33 13.7L233.5 171.2c-10.5 10.5-19.8 22.1-27.7 34.6L132.7 321.6c-7.3 11.5-15.8 22.2-25.5 31.9L69.9 390.7l51.3 51.3 37.3-37.3c9.6-9.6 20.3-18.2 31.9-25.5l115.8-73.1c12.5-7.9 24.1-17.2 34.6-27.7L498.3 121c8.7-8.7 13.7-20.6 13.7-33s-4.9-24.2-13.7-33L457 13.7C448.2 4.9 436.4 0 424 0zm88 432a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM15 399c-9.4 9.4-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L49 399c-9.4-9.4-24.6-9.4-33.9 0z"]
            }, d2 = {
              prefix: "fas",
              iconName: "s",
              icon: [320, 512, [115], "53", "M99.1 105.4C79 114 68.2 127.2 65.2 144.8c-2.4 14.1-.7 23.2 2 29.4c2.8 6.3 7.9 12.4 16.7 18.6c19.2 13.4 48.3 22.1 84.9 32.5c1 .3 1.9 .6 2.9 .8c32.7 9.3 72 20.6 100.9 40.7c15.7 10.9 29.9 25.5 38.6 45.1c8.8 19.8 10.8 42 6.6 66.3c-7.3 42.5-35.3 71.7-71.8 87.3c-35.4 15.2-79.1 17.9-123.7 10.9l-.2 0 0 0c-24-3.9-62.7-17.1-87.6-25.6c-4.8-1.7-9.2-3.1-12.8-4.3C5.1 440.8-3.9 422.7 1.6 405.9s23.7-25.8 40.5-20.3c4.9 1.6 10.2 3.4 15.9 5.4c25.4 8.6 56.4 19.2 74.4 22.1c36.8 5.7 67.5 2.5 88.5-6.5c20.1-8.6 30.8-21.8 33.9-39.4c2.4-14.1 .7-23.2-2-29.4c-2.8-6.3-7.9-12.4-16.7-18.6c-19.2-13.4-48.3-22.1-84.9-32.5c-1-.3-1.9-.6-2.9-.8c-32.7-9.3-72-20.6-100.9-40.7c-15.7-10.9-29.9-25.5-38.6-45.1c-8.8-19.8-10.8-42-6.6-66.3l31.5 5.5L2.1 133.9C9.4 91.4 37.4 62.2 73.9 46.6c35.4-15.2 79.1-17.9 123.7-10.9c13 2 52.4 9.6 66.6 13.4c17.1 4.5 27.2 22.1 22.7 39.2s-22.1 27.2-39.2 22.7c-11.2-3-48.1-10.2-60.1-12l4.9-31.5-4.9 31.5c-36.9-5.8-67.5-2.5-88.6 6.5z"]
            }, Dv = {
              prefix: "fas",
              iconName: "timeline",
              icon: [640, 512, [], "e29c", "M128 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm32 97.3c28.3-12.3 48-40.5 48-73.3c0-44.2-35.8-80-80-80S48 51.8 48 96c0 32.8 19.7 61 48 73.3V224H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H288v54.7c-28.3 12.3-48 40.5-48 73.3c0 44.2 35.8 80 80 80s80-35.8 80-80c0-32.8-19.7-61-48-73.3V288H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H544V169.3c28.3-12.3 48-40.5 48-73.3c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 32.8 19.7 61 48 73.3V224H160V169.3zM488 96a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM320 392a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, d8 = {
              prefix: "fas",
              iconName: "keyboard",
              icon: [576, 512, [9e3], "f11c", "M64 64C28.7 64 0 92.7 0 128V384c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H64zm16 64h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V144c0-8.8 7.2-16 16-16zM64 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V240zm16 80h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V336c0-8.8 7.2-16 16-16zm80-176c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V144zm16 80h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zM160 336c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V336zM272 128h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V144c0-8.8 7.2-16 16-16zM256 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V240zM368 128h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H368c-8.8 0-16-7.2-16-16V144c0-8.8 7.2-16 16-16zM352 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H368c-8.8 0-16-7.2-16-16V240zM464 128h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H464c-8.8 0-16-7.2-16-16V144c0-8.8 7.2-16 16-16zM448 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H464c-8.8 0-16-7.2-16-16V240zm16 80h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H464c-8.8 0-16-7.2-16-16V336c0-8.8 7.2-16 16-16z"]
            }, Ax = {
              prefix: "fas",
              iconName: "caret-down",
              icon: [320, 512, [], "f0d7", "M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"]
            }, jH = {
              prefix: "fas",
              iconName: "house-chimney-medical",
              icon: [576, 512, ["clinic-medical"], "f7f2", "M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c.2 35.5-28.5 64.3-64 64.3H128.1c-35.3 0-64-28.7-64-64V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L416 100.7V64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32V185l52.8 46.4c8 7 12 15 11 24zM272 192c-8.8 0-16 7.2-16 16v48H208c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h48v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320h48c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H320V208c0-8.8-7.2-16-16-16H272z"]
            }, v2 = jH, v8 = {
              prefix: "fas",
              iconName: "temperature-three-quarters",
              icon: [320, 512, ["temperature-3", "thermometer-3", "thermometer-three-quarters"], "f2c8", "M160 64c-26.5 0-48 21.5-48 48V276.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5V112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112V276.5c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6V112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3V144c0-8.8 7.2-16 16-16s16 7.2 16 16V322.7c18.6 6.6 32 24.4 32 45.3z"]
            }, Vd = v8, $3 = v8, wB = v8, W9 = {
              prefix: "fas",
              iconName: "mobile-screen",
              icon: [384, 512, ["mobile-android-alt"], "f3cf", "M16 64C16 28.7 44.7 0 80 0H304c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H80c-35.3 0-64-28.7-64-64V64zM144 448c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16s-7.2-16-16-16H160c-8.8 0-16 7.2-16 16zM304 64H80V384H304V64z"]
            }, u8 = W9, nd = {
              prefix: "fas",
              iconName: "plane-up",
              icon: [512, 512, [], "e22d", "M192 93.7C192 59.5 221 0 256 0c36 0 64 59.5 64 93.7l0 66.3L497.8 278.5c8.9 5.9 14.2 15.9 14.2 26.6v56.7c0 10.9-10.7 18.6-21.1 15.2L320 320v80l57.6 43.2c4 3 6.4 7.8 6.4 12.8v42c0 7.8-6.3 14-14 14c-1.3 0-2.6-.2-3.9-.5L256 480 145.9 511.5c-1.3 .4-2.6 .5-3.9 .5c-7.8 0-14-6.3-14-14V456c0-5 2.4-9.8 6.4-12.8L192 400V320L21.1 377C10.7 380.4 0 372.7 0 361.8V305.1c0-10.7 5.3-20.7 14.2-26.6L192 160V93.7z"]
            }, dx = {
              prefix: "fas",
              iconName: "piggy-bank",
              icon: [576, 512, [], "f4d3", "M400 96l0 .7c-5.3-.4-10.6-.7-16-.7H256c-16.5 0-32.5 2.1-47.8 6c-.1-2-.2-4-.2-6c0-53 43-96 96-96s96 43 96 96zm-16 32c3.5 0 7 .1 10.4 .3c4.2 .3 8.4 .7 12.6 1.3C424.6 109.1 450.8 96 480 96h11.5c10.4 0 18 9.8 15.5 19.9l-13.8 55.2c15.8 14.8 28.7 32.8 37.5 52.9H544c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H512c-9.1 12.1-19.9 22.9-32 32v64c0 17.7-14.3 32-32 32H416c-17.7 0-32-14.3-32-32V448H256v32c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V416c-34.9-26.2-58.7-66.3-63.2-112H68c-37.6 0-68-30.4-68-68s30.4-68 68-68h4c13.3 0 24 10.7 24 24s-10.7 24-24 24H68c-11 0-20 9-20 20s9 20 20 20H99.2c12.1-59.8 57.7-107.5 116.3-122.8c12.9-3.4 26.5-5.2 40.5-5.2H384zm64 136a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
            }, rw = {
              prefix: "fas",
              iconName: "battery-half",
              icon: [576, 512, ["battery-3"], "f242", "M464 160c8.8 0 16 7.2 16 16V336c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16H464zM80 96C35.8 96 0 131.8 0 176V336c0 44.2 35.8 80 80 80H464c44.2 0 80-35.8 80-80V320c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32V176c0-44.2-35.8-80-80-80H80zm208 96H96V320H288V192z"]
            }, i0 = rw, vx = {
              prefix: "fas",
              iconName: "mountain-city",
              icon: [640, 512, [], "e52e", "M336 0c-26.5 0-48 21.5-48 48v92.1l71.4 118.4c2.5-1.6 5.4-2.5 8.6-2.5h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16h-3.5l73.8 122.4c12.4 20.6 12.9 46.3 1.2 67.3c-.4 .8-.9 1.6-1.4 2.3H592c26.5 0 48-21.5 48-48V240c0-26.5-21.5-48-48-48H568V120c0-13.3-10.7-24-24-24s-24 10.7-24 24v72H480V48c0-26.5-21.5-48-48-48H336zm32 64h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H368c-8.8 0-16-7.2-16-16V80c0-8.8 7.2-16 16-16zM352 176c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H368c-8.8 0-16-7.2-16-16V176zm160 96c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H528c-8.8 0-16-7.2-16-16V272zm16 80h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H528c-8.8 0-16-7.2-16-16V368c0-8.8 7.2-16 16-16zM224 188.9L283.8 288H223l-48 64-24.6-41.2L224 188.9zm29.4-44.2C247.1 134.3 236 128 224 128s-23.1 6.3-29.4 16.7L5.1 458.9c-6.5 10.8-6.7 24.3-.7 35.3S22 512 34.5 512H413.5c12.5 0 24-6.8 30.1-17.8s5.8-24.5-.7-35.3L253.4 144.7z"]
            }, nw = {
              prefix: "fas",
              iconName: "coins",
              icon: [512, 512, [], "f51e", "M512 80c0 18-14.3 34.6-38.4 48c-29.1 16.1-72.5 27.5-122.3 30.9c-3.7-1.8-7.4-3.5-11.3-5C300.6 137.4 248.2 128 192 128c-8.3 0-16.4 .2-24.5 .6l-1.1-.6C142.3 114.6 128 98 128 80c0-44.2 86-80 192-80S512 35.8 512 80zM160.7 161.1c10.2-.7 20.7-1.1 31.3-1.1c62.2 0 117.4 12.3 152.5 31.4C369.3 204.9 384 221.7 384 240c0 4-.7 7.9-2.1 11.7c-4.6 13.2-17 25.3-35 35.5c0 0 0 0 0 0c-.1 .1-.3 .1-.4 .2l0 0 0 0c-.3 .2-.6 .3-.9 .5c-35 19.4-90.8 32-153.6 32c-59.6 0-112.9-11.3-148.2-29.1c-1.9-.9-3.7-1.9-5.5-2.9C14.3 274.6 0 258 0 240c0-34.8 53.4-64.5 128-75.4c10.5-1.5 21.4-2.7 32.7-3.5zM416 240c0-21.9-10.6-39.9-24.1-53.4c28.3-4.4 54.2-11.4 76.2-20.5c16.3-6.8 31.5-15.2 43.9-25.5V176c0 19.3-16.5 37.1-43.8 50.9c-14.6 7.4-32.4 13.7-52.4 18.5c.1-1.8 .2-3.5 .2-5.3zm-32 96c0 18-14.3 34.6-38.4 48c-1.8 1-3.6 1.9-5.5 2.9C304.9 404.7 251.6 416 192 416c-62.8 0-118.6-12.6-153.6-32C14.3 370.6 0 354 0 336V300.6c12.5 10.3 27.6 18.7 43.9 25.5C83.4 342.6 135.8 352 192 352s108.6-9.4 148.1-25.9c7.8-3.2 15.3-6.9 22.4-10.9c6.1-3.4 11.8-7.2 17.2-11.2c1.5-1.1 2.9-2.3 4.3-3.4V304v5.7V336zm32 0V304 278.1c19-4.2 36.5-9.5 52.1-16c16.3-6.8 31.5-15.2 43.9-25.5V272c0 10.5-5 21-14.9 30.9c-16.3 16.3-45 29.7-81.3 38.4c.1-1.7 .2-3.5 .2-5.3zM192 448c56.2 0 108.6-9.4 148.1-25.9c16.3-6.8 31.5-15.2 43.9-25.5V432c0 44.2-86 80-192 80S0 476.2 0 432V396.6c12.5 10.3 27.6 18.7 43.9 25.5C83.4 438.6 135.8 448 192 448z"]
            }, mB = {
              prefix: "fas",
              iconName: "khanda",
              icon: [512, 512, [9772], "f66d", "M245.8 3.7c5.9-4.9 14.6-4.9 20.5 0l48 40c5.9 4.9 7.5 13.2 3.8 19.9l0 0 0 0 0 0 0 0-.1 .1-.3 .6c-.3 .5-.7 1.3-1.2 2.3c-1 2-2.6 5-4.4 8.6c-.5 .9-.9 1.9-1.4 2.9C344.9 97.4 368 134 368 176s-23.1 78.6-57.3 97.8c.5 1 1 2 1.4 2.9c1.8 3.7 3.3 6.6 4.4 8.6c.5 1 .9 1.8 1.2 2.3l.3 .6 .1 .1 0 0 0 0c3.6 6.7 2 15-3.8 19.9L272 343.5v19.8l35.6-24.5 41.1-28.2c42.8-29.4 68.4-78 68.4-130c0-31.1-9.2-61.6-26.5-87.5l-2.8-4.2c-4-6-3.5-14 1.3-19.5s12.7-7 19.2-3.7L401.1 80c7.2-14.3 7.2-14.3 7.2-14.3l0 0 0 0 .1 0 .3 .2 1 .5c.8 .4 2 1.1 3.5 1.9c2.9 1.7 7 4.1 11.8 7.3c9.6 6.4 22.5 16.1 35.4 29c25.7 25.7 52.7 65.6 52.7 119.3c0 53.1-26.4 100.5-51.2 133.6c-12.6 16.7-25.1 30.3-34.5 39.7c-4.7 4.7-8.7 8.4-11.5 10.9c-1.4 1.3-2.5 2.2-3.3 2.9l-.9 .8-.3 .2-.1 .1 0 0 0 0s0 0-10.2-12.3l10.2 12.3c-5.1 4.3-12.4 4.9-18.2 1.6l-75.6-43-32.7 22.5 45.5 31.3c1.8-.4 3.7-.7 5.7-.7c13.3 0 24 10.7 24 24s-10.7 24-24 24c-12.2 0-22.3-9.1-23.8-21L272 423.4v28.9c9.6 5.5 16 15.9 16 27.7c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-11.8 6.4-22.2 16-27.7V424.1l-40.3 27.7C197.8 463.3 187.9 472 176 472c-13.3 0-24-10.7-24-24s10.7-24 24-24c2.2 0 4.4 .3 6.5 .9l45.8-31.5-32.7-22.5-75.6 43c-5.8 3.3-13 2.7-18.2-1.6L112 400c-10.2 12.3-10.2 12.3-10.3 12.3l0 0 0 0-.1-.1-.3-.2-.9-.8c-.8-.7-1.9-1.7-3.3-2.9c-2.8-2.5-6.7-6.2-11.5-10.9c-9.4-9.4-21.9-23-34.5-39.7C26.4 324.5 0 277.1 0 224c0-53.7 26.9-93.6 52.7-119.3c12.9-12.9 25.8-22.6 35.4-29C93 72.5 97 70 99.9 68.4c1.5-.8 2.6-1.5 3.5-1.9l1-.5 .3-.2 .1 0 0 0 0 0s0 0 7.2 14.3l-7.2-14.3c6.5-3.2 14.3-1.7 19.2 3.7s5.3 13.4 1.3 19.5l-2.8 4.2C105.2 119 96 149.5 96 180.6c0 51.9 25.6 100.6 68.4 130l41.1 28.2L240 362.6V343.5l-42.2-35.2c-5.9-4.9-7.5-13.2-3.8-19.9l0 0 0 0 0 0 .1-.1 .3-.6c.3-.5 .7-1.3 1.2-2.3c1-2 2.6-5 4.4-8.6c.5-.9 .9-1.9 1.4-2.9C167.1 254.6 144 218 144 176s23.1-78.6 57.3-97.8c-.5-1-1-2-1.4-2.9c-1.8-3.7-3.3-6.6-4.4-8.6c-.5-1-.9-1.8-1.2-2.3l-.3-.6-.1-.1 0 0 0 0 0 0c-3.6-6.7-2-15 3.8-19.9l48-40zM220.2 122.9c-17 11.5-28.2 31-28.2 53.1s11.2 41.6 28.2 53.1C227 210.2 232 190.9 232 176s-5-34.2-11.8-53.1zm71.5 106.2c17-11.5 28.2-31 28.2-53.1s-11.2-41.6-28.2-53.1C285 141.8 280 161.1 280 176s5 34.2 11.8 53.1z"]
            }, s0 = {
              prefix: "fas",
              iconName: "sliders",
              icon: [512, 512, ["sliders-h"], "f1de", "M0 416c0 17.7 14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384c-17.7 0-32 14.3-32 32zm128 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32-80c-32.8 0-61 19.7-73.3 48L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48zM192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm73.3-64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64z"]
            }, l8 = s0, tc = {
              prefix: "fas",
              iconName: "folder-tree",
              icon: [576, 512, [], "f802", "M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32v96V384c0 35.3 28.7 64 64 64H256V384H64V160H256V96H64V32zM288 192c0 17.7 14.3 32 32 32H544c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32H445.3c-8.5 0-16.6-3.4-22.6-9.4L409.4 9.4c-6-6-14.1-9.4-22.6-9.4H320c-17.7 0-32 14.3-32 32V192zm0 288c0 17.7 14.3 32 32 32H544c17.7 0 32-14.3 32-32V352c0-17.7-14.3-32-32-32H445.3c-8.5 0-16.6-3.4-22.6-9.4l-13.3-13.3c-6-6-14.1-9.4-22.6-9.4H320c-17.7 0-32 14.3-32 32V480z"]
            }, iw = {
              prefix: "fas",
              iconName: "network-wired",
              icon: [640, 512, [], "f6ff", "M256 64H384v64H256V64zM240 0c-26.5 0-48 21.5-48 48v96c0 26.5 21.5 48 48 48h48v32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h96v32H80c-26.5 0-48 21.5-48 48v96c0 26.5 21.5 48 48 48H240c26.5 0 48-21.5 48-48V368c0-26.5-21.5-48-48-48H192V288H448v32H400c-26.5 0-48 21.5-48 48v96c0 26.5 21.5 48 48 48H560c26.5 0 48-21.5 48-48V368c0-26.5-21.5-48-48-48H512V288h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H352V192h48c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48H240zM96 448V384H224v64H96zm320-64H544v64H416V384z"]
            }, u2 = {
              prefix: "fas",
              iconName: "map-pin",
              icon: [320, 512, [128205], "f276", "M16 144a144 144 0 1 1 288 0A144 144 0 1 1 16 144zM160 80c8.8 0 16-7.2 16-16s-7.2-16-16-16c-53 0-96 43-96 96c0 8.8 7.2 16 16 16s16-7.2 16-16c0-35.3 28.7-64 64-64zM128 480V317.1c10.4 1.9 21.1 2.9 32 2.9s21.6-1 32-2.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32z"]
            }, P8 = {
              prefix: "fas",
              iconName: "hamsa",
              icon: [512, 512, [], "f665", "M34.6 288H80c8.8 0 16-7.2 16-16V72c0-22.1 17.9-40 40-40s40 17.9 40 40V204c0 11 9 20 20 20s20-9 20-20V40c0-22.1 17.9-40 40-40s40 17.9 40 40V204c0 11 9 20 20 20s20-9 20-20V72c0-22.1 17.9-40 40-40s40 17.9 40 40V272c0 8.8 7.2 16 16 16h45.4c19.1 0 34.6 15.5 34.6 34.6c0 8.6-3.2 16.9-9 23.3L416.6 441c-41.1 45.2-99.4 71-160.6 71s-119.4-25.8-160.6-71L9 345.9c-5.8-6.4-9-14.7-9-23.3C0 303.5 15.5 288 34.6 288zM256 288c-38.4 0-76.8 35.8-90.6 50.2c-3.6 3.7-5.4 8.7-5.4 13.8s1.8 10.1 5.4 13.8C179.2 380.2 217.6 416 256 416s76.8-35.8 90.6-50.2c3.6-3.7 5.4-8.7 5.4-13.8s-1.8-10.1-5.4-13.8C332.8 323.8 294.4 288 256 288zm0 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, c8 = {
              prefix: "fas",
              iconName: "cent-sign",
              icon: [384, 512, [], "e3f5", "M224 0c17.7 0 32 14.3 32 32V66.7c30.9 5.2 59.2 17.7 83.2 35.8c14.1 10.6 17 30.7 6.4 44.8s-30.7 17-44.8 6.4C279.4 137.5 252.9 128 224 128c-70.7 0-128 57.3-128 128s57.3 128 128 128c28.9 0 55.4-9.5 76.8-25.6c14.1-10.6 34.2-7.8 44.8 6.4s7.8 34.2-6.4 44.8c-24 18-52.4 30.6-83.2 35.8V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V445.3C101.2 430.1 32 351.1 32 256s69.2-174.1 160-189.3V32c0-17.7 14.3-32 32-32z"]
            }, wu = {
              prefix: "fas",
              iconName: "flask",
              icon: [448, 512, [], "f0c3", "M288 0H160 128C110.3 0 96 14.3 96 32s14.3 32 32 32V196.8c0 11.8-3.3 23.5-9.5 33.5L10.3 406.2C3.6 417.2 0 429.7 0 442.6C0 480.9 31.1 512 69.4 512H378.6c38.3 0 69.4-31.1 69.4-69.4c0-12.8-3.6-25.4-10.3-36.4L329.5 230.4c-6.2-10.1-9.5-21.7-9.5-33.5V64c17.7 0 32-14.3 32-32s-14.3-32-32-32H288zM192 196.8V64h64V196.8c0 23.7 6.6 46.9 19 67.1L309.5 320h-171L173 263.9c12.4-20.2 19-43.4 19-67.1z"]
            }, ux = {
              prefix: "fas",
              iconName: "person-pregnant",
              icon: [384, 512, [], "e31e", "M192 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM120 383c-13.8-3.6-24-16.1-24-31V296.9l-4.6 7.6c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c15-24.9 40.3-41.5 68.7-45.6c4.1-.6 8.2-1 12.5-1h1.1 12.5H192c1.4 0 2.8 .1 4.1 .3c35.7 2.9 65.4 29.3 72.1 65l6.1 32.5c44.3 8.6 77.7 47.5 77.7 94.3v32c0 17.7-14.3 32-32 32H304 264v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V384h-8-8v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V383z"]
            }, lx = {
              prefix: "fas",
              iconName: "wand-sparkles",
              icon: [512, 512, [], "f72b", "M464 6.1c9.5-8.5 24-8.1 33 .9l8 8c9 9 9.4 23.5 .9 33l-85.8 95.9c-2.6 2.9-4.1 6.7-4.1 10.7V176c0 8.8-7.2 16-16 16H384.2c-4.6 0-8.9 1.9-11.9 5.3L100.7 500.9C94.3 508 85.3 512 75.8 512c-8.8 0-17.3-3.5-23.5-9.8L9.7 459.7C3.5 453.4 0 445 0 436.2c0-9.5 4-18.5 11.1-24.8l111.6-99.8c3.4-3 5.3-7.4 5.3-11.9V272c0-8.8 7.2-16 16-16h34.6c3.9 0 7.7-1.5 10.7-4.1L464 6.1zM432 288c3.6 0 6.7 2.4 7.7 5.8l14.8 51.7 51.7 14.8c3.4 1 5.8 4.1 5.8 7.7s-2.4 6.7-5.8 7.7l-51.7 14.8-14.8 51.7c-1 3.4-4.1 5.8-7.7 5.8s-6.7-2.4-7.7-5.8l-14.8-51.7-51.7-14.8c-3.4-1-5.8-4.1-5.8-7.7s2.4-6.7 5.8-7.7l51.7-14.8 14.8-51.7c1-3.4 4.1-5.8 7.7-5.8zM87.7 69.8l14.8 51.7 51.7 14.8c3.4 1 5.8 4.1 5.8 7.7s-2.4 6.7-5.8 7.7l-51.7 14.8L87.7 218.2c-1 3.4-4.1 5.8-7.7 5.8s-6.7-2.4-7.7-5.8L57.5 166.5 5.8 151.7c-3.4-1-5.8-4.1-5.8-7.7s2.4-6.7 5.8-7.7l51.7-14.8L72.3 69.8c1-3.4 4.1-5.8 7.7-5.8s6.7 2.4 7.7 5.8zM208 0c3.7 0 6.9 2.5 7.8 6.1l6.8 27.3 27.3 6.8c3.6 .9 6.1 4.1 6.1 7.8s-2.5 6.9-6.1 7.8l-27.3 6.8-6.8 27.3c-.9 3.6-4.1 6.1-7.8 6.1s-6.9-2.5-7.8-6.1l-6.8-27.3-27.3-6.8c-3.6-.9-6.1-4.1-6.1-7.8s2.5-6.9 6.1-7.8l27.3-6.8 6.8-27.3c.9-3.6 4.1-6.1 7.8-6.1z"]
            }, l2 = {
              prefix: "fas",
              iconName: "ellipsis-vertical",
              icon: [128, 512, ["ellipsis-v"], "f142", "M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"]
            }, P2 = l2, c2 = {
              prefix: "fas",
              iconName: "ticket",
              icon: [576, 512, [127903], "f145", "M64 64C28.7 64 0 92.7 0 128v64c0 8.8 7.4 15.7 15.7 18.6C34.5 217.1 48 235 48 256s-13.5 38.9-32.3 45.4C7.4 304.3 0 311.2 0 320v64c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V320c0-8.8-7.4-15.7-15.7-18.6C541.5 294.9 528 277 528 256s13.5-38.9 32.3-45.4c8.3-2.9 15.7-9.8 15.7-18.6V128c0-35.3-28.7-64-64-64H64zm64 112l0 160c0 8.8 7.2 16 16 16H432c8.8 0 16-7.2 16-16V176c0-8.8-7.2-16-16-16H144c-8.8 0-16 7.2-16 16zM96 160c0-17.7 14.3-32 32-32H448c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H128c-17.7 0-32-14.3-32-32V160z"]
            }, p2 = {
              prefix: "fas",
              iconName: "power-off",
              icon: [512, 512, [9211], "f011", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V256c0 17.7 14.3 32 32 32s32-14.3 32-32V32zM143.5 120.6c13.6-11.3 15.4-31.5 4.1-45.1s-31.5-15.4-45.1-4.1C49.7 115.4 16 181.8 16 256c0 132.5 107.5 240 240 240s240-107.5 240-240c0-74.2-33.8-140.6-86.6-184.6c-13.6-11.3-33.8-9.4-45.1 4.1s-9.4 33.8 4.1 45.1c38.9 32.3 63.5 81 63.5 135.4c0 97.2-78.8 176-176 176s-176-78.8-176-176c0-54.4 24.7-103.1 63.5-135.4z"]
            }, Cf = {
              prefix: "fas",
              iconName: "right-long",
              icon: [512, 512, ["long-arrow-alt-right"], "f30b", "M334.5 414c8.8 3.8 19 2 26-4.6l144-136c4.8-4.5 7.5-10.8 7.5-17.4s-2.7-12.9-7.5-17.4l-144-136c-7-6.6-17.2-8.4-26-4.6s-14.5 12.5-14.5 22l0 72L32 192c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l288 0 0 72c0 9.6 5.7 18.2 14.5 22z"]
            }, BB = Cf, sw = {
              prefix: "fas",
              iconName: "flag-usa",
              icon: [448, 512, [], "f74d", "M32 0C49.7 0 64 14.3 64 32V48l69-17.2c38.1-9.5 78.3-5.1 113.5 12.5c46.3 23.2 100.8 23.2 147.1 0l9.6-4.8C423.8 28.1 448 43.1 448 66.1v36.1l-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-20.3-9-41.8-14.7-63.6-16.9v32.2c17.4 2.1 34.4 6.7 50.6 13.9l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4L448 136.3v62l-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-40.2-17.9-85-22.5-128.1-13.3L64 203.1v32.7l70.2-15.1c36.4-7.8 74.3-3.9 108.4 11.3l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4L448 232.3v62l-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-40.2-17.9-85-22.5-128.1-13.3L64 299.1v32.7l70.2-15.1c36.4-7.8 74.3-3.9 108.4 11.3l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4L448 328.3v33.5c0 13.3-8.3 25.3-20.8 30l-34.7 13c-46.2 17.3-97.6 14.6-141.7-7.4c-37.9-19-81.3-23.7-122.5-13.4L64 400v80c0 17.7-14.3 32-32 32s-32-14.3-32-32V416 345.5 312.8 249.5 216.8 153.5 120.8 64 32C0 14.3 14.3 0 32 0zm80 96A16 16 0 1 0 80 96a16 16 0 1 0 32 0zm32 0a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm-32 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm32 0a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
            }, WB = {
              prefix: "fas",
              iconName: "laptop-file",
              icon: [640, 512, [], "e51d", "M128 0C92.7 0 64 28.7 64 64V288H19.2C8.6 288 0 296.6 0 307.2C0 349.6 34.4 384 76.8 384H320V288H128V64H448V96h64V64c0-35.3-28.7-64-64-64H128zM512 128H400c-26.5 0-48 21.5-48 48V464c0 26.5 21.5 48 48 48H592c26.5 0 48-21.5 48-48V256H544c-17.7 0-32-14.3-32-32V128zm32 0v96h96l-96-96z"]
            }, Px = {
              prefix: "fas",
              iconName: "tty",
              icon: [512, 512, ["teletype"], "f1e4", "M38.3 241.3L15.1 200.6c-9.2-16.2-8.4-36.5 4.5-50C61.4 106.8 144.7 48 256 48s194.6 58.8 236.4 102.6c12.9 13.5 13.7 33.8 4.5 50l-23.1 40.7c-7.5 13.2-23.3 19.3-37.8 14.6l-81.1-26.6c-13.1-4.3-22-16.6-22-30.4V144c-49.6-18.1-104-18.1-153.6 0v54.8c0 13.8-8.9 26.1-22 30.4L76.1 255.8c-14.5 4.7-30.3-1.4-37.8-14.6zM32 336c0-8.8 7.2-16 16-16H80c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H48c-8.8 0-16-7.2-16-16V336zm0 96c0-8.8 7.2-16 16-16H80c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H48c-8.8 0-16-7.2-16-16V432zM144 320h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H144c-8.8 0-16-7.2-16-16V336c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H240c-8.8 0-16-7.2-16-16V336zm112-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H336c-8.8 0-16-7.2-16-16V336c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H432c-8.8 0-16-7.2-16-16V336zm16 80h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H432c-8.8 0-16-7.2-16-16V432c0-8.8 7.2-16 16-16zM128 432c0-8.8 7.2-16 16-16H368c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H144c-8.8 0-16-7.2-16-16V432z"]
            }, wH = Px, p8 = {
              prefix: "fas",
              iconName: "diagram-next",
              icon: [512, 512, [], "e476", "M512 160c0 35.3-28.7 64-64 64H280v64h46.1c21.4 0 32.1 25.9 17 41L273 399c-9.4 9.4-24.6 9.4-33.9 0L169 329c-15.1-15.1-4.4-41 17-41H232V224H64c-35.3 0-64-28.7-64-64V96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64v64zM448 416V352H365.3l.4-.4c18.4-18.4 20.4-43.7 11-63.6l71.3 0c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64V352c0-35.3 28.7-64 64-64l71.3 0c-9.4 19.9-7.4 45.2 11 63.6l.4 .4H64v64H210.7l5.7 5.7c21.9 21.9 57.3 21.9 79.2 0l5.7-5.7H448z"]
            }, p6 = {
              prefix: "fas",
              iconName: "person-rifle",
              icon: [576, 512, [], "e54e", "M265.2 192c25.4 0 49.8 7.1 70.8 19.9V512H144V337.7L90.4 428.3c-11.2 19-35.8 25.3-54.8 14.1s-25.3-35.8-14.1-54.8L97.7 258.8c24.5-41.4 69-66.8 117.1-66.8h50.4zM160 80a80 80 0 1 1 160 0A80 80 0 1 1 160 80zM448 0c8.8 0 16 7.2 16 16V132.3c9.6 5.5 16 15.9 16 27.7V269.3l16-5.3V208c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v84.5c0 6.9-4.4 13-10.9 15.2L480 325.3V352h48c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H484l23 92.1c2.5 10.1-5.1 19.9-15.5 19.9H432c-8.8 0-16-7.2-16-16V400H400c-17.7 0-32-14.3-32-32V224c0-17.7 14.3-32 32-32V160c0-11.8 6.4-22.2 16-27.7V32c-8.8 0-16-7.2-16-16s7.2-16 16-16h16 16z"]
            }, SB = {
              prefix: "fas",
              iconName: "house-medical-circle-exclamation",
              icon: [640, 512, [], "e512", "M320 368c0 59.5 29.5 112.1 74.8 144H128.1c-35.3 0-64-28.7-64-64V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L522.1 193.9c-8.5-1.3-17.3-1.9-26.1-1.9c-54.7 0-103.5 24.9-135.8 64H320V208c0-8.8-7.2-16-16-16H272c-8.8 0-16 7.2-16 16v48H208c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h48v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16v80c0 8.8 7.2 16 16 16s16-7.2 16-16V288c0-8.8-7.2-16-16-16z"]
            }, Qn = {
              prefix: "fas",
              iconName: "closed-captioning",
              icon: [576, 512, [], "f20a", "M0 96C0 60.7 28.7 32 64 32H512c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM200 208c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48s21.5-48 48-48zm144 48c0-26.5 21.5-48 48-48c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48z"]
            }, ep = {
              prefix: "fas",
              iconName: "person-hiking",
              icon: [384, 512, ["hiking"], "f6ec", "M192 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm51.3 182.7L224.2 307l49.7 49.7c9 9 14.1 21.2 14.1 33.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V397.3l-73.9-73.9c-15.8-15.8-22.2-38.6-16.9-60.3l20.4-84c8.3-34.1 42.7-54.9 76.7-46.4c19 4.8 35.6 16.4 46.4 32.7L305.1 208H336V184c0-13.3 10.7-24 24-24s24 10.7 24 24v55.8c0 .1 0 .2 0 .2s0 .2 0 .2V488c0 13.3-10.7 24-24 24s-24-10.7-24-24V272H296.6c-16 0-31-8-39.9-21.4l-13.3-20zM81.1 471.9L117.3 334c3 4.2 6.4 8.2 10.1 11.9l41.9 41.9L142.9 488.1c-4.5 17.1-22 27.3-39.1 22.8s-27.3-22-22.8-39.1zm55.5-346L101.4 266.5c-3 12.1-14.9 19.9-27.2 17.9l-47.9-8c-14-2.3-22.9-16.3-19.2-30L31.9 155c9.5-34.8 41.1-59 77.2-59h4.2c15.6 0 27.1 14.7 23.3 29.8z"]
            }, mH = ep, a0 = {
              prefix: "fas",
              iconName: "venus-double",
              icon: [640, 512, [9890], "f226", "M192 288a112 112 0 1 0 0-224 112 112 0 1 0 0 224zM368 176c0 86.3-62.1 158.1-144 173.1V384h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H224v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448H128c-17.7 0-32-14.3-32-32s14.3-32 32-32h32V349.1C78.1 334.1 16 262.3 16 176C16 78.8 94.8 0 192 0s176 78.8 176 176zM344 318c14.6-15.6 26.8-33.4 36-53c18.8 14.4 42.4 23 68 23c61.9 0 112-50.1 112-112s-50.1-112-112-112c-25.6 0-49.1 8.6-68 23c-9.3-19.5-21.5-37.4-36-53C373.1 12.6 409.1 0 448 0c97.2 0 176 78.8 176 176c0 86.3-62.1 158.1-144 173.1V384h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H480v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448H384c-17.7 0-32-14.3-32-32s14.3-32 32-32h32V349.1c-26.6-4.9-51.1-15.7-72-31.1z"]
            }, UB = {
              prefix: "fas",
              iconName: "images",
              icon: [576, 512, [], "f302", "M160 32c-35.3 0-64 28.7-64 64V320c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H160zM396 138.7l96 144c4.9 7.4 5.4 16.8 1.2 24.6S480.9 320 472 320H328 280 200c-9.2 0-17.6-5.3-21.6-13.6s-2.9-18.2 2.9-25.4l64-80c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l17.3 21.6 56-84C360.5 132 368 128 376 128s15.5 4 20 10.7zM192 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120V344c0 75.1 60.9 136 136 136H456c13.3 0 24-10.7 24-24s-10.7-24-24-24H136c-48.6 0-88-39.4-88-88V120z"]
            }, aw = {
              prefix: "fas",
              iconName: "calculator",
              icon: [384, 512, [128425], "f1ec", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM96 64H288c17.7 0 32 14.3 32 32v32c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zm32 160a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zM96 352a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM64 416c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32-14.3-32-32zM192 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm32 64a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm64-64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm32 64a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zM288 448a32 32 0 1 1 0-64 32 32 0 1 1 0 64z"]
            }, cx = {
              prefix: "fas",
              iconName: "people-pulling",
              icon: [576, 512, [], "e535", "M80 96A48 48 0 1 0 80 0a48 48 0 1 0 0 96zM64 128c-35.3 0-64 28.7-64 64V320c0 17.7 14.3 32 32 32c9.8 0 18.5-4.4 24.4-11.2L80.4 485.3c2.9 17.4 19.4 29.2 36.8 26.3s29.2-19.4 26.3-36.8L123.1 352h15.7l30 134.9c3.8 17.3 20.9 28.1 38.2 24.3s28.1-20.9 24.3-38.2l-57.3-258 116.3 53.8c.5 .3 1.1 .5 1.6 .7c8.6 3.6 18 3.1 25.9-.7c3.4-1.6 6.6-3.9 9.3-6.7c3.1-3.2 5.5-7 7.1-11.4c.1-.3 .2-.7 .3-1l2.5-7.5c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L537 232.7l-15.3-36.8C504.5 154.8 464.3 128 419.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-24.4 10.9-44.6 29-58.1 51.6L157.3 136.9C144.7 131 130.9 128 117 128H64zM464 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM349.7 335.6l-25 62.4-59.4 59.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L372.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6z"]
            }, IB = {
              prefix: "fas",
              iconName: "n",
              icon: [384, 512, [110], "4e", "M21.1 33.9c12.7-4.6 26.9-.7 35.5 9.6L320 359.6V64c0-17.7 14.3-32 32-32s32 14.3 32 32V448c0 13.5-8.4 25.5-21.1 30.1s-26.9 .7-35.5-9.6L64 152.4V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V64C0 50.5 8.4 38.5 21.1 33.9z"]
            }, jv = {
              prefix: "fas",
              iconName: "cable-car",
              icon: [512, 512, [128673, 57551, "tram"], "f7da", "M288 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM160 56a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM32 288c0-35.3 28.7-64 64-64H232V157.5l-203.1 42c-13 2.7-25.7-5.7-28.4-18.6s5.7-25.7 18.6-28.4l232-48 232-48c13-2.7 25.7 5.7 28.4 18.6s-5.7 25.7-18.6 28.4L280 147.5V224H416c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V288zm64 0c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16V304c0-8.8-7.2-16-16-16H96zm112 16v64c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16V304c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16V304c0-8.8-7.2-16-16-16H352z"]
            }, BH = jv, h2 = {
              prefix: "fas",
              iconName: "cloud-rain",
              icon: [512, 512, [127783, 9926], "f73d", "M96 320c-53 0-96-43-96-96c0-42.5 27.6-78.6 65.9-91.2C64.7 126.1 64 119.1 64 112C64 50.1 114.1 0 176 0c43.1 0 80.5 24.3 99.2 60c14.7-17.1 36.5-28 60.8-28c44.2 0 80 35.8 80 80c0 5.5-.6 10.8-1.6 16c.5 0 1.1 0 1.6 0c53 0 96 43 96 96s-43 96-96 96H96zm-6.8 52c1.3-2.5 3.9-4 6.8-4s5.4 1.5 6.8 4l35.1 64.6c4.1 7.5 6.2 15.8 6.2 24.3v3c0 26.5-21.5 48-48 48s-48-21.5-48-48v-3c0-8.5 2.1-16.9 6.2-24.3L89.2 372zm160 0c1.3-2.5 3.9-4 6.8-4s5.4 1.5 6.8 4l35.1 64.6c4.1 7.5 6.2 15.8 6.2 24.3v3c0 26.5-21.5 48-48 48s-48-21.5-48-48v-3c0-8.5 2.1-16.9 6.2-24.3L249.2 372zm124.9 64.6L409.2 372c1.3-2.5 3.9-4 6.8-4s5.4 1.5 6.8 4l35.1 64.6c4.1 7.5 6.2 15.8 6.2 24.3v3c0 26.5-21.5 48-48 48s-48-21.5-48-48v-3c0-8.5 2.1-16.9 6.2-24.3z"]
            }, ow = {
              prefix: "fas",
              iconName: "building-circle-xmark",
              icon: [640, 512, [], "e4d4", "M48 0C21.5 0 0 21.5 0 48V464c0 26.5 21.5 48 48 48h96V432c0-26.5 21.5-48 48-48s48 21.5 48 48v80h96c15.1 0 28.5-6.9 37.3-17.8C340.4 462.2 320 417.5 320 368c0-54.7 24.9-103.5 64-135.8V48c0-26.5-21.5-48-48-48H48zM64 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V240zm112-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V240zM80 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V112zM272 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
            }, RB = {
              prefix: "fas",
              iconName: "ship",
              icon: [576, 512, [128674], "f21a", "M192 32c0-17.7 14.3-32 32-32H352c17.7 0 32 14.3 32 32V64h48c26.5 0 48 21.5 48 48V240l44.4 14.8c23.1 7.7 29.5 37.5 11.5 53.9l-101 92.6c-16.2 9.4-34.7 15.1-50.9 15.1c-19.6 0-40.8-7.7-59.2-20.3c-22.1-15.5-51.6-15.5-73.7 0c-17.1 11.8-38 20.3-59.2 20.3c-16.2 0-34.7-5.7-50.9-15.1l-101-92.6c-18-16.5-11.6-46.2 11.5-53.9L96 240V112c0-26.5 21.5-48 48-48h48V32zM160 218.7l107.8-35.9c13.1-4.4 27.3-4.4 40.5 0L416 218.7V128H160v90.7zM306.5 421.9C329 437.4 356.5 448 384 448c26.9 0 55.4-10.8 77.4-26.1l0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 501.7 417 512 384 512c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7l0 0C136.7 437.2 165.1 448 192 448c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
            }, px = {
              prefix: "fas",
              iconName: "arrows-down-to-line",
              icon: [576, 512, [], "e4b8", "M544 416L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32zm22.6-137.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L480 274.7 480 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7-41.4-41.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96zm-320-45.3c-12.5-12.5-32.8-12.5-45.3 0L160 274.7 160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7L54.6 233.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3z"]
            }, VB = {
              prefix: "fas",
              iconName: "download",
              icon: [512, 512, [], "f019", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, fw = {
              prefix: "fas",
              iconName: "face-grin",
              icon: [512, 512, [128512, "grin"], "f580", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, mu = fw, Ul = {
              prefix: "fas",
              iconName: "delete-left",
              icon: [576, 512, [9003, "backspace"], "f55a", "M576 128c0-35.3-28.7-64-64-64H205.3c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7H512c35.3 0 64-28.7 64-64V128zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
            }, tp = Ul, hx = {
              prefix: "fas",
              iconName: "eye-dropper",
              icon: [512, 512, ["eye-dropper-empty", "eyedropper"], "f1fb", "M341.6 29.2L240.1 130.8l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4L482.8 170.4c39-39 39-102.2 0-141.1s-102.2-39-141.1 0zM55.4 323.3c-15 15-23.4 35.4-23.4 56.6v42.4L5.4 462.2c-8.5 12.7-6.8 29.6 4 40.4s27.7 12.5 40.4 4L89.7 480h42.4c21.2 0 41.6-8.4 56.6-23.4L309.4 335.9l-45.3-45.3L143.4 411.3c-3 3-7.1 4.7-11.3 4.7H96V379.9c0-4.2 1.7-8.3 4.7-11.3L221.4 247.9l-45.3-45.3L55.4 323.3z"]
            }, CB = hx, OB = hx, Aw = {
              prefix: "fas",
              iconName: "file-circle-check",
              icon: [576, 512, [], "e5a0", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384v38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM288 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L416 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
            }, yB = {
              prefix: "fas",
              iconName: "forward",
              icon: [512, 512, [9193], "f04e", "M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4L224 214.3V256v41.7L52.5 440.6zM256 352V256 128 96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4s-18.4-16.6-18.4-29V352z"]
            }, h8 = {
              prefix: "fas",
              iconName: "mobile",
              icon: [384, 512, [128241, "mobile-android", "mobile-phone"], "f3ce", "M80 0C44.7 0 16 28.7 16 64V448c0 35.3 28.7 64 64 64H304c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H80zm80 432h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H160c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, H8 = h8, Hx = h8, WH = {
              prefix: "fas",
              iconName: "face-meh",
              icon: [512, 512, [128528, "meh"], "f11a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM160 336H352c8.8 0 16 7.2 16 16s-7.2 16-16 16H160c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, kB = WH, H2 = {
              prefix: "fas",
              iconName: "align-center",
              icon: [448, 512, [], "f037", "M352 64c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32z"]
            }, g8 = {
              prefix: "fas",
              iconName: "book-skull",
              icon: [448, 512, ["book-dead"], "f6b7", "M0 96C0 43 43 0 96 0H384h32c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32v64c17.7 0 32 14.3 32 32s-14.3 32-32 32H384 96c-53 0-96-43-96-96V96zM64 416c0 17.7 14.3 32 32 32H352V384H96c-17.7 0-32 14.3-32 32zM320 112c0-35.3-35.8-64-80-64s-80 28.7-80 64c0 20.9 12.6 39.5 32 51.2V176c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16V163.2c19.4-11.7 32-30.3 32-51.2zM208 96a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM134.3 209.3c-8.1-3.5-17.5 .3-21 8.4s.3 17.5 8.4 21L199.4 272l-77.7 33.3c-8.1 3.5-11.9 12.9-8.4 21s12.9 11.9 21 8.4L240 289.4l105.7 45.3c8.1 3.5 17.5-.3 21-8.4s-.3-17.5-8.4-21L280.6 272l77.7-33.3c8.1-3.5 11.9-12.9 8.4-21s-12.9-11.9-21-8.4L240 254.6 134.3 209.3z"]
            }, S9 = g8, id = {
              prefix: "fas",
              iconName: "id-card",
              icon: [576, 512, [62147, "drivers-license"], "f2c2", "M0 96l576 0c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96zm0 32V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V128H0zM64 405.3c0-29.5 23.9-53.3 53.3-53.3H234.7c29.5 0 53.3 23.9 53.3 53.3c0 5.9-4.8 10.7-10.7 10.7H74.7c-5.9 0-10.7-4.8-10.7-10.7zM176 192a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm176 16c0-8.8 7.2-16 16-16H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16z"]
            }, EB = id, wv = {
              prefix: "fas",
              iconName: "outdent",
              icon: [448, 512, ["dedent"], "f03b", "M0 64C0 46.3 14.3 32 32 32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32zm32 96H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM.2 268.6c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6V335.3c0 13.3-15.3 20.8-25.8 12.6L.2 268.6z"]
            }, gx = wv, dw = {
              prefix: "fas",
              iconName: "heart-circle-exclamation",
              icon: [576, 512, [], "e4fe", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16v80c0 8.8-7.2 16-16 16s-16-7.2-16-16V288c0-8.8 7.2-16 16-16z"]
            }, X8 = {
              prefix: "fas",
              iconName: "house",
              icon: [576, 512, [127968, 63498, 63500, "home", "home-alt", "home-lg-alt"], "f015", "M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"]
            }, vw = X8, uw = X8, Bu = X8, T8 = {
              prefix: "fas",
              iconName: "calendar-week",
              icon: [448, 512, [], "f784", "M128 0c17.7 0 32 14.3 32 32V64H288V32c0-17.7 14.3-32 32-32s32 14.3 32 32V64h48c26.5 0 48 21.5 48 48v48H0V112C0 85.5 21.5 64 48 64H96V32c0-17.7 14.3-32 32-32zM0 192H448V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V192zm80 64c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16H368c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H80z"]
            }, Cd = {
              prefix: "fas",
              iconName: "laptop-medical",
              icon: [640, 512, [], "f812", "M64 96c0-35.3 28.7-64 64-64H512c35.3 0 64 28.7 64 64V352H512V96H128V352H64V96zM0 403.2C0 392.6 8.6 384 19.2 384H620.8c10.6 0 19.2 8.6 19.2 19.2c0 42.4-34.4 76.8-76.8 76.8H76.8C34.4 480 0 445.6 0 403.2zM288 160c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v48h48c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H352v48c0 8.8-7.2 16-16 16H304c-8.8 0-16-7.2-16-16V272H240c-8.8 0-16-7.2-16-16V224c0-8.8 7.2-16 16-16h48V160z"]
            }, lw = {
              prefix: "fas",
              iconName: "b",
              icon: [320, 512, [98], "42", "M64 32C28.7 32 0 60.7 0 96V256 416c0 35.3 28.7 64 64 64H192c70.7 0 128-57.3 128-128c0-46.5-24.8-87.3-62-109.7c18.7-22.3 30-51 30-82.3c0-70.7-57.3-128-128-128H64zm96 192H64V96h96c35.3 0 64 28.7 64 64s-28.7 64-64 64zM64 288h96 32c35.3 0 64 28.7 64 64s-28.7 64-64 64H64V288z"]
            }, rc = {
              prefix: "fas",
              iconName: "file-medical",
              icon: [384, 512, [], "f477", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM160 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v48h48c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H224v48c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V352H112c-8.8 0-16-7.2-16-16V304c0-8.8 7.2-16 16-16h48V240z"]
            }, q8 = {
              prefix: "fas",
              iconName: "dice-one",
              icon: [448, 512, [9856], "f525", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM224 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, Pw = {
              prefix: "fas",
              iconName: "kiwi-bird",
              icon: [576, 512, [], "f535", "M291.2 388.4c31.2-18.8 64.7-36.4 101.1-36.4H448c4.6 0 9.1-.2 13.6-.7l85.3 121.9c4 5.7 11.3 8.2 17.9 6.1s11.2-8.3 11.2-15.3V224c0-70.7-57.3-128-128-128H392.3c-36.4 0-69.9-17.6-101.1-36.4C262.3 42.1 228.3 32 192 32C86 32 0 118 0 224c0 71.1 38.6 133.1 96 166.3V456c0 13.3 10.7 24 24 24s24-10.7 24-24V410c15.3 3.9 31.4 6 48 6c5.4 0 10.7-.2 16-.7V456c0 13.3 10.7 24 24 24s24-10.7 24-24V405.1c12.4-4.4 24.2-10 35.2-16.7zM448 200a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, Xx = {
              prefix: "fas",
              iconName: "arrow-right-arrow-left",
              icon: [448, 512, [8644, "exchange"], "f0ec", "M438.6 150.6c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.7 96 32 96C14.3 96 0 110.3 0 128s14.3 32 32 32l306.7 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l96-96zm-333.3 352c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 416 416 416c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96z"]
            }, FB = Xx, g2 = {
              prefix: "fas",
              iconName: "rotate-right",
              icon: [512, 512, ["redo-alt", "rotate-forward"], "f2f9", "M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z"]
            }, mv = g2, SH = g2, cw = {
              prefix: "fas",
              iconName: "utensils",
              icon: [448, 512, [127860, 61685, "cutlery"], "f2e7", "M416 0C400 0 288 32 288 176V288c0 35.3 28.7 64 64 64h32V480c0 17.7 14.3 32 32 32s32-14.3 32-32V352 240 32c0-17.7-14.3-32-32-32zM64 16C64 7.8 57.9 1 49.7 .1S34.2 4.6 32.4 12.5L2.1 148.8C.7 155.1 0 161.5 0 167.9c0 45.9 35.1 83.6 80 87.7V480c0 17.7 14.3 32 32 32s32-14.3 32-32V255.6c44.9-4.1 80-41.8 80-87.7c0-6.4-.7-12.8-2.1-19.1L191.6 12.5c-1.8-8-9.3-13.3-17.4-12.4S160 7.8 160 16V150.2c0 5.4-4.4 9.8-9.8 9.8c-5.1 0-9.3-3.9-9.8-9L127.9 14.6C127.2 6.3 120.3 0 112 0s-15.2 6.3-15.9 14.6L83.7 151c-.5 5.1-4.7 9-9.8 9c-5.4 0-9.8-4.4-9.8-9.8V16zm48.3 152l-.3 0-.3 0 .3-.7 .3 .7z"]
            }, UH = cw, b8 = {
              prefix: "fas",
              iconName: "arrow-up-wide-short",
              icon: [576, 512, ["sort-amount-up"], "f161", "M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3V448c0 17.7 14.3 32 32 32s32-14.3 32-32V146.3l32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 480h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32s14.3 32 32 32z"]
            }, Tx = b8, pw = {
              prefix: "fas",
              iconName: "mill-sign",
              icon: [384, 512, [], "e1ed", "M302.1 42.8c5.9-16.6-2.7-35-19.4-40.9s-35 2.7-40.9 19.4L208 116.1c-5.7 4-11.1 8.5-16 13.5C171.7 108.9 143.3 96 112 96c-19.5 0-37.8 5-53.7 13.7C52.5 101.4 42.9 96 32 96C14.3 96 0 110.3 0 128v80V416c0 17.7 14.3 32 32 32s32-14.3 32-32V208c0-26.5 21.5-48 48-48s48 21.5 48 48v42.5L81.9 469.2c-5.9 16.6 2.7 35 19.4 40.9s35-2.7 40.9-19.4l21.4-60C168.9 441 179.6 448 192 448c17.7 0 32-14.3 32-32V261.5l35.7-100c3.9-1 8.1-1.6 12.3-1.6c26.5 0 48 21.5 48 48V416c0 17.7 14.3 32 32 32s32-14.3 32-32V208c0-58.2-44.3-106-101.1-111.5l19.2-53.8z"]
            }, hw = {
              prefix: "fas",
              iconName: "bowl-rice",
              icon: [512, 512, [], "e2eb", "M176 56c0-13.3 10.7-24 24-24h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H200c-13.3 0-24-10.7-24-24zm24 48h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H200c-13.3 0-24-10.7-24-24s10.7-24 24-24zM56 176H72c13.3 0 24 10.7 24 24s-10.7 24-24 24H56c-13.3 0-24-10.7-24-24s10.7-24 24-24zM0 283.4C0 268.3 12.3 256 27.4 256H484.6c15.1 0 27.4 12.3 27.4 27.4c0 70.5-44.4 130.7-106.7 154.1L403.5 452c-2 16-15.6 28-31.8 28H140.2c-16.1 0-29.8-12-31.8-28l-1.8-14.4C44.4 414.1 0 353.9 0 283.4zM224 200c0-13.3 10.7-24 24-24h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H248c-13.3 0-24-10.7-24-24zm-96 0c0-13.3 10.7-24 24-24h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H152c-13.3 0-24-10.7-24-24zm-24-96h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H104c-13.3 0-24-10.7-24-24s10.7-24 24-24zm216 96c0-13.3 10.7-24 24-24h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H344c-13.3 0-24-10.7-24-24zm-24-96h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H296c-13.3 0-24-10.7-24-24s10.7-24 24-24zm120 96c0-13.3 10.7-24 24-24h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H440c-13.3 0-24-10.7-24-24zm-24-96h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H392c-13.3 0-24-10.7-24-24s10.7-24 24-24zM296 32h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H296c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
            }, NB = {
              prefix: "fas",
              iconName: "skull",
              icon: [512, 512, [128128], "f54c", "M416 398.9c58.5-41.1 96-104.1 96-174.9C512 100.3 397.4 0 256 0S0 100.3 0 224c0 70.7 37.5 133.8 96 174.9c0 .4 0 .7 0 1.1v64c0 26.5 21.5 48 48 48h48V464c0-8.8 7.2-16 16-16s16 7.2 16 16v48h64V464c0-8.8 7.2-16 16-16s16 7.2 16 16v48h48c26.5 0 48-21.5 48-48V400c0-.4 0-.7 0-1.1zM96 256a64 64 0 1 1 128 0A64 64 0 1 1 96 256zm256-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
            }, Hw = {
              prefix: "fas",
              iconName: "tower-broadcast",
              icon: [576, 512, ["broadcast-tower"], "f519", "M80.3 44C69.8 69.9 64 98.2 64 128s5.8 58.1 16.3 84c6.6 16.4-1.3 35-17.7 41.7s-35-1.3-41.7-17.7C7.4 202.6 0 166.1 0 128S7.4 53.4 20.9 20C27.6 3.6 46.2-4.3 62.6 2.3S86.9 27.6 80.3 44zM555.1 20C568.6 53.4 576 89.9 576 128s-7.4 74.6-20.9 108c-6.6 16.4-25.3 24.3-41.7 17.7S489.1 228.4 495.7 212c10.5-25.9 16.3-54.2 16.3-84s-5.8-58.1-16.3-84C489.1 27.6 497 9 513.4 2.3s35 1.3 41.7 17.7zM352 128c0 23.7-12.9 44.4-32 55.4V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V183.4c-19.1-11.1-32-31.7-32-55.4c0-35.3 28.7-64 64-64s64 28.7 64 64zM170.6 76.8C163.8 92.4 160 109.7 160 128s3.8 35.6 10.6 51.2c7.1 16.2-.3 35.1-16.5 42.1s-35.1-.3-42.1-16.5c-10.3-23.6-16-49.6-16-76.8s5.7-53.2 16-76.8c7.1-16.2 25.9-23.6 42.1-16.5s23.6 25.9 16.5 42.1zM464 51.2c10.3 23.6 16 49.6 16 76.8s-5.7 53.2-16 76.8c-7.1 16.2-25.9 23.6-42.1 16.5s-23.6-25.9-16.5-42.1c6.8-15.6 10.6-32.9 10.6-51.2s-3.8-35.6-10.6-51.2c-7.1-16.2 .3-35.1 16.5-42.1s35.1 .3 42.1 16.5z"]
            }, qx = Hw, QB = {
              prefix: "fas",
              iconName: "truck-pickup",
              icon: [640, 512, [128763], "f63c", "M368.6 96l76.8 96H288V96h80.6zM224 80V192H64c-17.7 0-32 14.3-32 32v64c-17.7 0-32 14.3-32 32s14.3 32 32 32H65.1c-.7 5.2-1.1 10.6-1.1 16c0 61.9 50.1 112 112 112s112-50.1 112-112c0-5.4-.4-10.8-1.1-16h66.3c-.7 5.2-1.1 10.6-1.1 16c0 61.9 50.1 112 112 112s112-50.1 112-112c0-5.4-.4-10.8-1.1-16H608c17.7 0 32-14.3 32-32s-14.3-32-32-32V224c0-17.7-14.3-32-32-32H527.4L418.6 56c-12.1-15.2-30.5-24-50-24H272c-26.5 0-48 21.5-48 48zm0 288a48 48 0 1 1 -96 0 48 48 0 1 1 96 0zm288 0a48 48 0 1 1 -96 0 48 48 0 1 1 96 0z"]
            }, x8 = {
              prefix: "fas",
              iconName: "up-long",
              icon: [320, 512, ["long-arrow-alt-up"], "f30c", "M318 177.5c3.8-8.8 2-19-4.6-26l-136-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-136 144c-6.6 7-8.4 17.2-4.6 26S14.4 192 24 192H96l0 288c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32l0-288h72c9.6 0 18.2-5.7 22-14.5z"]
            }, YB = x8, MB = {
              prefix: "fas",
              iconName: "stop",
              icon: [384, 512, [9209], "f04d", "M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"]
            }, o0 = {
              prefix: "fas",
              iconName: "code-merge",
              icon: [448, 512, [], "f387", "M80 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm32.4 97.2c28-12.4 47.6-40.5 47.6-73.2c0-44.2-35.8-80-80-80S0 35.8 0 80c0 32.8 19.7 61 48 73.3V358.7C19.7 371 0 399.2 0 432c0 44.2 35.8 80 80 80s80-35.8 80-80c0-32.8-19.7-61-48-73.3V272c26.7 20.1 60 32 96 32h86.7c12.3 28.3 40.5 48 73.3 48c44.2 0 80-35.8 80-80s-35.8-80-80-80c-32.8 0-61 19.7-73.3 48H208c-49.9 0-91-38.1-95.6-86.8zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM344 272a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
            }, gw = {
              prefix: "fas",
              iconName: "upload",
              icon: [512, 512, [], "f093", "M288 109.3V352c0 17.7-14.3 32-32 32s-32-14.3-32-32V109.3l-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352H192c0 35.3 28.7 64 64 64s64-28.7 64-64H448c35.3 0 64 28.7 64 64v32c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V416c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
            }, LB = {
              prefix: "fas",
              iconName: "hurricane",
              icon: [384, 512, [], "f751", "M0 208C0 104.4 75.7 18.5 174.9 2.6C184 1.2 192 8.6 192 17.9V81.2c0 8.4 6.5 15.3 14.7 16.5C307 112.5 384 199 384 303.4c0 103.6-75.7 189.5-174.9 205.4c-9.2 1.5-17.1-5.9-17.1-15.2V430.2c0-8.4-6.5-15.3-14.7-16.5C77 398.9 0 312.4 0 208zm288 48A96 96 0 1 0 96 256a96 96 0 1 0 192 0zm-96-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, KB = {
              prefix: "fas",
              iconName: "mound",
              icon: [576, 512, [], "e52d", "M144.1 179.2C173.8 127.7 228.6 96 288 96s114.2 31.7 143.9 83.2L540.4 368c12.3 21.3-3.1 48-27.7 48H63.3c-24.6 0-40-26.6-27.7-48L144.1 179.2z"]
            }, Od = {
              prefix: "fas",
              iconName: "toilet-portable",
              icon: [320, 512, [], "e583", "M0 32V64H320V32c0-17.7-14.3-32-32-32H32C14.3 0 0 14.3 0 32zM24 96H0v24V488c0 13.3 10.7 24 24 24s24-10.7 24-24v-8H272v8c0 13.3 10.7 24 24 24s24-10.7 24-24V120 96H296 24zM256 240v64c0 8.8-7.2 16-16 16s-16-7.2-16-16V240c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
            }, D8 = {
              prefix: "fas",
              iconName: "compact-disc",
              icon: [512, 512, [128191, 128192, 128440], "f51f", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 32a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm-96-32a96 96 0 1 0 192 0 96 96 0 1 0 -192 0zM96 240c0-35 17.5-71.1 45.2-98.8S205 96 240 96c8.8 0 16-7.2 16-16s-7.2-16-16-16c-45.4 0-89.2 22.3-121.5 54.5S64 194.6 64 240c0 8.8 7.2 16 16 16s16-7.2 16-16z"]
            }, Xw = {
              prefix: "fas",
              iconName: "file-arrow-down",
              icon: [384, 512, ["file-download"], "f56d", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM216 232V334.1l31-31c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-72 72c-9.4 9.4-24.6 9.4-33.9 0l-72-72c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l31 31V232c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
            }, bx = Xw, nc = {
              prefix: "fas",
              iconName: "caravan",
              icon: [640, 512, [], "f8ff", "M0 112C0 67.8 35.8 32 80 32H416c88.4 0 160 71.6 160 160V352h32c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0H288c0 53-43 96-96 96s-96-43-96-96H80c-44.2 0-80-35.8-80-80V112zM320 352H448V256H416c-8.8 0-16-7.2-16-16s7.2-16 16-16h32V160c0-17.7-14.3-32-32-32H352c-17.7 0-32 14.3-32 32V352zM96 128c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V160c0-17.7-14.3-32-32-32H96zm96 336a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
            }, h6 = {
              prefix: "fas",
              iconName: "shield-cat",
              icon: [512, 512, [], "e572", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM160 154.4c0-5.8 4.7-10.4 10.4-10.4h.2c3.4 0 6.5 1.6 8.5 4.3l40 53.3c3 4 7.8 6.4 12.8 6.4h48c5 0 9.8-2.4 12.8-6.4l40-53.3c2-2.7 5.2-4.3 8.5-4.3h.2c5.8 0 10.4 4.7 10.4 10.4V272c0 53-43 96-96 96s-96-43-96-96V154.4zM216 288a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm96-16a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
            }, Bv = {
              prefix: "fas",
              iconName: "bolt",
              icon: [448, 512, [9889, "zap"], "f0e7", "M349.4 44.6c5.9-13.7 1.5-29.7-10.6-38.5s-28.6-8-39.9 1.8l-256 224c-10 8.8-13.6 22.9-8.9 35.3S50.7 288 64 288H175.5L98.6 467.4c-5.9 13.7-1.5 29.7 10.6 38.5s28.6 8 39.9-1.8l256-224c10-8.8 13.6-22.9 8.9-35.3s-16.6-20.7-30-20.7H272.5L349.4 44.6z"]
            }, Pf = Bv, j8 = {
              prefix: "fas",
              iconName: "glass-water",
              icon: [384, 512, [], "e4f4", "M32 0C23.1 0 14.6 3.7 8.6 10.2S-.6 25.4 .1 34.3L28.9 437.7c3 41.9 37.8 74.3 79.8 74.3H275.3c42 0 76.8-32.4 79.8-74.3L383.9 34.3c.6-8.9-2.4-17.6-8.5-24.1S360.9 0 352 0H32zM73 156.5L66.4 64H317.6L311 156.5l-24.2 12.1c-19.4 9.7-42.2 9.7-61.6 0c-20.9-10.4-45.5-10.4-66.4 0c-19.4 9.7-42.2 9.7-61.6 0L73 156.5z"]
            }, g1 = {
              prefix: "fas",
              iconName: "oil-well",
              icon: [576, 512, [], "e532", "M528.3 61.3c-11.4-42.7-55.3-68-98-56.6L414.9 8.8C397.8 13.4 387.7 31 392.3 48l24.5 91.4L308.5 167.5l-6.3-18.1C297.7 136.6 285.6 128 272 128s-25.7 8.6-30.2 21.4l-13.6 39L96 222.6V184c0-13.3-10.7-24-24-24s-24 10.7-24 24V448H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H406.7L340 257.5l-62.2 16.1L305.3 352H238.7L265 277l-74.6 19.3L137.3 448H96V288.8l337.4-87.5 25.2 94c4.6 17.1 22.1 27.2 39.2 22.6l15.5-4.1c42.7-11.4 68-55.3 56.6-98L528.3 61.3zM205.1 448l11.2-32H327.7l11.2 32H205.1z"]
            }, Wv = {
              prefix: "fas",
              iconName: "vault",
              icon: [576, 512, [], "e2c5", "M64 0C28.7 0 0 28.7 0 64V416c0 35.3 28.7 64 64 64H80l16 32h64l16-32H400l16 32h64l16-32h16c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM224 320a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-240a160 160 0 1 1 0 320 160 160 0 1 1 0-320zM480 221.3V336c0 8.8-7.2 16-16 16s-16-7.2-16-16V221.3c-18.6-6.6-32-24.4-32-45.3c0-26.5 21.5-48 48-48s48 21.5 48 48c0 20.9-13.4 38.7-32 45.3z"]
            }, ic = {
              prefix: "fas",
              iconName: "mars",
              icon: [448, 512, [9794], "f222", "M289.8 46.8c3.7-9 12.5-14.8 22.2-14.8H424c13.3 0 24 10.7 24 24V168c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-33.4-33.4L321 204.2c19.5 28.4 31 62.7 31 99.8c0 97.2-78.8 176-176 176S0 401.2 0 304s78.8-176 176-176c37 0 71.4 11.4 99.8 31l52.6-52.6L295 73c-6.9-6.9-8.9-17.2-5.2-26.2zM400 80l0 0h0v0zM176 416a112 112 0 1 0 0-224 112 112 0 1 0 0 224z"]
            }, X2 = {
              prefix: "fas",
              iconName: "toilet",
              icon: [448, 512, [128701], "f7d8", "M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48h8V196.9c-1.9 1.4-3.8 2.9-5.6 4.4C10.9 214.5 0 232.9 0 256c0 46.9 14.3 84.1 37 112.5c14.2 17.7 31.1 31.3 48.5 41.8L65.6 469.9c-3.3 9.8-1.6 20.5 4.4 28.8s15.7 13.3 26 13.3H352c10.3 0 19.9-4.9 26-13.3s7.7-19.1 4.4-28.8l-19.8-59.5c17.4-10.5 34.3-24.1 48.5-41.8c22.7-28.4 37-65.5 37-112.5c0-23.1-10.9-41.5-26.4-54.6c-1.8-1.5-3.7-3-5.6-4.4V48h8c13.3 0 24-10.7 24-24s-10.7-24-24-24H24zM384 256.3c0 1-.3 2.6-3.8 5.6c-4.8 4.1-14 9-29.3 13.4C320.5 284 276.1 288 224 288s-96.5-4-126.9-12.8c-15.3-4.4-24.5-9.3-29.3-13.4c-3.5-3-3.8-4.6-3.8-5.6l0-.3 0-.1c0-1 0-2.5 3.8-5.8c4.8-4.1 14-9 29.3-13.4C127.5 228 171.9 224 224 224s96.5 4 126.9 12.8c15.3 4.4 24.5 9.3 29.3 13.4c3.8 3.2 3.8 4.8 3.8 5.8l0 .1 0 .3zM328.2 384l-.2 .5 0-.5h.2zM112 64h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, sc = {
              prefix: "fas",
              iconName: "plane-circle-xmark",
              icon: [640, 512, [], "e557", "M256 0c-35 0-64 59.5-64 93.7v84.6L8.1 283.4c-5 2.8-8.1 8.2-8.1 13.9v65.5c0 10.6 10.2 18.3 20.4 15.4l171.6-49 0 70.9-57.6 43.2c-4 3-6.4 7.8-6.4 12.8v42c0 7.8 6.3 14 14 14c1.3 0 2.6-.2 3.9-.5L256 480l110.1 31.5c1.3 .4 2.6 .5 3.9 .5c6 0 11.1-3.7 13.1-9C344.5 470.7 320 422.2 320 368c0-60.6 30.6-114 77.1-145.6L320 178.3V93.7C320 59.5 292 0 256 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
            }, rp = {
              prefix: "fas",
              iconName: "yen-sign",
              icon: [320, 512, [165, "cny", "jpy", "rmb", "yen"], "f157", "M58.6 46.2C48.8 31.5 29 27.6 14.3 37.4S-4.4 67 5.4 81.7L100.2 224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32h80v32H48c-17.7 0-32 14.3-32 32s14.3 32 32 32h80v64c0 17.7 14.3 32 32 32s32-14.3 32-32V384h80c17.7 0 32-14.3 32-32s-14.3-32-32-32H192V288h80c17.7 0 32-14.3 32-32s-14.3-32-32-32H219.8L314.6 81.7c9.8-14.7 5.8-34.6-8.9-44.4s-34.6-5.8-44.4 8.9L160 198.3 58.6 46.2z"]
            }, f0 = rp, Tw = rp, T2 = rp, ms = rp, U9 = {
              prefix: "fas",
              iconName: "ruble-sign",
              icon: [384, 512, [8381, "rouble", "rub", "ruble"], "f158", "M96 32C78.3 32 64 46.3 64 64V256H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H64v32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H64v32c0 17.7 14.3 32 32 32s32-14.3 32-32V416H288c17.7 0 32-14.3 32-32s-14.3-32-32-32H128V320H240c79.5 0 144-64.5 144-144s-64.5-144-144-144H96zM240 256H128V96H240c44.2 0 80 35.8 80 80s-35.8 80-80 80z"]
            }, X1 = U9, i9 = U9, Il = U9, q2 = {
              prefix: "fas",
              iconName: "sun",
              icon: [512, 512, [9728], "f185", "M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM160 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"]
            }, cf = {
              prefix: "fas",
              iconName: "guitar",
              icon: [512, 512, [], "f7a6", "M465 7c-9.4-9.4-24.6-9.4-33.9 0L383 55c-2.4 2.4-4.3 5.3-5.5 8.5l-15.4 41-77.5 77.6c-45.1-29.4-99.3-30.2-131 1.6c-11 11-18 24.6-21.4 39.6c-3.7 16.6-19.1 30.7-36.1 31.6c-25.6 1.3-49.3 10.7-67.3 28.6C-16 328.4-7.6 409.4 47.5 464.5s136.1 63.5 180.9 18.7c17.9-17.9 27.4-41.7 28.6-67.3c.9-17 15-32.3 31.6-36.1c15-3.4 28.6-10.5 39.6-21.4c31.8-31.8 31-85.9 1.6-131l77.6-77.6 41-15.4c3.2-1.2 6.1-3.1 8.5-5.5l48-48c9.4-9.4 9.4-24.6 0-33.9L465 7zM208 256a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, IH = {
              prefix: "fas",
              iconName: "face-laugh-wink",
              icon: [512, 512, ["laugh-wink"], "f59c", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1H393.6c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zM144.4 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm156.4 25.6c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2c-17.6-23.5-52.8-23.5-70.4 0z"]
            }, w8 = IH, b2 = {
              prefix: "fas",
              iconName: "horse-head",
              icon: [640, 512, [], "f7ab", "M64 464V316.9c0-108.4 68.3-205.1 170.5-241.3L404.2 15.5C425.6 7.9 448 23.8 448 46.4c0 11-5.5 21.2-14.6 27.3L400 96c48.1 0 91.2 29.8 108.1 74.9l48.6 129.5c11.8 31.4 4.1 66.8-19.6 90.5c-16 16-37.8 25.1-60.5 25.1h-3.4c-26.1 0-50.9-11.6-67.6-31.7l-32.3-38.7c-11.7 4.1-24.2 6.4-37.3 6.4l-.1 0 0 0c-6.3 0-12.5-.5-18.6-1.5c-3.6-.6-7.2-1.4-10.7-2.3l0 0c-28.9-7.8-53.1-26.8-67.8-52.2c-4.4-7.6-14.2-10.3-21.9-5.8s-10.3 14.2-5.8 21.9c24 41.5 68.3 70 119.3 71.9l47.2 70.8c4 6.1 6.2 13.2 6.2 20.4c0 20.3-16.5 36.8-36.8 36.8H112c-26.5 0-48-21.5-48-48zM392 224a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
            }, np = {
              prefix: "fas",
              iconName: "bore-hole",
              icon: [512, 512, [], "e4c3", "M256 0c-17.7 0-32 14.3-32 32V296.6c-19.1 11.1-32 31.7-32 55.4c0 35.3 28.7 64 64 64s64-28.7 64-64c0-23.7-12.9-44.4-32-55.4V32c0-17.7-14.3-32-32-32zM48 128c-26.5 0-48 21.5-48 48V464c0 26.5 21.5 48 48 48H464c26.5 0 48-21.5 48-48V176c0-26.5-21.5-48-48-48H384c-17.7 0-32 14.3-32 32V352c0 53-43 96-96 96s-96-43-96-96V160c0-17.7-14.3-32-32-32H48z"]
            }, A0 = {
              prefix: "fas",
              iconName: "industry",
              icon: [576, 512, [], "f275", "M64 32C46.3 32 32 46.3 32 64V304v48 80c0 26.5 21.5 48 48 48H496c26.5 0 48-21.5 48-48V304 152.2c0-18.2-19.4-29.7-35.4-21.1L352 215.4V152.2c0-18.2-19.4-29.7-35.4-21.1L160 215.4V64c0-17.7-14.3-32-32-32H64z"]
            }, Z6 = {
              prefix: "fas",
              iconName: "circle-down",
              icon: [512, 512, [61466, "arrow-alt-circle-down"], "f358", "M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM376.9 294.6L269.8 394.5c-3.8 3.5-8.7 5.5-13.8 5.5s-10.1-2-13.8-5.5L135.1 294.6c-4.5-4.2-7.1-10.1-7.1-16.3c0-12.3 10-22.3 22.3-22.3l57.7 0 0-96c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 96 57.7 0c12.3 0 22.3 10 22.3 22.3c0 6.2-2.6 12.1-7.1 16.3z"]
            }, x2 = Z6, qw = {
              prefix: "fas",
              iconName: "arrows-turn-to-dots",
              icon: [512, 512, [], "e4c1", "M249.4 25.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L269.3 96 416 96c53 0 96 43 96 96v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V192c0-17.7-14.3-32-32-32l-146.7 0 25.4 25.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-80-80c-12.5-12.5-12.5-32.8 0-45.3l80-80zm13.3 256l80 80c12.5 12.5 12.5 32.8 0 45.3l-80 80c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 416 96 416c-17.7 0-32 14.3-32 32v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V448c0-53 43-96 96-96l146.7 0-25.4-25.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0zM384 384a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM64 192A64 64 0 1 1 64 64a64 64 0 1 1 0 128z"]
            }, bw = {
              prefix: "fas",
              iconName: "florin-sign",
              icon: [384, 512, [], "e184", "M314.7 32c-38.8 0-73.7 23.3-88.6 59.1L170.7 224H64c-17.7 0-32 14.3-32 32s14.3 32 32 32h80L98.9 396.3c-5 11.9-16.6 19.7-29.5 19.7H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H69.3c38.8 0 73.7-23.3 88.6-59.1L213.3 288H320c17.7 0 32-14.3 32-32s-14.3-32-32-32H240l45.1-108.3c5-11.9 16.6-19.7 29.5-19.7H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H314.7z"]
            }, xx = {
              prefix: "fas",
              iconName: "arrow-down-short-wide",
              icon: [576, 512, ["sort-amount-desc", "sort-amount-down-alt"], "f884", "M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V365.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, ac = xx, RH = xx, Dx = {
              prefix: "fas",
              iconName: "less-than",
              icon: [384, 512, [62774], "3c", "M380.6 81.7c7.9 15.8 1.5 35-14.3 42.9L103.6 256 366.3 387.4c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3l-320-160C6.8 279.2 0 268.1 0 256s6.8-23.2 17.7-28.6l320-160c15.8-7.9 35-1.5 42.9 14.3z"]
            }, m8 = {
              prefix: "fas",
              iconName: "angle-down",
              icon: [448, 512, [8964], "f107", "M201.4 342.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 274.7 86.6 137.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]
            }, B8 = {
              prefix: "fas",
              iconName: "car-tunnel",
              icon: [512, 512, [], "e4de", "M256 0C114.6 0 0 114.6 0 256V448c0 35.3 28.7 64 64 64h42.8c-6.6-5.9-10.8-14.4-10.8-24V376c0-20.8 11.3-38.9 28.1-48.6l21-64.7c7.5-23.1 29-38.7 53.3-38.7H313.6c24.3 0 45.8 15.6 53.3 38.7l21 64.7c16.8 9.7 28.2 27.8 28.2 48.6V488c0 9.6-4.2 18.1-10.8 24H448c35.3 0 64-28.7 64-64V256C512 114.6 397.4 0 256 0zM362.8 512c-6.6-5.9-10.8-14.4-10.8-24V448H160v40c0 9.6-4.2 18.1-10.8 24H362.8zM190.8 277.5L177 320H335l-13.8-42.5c-1.1-3.3-4.1-5.5-7.6-5.5H198.4c-3.5 0-6.5 2.2-7.6 5.5zM168 408a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm200-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
            }, d0 = {
              prefix: "fas",
              iconName: "head-side-cough",
              icon: [640, 512, [], "e061", "M0 224.2C0 100.6 100.2 0 224 0h24c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8H448v0 32L339.2 365.6c-11 1.4-19.2 10.7-19.2 21.8c0 11.6 9 21.2 20.6 21.9L448 416v16c0 26.5-21.5 48-48 48H320v8c0 13.3-10.7 24-24 24H256v0H96c-17.7 0-32-14.3-32-32V407.3c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zm352-.2a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM464 384a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm152-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM592 480a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM552 312a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40-24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM552 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, ip = {
              prefix: "fas",
              iconName: "grip-lines",
              icon: [448, 512, [], "f7a4", "M32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 288zm0-128c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160z"]
            }, oc = {
              prefix: "fas",
              iconName: "thumbs-down",
              icon: [512, 512, [128078, 61576], "f165", "M313.4 479.1c26-5.2 42.9-30.5 37.7-56.5l-2.3-11.4c-5.3-26.7-15.1-52.1-28.8-75.2H464c26.5 0 48-21.5 48-48c0-18.5-10.5-34.6-25.9-42.6C497 236.6 504 223.1 504 208c0-23.4-16.8-42.9-38.9-47.1c4.4-7.3 6.9-15.8 6.9-24.9c0-21.3-13.9-39.4-33.1-45.6c.7-3.3 1.1-6.8 1.1-10.4c0-26.5-21.5-48-48-48H294.5c-19 0-37.5 5.6-53.3 16.1L202.7 73.8C176 91.6 160 121.6 160 153.7V192v48 24.9c0 29.2 13.3 56.7 36 75l7.4 5.9c26.5 21.2 44.6 51 51.2 84.2l2.3 11.4c5.2 26 30.5 42.9 56.5 37.7zM32 384H96c17.7 0 32-14.3 32-32V128c0-17.7-14.3-32-32-32H32C14.3 96 0 110.3 0 128V352c0 17.7 14.3 32 32 32z"]
            }, VH = {
              prefix: "fas",
              iconName: "user-lock",
              icon: [640, 512, [], "f502", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H392.6c-5.4-9.4-8.6-20.3-8.6-32V352c0-2.1 .1-4.2 .3-6.3c-31-26-71-41.7-114.6-41.7H178.3zM528 240c17.7 0 32 14.3 32 32v48H496V272c0-17.7 14.3-32 32-32zm-80 32v48c-17.7 0-32 14.3-32 32V480c0 17.7 14.3 32 32 32H608c17.7 0 32-14.3 32-32V352c0-17.7-14.3-32-32-32V272c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
            }, D2 = {
              prefix: "fas",
              iconName: "arrow-right-long",
              icon: [512, 512, ["long-arrow-right"], "f178", "M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l370.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]
            }, W8 = D2, xw = {
              prefix: "fas",
              iconName: "anchor-circle-xmark",
              icon: [640, 512, [], "e4ac", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80H224c-17.7 0-32 14.3-32 32s14.3 32 32 32h32V448H208c-53 0-96-43-96-96v-6.1l7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7V352c0 88.4 71.6 160 160 160h80 80c8.2 0 16.3-.6 24.2-1.8c-22.2-16.2-40.4-37.5-53-62.2H320V368 240h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H341.1zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
            }, v0 = {
              prefix: "fas",
              iconName: "ellipsis",
              icon: [448, 512, ["ellipsis-h"], "f141", "M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"]
            }, S8 = v0, U8 = {
              prefix: "fas",
              iconName: "chess-pawn",
              icon: [320, 512, [9823], "f443", "M215.5 224c29.2-18.4 48.5-50.9 48.5-88c0-57.4-46.6-104-104-104S56 78.6 56 136c0 37.1 19.4 69.6 48.5 88H96c-17.7 0-32 14.3-32 32c0 16.5 12.5 30 28.5 31.8L80 400H240L227.5 287.8c16-1.8 28.5-15.3 28.5-31.8c0-17.7-14.3-32-32-32h-8.5zM22.6 473.4c-4.2 4.2-6.6 10-6.6 16C16 501.9 26.1 512 38.6 512H281.4c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L256 432H64L22.6 473.4z"]
            }, CH = {
              prefix: "fas",
              iconName: "kit-medical",
              icon: [576, 512, ["first-aid"], "f479", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H96V32H64zm64 0V480H448V32H128zM512 480c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H480V480h32zM256 176c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v48h48c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H320v48c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V288H208c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16h48V176z"]
            }, Dw = CH, u0 = {
              prefix: "fas",
              iconName: "person-through-window",
              icon: [640, 512, [], "e5a9", "M64 64l224 0 0 9.8c0 39-23.7 74-59.9 88.4C167.6 186.5 128 245 128 310.2l0 73.8s0 0 0 0H64V64zm288 0l224 0V384H508.3l-3.7-4.5-75.2-90.2c-9.1-10.9-22.6-17.3-36.9-17.3l-71.1 0-41-63.1c-.3-.5-.6-1-1-1.4c44.7-29 72.5-79 72.5-133.6l0-9.8zm73 320H379.2l42.7 64H592c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48V400c0 26.5 21.5 48 48 48H308.2l33.2 49.8c9.8 14.7 29.7 18.7 44.4 8.9s18.7-29.7 8.9-44.4L310.5 336l74.6 0 40 48zm-159.5 0H192s0 0 0 0l0-73.8c0-10.2 1.6-20.1 4.7-29.5L265.5 384zM192 128a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
            }, OH = {
              prefix: "fas",
              iconName: "toolbox",
              icon: [512, 512, [129520], "f552", "M176 88v40H336V88c0-4.4-3.6-8-8-8H184c-4.4 0-8 3.6-8 8zm-48 40V88c0-30.9 25.1-56 56-56H328c30.9 0 56 25.1 56 56v40h28.1c12.7 0 24.9 5.1 33.9 14.1l51.9 51.9c9 9 14.1 21.2 14.1 33.9V304H384V288c0-17.7-14.3-32-32-32s-32 14.3-32 32v16H192V288c0-17.7-14.3-32-32-32s-32 14.3-32 32v16H0V227.9c0-12.7 5.1-24.9 14.1-33.9l51.9-51.9c9-9 21.2-14.1 33.9-14.1H128zM0 416V336H128v16c0 17.7 14.3 32 32 32s32-14.3 32-32V336H320v16c0 17.7 14.3 32 32 32s32-14.3 32-32V336H512v80c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64z"]
            }, j2 = {
              prefix: "fas",
              iconName: "hands-holding-circle",
              icon: [640, 512, [], "e4fb", "M320 0a128 128 0 1 1 0 256A128 128 0 1 1 320 0zM40 64c22.1 0 40 17.9 40 40v40 80 40.2c0 17 6.7 33.3 18.7 45.3l51.1 51.1c8.3 8.3 21.3 9.6 31 3.1c12.9-8.6 14.7-26.9 3.7-37.8l-15.2-15.2-32-32c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l32 32 15.2 15.2 0 0 25.3 25.3c21 21 32.8 49.5 32.8 79.2V464c0 26.5-21.5 48-48 48H173.3c-17 0-33.3-6.7-45.3-18.7L28.1 393.4C10.1 375.4 0 351 0 325.5V224 160 104C0 81.9 17.9 64 40 64zm560 0c22.1 0 40 17.9 40 40v56 64V325.5c0 25.5-10.1 49.9-28.1 67.9L512 493.3c-12 12-28.3 18.7-45.3 18.7H400c-26.5 0-48-21.5-48-48V385.1c0-29.7 11.8-58.2 32.8-79.2l25.3-25.3 0 0 15.2-15.2 32-32c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-32 32-15.2 15.2c-11 11-9.2 29.2 3.7 37.8c9.7 6.5 22.7 5.2 31-3.1l51.1-51.1c12-12 18.7-28.3 18.7-45.3V224 144 104c0-22.1 17.9-40 40-40z"]
            }, I8 = {
              prefix: "fas",
              iconName: "bug",
              icon: [512, 512, [], "f188", "M256 0c53 0 96 43 96 96v3.6c0 15.7-12.7 28.4-28.4 28.4H188.4c-15.7 0-28.4-12.7-28.4-28.4V96c0-53 43-96 96-96zM41.4 105.4c12.5-12.5 32.8-12.5 45.3 0l64 64c.7 .7 1.3 1.4 1.9 2.1c14.2-7.3 30.4-11.4 47.5-11.4H312c17.1 0 33.2 4.1 47.5 11.4c.6-.7 1.2-1.4 1.9-2.1l64-64c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-64 64c-.7 .7-1.4 1.3-2.1 1.9c6.2 12 10.1 25.3 11.1 39.5H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H416c0 24.6-5.5 47.8-15.4 68.6c2.2 1.3 4.2 2.9 6 4.8l64 64c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-63.1-63.1c-24.5 21.8-55.8 36.2-90.3 39.6V240c0-8.8-7.2-16-16-16s-16 7.2-16 16V479.2c-34.5-3.4-65.8-17.8-90.3-39.6L86.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l64-64c1.9-1.9 3.9-3.4 6-4.8C101.5 367.8 96 344.6 96 320H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H96.3c1.1-14.1 5-27.5 11.1-39.5c-.7-.6-1.4-1.2-2.1-1.9l-64-64c-12.5-12.5-12.5-32.8 0-45.3z"]
            }, jx = {
              prefix: "fas",
              iconName: "credit-card",
              icon: [576, 512, [128179, 62083, "credit-card-alt"], "f09d", "M64 32C28.7 32 0 60.7 0 96v32H576V96c0-35.3-28.7-64-64-64H64zM576 224H0V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V224zM112 352h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm112 16c0-8.8 7.2-16 16-16H368c8.8 0 16 7.2 16 16s-7.2 16-16 16H240c-8.8 0-16-7.2-16-16z"]
            }, R8 = jx, I9 = {
              prefix: "fas",
              iconName: "car",
              icon: [512, 512, [128664, "automobile"], "f1b9", "M135.2 117.4L109.1 192H402.9l-26.1-74.6C372.3 104.6 360.2 96 346.6 96H165.4c-13.6 0-25.7 8.6-30.2 21.4zM39.6 196.8L74.8 96.3C88.3 57.8 124.6 32 165.4 32H346.6c40.8 0 77.1 25.8 90.6 64.3l35.2 100.5c23.2 9.6 39.6 32.5 39.6 59.2V400v48c0 17.7-14.3 32-32 32H448c-17.7 0-32-14.3-32-32V400H96v48c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32V400 256c0-26.7 16.4-49.6 39.6-59.2zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, sp = I9, JB = {
              prefix: "fas",
              iconName: "hand-holding-hand",
              icon: [576, 512, [], "e4f7", "M7.8 207.7c-13.1-17.8-9.3-42.8 8.5-55.9L142.9 58.5C166.2 41.3 194.5 32 223.5 32H384 544c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H507.2l-44.9 36c-22.7 18.2-50.9 28-80 28H304 288 224c-17.7 0-32-14.3-32-32s14.3-32 32-32h64 16c8.8 0 16-7.2 16-16s-7.2-16-16-16H183.4L63.7 216.2c-17.8 13.1-42.8 9.3-55.9-8.5zM382.4 160l0 0 .9 0c-.3 0-.6 0-.9 0zM568.2 304.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 453.5c-23.4 17.2-51.6 26.5-80.7 26.5H192 32c-17.7 0-32-14.3-32-32V384c0-17.7 14.3-32 32-32H68.8l44.9-36c22.7-18.2 50.9-28 80-28H272h16 64c17.7 0 32 14.3 32 32s-14.3 32-32 32H288 272c-8.8 0-16 7.2-16 16s7.2 16 16 16H392.6l119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 352l0 0-.9 0c.3 0 .6 0 .9 0z"]
            }, Qo = {
              prefix: "fas",
              iconName: "book-open-reader",
              icon: [512, 512, ["book-reader"], "f5da", "M160 96a96 96 0 1 1 192 0A96 96 0 1 1 160 96zm80 152V512l-48.4-24.2c-20.9-10.4-43.5-17-66.8-19.3l-96-9.6C12.5 457.2 0 443.5 0 427V224c0-17.7 14.3-32 32-32H62.3c63.6 0 125.6 19.6 177.7 56zm32 264V248c52.1-36.4 114.1-56 177.7-56H480c17.7 0 32 14.3 32 32V427c0 16.4-12.5 30.2-28.8 31.8l-96 9.6c-23.2 2.3-45.9 8.9-66.8 19.3L272 512z"]
            }, zB = Qo, jw = {
              prefix: "fas",
              iconName: "mountain-sun",
              icon: [640, 512, [], "e52f", "M560 160A80 80 0 1 0 560 0a80 80 0 1 0 0 160zM55.9 512H381.1h75H578.9c33.8 0 61.1-27.4 61.1-61.1c0-11.2-3.1-22.2-8.9-31.8l-132-216.3C495 196.1 487.8 192 480 192s-15 4.1-19.1 10.7l-48.2 79L286.8 81c-6.6-10.6-18.3-17-30.8-17s-24.1 6.4-30.8 17L8.6 426.4C3 435.3 0 445.6 0 456.1C0 487 25 512 55.9 512z"]
            }, qA = {
              prefix: "fas",
              iconName: "arrows-left-right-to-line",
              icon: [640, 512, [], "e4ba", "M32 64c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32s-32-14.3-32-32V96C0 78.3 14.3 64 32 64zm214.6 73.4c12.5 12.5 12.5 32.8 0 45.3L205.3 224l229.5 0-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L434.7 288l-229.5 0 41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0zM640 96V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V96c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
            }, w2 = {
              prefix: "fas",
              iconName: "dice-d20",
              icon: [512, 512, [], "f6cf", "M48.7 125.8l53.2 31.9c7.8 4.7 17.8 2 22.2-5.9L201.6 12.1c3-5.4-.9-12.1-7.1-12.1c-1.6 0-3.2 .5-4.6 1.4L47.9 98.8c-9.6 6.6-9.2 20.9 .8 26.9zM16 171.7V295.3c0 8 10.4 11 14.7 4.4l60-92c5-7.6 2.6-17.8-5.2-22.5L40.2 158C29.6 151.6 16 159.3 16 171.7zM310.4 12.1l77.6 139.6c4.4 7.9 14.5 10.6 22.2 5.9l53.2-31.9c10-6 10.4-20.3 .8-26.9L322.1 1.4c-1.4-.9-3-1.4-4.6-1.4c-6.2 0-10.1 6.7-7.1 12.1zM496 171.7c0-12.4-13.6-20.1-24.2-13.7l-45.3 27.2c-7.8 4.7-10.1 14.9-5.2 22.5l60 92c4.3 6.7 14.7 3.6 14.7-4.4V171.7zm-49.3 246L286.1 436.6c-8.1 .9-14.1 7.8-14.1 15.9v52.8c0 3.7 3 6.8 6.8 6.8c.8 0 1.6-.1 2.4-.4l172.7-64c6.1-2.2 10.1-8 10.1-14.5c0-9.3-8.1-16.5-17.3-15.4zM233.2 512c3.7 0 6.8-3 6.8-6.8V452.6c0-8.1-6.1-14.9-14.1-15.9l-160.6-19c-9.2-1.1-17.3 6.1-17.3 15.4c0 6.5 4 12.3 10.1 14.5l172.7 64c.8 .3 1.6 .4 2.4 .4zM41.7 382.9l170.9 20.2c7.8 .9 13.4-7.5 9.5-14.3l-85.7-150c-5.9-10.4-20.7-10.8-27.3-.8L30.2 358.2c-6.5 9.9-.3 23.3 11.5 24.7zm439.6-24.8L402.9 238.1c-6.5-10-21.4-9.6-27.3 .8L290.2 388.5c-3.9 6.8 1.6 15.2 9.5 14.3l170.1-20c11.8-1.4 18-14.7 11.5-24.6zm-216.9 11l78.4-137.2c6.1-10.7-1.6-23.9-13.9-23.9H183.1c-12.3 0-20 13.3-13.9 23.9l78.4 137.2c3.7 6.4 13 6.4 16.7 0zM174.4 176H337.6c12.2 0 19.9-13.1 14-23.8l-80-144c-2.8-5.1-8.2-8.2-14-8.2h-3.2c-5.8 0-11.2 3.2-14 8.2l-80 144c-5.9 10.7 1.8 23.8 14 23.8z"]
            }, mx = {
              prefix: "fas",
              iconName: "truck-droplet",
              icon: [640, 512, [], "e58c", "M0 48C0 21.5 21.5 0 48 0H368c26.5 0 48 21.5 48 48V96h50.7c17 0 33.3 6.7 45.3 18.7L589.3 192c12 12 18.7 28.3 18.7 45.3V256v32 64c17.7 0 32 14.3 32 32s-14.3 32-32 32H576c0 53-43 96-96 96s-96-43-96-96H256c0 53-43 96-96 96s-96-43-96-96H48c-26.5 0-48-21.5-48-48V48zM416 256H544V237.3L466.7 160H416v96zM160 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM208 272c39.8 0 72-29.6 72-66c0-27-39.4-82.9-59.9-110.3c-6.1-8.2-18.1-8.2-24.2 0C175.4 123 136 179 136 206c0 36.5 32.2 66 72 66z"]
            }, ww = {
              prefix: "fas",
              iconName: "file-circle-xmark",
              icon: [576, 512, [], "e5a1", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384v38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L432 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L409.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L432 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L454.6 368l36.7-36.7z"]
            }, mw = {
              prefix: "fas",
              iconName: "temperature-arrow-up",
              icon: [576, 512, ["temperature-up"], "e040", "M128 112c0-26.5 21.5-48 48-48s48 21.5 48 48V276.5c0 17.3 7.1 31.9 15.3 42.5C249.8 332.6 256 349.5 256 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9c8.2-10.6 15.3-25.2 15.3-42.5V112zM176 0C114.1 0 64 50.1 64 112V276.4c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C43.2 304.2 32 334.8 32 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6V112C288 50.1 237.9 0 176 0zm0 416c26.5 0 48-21.5 48-48c0-20.9-13.4-38.7-32-45.3V112c0-8.8-7.2-16-16-16s-16 7.2-16 16V322.7c-18.6 6.6-32 24.4-32 45.3c0 26.5 21.5 48 48 48zM480 160h32c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8h32V448c0 17.7 14.3 32 32 32s32-14.3 32-32V160z"]
            }, V8 = mw, ap = {
              prefix: "fas",
              iconName: "medal",
              icon: [512, 512, [127941], "f5a2", "M4.1 38.2C1.4 34.2 0 29.4 0 24.6C0 11 11 0 24.6 0H133.9c11.2 0 21.7 5.9 27.4 15.5l68.5 114.1c-48.2 6.1-91.3 28.6-123.4 61.9L4.1 38.2zm503.7 0L405.6 191.5c-32.1-33.3-75.2-55.8-123.4-61.9L350.7 15.5C356.5 5.9 366.9 0 378.1 0H487.4C501 0 512 11 512 24.6c0 4.8-1.4 9.6-4.1 13.6zM80 336a176 176 0 1 1 352 0A176 176 0 1 1 80 336zm184.4-94.9c-3.4-7-13.3-7-16.8 0l-22.4 45.4c-1.4 2.8-4 4.7-7 5.1L168 298.9c-7.7 1.1-10.7 10.5-5.2 16l36.3 35.4c2.2 2.2 3.2 5.2 2.7 8.3l-8.6 49.9c-1.3 7.6 6.7 13.5 13.6 9.9l44.8-23.6c2.7-1.4 6-1.4 8.7 0l44.8 23.6c6.9 3.6 14.9-2.2 13.6-9.9l-8.6-49.9c-.5-3 .5-6.1 2.7-8.3l36.3-35.4c5.6-5.4 2.5-14.8-5.2-16l-50.1-7.3c-3-.4-5.7-2.4-7-5.1l-22.4-45.4z"]
            }, Bw = {
              prefix: "fas",
              iconName: "bed",
              icon: [640, 512, [128716], "f236", "M32 32c17.7 0 32 14.3 32 32V320H288V160c0-17.7 14.3-32 32-32H544c53 0 96 43 96 96V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V416H352 320 64v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V64C0 46.3 14.3 32 32 32zm144 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
            }, Ww = {
              prefix: "fas",
              iconName: "square-h",
              icon: [448, 512, ["h-square"], "f0fd", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM336 152V256 360c0 13.3-10.7 24-24 24s-24-10.7-24-24V280H160l0 80c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-208c0-13.3 10.7-24 24-24s24 10.7 24 24v80H288V152c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
            }, Bx = Ww, GB = {
              prefix: "fas",
              iconName: "podcast",
              icon: [448, 512, [], "f2ce", "M319.4 372c48.5-31.3 80.6-85.9 80.6-148c0-97.2-78.8-176-176-176S48 126.8 48 224c0 62.1 32.1 116.6 80.6 148c1.2 17.3 4 38 7.2 57.1l.2 1C56 395.8 0 316.5 0 224C0 100.3 100.3 0 224 0S448 100.3 448 224c0 92.5-56 171.9-136 206.1l.2-1.1c3.1-19.2 6-39.8 7.2-57zm-2.3-38.1c-1.6-5.7-3.9-11.1-7-16.2c-5.8-9.7-13.5-17-21.9-22.4c19.5-17.6 31.8-43 31.8-71.3c0-53-43-96-96-96s-96 43-96 96c0 28.3 12.3 53.8 31.8 71.3c-8.4 5.4-16.1 12.7-21.9 22.4c-3.1 5.1-5.4 10.5-7 16.2C99.8 307.5 80 268 80 224c0-79.5 64.5-144 144-144s144 64.5 144 144c0 44-19.8 83.5-50.9 109.9zM224 312c32.9 0 64 8.6 64 43.8c0 33-12.9 104.1-20.6 132.9c-5.1 19-24.5 23.4-43.4 23.4s-38.2-4.4-43.4-23.4c-7.8-28.5-20.6-99.7-20.6-132.8c0-35.1 31.1-43.8 64-43.8zm0-144a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"]
            }, yd = {
              prefix: "fas",
              iconName: "temperature-full",
              icon: [320, 512, ["temperature-4", "thermometer-4", "thermometer-full"], "f2c7", "M160 64c-26.5 0-48 21.5-48 48V276.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5V112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112V276.5c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6V112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3V112c0-8.8 7.2-16 16-16s16 7.2 16 16V322.7c18.6 6.6 32 24.4 32 45.3z"]
            }, Wx = yd, C8 = yd, Sx = yd, l0 = {
              prefix: "fas",
              iconName: "bell",
              icon: [448, 512, [128276, 61602], "f0f3", "M224 0c-17.7 0-32 14.3-32 32V51.2C119 66 64 130.6 64 208v18.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S19.4 416 32 416H416c12.6 0 24-7.4 29.2-18.9s3.1-25-5.3-34.4l-7.4-8.3C401.3 319.2 384 273.9 384 226.8V208c0-77.4-55-142-128-156.8V32c0-17.7-14.3-32-32-32zm45.3 493.3c12-12 18.7-28.3 18.7-45.3H224 160c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"]
            }, Sw = {
              prefix: "fas",
              iconName: "superscript",
              icon: [512, 512, [], "f12b", "M480 32c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 73.5 404.3 80 416 80v80c-17.7 0-32 14.3-32 32s14.3 32 32 32h32 32c17.7 0 32-14.3 32-32s-14.3-32-32-32V32zM32 64C14.3 64 0 78.3 0 96s14.3 32 32 32H47.3l89.6 128L47.3 384H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H64c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H304.7L215.1 256l89.6-128H320c17.7 0 32-14.3 32-32s-14.3-32-32-32H288c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64H32z"]
            }, Ux = {
              prefix: "fas",
              iconName: "plug-circle-xmark",
              icon: [576, 512, [], "e560", "M96 0C78.3 0 64 14.3 64 32v96h64V32c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32v96h64V32c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32v32c0 77.4 55 142 128 156.8V480c0 17.7 14.3 32 32 32s32-14.3 32-32V412.8c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32H32zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L454.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L432 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L409.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L432 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
            }, g = {
              prefix: "fas",
              iconName: "star-of-life",
              icon: [512, 512, [], "f621", "M208 32c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32V172.9l122-70.4c15.3-8.8 34.9-3.6 43.7 11.7l16 27.7c8.8 15.3 3.6 34.9-11.7 43.7L352 256l122 70.4c15.3 8.8 20.5 28.4 11.7 43.7l-16 27.7c-8.8 15.3-28.4 20.6-43.7 11.7L304 339.1V480c0 17.7-14.3 32-32 32H240c-17.7 0-32-14.3-32-32V339.1L86 409.6c-15.3 8.8-34.9 3.6-43.7-11.7l-16-27.7c-8.8-15.3-3.6-34.9 11.7-43.7L160 256 38 185.6c-15.3-8.8-20.5-28.4-11.7-43.7l16-27.7C51.1 98.8 70.7 93.6 86 102.4l122 70.4V32z"]
            }, x = {
              prefix: "fas",
              iconName: "phone-slash",
              icon: [640, 512, [], "f3dd", "M228.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C76.1 30.2 64 46 64 64c0 107.4 37.8 206 100.8 283.1L9.2 469.1c-10.4 8.2-12.3 23.3-4.1 33.7s23.3 12.3 33.7 4.1l592-464c10.4-8.2 12.3-23.3 4.1-33.7s-23.3-12.3-33.7-4.1L253 278c-17.8-21.5-32.9-45.2-45-70.7L257.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96zm96.8 319l-91.3 72C310.7 476 407.1 512 512 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L368.7 368c-15-7.1-29.3-15.2-43-24.3z"]
            }, U = {
              prefix: "fas",
              iconName: "paint-roller",
              icon: [512, 512, [], "f5aa", "M0 64C0 28.7 28.7 0 64 0H352c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM160 352c0-17.7 14.3-32 32-32V304c0-44.2 35.8-80 80-80H416c17.7 0 32-14.3 32-32V160 69.5c37.3 13.2 64 48.7 64 90.5v32c0 53-43 96-96 96H272c-8.8 0-16 7.2-16 16v16c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V352z"]
            }, F = {
              prefix: "fas",
              iconName: "handshake-angle",
              icon: [640, 512, ["hands-helping"], "f4c4", "M544 248v3.3l69.7-69.7c21.9-21.9 21.9-57.3 0-79.2L535.6 24.4c-21.9-21.9-57.3-21.9-79.2 0L416.3 64.5c-2.7-.3-5.5-.5-8.3-.5H296c-37.1 0-67.6 28-71.6 64H224V248c0 22.1 17.9 40 40 40s40-17.9 40-40V176c0 0 0-.1 0-.1V160l16 0 136 0c0 0 0 0 .1 0H464c44.2 0 80 35.8 80 80v8zM336 192v56c0 39.8-32.2 72-72 72s-72-32.2-72-72V129.4c-35.9 6.2-65.8 32.3-76 68.2L99.5 255.2 26.3 328.4c-21.9 21.9-21.9 57.3 0 79.2l78.1 78.1c21.9 21.9 57.3 21.9 79.2 0l37.7-37.7c.9 0 1.8 .1 2.7 .1H384c26.5 0 48-21.5 48-48c0-5.6-1-11-2.7-16H432c26.5 0 48-21.5 48-48c0-12.8-5-24.4-13.2-33c25.7-5 45.1-27.6 45.2-54.8v-.4c-.1-30.8-25.1-55.8-56-55.8c0 0 0 0 0 0l-120 0z"]
            }, K = F, oe = {
              prefix: "fas",
              iconName: "location-dot",
              icon: [384, 512, ["map-marker-alt"], "f3c5", "M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
            }, ce = oe, Te = {
              prefix: "fas",
              iconName: "file",
              icon: [384, 512, [128196, 128459, 61462], "f15b", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128z"]
            }, Ce = {
              prefix: "fas",
              iconName: "greater-than",
              icon: [384, 512, [62769], "3e", "M3.4 81.7c-7.9 15.8-1.5 35 14.3 42.9L280.5 256 17.7 387.4C1.9 395.3-4.5 414.5 3.4 430.3s27.1 22.2 42.9 14.3l320-160c10.8-5.4 17.7-16.5 17.7-28.6s-6.8-23.2-17.7-28.6l-320-160c-15.8-7.9-35-1.5-42.9 14.3z"]
            }, tt = {
              prefix: "fas",
              iconName: "person-swimming",
              icon: [576, 512, [127946, "swimmer"], "f5c4", "M309.5 178.4L447.9 297.1c-1.6 .9-3.2 2-4.8 3c-18 12.4-40.1 20.3-59.2 20.3c-19.6 0-40.8-7.7-59.2-20.3c-22.1-15.5-51.6-15.5-73.7 0c-17.1 11.8-38 20.3-59.2 20.3c-10.1 0-21.1-2.2-31.9-6.2C163.1 193.2 262.2 96 384 96h64c17.7 0 32 14.3 32 32s-14.3 32-32 32H384c-26.9 0-52.3 6.6-74.5 18.4zM160 160A64 64 0 1 1 32 160a64 64 0 1 1 128 0zM306.5 325.9C329 341.4 356.5 352 384 352c26.9 0 55.4-10.8 77.4-26.1l0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 405.7 417 416 384 416c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7l0 0C136.7 341.2 165.1 352 192 352c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
            }, ft = tt, Rt = {
              prefix: "fas",
              iconName: "arrow-down",
              icon: [384, 512, [8595], "f063", "M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 370.8 224 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 306.7L54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]
            }, ct = {
              prefix: "fas",
              iconName: "droplet",
              icon: [384, 512, [128167, "tint"], "f043", "M192 512C86 512 0 426 0 320C0 228.8 130.2 57.7 166.6 11.7C172.6 4.2 181.5 0 191.1 0h1.8c9.6 0 18.5 4.2 24.5 11.7C253.8 57.7 384 228.8 384 320c0 106-86 192-192 192zM96 336c0-8.8-7.2-16-16-16s-16 7.2-16 16c0 61.9 50.1 112 112 112c8.8 0 16-7.2 16-16s-7.2-16-16-16c-44.2 0-80-35.8-80-80z"]
            }, Ft = ct, wr = {
              prefix: "fas",
              iconName: "eraser",
              icon: [576, 512, [], "f12d", "M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7H288h9.4H512c17.7 0 32-14.3 32-32s-14.3-32-32-32H387.9L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416H288l-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"]
            }, Yr = {
              prefix: "fas",
              iconName: "earth-americas",
              icon: [512, 512, [127758, "earth", "earth-america", "globe-americas"], "f57d", "M57.7 193l9.4 16.4c8.3 14.5 21.9 25.2 38 29.8L163 255.7c17.2 4.9 29 20.6 29 38.5v39.9c0 11 6.2 21 16 25.9s16 14.9 16 25.9v39c0 15.6 14.9 26.9 29.9 22.6c16.1-4.6 28.6-17.5 32.7-33.8l2.8-11.2c4.2-16.9 15.2-31.4 30.3-40l8.1-4.6c15-8.5 24.2-24.5 24.2-41.7v-8.3c0-12.7-5.1-24.9-14.1-33.9l-3.9-3.9c-9-9-21.2-14.1-33.9-14.1H257c-11.1 0-22.1-2.9-31.8-8.4l-34.5-19.7c-4.3-2.5-7.6-6.5-9.2-11.2c-3.2-9.6 1.1-20 10.2-24.5l5.9-3c6.6-3.3 14.3-3.9 21.3-1.5l23.2 7.7c8.2 2.7 17.2-.4 21.9-7.5c4.7-7 4.2-16.3-1.2-22.8l-13.6-16.3c-10-12-9.9-29.5 .3-41.3l15.7-18.3c8.8-10.3 10.2-25 3.5-36.7l-2.4-4.2c-3.5-.2-6.9-.3-10.4-.3C163.1 48 84.4 108.9 57.7 193zM464 256c0-36.8-9.6-71.4-26.4-101.5L412 164.8c-15.7 6.3-23.8 23.8-18.5 39.8l16.9 50.7c3.5 10.4 12 18.3 22.6 20.9l29.1 7.3c1.2-9 1.8-18.2 1.8-27.5zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
            }, Si = Yr, os = Yr, Ci = Yr, ea = {
              prefix: "fas",
              iconName: "person-burst",
              icon: [640, 512, [], "e53b", "M480 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 384V352h16V480c0 17.7 14.3 32 32 32s32-14.3 32-32V256.9l28.6 47.5c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-58.3-97c-17.4-28.9-48.6-46.6-82.3-46.6H465.1c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L408 256.9V480c0 17.7 14.3 32 32 32s32-14.3 32-32zM190.9 18.1C188.4 12 182.6 8 176 8s-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6L176 286.1l58.6 53.9c4.8 4.4 11.9 5.5 17.8 2.6s9.5-9 9-15.5l-5.6-79.4 50.5-7.8 24.4-40.5-55.2-38L315 92.2c3.3-5.7 2.7-12.8-1.4-17.9s-10.9-7.2-17.2-5.3L220.3 92.1l-29.4-74z"]
            }, to = {
              prefix: "fas",
              iconName: "dove",
              icon: [512, 512, [128330], "f4ba", "M160.8 96.5c14 17 31 30.9 49.5 42.2c25.9 15.8 53.7 25.9 77.7 31.6V138.8C265.8 108.5 250 71.5 248.6 28c-.4-11.3-7.5-21.5-18.4-24.4c-7.6-2-15.8-.2-21 5.8c-13.3 15.4-32.7 44.6-48.4 87.2zM320 144v30.6l0 0v1.3l0 0 0 32.1c-60.8-5.1-185-43.8-219.3-157.2C97.4 40 87.9 32 76.6 32c-7.9 0-15.3 3.9-18.8 11C46.8 65.9 32 112.1 32 176c0 116.9 80.1 180.5 118.4 202.8L11.8 416.6C6.7 418 2.6 421.8 .9 426.8s-.8 10.6 2.3 14.8C21.7 466.2 77.3 512 160 512c3.6 0 7.2-1.2 10-3.5L245.6 448H320c88.4 0 160-71.6 160-160V128l29.9-44.9c1.3-2 2.1-4.4 2.1-6.8c0-6.8-5.5-12.3-12.3-12.3H400c-44.2 0-80 35.8-80 80zm80-16a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
            }, Nt = {
              prefix: "fas",
              iconName: "battery-empty",
              icon: [576, 512, ["battery-0"], "f244", "M80 160c-8.8 0-16 7.2-16 16V336c0 8.8 7.2 16 16 16H464c8.8 0 16-7.2 16-16V176c0-8.8-7.2-16-16-16H80zM0 176c0-44.2 35.8-80 80-80H464c44.2 0 80 35.8 80 80v16c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32v16c0 44.2-35.8 80-80 80H80c-44.2 0-80-35.8-80-80V176z"]
            }, dr = Nt, ht = {
              prefix: "fas",
              iconName: "socks",
              icon: [512, 512, [129510], "f696", "M175.2 476.6c-9.7-18-15.2-38.7-15.2-60.6c0-40.3 19-78.2 51.2-102.4l64-48c8.1-6 12.8-15.5 12.8-25.6V96H128V240c0 20.1-9.5 39.1-25.6 51.2l-64 48C14.2 357.3 0 385.8 0 416c0 53 43 96 96 96c20.8 0 41-6.7 57.6-19.2l21.6-16.2zM128 64H288V48c0-14.5 3.9-28.2 10.7-39.9C291 3 281.9 0 272 0H176c-26.5 0-48 21.5-48 48V64zM320 96V240c0 20.1-9.5 39.1-25.6 51.2l-64 48C206.2 357.3 192 385.8 192 416c0 53 43 96 96 96c20.8 0 41-6.7 57.6-19.2l115.2-86.4C493 382.2 512 344.3 512 304V96H320zM512 64V48c0-26.5-21.5-48-48-48H368c-26.5 0-48 21.5-48 48V64H512z"]
            }, Or = {
              prefix: "fas",
              iconName: "inbox",
              icon: [512, 512, [], "f01c", "M121 32C91.6 32 66 52 58.9 80.5L1.9 308.4C.6 313.5 0 318.7 0 323.9V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V323.9c0-5.2-.6-10.4-1.9-15.5l-57-227.9C446 52 420.4 32 391 32H121zm0 64H391l48 192H387.8c-12.1 0-23.2 6.8-28.6 17.7l-14.3 28.6c-5.4 10.8-16.5 17.7-28.6 17.7H195.8c-12.1 0-23.2-6.8-28.6-17.7l-14.3-28.6c-5.4-10.8-16.5-17.7-28.6-17.7H73L121 96z"]
            }, hn = {
              prefix: "fas",
              iconName: "section",
              icon: [256, 512, [], "e447", "M64.9 96C67.1 84.4 73.7 76.2 86 70.6c13.8-6.2 34.8-8.9 61.2-4.5c8.8 1.4 36.1 7.1 44.1 9.3c17 4.8 34.7-5.1 39.5-22.2s-5.1-34.7-22.2-39.5c-11.1-3.1-41-9.2-50.9-10.8C123-2.7 88.3-.6 59.7 12.3C29.9 25.8 7.5 50.9 1.6 86.5c-.1 .5-.2 1.1-.2 1.6c-2.2 19.7 .3 37.9 8.1 54.1c7.7 16.1 19.4 28 32 36.9c.6 .5 1.3 .9 2 1.4C22.3 194.2 6.5 215.1 1.7 243c-.1 .6-.2 1.1-.2 1.7c-2.3 19.3 .4 37.1 8.4 53c7.9 15.6 19.8 27 32.3 35.5c22.4 15.2 51.9 24 75.4 31l0 0 3.7 1.1c27.2 8.2 46.9 14.6 59.4 23.8c5.5 4 8.2 7.6 9.5 10.9c1.3 3.2 2.6 8.6 .9 18.1c-1.7 10.1-7.7 18-20.7 23.5c-14 6-35.4 8.5-62 4.4c-12.8-2.1-35.1-9.7-54.1-16.2l0 0c-4.3-1.5-8.5-2.9-12.3-4.2C25.3 420 7.2 429.1 1.6 445.8s3.5 34.9 20.3 40.5c2.6 .8 5.7 1.9 9.2 3.1c18.6 6.3 48.5 16.6 67.3 19.6l0 0 .2 0c34.5 5.4 68.8 3.4 97.2-8.7c29.4-12.6 52.5-36.5 58.5-71.5c3.3-19.3 1.9-37.4-5-53.9c-6.3-15-16.4-26.4-27.6-35.2c16.5-13.9 28.5-33.2 32.6-58.2c3.2-19.8 1.9-38.3-4.8-55.1c-6.7-16.8-17.8-29.4-30.2-39c-22.8-17.6-53.6-27.4-77.7-35l-1.4-.5c-27.4-8.7-47.8-15.3-61.5-25c-6.1-4.4-9.5-8.5-11.4-12.4c-1.8-3.7-3.2-9.3-2.3-18.5zm76.7 208.5c-.2-.1-.4-.1-.6-.2l-1.4-.4c-27.4-8.2-47.9-14.5-61.7-23.8c-6.2-4.2-9.3-7.9-11-11.3c-1.5-3-2.9-7.7-2.1-15.7c1.9-9.7 7.9-17.3 20.5-22.7c14-6 35.4-8.5 62.1-4.3l16.4 2.6c6.3 2.9 11.7 6 16.2 9.5c5.5 4.2 8.4 8.2 10 12.2c1.6 4 2.8 10.4 1.1 20.9c-2.4 14.7-12.8 26.4-37.1 31l-12.4 2.3z"]
            }, Nn = {
              prefix: "fas",
              iconName: "gauge-high",
              icon: [512, 512, [62461, "tachometer-alt", "tachometer-alt-fast"], "f625", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM256 416c35.3 0 64-28.7 64-64c0-17.4-6.9-33.1-18.1-44.6L366 161.7c5.3-12.1-.2-26.3-12.3-31.6s-26.3 .2-31.6 12.3L257.9 288c-.6 0-1.3 0-1.9 0c-35.3 0-64 28.7-64 64s28.7 64 64 64zM176 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM96 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm352-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
            }, Fs = Nn, Do = Nn, o1 = {
              prefix: "fas",
              iconName: "envelope-open-text",
              icon: [512, 512, [], "f658", "M215.4 96H144 107.8 96v8.8V144v40.4 89L.2 202.5c1.6-18.1 10.9-34.9 25.7-45.8L48 140.3V96c0-26.5 21.5-48 48-48h76.6l49.9-36.9C232.2 3.9 243.9 0 256 0s23.8 3.9 33.5 11L339.4 48H416c26.5 0 48 21.5 48 48v44.3l22.1 16.4c14.8 10.9 24.1 27.7 25.7 45.8L416 273.4v-89V144 104.8 96H404.2 368 296.6 215.4zM0 448V242.1L217.6 403.3c11.1 8.2 24.6 12.7 38.4 12.7s27.3-4.4 38.4-12.7L512 242.1V448v0c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64v0zM176 160H336c8.8 0 16 7.2 16 16s-7.2 16-16 16H176c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H336c8.8 0 16 7.2 16 16s-7.2 16-16 16H176c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, pa = {
              prefix: "fas",
              iconName: "hospital",
              icon: [640, 512, [127973, 62589, "hospital-alt", "hospital-wide"], "f0f8", "M192 48c0-26.5 21.5-48 48-48H400c26.5 0 48 21.5 48 48V512H368V432c0-26.5-21.5-48-48-48s-48 21.5-48 48v80H192V48zM48 96H160V512H48c-26.5 0-48-21.5-48-48V320H80c8.8 0 16-7.2 16-16s-7.2-16-16-16H0V224H80c8.8 0 16-7.2 16-16s-7.2-16-16-16H0V144c0-26.5 21.5-48 48-48zm544 0c26.5 0 48 21.5 48 48v48H560c-8.8 0-16 7.2-16 16s7.2 16 16 16h80v64H560c-8.8 0-16 7.2-16 16s7.2 16 16 16h80V464c0 26.5-21.5 48-48 48H480V96H592zM312 64c-8.8 0-16 7.2-16 16v24H272c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h24v24c0 8.8 7.2 16 16 16h16c8.8 0 16-7.2 16-16V152h24c8.8 0 16-7.2 16-16V120c0-8.8-7.2-16-16-16H344V80c0-8.8-7.2-16-16-16H312z"]
            }, pf = pa, Ls = pa, lo = {
              prefix: "fas",
              iconName: "wine-bottle",
              icon: [512, 512, [], "f72f", "M393.4 9.4c12.5-12.5 32.8-12.5 45.3 0l64 64c12.5 12.5 12.5 32.8 0 45.3c-11.8 11.8-30.7 12.5-43.2 1.9l-9.5 9.5-48.8 48.8c-9.2 9.2-11.5 22.9-8.6 35.6c9.4 40.9-1.9 85.6-33.8 117.5L197.3 493.3c-25 25-65.5 25-90.5 0l-88-88c-25-25-25-65.5 0-90.5L180.2 153.3c31.9-31.9 76.6-43.1 117.5-33.8c12.6 2.9 26.4 .5 35.5-8.6l48.8-48.8 9.5-9.5c-10.6-12.6-10-31.4 1.9-43.2zM99.3 347.3l65.4 65.4c6.2 6.2 16.4 6.2 22.6 0l97.4-97.4c6.2-6.2 6.2-16.4 0-22.6l-65.4-65.4c-6.2-6.2-16.4-6.2-22.6 0L99.3 324.7c-6.2 6.2-6.2 16.4 0 22.6z"]
            }, s9 = {
              prefix: "fas",
              iconName: "chess-rook",
              icon: [448, 512, [9820], "f447", "M32 192V48c0-8.8 7.2-16 16-16h64c8.8 0 16 7.2 16 16V88c0 4.4 3.6 8 8 8h32c4.4 0 8-3.6 8-8V48c0-8.8 7.2-16 16-16h64c8.8 0 16 7.2 16 16V88c0 4.4 3.6 8 8 8h32c4.4 0 8-3.6 8-8V48c0-8.8 7.2-16 16-16h64c8.8 0 16 7.2 16 16V192c0 10.1-4.7 19.6-12.8 25.6L352 256l16 144H80L96 256 44.8 217.6C36.7 211.6 32 202.1 32 192zm176 96h32c8.8 0 16-7.2 16-16V224c0-17.7-14.3-32-32-32s-32 14.3-32 32v48c0 8.8 7.2 16 16 16zM22.6 473.4L64 432H384l41.4 41.4c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6H38.6C26.1 512 16 501.9 16 489.4c0-6 2.4-11.8 6.6-16z"]
            }, Yo = {
              prefix: "fas",
              iconName: "bars-staggered",
              icon: [512, 512, ["reorder", "stream"], "f550", "M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM64 256c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]
            }, Rl = Yo, Q1 = Yo, Sv = {
              prefix: "fas",
              iconName: "dharmachakra",
              icon: [512, 512, [9784], "f655", "M337.8 205.7l48.6-42.5c13.8 19.3 23.4 41.9 27.4 66.2l-64.4 4.3c-2.4-10.1-6.4-19.5-11.6-28zm140.1 19.5c-5.3-38.8-20.6-74.5-43.2-104.3l.8-.7C449 108.4 449.7 87.6 437 75s-33.4-12-45.2 1.5l-.7 .8c-29.8-22.6-65.5-37.9-104.3-43.2l.1-1.1c1.2-17.9-13-33-30.9-33s-32.1 15.2-30.9 33l.1 1.1c-38.8 5.3-74.5 20.6-104.3 43.2l-.7-.8C108.4 63 87.6 62.3 75 75s-12 33.4 1.5 45.2l.8 .7c-22.6 29.8-37.9 65.5-43.2 104.3l-1.1-.1c-17.9-1.2-33 13-33 30.9s15.2 32.1 33 30.9l1.1-.1c5.3 38.8 20.6 74.5 43.2 104.3l-.8 .7C63 403.6 62.3 424.4 75 437s33.4 12 45.2-1.5l.7-.8c29.8 22.6 65.5 37.9 104.3 43.2l-.1 1.1c-1.2 17.9 13 33 30.9 33s32.1-15.2 30.9-33l-.1-1.1c38.8-5.3 74.5-20.6 104.3-43.2l.7 .8c11.8 13.5 32.5 14.2 45.2 1.5s12-33.4-1.5-45.2l-.8-.7c22.6-29.8 37.9-65.5 43.2-104.3l1.1 .1c17.9 1.2 33-13 33-30.9s-15.2-32.1-33-30.9l-1.1 .1zM163.2 125.6c19.3-13.8 41.9-23.4 66.2-27.5l4.3 64.4c-10 2.4-19.5 6.4-28 11.6l-42.5-48.6zm-65 103.8c4.1-24.4 13.7-46.9 27.5-66.2l48.6 42.5c-5.3 8.5-9.2 18-11.6 28l-64.4-4.3zm27.5 119.4c-13.8-19.3-23.4-41.9-27.5-66.2l64.4-4.3c2.4 10 6.4 19.5 11.6 28l-48.6 42.5zm103.8 65c-24.4-4.1-46.9-13.7-66.2-27.4l42.5-48.6c8.5 5.3 18 9.2 28 11.6l-4.3 64.4zm119.4-27.4c-19.3 13.8-41.9 23.4-66.2 27.4l-4.3-64.4c10-2.4 19.5-6.4 28-11.6l42.5 48.6zm65-103.8c-4.1 24.4-13.7 46.9-27.4 66.2l-48.6-42.5c5.3-8.5 9.2-18 11.6-28l64.4 4.3zm-65-156.9l-42.5 48.6c-8.5-5.3-18-9.2-28-11.6l4.3-64.4c24.4 4.1 46.9 13.7 66.2 27.5zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, P0 = {
              prefix: "fas",
              iconName: "hotdog",
              icon: [512, 512, [127789], "f80f", "M488.6 23.4c31.2 31.2 31.2 81.9 0 113.1l-352 352c-31.2 31.2-81.9 31.2-113.1 0s-31.2-81.9 0-113.1l352-352c31.2-31.2 81.9-31.2 113.1 0zM443.3 92.7c-6.2-6.2-16.4-6.2-22.6 0c-12.5 12.5-23.8 15.1-37.5 17.6l-2.5 .4c-13.8 2.5-31.6 5.6-48 22c-16.7 16.7-20.9 36-24.1 50.9l0 0v0l-.2 1c-3.4 15.6-6 26.4-15.7 36.1s-20.5 12.3-36.1 15.7l-1 .2c-14.9 3.2-34.2 7.4-50.9 24.1s-20.9 36-24.1 50.9l-.2 1c-3.4 15.6-6 26.4-15.7 36.1c-9.2 9.2-18 10.8-32.7 13.4l0 0-.9 .2c-15.6 2.8-34.9 6.9-54.4 26.4c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0c12.5-12.5 23.8-15.1 37.5-17.6l2.5-.4c13.8-2.5 31.6-5.6 48-22c16.7-16.7 20.9-36 24.1-50.9l.2-1c3.4-15.6 6-26.4 15.7-36.1s20.5-12.3 36.1-15.7l1-.2c14.9-3.2 34.2-7.4 50.9-24.1s20.9-36 24.1-50.9l.2-1c3.4-15.6 6-26.4 15.7-36.1c9.2-9.2 18-10.8 32.7-13.4l.9-.2c15.6-2.8 34.9-6.9 54.4-26.4c6.2-6.2 6.2-16.4 0-22.6zM191.2 479.2l288-288L495 207c10.9 10.9 17 25.6 17 41s-6.1 30.1-17 41L289 495c-10.9 10.9-25.6 17-41 17s-30.1-6.1-41-17l-15.8-15.8zM17 305C6.1 294.1 0 279.4 0 264s6.1-30.1 17-41L223 17C233.9 6.1 248.6 0 264 0s30.1 6.1 41 17l15.8 15.8-288 288L17 305z"]
            }, op = {
              prefix: "fas",
              iconName: "person-walking-with-cane",
              icon: [512, 512, ["blind"], "f29d", "M176 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8.4 32c-36.4 0-69.6 20.5-85.9 53.1L35.4 273.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3L128 231.6v43.2c0 17 6.7 33.3 18.7 45.3L224 397.3V480c0 17.7 14.3 32 32 32s32-14.3 32-32V390.6c0-12.7-5.1-24.9-14.1-33.9L224 306.7V213.3l70.4 93.9c10.6 14.1 30.7 17 44.8 6.4s17-30.7 6.4-44.8L268.8 166.4C250.7 142.2 222.2 128 192 128H167.6zM128.3 346.8L97 472.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l22-88.2-52.8-52.8zM450.8 505.1c5 7.3 15 9.1 22.3 4s9.1-15 4-22.3L358.9 316.1c-2.8 3.8-6.1 7.3-10.1 10.3c-5 3.8-10.5 6.4-16.2 7.9L450.8 505.1z"]
            }, Vl = op, Ix = {
              prefix: "fas",
              iconName: "drum",
              icon: [512, 512, [129345], "f569", "M501.2 76.1c11.1-7.3 14.2-22.1 6.9-33.2s-22.1-14.2-33.2-6.9L370.2 104.5C335.8 98.7 297 96 256 96C114.6 96 0 128 0 208V368c0 31.3 27.4 58.8 72 78.7V344c0-13.3 10.7-24 24-24s24 10.7 24 24V463.4c33 8.9 71.1 14.5 112 16.1V376c0-13.3 10.7-24 24-24s24 10.7 24 24V479.5c40.9-1.6 79-7.2 112-16.1V344c0-13.3 10.7-24 24-24s24 10.7 24 24V446.7c44.6-19.9 72-47.4 72-78.7V208c0-41.1-30.2-69.5-78.8-87.4l67.9-44.5zM307.4 145.6l-64.6 42.3c-11.1 7.3-14.2 22.1-6.9 33.2s22.1 14.2 33.2 6.9l111.1-72.8c14.7 3.2 27.9 7 39.4 11.5C458.4 181.8 464 197.4 464 208c0 .8-2.7 17.2-46 35.9C379.1 260.7 322 272 256 272s-123.1-11.3-162-28.1C50.7 225.2 48 208.8 48 208c0-10.6 5.6-26.2 44.4-41.3C130.6 151.9 187.8 144 256 144c18 0 35.1 .5 51.4 1.6z"]
            }, mU = {
              prefix: "fas",
              iconName: "ice-cream",
              icon: [448, 512, [127848], "f810", "M367.1 160c.6-5.3 .9-10.6 .9-16C368 64.5 303.5 0 224 0S80 64.5 80 144c0 5.4 .3 10.7 .9 16H80c-26.5 0-48 21.5-48 48s21.5 48 48 48h53.5 181H368c26.5 0 48-21.5 48-48s-21.5-48-48-48h-.9zM96 288L200.8 497.7c4.4 8.8 13.3 14.3 23.2 14.3s18.8-5.5 23.2-14.3L352 288H96z"]
            }, BU = {
              prefix: "fas",
              iconName: "heart-circle-bolt",
              icon: [576, 512, [], "e4fc", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm47.9-225c4.3 3.7 5.4 9.9 2.6 14.9L452.4 356H488c5.2 0 9.8 3.3 11.4 8.2s-.1 10.3-4.2 13.4l-96 72c-4.5 3.4-10.8 3.2-15.1-.6s-5.4-9.9-2.6-14.9L411.6 380H376c-5.2 0-9.8-3.3-11.4-8.2s.1-10.3 4.2-13.4l96-72c4.5-3.4 10.8-3.2 15.1 .6z"]
            }, TV = {
              prefix: "fas",
              iconName: "fax",
              icon: [512, 512, [128224, 128439], "f1ac", "M128 64v96h64V64H386.7L416 93.3V160h64V93.3c0-17-6.7-33.3-18.7-45.3L432 18.7C420 6.7 403.7 0 386.7 0H192c-35.3 0-64 28.7-64 64zM0 160V480c0 17.7 14.3 32 32 32H64c17.7 0 32-14.3 32-32V160c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zm480 32H128V480c0 17.7 14.3 32 32 32H480c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM256 256a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM224 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, qV = {
              prefix: "fas",
              iconName: "paragraph",
              icon: [448, 512, [182], "f1dd", "M192 32h64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H384l0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352H288V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H192c-88.4 0-160-71.6-160-160s71.6-160 160-160z"]
            }, O8 = {
              prefix: "fas",
              iconName: "check-to-slot",
              icon: [576, 512, ["vote-yea"], "f772", "M96 80c0-26.5 21.5-48 48-48H432c26.5 0 48 21.5 48 48V384H96V80zm313 47c-9.4-9.4-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L409 161c9.4-9.4 9.4-24.6 0-33.9zM0 336c0-26.5 21.5-48 48-48H64V416H512V288h16c26.5 0 48 21.5 48 48v96c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V336z"]
            }, Cl = O8, y8 = {
              prefix: "fas",
              iconName: "star-half",
              icon: [576, 512, [61731], "f089", "M288 0c-12.2 .1-23.3 7-28.6 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3L288 439.8V0zM429.9 512c1.1 .1 2.1 .1 3.2 0h-3.2z"]
            }, ZB = {
              prefix: "fas",
              iconName: "boxes-stacked",
              icon: [576, 512, [62625, "boxes", "boxes-alt"], "f468", "M248 0H208c-26.5 0-48 21.5-48 48V160c0 35.3 28.7 64 64 64H352c35.3 0 64-28.7 64-64V48c0-26.5-21.5-48-48-48H328V80c0 8.8-7.2 16-16 16H264c-8.8 0-16-7.2-16-16V0zM64 256c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H224c35.3 0 64-28.7 64-64V320c0-35.3-28.7-64-64-64H184v80c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V256H64zM352 512H512c35.3 0 64-28.7 64-64V320c0-35.3-28.7-64-64-64H472v80c0 8.8-7.2 16-16 16H408c-8.8 0-16-7.2-16-16V256H352c-15 0-28.8 5.1-39.7 13.8c4.9 10.4 7.7 22 7.7 34.2V464c0 12.2-2.8 23.8-7.7 34.2C323.2 506.9 337 512 352 512z"]
            }, k8 = ZB, _B = ZB, Uw = {
              prefix: "fas",
              iconName: "link",
              icon: [640, 512, [128279, "chain"], "f0c1", "M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"]
            }, WU = Uw, $B = {
              prefix: "fas",
              iconName: "ear-listen",
              icon: [512, 512, ["assistive-listening-systems"], "f2a2", "M398.3 3.4c-15.8-7.9-35-1.5-42.9 14.3c-7.9 15.8-1.5 34.9 14.2 42.9l.4 .2c.4 .2 1.1 .6 2.1 1.2c2 1.2 5 3 8.7 5.6c7.5 5.2 17.6 13.2 27.7 24.2C428.5 113.4 448 146 448 192c0 17.7 14.3 32 32 32s32-14.3 32-32c0-66-28.5-113.4-56.5-143.7C441.6 33.2 427.7 22.2 417.3 15c-5.3-3.7-9.7-6.4-13-8.3c-1.6-1-3-1.7-4-2.2c-.5-.3-.9-.5-1.2-.7l-.4-.2-.2-.1-.1 0 0 0c0 0 0 0-14.3 28.6L398.3 3.4zM128.7 227.5c6.2-56 53.7-99.5 111.3-99.5c61.9 0 112 50.1 112 112c0 29.3-11.2 55.9-29.6 75.9c-17 18.4-34.4 45.1-34.4 78V400c0 26.5-21.5 48-48 48c-17.7 0-32 14.3-32 32s14.3 32 32 32c61.9 0 112-50.1 112-112v-6.1c0-9.8 5.4-21.7 17.4-34.7C398.3 327.9 416 286 416 240c0-97.2-78.8-176-176-176C149.4 64 74.8 132.5 65.1 220.5c-1.9 17.6 10.7 33.4 28.3 35.3s33.4-10.7 35.3-28.3zM32 512a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM192 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0zM208 240c0-17.7 14.3-32 32-32s32 14.3 32 32c0 13.3 10.7 24 24 24s24-10.7 24-24c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 13.3 10.7 24 24 24s24-10.7 24-24z"]
            }, bV = $B, xV = {
              prefix: "fas",
              iconName: "tree-city",
              icon: [640, 512, [], "e587", "M288 48c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48V192h40V120c0-13.3 10.7-24 24-24s24 10.7 24 24v72h24c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H432 336c-26.5 0-48-21.5-48-48V48zm64 32v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16zm16 80c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V176c0-8.8-7.2-16-16-16H368zM352 272v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16zm176-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H528zM512 368v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H528c-8.8 0-16 7.2-16 16zM224 160c0 6-1 11-2 16c20 14 34 38 34 64c0 45-36 80-80 80H160V480c0 18-15 32-32 32c-18 0-32-14-32-32V320H80c-45 0-80-35-80-80c0-26 13-50 33-64c-1-5-1-10-1-16c0-53 42-96 96-96c53 0 96 43 96 96z"]
            }, eW = {
              prefix: "fas",
              iconName: "play",
              icon: [384, 512, [9654], "f04b", "M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80V432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"]
            }, DV = {
              prefix: "fas",
              iconName: "font",
              icon: [448, 512, [], "f031", "M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32h-1.8l18-48H303.8l18 48H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H390.2L254 52.8zM279.8 304H168.2L224 155.1 279.8 304z"]
            }, tW = {
              prefix: "fas",
              iconName: "rupiah-sign",
              icon: [512, 512, [], "e23d", "M0 64C0 46.3 14.3 32 32 32h80c79.5 0 144 64.5 144 144c0 58.8-35.2 109.3-85.7 131.7l51.4 128.4c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8L106.3 320H64V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V288 64zM64 256h48c44.2 0 80-35.8 80-80s-35.8-80-80-80H64V256zm256-96h80c61.9 0 112 50.1 112 112s-50.1 112-112 112H352v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V352 192c0-17.7 14.3-32 32-32zm80 160c26.5 0 48-21.5 48-48s-21.5-48-48-48H352v96h48z"]
            }, SU = {
              prefix: "fas",
              iconName: "magnifying-glass",
              icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]
            }, jV = SU, Rx = {
              prefix: "fas",
              iconName: "table-tennis-paddle-ball",
              icon: [640, 512, [127955, "ping-pong-paddle-ball", "table-tennis"], "f45d", "M480 288c-50.1 0-93.6 28.8-114.6 70.8L132.9 126.3l.6-.6 60.1-60.1c87.5-87.5 229.3-87.5 316.8 0c67.1 67.1 82.7 166.3 46.8 248.3C535.8 297.6 509 288 480 288zM113.3 151.9L354.1 392.7c-1.4 7.5-2.1 15.3-2.1 23.3c0 23.2 6.2 44.9 16.9 63.7c-3 .2-6.1 .3-9.2 .3H357c-33.9 0-66.5-13.5-90.5-37.5l-9.8-9.8c-13.1-13.1-34.6-12.4-46.8 1.7L152.2 501c-5.8 6.7-14.2 10.7-23 11s-17.5-3.1-23.8-9.4l-32-32c-6.3-6.3-9.7-14.9-9.4-23.8s4.3-17.2 11-23l66.6-57.7c14-12.2 14.8-33.7 1.7-46.8l-9.8-9.8c-24-24-37.5-56.6-37.5-90.5v-2.7c0-22.8 6.1-44.9 17.3-64.3zM480 320a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
            }, UU = Rx, wV = Rx, Uv = {
              prefix: "fas",
              iconName: "person-dots-from-line",
              icon: [576, 512, ["diagnoses"], "f470", "M288 176A88 88 0 1 0 288 0a88 88 0 1 0 0 176zM78.7 372.9c15-12.5 50-34.4 97.3-50.1V432H400V322.7c47.3 15.8 82.3 37.7 97.3 50.1c20.4 17 50.6 14.2 67.6-6.1s14.2-50.6-6.1-67.6c-12-10-30.1-22.5-53.2-35C497.2 278.4 481.7 288 464 288c-26.5 0-48-21.5-48-48c0-4.3 .6-8.4 1.6-12.4C379.1 215.9 335.3 208 288 208c-60.2 0-114.9 12.9-160 29.9c0 .7 0 1.4 0 2.1c0 26.5-21.5 48-48 48c-11.8 0-22.7-4.3-31-11.4c-13.1 8.1-23.7 15.9-31.7 22.5c-20.4 17-23.1 47.2-6.1 67.6s47.2 23.1 67.6 6.1zM24 464c-13.3 0-24 10.7-24 24s10.7 24 24 24H552c13.3 0 24-10.7 24-24s-10.7-24-24-24H24zM224 280a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm104 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM96 240a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm368 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
            }, rW = Uv, IU = {
              prefix: "fas",
              iconName: "trash-can-arrow-up",
              icon: [448, 512, ["trash-restore-alt"], "f82a", "M163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3C140.6 6.8 151.7 0 163.8 0zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm192 64c-6.4 0-12.5 2.5-17 7l-80 80c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39V408c0 13.3 10.7 24 24 24s24-10.7 24-24V273.9l39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-4.5-4.5-10.6-7-17-7z"]
            }, mV = IU, m2 = {
              prefix: "fas",
              iconName: "naira-sign",
              icon: [448, 512, [], "e1f6", "M122.6 46.3c-7.8-11.7-22.4-17-35.9-12.9S64 49.9 64 64V256H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H64V448c0 17.7 14.3 32 32 32s32-14.3 32-32V320H228.2l97.2 145.8c7.8 11.7 22.4 17 35.9 12.9s22.7-16.5 22.7-30.6V320h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H384V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V256H262.5L122.6 46.3zM305.1 320H320v22.3L305.1 320zM185.5 256H128V169.7L185.5 256z"]
            }, BV = {
              prefix: "fas",
              iconName: "cart-arrow-down",
              icon: [576, 512, [], "f218", "M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48H69.5c3.8 0 7.1 2.7 7.9 6.5l51.6 271c6.5 34 36.2 58.5 70.7 58.5H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H199.7c-11.5 0-21.4-8.2-23.6-19.5L170.7 288H459.2c32.6 0 61.1-21.8 69.5-53.3l41-152.3C576.6 57 557.4 32 531.1 32H360V134.1l23-23c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-64 64c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l23 23V32H120.1C111 12.8 91.6 0 69.5 0H24zM176 512a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm336-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
            }, WV = {
              prefix: "fas",
              iconName: "walkie-talkie",
              icon: [384, 512, [], "f8ef", "M112 24c0-13.3-10.7-24-24-24S64 10.7 64 24V96H48C21.5 96 0 117.5 0 144V300.1c0 12.7 5.1 24.9 14.1 33.9l3.9 3.9c9 9 14.1 21.2 14.1 33.9V464c0 26.5 21.5 48 48 48H304c26.5 0 48-21.5 48-48V371.9c0-12.7 5.1-24.9 14.1-33.9l3.9-3.9c9-9 14.1-21.2 14.1-33.9V144c0-26.5-21.5-48-48-48H320c0-17.7-14.3-32-32-32s-32 14.3-32 32H224c0-17.7-14.3-32-32-32s-32 14.3-32 32H112V24zm0 136H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, Iw = {
              prefix: "fas",
              iconName: "file-pen",
              icon: [576, 512, [128221, "file-edit"], "f31c", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V285.7l-86.8 86.8c-10.3 10.3-17.5 23.1-21 37.2l-18.7 74.9c-2.3 9.2-1.8 18.8 1.3 27.5H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"]
            }, nW = Iw, yH = {
              prefix: "fas",
              iconName: "receipt",
              icon: [384, 512, [129534], "f543", "M14 2.2C22.5-1.7 32.5-.3 39.6 5.8L80 40.4 120.4 5.8c9-7.7 22.3-7.7 31.2 0L192 40.4 232.4 5.8c9-7.7 22.3-7.7 31.2 0L304 40.4 344.4 5.8c7.1-6.1 17.1-7.5 25.6-3.6s14 12.4 14 21.8V488c0 9.4-5.5 17.9-14 21.8s-18.5 2.5-25.6-3.6L304 471.6l-40.4 34.6c-9 7.7-22.3 7.7-31.2 0L192 471.6l-40.4 34.6c-9 7.7-22.3 7.7-31.2 0L80 471.6 39.6 506.2c-7.1 6.1-17.1 7.5-25.6 3.6S0 497.4 0 488V24C0 14.6 5.5 6.1 14 2.2zM96 144c-8.8 0-16 7.2-16 16s7.2 16 16 16H288c8.8 0 16-7.2 16-16s-7.2-16-16-16H96zM80 352c0 8.8 7.2 16 16 16H288c8.8 0 16-7.2 16-16s-7.2-16-16-16H96c-8.8 0-16 7.2-16 16zM96 240c-8.8 0-16 7.2-16 16s7.2 16 16 16H288c8.8 0 16-7.2 16-16s-7.2-16-16-16H96z"]
            }, iW = {
              prefix: "fas",
              iconName: "square-pen",
              icon: [448, 512, ["pen-square", "pencil-square"], "f14b", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM325.8 139.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-21.4 21.4-71-71 21.4-21.4c15.6-15.6 40.9-15.6 56.6 0zM119.9 289L225.1 183.8l71 71L190.9 359.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"]
            }, SV = iW, UV = iW, RU = {
              prefix: "fas",
              iconName: "suitcase-rolling",
              icon: [384, 512, [], "f5c1", "M144 56c0-4.4 3.6-8 8-8h80c4.4 0 8 3.6 8 8v72H144V56zm176 72H288V56c0-30.9-25.1-56-56-56H152C121.1 0 96 25.1 96 56v72H64c-35.3 0-64 28.7-64 64V416c0 35.3 28.7 64 64 64c0 17.7 14.3 32 32 32s32-14.3 32-32H256c0 17.7 14.3 32 32 32s32-14.3 32-32c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64zM112 224H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 128H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, sW = {
              prefix: "fas",
              iconName: "person-circle-exclamation",
              icon: [576, 512, [], "e53f", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V256.9L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6h29.7c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H152zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16v80c0 8.8 7.2 16 16 16s16-7.2 16-16V288c0-8.8-7.2-16-16-16z"]
            }, IV = {
              prefix: "fas",
              iconName: "chevron-down",
              icon: [512, 512, [], "f078", "M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]
            }, aW = {
              prefix: "fas",
              iconName: "battery-full",
              icon: [576, 512, [128267, "battery", "battery-5"], "f240", "M464 160c8.8 0 16 7.2 16 16V336c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16H464zM80 96C35.8 96 0 131.8 0 176V336c0 44.2 35.8 80 80 80H464c44.2 0 80-35.8 80-80V320c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32V176c0-44.2-35.8-80-80-80H80zm368 96H96V320H448V192z"]
            }, oW = aW, VU = aW, RV = {
              prefix: "fas",
              iconName: "skull-crossbones",
              icon: [448, 512, [128369, 9760], "f714", "M368 128c0 44.4-25.4 83.5-64 106.4V256c0 17.7-14.3 32-32 32H176c-17.7 0-32-14.3-32-32V234.4c-38.6-23-64-62.1-64-106.4C80 57.3 144.5 0 224 0s144 57.3 144 128zM168 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM3.4 273.7c7.9-15.8 27.1-22.2 42.9-14.3L224 348.2l177.7-88.8c15.8-7.9 35-1.5 42.9 14.3s1.5 35-14.3 42.9L295.6 384l134.8 67.4c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3L224 419.8 46.3 508.6c-15.8 7.9-35 1.5-42.9-14.3s-1.5-35 14.3-42.9L152.4 384 17.7 316.6C1.9 308.7-4.5 289.5 3.4 273.7z"]
            }, CU = {
              prefix: "fas",
              iconName: "code-compare",
              icon: [512, 512, [], "e13a", "M320 488c0 9.5-5.6 18.1-14.2 21.9s-18.8 2.3-25.8-4.1l-80-72c-5.1-4.6-7.9-11-7.9-17.8s2.9-13.3 7.9-17.8l80-72c7-6.3 17.2-7.9 25.8-4.1s14.2 12.4 14.2 21.9v40h16c35.3 0 64-28.7 64-64V153.3C371.7 141 352 112.8 352 80c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3V320c0 70.7-57.3 128-128 128H320v40zM456 80a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM192 24c0-9.5 5.6-18.1 14.2-21.9s18.8-2.3 25.8 4.1l80 72c5.1 4.6 7.9 11 7.9 17.8s-2.9 13.3-7.9 17.8l-80 72c-7 6.3-17.2 7.9-25.8 4.1s-14.2-12.4-14.2-21.9V128H176c-35.3 0-64 28.7-64 64V358.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3V192c0-70.7 57.3-128 128-128h16V24zM56 432a24 24 0 1 0 48 0 24 24 0 1 0 -48 0z"]
            }, Rw = {
              prefix: "fas",
              iconName: "list-ul",
              icon: [512, 512, ["list-dots"], "f0ca", "M64 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zM64 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48-208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
            }, VV = Rw, fW = {
              prefix: "fas",
              iconName: "school-lock",
              icon: [640, 512, [], "e56f", "M302.2 5.4c10.7-7.2 24.8-7.2 35.5 0L473.7 96H592c26.5 0 48 21.5 48 48V272c0-61.9-50.1-112-112-112s-112 50.1-112 112v24.6c-19.1 11.1-32 31.7-32 55.4H320.3l-.3 0c-35.3 0-64 28.7-64 64v96h64v0H48c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48H166.3L302.2 5.4zM80 208v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V208c0-8.8-7.2-16-16-16H96c-8.8 0-16 7.2-16 16zm0 128v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V336c0-8.8-7.2-16-16-16H96c-8.8 0-16 7.2-16 16zm240-72a88 88 0 1 0 0-176 88 88 0 1 0 0 176zm16-120v16h16c8.8 0 16 7.2 16 16s-7.2 16-16 16H320c-8.8 0-16-7.2-16-16V144c0-8.8 7.2-16 16-16s16 7.2 16 16zm192 96c-17.7 0-32 14.3-32 32v48h64V272c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80v48c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32H448c-17.7 0-32-14.3-32-32V352c0-17.7 14.3-32 32-32V272z"]
            }, AW = {
              prefix: "fas",
              iconName: "tower-cell",
              icon: [576, 512, [], "e585", "M62.6 2.3C46.2-4.3 27.6 3.6 20.9 20C7.4 53.4 0 89.9 0 128s7.4 74.6 20.9 108c6.6 16.4 25.3 24.3 41.7 17.7S86.9 228.4 80.3 212C69.8 186.1 64 157.8 64 128s5.8-58.1 16.3-84C86.9 27.6 79 9 62.6 2.3zm450.8 0C497 9 489.1 27.6 495.7 44C506.2 69.9 512 98.2 512 128s-5.8 58.1-16.3 84c-6.6 16.4 1.3 35 17.7 41.7s35-1.3 41.7-17.7c13.5-33.4 20.9-69.9 20.9-108s-7.4-74.6-20.9-108C548.4 3.6 529.8-4.3 513.4 2.3zM340.1 165.2c7.5-10.5 11.9-23.3 11.9-37.2c0-35.3-28.7-64-64-64s-64 28.7-64 64c0 13.9 4.4 26.7 11.9 37.2L98.9 466.8c-7.3 16.1-.2 35.1 15.9 42.4s35.1 .2 42.4-15.9L177.7 448H398.3l20.6 45.2c7.3 16.1 26.3 23.2 42.4 15.9s23.2-26.3 15.9-42.4L340.1 165.2zM369.2 384H206.8l14.5-32H354.7l14.5 32zM288 205.3L325.6 288H250.4L288 205.3zM163.3 73.6c5.3-12.1-.2-26.3-12.4-31.6s-26.3 .2-31.6 12.4C109.5 77 104 101.9 104 128s5.5 51 15.3 73.6c5.3 12.1 19.5 17.7 31.6 12.4s17.7-19.5 12.4-31.6C156 165.8 152 147.4 152 128s4-37.8 11.3-54.4zM456.7 54.4c-5.3-12.1-19.5-17.7-31.6-12.4s-17.7 19.5-12.4 31.6C420 90.2 424 108.6 424 128s-4 37.8-11.3 54.4c-5.3 12.1 .2 26.3 12.4 31.6s26.3-.2 31.6-12.4C466.5 179 472 154.1 472 128s-5.5-51-15.3-73.6z"]
            }, dW = {
              prefix: "fas",
              iconName: "down-long",
              icon: [320, 512, ["long-arrow-alt-down"], "f309", "M2 334.5c-3.8 8.8-2 19 4.6 26l136 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l136-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L128 0C110.3 0 96 14.3 96 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"]
            }, CV = dW, OU = {
              prefix: "fas",
              iconName: "ranking-star",
              icon: [640, 512, [], "e561", "M353.8 54.1L330.2 6.3c-3.9-8.3-16.1-8.6-20.4 0L286.2 54.1l-52.3 7.5c-9.3 1.4-13.3 12.9-6.4 19.8l38 37-9 52.1c-1.4 9.3 8.2 16.5 16.8 12.2l46.9-24.8 46.6 24.4c8.6 4.3 18.3-2.9 16.8-12.2l-9-52.1 38-36.6c6.8-6.8 2.9-18.3-6.4-19.8l-52.3-7.5zM256 256c-17.7 0-32 14.3-32 32V480c0 17.7 14.3 32 32 32H384c17.7 0 32-14.3 32-32V288c0-17.7-14.3-32-32-32H256zM32 320c-17.7 0-32 14.3-32 32V480c0 17.7 14.3 32 32 32H160c17.7 0 32-14.3 32-32V352c0-17.7-14.3-32-32-32H32zm416 96v64c0 17.7 14.3 32 32 32H608c17.7 0 32-14.3 32-32V416c0-17.7-14.3-32-32-32H480c-17.7 0-32 14.3-32 32z"]
            }, yU = {
              prefix: "fas",
              iconName: "chess-king",
              icon: [448, 512, [9818], "f43f", "M224 0c17.7 0 32 14.3 32 32V48h16c17.7 0 32 14.3 32 32s-14.3 32-32 32H256v48H408c22.1 0 40 17.9 40 40c0 5.3-1 10.5-3.1 15.4L368 400H80L3.1 215.4C1 210.5 0 205.3 0 200c0-22.1 17.9-40 40-40H192V112H176c-17.7 0-32-14.3-32-32s14.3-32 32-32h16V32c0-17.7 14.3-32 32-32zM38.6 473.4L80 432H368l41.4 41.4c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6H54.6C42.1 512 32 501.9 32 489.4c0-6 2.4-11.8 6.6-16z"]
            }, Vx = {
              prefix: "fas",
              iconName: "person-harassing",
              icon: [576, 512, [], "e549", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM59.4 304.5L88 256.9V480c0 17.7 14.3 32 32 32s32-14.3 32-32V352h16V480c0 17.7 14.3 32 32 32s32-14.3 32-32V235.3l47.4 57.1c11.3 13.6 31.5 15.5 45.1 4.2s15.5-31.5 4.2-45.1l-73.7-88.9c-18.2-22-45.3-34.7-73.9-34.7H145.1c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9zM480 240a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM464 344v58.7l-41.4-41.4c-7.3-7.3-17.6-10.6-27.8-9s-18.9 8.1-23.5 17.3l-48 96c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3L408.8 438l54.7 54.7c12.4 12.4 29.1 19.3 46.6 19.3c36.4 0 65.9-29.5 65.9-65.9V344c0-30.9-25.1-56-56-56s-56 25.1-56 56zM288 48c0 8.8 7.2 16 16 16h56c8.8 0 16-7.2 16-16s-7.2-16-16-16H304c-8.8 0-16 7.2-16 16zm-.8 49.7c-7.9-4-17.5-.7-21.5 7.2s-.7 17.5 7.2 21.5l48 24c7.9 4 17.5 .7 21.5-7.2s.7-17.5-7.2-21.5l-48-24z"]
            }, Vw = {
              prefix: "fas",
              iconName: "brazilian-real-sign",
              icon: [512, 512, [], "e46c", "M400 0c17.7 0 32 14.3 32 32V50.2c12.5 2.3 24.7 6.4 36.2 12.1l10.1 5.1c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3l-10.2-5.1c-9.9-5-20.9-7.5-32-7.5h-1.7c-29.8 0-53.9 24.1-53.9 53.9c0 22 13.4 41.8 33.9 50l52 20.8c44.7 17.9 74.1 61.2 74.1 109.4v3.4c0 51.2-33.6 94.6-80 109.2V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V460.6c-15-3.5-29.4-9.7-42.3-18.3l-23.4-15.6c-14.7-9.8-18.7-29.7-8.9-44.4s29.7-18.7 44.4-8.9L361.2 389c10.8 7.2 23.4 11 36.3 11c27.9 0 50.5-22.6 50.5-50.5v-3.4c0-22-13.4-41.8-33.9-50l-52-20.8C317.3 257.4 288 214.1 288 165.9C288 114 321.5 70 368 54.2V32c0-17.7 14.3-32 32-32zM0 64C0 46.3 14.3 32 32 32h80c79.5 0 144 64.5 144 144c0 58.8-35.2 109.3-85.7 131.7l51.4 128.4c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8L106.3 320H64V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V288 64zM64 256h48c44.2 0 80-35.8 80-80s-35.8-80-80-80H64V256z"]
            }, kU = {
              prefix: "fas",
              iconName: "landmark-dome",
              icon: [512, 512, ["landmark-alt"], "f752", "M248 0h16c13.3 0 24 10.7 24 24V34.7C368.4 48.1 431.9 111.6 445.3 192H448c17.7 0 32 14.3 32 32s-14.3 32-32 32H64c-17.7 0-32-14.3-32-32s14.3-32 32-32h2.7C80.1 111.6 143.6 48.1 224 34.7V24c0-13.3 10.7-24 24-24zM64 288h64V416h40V288h64V416h48V288h64V416h40V288h64V420.3c.6 .3 1.2 .7 1.7 1.1l48 32c11.7 7.8 17 22.4 12.9 35.9S494.1 512 480 512H32c-14.1 0-26.5-9.2-30.6-22.7s1.1-28.1 12.9-35.9l48-32c.6-.4 1.2-.7 1.8-1.1V288z"]
            }, EU = kU, vW = {
              prefix: "fas",
              iconName: "arrow-up",
              icon: [384, 512, [8593], "f062", "M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.2L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"]
            }, uW = {
              prefix: "fas",
              iconName: "tv",
              icon: [640, 512, [63717, "television", "tv-alt"], "f26c", "M64 64V352H576V64H64zM0 64C0 28.7 28.7 0 64 0H576c35.3 0 64 28.7 64 64V352c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM128 448H512c17.7 0 32 14.3 32 32s-14.3 32-32 32H128c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, OV = uW, FU = uW, NU = {
              prefix: "fas",
              iconName: "shrimp",
              icon: [512, 512, [129424], "e448", "M64 32C28.7 32 0 60.7 0 96s28.7 64 64 64h1c3.7 88.9 77 160 167 160h56V128H264 88.8 64c-17.7 0-32-14.3-32-32s14.3-32 32-32H464c8.8 0 16-7.2 16-16s-7.2-16-16-16H64zM224 456c0 13.3 10.7 24 24 24h72V407.8l-64.1-22.4c-12.5-4.4-26.2 2.2-30.6 14.7s2.2 26.2 14.7 30.6l4.5 1.6C233 433.9 224 443.9 224 456zm128 23.3c36.4-3.3 69.5-17.6 96.1-39.6l-86.5-34.6c-3 1.8-6.2 3.2-9.6 4.3v69.9zM472.6 415c24.6-30.3 39.4-68.9 39.4-111c0-12.3-1.3-24.3-3.7-35.9L382.8 355.1c.8 3.4 1.2 7 1.2 10.6c0 4.6-.7 9-1.9 13.1L472.6 415zM336 128H320V320h18.3c9.9 0 19.1 3.2 26.6 8.5l133.5-92.4C471.8 172.6 409.1 128 336 128zM168 192a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
            }, QU = {
              prefix: "fas",
              iconName: "list-check",
              icon: [512, 512, ["tasks"], "f0ae", "M152.1 38.2c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 113C-2.3 103.6-2.3 88.4 7 79s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zm0 160c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zM224 96c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H256c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H256c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H192c-17.7 0-32-14.3-32-32zM48 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, YU = QU, yV = {
              prefix: "fas",
              iconName: "jug-detergent",
              icon: [384, 512, [], "e519", "M96 24c0-13.3 10.7-24 24-24h80c13.3 0 24 10.7 24 24V48h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H88C74.7 96 64 85.3 64 72s10.7-24 24-24h8V24zM0 256c0-70.7 57.3-128 128-128H256c70.7 0 128 57.3 128 128V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V256zm256 0v96c0 17.7 14.3 32 32 32s32-14.3 32-32V256c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
            }, lW = {
              prefix: "fas",
              iconName: "circle-user",
              icon: [512, 512, [62142, "user-circle"], "f2bd", "M399 384.2C376.9 345.8 335.4 320 288 320H224c-47.4 0-88.9 25.8-111 64.2c35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z"]
            }, MU = lW, LU = {
              prefix: "fas",
              iconName: "user-shield",
              icon: [640, 512, [], "f505", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c1.8 0 3.5-.2 5.3-.5c-76.3-55.1-99.8-141-103.1-200.2c-16.1-4.8-33.1-7.3-50.7-7.3H178.3zm308.8-78.3l-120 48C358 277.4 352 286.2 352 296c0 63.3 25.9 168.8 134.8 214.2c5.9 2.5 12.6 2.5 18.5 0C614.1 464.8 640 359.3 640 296c0-9.8-6-18.6-15.1-22.3l-120-48c-5.7-2.3-12.1-2.3-17.8 0zM591.4 312c-3.9 50.7-27.2 116.7-95.4 149.7V273.8L591.4 312z"]
            }, KU = {
              prefix: "fas",
              iconName: "wind",
              icon: [512, 512, [], "f72e", "M288 32c0 17.7 14.3 32 32 32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c53 0 96-43 96-96s-43-96-96-96H320c-17.7 0-32 14.3-32 32zm64 352c0 17.7 14.3 32 32 32h32c53 0 96-43 96-96s-43-96-96-96H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H384c-17.7 0-32 14.3-32 32zM128 512h32c53 0 96-43 96-96s-43-96-96-96H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H160c17.7 0 32 14.3 32 32s-14.3 32-32 32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32z"]
            }, PW = {
              prefix: "fas",
              iconName: "car-burst",
              icon: [640, 512, ["car-crash"], "f5e1", "M176 8c-6.6 0-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6l35.3-32.5 9.5-35.4 10.4-38.6c8-29.9 30.5-52.1 57.9-60.9l41-59.2c11.3-16.3 26.4-28.9 43.5-37.2c-.4-.6-.8-1.2-1.3-1.8c-4.1-5.1-10.9-7.2-17.2-5.3L220.3 92.1l-29.4-74C188.4 12 182.6 8 176 8zM367.7 161.5l135.6 36.3c6.5 1.8 11.3 7.4 11.8 14.2l4.6 56.5-201.5-54 32.2-46.6c3.8-5.6 10.8-8.1 17.3-6.4zm-69.9-30l-47.9 69.3c-21.6 3-40.3 18.6-46.3 41l-10.4 38.6-16.6 61.8-8.3 30.9c-4.6 17.1 5.6 34.6 22.6 39.2l15.5 4.1c17.1 4.6 34.6-5.6 39.2-22.6l8.3-30.9 247.3 66.3-8.3 30.9c-4.6 17.1 5.6 34.6 22.6 39.2l15.5 4.1c17.1 4.6 34.6-5.6 39.2-22.6l8.3-30.9L595 388l10.4-38.6c6-22.4-2.5-45.2-19.6-58.7l-6.8-84c-2.7-33.7-26.4-62-59-70.8L384.2 99.7c-32.7-8.8-67.3 4-86.5 31.8zm-17 131a24 24 0 1 1 -12.4 46.4 24 24 0 1 1 12.4-46.4zm217.9 83.2A24 24 0 1 1 545 358.1a24 24 0 1 1 -46.4-12.4z"]
            }, JU = PW, zU = {
              prefix: "fas",
              iconName: "y",
              icon: [384, 512, [121], "59", "M58 45.4C47.8 31 27.8 27.7 13.4 38S-4.3 68.2 6 82.6L160 298.3V448c0 17.7 14.3 32 32 32s32-14.3 32-32V298.3L378 82.6c10.3-14.4 6.9-34.4-7.4-44.6S336.2 31 326 45.4L192 232.9 58 45.4z"]
            }, cW = {
              prefix: "fas",
              iconName: "person-snowboarding",
              icon: [512, 512, [127938, "snowboarding"], "f7ce", "M209.7 3.4c15.8-7.9 35-1.5 42.9 14.3l25 50 42.4 8.5c19.5 3.9 37.8 12.3 53.5 24.5l126.1 98.1c14 10.9 16.5 31 5.6 44.9s-31 16.5-44.9 5.6l-72.1-56.1-71.5 31.8 33.1 27.6c23.2 19.3 33.5 50 26.7 79.4l-17.4 75.2c-2.2 9.4-8.2 16.8-16.1 21l86.5 33.1c4.6 1.8 9.4 2.6 14.3 2.6H472c13.3 0 24 10.7 24 24s-10.7 24-24 24H443.8c-10.8 0-21.4-2-31.5-5.8L60.1 371.3c-11.5-4.4-22-11.2-30.8-20L7 329c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.4 22.4c4 4 8.7 7.1 14 9.1l22.4 8.6c-.8-1.6-1.5-3.2-2.1-4.9c-5.6-16.8 3.5-34.9 20.2-40.5L192 264.9l0-53.2c0-24.2 13.7-46.4 35.4-57.2l45.2-22.6-7.5-1.5c-19.4-3.9-35.9-16.5-44.7-34.1l-25-50c-7.9-15.8-1.5-35 14.3-42.9zM139 350.1l159 60.9c-2.1-5.6-2.6-11.9-1.1-18.2l17.4-75.2c1.4-5.9-.7-12-5.3-15.9l-52.8-44 0 18.8c0 20.7-13.2 39-32.8 45.5L139 350.1zM432 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, GU = cW, pW = {
              prefix: "fas",
              iconName: "truck-fast",
              icon: [640, 512, ["shipping-fast"], "f48b", "M112 0C85.5 0 64 21.5 64 48V96H16c-8.8 0-16 7.2-16 16s7.2 16 16 16H64 272c8.8 0 16 7.2 16 16s-7.2 16-16 16H64 48c-8.8 0-16 7.2-16 16s7.2 16 16 16H64 240c8.8 0 16 7.2 16 16s-7.2 16-16 16H64 16c-8.8 0-16 7.2-16 16s7.2 16 16 16H64 208c8.8 0 16 7.2 16 16s-7.2 16-16 16H64V416c0 53 43 96 96 96s96-43 96-96H384c0 53 43 96 96 96s96-43 96-96h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V288 256 237.3c0-17-6.7-33.3-18.7-45.3L512 114.7c-12-12-28.3-18.7-45.3-18.7H416V48c0-26.5-21.5-48-48-48H112zM544 237.3V256H416V160h50.7L544 237.3zM160 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm272 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z"]
            }, ZU = pW, _U = {
              prefix: "fas",
              iconName: "fish",
              icon: [576, 512, [128031], "f578", "M180.5 141.5C219.7 108.5 272.6 80 336 80s116.3 28.5 155.5 61.5c39.1 33 66.9 72.4 81 99.8c4.7 9.2 4.7 20.1 0 29.3c-14.1 27.4-41.9 66.8-81 99.8C452.3 403.5 399.4 432 336 432s-116.3-28.5-155.5-61.5c-16.2-13.7-30.5-28.5-42.7-43.1L48.1 379.6c-12.5 7.3-28.4 5.3-38.7-4.9S-3 348.7 4.2 336.1L50 256 4.2 175.9c-7.2-12.6-5-28.4 5.3-38.6s26.1-12.2 38.7-4.9l89.7 52.3c12.2-14.6 26.5-29.4 42.7-43.1zM448 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
            }, $U = {
              prefix: "fas",
              iconName: "user-graduate",
              icon: [448, 512, [], "f501", "M219.3 .5c3.1-.6 6.3-.6 9.4 0l200 40C439.9 42.7 448 52.6 448 64s-8.1 21.3-19.3 23.5L352 102.9V160c0 70.7-57.3 128-128 128s-128-57.3-128-128V102.9L48 93.3v65.1l15.7 78.4c.9 4.7-.3 9.6-3.3 13.3s-7.6 5.9-12.4 5.9H16c-4.8 0-9.3-2.1-12.4-5.9s-4.3-8.6-3.3-13.3L16 158.4V86.6C6.5 83.3 0 74.3 0 64C0 52.6 8.1 42.7 19.3 40.5l200-40zM111.9 327.7c10.5-3.4 21.8 .4 29.4 8.5l71 75.5c6.3 6.7 17 6.7 23.3 0l71-75.5c7.6-8.1 18.9-11.9 29.4-8.5C401 348.6 448 409.4 448 481.3c0 17-13.8 30.7-30.7 30.7H30.7C13.8 512 0 498.2 0 481.3c0-71.9 47-132.7 111.9-153.6z"]
            }, hW = {
              prefix: "fas",
              iconName: "circle-half-stroke",
              icon: [512, 512, [9680, "adjust"], "f042", "M448 256c0-106-86-192-192-192V448c106 0 192-86 192-192zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
            }, eI = hW, HW = {
              prefix: "fas",
              iconName: "clapperboard",
              icon: [512, 512, [], "e131", "M448 32H361.9l-1 1-127 127h92.1l1-1L453.8 32.3c-1.9-.2-3.8-.3-5.8-.3zm64 128V96c0-15.1-5.3-29.1-14-40l-104 104H512zM294.1 32H201.9l-1 1L73.9 160h92.1l1-1 127-127zM64 32C28.7 32 0 60.7 0 96v64H6.1l1-1 127-127H64zM512 192H0V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V192z"]
            }, tI = {
              prefix: "fas",
              iconName: "circle-radiation",
              icon: [512, 512, [9762, "radiation-alt"], "f7ba", "M256 64a192 192 0 1 1 0 384 192 192 0 1 1 0-384zm0 448A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM200 256c0-20.7 11.3-38.8 28-48.5l-36-62.3c-8.8-15.3-28.7-20.8-42-9c-25.6 22.6-43.9 53.3-50.9 88.1C95.7 241.5 110.3 256 128 256l72 0zm28 48.5l-36 62.4c-8.8 15.3-3.6 35.2 13.1 40.8c16 5.4 33.1 8.3 50.9 8.3s34.9-2.9 50.9-8.3c16.7-5.6 21.9-25.5 13.1-40.8l-36-62.4c-8.2 4.8-17.8 7.5-28 7.5s-19.8-2.7-28-7.5zM312 256l72 0c17.7 0 32.3-14.5 28.8-31.8c-7-34.8-25.3-65.5-50.9-88.1c-13.2-11.7-33.1-6.3-42 9l-36 62.3c16.7 9.7 28 27.8 28 48.5zm-56 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, kV = tI, rI = {
              prefix: "fas",
              iconName: "baseball",
              icon: [512, 512, [129358, 9918, "baseball-ball"], "f433", "M62.7 223.4c-4.8 .4-9.7 .6-14.7 .6c-15.6 0-30.8-2-45.2-5.9C19.2 107.1 107.1 19.2 218.1 2.8C222 17.2 224 32.4 224 48c0 4.9-.2 9.8-.6 14.7c-.7 8.8 5.8 16.5 14.6 17.3s16.5-5.8 17.3-14.6c.5-5.7 .7-11.5 .7-17.3c0-16.5-1.9-32.6-5.6-47.9c1.8 0 3.7-.1 5.6-.1C397.4 0 512 114.6 512 256c0 1.9 0 3.7-.1 5.6c-15.4-3.6-31.4-5.6-47.9-5.6c-5.8 0-11.6 .2-17.3 .7c-8.8 .7-15.4 8.5-14.6 17.3s8.5 15.4 17.3 14.6c4.8-.4 9.7-.6 14.7-.6c15.6 0 30.8 2 45.2 5.9C492.8 404.9 404.9 492.8 293.9 509.2C290 494.8 288 479.6 288 464c0-4.9 .2-9.8 .6-14.7c.7-8.8-5.8-16.5-14.6-17.3s-16.5 5.8-17.3 14.6c-.5 5.7-.7 11.5-.7 17.3c0 16.5 1.9 32.6 5.6 47.9c-1.8 0-3.7 .1-5.6 .1C114.6 512 0 397.4 0 256c0-1.9 0-3.7 .1-5.6C15.4 254.1 31.5 256 48 256c5.8 0 11.6-.2 17.3-.7c8.8-.7 15.4-8.5 14.6-17.3s-8.5-15.4-17.3-14.6zM121.3 208c-8 3.7-11.6 13.2-7.9 21.2s13.2 11.6 21.2 7.9c45.2-20.8 81.7-57.2 102.5-102.5c3.7-8 .2-17.5-7.9-21.2s-17.5-.2-21.2 7.9c-17.6 38.3-48.5 69.2-86.7 86.7zm277.2 74.7c-3.7-8-13.2-11.6-21.2-7.9c-45.2 20.8-81.7 57.2-102.5 102.5c-3.7 8-.2 17.5 7.9 21.2s17.5 .2 21.2-7.9c17.6-38.3 48.5-69.2 86.7-86.7c8-3.7 11.6-13.2 7.9-21.2z"]
            }, EV = rI, nI = {
              prefix: "fas",
              iconName: "jet-fighter-up",
              icon: [512, 512, [], "e518", "M270.7 9.7C268.2 3.8 262.4 0 256 0s-12.2 3.8-14.7 9.7L197.2 112.6c-3.4 8-5.2 16.5-5.2 25.2v77l-144 84V280c0-13.3-10.7-24-24-24s-24 10.7-24 24v56 32 24c0 13.3 10.7 24 24 24s24-10.7 24-24v-8H192v32.7L133.5 468c-3.5 3-5.5 7.4-5.5 12v16c0 8.8 7.2 16 16 16h96V448c0-8.8 7.2-16 16-16s16 7.2 16 16v64h96c8.8 0 16-7.2 16-16V480c0-4.6-2-9-5.5-12L320 416.7V384H464v8c0 13.3 10.7 24 24 24s24-10.7 24-24V368 336 280c0-13.3-10.7-24-24-24s-24 10.7-24 24v18.8l-144-84v-77c0-8.7-1.8-17.2-5.2-25.2L270.7 9.7z"]
            }, Cw = {
              prefix: "fas",
              iconName: "diagram-project",
              icon: [576, 512, ["project-diagram"], "f542", "M0 80C0 53.5 21.5 32 48 32h96c26.5 0 48 21.5 48 48V96H384V80c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v96c0 26.5-21.5 48-48 48H432c-26.5 0-48-21.5-48-48V160H192v16c0 1.7-.1 3.4-.3 5L272 288h96c26.5 0 48 21.5 48 48v96c0 26.5-21.5 48-48 48H272c-26.5 0-48-21.5-48-48V336c0-1.7 .1-3.4 .3-5L144 224H48c-26.5 0-48-21.5-48-48V80z"]
            }, FV = Cw, Ow = {
              prefix: "fas",
              iconName: "copy",
              icon: [448, 512, [], "f0c5", "M208 0H332.1c12.7 0 24.9 5.1 33.9 14.1l67.9 67.9c9 9 14.1 21.2 14.1 33.9V336c0 26.5-21.5 48-48 48H208c-26.5 0-48-21.5-48-48V48c0-26.5 21.5-48 48-48zM48 128h80v64H64V448H256V416h64v48c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V176c0-26.5 21.5-48 48-48z"]
            }, gW = {
              prefix: "fas",
              iconName: "volume-xmark",
              icon: [576, 512, ["volume-mute", "volume-times"], "f6a9", "M301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM425 167l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"]
            }, NV = gW, yw = gW, Cx = {
              prefix: "fas",
              iconName: "hand-sparkles",
              icon: [640, 512, [], "e05d", "M320 0c17.7 0 32 14.3 32 32V240c0 8.8 7.2 16 16 16s16-7.2 16-16V64c0-17.7 14.3-32 32-32s32 14.3 32 32V240c0 8.8 7.2 16 16 16s16-7.2 16-16V128c0-17.7 14.3-32 32-32s32 14.3 32 32V323.1c-11.9 4.8-21.3 14.9-25 27.8l-8.9 31.2L478.9 391C460.6 396.3 448 413 448 432c0 18.9 12.5 35.6 30.6 40.9C448.4 497.4 409.9 512 368 512H348.8c-59.6 0-116.9-22.9-160-64L76.4 341c-16-15.2-16.6-40.6-1.4-56.6s40.6-16.6 56.6-1.4l60.5 57.6c0-1.5-.1-3.1-.1-4.6V64c0-17.7 14.3-32 32-32s32 14.3 32 32V240c0 8.8 7.2 16 16 16s16-7.2 16-16V32c0-17.7 14.3-32 32-32zm-7.3 326.6c-1.1-3.9-4.7-6.6-8.7-6.6s-7.6 2.7-8.7 6.6L288 352l-25.4 7.3c-3.9 1.1-6.6 4.7-6.6 8.7s2.7 7.6 6.6 8.7L288 384l7.3 25.4c1.1 3.9 4.7 6.6 8.7 6.6s7.6-2.7 8.7-6.6L320 384l25.4-7.3c3.9-1.1 6.6-4.7 6.6-8.7s-2.7-7.6-6.6-8.7L320 352l-7.3-25.4zM104 120l48.3 13.8c4.6 1.3 7.7 5.5 7.7 10.2s-3.1 8.9-7.7 10.2L104 168 90.2 216.3c-1.3 4.6-5.5 7.7-10.2 7.7s-8.9-3.1-10.2-7.7L56 168 7.7 154.2C3.1 152.9 0 148.7 0 144s3.1-8.9 7.7-10.2L56 120 69.8 71.7C71.1 67.1 75.3 64 80 64s8.9 3.1 10.2 7.7L104 120zM584 408l48.3 13.8c4.6 1.3 7.7 5.5 7.7 10.2s-3.1 8.9-7.7 10.2L584 456l-13.8 48.3c-1.3 4.6-5.5 7.7-10.2 7.7s-8.9-3.1-10.2-7.7L536 456l-48.3-13.8c-4.6-1.3-7.7-5.5-7.7-10.2s3.1-8.9 7.7-10.2L536 408l13.8-48.3c1.3-4.6 5.5-7.7 10.2-7.7s8.9 3.1 10.2 7.7L584 408z"]
            }, XW = {
              prefix: "fas",
              iconName: "grip",
              icon: [448, 512, ["grip-horizontal"], "f58d", "M128 136c0-22.1-17.9-40-40-40L40 96C17.9 96 0 113.9 0 136l0 48c0 22.1 17.9 40 40 40H88c22.1 0 40-17.9 40-40l0-48zm0 192c0-22.1-17.9-40-40-40H40c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40H88c22.1 0 40-17.9 40-40V328zm32-192v48c0 22.1 17.9 40 40 40h48c22.1 0 40-17.9 40-40V136c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM288 328c0-22.1-17.9-40-40-40H200c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40h48c22.1 0 40-17.9 40-40V328zm32-192v48c0 22.1 17.9 40 40 40h48c22.1 0 40-17.9 40-40V136c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM448 328c0-22.1-17.9-40-40-40H360c-22.1 0-40 17.9-40 40v48c0 22.1 17.9 40 40 40h48c22.1 0 40-17.9 40-40V328z"]
            }, QV = XW, TW = {
              prefix: "fas",
              iconName: "share-from-square",
              icon: [576, 512, [61509, "share-square"], "f14d", "M352 224H305.5c-45 0-81.5 36.5-81.5 81.5c0 22.3 10.3 34.3 19.2 40.5c6.8 4.7 12.8 12 12.8 20.3c0 9.8-8 17.8-17.8 17.8h-2.5c-2.4 0-4.8-.4-7.1-1.4C210.8 374.8 128 333.4 128 240c0-79.5 64.5-144 144-144h80V34.7C352 15.5 367.5 0 386.7 0c8.6 0 16.8 3.2 23.2 8.9L548.1 133.3c7.6 6.8 11.9 16.5 11.9 26.7s-4.3 19.9-11.9 26.7l-139 125.1c-5.9 5.3-13.5 8.2-21.4 8.2H384c-17.7 0-32-14.3-32-32V224zM80 96c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16H400c8.8 0 16-7.2 16-16V384c0-17.7 14.3-32 32-32s32 14.3 32 32v48c0 44.2-35.8 80-80 80H80c-44.2 0-80-35.8-80-80V112C0 67.8 35.8 32 80 32h48c17.7 0 32 14.3 32 32s-14.3 32-32 32H80z"]
            }, qW = TW, bW = {
              prefix: "fas",
              iconName: "child-combatant",
              icon: [576, 512, ["child-rifle"], "e4e0", "M176 128A64 64 0 1 0 176 0a64 64 0 1 0 0 128zm-8 352V352h16V480c0 17.7 14.3 32 32 32s32-14.3 32-32V300.5L260.9 321c9.4 15 29.2 19.4 44.1 10s19.4-29.2 10-44.1l-51.7-82.1c-17.6-27.9-48.3-44.9-81.2-44.9H169.8c-33 0-63.7 16.9-81.2 44.9L36.9 287c-9.4 15-4.9 34.7 10 44.1s34.7 4.9 44.1-10L104 300.5V480c0 17.7 14.3 32 32 32s32-14.3 32-32zM448 0H432 416c-8.8 0-16 7.2-16 16s7.2 16 16 16V132.3c-9.6 5.5-16 15.9-16 27.7v32c-17.7 0-32 14.3-32 32V368c0 17.7 14.3 32 32 32h16v96c0 8.8 7.2 16 16 16h59.5c10.4 0 18-9.8 15.5-19.9L484 400h44c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H480V325.3l53.1-17.7c6.5-2.2 10.9-8.3 10.9-15.2V208c0-8.8-7.2-16-16-16H512c-8.8 0-16 7.2-16 16v56l-16 5.3V160c0-11.8-6.4-22.2-16-27.7V16c0-8.8-7.2-16-16-16z"]
            }, YV = bW, MV = {
              prefix: "fas",
              iconName: "gun",
              icon: [576, 512, [], "e19b", "M528 56c0-13.3-10.7-24-24-24s-24 10.7-24 24v8H32C14.3 64 0 78.3 0 96V208c0 17.7 14.3 32 32 32H42c20.8 0 36.1 19.6 31 39.8L33 440.2c-2.4 9.6-.2 19.7 5.8 27.5S54.1 480 64 480h96c14.7 0 27.5-10 31-24.2L217 352H321.4c23.7 0 44.8-14.9 52.7-37.2L400.9 240H432c8.5 0 16.6-3.4 22.6-9.4L477.3 208H544c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32H528V56zM321.4 304H229l16-64h105l-21 58.7c-1.1 3.2-4.2 5.3-7.5 5.3zM80 128H464c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, Ox = {
              prefix: "fas",
              iconName: "square-phone",
              icon: [448, 512, ["phone-square"], "f098", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm90.7 96.7c9.7-2.6 19.9 2.3 23.7 11.6l20 48c3.4 8.2 1 17.6-5.8 23.2L168 231.7c16.6 35.2 45.1 63.7 80.3 80.3l20.2-24.7c5.6-6.8 15-9.2 23.2-5.8l48 20c9.3 3.9 14.2 14 11.6 23.7l-12 44C336.9 378 329 384 320 384C196.3 384 96 283.7 96 160c0-9 6-16.9 14.7-19.3l44-12z"]
            }, LV = Ox, iI = {
              prefix: "fas",
              iconName: "plus",
              icon: [448, 512, [10133, 61543, "add"], "2b", "M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"]
            }, KV = iI, JV = {
              prefix: "fas",
              iconName: "expand",
              icon: [448, 512, [], "f065", "M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V352zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H320zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V352z"]
            }, zV = {
              prefix: "fas",
              iconName: "computer",
              icon: [640, 512, [], "e4e5", "M384 96V320H64L64 96H384zM64 32C28.7 32 0 60.7 0 96V320c0 35.3 28.7 64 64 64H181.3l-10.7 32H96c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H277.3l-10.7-32H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm464 0c-26.5 0-48 21.5-48 48V432c0 26.5 21.5 48 48 48h64c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48H528zm16 64h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H544c-8.8 0-16-7.2-16-16s7.2-16 16-16zm-16 80c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H544c-8.8 0-16-7.2-16-16zm32 160a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, yx = {
              prefix: "fas",
              iconName: "xmark",
              icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]
            }, GV = yx, xW = yx, ZV = yx, _V = yx, sI = {
              prefix: "fas",
              iconName: "arrows-up-down-left-right",
              icon: [512, 512, ["arrows"], "f047", "M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z"]
            }, $V = sI, DW = {
              prefix: "fas",
              iconName: "chalkboard-user",
              icon: [640, 512, ["chalkboard-teacher"], "f51c", "M160 64c0-35.3 28.7-64 64-64H576c35.3 0 64 28.7 64 64V352c0 35.3-28.7 64-64 64H336.8c-11.8-25.5-29.9-47.5-52.4-64H384V320c0-17.7 14.3-32 32-32h64c17.7 0 32 14.3 32 32v32h64V64L224 64v49.1C205.2 102.2 183.3 96 160 96V64zm0 64a96 96 0 1 1 0 192 96 96 0 1 1 0-192zM133.3 352h53.3C260.3 352 320 411.7 320 485.3c0 14.7-11.9 26.7-26.7 26.7H26.7C11.9 512 0 500.1 0 485.3C0 411.7 59.7 352 133.3 352z"]
            }, h = DW, X = {
              prefix: "fas",
              iconName: "peso-sign",
              icon: [384, 512, [], "e222", "M64 32C46.3 32 32 46.3 32 64v64c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V384h80c68.4 0 127.7-39 156.8-96H352c17.7 0 32-14.3 32-32s-14.3-32-32-32h-.7c.5-5.3 .7-10.6 .7-16s-.2-10.7-.7-16h.7c17.7 0 32-14.3 32-32s-14.3-32-32-32H332.8C303.7 71 244.4 32 176 32H64zm190.4 96H96V96h80c30.5 0 58.2 12.2 78.4 32zM96 192H286.9c.7 5.2 1.1 10.6 1.1 16s-.4 10.8-1.1 16H96V192zm158.4 96c-20.2 19.8-47.9 32-78.4 32H96V288H254.4z"]
            }, W = {
              prefix: "fas",
              iconName: "building-shield",
              icon: [576, 512, [], "e4d8", "M0 48C0 21.5 21.5 0 48 0H336c26.5 0 48 21.5 48 48V207l-42.4 17H304 272c-8.8 0-16 7.2-16 16v32 24.2V304c0 .9 .1 1.7 .2 2.6c2.3 58.1 24.1 144.8 98.7 201.5c-5.8 2.5-12.2 3.9-18.9 3.9H240V432c0-26.5-21.5-48-48-48s-48 21.5-48 48v80H48c-26.5 0-48-21.5-48-48V48zM80 224c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H80zm80 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H176c-8.8 0-16 7.2-16 16zM64 112v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zM176 96c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H176zm80 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H272c-8.8 0-16 7.2-16 16zM423.1 225.7c5.7-2.3 12.1-2.3 17.8 0l120 48C570 277.4 576 286.2 576 296c0 63.3-25.9 168.8-134.8 214.2c-5.9 2.5-12.6 2.5-18.5 0C313.9 464.8 288 359.3 288 296c0-9.8 6-18.6 15.1-22.3l120-48zM527.4 312L432 273.8V461.7c68.2-33 91.5-99 95.4-149.7z"]
            }, V = {
              prefix: "fas",
              iconName: "baby",
              icon: [448, 512, [], "f77c", "M152 88a72 72 0 1 1 144 0A72 72 0 1 1 152 88zM39.7 144.5c13-17.9 38-21.8 55.9-8.8L131.8 162c26.8 19.5 59.1 30 92.2 30s65.4-10.5 92.2-30l36.2-26.4c17.9-13 42.9-9 55.9 8.8s9 42.9-8.8 55.9l-36.2 26.4c-13.6 9.9-28.1 18.2-43.3 25V288H128V251.7c-15.2-6.7-29.7-15.1-43.3-25L48.5 200.3c-17.9-13-21.8-38-8.8-55.9zm89.8 184.8l60.6 53-26 37.2 24.3 24.3c15.6 15.6 15.6 40.9 0 56.6s-40.9 15.6-56.6 0l-48-48C70 438.6 68.1 417 79.2 401.1l50.2-71.8zm128.5 53l60.6-53 50.2 71.8c11.1 15.9 9.2 37.5-4.5 51.2l-48 48c-15.6 15.6-40.9 15.6-56.6 0s-15.6-40.9 0-56.6L284 419.4l-26-37.2z"]
            }, Q = {
              prefix: "fas",
              iconName: "users-line",
              icon: [640, 512, [], "e592", "M211.2 96a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM32 256c0 17.7 14.3 32 32 32h85.6c10.1-39.4 38.6-71.5 75.8-86.6c-9.7-6-21.2-9.4-33.4-9.4H96c-35.3 0-64 28.7-64 64zm461.6 32H576c17.7 0 32-14.3 32-32c0-35.3-28.7-64-64-64H448c-11.7 0-22.7 3.1-32.1 8.6c38.1 14.8 67.4 47.3 77.7 87.4zM391.2 226.4c-6.9-1.6-14.2-2.4-21.6-2.4h-96c-8.5 0-16.7 1.1-24.5 3.1c-30.8 8.1-55.6 31.1-66.1 60.9c-3.5 10-5.5 20.8-5.5 32c0 17.7 14.3 32 32 32h224c17.7 0 32-14.3 32-32c0-11.2-1.9-22-5.5-32c-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM321.6 192a80 80 0 1 0 0-160 80 80 0 1 0 0 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"]
            }, ie = {
              prefix: "fas",
              iconName: "quote-left",
              icon: [448, 512, [8220, "quote-left-alt"], "f10d", "M0 216C0 149.7 53.7 96 120 96h8c17.7 0 32 14.3 32 32s-14.3 32-32 32h-8c-30.9 0-56 25.1-56 56v8h64c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V320 288 216zm256 0c0-66.3 53.7-120 120-120h8c17.7 0 32 14.3 32 32s-14.3 32-32 32h-8c-30.9 0-56 25.1-56 56v8h64c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64H320c-35.3 0-64-28.7-64-64V320 288 216z"]
            }, le = ie, He = {
              prefix: "fas",
              iconName: "tractor",
              icon: [640, 512, [128668], "f722", "M96 64c0-35.3 28.7-64 64-64H266.3c26.2 0 49.7 15.9 59.4 40.2L373.7 160H480V126.2c0-24.8 5.8-49.3 16.9-71.6l2.5-5c7.9-15.8 27.1-22.2 42.9-14.3s22.2 27.1 14.3 42.9l-2.5 5c-6.7 13.3-10.1 28-10.1 42.9V160h56c22.1 0 40 17.9 40 40v45.4c0 16.5-8.5 31.9-22.6 40.7l-43.3 27.1c-14.2-5.9-29.8-9.2-46.1-9.2c-39.3 0-74.1 18.9-96 48H352c0 17.7-14.3 32-32 32h-8.2c-1.7 4.8-3.7 9.5-5.8 14.1l5.8 5.8c12.5 12.5 12.5 32.8 0 45.3l-22.6 22.6c-12.5 12.5-32.8 12.5-45.3 0l-5.8-5.8c-4.6 2.2-9.3 4.1-14.1 5.8V480c0 17.7-14.3 32-32 32H160c-17.7 0-32-14.3-32-32v-8.2c-4.8-1.7-9.5-3.7-14.1-5.8l-5.8 5.8c-12.5 12.5-32.8 12.5-45.3 0L40.2 449.1c-12.5-12.5-12.5-32.8 0-45.3l5.8-5.8c-2.2-4.6-4.1-9.3-5.8-14.1H32c-17.7 0-32-14.3-32-32V320c0-17.7 14.3-32 32-32h8.2c1.7-4.8 3.7-9.5 5.8-14.1l-5.8-5.8c-12.5-12.5-12.5-32.8 0-45.3l22.6-22.6c9-9 21.9-11.5 33.1-7.6V192 160 64zm170.3 0H160v96h32H304.7L266.3 64zM176 256a80 80 0 1 0 0 160 80 80 0 1 0 0-160zM528 448a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0 64c-48.6 0-88-39.4-88-88c0-29.8 14.8-56.1 37.4-72c14.3-10.1 31.8-16 50.6-16c2.7 0 5.3 .1 7.9 .3c44.9 4 80.1 41.7 80.1 87.7c0 48.6-39.4 88-88 88z"]
            }, xe = {
              prefix: "fas",
              iconName: "trash-arrow-up",
              icon: [448, 512, ["trash-restore"], "f829", "M163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3C140.6 6.8 151.7 0 163.8 0zM32 128H416L394.8 467c-1.6 25.3-22.6 45-47.9 45H101.1c-25.3 0-46.3-19.7-47.9-45L32 128zm192 64c-6.4 0-12.5 2.5-17 7l-80 80c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39V408c0 13.3 10.7 24 24 24s24-10.7 24-24V273.9l39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-4.5-4.5-10.6-7-17-7z"]
            }, Je = xe, _e = {
              prefix: "fas",
              iconName: "arrow-down-up-lock",
              icon: [640, 512, [], "e4b0", "M150.6 502.6l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 402.7V288H416V272c0-17.2 3.9-33.5 10.8-48H352V109.3l41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-6-6-14.1-9.4-22.6-9.4s-16.6 3.4-22.6 9.4l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L288 109.3V224l-128 0H96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32H96V402.7L54.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0zM160 192V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V192h64zM288 320V448c0 17.7 14.3 32 32 32s32-14.3 32-32V320H288zm240-80c17.7 0 32 14.3 32 32v48H496V272c0-17.7 14.3-32 32-32zm-80 32v48c-17.7 0-32 14.3-32 32V480c0 17.7 14.3 32 32 32H608c17.7 0 32-14.3 32-32V352c0-17.7-14.3-32-32-32V272c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
            }, qt = {
              prefix: "fas",
              iconName: "lines-leaning",
              icon: [384, 512, [], "e51e", "M190.4 74.1c5.6-16.8-3.5-34.9-20.2-40.5s-34.9 3.5-40.5 20.2l-128 384c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l128-384zm70.9-41.7c-17.4-2.9-33.9 8.9-36.8 26.3l-64 384c-2.9 17.4 8.9 33.9 26.3 36.8s33.9-8.9 36.8-26.3l64-384c2.9-17.4-8.9-33.9-26.3-36.8zM352 32c-17.7 0-32 14.3-32 32V448c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32z"]
            }, Ht = {
              prefix: "fas",
              iconName: "ruler-combined",
              icon: [512, 512, [], "f546", "M.2 468.9C2.7 493.1 23.1 512 48 512l96 0 320 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-48 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-64-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-64-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-48c0-26.5-21.5-48-48-48L48 0C21.5 0 0 21.5 0 48L0 368l0 96c0 1.7 .1 3.3 .2 4.9z"]
            }, Mt = {
              prefix: "fas",
              iconName: "copyright",
              icon: [512, 512, [169], "f1f9", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM199.4 312.6c31.2 31.2 81.9 31.2 113.1 0c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-50 50-131 50-181 0s-50-131 0-181s131-50 181 0c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-31.2-31.2-81.9-31.2-113.1 0s-31.2 81.9 0 113.1z"]
            }, Lt = {
              prefix: "fas",
              iconName: "equals",
              icon: [448, 512, [62764], "3d", "M48 128c-17.7 0-32 14.3-32 32s14.3 32 32 32H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H48zm0 192c-17.7 0-32 14.3-32 32s14.3 32 32 32H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H48z"]
            }, or = {
              prefix: "fas",
              iconName: "blender",
              icon: [512, 512, [], "f517", "M0 64C0 28.7 28.7 0 64 0h64 32H470.1c21.1 0 36.4 20.1 30.9 40.4L494.5 64H336c-8.8 0-16 7.2-16 16s7.2 16 16 16H485.8l-17.5 64H336c-8.8 0-16 7.2-16 16s7.2 16 16 16H459.6l-17.5 64H336c-8.8 0-16 7.2-16 16s7.2 16 16 16h97.5L416 352H160l-8.7-96H64c-35.3 0-64-28.7-64-64V64zM145.5 192L133.8 64H64V192h81.5zM144 384H432c26.5 0 48 21.5 48 48v32c0 26.5-21.5 48-48 48H144c-26.5 0-48-21.5-48-48V432c0-26.5 21.5-48 48-48zm144 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, yn = {
              prefix: "fas",
              iconName: "teeth",
              icon: [576, 512, [], "f62e", "M0 128C0 75 43 32 96 32H480c53 0 96 43 96 96V384c0 53-43 96-96 96H96c-53 0-96-43-96-96V128zm176 48v56c0 13.3 10.7 24 24 24h48c13.3 0 24-10.7 24-24V176c0-26.5-21.5-48-48-48s-48 21.5-48 48zm176-48c-26.5 0-48 21.5-48 48v56c0 13.3 10.7 24 24 24h48c13.3 0 24-10.7 24-24V176c0-26.5-21.5-48-48-48zM48 208v24c0 13.3 10.7 24 24 24h48c13.3 0 24-10.7 24-24V208c0-26.5-21.5-48-48-48s-48 21.5-48 48zM96 384c26.5 0 48-21.5 48-48V312c0-13.3-10.7-24-24-24H72c-13.3 0-24 10.7-24 24v24c0 26.5 21.5 48 48 48zm80-48c0 26.5 21.5 48 48 48s48-21.5 48-48V312c0-13.3-10.7-24-24-24H200c-13.3 0-24 10.7-24 24v24zm176 48c26.5 0 48-21.5 48-48V312c0-13.3-10.7-24-24-24H328c-13.3 0-24 10.7-24 24v24c0 26.5 21.5 48 48 48zm80-176v24c0 13.3 10.7 24 24 24h48c13.3 0 24-10.7 24-24V208c0-26.5-21.5-48-48-48s-48 21.5-48 48zm48 176c26.5 0 48-21.5 48-48V312c0-13.3-10.7-24-24-24H456c-13.3 0-24 10.7-24 24v24c0 26.5 21.5 48 48 48z"]
            }, hi = {
              prefix: "fas",
              iconName: "shekel-sign",
              icon: [448, 512, [8362, "ils", "shekel", "sheqel", "sheqel-sign"], "f20b", "M32 32C14.3 32 0 46.3 0 64V448c0 17.7 14.3 32 32 32s32-14.3 32-32V96H192c35.3 0 64 28.7 64 64V320c0 17.7 14.3 32 32 32s32-14.3 32-32V160c0-70.7-57.3-128-128-128H32zM320 480c70.7 0 128-57.3 128-128V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V352c0 35.3-28.7 64-64 64H192V192c0-17.7-14.3-32-32-32s-32 14.3-32 32V448c0 17.7 14.3 32 32 32H320z"]
            }, Pi = hi, Ks = hi, Is = hi, Vt = hi, fr = {
              prefix: "fas",
              iconName: "map",
              icon: [576, 512, [128506, 62072], "f279", "M384 476.1L192 421.2V35.9L384 90.8V476.1zm32-1.2V88.4L543.1 37.5c15.8-6.3 32.9 5.3 32.9 22.3V394.6c0 9.8-6 18.6-15.1 22.3L416 474.8zM15.1 95.1L160 37.2V423.6L32.9 474.5C17.1 480.8 0 469.2 0 452.2V117.4c0-9.8 6-18.6 15.1-22.3z"]
            }, Ct = {
              prefix: "fas",
              iconName: "rocket",
              icon: [512, 512, [], "f135", "M156.6 384.9L125.7 354c-8.5-8.5-11.5-20.8-7.7-32.2c3-8.9 7-20.5 11.8-33.8L24 288c-8.6 0-16.6-4.6-20.9-12.1s-4.2-16.7 .2-24.1l52.5-88.5c13-21.9 36.5-35.3 61.9-35.3l82.3 0c2.4-4 4.8-7.7 7.2-11.3C289.1-4.1 411.1-8.1 483.9 5.3c11.6 2.1 20.6 11.2 22.8 22.8c13.4 72.9 9.3 194.8-111.4 276.7c-3.5 2.4-7.3 4.8-11.3 7.2v82.3c0 25.4-13.4 49-35.3 61.9l-88.5 52.5c-7.4 4.4-16.6 4.5-24.1 .2s-12.1-12.2-12.1-20.9V380.8c-14.1 4.9-26.4 8.9-35.7 11.9c-11.2 3.6-23.4 .5-31.8-7.8zM384 168a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
            }, Nr = {
              prefix: "fas",
              iconName: "photo-film",
              icon: [640, 512, ["photo-video"], "f87c", "M256 0H576c35.3 0 64 28.7 64 64V288c0 35.3-28.7 64-64 64H256c-35.3 0-64-28.7-64-64V64c0-35.3 28.7-64 64-64zM476 106.7C471.5 100 464 96 456 96s-15.5 4-20 10.7l-56 84L362.7 169c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6h80 48H552c8.9 0 17-4.9 21.2-12.7s3.7-17.3-1.2-24.6l-96-144zM336 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM64 128h96V384v32c0 17.7 14.3 32 32 32H320c17.7 0 32-14.3 32-32V384H512v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V192c0-35.3 28.7-64 64-64zm8 64c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16H88c8.8 0 16-7.2 16-16V208c0-8.8-7.2-16-16-16H72zm0 104c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16H88c8.8 0 16-7.2 16-16V312c0-8.8-7.2-16-16-16H72zm0 104c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16H88c8.8 0 16-7.2 16-16V416c0-8.8-7.2-16-16-16H72zm336 16v16c0 8.8 7.2 16 16 16h16c8.8 0 16-7.2 16-16V416c0-8.8-7.2-16-16-16H424c-8.8 0-16 7.2-16 16z"]
            }, kn = Nr, mn = {
              prefix: "fas",
              iconName: "folder-minus",
              icon: [512, 512, [], "f65d", "M448 480H64c-35.3 0-64-28.7-64-64V96C0 60.7 28.7 32 64 32H192c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64zM184 272c-13.3 0-24 10.7-24 24s10.7 24 24 24H328c13.3 0 24-10.7 24-24s-10.7-24-24-24H184z"]
            }, Ei = {
              prefix: "fas",
              iconName: "store",
              icon: [576, 512, [], "f54e", "M547.6 103.8L490.3 13.1C485.2 5 476.1 0 466.4 0H109.6C99.9 0 90.8 5 85.7 13.1L28.3 103.8c-29.6 46.8-3.4 111.9 51.9 119.4c4 .5 8.1 .8 12.1 .8c26.1 0 49.3-11.4 65.2-29c15.9 17.6 39.1 29 65.2 29c26.1 0 49.3-11.4 65.2-29c15.9 17.6 39.1 29 65.2 29c26.2 0 49.3-11.4 65.2-29c16 17.6 39.1 29 65.2 29c4.1 0 8.1-.3 12.1-.8c55.5-7.4 81.8-72.5 52.1-119.4zM499.7 254.9l-.1 0c-5.3 .7-10.7 1.1-16.2 1.1c-12.4 0-24.3-1.9-35.4-5.3V384H128V250.6c-11.2 3.5-23.2 5.4-35.6 5.4c-5.5 0-11-.4-16.3-1.1l-.1 0c-4.1-.6-8.1-1.3-12-2.3V384v64c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V384 252.6c-4 1-8 1.8-12.3 2.3z"]
            }, rs = {
              prefix: "fas",
              iconName: "arrow-trend-up",
              icon: [576, 512, [], "e098", "M384 160c-17.7 0-32-14.3-32-32s14.3-32 32-32H544c17.7 0 32 14.3 32 32V288c0 17.7-14.3 32-32 32s-32-14.3-32-32V205.3L342.6 374.6c-12.5 12.5-32.8 12.5-45.3 0L192 269.3 54.6 406.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160c12.5-12.5 32.8-12.5 45.3 0L320 306.7 466.7 160H384z"]
            }, ro = {
              prefix: "fas",
              iconName: "plug-circle-minus",
              icon: [576, 512, [], "e55e", "M96 0C78.3 0 64 14.3 64 32v96h64V32c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32v96h64V32c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32v32c0 77.4 55 142 128 156.8V480c0 17.7 14.3 32 32 32s32-14.3 32-32V412.8c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32H32zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-64 0c0 8.8-7.2 16-16 16H368c-8.8 0-16-7.2-16-16s7.2-16 16-16H496c8.8 0 16 7.2 16 16z"]
            }, oa = {
              prefix: "fas",
              iconName: "sign-hanging",
              icon: [512, 512, ["sign"], "f4d9", "M96 0c17.7 0 32 14.3 32 32V64l352 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-352 0V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V128H32C14.3 128 0 113.7 0 96S14.3 64 32 64H64V32C64 14.3 78.3 0 96 0zm96 160H448c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32z"]
            }, a9 = oa, ha = {
              prefix: "fas",
              iconName: "bezier-curve",
              icon: [640, 512, [], "f55b", "M296 136V88h48v48H296zM288 32c-26.5 0-48 21.5-48 48v4H121.6C111.2 62.7 89.3 48 64 48C28.7 48 0 76.7 0 112s28.7 64 64 64c25.3 0 47.2-14.7 57.6-36h66.9c-58.9 39.6-98.9 105-104 180H80c-26.5 0-48 21.5-48 48v64c0 26.5 21.5 48 48 48h64c26.5 0 48-21.5 48-48V368c0-26.5-21.5-48-48-48h-3.3c5.9-67 48.5-123.4 107.5-149.1c8.6 12.7 23.2 21.1 39.8 21.1h64c16.6 0 31.1-8.4 39.8-21.1c59 25.7 101.6 82.1 107.5 149.1H496c-26.5 0-48 21.5-48 48v64c0 26.5 21.5 48 48 48h64c26.5 0 48-21.5 48-48V368c0-26.5-21.5-48-48-48h-4.5c-5-75-45.1-140.4-104-180h66.9c10.4 21.3 32.3 36 57.6 36c35.3 0 64-28.7 64-64s-28.7-64-64-64c-25.3 0-47.2 14.7-57.6 36H400V80c0-26.5-21.5-48-48-48H288zM88 376h48v48H88V376zm416 48V376h48v48H504z"]
            }, Of = {
              prefix: "fas",
              iconName: "bell-slash",
              icon: [640, 512, [128277, 61943], "f1f6", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-87.5-68.6c.5-1.7 .7-3.5 .7-5.4c0-27.6-11-54.1-30.5-73.7L512 320c-20.5-20.5-32-48.3-32-77.3V208c0-77.4-55-142-128-156.8V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V51.2c-42.6 8.6-79 34.2-102 69.3L38.8 5.1zM160 242.7c0 29-11.5 56.8-32 77.3l-1.5 1.5C107 341 96 367.5 96 395.2c0 11.5 9.3 20.8 20.8 20.8H406.2L160 222.1v20.7zM384 448H320 256c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7s18.7-28.3 18.7-45.3z"]
            }, bA = {
              prefix: "fas",
              iconName: "tablet",
              icon: [448, 512, ["tablet-android"], "f3fb", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM176 432h96c8.8 0 16 7.2 16 16s-7.2 16-16 16H176c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, xA = bA, Wu = {
              prefix: "fas",
              iconName: "school-flag",
              icon: [576, 512, [], "e56e", "M288 0H400c8.8 0 16 7.2 16 16V80c0 8.8-7.2 16-16 16H320.7l89.6 64H512c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H336V400c0-26.5-21.5-48-48-48s-48 21.5-48 48V512H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64H165.7L256 95.5V32c0-17.7 14.3-32 32-32zm48 240a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM80 224c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H80zm368 16v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16H464c-8.8 0-16 7.2-16 16zM80 352c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H80zm384 0c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H464z"]
            }, kd = {
              prefix: "fas",
              iconName: "fill",
              icon: [512, 512, [], "f575", "M86.6 9.4C74.1-3.1 53.9-3.1 41.4 9.4s-12.5 32.8 0 45.3L122.7 136 30.6 228.1c-37.5 37.5-37.5 98.3 0 135.8L148.1 481.4c37.5 37.5 98.3 37.5 135.8 0L474.3 290.9c28.1-28.1 28.1-73.7 0-101.8L322.9 37.7c-28.1-28.1-73.7-28.1-101.8 0L168 90.7 86.6 9.4zM168 181.3l49.4 49.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L213.3 136l53.1-53.1c3.1-3.1 8.2-3.1 11.3 0L429.1 234.3c3.1 3.1 3.1 8.2 0 11.3L386.7 288H67.5c1.4-5.4 4.2-10.4 8.4-14.6L168 181.3z"]
            }, Ed = {
              prefix: "fas",
              iconName: "angle-up",
              icon: [448, 512, [8963], "f106", "M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z"]
            }, sd = {
              prefix: "fas",
              iconName: "drumstick-bite",
              icon: [512, 512, [], "f6d7", "M160 265.2c0 8.5-3.4 16.6-9.4 22.6l-26.8 26.8c-12.3 12.3-32.5 11.4-49.4 7.2C69.8 320.6 65 320 60 320c-33.1 0-60 26.9-60 60s26.9 60 60 60c6.3 0 12 5.7 12 12c0 33.1 26.9 60 60 60s60-26.9 60-60c0-5-.6-9.8-1.8-14.5c-4.2-16.9-5.2-37.1 7.2-49.4l26.8-26.8c6-6 14.1-9.4 22.6-9.4H336c6.3 0 12.4-.3 18.5-1c11.9-1.2 16.4-15.5 10.8-26c-8.5-15.8-13.3-33.8-13.3-53c0-61.9 50.1-112 112-112c8 0 15.7 .8 23.2 2.4c11.7 2.5 24.1-5.9 22-17.6C494.5 62.5 422.5 0 336 0C238.8 0 160 78.8 160 176v89.2z"]
            }, c0 = {
              prefix: "fas",
              iconName: "holly-berry",
              icon: [512, 512, [], "f7aa", "M256 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-80 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM276.8 383.8c1 .1 2.1 .2 3.2 .2c39.8 0 72 32.2 72 72v22.7c0 16.4 16 27.9 31.6 22.8l12.8-4.3c18-6 37.3-6.5 55.6-1.5l19.4 5.3c17.9 4.9 34.4-11.6 29.5-29.5L495.6 452c-5-18.3-4.4-37.6 1.5-55.6l4.3-12.8c5.2-15.5-6.4-31.6-22.8-31.6c-34.6 0-62.7-28.1-62.7-62.7v-32c0-16.4-16-27.9-31.6-22.8l-12.8 4.3c-18 6-37.3 6.5-55.6 1.5l-29.6-8.1c-2.9-.8-5.9-1-8.7-.7c4.2 9.7 5.8 20.8 3.7 32.3L275 298.7c-1.5 8.4-1.4 17 .5 25.3l5.3 23.9c2.8 12.7 1.1 25.2-4 35.9zM127.6 234.5c-15.5-5.2-31.6 6.4-31.6 22.8v32C96 323.9 67.9 352 33.3 352c-16.4 0-27.9 16-22.8 31.6l4.3 12.8c6 18 6.5 37.3 1.5 55.6l-5.3 19.4C6.2 489.4 22.6 505.8 40.5 501L60 495.6c18.3-5 37.6-4.5 55.6 1.5l12.8 4.3c15.5 5.2 31.6-6.4 31.6-22.8v-32c0-34.6 28.1-62.7 62.7-62.7c16.4 0 27.9-16 22.8-31.6l-4.3-12.8c-6-18-6.5-37.3-1.5-55.6l5.3-19.4c4.9-17.9-11.6-34.4-29.5-29.5L196 240.4c-18.3 5-37.6 4.4-55.6-1.5l-12.8-4.3zM384 144a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
            }, E8 = {
              prefix: "fas",
              iconName: "chevron-left",
              icon: [320, 512, [9001], "f053", "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]
            }, kx = {
              prefix: "fas",
              iconName: "bacteria",
              icon: [640, 512, [], "e059", "M304.9 .7c-9.6-2.7-19.5 2.8-22.3 12.4l-4.3 15.2c-8.3-.6-16.8 0-25.2 1.9c-7.3 1.7-14.3 3.5-21.1 5.5l-5.5-12.7c-3.9-9.1-14.5-13.4-23.6-9.5s-13.4 14.5-9.5 23.6l4.4 10.4c-16.6 6.7-31.7 14.4-45.4 22.8L147 62c-5.5-8.3-16.7-10.5-25-5s-10.5 16.7-5 25l6 9c-13.7 11-25.5 22.8-35.8 34.9l-10-8c-7.8-6.2-19.1-5-25.3 2.8s-5 19.1 2.8 25.3L65.9 155c-1.8 2.8-3.5 5.7-5.1 8.5c-6.6 11.4-11.8 22.6-16 33l-8-3.2c-9.2-3.7-19.7 .8-23.4 10s.8 19.7 10 23.4l10.4 4.2c-.2 .8-.4 1.5-.5 2.3c-2.2 9.3-3.4 17.3-4.1 23.4c-.4 3.1-.6 5.7-.8 7.8c-.1 1.1-.1 2-.2 2.8l-.1 1.1 0 .5 0 .2 0 .1c0 0 0 .1 29.1 1l-.1 0L28 269.3c-.1 3.1 0 6.1 .2 9.1l-15.2 4.3C3.5 285.4-2 295.4 .7 304.9s12.7 15.1 22.3 12.4l15.6-4.5c7.6 13.6 18.9 25 32.6 32.6L66.7 361c-2.7 9.6 2.8 19.5 12.4 22.3s19.5-2.8 22.3-12.4l4.3-15.2c1.2 .1 2.4 .2 3.6 .2c15.6 .5 30.3-3.3 43-10.2l9 9c7 7 18.4 7 25.5 0s7-18.4 0-25.5l-7.2-7.2c9.3-12.6 15.2-27.8 16.3-44.5l7.1 3c9.1 3.9 19.7-.3 23.6-9.5s-.3-19.7-9.5-23.6l-8.6-3.7c6.4-9.9 17.3-22.4 36.9-33.3l1.3 4.4c2.7 9.6 12.7 15.1 22.3 12.4s15.1-12.7 12.4-22.3l-2.3-8.1c3.8-1.1 7.7-2.1 11.9-3.1c11.6-2.7 22.1-7.7 31.1-14.4l7.2 7.2c7 7 18.4 7 25.5 0s7-18.4 0-25.5l-9-9c7.6-13.9 11.3-30.1 10.1-46.6l15.2-4.3c9.6-2.7 15.1-12.7 12.4-22.3S370.6 64 361 66.7l-15.6 4.5c-7.7-13.9-19.1-25.1-32.6-32.6l4.5-15.6c2.7-9.6-2.8-19.5-12.4-22.3zM112 272l-48-1.5 0 0c11.7 .4 27.3 .9 48 1.6zm16-80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64-48a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM322.7 489c-2.7 9.6 2.8 19.5 12.4 22.3s19.5-2.8 22.2-12.4l4.3-15.2c8.3 .6 16.8 0 25.2-1.9c7.3-1.7 14.3-3.5 21.1-5.5l5.5 12.7c3.9 9.1 14.5 13.4 23.6 9.5s13.4-14.5 9.5-23.6l-4.4-10.4c16.6-6.7 31.7-14.4 45.4-22.8L493 450c5.5 8.3 16.7 10.5 25 5s10.5-16.7 5-25l-6-9c13.7-11 25.5-22.8 35.8-34.9l10 8c7.8 6.2 19.1 5 25.3-2.8s5-19.1-2.8-25.3L574.1 357c1.8-2.8 3.5-5.7 5.1-8.5c6.6-11.4 11.8-22.6 16-33l8 3.2c9.2 3.7 19.7-.8 23.4-10s-.8-19.7-10-23.4l-10.4-4.2c.2-.8 .4-1.5 .5-2.3c2.2-9.3 3.4-17.3 4.1-23.4c.4-3.1 .6-5.7 .8-7.8c.1-1.1 .1-2 .2-2.8l.1-1.1 0-.5 0-.2 0-.1c0 0 0-.1-29.1-1l.1 0 29.1 .9c.1-3.1 0-6.1-.2-9.1l15.2-4.3c9.6-2.7 15.1-12.7 12.4-22.3s-12.7-15.1-22.3-12.4l-15.6 4.5c-7.6-13.6-18.9-25-32.6-32.6l4.5-15.6c2.7-9.6-2.8-19.5-12.4-22.3s-19.5 2.8-22.3 12.4l-4.3 15.2c-1.2-.1-2.4-.2-3.6-.2c-15.6-.5-30.3 3.3-43 10.2l-9-9c-7-7-18.4-7-25.5 0s-7 18.4 0 25.5l7.2 7.2c-9.3 12.6-15.2 27.8-16.3 44.5l-7.1-3c-9.1-3.9-19.7 .3-23.6 9.5s.3 19.7 9.5 23.6l8.6 3.7c-6.4 9.9-17.3 22.4-36.9 33.3l-1.3-4.4c-2.7-9.6-12.7-15.1-22.3-12.4s-15.1 12.7-12.4 22.3l2.3 8.1c-3.8 1.1-7.7 2.1-11.9 3.1c-11.6 2.7-22.1 7.7-31.1 14.4l-7.2-7.2c-7-7-18.4-7-25.5 0s-7 18.4 0 25.5l9 9c-7.6 13.9-11.3 30.1-10.1 46.6l-15.2 4.3c-9.6 2.7-15.1 12.7-12.4 22.2s12.7 15.1 22.3 12.4l15.6-4.5c7.7 13.9 19.1 25.1 32.6 32.6L322.7 489zM576 241.5l0 0c-11.7-.4-27.3-.9-48-1.6l48 1.5zM448 384a32 32 0 1 1 -64 0 32 32 0 1 1 64 0z"]
            }, fp = {
              prefix: "fas",
              iconName: "hand-lizard",
              icon: [512, 512, [], "f258", "M0 112C0 85.5 21.5 64 48 64H160h80 46.5c36.8 0 71.2 18 92.1 48.2l113.5 164c13 18.7 19.9 41 19.9 63.8v12 16 48c0 17.7-14.3 32-32 32H384c-17.7 0-32-14.3-32-32V402.2L273.9 352H240 160 112c-26.5 0-48-21.5-48-48s21.5-48 48-48h48 80c26.5 0 48-21.5 48-48s-21.5-48-48-48H160 48c-26.5 0-48-21.5-48-48z"]
            }, eC = {
              prefix: "fas",
              iconName: "notdef",
              icon: [384, 512, [], "e1fe", "M64 390.3L153.5 256 64 121.7V390.3zM102.5 448H281.5L192 313.7 102.5 448zm128-192L320 390.3V121.7L230.5 256zM281.5 64H102.5L192 198.3 281.5 64zM0 48C0 21.5 21.5 0 48 0H336c26.5 0 48 21.5 48 48V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V48z"]
            }, tC = {
              prefix: "fas",
              iconName: "disease",
              icon: [512, 512, [], "f7fa", "M236.4 61.4L227 75.5c-21.3 32-59.4 48.5-97.3 42.1l-59.6-9.9C33.4 101.6 0 129.9 .1 167.1c0 15.9 6.4 31.2 17.6 42.5l29.2 29.2c11 11 17.2 25.9 17.2 41.5c0 15.8-6.4 30.9-17.7 42L33.3 335.1C22.2 345.9 16 360.7 16 376.2c0 36.8 34.1 64.2 70.1 56.2l62.3-13.8c7.7-1.7 15.7-2.6 23.6-2.6h10c27.2 0 53.7 9.3 75 26.3L287.8 467c10.5 8.4 23.6 13 37 13c32.7 0 59.3-26.5 59.3-59.3l0-25.2c0-34.9 21.4-66.2 53.9-78.8l36.9-14.3c22.4-8.7 37.2-30.3 37.2-54.3c0-28.1-20.1-52.3-47.8-57.3l-28-5.1c-36.5-6.7-65.4-34.5-73.6-70.7l-7.1-31.5C348.9 53.4 322.1 32 291.3 32c-22 0-42.6 11-54.9 29.4zM160 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm0 80a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, BM = {
              prefix: "fas",
              iconName: "briefcase-medical",
              icon: [512, 512, [], "f469", "M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zm96 152c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v48h48c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H288v48c0 8.8-7.2 16-16 16H240c-8.8 0-16-7.2-16-16V320H176c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16h48V208z"]
            }, WM = {
              prefix: "fas",
              iconName: "genderless",
              icon: [384, 512, [], "f22d", "M192 144a112 112 0 1 1 0 224 112 112 0 1 1 0-224zm0 288a176 176 0 1 0 0-352 176 176 0 1 0 0 352z"]
            }, SM = {
              prefix: "fas",
              iconName: "chevron-right",
              icon: [320, 512, [9002], "f054", "M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]
            }, UM = {
              prefix: "fas",
              iconName: "retweet",
              icon: [576, 512, [], "f079", "M272 416c17.7 0 32-14.3 32-32s-14.3-32-32-32H160c-17.7 0-32-14.3-32-32V192h32c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 128c0 53 43 96 96 96H272zM304 96c-17.7 0-32 14.3-32 32s14.3 32 32 32l112 0c17.7 0 32 14.3 32 32l0 128H416c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0V192c0-53-43-96-96-96L304 96z"]
            }, Zy = {
              prefix: "fas",
              iconName: "car-rear",
              icon: [512, 512, ["car-alt"], "f5de", "M165.4 96H346.6c13.6 0 25.7 8.6 30.2 21.4L402.9 192H109.1l26.1-74.6c4.5-12.8 16.6-21.4 30.2-21.4zm-90.6 .3L39.6 196.8C16.4 206.4 0 229.3 0 256v80c0 23.7 12.9 44.4 32 55.4V448c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V400H384v48c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V391.4c19.1-11.1 32-31.7 32-55.4V256c0-26.7-16.4-49.6-39.6-59.2L437.2 96.3C423.7 57.8 387.4 32 346.6 32H165.4c-40.8 0-77.1 25.8-90.6 64.3zM208 272h96c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H208c-8.8 0-16-7.2-16-16V288c0-8.8 7.2-16 16-16zM48 280c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24s-10.7 24-24 24H72c-13.3 0-24-10.7-24-24zm360-24h32c13.3 0 24 10.7 24 24s-10.7 24-24 24H408c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
            }, IM = Zy, RM = {
              prefix: "fas",
              iconName: "pump-soap",
              icon: [448, 512, [], "e06b", "M128 32v96H256V96h60.1c4.2 0 8.3 1.7 11.3 4.7l33.9 33.9c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L372.7 55.4c-15-15-35.4-23.4-56.6-23.4H256c0-17.7-14.3-32-32-32H160c-17.7 0-32 14.3-32 32zM117.4 160c-33.3 0-61 25.5-63.8 58.7L35 442.7C31.9 480 61.3 512 98.8 512H285.2c37.4 0 66.9-32 63.8-69.3l-18.7-224c-2.8-33.2-30.5-58.7-63.8-58.7H117.4zM256 360c0 35.3-28.7 56-64 56s-64-20.7-64-56c0-32.5 37-80.9 50.9-97.9c3.2-3.9 8.1-6.1 13.1-6.1s9.9 2.2 13.1 6.1C219 279.1 256 327.5 256 360z"]
            }, VM = {
              prefix: "fas",
              iconName: "video-slash",
              icon: [640, 512, [], "f4e2", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-86.4-67.7 13.8 9.2c9.8 6.5 22.4 7.2 32.9 1.6s16.9-16.4 16.9-28.2V128c0-11.8-6.5-22.6-16.9-28.2s-23-5-32.9 1.6l-96 64L448 174.9V192 320v5.8l-32-25.1V128c0-35.3-28.7-64-64-64H113.9L38.8 5.1zM407 416.7L32.3 121.5c-.2 2.1-.3 4.3-.3 6.5V384c0 35.3 28.7 64 64 64H352c23.4 0 43.9-12.6 55-31.3z"]
            }, _y = {
              prefix: "fas",
              iconName: "battery-quarter",
              icon: [576, 512, ["battery-2"], "f243", "M464 160c8.8 0 16 7.2 16 16V336c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16H464zM80 96C35.8 96 0 131.8 0 176V336c0 44.2 35.8 80 80 80H464c44.2 0 80-35.8 80-80V320c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32V176c0-44.2-35.8-80-80-80H80zm112 96H96V320h96V192z"]
            }, CM = _y, OM = {
              prefix: "fas",
              iconName: "radio",
              icon: [512, 512, [128251], "f8d7", "M494.8 47c12.7-3.7 20-17.1 16.3-29.8S494-2.8 481.2 1L51.7 126.9c-9.4 2.7-17.9 7.3-25.1 13.2C10.5 151.7 0 170.6 0 192v4V304 448c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64H218.5L494.8 47zM368 240a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM80 256c0-8.8 7.2-16 16-16h96c8.8 0 16 7.2 16 16s-7.2 16-16 16H96c-8.8 0-16-7.2-16-16zM64 320c0-8.8 7.2-16 16-16H208c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16zm16 64c0-8.8 7.2-16 16-16h96c8.8 0 16 7.2 16 16s-7.2 16-16 16H96c-8.8 0-16-7.2-16-16z"]
            }, $y = {
              prefix: "fas",
              iconName: "baby-carriage",
              icon: [512, 512, ["carriage-baby"], "f77d", "M256 192H.1C2.7 117.9 41.3 52.9 99 14.1c13.3-8.9 30.8-4.3 39.9 8.8L256 192zm128-32c0-35.3 28.7-64 64-64h32c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0v64c0 25.2-5.8 50.2-17 73.5s-27.8 44.5-48.6 62.3s-45.5 32-72.7 41.6S253.4 416 224 416s-58.5-5-85.7-14.6s-51.9-23.8-72.7-41.6s-37.3-39-48.6-62.3S0 249.2 0 224l224 0 160 0V160zM80 416a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm240 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z"]
            }, yM = $y, kM = {
              prefix: "fas",
              iconName: "traffic-light",
              icon: [320, 512, [128678], "f637", "M64 0C28.7 0 0 28.7 0 64V352c0 88.4 71.6 160 160 160s160-71.6 160-160V64c0-35.3-28.7-64-64-64H64zm96 416a48 48 0 1 1 0-96 48 48 0 1 1 0 96zm48-176a48 48 0 1 1 -96 0 48 48 0 1 1 96 0zm-48-80a48 48 0 1 1 0-96 48 48 0 1 1 0 96z"]
            }, EM = {
              prefix: "fas",
              iconName: "thermometer",
              icon: [512, 512, [], "f491", "M96 382.1V293.3c0-14.9 5.9-29.1 16.4-39.6l27.3-27.3 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 41.4-41.4 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 41.4-41.4 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 45.5-45.5C355.2 10.9 381.4 0 408.8 0C465.8 0 512 46.2 512 103.2c0 27.4-10.9 53.6-30.2 73L258.3 399.6c-10.5 10.5-24.7 16.4-39.6 16.4H129.9L41 505c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l89-89z"]
            }, FM = {
              prefix: "fas",
              iconName: "vr-cardboard",
              icon: [640, 512, [], "f729", "M576 64H64C28.7 64 0 92.7 0 128V384c0 35.3 28.7 64 64 64H184.4c24.2 0 46.4-13.7 57.2-35.4l32-64c8.8-17.5 26.7-28.6 46.3-28.6s37.5 11.1 46.3 28.6l32 64c10.8 21.7 33 35.4 57.2 35.4H576c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64zM96 240a64 64 0 1 1 128 0A64 64 0 1 1 96 240zm384-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
            }, NM = {
              prefix: "fas",
              iconName: "hand-middle-finger",
              icon: [448, 512, [128405], "f806", "M232 0c-22.1 0-40 17.9-40 40V204.2c-8.5-7.6-19.7-12.2-32-12.2c-26.5 0-48 21.5-48 48v7 73c0 8.8-7.2 16-16 16s-16-7.2-16-16V264.3c-2 1.4-3.9 3-5.8 4.5L55 284.8C40.4 297 32 315 32 334V372c0 38 16.9 74 46.1 98.3l5.4 4.5c28.8 24 65 37.1 102.4 37.1H304c70.7 0 128-57.3 128-128V320 288c0-26.5-21.5-48-48-48c-12.4 0-23.6 4.7-32.1 12.3C350 227.5 329.3 208 304 208c-12.3 0-23.5 4.6-32 12.2V40c0-22.1-17.9-40-40-40z"]
            }, ek = {
              prefix: "fas",
              iconName: "percent",
              icon: [384, 512, [62101, 62785, "percentage"], "25", "M374.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-320 320c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l320-320zM128 128A64 64 0 1 0 0 128a64 64 0 1 0 128 0zM384 384a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
            }, QM = ek, YM = {
              prefix: "fas",
              iconName: "truck-moving",
              icon: [640, 512, [], "f4df", "M64 32C28.7 32 0 60.7 0 96V304v80 16c0 44.2 35.8 80 80 80c26.2 0 49.4-12.6 64-32c14.6 19.4 37.8 32 64 32c44.2 0 80-35.8 80-80c0-5.5-.6-10.8-1.6-16H416h33.6c-1 5.2-1.6 10.5-1.6 16c0 44.2 35.8 80 80 80s80-35.8 80-80c0-5.5-.6-10.8-1.6-16H608c17.7 0 32-14.3 32-32V288 272 261.7c0-9.2-3.2-18.2-9-25.3l-58.8-71.8c-10.6-13-26.5-20.5-43.3-20.5H480V96c0-35.3-28.7-64-64-64H64zM585 256H480V192h48.8c2.4 0 4.7 1.1 6.2 2.9L585 256zM528 368a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM176 400a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM80 368a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, MM = {
              prefix: "fas",
              iconName: "glass-water-droplet",
              icon: [384, 512, [], "e4f5", "M32 0C23.1 0 14.6 3.7 8.6 10.2S-.6 25.4 .1 34.3L28.9 437.7c3 41.9 37.8 74.3 79.8 74.3H275.3c42 0 76.8-32.4 79.8-74.3L383.9 34.3c.6-8.9-2.4-17.6-8.5-24.1S360.9 0 352 0H32zM83 297.5L66.4 64H317.6L301 297.5 288 304c-20.1 10.1-43.9 10.1-64 0s-43.9-10.1-64 0s-43.9 10.1-64 0l-13-6.5zM256 196c0-24-33.7-70.1-52.2-93.5c-6.1-7.7-17.5-7.7-23.6 0C161.7 125.9 128 172 128 196c0 33.1 28.7 60 64 60s64-26.9 64-60z"]
            }, LM = {
              prefix: "fas",
              iconName: "display",
              icon: [576, 512, [], "e163", "M64 0C28.7 0 0 28.7 0 64V352c0 35.3 28.7 64 64 64H240l-10.7 32H160c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H346.7L336 416H512c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM512 64V352H64V64H512z"]
            }, tk = {
              prefix: "fas",
              iconName: "face-smile",
              icon: [512, 512, [128578, "smile"], "f118", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, KM = tk, rk = {
              prefix: "fas",
              iconName: "thumbtack",
              icon: [384, 512, [128204, 128392, "thumb-tack"], "f08d", "M32 32C32 14.3 46.3 0 64 0H320c17.7 0 32 14.3 32 32s-14.3 32-32 32H290.5l11.4 148.2c36.7 19.9 65.7 53.2 79.5 94.7l1 3c3.3 9.8 1.6 20.5-4.4 28.8s-15.7 13.3-26 13.3H32c-10.3 0-19.9-4.9-26-13.3s-7.7-19.1-4.4-28.8l1-3c13.8-41.5 42.8-74.8 79.5-94.7L93.5 64H64C46.3 64 32 49.7 32 32zM160 384h64v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V384z"]
            }, JM = rk, zM = {
              prefix: "fas",
              iconName: "trophy",
              icon: [576, 512, [127942], "f091", "M400 0H176c-26.5 0-48.1 21.8-47.1 48.2c.2 5.3 .4 10.6 .7 15.8H24C10.7 64 0 74.7 0 88c0 92.6 33.5 157 78.5 200.7c44.3 43.1 98.3 64.8 138.1 75.8c23.4 6.5 39.4 26 39.4 45.6c0 20.9-17 37.9-37.9 37.9H192c-17.7 0-32 14.3-32 32s14.3 32 32 32H384c17.7 0 32-14.3 32-32s-14.3-32-32-32H357.9C337 448 320 431 320 410.1c0-19.6 15.9-39.2 39.4-45.6c39.9-11 93.9-32.7 138.2-75.8C542.5 245 576 180.6 576 88c0-13.3-10.7-24-24-24H446.4c.3-5.2 .5-10.4 .7-15.8C448.1 21.8 426.5 0 400 0zM48.9 112h84.4c9.1 90.1 29.2 150.3 51.9 190.6c-24.9-11-50.8-26.5-73.2-48.3c-32-31.1-58-76-63-142.3zM464.1 254.3c-22.4 21.8-48.3 37.3-73.2 48.3c22.7-40.3 42.8-100.5 51.9-190.6h84.4c-5.1 66.3-31.1 111.2-63 142.3z"]
            }, nk = {
              prefix: "fas",
              iconName: "person-praying",
              icon: [448, 512, [128720, "pray"], "f683", "M352 64A64 64 0 1 0 224 64a64 64 0 1 0 128 0zM232.7 264l22.9 31.5c6.5 8.9 16.3 14.7 27.2 16.1s21.9-1.7 30.4-8.7l88-72c17.1-14 19.6-39.2 5.6-56.3s-39.2-19.6-56.3-5.6l-55.2 45.2-26.2-36C253.6 156.7 228.6 144 202 144c-30.9 0-59.2 17.1-73.6 44.4L79.8 280.9c-20.2 38.5-9.4 85.9 25.6 111.8L158.6 432H72c-22.1 0-40 17.9-40 40s17.9 40 40 40H280c17.3 0 32.6-11.1 38-27.5s-.3-34.4-14.2-44.7L187.7 354l45-90z"]
            }, GM = nk, ZM = {
              prefix: "fas",
              iconName: "hammer",
              icon: [576, 512, [128296], "f6e3", "M413.5 237.5c-28.2 4.8-58.2-3.6-80-25.4l-38.1-38.1C280.4 159 272 138.8 272 117.6V105.5L192.3 62c-5.3-2.9-8.6-8.6-8.3-14.7s3.9-11.5 9.5-14l47.2-21C259.1 4.2 279 0 299.2 0h18.1c36.7 0 72 14 98.7 39.1l44.6 42c24.2 22.8 33.2 55.7 26.6 86L503 183l8-8c9.4-9.4 24.6-9.4 33.9 0l24 24c9.4 9.4 9.4 24.6 0 33.9l-88 88c-9.4 9.4-24.6 9.4-33.9 0l-24-24c-9.4-9.4-9.4-24.6 0-33.9l8-8-17.5-17.5zM27.4 377.1L260.9 182.6c3.5 4.9 7.5 9.6 11.8 14l38.1 38.1c6 6 12.4 11.2 19.2 15.7L134.9 484.6c-14.5 17.4-36 27.4-58.6 27.4C34.1 512 0 477.8 0 435.7c0-22.6 10.1-44.1 27.4-58.6z"]
            }, _M = {
              prefix: "fas",
              iconName: "hand-peace",
              icon: [512, 512, [9996], "f25b", "M224 0c17.7 0 32 14.3 32 32V240H192V32c0-17.7 14.3-32 32-32zm96 160c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V192c0-17.7 14.3-32 32-32zm64 64c0-17.7 14.3-32 32-32s32 14.3 32 32v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V224zM93.3 51.2L175.9 240H106.1L34.7 76.8C27.6 60.6 35 41.8 51.2 34.7s35.1 .3 42.1 16.5zm27 221.3l-.2-.5h69.9H216c22.1 0 40 17.9 40 40s-17.9 40-40 40H160c-8.8 0-16 7.2-16 16s7.2 16 16 16h56c39.8 0 72-32.2 72-72l0-.6c9.4 5.4 20.3 8.6 32 8.6c13.2 0 25.4-4 35.6-10.8c8.7 24.9 32.5 42.8 60.4 42.8c11.7 0 22.6-3.1 32-8.6V352c0 88.4-71.6 160-160 160H226.3c-42.4 0-83.1-16.9-113.1-46.9l-11.6-11.6C77.5 429.5 64 396.9 64 363V336c0-32.7 24.6-59.7 56.3-63.5z"]
            }, ik = {
              prefix: "fas",
              iconName: "rotate",
              icon: [512, 512, [128260, "sync-alt"], "f2f1", "M142.9 142.9c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5c0 0 0 0 0 0H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5c7.7-21.8 20.2-42.3 37.8-59.8zM16 312v7.6 .7V440c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2l41.6-41.6c87.6 86.5 228.7 86.2 315.8-1c24.4-24.4 42.1-53.1 52.9-83.7c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.2 62.2-162.7 62.5-225.3 1L185 329c6.9-6.9 8.9-17.2 5.2-26.2s-12.5-14.8-22.2-14.8H48.4h-.7H40c-13.3 0-24 10.7-24 24z"]
            }, $M = ik, eL = {
              prefix: "fas",
              iconName: "spinner",
              icon: [512, 512, [], "f110", "M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"]
            }, tL = {
              prefix: "fas",
              iconName: "robot",
              icon: [640, 512, [129302], "f544", "M320 0c17.7 0 32 14.3 32 32V96H472c39.8 0 72 32.2 72 72V440c0 39.8-32.2 72-72 72H168c-39.8 0-72-32.2-72-72V168c0-39.8 32.2-72 72-72H288V32c0-17.7 14.3-32 32-32zM208 384c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H208zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H304zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H400zM264 256a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm152 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM48 224H64V416H48c-26.5 0-48-21.5-48-48V272c0-26.5 21.5-48 48-48zm544 0c26.5 0 48 21.5 48 48v96c0 26.5-21.5 48-48 48H576V224h16z"]
            }, rL = {
              prefix: "fas",
              iconName: "peace",
              icon: [512, 512, [9774], "f67c", "M224 445.3V323.5l-94.3 77.1c26.1 22.8 58.5 38.7 94.3 44.7zM89.2 351.1L224 240.8V66.7C133.2 81.9 64 160.9 64 256c0 34.6 9.2 67.1 25.2 95.1zm293.1 49.5L288 323.5V445.3c35.7-6 68.1-21.9 94.3-44.7zm40.6-49.5c16-28 25.2-60.5 25.2-95.1c0-95.1-69.2-174.1-160-189.3V240.8L422.8 351.1zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
            }, sk = {
              prefix: "fas",
              iconName: "gears",
              icon: [640, 512, ["cogs"], "f085", "M308.5 135.3c7.1-6.3 9.9-16.2 6.2-25c-2.3-5.3-4.8-10.5-7.6-15.5L304 89.4c-3-5-6.3-9.9-9.8-14.6c-5.7-7.6-15.7-10.1-24.7-7.1l-28.2 9.3c-10.7-8.8-23-16-36.2-20.9L199 27.1c-1.9-9.3-9.1-16.7-18.5-17.8C173.9 8.4 167.2 8 160.4 8h-.7c-6.8 0-13.5 .4-20.1 1.2c-9.4 1.1-16.6 8.6-18.5 17.8L115 56.1c-13.3 5-25.5 12.1-36.2 20.9L50.5 67.8c-9-3-19-.5-24.7 7.1c-3.5 4.7-6.8 9.6-9.9 14.6l-3 5.3c-2.8 5-5.3 10.2-7.6 15.6c-3.7 8.7-.9 18.6 6.2 25l22.2 19.8C32.6 161.9 32 168.9 32 176s.6 14.1 1.7 20.9L11.5 216.7c-7.1 6.3-9.9 16.2-6.2 25c2.3 5.3 4.8 10.5 7.6 15.6l3 5.2c3 5.1 6.3 9.9 9.9 14.6c5.7 7.6 15.7 10.1 24.7 7.1l28.2-9.3c10.7 8.8 23 16 36.2 20.9l6.1 29.1c1.9 9.3 9.1 16.7 18.5 17.8c6.7 .8 13.5 1.2 20.4 1.2s13.7-.4 20.4-1.2c9.4-1.1 16.6-8.6 18.5-17.8l6.1-29.1c13.3-5 25.5-12.1 36.2-20.9l28.2 9.3c9 3 19 .5 24.7-7.1c3.5-4.7 6.8-9.5 9.8-14.6l3.1-5.4c2.8-5 5.3-10.2 7.6-15.5c3.7-8.7 .9-18.6-6.2-25l-22.2-19.8c1.1-6.8 1.7-13.8 1.7-20.9s-.6-14.1-1.7-20.9l22.2-19.8zM112 176a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM504.7 500.5c6.3 7.1 16.2 9.9 25 6.2c5.3-2.3 10.5-4.8 15.5-7.6l5.4-3.1c5-3 9.9-6.3 14.6-9.8c7.6-5.7 10.1-15.7 7.1-24.7l-9.3-28.2c8.8-10.7 16-23 20.9-36.2l29.1-6.1c9.3-1.9 16.7-9.1 17.8-18.5c.8-6.7 1.2-13.5 1.2-20.4s-.4-13.7-1.2-20.4c-1.1-9.4-8.6-16.6-17.8-18.5L583.9 307c-5-13.3-12.1-25.5-20.9-36.2l9.3-28.2c3-9 .5-19-7.1-24.7c-4.7-3.5-9.6-6.8-14.6-9.9l-5.3-3c-5-2.8-10.2-5.3-15.6-7.6c-8.7-3.7-18.6-.9-25 6.2l-19.8 22.2c-6.8-1.1-13.8-1.7-20.9-1.7s-14.1 .6-20.9 1.7l-19.8-22.2c-6.3-7.1-16.2-9.9-25-6.2c-5.3 2.3-10.5 4.8-15.6 7.6l-5.2 3c-5.1 3-9.9 6.3-14.6 9.9c-7.6 5.7-10.1 15.7-7.1 24.7l9.3 28.2c-8.8 10.7-16 23-20.9 36.2L315.1 313c-9.3 1.9-16.7 9.1-17.8 18.5c-.8 6.7-1.2 13.5-1.2 20.4s.4 13.7 1.2 20.4c1.1 9.4 8.6 16.6 17.8 18.5l29.1 6.1c5 13.3 12.1 25.5 20.9 36.2l-9.3 28.2c-3 9-.5 19 7.1 24.7c4.7 3.5 9.5 6.8 14.6 9.8l5.4 3.1c5 2.8 10.2 5.3 15.5 7.6c8.7 3.7 18.6 .9 25-6.2l19.8-22.2c6.8 1.1 13.8 1.7 20.9 1.7s14.1-.6 20.9-1.7l19.8 22.2zM464 304a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, nL = sk, iL = {
              prefix: "fas",
              iconName: "warehouse",
              icon: [640, 512, [], "f494", "M0 488V171.3c0-26.2 15.9-49.7 40.2-59.4L308.1 4.8c7.6-3.1 16.1-3.1 23.8 0L599.8 111.9c24.3 9.7 40.2 33.3 40.2 59.4V488c0 13.3-10.7 24-24 24H568c-13.3 0-24-10.7-24-24V224c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32V488c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24zm488 24l-336 0c-13.3 0-24-10.7-24-24V432H512l0 56c0 13.3-10.7 24-24 24zM128 400V336H512v64H128zm0-96V224H512l0 80H128z"]
            }, sL = {
              prefix: "fas",
              iconName: "arrow-up-right-dots",
              icon: [576, 512, [], "e4b7", "M160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h50.7L9.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L256 109.3V160c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H160zM576 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM448 208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM400 384a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm128 0a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM272 384a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM144 512a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM576 336a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm-48-80a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
            }, aL = {
              prefix: "fas",
              iconName: "splotch",
              icon: [512, 512, [], "f5bc", "M208.5 62.3l28.1-36.9C248.8 9.4 267.8 0 288 0c28.5 0 53.6 18.7 61.8 46l17.8 59.4c10.3 34.4 36.1 62 69.8 74.6l39.8 14.9c20.9 7.9 34.8 27.9 34.8 50.2c0 16.9-7.9 32.8-21.5 42.9l-67.3 50.5c-24.3 18.2-37.2 47.9-33.8 78.1l2.5 22.7c4.3 38.7-26 72.6-65 72.6c-14.8 0-29.3-5.1-40.8-14.3l-55.4-44.3c-4.5-3.6-9.3-6.7-14.5-9.2c-15.8-7.9-33.7-10.4-51-7.3L82.4 451.9C47.8 458.2 16 431.6 16 396.5c0-13.2 4.7-26 13.1-36.2l11.2-13.4c14.6-17.4 22.6-39.4 22.6-62.1c0-18.8-5.5-37.2-15.8-53L8.8 173.5C3.1 164.7 0 154.4 0 143.9c0-33.4 30.1-58.8 63-53.2l51.3 8.7c35.9 6.1 72.2-8.2 94.2-37.1z"]
            }, ak = {
              prefix: "fas",
              iconName: "face-grin-hearts",
              icon: [512, 512, [128525, "grin-hearts"], "f584", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM199.3 129.1c17.8 4.8 28.4 23.1 23.6 40.8l-17.4 65c-2.3 8.5-11.1 13.6-19.6 11.3l-65.1-17.4c-17.8-4.8-28.4-23.1-23.6-40.8s23.1-28.4 40.8-23.6l16.1 4.3 4.3-16.1c4.8-17.8 23.1-28.4 40.8-23.6zm154.3 23.6l4.3 16.1 16.1-4.3c17.8-4.8 36.1 5.8 40.8 23.6s-5.8 36.1-23.6 40.8l-65.1 17.4c-8.5 2.3-17.3-2.8-19.6-11.3l-17.4-65c-4.8-17.8 5.8-36.1 23.6-40.8s36.1 5.8 40.9 23.6z"]
            }, oL = ak, fL = {
              prefix: "fas",
              iconName: "dice-four",
              icon: [448, 512, [9859], "f524", "M0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zm160 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM352 160a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, AL = {
              prefix: "fas",
              iconName: "sim-card",
              icon: [384, 512, [], "f7c4", "M64 0H242.7c17 0 33.3 6.7 45.3 18.7L365.3 96c12 12 18.7 28.3 18.7 45.3V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64C0 28.7 28.7 0 64 0zM96 192c-17.7 0-32 14.3-32 32v32h64V192H96zM64 352h80 96 80V288H240 144 64v64zM320 224c0-17.7-14.3-32-32-32H256v64h64V224zM160 192v64h64V192H160zM288 448c17.7 0 32-14.3 32-32V384H256v64h32zM160 384v64h64V384H160zM64 416c0 17.7 14.3 32 32 32h32V384H64v32z"]
            }, ok = {
              prefix: "fas",
              iconName: "transgender",
              icon: [512, 512, [9895, "transgender-alt"], "f225", "M112 0c6.5 0 12.3 3.9 14.8 9.9s1.1 12.9-3.5 17.4l-31 31L112 78.1l7-7c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-7 7 15.2 15.2C187.7 107.6 220.5 96 256 96s68.3 11.6 94.9 31.2l68.8-68.8-31-31c-4.6-4.6-5.9-11.5-3.5-17.4s8.3-9.9 14.8-9.9h96c8.8 0 16 7.2 16 16v96c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5l-31-31-68.8 68.8C404.4 187.7 416 220.5 416 256c0 80.2-59 146.6-136 158.2V432h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H280v8c0 13.3-10.7 24-24 24s-24-10.7-24-24v-8H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h16V414.2C155 402.6 96 336.2 96 256c0-35.5 11.6-68.3 31.2-94.9L112 145.9l-7 7c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l7-7L58.3 92.3l-31 31c-4.6 4.6-11.5 5.9-17.4 3.5S0 118.5 0 112V16C0 7.2 7.2 0 16 0h96zM352 256a96 96 0 1 0 -192 0 96 96 0 1 0 192 0z"]
            }, dL = ok, vL = {
              prefix: "fas",
              iconName: "mercury",
              icon: [384, 512, [9791], "f223", "M72.1 7C85.8-4 106-1.8 117 12c17.6 22 44.7 36 75 36s57.3-14 75-36c11.1-13.8 31.2-16 45-5s16 31.2 5 45c-7.8 9.7-16.6 18.4-26.4 26.1C337.3 109.7 368 163.3 368 224c0 89.1-66.2 162.7-152 174.4V424h32c13.3 0 24 10.7 24 24s-10.7 24-24 24H216v16c0 13.3-10.7 24-24 24s-24-10.7-24-24V472H136c-13.3 0-24-10.7-24-24s10.7-24 24-24h32V398.4C82.2 386.7 16 313.1 16 224c0-60.7 30.7-114.3 77.5-145.9C83.7 70.5 74.9 61.7 67.1 52c-11.1-13.8-8.8-33.9 5-45zM80 224a112 112 0 1 0 224 0A112 112 0 1 0 80 224z"]
            }, fk = {
              prefix: "fas",
              iconName: "arrow-turn-down",
              icon: [384, 512, ["level-down"], "f149", "M32 64C14.3 64 0 49.7 0 32S14.3 0 32 0l96 0c53 0 96 43 96 96l0 306.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 402.7 160 96c0-17.7-14.3-32-32-32L32 64z"]
            }, uL = fk, lL = {
              prefix: "fas",
              iconName: "person-falling-burst",
              icon: [640, 512, [], "e547", "M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 9.8c0 39-23.7 74-59.9 88.4C71.6 154.5 32 213 32 278.2V352c0 17.7 14.3 32 32 32s32-14.3 32-32l0-73.8c0-10 1.6-19.8 4.5-29L261.1 497.4c9.6 14.8 29.4 19.1 44.3 9.5s19.1-29.4 9.5-44.3L222.6 320H224l80 0 38.4 51.2c10.6 14.1 30.7 17 44.8 6.4s17-30.7 6.4-44.8l-43.2-57.6C341.3 263.1 327.1 256 312 256l-71.5 0-56.8-80.2-.2-.3c44.7-29 72.5-79 72.5-133.6l0-9.8zM96 80A48 48 0 1 0 0 80a48 48 0 1 0 96 0zM464 286.1l58.6 53.9c4.8 4.4 11.9 5.5 17.8 2.6s9.5-9 9-15.5l-5.6-79.4 78.7-12.2c6.5-1 11.7-5.9 13.1-12.2s-1.1-13-6.5-16.7l-65.6-45.1L603 92.2c3.3-5.7 2.7-12.8-1.4-17.9s-10.9-7.2-17.2-5.3L508.3 92.1l-29.4-74C476.4 12 470.6 8 464 8s-12.4 4-14.9 10.1l-29.4 74L343.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1-65.6 45.1c-5.4 3.7-8 10.3-6.5 16.7c.1 .3 .1 .6 .2 .8l19.4 0c20.1 0 39.2 7.5 53.8 20.8l18.4 2.9L383 265.3l36.2 48.3c2.1 2.8 3.9 5.7 5.5 8.6L464 286.1z"]
            }, PL = {
              prefix: "fas",
              iconName: "award",
              icon: [384, 512, [], "f559", "M173.8 5.5c11-7.3 25.4-7.3 36.4 0L228 17.2c6 3.9 13 5.8 20.1 5.4l21.3-1.3c13.2-.8 25.6 6.4 31.5 18.2l9.6 19.1c3.2 6.4 8.4 11.5 14.7 14.7L344.5 83c11.8 5.9 19 18.3 18.2 31.5l-1.3 21.3c-.4 7.1 1.5 14.2 5.4 20.1l11.8 17.8c7.3 11 7.3 25.4 0 36.4L366.8 228c-3.9 6-5.8 13-5.4 20.1l1.3 21.3c.8 13.2-6.4 25.6-18.2 31.5l-19.1 9.6c-6.4 3.2-11.5 8.4-14.7 14.7L301 344.5c-5.9 11.8-18.3 19-31.5 18.2l-21.3-1.3c-7.1-.4-14.2 1.5-20.1 5.4l-17.8 11.8c-11 7.3-25.4 7.3-36.4 0L156 366.8c-6-3.9-13-5.8-20.1-5.4l-21.3 1.3c-13.2 .8-25.6-6.4-31.5-18.2l-9.6-19.1c-3.2-6.4-8.4-11.5-14.7-14.7L39.5 301c-11.8-5.9-19-18.3-18.2-31.5l1.3-21.3c.4-7.1-1.5-14.2-5.4-20.1L5.5 210.2c-7.3-11-7.3-25.4 0-36.4L17.2 156c3.9-6 5.8-13 5.4-20.1l-1.3-21.3c-.8-13.2 6.4-25.6 18.2-31.5l19.1-9.6C65 70.2 70.2 65 73.4 58.6L83 39.5c5.9-11.8 18.3-19 31.5-18.2l21.3 1.3c7.1 .4 14.2-1.5 20.1-5.4L173.8 5.5zM272 192a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM1.3 441.8L44.4 339.3c.2 .1 .3 .2 .4 .4l9.6 19.1c11.7 23.2 36 37.3 62 35.8l21.3-1.3c.2 0 .5 0 .7 .2l17.8 11.8c5.1 3.3 10.5 5.9 16.1 7.7l-37.6 89.3c-2.3 5.5-7.4 9.2-13.3 9.7s-11.6-2.2-14.8-7.2L74.4 455.5l-56.1 8.3c-5.7 .8-11.4-1.5-15-6s-4.3-10.7-2.1-16zm248 60.4L211.7 413c5.6-1.8 11-4.3 16.1-7.7l17.8-11.8c.2-.1 .4-.2 .7-.2l21.3 1.3c26 1.5 50.3-12.6 62-35.8l9.6-19.1c.1-.2 .2-.3 .4-.4l43.2 102.5c2.2 5.3 1.4 11.4-2.1 16s-9.3 6.9-15 6l-56.1-8.3-32.2 49.2c-3.2 5-8.9 7.7-14.8 7.2s-11-4.3-13.3-9.7z"]
            }, Ak = {
              prefix: "fas",
              iconName: "ticket-simple",
              icon: [576, 512, ["ticket-alt"], "f3ff", "M0 128C0 92.7 28.7 64 64 64H512c35.3 0 64 28.7 64 64v64c0 8.8-7.4 15.7-15.7 18.6C541.5 217.1 528 235 528 256s13.5 38.9 32.3 45.4c8.3 2.9 15.7 9.8 15.7 18.6v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V320c0-8.8 7.4-15.7 15.7-18.6C34.5 294.9 48 277 48 256s-13.5-38.9-32.3-45.4C7.4 207.7 0 200.8 0 192V128z"]
            }, cL = Ak, pL = {
              prefix: "fas",
              iconName: "building",
              icon: [384, 512, [127970, 61687], "f1ad", "M48 0C21.5 0 0 21.5 0 48V464c0 26.5 21.5 48 48 48h96V432c0-26.5 21.5-48 48-48s48 21.5 48 48v80h96c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48H48zM64 240c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V240zm112-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V240c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V240zM80 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V112zM272 96h32c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16z"]
            }, dk = {
              prefix: "fas",
              iconName: "angles-left",
              icon: [512, 512, [171, "angle-double-left"], "f100", "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"]
            }, hL = dk, HL = {
              prefix: "fas",
              iconName: "qrcode",
              icon: [448, 512, [], "f029", "M0 80C0 53.5 21.5 32 48 32h96c26.5 0 48 21.5 48 48v96c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V80zM64 96v64h64V96H64zM0 336c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v96c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V336zm64 16v64h64V352H64zM304 32h96c26.5 0 48 21.5 48 48v96c0 26.5-21.5 48-48 48H304c-26.5 0-48-21.5-48-48V80c0-26.5 21.5-48 48-48zm80 64H320v64h64V96zM256 304c0-8.8 7.2-16 16-16h64c8.8 0 16 7.2 16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s7.2-16 16-16s16 7.2 16 16v96c0 8.8-7.2 16-16 16H368c-8.8 0-16-7.2-16-16s-7.2-16-16-16s-16 7.2-16 16v64c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V304zM368 480a16 16 0 1 1 0-32 16 16 0 1 1 0 32zm64 0a16 16 0 1 1 0-32 16 16 0 1 1 0 32z"]
            }, vk = {
              prefix: "fas",
              iconName: "clock-rotate-left",
              icon: [512, 512, ["history"], "f1da", "M75 75L41 41C25.9 25.9 0 36.6 0 57.9V168c0 13.3 10.7 24 24 24H134.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24V256c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65V152c0-13.3-10.7-24-24-24z"]
            }, gL = vk, uk = {
              prefix: "fas",
              iconName: "face-grin-beam-sweat",
              icon: [512, 512, [128517, "grin-beam-sweat"], "f583", "M476.8 126.3c-4.1 1.1-8.4 1.7-12.8 1.7c-26.5 0-48-21-48-47c0-5 1.8-11.3 4.6-18.1c.3-.7 .6-1.4 .9-2.1c9-20.2 26.5-44.9 36-57.5c3.2-4.4 9.6-4.4 12.8 0C483.4 20.6 512 61 512 81c0 21.7-14.9 39.8-35.2 45.3zM256 0c51.4 0 99.3 15.2 139.4 41.2c-1.5 3.1-3 6.2-4.3 9.3c-3.4 8-7.1 19-7.1 30.5c0 44.3 36.6 79 80 79c9.6 0 18.8-1.7 27.4-4.8c13.3 30.9 20.6 65 20.6 100.8c0 141.4-114.6 256-256 256S0 397.4 0 256S114.6 0 256 0zM383.8 317.8C345.3 329.4 301.9 336 256 336s-89.3-6.6-127.8-18.2c-12.3-3.7-24.3 7-19.2 18.7c24.5 56.9 81.1 96.7 147 96.7s122.5-39.8 147-96.7c5.1-11.8-6.9-22.4-19.2-18.7zm-166.2-89l0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C126.7 188.4 120 206.1 120 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8l0 0 0 0 0 0 .2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2 0 0 0 0zm160 0l0 0 0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C286.7 188.4 280 206.1 280 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8l0 0 0 0 0 0 .2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2 0 0z"]
            }, XL = uk, lk = {
              prefix: "fas",
              iconName: "file-export",
              icon: [576, 512, ["arrow-right-from-file"], "f56e", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V288H216c-13.3 0-24 10.7-24 24s10.7 24 24 24H384V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM384 336V288H494.1l-39-39c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l80 80c9.4 9.4 9.4 24.6 0 33.9l-80 80c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l39-39H384zm0-208H256V0L384 128z"]
            }, TL = lk, Pk = {
              prefix: "fas",
              iconName: "shield",
              icon: [512, 512, [128737, "shield-blank"], "f132", "M256 0c4.6 0 9.2 1 13.4 2.9L457.7 82.8c22 9.3 38.4 31 38.3 57.2c-.5 99.2-41.3 280.7-213.6 363.2c-16.7 8-36.1 8-52.8 0C57.3 420.7 16.5 239.2 16 140c-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.8 1 251.4 0 256 0z"]
            }, qL = Pk, ck = {
              prefix: "fas",
              iconName: "arrow-up-short-wide",
              icon: [576, 512, ["sort-amount-up-alt"], "f885", "M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3V448c0 17.7 14.3 32 32 32s32-14.3 32-32V146.3l32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H320zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H320zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H320zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H320z"]
            }, bL = ck, xL = {
              prefix: "fas",
              iconName: "house-medical",
              icon: [576, 512, [], "e3b2", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1h32V448c0 35.3 28.7 64 64 64H448.5c35.5 0 64.2-28.8 64-64.3l-.7-160.2h32zM256 208c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v48h48c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H320v48c0 8.8-7.2 16-16 16H272c-8.8 0-16-7.2-16-16V320H208c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16h48V208z"]
            }, pk = {
              prefix: "fas",
              iconName: "golf-ball-tee",
              icon: [384, 512, ["golf-ball"], "f450", "M384 192c0 66.8-34.1 125.6-85.8 160H85.8C34.1 317.6 0 258.8 0 192C0 86 86 0 192 0S384 86 384 192zM242.1 256.6c0 18.5-15 33.5-33.5 33.5c-4.9 0-9.1 5.1-5.4 8.4c5.9 5.2 13.7 8.4 22.1 8.4c18.5 0 33.5-15 33.5-33.5c0-8.5-3.2-16.2-8.4-22.1c-3.3-3.7-8.4 .5-8.4 5.4zm-52.3-49.3c-4.9 0-9.1 5.1-5.4 8.4c5.9 5.2 13.7 8.4 22.1 8.4c18.5 0 33.5-15 33.5-33.5c0-8.5-3.2-16.2-8.4-22.1c-3.3-3.7-8.4 .5-8.4 5.4c0 18.5-15 33.5-33.5 33.5zm113.5-17.5c0 18.5-15 33.5-33.5 33.5c-4.9 0-9.1 5.1-5.4 8.4c5.9 5.2 13.7 8.4 22.1 8.4c18.5 0 33.5-15 33.5-33.5c0-8.5-3.2-16.2-8.4-22.1c-3.3-3.7-8.4 .5-8.4 5.4zM96 416c0-17.7 14.3-32 32-32h64 64c17.7 0 32 14.3 32 32s-14.3 32-32 32H240c-8.8 0-16 7.2-16 16v16c0 17.7-14.3 32-32 32s-32-14.3-32-32V464c0-8.8-7.2-16-16-16H128c-17.7 0-32-14.3-32-32z"]
            }, DL = pk, hk = {
              prefix: "fas",
              iconName: "circle-chevron-left",
              icon: [512, 512, ["chevron-circle-left"], "f137", "M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM271 135c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-87 87 87 87c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L167 273c-9.4-9.4-9.4-24.6 0-33.9L271 135z"]
            }, jL = hk, wL = {
              prefix: "fas",
              iconName: "house-chimney-window",
              icon: [576, 512, [], "e00d", "M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c.2 35.5-28.5 64.3-64 64.3H128.1c-35.3 0-64-28.7-64-64V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L416 100.7V64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32V185l52.8 46.4c8 7 12 15 11 24zM248 192c-13.3 0-24 10.7-24 24v80c0 13.3 10.7 24 24 24h80c13.3 0 24-10.7 24-24V216c0-13.3-10.7-24-24-24H248z"]
            }, mL = {
              prefix: "fas",
              iconName: "pen-nib",
              icon: [512, 512, [10001], "f5ad", "M368.4 18.3L312.7 74.1 437.9 199.3l55.7-55.7c21.9-21.9 21.9-57.3 0-79.2L447.6 18.3c-21.9-21.9-57.3-21.9-79.2 0zM288 94.6l-9.2 2.8L134.7 140.6c-19.9 6-35.7 21.2-42.3 41L3.8 445.8c-3.8 11.3-1 23.9 7.3 32.4L164.7 324.7c-3-6.3-4.7-13.3-4.7-20.7c0-26.5 21.5-48 48-48s48 21.5 48 48s-21.5 48-48 48c-7.4 0-14.4-1.7-20.7-4.7L33.7 500.9c8.6 8.3 21.1 11.2 32.4 7.3l264.3-88.6c19.7-6.6 35-22.4 41-42.3l43.2-144.1 2.8-9.2L288 94.6z"]
            }, BL = {
              prefix: "fas",
              iconName: "tent-arrow-turn-left",
              icon: [576, 512, [], "e580", "M120.1 41.8c9.9-8.9 10.7-24 1.8-33.9S97.8-2.7 87.9 6.2l-80 72C2.9 82.7 0 89.2 0 96s2.9 13.3 7.9 17.8l80 72c9.9 8.9 25 8.1 33.9-1.8s8.1-25-1.8-33.9L86.5 120 456 120c39.8 0 72 32.2 72 72v40c0 13.3 10.7 24 24 24s24-10.7 24-24V192c0-66.3-53.7-120-120-120L86.5 72l33.5-30.2zM307.4 166.5c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S86.7 512 96 512H288V352l96 160h96c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
            }, WL = {
              prefix: "fas",
              iconName: "tents",
              icon: [640, 512, [], "e582", "M396.6 6.5L235.8 129.1c9.6 1.8 18.9 5.8 27 12l168 128c13.2 10.1 22 24.9 24.5 41.4l6.2 41.5H608c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128c-11.5-8.7-27.3-8.7-38.8 0zm-153.2 160c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S22.7 512 32 512H224V352l96 160h96c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
            }, Hk = {
              prefix: "fas",
              iconName: "wand-magic",
              icon: [512, 512, ["magic"], "f0d0", "M14.1 463.3c-18.7-18.7-18.7-49.1 0-67.9L395.4 14.1c18.7-18.7 49.1-18.7 67.9 0l34.6 34.6c18.7 18.7 18.7 49.1 0 67.9L116.5 497.9c-18.7 18.7-49.1 18.7-67.9 0L14.1 463.3zM347.6 187.6l105-105L429.4 59.3l-105 105 23.3 23.3z"]
            }, SL = Hk, UL = {
              prefix: "fas",
              iconName: "dog",
              icon: [576, 512, [128021], "f6d3", "M309.6 158.5L332.7 19.8C334.6 8.4 344.5 0 356.1 0c7.5 0 14.5 3.5 19 9.5L392 32h52.1c12.7 0 24.9 5.1 33.9 14.1L496 64h56c13.3 0 24 10.7 24 24v24c0 44.2-35.8 80-80 80H464 448 426.7l-5.1 30.5-112-64zM416 256.1L416 480c0 17.7-14.3 32-32 32H352c-17.7 0-32-14.3-32-32V364.8c-24 12.3-51.2 19.2-80 19.2s-56-6.9-80-19.2V480c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V249.8c-28.8-10.9-51.4-35.3-59.2-66.5L1 167.8c-4.3-17.1 6.1-34.5 23.3-38.8s34.5 6.1 38.8 23.3l3.9 15.5C70.5 182 83.3 192 98 192h30 16H303.8L416 256.1zM464 80a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
            }, IL = {
              prefix: "fas",
              iconName: "carrot",
              icon: [512, 512, [129365], "f787", "M346.7 6C337.6 17 320 42.3 320 72c0 40 15.3 55.3 40 80s40 40 80 40c29.7 0 55-17.6 66-26.7c4-3.3 6-8.2 6-13.3s-2-10-6-13.2c-11.4-9.1-38.3-26.8-74-26.8c-32 0-40 8-40 8s8-8 8-40c0-35.7-17.7-62.6-26.8-74C370 2 365.1 0 360 0s-10 2-13.3 6zM244.6 136c-40 0-77.1 18.1-101.7 48.2l60.5 60.5c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-55.3-55.3 0 .1L2.2 477.9C-2 487-.1 497.8 7 505s17.9 9 27.1 4.8l134.7-62.4-52.1-52.1c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L199.7 433l100.2-46.4c46.4-21.5 76.2-68 76.2-119.2C376 194.8 317.2 136 244.6 136z"]
            }, RL = {
              prefix: "fas",
              iconName: "moon",
              icon: [384, 512, [127769, 9214], "f186", "M223.5 32C100 32 0 132.3 0 256S100 480 223.5 480c60.6 0 115.5-24.2 155.8-63.4c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-9.8 1.7-19.8 2.6-30.1 2.6c-96.9 0-175.5-78.8-175.5-176c0-65.8 36-123.1 89.3-153.3c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-6.3-.5-12.6-.8-19-.8z"]
            }, gk = {
              prefix: "fas",
              iconName: "wine-glass-empty",
              icon: [320, 512, ["wine-glass-alt"], "f5ce", "M64 0C47.4 0 33.5 12.8 32.1 29.3l-14 168.4c-6 72 42.5 135.2 109.9 150.6V448H80c-17.7 0-32 14.3-32 32s14.3 32 32 32h80 80c17.7 0 32-14.3 32-32s-14.3-32-32-32H192V348.4c67.4-15.4 115.9-78.6 109.9-150.6l-14-168.4C286.5 12.8 272.6 0 256 0H64zM81.9 203.1L93.4 64H226.6l11.6 139.1C242 248.8 205.9 288 160 288s-82-39.2-78.1-84.9z"]
            }, VL = gk, CL = {
              prefix: "fas",
              iconName: "cheese",
              icon: [512, 512, [], "f7ef", "M512 240.2V256H0c0-20 10-38.7 26.6-49.8L274.9 40.7c8.6-5.7 18.6-8.7 28.9-8.7C418.8 32 512 125.2 512 240.2zm0 47.8V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V288H512z"]
            }, OL = {
              prefix: "fas",
              iconName: "yin-yang",
              icon: [512, 512, [9775], "f6ad", "M256 64c53 0 96 43 96 96s-43 96-96 96s-96 43-96 96s43 96 96 96C150 448 64 362 64 256S150 64 256 64zm0 448A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm32-352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
            }, yL = {
              prefix: "fas",
              iconName: "music",
              icon: [512, 512, [127925], "f001", "M499.1 6.3c8.1 6 12.9 15.6 12.9 25.7v72V368c0 44.2-43 80-96 80s-96-35.8-96-80s43-80 96-80c11.2 0 22 1.6 32 4.6V147L192 223.8V432c0 44.2-43 80-96 80s-96-35.8-96-80s43-80 96-80c11.2 0 22 1.6 32 4.6V200 128c0-14.1 9.3-26.6 22.8-30.7l320-96c9.7-2.9 20.2-1.1 28.3 5z"]
            }, kL = {
              prefix: "fas",
              iconName: "code-commit",
              icon: [640, 512, [], "f386", "M320 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm156.8-48C462 361 397.4 416 320 416s-142-55-156.8-128H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H163.2C178 151 242.6 96 320 96s142 55 156.8 128H608c17.7 0 32 14.3 32 32s-14.3 32-32 32H476.8z"]
            }, EL = {
              prefix: "fas",
              iconName: "temperature-low",
              icon: [512, 512, [], "f76b", "M448 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 96a96 96 0 1 1 192 0A96 96 0 1 1 320 96zM144 64c-26.5 0-48 21.5-48 48V276.5c0 17.3-7.1 31.9-15.3 42.5C70.2 332.6 64 349.5 64 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5V112c0-26.5-21.5-48-48-48zM32 112C32 50.2 82.1 0 144 0s112 50.1 112 112V276.5c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S0 447.5 0 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6V112zM192 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3V272c0-8.8 7.2-16 16-16s16 7.2 16 16v50.7c18.6 6.6 32 24.4 32 45.3z"]
            }, Xk = {
              prefix: "fas",
              iconName: "person-biking",
              icon: [640, 512, [128692, "biking"], "f84a", "M400 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm27.2 64l-61.8-48.8c-17.3-13.6-41.7-13.8-59.1-.3l-83.1 64.2c-30.7 23.8-28.5 70.8 4.3 91.6L288 305.1V416c0 17.7 14.3 32 32 32s32-14.3 32-32V288c0-10.7-5.3-20.7-14.2-26.6L295 232.9l60.3-48.5L396 217c5.7 4.5 12.7 7 20 7h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H427.2zM56 384a72 72 0 1 1 144 0A72 72 0 1 1 56 384zm200 0A128 128 0 1 0 0 384a128 128 0 1 0 256 0zm184 0a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zm200 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"]
            }, FL = Xk, NL = {
              prefix: "fas",
              iconName: "broom",
              icon: [576, 512, [129529], "f51a", "M566.6 54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192-34.7-34.7c-4.2-4.2-10-6.6-16-6.6c-12.5 0-22.6 10.1-22.6 22.6v29.1L364.3 320h29.1c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16l-34.7-34.7 192-192zM341.1 353.4L222.6 234.9c-42.7-3.7-85.2 11.7-115.8 42.3l-8 8C76.5 307.5 64 337.7 64 369.2c0 6.8 7.1 11.2 13.2 8.2l51.1-25.5c5-2.5 9.5 4.1 5.4 7.9L7.3 473.4C2.7 477.6 0 483.6 0 489.9C0 502.1 9.9 512 22.1 512l173.3 0c38.8 0 75.9-15.4 103.4-42.8c30.6-30.6 45.9-73.1 42.3-115.8z"]
            }, QL = {
              prefix: "fas",
              iconName: "shield-heart",
              icon: [512, 512, [], "e574", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM144 221.3c0-33.8 27.4-61.3 61.3-61.3c16.2 0 31.8 6.5 43.3 17.9l7.4 7.4 7.4-7.4c11.5-11.5 27.1-17.9 43.3-17.9c33.8 0 61.3 27.4 61.3 61.3c0 16.2-6.5 31.8-17.9 43.3l-82.7 82.7c-6.2 6.2-16.4 6.2-22.6 0l-82.7-82.7c-11.5-11.5-17.9-27.1-17.9-43.3z"]
            }, YL = {
              prefix: "fas",
              iconName: "gopuram",
              icon: [512, 512, [], "f664", "M120 0c13.3 0 24 10.7 24 24v8h40V24c0-13.3 10.7-24 24-24s24 10.7 24 24v8h48V24c0-13.3 10.7-24 24-24s24 10.7 24 24v8h40V24c0-13.3 10.7-24 24-24s24 10.7 24 24v8V64v64c17.7 0 32 14.3 32 32v64c17.7 0 32 14.3 32 32v96c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H416V352H384V224H352V128H320v96h32V352h32V512H304V464c0-26.5-21.5-48-48-48s-48 21.5-48 48v48H128V352h32V224h32V128H160v96H128V352H96V512H32c-17.7 0-32-14.3-32-32V384c0-17.7 14.3-32 32-32V256c0-17.7 14.3-32 32-32V160c0-17.7 14.3-32 32-32V64 32 24c0-13.3 10.7-24 24-24zM256 272c-17.7 0-32 14.3-32 32v48h64V304c0-17.7-14.3-32-32-32zm-32-80v32h64V192c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
            }, Tk = {
              prefix: "fas",
              iconName: "earth-oceania",
              icon: [512, 512, ["globe-oceania"], "e47b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM208.6 357.3l-39-13.5c-6.5-2.2-13.6-2.3-20.1-.3l-15.3 4.9c-18.5 5.9-38.5-2.4-47.5-19.5l-3.3-6.2c-10.6-20.1-2.3-45 18.2-54.7l35.3-16.8c2.3-1.1 4.4-2.8 5.9-4.8l5.3-7c7.2-9.6 18.6-15.3 30.6-15.3s23.4 5.7 30.6 15.3l4.6 6.1c2 2.6 4.9 4.5 8.1 5.1c7.8 1.6 15.7-1.5 20.4-7.9l10.4-14.2c2-2.8 5.3-4.4 8.7-4.4c4.4 0 8.4 2.7 10 6.8l10.1 25.9c2.8 7.2 6.7 14 11.5 20.2L311 299.8c5.8 7.4 9 16.6 9 26s-3.2 18.6-9 26L299 367.2c-8.3 10.6-21 16.8-34.4 16.8c-8.4 0-16.6-2.4-23.7-7l-25.4-16.4c-2.2-1.4-4.5-2.5-6.9-3.4zm65.2-214.8L296 164.7c10.1 10.1 2.9 27.3-11.3 27.3H254.8c-5.6 0-11.1-1.2-16.2-3.4l-42.8-19c-14.3-6.3-11.9-27.3 3.4-30.3l38.5-7.7c13.1-2.6 26.7 1.5 36.1 10.9zM248 432c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16s-7.2 16-16 16H264c-8.8 0-16-7.2-16-16zM431.2 298.9l8 24c2.8 8.4-1.7 17.4-10.1 20.2s-17.4-1.7-20.2-10.1l-8-24c-2.8-8.4 1.7-17.4 10.1-20.2s17.4 1.7 20.2 10.1zm-19.9 80.4l-32 32c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l32-32c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
            }, ML = Tk, rC = {
              prefix: "fas",
              iconName: "square-xmark",
              icon: [448, 512, [10062, "times-square", "xmark-square"], "f2d3", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm79 143c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
            }, LL = rC, KL = rC, JL = {
              prefix: "fas",
              iconName: "hashtag",
              icon: [448, 512, [62098], "23", "M181.3 32.4c17.4 2.9 29.2 19.4 26.3 36.8L197.8 128h95.1l11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3s29.2 19.4 26.3 36.8L357.8 128H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H347.1L325.8 320H384c17.7 0 32 14.3 32 32s-14.3 32-32 32H315.1l-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8l9.8-58.7H155.1l-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8L90.2 384H32c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l21.3-128H64c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3zM187.1 192L165.8 320h95.1l21.3-128H187.1z"]
            }, qk = {
              prefix: "fas",
              iconName: "up-right-and-down-left-from-center",
              icon: [512, 512, ["expand-alt"], "f424", "M344 0H488c13.3 0 24 10.7 24 24V168c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87L327 41c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512H24c-13.3 0-24-10.7-24-24V344c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8z"]
            }, zL = qk, GL = {
              prefix: "fas",
              iconName: "oil-can",
              icon: [640, 512, [], "f613", "M320 128c17.7 0 32-14.3 32-32s-14.3-32-32-32H192c-17.7 0-32 14.3-32 32s14.3 32 32 32h32v32H144 96 48c-26.5 0-48 21.5-48 48v64.8c0 19 11.2 36.2 28.5 43.9l67.5 30V368c0 26.5 21.5 48 48 48H403.1c18.4 0 35.8-7.9 48-21.7L633.5 187.7c12.3-13.9-.3-35.4-18.4-31.5L448 192l-50.5-25.2c-8.9-4.4-18.7-6.8-28.6-6.8H288V128h32zM96 208v86.1L48 272.8V208H96z"]
            }, ZL = {
              prefix: "fas",
              iconName: "t",
              icon: [384, 512, [116], "54", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96H160V448c0 17.7 14.3 32 32 32s32-14.3 32-32V96H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H192 32z"]
            }, _L = {
              prefix: "fas",
              iconName: "hippo",
              icon: [640, 512, [129435], "f6ed", "M407 47c9.4-9.4 24.6-9.4 33.9 0l17.2 17.2c1.9-.1 3.9-.2 5.8-.2h32c11.2 0 21.9 2.3 31.6 6.5L543 55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L564 101.9c7.6 12.2 12 26.7 12 42.1c0 10.2 7.4 18.8 16.7 23c27.9 12.5 47.3 40.5 47.3 73c0 26.2-12.6 49.4-32 64v32c0 8.8-7.2 16-16 16H560c-8.8 0-16-7.2-16-16V320H480v16c0 8.8-7.2 16-16 16H432c-8.8 0-16-7.2-16-16V318.4c-11.8-2.4-22.7-7.4-32-14.4c-1.5-1.1-2.9-2.3-4.3-3.5c-17-14.7-27.7-36.4-27.7-60.5c0-8.8-7.2-16-16-16s-16 7.2-16 16c0 44.7 26.2 83.2 64 101.2V352c0 17.7 14.3 32 32 32h32v64c0 17.7-14.3 32-32 32H352c-17.7 0-32-14.3-32-32V372c-19.8 7.7-41.4 12-64 12s-44.2-4.3-64-12v76c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V329.1L45.9 369.7c-5.4 12.1-19.6 17.6-31.7 12.2S-3.3 362.4 2.1 350.3L24 300.9c5.3-11.9 8-24.7 8-37.7C32 155.7 117.2 68 223.8 64.1l.2-.1h7.2H256h32c41.7 0 83.4 12.1 117.2 25.7c1.7-1.8 3.5-3.6 5.3-5.2L407 81c-9.4-9.4-9.4-24.6 0-33.9zm73 185a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm88 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM480 144a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
            }, $L = {
              prefix: "fas",
              iconName: "chart-column",
              icon: [512, 512, [], "e0e3", "M32 32c17.7 0 32 14.3 32 32V400c0 8.8 7.2 16 16 16H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H80c-44.2 0-80-35.8-80-80V64C0 46.3 14.3 32 32 32zM160 224c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V256c0-17.7 14.3-32 32-32zm128-64V320c0 17.7-14.3 32-32 32s-32-14.3-32-32V160c0-17.7 14.3-32 32-32s32 14.3 32 32zm64 32c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V224c0-17.7 14.3-32 32-32zM480 96V320c0 17.7-14.3 32-32 32s-32-14.3-32-32V96c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
            }, eK = {
              prefix: "fas",
              iconName: "infinity",
              icon: [640, 512, [8734, 9854], "f534", "M0 241.1C0 161 65 96 145.1 96c38.5 0 75.4 15.3 102.6 42.5L320 210.7l72.2-72.2C419.5 111.3 456.4 96 494.9 96C575 96 640 161 640 241.1v29.7C640 351 575 416 494.9 416c-38.5 0-75.4-15.3-102.6-42.5L320 301.3l-72.2 72.2C220.5 400.7 183.6 416 145.1 416C65 416 0 351 0 270.9V241.1zM274.7 256l-72.2-72.2c-15.2-15.2-35.9-23.8-57.4-23.8C100.3 160 64 196.3 64 241.1v29.7c0 44.8 36.3 81.1 81.1 81.1c21.5 0 42.2-8.5 57.4-23.8L274.7 256zm90.5 0l72.2 72.2c15.2 15.2 35.9 23.8 57.4 23.8c44.8 0 81.1-36.3 81.1-81.1V241.1c0-44.8-36.3-81.1-81.1-81.1c-21.5 0-42.2 8.5-57.4 23.8L365.3 256z"]
            }, tK = {
              prefix: "fas",
              iconName: "vial-circle-check",
              icon: [512, 512, [], "e596", "M0 64C0 46.3 14.3 32 32 32H96h64 64c17.7 0 32 14.3 32 32s-14.3 32-32 32V266.8c-20.2 28.6-32 63.5-32 101.2c0 25.2 5.3 49.1 14.8 70.8C189.5 463.7 160.6 480 128 480c-53 0-96-43-96-96V96C14.3 96 0 81.7 0 64zM96 96v96h64V96H96zM224 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L352 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
            }, rK = {
              prefix: "fas",
              iconName: "person-arrow-down-to-line",
              icon: [640, 512, [], "e538", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 352V352h16v96H184zm-64 0H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H152h80H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H264V256.9l28.6 47.5c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-58.3-97c-17.4-28.9-48.6-46.6-82.3-46.6H177.1c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9V448zM464 64V306.7l-25.4-25.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l80 80c12.5 12.5 32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L528 306.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
            }, nK = {
              prefix: "fas",
              iconName: "voicemail",
              icon: [640, 512, [], "f897", "M144 320a80 80 0 1 1 0-160 80 80 0 1 1 0 160zm119.8 0c15.3-22.9 24.2-50.4 24.2-80c0-79.5-64.5-144-144-144S0 160.5 0 240s64.5 144 144 144H496c79.5 0 144-64.5 144-144s-64.5-144-144-144s-144 64.5-144 144c0 29.6 8.9 57.1 24.2 80H263.8zM496 160a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
            }, iK = {
              prefix: "fas",
              iconName: "fan",
              icon: [512, 512, [], "f863", "M258.6 0c-1.7 0-3.4 .1-5.1 .5C168 17 115.6 102.3 130.5 189.3c2.9 17 8.4 32.9 15.9 47.4L32 224H29.4C13.2 224 0 237.2 0 253.4c0 1.7 .1 3.4 .5 5.1C17 344 102.3 396.4 189.3 381.5c17-2.9 32.9-8.4 47.4-15.9L224 480v2.6c0 16.2 13.2 29.4 29.4 29.4c1.7 0 3.4-.1 5.1-.5C344 495 396.4 409.7 381.5 322.7c-2.9-17-8.4-32.9-15.9-47.4L480 288h2.6c16.2 0 29.4-13.2 29.4-29.4c0-1.7-.1-3.4-.5-5.1C495 168 409.7 115.6 322.7 130.5c-17 2.9-32.9 8.4-47.4 15.9L288 32V29.4C288 13.2 274.8 0 258.6 0zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, sK = {
              prefix: "fas",
              iconName: "person-walking-luggage",
              icon: [576, 512, [], "e554", "M432 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM347.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L505 232.7l-15.3-36.8C472.5 154.8 432.3 128 387.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1l-25 62.4-59.4 59.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L340.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM256 274.1c-7.7-4.4-17.4-1.8-21.9 5.9l-32 55.4L147.7 304c-15.3-8.8-34.9-3.6-43.7 11.7L40 426.6c-8.8 15.3-3.6 34.9 11.7 43.7l55.4 32c15.3 8.8 34.9 3.6 43.7-11.7l64-110.9c1.5-2.6 2.6-5.2 3.3-8L261.9 296c4.4-7.7 1.8-17.4-5.9-21.9z"]
            }, bk = {
              prefix: "fas",
              iconName: "up-down",
              icon: [256, 512, [8597, 11021, "arrows-alt-v"], "f338", "M145.6 7.7C141 2.8 134.7 0 128 0s-13 2.8-17.6 7.7l-104 112c-6.5 7-8.2 17.2-4.4 25.9S14.5 160 24 160H80V352H24c-9.5 0-18.2 5.7-22 14.4s-2.1 18.9 4.4 25.9l104 112c4.5 4.9 10.9 7.7 17.6 7.7s13-2.8 17.6-7.7l104-112c6.5-7 8.2-17.2 4.4-25.9s-12.5-14.4-22-14.4H176V160h56c9.5 0 18.2-5.7 22-14.4s2.1-18.9-4.4-25.9l-104-112z"]
            }, aK = bk, oK = {
              prefix: "fas",
              iconName: "cloud-moon-rain",
              icon: [576, 512, [], "f73c", "M481.2 0C417 0 363.5 46.5 353.7 107.6c35.4 17.6 60.2 53.3 62.1 95.1c23.2 11 42 29.7 53.1 52.7c4 .4 8.1 .6 12.3 .6c34.9 0 66.7-13.8 89.9-36.1c5.1-4.9 6.4-12.5 3.2-18.7s-10.1-9.7-17-8.6c-4.9 .8-10 1.3-15.2 1.3c-49 0-88.4-39.3-88.4-87.4c0-32.6 18-61.1 44.9-76.1c6.1-3.4 9.3-10.5 7.8-17.4s-7.3-12-14.3-12.6c-3.6-.3-7.3-.5-10.9-.5zM367.9 383.9c44.2 0 80-35.8 80-80c0-39.3-28.4-72.1-65.8-78.7c1.2-5.6 1.9-11.3 1.9-17.2c0-44.2-35.8-80-80-80c-17 0-32.8 5.3-45.8 14.4C241.3 114.6 210.8 96 176 96c-53 0-96 43-96 96l0 1.3c-45.4 7.6-80 47.1-80 94.6c0 53 43 96 96 96H367.9zM85.4 420.1c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3zm96 0c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3zm96 0c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3zm96 0c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3z"]
            }, fK = {
              prefix: "fas",
              iconName: "calendar",
              icon: [448, 512, [128197, 128198], "f133", "M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"]
            }, AK = {
              prefix: "fas",
              iconName: "trailer",
              icon: [640, 512, [], "e041", "M48 32C21.5 32 0 53.5 0 80V336c0 26.5 21.5 48 48 48H65.1c7.8-54.3 54.4-96 110.9-96s103.1 41.7 110.9 96H488h8H608c17.7 0 32-14.3 32-32s-14.3-32-32-32H544V80c0-26.5-21.5-48-48-48H48zM80 96c8.8 0 16 7.2 16 16l0 131.2c-11.4 5.9-22.2 12.9-32 21V112c0-8.8 7.2-16 16-16zm96 128c-5.4 0-10.7 .2-16 .7L160 112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112.7c-5.3-.5-10.6-.7-16-.7zm80 19.2L256 112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 152.2c-9.8-8.1-20.6-15.2-32-21zM368 96c8.8 0 16 7.2 16 16l0 192c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-192c0-8.8 7.2-16 16-16zm112 16l0 192c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-192c0-8.8 7.2-16 16-16s16 7.2 16 16zM176 480a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-112a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, xk = {
              prefix: "fas",
              iconName: "bahai",
              icon: [576, 512, ["haykal"], "f666", "M288 0c14.5 0 27.2 9.7 30.9 23.8l23.9 89.6 75.9-53.3c11.9-8.3 27.8-7.6 39 1.7s14.6 24.9 8.4 38.1l-39.3 84 92.4 8c14.4 1.2 26.2 12 28.8 26.3s-4.9 28.5-18 34.6l-84.1 39.1 65.7 65.5c10.3 10.2 12.4 26.1 5.1 38.7s-22 18.7-36 14.9L391 386.8l8.2 92.4c1.3 14.4-7.3 27.9-20.9 32.9s-28.9 .1-37.2-11.7l-53.1-76-53.1 76c-8.3 11.9-23.6 16.7-37.2 11.7s-22.2-18.5-20.9-32.9l8.2-92.4L95.4 410.9c-14 3.8-28.8-2.3-36-14.9s-5.2-28.4 5.1-38.7l65.7-65.5L46 252.7c-13.1-6.1-20.5-20.3-18-34.6s14.3-25.1 28.8-26.3l92.4-8-39.3-84c-6.1-13.1-2.7-28.8 8.4-38.1s27.1-10 39-1.7l75.9 53.3 23.9-89.6C260.8 9.7 273.5 0 288 0zm0 156.2l-4.8 18c-2.7 10.1-10.2 18.2-20 21.8s-20.8 2.1-29.3-3.9l-15.2-10.7 7.9 16.8c4.4 9.5 4 20.5-1.3 29.6s-14.5 15-25 15.9l-18.5 1.6 16.8 7.8c9.5 4.4 16.2 13.2 18 23.5s-1.5 20.8-8.9 28.2l-13.2 13.1 17.9-4.8c10.1-2.7 20.9-.3 28.9 6.4s12.2 16.9 11.3 27.3l-1.6 18.5 10.6-15.2c6-8.6 15.8-13.7 26.2-13.7s20.2 5.1 26.2 13.7l10.6 15.2-1.6-18.5c-.9-10.4 3.3-20.6 11.3-27.3s18.8-9.1 28.9-6.4l17.9 4.8-13.2-13.1c-7.4-7.4-10.7-17.9-8.9-28.2s8.5-19.1 18-23.5l16.8-7.8-18.5-1.6c-10.4-.9-19.7-6.8-25-15.9s-5.7-20.1-1.3-29.6l7.9-16.8-15.2 10.7c-8.6 6-19.5 7.5-29.3 3.9s-17.3-11.7-20-21.8l-4.8-18z"]
            }, dK = xk, vK = {
              prefix: "fas",
              iconName: "sd-card",
              icon: [384, 512, [], "f7c2", "M320 0H141.3C124.3 0 108 6.7 96 18.7L18.7 96C6.7 108 0 124.3 0 141.3V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64zM160 88v48c0 13.3-10.7 24-24 24s-24-10.7-24-24V88c0-13.3 10.7-24 24-24s24 10.7 24 24zm80 0v48c0 13.3-10.7 24-24 24s-24-10.7-24-24V88c0-13.3 10.7-24 24-24s24 10.7 24 24zm80 0v48c0 13.3-10.7 24-24 24s-24-10.7-24-24V88c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
            }, uK = {
              prefix: "fas",
              iconName: "dragon",
              icon: [640, 512, [128009], "f6d5", "M352 124.5l-51.9-13c-6.5-1.6-11.3-7.1-12-13.8s2.8-13.1 8.7-16.1l40.8-20.4L294.4 28.8c-5.5-4.1-7.8-11.3-5.6-17.9S297.1 0 304 0H416h32 16c30.2 0 58.7 14.2 76.8 38.4l57.6 76.8c6.2 8.3 9.6 18.4 9.6 28.8c0 26.5-21.5 48-48 48H538.5c-17 0-33.3-6.7-45.3-18.7L480 160H448v21.5c0 24.8 12.8 47.9 33.8 61.1l106.6 66.6c32.1 20.1 51.6 55.2 51.6 93.1C640 462.9 590.9 512 530.2 512H496 432 32.3c-3.3 0-6.6-.4-9.6-1.4C13.5 507.8 6 501 2.4 492.1C1 488.7 .2 485.2 0 481.4c-.2-3.7 .3-7.3 1.3-10.7c2.8-9.2 9.6-16.7 18.6-20.4c3-1.2 6.2-2 9.5-2.2L433.3 412c8.3-.7 14.7-7.7 14.7-16.1c0-4.3-1.7-8.4-4.7-11.4l-44.4-44.4c-30-30-46.9-70.7-46.9-113.1V181.5v-57zM512 72.3c0-.1 0-.2 0-.3s0-.2 0-.3v.6zm-1.3 7.4L464.3 68.1c-.2 1.3-.3 2.6-.3 3.9c0 13.3 10.7 24 24 24c10.6 0 19.5-6.8 22.7-16.3zM130.9 116.5c16.3-14.5 40.4-16.2 58.5-4.1l130.6 87V227c0 32.8 8.4 64.8 24 93H112c-6.7 0-12.7-4.2-15-10.4s-.5-13.3 4.6-17.7L171 232.3 18.4 255.8c-7 1.1-13.9-2.6-16.9-9s-1.5-14.1 3.8-18.8L130.9 116.5z"]
            }, lK = {
              prefix: "fas",
              iconName: "shoe-prints",
              icon: [640, 512, [], "f54b", "M416 0C352.3 0 256 32 256 32V160c48 0 76 16 104 32s56 32 104 32c56.4 0 176-16 176-96S512 0 416 0zM128 96c0 35.3 28.7 64 64 64h32V32H192c-35.3 0-64 28.7-64 64zM288 512c96 0 224-48 224-128s-119.6-96-176-96c-48 0-76 16-104 32s-56 32-104 32V480s96.3 32 160 32zM0 416c0 35.3 28.7 64 64 64H96V352H64c-35.3 0-64 28.7-64 64z"]
            }, Dk = {
              prefix: "fas",
              iconName: "circle-plus",
              icon: [512, 512, ["plus-circle"], "f055", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344V280H168c-13.3 0-24-10.7-24-24s10.7-24 24-24h64V168c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H280v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]
            }, PK = Dk, jk = {
              prefix: "fas",
              iconName: "face-grin-tongue-wink",
              icon: [512, 512, [128540, "grin-tongue-wink"], "f58b", "M174.5 498.8C73.1 464.7 0 368.9 0 256C0 114.6 114.6 0 256 0S512 114.6 512 256c0 112.9-73.1 208.7-174.5 242.8C346.7 484 352 466.6 352 448V401.1c24.3-17.5 43.6-41.6 55.4-69.6c5-11.8-7-22.5-19.3-18.7c-39.7 12.2-84.5 19-131.8 19s-92.1-6.8-131.8-19c-12.3-3.8-24.3 6.9-19.3 18.7c11.7 27.8 30.8 51.7 54.8 69.2V448c0 18.6 5.3 36 14.5 50.8zm20.7-265.2c5.3 7.1 15.3 8.5 22.4 3.2s8.5-15.3 3.2-22.4c-30.4-40.5-91.2-40.5-121.6 0c-5.3 7.1-3.9 17.1 3.2 22.4s17.1 3.9 22.4-3.2c17.6-23.5 52.8-23.5 70.4 0zM336 272a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM320 402.6V448c0 35.3-28.7 64-64 64s-64-28.7-64-64V402.6c0-14.7 11.9-26.6 26.6-26.6h2c11.3 0 21.1 7.9 23.6 18.9c2.8 12.6 20.8 12.6 23.6 0c2.5-11.1 12.3-18.9 23.6-18.9h2c14.7 0 26.6 11.9 26.6 26.6zM336 184a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, cK = jk, pK = {
              prefix: "fas",
              iconName: "hand-holding",
              icon: [576, 512, [], "f4bd", "M559.7 392.2c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 416H272c-8.8 0-16-7.2-16-16s7.2-16 16-16h16 64c17.7 0 32-14.3 32-32s-14.3-32-32-32H288 272 193.7c-29.1 0-57.3 9.9-80 28L68.8 384H32c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32H192 352.5c29 0 57.3-9.3 80.7-26.5l126.6-93.3zm-366.1-8.3a.5 .5 0 1 1 -.9 .1 .5 .5 0 1 1 .9-.1z"]
            }, hK = {
              prefix: "fas",
              iconName: "plug-circle-exclamation",
              icon: [576, 512, [], "e55d", "M96 0C78.3 0 64 14.3 64 32v96h64V32c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32v96h64V32c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32v32c0 77.4 55 142 128 156.8V480c0 17.7 14.3 32 32 32s32-14.3 32-32V412.8c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32H32zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16v80c0 8.8-7.2 16-16 16s-16-7.2-16-16V288c0-8.8 7.2-16 16-16z"]
            }, aI = {
              prefix: "fas",
              iconName: "link-slash",
              icon: [640, 512, ["chain-broken", "chain-slash", "unlink"], "f127", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L489.3 358.2l90.5-90.5c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114l-96 96-31.9-25C430.9 239.6 420.1 175.1 377 132c-52.2-52.3-134.5-56.2-191.3-11.7L38.8 5.1zM239 162c30.1-14.9 67.7-9.9 92.8 15.3c20 20 27.5 48.3 21.7 74.5L239 162zM406.6 416.4L220.9 270c-2.1 39.8 12.2 80.1 42.2 110c38.9 38.9 94.4 51 143.6 36.3zm-290-228.5L60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5l61.8-61.8-50.6-39.9z"]
            }, gK = aI, XK = aI, TK = aI, qK = {
              prefix: "fas",
              iconName: "clone",
              icon: [512, 512, [], "f24d", "M288 448H64V224h64V160H64c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H288c35.3 0 64-28.7 64-64V384H288v64zm-64-96H448c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H224c-35.3 0-64 28.7-64 64V288c0 35.3 28.7 64 64 64z"]
            }, bK = {
              prefix: "fas",
              iconName: "person-walking-arrow-loop-left",
              icon: [640, 512, [], "e551", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zm347.7 119c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L461.3 384H480c88.4 0 160-71.6 160-160s-71.6-160-160-160L352 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c53 0 96 43 96 96s-43 96-96 96H461.3l25.4-25.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3l80 80z"]
            }, wk = {
              prefix: "fas",
              iconName: "arrow-up-z-a",
              icon: [576, 512, ["sort-alpha-up-alt"], "f882", "M183.6 42.4C177.5 35.8 169 32 160 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L128 146.3V448c0 17.7 14.3 32 32 32s32-14.3 32-32V146.3l32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 64c0 17.7 14.3 32 32 32h50.7l-73.4 73.4c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H429.3l73.4-73.4c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8H352c-17.7 0-32 14.3-32 32zm96 192c-12.1 0-23.2 6.8-28.6 17.7l-64 128-16 32c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l7.2-14.3h88.4l7.2 14.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9l-16-32-64-128C439.2 262.8 428.1 256 416 256zM395.8 400L416 359.6 436.2 400H395.8z"]
            }, xK = wk, mk = {
              prefix: "fas",
              iconName: "fire-flame-curved",
              icon: [384, 512, ["fire-alt"], "f7e4", "M153.6 29.9l16-21.3C173.6 3.2 180 0 186.7 0C198.4 0 208 9.6 208 21.3V43.5c0 13.1 5.4 25.7 14.9 34.7L307.6 159C356.4 205.6 384 270.2 384 337.7C384 434 306 512 209.7 512H192C86 512 0 426 0 320v-3.8c0-48.8 19.4-95.6 53.9-130.1l3.5-3.5c4.2-4.2 10-6.6 16-6.6C85.9 176 96 186.1 96 198.6V288c0 35.3 28.7 64 64 64s64-28.7 64-64v-3.9c0-18-7.2-35.3-19.9-48l-38.6-38.6c-24-24-37.5-56.7-37.5-90.7c0-27.7 9-54.8 25.6-76.9z"]
            }, DK = mk, jK = {
              prefix: "fas",
              iconName: "tornado",
              icon: [448, 512, [127786], "f76f", "M0 32V45.6C0 62.7 1.7 79.6 5 96H357.8c3.2-6.9 7.5-13.3 13-18.8l38.6-38.6c4.2-4.2 6.6-10 6.6-16C416 10.1 405.9 0 393.4 0H32C14.3 0 0 14.3 0 32zm352.2 96H13.6c12.2 35.9 32.3 68.7 58.8 96H412l-47.2-62.9c-7.3-9.7-11.6-21.2-12.6-33.1zm-226 138.2l116.4 68.5c8.2 4.8 15.8 10.7 22.5 17.3H445c2-9.8 3-19.9 3-30.1c0-23-5.3-45.5-15.3-65.9H110.2c5.2 3.6 10.5 7 16 10.2zM288 384c10.3 21.4 13.8 45.5 9.9 69l-5.9 35.7c-2 12.2 7.4 23.4 19.8 23.4c5.3 0 10.4-2.1 14.2-5.9l78.2-78.2c12.8-12.8 23.1-27.7 30.4-43.9H288z"]
            }, wK = {
              prefix: "fas",
              iconName: "file-circle-plus",
              icon: [576, 512, [58606], "e494", "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384v38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm16 80c0-8.8-7.2-16-16-16s-16 7.2-16 16v48H368c-8.8 0-16 7.2-16 16s7.2 16 16 16h48v48c0 8.8 7.2 16 16 16s16-7.2 16-16V384h48c8.8 0 16-7.2 16-16s-7.2-16-16-16H448V304z"]
            }, Bk = {
              prefix: "fas",
              iconName: "book-quran",
              icon: [448, 512, ["quran"], "f687", "M352 0c53 0 96 43 96 96V416c0 53-43 96-96 96H64 32c-17.7 0-32-14.3-32-32s14.3-32 32-32V384c-17.7 0-32-14.3-32-32V32C0 14.3 14.3 0 32 0H64 352zm0 384H96v64H352c17.7 0 32-14.3 32-32s-14.3-32-32-32zM274.1 150.2l-8.9 21.4-23.1 1.9c-5.7 .5-8 7.5-3.7 11.2L256 199.8l-5.4 22.6c-1.3 5.5 4.7 9.9 9.6 6.9L280 217.2l19.8 12.1c4.9 3 10.9-1.4 9.6-6.9L304 199.8l17.6-15.1c4.3-3.7 2-10.8-3.7-11.2l-23.1-1.9-8.9-21.4c-2.2-5.3-9.6-5.3-11.8 0zM96 192c0 70.7 57.3 128 128 128c25.6 0 49.5-7.5 69.5-20.5c3.2-2.1 4.5-6.2 3.1-9.7s-5.2-5.6-9-4.8c-6.1 1.2-12.5 1.9-19 1.9c-52.4 0-94.9-42.5-94.9-94.9s42.5-94.9 94.9-94.9c6.5 0 12.8 .7 19 1.9c3.8 .8 7.5-1.3 9-4.8s.2-7.6-3.1-9.7C273.5 71.5 249.6 64 224 64C153.3 64 96 121.3 96 192z"]
            }, mK = Bk, BK = {
              prefix: "fas",
              iconName: "anchor",
              icon: [576, 512, [9875], "f13d", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80H224c-17.7 0-32 14.3-32 32s14.3 32 32 32h32V448H208c-53 0-96-43-96-96v-6.1l7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7V352c0 88.4 71.6 160 160 160h80 80c88.4 0 160-71.6 160-160v-6.1l7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-56-56c-9.4-9.4-24.6-9.4-33.9 0l-56 56c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7V352c0 53-43 96-96 96H320V240h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H341.1z"]
            }, WK = {
              prefix: "fas",
              iconName: "border-all",
              icon: [448, 512, [], "f84c", "M384 96V224H256V96H384zm0 192V416H256V288H384zM192 224H64V96H192V224zM64 288H192V416H64V288zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"]
            }, Wk = {
              prefix: "fas",
              iconName: "face-angry",
              icon: [512, 512, [128544, "angry"], "f556", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM338.7 395.9c6.6-5.9 7.1-16 1.2-22.6C323.8 355.4 295.7 336 256 336s-67.8 19.4-83.9 37.3c-5.9 6.6-5.4 16.7 1.2 22.6s16.7 5.4 22.6-1.2c11.7-13 31.6-26.7 60.1-26.7s48.4 13.7 60.1 26.7c5.9 6.6 16 7.1 22.6 1.2zM176.4 272c17.7 0 32-14.3 32-32c0-1.5-.1-3-.3-4.4l10.9 3.6c8.4 2.8 17.4-1.7 20.2-10.1s-1.7-17.4-10.1-20.2l-96-32c-8.4-2.8-17.4 1.7-20.2 10.1s1.7 17.4 10.1 20.2l30.7 10.2c-5.8 5.8-9.3 13.8-9.3 22.6c0 17.7 14.3 32 32 32zm192-32c0-8.9-3.6-17-9.5-22.8l30.2-10.1c8.4-2.8 12.9-11.9 10.1-20.2s-11.9-12.9-20.2-10.1l-96 32c-8.4 2.8-12.9 11.9-10.1 20.2s11.9 12.9 20.2 10.1l11.7-3.9c-.2 1.5-.3 3.1-.3 4.7c0 17.7 14.3 32 32 32s32-14.3 32-32z"]
            }, SK = Wk, UK = {
              prefix: "fas",
              iconName: "cookie-bite",
              icon: [512, 512, [], "f564", "M257.5 27.6c-.8-5.4-4.9-9.8-10.3-10.6c-22.1-3.1-44.6 .9-64.4 11.4l-74 39.5C89.1 78.4 73.2 94.9 63.4 115L26.7 190.6c-9.8 20.1-13 42.9-9.1 64.9l14.5 82.8c3.9 22.1 14.6 42.3 30.7 57.9l60.3 58.4c16.1 15.6 36.6 25.6 58.7 28.7l83 11.7c22.1 3.1 44.6-.9 64.4-11.4l74-39.5c19.7-10.5 35.6-27 45.4-47.2l36.7-75.5c9.8-20.1 13-42.9 9.1-64.9c-.9-5.3-5.3-9.3-10.6-10.1c-51.5-8.2-92.8-47.1-104.5-97.4c-1.8-7.6-8-13.4-15.7-14.6c-54.6-8.7-97.7-52-106.2-106.8zM208 144a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM144 336a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm224-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, IK = {
              prefix: "fas",
              iconName: "arrow-trend-down",
              icon: [576, 512, [], "e097", "M384 352c-17.7 0-32 14.3-32 32s14.3 32 32 32H544c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32s-32 14.3-32 32v82.7L342.6 137.4c-12.5-12.5-32.8-12.5-45.3 0L192 242.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0L320 205.3 466.7 352H384z"]
            }, Sk = {
              prefix: "fas",
              iconName: "rss",
              icon: [448, 512, ["feed"], "f09e", "M0 64C0 46.3 14.3 32 32 32c229.8 0 416 186.2 416 416c0 17.7-14.3 32-32 32s-32-14.3-32-32C384 253.6 226.4 96 32 96C14.3 96 0 81.7 0 64zM0 416a64 64 0 1 1 128 0A64 64 0 1 1 0 416zM32 160c159.1 0 288 128.9 288 288c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-123.7-100.3-224-224-224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, RK = Sk, VK = {
              prefix: "fas",
              iconName: "draw-polygon",
              icon: [448, 512, [], "f5ee", "M96 151.4V360.6c9.7 5.6 17.8 13.7 23.4 23.4H328.6c0-.1 .1-.2 .1-.3l-4.5-7.9-32-56 0 0c-1.4 .1-2.8 .1-4.2 .1c-35.3 0-64-28.7-64-64s28.7-64 64-64c1.4 0 2.8 0 4.2 .1l0 0 32-56 4.5-7.9-.1-.3H119.4c-5.6 9.7-13.7 17.8-23.4 23.4zM384.3 352c35.2 .2 63.7 28.7 63.7 64c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H119.4c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V151.4C12.9 140.4 0 119.7 0 96C0 60.7 28.7 32 64 32c23.7 0 44.4 12.9 55.4 32H328.6c11.1-19.1 31.7-32 55.4-32c35.3 0 64 28.7 64 64c0 35.3-28.5 63.8-63.7 64l-4.5 7.9-32 56-2.3 4c4.2 8.5 6.5 18 6.5 28.1s-2.3 19.6-6.5 28.1l2.3 4 32 56 4.5 7.9z"]
            }, Uk = {
              prefix: "fas",
              iconName: "scale-balanced",
              icon: [640, 512, [9878, "balance-scale"], "f24e", "M384 32H512c17.7 0 32 14.3 32 32s-14.3 32-32 32H398.4c-5.2 25.8-22.9 47.1-46.4 57.3V448H512c17.7 0 32 14.3 32 32s-14.3 32-32 32H320 128c-17.7 0-32-14.3-32-32s14.3-32 32-32H288V153.3c-23.5-10.3-41.2-31.6-46.4-57.3H128c-17.7 0-32-14.3-32-32s14.3-32 32-32H256c14.6-19.4 37.8-32 64-32s49.4 12.6 64 32zm55.6 288H584.4L512 195.8 439.6 320zM512 416c-62.9 0-115.2-34-126-78.9c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1C627.2 382 574.9 416 512 416zM126.8 195.8L54.4 320H199.3L126.8 195.8zM.9 337.1c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1C242 382 189.7 416 126.8 416S11.7 382 .9 337.1z"]
            }, CK = Uk, nC = {
              prefix: "fas",
              iconName: "gauge-simple-high",
              icon: [512, 512, [61668, "tachometer", "tachometer-fast"], "f62a", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm320 96c0-15.9-5.8-30.4-15.3-41.6l76.6-147.4c6.1-11.8 1.5-26.3-10.2-32.4s-26.2-1.5-32.4 10.2L262.1 288.3c-2-.2-4-.3-6.1-.3c-35.3 0-64 28.7-64 64s28.7 64 64 64s64-28.7 64-64z"]
            }, OK = nC, yK = nC, kK = {
              prefix: "fas",
              iconName: "shower",
              icon: [512, 512, [128703], "f2cc", "M64 131.9C64 112.1 80.1 96 99.9 96c9.5 0 18.6 3.8 25.4 10.5l16.2 16.2c-21 38.9-17.4 87.5 10.9 123L151 247c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0L345 121c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-1.3 1.3c-35.5-28.3-84.2-31.9-123-10.9L170.5 61.3C151.8 42.5 126.4 32 99.9 32C44.7 32 0 76.7 0 131.9V448c0 17.7 14.3 32 32 32s32-14.3 32-32V131.9zM256 352a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm32-32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, Ik = {
              prefix: "fas",
              iconName: "desktop",
              icon: [576, 512, [128421, 61704, "desktop-alt"], "f390", "M64 0C28.7 0 0 28.7 0 64V352c0 35.3 28.7 64 64 64H240l-10.7 32H160c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H346.7L336 416H512c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM512 64V288H64V64H512z"]
            }, EK = Ik, FK = {
              prefix: "fas",
              iconName: "m",
              icon: [448, 512, [109], "4d", "M22.7 33.4c13.5-4.1 28.1 1.1 35.9 12.9L224 294.3 389.4 46.2c7.8-11.7 22.4-17 35.9-12.9S448 49.9 448 64V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V169.7L250.6 369.8c-5.9 8.9-15.9 14.2-26.6 14.2s-20.7-5.3-26.6-14.2L64 169.7V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V64C0 49.9 9.2 37.5 22.7 33.4z"]
            }, Rk = {
              prefix: "fas",
              iconName: "table-list",
              icon: [512, 512, ["th-list"], "f00b", "M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zm64 0v64h64V96H64zm384 0H192v64H448V96zM64 224v64h64V224H64zm384 0H192v64H448V224zM64 352v64h64V352H64zm384 0H192v64H448V352z"]
            }, NK = Rk, Vk = {
              prefix: "fas",
              iconName: "comment-sms",
              icon: [512, 512, ["sms"], "f7cd", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3 0 0 0 0 0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM202.9 176.8c6.5-2.2 13.7 .1 17.9 5.6L256 229.3l35.2-46.9c4.1-5.5 11.3-7.8 17.9-5.6s10.9 8.3 10.9 15.2v96c0 8.8-7.2 16-16 16s-16-7.2-16-16V240l-19.2 25.6c-3 4-7.8 6.4-12.8 6.4s-9.8-2.4-12.8-6.4L224 240v48c0 8.8-7.2 16-16 16s-16-7.2-16-16V192c0-6.9 4.4-13 10.9-15.2zm173.1 38c0 .2 0 .4 0 .4c.1 .1 .6 .8 2.2 1.7c3.9 2.3 9.6 4.1 18.3 6.8l.6 .2c7.4 2.2 17.3 5.2 25.2 10.2c9.1 5.7 17.4 15.2 17.6 29.9c.2 15-7.6 26-17.8 32.3c-9.5 5.9-20.9 7.9-30.7 7.6c-12.2-.4-23.7-4.4-32.6-7.4l0 0 0 0c-1.4-.5-2.7-.9-4-1.4c-8.4-2.8-12.9-11.9-10.1-20.2s11.9-12.9 20.2-10.1c1.7 .6 3.3 1.1 4.9 1.6l0 0 0 0c9.1 3.1 15.6 5.3 22.6 5.5c5.3 .2 10-1 12.8-2.8c1.2-.8 1.8-1.5 2.1-2c.2-.4 .6-1.2 .6-2.7l0-.2c0-.7 0-1.4-2.7-3.1c-3.8-2.4-9.6-4.3-18-6.9l-1.2-.4c-7.2-2.2-16.7-5-24.3-9.6c-9-5.4-17.7-14.7-17.7-29.4c-.1-15.2 8.6-25.7 18.5-31.6c9.4-5.5 20.5-7.5 29.7-7.4c10 .2 19.7 2.3 27.9 4.4c8.5 2.3 13.6 11 11.3 19.6s-11 13.6-19.6 11.3c-7.3-1.9-14.1-3.3-20.1-3.4c-4.9-.1-9.8 1.1-12.9 2.9c-1.4 .8-2.1 1.6-2.4 2c-.2 .3-.4 .8-.4 1.9zm-272 0c0 .2 0 .4 0 .4c.1 .1 .6 .8 2.2 1.7c3.9 2.3 9.6 4.1 18.3 6.8l.6 .2c7.4 2.2 17.3 5.2 25.2 10.2c9.1 5.7 17.4 15.2 17.6 29.9c.2 15-7.6 26-17.8 32.3c-9.5 5.9-20.9 7.9-30.7 7.6c-12.3-.4-24.2-4.5-33.2-7.6l0 0 0 0c-1.3-.4-2.5-.8-3.6-1.2c-8.4-2.8-12.9-11.9-10.1-20.2s11.9-12.9 20.2-10.1c1.4 .5 2.8 .9 4.1 1.4l0 0 0 0c9.5 3.2 16.5 5.6 23.7 5.8c5.3 .2 10-1 12.8-2.8c1.2-.8 1.8-1.5 2.1-2c.2-.4 .6-1.2 .6-2.7l0-.2c0-.7 0-1.4-2.7-3.1c-3.8-2.4-9.6-4.3-18-6.9l-1.2-.4 0 0c-7.2-2.2-16.7-5-24.3-9.6C80.8 239 72.1 229.7 72 215c-.1-15.2 8.6-25.7 18.5-31.6c9.4-5.5 20.5-7.5 29.7-7.4c9.5 .1 22.2 2.1 31.1 4.4c8.5 2.3 13.6 11 11.3 19.6s-11 13.6-19.6 11.3c-6.6-1.8-16.8-3.3-23.3-3.4c-4.9-.1-9.8 1.1-12.9 2.9c-1.4 .8-2.1 1.6-2.4 2c-.2 .3-.4 .8-.4 1.9z"]
            }, QK = Vk, YK = {
              prefix: "fas",
              iconName: "book",
              icon: [448, 512, [128212], "f02d", "M96 0C43 0 0 43 0 96V416c0 53 43 96 96 96H384h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V384c17.7 0 32-14.3 32-32V32c0-17.7-14.3-32-32-32H384 96zm0 384H352v64H96c-17.7 0-32-14.3-32-32s14.3-32 32-32zm32-240c0-8.8 7.2-16 16-16H336c8.8 0 16 7.2 16 16s-7.2 16-16 16H144c-8.8 0-16-7.2-16-16zm16 48H336c8.8 0 16 7.2 16 16s-7.2 16-16 16H144c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, MK = {
              prefix: "fas",
              iconName: "user-plus",
              icon: [640, 512, [], "f234", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3zM504 312V248H440c-13.3 0-24-10.7-24-24s10.7-24 24-24h64V136c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H552v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]
            }, LK = {
              prefix: "fas",
              iconName: "check",
              icon: [448, 512, [10003, 10004], "f00c", "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"]
            }, Ck = {
              prefix: "fas",
              iconName: "battery-three-quarters",
              icon: [576, 512, ["battery-4"], "f241", "M464 160c8.8 0 16 7.2 16 16V336c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16H464zM80 96C35.8 96 0 131.8 0 176V336c0 44.2 35.8 80 80 80H464c44.2 0 80-35.8 80-80V320c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32V176c0-44.2-35.8-80-80-80H80zm272 96H96V320H352V192z"]
            }, KK = Ck, JK = {
              prefix: "fas",
              iconName: "house-circle-check",
              icon: [640, 512, [], "e509", "M320.7 352c8.1-89.7 83.5-160 175.3-160c8.9 0 17.6 .7 26.1 1.9L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1h32v69.7c-.1 .9-.1 1.8-.1 2.8V472c0 22.1 17.9 40 40 40h16c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2H160h24c22.1 0 40-17.9 40-40V448 384c0-17.7 14.3-32 32-32h64l.7 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
            }, zK = {
              prefix: "fas",
              iconName: "angle-left",
              icon: [320, 512, [8249], "f104", "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]
            }, GK = {
              prefix: "fas",
              iconName: "diagram-successor",
              icon: [512, 512, [], "e47a", "M512 416l0-64c0-35.3-28.7-64-64-64L64 288c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64zM64 160l0-64 144 0 16 0 0 64L64 160zm224 0l0-64 80 0c8.8 0 16 7.2 16 16l0 16-38.1 0c-21.4 0-32.1 25.9-17 41L399 239c9.4 9.4 24.6 9.4 33.9 0L503 169c15.1-15.1 4.4-41-17-41L448 128l0-16c0-44.2-35.8-80-80-80L224 32l-16 0L64 32C28.7 32 0 60.7 0 96l0 64c0 35.3 28.7 64 64 64l160 0c35.3 0 64-28.7 64-64z"]
            }, ZK = {
              prefix: "fas",
              iconName: "truck-arrow-right",
              icon: [640, 512, [], "e58b", "M0 48C0 21.5 21.5 0 48 0H368c26.5 0 48 21.5 48 48V96h50.7c17 0 33.3 6.7 45.3 18.7L589.3 192c12 12 18.7 28.3 18.7 45.3V256v32 64c17.7 0 32 14.3 32 32s-14.3 32-32 32H576c0 53-43 96-96 96s-96-43-96-96H256c0 53-43 96-96 96s-96-43-96-96H48c-26.5 0-48-21.5-48-48V48zM416 256H544V237.3L466.7 160H416v96zM160 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM257 95c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l39 39H96c-13.3 0-24 10.7-24 24s10.7 24 24 24H262.1l-39 39c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9L257 95z"]
            }, _K = {
              prefix: "fas",
              iconName: "arrows-split-up-and-left",
              icon: [512, 512, [], "e4bc", "M246.6 150.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L352 109.3V384c0 35.3 28.7 64 64 64h64c17.7 0 32 14.3 32 32s-14.3 32-32 32H416c-70.7 0-128-57.3-128-128c0-35.3-28.7-64-64-64H109.3l41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L109.3 256H224c23.3 0 45.2 6.2 64 17.1V109.3l-41.4 41.4z"]
            }, Ok = {
              prefix: "fas",
              iconName: "hand-fist",
              icon: [448, 512, [9994, "fist-raised"], "f6de", "M192 0c17.7 0 32 14.3 32 32V144H160V32c0-17.7 14.3-32 32-32zM64 64c0-17.7 14.3-32 32-32s32 14.3 32 32v80H64V64zm192 0c0-17.7 14.3-32 32-32s32 14.3 32 32v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V64zm96 64c0-17.7 14.3-32 32-32s32 14.3 32 32v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V128zm-96 88l0-.6c9.4 5.4 20.3 8.6 32 8.6c13.2 0 25.4-4 35.6-10.8c8.7 24.9 32.5 42.8 60.4 42.8c11.7 0 22.6-3.1 32-8.6V256c0 52.3-25.1 98.8-64 128v96c0 17.7-14.3 32-32 32H160c-17.7 0-32-14.3-32-32V401.6c-17.3-7.9-33.2-18.8-46.9-32.5L69.5 357.5C45.5 333.5 32 300.9 32 267V240c0-35.3 28.7-64 64-64h88c22.1 0 40 17.9 40 40s-17.9 40-40 40H128c-8.8 0-16 7.2-16 16s7.2 16 16 16h56c39.8 0 72-32.2 72-72z"]
            }, $K = Ok, eJ = {
              prefix: "fas",
              iconName: "cloud-moon",
              icon: [640, 512, [], "f6c3", "M495.8 0c5.5 0 10.9 .2 16.3 .7c7 .6 12.8 5.7 14.3 12.5s-1.6 13.9-7.7 17.3c-44.4 25.2-74.4 73-74.4 127.8c0 81 65.5 146.6 146.2 146.6c8.6 0 17-.7 25.1-2.1c6.9-1.2 13.8 2.2 17 8.5s1.9 13.8-3.1 18.7c-34.5 33.6-81.7 54.4-133.6 54.4c-9.3 0-18.4-.7-27.4-1.9c-11.2-22.6-29.8-40.9-52.6-51.7c-2.7-58.5-50.3-105.3-109.2-106.7c-1.7-10.4-2.6-21-2.6-31.8C304 86.1 389.8 0 495.8 0zM447.9 431.9c0 44.2-35.8 80-80 80H96c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]
            }, tJ = {
              prefix: "fas",
              iconName: "briefcase",
              icon: [512, 512, [128188], "f0b1", "M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 320 512V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM512 288H320v32c0 17.7-14.3 32-32 32H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V288z"]
            }, rJ = {
              prefix: "fas",
              iconName: "person-falling",
              icon: [512, 512, [], "e546", "M288 0c17.7 0 32 14.3 32 32l0 9.8c0 54.6-27.9 104.6-72.5 133.6l.2 .3L304.5 256l87.5 0c15.1 0 29.3 7.1 38.4 19.2l43.2 57.6c10.6 14.1 7.7 34.2-6.4 44.8s-34.2 7.7-44.8-6.4L384 320l-96 0h-1.4l92.3 142.6c9.6 14.8 5.4 34.6-9.5 44.3s-34.6 5.4-44.3-9.5L164.5 249.2c-2.9 9.2-4.5 19-4.5 29l0 73.8c0 17.7-14.3 32-32 32s-32-14.3-32-32V278.2c0-65.1 39.6-123.7 100.1-147.9C232.3 115.8 256 80.8 256 41.8l0-9.8c0-17.7 14.3-32 32-32zM112 32a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
            }, yk = {
              prefix: "fas",
              iconName: "image-portrait",
              icon: [384, 512, ["portrait"], "f3e0", "M384 64c0-35.3-28.7-64-64-64H64C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64l0-384zM128 192a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM80 356.6c0-37.9 30.7-68.6 68.6-68.6h86.9c37.9 0 68.6 30.7 68.6 68.6c0 15.1-12.3 27.4-27.4 27.4H107.4C92.3 384 80 371.7 80 356.6z"]
            }, nJ = yk, iJ = {
              prefix: "fas",
              iconName: "user-tag",
              icon: [640, 512, [], "f507", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c10 0 18.8-4.9 24.2-12.5l-99.2-99.2c-14.9-14.9-23.3-35.1-23.3-56.1v-33c-15.9-4.7-32.8-7.2-50.3-7.2H178.3zM384 224c-17.7 0-32 14.3-32 32v82.7c0 17 6.7 33.3 18.7 45.3L478.1 491.3c18.7 18.7 49.1 18.7 67.9 0l73.4-73.4c18.7-18.7 18.7-49.1 0-67.9L512 242.7c-12-12-28.3-18.7-45.3-18.7H384zm24 80a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
            }, sJ = {
              prefix: "fas",
              iconName: "rug",
              icon: [640, 512, [], "e569", "M24 64H56 80V88v88 80 80 88 24H56 24c-13.3 0-24-10.7-24-24s10.7-24 24-24h8V360H24c-13.3 0-24-10.7-24-24s10.7-24 24-24h8V280H24c-13.3 0-24-10.7-24-24s10.7-24 24-24h8V200H24c-13.3 0-24-10.7-24-24s10.7-24 24-24h8V112H24C10.7 112 0 101.3 0 88S10.7 64 24 64zm88 0H528V448H112V64zM640 88c0 13.3-10.7 24-24 24h-8v40h8c13.3 0 24 10.7 24 24s-10.7 24-24 24h-8v32h8c13.3 0 24 10.7 24 24s-10.7 24-24 24h-8v32h8c13.3 0 24 10.7 24 24s-10.7 24-24 24h-8v40h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H584 560V424 336 256 176 88 64h24 32c13.3 0 24 10.7 24 24z"]
            }, kk = {
              prefix: "fas",
              iconName: "earth-europe",
              icon: [512, 512, ["globe-europe"], "f7a2", "M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1v9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1h1c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24v4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6H400c8.8 0 16 7.2 16 16s-7.2 16-16 16H379.3c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3h11.3c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16H454c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.7-15.4H251.4c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3v3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3H248c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z"]
            }, aJ = kk, Ek = {
              prefix: "fas",
              iconName: "cart-flatbed-suitcase",
              icon: [640, 512, ["luggage-cart"], "f59d", "M0 32C0 14.3 14.3 0 32 0H48c44.2 0 80 35.8 80 80V368c0 8.8 7.2 16 16 16H608c17.7 0 32 14.3 32 32s-14.3 32-32 32H541.3c1.8 5 2.7 10.4 2.7 16c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-5.6 1-11 2.7-16H253.3c1.8 5 2.7 10.4 2.7 16c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-5.6 1-11 2.7-16H144c-44.2 0-80-35.8-80-80V80c0-8.8-7.2-16-16-16H32C14.3 64 0 49.7 0 32zM432 96V56c0-4.4-3.6-8-8-8H344c-4.4 0-8 3.6-8 8V96h96zM288 96V56c0-30.9 25.1-56 56-56h80c30.9 0 56 25.1 56 56V96 320H288V96zM512 320V96h16c26.5 0 48 21.5 48 48V272c0 26.5-21.5 48-48 48H512zM240 96h16V320H240c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48z"]
            }, oJ = Ek, oI = {
              prefix: "fas",
              iconName: "rectangle-xmark",
              icon: [512, 512, [62164, "rectangle-times", "times-rectangle", "window-close"], "f410", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
            }, fJ = oI, AJ = oI, dJ = oI, vJ = {
              prefix: "fas",
              iconName: "baht-sign",
              icon: [320, 512, [], "e0ac", "M144 0c-17.7 0-32 14.3-32 32V64H37.6C16.8 64 0 80.8 0 101.6V224v41.7V288 406.3c0 23 18.7 41.7 41.7 41.7H112v32c0 17.7 14.3 32 32 32s32-14.3 32-32V448h32c61.9 0 112-50.1 112-112c0-40.1-21.1-75.3-52.7-95.1C280.3 222.6 288 200.2 288 176c0-61.9-50.1-112-112-112V32c0-17.7-14.3-32-32-32zM112 128v96H64V128h48zm64 96V128c26.5 0 48 21.5 48 48s-21.5 48-48 48zm-64 64v96H64V288h48zm64 96V288h32c26.5 0 48 21.5 48 48s-21.5 48-48 48H176z"]
            }, uJ = {
              prefix: "fas",
              iconName: "book-open",
              icon: [576, 512, [128214, 128366], "f518", "M249.6 471.5c10.8 3.8 22.4-4.1 22.4-15.5V78.6c0-4.2-1.6-8.4-5-11C247.4 52 202.4 32 144 32C93.5 32 46.3 45.3 18.1 56.1C6.8 60.5 0 71.7 0 83.8V454.1c0 11.9 12.8 20.2 24.1 16.5C55.6 460.1 105.5 448 144 448c33.9 0 79 14 105.6 23.5zm76.8 0C353 462 398.1 448 432 448c38.5 0 88.4 12.1 119.9 22.6c11.3 3.8 24.1-4.6 24.1-16.5V83.8c0-12.1-6.8-23.3-18.1-27.6C529.7 45.3 482.5 32 432 32c-58.4 0-103.4 20-123 35.6c-3.3 2.6-5 6.8-5 11V456c0 11.4 11.7 19.3 22.4 15.5z"]
            }, Fk = {
              prefix: "fas",
              iconName: "book-journal-whills",
              icon: [448, 512, ["journal-whills"], "f66a", "M0 96C0 43 43 0 96 0H384h32c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32v64c17.7 0 32 14.3 32 32s-14.3 32-32 32H384 96c-53 0-96-43-96-96V96zM64 416c0 17.7 14.3 32 32 32H352V384H96c-17.7 0-32 14.3-32 32zm90.4-234.4l-21.2-21.2c-3 10.1-5.1 20.6-5.1 31.6c0 .2 0 .5 .1 .8s.1 .5 .1 .8L165.2 226c2.5 2.1 3.4 5.8 2.3 8.9c-1.3 3-4.1 5.1-7.5 5.1c-1.9-.1-3.8-.8-5.2-2l-23.6-20.6C142.8 267 186.9 304 240 304s97.3-37 108.9-86.6L325.3 238c-1.4 1.2-3.3 2-5.3 2c-2.2-.1-4.4-1.1-6-2.8c-1.2-1.5-1.9-3.4-2-5.2c.1-2.2 1.1-4.4 2.8-6l37.1-32.5c0-.3 0-.5 .1-.8s.1-.5 .1-.8c0-11-2.1-21.5-5.1-31.6l-21.2 21.2c-3.1 3.1-8.1 3.1-11.3 0s-3.1-8.1 0-11.2l26.4-26.5c-8.2-17-20.5-31.7-35.9-42.6c-2.7-1.9-6.2 1.4-5 4.5c8.5 22.4 3.6 48-13 65.6c-3.2 3.4-3.6 8.9-.9 12.7c9.8 14 12.7 31.9 7.5 48.5c-5.9 19.4-22 34.1-41.9 38.3l-1.4-34.3 12.6 8.6c.6 .4 1.5 .6 2.3 .6c1.5 0 2.7-.8 3.5-2s.6-2.8-.1-4L260 225.4l18-3.6c1.8-.4 3.1-2.1 3.1-4s-1.4-3.5-3.1-3.9l-18-3.7 8.5-14.3c.8-1.2 .9-2.9 .1-4.1s-2-2-3.5-2l-.1 0c-.7 .1-1.5 .3-2.1 .7l-14.1 9.6L244 87.9c-.1-2.2-1.9-3.9-4-3.9s-3.9 1.6-4 3.9l-4.6 110.8-12-8.1c-1.5-1.1-3.6-.9-5 .4s-1.6 3.4-.8 5l8.6 14.3-18 3.7c-1.8 .4-3.1 2-3.1 3.9s1.4 3.6 3.1 4l18 3.8-8.6 14.2c-.2 .6-.5 1.4-.5 2c0 1.1 .5 2.1 1.2 3c.8 .6 1.8 1 2.8 1c.7 0 1.6-.2 2.2-.6l10.4-7.1-1.4 32.8c-19.9-4.1-36-18.9-41.9-38.3c-5.1-16.6-2.2-34.4 7.6-48.5c2.7-3.9 2.3-9.3-.9-12.7c-16.6-17.5-21.6-43.1-13.1-65.5c1.2-3.1-2.3-6.4-5-4.5c-15.3 10.9-27.6 25.6-35.8 42.6l26.4 26.5c3.1 3.1 3.1 8.1 0 11.2s-8.1 3.1-11.2 0z"]
            }, lJ = Fk, PJ = {
              prefix: "fas",
              iconName: "handcuffs",
              icon: [640, 512, [], "e4f8", "M240 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM192 48a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm-32 80c17.7 0 32 14.3 32 32h8c13.3 0 24 10.7 24 24v16c0 1.7-.2 3.4-.5 5.1C280.3 229.6 320 286.2 320 352c0 88.4-71.6 160-160 160S0 440.4 0 352c0-65.8 39.7-122.4 96.5-146.9c-.4-1.6-.5-3.3-.5-5.1V184c0-13.3 10.7-24 24-24h8c0-17.7 14.3-32 32-32zm0 320a96 96 0 1 0 0-192 96 96 0 1 0 0 192zm192-96c0-25.9-5.1-50.5-14.4-73.1c16.9-32.9 44.8-59.1 78.9-73.9c-.4-1.6-.5-3.3-.5-5.1V184c0-13.3 10.7-24 24-24h8c0-17.7 14.3-32 32-32s32 14.3 32 32h8c13.3 0 24 10.7 24 24v16c0 1.7-.2 3.4-.5 5.1C600.3 229.6 640 286.2 640 352c0 88.4-71.6 160-160 160c-62 0-115.8-35.3-142.4-86.9c9.3-22.5 14.4-47.2 14.4-73.1zm224 0a96 96 0 1 0 -192 0 96 96 0 1 0 192 0zM368 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm80 48a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, iC = {
              prefix: "fas",
              iconName: "triangle-exclamation",
              icon: [512, 512, [9888, "exclamation-triangle", "warning"], "f071", "M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
            }, cJ = iC, pJ = iC, hJ = {
              prefix: "fas",
              iconName: "database",
              icon: [448, 512, [], "f1c0", "M448 80v48c0 44.2-100.3 80-224 80S0 172.2 0 128V80C0 35.8 100.3 0 224 0S448 35.8 448 80zM393.2 214.7c20.8-7.4 39.9-16.9 54.8-28.6V288c0 44.2-100.3 80-224 80S0 332.2 0 288V186.1c14.9 11.8 34 21.2 54.8 28.6C99.7 230.7 159.5 240 224 240s124.3-9.3 169.2-25.3zM0 346.1c14.9 11.8 34 21.2 54.8 28.6C99.7 390.7 159.5 400 224 400s124.3-9.3 169.2-25.3c20.8-7.4 39.9-16.9 54.8-28.6V432c0 44.2-100.3 80-224 80S0 476.2 0 432V346.1z"]
            }, sC = {
              prefix: "fas",
              iconName: "share",
              icon: [512, 512, ["arrow-turn-right", "mail-forward"], "f064", "M307 34.8c-11.5 5.1-19 16.6-19 29.2v64H176C78.8 128 0 206.8 0 304C0 417.3 81.5 467.9 100.2 478.1c2.5 1.4 5.3 1.9 8.1 1.9c10.9 0 19.7-8.9 19.7-19.7c0-7.5-4.3-14.4-9.8-19.5C108.8 431.9 96 414.4 96 384c0-53 43-96 96-96h96v64c0 12.6 7.4 24.1 19 29.2s25 3 34.4-5.4l160-144c6.7-6.1 10.6-14.7 10.6-23.8s-3.8-17.7-10.6-23.8l-160-144c-9.4-8.5-22.9-10.6-34.4-5.4z"]
            }, HJ = sC, gJ = sC, XJ = {
              prefix: "fas",
              iconName: "bottle-droplet",
              icon: [320, 512, [], "e4c4", "M96 0C82.7 0 72 10.7 72 24s10.7 24 24 24c4.4 0 8 3.6 8 8v64.9c0 12.2-7.2 23.1-17.2 30.1C53.7 174.1 32 212.5 32 256V448c0 35.3 28.7 64 64 64H224c35.3 0 64-28.7 64-64V256c0-43.5-21.7-81.9-54.8-105c-10-7-17.2-17.9-17.2-30.1V56c0-4.4 3.6-8 8-8c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0 0 0 0H104l0 0 0 0L96 0zm64 382c-26.5 0-48-20.1-48-45c0-16.8 22.1-48.1 36.3-66.4c6-7.8 17.5-7.8 23.5 0C185.9 288.9 208 320.2 208 337c0 24.9-21.5 45-48 45z"]
            }, TJ = {
              prefix: "fas",
              iconName: "mask-face",
              icon: [640, 512, [], "e1d7", "M320 64c-27.2 0-53.8 8-76.4 23.1l-37.1 24.8c-15.8 10.5-34.3 16.1-53.3 16.1H144 128 56c-30.9 0-56 25.1-56 56v85c0 55.1 37.5 103.1 90.9 116.4l108 27C233.8 435 275.4 448 320 448s86.2-13 121.1-35.5l108-27C602.5 372.1 640 324.1 640 269V184c0-30.9-25.1-56-56-56H512 496h-9.2c-19 0-37.5-5.6-53.3-16.1L396.4 87.1C373.8 72 347.2 64 320 64zM132.3 346.3l-29.8-7.4C70.5 330.9 48 302.1 48 269V184c0-4.4 3.6-8 8-8H96v48c0 45.1 13.4 87.2 36.3 122.3zm405.1-7.4l-29.8 7.4c23-35.2 36.3-77.2 36.3-122.3V176h40c4.4 0 8 3.6 8 8v85c0 33-22.5 61.8-54.5 69.9zM192 208c0-8.8 7.2-16 16-16H432c8.8 0 16 7.2 16 16s-7.2 16-16 16H208c-8.8 0-16-7.2-16-16zm16 48H432c8.8 0 16 7.2 16 16s-7.2 16-16 16H208c-8.8 0-16-7.2-16-16s7.2-16 16-16zm16 80c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16s-7.2 16-16 16H240c-8.8 0-16-7.2-16-16z"]
            }, qJ = {
              prefix: "fas",
              iconName: "hill-rockslide",
              icon: [576, 512, [], "e508", "M252.4 103.8l27 48c2.8 5 8.2 8.2 13.9 8.2l53.3 0c5.8 0 11.1-3.1 13.9-8.2l27-48c2.7-4.9 2.7-10.8 0-15.7l-27-48c-2.8-5-8.2-8.2-13.9-8.2H293.4c-5.8 0-11.1 3.1-13.9 8.2l-27 48c-2.7 4.9-2.7 10.8 0 15.7zM68.3 87C43.1 61.8 0 79.7 0 115.3V432c0 44.2 35.8 80 80 80H396.7c35.6 0 53.5-43.1 28.3-68.3L68.3 87zM504.2 403.6c4.9 2.7 10.8 2.7 15.7 0l48-27c5-2.8 8.2-8.2 8.2-13.9V309.4c0-5.8-3.1-11.1-8.2-13.9l-48-27c-4.9-2.7-10.8-2.7-15.7 0l-48 27c-5 2.8-8.2 8.2-8.2 13.9v53.3c0 5.8 3.1 11.1 8.2 13.9l48 27zM192 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM384 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, Nk = {
              prefix: "fas",
              iconName: "right-left",
              icon: [512, 512, ["exchange-alt"], "f362", "M32 96l320 0V32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l96 96c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-96 96c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6V160L32 160c-17.7 0-32-14.3-32-32s14.3-32 32-32zM480 352c17.7 0 32 14.3 32 32s-14.3 32-32 32H160v64c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-96-96c-6-6-9.4-14.1-9.4-22.6s3.4-16.6 9.4-22.6l96-96c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 64H480z"]
            }, bJ = Nk, xJ = {
              prefix: "fas",
              iconName: "paper-plane",
              icon: [512, 512, [61913], "f1d8", "M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480V396.4c0-4 1.5-7.8 4.2-10.7L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"]
            }, DJ = {
              prefix: "fas",
              iconName: "road-circle-exclamation",
              icon: [640, 512, [], "e565", "M213.2 32H288V96c0 17.7 14.3 32 32 32s32-14.3 32-32V32h74.8c27.1 0 51.3 17.1 60.3 42.6l42.7 120.6c-10.9-2.1-22.2-3.2-33.8-3.2c-59.5 0-112.1 29.6-144 74.8V224c0-17.7-14.3-32-32-32s-32 14.3-32 32v64c0 17.7 14.3 32 32 32c2.3 0 4.6-.3 6.8-.7c-4.5 15.5-6.8 31.8-6.8 48.7c0 5.4 .2 10.7 .7 16l-.7 0c-17.7 0-32 14.3-32 32v64H86.6C56.5 480 32 455.5 32 425.4c0-6.2 1.1-12.4 3.1-18.2L152.9 74.6C162 49.1 186.1 32 213.2 32zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16v80c0 8.8 7.2 16 16 16s16-7.2 16-16V288c0-8.8-7.2-16-16-16z"]
            }, jJ = {
              prefix: "fas",
              iconName: "dungeon",
              icon: [512, 512, [], "f6d9", "M336.6 156.5c1.3 1.1 2.7 2.2 3.9 3.3c9.3 8.2 23 10.5 33.4 3.6l67.6-45.1c11.4-7.6 14.2-23.2 5.1-33.4C430 66.6 410.9 50.6 389.7 37.6c-11.9-7.3-26.9-1.4-32.1 11.6l-30.5 76.2c-4.5 11.1 .2 23.6 9.5 31.2zM328 36.8c5.1-12.8-1.6-27.4-15-30.5C294.7 2.2 275.6 0 256 0s-38.7 2.2-57 6.4C185.5 9.4 178.8 24 184 36.8l30.3 75.8c4.5 11.3 16.8 17.2 29 16c4.2-.4 8.4-.6 12.7-.6s8.6 .2 12.7 .6c12.1 1.2 24.4-4.7 29-16L328 36.8zM65.5 85c-9.1 10.2-6.3 25.8 5.1 33.4l67.6 45.1c10.3 6.9 24.1 4.6 33.4-3.6c1.3-1.1 2.6-2.3 4-3.3c9.3-7.5 13.9-20.1 9.5-31.2L154.4 49.2c-5.2-12.9-20.3-18.8-32.1-11.6C101.1 50.6 82 66.6 65.5 85zm314 137.1c.9 3.3 1.7 6.6 2.3 10c2.5 13 13 23.9 26.2 23.9h80c13.3 0 24.1-10.8 22.9-24c-2.5-27.2-9.3-53.2-19.7-77.3c-5.5-12.9-21.4-16.6-33.1-8.9l-68.6 45.7c-9.8 6.5-13.2 19.2-10 30.5zM53.9 145.8c-11.6-7.8-27.6-4-33.1 8.9C10.4 178.8 3.6 204.8 1.1 232c-1.2 13.2 9.6 24 22.9 24h80c13.3 0 23.8-10.8 26.2-23.9c.6-3.4 1.4-6.7 2.3-10c3.1-11.4-.2-24-10-30.5L53.9 145.8zM104 288H24c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h80c13.3 0 24-10.7 24-24V312c0-13.3-10.7-24-24-24zm304 0c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h80c13.3 0 24-10.7 24-24V312c0-13.3-10.7-24-24-24H408zM24 416c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h80c13.3 0 24-10.7 24-24V440c0-13.3-10.7-24-24-24H24zm384 0c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h80c13.3 0 24-10.7 24-24V440c0-13.3-10.7-24-24-24H408zM272 192c0-8.8-7.2-16-16-16s-16 7.2-16 16V464c0 8.8 7.2 16 16 16s16-7.2 16-16V192zm-64 32c0-8.8-7.2-16-16-16s-16 7.2-16 16V464c0 8.8 7.2 16 16 16s16-7.2 16-16V224zm128 0c0-8.8-7.2-16-16-16s-16 7.2-16 16V464c0 8.8 7.2 16 16 16s16-7.2 16-16V224z"]
            }, wJ = {
              prefix: "fas",
              iconName: "align-right",
              icon: [448, 512, [], "f038", "M448 64c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]
            }, Qk = {
              prefix: "fas",
              iconName: "money-bill-1-wave",
              icon: [576, 512, ["money-bill-wave-alt"], "f53b", "M0 112.5V422.3c0 18 10.1 35 27 41.3c87 32.5 174 10.3 261-11.9c79.8-20.3 159.6-40.7 239.3-18.9c23 6.3 48.7-9.5 48.7-33.4V89.7c0-18-10.1-35-27-41.3C462 15.9 375 38.1 288 60.3C208.2 80.6 128.4 100.9 48.7 79.1C25.6 72.8 0 88.6 0 112.5zM128 416H64V352c35.3 0 64 28.7 64 64zM64 224V160h64c0 35.3-28.7 64-64 64zM448 352c0-35.3 28.7-64 64-64v64H448zm64-192c-35.3 0-64-28.7-64-64h64v64zM384 256c0 61.9-43 112-96 112s-96-50.1-96-112s43-112 96-112s96 50.1 96 112zM252 208c0 9.7 6.9 17.7 16 19.6V276h-4c-11 0-20 9-20 20s9 20 20 20h24 24c11 0 20-9 20-20s-9-20-20-20h-4V208c0-11-9-20-20-20H272c-11 0-20 9-20 20z"]
            }, mJ = Qk, BJ = {
              prefix: "fas",
              iconName: "life-ring",
              icon: [512, 512, [], "f1cd", "M367.2 412.5C335.9 434.9 297.5 448 256 448s-79.9-13.1-111.2-35.5l58-58c15.8 8.6 34 13.5 53.3 13.5s37.4-4.9 53.3-13.5l58 58zm90.7 .8c33.8-43.4 54-98 54-157.3s-20.2-113.9-54-157.3c9-12.5 7.9-30.1-3.4-41.3S425.8 45 413.3 54C369.9 20.2 315.3 0 256 0S142.1 20.2 98.7 54c-12.5-9-30.1-7.9-41.3 3.4S45 86.2 54 98.7C20.2 142.1 0 196.7 0 256s20.2 113.9 54 157.3c-9 12.5-7.9 30.1 3.4 41.3S86.2 467 98.7 458c43.4 33.8 98 54 157.3 54s113.9-20.2 157.3-54c12.5 9 30.1 7.9 41.3-3.4s12.4-28.8 3.4-41.3zm-45.5-46.1l-58-58c8.6-15.8 13.5-34 13.5-53.3s-4.9-37.4-13.5-53.3l58-58C434.9 176.1 448 214.5 448 256s-13.1 79.9-35.5 111.2zM367.2 99.5l-58 58c-15.8-8.6-34-13.5-53.3-13.5s-37.4 4.9-53.3 13.5l-58-58C176.1 77.1 214.5 64 256 64s79.9 13.1 111.2 35.5zM157.5 309.3l-58 58C77.1 335.9 64 297.5 64 256s13.1-79.9 35.5-111.2l58 58c-8.6 15.8-13.5 34-13.5 53.3s4.9 37.4 13.5 53.3zM208 256a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z"]
            }, aC = {
              prefix: "fas",
              iconName: "hands",
              icon: [576, 512, ["sign-language", "signing"], "f2a7", "M544 160l-.1 72.6c-.1 52.2-24 101-64 133.1c.1-1.9 .1-3.8 .1-5.7v-8c0-71.8-37-138.6-97.9-176.7l-60.2-37.6c-8.6-5.4-17.9-8.4-27.3-9.4L248.7 48.8c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8l78 135.1c3.3 5.7 10.7 7.7 16.4 4.4s7.7-10.7 4.4-16.4l-62-107.4c-6.6-11.5-2.7-26.2 8.8-32.8S362 5 368.6 16.5l68 117.8 0 0 0 0 43.3 75L480 160c0-17.7 14.4-32 32-32s32 14.4 32 32zM243.9 88.5L268.5 131c-13.9 4.5-26.4 13.7-34.7 27c-.9 1.4-1.7 2.9-2.5 4.4l-28.9-50c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8zm-46.4 63.7l26.8 46.4c.6 6 2.1 11.8 4.3 17.4H224 210.7l0 0H179l-23-39.8c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8zM260.9 175c9.4-15 29.1-19.5 44.1-10.2l60.2 37.6C416.7 234.7 448 291.2 448 352v8c0 83.9-68.1 152-152 152H120c-13.3 0-24-10.7-24-24s10.7-24 24-24h92c6.6 0 12-5.4 12-12s-5.4-12-12-12H88c-13.3 0-24-10.7-24-24s10.7-24 24-24H212c6.6 0 12-5.4 12-12s-5.4-12-12-12H56c-13.3 0-24-10.7-24-24s10.7-24 24-24H212c6.6 0 12-5.4 12-12s-5.4-12-12-12H88c-13.3 0-24-10.7-24-24s10.7-24 24-24H224l0 0 0 0h93.2L271 219.1c-15-9.4-19.5-29.1-10.2-44.1z"]
            }, WJ = aC, SJ = aC, UJ = {
              prefix: "fas",
              iconName: "calendar-day",
              icon: [448, 512, [], "f783", "M128 0c17.7 0 32 14.3 32 32V64H288V32c0-17.7 14.3-32 32-32s32 14.3 32 32V64h48c26.5 0 48 21.5 48 48v48H0V112C0 85.5 21.5 64 48 64H96V32c0-17.7 14.3-32 32-32zM0 192H448V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V192zm80 64c-8.8 0-16 7.2-16 16v96c0 8.8 7.2 16 16 16h96c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H80z"]
            }, oC = {
              prefix: "fas",
              iconName: "water-ladder",
              icon: [576, 512, ["ladder-water", "swimming-pool"], "f5c5", "M128 127.7C128 74.9 170.9 32 223.7 32c48.3 0 89 36 95 83.9l1 8.2c2.2 17.5-10.2 33.5-27.8 35.7s-33.5-10.2-35.7-27.8l-1-8.2c-2-15.9-15.5-27.8-31.5-27.8c-17.5 0-31.7 14.2-31.7 31.7V224H384V127.7C384 74.9 426.9 32 479.7 32c48.3 0 89 36 95 83.9l1 8.2c2.2 17.5-10.2 33.5-27.8 35.7s-33.5-10.2-35.7-27.8l-1-8.2c-2-15.9-15.5-27.8-31.5-27.8c-17.5 0-31.7 14.2-31.7 31.7V361c-1.6 1-3.3 2-4.8 3.1c-18 12.4-40.1 20.3-59.2 20.3h0V288H192v96.5c-19 0-41.2-7.9-59.1-20.3c-1.6-1.1-3.2-2.2-4.9-3.1V127.7zM306.5 389.9C329 405.4 356.5 416 384 416c26.9 0 55.4-10.8 77.4-26.1l0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 469.7 417 480 384 480c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7l0 0C136.7 405.2 165.1 416 192 416c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
            }, IJ = oC, RJ = oC, Yk = {
              prefix: "fas",
              iconName: "arrows-up-down",
              icon: [320, 512, ["arrows-v"], "f07d", "M182.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L128 109.3V402.7L86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7V109.3l41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96z"]
            }, VJ = Yk, Mk = {
              prefix: "fas",
              iconName: "face-grimace",
              icon: [512, 512, [128556, "grimace"], "f57f", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm96-112h-8V360l55.3 0c-3.8 22.7-23.6 40-47.3 40zm47.3-56L344 344V304h8c23.8 0 43.5 17.3 47.3 40zM328 344H264V304h64v40zm0 56H264V360h64v40zm-80-96v40l-64 0V304h64zm0 56v40H184V360l64 0zm-80-16H112.7c3.8-22.7 23.6-40 47.3-40h8v40zm0 56h-8c-23.8 0-43.5-17.3-47.3-40H168v40zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, CJ = Mk, Lk = {
              prefix: "fas",
              iconName: "wheelchair-move",
              icon: [448, 512, ["wheelchair-alt"], "e2ce", "M320 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM204.5 121.3c-5.4-2.5-11.7-1.9-16.4 1.7l-40.9 30.7c-14.1 10.6-34.2 7.7-44.8-6.4s-7.7-34.2 6.4-44.8l40.9-30.7c23.7-17.8 55.3-21 82.1-8.4l90.4 42.5c29.1 13.7 36.8 51.6 15.2 75.5L299.1 224h97.4c30.3 0 53 27.7 47.1 57.4L415.4 422.3c-3.5 17.3-20.3 28.6-37.7 25.1s-28.6-20.3-25.1-37.7L377 288H306.7c8.6 19.6 13.3 41.2 13.3 64c0 88.4-71.6 160-160 160S0 440.4 0 352s71.6-160 160-160c11.1 0 22 1.1 32.4 3.3l54.2-54.2-42.1-19.8zM160 448a96 96 0 1 0 0-192 96 96 0 1 0 0 192z"]
            }, OJ = Lk, Kk = {
              prefix: "fas",
              iconName: "turn-down",
              icon: [384, 512, [10549, "level-down-alt"], "f3be", "M350 334.5c3.8 8.8 2 19-4.6 26l-136 144c-4.5 4.8-10.8 7.5-17.4 7.5s-12.9-2.7-17.4-7.5l-136-144c-6.6-7-8.4-17.2-4.6-26s12.5-14.5 22-14.5h88l0-192c0-17.7-14.3-32-32-32H32C14.3 96 0 81.7 0 64V32C0 14.3 14.3 0 32 0l80 0c70.7 0 128 57.3 128 128l0 192h88c9.6 0 18.2 5.7 22 14.5z"]
            }, yJ = Kk, kJ = {
              prefix: "fas",
              iconName: "person-walking-arrow-right",
              icon: [640, 512, [], "e552", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM550.6 153.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L530.7 224H384c-17.7 0-32 14.3-32 32s14.3 32 32 32H530.7l-25.4 25.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3l-80-80z"]
            }, Jk = {
              prefix: "fas",
              iconName: "square-envelope",
              icon: [448, 512, ["envelope-square"], "f199", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM218 271.7L64.2 172.4C66 156.4 79.5 144 96 144H352c16.5 0 30 12.4 31.8 28.4L230 271.7c-1.8 1.2-3.9 1.8-6 1.8s-4.2-.6-6-1.8zm29.4 26.9L384 210.4V336c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V210.4l136.6 88.2c7 4.5 15.1 6.9 23.4 6.9s16.4-2.4 23.4-6.9z"]
            }, EJ = Jk, FJ = {
              prefix: "fas",
              iconName: "dice",
              icon: [640, 512, [127922], "f522", "M274.9 34.3c-28.1-28.1-73.7-28.1-101.8 0L34.3 173.1c-28.1 28.1-28.1 73.7 0 101.8L173.1 413.7c28.1 28.1 73.7 28.1 101.8 0L413.7 274.9c28.1-28.1 28.1-73.7 0-101.8L274.9 34.3zM200 224a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM96 200a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM224 376a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM352 200a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM224 120a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm96 328c0 35.3 28.7 64 64 64H576c35.3 0 64-28.7 64-64V256c0-35.3-28.7-64-64-64H461.7c11.6 36 3.1 77-25.4 105.5L320 413.8V448zM480 328a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, NJ = {
              prefix: "fas",
              iconName: "bowling-ball",
              icon: [512, 512, [], "f436", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM240 80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM208 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-64-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, QJ = {
              prefix: "fas",
              iconName: "brain",
              icon: [512, 512, [129504], "f5dc", "M184 0c30.9 0 56 25.1 56 56V456c0 30.9-25.1 56-56 56c-28.9 0-52.7-21.9-55.7-50.1c-5.2 1.4-10.7 2.1-16.3 2.1c-35.3 0-64-28.7-64-64c0-7.4 1.3-14.6 3.6-21.2C21.4 367.4 0 338.2 0 304c0-31.9 18.7-59.5 45.8-72.3C37.1 220.8 32 207 32 192c0-30.7 21.6-56.3 50.4-62.6C80.8 123.9 80 118 80 112c0-29.9 20.6-55.1 48.3-62.1C131.3 21.9 155.1 0 184 0zM328 0c28.9 0 52.6 21.9 55.7 49.9c27.8 7 48.3 32.1 48.3 62.1c0 6-.8 11.9-2.4 17.4c28.8 6.2 50.4 31.9 50.4 62.6c0 15-5.1 28.8-13.8 39.7C493.3 244.5 512 272.1 512 304c0 34.2-21.4 63.4-51.6 74.8c2.3 6.6 3.6 13.8 3.6 21.2c0 35.3-28.7 64-64 64c-5.6 0-11.1-.7-16.3-2.1c-3 28.2-26.8 50.1-55.7 50.1c-30.9 0-56-25.1-56-56V56c0-30.9 25.1-56 56-56z"]
            }, zk = {
              prefix: "fas",
              iconName: "bandage",
              icon: [640, 512, [129657, "band-aid"], "f462", "M480 416h96c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H480V416zM448 96H192V416H448V96zM64 96C28.7 96 0 124.7 0 160V352c0 35.3 28.7 64 64 64h96V96H64zM248 208a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm120-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM248 304a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm120-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, YJ = zk, MJ = {
              prefix: "fas",
              iconName: "calendar-minus",
              icon: [512, 512, [], "f272", "M160 0c17.7 0 32 14.3 32 32V64H320V32c0-17.7 14.3-32 32-32s32 14.3 32 32V64h48c26.5 0 48 21.5 48 48v48H32V112c0-26.5 21.5-48 48-48h48V32c0-17.7 14.3-32 32-32zM32 192H480V464c0 26.5-21.5 48-48 48H80c-26.5 0-48-21.5-48-48V192zM344 376c13.3 0 24-10.7 24-24s-10.7-24-24-24H168c-13.3 0-24 10.7-24 24s10.7 24 24 24H344z"]
            }, fC = {
              prefix: "fas",
              iconName: "circle-xmark",
              icon: [512, 512, [61532, "times-circle", "xmark-circle"], "f057", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
            }, LJ = fC, KJ = fC, JJ = {
              prefix: "fas",
              iconName: "gifts",
              icon: [640, 512, [], "f79c", "M200.6 32C205 19.5 198.5 5.8 186 1.4S159.8 3.5 155.4 16L144.7 46.2l-9.9-29.8C130.6 3.8 117-3 104.4 1.2S85 19 89.2 31.6l8.3 25-27.4-20c-10.7-7.8-25.7-5.4-33.5 5.3s-5.4 25.7 5.3 33.5L70.2 96H48C21.5 96 0 117.5 0 144V464c0 26.5 21.5 48 48 48H200.6c-5.4-9.4-8.6-20.3-8.6-32V256c0-29.9 20.5-55 48.2-62c1.8-31 17.1-58.2 40.1-76.1C271.7 104.7 256.9 96 240 96H217.8l28.3-20.6c10.7-7.8 13.1-22.8 5.3-33.5s-22.8-13.1-33.5-5.3L192.5 55.1 200.6 32zM363.5 185.5L393.1 224H344c-13.3 0-24-10.7-24-24c0-13.1 10.8-24 24.2-24c7.6 0 14.7 3.5 19.3 9.5zM272 200c0 8.4 1.4 16.5 4.1 24H272c-26.5 0-48 21.5-48 48v80H416V256h32v96H640V272c0-26.5-21.5-48-48-48h-4.1c2.7-7.5 4.1-15.6 4.1-24c0-39.9-32.5-72-72.2-72c-22.4 0-43.6 10.4-57.3 28.2L432 195.8l-30.5-39.6c-13.7-17.8-35-28.2-57.3-28.2c-39.7 0-72.2 32.1-72.2 72zM224 464c0 26.5 21.5 48 48 48H416V384H224v80zm224 48H592c26.5 0 48-21.5 48-48V384H448V512zm96-312c0 13.3-10.7 24-24 24H470.9l29.6-38.5c4.6-5.9 11.7-9.5 19.3-9.5c13.4 0 24.2 10.9 24.2 24z"]
            }, zJ = {
              prefix: "fas",
              iconName: "hotel",
              icon: [512, 512, [127976], "f594", "M0 32C0 14.3 14.3 0 32 0H480c17.7 0 32 14.3 32 32s-14.3 32-32 32V448c17.7 0 32 14.3 32 32s-14.3 32-32 32H304V464c0-26.5-21.5-48-48-48s-48 21.5-48 48v48H32c-17.7 0-32-14.3-32-32s14.3-32 32-32V64C14.3 64 0 49.7 0 32zm96 80v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H112c-8.8 0-16 7.2-16 16zM240 96c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H240zm112 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16zM112 192c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V208c0-8.8-7.2-16-16-16H112zm112 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V208c0-8.8-7.2-16-16-16H240c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V208c0-8.8-7.2-16-16-16H368zM328 384c13.3 0 24.3-10.9 21-23.8c-10.6-41.5-48.2-72.2-93-72.2s-82.5 30.7-93 72.2c-3.3 12.8 7.8 23.8 21 23.8H328z"]
            }, Gk = {
              prefix: "fas",
              iconName: "earth-asia",
              icon: [512, 512, [127759, "globe-asia"], "f57e", "M51.7 295.1l31.7 6.3c7.9 1.6 16-.9 21.7-6.6l15.4-15.4c11.6-11.6 31.1-8.4 38.4 6.2l9.3 18.5c4.8 9.6 14.6 15.7 25.4 15.7c15.2 0 26.1-14.6 21.7-29.2l-6-19.9c-4.6-15.4 6.9-30.9 23-30.9h2.3c13.4 0 25.9-6.7 33.3-17.8l10.7-16.1c5.6-8.5 5.3-19.6-.8-27.7l-16.1-21.5c-10.3-13.7-3.3-33.5 13.4-37.7l17-4.3c7.5-1.9 13.6-7.2 16.5-14.4l16.4-40.9C303.4 52.1 280.2 48 256 48C141.1 48 48 141.1 48 256c0 13.4 1.3 26.5 3.7 39.1zm407.7 4.6c-3-.3-6-.1-9 .8l-15.8 4.4c-6.7 1.9-13.8-.9-17.5-6.7l-2-3.1c-6-9.4-16.4-15.1-27.6-15.1s-21.6 5.7-27.6 15.1l-6.1 9.5c-1.4 2.2-3.4 4.1-5.7 5.3L312 330.1c-18.1 10.1-25.5 32.4-17 51.3l5.5 12.4c8.6 19.2 30.7 28.5 50.5 21.1l2.6-1c10-3.7 21.3-2.2 29.9 4.1l1.5 1.1c37.2-29.5 64.1-71.4 74.4-119.5zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm144.5 92.1c-2.1 8.6 3.1 17.3 11.6 19.4l32 8c8.6 2.1 17.3-3.1 19.4-11.6s-3.1-17.3-11.6-19.4l-32-8c-8.6-2.1-17.3 3.1-19.4 11.6zm92-20c-2.1 8.6 3.1 17.3 11.6 19.4s17.3-3.1 19.4-11.6l8-32c2.1-8.6-3.1-17.3-11.6-19.4s-17.3 3.1-19.4 11.6l-8 32zM343.2 113.7c-7.9-4-17.5-.7-21.5 7.2l-16 32c-4 7.9-.7 17.5 7.2 21.5s17.5 .7 21.5-7.2l16-32c4-7.9 .7-17.5-7.2-21.5z"]
            }, GJ = Gk, Zk = {
              prefix: "fas",
              iconName: "id-card-clip",
              icon: [576, 512, ["id-card-alt"], "f47f", "M256 0h64c17.7 0 32 14.3 32 32V96c0 17.7-14.3 32-32 32H256c-17.7 0-32-14.3-32-32V32c0-17.7 14.3-32 32-32zM64 64H192v48c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48V64H512c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128C0 92.7 28.7 64 64 64zM176 437.3c0 5.9 4.8 10.7 10.7 10.7H389.3c5.9 0 10.7-4.8 10.7-10.7c0-29.5-23.9-53.3-53.3-53.3H229.3c-29.5 0-53.3 23.9-53.3 53.3zM288 352a64 64 0 1 0 0-128 64 64 0 1 0 0 128z"]
            }, ZJ = Zk, _k = {
              prefix: "fas",
              iconName: "magnifying-glass-plus",
              icon: [512, 512, ["search-plus"], "f00e", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM184 296c0 13.3 10.7 24 24 24s24-10.7 24-24V232h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H232V120c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"]
            }, _J = _k, $J = {
              prefix: "fas",
              iconName: "thumbs-up",
              icon: [512, 512, [128077, 61575], "f164", "M313.4 32.9c26 5.2 42.9 30.5 37.7 56.5l-2.3 11.4c-5.3 26.7-15.1 52.1-28.8 75.2H464c26.5 0 48 21.5 48 48c0 18.5-10.5 34.6-25.9 42.6C497 275.4 504 288.9 504 304c0 23.4-16.8 42.9-38.9 47.1c4.4 7.3 6.9 15.8 6.9 24.9c0 21.3-13.9 39.4-33.1 45.6c.7 3.3 1.1 6.8 1.1 10.4c0 26.5-21.5 48-48 48H294.5c-19 0-37.5-5.6-53.3-16.1l-38.5-25.7C176 420.4 160 390.4 160 358.3V320 272 247.1c0-29.2 13.3-56.7 36-75l7.4-5.9c26.5-21.2 44.6-51 51.2-84.2l2.3-11.4c5.2-26 30.5-42.9 56.5-37.7zM32 192H96c17.7 0 32 14.3 32 32V448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32V224c0-17.7 14.3-32 32-32z"]
            }, ez = {
              prefix: "fas",
              iconName: "user-clock",
              icon: [640, 512, [], "f4fd", "M224 0a128 128 0 1 1 0 256A128 128 0 1 1 224 0zM178.3 304h91.4c20.6 0 40.4 3.5 58.8 9.9C323 331 320 349.1 320 368c0 59.5 29.5 112.1 74.8 144H29.7C13.3 512 0 498.7 0 482.3C0 383.8 79.8 304 178.3 304zM352 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-80c-8.8 0-16 7.2-16 16v64c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16s-7.2-16-16-16H512V304c0-8.8-7.2-16-16-16z"]
            }, $k = {
              prefix: "fas",
              iconName: "hand-dots",
              icon: [512, 512, ["allergies"], "f461", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V240c0 8.8-7.2 16-16 16s-16-7.2-16-16V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V336c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L124.8 448c43.1 41.1 100.4 64 160 64H304c97.2 0 176-78.8 176-176V128c0-17.7-14.3-32-32-32s-32 14.3-32 32V240c0 8.8-7.2 16-16 16s-16-7.2-16-16V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V240c0 8.8-7.2 16-16 16s-16-7.2-16-16V32zM240 336a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm80 16a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48-16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm-16 80a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM240 432a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm-48-48a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
            }, tz = $k, rz = {
              prefix: "fas",
              iconName: "file-invoice",
              icon: [384, 512, [], "f570", "M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM80 64h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16s7.2-16 16-16zm16 96H288c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V256c0-17.7 14.3-32 32-32zm0 32v64H288V256H96zM240 416h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H240c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
            }, nz = {
              prefix: "fas",
              iconName: "window-minimize",
              icon: [512, 512, [128469], "f2d1", "M32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"]
            }, eE = {
              prefix: "fas",
              iconName: "mug-saucer",
              icon: [640, 512, ["coffee"], "f0f4", "M96 64c0-17.7 14.3-32 32-32H448h64c70.7 0 128 57.3 128 128s-57.3 128-128 128H480c0 53-43 96-96 96H192c-53 0-96-43-96-96V64zM480 224h32c35.3 0 64-28.7 64-64s-28.7-64-64-64H480V224zM32 416H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
            }, iz = eE, sz = {
              prefix: "fas",
              iconName: "brush",
              icon: [384, 512, [], "f55d", "M162.4 6c-1.5-3.6-5-6-8.9-6h-19c-3.9 0-7.5 2.4-8.9 6L104.9 57.7c-3.2 8-14.6 8-17.8 0L66.4 6c-1.5-3.6-5-6-8.9-6H48C21.5 0 0 21.5 0 48V224v22.4V256H9.6 374.4 384v-9.6V224 48c0-26.5-21.5-48-48-48H230.5c-3.9 0-7.5 2.4-8.9 6L200.9 57.7c-3.2 8-14.6 8-17.8 0L162.4 6zM0 288v32c0 35.3 28.7 64 64 64h64v64c0 35.3 28.7 64 64 64s64-28.7 64-64V384h64c35.3 0 64-28.7 64-64V288H0zM192 432a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
            }, az = {
              prefix: "fas",
              iconName: "mask",
              icon: [576, 512, [], "f6fa", "M288 64C64 64 0 160 0 272S80 448 176 448h8.4c24.2 0 46.4-13.7 57.2-35.4l23.2-46.3c4.4-8.8 13.3-14.3 23.2-14.3s18.8 5.5 23.2 14.3l23.2 46.3c10.8 21.7 33 35.4 57.2 35.4H400c96 0 176-64 176-176s-64-208-288-208zM96 256a64 64 0 1 1 128 0A64 64 0 1 1 96 256zm320-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
            }, tE = {
              prefix: "fas",
              iconName: "magnifying-glass-minus",
              icon: [512, 512, ["search-minus"], "f010", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24H280c13.3 0 24-10.7 24-24s-10.7-24-24-24H136z"]
            }, oz = tE, fz = {
              prefix: "fas",
              iconName: "ruler-vertical",
              icon: [256, 512, [], "f548", "M0 48C0 21.5 21.5 0 48 0H208c26.5 0 48 21.5 48 48V96H176c-8.8 0-16 7.2-16 16s7.2 16 16 16h80v64H176c-8.8 0-16 7.2-16 16s7.2 16 16 16h80v64H176c-8.8 0-16 7.2-16 16s7.2 16 16 16h80v64H176c-8.8 0-16 7.2-16 16s7.2 16 16 16h80v48c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V48z"]
            }, rE = {
              prefix: "fas",
              iconName: "user-large",
              icon: [512, 512, ["user-alt"], "f406", "M256 288A144 144 0 1 0 256 0a144 144 0 1 0 0 288zm-94.7 32C72.2 320 0 392.2 0 481.3c0 17 13.8 30.7 30.7 30.7H481.3c17 0 30.7-13.8 30.7-30.7C512 392.2 439.8 320 350.7 320H161.3z"]
            }, Az = rE, dz = {
              prefix: "fas",
              iconName: "train-tram",
              icon: [448, 512, [128650], "e5b4", "M86.8 48c-12.2 0-23.6 5.5-31.2 15L42.7 79C34.5 89.3 19.4 91 9 82.7S-3 59.4 5.3 49L18 33C34.7 12.2 60 0 86.8 0H361.2c26.7 0 52 12.2 68.7 33l12.8 16c8.3 10.4 6.6 25.5-3.8 33.7s-25.5 6.6-33.7-3.7L392.5 63c-7.6-9.5-19.1-15-31.2-15H248V96h40c53 0 96 43 96 96V352c0 30.6-14.3 57.8-36.6 75.4l65.5 65.5c7.1 7.1 2.1 19.1-7.9 19.1H365.3c-8.5 0-16.6-3.4-22.6-9.4L288 448H160l-54.6 54.6c-6 6-14.1 9.4-22.6 9.4H43c-10 0-15-12.1-7.9-19.1l65.5-65.5C78.3 409.8 64 382.6 64 352V192c0-53 43-96 96-96h40V48H86.8zM160 160c-17.7 0-32 14.3-32 32v32c0 17.7 14.3 32 32 32H288c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32H160zm32 192a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
            }, vz = {
              prefix: "fas",
              iconName: "user-nurse",
              icon: [448, 512, [], "f82f", "M96 128V70.2c0-13.3 8.3-25.3 20.8-30l96-36c7.2-2.7 15.2-2.7 22.5 0l96 36c12.5 4.7 20.8 16.6 20.8 30V128h-.3c.2 2.6 .3 5.3 .3 8v40c0 70.7-57.3 128-128 128s-128-57.3-128-128V136c0-2.7 .1-5.4 .3-8H96zm48 48c0 44.2 35.8 80 80 80s80-35.8 80-80V160H144v16zM111.9 327.7c10.5-3.4 21.8 .4 29.4 8.5l71 75.5c6.3 6.7 17 6.7 23.3 0l71-75.5c7.6-8.1 18.9-11.9 29.4-8.5C401 348.6 448 409.4 448 481.3c0 17-13.8 30.7-30.7 30.7H30.7C13.8 512 0 498.2 0 481.3c0-71.9 47-132.7 111.9-153.6zM208 48V64H192c-4.4 0-8 3.6-8 8V88c0 4.4 3.6 8 8 8h16v16c0 4.4 3.6 8 8 8h16c4.4 0 8-3.6 8-8V96h16c4.4 0 8-3.6 8-8V72c0-4.4-3.6-8-8-8H240V48c0-4.4-3.6-8-8-8H216c-4.4 0-8 3.6-8 8z"]
            }, uz = {
              prefix: "fas",
              iconName: "syringe",
              icon: [512, 512, [128137], "f48e", "M441 7l32 32 32 32c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-15-15L417.9 128l55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-72-72L295 73c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l55 55L422.1 56 407 41c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0zM210.3 155.7l61.1-61.1c.3 .3 .6 .7 1 1l16 16 56 56 56 56 16 16c.3 .3 .6 .6 1 1l-191 191c-10.5 10.5-24.7 16.4-39.6 16.4H97.9L41 505c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l57-57V325.3c0-14.9 5.9-29.1 16.4-39.6l43.3-43.3 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 41.4-41.4 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57z"]
            }, lz = {
              prefix: "fas",
              iconName: "cloud-sun",
              icon: [640, 512, [9925], "f6c4", "M294.2 1.2c5.1 2.1 8.7 6.7 9.6 12.1l14.1 84.7 84.7 14.1c5.4 .9 10 4.5 12.1 9.6s1.5 10.9-1.6 15.4l-38.5 55c-2.2-.1-4.4-.2-6.7-.2c-23.3 0-45.1 6.2-64 17.1l0-1.1c0-53-43-96-96-96s-96 43-96 96s43 96 96 96c8.1 0 15.9-1 23.4-2.9c-36.6 18.1-63.3 53.1-69.8 94.9l-24.4 17c-4.5 3.2-10.3 3.8-15.4 1.6s-8.7-6.7-9.6-12.1L98.1 317.9 13.4 303.8c-5.4-.9-10-4.5-12.1-9.6s-1.5-10.9 1.6-15.4L52.5 208 2.9 137.2c-3.2-4.5-3.8-10.3-1.6-15.4s6.7-8.7 12.1-9.6L98.1 98.1l14.1-84.7c.9-5.4 4.5-10 9.6-12.1s10.9-1.5 15.4 1.6L208 52.5 278.8 2.9c4.5-3.2 10.3-3.8 15.4-1.6zM144 208a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM639.9 431.9c0 44.2-35.8 80-80 80H288c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]
            }, Pz = {
              prefix: "fas",
              iconName: "stopwatch-20",
              icon: [448, 512, [], "e06f", "M176 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h16V98.4C92.3 113.8 16 200 16 304c0 114.9 93.1 208 208 208s208-93.1 208-208c0-41.8-12.3-80.7-33.5-113.2l24.1-24.1c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L355.7 143c-28.1-23-62.2-38.8-99.7-44.6V64h16c17.7 0 32-14.3 32-32s-14.3-32-32-32H176zM288 204c28.7 0 52 23.3 52 52v96c0 28.7-23.3 52-52 52s-52-23.3-52-52V256c0-28.7 23.3-52 52-52zm-12 52v96c0 6.6 5.4 12 12 12s12-5.4 12-12V256c0-6.6-5.4-12-12-12s-12 5.4-12 12zM159.5 244c-5.4 0-10.2 3.5-11.9 8.6l-.6 1.7c-3.5 10.5-14.8 16.1-25.3 12.6s-16.1-14.8-12.6-25.3l.6-1.7c7.2-21.5 27.2-35.9 49.8-35.9c29 0 52.5 23.5 52.5 52.5v2.2c0 13.4-4.9 26.4-13.8 36.4l-39 43.9c-6.2 7-10 15.7-10.9 24.9H192c11 0 20 9 20 20s-9 20-20 20H128c-11 0-20-9-20-20V368.3c0-20.6 7.5-40.4 21.2-55.8l39-43.9c2.4-2.7 3.7-6.2 3.7-9.8v-2.2c0-6.9-5.6-12.5-12.5-12.5z"]
            }, cz = {
              prefix: "fas",
              iconName: "square-full",
              icon: [512, 512, [128997, 128998, 128999, 129e3, 129001, 129002, 129003, 11035, 11036], "f45c", "M0 0H512V512H0V0z"]
            }, pz = {
              prefix: "fas",
              iconName: "magnet",
              icon: [448, 512, [129522], "f076", "M0 160v96C0 379.7 100.3 480 224 480s224-100.3 224-224V160H320v96c0 53-43 96-96 96s-96-43-96-96V160H0zm0-32H128V64c0-17.7-14.3-32-32-32H32C14.3 32 0 46.3 0 64v64zm320 0H448V64c0-17.7-14.3-32-32-32H352c-17.7 0-32 14.3-32 32v64z"]
            }, hz = {
              prefix: "fas",
              iconName: "jar",
              icon: [320, 512, [], "e516", "M32 32C32 14.3 46.3 0 64 0H256c17.7 0 32 14.3 32 32s-14.3 32-32 32H64C46.3 64 32 49.7 32 32zM0 160c0-35.3 28.7-64 64-64H256c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V160zm96 64c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V256c0-17.7-14.3-32-32-32H96z"]
            }, nE = {
              prefix: "fas",
              iconName: "note-sticky",
              icon: [448, 512, [62026, "sticky-note"], "f249", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H288V368c0-26.5 21.5-48 48-48H448V96c0-35.3-28.7-64-64-64H64zM448 352H402.7 336c-8.8 0-16 7.2-16 16v66.7V480l32-32 64-64 32-32z"]
            }, Hz = nE, gz = {
              prefix: "fas",
              iconName: "bug-slash",
              icon: [640, 512, [], "e490", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L477.4 348.9c1.7-9.4 2.6-19 2.6-28.9h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H479.7c-1.1-14.1-5-27.5-11.1-39.5c.7-.6 1.4-1.2 2.1-1.9l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-.7 .7-1.3 1.4-1.9 2.1C409.2 164.1 393.1 160 376 160H264c-8.3 0-16.3 1-24 2.8L38.8 5.1zM320 0c-53 0-96 43-96 96v3.6c0 15.7 12.7 28.4 28.4 28.4H387.6c15.7 0 28.4-12.7 28.4-28.4V96c0-53-43-96-96-96zM160.3 256H96c-17.7 0-32 14.3-32 32s14.3 32 32 32h64c0 24.6 5.5 47.8 15.4 68.6c-2.2 1.3-4.2 2.9-6 4.8l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l63.1-63.1c24.5 21.8 55.8 36.2 90.3 39.6V335.5L166.7 227.3c-3.4 9-5.6 18.7-6.4 28.7zM336 479.2c36.6-3.6 69.7-19.6 94.8-43.8L336 360.7V479.2z"]
            }, Xz = {
              prefix: "fas",
              iconName: "arrow-up-from-water-pump",
              icon: [576, 512, [], "e4b6", "M112 0C85.5 0 64 21.5 64 48V256H48c-26.5 0-48 21.5-48 48v96c0 8 2 15.6 5.4 22.2c3.8-1.7 7.8-3.1 12-4.1c13.1-3.1 26.7-9.8 37.3-18.6c22.2-18.7 54.3-20.1 78.1-3.4c18 12.4 40.1 20.3 59.2 20.3c21.1 0 42-8.5 59.2-20.3c22.1-15.5 51.6-15.5 73.7 0c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.3 78.1 3.4c10.6 8.8 24.2 15.6 37.3 18.6c4.2 1 8.2 2.4 12 4.1C574 415.6 576 408 576 400V304c0-26.5-21.5-48-48-48H480l0-146.7 25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-80-80c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 109.3 416 256H288V48c0-26.5-21.5-48-48-48H112zM306.5 421.9c-11.1-7.9-25.9-7.9-37 0C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1l0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7l0 0C439.4 437.2 410.9 448 384 448c-27.5 0-55-10.6-77.5-26.1z"]
            }, Tz = {
              prefix: "fas",
              iconName: "bone",
              icon: [576, 512, [129460], "f5d7", "M153.7 144.8c6.9 16.3 20.6 31.2 38.3 31.2H384c17.7 0 31.4-14.9 38.3-31.2C434.4 116.1 462.9 96 496 96c44.2 0 80 35.8 80 80c0 30.4-17 56.9-42 70.4c-3.6 1.9-6 5.5-6 9.6s2.4 7.7 6 9.6c25 13.5 42 40 42 70.4c0 44.2-35.8 80-80 80c-33.1 0-61.6-20.1-73.7-48.8C415.4 350.9 401.7 336 384 336H192c-17.7 0-31.4 14.9-38.3 31.2C141.6 395.9 113.1 416 80 416c-44.2 0-80-35.8-80-80c0-30.4 17-56.9 42-70.4c3.6-1.9 6-5.5 6-9.6s-2.4-7.7-6-9.6C17 232.9 0 206.4 0 176c0-44.2 35.8-80 80-80c33.1 0 61.6 20.1 73.7 48.8z"]
            }, qz = {
              prefix: "fas",
              iconName: "user-injured",
              icon: [448, 512, [], "f728", "M240 80H342.7c-7.9-19.5-20.4-36.5-36.2-49.9L240 80zm37.7-68.2C261.3 4.2 243.2 0 224 0c-53.7 0-99.7 33.1-118.7 80h81.4l91-68.2zM224 256c70.7 0 128-57.3 128-128c0-5.4-.3-10.8-1-16H97c-.7 5.2-1 10.6-1 16c0 70.7 57.3 128 128 128zM124 312.4c-9.7 3.1-19.1 7-28 11.7V512H243.7L181.5 408.2 124 312.4zm33-7.2L204.3 384H272c44.2 0 80 35.8 80 80c0 18-6 34.6-16 48h82.3c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304H178.3c-7.2 0-14.3 .4-21.3 1.3zM0 482.3C0 498.7 13.3 512 29.7 512H64V345.4C24.9 378.1 0 427.3 0 482.3zM320 464c0-26.5-21.5-48-48-48H223.5l57.1 95.2C303 507.2 320 487.6 320 464z"]
            }, iE = {
              prefix: "fas",
              iconName: "face-sad-tear",
              icon: [512, 512, [128546, "sad-tear"], "f5b4", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm240 80c0-8.8 7.2-16 16-16c45 0 85.6 20.5 115.7 53.1c6 6.5 5.6 16.6-.9 22.6s-16.6 5.6-22.6-.9c-25-27.1-57.4-42.9-92.3-42.9c-8.8 0-16-7.2-16-16zm-80 80c-26.5 0-48-21-48-47c0-20 28.6-60.4 41.6-77.7c3.2-4.4 9.6-4.4 12.8 0C179.6 308.6 208 349 208 369c0 26-21.5 47-48 47zM367.6 208a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm-192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, bz = iE, xz = {
              prefix: "fas",
              iconName: "plane",
              icon: [576, 512, [], "f072", "M482.3 192c34.2 0 93.7 29 93.7 64c0 36-59.5 64-93.7 64l-116.6 0L265.2 495.9c-5.7 10-16.3 16.1-27.8 16.1l-56.2 0c-10.6 0-18.3-10.2-15.4-20.4l49-171.6L112 320 68.8 377.6c-3 4-7.8 6.4-12.8 6.4l-42 0c-7.8 0-14-6.3-14-14c0-1.3 .2-2.6 .5-3.9L32 256 .5 145.9c-.4-1.3-.5-2.6-.5-3.9c0-7.8 6.3-14 14-14l42 0c5 0 9.8 2.4 12.8 6.4L112 192l102.9 0-49-171.6C162.9 10.2 170.6 0 181.2 0l56.2 0c11.5 0 22.1 6.2 27.8 16.1L365.7 192l116.6 0z"]
            }, Dz = {
              prefix: "fas",
              iconName: "tent-arrows-down",
              icon: [576, 512, [], "e581", "M209.8 111.9c-8.9-9.9-24-10.7-33.9-1.8l-39.9 36L136 24c0-13.3-10.7-24-24-24S88 10.7 88 24l0 122.1-39.9-36c-9.9-8.9-25-8.1-33.9 1.8s-8.1 25 1.8 33.9l80 72c9.1 8.2 23 8.2 32.1 0l80-72c9.9-8.9 10.7-24 1.8-33.9zm352 0c-8.9-9.9-24-10.7-33.9-1.8l-39.9 36V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V146.1l-39.9-36c-9.9-8.9-25-8.1-33.9 1.8s-8.1 25 1.8 33.9l80 72c9.1 8.2 23 8.2 32.1 0l80-72c9.9-8.9 10.7-24 1.8-33.9zM307.4 166.5c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S86.7 512 96 512H288V352l96 160h96c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
            }, jz = {
              prefix: "fas",
              iconName: "exclamation",
              icon: [64, 512, [10069, 10071, 61738], "21", "M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V320c0 17.7 14.3 32 32 32s32-14.3 32-32V64zM32 480a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
            }, wz = {
              prefix: "fas",
              iconName: "arrows-spin",
              icon: [512, 512, [], "e4bb", "M256 96c38.4 0 73.7 13.5 101.3 36.1l-32.6 32.6c-4.6 4.6-5.9 11.5-3.5 17.4s8.3 9.9 14.8 9.9H448c8.8 0 16-7.2 16-16V64c0-6.5-3.9-12.3-9.9-14.8s-12.9-1.1-17.4 3.5l-34 34C363.4 52.6 312.1 32 256 32c-10.9 0-21.5 .8-32 2.3V99.2c10.3-2.1 21-3.2 32-3.2zM132.1 154.7l32.6 32.6c4.6 4.6 11.5 5.9 17.4 3.5s9.9-8.3 9.9-14.8V64c0-8.8-7.2-16-16-16H64c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4l34 34C52.6 148.6 32 199.9 32 256c0 10.9 .8 21.5 2.3 32H99.2c-2.1-10.3-3.2-21-3.2-32c0-38.4 13.5-73.7 36.1-101.3zM477.7 224H412.8c2.1 10.3 3.2 21 3.2 32c0 38.4-13.5 73.7-36.1 101.3l-32.6-32.6c-4.6-4.6-11.5-5.9-17.4-3.5s-9.9 8.3-9.9 14.8V448c0 8.8 7.2 16 16 16H448c6.5 0 12.3-3.9 14.8-9.9s1.1-12.9-3.5-17.4l-34-34C459.4 363.4 480 312.1 480 256c0-10.9-.8-21.5-2.3-32zM256 416c-38.4 0-73.7-13.5-101.3-36.1l32.6-32.6c4.6-4.6 5.9-11.5 3.5-17.4s-8.3-9.9-14.8-9.9H64c-8.8 0-16 7.2-16 16l0 112c0 6.5 3.9 12.3 9.9 14.8s12.9 1.1 17.4-3.5l34-34C148.6 459.4 199.9 480 256 480c10.9 0 21.5-.8 32-2.3V412.8c-10.3 2.1-21 3.2-32 3.2z"]
            }, mz = {
              prefix: "fas",
              iconName: "print",
              icon: [512, 512, [128424, 128438, 9113], "f02f", "M128 0C92.7 0 64 28.7 64 64v96h64V64H354.7L384 93.3V160h64V93.3c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0H128zM384 352v32 64H128V384 368 352H384zm64 32h32c17.7 0 32-14.3 32-32V256c0-35.3-28.7-64-64-64H64c-35.3 0-64 28.7-64 64v96c0 17.7 14.3 32 32 32H64v64c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V384zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
            }, AC = {
              prefix: "fas",
              iconName: "turkish-lira-sign",
              icon: [384, 512, ["try", "turkish-lira"], "e2bb", "M96 32c17.7 0 32 14.3 32 32V99.3L247.2 65.2c17-4.9 34.7 5 39.6 22s-5 34.7-22 39.6L128 165.9v29.4l119.2-34.1c17-4.9 34.7 5 39.6 22s-5 34.7-22 39.6L128 261.9V416h63.8c68.2 0 124.4-53.5 127.8-121.6l.4-8c.9-17.7 15.9-31.2 33.6-30.4s31.2 15.9 30.4 33.6l-.4 8C378.5 399.8 294.1 480 191.8 480H96c-17.7 0-32-14.3-32-32V280.1l-23.2 6.6c-17 4.9-34.7-5-39.6-22s5-34.7 22-39.6L64 213.6V184.1l-23.2 6.6c-17 4.9-34.7-5-39.6-22s5-34.7 22-39.6L64 117.6V64c0-17.7 14.3-32 32-32z"]
            }, Bz = AC, Wz = AC, dC = {
              prefix: "fas",
              iconName: "dollar-sign",
              icon: [320, 512, [128178, 61781, "dollar", "usd"], "24", "M160 0c17.7 0 32 14.3 32 32V67.7c1.6 .2 3.1 .4 4.7 .7c.4 .1 .7 .1 1.1 .2l48 8.8c17.4 3.2 28.9 19.9 25.7 37.2s-19.9 28.9-37.2 25.7l-47.5-8.7c-31.3-4.6-58.9-1.5-78.3 6.2s-27.2 18.3-29 28.1c-2 10.7-.5 16.7 1.2 20.4c1.8 3.9 5.5 8.3 12.8 13.2c16.3 10.7 41.3 17.7 73.7 26.3l2.9 .8c28.6 7.6 63.6 16.8 89.6 33.8c14.2 9.3 27.6 21.9 35.9 39.5c8.5 17.9 10.3 37.9 6.4 59.2c-6.9 38-33.1 63.4-65.6 76.7c-13.7 5.6-28.6 9.2-44.4 11V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V445.1c-.4-.1-.9-.1-1.3-.2l-.2 0 0 0c-24.4-3.8-64.5-14.3-91.5-26.3c-16.1-7.2-23.4-26.1-16.2-42.2s26.1-23.4 42.2-16.2c20.9 9.3 55.3 18.5 75.2 21.6c31.9 4.7 58.2 2 76-5.3c16.9-6.9 24.6-16.9 26.8-28.9c1.9-10.6 .4-16.7-1.3-20.4c-1.9-4-5.6-8.4-13-13.3c-16.4-10.7-41.5-17.7-74-26.3l-2.8-.7 0 0C119.4 279.3 84.4 270 58.4 253c-14.2-9.3-27.5-22-35.8-39.6c-8.4-17.9-10.1-37.9-6.1-59.2C23.7 116 52.3 91.2 84.8 78.3c13.3-5.3 27.9-8.9 43.2-11V32c0-17.7 14.3-32 32-32z"]
            }, Sz = dC, Uz = dC, Iz = {
              prefix: "fas",
              iconName: "x",
              icon: [384, 512, [120], "58", "M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"]
            }, sE = {
              prefix: "fas",
              iconName: "magnifying-glass-dollar",
              icon: [512, 512, ["search-dollar"], "f688", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM228 104c0-11-9-20-20-20s-20 9-20 20v14c-7.6 1.7-15.2 4.4-22.2 8.5c-13.9 8.3-25.9 22.8-25.8 43.9c.1 20.3 12 33.1 24.7 40.7c11 6.6 24.7 10.8 35.6 14l1.7 .5c12.6 3.8 21.8 6.8 28 10.7c5.1 3.2 5.8 5.4 5.9 8.2c.1 5-1.8 8-5.9 10.5c-5 3.1-12.9 5-21.4 4.7c-11.1-.4-21.5-3.9-35.1-8.5c-2.3-.8-4.7-1.6-7.2-2.4c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3c1.9 .6 4 1.3 6.1 2.1l0 0 0 0c8.3 2.9 17.9 6.2 28.2 8.4V312c0 11 9 20 20 20s20-9 20-20V298.2c8-1.7 16-4.5 23.2-9c14.3-8.9 25.1-24.1 24.8-45c-.3-20.3-11.7-33.4-24.6-41.6c-11.5-7.2-25.9-11.6-37.1-15l-.7-.2c-12.8-3.9-21.9-6.7-28.3-10.5c-5.2-3.1-5.3-4.9-5.3-6.7c0-3.7 1.4-6.5 6.2-9.3c5.4-3.2 13.6-5.1 21.5-5c9.6 .1 20.2 2.2 31.2 5.2c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-6.5-1.7-13.7-3.4-21.1-4.7V104z"]
            }, Rz = sE, aE = {
              prefix: "fas",
              iconName: "users-gear",
              icon: [640, 512, ["users-cog"], "f509", "M144 160A80 80 0 1 0 144 0a80 80 0 1 0 0 160zm368 0A80 80 0 1 0 512 0a80 80 0 1 0 0 160zM0 298.7C0 310.4 9.6 320 21.3 320H234.7c.2 0 .4 0 .7 0c-26.6-23.5-43.3-57.8-43.3-96c0-7.6 .7-15 1.9-22.3c-13.6-6.3-28.7-9.7-44.6-9.7H106.7C47.8 192 0 239.8 0 298.7zM320 320c24 0 45.9-8.8 62.7-23.3c2.5-3.7 5.2-7.3 8-10.7c2.7-3.3 5.7-6.1 9-8.3C410 262.3 416 243.9 416 224c0-53-43-96-96-96s-96 43-96 96s43 96 96 96zm65.4 60.2c-10.3-5.9-18.1-16.2-20.8-28.2H261.3C187.7 352 128 411.7 128 485.3c0 14.7 11.9 26.7 26.7 26.7H455.2c-2.1-5.2-3.2-10.9-3.2-16.4v-3c-1.3-.7-2.7-1.5-4-2.3l-2.6 1.5c-16.8 9.7-40.5 8-54.7-9.7c-4.5-5.6-8.6-11.5-12.4-17.6l-.1-.2-.1-.2-2.4-4.1-.1-.2-.1-.2c-3.4-6.2-6.4-12.6-9-19.3c-8.2-21.2 2.2-42.6 19-52.3l2.7-1.5c0-.8 0-1.5 0-2.3s0-1.5 0-2.3l-2.7-1.5zM533.3 192H490.7c-15.9 0-31 3.5-44.6 9.7c1.3 7.2 1.9 14.7 1.9 22.3c0 17.4-3.5 33.9-9.7 49c2.5 .9 4.9 2 7.1 3.3l2.6 1.5c1.3-.8 2.6-1.6 4-2.3v-3c0-19.4 13.3-39.1 35.8-42.6c7.9-1.2 16-1.9 24.2-1.9s16.3 .6 24.2 1.9c22.5 3.5 35.8 23.2 35.8 42.6v3c1.3 .7 2.7 1.5 4 2.3l2.6-1.5c16.8-9.7 40.5-8 54.7 9.7c2.3 2.8 4.5 5.8 6.6 8.7c-2.1-57.1-49-102.7-106.6-102.7zm91.3 163.9c6.3-3.6 9.5-11.1 6.8-18c-2.1-5.5-4.6-10.8-7.4-15.9l-2.3-4c-3.1-5.1-6.5-9.9-10.2-14.5c-4.6-5.7-12.7-6.7-19-3L574.4 311c-8.9-7.6-19.1-13.6-30.4-17.6v-21c0-7.3-4.9-13.8-12.1-14.9c-6.5-1-13.1-1.5-19.9-1.5s-13.4 .5-19.9 1.5c-7.2 1.1-12.1 7.6-12.1 14.9v21c-11.2 4-21.5 10-30.4 17.6l-18.2-10.5c-6.3-3.6-14.4-2.6-19 3c-3.7 4.6-7.1 9.5-10.2 14.6l-2.3 3.9c-2.8 5.1-5.3 10.4-7.4 15.9c-2.6 6.8 .5 14.3 6.8 17.9l18.2 10.5c-1 5.7-1.6 11.6-1.6 17.6s.6 11.9 1.6 17.5l-18.2 10.5c-6.3 3.6-9.5 11.1-6.8 17.9c2.1 5.5 4.6 10.7 7.4 15.8l2.4 4.1c3 5.1 6.4 9.9 10.1 14.5c4.6 5.7 12.7 6.7 19 3L449.6 457c8.9 7.6 19.2 13.6 30.4 17.6v21c0 7.3 4.9 13.8 12.1 14.9c6.5 1 13.1 1.5 19.9 1.5s13.4-.5 19.9-1.5c7.2-1.1 12.1-7.6 12.1-14.9v-21c11.2-4 21.5-10 30.4-17.6l18.2 10.5c6.3 3.6 14.4 2.6 19-3c3.7-4.6 7.1-9.4 10.1-14.5l2.4-4.2c2.8-5.1 5.3-10.3 7.4-15.8c2.6-6.8-.5-14.3-6.8-17.9l-18.2-10.5c1-5.7 1.6-11.6 1.6-17.5s-.6-11.9-1.6-17.6l18.2-10.5zM472 384a40 40 0 1 1 80 0 40 40 0 1 1 -80 0z"]
            }, Vz = aE, Cz = {
              prefix: "fas",
              iconName: "person-military-pointing",
              icon: [576, 512, [], "e54a", "M246.9 14.1C234 15.2 224 26 224 39c0 13.8 11.2 25 25 25H400c8.8 0 16-7.2 16-16V17.4C416 8 408 .7 398.7 1.4L246.9 14.1zM240 112c0 44.2 35.8 80 80 80s80-35.8 80-80c0-5.5-.6-10.8-1.6-16H241.6c-1 5.2-1.6 10.5-1.6 16zM72 224c-22.1 0-40 17.9-40 40s17.9 40 40 40H224v89.4L386.8 230.5c-13.3-4.3-27.3-6.5-41.6-6.5H240 72zm345.7 20.9L246.6 416H416V369.7l53.6 90.6c11.2 19 35.8 25.3 54.8 14.1s25.3-35.8 14.1-54.8L462.3 290.8c-11.2-18.9-26.6-34.5-44.6-45.9zM224 448v32c0 17.7 14.3 32 32 32H384c17.7 0 32-14.3 32-32V448H224z"]
            }, jW = {
              prefix: "fas",
              iconName: "building-columns",
              icon: [512, 512, ["bank", "institution", "museum", "university"], "f19c", "M243.4 2.6l-224 96c-14 6-21.8 21-18.7 35.8S16.8 160 32 160v8c0 13.3 10.7 24 24 24H456c13.3 0 24-10.7 24-24v-8c15.2 0 28.3-10.7 31.3-25.6s-4.8-29.9-18.7-35.8l-224-96c-8-3.4-17.2-3.4-25.2 0zM128 224H64V420.3c-.6 .3-1.2 .7-1.8 1.1l-48 32c-11.7 7.8-17 22.4-12.9 35.9S17.9 512 32 512H480c14.1 0 26.5-9.2 30.6-22.7s-1.1-28.1-12.9-35.9l-48-32c-.6-.4-1.2-.7-1.8-1.1V224H384V416H344V224H280V416H232V224H168V416H128V224zM256 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
            }, Oz = jW, yz = jW, kz = jW, Ez = jW, Fz = {
              prefix: "fas",
              iconName: "umbrella",
              icon: [576, 512, [], "f0e9", "M288 0c17.7 0 32 14.3 32 32V49.7C451.8 63.4 557.7 161 573.9 285.9c2 15.6-17.3 24.4-27.8 12.7C532.1 283 504.8 272 480 272c-38.7 0-71 27.5-78.4 64.1c-1.7 8.7-8.7 15.9-17.6 15.9s-15.8-7.2-17.6-15.9C359 299.5 326.7 272 288 272s-71 27.5-78.4 64.1c-1.7 8.7-8.7 15.9-17.6 15.9s-15.8-7.2-17.6-15.9C167 299.5 134.7 272 96 272c-24.8 0-52.1 11-66.1 26.7C19.4 310.4 .1 301.5 2.1 285.9C18.3 161 124.2 63.4 256 49.7V32c0-17.7 14.3-32 32-32zm0 304c12.3 0 23.5 4.6 32 12.2V430.6c0 45-36.5 81.4-81.4 81.4c-30.8 0-59-17.4-72.8-45l-2.3-4.7c-7.9-15.8-1.5-35 14.3-42.9s35-1.5 42.9 14.3l2.3 4.7c3 5.9 9 9.6 15.6 9.6c9.6 0 17.4-7.8 17.4-17.4V316.2c8.5-7.6 19.7-12.2 32-12.2z"]
            }, Nz = {
              prefix: "fas",
              iconName: "trowel",
              icon: [512, 512, [], "e589", "M343.9 213.4L245.3 312l65.4 65.4c7.9 7.9 11.1 19.4 8.4 30.3s-10.8 19.6-21.5 22.9l-256 80c-11.4 3.5-23.8 .5-32.2-7.9S-2.1 481.8 1.5 470.5l80-256c3.3-10.7 12-18.9 22.9-21.5s22.4 .5 30.3 8.4L200 266.7l98.6-98.6c-14.3-14.6-14.2-38 .3-52.5l95.4-95.4c26.9-26.9 70.5-26.9 97.5 0s26.9 70.5 0 97.5l-95.4 95.4c-14.5 14.5-37.9 14.6-52.5 .3z"]
            }, Qz = {
              prefix: "fas",
              iconName: "d",
              icon: [384, 512, [100], "44", "M0 96C0 60.7 28.7 32 64 32h96c123.7 0 224 100.3 224 224s-100.3 224-224 224H64c-35.3 0-64-28.7-64-64V96zm160 0H64V416h96c88.4 0 160-71.6 160-160s-71.6-160-160-160z"]
            }, Yz = {
              prefix: "fas",
              iconName: "stapler",
              icon: [640, 512, [], "e5af", "M640 299.3V304 432c0 26.5-21.5 48-48 48H512 448 64c-17.7 0-32-14.3-32-32s14.3-32 32-32H448V368H96c-17.7 0-32-14.3-32-32V219.4L33.8 214C14.2 210.5 0 193.5 0 173.7c0-8.9 2.9-17.5 8.2-24.6l35.6-47.5C76.7 57.8 128.2 32 182.9 32c27 0 53.6 6.3 77.8 18.4L586.9 213.5C619.5 229.7 640 263 640 299.3zM448 304V288L128 230.9V304H448z"]
            }, oE = {
              prefix: "fas",
              iconName: "masks-theater",
              icon: [640, 512, [127917, "theater-masks"], "f630", "M74.6 373.2c41.7 36.1 108 82.5 166.1 73.7c6.1-.9 12.1-2.5 18-4.5c-9.2-12.3-17.3-24.4-24.2-35.4c-21.9-35-28.8-75.2-25.9-113.6c-20.6 4.1-39.2 13-54.7 25.4c-6.5 5.2-16.3 1.3-14.8-7c6.4-33.5 33-60.9 68.2-66.3c2.6-.4 5.3-.7 7.9-.8l19.4-131.3c2-13.8 8-32.7 25-45.9C278.2 53.2 310.5 37 363.2 32.2c-.8-.7-1.6-1.4-2.4-2.1C340.6 14.5 288.4-11.5 175.7 5.6S20.5 63 5.7 83.9C0 91.9-.8 102 .6 111.8L24.8 276.1c5.5 37.3 21.5 72.6 49.8 97.2zm87.7-219.6c4.4-3.1 10.8-2 11.8 3.3c.1 .5 .2 1.1 .3 1.6c3.2 21.8-11.6 42-33.1 45.3s-41.5-11.8-44.7-33.5c-.1-.5-.1-1.1-.2-1.6c-.6-5.4 5.2-8.4 10.3-6.7c9 3 18.8 3.9 28.7 2.4s19.1-5.3 26.8-10.8zM261.6 390c29.4 46.9 79.5 110.9 137.6 119.7s124.5-37.5 166.1-73.7c28.3-24.5 44.3-59.8 49.8-97.2l24.2-164.3c1.4-9.8 .6-19.9-5.1-27.9c-14.8-20.9-57.3-61.2-170-78.3S299.4 77.2 279.2 92.8c-7.8 6-11.5 15.4-12.9 25.2L242.1 282.3c-5.5 37.3-.4 75.8 19.6 107.7zM404.5 235.3c-7.7-5.5-16.8-9.3-26.8-10.8s-19.8-.6-28.7 2.4c-5.1 1.7-10.9-1.3-10.3-6.7c.1-.5 .1-1.1 .2-1.6c3.2-21.8 23.2-36.8 44.7-33.5s36.3 23.5 33.1 45.3c-.1 .5-.2 1.1-.3 1.6c-1 5.3-7.4 6.4-11.8 3.3zm136.2 15.5c-1 5.3-7.4 6.4-11.8 3.3c-7.7-5.5-16.8-9.3-26.8-10.8s-19.8-.6-28.7 2.4c-5.1 1.7-10.9-1.3-10.3-6.7c.1-.5 .1-1.1 .2-1.6c3.2-21.8 23.2-36.8 44.7-33.5s36.3 23.5 33.1 45.3c-.1 .5-.2 1.1-.3 1.6zM530 350.2c-19.6 44.7-66.8 72.5-116.8 64.9s-87.1-48.2-93-96.7c-1-8.3 8.9-12.1 15.2-6.7c23.9 20.8 53.6 35.3 87 40.3s66.1 .1 94.9-12.8c7.6-3.4 16 3.2 12.6 10.9z"]
            }, Mz = oE, Lz = {
              prefix: "fas",
              iconName: "kip-sign",
              icon: [384, 512, [], "e1c4", "M340.8 88.3c13.4-11.5 15-31.7 3.5-45.1s-31.7-15-45.1-3.5L128 186.4V64c0-17.7-14.3-32-32-32S64 46.3 64 64V224H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H64V448c0 17.7 14.3 32 32 32s32-14.3 32-32V325.6L299.2 472.3c13.4 11.5 33.6 9.9 45.1-3.5s9.9-33.6-3.5-45.1L182.5 288H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H182.5L340.8 88.3z"]
            }, Kz = {
              prefix: "fas",
              iconName: "hand-point-left",
              icon: [512, 512, [], "f0a5", "M32 96C14.3 96 0 110.3 0 128s14.3 32 32 32l208 0 0-64L32 96zM192 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0zm-64-64c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-48 0c-17.7 0-32 14.3-32 32zm96 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0zm88-96l-.6 0c5.4 9.4 8.6 20.3 8.6 32c0 13.2-4 25.4-10.8 35.6c24.9 8.7 42.8 32.5 42.8 60.4c0 11.7-3.1 22.6-8.6 32l8.6 0c88.4 0 160-71.6 160-160l0-61.7c0-42.4-16.9-83.1-46.9-113.1l-11.6-11.6C429.5 77.5 396.9 64 363 64l-27 0c-35.3 0-64 28.7-64 64l0 88c0 22.1 17.9 40 40 40s40-17.9 40-40l0-56c0-8.8 7.2-16 16-16s16 7.2 16 16l0 56c0 39.8-32.2 72-72 72z"]
            }, fE = {
              prefix: "fas",
              iconName: "handshake-simple",
              icon: [640, 512, [129309, "handshake-alt"], "f4c6", "M323.4 85.2l-96.8 78.4c-16.1 13-19.2 36.4-7 53.1c12.9 17.8 38 21.3 55.3 7.8l99.3-77.2c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L550.2 352H592c26.5 0 48-21.5 48-48V176c0-26.5-21.5-48-48-48H516h-4-.7l-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2zm22.8 124.4l-51.7 40.2C263 274.4 217.3 268 193.7 235.6c-22.2-30.5-16.6-73.1 12.7-96.8l83.2-67.3c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-72 48H48c-26.5 0-48 21.5-48 48V304c0 26.5 21.5 48 48 48H156.2l91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c4.5-4.9 7.8-10.6 9.9-16.5c19.4 13 45.8 10.3 62.1-7.5c17.9-19.5 16.6-49.9-2.9-67.8l-134.2-123z"]
            }, Jz = fE, AE = {
              prefix: "fas",
              iconName: "jet-fighter",
              icon: [640, 512, ["fighter-jet"], "f0fb", "M160 24c0-13.3 10.7-24 24-24H296c13.3 0 24 10.7 24 24s-10.7 24-24 24H280L384 192H500.4c7.7 0 15.3 1.4 22.5 4.1L625 234.4c9 3.4 15 12 15 21.6s-6 18.2-15 21.6L522.9 315.9c-7.2 2.7-14.8 4.1-22.5 4.1H384L280 464h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24h8V320H160l-54.6 54.6c-6 6-14.1 9.4-22.6 9.4H64c-17.7 0-32-14.3-32-32V288c-17.7 0-32-14.3-32-32s14.3-32 32-32V160c0-17.7 14.3-32 32-32H82.7c8.5 0 16.6 3.4 22.6 9.4L160 192h32V48h-8c-13.3 0-24-10.7-24-24zM80 240c-8.8 0-16 7.2-16 16s7.2 16 16 16h64c8.8 0 16-7.2 16-16s-7.2-16-16-16H80z"]
            }, zz = AE, dE = {
              prefix: "fas",
              iconName: "square-share-nodes",
              icon: [448, 512, ["share-alt-square"], "f1e1", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM384 160c0 35.3-28.7 64-64 64c-15.4 0-29.5-5.4-40.6-14.5L194.1 256l85.3 46.5c11-9.1 25.2-14.5 40.6-14.5c35.3 0 64 28.7 64 64s-28.7 64-64 64s-64-28.7-64-64c0-2.5 .1-4.9 .4-7.3L174.5 300c-11.7 12.3-28.2 20-46.5 20c-35.3 0-64-28.7-64-64s28.7-64 64-64c18.3 0 34.8 7.7 46.5 20l81.9-44.7c-.3-2.4-.4-4.9-.4-7.3c0-35.3 28.7-64 64-64s64 28.7 64 64z"]
            }, Gz = dE, Zz = {
              prefix: "fas",
              iconName: "barcode",
              icon: [512, 512, [], "f02a", "M24 32C10.7 32 0 42.7 0 56V456c0 13.3 10.7 24 24 24H40c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24H24zm88 0c-8.8 0-16 7.2-16 16V464c0 8.8 7.2 16 16 16s16-7.2 16-16V48c0-8.8-7.2-16-16-16zm72 0c-13.3 0-24 10.7-24 24V456c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24H184zm96 0c-13.3 0-24 10.7-24 24V456c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24H280zM448 56V456c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24H472c-13.3 0-24 10.7-24 24zm-64-8V464c0 8.8 7.2 16 16 16s16-7.2 16-16V48c0-8.8-7.2-16-16-16s-16 7.2-16 16z"]
            }, _z = {
              prefix: "fas",
              iconName: "plus-minus",
              icon: [384, 512, [], "e43c", "M224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V144H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H160V320c0 17.7 14.3 32 32 32s32-14.3 32-32V208H336c17.7 0 32-14.3 32-32s-14.3-32-32-32H224V32zM0 480c0 17.7 14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32z"]
            }, vE = {
              prefix: "fas",
              iconName: "video",
              icon: [576, 512, ["video-camera"], "f03d", "M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2V384c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1V320 192 174.9l14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"]
            }, $z = vE, uE = {
              prefix: "fas",
              iconName: "graduation-cap",
              icon: [640, 512, [127891, "mortar-board"], "f19d", "M320 32c-8.1 0-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6l57.9 20.9C57.3 229.3 48 259.8 48 291.9v28.1c0 28.4-10.8 57.7-22.3 80.8c-6.5 13-13.9 25.8-22.5 37.6C0 442.7-.9 448.3 .9 453.4s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7 .3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7C90.3 344.3 86 329.8 80 316.5V291.9c0-30.2 10.2-58.7 27.9-81.5c12.9-15.5 29.6-28 49.2-35.7l157-61.7c8.2-3.2 17.5 .8 20.7 9s-.8 17.5-9 20.7l-157 61.7c-12.4 4.9-23.3 12.4-32.2 21.6l159.6 57.6c7.6 2.7 15.6 4.1 23.7 4.1s16.1-1.4 23.7-4.1L624.2 182.6c9.5-3.4 15.8-12.5 15.8-22.6s-6.3-19.1-15.8-22.6L343.7 36.1C336.1 33.4 328.1 32 320 32zM128 408c0 35.3 86 72 192 72s192-36.7 192-72L496.7 262.6 354.5 314c-11.1 4-22.8 6-34.5 6s-23.5-2-34.5-6L143.3 262.6 128 408z"]
            }, eG = uE, tG = {
              prefix: "fas",
              iconName: "hand-holding-medical",
              icon: [576, 512, [], "e05c", "M224 24V80H168c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h56v56c0 13.3 10.7 24 24 24h48c13.3 0 24-10.7 24-24V176h56c13.3 0 24-10.7 24-24V104c0-13.3-10.7-24-24-24H320V24c0-13.3-10.7-24-24-24H248c-13.3 0-24 10.7-24 24zM559.7 392.2c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 416H272c-8.8 0-16-7.2-16-16s7.2-16 16-16h16 64c17.7 0 32-14.3 32-32s-14.3-32-32-32H288 272 193.7c-29.1 0-57.3 9.9-80 28L68.8 384H32c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32H192 352.5c29 0 57.3-9.3 80.7-26.5l126.6-93.3zm-367-8.2l.9 0 0 0c-.3 0-.6 0-.9 0z"]
            }, rG = {
              prefix: "fas",
              iconName: "person-circle-check",
              icon: [576, 512, [], "e53e", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V256.9L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6h29.7c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H152zm136 16a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L416 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
            }, lE = {
              prefix: "fas",
              iconName: "turn-up",
              icon: [384, 512, [10548, "level-up-alt"], "f3bf", "M350 177.5c3.8-8.8 2-19-4.6-26l-136-144C204.9 2.7 198.6 0 192 0s-12.9 2.7-17.4 7.5l-136 144c-6.6 7-8.4 17.2-4.6 26s12.5 14.5 22 14.5h88l0 192c0 17.7-14.3 32-32 32H32c-17.7 0-32 14.3-32 32v32c0 17.7 14.3 32 32 32l80 0c70.7 0 128-57.3 128-128l0-192h88c9.6 0 18.2-5.7 22-14.5z"]
            }, nG = lE, D9e = {
              fa0: v,
              fa1: u,
              fa2: l,
              fa3: P,
              fa4: p,
              fa5: c,
              fa6: H,
              fa7: T,
              fa8: q,
              fa9: b,
              faFillDrip: j,
              faArrowsToCircle: w,
              faCircleChevronRight: m,
              faChevronCircleRight: I,
              faAt: N,
              faTrashCan: k,
              faTrashAlt: R,
              faTextHeight: y,
              faUserXmark: O,
              faUserTimes: Y,
              faStethoscope: ee,
              faMessage: Z,
              faCommentAlt: te,
              faInfo: fe,
              faDownLeftAndUpRightToCenter: _,
              faCompressAlt: G,
              faExplosion: L,
              faFileLines: $,
              faFileAlt: ae,
              faFileText: Pe,
              faWaveSquare: ge,
              faRing: me,
              faBuildingUn: Xe,
              faDiceThree: De,
              faCalendarDays: ne,
              faCalendarAlt: re,
              faAnchorCircleCheck: ve,
              faBuildingCircleArrowRight: qe,
              faVolleyball: ke,
              faVolleyballBall: be,
              faArrowsUpToLine: Fe,
              faSortDown: Ke,
              faSortDesc: nt,
              faCircleMinus: ut,
              faMinusCircle: bt,
              faDoorOpen: wt,
              faRightFromBracket: Tt,
              faSignOutAlt: lr,
              faAtom: Qt,
              faSoap: tr,
              faIcons: br,
              faHeartMusicCameraBolt: Xn,
              faMicrophoneLinesSlash: qr,
              faMicrophoneAltSlash: En,
              faBridgeCircleCheck: Bn,
              faPumpMedical: Fi,
              faFingerprint: Gt,
              faHandPointRight: xr,
              faMagnifyingGlassLocation: Br,
              faSearchLocation: nn,
              faForwardStep: sn,
              faStepForward: Pn,
              faFaceSmileBeam: an,
              faSmileBeam: Wn,
              faFlagCheckered: rr,
              faFootball: Sr,
              faFootballBall: nr,
              faSchoolCircleExclamation: Er,
              faCrop: Rn,
              faAnglesDown: Vn,
              faAngleDoubleDown: ki,
              faUsersRectangle: as,
              faPeopleRoof: Rr,
              faPeopleLine: Ii,
              faBeerMugEmpty: is,
              faBeer: ji,
              faDiagramPredecessor: _i,
              faArrowUpLong: oi,
              faLongArrowUp: vr,
              faFireFlameSimple: Fr,
              faBurn: pr,
              faPerson: ds,
              faMale: it,
              faLaptop: $t,
              faFileCsv: Ur,
              faMenorah: $e,
              faTruckPlane: Kt,
              faRecordVinyl: cr,
              faFaceGrinStars: Vr,
              faGrinStars: Lr,
              faBong: pi,
              faSpaghettiMonsterFlying: zr,
              faPastafarianism: Cn,
              faArrowDownUpAcrossLine: Mi,
              faSpoon: li,
              faUtensilSpoon: Xs,
              faJarWheat: Ri,
              faEnvelopesBulk: j1,
              faMailBulk: w1,
              faFileCircleExclamation: di,
              faCircleH: jf,
              faHospitalSymbol: B6,
              faPager: W6,
              faAddressBook: S6,
              faContactBook: qa,
              faStrikethrough: m1,
              faK: Ho,
              faLandmarkFlag: X9,
              faPencil: $o,
              faPencilAlt: T9,
              faBackward: q9,
              faCaretRight: wf,
              faComments: mf,
              faPaste: B1,
              faFileClipboard: h1,
              faCodePullRequest: U6,
              faClipboardList: b9,
              faTruckRampBox: J9,
              faTruckLoading: OA,
              faUserCheck: z1,
              faVialVirus: Zd,
              faSheetPlastic: Zr,
              faBlog: Ts,
              faUserNinja: go,
              faPersonArrowUpFromLine: G1,
              faScrollTorah: z9,
              faTorah: Li,
              faBroomBall: Fa,
              faQuidditch: Sa,
              faQuidditchBroomBall: Fn,
              faToggleOff: I6,
              faBoxArchive: $i,
              faArchive: Ga,
              faPersonDrowning: e1,
              faArrowDown91: Lf,
              faSortNumericDesc: Ua,
              faSortNumericDownAlt: vs,
              faFaceGrinTongueSquint: R6,
              faGrinTongueSquint: Bf,
              faSprayCan: Ie,
              faTruckMonster: Pt,
              faW: Et,
              faEarthAfrica: er,
              faGlobeAfrica: _r,
              faRainbow: Xi,
              faCircleNotch: Mn,
              faTabletScreenButton: _n,
              faTabletAlt: Ps,
              faPaw: qi,
              faCloud: Gs,
              faTrowelBricks: ks,
              faFaceFlushed: Na,
              faFlushed: Ao,
              faHospitalUser: Ro,
              faTentArrowLeftRight: oA,
              faGavel: W1,
              faLegal: je,
              faBinoculars: dt,
              faMicrophoneSlash: kt,
              faBoxTissue: _t,
              faMotorcycle: Cr,
              faBellConcierge: fi,
              faConciergeBell: on,
              faPenRuler: si,
              faPencilRuler: ss,
              faPeopleArrows: hs,
              faPeopleArrowsLeftRight: js,
              faMarsAndVenusBurst: ws,
              faSquareCaretRight: Zs,
              faCaretSquareRight: Ia,
              faScissors: cs,
              faCut: ud,
              faSunPlantWilt: Lv,
              faToiletsPortable: Kv,
              faHockeyPuck: $l,
              faTable: V6,
              faMagnifyingGlassArrowRight: ld,
              faTachographDigital: Jv,
              faDigitalTachograph: zv,
              faUsersSlash: Wc,
              faClover: Sc,
              faReply: Gv,
              faMailReply: _d,
              faStarAndCrescent: eP,
              faHouseFire: J0,
              faSquareMinus: Nu,
              faMinusSquare: Uc,
              faHelicopter: t1,
              faCompass: Pd,
              faSquareCaretDown: Z1,
              faCaretSquareDown: fA,
              faFileCircleQuestion: tP,
              faLaptopCode: AA,
              faSwatchbook: rP,
              faPrescriptionBottle: Qu,
              faBars: Kf,
              faNavicon: cd,
              faPeopleGroup: Xo,
              faHourglassEnd: C6,
              faHourglass3: Zv,
              faHeartCrack: nP,
              faHeartBroken: mp,
              faSquareUpRight: $d,
              faExternalLinkSquareAlt: z0,
              faFaceKissBeam: Ic,
              faKissBeam: iP,
              faFilm: dA,
              faRulerHorizontal: Rc,
              faPeopleRobbery: G0,
              faLightbulb: Vc,
              faCaretLeft: Z0,
              faCircleExclamation: Cc,
              faExclamationCircle: sP,
              faSchoolCircleXmark: ev,
              faArrowRightFromBracket: tv,
              faSignOut: Yu,
              faCircleChevronDown: Bp,
              faChevronCircleDown: Wp,
              faUnlockKeyhole: aP,
              faUnlockAlt: Sp,
              faCloudShowersHeavy: Up,
              faHeadphonesSimple: Ip,
              faHeadphonesAlt: _0,
              faSitemap: gg,
              faCircleDollarToSlot: $0,
              faDonate: Rp,
              faMemory: rv,
              faRoadSpikes: Oc,
              faFireBurner: G9,
              faFlag: yA,
              faHanukiah: e7,
              faFeather: Be,
              faVolumeLow: Qe,
              faVolumeDown: ze,
              faCommentSlash: rt,
              faCloudSunRain: vt,
              faCompress: yt,
              faWheatAwn: Bt,
              faWheatAlt: ar,
              faAnkh: Pr,
              faHandsHoldingChild: Sn,
              faAsterisk: cn,
              faSquareCheck: Gn,
              faCheckSquare: es,
              faPesetaSign: Ys,
              faHeading: S1,
              faHeader: ia,
              faGhost: x9,
              faList: Jf,
              faListSquares: Vo,
              faSquarePhoneFlip: U1,
              faPhoneSquareAlt: vA,
              faCartPlus: Wf,
              faGamepad: _1,
              faCircleDot: $1,
              faDotCircle: D9,
              faFaceDizzy: kA,
              faDizzy: oP,
              faEgg: yc,
              faHouseMedicalCircleXmark: Bq,
              faCampground: Xg,
              faFolderPlus: kc,
              faFutbol: Pa,
              faFutbolBall: nv,
              faSoccerBall: iv,
              faPaintbrush: O6,
              faPaintBrush: t7,
              faLock: Ec,
              faGasPump: Vp,
              faHotTubPerson: Fc,
              faHotTub: fP,
              faMapLocation: r7,
              faMapMarked: Tg,
              faHouseFloodWater: Wq,
              faTree: qg,
              faBridgeLock: Mu,
              faSackDollar: Nc,
              faPenToSquare: Lu,
              faEdit: Ku,
              faCarSide: Qc,
              faShareNodes: sv,
              faShareAlt: p4,
              faHeartCircleMinus: Ju,
              faHourglassHalf: AP,
              faHourglass2: n7,
              faMicroscope: av,
              faSink: pd,
              faBagShopping: Z9,
              faShoppingBag: zu,
              faArrowDownZA: EA,
              faSortAlphaDesc: _9,
              faSortAlphaDownAlt: Sf,
              faMitten: Gu,
              faPersonRays: Sq,
              faUsers: bg,
              faEyeSlash: Es,
              faFlaskVial: FA,
              faHand: Qa,
              faHandPaper: fn,
              faOm: Zu,
              faWorm: Ms,
              faHouseCircleXmark: Ni,
              faPlug: _s,
              faChevronUp: bi,
              faHandSpock: uA,
              faStopwatch: xi,
              faFaceKiss: Ya,
              faKiss: Uf,
              faBridgeCircleXmark: I1,
              faFaceGrinTongue: vo,
              faGrinTongue: NA,
              faChessBishop: _u,
              faFaceGrinWink: ov,
              faGrinWink: QA,
              faEarDeaf: dP,
              faDeaf: lA,
              faDeafness: To,
              faHardOfHearing: Yc,
              faRoadCircleCheck: i7,
              faDiceFive: xg,
              faSquareRss: $9,
              faRssSquare: _v,
              faLandMineOn: e6,
              faICursor: $u,
              faStamp: Mc,
              faStairs: t6,
              faI: zf,
              faHryvniaSign: PA,
              faHryvnia: ef,
              faPills: $v,
              faFaceGrinWide: r6,
              faGrinAlt: Dg,
              faTooth: Cp,
              faV: jg,
              faBangladeshiTakaSign: n6,
              faBicycle: r1,
              faStaffSnake: Us,
              faRodAsclepius: tf,
              faRodSnake: fv,
              faStaffAesculapius: Lc,
              faHeadSideCoughSlash: el,
              faTruckMedical: eu,
              faAmbulance: h4,
              faWheatAwnCircleExclamation: s7,
              faSnowman: wg,
              faMortarPestle: qo,
              faRoadBarrier: a7,
              faSchool: Op,
              faIgloo: Gf,
              faJoint: Av,
              faAngleRight: o7,
              faHorse: hd,
              faQ: f7,
              faG: mg,
              faNotesMedical: YA,
              faTemperatureHalf: n1,
              faTemperature2: dn,
              faThermometer2: i1,
              faThermometerHalf: rf,
              faDongSign: Kc,
              faCapsules: vP,
              faPooStorm: MA,
              faPooBolt: tu,
              faFaceFrownOpen: uP,
              faFrownOpen: R1,
              faHandPointUp: dv,
              faMoneyBill: ru,
              faBookmark: yp,
              faAlignJustify: A7,
              faUmbrellaBeach: vv,
              faHelmetUn: lP,
              faBullseye: H4,
              faBacon: Bg,
              faHandPointDown: d7,
              faArrowUpFromBracket: v7,
              faFolder: Wg,
              faFolderBlank: g4,
              faFileWaveform: kp,
              faFileMedicalAlt: Jc,
              faRadiation: Ep,
              faChartSimple: Sg,
              faMarsStroke: Ug,
              faVial: zc,
              faGauge: Gc,
              faDashboard: Fp,
              faGaugeMed: j9,
              faTachometerAltAverage: tl,
              faWandMagicSparkles: rl,
              faMagicWandSparkles: uv,
              faE: u7,
              faPenClip: y6,
              faPenAlt: Di,
              faBridgeCircleExclamation: Ki,
              faUser: wi,
              faSchoolCircleCheck: Za,
              faDumpster: k6,
              faVanShuttle: Zc,
              faShuttleVan: Np,
              faBuildingUser: _c,
              faSquareCaretLeft: nu,
              faCaretSquareLeft: sa,
              faHighlighter: Ar,
              faKey: Zt,
              faBullhorn: Ln,
              faGlobe: qs,
              faSynagogue: Zf,
              faPersonHalfDress: iu,
              faRoadBridge: Ra,
              faLocationArrow: nl,
              faC: su,
              faTabletButton: il,
              faBuildingLock: E6,
              faPizzaSlice: i6,
              faMoneyBillWave: LA,
              faChartArea: au,
              faAreaChart: lv,
              faHouseFlag: $c,
              faPersonCircleMinus: Qp,
              faBan: e3,
              faCancel: t3,
              faCameraRotate: cA,
              faSprayCanSparkles: _a,
              faAirFreshener: Ig,
              faStar: ba,
              faRepeat: KA,
              faCross: l7,
              faBox: PP,
              faVenusMars: pA,
              faArrowPointer: Yp,
              faMousePointer: Mp,
              faMaximize: Lp,
              faExpandArrowsAlt: Kp,
              faChargingStation: Rg,
              faShapes: sl,
              faTriangleCircleSquare: Jp,
              faShuffle: cP,
              faRandom: Hd,
              faPersonRunning: s6,
              faRunning: Uq,
              faMobileRetro: Ma,
              faGripLinesVertical: P7,
              faSpider: c7,
              faHandsBound: V1,
              faFileInvoiceDollar: gd,
              faPlaneCircleExclamation: X4,
              faXRay: nf,
              faSpellCheck: pP,
              faSlash: ca,
              faComputerMouse: hP,
              faMouse: zp,
              faArrowRightToBracket: r3,
              faSignIn: n3,
              faShopSlash: Gp,
              faStoreAltSlash: T4,
              faServer: i3,
              faVirusCovidSlash: q4,
              faShopLock: Vg,
              faHourglassStart: Zp,
              faHourglass1: Iq,
              faBlenderPhone: C1,
              faBuildingWheat: O1,
              faPersonBreastfeeding: al,
              faRightToBracket: _p,
              faSignInAlt: F6,
              faVenus: HP,
              faPassport: ts,
              faHeartPulse: ou,
              faHeartbeat: p7,
              faPeopleCarryBox: Cg,
              faPeopleCarry: b4,
              faTemperatureHigh: h7,
              faMicrochip: gP,
              faCrown: $p,
              faWeightHanging: eh,
              faXmarksLines: Og,
              faFilePrescription: s3,
              faWeightScale: x4,
              faWeight: yg,
              faUserGroup: fu,
              faUserFriends: th,
              faArrowUpAZ: H1,
              faSortAlphaUp: _f,
              faChessKnight: Au,
              faFaceLaughSquint: XP,
              faLaughSquint: ol,
              faWheelchair: a6,
              faCircleArrowUp: Co,
              faArrowCircleUp: a3,
              faToggleOn: Va,
              faPersonWalking: TP,
              faWalking: rh,
              faL: du,
              faFire: sf,
              faBedPulse: nh,
              faProcedures: Un,
              faShuttleSpace: Xd,
              faSpaceShuttle: ih,
              faFaceLaugh: o3,
              faLaugh: kg,
              faFolderOpen: sh,
              faHeartCirclePlus: ah,
              faCodeFork: Eg,
              faCity: oh,
              faMicrophoneLines: Fg,
              faMicrophoneAlt: H7,
              faPepperHot: f3,
              faUnlock: Pv,
              faColonSign: bo,
              faHeadset: af,
              faStoreSlash: JA,
              faRoadCircleXmark: A3,
              faUserMinus: vu,
              faMarsStrokeUp: zA,
              faMarsStrokeV: D4,
              faChampagneGlasses: Td,
              faGlassCheers: g7,
              faClipboard: d3,
              faHouseCircleExclamation: j4,
              faFileArrowUp: X7,
              faFileUpload: Ng,
              faWifi: v3,
              faWifi3: fh,
              faWifiStrong: Qg,
              faBath: $f,
              faBathtub: bs,
              faUnderline: Oo,
              faUserPen: yo,
              faUserEdit: of,
              faSignature: o6,
              faStroopwafel: cv,
              faBold: ff,
              faAnchorLock: u3,
              faBuildingNgo: pv,
              faManatSign: Ah,
              faNotEqual: l3,
              faBorderTopLeft: uu,
              faBorderStyle: f6,
              faMapLocationDot: T7,
              faMapMarkedAlt: P3,
              faJedi: hv,
              faSquarePollVertical: c3,
              faPoll: fl,
              faMugHot: A6,
              faCarBattery: lu,
              faBatteryCar: Al,
              faGift: q7,
              faDiceTwo: p3,
              faChessQueen: b7,
              faGlasses: qP,
              faChessBoard: dl,
              faBuildingCircleCheck: w9,
              faPersonChalkboard: y1,
              faMarsStrokeRight: If,
              faMarsStrokeH: k1,
              faHandBackFist: qd,
              faHandRock: Yg,
              faSquareCaretUp: h3,
              faCaretSquareUp: Mg,
              faCloudShowersWater: d6,
              faChartBar: Lg,
              faBarChart: bP,
              faHandsBubbles: Pu,
              faHandsWash: x7,
              faLessThanEqual: vl,
              faTrain: w4,
              faEyeLowVision: dh,
              faLowVision: Kg,
              faCrow: D7,
              faSailboat: Rq,
              faWindowRestore: Vq,
              faSquarePlus: Jg,
              faPlusSquare: zg,
              faToriiGate: xP,
              faFrog: Cq,
              faBucket: e9,
              faImage: m4,
              faMicrophone: $a,
              faCow: B4,
              faCaretUp: j7,
              faScrewdriver: W4,
              faFolderClosed: Oq,
              faHouseTsunami: S4,
              faSquareNfi: Gg,
              faArrowUpFromGroundWater: U4,
              faMartiniGlass: N6,
              faGlassMartiniAlt: Zg,
              faRotateLeft: w7,
              faRotateBack: cu,
              faRotateBackward: H3,
              faUndoAlt: DP,
              faTableColumns: g3,
              faColumns: vh,
              faLemon: jP,
              faHeadSideMask: yq,
              faHandshake: m7,
              faGem: wP,
              faDolly: X3,
              faDollyBox: T3,
              faSmoking: mP,
              faMinimize: uh,
              faCompressArrowsAlt: I4,
              faMonument: B7,
              faSnowplow: R4,
              faAnglesRight: W7,
              faAngleDoubleRight: S7,
              faCannabis: hA,
              faCirclePlay: lh,
              faPlayCircle: Ph,
              faTablets: V4,
              faEthernet: C4,
              faEuroSign: q3,
              faEur: uo,
              faEuro: BP,
              faChair: O4,
              faCircleCheck: b3,
              faCheckCircle: D,
              faCircleStop: B,
              faStopCircle: E,
              faCompassDrafting: z,
              faDraftingCompass: Ae,
              faPlateWheat: pe,
              faIcicles: Re,
              faPersonShelter: ot,
              faNeuter: lt,
              faIdBadge: Jt,
              faMarker: Wr,
              faFaceLaughBeam: Xr,
              faLaughBeam: Dr,
              faHelicopterSymbol: Tn,
              faUniversalAccess: In,
              faCircleChevronUp: Kn,
              faChevronCircleUp: La,
              faLariSign: mt,
              faVolcano: pt,
              faPersonWalkingDashedLineArrowRight: It,
              faSterlingSign: Qr,
              faGbp: Jn,
              faPoundSign: On,
              faViruses: vi,
              faSquarePersonConfined: Wi,
              faUserTie: Af,
              faArrowDownLong: xs,
              faLongArrowDown: pu,
              faTentArrowDownToLine: ch,
              faCertificate: RD,
              faReplyAll: kq,
              faMailReplyAll: VD,
              faSuitcase: CD,
              faPersonSkating: OD,
              faSkating: _g,
              faFilterCircleDollar: y4,
              faFunnelDollar: Jm,
              faCameraRetro: zm,
              faCircleArrowDown: yD,
              faArrowCircleDown: Gm,
              faFileImport: kD,
              faArrowRightToFile: Zm,
              faSquareArrowUpRight: ph,
              faExternalLinkSquare: Eq,
              faBoxOpen: $g,
              faScroll: k4,
              faSpa: ED,
              faLocationPinLock: FD,
              faPause: Fq,
              faHillAvalanche: ND,
              faTemperatureEmpty: hh,
              faTemperature0: ul,
              faThermometer0: Hh,
              faThermometerEmpty: QD,
              faBomb: eX,
              faRegistered: YD,
              faAddressCard: E4,
              faContactCard: Nq,
              faVcard: MD,
              faScaleUnbalancedFlip: Qq,
              faBalanceScaleRight: Yq,
              faSubscript: bd,
              faDiamondTurnRight: Mq,
              faDirections: LD,
              faBurst: Lq,
              faHouseLaptop: x3,
              faLaptopHouse: Kq,
              faFaceTired: tX,
              faTired: Jq,
              faMoneyBills: zq,
              faSmog: _m,
              faCrutch: ko,
              faFontAwesome: F4,
              faFontAwesomeFlag: N4,
              faFontAwesomeLogoFull: rX,
              faCloudArrowUp: Q4,
              faCloudUpload: KD,
              faCloudUploadAlt: Gq,
              faPalette: nX,
              faArrowsTurnRight: Zq,
              faVest: Y4,
              faFerry: gh,
              faArrowsDownToPeople: $m,
              faSeedling: iX,
              faSprout: eB,
              faLeftRight: JD,
              faArrowsAltH: HA,
              faBoxesPacking: sX,
              faCircleArrowLeft: aX,
              faArrowCircleLeft: D3,
              faGroupArrowsRotate: zD,
              faBowlFood: Xh,
              faCandyCane: Th,
              faArrowDownWideShort: U7,
              faSortAmountAsc: _q,
              faSortAmountDown: M4,
              faCloudBolt: I7,
              faThunderstorm: GD,
              faTextSlash: qh,
              faRemoveFormat: ZD,
              faFaceSmileWink: $q,
              faSmileWink: tB,
              faFileWord: rB,
              faFilePowerpoint: oX,
              faArrowsLeftRight: j3,
              faArrowsH: eb,
              faHouseLock: nB,
              faCloudArrowDown: R7,
              faCloudDownload: iB,
              faCloudDownloadAlt: _D,
              faChildren: sB,
              faChalkboard: $D,
              faBlackboard: aB,
              faUserLargeSlash: ej,
              faUserAltSlash: oB,
              faEnvelopeOpen: fB,
              faHandshakeSimpleSlash: tj,
              faHandshakeAltSlash: AB,
              faMattressPillow: tb,
              faGuaraniSign: rb,
              faArrowsRotate: fX,
              faRefresh: nb,
              faSync: dB,
              faFireExtinguisher: AX,
              faCruzeiroSign: dX,
              faGreaterThanEqual: vB,
              faShieldHalved: V7,
              faShieldAlt: vX,
              faBookAtlas: ib,
              faAtlas: C7,
              faVirus: rj,
              faEnvelopeCircleCheck: L4,
              faLayerGroup: nj,
              faArrowsToDot: uX,
              faArchway: bh,
              faHeartCircleCheck: ll,
              faHouseChimneyCrack: xd,
              faHouseDamage: Pl,
              faFileZipper: lX,
              faFileArchive: PX,
              faSquare: K4,
              faMartiniGlassEmpty: sb,
              faGlassMartini: ij,
              faCouch: ab,
              faCediSign: hu,
              faItalic: ob,
              faChurch: J4,
              faCommentsDollar: WP,
              faDemocrat: w3,
              faZ: Q6,
              faPersonSkiing: t9,
              faSkiing: fb,
              faRoadLock: Dd,
              faA: Hu,
              faTemperatureArrowDown: gu,
              faTemperatureDown: cX,
              faFeatherPointed: m3,
              faFeatherAlt: sj,
              faP: O7,
              faSnowflake: z4,
              faNewspaper: cl,
              faRectangleAd: y7,
              faAd: Ab,
              faCircleArrowRight: db,
              faArrowCircleRight: aj,
              faFilterCircleXmark: G4,
              faLocust: oj,
              faSort: fj,
              faUnsorted: vb,
              faListOl: k7,
              faList12: Aj,
              faListNumeric: Z4,
              faPersonDressBurst: pl,
              faMoneyCheckDollar: xh,
              faMoneyCheckAlt: uB,
              faVectorSquare: lB,
              faBreadSlice: PB,
              faLanguage: cB,
              faFaceKissWinkHeart: dj,
              faKissWinkHeart: vj,
              faFilter: pX,
              faQuestion: uj,
              faFileSignature: pB,
              faUpDownLeftRight: E7,
              faArrowsAlt: Dh,
              faHouseChimneyUser: hB,
              faHandHoldingHeart: _4,
              faPuzzlePiece: lj,
              faMoneyCheck: Pj,
              faStarHalfStroke: ub,
              faStarHalfAlt: cj,
              faCode: pj,
              faWhiskeyGlass: GA,
              faGlassWhiskey: jh,
              faBuildingCircleExclamation: SP,
              faMagnifyingGlassChart: hj,
              faArrowUpRightFromSquare: lb,
              faExternalLink: Pb,
              faCubesStacked: HB,
              faWonSign: cb,
              faKrw: UP,
              faWon: $4,
              faVirusCovid: pb,
              faAustralSign: Hj,
              faF: Y6,
              faLeaf: F7,
              faRoad: gj,
              faTaxi: B3,
              faCab: W3,
              faPersonCirclePlus: N7,
              faChartPie: S3,
              faPieChart: Hv,
              faBoltLightning: Q7,
              faSackXmark: eT,
              faFileExcel: s1,
              faFileContract: E1,
              faFishFins: ZA,
              faBuildingFlag: Xu,
              faFaceGrinBeam: v6,
              faGrinBeam: Xj,
              faObjectUngroup: hX,
              faPoop: wh,
              faLocationPin: IP,
              faMapMarker: M6,
              faKaaba: tT,
              faToiletPaper: RP,
              faHelmetSafety: mh,
              faHardHat: Y7,
              faHatHard: M7,
              faEject: U3,
              faCircleRight: L6,
              faArrowAltCircleRight: Bh,
              faPlaneCircleCheck: hl,
              faFaceRollingEyes: jd,
              faMehRollingEyes: VP,
              faObjectGroup: xo,
              faChartLine: Rf,
              faLineChart: HX,
              faMaskVentilator: gA,
              faArrowRight: gv,
              faSignsPost: K6,
              faMapSigns: L7,
              faCashRegister: CP,
              faPersonCircleQuestion: gX,
              faH: Wh,
              faTarp: XX,
              faScrewdriverWrench: Xv,
              faTools: K7,
              faArrowsToEye: hb,
              faPlugCircleBolt: Hb,
              faHeart: Tj,
              faMarsAndVenus: OP,
              faHouseUser: F1,
              faHomeUser: qj,
              faDumpsterFire: yP,
              faHouseCrack: Sh,
              faMartiniGlassCitrus: Tv,
              faCocktail: J7,
              faFaceSurprise: z7,
              faSurprise: TX,
              faBottleWater: gb,
              faCirclePause: rT,
              faPauseCircle: XA,
              faToiletPaperSlash: wd,
              faAppleWhole: I3,
              faAppleAlt: nT,
              faKitchenSet: R3,
              faR: qv,
              faTemperatureQuarter: J6,
              faTemperature1: Hl,
              faThermometer1: gl,
              faThermometerQuarter: Tu,
              faCube: gB,
              faBitcoinSign: bj,
              faShieldDog: Xb,
              faSolarPanel: kP,
              faLockOpen: iT,
              faElevator: qX,
              faMoneyBillTransfer: G7,
              faMoneyBillTrendUp: xj,
              faHouseFloodWaterCircleArrowRight: Z7,
              faSquarePollHorizontal: sT,
              faPollH: Tb,
              faCircle: EP,
              faBackwardFast: r9,
              faFastBackward: TA,
              faRecycle: md,
              faUserAstronaut: V3,
              faPlaneSlash: C3,
              faTrademark: Dj,
              faBasketball: aT,
              faBasketballBall: XB,
              faSatelliteDish: jj,
              faCircleUp: oT,
              faArrowAltCircleUp: wj,
              faMobileScreenButton: qb,
              faMobileAlt: bX,
              faVolumeHigh: xX,
              faVolumeUp: fT,
              faUsersRays: DX,
              faWallet: jX,
              faClipboardCheck: AT,
              faFileAudio: dT,
              faBurger: _7,
              faHamburger: vT,
              faWrench: uT,
              faBugs: bb,
              faRupeeSign: O3,
              faRupee: mj,
              faFileImage: Bj,
              faCircleQuestion: Uh,
              faQuestionCircle: $7,
              faPlaneDeparture: a1,
              faHandshakeSlash: Ih,
              faBookBookmark: lT,
              faCodeBranch: PT,
              faHatCowboy: Wj,
              faBridge: Bd,
              faPhoneFlip: Rh,
              faPhoneAlt: FP,
              faTruckFront: eH,
              faCat: Vh,
              faAnchorCircleExclamation: wX,
              faTruckField: tH,
              faRoute: Ch,
              faClipboardQuestion: NP,
              faPanorama: u6,
              faCommentMedical: Oh,
              faTeethOpen: rH,
              faFileCircleMinus: Wd,
              faTags: xb,
              faWineGlass: QP,
              faForwardFast: Xl,
              faFastForward: nH,
              faFaceMehBlank: yh,
              faMehBlank: iH,
              faSquareParking: Tl,
              faParking: kh,
              faHouseSignal: sH,
              faBarsProgress: _A,
              faTasksAlt: YP,
              faFaucetDrip: ql,
              faCartFlatbed: Sj,
              faDollyFlatbed: Uj,
              faBanSmoking: y3,
              faSmokingBan: df,
              faTerminal: MP,
              faMobileButton: Db,
              faHouseMedicalFlag: TB,
              faBasketShopping: jb,
              faShoppingBasket: Ij,
              faTape: cT,
              faBusSimple: l6,
              faBusAlt: wb,
              faEye: k3,
              faFaceSadCry: mX,
              faSadCry: Rj,
              faAudioDescription: aH,
              faPersonMilitaryToPerson: mb,
              faFileShield: BX,
              faUserSlash: Bb,
              faPen: pn,
              faTowerObservation: $A,
              faFileCode: pT,
              faSignal: Sd,
              faSignal5: bv,
              faSignalPerfect: Ca,
              faBus: m9,
              faHeartCircleXmark: B9,
              faHouseChimney: E3,
              faHomeLg: WX,
              faWindowMaximize: Vj,
              faFaceFrown: jr,
              faFrown: Ud,
              faPrescription: bl,
              faShop: SX,
              faStoreAlt: Oa,
              faFloppyDisk: bn,
              faSave: Eh,
              faVihara: Wb,
              faScaleUnbalanced: P6,
              faBalanceScaleLeft: hT,
              faSortUp: xl,
              faSortAsc: HT,
              faCommentDots: UX,
              faCommenting: LP,
              faPlantWilt: F3,
              faDiamond: Sb,
              faFaceGrinSquint: Fh,
              faGrinSquint: gT,
              faHandHoldingDollar: XT,
              faHandHoldingUsd: TT,
              faBacterium: Ub,
              faHandPointer: Cj,
              faDrumSteelpan: qT,
              faHandScissors: oH,
              faHandsPraying: N3,
              faPrayingHands: IX,
              faArrowRotateRight: Dl,
              faArrowRightRotate: fH,
              faArrowRotateForward: AH,
              faRedo: Q3,
              faBiohazard: RX,
              faLocationCrosshairs: VX,
              faLocation: Y3,
              faMarsDouble: KP,
              faChildDress: dH,
              faUsersBetweenLines: CX,
              faLungsVirus: Ib,
              faFaceGrinTears: JP,
              faGrinTears: OX,
              faPhone: qB,
              faCalendarXmark: yX,
              faCalendarTimes: Nh,
              faChildReaching: qu,
              faHeadSideVirus: Qh,
              faUserGear: M3,
              faUserCog: vH,
              faArrowUp19: bT,
              faSortNumericUp: xT,
              faDoorClosed: uH,
              faShieldVirus: kX,
              faDiceSix: Rb,
              faMosquitoNet: DT,
              faBridgeWater: jT,
              faPersonBooth: Oj,
              faTextWidth: Vb,
              faHatWizard: Yh,
              faPenFancy: xv,
              faPersonDigging: EX,
              faDigging: L3,
              faTrash: lH,
              faGaugeSimple: wT,
              faGaugeSimpleMed: zP,
              faTachometerAverage: Mh,
              faBookMedical: yj,
              faPoo: Id,
              faQuoteRight: Eo,
              faQuoteRightAlt: N1,
              faShirt: ed,
              faTShirt: ui,
              faTshirt: Vf,
              faCubes: mT,
              faDivide: Lh,
              faTengeSign: kj,
              faTenge: xn,
              faHeadphones: Kh,
              faHandsHolding: BT,
              faHandsClapping: GP,
              faRepublican: ZP,
              faArrowLeft: $s,
              faPersonCircleXmark: eo,
              faRuler: vf,
              faAlignLeft: K3,
              faDiceD6: Jh,
              faRestroom: zh,
              faJ: Cb,
              faUsersViewfinder: Gh,
              faFileVideo: ur,
              faUpRightFromSquare: z6,
              faExternalLinkAlt: uf,
              faTableCells: WT,
              faTh: aa,
              faFilePdf: un,
              faBookBible: J3,
              faBible: Ob,
              faO: G6,
              faSuitcaseMedical: ST,
              faMedkit: PH,
              faUserSecret: cH,
              faOtter: yb,
              faPersonDress: FX,
              faFemale: bu,
              faCommentDollar: td,
              faBusinessTime: UT,
              faBriefcaseClock: kb,
              faTableCellsLarge: IT,
              faThLarge: Eb,
              faBookTanakh: RT,
              faTanakh: wU,
              faPhoneVolume: bB,
              faVolumeControlPhone: NX,
              faHatCowboySide: Zh,
              faClipboardUser: QX,
              faChild: Fb,
              faLiraSign: Ej,
              faSatellite: Nb,
              faPlaneLock: Qb,
              faTag: VT,
              faComment: CT,
              faCakeCandles: pH,
              faBirthdayCake: hH,
              faCake: OT,
              faEnvelope: YX,
              faAnglesUp: HH,
              faAngleDoubleUp: yT,
              faPaperclip: kT,
              faArrowRightToCity: MX,
              faRibbon: ET,
              faLungs: FT,
              faArrowUp91: gH,
              faSortNumericUpAlt: LX,
              faLitecoinSign: Fj,
              faBorderNone: NT,
              faCircleNodes: QT,
              faParachuteBox: Nj,
              faIndent: YT,
              faTruckFieldUn: KX,
              faHourglass: Rd,
              faHourglassEmpty: Yb,
              faMountain: JX,
              faUserDoctor: _P,
              faUserMd: Mb,
              faCircleInfo: MT,
              faInfoCircle: LT,
              faCloudMeatball: Qj,
              faCamera: zX,
              faCameraAlt: XH,
              faSquareVirus: Lb,
              faMeteor: Yj,
              faCarOn: Mj,
              faSleigh: GX,
              faArrowDown19: TH,
              faSortNumericAsc: Kb,
              faSortNumericDown: xB,
              faHandHoldingDroplet: KT,
              faHandHoldingWater: Jb,
              faWater: Lj,
              faCalendarCheck: Kj,
              faBraille: ZX,
              faPrescriptionBottleMedical: zb,
              faPrescriptionBottleAlt: Jj,
              faLandmark: zj,
              faTruck: Gb,
              faCrosshairs: jl,
              faPersonCane: xu,
              faTent: JT,
              faVestPatches: Zb,
              faCheckDouble: Qi,
              faArrowDownAZ: wl,
              faSortAlphaAsc: _b,
              faSortAlphaDown: zT,
              faMoneyBillWheat: _X,
              faCookie: $X,
              faArrowRotateLeft: _h,
              faArrowLeftRotate: e2,
              faArrowRotateBack: Gj,
              faArrowRotateBackward: Zj,
              faUndo: DB,
              faHardDrive: $b,
              faHdd: GT,
              faFaceGrinSquintTears: t2,
              faGrinSquintTears: ZT,
              faDumbbell: _j,
              faRectangleList: $h,
              faListAlt: ml,
              faTarpDroplet: ex,
              faHouseMedicalCircleCheck: Du,
              faPersonSkiingNordic: _T,
              faSkiingNordic: tx,
              faCalendarPlus: ju,
              faPlaneArrival: rx,
              faCircleLeft: $j,
              faArrowAltCircleLeft: nx,
              faTrainSubway: $T,
              faSubway: e8,
              faChartGantt: r2,
              faIndianRupeeSign: Fo,
              faIndianRupee: t8,
              faInr: jB,
              faCropSimple: n2,
              faCropAlt: r8,
              faMoneyBill1: rd,
              faMoneyBillAlt: Bl,
              faLeftLong: e0,
              faLongArrowAltLeft: n9,
              faDna: qH,
              faVirusSlash: z3,
              faMinus: t0,
              faSubtract: bH,
              faChess: i2,
              faArrowLeftLong: Ti,
              faLongArrowLeft: c6,
              faPlugCircleCheck: No,
              faStreetView: Ka,
              faFrancSign: Wl,
              faVolumeOff: n8,
              faHandsAslInterpreting: lf,
              faAmericanSignLanguageInterpreting: s2,
              faAslInterpreting: G3,
              faHandsAmericanSignLanguageInterpreting: i8,
              faGear: Z3,
              faCog: s8,
              faDropletSlash: a2,
              faTintSlash: o2,
              faMosque: ix,
              faMosquito: a8,
              faStarOfDavid: ew,
              faPersonMilitaryRifle: xH,
              faCartShopping: o8,
              faShoppingCart: zn,
              faVials: f8,
              faPlugCirclePlus: sx,
              faPlaceOfWorship: DH,
              faGripVertical: $P,
              faArrowTurnUp: ec,
              faLevelUp: r0,
              faU: f2,
              faSquareRootVariable: A8,
              faSquareRootAlt: ax,
              faClock: Sl,
              faClockFour: tw,
              faBackwardStep: _3,
              faStepBackward: ox,
              faPallet: fx,
              faFaucet: A2,
              faBaseballBatBall: n0,
              faS: d2,
              faTimeline: Dv,
              faKeyboard: d8,
              faCaretDown: Ax,
              faHouseChimneyMedical: jH,
              faClinicMedical: v2,
              faTemperatureThreeQuarters: v8,
              faTemperature3: Vd,
              faThermometer3: $3,
              faThermometerThreeQuarters: wB,
              faMobileScreen: W9,
              faMobileAndroidAlt: u8,
              faPlaneUp: nd,
              faPiggyBank: dx,
              faBatteryHalf: rw,
              faBattery3: i0,
              faMountainCity: vx,
              faCoins: nw,
              faKhanda: mB,
              faSliders: s0,
              faSlidersH: l8,
              faFolderTree: tc,
              faNetworkWired: iw,
              faMapPin: u2,
              faHamsa: P8,
              faCentSign: c8,
              faFlask: wu,
              faPersonPregnant: ux,
              faWandSparkles: lx,
              faEllipsisVertical: l2,
              faEllipsisV: P2,
              faTicket: c2,
              faPowerOff: p2,
              faRightLong: Cf,
              faLongArrowAltRight: BB,
              faFlagUsa: sw,
              faLaptopFile: WB,
              faTty: Px,
              faTeletype: wH,
              faDiagramNext: p8,
              faPersonRifle: p6,
              faHouseMedicalCircleExclamation: SB,
              faClosedCaptioning: Qn,
              faPersonHiking: ep,
              faHiking: mH,
              faVenusDouble: a0,
              faImages: UB,
              faCalculator: aw,
              faPeoplePulling: cx,
              faN: IB,
              faCableCar: jv,
              faTram: BH,
              faCloudRain: h2,
              faBuildingCircleXmark: ow,
              faShip: RB,
              faArrowsDownToLine: px,
              faDownload: VB,
              faFaceGrin: fw,
              faGrin: mu,
              faDeleteLeft: Ul,
              faBackspace: tp,
              faEyeDropper: hx,
              faEyeDropperEmpty: CB,
              faEyedropper: OB,
              faFileCircleCheck: Aw,
              faForward: yB,
              faMobile: h8,
              faMobileAndroid: H8,
              faMobilePhone: Hx,
              faFaceMeh: WH,
              faMeh: kB,
              faAlignCenter: H2,
              faBookSkull: g8,
              faBookDead: S9,
              faIdCard: id,
              faDriversLicense: EB,
              faOutdent: wv,
              faDedent: gx,
              faHeartCircleExclamation: dw,
              faHouse: X8,
              faHome: vw,
              faHomeAlt: uw,
              faHomeLgAlt: Bu,
              faCalendarWeek: T8,
              faLaptopMedical: Cd,
              faB: lw,
              faFileMedical: rc,
              faDiceOne: q8,
              faKiwiBird: Pw,
              faArrowRightArrowLeft: Xx,
              faExchange: FB,
              faRotateRight: g2,
              faRedoAlt: mv,
              faRotateForward: SH,
              faUtensils: cw,
              faCutlery: UH,
              faArrowUpWideShort: b8,
              faSortAmountUp: Tx,
              faMillSign: pw,
              faBowlRice: hw,
              faSkull: NB,
              faTowerBroadcast: Hw,
              faBroadcastTower: qx,
              faTruckPickup: QB,
              faUpLong: x8,
              faLongArrowAltUp: YB,
              faStop: MB,
              faCodeMerge: o0,
              faUpload: gw,
              faHurricane: LB,
              faMound: KB,
              faToiletPortable: Od,
              faCompactDisc: D8,
              faFileArrowDown: Xw,
              faFileDownload: bx,
              faCaravan: nc,
              faShieldCat: h6,
              faBolt: Bv,
              faZap: Pf,
              faGlassWater: j8,
              faOilWell: g1,
              faVault: Wv,
              faMars: ic,
              faToilet: X2,
              faPlaneCircleXmark: sc,
              faYenSign: rp,
              faCny: f0,
              faJpy: Tw,
              faRmb: T2,
              faYen: ms,
              faRubleSign: U9,
              faRouble: X1,
              faRub: i9,
              faRuble: Il,
              faSun: q2,
              faGuitar: cf,
              faFaceLaughWink: IH,
              faLaughWink: w8,
              faHorseHead: b2,
              faBoreHole: np,
              faIndustry: A0,
              faCircleDown: Z6,
              faArrowAltCircleDown: x2,
              faArrowsTurnToDots: qw,
              faFlorinSign: bw,
              faArrowDownShortWide: xx,
              faSortAmountDesc: ac,
              faSortAmountDownAlt: RH,
              faLessThan: Dx,
              faAngleDown: m8,
              faCarTunnel: B8,
              faHeadSideCough: d0,
              faGripLines: ip,
              faThumbsDown: oc,
              faUserLock: VH,
              faArrowRightLong: D2,
              faLongArrowRight: W8,
              faAnchorCircleXmark: xw,
              faEllipsis: v0,
              faEllipsisH: S8,
              faChessPawn: U8,
              faKitMedical: CH,
              faFirstAid: Dw,
              faPersonThroughWindow: u0,
              faToolbox: OH,
              faHandsHoldingCircle: j2,
              faBug: I8,
              faCreditCard: jx,
              faCreditCardAlt: R8,
              faCar: I9,
              faAutomobile: sp,
              faHandHoldingHand: JB,
              faBookOpenReader: Qo,
              faBookReader: zB,
              faMountainSun: jw,
              faArrowsLeftRightToLine: qA,
              faDiceD20: w2,
              faTruckDroplet: mx,
              faFileCircleXmark: ww,
              faTemperatureArrowUp: mw,
              faTemperatureUp: V8,
              faMedal: ap,
              faBed: Bw,
              faSquareH: Ww,
              faHSquare: Bx,
              faPodcast: GB,
              faTemperatureFull: yd,
              faTemperature4: Wx,
              faThermometer4: C8,
              faThermometerFull: Sx,
              faBell: l0,
              faSuperscript: Sw,
              faPlugCircleXmark: Ux,
              faStarOfLife: g,
              faPhoneSlash: x,
              faPaintRoller: U,
              faHandshakeAngle: F,
              faHandsHelping: K,
              faLocationDot: oe,
              faMapMarkerAlt: ce,
              faFile: Te,
              faGreaterThan: Ce,
              faPersonSwimming: tt,
              faSwimmer: ft,
              faArrowDown: Rt,
              faDroplet: ct,
              faTint: Ft,
              faEraser: wr,
              faEarthAmericas: Yr,
              faEarth: Si,
              faEarthAmerica: os,
              faGlobeAmericas: Ci,
              faPersonBurst: ea,
              faDove: to,
              faBatteryEmpty: Nt,
              faBattery0: dr,
              faSocks: ht,
              faInbox: Or,
              faSection: hn,
              faGaugeHigh: Nn,
              faTachometerAlt: Fs,
              faTachometerAltFast: Do,
              faEnvelopeOpenText: o1,
              faHospital: pa,
              faHospitalAlt: pf,
              faHospitalWide: Ls,
              faWineBottle: lo,
              faChessRook: s9,
              faBarsStaggered: Yo,
              faReorder: Rl,
              faStream: Q1,
              faDharmachakra: Sv,
              faHotdog: P0,
              faPersonWalkingWithCane: op,
              faBlind: Vl,
              faDrum: Ix,
              faIceCream: mU,
              faHeartCircleBolt: BU,
              faFax: TV,
              faParagraph: qV,
              faCheckToSlot: O8,
              faVoteYea: Cl,
              faStarHalf: y8,
              faBoxesStacked: ZB,
              faBoxes: k8,
              faBoxesAlt: _B,
              faLink: Uw,
              faChain: WU,
              faEarListen: $B,
              faAssistiveListeningSystems: bV,
              faTreeCity: xV,
              faPlay: eW,
              faFont: DV,
              faRupiahSign: tW,
              faMagnifyingGlass: SU,
              faSearch: jV,
              faTableTennisPaddleBall: Rx,
              faPingPongPaddleBall: UU,
              faTableTennis: wV,
              faPersonDotsFromLine: Uv,
              faDiagnoses: rW,
              faTrashCanArrowUp: IU,
              faTrashRestoreAlt: mV,
              faNairaSign: m2,
              faCartArrowDown: BV,
              faWalkieTalkie: WV,
              faFilePen: Iw,
              faFileEdit: nW,
              faReceipt: yH,
              faSquarePen: iW,
              faPenSquare: SV,
              faPencilSquare: UV,
              faSuitcaseRolling: RU,
              faPersonCircleExclamation: sW,
              faChevronDown: IV,
              faBatteryFull: aW,
              faBattery: oW,
              faBattery5: VU,
              faSkullCrossbones: RV,
              faCodeCompare: CU,
              faListUl: Rw,
              faListDots: VV,
              faSchoolLock: fW,
              faTowerCell: AW,
              faDownLong: dW,
              faLongArrowAltDown: CV,
              faRankingStar: OU,
              faChessKing: yU,
              faPersonHarassing: Vx,
              faBrazilianRealSign: Vw,
              faLandmarkDome: kU,
              faLandmarkAlt: EU,
              faArrowUp: vW,
              faTv: uW,
              faTelevision: OV,
              faTvAlt: FU,
              faShrimp: NU,
              faListCheck: QU,
              faTasks: YU,
              faJugDetergent: yV,
              faCircleUser: lW,
              faUserCircle: MU,
              faUserShield: LU,
              faWind: KU,
              faCarBurst: PW,
              faCarCrash: JU,
              faY: zU,
              faPersonSnowboarding: cW,
              faSnowboarding: GU,
              faTruckFast: pW,
              faShippingFast: ZU,
              faFish: _U,
              faUserGraduate: $U,
              faCircleHalfStroke: hW,
              faAdjust: eI,
              faClapperboard: HW,
              faCircleRadiation: tI,
              faRadiationAlt: kV,
              faBaseball: rI,
              faBaseballBall: EV,
              faJetFighterUp: nI,
              faDiagramProject: Cw,
              faProjectDiagram: FV,
              faCopy: Ow,
              faVolumeXmark: gW,
              faVolumeMute: NV,
              faVolumeTimes: yw,
              faHandSparkles: Cx,
              faGrip: XW,
              faGripHorizontal: QV,
              faShareFromSquare: TW,
              faShareSquare: qW,
              faChildCombatant: bW,
              faChildRifle: YV,
              faGun: MV,
              faSquarePhone: Ox,
              faPhoneSquare: LV,
              faPlus: iI,
              faAdd: KV,
              faExpand: JV,
              faComputer: zV,
              faXmark: yx,
              faClose: GV,
              faMultiply: xW,
              faRemove: ZV,
              faTimes: _V,
              faArrowsUpDownLeftRight: sI,
              faArrows: $V,
              faChalkboardUser: DW,
              faChalkboardTeacher: h,
              faPesoSign: X,
              faBuildingShield: W,
              faBaby: V,
              faUsersLine: Q,
              faQuoteLeft: ie,
              faQuoteLeftAlt: le,
              faTractor: He,
              faTrashArrowUp: xe,
              faTrashRestore: Je,
              faArrowDownUpLock: _e,
              faLinesLeaning: qt,
              faRulerCombined: Ht,
              faCopyright: Mt,
              faEquals: Lt,
              faBlender: or,
              faTeeth: yn,
              faShekelSign: hi,
              faIls: Pi,
              faShekel: Ks,
              faSheqel: Is,
              faSheqelSign: Vt,
              faMap: fr,
              faRocket: Ct,
              faPhotoFilm: Nr,
              faPhotoVideo: kn,
              faFolderMinus: mn,
              faStore: Ei,
              faArrowTrendUp: rs,
              faPlugCircleMinus: ro,
              faSignHanging: oa,
              faSign: a9,
              faBezierCurve: ha,
              faBellSlash: Of,
              faTablet: bA,
              faTabletAndroid: xA,
              faSchoolFlag: Wu,
              faFill: kd,
              faAngleUp: Ed,
              faDrumstickBite: sd,
              faHollyBerry: c0,
              faChevronLeft: E8,
              faBacteria: kx,
              faHandLizard: fp,
              faNotdef: eC,
              faDisease: tC,
              faBriefcaseMedical: BM,
              faGenderless: WM,
              faChevronRight: SM,
              faRetweet: UM,
              faCarRear: Zy,
              faCarAlt: IM,
              faPumpSoap: RM,
              faVideoSlash: VM,
              faBatteryQuarter: _y,
              faBattery2: CM,
              faRadio: OM,
              faBabyCarriage: $y,
              faCarriageBaby: yM,
              faTrafficLight: kM,
              faThermometer: EM,
              faVrCardboard: FM,
              faHandMiddleFinger: NM,
              faPercent: ek,
              faPercentage: QM,
              faTruckMoving: YM,
              faGlassWaterDroplet: MM,
              faDisplay: LM,
              faFaceSmile: tk,
              faSmile: KM,
              faThumbtack: rk,
              faThumbTack: JM,
              faTrophy: zM,
              faPersonPraying: nk,
              faPray: GM,
              faHammer: ZM,
              faHandPeace: _M,
              faRotate: ik,
              faSyncAlt: $M,
              faSpinner: eL,
              faRobot: tL,
              faPeace: rL,
              faGears: sk,
              faCogs: nL,
              faWarehouse: iL,
              faArrowUpRightDots: sL,
              faSplotch: aL,
              faFaceGrinHearts: ak,
              faGrinHearts: oL,
              faDiceFour: fL,
              faSimCard: AL,
              faTransgender: ok,
              faTransgenderAlt: dL,
              faMercury: vL,
              faArrowTurnDown: fk,
              faLevelDown: uL,
              faPersonFallingBurst: lL,
              faAward: PL,
              faTicketSimple: Ak,
              faTicketAlt: cL,
              faBuilding: pL,
              faAnglesLeft: dk,
              faAngleDoubleLeft: hL,
              faQrcode: HL,
              faClockRotateLeft: vk,
              faHistory: gL,
              faFaceGrinBeamSweat: uk,
              faGrinBeamSweat: XL,
              faFileExport: lk,
              faArrowRightFromFile: TL,
              faShield: Pk,
              faShieldBlank: qL,
              faArrowUpShortWide: ck,
              faSortAmountUpAlt: bL,
              faHouseMedical: xL,
              faGolfBallTee: pk,
              faGolfBall: DL,
              faCircleChevronLeft: hk,
              faChevronCircleLeft: jL,
              faHouseChimneyWindow: wL,
              faPenNib: mL,
              faTentArrowTurnLeft: BL,
              faTents: WL,
              faWandMagic: Hk,
              faMagic: SL,
              faDog: UL,
              faCarrot: IL,
              faMoon: RL,
              faWineGlassEmpty: gk,
              faWineGlassAlt: VL,
              faCheese: CL,
              faYinYang: OL,
              faMusic: yL,
              faCodeCommit: kL,
              faTemperatureLow: EL,
              faPersonBiking: Xk,
              faBiking: FL,
              faBroom: NL,
              faShieldHeart: QL,
              faGopuram: YL,
              faEarthOceania: Tk,
              faGlobeOceania: ML,
              faSquareXmark: rC,
              faTimesSquare: LL,
              faXmarkSquare: KL,
              faHashtag: JL,
              faUpRightAndDownLeftFromCenter: qk,
              faExpandAlt: zL,
              faOilCan: GL,
              faT: ZL,
              faHippo: _L,
              faChartColumn: $L,
              faInfinity: eK,
              faVialCircleCheck: tK,
              faPersonArrowDownToLine: rK,
              faVoicemail: nK,
              faFan: iK,
              faPersonWalkingLuggage: sK,
              faUpDown: bk,
              faArrowsAltV: aK,
              faCloudMoonRain: oK,
              faCalendar: fK,
              faTrailer: AK,
              faBahai: xk,
              faHaykal: dK,
              faSdCard: vK,
              faDragon: uK,
              faShoePrints: lK,
              faCirclePlus: Dk,
              faPlusCircle: PK,
              faFaceGrinTongueWink: jk,
              faGrinTongueWink: cK,
              faHandHolding: pK,
              faPlugCircleExclamation: hK,
              faLinkSlash: aI,
              faChainBroken: gK,
              faChainSlash: XK,
              faUnlink: TK,
              faClone: qK,
              faPersonWalkingArrowLoopLeft: bK,
              faArrowUpZA: wk,
              faSortAlphaUpAlt: xK,
              faFireFlameCurved: mk,
              faFireAlt: DK,
              faTornado: jK,
              faFileCirclePlus: wK,
              faBookQuran: Bk,
              faQuran: mK,
              faAnchor: BK,
              faBorderAll: WK,
              faFaceAngry: Wk,
              faAngry: SK,
              faCookieBite: UK,
              faArrowTrendDown: IK,
              faRss: Sk,
              faFeed: RK,
              faDrawPolygon: VK,
              faScaleBalanced: Uk,
              faBalanceScale: CK,
              faGaugeSimpleHigh: nC,
              faTachometer: OK,
              faTachometerFast: yK,
              faShower: kK,
              faDesktop: Ik,
              faDesktopAlt: EK,
              faM: FK,
              faTableList: Rk,
              faThList: NK,
              faCommentSms: Vk,
              faSms: QK,
              faBook: YK,
              faUserPlus: MK,
              faCheck: LK,
              faBatteryThreeQuarters: Ck,
              faBattery4: KK,
              faHouseCircleCheck: JK,
              faAngleLeft: zK,
              faDiagramSuccessor: GK,
              faTruckArrowRight: ZK,
              faArrowsSplitUpAndLeft: _K,
              faHandFist: Ok,
              faFistRaised: $K,
              faCloudMoon: eJ,
              faBriefcase: tJ,
              faPersonFalling: rJ,
              faImagePortrait: yk,
              faPortrait: nJ,
              faUserTag: iJ,
              faRug: sJ,
              faEarthEurope: kk,
              faGlobeEurope: aJ,
              faCartFlatbedSuitcase: Ek,
              faLuggageCart: oJ,
              faRectangleXmark: oI,
              faRectangleTimes: fJ,
              faTimesRectangle: AJ,
              faWindowClose: dJ,
              faBahtSign: vJ,
              faBookOpen: uJ,
              faBookJournalWhills: Fk,
              faJournalWhills: lJ,
              faHandcuffs: PJ,
              faTriangleExclamation: iC,
              faExclamationTriangle: cJ,
              faWarning: pJ,
              faDatabase: hJ,
              faShare: sC,
              faArrowTurnRight: HJ,
              faMailForward: gJ,
              faBottleDroplet: XJ,
              faMaskFace: TJ,
              faHillRockslide: qJ,
              faRightLeft: Nk,
              faExchangeAlt: bJ,
              faPaperPlane: xJ,
              faRoadCircleExclamation: DJ,
              faDungeon: jJ,
              faAlignRight: wJ,
              faMoneyBill1Wave: Qk,
              faMoneyBillWaveAlt: mJ,
              faLifeRing: BJ,
              faHands: aC,
              faSignLanguage: WJ,
              faSigning: SJ,
              faCalendarDay: UJ,
              faWaterLadder: oC,
              faLadderWater: IJ,
              faSwimmingPool: RJ,
              faArrowsUpDown: Yk,
              faArrowsV: VJ,
              faFaceGrimace: Mk,
              faGrimace: CJ,
              faWheelchairMove: Lk,
              faWheelchairAlt: OJ,
              faTurnDown: Kk,
              faLevelDownAlt: yJ,
              faPersonWalkingArrowRight: kJ,
              faSquareEnvelope: Jk,
              faEnvelopeSquare: EJ,
              faDice: FJ,
              faBowlingBall: NJ,
              faBrain: QJ,
              faBandage: zk,
              faBandAid: YJ,
              faCalendarMinus: MJ,
              faCircleXmark: fC,
              faTimesCircle: LJ,
              faXmarkCircle: KJ,
              faGifts: JJ,
              faHotel: zJ,
              faEarthAsia: Gk,
              faGlobeAsia: GJ,
              faIdCardClip: Zk,
              faIdCardAlt: ZJ,
              faMagnifyingGlassPlus: _k,
              faSearchPlus: _J,
              faThumbsUp: $J,
              faUserClock: ez,
              faHandDots: $k,
              faAllergies: tz,
              faFileInvoice: rz,
              faWindowMinimize: nz,
              faMugSaucer: eE,
              faCoffee: iz,
              faBrush: sz,
              faMask: az,
              faMagnifyingGlassMinus: tE,
              faSearchMinus: oz,
              faRulerVertical: fz,
              faUserLarge: rE,
              faUserAlt: Az,
              faTrainTram: dz,
              faUserNurse: vz,
              faSyringe: uz,
              faCloudSun: lz,
              faStopwatch20: Pz,
              faSquareFull: cz,
              faMagnet: pz,
              faJar: hz,
              faNoteSticky: nE,
              faStickyNote: Hz,
              faBugSlash: gz,
              faArrowUpFromWaterPump: Xz,
              faBone: Tz,
              faUserInjured: qz,
              faFaceSadTear: iE,
              faSadTear: bz,
              faPlane: xz,
              faTentArrowsDown: Dz,
              faExclamation: jz,
              faArrowsSpin: wz,
              faPrint: mz,
              faTurkishLiraSign: AC,
              faTry: Bz,
              faTurkishLira: Wz,
              faDollarSign: dC,
              faDollar: Sz,
              faUsd: Uz,
              faX: Iz,
              faMagnifyingGlassDollar: sE,
              faSearchDollar: Rz,
              faUsersGear: aE,
              faUsersCog: Vz,
              faPersonMilitaryPointing: Cz,
              faBuildingColumns: jW,
              faBank: Oz,
              faInstitution: yz,
              faMuseum: kz,
              faUniversity: Ez,
              faUmbrella: Fz,
              faTrowel: Nz,
              faD: Qz,
              faStapler: Yz,
              faMasksTheater: oE,
              faTheaterMasks: Mz,
              faKipSign: Lz,
              faHandPointLeft: Kz,
              faHandshakeSimple: fE,
              faHandshakeAlt: Jz,
              faJetFighter: AE,
              faFighterJet: zz,
              faSquareShareNodes: dE,
              faShareAltSquare: Gz,
              faBarcode: Zz,
              faPlusMinus: _z,
              faVideo: vE,
              faVideoCamera: $z,
              faGraduationCap: uE,
              faMortarBoard: eG,
              faHandHoldingMedical: tG,
              faPersonCircleCheck: rG,
              faTurnUp: lE,
              faLevelUpAlt: nG
            };
          }
        )
        /******/
      }, n = {};
      function i(a) {
        var f = n[a];
        if (f !== void 0)
          return f.exports;
        var o = n[a] = {
          /******/
          id: a,
          /******/
          loaded: !1,
          /******/
          exports: {}
          /******/
        };
        return r[a](o, o.exports, i), o.loaded = !0, o.exports;
      }
      i.n = (a) => {
        var f = a && a.__esModule ? (
          /******/
          () => a.default
        ) : (
          /******/
          () => a
        );
        return i.d(f, { a: f }), f;
      }, i.d = (a, f) => {
        for (var o in f)
          i.o(f, o) && !i.o(a, o) && Object.defineProperty(a, o, { enumerable: !0, get: f[o] });
      }, i.g = function() {
        if (typeof globalThis == "object")
          return globalThis;
        try {
          return this || new Function("return this")();
        } catch {
          if (typeof window == "object")
            return window;
        }
      }(), i.o = (a, f) => Object.prototype.hasOwnProperty.call(a, f), i.r = (a) => {
        typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(a, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(a, "__esModule", { value: !0 });
      }, i.nmd = (a) => (a.paths = [], a.children || (a.children = []), a), i.nc = void 0;
      var s = {};
      return (() => {
        /*!**********************!*\
          !*** ./src/index.ts ***!
          \**********************/
        i.r(s), i.d(s, {
          /* harmony export */
          default: () => f,
          /* harmony export */
          nodeEditor: () => (
            /* reexport module object */
            a
          )
          /* harmony export */
        });
        var a = i(
          /*! node-editor/legacy/legacy */
          "../../../tools/nodeEditor/dist/legacy/legacy.js"
        );
        const f = a;
      })(), s = s.default, s;
    })()
  ));
})(wfe);
var kqe = wfe.exports;
function Eqe(A) {
  const e = mfe, t = ja.Parse(e, A);
  return t.name = Zn(), t;
}
function Fqe(A) {
  A instanceof ja ? kqe.NodeEditor.Show({ nodeMaterial: A }) : console.error("open error!");
}
function Nqe(A, e) {
  try {
    const t = e || mfe;
    return ja.Parse(t, A);
  } catch {
    console.error("Generate NodeMaterial failed!");
  }
}
const mfe = {
  tags: null,
  ignoreAlpha: !1,
  maxSimultaneousLights: 4,
  mode: 0,
  forceAlphaBlending: !1,
  id: "node",
  name: "node",
  checkReadyOnEveryCall: !1,
  checkReadyOnlyOnce: !1,
  state: "",
  alpha: 1,
  backFaceCulling: !0,
  cullBackFaces: !0,
  sideOrientation: 1,
  alphaMode: 2,
  _needDepthPrePass: !1,
  disableDepthWrite: !1,
  disableColorWrite: !1,
  forceDepthWrite: !1,
  depthFunction: 0,
  separateCullingPass: !1,
  fogEnabled: !0,
  pointSize: 1,
  zOffset: 0,
  zOffsetUnits: 0,
  pointsCloud: !1,
  fillMode: 0,
  editorData: {
    locations: [
      {
        blockId: 10,
        x: 720,
        y: 90
      },
      {
        blockId: 9,
        x: 495,
        y: 90
      },
      {
        blockId: 7,
        x: 225,
        y: 45
      },
      {
        blockId: 5,
        x: 0,
        y: 0
      },
      {
        blockId: 6,
        x: 0,
        y: 135
      },
      {
        blockId: 8,
        x: 225,
        y: 180
      },
      {
        blockId: 12,
        x: 315,
        y: 270
      },
      {
        blockId: 30,
        x: 45,
        y: 405
      },
      {
        blockId: 31,
        x: -315,
        y: 450
      }
    ],
    frames: [],
    x: 369.78231736390467,
    y: 165.509405015757,
    zoom: 0.6366131739
  },
  customType: "BABYLON.NodeMaterial",
  outputNodes: [10, 12],
  blocks: [
    {
      customType: "BABYLON.VertexOutputBlock",
      id: 10,
      name: "VertexOutput",
      comments: "",
      visibleInInspector: !1,
      visibleOnFrame: !1,
      target: 1,
      inputs: [
        {
          name: "vector",
          inputName: "vector",
          targetBlockId: 9,
          targetConnectionName: "output",
          isExposedOnFrame: !0,
          exposedPortPosition: -1
        }
      ],
      outputs: []
    },
    {
      customType: "BABYLON.TransformBlock",
      id: 9,
      name: "WorldPos * ViewProjectionTransform",
      comments: "",
      visibleInInspector: !1,
      visibleOnFrame: !1,
      target: 1,
      inputs: [
        {
          name: "vector",
          inputName: "vector",
          targetBlockId: 7,
          targetConnectionName: "output",
          isExposedOnFrame: !0,
          exposedPortPosition: -1
        },
        {
          name: "transform",
          inputName: "transform",
          targetBlockId: 8,
          targetConnectionName: "output",
          isExposedOnFrame: !0,
          exposedPortPosition: -1
        }
      ],
      outputs: [
        {
          name: "output"
        },
        {
          name: "xyz"
        }
      ],
      complementZ: 0,
      complementW: 1
    },
    {
      customType: "BABYLON.TransformBlock",
      id: 7,
      name: "WorldPos",
      comments: "",
      visibleInInspector: !1,
      visibleOnFrame: !1,
      target: 1,
      inputs: [
        {
          name: "vector",
          inputName: "vector",
          targetBlockId: 5,
          targetConnectionName: "output",
          isExposedOnFrame: !0,
          exposedPortPosition: -1
        },
        {
          name: "transform",
          inputName: "transform",
          targetBlockId: 6,
          targetConnectionName: "output",
          isExposedOnFrame: !0,
          exposedPortPosition: -1
        }
      ],
      outputs: [
        {
          name: "output"
        },
        {
          name: "xyz"
        }
      ],
      complementZ: 0,
      complementW: 1
    },
    {
      customType: "BABYLON.InputBlock",
      id: 5,
      name: "position",
      comments: "",
      visibleInInspector: !1,
      visibleOnFrame: !1,
      target: 1,
      inputs: [],
      outputs: [
        {
          name: "output"
        }
      ],
      type: 8,
      mode: 1,
      systemValue: null,
      animationType: 0,
      min: 0,
      max: 0,
      isBoolean: !1,
      matrixMode: 0,
      isConstant: !1,
      groupInInspector: "",
      convertToGammaSpace: !1,
      convertToLinearSpace: !1
    },
    {
      customType: "BABYLON.InputBlock",
      id: 6,
      name: "World",
      comments: "",
      visibleInInspector: !1,
      visibleOnFrame: !1,
      target: 1,
      inputs: [],
      outputs: [
        {
          name: "output"
        }
      ],
      type: 128,
      mode: 0,
      systemValue: 1,
      animationType: 0,
      min: 0,
      max: 0,
      isBoolean: !1,
      matrixMode: 0,
      isConstant: !1,
      groupInInspector: "",
      convertToGammaSpace: !1,
      convertToLinearSpace: !1
    },
    {
      customType: "BABYLON.InputBlock",
      id: 8,
      name: "ViewProjection",
      comments: "",
      visibleInInspector: !1,
      visibleOnFrame: !1,
      target: 1,
      inputs: [],
      outputs: [
        {
          name: "output"
        }
      ],
      type: 128,
      mode: 0,
      systemValue: 4,
      animationType: 0,
      min: 0,
      max: 0,
      isBoolean: !1,
      matrixMode: 0,
      isConstant: !1,
      groupInInspector: "",
      convertToGammaSpace: !1,
      convertToLinearSpace: !1
    },
    {
      customType: "BABYLON.FragmentOutputBlock",
      id: 12,
      name: "FragmentOutput",
      comments: "",
      visibleInInspector: !1,
      visibleOnFrame: !1,
      target: 2,
      inputs: [
        {
          name: "rgba"
        },
        {
          name: "rgb",
          inputName: "rgb",
          targetBlockId: 30,
          targetConnectionName: "rgb",
          isExposedOnFrame: !0,
          exposedPortPosition: -1
        },
        {
          name: "a"
        }
      ],
      outputs: [],
      convertToGammaSpace: !1,
      convertToLinearSpace: !1,
      useLogarithmicDepth: !1
    },
    {
      customType: "BABYLON.TextureBlock",
      id: 30,
      name: "Texture",
      comments: "",
      visibleInInspector: !1,
      visibleOnFrame: !1,
      target: 3,
      inputs: [
        {
          name: "uv",
          inputName: "uv",
          targetBlockId: 31,
          targetConnectionName: "output",
          isExposedOnFrame: !0,
          exposedPortPosition: -1
        },
        {
          name: "source"
        }
      ],
      outputs: [
        {
          name: "rgba"
        },
        {
          name: "rgb"
        },
        {
          name: "r"
        },
        {
          name: "g"
        },
        {
          name: "b"
        },
        {
          name: "a"
        },
        {
          name: "level"
        }
      ],
      convertToGammaSpace: !1,
      convertToLinearSpace: !1,
      fragmentOnly: !1,
      disableLevelMultiplication: !1,
      texture: {
        tags: null,
        url: "",
        uOffset: 0,
        vOffset: 0,
        uScale: 1,
        vScale: 1,
        uAng: 0,
        vAng: 0,
        wAng: 0,
        uRotationCenter: 0.5,
        vRotationCenter: 0.5,
        wRotationCenter: 0.5,
        homogeneousRotationInUVTransform: !1,
        isBlocking: !0,
        name: "/img/logo.png",
        hasAlpha: !1,
        getAlphaFromRGB: !1,
        level: 1,
        coordinatesIndex: 0,
        coordinatesMode: 7,
        wrapU: 1,
        wrapV: 1,
        wrapR: 1,
        anisotropicFilteringLevel: 4,
        isCube: !1,
        is3D: !1,
        is2DArray: !1,
        gammaSpace: !0,
        invertZ: !1,
        lodLevelInAlpha: !1,
        lodGenerationOffset: 0,
        lodGenerationScale: 0,
        linearSpecularLOD: !1,
        isRenderTarget: !1,
        animations: [],
        invertY: !1,
        samplingMode: 3,
        _useSRGBBuffer: !1
      }
    },
    {
      customType: "BABYLON.InputBlock",
      id: 31,
      name: "uv",
      comments: "",
      visibleInInspector: !1,
      visibleOnFrame: !1,
      target: 1,
      inputs: [],
      outputs: [
        {
          name: "output"
        }
      ],
      type: 4,
      mode: 1,
      systemValue: null,
      animationType: 0,
      min: 0,
      max: 0,
      isBoolean: !1,
      matrixMode: 0,
      isConstant: !1,
      groupInInspector: "",
      convertToGammaSpace: !1,
      convertToLinearSpace: !1
    }
  ]
}, Qqe = `
// Attributes
attribute vec2 position;
// Transform matrix to offset the patch
uniform mat3 world;
// Output
varying vec2 vUV;
void main(void) {
    // We chose position from 0 to 1 to simplify to matrix computation
    // So the UVs will be a straight match
    vUV = position;
    // Transform to the requested patch location
    vec3 wPosition = vec3(position, 1) * world;
    // Go back from 0 to 1 to -1 to 1 for clip space coordinates
    wPosition = wPosition * 2.0 - 1.0;
    // Assign the location (depth is disabled in the pipeline)
    gl_Position = vec4(wPosition.xy, 0.0, 1.0);
}`, Yqe = `
// Inputs from vertex
varying vec2 vUV;
// Color Lookup
uniform sampler2D textureSampler;
// Color mix
uniform vec4 color;
void main(void) 
{
    // We simply display the color from the texture
    vec2 uv = vec2(vUV.x, 1.0 - vUV.y);
    vec4 finalColor = texture2D(textureSampler, vUV) * color;
    // With a pinch of alpha testing as defined in the data
    // Else everything could have been handled in a texSubImage2d.
    if (color.a == 1. && finalColor.a == 0.) {
        discard;
    }
    gl_FragColor = finalColor;
}`, Mqe = {
  name: "Patch",
  vertexShader: Qqe,
  fragmentShader: Yqe,
  samplerNames: ["textureSampler"],
  uniformNames: ["world", "color"]
};
var fm = {}, Bfe = {}, pq = {};
Object.defineProperty(pq, "__esModule", {
  value: !0
});
pq.loop = pq.conditional = pq.parse = void 0;
var Lqe = function A(e, t) {
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : r;
  if (Array.isArray(t))
    t.forEach(function(s) {
      return A(e, s, r, n);
    });
  else if (typeof t == "function")
    t(e, r, n, A);
  else {
    var i = Object.keys(t)[0];
    Array.isArray(t[i]) ? (n[i] = {}, A(e, t[i], r, n[i])) : n[i] = t[i](e, r, n, A);
  }
  return r;
};
pq.parse = Lqe;
var Kqe = function(e, t) {
  return function(r, n, i, s) {
    t(r, n, i) && s(r, e, n, i);
  };
};
pq.conditional = Kqe;
var Jqe = function(e, t) {
  return function(r, n, i, s) {
    for (var a = [], f = r.pos; t(r, n, i); ) {
      var o = {};
      if (s(r, e, n, o), r.pos === f)
        break;
      f = r.pos, a.push(o);
    }
    return a;
  };
};
pq.loop = Jqe;
var tA = {};
Object.defineProperty(tA, "__esModule", {
  value: !0
});
tA.readBits = tA.readArray = tA.readUnsigned = tA.readString = tA.peekBytes = tA.readBytes = tA.peekByte = tA.readByte = tA.buildStream = void 0;
var zqe = function(e) {
  return {
    data: e,
    pos: 0
  };
};
tA.buildStream = zqe;
var Wfe = function() {
  return function(e) {
    return e.data[e.pos++];
  };
};
tA.readByte = Wfe;
var Gqe = function() {
  var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
  return function(t) {
    return t.data[t.pos + e];
  };
};
tA.peekByte = Gqe;
var Ny = function(e) {
  return function(t) {
    return t.data.subarray(t.pos, t.pos += e);
  };
};
tA.readBytes = Ny;
var Zqe = function(e) {
  return function(t) {
    return t.data.subarray(t.pos, t.pos + e);
  };
};
tA.peekBytes = Zqe;
var _qe = function(e) {
  return function(t) {
    return Array.from(Ny(e)(t)).map(function(r) {
      return String.fromCharCode(r);
    }).join("");
  };
};
tA.readString = _qe;
var $qe = function(e) {
  return function(t) {
    var r = Ny(2)(t);
    return e ? (r[1] << 8) + r[0] : (r[0] << 8) + r[1];
  };
};
tA.readUnsigned = $qe;
var ebe = function(e, t) {
  return function(r, n, i) {
    for (var s = typeof t == "function" ? t(r, n, i) : t, a = Ny(e), f = new Array(s), o = 0; o < s; o++)
      f[o] = a(r);
    return f;
  };
};
tA.readArray = ebe;
var tbe = function(e, t, r) {
  for (var n = 0, i = 0; i < r; i++)
    n += e[t + i] && Math.pow(2, r - i - 1);
  return n;
}, rbe = function(e) {
  return function(t) {
    for (var r = Wfe()(t), n = new Array(8), i = 0; i < 8; i++)
      n[7 - i] = !!(r & 1 << i);
    return Object.keys(e).reduce(function(s, a) {
      var f = e[a];
      return f.length ? s[a] = tbe(n, f.index, f.length) : s[a] = n[f.index], s;
    }, {});
  };
};
tA.readBits = rbe;
(function(A) {
  Object.defineProperty(A, "__esModule", {
    value: !0
  }), A.default = void 0;
  var e = pq, t = tA, r = {
    blocks: function(u) {
      for (var l = 0, P = [], p = u.data.length, c = 0, H = (0, t.readByte)()(u); H !== l && H; H = (0, t.readByte)()(u)) {
        if (u.pos + H >= p) {
          var T = p - u.pos;
          P.push((0, t.readBytes)(T)(u)), c += T;
          break;
        }
        P.push((0, t.readBytes)(H)(u)), c += H;
      }
      for (var q = new Uint8Array(c), b = 0, j = 0; j < P.length; j++)
        q.set(P[j], b), b += P[j].length;
      return q;
    }
  }, n = (0, e.conditional)({
    gce: [{
      codes: (0, t.readBytes)(2)
    }, {
      byteSize: (0, t.readByte)()
    }, {
      extras: (0, t.readBits)({
        future: {
          index: 0,
          length: 3
        },
        disposal: {
          index: 3,
          length: 3
        },
        userInput: {
          index: 6
        },
        transparentColorGiven: {
          index: 7
        }
      })
    }, {
      delay: (0, t.readUnsigned)(!0)
    }, {
      transparentColorIndex: (0, t.readByte)()
    }, {
      terminator: (0, t.readByte)()
    }]
  }, function(v) {
    var u = (0, t.peekBytes)(2)(v);
    return u[0] === 33 && u[1] === 249;
  }), i = (0, e.conditional)({
    image: [{
      code: (0, t.readByte)()
    }, {
      descriptor: [{
        left: (0, t.readUnsigned)(!0)
      }, {
        top: (0, t.readUnsigned)(!0)
      }, {
        width: (0, t.readUnsigned)(!0)
      }, {
        height: (0, t.readUnsigned)(!0)
      }, {
        lct: (0, t.readBits)({
          exists: {
            index: 0
          },
          interlaced: {
            index: 1
          },
          sort: {
            index: 2
          },
          future: {
            index: 3,
            length: 2
          },
          size: {
            index: 5,
            length: 3
          }
        })
      }]
    }, (0, e.conditional)({
      lct: (0, t.readArray)(3, function(v, u, l) {
        return Math.pow(2, l.descriptor.lct.size + 1);
      })
    }, function(v, u, l) {
      return l.descriptor.lct.exists;
    }), {
      data: [{
        minCodeSize: (0, t.readByte)()
      }, r]
    }]
  }, function(v) {
    return (0, t.peekByte)()(v) === 44;
  }), s = (0, e.conditional)({
    text: [{
      codes: (0, t.readBytes)(2)
    }, {
      blockSize: (0, t.readByte)()
    }, {
      preData: function(u, l, P) {
        return (0, t.readBytes)(P.text.blockSize)(u);
      }
    }, r]
  }, function(v) {
    var u = (0, t.peekBytes)(2)(v);
    return u[0] === 33 && u[1] === 1;
  }), a = (0, e.conditional)({
    application: [{
      codes: (0, t.readBytes)(2)
    }, {
      blockSize: (0, t.readByte)()
    }, {
      id: function(u, l, P) {
        return (0, t.readString)(P.blockSize)(u);
      }
    }, r]
  }, function(v) {
    var u = (0, t.peekBytes)(2)(v);
    return u[0] === 33 && u[1] === 255;
  }), f = (0, e.conditional)({
    comment: [{
      codes: (0, t.readBytes)(2)
    }, r]
  }, function(v) {
    var u = (0, t.peekBytes)(2)(v);
    return u[0] === 33 && u[1] === 254;
  }), o = [
    {
      header: [{
        signature: (0, t.readString)(3)
      }, {
        version: (0, t.readString)(3)
      }]
    },
    {
      lsd: [{
        width: (0, t.readUnsigned)(!0)
      }, {
        height: (0, t.readUnsigned)(!0)
      }, {
        gct: (0, t.readBits)({
          exists: {
            index: 0
          },
          resolution: {
            index: 1,
            length: 3
          },
          sort: {
            index: 4
          },
          size: {
            index: 5,
            length: 3
          }
        })
      }, {
        backgroundColorIndex: (0, t.readByte)()
      }, {
        pixelAspectRatio: (0, t.readByte)()
      }]
    },
    (0, e.conditional)({
      gct: (0, t.readArray)(3, function(v, u) {
        return Math.pow(2, u.lsd.gct.size + 1);
      })
    }, function(v, u) {
      return u.lsd.gct.exists;
    }),
    // content frames
    {
      frames: (0, e.loop)([n, a, f, i, s], function(v) {
        var u = (0, t.peekByte)()(v);
        return u === 33 || u === 44;
      })
    }
  ], d = o;
  A.default = d;
})(Bfe);
var Qy = {};
Object.defineProperty(Qy, "__esModule", {
  value: !0
});
Qy.deinterlace = void 0;
var nbe = function(e, t) {
  for (var r = new Array(e.length), n = e.length / t, i = function(u, l) {
    var P = e.slice(l * t, (l + 1) * t);
    r.splice.apply(r, [u * t, t].concat(P));
  }, s = [0, 4, 2, 1], a = [8, 8, 4, 2], f = 0, o = 0; o < 4; o++)
    for (var d = s[o]; d < n; d += a[o])
      i(d, f), f++;
  return r;
};
Qy.deinterlace = nbe;
var Yy = {};
Object.defineProperty(Yy, "__esModule", {
  value: !0
});
Yy.lzw = void 0;
var ibe = function(e, t, r) {
  var n = 4096, i = -1, s = r, a, f, o, d, v, u, l, w, P, p, j, c, m, I, k, N, H = new Array(r), T = new Array(n), q = new Array(n), b = new Array(n + 1);
  for (c = e, f = 1 << c, v = f + 1, a = f + 2, l = i, d = c + 1, o = (1 << d) - 1, P = 0; P < f; P++)
    T[P] = 0, q[P] = P;
  var j, w, m, I, N, k;
  for (j = w = m = I = N = k = 0, p = 0; p < s; ) {
    if (I === 0) {
      if (w < d) {
        j += t[k] << w, w += 8, k++;
        continue;
      }
      if (P = j & o, j >>= d, w -= d, P > a || P == v)
        break;
      if (P == f) {
        d = c + 1, o = (1 << d) - 1, a = f + 2, l = i;
        continue;
      }
      if (l == i) {
        b[I++] = q[P], l = P, m = P;
        continue;
      }
      for (u = P, P == a && (b[I++] = m, P = l); P > f; )
        b[I++] = q[P], P = T[P];
      m = q[P] & 255, b[I++] = m, a < n && (T[a] = l, q[a] = m, a++, !(a & o) && a < n && (d++, o += a)), l = u;
    }
    I--, H[N++] = b[I], p++;
  }
  for (p = N; p < s; p++)
    H[p] = 0;
  return H;
};
Yy.lzw = ibe;
Object.defineProperty(fm, "__esModule", {
  value: !0
});
var Sfe = fm.decompressFrames = fm.decompressFrame = Ufe = fm.parseGIF = void 0, sbe = dbe(Bfe), abe = pq, obe = tA, fbe = Qy, Abe = Yy;
function dbe(A) {
  return A && A.__esModule ? A : { default: A };
}
var vbe = function(e) {
  var t = new Uint8Array(e);
  return (0, abe.parse)((0, obe.buildStream)(t), sbe.default);
}, Ufe = fm.parseGIF = vbe, ube = function(e) {
  for (var t = e.pixels.length, r = new Uint8ClampedArray(t * 4), n = 0; n < t; n++) {
    var i = n * 4, s = e.pixels[n], a = e.colorTable[s] || [0, 0, 0];
    r[i] = a[0], r[i + 1] = a[1], r[i + 2] = a[2], r[i + 3] = s !== e.transparentIndex ? 255 : 0;
  }
  return r;
}, Ife = function(e, t, r) {
  if (!e.image) {
    console.warn("gif frame does not have associated image.");
    return;
  }
  var n = e.image, i = n.descriptor.width * n.descriptor.height, s = (0, Abe.lzw)(n.data.minCodeSize, n.data.blocks, i);
  n.descriptor.lct.interlaced && (s = (0, fbe.deinterlace)(s, n.descriptor.width));
  var a = {
    pixels: s,
    dims: {
      top: e.image.descriptor.top,
      left: e.image.descriptor.left,
      width: e.image.descriptor.width,
      height: e.image.descriptor.height
    }
  };
  return n.descriptor.lct && n.descriptor.lct.exists ? a.colorTable = n.lct : a.colorTable = t, e.gce && (a.delay = (e.gce.delay || 10) * 10, a.disposalType = e.gce.extras.disposal, e.gce.extras.transparentColorGiven && (a.transparentIndex = e.gce.transparentColorIndex)), r && (a.patch = ube(a)), a;
};
fm.decompressFrame = Ife;
var lbe = function(e, t) {
  return e.frames.filter(function(r) {
    return r.image;
  }).map(function(r) {
    return Ife(r, e.gct, t);
  });
};
Sfe = fm.decompressFrames = lbe;
class LSe extends ls {
  /**
   * Instantiates an AnimatedGifTexture from the following parameters.
   *
   * @param url The location of the Gif
   * @param engine engine the texture will be used in
   * @param onLoad defines a callback to trigger once all ready.
   */
  constructor(e, t, r = null) {
    super(t), this._frames = null, this._nextFrameIndex = 0, this.name = e, this._onLoad = r, this._createInternalTexture(), this._createRenderer(), this._createRenderLoopCallback(), this._loadGifTexture();
  }
  /**
   * Creates the internal texture used by the engine.
   */
  _createInternalTexture() {
    this._engine && (this._texture = this._engine.createRawTexture(
      null,
      1,
      1,
      et.TEXTUREFORMAT_RGBA,
      !1,
      !1,
      et.TEXTURE_BILINEAR_SAMPLINGMODE,
      null,
      et.TEXTURETYPE_UNSIGNED_INT
    ), this._texture.isReady = !1), this.wrapU = et.TEXTURE_CLAMP_ADDRESSMODE, this.wrapV = et.TEXTURE_CLAMP_ADDRESSMODE, this.wrapR = et.TEXTURE_CLAMP_ADDRESSMODE, this.anisotropicFilteringLevel = 1;
  }
  /**
   * Create the renderer resources used to draw the Gif patches in the texture.
   */
  _createRenderer() {
    this._patchEffectWrapper = new ng({
      ...Mqe,
      engine: this._engine
    }), this._patchEffectRenderer = new fU(this._engine, {
      positions: [1, 1, 0, 1, 0, 0, 1, 0]
    });
  }
  /**
   * Creates the current render loop callback.
   */
  _createRenderLoopCallback() {
    this._renderLoopCallback = () => {
      this._renderFrame();
    };
  }
  /**
   * Starts loading the Gif data.
   */
  _loadGifTexture() {
    var t;
    const e = (r) => {
      var n;
      this._parseGifData(r), this._createGifResources(), (n = this._engine) == null || n.runRenderLoop(this._renderLoopCallback);
    };
    (t = this._engine) == null || t._loadFile(this.name, e, void 0, void 0, !0);
  }
  /**
   * Parses the Gif data and creates the associated frames.
   * @param buffer Defines the buffer containing the data
   */
  _parseGifData(e) {
    const t = Ufe(e);
    this._frames = Sfe(t, !0);
  }
  /**
   * Creates the GPU resources associated with the Gif file.
   * It will create the texture for each frame as well as our render target used
   * to hold the final Gif.
   */
  _createGifResources() {
    var e;
    if (this._frames && this._engine) {
      for (let r of this._frames) {
        r.texture = this._engine.createRawTexture(
          new Uint8Array(r.patch.buffer),
          r.dims.width,
          r.dims.height,
          et.TEXTUREFORMAT_RGBA,
          !1,
          !0,
          et.TEXTURE_NEAREST_SAMPLINGMODE,
          null,
          et.TEXTURETYPE_UNSIGNED_INT
        );
        const n = r.dims.width / this._frames[0].dims.width, i = r.dims.height / this._frames[0].dims.height, s = r.dims.left / this._frames[0].dims.width, a = (this._frames[0].dims.height - (r.dims.top + r.dims.height)) / this._frames[0].dims.height;
        r.worldMatrix = new Float32Array([n, 0, s, 0, i, a, 0, 0, 1]), this._engine.updateTextureWrappingMode(
          r.texture,
          et.TEXTURE_CLAMP_ADDRESSMODE,
          et.TEXTURE_CLAMP_ADDRESSMODE
        );
      }
      this._renderTarget = this._engine.createRenderTargetTexture(
        this._frames[0].dims,
        {
          format: et.TEXTUREFORMAT_RGBA,
          generateDepthBuffer: !1,
          generateMipMaps: !1,
          generateStencilBuffer: !1,
          samplingMode: et.TEXTURE_BILINEAR_SAMPLINGMODE,
          type: et.TEXTURETYPE_UNSIGNED_BYTE
        }
      ), this._engine._releaseTexture(this._texture);
      let t = this._renderTarget;
      (e = t == null ? void 0 : t.texture) == null || e._swapAndDie(this._texture), this._engine.updateTextureWrappingMode(
        this._texture,
        et.TEXTURE_CLAMP_ADDRESSMODE,
        et.TEXTURE_CLAMP_ADDRESSMODE
      ), this._texture && (this._texture.width = this._frames[0].dims.width, this._texture.height = this._frames[0].dims.height, this._texture.isReady = !1);
    }
  }
  /**
   * Render the current frame when all is ready.
   */
  _renderFrame() {
    this._currentFrame && Yi.Now - this._previousDate < this._currentFrame.delay || this._frames && (this._currentFrame = this._frames[this._nextFrameIndex], this._drawPatch(), this._previousDate = Yi.Now, this._nextFrameIndex++, this._nextFrameIndex >= this._frames.length && (this._nextFrameIndex = 0));
  }
  /**
   * Draw the patch texture on top of the previous one.
   */
  _drawPatch() {
    var r, n, i;
    if (!this._patchEffectWrapper.effect.isReady())
      return;
    const e = this._currentFrame, t = (r = this._engine) == null ? void 0 : r.currentViewport;
    if (this._previousFrame && (this._previousFrame.disposalType === 2 || this._nextFrameIndex === 0)) {
      let s = this._previousFrame;
      this._patchEffectWrapper.onApplyObservable.addOnce(() => {
        this._patchEffectWrapper.effect.setFloat4("color", 0, 0, 0, 0), this._patchEffectWrapper.effect.setMatrix3x3(
          "world",
          s.worldMatrix
        ), this._patchEffectWrapper.effect._bindTexture(
          "textureSampler",
          s.texture
        );
      }), this._patchEffectRenderer.render(
        this._patchEffectWrapper,
        this._renderTarget
      );
    }
    this._patchEffectWrapper.onApplyObservable.addOnce(() => {
      this._patchEffectWrapper.effect.setFloat4("color", 1, 1, 1, 1), this._patchEffectWrapper.effect.setMatrix3x3("world", e.worldMatrix), this._patchEffectWrapper.effect._bindTexture(
        "textureSampler",
        e.texture
      );
    }), this._patchEffectRenderer.render(
      this._patchEffectWrapper,
      this._renderTarget
    ), this._previousFrame = e, (n = this._engine) == null || n.setViewport(t), this._texture && !((i = this._texture) != null && i.isReady) && (this._texture.isReady = !0, this._onLoad && this._onLoad());
  }
  /**
   * Dispose the texture and release its associated resources.
   */
  dispose() {
    var e;
    (e = this._engine) == null || e.stopRenderLoop(this._renderLoopCallback), this._patchEffectWrapper.dispose(), this._patchEffectRenderer.dispose();
    for (let t of this._frames)
      t.texture.dispose();
    this._renderTarget.dispose(), super.dispose();
  }
}
class NW extends Zo {
  get mainColor() {
    return this._mainColor;
  }
  set mainColor(e) {
    this._mainColor = e, this.setColor3("mainColor", e);
  }
  get ringColor() {
    return this._ringColor;
  }
  set ringColor(e) {
    this._ringColor = e, this.setColor3("ringColor", e);
  }
  get growColor() {
    return this._growColor;
  }
  set growColor(e) {
    this.setColor3("growColor", e);
  }
  get mixColor() {
    return this._mixColor;
  }
  set mixColor(e) {
    this._mixColor = e, this.setColor3("mixColor", e);
  }
  get maxHeight() {
    return this._maxHeight;
  }
  set maxHeight(e) {
    this._maxHeight = e, this.setFloat("maxHeight", e);
  }
  get minHeight() {
    return this._minHeight;
  }
  set minHeight(e) {
    this._minHeight = e, this.setFloat("minHeight", e);
  }
  get ringLength() {
    return this._ringLength;
  }
  set ringLength(e) {
    this._ringLength = e, this.setFloat("ringLength", e);
  }
  get timeScale1() {
    return this._timeScale1;
  }
  set timeScale1(e) {
    this._timeScale1 = e, this.setFloat("timeScale1", e), e || (this.tTime1 = e, this.setFloat("tTime1", -2e3));
  }
  get timeScale2() {
    return this._timeScale2;
  }
  set timeScale2(e) {
    this._timeScale2 = e, this.setFloat("timeScale2", e), e || (this.tTime2 = e, this.setFloat("tTime2", -2e3));
  }
  get timeScale3() {
    return this._timeScale3;
  }
  set timeScale3(e) {
    this._timeScale3 = e, this.setFloat("timeScale3", e), e || (this.tTime3 = e, this.setFloat("tTime3", -2e3));
  }
  constructor(e, t) {
    An.ShadersStore["gradient" + e + "VertexShader"] = `
             precision highp float;
             //attribute
             attribute vec3 position;
             attribute vec2 uv;
             attribute vec3 normal;
             //uniform
             uniform mat4 worldViewProjection;
             //varying
             varying vec3 vPosition;
             varying vec2 vUV;
             varying vec3 vNormal;
             void main(void) {
                gl_Position = worldViewProjection*vec4(position,1.0);
                vPosition = position;
                vUV = uv;
                vNormal = normal;
             }`, An.ShadersStore["gradient" + e + "FragmentShader"] = `
              precision highp float;
              varying vec3 vPosition;
              float distanceTwoVec3(vec3 p1){
                 float d = sqrt((p1.x)*(p1.x)+(p1.y)*(p1.y)+(p1.z)*(p1.z));
                 return d;
              }
              uniform vec3 mainColor;
              uniform vec3 ringColor;
              uniform vec3 growColor;
              uniform vec3 mixColor;
              uniform float maxHeight;
              uniform float minHeight;
              uniform float lengthHeight;
              uniform float ringLength;
              uniform float tTime;
              uniform float tTime2;
              uniform float tTime3;
              uniform float timeScale1;
              uniform float timeScale2;
              uniform float timeScale3;
              void main(void) {
        
                  float alpha = (vPosition.z-minHeight)/(maxHeight-minHeight);
                  vec3 color = mix(mainColor,mixColor,alpha);
                  vec3 finalColor = color;
                  float ringRange = distanceTwoVec3(vPosition);
                  if(ringRange>tTime*timeScale1-1000.0-ringLength&&ringRange<tTime*timeScale1-1000.0+ringLength){
                    float dIndex = (tTime*timeScale1-1000.0 - ringRange) / 120.0 * 3.14;
                    finalColor = mix(mainColor, ringColor, 1.0 - dIndex);
                  };

                  if(vPosition.x>tTime2*timeScale2-1000.0-ringLength&&vPosition.x<tTime2*timeScale2-1000.0+ringLength){
                    float dIndex = (tTime2*timeScale2-1000.0 - vPosition.x) / 120.0 * 3.14;
                    finalColor = mix(mainColor, mixColor, 1.0 - dIndex);
                  };
                  
                  if(vPosition.y>tTime2*timeScale2-1000.0-ringLength&&vPosition.y<tTime2*timeScale2-1000.0+ringLength){
                    float dIndex = (tTime2*timeScale2-1000.0 - vPosition.y) / 120.0 * 3.14;
                    finalColor = mix(mainColor, mixColor, 1.0 - dIndex);
                  };

                  if(vPosition.z>tTime3*timeScale3-1000.0-ringLength&&vPosition.z<tTime3*timeScale3-1000.0+ringLength){
                    float dIndex = (tTime3*timeScale3-1000.0-ringLength*0.1 - vPosition.z) / 120.0 * 3.14 ;
                    finalColor = mix(mainColor, growColor, 1.0 - dIndex);
                  }

                 gl_FragColor = vec4(finalColor,1.0);
              }`, super(
      "effectGradAlpha" + e,
      t,
      {
        vertex: "gradient" + e,
        fragment: "gradient" + e
      },
      {
        attributes: ["normal", "position", "uv"],
        uniforms: [
          "world",
          "worldView",
          "worldViewProjection",
          "view",
          "projection"
        ]
      }
    ), this._mainColor = Ne.FromHexString("#738182"), this._mixColor = new Ne(1, 1, 1), this._ringColor = Ne.FromHexString("#8cfffb"), this._maxHeight = 100, this._minHeight = 0, this._ringLength = 5, this._growColor = Ne.FromHexString("#00ff00"), this.setFloat("minHeight", this._minHeight), this._timeScale1 = 1, this._timeScale2 = 2, this._timeScale3 = 1, this.setFloat("ringLength", this._ringLength), this.setFloat("maxHeight", this._maxHeight), this.setColor3("mainColor", this._mainColor), this.setColor3("mixColor", this._mixColor), this.setColor3("ringColor", this._ringColor), this.setColor3("growColor", this._growColor);
    let r = 500, n = -200, i = 0;
    this.tTime1 = r, this.tTime2 = n, this.tTime3 = i, this.setFloat("tTime", r), this.setFloat("tTime2", n), this.setFloat("tTime3", i), this.setFloat("timeScale1", this._timeScale1), this.setFloat("timeScale2", this._timeScale2), this.setFloat("timeScale3", this._timeScale3), this.ob = this.addTimeOb(t, this), this.onDispose = () => {
      this.ob && t.onBeforeRenderObservable.remove(this.ob);
    };
  }
  addTimeOb(e, t) {
    return this.ob = e.onBeforeRenderObservable.add(() => {
      this.tTime1 < 2e3 ? (this.tTime1 += 5, t.setFloat("tTime", this.tTime1)) : (this.tTime1 = -1e3, t.setFloat("tTime", this.tTime1)), this.tTime2 < 2e3 ? (this.tTime2 += 10, t.setFloat("tTime2", this.tTime2)) : (this.tTime2 = -200, t.setFloat("tTime2", this.tTime2)), this.tTime3 < 2e3 ? (this.tTime3 += 1, t.setFloat("tTime3", this.tTime3)) : (this.tTime3 = -200, t.setFloat("tTime3", this.tTime3));
    }), this.ob;
  }
  removeTimeOb() {
    this.scene.onBeforeRenderObservable.remove(this.ob);
  }
}
Ue("BABYLON.CityMaterial", NW);
function oD(A) {
  return A.replaceAll(" ", "");
}
const KSe = (A) => A.startsWith("#") || A.startsWith("rgb(") || A.startsWith("rgba("), NZ = (A) => Array(A).fill("").map((e) => Math.random().toString(36).charAt(2)).join("");
function A4(A) {
  if (A.startsWith("rgb")) {
    const e = oD(A), [t = 0, r = 0, n = 0] = e.substring(e.indexOf("(") + 1, e.indexOf(")")).split(",").map((i) => Number(i));
    return new Ne(t / 255, r / 255, n / 255);
  }
  return A.length === 4 && (A = `#${A[1]}${A[1]}${A[2]}${A[2]}${A[3]}${A[3]}`), Ne.FromHexString(A);
}
function lR(A) {
  if (A.startsWith("rgb")) {
    const e = oD(A), [t = 0, r = 0, n = 0, i = 1] = e.substring(e.indexOf("(") + 1, e.indexOf(")")).split(",").map((s) => Number(s));
    return new xt(t / 255, r / 255, n / 255, i);
  }
  return xt.FromHexString(A);
}
function cO(A) {
  if (!A)
    return "";
  const [e, t, r, n = 1] = A.asArray();
  return A instanceof Ne ? `rgb(${Math.round(e * 255)}, ${Math.round(t * 255)}, ${Math.round(
    r * 255
  )})` : `rgba(${Math.round(e * 255)}, ${Math.round(t * 255)}, ${Math.round(
    r * 255
  )}, ${n})`;
}
const Pbe = [
  {
    property: "__valueType",
    name: "值类型",
    valueType: se.Number,
    setValue(A, e, t) {
      const r = t.getMetadata(A);
      r.__valueType = zt.typeOf(A, t);
    },
    getDefaultValue() {
      return -1;
    }
  },
  {
    property: "__initOption",
    name: "初始配置",
    valueType: se.Object
  },
  {
    property: "__targetIndex",
    name: "模型索引",
    valueType: se.Number,
    includes: [
      se.Scene,
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    getValue(A, e) {
      return e.getMetadata(A).__targetIndex || 0;
    },
    getDefaultValue() {
    }
  },
  {
    property: "__glbIndex",
    name: "模型索引",
    valueType: se.Number,
    excludes: [
      se.Scene,
      se.ArcRotateCamera,
      se.FollowCamera,
      se.FreeCamera,
      se.DirectionalLight,
      se.SpotLight,
      se.PointLight,
      se.HemisphericLight
    ],
    getDefaultValue() {
    }
  },
  {
    property: "__glbUUID",
    name: "模型UUID",
    valueType: se.String,
    excludes: [
      se.Scene,
      se.ArcRotateCamera,
      se.FollowCamera,
      se.FreeCamera,
      se.DirectionalLight,
      se.SpotLight,
      se.PointLight,
      se.HemisphericLight
    ]
  },
  {
    property: "__glbUrl",
    name: "模型文件地址",
    valueType: se.String,
    serializable: !1,
    excludes: [
      se.Scene,
      se.ArcRotateCamera,
      se.FollowCamera,
      se.FreeCamera,
      se.DirectionalLight,
      se.SpotLight,
      se.PointLight,
      se.HemisphericLight
    ],
    getValue(A, e) {
      var r;
      const t = e.getMetadata(A);
      return (r = e.resourceManager.glbUUIDMap.get(t.__glbUUID)) == null ? void 0 : r.url;
    }
  },
  {
    property: "__glbName",
    name: "模型文件名称",
    valueType: se.String,
    serializable: !1,
    excludes: [
      se.Scene,
      se.ArcRotateCamera,
      se.FollowCamera,
      se.FreeCamera,
      se.DirectionalLight,
      se.SpotLight,
      se.PointLight,
      se.HemisphericLight
    ],
    getValue(A, e) {
      var r;
      const t = e.getMetadata(A);
      return (r = e.resourceManager.glbUUIDMap.get(t.__glbUUID)) == null ? void 0 : r.name;
    }
  },
  {
    property: "__instancedID",
    name: "实例ID",
    valueType: se.String,
    includes: [se.InstancedMesh]
  },
  {
    property: "__instancedType",
    name: "实例类型",
    valueType: se.Number,
    includes: [se.InstancedMesh]
  },
  {
    property: "__parentId",
    name: "实例ID",
    valueType: se.String,
    // serializable: false,
    includes: [se.InstancedMesh],
    setValue(A, e, t) {
      if (e) {
        const r = t.getMetadata(A);
        r.__parentId = e, A.parent = t.getTargetById(e);
      }
    }
  },
  {
    property: "__materialIndex",
    name: "",
    valueType: se.Number,
    includes: [se.AbstractMesh, se.Mesh],
    getDefaultValue() {
      return -1;
    }
  },
  {
    property: "__textureMap",
    name: "",
    valueType: se.Object,
    includes: [
      se.StandardMaterial,
      se.PBRMaterial,
      se.GridMaterial,
      se.GradientMaterial,
      se.NodeMaterial,
      se.ShaderMaterial,
      se.WaterMaterial
    ]
  },
  {
    property: "size",
    name: "尺寸",
    valueType: se.Object,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    getValue(A, e) {
      if (e.nodeManager.getParent(A))
        return;
      let t, r;
      const n = A;
      if (n.getBoundingInfo && n.subMeshes) {
        const a = n.getBoundingInfo();
        t = a.boundingBox.minimumWorld.clone(), r = a.boundingBox.maximumWorld.clone();
      } else
        t = new S(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), r = new S(
          -Number.MAX_VALUE,
          -Number.MAX_VALUE,
          -Number.MAX_VALUE
        );
      const i = n.getDescendants(!1);
      for (const a of i) {
        const f = a;
        if (!f.getBoundingInfo || f.getTotalVertices() === 0)
          continue;
        const d = f.getBoundingInfo().boundingBox, v = d.minimumWorld, u = d.maximumWorld;
        S.CheckExtends(v, t, r), S.CheckExtends(u, t, r);
      }
      const s = r.subtract(t);
      return {
        x: s.x,
        y: s.y,
        z: s.z
      };
    }
  },
  {
    property: "animations",
    name: "自定义动画",
    valueType: se.Array,
    includes: [
      se.Scene,
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    serializable(A, e) {
      return e.getMetadata(A).__targetIndex === 0;
    },
    setValue(A, e, t) {
      const r = t.getMetadata(A);
      r.__targetIndex > 0 || (e.forEach((n) => {
        n.id = n.id ?? e4(), n.list.forEach((i) => {
          i.id = i.id ?? e4();
        }), t.animateManager.setSpeedRatio(
          A,
          n.id,
          n.speedRatio || 0
        );
      }), r.animations = e);
    }
  },
  {
    property: "groupAnimations",
    name: "自带动画",
    valueType: se.Array,
    includes: [
      se.Scene,
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    serializable(A, e) {
      return e.getMetadata(A).__targetIndex === 0;
    },
    setValue(A, e, t) {
      const r = t.getMetadata(A);
      r.__targetIndex > 0 || (e.forEach((n) => {
        t.animateManager.setSpeedRatio(
          A,
          n.id,
          n.speedRatio || 0
        );
      }), r.groupAnimations = e);
    }
  },
  {
    property: "states",
    name: "状态",
    valueType: se.Array,
    includes: [
      se.Scene,
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    serializable(A, e) {
      return e.getMetadata(A).__targetIndex === 0;
    },
    setValue(A, e, t) {
      const r = t.getMetadata(A);
      if (r.__targetIndex > 0)
        return;
      r.states = e;
      const n = t.getValue(A, "id");
      t.dynamicDataManager.register(n, e);
    }
  },
  {
    property: "events",
    name: "事件",
    valueType: se.Array,
    includes: [
      se.Scene,
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    serializable(A, e) {
      return e.getMetadata(A).__targetIndex === 0;
    },
    setValue(A, e, t) {
      const r = t.getMetadata(A);
      if (r.__targetIndex > 0)
        return;
      r.events = e;
      const n = t.getValue(A, "id");
      t.eventManager.register(n, e);
    }
  },
  {
    property: "groups",
    name: "所属分组",
    valueType: se.Array,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    setValue(A, e, t) {
      const r = t.getMetadata(A);
      r.groups = e;
      const n = t.getValue(A, "id");
      t.groupManager.register(n, e);
    }
  },
  //边缘渲染
  {
    property: "useMeshEdge",
    name: "开启边框",
    valueType: se.Boolean,
    includes: [se.Mesh, se.AbstractMesh],
    setValue(A, e, t) {
      let r = A.getChildMeshes(), n = [A, ...r];
      e ? n.forEach((i) => {
        t.getMetadata(i) || t.setMetadata(i, {});
        const s = t.getMetadata(i);
        s.useMeshEdge = e, i instanceof jn && !i.edgesRenderer && i.enableEdgesRendering();
      }) : n.forEach((i) => {
        t.getMetadata(i) || t.setMetadata(i, {});
        const s = t.getMetadata(i);
        s.useMeshEdge = e, i.edgesRenderer && i.disableEdgesRendering();
      });
    }
  },
  {
    property: "edgesWidth",
    name: "边框宽度",
    valueType: se.Number,
    includes: [se.Mesh, se.AbstractMesh],
    setValue(A, e, t) {
      let r = A.getChildMeshes();
      [A, ...r].forEach((i) => {
        t.getMetadata(i) || t.setMetadata(i, {});
        const s = t.getMetadata(i);
        s.edgesWidth = e, e !== i.edgesWidth && (i.edgesWidth = e);
      });
    },
    getDefaultValue() {
      return 1;
    }
  },
  {
    property: "edgesColor",
    name: "边框颜色",
    valueType: se.Color4,
    includes: [se.Mesh, se.AbstractMesh],
    getValue(A) {
      return A.edgesColor;
    },
    setValue(A, e, t) {
      let r = A.getChildMeshes(), n = [A, ...r];
      const i = cO(e);
      n.forEach((s) => {
        t.getMetadata(s) || t.setMetadata(s, {});
        const a = t.getMetadata(s);
        a.edgesColor = i, e != null && e.equals(Ne.Red().toColor4()) || (s.edgesColor = e);
      });
    },
    getDefaultValue() {
      return Ne.Red().toColor4();
    }
  },
  {
    property: "width",
    name: "宽度",
    valueType: se.Number,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i, s;
      const r = t.getMetadata(A);
      (i = (n = r == null ? void 0 : r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("2DPanel") && (r.width = e || 0, (s = t == null ? void 0 : t.GUIManager) == null || s.update(A, "width", e));
    },
    getDefaultValue() {
      return 1024;
    }
  },
  {
    property: "height",
    name: "高度",
    valueType: se.Number,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i, s;
      const r = t.getMetadata(A);
      (i = (n = r == null ? void 0 : r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("2DPanel") && (r.height = e || 0, (s = t == null ? void 0 : t.GUIManager) == null || s.update(A, "height", e));
    },
    getDefaultValue() {
      return 1024;
    }
  },
  {
    property: "backgroundColor",
    name: "背景色",
    valueType: se.String,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i, s;
      const r = t.getMetadata(A);
      (i = (n = r == null ? void 0 : r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("2DPanel") && (r.backgroundColor = e || "", (s = t == null ? void 0 : t.GUIManager) == null || s.update(A, "backgroundColor", e));
    }
  },
  {
    property: "imageSource",
    name: "背景图片",
    valueType: se.String,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i, s;
      const r = t.getMetadata(A);
      (i = (n = r == null ? void 0 : r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("2DPanel") && (r.imageSource = e || "", (s = t == null ? void 0 : t.GUIManager) == null || s.update(A, "imageSource", e));
    }
  },
  {
    property: "stretch",
    name: "填充方式",
    valueType: se.Number,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i, s;
      const r = t.getMetadata(A);
      (i = (n = r == null ? void 0 : r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("2DPanel") && (r.stretch = e, (s = t == null ? void 0 : t.GUIManager) == null || s.update(A, "stretch", e));
    },
    getDefaultValue() {
      return 1;
    }
  },
  {
    property: "contents",
    name: "内容列表",
    valueType: se.Array,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i, s;
      const r = t.getMetadata(A);
      (i = (n = r == null ? void 0 : r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("2DPanel") && (e.forEach((a) => {
        a.id || (a.id = e4()), a.name || (a.name = a.id), a.type || (a.type = "text"), a.left || (a.left = 0), a.top || (a.top = 0), a.width || (a.width = 0), a.height || (a.height = 0);
      }), r.contents = e, (s = t == null ? void 0 : t.GUIManager) == null || s.update(A, "contents", e));
    }
  },
  {
    property: "limitY",
    name: "高度",
    valueType: se.Number,
    includes: [se.FreeCamera],
    setValue(A, e, t) {
      const r = t.getMetadata(A);
      r.limitY = e, A.position.y = e;
    },
    getDefaultValue() {
      return 5;
    }
  },
  {
    property: "maxHeight",
    name: "最大高度",
    valueType: se.Number,
    includes: [se.ShaderMaterial],
    getValue(A, e) {
      var n;
      const t = e.getMetadata(A);
      if (((n = t == null ? void 0 : t.__initOption) == null ? void 0 : n.type) === Rv.Grad)
        return t.maxHeight;
    },
    setValue(A, e, t) {
      var i;
      const r = t.getMetadata(A);
      ((i = r == null ? void 0 : r.__initOption) == null ? void 0 : i.type) === Rv.Grad && (A.setFloat("maxHeight", e), r.maxHeight = e);
    }
  },
  {
    property: "minHeight",
    name: "最小高度",
    valueType: se.Number,
    includes: [se.ShaderMaterial],
    getValue(A, e) {
      var n;
      const t = e.getMetadata(A);
      if (((n = t == null ? void 0 : t.__initOption) == null ? void 0 : n.type) === Rv.Grad)
        return t.minHeight;
    },
    setValue(A, e, t) {
      var i;
      const r = t.getMetadata(A);
      ((i = r == null ? void 0 : r.__initOption) == null ? void 0 : i.type) === Rv.Grad && (A.setFloat("minHeight", e), r.minHeight = e);
    }
  },
  {
    property: "mainColor",
    name: "主颜色",
    valueType: se.String,
    includes: [se.ShaderMaterial],
    getValue(A, e) {
      var n;
      const t = e.getMetadata(A);
      if (((n = t == null ? void 0 : t.__initOption) == null ? void 0 : n.type) === Rv.Grad)
        return t.mainColor;
    },
    setValue(A, e, t) {
      var i;
      const r = t.getMetadata(A);
      if (((i = r == null ? void 0 : r.__initOption) == null ? void 0 : i.type) === Rv.Grad) {
        const s = A4(e);
        A.setColor3("mainColor", s), r.mainColor = e;
      }
    },
    getDefaultValue() {
      return "#fff";
    }
  },
  {
    property: "alphaK",
    name: "线性透明度因子",
    valueType: se.Number,
    includes: [se.ShaderMaterial],
    getValue(A, e) {
      var n;
      const t = e.getMetadata(A);
      if (((n = t == null ? void 0 : t.__initOption) == null ? void 0 : n.type) === Rv.Grad)
        return t.alphaK;
    },
    setValue(A, e, t) {
      var i;
      const r = t.getMetadata(A);
      ((i = r == null ? void 0 : r.__initOption) == null ? void 0 : i.type) === Rv.Grad && (A.setFloat("alphaK", e), r.alphaK = e);
    }
  },
  {
    property: "changeColor",
    name: "辅颜色",
    valueType: se.Color3,
    includes: [se.ShaderMaterial],
    getValue(A, e) {
      var n;
      const t = e.getMetadata(A);
      if (((n = t == null ? void 0 : t.__initOption) == null ? void 0 : n.type) === Rv.OutLine)
        return t.changeColor;
    },
    setValue(A, e, t) {
      var i;
      const r = t.getMetadata(A);
      ((i = r == null ? void 0 : r.__initOption) == null ? void 0 : i.type) === Rv.OutLine && (A.setColor3("changeColor", e), r.changeColor = zt.serialize(e, t));
    },
    getDefaultValue() {
      return "#fff";
    }
  },
  {
    property: "power",
    name: "指数透明因子",
    valueType: se.Number,
    includes: [se.ShaderMaterial],
    getValue(A, e) {
      var n;
      const t = e.getMetadata(A);
      if (((n = t == null ? void 0 : t.__initOption) == null ? void 0 : n.type) === Rv.OutLine)
        return t.power;
    },
    setValue(A, e, t) {
      var i;
      const r = t.getMetadata(A);
      ((i = r == null ? void 0 : r.__initOption) == null ? void 0 : i.type) === Rv.OutLine && (A.setFloat("power", e), r.power = e);
    },
    getDefaultValue() {
      return 2;
    }
  },
  {
    property: "k",
    name: "线性透明因子",
    valueType: se.Number,
    includes: [se.ShaderMaterial],
    getValue(A, e) {
      var n;
      const t = e.getMetadata(A);
      if (((n = t == null ? void 0 : t.__initOption) == null ? void 0 : n.type) === Rv.OutLine)
        return t.k;
    },
    setValue(A, e, t) {
      var i;
      const r = t.getMetadata(A);
      ((i = r == null ? void 0 : r.__initOption) == null ? void 0 : i.type) === Rv.OutLine && (A.setFloat("k", e), r.k = e);
    },
    getDefaultValue() {
      return 1;
    }
  },
  {
    property: "useGlowLayer",
    name: "开启辉光",
    valueType: se.Boolean,
    includes: [se.Mesh],
    setValue(A, e, t) {
      const r = t.getMetadata(A);
      r.useGlowLayer = e, e ? t.glManager.setGlowLayer(A) : t.glManager.detachGl(A);
    }
  },
  {
    property: "glBlurKernelSize",
    name: "辉光模糊因子",
    valueType: se.Number,
    includes: [se.Mesh],
    setValue(A, e, t) {
      const r = t.getMetadata(A);
      r.glBlurKernelSize = e, t.glManager.setGlowLayer(A);
    },
    getDefaultValue() {
      return 32;
    }
  },
  {
    property: "glIntensity",
    name: "辉光亮度",
    valueType: se.Number,
    includes: [se.Mesh],
    setValue(A, e, t) {
      const r = t.getMetadata(A);
      r.glIntensity = e, t.glManager.setGlowLayer(A);
    },
    getDefaultValue() {
      return 1;
    }
  },
  //粒子
  // {
  //   property: "useParticle",
  //   name: "开启粒子",
  //   valueType: ValueType.Boolean,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: boolean, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.useParticle = value;
  //     if (value) {
  //       if (!manager.scene.getParticleSystemById("le5le_particle")) {
  //         manager.particle = createParticleSystem(manager);
  //       } else {
  //         manager.particle?.start();
  //       }
  //     } else {
  //       manager.particle?.stop();
  //       // manager.particle?.dispose();
  //       // manager.particle = undefined;
  //     }
  //   },
  //   getDefaultValue() {
  //     return false;
  //   },
  // },
  // {
  //   property: "spriteCapacity",
  //   name: "开启粒子",
  //   valueType: ValueType.Number,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.spriteCapacity = value;
  //     if (value) {
  //       manager.particle?.dispose();
  //       manager.particle = undefined;
  //       if (metadata.useParticle) {
  //         manager.particle = createParticleSystem(manager);
  //       }
  //     }
  //   },
  //   getDefaultValue() {
  //     return 200;
  //   },
  // },
  // {
  //   property: "particleTexture",
  //   name: "粒子贴图url",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: string, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.particleTexture = value;
  //     if (manager.particle?.particleTexture) {
  //       if (value) {
  //         (<Texture>manager.particle.particleTexture).updateURL(
  //           value,
  //           null,
  //           () => {
  //             metadata.spriteCellWidth =
  //               manager.particle.particleTexture.getSize().width;
  //             metadata.spriteCellHeight =
  //               manager.particle.particleTexture.getSize().height;
  //             manager.particle.spriteCellHeight = metadata.spriteCellHeight;
  //             manager.particle.spriteCellWidth = metadata.spriteCellWidth;
  //           }
  //         );
  //       } else {
  //         let texture = new Texture(value, manager.scene);
  //         (<Texture>manager.particle.particleTexture) = texture;
  //         let loadOb = texture.onLoadObservable.add(() => {
  //           metadata.spriteCellWidth = texture.getSize().width;
  //           metadata.spriteCellHeight = texture.getSize().height;
  //           manager.particle.spriteCellHeight = metadata.spriteCellHeight;
  //           manager.particle.spriteCellWidth = metadata.spriteCellWidth;
  //           texture.onLoadObservable.remove(loadOb);
  //         });
  //       }
  //     }
  //   },
  //   getDefaultValue() {
  //     return PARTICAL_TEXTUREURL;
  //   },
  // },
  // {
  //   property: "spriteCellWidth",
  //   name: "精灵图宽度",
  //   valueType: ValueType.Number,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.spriteCellWidth = value;
  //     if (manager.particle) {
  //       manager.particle.spriteCellWidth = value;
  //     }
  //   },
  //   getDefaultValue(target, manager) {
  //     return 256;
  //   },
  // },
  // {
  //   property: "spriteCellHeight",
  //   name: "精灵图宽度",
  //   valueType: ValueType.Number,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.spriteCellHeight = value;
  //     if (manager.particle) {
  //       manager.particle.spriteCellHeight = value;
  //     }
  //   },
  //   getDefaultValue(target, manager) {
  //     return 256;
  //   },
  // },
  // {
  //   property: "isAnimationSheetEnabled",
  //   name: "精灵图宽度",
  //   valueType: ValueType.Boolean,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: boolean, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.isAnimationSheetEnabled = value;
  //     if (manager.particle) {
  //       manager.particle.isAnimationSheetEnabled = value;
  //     }
  //   },
  //   getDefaultValue() {
  //     return 1;
  //   },
  // },
  // {
  //   property: "startSpriteCellID",
  //   name: "精灵图宽度",
  //   valueType: ValueType.Number,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.startSpriteCellID = value;
  //     if (manager.particle) {
  //       manager.particle.startSpriteCellID = value;
  //     }
  //   },
  //   getDefaultValue() {
  //     return 0;
  //   },
  // },
  // {
  //   property: "endSpriteCellID",
  //   name: "精灵图宽度",
  //   valueType: ValueType.Number,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.endSpriteCellID = value;
  //     if (manager.particle) {
  //       manager.particle.endSpriteCellID = value;
  //     }
  //   },
  //   getDefaultValue() {
  //     return 0;
  //   },
  // },
  // {
  //   property: "spriteCellChangeSpeed",
  //   name: "精灵图宽度",
  //   valueType: ValueType.Number,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.spriteCellChangeSpeed = value;
  //     if (manager.particle) {
  //       manager.particle.spriteCellChangeSpeed = value;
  //     }
  //   },
  //   getDefaultValue() {
  //     return 0;
  //   },
  // },
  // {
  //   property: "pColor1",
  //   name: "粒子颜色1",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: string, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pColor1 = value;
  //     if (manager.particle) {
  //       manager.particle.color1 = stringToColor3(value).toColor4();
  //     }
  //   },
  //   getDefaultValue() {
  //     return new Color4(0.7, 0.8, 1.0, 1.0).toHexString();
  //   },
  // },
  // {
  //   property: "pColor2",
  //   name: "粒子颜色2",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: string, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pColor2 = value;
  //     if (manager.particle) {
  //       manager.particle.color2 = stringToColor3(value).toColor4();
  //     }
  //   },
  //   getDefaultValue() {
  //     return new Color4(0.2, 0.5, 1.0, 1.0).toHexString();
  //   },
  // },
  // {
  //   property: "pColorDead",
  //   name: "粒子颜色2",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: string, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pColorDead = value;
  //     if (manager.particle) {
  //       manager.particle.colorDead = stringToColor3(value).toColor4();
  //     }
  //   },
  //   getDefaultValue() {
  //     return new Color4(0.7, 0.8, 1.0, 1.0).toHexString();
  //   },
  // },
  // {
  //   property: "pSize",
  //   name: "粒子大小",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pSize = value;
  //     if (manager.particle) {
  //       manager.particle.maxSize = value + 2;
  //       manager.particle.minSize = value - 2;
  //     }
  //   },
  //   getDefaultValue() {
  //     return 5;
  //   },
  // },
  // {
  //   property: "pEmitRate",
  //   name: "粒子大小",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pEmitRate = value;
  //     if (manager.particle) {
  //       manager.particle.emitRate = value;
  //     }
  //   },
  //   getDefaultValue() {
  //     return 1500;
  //   },
  // },
  // {
  //   property: "pDravityDirection",
  //   name: "粒子大小",
  //   valueType: ValueType.Boolean,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: boolean, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pDravityDirection = value;
  //     if (manager.particle) {
  //       if (value) {
  //         manager.particle.gravity = new Vector3(0, -9.81, 0);
  //       } else {
  //         manager.particle.gravity = new Vector3(0, 9.81, 0);
  //       }
  //     }
  //   },
  //   getDefaultValue() {
  //     return false;
  //   },
  // },
  // {
  //   property: "pEmitRate",
  //   name: "发射速率",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pEmitRate = value;
  //     if (manager.particle) {
  //       manager.particle.emitRate = value;
  //     }
  //   },
  //   getDefaultValue() {
  //     return 1;
  //   },
  // },
  // {
  //   property: "pPower",
  //   name: "发射速率",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pPower = value;
  //     if (manager.particle) {
  //       manager.particle.maxEmitPower = value + 2;
  //       manager.particle.minEmitPower = value;
  //     }
  //   },
  //   getDefaultValue() {
  //     return 1;
  //   },
  // },
  // {
  //   property: "updateSpeed",
  //   name: "发射速率",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.updateSpeed = value;
  //     if (manager.particle) {
  //       manager.particle.updateSpeed = value;
  //     }
  //   },
  //   getDefaultValue() {
  //     return 0.005;
  //   },
  // },
  // {
  //   property: "pHeight",
  //   name: "粒子生成高度",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pHeight = value;
  //     if (manager.particle) {
  //       let pRegion = metadata.pRegion ? metadata.pRegion : 500;
  //       manager.particle.minEmitBox = new Vector3(-pRegion, value, -pRegion); // Bottom Left Front
  //       manager.particle.maxEmitBox = new Vector3(pRegion, value, pRegion); // Top Right Back
  //     }
  //   },
  //   getDefaultValue() {
  //     return -15;
  //   },
  // },
  // {
  //   property: "pRegion",
  //   name: "粒子生成面积",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pRegion = value;
  //     if (manager.particle) {
  //       let pHeight = metadata.pHeight ? metadata.pHeight : -15;
  //       manager.particle.minEmitBox = new Vector3(-value, pHeight, -value); // Bottom Left Front
  //       manager.particle.maxEmitBox = new Vector3(value, pHeight, value); // Top Right Back
  //     }
  //   },
  //   getDefaultValue() {
  //     return 500;
  //   },
  // },
  // {
  //   property: "pLifeTime",
  //   name: "粒子生存时间",
  //   valueType: ValueType.String,
  //   includes: [ValueType.Scene],
  //   setValue(target: Scene, value: number, manager: SceneManager) {
  //     let metadata = manager.getMetadata(target);
  //     metadata.pLifeTime = value;
  //     if (manager.particle) {
  //       manager.particle.maxLifeTime = value + 2;
  //       manager.particle.minLifeTime = value - 1;
  //     }
  //   },
  //   getDefaultValue() {
  //     return 5;
  //   },
  // },
  // {
  //   property: "_useSG",
  //   name: "开启阴影",
  //   valueType: ValueType.Boolean,
  //   includes: [
  //     ValueType.SpotLight,
  //     ValueType.DirectionalLight,
  //     ValueType.PointLight,
  //   ],
  //   setValue(target: SpotLight | DirectionalLight | PointLight, value) {
  //     target.metadata._useSG = value;
  //     if (value) {
  //       let sg = target.getShadowGenerator();
  //       if (!sg) {
  //         sg = new ShadowGenerator(1024, target);
  //         const newSG = sg as ShadowGenerator;
  //         newSG.bias = 0.001;
  //         newSG.normalBias = 0.02;
  //         target.shadowMaxZ = 1000;
  //         target.shadowMinZ = 0;
  //         newSG.useContactHardeningShadow = true;
  //         newSG.contactHardeningLightSizeUVRatio = 0.5;
  //         newSG.useBlurExponentialShadowMap = true;
  //         // newSG.setDarkness(0.5);
  //         // newSG.transparencyShadow = true;
  //         // newSG.enableSoftTransparentShadow = true;
  //         const scene = target.getScene();
  //         scene.meshes.forEach((mesh) => {
  //           if (!isLightAuxiliaryMesh(mesh)) {
  //             if (!mesh.receiveShadows) {
  //               mesh.receiveShadows = true;
  //             }
  //             newSG.addShadowCaster(mesh, false);
  //           }
  //         });
  //       }
  //     } else {
  //       let sg = target.getShadowGenerator();
  //       if (sg) {
  //         sg.dispose();
  //       }
  //     }
  //   },
  // },
  // {
  //   property: "renderList",
  //   name: "反射列表",
  //   valueType: ValueType.Array,
  //   includes: [ValueType.WaterMaterial],
  //   setValue(target: WaterMaterial, value: Array<string>, manager) {
  //     const metadata = manager.getMetadata(target);
  //     metadata.renderList = value;
  //     let renderList = target.getRenderList();
  //     // if (renderList.length > 0) {
  //     //   // renderList.length = 0;
  //     // }
  //     const scene = target.getScene();
  //     value.forEach((meshName) => {
  //       let mesh = scene.getMeshByName(meshName);
  //       if (mesh) {
  //         [mesh, ...mesh.getChildMeshes()].forEach((reflectedMesh) => {
  //           if (reflectedMesh) {
  //             // console.log("reflectedMesh:",reflectedMesh)
  //             if (scene.meshes.includes(reflectedMesh)) {
  //               console.log("当前场景有该Mesh");
  //               target.addToRenderList(reflectedMesh);
  //             }else{
  //               reflectedMesh.onReady = () => {
  //                 target.addToRenderList(reflectedMesh);
  //               }
  //             }
  //           }
  //         });
  //       }
  //       let photoDome = scene.getTransformNodeByName(meshName);
  //       if (photoDome instanceof PhotoDome) {
  //         console.log("反射天空盒");
  //         target.addToRenderList(photoDome.mesh);
  //       }
  //     });
  //   },
  // },
  //curver色彩调节属性
  // curve.globalExposure = 0; // 0 by default
  // curve.globalExposure = 1; // 0 by default
  // curve.globalHue =300; // 30 by default
  // curve.globalSaturation = 100; // 0 by default
  // {
  //   property: "globalDensity",
  //   name: "全局阴影",
  //   valueType: ValueType.Number,
  //   includes: [ValueType.Scene],
  //   setValue(
  //     target: Scene,
  //     value: number,
  //     manager: SceneManager
  //   ) {
  //     const metadata = manager.getMetadata(target);
  //     metadata.globalDensity = value;
  //     if (manager.pipeline) {
  //       if (!manager.pipeline.imageProcessing.colorCurves) {
  //         manager.pipeline.imageProcessing.colorCurves = new ColorCurves();
  //       }
  //       if (value) {
  //         manager.pipeline.imageProcessing.colorCurvesEnabled = true;
  //       }
  //       manager.pipeline.imageProcessing.colorCurves.globalDensity = value;
  //     }
  //   },
  // },
  // {
  //   property: "globalExposure",
  //   name: "曝光度",
  //   valueType: ValueType.Number,
  //   includes: [ValueType.Scene],
  //   setValue(
  //     target: Scene,
  //     value: number,
  //     manager: SceneManager
  //   ) {
  //     const metadata = manager.getMetadata(target);
  //     metadata.globalExposure = value;
  //     if (manager.pipeline) {
  //       if (!manager.pipeline.imageProcessing.colorCurves) {
  //         manager.pipeline.imageProcessing.colorCurves = new ColorCurves();
  //       }
  //       if (value) {
  //         manager.pipeline.imageProcessing.colorCurvesEnabled = true;
  //       }
  //       manager.pipeline.imageProcessing.colorCurves.globalExposure = value;
  //     }
  //   },
  // },
  /*   dofBlurLevel?:number;
  dofFStop?:number;
  dofFocalLength?:number;
  dofFocusDistance?:number;
  dofLensSize?:number; */
  /*   defaultPipeline.depthOfFieldEnabled = false; // false by default
       if (defaultPipeline.depthOfFieldEnabled && defaultPipeline.depthOfField.isSupported) {
           defaultPipeline.depthOfFieldBlurLevel = 0; // 0 by default
           defaultPipeline.depthOfField.focalLength = 1.4; // 1.4 by default
           defaultPipeline.depthOfField.focalLength = 50; // 50 by default, mm
           defaultPipeline.depthOfField.focusDistance = 2000; // 2000 by default, mm
           defaultPipeline.depthOfField.lensSize = 50; // 50 by default
       } */
  // blur Dispersion Strength
  //锐化
  /*  defaultPipeline.sharpenEnabled = true;
   if (defaultPipeline.sharpenEnabled) {
       defaultPipeline.sharpen.adaptScaleToCurrentViewport = true; // false by default
       defaultPipeline.sharpen.edgeAmount = 0.3; // 0.3 by default
       defaultPipeline.sharpen.colorAmount = 1; // 1 by default
   } */
  {
    property: "generateShadow",
    name: "生成阴影",
    valueType: se.Boolean,
    includes: [se.AbstractMesh, se.Mesh],
    setValue(A, e, t) {
      t.scene.scene.lights.forEach((r) => {
        const n = r.getShadowGenerator();
        e ? n == null || n.addShadowCaster(A, !0) : n == null || n.removeShadowCaster(A, !0);
      }), [A, ...A.getChildMeshes()].forEach((r) => {
        t.getMetadata(r) || t.setMetadata(r, {});
        const n = t.getMetadata(r);
        n && (n.generateShadow = e);
      });
    },
    getDefaultValue() {
      return !0;
    }
  },
  //火焰与烟雾粒子
  {
    property: "smokePColor",
    name: "烟雾粒子颜色",
    valueType: se.Color4,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i;
      const r = t.getMetadata(A);
      if ((i = (n = r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("smoke")) {
        let s = t.particleManager.meshMap.get(A);
        s ? (r.smokePColor = cO(e), s.getColorGradients().forEach((a) => {
          a.color1 = e, a.color2 = e;
        })) : t.particleManager.addProperty(A, {
          property: "colorGrading",
          value: e
        });
      }
    },
    getDefaultValue() {
      return Ne.White().toColor4();
    }
  },
  {
    property: "smokePWindX",
    name: "烟雾粒子颜色",
    valueType: se.Number,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i;
      const r = t.getMetadata(A);
      if ((i = (n = r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("smoke")) {
        let s = t.particleManager.meshMap.get(A);
        r.smokePWindX = e, s ? s.gravity.x = e : t.particleManager.addProperty(A, {
          property: "gravity.x",
          value: e
        });
      }
    },
    getDefaultValue() {
      return 0;
    }
  },
  {
    property: "smokePWindZ",
    name: "烟雾粒子颜色",
    valueType: se.Number,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i;
      const r = t.getMetadata(A);
      if ((i = (n = r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("smoke")) {
        let s = t.particleManager.meshMap.get(A);
        r.smokePWindZ = e, s ? s.gravity.z = e : t.particleManager.addProperty(A, {
          property: "gravity.z",
          value: e
        });
      }
    },
    getDefaultValue() {
      return 0;
    }
  },
  {
    property: "smokePSpeed",
    name: "烟雾生成速度",
    valueType: se.Number,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i;
      const r = t.getMetadata(A);
      if ((i = (n = r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("smoke")) {
        let s = t.particleManager.meshMap.get(A);
        r.smokePSpeed = e, s ? s.updateSpeed = e : t.particleManager.addProperty(A, {
          property: "updateSpeed",
          value: e
        });
      }
    },
    getDefaultValue() {
      return 0.01;
    }
  },
  {
    property: "smokePPow",
    name: "烟雾生成范围",
    valueType: se.Number,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i;
      const r = t.getMetadata(A);
      if ((i = (n = r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("smoke")) {
        let s = t.particleManager.meshMap.get(A);
        r.smokePPow = e, s ? (s.maxEmitPower = e, s.minEmitPower = e) : (t.particleManager.addProperty(A, {
          property: "maxEmitPower",
          value: e
        }), t.particleManager.addProperty(A, {
          property: "minEmitPower",
          value: e
        }));
      }
    },
    getDefaultValue() {
      return 1;
    }
  },
  {
    property: "smokePSize",
    name: "烟雾大小",
    valueType: se.Number,
    includes: [se.Mesh],
    setValue(A, e, t) {
      var n, i;
      const r = t.getMetadata(A);
      if ((i = (n = r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("smoke")) {
        let s = t.particleManager.meshMap.get(A);
        r.smokePSize = e, s ? (s.minScaleX = e, s.minScaleY = e, s.maxScaleX = e, s.maxScaleY = e) : (t.particleManager.addProperty(A, {
          property: "minScaleX",
          value: e
        }), t.particleManager.addProperty(A, {
          property: "minScaleY",
          value: e
        }), t.particleManager.addProperty(A, {
          property: "maxScaleX",
          value: e
        }), t.particleManager.addProperty(A, {
          property: "maxScaleY",
          value: e
        }));
      }
    },
    getDefaultValue() {
      return 1;
    }
  },
  /* {
    property: "mode",
    name: "相机模式",
    valueType: ValueType.Boolean,
    animatable: false,
    includes: [ValueType.ArcRotateCamera, ValueType.FreeCamera],
    setValue(target: ArcRotateCamera, value: boolean, manager: SceneManager) {
      if (value) {
        let height = manager.root.engine.getRenderHeight();
        let width = manager.root.engine.getRenderWidth();
        let radio = width / height;
        target.mode = 1;
        target.orthoBottom = -target.radius / 2 / radio;
        target.orthoTop = target.radius / 2 / radio;
        target.orthoLeft = -target.radius / 2;
        target.orthoRight = target.radius / 2;
        target.minZ = -10000;
        manager.cameraManager?.setOrthogonalCameraOb();
        let metadata = manager.getMetadata(target) as any;
        metadata.upperBetaLimit = target.upperBetaLimit;
        metadata.lowerBetaLimit = target.lowerBetaLimit;
        target.upperBetaLimit = 0.1;
        target.lowerBetaLimit = 0.1;
        // target.alpha = Math.PI/2;
        // target.beta = 0;
      } else {
        target.mode = Camera.PERSPECTIVE_CAMERA;
        manager.cameraManager?.clearOrthogonalCameraOb();
        let metadata = manager.getMetadata(target) as any;
        if (metadata.upperBetaLimit)
          target.upperBetaLimit = metadata.upperBetaLimit;
        if (metadata.lowerBetaLimit)
          target.lowerBetaLimit = metadata.lowerBetaLimit;
      }
    },
    getValue(target: Camera, manager) {
      return target.mode ? true : false;
    },
  }, */
  //经纬度
  {
    property: "lon",
    name: "经度",
    valueType: se.Number,
    animatable: !1,
    includes: [se.Mesh],
    setValue(A, e, t) {
      const r = t.getMetadata(A), { lat: n } = r;
      n != null && (r.lon = e, A instanceof Ee && (A.position = t.LonLatToVector3(r.lon, r.lat)));
    },
    getValue(A, e) {
      let t = e.getMetadata(e.scene), r = 0;
      if (t.lon)
        if (A instanceof Ee) {
          let n = e.getMetadata(A), i = e.vecToLonlat(
            A.getAbsolutePosition().clone()
          );
          n.lon = i.longitude, n.lat = i.latitude, r = n.lon;
        } else
          r = t.lon;
      return r;
    }
  },
  {
    property: "lat",
    name: "纬度",
    valueType: se.Number,
    animatable: !1,
    includes: [se.Mesh],
    setValue(A, e, t) {
      const r = t.getMetadata(A), { lon: n } = r;
      n != null && (r.lat = e, A instanceof Ee && (A.position = t.LonLatToVector3(r.lon, r.lat)));
    },
    getValue(A, e) {
      let t = e.getMetadata(e.scene), r = 0;
      if (t.lat)
        if (A instanceof Ee) {
          let n = e.getMetadata(A), i = e.vecToLonlat(
            A.getAbsolutePosition().clone()
          );
          n.lon = i.longitude, n.lat = i.latitude, r = n.lat;
        } else
          r = t.lat;
      return r;
    }
  }
], DN = Pbe.map((A) => {
  const e = { ...A, isMetadata: !0 }, {
    getDefaultValue: t,
    getValue: r,
    setValue: n,
    serialize: i,
    property: s,
    includes: a,
    excludes: f,
    valueType: o,
    serializable: d = !0
  } = A;
  return e.verify = (v) => (!f || !f.includes(v)) && (!a || a.includes(v)), e.verifyValue = (v, u) => e.verify(zt.typeOf(v, u)), e.getDefaultValue = (v, u) => {
    if (e.verifyValue(v, u))
      return t ? t(v, u) : EBe(Xa(o)[0]);
  }, e.getValue = (v, u) => {
    if (e.verifyValue(v, u)) {
      if (r)
        return r(v, u);
      {
        const l = u.getMetadata(v);
        return l == null ? void 0 : l[s];
      }
    }
  }, e.setValue = (v, u, l) => {
    if (e.verifyValue(v, l))
      if (l.getMetadata(v) || l.setMetadata(v, {}), u = zt.deserialize(u, l, o), n)
        n(v, u, l);
      else {
        const P = l.getMetadata(v);
        P[s] = u;
      }
  }, e.serialize = (v, u, l = !1) => {
    if (d) {
      if (i)
        return i(v, u, l);
      {
        const P = e.getValue(v, u);
        if (!V0(P) || !P.doNotSerialize)
          return zt.serialize(P, u, l);
      }
    }
  }, e;
});
class JSe {
  constructor(e) {
    this._panningMouseButton = 2, this._isAttached = !1, this.showTargetMesh = () => {
      if (this._targetMesh)
        return;
      const r = Ef.CreateSphere(_1e), n = this.arcRotateCamera.radius / 100;
      r.scaling = new S(n, n, n), r.isPickable = !1;
      const i = new Wt("", this.manager.scene.scene);
      i.maxSimultaneousLights = 0, i.emissiveColor = new Ne(1, 0.7, 0.4), r.material = i, r.position.copyFrom(this.arcRotateCamera.target), this._targetMesh = r, this._observable && this.arcRotateCamera.onViewMatrixChangedObservable.remove(this._observable), this._observable = this.arcRotateCamera.onViewMatrixChangedObservable.add(() => {
        const s = this.arcRotateCamera.radius / 100;
        this._targetMesh.scaling = new S(s, s, s), this._targetMesh.position.copyFrom(this.arcRotateCamera.target);
      });
    }, this.hideTargetMesh = () => {
      var r;
      (r = this._targetMesh) == null || r.dispose(!1, !0), this._targetMesh = void 0, this.arcRotateCamera.onViewMatrixChangedObservable.remove(this._observable), this._observable = void 0;
    }, this.setOrthogonalCameraOb = () => {
      this._orthogonalCamera || (this._orthogonalCamera = this.manager.scene.scene.onPointerObservable.add((r, n) => {
        if (r.type == 8) {
          let i = this.manager.scene.scene.getEngine().getRenderHeight(), a = this.manager.scene.scene.getEngine().getRenderWidth() / i;
          r.event.deltaY > 0 ? (this.arcRotateCamera.radius -= 0.5, this.arcRotateCamera.orthoBottom -= 0.5 / a, this.arcRotateCamera.orthoTop += 0.5 / a, this.arcRotateCamera.orthoLeft -= 0.5, this.arcRotateCamera.orthoRight += 0.5) : (this.arcRotateCamera.radius += 0.5, this.arcRotateCamera.orthoBottom += 0.5 / a, this.arcRotateCamera.orthoTop -= 0.5 / a, this.arcRotateCamera.orthoLeft += 0.5, this.arcRotateCamera.orthoRight -= 0.5);
        }
      }));
    }, this.clearOrthogonalCameraOb = () => {
      this._orthogonalCamera && (this.manager.scene.scene.onPointerObservable.remove(this._orthogonalCamera), this._orthogonalCamera = void 0);
    }, this.manager = e;
    const t = zt.createInstance(
      se.ArcRotateCamera,
      this.manager,
      {
        alpha: 0,
        beta: 0,
        radius: 0,
        target: { x: 0, y: 0, z: 0 }
      }
    );
    t.id = "旋转相机", t.inputs.remove(t.inputs.attached.keyboard), t.name = Z1e, t.zoomToMouseLocation = !1, t.lowerRadiusLimit = 1, t.upperRadiusLimit = 1e3, t.inertia = 0.6, t.panningInertia = 0.6, t.inertialRadiusOffset = 0.6, t.panningAxis = new S(1, 1, 1), t.wheelPrecision = 2.5, t.panningSensibility = 100, t.angularSensibilityX = 500, t.angularSensibilityY = 500, t.setTarget(S.Zero()), t.setPosition(new S(0, 10, 20)), t.onViewMatrixChangedObservable.add(() => {
      t.panningSensibility = 5e3 / t.radius, this.manager.root.emit("cameraViewChanged", {
        type: "arcRotate",
        camera: t,
        sceneManager: this
      });
    }), this.arcRotateCamera = t, this.manager.root.getOptions().operateMode === 2 ? this.panningMouseButton = 0 : this.panningMouseButton = 2;
  }
  get panningMouseButton() {
    return this._panningMouseButton;
  }
  set panningMouseButton(e) {
    this._panningMouseButton = e, this.isAttached = this.isAttached;
  }
  get isAttached() {
    return this._isAttached;
  }
  set isAttached(e) {
    this._isAttached !== e && (e ? this.arcRotateCamera.attachControl(!0, !1, this.panningMouseButton) : this.arcRotateCamera.detachControl(), this._isAttached = e);
  }
}
class cbe {
  constructor(e) {
    this.color = "#ed952d", this._meshes = [], this._uniqueIdMap = /* @__PURE__ */ new Map(), this._uniqueId = -1e3, this._running = !1, this.add = (t, r = this.color) => {
      Array.from(
        new Set(
          Xa(t).reduce(
            (i, s) => [
              ...i,
              s,
              ...this.manager.nodeManager.getChildren(s)
            ],
            []
          ).filter((i) => i instanceof Ee)
        )
      ).forEach((i) => this._addMesh(i, A4(r)));
    }, this.remove = (t) => {
      Array.from(
        new Set(
          Xa(t).reduce(
            (n, i) => [
              ...n,
              i,
              ...this.manager.nodeManager.getChildren(i)
            ],
            []
          ).filter((n) => n instanceof Ee)
        )
      ).forEach((n) => this._removeMesh(n));
    }, this.clear = () => {
      [...this._meshes].forEach((t) => this._removeMesh(t.mesh));
    }, this.dispose = () => {
      this.clear(), this._meshes = [], this._uniqueId = -1e3, this._uniqueIdMap.clear(), this.layer.dispose();
    }, this._addMesh = (t, r) => {
      this._meshes.findIndex((i) => i.mesh === t) > -1 && this._removeMesh(t), this.layer.removeExcludedMesh(t);
      {
        const i = this._uniqueId;
        this._uniqueId--, t.material && (this._uniqueIdMap.set(t.material, t.material.uniqueId), t.material.uniqueId = i), t.uniqueId = i, this._uniqueIdMap.set(t, t.uniqueId);
      }
      this._meshes.push({ mesh: t, color: r }), this.layer.addMesh(t, r);
    }, this._removeMesh = (t) => {
      const r = this._meshes.findIndex((n) => n.mesh === t);
      if (r !== -1) {
        this.layer.removeMesh(t);
        {
          const n = this._uniqueIdMap.get(t) ?? t.uniqueId;
          if (t.material) {
            const i = this._uniqueIdMap.get(t.material) ?? t.material.uniqueId;
            t.material.uniqueId = i;
          }
          t.uniqueId = n, this._uniqueIdMap.delete(t);
        }
        this._meshes.splice(r, 1), this.layer.addExcludedMesh(t);
      }
    }, this.manager = e, this.layer = new Ad(i2e, this.manager.scene.scene, {
      isStroke: !0,
      mainTextureRatio: 0.1,
      mainTextureFixedSize: 2048
    }), this.layer.innerGlow = !1, this.layer.outerGlow = !0;
  }
  get running() {
    return this._running;
  }
  set running(e) {
    if (e === this._running)
      return;
    const t = [...this._meshes];
    this.clear(), this._running = e, this.layer.innerGlow = e, this.layer.outerGlow = !e, t.forEach(({ mesh: r, color: n }) => this._addMesh(r, n));
  }
}
function TI(A) {
  throw new Error('Could not dynamically require "' + A + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var Rfe = { exports: {} };
(function(A, e) {
  (function(t) {
    A.exports = t();
  })(function() {
    return (/* @__PURE__ */ function() {
      return function t(r, n, i) {
        function s(o, d) {
          if (!n[o]) {
            if (!r[o]) {
              var v = typeof TI == "function" && TI;
              if (!d && v)
                return v(o, !0);
              if (a)
                return a(o, !0);
              var u = new Error("Cannot find module '" + o + "'");
              throw u.code = "MODULE_NOT_FOUND", u;
            }
            var l = n[o] = { exports: {} };
            r[o][0].call(l.exports, function(P) {
              return s(r[o][1][P] || P);
            }, l, l.exports, t, r, n, i);
          }
          return n[o].exports;
        }
        for (var a = typeof TI == "function" && TI, f = 0; f < i.length; f++)
          s(i[f]);
        return s;
      };
    }())({ 1: [function(t, r, n) {
      (function(i, s) {
        (function() {
          const a = t("events").EventEmitter, f = t("./store"), o = t("./topic-alias-recv"), d = t("./topic-alias-send"), v = t("mqtt-packet"), u = t("./default-message-id-provider"), l = t("readable-stream").Writable, P = t("inherits"), p = t("reinterval"), c = t("rfdc/default"), H = t("./validations"), T = t("xtend"), q = t("debug")("mqttjs:client"), b = i ? i.nextTick : function(O) {
            setTimeout(O, 0);
          }, j = s.setImmediate || function(O) {
            b(O);
          }, w = { keepalive: 60, reschedulePings: !0, protocolId: "MQTT", protocolVersion: 4, reconnectPeriod: 1e3, connectTimeout: 3e4, clean: !0, resubscribe: !0 }, m = { 0: "", 1: "Unacceptable protocol version", 2: "Identifier rejected", 3: "Server unavailable", 4: "Bad username or password", 5: "Not authorized", 16: "No matching subscribers", 17: "No subscription existed", 128: "Unspecified error", 129: "Malformed Packet", 130: "Protocol Error", 131: "Implementation specific error", 132: "Unsupported Protocol Version", 133: "Client Identifier not valid", 134: "Bad User Name or Password", 135: "Not authorized", 136: "Server unavailable", 137: "Server busy", 138: "Banned", 139: "Server shutting down", 140: "Bad authentication method", 141: "Keep Alive timeout", 142: "Session taken over", 143: "Topic Filter invalid", 144: "Topic Name invalid", 145: "Packet identifier in use", 146: "Packet Identifier not found", 147: "Receive Maximum exceeded", 148: "Topic Alias invalid", 149: "Packet too large", 150: "Message rate too high", 151: "Quota exceeded", 152: "Administrative action", 153: "Payload format invalid", 154: "Retain not supported", 155: "QoS not supported", 156: "Use another server", 157: "Server moved", 158: "Shared Subscriptions not supported", 159: "Connection rate exceeded", 160: "Maximum connect time", 161: "Subscription Identifiers not supported", 162: "Wildcard Subscriptions not supported" };
          function I(O, Y) {
            let ee;
            Y.properties && (ee = Y.properties.topicAlias);
            let Z = Y.topic.toString();
            if (Z.length === 0) {
              if (ee === void 0)
                return new Error("Unregistered Topic Alias");
              if ((Z = O.topicAliasSend.getTopicByAlias(ee)) === void 0)
                return new Error("Unregistered Topic Alias");
              Y.topic = Z;
            }
            ee && delete Y.properties.topicAlias;
          }
          function N(O, Y, ee) {
            q("sendPacket :: packet: %O", Y), q("sendPacket :: emitting `packetsend`"), O.emit("packetsend", Y), q("sendPacket :: writing to stream");
            const Z = v.writeToStream(Y, O.stream, O.options);
            q("sendPacket :: writeToStream result %s", Z), !Z && ee && ee !== R ? (q("sendPacket :: handle events on `drain` once through callback."), O.stream.once("drain", ee)) : ee && (q("sendPacket :: invoking cb"), ee());
          }
          function k(O, Y, ee, Z) {
            q("storeAndSend :: store packet with cmd %s to outgoingStore", Y.cmd);
            let te, fe = Y;
            if (fe.cmd === "publish" && (fe = c(Y), te = I(O, fe)))
              return ee && ee(te);
            O.outgoingStore.put(fe, function(_) {
              if (_)
                return ee && ee(_);
              Z(), N(O, Y, ee);
            });
          }
          function R(O) {
            q("nop ::", O);
          }
          function y(O, Y) {
            let ee;
            const Z = this;
            if (!(this instanceof y))
              return new y(O, Y);
            for (ee in this.options = Y || {}, w)
              this.options[ee] === void 0 ? this.options[ee] = w[ee] : this.options[ee] = Y[ee];
            q("MqttClient :: options.protocol", Y.protocol), q("MqttClient :: options.protocolVersion", Y.protocolVersion), q("MqttClient :: options.username", Y.username), q("MqttClient :: options.keepalive", Y.keepalive), q("MqttClient :: options.reconnectPeriod", Y.reconnectPeriod), q("MqttClient :: options.rejectUnauthorized", Y.rejectUnauthorized), q("MqttClient :: options.topicAliasMaximum", Y.topicAliasMaximum), this.options.clientId = typeof Y.clientId == "string" ? Y.clientId : "mqttjs_" + Math.random().toString(16).substr(2, 8), q("MqttClient :: clientId", this.options.clientId), this.options.customHandleAcks = Y.protocolVersion === 5 && Y.customHandleAcks ? Y.customHandleAcks : function() {
              arguments[3](0);
            }, this.streamBuilder = O, this.messageIdProvider = this.options.messageIdProvider === void 0 ? new u() : this.options.messageIdProvider, this.outgoingStore = Y.outgoingStore || new f(), this.incomingStore = Y.incomingStore || new f(), this.queueQoSZero = Y.queueQoSZero === void 0 || Y.queueQoSZero, this._resubscribeTopics = {}, this.messageIdToTopic = {}, this.pingTimer = null, this.connected = !1, this.disconnecting = !1, this.queue = [], this.connackTimer = null, this.reconnectTimer = null, this._storeProcessing = !1, this._packetIdsDuringStoreProcessing = {}, this._storeProcessingQueue = [], this.outgoing = {}, this._firstConnection = !0, Y.topicAliasMaximum > 0 && (Y.topicAliasMaximum > 65535 ? q("MqttClient :: options.topicAliasMaximum is out of range") : this.topicAliasRecv = new o(Y.topicAliasMaximum)), this.on("connect", function() {
              const te = this.queue;
              q("connect :: sending queued packets"), function fe() {
                const _ = te.shift();
                q("deliver :: entry %o", _);
                let G = null;
                if (!_)
                  return void Z._resubscribe();
                G = _.packet, q("deliver :: call _sendPacket for %o", G);
                let L = !0;
                G.messageId && G.messageId !== 0 && (Z.messageIdProvider.register(G.messageId) || (L = !1)), L ? Z._sendPacket(G, function($) {
                  _.cb && _.cb($), fe();
                }) : (q("messageId: %d has already used. The message is skipped and removed.", G.messageId), fe());
              }();
            }), this.on("close", function() {
              q("close :: connected set to `false`"), this.connected = !1, q("close :: clearing connackTimer"), clearTimeout(this.connackTimer), q("close :: clearing ping timer"), Z.pingTimer !== null && (Z.pingTimer.clear(), Z.pingTimer = null), this.topicAliasRecv && this.topicAliasRecv.clear(), q("close :: calling _setupReconnect"), this._setupReconnect();
            }), a.call(this), q("MqttClient :: setting up stream"), this._setupStream();
          }
          P(y, a), y.prototype._setupStream = function() {
            const O = this, Y = new l(), ee = v.parser(this.options);
            let Z = null;
            const te = [];
            function fe() {
              if (te.length)
                b(_);
              else {
                const L = Z;
                Z = null, L();
              }
            }
            function _() {
              q("work :: getting next packet in queue");
              const L = te.shift();
              if (L)
                q("work :: packet pulled from queue"), O._handlePacket(L, fe);
              else {
                q("work :: no packets in queue");
                const $ = Z;
                Z = null, q("work :: done flag is %s", !!$), $ && $();
              }
            }
            q("_setupStream :: calling method to clear reconnect"), this._clearReconnect(), q("_setupStream :: using streamBuilder provided to client to create stream"), this.stream = this.streamBuilder(this), ee.on("packet", function(L) {
              q("parser :: on packet push to packets array."), te.push(L);
            }), Y._write = function(L, $, ae) {
              Z = ae, q("writable stream :: parsing buffer"), ee.parse(L), _();
            }, q("_setupStream :: pipe stream to writable stream"), this.stream.pipe(Y), this.stream.on("error", function(L) {
              q("streamErrorHandler :: error", L.message), L.code ? (q("streamErrorHandler :: emitting error"), O.emit("error", L)) : R(L);
            }), this.stream.on("close", function() {
              var L;
              q("(%s)stream :: on close", O.options.clientId), (L = O.outgoing) && (q("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"), Object.keys(L).forEach(function($) {
                L[$].volatile && typeof L[$].cb == "function" && (L[$].cb(new Error("Connection closed")), delete L[$]);
              })), q("stream: emit close to MqttClient"), O.emit("close");
            }), q("_setupStream: sending packet `connect`");
            const G = Object.create(this.options);
            if (G.cmd = "connect", this.topicAliasRecv && (G.properties || (G.properties = {}), this.topicAliasRecv && (G.properties.topicAliasMaximum = this.topicAliasRecv.max)), N(this, G), ee.on("error", this.emit.bind(this, "error")), this.options.properties) {
              if (!this.options.properties.authenticationMethod && this.options.properties.authenticationData)
                return O.end(() => this.emit("error", new Error("Packet has no Authentication Method"))), this;
              this.options.properties.authenticationMethod && this.options.authPacket && typeof this.options.authPacket == "object" && N(this, T({ cmd: "auth", reasonCode: 0 }, this.options.authPacket));
            }
            this.stream.setMaxListeners(1e3), clearTimeout(this.connackTimer), this.connackTimer = setTimeout(function() {
              q("!!connectTimeout hit!! Calling _cleanUp with force `true`"), O._cleanUp(!0);
            }, this.options.connectTimeout);
          }, y.prototype._handlePacket = function(O, Y) {
            const ee = this.options;
            if (ee.protocolVersion === 5 && ee.properties && ee.properties.maximumPacketSize && ee.properties.maximumPacketSize < O.length)
              return this.emit("error", new Error("exceeding packets size " + O.cmd)), this.end({ reasonCode: 149, properties: { reasonString: "Maximum packet size was exceeded" } }), this;
            switch (q("_handlePacket :: emitting packetreceive"), this.emit("packetreceive", O), O.cmd) {
              case "publish":
                this._handlePublish(O, Y);
                break;
              case "puback":
              case "pubrec":
              case "pubcomp":
              case "suback":
              case "unsuback":
                this._handleAck(O), Y();
                break;
              case "pubrel":
                this._handlePubrel(O, Y);
                break;
              case "connack":
                this._handleConnack(O), Y();
                break;
              case "auth":
                this._handleAuth(O), Y();
                break;
              case "pingresp":
                this._handlePingresp(O), Y();
                break;
              case "disconnect":
                this._handleDisconnect(O), Y();
            }
          }, y.prototype._checkDisconnecting = function(O) {
            return this.disconnecting && (O && O !== R ? O(new Error("client disconnecting")) : this.emit("error", new Error("client disconnecting"))), this.disconnecting;
          }, y.prototype.publish = function(O, Y, ee, Z) {
            q("publish :: message `%s` to topic `%s`", Y, O);
            const te = this.options;
            if (typeof ee == "function" && (Z = ee, ee = null), ee = T({ qos: 0, retain: !1, dup: !1 }, ee), this._checkDisconnecting(Z))
              return this;
            const fe = this, _ = function() {
              let G = 0;
              if ((ee.qos === 1 || ee.qos === 2) && (G = fe._nextId()) === null)
                return q("No messageId left"), !1;
              const L = { cmd: "publish", topic: O, payload: Y, qos: ee.qos, retain: ee.retain, messageId: G, dup: ee.dup };
              switch (te.protocolVersion === 5 && (L.properties = ee.properties), q("publish :: qos", ee.qos), ee.qos) {
                case 1:
                case 2:
                  fe.outgoing[L.messageId] = { volatile: !1, cb: Z || R }, q("MqttClient:publish: packet cmd: %s", L.cmd), fe._sendPacket(L, void 0, ee.cbStorePut);
                  break;
                default:
                  q("MqttClient:publish: packet cmd: %s", L.cmd), fe._sendPacket(L, Z, ee.cbStorePut);
              }
              return !0;
            };
            return (this._storeProcessing || this._storeProcessingQueue.length > 0 || !_()) && this._storeProcessingQueue.push({ invoke: _, cbStorePut: ee.cbStorePut, callback: Z }), this;
          }, y.prototype.subscribe = function() {
            const O = this, Y = new Array(arguments.length);
            for (let Pe = 0; Pe < arguments.length; Pe++)
              Y[Pe] = arguments[Pe];
            const ee = [];
            let Z = Y.shift();
            const te = Z.resubscribe;
            let fe = Y.pop() || R, _ = Y.pop();
            const G = this.options.protocolVersion;
            delete Z.resubscribe, typeof Z == "string" && (Z = [Z]), typeof fe != "function" && (_ = fe, fe = R);
            const L = H.validateTopics(Z);
            if (L !== null)
              return j(fe, new Error("Invalid topic " + L)), this;
            if (this._checkDisconnecting(fe))
              return q("subscribe: discconecting true"), this;
            const $ = { qos: 0 };
            if (G === 5 && ($.nl = !1, $.rap = !1, $.rh = 0), _ = T($, _), Array.isArray(Z) ? Z.forEach(function(Pe) {
              if (q("subscribe: array topic %s", Pe), !Object.prototype.hasOwnProperty.call(O._resubscribeTopics, Pe) || O._resubscribeTopics[Pe].qos < _.qos || te) {
                const ge = { topic: Pe, qos: _.qos };
                G === 5 && (ge.nl = _.nl, ge.rap = _.rap, ge.rh = _.rh, ge.properties = _.properties), q("subscribe: pushing topic `%s` and qos `%s` to subs list", ge.topic, ge.qos), ee.push(ge);
              }
            }) : Object.keys(Z).forEach(function(Pe) {
              if (q("subscribe: object topic %s", Pe), !Object.prototype.hasOwnProperty.call(O._resubscribeTopics, Pe) || O._resubscribeTopics[Pe].qos < Z[Pe].qos || te) {
                const ge = { topic: Pe, qos: Z[Pe].qos };
                G === 5 && (ge.nl = Z[Pe].nl, ge.rap = Z[Pe].rap, ge.rh = Z[Pe].rh, ge.properties = _.properties), q("subscribe: pushing `%s` to subs list", ge), ee.push(ge);
              }
            }), !ee.length)
              return fe(null, []), this;
            const ae = function() {
              const Pe = O._nextId();
              if (Pe === null)
                return q("No messageId left"), !1;
              const ge = { cmd: "subscribe", subscriptions: ee, qos: 1, retain: !1, dup: !1, messageId: Pe };
              if (_.properties && (ge.properties = _.properties), O.options.resubscribe) {
                q("subscribe :: resubscribe true");
                const me = [];
                ee.forEach(function(Xe) {
                  if (O.options.reconnectPeriod > 0) {
                    const De = { qos: Xe.qos };
                    G === 5 && (De.nl = Xe.nl || !1, De.rap = Xe.rap || !1, De.rh = Xe.rh || 0, De.properties = Xe.properties), O._resubscribeTopics[Xe.topic] = De, me.push(Xe.topic);
                  }
                }), O.messageIdToTopic[ge.messageId] = me;
              }
              return O.outgoing[ge.messageId] = { volatile: !0, cb: function(me, Xe) {
                if (!me) {
                  const De = Xe.granted;
                  for (let ne = 0; ne < De.length; ne += 1)
                    ee[ne].qos = De[ne];
                }
                fe(me, ee);
              } }, q("subscribe :: call _sendPacket"), O._sendPacket(ge), !0;
            };
            return (this._storeProcessing || this._storeProcessingQueue.length > 0 || !ae()) && this._storeProcessingQueue.push({ invoke: ae, callback: fe }), this;
          }, y.prototype.unsubscribe = function() {
            const O = this, Y = new Array(arguments.length);
            for (let G = 0; G < arguments.length; G++)
              Y[G] = arguments[G];
            let ee = Y.shift(), Z = Y.pop() || R, te = Y.pop();
            typeof ee == "string" && (ee = [ee]), typeof Z != "function" && (te = Z, Z = R);
            const fe = H.validateTopics(ee);
            if (fe !== null)
              return j(Z, new Error("Invalid topic " + fe)), this;
            if (O._checkDisconnecting(Z))
              return this;
            const _ = function() {
              const G = O._nextId();
              if (G === null)
                return q("No messageId left"), !1;
              const L = { cmd: "unsubscribe", qos: 1, messageId: G };
              return typeof ee == "string" ? L.unsubscriptions = [ee] : Array.isArray(ee) && (L.unsubscriptions = ee), O.options.resubscribe && L.unsubscriptions.forEach(function($) {
                delete O._resubscribeTopics[$];
              }), typeof te == "object" && te.properties && (L.properties = te.properties), O.outgoing[L.messageId] = { volatile: !0, cb: Z }, q("unsubscribe: call _sendPacket"), O._sendPacket(L), !0;
            };
            return (this._storeProcessing || this._storeProcessingQueue.length > 0 || !_()) && this._storeProcessingQueue.push({ invoke: _, callback: Z }), this;
          }, y.prototype.end = function(O, Y, ee) {
            const Z = this;
            function te() {
              q("end :: (%s) :: finish :: calling _cleanUp with force %s", Z.options.clientId, O), Z._cleanUp(O, () => {
                q("end :: finish :: calling process.nextTick on closeStores"), b((function() {
                  q("end :: closeStores: closing incoming and outgoing stores"), Z.disconnected = !0, Z.incomingStore.close(function(fe) {
                    Z.outgoingStore.close(function(_) {
                      if (q("end :: closeStores: emitting end"), Z.emit("end"), ee) {
                        const G = fe || _;
                        q("end :: closeStores: invoking callback with args"), ee(G);
                      }
                    });
                  }), Z._deferredReconnect && Z._deferredReconnect();
                }).bind(Z));
              }, Y);
            }
            return q("end :: (%s)", this.options.clientId), O != null && typeof O == "boolean" || (ee = Y || R, Y = O, O = !1, typeof Y != "object" && (ee = Y, Y = null, typeof ee != "function" && (ee = R))), typeof Y != "object" && (ee = Y, Y = null), q("end :: cb? %s", !!ee), ee = ee || R, this.disconnecting ? (ee(), this) : (this._clearReconnect(), this.disconnecting = !0, !O && Object.keys(this.outgoing).length > 0 ? (q("end :: (%s) :: calling finish in 10ms once outgoing is empty", Z.options.clientId), this.once("outgoingEmpty", setTimeout.bind(null, te, 10))) : (q("end :: (%s) :: immediately calling finish", Z.options.clientId), te()), this);
          }, y.prototype.removeOutgoingMessage = function(O) {
            const Y = this.outgoing[O] ? this.outgoing[O].cb : null;
            return delete this.outgoing[O], this.outgoingStore.del({ messageId: O }, function() {
              Y(new Error("Message removed"));
            }), this;
          }, y.prototype.reconnect = function(O) {
            q("client reconnect");
            const Y = this, ee = function() {
              O ? (Y.options.incomingStore = O.incomingStore, Y.options.outgoingStore = O.outgoingStore) : (Y.options.incomingStore = null, Y.options.outgoingStore = null), Y.incomingStore = Y.options.incomingStore || new f(), Y.outgoingStore = Y.options.outgoingStore || new f(), Y.disconnecting = !1, Y.disconnected = !1, Y._deferredReconnect = null, Y._reconnect();
            };
            return this.disconnecting && !this.disconnected ? this._deferredReconnect = ee : ee(), this;
          }, y.prototype._reconnect = function() {
            q("_reconnect: emitting reconnect to client"), this.emit("reconnect"), this.connected ? (this.end(() => {
              this._setupStream();
            }), q("client already connected. disconnecting first.")) : (q("_reconnect: calling _setupStream"), this._setupStream());
          }, y.prototype._setupReconnect = function() {
            const O = this;
            !O.disconnecting && !O.reconnectTimer && O.options.reconnectPeriod > 0 ? (this.reconnecting || (q("_setupReconnect :: emit `offline` state"), this.emit("offline"), q("_setupReconnect :: set `reconnecting` to `true`"), this.reconnecting = !0), q("_setupReconnect :: setting reconnectTimer for %d ms", O.options.reconnectPeriod), O.reconnectTimer = setInterval(function() {
              q("reconnectTimer :: reconnect triggered!"), O._reconnect();
            }, O.options.reconnectPeriod)) : q("_setupReconnect :: doing nothing...");
          }, y.prototype._clearReconnect = function() {
            q("_clearReconnect : clearing reconnect timer"), this.reconnectTimer && (clearInterval(this.reconnectTimer), this.reconnectTimer = null);
          }, y.prototype._cleanUp = function(O, Y) {
            const ee = arguments[2];
            if (Y && (q("_cleanUp :: done callback provided for on stream close"), this.stream.on("close", Y)), q("_cleanUp :: forced? %s", O), O)
              this.options.reconnectPeriod === 0 && this.options.clean && (Z = this.outgoing) && (q("flush: queue exists? %b", !!Z), Object.keys(Z).forEach(function(te) {
                typeof Z[te].cb == "function" && (Z[te].cb(new Error("Connection closed")), delete Z[te]);
              })), q("_cleanUp :: (%s) :: destroying stream", this.options.clientId), this.stream.destroy();
            else {
              const te = T({ cmd: "disconnect" }, ee);
              q("_cleanUp :: (%s) :: call _sendPacket with disconnect packet", this.options.clientId), this._sendPacket(te, j.bind(null, this.stream.end.bind(this.stream)));
            }
            var Z;
            this.disconnecting || (q("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."), this._clearReconnect(), this._setupReconnect()), this.pingTimer !== null && (q("_cleanUp :: clearing pingTimer"), this.pingTimer.clear(), this.pingTimer = null), Y && !this.connected && (q("_cleanUp :: (%s) :: removing stream `done` callback `close` listener", this.options.clientId), this.stream.removeListener("close", Y), Y());
          }, y.prototype._sendPacket = function(O, Y, ee) {
            q("_sendPacket :: (%s) ::  start", this.options.clientId), ee = ee || R, Y = Y || R;
            const Z = function(te, fe) {
              if (te.options.protocolVersion === 5 && fe.cmd === "publish") {
                let _;
                fe.properties && (_ = fe.properties.topicAlias);
                const G = fe.topic.toString();
                if (te.topicAliasSend)
                  if (_) {
                    if (G.length !== 0 && (q("applyTopicAlias :: register topic: %s - alias: %d", G, _), !te.topicAliasSend.put(G, _)))
                      return q("applyTopicAlias :: error out of range. topic: %s - alias: %d", G, _), new Error("Sending Topic Alias out of range");
                  } else
                    G.length !== 0 && (te.options.autoAssignTopicAlias ? (_ = te.topicAliasSend.getAliasByTopic(G)) ? (fe.topic = "", fe.properties = { ...fe.properties, topicAlias: _ }, q("applyTopicAlias :: auto assign(use) topic: %s - alias: %d", G, _)) : (_ = te.topicAliasSend.getLruAlias(), te.topicAliasSend.put(G, _), fe.properties = { ...fe.properties, topicAlias: _ }, q("applyTopicAlias :: auto assign topic: %s - alias: %d", G, _)) : te.options.autoUseTopicAlias && (_ = te.topicAliasSend.getAliasByTopic(G)) && (fe.topic = "", fe.properties = { ...fe.properties, topicAlias: _ }, q("applyTopicAlias :: auto use topic: %s - alias: %d", G, _)));
                else if (_)
                  return q("applyTopicAlias :: error out of range. topic: %s - alias: %d", G, _), new Error("Sending Topic Alias out of range");
              }
            }(this, O);
            if (Z)
              Y(Z);
            else {
              if (!this.connected)
                return O.cmd === "auth" ? (this._shiftPingInterval(), void N(this, O, Y)) : (q("_sendPacket :: client not connected. Storing packet offline."), void this._storePacket(O, Y, ee));
              switch (this._shiftPingInterval(), O.cmd) {
                case "publish":
                  break;
                case "pubrel":
                  return void k(this, O, Y, ee);
                default:
                  return void N(this, O, Y);
              }
              switch (O.qos) {
                case 2:
                case 1:
                  k(this, O, Y, ee);
                  break;
                case 0:
                default:
                  N(this, O, Y);
              }
              q("_sendPacket :: (%s) ::  end", this.options.clientId);
            }
          }, y.prototype._storePacket = function(O, Y, ee) {
            q("_storePacket :: packet: %o", O), q("_storePacket :: cb? %s", !!Y), ee = ee || R;
            let Z = O;
            if (Z.cmd === "publish") {
              const te = I(this, Z = c(O));
              if (te)
                return Y && Y(te);
            }
            (Z.qos || 0) === 0 && this.queueQoSZero || Z.cmd !== "publish" ? this.queue.push({ packet: Z, cb: Y }) : Z.qos > 0 ? (Y = this.outgoing[Z.messageId] ? this.outgoing[Z.messageId].cb : null, this.outgoingStore.put(Z, function(te) {
              if (te)
                return Y && Y(te);
              ee();
            })) : Y && Y(new Error("No connection to broker"));
          }, y.prototype._setupPingTimer = function() {
            q("_setupPingTimer :: keepalive %d (seconds)", this.options.keepalive);
            const O = this;
            !this.pingTimer && this.options.keepalive && (this.pingResp = !0, this.pingTimer = p(function() {
              O._checkPing();
            }, 1e3 * this.options.keepalive));
          }, y.prototype._shiftPingInterval = function() {
            this.pingTimer && this.options.keepalive && this.options.reschedulePings && this.pingTimer.reschedule(1e3 * this.options.keepalive);
          }, y.prototype._checkPing = function() {
            q("_checkPing :: checking ping..."), this.pingResp ? (q("_checkPing :: ping response received. Clearing flag and sending `pingreq`"), this.pingResp = !1, this._sendPacket({ cmd: "pingreq" })) : (q("_checkPing :: calling _cleanUp with force true"), this._cleanUp(!0));
          }, y.prototype._handlePingresp = function() {
            this.pingResp = !0;
          }, y.prototype._handleConnack = function(O) {
            q("_handleConnack");
            const Y = this.options, ee = Y.protocolVersion === 5 ? O.reasonCode : O.returnCode;
            if (clearTimeout(this.connackTimer), delete this.topicAliasSend, O.properties) {
              if (O.properties.topicAliasMaximum) {
                if (O.properties.topicAliasMaximum > 65535)
                  return void this.emit("error", new Error("topicAliasMaximum from broker is out of range"));
                O.properties.topicAliasMaximum > 0 && (this.topicAliasSend = new d(O.properties.topicAliasMaximum));
              }
              O.properties.serverKeepAlive && Y.keepalive && (Y.keepalive = O.properties.serverKeepAlive, this._shiftPingInterval()), O.properties.maximumPacketSize && (Y.properties || (Y.properties = {}), Y.properties.maximumPacketSize = O.properties.maximumPacketSize);
            }
            if (ee === 0)
              this.reconnecting = !1, this._onConnect(O);
            else if (ee > 0) {
              const Z = new Error("Connection refused: " + m[ee]);
              Z.code = ee, this.emit("error", Z);
            }
          }, y.prototype._handleAuth = function(O) {
            const Y = this.options.protocolVersion, ee = Y === 5 ? O.reasonCode : O.returnCode;
            if (Y !== 5) {
              const te = new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:" + Y);
              return te.code = ee, void this.emit("error", te);
            }
            const Z = this;
            this.handleAuth(O, function(te, fe) {
              if (te)
                Z.emit("error", te);
              else if (ee === 24)
                Z.reconnecting = !1, Z._sendPacket(fe);
              else {
                const _ = new Error("Connection refused: " + m[ee]);
                te.code = ee, Z.emit("error", _);
              }
            });
          }, y.prototype.handleAuth = function(O, Y) {
            Y();
          }, y.prototype._handlePublish = function(O, Y) {
            q("_handlePublish: packet %o", O), Y = Y !== void 0 ? Y : R;
            let ee = O.topic.toString();
            const Z = O.payload, te = O.qos, fe = O.messageId, _ = this, G = this.options, L = [0, 16, 128, 131, 135, 144, 145, 151, 153];
            if (this.options.protocolVersion === 5) {
              let $;
              if (O.properties && ($ = O.properties.topicAlias), $ !== void 0)
                if (ee.length === 0) {
                  if (!($ > 0 && $ <= 65535))
                    return q("_handlePublish :: topic alias out of range. alias: %d", $), void this.emit("error", new Error("Received Topic Alias is out of range"));
                  {
                    const ae = this.topicAliasRecv.getTopicByAlias($);
                    if (!ae)
                      return q("_handlePublish :: unregistered topic alias. alias: %d", $), void this.emit("error", new Error("Received unregistered Topic Alias"));
                    q("_handlePublish :: topic complemented by alias. topic: %s - alias: %d", ee = ae, $);
                  }
                } else {
                  if (!this.topicAliasRecv.put(ee, $))
                    return q("_handlePublish :: topic alias out of range. alias: %d", $), void this.emit("error", new Error("Received Topic Alias is out of range"));
                  q("_handlePublish :: registered topic: %s - alias: %d", ee, $);
                }
            }
            switch (q("_handlePublish: qos %d", te), te) {
              case 2:
                G.customHandleAcks(ee, Z, O, function($, ae) {
                  return $ instanceof Error || (ae = $, $ = null), $ ? _.emit("error", $) : L.indexOf(ae) === -1 ? _.emit("error", new Error("Wrong reason code for pubrec")) : void (ae ? _._sendPacket({ cmd: "pubrec", messageId: fe, reasonCode: ae }, Y) : _.incomingStore.put(O, function() {
                    _._sendPacket({ cmd: "pubrec", messageId: fe }, Y);
                  }));
                });
                break;
              case 1:
                G.customHandleAcks(ee, Z, O, function($, ae) {
                  return $ instanceof Error || (ae = $, $ = null), $ ? _.emit("error", $) : L.indexOf(ae) === -1 ? _.emit("error", new Error("Wrong reason code for puback")) : (ae || _.emit("message", ee, Z, O), void _.handleMessage(O, function(Pe) {
                    if (Pe)
                      return Y && Y(Pe);
                    _._sendPacket({ cmd: "puback", messageId: fe, reasonCode: ae }, Y);
                  }));
                });
                break;
              case 0:
                this.emit("message", ee, Z, O), this.handleMessage(O, Y);
                break;
              default:
                q("_handlePublish: unknown QoS. Doing nothing.");
            }
          }, y.prototype.handleMessage = function(O, Y) {
            Y();
          }, y.prototype._handleAck = function(O) {
            const Y = O.messageId, ee = O.cmd;
            let Z = null;
            const te = this.outgoing[Y] ? this.outgoing[Y].cb : null, fe = this;
            let _;
            if (te) {
              switch (q("_handleAck :: packet type", ee), ee) {
                case "pubcomp":
                case "puback": {
                  const G = O.reasonCode;
                  G && G > 0 && G !== 16 && ((_ = new Error("Publish error: " + m[G])).code = G, te(_, O)), delete this.outgoing[Y], this.outgoingStore.del(O, te), this.messageIdProvider.deallocate(Y), this._invokeStoreProcessingQueue();
                  break;
                }
                case "pubrec": {
                  Z = { cmd: "pubrel", qos: 2, messageId: Y };
                  const G = O.reasonCode;
                  G && G > 0 && G !== 16 ? ((_ = new Error("Publish error: " + m[G])).code = G, te(_, O)) : this._sendPacket(Z);
                  break;
                }
                case "suback":
                  delete this.outgoing[Y], this.messageIdProvider.deallocate(Y);
                  for (let G = 0; G < O.granted.length; G++)
                    if (128 & O.granted[G]) {
                      const L = this.messageIdToTopic[Y];
                      L && L.forEach(function($) {
                        delete fe._resubscribeTopics[$];
                      });
                    }
                  this._invokeStoreProcessingQueue(), te(null, O);
                  break;
                case "unsuback":
                  delete this.outgoing[Y], this.messageIdProvider.deallocate(Y), this._invokeStoreProcessingQueue(), te(null);
                  break;
                default:
                  fe.emit("error", new Error("unrecognized packet type"));
              }
              this.disconnecting && Object.keys(this.outgoing).length === 0 && this.emit("outgoingEmpty");
            } else
              q("_handleAck :: Server sent an ack in error. Ignoring.");
          }, y.prototype._handlePubrel = function(O, Y) {
            q("handling pubrel packet"), Y = Y !== void 0 ? Y : R;
            const ee = this, Z = { cmd: "pubcomp", messageId: O.messageId };
            ee.incomingStore.get(O, function(te, fe) {
              te ? ee._sendPacket(Z, Y) : (ee.emit("message", fe.topic, fe.payload, fe), ee.handleMessage(fe, function(_) {
                if (_)
                  return Y(_);
                ee.incomingStore.del(fe, R), ee._sendPacket(Z, Y);
              }));
            });
          }, y.prototype._handleDisconnect = function(O) {
            this.emit("disconnect", O);
          }, y.prototype._nextId = function() {
            return this.messageIdProvider.allocate();
          }, y.prototype.getLastMessageId = function() {
            return this.messageIdProvider.getLastAllocated();
          }, y.prototype._resubscribe = function() {
            q("_resubscribe");
            const O = Object.keys(this._resubscribeTopics);
            if (!this._firstConnection && (this.options.clean || this.options.protocolVersion === 5 && !this.connackPacket.sessionPresent) && O.length > 0)
              if (this.options.resubscribe)
                if (this.options.protocolVersion === 5) {
                  q("_resubscribe: protocolVersion 5");
                  for (let Y = 0; Y < O.length; Y++) {
                    const ee = {};
                    ee[O[Y]] = this._resubscribeTopics[O[Y]], ee.resubscribe = !0, this.subscribe(ee, { properties: ee[O[Y]].properties });
                  }
                } else
                  this._resubscribeTopics.resubscribe = !0, this.subscribe(this._resubscribeTopics);
              else
                this._resubscribeTopics = {};
            this._firstConnection = !1;
          }, y.prototype._onConnect = function(O) {
            if (this.disconnected)
              return void this.emit("connect", O);
            const Y = this;
            this.connackPacket = O, this.messageIdProvider.clear(), this._setupPingTimer(), this.connected = !0, function ee() {
              let Z = Y.outgoingStore.createStream();
              function te() {
                Y._storeProcessing = !1, Y._packetIdsDuringStoreProcessing = {};
              }
              function fe() {
                Z.destroy(), Z = null, Y._flushStoreProcessingQueue(), te();
              }
              Y.once("close", fe), Z.on("error", function(_) {
                te(), Y._flushStoreProcessingQueue(), Y.removeListener("close", fe), Y.emit("error", _);
              }), Z.on("end", function() {
                let _ = !0;
                for (const G in Y._packetIdsDuringStoreProcessing)
                  if (!Y._packetIdsDuringStoreProcessing[G]) {
                    _ = !1;
                    break;
                  }
                _ ? (te(), Y.removeListener("close", fe), Y._invokeAllStoreProcessingQueue(), Y.emit("connect", O)) : ee();
              }), function _() {
                if (!Z)
                  return;
                Y._storeProcessing = !0;
                const G = Z.read(1);
                let L;
                G ? Y._packetIdsDuringStoreProcessing[G.messageId] ? _() : Y.disconnecting || Y.reconnectTimer ? Z.destroy && Z.destroy() : (L = Y.outgoing[G.messageId] ? Y.outgoing[G.messageId].cb : null, Y.outgoing[G.messageId] = { volatile: !1, cb: function($, ae) {
                  L && L($, ae), _();
                } }, Y._packetIdsDuringStoreProcessing[G.messageId] = !0, Y.messageIdProvider.register(G.messageId) ? Y._sendPacket(G) : q("messageId: %d has already used.", G.messageId)) : Z.once("readable", _);
              }();
            }();
          }, y.prototype._invokeStoreProcessingQueue = function() {
            if (this._storeProcessingQueue.length > 0) {
              const O = this._storeProcessingQueue[0];
              if (O && O.invoke())
                return this._storeProcessingQueue.shift(), !0;
            }
            return !1;
          }, y.prototype._invokeAllStoreProcessingQueue = function() {
            for (; this._invokeStoreProcessingQueue(); )
              ;
          }, y.prototype._flushStoreProcessingQueue = function() {
            for (const O of this._storeProcessingQueue)
              O.cbStorePut && O.cbStorePut(new Error("Connection closed")), O.callback && O.callback(new Error("Connection closed"));
            this._storeProcessingQueue.splice(0);
          }, r.exports = y;
        }).call(this);
      }).call(this, t("_process"), typeof zi < "u" ? zi : typeof self < "u" ? self : typeof window < "u" ? window : {});
    }, { "./default-message-id-provider": 7, "./store": 8, "./topic-alias-recv": 9, "./topic-alias-send": 10, "./validations": 11, _process: 50, debug: 18, events: 22, inherits: 24, "mqtt-packet": 40, "readable-stream": 69, reinterval: 70, "rfdc/default": 71, xtend: 81 }], 2: [function(t, r, n) {
      const { Buffer: i } = t("buffer"), s = t("readable-stream").Transform, a = t("duplexify");
      let f, o, d, v = !1;
      r.exports = function(u, l) {
        if (l.hostname = l.hostname || l.host, !l.hostname)
          throw new Error("Could not determine host. Specify host manually.");
        const P = l.protocolId === "MQIsdp" && l.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
        (function(c) {
          c.hostname || (c.hostname = "localhost"), c.path || (c.path = "/"), c.wsOptions || (c.wsOptions = {});
        })(l);
        const p = function(c, H) {
          const T = c.protocol === "alis" ? "wss" : "ws";
          let q = T + "://" + c.hostname + c.path;
          return c.port && c.port !== 80 && c.port !== 443 && (q = T + "://" + c.hostname + ":" + c.port + c.path), typeof c.transformWsUrl == "function" && (q = c.transformWsUrl(q, c, H)), q;
        }(l, u);
        return (f = l.my).connectSocket({ url: p, protocols: P }), o = function() {
          const c = new s();
          return c._write = function(H, T, q) {
            f.sendSocketMessage({ data: H.buffer, success: function() {
              q();
            }, fail: function() {
              q(new Error());
            } });
          }, c._flush = function(H) {
            f.closeSocket({ success: function() {
              H();
            } });
          }, c;
        }(), d = a.obj(), v || (v = !0, f.onSocketOpen(function() {
          d.setReadable(o), d.setWritable(o), d.emit("connect");
        }), f.onSocketMessage(function(c) {
          if (typeof c.data == "string") {
            const H = i.from(c.data, "base64");
            o.push(H);
          } else {
            const H = new FileReader();
            H.addEventListener("load", function() {
              let T = H.result;
              T = T instanceof ArrayBuffer ? i.from(T) : i.from(T, "utf8"), o.push(T);
            }), H.readAsArrayBuffer(c.data);
          }
        }), f.onSocketClose(function() {
          d.end(), d.destroy();
        }), f.onSocketError(function(c) {
          d.destroy(c);
        })), d;
      };
    }, { buffer: 17, duplexify: 20, "readable-stream": 69 }], 3: [function(t, r, n) {
      const i = t("net"), s = t("debug")("mqttjs:tcp");
      r.exports = function(a, f) {
        f.port = f.port || 1883, f.hostname = f.hostname || f.host || "localhost";
        const o = f.port, d = f.hostname;
        return s("port %d and host %s", o, d), i.createConnection(o, d);
      };
    }, { debug: 18, net: 16 }], 4: [function(t, r, n) {
      const i = t("tls"), s = t("net"), a = t("debug")("mqttjs:tls");
      r.exports = function(f, o) {
        o.port = o.port || 8883, o.host = o.hostname || o.host || "localhost", s.isIP(o.host) === 0 && (o.servername = o.host), o.rejectUnauthorized = o.rejectUnauthorized !== !1, delete o.path, a("port %d host %s rejectUnauthorized %b", o.port, o.host, o.rejectUnauthorized);
        const d = i.connect(o);
        function v(u) {
          o.rejectUnauthorized && f.emit("error", u), d.end();
        }
        return d.on("secureConnect", function() {
          o.rejectUnauthorized && !d.authorized ? d.emit("error", new Error("TLS not authorized")) : d.removeListener("error", v);
        }), d.on("error", v), d;
      };
    }, { debug: 18, net: 16, tls: 16 }], 5: [function(t, r, n) {
      (function(i) {
        (function() {
          const { Buffer: s } = t("buffer"), a = t("ws"), f = t("debug")("mqttjs:ws"), o = t("duplexify"), d = t("readable-stream").Transform, v = ["rejectUnauthorized", "ca", "cert", "key", "pfx", "passphrase"], u = i !== void 0 && i.title === "browser" || typeof __webpack_require__ == "function";
          function l(p, c) {
            let H = p.protocol + "://" + p.hostname + ":" + p.port + p.path;
            return typeof p.transformWsUrl == "function" && (H = p.transformWsUrl(H, p, c)), H;
          }
          function P(p) {
            const c = p;
            return p.hostname || (c.hostname = "localhost"), p.port || (p.protocol === "wss" ? c.port = 443 : c.port = 80), p.path || (c.path = "/"), p.wsOptions || (c.wsOptions = {}), u || p.protocol !== "wss" || v.forEach(function(H) {
              Object.prototype.hasOwnProperty.call(p, H) && !Object.prototype.hasOwnProperty.call(p.wsOptions, H) && (c.wsOptions[H] = p[H]);
            }), c;
          }
          r.exports = u ? function(p, c) {
            let H;
            f("browserStreamBuilder");
            const T = function(O) {
              const Y = P(O);
              if (Y.hostname || (Y.hostname = Y.host), !Y.hostname) {
                if (typeof document > "u")
                  throw new Error("Could not determine host. Specify host manually.");
                const ee = new URL(document.URL);
                Y.hostname = ee.hostname, Y.port || (Y.port = ee.port);
              }
              return Y.objectMode === void 0 && (Y.objectMode = !(Y.binary === !0 || Y.binary === void 0)), Y;
            }(c).browserBufferSize || 524288, q = c.browserBufferTimeout || 1e3, b = !c.objectMode, j = function(O, Y) {
              const ee = Y.protocolId === "MQIsdp" && Y.protocolVersion === 3 ? "mqttv3.1" : "mqtt", Z = l(Y, O), te = new WebSocket(Z, [ee]);
              return te.binaryType = "arraybuffer", te;
            }(p, c), w = function(O, Y, ee) {
              const Z = new d({ objectModeMode: O.objectMode });
              return Z._write = Y, Z._flush = ee, Z;
            }(c, function O(Y, ee, Z) {
              j.bufferedAmount > T && setTimeout(O, q, Y, ee, Z), b && typeof Y == "string" && (Y = s.from(Y, "utf8"));
              try {
                j.send(Y);
              } catch (te) {
                return Z(te);
              }
              Z();
            }, function(O) {
              j.close(), O();
            });
            c.objectMode || (w._writev = y), w.on("close", () => {
              j.close();
            });
            const m = j.addEventListener !== void 0;
            function I() {
              H.setReadable(w), H.setWritable(w), H.emit("connect");
            }
            function N() {
              H.end(), H.destroy();
            }
            function k(O) {
              H.destroy(O);
            }
            function R(O) {
              let Y = O.data;
              Y = Y instanceof ArrayBuffer ? s.from(Y) : s.from(Y, "utf8"), w.push(Y);
            }
            function y(O, Y) {
              const ee = new Array(O.length);
              for (let Z = 0; Z < O.length; Z++)
                typeof O[Z].chunk == "string" ? ee[Z] = s.from(O[Z], "utf8") : ee[Z] = O[Z].chunk;
              this._write(s.concat(ee), "binary", Y);
            }
            return j.readyState === j.OPEN ? H = w : (H = H = o(void 0, void 0, c), c.objectMode || (H._writev = y), m ? j.addEventListener("open", I) : j.onopen = I), H.socket = j, m ? (j.addEventListener("close", N), j.addEventListener("error", k), j.addEventListener("message", R)) : (j.onclose = N, j.onerror = k, j.onmessage = R), H;
          } : function(p, c) {
            f("streamBuilder");
            const H = P(c), T = l(H, p), q = function(j, w, m) {
              f("createWebSocket"), f("protocol: " + m.protocolId + " " + m.protocolVersion);
              const I = m.protocolId === "MQIsdp" && m.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
              return f("creating new Websocket for url: " + w + " and protocol: " + I), new a(w, [I], m.wsOptions);
            }(0, T, H), b = a.createWebSocketStream(q, H.wsOptions);
            return b.url = T, q.on("close", () => {
              b.destroy();
            }), b;
          };
        }).call(this);
      }).call(this, t("_process"));
    }, { _process: 50, buffer: 17, debug: 18, duplexify: 20, "readable-stream": 69, ws: 80 }], 6: [function(t, r, n) {
      const { Buffer: i } = t("buffer"), s = t("readable-stream").Transform, a = t("duplexify");
      let f, o, d;
      r.exports = function(v, u) {
        if (u.hostname = u.hostname || u.host, !u.hostname)
          throw new Error("Could not determine host. Specify host manually.");
        const l = u.protocolId === "MQIsdp" && u.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
        (function(c) {
          c.hostname || (c.hostname = "localhost"), c.path || (c.path = "/"), c.wsOptions || (c.wsOptions = {});
        })(u);
        const P = function(c, H) {
          const T = c.protocol === "wxs" ? "wss" : "ws";
          let q = T + "://" + c.hostname + c.path;
          return c.port && c.port !== 80 && c.port !== 443 && (q = T + "://" + c.hostname + ":" + c.port + c.path), typeof c.transformWsUrl == "function" && (q = c.transformWsUrl(q, c, H)), q;
        }(u, v);
        f = wx.connectSocket({ url: P, protocols: [l] }), o = function() {
          const c = new s();
          return c._write = function(H, T, q) {
            f.send({ data: H.buffer, success: function() {
              q();
            }, fail: function(b) {
              q(new Error(b));
            } });
          }, c._flush = function(H) {
            f.close({ success: function() {
              H();
            } });
          }, c;
        }(), (d = a.obj())._destroy = function(c, H) {
          f.close({ success: function() {
            H && H(c);
          } });
        };
        const p = d.destroy;
        return d.destroy = (function() {
          d.destroy = p;
          const c = this;
          setTimeout(function() {
            f.close({ fail: function() {
              c._destroy(new Error());
            } });
          }, 0);
        }).bind(d), f.onOpen(function() {
          d.setReadable(o), d.setWritable(o), d.emit("connect");
        }), f.onMessage(function(c) {
          let H = c.data;
          H = H instanceof ArrayBuffer ? i.from(H) : i.from(H, "utf8"), o.push(H);
        }), f.onClose(function() {
          d.end(), d.destroy();
        }), f.onError(function(c) {
          d.destroy(new Error(c.errMsg));
        }), d;
      };
    }, { buffer: 17, duplexify: 20, "readable-stream": 69 }], 7: [function(t, r, n) {
      function i() {
        if (!(this instanceof i))
          return new i();
        this.nextId = Math.max(1, Math.floor(65535 * Math.random()));
      }
      i.prototype.allocate = function() {
        const s = this.nextId++;
        return this.nextId === 65536 && (this.nextId = 1), s;
      }, i.prototype.getLastAllocated = function() {
        return this.nextId === 1 ? 65535 : this.nextId - 1;
      }, i.prototype.register = function(s) {
        return !0;
      }, i.prototype.deallocate = function(s) {
      }, i.prototype.clear = function() {
      }, r.exports = i;
    }, {}], 8: [function(t, r, n) {
      const i = t("xtend"), s = t("readable-stream").Readable, a = { objectMode: !0 }, f = { clean: !0 };
      function o(d) {
        if (!(this instanceof o))
          return new o(d);
        this.options = d || {}, this.options = i(f, d), this._inflights = /* @__PURE__ */ new Map();
      }
      o.prototype.put = function(d, v) {
        return this._inflights.set(d.messageId, d), v && v(), this;
      }, o.prototype.createStream = function() {
        const d = new s(a), v = [];
        let u = !1, l = 0;
        return this._inflights.forEach(function(P, p) {
          v.push(P);
        }), d._read = function() {
          !u && l < v.length ? this.push(v[l++]) : this.push(null);
        }, d.destroy = function() {
          if (u)
            return;
          const P = this;
          u = !0, setTimeout(function() {
            P.emit("close");
          }, 0);
        }, d;
      }, o.prototype.del = function(d, v) {
        return (d = this._inflights.get(d.messageId)) ? (this._inflights.delete(d.messageId), v(null, d)) : v && v(new Error("missing packet")), this;
      }, o.prototype.get = function(d, v) {
        return (d = this._inflights.get(d.messageId)) ? v(null, d) : v && v(new Error("missing packet")), this;
      }, o.prototype.close = function(d) {
        this.options.clean && (this._inflights = null), d && d();
      }, r.exports = o;
    }, { "readable-stream": 69, xtend: 81 }], 9: [function(t, r, n) {
      function i(s) {
        if (!(this instanceof i))
          return new i(s);
        this.aliasToTopic = {}, this.max = s;
      }
      i.prototype.put = function(s, a) {
        return !(a === 0 || a > this.max) && (this.aliasToTopic[a] = s, this.length = Object.keys(this.aliasToTopic).length, !0);
      }, i.prototype.getTopicByAlias = function(s) {
        return this.aliasToTopic[s];
      }, i.prototype.clear = function() {
        this.aliasToTopic = {};
      }, r.exports = i;
    }, {}], 10: [function(t, r, n) {
      const i = t("lru-cache"), s = t("number-allocator").NumberAllocator;
      function a(f) {
        if (!(this instanceof a))
          return new a(f);
        f > 0 && (this.aliasToTopic = new i({ max: f }), this.topicToAlias = {}, this.numberAllocator = new s(1, f), this.max = f, this.length = 0);
      }
      a.prototype.put = function(f, o) {
        if (o === 0 || o > this.max)
          return !1;
        const d = this.aliasToTopic.get(o);
        return d && delete this.topicToAlias[d], this.aliasToTopic.set(o, f), this.topicToAlias[f] = o, this.numberAllocator.use(o), this.length = this.aliasToTopic.length, !0;
      }, a.prototype.getTopicByAlias = function(f) {
        return this.aliasToTopic.get(f);
      }, a.prototype.getAliasByTopic = function(f) {
        const o = this.topicToAlias[f];
        return o !== void 0 && this.aliasToTopic.get(o), o;
      }, a.prototype.clear = function() {
        this.aliasToTopic.reset(), this.topicToAlias = {}, this.numberAllocator.clear(), this.length = 0;
      }, a.prototype.getLruAlias = function() {
        return this.numberAllocator.firstVacant() || this.aliasToTopic.keys()[this.aliasToTopic.length - 1];
      }, r.exports = a;
    }, { "lru-cache": 37, "number-allocator": 46 }], 11: [function(t, r, n) {
      function i(s) {
        const a = s.split("/");
        for (let f = 0; f < a.length; f++)
          if (a[f] !== "+") {
            if (a[f] === "#")
              return f === a.length - 1;
            if (a[f].indexOf("+") !== -1 || a[f].indexOf("#") !== -1)
              return !1;
          }
        return !0;
      }
      r.exports = { validateTopics: function(s) {
        if (s.length === 0)
          return "empty_topic_list";
        for (let a = 0; a < s.length; a++)
          if (!i(s[a]))
            return s[a];
        return null;
      } };
    }, {}], 12: [function(t, r, n) {
      (function(i) {
        (function() {
          const s = t("../client"), a = t("../store"), f = t("url"), o = t("xtend"), d = t("debug")("mqttjs"), v = {};
          function u(l, P) {
            if (d("connecting to an MQTT broker..."), typeof l != "object" || P || (P = l, l = null), P = P || {}, l) {
              const c = f.parse(l, !0);
              if (c.port != null && (c.port = Number(c.port)), (P = o(c, P)).protocol === null)
                throw new Error("Missing protocol");
              P.protocol = P.protocol.replace(/:$/, "");
            }
            if (function(c) {
              let H;
              c.auth && ((H = c.auth.match(/^(.+):(.+)$/)) ? (c.username = H[1], c.password = H[2]) : c.username = c.auth);
            }(P), P.query && typeof P.query.clientId == "string" && (P.clientId = P.query.clientId), P.cert && P.key) {
              if (!P.protocol)
                throw new Error("Missing secure protocol key");
              if (["mqtts", "wss", "wxs", "alis"].indexOf(P.protocol) === -1)
                switch (P.protocol) {
                  case "mqtt":
                    P.protocol = "mqtts";
                    break;
                  case "ws":
                    P.protocol = "wss";
                    break;
                  case "wx":
                    P.protocol = "wxs";
                    break;
                  case "ali":
                    P.protocol = "alis";
                    break;
                  default:
                    throw new Error('Unknown protocol for secure connection: "' + P.protocol + '"!');
                }
            }
            if (!v[P.protocol]) {
              const c = ["mqtts", "wss"].indexOf(P.protocol) !== -1;
              P.protocol = ["mqtt", "mqtts", "ws", "wss", "wx", "wxs", "ali", "alis"].filter(function(H, T) {
                return (!c || T % 2 != 0) && typeof v[H] == "function";
              })[0];
            }
            if (P.clean === !1 && !P.clientId)
              throw new Error("Missing clientId for unclean clients");
            P.protocol && (P.defaultProtocol = P.protocol);
            const p = new s(function(c) {
              return P.servers && (c._reconnectCount && c._reconnectCount !== P.servers.length || (c._reconnectCount = 0), P.host = P.servers[c._reconnectCount].host, P.port = P.servers[c._reconnectCount].port, P.protocol = P.servers[c._reconnectCount].protocol ? P.servers[c._reconnectCount].protocol : P.defaultProtocol, P.hostname = P.host, c._reconnectCount++), d("calling streambuilder for", P.protocol), v[P.protocol](c, P);
            }, P);
            return p.on("error", function() {
            }), p;
          }
          i !== void 0 && i.title !== "browser" || typeof __webpack_require__ != "function" ? (v.mqtt = t("./tcp"), v.tcp = t("./tcp"), v.ssl = t("./tls"), v.tls = t("./tls"), v.mqtts = t("./tls")) : (v.wx = t("./wx"), v.wxs = t("./wx"), v.ali = t("./ali"), v.alis = t("./ali")), v.ws = t("./ws"), v.wss = t("./ws"), r.exports = u, r.exports.connect = u, r.exports.MqttClient = s, r.exports.Store = a;
        }).call(this);
      }).call(this, t("_process"));
    }, { "../client": 1, "../store": 8, "./ali": 2, "./tcp": 3, "./tls": 4, "./ws": 5, "./wx": 6, _process: 50, debug: 18, url: 76, xtend: 81 }], 13: [function(t, r, n) {
      n.byteLength = function(l) {
        var P = v(l), p = P[0], c = P[1];
        return 3 * (p + c) / 4 - c;
      }, n.toByteArray = function(l) {
        var P, p, c = v(l), H = c[0], T = c[1], q = new a(function(w, m, I) {
          return 3 * (m + I) / 4 - I;
        }(0, H, T)), b = 0, j = T > 0 ? H - 4 : H;
        for (p = 0; p < j; p += 4)
          P = s[l.charCodeAt(p)] << 18 | s[l.charCodeAt(p + 1)] << 12 | s[l.charCodeAt(p + 2)] << 6 | s[l.charCodeAt(p + 3)], q[b++] = P >> 16 & 255, q[b++] = P >> 8 & 255, q[b++] = 255 & P;
        return T === 2 && (P = s[l.charCodeAt(p)] << 2 | s[l.charCodeAt(p + 1)] >> 4, q[b++] = 255 & P), T === 1 && (P = s[l.charCodeAt(p)] << 10 | s[l.charCodeAt(p + 1)] << 4 | s[l.charCodeAt(p + 2)] >> 2, q[b++] = P >> 8 & 255, q[b++] = 255 & P), q;
      }, n.fromByteArray = function(l) {
        for (var P, p = l.length, c = p % 3, H = [], T = 0, q = p - c; T < q; T += 16383)
          H.push(u(l, T, T + 16383 > q ? q : T + 16383));
        return c === 1 ? (P = l[p - 1], H.push(i[P >> 2] + i[P << 4 & 63] + "==")) : c === 2 && (P = (l[p - 2] << 8) + l[p - 1], H.push(i[P >> 10] + i[P >> 4 & 63] + i[P << 2 & 63] + "=")), H.join("");
      };
      for (var i = [], s = [], a = typeof Uint8Array < "u" ? Uint8Array : Array, f = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", o = 0, d = f.length; o < d; ++o)
        i[o] = f[o], s[f.charCodeAt(o)] = o;
      function v(l) {
        var P = l.length;
        if (P % 4 > 0)
          throw new Error("Invalid string. Length must be a multiple of 4");
        var p = l.indexOf("=");
        return p === -1 && (p = P), [p, p === P ? 0 : 4 - p % 4];
      }
      function u(l, P, p) {
        for (var c, H, T = [], q = P; q < p; q += 3)
          c = (l[q] << 16 & 16711680) + (l[q + 1] << 8 & 65280) + (255 & l[q + 2]), T.push(i[(H = c) >> 18 & 63] + i[H >> 12 & 63] + i[H >> 6 & 63] + i[63 & H]);
        return T.join("");
      }
      s[45] = 62, s[95] = 63;
    }, {}], 14: [function(t, r, n) {
      const { Buffer: i } = t("buffer"), s = Symbol.for("BufferList");
      function a(f) {
        if (!(this instanceof a))
          return new a(f);
        a._init.call(this, f);
      }
      a._init = function(f) {
        Object.defineProperty(this, s, { value: !0 }), this._bufs = [], this.length = 0, f && this.append(f);
      }, a.prototype._new = function(f) {
        return new a(f);
      }, a.prototype._offset = function(f) {
        if (f === 0)
          return [0, 0];
        let o = 0;
        for (let d = 0; d < this._bufs.length; d++) {
          const v = o + this._bufs[d].length;
          if (f < v || d === this._bufs.length - 1)
            return [d, f - o];
          o = v;
        }
      }, a.prototype._reverseOffset = function(f) {
        const o = f[0];
        let d = f[1];
        for (let v = 0; v < o; v++)
          d += this._bufs[v].length;
        return d;
      }, a.prototype.get = function(f) {
        if (f > this.length || f < 0)
          return;
        const o = this._offset(f);
        return this._bufs[o[0]][o[1]];
      }, a.prototype.slice = function(f, o) {
        return typeof f == "number" && f < 0 && (f += this.length), typeof o == "number" && o < 0 && (o += this.length), this.copy(null, 0, f, o);
      }, a.prototype.copy = function(f, o, d, v) {
        if ((typeof d != "number" || d < 0) && (d = 0), (typeof v != "number" || v > this.length) && (v = this.length), d >= this.length || v <= 0)
          return f || i.alloc(0);
        const u = !!f, l = this._offset(d), P = v - d;
        let p = P, c = u && o || 0, H = l[1];
        if (d === 0 && v === this.length) {
          if (!u)
            return this._bufs.length === 1 ? this._bufs[0] : i.concat(this._bufs, this.length);
          for (let T = 0; T < this._bufs.length; T++)
            this._bufs[T].copy(f, c), c += this._bufs[T].length;
          return f;
        }
        if (p <= this._bufs[l[0]].length - H)
          return u ? this._bufs[l[0]].copy(f, o, H, H + p) : this._bufs[l[0]].slice(H, H + p);
        u || (f = i.allocUnsafe(P));
        for (let T = l[0]; T < this._bufs.length; T++) {
          const q = this._bufs[T].length - H;
          if (!(p > q)) {
            this._bufs[T].copy(f, c, H, H + p), c += q;
            break;
          }
          this._bufs[T].copy(f, c, H), c += q, p -= q, H && (H = 0);
        }
        return f.length > c ? f.slice(0, c) : f;
      }, a.prototype.shallowSlice = function(f, o) {
        if (f = f || 0, o = typeof o != "number" ? this.length : o, f < 0 && (f += this.length), o < 0 && (o += this.length), f === o)
          return this._new();
        const d = this._offset(f), v = this._offset(o), u = this._bufs.slice(d[0], v[0] + 1);
        return v[1] === 0 ? u.pop() : u[u.length - 1] = u[u.length - 1].slice(0, v[1]), d[1] !== 0 && (u[0] = u[0].slice(d[1])), this._new(u);
      }, a.prototype.toString = function(f, o, d) {
        return this.slice(o, d).toString(f);
      }, a.prototype.consume = function(f) {
        if (f = Math.trunc(f), Number.isNaN(f) || f <= 0)
          return this;
        for (; this._bufs.length; ) {
          if (!(f >= this._bufs[0].length)) {
            this._bufs[0] = this._bufs[0].slice(f), this.length -= f;
            break;
          }
          f -= this._bufs[0].length, this.length -= this._bufs[0].length, this._bufs.shift();
        }
        return this;
      }, a.prototype.duplicate = function() {
        const f = this._new();
        for (let o = 0; o < this._bufs.length; o++)
          f.append(this._bufs[o]);
        return f;
      }, a.prototype.append = function(f) {
        if (f == null)
          return this;
        if (f.buffer)
          this._appendBuffer(i.from(f.buffer, f.byteOffset, f.byteLength));
        else if (Array.isArray(f))
          for (let o = 0; o < f.length; o++)
            this.append(f[o]);
        else if (this._isBufferList(f))
          for (let o = 0; o < f._bufs.length; o++)
            this.append(f._bufs[o]);
        else
          typeof f == "number" && (f = f.toString()), this._appendBuffer(i.from(f));
        return this;
      }, a.prototype._appendBuffer = function(f) {
        this._bufs.push(f), this.length += f.length;
      }, a.prototype.indexOf = function(f, o, d) {
        if (d === void 0 && typeof o == "string" && (d = o, o = void 0), typeof f == "function" || Array.isArray(f))
          throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');
        if (typeof f == "number" ? f = i.from([f]) : typeof f == "string" ? f = i.from(f, d) : this._isBufferList(f) ? f = f.slice() : Array.isArray(f.buffer) ? f = i.from(f.buffer, f.byteOffset, f.byteLength) : i.isBuffer(f) || (f = i.from(f)), o = Number(o || 0), isNaN(o) && (o = 0), o < 0 && (o = this.length + o), o < 0 && (o = 0), f.length === 0)
          return o > this.length ? this.length : o;
        const v = this._offset(o);
        let u = v[0], l = v[1];
        for (; u < this._bufs.length; u++) {
          const P = this._bufs[u];
          for (; l < P.length; )
            if (P.length - l >= f.length) {
              const p = P.indexOf(f, l);
              if (p !== -1)
                return this._reverseOffset([u, p]);
              l = P.length - f.length + 1;
            } else {
              const p = this._reverseOffset([u, l]);
              if (this._match(p, f))
                return p;
              l++;
            }
          l = 0;
        }
        return -1;
      }, a.prototype._match = function(f, o) {
        if (this.length - f < o.length)
          return !1;
        for (let d = 0; d < o.length; d++)
          if (this.get(f + d) !== o[d])
            return !1;
        return !0;
      }, function() {
        const f = { readDoubleBE: 8, readDoubleLE: 8, readFloatBE: 4, readFloatLE: 4, readInt32BE: 4, readInt32LE: 4, readUInt32BE: 4, readUInt32LE: 4, readInt16BE: 2, readInt16LE: 2, readUInt16BE: 2, readUInt16LE: 2, readInt8: 1, readUInt8: 1, readIntBE: null, readIntLE: null, readUIntBE: null, readUIntLE: null };
        for (const o in f)
          (function(d) {
            a.prototype[d] = f[d] === null ? function(v, u) {
              return this.slice(v, v + u)[d](0, u);
            } : function(v = 0) {
              return this.slice(v, v + f[d])[d](0);
            };
          })(o);
      }(), a.prototype._isBufferList = function(f) {
        return f instanceof a || a.isBufferList(f);
      }, a.isBufferList = function(f) {
        return f != null && f[s];
      }, r.exports = a;
    }, { buffer: 17 }], 15: [function(t, r, n) {
      const i = t("readable-stream").Duplex, s = t("inherits"), a = t("./BufferList");
      function f(o) {
        if (!(this instanceof f))
          return new f(o);
        if (typeof o == "function") {
          this._callback = o;
          const d = (function(v) {
            this._callback && (this._callback(v), this._callback = null);
          }).bind(this);
          this.on("pipe", function(v) {
            v.on("error", d);
          }), this.on("unpipe", function(v) {
            v.removeListener("error", d);
          }), o = null;
        }
        a._init.call(this, o), i.call(this);
      }
      s(f, i), Object.assign(f.prototype, a.prototype), f.prototype._new = function(o) {
        return new f(o);
      }, f.prototype._write = function(o, d, v) {
        this._appendBuffer(o), typeof v == "function" && v();
      }, f.prototype._read = function(o) {
        if (!this.length)
          return this.push(null);
        o = Math.min(o, this.length), this.push(this.slice(0, o)), this.consume(o);
      }, f.prototype.end = function(o) {
        i.prototype.end.call(this, o), this._callback && (this._callback(null, this.slice()), this._callback = null);
      }, f.prototype._destroy = function(o, d) {
        this._bufs.length = 0, this.length = 0, d(o);
      }, f.prototype._isBufferList = function(o) {
        return o instanceof f || o instanceof a || f.isBufferList(o);
      }, f.isBufferList = a.isBufferList, r.exports = f, r.exports.BufferListStream = f, r.exports.BufferList = a;
    }, { "./BufferList": 14, inherits: 24, "readable-stream": 69 }], 16: [function(t, r, n) {
    }, {}], 17: [function(t, r, n) {
      (function(i) {
        (function() {
          var s = t("base64-js"), a = t("ieee754");
          n.Buffer = d, n.SlowBuffer = function(ne) {
            return +ne != ne && (ne = 0), d.alloc(+ne);
          }, n.INSPECT_MAX_BYTES = 50;
          var f = 2147483647;
          function o(ne) {
            if (ne > f)
              throw new RangeError('The value "' + ne + '" is invalid for option "size"');
            var re = new Uint8Array(ne);
            return re.__proto__ = d.prototype, re;
          }
          function d(ne, re, ve) {
            if (typeof ne == "number") {
              if (typeof re == "string")
                throw new TypeError('The "string" argument must be of type string. Received type number');
              return l(ne);
            }
            return v(ne, re, ve);
          }
          function v(ne, re, ve) {
            if (typeof ne == "string")
              return function(be, Fe) {
                if (typeof Fe == "string" && Fe !== "" || (Fe = "utf8"), !d.isEncoding(Fe))
                  throw new TypeError("Unknown encoding: " + Fe);
                var Ke = 0 | c(be, Fe), nt = o(Ke), ut = nt.write(be, Fe);
                return ut !== Ke && (nt = nt.slice(0, ut)), nt;
              }(ne, re);
            if (ArrayBuffer.isView(ne))
              return P(ne);
            if (ne == null)
              throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof ne);
            if (Xe(ne, ArrayBuffer) || ne && Xe(ne.buffer, ArrayBuffer))
              return function(be, Fe, Ke) {
                if (Fe < 0 || be.byteLength < Fe)
                  throw new RangeError('"offset" is outside of buffer bounds');
                if (be.byteLength < Fe + (Ke || 0))
                  throw new RangeError('"length" is outside of buffer bounds');
                var nt;
                return nt = Fe === void 0 && Ke === void 0 ? new Uint8Array(be) : Ke === void 0 ? new Uint8Array(be, Fe) : new Uint8Array(be, Fe, Ke), nt.__proto__ = d.prototype, nt;
              }(ne, re, ve);
            if (typeof ne == "number")
              throw new TypeError('The "value" argument must not be of type number. Received type number');
            var qe = ne.valueOf && ne.valueOf();
            if (qe != null && qe !== ne)
              return d.from(qe, re, ve);
            var ke = function(be) {
              if (d.isBuffer(be)) {
                var Fe = 0 | p(be.length), Ke = o(Fe);
                return Ke.length === 0 || be.copy(Ke, 0, 0, Fe), Ke;
              }
              if (be.length !== void 0)
                return typeof be.length != "number" || De(be.length) ? o(0) : P(be);
              if (be.type === "Buffer" && Array.isArray(be.data))
                return P(be.data);
            }(ne);
            if (ke)
              return ke;
            if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof ne[Symbol.toPrimitive] == "function")
              return d.from(ne[Symbol.toPrimitive]("string"), re, ve);
            throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof ne);
          }
          function u(ne) {
            if (typeof ne != "number")
              throw new TypeError('"size" argument must be of type number');
            if (ne < 0)
              throw new RangeError('The value "' + ne + '" is invalid for option "size"');
          }
          function l(ne) {
            return u(ne), o(ne < 0 ? 0 : 0 | p(ne));
          }
          function P(ne) {
            for (var re = ne.length < 0 ? 0 : 0 | p(ne.length), ve = o(re), qe = 0; qe < re; qe += 1)
              ve[qe] = 255 & ne[qe];
            return ve;
          }
          function p(ne) {
            if (ne >= f)
              throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + f.toString(16) + " bytes");
            return 0 | ne;
          }
          function c(ne, re) {
            if (d.isBuffer(ne))
              return ne.length;
            if (ArrayBuffer.isView(ne) || Xe(ne, ArrayBuffer))
              return ne.byteLength;
            if (typeof ne != "string")
              throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof ne);
            var ve = ne.length, qe = arguments.length > 2 && arguments[2] === !0;
            if (!qe && ve === 0)
              return 0;
            for (var ke = !1; ; )
              switch (re) {
                case "ascii":
                case "latin1":
                case "binary":
                  return ve;
                case "utf8":
                case "utf-8":
                  return Pe(ne).length;
                case "ucs2":
                case "ucs-2":
                case "utf16le":
                case "utf-16le":
                  return 2 * ve;
                case "hex":
                  return ve >>> 1;
                case "base64":
                  return ge(ne).length;
                default:
                  if (ke)
                    return qe ? -1 : Pe(ne).length;
                  re = ("" + re).toLowerCase(), ke = !0;
              }
          }
          function H(ne, re, ve) {
            var qe = ne[re];
            ne[re] = ne[ve], ne[ve] = qe;
          }
          function T(ne, re, ve, qe, ke) {
            if (ne.length === 0)
              return -1;
            if (typeof ve == "string" ? (qe = ve, ve = 0) : ve > 2147483647 ? ve = 2147483647 : ve < -2147483648 && (ve = -2147483648), De(ve = +ve) && (ve = ke ? 0 : ne.length - 1), ve < 0 && (ve = ne.length + ve), ve >= ne.length) {
              if (ke)
                return -1;
              ve = ne.length - 1;
            } else if (ve < 0) {
              if (!ke)
                return -1;
              ve = 0;
            }
            if (typeof re == "string" && (re = d.from(re, qe)), d.isBuffer(re))
              return re.length === 0 ? -1 : q(ne, re, ve, qe, ke);
            if (typeof re == "number")
              return re &= 255, typeof Uint8Array.prototype.indexOf == "function" ? ke ? Uint8Array.prototype.indexOf.call(ne, re, ve) : Uint8Array.prototype.lastIndexOf.call(ne, re, ve) : q(ne, [re], ve, qe, ke);
            throw new TypeError("val must be string, number or Buffer");
          }
          function q(ne, re, ve, qe, ke) {
            var be, Fe = 1, Ke = ne.length, nt = re.length;
            if (qe !== void 0 && ((qe = String(qe).toLowerCase()) === "ucs2" || qe === "ucs-2" || qe === "utf16le" || qe === "utf-16le")) {
              if (ne.length < 2 || re.length < 2)
                return -1;
              Fe = 2, Ke /= 2, nt /= 2, ve /= 2;
            }
            function ut(lr, Qt) {
              return Fe === 1 ? lr[Qt] : lr.readUInt16BE(Qt * Fe);
            }
            if (ke) {
              var bt = -1;
              for (be = ve; be < Ke; be++)
                if (ut(ne, be) === ut(re, bt === -1 ? 0 : be - bt)) {
                  if (bt === -1 && (bt = be), be - bt + 1 === nt)
                    return bt * Fe;
                } else
                  bt !== -1 && (be -= be - bt), bt = -1;
            } else
              for (ve + nt > Ke && (ve = Ke - nt), be = ve; be >= 0; be--) {
                for (var wt = !0, Tt = 0; Tt < nt; Tt++)
                  if (ut(ne, be + Tt) !== ut(re, Tt)) {
                    wt = !1;
                    break;
                  }
                if (wt)
                  return be;
              }
            return -1;
          }
          function b(ne, re, ve, qe) {
            ve = Number(ve) || 0;
            var ke = ne.length - ve;
            qe ? (qe = Number(qe)) > ke && (qe = ke) : qe = ke;
            var be = re.length;
            qe > be / 2 && (qe = be / 2);
            for (var Fe = 0; Fe < qe; ++Fe) {
              var Ke = parseInt(re.substr(2 * Fe, 2), 16);
              if (De(Ke))
                return Fe;
              ne[ve + Fe] = Ke;
            }
            return Fe;
          }
          function j(ne, re, ve, qe) {
            return me(Pe(re, ne.length - ve), ne, ve, qe);
          }
          function w(ne, re, ve, qe) {
            return me(function(ke) {
              for (var be = [], Fe = 0; Fe < ke.length; ++Fe)
                be.push(255 & ke.charCodeAt(Fe));
              return be;
            }(re), ne, ve, qe);
          }
          function m(ne, re, ve, qe) {
            return w(ne, re, ve, qe);
          }
          function I(ne, re, ve, qe) {
            return me(ge(re), ne, ve, qe);
          }
          function N(ne, re, ve, qe) {
            return me(function(ke, be) {
              for (var Fe, Ke, nt, ut = [], bt = 0; bt < ke.length && !((be -= 2) < 0); ++bt)
                Fe = ke.charCodeAt(bt), Ke = Fe >> 8, nt = Fe % 256, ut.push(nt), ut.push(Ke);
              return ut;
            }(re, ne.length - ve), ne, ve, qe);
          }
          function k(ne, re, ve) {
            return re === 0 && ve === ne.length ? s.fromByteArray(ne) : s.fromByteArray(ne.slice(re, ve));
          }
          function R(ne, re, ve) {
            ve = Math.min(ne.length, ve);
            for (var qe = [], ke = re; ke < ve; ) {
              var be, Fe, Ke, nt, ut = ne[ke], bt = null, wt = ut > 239 ? 4 : ut > 223 ? 3 : ut > 191 ? 2 : 1;
              if (ke + wt <= ve)
                switch (wt) {
                  case 1:
                    ut < 128 && (bt = ut);
                    break;
                  case 2:
                    (192 & (be = ne[ke + 1])) == 128 && (nt = (31 & ut) << 6 | 63 & be) > 127 && (bt = nt);
                    break;
                  case 3:
                    be = ne[ke + 1], Fe = ne[ke + 2], (192 & be) == 128 && (192 & Fe) == 128 && (nt = (15 & ut) << 12 | (63 & be) << 6 | 63 & Fe) > 2047 && (nt < 55296 || nt > 57343) && (bt = nt);
                    break;
                  case 4:
                    be = ne[ke + 1], Fe = ne[ke + 2], Ke = ne[ke + 3], (192 & be) == 128 && (192 & Fe) == 128 && (192 & Ke) == 128 && (nt = (15 & ut) << 18 | (63 & be) << 12 | (63 & Fe) << 6 | 63 & Ke) > 65535 && nt < 1114112 && (bt = nt);
                }
              bt === null ? (bt = 65533, wt = 1) : bt > 65535 && (bt -= 65536, qe.push(bt >>> 10 & 1023 | 55296), bt = 56320 | 1023 & bt), qe.push(bt), ke += wt;
            }
            return function(Tt) {
              var lr = Tt.length;
              if (lr <= y)
                return String.fromCharCode.apply(String, Tt);
              for (var Qt = "", tr = 0; tr < lr; )
                Qt += String.fromCharCode.apply(String, Tt.slice(tr, tr += y));
              return Qt;
            }(qe);
          }
          n.kMaxLength = f, d.TYPED_ARRAY_SUPPORT = function() {
            try {
              var ne = new Uint8Array(1);
              return ne.__proto__ = { __proto__: Uint8Array.prototype, foo: function() {
                return 42;
              } }, ne.foo() === 42;
            } catch {
              return !1;
            }
          }(), d.TYPED_ARRAY_SUPPORT || typeof console > "u" || typeof console.error != "function" || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), Object.defineProperty(d.prototype, "parent", { enumerable: !0, get: function() {
            if (d.isBuffer(this))
              return this.buffer;
          } }), Object.defineProperty(d.prototype, "offset", { enumerable: !0, get: function() {
            if (d.isBuffer(this))
              return this.byteOffset;
          } }), typeof Symbol < "u" && Symbol.species != null && d[Symbol.species] === d && Object.defineProperty(d, Symbol.species, { value: null, configurable: !0, enumerable: !1, writable: !1 }), d.poolSize = 8192, d.from = function(ne, re, ve) {
            return v(ne, re, ve);
          }, d.prototype.__proto__ = Uint8Array.prototype, d.__proto__ = Uint8Array, d.alloc = function(ne, re, ve) {
            return function(qe, ke, be) {
              return u(qe), qe <= 0 ? o(qe) : ke !== void 0 ? typeof be == "string" ? o(qe).fill(ke, be) : o(qe).fill(ke) : o(qe);
            }(ne, re, ve);
          }, d.allocUnsafe = function(ne) {
            return l(ne);
          }, d.allocUnsafeSlow = function(ne) {
            return l(ne);
          }, d.isBuffer = function(ne) {
            return ne != null && ne._isBuffer === !0 && ne !== d.prototype;
          }, d.compare = function(ne, re) {
            if (Xe(ne, Uint8Array) && (ne = d.from(ne, ne.offset, ne.byteLength)), Xe(re, Uint8Array) && (re = d.from(re, re.offset, re.byteLength)), !d.isBuffer(ne) || !d.isBuffer(re))
              throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
            if (ne === re)
              return 0;
            for (var ve = ne.length, qe = re.length, ke = 0, be = Math.min(ve, qe); ke < be; ++ke)
              if (ne[ke] !== re[ke]) {
                ve = ne[ke], qe = re[ke];
                break;
              }
            return ve < qe ? -1 : qe < ve ? 1 : 0;
          }, d.isEncoding = function(ne) {
            switch (String(ne).toLowerCase()) {
              case "hex":
              case "utf8":
              case "utf-8":
              case "ascii":
              case "latin1":
              case "binary":
              case "base64":
              case "ucs2":
              case "ucs-2":
              case "utf16le":
              case "utf-16le":
                return !0;
              default:
                return !1;
            }
          }, d.concat = function(ne, re) {
            if (!Array.isArray(ne))
              throw new TypeError('"list" argument must be an Array of Buffers');
            if (ne.length === 0)
              return d.alloc(0);
            var ve;
            if (re === void 0)
              for (re = 0, ve = 0; ve < ne.length; ++ve)
                re += ne[ve].length;
            var qe = d.allocUnsafe(re), ke = 0;
            for (ve = 0; ve < ne.length; ++ve) {
              var be = ne[ve];
              if (Xe(be, Uint8Array) && (be = d.from(be)), !d.isBuffer(be))
                throw new TypeError('"list" argument must be an Array of Buffers');
              be.copy(qe, ke), ke += be.length;
            }
            return qe;
          }, d.byteLength = c, d.prototype._isBuffer = !0, d.prototype.swap16 = function() {
            var ne = this.length;
            if (ne % 2 != 0)
              throw new RangeError("Buffer size must be a multiple of 16-bits");
            for (var re = 0; re < ne; re += 2)
              H(this, re, re + 1);
            return this;
          }, d.prototype.swap32 = function() {
            var ne = this.length;
            if (ne % 4 != 0)
              throw new RangeError("Buffer size must be a multiple of 32-bits");
            for (var re = 0; re < ne; re += 4)
              H(this, re, re + 3), H(this, re + 1, re + 2);
            return this;
          }, d.prototype.swap64 = function() {
            var ne = this.length;
            if (ne % 8 != 0)
              throw new RangeError("Buffer size must be a multiple of 64-bits");
            for (var re = 0; re < ne; re += 8)
              H(this, re, re + 7), H(this, re + 1, re + 6), H(this, re + 2, re + 5), H(this, re + 3, re + 4);
            return this;
          }, d.prototype.toString = function() {
            var ne = this.length;
            return ne === 0 ? "" : arguments.length === 0 ? R(this, 0, ne) : (function(re, ve, qe) {
              var ke = !1;
              if ((ve === void 0 || ve < 0) && (ve = 0), ve > this.length || ((qe === void 0 || qe > this.length) && (qe = this.length), qe <= 0) || (qe >>>= 0) <= (ve >>>= 0))
                return "";
              for (re || (re = "utf8"); ; )
                switch (re) {
                  case "hex":
                    return ee(this, ve, qe);
                  case "utf8":
                  case "utf-8":
                    return R(this, ve, qe);
                  case "ascii":
                    return O(this, ve, qe);
                  case "latin1":
                  case "binary":
                    return Y(this, ve, qe);
                  case "base64":
                    return k(this, ve, qe);
                  case "ucs2":
                  case "ucs-2":
                  case "utf16le":
                  case "utf-16le":
                    return Z(this, ve, qe);
                  default:
                    if (ke)
                      throw new TypeError("Unknown encoding: " + re);
                    re = (re + "").toLowerCase(), ke = !0;
                }
            }).apply(this, arguments);
          }, d.prototype.toLocaleString = d.prototype.toString, d.prototype.equals = function(ne) {
            if (!d.isBuffer(ne))
              throw new TypeError("Argument must be a Buffer");
            return this === ne || d.compare(this, ne) === 0;
          }, d.prototype.inspect = function() {
            var ne = "", re = n.INSPECT_MAX_BYTES;
            return ne = this.toString("hex", 0, re).replace(/(.{2})/g, "$1 ").trim(), this.length > re && (ne += " ... "), "<Buffer " + ne + ">";
          }, d.prototype.compare = function(ne, re, ve, qe, ke) {
            if (Xe(ne, Uint8Array) && (ne = d.from(ne, ne.offset, ne.byteLength)), !d.isBuffer(ne))
              throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof ne);
            if (re === void 0 && (re = 0), ve === void 0 && (ve = ne ? ne.length : 0), qe === void 0 && (qe = 0), ke === void 0 && (ke = this.length), re < 0 || ve > ne.length || qe < 0 || ke > this.length)
              throw new RangeError("out of range index");
            if (qe >= ke && re >= ve)
              return 0;
            if (qe >= ke)
              return -1;
            if (re >= ve)
              return 1;
            if (re >>>= 0, ve >>>= 0, qe >>>= 0, ke >>>= 0, this === ne)
              return 0;
            for (var be = ke - qe, Fe = ve - re, Ke = Math.min(be, Fe), nt = this.slice(qe, ke), ut = ne.slice(re, ve), bt = 0; bt < Ke; ++bt)
              if (nt[bt] !== ut[bt]) {
                be = nt[bt], Fe = ut[bt];
                break;
              }
            return be < Fe ? -1 : Fe < be ? 1 : 0;
          }, d.prototype.includes = function(ne, re, ve) {
            return this.indexOf(ne, re, ve) !== -1;
          }, d.prototype.indexOf = function(ne, re, ve) {
            return T(this, ne, re, ve, !0);
          }, d.prototype.lastIndexOf = function(ne, re, ve) {
            return T(this, ne, re, ve, !1);
          }, d.prototype.write = function(ne, re, ve, qe) {
            if (re === void 0)
              qe = "utf8", ve = this.length, re = 0;
            else if (ve === void 0 && typeof re == "string")
              qe = re, ve = this.length, re = 0;
            else {
              if (!isFinite(re))
                throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
              re >>>= 0, isFinite(ve) ? (ve >>>= 0, qe === void 0 && (qe = "utf8")) : (qe = ve, ve = void 0);
            }
            var ke = this.length - re;
            if ((ve === void 0 || ve > ke) && (ve = ke), ne.length > 0 && (ve < 0 || re < 0) || re > this.length)
              throw new RangeError("Attempt to write outside buffer bounds");
            qe || (qe = "utf8");
            for (var be = !1; ; )
              switch (qe) {
                case "hex":
                  return b(this, ne, re, ve);
                case "utf8":
                case "utf-8":
                  return j(this, ne, re, ve);
                case "ascii":
                  return w(this, ne, re, ve);
                case "latin1":
                case "binary":
                  return m(this, ne, re, ve);
                case "base64":
                  return I(this, ne, re, ve);
                case "ucs2":
                case "ucs-2":
                case "utf16le":
                case "utf-16le":
                  return N(this, ne, re, ve);
                default:
                  if (be)
                    throw new TypeError("Unknown encoding: " + qe);
                  qe = ("" + qe).toLowerCase(), be = !0;
              }
          }, d.prototype.toJSON = function() {
            return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
          };
          var y = 4096;
          function O(ne, re, ve) {
            var qe = "";
            ve = Math.min(ne.length, ve);
            for (var ke = re; ke < ve; ++ke)
              qe += String.fromCharCode(127 & ne[ke]);
            return qe;
          }
          function Y(ne, re, ve) {
            var qe = "";
            ve = Math.min(ne.length, ve);
            for (var ke = re; ke < ve; ++ke)
              qe += String.fromCharCode(ne[ke]);
            return qe;
          }
          function ee(ne, re, ve) {
            var qe = ne.length;
            (!re || re < 0) && (re = 0), (!ve || ve < 0 || ve > qe) && (ve = qe);
            for (var ke = "", be = re; be < ve; ++be)
              ke += ae(ne[be]);
            return ke;
          }
          function Z(ne, re, ve) {
            for (var qe = ne.slice(re, ve), ke = "", be = 0; be < qe.length; be += 2)
              ke += String.fromCharCode(qe[be] + 256 * qe[be + 1]);
            return ke;
          }
          function te(ne, re, ve) {
            if (ne % 1 != 0 || ne < 0)
              throw new RangeError("offset is not uint");
            if (ne + re > ve)
              throw new RangeError("Trying to access beyond buffer length");
          }
          function fe(ne, re, ve, qe, ke, be) {
            if (!d.isBuffer(ne))
              throw new TypeError('"buffer" argument must be a Buffer instance');
            if (re > ke || re < be)
              throw new RangeError('"value" argument is out of bounds');
            if (ve + qe > ne.length)
              throw new RangeError("Index out of range");
          }
          function _(ne, re, ve, qe, ke, be) {
            if (ve + qe > ne.length)
              throw new RangeError("Index out of range");
            if (ve < 0)
              throw new RangeError("Index out of range");
          }
          function G(ne, re, ve, qe, ke) {
            return re = +re, ve >>>= 0, ke || _(ne, 0, ve, 4), a.write(ne, re, ve, qe, 23, 4), ve + 4;
          }
          function L(ne, re, ve, qe, ke) {
            return re = +re, ve >>>= 0, ke || _(ne, 0, ve, 8), a.write(ne, re, ve, qe, 52, 8), ve + 8;
          }
          d.prototype.slice = function(ne, re) {
            var ve = this.length;
            ne = ~~ne, re = re === void 0 ? ve : ~~re, ne < 0 ? (ne += ve) < 0 && (ne = 0) : ne > ve && (ne = ve), re < 0 ? (re += ve) < 0 && (re = 0) : re > ve && (re = ve), re < ne && (re = ne);
            var qe = this.subarray(ne, re);
            return qe.__proto__ = d.prototype, qe;
          }, d.prototype.readUIntLE = function(ne, re, ve) {
            ne >>>= 0, re >>>= 0, ve || te(ne, re, this.length);
            for (var qe = this[ne], ke = 1, be = 0; ++be < re && (ke *= 256); )
              qe += this[ne + be] * ke;
            return qe;
          }, d.prototype.readUIntBE = function(ne, re, ve) {
            ne >>>= 0, re >>>= 0, ve || te(ne, re, this.length);
            for (var qe = this[ne + --re], ke = 1; re > 0 && (ke *= 256); )
              qe += this[ne + --re] * ke;
            return qe;
          }, d.prototype.readUInt8 = function(ne, re) {
            return ne >>>= 0, re || te(ne, 1, this.length), this[ne];
          }, d.prototype.readUInt16LE = function(ne, re) {
            return ne >>>= 0, re || te(ne, 2, this.length), this[ne] | this[ne + 1] << 8;
          }, d.prototype.readUInt16BE = function(ne, re) {
            return ne >>>= 0, re || te(ne, 2, this.length), this[ne] << 8 | this[ne + 1];
          }, d.prototype.readUInt32LE = function(ne, re) {
            return ne >>>= 0, re || te(ne, 4, this.length), (this[ne] | this[ne + 1] << 8 | this[ne + 2] << 16) + 16777216 * this[ne + 3];
          }, d.prototype.readUInt32BE = function(ne, re) {
            return ne >>>= 0, re || te(ne, 4, this.length), 16777216 * this[ne] + (this[ne + 1] << 16 | this[ne + 2] << 8 | this[ne + 3]);
          }, d.prototype.readIntLE = function(ne, re, ve) {
            ne >>>= 0, re >>>= 0, ve || te(ne, re, this.length);
            for (var qe = this[ne], ke = 1, be = 0; ++be < re && (ke *= 256); )
              qe += this[ne + be] * ke;
            return qe >= (ke *= 128) && (qe -= Math.pow(2, 8 * re)), qe;
          }, d.prototype.readIntBE = function(ne, re, ve) {
            ne >>>= 0, re >>>= 0, ve || te(ne, re, this.length);
            for (var qe = re, ke = 1, be = this[ne + --qe]; qe > 0 && (ke *= 256); )
              be += this[ne + --qe] * ke;
            return be >= (ke *= 128) && (be -= Math.pow(2, 8 * re)), be;
          }, d.prototype.readInt8 = function(ne, re) {
            return ne >>>= 0, re || te(ne, 1, this.length), 128 & this[ne] ? -1 * (255 - this[ne] + 1) : this[ne];
          }, d.prototype.readInt16LE = function(ne, re) {
            ne >>>= 0, re || te(ne, 2, this.length);
            var ve = this[ne] | this[ne + 1] << 8;
            return 32768 & ve ? 4294901760 | ve : ve;
          }, d.prototype.readInt16BE = function(ne, re) {
            ne >>>= 0, re || te(ne, 2, this.length);
            var ve = this[ne + 1] | this[ne] << 8;
            return 32768 & ve ? 4294901760 | ve : ve;
          }, d.prototype.readInt32LE = function(ne, re) {
            return ne >>>= 0, re || te(ne, 4, this.length), this[ne] | this[ne + 1] << 8 | this[ne + 2] << 16 | this[ne + 3] << 24;
          }, d.prototype.readInt32BE = function(ne, re) {
            return ne >>>= 0, re || te(ne, 4, this.length), this[ne] << 24 | this[ne + 1] << 16 | this[ne + 2] << 8 | this[ne + 3];
          }, d.prototype.readFloatLE = function(ne, re) {
            return ne >>>= 0, re || te(ne, 4, this.length), a.read(this, ne, !0, 23, 4);
          }, d.prototype.readFloatBE = function(ne, re) {
            return ne >>>= 0, re || te(ne, 4, this.length), a.read(this, ne, !1, 23, 4);
          }, d.prototype.readDoubleLE = function(ne, re) {
            return ne >>>= 0, re || te(ne, 8, this.length), a.read(this, ne, !0, 52, 8);
          }, d.prototype.readDoubleBE = function(ne, re) {
            return ne >>>= 0, re || te(ne, 8, this.length), a.read(this, ne, !1, 52, 8);
          }, d.prototype.writeUIntLE = function(ne, re, ve, qe) {
            ne = +ne, re >>>= 0, ve >>>= 0, qe || fe(this, ne, re, ve, Math.pow(2, 8 * ve) - 1, 0);
            var ke = 1, be = 0;
            for (this[re] = 255 & ne; ++be < ve && (ke *= 256); )
              this[re + be] = ne / ke & 255;
            return re + ve;
          }, d.prototype.writeUIntBE = function(ne, re, ve, qe) {
            ne = +ne, re >>>= 0, ve >>>= 0, qe || fe(this, ne, re, ve, Math.pow(2, 8 * ve) - 1, 0);
            var ke = ve - 1, be = 1;
            for (this[re + ke] = 255 & ne; --ke >= 0 && (be *= 256); )
              this[re + ke] = ne / be & 255;
            return re + ve;
          }, d.prototype.writeUInt8 = function(ne, re, ve) {
            return ne = +ne, re >>>= 0, ve || fe(this, ne, re, 1, 255, 0), this[re] = 255 & ne, re + 1;
          }, d.prototype.writeUInt16LE = function(ne, re, ve) {
            return ne = +ne, re >>>= 0, ve || fe(this, ne, re, 2, 65535, 0), this[re] = 255 & ne, this[re + 1] = ne >>> 8, re + 2;
          }, d.prototype.writeUInt16BE = function(ne, re, ve) {
            return ne = +ne, re >>>= 0, ve || fe(this, ne, re, 2, 65535, 0), this[re] = ne >>> 8, this[re + 1] = 255 & ne, re + 2;
          }, d.prototype.writeUInt32LE = function(ne, re, ve) {
            return ne = +ne, re >>>= 0, ve || fe(this, ne, re, 4, 4294967295, 0), this[re + 3] = ne >>> 24, this[re + 2] = ne >>> 16, this[re + 1] = ne >>> 8, this[re] = 255 & ne, re + 4;
          }, d.prototype.writeUInt32BE = function(ne, re, ve) {
            return ne = +ne, re >>>= 0, ve || fe(this, ne, re, 4, 4294967295, 0), this[re] = ne >>> 24, this[re + 1] = ne >>> 16, this[re + 2] = ne >>> 8, this[re + 3] = 255 & ne, re + 4;
          }, d.prototype.writeIntLE = function(ne, re, ve, qe) {
            if (ne = +ne, re >>>= 0, !qe) {
              var ke = Math.pow(2, 8 * ve - 1);
              fe(this, ne, re, ve, ke - 1, -ke);
            }
            var be = 0, Fe = 1, Ke = 0;
            for (this[re] = 255 & ne; ++be < ve && (Fe *= 256); )
              ne < 0 && Ke === 0 && this[re + be - 1] !== 0 && (Ke = 1), this[re + be] = (ne / Fe >> 0) - Ke & 255;
            return re + ve;
          }, d.prototype.writeIntBE = function(ne, re, ve, qe) {
            if (ne = +ne, re >>>= 0, !qe) {
              var ke = Math.pow(2, 8 * ve - 1);
              fe(this, ne, re, ve, ke - 1, -ke);
            }
            var be = ve - 1, Fe = 1, Ke = 0;
            for (this[re + be] = 255 & ne; --be >= 0 && (Fe *= 256); )
              ne < 0 && Ke === 0 && this[re + be + 1] !== 0 && (Ke = 1), this[re + be] = (ne / Fe >> 0) - Ke & 255;
            return re + ve;
          }, d.prototype.writeInt8 = function(ne, re, ve) {
            return ne = +ne, re >>>= 0, ve || fe(this, ne, re, 1, 127, -128), ne < 0 && (ne = 255 + ne + 1), this[re] = 255 & ne, re + 1;
          }, d.prototype.writeInt16LE = function(ne, re, ve) {
            return ne = +ne, re >>>= 0, ve || fe(this, ne, re, 2, 32767, -32768), this[re] = 255 & ne, this[re + 1] = ne >>> 8, re + 2;
          }, d.prototype.writeInt16BE = function(ne, re, ve) {
            return ne = +ne, re >>>= 0, ve || fe(this, ne, re, 2, 32767, -32768), this[re] = ne >>> 8, this[re + 1] = 255 & ne, re + 2;
          }, d.prototype.writeInt32LE = function(ne, re, ve) {
            return ne = +ne, re >>>= 0, ve || fe(this, ne, re, 4, 2147483647, -2147483648), this[re] = 255 & ne, this[re + 1] = ne >>> 8, this[re + 2] = ne >>> 16, this[re + 3] = ne >>> 24, re + 4;
          }, d.prototype.writeInt32BE = function(ne, re, ve) {
            return ne = +ne, re >>>= 0, ve || fe(this, ne, re, 4, 2147483647, -2147483648), ne < 0 && (ne = 4294967295 + ne + 1), this[re] = ne >>> 24, this[re + 1] = ne >>> 16, this[re + 2] = ne >>> 8, this[re + 3] = 255 & ne, re + 4;
          }, d.prototype.writeFloatLE = function(ne, re, ve) {
            return G(this, ne, re, !0, ve);
          }, d.prototype.writeFloatBE = function(ne, re, ve) {
            return G(this, ne, re, !1, ve);
          }, d.prototype.writeDoubleLE = function(ne, re, ve) {
            return L(this, ne, re, !0, ve);
          }, d.prototype.writeDoubleBE = function(ne, re, ve) {
            return L(this, ne, re, !1, ve);
          }, d.prototype.copy = function(ne, re, ve, qe) {
            if (!d.isBuffer(ne))
              throw new TypeError("argument should be a Buffer");
            if (ve || (ve = 0), qe || qe === 0 || (qe = this.length), re >= ne.length && (re = ne.length), re || (re = 0), qe > 0 && qe < ve && (qe = ve), qe === ve || ne.length === 0 || this.length === 0)
              return 0;
            if (re < 0)
              throw new RangeError("targetStart out of bounds");
            if (ve < 0 || ve >= this.length)
              throw new RangeError("Index out of range");
            if (qe < 0)
              throw new RangeError("sourceEnd out of bounds");
            qe > this.length && (qe = this.length), ne.length - re < qe - ve && (qe = ne.length - re + ve);
            var ke = qe - ve;
            if (this === ne && typeof Uint8Array.prototype.copyWithin == "function")
              this.copyWithin(re, ve, qe);
            else if (this === ne && ve < re && re < qe)
              for (var be = ke - 1; be >= 0; --be)
                ne[be + re] = this[be + ve];
            else
              Uint8Array.prototype.set.call(ne, this.subarray(ve, qe), re);
            return ke;
          }, d.prototype.fill = function(ne, re, ve, qe) {
            if (typeof ne == "string") {
              if (typeof re == "string" ? (qe = re, re = 0, ve = this.length) : typeof ve == "string" && (qe = ve, ve = this.length), qe !== void 0 && typeof qe != "string")
                throw new TypeError("encoding must be a string");
              if (typeof qe == "string" && !d.isEncoding(qe))
                throw new TypeError("Unknown encoding: " + qe);
              if (ne.length === 1) {
                var ke = ne.charCodeAt(0);
                (qe === "utf8" && ke < 128 || qe === "latin1") && (ne = ke);
              }
            } else
              typeof ne == "number" && (ne &= 255);
            if (re < 0 || this.length < re || this.length < ve)
              throw new RangeError("Out of range index");
            if (ve <= re)
              return this;
            var be;
            if (re >>>= 0, ve = ve === void 0 ? this.length : ve >>> 0, ne || (ne = 0), typeof ne == "number")
              for (be = re; be < ve; ++be)
                this[be] = ne;
            else {
              var Fe = d.isBuffer(ne) ? ne : d.from(ne, qe), Ke = Fe.length;
              if (Ke === 0)
                throw new TypeError('The value "' + ne + '" is invalid for argument "value"');
              for (be = 0; be < ve - re; ++be)
                this[be + re] = Fe[be % Ke];
            }
            return this;
          };
          var $ = /[^+/0-9A-Za-z-_]/g;
          function ae(ne) {
            return ne < 16 ? "0" + ne.toString(16) : ne.toString(16);
          }
          function Pe(ne, re) {
            var ve;
            re = re || 1 / 0;
            for (var qe = ne.length, ke = null, be = [], Fe = 0; Fe < qe; ++Fe) {
              if ((ve = ne.charCodeAt(Fe)) > 55295 && ve < 57344) {
                if (!ke) {
                  if (ve > 56319) {
                    (re -= 3) > -1 && be.push(239, 191, 189);
                    continue;
                  }
                  if (Fe + 1 === qe) {
                    (re -= 3) > -1 && be.push(239, 191, 189);
                    continue;
                  }
                  ke = ve;
                  continue;
                }
                if (ve < 56320) {
                  (re -= 3) > -1 && be.push(239, 191, 189), ke = ve;
                  continue;
                }
                ve = 65536 + (ke - 55296 << 10 | ve - 56320);
              } else
                ke && (re -= 3) > -1 && be.push(239, 191, 189);
              if (ke = null, ve < 128) {
                if ((re -= 1) < 0)
                  break;
                be.push(ve);
              } else if (ve < 2048) {
                if ((re -= 2) < 0)
                  break;
                be.push(ve >> 6 | 192, 63 & ve | 128);
              } else if (ve < 65536) {
                if ((re -= 3) < 0)
                  break;
                be.push(ve >> 12 | 224, ve >> 6 & 63 | 128, 63 & ve | 128);
              } else {
                if (!(ve < 1114112))
                  throw new Error("Invalid code point");
                if ((re -= 4) < 0)
                  break;
                be.push(ve >> 18 | 240, ve >> 12 & 63 | 128, ve >> 6 & 63 | 128, 63 & ve | 128);
              }
            }
            return be;
          }
          function ge(ne) {
            return s.toByteArray(function(re) {
              if ((re = (re = re.split("=")[0]).trim().replace($, "")).length < 2)
                return "";
              for (; re.length % 4 != 0; )
                re += "=";
              return re;
            }(ne));
          }
          function me(ne, re, ve, qe) {
            for (var ke = 0; ke < qe && !(ke + ve >= re.length || ke >= ne.length); ++ke)
              re[ke + ve] = ne[ke];
            return ke;
          }
          function Xe(ne, re) {
            return ne instanceof re || ne != null && ne.constructor != null && ne.constructor.name != null && ne.constructor.name === re.name;
          }
          function De(ne) {
            return ne != ne;
          }
        }).call(this);
      }).call(this, t("buffer").Buffer);
    }, { "base64-js": 13, buffer: 17, ieee754: 23 }], 18: [function(t, r, n) {
      (function(i) {
        (function() {
          n.formatArgs = function(a) {
            if (a[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + a[0] + (this.useColors ? "%c " : " ") + "+" + r.exports.humanize(this.diff), !this.useColors)
              return;
            const f = "color: " + this.color;
            a.splice(1, 0, f, "color: inherit");
            let o = 0, d = 0;
            a[0].replace(/%[a-zA-Z%]/g, (v) => {
              v !== "%%" && v === "%c" && (d = ++o);
            }), a.splice(d, 0, f);
          }, n.save = function(a) {
            try {
              a ? n.storage.setItem("debug", a) : n.storage.removeItem("debug");
            } catch {
            }
          }, n.load = function() {
            let a;
            try {
              a = n.storage.getItem("debug");
            } catch {
            }
            return !a && i !== void 0 && "env" in i && (a = i.env.DEBUG), a;
          }, n.useColors = function() {
            return typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs) ? !0 : typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/) ? !1 : typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
          }, n.storage = function() {
            try {
              return localStorage;
            } catch {
            }
          }(), n.destroy = /* @__PURE__ */ (() => {
            let a = !1;
            return () => {
              a || (a = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
            };
          })(), n.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"], n.log = console.debug || console.log || (() => {
          }), r.exports = t("./common")(n);
          const { formatters: s } = r.exports;
          s.j = function(a) {
            try {
              return JSON.stringify(a);
            } catch (f) {
              return "[UnexpectedJSONParseError]: " + f.message;
            }
          };
        }).call(this);
      }).call(this, t("_process"));
    }, { "./common": 19, _process: 50 }], 19: [function(t, r, n) {
      r.exports = function(i) {
        function s(o) {
          let d, v, u, l = null;
          function P(...p) {
            if (!P.enabled)
              return;
            const c = P, H = Number(/* @__PURE__ */ new Date()), T = H - (d || H);
            c.diff = T, c.prev = d, c.curr = H, d = H, p[0] = s.coerce(p[0]), typeof p[0] != "string" && p.unshift("%O");
            let q = 0;
            p[0] = p[0].replace(/%([a-zA-Z%])/g, (b, j) => {
              if (b === "%%")
                return "%";
              q++;
              const w = s.formatters[j];
              if (typeof w == "function") {
                const m = p[q];
                b = w.call(c, m), p.splice(q, 1), q--;
              }
              return b;
            }), s.formatArgs.call(c, p), (c.log || s.log).apply(c, p);
          }
          return P.namespace = o, P.useColors = s.useColors(), P.color = s.selectColor(o), P.extend = a, P.destroy = s.destroy, Object.defineProperty(P, "enabled", { enumerable: !0, configurable: !1, get: () => l !== null ? l : (v !== s.namespaces && (v = s.namespaces, u = s.enabled(o)), u), set: (p) => {
            l = p;
          } }), typeof s.init == "function" && s.init(P), P;
        }
        function a(o, d) {
          const v = s(this.namespace + (d === void 0 ? ":" : d) + o);
          return v.log = this.log, v;
        }
        function f(o) {
          return o.toString().substring(2, o.toString().length - 2).replace(/\.\*\?$/, "*");
        }
        return s.debug = s, s.default = s, s.coerce = function(o) {
          return o instanceof Error ? o.stack || o.message : o;
        }, s.disable = function() {
          const o = [...s.names.map(f), ...s.skips.map(f).map((d) => "-" + d)].join(",");
          return s.enable(""), o;
        }, s.enable = function(o) {
          let d;
          s.save(o), s.namespaces = o, s.names = [], s.skips = [];
          const v = (typeof o == "string" ? o : "").split(/[\s,]+/), u = v.length;
          for (d = 0; d < u; d++)
            v[d] && ((o = v[d].replace(/\*/g, ".*?"))[0] === "-" ? s.skips.push(new RegExp("^" + o.substr(1) + "$")) : s.names.push(new RegExp("^" + o + "$")));
        }, s.enabled = function(o) {
          if (o[o.length - 1] === "*")
            return !0;
          let d, v;
          for (d = 0, v = s.skips.length; d < v; d++)
            if (s.skips[d].test(o))
              return !1;
          for (d = 0, v = s.names.length; d < v; d++)
            if (s.names[d].test(o))
              return !0;
          return !1;
        }, s.humanize = t("ms"), s.destroy = function() {
          console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
        }, Object.keys(i).forEach((o) => {
          s[o] = i[o];
        }), s.names = [], s.skips = [], s.formatters = {}, s.selectColor = function(o) {
          let d = 0;
          for (let v = 0; v < o.length; v++)
            d = (d << 5) - d + o.charCodeAt(v), d |= 0;
          return s.colors[Math.abs(d) % s.colors.length];
        }, s.enable(s.load()), s;
      };
    }, { ms: 45 }], 20: [function(t, r, n) {
      (function(i, s) {
        (function() {
          var a = t("readable-stream"), f = t("end-of-stream"), o = t("inherits"), d = t("stream-shift"), v = s.from && s.from !== Uint8Array.from ? s.from([0]) : new s([0]), u = function(c, H) {
            c._corked ? c.once("uncork", H) : H();
          }, l = function(c, H) {
            return function(T) {
              T ? function(q, b) {
                q._autoDestroy && q.destroy(b);
              }(c, T.message === "premature close" ? null : T) : H && !c._ended && c.end();
            };
          }, P = function() {
          }, p = function(c, H, T) {
            if (!(this instanceof p))
              return new p(c, H, T);
            a.Duplex.call(this, T), this._writable = null, this._readable = null, this._readable2 = null, this._autoDestroy = !T || T.autoDestroy !== !1, this._forwardDestroy = !T || T.destroy !== !1, this._forwardEnd = !T || T.end !== !1, this._corked = 1, this._ondrain = null, this._drained = !1, this._forwarding = !1, this._unwrite = null, this._unread = null, this._ended = !1, this.destroyed = !1, c && this.setWritable(c), H && this.setReadable(H);
          };
          o(p, a.Duplex), p.obj = function(c, H, T) {
            return T || (T = {}), T.objectMode = !0, T.highWaterMark = 16, new p(c, H, T);
          }, p.prototype.cork = function() {
            ++this._corked == 1 && this.emit("cork");
          }, p.prototype.uncork = function() {
            this._corked && --this._corked == 0 && this.emit("uncork");
          }, p.prototype.setWritable = function(c) {
            if (this._unwrite && this._unwrite(), this.destroyed)
              c && c.destroy && c.destroy();
            else if (c !== null && c !== !1) {
              var H = this, T = f(c, { writable: !0, readable: !1 }, l(this, this._forwardEnd)), q = function() {
                var b = H._ondrain;
                H._ondrain = null, b && b();
              };
              this._unwrite && i.nextTick(q), this._writable = c, this._writable.on("drain", q), this._unwrite = function() {
                H._writable.removeListener("drain", q), T();
              }, this.uncork();
            } else
              this.end();
          }, p.prototype.setReadable = function(c) {
            if (this._unread && this._unread(), this.destroyed)
              c && c.destroy && c.destroy();
            else {
              if (c === null || c === !1)
                return this.push(null), void this.resume();
              var H, T = this, q = f(c, { writable: !1, readable: !0 }, l(this)), b = function() {
                T._forward();
              }, j = function() {
                T.push(null);
              };
              this._drained = !0, this._readable = c, this._readable2 = c._readableState ? c : (H = c, new a.Readable({ objectMode: !0, highWaterMark: 16 }).wrap(H)), this._readable2.on("readable", b), this._readable2.on("end", j), this._unread = function() {
                T._readable2.removeListener("readable", b), T._readable2.removeListener("end", j), q();
              }, this._forward();
            }
          }, p.prototype._read = function() {
            this._drained = !0, this._forward();
          }, p.prototype._forward = function() {
            if (!this._forwarding && this._readable2 && this._drained) {
              var c;
              for (this._forwarding = !0; this._drained && (c = d(this._readable2)) !== null; )
                this.destroyed || (this._drained = this.push(c));
              this._forwarding = !1;
            }
          }, p.prototype.destroy = function(c, H) {
            if (H || (H = P), this.destroyed)
              return H(null);
            this.destroyed = !0;
            var T = this;
            i.nextTick(function() {
              T._destroy(c), H(null);
            });
          }, p.prototype._destroy = function(c) {
            if (c) {
              var H = this._ondrain;
              this._ondrain = null, H ? H(c) : this.emit("error", c);
            }
            this._forwardDestroy && (this._readable && this._readable.destroy && this._readable.destroy(), this._writable && this._writable.destroy && this._writable.destroy()), this.emit("close");
          }, p.prototype._write = function(c, H, T) {
            if (!this.destroyed)
              return this._corked ? u(this, this._write.bind(this, c, H, T)) : c === v ? this._finish(T) : this._writable ? void (this._writable.write(c) === !1 ? this._ondrain = T : this.destroyed || T()) : T();
          }, p.prototype._finish = function(c) {
            var H = this;
            this.emit("preend"), u(this, function() {
              var T, q;
              T = H._forwardEnd && H._writable, q = function() {
                H._writableState.prefinished === !1 && (H._writableState.prefinished = !0), H.emit("prefinish"), u(H, c);
              }, T ? T._writableState && T._writableState.finished ? q() : T._writableState ? T.end(q) : (T.end(), q()) : q();
            });
          }, p.prototype.end = function(c, H, T) {
            return typeof c == "function" ? this.end(null, null, c) : typeof H == "function" ? this.end(c, null, H) : (this._ended = !0, c && this.write(c), this._writableState.ending || this._writableState.destroyed || this.write(v), a.Writable.prototype.end.call(this, T));
          }, r.exports = p;
        }).call(this);
      }).call(this, t("_process"), t("buffer").Buffer);
    }, { _process: 50, buffer: 17, "end-of-stream": 21, inherits: 24, "readable-stream": 69, "stream-shift": 74 }], 21: [function(t, r, n) {
      (function(i) {
        (function() {
          var s = t("once"), a = function() {
          }, f = function(o, d, v) {
            if (typeof d == "function")
              return f(o, null, d);
            d || (d = {}), v = s(v || a);
            var u = o._writableState, l = o._readableState, P = d.readable || d.readable !== !1 && o.readable, p = d.writable || d.writable !== !1 && o.writable, c = !1, H = function() {
              o.writable || T();
            }, T = function() {
              p = !1, P || v.call(o);
            }, q = function() {
              P = !1, p || v.call(o);
            }, b = function(N) {
              v.call(o, N ? new Error("exited with error code: " + N) : null);
            }, j = function(N) {
              v.call(o, N);
            }, w = function() {
              i.nextTick(m);
            }, m = function() {
              if (!c)
                return (!P || l && l.ended && !l.destroyed) && (!p || u && u.ended && !u.destroyed) ? void 0 : v.call(o, new Error("premature close"));
            }, I = function() {
              o.req.on("finish", T);
            };
            return function(N) {
              return N.setHeader && typeof N.abort == "function";
            }(o) ? (o.on("complete", T), o.on("abort", w), o.req ? I() : o.on("request", I)) : p && !u && (o.on("end", H), o.on("close", H)), function(N) {
              return N.stdio && Array.isArray(N.stdio) && N.stdio.length === 3;
            }(o) && o.on("exit", b), o.on("end", q), o.on("finish", T), d.error !== !1 && o.on("error", j), o.on("close", w), function() {
              c = !0, o.removeListener("complete", T), o.removeListener("abort", w), o.removeListener("request", I), o.req && o.req.removeListener("finish", T), o.removeListener("end", H), o.removeListener("close", H), o.removeListener("finish", T), o.removeListener("exit", b), o.removeListener("end", q), o.removeListener("error", j), o.removeListener("close", w);
            };
          };
          r.exports = f;
        }).call(this);
      }).call(this, t("_process"));
    }, { _process: 50, once: 48 }], 22: [function(t, r, n) {
      var i = Object.create || function(q) {
        var b = function() {
        };
        return b.prototype = q, new b();
      }, s = Object.keys || function(q) {
        var b = [];
        for (var j in q)
          Object.prototype.hasOwnProperty.call(q, j) && b.push(j);
        return j;
      }, a = Function.prototype.bind || function(q) {
        var b = this;
        return function() {
          return b.apply(q, arguments);
        };
      };
      function f() {
        this._events && Object.prototype.hasOwnProperty.call(this, "_events") || (this._events = i(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
      }
      r.exports = f, f.EventEmitter = f, f.prototype._events = void 0, f.prototype._maxListeners = void 0;
      var o, d = 10;
      try {
        var v = {};
        Object.defineProperty && Object.defineProperty(v, "x", { value: 0 }), o = v.x === 0;
      } catch {
        o = !1;
      }
      function u(q) {
        return q._maxListeners === void 0 ? f.defaultMaxListeners : q._maxListeners;
      }
      function l(q, b, j, w) {
        var m, I, N;
        if (typeof j != "function")
          throw new TypeError('"listener" argument must be a function');
        if ((I = q._events) ? (I.newListener && (q.emit("newListener", b, j.listener ? j.listener : j), I = q._events), N = I[b]) : (I = q._events = i(null), q._eventsCount = 0), N) {
          if (typeof N == "function" ? N = I[b] = w ? [j, N] : [N, j] : w ? N.unshift(j) : N.push(j), !N.warned && (m = u(q)) && m > 0 && N.length > m) {
            N.warned = !0;
            var k = new Error("Possible EventEmitter memory leak detected. " + N.length + ' "' + String(b) + '" listeners added. Use emitter.setMaxListeners() to increase limit.');
            k.name = "MaxListenersExceededWarning", k.emitter = q, k.type = b, k.count = N.length, typeof console == "object" && console.warn && console.warn("%s: %s", k.name, k.message);
          }
        } else
          N = I[b] = j, ++q._eventsCount;
        return q;
      }
      function P() {
        if (!this.fired)
          switch (this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length) {
            case 0:
              return this.listener.call(this.target);
            case 1:
              return this.listener.call(this.target, arguments[0]);
            case 2:
              return this.listener.call(this.target, arguments[0], arguments[1]);
            case 3:
              return this.listener.call(this.target, arguments[0], arguments[1], arguments[2]);
            default:
              for (var q = new Array(arguments.length), b = 0; b < q.length; ++b)
                q[b] = arguments[b];
              this.listener.apply(this.target, q);
          }
      }
      function p(q, b, j) {
        var w = { fired: !1, wrapFn: void 0, target: q, type: b, listener: j }, m = a.call(P, w);
        return m.listener = j, w.wrapFn = m, m;
      }
      function c(q, b, j) {
        var w = q._events;
        if (!w)
          return [];
        var m = w[b];
        return m ? typeof m == "function" ? j ? [m.listener || m] : [m] : j ? function(I) {
          for (var N = new Array(I.length), k = 0; k < N.length; ++k)
            N[k] = I[k].listener || I[k];
          return N;
        }(m) : T(m, m.length) : [];
      }
      function H(q) {
        var b = this._events;
        if (b) {
          var j = b[q];
          if (typeof j == "function")
            return 1;
          if (j)
            return j.length;
        }
        return 0;
      }
      function T(q, b) {
        for (var j = new Array(b), w = 0; w < b; ++w)
          j[w] = q[w];
        return j;
      }
      o ? Object.defineProperty(f, "defaultMaxListeners", { enumerable: !0, get: function() {
        return d;
      }, set: function(q) {
        if (typeof q != "number" || q < 0 || q != q)
          throw new TypeError('"defaultMaxListeners" must be a positive number');
        d = q;
      } }) : f.defaultMaxListeners = d, f.prototype.setMaxListeners = function(q) {
        if (typeof q != "number" || q < 0 || isNaN(q))
          throw new TypeError('"n" argument must be a positive number');
        return this._maxListeners = q, this;
      }, f.prototype.getMaxListeners = function() {
        return u(this);
      }, f.prototype.emit = function(q) {
        var b, j, w, m, I, N, k = q === "error";
        if (N = this._events)
          k = k && N.error == null;
        else if (!k)
          return !1;
        if (k) {
          if (arguments.length > 1 && (b = arguments[1]), b instanceof Error)
            throw b;
          var R = new Error('Unhandled "error" event. (' + b + ")");
          throw R.context = b, R;
        }
        if (!(j = N[q]))
          return !1;
        var y = typeof j == "function";
        switch (w = arguments.length) {
          case 1:
            (function(O, Y, ee) {
              if (Y)
                O.call(ee);
              else
                for (var Z = O.length, te = T(O, Z), fe = 0; fe < Z; ++fe)
                  te[fe].call(ee);
            })(j, y, this);
            break;
          case 2:
            (function(O, Y, ee, Z) {
              if (Y)
                O.call(ee, Z);
              else
                for (var te = O.length, fe = T(O, te), _ = 0; _ < te; ++_)
                  fe[_].call(ee, Z);
            })(j, y, this, arguments[1]);
            break;
          case 3:
            (function(O, Y, ee, Z, te) {
              if (Y)
                O.call(ee, Z, te);
              else
                for (var fe = O.length, _ = T(O, fe), G = 0; G < fe; ++G)
                  _[G].call(ee, Z, te);
            })(j, y, this, arguments[1], arguments[2]);
            break;
          case 4:
            (function(O, Y, ee, Z, te, fe) {
              if (Y)
                O.call(ee, Z, te, fe);
              else
                for (var _ = O.length, G = T(O, _), L = 0; L < _; ++L)
                  G[L].call(ee, Z, te, fe);
            })(j, y, this, arguments[1], arguments[2], arguments[3]);
            break;
          default:
            for (m = new Array(w - 1), I = 1; I < w; I++)
              m[I - 1] = arguments[I];
            (function(O, Y, ee, Z) {
              if (Y)
                O.apply(ee, Z);
              else
                for (var te = O.length, fe = T(O, te), _ = 0; _ < te; ++_)
                  fe[_].apply(ee, Z);
            })(j, y, this, m);
        }
        return !0;
      }, f.prototype.addListener = function(q, b) {
        return l(this, q, b, !1);
      }, f.prototype.on = f.prototype.addListener, f.prototype.prependListener = function(q, b) {
        return l(this, q, b, !0);
      }, f.prototype.once = function(q, b) {
        if (typeof b != "function")
          throw new TypeError('"listener" argument must be a function');
        return this.on(q, p(this, q, b)), this;
      }, f.prototype.prependOnceListener = function(q, b) {
        if (typeof b != "function")
          throw new TypeError('"listener" argument must be a function');
        return this.prependListener(q, p(this, q, b)), this;
      }, f.prototype.removeListener = function(q, b) {
        var j, w, m, I, N;
        if (typeof b != "function")
          throw new TypeError('"listener" argument must be a function');
        if (!(w = this._events))
          return this;
        if (!(j = w[q]))
          return this;
        if (j === b || j.listener === b)
          --this._eventsCount == 0 ? this._events = i(null) : (delete w[q], w.removeListener && this.emit("removeListener", q, j.listener || b));
        else if (typeof j != "function") {
          for (m = -1, I = j.length - 1; I >= 0; I--)
            if (j[I] === b || j[I].listener === b) {
              N = j[I].listener, m = I;
              break;
            }
          if (m < 0)
            return this;
          m === 0 ? j.shift() : function(k, R) {
            for (var y = R, O = y + 1, Y = k.length; O < Y; y += 1, O += 1)
              k[y] = k[O];
            k.pop();
          }(j, m), j.length === 1 && (w[q] = j[0]), w.removeListener && this.emit("removeListener", q, N || b);
        }
        return this;
      }, f.prototype.removeAllListeners = function(q) {
        var b, j, w;
        if (!(j = this._events))
          return this;
        if (!j.removeListener)
          return arguments.length === 0 ? (this._events = i(null), this._eventsCount = 0) : j[q] && (--this._eventsCount == 0 ? this._events = i(null) : delete j[q]), this;
        if (arguments.length === 0) {
          var m, I = s(j);
          for (w = 0; w < I.length; ++w)
            (m = I[w]) !== "removeListener" && this.removeAllListeners(m);
          return this.removeAllListeners("removeListener"), this._events = i(null), this._eventsCount = 0, this;
        }
        if (typeof (b = j[q]) == "function")
          this.removeListener(q, b);
        else if (b)
          for (w = b.length - 1; w >= 0; w--)
            this.removeListener(q, b[w]);
        return this;
      }, f.prototype.listeners = function(q) {
        return c(this, q, !0);
      }, f.prototype.rawListeners = function(q) {
        return c(this, q, !1);
      }, f.listenerCount = function(q, b) {
        return typeof q.listenerCount == "function" ? q.listenerCount(b) : H.call(q, b);
      }, f.prototype.listenerCount = H, f.prototype.eventNames = function() {
        return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
      };
    }, {}], 23: [function(t, r, n) {
      n.read = function(i, s, a, f, o) {
        var d, v, u = 8 * o - f - 1, l = (1 << u) - 1, P = l >> 1, p = -7, c = a ? o - 1 : 0, H = a ? -1 : 1, T = i[s + c];
        for (c += H, d = T & (1 << -p) - 1, T >>= -p, p += u; p > 0; d = 256 * d + i[s + c], c += H, p -= 8)
          ;
        for (v = d & (1 << -p) - 1, d >>= -p, p += f; p > 0; v = 256 * v + i[s + c], c += H, p -= 8)
          ;
        if (d === 0)
          d = 1 - P;
        else {
          if (d === l)
            return v ? NaN : 1 / 0 * (T ? -1 : 1);
          v += Math.pow(2, f), d -= P;
        }
        return (T ? -1 : 1) * v * Math.pow(2, d - f);
      }, n.write = function(i, s, a, f, o, d) {
        var v, u, l, P = 8 * d - o - 1, p = (1 << P) - 1, c = p >> 1, H = o === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, T = f ? 0 : d - 1, q = f ? 1 : -1, b = s < 0 || s === 0 && 1 / s < 0 ? 1 : 0;
        for (s = Math.abs(s), isNaN(s) || s === 1 / 0 ? (u = isNaN(s) ? 1 : 0, v = p) : (v = Math.floor(Math.log(s) / Math.LN2), s * (l = Math.pow(2, -v)) < 1 && (v--, l *= 2), (s += v + c >= 1 ? H / l : H * Math.pow(2, 1 - c)) * l >= 2 && (v++, l /= 2), v + c >= p ? (u = 0, v = p) : v + c >= 1 ? (u = (s * l - 1) * Math.pow(2, o), v += c) : (u = s * Math.pow(2, c - 1) * Math.pow(2, o), v = 0)); o >= 8; i[a + T] = 255 & u, T += q, u /= 256, o -= 8)
          ;
        for (v = v << o | u, P += o; P > 0; i[a + T] = 255 & v, T += q, v /= 256, P -= 8)
          ;
        i[a + T - q] |= 128 * b;
      };
    }, {}], 24: [function(t, r, n) {
      typeof Object.create == "function" ? r.exports = function(i, s) {
        s && (i.super_ = s, i.prototype = Object.create(s.prototype, { constructor: { value: i, enumerable: !1, writable: !0, configurable: !0 } }));
      } : r.exports = function(i, s) {
        if (s) {
          i.super_ = s;
          var a = function() {
          };
          a.prototype = s.prototype, i.prototype = new a(), i.prototype.constructor = i;
        }
      };
    }, {}], 25: [function(t, r, n) {
      Object.defineProperty(n, "__esModule", { value: !0 });
      var i = function() {
        function s(a, f) {
          this.color = !0, this.key = void 0, this.value = void 0, this.parent = void 0, this.brother = void 0, this.leftChild = void 0, this.rightChild = void 0, this.key = a, this.value = f;
        }
        return s.prototype.rotateLeft = function() {
          var a = this.parent, f = this.brother, o = this.leftChild, d = this.rightChild;
          if (!d)
            throw new Error("unknown error");
          var v = d.leftChild, u = d.rightChild;
          return a && (a.leftChild === this ? a.leftChild = d : a.rightChild === this && (a.rightChild = d)), d.parent = a, d.brother = f, d.leftChild = this, d.rightChild = u, f && (f.brother = d), this.parent = d, this.brother = u, this.leftChild = o, this.rightChild = v, u && (u.parent = d, u.brother = this), o && (o.parent = this, o.brother = v), v && (v.parent = this, v.brother = o), d;
        }, s.prototype.rotateRight = function() {
          var a = this.parent, f = this.brother, o = this.leftChild;
          if (!o)
            throw new Error("unknown error");
          var d = this.rightChild, v = o.leftChild, u = o.rightChild;
          return a && (a.leftChild === this ? a.leftChild = o : a.rightChild === this && (a.rightChild = o)), o.parent = a, o.brother = f, o.leftChild = v, o.rightChild = this, f && (f.brother = o), v && (v.parent = o, v.brother = this), this.parent = o, this.brother = v, this.leftChild = u, this.rightChild = d, u && (u.parent = this, u.brother = d), d && (d.parent = this, d.brother = u), o;
        }, s.prototype.remove = function() {
          if (this.leftChild || this.rightChild)
            throw new Error("can only remove leaf node");
          this.parent && (this === this.parent.leftChild ? this.parent.leftChild = void 0 : this === this.parent.rightChild && (this.parent.rightChild = void 0)), this.brother && (this.brother.brother = void 0), this.key = void 0, this.value = void 0, this.parent = void 0, this.brother = void 0;
        }, s.TreeNodeColorType = { red: !0, black: !1 }, s;
      }();
      Object.freeze(i), n.default = i;
    }, {}], 26: [function(t, r, n) {
      var i = this && this.__generator || function(a, f) {
        var o, d, v, u, l = { label: 0, sent: function() {
          if (1 & v[0])
            throw v[1];
          return v[1];
        }, trys: [], ops: [] };
        return u = { next: P(0), throw: P(1), return: P(2) }, typeof Symbol == "function" && (u[Symbol.iterator] = function() {
          return this;
        }), u;
        function P(p) {
          return function(c) {
            return function(H) {
              if (o)
                throw new TypeError("Generator is already executing.");
              for (; l; )
                try {
                  if (o = 1, d && (v = 2 & H[0] ? d.return : H[0] ? d.throw || ((v = d.return) && v.call(d), 0) : d.next) && !(v = v.call(d, H[1])).done)
                    return v;
                  switch (d = 0, v && (H = [2 & H[0], v.value]), H[0]) {
                    case 0:
                    case 1:
                      v = H;
                      break;
                    case 4:
                      return l.label++, { value: H[1], done: !1 };
                    case 5:
                      l.label++, d = H[1], H = [0];
                      continue;
                    case 7:
                      H = l.ops.pop(), l.trys.pop();
                      continue;
                    default:
                      if (!(v = (v = l.trys).length > 0 && v[v.length - 1]) && (H[0] === 6 || H[0] === 2)) {
                        l = 0;
                        continue;
                      }
                      if (H[0] === 3 && (!v || H[1] > v[0] && H[1] < v[3])) {
                        l.label = H[1];
                        break;
                      }
                      if (H[0] === 6 && l.label < v[1]) {
                        l.label = v[1], v = H;
                        break;
                      }
                      if (v && l.label < v[2]) {
                        l.label = v[2], l.ops.push(H);
                        break;
                      }
                      v[2] && l.ops.pop(), l.trys.pop();
                      continue;
                  }
                  H = f.call(a, l);
                } catch (T) {
                  H = [6, T], d = 0;
                } finally {
                  o = v = 0;
                }
              if (5 & H[0])
                throw H[1];
              return { value: H[0] ? H[1] : void 0, done: !0 };
            }([p, c]);
          };
        }
      };
      function s(a) {
        var f = this;
        a === void 0 && (a = []);
        var o = [], d = 0, v = 0, u = 0, l = 0, P = 0, p = 0;
        this.size = function() {
          return p;
        }, this.empty = function() {
          return p === 0;
        }, this.clear = function() {
          d = u = v = l = P = p = 0, H.call(this, s.bucketSize), p = 0;
        }, this.front = function() {
          return o[d][v];
        }, this.back = function() {
          return o[u][l];
        }, this.forEach = function(T) {
          if (!this.empty()) {
            var q = 0;
            if (d !== u) {
              for (j = v; j < s.bucketSize; ++j)
                T(o[d][j], q++);
              for (j = d + 1; j < u; ++j)
                for (var b = 0; b < s.bucketSize; ++b)
                  T(o[j][b], q++);
              for (j = 0; j <= l; ++j)
                T(o[u][j], q++);
            } else
              for (var j = v; j <= l; ++j)
                T(o[d][j], q++);
          }
        };
        var c = function(T) {
          var q = d * s.bucketSize + v, b = q + T, j = u * s.bucketSize + l;
          if (b < q || b > j)
            throw new Error("pos should more than 0 and less than queue's size");
          return { curNodeBucketIndex: Math.floor(b / s.bucketSize), curNodePointerIndex: b % s.bucketSize };
        };
        this.getElementByPos = function(T) {
          var q = c(T), b = q.curNodeBucketIndex, j = q.curNodePointerIndex;
          return o[b][j];
        }, this.eraseElementByPos = function(T) {
          var q = this;
          if (T < 0 || T > p)
            throw new Error("pos should more than 0 and less than queue's size");
          if (T === 0)
            this.popFront();
          else if (T === this.size())
            this.popBack();
          else {
            for (var b = [], j = T + 1; j < p; ++j)
              b.push(this.getElementByPos(j));
            this.cut(T), this.popBack(), b.forEach(function(w) {
              return q.pushBack(w);
            });
          }
        }, this.eraseElementByValue = function(T) {
          if (!this.empty()) {
            var q = [];
            this.forEach(function(w) {
              w !== T && q.push(w);
            });
            for (var b = q.length, j = 0; j < b; ++j)
              this.setElementByPos(j, q[j]);
            this.cut(b - 1);
          }
        };
        var H = function(T) {
          for (var q = [], b = T * s.sigma, j = Math.max(Math.ceil(b / s.bucketSize), 2), w = 0; w < j; ++w)
            q.push(new Array(s.bucketSize));
          var m = Math.ceil(T / s.bucketSize), I = Math.floor(j / 2) - Math.floor(m / 2), N = I, k = 0;
          if (this.size())
            for (w = 0; w < m; ++w) {
              for (var R = 0; R < s.bucketSize; ++R)
                if (q[I + w][R] = this.front(), this.popFront(), this.empty()) {
                  N = I + w, k = R;
                  break;
                }
              if (this.empty())
                break;
            }
          o = q, d = I, v = 0, u = N, l = k, P = j, p = T;
        };
        this.pushBack = function(T) {
          this.empty() || (u === P - 1 && l === s.bucketSize - 1 && H.call(this, this.size()), l < s.bucketSize - 1 ? ++l : u < P - 1 && (++u, l = 0)), ++p, o[u][l] = T;
        }, this.popBack = function() {
          this.empty() || (this.size() !== 1 && (l > 0 ? --l : d < u && (--u, l = s.bucketSize - 1)), p > 0 && --p);
        }, this.setElementByPos = function(T, q) {
          var b = c(T), j = b.curNodeBucketIndex, w = b.curNodePointerIndex;
          o[j][w] = q;
        }, this.insert = function(T, q, b) {
          var j = this;
          if (b === void 0 && (b = 1), T === 0)
            for (; b--; )
              this.pushFront(q);
          else if (T === this.size())
            for (; b--; )
              this.pushBack(q);
          else {
            for (var w = [], m = T; m < p; ++m)
              w.push(this.getElementByPos(m));
            for (this.cut(T - 1), m = 0; m < b; ++m)
              this.pushBack(q);
            w.forEach(function(I) {
              return j.pushBack(I);
            });
          }
        }, this.find = function(T) {
          if (d === u) {
            for (var q = v; q <= l; ++q)
              if (o[d][q] === T)
                return !0;
            return !1;
          }
          for (q = v; q < s.bucketSize; ++q)
            if (o[d][q] === T)
              return !0;
          for (q = d + 1; q < u; ++q)
            for (var b = 0; b < s.bucketSize; ++b)
              if (o[q][b] === T)
                return !0;
          for (q = 0; q <= l; ++q)
            if (o[u][q] === T)
              return !0;
          return !1;
        }, this.reverse = function() {
          for (var T = 0, q = p - 1; T < q; ) {
            var b = this.getElementByPos(T);
            this.setElementByPos(T, this.getElementByPos(q)), this.setElementByPos(q, b), ++T, --q;
          }
        }, this.unique = function() {
          if (!this.empty()) {
            var T = [], q = this.front();
            this.forEach(function(j, w) {
              w !== 0 && j === q || (T.push(j), q = j);
            });
            for (var b = 0; b < p; ++b)
              this.setElementByPos(b, T[b]);
            this.cut(T.length - 1);
          }
        }, this.sort = function(T) {
          var q = [];
          this.forEach(function(j) {
            q.push(j);
          }), q.sort(T);
          for (var b = 0; b < p; ++b)
            this.setElementByPos(b, q[b]);
        }, this.pushFront = function(T) {
          this.empty() || (d === 0 && v === 0 && H.call(this, this.size()), v > 0 ? --v : d > 0 && (--d, v = s.bucketSize - 1)), ++p, o[d][v] = T;
        }, this.popFront = function() {
          this.empty() || (this.size() !== 1 && (v < s.bucketSize - 1 ? ++v : d < u && (++d, v = 0)), p > 0 && --p);
        }, this.shrinkToFit = function() {
          var T = this, q = [];
          this.forEach(function(m) {
            q.push(m);
          });
          var b = q.length;
          o = [];
          for (var j = Math.ceil(b / s.bucketSize), w = 0; w < j; ++w)
            o.push(new Array(s.bucketSize));
          this.clear(), q.forEach(function(m) {
            return T.pushBack(m);
          });
        }, this.cut = function(T) {
          if (T < 0)
            this.clear();
          else {
            var q = c(T), b = q.curNodeBucketIndex, j = q.curNodePointerIndex;
            u = b, l = j, p = T + 1;
          }
        }, this[Symbol.iterator] = function() {
          return function() {
            var T, q;
            return i(this, function(b) {
              switch (b.label) {
                case 0:
                  if (p === 0)
                    return [2];
                  if (d !== u)
                    return [3, 5];
                  q = v, b.label = 1;
                case 1:
                  return q <= l ? [4, o[d][q]] : [3, 4];
                case 2:
                  b.sent(), b.label = 3;
                case 3:
                  return ++q, [3, 1];
                case 4:
                  return [2];
                case 5:
                  q = v, b.label = 6;
                case 6:
                  return q < s.bucketSize ? [4, o[d][q]] : [3, 9];
                case 7:
                  b.sent(), b.label = 8;
                case 8:
                  return ++q, [3, 6];
                case 9:
                  q = d + 1, b.label = 10;
                case 10:
                  if (!(q < u))
                    return [3, 15];
                  T = 0, b.label = 11;
                case 11:
                  return T < s.bucketSize ? [4, o[q][T]] : [3, 14];
                case 12:
                  b.sent(), b.label = 13;
                case 13:
                  return ++T, [3, 11];
                case 14:
                  return ++q, [3, 10];
                case 15:
                  q = 0, b.label = 16;
                case 16:
                  return q <= l ? [4, o[u][q]] : [3, 19];
                case 17:
                  b.sent(), b.label = 18;
                case 18:
                  return ++q, [3, 16];
                case 19:
                  return [2];
              }
            });
          }();
        }, function() {
          var T = s.bucketSize;
          a.size ? T = a.size() : a.length && (T = a.length);
          var q = T * s.sigma;
          P = Math.ceil(q / s.bucketSize), P = Math.max(P, 3);
          for (var b = 0; b < P; ++b)
            o.push(new Array(s.bucketSize));
          var j = Math.ceil(T / s.bucketSize);
          d = Math.floor(P / 2) - Math.floor(j / 2), u = d, a.forEach(function(w) {
            return f.pushBack(w);
          });
        }(), Object.freeze(this);
      }
      Object.defineProperty(n, "__esModule", { value: !0 }), s.sigma = 3, s.bucketSize = 5e3, Object.freeze(s), n.default = s;
    }, {}], 27: [function(t, r, n) {
      var i = this && this.__generator || function(d, v) {
        var u, l, P, p, c = { label: 0, sent: function() {
          if (1 & P[0])
            throw P[1];
          return P[1];
        }, trys: [], ops: [] };
        return p = { next: H(0), throw: H(1), return: H(2) }, typeof Symbol == "function" && (p[Symbol.iterator] = function() {
          return this;
        }), p;
        function H(T) {
          return function(q) {
            return function(b) {
              if (u)
                throw new TypeError("Generator is already executing.");
              for (; c; )
                try {
                  if (u = 1, l && (P = 2 & b[0] ? l.return : b[0] ? l.throw || ((P = l.return) && P.call(l), 0) : l.next) && !(P = P.call(l, b[1])).done)
                    return P;
                  switch (l = 0, P && (b = [2 & b[0], P.value]), b[0]) {
                    case 0:
                    case 1:
                      P = b;
                      break;
                    case 4:
                      return c.label++, { value: b[1], done: !1 };
                    case 5:
                      c.label++, l = b[1], b = [0];
                      continue;
                    case 7:
                      b = c.ops.pop(), c.trys.pop();
                      continue;
                    default:
                      if (!(P = (P = c.trys).length > 0 && P[P.length - 1]) && (b[0] === 6 || b[0] === 2)) {
                        c = 0;
                        continue;
                      }
                      if (b[0] === 3 && (!P || b[1] > P[0] && b[1] < P[3])) {
                        c.label = b[1];
                        break;
                      }
                      if (b[0] === 6 && c.label < P[1]) {
                        c.label = P[1], P = b;
                        break;
                      }
                      if (P && c.label < P[2]) {
                        c.label = P[2], c.ops.push(b);
                        break;
                      }
                      P[2] && c.ops.pop(), c.trys.pop();
                      continue;
                  }
                  b = v.call(d, c);
                } catch (j) {
                  b = [6, j], l = 0;
                } finally {
                  u = P = 0;
                }
              if (5 & b[0])
                throw b[1];
              return { value: b[0] ? b[1] : void 0, done: !0 };
            }([T, q]);
          };
        }
      }, s = this && this.__values || function(d) {
        var v = typeof Symbol == "function" && Symbol.iterator, u = v && d[v], l = 0;
        if (u)
          return u.call(d);
        if (d && typeof d.length == "number")
          return { next: function() {
            return d && l >= d.length && (d = void 0), { value: d && d[l++], done: !d };
          } };
        throw new TypeError(v ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(n, "__esModule", { value: !0 });
      var a = t("../LinkList/LinkList"), f = t("../Map/Map");
      function o(d, v, u) {
        var l = this;
        if (d === void 0 && (d = []), v === void 0 && (v = o.initSize), u = u || function(H) {
          var T, q, b = 0, j = "";
          if (typeof H == "number")
            b = ((b = Math.floor(H)) << 5) - b, b &= b;
          else {
            j = typeof H != "string" ? JSON.stringify(H) : H;
            try {
              for (var w = s(j), m = w.next(); !m.done; m = w.next())
                b = (b << 5) - b + m.value.charCodeAt(0), b &= b;
            } catch (I) {
              T = { error: I };
            } finally {
              try {
                m && !m.done && (q = w.return) && q.call(w);
              } finally {
                if (T)
                  throw T.error;
              }
            }
          }
          return b ^= b >>> 16;
        }, (v & v - 1) != 0)
          throw new Error("initBucketNum must be 2 to the power of n");
        var P = 0, p = [], c = Math.max(o.initSize, Math.min(o.maxSize, v));
        this.size = function() {
          return P;
        }, this.empty = function() {
          return P === 0;
        }, this.clear = function() {
          P = 0, c = v, p = [];
        }, this.forEach = function(H) {
          var T = 0;
          p.forEach(function(q) {
            q.forEach(function(b) {
              H(b, T++);
            });
          });
        }, this.setElement = function(H, T) {
          var q, b;
          if (H == null)
            throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");
          if (T != null) {
            var j = u(H) & c - 1;
            if (p[j]) {
              var w = p[j].size();
              if (p[j] instanceof a.default) {
                try {
                  for (var m = s(p[j]), I = m.next(); !I.done; I = m.next()) {
                    var N = I.value;
                    if (N.key === H)
                      return void (N.value = T);
                  }
                } catch (R) {
                  q = { error: R };
                } finally {
                  try {
                    I && !I.done && (b = m.return) && b.call(m);
                  } finally {
                    if (q)
                      throw q.error;
                  }
                }
                p[j].pushBack({ key: H, value: T }), p[j].size() >= o.treeifyThreshold && (p[j] = new f.default(p[j]));
              } else
                p[j].setElement(H, T);
              var k = p[j].size();
              P += k - w;
            } else
              ++P, p[j] = new a.default([{ key: H, value: T }]);
            P > c * o.sigma && (function(R) {
              if (!(R >= o.maxSize)) {
                c = 2 * R;
                var y = [];
                p.forEach(function(O, Y) {
                  if (!O.empty()) {
                    if (O instanceof a.default && O.size() === 1) {
                      var ee = O.front(), Z = ee.key, te = ee.value;
                      y[u(Z) & c - 1] = new a.default([{ key: Z, value: te }]);
                    } else if (O instanceof f.default) {
                      var fe = new a.default(), _ = new a.default();
                      O.forEach(function($) {
                        u($.key) & R ? _.pushBack($) : fe.pushBack($);
                      }), fe.size() > o.untreeifyThreshold ? y[Y] = new f.default(fe) : fe.size() && (y[Y] = fe), _.size() > o.untreeifyThreshold ? y[Y + R] = new f.default(_) : _.size() && (y[Y + R] = _);
                    } else {
                      var G = new a.default(), L = new a.default();
                      O.forEach(function($) {
                        u($.key) & R ? L.pushBack($) : G.pushBack($);
                      }), G.size() && (y[Y] = G), L.size() && (y[Y + R] = L);
                    }
                    p[Y].clear();
                  }
                }), p = y;
              }
            }).call(this, c);
          } else
            this.eraseElementByKey(H);
        }, this.getElementByKey = function(H) {
          var T, q, b = u(H) & c - 1;
          if (p[b]) {
            if (p[b] instanceof f.default)
              return p[b].getElementByKey(H);
            try {
              for (var j = s(p[b]), w = j.next(); !w.done; w = j.next()) {
                var m = w.value;
                if (m.key === H)
                  return m.value;
              }
            } catch (I) {
              T = { error: I };
            } finally {
              try {
                w && !w.done && (q = j.return) && q.call(j);
              } finally {
                if (T)
                  throw T.error;
              }
            }
          }
        }, this.eraseElementByKey = function(H) {
          var T, q, b = u(H) & c - 1;
          if (p[b]) {
            var j = p[b].size();
            if (p[b] instanceof f.default)
              p[b].eraseElementByKey(H), p[b].size() <= o.untreeifyThreshold && (p[b] = new a.default(p[b]));
            else {
              var w = -1;
              try {
                for (var m = s(p[b]), I = m.next(); !I.done; I = m.next())
                  if (++w, I.value.key === H) {
                    p[b].eraseElementByPos(w);
                    break;
                  }
              } catch (k) {
                T = { error: k };
              } finally {
                try {
                  I && !I.done && (q = m.return) && q.call(m);
                } finally {
                  if (T)
                    throw T.error;
                }
              }
            }
            var N = p[b].size();
            P += N - j;
          }
        }, this.find = function(H) {
          var T, q, b = u(H) & c - 1;
          if (!p[b])
            return !1;
          if (p[b] instanceof f.default)
            return p[b].find(H);
          try {
            for (var j = s(p[b]), w = j.next(); !w.done; w = j.next())
              if (w.value.key === H)
                return !0;
          } catch (m) {
            T = { error: m };
          } finally {
            try {
              w && !w.done && (q = j.return) && q.call(j);
            } finally {
              if (T)
                throw T.error;
            }
          }
          return !1;
        }, this[Symbol.iterator] = function() {
          return function() {
            var H, T, q, b, j, w;
            return i(this, function(m) {
              switch (m.label) {
                case 0:
                  H = 0, m.label = 1;
                case 1:
                  if (!(H < c))
                    return [3, 10];
                  for (; H < c && !p[H]; )
                    ++H;
                  if (H >= c)
                    return [3, 10];
                  m.label = 2;
                case 2:
                  m.trys.push([2, 7, 8, 9]), j = void 0, T = s(p[H]), q = T.next(), m.label = 3;
                case 3:
                  return q.done ? [3, 6] : [4, q.value];
                case 4:
                  m.sent(), m.label = 5;
                case 5:
                  return q = T.next(), [3, 3];
                case 6:
                  return [3, 9];
                case 7:
                  return b = m.sent(), j = { error: b }, [3, 9];
                case 8:
                  try {
                    q && !q.done && (w = T.return) && w.call(T);
                  } finally {
                    if (j)
                      throw j.error;
                  }
                  return [7];
                case 9:
                  return ++H, [3, 1];
                case 10:
                  return [2];
              }
            });
          }();
        }, d.forEach(function(H) {
          var T = H.key, q = H.value;
          return l.setElement(T, q);
        }), Object.freeze(this);
      }
      o.initSize = 16, o.maxSize = 1 << 30, o.sigma = 0.75, o.treeifyThreshold = 8, o.untreeifyThreshold = 6, o.minTreeifySize = 64, Object.freeze(o), n.default = o;
    }, { "../LinkList/LinkList": 29, "../Map/Map": 30 }], 28: [function(t, r, n) {
      var i = this && this.__generator || function(d, v) {
        var u, l, P, p, c = { label: 0, sent: function() {
          if (1 & P[0])
            throw P[1];
          return P[1];
        }, trys: [], ops: [] };
        return p = { next: H(0), throw: H(1), return: H(2) }, typeof Symbol == "function" && (p[Symbol.iterator] = function() {
          return this;
        }), p;
        function H(T) {
          return function(q) {
            return function(b) {
              if (u)
                throw new TypeError("Generator is already executing.");
              for (; c; )
                try {
                  if (u = 1, l && (P = 2 & b[0] ? l.return : b[0] ? l.throw || ((P = l.return) && P.call(l), 0) : l.next) && !(P = P.call(l, b[1])).done)
                    return P;
                  switch (l = 0, P && (b = [2 & b[0], P.value]), b[0]) {
                    case 0:
                    case 1:
                      P = b;
                      break;
                    case 4:
                      return c.label++, { value: b[1], done: !1 };
                    case 5:
                      c.label++, l = b[1], b = [0];
                      continue;
                    case 7:
                      b = c.ops.pop(), c.trys.pop();
                      continue;
                    default:
                      if (!(P = (P = c.trys).length > 0 && P[P.length - 1]) && (b[0] === 6 || b[0] === 2)) {
                        c = 0;
                        continue;
                      }
                      if (b[0] === 3 && (!P || b[1] > P[0] && b[1] < P[3])) {
                        c.label = b[1];
                        break;
                      }
                      if (b[0] === 6 && c.label < P[1]) {
                        c.label = P[1], P = b;
                        break;
                      }
                      if (P && c.label < P[2]) {
                        c.label = P[2], c.ops.push(b);
                        break;
                      }
                      P[2] && c.ops.pop(), c.trys.pop();
                      continue;
                  }
                  b = v.call(d, c);
                } catch (j) {
                  b = [6, j], l = 0;
                } finally {
                  u = P = 0;
                }
              if (5 & b[0])
                throw b[1];
              return { value: b[0] ? b[1] : void 0, done: !0 };
            }([T, q]);
          };
        }
      }, s = this && this.__values || function(d) {
        var v = typeof Symbol == "function" && Symbol.iterator, u = v && d[v], l = 0;
        if (u)
          return u.call(d);
        if (d && typeof d.length == "number")
          return { next: function() {
            return d && l >= d.length && (d = void 0), { value: d && d[l++], done: !d };
          } };
        throw new TypeError(v ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(n, "__esModule", { value: !0 });
      var a = t("../Set/Set"), f = t("../LinkList/LinkList");
      function o(d, v, u) {
        var l = this;
        if (d === void 0 && (d = []), v === void 0 && (v = o.initSize), u = u || function(H) {
          var T = 0, q = "";
          if (typeof H == "number")
            T = ((T = Math.floor(H)) << 5) - T, T &= T;
          else {
            q = typeof H != "string" ? JSON.stringify(H) : H;
            for (var b = 0; b < q.length; b++)
              T = (T << 5) - T + q.charCodeAt(b), T &= T;
          }
          return T ^= T >>> 16;
        }, (v & v - 1) != 0)
          throw new Error("initBucketNum must be 2 to the power of n");
        var P = 0, p = [], c = Math.max(o.initSize, Math.min(o.maxSize, v));
        this.size = function() {
          return P;
        }, this.empty = function() {
          return P === 0;
        }, this.clear = function() {
          P = 0, c = v, p = [];
        }, this.forEach = function(H) {
          var T = 0;
          p.forEach(function(q) {
            q.forEach(function(b) {
              H(b, T++);
            });
          });
        }, this.insert = function(H) {
          if (H == null)
            throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");
          var T = u(H) & c - 1;
          if (p[T]) {
            var q = p[T].size();
            if (p[T] instanceof f.default) {
              if (p[T].find(H))
                return;
              p[T].pushBack(H), p[T].size() >= o.treeifyThreshold && (p[T] = new a.default(p[T]));
            } else
              p[T].insert(H);
            var b = p[T].size();
            P += b - q;
          } else
            p[T] = new f.default([H]), ++P;
          P > c * o.sigma && (function(j) {
            if (!(j >= o.maxSize)) {
              c = 2 * j;
              var w = [];
              p.forEach(function(m, I) {
                if (!m.empty()) {
                  if (m instanceof f.default && m.size() === 1) {
                    var N = m.front();
                    if (N === void 0)
                      throw new Error("unknown error");
                    w[u(N) & c - 1] = new f.default([N]);
                  } else if (m instanceof a.default) {
                    var k = new f.default(), R = new f.default();
                    m.forEach(function(Y) {
                      u(Y) & j ? R.pushBack(Y) : k.pushBack(Y);
                    }), k.size() > o.untreeifyThreshold ? w[I] = new a.default(k) : k.size() && (w[I] = k), R.size() > o.untreeifyThreshold ? w[I + j] = new a.default(R) : R.size() && (w[I + j] = R);
                  } else {
                    var y = new f.default(), O = new f.default();
                    m.forEach(function(Y) {
                      u(Y) & j ? O.pushBack(Y) : y.pushBack(Y);
                    }), y.size() && (w[I] = y), O.size() && (w[I + j] = O);
                  }
                  p[I].clear();
                }
              }), p = w;
            }
          }).call(this, c);
        }, this.eraseElementByValue = function(H) {
          var T = u(H) & c - 1;
          if (p[T]) {
            var q = p[T].size();
            p[T].eraseElementByValue(H), p[T] instanceof a.default && p[T].size() <= o.untreeifyThreshold && (p[T] = new f.default(p[T]));
            var b = p[T].size();
            P += b - q;
          }
        }, this.find = function(H) {
          var T = u(H) & c - 1;
          return !!p[T] && p[T].find(H);
        }, this[Symbol.iterator] = function() {
          return function() {
            var H, T, q, b, j, w;
            return i(this, function(m) {
              switch (m.label) {
                case 0:
                  H = 0, m.label = 1;
                case 1:
                  if (!(H < c))
                    return [3, 10];
                  for (; H < c && !p[H]; )
                    ++H;
                  if (H >= c)
                    return [3, 10];
                  m.label = 2;
                case 2:
                  m.trys.push([2, 7, 8, 9]), j = void 0, T = s(p[H]), q = T.next(), m.label = 3;
                case 3:
                  return q.done ? [3, 6] : [4, q.value];
                case 4:
                  m.sent(), m.label = 5;
                case 5:
                  return q = T.next(), [3, 3];
                case 6:
                  return [3, 9];
                case 7:
                  return b = m.sent(), j = { error: b }, [3, 9];
                case 8:
                  try {
                    q && !q.done && (w = T.return) && w.call(T);
                  } finally {
                    if (j)
                      throw j.error;
                  }
                  return [7];
                case 9:
                  return ++H, [3, 1];
                case 10:
                  return [2];
              }
            });
          }();
        }, d.forEach(function(H) {
          return l.insert(H);
        }), Object.freeze(this);
      }
      o.initSize = 16, o.maxSize = 1 << 30, o.sigma = 0.75, o.treeifyThreshold = 8, o.untreeifyThreshold = 6, o.minTreeifySize = 64, Object.freeze(o), n.default = o;
    }, { "../LinkList/LinkList": 29, "../Set/Set": 33 }], 29: [function(t, r, n) {
      var i = this && this.__generator || function(f, o) {
        var d, v, u, l, P = { label: 0, sent: function() {
          if (1 & u[0])
            throw u[1];
          return u[1];
        }, trys: [], ops: [] };
        return l = { next: p(0), throw: p(1), return: p(2) }, typeof Symbol == "function" && (l[Symbol.iterator] = function() {
          return this;
        }), l;
        function p(c) {
          return function(H) {
            return function(T) {
              if (d)
                throw new TypeError("Generator is already executing.");
              for (; P; )
                try {
                  if (d = 1, v && (u = 2 & T[0] ? v.return : T[0] ? v.throw || ((u = v.return) && u.call(v), 0) : v.next) && !(u = u.call(v, T[1])).done)
                    return u;
                  switch (v = 0, u && (T = [2 & T[0], u.value]), T[0]) {
                    case 0:
                    case 1:
                      u = T;
                      break;
                    case 4:
                      return P.label++, { value: T[1], done: !1 };
                    case 5:
                      P.label++, v = T[1], T = [0];
                      continue;
                    case 7:
                      T = P.ops.pop(), P.trys.pop();
                      continue;
                    default:
                      if (!(u = (u = P.trys).length > 0 && u[u.length - 1]) && (T[0] === 6 || T[0] === 2)) {
                        P = 0;
                        continue;
                      }
                      if (T[0] === 3 && (!u || T[1] > u[0] && T[1] < u[3])) {
                        P.label = T[1];
                        break;
                      }
                      if (T[0] === 6 && P.label < u[1]) {
                        P.label = u[1], u = T;
                        break;
                      }
                      if (u && P.label < u[2]) {
                        P.label = u[2], P.ops.push(T);
                        break;
                      }
                      u[2] && P.ops.pop(), P.trys.pop();
                      continue;
                  }
                  T = o.call(f, P);
                } catch (q) {
                  T = [6, q], v = 0;
                } finally {
                  d = u = 0;
                }
              if (5 & T[0])
                throw T[1];
              return { value: T[0] ? T[1] : void 0, done: !0 };
            }([c, H]);
          };
        }
      };
      Object.defineProperty(n, "__esModule", { value: !0 });
      var s = /* @__PURE__ */ function() {
        return function(f) {
          this.value = void 0, this.pre = void 0, this.next = void 0, this.value = f;
        };
      }();
      function a(f) {
        var o = this;
        f === void 0 && (f = []);
        var d = 0, v = void 0, u = void 0;
        this.size = function() {
          return d;
        }, this.empty = function() {
          return d === 0;
        }, this.clear = function() {
          v = u = void 0, d = 0;
        }, this.front = function() {
          return v == null ? void 0 : v.value;
        }, this.back = function() {
          return u == null ? void 0 : u.value;
        }, this.forEach = function(l) {
          for (var P = v, p = 0; P; ) {
            if (P.value === void 0)
              throw new Error("unknown error");
            l(P.value, p++), P = P.next;
          }
        }, this.getElementByPos = function(l) {
          if (l < 0 || l >= d)
            throw new Error("pos must more then 0 and less then the list length");
          for (var P = v; l-- && P; )
            P = P.next;
          if (!P || P.value === void 0)
            throw new Error("unknown error");
          return P.value;
        }, this.eraseElementByPos = function(l) {
          if (l < 0 || l >= d)
            throw new Error("erase pos must more then 0 and less then the list length");
          if (l === 0)
            this.popFront();
          else if (l === d - 1)
            this.popBack();
          else {
            for (var P = v; l--; ) {
              if (!(P != null && P.next))
                throw new Error("unknown error");
              P = P.next;
            }
            if (!P || !P.pre || !P.next)
              throw new Error("unknown error");
            var p = P.pre, c = P.next;
            c.pre = p, p.next = c, d > 0 && --d;
          }
        }, this.eraseElementByValue = function(l) {
          for (; v && v.value === l; )
            this.popFront();
          for (; u && u.value === l; )
            this.popBack();
          if (v)
            for (var P = v; P; ) {
              if (P.value === l) {
                var p = P.pre, c = P.next;
                c && (c.pre = p), p && (p.next = c), d > 0 && --d;
              }
              P = P.next;
            }
        }, this.pushBack = function(l) {
          if (l == null)
            throw new Error("you can't push null or undefined here");
          ++d;
          var P = new s(l);
          u ? (u.next = P, P.pre = u, u = P) : v = u = P;
        }, this.popBack = function() {
          u && (d > 0 && --d, u && (v === u ? v = u = void 0 : (u = u.pre) && (u.next = void 0)));
        }, this.setElementByPos = function(l, P) {
          if (P == null)
            throw new Error("you can't set null or undefined here");
          if (l < 0 || l >= d)
            throw new Error("pos must more then 0 and less then the list length");
          for (var p = v; l--; ) {
            if (!p)
              throw new Error("unknown error");
            p = p.next;
          }
          p && (p.value = P);
        }, this.insert = function(l, P, p) {
          if (p === void 0 && (p = 1), P == null)
            throw new Error("you can't insert null or undefined here");
          if (l < 0 || l > d)
            throw new Error("insert pos must more then 0 and less then or equal to the list length");
          if (p < 0)
            throw new Error("insert size must more than 0");
          if (l === 0)
            for (; p--; )
              this.pushFront(P);
          else if (l === d)
            for (; p--; )
              this.pushBack(P);
          else {
            for (var c = v, H = 1; H < l; ++H) {
              if (!(c != null && c.next))
                throw new Error("unknown error");
              c = c == null ? void 0 : c.next;
            }
            if (!c)
              throw new Error("unknown error");
            var T = c.next;
            for (d += p; p--; )
              c.next = new s(P), c.next.pre = c, c = c.next;
            c.next = T, T && (T.pre = c);
          }
        }, this.find = function(l) {
          for (var P = v; P; ) {
            if (P.value === l)
              return !0;
            P = P.next;
          }
          return !1;
        }, this.reverse = function() {
          for (var l = v, P = u, p = 0; l && P && 2 * p < d; ) {
            var c = l.value;
            l.value = P.value, P.value = c, l = l.next, P = P.pre, ++p;
          }
        }, this.unique = function() {
          for (var l = v; l; ) {
            for (var P = l; P && P.next && P.value === P.next.value; )
              P = P.next, d > 0 && --d;
            l.next = P.next, l.next && (l.next.pre = l), l = l.next;
          }
        }, this.sort = function(l) {
          var P = [];
          this.forEach(function(c) {
            P.push(c);
          }), P.sort(l);
          var p = v;
          P.forEach(function(c) {
            p && (p.value = c, p = p.next);
          });
        }, this.pushFront = function(l) {
          if (l == null)
            throw new Error("you can't push null or undefined here");
          ++d;
          var P = new s(l);
          v ? (P.next = v, v.pre = P, v = P) : v = u = P;
        }, this.popFront = function() {
          v && (d > 0 && --d, v && (v === u ? v = u = void 0 : (v = v.next) && (v.pre = void 0)));
        }, this.merge = function(l) {
          var P = this, p = v;
          l.forEach(function(c) {
            for (; p && p.value !== void 0 && p.value <= c; )
              p = p.next;
            if (p === void 0)
              P.pushBack(c), p = u;
            else if (p === v)
              P.pushFront(c), p = v;
            else {
              ++d;
              var H = p.pre;
              H && (H.next = new s(c), H.next.pre = H, H.next.next = p, p && (p.pre = H.next));
            }
          });
        }, this[Symbol.iterator] = function() {
          return function() {
            var l;
            return i(this, function(P) {
              switch (P.label) {
                case 0:
                  l = v, P.label = 1;
                case 1:
                  if (l === void 0)
                    return [3, 3];
                  if (!l.value)
                    throw new Error("unknown error");
                  return [4, l.value];
                case 2:
                  return P.sent(), l = l.next, [3, 1];
                case 3:
                  return [2];
              }
            });
          }();
        }, f.forEach(function(l) {
          return o.pushBack(l);
        }), Object.freeze(this);
      }
      Object.freeze(a), n.default = a;
    }, {}], 30: [function(t, r, n) {
      var i = this && this.__generator || function(o, d) {
        var v, u, l, P, p = { label: 0, sent: function() {
          if (1 & l[0])
            throw l[1];
          return l[1];
        }, trys: [], ops: [] };
        return P = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (P[Symbol.iterator] = function() {
          return this;
        }), P;
        function c(H) {
          return function(T) {
            return function(q) {
              if (v)
                throw new TypeError("Generator is already executing.");
              for (; p; )
                try {
                  if (v = 1, u && (l = 2 & q[0] ? u.return : q[0] ? u.throw || ((l = u.return) && l.call(u), 0) : u.next) && !(l = l.call(u, q[1])).done)
                    return l;
                  switch (u = 0, l && (q = [2 & q[0], l.value]), q[0]) {
                    case 0:
                    case 1:
                      l = q;
                      break;
                    case 4:
                      return p.label++, { value: q[1], done: !1 };
                    case 5:
                      p.label++, u = q[1], q = [0];
                      continue;
                    case 7:
                      q = p.ops.pop(), p.trys.pop();
                      continue;
                    default:
                      if (!(l = (l = p.trys).length > 0 && l[l.length - 1]) && (q[0] === 6 || q[0] === 2)) {
                        p = 0;
                        continue;
                      }
                      if (q[0] === 3 && (!l || q[1] > l[0] && q[1] < l[3])) {
                        p.label = q[1];
                        break;
                      }
                      if (q[0] === 6 && p.label < l[1]) {
                        p.label = l[1], l = q;
                        break;
                      }
                      if (l && p.label < l[2]) {
                        p.label = l[2], p.ops.push(q);
                        break;
                      }
                      l[2] && p.ops.pop(), p.trys.pop();
                      continue;
                  }
                  q = d.call(o, p);
                } catch (b) {
                  q = [6, b], u = 0;
                } finally {
                  v = l = 0;
                }
              if (5 & q[0])
                throw q[1];
              return { value: q[0] ? q[1] : void 0, done: !0 };
            }([H, T]);
          };
        }
      }, s = this && this.__values || function(o) {
        var d = typeof Symbol == "function" && Symbol.iterator, v = d && o[d], u = 0;
        if (v)
          return v.call(o);
        if (o && typeof o.length == "number")
          return { next: function() {
            return o && u >= o.length && (o = void 0), { value: o && o[u++], done: !o };
          } };
        throw new TypeError(d ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(n, "__esModule", { value: !0 });
      var a = t("../Base/TreeNode");
      function f(o, d) {
        var v = this;
        o === void 0 && (o = []), d = d || function(R, y) {
          return R < y ? -1 : R > y ? 1 : 0;
        };
        var u = 0, l = new a.default();
        l.color = a.default.TreeNodeColorType.black, this.size = function() {
          return u;
        }, this.empty = function() {
          return u === 0;
        }, this.clear = function() {
          u = 0, l.key = l.value = void 0, l.leftChild = l.rightChild = l.brother = void 0;
        };
        var P = function(R) {
          if (!R || R.key === void 0)
            throw new Error("unknown error");
          return R.leftChild ? P(R.leftChild) : R;
        }, p = function(R) {
          if (!R || R.key === void 0)
            throw new Error("unknown error");
          return R.rightChild ? p(R.rightChild) : R;
        };
        this.front = function() {
          if (!this.empty()) {
            var R = P(l);
            if (R.key === void 0 || R.value === void 0)
              throw new Error("unknown error");
            return { key: R.key, value: R.value };
          }
        }, this.back = function() {
          if (!this.empty()) {
            var R = p(l);
            if (R.key === void 0 || R.value === void 0)
              throw new Error("unknown error");
            return { key: R.key, value: R.value };
          }
        }, this.forEach = function(R) {
          var y, O, Y = 0;
          try {
            for (var ee = s(this), Z = ee.next(); !Z.done; Z = ee.next())
              R(Z.value, Y++);
          } catch (te) {
            y = { error: te };
          } finally {
            try {
              Z && !Z.done && (O = ee.return) && O.call(ee);
            } finally {
              if (y)
                throw y.error;
            }
          }
        }, this.getElementByPos = function(R) {
          var y, O;
          if (R < 0 || R >= this.size())
            throw new Error("pos must more than 0 and less than set's size");
          var Y = 0;
          try {
            for (var ee = s(this), Z = ee.next(); !Z.done; Z = ee.next()) {
              var te = Z.value;
              if (Y === R)
                return te;
              ++Y;
            }
          } catch (fe) {
            y = { error: fe };
          } finally {
            try {
              Z && !Z.done && (O = ee.return) && O.call(ee);
            } finally {
              if (y)
                throw y.error;
            }
          }
          throw new Error("unknown Error");
        };
        var c = function(R, y) {
          if (R && R.key !== void 0 && R.value !== void 0) {
            var O = d(R.key, y);
            return O === 0 ? { key: R.key, value: R.value } : O < 0 ? c(R.rightChild, y) : c(R.leftChild, y) || { key: R.key, value: R.value };
          }
        };
        this.lowerBound = function(R) {
          return c(l, R);
        };
        var H = function(R, y) {
          if (R && R.key !== void 0 && R.value !== void 0)
            return d(R.key, y) <= 0 ? H(R.rightChild, y) : H(R.leftChild, y) || { key: R.key, value: R.value };
        };
        this.upperBound = function(R) {
          return H(l, R);
        };
        var T = function(R, y) {
          if (R && R.key !== void 0 && R.value !== void 0) {
            var O = d(R.key, y);
            return O === 0 ? { key: R.key, value: R.value } : O > 0 ? T(R.leftChild, y) : T(R.rightChild, y) || { key: R.key, value: R.value };
          }
        };
        this.reverseLowerBound = function(R) {
          return T(l, R);
        };
        var q = function(R, y) {
          if (R && R.key !== void 0 && R.value !== void 0)
            return d(R.key, y) >= 0 ? q(R.leftChild, y) : q(R.rightChild, y) || { key: R.key, value: R.value };
        };
        this.reverseUpperBound = function(R) {
          return q(l, R);
        };
        var b = function(R) {
          var y = R.parent;
          if (!y) {
            if (R === l)
              return;
            throw new Error("unknown error");
          }
          if (R.color !== a.default.TreeNodeColorType.red) {
            var O = R.brother;
            if (!O)
              throw new Error("unknown error");
            if (R === y.leftChild)
              if (O.color === a.default.TreeNodeColorType.red) {
                O.color = a.default.TreeNodeColorType.black, y.color = a.default.TreeNodeColorType.red;
                var Y = y.rotateLeft();
                l === y && (l = Y), b(R);
              } else
                O.color === a.default.TreeNodeColorType.black && (O.rightChild && O.rightChild.color === a.default.TreeNodeColorType.red ? (O.color = y.color, y.color = a.default.TreeNodeColorType.black, O.rightChild && (O.rightChild.color = a.default.TreeNodeColorType.black), Y = y.rotateLeft(), l === y && (l = Y), R.color = a.default.TreeNodeColorType.black) : O.rightChild && O.rightChild.color !== a.default.TreeNodeColorType.black || !O.leftChild || O.leftChild.color !== a.default.TreeNodeColorType.red ? O.leftChild && O.leftChild.color !== a.default.TreeNodeColorType.black || O.rightChild && O.rightChild.color !== a.default.TreeNodeColorType.black || (O.color = a.default.TreeNodeColorType.red, b(y)) : (O.color = a.default.TreeNodeColorType.red, O.leftChild && (O.leftChild.color = a.default.TreeNodeColorType.black), Y = O.rotateRight(), l === O && (l = Y), b(R)));
            else
              R === y.rightChild && (O.color === a.default.TreeNodeColorType.red ? (O.color = a.default.TreeNodeColorType.black, y.color = a.default.TreeNodeColorType.red, Y = y.rotateRight(), l === y && (l = Y), b(R)) : O.color === a.default.TreeNodeColorType.black && (O.leftChild && O.leftChild.color === a.default.TreeNodeColorType.red ? (O.color = y.color, y.color = a.default.TreeNodeColorType.black, O.leftChild && (O.leftChild.color = a.default.TreeNodeColorType.black), Y = y.rotateRight(), l === y && (l = Y), R.color = a.default.TreeNodeColorType.black) : O.leftChild && O.leftChild.color !== a.default.TreeNodeColorType.black || !O.rightChild || O.rightChild.color !== a.default.TreeNodeColorType.red ? O.leftChild && O.leftChild.color !== a.default.TreeNodeColorType.black || O.rightChild && O.rightChild.color !== a.default.TreeNodeColorType.black || (O.color = a.default.TreeNodeColorType.red, b(y)) : (O.color = a.default.TreeNodeColorType.red, O.rightChild && (O.rightChild.color = a.default.TreeNodeColorType.black), Y = O.rotateLeft(), l === O && (l = Y), b(R))));
          } else
            R.color = a.default.TreeNodeColorType.black;
        }, j = function(R) {
          for (var y = R; y.leftChild || y.rightChild; ) {
            if (y.rightChild) {
              y = P(y.rightChild);
              var O = R.key;
              R.key = y.key, y.key = O;
              var Y = R.value;
              R.value = y.value, y.value = Y, R = y;
            }
            y.leftChild && (y = p(y.leftChild), O = R.key, R.key = y.key, y.key = O, Y = R.value, R.value = y.value, y.value = Y, R = y);
          }
          b(y), y && y.remove(), --u, l.color = a.default.TreeNodeColorType.black;
        }, w = function(R, y) {
          return !(!R || R.key === void 0) && (!!w(R.leftChild, y) || !!y(R) || w(R.rightChild, y));
        };
        this.eraseElementByPos = function(R) {
          if (R < 0 || R >= u)
            throw new Error("pos must more than 0 and less than set's size");
          var y = 0;
          w(l, function(O) {
            return R === y ? (j(O), !0) : (++y, !1);
          });
        }, this.eraseElementByKey = function(R) {
          if (!this.empty()) {
            var y = N(l, R);
            y !== void 0 && y.key !== void 0 && d(y.key, R) === 0 && j(y);
          }
        };
        var m = function(R, y) {
          if (!R || R.key === void 0)
            throw new Error("unknown error");
          var O = d(y, R.key);
          return O < 0 ? R.leftChild ? m(R.leftChild, y) : (R.leftChild = new a.default(), R.leftChild.parent = R, R.leftChild.brother = R.rightChild, R.rightChild && (R.rightChild.brother = R.leftChild), R.leftChild) : O > 0 ? R.rightChild ? m(R.rightChild, y) : (R.rightChild = new a.default(), R.rightChild.parent = R, R.rightChild.brother = R.leftChild, R.leftChild && (R.leftChild.brother = R.rightChild), R.rightChild) : R;
        }, I = function(R) {
          var y = R.parent;
          if (!y) {
            if (R === l)
              return;
            throw new Error("unknown error");
          }
          if (y.color !== a.default.TreeNodeColorType.black && y.color === a.default.TreeNodeColorType.red) {
            var O = y.brother, Y = y.parent;
            if (!Y)
              throw new Error("unknown error");
            if (O && O.color === a.default.TreeNodeColorType.red)
              O.color = y.color = a.default.TreeNodeColorType.black, Y.color = a.default.TreeNodeColorType.red, I(Y);
            else if (!O || O.color === a.default.TreeNodeColorType.black)
              if (y === Y.leftChild)
                if (R === y.leftChild) {
                  y.color = a.default.TreeNodeColorType.black, Y.color = a.default.TreeNodeColorType.red;
                  var ee = Y.rotateRight();
                  Y === l && (l = ee);
                } else
                  R === y.rightChild && (ee = y.rotateLeft(), Y === l && (l = ee), I(y));
              else
                y === Y.rightChild && (R === y.leftChild ? (ee = y.rotateRight(), Y === l && (l = ee), I(y)) : R === y.rightChild && (y.color = a.default.TreeNodeColorType.black, Y.color = a.default.TreeNodeColorType.red, ee = Y.rotateLeft(), Y === l && (l = ee)));
          }
        };
        this.setElement = function(R, y) {
          if (R == null)
            throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");
          if (y != null) {
            if (this.empty())
              return ++u, l.key = R, l.value = y, void (l.color = a.default.TreeNodeColorType.black);
            var O = m(l, R);
            O.key === void 0 || d(O.key, R) !== 0 ? (++u, O.key = R, O.value = y, I(O), l.color = a.default.TreeNodeColorType.black) : O.value = y;
          } else
            this.eraseElementByKey(R);
        };
        var N = function(R, y) {
          if (R && R.key !== void 0) {
            var O = d(y, R.key);
            return O < 0 ? N(R.leftChild, y) : O > 0 ? N(R.rightChild, y) : R;
          }
        };
        this.find = function(R) {
          return !!N(l, R);
        }, this.getElementByKey = function(R) {
          var y = N(l, R);
          if ((y == null ? void 0 : y.key) === void 0 || (y == null ? void 0 : y.value) === void 0)
            throw new Error("unknown error");
          return y.value;
        }, this.union = function(R) {
          var y = this;
          R.forEach(function(O) {
            var Y = O.key, ee = O.value;
            return y.setElement(Y, ee);
          });
        }, this.getHeight = function() {
          if (this.empty())
            return 0;
          var R = function(y) {
            return y ? Math.max(R(y.leftChild), R(y.rightChild)) + 1 : 1;
          };
          return R(l);
        };
        var k = function(R) {
          return i(this, function(y) {
            switch (y.label) {
              case 0:
                return R && R.key !== void 0 && R.value !== void 0 ? [5, s(k(R.leftChild))] : [2];
              case 1:
                return y.sent(), [4, { key: R.key, value: R.value }];
              case 2:
                return y.sent(), [5, s(k(R.rightChild))];
              case 3:
                return y.sent(), [2];
            }
          });
        };
        this[Symbol.iterator] = function() {
          return k(l);
        }, o.forEach(function(R) {
          var y = R.key, O = R.value;
          return v.setElement(y, O);
        }), Object.freeze(this);
      }
      Object.freeze(f), n.default = f;
    }, { "../Base/TreeNode": 25 }], 31: [function(t, r, n) {
      function i(s, a) {
        s === void 0 && (s = []), a = a || function(u, l) {
          return u > l ? -1 : u < l ? 1 : 0;
        };
        var f = [];
        s.forEach(function(u) {
          return f.push(u);
        });
        var o = f.length, d = function(u, l) {
          if (u < 0 || u >= o)
            throw new Error("unknown error");
          if (l < 0 || l >= o)
            throw new Error("unknown error");
          var P = f[u];
          f[u] = f[l], f[l] = P;
        }, v = function(u) {
          if (u < 0 || u >= o)
            throw new Error("unknown error");
          var l = 2 * u + 1, P = 2 * u + 2;
          l < o && a(f[u], f[l]) > 0 && d(u, l), P < o && a(f[u], f[P]) > 0 && d(u, P);
        };
        (function() {
          for (var u = Math.floor((o - 1) / 2); u >= 0; --u)
            for (var l = u, P = 2 * l + 1; P < o; ) {
              var p = P + 1, c = P;
              if (p < o && a(f[P], f[p]) > 0 && (c = p), a(f[l], f[c]) <= 0)
                break;
              d(l, c), P = 2 * (l = c) + 1;
            }
        })(), this.size = function() {
          return o;
        }, this.empty = function() {
          return o === 0;
        }, this.clear = function() {
          o = 0, f.length = 0;
        }, this.push = function(u) {
          if (f.push(u), ++o !== 1)
            for (var l = o - 1; l > 0; ) {
              var P = Math.floor((l - 1) / 2);
              if (a(f[P], u) <= 0)
                break;
              v(P), l = P;
            }
        }, this.pop = function() {
          if (!this.empty())
            if (this.size() !== 1) {
              var u = f[o - 1];
              --o;
              for (var l = 0; l < this.size(); ) {
                var P = 2 * l + 1, p = 2 * l + 2;
                if (P >= this.size())
                  break;
                var c = P;
                if (p < this.size() && a(f[P], f[p]) > 0 && (c = p), a(f[c], u) >= 0)
                  break;
                f[l] = f[c], l = c;
              }
              f[l] = u;
            } else
              --o;
        }, this.top = function() {
          return f[0];
        }, Object.freeze(this);
      }
      Object.defineProperty(n, "__esModule", { value: !0 }), Object.freeze(i), n.default = i;
    }, {}], 32: [function(t, r, n) {
      Object.defineProperty(n, "__esModule", { value: !0 });
      var i = t("../LinkList/LinkList");
      function s(a) {
        a === void 0 && (a = []);
        var f = new i.default(a);
        this.size = function() {
          return f.size();
        }, this.empty = function() {
          return f.empty();
        }, this.clear = function() {
          f.clear();
        }, this.push = function(o) {
          f.pushBack(o);
        }, this.pop = function() {
          f.popFront();
        }, this.front = function() {
          return f.front();
        }, Object.freeze(this);
      }
      Object.freeze(s), n.default = s;
    }, { "../LinkList/LinkList": 29 }], 33: [function(t, r, n) {
      var i = this && this.__generator || function(o, d) {
        var v, u, l, P, p = { label: 0, sent: function() {
          if (1 & l[0])
            throw l[1];
          return l[1];
        }, trys: [], ops: [] };
        return P = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (P[Symbol.iterator] = function() {
          return this;
        }), P;
        function c(H) {
          return function(T) {
            return function(q) {
              if (v)
                throw new TypeError("Generator is already executing.");
              for (; p; )
                try {
                  if (v = 1, u && (l = 2 & q[0] ? u.return : q[0] ? u.throw || ((l = u.return) && l.call(u), 0) : u.next) && !(l = l.call(u, q[1])).done)
                    return l;
                  switch (u = 0, l && (q = [2 & q[0], l.value]), q[0]) {
                    case 0:
                    case 1:
                      l = q;
                      break;
                    case 4:
                      return p.label++, { value: q[1], done: !1 };
                    case 5:
                      p.label++, u = q[1], q = [0];
                      continue;
                    case 7:
                      q = p.ops.pop(), p.trys.pop();
                      continue;
                    default:
                      if (!(l = (l = p.trys).length > 0 && l[l.length - 1]) && (q[0] === 6 || q[0] === 2)) {
                        p = 0;
                        continue;
                      }
                      if (q[0] === 3 && (!l || q[1] > l[0] && q[1] < l[3])) {
                        p.label = q[1];
                        break;
                      }
                      if (q[0] === 6 && p.label < l[1]) {
                        p.label = l[1], l = q;
                        break;
                      }
                      if (l && p.label < l[2]) {
                        p.label = l[2], p.ops.push(q);
                        break;
                      }
                      l[2] && p.ops.pop(), p.trys.pop();
                      continue;
                  }
                  q = d.call(o, p);
                } catch (b) {
                  q = [6, b], u = 0;
                } finally {
                  v = l = 0;
                }
              if (5 & q[0])
                throw q[1];
              return { value: q[0] ? q[1] : void 0, done: !0 };
            }([H, T]);
          };
        }
      }, s = this && this.__values || function(o) {
        var d = typeof Symbol == "function" && Symbol.iterator, v = d && o[d], u = 0;
        if (v)
          return v.call(o);
        if (o && typeof o.length == "number")
          return { next: function() {
            return o && u >= o.length && (o = void 0), { value: o && o[u++], done: !o };
          } };
        throw new TypeError(d ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(n, "__esModule", { value: !0 });
      var a = t("../Base/TreeNode");
      function f(o, d) {
        var v = this;
        o === void 0 && (o = []), d = d || function(R, y) {
          return R < y ? -1 : R > y ? 1 : 0;
        };
        var u = 0, l = new a.default();
        l.color = a.default.TreeNodeColorType.black, this.size = function() {
          return u;
        }, this.empty = function() {
          return u === 0;
        }, this.clear = function() {
          u = 0, l.key = void 0, l.leftChild = l.rightChild = l.brother = l.parent = void 0, l.color = a.default.TreeNodeColorType.black;
        };
        var P = function(R) {
          if (!R || R.key === void 0)
            throw new Error("unknown error");
          return R.leftChild ? P(R.leftChild) : R;
        }, p = function(R) {
          if (!R || R.key === void 0)
            throw new Error("unknown error");
          return R.rightChild ? p(R.rightChild) : R;
        };
        this.front = function() {
          if (!this.empty())
            return P(l).key;
        }, this.back = function() {
          if (!this.empty())
            return p(l).key;
        }, this.forEach = function(R) {
          var y, O, Y = 0;
          try {
            for (var ee = s(this), Z = ee.next(); !Z.done; Z = ee.next())
              R(Z.value, Y++);
          } catch (te) {
            y = { error: te };
          } finally {
            try {
              Z && !Z.done && (O = ee.return) && O.call(ee);
            } finally {
              if (y)
                throw y.error;
            }
          }
        }, this.getElementByPos = function(R) {
          var y, O;
          if (R < 0 || R >= this.size())
            throw new Error("pos must more than 0 and less than set's size");
          var Y = 0;
          try {
            for (var ee = s(this), Z = ee.next(); !Z.done; Z = ee.next()) {
              var te = Z.value;
              if (Y === R)
                return te;
              ++Y;
            }
          } catch (fe) {
            y = { error: fe };
          } finally {
            try {
              Z && !Z.done && (O = ee.return) && O.call(ee);
            } finally {
              if (y)
                throw y.error;
            }
          }
          throw new Error("unknown error");
        };
        var c = function(R) {
          var y = R.parent;
          if (!y) {
            if (R === l)
              return;
            throw new Error("unknown error");
          }
          if (R.color !== a.default.TreeNodeColorType.red) {
            var O = R.brother;
            if (!O)
              throw new Error("unknown error");
            if (R === y.leftChild)
              if (O.color === a.default.TreeNodeColorType.red) {
                O.color = a.default.TreeNodeColorType.black, y.color = a.default.TreeNodeColorType.red;
                var Y = y.rotateLeft();
                l === y && (l = Y), c(R);
              } else
                O.color === a.default.TreeNodeColorType.black && (O.rightChild && O.rightChild.color === a.default.TreeNodeColorType.red ? (O.color = y.color, y.color = a.default.TreeNodeColorType.black, O.rightChild && (O.rightChild.color = a.default.TreeNodeColorType.black), Y = y.rotateLeft(), l === y && (l = Y), R.color = a.default.TreeNodeColorType.black) : O.rightChild && O.rightChild.color !== a.default.TreeNodeColorType.black || !O.leftChild || O.leftChild.color !== a.default.TreeNodeColorType.red ? O.leftChild && O.leftChild.color !== a.default.TreeNodeColorType.black || O.rightChild && O.rightChild.color !== a.default.TreeNodeColorType.black || (O.color = a.default.TreeNodeColorType.red, c(y)) : (O.color = a.default.TreeNodeColorType.red, O.leftChild && (O.leftChild.color = a.default.TreeNodeColorType.black), Y = O.rotateRight(), l === O && (l = Y), c(R)));
            else
              R === y.rightChild && (O.color === a.default.TreeNodeColorType.red ? (O.color = a.default.TreeNodeColorType.black, y.color = a.default.TreeNodeColorType.red, Y = y.rotateRight(), l === y && (l = Y), c(R)) : O.color === a.default.TreeNodeColorType.black && (O.leftChild && O.leftChild.color === a.default.TreeNodeColorType.red ? (O.color = y.color, y.color = a.default.TreeNodeColorType.black, O.leftChild && (O.leftChild.color = a.default.TreeNodeColorType.black), Y = y.rotateRight(), l === y && (l = Y), R.color = a.default.TreeNodeColorType.black) : O.leftChild && O.leftChild.color !== a.default.TreeNodeColorType.black || !O.rightChild || O.rightChild.color !== a.default.TreeNodeColorType.red ? O.leftChild && O.leftChild.color !== a.default.TreeNodeColorType.black || O.rightChild && O.rightChild.color !== a.default.TreeNodeColorType.black || (O.color = a.default.TreeNodeColorType.red, c(y)) : (O.color = a.default.TreeNodeColorType.red, O.rightChild && (O.rightChild.color = a.default.TreeNodeColorType.black), Y = O.rotateLeft(), l === O && (l = Y), c(R))));
          } else
            R.color = a.default.TreeNodeColorType.black;
        }, H = function(R) {
          for (var y = R; y.leftChild || y.rightChild; ) {
            if (y.rightChild) {
              y = P(y.rightChild);
              var O = R.key;
              R.key = y.key, y.key = O, R = y;
            }
            y.leftChild && (y = p(y.leftChild), O = R.key, R.key = y.key, y.key = O, R = y);
          }
          c(y), y && y.remove(), --u, l.color = a.default.TreeNodeColorType.black;
        }, T = function(R, y) {
          return !(!R || R.key === void 0) && (!!T(R.leftChild, y) || !!y(R) || T(R.rightChild, y));
        };
        this.eraseElementByPos = function(R) {
          if (R < 0 || R >= u)
            throw new Error("pos must more than 0 and less than set's size");
          var y = 0;
          T(l, function(O) {
            return R === y ? (H(O), !0) : (++y, !1);
          });
        }, this.eraseElementByValue = function(R) {
          if (!this.empty()) {
            var y = j(l, R);
            y !== void 0 && y.key !== void 0 && d(y.key, R) === 0 && H(y);
          }
        };
        var q = function(R, y) {
          if (!R || R.key === void 0)
            throw new Error("unknown error");
          var O = d(y, R.key);
          return O < 0 ? R.leftChild ? q(R.leftChild, y) : (R.leftChild = new a.default(), R.leftChild.parent = R, R.leftChild.brother = R.rightChild, R.rightChild && (R.rightChild.brother = R.leftChild), R.leftChild) : O > 0 ? R.rightChild ? q(R.rightChild, y) : (R.rightChild = new a.default(), R.rightChild.parent = R, R.rightChild.brother = R.leftChild, R.leftChild && (R.leftChild.brother = R.rightChild), R.rightChild) : R;
        }, b = function(R) {
          var y = R.parent;
          if (!y) {
            if (R === l)
              return;
            throw new Error("unknown error");
          }
          if (y.color !== a.default.TreeNodeColorType.black && y.color === a.default.TreeNodeColorType.red) {
            var O = y.brother, Y = y.parent;
            if (!Y)
              throw new Error("unknown error");
            if (O && O.color === a.default.TreeNodeColorType.red)
              O.color = y.color = a.default.TreeNodeColorType.black, Y.color = a.default.TreeNodeColorType.red, b(Y);
            else if (!O || O.color === a.default.TreeNodeColorType.black)
              if (y === Y.leftChild)
                if (R === y.leftChild) {
                  y.color = a.default.TreeNodeColorType.black, Y.color = a.default.TreeNodeColorType.red;
                  var ee = Y.rotateRight();
                  Y === l && (l = ee);
                } else
                  R === y.rightChild && (ee = y.rotateLeft(), Y === l && (l = ee), b(y));
              else
                y === Y.rightChild && (R === y.leftChild ? (ee = y.rotateRight(), Y === l && (l = ee), b(y)) : R === y.rightChild && (y.color = a.default.TreeNodeColorType.black, Y.color = a.default.TreeNodeColorType.red, ee = Y.rotateLeft(), Y === l && (l = ee)));
          }
        };
        this.insert = function(R) {
          if (R == null)
            throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");
          if (this.empty())
            return ++u, l.key = R, void (l.color = a.default.TreeNodeColorType.black);
          var y = q(l, R);
          y.key !== void 0 && d(y.key, R) === 0 || (++u, y.key = R, b(y), l.color = a.default.TreeNodeColorType.black);
        };
        var j = function(R, y) {
          if (R && R.key !== void 0) {
            var O = d(y, R.key);
            return O < 0 ? j(R.leftChild, y) : O > 0 ? j(R.rightChild, y) : R;
          }
        };
        this.find = function(R) {
          var y = j(l, R);
          return y !== void 0 && y.key !== void 0 && d(y.key, R) === 0;
        };
        var w = function(R, y) {
          if (R && R.key !== void 0) {
            var O = d(R.key, y);
            if (O === 0)
              return R.key;
            if (O < 0)
              return w(R.rightChild, y);
            var Y = w(R.leftChild, y);
            return Y !== void 0 ? Y : R.key;
          }
        };
        this.lowerBound = function(R) {
          return w(l, R);
        };
        var m = function(R, y) {
          if (R && R.key !== void 0) {
            if (d(R.key, y) <= 0)
              return m(R.rightChild, y);
            var O = m(R.leftChild, y);
            return O !== void 0 ? O : R.key;
          }
        };
        this.upperBound = function(R) {
          return m(l, R);
        };
        var I = function(R, y) {
          if (R && R.key !== void 0) {
            var O = d(R.key, y);
            if (O === 0)
              return R.key;
            if (O > 0)
              return I(R.leftChild, y);
            var Y = I(R.rightChild, y);
            return Y !== void 0 ? Y : R.key;
          }
        };
        this.reverseLowerBound = function(R) {
          return I(l, R);
        };
        var N = function(R, y) {
          if (R && R.key !== void 0) {
            if (d(R.key, y) >= 0)
              return N(R.leftChild, y);
            var O = N(R.rightChild, y);
            return O !== void 0 ? O : R.key;
          }
        };
        this.reverseUpperBound = function(R) {
          return N(l, R);
        }, this.union = function(R) {
          var y = this;
          R.forEach(function(O) {
            return y.insert(O);
          });
        }, this.getHeight = function() {
          if (this.empty())
            return 0;
          var R = function(y) {
            return y ? Math.max(R(y.leftChild), R(y.rightChild)) + 1 : 1;
          };
          return R(l);
        };
        var k = function(R) {
          return i(this, function(y) {
            switch (y.label) {
              case 0:
                return R && R.key !== void 0 ? [5, s(k(R.leftChild))] : [2];
              case 1:
                return y.sent(), [4, R.key];
              case 2:
                return y.sent(), [5, s(k(R.rightChild))];
              case 3:
                return y.sent(), [2];
            }
          });
        };
        this[Symbol.iterator] = function() {
          return k(l);
        }, o.forEach(function(R) {
          return v.insert(R);
        }), Object.freeze(this);
      }
      Object.freeze(f), n.default = f;
    }, { "../Base/TreeNode": 25 }], 34: [function(t, r, n) {
      function i(s) {
        var a = this;
        s === void 0 && (s = []);
        var f = 0, o = [];
        this.size = function() {
          return f;
        }, this.empty = function() {
          return f === 0;
        }, this.clear = function() {
          f = 0, o.length = 0;
        }, this.push = function(d) {
          o.push(d), ++f;
        }, this.pop = function() {
          o.pop(), f > 0 && --f;
        }, this.top = function() {
          return o[f - 1];
        }, s.forEach(function(d) {
          return a.push(d);
        }), Object.freeze(this);
      }
      Object.defineProperty(n, "__esModule", { value: !0 }), Object.freeze(i), n.default = i;
    }, {}], 35: [function(t, r, n) {
      var i = this && this.__generator || function(d, v) {
        var u, l, P, p, c = { label: 0, sent: function() {
          if (1 & P[0])
            throw P[1];
          return P[1];
        }, trys: [], ops: [] };
        return p = { next: H(0), throw: H(1), return: H(2) }, typeof Symbol == "function" && (p[Symbol.iterator] = function() {
          return this;
        }), p;
        function H(T) {
          return function(q) {
            return function(b) {
              if (u)
                throw new TypeError("Generator is already executing.");
              for (; c; )
                try {
                  if (u = 1, l && (P = 2 & b[0] ? l.return : b[0] ? l.throw || ((P = l.return) && P.call(l), 0) : l.next) && !(P = P.call(l, b[1])).done)
                    return P;
                  switch (l = 0, P && (b = [2 & b[0], P.value]), b[0]) {
                    case 0:
                    case 1:
                      P = b;
                      break;
                    case 4:
                      return c.label++, { value: b[1], done: !1 };
                    case 5:
                      c.label++, l = b[1], b = [0];
                      continue;
                    case 7:
                      b = c.ops.pop(), c.trys.pop();
                      continue;
                    default:
                      if (!(P = (P = c.trys).length > 0 && P[P.length - 1]) && (b[0] === 6 || b[0] === 2)) {
                        c = 0;
                        continue;
                      }
                      if (b[0] === 3 && (!P || b[1] > P[0] && b[1] < P[3])) {
                        c.label = b[1];
                        break;
                      }
                      if (b[0] === 6 && c.label < P[1]) {
                        c.label = P[1], P = b;
                        break;
                      }
                      if (P && c.label < P[2]) {
                        c.label = P[2], c.ops.push(b);
                        break;
                      }
                      P[2] && c.ops.pop(), c.trys.pop();
                      continue;
                  }
                  b = v.call(d, c);
                } catch (j) {
                  b = [6, j], l = 0;
                } finally {
                  u = P = 0;
                }
              if (5 & b[0])
                throw b[1];
              return { value: b[0] ? b[1] : void 0, done: !0 };
            }([T, q]);
          };
        }
      }, s = this && this.__read || function(d, v) {
        var u = typeof Symbol == "function" && d[Symbol.iterator];
        if (!u)
          return d;
        var l, P, p = u.call(d), c = [];
        try {
          for (; (v === void 0 || v-- > 0) && !(l = p.next()).done; )
            c.push(l.value);
        } catch (H) {
          P = { error: H };
        } finally {
          try {
            l && !l.done && (u = p.return) && u.call(p);
          } finally {
            if (P)
              throw P.error;
          }
        }
        return c;
      }, a = this && this.__spreadArray || function(d, v, u) {
        if (u || arguments.length === 2)
          for (var l, P = 0, p = v.length; P < p; P++)
            !l && P in v || (l || (l = Array.prototype.slice.call(v, 0, P)), l[P] = v[P]);
        return d.concat(l || Array.prototype.slice.call(v));
      }, f = this && this.__values || function(d) {
        var v = typeof Symbol == "function" && Symbol.iterator, u = v && d[v], l = 0;
        if (u)
          return u.call(d);
        if (d && typeof d.length == "number")
          return { next: function() {
            return d && l >= d.length && (d = void 0), { value: d && d[l++], done: !d };
          } };
        throw new TypeError(v ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      function o(d) {
        var v = this;
        d === void 0 && (d = []);
        var u = 0, l = [];
        this.size = function() {
          return u;
        }, this.empty = function() {
          return u === 0;
        }, this.clear = function() {
          u = 0, l.length = 0;
        }, this.front = function() {
          if (!this.empty())
            return l[0];
        }, this.back = function() {
          if (!this.empty())
            return l[u - 1];
        }, this.forEach = function(P) {
          l.forEach(P);
        }, this.getElementByPos = function(P) {
          if (P < 0 || P >= u)
            throw new Error("pos must more than 0 and less than vector's size");
          return l[P];
        }, this.eraseElementByPos = function(P) {
          if (P < 0 || P >= u)
            throw new Error("pos must more than 0 and less than vector's size");
          for (var p = P; p < u - 1; ++p)
            l[p] = l[p + 1];
          this.popBack();
        }, this.eraseElementByValue = function(P) {
          var p = [];
          this.forEach(function(H) {
            H !== P && p.push(H);
          }), p.forEach(function(H, T) {
            l[T] = H;
          });
          for (var c = p.length; u > c; )
            this.popBack();
        }, this.pushBack = function(P) {
          l.push(P), ++u;
        }, this.popBack = function() {
          l.pop(), u > 0 && --u;
        }, this.setElementByPos = function(P, p) {
          if (P < 0 || P >= u)
            throw new Error("pos must more than 0 and less than vector's size");
          l[P] = p;
        }, this.insert = function(P, p, c) {
          if (c === void 0 && (c = 1), P < 0 || P > u)
            throw new Error("pos must more than 0 and less than or equal to vector's size");
          l.splice.apply(l, a([P, 0], s(new Array(c).fill(p)), !1)), u += c;
        }, this.find = function(P) {
          return l.includes(P);
        }, this.reverse = function() {
          l.reverse();
        }, this.unique = function() {
          var P, p = [];
          this.forEach(function(H, T) {
            T !== 0 && H === P || (p.push(H), P = H);
          }), p.forEach(function(H, T) {
            l[T] = H;
          });
          for (var c = p.length; u > c; )
            this.popBack();
        }, this.sort = function(P) {
          l.sort(P);
        }, this[Symbol.iterator] = function() {
          return function() {
            return i(this, function(P) {
              switch (P.label) {
                case 0:
                  return [5, f(l)];
                case 1:
                  return [2, P.sent()];
              }
            });
          }();
        }, d.forEach(function(P) {
          return v.pushBack(P);
        }), Object.freeze(this);
      }
      Object.defineProperty(n, "__esModule", { value: !0 }), Object.freeze(o), n.default = o;
    }, {}], 36: [function(t, r, n) {
      Object.defineProperty(n, "__esModule", { value: !0 }), n.HashMap = n.HashSet = n.Map = n.Set = n.PriorityQueue = n.Deque = n.LinkList = n.Queue = n.Stack = n.Vector = void 0;
      var i = t("./Vector/Vector");
      n.Vector = i.default;
      var s = t("./Stack/Stack");
      n.Stack = s.default;
      var a = t("./Queue/Queue");
      n.Queue = a.default;
      var f = t("./LinkList/LinkList");
      n.LinkList = f.default;
      var o = t("./Deque/Deque");
      n.Deque = o.default;
      var d = t("./PriorityQueue/PriorityQueue");
      n.PriorityQueue = d.default;
      var v = t("./Set/Set");
      n.Set = v.default;
      var u = t("./Map/Map");
      n.Map = u.default;
      var l = t("./HashSet/HashSet");
      n.HashSet = l.default;
      var P = t("./HashMap/HashMap");
      n.HashMap = P.default;
    }, { "./Deque/Deque": 26, "./HashMap/HashMap": 27, "./HashSet/HashSet": 28, "./LinkList/LinkList": 29, "./Map/Map": 30, "./PriorityQueue/PriorityQueue": 31, "./Queue/Queue": 32, "./Set/Set": 33, "./Stack/Stack": 34, "./Vector/Vector": 35 }], 37: [function(t, r, n) {
      const i = t("yallist"), s = Symbol("max"), a = Symbol("length"), f = Symbol("lengthCalculator"), o = Symbol("allowStale"), d = Symbol("maxAge"), v = Symbol("dispose"), u = Symbol("noDisposeOnSet"), l = Symbol("lruList"), P = Symbol("cache"), p = Symbol("updateAgeOnGet"), c = () => 1, H = (m, I, N) => {
        const k = m[P].get(I);
        if (k) {
          const R = k.value;
          if (T(m, R)) {
            if (b(m, k), !m[o])
              return;
          } else
            N && (m[p] && (k.value.now = Date.now()), m[l].unshiftNode(k));
          return R.value;
        }
      }, T = (m, I) => {
        if (!I || !I.maxAge && !m[d])
          return !1;
        const N = Date.now() - I.now;
        return I.maxAge ? N > I.maxAge : m[d] && N > m[d];
      }, q = (m) => {
        if (m[a] > m[s])
          for (let I = m[l].tail; m[a] > m[s] && I !== null; ) {
            const N = I.prev;
            b(m, I), I = N;
          }
      }, b = (m, I) => {
        if (I) {
          const N = I.value;
          m[v] && m[v](N.key, N.value), m[a] -= N.length, m[P].delete(N.key), m[l].removeNode(I);
        }
      };
      class j {
        constructor(I, N, k, R, y) {
          this.key = I, this.value = N, this.length = k, this.now = R, this.maxAge = y || 0;
        }
      }
      const w = (m, I, N, k) => {
        let R = N.value;
        T(m, R) && (b(m, N), m[o] || (R = void 0)), R && I.call(k, R.value, R.key, m);
      };
      r.exports = class {
        constructor(m) {
          if (typeof m == "number" && (m = { max: m }), m || (m = {}), m.max && (typeof m.max != "number" || m.max < 0))
            throw new TypeError("max must be a non-negative number");
          this[s] = m.max || 1 / 0;
          const I = m.length || c;
          if (this[f] = typeof I != "function" ? c : I, this[o] = m.stale || !1, m.maxAge && typeof m.maxAge != "number")
            throw new TypeError("maxAge must be a number");
          this[d] = m.maxAge || 0, this[v] = m.dispose, this[u] = m.noDisposeOnSet || !1, this[p] = m.updateAgeOnGet || !1, this.reset();
        }
        set max(m) {
          if (typeof m != "number" || m < 0)
            throw new TypeError("max must be a non-negative number");
          this[s] = m || 1 / 0, q(this);
        }
        get max() {
          return this[s];
        }
        set allowStale(m) {
          this[o] = !!m;
        }
        get allowStale() {
          return this[o];
        }
        set maxAge(m) {
          if (typeof m != "number")
            throw new TypeError("maxAge must be a non-negative number");
          this[d] = m, q(this);
        }
        get maxAge() {
          return this[d];
        }
        set lengthCalculator(m) {
          typeof m != "function" && (m = c), m !== this[f] && (this[f] = m, this[a] = 0, this[l].forEach((I) => {
            I.length = this[f](I.value, I.key), this[a] += I.length;
          })), q(this);
        }
        get lengthCalculator() {
          return this[f];
        }
        get length() {
          return this[a];
        }
        get itemCount() {
          return this[l].length;
        }
        rforEach(m, I) {
          I = I || this;
          for (let N = this[l].tail; N !== null; ) {
            const k = N.prev;
            w(this, m, N, I), N = k;
          }
        }
        forEach(m, I) {
          I = I || this;
          for (let N = this[l].head; N !== null; ) {
            const k = N.next;
            w(this, m, N, I), N = k;
          }
        }
        keys() {
          return this[l].toArray().map((m) => m.key);
        }
        values() {
          return this[l].toArray().map((m) => m.value);
        }
        reset() {
          this[v] && this[l] && this[l].length && this[l].forEach((m) => this[v](m.key, m.value)), this[P] = /* @__PURE__ */ new Map(), this[l] = new i(), this[a] = 0;
        }
        dump() {
          return this[l].map((m) => !T(this, m) && { k: m.key, v: m.value, e: m.now + (m.maxAge || 0) }).toArray().filter((m) => m);
        }
        dumpLru() {
          return this[l];
        }
        set(m, I, N) {
          if ((N = N || this[d]) && typeof N != "number")
            throw new TypeError("maxAge must be a number");
          const k = N ? Date.now() : 0, R = this[f](I, m);
          if (this[P].has(m)) {
            if (R > this[s])
              return b(this, this[P].get(m)), !1;
            const O = this[P].get(m).value;
            return this[v] && (this[u] || this[v](m, O.value)), O.now = k, O.maxAge = N, O.value = I, this[a] += R - O.length, O.length = R, this.get(m), q(this), !0;
          }
          const y = new j(m, I, R, k, N);
          return y.length > this[s] ? (this[v] && this[v](m, I), !1) : (this[a] += y.length, this[l].unshift(y), this[P].set(m, this[l].head), q(this), !0);
        }
        has(m) {
          if (!this[P].has(m))
            return !1;
          const I = this[P].get(m).value;
          return !T(this, I);
        }
        get(m) {
          return H(this, m, !0);
        }
        peek(m) {
          return H(this, m, !1);
        }
        pop() {
          const m = this[l].tail;
          return m ? (b(this, m), m.value) : null;
        }
        del(m) {
          b(this, this[P].get(m));
        }
        load(m) {
          this.reset();
          const I = Date.now();
          for (let N = m.length - 1; N >= 0; N--) {
            const k = m[N], R = k.e || 0;
            if (R === 0)
              this.set(k.k, k.v);
            else {
              const y = R - I;
              y > 0 && this.set(k.k, k.v, y);
            }
          }
        }
        prune() {
          this[P].forEach((m, I) => H(this, I, !1));
        }
      };
    }, { yallist: 83 }], 38: [function(t, r, n) {
      (function(i) {
        (function() {
          const s = r.exports;
          s.types = { 0: "reserved", 1: "connect", 2: "connack", 3: "publish", 4: "puback", 5: "pubrec", 6: "pubrel", 7: "pubcomp", 8: "subscribe", 9: "suback", 10: "unsubscribe", 11: "unsuback", 12: "pingreq", 13: "pingresp", 14: "disconnect", 15: "auth" }, s.codes = {};
          for (const f in s.types) {
            const o = s.types[f];
            s.codes[o] = f;
          }
          s.CMD_SHIFT = 4, s.CMD_MASK = 240, s.DUP_MASK = 8, s.QOS_MASK = 3, s.QOS_SHIFT = 1, s.RETAIN_MASK = 1, s.VARBYTEINT_MASK = 127, s.VARBYTEINT_FIN_MASK = 128, s.VARBYTEINT_MAX = 268435455, s.SESSIONPRESENT_MASK = 1, s.SESSIONPRESENT_HEADER = i.from([s.SESSIONPRESENT_MASK]), s.CONNACK_HEADER = i.from([s.codes.connack << s.CMD_SHIFT]), s.USERNAME_MASK = 128, s.PASSWORD_MASK = 64, s.WILL_RETAIN_MASK = 32, s.WILL_QOS_MASK = 24, s.WILL_QOS_SHIFT = 3, s.WILL_FLAG_MASK = 4, s.CLEAN_SESSION_MASK = 2, s.CONNECT_HEADER = i.from([s.codes.connect << s.CMD_SHIFT]), s.properties = { sessionExpiryInterval: 17, willDelayInterval: 24, receiveMaximum: 33, maximumPacketSize: 39, topicAliasMaximum: 34, requestResponseInformation: 25, requestProblemInformation: 23, userProperties: 38, authenticationMethod: 21, authenticationData: 22, payloadFormatIndicator: 1, messageExpiryInterval: 2, contentType: 3, responseTopic: 8, correlationData: 9, maximumQoS: 36, retainAvailable: 37, assignedClientIdentifier: 18, reasonString: 31, wildcardSubscriptionAvailable: 40, subscriptionIdentifiersAvailable: 41, sharedSubscriptionAvailable: 42, serverKeepAlive: 19, responseInformation: 26, serverReference: 28, topicAlias: 35, subscriptionIdentifier: 11 }, s.propertiesCodes = {};
          for (const f in s.properties) {
            const o = s.properties[f];
            s.propertiesCodes[o] = f;
          }
          function a(f) {
            return [0, 1, 2].map((o) => [0, 1].map((d) => [0, 1].map((v) => {
              const u = i.alloc(1);
              return u.writeUInt8(s.codes[f] << s.CMD_SHIFT | (d ? s.DUP_MASK : 0) | o << s.QOS_SHIFT | v, 0, !0), u;
            })));
          }
          s.propertiesTypes = { sessionExpiryInterval: "int32", willDelayInterval: "int32", receiveMaximum: "int16", maximumPacketSize: "int32", topicAliasMaximum: "int16", requestResponseInformation: "byte", requestProblemInformation: "byte", userProperties: "pair", authenticationMethod: "string", authenticationData: "binary", payloadFormatIndicator: "byte", messageExpiryInterval: "int32", contentType: "string", responseTopic: "string", correlationData: "binary", maximumQoS: "int8", retainAvailable: "byte", assignedClientIdentifier: "string", reasonString: "string", wildcardSubscriptionAvailable: "byte", subscriptionIdentifiersAvailable: "byte", sharedSubscriptionAvailable: "byte", serverKeepAlive: "int16", responseInformation: "string", serverReference: "string", topicAlias: "int16", subscriptionIdentifier: "var" }, s.PUBLISH_HEADER = a("publish"), s.SUBSCRIBE_HEADER = a("subscribe"), s.SUBSCRIBE_OPTIONS_QOS_MASK = 3, s.SUBSCRIBE_OPTIONS_NL_MASK = 1, s.SUBSCRIBE_OPTIONS_NL_SHIFT = 2, s.SUBSCRIBE_OPTIONS_RAP_MASK = 1, s.SUBSCRIBE_OPTIONS_RAP_SHIFT = 3, s.SUBSCRIBE_OPTIONS_RH_MASK = 3, s.SUBSCRIBE_OPTIONS_RH_SHIFT = 4, s.SUBSCRIBE_OPTIONS_RH = [0, 16, 32], s.SUBSCRIBE_OPTIONS_NL = 4, s.SUBSCRIBE_OPTIONS_RAP = 8, s.SUBSCRIBE_OPTIONS_QOS = [0, 1, 2], s.UNSUBSCRIBE_HEADER = a("unsubscribe"), s.ACKS = { unsuback: a("unsuback"), puback: a("puback"), pubcomp: a("pubcomp"), pubrel: a("pubrel"), pubrec: a("pubrec") }, s.SUBACK_HEADER = i.from([s.codes.suback << s.CMD_SHIFT]), s.VERSION3 = i.from([3]), s.VERSION4 = i.from([4]), s.VERSION5 = i.from([5]), s.VERSION131 = i.from([131]), s.VERSION132 = i.from([132]), s.QOS = [0, 1, 2].map((f) => i.from([f])), s.EMPTY = { pingreq: i.from([s.codes.pingreq << 4, 0]), pingresp: i.from([s.codes.pingresp << 4, 0]), disconnect: i.from([s.codes.disconnect << 4, 0]) };
        }).call(this);
      }).call(this, t("buffer").Buffer);
    }, { buffer: 17 }], 39: [function(t, r, n) {
      (function(i) {
        (function() {
          const s = t("./writeToStream"), a = t("events");
          class f extends a {
            constructor() {
              super(), this._array = new Array(20), this._i = 0;
            }
            write(d) {
              return this._array[this._i++] = d, !0;
            }
            concat() {
              let d = 0;
              const v = new Array(this._array.length), u = this._array;
              let l, P = 0;
              for (l = 0; l < u.length && u[l] !== void 0; l++)
                typeof u[l] != "string" ? v[l] = u[l].length : v[l] = i.byteLength(u[l]), d += v[l];
              const p = i.allocUnsafe(d);
              for (l = 0; l < u.length && u[l] !== void 0; l++)
                typeof u[l] != "string" ? (u[l].copy(p, P), P += v[l]) : (p.write(u[l], P), P += v[l]);
              return p;
            }
          }
          r.exports = function(o, d) {
            const v = new f();
            return s(o, v, d), v.concat();
          };
        }).call(this);
      }).call(this, t("buffer").Buffer);
    }, { "./writeToStream": 44, buffer: 17, events: 22 }], 40: [function(t, r, n) {
      n.parser = t("./parser").parser, n.generate = t("./generate"), n.writeToStream = t("./writeToStream");
    }, { "./generate": 39, "./parser": 43, "./writeToStream": 44 }], 41: [function(t, r, n) {
      (function(i) {
        (function() {
          const a = {}, f = i.isBuffer(i.from([1, 2]).subarray(0, 1));
          function o(d) {
            const v = i.allocUnsafe(2);
            return v.writeUInt8(d >> 8, 0), v.writeUInt8(255 & d, 1), v;
          }
          r.exports = { cache: a, generateCache: function() {
            for (let d = 0; d < 65536; d++)
              a[d] = o(d);
          }, generateNumber: o, genBufVariableByteInt: function(d) {
            let v = 0, u = 0;
            const l = i.allocUnsafe(4);
            do
              v = d % 128 | 0, (d = d / 128 | 0) > 0 && (v |= 128), l.writeUInt8(v, u++);
            while (d > 0 && u < 4);
            return d > 0 && (u = 0), f ? l.subarray(0, u) : l.slice(0, u);
          }, generate4ByteBuffer: function(d) {
            const v = i.allocUnsafe(4);
            return v.writeUInt32BE(d, 0), v;
          } };
        }).call(this);
      }).call(this, t("buffer").Buffer);
    }, { buffer: 17 }], 42: [function(t, r, n) {
      r.exports = class {
        constructor() {
          this.cmd = null, this.retain = !1, this.qos = 0, this.dup = !1, this.length = -1, this.topic = null, this.payload = null;
        }
      };
    }, {}], 43: [function(t, r, n) {
      const i = t("bl"), s = t("events"), a = t("./packet"), f = t("./constants"), o = t("debug")("mqtt-packet:parser");
      class d extends s {
        constructor() {
          super(), this.parser = this.constructor.parser;
        }
        static parser(u) {
          return this instanceof d ? (this.settings = u || {}, this._states = ["_parseHeader", "_parseLength", "_parsePayload", "_newPacket"], this._resetState(), this) : new d().parser(u);
        }
        _resetState() {
          o("_resetState: resetting packet, error, _list, and _stateCounter"), this.packet = new a(), this.error = null, this._list = i(), this._stateCounter = 0;
        }
        parse(u) {
          for (this.error && this._resetState(), this._list.append(u), o("parse: current state: %s", this._states[this._stateCounter]); (this.packet.length !== -1 || this._list.length > 0) && this[this._states[this._stateCounter]]() && !this.error; )
            this._stateCounter++, o("parse: state complete. _stateCounter is now: %d", this._stateCounter), o("parse: packet.length: %d, buffer list length: %d", this.packet.length, this._list.length), this._stateCounter >= this._states.length && (this._stateCounter = 0);
          return o("parse: exited while loop. packet: %d, buffer list length: %d", this.packet.length, this._list.length), this._list.length;
        }
        _parseHeader() {
          const u = this._list.readUInt8(0);
          return this.packet.cmd = f.types[u >> f.CMD_SHIFT], this.packet.retain = (u & f.RETAIN_MASK) != 0, this.packet.qos = u >> f.QOS_SHIFT & f.QOS_MASK, this.packet.dup = (u & f.DUP_MASK) != 0, o("_parseHeader: packet: %o", this.packet), this._list.consume(1), !0;
        }
        _parseLength() {
          const u = this._parseVarByteNum(!0);
          return u && (this.packet.length = u.value, this._list.consume(u.bytes)), o("_parseLength %d", u.value), !!u;
        }
        _parsePayload() {
          o("_parsePayload: payload %O", this._list);
          let u = !1;
          if (this.packet.length === 0 || this._list.length >= this.packet.length) {
            switch (this._pos = 0, this.packet.cmd) {
              case "connect":
                this._parseConnect();
                break;
              case "connack":
                this._parseConnack();
                break;
              case "publish":
                this._parsePublish();
                break;
              case "puback":
              case "pubrec":
              case "pubrel":
              case "pubcomp":
                this._parseConfirmation();
                break;
              case "subscribe":
                this._parseSubscribe();
                break;
              case "suback":
                this._parseSuback();
                break;
              case "unsubscribe":
                this._parseUnsubscribe();
                break;
              case "unsuback":
                this._parseUnsuback();
                break;
              case "pingreq":
              case "pingresp":
                break;
              case "disconnect":
                this._parseDisconnect();
                break;
              case "auth":
                this._parseAuth();
                break;
              default:
                this._emitError(new Error("Not supported"));
            }
            u = !0;
          }
          return o("_parsePayload complete result: %s", u), u;
        }
        _parseConnect() {
          let u, l, P, p;
          o("_parseConnect");
          const c = {}, H = this.packet, T = this._parseString();
          if (T === null)
            return this._emitError(new Error("Cannot parse protocolId"));
          if (T !== "MQTT" && T !== "MQIsdp")
            return this._emitError(new Error("Invalid protocolId"));
          if (H.protocolId = T, this._pos >= this._list.length)
            return this._emitError(new Error("Packet too short"));
          if (H.protocolVersion = this._list.readUInt8(this._pos), H.protocolVersion >= 128 && (H.bridgeMode = !0, H.protocolVersion = H.protocolVersion - 128), H.protocolVersion !== 3 && H.protocolVersion !== 4 && H.protocolVersion !== 5)
            return this._emitError(new Error("Invalid protocol version"));
          if (this._pos++, this._pos >= this._list.length)
            return this._emitError(new Error("Packet too short"));
          if (c.username = this._list.readUInt8(this._pos) & f.USERNAME_MASK, c.password = this._list.readUInt8(this._pos) & f.PASSWORD_MASK, c.will = this._list.readUInt8(this._pos) & f.WILL_FLAG_MASK, c.will && (H.will = {}, H.will.retain = (this._list.readUInt8(this._pos) & f.WILL_RETAIN_MASK) != 0, H.will.qos = (this._list.readUInt8(this._pos) & f.WILL_QOS_MASK) >> f.WILL_QOS_SHIFT), H.clean = (this._list.readUInt8(this._pos) & f.CLEAN_SESSION_MASK) != 0, this._pos++, H.keepalive = this._parseNum(), H.keepalive === -1)
            return this._emitError(new Error("Packet too short"));
          if (H.protocolVersion === 5) {
            const b = this._parseProperties();
            Object.getOwnPropertyNames(b).length && (H.properties = b);
          }
          const q = this._parseString();
          if (q === null)
            return this._emitError(new Error("Packet too short"));
          if (H.clientId = q, o("_parseConnect: packet.clientId: %s", H.clientId), c.will) {
            if (H.protocolVersion === 5) {
              const b = this._parseProperties();
              Object.getOwnPropertyNames(b).length && (H.will.properties = b);
            }
            if ((u = this._parseString()) === null)
              return this._emitError(new Error("Cannot parse will topic"));
            if (H.will.topic = u, o("_parseConnect: packet.will.topic: %s", H.will.topic), (l = this._parseBuffer()) === null)
              return this._emitError(new Error("Cannot parse will payload"));
            H.will.payload = l, o("_parseConnect: packet.will.paylaod: %s", H.will.payload);
          }
          if (c.username) {
            if ((p = this._parseString()) === null)
              return this._emitError(new Error("Cannot parse username"));
            H.username = p, o("_parseConnect: packet.username: %s", H.username);
          }
          if (c.password) {
            if ((P = this._parseBuffer()) === null)
              return this._emitError(new Error("Cannot parse password"));
            H.password = P;
          }
          return this.settings = H, o("_parseConnect: complete"), H;
        }
        _parseConnack() {
          o("_parseConnack");
          const u = this.packet;
          if (this._list.length < 1)
            return null;
          if (u.sessionPresent = !!(this._list.readUInt8(this._pos++) & f.SESSIONPRESENT_MASK), this.settings.protocolVersion === 5)
            this._list.length >= 2 ? u.reasonCode = this._list.readUInt8(this._pos++) : u.reasonCode = 0;
          else {
            if (this._list.length < 2)
              return null;
            u.returnCode = this._list.readUInt8(this._pos++);
          }
          if (u.returnCode === -1 || u.reasonCode === -1)
            return this._emitError(new Error("Cannot parse return code"));
          if (this.settings.protocolVersion === 5) {
            const l = this._parseProperties();
            Object.getOwnPropertyNames(l).length && (u.properties = l);
          }
          o("_parseConnack: complete");
        }
        _parsePublish() {
          o("_parsePublish");
          const u = this.packet;
          if (u.topic = this._parseString(), u.topic === null)
            return this._emitError(new Error("Cannot parse topic"));
          if (!(u.qos > 0) || this._parseMessageId()) {
            if (this.settings.protocolVersion === 5) {
              const l = this._parseProperties();
              Object.getOwnPropertyNames(l).length && (u.properties = l);
            }
            u.payload = this._list.slice(this._pos, u.length), o("_parsePublish: payload from buffer list: %o", u.payload);
          }
        }
        _parseSubscribe() {
          o("_parseSubscribe");
          const u = this.packet;
          let l, P, p, c, H, T, q;
          if (u.qos !== 1)
            return this._emitError(new Error("Wrong subscribe header"));
          if (u.subscriptions = [], this._parseMessageId()) {
            if (this.settings.protocolVersion === 5) {
              const b = this._parseProperties();
              Object.getOwnPropertyNames(b).length && (u.properties = b);
            }
            for (; this._pos < u.length; ) {
              if ((l = this._parseString()) === null)
                return this._emitError(new Error("Cannot parse topic"));
              if (this._pos >= u.length)
                return this._emitError(new Error("Malformed Subscribe Payload"));
              p = (P = this._parseByte()) & f.SUBSCRIBE_OPTIONS_QOS_MASK, T = (P >> f.SUBSCRIBE_OPTIONS_NL_SHIFT & f.SUBSCRIBE_OPTIONS_NL_MASK) != 0, H = (P >> f.SUBSCRIBE_OPTIONS_RAP_SHIFT & f.SUBSCRIBE_OPTIONS_RAP_MASK) != 0, c = P >> f.SUBSCRIBE_OPTIONS_RH_SHIFT & f.SUBSCRIBE_OPTIONS_RH_MASK, q = { topic: l, qos: p }, this.settings.protocolVersion === 5 ? (q.nl = T, q.rap = H, q.rh = c) : this.settings.bridgeMode && (q.rh = 0, q.rap = !0, q.nl = !0), o("_parseSubscribe: push subscription `%s` to subscription", q), u.subscriptions.push(q);
            }
          }
        }
        _parseSuback() {
          o("_parseSuback");
          const u = this.packet;
          if (this.packet.granted = [], this._parseMessageId()) {
            if (this.settings.protocolVersion === 5) {
              const l = this._parseProperties();
              Object.getOwnPropertyNames(l).length && (u.properties = l);
            }
            for (; this._pos < this.packet.length; )
              this.packet.granted.push(this._list.readUInt8(this._pos++));
          }
        }
        _parseUnsubscribe() {
          o("_parseUnsubscribe");
          const u = this.packet;
          if (u.unsubscriptions = [], this._parseMessageId()) {
            if (this.settings.protocolVersion === 5) {
              const l = this._parseProperties();
              Object.getOwnPropertyNames(l).length && (u.properties = l);
            }
            for (; this._pos < u.length; ) {
              const l = this._parseString();
              if (l === null)
                return this._emitError(new Error("Cannot parse topic"));
              o("_parseUnsubscribe: push topic `%s` to unsubscriptions", l), u.unsubscriptions.push(l);
            }
          }
        }
        _parseUnsuback() {
          o("_parseUnsuback");
          const u = this.packet;
          if (!this._parseMessageId())
            return this._emitError(new Error("Cannot parse messageId"));
          if (this.settings.protocolVersion === 5) {
            const l = this._parseProperties();
            for (Object.getOwnPropertyNames(l).length && (u.properties = l), u.granted = []; this._pos < this.packet.length; )
              this.packet.granted.push(this._list.readUInt8(this._pos++));
          }
        }
        _parseConfirmation() {
          o("_parseConfirmation: packet.cmd: `%s`", this.packet.cmd);
          const u = this.packet;
          if (this._parseMessageId(), this.settings.protocolVersion === 5 && (u.length > 2 ? (u.reasonCode = this._parseByte(), o("_parseConfirmation: packet.reasonCode `%d`", u.reasonCode)) : u.reasonCode = 0, u.length > 3)) {
            const l = this._parseProperties();
            Object.getOwnPropertyNames(l).length && (u.properties = l);
          }
          return !0;
        }
        _parseDisconnect() {
          const u = this.packet;
          if (o("_parseDisconnect"), this.settings.protocolVersion === 5) {
            this._list.length > 0 ? u.reasonCode = this._parseByte() : u.reasonCode = 0;
            const l = this._parseProperties();
            Object.getOwnPropertyNames(l).length && (u.properties = l);
          }
          return o("_parseDisconnect result: true"), !0;
        }
        _parseAuth() {
          o("_parseAuth");
          const u = this.packet;
          if (this.settings.protocolVersion !== 5)
            return this._emitError(new Error("Not supported auth packet for this version MQTT"));
          u.reasonCode = this._parseByte();
          const l = this._parseProperties();
          return Object.getOwnPropertyNames(l).length && (u.properties = l), o("_parseAuth: result: true"), !0;
        }
        _parseMessageId() {
          const u = this.packet;
          return u.messageId = this._parseNum(), u.messageId === null ? (this._emitError(new Error("Cannot parse messageId")), !1) : (o("_parseMessageId: packet.messageId %d", u.messageId), !0);
        }
        _parseString(u) {
          const l = this._parseNum(), P = l + this._pos;
          if (l === -1 || P > this._list.length || P > this.packet.length)
            return null;
          const p = this._list.toString("utf8", this._pos, P);
          return this._pos += l, o("_parseString: result: %s", p), p;
        }
        _parseStringPair() {
          return o("_parseStringPair"), { name: this._parseString(), value: this._parseString() };
        }
        _parseBuffer() {
          const u = this._parseNum(), l = u + this._pos;
          if (u === -1 || l > this._list.length || l > this.packet.length)
            return null;
          const P = this._list.slice(this._pos, l);
          return this._pos += u, o("_parseBuffer: result: %o", P), P;
        }
        _parseNum() {
          if (this._list.length - this._pos < 2)
            return -1;
          const u = this._list.readUInt16BE(this._pos);
          return this._pos += 2, o("_parseNum: result: %s", u), u;
        }
        _parse4ByteNum() {
          if (this._list.length - this._pos < 4)
            return -1;
          const u = this._list.readUInt32BE(this._pos);
          return this._pos += 4, o("_parse4ByteNum: result: %s", u), u;
        }
        _parseVarByteNum(u) {
          o("_parseVarByteNum");
          let l, P = 0, p = 1, c = 0, H = !1;
          const T = this._pos ? this._pos : 0;
          for (; P < 4 && T + P < this._list.length; ) {
            if (c += p * ((l = this._list.readUInt8(T + P++)) & f.VARBYTEINT_MASK), p *= 128, (l & f.VARBYTEINT_FIN_MASK) == 0) {
              H = !0;
              break;
            }
            if (this._list.length <= P)
              break;
          }
          return !H && P === 4 && this._list.length >= P && this._emitError(new Error("Invalid variable byte integer")), T && (this._pos += P), o("_parseVarByteNum: result: %o", H = !!H && (u ? { bytes: P, value: c } : c)), H;
        }
        _parseByte() {
          let u;
          return this._pos < this._list.length && (u = this._list.readUInt8(this._pos), this._pos++), o("_parseByte: result: %o", u), u;
        }
        _parseByType(u) {
          switch (o("_parseByType: type: %s", u), u) {
            case "byte":
              return this._parseByte() !== 0;
            case "int8":
              return this._parseByte();
            case "int16":
              return this._parseNum();
            case "int32":
              return this._parse4ByteNum();
            case "var":
              return this._parseVarByteNum();
            case "string":
              return this._parseString();
            case "pair":
              return this._parseStringPair();
            case "binary":
              return this._parseBuffer();
          }
        }
        _parseProperties() {
          o("_parseProperties");
          const u = this._parseVarByteNum(), l = this._pos + u, P = {};
          for (; this._pos < l; ) {
            const p = this._parseByte();
            if (!p)
              return this._emitError(new Error("Cannot parse property code type")), !1;
            const c = f.propertiesCodes[p];
            if (!c)
              return this._emitError(new Error("Unknown property")), !1;
            if (c !== "userProperties")
              P[c] ? Array.isArray(P[c]) ? P[c].push(this._parseByType(f.propertiesTypes[c])) : (P[c] = [P[c]], P[c].push(this._parseByType(f.propertiesTypes[c]))) : P[c] = this._parseByType(f.propertiesTypes[c]);
            else {
              P[c] || (P[c] = /* @__PURE__ */ Object.create(null));
              const H = this._parseByType(f.propertiesTypes[c]);
              if (P[c][H.name])
                if (Array.isArray(P[c][H.name]))
                  P[c][H.name].push(H.value);
                else {
                  const T = P[c][H.name];
                  P[c][H.name] = [T], P[c][H.name].push(H.value);
                }
              else
                P[c][H.name] = H.value;
            }
          }
          return P;
        }
        _newPacket() {
          return o("_newPacket"), this.packet && (this._list.consume(this.packet.length), o("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d", this.packet.cmd, this.packet.payload, this.packet.length), this.emit("packet", this.packet)), o("_newPacket: new packet"), this.packet = new a(), this._pos = 0, !0;
        }
        _emitError(u) {
          o("_emitError"), this.error = u, this.emit("error", u);
        }
      }
      r.exports = d;
    }, { "./constants": 38, "./packet": 42, bl: 15, debug: 18, events: 22 }], 44: [function(t, r, n) {
      (function(i) {
        (function() {
          const s = t("./constants"), a = i.allocUnsafe(0), f = i.from([0]), o = t("./numbers"), d = t("process-nextick-args").nextTick, v = t("debug")("mqtt-packet:writeToStream"), u = o.cache, l = o.generateNumber, P = o.generateCache, p = o.genBufVariableByteInt, c = o.generate4ByteBuffer;
          let H = N, T = !0;
          function q(fe, _, G) {
            switch (v("generate called"), _.cork && (_.cork(), d(b, _)), T && (T = !1, P()), v("generate: packet.cmd: %s", fe.cmd), fe.cmd) {
              case "connect":
                return function(L, $, ae) {
                  const Pe = L || {}, ge = Pe.protocolId || "MQTT";
                  let me = Pe.protocolVersion || 4;
                  const Xe = Pe.will;
                  let De = Pe.clean;
                  const ne = Pe.keepalive || 0, re = Pe.clientId || "", ve = Pe.username, qe = Pe.password, ke = Pe.properties;
                  De === void 0 && (De = !0);
                  let be = 0;
                  if (!ge || typeof ge != "string" && !i.isBuffer(ge))
                    return $.emit("error", new Error("Invalid protocolId")), !1;
                  if (be += ge.length + 2, me !== 3 && me !== 4 && me !== 5)
                    return $.emit("error", new Error("Invalid protocol version")), !1;
                  if (be += 1, (typeof re == "string" || i.isBuffer(re)) && (re || me >= 4) && (re || De))
                    be += i.byteLength(re) + 2;
                  else {
                    if (me < 4)
                      return $.emit("error", new Error("clientId must be supplied before 3.1.1")), !1;
                    if (1 * De == 0)
                      return $.emit("error", new Error("clientId must be given if cleanSession set to 0")), !1;
                  }
                  if (typeof ne != "number" || ne < 0 || ne > 65535 || ne % 1 != 0)
                    return $.emit("error", new Error("Invalid keepalive")), !1;
                  if (be += 2, be += 1, me === 5) {
                    var Fe = y($, ke);
                    if (!Fe)
                      return !1;
                    be += Fe.length;
                  }
                  if (Xe) {
                    if (typeof Xe != "object")
                      return $.emit("error", new Error("Invalid will")), !1;
                    if (!Xe.topic || typeof Xe.topic != "string")
                      return $.emit("error", new Error("Invalid will topic")), !1;
                    if (be += i.byteLength(Xe.topic) + 2, be += 2, Xe.payload) {
                      if (!(Xe.payload.length >= 0))
                        return $.emit("error", new Error("Invalid will payload")), !1;
                      typeof Xe.payload == "string" ? be += i.byteLength(Xe.payload) : be += Xe.payload.length;
                    }
                    var Ke = {};
                    if (me === 5) {
                      if (!(Ke = y($, Xe.properties)))
                        return !1;
                      be += Ke.length;
                    }
                  }
                  let nt = !1;
                  if (ve != null) {
                    if (!te(ve))
                      return $.emit("error", new Error("Invalid username")), !1;
                    nt = !0, be += i.byteLength(ve) + 2;
                  }
                  if (qe != null) {
                    if (!nt)
                      return $.emit("error", new Error("Username is required to use password")), !1;
                    if (!te(qe))
                      return $.emit("error", new Error("Invalid password")), !1;
                    be += Z(qe) + 2;
                  }
                  $.write(s.CONNECT_HEADER), w($, be), R($, ge), Pe.bridgeMode && (me += 128), $.write(me === 131 ? s.VERSION131 : me === 132 ? s.VERSION132 : me === 4 ? s.VERSION4 : me === 5 ? s.VERSION5 : s.VERSION3);
                  let ut = 0;
                  return ut |= ve != null ? s.USERNAME_MASK : 0, ut |= qe != null ? s.PASSWORD_MASK : 0, ut |= Xe && Xe.retain ? s.WILL_RETAIN_MASK : 0, ut |= Xe && Xe.qos ? Xe.qos << s.WILL_QOS_SHIFT : 0, ut |= Xe ? s.WILL_FLAG_MASK : 0, ut |= De ? s.CLEAN_SESSION_MASK : 0, $.write(i.from([ut])), H($, ne), me === 5 && Fe.write(), R($, re), Xe && (me === 5 && Ke.write(), m($, Xe.topic), R($, Xe.payload)), ve != null && R($, ve), qe != null && R($, qe), !0;
                }(fe, _);
              case "connack":
                return function(L, $, ae) {
                  const Pe = ae ? ae.protocolVersion : 4, ge = L || {}, me = Pe === 5 ? ge.reasonCode : ge.returnCode, Xe = ge.properties;
                  let De = 2;
                  if (typeof me != "number")
                    return $.emit("error", new Error("Invalid return code")), !1;
                  let ne = null;
                  if (Pe === 5) {
                    if (!(ne = y($, Xe)))
                      return !1;
                    De += ne.length;
                  }
                  return $.write(s.CONNACK_HEADER), w($, De), $.write(ge.sessionPresent ? s.SESSIONPRESENT_HEADER : f), $.write(i.from([me])), ne != null && ne.write(), !0;
                }(fe, _, G);
              case "publish":
                return function(L, $, ae) {
                  v("publish: packet: %o", L);
                  const Pe = ae ? ae.protocolVersion : 4, ge = L || {}, me = ge.qos || 0, Xe = ge.retain ? s.RETAIN_MASK : 0, De = ge.topic, ne = ge.payload || a, re = ge.messageId, ve = ge.properties;
                  let qe = 0;
                  if (typeof De == "string")
                    qe += i.byteLength(De) + 2;
                  else {
                    if (!i.isBuffer(De))
                      return $.emit("error", new Error("Invalid topic")), !1;
                    qe += De.length + 2;
                  }
                  if (i.isBuffer(ne) ? qe += ne.length : qe += i.byteLength(ne), me && typeof re != "number")
                    return $.emit("error", new Error("Invalid messageId")), !1;
                  me && (qe += 2);
                  let ke = null;
                  if (Pe === 5) {
                    if (!(ke = y($, ve)))
                      return !1;
                    qe += ke.length;
                  }
                  return $.write(s.PUBLISH_HEADER[me][ge.dup ? 1 : 0][Xe ? 1 : 0]), w($, qe), H($, Z(De)), $.write(De), me > 0 && H($, re), ke != null && ke.write(), v("publish: payload: %o", ne), $.write(ne);
                }(fe, _, G);
              case "puback":
              case "pubrec":
              case "pubrel":
              case "pubcomp":
                return function(L, $, ae) {
                  const Pe = ae ? ae.protocolVersion : 4, ge = L || {}, me = ge.cmd || "puback", Xe = ge.messageId, De = ge.dup && me === "pubrel" ? s.DUP_MASK : 0;
                  let ne = 0;
                  const re = ge.reasonCode, ve = ge.properties;
                  let qe = Pe === 5 ? 3 : 2;
                  if (me === "pubrel" && (ne = 1), typeof Xe != "number")
                    return $.emit("error", new Error("Invalid messageId")), !1;
                  let ke = null;
                  if (Pe === 5 && typeof ve == "object") {
                    if (!(ke = O($, ve, ae, qe)))
                      return !1;
                    qe += ke.length;
                  }
                  return $.write(s.ACKS[me][ne][De][0]), w($, qe), H($, Xe), Pe === 5 && $.write(i.from([re])), ke !== null && ke.write(), !0;
                }(fe, _, G);
              case "subscribe":
                return function(L, $, ae) {
                  v("subscribe: packet: ");
                  const Pe = ae ? ae.protocolVersion : 4, ge = L || {}, me = ge.dup ? s.DUP_MASK : 0, Xe = ge.messageId, De = ge.subscriptions, ne = ge.properties;
                  let re = 0;
                  if (typeof Xe != "number")
                    return $.emit("error", new Error("Invalid messageId")), !1;
                  re += 2;
                  let ve = null;
                  if (Pe === 5) {
                    if (!(ve = y($, ne)))
                      return !1;
                    re += ve.length;
                  }
                  if (typeof De != "object" || !De.length)
                    return $.emit("error", new Error("Invalid subscriptions")), !1;
                  for (let ke = 0; ke < De.length; ke += 1) {
                    const be = De[ke].topic, Fe = De[ke].qos;
                    if (typeof be != "string")
                      return $.emit("error", new Error("Invalid subscriptions - invalid topic")), !1;
                    if (typeof Fe != "number")
                      return $.emit("error", new Error("Invalid subscriptions - invalid qos")), !1;
                    if (Pe === 5) {
                      if (typeof (De[ke].nl || !1) != "boolean")
                        return $.emit("error", new Error("Invalid subscriptions - invalid No Local")), !1;
                      if (typeof (De[ke].rap || !1) != "boolean")
                        return $.emit("error", new Error("Invalid subscriptions - invalid Retain as Published")), !1;
                      const ut = De[ke].rh || 0;
                      if (typeof ut != "number" || ut > 2)
                        return $.emit("error", new Error("Invalid subscriptions - invalid Retain Handling")), !1;
                    }
                    re += i.byteLength(be) + 2 + 1;
                  }
                  v("subscribe: writing to stream: %o", s.SUBSCRIBE_HEADER), $.write(s.SUBSCRIBE_HEADER[1][me ? 1 : 0][0]), w($, re), H($, Xe), ve !== null && ve.write();
                  let qe = !0;
                  for (const ke of De) {
                    const be = ke.topic, Fe = ke.qos, Ke = +ke.nl, nt = +ke.rap, ut = ke.rh;
                    let bt;
                    m($, be), bt = s.SUBSCRIBE_OPTIONS_QOS[Fe], Pe === 5 && (bt |= Ke ? s.SUBSCRIBE_OPTIONS_NL : 0, bt |= nt ? s.SUBSCRIBE_OPTIONS_RAP : 0, bt |= ut ? s.SUBSCRIBE_OPTIONS_RH[ut] : 0), qe = $.write(i.from([bt]));
                  }
                  return qe;
                }(fe, _, G);
              case "suback":
                return function(L, $, ae) {
                  const Pe = ae ? ae.protocolVersion : 4, ge = L || {}, me = ge.messageId, Xe = ge.granted, De = ge.properties;
                  let ne = 0;
                  if (typeof me != "number")
                    return $.emit("error", new Error("Invalid messageId")), !1;
                  if (ne += 2, typeof Xe != "object" || !Xe.length)
                    return $.emit("error", new Error("Invalid qos vector")), !1;
                  for (let ve = 0; ve < Xe.length; ve += 1) {
                    if (typeof Xe[ve] != "number")
                      return $.emit("error", new Error("Invalid qos vector")), !1;
                    ne += 1;
                  }
                  let re = null;
                  if (Pe === 5) {
                    if (!(re = O($, De, ae, ne)))
                      return !1;
                    ne += re.length;
                  }
                  return $.write(s.SUBACK_HEADER), w($, ne), H($, me), re !== null && re.write(), $.write(i.from(Xe));
                }(fe, _, G);
              case "unsubscribe":
                return function(L, $, ae) {
                  const Pe = ae ? ae.protocolVersion : 4, ge = L || {}, me = ge.messageId, Xe = ge.dup ? s.DUP_MASK : 0, De = ge.unsubscriptions, ne = ge.properties;
                  let re = 0;
                  if (typeof me != "number")
                    return $.emit("error", new Error("Invalid messageId")), !1;
                  if (re += 2, typeof De != "object" || !De.length)
                    return $.emit("error", new Error("Invalid unsubscriptions")), !1;
                  for (let ke = 0; ke < De.length; ke += 1) {
                    if (typeof De[ke] != "string")
                      return $.emit("error", new Error("Invalid unsubscriptions")), !1;
                    re += i.byteLength(De[ke]) + 2;
                  }
                  let ve = null;
                  if (Pe === 5) {
                    if (!(ve = y($, ne)))
                      return !1;
                    re += ve.length;
                  }
                  $.write(s.UNSUBSCRIBE_HEADER[1][Xe ? 1 : 0][0]), w($, re), H($, me), ve !== null && ve.write();
                  let qe = !0;
                  for (let ke = 0; ke < De.length; ke++)
                    qe = m($, De[ke]);
                  return qe;
                }(fe, _, G);
              case "unsuback":
                return function(L, $, ae) {
                  const Pe = ae ? ae.protocolVersion : 4, ge = L || {}, me = ge.messageId, Xe = ge.dup ? s.DUP_MASK : 0, De = ge.granted, ne = ge.properties, re = ge.cmd;
                  let ve = 2;
                  if (typeof me != "number")
                    return $.emit("error", new Error("Invalid messageId")), !1;
                  if (Pe === 5) {
                    if (typeof De != "object" || !De.length)
                      return $.emit("error", new Error("Invalid qos vector")), !1;
                    for (let ke = 0; ke < De.length; ke += 1) {
                      if (typeof De[ke] != "number")
                        return $.emit("error", new Error("Invalid qos vector")), !1;
                      ve += 1;
                    }
                  }
                  let qe = null;
                  if (Pe === 5) {
                    if (!(qe = O($, ne, ae, ve)))
                      return !1;
                    ve += qe.length;
                  }
                  return $.write(s.ACKS[re][0][Xe][0]), w($, ve), H($, me), qe !== null && qe.write(), Pe === 5 && $.write(i.from(De)), !0;
                }(fe, _, G);
              case "pingreq":
              case "pingresp":
                return function(L, $, ae) {
                  return $.write(s.EMPTY[L.cmd]);
                }(fe, _);
              case "disconnect":
                return function(L, $, ae) {
                  const Pe = ae ? ae.protocolVersion : 4, ge = L || {}, me = ge.reasonCode, Xe = ge.properties;
                  let De = Pe === 5 ? 1 : 0, ne = null;
                  if (Pe === 5) {
                    if (!(ne = O($, Xe, ae, De)))
                      return !1;
                    De += ne.length;
                  }
                  return $.write(i.from([s.codes.disconnect << 4])), w($, De), Pe === 5 && $.write(i.from([me])), ne !== null && ne.write(), !0;
                }(fe, _, G);
              case "auth":
                return function(L, $, ae) {
                  const Pe = ae ? ae.protocolVersion : 4, ge = L || {}, me = ge.reasonCode, Xe = ge.properties;
                  let De = Pe === 5 ? 1 : 0;
                  Pe !== 5 && $.emit("error", new Error("Invalid mqtt version for auth packet"));
                  const ne = O($, Xe, ae, De);
                  return ne ? (De += ne.length, $.write(i.from([s.codes.auth << 4])), w($, De), $.write(i.from([me])), ne !== null && ne.write(), !0) : !1;
                }(fe, _, G);
              default:
                return _.emit("error", new Error("Unknown command")), !1;
            }
          }
          function b(fe) {
            fe.uncork();
          }
          Object.defineProperty(q, "cacheNumbers", { get: () => H === N, set(fe) {
            fe ? (u && Object.keys(u).length !== 0 || (T = !0), H = N) : (T = !1, H = k);
          } });
          const j = {};
          function w(fe, _) {
            if (_ > s.VARBYTEINT_MAX)
              return fe.emit("error", new Error(`Invalid variable byte integer: ${_}`)), !1;
            let G = j[_];
            return G || (G = p(_), _ < 16384 && (j[_] = G)), v("writeVarByteInt: writing to stream: %o", G), fe.write(G);
          }
          function m(fe, _) {
            const G = i.byteLength(_);
            return H(fe, G), v("writeString: %s", _), fe.write(_, "utf8");
          }
          function I(fe, _, G) {
            m(fe, _), m(fe, G);
          }
          function N(fe, _) {
            return v("writeNumberCached: number: %d", _), v("writeNumberCached: %o", u[_]), fe.write(u[_]);
          }
          function k(fe, _) {
            const G = l(_);
            return v("writeNumberGenerated: %o", G), fe.write(G);
          }
          function R(fe, _) {
            typeof _ == "string" ? m(fe, _) : _ ? (H(fe, _.length), fe.write(_)) : H(fe, 0);
          }
          function y(fe, _) {
            if (typeof _ != "object" || _.length != null)
              return { length: 1, write() {
                ee(fe, {}, 0);
              } };
            let G = 0;
            function L($, ae) {
              let Pe = 0;
              switch (s.propertiesTypes[$]) {
                case "byte":
                  if (typeof ae != "boolean")
                    return fe.emit("error", new Error(`Invalid ${$}: ${ae}`)), !1;
                  Pe += 2;
                  break;
                case "int8":
                  if (typeof ae != "number" || ae < 0 || ae > 255)
                    return fe.emit("error", new Error(`Invalid ${$}: ${ae}`)), !1;
                  Pe += 2;
                  break;
                case "binary":
                  if (ae && ae === null)
                    return fe.emit("error", new Error(`Invalid ${$}: ${ae}`)), !1;
                  Pe += 1 + i.byteLength(ae) + 2;
                  break;
                case "int16":
                  if (typeof ae != "number" || ae < 0 || ae > 65535)
                    return fe.emit("error", new Error(`Invalid ${$}: ${ae}`)), !1;
                  Pe += 3;
                  break;
                case "int32":
                  if (typeof ae != "number" || ae < 0 || ae > 4294967295)
                    return fe.emit("error", new Error(`Invalid ${$}: ${ae}`)), !1;
                  Pe += 5;
                  break;
                case "var":
                  if (typeof ae != "number" || ae < 0 || ae > 268435455)
                    return fe.emit("error", new Error(`Invalid ${$}: ${ae}`)), !1;
                  Pe += 1 + i.byteLength(p(ae));
                  break;
                case "string":
                  if (typeof ae != "string")
                    return fe.emit("error", new Error(`Invalid ${$}: ${ae}`)), !1;
                  Pe += 3 + i.byteLength(ae.toString());
                  break;
                case "pair":
                  if (typeof ae != "object")
                    return fe.emit("error", new Error(`Invalid ${$}: ${ae}`)), !1;
                  Pe += Object.getOwnPropertyNames(ae).reduce((ge, me) => {
                    const Xe = ae[me];
                    return Array.isArray(Xe) ? ge += Xe.reduce((De, ne) => De += 3 + i.byteLength(me.toString()) + 2 + i.byteLength(ne.toString()), 0) : ge += 3 + i.byteLength(me.toString()) + 2 + i.byteLength(ae[me].toString()), ge;
                  }, 0);
                  break;
                default:
                  return fe.emit("error", new Error(`Invalid property ${$}: ${ae}`)), !1;
              }
              return Pe;
            }
            if (_)
              for (const $ in _) {
                let ae = 0, Pe = 0;
                const ge = _[$];
                if (Array.isArray(ge))
                  for (let me = 0; me < ge.length; me++) {
                    if (!(Pe = L($, ge[me])))
                      return !1;
                    ae += Pe;
                  }
                else {
                  if (!(Pe = L($, ge)))
                    return !1;
                  ae = Pe;
                }
                if (!ae)
                  return !1;
                G += ae;
              }
            return { length: i.byteLength(p(G)) + G, write() {
              ee(fe, _, G);
            } };
          }
          function O(fe, _, G, L) {
            const $ = ["reasonString", "userProperties"], ae = G && G.properties && G.properties.maximumPacketSize ? G.properties.maximumPacketSize : 0;
            let Pe = y(fe, _);
            if (ae)
              for (; L + Pe.length > ae; ) {
                const ge = $.shift();
                if (!ge || !_[ge])
                  return !1;
                delete _[ge], Pe = y(fe, _);
              }
            return Pe;
          }
          function Y(fe, _, G) {
            switch (s.propertiesTypes[_]) {
              case "byte":
                fe.write(i.from([s.properties[_]])), fe.write(i.from([+G]));
                break;
              case "int8":
                fe.write(i.from([s.properties[_]])), fe.write(i.from([G]));
                break;
              case "binary":
                fe.write(i.from([s.properties[_]])), R(fe, G);
                break;
              case "int16":
                fe.write(i.from([s.properties[_]])), H(fe, G);
                break;
              case "int32":
                fe.write(i.from([s.properties[_]])), function(L, $) {
                  const ae = c($);
                  v("write4ByteNumber: %o", ae), L.write(ae);
                }(fe, G);
                break;
              case "var":
                fe.write(i.from([s.properties[_]])), w(fe, G);
                break;
              case "string":
                fe.write(i.from([s.properties[_]])), m(fe, G);
                break;
              case "pair":
                Object.getOwnPropertyNames(G).forEach((L) => {
                  const $ = G[L];
                  Array.isArray($) ? $.forEach((ae) => {
                    fe.write(i.from([s.properties[_]])), I(fe, L.toString(), ae.toString());
                  }) : (fe.write(i.from([s.properties[_]])), I(fe, L.toString(), $.toString()));
                });
                break;
              default:
                return fe.emit("error", new Error(`Invalid property ${_} value: ${G}`)), !1;
            }
          }
          function ee(fe, _, G) {
            w(fe, G);
            for (const L in _)
              if (Object.prototype.hasOwnProperty.call(_, L) && _[L] !== null) {
                const $ = _[L];
                if (Array.isArray($))
                  for (let ae = 0; ae < $.length; ae++)
                    Y(fe, L, $[ae]);
                else
                  Y(fe, L, $);
              }
          }
          function Z(fe) {
            return fe ? fe instanceof i ? fe.length : i.byteLength(fe) : 0;
          }
          function te(fe) {
            return typeof fe == "string" || fe instanceof i;
          }
          r.exports = q;
        }).call(this);
      }).call(this, t("buffer").Buffer);
    }, { "./constants": 38, "./numbers": 41, buffer: 17, debug: 18, "process-nextick-args": 49 }], 45: [function(t, r, n) {
      var i = 1e3, s = 60 * i, a = 60 * s, f = 24 * a, o = 7 * f, d = 365.25 * f;
      function v(u, l, P, p) {
        var c = l >= 1.5 * P;
        return Math.round(u / P) + " " + p + (c ? "s" : "");
      }
      r.exports = function(u, l) {
        l = l || {};
        var P = typeof u;
        if (P === "string" && u.length > 0)
          return function(p) {
            if (!((p = String(p)).length > 100)) {
              var c = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);
              if (c) {
                var H = parseFloat(c[1]);
                switch ((c[2] || "ms").toLowerCase()) {
                  case "years":
                  case "year":
                  case "yrs":
                  case "yr":
                  case "y":
                    return H * d;
                  case "weeks":
                  case "week":
                  case "w":
                    return H * o;
                  case "days":
                  case "day":
                  case "d":
                    return H * f;
                  case "hours":
                  case "hour":
                  case "hrs":
                  case "hr":
                  case "h":
                    return H * a;
                  case "minutes":
                  case "minute":
                  case "mins":
                  case "min":
                  case "m":
                    return H * s;
                  case "seconds":
                  case "second":
                  case "secs":
                  case "sec":
                  case "s":
                    return H * i;
                  case "milliseconds":
                  case "millisecond":
                  case "msecs":
                  case "msec":
                  case "ms":
                    return H;
                  default:
                    return;
                }
              }
            }
          }(u);
        if (P === "number" && isFinite(u))
          return l.long ? function(p) {
            var c = Math.abs(p);
            return c >= f ? v(p, c, f, "day") : c >= a ? v(p, c, a, "hour") : c >= s ? v(p, c, s, "minute") : c >= i ? v(p, c, i, "second") : p + " ms";
          }(u) : function(p) {
            var c = Math.abs(p);
            return c >= f ? Math.round(p / f) + "d" : c >= a ? Math.round(p / a) + "h" : c >= s ? Math.round(p / s) + "m" : c >= i ? Math.round(p / i) + "s" : p + "ms";
          }(u);
        throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(u));
      };
    }, {}], 46: [function(t, r, n) {
      const i = t("./lib/number-allocator.js");
      r.exports.NumberAllocator = i;
    }, { "./lib/number-allocator.js": 47 }], 47: [function(t, r, n) {
      const i = t("js-sdsl").Set, s = t("debug")("number-allocator:trace"), a = t("debug")("number-allocator:error");
      function f(d, v) {
        this.low = d, this.high = v;
      }
      function o(d, v) {
        if (!(this instanceof o))
          return new o(d, v);
        this.min = d, this.max = v, this.ss = new i([], (u, l) => u.compare(l)), s("Create"), this.clear();
      }
      f.prototype.equals = function(d) {
        return this.low === d.low && this.high === d.high;
      }, f.prototype.compare = function(d) {
        return this.low < d.low && this.high < d.low ? -1 : d.low < this.low && d.high < this.low ? 1 : 0;
      }, o.prototype.firstVacant = function() {
        return this.ss.size() === 0 ? null : this.ss.front().low;
      }, o.prototype.alloc = function() {
        if (this.ss.size() === 0)
          return s("alloc():empty"), null;
        const d = this.ss.front(), v = d.low;
        return v + 1 <= d.high ? ++d.low : this.ss.eraseElementByPos(0), s("alloc():" + v), v;
      }, o.prototype.use = function(d) {
        const v = new f(d, d), u = this.ss.lowerBound(v);
        if (u) {
          if (u.equals(v))
            return this.ss.eraseElementByValue(u), s("use():" + d), !0;
          if (u.low > d)
            return !1;
          if (u.low === d)
            return ++u.low, s("use():" + d), !0;
          if (u.high === d)
            return --u.high, s("use():" + d), !0;
          const l = u.low;
          return u.low = d + 1, this.ss.insert(new f(l, d - 1)), s("use():" + d), !0;
        }
        return s("use():failed"), !1;
      }, o.prototype.free = function(d) {
        if (d < this.min || d > this.max)
          return void a("free():" + d + " is out of range");
        const v = new f(d, d), u = this.ss.lowerBound(v);
        if (u) {
          if (u.low <= d && d <= u.high)
            return void a("free():" + d + " has already been vacant");
          if (u === this.ss.front())
            d + 1 === u.low ? --u.low : this.ss.insert(v);
          else {
            const l = this.ss.reverseLowerBound(v);
            l.high + 1 === d ? d + 1 === u.low ? (this.ss.eraseElementByValue(l), u.low = l.low) : l.high = d : d + 1 === u.low ? u.low = d : this.ss.insert(v);
          }
        } else {
          if (u === this.ss.front())
            return void this.ss.insert(v);
          const l = this.ss.reverseLowerBound(v);
          l.high + 1 === d ? l.high = d : this.ss.insert(v);
        }
        s("free():" + d);
      }, o.prototype.clear = function() {
        s("clear()"), this.ss.clear(), this.ss.insert(new f(this.min, this.max));
      }, o.prototype.intervalCount = function() {
        return this.ss.size();
      }, o.prototype.dump = function() {
        console.log("length:" + this.ss.size());
        for (const d of this.ss)
          console.log(d);
      }, r.exports = o;
    }, { debug: 18, "js-sdsl": 36 }], 48: [function(t, r, n) {
      var i = t("wrappy");
      function s(f) {
        var o = function() {
          return o.called ? o.value : (o.called = !0, o.value = f.apply(this, arguments));
        };
        return o.called = !1, o;
      }
      function a(f) {
        var o = function() {
          if (o.called)
            throw new Error(o.onceError);
          return o.called = !0, o.value = f.apply(this, arguments);
        }, d = f.name || "Function wrapped with `once`";
        return o.onceError = d + " shouldn't be called more than once", o.called = !1, o;
      }
      r.exports = i(s), r.exports.strict = i(a), s.proto = s(function() {
        Object.defineProperty(Function.prototype, "once", { value: function() {
          return s(this);
        }, configurable: !0 }), Object.defineProperty(Function.prototype, "onceStrict", { value: function() {
          return a(this);
        }, configurable: !0 });
      });
    }, { wrappy: 79 }], 49: [function(t, r, n) {
      (function(i) {
        (function() {
          i === void 0 || !i.version || i.version.indexOf("v0.") === 0 || i.version.indexOf("v1.") === 0 && i.version.indexOf("v1.8.") !== 0 ? r.exports = { nextTick: function(s, a, f, o) {
            if (typeof s != "function")
              throw new TypeError('"callback" argument must be a function');
            var d, v, u = arguments.length;
            switch (u) {
              case 0:
              case 1:
                return i.nextTick(s);
              case 2:
                return i.nextTick(function() {
                  s.call(null, a);
                });
              case 3:
                return i.nextTick(function() {
                  s.call(null, a, f);
                });
              case 4:
                return i.nextTick(function() {
                  s.call(null, a, f, o);
                });
              default:
                for (d = new Array(u - 1), v = 0; v < d.length; )
                  d[v++] = arguments[v];
                return i.nextTick(function() {
                  s.apply(null, d);
                });
            }
          } } : r.exports = i;
        }).call(this);
      }).call(this, t("_process"));
    }, { _process: 50 }], 50: [function(t, r, n) {
      var i, s, a = r.exports = {};
      function f() {
        throw new Error("setTimeout has not been defined");
      }
      function o() {
        throw new Error("clearTimeout has not been defined");
      }
      function d(q) {
        if (i === setTimeout)
          return setTimeout(q, 0);
        if ((i === f || !i) && setTimeout)
          return i = setTimeout, setTimeout(q, 0);
        try {
          return i(q, 0);
        } catch {
          try {
            return i.call(null, q, 0);
          } catch {
            return i.call(this, q, 0);
          }
        }
      }
      (function() {
        try {
          i = typeof setTimeout == "function" ? setTimeout : f;
        } catch {
          i = f;
        }
        try {
          s = typeof clearTimeout == "function" ? clearTimeout : o;
        } catch {
          s = o;
        }
      })();
      var v, u = [], l = !1, P = -1;
      function p() {
        l && v && (l = !1, v.length ? u = v.concat(u) : P = -1, u.length && c());
      }
      function c() {
        if (!l) {
          var q = d(p);
          l = !0;
          for (var b = u.length; b; ) {
            for (v = u, u = []; ++P < b; )
              v && v[P].run();
            P = -1, b = u.length;
          }
          v = null, l = !1, function(j) {
            if (s === clearTimeout)
              return clearTimeout(j);
            if ((s === o || !s) && clearTimeout)
              return s = clearTimeout, clearTimeout(j);
            try {
              s(j);
            } catch {
              try {
                return s.call(null, j);
              } catch {
                return s.call(this, j);
              }
            }
          }(q);
        }
      }
      function H(q, b) {
        this.fun = q, this.array = b;
      }
      function T() {
      }
      a.nextTick = function(q) {
        var b = new Array(arguments.length - 1);
        if (arguments.length > 1)
          for (var j = 1; j < arguments.length; j++)
            b[j - 1] = arguments[j];
        u.push(new H(q, b)), u.length !== 1 || l || d(c);
      }, H.prototype.run = function() {
        this.fun.apply(null, this.array);
      }, a.title = "browser", a.browser = !0, a.env = {}, a.argv = [], a.version = "", a.versions = {}, a.on = T, a.addListener = T, a.once = T, a.off = T, a.removeListener = T, a.removeAllListeners = T, a.emit = T, a.prependListener = T, a.prependOnceListener = T, a.listeners = function(q) {
        return [];
      }, a.binding = function(q) {
        throw new Error("process.binding is not supported");
      }, a.cwd = function() {
        return "/";
      }, a.chdir = function(q) {
        throw new Error("process.chdir is not supported");
      }, a.umask = function() {
        return 0;
      };
    }, {}], 51: [function(t, r, n) {
      (function(i) {
        (function() {
          (function(s) {
            var a = typeof n == "object" && n && !n.nodeType && n, f = typeof r == "object" && r && !r.nodeType && r, o = typeof i == "object" && i;
            o.global !== o && o.window !== o && o.self !== o || (s = o);
            var d, v, u = 2147483647, l = 36, P = 1, p = 26, c = 38, H = 700, T = 72, q = 128, b = "-", j = /^xn--/, w = /[^\x20-\x7E]/, m = /[\x2E\u3002\uFF0E\uFF61]/g, I = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }, N = l - P, k = Math.floor, R = String.fromCharCode;
            function y(L) {
              throw new RangeError(I[L]);
            }
            function O(L, $) {
              for (var ae = L.length, Pe = []; ae--; )
                Pe[ae] = $(L[ae]);
              return Pe;
            }
            function Y(L, $) {
              var ae = L.split("@"), Pe = "";
              return ae.length > 1 && (Pe = ae[0] + "@", L = ae[1]), Pe + O((L = L.replace(m, ".")).split("."), $).join(".");
            }
            function ee(L) {
              for (var $, ae, Pe = [], ge = 0, me = L.length; ge < me; )
                ($ = L.charCodeAt(ge++)) >= 55296 && $ <= 56319 && ge < me ? (64512 & (ae = L.charCodeAt(ge++))) == 56320 ? Pe.push(((1023 & $) << 10) + (1023 & ae) + 65536) : (Pe.push($), ge--) : Pe.push($);
              return Pe;
            }
            function Z(L) {
              return O(L, function($) {
                var ae = "";
                return $ > 65535 && (ae += R(($ -= 65536) >>> 10 & 1023 | 55296), $ = 56320 | 1023 & $), ae += R($);
              }).join("");
            }
            function te(L, $) {
              return L + 22 + 75 * (L < 26) - (($ != 0) << 5);
            }
            function fe(L, $, ae) {
              var Pe = 0;
              for (L = ae ? k(L / H) : L >> 1, L += k(L / $); L > N * p >> 1; Pe += l)
                L = k(L / N);
              return k(Pe + (N + 1) * L / (L + c));
            }
            function _(L) {
              var $, ae, Pe, ge, me, Xe, De, ne, re, ve, qe, ke = [], be = L.length, Fe = 0, Ke = q, nt = T;
              for ((ae = L.lastIndexOf(b)) < 0 && (ae = 0), Pe = 0; Pe < ae; ++Pe)
                L.charCodeAt(Pe) >= 128 && y("not-basic"), ke.push(L.charCodeAt(Pe));
              for (ge = ae > 0 ? ae + 1 : 0; ge < be; ) {
                for (me = Fe, Xe = 1, De = l; ge >= be && y("invalid-input"), ((ne = (qe = L.charCodeAt(ge++)) - 48 < 10 ? qe - 22 : qe - 65 < 26 ? qe - 65 : qe - 97 < 26 ? qe - 97 : l) >= l || ne > k((u - Fe) / Xe)) && y("overflow"), Fe += ne * Xe, !(ne < (re = De <= nt ? P : De >= nt + p ? p : De - nt)); De += l)
                  Xe > k(u / (ve = l - re)) && y("overflow"), Xe *= ve;
                nt = fe(Fe - me, $ = ke.length + 1, me == 0), k(Fe / $) > u - Ke && y("overflow"), Ke += k(Fe / $), Fe %= $, ke.splice(Fe++, 0, Ke);
              }
              return Z(ke);
            }
            function G(L) {
              var $, ae, Pe, ge, me, Xe, De, ne, re, ve, qe, ke, be, Fe, Ke, nt = [];
              for (ke = (L = ee(L)).length, $ = q, ae = 0, me = T, Xe = 0; Xe < ke; ++Xe)
                (qe = L[Xe]) < 128 && nt.push(R(qe));
              for (Pe = ge = nt.length, ge && nt.push(b); Pe < ke; ) {
                for (De = u, Xe = 0; Xe < ke; ++Xe)
                  (qe = L[Xe]) >= $ && qe < De && (De = qe);
                for (De - $ > k((u - ae) / (be = Pe + 1)) && y("overflow"), ae += (De - $) * be, $ = De, Xe = 0; Xe < ke; ++Xe)
                  if ((qe = L[Xe]) < $ && ++ae > u && y("overflow"), qe == $) {
                    for (ne = ae, re = l; !(ne < (ve = re <= me ? P : re >= me + p ? p : re - me)); re += l)
                      Ke = ne - ve, Fe = l - ve, nt.push(R(te(ve + Ke % Fe, 0))), ne = k(Ke / Fe);
                    nt.push(R(te(ne, 0))), me = fe(ae, be, Pe == ge), ae = 0, ++Pe;
                  }
                ++ae, ++$;
              }
              return nt.join("");
            }
            if (d = { version: "1.4.1", ucs2: { decode: ee, encode: Z }, decode: _, encode: G, toASCII: function(L) {
              return Y(L, function($) {
                return w.test($) ? "xn--" + G($) : $;
              });
            }, toUnicode: function(L) {
              return Y(L, function($) {
                return j.test($) ? _($.slice(4).toLowerCase()) : $;
              });
            } }, a && f)
              if (r.exports == a)
                f.exports = d;
              else
                for (v in d)
                  d.hasOwnProperty(v) && (a[v] = d[v]);
            else
              s.punycode = d;
          })(this);
        }).call(this);
      }).call(this, typeof zi < "u" ? zi : typeof self < "u" ? self : typeof window < "u" ? window : {});
    }, {}], 52: [function(t, r, n) {
      function i(a, f) {
        return Object.prototype.hasOwnProperty.call(a, f);
      }
      r.exports = function(a, f, o, d) {
        f = f || "&", o = o || "=";
        var v = {};
        if (typeof a != "string" || a.length === 0)
          return v;
        var u = /\+/g;
        a = a.split(f);
        var l = 1e3;
        d && typeof d.maxKeys == "number" && (l = d.maxKeys);
        var P = a.length;
        l > 0 && P > l && (P = l);
        for (var p = 0; p < P; ++p) {
          var c, H, T, q, b = a[p].replace(u, "%20"), j = b.indexOf(o);
          j >= 0 ? (c = b.substr(0, j), H = b.substr(j + 1)) : (c = b, H = ""), T = decodeURIComponent(c), q = decodeURIComponent(H), i(v, T) ? s(v[T]) ? v[T].push(q) : v[T] = [v[T], q] : v[T] = q;
        }
        return v;
      };
      var s = Array.isArray || function(a) {
        return Object.prototype.toString.call(a) === "[object Array]";
      };
    }, {}], 53: [function(t, r, n) {
      var i = function(o) {
        switch (typeof o) {
          case "string":
            return o;
          case "boolean":
            return o ? "true" : "false";
          case "number":
            return isFinite(o) ? o : "";
          default:
            return "";
        }
      };
      r.exports = function(o, d, v, u) {
        return d = d || "&", v = v || "=", o === null && (o = void 0), typeof o == "object" ? a(f(o), function(l) {
          var P = encodeURIComponent(i(l)) + v;
          return s(o[l]) ? a(o[l], function(p) {
            return P + encodeURIComponent(i(p));
          }).join(d) : P + encodeURIComponent(i(o[l]));
        }).join(d) : u ? encodeURIComponent(i(u)) + v + encodeURIComponent(i(o)) : "";
      };
      var s = Array.isArray || function(o) {
        return Object.prototype.toString.call(o) === "[object Array]";
      };
      function a(o, d) {
        if (o.map)
          return o.map(d);
        for (var v = [], u = 0; u < o.length; u++)
          v.push(d(o[u], u));
        return v;
      }
      var f = Object.keys || function(o) {
        var d = [];
        for (var v in o)
          Object.prototype.hasOwnProperty.call(o, v) && d.push(v);
        return d;
      };
    }, {}], 54: [function(t, r, n) {
      n.decode = n.parse = t("./decode"), n.encode = n.stringify = t("./encode");
    }, { "./decode": 52, "./encode": 53 }], 55: [function(t, r, n) {
      var i = {};
      function s(f, o, d) {
        d || (d = Error);
        var v = function(u) {
          var l, P;
          function p(c, H, T) {
            return u.call(this, function(q, b, j) {
              return typeof o == "string" ? o : o(q, b, j);
            }(c, H, T)) || this;
          }
          return P = u, (l = p).prototype = Object.create(P.prototype), l.prototype.constructor = l, l.__proto__ = P, p;
        }(d);
        v.prototype.name = d.name, v.prototype.code = f, i[f] = v;
      }
      function a(f, o) {
        if (Array.isArray(f)) {
          var d = f.length;
          return f = f.map(function(v) {
            return String(v);
          }), d > 2 ? "one of ".concat(o, " ").concat(f.slice(0, d - 1).join(", "), ", or ") + f[d - 1] : d === 2 ? "one of ".concat(o, " ").concat(f[0], " or ").concat(f[1]) : "of ".concat(o, " ").concat(f[0]);
        }
        return "of ".concat(o, " ").concat(String(f));
      }
      s("ERR_INVALID_OPT_VALUE", function(f, o) {
        return 'The value "' + o + '" is invalid for option "' + f + '"';
      }, TypeError), s("ERR_INVALID_ARG_TYPE", function(f, o, d) {
        var v, u, l;
        if (typeof o == "string" && (u = "not ", o.substr(0, u.length) === u) ? (v = "must not be", o = o.replace(/^not /, "")) : v = "must be", function(p, c, H) {
          return (H === void 0 || H > p.length) && (H = p.length), p.substring(H - c.length, H) === c;
        }(f, " argument"))
          l = "The ".concat(f, " ").concat(v, " ").concat(a(o, "type"));
        else {
          var P = function(p, c, H) {
            return typeof H != "number" && (H = 0), !(H + c.length > p.length) && p.indexOf(c, H) !== -1;
          }(f, ".") ? "property" : "argument";
          l = 'The "'.concat(f, '" ').concat(P, " ").concat(v, " ").concat(a(o, "type"));
        }
        return l += ". Received type ".concat(typeof d);
      }, TypeError), s("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), s("ERR_METHOD_NOT_IMPLEMENTED", function(f) {
        return "The " + f + " method is not implemented";
      }), s("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), s("ERR_STREAM_DESTROYED", function(f) {
        return "Cannot call " + f + " after a stream was destroyed";
      }), s("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), s("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), s("ERR_STREAM_WRITE_AFTER_END", "write after end"), s("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), s("ERR_UNKNOWN_ENCODING", function(f) {
        return "Unknown encoding: " + f;
      }, TypeError), s("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), r.exports.codes = i;
    }, {}], 56: [function(t, r, n) {
      (function(i) {
        (function() {
          var s = Object.keys || function(p) {
            var c = [];
            for (var H in p)
              c.push(H);
            return c;
          };
          r.exports = u;
          var a = t("./_stream_readable"), f = t("./_stream_writable");
          t("inherits")(u, a);
          for (var o = s(f.prototype), d = 0; d < o.length; d++) {
            var v = o[d];
            u.prototype[v] || (u.prototype[v] = f.prototype[v]);
          }
          function u(p) {
            if (!(this instanceof u))
              return new u(p);
            a.call(this, p), f.call(this, p), this.allowHalfOpen = !0, p && (p.readable === !1 && (this.readable = !1), p.writable === !1 && (this.writable = !1), p.allowHalfOpen === !1 && (this.allowHalfOpen = !1, this.once("end", l)));
          }
          function l() {
            this._writableState.ended || i.nextTick(P, this);
          }
          function P(p) {
            p.end();
          }
          Object.defineProperty(u.prototype, "writableHighWaterMark", { enumerable: !1, get: function() {
            return this._writableState.highWaterMark;
          } }), Object.defineProperty(u.prototype, "writableBuffer", { enumerable: !1, get: function() {
            return this._writableState && this._writableState.getBuffer();
          } }), Object.defineProperty(u.prototype, "writableLength", { enumerable: !1, get: function() {
            return this._writableState.length;
          } }), Object.defineProperty(u.prototype, "destroyed", { enumerable: !1, get: function() {
            return this._readableState !== void 0 && this._writableState !== void 0 && this._readableState.destroyed && this._writableState.destroyed;
          }, set: function(p) {
            this._readableState !== void 0 && this._writableState !== void 0 && (this._readableState.destroyed = p, this._writableState.destroyed = p);
          } });
        }).call(this);
      }).call(this, t("_process"));
    }, { "./_stream_readable": 58, "./_stream_writable": 60, _process: 50, inherits: 24 }], 57: [function(t, r, n) {
      r.exports = s;
      var i = t("./_stream_transform");
      function s(a) {
        if (!(this instanceof s))
          return new s(a);
        i.call(this, a);
      }
      t("inherits")(s, i), s.prototype._transform = function(a, f, o) {
        o(null, a);
      };
    }, { "./_stream_transform": 59, inherits: 24 }], 58: [function(t, r, n) {
      (function(i, s) {
        (function() {
          var a;
          r.exports = y, y.ReadableState = R, t("events").EventEmitter;
          var f = function(ne, re) {
            return ne.listeners(re).length;
          }, o = t("./internal/streams/stream"), d = t("buffer").Buffer, v = s.Uint8Array || function() {
          }, u, l = t("util");
          u = l && l.debuglog ? l.debuglog("stream") : function() {
          };
          var P, p, c, H = t("./internal/streams/buffer_list"), T = t("./internal/streams/destroy"), q = t("./internal/streams/state").getHighWaterMark, b = t("../errors").codes, j = b.ERR_INVALID_ARG_TYPE, w = b.ERR_STREAM_PUSH_AFTER_EOF, m = b.ERR_METHOD_NOT_IMPLEMENTED, I = b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
          t("inherits")(y, o);
          var N = T.errorOrDestroy, k = ["error", "close", "destroy", "pause", "resume"];
          function R(ne, re, ve) {
            a = a || t("./_stream_duplex"), ne = ne || {}, typeof ve != "boolean" && (ve = re instanceof a), this.objectMode = !!ne.objectMode, ve && (this.objectMode = this.objectMode || !!ne.readableObjectMode), this.highWaterMark = q(this, ne, "readableHighWaterMark", ve), this.buffer = new H(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = ne.emitClose !== !1, this.autoDestroy = !!ne.autoDestroy, this.destroyed = !1, this.defaultEncoding = ne.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, ne.encoding && (P || (P = t("string_decoder/").StringDecoder), this.decoder = new P(ne.encoding), this.encoding = ne.encoding);
          }
          function y(ne) {
            if (a = a || t("./_stream_duplex"), !(this instanceof y))
              return new y(ne);
            var re = this instanceof a;
            this._readableState = new R(ne, this, re), this.readable = !0, ne && (typeof ne.read == "function" && (this._read = ne.read), typeof ne.destroy == "function" && (this._destroy = ne.destroy)), o.call(this);
          }
          function O(ne, re, ve, qe, ke) {
            u("readableAddChunk", re);
            var be, Fe = ne._readableState;
            if (re === null)
              Fe.reading = !1, function(Ke, nt) {
                if (u("onEofChunk"), !nt.ended) {
                  if (nt.decoder) {
                    var ut = nt.decoder.end();
                    ut && ut.length && (nt.buffer.push(ut), nt.length += nt.objectMode ? 1 : ut.length);
                  }
                  nt.ended = !0, nt.sync ? te(Ke) : (nt.needReadable = !1, nt.emittedReadable || (nt.emittedReadable = !0, fe(Ke)));
                }
              }(ne, Fe);
            else if (ke || (be = function(Ke, nt) {
              var ut;
              bt = nt, d.isBuffer(bt) || bt instanceof v || typeof nt == "string" || nt === void 0 || Ke.objectMode || (ut = new j("chunk", ["string", "Buffer", "Uint8Array"], nt));
              var bt;
              return ut;
            }(Fe, re)), be)
              N(ne, be);
            else if (Fe.objectMode || re && re.length > 0)
              if (typeof re == "string" || Fe.objectMode || Object.getPrototypeOf(re) === d.prototype || (re = function(Ke) {
                return d.from(Ke);
              }(re)), qe)
                Fe.endEmitted ? N(ne, new I()) : Y(ne, Fe, re, !0);
              else if (Fe.ended)
                N(ne, new w());
              else {
                if (Fe.destroyed)
                  return !1;
                Fe.reading = !1, Fe.decoder && !ve ? (re = Fe.decoder.write(re), Fe.objectMode || re.length !== 0 ? Y(ne, Fe, re, !1) : _(ne, Fe)) : Y(ne, Fe, re, !1);
              }
            else
              qe || (Fe.reading = !1, _(ne, Fe));
            return !Fe.ended && (Fe.length < Fe.highWaterMark || Fe.length === 0);
          }
          function Y(ne, re, ve, qe) {
            re.flowing && re.length === 0 && !re.sync ? (re.awaitDrain = 0, ne.emit("data", ve)) : (re.length += re.objectMode ? 1 : ve.length, qe ? re.buffer.unshift(ve) : re.buffer.push(ve), re.needReadable && te(ne)), _(ne, re);
          }
          Object.defineProperty(y.prototype, "destroyed", { enumerable: !1, get: function() {
            return this._readableState !== void 0 && this._readableState.destroyed;
          }, set: function(ne) {
            this._readableState && (this._readableState.destroyed = ne);
          } }), y.prototype.destroy = T.destroy, y.prototype._undestroy = T.undestroy, y.prototype._destroy = function(ne, re) {
            re(ne);
          }, y.prototype.push = function(ne, re) {
            var ve, qe = this._readableState;
            return qe.objectMode ? ve = !0 : typeof ne == "string" && ((re = re || qe.defaultEncoding) !== qe.encoding && (ne = d.from(ne, re), re = ""), ve = !0), O(this, ne, re, !1, ve);
          }, y.prototype.unshift = function(ne) {
            return O(this, ne, null, !0, !1);
          }, y.prototype.isPaused = function() {
            return this._readableState.flowing === !1;
          }, y.prototype.setEncoding = function(ne) {
            P || (P = t("string_decoder/").StringDecoder);
            var re = new P(ne);
            this._readableState.decoder = re, this._readableState.encoding = this._readableState.decoder.encoding;
            for (var ve = this._readableState.buffer.head, qe = ""; ve !== null; )
              qe += re.write(ve.data), ve = ve.next;
            return this._readableState.buffer.clear(), qe !== "" && this._readableState.buffer.push(qe), this._readableState.length = qe.length, this;
          };
          var ee = 1073741824;
          function Z(ne, re) {
            return ne <= 0 || re.length === 0 && re.ended ? 0 : re.objectMode ? 1 : ne != ne ? re.flowing && re.length ? re.buffer.head.data.length : re.length : (ne > re.highWaterMark && (re.highWaterMark = function(ve) {
              return ve >= ee ? ve = ee : (ve--, ve |= ve >>> 1, ve |= ve >>> 2, ve |= ve >>> 4, ve |= ve >>> 8, ve |= ve >>> 16, ve++), ve;
            }(ne)), ne <= re.length ? ne : re.ended ? re.length : (re.needReadable = !0, 0));
          }
          function te(ne) {
            var re = ne._readableState;
            u("emitReadable", re.needReadable, re.emittedReadable), re.needReadable = !1, re.emittedReadable || (u("emitReadable", re.flowing), re.emittedReadable = !0, i.nextTick(fe, ne));
          }
          function fe(ne) {
            var re = ne._readableState;
            u("emitReadable_", re.destroyed, re.length, re.ended), re.destroyed || !re.length && !re.ended || (ne.emit("readable"), re.emittedReadable = !1), re.needReadable = !re.flowing && !re.ended && re.length <= re.highWaterMark, Pe(ne);
          }
          function _(ne, re) {
            re.readingMore || (re.readingMore = !0, i.nextTick(G, ne, re));
          }
          function G(ne, re) {
            for (; !re.reading && !re.ended && (re.length < re.highWaterMark || re.flowing && re.length === 0); ) {
              var ve = re.length;
              if (u("maybeReadMore read 0"), ne.read(0), ve === re.length)
                break;
            }
            re.readingMore = !1;
          }
          function L(ne) {
            var re = ne._readableState;
            re.readableListening = ne.listenerCount("readable") > 0, re.resumeScheduled && !re.paused ? re.flowing = !0 : ne.listenerCount("data") > 0 && ne.resume();
          }
          function $(ne) {
            u("readable nexttick read 0"), ne.read(0);
          }
          function ae(ne, re) {
            u("resume", re.reading), re.reading || ne.read(0), re.resumeScheduled = !1, ne.emit("resume"), Pe(ne), re.flowing && !re.reading && ne.read(0);
          }
          function Pe(ne) {
            var re = ne._readableState;
            for (u("flow", re.flowing); re.flowing && ne.read() !== null; )
              ;
          }
          function ge(ne, re) {
            return re.length === 0 ? null : (re.objectMode ? ve = re.buffer.shift() : !ne || ne >= re.length ? (ve = re.decoder ? re.buffer.join("") : re.buffer.length === 1 ? re.buffer.first() : re.buffer.concat(re.length), re.buffer.clear()) : ve = re.buffer.consume(ne, re.decoder), ve);
            var ve;
          }
          function me(ne) {
            var re = ne._readableState;
            u("endReadable", re.endEmitted), re.endEmitted || (re.ended = !0, i.nextTick(Xe, re, ne));
          }
          function Xe(ne, re) {
            if (u("endReadableNT", ne.endEmitted, ne.length), !ne.endEmitted && ne.length === 0 && (ne.endEmitted = !0, re.readable = !1, re.emit("end"), ne.autoDestroy)) {
              var ve = re._writableState;
              (!ve || ve.autoDestroy && ve.finished) && re.destroy();
            }
          }
          function De(ne, re) {
            for (var ve = 0, qe = ne.length; ve < qe; ve++)
              if (ne[ve] === re)
                return ve;
            return -1;
          }
          y.prototype.read = function(ne) {
            u("read", ne), ne = parseInt(ne, 10);
            var re = this._readableState, ve = ne;
            if (ne !== 0 && (re.emittedReadable = !1), ne === 0 && re.needReadable && ((re.highWaterMark !== 0 ? re.length >= re.highWaterMark : re.length > 0) || re.ended))
              return u("read: emitReadable", re.length, re.ended), re.length === 0 && re.ended ? me(this) : te(this), null;
            if ((ne = Z(ne, re)) === 0 && re.ended)
              return re.length === 0 && me(this), null;
            var qe, ke = re.needReadable;
            return u("need readable", ke), (re.length === 0 || re.length - ne < re.highWaterMark) && u("length less than watermark", ke = !0), re.ended || re.reading ? u("reading or ended", ke = !1) : ke && (u("do read"), re.reading = !0, re.sync = !0, re.length === 0 && (re.needReadable = !0), this._read(re.highWaterMark), re.sync = !1, re.reading || (ne = Z(ve, re))), (qe = ne > 0 ? ge(ne, re) : null) === null ? (re.needReadable = re.length <= re.highWaterMark, ne = 0) : (re.length -= ne, re.awaitDrain = 0), re.length === 0 && (re.ended || (re.needReadable = !0), ve !== ne && re.ended && me(this)), qe !== null && this.emit("data", qe), qe;
          }, y.prototype._read = function(ne) {
            N(this, new m("_read()"));
          }, y.prototype.pipe = function(ne, re) {
            var ve = this, qe = this._readableState;
            switch (qe.pipesCount) {
              case 0:
                qe.pipes = ne;
                break;
              case 1:
                qe.pipes = [qe.pipes, ne];
                break;
              default:
                qe.pipes.push(ne);
            }
            qe.pipesCount += 1, u("pipe count=%d opts=%j", qe.pipesCount, re);
            var ke = (!re || re.end !== !1) && ne !== i.stdout && ne !== i.stderr ? Fe : lr;
            function be(Qt, tr) {
              u("onunpipe"), Qt === ve && tr && tr.hasUnpiped === !1 && (tr.hasUnpiped = !0, u("cleanup"), ne.removeListener("close", wt), ne.removeListener("finish", Tt), ne.removeListener("drain", Ke), ne.removeListener("error", bt), ne.removeListener("unpipe", be), ve.removeListener("end", Fe), ve.removeListener("end", lr), ve.removeListener("data", ut), nt = !0, !qe.awaitDrain || ne._writableState && !ne._writableState.needDrain || Ke());
            }
            function Fe() {
              u("onend"), ne.end();
            }
            qe.endEmitted ? i.nextTick(ke) : ve.once("end", ke), ne.on("unpipe", be);
            var Ke = /* @__PURE__ */ function(Qt) {
              return function() {
                var tr = Qt._readableState;
                u("pipeOnDrain", tr.awaitDrain), tr.awaitDrain && tr.awaitDrain--, tr.awaitDrain === 0 && f(Qt, "data") && (tr.flowing = !0, Pe(Qt));
              };
            }(ve);
            ne.on("drain", Ke);
            var nt = !1;
            function ut(Qt) {
              u("ondata");
              var tr = ne.write(Qt);
              u("dest.write", tr), tr === !1 && ((qe.pipesCount === 1 && qe.pipes === ne || qe.pipesCount > 1 && De(qe.pipes, ne) !== -1) && !nt && (u("false write response, pause", qe.awaitDrain), qe.awaitDrain++), ve.pause());
            }
            function bt(Qt) {
              u("onerror", Qt), lr(), ne.removeListener("error", bt), f(ne, "error") === 0 && N(ne, Qt);
            }
            function wt() {
              ne.removeListener("finish", Tt), lr();
            }
            function Tt() {
              u("onfinish"), ne.removeListener("close", wt), lr();
            }
            function lr() {
              u("unpipe"), ve.unpipe(ne);
            }
            return ve.on("data", ut), function(Qt, tr, br) {
              if (typeof Qt.prependListener == "function")
                return Qt.prependListener(tr, br);
              Qt._events && Qt._events[tr] ? Array.isArray(Qt._events[tr]) ? Qt._events[tr].unshift(br) : Qt._events[tr] = [br, Qt._events[tr]] : Qt.on(tr, br);
            }(ne, "error", bt), ne.once("close", wt), ne.once("finish", Tt), ne.emit("pipe", ve), qe.flowing || (u("pipe resume"), ve.resume()), ne;
          }, y.prototype.unpipe = function(ne) {
            var re = this._readableState, ve = { hasUnpiped: !1 };
            if (re.pipesCount === 0)
              return this;
            if (re.pipesCount === 1)
              return ne && ne !== re.pipes ? this : (ne || (ne = re.pipes), re.pipes = null, re.pipesCount = 0, re.flowing = !1, ne && ne.emit("unpipe", this, ve), this);
            if (!ne) {
              var qe = re.pipes, ke = re.pipesCount;
              re.pipes = null, re.pipesCount = 0, re.flowing = !1;
              for (var be = 0; be < ke; be++)
                qe[be].emit("unpipe", this, { hasUnpiped: !1 });
              return this;
            }
            var Fe = De(re.pipes, ne);
            return Fe === -1 ? this : (re.pipes.splice(Fe, 1), re.pipesCount -= 1, re.pipesCount === 1 && (re.pipes = re.pipes[0]), ne.emit("unpipe", this, ve), this);
          }, y.prototype.on = function(ne, re) {
            var ve = o.prototype.on.call(this, ne, re), qe = this._readableState;
            return ne === "data" ? (qe.readableListening = this.listenerCount("readable") > 0, qe.flowing !== !1 && this.resume()) : ne === "readable" && (qe.endEmitted || qe.readableListening || (qe.readableListening = qe.needReadable = !0, qe.flowing = !1, qe.emittedReadable = !1, u("on readable", qe.length, qe.reading), qe.length ? te(this) : qe.reading || i.nextTick($, this))), ve;
          }, y.prototype.addListener = y.prototype.on, y.prototype.removeListener = function(ne, re) {
            var ve = o.prototype.removeListener.call(this, ne, re);
            return ne === "readable" && i.nextTick(L, this), ve;
          }, y.prototype.removeAllListeners = function(ne) {
            var re = o.prototype.removeAllListeners.apply(this, arguments);
            return ne !== "readable" && ne !== void 0 || i.nextTick(L, this), re;
          }, y.prototype.resume = function() {
            var ne = this._readableState;
            return ne.flowing || (u("resume"), ne.flowing = !ne.readableListening, function(re, ve) {
              ve.resumeScheduled || (ve.resumeScheduled = !0, i.nextTick(ae, re, ve));
            }(this, ne)), ne.paused = !1, this;
          }, y.prototype.pause = function() {
            return u("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (u("pause"), this._readableState.flowing = !1, this.emit("pause")), this._readableState.paused = !0, this;
          }, y.prototype.wrap = function(ne) {
            var re = this, ve = this._readableState, qe = !1;
            for (var ke in ne.on("end", function() {
              if (u("wrapped end"), ve.decoder && !ve.ended) {
                var Fe = ve.decoder.end();
                Fe && Fe.length && re.push(Fe);
              }
              re.push(null);
            }), ne.on("data", function(Fe) {
              u("wrapped data"), ve.decoder && (Fe = ve.decoder.write(Fe)), (!ve.objectMode || Fe != null) && (ve.objectMode || Fe && Fe.length) && (re.push(Fe) || (qe = !0, ne.pause()));
            }), ne)
              this[ke] === void 0 && typeof ne[ke] == "function" && (this[ke] = /* @__PURE__ */ function(Fe) {
                return function() {
                  return ne[Fe].apply(ne, arguments);
                };
              }(ke));
            for (var be = 0; be < k.length; be++)
              ne.on(k[be], this.emit.bind(this, k[be]));
            return this._read = function(Fe) {
              u("wrapped _read", Fe), qe && (qe = !1, ne.resume());
            }, this;
          }, typeof Symbol == "function" && (y.prototype[Symbol.asyncIterator] = function() {
            return p === void 0 && (p = t("./internal/streams/async_iterator")), p(this);
          }), Object.defineProperty(y.prototype, "readableHighWaterMark", { enumerable: !1, get: function() {
            return this._readableState.highWaterMark;
          } }), Object.defineProperty(y.prototype, "readableBuffer", { enumerable: !1, get: function() {
            return this._readableState && this._readableState.buffer;
          } }), Object.defineProperty(y.prototype, "readableFlowing", { enumerable: !1, get: function() {
            return this._readableState.flowing;
          }, set: function(ne) {
            this._readableState && (this._readableState.flowing = ne);
          } }), y._fromList = ge, Object.defineProperty(y.prototype, "readableLength", { enumerable: !1, get: function() {
            return this._readableState.length;
          } }), typeof Symbol == "function" && (y.from = function(ne, re) {
            return c === void 0 && (c = t("./internal/streams/from")), c(y, ne, re);
          });
        }).call(this);
      }).call(this, t("_process"), typeof zi < "u" ? zi : typeof self < "u" ? self : typeof window < "u" ? window : {});
    }, { "../errors": 55, "./_stream_duplex": 56, "./internal/streams/async_iterator": 61, "./internal/streams/buffer_list": 62, "./internal/streams/destroy": 63, "./internal/streams/from": 65, "./internal/streams/state": 67, "./internal/streams/stream": 68, _process: 50, buffer: 17, events: 22, inherits: 24, "string_decoder/": 75, util: 16 }], 59: [function(t, r, n) {
      r.exports = v;
      var i = t("../errors").codes, s = i.ERR_METHOD_NOT_IMPLEMENTED, a = i.ERR_MULTIPLE_CALLBACK, f = i.ERR_TRANSFORM_ALREADY_TRANSFORMING, o = i.ERR_TRANSFORM_WITH_LENGTH_0, d = t("./_stream_duplex");
      function v(P) {
        if (!(this instanceof v))
          return new v(P);
        d.call(this, P), this._transformState = { afterTransform: (function(p, c) {
          var H = this._transformState;
          H.transforming = !1;
          var T = H.writecb;
          if (T === null)
            return this.emit("error", new a());
          H.writechunk = null, H.writecb = null, c != null && this.push(c), T(p);
          var q = this._readableState;
          q.reading = !1, (q.needReadable || q.length < q.highWaterMark) && this._read(q.highWaterMark);
        }).bind(this), needTransform: !1, transforming: !1, writecb: null, writechunk: null, writeencoding: null }, this._readableState.needReadable = !0, this._readableState.sync = !1, P && (typeof P.transform == "function" && (this._transform = P.transform), typeof P.flush == "function" && (this._flush = P.flush)), this.on("prefinish", u);
      }
      function u() {
        var P = this;
        typeof this._flush != "function" || this._readableState.destroyed ? l(this, null, null) : this._flush(function(p, c) {
          l(P, p, c);
        });
      }
      function l(P, p, c) {
        if (p)
          return P.emit("error", p);
        if (c != null && P.push(c), P._writableState.length)
          throw new o();
        if (P._transformState.transforming)
          throw new f();
        return P.push(null);
      }
      t("inherits")(v, d), v.prototype.push = function(P, p) {
        return this._transformState.needTransform = !1, d.prototype.push.call(this, P, p);
      }, v.prototype._transform = function(P, p, c) {
        c(new s("_transform()"));
      }, v.prototype._write = function(P, p, c) {
        var H = this._transformState;
        if (H.writecb = c, H.writechunk = P, H.writeencoding = p, !H.transforming) {
          var T = this._readableState;
          (H.needTransform || T.needReadable || T.length < T.highWaterMark) && this._read(T.highWaterMark);
        }
      }, v.prototype._read = function(P) {
        var p = this._transformState;
        p.writechunk === null || p.transforming ? p.needTransform = !0 : (p.transforming = !0, this._transform(p.writechunk, p.writeencoding, p.afterTransform));
      }, v.prototype._destroy = function(P, p) {
        d.prototype._destroy.call(this, P, function(c) {
          p(c);
        });
      };
    }, { "../errors": 55, "./_stream_duplex": 56, inherits: 24 }], 60: [function(t, r, n) {
      (function(i, s) {
        (function() {
          function a(_) {
            var G = this;
            this.next = null, this.entry = null, this.finish = function() {
              (function(L, $, ae) {
                var Pe = L.entry;
                for (L.entry = null; Pe; ) {
                  var ge = Pe.callback;
                  $.pendingcb--, ge(ae), Pe = Pe.next;
                }
                $.corkedRequestsFree.next = L;
              })(G, _);
            };
          }
          var f;
          r.exports = y, y.WritableState = R;
          var o = { deprecate: t("util-deprecate") }, d = t("./internal/streams/stream"), v = t("buffer").Buffer, u = s.Uint8Array || function() {
          }, l, P = t("./internal/streams/destroy"), p = t("./internal/streams/state").getHighWaterMark, c = t("../errors").codes, H = c.ERR_INVALID_ARG_TYPE, T = c.ERR_METHOD_NOT_IMPLEMENTED, q = c.ERR_MULTIPLE_CALLBACK, b = c.ERR_STREAM_CANNOT_PIPE, j = c.ERR_STREAM_DESTROYED, w = c.ERR_STREAM_NULL_VALUES, m = c.ERR_STREAM_WRITE_AFTER_END, I = c.ERR_UNKNOWN_ENCODING, N = P.errorOrDestroy;
          function k() {
          }
          function R(_, G, L) {
            f = f || t("./_stream_duplex"), _ = _ || {}, typeof L != "boolean" && (L = G instanceof f), this.objectMode = !!_.objectMode, L && (this.objectMode = this.objectMode || !!_.writableObjectMode), this.highWaterMark = p(this, _, "writableHighWaterMark", L), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
            var $ = _.decodeStrings === !1;
            this.decodeStrings = !$, this.defaultEncoding = _.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(ae) {
              (function(Pe, ge) {
                var me = Pe._writableState, Xe = me.sync, De = me.writecb;
                if (typeof De != "function")
                  throw new q();
                if (function(re) {
                  re.writing = !1, re.writecb = null, re.length -= re.writelen, re.writelen = 0;
                }(me), ge)
                  (function(re, ve, qe, ke, be) {
                    --ve.pendingcb, qe ? (i.nextTick(be, ke), i.nextTick(fe, re, ve), re._writableState.errorEmitted = !0, N(re, ke)) : (be(ke), re._writableState.errorEmitted = !0, N(re, ke), fe(re, ve));
                  })(Pe, me, Xe, ge, De);
                else {
                  var ne = Z(me) || Pe.destroyed;
                  ne || me.corked || me.bufferProcessing || !me.bufferedRequest || ee(Pe, me), Xe ? i.nextTick(Y, Pe, me, ne, De) : Y(Pe, me, ne, De);
                }
              })(G, ae);
            }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = _.emitClose !== !1, this.autoDestroy = !!_.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new a(this);
          }
          function y(_) {
            var G = this instanceof (f = f || t("./_stream_duplex"));
            if (!G && !l.call(y, this))
              return new y(_);
            this._writableState = new R(_, this, G), this.writable = !0, _ && (typeof _.write == "function" && (this._write = _.write), typeof _.writev == "function" && (this._writev = _.writev), typeof _.destroy == "function" && (this._destroy = _.destroy), typeof _.final == "function" && (this._final = _.final)), d.call(this);
          }
          function O(_, G, L, $, ae, Pe, ge) {
            G.writelen = $, G.writecb = ge, G.writing = !0, G.sync = !0, G.destroyed ? G.onwrite(new j("write")) : L ? _._writev(ae, G.onwrite) : _._write(ae, Pe, G.onwrite), G.sync = !1;
          }
          function Y(_, G, L, $) {
            L || function(ae, Pe) {
              Pe.length === 0 && Pe.needDrain && (Pe.needDrain = !1, ae.emit("drain"));
            }(_, G), G.pendingcb--, $(), fe(_, G);
          }
          function ee(_, G) {
            G.bufferProcessing = !0;
            var L = G.bufferedRequest;
            if (_._writev && L && L.next) {
              var $ = G.bufferedRequestCount, ae = new Array($), Pe = G.corkedRequestsFree;
              Pe.entry = L;
              for (var ge = 0, me = !0; L; )
                ae[ge] = L, L.isBuf || (me = !1), L = L.next, ge += 1;
              ae.allBuffers = me, O(_, G, !0, G.length, ae, "", Pe.finish), G.pendingcb++, G.lastBufferedRequest = null, Pe.next ? (G.corkedRequestsFree = Pe.next, Pe.next = null) : G.corkedRequestsFree = new a(G), G.bufferedRequestCount = 0;
            } else {
              for (; L; ) {
                var Xe = L.chunk, De = L.encoding, ne = L.callback;
                if (O(_, G, !1, G.objectMode ? 1 : Xe.length, Xe, De, ne), L = L.next, G.bufferedRequestCount--, G.writing)
                  break;
              }
              L === null && (G.lastBufferedRequest = null);
            }
            G.bufferedRequest = L, G.bufferProcessing = !1;
          }
          function Z(_) {
            return _.ending && _.length === 0 && _.bufferedRequest === null && !_.finished && !_.writing;
          }
          function te(_, G) {
            _._final(function(L) {
              G.pendingcb--, L && N(_, L), G.prefinished = !0, _.emit("prefinish"), fe(_, G);
            });
          }
          function fe(_, G) {
            var L = Z(G);
            if (L && (function(ae, Pe) {
              Pe.prefinished || Pe.finalCalled || (typeof ae._final != "function" || Pe.destroyed ? (Pe.prefinished = !0, ae.emit("prefinish")) : (Pe.pendingcb++, Pe.finalCalled = !0, i.nextTick(te, ae, Pe)));
            }(_, G), G.pendingcb === 0 && (G.finished = !0, _.emit("finish"), G.autoDestroy))) {
              var $ = _._readableState;
              (!$ || $.autoDestroy && $.endEmitted) && _.destroy();
            }
            return L;
          }
          t("inherits")(y, d), R.prototype.getBuffer = function() {
            for (var _ = this.bufferedRequest, G = []; _; )
              G.push(_), _ = _.next;
            return G;
          }, function() {
            try {
              Object.defineProperty(R.prototype, "buffer", { get: o.deprecate(function() {
                return this.getBuffer();
              }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") });
            } catch {
            }
          }(), typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (l = Function.prototype[Symbol.hasInstance], Object.defineProperty(y, Symbol.hasInstance, { value: function(_) {
            return !!l.call(this, _) || this === y && _ && _._writableState instanceof R;
          } })) : l = function(_) {
            return _ instanceof this;
          }, y.prototype.pipe = function() {
            N(this, new b());
          }, y.prototype.write = function(_, G, L) {
            var $, ae = this._writableState, Pe = !1, ge = !ae.objectMode && ($ = _, v.isBuffer($) || $ instanceof u);
            return ge && !v.isBuffer(_) && (_ = function(me) {
              return v.from(me);
            }(_)), typeof G == "function" && (L = G, G = null), ge ? G = "buffer" : G || (G = ae.defaultEncoding), typeof L != "function" && (L = k), ae.ending ? function(me, Xe) {
              var De = new m();
              N(me, De), i.nextTick(Xe, De);
            }(this, L) : (ge || function(me, Xe, De, ne) {
              var re;
              return De === null ? re = new w() : typeof De == "string" || Xe.objectMode || (re = new H("chunk", ["string", "Buffer"], De)), !re || (N(me, re), i.nextTick(ne, re), !1);
            }(this, ae, _, L)) && (ae.pendingcb++, Pe = function(me, Xe, De, ne, re, ve) {
              if (!De) {
                var qe = function(Ke, nt, ut) {
                  return Ke.objectMode || Ke.decodeStrings === !1 || typeof nt != "string" || (nt = v.from(nt, ut)), nt;
                }(Xe, ne, re);
                ne !== qe && (De = !0, re = "buffer", ne = qe);
              }
              var ke = Xe.objectMode ? 1 : ne.length;
              Xe.length += ke;
              var be = Xe.length < Xe.highWaterMark;
              if (be || (Xe.needDrain = !0), Xe.writing || Xe.corked) {
                var Fe = Xe.lastBufferedRequest;
                Xe.lastBufferedRequest = { chunk: ne, encoding: re, isBuf: De, callback: ve, next: null }, Fe ? Fe.next = Xe.lastBufferedRequest : Xe.bufferedRequest = Xe.lastBufferedRequest, Xe.bufferedRequestCount += 1;
              } else
                O(me, Xe, !1, ke, ne, re, ve);
              return be;
            }(this, ae, ge, _, G, L)), Pe;
          }, y.prototype.cork = function() {
            this._writableState.corked++;
          }, y.prototype.uncork = function() {
            var _ = this._writableState;
            _.corked && (_.corked--, _.writing || _.corked || _.bufferProcessing || !_.bufferedRequest || ee(this, _));
          }, y.prototype.setDefaultEncoding = function(_) {
            if (typeof _ == "string" && (_ = _.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((_ + "").toLowerCase()) > -1))
              throw new I(_);
            return this._writableState.defaultEncoding = _, this;
          }, Object.defineProperty(y.prototype, "writableBuffer", { enumerable: !1, get: function() {
            return this._writableState && this._writableState.getBuffer();
          } }), Object.defineProperty(y.prototype, "writableHighWaterMark", { enumerable: !1, get: function() {
            return this._writableState.highWaterMark;
          } }), y.prototype._write = function(_, G, L) {
            L(new T("_write()"));
          }, y.prototype._writev = null, y.prototype.end = function(_, G, L) {
            var $ = this._writableState;
            return typeof _ == "function" ? (L = _, _ = null, G = null) : typeof G == "function" && (L = G, G = null), _ != null && this.write(_, G), $.corked && ($.corked = 1, this.uncork()), $.ending || function(ae, Pe, ge) {
              Pe.ending = !0, fe(ae, Pe), ge && (Pe.finished ? i.nextTick(ge) : ae.once("finish", ge)), Pe.ended = !0, ae.writable = !1;
            }(this, $, L), this;
          }, Object.defineProperty(y.prototype, "writableLength", { enumerable: !1, get: function() {
            return this._writableState.length;
          } }), Object.defineProperty(y.prototype, "destroyed", { enumerable: !1, get: function() {
            return this._writableState !== void 0 && this._writableState.destroyed;
          }, set: function(_) {
            this._writableState && (this._writableState.destroyed = _);
          } }), y.prototype.destroy = P.destroy, y.prototype._undestroy = P.undestroy, y.prototype._destroy = function(_, G) {
            G(_);
          };
        }).call(this);
      }).call(this, t("_process"), typeof zi < "u" ? zi : typeof self < "u" ? self : typeof window < "u" ? window : {});
    }, { "../errors": 55, "./_stream_duplex": 56, "./internal/streams/destroy": 63, "./internal/streams/state": 67, "./internal/streams/stream": 68, _process: 50, buffer: 17, inherits: 24, "util-deprecate": 78 }], 61: [function(t, r, n) {
      (function(i) {
        (function() {
          var s;
          function a(b, j, w) {
            return j in b ? Object.defineProperty(b, j, { value: w, enumerable: !0, configurable: !0, writable: !0 }) : b[j] = w, b;
          }
          var f = t("./end-of-stream"), o = Symbol("lastResolve"), d = Symbol("lastReject"), v = Symbol("error"), u = Symbol("ended"), l = Symbol("lastPromise"), P = Symbol("handlePromise"), p = Symbol("stream");
          function c(b, j) {
            return { value: b, done: j };
          }
          function H(b) {
            var j = b[o];
            if (j !== null) {
              var w = b[p].read();
              w !== null && (b[l] = null, b[o] = null, b[d] = null, j(c(w, !1)));
            }
          }
          var T = Object.getPrototypeOf(function() {
          }), q = Object.setPrototypeOf((a(s = { get stream() {
            return this[p];
          }, next: function() {
            var b = this, j = this[v];
            if (j !== null)
              return Promise.reject(j);
            if (this[u])
              return Promise.resolve(c(void 0, !0));
            if (this[p].destroyed)
              return new Promise(function(N, k) {
                i.nextTick(function() {
                  b[v] ? k(b[v]) : N(c(void 0, !0));
                });
              });
            var w, m = this[l];
            if (m)
              w = new Promise(/* @__PURE__ */ function(N, k) {
                return function(R, y) {
                  N.then(function() {
                    k[u] ? R(c(void 0, !0)) : k[P](R, y);
                  }, y);
                };
              }(m, this));
            else {
              var I = this[p].read();
              if (I !== null)
                return Promise.resolve(c(I, !1));
              w = new Promise(this[P]);
            }
            return this[l] = w, w;
          } }, Symbol.asyncIterator, function() {
            return this;
          }), a(s, "return", function() {
            var b = this;
            return new Promise(function(j, w) {
              b[p].destroy(null, function(m) {
                m ? w(m) : j(c(void 0, !0));
              });
            });
          }), s), T);
          r.exports = function(b) {
            var j, w = Object.create(q, (a(j = {}, p, { value: b, writable: !0 }), a(j, o, { value: null, writable: !0 }), a(j, d, { value: null, writable: !0 }), a(j, v, { value: null, writable: !0 }), a(j, u, { value: b._readableState.endEmitted, writable: !0 }), a(j, P, { value: function(m, I) {
              var N = w[p].read();
              N ? (w[l] = null, w[o] = null, w[d] = null, m(c(N, !1))) : (w[o] = m, w[d] = I);
            }, writable: !0 }), j));
            return w[l] = null, f(b, function(m) {
              if (m && m.code !== "ERR_STREAM_PREMATURE_CLOSE") {
                var I = w[d];
                return I !== null && (w[l] = null, w[o] = null, w[d] = null, I(m)), void (w[v] = m);
              }
              var N = w[o];
              N !== null && (w[l] = null, w[o] = null, w[d] = null, N(c(void 0, !0))), w[u] = !0;
            }), b.on("readable", (function(m) {
              i.nextTick(H, m);
            }).bind(null, w)), w;
          };
        }).call(this);
      }).call(this, t("_process"));
    }, { "./end-of-stream": 64, _process: 50 }], 62: [function(t, r, n) {
      function i(v, u) {
        var l = Object.keys(v);
        if (Object.getOwnPropertySymbols) {
          var P = Object.getOwnPropertySymbols(v);
          u && (P = P.filter(function(p) {
            return Object.getOwnPropertyDescriptor(v, p).enumerable;
          })), l.push.apply(l, P);
        }
        return l;
      }
      function s(v, u, l) {
        return u in v ? Object.defineProperty(v, u, { value: l, enumerable: !0, configurable: !0, writable: !0 }) : v[u] = l, v;
      }
      function a(v, u) {
        for (var l = 0; l < u.length; l++) {
          var P = u[l];
          P.enumerable = P.enumerable || !1, P.configurable = !0, "value" in P && (P.writable = !0), Object.defineProperty(v, P.key, P);
        }
      }
      var f = t("buffer").Buffer, o = t("util").inspect, d = o && o.custom || "inspect";
      r.exports = function() {
        function v() {
          (function(P, p) {
            if (!(P instanceof p))
              throw new TypeError("Cannot call a class as a function");
          })(this, v), this.head = null, this.tail = null, this.length = 0;
        }
        var u, l;
        return u = v, (l = [{ key: "push", value: function(P) {
          var p = { data: P, next: null };
          this.length > 0 ? this.tail.next = p : this.head = p, this.tail = p, ++this.length;
        } }, { key: "unshift", value: function(P) {
          var p = { data: P, next: this.head };
          this.length === 0 && (this.tail = p), this.head = p, ++this.length;
        } }, { key: "shift", value: function() {
          if (this.length !== 0) {
            var P = this.head.data;
            return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, P;
          }
        } }, { key: "clear", value: function() {
          this.head = this.tail = null, this.length = 0;
        } }, { key: "join", value: function(P) {
          if (this.length === 0)
            return "";
          for (var p = this.head, c = "" + p.data; p = p.next; )
            c += P + p.data;
          return c;
        } }, { key: "concat", value: function(P) {
          if (this.length === 0)
            return f.alloc(0);
          for (var p, c, H, T = f.allocUnsafe(P >>> 0), q = this.head, b = 0; q; )
            p = q.data, c = T, H = b, f.prototype.copy.call(p, c, H), b += q.data.length, q = q.next;
          return T;
        } }, { key: "consume", value: function(P, p) {
          var c;
          return P < this.head.data.length ? (c = this.head.data.slice(0, P), this.head.data = this.head.data.slice(P)) : c = P === this.head.data.length ? this.shift() : p ? this._getString(P) : this._getBuffer(P), c;
        } }, { key: "first", value: function() {
          return this.head.data;
        } }, { key: "_getString", value: function(P) {
          var p = this.head, c = 1, H = p.data;
          for (P -= H.length; p = p.next; ) {
            var T = p.data, q = P > T.length ? T.length : P;
            if (q === T.length ? H += T : H += T.slice(0, P), (P -= q) === 0) {
              q === T.length ? (++c, p.next ? this.head = p.next : this.head = this.tail = null) : (this.head = p, p.data = T.slice(q));
              break;
            }
            ++c;
          }
          return this.length -= c, H;
        } }, { key: "_getBuffer", value: function(P) {
          var p = f.allocUnsafe(P), c = this.head, H = 1;
          for (c.data.copy(p), P -= c.data.length; c = c.next; ) {
            var T = c.data, q = P > T.length ? T.length : P;
            if (T.copy(p, p.length - P, 0, q), (P -= q) === 0) {
              q === T.length ? (++H, c.next ? this.head = c.next : this.head = this.tail = null) : (this.head = c, c.data = T.slice(q));
              break;
            }
            ++H;
          }
          return this.length -= H, p;
        } }, { key: d, value: function(P, p) {
          return o(this, function(c) {
            for (var H = 1; H < arguments.length; H++) {
              var T = arguments[H] != null ? arguments[H] : {};
              H % 2 ? i(Object(T), !0).forEach(function(q) {
                s(c, q, T[q]);
              }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(c, Object.getOwnPropertyDescriptors(T)) : i(Object(T)).forEach(function(q) {
                Object.defineProperty(c, q, Object.getOwnPropertyDescriptor(T, q));
              });
            }
            return c;
          }({}, p, { depth: 0, customInspect: !1 }));
        } }]) && a(u.prototype, l), v;
      }();
    }, { buffer: 17, util: 16 }], 63: [function(t, r, n) {
      (function(i) {
        (function() {
          function s(o, d) {
            f(o, d), a(o);
          }
          function a(o) {
            o._writableState && !o._writableState.emitClose || o._readableState && !o._readableState.emitClose || o.emit("close");
          }
          function f(o, d) {
            o.emit("error", d);
          }
          r.exports = { destroy: function(o, d) {
            var v = this, u = this._readableState && this._readableState.destroyed, l = this._writableState && this._writableState.destroyed;
            return u || l ? (d ? d(o) : o && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, i.nextTick(f, this, o)) : i.nextTick(f, this, o)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(o || null, function(P) {
              !d && P ? v._writableState ? v._writableState.errorEmitted ? i.nextTick(a, v) : (v._writableState.errorEmitted = !0, i.nextTick(s, v, P)) : i.nextTick(s, v, P) : d ? (i.nextTick(a, v), d(P)) : i.nextTick(a, v);
            }), this);
          }, undestroy: function() {
            this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1);
          }, errorOrDestroy: function(o, d) {
            var v = o._readableState, u = o._writableState;
            v && v.autoDestroy || u && u.autoDestroy ? o.destroy(d) : o.emit("error", d);
          } };
        }).call(this);
      }).call(this, t("_process"));
    }, { _process: 50 }], 64: [function(t, r, n) {
      var i = t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;
      function s() {
      }
      r.exports = function a(f, o, d) {
        if (typeof o == "function")
          return a(f, null, o);
        o || (o = {}), d = /* @__PURE__ */ function(j) {
          var w = !1;
          return function() {
            if (!w) {
              w = !0;
              for (var m = arguments.length, I = new Array(m), N = 0; N < m; N++)
                I[N] = arguments[N];
              j.apply(this, I);
            }
          };
        }(d || s);
        var v = o.readable || o.readable !== !1 && f.readable, u = o.writable || o.writable !== !1 && f.writable, l = function() {
          f.writable || p();
        }, P = f._writableState && f._writableState.finished, p = function() {
          u = !1, P = !0, v || d.call(f);
        }, c = f._readableState && f._readableState.endEmitted, H = function() {
          v = !1, c = !0, u || d.call(f);
        }, T = function(j) {
          d.call(f, j);
        }, q = function() {
          var j;
          return v && !c ? (f._readableState && f._readableState.ended || (j = new i()), d.call(f, j)) : u && !P ? (f._writableState && f._writableState.ended || (j = new i()), d.call(f, j)) : void 0;
        }, b = function() {
          f.req.on("finish", p);
        };
        return function(j) {
          return j.setHeader && typeof j.abort == "function";
        }(f) ? (f.on("complete", p), f.on("abort", q), f.req ? b() : f.on("request", b)) : u && !f._writableState && (f.on("end", l), f.on("close", l)), f.on("end", H), f.on("finish", p), o.error !== !1 && f.on("error", T), f.on("close", q), function() {
          f.removeListener("complete", p), f.removeListener("abort", q), f.removeListener("request", b), f.req && f.req.removeListener("finish", p), f.removeListener("end", l), f.removeListener("close", l), f.removeListener("finish", p), f.removeListener("end", H), f.removeListener("error", T), f.removeListener("close", q);
        };
      };
    }, { "../../../errors": 55 }], 65: [function(t, r, n) {
      r.exports = function() {
        throw new Error("Readable.from is not available in the browser");
      };
    }, {}], 66: [function(t, r, n) {
      var i, s = t("../../../errors").codes, a = s.ERR_MISSING_ARGS, f = s.ERR_STREAM_DESTROYED;
      function o(u) {
        if (u)
          throw u;
      }
      function d(u) {
        u();
      }
      function v(u, l) {
        return u.pipe(l);
      }
      r.exports = function() {
        for (var u = arguments.length, l = new Array(u), P = 0; P < u; P++)
          l[P] = arguments[P];
        var p, c = function(T) {
          return T.length ? typeof T[T.length - 1] != "function" ? o : T.pop() : o;
        }(l);
        if (Array.isArray(l[0]) && (l = l[0]), l.length < 2)
          throw new a("streams");
        var H = l.map(function(T, q) {
          var b = q < l.length - 1;
          return function(j, w, m, I) {
            I = /* @__PURE__ */ function(R) {
              var y = !1;
              return function() {
                y || (y = !0, R.apply(void 0, arguments));
              };
            }(I);
            var N = !1;
            j.on("close", function() {
              N = !0;
            }), i === void 0 && (i = t("./end-of-stream")), i(j, { readable: w, writable: m }, function(R) {
              if (R)
                return I(R);
              N = !0, I();
            });
            var k = !1;
            return function(R) {
              if (!N && !k)
                return k = !0, function(y) {
                  return y.setHeader && typeof y.abort == "function";
                }(j) ? j.abort() : typeof j.destroy == "function" ? j.destroy() : void I(R || new f("pipe"));
            };
          }(T, b, q > 0, function(j) {
            p || (p = j), j && H.forEach(d), b || (H.forEach(d), c(p));
          });
        });
        return l.reduce(v);
      };
    }, { "../../../errors": 55, "./end-of-stream": 64 }], 67: [function(t, r, n) {
      var i = t("../../../errors").codes.ERR_INVALID_OPT_VALUE;
      r.exports = { getHighWaterMark: function(s, a, f, o) {
        var d = function(v, u, l) {
          return v.highWaterMark != null ? v.highWaterMark : u ? v[l] : null;
        }(a, o, f);
        if (d != null) {
          if (!isFinite(d) || Math.floor(d) !== d || d < 0)
            throw new i(o ? f : "highWaterMark", d);
          return Math.floor(d);
        }
        return s.objectMode ? 16 : 16384;
      } };
    }, { "../../../errors": 55 }], 68: [function(t, r, n) {
      r.exports = t("events").EventEmitter;
    }, { events: 22 }], 69: [function(t, r, n) {
      (n = r.exports = t("./lib/_stream_readable.js")).Stream = n, n.Readable = n, n.Writable = t("./lib/_stream_writable.js"), n.Duplex = t("./lib/_stream_duplex.js"), n.Transform = t("./lib/_stream_transform.js"), n.PassThrough = t("./lib/_stream_passthrough.js"), n.finished = t("./lib/internal/streams/end-of-stream.js"), n.pipeline = t("./lib/internal/streams/pipeline.js");
    }, { "./lib/_stream_duplex.js": 56, "./lib/_stream_passthrough.js": 57, "./lib/_stream_readable.js": 58, "./lib/_stream_transform.js": 59, "./lib/_stream_writable.js": 60, "./lib/internal/streams/end-of-stream.js": 64, "./lib/internal/streams/pipeline.js": 66 }], 70: [function(t, r, n) {
      r.exports = function() {
        if (typeof arguments[0] != "function")
          throw new Error("callback needed");
        if (typeof arguments[1] != "number")
          throw new Error("interval needed");
        var i;
        if (arguments.length > 0) {
          i = new Array(arguments.length - 2);
          for (var s = 0; s < i.length; s++)
            i[s] = arguments[s + 2];
        }
        return new function(a, f, o) {
          var d = this;
          this._callback = a, this._args = o, this._interval = setInterval(a, f, this._args), this.reschedule = function(v) {
            v || (v = d._interval), d._interval && clearInterval(d._interval), d._interval = setInterval(d._callback, v, d._args);
          }, this.clear = function() {
            d._interval && (clearInterval(d._interval), d._interval = void 0);
          }, this.destroy = function() {
            d._interval && clearInterval(d._interval), d._callback = void 0, d._interval = void 0, d._args = void 0;
          };
        }(arguments[0], arguments[1], i);
      };
    }, {}], 71: [function(t, r, n) {
      r.exports = t("./index.js")();
    }, { "./index.js": 72 }], 72: [function(t, r, n) {
      (function(i) {
        (function() {
          function s(a) {
            return a instanceof i ? i.from(a) : new a.constructor(a.buffer.slice(), a.byteOffset, a.length);
          }
          r.exports = function(a) {
            return (a = a || {}).circles ? function(o) {
              var d = [], v = [];
              return o.proto ? function l(P) {
                if (typeof P != "object" || P === null)
                  return P;
                if (P instanceof Date)
                  return new Date(P);
                if (Array.isArray(P))
                  return u(P, l);
                if (P instanceof Map)
                  return new Map(u(Array.from(P), l));
                if (P instanceof Set)
                  return new Set(u(Array.from(P), l));
                var p = {};
                for (var c in d.push(P), v.push(p), P) {
                  var H = P[c];
                  if (typeof H != "object" || H === null)
                    p[c] = H;
                  else if (H instanceof Date)
                    p[c] = new Date(H);
                  else if (H instanceof Map)
                    p[c] = new Map(u(Array.from(H), l));
                  else if (H instanceof Set)
                    p[c] = new Set(u(Array.from(H), l));
                  else if (ArrayBuffer.isView(H))
                    p[c] = s(H);
                  else {
                    var T = d.indexOf(H);
                    p[c] = T !== -1 ? v[T] : l(H);
                  }
                }
                return d.pop(), v.pop(), p;
              } : function l(P) {
                if (typeof P != "object" || P === null)
                  return P;
                if (P instanceof Date)
                  return new Date(P);
                if (Array.isArray(P))
                  return u(P, l);
                if (P instanceof Map)
                  return new Map(u(Array.from(P), l));
                if (P instanceof Set)
                  return new Set(u(Array.from(P), l));
                var p = {};
                for (var c in d.push(P), v.push(p), P)
                  if (Object.hasOwnProperty.call(P, c) !== !1) {
                    var H = P[c];
                    if (typeof H != "object" || H === null)
                      p[c] = H;
                    else if (H instanceof Date)
                      p[c] = new Date(H);
                    else if (H instanceof Map)
                      p[c] = new Map(u(Array.from(H), l));
                    else if (H instanceof Set)
                      p[c] = new Set(u(Array.from(H), l));
                    else if (ArrayBuffer.isView(H))
                      p[c] = s(H);
                    else {
                      var T = d.indexOf(H);
                      p[c] = T !== -1 ? v[T] : l(H);
                    }
                  }
                return d.pop(), v.pop(), p;
              };
              function u(l, P) {
                for (var p = Object.keys(l), c = new Array(p.length), H = 0; H < p.length; H++) {
                  var T = p[H], q = l[T];
                  if (typeof q != "object" || q === null)
                    c[T] = q;
                  else if (q instanceof Date)
                    c[T] = new Date(q);
                  else if (ArrayBuffer.isView(q))
                    c[T] = s(q);
                  else {
                    var b = d.indexOf(q);
                    c[T] = b !== -1 ? v[b] : P(q);
                  }
                }
                return c;
              }
            }(a) : a.proto ? function o(d) {
              if (typeof d != "object" || d === null)
                return d;
              if (d instanceof Date)
                return new Date(d);
              if (Array.isArray(d))
                return f(d, o);
              if (d instanceof Map)
                return new Map(f(Array.from(d), o));
              if (d instanceof Set)
                return new Set(f(Array.from(d), o));
              var v = {};
              for (var u in d) {
                var l = d[u];
                typeof l != "object" || l === null ? v[u] = l : l instanceof Date ? v[u] = new Date(l) : l instanceof Map ? v[u] = new Map(f(Array.from(l), o)) : l instanceof Set ? v[u] = new Set(f(Array.from(l), o)) : ArrayBuffer.isView(l) ? v[u] = s(l) : v[u] = o(l);
              }
              return v;
            } : function o(d) {
              if (typeof d != "object" || d === null)
                return d;
              if (d instanceof Date)
                return new Date(d);
              if (Array.isArray(d))
                return f(d, o);
              if (d instanceof Map)
                return new Map(f(Array.from(d), o));
              if (d instanceof Set)
                return new Set(f(Array.from(d), o));
              var v = {};
              for (var u in d)
                if (Object.hasOwnProperty.call(d, u) !== !1) {
                  var l = d[u];
                  typeof l != "object" || l === null ? v[u] = l : l instanceof Date ? v[u] = new Date(l) : l instanceof Map ? v[u] = new Map(f(Array.from(l), o)) : l instanceof Set ? v[u] = new Set(f(Array.from(l), o)) : ArrayBuffer.isView(l) ? v[u] = s(l) : v[u] = o(l);
                }
              return v;
            };
            function f(o, d) {
              for (var v = Object.keys(o), u = new Array(v.length), l = 0; l < v.length; l++) {
                var P = v[l], p = o[P];
                typeof p != "object" || p === null ? u[P] = p : p instanceof Date ? u[P] = new Date(p) : ArrayBuffer.isView(p) ? u[P] = s(p) : u[P] = d(p);
              }
              return u;
            }
          };
        }).call(this);
      }).call(this, t("buffer").Buffer);
    }, { buffer: 17 }], 73: [function(t, r, n) {
      var i = t("buffer"), s = i.Buffer;
      function a(o, d) {
        for (var v in o)
          d[v] = o[v];
      }
      function f(o, d, v) {
        return s(o, d, v);
      }
      s.from && s.alloc && s.allocUnsafe && s.allocUnsafeSlow ? r.exports = i : (a(i, n), n.Buffer = f), f.prototype = Object.create(s.prototype), a(s, f), f.from = function(o, d, v) {
        if (typeof o == "number")
          throw new TypeError("Argument must not be a number");
        return s(o, d, v);
      }, f.alloc = function(o, d, v) {
        if (typeof o != "number")
          throw new TypeError("Argument must be a number");
        var u = s(o);
        return d !== void 0 ? typeof v == "string" ? u.fill(d, v) : u.fill(d) : u.fill(0), u;
      }, f.allocUnsafe = function(o) {
        if (typeof o != "number")
          throw new TypeError("Argument must be a number");
        return s(o);
      }, f.allocUnsafeSlow = function(o) {
        if (typeof o != "number")
          throw new TypeError("Argument must be a number");
        return i.SlowBuffer(o);
      };
    }, { buffer: 17 }], 74: [function(t, r, n) {
      r.exports = function(i) {
        var s = i._readableState;
        return s ? s.objectMode || typeof i._duplexState == "number" ? i.read() : i.read((a = s, a.buffer.length ? a.buffer.head ? a.buffer.head.data.length : a.buffer[0].length : a.length)) : null;
        var a;
      };
    }, {}], 75: [function(t, r, n) {
      var i = t("safe-buffer").Buffer, s = i.isEncoding || function(c) {
        switch ((c = "" + c) && c.toLowerCase()) {
          case "hex":
          case "utf8":
          case "utf-8":
          case "ascii":
          case "binary":
          case "base64":
          case "ucs2":
          case "ucs-2":
          case "utf16le":
          case "utf-16le":
          case "raw":
            return !0;
          default:
            return !1;
        }
      };
      function a(c) {
        var H;
        switch (this.encoding = function(T) {
          var q = function(b) {
            if (!b)
              return "utf8";
            for (var j; ; )
              switch (b) {
                case "utf8":
                case "utf-8":
                  return "utf8";
                case "ucs2":
                case "ucs-2":
                case "utf16le":
                case "utf-16le":
                  return "utf16le";
                case "latin1":
                case "binary":
                  return "latin1";
                case "base64":
                case "ascii":
                case "hex":
                  return b;
                default:
                  if (j)
                    return;
                  b = ("" + b).toLowerCase(), j = !0;
              }
          }(T);
          if (typeof q != "string" && (i.isEncoding === s || !s(T)))
            throw new Error("Unknown encoding: " + T);
          return q || T;
        }(c), this.encoding) {
          case "utf16le":
            this.text = d, this.end = v, H = 4;
            break;
          case "utf8":
            this.fillLast = o, H = 4;
            break;
          case "base64":
            this.text = u, this.end = l, H = 3;
            break;
          default:
            return this.write = P, void (this.end = p);
        }
        this.lastNeed = 0, this.lastTotal = 0, this.lastChar = i.allocUnsafe(H);
      }
      function f(c) {
        return c <= 127 ? 0 : c >> 5 == 6 ? 2 : c >> 4 == 14 ? 3 : c >> 3 == 30 ? 4 : c >> 6 == 2 ? -1 : -2;
      }
      function o(c) {
        var H = this.lastTotal - this.lastNeed, T = function(q, b, j) {
          if ((192 & b[0]) != 128)
            return q.lastNeed = 0, "�";
          if (q.lastNeed > 1 && b.length > 1) {
            if ((192 & b[1]) != 128)
              return q.lastNeed = 1, "�";
            if (q.lastNeed > 2 && b.length > 2 && (192 & b[2]) != 128)
              return q.lastNeed = 2, "�";
          }
        }(this, c);
        return T !== void 0 ? T : this.lastNeed <= c.length ? (c.copy(this.lastChar, H, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (c.copy(this.lastChar, H, 0, c.length), void (this.lastNeed -= c.length));
      }
      function d(c, H) {
        if ((c.length - H) % 2 == 0) {
          var T = c.toString("utf16le", H);
          if (T) {
            var q = T.charCodeAt(T.length - 1);
            if (q >= 55296 && q <= 56319)
              return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = c[c.length - 2], this.lastChar[1] = c[c.length - 1], T.slice(0, -1);
          }
          return T;
        }
        return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = c[c.length - 1], c.toString("utf16le", H, c.length - 1);
      }
      function v(c) {
        var H = c && c.length ? this.write(c) : "";
        if (this.lastNeed) {
          var T = this.lastTotal - this.lastNeed;
          return H + this.lastChar.toString("utf16le", 0, T);
        }
        return H;
      }
      function u(c, H) {
        var T = (c.length - H) % 3;
        return T === 0 ? c.toString("base64", H) : (this.lastNeed = 3 - T, this.lastTotal = 3, T === 1 ? this.lastChar[0] = c[c.length - 1] : (this.lastChar[0] = c[c.length - 2], this.lastChar[1] = c[c.length - 1]), c.toString("base64", H, c.length - T));
      }
      function l(c) {
        var H = c && c.length ? this.write(c) : "";
        return this.lastNeed ? H + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : H;
      }
      function P(c) {
        return c.toString(this.encoding);
      }
      function p(c) {
        return c && c.length ? this.write(c) : "";
      }
      n.StringDecoder = a, a.prototype.write = function(c) {
        if (c.length === 0)
          return "";
        var H, T;
        if (this.lastNeed) {
          if ((H = this.fillLast(c)) === void 0)
            return "";
          T = this.lastNeed, this.lastNeed = 0;
        } else
          T = 0;
        return T < c.length ? H ? H + this.text(c, T) : this.text(c, T) : H || "";
      }, a.prototype.end = function(c) {
        var H = c && c.length ? this.write(c) : "";
        return this.lastNeed ? H + "�" : H;
      }, a.prototype.text = function(c, H) {
        var T = function(b, j, w) {
          var m = j.length - 1;
          if (m < w)
            return 0;
          var I = f(j[m]);
          return I >= 0 ? (I > 0 && (b.lastNeed = I - 1), I) : --m < w || I === -2 ? 0 : (I = f(j[m])) >= 0 ? (I > 0 && (b.lastNeed = I - 2), I) : --m < w || I === -2 ? 0 : (I = f(j[m])) >= 0 ? (I > 0 && (I === 2 ? I = 0 : b.lastNeed = I - 3), I) : 0;
        }(this, c, H);
        if (!this.lastNeed)
          return c.toString("utf8", H);
        this.lastTotal = T;
        var q = c.length - (T - this.lastNeed);
        return c.copy(this.lastChar, 0, q), c.toString("utf8", H, q);
      }, a.prototype.fillLast = function(c) {
        if (this.lastNeed <= c.length)
          return c.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
        c.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, c.length), this.lastNeed -= c.length;
      };
    }, { "safe-buffer": 73 }], 76: [function(t, r, n) {
      var i = t("punycode"), s = t("./util");
      function a() {
        this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;
      }
      n.parse = j, n.resolve = function(w, m) {
        return j(w, !1, !0).resolve(m);
      }, n.resolveObject = function(w, m) {
        return w ? j(w, !1, !0).resolveObject(m) : m;
      }, n.format = function(w) {
        return s.isString(w) && (w = j(w)), w instanceof a ? w.format() : a.prototype.format.call(w);
      }, n.Url = a;
      var f = /^([a-z0-9.+-]+:)/i, o = /:[0-9]*$/, d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, v = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", `
`, "	"]), u = ["'"].concat(v), l = ["%", "/", "?", ";", "#"].concat(u), P = ["/", "?", "#"], p = /^[+a-z0-9A-Z_-]{0,63}$/, c = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, H = { javascript: !0, "javascript:": !0 }, T = { javascript: !0, "javascript:": !0 }, q = { http: !0, https: !0, ftp: !0, gopher: !0, file: !0, "http:": !0, "https:": !0, "ftp:": !0, "gopher:": !0, "file:": !0 }, b = t("querystring");
      function j(w, m, I) {
        if (w && s.isObject(w) && w instanceof a)
          return w;
        var N = new a();
        return N.parse(w, m, I), N;
      }
      a.prototype.parse = function(w, m, I) {
        if (!s.isString(w))
          throw new TypeError("Parameter 'url' must be a string, not " + typeof w);
        var N = w.indexOf("?"), k = N !== -1 && N < w.indexOf("#") ? "?" : "#", R = w.split(k);
        R[0] = R[0].replace(/\\/g, "/");
        var y = w = R.join(k);
        if (y = y.trim(), !I && w.split("#").length === 1) {
          var O = d.exec(y);
          if (O)
            return this.path = y, this.href = y, this.pathname = O[1], O[2] ? (this.search = O[2], this.query = m ? b.parse(this.search.substr(1)) : this.search.substr(1)) : m && (this.search = "", this.query = {}), this;
        }
        var Y = f.exec(y);
        if (Y) {
          var ee = (Y = Y[0]).toLowerCase();
          this.protocol = ee, y = y.substr(Y.length);
        }
        if (I || Y || y.match(/^\/\/[^@\/]+@[^@\/]+/)) {
          var Z = y.substr(0, 2) === "//";
          !Z || Y && T[Y] || (y = y.substr(2), this.slashes = !0);
        }
        if (!T[Y] && (Z || Y && !q[Y])) {
          for (var te, fe, _ = -1, G = 0; G < P.length; G++)
            (L = y.indexOf(P[G])) !== -1 && (_ === -1 || L < _) && (_ = L);
          for ((fe = _ === -1 ? y.lastIndexOf("@") : y.lastIndexOf("@", _)) !== -1 && (te = y.slice(0, fe), y = y.slice(fe + 1), this.auth = decodeURIComponent(te)), _ = -1, G = 0; G < l.length; G++) {
            var L;
            (L = y.indexOf(l[G])) !== -1 && (_ === -1 || L < _) && (_ = L);
          }
          _ === -1 && (_ = y.length), this.host = y.slice(0, _), y = y.slice(_), this.parseHost(), this.hostname = this.hostname || "";
          var $ = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
          if (!$)
            for (var ae = this.hostname.split(/\./), Pe = (G = 0, ae.length); G < Pe; G++) {
              var ge = ae[G];
              if (ge && !ge.match(p)) {
                for (var me = "", Xe = 0, De = ge.length; Xe < De; Xe++)
                  ge.charCodeAt(Xe) > 127 ? me += "x" : me += ge[Xe];
                if (!me.match(p)) {
                  var ne = ae.slice(0, G), re = ae.slice(G + 1), ve = ge.match(c);
                  ve && (ne.push(ve[1]), re.unshift(ve[2])), re.length && (y = "/" + re.join(".") + y), this.hostname = ne.join(".");
                  break;
                }
              }
            }
          this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), $ || (this.hostname = i.toASCII(this.hostname));
          var qe = this.port ? ":" + this.port : "", ke = this.hostname || "";
          this.host = ke + qe, this.href += this.host, $ && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), y[0] !== "/" && (y = "/" + y));
        }
        if (!H[ee])
          for (G = 0, Pe = u.length; G < Pe; G++) {
            var be = u[G];
            if (y.indexOf(be) !== -1) {
              var Fe = encodeURIComponent(be);
              Fe === be && (Fe = escape(be)), y = y.split(be).join(Fe);
            }
          }
        var Ke = y.indexOf("#");
        Ke !== -1 && (this.hash = y.substr(Ke), y = y.slice(0, Ke));
        var nt = y.indexOf("?");
        if (nt !== -1 ? (this.search = y.substr(nt), this.query = y.substr(nt + 1), m && (this.query = b.parse(this.query)), y = y.slice(0, nt)) : m && (this.search = "", this.query = {}), y && (this.pathname = y), q[ee] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
          qe = this.pathname || "";
          var ut = this.search || "";
          this.path = qe + ut;
        }
        return this.href = this.format(), this;
      }, a.prototype.format = function() {
        var w = this.auth || "";
        w && (w = (w = encodeURIComponent(w)).replace(/%3A/i, ":"), w += "@");
        var m = this.protocol || "", I = this.pathname || "", N = this.hash || "", k = !1, R = "";
        this.host ? k = w + this.host : this.hostname && (k = w + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (k += ":" + this.port)), this.query && s.isObject(this.query) && Object.keys(this.query).length && (R = b.stringify(this.query));
        var y = this.search || R && "?" + R || "";
        return m && m.substr(-1) !== ":" && (m += ":"), this.slashes || (!m || q[m]) && k !== !1 ? (k = "//" + (k || ""), I && I.charAt(0) !== "/" && (I = "/" + I)) : k || (k = ""), N && N.charAt(0) !== "#" && (N = "#" + N), y && y.charAt(0) !== "?" && (y = "?" + y), m + k + (I = I.replace(/[?#]/g, function(O) {
          return encodeURIComponent(O);
        })) + (y = y.replace("#", "%23")) + N;
      }, a.prototype.resolve = function(w) {
        return this.resolveObject(j(w, !1, !0)).format();
      }, a.prototype.resolveObject = function(w) {
        if (s.isString(w)) {
          var m = new a();
          m.parse(w, !1, !0), w = m;
        }
        for (var I = new a(), N = Object.keys(this), k = 0; k < N.length; k++) {
          var R = N[k];
          I[R] = this[R];
        }
        if (I.hash = w.hash, w.href === "")
          return I.href = I.format(), I;
        if (w.slashes && !w.protocol) {
          for (var y = Object.keys(w), O = 0; O < y.length; O++) {
            var Y = y[O];
            Y !== "protocol" && (I[Y] = w[Y]);
          }
          return q[I.protocol] && I.hostname && !I.pathname && (I.path = I.pathname = "/"), I.href = I.format(), I;
        }
        if (w.protocol && w.protocol !== I.protocol) {
          if (!q[w.protocol]) {
            for (var ee = Object.keys(w), Z = 0; Z < ee.length; Z++) {
              var te = ee[Z];
              I[te] = w[te];
            }
            return I.href = I.format(), I;
          }
          if (I.protocol = w.protocol, w.host || T[w.protocol])
            I.pathname = w.pathname;
          else {
            for (var fe = (w.pathname || "").split("/"); fe.length && !(w.host = fe.shift()); )
              ;
            w.host || (w.host = ""), w.hostname || (w.hostname = ""), fe[0] !== "" && fe.unshift(""), fe.length < 2 && fe.unshift(""), I.pathname = fe.join("/");
          }
          if (I.search = w.search, I.query = w.query, I.host = w.host || "", I.auth = w.auth, I.hostname = w.hostname || w.host, I.port = w.port, I.pathname || I.search) {
            var _ = I.pathname || "", G = I.search || "";
            I.path = _ + G;
          }
          return I.slashes = I.slashes || w.slashes, I.href = I.format(), I;
        }
        var L = I.pathname && I.pathname.charAt(0) === "/", $ = w.host || w.pathname && w.pathname.charAt(0) === "/", ae = $ || L || I.host && w.pathname, Pe = ae, ge = I.pathname && I.pathname.split("/") || [], me = (fe = w.pathname && w.pathname.split("/") || [], I.protocol && !q[I.protocol]);
        if (me && (I.hostname = "", I.port = null, I.host && (ge[0] === "" ? ge[0] = I.host : ge.unshift(I.host)), I.host = "", w.protocol && (w.hostname = null, w.port = null, w.host && (fe[0] === "" ? fe[0] = w.host : fe.unshift(w.host)), w.host = null), ae = ae && (fe[0] === "" || ge[0] === "")), $)
          I.host = w.host || w.host === "" ? w.host : I.host, I.hostname = w.hostname || w.hostname === "" ? w.hostname : I.hostname, I.search = w.search, I.query = w.query, ge = fe;
        else if (fe.length)
          ge || (ge = []), ge.pop(), ge = ge.concat(fe), I.search = w.search, I.query = w.query;
        else if (!s.isNullOrUndefined(w.search))
          return me && (I.hostname = I.host = ge.shift(), (ve = !!(I.host && I.host.indexOf("@") > 0) && I.host.split("@")) && (I.auth = ve.shift(), I.host = I.hostname = ve.shift())), I.search = w.search, I.query = w.query, s.isNull(I.pathname) && s.isNull(I.search) || (I.path = (I.pathname ? I.pathname : "") + (I.search ? I.search : "")), I.href = I.format(), I;
        if (!ge.length)
          return I.pathname = null, I.search ? I.path = "/" + I.search : I.path = null, I.href = I.format(), I;
        for (var Xe = ge.slice(-1)[0], De = (I.host || w.host || ge.length > 1) && (Xe === "." || Xe === "..") || Xe === "", ne = 0, re = ge.length; re >= 0; re--)
          (Xe = ge[re]) === "." ? ge.splice(re, 1) : Xe === ".." ? (ge.splice(re, 1), ne++) : ne && (ge.splice(re, 1), ne--);
        if (!ae && !Pe)
          for (; ne--; ne)
            ge.unshift("..");
        !ae || ge[0] === "" || ge[0] && ge[0].charAt(0) === "/" || ge.unshift(""), De && ge.join("/").substr(-1) !== "/" && ge.push("");
        var ve, qe = ge[0] === "" || ge[0] && ge[0].charAt(0) === "/";
        return me && (I.hostname = I.host = qe ? "" : ge.length ? ge.shift() : "", (ve = !!(I.host && I.host.indexOf("@") > 0) && I.host.split("@")) && (I.auth = ve.shift(), I.host = I.hostname = ve.shift())), (ae = ae || I.host && ge.length) && !qe && ge.unshift(""), ge.length ? I.pathname = ge.join("/") : (I.pathname = null, I.path = null), s.isNull(I.pathname) && s.isNull(I.search) || (I.path = (I.pathname ? I.pathname : "") + (I.search ? I.search : "")), I.auth = w.auth || I.auth, I.slashes = I.slashes || w.slashes, I.href = I.format(), I;
      }, a.prototype.parseHost = function() {
        var w = this.host, m = o.exec(w);
        m && ((m = m[0]) !== ":" && (this.port = m.substr(1)), w = w.substr(0, w.length - m.length)), w && (this.hostname = w);
      };
    }, { "./util": 77, punycode: 51, querystring: 54 }], 77: [function(t, r, n) {
      r.exports = { isString: function(i) {
        return typeof i == "string";
      }, isObject: function(i) {
        return typeof i == "object" && i !== null;
      }, isNull: function(i) {
        return i === null;
      }, isNullOrUndefined: function(i) {
        return i == null;
      } };
    }, {}], 78: [function(t, r, n) {
      (function(i) {
        (function() {
          function s(a) {
            try {
              if (!i.localStorage)
                return !1;
            } catch {
              return !1;
            }
            var f = i.localStorage[a];
            return f != null && String(f).toLowerCase() === "true";
          }
          r.exports = function(a, f) {
            if (s("noDeprecation"))
              return a;
            var o = !1;
            return function() {
              if (!o) {
                if (s("throwDeprecation"))
                  throw new Error(f);
                s("traceDeprecation") ? console.trace(f) : console.warn(f), o = !0;
              }
              return a.apply(this, arguments);
            };
          };
        }).call(this);
      }).call(this, typeof zi < "u" ? zi : typeof self < "u" ? self : typeof window < "u" ? window : {});
    }, {}], 79: [function(t, r, n) {
      r.exports = function i(s, a) {
        if (s && a)
          return i(s)(a);
        if (typeof s != "function")
          throw new TypeError("need wrapper function");
        return Object.keys(s).forEach(function(o) {
          f[o] = s[o];
        }), f;
        function f() {
          for (var o = new Array(arguments.length), d = 0; d < o.length; d++)
            o[d] = arguments[d];
          var v = s.apply(this, o), u = o[o.length - 1];
          return typeof v == "function" && v !== u && Object.keys(u).forEach(function(l) {
            v[l] = u[l];
          }), v;
        }
      };
    }, {}], 80: [function(t, r, n) {
      r.exports = function() {
        throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object");
      };
    }, {}], 81: [function(t, r, n) {
      r.exports = function() {
        for (var s = {}, a = 0; a < arguments.length; a++) {
          var f = arguments[a];
          for (var o in f)
            i.call(f, o) && (s[o] = f[o]);
        }
        return s;
      };
      var i = Object.prototype.hasOwnProperty;
    }, {}], 82: [function(t, r, n) {
      r.exports = function(i) {
        i.prototype[Symbol.iterator] = function* () {
          for (let s = this.head; s; s = s.next)
            yield s.value;
        };
      };
    }, {}], 83: [function(t, r, n) {
      function i(d) {
        var v = this;
        if (v instanceof i || (v = new i()), v.tail = null, v.head = null, v.length = 0, d && typeof d.forEach == "function")
          d.forEach(function(P) {
            v.push(P);
          });
        else if (arguments.length > 0)
          for (var u = 0, l = arguments.length; u < l; u++)
            v.push(arguments[u]);
        return v;
      }
      function s(d, v, u) {
        var l = v === d.head ? new o(u, null, v, d) : new o(u, v, v.next, d);
        return l.next === null && (d.tail = l), l.prev === null && (d.head = l), d.length++, l;
      }
      function a(d, v) {
        d.tail = new o(v, d.tail, null, d), d.head || (d.head = d.tail), d.length++;
      }
      function f(d, v) {
        d.head = new o(v, null, d.head, d), d.tail || (d.tail = d.head), d.length++;
      }
      function o(d, v, u, l) {
        if (!(this instanceof o))
          return new o(d, v, u, l);
        this.list = l, this.value = d, v ? (v.next = this, this.prev = v) : this.prev = null, u ? (u.prev = this, this.next = u) : this.next = null;
      }
      r.exports = i, i.Node = o, i.create = i, i.prototype.removeNode = function(d) {
        if (d.list !== this)
          throw new Error("removing node which does not belong to this list");
        var v = d.next, u = d.prev;
        return v && (v.prev = u), u && (u.next = v), d === this.head && (this.head = v), d === this.tail && (this.tail = u), d.list.length--, d.next = null, d.prev = null, d.list = null, v;
      }, i.prototype.unshiftNode = function(d) {
        if (d !== this.head) {
          d.list && d.list.removeNode(d);
          var v = this.head;
          d.list = this, d.next = v, v && (v.prev = d), this.head = d, this.tail || (this.tail = d), this.length++;
        }
      }, i.prototype.pushNode = function(d) {
        if (d !== this.tail) {
          d.list && d.list.removeNode(d);
          var v = this.tail;
          d.list = this, d.prev = v, v && (v.next = d), this.tail = d, this.head || (this.head = d), this.length++;
        }
      }, i.prototype.push = function() {
        for (var d = 0, v = arguments.length; d < v; d++)
          a(this, arguments[d]);
        return this.length;
      }, i.prototype.unshift = function() {
        for (var d = 0, v = arguments.length; d < v; d++)
          f(this, arguments[d]);
        return this.length;
      }, i.prototype.pop = function() {
        if (this.tail) {
          var d = this.tail.value;
          return this.tail = this.tail.prev, this.tail ? this.tail.next = null : this.head = null, this.length--, d;
        }
      }, i.prototype.shift = function() {
        if (this.head) {
          var d = this.head.value;
          return this.head = this.head.next, this.head ? this.head.prev = null : this.tail = null, this.length--, d;
        }
      }, i.prototype.forEach = function(d, v) {
        v = v || this;
        for (var u = this.head, l = 0; u !== null; l++)
          d.call(v, u.value, l, this), u = u.next;
      }, i.prototype.forEachReverse = function(d, v) {
        v = v || this;
        for (var u = this.tail, l = this.length - 1; u !== null; l--)
          d.call(v, u.value, l, this), u = u.prev;
      }, i.prototype.get = function(d) {
        for (var v = 0, u = this.head; u !== null && v < d; v++)
          u = u.next;
        if (v === d && u !== null)
          return u.value;
      }, i.prototype.getReverse = function(d) {
        for (var v = 0, u = this.tail; u !== null && v < d; v++)
          u = u.prev;
        if (v === d && u !== null)
          return u.value;
      }, i.prototype.map = function(d, v) {
        v = v || this;
        for (var u = new i(), l = this.head; l !== null; )
          u.push(d.call(v, l.value, this)), l = l.next;
        return u;
      }, i.prototype.mapReverse = function(d, v) {
        v = v || this;
        for (var u = new i(), l = this.tail; l !== null; )
          u.push(d.call(v, l.value, this)), l = l.prev;
        return u;
      }, i.prototype.reduce = function(d, v) {
        var u, l = this.head;
        if (arguments.length > 1)
          u = v;
        else {
          if (!this.head)
            throw new TypeError("Reduce of empty list with no initial value");
          l = this.head.next, u = this.head.value;
        }
        for (var P = 0; l !== null; P++)
          u = d(u, l.value, P), l = l.next;
        return u;
      }, i.prototype.reduceReverse = function(d, v) {
        var u, l = this.tail;
        if (arguments.length > 1)
          u = v;
        else {
          if (!this.tail)
            throw new TypeError("Reduce of empty list with no initial value");
          l = this.tail.prev, u = this.tail.value;
        }
        for (var P = this.length - 1; l !== null; P--)
          u = d(u, l.value, P), l = l.prev;
        return u;
      }, i.prototype.toArray = function() {
        for (var d = new Array(this.length), v = 0, u = this.head; u !== null; v++)
          d[v] = u.value, u = u.next;
        return d;
      }, i.prototype.toArrayReverse = function() {
        for (var d = new Array(this.length), v = 0, u = this.tail; u !== null; v++)
          d[v] = u.value, u = u.prev;
        return d;
      }, i.prototype.slice = function(d, v) {
        (v = v || this.length) < 0 && (v += this.length), (d = d || 0) < 0 && (d += this.length);
        var u = new i();
        if (v < d || v < 0)
          return u;
        d < 0 && (d = 0), v > this.length && (v = this.length);
        for (var l = 0, P = this.head; P !== null && l < d; l++)
          P = P.next;
        for (; P !== null && l < v; l++, P = P.next)
          u.push(P.value);
        return u;
      }, i.prototype.sliceReverse = function(d, v) {
        (v = v || this.length) < 0 && (v += this.length), (d = d || 0) < 0 && (d += this.length);
        var u = new i();
        if (v < d || v < 0)
          return u;
        d < 0 && (d = 0), v > this.length && (v = this.length);
        for (var l = this.length, P = this.tail; P !== null && l > v; l--)
          P = P.prev;
        for (; P !== null && l > d; l--, P = P.prev)
          u.push(P.value);
        return u;
      }, i.prototype.splice = function(d, v, ...u) {
        d > this.length && (d = this.length - 1), d < 0 && (d = this.length + d);
        for (var l = 0, P = this.head; P !== null && l < d; l++)
          P = P.next;
        var p = [];
        for (l = 0; P && l < v; l++)
          p.push(P.value), P = this.removeNode(P);
        for (P === null && (P = this.tail), P !== this.head && P !== this.tail && (P = P.prev), l = 0; l < u.length; l++)
          P = s(this, P, u[l]);
        return p;
      }, i.prototype.reverse = function() {
        for (var d = this.head, v = this.tail, u = d; u !== null; u = u.prev) {
          var l = u.prev;
          u.prev = u.next, u.next = l;
        }
        return this.head = v, this.tail = d, this;
      };
      try {
        t("./iterator.js")(i);
      } catch {
      }
    }, { "./iterator.js": 82 }] }, {}, [12])(12);
  });
})(Rfe);
var pbe = Rfe.exports, lM = { exports: {} }, Vfe = function(e, t) {
  return function() {
    for (var n = new Array(arguments.length), i = 0; i < n.length; i++)
      n[i] = arguments[i];
    return e.apply(t, n);
  };
}, hbe = Vfe, PM = Object.prototype.toString, cM = /* @__PURE__ */ function(A) {
  return function(e) {
    var t = PM.call(e);
    return A[t] || (A[t] = t.slice(8, -1).toLowerCase());
  };
}(/* @__PURE__ */ Object.create(null));
function Qm(A) {
  return A = A.toLowerCase(), function(t) {
    return cM(t) === A;
  };
}
function pM(A) {
  return Array.isArray(A);
}
function pO(A) {
  return typeof A > "u";
}
function Hbe(A) {
  return A !== null && !pO(A) && A.constructor !== null && !pO(A.constructor) && typeof A.constructor.isBuffer == "function" && A.constructor.isBuffer(A);
}
var Cfe = Qm("ArrayBuffer");
function gbe(A) {
  var e;
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(A) : e = A && A.buffer && Cfe(A.buffer), e;
}
function Xbe(A) {
  return typeof A == "string";
}
function Tbe(A) {
  return typeof A == "number";
}
function Ofe(A) {
  return A !== null && typeof A == "object";
}
function EC(A) {
  if (cM(A) !== "object")
    return !1;
  var e = Object.getPrototypeOf(A);
  return e === null || e === Object.prototype;
}
var qbe = Qm("Date"), bbe = Qm("File"), xbe = Qm("Blob"), Dbe = Qm("FileList");
function hM(A) {
  return PM.call(A) === "[object Function]";
}
function jbe(A) {
  return Ofe(A) && hM(A.pipe);
}
function wbe(A) {
  var e = "[object FormData]";
  return A && (typeof FormData == "function" && A instanceof FormData || PM.call(A) === e || hM(A.toString) && A.toString() === e);
}
var mbe = Qm("URLSearchParams");
function Bbe(A) {
  return A.trim ? A.trim() : A.replace(/^\s+|\s+$/g, "");
}
function Wbe() {
  return typeof navigator < "u" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS") ? !1 : typeof window < "u" && typeof document < "u";
}
function HM(A, e) {
  if (!(A === null || typeof A > "u"))
    if (typeof A != "object" && (A = [A]), pM(A))
      for (var t = 0, r = A.length; t < r; t++)
        e.call(null, A[t], t, A);
    else
      for (var n in A)
        Object.prototype.hasOwnProperty.call(A, n) && e.call(null, A[n], n, A);
}
function jN() {
  var A = {};
  function e(n, i) {
    EC(A[i]) && EC(n) ? A[i] = jN(A[i], n) : EC(n) ? A[i] = jN({}, n) : pM(n) ? A[i] = n.slice() : A[i] = n;
  }
  for (var t = 0, r = arguments.length; t < r; t++)
    HM(arguments[t], e);
  return A;
}
function Sbe(A, e, t) {
  return HM(e, function(n, i) {
    t && typeof n == "function" ? A[i] = hbe(n, t) : A[i] = n;
  }), A;
}
function Ube(A) {
  return A.charCodeAt(0) === 65279 && (A = A.slice(1)), A;
}
function Ibe(A, e, t, r) {
  A.prototype = Object.create(e.prototype, r), A.prototype.constructor = A, t && Object.assign(A.prototype, t);
}
function Rbe(A, e, t) {
  var r, n, i, s = {};
  e = e || {};
  do {
    for (r = Object.getOwnPropertyNames(A), n = r.length; n-- > 0; )
      i = r[n], s[i] || (e[i] = A[i], s[i] = !0);
    A = Object.getPrototypeOf(A);
  } while (A && (!t || t(A, e)) && A !== Object.prototype);
  return e;
}
function Vbe(A, e, t) {
  A = String(A), (t === void 0 || t > A.length) && (t = A.length), t -= e.length;
  var r = A.indexOf(e, t);
  return r !== -1 && r === t;
}
function Cbe(A) {
  if (!A)
    return null;
  var e = A.length;
  if (pO(e))
    return null;
  for (var t = new Array(e); e-- > 0; )
    t[e] = A[e];
  return t;
}
var Obe = /* @__PURE__ */ function(A) {
  return function(e) {
    return A && e instanceof A;
  };
}(typeof Uint8Array < "u" && Object.getPrototypeOf(Uint8Array)), Mv = {
  isArray: pM,
  isArrayBuffer: Cfe,
  isBuffer: Hbe,
  isFormData: wbe,
  isArrayBufferView: gbe,
  isString: Xbe,
  isNumber: Tbe,
  isObject: Ofe,
  isPlainObject: EC,
  isUndefined: pO,
  isDate: qbe,
  isFile: bbe,
  isBlob: xbe,
  isFunction: hM,
  isStream: jbe,
  isURLSearchParams: mbe,
  isStandardBrowserEnv: Wbe,
  forEach: HM,
  merge: jN,
  extend: Sbe,
  trim: Bbe,
  stripBOM: Ube,
  inherits: Ibe,
  toFlatObject: Rbe,
  kindOf: cM,
  kindOfTest: Qm,
  endsWith: Vbe,
  toArray: Cbe,
  isTypedArray: Obe,
  isFileList: Dbe
}, RW = Mv;
function QZ(A) {
  return encodeURIComponent(A).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
var yfe = function(e, t, r) {
  if (!t)
    return e;
  var n;
  if (r)
    n = r(t);
  else if (RW.isURLSearchParams(t))
    n = t.toString();
  else {
    var i = [];
    RW.forEach(t, function(f, o) {
      f === null || typeof f > "u" || (RW.isArray(f) ? o = o + "[]" : f = [f], RW.forEach(f, function(v) {
        RW.isDate(v) ? v = v.toISOString() : RW.isObject(v) && (v = JSON.stringify(v)), i.push(QZ(o) + "=" + QZ(v));
      }));
    }), n = i.join("&");
  }
  if (n) {
    var s = e.indexOf("#");
    s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + n;
  }
  return e;
}, ybe = Mv;
function My() {
  this.handlers = [];
}
My.prototype.use = function(e, t, r) {
  return this.handlers.push({
    fulfilled: e,
    rejected: t,
    synchronous: r ? r.synchronous : !1,
    runWhen: r ? r.runWhen : null
  }), this.handlers.length - 1;
};
My.prototype.eject = function(e) {
  this.handlers[e] && (this.handlers[e] = null);
};
My.prototype.forEach = function(e) {
  ybe.forEach(this.handlers, function(r) {
    r !== null && e(r);
  });
};
var kbe = My, Ebe = Mv, Fbe = function(e, t) {
  Ebe.forEach(e, function(n, i) {
    i !== t && i.toUpperCase() === t.toUpperCase() && (e[t] = n, delete e[i]);
  });
}, kfe = Mv;
function ZS(A, e, t, r, n) {
  Error.call(this), this.message = A, this.name = "AxiosError", e && (this.code = e), t && (this.config = t), r && (this.request = r), n && (this.response = n);
}
kfe.inherits(ZS, Error, {
  toJSON: function() {
    return {
      // Standard
      message: this.message,
      name: this.name,
      // Microsoft
      description: this.description,
      number: this.number,
      // Mozilla
      fileName: this.fileName,
      lineNumber: this.lineNumber,
      columnNumber: this.columnNumber,
      stack: this.stack,
      // Axios
      config: this.config,
      code: this.code,
      status: this.response && this.response.status ? this.response.status : null
    };
  }
});
var Efe = ZS.prototype, Ffe = {};
[
  "ERR_BAD_OPTION_VALUE",
  "ERR_BAD_OPTION",
  "ECONNABORTED",
  "ETIMEDOUT",
  "ERR_NETWORK",
  "ERR_FR_TOO_MANY_REDIRECTS",
  "ERR_DEPRECATED",
  "ERR_BAD_RESPONSE",
  "ERR_BAD_REQUEST",
  "ERR_CANCELED"
  // eslint-disable-next-line func-names
].forEach(function(A) {
  Ffe[A] = { value: A };
});
Object.defineProperties(ZS, Ffe);
Object.defineProperty(Efe, "isAxiosError", { value: !0 });
ZS.from = function(A, e, t, r, n, i) {
  var s = Object.create(Efe);
  return kfe.toFlatObject(A, s, function(f) {
    return f !== Error.prototype;
  }), ZS.call(s, A.message, e, t, r, n), s.name = A.name, i && Object.assign(s, i), s;
};
var xU = ZS, Nfe = {
  silentJSONParsing: !0,
  forcedJSONParsing: !0,
  clarifyTimeoutError: !1
}, EH = Mv;
function Nbe(A, e) {
  e = e || new FormData();
  var t = [];
  function r(i) {
    return i === null ? "" : EH.isDate(i) ? i.toISOString() : EH.isArrayBuffer(i) || EH.isTypedArray(i) ? typeof Blob == "function" ? new Blob([i]) : Buffer.from(i) : i;
  }
  function n(i, s) {
    if (EH.isPlainObject(i) || EH.isArray(i)) {
      if (t.indexOf(i) !== -1)
        throw Error("Circular reference detected in " + s);
      t.push(i), EH.forEach(i, function(f, o) {
        if (!EH.isUndefined(f)) {
          var d = s ? s + "." + o : o, v;
          if (f && !s && typeof f == "object") {
            if (EH.endsWith(o, "{}"))
              f = JSON.stringify(f);
            else if (EH.endsWith(o, "[]") && (v = EH.toArray(f))) {
              v.forEach(function(u) {
                !EH.isUndefined(u) && e.append(d, r(u));
              });
              return;
            }
          }
          n(f, d);
        }
      }), t.pop();
    } else
      e.append(s, r(i));
  }
  return n(A), e;
}
var Qfe = Nbe, EE, YZ;
function Qbe() {
  if (YZ)
    return EE;
  YZ = 1;
  var A = xU;
  return EE = function(t, r, n) {
    var i = n.config.validateStatus;
    !n.status || !i || i(n.status) ? t(n) : r(new A(
      "Request failed with status code " + n.status,
      [A.ERR_BAD_REQUEST, A.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
      n.config,
      n.request,
      n
    ));
  }, EE;
}
var FE, MZ;
function Ybe() {
  if (MZ)
    return FE;
  MZ = 1;
  var A = Mv;
  return FE = A.isStandardBrowserEnv() ? (
    // Standard browser envs support document.cookie
    /* @__PURE__ */ function() {
      return {
        write: function(r, n, i, s, a, f) {
          var o = [];
          o.push(r + "=" + encodeURIComponent(n)), A.isNumber(i) && o.push("expires=" + new Date(i).toGMTString()), A.isString(s) && o.push("path=" + s), A.isString(a) && o.push("domain=" + a), f === !0 && o.push("secure"), document.cookie = o.join("; ");
        },
        read: function(r) {
          var n = document.cookie.match(new RegExp("(^|;\\s*)(" + r + ")=([^;]*)"));
          return n ? decodeURIComponent(n[3]) : null;
        },
        remove: function(r) {
          this.write(r, "", Date.now() - 864e5);
        }
      };
    }()
  ) : (
    // Non standard browser env (web workers, react-native) lack needed support.
    /* @__PURE__ */ function() {
      return {
        write: function() {
        },
        read: function() {
          return null;
        },
        remove: function() {
        }
      };
    }()
  ), FE;
}
var Mbe = function(e) {
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}, Lbe = function(e, t) {
  return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
}, Kbe = Mbe, Jbe = Lbe, Yfe = function(e, t) {
  return e && !Kbe(t) ? Jbe(e, t) : t;
}, NE, LZ;
function zbe() {
  if (LZ)
    return NE;
  LZ = 1;
  var A = Mv, e = [
    "age",
    "authorization",
    "content-length",
    "content-type",
    "etag",
    "expires",
    "from",
    "host",
    "if-modified-since",
    "if-unmodified-since",
    "last-modified",
    "location",
    "max-forwards",
    "proxy-authorization",
    "referer",
    "retry-after",
    "user-agent"
  ];
  return NE = function(r) {
    var n = {}, i, s, a;
    return r && A.forEach(r.split(`
`), function(o) {
      if (a = o.indexOf(":"), i = A.trim(o.substr(0, a)).toLowerCase(), s = A.trim(o.substr(a + 1)), i) {
        if (n[i] && e.indexOf(i) >= 0)
          return;
        i === "set-cookie" ? n[i] = (n[i] ? n[i] : []).concat([s]) : n[i] = n[i] ? n[i] + ", " + s : s;
      }
    }), n;
  }, NE;
}
var QE, KZ;
function Gbe() {
  if (KZ)
    return QE;
  KZ = 1;
  var A = Mv;
  return QE = A.isStandardBrowserEnv() ? (
    // Standard browser envs have full support of the APIs needed to test
    // whether the request URL is of the same origin as current location.
    function() {
      var t = /(msie|trident)/i.test(navigator.userAgent), r = document.createElement("a"), n;
      function i(s) {
        var a = s;
        return t && (r.setAttribute("href", a), a = r.href), r.setAttribute("href", a), {
          href: r.href,
          protocol: r.protocol ? r.protocol.replace(/:$/, "") : "",
          host: r.host,
          search: r.search ? r.search.replace(/^\?/, "") : "",
          hash: r.hash ? r.hash.replace(/^#/, "") : "",
          hostname: r.hostname,
          port: r.port,
          pathname: r.pathname.charAt(0) === "/" ? r.pathname : "/" + r.pathname
        };
      }
      return n = i(window.location.href), function(a) {
        var f = A.isString(a) ? i(a) : a;
        return f.protocol === n.protocol && f.host === n.host;
      };
    }()
  ) : (
    // Non standard browser envs (web workers, react-native) lack needed support.
    /* @__PURE__ */ function() {
      return function() {
        return !0;
      };
    }()
  ), QE;
}
var YE, JZ;
function Ly() {
  if (JZ)
    return YE;
  JZ = 1;
  var A = xU, e = Mv;
  function t(r) {
    A.call(this, r ?? "canceled", A.ERR_CANCELED), this.name = "CanceledError";
  }
  return e.inherits(t, A, {
    __CANCEL__: !0
  }), YE = t, YE;
}
var ME, zZ;
function Zbe() {
  return zZ || (zZ = 1, ME = function(e) {
    var t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
    return t && t[1] || "";
  }), ME;
}
var LE, GZ;
function ZZ() {
  if (GZ)
    return LE;
  GZ = 1;
  var A = Mv, e = Qbe(), t = Ybe(), r = yfe, n = Yfe, i = zbe(), s = Gbe(), a = Nfe, f = xU, o = Ly(), d = Zbe();
  return LE = function(u) {
    return new Promise(function(P, p) {
      var c = u.data, H = u.headers, T = u.responseType, q;
      function b() {
        u.cancelToken && u.cancelToken.unsubscribe(q), u.signal && u.signal.removeEventListener("abort", q);
      }
      A.isFormData(c) && A.isStandardBrowserEnv() && delete H["Content-Type"];
      var j = new XMLHttpRequest();
      if (u.auth) {
        var w = u.auth.username || "", m = u.auth.password ? unescape(encodeURIComponent(u.auth.password)) : "";
        H.Authorization = "Basic " + btoa(w + ":" + m);
      }
      var I = n(u.baseURL, u.url);
      j.open(u.method.toUpperCase(), r(I, u.params, u.paramsSerializer), !0), j.timeout = u.timeout;
      function N() {
        if (j) {
          var y = "getAllResponseHeaders" in j ? i(j.getAllResponseHeaders()) : null, O = !T || T === "text" || T === "json" ? j.responseText : j.response, Y = {
            data: O,
            status: j.status,
            statusText: j.statusText,
            headers: y,
            config: u,
            request: j
          };
          e(function(Z) {
            P(Z), b();
          }, function(Z) {
            p(Z), b();
          }, Y), j = null;
        }
      }
      if ("onloadend" in j ? j.onloadend = N : j.onreadystatechange = function() {
        !j || j.readyState !== 4 || j.status === 0 && !(j.responseURL && j.responseURL.indexOf("file:") === 0) || setTimeout(N);
      }, j.onabort = function() {
        j && (p(new f("Request aborted", f.ECONNABORTED, u, j)), j = null);
      }, j.onerror = function() {
        p(new f("Network Error", f.ERR_NETWORK, u, j, j)), j = null;
      }, j.ontimeout = function() {
        var O = u.timeout ? "timeout of " + u.timeout + "ms exceeded" : "timeout exceeded", Y = u.transitional || a;
        u.timeoutErrorMessage && (O = u.timeoutErrorMessage), p(new f(
          O,
          Y.clarifyTimeoutError ? f.ETIMEDOUT : f.ECONNABORTED,
          u,
          j
        )), j = null;
      }, A.isStandardBrowserEnv()) {
        var k = (u.withCredentials || s(I)) && u.xsrfCookieName ? t.read(u.xsrfCookieName) : void 0;
        k && (H[u.xsrfHeaderName] = k);
      }
      "setRequestHeader" in j && A.forEach(H, function(O, Y) {
        typeof c > "u" && Y.toLowerCase() === "content-type" ? delete H[Y] : j.setRequestHeader(Y, O);
      }), A.isUndefined(u.withCredentials) || (j.withCredentials = !!u.withCredentials), T && T !== "json" && (j.responseType = u.responseType), typeof u.onDownloadProgress == "function" && j.addEventListener("progress", u.onDownloadProgress), typeof u.onUploadProgress == "function" && j.upload && j.upload.addEventListener("progress", u.onUploadProgress), (u.cancelToken || u.signal) && (q = function(y) {
        j && (p(!y || y && y.type ? new o() : y), j.abort(), j = null);
      }, u.cancelToken && u.cancelToken.subscribe(q), u.signal && (u.signal.aborted ? q() : u.signal.addEventListener("abort", q))), c || (c = null);
      var R = d(I);
      if (R && ["http", "https", "file"].indexOf(R) === -1) {
        p(new f("Unsupported protocol " + R + ":", f.ERR_BAD_REQUEST, u));
        return;
      }
      j.send(c);
    });
  }, LE;
}
var KE, _Z;
function _be() {
  return _Z || (_Z = 1, KE = null), KE;
}
var Nd = Mv, $Z = Fbe, e_ = xU, $be = Nfe, exe = Qfe, txe = {
  "Content-Type": "application/x-www-form-urlencoded"
};
function t_(A, e) {
  !Nd.isUndefined(A) && Nd.isUndefined(A["Content-Type"]) && (A["Content-Type"] = e);
}
function rxe() {
  var A;
  return (typeof XMLHttpRequest < "u" || typeof process < "u" && Object.prototype.toString.call(process) === "[object process]") && (A = ZZ()), A;
}
function nxe(A, e, t) {
  if (Nd.isString(A))
    try {
      return (e || JSON.parse)(A), Nd.trim(A);
    } catch (r) {
      if (r.name !== "SyntaxError")
        throw r;
    }
  return (t || JSON.stringify)(A);
}
var Ky = {
  transitional: $be,
  adapter: rxe(),
  transformRequest: [function(e, t) {
    if ($Z(t, "Accept"), $Z(t, "Content-Type"), Nd.isFormData(e) || Nd.isArrayBuffer(e) || Nd.isBuffer(e) || Nd.isStream(e) || Nd.isFile(e) || Nd.isBlob(e))
      return e;
    if (Nd.isArrayBufferView(e))
      return e.buffer;
    if (Nd.isURLSearchParams(e))
      return t_(t, "application/x-www-form-urlencoded;charset=utf-8"), e.toString();
    var r = Nd.isObject(e), n = t && t["Content-Type"], i;
    if ((i = Nd.isFileList(e)) || r && n === "multipart/form-data") {
      var s = this.env && this.env.FormData;
      return exe(i ? { "files[]": e } : e, s && new s());
    } else if (r || n === "application/json")
      return t_(t, "application/json"), nxe(e);
    return e;
  }],
  transformResponse: [function(e) {
    var t = this.transitional || Ky.transitional, r = t && t.silentJSONParsing, n = t && t.forcedJSONParsing, i = !r && this.responseType === "json";
    if (i || n && Nd.isString(e) && e.length)
      try {
        return JSON.parse(e);
      } catch (s) {
        if (i)
          throw s.name === "SyntaxError" ? e_.from(s, e_.ERR_BAD_RESPONSE, this, null, this.response) : s;
      }
    return e;
  }],
  /**
   * A timeout in milliseconds to abort a request. If set to 0 (default) a
   * timeout is not created.
   */
  timeout: 0,
  xsrfCookieName: "XSRF-TOKEN",
  xsrfHeaderName: "X-XSRF-TOKEN",
  maxContentLength: -1,
  maxBodyLength: -1,
  env: {
    FormData: _be()
  },
  validateStatus: function(e) {
    return e >= 200 && e < 300;
  },
  headers: {
    common: {
      Accept: "application/json, text/plain, */*"
    }
  }
};
Nd.forEach(["delete", "get", "head"], function(e) {
  Ky.headers[e] = {};
});
Nd.forEach(["post", "put", "patch"], function(e) {
  Ky.headers[e] = Nd.merge(txe);
});
var gM = Ky, ixe = Mv, sxe = gM, axe = function(e, t, r) {
  var n = this || sxe;
  return ixe.forEach(r, function(s) {
    e = s.call(n, e, t);
  }), e;
}, JE, r_;
function Mfe() {
  return r_ || (r_ = 1, JE = function(e) {
    return !!(e && e.__CANCEL__);
  }), JE;
}
var n_ = Mv, zE = axe, oxe = Mfe(), fxe = gM, Axe = Ly();
function GE(A) {
  if (A.cancelToken && A.cancelToken.throwIfRequested(), A.signal && A.signal.aborted)
    throw new Axe();
}
var dxe = function(e) {
  GE(e), e.headers = e.headers || {}, e.data = zE.call(
    e,
    e.data,
    e.headers,
    e.transformRequest
  ), e.headers = n_.merge(
    e.headers.common || {},
    e.headers[e.method] || {},
    e.headers
  ), n_.forEach(
    ["delete", "get", "head", "post", "put", "patch", "common"],
    function(n) {
      delete e.headers[n];
    }
  );
  var t = e.adapter || fxe.adapter;
  return t(e).then(function(n) {
    return GE(e), n.data = zE.call(
      e,
      n.data,
      n.headers,
      e.transformResponse
    ), n;
  }, function(n) {
    return oxe(n) || (GE(e), n && n.response && (n.response.data = zE.call(
      e,
      n.response.data,
      n.response.headers,
      e.transformResponse
    ))), Promise.reject(n);
  });
}, Ap = Mv, Lfe = function(e, t) {
  t = t || {};
  var r = {};
  function n(d, v) {
    return Ap.isPlainObject(d) && Ap.isPlainObject(v) ? Ap.merge(d, v) : Ap.isPlainObject(v) ? Ap.merge({}, v) : Ap.isArray(v) ? v.slice() : v;
  }
  function i(d) {
    if (Ap.isUndefined(t[d])) {
      if (!Ap.isUndefined(e[d]))
        return n(void 0, e[d]);
    } else
      return n(e[d], t[d]);
  }
  function s(d) {
    if (!Ap.isUndefined(t[d]))
      return n(void 0, t[d]);
  }
  function a(d) {
    if (Ap.isUndefined(t[d])) {
      if (!Ap.isUndefined(e[d]))
        return n(void 0, e[d]);
    } else
      return n(void 0, t[d]);
  }
  function f(d) {
    if (d in t)
      return n(e[d], t[d]);
    if (d in e)
      return n(void 0, e[d]);
  }
  var o = {
    url: s,
    method: s,
    data: s,
    baseURL: a,
    transformRequest: a,
    transformResponse: a,
    paramsSerializer: a,
    timeout: a,
    timeoutMessage: a,
    withCredentials: a,
    adapter: a,
    responseType: a,
    xsrfCookieName: a,
    xsrfHeaderName: a,
    onUploadProgress: a,
    onDownloadProgress: a,
    decompress: a,
    maxContentLength: a,
    maxBodyLength: a,
    beforeRedirect: a,
    transport: a,
    httpAgent: a,
    httpsAgent: a,
    cancelToken: a,
    socketPath: a,
    responseEncoding: a,
    validateStatus: f
  };
  return Ap.forEach(Object.keys(e).concat(Object.keys(t)), function(v) {
    var u = o[v] || i, l = u(v);
    Ap.isUndefined(l) && u !== f || (r[v] = l);
  }), r;
}, ZE, i_;
function Kfe() {
  return i_ || (i_ = 1, ZE = {
    version: "0.27.2"
  }), ZE;
}
var vxe = Kfe().version, Yx = xU, XM = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach(function(A, e) {
  XM[A] = function(r) {
    return typeof r === A || "a" + (e < 1 ? "n " : " ") + A;
  };
});
var s_ = {};
XM.transitional = function(e, t, r) {
  function n(i, s) {
    return "[Axios v" + vxe + "] Transitional option '" + i + "'" + s + (r ? ". " + r : "");
  }
  return function(i, s, a) {
    if (e === !1)
      throw new Yx(
        n(s, " has been removed" + (t ? " in " + t : "")),
        Yx.ERR_DEPRECATED
      );
    return t && !s_[s] && (s_[s] = !0, console.warn(
      n(
        s,
        " has been deprecated since v" + t + " and will be removed in the near future"
      )
    )), e ? e(i, s, a) : !0;
  };
};
function uxe(A, e, t) {
  if (typeof A != "object")
    throw new Yx("options must be an object", Yx.ERR_BAD_OPTION_VALUE);
  for (var r = Object.keys(A), n = r.length; n-- > 0; ) {
    var i = r[n], s = e[i];
    if (s) {
      var a = A[i], f = a === void 0 || s(a, i, A);
      if (f !== !0)
        throw new Yx("option " + i + " must be " + f, Yx.ERR_BAD_OPTION_VALUE);
      continue;
    }
    if (t !== !0)
      throw new Yx("Unknown option " + i, Yx.ERR_BAD_OPTION);
  }
}
var lxe = {
  assertOptions: uxe,
  validators: XM
}, Jfe = Mv, Pxe = yfe, a_ = kbe, o_ = dxe, Jy = Lfe, cxe = Yfe, zfe = lxe, VW = zfe.validators;
function _S(A) {
  this.defaults = A, this.interceptors = {
    request: new a_(),
    response: new a_()
  };
}
_S.prototype.request = function(e, t) {
  typeof e == "string" ? (t = t || {}, t.url = e) : t = e || {}, t = Jy(this.defaults, t), t.method ? t.method = t.method.toLowerCase() : this.defaults.method ? t.method = this.defaults.method.toLowerCase() : t.method = "get";
  var r = t.transitional;
  r !== void 0 && zfe.assertOptions(r, {
    silentJSONParsing: VW.transitional(VW.boolean),
    forcedJSONParsing: VW.transitional(VW.boolean),
    clarifyTimeoutError: VW.transitional(VW.boolean)
  }, !1);
  var n = [], i = !0;
  this.interceptors.request.forEach(function(l) {
    typeof l.runWhen == "function" && l.runWhen(t) === !1 || (i = i && l.synchronous, n.unshift(l.fulfilled, l.rejected));
  });
  var s = [];
  this.interceptors.response.forEach(function(l) {
    s.push(l.fulfilled, l.rejected);
  });
  var a;
  if (!i) {
    var f = [o_, void 0];
    for (Array.prototype.unshift.apply(f, n), f = f.concat(s), a = Promise.resolve(t); f.length; )
      a = a.then(f.shift(), f.shift());
    return a;
  }
  for (var o = t; n.length; ) {
    var d = n.shift(), v = n.shift();
    try {
      o = d(o);
    } catch (u) {
      v(u);
      break;
    }
  }
  try {
    a = o_(o);
  } catch (u) {
    return Promise.reject(u);
  }
  for (; s.length; )
    a = a.then(s.shift(), s.shift());
  return a;
};
_S.prototype.getUri = function(e) {
  e = Jy(this.defaults, e);
  var t = cxe(e.baseURL, e.url);
  return Pxe(t, e.params, e.paramsSerializer);
};
Jfe.forEach(["delete", "get", "head", "options"], function(e) {
  _S.prototype[e] = function(t, r) {
    return this.request(Jy(r || {}, {
      method: e,
      url: t,
      data: (r || {}).data
    }));
  };
});
Jfe.forEach(["post", "put", "patch"], function(e) {
  function t(r) {
    return function(i, s, a) {
      return this.request(Jy(a || {}, {
        method: e,
        headers: r ? {
          "Content-Type": "multipart/form-data"
        } : {},
        url: i,
        data: s
      }));
    };
  }
  _S.prototype[e] = t(), _S.prototype[e + "Form"] = t(!0);
});
var pxe = _S, _E, f_;
function hxe() {
  if (f_)
    return _E;
  f_ = 1;
  var A = Ly();
  function e(t) {
    if (typeof t != "function")
      throw new TypeError("executor must be a function.");
    var r;
    this.promise = new Promise(function(s) {
      r = s;
    });
    var n = this;
    this.promise.then(function(i) {
      if (n._listeners) {
        var s, a = n._listeners.length;
        for (s = 0; s < a; s++)
          n._listeners[s](i);
        n._listeners = null;
      }
    }), this.promise.then = function(i) {
      var s, a = new Promise(function(f) {
        n.subscribe(f), s = f;
      }).then(i);
      return a.cancel = function() {
        n.unsubscribe(s);
      }, a;
    }, t(function(s) {
      n.reason || (n.reason = new A(s), r(n.reason));
    });
  }
  return e.prototype.throwIfRequested = function() {
    if (this.reason)
      throw this.reason;
  }, e.prototype.subscribe = function(r) {
    if (this.reason) {
      r(this.reason);
      return;
    }
    this._listeners ? this._listeners.push(r) : this._listeners = [r];
  }, e.prototype.unsubscribe = function(r) {
    if (this._listeners) {
      var n = this._listeners.indexOf(r);
      n !== -1 && this._listeners.splice(n, 1);
    }
  }, e.source = function() {
    var r, n = new e(function(s) {
      r = s;
    });
    return {
      token: n,
      cancel: r
    };
  }, _E = e, _E;
}
var $E, A_;
function Hxe() {
  return A_ || (A_ = 1, $E = function(e) {
    return function(r) {
      return e.apply(null, r);
    };
  }), $E;
}
var e5, d_;
function gxe() {
  if (d_)
    return e5;
  d_ = 1;
  var A = Mv;
  return e5 = function(t) {
    return A.isObject(t) && t.isAxiosError === !0;
  }, e5;
}
var v_ = Mv, Xxe = Vfe, FC = pxe, Txe = Lfe, qxe = gM;
function Gfe(A) {
  var e = new FC(A), t = Xxe(FC.prototype.request, e);
  return v_.extend(t, FC.prototype, e), v_.extend(t, e), t.create = function(n) {
    return Gfe(Txe(A, n));
  }, t;
}
var jc = Gfe(qxe);
jc.Axios = FC;
jc.CanceledError = Ly();
jc.CancelToken = hxe();
jc.isCancel = Mfe();
jc.VERSION = Kfe().version;
jc.toFormData = Qfe;
jc.AxiosError = xU;
jc.Cancel = jc.CanceledError;
jc.all = function(e) {
  return Promise.all(e);
};
jc.spread = Hxe();
jc.isAxiosError = gxe();
lM.exports = jc;
lM.exports.default = jc;
var bxe = lM.exports, xxe = bxe;
const Dxe = /* @__PURE__ */ Dfe(xxe), TM = Dxe.create();
TM.interceptors.response.use((A) => {
  if (A)
    return A.data;
});
var jxe = /* @__PURE__ */ ((A) => (A[A.HTTP = 0] = "HTTP", A[A.MQTT = 1] = "MQTT", A[A.WebSocket = 2] = "WebSocket", A))(jxe || {}), wxe = /* @__PURE__ */ ((A) => (A[A.Get = 0] = "Get", A[A.Post = 1] = "Post", A))(wxe || {}), mxe = /* @__PURE__ */ ((A) => (A[A.Value = 0] = "Value", A[A.StateData = 1] = "StateData", A[A.DynamicData = 2] = "DynamicData", A[A.Property = 3] = "Property", A[A.UrlQuery = 4] = "UrlQuery", A))(mxe || {});
class Bxe {
  constructor(e) {
    this.map = /* @__PURE__ */ new Map(), this._HTTPCacheMap = {}, this._MQTTCacheMap = {}, this._WebSocketCacheMap = {}, this.get = (t) => this.map.get(t), this.set = (t) => {
      const r = Xa(t), n = [];
      r.forEach((i) => {
        const s = i.id || e4(), a = {
          id: s,
          name: "",
          type: 0,
          subscribed: !1,
          url: "",
          method: 0,
          header: [],
          param: [],
          query: [],
          topics: "",
          username: "",
          password: "",
          clientId: "",
          protocols: ""
        }, o = { ...this.get(s) || a, ...i };
        this.map.set(s, o), n.push({ id: s, data: o });
      }), n.length && this.manager.root.emit("networkDataChange", n);
    }, this.delete = (t) => {
      const r = Xa(t), n = [];
      r.forEach((i) => {
        const s = this.get(i);
        if (!s)
          return !1;
        this.cancel(i), this.map.delete(i), n.push({ id: i, data: s });
      }), n.length && this.manager.root.emit("networkDataDelete", n);
    }, this.data = () => M9([...this.map.values()]), this.load = (t) => {
      this.dispose(), t.forEach((r) => this.map.set(r.id, r));
    }, this.subscribe = () => {
      this._timer && (clearInterval(this._timer), this._timer = void 0);
      const t = [];
      this.map.forEach((r) => {
        r.subscribed && (this.request(r.id, this.manager.scene), r.type === 0 && t.push(r.id));
      }), this._timer = setInterval(() => {
        this.manager.dynamicDataManager.createMock(), t.forEach((r) => this.request(r, this.manager.scene));
      }, this.manager.root.getOptions().pollingInterval * 1e3);
    }, this.request = (t, r) => {
      const n = this.get(t);
      if (!(!n || !n.url)) {
        switch (n.type) {
          case 0:
            this.requestHTTP(n, r);
            break;
          case 1:
            this.requestMQTT(n);
            break;
          case 2:
            this.requestWebSocket(n);
            break;
        }
        this.manager.eventManager.executeTrigger(
          "AfterNetworkRequest",
          null,
          { id: t }
        );
      }
    }, this.cancel = (t) => {
      const r = this.get(t);
      if (r) {
        switch (r.type) {
          case 0:
            this._cancelHTTP(r);
            break;
          case 1:
            this._cancelMQTT(r);
            break;
          case 2:
            this._cancelWebSocket(r);
            break;
        }
        this.manager.eventManager.executeTrigger(
          "AfterNetworkCancel",
          null,
          { id: t }
        );
      }
    }, this.response = (t, r) => {
      this.manager.eventManager.executeTrigger(
        "AfterNetworkResponse",
        null,
        { id: t }
      );
      const n = [];
      try {
        Array.isArray(r) ? n.push(...r) : Object.keys(r).forEach((i) => {
          n.push({ dataId: i, value: r[i] });
        });
      } catch (i) {
        console.error("NetworkManager Response Error: 处理返回数据错误。", i);
      }
      n.forEach((i) => {
        const { dataId: s, id: a, value: f } = i;
        this.manager.dynamicDataManager.setValue(s ?? a, f);
      });
    }, this.parseParam = (t, r) => {
      const n = {};
      return t.forEach((i) => {
        const { key: s, type: a, value: f, targetId: o } = i;
        a === 2 ? n[s] = this.manager.dynamicDataManager.getValue(f) : a === 3 ? f != null && f.startsWith("le5le#") ? n[s] = this.manager.getValue(r, f.substring(6)) : n[s] = this.manager.stateDataManager.getValue(o || r, f) : a === 4 ? n[s] = GBe()[f] : a === 0 && (n[s] = f);
      }), n;
    }, this.cancelAll = () => {
      clearInterval(this._timer), this._timer = void 0, this.map.forEach((t) => this.cancel(t.id));
    }, this.requestHTTP = (t, r) => {
      const { id: n, url: i, method: s, header: a, query: f, param: o } = t, d = this.parseParam(a, r), v = this.parseParam(f, r), u = this.parseParam(o, r), l = {
        url: i,
        method: this._getMethod(s),
        header: d,
        param: v,
        data: u
      }, P = e4();
      this._HTTPCacheMap[n] = { tempId: P, data: t, option: l }, fq(() => {
        TM(l).then((p) => {
          var c;
          if (p) {
            if (((c = this._HTTPCacheMap[n]) == null ? void 0 : c.tempId) !== P)
              return;
            this.response(n, p);
          }
        }).catch((p) => console.error(p));
      });
    }, this.requestMQTT = (t) => {
      const {
        id: r,
        url: n = "",
        topics: i = "",
        clientId: s = "",
        username: a = "",
        password: f = ""
      } = t;
      fq(() => {
        const o = {
          // true: 清除会话, false: 保留会话
          clean: !0,
          //超时时间
          connectTimeout: 4e4,
          username: a,
          password: f,
          clientId: s || r
        }, d = pbe.connect(n, o);
        this._MQTTCacheMap[r] = { instance: d, data: t, option: o }, i && d.subscribe(oD(i).split(",")), d.on("message", (v, u) => {
          const l = JSON.parse(u.toString());
          this.response(r, l);
        });
      });
    }, this.requestWebSocket = (t) => {
      const { id: r, url: n = "", protocols: i = "" } = t;
      fq(() => {
        const s = new WebSocket(n, i ? oD(i).split(",") : "");
        s.onmessage = (a) => {
          const f = JSON.parse(a.data);
          this.response(r, f);
        }, s.onclose = () => {
          this.requestWebSocket(t);
        }, this._WebSocketCacheMap[r] = { instance: s, data: t };
      });
    }, this.dispose = () => {
      this.cancelAll(), this.map.clear();
    }, this._cancelHTTP = (t) => {
      delete this._HTTPCacheMap[t.id];
    }, this._cancelMQTT = (t) => {
      var r;
      (r = this._MQTTCacheMap[t.id]) == null || r.instance.end(), delete this._MQTTCacheMap[t.id];
    }, this._cancelWebSocket = (t) => {
      const r = this._WebSocketCacheMap[t.id];
      r && (r.instance.onclose = void 0, r.instance.close()), delete this._WebSocketCacheMap[t.id];
    }, this._getMethod = (t) => ({
      0: "get",
      1: "post"
    })[t] || "", this.manager = e;
  }
}
var Wxe = /* @__PURE__ */ ((A) => (A[A.None = 0] = "None", A[A.OneWay = 1] = "OneWay", A[A.TwoWay = 2] = "TwoWay", A))(Wxe || {}), qM = /* @__PURE__ */ ((A) => (A[A.Start = 0] = "Start", A[A.Current = 1] = "Current", A[A.End = 2] = "End", A))(qM || {}), pp = ((A) => (A[A.In = u1.EASINGMODE_EASEIN] = "In", A[A.Out = u1.EASINGMODE_EASEOUT] = "Out", A[A.InOut = u1.EASINGMODE_EASEINOUT] = "InOut", A[A.None = 10] = "None", A))(pp || {});
const L8 = class L8 {
  constructor(e) {
    this._aniamteMap = /* @__PURE__ */ new Map(), this._transitionMap = /* @__PURE__ */ new Map(), this._aotmicAnimataleMap = /* @__PURE__ */ new Map(), this._groupAnimateMap = /* @__PURE__ */ new Map(), this.setSpeedRatio = (t, r, n) => {
      var f;
      n < 0 && (n = 0);
      const i = this.manager.getValue(t, "id"), s = this._aniamteMap.get(i);
      if (s) {
        const o = s.get(r);
        if (o) {
          for (const [d, v] of [...o]) {
            const u = this._aotmicAnimataleMap.get(d);
            u && v.forEach((l) => {
              var p;
              const P = (p = u.get(l)) == null ? void 0 : p.animatable;
              P && (P.speedRatio = n);
            });
          }
          return;
        }
      }
      const a = (f = this._groupAnimateMap.get(i)) == null ? void 0 : f.get(r);
      a && (a.speedRatio = n);
    }, this.begin = (t, r) => {
      this.stop(t, r);
      const n = this.manager.getValue(t, "id"), i = Xa(r), s = this.manager.getMetadata(t);
      if (!s || !s.animations)
        return;
      const a = s.animations.filter(
        (d) => i.includes(d.id)
      );
      if (!(a != null && a.length))
        return;
      const f = this.manager.getTargetsByRoot(t);
      if (!f)
        return;
      const o = this._aniamteMap.get(n) || /* @__PURE__ */ new Map();
      a.forEach((d) => {
        const {
          id: v,
          targetIndex: u,
          loopMode: l = 0,
          cycles: P,
          speedRatio: p = 1,
          endStatus: c = 0,
          list: H = []
        } = d;
        if (!H.length)
          return;
        const T = f[u];
        if (!T)
          return;
        const q = Math.max(...H.map((N) => N.endTime)), b = {}, j = o.get(v) || /* @__PURE__ */ new Map(), w = l === 2 ? q * 2 : q;
        let m = 0, I = 0;
        H.forEach(({ startTime: N, endTime: k, list: R }) => {
          R.forEach(({ property: y, startValue: O, endValue: Y }) => {
            const { target: ee, property: Z } = zt.getFinalTargetAndProperty(T, y, this.manager);
            if (!Z || !ee)
              return;
            const { animatable: te, valueType: fe } = zt.getTargetPropertyInfo(
              ee,
              Z,
              this.manager
            );
            if (!te)
              return;
            const _ = this._transPropertyAndValue(
              O,
              Z,
              ee
            ), G = this._transPropertyAndValue(
              Y,
              Z,
              ee
            );
            _.value = zt.deserialize(
              _.value,
              this.manager,
              fe
            ), G.value = zt.deserialize(
              G.value,
              this.manager,
              fe
            );
            const L = this.manager.getValue(ee, "id");
            b[L] || (b[L] = { target: ee, prop: {} });
            const $ = b[L].prop;
            $[_.property] || ($[_.property] = {});
            const ae = $[_.property];
            ae[N] = _.value, ae[k] = G.value, l === 2 && (ae[w - N] = _.value, ae[w - k] = G.value);
          });
        });
        for (const N in b) {
          const { target: k, prop: R } = b[N];
          for (const y in R) {
            const O = R[y];
            O[0] == null && (O[0] = this._transPropertyAndValue(
              zt.getValue(k, y, this.manager, !0),
              y,
              k
            ).value), O[w] == null && (O[w] = this._transPropertyAndValue(
              zt.getValue(k, y, this.manager, !0),
              y,
              k
            ).value);
            const Y = zt.typeOf(O[0], this.manager), ee = Object.keys(O).map((G) => ({
              frame: +G * L8.FRAME_PER_SECOND,
              value: O[G]
            })), Z = new st(
              "",
              y,
              L8.FRAME_PER_SECOND,
              Y,
              st.ANIMATIONLOOPMODE_CYCLE
            );
            Z.setKeys(ee);
            let te = l === 0 ? 1 : P || 1 / 0;
            m++;
            const fe = () => {
              const G = this.manager.scene.scene.beginDirectAnimation(
                k,
                [Z],
                0,
                w * L8.FRAME_PER_SECOND,
                !c,
                p
              );
              G.onAnimationLoop = () => {
                G.stop();
              }, G.onAnimationEnd = () => {
                this.stopAtomicAnimate(N, y), I++, I >= m && (this.stop(n, v), this.manager.eventManager.executeTrigger(
                  "AfterAnimationStop",
                  t,
                  {
                    type: "custom",
                    id: v
                  }
                ));
              }, this.setAtomicAnimate(
                N,
                y,
                G,
                c
              );
            };
            if (te > 1) {
              const G = this.manager.scene.scene.beginDirectAnimation(
                k,
                [Z],
                0,
                w * L8.FRAME_PER_SECOND,
                !0,
                p
              );
              G.onAnimationLoop = () => {
                te--, te <= 1 && (G.onAnimationEnd = void 0, G.stop(), fe());
              }, G.onAnimationEnd = () => {
                this.stopAtomicAnimate(N, y), I++, I >= m && (this.stop(n, v), this.manager.eventManager.executeTrigger(
                  "AfterAnimationStop",
                  t,
                  {
                    type: "custom",
                    id: v
                  }
                ));
              }, this.setAtomicAnimate(
                N,
                y,
                G,
                c
              );
            } else
              fe();
            const _ = j.get(N) || [];
            _.push(y), j.set(N, _);
          }
        }
        o.set(v, j);
      }), this._aniamteMap.set(n, o), i.forEach(
        (d) => this.manager.eventManager.executeTrigger("AfterAnimationBegin", t, {
          type: "custom",
          id: d
        })
      );
    }, this.pause = (t, r) => {
      const n = this.manager.getValue(t, "id"), i = Xa(r), s = this._aniamteMap.get(n);
      s && (i.forEach((a) => {
        const f = s.get(a);
        f == null || f.forEach((o, d) => {
          const v = this._aotmicAnimataleMap.get(d);
          v && o.forEach((u) => {
            var l, P;
            (P = (l = v.get(u)) == null ? void 0 : l.animatable) == null || P.pause();
          });
        });
      }), i.forEach(
        (a) => this.manager.eventManager.executeTrigger("AfterAnimationPause", t, {
          type: "custom",
          id: a
        })
      ));
    }, this.restart = (t, r) => {
      const n = this.manager.getValue(t, "id"), i = Xa(r), s = this._aniamteMap.get(n);
      s && (i.forEach((a) => {
        const f = s.get(a);
        f == null || f.forEach((o, d) => {
          const v = this._aotmicAnimataleMap.get(d);
          v && o.forEach((u) => {
            var l, P;
            (P = (l = v.get(u)) == null ? void 0 : l.animatable) == null || P.restart();
          });
        });
      }), i.forEach(
        (a) => this.manager.eventManager.executeTrigger("AfterAnimationRestart", t, {
          type: "custom",
          id: a
        })
      ));
    }, this.stop = (t, r) => {
      const n = this.manager.getValue(t, "id"), i = r ? Xa(r) : this.manager.getValue(t, "animations").map((a) => a.id), s = this._aniamteMap.get(n);
      s && (i.forEach((a) => {
        const f = s.get(a);
        f == null || f.forEach((o, d) => {
          const v = this._aotmicAnimataleMap.get(d);
          v && (o.forEach((u) => {
            const l = v.get(u);
            if (l) {
              const { animatable: P, endStatus: p } = l, c = {
                0: P.fromFrame,
                1: P.masterFrame,
                2: P.toFrame
              }[p];
              P.goToFrame(c), P.stop();
            }
            v.delete(u);
          }), f.delete(d));
        }), s.delete(a);
      }), s.size || this._aniamteMap.delete(n));
    }, this.beginGroup = (t, r) => {
      var o;
      this.stopGroup(t, r);
      const n = this.manager.getValue(t, "id"), i = Xa(r), s = (o = this.manager.getValue(t, "groupAnimations")) == null ? void 0 : o.filter((d) => i.includes(d.id));
      if (!(s != null && s.length))
        return;
      const a = this._groupAnimateMap.get(n) || /* @__PURE__ */ new Map(), f = (d, v) => {
        d.stop(), d.start(!1, v), d.onAnimationGroupEndObservable.add(() => {
          this.stopGroup(t, d.name);
        });
      };
      s.forEach((d) => {
        const { id: v, cycles: u, speedRatio: l = 1 } = d, P = this.manager.scene.scene.getAnimationGroupByName(v);
        if (!P)
          return;
        a.set(P.name, P);
        let p = u || 1 / 0;
        p > 1 ? (P == null || P.start(!0, l), P.onAnimationGroupLoopObservable.add(() => {
          p--, p <= 1 && f(P, l);
        })) : f(P, l);
      }), this._groupAnimateMap.set(n, a), i.forEach(
        (d) => this.manager.eventManager.executeTrigger("AfterAnimationBegin", t, {
          type: "group",
          id: d
        })
      );
    }, this.pauseGroup = (t, r) => {
      var s;
      const n = Xa(r), i = (s = this.manager.getValue(t, "groupAnimations")) == null ? void 0 : s.filter((a) => n.includes(a.id)).map(
        (a) => this.manager.scene.scene.getAnimationGroupByName(a.id)
      );
      i != null && i.length && (i.forEach((a) => a == null ? void 0 : a.pause()), n.forEach(
        (a) => this.manager.eventManager.executeTrigger("AfterAnimationPause", t, {
          type: "group",
          id: a
        })
      ));
    }, this.restartGroup = (t, r) => {
      var s;
      const n = Xa(r), i = (s = this.manager.getValue(t, "groupAnimations")) == null ? void 0 : s.filter((a) => n.includes(a.id)).map(
        (a) => this.manager.scene.scene.getAnimationGroupByName(a.id)
      );
      i != null && i.length && (i.forEach((a) => a == null ? void 0 : a.restart()), n.forEach(
        (a) => this.manager.eventManager.executeTrigger("AfterAnimationRestart", t, {
          type: "group",
          id: a
        })
      ));
    }, this.stopGroup = (t, r) => {
      var a;
      const n = this.manager.getValue(t, "id"), i = (a = this.manager.getValue(t, "groupAnimations")) == null ? void 0 : a.filter((f) => r ? Xa(r).includes(f.id) : !0);
      if (!(i != null && i.length))
        return;
      const s = this._groupAnimateMap.get(n);
      i.forEach((f) => {
        const {
          id: o,
          endStatus: d = 0
          /* Start */
        } = f, v = this.manager.scene.scene.getAnimationGroupByName(o);
        v && (v.onAnimationGroupLoopObservable.clear(), v.onAnimationGroupEndObservable.clear(), d === 0 ? v.isPlaying ? v.goToFrame(v.from) : v.reset() : d === 2 && v.isPlaying && v.goToFrame(v.to), v.stop(), s == null || s.delete(v.name));
      }), s && s.size && this._groupAnimateMap.set(n, s), i.forEach(
        (f) => this.manager.eventManager.executeTrigger("AfterAnimationStop", t, {
          type: "group",
          id: f.id
        })
      );
    }, this.beginTransition = (t, r, n, i, s = 0, a = 10, f = () => {
    }) => {
      const o = this.manager.getValue(t, "id"), { target: d, property: v } = zt.getFinalTargetAndProperty(t, r, this.manager);
      if (!d || !v)
        return !1;
      const u = this._transPropertyAndValue(
        n,
        v,
        d
      ), l = this._transPropertyAndValue(
        i,
        v,
        d
      );
      if (!u || !l)
        return !1;
      const P = zt.getValue(d, "id", this.manager);
      if (!zt.getTargetPropertyInfo(
        d,
        v,
        this.manager
      ).animatable)
        return !1;
      const c = s * L8.FRAME_PER_SECOND, H = u.value, T = l.value, q = [
        {
          frame: 0,
          value: H
        },
        {
          frame: c,
          value: T
        }
      ], b = new st(
        Zn(),
        v,
        L8.FRAME_PER_SECOND,
        zt.typeOf(H, this.manager),
        st.ANIMATIONLOOPMODE_CONSTANT
      );
      b.setKeys(q);
      const j = this._getEasingFunction(a);
      j && b.setEasingFunction(j);
      const m = this.manager.scene.scene.beginDirectAnimation(
        d,
        [b],
        0,
        c,
        !1,
        1
      );
      m.onAnimationEnd = () => {
        this.stopAtomicAnimate(P, v);
        const k = this._transitionMap.get(o);
        if (k) {
          const R = k.get(P) || [], y = R.indexOf(v);
          y > -1 && R.splice(y, 1), R.length || k.delete(P), k.size || this._transitionMap.delete(o);
        }
        f(t, r);
      }, this.setAtomicAnimate(
        P,
        v,
        m,
        2
        /* End */
      );
      const I = this._transitionMap.get(o) || /* @__PURE__ */ new Map(), N = I.get(P) || [];
      return N.push(v), I.set(P, N), this._transitionMap.set(o, I), !0;
    }, this.stopTransition = (t, r) => {
      const n = this.manager.getValue(t, "id"), i = this._transitionMap.get(n);
      if (!i)
        return;
      const { target: s, property: a } = zt.getFinalTargetAndProperty(t, r, this.manager);
      if (!s || !a)
        return !1;
      const f = this.manager.getValue(s, "id");
      (i.get(f) || []).indexOf(a) && this.setAtomicAnimate(
        f,
        a,
        null,
        2
        /* End */
      );
    }, this.stopAtomicAnimate = (t, r) => {
      const n = this._aotmicAnimataleMap.get(t) || /* @__PURE__ */ new Map();
      n.delete(r), n.size || this._aotmicAnimataleMap.delete(t);
    }, this.setAtomicAnimate = (t, r, n, i) => {
      const s = this._aotmicAnimataleMap.get(t) || /* @__PURE__ */ new Map(), a = s.get(r);
      if (a && a.animatable.stop(), !n) {
        s.delete(r);
        return;
      }
      n.disposeOnEnd = !0, s.set(r, { animatable: n, endStatus: i }), this._aotmicAnimataleMap.set(t, s);
    }, this.stopAll = () => {
      this._aotmicAnimataleMap.forEach((t) => {
        t.forEach(({ animatable: r }) => {
          r.stop();
        });
      }), this._groupAnimateMap.forEach(
        (t) => t.forEach((r) => {
          r.stop(), r.reset();
        })
      ), this._transitionMap.clear(), this._aniamteMap.clear(), this._aotmicAnimataleMap.clear(), this._groupAnimateMap.clear();
    }, this.dispose = () => {
      this.stopAll();
    }, this._transPropertyAndValue = (t, r, n) => (typeof t == "number" && (r === "alpha" || r === "beta" || r.startsWith("rotation")) && (t = ye.ToRadians(t)), r.startsWith("size"), { property: r, value: t }), this._getEasingFunction = (t) => {
      if (t === 10)
        return null;
      const r = new _N();
      return r.setEasingMode(t), r;
    }, this.manager = e;
  }
};
L8.FRAME_PER_SECOND = 100;
let wN = L8;
var eD = /* @__PURE__ */ ((A) => (A.Update = "Update", A.Add = "Add", A.Delete = "Delete", A.Select = "Select", A.MatBrash = "MatBrash", A))(eD || {});
class Sxe {
  constructor(e) {
    this.limitLen = 30, this.list = [], this.index = -1, this.add = (t) => {
      var r;
      if (!this.manager.root.running)
        return (r = t.infos) != null && r.length ? (this.list.splice(this.index + 1, this.list.length), this.list.push({
          ...t
        }), this.list.length > this.limitLen && this.list.splice(
          0,
          this.list.length - this.limitLen
        ), this.index = this.list.length - 1, !0) : !1;
    }, this.current = () => this.list[this.index], this.undo = () => {
      if (!this.undoable())
        return !1;
      const t = this.current();
      return this.execute(t, !0), this.index--, !0;
    }, this.redo = () => {
      if (!this.redoable())
        return !1;
      this.index++;
      const t = this.current();
      return this.execute(t), !0;
    }, this.undoable = () => !this.manager.root.running && this.len() && this.index > -1, this.redoable = () => !this.manager.root.running && this.len() && this.index < this.list.length - 1, this.len = () => this.list.length, this.clear = () => {
      this.list.length = 0, this.index = -1;
    }, this.all = () => this.list, this.execute = (t, r = !1) => {
      const { type: n, infos: i } = t;
      n === "Update" ? i.forEach((s) => {
        const { target: a, props: f } = s, o = {};
        Object.keys(f).forEach((d) => {
          const { oldValue: v, newValue: u } = f[d];
          o[d] = r ? v : u;
        }), zt.setValue(a, o, this.manager);
      }) : n === "Add" ? i.forEach((s) => {
        const { target: a } = s;
        r ? this.manager.nodeManager.removeNodes(a) : this.manager.nodeManager.addNodes(a);
      }) : n === "Delete" ? i.forEach((s) => {
        const { target: a } = s;
        r ? this.manager.nodeManager.addNodes(a) : this.manager.nodeManager.removeNodes(a);
      }) : n === "Select" ? i.forEach((s) => {
        const { oldTargets: a, newTargets: f } = s;
        r ? this.manager.selectNodes(a, { history: !1 }) : this.manager.selectNodes(f, { history: !1 });
      }) : n === "MatBrash" && i.forEach((s) => {
        const { target: a, props: f } = s, o = this.manager.scene.scene.getMeshByName(a);
        let d;
        r ? d = this.manager.scene.scene.getMaterialByName(f.material.oldValue) : d = this.manager.scene.scene.getMaterialByName(f.material.newValue), o instanceof Ee ? o.material = d : o instanceof bp && (o.sourceMesh.material = d);
      });
    }, this.dispose = () => {
    }, this.manager = e;
  }
}
class Uxe {
  constructor(e) {
    this.dragging = !1, this._selectorObserver = null, this._dragged = !1, this._dragAxis = "", this._startVectors = [], this._startOriginalVectors = [], this._alignLines = [], this._hoverColor = "#bfd4ff", this._selectedColor = "#4583ff", this._hoverNodes = [], this._selectedNodes = [], this._type = "position", this._panelEnabled = !0, this.createBoxGizmo = (t) => {
      const r = new zQ(
        t ? A4(t) : void 0,
        this._layer
      );
      return r.setEnabledRotationAxis(""), r.setEnabledScaling(!1), r.attachedMesh = null, r;
    }, this.createPositionGizmo = () => {
      const t = new oy(this._layer);
      return t.scaleRatio = 1, t.attachedMesh = null, [
        "x",
        "y",
        "z"
        /* , "yz", "xz", "xy" */
      ].forEach((r) => {
        const n = {
          x: t.xGizmo,
          y: t.yGizmo,
          z: t.zGizmo,
          yz: t.xPlaneGizmo,
          xz: t.yPlaneGizmo,
          xy: t.zPlaneGizmo
        }[r];
        n.dragBehavior.onDragStartObservable.add(
          (i, s) => {
            this.onDragStart(r, i, s);
          }
        ), n.dragBehavior.onDragObservable.add(
          (i, s) => {
            this.onDragging(r, i, s);
          }
        ), n.dragBehavior.onDragEndObservable.add(() => {
          this.onDragEnd(r);
        });
      }), t.updateGizmoRotationToMatchAttachedMesh = !1, t;
    }, this.createScalingGizmo = () => {
      const t = new ZQ(this._layer);
      return t.attachedMesh = null, ["x", "y", "z", "xyz"].forEach((r) => {
        const n = {
          x: t.xGizmo,
          y: t.yGizmo,
          z: t.zGizmo,
          xyz: t.uniformScaleGizmo
        }[r];
        n.dragBehavior.onDragStartObservable.add(
          (i, s) => {
            this.onDragStart(r, i, s);
          }
        ), n.dragBehavior.onDragObservable.add(
          (i, s) => {
            this.onDragging(r, i, s);
          }
        ), n.dragBehavior.onDragEndObservable.add(() => {
          this.onDragEnd(r);
        });
      }), t.updateGizmoRotationToMatchAttachedMesh = !1, t;
    }, this.createRotationGizmo = () => {
      const t = new GQ(this._layer);
      return t.attachedMesh = null, ["x", "y", "z"].forEach((r) => {
        const n = {
          x: t.xGizmo,
          y: t.yGizmo,
          z: t.zGizmo
        }[r];
        n.dragBehavior.onDragStartObservable.add(
          (i, s) => {
            this.onDragStart(r, i, s);
          }
        ), n.dragBehavior.onDragObservable.add(
          (i, s) => {
            this.onDragging(r, i, s);
          }
        ), n.dragBehavior.onDragEndObservable.add(() => {
          this.onDragEnd(r);
        });
      }), t.updateGizmoRotationToMatchAttachedMesh = !1, t;
    }, this.onDragStart = (t, r, n) => {
      this.dragging = !0, this._dragged = !1, this._alignLines.forEach((i) => i.dispose()), this._alignLines = [], this._dragAxis = t, this._dragEventData = r, this._setGizmoVisible(!0), this._startVectors = this.selectedNodes.map(this._getVector), this._startOriginalVectors = this.selectedNodes.map(this._getOriginVector), this._startVector = this._getVector(this.selectorMesh), this._currentVector = this._getOriginVector(this.selectorMesh), this._prevDragVector = this._currentVector.clone(), this.manager.root.emit("gizmoDragStart", {
        type: this.type,
        vector: this._startVector.clone(),
        vectors: this._startVectors.map((i) => i.clone()),
        multiple: this.selectedNodes.length > 1
      });
    }, this.onDragging = (t, r, n) => {
      this._dragged = !0, this._dragAxis = t, this._dragEventData = r, this._currentVector = this._currentVector.add(r.delta), this._setGizmoVisible(!1), this.type, this._align(t);
      const i = this._getVector(this.selectorMesh), s = i.subtract(this._startVector), a = this._selectedNodes.forEach((f, o) => {
        const d = this._startVectors[o].add(s);
        return this.type === "position" ? f.setAbsolutePosition(d) : this.type === "rotation" ? T9e(f, new S(ye.ToRadians(d.x), ye.ToRadians(d.y), ye.ToRadians(d.z))) : f[this.type].copyFrom(d), d;
      });
      this._prevDragVector = this._getOriginVector(this.selectorMesh), this.manager.root.emit("gizmoDragging", {
        type: this.type,
        vector: i,
        vectors: a,
        multiple: this.selectedNodes.length > 1
      });
    }, this.onDragEnd = (t) => {
      const r = this._getVector(this.selectorMesh), n = this._selectedNodes.map(this._getVector), i = this._selectedNodes.map(this._getOriginVector);
      this._dragged && this.manager.undoRedoManager.add({
        type: eD.Update,
        infos: this.selectedNodes.map((s, a) => ({
          target: s,
          props: {
            [this.type]: {
              oldValue: this._startOriginalVectors[a].clone(),
              newValue: i[a].clone()
            }
          }
        }))
      }), this.dragging = !1, this._dragAxis = t, this._dragged = !1, this._alignLines.forEach((s) => s.dispose()), this._alignLines = [], this._setGizmoVisible(!0), this.manager.root.emit("gizmoDragEnd", {
        type: this.type,
        vector: r,
        vectors: n,
        multiple: this.selectedNodes.length > 1
      });
    }, this.dispose = () => {
      this.selectedNodes = [], this.hoverNodes = [], this.panelEnabled = !1, this._layer.dispose();
    }, this._attach = (t, r) => {
      t.attachedMesh !== r && (t.attachedMesh = r);
    }, this._getOriginVector = (t) => this.type === "rotation" ? QC(t) : t[this.type].clone(), this._getVector = (t) => {
      if (this.type === "position")
        return t.getAbsolutePosition().clone();
      if (this.type === "rotation") {
        const r = QC(t).clone();
        return r.x = ye.ToDegrees(r.x), r.y = ye.ToDegrees(r.y), r.z = ye.ToDegrees(r.z), r;
      } else
        return t[this.type].clone();
    }, this._updatePanel = () => {
      if (!this.panel)
        return;
      const t = this[`_${this.type}Gizmo`].attachedMesh;
      if (!t || !this.panelEnabled || !this.dragging) {
        this.panel.style.display = "none";
        return;
      }
      const { x: r, y: n } = i9e(
        t.getAbsolutePosition(),
        this.manager.scene.scene
      );
      this.panel.style.display = "block", this.panel.style.left = r + "px", this.panel.style.top = n + "px";
      const i = [], s = this._getVector(t);
      ["x", "y", "z"].forEach((a) => {
        const f = s[a];
        i.push(`
        <div ${this._dragAxis.includes(a) ? 'style="color: #f84"' : ""}>
          ${a}: ${Vqe(f, 2)}
        </div>
      `);
      }), this.panel.innerHTML = i.join("");
    }, this._updateSelectorMesh = () => {
      this.selectedNodes.length && (this.selectedNodes.length === 1 ? (this.selectorMesh.position = this.selectedNodes[0].getAbsolutePosition(), this.selectorMesh.rotation = QC(this.selectedNodes[0]), this.selectorMesh.scaling = this.selectedNodes[0].scaling.clone()) : this.selectorMesh.position = X9e(this.selectedNodes.map((t) => t.getAbsolutePosition())), this._updatePanel());
    }, this._align = (t) => {
      this.type === "position" || this.type;
    }, this._setGizmoVisible = (t) => {
      this.type === "position" && (this._positionGizmo.xGizmo._rootMesh.setEnabled(t), this._positionGizmo.yGizmo._rootMesh.setEnabled(t), this._positionGizmo.zGizmo._rootMesh.setEnabled(t));
    }, this.manager = e, this._layer = new Ds(this.manager.scene.scene), this.selectorMesh = new Ee(d2e, this.manager.scene.scene), this._positionGizmo = this.createPositionGizmo(), this._scalingGizmo = this.createScalingGizmo(), this._rotationGizmo = this.createRotationGizmo(), this.panelEnabled = !0, this.type = this.manager.root.getOptions().selectorType;
  }
  get hoverColor() {
    return this._hoverColor;
  }
  set hoverColor(e) {
    e || (e = "#bfd4ff"), this._hoverNodes.forEach((t) => {
      this._selectedNodes.includes(t) || (this.manager.highlightManager.remove(t), this.manager.highlightManager.add(t, e));
    }), this._hoverColor = e;
  }
  get selectedColor() {
    return this._selectedColor;
  }
  set selectedColor(e) {
    e || (e = "#4583ff"), this._selectedNodes.forEach((t) => {
      this.manager.highlightManager.remove(t), this.manager.highlightManager.add(t, e);
    }), this._selectedColor = e;
  }
  get hoverNodes() {
    return this._hoverNodes;
  }
  set hoverNodes(e) {
    this._hoverNodes.forEach((t) => {
      this._selectedNodes.includes(t) || this.manager.highlightManager.remove(t);
    }), e.length && e.forEach((t) => {
      this._selectedNodes.includes(t) || this.manager.highlightManager.add(t, this.hoverColor);
    }), this._hoverNodes = e;
  }
  get selectedNodes() {
    return this._selectedNodes;
  }
  set selectedNodes(e) {
    this._selectedNodes.forEach((t) => {
      this.manager.highlightManager.remove(t), this._hoverNodes.includes(t) && this.manager.highlightManager.add(t, this.hoverColor);
    }), e.length && e.forEach((t) => {
      this.manager.highlightManager.add(t, this.selectedColor);
    }), this._selectedNodes = e, !e.length && this._selectorObserver ? (this.manager.scene.scene.onBeforeRenderObservable.remove(
      this._selectorObserver
    ), this._selectorObserver = null) : e.length && !this._selectorObserver && (this._selectorObserver = this.manager.scene.scene.onBeforeRenderObservable.add(this._updateSelectorMesh)), this.selectorMesh.position = S.Zero(), this.selectorMesh.rotation = S.Zero(), this.selectorMesh.scaling = S.One(), this._updateSelectorMesh(), this.type = this._type;
  }
  get type() {
    return this._type;
  }
  set type(e) {
    this._type = e, this._attach(this._positionGizmo, null), this._attach(this._scalingGizmo, null), this._attach(this._rotationGizmo, null), this._attach(
      this[`_${e}Gizmo`],
      this._selectedNodes.length ? this.selectorMesh : null
    );
  }
  get panelEnabled() {
    return this._panelEnabled;
  }
  set panelEnabled(e) {
    this._panelEnabled = e, e ? this.panel || (this.panel = document.createElement("div"), this.panel.style.position = "absolute", this.panel.style.left = "0px", this.panel.style.top = "0px", this.panel.style.zIndex = "10", this.panel.style.width = "auto", this.panel.style.height = "auto", this.panel.style.padding = "4px", this.panel.style.whiteSpace = "nowrap", this.panel.style.backgroundColor = "rgba(0, 0, 0, 0.8)", this.panel.style.color = "rgba(255, 255, 255, 1)", this.panel.style.transform = "translate(-50%, -50%)", this.manager.root.rootDOM.appendChild(this.panel)) : this.panel && (this.manager.root.rootDOM.removeChild(this.panel), this.panel = void 0), this._updatePanel();
  }
}
class Ixe {
  constructor(e) {
    this.map = /* @__PURE__ */ new Map(), this.nodeIdMap = /* @__PURE__ */ new Map(), this.get = (t) => this.map.get(t), this.set = (t) => {
      const r = Xa(t), n = [];
      r.forEach((i) => {
        const s = i.id || e4(), a = {
          id: s,
          name: ""
        }, o = { ...this.get(s) || a, ...i };
        this.map.set(s, o), this.nodeIdMap.has(s) || this.nodeIdMap.set(s, []), n.push({ id: s, data: o });
      }), n.length && this.manager.root.emit("groupChange", n);
    }, this.delete = (t) => {
      const r = Xa(t), n = [];
      r.forEach((a) => {
        const f = this.get(a);
        if (!f)
          return !1;
        this.map.delete(a), n.push({ id: a, data: f });
      });
      const i = {};
      r.forEach((a) => {
        (this.nodeIdMap.get(a) || []).forEach((o) => {
          i[o] = [];
        });
      });
      const s = [];
      Object.keys(i).forEach((a) => {
        const f = this.manager.getValue(a, "groups").filter((o) => !r.includes(o));
        s.push({ target: a, props: { groups: f } });
      }), this.manager.setValue(s), n.length && this.manager.root.emit("groupDelete", n);
    }, this.data = () => [...this.map.values()], this.load = (t) => {
      this.dispose(), t.forEach((r) => this.map.set(r.id, r));
    }, this.register = (t, r) => {
      r.forEach((n) => {
        this.nodeIdMap.has(n) || this.nodeIdMap.set(n, []);
      }), this.nodeIdMap.forEach((n, i) => {
        if (r.includes(i))
          n.includes(t) || n.push(t);
        else {
          const s = n.indexOf(t);
          s > -1 && n.splice(s, 1);
        }
      });
    }, this.getNodeIds = (t) => this.nodeIdMap.get(t) || [], this.select = (t) => {
      this.manager.selectNodes(this.getNodeIds(t));
    }, this.dispose = () => {
      this.map.clear(), this.nodeIdMap.clear();
    }, this.manager = e;
  }
}
class Rxe {
  constructor(e) {
    this.map = /* @__PURE__ */ new Map(), this.relationMap = /* @__PURE__ */ new Map(), this._mockable = !1, this.data = () => M9([...this.map.values()]), this.load = (t) => {
      this.map.clear(), t.forEach((r) => {
        const n = this._transData(r);
        this.map.set(n.dataId, n);
      }), this.manager.root.emit("dynamicDataChange", [...this.map.values()]);
    }, this.get = (t) => this.map.get(t), this.set = (t) => {
      const r = this._transData(t);
      this.map.set(r.dataId, r), this.manager.root.emit("dynamicDataChange", [...this.map.values()]);
    }, this.delete = (t) => {
      this.get(t) && this.map.delete(t), this.manager.root.emit("dynamicDataChange", [...this.map.values()]);
    }, this.register = (t, r) => {
      this.relationMap.forEach((n) => n.delete(t)), r.forEach((n) => {
        const { id: i, dataId: s } = n;
        if (s) {
          const a = this.relationMap.get(s) || /* @__PURE__ */ new Map(), f = a.get(t) || [];
          f.includes(i) || f.push(i), a.set(t, f), this.relationMap.set(s, a);
        }
      });
    }, this.getValue = (t) => {
      var r;
      return (r = this.map.get(t)) == null ? void 0 : r.value;
    }, this.setValue = (t, r, n = !1) => {
      const i = this.map.get(t);
      if (!i)
        return;
      const s = FH(r, i.dataType);
      (n || i.value !== s) && (i.value = s, this.manager.root.emit("dynamicDataChange", i), this.manager.eventManager.executeTrigger("AfterSetDynamicData", null, {
        dataId: t
      }), this.updateRelation(t, n));
    }, this.updateRelation = (t, r = !1) => {
      const n = this.get(t), i = this.relationMap.get(t);
      !n || !i || [...i].forEach(([s, a]) => {
        const f = this.manager.getTargetById(s);
        a.forEach((o) => {
          this.manager.stateDataManager.setValue(f, o, n.value, r);
        });
      });
    }, this.createMock = () => {
      this.mockable && this.map.forEach((t) => {
        let { dataId: r, rule: n, mockable: i, dataType: s } = t;
        if (i && !(s !== Mo.Boolean && !n)) {
          if (n = n.trim(), s === Mo.Boolean) {
            const a = !!Math.round(Math.random());
            this.setValue(r, a);
          } else if (s === Mo.Number)
            if (n.startsWith("{") && n.endsWith("}")) {
              n = oD(n);
              const a = n.substring(0, n.length - 1).substring(1).split(",").map((f) => FH(f, Mo.Number));
              a.length > 0 && this.setValue(r, a[Math.floor(Math.random() * a.length)]);
            } else if (n.includes("[") && n.includes("]")) {
              n = oD(n);
              const [a, f] = n.split("[")[1].split("]"), [o, d] = a.split(","), v = FH(f, Mo.Number), u = FH(o, Mo.Number), l = FH(d, Mo.Number), P = Math.min(u, l), p = Math.max(u, l);
              this.setValue(r, J_(P, p - P, v));
            } else
              this.setValue(r, FH(n, Mo.Number));
          else if (s === Mo.String)
            if (n.startsWith("{") && n.endsWith("}")) {
              const a = n.substring(0, n.length - 1).substring(1).split(",").map((f) => f.trim());
              a.length > 0 && this.setValue(r, a[Math.floor(Math.random() * a.length)]);
            } else if (n.startsWith("[") && n.endsWith("]")) {
              n = oD(n);
              const [a, f] = n.substring(0, n.length - 1).substring(1).split(",");
              if (f === void 0)
                this.setValue(r, NZ(FH(a, Mo.Number)));
              else {
                const o = FH(a, Mo.Number), d = FH(f, Mo.Number), v = Math.min(o, d), u = Math.max(o, d);
                this.setValue(r, NZ(J_(v, u - v)));
              }
            } else
              this.setValue(r, n);
        }
      });
    }, this.dispose = () => {
      this.map.clear(), this.relationMap.clear();
    }, this._transData = (t) => {
      const r = t.dataId || t.id, n = t.name || t.label, i = t.hasOwnProperty("dataType") ? t.dataType : h2e(t.type), s = t.hasOwnProperty("rule") ? t.rule : this._mockToRule(t.mock || "", t.type || "string"), a = FH(t.value, i);
      return { ...t, dataId: r, name: n, dataType: i, value: a, rule: s };
    }, this._mockToRule = (t, r) => {
      if (t = oD(t), r === "float" || r === "integer") {
        if (t.includes(","))
          return `{${t}}`;
        if (t.indexOf("-") > -1) {
          const n = t.split("-");
          if (n.length === 2 && n[0] !== "" || n.length > 2) {
            const i = Math.max(...n.map((f) => {
              var o;
              return ((o = f.split(".")[1]) == null ? void 0 : o.length) || 0;
            }));
            let s = "0", a = "0";
            return n.length === 2 ? (s = n[0], a = n[1]) : n.length === 3 ? n[0] === "" ? (s = "-" + n[1], a = n[2]) : (s = n[0], a = "-" + n[2]) : n.length === 4 && (s = "-" + n[1], a = "-" + n[3]), `[${s},${a}]${i}`;
          }
        }
      } else if (r === "string" && t.includes(","))
        return `{${t}}`;
      return t;
    }, this.manager = e;
  }
  get mockable() {
    return this._mockable;
  }
  set mockable(e) {
    this._mockable = e;
  }
}
const Zfe = 0.25, Vxe = [3, 2, 4, 1], Cxe = [4, 2, 1, 3], Oxe = (A) => {
  let e = A.byteLength, t = Math.floor(Zfe * e), r = {
    buffer1: A.slice(0, t),
    buffer2: A.slice(t, 2 * t),
    buffer3: A.slice(2 * t, e - t),
    buffer4: A.slice(e - t, e)
  }, n = _fe(r, Cxe);
  return r = void 0, n;
}, yxe = (A) => {
  let e = A.byteLength, t = Math.floor(Zfe * e), r = {
    buffer1: A.slice(0, t),
    buffer2: A.slice(t, 2 * t),
    buffer3: A.slice(2 * t, 3 * t),
    buffer4: A.slice(3 * t, e)
  }, n = _fe(r, Vxe);
  return r = void 0, n;
};
function _fe(A, e) {
  const t = [];
  e.forEach((a) => {
    t.push(A["buffer" + a]);
  });
  let r = 0;
  for (let a of t)
    r += a.byteLength;
  let n = new ArrayBuffer(r), i = new Uint8Array(n), s = 0;
  for (let a of t) {
    let f = new Uint8Array(a);
    i.set(f, s), s += a.byteLength;
  }
  return n;
}
class $fe {
  static DeCode(e) {
    return Oxe(e);
  }
  static EnCode(e) {
    return yxe(e);
  }
}
var e9e = { exports: {} }, t5 = { exports: {} };
const kxe = {}, Exe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: kxe
}, Symbol.toStringTag, { value: "Module" })), Fxe = /* @__PURE__ */ jfe(Exe);
var u_;
function Ea() {
  return u_ || (u_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r();
    })(zi, function() {
      var t = t || function(r, n) {
        var i;
        if (typeof window < "u" && window.crypto && (i = window.crypto), typeof self < "u" && self.crypto && (i = self.crypto), typeof globalThis < "u" && globalThis.crypto && (i = globalThis.crypto), !i && typeof window < "u" && window.msCrypto && (i = window.msCrypto), !i && typeof zi < "u" && zi.crypto && (i = zi.crypto), !i && typeof TI == "function")
          try {
            i = Fxe;
          } catch {
          }
        var s = function() {
          if (i) {
            if (typeof i.getRandomValues == "function")
              try {
                return i.getRandomValues(new Uint32Array(1))[0];
              } catch {
              }
            if (typeof i.randomBytes == "function")
              try {
                return i.randomBytes(4).readInt32LE();
              } catch {
              }
          }
          throw new Error("Native crypto module could not be used to get secure random number.");
        }, a = Object.create || /* @__PURE__ */ function() {
          function T() {
          }
          return function(q) {
            var b;
            return T.prototype = q, b = new T(), T.prototype = null, b;
          };
        }(), f = {}, o = f.lib = {}, d = o.Base = /* @__PURE__ */ function() {
          return {
            /**
             * Creates a new object that inherits from this object.
             *
             * @param {Object} overrides Properties to copy into the new object.
             *
             * @return {Object} The new object.
             *
             * @static
             *
             * @example
             *
             *     var MyType = CryptoJS.lib.Base.extend({
             *         field: 'value',
             *
             *         method: function () {
             *         }
             *     });
             */
            extend: function(T) {
              var q = a(this);
              return T && q.mixIn(T), (!q.hasOwnProperty("init") || this.init === q.init) && (q.init = function() {
                q.$super.init.apply(this, arguments);
              }), q.init.prototype = q, q.$super = this, q;
            },
            /**
             * Extends this object and runs the init method.
             * Arguments to create() will be passed to init().
             *
             * @return {Object} The new object.
             *
             * @static
             *
             * @example
             *
             *     var instance = MyType.create();
             */
            create: function() {
              var T = this.extend();
              return T.init.apply(T, arguments), T;
            },
            /**
             * Initializes a newly created object.
             * Override this method to add some logic when your objects are created.
             *
             * @example
             *
             *     var MyType = CryptoJS.lib.Base.extend({
             *         init: function () {
             *             // ...
             *         }
             *     });
             */
            init: function() {
            },
            /**
             * Copies properties into this object.
             *
             * @param {Object} properties The properties to mix in.
             *
             * @example
             *
             *     MyType.mixIn({
             *         field: 'value'
             *     });
             */
            mixIn: function(T) {
              for (var q in T)
                T.hasOwnProperty(q) && (this[q] = T[q]);
              T.hasOwnProperty("toString") && (this.toString = T.toString);
            },
            /**
             * Creates a copy of this object.
             *
             * @return {Object} The clone.
             *
             * @example
             *
             *     var clone = instance.clone();
             */
            clone: function() {
              return this.init.prototype.extend(this);
            }
          };
        }(), v = o.WordArray = d.extend({
          /**
           * Initializes a newly created word array.
           *
           * @param {Array} words (Optional) An array of 32-bit words.
           * @param {number} sigBytes (Optional) The number of significant bytes in the words.
           *
           * @example
           *
           *     var wordArray = CryptoJS.lib.WordArray.create();
           *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
           *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
           */
          init: function(T, q) {
            T = this.words = T || [], q != n ? this.sigBytes = q : this.sigBytes = T.length * 4;
          },
          /**
           * Converts this word array to a string.
           *
           * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
           *
           * @return {string} The stringified word array.
           *
           * @example
           *
           *     var string = wordArray + '';
           *     var string = wordArray.toString();
           *     var string = wordArray.toString(CryptoJS.enc.Utf8);
           */
          toString: function(T) {
            return (T || l).stringify(this);
          },
          /**
           * Concatenates a word array to this word array.
           *
           * @param {WordArray} wordArray The word array to append.
           *
           * @return {WordArray} This word array.
           *
           * @example
           *
           *     wordArray1.concat(wordArray2);
           */
          concat: function(T) {
            var q = this.words, b = T.words, j = this.sigBytes, w = T.sigBytes;
            if (this.clamp(), j % 4)
              for (var m = 0; m < w; m++) {
                var I = b[m >>> 2] >>> 24 - m % 4 * 8 & 255;
                q[j + m >>> 2] |= I << 24 - (j + m) % 4 * 8;
              }
            else
              for (var N = 0; N < w; N += 4)
                q[j + N >>> 2] = b[N >>> 2];
            return this.sigBytes += w, this;
          },
          /**
           * Removes insignificant bits.
           *
           * @example
           *
           *     wordArray.clamp();
           */
          clamp: function() {
            var T = this.words, q = this.sigBytes;
            T[q >>> 2] &= 4294967295 << 32 - q % 4 * 8, T.length = r.ceil(q / 4);
          },
          /**
           * Creates a copy of this word array.
           *
           * @return {WordArray} The clone.
           *
           * @example
           *
           *     var clone = wordArray.clone();
           */
          clone: function() {
            var T = d.clone.call(this);
            return T.words = this.words.slice(0), T;
          },
          /**
           * Creates a word array filled with random bytes.
           *
           * @param {number} nBytes The number of random bytes to generate.
           *
           * @return {WordArray} The random word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.lib.WordArray.random(16);
           */
          random: function(T) {
            for (var q = [], b = 0; b < T; b += 4)
              q.push(s());
            return new v.init(q, T);
          }
        }), u = f.enc = {}, l = u.Hex = {
          /**
           * Converts a word array to a hex string.
           *
           * @param {WordArray} wordArray The word array.
           *
           * @return {string} The hex string.
           *
           * @static
           *
           * @example
           *
           *     var hexString = CryptoJS.enc.Hex.stringify(wordArray);
           */
          stringify: function(T) {
            for (var q = T.words, b = T.sigBytes, j = [], w = 0; w < b; w++) {
              var m = q[w >>> 2] >>> 24 - w % 4 * 8 & 255;
              j.push((m >>> 4).toString(16)), j.push((m & 15).toString(16));
            }
            return j.join("");
          },
          /**
           * Converts a hex string to a word array.
           *
           * @param {string} hexStr The hex string.
           *
           * @return {WordArray} The word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.enc.Hex.parse(hexString);
           */
          parse: function(T) {
            for (var q = T.length, b = [], j = 0; j < q; j += 2)
              b[j >>> 3] |= parseInt(T.substr(j, 2), 16) << 24 - j % 8 * 4;
            return new v.init(b, q / 2);
          }
        }, P = u.Latin1 = {
          /**
           * Converts a word array to a Latin1 string.
           *
           * @param {WordArray} wordArray The word array.
           *
           * @return {string} The Latin1 string.
           *
           * @static
           *
           * @example
           *
           *     var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
           */
          stringify: function(T) {
            for (var q = T.words, b = T.sigBytes, j = [], w = 0; w < b; w++) {
              var m = q[w >>> 2] >>> 24 - w % 4 * 8 & 255;
              j.push(String.fromCharCode(m));
            }
            return j.join("");
          },
          /**
           * Converts a Latin1 string to a word array.
           *
           * @param {string} latin1Str The Latin1 string.
           *
           * @return {WordArray} The word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
           */
          parse: function(T) {
            for (var q = T.length, b = [], j = 0; j < q; j++)
              b[j >>> 2] |= (T.charCodeAt(j) & 255) << 24 - j % 4 * 8;
            return new v.init(b, q);
          }
        }, p = u.Utf8 = {
          /**
           * Converts a word array to a UTF-8 string.
           *
           * @param {WordArray} wordArray The word array.
           *
           * @return {string} The UTF-8 string.
           *
           * @static
           *
           * @example
           *
           *     var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
           */
          stringify: function(T) {
            try {
              return decodeURIComponent(escape(P.stringify(T)));
            } catch {
              throw new Error("Malformed UTF-8 data");
            }
          },
          /**
           * Converts a UTF-8 string to a word array.
           *
           * @param {string} utf8Str The UTF-8 string.
           *
           * @return {WordArray} The word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
           */
          parse: function(T) {
            return P.parse(unescape(encodeURIComponent(T)));
          }
        }, c = o.BufferedBlockAlgorithm = d.extend({
          /**
           * Resets this block algorithm's data buffer to its initial state.
           *
           * @example
           *
           *     bufferedBlockAlgorithm.reset();
           */
          reset: function() {
            this._data = new v.init(), this._nDataBytes = 0;
          },
          /**
           * Adds new data to this block algorithm's buffer.
           *
           * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
           *
           * @example
           *
           *     bufferedBlockAlgorithm._append('data');
           *     bufferedBlockAlgorithm._append(wordArray);
           */
          _append: function(T) {
            typeof T == "string" && (T = p.parse(T)), this._data.concat(T), this._nDataBytes += T.sigBytes;
          },
          /**
           * Processes available data blocks.
           *
           * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
           *
           * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
           *
           * @return {WordArray} The processed data.
           *
           * @example
           *
           *     var processedData = bufferedBlockAlgorithm._process();
           *     var processedData = bufferedBlockAlgorithm._process(!!'flush');
           */
          _process: function(T) {
            var q, b = this._data, j = b.words, w = b.sigBytes, m = this.blockSize, I = m * 4, N = w / I;
            T ? N = r.ceil(N) : N = r.max((N | 0) - this._minBufferSize, 0);
            var k = N * m, R = r.min(k * 4, w);
            if (k) {
              for (var y = 0; y < k; y += m)
                this._doProcessBlock(j, y);
              q = j.splice(0, k), b.sigBytes -= R;
            }
            return new v.init(q, R);
          },
          /**
           * Creates a copy of this object.
           *
           * @return {Object} The clone.
           *
           * @example
           *
           *     var clone = bufferedBlockAlgorithm.clone();
           */
          clone: function() {
            var T = d.clone.call(this);
            return T._data = this._data.clone(), T;
          },
          _minBufferSize: 0
        });
        o.Hasher = c.extend({
          /**
           * Configuration options.
           */
          cfg: d.extend(),
          /**
           * Initializes a newly created hasher.
           *
           * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
           *
           * @example
           *
           *     var hasher = CryptoJS.algo.SHA256.create();
           */
          init: function(T) {
            this.cfg = this.cfg.extend(T), this.reset();
          },
          /**
           * Resets this hasher to its initial state.
           *
           * @example
           *
           *     hasher.reset();
           */
          reset: function() {
            c.reset.call(this), this._doReset();
          },
          /**
           * Updates this hasher with a message.
           *
           * @param {WordArray|string} messageUpdate The message to append.
           *
           * @return {Hasher} This hasher.
           *
           * @example
           *
           *     hasher.update('message');
           *     hasher.update(wordArray);
           */
          update: function(T) {
            return this._append(T), this._process(), this;
          },
          /**
           * Finalizes the hash computation.
           * Note that the finalize operation is effectively a destructive, read-once operation.
           *
           * @param {WordArray|string} messageUpdate (Optional) A final message update.
           *
           * @return {WordArray} The hash.
           *
           * @example
           *
           *     var hash = hasher.finalize();
           *     var hash = hasher.finalize('message');
           *     var hash = hasher.finalize(wordArray);
           */
          finalize: function(T) {
            T && this._append(T);
            var q = this._doFinalize();
            return q;
          },
          blockSize: 16,
          /**
           * Creates a shortcut function to a hasher's object interface.
           *
           * @param {Hasher} hasher The hasher to create a helper for.
           *
           * @return {Function} The shortcut function.
           *
           * @static
           *
           * @example
           *
           *     var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
           */
          _createHelper: function(T) {
            return function(q, b) {
              return new T.init(b).finalize(q);
            };
          },
          /**
           * Creates a shortcut function to the HMAC's object interface.
           *
           * @param {Hasher} hasher The hasher to use in this HMAC helper.
           *
           * @return {Function} The shortcut function.
           *
           * @static
           *
           * @example
           *
           *     var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
           */
          _createHmacHelper: function(T) {
            return function(q, b) {
              return new H.HMAC.init(T, b).finalize(q);
            };
          }
        });
        var H = f.algo = {};
        return f;
      }(Math);
      return t;
    });
  }(t5)), t5.exports;
}
var r5 = { exports: {} }, l_;
function zy() {
  return l_ || (l_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r(Ea());
    })(zi, function(t) {
      return function(r) {
        var n = t, i = n.lib, s = i.Base, a = i.WordArray, f = n.x64 = {};
        f.Word = s.extend({
          /**
           * Initializes a newly created 64-bit word.
           *
           * @param {number} high The high 32 bits.
           * @param {number} low The low 32 bits.
           *
           * @example
           *
           *     var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
           */
          init: function(o, d) {
            this.high = o, this.low = d;
          }
          /**
           * Bitwise NOTs this word.
           *
           * @return {X64Word} A new x64-Word object after negating.
           *
           * @example
           *
           *     var negated = x64Word.not();
           */
          // not: function () {
          // var high = ~this.high;
          // var low = ~this.low;
          // return X64Word.create(high, low);
          // },
          /**
           * Bitwise ANDs this word with the passed word.
           *
           * @param {X64Word} word The x64-Word to AND with this word.
           *
           * @return {X64Word} A new x64-Word object after ANDing.
           *
           * @example
           *
           *     var anded = x64Word.and(anotherX64Word);
           */
          // and: function (word) {
          // var high = this.high & word.high;
          // var low = this.low & word.low;
          // return X64Word.create(high, low);
          // },
          /**
           * Bitwise ORs this word with the passed word.
           *
           * @param {X64Word} word The x64-Word to OR with this word.
           *
           * @return {X64Word} A new x64-Word object after ORing.
           *
           * @example
           *
           *     var ored = x64Word.or(anotherX64Word);
           */
          // or: function (word) {
          // var high = this.high | word.high;
          // var low = this.low | word.low;
          // return X64Word.create(high, low);
          // },
          /**
           * Bitwise XORs this word with the passed word.
           *
           * @param {X64Word} word The x64-Word to XOR with this word.
           *
           * @return {X64Word} A new x64-Word object after XORing.
           *
           * @example
           *
           *     var xored = x64Word.xor(anotherX64Word);
           */
          // xor: function (word) {
          // var high = this.high ^ word.high;
          // var low = this.low ^ word.low;
          // return X64Word.create(high, low);
          // },
          /**
           * Shifts this word n bits to the left.
           *
           * @param {number} n The number of bits to shift.
           *
           * @return {X64Word} A new x64-Word object after shifting.
           *
           * @example
           *
           *     var shifted = x64Word.shiftL(25);
           */
          // shiftL: function (n) {
          // if (n < 32) {
          // var high = (this.high << n) | (this.low >>> (32 - n));
          // var low = this.low << n;
          // } else {
          // var high = this.low << (n - 32);
          // var low = 0;
          // }
          // return X64Word.create(high, low);
          // },
          /**
           * Shifts this word n bits to the right.
           *
           * @param {number} n The number of bits to shift.
           *
           * @return {X64Word} A new x64-Word object after shifting.
           *
           * @example
           *
           *     var shifted = x64Word.shiftR(7);
           */
          // shiftR: function (n) {
          // if (n < 32) {
          // var low = (this.low >>> n) | (this.high << (32 - n));
          // var high = this.high >>> n;
          // } else {
          // var low = this.high >>> (n - 32);
          // var high = 0;
          // }
          // return X64Word.create(high, low);
          // },
          /**
           * Rotates this word n bits to the left.
           *
           * @param {number} n The number of bits to rotate.
           *
           * @return {X64Word} A new x64-Word object after rotating.
           *
           * @example
           *
           *     var rotated = x64Word.rotL(25);
           */
          // rotL: function (n) {
          // return this.shiftL(n).or(this.shiftR(64 - n));
          // },
          /**
           * Rotates this word n bits to the right.
           *
           * @param {number} n The number of bits to rotate.
           *
           * @return {X64Word} A new x64-Word object after rotating.
           *
           * @example
           *
           *     var rotated = x64Word.rotR(7);
           */
          // rotR: function (n) {
          // return this.shiftR(n).or(this.shiftL(64 - n));
          // },
          /**
           * Adds this word with the passed word.
           *
           * @param {X64Word} word The x64-Word to add with this word.
           *
           * @return {X64Word} A new x64-Word object after adding.
           *
           * @example
           *
           *     var added = x64Word.add(anotherX64Word);
           */
          // add: function (word) {
          // var low = (this.low + word.low) | 0;
          // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
          // var high = (this.high + word.high + carry) | 0;
          // return X64Word.create(high, low);
          // }
        }), f.WordArray = s.extend({
          /**
           * Initializes a newly created word array.
           *
           * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
           * @param {number} sigBytes (Optional) The number of significant bytes in the words.
           *
           * @example
           *
           *     var wordArray = CryptoJS.x64.WordArray.create();
           *
           *     var wordArray = CryptoJS.x64.WordArray.create([
           *         CryptoJS.x64.Word.create(0x00010203, 0x04050607),
           *         CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
           *     ]);
           *
           *     var wordArray = CryptoJS.x64.WordArray.create([
           *         CryptoJS.x64.Word.create(0x00010203, 0x04050607),
           *         CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
           *     ], 10);
           */
          init: function(o, d) {
            o = this.words = o || [], d != r ? this.sigBytes = d : this.sigBytes = o.length * 8;
          },
          /**
           * Converts this 64-bit word array to a 32-bit word array.
           *
           * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
           *
           * @example
           *
           *     var x32WordArray = x64WordArray.toX32();
           */
          toX32: function() {
            for (var o = this.words, d = o.length, v = [], u = 0; u < d; u++) {
              var l = o[u];
              v.push(l.high), v.push(l.low);
            }
            return a.create(v, this.sigBytes);
          },
          /**
           * Creates a copy of this word array.
           *
           * @return {X64WordArray} The clone.
           *
           * @example
           *
           *     var clone = x64WordArray.clone();
           */
          clone: function() {
            for (var o = s.clone.call(this), d = o.words = this.words.slice(0), v = d.length, u = 0; u < v; u++)
              d[u] = d[u].clone();
            return o;
          }
        });
      }(), t;
    });
  }(r5)), r5.exports;
}
var n5 = { exports: {} }, P_;
function Nxe() {
  return P_ || (P_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r(Ea());
    })(zi, function(t) {
      return function() {
        if (typeof ArrayBuffer == "function") {
          var r = t, n = r.lib, i = n.WordArray, s = i.init, a = i.init = function(f) {
            if (f instanceof ArrayBuffer && (f = new Uint8Array(f)), (f instanceof Int8Array || typeof Uint8ClampedArray < "u" && f instanceof Uint8ClampedArray || f instanceof Int16Array || f instanceof Uint16Array || f instanceof Int32Array || f instanceof Uint32Array || f instanceof Float32Array || f instanceof Float64Array) && (f = new Uint8Array(f.buffer, f.byteOffset, f.byteLength)), f instanceof Uint8Array) {
              for (var o = f.byteLength, d = [], v = 0; v < o; v++)
                d[v >>> 2] |= f[v] << 24 - v % 4 * 8;
              s.call(this, d, o);
            } else
              s.apply(this, arguments);
          };
          a.prototype = i;
        }
      }(), t.lib.WordArray;
    });
  }(n5)), n5.exports;
}
var i5 = { exports: {} }, c_;
function Qxe() {
  return c_ || (c_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r(Ea());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.WordArray, s = r.enc;
        s.Utf16 = s.Utf16BE = {
          /**
           * Converts a word array to a UTF-16 BE string.
           *
           * @param {WordArray} wordArray The word array.
           *
           * @return {string} The UTF-16 BE string.
           *
           * @static
           *
           * @example
           *
           *     var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
           */
          stringify: function(f) {
            for (var o = f.words, d = f.sigBytes, v = [], u = 0; u < d; u += 2) {
              var l = o[u >>> 2] >>> 16 - u % 4 * 8 & 65535;
              v.push(String.fromCharCode(l));
            }
            return v.join("");
          },
          /**
           * Converts a UTF-16 BE string to a word array.
           *
           * @param {string} utf16Str The UTF-16 BE string.
           *
           * @return {WordArray} The word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
           */
          parse: function(f) {
            for (var o = f.length, d = [], v = 0; v < o; v++)
              d[v >>> 1] |= f.charCodeAt(v) << 16 - v % 2 * 16;
            return i.create(d, o * 2);
          }
        }, s.Utf16LE = {
          /**
           * Converts a word array to a UTF-16 LE string.
           *
           * @param {WordArray} wordArray The word array.
           *
           * @return {string} The UTF-16 LE string.
           *
           * @static
           *
           * @example
           *
           *     var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
           */
          stringify: function(f) {
            for (var o = f.words, d = f.sigBytes, v = [], u = 0; u < d; u += 2) {
              var l = a(o[u >>> 2] >>> 16 - u % 4 * 8 & 65535);
              v.push(String.fromCharCode(l));
            }
            return v.join("");
          },
          /**
           * Converts a UTF-16 LE string to a word array.
           *
           * @param {string} utf16Str The UTF-16 LE string.
           *
           * @return {WordArray} The word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
           */
          parse: function(f) {
            for (var o = f.length, d = [], v = 0; v < o; v++)
              d[v >>> 1] |= a(f.charCodeAt(v) << 16 - v % 2 * 16);
            return i.create(d, o * 2);
          }
        };
        function a(f) {
          return f << 8 & 4278255360 | f >>> 8 & 16711935;
        }
      }(), t.enc.Utf16;
    });
  }(i5)), i5.exports;
}
var s5 = { exports: {} }, p_;
function Ym() {
  return p_ || (p_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r(Ea());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.WordArray, s = r.enc;
        s.Base64 = {
          /**
           * Converts a word array to a Base64 string.
           *
           * @param {WordArray} wordArray The word array.
           *
           * @return {string} The Base64 string.
           *
           * @static
           *
           * @example
           *
           *     var base64String = CryptoJS.enc.Base64.stringify(wordArray);
           */
          stringify: function(f) {
            var o = f.words, d = f.sigBytes, v = this._map;
            f.clamp();
            for (var u = [], l = 0; l < d; l += 3)
              for (var P = o[l >>> 2] >>> 24 - l % 4 * 8 & 255, p = o[l + 1 >>> 2] >>> 24 - (l + 1) % 4 * 8 & 255, c = o[l + 2 >>> 2] >>> 24 - (l + 2) % 4 * 8 & 255, H = P << 16 | p << 8 | c, T = 0; T < 4 && l + T * 0.75 < d; T++)
                u.push(v.charAt(H >>> 6 * (3 - T) & 63));
            var q = v.charAt(64);
            if (q)
              for (; u.length % 4; )
                u.push(q);
            return u.join("");
          },
          /**
           * Converts a Base64 string to a word array.
           *
           * @param {string} base64Str The Base64 string.
           *
           * @return {WordArray} The word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.enc.Base64.parse(base64String);
           */
          parse: function(f) {
            var o = f.length, d = this._map, v = this._reverseMap;
            if (!v) {
              v = this._reverseMap = [];
              for (var u = 0; u < d.length; u++)
                v[d.charCodeAt(u)] = u;
            }
            var l = d.charAt(64);
            if (l) {
              var P = f.indexOf(l);
              P !== -1 && (o = P);
            }
            return a(f, o, v);
          },
          _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
        };
        function a(f, o, d) {
          for (var v = [], u = 0, l = 0; l < o; l++)
            if (l % 4) {
              var P = d[f.charCodeAt(l - 1)] << l % 4 * 2, p = d[f.charCodeAt(l)] >>> 6 - l % 4 * 2, c = P | p;
              v[u >>> 2] |= c << 24 - u % 4 * 8, u++;
            }
          return i.create(v, u);
        }
      }(), t.enc.Base64;
    });
  }(s5)), s5.exports;
}
var a5 = { exports: {} }, h_;
function Yxe() {
  return h_ || (h_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r(Ea());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.WordArray, s = r.enc;
        s.Base64url = {
          /**
           * Converts a word array to a Base64url string.
           *
           * @param {WordArray} wordArray The word array.
           *
           * @param {boolean} urlSafe Whether to use url safe
           *
           * @return {string} The Base64url string.
           *
           * @static
           *
           * @example
           *
           *     var base64String = CryptoJS.enc.Base64url.stringify(wordArray);
           */
          stringify: function(f, o) {
            o === void 0 && (o = !0);
            var d = f.words, v = f.sigBytes, u = o ? this._safe_map : this._map;
            f.clamp();
            for (var l = [], P = 0; P < v; P += 3)
              for (var p = d[P >>> 2] >>> 24 - P % 4 * 8 & 255, c = d[P + 1 >>> 2] >>> 24 - (P + 1) % 4 * 8 & 255, H = d[P + 2 >>> 2] >>> 24 - (P + 2) % 4 * 8 & 255, T = p << 16 | c << 8 | H, q = 0; q < 4 && P + q * 0.75 < v; q++)
                l.push(u.charAt(T >>> 6 * (3 - q) & 63));
            var b = u.charAt(64);
            if (b)
              for (; l.length % 4; )
                l.push(b);
            return l.join("");
          },
          /**
           * Converts a Base64url string to a word array.
           *
           * @param {string} base64Str The Base64url string.
           *
           * @param {boolean} urlSafe Whether to use url safe
           *
           * @return {WordArray} The word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.enc.Base64url.parse(base64String);
           */
          parse: function(f, o) {
            o === void 0 && (o = !0);
            var d = f.length, v = o ? this._safe_map : this._map, u = this._reverseMap;
            if (!u) {
              u = this._reverseMap = [];
              for (var l = 0; l < v.length; l++)
                u[v.charCodeAt(l)] = l;
            }
            var P = v.charAt(64);
            if (P) {
              var p = f.indexOf(P);
              p !== -1 && (d = p);
            }
            return a(f, d, u);
          },
          _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
          _safe_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
        };
        function a(f, o, d) {
          for (var v = [], u = 0, l = 0; l < o; l++)
            if (l % 4) {
              var P = d[f.charCodeAt(l - 1)] << l % 4 * 2, p = d[f.charCodeAt(l)] >>> 6 - l % 4 * 2, c = P | p;
              v[u >>> 2] |= c << 24 - u % 4 * 8, u++;
            }
          return i.create(v, u);
        }
      }(), t.enc.Base64url;
    });
  }(a5)), a5.exports;
}
var o5 = { exports: {} }, H_;
function Mm() {
  return H_ || (H_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r(Ea());
    })(zi, function(t) {
      return function(r) {
        var n = t, i = n.lib, s = i.WordArray, a = i.Hasher, f = n.algo, o = [];
        (function() {
          for (var p = 0; p < 64; p++)
            o[p] = r.abs(r.sin(p + 1)) * 4294967296 | 0;
        })();
        var d = f.MD5 = a.extend({
          _doReset: function() {
            this._hash = new s.init([
              1732584193,
              4023233417,
              2562383102,
              271733878
            ]);
          },
          _doProcessBlock: function(p, c) {
            for (var H = 0; H < 16; H++) {
              var T = c + H, q = p[T];
              p[T] = (q << 8 | q >>> 24) & 16711935 | (q << 24 | q >>> 8) & 4278255360;
            }
            var b = this._hash.words, j = p[c + 0], w = p[c + 1], m = p[c + 2], I = p[c + 3], N = p[c + 4], k = p[c + 5], R = p[c + 6], y = p[c + 7], O = p[c + 8], Y = p[c + 9], ee = p[c + 10], Z = p[c + 11], te = p[c + 12], fe = p[c + 13], _ = p[c + 14], G = p[c + 15], L = b[0], $ = b[1], ae = b[2], Pe = b[3];
            L = v(L, $, ae, Pe, j, 7, o[0]), Pe = v(Pe, L, $, ae, w, 12, o[1]), ae = v(ae, Pe, L, $, m, 17, o[2]), $ = v($, ae, Pe, L, I, 22, o[3]), L = v(L, $, ae, Pe, N, 7, o[4]), Pe = v(Pe, L, $, ae, k, 12, o[5]), ae = v(ae, Pe, L, $, R, 17, o[6]), $ = v($, ae, Pe, L, y, 22, o[7]), L = v(L, $, ae, Pe, O, 7, o[8]), Pe = v(Pe, L, $, ae, Y, 12, o[9]), ae = v(ae, Pe, L, $, ee, 17, o[10]), $ = v($, ae, Pe, L, Z, 22, o[11]), L = v(L, $, ae, Pe, te, 7, o[12]), Pe = v(Pe, L, $, ae, fe, 12, o[13]), ae = v(ae, Pe, L, $, _, 17, o[14]), $ = v($, ae, Pe, L, G, 22, o[15]), L = u(L, $, ae, Pe, w, 5, o[16]), Pe = u(Pe, L, $, ae, R, 9, o[17]), ae = u(ae, Pe, L, $, Z, 14, o[18]), $ = u($, ae, Pe, L, j, 20, o[19]), L = u(L, $, ae, Pe, k, 5, o[20]), Pe = u(Pe, L, $, ae, ee, 9, o[21]), ae = u(ae, Pe, L, $, G, 14, o[22]), $ = u($, ae, Pe, L, N, 20, o[23]), L = u(L, $, ae, Pe, Y, 5, o[24]), Pe = u(Pe, L, $, ae, _, 9, o[25]), ae = u(ae, Pe, L, $, I, 14, o[26]), $ = u($, ae, Pe, L, O, 20, o[27]), L = u(L, $, ae, Pe, fe, 5, o[28]), Pe = u(Pe, L, $, ae, m, 9, o[29]), ae = u(ae, Pe, L, $, y, 14, o[30]), $ = u($, ae, Pe, L, te, 20, o[31]), L = l(L, $, ae, Pe, k, 4, o[32]), Pe = l(Pe, L, $, ae, O, 11, o[33]), ae = l(ae, Pe, L, $, Z, 16, o[34]), $ = l($, ae, Pe, L, _, 23, o[35]), L = l(L, $, ae, Pe, w, 4, o[36]), Pe = l(Pe, L, $, ae, N, 11, o[37]), ae = l(ae, Pe, L, $, y, 16, o[38]), $ = l($, ae, Pe, L, ee, 23, o[39]), L = l(L, $, ae, Pe, fe, 4, o[40]), Pe = l(Pe, L, $, ae, j, 11, o[41]), ae = l(ae, Pe, L, $, I, 16, o[42]), $ = l($, ae, Pe, L, R, 23, o[43]), L = l(L, $, ae, Pe, Y, 4, o[44]), Pe = l(Pe, L, $, ae, te, 11, o[45]), ae = l(ae, Pe, L, $, G, 16, o[46]), $ = l($, ae, Pe, L, m, 23, o[47]), L = P(L, $, ae, Pe, j, 6, o[48]), Pe = P(Pe, L, $, ae, y, 10, o[49]), ae = P(ae, Pe, L, $, _, 15, o[50]), $ = P($, ae, Pe, L, k, 21, o[51]), L = P(L, $, ae, Pe, te, 6, o[52]), Pe = P(Pe, L, $, ae, I, 10, o[53]), ae = P(ae, Pe, L, $, ee, 15, o[54]), $ = P($, ae, Pe, L, w, 21, o[55]), L = P(L, $, ae, Pe, O, 6, o[56]), Pe = P(Pe, L, $, ae, G, 10, o[57]), ae = P(ae, Pe, L, $, R, 15, o[58]), $ = P($, ae, Pe, L, fe, 21, o[59]), L = P(L, $, ae, Pe, N, 6, o[60]), Pe = P(Pe, L, $, ae, Z, 10, o[61]), ae = P(ae, Pe, L, $, m, 15, o[62]), $ = P($, ae, Pe, L, Y, 21, o[63]), b[0] = b[0] + L | 0, b[1] = b[1] + $ | 0, b[2] = b[2] + ae | 0, b[3] = b[3] + Pe | 0;
          },
          _doFinalize: function() {
            var p = this._data, c = p.words, H = this._nDataBytes * 8, T = p.sigBytes * 8;
            c[T >>> 5] |= 128 << 24 - T % 32;
            var q = r.floor(H / 4294967296), b = H;
            c[(T + 64 >>> 9 << 4) + 15] = (q << 8 | q >>> 24) & 16711935 | (q << 24 | q >>> 8) & 4278255360, c[(T + 64 >>> 9 << 4) + 14] = (b << 8 | b >>> 24) & 16711935 | (b << 24 | b >>> 8) & 4278255360, p.sigBytes = (c.length + 1) * 4, this._process();
            for (var j = this._hash, w = j.words, m = 0; m < 4; m++) {
              var I = w[m];
              w[m] = (I << 8 | I >>> 24) & 16711935 | (I << 24 | I >>> 8) & 4278255360;
            }
            return j;
          },
          clone: function() {
            var p = a.clone.call(this);
            return p._hash = this._hash.clone(), p;
          }
        });
        function v(p, c, H, T, q, b, j) {
          var w = p + (c & H | ~c & T) + q + j;
          return (w << b | w >>> 32 - b) + c;
        }
        function u(p, c, H, T, q, b, j) {
          var w = p + (c & T | H & ~T) + q + j;
          return (w << b | w >>> 32 - b) + c;
        }
        function l(p, c, H, T, q, b, j) {
          var w = p + (c ^ H ^ T) + q + j;
          return (w << b | w >>> 32 - b) + c;
        }
        function P(p, c, H, T, q, b, j) {
          var w = p + (H ^ (c | ~T)) + q + j;
          return (w << b | w >>> 32 - b) + c;
        }
        n.MD5 = a._createHelper(d), n.HmacMD5 = a._createHmacHelper(d);
      }(Math), t.MD5;
    });
  }(o5)), o5.exports;
}
var f5 = { exports: {} }, g_;
function t9e() {
  return g_ || (g_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r(Ea());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.WordArray, s = n.Hasher, a = r.algo, f = [], o = a.SHA1 = s.extend({
          _doReset: function() {
            this._hash = new i.init([
              1732584193,
              4023233417,
              2562383102,
              271733878,
              3285377520
            ]);
          },
          _doProcessBlock: function(d, v) {
            for (var u = this._hash.words, l = u[0], P = u[1], p = u[2], c = u[3], H = u[4], T = 0; T < 80; T++) {
              if (T < 16)
                f[T] = d[v + T] | 0;
              else {
                var q = f[T - 3] ^ f[T - 8] ^ f[T - 14] ^ f[T - 16];
                f[T] = q << 1 | q >>> 31;
              }
              var b = (l << 5 | l >>> 27) + H + f[T];
              T < 20 ? b += (P & p | ~P & c) + 1518500249 : T < 40 ? b += (P ^ p ^ c) + 1859775393 : T < 60 ? b += (P & p | P & c | p & c) - 1894007588 : b += (P ^ p ^ c) - 899497514, H = c, c = p, p = P << 30 | P >>> 2, P = l, l = b;
            }
            u[0] = u[0] + l | 0, u[1] = u[1] + P | 0, u[2] = u[2] + p | 0, u[3] = u[3] + c | 0, u[4] = u[4] + H | 0;
          },
          _doFinalize: function() {
            var d = this._data, v = d.words, u = this._nDataBytes * 8, l = d.sigBytes * 8;
            return v[l >>> 5] |= 128 << 24 - l % 32, v[(l + 64 >>> 9 << 4) + 14] = Math.floor(u / 4294967296), v[(l + 64 >>> 9 << 4) + 15] = u, d.sigBytes = v.length * 4, this._process(), this._hash;
          },
          clone: function() {
            var d = s.clone.call(this);
            return d._hash = this._hash.clone(), d;
          }
        });
        r.SHA1 = s._createHelper(o), r.HmacSHA1 = s._createHmacHelper(o);
      }(), t.SHA1;
    });
  }(f5)), f5.exports;
}
var A5 = { exports: {} }, X_;
function bM() {
  return X_ || (X_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r(Ea());
    })(zi, function(t) {
      return function(r) {
        var n = t, i = n.lib, s = i.WordArray, a = i.Hasher, f = n.algo, o = [], d = [];
        (function() {
          function l(H) {
            for (var T = r.sqrt(H), q = 2; q <= T; q++)
              if (!(H % q))
                return !1;
            return !0;
          }
          function P(H) {
            return (H - (H | 0)) * 4294967296 | 0;
          }
          for (var p = 2, c = 0; c < 64; )
            l(p) && (c < 8 && (o[c] = P(r.pow(p, 1 / 2))), d[c] = P(r.pow(p, 1 / 3)), c++), p++;
        })();
        var v = [], u = f.SHA256 = a.extend({
          _doReset: function() {
            this._hash = new s.init(o.slice(0));
          },
          _doProcessBlock: function(l, P) {
            for (var p = this._hash.words, c = p[0], H = p[1], T = p[2], q = p[3], b = p[4], j = p[5], w = p[6], m = p[7], I = 0; I < 64; I++) {
              if (I < 16)
                v[I] = l[P + I] | 0;
              else {
                var N = v[I - 15], k = (N << 25 | N >>> 7) ^ (N << 14 | N >>> 18) ^ N >>> 3, R = v[I - 2], y = (R << 15 | R >>> 17) ^ (R << 13 | R >>> 19) ^ R >>> 10;
                v[I] = k + v[I - 7] + y + v[I - 16];
              }
              var O = b & j ^ ~b & w, Y = c & H ^ c & T ^ H & T, ee = (c << 30 | c >>> 2) ^ (c << 19 | c >>> 13) ^ (c << 10 | c >>> 22), Z = (b << 26 | b >>> 6) ^ (b << 21 | b >>> 11) ^ (b << 7 | b >>> 25), te = m + Z + O + d[I] + v[I], fe = ee + Y;
              m = w, w = j, j = b, b = q + te | 0, q = T, T = H, H = c, c = te + fe | 0;
            }
            p[0] = p[0] + c | 0, p[1] = p[1] + H | 0, p[2] = p[2] + T | 0, p[3] = p[3] + q | 0, p[4] = p[4] + b | 0, p[5] = p[5] + j | 0, p[6] = p[6] + w | 0, p[7] = p[7] + m | 0;
          },
          _doFinalize: function() {
            var l = this._data, P = l.words, p = this._nDataBytes * 8, c = l.sigBytes * 8;
            return P[c >>> 5] |= 128 << 24 - c % 32, P[(c + 64 >>> 9 << 4) + 14] = r.floor(p / 4294967296), P[(c + 64 >>> 9 << 4) + 15] = p, l.sigBytes = P.length * 4, this._process(), this._hash;
          },
          clone: function() {
            var l = a.clone.call(this);
            return l._hash = this._hash.clone(), l;
          }
        });
        n.SHA256 = a._createHelper(u), n.HmacSHA256 = a._createHmacHelper(u);
      }(Math), t.SHA256;
    });
  }(A5)), A5.exports;
}
var d5 = { exports: {} }, T_;
function Mxe() {
  return T_ || (T_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), bM());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.WordArray, s = r.algo, a = s.SHA256, f = s.SHA224 = a.extend({
          _doReset: function() {
            this._hash = new i.init([
              3238371032,
              914150663,
              812702999,
              4144912697,
              4290775857,
              1750603025,
              1694076839,
              3204075428
            ]);
          },
          _doFinalize: function() {
            var o = a._doFinalize.call(this);
            return o.sigBytes -= 4, o;
          }
        });
        r.SHA224 = a._createHelper(f), r.HmacSHA224 = a._createHmacHelper(f);
      }(), t.SHA224;
    });
  }(d5)), d5.exports;
}
var v5 = { exports: {} }, q_;
function r9e() {
  return q_ || (q_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), zy());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.Hasher, s = r.x64, a = s.Word, f = s.WordArray, o = r.algo;
        function d() {
          return a.create.apply(a, arguments);
        }
        var v = [
          d(1116352408, 3609767458),
          d(1899447441, 602891725),
          d(3049323471, 3964484399),
          d(3921009573, 2173295548),
          d(961987163, 4081628472),
          d(1508970993, 3053834265),
          d(2453635748, 2937671579),
          d(2870763221, 3664609560),
          d(3624381080, 2734883394),
          d(310598401, 1164996542),
          d(607225278, 1323610764),
          d(1426881987, 3590304994),
          d(1925078388, 4068182383),
          d(2162078206, 991336113),
          d(2614888103, 633803317),
          d(3248222580, 3479774868),
          d(3835390401, 2666613458),
          d(4022224774, 944711139),
          d(264347078, 2341262773),
          d(604807628, 2007800933),
          d(770255983, 1495990901),
          d(1249150122, 1856431235),
          d(1555081692, 3175218132),
          d(1996064986, 2198950837),
          d(2554220882, 3999719339),
          d(2821834349, 766784016),
          d(2952996808, 2566594879),
          d(3210313671, 3203337956),
          d(3336571891, 1034457026),
          d(3584528711, 2466948901),
          d(113926993, 3758326383),
          d(338241895, 168717936),
          d(666307205, 1188179964),
          d(773529912, 1546045734),
          d(1294757372, 1522805485),
          d(1396182291, 2643833823),
          d(1695183700, 2343527390),
          d(1986661051, 1014477480),
          d(2177026350, 1206759142),
          d(2456956037, 344077627),
          d(2730485921, 1290863460),
          d(2820302411, 3158454273),
          d(3259730800, 3505952657),
          d(3345764771, 106217008),
          d(3516065817, 3606008344),
          d(3600352804, 1432725776),
          d(4094571909, 1467031594),
          d(275423344, 851169720),
          d(430227734, 3100823752),
          d(506948616, 1363258195),
          d(659060556, 3750685593),
          d(883997877, 3785050280),
          d(958139571, 3318307427),
          d(1322822218, 3812723403),
          d(1537002063, 2003034995),
          d(1747873779, 3602036899),
          d(1955562222, 1575990012),
          d(2024104815, 1125592928),
          d(2227730452, 2716904306),
          d(2361852424, 442776044),
          d(2428436474, 593698344),
          d(2756734187, 3733110249),
          d(3204031479, 2999351573),
          d(3329325298, 3815920427),
          d(3391569614, 3928383900),
          d(3515267271, 566280711),
          d(3940187606, 3454069534),
          d(4118630271, 4000239992),
          d(116418474, 1914138554),
          d(174292421, 2731055270),
          d(289380356, 3203993006),
          d(460393269, 320620315),
          d(685471733, 587496836),
          d(852142971, 1086792851),
          d(1017036298, 365543100),
          d(1126000580, 2618297676),
          d(1288033470, 3409855158),
          d(1501505948, 4234509866),
          d(1607167915, 987167468),
          d(1816402316, 1246189591)
        ], u = [];
        (function() {
          for (var P = 0; P < 80; P++)
            u[P] = d();
        })();
        var l = o.SHA512 = i.extend({
          _doReset: function() {
            this._hash = new f.init([
              new a.init(1779033703, 4089235720),
              new a.init(3144134277, 2227873595),
              new a.init(1013904242, 4271175723),
              new a.init(2773480762, 1595750129),
              new a.init(1359893119, 2917565137),
              new a.init(2600822924, 725511199),
              new a.init(528734635, 4215389547),
              new a.init(1541459225, 327033209)
            ]);
          },
          _doProcessBlock: function(P, p) {
            for (var c = this._hash.words, H = c[0], T = c[1], q = c[2], b = c[3], j = c[4], w = c[5], m = c[6], I = c[7], N = H.high, k = H.low, R = T.high, y = T.low, O = q.high, Y = q.low, ee = b.high, Z = b.low, te = j.high, fe = j.low, _ = w.high, G = w.low, L = m.high, $ = m.low, ae = I.high, Pe = I.low, ge = N, me = k, Xe = R, De = y, ne = O, re = Y, ve = ee, qe = Z, ke = te, be = fe, Fe = _, Ke = G, nt = L, ut = $, bt = ae, wt = Pe, Tt = 0; Tt < 80; Tt++) {
              var lr, Qt, tr = u[Tt];
              if (Tt < 16)
                Qt = tr.high = P[p + Tt * 2] | 0, lr = tr.low = P[p + Tt * 2 + 1] | 0;
              else {
                var br = u[Tt - 15], Xn = br.high, qr = br.low, En = (Xn >>> 1 | qr << 31) ^ (Xn >>> 8 | qr << 24) ^ Xn >>> 7, Bn = (qr >>> 1 | Xn << 31) ^ (qr >>> 8 | Xn << 24) ^ (qr >>> 7 | Xn << 25), Fi = u[Tt - 2], Gt = Fi.high, xr = Fi.low, Br = (Gt >>> 19 | xr << 13) ^ (Gt << 3 | xr >>> 29) ^ Gt >>> 6, nn = (xr >>> 19 | Gt << 13) ^ (xr << 3 | Gt >>> 29) ^ (xr >>> 6 | Gt << 26), sn = u[Tt - 7], Pn = sn.high, an = sn.low, Wn = u[Tt - 16], rr = Wn.high, Sr = Wn.low;
                lr = Bn + an, Qt = En + Pn + (lr >>> 0 < Bn >>> 0 ? 1 : 0), lr = lr + nn, Qt = Qt + Br + (lr >>> 0 < nn >>> 0 ? 1 : 0), lr = lr + Sr, Qt = Qt + rr + (lr >>> 0 < Sr >>> 0 ? 1 : 0), tr.high = Qt, tr.low = lr;
              }
              var nr = ke & Fe ^ ~ke & nt, Er = be & Ke ^ ~be & ut, Rn = ge & Xe ^ ge & ne ^ Xe & ne, Vn = me & De ^ me & re ^ De & re, ki = (ge >>> 28 | me << 4) ^ (ge << 30 | me >>> 2) ^ (ge << 25 | me >>> 7), as = (me >>> 28 | ge << 4) ^ (me << 30 | ge >>> 2) ^ (me << 25 | ge >>> 7), Rr = (ke >>> 14 | be << 18) ^ (ke >>> 18 | be << 14) ^ (ke << 23 | be >>> 9), Ii = (be >>> 14 | ke << 18) ^ (be >>> 18 | ke << 14) ^ (be << 23 | ke >>> 9), is = v[Tt], ji = is.high, _i = is.low, oi = wt + Ii, vr = bt + Rr + (oi >>> 0 < wt >>> 0 ? 1 : 0), oi = oi + Er, vr = vr + nr + (oi >>> 0 < Er >>> 0 ? 1 : 0), oi = oi + _i, vr = vr + ji + (oi >>> 0 < _i >>> 0 ? 1 : 0), oi = oi + lr, vr = vr + Qt + (oi >>> 0 < lr >>> 0 ? 1 : 0), Fr = as + Vn, pr = ki + Rn + (Fr >>> 0 < as >>> 0 ? 1 : 0);
              bt = nt, wt = ut, nt = Fe, ut = Ke, Fe = ke, Ke = be, be = qe + oi | 0, ke = ve + vr + (be >>> 0 < qe >>> 0 ? 1 : 0) | 0, ve = ne, qe = re, ne = Xe, re = De, Xe = ge, De = me, me = oi + Fr | 0, ge = vr + pr + (me >>> 0 < oi >>> 0 ? 1 : 0) | 0;
            }
            k = H.low = k + me, H.high = N + ge + (k >>> 0 < me >>> 0 ? 1 : 0), y = T.low = y + De, T.high = R + Xe + (y >>> 0 < De >>> 0 ? 1 : 0), Y = q.low = Y + re, q.high = O + ne + (Y >>> 0 < re >>> 0 ? 1 : 0), Z = b.low = Z + qe, b.high = ee + ve + (Z >>> 0 < qe >>> 0 ? 1 : 0), fe = j.low = fe + be, j.high = te + ke + (fe >>> 0 < be >>> 0 ? 1 : 0), G = w.low = G + Ke, w.high = _ + Fe + (G >>> 0 < Ke >>> 0 ? 1 : 0), $ = m.low = $ + ut, m.high = L + nt + ($ >>> 0 < ut >>> 0 ? 1 : 0), Pe = I.low = Pe + wt, I.high = ae + bt + (Pe >>> 0 < wt >>> 0 ? 1 : 0);
          },
          _doFinalize: function() {
            var P = this._data, p = P.words, c = this._nDataBytes * 8, H = P.sigBytes * 8;
            p[H >>> 5] |= 128 << 24 - H % 32, p[(H + 128 >>> 10 << 5) + 30] = Math.floor(c / 4294967296), p[(H + 128 >>> 10 << 5) + 31] = c, P.sigBytes = p.length * 4, this._process();
            var T = this._hash.toX32();
            return T;
          },
          clone: function() {
            var P = i.clone.call(this);
            return P._hash = this._hash.clone(), P;
          },
          blockSize: 1024 / 32
        });
        r.SHA512 = i._createHelper(l), r.HmacSHA512 = i._createHmacHelper(l);
      }(), t.SHA512;
    });
  }(v5)), v5.exports;
}
var u5 = { exports: {} }, b_;
function Lxe() {
  return b_ || (b_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), zy(), r9e());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.x64, i = n.Word, s = n.WordArray, a = r.algo, f = a.SHA512, o = a.SHA384 = f.extend({
          _doReset: function() {
            this._hash = new s.init([
              new i.init(3418070365, 3238371032),
              new i.init(1654270250, 914150663),
              new i.init(2438529370, 812702999),
              new i.init(355462360, 4144912697),
              new i.init(1731405415, 4290775857),
              new i.init(2394180231, 1750603025),
              new i.init(3675008525, 1694076839),
              new i.init(1203062813, 3204075428)
            ]);
          },
          _doFinalize: function() {
            var d = f._doFinalize.call(this);
            return d.sigBytes -= 16, d;
          }
        });
        r.SHA384 = f._createHelper(o), r.HmacSHA384 = f._createHmacHelper(o);
      }(), t.SHA384;
    });
  }(u5)), u5.exports;
}
var l5 = { exports: {} }, x_;
function Kxe() {
  return x_ || (x_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), zy());
    })(zi, function(t) {
      return function(r) {
        var n = t, i = n.lib, s = i.WordArray, a = i.Hasher, f = n.x64, o = f.Word, d = n.algo, v = [], u = [], l = [];
        (function() {
          for (var c = 1, H = 0, T = 0; T < 24; T++) {
            v[c + 5 * H] = (T + 1) * (T + 2) / 2 % 64;
            var q = H % 5, b = (2 * c + 3 * H) % 5;
            c = q, H = b;
          }
          for (var c = 0; c < 5; c++)
            for (var H = 0; H < 5; H++)
              u[c + 5 * H] = H + (2 * c + 3 * H) % 5 * 5;
          for (var j = 1, w = 0; w < 24; w++) {
            for (var m = 0, I = 0, N = 0; N < 7; N++) {
              if (j & 1) {
                var k = (1 << N) - 1;
                k < 32 ? I ^= 1 << k : m ^= 1 << k - 32;
              }
              j & 128 ? j = j << 1 ^ 113 : j <<= 1;
            }
            l[w] = o.create(m, I);
          }
        })();
        var P = [];
        (function() {
          for (var c = 0; c < 25; c++)
            P[c] = o.create();
        })();
        var p = d.SHA3 = a.extend({
          /**
           * Configuration options.
           *
           * @property {number} outputLength
           *   The desired number of bits in the output hash.
           *   Only values permitted are: 224, 256, 384, 512.
           *   Default: 512
           */
          cfg: a.cfg.extend({
            outputLength: 512
          }),
          _doReset: function() {
            for (var c = this._state = [], H = 0; H < 25; H++)
              c[H] = new o.init();
            this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
          },
          _doProcessBlock: function(c, H) {
            for (var T = this._state, q = this.blockSize / 2, b = 0; b < q; b++) {
              var j = c[H + 2 * b], w = c[H + 2 * b + 1];
              j = (j << 8 | j >>> 24) & 16711935 | (j << 24 | j >>> 8) & 4278255360, w = (w << 8 | w >>> 24) & 16711935 | (w << 24 | w >>> 8) & 4278255360;
              var m = T[b];
              m.high ^= w, m.low ^= j;
            }
            for (var I = 0; I < 24; I++) {
              for (var N = 0; N < 5; N++) {
                for (var k = 0, R = 0, y = 0; y < 5; y++) {
                  var m = T[N + 5 * y];
                  k ^= m.high, R ^= m.low;
                }
                var O = P[N];
                O.high = k, O.low = R;
              }
              for (var N = 0; N < 5; N++)
                for (var Y = P[(N + 4) % 5], ee = P[(N + 1) % 5], Z = ee.high, te = ee.low, k = Y.high ^ (Z << 1 | te >>> 31), R = Y.low ^ (te << 1 | Z >>> 31), y = 0; y < 5; y++) {
                  var m = T[N + 5 * y];
                  m.high ^= k, m.low ^= R;
                }
              for (var fe = 1; fe < 25; fe++) {
                var k, R, m = T[fe], _ = m.high, G = m.low, L = v[fe];
                L < 32 ? (k = _ << L | G >>> 32 - L, R = G << L | _ >>> 32 - L) : (k = G << L - 32 | _ >>> 64 - L, R = _ << L - 32 | G >>> 64 - L);
                var $ = P[u[fe]];
                $.high = k, $.low = R;
              }
              var ae = P[0], Pe = T[0];
              ae.high = Pe.high, ae.low = Pe.low;
              for (var N = 0; N < 5; N++)
                for (var y = 0; y < 5; y++) {
                  var fe = N + 5 * y, m = T[fe], ge = P[fe], me = P[(N + 1) % 5 + 5 * y], Xe = P[(N + 2) % 5 + 5 * y];
                  m.high = ge.high ^ ~me.high & Xe.high, m.low = ge.low ^ ~me.low & Xe.low;
                }
              var m = T[0], De = l[I];
              m.high ^= De.high, m.low ^= De.low;
            }
          },
          _doFinalize: function() {
            var c = this._data, H = c.words;
            this._nDataBytes * 8;
            var T = c.sigBytes * 8, q = this.blockSize * 32;
            H[T >>> 5] |= 1 << 24 - T % 32, H[(r.ceil((T + 1) / q) * q >>> 5) - 1] |= 128, c.sigBytes = H.length * 4, this._process();
            for (var b = this._state, j = this.cfg.outputLength / 8, w = j / 8, m = [], I = 0; I < w; I++) {
              var N = b[I], k = N.high, R = N.low;
              k = (k << 8 | k >>> 24) & 16711935 | (k << 24 | k >>> 8) & 4278255360, R = (R << 8 | R >>> 24) & 16711935 | (R << 24 | R >>> 8) & 4278255360, m.push(R), m.push(k);
            }
            return new s.init(m, j);
          },
          clone: function() {
            for (var c = a.clone.call(this), H = c._state = this._state.slice(0), T = 0; T < 25; T++)
              H[T] = H[T].clone();
            return c;
          }
        });
        n.SHA3 = a._createHelper(p), n.HmacSHA3 = a._createHmacHelper(p);
      }(Math), t.SHA3;
    });
  }(l5)), l5.exports;
}
var P5 = { exports: {} }, D_;
function Jxe() {
  return D_ || (D_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r(Ea());
    })(zi, function(t) {
      /** @preserve
      			(c) 2012 by Cédric Mesnil. All rights reserved.
      
      			Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
      
      			    - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
      			    - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
      
      			THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      			*/
      return function(r) {
        var n = t, i = n.lib, s = i.WordArray, a = i.Hasher, f = n.algo, o = s.create([
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          7,
          4,
          13,
          1,
          10,
          6,
          15,
          3,
          12,
          0,
          9,
          5,
          2,
          14,
          11,
          8,
          3,
          10,
          14,
          4,
          9,
          15,
          8,
          1,
          2,
          7,
          0,
          6,
          13,
          11,
          5,
          12,
          1,
          9,
          11,
          10,
          0,
          8,
          12,
          4,
          13,
          3,
          7,
          15,
          14,
          5,
          6,
          2,
          4,
          0,
          5,
          9,
          7,
          12,
          2,
          10,
          14,
          1,
          3,
          8,
          11,
          6,
          15,
          13
        ]), d = s.create([
          5,
          14,
          7,
          0,
          9,
          2,
          11,
          4,
          13,
          6,
          15,
          8,
          1,
          10,
          3,
          12,
          6,
          11,
          3,
          7,
          0,
          13,
          5,
          10,
          14,
          15,
          8,
          12,
          4,
          9,
          1,
          2,
          15,
          5,
          1,
          3,
          7,
          14,
          6,
          9,
          11,
          8,
          12,
          2,
          10,
          0,
          4,
          13,
          8,
          6,
          4,
          1,
          3,
          11,
          15,
          0,
          5,
          12,
          2,
          13,
          9,
          7,
          10,
          14,
          12,
          15,
          10,
          4,
          1,
          5,
          8,
          7,
          6,
          2,
          13,
          14,
          0,
          3,
          9,
          11
        ]), v = s.create([
          11,
          14,
          15,
          12,
          5,
          8,
          7,
          9,
          11,
          13,
          14,
          15,
          6,
          7,
          9,
          8,
          7,
          6,
          8,
          13,
          11,
          9,
          7,
          15,
          7,
          12,
          15,
          9,
          11,
          7,
          13,
          12,
          11,
          13,
          6,
          7,
          14,
          9,
          13,
          15,
          14,
          8,
          13,
          6,
          5,
          12,
          7,
          5,
          11,
          12,
          14,
          15,
          14,
          15,
          9,
          8,
          9,
          14,
          5,
          6,
          8,
          6,
          5,
          12,
          9,
          15,
          5,
          11,
          6,
          8,
          13,
          12,
          5,
          12,
          13,
          14,
          11,
          8,
          5,
          6
        ]), u = s.create([
          8,
          9,
          9,
          11,
          13,
          15,
          15,
          5,
          7,
          7,
          8,
          11,
          14,
          14,
          12,
          6,
          9,
          13,
          15,
          7,
          12,
          8,
          9,
          11,
          7,
          7,
          12,
          7,
          6,
          15,
          13,
          11,
          9,
          7,
          15,
          11,
          8,
          6,
          6,
          14,
          12,
          13,
          5,
          14,
          13,
          13,
          7,
          5,
          15,
          5,
          8,
          11,
          14,
          14,
          6,
          14,
          6,
          9,
          12,
          9,
          12,
          5,
          15,
          8,
          8,
          5,
          12,
          9,
          12,
          5,
          14,
          6,
          8,
          13,
          6,
          5,
          15,
          13,
          11,
          11
        ]), l = s.create([0, 1518500249, 1859775393, 2400959708, 2840853838]), P = s.create([1352829926, 1548603684, 1836072691, 2053994217, 0]), p = f.RIPEMD160 = a.extend({
          _doReset: function() {
            this._hash = s.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
          },
          _doProcessBlock: function(w, m) {
            for (var I = 0; I < 16; I++) {
              var N = m + I, k = w[N];
              w[N] = (k << 8 | k >>> 24) & 16711935 | (k << 24 | k >>> 8) & 4278255360;
            }
            var R = this._hash.words, y = l.words, O = P.words, Y = o.words, ee = d.words, Z = v.words, te = u.words, fe, _, G, L, $, ae, Pe, ge, me, Xe;
            ae = fe = R[0], Pe = _ = R[1], ge = G = R[2], me = L = R[3], Xe = $ = R[4];
            for (var De, I = 0; I < 80; I += 1)
              De = fe + w[m + Y[I]] | 0, I < 16 ? De += c(_, G, L) + y[0] : I < 32 ? De += H(_, G, L) + y[1] : I < 48 ? De += T(_, G, L) + y[2] : I < 64 ? De += q(_, G, L) + y[3] : De += b(_, G, L) + y[4], De = De | 0, De = j(De, Z[I]), De = De + $ | 0, fe = $, $ = L, L = j(G, 10), G = _, _ = De, De = ae + w[m + ee[I]] | 0, I < 16 ? De += b(Pe, ge, me) + O[0] : I < 32 ? De += q(Pe, ge, me) + O[1] : I < 48 ? De += T(Pe, ge, me) + O[2] : I < 64 ? De += H(Pe, ge, me) + O[3] : De += c(Pe, ge, me) + O[4], De = De | 0, De = j(De, te[I]), De = De + Xe | 0, ae = Xe, Xe = me, me = j(ge, 10), ge = Pe, Pe = De;
            De = R[1] + G + me | 0, R[1] = R[2] + L + Xe | 0, R[2] = R[3] + $ + ae | 0, R[3] = R[4] + fe + Pe | 0, R[4] = R[0] + _ + ge | 0, R[0] = De;
          },
          _doFinalize: function() {
            var w = this._data, m = w.words, I = this._nDataBytes * 8, N = w.sigBytes * 8;
            m[N >>> 5] |= 128 << 24 - N % 32, m[(N + 64 >>> 9 << 4) + 14] = (I << 8 | I >>> 24) & 16711935 | (I << 24 | I >>> 8) & 4278255360, w.sigBytes = (m.length + 1) * 4, this._process();
            for (var k = this._hash, R = k.words, y = 0; y < 5; y++) {
              var O = R[y];
              R[y] = (O << 8 | O >>> 24) & 16711935 | (O << 24 | O >>> 8) & 4278255360;
            }
            return k;
          },
          clone: function() {
            var w = a.clone.call(this);
            return w._hash = this._hash.clone(), w;
          }
        });
        function c(w, m, I) {
          return w ^ m ^ I;
        }
        function H(w, m, I) {
          return w & m | ~w & I;
        }
        function T(w, m, I) {
          return (w | ~m) ^ I;
        }
        function q(w, m, I) {
          return w & I | m & ~I;
        }
        function b(w, m, I) {
          return w ^ (m | ~I);
        }
        function j(w, m) {
          return w << m | w >>> 32 - m;
        }
        n.RIPEMD160 = a._createHelper(p), n.HmacRIPEMD160 = a._createHmacHelper(p);
      }(), t.RIPEMD160;
    });
  }(P5)), P5.exports;
}
var c5 = { exports: {} }, j_;
function xM() {
  return j_ || (j_ = 1, function(A, e) {
    (function(t, r) {
      A.exports = r(Ea());
    })(zi, function(t) {
      (function() {
        var r = t, n = r.lib, i = n.Base, s = r.enc, a = s.Utf8, f = r.algo;
        f.HMAC = i.extend({
          /**
           * Initializes a newly created HMAC.
           *
           * @param {Hasher} hasher The hash algorithm to use.
           * @param {WordArray|string} key The secret key.
           *
           * @example
           *
           *     var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
           */
          init: function(o, d) {
            o = this._hasher = new o.init(), typeof d == "string" && (d = a.parse(d));
            var v = o.blockSize, u = v * 4;
            d.sigBytes > u && (d = o.finalize(d)), d.clamp();
            for (var l = this._oKey = d.clone(), P = this._iKey = d.clone(), p = l.words, c = P.words, H = 0; H < v; H++)
              p[H] ^= 1549556828, c[H] ^= 909522486;
            l.sigBytes = P.sigBytes = u, this.reset();
          },
          /**
           * Resets this HMAC to its initial state.
           *
           * @example
           *
           *     hmacHasher.reset();
           */
          reset: function() {
            var o = this._hasher;
            o.reset(), o.update(this._iKey);
          },
          /**
           * Updates this HMAC with a message.
           *
           * @param {WordArray|string} messageUpdate The message to append.
           *
           * @return {HMAC} This HMAC instance.
           *
           * @example
           *
           *     hmacHasher.update('message');
           *     hmacHasher.update(wordArray);
           */
          update: function(o) {
            return this._hasher.update(o), this;
          },
          /**
           * Finalizes the HMAC computation.
           * Note that the finalize operation is effectively a destructive, read-once operation.
           *
           * @param {WordArray|string} messageUpdate (Optional) A final message update.
           *
           * @return {WordArray} The HMAC.
           *
           * @example
           *
           *     var hmac = hmacHasher.finalize();
           *     var hmac = hmacHasher.finalize('message');
           *     var hmac = hmacHasher.finalize(wordArray);
           */
          finalize: function(o) {
            var d = this._hasher, v = d.finalize(o);
            d.reset();
            var u = d.finalize(this._oKey.clone().concat(v));
            return u;
          }
        });
      })();
    });
  }(c5)), c5.exports;
}
var p5 = { exports: {} }, w_;
function zxe() {
  return w_ || (w_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), bM(), xM());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.Base, s = n.WordArray, a = r.algo, f = a.SHA256, o = a.HMAC, d = a.PBKDF2 = i.extend({
          /**
           * Configuration options.
           *
           * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
           * @property {Hasher} hasher The hasher to use. Default: SHA256
           * @property {number} iterations The number of iterations to perform. Default: 250000
           */
          cfg: i.extend({
            keySize: 128 / 32,
            hasher: f,
            iterations: 25e4
          }),
          /**
           * Initializes a newly created key derivation function.
           *
           * @param {Object} cfg (Optional) The configuration options to use for the derivation.
           *
           * @example
           *
           *     var kdf = CryptoJS.algo.PBKDF2.create();
           *     var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
           *     var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
           */
          init: function(v) {
            this.cfg = this.cfg.extend(v);
          },
          /**
           * Computes the Password-Based Key Derivation Function 2.
           *
           * @param {WordArray|string} password The password.
           * @param {WordArray|string} salt A salt.
           *
           * @return {WordArray} The derived key.
           *
           * @example
           *
           *     var key = kdf.compute(password, salt);
           */
          compute: function(v, u) {
            for (var l = this.cfg, P = o.create(l.hasher, v), p = s.create(), c = s.create([1]), H = p.words, T = c.words, q = l.keySize, b = l.iterations; H.length < q; ) {
              var j = P.update(u).finalize(c);
              P.reset();
              for (var w = j.words, m = w.length, I = j, N = 1; N < b; N++) {
                I = P.finalize(I), P.reset();
                for (var k = I.words, R = 0; R < m; R++)
                  w[R] ^= k[R];
              }
              p.concat(j), T[0]++;
            }
            return p.sigBytes = q * 4, p;
          }
        });
        r.PBKDF2 = function(v, u, l) {
          return d.create(l).compute(v, u);
        };
      }(), t.PBKDF2;
    });
  }(p5)), p5.exports;
}
var h5 = { exports: {} }, m_;
function UD() {
  return m_ || (m_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), t9e(), xM());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.Base, s = n.WordArray, a = r.algo, f = a.MD5, o = a.EvpKDF = i.extend({
          /**
           * Configuration options.
           *
           * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
           * @property {Hasher} hasher The hash algorithm to use. Default: MD5
           * @property {number} iterations The number of iterations to perform. Default: 1
           */
          cfg: i.extend({
            keySize: 128 / 32,
            hasher: f,
            iterations: 1
          }),
          /**
           * Initializes a newly created key derivation function.
           *
           * @param {Object} cfg (Optional) The configuration options to use for the derivation.
           *
           * @example
           *
           *     var kdf = CryptoJS.algo.EvpKDF.create();
           *     var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
           *     var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
           */
          init: function(d) {
            this.cfg = this.cfg.extend(d);
          },
          /**
           * Derives a key from a password.
           *
           * @param {WordArray|string} password The password.
           * @param {WordArray|string} salt A salt.
           *
           * @return {WordArray} The derived key.
           *
           * @example
           *
           *     var key = kdf.compute(password, salt);
           */
          compute: function(d, v) {
            for (var u, l = this.cfg, P = l.hasher.create(), p = s.create(), c = p.words, H = l.keySize, T = l.iterations; c.length < H; ) {
              u && P.update(u), u = P.update(d).finalize(v), P.reset();
              for (var q = 1; q < T; q++)
                u = P.finalize(u), P.reset();
              p.concat(u);
            }
            return p.sigBytes = H * 4, p;
          }
        });
        r.EvpKDF = function(d, v, u) {
          return o.create(u).compute(d, v);
        };
      }(), t.EvpKDF;
    });
  }(h5)), h5.exports;
}
var H5 = { exports: {} }, B_;
function Gd() {
  return B_ || (B_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), UD());
    })(zi, function(t) {
      t.lib.Cipher || function(r) {
        var n = t, i = n.lib, s = i.Base, a = i.WordArray, f = i.BufferedBlockAlgorithm, o = n.enc;
        o.Utf8;
        var d = o.Base64, v = n.algo, u = v.EvpKDF, l = i.Cipher = f.extend({
          /**
           * Configuration options.
           *
           * @property {WordArray} iv The IV to use for this operation.
           */
          cfg: s.extend(),
          /**
           * Creates this cipher in encryption mode.
           *
           * @param {WordArray} key The key.
           * @param {Object} cfg (Optional) The configuration options to use for this operation.
           *
           * @return {Cipher} A cipher instance.
           *
           * @static
           *
           * @example
           *
           *     var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
           */
          createEncryptor: function(k, R) {
            return this.create(this._ENC_XFORM_MODE, k, R);
          },
          /**
           * Creates this cipher in decryption mode.
           *
           * @param {WordArray} key The key.
           * @param {Object} cfg (Optional) The configuration options to use for this operation.
           *
           * @return {Cipher} A cipher instance.
           *
           * @static
           *
           * @example
           *
           *     var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
           */
          createDecryptor: function(k, R) {
            return this.create(this._DEC_XFORM_MODE, k, R);
          },
          /**
           * Initializes a newly created cipher.
           *
           * @param {number} xformMode Either the encryption or decryption transormation mode constant.
           * @param {WordArray} key The key.
           * @param {Object} cfg (Optional) The configuration options to use for this operation.
           *
           * @example
           *
           *     var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
           */
          init: function(k, R, y) {
            this.cfg = this.cfg.extend(y), this._xformMode = k, this._key = R, this.reset();
          },
          /**
           * Resets this cipher to its initial state.
           *
           * @example
           *
           *     cipher.reset();
           */
          reset: function() {
            f.reset.call(this), this._doReset();
          },
          /**
           * Adds data to be encrypted or decrypted.
           *
           * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
           *
           * @return {WordArray} The data after processing.
           *
           * @example
           *
           *     var encrypted = cipher.process('data');
           *     var encrypted = cipher.process(wordArray);
           */
          process: function(k) {
            return this._append(k), this._process();
          },
          /**
           * Finalizes the encryption or decryption process.
           * Note that the finalize operation is effectively a destructive, read-once operation.
           *
           * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
           *
           * @return {WordArray} The data after final processing.
           *
           * @example
           *
           *     var encrypted = cipher.finalize();
           *     var encrypted = cipher.finalize('data');
           *     var encrypted = cipher.finalize(wordArray);
           */
          finalize: function(k) {
            k && this._append(k);
            var R = this._doFinalize();
            return R;
          },
          keySize: 128 / 32,
          ivSize: 128 / 32,
          _ENC_XFORM_MODE: 1,
          _DEC_XFORM_MODE: 2,
          /**
           * Creates shortcut functions to a cipher's object interface.
           *
           * @param {Cipher} cipher The cipher to create a helper for.
           *
           * @return {Object} An object with encrypt and decrypt shortcut functions.
           *
           * @static
           *
           * @example
           *
           *     var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
           */
          _createHelper: /* @__PURE__ */ function() {
            function k(R) {
              return typeof R == "string" ? N : w;
            }
            return function(R) {
              return {
                encrypt: function(y, O, Y) {
                  return k(O).encrypt(R, y, O, Y);
                },
                decrypt: function(y, O, Y) {
                  return k(O).decrypt(R, y, O, Y);
                }
              };
            };
          }()
        });
        i.StreamCipher = l.extend({
          _doFinalize: function() {
            var k = this._process(!0);
            return k;
          },
          blockSize: 1
        });
        var P = n.mode = {}, p = i.BlockCipherMode = s.extend({
          /**
           * Creates this mode for encryption.
           *
           * @param {Cipher} cipher A block cipher instance.
           * @param {Array} iv The IV words.
           *
           * @static
           *
           * @example
           *
           *     var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
           */
          createEncryptor: function(k, R) {
            return this.Encryptor.create(k, R);
          },
          /**
           * Creates this mode for decryption.
           *
           * @param {Cipher} cipher A block cipher instance.
           * @param {Array} iv The IV words.
           *
           * @static
           *
           * @example
           *
           *     var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
           */
          createDecryptor: function(k, R) {
            return this.Decryptor.create(k, R);
          },
          /**
           * Initializes a newly created mode.
           *
           * @param {Cipher} cipher A block cipher instance.
           * @param {Array} iv The IV words.
           *
           * @example
           *
           *     var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
           */
          init: function(k, R) {
            this._cipher = k, this._iv = R;
          }
        }), c = P.CBC = function() {
          var k = p.extend();
          k.Encryptor = k.extend({
            /**
             * Processes the data block at offset.
             *
             * @param {Array} words The data words to operate on.
             * @param {number} offset The offset where the block starts.
             *
             * @example
             *
             *     mode.processBlock(data.words, offset);
             */
            processBlock: function(y, O) {
              var Y = this._cipher, ee = Y.blockSize;
              R.call(this, y, O, ee), Y.encryptBlock(y, O), this._prevBlock = y.slice(O, O + ee);
            }
          }), k.Decryptor = k.extend({
            /**
             * Processes the data block at offset.
             *
             * @param {Array} words The data words to operate on.
             * @param {number} offset The offset where the block starts.
             *
             * @example
             *
             *     mode.processBlock(data.words, offset);
             */
            processBlock: function(y, O) {
              var Y = this._cipher, ee = Y.blockSize, Z = y.slice(O, O + ee);
              Y.decryptBlock(y, O), R.call(this, y, O, ee), this._prevBlock = Z;
            }
          });
          function R(y, O, Y) {
            var ee, Z = this._iv;
            Z ? (ee = Z, this._iv = r) : ee = this._prevBlock;
            for (var te = 0; te < Y; te++)
              y[O + te] ^= ee[te];
          }
          return k;
        }(), H = n.pad = {}, T = H.Pkcs7 = {
          /**
           * Pads data using the algorithm defined in PKCS #5/7.
           *
           * @param {WordArray} data The data to pad.
           * @param {number} blockSize The multiple that the data should be padded to.
           *
           * @static
           *
           * @example
           *
           *     CryptoJS.pad.Pkcs7.pad(wordArray, 4);
           */
          pad: function(k, R) {
            for (var y = R * 4, O = y - k.sigBytes % y, Y = O << 24 | O << 16 | O << 8 | O, ee = [], Z = 0; Z < O; Z += 4)
              ee.push(Y);
            var te = a.create(ee, O);
            k.concat(te);
          },
          /**
           * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
           *
           * @param {WordArray} data The data to unpad.
           *
           * @static
           *
           * @example
           *
           *     CryptoJS.pad.Pkcs7.unpad(wordArray);
           */
          unpad: function(k) {
            var R = k.words[k.sigBytes - 1 >>> 2] & 255;
            k.sigBytes -= R;
          }
        };
        i.BlockCipher = l.extend({
          /**
           * Configuration options.
           *
           * @property {Mode} mode The block mode to use. Default: CBC
           * @property {Padding} padding The padding strategy to use. Default: Pkcs7
           */
          cfg: l.cfg.extend({
            mode: c,
            padding: T
          }),
          reset: function() {
            var k;
            l.reset.call(this);
            var R = this.cfg, y = R.iv, O = R.mode;
            this._xformMode == this._ENC_XFORM_MODE ? k = O.createEncryptor : (k = O.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == k ? this._mode.init(this, y && y.words) : (this._mode = k.call(O, this, y && y.words), this._mode.__creator = k);
          },
          _doProcessBlock: function(k, R) {
            this._mode.processBlock(k, R);
          },
          _doFinalize: function() {
            var k, R = this.cfg.padding;
            return this._xformMode == this._ENC_XFORM_MODE ? (R.pad(this._data, this.blockSize), k = this._process(!0)) : (k = this._process(!0), R.unpad(k)), k;
          },
          blockSize: 128 / 32
        });
        var q = i.CipherParams = s.extend({
          /**
           * Initializes a newly created cipher params object.
           *
           * @param {Object} cipherParams An object with any of the possible cipher parameters.
           *
           * @example
           *
           *     var cipherParams = CryptoJS.lib.CipherParams.create({
           *         ciphertext: ciphertextWordArray,
           *         key: keyWordArray,
           *         iv: ivWordArray,
           *         salt: saltWordArray,
           *         algorithm: CryptoJS.algo.AES,
           *         mode: CryptoJS.mode.CBC,
           *         padding: CryptoJS.pad.PKCS7,
           *         blockSize: 4,
           *         formatter: CryptoJS.format.OpenSSL
           *     });
           */
          init: function(k) {
            this.mixIn(k);
          },
          /**
           * Converts this cipher params object to a string.
           *
           * @param {Format} formatter (Optional) The formatting strategy to use.
           *
           * @return {string} The stringified cipher params.
           *
           * @throws Error If neither the formatter nor the default formatter is set.
           *
           * @example
           *
           *     var string = cipherParams + '';
           *     var string = cipherParams.toString();
           *     var string = cipherParams.toString(CryptoJS.format.OpenSSL);
           */
          toString: function(k) {
            return (k || this.formatter).stringify(this);
          }
        }), b = n.format = {}, j = b.OpenSSL = {
          /**
           * Converts a cipher params object to an OpenSSL-compatible string.
           *
           * @param {CipherParams} cipherParams The cipher params object.
           *
           * @return {string} The OpenSSL-compatible string.
           *
           * @static
           *
           * @example
           *
           *     var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
           */
          stringify: function(k) {
            var R, y = k.ciphertext, O = k.salt;
            return O ? R = a.create([1398893684, 1701076831]).concat(O).concat(y) : R = y, R.toString(d);
          },
          /**
           * Converts an OpenSSL-compatible string to a cipher params object.
           *
           * @param {string} openSSLStr The OpenSSL-compatible string.
           *
           * @return {CipherParams} The cipher params object.
           *
           * @static
           *
           * @example
           *
           *     var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
           */
          parse: function(k) {
            var R, y = d.parse(k), O = y.words;
            return O[0] == 1398893684 && O[1] == 1701076831 && (R = a.create(O.slice(2, 4)), O.splice(0, 4), y.sigBytes -= 16), q.create({ ciphertext: y, salt: R });
          }
        }, w = i.SerializableCipher = s.extend({
          /**
           * Configuration options.
           *
           * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
           */
          cfg: s.extend({
            format: j
          }),
          /**
           * Encrypts a message.
           *
           * @param {Cipher} cipher The cipher algorithm to use.
           * @param {WordArray|string} message The message to encrypt.
           * @param {WordArray} key The key.
           * @param {Object} cfg (Optional) The configuration options to use for this operation.
           *
           * @return {CipherParams} A cipher params object.
           *
           * @static
           *
           * @example
           *
           *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
           *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
           *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
           */
          encrypt: function(k, R, y, O) {
            O = this.cfg.extend(O);
            var Y = k.createEncryptor(y, O), ee = Y.finalize(R), Z = Y.cfg;
            return q.create({
              ciphertext: ee,
              key: y,
              iv: Z.iv,
              algorithm: k,
              mode: Z.mode,
              padding: Z.padding,
              blockSize: k.blockSize,
              formatter: O.format
            });
          },
          /**
           * Decrypts serialized ciphertext.
           *
           * @param {Cipher} cipher The cipher algorithm to use.
           * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
           * @param {WordArray} key The key.
           * @param {Object} cfg (Optional) The configuration options to use for this operation.
           *
           * @return {WordArray} The plaintext.
           *
           * @static
           *
           * @example
           *
           *     var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
           *     var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
           */
          decrypt: function(k, R, y, O) {
            O = this.cfg.extend(O), R = this._parse(R, O.format);
            var Y = k.createDecryptor(y, O).finalize(R.ciphertext);
            return Y;
          },
          /**
           * Converts serialized ciphertext to CipherParams,
           * else assumed CipherParams already and returns ciphertext unchanged.
           *
           * @param {CipherParams|string} ciphertext The ciphertext.
           * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
           *
           * @return {CipherParams} The unserialized ciphertext.
           *
           * @static
           *
           * @example
           *
           *     var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
           */
          _parse: function(k, R) {
            return typeof k == "string" ? R.parse(k, this) : k;
          }
        }), m = n.kdf = {}, I = m.OpenSSL = {
          /**
           * Derives a key and IV from a password.
           *
           * @param {string} password The password to derive from.
           * @param {number} keySize The size in words of the key to generate.
           * @param {number} ivSize The size in words of the IV to generate.
           * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
           *
           * @return {CipherParams} A cipher params object with the key, IV, and salt.
           *
           * @static
           *
           * @example
           *
           *     var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
           *     var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
           */
          execute: function(k, R, y, O, Y) {
            if (O || (O = a.random(64 / 8)), Y)
              var ee = u.create({ keySize: R + y, hasher: Y }).compute(k, O);
            else
              var ee = u.create({ keySize: R + y }).compute(k, O);
            var Z = a.create(ee.words.slice(R), y * 4);
            return ee.sigBytes = R * 4, q.create({ key: ee, iv: Z, salt: O });
          }
        }, N = i.PasswordBasedCipher = w.extend({
          /**
           * Configuration options.
           *
           * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
           */
          cfg: w.cfg.extend({
            kdf: I
          }),
          /**
           * Encrypts a message using a password.
           *
           * @param {Cipher} cipher The cipher algorithm to use.
           * @param {WordArray|string} message The message to encrypt.
           * @param {string} password The password.
           * @param {Object} cfg (Optional) The configuration options to use for this operation.
           *
           * @return {CipherParams} A cipher params object.
           *
           * @static
           *
           * @example
           *
           *     var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
           *     var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
           */
          encrypt: function(k, R, y, O) {
            O = this.cfg.extend(O);
            var Y = O.kdf.execute(y, k.keySize, k.ivSize, O.salt, O.hasher);
            O.iv = Y.iv;
            var ee = w.encrypt.call(this, k, R, Y.key, O);
            return ee.mixIn(Y), ee;
          },
          /**
           * Decrypts serialized ciphertext using a password.
           *
           * @param {Cipher} cipher The cipher algorithm to use.
           * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
           * @param {string} password The password.
           * @param {Object} cfg (Optional) The configuration options to use for this operation.
           *
           * @return {WordArray} The plaintext.
           *
           * @static
           *
           * @example
           *
           *     var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
           *     var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
           */
          decrypt: function(k, R, y, O) {
            O = this.cfg.extend(O), R = this._parse(R, O.format);
            var Y = O.kdf.execute(y, k.keySize, k.ivSize, R.salt, O.hasher);
            O.iv = Y.iv;
            var ee = w.decrypt.call(this, k, R, Y.key, O);
            return ee;
          }
        });
      }();
    });
  }(H5)), H5.exports;
}
var g5 = { exports: {} }, W_;
function Gxe() {
  return W_ || (W_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      return t.mode.CFB = function() {
        var r = t.lib.BlockCipherMode.extend();
        r.Encryptor = r.extend({
          processBlock: function(i, s) {
            var a = this._cipher, f = a.blockSize;
            n.call(this, i, s, f, a), this._prevBlock = i.slice(s, s + f);
          }
        }), r.Decryptor = r.extend({
          processBlock: function(i, s) {
            var a = this._cipher, f = a.blockSize, o = i.slice(s, s + f);
            n.call(this, i, s, f, a), this._prevBlock = o;
          }
        });
        function n(i, s, a, f) {
          var o, d = this._iv;
          d ? (o = d.slice(0), this._iv = void 0) : o = this._prevBlock, f.encryptBlock(o, 0);
          for (var v = 0; v < a; v++)
            i[s + v] ^= o[v];
        }
        return r;
      }(), t.mode.CFB;
    });
  }(g5)), g5.exports;
}
var X5 = { exports: {} }, S_;
function Zxe() {
  return S_ || (S_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      return t.mode.CTR = function() {
        var r = t.lib.BlockCipherMode.extend(), n = r.Encryptor = r.extend({
          processBlock: function(i, s) {
            var a = this._cipher, f = a.blockSize, o = this._iv, d = this._counter;
            o && (d = this._counter = o.slice(0), this._iv = void 0);
            var v = d.slice(0);
            a.encryptBlock(v, 0), d[f - 1] = d[f - 1] + 1 | 0;
            for (var u = 0; u < f; u++)
              i[s + u] ^= v[u];
          }
        });
        return r.Decryptor = n, r;
      }(), t.mode.CTR;
    });
  }(X5)), X5.exports;
}
var T5 = { exports: {} }, U_;
function _xe() {
  return U_ || (U_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      /** @preserve
       * Counter block mode compatible with  Dr Brian Gladman fileenc.c
       * derived from CryptoJS.mode.CTR
       * Jan Hruby jhruby.web@gmail.com
       */
      return t.mode.CTRGladman = function() {
        var r = t.lib.BlockCipherMode.extend();
        function n(a) {
          if ((a >> 24 & 255) === 255) {
            var f = a >> 16 & 255, o = a >> 8 & 255, d = a & 255;
            f === 255 ? (f = 0, o === 255 ? (o = 0, d === 255 ? d = 0 : ++d) : ++o) : ++f, a = 0, a += f << 16, a += o << 8, a += d;
          } else
            a += 1 << 24;
          return a;
        }
        function i(a) {
          return (a[0] = n(a[0])) === 0 && (a[1] = n(a[1])), a;
        }
        var s = r.Encryptor = r.extend({
          processBlock: function(a, f) {
            var o = this._cipher, d = o.blockSize, v = this._iv, u = this._counter;
            v && (u = this._counter = v.slice(0), this._iv = void 0), i(u);
            var l = u.slice(0);
            o.encryptBlock(l, 0);
            for (var P = 0; P < d; P++)
              a[f + P] ^= l[P];
          }
        });
        return r.Decryptor = s, r;
      }(), t.mode.CTRGladman;
    });
  }(T5)), T5.exports;
}
var q5 = { exports: {} }, I_;
function $xe() {
  return I_ || (I_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      return t.mode.OFB = function() {
        var r = t.lib.BlockCipherMode.extend(), n = r.Encryptor = r.extend({
          processBlock: function(i, s) {
            var a = this._cipher, f = a.blockSize, o = this._iv, d = this._keystream;
            o && (d = this._keystream = o.slice(0), this._iv = void 0), a.encryptBlock(d, 0);
            for (var v = 0; v < f; v++)
              i[s + v] ^= d[v];
          }
        });
        return r.Decryptor = n, r;
      }(), t.mode.OFB;
    });
  }(q5)), q5.exports;
}
var b5 = { exports: {} }, R_;
function eDe() {
  return R_ || (R_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      return t.mode.ECB = function() {
        var r = t.lib.BlockCipherMode.extend();
        return r.Encryptor = r.extend({
          processBlock: function(n, i) {
            this._cipher.encryptBlock(n, i);
          }
        }), r.Decryptor = r.extend({
          processBlock: function(n, i) {
            this._cipher.decryptBlock(n, i);
          }
        }), r;
      }(), t.mode.ECB;
    });
  }(b5)), b5.exports;
}
var x5 = { exports: {} }, V_;
function tDe() {
  return V_ || (V_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      return t.pad.AnsiX923 = {
        pad: function(r, n) {
          var i = r.sigBytes, s = n * 4, a = s - i % s, f = i + a - 1;
          r.clamp(), r.words[f >>> 2] |= a << 24 - f % 4 * 8, r.sigBytes += a;
        },
        unpad: function(r) {
          var n = r.words[r.sigBytes - 1 >>> 2] & 255;
          r.sigBytes -= n;
        }
      }, t.pad.Ansix923;
    });
  }(x5)), x5.exports;
}
var D5 = { exports: {} }, C_;
function rDe() {
  return C_ || (C_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      return t.pad.Iso10126 = {
        pad: function(r, n) {
          var i = n * 4, s = i - r.sigBytes % i;
          r.concat(t.lib.WordArray.random(s - 1)).concat(t.lib.WordArray.create([s << 24], 1));
        },
        unpad: function(r) {
          var n = r.words[r.sigBytes - 1 >>> 2] & 255;
          r.sigBytes -= n;
        }
      }, t.pad.Iso10126;
    });
  }(D5)), D5.exports;
}
var j5 = { exports: {} }, O_;
function nDe() {
  return O_ || (O_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      return t.pad.Iso97971 = {
        pad: function(r, n) {
          r.concat(t.lib.WordArray.create([2147483648], 1)), t.pad.ZeroPadding.pad(r, n);
        },
        unpad: function(r) {
          t.pad.ZeroPadding.unpad(r), r.sigBytes--;
        }
      }, t.pad.Iso97971;
    });
  }(j5)), j5.exports;
}
var w5 = { exports: {} }, y_;
function iDe() {
  return y_ || (y_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      return t.pad.ZeroPadding = {
        pad: function(r, n) {
          var i = n * 4;
          r.clamp(), r.sigBytes += i - (r.sigBytes % i || i);
        },
        unpad: function(r) {
          for (var n = r.words, i = r.sigBytes - 1, i = r.sigBytes - 1; i >= 0; i--)
            if (n[i >>> 2] >>> 24 - i % 4 * 8 & 255) {
              r.sigBytes = i + 1;
              break;
            }
        }
      }, t.pad.ZeroPadding;
    });
  }(w5)), w5.exports;
}
var m5 = { exports: {} }, k_;
function sDe() {
  return k_ || (k_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      return t.pad.NoPadding = {
        pad: function() {
        },
        unpad: function() {
        }
      }, t.pad.NoPadding;
    });
  }(m5)), m5.exports;
}
var B5 = { exports: {} }, E_;
function aDe() {
  return E_ || (E_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Gd());
    })(zi, function(t) {
      return function(r) {
        var n = t, i = n.lib, s = i.CipherParams, a = n.enc, f = a.Hex, o = n.format;
        o.Hex = {
          /**
           * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
           *
           * @param {CipherParams} cipherParams The cipher params object.
           *
           * @return {string} The hexadecimally encoded string.
           *
           * @static
           *
           * @example
           *
           *     var hexString = CryptoJS.format.Hex.stringify(cipherParams);
           */
          stringify: function(d) {
            return d.ciphertext.toString(f);
          },
          /**
           * Converts a hexadecimally encoded ciphertext string to a cipher params object.
           *
           * @param {string} input The hexadecimally encoded string.
           *
           * @return {CipherParams} The cipher params object.
           *
           * @static
           *
           * @example
           *
           *     var cipherParams = CryptoJS.format.Hex.parse(hexString);
           */
          parse: function(d) {
            var v = f.parse(d);
            return s.create({ ciphertext: v });
          }
        };
      }(), t.format.Hex;
    });
  }(B5)), B5.exports;
}
var W5 = { exports: {} }, F_;
function oDe() {
  return F_ || (F_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Ym(), Mm(), UD(), Gd());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.BlockCipher, s = r.algo, a = [], f = [], o = [], d = [], v = [], u = [], l = [], P = [], p = [], c = [];
        (function() {
          for (var q = [], b = 0; b < 256; b++)
            b < 128 ? q[b] = b << 1 : q[b] = b << 1 ^ 283;
          for (var j = 0, w = 0, b = 0; b < 256; b++) {
            var m = w ^ w << 1 ^ w << 2 ^ w << 3 ^ w << 4;
            m = m >>> 8 ^ m & 255 ^ 99, a[j] = m, f[m] = j;
            var I = q[j], N = q[I], k = q[N], R = q[m] * 257 ^ m * 16843008;
            o[j] = R << 24 | R >>> 8, d[j] = R << 16 | R >>> 16, v[j] = R << 8 | R >>> 24, u[j] = R;
            var R = k * 16843009 ^ N * 65537 ^ I * 257 ^ j * 16843008;
            l[m] = R << 24 | R >>> 8, P[m] = R << 16 | R >>> 16, p[m] = R << 8 | R >>> 24, c[m] = R, j ? (j = I ^ q[q[q[k ^ I]]], w ^= q[q[w]]) : j = w = 1;
          }
        })();
        var H = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], T = s.AES = i.extend({
          _doReset: function() {
            var q;
            if (!(this._nRounds && this._keyPriorReset === this._key)) {
              for (var b = this._keyPriorReset = this._key, j = b.words, w = b.sigBytes / 4, m = this._nRounds = w + 6, I = (m + 1) * 4, N = this._keySchedule = [], k = 0; k < I; k++)
                k < w ? N[k] = j[k] : (q = N[k - 1], k % w ? w > 6 && k % w == 4 && (q = a[q >>> 24] << 24 | a[q >>> 16 & 255] << 16 | a[q >>> 8 & 255] << 8 | a[q & 255]) : (q = q << 8 | q >>> 24, q = a[q >>> 24] << 24 | a[q >>> 16 & 255] << 16 | a[q >>> 8 & 255] << 8 | a[q & 255], q ^= H[k / w | 0] << 24), N[k] = N[k - w] ^ q);
              for (var R = this._invKeySchedule = [], y = 0; y < I; y++) {
                var k = I - y;
                if (y % 4)
                  var q = N[k];
                else
                  var q = N[k - 4];
                y < 4 || k <= 4 ? R[y] = q : R[y] = l[a[q >>> 24]] ^ P[a[q >>> 16 & 255]] ^ p[a[q >>> 8 & 255]] ^ c[a[q & 255]];
              }
            }
          },
          encryptBlock: function(q, b) {
            this._doCryptBlock(q, b, this._keySchedule, o, d, v, u, a);
          },
          decryptBlock: function(q, b) {
            var j = q[b + 1];
            q[b + 1] = q[b + 3], q[b + 3] = j, this._doCryptBlock(q, b, this._invKeySchedule, l, P, p, c, f);
            var j = q[b + 1];
            q[b + 1] = q[b + 3], q[b + 3] = j;
          },
          _doCryptBlock: function(q, b, j, w, m, I, N, k) {
            for (var R = this._nRounds, y = q[b] ^ j[0], O = q[b + 1] ^ j[1], Y = q[b + 2] ^ j[2], ee = q[b + 3] ^ j[3], Z = 4, te = 1; te < R; te++) {
              var fe = w[y >>> 24] ^ m[O >>> 16 & 255] ^ I[Y >>> 8 & 255] ^ N[ee & 255] ^ j[Z++], _ = w[O >>> 24] ^ m[Y >>> 16 & 255] ^ I[ee >>> 8 & 255] ^ N[y & 255] ^ j[Z++], G = w[Y >>> 24] ^ m[ee >>> 16 & 255] ^ I[y >>> 8 & 255] ^ N[O & 255] ^ j[Z++], L = w[ee >>> 24] ^ m[y >>> 16 & 255] ^ I[O >>> 8 & 255] ^ N[Y & 255] ^ j[Z++];
              y = fe, O = _, Y = G, ee = L;
            }
            var fe = (k[y >>> 24] << 24 | k[O >>> 16 & 255] << 16 | k[Y >>> 8 & 255] << 8 | k[ee & 255]) ^ j[Z++], _ = (k[O >>> 24] << 24 | k[Y >>> 16 & 255] << 16 | k[ee >>> 8 & 255] << 8 | k[y & 255]) ^ j[Z++], G = (k[Y >>> 24] << 24 | k[ee >>> 16 & 255] << 16 | k[y >>> 8 & 255] << 8 | k[O & 255]) ^ j[Z++], L = (k[ee >>> 24] << 24 | k[y >>> 16 & 255] << 16 | k[O >>> 8 & 255] << 8 | k[Y & 255]) ^ j[Z++];
            q[b] = fe, q[b + 1] = _, q[b + 2] = G, q[b + 3] = L;
          },
          keySize: 256 / 32
        });
        r.AES = i._createHelper(T);
      }(), t.AES;
    });
  }(W5)), W5.exports;
}
var S5 = { exports: {} }, N_;
function fDe() {
  return N_ || (N_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Ym(), Mm(), UD(), Gd());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.WordArray, s = n.BlockCipher, a = r.algo, f = [
          57,
          49,
          41,
          33,
          25,
          17,
          9,
          1,
          58,
          50,
          42,
          34,
          26,
          18,
          10,
          2,
          59,
          51,
          43,
          35,
          27,
          19,
          11,
          3,
          60,
          52,
          44,
          36,
          63,
          55,
          47,
          39,
          31,
          23,
          15,
          7,
          62,
          54,
          46,
          38,
          30,
          22,
          14,
          6,
          61,
          53,
          45,
          37,
          29,
          21,
          13,
          5,
          28,
          20,
          12,
          4
        ], o = [
          14,
          17,
          11,
          24,
          1,
          5,
          3,
          28,
          15,
          6,
          21,
          10,
          23,
          19,
          12,
          4,
          26,
          8,
          16,
          7,
          27,
          20,
          13,
          2,
          41,
          52,
          31,
          37,
          47,
          55,
          30,
          40,
          51,
          45,
          33,
          48,
          44,
          49,
          39,
          56,
          34,
          53,
          46,
          42,
          50,
          36,
          29,
          32
        ], d = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28], v = [
          {
            0: 8421888,
            268435456: 32768,
            536870912: 8421378,
            805306368: 2,
            1073741824: 512,
            1342177280: 8421890,
            1610612736: 8389122,
            1879048192: 8388608,
            2147483648: 514,
            2415919104: 8389120,
            2684354560: 33280,
            2952790016: 8421376,
            3221225472: 32770,
            3489660928: 8388610,
            3758096384: 0,
            4026531840: 33282,
            134217728: 0,
            402653184: 8421890,
            671088640: 33282,
            939524096: 32768,
            1207959552: 8421888,
            1476395008: 512,
            1744830464: 8421378,
            2013265920: 2,
            2281701376: 8389120,
            2550136832: 33280,
            2818572288: 8421376,
            3087007744: 8389122,
            3355443200: 8388610,
            3623878656: 32770,
            3892314112: 514,
            4160749568: 8388608,
            1: 32768,
            268435457: 2,
            536870913: 8421888,
            805306369: 8388608,
            1073741825: 8421378,
            1342177281: 33280,
            1610612737: 512,
            1879048193: 8389122,
            2147483649: 8421890,
            2415919105: 8421376,
            2684354561: 8388610,
            2952790017: 33282,
            3221225473: 514,
            3489660929: 8389120,
            3758096385: 32770,
            4026531841: 0,
            134217729: 8421890,
            402653185: 8421376,
            671088641: 8388608,
            939524097: 512,
            1207959553: 32768,
            1476395009: 8388610,
            1744830465: 2,
            2013265921: 33282,
            2281701377: 32770,
            2550136833: 8389122,
            2818572289: 514,
            3087007745: 8421888,
            3355443201: 8389120,
            3623878657: 0,
            3892314113: 33280,
            4160749569: 8421378
          },
          {
            0: 1074282512,
            16777216: 16384,
            33554432: 524288,
            50331648: 1074266128,
            67108864: 1073741840,
            83886080: 1074282496,
            100663296: 1073758208,
            117440512: 16,
            134217728: 540672,
            150994944: 1073758224,
            167772160: 1073741824,
            184549376: 540688,
            201326592: 524304,
            218103808: 0,
            234881024: 16400,
            251658240: 1074266112,
            8388608: 1073758208,
            25165824: 540688,
            41943040: 16,
            58720256: 1073758224,
            75497472: 1074282512,
            92274688: 1073741824,
            109051904: 524288,
            125829120: 1074266128,
            142606336: 524304,
            159383552: 0,
            176160768: 16384,
            192937984: 1074266112,
            209715200: 1073741840,
            226492416: 540672,
            243269632: 1074282496,
            260046848: 16400,
            268435456: 0,
            285212672: 1074266128,
            301989888: 1073758224,
            318767104: 1074282496,
            335544320: 1074266112,
            352321536: 16,
            369098752: 540688,
            385875968: 16384,
            402653184: 16400,
            419430400: 524288,
            436207616: 524304,
            452984832: 1073741840,
            469762048: 540672,
            486539264: 1073758208,
            503316480: 1073741824,
            520093696: 1074282512,
            276824064: 540688,
            293601280: 524288,
            310378496: 1074266112,
            327155712: 16384,
            343932928: 1073758208,
            360710144: 1074282512,
            377487360: 16,
            394264576: 1073741824,
            411041792: 1074282496,
            427819008: 1073741840,
            444596224: 1073758224,
            461373440: 524304,
            478150656: 0,
            494927872: 16400,
            511705088: 1074266128,
            528482304: 540672
          },
          {
            0: 260,
            1048576: 0,
            2097152: 67109120,
            3145728: 65796,
            4194304: 65540,
            5242880: 67108868,
            6291456: 67174660,
            7340032: 67174400,
            8388608: 67108864,
            9437184: 67174656,
            10485760: 65792,
            11534336: 67174404,
            12582912: 67109124,
            13631488: 65536,
            14680064: 4,
            15728640: 256,
            524288: 67174656,
            1572864: 67174404,
            2621440: 0,
            3670016: 67109120,
            4718592: 67108868,
            5767168: 65536,
            6815744: 65540,
            7864320: 260,
            8912896: 4,
            9961472: 256,
            11010048: 67174400,
            12058624: 65796,
            13107200: 65792,
            14155776: 67109124,
            15204352: 67174660,
            16252928: 67108864,
            16777216: 67174656,
            17825792: 65540,
            18874368: 65536,
            19922944: 67109120,
            20971520: 256,
            22020096: 67174660,
            23068672: 67108868,
            24117248: 0,
            25165824: 67109124,
            26214400: 67108864,
            27262976: 4,
            28311552: 65792,
            29360128: 67174400,
            30408704: 260,
            31457280: 65796,
            32505856: 67174404,
            17301504: 67108864,
            18350080: 260,
            19398656: 67174656,
            20447232: 0,
            21495808: 65540,
            22544384: 67109120,
            23592960: 256,
            24641536: 67174404,
            25690112: 65536,
            26738688: 67174660,
            27787264: 65796,
            28835840: 67108868,
            29884416: 67109124,
            30932992: 67174400,
            31981568: 4,
            33030144: 65792
          },
          {
            0: 2151682048,
            65536: 2147487808,
            131072: 4198464,
            196608: 2151677952,
            262144: 0,
            327680: 4198400,
            393216: 2147483712,
            458752: 4194368,
            524288: 2147483648,
            589824: 4194304,
            655360: 64,
            720896: 2147487744,
            786432: 2151678016,
            851968: 4160,
            917504: 4096,
            983040: 2151682112,
            32768: 2147487808,
            98304: 64,
            163840: 2151678016,
            229376: 2147487744,
            294912: 4198400,
            360448: 2151682112,
            425984: 0,
            491520: 2151677952,
            557056: 4096,
            622592: 2151682048,
            688128: 4194304,
            753664: 4160,
            819200: 2147483648,
            884736: 4194368,
            950272: 4198464,
            1015808: 2147483712,
            1048576: 4194368,
            1114112: 4198400,
            1179648: 2147483712,
            1245184: 0,
            1310720: 4160,
            1376256: 2151678016,
            1441792: 2151682048,
            1507328: 2147487808,
            1572864: 2151682112,
            1638400: 2147483648,
            1703936: 2151677952,
            1769472: 4198464,
            1835008: 2147487744,
            1900544: 4194304,
            1966080: 64,
            2031616: 4096,
            1081344: 2151677952,
            1146880: 2151682112,
            1212416: 0,
            1277952: 4198400,
            1343488: 4194368,
            1409024: 2147483648,
            1474560: 2147487808,
            1540096: 64,
            1605632: 2147483712,
            1671168: 4096,
            1736704: 2147487744,
            1802240: 2151678016,
            1867776: 4160,
            1933312: 2151682048,
            1998848: 4194304,
            2064384: 4198464
          },
          {
            0: 128,
            4096: 17039360,
            8192: 262144,
            12288: 536870912,
            16384: 537133184,
            20480: 16777344,
            24576: 553648256,
            28672: 262272,
            32768: 16777216,
            36864: 537133056,
            40960: 536871040,
            45056: 553910400,
            49152: 553910272,
            53248: 0,
            57344: 17039488,
            61440: 553648128,
            2048: 17039488,
            6144: 553648256,
            10240: 128,
            14336: 17039360,
            18432: 262144,
            22528: 537133184,
            26624: 553910272,
            30720: 536870912,
            34816: 537133056,
            38912: 0,
            43008: 553910400,
            47104: 16777344,
            51200: 536871040,
            55296: 553648128,
            59392: 16777216,
            63488: 262272,
            65536: 262144,
            69632: 128,
            73728: 536870912,
            77824: 553648256,
            81920: 16777344,
            86016: 553910272,
            90112: 537133184,
            94208: 16777216,
            98304: 553910400,
            102400: 553648128,
            106496: 17039360,
            110592: 537133056,
            114688: 262272,
            118784: 536871040,
            122880: 0,
            126976: 17039488,
            67584: 553648256,
            71680: 16777216,
            75776: 17039360,
            79872: 537133184,
            83968: 536870912,
            88064: 17039488,
            92160: 128,
            96256: 553910272,
            100352: 262272,
            104448: 553910400,
            108544: 0,
            112640: 553648128,
            116736: 16777344,
            120832: 262144,
            124928: 537133056,
            129024: 536871040
          },
          {
            0: 268435464,
            256: 8192,
            512: 270532608,
            768: 270540808,
            1024: 268443648,
            1280: 2097152,
            1536: 2097160,
            1792: 268435456,
            2048: 0,
            2304: 268443656,
            2560: 2105344,
            2816: 8,
            3072: 270532616,
            3328: 2105352,
            3584: 8200,
            3840: 270540800,
            128: 270532608,
            384: 270540808,
            640: 8,
            896: 2097152,
            1152: 2105352,
            1408: 268435464,
            1664: 268443648,
            1920: 8200,
            2176: 2097160,
            2432: 8192,
            2688: 268443656,
            2944: 270532616,
            3200: 0,
            3456: 270540800,
            3712: 2105344,
            3968: 268435456,
            4096: 268443648,
            4352: 270532616,
            4608: 270540808,
            4864: 8200,
            5120: 2097152,
            5376: 268435456,
            5632: 268435464,
            5888: 2105344,
            6144: 2105352,
            6400: 0,
            6656: 8,
            6912: 270532608,
            7168: 8192,
            7424: 268443656,
            7680: 270540800,
            7936: 2097160,
            4224: 8,
            4480: 2105344,
            4736: 2097152,
            4992: 268435464,
            5248: 268443648,
            5504: 8200,
            5760: 270540808,
            6016: 270532608,
            6272: 270540800,
            6528: 270532616,
            6784: 8192,
            7040: 2105352,
            7296: 2097160,
            7552: 0,
            7808: 268435456,
            8064: 268443656
          },
          {
            0: 1048576,
            16: 33555457,
            32: 1024,
            48: 1049601,
            64: 34604033,
            80: 0,
            96: 1,
            112: 34603009,
            128: 33555456,
            144: 1048577,
            160: 33554433,
            176: 34604032,
            192: 34603008,
            208: 1025,
            224: 1049600,
            240: 33554432,
            8: 34603009,
            24: 0,
            40: 33555457,
            56: 34604032,
            72: 1048576,
            88: 33554433,
            104: 33554432,
            120: 1025,
            136: 1049601,
            152: 33555456,
            168: 34603008,
            184: 1048577,
            200: 1024,
            216: 34604033,
            232: 1,
            248: 1049600,
            256: 33554432,
            272: 1048576,
            288: 33555457,
            304: 34603009,
            320: 1048577,
            336: 33555456,
            352: 34604032,
            368: 1049601,
            384: 1025,
            400: 34604033,
            416: 1049600,
            432: 1,
            448: 0,
            464: 34603008,
            480: 33554433,
            496: 1024,
            264: 1049600,
            280: 33555457,
            296: 34603009,
            312: 1,
            328: 33554432,
            344: 1048576,
            360: 1025,
            376: 34604032,
            392: 33554433,
            408: 34603008,
            424: 0,
            440: 34604033,
            456: 1049601,
            472: 1024,
            488: 33555456,
            504: 1048577
          },
          {
            0: 134219808,
            1: 131072,
            2: 134217728,
            3: 32,
            4: 131104,
            5: 134350880,
            6: 134350848,
            7: 2048,
            8: 134348800,
            9: 134219776,
            10: 133120,
            11: 134348832,
            12: 2080,
            13: 0,
            14: 134217760,
            15: 133152,
            2147483648: 2048,
            2147483649: 134350880,
            2147483650: 134219808,
            2147483651: 134217728,
            2147483652: 134348800,
            2147483653: 133120,
            2147483654: 133152,
            2147483655: 32,
            2147483656: 134217760,
            2147483657: 2080,
            2147483658: 131104,
            2147483659: 134350848,
            2147483660: 0,
            2147483661: 134348832,
            2147483662: 134219776,
            2147483663: 131072,
            16: 133152,
            17: 134350848,
            18: 32,
            19: 2048,
            20: 134219776,
            21: 134217760,
            22: 134348832,
            23: 131072,
            24: 0,
            25: 131104,
            26: 134348800,
            27: 134219808,
            28: 134350880,
            29: 133120,
            30: 2080,
            31: 134217728,
            2147483664: 131072,
            2147483665: 2048,
            2147483666: 134348832,
            2147483667: 133152,
            2147483668: 32,
            2147483669: 134348800,
            2147483670: 134217728,
            2147483671: 134219808,
            2147483672: 134350880,
            2147483673: 134217760,
            2147483674: 134219776,
            2147483675: 0,
            2147483676: 133120,
            2147483677: 2080,
            2147483678: 131104,
            2147483679: 134350848
          }
        ], u = [
          4160749569,
          528482304,
          33030144,
          2064384,
          129024,
          8064,
          504,
          2147483679
        ], l = a.DES = s.extend({
          _doReset: function() {
            for (var H = this._key, T = H.words, q = [], b = 0; b < 56; b++) {
              var j = f[b] - 1;
              q[b] = T[j >>> 5] >>> 31 - j % 32 & 1;
            }
            for (var w = this._subKeys = [], m = 0; m < 16; m++) {
              for (var I = w[m] = [], N = d[m], b = 0; b < 24; b++)
                I[b / 6 | 0] |= q[(o[b] - 1 + N) % 28] << 31 - b % 6, I[4 + (b / 6 | 0)] |= q[28 + (o[b + 24] - 1 + N) % 28] << 31 - b % 6;
              I[0] = I[0] << 1 | I[0] >>> 31;
              for (var b = 1; b < 7; b++)
                I[b] = I[b] >>> (b - 1) * 4 + 3;
              I[7] = I[7] << 5 | I[7] >>> 27;
            }
            for (var k = this._invSubKeys = [], b = 0; b < 16; b++)
              k[b] = w[15 - b];
          },
          encryptBlock: function(H, T) {
            this._doCryptBlock(H, T, this._subKeys);
          },
          decryptBlock: function(H, T) {
            this._doCryptBlock(H, T, this._invSubKeys);
          },
          _doCryptBlock: function(H, T, q) {
            this._lBlock = H[T], this._rBlock = H[T + 1], P.call(this, 4, 252645135), P.call(this, 16, 65535), p.call(this, 2, 858993459), p.call(this, 8, 16711935), P.call(this, 1, 1431655765);
            for (var b = 0; b < 16; b++) {
              for (var j = q[b], w = this._lBlock, m = this._rBlock, I = 0, N = 0; N < 8; N++)
                I |= v[N][((m ^ j[N]) & u[N]) >>> 0];
              this._lBlock = m, this._rBlock = w ^ I;
            }
            var k = this._lBlock;
            this._lBlock = this._rBlock, this._rBlock = k, P.call(this, 1, 1431655765), p.call(this, 8, 16711935), p.call(this, 2, 858993459), P.call(this, 16, 65535), P.call(this, 4, 252645135), H[T] = this._lBlock, H[T + 1] = this._rBlock;
          },
          keySize: 64 / 32,
          ivSize: 64 / 32,
          blockSize: 64 / 32
        });
        function P(H, T) {
          var q = (this._lBlock >>> H ^ this._rBlock) & T;
          this._rBlock ^= q, this._lBlock ^= q << H;
        }
        function p(H, T) {
          var q = (this._rBlock >>> H ^ this._lBlock) & T;
          this._lBlock ^= q, this._rBlock ^= q << H;
        }
        r.DES = s._createHelper(l);
        var c = a.TripleDES = s.extend({
          _doReset: function() {
            var H = this._key, T = H.words;
            if (T.length !== 2 && T.length !== 4 && T.length < 6)
              throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
            var q = T.slice(0, 2), b = T.length < 4 ? T.slice(0, 2) : T.slice(2, 4), j = T.length < 6 ? T.slice(0, 2) : T.slice(4, 6);
            this._des1 = l.createEncryptor(i.create(q)), this._des2 = l.createEncryptor(i.create(b)), this._des3 = l.createEncryptor(i.create(j));
          },
          encryptBlock: function(H, T) {
            this._des1.encryptBlock(H, T), this._des2.decryptBlock(H, T), this._des3.encryptBlock(H, T);
          },
          decryptBlock: function(H, T) {
            this._des3.decryptBlock(H, T), this._des2.encryptBlock(H, T), this._des1.decryptBlock(H, T);
          },
          keySize: 192 / 32,
          ivSize: 64 / 32,
          blockSize: 64 / 32
        });
        r.TripleDES = s._createHelper(c);
      }(), t.TripleDES;
    });
  }(S5)), S5.exports;
}
var U5 = { exports: {} }, Q_;
function ADe() {
  return Q_ || (Q_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Ym(), Mm(), UD(), Gd());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.StreamCipher, s = r.algo, a = s.RC4 = i.extend({
          _doReset: function() {
            for (var d = this._key, v = d.words, u = d.sigBytes, l = this._S = [], P = 0; P < 256; P++)
              l[P] = P;
            for (var P = 0, p = 0; P < 256; P++) {
              var c = P % u, H = v[c >>> 2] >>> 24 - c % 4 * 8 & 255;
              p = (p + l[P] + H) % 256;
              var T = l[P];
              l[P] = l[p], l[p] = T;
            }
            this._i = this._j = 0;
          },
          _doProcessBlock: function(d, v) {
            d[v] ^= f.call(this);
          },
          keySize: 256 / 32,
          ivSize: 0
        });
        function f() {
          for (var d = this._S, v = this._i, u = this._j, l = 0, P = 0; P < 4; P++) {
            v = (v + 1) % 256, u = (u + d[v]) % 256;
            var p = d[v];
            d[v] = d[u], d[u] = p, l |= d[(d[v] + d[u]) % 256] << 24 - P * 8;
          }
          return this._i = v, this._j = u, l;
        }
        r.RC4 = i._createHelper(a);
        var o = s.RC4Drop = a.extend({
          /**
           * Configuration options.
           *
           * @property {number} drop The number of keystream words to drop. Default 192
           */
          cfg: a.cfg.extend({
            drop: 192
          }),
          _doReset: function() {
            a._doReset.call(this);
            for (var d = this.cfg.drop; d > 0; d--)
              f.call(this);
          }
        });
        r.RC4Drop = i._createHelper(o);
      }(), t.RC4;
    });
  }(U5)), U5.exports;
}
var I5 = { exports: {} }, Y_;
function dDe() {
  return Y_ || (Y_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Ym(), Mm(), UD(), Gd());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.StreamCipher, s = r.algo, a = [], f = [], o = [], d = s.Rabbit = i.extend({
          _doReset: function() {
            for (var u = this._key.words, l = this.cfg.iv, P = 0; P < 4; P++)
              u[P] = (u[P] << 8 | u[P] >>> 24) & 16711935 | (u[P] << 24 | u[P] >>> 8) & 4278255360;
            var p = this._X = [
              u[0],
              u[3] << 16 | u[2] >>> 16,
              u[1],
              u[0] << 16 | u[3] >>> 16,
              u[2],
              u[1] << 16 | u[0] >>> 16,
              u[3],
              u[2] << 16 | u[1] >>> 16
            ], c = this._C = [
              u[2] << 16 | u[2] >>> 16,
              u[0] & 4294901760 | u[1] & 65535,
              u[3] << 16 | u[3] >>> 16,
              u[1] & 4294901760 | u[2] & 65535,
              u[0] << 16 | u[0] >>> 16,
              u[2] & 4294901760 | u[3] & 65535,
              u[1] << 16 | u[1] >>> 16,
              u[3] & 4294901760 | u[0] & 65535
            ];
            this._b = 0;
            for (var P = 0; P < 4; P++)
              v.call(this);
            for (var P = 0; P < 8; P++)
              c[P] ^= p[P + 4 & 7];
            if (l) {
              var H = l.words, T = H[0], q = H[1], b = (T << 8 | T >>> 24) & 16711935 | (T << 24 | T >>> 8) & 4278255360, j = (q << 8 | q >>> 24) & 16711935 | (q << 24 | q >>> 8) & 4278255360, w = b >>> 16 | j & 4294901760, m = j << 16 | b & 65535;
              c[0] ^= b, c[1] ^= w, c[2] ^= j, c[3] ^= m, c[4] ^= b, c[5] ^= w, c[6] ^= j, c[7] ^= m;
              for (var P = 0; P < 4; P++)
                v.call(this);
            }
          },
          _doProcessBlock: function(u, l) {
            var P = this._X;
            v.call(this), a[0] = P[0] ^ P[5] >>> 16 ^ P[3] << 16, a[1] = P[2] ^ P[7] >>> 16 ^ P[5] << 16, a[2] = P[4] ^ P[1] >>> 16 ^ P[7] << 16, a[3] = P[6] ^ P[3] >>> 16 ^ P[1] << 16;
            for (var p = 0; p < 4; p++)
              a[p] = (a[p] << 8 | a[p] >>> 24) & 16711935 | (a[p] << 24 | a[p] >>> 8) & 4278255360, u[l + p] ^= a[p];
          },
          blockSize: 128 / 32,
          ivSize: 64 / 32
        });
        function v() {
          for (var u = this._X, l = this._C, P = 0; P < 8; P++)
            f[P] = l[P];
          l[0] = l[0] + 1295307597 + this._b | 0, l[1] = l[1] + 3545052371 + (l[0] >>> 0 < f[0] >>> 0 ? 1 : 0) | 0, l[2] = l[2] + 886263092 + (l[1] >>> 0 < f[1] >>> 0 ? 1 : 0) | 0, l[3] = l[3] + 1295307597 + (l[2] >>> 0 < f[2] >>> 0 ? 1 : 0) | 0, l[4] = l[4] + 3545052371 + (l[3] >>> 0 < f[3] >>> 0 ? 1 : 0) | 0, l[5] = l[5] + 886263092 + (l[4] >>> 0 < f[4] >>> 0 ? 1 : 0) | 0, l[6] = l[6] + 1295307597 + (l[5] >>> 0 < f[5] >>> 0 ? 1 : 0) | 0, l[7] = l[7] + 3545052371 + (l[6] >>> 0 < f[6] >>> 0 ? 1 : 0) | 0, this._b = l[7] >>> 0 < f[7] >>> 0 ? 1 : 0;
          for (var P = 0; P < 8; P++) {
            var p = u[P] + l[P], c = p & 65535, H = p >>> 16, T = ((c * c >>> 17) + c * H >>> 15) + H * H, q = ((p & 4294901760) * p | 0) + ((p & 65535) * p | 0);
            o[P] = T ^ q;
          }
          u[0] = o[0] + (o[7] << 16 | o[7] >>> 16) + (o[6] << 16 | o[6] >>> 16) | 0, u[1] = o[1] + (o[0] << 8 | o[0] >>> 24) + o[7] | 0, u[2] = o[2] + (o[1] << 16 | o[1] >>> 16) + (o[0] << 16 | o[0] >>> 16) | 0, u[3] = o[3] + (o[2] << 8 | o[2] >>> 24) + o[1] | 0, u[4] = o[4] + (o[3] << 16 | o[3] >>> 16) + (o[2] << 16 | o[2] >>> 16) | 0, u[5] = o[5] + (o[4] << 8 | o[4] >>> 24) + o[3] | 0, u[6] = o[6] + (o[5] << 16 | o[5] >>> 16) + (o[4] << 16 | o[4] >>> 16) | 0, u[7] = o[7] + (o[6] << 8 | o[6] >>> 24) + o[5] | 0;
        }
        r.Rabbit = i._createHelper(d);
      }(), t.Rabbit;
    });
  }(I5)), I5.exports;
}
var R5 = { exports: {} }, M_;
function vDe() {
  return M_ || (M_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Ym(), Mm(), UD(), Gd());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.StreamCipher, s = r.algo, a = [], f = [], o = [], d = s.RabbitLegacy = i.extend({
          _doReset: function() {
            var u = this._key.words, l = this.cfg.iv, P = this._X = [
              u[0],
              u[3] << 16 | u[2] >>> 16,
              u[1],
              u[0] << 16 | u[3] >>> 16,
              u[2],
              u[1] << 16 | u[0] >>> 16,
              u[3],
              u[2] << 16 | u[1] >>> 16
            ], p = this._C = [
              u[2] << 16 | u[2] >>> 16,
              u[0] & 4294901760 | u[1] & 65535,
              u[3] << 16 | u[3] >>> 16,
              u[1] & 4294901760 | u[2] & 65535,
              u[0] << 16 | u[0] >>> 16,
              u[2] & 4294901760 | u[3] & 65535,
              u[1] << 16 | u[1] >>> 16,
              u[3] & 4294901760 | u[0] & 65535
            ];
            this._b = 0;
            for (var c = 0; c < 4; c++)
              v.call(this);
            for (var c = 0; c < 8; c++)
              p[c] ^= P[c + 4 & 7];
            if (l) {
              var H = l.words, T = H[0], q = H[1], b = (T << 8 | T >>> 24) & 16711935 | (T << 24 | T >>> 8) & 4278255360, j = (q << 8 | q >>> 24) & 16711935 | (q << 24 | q >>> 8) & 4278255360, w = b >>> 16 | j & 4294901760, m = j << 16 | b & 65535;
              p[0] ^= b, p[1] ^= w, p[2] ^= j, p[3] ^= m, p[4] ^= b, p[5] ^= w, p[6] ^= j, p[7] ^= m;
              for (var c = 0; c < 4; c++)
                v.call(this);
            }
          },
          _doProcessBlock: function(u, l) {
            var P = this._X;
            v.call(this), a[0] = P[0] ^ P[5] >>> 16 ^ P[3] << 16, a[1] = P[2] ^ P[7] >>> 16 ^ P[5] << 16, a[2] = P[4] ^ P[1] >>> 16 ^ P[7] << 16, a[3] = P[6] ^ P[3] >>> 16 ^ P[1] << 16;
            for (var p = 0; p < 4; p++)
              a[p] = (a[p] << 8 | a[p] >>> 24) & 16711935 | (a[p] << 24 | a[p] >>> 8) & 4278255360, u[l + p] ^= a[p];
          },
          blockSize: 128 / 32,
          ivSize: 64 / 32
        });
        function v() {
          for (var u = this._X, l = this._C, P = 0; P < 8; P++)
            f[P] = l[P];
          l[0] = l[0] + 1295307597 + this._b | 0, l[1] = l[1] + 3545052371 + (l[0] >>> 0 < f[0] >>> 0 ? 1 : 0) | 0, l[2] = l[2] + 886263092 + (l[1] >>> 0 < f[1] >>> 0 ? 1 : 0) | 0, l[3] = l[3] + 1295307597 + (l[2] >>> 0 < f[2] >>> 0 ? 1 : 0) | 0, l[4] = l[4] + 3545052371 + (l[3] >>> 0 < f[3] >>> 0 ? 1 : 0) | 0, l[5] = l[5] + 886263092 + (l[4] >>> 0 < f[4] >>> 0 ? 1 : 0) | 0, l[6] = l[6] + 1295307597 + (l[5] >>> 0 < f[5] >>> 0 ? 1 : 0) | 0, l[7] = l[7] + 3545052371 + (l[6] >>> 0 < f[6] >>> 0 ? 1 : 0) | 0, this._b = l[7] >>> 0 < f[7] >>> 0 ? 1 : 0;
          for (var P = 0; P < 8; P++) {
            var p = u[P] + l[P], c = p & 65535, H = p >>> 16, T = ((c * c >>> 17) + c * H >>> 15) + H * H, q = ((p & 4294901760) * p | 0) + ((p & 65535) * p | 0);
            o[P] = T ^ q;
          }
          u[0] = o[0] + (o[7] << 16 | o[7] >>> 16) + (o[6] << 16 | o[6] >>> 16) | 0, u[1] = o[1] + (o[0] << 8 | o[0] >>> 24) + o[7] | 0, u[2] = o[2] + (o[1] << 16 | o[1] >>> 16) + (o[0] << 16 | o[0] >>> 16) | 0, u[3] = o[3] + (o[2] << 8 | o[2] >>> 24) + o[1] | 0, u[4] = o[4] + (o[3] << 16 | o[3] >>> 16) + (o[2] << 16 | o[2] >>> 16) | 0, u[5] = o[5] + (o[4] << 8 | o[4] >>> 24) + o[3] | 0, u[6] = o[6] + (o[5] << 16 | o[5] >>> 16) + (o[4] << 16 | o[4] >>> 16) | 0, u[7] = o[7] + (o[6] << 8 | o[6] >>> 24) + o[5] | 0;
        }
        r.RabbitLegacy = i._createHelper(d);
      }(), t.RabbitLegacy;
    });
  }(R5)), R5.exports;
}
var V5 = { exports: {} }, L_;
function uDe() {
  return L_ || (L_ = 1, function(A, e) {
    (function(t, r, n) {
      A.exports = r(Ea(), Ym(), Mm(), UD(), Gd());
    })(zi, function(t) {
      return function() {
        var r = t, n = r.lib, i = n.BlockCipher, s = r.algo;
        const a = 16, f = [
          608135816,
          2242054355,
          320440878,
          57701188,
          2752067618,
          698298832,
          137296536,
          3964562569,
          1160258022,
          953160567,
          3193202383,
          887688300,
          3232508343,
          3380367581,
          1065670069,
          3041331479,
          2450970073,
          2306472731
        ], o = [
          [
            3509652390,
            2564797868,
            805139163,
            3491422135,
            3101798381,
            1780907670,
            3128725573,
            4046225305,
            614570311,
            3012652279,
            134345442,
            2240740374,
            1667834072,
            1901547113,
            2757295779,
            4103290238,
            227898511,
            1921955416,
            1904987480,
            2182433518,
            2069144605,
            3260701109,
            2620446009,
            720527379,
            3318853667,
            677414384,
            3393288472,
            3101374703,
            2390351024,
            1614419982,
            1822297739,
            2954791486,
            3608508353,
            3174124327,
            2024746970,
            1432378464,
            3864339955,
            2857741204,
            1464375394,
            1676153920,
            1439316330,
            715854006,
            3033291828,
            289532110,
            2706671279,
            2087905683,
            3018724369,
            1668267050,
            732546397,
            1947742710,
            3462151702,
            2609353502,
            2950085171,
            1814351708,
            2050118529,
            680887927,
            999245976,
            1800124847,
            3300911131,
            1713906067,
            1641548236,
            4213287313,
            1216130144,
            1575780402,
            4018429277,
            3917837745,
            3693486850,
            3949271944,
            596196993,
            3549867205,
            258830323,
            2213823033,
            772490370,
            2760122372,
            1774776394,
            2652871518,
            566650946,
            4142492826,
            1728879713,
            2882767088,
            1783734482,
            3629395816,
            2517608232,
            2874225571,
            1861159788,
            326777828,
            3124490320,
            2130389656,
            2716951837,
            967770486,
            1724537150,
            2185432712,
            2364442137,
            1164943284,
            2105845187,
            998989502,
            3765401048,
            2244026483,
            1075463327,
            1455516326,
            1322494562,
            910128902,
            469688178,
            1117454909,
            936433444,
            3490320968,
            3675253459,
            1240580251,
            122909385,
            2157517691,
            634681816,
            4142456567,
            3825094682,
            3061402683,
            2540495037,
            79693498,
            3249098678,
            1084186820,
            1583128258,
            426386531,
            1761308591,
            1047286709,
            322548459,
            995290223,
            1845252383,
            2603652396,
            3431023940,
            2942221577,
            3202600964,
            3727903485,
            1712269319,
            422464435,
            3234572375,
            1170764815,
            3523960633,
            3117677531,
            1434042557,
            442511882,
            3600875718,
            1076654713,
            1738483198,
            4213154764,
            2393238008,
            3677496056,
            1014306527,
            4251020053,
            793779912,
            2902807211,
            842905082,
            4246964064,
            1395751752,
            1040244610,
            2656851899,
            3396308128,
            445077038,
            3742853595,
            3577915638,
            679411651,
            2892444358,
            2354009459,
            1767581616,
            3150600392,
            3791627101,
            3102740896,
            284835224,
            4246832056,
            1258075500,
            768725851,
            2589189241,
            3069724005,
            3532540348,
            1274779536,
            3789419226,
            2764799539,
            1660621633,
            3471099624,
            4011903706,
            913787905,
            3497959166,
            737222580,
            2514213453,
            2928710040,
            3937242737,
            1804850592,
            3499020752,
            2949064160,
            2386320175,
            2390070455,
            2415321851,
            4061277028,
            2290661394,
            2416832540,
            1336762016,
            1754252060,
            3520065937,
            3014181293,
            791618072,
            3188594551,
            3933548030,
            2332172193,
            3852520463,
            3043980520,
            413987798,
            3465142937,
            3030929376,
            4245938359,
            2093235073,
            3534596313,
            375366246,
            2157278981,
            2479649556,
            555357303,
            3870105701,
            2008414854,
            3344188149,
            4221384143,
            3956125452,
            2067696032,
            3594591187,
            2921233993,
            2428461,
            544322398,
            577241275,
            1471733935,
            610547355,
            4027169054,
            1432588573,
            1507829418,
            2025931657,
            3646575487,
            545086370,
            48609733,
            2200306550,
            1653985193,
            298326376,
            1316178497,
            3007786442,
            2064951626,
            458293330,
            2589141269,
            3591329599,
            3164325604,
            727753846,
            2179363840,
            146436021,
            1461446943,
            4069977195,
            705550613,
            3059967265,
            3887724982,
            4281599278,
            3313849956,
            1404054877,
            2845806497,
            146425753,
            1854211946
          ],
          [
            1266315497,
            3048417604,
            3681880366,
            3289982499,
            290971e4,
            1235738493,
            2632868024,
            2414719590,
            3970600049,
            1771706367,
            1449415276,
            3266420449,
            422970021,
            1963543593,
            2690192192,
            3826793022,
            1062508698,
            1531092325,
            1804592342,
            2583117782,
            2714934279,
            4024971509,
            1294809318,
            4028980673,
            1289560198,
            2221992742,
            1669523910,
            35572830,
            157838143,
            1052438473,
            1016535060,
            1802137761,
            1753167236,
            1386275462,
            3080475397,
            2857371447,
            1040679964,
            2145300060,
            2390574316,
            1461121720,
            2956646967,
            4031777805,
            4028374788,
            33600511,
            2920084762,
            1018524850,
            629373528,
            3691585981,
            3515945977,
            2091462646,
            2486323059,
            586499841,
            988145025,
            935516892,
            3367335476,
            2599673255,
            2839830854,
            265290510,
            3972581182,
            2759138881,
            3795373465,
            1005194799,
            847297441,
            406762289,
            1314163512,
            1332590856,
            1866599683,
            4127851711,
            750260880,
            613907577,
            1450815602,
            3165620655,
            3734664991,
            3650291728,
            3012275730,
            3704569646,
            1427272223,
            778793252,
            1343938022,
            2676280711,
            2052605720,
            1946737175,
            3164576444,
            3914038668,
            3967478842,
            3682934266,
            1661551462,
            3294938066,
            4011595847,
            840292616,
            3712170807,
            616741398,
            312560963,
            711312465,
            1351876610,
            322626781,
            1910503582,
            271666773,
            2175563734,
            1594956187,
            70604529,
            3617834859,
            1007753275,
            1495573769,
            4069517037,
            2549218298,
            2663038764,
            504708206,
            2263041392,
            3941167025,
            2249088522,
            1514023603,
            1998579484,
            1312622330,
            694541497,
            2582060303,
            2151582166,
            1382467621,
            776784248,
            2618340202,
            3323268794,
            2497899128,
            2784771155,
            503983604,
            4076293799,
            907881277,
            423175695,
            432175456,
            1378068232,
            4145222326,
            3954048622,
            3938656102,
            3820766613,
            2793130115,
            2977904593,
            26017576,
            3274890735,
            3194772133,
            1700274565,
            1756076034,
            4006520079,
            3677328699,
            720338349,
            1533947780,
            354530856,
            688349552,
            3973924725,
            1637815568,
            332179504,
            3949051286,
            53804574,
            2852348879,
            3044236432,
            1282449977,
            3583942155,
            3416972820,
            4006381244,
            1617046695,
            2628476075,
            3002303598,
            1686838959,
            431878346,
            2686675385,
            1700445008,
            1080580658,
            1009431731,
            832498133,
            3223435511,
            2605976345,
            2271191193,
            2516031870,
            1648197032,
            4164389018,
            2548247927,
            300782431,
            375919233,
            238389289,
            3353747414,
            2531188641,
            2019080857,
            1475708069,
            455242339,
            2609103871,
            448939670,
            3451063019,
            1395535956,
            2413381860,
            1841049896,
            1491858159,
            885456874,
            4264095073,
            4001119347,
            1565136089,
            3898914787,
            1108368660,
            540939232,
            1173283510,
            2745871338,
            3681308437,
            4207628240,
            3343053890,
            4016749493,
            1699691293,
            1103962373,
            3625875870,
            2256883143,
            3830138730,
            1031889488,
            3479347698,
            1535977030,
            4236805024,
            3251091107,
            2132092099,
            1774941330,
            1199868427,
            1452454533,
            157007616,
            2904115357,
            342012276,
            595725824,
            1480756522,
            206960106,
            497939518,
            591360097,
            863170706,
            2375253569,
            3596610801,
            1814182875,
            2094937945,
            3421402208,
            1082520231,
            3463918190,
            2785509508,
            435703966,
            3908032597,
            1641649973,
            2842273706,
            3305899714,
            1510255612,
            2148256476,
            2655287854,
            3276092548,
            4258621189,
            236887753,
            3681803219,
            274041037,
            1734335097,
            3815195456,
            3317970021,
            1899903192,
            1026095262,
            4050517792,
            356393447,
            2410691914,
            3873677099,
            3682840055
          ],
          [
            3913112168,
            2491498743,
            4132185628,
            2489919796,
            1091903735,
            1979897079,
            3170134830,
            3567386728,
            3557303409,
            857797738,
            1136121015,
            1342202287,
            507115054,
            2535736646,
            337727348,
            3213592640,
            1301675037,
            2528481711,
            1895095763,
            1721773893,
            3216771564,
            62756741,
            2142006736,
            835421444,
            2531993523,
            1442658625,
            3659876326,
            2882144922,
            676362277,
            1392781812,
            170690266,
            3921047035,
            1759253602,
            3611846912,
            1745797284,
            664899054,
            1329594018,
            3901205900,
            3045908486,
            2062866102,
            2865634940,
            3543621612,
            3464012697,
            1080764994,
            553557557,
            3656615353,
            3996768171,
            991055499,
            499776247,
            1265440854,
            648242737,
            3940784050,
            980351604,
            3713745714,
            1749149687,
            3396870395,
            4211799374,
            3640570775,
            1161844396,
            3125318951,
            1431517754,
            545492359,
            4268468663,
            3499529547,
            1437099964,
            2702547544,
            3433638243,
            2581715763,
            2787789398,
            1060185593,
            1593081372,
            2418618748,
            4260947970,
            69676912,
            2159744348,
            86519011,
            2512459080,
            3838209314,
            1220612927,
            3339683548,
            133810670,
            1090789135,
            1078426020,
            1569222167,
            845107691,
            3583754449,
            4072456591,
            1091646820,
            628848692,
            1613405280,
            3757631651,
            526609435,
            236106946,
            48312990,
            2942717905,
            3402727701,
            1797494240,
            859738849,
            992217954,
            4005476642,
            2243076622,
            3870952857,
            3732016268,
            765654824,
            3490871365,
            2511836413,
            1685915746,
            3888969200,
            1414112111,
            2273134842,
            3281911079,
            4080962846,
            172450625,
            2569994100,
            980381355,
            4109958455,
            2819808352,
            2716589560,
            2568741196,
            3681446669,
            3329971472,
            1835478071,
            660984891,
            3704678404,
            4045999559,
            3422617507,
            3040415634,
            1762651403,
            1719377915,
            3470491036,
            2693910283,
            3642056355,
            3138596744,
            1364962596,
            2073328063,
            1983633131,
            926494387,
            3423689081,
            2150032023,
            4096667949,
            1749200295,
            3328846651,
            309677260,
            2016342300,
            1779581495,
            3079819751,
            111262694,
            1274766160,
            443224088,
            298511866,
            1025883608,
            3806446537,
            1145181785,
            168956806,
            3641502830,
            3584813610,
            1689216846,
            3666258015,
            3200248200,
            1692713982,
            2646376535,
            4042768518,
            1618508792,
            1610833997,
            3523052358,
            4130873264,
            2001055236,
            3610705100,
            2202168115,
            4028541809,
            2961195399,
            1006657119,
            2006996926,
            3186142756,
            1430667929,
            3210227297,
            1314452623,
            4074634658,
            4101304120,
            2273951170,
            1399257539,
            3367210612,
            3027628629,
            1190975929,
            2062231137,
            2333990788,
            2221543033,
            2438960610,
            1181637006,
            548689776,
            2362791313,
            3372408396,
            3104550113,
            3145860560,
            296247880,
            1970579870,
            3078560182,
            3769228297,
            1714227617,
            3291629107,
            3898220290,
            166772364,
            1251581989,
            493813264,
            448347421,
            195405023,
            2709975567,
            677966185,
            3703036547,
            1463355134,
            2715995803,
            1338867538,
            1343315457,
            2802222074,
            2684532164,
            233230375,
            2599980071,
            2000651841,
            3277868038,
            1638401717,
            4028070440,
            3237316320,
            6314154,
            819756386,
            300326615,
            590932579,
            1405279636,
            3267499572,
            3150704214,
            2428286686,
            3959192993,
            3461946742,
            1862657033,
            1266418056,
            963775037,
            2089974820,
            2263052895,
            1917689273,
            448879540,
            3550394620,
            3981727096,
            150775221,
            3627908307,
            1303187396,
            508620638,
            2975983352,
            2726630617,
            1817252668,
            1876281319,
            1457606340,
            908771278,
            3720792119,
            3617206836,
            2455994898,
            1729034894,
            1080033504
          ],
          [
            976866871,
            3556439503,
            2881648439,
            1522871579,
            1555064734,
            1336096578,
            3548522304,
            2579274686,
            3574697629,
            3205460757,
            3593280638,
            3338716283,
            3079412587,
            564236357,
            2993598910,
            1781952180,
            1464380207,
            3163844217,
            3332601554,
            1699332808,
            1393555694,
            1183702653,
            3581086237,
            1288719814,
            691649499,
            2847557200,
            2895455976,
            3193889540,
            2717570544,
            1781354906,
            1676643554,
            2592534050,
            3230253752,
            1126444790,
            2770207658,
            2633158820,
            2210423226,
            2615765581,
            2414155088,
            3127139286,
            673620729,
            2805611233,
            1269405062,
            4015350505,
            3341807571,
            4149409754,
            1057255273,
            2012875353,
            2162469141,
            2276492801,
            2601117357,
            993977747,
            3918593370,
            2654263191,
            753973209,
            36408145,
            2530585658,
            25011837,
            3520020182,
            2088578344,
            530523599,
            2918365339,
            1524020338,
            1518925132,
            3760827505,
            3759777254,
            1202760957,
            3985898139,
            3906192525,
            674977740,
            4174734889,
            2031300136,
            2019492241,
            3983892565,
            4153806404,
            3822280332,
            352677332,
            2297720250,
            60907813,
            90501309,
            3286998549,
            1016092578,
            2535922412,
            2839152426,
            457141659,
            509813237,
            4120667899,
            652014361,
            1966332200,
            2975202805,
            55981186,
            2327461051,
            676427537,
            3255491064,
            2882294119,
            3433927263,
            1307055953,
            942726286,
            933058658,
            2468411793,
            3933900994,
            4215176142,
            1361170020,
            2001714738,
            2830558078,
            3274259782,
            1222529897,
            1679025792,
            2729314320,
            3714953764,
            1770335741,
            151462246,
            3013232138,
            1682292957,
            1483529935,
            471910574,
            1539241949,
            458788160,
            3436315007,
            1807016891,
            3718408830,
            978976581,
            1043663428,
            3165965781,
            1927990952,
            4200891579,
            2372276910,
            3208408903,
            3533431907,
            1412390302,
            2931980059,
            4132332400,
            1947078029,
            3881505623,
            4168226417,
            2941484381,
            1077988104,
            1320477388,
            886195818,
            18198404,
            3786409e3,
            2509781533,
            112762804,
            3463356488,
            1866414978,
            891333506,
            18488651,
            661792760,
            1628790961,
            3885187036,
            3141171499,
            876946877,
            2693282273,
            1372485963,
            791857591,
            2686433993,
            3759982718,
            3167212022,
            3472953795,
            2716379847,
            445679433,
            3561995674,
            3504004811,
            3574258232,
            54117162,
            3331405415,
            2381918588,
            3769707343,
            4154350007,
            1140177722,
            4074052095,
            668550556,
            3214352940,
            367459370,
            261225585,
            2610173221,
            4209349473,
            3468074219,
            3265815641,
            314222801,
            3066103646,
            3808782860,
            282218597,
            3406013506,
            3773591054,
            379116347,
            1285071038,
            846784868,
            2669647154,
            3771962079,
            3550491691,
            2305946142,
            453669953,
            1268987020,
            3317592352,
            3279303384,
            3744833421,
            2610507566,
            3859509063,
            266596637,
            3847019092,
            517658769,
            3462560207,
            3443424879,
            370717030,
            4247526661,
            2224018117,
            4143653529,
            4112773975,
            2788324899,
            2477274417,
            1456262402,
            2901442914,
            1517677493,
            1846949527,
            2295493580,
            3734397586,
            2176403920,
            1280348187,
            1908823572,
            3871786941,
            846861322,
            1172426758,
            3287448474,
            3383383037,
            1655181056,
            3139813346,
            901632758,
            1897031941,
            2986607138,
            3066810236,
            3447102507,
            1393639104,
            373351379,
            950779232,
            625454576,
            3124240540,
            4148612726,
            2007998917,
            544563296,
            2244738638,
            2330496472,
            2058025392,
            1291430526,
            424198748,
            50039436,
            29584100,
            3605783033,
            2429876329,
            2791104160,
            1057563949,
            3255363231,
            3075367218,
            3463963227,
            1469046755,
            985887462
          ]
        ];
        var d = {
          pbox: [],
          sbox: []
        };
        function v(c, H) {
          let T = H >> 24 & 255, q = H >> 16 & 255, b = H >> 8 & 255, j = H & 255, w = c.sbox[0][T] + c.sbox[1][q];
          return w = w ^ c.sbox[2][b], w = w + c.sbox[3][j], w;
        }
        function u(c, H, T) {
          let q = H, b = T, j;
          for (let w = 0; w < a; ++w)
            q = q ^ c.pbox[w], b = v(c, q) ^ b, j = q, q = b, b = j;
          return j = q, q = b, b = j, b = b ^ c.pbox[a], q = q ^ c.pbox[a + 1], { left: q, right: b };
        }
        function l(c, H, T) {
          let q = H, b = T, j;
          for (let w = a + 1; w > 1; --w)
            q = q ^ c.pbox[w], b = v(c, q) ^ b, j = q, q = b, b = j;
          return j = q, q = b, b = j, b = b ^ c.pbox[1], q = q ^ c.pbox[0], { left: q, right: b };
        }
        function P(c, H, T) {
          for (let m = 0; m < 4; m++) {
            c.sbox[m] = [];
            for (let I = 0; I < 256; I++)
              c.sbox[m][I] = o[m][I];
          }
          let q = 0;
          for (let m = 0; m < a + 2; m++)
            c.pbox[m] = f[m] ^ H[q], q++, q >= T && (q = 0);
          let b = 0, j = 0, w = 0;
          for (let m = 0; m < a + 2; m += 2)
            w = u(c, b, j), b = w.left, j = w.right, c.pbox[m] = b, c.pbox[m + 1] = j;
          for (let m = 0; m < 4; m++)
            for (let I = 0; I < 256; I += 2)
              w = u(c, b, j), b = w.left, j = w.right, c.sbox[m][I] = b, c.sbox[m][I + 1] = j;
          return !0;
        }
        var p = s.Blowfish = i.extend({
          _doReset: function() {
            if (this._keyPriorReset !== this._key) {
              var c = this._keyPriorReset = this._key, H = c.words, T = c.sigBytes / 4;
              P(d, H, T);
            }
          },
          encryptBlock: function(c, H) {
            var T = u(d, c[H], c[H + 1]);
            c[H] = T.left, c[H + 1] = T.right;
          },
          decryptBlock: function(c, H) {
            var T = l(d, c[H], c[H + 1]);
            c[H] = T.left, c[H + 1] = T.right;
          },
          blockSize: 64 / 32,
          keySize: 128 / 32,
          ivSize: 64 / 32
        });
        r.Blowfish = i._createHelper(p);
      }(), t.Blowfish;
    });
  }(V5)), V5.exports;
}
(function(A, e) {
  (function(t, r, n) {
    A.exports = r(Ea(), zy(), Nxe(), Qxe(), Ym(), Yxe(), Mm(), t9e(), bM(), Mxe(), r9e(), Lxe(), Kxe(), Jxe(), xM(), zxe(), UD(), Gd(), Gxe(), Zxe(), _xe(), $xe(), eDe(), tDe(), rDe(), nDe(), iDe(), sDe(), aDe(), oDe(), fDe(), ADe(), dDe(), vDe(), uDe());
  })(zi, function(t) {
    return t;
  });
})(e9e);
var lDe = e9e.exports;
const gc = /* @__PURE__ */ Dfe(lDe);
function e4() {
  return ((1 + Math.random()) * 4294967296 | 0).toString(16).substring(1);
}
function K_() {
  let A = [
    "0",
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7",
    "8",
    "9",
    "A",
    "B",
    "C",
    "D",
    "E",
    "F",
    "G",
    "H",
    "I",
    "J",
    "K",
    "L",
    "M",
    "N",
    "O",
    "P",
    "Q",
    "R",
    "S",
    "T",
    "U",
    "V",
    "W",
    "X",
    "Y",
    "Z",
    "a",
    "b",
    "c",
    "d",
    "e",
    "f",
    "g",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "n",
    "o",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "v",
    "w",
    "x",
    "y",
    "z"
  ], e = "";
  for (let t = 0; t < 16; t++) {
    let r = Math.ceil(Math.random() * 61);
    e += A[r];
  }
  return e;
}
const PDe = (A, e, t) => {
  let r = gc.enc.Utf8.parse(A);
  return gc.AES.encrypt(r, gc.enc.Utf8.parse(e), {
    iv: gc.enc.Utf8.parse(t),
    mode: gc.mode.CBC,
    padding: gc.pad.Pkcs7
  }).ciphertext.toString().toUpperCase();
}, cDe = (A, e, t) => {
  let r = gc.enc.Hex.parse(A), n = gc.enc.Base64.stringify(r);
  return gc.AES.decrypt(n, gc.enc.Utf8.parse(e), {
    iv: gc.enc.Utf8.parse(t),
    mode: gc.mode.CBC,
    padding: gc.pad.Pkcs7
  }).toString(gc.enc.Utf8).toString();
}, pDe = (A) => {
  const e = K_().toUpperCase(), t = K_().toUpperCase(), r = PDe(A, e, t);
  return e + r + t;
}, hO = (A) => {
  const e = A.substring(0, 16), t = A.substring(A.length - 16);
  return cDe(A.substring(16, A.length - 16), e, t);
};
class hDe {
  constructor(e) {
    this.loaders = [], this.glbUUIDMap = /* @__PURE__ */ new Map(), this.resultMap = /* @__PURE__ */ new Map(), this.instancedMap = /* @__PURE__ */ new Map(), this._callbackQueue = /* @__PURE__ */ new Map(), this._systemNodesMap = /* @__PURE__ */ new Map(), this._placeholderBox = /* @__PURE__ */ new Map(), this.getLoader = (t) => this.loaders.find((r) => r.able(t)), this.get = (t, r) => {
      const {
        data: n,
        placeholder: i = !0,
        onSuccess: s = () => {
        },
        onError: a = () => {
        }
      } = r || {};
      if (this.glbUUIDMap.has(t)) {
        const { name: f, url: o } = this.glbUUIDMap.get(t), d = this.getLoader(f);
        if (d) {
          this.resultMap.has(t) || this.resultMap.set(t, {
            state: 0,
            result: void 0
          });
          const v = this.resultMap.get(t);
          if ((v == null ? void 0 : v.state) === 2)
            s == null || s(v.result);
          else if ((v == null ? void 0 : v.state) === 3)
            a == null || a(v.error);
          else {
            const u = this._callbackQueue.get(t) || {
              success: [],
              error: []
            };
            if (s && u.success.push(s), a && u.error.push(a), this._callbackQueue.set(t, u), v.state !== 1) {
              if (n && i) {
                const {
                  scaling: l = { x: 1, y: 1, z: 1 },
                  size: P = l,
                  position: p = { x: 0, y: 0, z: 0 },
                  rotation: c = { x: 0, y: 0, z: 0 }
                } = n, H = Ef.CreateBox(
                  A2e + "_" + t,
                  { size: 1 },
                  this.manager.scene.scene
                );
                H.visibility = 0.5, H.isPickable = !1;
                const T = new Wt("", this.manager.scene.scene);
                T.maxSimultaneousLights = 0, T.emissiveColor = new Ne(0.2, 0.5, 1), T.backFaceCulling = !1, H.material = T;
                const q = this.manager.pivotPointPlacementMap.get(t) || $2.CX_NY_CZ;
                wM(H, q), H.scaling.set(
                  P.x || 1e-4,
                  P.y || 1e-4,
                  P.z || 1e-4
                ), H.position.set(p.x, p.y, p.z), H.rotation.set(
                  CW(c.x),
                  CW(c.y),
                  CW(c.z)
                ), this._placeholderBox.set(t, H);
              }
              d.get(
                o,
                f,
                t,
                (l) => {
                  var p, c;
                  if (this.resultMap.set(t, {
                    state: 2,
                    result: l,
                    error: void 0
                  }), n) {
                    const {
                      scaling: H = { x: 1, y: 1, z: 1 },
                      position: T = { x: 0, y: 0, z: 0 },
                      rotation: q = { x: 0, y: 0, z: 0 }
                    } = n;
                    l.root.position.set(T.x, T.y, T.z), l.root.scaling.set(
                      H.x || 1e-4,
                      H.y || 1e-4,
                      H.z || 1e-4
                    ), l.root.rotation.set(
                      CW(q.x),
                      CW(q.y),
                      CW(q.z)
                    );
                  }
                  const P = ((p = this._callbackQueue.get(t)) == null ? void 0 : p.success) || [];
                  this._callbackQueue.delete(t), P.forEach((H) => H(l)), (c = this._placeholderBox.get(t)) == null || c.dispose(!1, !0), this._placeholderBox.delete(t);
                },
                (l) => {
                  var p, c;
                  this.resultMap.set(t, {
                    state: 0,
                    result: void 0,
                    error: l
                  });
                  const P = ((p = this._callbackQueue.get(t)) == null ? void 0 : p.error) || [];
                  this._callbackQueue.delete(t), P.forEach((H) => H(l)), (c = this._placeholderBox.get(t)) == null || c.dispose(!1, !0), this._placeholderBox.delete(t);
                }
              ), this.resultMap.set(t, {
                state: 1,
                result: void 0
              });
            }
          }
        }
      } else
        console.error("未找到模型地址，glbId：", t), a({
          sceneManager: this.manager,
          url: "",
          name: "",
          message: "未找到模型地址"
        });
      return { placeholder: this._placeholderBox.get(t) };
    }, this.getResult = (t) => {
      var r;
      return (r = this.resultMap.get(t)) == null ? void 0 : r.result;
    }, this.getInstanced = (t, r) => {
      if (this.instancedMap.has(t))
        return this.instancedMap.get(t);
      let n = null;
      const i = [], s = [], a = this.resultMap.get(r);
      if (!a || !a.result)
        return console.error(
          "实例模型的源模型未加载，instancedID: ",
          t,
          "glbID: ",
          r
        ), { glbId: r, instancedId: t, root: n, transformNodes: i, meshes: s };
      const f = {};
      let o = 0;
      [a.result.meshes, a.result.transformNodes].forEach((v, u) => {
        v.forEach((l, P) => {
          let p;
          l instanceof bp ? p = l.sourceMesh.createInstance(Zn()) : l instanceof Ee && l.geometry ? p = l.createInstance(Zn()) : p = new Hr(Zn(), this.manager.scene.scene), p.position = l.position.clone(), p.scaling = l.scaling.clone(), p.rotation = l.rotation.clone(), this.manager.setMetadata(p, {
            __glbIndex: P,
            __glbUUID: r,
            __targetIndex: o,
            __instancedID: t,
            __instancedType: u === 0 ? se.Mesh : se.TransformNode,
            __valueType: se.InstancedMesh
          }), zt.initMetadata(p, this.manager), u === 0 ? s.push(p) : i.push(p), f[l.name] = p, o++;
        });
      }), [
        [i, a.result.transformNodes],
        [s, a.result.meshes]
      ].forEach((v) => {
        v[0].forEach((u, l) => {
          const P = v[1][l].parent;
          P && (u.parent = f[P.name]);
        });
      }), n = s[0];
      const d = { instancedId: t, glbId: r, root: n, transformNodes: i, meshes: s };
      return this.instancedMap.set(t, d), { instancedId: t, glbId: r, root: n, transformNodes: i, meshes: s };
    }, this.getList = (t) => {
      switch (t) {
        case se.TransformNode:
          return "transformNodes";
        case se.AbstractMesh:
        case se.Mesh:
        case se.InstancedMesh:
          return "meshes";
        case se.PointLight:
        case se.SpotLight:
        case se.HemisphericLight:
        case se.DirectionalLight:
          return "lights";
        case se.OrthographicCamera:
        case se.ArcRotateCamera:
        case se.FollowCamera:
        case se.FreeCamera:
          return "cameras";
        case se.StandardMaterial:
        case se.GridMaterial:
        case se.PBRMaterial:
        case se.GradientMaterial:
        case se.CityMaterial:
        case se.ShaderMaterial:
        case se.NodeMaterial:
        case se.WaterMaterial:
          return "materials";
        case se.Texture:
        case se.VideoTexture:
        case se.CubeTexture:
        case se.MirrorTexture:
          return "textures";
      }
    }, this.register = (t) => {
      this.loaders.unshift(t);
    }, this.getSystemNode = (t) => {
      t = t.replace(t[0], t[0].toLowerCase());
      const r = this._systemNodesMap.get(t);
      if (r) {
        const { rootNodes: n } = r.instantiateModelsToScene(void 0, !0);
        return n[0];
      }
    }, this.isLoading = () => [...this.resultMap.values()].some(
      (t) => t.state === 1
      /* Loading */
    ), this.dispose = () => {
      this._callbackQueue.clear(), this.resultMap.clear(), this.loaders.length = 0, this._systemNodesMap.forEach((t) => {
        t.dispose();
      });
    }, this.manager = e, this.register(new HDe(e)), this.register(new gDe(e));
  }
}
class n9e {
  constructor(e) {
    this.manager = e;
  }
}
class HDe extends n9e {
  constructor() {
    super(...arguments), this.able = (e) => QBe(e.toLocaleLowerCase()) || v$(e.toLocaleLowerCase()), this.get = async (e, t, r, n, i) => {
      fetch(e + t, {
        method: "get"
      }).then((s) => {
        if (s.status !== 200)
          throw new Error("fetch 状态码不为200");
        return s.arrayBuffer();
      }).then((s) => {
        v$(t) && (s = $fe.DeCode(s));
        const a = new File([s], t, { type: "model/gltf-binary" });
        Hn.ImportMesh(
          void 0,
          e,
          a,
          this.manager.scene.scene,
          (f, o, d, v, u, l, P) => {
            try {
              const p = XDe(
                e,
                t,
                r,
                {
                  meshes: f,
                  particleSystems: o,
                  skeletons: d,
                  animationGroups: v,
                  transformNodes: u,
                  geometries: l,
                  lights: P
                },
                this.manager
              );
              n(p);
            } catch (p) {
              console.error(p);
            }
          },
          void 0,
          (f, o, d) => {
            i == null || i({
              message: o,
              exception: d,
              sceneManager: this.manager,
              url: e,
              name: t
            });
          },
          ".glb"
        );
      }).catch((s) => {
        console.error("fetch error: 下载GLB文件失败，id：", r, s), i == null || i({
          message: "fetch error: 下载GLB文件失败",
          exception: s,
          sceneManager: this.manager,
          url: e,
          name: t
        });
      });
    };
  }
}
class gDe extends n9e {
  constructor() {
    super(...arguments), this.able = (e) => YBe(e.toLocaleLowerCase()), this.get = async (e, t, r, n, i) => {
      fetch(e + t, {
        method: "get"
      }).then((s) => {
        if (s.status !== 200)
          throw new Error("fetch 状态码不为200");
        return s.text();
      }).then((s) => {
        try {
          const a = JSON.parse(hO(s)), f = zt.deserialize(a, this.manager);
          n({
            root: f,
            url: e,
            name: t,
            glbId: r,
            meshes: [f],
            particleSystems: [],
            skeletons: [],
            animationGroups: [],
            transformNodes: [],
            geometries: [],
            lights: [],
            materials: [],
            textures: []
          });
        } catch (a) {
          console.error(a);
        }
      }).catch((s) => {
        i == null || i({
          message: "fetch error: 下载L3DM文件失败",
          exception: s,
          sceneManager: this.manager,
          url: e,
          name: t
        });
      });
    };
  }
}
const XDe = (A, e, t, r, n) => {
  const {
    meshes: i = [],
    particleSystems: s = [],
    skeletons: a = [],
    animationGroups: f = [],
    transformNodes: o = [],
    geometries: d = [],
    lights: v = []
  } = r, u = [], l = [], P = i[0];
  if (P) {
    const p = P.scaling.clone().asArray();
    P.scaling = new S(p[0], p[1], p[2]), wM(P, n.pivotPointPlacementMap.get(t));
    const c = (H) => {
      const T = H.id;
      H.name = Zn(), H.id = T, n.setMetadata(H, { __glbUUID: t }), zt.initMetadata(H, n);
      const q = n.getMetadata(H);
      q.__glbUUID = t, H.getChildren().forEach((b) => c(b));
    };
    c(P), [...i, ...o].forEach((H, T) => {
      const q = n.getMetadata(H);
      if (zt.setValue(
        H,
        { receiveShadows: !0, generateShadow: !0 },
        n
      ), H.reIntegrateRotationIntoRotationQuaternion = !0, H instanceof jn ? (q.__glbIndex = T, q.__materialIndex = -1) : H instanceof Hr && (q.__glbIndex = T - i.length), q.__targetIndex = T, H instanceof jn && H.material) {
        const b = H.material;
        n.getMetadata(b) || n.setMetadata(b, {});
        const j = n.getMetadata(b);
        if (!u.includes(b)) {
          b.name = Zn(), zt.initMetadata(b, n), j.__glbIndex = u.length, j.__glbUUID = t, j.__textureMap = {}, u.push(b);
          const w = zt.getInfo(j.__valueType);
          if (w)
            for (const m of w.values()) {
              const { property: I, valueType: N, getValue: k } = m;
              if (Xa(N).some((R) => zt.isTextureType(R))) {
                const R = k(b, n);
                n.getMetadata(R) || n.setMetadata(R, {});
                const y = n.getMetadata(R);
                R instanceof ls && (l.includes(R) || (R.name = Zn(), zt.initMetadata(R, n), y.__glbIndex = l.length, y.__glbUUID = t, l.push(R)), j.__textureMap[I] = l.indexOf(R));
              }
            }
        }
        q.__materialIndex = u.indexOf(b);
      }
    }), i.forEach((H) => {
      const T = n.getMetadata(H);
      H instanceof bp && (T.__initOption.source = H.sourceMesh.name);
    });
  }
  return {
    root: P,
    url: A,
    name: e,
    glbId: t,
    meshes: i,
    particleSystems: s,
    skeletons: a,
    animationGroups: f.map((p, c) => {
      p.stop();
      const H = t + "-" + c, T = p.name;
      return p.name = H, {
        id: H,
        name: T,
        group: p
      };
    }),
    transformNodes: o,
    geometries: d,
    lights: v,
    materials: u,
    textures: l
  };
};
class TDe {
  constructor(e) {
    var t;
    this.glowLayers = /* @__PURE__ */ new Map(), this.meshesMap = /* @__PURE__ */ new Map(), this.addExcludedMesh = (r) => {
      this.glowLayers.forEach((n) => {
        n.addExcludedMesh(r);
      });
    }, this.manager = e, this.manager.glowLayer && this.meshesMap.set((t = this.manager.glowLayer) == null ? void 0 : t.name, /* @__PURE__ */ new Map());
  }
  setGlowLayer(e) {
    const t = this.manager.getMetadata(e);
    if (this.detachGl(e), t != null && t.useGlowLayer) {
      let r = !0;
      if (this.glowLayers.forEach((n) => {
        n.blurKernelSize == t.glBlurKernelSize && n.intensity == t.glIntensity && (this.glAttachToMesh(n, e), r = !1);
      }), r) {
        const n = new zl(Zn(), this.manager.scene.scene, {
          mainTextureFixedSize: 1024
        });
        this.manager.scene.scene.meshes.forEach((i) => {
          i instanceof Ee && n.addExcludedMesh(i);
        }), this.glowLayers.set(n.name, n), this.meshesMap.set(n.name, /* @__PURE__ */ new Map()), n.intensity = t.glIntensity, n.blurKernelSize = t.glBlurKernelSize, this.glAttachToMesh(n, e);
      }
    }
  }
  glAttachToMesh(e, t) {
    e.removeExcludedMesh(t), e.referenceMeshToUseItsOwnMaterial(t);
    const r = this.meshesMap.get(e.name);
    r && r.set(t.name, t);
  }
  //监听gl是否还有存在影响的Mesh
  listenMapRemove(e, t) {
    var n;
    const r = this.meshesMap.get(e.name);
    r && r.delete(t.name), (r == null ? void 0 : r.size) < 1 && e.name != "le5le_Gl" && ((n = this.glowLayers.get(e.name)) == null || n.dispose(), this.glowLayers.delete(e.name), this.meshesMap.delete(e.name));
  }
  detachGl(e) {
    this.glowLayers.forEach((t) => {
      t.addExcludedMesh(e), t.unReferenceMeshFromUsingItsOwnMaterial(e), this.listenMapRemove(t, e);
    });
  }
  dispose() {
    this.glowLayers.forEach((e) => {
      e.dispose();
    }), this.glowLayers = null, this.meshesMap = null;
  }
}
const qDe = "cellPixelShader", bDe = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<helperFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;
#endif
#include<clipPlaneFragmentDeclaration>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
vec3 computeCustomDiffuseLighting(lightingInfo info,vec3 diffuseBase,float shadow)
{diffuseBase=info.diffuse*shadow;
#ifdef CELLBASIC
float level=1.0;if (info.ndl<0.5)
level=0.5;diffuseBase.rgb*vec3(level,level,level);
#else
float ToonThresholds[4];ToonThresholds[0]=0.95;ToonThresholds[1]=0.5;ToonThresholds[2]=0.2;ToonThresholds[3]=0.03;float ToonBrightnessLevels[5];ToonBrightnessLevels[0]=1.0;ToonBrightnessLevels[1]=0.8;ToonBrightnessLevels[2]=0.6;ToonBrightnessLevels[3]=0.35;ToonBrightnessLevels[4]=0.2;if (info.ndl>ToonThresholds[0])
{diffuseBase.rgb*=ToonBrightnessLevels[0];}
else if (info.ndl>ToonThresholds[1])
{diffuseBase.rgb*=ToonBrightnessLevels[1];}
else if (info.ndl>ToonThresholds[2])
{diffuseBase.rgb*=ToonBrightnessLevels[2];}
else if (info.ndl>ToonThresholds[3])
{diffuseBase.rgb*=ToonBrightnessLevels[3];}
else
{diffuseBase.rgb*=ToonBrightnessLevels[4];}
#endif
return max(diffuseBase,vec3(0.2));}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;
#ifdef DIFFUSE
baseColor=texture2D(diffuseSampler,vDiffuseUV);
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
#include<depthPrePass>
baseColor.rgb*=vDiffuseInfos.y;
#endif
#ifdef VERTEXCOLOR
baseColor.rgb*=vColor.rgb;
#endif
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(1.0,1.0,1.0);
#endif
lightingInfo info;vec3 diffuseBase=vec3(0.,0.,0.);float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif 
#include<lightFragment>[0..maxSimultaneousLights]
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[qDe] = bDe;
const xDe = "cellVertexShader", DDe = `precision highp float;attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);
#ifdef NORMAL
vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef DIFFUSE
if (vDiffuseInfos.x==0.)
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}
else
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[xDe] = DDe;
class jDe extends na {
  constructor() {
    super(), this.DIFFUSE = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.POINTSIZE = !1, this.FOG = !1, this.NORMAL = !1, this.UV1 = !1, this.UV2 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.INSTANCESCOLOR = !1, this.NDOTL = !0, this.CUSTOMUSERLIGHTING = !0, this.CELLBASIC = !0, this.DEPTHPREPASS = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class xp extends P1 {
  constructor(e, t) {
    super(e, t), this.diffuseColor = new Ne(1, 1, 1), this._computeHighLevel = !1, this._disableLighting = !1, this._maxSimultaneousLights = 4;
  }
  needAlphaBlending() {
    return this.alpha < 1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new jDe());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (n._areTexturesDirty && (n._needUVs = !1, i.texturesEnabled && this._diffuseTexture && Dt.DiffuseTextureEnabled))
      if (this._diffuseTexture.isReady())
        n._needUVs = !0, n.DIFFUSE = !0;
      else
        return !1;
    if (n.CELLBASIC = !this.computeHighLevel, Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), n), n._needNormals = Ye.PrepareDefinesForLights(i, e, n, !1, this._maxSimultaneousLights, this._disableLighting), Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), Ye.PrepareDefinesForAttributes(e, n, !0, !0), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(n, a, this.maxSimultaneousLights), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess;
      const f = [J.PositionKind];
      n.NORMAL && f.push(J.NormalKind), n.UV1 && f.push(J.UVKind), n.UV2 && f.push(J.UV2Kind), n.VERTEXCOLOR && f.push(J.ColorKind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "cell", d = n.toString(), v = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vDiffuseColor",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "vDiffuseInfos",
        "mBones",
        "diffuseMatrix",
        "logarithmicDepthConstant"
      ], u = ["diffuseSampler"], l = [];
      Mf(v), Ye.PrepareUniformsAndSamplersList({
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: n,
        maxSimultaneousLights: this.maxSimultaneousLights
      }), t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: d,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights - 1 }
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), this._mustRebind(n, s) && (this._diffuseTexture && Dt.DiffuseTextureEnabled && (this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture), this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix())), Df(this._activeEffect, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), n.lightsEnabled && !this.disableLighting && Ye.BindLights(n, t, this._activeEffect, i, this._maxSimultaneousLights), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._afterBind(t, this._activeEffect));
  }
  getAnimatables() {
    const e = [];
    return this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0 && e.push(this._diffuseTexture), e;
  }
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._diffuseTexture && e.push(this._diffuseTexture), e;
  }
  hasTexture(e) {
    return super.hasTexture(e) ? !0 : this._diffuseTexture === e;
  }
  dispose(e) {
    this._diffuseTexture && this._diffuseTexture.dispose(), super.dispose(e);
  }
  getClassName() {
    return "CellMaterial";
  }
  clone(e) {
    return jt.Clone(() => new xp(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.CellMaterial", e;
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new xp(e.name, t), e, t, r);
  }
}
C([
  en("diffuseTexture")
], xp.prototype, "_diffuseTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], xp.prototype, "diffuseTexture", void 0);
C([
  Oi("diffuse")
], xp.prototype, "diffuseColor", void 0);
C([
  M("computeHighLevel")
], xp.prototype, "_computeHighLevel", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], xp.prototype, "computeHighLevel", void 0);
C([
  M("disableLighting")
], xp.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], xp.prototype, "disableLighting", void 0);
C([
  M("maxSimultaneousLights")
], xp.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], xp.prototype, "maxSimultaneousLights", void 0);
Ue("BABYLON.CellMaterial", xp);
class wDe {
  constructor() {
  }
}
class PR extends Wt {
  AttachAfterBind(e, t) {
    if (this._newUniformInstances)
      for (const r in this._newUniformInstances) {
        const n = r.toString().split("-");
        n[0] == "vec2" ? t.setVector2(n[1], this._newUniformInstances[r]) : n[0] == "vec3" ? this._newUniformInstances[r] instanceof Ne ? t.setColor3(n[1], this._newUniformInstances[r]) : t.setVector3(n[1], this._newUniformInstances[r]) : n[0] == "vec4" ? (this._newUniformInstances[r] instanceof xt ? t.setDirectColor4(n[1], this._newUniformInstances[r]) : t.setVector4(n[1], this._newUniformInstances[r]), t.setVector4(n[1], this._newUniformInstances[r])) : n[0] == "mat4" ? t.setMatrix(n[1], this._newUniformInstances[r]) : n[0] == "float" && t.setFloat(n[1], this._newUniformInstances[r]);
      }
    if (this._newSamplerInstances)
      for (const r in this._newSamplerInstances) {
        const n = r.toString().split("-");
        n[0] == "sampler2D" && this._newSamplerInstances[r].isReady && this._newSamplerInstances[r].isReady() && t.setTexture(n[1], this._newSamplerInstances[r]);
      }
  }
  ReviewUniform(e, t) {
    if (e == "uniform" && this._newUniforms)
      for (let r = 0; r < this._newUniforms.length; r++)
        this._customUniform[r].indexOf("sampler") == -1 && t.push(this._newUniforms[r].replace(/\[\d*\]/g, ""));
    if (e == "sampler" && this._newUniforms)
      for (let r = 0; r < this._newUniforms.length; r++)
        this._customUniform[r].indexOf("sampler") != -1 && t.push(this._newUniforms[r].replace(/\[\d*\]/g, ""));
    return t;
  }
  Builder(e, t, r, n, i, s) {
    s && this._customAttributes && this._customAttributes.length > 0 && s.push(...this._customAttributes), this.ReviewUniform("uniform", t), this.ReviewUniform("sampler", n);
    const a = this._createdShaderName;
    return An.ShadersStore[a + "VertexShader"] && An.ShadersStore[a + "PixelShader"] || (An.ShadersStore[a + "VertexShader"] = this.VertexShader.replace("#define CUSTOM_VERTEX_BEGIN", this.CustomParts.Vertex_Begin ? this.CustomParts.Vertex_Begin : "").replace("#define CUSTOM_VERTEX_DEFINITIONS", (this._customUniform ? this._customUniform.join(`
`) : "") + (this.CustomParts.Vertex_Definitions ? this.CustomParts.Vertex_Definitions : "")).replace("#define CUSTOM_VERTEX_MAIN_BEGIN", this.CustomParts.Vertex_MainBegin ? this.CustomParts.Vertex_MainBegin : "").replace("#define CUSTOM_VERTEX_UPDATE_POSITION", this.CustomParts.Vertex_Before_PositionUpdated ? this.CustomParts.Vertex_Before_PositionUpdated : "").replace("#define CUSTOM_VERTEX_UPDATE_NORMAL", this.CustomParts.Vertex_Before_NormalUpdated ? this.CustomParts.Vertex_Before_NormalUpdated : "").replace("#define CUSTOM_VERTEX_MAIN_END", this.CustomParts.Vertex_MainEnd ? this.CustomParts.Vertex_MainEnd : ""), this.CustomParts.Vertex_After_WorldPosComputed && (An.ShadersStore[a + "VertexShader"] = An.ShadersStore[a + "VertexShader"].replace("#define CUSTOM_VERTEX_UPDATE_WORLDPOS", this.CustomParts.Vertex_After_WorldPosComputed)), An.ShadersStore[a + "PixelShader"] = this.FragmentShader.replace("#define CUSTOM_FRAGMENT_BEGIN", this.CustomParts.Fragment_Begin ? this.CustomParts.Fragment_Begin : "").replace("#define CUSTOM_FRAGMENT_MAIN_BEGIN", this.CustomParts.Fragment_MainBegin ? this.CustomParts.Fragment_MainBegin : "").replace("#define CUSTOM_FRAGMENT_DEFINITIONS", (this._customUniform ? this._customUniform.join(`
`) : "") + (this.CustomParts.Fragment_Definitions ? this.CustomParts.Fragment_Definitions : "")).replace("#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE", this.CustomParts.Fragment_Custom_Diffuse ? this.CustomParts.Fragment_Custom_Diffuse : "").replace("#define CUSTOM_FRAGMENT_UPDATE_ALPHA", this.CustomParts.Fragment_Custom_Alpha ? this.CustomParts.Fragment_Custom_Alpha : "").replace("#define CUSTOM_FRAGMENT_BEFORE_LIGHTS", this.CustomParts.Fragment_Before_Lights ? this.CustomParts.Fragment_Before_Lights : "").replace("#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR", this.CustomParts.Fragment_Before_FragColor ? this.CustomParts.Fragment_Before_FragColor : "").replace("#define CUSTOM_FRAGMENT_MAIN_END", this.CustomParts.Fragment_MainEnd ? this.CustomParts.Fragment_MainEnd : ""), this.CustomParts.Fragment_Before_Fog && (An.ShadersStore[a + "PixelShader"] = An.ShadersStore[a + "PixelShader"].replace("#define CUSTOM_FRAGMENT_BEFORE_FOG", this.CustomParts.Fragment_Before_Fog))), a;
  }
  constructor(e, t) {
    super(e, t), this.CustomParts = new wDe(), this.customShaderNameResolve = this.Builder, this.FragmentShader = An.ShadersStore.defaultPixelShader, this.VertexShader = An.ShadersStore.defaultVertexShader, PR.ShaderIndexer++, this._createdShaderName = "custom_" + PR.ShaderIndexer;
  }
  _afterBind(e, t = null) {
    if (t) {
      this.AttachAfterBind(e, t);
      try {
        super._afterBind(e, t);
      } catch {
      }
    }
  }
  AddUniform(e, t, r) {
    return this._customUniform || (this._customUniform = new Array(), this._newUniforms = new Array(), this._newSamplerInstances = {}, this._newUniformInstances = {}), r && (t.indexOf("sampler") != -1 ? this._newSamplerInstances[t + "-" + e] = r : this._newUniformInstances[t + "-" + e] = r), this._customUniform.push("uniform " + t + " " + e + ";"), this._newUniforms.push(e), this;
  }
  AddAttribute(e) {
    return this._customAttributes || (this._customAttributes = []), this._customAttributes.push(e), this;
  }
  Fragment_Begin(e) {
    return this.CustomParts.Fragment_Begin = e, this;
  }
  Fragment_Definitions(e) {
    return this.CustomParts.Fragment_Definitions = e, this;
  }
  Fragment_MainBegin(e) {
    return this.CustomParts.Fragment_MainBegin = e, this;
  }
  Fragment_MainEnd(e) {
    return this.CustomParts.Fragment_MainEnd = e, this;
  }
  Fragment_Custom_Diffuse(e) {
    return this.CustomParts.Fragment_Custom_Diffuse = e.replace("result", "diffuseColor"), this;
  }
  Fragment_Custom_Alpha(e) {
    return this.CustomParts.Fragment_Custom_Alpha = e.replace("result", "alpha"), this;
  }
  Fragment_Before_Lights(e) {
    return this.CustomParts.Fragment_Before_Lights = e, this;
  }
  Fragment_Before_Fog(e) {
    return this.CustomParts.Fragment_Before_Fog = e, this;
  }
  Fragment_Before_FragColor(e) {
    return this.CustomParts.Fragment_Before_FragColor = e.replace("result", "color"), this;
  }
  Vertex_Begin(e) {
    return this.CustomParts.Vertex_Begin = e, this;
  }
  Vertex_Definitions(e) {
    return this.CustomParts.Vertex_Definitions = e, this;
  }
  Vertex_MainBegin(e) {
    return this.CustomParts.Vertex_MainBegin = e, this;
  }
  Vertex_Before_PositionUpdated(e) {
    return this.CustomParts.Vertex_Before_PositionUpdated = e.replace("result", "positionUpdated"), this;
  }
  Vertex_Before_NormalUpdated(e) {
    return this.CustomParts.Vertex_Before_NormalUpdated = e.replace("result", "normalUpdated"), this;
  }
  Vertex_After_WorldPosComputed(e) {
    return this.CustomParts.Vertex_After_WorldPosComputed = e, this;
  }
  Vertex_MainEnd(e) {
    return this.CustomParts.Vertex_MainEnd = e, this;
  }
}
PR.ShaderIndexer = 1;
Ue("BABYLON.CustomMaterial", PR);
class mDe {
  constructor() {
  }
}
class cR extends mr {
  AttachAfterBind(e, t) {
    if (this._newUniformInstances)
      for (const r in this._newUniformInstances) {
        const n = r.toString().split("-");
        n[0] == "vec2" ? t.setVector2(n[1], this._newUniformInstances[r]) : n[0] == "vec3" ? this._newUniformInstances[r] instanceof Ne ? t.setColor3(n[1], this._newUniformInstances[r]) : t.setVector3(n[1], this._newUniformInstances[r]) : n[0] == "vec4" ? (this._newUniformInstances[r] instanceof xt ? t.setDirectColor4(n[1], this._newUniformInstances[r]) : t.setVector4(n[1], this._newUniformInstances[r]), t.setVector4(n[1], this._newUniformInstances[r])) : n[0] == "mat4" ? t.setMatrix(n[1], this._newUniformInstances[r]) : n[0] == "float" && t.setFloat(n[1], this._newUniformInstances[r]);
      }
    if (this._newSamplerInstances)
      for (const r in this._newSamplerInstances) {
        const n = r.toString().split("-");
        n[0] == "sampler2D" && this._newSamplerInstances[r].isReady && this._newSamplerInstances[r].isReady() && t.setTexture(n[1], this._newSamplerInstances[r]);
      }
  }
  ReviewUniform(e, t) {
    if (e == "uniform" && this._newUniforms)
      for (let r = 0; r < this._newUniforms.length; r++)
        this._customUniform[r].indexOf("sampler") == -1 && t.push(this._newUniforms[r].replace(/\[\d*\]/g, ""));
    if (e == "sampler" && this._newUniforms)
      for (let r = 0; r < this._newUniforms.length; r++)
        this._customUniform[r].indexOf("sampler") != -1 && t.push(this._newUniforms[r].replace(/\[\d*\]/g, ""));
    return t;
  }
  Builder(e, t, r, n, i, s, a) {
    if (a) {
      const o = a.processFinalCode;
      a.processFinalCode = (d, v) => {
        if (d === "vertex")
          return o ? o(d, v) : v;
        const u = new Aq(v);
        return u.inlineToken = "#define pbr_inline", u.processCode(), o ? o(d, u.code) : u.code;
      };
    }
    s && this._customAttributes && this._customAttributes.length > 0 && s.push(...this._customAttributes), this.ReviewUniform("uniform", t), this.ReviewUniform("sampler", n);
    const f = this._createdShaderName;
    return An.ShadersStore[f + "VertexShader"] && An.ShadersStore[f + "PixelShader"] || (An.ShadersStore[f + "VertexShader"] = this.VertexShader.replace("#define CUSTOM_VERTEX_BEGIN", this.CustomParts.Vertex_Begin ? this.CustomParts.Vertex_Begin : "").replace("#define CUSTOM_VERTEX_DEFINITIONS", (this._customUniform ? this._customUniform.join(`
`) : "") + (this.CustomParts.Vertex_Definitions ? this.CustomParts.Vertex_Definitions : "")).replace("#define CUSTOM_VERTEX_MAIN_BEGIN", this.CustomParts.Vertex_MainBegin ? this.CustomParts.Vertex_MainBegin : "").replace("#define CUSTOM_VERTEX_UPDATE_POSITION", this.CustomParts.Vertex_Before_PositionUpdated ? this.CustomParts.Vertex_Before_PositionUpdated : "").replace("#define CUSTOM_VERTEX_UPDATE_NORMAL", this.CustomParts.Vertex_Before_NormalUpdated ? this.CustomParts.Vertex_Before_NormalUpdated : "").replace("#define CUSTOM_VERTEX_MAIN_END", this.CustomParts.Vertex_MainEnd ? this.CustomParts.Vertex_MainEnd : ""), this.CustomParts.Vertex_After_WorldPosComputed && (An.ShadersStore[f + "VertexShader"] = An.ShadersStore[f + "VertexShader"].replace("#define CUSTOM_VERTEX_UPDATE_WORLDPOS", this.CustomParts.Vertex_After_WorldPosComputed)), An.ShadersStore[f + "PixelShader"] = this.FragmentShader.replace("#define CUSTOM_FRAGMENT_BEGIN", this.CustomParts.Fragment_Begin ? this.CustomParts.Fragment_Begin : "").replace("#define CUSTOM_FRAGMENT_MAIN_BEGIN", this.CustomParts.Fragment_MainBegin ? this.CustomParts.Fragment_MainBegin : "").replace("#define CUSTOM_FRAGMENT_DEFINITIONS", (this._customUniform ? this._customUniform.join(`
`) : "") + (this.CustomParts.Fragment_Definitions ? this.CustomParts.Fragment_Definitions : "")).replace("#define CUSTOM_FRAGMENT_UPDATE_ALBEDO", this.CustomParts.Fragment_Custom_Albedo ? this.CustomParts.Fragment_Custom_Albedo : "").replace("#define CUSTOM_FRAGMENT_UPDATE_ALPHA", this.CustomParts.Fragment_Custom_Alpha ? this.CustomParts.Fragment_Custom_Alpha : "").replace("#define CUSTOM_FRAGMENT_BEFORE_LIGHTS", this.CustomParts.Fragment_Before_Lights ? this.CustomParts.Fragment_Before_Lights : "").replace("#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS", this.CustomParts.Fragment_Custom_MetallicRoughness ? this.CustomParts.Fragment_Custom_MetallicRoughness : "").replace("#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE", this.CustomParts.Fragment_Custom_MicroSurface ? this.CustomParts.Fragment_Custom_MicroSurface : "").replace("#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION", this.CustomParts.Fragment_Before_FinalColorComposition ? this.CustomParts.Fragment_Before_FinalColorComposition : "").replace("#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR", this.CustomParts.Fragment_Before_FragColor ? this.CustomParts.Fragment_Before_FragColor : "").replace("#define CUSTOM_FRAGMENT_MAIN_END", this.CustomParts.Fragment_MainEnd ? this.CustomParts.Fragment_MainEnd : ""), this.CustomParts.Fragment_Before_Fog && (An.ShadersStore[f + "PixelShader"] = An.ShadersStore[f + "PixelShader"].replace("#define CUSTOM_FRAGMENT_BEFORE_FOG", this.CustomParts.Fragment_Before_Fog))), f;
  }
  constructor(e, t) {
    super(e, t), this.CustomParts = new mDe(), this.customShaderNameResolve = this.Builder, this.FragmentShader = An.ShadersStore.pbrPixelShader, this.VertexShader = An.ShadersStore.pbrVertexShader, this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockAlbedoOpacity>/g, An.IncludesShadersStore.pbrBlockAlbedoOpacity), this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockReflectivity>/g, An.IncludesShadersStore.pbrBlockReflectivity), this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockFinalColorComposition>/g, An.IncludesShadersStore.pbrBlockFinalColorComposition), cR.ShaderIndexer++, this._createdShaderName = "custompbr_" + cR.ShaderIndexer;
  }
  _afterBind(e, t = null) {
    if (t) {
      this.AttachAfterBind(e, t);
      try {
        super._afterBind(e, t);
      } catch {
      }
    }
  }
  AddUniform(e, t, r) {
    return this._customUniform || (this._customUniform = new Array(), this._newUniforms = new Array(), this._newSamplerInstances = {}, this._newUniformInstances = {}), r && (t.indexOf("sampler") != -1 ? this._newSamplerInstances[t + "-" + e] = r : this._newUniformInstances[t + "-" + e] = r), this._customUniform.push("uniform " + t + " " + e + ";"), this._newUniforms.push(e), this;
  }
  AddAttribute(e) {
    return this._customAttributes || (this._customAttributes = []), this._customAttributes.push(e), this;
  }
  Fragment_Begin(e) {
    return this.CustomParts.Fragment_Begin = e, this;
  }
  Fragment_Definitions(e) {
    return this.CustomParts.Fragment_Definitions = e, this;
  }
  Fragment_MainBegin(e) {
    return this.CustomParts.Fragment_MainBegin = e, this;
  }
  Fragment_Custom_Albedo(e) {
    return this.CustomParts.Fragment_Custom_Albedo = e.replace("result", "surfaceAlbedo"), this;
  }
  Fragment_Custom_Alpha(e) {
    return this.CustomParts.Fragment_Custom_Alpha = e.replace("result", "alpha"), this;
  }
  Fragment_Before_Lights(e) {
    return this.CustomParts.Fragment_Before_Lights = e, this;
  }
  Fragment_Custom_MetallicRoughness(e) {
    return this.CustomParts.Fragment_Custom_MetallicRoughness = e, this;
  }
  Fragment_Custom_MicroSurface(e) {
    return this.CustomParts.Fragment_Custom_MicroSurface = e, this;
  }
  Fragment_Before_Fog(e) {
    return this.CustomParts.Fragment_Before_Fog = e, this;
  }
  Fragment_Before_FinalColorComposition(e) {
    return this.CustomParts.Fragment_Before_FinalColorComposition = e, this;
  }
  Fragment_Before_FragColor(e) {
    return this.CustomParts.Fragment_Before_FragColor = e.replace("result", "color"), this;
  }
  Fragment_MainEnd(e) {
    return this.CustomParts.Fragment_MainEnd = e, this;
  }
  Vertex_Begin(e) {
    return this.CustomParts.Vertex_Begin = e, this;
  }
  Vertex_Definitions(e) {
    return this.CustomParts.Vertex_Definitions = e, this;
  }
  Vertex_MainBegin(e) {
    return this.CustomParts.Vertex_MainBegin = e, this;
  }
  Vertex_Before_PositionUpdated(e) {
    return this.CustomParts.Vertex_Before_PositionUpdated = e.replace("result", "positionUpdated"), this;
  }
  Vertex_Before_NormalUpdated(e) {
    return this.CustomParts.Vertex_Before_NormalUpdated = e.replace("result", "normalUpdated"), this;
  }
  Vertex_After_WorldPosComputed(e) {
    return this.CustomParts.Vertex_After_WorldPosComputed = e, this;
  }
  Vertex_MainEnd(e) {
    return this.CustomParts.Vertex_MainEnd = e, this;
  }
}
cR.ShaderIndexer = 1;
Ue("BABYLON.PBRCustomMaterial", cR);
const BDe = "firePixelShader", WDe = `precision highp float;uniform vec4 vEyePosition;varying vec3 vPositionW;
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;
#endif
uniform sampler2D distortionSampler;uniform sampler2D opacitySampler;
#ifdef DIFFUSE
varying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3;
#endif
#include<clipPlaneFragmentDeclaration>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
vec4 bx2(vec4 x)
{return vec4(2.0)*x-vec4(1.0);}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);float alpha=1.0;
#ifdef DIFFUSE
const float distortionAmount0 =0.092;const float distortionAmount1 =0.092;const float distortionAmount2 =0.092;vec2 heightAttenuation=vec2(0.3,0.39);vec4 noise0=texture2D(distortionSampler,vDistortionCoords1);vec4 noise1=texture2D(distortionSampler,vDistortionCoords2);vec4 noise2=texture2D(distortionSampler,vDistortionCoords3);vec4 noiseSum=bx2(noise0)*distortionAmount0+bx2(noise1)*distortionAmount1+bx2(noise2)*distortionAmount2;vec4 perturbedBaseCoords=vec4(vDiffuseUV,0.0,1.0)+noiseSum*(vDiffuseUV.y*heightAttenuation.x+heightAttenuation.y);vec4 opacityColor=texture2D(opacitySampler,perturbedBaseCoords.xy);
#ifdef ALPHATEST
if (opacityColor.r<0.1)
discard;
#endif
#include<depthPrePass>
baseColor=texture2D(diffuseSampler,perturbedBaseCoords.xy)*2.0;baseColor*=opacityColor;baseColor.rgb*=vDiffuseInfos.y;
#endif
#ifdef VERTEXCOLOR
baseColor.rgb*=vColor.rgb;
#endif
vec3 diffuseBase=vec3(1.0,1.0,1.0);
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
vec4 color=vec4(baseColor.rgb,alpha);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[BDe] = WDe;
const SDe = "fireVertexShader", UDe = `precision highp float;attribute vec3 position;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef DIFFUSE
varying vec2 vDiffuseUV;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
uniform float time;uniform float speed;
#ifdef DIFFUSE
varying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);
#ifdef DIFFUSE
vDiffuseUV=uv;vDiffuseUV.y-=0.2;
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
#include<fogVertex>
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#ifdef DIFFUSE
vec3 layerSpeed=vec3(-0.2,-0.52,-0.1)*speed;vDistortionCoords1.x=uv.x;vDistortionCoords1.y=uv.y+layerSpeed.x*time/1000.0;vDistortionCoords2.x=uv.x;vDistortionCoords2.y=uv.y+layerSpeed.y*time/1000.0;vDistortionCoords3.x=uv.x;vDistortionCoords3.y=uv.y+layerSpeed.z*time/1000.0;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[SDe] = UDe;
class IDe extends na {
  constructor() {
    super(), this.DIFFUSE = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.POINTSIZE = !1, this.FOG = !1, this.UV1 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.BonesPerMesh = 0, this.NUM_BONE_INFLUENCERS = 0, this.INSTANCES = !1, this.INSTANCESCOLOR = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class Q0 extends P1 {
  constructor(e, t) {
    super(e, t), this.diffuseColor = new Ne(1, 1, 1), this.speed = 1, this._scaledDiffuse = new Ne(), this._lastTime = 0;
  }
  needAlphaBlending() {
    return !1;
  }
  needAlphaTesting() {
    return !0;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new IDe());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (n._areTexturesDirty && (n._needUVs = !1, this._diffuseTexture && Dt.DiffuseTextureEnabled))
      if (this._diffuseTexture.isReady())
        n._needUVs = !0, n.DIFFUSE = !0;
      else
        return !1;
    if (n.ALPHATEST = !!this._opacityTexture, n._areMiscDirty && (n.POINTSIZE = this.pointsCloud || i.forcePointsCloud, n.FOG = i.fogEnabled && e.applyFog && i.fogMode !== sr.FOGMODE_NONE && this.fogEnabled, n.LOGARITHMICDEPTH = this._useLogarithmicDepth), Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), Ye.PrepareDefinesForAttributes(e, n, !1, !0), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess;
      const f = [J.PositionKind];
      n.UV1 && f.push(J.UVKind), n.VERTEXCOLOR && f.push(J.ColorKind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "fire", d = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "vDiffuseInfos",
        "mBones",
        "diffuseMatrix",
        "logarithmicDepthConstant",
        // Fire
        "time",
        "speed"
      ];
      Mf(d);
      const v = n.toString();
      t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: d,
        uniformBuffersNames: [],
        samplers: [
          "diffuseSampler",
          // Fire
          "distortionSampler",
          "opacitySampler"
        ],
        defines: v,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: null,
        maxSimultaneousLights: 4,
        transformFeedbackVaryings: null
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), this._mustRebind(n, s) && (this._diffuseTexture && Dt.DiffuseTextureEnabled && (this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture), this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix()), this._activeEffect.setTexture("distortionSampler", this._distortionTexture), this._activeEffect.setTexture("opacitySampler", this._opacityTexture)), Df(this._activeEffect, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this._scaledDiffuse, this.alpha * t.visibility), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._lastTime += n.getEngine().getDeltaTime(), this._activeEffect.setFloat("time", this._lastTime), this._activeEffect.setFloat("speed", this.speed), this._afterBind(t, this._activeEffect));
  }
  getAnimatables() {
    const e = [];
    return this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0 && e.push(this._diffuseTexture), this._distortionTexture && this._distortionTexture.animations && this._distortionTexture.animations.length > 0 && e.push(this._distortionTexture), this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0 && e.push(this._opacityTexture), e;
  }
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._diffuseTexture && e.push(this._diffuseTexture), this._distortionTexture && e.push(this._distortionTexture), this._opacityTexture && e.push(this._opacityTexture), e;
  }
  hasTexture(e) {
    return !!(super.hasTexture(e) || this._diffuseTexture === e || this._distortionTexture === e || this._opacityTexture === e);
  }
  getClassName() {
    return "FireMaterial";
  }
  dispose(e) {
    this._diffuseTexture && this._diffuseTexture.dispose(), this._distortionTexture && this._distortionTexture.dispose(), super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new Q0(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.FireMaterial", e.diffuseColor = this.diffuseColor.asArray(), e.speed = this.speed, this._diffuseTexture && (e._diffuseTexture = this._diffuseTexture.serialize()), this._distortionTexture && (e._distortionTexture = this._distortionTexture.serialize()), this._opacityTexture && (e._opacityTexture = this._opacityTexture.serialize()), e;
  }
  static Parse(e, t, r) {
    const n = new Q0(e.name, t);
    return n.diffuseColor = Ne.FromArray(e.diffuseColor), n.speed = e.speed, n.alpha = e.alpha, n.id = e.id, Zi.AddTagsTo(n, e.tags), n.backFaceCulling = e.backFaceCulling, n.wireframe = e.wireframe, e._diffuseTexture && (n._diffuseTexture = We.Parse(e._diffuseTexture, t, r)), e._distortionTexture && (n._distortionTexture = We.Parse(e._distortionTexture, t, r)), e._opacityTexture && (n._opacityTexture = We.Parse(e._opacityTexture, t, r)), n;
  }
}
C([
  en("diffuseTexture")
], Q0.prototype, "_diffuseTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Q0.prototype, "diffuseTexture", void 0);
C([
  en("distortionTexture")
], Q0.prototype, "_distortionTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Q0.prototype, "distortionTexture", void 0);
C([
  en("opacityTexture")
], Q0.prototype, "_opacityTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Q0.prototype, "opacityTexture", void 0);
C([
  Oi("diffuse")
], Q0.prototype, "diffuseColor", void 0);
C([
  M()
], Q0.prototype, "speed", void 0);
Ue("BABYLON.FireMaterial", Q0);
const RDe = "furPixelShader", VDe = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;uniform vec4 furColor;uniform float furLength;varying vec3 vPositionW;varying float vfur_length;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<helperFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;
#endif
#ifdef HIGHLEVEL
uniform float furOffset;uniform float furOcclusion;uniform sampler2D furTexture;varying vec2 vFurUV;
#endif
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<fogFragmentDeclaration>
#include<clipPlaneFragmentDeclaration>
float Rand(vec3 rv) {float x=dot(rv,vec3(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=furColor;vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;
#ifdef DIFFUSE
baseColor*=texture2D(diffuseSampler,vDiffuseUV);
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
#include<depthPrePass>
baseColor.rgb*=vDiffuseInfos.y;
#endif
#ifdef VERTEXCOLOR
baseColor.rgb*=vColor.rgb;
#endif
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(1.0,1.0,1.0);
#endif
#ifdef HIGHLEVEL
vec4 furTextureColor=texture2D(furTexture,vec2(vFurUV.x,vFurUV.y));if (furTextureColor.a<=0.0 || furTextureColor.g<furOffset) {discard;}
float occlusion=mix(0.0,furTextureColor.b*1.2,furOffset);baseColor=vec4(baseColor.xyz*max(occlusion,furOcclusion),1.1-furOffset);
#endif
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
#include<lightFragment>[0..maxSimultaneousLights]
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
vec3 finalDiffuse=clamp(diffuseBase.rgb*baseColor.rgb,0.0,1.0);
#ifdef HIGHLEVEL
vec4 color=vec4(finalDiffuse,alpha);
#else
float r=vfur_length/furLength*0.5;vec4 color=vec4(finalDiffuse*(0.5+r),alpha);
#endif
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[RDe] = VDe;
const CDe = "furVertexShader", ODe = `precision highp float;attribute vec3 position;attribute vec3 normal;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
uniform float furLength;uniform float furAngle;
#ifdef HIGHLEVEL
uniform float furOffset;uniform vec3 furGravity;uniform float furTime;uniform float furSpacing;uniform float furDensity;
#endif
#ifdef HEIGHTMAP
uniform sampler2D heightTexture;
#endif
#ifdef HIGHLEVEL
varying vec2 vFurUV;
#endif
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
varying float vfur_length;
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
float Rand(vec3 rv) {float x=dot(rv,vec3(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
float r=Rand(position);
#ifdef HEIGHTMAP
#if __VERSION__>100
vfur_length=furLength*texture(heightTexture,uv).x;
#else
vfur_length=furLength*texture2D(heightTexture,uv).r;
#endif
#else 
vfur_length=(furLength*r);
#endif
vec3 tangent1=vec3(normal.y,-normal.x,0);vec3 tangent2=vec3(-normal.z,0,normal.x);r=Rand(tangent1*r);float J=(2.0+4.0*r);r=Rand(tangent2*r);float K=(2.0+2.0*r);tangent1=tangent1*J+tangent2*K;tangent1=normalize(tangent1);vec3 newPosition=position+normal*vfur_length*cos(furAngle)+tangent1*vfur_length*sin(furAngle);
#ifdef HIGHLEVEL
vec3 forceDirection=vec3(0.0,0.0,0.0);forceDirection.x=sin(furTime+position.x*0.05)*0.2;forceDirection.y=cos(furTime*0.7+position.y*0.04)*0.2;forceDirection.z=sin(furTime*0.7+position.z*0.04)*0.2;vec3 displacement=vec3(0.0,0.0,0.0);displacement=furGravity+forceDirection;float displacementFactor=pow(furOffset,3.0);vec3 aNormal=normal;aNormal.xyz+=displacement*displacementFactor;newPosition=vec3(newPosition.x,newPosition.y,newPosition.z)+(normalize(aNormal)*furOffset*furSpacing);
#endif
#ifdef NORMAL
vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));
#endif
gl_Position=viewProjection*finalWorld*vec4(newPosition,1.0);vec4 worldPos=finalWorld*vec4(newPosition,1.0);vPositionW=vec3(worldPos);
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef DIFFUSE
if (vDiffuseInfos.x==0.)
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}
else
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}
#ifdef HIGHLEVEL
vFurUV=vDiffuseUV*furDensity;
#endif
#else
#ifdef HIGHLEVEL
vFurUV=uv*furDensity;
#endif
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[CDe] = ODe;
class yDe extends na {
  constructor() {
    super(), this.DIFFUSE = !1, this.HEIGHTMAP = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.POINTSIZE = !1, this.FOG = !1, this.NORMAL = !1, this.UV1 = !1, this.UV2 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.INSTANCESCOLOR = !1, this.HIGHLEVEL = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class x1 extends P1 {
  constructor(e, t) {
    super(e, t), this.diffuseColor = new Ne(1, 1, 1), this.furLength = 1, this.furAngle = 0, this.furColor = new Ne(0.44, 0.21, 0.02), this.furOffset = 0, this.furSpacing = 12, this.furGravity = new S(0, 0, 0), this.furSpeed = 100, this.furDensity = 20, this.furOcclusion = 0, this._disableLighting = !1, this._maxSimultaneousLights = 4, this.highLevelFur = !0, this._furTime = 0;
  }
  get furTime() {
    return this._furTime;
  }
  set furTime(e) {
    this._furTime = e;
  }
  needAlphaBlending() {
    return this.alpha < 1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  updateFur() {
    for (let e = 1; e < this._meshes.length; e++) {
      const t = this._meshes[e].material;
      t.furLength = this.furLength, t.furAngle = this.furAngle, t.furGravity = this.furGravity, t.furSpacing = this.furSpacing, t.furSpeed = this.furSpeed, t.furColor = this.furColor, t.diffuseTexture = this.diffuseTexture, t.furTexture = this.furTexture, t.highLevelFur = this.highLevelFur, t.furTime = this.furTime, t.furDensity = this.furDensity;
    }
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new yDe());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (n._areTexturesDirty && i.texturesEnabled) {
      if (this.diffuseTexture && Dt.DiffuseTextureEnabled)
        if (this.diffuseTexture.isReady())
          n._needUVs = !0, n.DIFFUSE = !0;
        else
          return !1;
      if (this.heightTexture && s.getCaps().maxVertexTextureImageUnits)
        if (this.heightTexture.isReady())
          n._needUVs = !0, n.HEIGHTMAP = !0;
        else
          return !1;
    }
    if (this.highLevelFur !== n.HIGHLEVEL && (n.HIGHLEVEL = !0, n.markAsUnprocessed()), Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), n), n._needNormals = Ye.PrepareDefinesForLights(i, e, n, !1, this._maxSimultaneousLights, this._disableLighting), Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), Ye.PrepareDefinesForAttributes(e, n, !0, !0), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(n, a, this.maxSimultaneousLights), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess;
      const f = [J.PositionKind];
      n.NORMAL && f.push(J.NormalKind), n.UV1 && f.push(J.UVKind), n.UV2 && f.push(J.UV2Kind), n.VERTEXCOLOR && f.push(J.ColorKind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "fur", d = n.toString(), v = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vDiffuseColor",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "vDiffuseInfos",
        "mBones",
        "diffuseMatrix",
        "logarithmicDepthConstant",
        "furLength",
        "furAngle",
        "furColor",
        "furOffset",
        "furGravity",
        "furTime",
        "furSpacing",
        "furDensity",
        "furOcclusion"
      ];
      Mf(v);
      const u = ["diffuseSampler", "heightTexture", "furTexture"], l = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: n,
        maxSimultaneousLights: this.maxSimultaneousLights
      }), t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: d,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), n.getCachedMaterial() !== this && (this._diffuseTexture && Dt.DiffuseTextureEnabled && (this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture), this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix())), this._heightTexture && this._activeEffect.setTexture("heightTexture", this._heightTexture), Df(this._activeEffect, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), n.lightsEnabled && !this.disableLighting && Ye.BindLights(n, t, this._activeEffect, i, this.maxSimultaneousLights), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._activeEffect.setFloat("furLength", this.furLength), this._activeEffect.setFloat("furAngle", this.furAngle), this._activeEffect.setColor4("furColor", this.furColor, 1), this.highLevelFur && (this._activeEffect.setVector3("furGravity", this.furGravity), this._activeEffect.setFloat("furOffset", this.furOffset), this._activeEffect.setFloat("furSpacing", this.furSpacing), this._activeEffect.setFloat("furDensity", this.furDensity), this._activeEffect.setFloat("furOcclusion", this.furOcclusion), this._furTime += this.getScene().getEngine().getDeltaTime() / this.furSpeed, this._activeEffect.setFloat("furTime", this._furTime), this._activeEffect.setTexture("furTexture", this.furTexture)), this._afterBind(t, this._activeEffect));
  }
  getAnimatables() {
    const e = [];
    return this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0 && e.push(this.diffuseTexture), this.heightTexture && this.heightTexture.animations && this.heightTexture.animations.length > 0 && e.push(this.heightTexture), e;
  }
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._diffuseTexture && e.push(this._diffuseTexture), this._heightTexture && e.push(this._heightTexture), e;
  }
  hasTexture(e) {
    return !!(super.hasTexture(e) || this.diffuseTexture === e || this._heightTexture === e);
  }
  dispose(e) {
    if (this.diffuseTexture && this.diffuseTexture.dispose(), this._meshes)
      for (let t = 1; t < this._meshes.length; t++) {
        const r = this._meshes[t].material;
        r && r.dispose(e), this._meshes[t].dispose();
      }
    super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new x1(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.FurMaterial", this._meshes && (e.sourceMeshName = this._meshes[0].name, e.quality = this._meshes.length), e;
  }
  getClassName() {
    return "FurMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    const n = jt.Parse(() => new x1(e.name, t), e, t, r);
    return e.sourceMeshName && n.highLevelFur && t.executeWhenReady(() => {
      const i = t.getMeshByName(e.sourceMeshName);
      if (i) {
        const s = x1.GenerateTexture("Fur Texture", t);
        n.furTexture = s, x1.FurifyMesh(i, e.quality);
      }
    }), n;
  }
  static GenerateTexture(e, t) {
    const r = new Xp("FurTexture " + e, 256, t, !0), n = r.getContext();
    for (let i = 0; i < 2e4; ++i)
      n.fillStyle = "rgba(255, " + Math.floor(Math.random() * 255) + ", " + Math.floor(Math.random() * 255) + ", 1)", n.fillRect(Math.random() * r.getSize().width, Math.random() * r.getSize().height, 2, 2);
    return r.update(!1), r.wrapU = We.WRAP_ADDRESSMODE, r.wrapV = We.WRAP_ADDRESSMODE, r;
  }
  // Creates and returns an array of meshes used as shells for the Fur Material
  // that can be disposed later in your code
  // The quality is in interval [0, 100]
  static FurifyMesh(e, t) {
    const r = [e], n = e.material;
    let i;
    if (!(n instanceof x1))
      throw "The material of the source mesh must be a Fur Material";
    for (i = 1; i < t; i++) {
      const s = new x1(n.name + i, e.getScene());
      e.getScene().materials.pop(), Zi.EnableFor(s), Zi.AddTagsTo(s, "furShellMaterial"), s.furLength = n.furLength, s.furAngle = n.furAngle, s.furGravity = n.furGravity, s.furSpacing = n.furSpacing, s.furSpeed = n.furSpeed, s.furColor = n.furColor, s.diffuseTexture = n.diffuseTexture, s.furOffset = i / t, s.furTexture = n.furTexture, s.highLevelFur = n.highLevelFur, s.furTime = n.furTime, s.furDensity = n.furDensity;
      const a = e.clone(e.name + i);
      a.material = s, a.skeleton = e.skeleton, a.position = S.Zero(), r.push(a);
    }
    for (i = 1; i < r.length; i++)
      r[i].parent = e;
    return e.material._meshes = r, r;
  }
}
C([
  en("diffuseTexture")
], x1.prototype, "_diffuseTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], x1.prototype, "diffuseTexture", void 0);
C([
  en("heightTexture")
], x1.prototype, "_heightTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], x1.prototype, "heightTexture", void 0);
C([
  Oi()
], x1.prototype, "diffuseColor", void 0);
C([
  M()
], x1.prototype, "furLength", void 0);
C([
  M()
], x1.prototype, "furAngle", void 0);
C([
  Oi()
], x1.prototype, "furColor", void 0);
C([
  M()
], x1.prototype, "furOffset", void 0);
C([
  M()
], x1.prototype, "furSpacing", void 0);
C([
  fo()
], x1.prototype, "furGravity", void 0);
C([
  M()
], x1.prototype, "furSpeed", void 0);
C([
  M()
], x1.prototype, "furDensity", void 0);
C([
  M()
], x1.prototype, "furOcclusion", void 0);
C([
  M("disableLighting")
], x1.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], x1.prototype, "disableLighting", void 0);
C([
  M("maxSimultaneousLights")
], x1.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], x1.prototype, "maxSimultaneousLights", void 0);
C([
  M()
], x1.prototype, "highLevelFur", void 0);
C([
  M()
], x1.prototype, "furTime", null);
Ue("BABYLON.FurMaterial", x1);
const kDe = "gradientPixelShader", EDe = `precision highp float;uniform vec4 vEyePosition;uniform vec4 topColor;uniform vec4 bottomColor;uniform float offset;uniform float scale;uniform float smoothness;varying vec3 vPositionW;varying vec3 vPosition;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<helperFunctions>
#include<__decl__lightFragment>[0]
#include<__decl__lightFragment>[1]
#include<__decl__lightFragment>[2]
#include<__decl__lightFragment>[3]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<clipPlaneFragmentDeclaration>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);float h=vPosition.y*scale+offset;float mysmoothness=clamp(smoothness,0.01,max(smoothness,10.));vec4 baseColor=mix(bottomColor,topColor,max(pow(max(h,0.0),mysmoothness),0.0));vec3 diffuseColor=baseColor.rgb;float alpha=baseColor.a;
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
#include<depthPrePass>
#ifdef VERTEXCOLOR
baseColor.rgb*=vColor.rgb;
#endif
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(1.0,1.0,1.0);
#endif
#ifdef EMISSIVE
vec3 diffuseBase=baseColor.rgb;
#else
vec3 diffuseBase=vec3(0.,0.,0.);
#endif
lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;
#include<lightFragment>[0..maxSimultaneousLights]
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[kDe] = EDe;
const FDe = "gradientVertexShader", NDe = `precision highp float;attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;varying vec3 vPosition;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);vPosition=position;
#ifdef NORMAL
vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[FDe] = NDe;
class QDe extends na {
  constructor() {
    super(), this.EMISSIVE = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.POINTSIZE = !1, this.FOG = !1, this.NORMAL = !1, this.UV1 = !1, this.UV2 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.INSTANCESCOLOR = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class Kd extends P1 {
  constructor(e, t) {
    super(e, t), this._maxSimultaneousLights = 4, this.topColor = new Ne(1, 0, 0), this.topColorAlpha = 1, this.bottomColor = new Ne(0, 0, 1), this.bottomColorAlpha = 1, this.offset = 0, this.scale = 1, this.smoothness = 1, this._disableLighting = !1;
  }
  needAlphaBlending() {
    return this.alpha < 1 || this.topColorAlpha < 1 || this.bottomColorAlpha < 1;
  }
  needAlphaTesting() {
    return !0;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new QDe());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), n), n._needNormals = Ye.PrepareDefinesForLights(i, e, n, !1, this._maxSimultaneousLights, this._disableLighting), n.EMISSIVE = this._disableLighting, Ye.PrepareDefinesForAttributes(e, n, !1, !0), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(n, a), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess;
      const f = [J.PositionKind];
      n.NORMAL && f.push(J.NormalKind), n.UV1 && f.push(J.UVKind), n.UV2 && f.push(J.UV2Kind), n.VERTEXCOLOR && f.push(J.ColorKind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "gradient", d = n.toString(), v = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "mBones",
        "logarithmicDepthConstant",
        "topColor",
        "bottomColor",
        "offset",
        "smoothness",
        "scale"
      ];
      Mf(v);
      const u = [], l = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: n,
        maxSimultaneousLights: 4
      }), t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: d,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, s), this._mustRebind(n, s) && (Df(s, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), n.lightsEnabled && !this.disableLighting && Ye.BindLights(n, t, this._activeEffect, i, this.maxSimultaneousLights), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._activeEffect.setColor4("topColor", this.topColor, this.topColorAlpha), this._activeEffect.setColor4("bottomColor", this.bottomColor, this.bottomColorAlpha), this._activeEffect.setFloat("offset", this.offset), this._activeEffect.setFloat("scale", this.scale), this._activeEffect.setFloat("smoothness", this.smoothness), this._afterBind(t, this._activeEffect));
  }
  getAnimatables() {
    return [];
  }
  dispose(e) {
    super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new Kd(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.GradientMaterial", e;
  }
  getClassName() {
    return "GradientMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new Kd(e.name, t), e, t, r);
  }
}
C([
  M("maxSimultaneousLights")
], Kd.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Kd.prototype, "maxSimultaneousLights", void 0);
C([
  Oi()
], Kd.prototype, "topColor", void 0);
C([
  M()
], Kd.prototype, "topColorAlpha", void 0);
C([
  Oi()
], Kd.prototype, "bottomColor", void 0);
C([
  M()
], Kd.prototype, "bottomColorAlpha", void 0);
C([
  M()
], Kd.prototype, "offset", void 0);
C([
  M()
], Kd.prototype, "scale", void 0);
C([
  M()
], Kd.prototype, "smoothness", void 0);
C([
  M("disableLighting")
], Kd.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Kd.prototype, "disableLighting", void 0);
Ue("BABYLON.GradientMaterial", Kd);
const YDe = "gridPixelShader", MDe = `#extension GL_OES_standard_derivatives : enable
#define SQRT2 1.41421356
#define PI 3.14159
precision highp float;uniform float visibility;uniform vec3 mainColor;uniform vec3 lineColor;uniform vec4 gridControl;uniform vec3 gridOffset;varying vec3 vPosition;varying vec3 vNormal;
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#ifdef OPACITY
varying vec2 vOpacityUV;uniform sampler2D opacitySampler;uniform vec2 vOpacityInfos;
#endif
float getDynamicVisibility(float position) {float majorGridFrequency=gridControl.y;if (floor(position+0.5)==floor(position/majorGridFrequency+0.5)*majorGridFrequency)
{return 1.0;}
return gridControl.z;}
float getAnisotropicAttenuation(float differentialLength) {const float maxNumberOfLines=10.0;return clamp(1.0/(differentialLength+1.0)-1.0/maxNumberOfLines,0.0,1.0);}
float isPointOnLine(float position,float differentialLength) {float fractionPartOfPosition=position-floor(position+0.5); 
fractionPartOfPosition/=differentialLength; 
#ifdef ANTIALIAS
fractionPartOfPosition=clamp(fractionPartOfPosition,-1.,1.);float result=0.5+0.5*cos(fractionPartOfPosition*PI); 
return result;
#else
return abs(fractionPartOfPosition)<SQRT2/4. ? 1. : 0.;
#endif
}
float contributionOnAxis(float position) {float differentialLength=length(vec2(dFdx(position),dFdy(position)));differentialLength*=SQRT2; 
float result=isPointOnLine(position,differentialLength);float dynamicVisibility=getDynamicVisibility(position);result*=dynamicVisibility;float anisotropicAttenuation=getAnisotropicAttenuation(differentialLength);result*=anisotropicAttenuation;return result;}
float normalImpactOnAxis(float x) {float normalImpact=clamp(1.0-3.0*abs(x*x*x),0.0,1.0);return normalImpact;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
float gridRatio=gridControl.x;vec3 gridPos=(vPosition+gridOffset.xyz)/gridRatio;float x=contributionOnAxis(gridPos.x);float y=contributionOnAxis(gridPos.y);float z=contributionOnAxis(gridPos.z);vec3 normal=normalize(vNormal);x*=normalImpactOnAxis(normal.x);y*=normalImpactOnAxis(normal.y);z*=normalImpactOnAxis(normal.z);
#ifdef MAX_LINE
float grid=clamp(max(max(x,y),z),0.,1.);
#else
float grid=clamp(x+y+z,0.,1.);
#endif
vec3 color=mix(mainColor,lineColor,grid);
#ifdef FOG
#include<fogFragment>
#endif
float opacity=1.0;
#ifdef TRANSPARENT
opacity=clamp(grid,0.08,gridControl.w*grid);
#endif
#ifdef OPACITY
opacity*=texture2D(opacitySampler,vOpacityUV).a;
#endif
gl_FragColor=vec4(color.rgb,opacity*visibility);
#ifdef TRANSPARENT
#ifdef PREMULTIPLYALPHA
gl_FragColor.rgb*=opacity;
#endif
#else
#endif
#include<logDepthFragment>
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[YDe] = MDe;
const LDe = "gridVertexShader", KDe = `precision highp float;attribute vec3 position;attribute vec3 normal;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#include<instancesDeclaration>
uniform mat4 projection;uniform mat4 view;varying vec3 vPosition;varying vec3 vNormal;
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
#ifdef OPACITY
varying vec2 vOpacityUV;uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
vec4 worldPos=finalWorld*vec4(position,1.0);
#include<fogVertex>
vec4 cameraSpacePosition=view*worldPos;gl_Position=projection*cameraSpacePosition;
#ifdef OPACITY
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
if (vOpacityInfos.x==0.)
{vOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));}
else
{vOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));}
#endif 
#include<logDepthVertex>
vPosition=position;vNormal=normal;
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[LDe] = KDe;
class JDe extends na {
  constructor() {
    super(), this.OPACITY = !1, this.ANTIALIAS = !1, this.TRANSPARENT = !1, this.FOG = !1, this.PREMULTIPLYALPHA = !1, this.MAX_LINE = !1, this.UV1 = !1, this.UV2 = !1, this.INSTANCES = !1, this.THIN_INSTANCES = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class RA extends P1 {
  /**
   * constructor
   * @param name The name given to the material in order to identify it afterwards.
   * @param scene The scene the material is used in.
   */
  constructor(e, t) {
    super(e, t), this.mainColor = Ne.Black(), this.lineColor = Ne.Teal(), this.gridRatio = 1, this.gridOffset = S.Zero(), this.majorUnitFrequency = 10, this.minorUnitVisibility = 0.33, this.opacity = 1, this.antialias = !0, this.preMultiplyAlpha = !1, this.useMaxLine = !1, this._gridControl = new Ir(this.gridRatio, this.majorUnitFrequency, this.minorUnitVisibility, this.opacity);
  }
  /**
   * Returns whether or not the grid requires alpha blending.
   */
  needAlphaBlending() {
    return this.opacity < 1 || this._opacityTexture && this._opacityTexture.isReady();
  }
  needAlphaBlendingForMesh(e) {
    return e.visibility < 1 || this.needAlphaBlending();
  }
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new JDe());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    if (n.TRANSPARENT !== this.opacity < 1 && (n.TRANSPARENT = !n.TRANSPARENT, n.markAsUnprocessed()), n.PREMULTIPLYALPHA != this.preMultiplyAlpha && (n.PREMULTIPLYALPHA = !n.PREMULTIPLYALPHA, n.markAsUnprocessed()), n.MAX_LINE !== this.useMaxLine && (n.MAX_LINE = !n.MAX_LINE, n.markAsUnprocessed()), n.ANTIALIAS !== this.antialias && (n.ANTIALIAS = !n.ANTIALIAS, n.markAsUnprocessed()), n._areTexturesDirty && (n._needUVs = !1, i.texturesEnabled && this._opacityTexture && Dt.OpacityTextureEnabled))
      if (this._opacityTexture.isReady())
        n._needUVs = !0, n.OPACITY = !0;
      else
        return !1;
    if (Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, !1, this.fogEnabled, !1, n), Ye.PrepareDefinesForFrameBoundValues(i, i.getEngine(), this, n, !!r), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial(), Ye.PrepareDefinesForAttributes(e, n, !1, !1);
      const s = [J.PositionKind, J.NormalKind];
      n.UV1 && s.push(J.UVKind), n.UV2 && s.push(J.UV2Kind), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess, Ye.PrepareAttributesForInstances(s, n);
      const a = n.toString();
      t.setEffect(i.getEngine().createEffect("grid", s, [
        "projection",
        "mainColor",
        "lineColor",
        "gridControl",
        "gridOffset",
        "vFogInfos",
        "vFogColor",
        "world",
        "view",
        "opacityMatrix",
        "vOpacityInfos",
        "visibility",
        "logarithmicDepthConstant"
      ], ["opacitySampler"], a, void 0, this.onCompiled, this.onError), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this._activeEffect.setFloat("visibility", t.visibility), (!i.INSTANCES || i.THIN_INSTANCE) && this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("view", n.getViewMatrix()), this._activeEffect.setMatrix("projection", n.getProjectionMatrix()), this._mustRebind(n, s) && (this._activeEffect.setColor3("mainColor", this.mainColor), this._activeEffect.setColor3("lineColor", this.lineColor), this._activeEffect.setVector3("gridOffset", this.gridOffset), this._gridControl.x = this.gridRatio, this._gridControl.y = Math.round(this.majorUnitFrequency), this._gridControl.z = this.minorUnitVisibility, this._gridControl.w = this.opacity, this._activeEffect.setVector4("gridControl", this._gridControl), this._opacityTexture && Dt.OpacityTextureEnabled && (this._activeEffect.setTexture("opacitySampler", this._opacityTexture), this._activeEffect.setFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), this._activeEffect.setMatrix("opacityMatrix", this._opacityTexture.getTextureMatrix())), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n)), Ye.BindFogParameters(n, t, this._activeEffect), this._afterBind(t, this._activeEffect));
  }
  /**
   * Dispose the material and its associated resources.
   * @param forceDisposeEffect will also dispose the used effect when true
   */
  dispose(e) {
    super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new RA(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.GridMaterial", e;
  }
  getClassName() {
    return "GridMaterial";
  }
  static Parse(e, t, r) {
    return jt.Parse(() => new RA(e.name, t), e, t, r);
  }
}
C([
  Oi()
], RA.prototype, "mainColor", void 0);
C([
  Oi()
], RA.prototype, "lineColor", void 0);
C([
  M()
], RA.prototype, "gridRatio", void 0);
C([
  fo()
], RA.prototype, "gridOffset", void 0);
C([
  M()
], RA.prototype, "majorUnitFrequency", void 0);
C([
  M()
], RA.prototype, "minorUnitVisibility", void 0);
C([
  M()
], RA.prototype, "opacity", void 0);
C([
  M()
], RA.prototype, "antialias", void 0);
C([
  M()
], RA.prototype, "preMultiplyAlpha", void 0);
C([
  M()
], RA.prototype, "useMaxLine", void 0);
C([
  en("opacityTexture")
], RA.prototype, "_opacityTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], RA.prototype, "opacityTexture", void 0);
Ue("BABYLON.GridMaterial", RA);
const zDe = "lavaPixelShader", GDe = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;uniform float time;uniform float speed;uniform float movingSpeed;uniform vec3 fogColor;uniform sampler2D noiseTexture;uniform float fogDensity;varying float noise;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<helperFunctions>
#include<__decl__lightFragment>[0]
#include<__decl__lightFragment>[1]
#include<__decl__lightFragment>[2]
#include<__decl__lightFragment>[3]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;
#endif
#include<clipPlaneFragmentDeclaration>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
float random( vec3 scale,float seed ){return fract( sin( dot( gl_FragCoord.xyz+seed,scale ) )*43758.5453+seed ) ;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;
#ifdef DIFFUSE
vec4 noiseTex=texture2D( noiseTexture,vDiffuseUV );vec2 T1=vDiffuseUV+vec2( 1.5,-1.5 )*time *0.02;vec2 T2=vDiffuseUV+vec2( -0.5,2.0 )*time*0.01*speed;T1.x+=noiseTex.x*2.0;T1.y+=noiseTex.y*2.0;T2.x-=noiseTex.y*0.2+time*0.001*movingSpeed;T2.y+=noiseTex.z*0.2+time*0.002*movingSpeed;float p=texture2D( noiseTexture,T1*3.0 ).a;vec4 lavaColor=texture2D( diffuseSampler,T2*4.0);vec4 temp=lavaColor*( vec4( p,p,p,p )*2. )+( lavaColor*lavaColor-0.1 );baseColor=temp;float depth=gl_FragCoord.z*4.0;const float LOG2=1.442695;float fogFactor=exp2(-fogDensity*fogDensity*depth*depth*LOG2 );fogFactor=1.0-clamp( fogFactor,0.0,1.0 );baseColor=mix( baseColor,vec4( fogColor,baseColor.w ),fogFactor );diffuseColor=baseColor.rgb;
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
#include<depthPrePass>
baseColor.rgb*=vDiffuseInfos.y;
#endif
#ifdef VERTEXCOLOR
baseColor.rgb*=vColor.rgb;
#endif
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(1.0,1.0,1.0);
#endif
#ifdef UNLIT
vec3 diffuseBase=vec3(1.,1.,1.);
#else
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;
#include<lightFragment>[0]
#include<lightFragment>[1]
#include<lightFragment>[2]
#include<lightFragment>[3]
#endif
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[zDe] = GDe;
const ZDe = "lavaVertexShader", _De = `precision highp float;uniform float time;uniform float lowFrequencySpeed;varying float noise;attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
/* NOISE FUNCTIONS */
vec3 mod289(vec3 x)
{return x-floor(x*(1.0/289.0))*289.0;}
vec4 mod289(vec4 x)
{return x-floor(x*(1.0/289.0))*289.0;}
vec4 permute(vec4 x)
{return mod289(((x*34.0)+1.0)*x);}
vec4 taylorInvSqrt(vec4 r)
{return 1.79284291400159-0.85373472095314*r;}
vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}
float pnoise(vec3 P,vec3 rep)
{vec3 Pi0=mod(floor(P),rep); 
vec3 Pi1=mod(Pi0+vec3(1.0),rep); 
Pi0=mod289(Pi0);Pi1=mod289(Pi1);vec3 Pf0=fract(P); 
vec3 Pf1=Pf0-vec3(1.0); 
vec4 ix=vec4(Pi0.x,Pi1.x,Pi0.x,Pi1.x);vec4 iy=vec4(Pi0.yy,Pi1.yy);vec4 iz0=Pi0.zzzz;vec4 iz1=Pi1.zzzz;vec4 ixy=permute(permute(ix)+iy);vec4 ixy0=permute(ixy+iz0);vec4 ixy1=permute(ixy+iz1);vec4 gx0=ixy0*(1.0/7.0);vec4 gy0=fract(floor(gx0)*(1.0/7.0))-0.5;gx0=fract(gx0);vec4 gz0=vec4(0.5)-abs(gx0)-abs(gy0);vec4 sz0=step(gz0,vec4(0.0));gx0-=sz0*(step(0.0,gx0)-0.5);gy0-=sz0*(step(0.0,gy0)-0.5);vec4 gx1=ixy1*(1.0/7.0);vec4 gy1=fract(floor(gx1)*(1.0/7.0))-0.5;gx1=fract(gx1);vec4 gz1=vec4(0.5)-abs(gx1)-abs(gy1);vec4 sz1=step(gz1,vec4(0.0));gx1-=sz1*(step(0.0,gx1)-0.5);gy1-=sz1*(step(0.0,gy1)-0.5);vec3 g000=vec3(gx0.x,gy0.x,gz0.x);vec3 g100=vec3(gx0.y,gy0.y,gz0.y);vec3 g010=vec3(gx0.z,gy0.z,gz0.z);vec3 g110=vec3(gx0.w,gy0.w,gz0.w);vec3 g001=vec3(gx1.x,gy1.x,gz1.x);vec3 g101=vec3(gx1.y,gy1.y,gz1.y);vec3 g011=vec3(gx1.z,gy1.z,gz1.z);vec3 g111=vec3(gx1.w,gy1.w,gz1.w);vec4 norm0=taylorInvSqrt(vec4(dot(g000,g000),dot(g010,g010),dot(g100,g100),dot(g110,g110)));g000*=norm0.x;g010*=norm0.y;g100*=norm0.z;g110*=norm0.w;vec4 norm1=taylorInvSqrt(vec4(dot(g001,g001),dot(g011,g011),dot(g101,g101),dot(g111,g111)));g001*=norm1.x;g011*=norm1.y;g101*=norm1.z;g111*=norm1.w;float n000=dot(g000,Pf0);float n100=dot(g100,vec3(Pf1.x,Pf0.yz));float n010=dot(g010,vec3(Pf0.x,Pf1.y,Pf0.z));float n110=dot(g110,vec3(Pf1.xy,Pf0.z));float n001=dot(g001,vec3(Pf0.xy,Pf1.z));float n101=dot(g101,vec3(Pf1.x,Pf0.y,Pf1.z));float n011=dot(g011,vec3(Pf0.x,Pf1.yz));float n111=dot(g111,Pf1);vec3 fade_xyz=fade(Pf0);vec4 n_z=mix(vec4(n000,n100,n010,n110),vec4(n001,n101,n011,n111),fade_xyz.z);vec2 n_yz=mix(n_z.xy,n_z.zw,fade_xyz.y);float n_xyz=mix(n_yz.x,n_yz.y,fade_xyz.x);return 2.2*n_xyz;}
/* END FUNCTION */
float turbulence( vec3 p ) {float w=100.0;float t=-.5;for (float f=1.0 ; f<=10.0 ; f++ ){float power=pow( 2.0,f );t+=abs( pnoise( vec3( power*p ),vec3( 10.0,10.0,10.0 ) )/power );}
return t;}
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
#ifdef NORMAL
noise=10.0* -.10*turbulence( .5*normal+time*1.15 );float b=lowFrequencySpeed*5.0*pnoise( 0.05*position +vec3(time*1.025),vec3( 100.0 ) );float displacement=- 1.5*noise+b;vec3 newPosition=position+normal*displacement;gl_Position=viewProjection*finalWorld*vec4( newPosition,1.0 );vec4 worldPos=finalWorld*vec4(newPosition,1.0);vPositionW=vec3(worldPos);vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef DIFFUSE
if (vDiffuseInfos.x==0.)
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}
else
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#include<logDepthVertex>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#define CUSTOM_VERTEX_MAIN_END
}`;
Le.ShadersStore[ZDe] = _De;
class $De extends na {
  constructor() {
    super(), this.DIFFUSE = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.POINTSIZE = !1, this.FOG = !1, this.LIGHT0 = !1, this.LIGHT1 = !1, this.LIGHT2 = !1, this.LIGHT3 = !1, this.SPOTLIGHT0 = !1, this.SPOTLIGHT1 = !1, this.SPOTLIGHT2 = !1, this.SPOTLIGHT3 = !1, this.HEMILIGHT0 = !1, this.HEMILIGHT1 = !1, this.HEMILIGHT2 = !1, this.HEMILIGHT3 = !1, this.DIRLIGHT0 = !1, this.DIRLIGHT1 = !1, this.DIRLIGHT2 = !1, this.DIRLIGHT3 = !1, this.POINTLIGHT0 = !1, this.POINTLIGHT1 = !1, this.POINTLIGHT2 = !1, this.POINTLIGHT3 = !1, this.SHADOW0 = !1, this.SHADOW1 = !1, this.SHADOW2 = !1, this.SHADOW3 = !1, this.SHADOWS = !1, this.SHADOWESM0 = !1, this.SHADOWESM1 = !1, this.SHADOWESM2 = !1, this.SHADOWESM3 = !1, this.SHADOWPOISSON0 = !1, this.SHADOWPOISSON1 = !1, this.SHADOWPOISSON2 = !1, this.SHADOWPOISSON3 = !1, this.SHADOWPCF0 = !1, this.SHADOWPCF1 = !1, this.SHADOWPCF2 = !1, this.SHADOWPCF3 = !1, this.SHADOWPCSS0 = !1, this.SHADOWPCSS1 = !1, this.SHADOWPCSS2 = !1, this.SHADOWPCSS3 = !1, this.NORMAL = !1, this.UV1 = !1, this.UV2 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.INSTANCESCOLOR = !1, this.UNLIT = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class vd extends P1 {
  constructor(e, t) {
    super(e, t), this.speed = 1, this.movingSpeed = 1, this.lowFrequencySpeed = 1, this.fogDensity = 0.15, this._lastTime = 0, this.diffuseColor = new Ne(1, 1, 1), this._disableLighting = !1, this._unlit = !1, this._maxSimultaneousLights = 4, this._scaledDiffuse = new Ne();
  }
  needAlphaBlending() {
    return this.alpha < 1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new $De());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (n._areTexturesDirty && (n._needUVs = !1, i.texturesEnabled && this._diffuseTexture && Dt.DiffuseTextureEnabled))
      if (this._diffuseTexture.isReady())
        n._needUVs = !0, n.DIFFUSE = !0;
      else
        return !1;
    if (Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), n), n._needNormals = !0, Ye.PrepareDefinesForLights(i, e, n, !1, this._maxSimultaneousLights, this._disableLighting), Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), Ye.PrepareDefinesForAttributes(e, n, !0, !0), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(n, a), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess;
      const f = [J.PositionKind];
      n.NORMAL && f.push(J.NormalKind), n.UV1 && f.push(J.UVKind), n.UV2 && f.push(J.UV2Kind), n.VERTEXCOLOR && f.push(J.ColorKind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "lava", d = n.toString(), v = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vDiffuseColor",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "vDiffuseInfos",
        "mBones",
        "diffuseMatrix",
        "logarithmicDepthConstant",
        "time",
        "speed",
        "movingSpeed",
        "fogColor",
        "fogDensity",
        "lowFrequencySpeed"
      ];
      Mf(v);
      const u = ["diffuseSampler", "noiseTexture"], l = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: n,
        maxSimultaneousLights: this.maxSimultaneousLights
      }), t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: d,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, i.UNLIT = this._unlit, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), this._mustRebind(n, s) && (this.diffuseTexture && Dt.DiffuseTextureEnabled && (this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture), this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level), this._activeEffect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix())), this.noiseTexture && this._activeEffect.setTexture("noiseTexture", this.noiseTexture), Df(s, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this._scaledDiffuse, this.alpha * t.visibility), n.lightsEnabled && !this.disableLighting && Ye.BindLights(n, t, this._activeEffect, i), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._lastTime += n.getEngine().getDeltaTime(), this._activeEffect.setFloat("time", this._lastTime * this.speed / 1e3), this.fogColor || (this.fogColor = Ne.Black()), this._activeEffect.setColor3("fogColor", this.fogColor), this._activeEffect.setFloat("fogDensity", this.fogDensity), this._activeEffect.setFloat("lowFrequencySpeed", this.lowFrequencySpeed), this._activeEffect.setFloat("movingSpeed", this.movingSpeed), this._afterBind(t, this._activeEffect));
  }
  getAnimatables() {
    const e = [];
    return this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0 && e.push(this.diffuseTexture), this.noiseTexture && this.noiseTexture.animations && this.noiseTexture.animations.length > 0 && e.push(this.noiseTexture), e;
  }
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._diffuseTexture && e.push(this._diffuseTexture), e;
  }
  hasTexture(e) {
    return !!(super.hasTexture(e) || this.diffuseTexture === e);
  }
  dispose(e) {
    this.diffuseTexture && this.diffuseTexture.dispose(), this.noiseTexture && this.noiseTexture.dispose(), super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new vd(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.LavaMaterial", e;
  }
  getClassName() {
    return "LavaMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new vd(e.name, t), e, t, r);
  }
}
C([
  en("diffuseTexture")
], vd.prototype, "_diffuseTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], vd.prototype, "diffuseTexture", void 0);
C([
  en()
], vd.prototype, "noiseTexture", void 0);
C([
  Oi()
], vd.prototype, "fogColor", void 0);
C([
  M()
], vd.prototype, "speed", void 0);
C([
  M()
], vd.prototype, "movingSpeed", void 0);
C([
  M()
], vd.prototype, "lowFrequencySpeed", void 0);
C([
  M()
], vd.prototype, "fogDensity", void 0);
C([
  Oi()
], vd.prototype, "diffuseColor", void 0);
C([
  M("disableLighting")
], vd.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], vd.prototype, "disableLighting", void 0);
C([
  M("unlit")
], vd.prototype, "_unlit", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], vd.prototype, "unlit", void 0);
C([
  M("maxSimultaneousLights")
], vd.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], vd.prototype, "maxSimultaneousLights", void 0);
Ue("BABYLON.LavaMaterial", vd);
const eje = "mixPixelShader", tje = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;
#ifdef SPECULARTERM
uniform vec4 vSpecularColor;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<helperFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#ifdef DIFFUSE
varying vec2 vTextureUV;uniform sampler2D mixMap1Sampler;uniform vec2 vTextureInfos;
#ifdef MIXMAP2
uniform sampler2D mixMap2Sampler;
#endif
uniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform sampler2D diffuse4Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;uniform vec2 diffuse4Infos;
#ifdef MIXMAP2
uniform sampler2D diffuse5Sampler;uniform sampler2D diffuse6Sampler;uniform sampler2D diffuse7Sampler;uniform sampler2D diffuse8Sampler;uniform vec2 diffuse5Infos;uniform vec2 diffuse6Infos;uniform vec2 diffuse7Infos;uniform vec2 diffuse8Infos;
#endif
#endif
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<clipPlaneFragmentDeclaration>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 finalMixColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;
#ifdef MIXMAP2
vec4 mixColor2=vec4(1.,1.,1.,1.);
#endif
#ifdef SPECULARTERM
float glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;
#else
float glossiness=0.;
#endif
float alpha=vDiffuseColor.a;
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(1.0,1.0,1.0);
#endif
#ifdef DIFFUSE
vec4 mixColor=texture2D(mixMap1Sampler,vTextureUV);
#include<depthPrePass>
mixColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);vec4 diffuse4Color=texture2D(diffuse4Sampler,vTextureUV*diffuse4Infos);diffuse1Color.rgb*=mixColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,mixColor.g);diffuse3Color.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,mixColor.b);finalMixColor.rgb=mix(diffuse3Color.rgb,diffuse4Color.rgb,1.0-mixColor.a);
#ifdef MIXMAP2
mixColor=texture2D(mixMap2Sampler,vTextureUV);mixColor.rgb*=vTextureInfos.y;vec4 diffuse5Color=texture2D(diffuse5Sampler,vTextureUV*diffuse5Infos);vec4 diffuse6Color=texture2D(diffuse6Sampler,vTextureUV*diffuse6Infos);vec4 diffuse7Color=texture2D(diffuse7Sampler,vTextureUV*diffuse7Infos);vec4 diffuse8Color=texture2D(diffuse8Sampler,vTextureUV*diffuse8Infos);diffuse5Color.rgb=mix(finalMixColor.rgb,diffuse5Color.rgb,mixColor.r);diffuse6Color.rgb=mix(diffuse5Color.rgb,diffuse6Color.rgb,mixColor.g);diffuse7Color.rgb=mix(diffuse6Color.rgb,diffuse7Color.rgb,mixColor.b);finalMixColor.rgb=mix(diffuse7Color.rgb,diffuse8Color.rgb,1.0-mixColor.a);
#endif
#endif
#ifdef VERTEXCOLOR
finalMixColor.rgb*=vColor.rgb;
#endif
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
#include<lightFragment>[0..maxSimultaneousLights]
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase*specularColor;
#else
vec3 finalSpecular=vec3(0.0);
#endif
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor*finalMixColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[eje] = tje;
const rje = "mixVertexShader", nje = `precision highp float;attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef DIFFUSE
varying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);
#ifdef NORMAL
vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef DIFFUSE
if (vTextureInfos.x==0.)
{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));}
else
{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));}
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[rje] = nje;
class ije extends na {
  constructor() {
    super(), this.DIFFUSE = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.POINTSIZE = !1, this.FOG = !1, this.SPECULARTERM = !1, this.NORMAL = !1, this.UV1 = !1, this.UV2 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.INSTANCESCOLOR = !1, this.MIXMAP2 = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class Io extends P1 {
  constructor(e, t) {
    super(e, t), this.diffuseColor = new Ne(1, 1, 1), this.specularColor = new Ne(0, 0, 0), this.specularPower = 64, this._disableLighting = !1, this._maxSimultaneousLights = 4;
  }
  needAlphaBlending() {
    return this.alpha < 1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new ije());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (i.texturesEnabled && (!this._mixTexture1 || !this._mixTexture1.isReady() || (n._needUVs = !0, Dt.DiffuseTextureEnabled && (!this._diffuseTexture1 || !this._diffuseTexture1.isReady() || (n.DIFFUSE = !0, !this._diffuseTexture2 || !this._diffuseTexture2.isReady()) || !this._diffuseTexture3 || !this._diffuseTexture3.isReady() || !this._diffuseTexture4 || !this._diffuseTexture4.isReady() || this._mixTexture2 && (!this._mixTexture2.isReady() || (n.MIXMAP2 = !0, !this._diffuseTexture5 || !this._diffuseTexture5.isReady()) || !this._diffuseTexture6 || !this._diffuseTexture6.isReady() || !this._diffuseTexture7 || !this._diffuseTexture7.isReady() || !this._diffuseTexture8 || !this._diffuseTexture8.isReady())))))
      return !1;
    if (Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), n), n._needNormals = Ye.PrepareDefinesForLights(i, e, n, !1, this._maxSimultaneousLights, this._disableLighting), Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), Ye.PrepareDefinesForAttributes(e, n, !0, !0), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(n, a, this.maxSimultaneousLights), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess;
      const f = [J.PositionKind];
      n.NORMAL && f.push(J.NormalKind), n.UV1 && f.push(J.UVKind), n.UV2 && f.push(J.UV2Kind), n.VERTEXCOLOR && f.push(J.ColorKind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "mix", d = n.toString(), v = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vDiffuseColor",
        "vSpecularColor",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "vTextureInfos",
        "mBones",
        "textureMatrix",
        "logarithmicDepthConstant",
        "diffuse1Infos",
        "diffuse2Infos",
        "diffuse3Infos",
        "diffuse4Infos",
        "diffuse5Infos",
        "diffuse6Infos",
        "diffuse7Infos",
        "diffuse8Infos"
      ], u = [
        "mixMap1Sampler",
        "mixMap2Sampler",
        "diffuse1Sampler",
        "diffuse2Sampler",
        "diffuse3Sampler",
        "diffuse4Sampler",
        "diffuse5Sampler",
        "diffuse6Sampler",
        "diffuse7Sampler",
        "diffuse8Sampler"
      ], l = [];
      Mf(v), Ye.PrepareUniformsAndSamplersList({
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: n,
        maxSimultaneousLights: this.maxSimultaneousLights
      }), t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: d,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), this._mustRebind(n, s) && (this._mixTexture1 && (this._activeEffect.setTexture("mixMap1Sampler", this._mixTexture1), this._activeEffect.setFloat2("vTextureInfos", this._mixTexture1.coordinatesIndex, this._mixTexture1.level), this._activeEffect.setMatrix("textureMatrix", this._mixTexture1.getTextureMatrix()), Dt.DiffuseTextureEnabled && (this._diffuseTexture1 && (this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1), this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale)), this._diffuseTexture2 && (this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2), this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale)), this._diffuseTexture3 && (this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3), this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale)), this._diffuseTexture4 && (this._activeEffect.setTexture("diffuse4Sampler", this._diffuseTexture4), this._activeEffect.setFloat2("diffuse4Infos", this._diffuseTexture4.uScale, this._diffuseTexture4.vScale)))), this._mixTexture2 && (this._activeEffect.setTexture("mixMap2Sampler", this._mixTexture2), Dt.DiffuseTextureEnabled && (this._diffuseTexture5 && (this._activeEffect.setTexture("diffuse5Sampler", this._diffuseTexture5), this._activeEffect.setFloat2("diffuse5Infos", this._diffuseTexture5.uScale, this._diffuseTexture5.vScale)), this._diffuseTexture6 && (this._activeEffect.setTexture("diffuse6Sampler", this._diffuseTexture6), this._activeEffect.setFloat2("diffuse6Infos", this._diffuseTexture6.uScale, this._diffuseTexture6.vScale)), this._diffuseTexture7 && (this._activeEffect.setTexture("diffuse7Sampler", this._diffuseTexture7), this._activeEffect.setFloat2("diffuse7Infos", this._diffuseTexture7.uScale, this._diffuseTexture7.vScale)), this._diffuseTexture8 && (this._activeEffect.setTexture("diffuse8Sampler", this._diffuseTexture8), this._activeEffect.setFloat2("diffuse8Infos", this._diffuseTexture8.uScale, this._diffuseTexture8.vScale)))), Df(s, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), i.SPECULARTERM && this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower), n.lightsEnabled && !this.disableLighting && Ye.BindLights(n, t, this._activeEffect, i, this.maxSimultaneousLights), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._afterBind(t, this._activeEffect));
  }
  getAnimatables() {
    const e = [];
    return this._mixTexture1 && this._mixTexture1.animations && this._mixTexture1.animations.length > 0 && e.push(this._mixTexture1), this._mixTexture2 && this._mixTexture2.animations && this._mixTexture2.animations.length > 0 && e.push(this._mixTexture2), e;
  }
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._mixTexture1 && e.push(this._mixTexture1), this._diffuseTexture1 && e.push(this._diffuseTexture1), this._diffuseTexture2 && e.push(this._diffuseTexture2), this._diffuseTexture3 && e.push(this._diffuseTexture3), this._diffuseTexture4 && e.push(this._diffuseTexture4), this._mixTexture2 && e.push(this._mixTexture2), this._diffuseTexture5 && e.push(this._diffuseTexture5), this._diffuseTexture6 && e.push(this._diffuseTexture6), this._diffuseTexture7 && e.push(this._diffuseTexture7), this._diffuseTexture8 && e.push(this._diffuseTexture8), e;
  }
  hasTexture(e) {
    return !!(super.hasTexture(e) || this._mixTexture1 === e || this._diffuseTexture1 === e || this._diffuseTexture2 === e || this._diffuseTexture3 === e || this._diffuseTexture4 === e || this._mixTexture2 === e || this._diffuseTexture5 === e || this._diffuseTexture6 === e || this._diffuseTexture7 === e || this._diffuseTexture8 === e);
  }
  dispose(e) {
    this._mixTexture1 && this._mixTexture1.dispose(), super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new Io(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.MixMaterial", e;
  }
  getClassName() {
    return "MixMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new Io(e.name, t), e, t, r);
  }
}
C([
  en("mixTexture1")
], Io.prototype, "_mixTexture1", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Io.prototype, "mixTexture1", void 0);
C([
  en("mixTexture2")
], Io.prototype, "_mixTexture2", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Io.prototype, "mixTexture2", void 0);
C([
  en("diffuseTexture1")
], Io.prototype, "_diffuseTexture1", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Io.prototype, "diffuseTexture1", void 0);
C([
  en("diffuseTexture2")
], Io.prototype, "_diffuseTexture2", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Io.prototype, "diffuseTexture2", void 0);
C([
  en("diffuseTexture3")
], Io.prototype, "_diffuseTexture3", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Io.prototype, "diffuseTexture3", void 0);
C([
  en("diffuseTexture4")
], Io.prototype, "_diffuseTexture4", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Io.prototype, "diffuseTexture4", void 0);
C([
  en("diffuseTexture1")
], Io.prototype, "_diffuseTexture5", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Io.prototype, "diffuseTexture5", void 0);
C([
  en("diffuseTexture2")
], Io.prototype, "_diffuseTexture6", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Io.prototype, "diffuseTexture6", void 0);
C([
  en("diffuseTexture3")
], Io.prototype, "_diffuseTexture7", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Io.prototype, "diffuseTexture7", void 0);
C([
  en("diffuseTexture4")
], Io.prototype, "_diffuseTexture8", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Io.prototype, "diffuseTexture8", void 0);
C([
  Oi()
], Io.prototype, "diffuseColor", void 0);
C([
  Oi()
], Io.prototype, "specularColor", void 0);
C([
  M()
], Io.prototype, "specularPower", void 0);
C([
  M("disableLighting")
], Io.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Io.prototype, "disableLighting", void 0);
C([
  M("maxSimultaneousLights")
], Io.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Io.prototype, "maxSimultaneousLights", void 0);
Ue("BABYLON.MixMaterial", Io);
const sje = "normalPixelShader", aje = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef LIGHTING
#include<helperFunctions>
#include<__decl__lightFragment>[0]
#include<__decl__lightFragment>[1]
#include<__decl__lightFragment>[2]
#include<__decl__lightFragment>[3]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#endif
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;
#endif
#include<clipPlaneFragmentDeclaration>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;
#ifdef DIFFUSE
baseColor=texture2D(diffuseSampler,vDiffuseUV);
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
#include<depthPrePass>
baseColor.rgb*=vDiffuseInfos.y;
#endif
#ifdef NORMAL
baseColor=mix(baseColor,vec4(vNormalW,1.0),0.5);
#endif
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(1.0,1.0,1.0);
#endif
#ifdef LIGHTING
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;
#include<lightFragment>[0]
#include<lightFragment>[1]
#include<lightFragment>[2]
#include<lightFragment>[3]
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;
#else
vec3 finalDiffuse= baseColor.rgb;
#endif
vec4 color=vec4(finalDiffuse,alpha);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[sje] = aje;
const oje = "normalVertexShader", fje = `precision highp float;attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);
#ifdef NORMAL
vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef DIFFUSE
if (vDiffuseInfos.x==0.)
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}
else
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[oje] = fje;
class Aje extends na {
  constructor() {
    super(), this.DIFFUSE = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.POINTSIZE = !1, this.FOG = !1, this.LIGHT0 = !1, this.LIGHT1 = !1, this.LIGHT2 = !1, this.LIGHT3 = !1, this.SPOTLIGHT0 = !1, this.SPOTLIGHT1 = !1, this.SPOTLIGHT2 = !1, this.SPOTLIGHT3 = !1, this.HEMILIGHT0 = !1, this.HEMILIGHT1 = !1, this.HEMILIGHT2 = !1, this.HEMILIGHT3 = !1, this.DIRLIGHT0 = !1, this.DIRLIGHT1 = !1, this.DIRLIGHT2 = !1, this.DIRLIGHT3 = !1, this.POINTLIGHT0 = !1, this.POINTLIGHT1 = !1, this.POINTLIGHT2 = !1, this.POINTLIGHT3 = !1, this.SHADOW0 = !1, this.SHADOW1 = !1, this.SHADOW2 = !1, this.SHADOW3 = !1, this.SHADOWS = !1, this.SHADOWESM0 = !1, this.SHADOWESM1 = !1, this.SHADOWESM2 = !1, this.SHADOWESM3 = !1, this.SHADOWPOISSON0 = !1, this.SHADOWPOISSON1 = !1, this.SHADOWPOISSON2 = !1, this.SHADOWPOISSON3 = !1, this.SHADOWPCF0 = !1, this.SHADOWPCF1 = !1, this.SHADOWPCF2 = !1, this.SHADOWPCF3 = !1, this.SHADOWPCSS0 = !1, this.SHADOWPCSS1 = !1, this.SHADOWPCSS2 = !1, this.SHADOWPCSS3 = !1, this.NORMAL = !1, this.UV1 = !1, this.UV2 = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.LIGHTING = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class dg extends P1 {
  constructor(e, t) {
    super(e, t), this.diffuseColor = new Ne(1, 1, 1), this._disableLighting = !1, this._maxSimultaneousLights = 4;
  }
  needAlphaBlending() {
    return this.alpha < 1;
  }
  needAlphaBlendingForMesh(e) {
    return this.needAlphaBlending() || e.visibility < 1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new Aje());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (n._areTexturesDirty && (n._needUVs = !1, i.texturesEnabled && this._diffuseTexture && Dt.DiffuseTextureEnabled))
      if (this._diffuseTexture.isReady())
        n._needUVs = !0, n.DIFFUSE = !0;
      else
        return !1;
    if (Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), n), n._needNormals = !0, Ye.PrepareDefinesForLights(i, e, n, !1, this._maxSimultaneousLights, this._disableLighting), Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), n.LIGHTING = !this._disableLighting, Ye.PrepareDefinesForAttributes(e, n, !0, !0), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(n, a), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess;
      const f = [J.PositionKind];
      n.NORMAL && f.push(J.NormalKind), n.UV1 && f.push(J.UVKind), n.UV2 && f.push(J.UV2Kind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "normal", d = n.toString(), v = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vDiffuseColor",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "vDiffuseInfos",
        "mBones",
        "diffuseMatrix",
        "logarithmicDepthConstant"
      ], u = ["diffuseSampler"], l = [];
      Mf(v), Ye.PrepareUniformsAndSamplersList({
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: n,
        maxSimultaneousLights: 4
      }), t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: d,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), this._mustRebind(n, s) && (this.diffuseTexture && Dt.DiffuseTextureEnabled && (this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture), this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level), this._activeEffect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix())), Df(s, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), n.lightsEnabled && !this.disableLighting && Ye.BindLights(n, t, this._activeEffect, i), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._afterBind(t, this._activeEffect));
  }
  getAnimatables() {
    const e = [];
    return this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0 && e.push(this.diffuseTexture), e;
  }
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._diffuseTexture && e.push(this._diffuseTexture), e;
  }
  hasTexture(e) {
    return !!(super.hasTexture(e) || this.diffuseTexture === e);
  }
  dispose(e) {
    this.diffuseTexture && this.diffuseTexture.dispose(), super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new dg(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.NormalMaterial", e;
  }
  getClassName() {
    return "NormalMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new dg(e.name, t), e, t, r);
  }
}
C([
  en("diffuseTexture")
], dg.prototype, "_diffuseTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], dg.prototype, "diffuseTexture", void 0);
C([
  Oi()
], dg.prototype, "diffuseColor", void 0);
C([
  M("disableLighting")
], dg.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], dg.prototype, "disableLighting", void 0);
C([
  M("maxSimultaneousLights")
], dg.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], dg.prototype, "maxSimultaneousLights", void 0);
Ue("BABYLON.NormalMaterial", dg);
const dje = "shadowOnlyPixelShader", vje = `precision highp float;uniform vec4 vEyePosition;uniform float alpha;uniform vec3 shadowColor;varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#include<helperFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<clipPlaneFragmentDeclaration>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(1.0,1.0,1.0);
#endif
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;
#include<lightFragment>[0..1]
vec4 color=vec4(shadowColor,(1.0-clamp(shadow,0.,1.))*alpha);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[dje] = vje;
const uje = "shadowOnlyVertexShader", lje = `precision highp float;attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);
#ifdef NORMAL
vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[uje] = lje;
class Pje extends na {
  constructor() {
    super(), this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.POINTSIZE = !1, this.FOG = !1, this.NORMAL = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class HO extends P1 {
  constructor(e, t) {
    super(e, t), this._needAlphaBlending = !0, this.shadowColor = Ne.Black();
  }
  needAlphaBlending() {
    return this._needAlphaBlending;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  get activeLight() {
    return this._activeLight;
  }
  set activeLight(e) {
    this._activeLight = e;
  }
  _getFirstShadowLightForMesh(e) {
    for (const t of e.lightSources)
      if (t.shadowEnabled)
        return t;
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    var n;
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new Pje());
    const i = t.materialDefines, s = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const a = s.getEngine();
    if (this._activeLight) {
      for (const o of e.lightSources)
        if (o.shadowEnabled) {
          if (this._activeLight === o)
            break;
          const d = e.lightSources.indexOf(this._activeLight);
          d !== -1 && (e.lightSources.splice(d, 1), e.lightSources.splice(0, 0, this._activeLight));
          break;
        }
    }
    Ye.PrepareDefinesForFrameBoundValues(s, a, this, i, !!r), Ye.PrepareDefinesForMisc(e, s, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), i), i._needNormals = Ye.PrepareDefinesForLights(s, e, i, !1, 1);
    const f = (n = this._getFirstShadowLightForMesh(e)) === null || n === void 0 ? void 0 : n.getShadowGenerator();
    if (this._needAlphaBlending = !0, f && f.getClassName && f.getClassName() === "CascadedShadowGenerator") {
      const o = f;
      this._needAlphaBlending = !o.autoCalcDepthBounds;
    }
    if (Ye.PrepareDefinesForAttributes(e, i, !1, !0), i.isDirty) {
      i.markAsProcessed(), s.resetCachedMaterial();
      const o = new c1();
      i.FOG && o.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(i, o, 1), i.NUM_BONE_INFLUENCERS > 0 && o.addCPUSkinningFallback(0, e), i.IMAGEPROCESSINGPOSTPROCESS = s.imageProcessingConfiguration.applyByPostProcess;
      const d = [J.PositionKind];
      i.NORMAL && d.push(J.NormalKind), Ye.PrepareAttributesForBones(d, e, i, o), Ye.PrepareAttributesForInstances(d, i);
      const v = "shadowOnly", u = i.toString(), l = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "alpha",
        "shadowColor",
        "mBones",
        "logarithmicDepthConstant"
      ], P = [], p = [];
      Mf(l), Ye.PrepareUniformsAndSamplersList({
        uniformsNames: l,
        uniformBuffersNames: p,
        samplers: P,
        defines: i,
        maxSimultaneousLights: 1
      }), t.setEffect(s.getEngine().createEffect(v, {
        attributes: d,
        uniformsNames: l,
        uniformBuffersNames: p,
        samplers: P,
        defines: u,
        fallbacks: o,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 1 }
      }, a), i, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (i._renderId = s.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    if (s) {
      if (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), this._mustRebind(n, s) && (Df(s, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._activeEffect.setFloat("alpha", this.alpha), this._activeEffect.setColor3("shadowColor", this.shadowColor), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), n.lightsEnabled) {
        Ye.BindLights(n, t, this._activeEffect, i, 1);
        const a = this._getFirstShadowLightForMesh(t);
        a && (a._renderId = -1);
      }
      (n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE || i.SHADOWCSM0) && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._afterBind(t, this._activeEffect);
    }
  }
  clone(e) {
    return jt.Clone(() => new HO(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.ShadowOnlyMaterial", e;
  }
  getClassName() {
    return "ShadowOnlyMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new HO(e.name, t), e, t, r);
  }
}
Ue("BABYLON.ShadowOnlyMaterial", HO);
const cje = "simplePixelShader", pje = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<helperFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;
#endif
#include<clipPlaneFragmentDeclaration>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;
#ifdef DIFFUSE
baseColor=texture2D(diffuseSampler,vDiffuseUV);
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
#include<depthPrePass>
baseColor.rgb*=vDiffuseInfos.y;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
baseColor.rgb*=vColor.rgb;
#endif
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(1.0,1.0,1.0);
#endif
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif 
#include<lightFragment>[0..maxSimultaneousLights]
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;
Le.ShadersStore[cje] = pje;
const hje = "simpleVertexShader", Hje = `precision highp float;attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef DIFFUSE
varying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);
#ifdef NORMAL
vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef DIFFUSE
if (vDiffuseInfos.x==0.)
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}
else
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[hje] = Hje;
class gje extends na {
  constructor() {
    super(), this.DIFFUSE = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.POINTSIZE = !1, this.FOG = !1, this.NORMAL = !1, this.UV1 = !1, this.UV2 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.INSTANCESCOLOR = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class vg extends P1 {
  constructor(e, t) {
    super(e, t), this.diffuseColor = new Ne(1, 1, 1), this._disableLighting = !1, this._maxSimultaneousLights = 4;
  }
  needAlphaBlending() {
    return this.alpha < 1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new gje());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (n._areTexturesDirty && (n._needUVs = !1, i.texturesEnabled && this._diffuseTexture && Dt.DiffuseTextureEnabled))
      if (this._diffuseTexture.isReady())
        n._needUVs = !0, n.DIFFUSE = !0;
      else
        return !1;
    if (Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), n), n._needNormals = Ye.PrepareDefinesForLights(i, e, n, !1, this._maxSimultaneousLights, this._disableLighting), Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), Ye.PrepareDefinesForAttributes(e, n, !0, !0), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(n, a, this.maxSimultaneousLights), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess;
      const f = [J.PositionKind];
      n.NORMAL && f.push(J.NormalKind), n.UV1 && f.push(J.UVKind), n.UV2 && f.push(J.UV2Kind), n.VERTEXCOLOR && f.push(J.ColorKind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "simple", d = n.toString(), v = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vDiffuseColor",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "vDiffuseInfos",
        "mBones",
        "diffuseMatrix",
        "logarithmicDepthConstant"
      ], u = ["diffuseSampler"], l = [];
      Mf(v), Ye.PrepareUniformsAndSamplersList({
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: n,
        maxSimultaneousLights: this.maxSimultaneousLights
      }), t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: d,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights - 1 }
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), this._mustRebind(n, s) && (this._diffuseTexture && Dt.DiffuseTextureEnabled && (this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture), this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix())), Df(s, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), n.lightsEnabled && !this.disableLighting && Ye.BindLights(n, t, this._activeEffect, i, this.maxSimultaneousLights), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._afterBind(t, this._activeEffect));
  }
  getAnimatables() {
    const e = [];
    return this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0 && e.push(this._diffuseTexture), e;
  }
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._diffuseTexture && e.push(this._diffuseTexture), e;
  }
  hasTexture(e) {
    return !!(super.hasTexture(e) || this.diffuseTexture === e);
  }
  dispose(e) {
    this._diffuseTexture && this._diffuseTexture.dispose(), super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new vg(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.SimpleMaterial", e;
  }
  getClassName() {
    return "SimpleMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new vg(e.name, t), e, t, r);
  }
}
C([
  en("diffuseTexture")
], vg.prototype, "_diffuseTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], vg.prototype, "diffuseTexture", void 0);
C([
  Oi("diffuse")
], vg.prototype, "diffuseColor", void 0);
C([
  M("disableLighting")
], vg.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], vg.prototype, "disableLighting", void 0);
C([
  M("maxSimultaneousLights")
], vg.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], vg.prototype, "maxSimultaneousLights", void 0);
Ue("BABYLON.SimpleMaterial", vg);
const Xje = "skyPixelShader", Tje = `precision highp float;varying vec3 vPositionW;
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<clipPlaneFragmentDeclaration>
uniform vec3 cameraPosition;uniform vec3 cameraOffset;uniform vec3 up;uniform float luminance;uniform float turbidity;uniform float rayleigh;uniform float mieCoefficient;uniform float mieDirectionalG;uniform vec3 sunPosition;
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
const float e=2.71828182845904523536028747135266249775724709369995957;const float pi=3.141592653589793238462643383279502884197169;const float n=1.0003;const float N=2.545E25;const float pn=0.035;const vec3 lambda=vec3(680E-9,550E-9,450E-9);const vec3 K=vec3(0.686,0.678,0.666);const float v=4.0;const float rayleighZenithLength=8.4E3;const float mieZenithLength=1.25E3;const float EE=1000.0;const float sunAngularDiameterCos=0.999956676946448443553574619906976478926848692873900859324;const float cutoffAngle=pi/1.95;const float steepness=1.5;vec3 totalRayleigh(vec3 lambda)
{return (8.0*pow(pi,3.0)*pow(pow(n,2.0)-1.0,2.0)*(6.0+3.0*pn))/(3.0*N*pow(lambda,vec3(4.0))*(6.0-7.0*pn));}
vec3 simplifiedRayleigh()
{return 0.0005/vec3(94,40,18);}
float rayleighPhase(float cosTheta)
{ 
return (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));}
vec3 totalMie(vec3 lambda,vec3 K,float T)
{float c=(0.2*T )*10E-18;return 0.434*c*pi*pow((2.0*pi)/lambda,vec3(v-2.0))*K;}
float hgPhase(float cosTheta,float g)
{return (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));}
float sunIntensity(float zenithAngleCos)
{return EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));}
float A=0.15;float B=0.50;float C=0.10;float D=0.20;float EEE=0.02;float F=0.30;float W=1000.0;vec3 Uncharted2Tonemap(vec3 x)
{return ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;}
#if DITHER
#include<helperFunctions>
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
/**
*--------------------------------------------------------------------------------------------------
* Sky Color
*--------------------------------------------------------------------------------------------------
*/
float sunfade=1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);float rayleighCoefficient=rayleigh-(1.0*(1.0-sunfade));vec3 sunDirection=normalize(sunPosition);float sunE=sunIntensity(dot(sunDirection,up));vec3 betaR=simplifiedRayleigh()*rayleighCoefficient;vec3 betaM=totalMie(lambda,K,turbidity)*mieCoefficient;float zenithAngle=acos(max(0.0,dot(up,normalize(vPositionW-cameraPosition+cameraOffset))));float sR=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));float sM=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));vec3 Fex=exp(-(betaR*sR+betaM*sM));float cosTheta=dot(normalize(vPositionW-cameraPosition),sunDirection);float rPhase=rayleighPhase(cosTheta*0.5+0.5);vec3 betaRTheta=betaR*rPhase;float mPhase=hgPhase(cosTheta,mieDirectionalG);vec3 betaMTheta=betaM*mPhase;vec3 Lin=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex),vec3(1.5));Lin*=mix(vec3(1.0),pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up,sunDirection),5.0),0.0,1.0));vec3 direction=normalize(vPositionW-cameraPosition);float theta=acos(direction.y);float phi=atan(direction.z,direction.x);vec2 uv=vec2(phi,theta)/vec2(2.0*pi,pi)+vec2(0.5,0.0);vec3 L0=vec3(0.1)*Fex;float sundisk=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);L0+=(sunE*19000.0*Fex)*sundisk;vec3 whiteScale=1.0/Uncharted2Tonemap(vec3(W));vec3 texColor=(Lin+L0);texColor*=0.04 ;texColor+=vec3(0.0,0.001,0.0025)*0.3;float g_fMaxLuminance=1.0;float fLumScaled=0.1/luminance; 
float fLumCompressed=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled); 
float ExposureBias=fLumCompressed;vec3 curr=Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);vec3 retColor=curr*whiteScale;/**
*--------------------------------------------------------------------------------------------------
* Sky Color
*--------------------------------------------------------------------------------------------------
*/
float alpha=1.0;
#ifdef VERTEXCOLOR
retColor.rgb*=vColor.rgb;
#endif
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#if DITHER
retColor.rgb+=dither(gl_FragCoord.xy,0.5);
#endif
vec4 color=clamp(vec4(retColor.rgb,alpha),0.0,1.0);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[Xje] = Tje;
const qje = "skyVertexShader", bje = `precision highp float;attribute vec3 position;
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
uniform mat4 world;uniform mat4 view;uniform mat4 viewProjection;
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef VERTEXCOLOR
varying vec4 vColor;
#endif
#include<logDepthDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
gl_Position=viewProjection*world*vec4(position,1.0);vec4 worldPos=world*vec4(position,1.0);vPositionW=vec3(worldPos);
#include<clipPlaneVertex>
#include<logDepthVertex>
#include<fogVertex>
#ifdef VERTEXCOLOR
vColor=color;
#endif
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[qje] = bje;
class xje extends na {
  constructor() {
    super(), this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.POINTSIZE = !1, this.FOG = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.DITHER = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class Nv extends P1 {
  /**
   * Instantiates a new sky material.
   * This material allows to create dynamic and texture free
   * effects for skyboxes by taking care of the atmosphere state.
   * @see https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/skyMat
   * @param name Define the name of the material in the scene
   * @param scene Define the scene the material belong to
   */
  constructor(e, t) {
    super(e, t), this.luminance = 1, this.turbidity = 10, this.rayleigh = 2, this.mieCoefficient = 5e-3, this.mieDirectionalG = 0.8, this.distance = 500, this.inclination = 0.49, this.azimuth = 0.25, this.sunPosition = new S(0, 100, 0), this.useSunPosition = !1, this.cameraOffset = S.Zero(), this.up = S.Up(), this.dithering = !1, this._cameraPosition = S.Zero(), this._skyOrientation = new Ze();
  }
  /**
   * Specifies if the material will require alpha blending
   * @returns a boolean specifying if alpha blending is needed
   */
  needAlphaBlending() {
    return this.alpha < 1;
  }
  /**
   * Specifies if this material should be rendered in alpha test mode
   * @returns false as the sky material doesn't need alpha testing.
   */
  needAlphaTesting() {
    return !1;
  }
  /**
   * Get the texture used for alpha test purpose.
   * @returns null as the sky material has no texture.
   */
  getAlphaTestTexture() {
    return null;
  }
  /**
   * Get if the submesh is ready to be used and all its information available.
   * Child classes can use it to update shaders
   * @param mesh defines the mesh to check
   * @param subMesh defines which submesh to check
   * @returns a boolean indicating that the submesh is ready or not
   */
  isReadyForSubMesh(e, t) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady)
      return !0;
    t.materialDefines || (t.materialDefines = new xje());
    const r = t.materialDefines, n = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    if (Ye.PrepareDefinesForMisc(e, n, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, !1, r), Ye.PrepareDefinesForAttributes(e, r, !0, !1), r.IMAGEPROCESSINGPOSTPROCESS !== n.imageProcessingConfiguration.applyByPostProcess && r.markAsMiscDirty(), r.DITHER !== this.dithering && r.markAsMiscDirty(), r.isDirty) {
      r.markAsProcessed(), n.resetCachedMaterial();
      const i = new c1();
      r.FOG && i.addFallback(1, "FOG"), r.IMAGEPROCESSINGPOSTPROCESS = n.imageProcessingConfiguration.applyByPostProcess, r.DITHER = this.dithering;
      const s = [J.PositionKind];
      r.VERTEXCOLOR && s.push(J.ColorKind);
      const a = "sky", f = [
        "world",
        "viewProjection",
        "view",
        "vFogInfos",
        "vFogColor",
        "logarithmicDepthConstant",
        "pointSize",
        "luminance",
        "turbidity",
        "rayleigh",
        "mieCoefficient",
        "mieDirectionalG",
        "sunPosition",
        "cameraPosition",
        "cameraOffset",
        "up"
      ];
      Mf(f);
      const o = r.toString();
      t.setEffect(n.getEngine().createEffect(a, s, f, [], o, i, this.onCompiled, this.onError), r, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (r._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, !0);
  }
  /**
   * Binds the submesh to this material by preparing the effect and shader to draw
   * @param world defines the world transformation matrix
   * @param mesh defines the mesh containing the submesh
   * @param subMesh defines the submesh to bind the material to
   */
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    if (!s)
      return;
    this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), this._mustRebind(n, s) && (Df(s, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n)), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect);
    const a = n.activeCamera;
    if (a) {
      const f = a.getWorldMatrix();
      this._cameraPosition.x = f.m[12], this._cameraPosition.y = f.m[13], this._cameraPosition.z = f.m[14], this._activeEffect.setVector3("cameraPosition", this._cameraPosition);
    }
    if (this._activeEffect.setVector3("cameraOffset", this.cameraOffset), this._activeEffect.setVector3("up", this.up), this.luminance > 0 && this._activeEffect.setFloat("luminance", this.luminance), this._activeEffect.setFloat("turbidity", this.turbidity), this._activeEffect.setFloat("rayleigh", this.rayleigh), this._activeEffect.setFloat("mieCoefficient", this.mieCoefficient), this._activeEffect.setFloat("mieDirectionalG", this.mieDirectionalG), !this.useSunPosition) {
      const f = Math.PI * (this.inclination - 0.5), o = 2 * Math.PI * (this.azimuth - 0.5);
      this.sunPosition.x = this.distance * Math.cos(o) * Math.cos(f), this.sunPosition.y = this.distance * Math.sin(-f), this.sunPosition.z = this.distance * Math.sin(o) * Math.cos(f), Ze.FromUnitVectorsToRef(S.UpReadOnly, this.up, this._skyOrientation), this.sunPosition.rotateByQuaternionToRef(this._skyOrientation, this.sunPosition);
    }
    this._activeEffect.setVector3("sunPosition", this.sunPosition), this._afterBind(t, this._activeEffect);
  }
  /**
   * Get the list of animatables in the material.
   * @returns the list of animatables object used in the material
   */
  getAnimatables() {
    return [];
  }
  /**
   * Disposes the material
   * @param forceDisposeEffect specifies if effects should be forcefully disposed
   */
  dispose(e) {
    super.dispose(e);
  }
  /**
   * Makes a duplicate of the material, and gives it a new name
   * @param name defines the new name for the duplicated material
   * @returns the cloned material
   */
  clone(e) {
    return jt.Clone(() => new Nv(e, this.getScene()), this);
  }
  /**
   * Serializes this material in a JSON representation
   * @returns the serialized material object
   */
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.SkyMaterial", e;
  }
  /**
   * Gets the current class name of the material e.g. "SkyMaterial"
   * Mainly use in serialization.
   * @returns the class name
   */
  getClassName() {
    return "SkyMaterial";
  }
  /**
   * Creates a sky material from parsed material data
   * @param source defines the JSON representation of the material
   * @param scene defines the hosting scene
   * @param rootUrl defines the root URL to use to load textures and relative dependencies
   * @returns a new sky material
   */
  static Parse(e, t, r) {
    return jt.Parse(() => new Nv(e.name, t), e, t, r);
  }
}
C([
  M()
], Nv.prototype, "luminance", void 0);
C([
  M()
], Nv.prototype, "turbidity", void 0);
C([
  M()
], Nv.prototype, "rayleigh", void 0);
C([
  M()
], Nv.prototype, "mieCoefficient", void 0);
C([
  M()
], Nv.prototype, "mieDirectionalG", void 0);
C([
  M()
], Nv.prototype, "distance", void 0);
C([
  M()
], Nv.prototype, "inclination", void 0);
C([
  M()
], Nv.prototype, "azimuth", void 0);
C([
  fo()
], Nv.prototype, "sunPosition", void 0);
C([
  M()
], Nv.prototype, "useSunPosition", void 0);
C([
  fo()
], Nv.prototype, "cameraOffset", void 0);
C([
  fo()
], Nv.prototype, "up", void 0);
C([
  M()
], Nv.prototype, "dithering", void 0);
Ue("BABYLON.SkyMaterial", Nv);
const Dje = "terrainPixelShader", jje = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;
#ifdef SPECULARTERM
uniform vec4 vSpecularColor;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<helperFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#ifdef DIFFUSE
varying vec2 vTextureUV;uniform sampler2D textureSampler;uniform vec2 vTextureInfos;uniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;
#endif
#ifdef BUMP
uniform sampler2D bump1Sampler;uniform sampler2D bump2Sampler;uniform sampler2D bump3Sampler;
#endif
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<clipPlaneFragmentDeclaration>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#ifdef BUMP
#extension GL_OES_standard_derivatives : enable
mat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)
{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;float invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));return mat3(tangent*invmax,binormal*invmax,normal);}
vec3 perturbNormal(vec3 viewDir,vec3 mixColor)
{vec3 bump1Color=texture2D(bump1Sampler,vTextureUV*diffuse1Infos).xyz;vec3 bump2Color=texture2D(bump2Sampler,vTextureUV*diffuse2Infos).xyz;vec3 bump3Color=texture2D(bump3Sampler,vTextureUV*diffuse3Infos).xyz;bump1Color.rgb*=mixColor.r;bump2Color.rgb=mix(bump1Color.rgb,bump2Color.rgb,mixColor.g);vec3 map=mix(bump2Color.rgb,bump3Color.rgb,mixColor.b);map=map*255./127.-128./127.;mat3 TBN=cotangent_frame(vNormalW*vTextureInfos.y,-viewDir,vTextureUV);return normalize(TBN*map);}
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;
#ifdef SPECULARTERM
float glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;
#else
float glossiness=0.;
#endif
float alpha=vDiffuseColor.a;
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(1.0,1.0,1.0);
#endif
#ifdef DIFFUSE
baseColor=texture2D(textureSampler,vTextureUV);
#if defined(BUMP) && defined(DIFFUSE)
normalW=perturbNormal(viewDirectionW,baseColor.rgb);
#endif
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
#include<depthPrePass>
baseColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);diffuse1Color.rgb*=baseColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,baseColor.g);baseColor.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,baseColor.b);
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
baseColor.rgb*=vColor.rgb;
#endif
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
#include<lightFragment>[0..maxSimultaneousLights]
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase*specularColor;
#else
vec3 finalSpecular=vec3(0.0);
#endif
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor*baseColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[Dje] = jje;
const wje = "terrainVertexShader", mje = `precision highp float;attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef DIFFUSE
varying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<logDepthDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);
#ifdef NORMAL
vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef DIFFUSE
if (vTextureInfos.x==0.)
{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));}
else
{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));}
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[wje] = mje;
class Bje extends na {
  constructor() {
    super(), this.DIFFUSE = !1, this.BUMP = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.POINTSIZE = !1, this.FOG = !1, this.SPECULARTERM = !1, this.NORMAL = !1, this.UV1 = !1, this.UV2 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.INSTANCESCOLOR = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class Qf extends P1 {
  constructor(e, t) {
    super(e, t), this.diffuseColor = new Ne(1, 1, 1), this.specularColor = new Ne(0, 0, 0), this.specularPower = 64, this._disableLighting = !1, this._maxSimultaneousLights = 4;
  }
  needAlphaBlending() {
    return this.alpha < 1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new Bje());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (i.texturesEnabled) {
      if (!this.mixTexture || !this.mixTexture.isReady())
        return !1;
      if (n._needUVs = !0, Dt.DiffuseTextureEnabled) {
        if (!this.diffuseTexture1 || !this.diffuseTexture1.isReady() || !this.diffuseTexture2 || !this.diffuseTexture2.isReady() || !this.diffuseTexture3 || !this.diffuseTexture3.isReady())
          return !1;
        n.DIFFUSE = !0;
      }
      if (this.bumpTexture1 && this.bumpTexture2 && this.bumpTexture3 && Dt.BumpTextureEnabled) {
        if (!this.bumpTexture1.isReady() || !this.bumpTexture2.isReady() || !this.bumpTexture3.isReady())
          return !1;
        n._needNormals = !0, n.BUMP = !0;
      }
    }
    if (Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), n), n._needNormals = Ye.PrepareDefinesForLights(i, e, n, !1, this._maxSimultaneousLights, this._disableLighting), Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), Ye.PrepareDefinesForAttributes(e, n, !0, !0), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(n, a, this.maxSimultaneousLights), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess;
      const f = [J.PositionKind];
      n.NORMAL && f.push(J.NormalKind), n.UV1 && f.push(J.UVKind), n.UV2 && f.push(J.UV2Kind), n.VERTEXCOLOR && f.push(J.ColorKind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "terrain", d = n.toString(), v = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vDiffuseColor",
        "vSpecularColor",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "vTextureInfos",
        "mBones",
        "textureMatrix",
        "diffuse1Infos",
        "diffuse2Infos",
        "diffuse3Infos"
      ], u = [
        "textureSampler",
        "diffuse1Sampler",
        "diffuse2Sampler",
        "diffuse3Sampler",
        "bump1Sampler",
        "bump2Sampler",
        "bump3Sampler",
        "logarithmicDepthConstant"
      ], l = [];
      Mf(v), Ye.PrepareUniformsAndSamplersList({
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: n,
        maxSimultaneousLights: this.maxSimultaneousLights
      }), t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: d,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), this._mustRebind(n, s) && (this.mixTexture && (this._activeEffect.setTexture("textureSampler", this._mixTexture), this._activeEffect.setFloat2("vTextureInfos", this._mixTexture.coordinatesIndex, this._mixTexture.level), this._activeEffect.setMatrix("textureMatrix", this._mixTexture.getTextureMatrix()), Dt.DiffuseTextureEnabled && (this._diffuseTexture1 && (this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1), this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale)), this._diffuseTexture2 && (this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2), this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale)), this._diffuseTexture3 && (this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3), this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale))), Dt.BumpTextureEnabled && n.getEngine().getCaps().standardDerivatives && (this._bumpTexture1 && this._activeEffect.setTexture("bump1Sampler", this._bumpTexture1), this._bumpTexture2 && this._activeEffect.setTexture("bump2Sampler", this._bumpTexture2), this._bumpTexture3 && this._activeEffect.setTexture("bump3Sampler", this._bumpTexture3))), Df(s, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), i.SPECULARTERM && this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower), n.lightsEnabled && !this.disableLighting && Ye.BindLights(n, t, this._activeEffect, i, this.maxSimultaneousLights), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._afterBind(t, this._activeEffect));
  }
  getAnimatables() {
    const e = [];
    return this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0 && e.push(this.mixTexture), e;
  }
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._mixTexture && e.push(this._mixTexture), this._diffuseTexture1 && e.push(this._diffuseTexture1), this._diffuseTexture2 && e.push(this._diffuseTexture2), this._diffuseTexture3 && e.push(this._diffuseTexture3), this._bumpTexture1 && e.push(this._bumpTexture1), this._bumpTexture2 && e.push(this._bumpTexture2), this._bumpTexture3 && e.push(this._bumpTexture3), e;
  }
  hasTexture(e) {
    return !!(super.hasTexture(e) || this._mixTexture === e || this._diffuseTexture1 === e || this._diffuseTexture2 === e || this._diffuseTexture3 === e || this._bumpTexture1 === e || this._bumpTexture2 === e || this._bumpTexture3 === e);
  }
  dispose(e) {
    this.mixTexture && this.mixTexture.dispose(), super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new Qf(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.TerrainMaterial", e;
  }
  getClassName() {
    return "TerrainMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new Qf(e.name, t), e, t, r);
  }
}
C([
  en("mixTexture")
], Qf.prototype, "_mixTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Qf.prototype, "mixTexture", void 0);
C([
  en("diffuseTexture1")
], Qf.prototype, "_diffuseTexture1", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Qf.prototype, "diffuseTexture1", void 0);
C([
  en("diffuseTexture2")
], Qf.prototype, "_diffuseTexture2", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Qf.prototype, "diffuseTexture2", void 0);
C([
  en("diffuseTexture3")
], Qf.prototype, "_diffuseTexture3", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Qf.prototype, "diffuseTexture3", void 0);
C([
  en("bumpTexture1")
], Qf.prototype, "_bumpTexture1", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Qf.prototype, "bumpTexture1", void 0);
C([
  en("bumpTexture2")
], Qf.prototype, "_bumpTexture2", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Qf.prototype, "bumpTexture2", void 0);
C([
  en("bumpTexture3")
], Qf.prototype, "_bumpTexture3", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Qf.prototype, "bumpTexture3", void 0);
C([
  Oi()
], Qf.prototype, "diffuseColor", void 0);
C([
  Oi()
], Qf.prototype, "specularColor", void 0);
C([
  M()
], Qf.prototype, "specularPower", void 0);
C([
  M("disableLighting")
], Qf.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Qf.prototype, "disableLighting", void 0);
C([
  M("maxSimultaneousLights")
], Qf.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Qf.prototype, "maxSimultaneousLights", void 0);
Ue("BABYLON.TerrainMaterial", Qf);
const Wje = "triplanarPixelShader", Sje = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;
#ifdef SPECULARTERM
uniform vec4 vSpecularColor;
#endif
varying vec3 vPositionW;
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<helperFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#ifdef DIFFUSEX
varying vec2 vTextureUVX;uniform sampler2D diffuseSamplerX;
#ifdef BUMPX
uniform sampler2D normalSamplerX;
#endif
#endif
#ifdef DIFFUSEY
varying vec2 vTextureUVY;uniform sampler2D diffuseSamplerY;
#ifdef BUMPY
uniform sampler2D normalSamplerY;
#endif
#endif
#ifdef DIFFUSEZ
varying vec2 vTextureUVZ;uniform sampler2D diffuseSamplerZ;
#ifdef BUMPZ
uniform sampler2D normalSamplerZ;
#endif
#endif
#ifdef NORMAL
varying mat3 tangentSpace;
#endif
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<clipPlaneFragmentDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(0.,0.,0.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;
#ifdef NORMAL
vec3 normalW=tangentSpace[2];
#else
vec3 normalW=vec3(1.0,1.0,1.0);
#endif
vec4 baseNormal=vec4(0.0,0.0,0.0,1.0);normalW*=normalW;
#ifdef DIFFUSEX
baseColor+=texture2D(diffuseSamplerX,vTextureUVX)*normalW.x;
#ifdef BUMPX
baseNormal+=texture2D(normalSamplerX,vTextureUVX)*normalW.x;
#endif
#endif
#ifdef DIFFUSEY
baseColor+=texture2D(diffuseSamplerY,vTextureUVY)*normalW.y;
#ifdef BUMPY
baseNormal+=texture2D(normalSamplerY,vTextureUVY)*normalW.y;
#endif
#endif
#ifdef DIFFUSEZ
baseColor+=texture2D(diffuseSamplerZ,vTextureUVZ)*normalW.z;
#ifdef BUMPZ
baseNormal+=texture2D(normalSamplerZ,vTextureUVZ)*normalW.z;
#endif
#endif
#ifdef NORMAL
normalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);
#endif
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
#include<depthPrePass>
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
baseColor.rgb*=vColor.rgb;
#endif
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;
#ifdef SPECULARTERM
float glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;
#else
float glossiness=0.;
#endif
#include<lightFragment>[0..maxSimultaneousLights]
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase*specularColor;
#else
vec3 finalSpecular=vec3(0.0);
#endif
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse+finalSpecular,alpha);
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[Wje] = Sje;
const Uje = "triplanarVertexShader", Ije = `precision highp float;attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<helperFunctions>
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef DIFFUSEX
varying vec2 vTextureUVX;
#endif
#ifdef DIFFUSEY
varying vec2 vTextureUVY;
#endif
#ifdef DIFFUSEZ
varying vec2 vTextureUVZ;
#endif
uniform float tileSize;
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying mat3 tangentSpace;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<clipPlaneVertexDeclaration>
#include<logDepthDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);
#ifdef DIFFUSEX
vTextureUVX=worldPos.zy/tileSize;
#endif
#ifdef DIFFUSEY
vTextureUVY=worldPos.xz/tileSize;
#endif
#ifdef DIFFUSEZ
vTextureUVZ=worldPos.xy/tileSize;
#endif
#ifdef NORMAL
vec3 xtan=vec3(0,0,1);vec3 xbin=vec3(0,1,0);vec3 ytan=vec3(1,0,0);vec3 ybin=vec3(0,0,1);vec3 ztan=vec3(1,0,0);vec3 zbin=vec3(0,1,0);vec3 normalizedNormal=normalize(normal);normalizedNormal*=normalizedNormal;vec3 worldBinormal=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);vec3 worldTangent=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);mat3 normalWorld=mat3(world);
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
worldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);vec3 worldNormal=normalize((normalWorld*normalize(normal)).xyz);tangentSpace[0]=worldTangent;tangentSpace[1]=worldBinormal;tangentSpace[2]=worldNormal;
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[Uje] = Ije;
class Rje extends na {
  constructor() {
    super(), this.DIFFUSEX = !1, this.DIFFUSEY = !1, this.DIFFUSEZ = !1, this.BUMPX = !1, this.BUMPY = !1, this.BUMPZ = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.POINTSIZE = !1, this.FOG = !1, this.SPECULARTERM = !1, this.NORMAL = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.INSTANCESCOLOR = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.NONUNIFORMSCALING = !1, this.LOGARITHMICDEPTH = !1, this.rebuild();
  }
}
class Yf extends P1 {
  constructor(e, t) {
    super(e, t), this.tileSize = 1, this.diffuseColor = new Ne(1, 1, 1), this.specularColor = new Ne(0.2, 0.2, 0.2), this.specularPower = 64, this._disableLighting = !1, this._maxSimultaneousLights = 4;
  }
  needAlphaBlending() {
    return this.alpha < 1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new Rje());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (n._areTexturesDirty && i.texturesEnabled) {
      if (Dt.DiffuseTextureEnabled) {
        const a = [this.diffuseTextureX, this.diffuseTextureY, this.diffuseTextureZ], f = ["DIFFUSEX", "DIFFUSEY", "DIFFUSEZ"];
        for (let o = 0; o < a.length; o++)
          if (a[o])
            if (a[o].isReady())
              n[f[o]] = !0;
            else
              return !1;
      }
      if (Dt.BumpTextureEnabled) {
        const a = [this.normalTextureX, this.normalTextureY, this.normalTextureZ], f = ["BUMPX", "BUMPY", "BUMPZ"];
        for (let o = 0; o < a.length; o++)
          if (a[o])
            if (a[o].isReady())
              n[f[o]] = !0;
            else
              return !1;
      }
    }
    if (Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), n), n._needNormals = Ye.PrepareDefinesForLights(i, e, n, !1, this._maxSimultaneousLights, this._disableLighting), Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), Ye.PrepareDefinesForAttributes(e, n, !0, !0), n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(n, a, this.maxSimultaneousLights), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e), n.IMAGEPROCESSINGPOSTPROCESS = i.imageProcessingConfiguration.applyByPostProcess;
      const f = [J.PositionKind];
      n.NORMAL && f.push(J.NormalKind), n.VERTEXCOLOR && f.push(J.ColorKind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "triplanar", d = n.toString(), v = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vDiffuseColor",
        "vSpecularColor",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "mBones",
        "tileSize"
      ], u = ["diffuseSamplerX", "diffuseSamplerY", "diffuseSamplerZ", "normalSamplerX", "normalSamplerY", "normalSamplerZ", "logarithmicDepthConstant"], l = [];
      Mf(v), Ye.PrepareUniformsAndSamplersList({
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: n,
        maxSimultaneousLights: this.maxSimultaneousLights
      }), t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: d,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), this._activeEffect.setFloat("tileSize", this.tileSize), n.getCachedMaterial() !== this && (this.diffuseTextureX && this._activeEffect.setTexture("diffuseSamplerX", this.diffuseTextureX), this.diffuseTextureY && this._activeEffect.setTexture("diffuseSamplerY", this.diffuseTextureY), this.diffuseTextureZ && this._activeEffect.setTexture("diffuseSamplerZ", this.diffuseTextureZ), this.normalTextureX && this._activeEffect.setTexture("normalSamplerX", this.normalTextureX), this.normalTextureY && this._activeEffect.setTexture("normalSamplerY", this.normalTextureY), this.normalTextureZ && this._activeEffect.setTexture("normalSamplerZ", this.normalTextureZ), Df(s, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), i.SPECULARTERM && this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower), n.lightsEnabled && !this.disableLighting && Ye.BindLights(n, t, this._activeEffect, i, this.maxSimultaneousLights), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), this._afterBind(t, this._activeEffect));
  }
  getAnimatables() {
    const e = [];
    return this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0 && e.push(this.mixTexture), e;
  }
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._diffuseTextureX && e.push(this._diffuseTextureX), this._diffuseTextureY && e.push(this._diffuseTextureY), this._diffuseTextureZ && e.push(this._diffuseTextureZ), this._normalTextureX && e.push(this._normalTextureX), this._normalTextureY && e.push(this._normalTextureY), this._normalTextureZ && e.push(this._normalTextureZ), e;
  }
  hasTexture(e) {
    return !!(super.hasTexture(e) || this._diffuseTextureX === e || this._diffuseTextureY === e || this._diffuseTextureZ === e || this._normalTextureX === e || this._normalTextureY === e || this._normalTextureZ === e);
  }
  dispose(e) {
    this.mixTexture && this.mixTexture.dispose(), super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new Yf(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.TriPlanarMaterial", e;
  }
  getClassName() {
    return "TriPlanarMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new Yf(e.name, t), e, t, r);
  }
}
C([
  en()
], Yf.prototype, "mixTexture", void 0);
C([
  en("diffuseTextureX")
], Yf.prototype, "_diffuseTextureX", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Yf.prototype, "diffuseTextureX", void 0);
C([
  en("diffuseTexturY")
], Yf.prototype, "_diffuseTextureY", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Yf.prototype, "diffuseTextureY", void 0);
C([
  en("diffuseTextureZ")
], Yf.prototype, "_diffuseTextureZ", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Yf.prototype, "diffuseTextureZ", void 0);
C([
  en("normalTextureX")
], Yf.prototype, "_normalTextureX", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Yf.prototype, "normalTextureX", void 0);
C([
  en("normalTextureY")
], Yf.prototype, "_normalTextureY", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Yf.prototype, "normalTextureY", void 0);
C([
  en("normalTextureZ")
], Yf.prototype, "_normalTextureZ", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], Yf.prototype, "normalTextureZ", void 0);
C([
  M()
], Yf.prototype, "tileSize", void 0);
C([
  Oi()
], Yf.prototype, "diffuseColor", void 0);
C([
  Oi()
], Yf.prototype, "specularColor", void 0);
C([
  M()
], Yf.prototype, "specularPower", void 0);
C([
  M("disableLighting")
], Yf.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Yf.prototype, "disableLighting", void 0);
C([
  M("maxSimultaneousLights")
], Yf.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], Yf.prototype, "maxSimultaneousLights", void 0);
Ue("BABYLON.TriPlanarMaterial", Yf);
const Vje = "waterPixelShader", Cje = `#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;
#ifdef SPECULARTERM
uniform vec4 vSpecularColor;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<helperFunctions>
#include<imageProcessingDeclaration>
#include<imageProcessingFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#ifdef BUMP
varying vec2 vNormalUV;
#ifdef BUMPSUPERIMPOSE
varying vec2 vNormalUV2;
#endif
uniform sampler2D normalSampler;uniform vec2 vNormalInfos;
#endif
uniform sampler2D refractionSampler;uniform sampler2D reflectionSampler;const float LOG2=1.442695;uniform vec3 cameraPosition;uniform vec4 waterColor;uniform float colorBlendFactor;uniform vec4 waterColor2;uniform float colorBlendFactor2;uniform float bumpHeight;uniform float time;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;
#ifdef BUMP
#ifdef BUMPSUPERIMPOSE
baseColor=0.6*texture2D(normalSampler,vNormalUV)+0.4*texture2D(normalSampler,vec2(vNormalUV2.x,vNormalUV2.y));
#else
baseColor=texture2D(normalSampler,vNormalUV);
#endif
vec3 bumpColor=baseColor.rgb;
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
baseColor.rgb*=vNormalInfos.y;
#else
vec3 bumpColor=vec3(1.0);
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
baseColor.rgb*=vColor.rgb;
#endif
#ifdef NORMAL
vec2 perturbation=bumpHeight*(baseColor.rg-0.5);
#ifdef BUMPAFFECTSREFLECTION
vec3 normalW=normalize(vNormalW+vec3(perturbation.x*8.0,0.0,perturbation.y*8.0));if (normalW.y<0.0) {normalW.y=-normalW.y;}
#else
vec3 normalW=normalize(vNormalW);
#endif
#else
vec3 normalW=vec3(1.0,1.0,1.0);vec2 perturbation=bumpHeight*(vec2(1.0,1.0)-0.5);
#endif
#ifdef FRESNELSEPARATE
#ifdef REFLECTION
vec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation*0.5,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);
#ifdef IS_REFRACTION_LINEAR
refractiveColor.rgb=toGammaSpace(refractiveColor.rgb);
#endif
vec2 projectedReflectionTexCoords=clamp(vec2(
vReflectionMapTexCoord.x/vReflectionMapTexCoord.z+perturbation.x*0.3,
vReflectionMapTexCoord.y/vReflectionMapTexCoord.z+perturbation.y
),0.0,1.0);vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);
#ifdef IS_REFLECTION_LINEAR
reflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);
#endif
vec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);float IfresnelTerm=1.0-fresnelTerm;refractiveColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*refractiveColor;reflectiveColor=IfresnelTerm*colorBlendFactor2*waterColor+(1.0-colorBlendFactor2*IfresnelTerm)*reflectiveColor;vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;baseColor=combinedColor;
#endif
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;
#ifdef SPECULARTERM
float glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;
#else
float glossiness=0.;
#endif
#include<lightFragment>[0..maxSimultaneousLights]
vec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase*specularColor;
#else
vec3 finalSpecular=vec3(0.0);
#endif
#else 
#ifdef REFLECTION
vec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);
#ifdef IS_REFRACTION_LINEAR
refractiveColor.rgb=toGammaSpace(refractiveColor.rgb);
#endif
vec2 projectedReflectionTexCoords=clamp(vReflectionMapTexCoord.xy/vReflectionMapTexCoord.z+perturbation,0.0,1.0);vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);
#ifdef IS_REFLECTION_LINEAR
reflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);
#endif
vec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=max(dot(viewDirectionW,upVector),0.0);vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);baseColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*combinedColor;
#endif
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;
#ifdef SPECULARTERM
float glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;
#else
float glossiness=0.;
#endif
#include<lightFragment>[0..maxSimultaneousLights]
vec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase*specularColor;
#else
vec3 finalSpecular=vec3(0.0);
#endif
#endif
vec4 color=vec4(finalDiffuse+finalSpecular,alpha);
#include<logDepthFragment>
#include<fogFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
color.rgb=toLinearSpace(color.rgb);
#elif defined(IMAGEPROCESSING)
color.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color);
#endif
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
Le.ShadersStore[Vje] = Cje;
const Oje = "waterVertexShader", yje = `precision highp float;attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
uniform mat4 view;uniform mat4 viewProjection;
#ifdef BUMP
varying vec2 vNormalUV;
#ifdef BUMPSUPERIMPOSE
varying vec2 vNormalUV2;
#endif
uniform mat4 normalMatrix;uniform vec2 vNormalInfos;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<logDepthDeclaration>
uniform mat4 reflectionViewProjection;uniform vec2 windDirection;uniform float waveLength;uniform float time;uniform float windForce;uniform float waveHeight;uniform float waveSpeed;uniform float waveCount;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos);
#ifdef NORMAL
vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef BUMP
if (vNormalInfos.x==0.)
{vNormalUV=vec2(normalMatrix*vec4((uv*1.0)/waveLength+time*windForce*windDirection,1.0,0.0));
#ifdef BUMPSUPERIMPOSE
vNormalUV2=vec2(normalMatrix*vec4((uv*0.721)/waveLength+time*1.2*windForce*windDirection,1.0,0.0));
#endif
}
else
{vNormalUV=vec2(normalMatrix*vec4((uv2*1.0)/waveLength+time*windForce*windDirection ,1.0,0.0));
#ifdef BUMPSUPERIMPOSE
vNormalUV2=vec2(normalMatrix*vec4((uv2*0.721)/waveLength+time*1.2*windForce*windDirection ,1.0,0.0));
#endif
}
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
float finalWaveCount=1.0/(waveCount*0.5);
#ifdef USE_WORLD_COORDINATES
vec3 p=worldPos.xyz;
#else
vec3 p=position;
#endif
float newY=(sin(((p.x/finalWaveCount)+time*waveSpeed))*waveHeight*windDirection.x*5.0)
+ (cos(((p.z/finalWaveCount)+ time*waveSpeed))*waveHeight*windDirection.y*5.0);p.y+=abs(newY);
#ifdef USE_WORLD_COORDINATES
gl_Position=viewProjection*vec4(p,1.0);
#else
gl_Position=viewProjection*finalWorld*vec4(p,1.0);
#endif
#ifdef REFLECTION
vRefractionMapTexCoord.x=0.5*(gl_Position.w+gl_Position.x);vRefractionMapTexCoord.y=0.5*(gl_Position.w+gl_Position.y);vRefractionMapTexCoord.z=gl_Position.w;worldPos=reflectionViewProjection*finalWorld*vec4(position,1.0);vReflectionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);vReflectionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);vReflectionMapTexCoord.z=worldPos.w;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}
`;
Le.ShadersStore[Oje] = yje;
class kje extends na {
  constructor() {
    super(), this.BUMP = !1, this.REFLECTION = !1, this.CLIPPLANE = !1, this.CLIPPLANE2 = !1, this.CLIPPLANE3 = !1, this.CLIPPLANE4 = !1, this.CLIPPLANE5 = !1, this.CLIPPLANE6 = !1, this.ALPHATEST = !1, this.DEPTHPREPASS = !1, this.POINTSIZE = !1, this.FOG = !1, this.NORMAL = !1, this.UV1 = !1, this.UV2 = !1, this.VERTEXCOLOR = !1, this.VERTEXALPHA = !1, this.NUM_BONE_INFLUENCERS = 0, this.BonesPerMesh = 0, this.INSTANCES = !1, this.INSTANCESCOLOR = !1, this.SPECULARTERM = !1, this.LOGARITHMICDEPTH = !1, this.USE_REVERSE_DEPTHBUFFER = !1, this.FRESNELSEPARATE = !1, this.BUMPSUPERIMPOSE = !1, this.BUMPAFFECTSREFLECTION = !1, this.USE_WORLD_COORDINATES = !1, this.IMAGEPROCESSING = !1, this.VIGNETTE = !1, this.VIGNETTEBLENDMODEMULTIPLY = !1, this.VIGNETTEBLENDMODEOPAQUE = !1, this.TONEMAPPING = !1, this.TONEMAPPING_ACES = !1, this.CONTRAST = !1, this.EXPOSURE = !1, this.COLORCURVES = !1, this.COLORGRADING = !1, this.COLORGRADING3D = !1, this.SAMPLER3DGREENDEPTH = !1, this.SAMPLER3DBGRMAP = !1, this.DITHER = !1, this.IMAGEPROCESSINGPOSTPROCESS = !1, this.SKIPFINALCOLORCLAMP = !1, this.rebuild();
  }
}
class la extends P1 {
  /**
   * Gets a boolean indicating that current material needs to register RTT
   */
  get hasRenderTargetTextures() {
    return !0;
  }
  /**
   * Constructor
   * @param name
   * @param scene
   * @param renderTargetSize
   */
  constructor(e, t, r = new at(512, 512)) {
    super(e, t), this.renderTargetSize = r, this.diffuseColor = new Ne(1, 1, 1), this.specularColor = new Ne(0, 0, 0), this.specularPower = 64, this._disableLighting = !1, this._maxSimultaneousLights = 4, this.windForce = 6, this.windDirection = new at(0, 1), this.waveHeight = 0.4, this.bumpHeight = 0.4, this._bumpSuperimpose = !1, this._fresnelSeparate = !1, this._bumpAffectsReflection = !1, this.waterColor = new Ne(0.1, 0.1, 0.6), this.colorBlendFactor = 0.2, this.waterColor2 = new Ne(0.1, 0.1, 0.6), this.colorBlendFactor2 = 0.2, this.waveLength = 0.1, this.waveSpeed = 1, this.waveCount = 20, this.disableClipPlane = !1, this._useWorldCoordinatesForWaveDeformation = !1, this._renderTargets = new qf(16), this._mesh = null, this._reflectionTransform = he.Zero(), this._lastTime = 0, this._lastDeltaTime = 0, this._createRenderTargets(this.getScene(), r), this.getRenderTargetTextures = () => (this._renderTargets.reset(), this._renderTargets.push(this._reflectionRTT), this._renderTargets.push(this._refractionRTT), this._renderTargets), this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
      this._markAllSubMeshesAsImageProcessingDirty();
    }));
  }
  // Get / Set
  get refractionTexture() {
    return this._refractionRTT;
  }
  get reflectionTexture() {
    return this._reflectionRTT;
  }
  // Methods
  addToRenderList(e) {
    this._refractionRTT && this._refractionRTT.renderList && this._refractionRTT.renderList.push(e), this._reflectionRTT && this._reflectionRTT.renderList && this._reflectionRTT.renderList.push(e);
  }
  removeFromRenderList(e) {
    if (this._refractionRTT && this._refractionRTT.renderList) {
      const t = this._refractionRTT.renderList.indexOf(e);
      t !== -1 && this._refractionRTT.renderList.splice(t, 1);
    }
    if (this._reflectionRTT && this._reflectionRTT.renderList) {
      const t = this._reflectionRTT.renderList.indexOf(e);
      t !== -1 && this._reflectionRTT.renderList.splice(t, 1);
    }
  }
  enableRenderTargets(e) {
    const t = e ? 1 : 0;
    this._refractionRTT && (this._refractionRTT.refreshRate = t), this._reflectionRTT && (this._reflectionRTT.refreshRate = t);
  }
  getRenderList() {
    return this._refractionRTT ? this._refractionRTT.renderList : [];
  }
  get renderTargetsEnabled() {
    return !(this._refractionRTT && this._refractionRTT.refreshRate === 0);
  }
  needAlphaBlending() {
    return this.alpha < 1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  isReadyForSubMesh(e, t, r) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady && t.effect._wasPreviouslyUsingInstances === r)
      return !0;
    t.materialDefines || (t.materialDefines = new kje());
    const n = t.materialDefines, i = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const s = i.getEngine();
    if (n._areTexturesDirty && (n._needUVs = !1, i.texturesEnabled)) {
      if (this.bumpTexture && Dt.BumpTextureEnabled)
        if (this.bumpTexture.isReady())
          n._needUVs = !0, n.BUMP = !0;
        else
          return !1;
      Dt.ReflectionTextureEnabled && (n.REFLECTION = !0);
    }
    if (Ye.PrepareDefinesForFrameBoundValues(i, s, this, n, !!r), Ye.PrepareDefinesForMisc(e, i, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), n), n._areMiscDirty && (n.FRESNELSEPARATE = this._fresnelSeparate, n.BUMPSUPERIMPOSE = this._bumpSuperimpose, n.BUMPAFFECTSREFLECTION = this._bumpAffectsReflection, n.USE_WORLD_COORDINATES = this._useWorldCoordinatesForWaveDeformation), n._needNormals = Ye.PrepareDefinesForLights(i, e, n, !0, this._maxSimultaneousLights, this._disableLighting), n._areImageProcessingDirty && this._imageProcessingConfiguration) {
      if (!this._imageProcessingConfiguration.isReady())
        return !1;
      this._imageProcessingConfiguration.prepareDefines(n), n.IS_REFLECTION_LINEAR = this.reflectionTexture != null && !this.reflectionTexture.gammaSpace, n.IS_REFRACTION_LINEAR = this.refractionTexture != null && !this.refractionTexture.gammaSpace;
    }
    if (Ye.PrepareDefinesForAttributes(e, n, !0, !0), this._mesh = e, this._waitingRenderList) {
      for (let a = 0; a < this._waitingRenderList.length; a++)
        this.addToRenderList(i.getNodeById(this._waitingRenderList[a]));
      this._waitingRenderList = null;
    }
    if (n.isDirty) {
      n.markAsProcessed(), i.resetCachedMaterial();
      const a = new c1();
      n.FOG && a.addFallback(1, "FOG"), n.LOGARITHMICDEPTH && a.addFallback(0, "LOGARITHMICDEPTH"), Ye.HandleFallbacksForShadows(n, a, this.maxSimultaneousLights), n.NUM_BONE_INFLUENCERS > 0 && a.addCPUSkinningFallback(0, e);
      const f = [J.PositionKind];
      n.NORMAL && f.push(J.NormalKind), n.UV1 && f.push(J.UVKind), n.UV2 && f.push(J.UV2Kind), n.VERTEXCOLOR && f.push(J.ColorKind), Ye.PrepareAttributesForBones(f, e, n, a), Ye.PrepareAttributesForInstances(f, n);
      const o = "water", d = n.toString(), v = [
        "world",
        "view",
        "viewProjection",
        "vEyePosition",
        "vLightsType",
        "vDiffuseColor",
        "vSpecularColor",
        "vFogInfos",
        "vFogColor",
        "pointSize",
        "vNormalInfos",
        "mBones",
        "normalMatrix",
        "logarithmicDepthConstant",
        // Water
        "reflectionViewProjection",
        "windDirection",
        "waveLength",
        "time",
        "windForce",
        "cameraPosition",
        "bumpHeight",
        "waveHeight",
        "waterColor",
        "waterColor2",
        "colorBlendFactor",
        "colorBlendFactor2",
        "waveSpeed",
        "waveCount"
      ], u = [
        "normalSampler",
        // Water
        "refractionSampler",
        "reflectionSampler"
      ], l = [];
      Ui && (Ui.PrepareUniforms(v, n), Ui.PrepareSamplers(u, n)), Mf(v), Ye.PrepareUniformsAndSamplersList({
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: n,
        maxSimultaneousLights: this.maxSimultaneousLights
      }), t.setEffect(i.getEngine().createEffect(o, {
        attributes: f,
        uniformsNames: v,
        uniformBuffersNames: l,
        samplers: u,
        defines: d,
        fallbacks: a,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights }
      }, s), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = i.getRenderId(), t.effect._wasPreviouslyReady = !0, t.effect._wasPreviouslyUsingInstances = !!r, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    if (!s || !this._mesh)
      return;
    this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), Ye.BindBonesParameters(t, this._activeEffect), this._mustRebind(n, s) && (this.bumpTexture && Dt.BumpTextureEnabled && (this._activeEffect.setTexture("normalSampler", this.bumpTexture), this._activeEffect.setFloat2("vNormalInfos", this.bumpTexture.coordinatesIndex, this.bumpTexture.level), this._activeEffect.setMatrix("normalMatrix", this.bumpTexture.getTextureMatrix())), Df(s, this, n), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && Ye.BindLogDepth(i, s, n), n.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), i.SPECULARTERM && this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower), n.lightsEnabled && !this.disableLighting && Ye.BindLights(n, t, this._activeEffect, i, this.maxSimultaneousLights), n.fogEnabled && t.applyFog && n.fogMode !== sr.FOGMODE_NONE && this._activeEffect.setMatrix("view", n.getViewMatrix()), Ye.BindFogParameters(n, t, this._activeEffect), Ye.BindLogDepth(i, this._activeEffect, n), Dt.ReflectionTextureEnabled && (this._activeEffect.setTexture("refractionSampler", this._refractionRTT), this._activeEffect.setTexture("reflectionSampler", this._reflectionRTT));
    const a = this._reflectionTransform.multiply(n.getProjectionMatrix()), f = n.getEngine().getDeltaTime();
    f !== this._lastDeltaTime && (this._lastDeltaTime = f, this._lastTime += this._lastDeltaTime), this._activeEffect.setMatrix("reflectionViewProjection", a), this._activeEffect.setVector2("windDirection", this.windDirection), this._activeEffect.setFloat("waveLength", this.waveLength), this._activeEffect.setFloat("time", this._lastTime / 1e5), this._activeEffect.setFloat("windForce", this.windForce), this._activeEffect.setFloat("waveHeight", this.waveHeight), this._activeEffect.setFloat("bumpHeight", this.bumpHeight), this._activeEffect.setColor4("waterColor", this.waterColor, 1), this._activeEffect.setFloat("colorBlendFactor", this.colorBlendFactor), this._activeEffect.setColor4("waterColor2", this.waterColor2, 1), this._activeEffect.setFloat("colorBlendFactor2", this.colorBlendFactor2), this._activeEffect.setFloat("waveSpeed", this.waveSpeed), this._activeEffect.setFloat("waveCount", this.waveCount), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(this._activeEffect), this._afterBind(t, this._activeEffect);
  }
  _createRenderTargets(e, t) {
    this._refractionRTT = new Ta(name + "_refraction", { width: t.x, height: t.y }, e, !1, !0), this._refractionRTT.wrapU = et.TEXTURE_MIRROR_ADDRESSMODE, this._refractionRTT.wrapV = et.TEXTURE_MIRROR_ADDRESSMODE, this._refractionRTT.ignoreCameraViewport = !0, this._reflectionRTT = new Ta(name + "_reflection", { width: t.x, height: t.y }, e, !1, !0), this._reflectionRTT.wrapU = et.TEXTURE_MIRROR_ADDRESSMODE, this._reflectionRTT.wrapV = et.TEXTURE_MIRROR_ADDRESSMODE, this._reflectionRTT.ignoreCameraViewport = !0;
    let r, n = null, i;
    const s = he.Zero();
    this._refractionRTT.onBeforeRender = () => {
      if (this._mesh && (r = this._mesh.isVisible, this._mesh.isVisible = !1), !this.disableClipPlane) {
        n = e.clipPlane;
        const a = this._mesh ? this._mesh.absolutePosition.y : 0;
        e.clipPlane = BA.FromPositionAndNormal(new S(0, a + 0.05, 0), new S(0, 1, 0));
      }
    }, this._refractionRTT.onAfterRender = () => {
      this._mesh && (this._mesh.isVisible = r), this.disableClipPlane || (e.clipPlane = n);
    }, this._reflectionRTT.onBeforeRender = () => {
      if (this._mesh && (r = this._mesh.isVisible, this._mesh.isVisible = !1), !this.disableClipPlane) {
        n = e.clipPlane;
        const a = this._mesh ? this._mesh.absolutePosition.y : 0;
        e.clipPlane = BA.FromPositionAndNormal(new S(0, a - 0.05, 0), new S(0, -1, 0)), he.ReflectionToRef(e.clipPlane, s);
      }
      i = e.getViewMatrix(), s.multiplyToRef(i, this._reflectionTransform), e.setTransformMatrix(this._reflectionTransform, e.getProjectionMatrix()), e._mirroredCameraPosition = S.TransformCoordinates(e.activeCamera.position, s);
    }, this._reflectionRTT.onAfterRender = () => {
      this._mesh && (this._mesh.isVisible = r), e.clipPlane = n, e.setTransformMatrix(i, e.getProjectionMatrix()), e._mirroredCameraPosition = null;
    };
  }
  getAnimatables() {
    const e = [];
    return this.bumpTexture && this.bumpTexture.animations && this.bumpTexture.animations.length > 0 && e.push(this.bumpTexture), this._reflectionRTT && this._reflectionRTT.animations && this._reflectionRTT.animations.length > 0 && e.push(this._reflectionRTT), this._refractionRTT && this._refractionRTT.animations && this._refractionRTT.animations.length > 0 && e.push(this._refractionRTT), e;
  }
  getActiveTextures() {
    const e = super.getActiveTextures();
    return this._bumpTexture && e.push(this._bumpTexture), e;
  }
  hasTexture(e) {
    return !!(super.hasTexture(e) || this._bumpTexture === e);
  }
  dispose(e) {
    this.bumpTexture && this.bumpTexture.dispose();
    let t = this.getScene().customRenderTargets.indexOf(this._refractionRTT);
    t != -1 && this.getScene().customRenderTargets.splice(t, 1), t = -1, t = this.getScene().customRenderTargets.indexOf(this._reflectionRTT), t != -1 && this.getScene().customRenderTargets.splice(t, 1), this._reflectionRTT && this._reflectionRTT.dispose(), this._refractionRTT && this._refractionRTT.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new la(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    if (e.customType = "BABYLON.WaterMaterial", e.renderList = [], this._refractionRTT && this._refractionRTT.renderList)
      for (let t = 0; t < this._refractionRTT.renderList.length; t++)
        e.renderList.push(this._refractionRTT.renderList[t].id);
    return e;
  }
  getClassName() {
    return "WaterMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    const n = jt.Parse(() => new la(e.name, t), e, t, r);
    return n._waitingRenderList = e.renderList, n;
  }
  static CreateDefaultMesh(e, t) {
    return Wm(e, { width: 512, height: 512, subdivisions: 32, updatable: !1 }, t);
  }
}
C([
  en("bumpTexture")
], la.prototype, "_bumpTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesDirty")
], la.prototype, "bumpTexture", void 0);
C([
  Oi()
], la.prototype, "diffuseColor", void 0);
C([
  Oi()
], la.prototype, "specularColor", void 0);
C([
  M()
], la.prototype, "specularPower", void 0);
C([
  M("disableLighting")
], la.prototype, "_disableLighting", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], la.prototype, "disableLighting", void 0);
C([
  M("maxSimultaneousLights")
], la.prototype, "_maxSimultaneousLights", void 0);
C([
  At("_markAllSubMeshesAsLightsDirty")
], la.prototype, "maxSimultaneousLights", void 0);
C([
  M()
], la.prototype, "windForce", void 0);
C([
  HR()
], la.prototype, "windDirection", void 0);
C([
  M()
], la.prototype, "waveHeight", void 0);
C([
  M()
], la.prototype, "bumpHeight", void 0);
C([
  M("bumpSuperimpose")
], la.prototype, "_bumpSuperimpose", void 0);
C([
  At("_markAllSubMeshesAsMiscDirty")
], la.prototype, "bumpSuperimpose", void 0);
C([
  M("fresnelSeparate")
], la.prototype, "_fresnelSeparate", void 0);
C([
  At("_markAllSubMeshesAsMiscDirty")
], la.prototype, "fresnelSeparate", void 0);
C([
  M("bumpAffectsReflection")
], la.prototype, "_bumpAffectsReflection", void 0);
C([
  At("_markAllSubMeshesAsMiscDirty")
], la.prototype, "bumpAffectsReflection", void 0);
C([
  Oi()
], la.prototype, "waterColor", void 0);
C([
  M()
], la.prototype, "colorBlendFactor", void 0);
C([
  Oi()
], la.prototype, "waterColor2", void 0);
C([
  M()
], la.prototype, "colorBlendFactor2", void 0);
C([
  M()
], la.prototype, "waveLength", void 0);
C([
  M()
], la.prototype, "waveSpeed", void 0);
C([
  M()
], la.prototype, "waveCount", void 0);
C([
  M()
], la.prototype, "disableClipPlane", void 0);
C([
  M("useWorldCoordinatesForWaveDeformation")
], la.prototype, "_useWorldCoordinatesForWaveDeformation", void 0);
C([
  At("_markAllSubMeshesAsMiscDirty")
], la.prototype, "useWorldCoordinatesForWaveDeformation", void 0);
Ue("BABYLON.WaterMaterial", la);
function Xa(A) {
  return Array.isArray(A) ? [...A] : [A];
}
function C5(A) {
  let e, t;
  return A.forEach((r, n) => {
    (n === 0 || r < e) && (e = r, t = n);
  }), { min: e, index: t };
}
const Eje = async (A, e) => {
  for (let t = 0; t < A.length; t++)
    await e(A[t], t, A);
}, zSe = async (A, e) => {
  const t = [];
  return await Eje(A, async (r, n) => {
    t.push(await e(r, n, A));
  }), t;
};
function CW(A) {
  return A % 360 * Math.PI / 180;
}
function GSe(A) {
  return A * 180 / Math.PI % 360;
}
function ZSe(A) {
  return A / 1e3;
}
function _Se(A, e, t) {
  const { min: r, center: n, max: i } = A, { min: s, center: a, max: f } = e, o = [
    s.x - r.x,
    s.x - n.x,
    s.x - i.x,
    a.x - r.x,
    a.x - n.x,
    a.x - i.x,
    f.x - r.x,
    f.x - n.x,
    f.x - i.x
  ], d = [
    s.y - r.y,
    s.y - n.y,
    s.y - i.y,
    a.y - r.y,
    a.y - n.y,
    a.y - i.y,
    f.y - r.y,
    f.y - n.y,
    f.y - i.y
  ], v = [
    s.z - r.z,
    s.z - n.z,
    s.z - i.z,
    a.z - r.z,
    a.z - n.z,
    a.z - i.z,
    f.z - r.z,
    f.z - n.z,
    f.z - i.z
  ], { min: u, index: l } = C5(o.map((ee) => Math.abs(ee))), { min: P, index: p } = C5(d.map((ee) => Math.abs(ee))), { min: c, index: H } = C5(v.map((ee) => Math.abs(ee))), T = u < t ? o[l] : NaN, q = P < t ? d[p] : NaN, b = c < t ? v[H] : NaN, j = (ee) => ({ 0: "min", 1: "center", 2: "max" })[ee], w = j(Math.floor(l / 3)), m = j(Math.floor(p / 3)), I = j(Math.floor(H / 3)), N = w === "min" ? s : w === "max" ? f : a, k = m === "min" ? s : m === "max" ? f : a, R = I === "min" ? s : I === "max" ? f : a, y = isNaN(T) ? void 0 : {
    from: new S(N.x, n.y, n.z),
    middle: new S(N.x, n.y, a.z),
    to: new S(N.x, a.y, a.z)
  }, O = isNaN(q) ? void 0 : {
    from: new S(n.x, k.y, n.z),
    middle: new S(n.x, k.y, a.z),
    to: new S(a.x, k.y, a.z)
  }, Y = isNaN(b) ? void 0 : {
    from: new S(n.x, n.y, R.z),
    middle: new S(n.x, a.y, R.z),
    to: new S(a.x, a.y, R.z)
  };
  return { x: T, y: q, z: b, px: y, py: O, pz: Y };
}
function Fje(...A) {
  const [e, ...t] = A;
  return t.length === 0 ? e : e + Fje(...A.slice(1));
}
function $Se(A) {
  return A / 2;
}
function eUe(A) {
  let e = A.getVerticesData(J.PositionKind), t = A.getIndices(), r = [];
  for (let s = 0; s < (e == null ? void 0 : e.length); s++)
    for (let a = 0; a < 3; a++) {
      let f = t[3 * s + a];
      r.push(S.FromArray(e, 3 * f));
    }
  let n = A.getBoundingInfo().boundingBox.centerWorld, i = 0;
  for (let s = 0; s < (r == null ? void 0 : r.length); s += 3)
    i += Nje(
      n,
      r[s],
      r[s + 1],
      r[s + 2]
    );
  return Math.abs(i);
}
function Nje(A, e, t, r) {
  let n = e.subtract(A), i = t.subtract(A), s = r.subtract(A), a = S.Dot(S.Cross(n, i), s) / 6;
  return Math.abs(a);
}
function tUe(A) {
  let e = A.getVerticesData(J.PositionKind), t = A.getIndices(), r = [];
  for (let i = 0; i < (e == null ? void 0 : e.length); i++)
    for (let s = 0; s < 3; s++) {
      let a = t[3 * i + s];
      r.push(S.FromArray(e, 3 * a));
    }
  let n = 0;
  for (let i = 0; i < (r == null ? void 0 : r.length); i += 3)
    n += Qje(
      r[i],
      r[i + 1],
      r[i + 2]
    );
  return n;
}
function Qje(A, e, t) {
  let r = e.subtract(A), n = t.subtract(A);
  return Math.abs(S.Distance(S.Cross(r, n), S.Zero())) * 0.5;
}
function i9e(A, e) {
  let t = e.getEngine();
  var r = S.Project(
    A,
    he.Identity(),
    e.getTransformMatrix(),
    e.activeCamera.viewport.toGlobal(
      t.getRenderWidth(),
      t.getRenderHeight()
    )
  );
  return {
    x: r.x,
    y: r.y
  };
}
function rUe(A, e, t) {
  return t.pick(A, e).pickedPoint;
}
function nUe(A, e, t = 1, r = 1) {
  const n = {
    centimeter: 1,
    decimeter: 10,
    meter: 100
  };
  return n[A] * t / (n[e] * r);
}
const qI = (A, e) => {
  const { x: t = 0, y: r = 0, z: n = 0 } = A, { x: i = 0, y: s = 0, z: a = 0 } = e;
  return ((t - i) ** 2 + (r - s) ** 2 + (n - a) ** 2) ** 0.5;
}, iUe = (A, e, t) => {
  const { x: r, y: n, z: i } = A, { x: s, y: a, z: f } = e, o = [];
  return o.push({
    x: s + t * (i - f) / qI(A, e),
    y: a,
    z: f - t * (r - s) / qI(A, e)
  }), o.push({
    x: s - t * (i - f) / qI(A, e),
    y: a,
    z: f + t * (r - s) / qI(A, e)
  }), o;
}, sUe = (A, e, t, r) => {
  const n = { x: 0, y: 0 };
  let i = null, s = null, a = 0, f = 0;
  return A.x !== e.x && (i = (e.y - A.y) / (e.x - A.x)), t.x !== r.x && (s = (r.y - t.y) / (r.x - t.x)), i === s ? !1 : (i !== null && (a = (e.x * A.y - A.x * e.y) / (e.x - A.x)), s !== null && (f = (r.x * t.y - t.x * r.y) / (r.x - t.x)), i === null ? (n.x = A.x, n.y = s * n.x + f) : s === null ? (n.x = t.x, n.y = i * n.x + a) : i === 0 ? (n.x = (A.y - f) / s, n.y = A.y) : s === 0 ? (n.x = (t.y - a) / i, n.y = t.y) : (n.x = (f - a) / (i - s), n.y = (s * a - i * f) / (s - i)), n);
};
function aUe(A, e, t, r = !0) {
  let n = t || 50, i = Math.cos(e * Math.PI / 180) * Math.cos(A * Math.PI / 180) * n, s = r ? 0 : Math.cos(e * Math.PI / 180) * Math.sin(A * Math.PI / 180) * n, a = Math.sin(e * Math.PI / 180) * n;
  return new S(i, s, a);
}
const s9e = (A, e, t) => ({
  x: A * Math.sin(t) * Math.cos(e),
  y: A * Math.cos(t),
  z: A * Math.sin(t) * Math.sin(e)
}), oUe = (A, e) => A && e ? Math.round(A / e) * e - A : 0, J_ = (A = 0, e = 1, t = 0) => Math.round((Math.random() * e + A) * Math.pow(10, t)) / Math.pow(10, t), fUe = (A) => (A = A % 360, A < 0 && (A = A + 360), A), Yje = "data:image/png;base64,[encoded data, 43220 characters]", a9e = {
  name: "rainDense",
  id: "rainDense",
  capacity: 3e3,
  emitter: [
    0,
    300,
    0
  ],
  particleEmitterType: {
    type: "BoxParticleEmitter",
    direction1: [
      0,
      -1,
      0
    ],
    direction2: [
      0,
      -1,
      0
    ],
    minEmitBox: [
      -30,
      0,
      -30
    ],
    maxEmitBox: [
      30,
      0,
      30
    ]
  },
  textureName: Yje,
  animations: [],
  startDelay: 0,
  renderingGroupId: 0,
  isBillboardBased: !0,
  billboardMode: 2,
  minAngularSpeed: 0,
  maxAngularSpeed: 0,
  minSize: 1,
  maxSize: 1,
  minScaleX: 0.5,
  maxScaleX: 2,
  minScaleY: 0.5,
  maxScaleY: 4,
  minEmitPower: 100,
  maxEmitPower: 100,
  minLifeTime: 5,
  maxLifeTime: 5,
  emitRate: 60,
  gravity: [
    0,
    0,
    0
  ],
  noiseStrength: [
    10,
    10,
    10
  ],
  color1: [
    1,
    1,
    1,
    1
  ],
  color2: [
    1,
    1,
    1,
    1
  ],
  colorDead: [
    1,
    1,
    1,
    0
  ],
  updateSpeed: 0.03333333333333333,
  targetStopDuration: 0,
  blendMode: 1,
  preWarmCycles: 50,
  preWarmStepOffset: 1,
  minInitialRotation: 0,
  maxInitialRotation: 0,
  startSpriteCellID: 0,
  endSpriteCellID: 3,
  spriteCellChangeSpeed: 0,
  spriteCellWidth: 128,
  spriteCellHeight: 512,
  spriteRandomStartCell: !0,
  isAnimationSheetEnabled: !0,
  colorGradients: [
    {
      gradient: 0,
      color1: [
        1,
        1,
        1,
        0.3
      ]
    },
    {
      gradient: 1,
      color1: [
        1,
        1,
        1,
        0.3
      ]
    }
  ],
  textureMask: [
    1,
    1,
    1,
    1
  ],
  customShader: null,
  preventAutoStart: !0
};
class o9e extends ps {
  constructor(e, t, r, n, i, s, a) {
    super(e, t, r, n, i, s), this.setOrthogonalCameraOb = () => {
      if (this.inputOb)
        return;
      let f = this.getScene();
      this.inputOb = f.onPointerObservable.add((o, d) => {
        o.type == 8 && (f.getEngine().getRenderHeight(), f.getEngine().getRenderWidth(), o.event.deltaY > 0 ? this.orthoRadius += 0.5 : this.orthoRadius -= 0.5);
      });
    }, this.clearOrthogonalCameraOb = () => {
      this.inputOb && (this.getScene().onPointerObservable.remove(this.inputOb), this.inputOb = void 0);
    }, this.inputs.remove(this.inputs.attached.keyboard), this.zoomToMouseLocation = !1, this.lowerRadiusLimit = 1, this.upperRadiusLimit = 1e4, this.lowerAlphaLimit = Math.PI / 2, this.upperAlphaLimit = Math.PI / 2, this.lowerBetaLimit = 0, this.upperBetaLimit = 0, this.inertia = 0.6, this.panningInertia = 0.6, this.inertialRadiusOffset = 0.6, this.panningAxis = new S(1, 1, 1), this.wheelPrecision = 2.5, this.panningSensibility = 100, this.angularSensibilityX = 500, this.angularSensibilityY = 500, this.maxZ = 99999, this.minZ = -99999, this.mode = 1, this.orthoRadius = n;
  }
  set orthoRadius(e) {
    this._orthoRadius = e;
    let t = this.getScene().getEngine().getRenderHeight(), n = this.getScene().getEngine().getRenderWidth() / t;
    this.orthoBottom = -e / n, this.orthoTop = e / n, this.orthoLeft = -e, this.orthoRight = e;
  }
  get orthoRadius() {
    return this._orthoRadius;
  }
}
Ue("BABYLON.OrthographicCamera", o9e);
const Mje = {
  rain: a9e
}, Lje = {
  cloudy: C1e,
  default: O1e,
  dusk: y1e,
  night: k1e,
  sunny: E1e
}, Kje = {
  default: "",
  cloudy: F1e,
  dusk: N1e,
  night: Q1e,
  sunny: Y1e
}, VI = class VI {
  constructor(e, t = {}) {
    this.isEnabled = () => !0, this._lon = 0, this._lat = 0, this.pipeline = null, this._usePipeline = !1, this._samples = 1, this._bloomEnabled = !1, this._bloomKernel = 64, this._bloomScale = 0.5, this._bloomThreshold = 0.9, this._bloomWeight = 0.15, this._imageProcessingEnabled = !1, this._contrast = 1, this._exposure = 1, this._colorGradingTexture = "", this._colorGradingLevel = 1, this._globalHue = 0, this._globalSaturation = 0, this._useSharpen = !1, this._edgeAmount = 0.3, this._colorAmount = 1, this.SSR = null, this._useSSR = !1, this._SSRStrength = 1, this._SSRStep = 1, this._SSRRreflectionSpecularFalloffExponent = 0.1, this._SSRBlurDispersionStrength = 0.03, this.ground = null, this._groundEnabled = !1, this._groundMainColor = A4("rgb(30, 36, 48)"), this._groundLineColor = A4("rgb(225, 225, 225)"), this._groundOpacity = 1, this.arcRotateCamera = null, this.orthographicCamera = null, this._activeCameraType = 0, this._cameraPanningMouseButton = 2, this._cameraAttached = !1, this._particleSystem = null, this._skybox = null, this._hdr = null, this._environmentType = "default", this._skyboxUrl = "", this._hdrUrl = "", this._hdrIntensity = 1, this._minutes = 540, this._sunEnabled = !0, this._sunMaxIntensity = 2, this._sunShadowEnabled = !0, this._sunFilteringQuality = 1, this._sunBias = 0.5, this._weather = "", this._weatherArea = 500, this._weatherEmitRate = 1, this._weatherEmitterHeight = 300, this._weatherSpeed = 150, this.getClassName = () => "LScene", this.setTime = (i, s = 0) => {
      i = i % 24, i < 0 && (i += 24), s = s % 60, s < 0 && (s += 60);
      const a = i * 60 + s;
      this.minutes = a;
    }, this.weatherStart = () => {
      var i;
      (i = this._particleSystem) == null || i.start();
    }, this.weatherStop = () => {
      var i;
      (i = this._particleSystem) == null || i.stop();
    }, this.getCamera = (i) => i === 0 ? this.arcRotateCamera : this.orthographicCamera, this.showCameraTargetMesh = () => {
      if (this._targetMesh)
        return;
      const i = Ef.CreateSphere(_1e), s = this.arcRotateCamera.radius / 100;
      i.scaling = new S(s, s, s), i.isPickable = !1;
      const a = new Wt("", this.manager.scene.scene);
      a.maxSimultaneousLights = 0, a.emissiveColor = new Ne(1, 0.7, 0.4), i.material = a, i.position.copyFrom(this.arcRotateCamera.target), this._targetMesh = i, this._observable && this.arcRotateCamera.onViewMatrixChangedObservable.remove(
        this._observable
      ), this._observable = this.arcRotateCamera.onViewMatrixChangedObservable.add(
        () => {
          const f = this.arcRotateCamera.radius / 100;
          this._targetMesh.scaling = new S(f, f, f), this._targetMesh.position.copyFrom(this.arcRotateCamera.target);
        }
      );
    }, this.hideCameraTargetMesh = () => {
      var i;
      (i = this._targetMesh) == null || i.dispose(!1, !0), this._targetMesh = void 0, this.arcRotateCamera.onViewMatrixChangedObservable.remove(this._observable), this._observable = void 0;
    }, this.dispose = () => {
      var i, s, a, f, o, d;
      (i = this.pipeline) == null || i.dispose(), this.pipeline = void 0, (s = this.SSR) == null || s.dispose(), this.SSR = void 0, this.sun.dispose(), this.sun = void 0, (a = this._particleSystem) == null || a.dispose(), this._particleSystem = void 0, (f = this._skybox) == null || f.dispose(), this._skybox = void 0, (o = this._hdr) == null || o.dispose(), this._hdr = void 0, (d = this.ground) == null || d.dispose(!1, !0), this.ground = void 0, this.arcRotateCamera.dispose(), this.arcRotateCamera = void 0, this.orthographicCamera.dispose(), this.orthographicCamera = void 0, this.scene.dispose(), this.scene = void 0;
    }, this._updateSkybox = () => {
      this._skybox && (this._skybox.dispose(), this._skybox = null);
      let i = Kje[this._environmentType] || this._skyboxUrl;
      i === "cloudy" ? i = F1e : i === "dusk" ? i = N1e : i === "night" ? i = Q1e : i === "sunny" && (i = Y1e), i && (this._skybox = new US(
        yC,
        i,
        { resolution: 32, size: 1e4 },
        this.scene
      ), this._skybox.name = yC, this._skybox.imageMode = US.MODE_SIDEBYSIDE, this._skybox.getChildren(() => !0, !1).forEach((s, a) => {
        s.name = yC + "_child_" + a, s instanceof jn && (s.isPickable = !1);
      }), this._skybox.texture && (this._skybox.texture.uScale = 1, this._skybox.texture.vScale = 1), this._skybox.onReady = () => {
        this.scene.materials.forEach((s) => {
          s instanceof la && !s.getRenderList().includes(this._skybox.mesh) && s.addToRenderList(this._skybox.mesh);
        });
      });
    }, this._updateHDR = () => {
      this._hdr && (this._hdr.dispose(), this._hdr = null, this.scene.environmentTexture = null);
      let i = Lje[this._environmentType] || this._hdrUrl;
      i === "default" ? i = O1e : i === "cloudy" ? i = C1e : i === "night" ? i = k1e : i === "dusk" ? i = y1e : i === "sunny" && (i = E1e), i && (this._hdr = MBe(i) ? new _2(i, this.scene, 512) : new v1(i, this.scene, void 0, void 0, void 0, void 0, void 0, void 0, void 0, ".env"), this.scene.environmentTexture = this._hdr);
    }, this._updateLight = () => {
      if (!this.sun.isEnabled())
        return;
      const i = ye.ToRadians(0), s = ye.ToRadians(this.minutes / 4), a = 99999, { x: f, y: o, z: d } = s9e(a, i, s);
      this.sun.direction = new S(f, o, d), this.sun.position = new S(-f, -o, -d), this._updateIntensity();
    }, this._updateIntensity = () => {
      this.minutes <= 720 ? this.sun.intensity = this._sunMaxIntensity * ((this.minutes - 360) / 360) : this.sun.intensity = this._sunMaxIntensity * ((1080 - this.minutes) / 360), this.sun.intensity < 0 && (this.sun.intensity = 0);
    }, this._updateShadowEnabled = () => {
      if (this.sunShadowEnabled) {
        this.sun.autoUpdateExtends = !0;
        const i = new ln(1024, this.sun);
        i.normalBias = 0.1, i.usePercentageCloserFiltering = !0, i.bias = this.sunBias / 1e4, i.filteringQuality = this.sunFilteringQuality, this.scene.meshes.filter((s) => !TD(s)).forEach((s) => {
          const a = this.manager.getMetadata(s);
          a != null && a.generateShadow && (i == null || i.addShadowCaster(s, !1));
        });
      } else {
        const i = this.sun.getShadowGenerator();
        i == null || i.dispose();
      }
      this.sun.shadowEnabled = this.sunShadowEnabled;
    }, this._updateFilteringQuality = () => {
      const i = this.sun.getShadowGenerator();
      i && (i.filteringQuality = this.sunFilteringQuality);
    }, this._updateBais = () => {
      const i = this.sun.getShadowGenerator();
      i && (i.bias = this.sunBias / 1e4);
    }, this._updateWeather = () => {
      this._particleSystem && (this._particleSystem.dispose(), this._particleSystem = null);
      const i = Mje[this._weather];
      if (this._weather && i) {
        const s = this._weatherSpeed, a = this._weatherEmitterHeight / s;
        let o = this._weatherEmitRate / 1e3 / VI.FPS * Math.pow(this._weatherArea, 2) * VI.FPS * a;
        o > 1e6 && (o = 1e6);
        const v = (bc.IsSupported ? bc : ti).Parse(
          a9e,
          this.scene,
          "",
          !0,
          o
        );
        v.emitter = new S(0, this._weatherEmitterHeight, 0), v.minLifeTime = a, v.maxLifeTime = a, v.minEmitPower = s, v.maxEmitPower = s, v.particleEmitterType.minEmitBox = new S(-this._weatherArea / 2, 0, -this._weatherArea / 2), v.particleEmitterType.maxEmitBox = new S(this._weatherArea / 2, 0, this._weatherArea / 2), v.start(), this._particleSystem = v;
      }
    };
    const { id: r = Zn(), name: n = "新建场景" } = t;
    this.manager = e, this.scene = new sr(e.root.engine), this.scene.preventDefaultOnPointerDown = !1, this.clearColor = lR("rgba(30, 36, 48, 1)"), this.ambientColor = Ne.White(), this.id = r, this.name = n, this.arcRotateCamera = new ps(
      Z1e,
      ye.ToRadians(90),
      ye.ToRadians(45),
      50,
      S.Zero(),
      this.scene
    ), this.arcRotateCamera.id = "旋转相机", this.arcRotateCamera.inputs.remove(
      this.arcRotateCamera.inputs.attached.keyboard
    ), this.arcRotateCamera.zoomToMouseLocation = !1, this.arcRotateCamera.lowerRadiusLimit = 1, this.arcRotateCamera.upperRadiusLimit = 1e4, this.arcRotateCamera.lowerBetaLimit = 0, this.arcRotateCamera.upperBetaLimit = Math.PI, this.arcRotateCamera.inertia = 0.6, this.arcRotateCamera.panningInertia = 0.6, this.arcRotateCamera.inertialRadiusOffset = 0.6, this.arcRotateCamera.panningAxis = new S(1, 1, 1), this.arcRotateCamera.wheelPrecision = 2.5, this.arcRotateCamera.panningSensibility = 100, this.arcRotateCamera.angularSensibilityX = 500, this.arcRotateCamera.angularSensibilityY = 500, this.orthographicCamera = new o9e(
      n2e,
      ye.ToRadians(90),
      0,
      this.arcRotateCamera.radius,
      S.Zero(),
      this.scene
    ), this.sun = new IA(
      "le5le_sun",
      new S(0, 0, 0),
      this.scene
    ), this.sun.autoCalcShadowZBounds = !0, this._updateSkybox(), this._updateHDR(), this._updateLight(), this._updateShadowEnabled(), this._updateBais(), this._updateFilteringQuality(), this.manager.root.getOptions().operateMode === 2 ? this.cameraPanningMouseButton = 0 : this.cameraPanningMouseButton = 2, [this.arcRotateCamera, this.orthographicCamera].forEach((i, s) => {
      i.onViewMatrixChangedObservable.add(() => {
        i.panningSensibility = 5e3 / i.radius, s === 1 && (i.orthoRadius = i.radius), this.manager.root.emit("cameraViewChanged", {
          type: s,
          camera: i,
          sceneManager: this.manager
        });
      });
    });
  }
  get lon() {
    return this._lon;
  }
  set lon(e) {
    this._lon = e;
  }
  get lat() {
    return this._lon;
  }
  set lat(e) {
    this._lat = e;
  }
  get clearColor() {
    return this.scene.clearColor;
  }
  set clearColor(e) {
    this.scene.clearColor = e;
  }
  get ambientColor() {
    return this.scene.ambientColor;
  }
  set ambientColor(e) {
    this.scene.ambientColor = e;
  }
  get useOrderIndependentTransparency() {
    return this.scene.useOrderIndependentTransparency;
  }
  set useOrderIndependentTransparency(e) {
    this.scene.useOrderIndependentTransparency = e;
  }
  get usePipeline() {
    return this._usePipeline;
  }
  set usePipeline(e) {
    this._usePipeline = e;
    let t = [this.arcRotateCamera, this.orthographicCamera];
    e ? this.pipeline ? t.forEach((r) => {
      var n;
      this.pipeline.cameras.includes(r) || (n = this.pipeline) == null || n.addCamera(r);
    }) : (this.pipeline = new K9(
      zd + "_pipeline",
      !0,
      this.scene,
      t
    ), this.samples = this.samples, this.bloomEnabled = this.bloomEnabled, this.imageProcessingEnabled = this.imageProcessingEnabled, this.useSharpen = this.useSharpen, this.useSSR = this.useSSR) : t.forEach((r) => {
      var n;
      (n = this.pipeline) == null || n.removeCamera(r);
    });
  }
  get samples() {
    return this._samples;
  }
  set samples(e) {
    this._samples = e, this.pipeline && (this.pipeline.samples = e);
  }
  get bloomEnabled() {
    return this._bloomEnabled;
  }
  set bloomEnabled(e) {
    this._bloomEnabled = e, this.pipeline && (this.pipeline.bloomEnabled = e, this.bloomKernel = this.bloomKernel, this.bloomScale = this.bloomScale, this.bloomThreshold = this.bloomThreshold, this.bloomWeight = this.bloomWeight);
  }
  get bloomKernel() {
    return this._bloomKernel;
  }
  set bloomKernel(e) {
    this._bloomKernel = e, this.pipeline && (this.pipeline.bloomKernel = e);
  }
  get bloomScale() {
    return this._bloomScale;
  }
  set bloomScale(e) {
    this._bloomScale = e, this.pipeline && (this.pipeline.bloomScale = e);
  }
  get bloomThreshold() {
    return this._bloomThreshold;
  }
  set bloomThreshold(e) {
    this._bloomThreshold = e, this.pipeline && (this.pipeline.bloomThreshold = e);
  }
  get bloomWeight() {
    return this._bloomWeight;
  }
  set bloomWeight(e) {
    this._bloomWeight = e, this.pipeline && (this.pipeline.bloomWeight = e);
  }
  get imageProcessingEnabled() {
    return this._imageProcessingEnabled;
  }
  set imageProcessingEnabled(e) {
    this._imageProcessingEnabled = e, this.pipeline && (this.pipeline.imageProcessingEnabled = e, this.contrast = this.contrast, this.exposure = this.exposure, this.colorGradingTexture = this.colorGradingTexture, this.colorGradingLevel = this.colorGradingLevel, this.globalHue = this.globalHue, this.globalSaturation = this.globalSaturation);
  }
  get contrast() {
    return this._contrast;
  }
  set contrast(e) {
    var t;
    this._contrast = e, (t = this.pipeline) != null && t.imageProcessing && (this.pipeline.imageProcessing.contrast = e);
  }
  get exposure() {
    return this._exposure;
  }
  set exposure(e) {
    var t;
    this._exposure = e, (t = this.pipeline) != null && t.imageProcessing && (this.pipeline.imageProcessing.exposure = e);
  }
  get colorGradingTexture() {
    return this._colorGradingTexture;
  }
  set colorGradingTexture(e) {
    var t, r, n, i;
    if (this._colorGradingTexture = e, (n = (r = (t = this.pipeline) == null ? void 0 : t.imageProcessing) == null ? void 0 : r.colorGradingTexture) == null || n.dispose(), (i = this.pipeline) != null && i.imageProcessing)
      if (e) {
        const s = new PD(e, this.scene);
        this.pipeline.imageProcessing.colorGradingTexture = s, this.pipeline.imageProcessing.colorGradingEnabled = !0;
      } else
        this.pipeline.imageProcessing.colorGradingTexture = null;
  }
  get colorGradingLevel() {
    return this._colorGradingLevel;
  }
  set colorGradingLevel(e) {
    var t, r;
    this._colorGradingLevel = e, (r = (t = this.pipeline) == null ? void 0 : t.imageProcessing) != null && r.colorGradingTexture && (this.pipeline.imageProcessing.colorGradingTexture.level = e);
  }
  get globalHue() {
    return this._globalHue;
  }
  set globalHue(e) {
    var t;
    this._globalHue = e, (t = this.pipeline) != null && t.imageProcessing && (this.pipeline.imageProcessing.colorCurves || (this.pipeline.imageProcessing.colorCurves = new so(), this.pipeline.imageProcessing.colorCurvesEnabled = !0), this.pipeline.imageProcessing.colorCurves.globalHue = e, this.pipeline.imageProcessing.colorCurves.midtonesExposure);
  }
  get globalSaturation() {
    return this._globalSaturation;
  }
  set globalSaturation(e) {
    var t;
    this._globalSaturation = e, (t = this.pipeline) != null && t.imageProcessing && (this.pipeline.imageProcessing.colorCurves || (this.pipeline.imageProcessing.colorCurves = new so(), this.pipeline.imageProcessing.colorCurvesEnabled = !0), this.pipeline.imageProcessing.colorCurves.globalSaturation = e);
  }
  get useSharpen() {
    return this._useSharpen;
  }
  set useSharpen(e) {
    this._useSharpen = e, this.pipeline && (this.pipeline.sharpenEnabled = e, this.edgeAmount = this.edgeAmount, this.colorAmount = this.colorAmount);
  }
  get edgeAmount() {
    return this._edgeAmount;
  }
  set edgeAmount(e) {
    this._edgeAmount = e, this.pipeline && (this.pipeline.sharpen.edgeAmount = e);
  }
  get colorAmount() {
    return this._colorAmount;
  }
  set colorAmount(e) {
    this._colorAmount = e, this.pipeline && (this.pipeline.sharpen.colorAmount = e);
  }
  get useSSR() {
    return this._useSSR;
  }
  set useSSR(e) {
    this._useSSR = e, e ? (this.SSR || (this.SSR = new Wa(
      "le5le_SSR",
      this.scene,
      [this.arcRotateCamera, this.orthographicCamera],
      !1,
      0
    ), this.SSR.enableSmoothReflections = !0, this.SSR.enableAutomaticThicknessComputation = !0, this.SSR.maxDistance = 30, this.SSRStrength = this.SSRStrength, this.SSRStep = this.SSRStep, this.SSRBlurDispersionStrength = this.SSRBlurDispersionStrength, this.SSRRreflectionSpecularFalloffExponent = this.SSRRreflectionSpecularFalloffExponent), this.SSR.isEnabled = !0) : this.SSR && (this.SSR.isEnabled = !1);
  }
  get SSRStrength() {
    return this._SSRStrength;
  }
  set SSRStrength(e) {
    this._SSRStrength = e, this.SSR && (this.SSR.strength = e);
  }
  get SSRStep() {
    return this._SSRStep;
  }
  set SSRStep(e) {
    this._SSRStep = e, this.SSR && (this.SSR.step = e);
  }
  get SSRRreflectionSpecularFalloffExponent() {
    return this._SSRRreflectionSpecularFalloffExponent;
  }
  set SSRRreflectionSpecularFalloffExponent(e) {
    this._SSRRreflectionSpecularFalloffExponent = e, this.SSR && (this.SSR.reflectionSpecularFalloffExponent = e);
  }
  get SSRBlurDispersionStrength() {
    return this._SSRBlurDispersionStrength;
  }
  set SSRBlurDispersionStrength(e) {
    this._SSRBlurDispersionStrength = e, this.SSR && (this.SSR.blurDispersionStrength = e);
  }
  get groundEnabled() {
    return this._groundEnabled;
  }
  set groundEnabled(e) {
    if (this._groundEnabled = e, e && !this.ground) {
      const { groundMainColor: t, groundLineColor: r, groundOpacity: n } = this;
      this.ground = Ef.CreateGround(
        s2e,
        { width: 1e4, height: 1e4 },
        this.scene
      );
      const i = new RA(Zn(), this.scene);
      i.mainColor = t, i.lineColor = r, i.opacity = n, this.ground.material = i;
    } else
      !e && this.ground && (this.ground.dispose(!1, !0), this.ground = null);
  }
  get groundMainColor() {
    return this._groundMainColor;
  }
  set groundMainColor(e) {
    this._groundMainColor = e, this.ground && (this.ground.material.mainColor = e);
  }
  get groundLineColor() {
    return this._groundLineColor;
  }
  set groundLineColor(e) {
    this._groundLineColor = e, this.ground && (this.ground.material.lineColor = e);
  }
  get groundOpacity() {
    return this._groundOpacity;
  }
  set groundOpacity(e) {
    this._groundOpacity = e, this.ground && (this.ground.material.opacity = e);
  }
  get activeCamera() {
    return this.activeCameraType === 0 ? this.arcRotateCamera : this.orthographicCamera;
  }
  get activeCameraType() {
    return this._activeCameraType;
  }
  set activeCameraType(e) {
    this._activeCameraType = e, this.activeCamera.detachControl(), e === 0 ? this.scene.activeCamera = this.arcRotateCamera : this.scene.activeCamera = this.orthographicCamera, this.cameraAttached && (this.cameraAttached = !1, this.cameraAttached = !0);
  }
  get cameraPanningMouseButton() {
    return this._cameraPanningMouseButton;
  }
  set cameraPanningMouseButton(e) {
    this._cameraPanningMouseButton = e, this.cameraAttached && (this.cameraAttached = !1, this.cameraAttached = !0);
  }
  get cameraAttached() {
    return this._cameraAttached;
  }
  set cameraAttached(e) {
    var t;
    e !== this._cameraAttached && (this._cameraAttached = e, this.arcRotateCamera.detachControl(), this.orthographicCamera.detachControl(), e && ((t = this.activeCamera) == null || t.attachControl(
      !0,
      !1,
      this.cameraPanningMouseButton
    )));
  }
  get cameraTarget() {
    return this.activeCamera.target;
  }
  set cameraTarget(e) {
    this.activeCamera.setTarget(e);
  }
  get cameraRadius() {
    return this.activeCameraType === 0 ? this.arcRotateCamera.radius : this.orthographicCamera.orthoRadius;
  }
  set cameraRadius(e) {
    this.activeCameraType === 0 ? this.arcRotateCamera.radius = e : this.orthographicCamera.orthoRadius = e;
  }
  get cameraLowerRadiusLimit() {
    return this.arcRotateCamera.lowerRadiusLimit;
  }
  set cameraLowerRadiusLimit(e) {
    this.activeCamera.lowerRadiusLimit = e;
  }
  get cameraUpperRadiusLimit() {
    return this.activeCamera.upperRadiusLimit;
  }
  set cameraUpperRadiusLimit(e) {
    this.activeCamera.upperRadiusLimit = e;
  }
  get cameraAlpha() {
    return ye.ToDegrees(this.activeCamera.alpha);
  }
  set cameraAlpha(e) {
    this.activeCamera.alpha = ye.ToRadians(e);
  }
  get cameraLowerAlphaLimit() {
    return ye.ToDegrees(this.activeCamera.lowerAlphaLimit);
  }
  set cameraLowerAlphaLimit(e) {
    this.activeCamera.lowerAlphaLimit = ye.ToRadians(e);
  }
  get cameraUpperAlphaLimit() {
    return ye.ToDegrees(this.activeCamera.upperAlphaLimit);
  }
  set cameraUpperAlphaLimit(e) {
    this.activeCamera.upperAlphaLimit = ye.ToRadians(e);
  }
  get cameraBeta() {
    return ye.ToDegrees(this.activeCamera.beta);
  }
  set cameraBeta(e) {
    this.activeCamera.beta = ye.ToRadians(e);
  }
  get cameraLowerBetaLimit() {
    return ye.ToDegrees(this.activeCamera.lowerBetaLimit);
  }
  set cameraLowerBetaLimit(e) {
    this.activeCamera.lowerBetaLimit = ye.ToRadians(e);
  }
  get cameraUpperBetaLimit() {
    return ye.ToDegrees(this.activeCamera.upperBetaLimit);
  }
  set cameraUpperBetaLimit(e) {
    this.activeCamera.upperBetaLimit = ye.ToRadians(e);
  }
  get cameraFov() {
    return this.activeCamera.fov;
  }
  set cameraFov(e) {
    this.activeCamera.fov = e;
  }
  get environmentType() {
    return this._environmentType;
  }
  set environmentType(e) {
    const t = this._environmentType !== e;
    this._environmentType = e, t && (this._updateSkybox(), this._updateHDR());
  }
  get skyboxUrl() {
    return this._skyboxUrl;
  }
  set skyboxUrl(e) {
    const t = this._skyboxUrl !== e;
    this._skyboxUrl = e, t && !this._environmentType && this._updateSkybox();
  }
  get hdrUrl() {
    return this._hdrUrl;
  }
  set hdrUrl(e) {
    const t = this._hdrUrl !== e;
    this._hdrUrl = e, t && !this._environmentType && this._updateHDR();
  }
  get hdrIntensity() {
    return this._hdrIntensity;
  }
  set hdrIntensity(e) {
    this._hdrIntensity = e, this.scene.environmentIntensity = e;
  }
  get minutes() {
    return this._minutes;
  }
  set minutes(e) {
    const t = this._minutes !== e;
    this._minutes = e, t && this._updateLight();
  }
  get sunEnabled() {
    return this._sunEnabled;
  }
  set sunEnabled(e) {
    this._sunEnabled = e, this.sun.setEnabled(e);
  }
  get sunMaxIntensity() {
    return this._sunMaxIntensity;
  }
  set sunMaxIntensity(e) {
    const t = this._sunMaxIntensity !== e;
    this._sunMaxIntensity = e, t && this._updateIntensity();
  }
  get sunShadowEnabled() {
    return this._sunShadowEnabled;
  }
  set sunShadowEnabled(e) {
    const t = this._sunShadowEnabled !== e;
    this._sunShadowEnabled = e, t && this._updateShadowEnabled();
  }
  get sunFilteringQuality() {
    return this._sunFilteringQuality;
  }
  set sunFilteringQuality(e) {
    const t = this._sunFilteringQuality !== e;
    this._sunFilteringQuality = e, t && this._updateFilteringQuality();
  }
  get sunBias() {
    return this._sunBias;
  }
  set sunBias(e) {
    const t = this._sunBias !== e;
    this._sunBias = e, t && this._updateBais();
  }
  get weather() {
    return this._weather;
  }
  set weather(e) {
    const t = this._weather !== e;
    this._weather = e, t && this._updateWeather();
  }
  get weatherArea() {
    return this._weatherArea;
  }
  set weatherArea(e) {
    const t = this._weatherArea !== e;
    this._weatherArea = e, t && this._updateWeather();
  }
  get weatherEmitRate() {
    return this._weatherEmitRate;
  }
  set weatherEmitRate(e) {
    const t = this._weatherEmitRate !== e;
    this._weatherEmitRate = e, t && this._updateWeather();
  }
  get weatherEmitterHeight() {
    return this._weatherEmitterHeight;
  }
  set weatherEmitterHeight(e) {
    const t = this._weatherEmitterHeight !== e;
    this._weatherEmitterHeight = e, t && this._updateWeather();
  }
  get weatherSpeed() {
    return this._weatherSpeed;
  }
  set weatherSpeed(e) {
    const t = this._weatherSpeed !== e;
    this._weatherSpeed = e, t && this._updateWeather();
  }
};
VI.FPS = 60;
let C0 = VI;
Ue("BABYLON.LScene", C0);
const TO = class TO {
  constructor(e, t = {}) {
    var a, f;
    this.activeEdgeMeshes = /* @__PURE__ */ new Map(), this.lightRangeMeshesMap = /* @__PURE__ */ new Map(), this._isEditTube = !1, this.MOVE_DIFF = 1, this.SCALE_DIFF = 0.1, this.ROTATE_DIFF = 1, this.autoRotateSpan = 5, this.autoRotateSpeed = 60, this.autoRotateDirection = 0, this.pivotPointPlacementMap = /* @__PURE__ */ new Map(), this._metadataMap = /* @__PURE__ */ new Map(), this._cameraViews = /* @__PURE__ */ new Map(), this._cameraViewGroups = /* @__PURE__ */ new Map(), this._cacheErrorDatas = {
      textures: [],
      materials: [],
      nodes: [],
      instancedNodes: []
    }, this.startRunning = () => {
      this._selectedCache = this.getSelectedNodes(), this.selectNodes([], { emit: !1 }), this.selectorManager.hoverNodes = [], this.stopAutoRotateCamera(), this.networkManager.cancelAll(), this.animateManager.stopAll(), this.highlightManager.clear(), this.highlightManager.running = !0, this.scene.scene.animatables.forEach((o) => o.stop()), this.scene.scene.animationGroups.forEach((o) => {
        o.reset();
      }), this._dataCache = this.data(), this._cacheErrorDatas.textures = [], this._cacheErrorDatas.materials = [], this._cacheErrorDatas.nodes = [], this._cacheErrorDatas.instancedNodes = [], this._optimizeRunning();
    }, this.stopRunning = (o = (d) => {
    }) => {
      this.stopAutoRotateCamera(), this.networkManager.cancelAll(), this.animateManager.stopAll(), this.highlightManager.clear(), this.highlightManager.running = !1, this.scene.scene.animatables.forEach((d) => d.stop()), this.scene.scene.animationGroups.forEach((d) => {
        d.reset();
      }), this._cacheErrorDatas.textures = [], this._cacheErrorDatas.materials = [], this._cacheErrorDatas.nodes = [], this._cacheErrorDatas.instancedNodes = [], this._dataCache && this.load({
        data: this._dataCache,
        onEnd: () => {
          this._selectedCache && this.selectNodes(this._selectedCache, { emit: !1 }), this._selectedCache = void 0, this._dataCache = void 0, o(this);
        }
      });
    }, this.pick = (o = !1, d = this.root.interactManager.offsetX, v = this.root.interactManager.offsetY, u = () => !0) => {
      const l = this.pickDOM(
        d,
        v,
        (p) => u("DOM", p)
      ).DOMPickInfo;
      if (l)
        return { x: d, y: v, DOMPickInfo: l, meshPickInfo: null };
      const P = this.pickMesh(
        o,
        d,
        v,
        (p) => u("Mesh", p)
      ).meshPickInfo;
      return P ? { x: d, y: v, DOMPickInfo: null, meshPickInfo: P } : { x: d, y: v, DOMPickInfo: null, meshPickInfo: null };
    }, this.pickDOM = (o = this.root.interactManager.offsetX, d = this.root.interactManager.offsetY, v = () => !0) => {
      const u = this.DOMManager.doms().reverse().find(
        (P) => this.DOMManager.pointInRef(P.data.id, { x: o, y: d }) && v(P)
      );
      let l = null;
      if (u) {
        const {
          ref: { rect: P }
        } = u;
        l = {
          width: P.width,
          height: P.height,
          x: P.left,
          y: P.top,
          ex: P.width + P.left,
          ey: P.height + P.top,
          cx: P.width / 2 + P.left,
          cy: P.height / 2 + P.top,
          data: u
        };
      }
      return { x: o, y: d, DOMPickInfo: l };
    }, this.pickMesh = (o = !1, d = this.root.interactManager.offsetX, v = this.root.interactManager.offsetY, u = () => !0) => {
      let l = this.scene.scene.pick(d, v, (P) => (o && P === this.scene.ground || !TD(P)) && P.isPickable && P.isEnabled() && u(P));
      return l.pickedMesh || (l = null), { x: d, y: v, meshPickInfo: l };
    }, this.data = () => {
      const o = {}, d = {}, v = {}, u = {}, l = [], P = [];
      return this.nodeManager.getAllNodes().forEach((c) => {
        [c.node, ...this.nodeManager.getChildren(c.node)].forEach(
          (H) => {
            const T = zt.serialize(H, this, !0);
            if (T.material) {
              const q = T.material;
              if (Object.keys(q).forEach((b) => {
                if (V0(q[b]) && zt.isTextureType(q[b].__valueType)) {
                  const j = q[b];
                  if (!u[j.id]) {
                    if (j.__glbUUID) {
                      const w = this.resourceManager.glbUUIDMap.get(
                        j.__glbUUID
                      );
                      w ? d[j.__glbUUID] = w : delete j.__glbUUID;
                    }
                    u[j.id] = j;
                  }
                  q[b] = "id:" + j.id;
                }
              }), !v[q.id]) {
                const b = this.resourceManager.glbUUIDMap.get(
                  q.__glbUUID
                );
                b ? d[q.__glbUUID] = b : delete q.__glbUUID, v[q.id] = q;
              }
              T.material = "id:" + q.id;
            }
            T.__valueType === se.InstancedMesh && T.__instancedID ? P.push(T) : (T.__valueType === se.Mesh && (T.__glbUUID ? (this.resourceManager.glbUUIDMap.has(T.__glbUUID) && (d[T.__glbUUID] = {
              ...this.resourceManager.glbUUIDMap.get(T.__glbUUID)
            }), T.__glbIndex === 0 && (o[T.__glbUUID] = this.pivotPointPlacementMap.get(T.__glbUUID) ?? $2.None)) : o[T.id] = this.pivotPointPlacementMap.get(T.id) ?? $2.None), l.push(T));
          }
        );
      }), this._cacheErrorDatas.textures.forEach((c) => {
        if (u[c.id] = c, c.__glbUUID) {
          const H = this.resourceManager.glbUUIDMap.get(c.__glbUUID);
          H && (d[c.__glbUUID] = H);
        }
      }), this._cacheErrorDatas.materials.forEach((c) => {
        if (v[c.id] = c, c.__glbUUID) {
          const H = this.resourceManager.glbUUIDMap.get(c.__glbUUID);
          H && (d[c.__glbUUID] = H);
        }
      }), this._cacheErrorDatas.nodes.forEach((c) => {
        if (l.push(c), c.__glbUUID) {
          const H = this.resourceManager.glbUUIDMap.get(c.__glbUUID);
          H && (d[c.__glbUUID] = H);
        }
      }), this._cacheErrorDatas.instancedNodes.forEach((c) => {
        if (P.push(c), c.__glbUUID) {
          const H = this.resourceManager.glbUUIDMap.get(c.__glbUUID);
          H && (d[c.__glbUUID] = H);
        }
      }), {
        version: TO.VERSION,
        mockable: this.dynamicDataManager.mockable,
        nodes: l,
        instancedNodes: P,
        scene: zt.serialize(this.scene, this, !0),
        groupDatas: this.groupManager.data(),
        DOMDatas: this.DOMManager.data(),
        dynamicDatas: this.dynamicDataManager.data(),
        networkDatas: this.networkManager.data(),
        cameraViews: this.allCameraViews(),
        cameraViewGroups: this.allCameraViewGroups(),
        pivotPointPlacements: o,
        glbMap: d,
        materials: v,
        textures: u
      };
    }, this.load = (o = {}) => {
      const {
        data: d = {},
        placeholder: v,
        onEnd: u = () => {
        },
        onProgress: l = () => {
        }
      } = o, {
        mockable: P,
        nodes: p = [],
        instancedNodes: c = [],
        scene: H = {},
        DOMDatas: T = [],
        dynamicDatas: q = [],
        groupDatas: b = [],
        networkDatas: j = [],
        cameraViews: w = [],
        cameraViewGroups: m = [],
        pivotPointPlacements: I = {},
        glbMap: N = {},
        materials: k = {},
        textures: R = {},
        ...y
      } = uSe(d);
      this.networkManager.load(j), this.DOMManager.load(T), this.dynamicDataManager.load(q), this.dynamicDataManager.mockable = !!P, this.groupManager.load(b), w.forEach((_) => this._cameraViews.set(_.id, _)), m.forEach(
        (_) => this._cameraViewGroups.set(_.id, _)
      );
      const O = { ...y, ...H };
      O.__valueType = se.Scene, delete O.__targetType, zt.setValue(this.scene, O, this), O.cameraViews && O.cameraViews.forEach(
        (_) => this._cameraViews.set(_.id, _)
      );
      const Y = {};
      p.forEach((_) => {
        _.__glbUUID && _.__valueType === se.Mesh && _.__glbIndex === 0 && (Y[_.__glbUUID] = {
          position: _.position,
          scaling: _.scaling,
          rotation: _.rotation,
          size: _.size
        });
      }), Object.keys(I).forEach((_) => {
        this.pivotPointPlacementMap.set(_, I[_]);
      }), Object.keys(N).forEach((_) => {
        this.resourceManager.glbUUIDMap.set(_, N[_]);
      });
      const ee = [
        Object.keys(R).map((_) => {
          const G = R[_];
          return G.__glbUUID && Y[G.__glbUUID] ? { ...G, ...Y[G.__glbUUID] } : G;
        }),
        Object.keys(k).map((_) => {
          const G = k[_];
          return G.__glbUUID && Y[G.__glbUUID] ? { ...G, ...Y[G.__glbUUID] } : G;
        }),
        p,
        c
      ], Z = ee.reduce((_, G) => _ + G.length, 0);
      let te = 0;
      const fe = (_ = 0) => {
        const G = ee.slice(0, _).reduce((L, $) => L + $.length, 0);
        zt.loadNode(
          {
            data: ee[_],
            placeholder: v,
            onEnd: () => {
              _ === ee.length - 1 ? (u == null || u({ total: Z, loaded: te, manager: this }), this.root.running && this._optimizeRunning()) : fe(++_);
            },
            onProgress: ({ node: L, data: $, index: ae, error: Pe }) => {
              te++, Pe && this._cacheErrorDatas[_ === 0 ? "textures" : _ === 1 ? "materials" : _ === 2 ? "nodes" : "instancedNodes"].push($), l == null || l({
                total: Z,
                loaded: te,
                manager: this,
                data: $,
                node: L,
                index: G + ae,
                error: Pe
              });
            }
          },
          this
        );
      };
      fe();
    }, this.targetData = (o, d) => {
      if (typeof o == "string" && (o = this.getTargetById(o)), !!o)
        return zt.serialize(o, this, d);
    }, this.getValue = (o, d, v = !1) => {
      o = typeof o == "string" ? this.getTargetById(o) : o;
      const [u, ...l] = d.split("#");
      if (u === "animations" || u === "groupAnimations" || u === "contents") {
        const P = zt.getValue(o, u, this);
        return hR.GetNestedValue(P, l).value;
      }
      return zt.getValue(o, d, this, v);
    }, this.setValue = (o, d = {}) => {
      const {
        history: v = !0,
        emit: u = !0,
        duration: l = 0,
        easingMode: P = pp.None,
        onEnd: p = () => {
        }
      } = d, c = Xa(o), H = { type: eD.Update, infos: [] }, T = [];
      let q = 0;
      const b = () => {
        q > 0 || (c[0] && (v && this.undoRedoManager.add(H), u && this.root.emit("setValue", {
          changes: T,
          sceneManager: this
        })), p(T, this));
      };
      c.forEach((j, w) => {
        let { target: m, props: I, properties: N } = j;
        if (m = typeof m == "string" ? this.getTargetById(m) : m, !m)
          return;
        I = N ?? I;
        const k = {};
        for (const R in I) {
          let { target: y, property: O } = zt.getFinalTargetAndProperty(m, R, this);
          if (!y)
            return;
          const { valueType: Y, animatable: ee, setValue: Z, getValue: te } = zt.getTargetPropertyInfo(y, O, this);
          if (Y === se.Unknown)
            return;
          let fe = te(y, this), _ = zt.deserialize(I[R], this, Y);
          if (q++, !ee || l <= 0 || !this.animateManager.beginTransition(
            y,
            O,
            fe,
            _,
            l,
            P,
            () => {
              q--, b();
            }
          )) {
            const G = this.getValue(y, "id");
            this.animateManager.setAtomicAnimate(
              G,
              O,
              null,
              qM.End
            ), Z(y, _, this), q--;
          }
          k[R] = { oldValue: fe, newValue: I[R] }, T[w] || (T[w] = { target: m, props: {} }), T[w].props[R] = {
            oldValue: fe,
            newValue: I[R]
          };
        }
        H.infos.push({ target: m, props: k });
      }), b();
    }, this.addCameraView = (o, d) => {
      const v = this.scene.activeCamera, u = {
        id: o,
        img: "",
        type: this.scene.activeCameraType
      };
      if (v instanceof ps && (u.target = zt.serialize(v.target, this), u.alpha = ye.ToDegrees(v.alpha), u.beta = ye.ToDegrees(v.beta), u.radius = v.radius), this._cameraViews.set(u.id, u), d) {
        const l = typeof d == "boolean" ? { size: { width: 200, height: 150 }, onSuccess: () => {
        } } : d, { size: P = { width: 200, height: 150 }, onSuccess: p = () => {
        } } = l;
        this.root.screenshot(P, (c) => {
          u.img = c, p(u);
        });
      }
      return u;
    }, this.getCameraView = (o) => this._cameraViews.get(o), this.deleteCameraView = (o) => this._cameraViews.delete(o), this.showCameraView = (o, d = {}) => {
      const v = this._cameraViews.get(o);
      if (!v)
        return;
      const { type: u, ...l } = v, P = this.scene.activeCamera, p = P.position.clone(), c = P.target.clone(), H = this.scene.getCamera(u);
      H.position = p, H.setTarget(c), this.moveCamera(l, {
        ...d,
        onEnd: () => {
          var T;
          (T = d.onEnd) == null || T.call(d), this.eventManager.executeTrigger("AfterShowCameraView", null, l);
        }
      });
    }, this.resetCameraView = (o) => {
      if (this.scene.activeCamera instanceof ps) {
        const v = {
          target: { x: 0, y: 0, z: 0 },
          alpha: -90,
          beta: 45,
          radius: 28.2843
        };
        this.moveCamera(v, o);
      }
    }, this.allCameraViews = () => [...this._cameraViews.values()], this.getCameraViewGrouop = (o) => this._cameraViewGroups.get(o), this.setCameraViewGroup = (o, d) => {
      const v = {
        id: o,
        views: d
      };
      return this._cameraViewGroups.set(v.id, v), v;
    }, this.removeCameraViewGroup = (o) => this._cameraViewGroups.delete(o), this.allCameraViewGroups = () => [...this._cameraViewGroups.values()], this.moveCameraToTargets = (o, d = {}) => {
      const {
        target: v,
        zoom: u = !0,
        alpha: l = this.scene.cameraAlpha,
        beta: P = this.scene.cameraBeta,
        radius: p = this.scene.cameraRadius
      } = o, c = Xa(v).map((w) => typeof w == "string" ? this.getTargetById(w) : w);
      if (!c.length)
        return;
      const { min: H, max: T, center: q } = this.getTargetsRange(c);
      if (!H || !T || !q)
        return;
      let b = p, j = 1;
      if (u) {
        const w = T.subtract(H);
        b = Math.max(w.x, w.y, w.z), b < 1 ? j = 2 : b < 1e3 && (j = (b - 1e3) / -999 * 1 + 1);
      }
      this.moveCamera(
        {
          target: q,
          radius: b * j,
          alpha: l,
          beta: P
        },
        d
      );
    }, this.moveCamera = (o, d = {}) => {
      const {
        duration: v = 0.5,
        easingMode: u = pp.Out,
        onEnd: l = () => {
        }
      } = d, P = this.scene.arcRotateCamera, p = { target: this.scene, props: {} };
      if (P instanceof ps) {
        const {
          radius: c = P.radius,
          alpha: H = ye.ToDegrees(P.alpha),
          beta: T = ye.ToDegrees(P.beta),
          target: q = P.target
        } = o, b = q, j = c, w = H, m = T;
        p.props = {
          cameraAlpha: w,
          cameraBeta: m,
          cameraRadius: j,
          "cameraTarget.x": b.x,
          "cameraTarget.y": b.y,
          "cameraTarget.z": b.z
        };
      }
      this.setValue(p, {
        history: !1,
        emit: !1,
        duration: v,
        easingMode: u,
        onEnd: l
      });
    }, this.beginAutoRotateCamera = () => {
      if (this.stopAutoRotateCamera(), this.autoRotateSpeed <= 0)
        return;
      const o = this.scene.activeCamera, d = o.alpha, v = this.autoRotateDirection ? d + 2 * Math.PI : d - 2 * Math.PI, u = 60, l = this.autoRotateSpeed * u, P = [
        {
          frame: 0,
          value: d
        },
        {
          frame: l,
          value: v
        }
      ], p = new st(
        "autoRotateCamera",
        "alpha",
        u,
        st.ANIMATIONTYPE_FLOAT,
        st.ANIMATIONLOOPMODE_CYCLE
      );
      p.setKeys(P);
      const c = this.scene.scene.beginDirectAnimation(
        o,
        [p],
        0,
        l,
        !0
      );
      this._autoRotateAnimatable = c, this.eventManager.executeTrigger(
        "AfterCameraAutoRotateBegin",
        null,
        void 0
      );
    }, this.stopAutoRotateCamera = () => {
      this._autoRotateAnimatable && (this._autoRotateAnimatable.stop(), this._autoRotateAnimatable = void 0, this.eventManager.executeTrigger(
        "AfterCameraAutoRotateStop",
        null,
        void 0
      ));
    }, this.undo = (o = !0) => {
      if (!this.undoRedoManager.undoable())
        return !1;
      this.undoRedoManager.undo() && o && this.root.emit("undo", this);
    }, this.redo = (o = !0) => {
      if (!this.undoRedoManager.redoable())
        return !1;
      this.undoRedoManager.redo() && o && this.root.emit("redo", this);
    }, this.addNodes = (o, d = {}) => {
      const {
        history: v = !0,
        emit: u = !0,
        onSuccess: l = () => {
        },
        onProgress: P = () => {
        },
        onError: p = () => {
        }
      } = d, c = Xa(o).map((T) => (T.__glbName && T.__glbUrl ? (T.__glbUUID = Zn(), this.resourceManager.glbUUIDMap.set(T.__glbUUID, {
        name: T.__glbName,
        url: T.__glbUrl
      })) : T.id = Zn(), this.pivotPointPlacementMap.set(
        T.__glbUUID || T.id,
        this.root.getOptions().pivotPointPlacement
      ), T)), H = [];
      zt.loadNode(
        {
          data: c,
          onEnd: () => {
            const T = Array.from(
              new Set(H.map((q) => this.getRoot(q)))
            );
            v && !this.root.running && this.undoRedoManager.add({
              type: eD.Add,
              infos: T.map((q) => ({ target: q }))
            }), l == null || l(H), u && fq(
              () => this.root.emit("addNodes", {
                nodes: T,
                sceneManager: this
              })
            );
          },
          onProgress: ({ node: T, error: q }) => {
            q ? p == null || p(q) : P == null || P(T), T instanceof Hr && H.push(T);
          }
        },
        this
      );
    }, this.deleteNodes = (o, d = {}) => {
      const { history: v = !0, emit: u = !0 } = d, l = this.getNodes(o), P = Array.from(new Set(l.map((T) => this.getRoot(T)))), p = [];
      this.nodeManager.rootNodes.forEach((T) => {
        const { node: q } = T;
        if (P.includes(q))
          return;
        const b = this.getMetadata(q);
        !b || b.__valueType !== se.InstancedMesh || P.some((j) => {
          var w;
          return j.name === ((w = b.__initOption) == null ? void 0 : w.source);
        }) && p.push(q);
      });
      const c = this.getSelectedNodes();
      this.selectNodes(
        c.filter(
          (T) => l.findIndex((q) => q.name === T.name) === -1
        )
      );
      const H = Array.from(/* @__PURE__ */ new Set([...p, ...P]));
      this.nodeManager.removeNodes(H), this.selectorManager.hoverNodes = this.selectorManager.hoverNodes.filter(
        (T) => !H.includes(T)
      ), v && !this.root.running && this.undoRedoManager.add({
        type: eD.Delete,
        infos: H.map((T) => ({
          target: T
        }))
      }), u && fq(
        () => this.root.emit("deleteNodes", { nodes: l, sceneManager: this })
      );
    }, this.selectNodes = (o = [], d = {}) => {
      const { emit: v = !0, history: u = !0 } = d, l = [...this.getSelectedNodes()], P = o ? this.getNodes(o).filter(
        (H) => H instanceof Hr
      ) : [], p = P.filter(
        (H) => l.findIndex((T) => T.name === H.name) === -1
      ), c = l.filter(
        (H) => P.findIndex((T) => T.name === H.name) === -1
      );
      this.selectorManager.selectedNodes = P, c.length > 0 && c.forEach((H) => {
        this.animateManager.stop(H), this.animateManager.stopGroup(H);
      }), u && this.undoRedoManager.add({
        type: eD.Select,
        infos: [
          {
            oldTargets: [...l],
            newTargets: [...P]
          }
        ]
      }), v && fq(
        () => this.root.emit("selectNodes", {
          nodes: P,
          selected: p,
          deselected: c,
          sceneManager: this
        })
      );
    }, this.setHoverNodes = (o = []) => {
      const d = this.getNodes(o);
      this.selectorManager.hoverNodes = d;
    }, this.addDOMs = (o) => {
      const d = Xa(o), v = this.DOMManager.set(d);
      this.root.emit("addDOMs", v);
    }, this.deleteDOMs = (o) => {
      const d = Xa(o), v = d.forEach((u) => this.DOMManager.get(u));
      this.DOMManager.delete(d), this.root.emit("deleteDOMs", v);
    }, this.setDOMs = (o) => {
      const d = Xa(o), v = this.DOMManager.set(d);
      this.root.emit("setDOMs", v);
    }, this.copyNodes = (o, d = {}) => {
      const {
        instanced: v = !1,
        emit: u = !0,
        history: l = !0,
        onSuccess: P = () => {
        }
      } = d, p = Xa(o), c = Array.from(
        new Set(p.map((T) => this.getRoot(T)))
      ), H = [];
      zt.cloneNode(
        c,
        this,
        v,
        () => {
          l && !this.root.running && this.undoRedoManager.add({
            type: eD.Add,
            infos: H.map((T) => ({ target: T }))
          }), P(H), u && fq(
            () => this.root.emit("addNodes", {
              nodes: H,
              sceneManager: this
            })
          );
        },
        (T, q) => {
          H.push(T);
        }
      );
    }, this.getNodes = (o) => Xa(o).map(
      (v) => typeof v == "string" ? this.getTargetById(v) : v
    ), this.getTargetsByName = (o) => {
      const d = Xa(o), v = [];
      return d.includes(this.name) && v.push(this.scene), v.push(
        ...this.scene.scene.getNodes().filter((u) => d.includes(u.id))
      ), v;
    }, this.getNodesByGroup = (o) => this.groupManager.getNodeIds(o).map((d) => this.getTargetById(d)) || [], this.getTargetById = (o, d) => this.nodeManager.getTargetById(o, d), this.getAnimationGroupById = (o) => this.scene.scene.animationGroups.find(
      (d) => {
        var v;
        return ((v = d.metadata) == null ? void 0 : v.id) === o;
      }
    ), this.getAnimationGroupsByName = (o) => this.scene.scene.animationGroups.filter(
      (d) => {
        var v;
        return ((v = d.metadata) == null ? void 0 : v.name) === o;
      }
    ), this.getSelectedNodes = () => this.selectorManager.selectedNodes, this.getTargets = (o, d) => {
      const { targetType: v = "id", targetList: u = [] } = o;
      return v === "id" ? !u.length && d ? [d] : u.map((l) => this.getTargetById(l)) : v === "name" ? this.getTargetsByName(u) : v === "group" ? [
        ...new Set(
          u.reduce(
            (l, P) => [...l, ...this.getNodesByGroup(P)],
            []
          )
        )
      ] : [];
    }, this.getRoot = (o) => {
      const d = typeof o == "string" ? this.getTargetById(o) : o;
      return this.nodeManager.getRoot(d);
    }, this.getParent = (o) => {
      const d = typeof o == "string" ? this.getTargetById(o) : o;
      return this.nodeManager.getParent(d);
    }, this.getChildren = (o, d = !0) => {
      const v = typeof o == "string" ? this.getTargetById(o) : o;
      return this.nodeManager.getChildren(v, d);
    }, this.getTargetsByRoot = (o) => {
      const d = this.getMetadata(o);
      if (!d)
        return [];
      if (d.__valueType === se.Scene)
        return [o];
      if (!d.__glbUUID)
        return [o];
      const v = d.__instancedID ? this.resourceManager.getInstanced(
        d.__instancedID,
        d.__glbUUID
      ) : this.resourceManager.getResult(d.__glbUUID);
      return [...v.meshes, ...v.transformNodes];
    }, this.getTargetsRange = (o) => {
      let d, v, u;
      const l = (P) => {
        let p, c;
        P instanceof Hr ? { min: p, max: c } = P.getHierarchyBoundingVectors() : (p = new S(P.x, P.y, P.z), c = new S(P.x, P.y, P.z)), !d || !v ? (d = c, v = p) : (d = S.Maximize(d, c), v = S.Minimize(v, p));
      };
      return o.forEach((P) => {
        P instanceof C0 ? this.getRootNodes().forEach((c) => {
          l(c.node);
        }) : l(P);
      }), d && v && (u = S.Center(v, d)), { max: d, min: v, center: u };
    }, this.getMetadata = (o) => this._metadataMap.get(o), this.setMetadata = (o, d = {}) => {
      this._metadataMap.set(o, d);
    }, this.deleteMetadata = (o) => {
      this._metadataMap.delete(o);
    }, this.getMeshes = () => this.scene.scene.meshes.filter((o) => !TD(o)), this.getRootNodes = () => this.nodeManager.getAllNodes(), this.getLayers = () => this.nodeManager.getAllLayers(), this.performance = (o) => {
      this.scene.scene.meshes.filter((d) => !(o != null && o.includes(d.name))).forEach((d) => {
        d instanceof Ee && (d.freezeNormals(), d.freezeWorldMatrix()), d.doNotSyncBoundingInfo = !0, d.isPickable = !1;
        let v = d.material;
        v && v.freeze();
      });
    }, this.dispose = () => {
      this.highlightManager.dispose(), this.networkManager.dispose(), this.animateManager.dispose(), this.undoRedoManager.dispose(), this.DOMManager.dispose(), this.GUIManager.dispose(), this.GUI2dManager.dispose(), this.selectorManager.dispose(), this.resourceManager.dispose(), this.scene.scene.dispose();
    }, this._onNewMeshAdded = (o) => {
      if (o instanceof Ee) {
        let d = setTimeout(() => {
          this.highlightManager.layer.addExcludedMesh(o), this.glManager.addExcludedMesh(o), this.glManager.setGlowLayer(o), clearTimeout(d);
        }, 0);
      }
    }, this._onMeshRemoved = (o) => {
      const d = this.getMetadata(o);
      d != null && d.useGlowLayer && this.scene.scene.getGlowLayerByName("_gl" + o.name) && (this.scene.scene.getGlowLayerByName("_gl" + o.name).isEnabled = !1), o instanceof Ee && this.highlightManager.layer.removeExcludedMesh(o);
    }, this._optimizeRunning = () => {
      const o = [
        "Click",
        "Dblclick",
        "MouseDown",
        "MouseIn",
        "MouseOut",
        "MouseUp",
        "RightClick"
      ];
      this.nodeManager.getAllNodes().forEach((d) => {
        const { node: v, children: u } = d, { events: l } = this.getMetadata(v), P = /* @__PURE__ */ new Set();
        l.filter((c) => o.includes(c.triggerType)).forEach((c) => {
          P.add(
            c.triggerParam.targetIndex
          );
        });
        const p = (c, H) => {
          const { node: T, children: q } = c, { __targetIndex: b } = this.getMetadata(T);
          H = H || P.has(b), T instanceof jn && !H && (T.isPickable = !1), q != null && q.length && q.forEach((j) => p(j, H));
        };
        p(d, !1);
      });
    }, this.mergeMesh = (o) => {
      let d = this.scene.scene.getMeshByName(
        "le5le_mergeMesh" + o.name
      );
      d && d.dispose();
      let v = /* @__PURE__ */ new Map();
      o.getChildMeshes().filter((u) => {
        let l = !1;
        if (u instanceof Ee && u.geometry) {
          let P = u.getVerticesDataKinds().toString();
          v.get(P) || v.set(P, []), v.get(P).push(u), l = !0;
        }
        return l;
      }), v.forEach((u) => {
        Ee.MergeMeshesAsync(
          u,
          !1,
          !0,
          void 0,
          !0,
          !0
        ).then((P) => {
          P instanceof Ee && (P.name = "le5le_mergeMesh" + o.name, u.forEach((p) => {
            p.setEnabled(!1);
          }));
        });
      }), v.clear();
    }, this.recoverMesh = (o) => {
      let d = this.scene.scene.getMeshByName(
        "le5le_mergeMesh" + o.name
      );
      d && (d.dispose(), o.getChildMeshes().forEach((v) => {
        v.setEnabled(!0);
      }));
    };
    const { data: r = {} } = t;
    this.root = e;
    const n = typeof r == "string" ? JSON.parse(r.startsWith("{") ? r : hO(r)) : r, i = n.id || ((a = n.scene) == null ? void 0 : a.id), s = (f = n.scene) == null ? void 0 : f.name;
    return this.scene = new C0(this, { id: i, name: s }), this.scene.scene.setRenderingAutoClearDepthStencil(1, !1, !1, !1), this.highlightManager = new cbe(this), this.scene.scene.onNewMeshAddedObservable.add(this._onNewMeshAdded), this.scene.scene.onMeshRemovedObservable.add(this._onMeshRemoved), this.nodeManager = new yme(this), this.resourceManager = new hDe(this), this.dynamicDataManager = new Rxe(this), this.undoRedoManager = new Sxe(this), this.DOMManager = new hwe(this), this.GUIManager = new wme(this), this.GUI2dManager = new Nme(this), this.particleManager = new Lme(this), this.selectorManager = new Uxe(this), this.glManager = new TDe(this), this.groupManager = new Ixe(this), this.stateDataManager = new Vme(this), this.animateManager = new wN(this), this.eventManager = new Ome(this), this.networkManager = new Bxe(this), zt.initMetadata(this.scene, this), new Promise((o) => o(this)).then(
      () => this.load({ ...t, data: n })
    ), this;
  }
  // public set isEditTube(value: boolean) {
  //   this._isEditTube = value;
  //   if (value) {
  //     this.tubeManager = new TubeManager(this);
  //   } else {
  //     // this.tubeManager?.newGenerate();
  //     this.tubeManager?.dispose();
  //   }
  // }
  get id() {
    return this.scene.id || "";
  }
  get name() {
    return this.scene.name || "";
  }
  /**
   *
   * @param lon 经度
   * @param lat 纬度
   * @param height 高度
   * @param ellipsoid 曲率弥补
   */
  LonLatToVector3(e, t, r, n) {
    const { lat: i, lon: s } = this.scene;
    let a = hI(s, i, r, n), f = hI(s, i, 3e4, n), o = hI(e, t, r, n), d = new Hr("BASE", this.scene.scene);
    d.lookAt(f.subtract(a)), d.addRotation(Math.PI / 2, 0, 0);
    let v = new Hr("BASE2", this.scene.scene);
    v.position = o, v.setParent(d);
    let u = new Hr("BASE3", this.scene.scene);
    u.position = a.clone(), u.setParent(d);
    let l = v.position.clone().subtract(u.position.clone());
    return [d, v, u].forEach((P) => P.dispose()), l;
  }
  /**
   *
   * @param vec 当前位置的坐标
   * @param height 地面高度
   * @param ellipsoid 椭球 这里使用cesium的ellipsoid弥补
   * @returns
   */
  vecToLonlat(e, t, r) {
    const { lat: n, lon: i } = this.scene;
    let s = hI(i, n, t, r), a = hI(i, n, 3e4, r), f = new Hr("BASE", this.scene.scene);
    f.lookAt(a.subtract(s)), f.addRotation(Math.PI / 2, 0, 0);
    let o = new Hr("BASE2", this.scene.scene), d = new Hr("BASE3", this.scene.scene);
    d.setAbsolutePosition(s.clone()), d.setParent(f);
    let v = d.position.add(e);
    o.setParent(f), o.position = v;
    let u = o.getAbsolutePosition().clone();
    return [f, o, d].forEach((l) => l.dispose()), zme(u);
  }
  beginEditTube(e) {
    var t;
    (t = this.tubeManager) == null || t.dispose(), this.tubeManager = new gO(this, e);
  }
  stopEditTube() {
    var e;
    (e = this.tubeManager) == null || e.dispose();
  }
};
TO.VERSION = 1.5;
let pR = TO;
function Jje(A, e = !1) {
  const t = Xa(A);
  let r, n;
  return t.forEach((i) => {
    r || (r = i.getAbsolutePosition()), n || (n = i.getAbsolutePosition());
    const s = e ? [] : i.getChildMeshes();
    [i, ...s].forEach((a) => {
      if (a instanceof jn) {
        const f = a.getBoundingInfo().boundingBox, o = f.minimumWorld, d = f.maximumWorld;
        r = S.Minimize(r, o).clone(), n = S.Maximize(n, d).clone();
      }
    });
  }), { min: r, max: n, center: S.Center(r, n) };
}
function AUe(A, e) {
  if (A instanceof jn && !A.parent) {
    A.computeWorldMatrix(!0);
    let t = A.getAbsolutePosition().clone();
    A.setPivotPoint(e, ai.WORLD), A.position = A.position.add(
      t.subtract(A.getAbsolutePosition())
    );
  }
}
const dUe = (A) => {
  let e = A.getChildMeshes(), t = new w0(
    "le5le_meshExplorer" + Zn(),
    e[0].getScene()
  ), r = [];
  e.forEach((a) => {
    r.push(a), a.getChildMeshes().forEach((f) => {
      r.push(f);
    });
  });
  let n = Jje(e).center, i = new Set(r), s = new Set(i);
  return i.forEach((a) => {
    let f = a.getBoundingInfo().boundingBox.center;
    s.delete(a);
    let o = zje(a, s), d = S.Normalize(f);
    S.Distance(d, S.Zero()) < 0.1 && (d = S.Normalize(
      a.getBoundingInfo().boundingBox.centerWorld.clone().subtract(n)
    ));
    let v = qI(
      a.getBoundingInfo().boundingBox.maximumWorld.clone(),
      a.getBoundingInfo().boundingBox.minimumWorld.clone()
    ), u = a.position.clone(), l = u.add(
      d.scale(v * (1 + o / 10))
    ), P = new st(
      "le5le_explore",
      "position",
      60,
      st.ANIMATIONTYPE_VECTOR3,
      st.ANIMATIONLOOPMODE_CYCLE
    ), p = [];
    p.push({
      frame: 0,
      value: u
    }), p.push({
      frame: 200,
      value: l
    }), P.setKeys(p), t.addTargetedAnimation(P, a);
  }), t;
};
function zje(A, e) {
  new Set(e).delete(A);
  let r = A.getAbsolutePosition(), n = 0;
  for (let i of e)
    S.Distance(i.getAbsolutePosition().clone(), r.clone()) < 0.1 && n++;
  return n;
}
function Gje(A, e = !0) {
  let t = A.getBoundingInfo().boundingBox.centerWorld.clone();
  A.position = A.position.subtract(t), A.setPivotPoint(t), e && (A.rotation.x += Math.PI, A.rotation.y += Math.PI), A.bakeCurrentTransformIntoVertices(), A.setPivotMatrix(he.Translation(0, 0, 0));
}
function vUe(A) {
  let e = A.getBoundingInfo().boundingBox.centerWorld.clone();
  Gje(A, !1), A.setAbsolutePosition(e);
}
const uUe = async (A, e, t = {}) => {
  const { zOffset: r, ...n } = t, i = A.getScene(), s = Ef.CreateDecal(Zn("decal"), A, {
    size: new S(1, 1, 1),
    ...n
  }), a = new Wt(Zn(s + "Mat"), i);
  return a.zOffset = u2e(r) ? -2 : r, s.material = a, s.setParent(A), zt.initMetadata(s, e), s;
};
var mN = { exports: {} }, uI = {}, BN = { exports: {} }, bI = { exports: {} };
/**
 * @license React
 * react.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
bI.exports;
var z_;
function Zje() {
  return z_ || (z_ = 1, function(A, e) {
    process.env.NODE_ENV !== "production" && function() {
      typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
      var t = "18.2.0", r = Symbol.for("react.element"), n = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), o = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), c = Symbol.iterator, H = "@@iterator";
      function T(je) {
        if (je === null || typeof je != "object")
          return null;
        var dt = c && je[c] || je[H];
        return typeof dt == "function" ? dt : null;
      }
      var q = {
        /**
         * @internal
         * @type {ReactComponent}
         */
        current: null
      }, b = {
        transition: null
      }, j = {
        current: null,
        // Used to reproduce behavior of `batchedUpdates` in legacy mode.
        isBatchingLegacy: !1,
        didScheduleLegacyUpdate: !1
      }, w = {
        /**
         * @internal
         * @type {ReactComponent}
         */
        current: null
      }, m = {}, I = null;
      function N(je) {
        I = je;
      }
      m.setExtraStackFrame = function(je) {
        I = je;
      }, m.getCurrentStack = null, m.getStackAddendum = function() {
        var je = "";
        I && (je += I);
        var dt = m.getCurrentStack;
        return dt && (je += dt() || ""), je;
      };
      var k = !1, R = !1, y = !1, O = !1, Y = !1, ee = {
        ReactCurrentDispatcher: q,
        ReactCurrentBatchConfig: b,
        ReactCurrentOwner: w
      };
      ee.ReactDebugCurrentFrame = m, ee.ReactCurrentActQueue = j;
      function Z(je) {
        {
          for (var dt = arguments.length, kt = new Array(dt > 1 ? dt - 1 : 0), _t = 1; _t < dt; _t++)
            kt[_t - 1] = arguments[_t];
          fe("warn", je, kt);
        }
      }
      function te(je) {
        {
          for (var dt = arguments.length, kt = new Array(dt > 1 ? dt - 1 : 0), _t = 1; _t < dt; _t++)
            kt[_t - 1] = arguments[_t];
          fe("error", je, kt);
        }
      }
      function fe(je, dt, kt) {
        {
          var _t = ee.ReactDebugCurrentFrame, Cr = _t.getStackAddendum();
          Cr !== "" && (dt += "%s", kt = kt.concat([Cr]));
          var fi = kt.map(function(on) {
            return String(on);
          });
          fi.unshift("Warning: " + dt), Function.prototype.apply.call(console[je], console, fi);
        }
      }
      var _ = {};
      function G(je, dt) {
        {
          var kt = je.constructor, _t = kt && (kt.displayName || kt.name) || "ReactClass", Cr = _t + "." + dt;
          if (_[Cr])
            return;
          te("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", dt, _t), _[Cr] = !0;
        }
      }
      var L = {
        /**
         * Checks whether or not this composite component is mounted.
         * @param {ReactClass} publicInstance The instance we want to test.
         * @return {boolean} True if mounted, false otherwise.
         * @protected
         * @final
         */
        isMounted: function(je) {
          return !1;
        },
        /**
         * Forces an update. This should only be invoked when it is known with
         * certainty that we are **not** in a DOM transaction.
         *
         * You may want to call this when you know that some deeper aspect of the
         * component's state has changed but `setState` was not called.
         *
         * This will not invoke `shouldComponentUpdate`, but it will invoke
         * `componentWillUpdate` and `componentDidUpdate`.
         *
         * @param {ReactClass} publicInstance The instance that should rerender.
         * @param {?function} callback Called after component is updated.
         * @param {?string} callerName name of the calling function in the public API.
         * @internal
         */
        enqueueForceUpdate: function(je, dt, kt) {
          G(je, "forceUpdate");
        },
        /**
         * Replaces all of the state. Always use this or `setState` to mutate state.
         * You should treat `this.state` as immutable.
         *
         * There is no guarantee that `this.state` will be immediately updated, so
         * accessing `this.state` after calling this method may return the old value.
         *
         * @param {ReactClass} publicInstance The instance that should rerender.
         * @param {object} completeState Next state.
         * @param {?function} callback Called after component is updated.
         * @param {?string} callerName name of the calling function in the public API.
         * @internal
         */
        enqueueReplaceState: function(je, dt, kt, _t) {
          G(je, "replaceState");
        },
        /**
         * Sets a subset of the state. This only exists because _pendingState is
         * internal. This provides a merging strategy that is not available to deep
         * properties which is confusing. TODO: Expose pendingState or don't use it
         * during the merge.
         *
         * @param {ReactClass} publicInstance The instance that should rerender.
         * @param {object} partialState Next partial state to be merged with state.
         * @param {?function} callback Called after component is updated.
         * @param {?string} Name of the calling function in the public API.
         * @internal
         */
        enqueueSetState: function(je, dt, kt, _t) {
          G(je, "setState");
        }
      }, $ = Object.assign, ae = {};
      Object.freeze(ae);
      function Pe(je, dt, kt) {
        this.props = je, this.context = dt, this.refs = ae, this.updater = kt || L;
      }
      Pe.prototype.isReactComponent = {}, Pe.prototype.setState = function(je, dt) {
        if (typeof je != "object" && typeof je != "function" && je != null)
          throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
        this.updater.enqueueSetState(this, je, dt, "setState");
      }, Pe.prototype.forceUpdate = function(je) {
        this.updater.enqueueForceUpdate(this, je, "forceUpdate");
      };
      {
        var ge = {
          isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
          replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
        }, me = function(je, dt) {
          Object.defineProperty(Pe.prototype, je, {
            get: function() {
              Z("%s(...) is deprecated in plain JavaScript React classes. %s", dt[0], dt[1]);
            }
          });
        };
        for (var Xe in ge)
          ge.hasOwnProperty(Xe) && me(Xe, ge[Xe]);
      }
      function De() {
      }
      De.prototype = Pe.prototype;
      function ne(je, dt, kt) {
        this.props = je, this.context = dt, this.refs = ae, this.updater = kt || L;
      }
      var re = ne.prototype = new De();
      re.constructor = ne, $(re, Pe.prototype), re.isPureReactComponent = !0;
      function ve() {
        var je = {
          current: null
        };
        return Object.seal(je), je;
      }
      var qe = Array.isArray;
      function ke(je) {
        return qe(je);
      }
      function be(je) {
        {
          var dt = typeof Symbol == "function" && Symbol.toStringTag, kt = dt && je[Symbol.toStringTag] || je.constructor.name || "Object";
          return kt;
        }
      }
      function Fe(je) {
        try {
          return Ke(je), !1;
        } catch {
          return !0;
        }
      }
      function Ke(je) {
        return "" + je;
      }
      function nt(je) {
        if (Fe(je))
          return te("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", be(je)), Ke(je);
      }
      function ut(je, dt, kt) {
        var _t = je.displayName;
        if (_t)
          return _t;
        var Cr = dt.displayName || dt.name || "";
        return Cr !== "" ? kt + "(" + Cr + ")" : kt;
      }
      function bt(je) {
        return je.displayName || "Context";
      }
      function wt(je) {
        if (je == null)
          return null;
        if (typeof je.tag == "number" && te("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof je == "function")
          return je.displayName || je.name || null;
        if (typeof je == "string")
          return je;
        switch (je) {
          case i:
            return "Fragment";
          case n:
            return "Portal";
          case a:
            return "Profiler";
          case s:
            return "StrictMode";
          case v:
            return "Suspense";
          case u:
            return "SuspenseList";
        }
        if (typeof je == "object")
          switch (je.$$typeof) {
            case o:
              var dt = je;
              return bt(dt) + ".Consumer";
            case f:
              var kt = je;
              return bt(kt._context) + ".Provider";
            case d:
              return ut(je, je.render, "ForwardRef");
            case l:
              var _t = je.displayName || null;
              return _t !== null ? _t : wt(je.type) || "Memo";
            case P: {
              var Cr = je, fi = Cr._payload, on = Cr._init;
              try {
                return wt(on(fi));
              } catch {
                return null;
              }
            }
          }
        return null;
      }
      var Tt = Object.prototype.hasOwnProperty, lr = {
        key: !0,
        ref: !0,
        __self: !0,
        __source: !0
      }, Qt, tr, br;
      br = {};
      function Xn(je) {
        if (Tt.call(je, "ref")) {
          var dt = Object.getOwnPropertyDescriptor(je, "ref").get;
          if (dt && dt.isReactWarning)
            return !1;
        }
        return je.ref !== void 0;
      }
      function qr(je) {
        if (Tt.call(je, "key")) {
          var dt = Object.getOwnPropertyDescriptor(je, "key").get;
          if (dt && dt.isReactWarning)
            return !1;
        }
        return je.key !== void 0;
      }
      function En(je, dt) {
        var kt = function() {
          Qt || (Qt = !0, te("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", dt));
        };
        kt.isReactWarning = !0, Object.defineProperty(je, "key", {
          get: kt,
          configurable: !0
        });
      }
      function Bn(je, dt) {
        var kt = function() {
          tr || (tr = !0, te("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", dt));
        };
        kt.isReactWarning = !0, Object.defineProperty(je, "ref", {
          get: kt,
          configurable: !0
        });
      }
      function Fi(je) {
        if (typeof je.ref == "string" && w.current && je.__self && w.current.stateNode !== je.__self) {
          var dt = wt(w.current.type);
          br[dt] || (te('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', dt, je.ref), br[dt] = !0);
        }
      }
      var Gt = function(je, dt, kt, _t, Cr, fi, on) {
        var si = {
          // This tag allows us to uniquely identify this as a React Element
          $$typeof: r,
          // Built-in properties that belong on the element
          type: je,
          key: dt,
          ref: kt,
          props: on,
          // Record the component responsible for creating this element.
          _owner: fi
        };
        return si._store = {}, Object.defineProperty(si._store, "validated", {
          configurable: !1,
          enumerable: !1,
          writable: !0,
          value: !1
        }), Object.defineProperty(si, "_self", {
          configurable: !1,
          enumerable: !1,
          writable: !1,
          value: _t
        }), Object.defineProperty(si, "_source", {
          configurable: !1,
          enumerable: !1,
          writable: !1,
          value: Cr
        }), Object.freeze && (Object.freeze(si.props), Object.freeze(si)), si;
      };
      function xr(je, dt, kt) {
        var _t, Cr = {}, fi = null, on = null, si = null, ss = null;
        if (dt != null) {
          Xn(dt) && (on = dt.ref, Fi(dt)), qr(dt) && (nt(dt.key), fi = "" + dt.key), si = dt.__self === void 0 ? null : dt.__self, ss = dt.__source === void 0 ? null : dt.__source;
          for (_t in dt)
            Tt.call(dt, _t) && !lr.hasOwnProperty(_t) && (Cr[_t] = dt[_t]);
        }
        var hs = arguments.length - 2;
        if (hs === 1)
          Cr.children = kt;
        else if (hs > 1) {
          for (var js = Array(hs), ws = 0; ws < hs; ws++)
            js[ws] = arguments[ws + 2];
          Object.freeze && Object.freeze(js), Cr.children = js;
        }
        if (je && je.defaultProps) {
          var Zs = je.defaultProps;
          for (_t in Zs)
            Cr[_t] === void 0 && (Cr[_t] = Zs[_t]);
        }
        if (fi || on) {
          var Ia = typeof je == "function" ? je.displayName || je.name || "Unknown" : je;
          fi && En(Cr, Ia), on && Bn(Cr, Ia);
        }
        return Gt(je, fi, on, si, ss, w.current, Cr);
      }
      function Br(je, dt) {
        var kt = Gt(je.type, dt, je.ref, je._self, je._source, je._owner, je.props);
        return kt;
      }
      function nn(je, dt, kt) {
        if (je == null)
          throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + je + ".");
        var _t, Cr = $({}, je.props), fi = je.key, on = je.ref, si = je._self, ss = je._source, hs = je._owner;
        if (dt != null) {
          Xn(dt) && (on = dt.ref, hs = w.current), qr(dt) && (nt(dt.key), fi = "" + dt.key);
          var js;
          je.type && je.type.defaultProps && (js = je.type.defaultProps);
          for (_t in dt)
            Tt.call(dt, _t) && !lr.hasOwnProperty(_t) && (dt[_t] === void 0 && js !== void 0 ? Cr[_t] = js[_t] : Cr[_t] = dt[_t]);
        }
        var ws = arguments.length - 2;
        if (ws === 1)
          Cr.children = kt;
        else if (ws > 1) {
          for (var Zs = Array(ws), Ia = 0; Ia < ws; Ia++)
            Zs[Ia] = arguments[Ia + 2];
          Cr.children = Zs;
        }
        return Gt(je.type, fi, on, si, ss, hs, Cr);
      }
      function sn(je) {
        return typeof je == "object" && je !== null && je.$$typeof === r;
      }
      var Pn = ".", an = ":";
      function Wn(je) {
        var dt = /[=:]/g, kt = {
          "=": "=0",
          ":": "=2"
        }, _t = je.replace(dt, function(Cr) {
          return kt[Cr];
        });
        return "$" + _t;
      }
      var rr = !1, Sr = /\/+/g;
      function nr(je) {
        return je.replace(Sr, "$&/");
      }
      function Er(je, dt) {
        return typeof je == "object" && je !== null && je.key != null ? (nt(je.key), Wn("" + je.key)) : dt.toString(36);
      }
      function Rn(je, dt, kt, _t, Cr) {
        var fi = typeof je;
        (fi === "undefined" || fi === "boolean") && (je = null);
        var on = !1;
        if (je === null)
          on = !0;
        else
          switch (fi) {
            case "string":
            case "number":
              on = !0;
              break;
            case "object":
              switch (je.$$typeof) {
                case r:
                case n:
                  on = !0;
              }
          }
        if (on) {
          var si = je, ss = Cr(si), hs = _t === "" ? Pn + Er(si, 0) : _t;
          if (ke(ss)) {
            var js = "";
            hs != null && (js = nr(hs) + "/"), Rn(ss, dt, js, "", function(zv) {
              return zv;
            });
          } else
            ss != null && (sn(ss) && (ss.key && (!si || si.key !== ss.key) && nt(ss.key), ss = Br(
              ss,
              // Keep both the (mapped) and old keys if they differ, just as
              // traverseAllChildren used to do for objects as children
              kt + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
              (ss.key && (!si || si.key !== ss.key) ? (
                // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
                // eslint-disable-next-line react-internal/safe-string-coercion
                nr("" + ss.key) + "/"
              ) : "") + hs
            )), dt.push(ss));
          return 1;
        }
        var ws, Zs, Ia = 0, cs = _t === "" ? Pn : _t + an;
        if (ke(je))
          for (var ud = 0; ud < je.length; ud++)
            ws = je[ud], Zs = cs + Er(ws, ud), Ia += Rn(ws, dt, kt, Zs, Cr);
        else {
          var Lv = T(je);
          if (typeof Lv == "function") {
            var Kv = je;
            Lv === Kv.entries && (rr || Z("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), rr = !0);
            for (var $l = Lv.call(Kv), V6, ld = 0; !(V6 = $l.next()).done; )
              ws = V6.value, Zs = cs + Er(ws, ld++), Ia += Rn(ws, dt, kt, Zs, Cr);
          } else if (fi === "object") {
            var Jv = String(je);
            throw new Error("Objects are not valid as a React child (found: " + (Jv === "[object Object]" ? "object with keys {" + Object.keys(je).join(", ") + "}" : Jv) + "). If you meant to render a collection of children, use an array instead.");
          }
        }
        return Ia;
      }
      function Vn(je, dt, kt) {
        if (je == null)
          return je;
        var _t = [], Cr = 0;
        return Rn(je, _t, "", "", function(fi) {
          return dt.call(kt, fi, Cr++);
        }), _t;
      }
      function ki(je) {
        var dt = 0;
        return Vn(je, function() {
          dt++;
        }), dt;
      }
      function as(je, dt, kt) {
        Vn(je, function() {
          dt.apply(this, arguments);
        }, kt);
      }
      function Rr(je) {
        return Vn(je, function(dt) {
          return dt;
        }) || [];
      }
      function Ii(je) {
        if (!sn(je))
          throw new Error("React.Children.only expected to receive a single React element child.");
        return je;
      }
      function is(je) {
        var dt = {
          $$typeof: o,
          // As a workaround to support multiple concurrent renderers, we categorize
          // some renderers as primary and others as secondary. We only expect
          // there to be two concurrent renderers at most: React Native (primary) and
          // Fabric (secondary); React DOM (primary) and React ART (secondary).
          // Secondary renderers store their context values on separate fields.
          _currentValue: je,
          _currentValue2: je,
          // Used to track how many concurrent renderers this context currently
          // supports within in a single renderer. Such as parallel server rendering.
          _threadCount: 0,
          // These are circular
          Provider: null,
          Consumer: null,
          // Add these to use same hidden class in VM as ServerContext
          _defaultValue: null,
          _globalName: null
        };
        dt.Provider = {
          $$typeof: f,
          _context: dt
        };
        var kt = !1, _t = !1, Cr = !1;
        {
          var fi = {
            $$typeof: o,
            _context: dt
          };
          Object.defineProperties(fi, {
            Provider: {
              get: function() {
                return _t || (_t = !0, te("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")), dt.Provider;
              },
              set: function(on) {
                dt.Provider = on;
              }
            },
            _currentValue: {
              get: function() {
                return dt._currentValue;
              },
              set: function(on) {
                dt._currentValue = on;
              }
            },
            _currentValue2: {
              get: function() {
                return dt._currentValue2;
              },
              set: function(on) {
                dt._currentValue2 = on;
              }
            },
            _threadCount: {
              get: function() {
                return dt._threadCount;
              },
              set: function(on) {
                dt._threadCount = on;
              }
            },
            Consumer: {
              get: function() {
                return kt || (kt = !0, te("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")), dt.Consumer;
              }
            },
            displayName: {
              get: function() {
                return dt.displayName;
              },
              set: function(on) {
                Cr || (Z("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", on), Cr = !0);
              }
            }
          }), dt.Consumer = fi;
        }
        return dt._currentRenderer = null, dt._currentRenderer2 = null, dt;
      }
      var ji = -1, _i = 0, oi = 1, vr = 2;
      function Fr(je) {
        if (je._status === ji) {
          var dt = je._result, kt = dt();
          if (kt.then(function(fi) {
            if (je._status === _i || je._status === ji) {
              var on = je;
              on._status = oi, on._result = fi;
            }
          }, function(fi) {
            if (je._status === _i || je._status === ji) {
              var on = je;
              on._status = vr, on._result = fi;
            }
          }), je._status === ji) {
            var _t = je;
            _t._status = _i, _t._result = kt;
          }
        }
        if (je._status === oi) {
          var Cr = je._result;
          return Cr === void 0 && te(`lazy: Expected the result of a dynamic import() call. Instead received: %s

Your code should look like: 
  const MyComponent = lazy(() => import('./MyComponent'))

Did you accidentally put curly braces around the import?`, Cr), "default" in Cr || te(`lazy: Expected the result of a dynamic import() call. Instead received: %s

Your code should look like: 
  const MyComponent = lazy(() => import('./MyComponent'))`, Cr), Cr.default;
        } else
          throw je._result;
      }
      function pr(je) {
        var dt = {
          // We use these fields to store the result.
          _status: ji,
          _result: je
        }, kt = {
          $$typeof: P,
          _payload: dt,
          _init: Fr
        };
        {
          var _t, Cr;
          Object.defineProperties(kt, {
            defaultProps: {
              configurable: !0,
              get: function() {
                return _t;
              },
              set: function(fi) {
                te("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), _t = fi, Object.defineProperty(kt, "defaultProps", {
                  enumerable: !0
                });
              }
            },
            propTypes: {
              configurable: !0,
              get: function() {
                return Cr;
              },
              set: function(fi) {
                te("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), Cr = fi, Object.defineProperty(kt, "propTypes", {
                  enumerable: !0
                });
              }
            }
          });
        }
        return kt;
      }
      function ds(je) {
        je != null && je.$$typeof === l ? te("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : typeof je != "function" ? te("forwardRef requires a render function but was given %s.", je === null ? "null" : typeof je) : je.length !== 0 && je.length !== 2 && te("forwardRef render functions accept exactly two parameters: props and ref. %s", je.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."), je != null && (je.defaultProps != null || je.propTypes != null) && te("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
        var dt = {
          $$typeof: d,
          render: je
        };
        {
          var kt;
          Object.defineProperty(dt, "displayName", {
            enumerable: !1,
            configurable: !0,
            get: function() {
              return kt;
            },
            set: function(_t) {
              kt = _t, !je.name && !je.displayName && (je.displayName = _t);
            }
          });
        }
        return dt;
      }
      var it;
      it = Symbol.for("react.module.reference");
      function $t(je) {
        return !!(typeof je == "string" || typeof je == "function" || je === i || je === a || Y || je === s || je === v || je === u || O || je === p || k || R || y || typeof je == "object" && je !== null && (je.$$typeof === P || je.$$typeof === l || je.$$typeof === f || je.$$typeof === o || je.$$typeof === d || // This needs to include all possible module reference object
        // types supported by any Flight configuration anywhere since
        // we don't know which Flight build this will end up being used
        // with.
        je.$$typeof === it || je.getModuleId !== void 0));
      }
      function Ur(je, dt) {
        $t(je) || te("memo: The first argument must be a component. Instead received: %s", je === null ? "null" : typeof je);
        var kt = {
          $$typeof: l,
          type: je,
          compare: dt === void 0 ? null : dt
        };
        {
          var _t;
          Object.defineProperty(kt, "displayName", {
            enumerable: !1,
            configurable: !0,
            get: function() {
              return _t;
            },
            set: function(Cr) {
              _t = Cr, !je.name && !je.displayName && (je.displayName = Cr);
            }
          });
        }
        return kt;
      }
      function $e() {
        var je = q.current;
        return je === null && te(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`), je;
      }
      function Kt(je) {
        var dt = $e();
        if (je._context !== void 0) {
          var kt = je._context;
          kt.Consumer === je ? te("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?") : kt.Provider === je && te("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
        }
        return dt.useContext(je);
      }
      function cr(je) {
        var dt = $e();
        return dt.useState(je);
      }
      function Vr(je, dt, kt) {
        var _t = $e();
        return _t.useReducer(je, dt, kt);
      }
      function Lr(je) {
        var dt = $e();
        return dt.useRef(je);
      }
      function pi(je, dt) {
        var kt = $e();
        return kt.useEffect(je, dt);
      }
      function zr(je, dt) {
        var kt = $e();
        return kt.useInsertionEffect(je, dt);
      }
      function Cn(je, dt) {
        var kt = $e();
        return kt.useLayoutEffect(je, dt);
      }
      function Mi(je, dt) {
        var kt = $e();
        return kt.useCallback(je, dt);
      }
      function li(je, dt) {
        var kt = $e();
        return kt.useMemo(je, dt);
      }
      function Xs(je, dt, kt) {
        var _t = $e();
        return _t.useImperativeHandle(je, dt, kt);
      }
      function Ri(je, dt) {
        {
          var kt = $e();
          return kt.useDebugValue(je, dt);
        }
      }
      function j1() {
        var je = $e();
        return je.useTransition();
      }
      function w1(je) {
        var dt = $e();
        return dt.useDeferredValue(je);
      }
      function di() {
        var je = $e();
        return je.useId();
      }
      function jf(je, dt, kt) {
        var _t = $e();
        return _t.useSyncExternalStore(je, dt, kt);
      }
      var B6 = 0, W6, S6, qa, m1, Ho, X9, $o;
      function T9() {
      }
      T9.__reactDisabledLog = !0;
      function q9() {
        {
          if (B6 === 0) {
            W6 = console.log, S6 = console.info, qa = console.warn, m1 = console.error, Ho = console.group, X9 = console.groupCollapsed, $o = console.groupEnd;
            var je = {
              configurable: !0,
              enumerable: !0,
              value: T9,
              writable: !0
            };
            Object.defineProperties(console, {
              info: je,
              log: je,
              warn: je,
              error: je,
              group: je,
              groupCollapsed: je,
              groupEnd: je
            });
          }
          B6++;
        }
      }
      function wf() {
        {
          if (B6--, B6 === 0) {
            var je = {
              configurable: !0,
              enumerable: !0,
              writable: !0
            };
            Object.defineProperties(console, {
              log: $({}, je, {
                value: W6
              }),
              info: $({}, je, {
                value: S6
              }),
              warn: $({}, je, {
                value: qa
              }),
              error: $({}, je, {
                value: m1
              }),
              group: $({}, je, {
                value: Ho
              }),
              groupCollapsed: $({}, je, {
                value: X9
              }),
              groupEnd: $({}, je, {
                value: $o
              })
            });
          }
          B6 < 0 && te("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
        }
      }
      var mf = ee.ReactCurrentDispatcher, B1;
      function h1(je, dt, kt) {
        {
          if (B1 === void 0)
            try {
              throw Error();
            } catch (Cr) {
              var _t = Cr.stack.trim().match(/\n( *(at )?)/);
              B1 = _t && _t[1] || "";
            }
          return `
` + B1 + je;
        }
      }
      var U6 = !1, b9;
      {
        var J9 = typeof WeakMap == "function" ? WeakMap : Map;
        b9 = new J9();
      }
      function OA(je, dt) {
        if (!je || U6)
          return "";
        {
          var kt = b9.get(je);
          if (kt !== void 0)
            return kt;
        }
        var _t;
        U6 = !0;
        var Cr = Error.prepareStackTrace;
        Error.prepareStackTrace = void 0;
        var fi;
        fi = mf.current, mf.current = null, q9();
        try {
          if (dt) {
            var on = function() {
              throw Error();
            };
            if (Object.defineProperty(on.prototype, "props", {
              set: function() {
                throw Error();
              }
            }), typeof Reflect == "object" && Reflect.construct) {
              try {
                Reflect.construct(on, []);
              } catch (cs) {
                _t = cs;
              }
              Reflect.construct(je, [], on);
            } else {
              try {
                on.call();
              } catch (cs) {
                _t = cs;
              }
              je.call(on.prototype);
            }
          } else {
            try {
              throw Error();
            } catch (cs) {
              _t = cs;
            }
            je();
          }
        } catch (cs) {
          if (cs && _t && typeof cs.stack == "string") {
            for (var si = cs.stack.split(`
`), ss = _t.stack.split(`
`), hs = si.length - 1, js = ss.length - 1; hs >= 1 && js >= 0 && si[hs] !== ss[js]; )
              js--;
            for (; hs >= 1 && js >= 0; hs--, js--)
              if (si[hs] !== ss[js]) {
                if (hs !== 1 || js !== 1)
                  do
                    if (hs--, js--, js < 0 || si[hs] !== ss[js]) {
                      var ws = `
` + si[hs].replace(" at new ", " at ");
                      return je.displayName && ws.includes("<anonymous>") && (ws = ws.replace("<anonymous>", je.displayName)), typeof je == "function" && b9.set(je, ws), ws;
                    }
                  while (hs >= 1 && js >= 0);
                break;
              }
          }
        } finally {
          U6 = !1, mf.current = fi, wf(), Error.prepareStackTrace = Cr;
        }
        var Zs = je ? je.displayName || je.name : "", Ia = Zs ? h1(Zs) : "";
        return typeof je == "function" && b9.set(je, Ia), Ia;
      }
      function z1(je, dt, kt) {
        return OA(je, !1);
      }
      function Zd(je) {
        var dt = je.prototype;
        return !!(dt && dt.isReactComponent);
      }
      function Zr(je, dt, kt) {
        if (je == null)
          return "";
        if (typeof je == "function")
          return OA(je, Zd(je));
        if (typeof je == "string")
          return h1(je);
        switch (je) {
          case v:
            return h1("Suspense");
          case u:
            return h1("SuspenseList");
        }
        if (typeof je == "object")
          switch (je.$$typeof) {
            case d:
              return z1(je.render);
            case l:
              return Zr(je.type, dt, kt);
            case P: {
              var _t = je, Cr = _t._payload, fi = _t._init;
              try {
                return Zr(fi(Cr), dt, kt);
              } catch {
              }
            }
          }
        return "";
      }
      var Ts = {}, go = ee.ReactDebugCurrentFrame;
      function G1(je) {
        if (je) {
          var dt = je._owner, kt = Zr(je.type, je._source, dt ? dt.type : null);
          go.setExtraStackFrame(kt);
        } else
          go.setExtraStackFrame(null);
      }
      function z9(je, dt, kt, _t, Cr) {
        {
          var fi = Function.call.bind(Tt);
          for (var on in je)
            if (fi(je, on)) {
              var si = void 0;
              try {
                if (typeof je[on] != "function") {
                  var ss = Error((_t || "React class") + ": " + kt + " type `" + on + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof je[on] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                  throw ss.name = "Invariant Violation", ss;
                }
                si = je[on](dt, on, _t, kt, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
              } catch (hs) {
                si = hs;
              }
              si && !(si instanceof Error) && (G1(Cr), te("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", _t || "React class", kt, on, typeof si), G1(null)), si instanceof Error && !(si.message in Ts) && (Ts[si.message] = !0, G1(Cr), te("Failed %s type: %s", kt, si.message), G1(null));
            }
        }
      }
      function Li(je) {
        if (je) {
          var dt = je._owner, kt = Zr(je.type, je._source, dt ? dt.type : null);
          N(kt);
        } else
          N(null);
      }
      var Fa;
      Fa = !1;
      function Sa() {
        if (w.current) {
          var je = wt(w.current.type);
          if (je)
            return `

Check the render method of \`` + je + "`.";
        }
        return "";
      }
      function Fn(je) {
        if (je !== void 0) {
          var dt = je.fileName.replace(/^.*[\\\/]/, ""), kt = je.lineNumber;
          return `

Check your code at ` + dt + ":" + kt + ".";
        }
        return "";
      }
      function I6(je) {
        return je != null ? Fn(je.__source) : "";
      }
      var $i = {};
      function Ga(je) {
        var dt = Sa();
        if (!dt) {
          var kt = typeof je == "string" ? je : je.displayName || je.name;
          kt && (dt = `

Check the top-level render call using <` + kt + ">.");
        }
        return dt;
      }
      function e1(je, dt) {
        if (!(!je._store || je._store.validated || je.key != null)) {
          je._store.validated = !0;
          var kt = Ga(dt);
          if (!$i[kt]) {
            $i[kt] = !0;
            var _t = "";
            je && je._owner && je._owner !== w.current && (_t = " It was passed a child from " + wt(je._owner.type) + "."), Li(je), te('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', kt, _t), Li(null);
          }
        }
      }
      function Lf(je, dt) {
        if (typeof je == "object") {
          if (ke(je))
            for (var kt = 0; kt < je.length; kt++) {
              var _t = je[kt];
              sn(_t) && e1(_t, dt);
            }
          else if (sn(je))
            je._store && (je._store.validated = !0);
          else if (je) {
            var Cr = T(je);
            if (typeof Cr == "function" && Cr !== je.entries)
              for (var fi = Cr.call(je), on; !(on = fi.next()).done; )
                sn(on.value) && e1(on.value, dt);
          }
        }
      }
      function Ua(je) {
        {
          var dt = je.type;
          if (dt == null || typeof dt == "string")
            return;
          var kt;
          if (typeof dt == "function")
            kt = dt.propTypes;
          else if (typeof dt == "object" && (dt.$$typeof === d || // Note: Memo only checks outer props here.
          // Inner props are checked in the reconciler.
          dt.$$typeof === l))
            kt = dt.propTypes;
          else
            return;
          if (kt) {
            var _t = wt(dt);
            z9(kt, je.props, "prop", _t, je);
          } else if (dt.PropTypes !== void 0 && !Fa) {
            Fa = !0;
            var Cr = wt(dt);
            te("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Cr || "Unknown");
          }
          typeof dt.getDefaultProps == "function" && !dt.getDefaultProps.isReactClassApproved && te("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
        }
      }
      function vs(je) {
        {
          for (var dt = Object.keys(je.props), kt = 0; kt < dt.length; kt++) {
            var _t = dt[kt];
            if (_t !== "children" && _t !== "key") {
              Li(je), te("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", _t), Li(null);
              break;
            }
          }
          je.ref !== null && (Li(je), te("Invalid attribute `ref` supplied to `React.Fragment`."), Li(null));
        }
      }
      function R6(je, dt, kt) {
        var _t = $t(je);
        if (!_t) {
          var Cr = "";
          (je === void 0 || typeof je == "object" && je !== null && Object.keys(je).length === 0) && (Cr += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
          var fi = I6(dt);
          fi ? Cr += fi : Cr += Sa();
          var on;
          je === null ? on = "null" : ke(je) ? on = "array" : je !== void 0 && je.$$typeof === r ? (on = "<" + (wt(je.type) || "Unknown") + " />", Cr = " Did you accidentally export a JSX literal instead of a component?") : on = typeof je, te("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", on, Cr);
        }
        var si = xr.apply(this, arguments);
        if (si == null)
          return si;
        if (_t)
          for (var ss = 2; ss < arguments.length; ss++)
            Lf(arguments[ss], je);
        return je === i ? vs(si) : Ua(si), si;
      }
      var Bf = !1;
      function Ie(je) {
        var dt = R6.bind(null, je);
        return dt.type = je, Bf || (Bf = !0, Z("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")), Object.defineProperty(dt, "type", {
          enumerable: !1,
          get: function() {
            return Z("Factory.type is deprecated. Access the class directly before passing it to createFactory."), Object.defineProperty(this, "type", {
              value: je
            }), je;
          }
        }), dt;
      }
      function Pt(je, dt, kt) {
        for (var _t = nn.apply(this, arguments), Cr = 2; Cr < arguments.length; Cr++)
          Lf(arguments[Cr], _t.type);
        return Ua(_t), _t;
      }
      function Et(je, dt) {
        var kt = b.transition;
        b.transition = {};
        var _t = b.transition;
        b.transition._updatedFibers = /* @__PURE__ */ new Set();
        try {
          je();
        } finally {
          if (b.transition = kt, kt === null && _t._updatedFibers) {
            var Cr = _t._updatedFibers.size;
            Cr > 10 && Z("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."), _t._updatedFibers.clear();
          }
        }
      }
      var er = !1, _r = null;
      function Xi(je) {
        if (_r === null)
          try {
            var dt = ("require" + Math.random()).slice(0, 7), kt = A && A[dt];
            _r = kt.call(A, "timers").setImmediate;
          } catch {
            _r = function(Cr) {
              er === !1 && (er = !0, typeof MessageChannel > "u" && te("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));
              var fi = new MessageChannel();
              fi.port1.onmessage = Cr, fi.port2.postMessage(void 0);
            };
          }
        return _r(je);
      }
      var Mn = 0, _n = !1;
      function Ps(je) {
        {
          var dt = Mn;
          Mn++, j.current === null && (j.current = []);
          var kt = j.isBatchingLegacy, _t;
          try {
            if (j.isBatchingLegacy = !0, _t = je(), !kt && j.didScheduleLegacyUpdate) {
              var Cr = j.current;
              Cr !== null && (j.didScheduleLegacyUpdate = !1, Na(Cr));
            }
          } catch (Zs) {
            throw qi(dt), Zs;
          } finally {
            j.isBatchingLegacy = kt;
          }
          if (_t !== null && typeof _t == "object" && typeof _t.then == "function") {
            var fi = _t, on = !1, si = {
              then: function(Zs, Ia) {
                on = !0, fi.then(function(cs) {
                  qi(dt), Mn === 0 ? Gs(cs, Zs, Ia) : Zs(cs);
                }, function(cs) {
                  qi(dt), Ia(cs);
                });
              }
            };
            return !_n && typeof Promise < "u" && Promise.resolve().then(function() {
            }).then(function() {
              on || (_n = !0, te("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"));
            }), si;
          } else {
            var ss = _t;
            if (qi(dt), Mn === 0) {
              var hs = j.current;
              hs !== null && (Na(hs), j.current = null);
              var js = {
                then: function(Zs, Ia) {
                  j.current === null ? (j.current = [], Gs(ss, Zs, Ia)) : Zs(ss);
                }
              };
              return js;
            } else {
              var ws = {
                then: function(Zs, Ia) {
                  Zs(ss);
                }
              };
              return ws;
            }
          }
        }
      }
      function qi(je) {
        je !== Mn - 1 && te("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "), Mn = je;
      }
      function Gs(je, dt, kt) {
        {
          var _t = j.current;
          if (_t !== null)
            try {
              Na(_t), Xi(function() {
                _t.length === 0 ? (j.current = null, dt(je)) : Gs(je, dt, kt);
              });
            } catch (Cr) {
              kt(Cr);
            }
          else
            dt(je);
        }
      }
      var ks = !1;
      function Na(je) {
        if (!ks) {
          ks = !0;
          var dt = 0;
          try {
            for (; dt < je.length; dt++) {
              var kt = je[dt];
              do
                kt = kt(!0);
              while (kt !== null);
            }
            je.length = 0;
          } catch (_t) {
            throw je = je.slice(dt + 1), _t;
          } finally {
            ks = !1;
          }
        }
      }
      var Ao = R6, Ro = Pt, oA = Ie, W1 = {
        map: Vn,
        forEach: as,
        count: ki,
        toArray: Rr,
        only: Ii
      };
      e.Children = W1, e.Component = Pe, e.Fragment = i, e.Profiler = a, e.PureComponent = ne, e.StrictMode = s, e.Suspense = v, e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ee, e.cloneElement = Ro, e.createContext = is, e.createElement = Ao, e.createFactory = oA, e.createRef = ve, e.forwardRef = ds, e.isValidElement = sn, e.lazy = pr, e.memo = Ur, e.startTransition = Et, e.unstable_act = Ps, e.useCallback = Mi, e.useContext = Kt, e.useDebugValue = Ri, e.useDeferredValue = w1, e.useEffect = pi, e.useId = di, e.useImperativeHandle = Xs, e.useInsertionEffect = zr, e.useLayoutEffect = Cn, e.useMemo = li, e.useReducer = Vr, e.useRef = Lr, e.useState = cr, e.useSyncExternalStore = jf, e.useTransition = j1, e.version = t, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
    }();
  }(bI, bI.exports)), bI.exports;
}
var Ha = {};
/**
 * @license React
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var G_;
function _je() {
  if (G_)
    return Ha;
  G_ = 1;
  var A = Symbol.for("react.element"), e = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), n = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), s = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), o = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), v = Symbol.iterator;
  function u(G) {
    return G === null || typeof G != "object" ? null : (G = v && G[v] || G["@@iterator"], typeof G == "function" ? G : null);
  }
  var l = { isMounted: function() {
    return !1;
  }, enqueueForceUpdate: function() {
  }, enqueueReplaceState: function() {
  }, enqueueSetState: function() {
  } }, P = Object.assign, p = {};
  function c(G, L, $) {
    this.props = G, this.context = L, this.refs = p, this.updater = $ || l;
  }
  c.prototype.isReactComponent = {}, c.prototype.setState = function(G, L) {
    if (typeof G != "object" && typeof G != "function" && G != null)
      throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
    this.updater.enqueueSetState(this, G, L, "setState");
  }, c.prototype.forceUpdate = function(G) {
    this.updater.enqueueForceUpdate(this, G, "forceUpdate");
  };
  function H() {
  }
  H.prototype = c.prototype;
  function T(G, L, $) {
    this.props = G, this.context = L, this.refs = p, this.updater = $ || l;
  }
  var q = T.prototype = new H();
  q.constructor = T, P(q, c.prototype), q.isPureReactComponent = !0;
  var b = Array.isArray, j = Object.prototype.hasOwnProperty, w = { current: null }, m = { key: !0, ref: !0, __self: !0, __source: !0 };
  function I(G, L, $) {
    var ae, Pe = {}, ge = null, me = null;
    if (L != null)
      for (ae in L.ref !== void 0 && (me = L.ref), L.key !== void 0 && (ge = "" + L.key), L)
        j.call(L, ae) && !m.hasOwnProperty(ae) && (Pe[ae] = L[ae]);
    var Xe = arguments.length - 2;
    if (Xe === 1)
      Pe.children = $;
    else if (1 < Xe) {
      for (var De = Array(Xe), ne = 0; ne < Xe; ne++)
        De[ne] = arguments[ne + 2];
      Pe.children = De;
    }
    if (G && G.defaultProps)
      for (ae in Xe = G.defaultProps, Xe)
        Pe[ae] === void 0 && (Pe[ae] = Xe[ae]);
    return { $$typeof: A, type: G, key: ge, ref: me, props: Pe, _owner: w.current };
  }
  function N(G, L) {
    return { $$typeof: A, type: G.type, key: L, ref: G.ref, props: G.props, _owner: G._owner };
  }
  function k(G) {
    return typeof G == "object" && G !== null && G.$$typeof === A;
  }
  function R(G) {
    var L = { "=": "=0", ":": "=2" };
    return "$" + G.replace(/[=:]/g, function($) {
      return L[$];
    });
  }
  var y = /\/+/g;
  function O(G, L) {
    return typeof G == "object" && G !== null && G.key != null ? R("" + G.key) : L.toString(36);
  }
  function Y(G, L, $, ae, Pe) {
    var ge = typeof G;
    (ge === "undefined" || ge === "boolean") && (G = null);
    var me = !1;
    if (G === null)
      me = !0;
    else
      switch (ge) {
        case "string":
        case "number":
          me = !0;
          break;
        case "object":
          switch (G.$$typeof) {
            case A:
            case e:
              me = !0;
          }
      }
    if (me)
      return me = G, Pe = Pe(me), G = ae === "" ? "." + O(me, 0) : ae, b(Pe) ? ($ = "", G != null && ($ = G.replace(y, "$&/") + "/"), Y(Pe, L, $, "", function(ne) {
        return ne;
      })) : Pe != null && (k(Pe) && (Pe = N(Pe, $ + (!Pe.key || me && me.key === Pe.key ? "" : ("" + Pe.key).replace(y, "$&/") + "/") + G)), L.push(Pe)), 1;
    if (me = 0, ae = ae === "" ? "." : ae + ":", b(G))
      for (var Xe = 0; Xe < G.length; Xe++) {
        ge = G[Xe];
        var De = ae + O(ge, Xe);
        me += Y(ge, L, $, De, Pe);
      }
    else if (De = u(G), typeof De == "function")
      for (G = De.call(G), Xe = 0; !(ge = G.next()).done; )
        ge = ge.value, De = ae + O(ge, Xe++), me += Y(ge, L, $, De, Pe);
    else if (ge === "object")
      throw L = String(G), Error("Objects are not valid as a React child (found: " + (L === "[object Object]" ? "object with keys {" + Object.keys(G).join(", ") + "}" : L) + "). If you meant to render a collection of children, use an array instead.");
    return me;
  }
  function ee(G, L, $) {
    if (G == null)
      return G;
    var ae = [], Pe = 0;
    return Y(G, ae, "", "", function(ge) {
      return L.call($, ge, Pe++);
    }), ae;
  }
  function Z(G) {
    if (G._status === -1) {
      var L = G._result;
      L = L(), L.then(function($) {
        (G._status === 0 || G._status === -1) && (G._status = 1, G._result = $);
      }, function($) {
        (G._status === 0 || G._status === -1) && (G._status = 2, G._result = $);
      }), G._status === -1 && (G._status = 0, G._result = L);
    }
    if (G._status === 1)
      return G._result.default;
    throw G._result;
  }
  var te = { current: null }, fe = { transition: null }, _ = { ReactCurrentDispatcher: te, ReactCurrentBatchConfig: fe, ReactCurrentOwner: w };
  return Ha.Children = { map: ee, forEach: function(G, L, $) {
    ee(G, function() {
      L.apply(this, arguments);
    }, $);
  }, count: function(G) {
    var L = 0;
    return ee(G, function() {
      L++;
    }), L;
  }, toArray: function(G) {
    return ee(G, function(L) {
      return L;
    }) || [];
  }, only: function(G) {
    if (!k(G))
      throw Error("React.Children.only expected to receive a single React element child.");
    return G;
  } }, Ha.Component = c, Ha.Fragment = t, Ha.Profiler = n, Ha.PureComponent = T, Ha.StrictMode = r, Ha.Suspense = f, Ha.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = _, Ha.cloneElement = function(G, L, $) {
    if (G == null)
      throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + G + ".");
    var ae = P({}, G.props), Pe = G.key, ge = G.ref, me = G._owner;
    if (L != null) {
      if (L.ref !== void 0 && (ge = L.ref, me = w.current), L.key !== void 0 && (Pe = "" + L.key), G.type && G.type.defaultProps)
        var Xe = G.type.defaultProps;
      for (De in L)
        j.call(L, De) && !m.hasOwnProperty(De) && (ae[De] = L[De] === void 0 && Xe !== void 0 ? Xe[De] : L[De]);
    }
    var De = arguments.length - 2;
    if (De === 1)
      ae.children = $;
    else if (1 < De) {
      Xe = Array(De);
      for (var ne = 0; ne < De; ne++)
        Xe[ne] = arguments[ne + 2];
      ae.children = Xe;
    }
    return { $$typeof: A, type: G.type, key: Pe, ref: ge, props: ae, _owner: me };
  }, Ha.createContext = function(G) {
    return G = { $$typeof: s, _currentValue: G, _currentValue2: G, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, G.Provider = { $$typeof: i, _context: G }, G.Consumer = G;
  }, Ha.createElement = I, Ha.createFactory = function(G) {
    var L = I.bind(null, G);
    return L.type = G, L;
  }, Ha.createRef = function() {
    return { current: null };
  }, Ha.forwardRef = function(G) {
    return { $$typeof: a, render: G };
  }, Ha.isValidElement = k, Ha.lazy = function(G) {
    return { $$typeof: d, _payload: { _status: -1, _result: G }, _init: Z };
  }, Ha.memo = function(G, L) {
    return { $$typeof: o, type: G, compare: L === void 0 ? null : L };
  }, Ha.startTransition = function(G) {
    var L = fe.transition;
    fe.transition = {};
    try {
      G();
    } finally {
      fe.transition = L;
    }
  }, Ha.unstable_act = function() {
    throw Error("act(...) is not supported in production builds of React.");
  }, Ha.useCallback = function(G, L) {
    return te.current.useCallback(G, L);
  }, Ha.useContext = function(G) {
    return te.current.useContext(G);
  }, Ha.useDebugValue = function() {
  }, Ha.useDeferredValue = function(G) {
    return te.current.useDeferredValue(G);
  }, Ha.useEffect = function(G, L) {
    return te.current.useEffect(G, L);
  }, Ha.useId = function() {
    return te.current.useId();
  }, Ha.useImperativeHandle = function(G, L, $) {
    return te.current.useImperativeHandle(G, L, $);
  }, Ha.useInsertionEffect = function(G, L) {
    return te.current.useInsertionEffect(G, L);
  }, Ha.useLayoutEffect = function(G, L) {
    return te.current.useLayoutEffect(G, L);
  }, Ha.useMemo = function(G, L) {
    return te.current.useMemo(G, L);
  }, Ha.useReducer = function(G, L, $) {
    return te.current.useReducer(G, L, $);
  }, Ha.useRef = function(G) {
    return te.current.useRef(G);
  }, Ha.useState = function(G) {
    return te.current.useState(G);
  }, Ha.useSyncExternalStore = function(G, L, $) {
    return te.current.useSyncExternalStore(G, L, $);
  }, Ha.useTransition = function() {
    return te.current.useTransition();
  }, Ha.version = "18.2.0", Ha;
}
process.env.NODE_ENV === "production" ? BN.exports = _je() : BN.exports = Zje();
var F0 = BN.exports;
/**
 * @license React
 * react-jsx-runtime.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var Z_;
function $je() {
  return Z_ || (Z_ = 1, process.env.NODE_ENV !== "production" && function() {
    var A = F0, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), a = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), o = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), u = Symbol.for("react.lazy"), l = Symbol.for("react.offscreen"), P = Symbol.iterator, p = "@@iterator";
    function c(it) {
      if (it === null || typeof it != "object")
        return null;
      var $t = P && it[P] || it[p];
      return typeof $t == "function" ? $t : null;
    }
    var H = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    function T(it) {
      {
        for (var $t = arguments.length, Ur = new Array($t > 1 ? $t - 1 : 0), $e = 1; $e < $t; $e++)
          Ur[$e - 1] = arguments[$e];
        q("error", it, Ur);
      }
    }
    function q(it, $t, Ur) {
      {
        var $e = H.ReactDebugCurrentFrame, Kt = $e.getStackAddendum();
        Kt !== "" && ($t += "%s", Ur = Ur.concat([Kt]));
        var cr = Ur.map(function(Vr) {
          return String(Vr);
        });
        cr.unshift("Warning: " + $t), Function.prototype.apply.call(console[it], console, cr);
      }
    }
    var b = !1, j = !1, w = !1, m = !1, I = !1, N;
    N = Symbol.for("react.module.reference");
    function k(it) {
      return !!(typeof it == "string" || typeof it == "function" || it === r || it === i || I || it === n || it === o || it === d || m || it === l || b || j || w || typeof it == "object" && it !== null && (it.$$typeof === u || it.$$typeof === v || it.$$typeof === s || it.$$typeof === a || it.$$typeof === f || // This needs to include all possible module reference object
      // types supported by any Flight configuration anywhere since
      // we don't know which Flight build this will end up being used
      // with.
      it.$$typeof === N || it.getModuleId !== void 0));
    }
    function R(it, $t, Ur) {
      var $e = it.displayName;
      if ($e)
        return $e;
      var Kt = $t.displayName || $t.name || "";
      return Kt !== "" ? Ur + "(" + Kt + ")" : Ur;
    }
    function y(it) {
      return it.displayName || "Context";
    }
    function O(it) {
      if (it == null)
        return null;
      if (typeof it.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof it == "function")
        return it.displayName || it.name || null;
      if (typeof it == "string")
        return it;
      switch (it) {
        case r:
          return "Fragment";
        case t:
          return "Portal";
        case i:
          return "Profiler";
        case n:
          return "StrictMode";
        case o:
          return "Suspense";
        case d:
          return "SuspenseList";
      }
      if (typeof it == "object")
        switch (it.$$typeof) {
          case a:
            var $t = it;
            return y($t) + ".Consumer";
          case s:
            var Ur = it;
            return y(Ur._context) + ".Provider";
          case f:
            return R(it, it.render, "ForwardRef");
          case v:
            var $e = it.displayName || null;
            return $e !== null ? $e : O(it.type) || "Memo";
          case u: {
            var Kt = it, cr = Kt._payload, Vr = Kt._init;
            try {
              return O(Vr(cr));
            } catch {
              return null;
            }
          }
        }
      return null;
    }
    var Y = Object.assign, ee = 0, Z, te, fe, _, G, L, $;
    function ae() {
    }
    ae.__reactDisabledLog = !0;
    function Pe() {
      {
        if (ee === 0) {
          Z = console.log, te = console.info, fe = console.warn, _ = console.error, G = console.group, L = console.groupCollapsed, $ = console.groupEnd;
          var it = {
            configurable: !0,
            enumerable: !0,
            value: ae,
            writable: !0
          };
          Object.defineProperties(console, {
            info: it,
            log: it,
            warn: it,
            error: it,
            group: it,
            groupCollapsed: it,
            groupEnd: it
          });
        }
        ee++;
      }
    }
    function ge() {
      {
        if (ee--, ee === 0) {
          var it = {
            configurable: !0,
            enumerable: !0,
            writable: !0
          };
          Object.defineProperties(console, {
            log: Y({}, it, {
              value: Z
            }),
            info: Y({}, it, {
              value: te
            }),
            warn: Y({}, it, {
              value: fe
            }),
            error: Y({}, it, {
              value: _
            }),
            group: Y({}, it, {
              value: G
            }),
            groupCollapsed: Y({}, it, {
              value: L
            }),
            groupEnd: Y({}, it, {
              value: $
            })
          });
        }
        ee < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
      }
    }
    var me = H.ReactCurrentDispatcher, Xe;
    function De(it, $t, Ur) {
      {
        if (Xe === void 0)
          try {
            throw Error();
          } catch (Kt) {
            var $e = Kt.stack.trim().match(/\n( *(at )?)/);
            Xe = $e && $e[1] || "";
          }
        return `
` + Xe + it;
      }
    }
    var ne = !1, re;
    {
      var ve = typeof WeakMap == "function" ? WeakMap : Map;
      re = new ve();
    }
    function qe(it, $t) {
      if (!it || ne)
        return "";
      {
        var Ur = re.get(it);
        if (Ur !== void 0)
          return Ur;
      }
      var $e;
      ne = !0;
      var Kt = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      var cr;
      cr = me.current, me.current = null, Pe();
      try {
        if ($t) {
          var Vr = function() {
            throw Error();
          };
          if (Object.defineProperty(Vr.prototype, "props", {
            set: function() {
              throw Error();
            }
          }), typeof Reflect == "object" && Reflect.construct) {
            try {
              Reflect.construct(Vr, []);
            } catch (Ri) {
              $e = Ri;
            }
            Reflect.construct(it, [], Vr);
          } else {
            try {
              Vr.call();
            } catch (Ri) {
              $e = Ri;
            }
            it.call(Vr.prototype);
          }
        } else {
          try {
            throw Error();
          } catch (Ri) {
            $e = Ri;
          }
          it();
        }
      } catch (Ri) {
        if (Ri && $e && typeof Ri.stack == "string") {
          for (var Lr = Ri.stack.split(`
`), pi = $e.stack.split(`
`), zr = Lr.length - 1, Cn = pi.length - 1; zr >= 1 && Cn >= 0 && Lr[zr] !== pi[Cn]; )
            Cn--;
          for (; zr >= 1 && Cn >= 0; zr--, Cn--)
            if (Lr[zr] !== pi[Cn]) {
              if (zr !== 1 || Cn !== 1)
                do
                  if (zr--, Cn--, Cn < 0 || Lr[zr] !== pi[Cn]) {
                    var Mi = `
` + Lr[zr].replace(" at new ", " at ");
                    return it.displayName && Mi.includes("<anonymous>") && (Mi = Mi.replace("<anonymous>", it.displayName)), typeof it == "function" && re.set(it, Mi), Mi;
                  }
                while (zr >= 1 && Cn >= 0);
              break;
            }
        }
      } finally {
        ne = !1, me.current = cr, ge(), Error.prepareStackTrace = Kt;
      }
      var li = it ? it.displayName || it.name : "", Xs = li ? De(li) : "";
      return typeof it == "function" && re.set(it, Xs), Xs;
    }
    function ke(it, $t, Ur) {
      return qe(it, !1);
    }
    function be(it) {
      var $t = it.prototype;
      return !!($t && $t.isReactComponent);
    }
    function Fe(it, $t, Ur) {
      if (it == null)
        return "";
      if (typeof it == "function")
        return qe(it, be(it));
      if (typeof it == "string")
        return De(it);
      switch (it) {
        case o:
          return De("Suspense");
        case d:
          return De("SuspenseList");
      }
      if (typeof it == "object")
        switch (it.$$typeof) {
          case f:
            return ke(it.render);
          case v:
            return Fe(it.type, $t, Ur);
          case u: {
            var $e = it, Kt = $e._payload, cr = $e._init;
            try {
              return Fe(cr(Kt), $t, Ur);
            } catch {
            }
          }
        }
      return "";
    }
    var Ke = Object.prototype.hasOwnProperty, nt = {}, ut = H.ReactDebugCurrentFrame;
    function bt(it) {
      if (it) {
        var $t = it._owner, Ur = Fe(it.type, it._source, $t ? $t.type : null);
        ut.setExtraStackFrame(Ur);
      } else
        ut.setExtraStackFrame(null);
    }
    function wt(it, $t, Ur, $e, Kt) {
      {
        var cr = Function.call.bind(Ke);
        for (var Vr in it)
          if (cr(it, Vr)) {
            var Lr = void 0;
            try {
              if (typeof it[Vr] != "function") {
                var pi = Error(($e || "React class") + ": " + Ur + " type `" + Vr + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof it[Vr] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                throw pi.name = "Invariant Violation", pi;
              }
              Lr = it[Vr]($t, Vr, $e, Ur, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
            } catch (zr) {
              Lr = zr;
            }
            Lr && !(Lr instanceof Error) && (bt(Kt), T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", $e || "React class", Ur, Vr, typeof Lr), bt(null)), Lr instanceof Error && !(Lr.message in nt) && (nt[Lr.message] = !0, bt(Kt), T("Failed %s type: %s", Ur, Lr.message), bt(null));
          }
      }
    }
    var Tt = Array.isArray;
    function lr(it) {
      return Tt(it);
    }
    function Qt(it) {
      {
        var $t = typeof Symbol == "function" && Symbol.toStringTag, Ur = $t && it[Symbol.toStringTag] || it.constructor.name || "Object";
        return Ur;
      }
    }
    function tr(it) {
      try {
        return br(it), !1;
      } catch {
        return !0;
      }
    }
    function br(it) {
      return "" + it;
    }
    function Xn(it) {
      if (tr(it))
        return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qt(it)), br(it);
    }
    var qr = H.ReactCurrentOwner, En = {
      key: !0,
      ref: !0,
      __self: !0,
      __source: !0
    }, Bn, Fi, Gt;
    Gt = {};
    function xr(it) {
      if (Ke.call(it, "ref")) {
        var $t = Object.getOwnPropertyDescriptor(it, "ref").get;
        if ($t && $t.isReactWarning)
          return !1;
      }
      return it.ref !== void 0;
    }
    function Br(it) {
      if (Ke.call(it, "key")) {
        var $t = Object.getOwnPropertyDescriptor(it, "key").get;
        if ($t && $t.isReactWarning)
          return !1;
      }
      return it.key !== void 0;
    }
    function nn(it, $t) {
      if (typeof it.ref == "string" && qr.current && $t && qr.current.stateNode !== $t) {
        var Ur = O(qr.current.type);
        Gt[Ur] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', O(qr.current.type), it.ref), Gt[Ur] = !0);
      }
    }
    function sn(it, $t) {
      {
        var Ur = function() {
          Bn || (Bn = !0, T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", $t));
        };
        Ur.isReactWarning = !0, Object.defineProperty(it, "key", {
          get: Ur,
          configurable: !0
        });
      }
    }
    function Pn(it, $t) {
      {
        var Ur = function() {
          Fi || (Fi = !0, T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", $t));
        };
        Ur.isReactWarning = !0, Object.defineProperty(it, "ref", {
          get: Ur,
          configurable: !0
        });
      }
    }
    var an = function(it, $t, Ur, $e, Kt, cr, Vr) {
      var Lr = {
        // This tag allows us to uniquely identify this as a React Element
        $$typeof: e,
        // Built-in properties that belong on the element
        type: it,
        key: $t,
        ref: Ur,
        props: Vr,
        // Record the component responsible for creating this element.
        _owner: cr
      };
      return Lr._store = {}, Object.defineProperty(Lr._store, "validated", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: !1
      }), Object.defineProperty(Lr, "_self", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: $e
      }), Object.defineProperty(Lr, "_source", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: Kt
      }), Object.freeze && (Object.freeze(Lr.props), Object.freeze(Lr)), Lr;
    };
    function Wn(it, $t, Ur, $e, Kt) {
      {
        var cr, Vr = {}, Lr = null, pi = null;
        Ur !== void 0 && (Xn(Ur), Lr = "" + Ur), Br($t) && (Xn($t.key), Lr = "" + $t.key), xr($t) && (pi = $t.ref, nn($t, Kt));
        for (cr in $t)
          Ke.call($t, cr) && !En.hasOwnProperty(cr) && (Vr[cr] = $t[cr]);
        if (it && it.defaultProps) {
          var zr = it.defaultProps;
          for (cr in zr)
            Vr[cr] === void 0 && (Vr[cr] = zr[cr]);
        }
        if (Lr || pi) {
          var Cn = typeof it == "function" ? it.displayName || it.name || "Unknown" : it;
          Lr && sn(Vr, Cn), pi && Pn(Vr, Cn);
        }
        return an(it, Lr, pi, Kt, $e, qr.current, Vr);
      }
    }
    var rr = H.ReactCurrentOwner, Sr = H.ReactDebugCurrentFrame;
    function nr(it) {
      if (it) {
        var $t = it._owner, Ur = Fe(it.type, it._source, $t ? $t.type : null);
        Sr.setExtraStackFrame(Ur);
      } else
        Sr.setExtraStackFrame(null);
    }
    var Er;
    Er = !1;
    function Rn(it) {
      return typeof it == "object" && it !== null && it.$$typeof === e;
    }
    function Vn() {
      {
        if (rr.current) {
          var it = O(rr.current.type);
          if (it)
            return `

Check the render method of \`` + it + "`.";
        }
        return "";
      }
    }
    function ki(it) {
      {
        if (it !== void 0) {
          var $t = it.fileName.replace(/^.*[\\\/]/, ""), Ur = it.lineNumber;
          return `

Check your code at ` + $t + ":" + Ur + ".";
        }
        return "";
      }
    }
    var as = {};
    function Rr(it) {
      {
        var $t = Vn();
        if (!$t) {
          var Ur = typeof it == "string" ? it : it.displayName || it.name;
          Ur && ($t = `

Check the top-level render call using <` + Ur + ">.");
        }
        return $t;
      }
    }
    function Ii(it, $t) {
      {
        if (!it._store || it._store.validated || it.key != null)
          return;
        it._store.validated = !0;
        var Ur = Rr($t);
        if (as[Ur])
          return;
        as[Ur] = !0;
        var $e = "";
        it && it._owner && it._owner !== rr.current && ($e = " It was passed a child from " + O(it._owner.type) + "."), nr(it), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', Ur, $e), nr(null);
      }
    }
    function is(it, $t) {
      {
        if (typeof it != "object")
          return;
        if (lr(it))
          for (var Ur = 0; Ur < it.length; Ur++) {
            var $e = it[Ur];
            Rn($e) && Ii($e, $t);
          }
        else if (Rn(it))
          it._store && (it._store.validated = !0);
        else if (it) {
          var Kt = c(it);
          if (typeof Kt == "function" && Kt !== it.entries)
            for (var cr = Kt.call(it), Vr; !(Vr = cr.next()).done; )
              Rn(Vr.value) && Ii(Vr.value, $t);
        }
      }
    }
    function ji(it) {
      {
        var $t = it.type;
        if ($t == null || typeof $t == "string")
          return;
        var Ur;
        if (typeof $t == "function")
          Ur = $t.propTypes;
        else if (typeof $t == "object" && ($t.$$typeof === f || // Note: Memo only checks outer props here.
        // Inner props are checked in the reconciler.
        $t.$$typeof === v))
          Ur = $t.propTypes;
        else
          return;
        if (Ur) {
          var $e = O($t);
          wt(Ur, it.props, "prop", $e, it);
        } else if ($t.PropTypes !== void 0 && !Er) {
          Er = !0;
          var Kt = O($t);
          T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Kt || "Unknown");
        }
        typeof $t.getDefaultProps == "function" && !$t.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
      }
    }
    function _i(it) {
      {
        for (var $t = Object.keys(it.props), Ur = 0; Ur < $t.length; Ur++) {
          var $e = $t[Ur];
          if ($e !== "children" && $e !== "key") {
            nr(it), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", $e), nr(null);
            break;
          }
        }
        it.ref !== null && (nr(it), T("Invalid attribute `ref` supplied to `React.Fragment`."), nr(null));
      }
    }
    function oi(it, $t, Ur, $e, Kt, cr) {
      {
        var Vr = k(it);
        if (!Vr) {
          var Lr = "";
          (it === void 0 || typeof it == "object" && it !== null && Object.keys(it).length === 0) && (Lr += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
          var pi = ki(Kt);
          pi ? Lr += pi : Lr += Vn();
          var zr;
          it === null ? zr = "null" : lr(it) ? zr = "array" : it !== void 0 && it.$$typeof === e ? (zr = "<" + (O(it.type) || "Unknown") + " />", Lr = " Did you accidentally export a JSX literal instead of a component?") : zr = typeof it, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", zr, Lr);
        }
        var Cn = Wn(it, $t, Ur, Kt, cr);
        if (Cn == null)
          return Cn;
        if (Vr) {
          var Mi = $t.children;
          if (Mi !== void 0)
            if ($e)
              if (lr(Mi)) {
                for (var li = 0; li < Mi.length; li++)
                  is(Mi[li], it);
                Object.freeze && Object.freeze(Mi);
              } else
                T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
            else
              is(Mi, it);
        }
        return it === r ? _i(Cn) : ji(Cn), Cn;
      }
    }
    function vr(it, $t, Ur) {
      return oi(it, $t, Ur, !0);
    }
    function Fr(it, $t, Ur) {
      return oi(it, $t, Ur, !1);
    }
    var pr = Fr, ds = vr;
    uI.Fragment = r, uI.jsx = pr, uI.jsxs = ds;
  }()), uI;
}
var lI = {};
/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var __;
function ewe() {
  if (__)
    return lI;
  __ = 1;
  var A = F0, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, n = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
  function s(a, f, o) {
    var d, v = {}, u = null, l = null;
    o !== void 0 && (u = "" + o), f.key !== void 0 && (u = "" + f.key), f.ref !== void 0 && (l = f.ref);
    for (d in f)
      r.call(f, d) && !i.hasOwnProperty(d) && (v[d] = f[d]);
    if (a && a.defaultProps)
      for (d in f = a.defaultProps, f)
        v[d] === void 0 && (v[d] = f[d]);
    return { $$typeof: e, type: a, key: u, ref: l, props: v, _owner: n.current };
  }
  return lI.Fragment = t, lI.jsx = s, lI.jsxs = s, lI;
}
process.env.NODE_ENV === "production" ? mN.exports = ewe() : mN.exports = $je();
var mi = mN.exports, LW = {}, WN = { exports: {} }, fc = {}, qC = { exports: {} }, O5 = {};
/**
 * @license React
 * scheduler.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var $_;
function twe() {
  return $_ || ($_ = 1, function(A) {
    process.env.NODE_ENV !== "production" && function() {
      typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
      var e = !1, t = !1, r = 5;
      function n(Gt, xr) {
        var Br = Gt.length;
        Gt.push(xr), a(Gt, xr, Br);
      }
      function i(Gt) {
        return Gt.length === 0 ? null : Gt[0];
      }
      function s(Gt) {
        if (Gt.length === 0)
          return null;
        var xr = Gt[0], Br = Gt.pop();
        return Br !== xr && (Gt[0] = Br, f(Gt, Br, 0)), xr;
      }
      function a(Gt, xr, Br) {
        for (var nn = Br; nn > 0; ) {
          var sn = nn - 1 >>> 1, Pn = Gt[sn];
          if (o(Pn, xr) > 0)
            Gt[sn] = xr, Gt[nn] = Pn, nn = sn;
          else
            return;
        }
      }
      function f(Gt, xr, Br) {
        for (var nn = Br, sn = Gt.length, Pn = sn >>> 1; nn < Pn; ) {
          var an = (nn + 1) * 2 - 1, Wn = Gt[an], rr = an + 1, Sr = Gt[rr];
          if (o(Wn, xr) < 0)
            rr < sn && o(Sr, Wn) < 0 ? (Gt[nn] = Sr, Gt[rr] = xr, nn = rr) : (Gt[nn] = Wn, Gt[an] = xr, nn = an);
          else if (rr < sn && o(Sr, xr) < 0)
            Gt[nn] = Sr, Gt[rr] = xr, nn = rr;
          else
            return;
        }
      }
      function o(Gt, xr) {
        var Br = Gt.sortIndex - xr.sortIndex;
        return Br !== 0 ? Br : Gt.id - xr.id;
      }
      var d = 1, v = 2, u = 3, l = 4, P = 5;
      function p(Gt, xr) {
      }
      var c = typeof performance == "object" && typeof performance.now == "function";
      if (c) {
        var H = performance;
        A.unstable_now = function() {
          return H.now();
        };
      } else {
        var T = Date, q = T.now();
        A.unstable_now = function() {
          return T.now() - q;
        };
      }
      var b = 1073741823, j = -1, w = 250, m = 5e3, I = 1e4, N = b, k = [], R = [], y = 1, O = null, Y = u, ee = !1, Z = !1, te = !1, fe = typeof setTimeout == "function" ? setTimeout : null, _ = typeof clearTimeout == "function" ? clearTimeout : null, G = typeof setImmediate < "u" ? setImmediate : null;
      typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling);
      function L(Gt) {
        for (var xr = i(R); xr !== null; ) {
          if (xr.callback === null)
            s(R);
          else if (xr.startTime <= Gt)
            s(R), xr.sortIndex = xr.expirationTime, n(k, xr);
          else
            return;
          xr = i(R);
        }
      }
      function $(Gt) {
        if (te = !1, L(Gt), !Z)
          if (i(k) !== null)
            Z = !0, Xn(ae);
          else {
            var xr = i(R);
            xr !== null && qr($, xr.startTime - Gt);
          }
      }
      function ae(Gt, xr) {
        Z = !1, te && (te = !1, En()), ee = !0;
        var Br = Y;
        try {
          var nn;
          if (!t)
            return Pe(Gt, xr);
        } finally {
          O = null, Y = Br, ee = !1;
        }
      }
      function Pe(Gt, xr) {
        var Br = xr;
        for (L(Br), O = i(k); O !== null && !e && !(O.expirationTime > Br && (!Gt || bt())); ) {
          var nn = O.callback;
          if (typeof nn == "function") {
            O.callback = null, Y = O.priorityLevel;
            var sn = O.expirationTime <= Br, Pn = nn(sn);
            Br = A.unstable_now(), typeof Pn == "function" ? O.callback = Pn : O === i(k) && s(k), L(Br);
          } else
            s(k);
          O = i(k);
        }
        if (O !== null)
          return !0;
        var an = i(R);
        return an !== null && qr($, an.startTime - Br), !1;
      }
      function ge(Gt, xr) {
        switch (Gt) {
          case d:
          case v:
          case u:
          case l:
          case P:
            break;
          default:
            Gt = u;
        }
        var Br = Y;
        Y = Gt;
        try {
          return xr();
        } finally {
          Y = Br;
        }
      }
      function me(Gt) {
        var xr;
        switch (Y) {
          case d:
          case v:
          case u:
            xr = u;
            break;
          default:
            xr = Y;
            break;
        }
        var Br = Y;
        Y = xr;
        try {
          return Gt();
        } finally {
          Y = Br;
        }
      }
      function Xe(Gt) {
        var xr = Y;
        return function() {
          var Br = Y;
          Y = xr;
          try {
            return Gt.apply(this, arguments);
          } finally {
            Y = Br;
          }
        };
      }
      function De(Gt, xr, Br) {
        var nn = A.unstable_now(), sn;
        if (typeof Br == "object" && Br !== null) {
          var Pn = Br.delay;
          typeof Pn == "number" && Pn > 0 ? sn = nn + Pn : sn = nn;
        } else
          sn = nn;
        var an;
        switch (Gt) {
          case d:
            an = j;
            break;
          case v:
            an = w;
            break;
          case P:
            an = N;
            break;
          case l:
            an = I;
            break;
          case u:
          default:
            an = m;
            break;
        }
        var Wn = sn + an, rr = {
          id: y++,
          callback: xr,
          priorityLevel: Gt,
          startTime: sn,
          expirationTime: Wn,
          sortIndex: -1
        };
        return sn > nn ? (rr.sortIndex = sn, n(R, rr), i(k) === null && rr === i(R) && (te ? En() : te = !0, qr($, sn - nn))) : (rr.sortIndex = Wn, n(k, rr), !Z && !ee && (Z = !0, Xn(ae))), rr;
      }
      function ne() {
      }
      function re() {
        !Z && !ee && (Z = !0, Xn(ae));
      }
      function ve() {
        return i(k);
      }
      function qe(Gt) {
        Gt.callback = null;
      }
      function ke() {
        return Y;
      }
      var be = !1, Fe = null, Ke = -1, nt = r, ut = -1;
      function bt() {
        var Gt = A.unstable_now() - ut;
        return !(Gt < nt);
      }
      function wt() {
      }
      function Tt(Gt) {
        if (Gt < 0 || Gt > 125) {
          console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
          return;
        }
        Gt > 0 ? nt = Math.floor(1e3 / Gt) : nt = r;
      }
      var lr = function() {
        if (Fe !== null) {
          var Gt = A.unstable_now();
          ut = Gt;
          var xr = !0, Br = !0;
          try {
            Br = Fe(xr, Gt);
          } finally {
            Br ? Qt() : (be = !1, Fe = null);
          }
        } else
          be = !1;
      }, Qt;
      if (typeof G == "function")
        Qt = function() {
          G(lr);
        };
      else if (typeof MessageChannel < "u") {
        var tr = new MessageChannel(), br = tr.port2;
        tr.port1.onmessage = lr, Qt = function() {
          br.postMessage(null);
        };
      } else
        Qt = function() {
          fe(lr, 0);
        };
      function Xn(Gt) {
        Fe = Gt, be || (be = !0, Qt());
      }
      function qr(Gt, xr) {
        Ke = fe(function() {
          Gt(A.unstable_now());
        }, xr);
      }
      function En() {
        _(Ke), Ke = -1;
      }
      var Bn = wt, Fi = null;
      A.unstable_IdlePriority = P, A.unstable_ImmediatePriority = d, A.unstable_LowPriority = l, A.unstable_NormalPriority = u, A.unstable_Profiling = Fi, A.unstable_UserBlockingPriority = v, A.unstable_cancelCallback = qe, A.unstable_continueExecution = re, A.unstable_forceFrameRate = Tt, A.unstable_getCurrentPriorityLevel = ke, A.unstable_getFirstCallbackNode = ve, A.unstable_next = me, A.unstable_pauseExecution = ne, A.unstable_requestPaint = Bn, A.unstable_runWithPriority = ge, A.unstable_scheduleCallback = De, A.unstable_shouldYield = bt, A.unstable_wrapCallback = Xe, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
    }();
  }(O5)), O5;
}
var y5 = {};
/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var e$;
function rwe() {
  return e$ || (e$ = 1, function(A) {
    function e(fe, _) {
      var G = fe.length;
      fe.push(_);
      e:
        for (; 0 < G; ) {
          var L = G - 1 >>> 1, $ = fe[L];
          if (0 < n($, _))
            fe[L] = _, fe[G] = $, G = L;
          else
            break e;
        }
    }
    function t(fe) {
      return fe.length === 0 ? null : fe[0];
    }
    function r(fe) {
      if (fe.length === 0)
        return null;
      var _ = fe[0], G = fe.pop();
      if (G !== _) {
        fe[0] = G;
        e:
          for (var L = 0, $ = fe.length, ae = $ >>> 1; L < ae; ) {
            var Pe = 2 * (L + 1) - 1, ge = fe[Pe], me = Pe + 1, Xe = fe[me];
            if (0 > n(ge, G))
              me < $ && 0 > n(Xe, ge) ? (fe[L] = Xe, fe[me] = G, L = me) : (fe[L] = ge, fe[Pe] = G, L = Pe);
            else if (me < $ && 0 > n(Xe, G))
              fe[L] = Xe, fe[me] = G, L = me;
            else
              break e;
          }
      }
      return _;
    }
    function n(fe, _) {
      var G = fe.sortIndex - _.sortIndex;
      return G !== 0 ? G : fe.id - _.id;
    }
    if (typeof performance == "object" && typeof performance.now == "function") {
      var i = performance;
      A.unstable_now = function() {
        return i.now();
      };
    } else {
      var s = Date, a = s.now();
      A.unstable_now = function() {
        return s.now() - a;
      };
    }
    var f = [], o = [], d = 1, v = null, u = 3, l = !1, P = !1, p = !1, c = typeof setTimeout == "function" ? setTimeout : null, H = typeof clearTimeout == "function" ? clearTimeout : null, T = typeof setImmediate < "u" ? setImmediate : null;
    typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling);
    function q(fe) {
      for (var _ = t(o); _ !== null; ) {
        if (_.callback === null)
          r(o);
        else if (_.startTime <= fe)
          r(o), _.sortIndex = _.expirationTime, e(f, _);
        else
          break;
        _ = t(o);
      }
    }
    function b(fe) {
      if (p = !1, q(fe), !P)
        if (t(f) !== null)
          P = !0, Z(j);
        else {
          var _ = t(o);
          _ !== null && te(b, _.startTime - fe);
        }
    }
    function j(fe, _) {
      P = !1, p && (p = !1, H(I), I = -1), l = !0;
      var G = u;
      try {
        for (q(_), v = t(f); v !== null && (!(v.expirationTime > _) || fe && !R()); ) {
          var L = v.callback;
          if (typeof L == "function") {
            v.callback = null, u = v.priorityLevel;
            var $ = L(v.expirationTime <= _);
            _ = A.unstable_now(), typeof $ == "function" ? v.callback = $ : v === t(f) && r(f), q(_);
          } else
            r(f);
          v = t(f);
        }
        if (v !== null)
          var ae = !0;
        else {
          var Pe = t(o);
          Pe !== null && te(b, Pe.startTime - _), ae = !1;
        }
        return ae;
      } finally {
        v = null, u = G, l = !1;
      }
    }
    var w = !1, m = null, I = -1, N = 5, k = -1;
    function R() {
      return !(A.unstable_now() - k < N);
    }
    function y() {
      if (m !== null) {
        var fe = A.unstable_now();
        k = fe;
        var _ = !0;
        try {
          _ = m(!0, fe);
        } finally {
          _ ? O() : (w = !1, m = null);
        }
      } else
        w = !1;
    }
    var O;
    if (typeof T == "function")
      O = function() {
        T(y);
      };
    else if (typeof MessageChannel < "u") {
      var Y = new MessageChannel(), ee = Y.port2;
      Y.port1.onmessage = y, O = function() {
        ee.postMessage(null);
      };
    } else
      O = function() {
        c(y, 0);
      };
    function Z(fe) {
      m = fe, w || (w = !0, O());
    }
    function te(fe, _) {
      I = c(function() {
        fe(A.unstable_now());
      }, _);
    }
    A.unstable_IdlePriority = 5, A.unstable_ImmediatePriority = 1, A.unstable_LowPriority = 4, A.unstable_NormalPriority = 3, A.unstable_Profiling = null, A.unstable_UserBlockingPriority = 2, A.unstable_cancelCallback = function(fe) {
      fe.callback = null;
    }, A.unstable_continueExecution = function() {
      P || l || (P = !0, Z(j));
    }, A.unstable_forceFrameRate = function(fe) {
      0 > fe || 125 < fe ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : N = 0 < fe ? Math.floor(1e3 / fe) : 5;
    }, A.unstable_getCurrentPriorityLevel = function() {
      return u;
    }, A.unstable_getFirstCallbackNode = function() {
      return t(f);
    }, A.unstable_next = function(fe) {
      switch (u) {
        case 1:
        case 2:
        case 3:
          var _ = 3;
          break;
        default:
          _ = u;
      }
      var G = u;
      u = _;
      try {
        return fe();
      } finally {
        u = G;
      }
    }, A.unstable_pauseExecution = function() {
    }, A.unstable_requestPaint = function() {
    }, A.unstable_runWithPriority = function(fe, _) {
      switch (fe) {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
          break;
        default:
          fe = 3;
      }
      var G = u;
      u = fe;
      try {
        return _();
      } finally {
        u = G;
      }
    }, A.unstable_scheduleCallback = function(fe, _, G) {
      var L = A.unstable_now();
      switch (typeof G == "object" && G !== null ? (G = G.delay, G = typeof G == "number" && 0 < G ? L + G : L) : G = L, fe) {
        case 1:
          var $ = -1;
          break;
        case 2:
          $ = 250;
          break;
        case 5:
          $ = 1073741823;
          break;
        case 4:
          $ = 1e4;
          break;
        default:
          $ = 5e3;
      }
      return $ = G + $, fe = { id: d++, callback: _, priorityLevel: fe, startTime: G, expirationTime: $, sortIndex: -1 }, G > L ? (fe.sortIndex = G, e(o, fe), t(f) === null && fe === t(o) && (p ? (H(I), I = -1) : p = !0, te(b, G - L))) : (fe.sortIndex = $, e(f, fe), P || l || (P = !0, Z(j))), fe;
    }, A.unstable_shouldYield = R, A.unstable_wrapCallback = function(fe) {
      var _ = u;
      return function() {
        var G = u;
        u = _;
        try {
          return fe.apply(this, arguments);
        } finally {
          u = G;
        }
      };
    };
  }(y5)), y5;
}
var t$;
function f9e() {
  return t$ || (t$ = 1, process.env.NODE_ENV === "production" ? qC.exports = rwe() : qC.exports = twe()), qC.exports;
}
/**
 * @license React
 * react-dom.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var r$;
function nwe() {
  return r$ || (r$ = 1, process.env.NODE_ENV !== "production" && function() {
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
    var A = F0, e = f9e(), t = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, r = !1;
    function n(h) {
      r = h;
    }
    function i(h) {
      if (!r) {
        for (var X = arguments.length, W = new Array(X > 1 ? X - 1 : 0), V = 1; V < X; V++)
          W[V - 1] = arguments[V];
        a("warn", h, W);
      }
    }
    function s(h) {
      if (!r) {
        for (var X = arguments.length, W = new Array(X > 1 ? X - 1 : 0), V = 1; V < X; V++)
          W[V - 1] = arguments[V];
        a("error", h, W);
      }
    }
    function a(h, X, W) {
      {
        var V = t.ReactDebugCurrentFrame, Q = V.getStackAddendum();
        Q !== "" && (X += "%s", W = W.concat([Q]));
        var ie = W.map(function(le) {
          return String(le);
        });
        ie.unshift("Warning: " + X), Function.prototype.apply.call(console[h], console, ie);
      }
    }
    var f = 0, o = 1, d = 2, v = 3, u = 4, l = 5, P = 6, p = 7, c = 8, H = 9, T = 10, q = 11, b = 12, j = 13, w = 14, m = 15, I = 16, N = 17, k = 18, R = 19, y = 21, O = 22, Y = 23, ee = 24, Z = 25, te = !0, fe = !1, _ = !1, G = !1, L = !1, $ = !0, ae = !1, Pe = !1, ge = !0, me = !0, Xe = !0, De = /* @__PURE__ */ new Set(), ne = {}, re = {};
    function ve(h, X) {
      qe(h, X), qe(h + "Capture", X);
    }
    function qe(h, X) {
      ne[h] && s("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", h), ne[h] = X;
      {
        var W = h.toLowerCase();
        re[W] = h, h === "onDoubleClick" && (re.ondblclick = h);
      }
      for (var V = 0; V < X.length; V++)
        De.add(X[V]);
    }
    var ke = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", be = Object.prototype.hasOwnProperty;
    function Fe(h) {
      {
        var X = typeof Symbol == "function" && Symbol.toStringTag, W = X && h[Symbol.toStringTag] || h.constructor.name || "Object";
        return W;
      }
    }
    function Ke(h) {
      try {
        return nt(h), !1;
      } catch {
        return !0;
      }
    }
    function nt(h) {
      return "" + h;
    }
    function ut(h, X) {
      if (Ke(h))
        return s("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", X, Fe(h)), nt(h);
    }
    function bt(h) {
      if (Ke(h))
        return s("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Fe(h)), nt(h);
    }
    function wt(h, X) {
      if (Ke(h))
        return s("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", X, Fe(h)), nt(h);
    }
    function Tt(h, X) {
      if (Ke(h))
        return s("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", X, Fe(h)), nt(h);
    }
    function lr(h) {
      if (Ke(h))
        return s("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", Fe(h)), nt(h);
    }
    function Qt(h) {
      if (Ke(h))
        return s("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", Fe(h)), nt(h);
    }
    var tr = 0, br = 1, Xn = 2, qr = 3, En = 4, Bn = 5, Fi = 6, Gt = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", xr = Gt + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040", Br = new RegExp("^[" + Gt + "][" + xr + "]*$"), nn = {}, sn = {};
    function Pn(h) {
      return be.call(sn, h) ? !0 : be.call(nn, h) ? !1 : Br.test(h) ? (sn[h] = !0, !0) : (nn[h] = !0, s("Invalid attribute name: `%s`", h), !1);
    }
    function an(h, X, W) {
      return X !== null ? X.type === tr : W ? !1 : h.length > 2 && (h[0] === "o" || h[0] === "O") && (h[1] === "n" || h[1] === "N");
    }
    function Wn(h, X, W, V) {
      if (W !== null && W.type === tr)
        return !1;
      switch (typeof X) {
        case "function":
        case "symbol":
          return !0;
        case "boolean": {
          if (V)
            return !1;
          if (W !== null)
            return !W.acceptsBooleans;
          var Q = h.toLowerCase().slice(0, 5);
          return Q !== "data-" && Q !== "aria-";
        }
        default:
          return !1;
      }
    }
    function rr(h, X, W, V) {
      if (X === null || typeof X > "u" || Wn(h, X, W, V))
        return !0;
      if (V)
        return !1;
      if (W !== null)
        switch (W.type) {
          case qr:
            return !X;
          case En:
            return X === !1;
          case Bn:
            return isNaN(X);
          case Fi:
            return isNaN(X) || X < 1;
        }
      return !1;
    }
    function Sr(h) {
      return Er.hasOwnProperty(h) ? Er[h] : null;
    }
    function nr(h, X, W, V, Q, ie, le) {
      this.acceptsBooleans = X === Xn || X === qr || X === En, this.attributeName = V, this.attributeNamespace = Q, this.mustUseProperty = W, this.propertyName = h, this.type = X, this.sanitizeURL = ie, this.removeEmptyString = le;
    }
    var Er = {}, Rn = [
      "children",
      "dangerouslySetInnerHTML",
      // TODO: This prevents the assignment of defaultValue to regular
      // elements (not just inputs). Now that ReactDOMInput assigns to the
      // defaultValue property -- do we need this?
      "defaultValue",
      "defaultChecked",
      "innerHTML",
      "suppressContentEditableWarning",
      "suppressHydrationWarning",
      "style"
    ];
    Rn.forEach(function(h) {
      Er[h] = new nr(
        h,
        tr,
        !1,
        // mustUseProperty
        h,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(h) {
      var X = h[0], W = h[1];
      Er[X] = new nr(
        X,
        br,
        !1,
        // mustUseProperty
        W,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(h) {
      Er[h] = new nr(
        h,
        Xn,
        !1,
        // mustUseProperty
        h.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(h) {
      Er[h] = new nr(
        h,
        Xn,
        !1,
        // mustUseProperty
        h,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "allowFullScreen",
      "async",
      // Note: there is a special case that prevents it from being written to the DOM
      // on the client side because the browsers are inconsistent. Instead we call focus().
      "autoFocus",
      "autoPlay",
      "controls",
      "default",
      "defer",
      "disabled",
      "disablePictureInPicture",
      "disableRemotePlayback",
      "formNoValidate",
      "hidden",
      "loop",
      "noModule",
      "noValidate",
      "open",
      "playsInline",
      "readOnly",
      "required",
      "reversed",
      "scoped",
      "seamless",
      // Microdata
      "itemScope"
    ].forEach(function(h) {
      Er[h] = new nr(
        h,
        qr,
        !1,
        // mustUseProperty
        h.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "checked",
      // Note: `option.selected` is not updated if `select.multiple` is
      // disabled with `removeAttribute`. We have special logic for handling this.
      "multiple",
      "muted",
      "selected"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(h) {
      Er[h] = new nr(
        h,
        qr,
        !0,
        // mustUseProperty
        h,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "capture",
      "download"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(h) {
      Er[h] = new nr(
        h,
        En,
        !1,
        // mustUseProperty
        h,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "cols",
      "rows",
      "size",
      "span"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(h) {
      Er[h] = new nr(
        h,
        Fi,
        !1,
        // mustUseProperty
        h,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), ["rowSpan", "start"].forEach(function(h) {
      Er[h] = new nr(
        h,
        Bn,
        !1,
        // mustUseProperty
        h.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    });
    var Vn = /[\-\:]([a-z])/g, ki = function(h) {
      return h[1].toUpperCase();
    };
    [
      "accent-height",
      "alignment-baseline",
      "arabic-form",
      "baseline-shift",
      "cap-height",
      "clip-path",
      "clip-rule",
      "color-interpolation",
      "color-interpolation-filters",
      "color-profile",
      "color-rendering",
      "dominant-baseline",
      "enable-background",
      "fill-opacity",
      "fill-rule",
      "flood-color",
      "flood-opacity",
      "font-family",
      "font-size",
      "font-size-adjust",
      "font-stretch",
      "font-style",
      "font-variant",
      "font-weight",
      "glyph-name",
      "glyph-orientation-horizontal",
      "glyph-orientation-vertical",
      "horiz-adv-x",
      "horiz-origin-x",
      "image-rendering",
      "letter-spacing",
      "lighting-color",
      "marker-end",
      "marker-mid",
      "marker-start",
      "overline-position",
      "overline-thickness",
      "paint-order",
      "panose-1",
      "pointer-events",
      "rendering-intent",
      "shape-rendering",
      "stop-color",
      "stop-opacity",
      "strikethrough-position",
      "strikethrough-thickness",
      "stroke-dasharray",
      "stroke-dashoffset",
      "stroke-linecap",
      "stroke-linejoin",
      "stroke-miterlimit",
      "stroke-opacity",
      "stroke-width",
      "text-anchor",
      "text-decoration",
      "text-rendering",
      "underline-position",
      "underline-thickness",
      "unicode-bidi",
      "unicode-range",
      "units-per-em",
      "v-alphabetic",
      "v-hanging",
      "v-ideographic",
      "v-mathematical",
      "vector-effect",
      "vert-adv-y",
      "vert-origin-x",
      "vert-origin-y",
      "word-spacing",
      "writing-mode",
      "xmlns:xlink",
      "x-height"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(h) {
      var X = h.replace(Vn, ki);
      Er[X] = new nr(
        X,
        br,
        !1,
        // mustUseProperty
        h,
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "xlink:actuate",
      "xlink:arcrole",
      "xlink:role",
      "xlink:show",
      "xlink:title",
      "xlink:type"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(h) {
      var X = h.replace(Vn, ki);
      Er[X] = new nr(
        X,
        br,
        !1,
        // mustUseProperty
        h,
        "http://www.w3.org/1999/xlink",
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "xml:base",
      "xml:lang",
      "xml:space"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(h) {
      var X = h.replace(Vn, ki);
      Er[X] = new nr(
        X,
        br,
        !1,
        // mustUseProperty
        h,
        "http://www.w3.org/XML/1998/namespace",
        !1,
        // sanitizeURL
        !1
      );
    }), ["tabIndex", "crossOrigin"].forEach(function(h) {
      Er[h] = new nr(
        h,
        br,
        !1,
        // mustUseProperty
        h.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    });
    var as = "xlinkHref";
    Er[as] = new nr(
      "xlinkHref",
      br,
      !1,
      // mustUseProperty
      "xlink:href",
      "http://www.w3.org/1999/xlink",
      !0,
      // sanitizeURL
      !1
    ), ["src", "href", "action", "formAction"].forEach(function(h) {
      Er[h] = new nr(
        h,
        br,
        !1,
        // mustUseProperty
        h.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !0,
        // sanitizeURL
        !0
      );
    });
    var Rr = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i, Ii = !1;
    function is(h) {
      !Ii && Rr.test(h) && (Ii = !0, s("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(h)));
    }
    function ji(h, X, W, V) {
      if (V.mustUseProperty) {
        var Q = V.propertyName;
        return h[Q];
      } else {
        ut(W, X), V.sanitizeURL && is("" + W);
        var ie = V.attributeName, le = null;
        if (V.type === En) {
          if (h.hasAttribute(ie)) {
            var He = h.getAttribute(ie);
            return He === "" ? !0 : rr(X, W, V, !1) ? He : He === "" + W ? W : He;
          }
        } else if (h.hasAttribute(ie)) {
          if (rr(X, W, V, !1))
            return h.getAttribute(ie);
          if (V.type === qr)
            return W;
          le = h.getAttribute(ie);
        }
        return rr(X, W, V, !1) ? le === null ? W : le : le === "" + W ? W : le;
      }
    }
    function _i(h, X, W, V) {
      {
        if (!Pn(X))
          return;
        if (!h.hasAttribute(X))
          return W === void 0 ? void 0 : null;
        var Q = h.getAttribute(X);
        return ut(W, X), Q === "" + W ? W : Q;
      }
    }
    function oi(h, X, W, V) {
      var Q = Sr(X);
      if (!an(X, Q, V)) {
        if (rr(X, W, Q, V) && (W = null), V || Q === null) {
          if (Pn(X)) {
            var ie = X;
            W === null ? h.removeAttribute(ie) : (ut(W, X), h.setAttribute(ie, "" + W));
          }
          return;
        }
        var le = Q.mustUseProperty;
        if (le) {
          var He = Q.propertyName;
          if (W === null) {
            var xe = Q.type;
            h[He] = xe === qr ? !1 : "";
          } else
            h[He] = W;
          return;
        }
        var Je = Q.attributeName, _e = Q.attributeNamespace;
        if (W === null)
          h.removeAttribute(Je);
        else {
          var qt = Q.type, Ht;
          qt === qr || qt === En && W === !0 ? Ht = "" : (ut(W, Je), Ht = "" + W, Q.sanitizeURL && is(Ht.toString())), _e ? h.setAttributeNS(_e, Je, Ht) : h.setAttribute(Je, Ht);
        }
      }
    }
    var vr = Symbol.for("react.element"), Fr = Symbol.for("react.portal"), pr = Symbol.for("react.fragment"), ds = Symbol.for("react.strict_mode"), it = Symbol.for("react.profiler"), $t = Symbol.for("react.provider"), Ur = Symbol.for("react.context"), $e = Symbol.for("react.forward_ref"), Kt = Symbol.for("react.suspense"), cr = Symbol.for("react.suspense_list"), Vr = Symbol.for("react.memo"), Lr = Symbol.for("react.lazy"), pi = Symbol.for("react.scope"), zr = Symbol.for("react.debug_trace_mode"), Cn = Symbol.for("react.offscreen"), Mi = Symbol.for("react.legacy_hidden"), li = Symbol.for("react.cache"), Xs = Symbol.for("react.tracing_marker"), Ri = Symbol.iterator, j1 = "@@iterator";
    function w1(h) {
      if (h === null || typeof h != "object")
        return null;
      var X = Ri && h[Ri] || h[j1];
      return typeof X == "function" ? X : null;
    }
    var di = Object.assign, jf = 0, B6, W6, S6, qa, m1, Ho, X9;
    function $o() {
    }
    $o.__reactDisabledLog = !0;
    function T9() {
      {
        if (jf === 0) {
          B6 = console.log, W6 = console.info, S6 = console.warn, qa = console.error, m1 = console.group, Ho = console.groupCollapsed, X9 = console.groupEnd;
          var h = {
            configurable: !0,
            enumerable: !0,
            value: $o,
            writable: !0
          };
          Object.defineProperties(console, {
            info: h,
            log: h,
            warn: h,
            error: h,
            group: h,
            groupCollapsed: h,
            groupEnd: h
          });
        }
        jf++;
      }
    }
    function q9() {
      {
        if (jf--, jf === 0) {
          var h = {
            configurable: !0,
            enumerable: !0,
            writable: !0
          };
          Object.defineProperties(console, {
            log: di({}, h, {
              value: B6
            }),
            info: di({}, h, {
              value: W6
            }),
            warn: di({}, h, {
              value: S6
            }),
            error: di({}, h, {
              value: qa
            }),
            group: di({}, h, {
              value: m1
            }),
            groupCollapsed: di({}, h, {
              value: Ho
            }),
            groupEnd: di({}, h, {
              value: X9
            })
          });
        }
        jf < 0 && s("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
      }
    }
    var wf = t.ReactCurrentDispatcher, mf;
    function B1(h, X, W) {
      {
        if (mf === void 0)
          try {
            throw Error();
          } catch (Q) {
            var V = Q.stack.trim().match(/\n( *(at )?)/);
            mf = V && V[1] || "";
          }
        return `
` + mf + h;
      }
    }
    var h1 = !1, U6;
    {
      var b9 = typeof WeakMap == "function" ? WeakMap : Map;
      U6 = new b9();
    }
    function J9(h, X) {
      if (!h || h1)
        return "";
      {
        var W = U6.get(h);
        if (W !== void 0)
          return W;
      }
      var V;
      h1 = !0;
      var Q = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      var ie;
      ie = wf.current, wf.current = null, T9();
      try {
        if (X) {
          var le = function() {
            throw Error();
          };
          if (Object.defineProperty(le.prototype, "props", {
            set: function() {
              throw Error();
            }
          }), typeof Reflect == "object" && Reflect.construct) {
            try {
              Reflect.construct(le, []);
            } catch (Lt) {
              V = Lt;
            }
            Reflect.construct(h, [], le);
          } else {
            try {
              le.call();
            } catch (Lt) {
              V = Lt;
            }
            h.call(le.prototype);
          }
        } else {
          try {
            throw Error();
          } catch (Lt) {
            V = Lt;
          }
          h();
        }
      } catch (Lt) {
        if (Lt && V && typeof Lt.stack == "string") {
          for (var He = Lt.stack.split(`
`), xe = V.stack.split(`
`), Je = He.length - 1, _e = xe.length - 1; Je >= 1 && _e >= 0 && He[Je] !== xe[_e]; )
            _e--;
          for (; Je >= 1 && _e >= 0; Je--, _e--)
            if (He[Je] !== xe[_e]) {
              if (Je !== 1 || _e !== 1)
                do
                  if (Je--, _e--, _e < 0 || He[Je] !== xe[_e]) {
                    var qt = `
` + He[Je].replace(" at new ", " at ");
                    return h.displayName && qt.includes("<anonymous>") && (qt = qt.replace("<anonymous>", h.displayName)), typeof h == "function" && U6.set(h, qt), qt;
                  }
                while (Je >= 1 && _e >= 0);
              break;
            }
        }
      } finally {
        h1 = !1, wf.current = ie, q9(), Error.prepareStackTrace = Q;
      }
      var Ht = h ? h.displayName || h.name : "", Mt = Ht ? B1(Ht) : "";
      return typeof h == "function" && U6.set(h, Mt), Mt;
    }
    function OA(h, X, W) {
      return J9(h, !0);
    }
    function z1(h, X, W) {
      return J9(h, !1);
    }
    function Zd(h) {
      var X = h.prototype;
      return !!(X && X.isReactComponent);
    }
    function Zr(h, X, W) {
      if (h == null)
        return "";
      if (typeof h == "function")
        return J9(h, Zd(h));
      if (typeof h == "string")
        return B1(h);
      switch (h) {
        case Kt:
          return B1("Suspense");
        case cr:
          return B1("SuspenseList");
      }
      if (typeof h == "object")
        switch (h.$$typeof) {
          case $e:
            return z1(h.render);
          case Vr:
            return Zr(h.type, X, W);
          case Lr: {
            var V = h, Q = V._payload, ie = V._init;
            try {
              return Zr(ie(Q), X, W);
            } catch {
            }
          }
        }
      return "";
    }
    function Ts(h) {
      switch (h._debugOwner && h._debugOwner.type, h._debugSource, h.tag) {
        case l:
          return B1(h.type);
        case I:
          return B1("Lazy");
        case j:
          return B1("Suspense");
        case R:
          return B1("SuspenseList");
        case f:
        case d:
        case m:
          return z1(h.type);
        case q:
          return z1(h.type.render);
        case o:
          return OA(h.type);
        default:
          return "";
      }
    }
    function go(h) {
      try {
        var X = "", W = h;
        do
          X += Ts(W), W = W.return;
        while (W);
        return X;
      } catch (V) {
        return `
Error generating stack: ` + V.message + `
` + V.stack;
      }
    }
    function G1(h, X, W) {
      var V = h.displayName;
      if (V)
        return V;
      var Q = X.displayName || X.name || "";
      return Q !== "" ? W + "(" + Q + ")" : W;
    }
    function z9(h) {
      return h.displayName || "Context";
    }
    function Li(h) {
      if (h == null)
        return null;
      if (typeof h.tag == "number" && s("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof h == "function")
        return h.displayName || h.name || null;
      if (typeof h == "string")
        return h;
      switch (h) {
        case pr:
          return "Fragment";
        case Fr:
          return "Portal";
        case it:
          return "Profiler";
        case ds:
          return "StrictMode";
        case Kt:
          return "Suspense";
        case cr:
          return "SuspenseList";
      }
      if (typeof h == "object")
        switch (h.$$typeof) {
          case Ur:
            var X = h;
            return z9(X) + ".Consumer";
          case $t:
            var W = h;
            return z9(W._context) + ".Provider";
          case $e:
            return G1(h, h.render, "ForwardRef");
          case Vr:
            var V = h.displayName || null;
            return V !== null ? V : Li(h.type) || "Memo";
          case Lr: {
            var Q = h, ie = Q._payload, le = Q._init;
            try {
              return Li(le(ie));
            } catch {
              return null;
            }
          }
        }
      return null;
    }
    function Fa(h, X, W) {
      var V = X.displayName || X.name || "";
      return h.displayName || (V !== "" ? W + "(" + V + ")" : W);
    }
    function Sa(h) {
      return h.displayName || "Context";
    }
    function Fn(h) {
      var X = h.tag, W = h.type;
      switch (X) {
        case ee:
          return "Cache";
        case H:
          var V = W;
          return Sa(V) + ".Consumer";
        case T:
          var Q = W;
          return Sa(Q._context) + ".Provider";
        case k:
          return "DehydratedFragment";
        case q:
          return Fa(W, W.render, "ForwardRef");
        case p:
          return "Fragment";
        case l:
          return W;
        case u:
          return "Portal";
        case v:
          return "Root";
        case P:
          return "Text";
        case I:
          return Li(W);
        case c:
          return W === ds ? "StrictMode" : "Mode";
        case O:
          return "Offscreen";
        case b:
          return "Profiler";
        case y:
          return "Scope";
        case j:
          return "Suspense";
        case R:
          return "SuspenseList";
        case Z:
          return "TracingMarker";
        case o:
        case f:
        case N:
        case d:
        case w:
        case m:
          if (typeof W == "function")
            return W.displayName || W.name || null;
          if (typeof W == "string")
            return W;
          break;
      }
      return null;
    }
    var I6 = t.ReactDebugCurrentFrame, $i = null, Ga = !1;
    function e1() {
      {
        if ($i === null)
          return null;
        var h = $i._debugOwner;
        if (h !== null && typeof h < "u")
          return Fn(h);
      }
      return null;
    }
    function Lf() {
      return $i === null ? "" : go($i);
    }
    function Ua() {
      I6.getCurrentStack = null, $i = null, Ga = !1;
    }
    function vs(h) {
      I6.getCurrentStack = h === null ? null : Lf, $i = h, Ga = !1;
    }
    function R6() {
      return $i;
    }
    function Bf(h) {
      Ga = h;
    }
    function Ie(h) {
      return "" + h;
    }
    function Pt(h) {
      switch (typeof h) {
        case "boolean":
        case "number":
        case "string":
        case "undefined":
          return h;
        case "object":
          return Qt(h), h;
        default:
          return "";
      }
    }
    var Et = {
      button: !0,
      checkbox: !0,
      image: !0,
      hidden: !0,
      radio: !0,
      reset: !0,
      submit: !0
    };
    function er(h, X) {
      Et[X.type] || X.onChange || X.onInput || X.readOnly || X.disabled || X.value == null || s("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."), X.onChange || X.readOnly || X.disabled || X.checked == null || s("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
    }
    function _r(h) {
      var X = h.type, W = h.nodeName;
      return W && W.toLowerCase() === "input" && (X === "checkbox" || X === "radio");
    }
    function Xi(h) {
      return h._valueTracker;
    }
    function Mn(h) {
      h._valueTracker = null;
    }
    function _n(h) {
      var X = "";
      return h && (_r(h) ? X = h.checked ? "true" : "false" : X = h.value), X;
    }
    function Ps(h) {
      var X = _r(h) ? "checked" : "value", W = Object.getOwnPropertyDescriptor(h.constructor.prototype, X);
      Qt(h[X]);
      var V = "" + h[X];
      if (!(h.hasOwnProperty(X) || typeof W > "u" || typeof W.get != "function" || typeof W.set != "function")) {
        var Q = W.get, ie = W.set;
        Object.defineProperty(h, X, {
          configurable: !0,
          get: function() {
            return Q.call(this);
          },
          set: function(He) {
            Qt(He), V = "" + He, ie.call(this, He);
          }
        }), Object.defineProperty(h, X, {
          enumerable: W.enumerable
        });
        var le = {
          getValue: function() {
            return V;
          },
          setValue: function(He) {
            Qt(He), V = "" + He;
          },
          stopTracking: function() {
            Mn(h), delete h[X];
          }
        };
        return le;
      }
    }
    function qi(h) {
      Xi(h) || (h._valueTracker = Ps(h));
    }
    function Gs(h) {
      if (!h)
        return !1;
      var X = Xi(h);
      if (!X)
        return !0;
      var W = X.getValue(), V = _n(h);
      return V !== W ? (X.setValue(V), !0) : !1;
    }
    function ks(h) {
      if (h = h || (typeof document < "u" ? document : void 0), typeof h > "u")
        return null;
      try {
        return h.activeElement || h.body;
      } catch {
        return h.body;
      }
    }
    var Na = !1, Ao = !1, Ro = !1, oA = !1;
    function W1(h) {
      var X = h.type === "checkbox" || h.type === "radio";
      return X ? h.checked != null : h.value != null;
    }
    function je(h, X) {
      var W = h, V = X.checked, Q = di({}, X, {
        defaultChecked: void 0,
        defaultValue: void 0,
        value: void 0,
        checked: V ?? W._wrapperState.initialChecked
      });
      return Q;
    }
    function dt(h, X) {
      er("input", X), X.checked !== void 0 && X.defaultChecked !== void 0 && !Ao && (s("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", e1() || "A component", X.type), Ao = !0), X.value !== void 0 && X.defaultValue !== void 0 && !Na && (s("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", e1() || "A component", X.type), Na = !0);
      var W = h, V = X.defaultValue == null ? "" : X.defaultValue;
      W._wrapperState = {
        initialChecked: X.checked != null ? X.checked : X.defaultChecked,
        initialValue: Pt(X.value != null ? X.value : V),
        controlled: W1(X)
      };
    }
    function kt(h, X) {
      var W = h, V = X.checked;
      V != null && oi(W, "checked", V, !1);
    }
    function _t(h, X) {
      var W = h;
      {
        var V = W1(X);
        !W._wrapperState.controlled && V && !oA && (s("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"), oA = !0), W._wrapperState.controlled && !V && !Ro && (s("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"), Ro = !0);
      }
      kt(h, X);
      var Q = Pt(X.value), ie = X.type;
      if (Q != null)
        ie === "number" ? (Q === 0 && W.value === "" || // We explicitly want to coerce to number here if possible.
        // eslint-disable-next-line
        W.value != Q) && (W.value = Ie(Q)) : W.value !== Ie(Q) && (W.value = Ie(Q));
      else if (ie === "submit" || ie === "reset") {
        W.removeAttribute("value");
        return;
      }
      X.hasOwnProperty("value") ? si(W, X.type, Q) : X.hasOwnProperty("defaultValue") && si(W, X.type, Pt(X.defaultValue)), X.checked == null && X.defaultChecked != null && (W.defaultChecked = !!X.defaultChecked);
    }
    function Cr(h, X, W) {
      var V = h;
      if (X.hasOwnProperty("value") || X.hasOwnProperty("defaultValue")) {
        var Q = X.type, ie = Q === "submit" || Q === "reset";
        if (ie && (X.value === void 0 || X.value === null))
          return;
        var le = Ie(V._wrapperState.initialValue);
        W || le !== V.value && (V.value = le), V.defaultValue = le;
      }
      var He = V.name;
      He !== "" && (V.name = ""), V.defaultChecked = !V.defaultChecked, V.defaultChecked = !!V._wrapperState.initialChecked, He !== "" && (V.name = He);
    }
    function fi(h, X) {
      var W = h;
      _t(W, X), on(W, X);
    }
    function on(h, X) {
      var W = X.name;
      if (X.type === "radio" && W != null) {
        for (var V = h; V.parentNode; )
          V = V.parentNode;
        ut(W, "name");
        for (var Q = V.querySelectorAll("input[name=" + JSON.stringify("" + W) + '][type="radio"]'), ie = 0; ie < Q.length; ie++) {
          var le = Q[ie];
          if (!(le === h || le.form !== h.form)) {
            var He = tT(le);
            if (!He)
              throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
            Gs(le), _t(le, He);
          }
        }
      }
    }
    function si(h, X, W) {
      // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
      (X !== "number" || ks(h.ownerDocument) !== h) && (W == null ? h.defaultValue = Ie(h._wrapperState.initialValue) : h.defaultValue !== Ie(W) && (h.defaultValue = Ie(W)));
    }
    var ss = !1, hs = !1, js = !1;
    function ws(h, X) {
      X.value == null && (typeof X.children == "object" && X.children !== null ? A.Children.forEach(X.children, function(W) {
        W != null && (typeof W == "string" || typeof W == "number" || hs || (hs = !0, s("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.")));
      }) : X.dangerouslySetInnerHTML != null && (js || (js = !0, s("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.")))), X.selected != null && !ss && (s("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."), ss = !0);
    }
    function Zs(h, X) {
      X.value != null && h.setAttribute("value", Ie(Pt(X.value)));
    }
    var Ia = Array.isArray;
    function cs(h) {
      return Ia(h);
    }
    var ud;
    ud = !1;
    function Lv() {
      var h = e1();
      return h ? `

Check the render method of \`` + h + "`." : "";
    }
    var Kv = ["value", "defaultValue"];
    function $l(h) {
      {
        er("select", h);
        for (var X = 0; X < Kv.length; X++) {
          var W = Kv[X];
          if (h[W] != null) {
            var V = cs(h[W]);
            h.multiple && !V ? s("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", W, Lv()) : !h.multiple && V && s("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", W, Lv());
          }
        }
      }
    }
    function V6(h, X, W, V) {
      var Q = h.options;
      if (X) {
        for (var ie = W, le = {}, He = 0; He < ie.length; He++)
          le["$" + ie[He]] = !0;
        for (var xe = 0; xe < Q.length; xe++) {
          var Je = le.hasOwnProperty("$" + Q[xe].value);
          Q[xe].selected !== Je && (Q[xe].selected = Je), Je && V && (Q[xe].defaultSelected = !0);
        }
      } else {
        for (var _e = Ie(Pt(W)), qt = null, Ht = 0; Ht < Q.length; Ht++) {
          if (Q[Ht].value === _e) {
            Q[Ht].selected = !0, V && (Q[Ht].defaultSelected = !0);
            return;
          }
          qt === null && !Q[Ht].disabled && (qt = Q[Ht]);
        }
        qt !== null && (qt.selected = !0);
      }
    }
    function ld(h, X) {
      return di({}, X, {
        value: void 0
      });
    }
    function Jv(h, X) {
      var W = h;
      $l(X), W._wrapperState = {
        wasMultiple: !!X.multiple
      }, X.value !== void 0 && X.defaultValue !== void 0 && !ud && (s("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"), ud = !0);
    }
    function zv(h, X) {
      var W = h;
      W.multiple = !!X.multiple;
      var V = X.value;
      V != null ? V6(W, !!X.multiple, V, !1) : X.defaultValue != null && V6(W, !!X.multiple, X.defaultValue, !0);
    }
    function Wc(h, X) {
      var W = h, V = W._wrapperState.wasMultiple;
      W._wrapperState.wasMultiple = !!X.multiple;
      var Q = X.value;
      Q != null ? V6(W, !!X.multiple, Q, !1) : V !== !!X.multiple && (X.defaultValue != null ? V6(W, !!X.multiple, X.defaultValue, !0) : V6(W, !!X.multiple, X.multiple ? [] : "", !1));
    }
    function Sc(h, X) {
      var W = h, V = X.value;
      V != null && V6(W, !!X.multiple, V, !1);
    }
    var Gv = !1;
    function _d(h, X) {
      var W = h;
      if (X.dangerouslySetInnerHTML != null)
        throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
      var V = di({}, X, {
        value: void 0,
        defaultValue: void 0,
        children: Ie(W._wrapperState.initialValue)
      });
      return V;
    }
    function eP(h, X) {
      var W = h;
      er("textarea", X), X.value !== void 0 && X.defaultValue !== void 0 && !Gv && (s("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", e1() || "A component"), Gv = !0);
      var V = X.value;
      if (V == null) {
        var Q = X.children, ie = X.defaultValue;
        if (Q != null) {
          s("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
          {
            if (ie != null)
              throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
            if (cs(Q)) {
              if (Q.length > 1)
                throw new Error("<textarea> can only have at most one child.");
              Q = Q[0];
            }
            ie = Q;
          }
        }
        ie == null && (ie = ""), V = ie;
      }
      W._wrapperState = {
        initialValue: Pt(V)
      };
    }
    function J0(h, X) {
      var W = h, V = Pt(X.value), Q = Pt(X.defaultValue);
      if (V != null) {
        var ie = Ie(V);
        ie !== W.value && (W.value = ie), X.defaultValue == null && W.defaultValue !== ie && (W.defaultValue = ie);
      }
      Q != null && (W.defaultValue = Ie(Q));
    }
    function Nu(h, X) {
      var W = h, V = W.textContent;
      V === W._wrapperState.initialValue && V !== "" && V !== null && (W.value = V);
    }
    function Uc(h, X) {
      J0(h, X);
    }
    var t1 = "http://www.w3.org/1999/xhtml", Pd = "http://www.w3.org/1998/Math/MathML", Z1 = "http://www.w3.org/2000/svg";
    function fA(h) {
      switch (h) {
        case "svg":
          return Z1;
        case "math":
          return Pd;
        default:
          return t1;
      }
    }
    function tP(h, X) {
      return h == null || h === t1 ? fA(X) : h === Z1 && X === "foreignObject" ? t1 : h;
    }
    var AA = function(h) {
      return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(X, W, V, Q) {
        MSApp.execUnsafeLocalFunction(function() {
          return h(X, W, V, Q);
        });
      } : h;
    }, rP, Qu = AA(function(h, X) {
      if (h.namespaceURI === Z1 && !("innerHTML" in h)) {
        rP = rP || document.createElement("div"), rP.innerHTML = "<svg>" + X.valueOf().toString() + "</svg>";
        for (var W = rP.firstChild; h.firstChild; )
          h.removeChild(h.firstChild);
        for (; W.firstChild; )
          h.appendChild(W.firstChild);
        return;
      }
      h.innerHTML = X;
    }), Kf = 1, cd = 3, Xo = 8, C6 = 9, Zv = 11, nP = function(h, X) {
      if (X) {
        var W = h.firstChild;
        if (W && W === h.lastChild && W.nodeType === cd) {
          W.nodeValue = X;
          return;
        }
      }
      h.textContent = X;
    }, mp = {
      animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
      background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
      backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
      border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
      borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
      borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
      borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
      borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
      borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
      borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
      borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
      borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
      borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
      borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
      borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
      borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
      borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
      columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
      columns: ["columnCount", "columnWidth"],
      flex: ["flexBasis", "flexGrow", "flexShrink"],
      flexFlow: ["flexDirection", "flexWrap"],
      font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
      fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
      gap: ["columnGap", "rowGap"],
      grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
      gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
      gridColumn: ["gridColumnEnd", "gridColumnStart"],
      gridColumnGap: ["columnGap"],
      gridGap: ["columnGap", "rowGap"],
      gridRow: ["gridRowEnd", "gridRowStart"],
      gridRowGap: ["rowGap"],
      gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
      listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
      margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
      marker: ["markerEnd", "markerMid", "markerStart"],
      mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
      maskPosition: ["maskPositionX", "maskPositionY"],
      outline: ["outlineColor", "outlineStyle", "outlineWidth"],
      overflow: ["overflowX", "overflowY"],
      padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
      placeContent: ["alignContent", "justifyContent"],
      placeItems: ["alignItems", "justifyItems"],
      placeSelf: ["alignSelf", "justifySelf"],
      textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
      textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
      transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
      wordWrap: ["overflowWrap"]
    }, $d = {
      animationIterationCount: !0,
      aspectRatio: !0,
      borderImageOutset: !0,
      borderImageSlice: !0,
      borderImageWidth: !0,
      boxFlex: !0,
      boxFlexGroup: !0,
      boxOrdinalGroup: !0,
      columnCount: !0,
      columns: !0,
      flex: !0,
      flexGrow: !0,
      flexPositive: !0,
      flexShrink: !0,
      flexNegative: !0,
      flexOrder: !0,
      gridArea: !0,
      gridRow: !0,
      gridRowEnd: !0,
      gridRowSpan: !0,
      gridRowStart: !0,
      gridColumn: !0,
      gridColumnEnd: !0,
      gridColumnSpan: !0,
      gridColumnStart: !0,
      fontWeight: !0,
      lineClamp: !0,
      lineHeight: !0,
      opacity: !0,
      order: !0,
      orphans: !0,
      tabSize: !0,
      widows: !0,
      zIndex: !0,
      zoom: !0,
      // SVG-related properties
      fillOpacity: !0,
      floodOpacity: !0,
      stopOpacity: !0,
      strokeDasharray: !0,
      strokeDashoffset: !0,
      strokeMiterlimit: !0,
      strokeOpacity: !0,
      strokeWidth: !0
    };
    function z0(h, X) {
      return h + X.charAt(0).toUpperCase() + X.substring(1);
    }
    var Ic = ["Webkit", "ms", "Moz", "O"];
    Object.keys($d).forEach(function(h) {
      Ic.forEach(function(X) {
        $d[z0(X, h)] = $d[h];
      });
    });
    function iP(h, X, W) {
      var V = X == null || typeof X == "boolean" || X === "";
      return V ? "" : !W && typeof X == "number" && X !== 0 && !($d.hasOwnProperty(h) && $d[h]) ? X + "px" : (Tt(X, h), ("" + X).trim());
    }
    var dA = /([A-Z])/g, Rc = /^ms-/;
    function G0(h) {
      return h.replace(dA, "-$1").toLowerCase().replace(Rc, "-ms-");
    }
    var Vc = function() {
    };
    {
      var Z0 = /^(?:webkit|moz|o)[A-Z]/, Cc = /^-ms-/, sP = /-(.)/g, ev = /;\s*$/, tv = {}, Yu = {}, Bp = !1, Wp = !1, aP = function(h) {
        return h.replace(sP, function(X, W) {
          return W.toUpperCase();
        });
      }, Sp = function(h) {
        tv.hasOwnProperty(h) && tv[h] || (tv[h] = !0, s(
          "Unsupported style property %s. Did you mean %s?",
          h,
          // As Andi Smith suggests
          // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
          // is converted to lowercase `ms`.
          aP(h.replace(Cc, "ms-"))
        ));
      }, Up = function(h) {
        tv.hasOwnProperty(h) && tv[h] || (tv[h] = !0, s("Unsupported vendor-prefixed style property %s. Did you mean %s?", h, h.charAt(0).toUpperCase() + h.slice(1)));
      }, Ip = function(h, X) {
        Yu.hasOwnProperty(X) && Yu[X] || (Yu[X] = !0, s(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, h, X.replace(ev, "")));
      }, _0 = function(h, X) {
        Bp || (Bp = !0, s("`NaN` is an invalid value for the `%s` css style property.", h));
      }, gg = function(h, X) {
        Wp || (Wp = !0, s("`Infinity` is an invalid value for the `%s` css style property.", h));
      };
      Vc = function(h, X) {
        h.indexOf("-") > -1 ? Sp(h) : Z0.test(h) ? Up(h) : ev.test(X) && Ip(h, X), typeof X == "number" && (isNaN(X) ? _0(h, X) : isFinite(X) || gg(h, X));
      };
    }
    var $0 = Vc;
    function Rp(h) {
      {
        var X = "", W = "";
        for (var V in h)
          if (h.hasOwnProperty(V)) {
            var Q = h[V];
            if (Q != null) {
              var ie = V.indexOf("--") === 0;
              X += W + (ie ? V : G0(V)) + ":", X += iP(V, Q, ie), W = ";";
            }
          }
        return X || null;
      }
    }
    function rv(h, X) {
      var W = h.style;
      for (var V in X)
        if (X.hasOwnProperty(V)) {
          var Q = V.indexOf("--") === 0;
          Q || $0(V, X[V]);
          var ie = iP(V, X[V], Q);
          V === "float" && (V = "cssFloat"), Q ? W.setProperty(V, ie) : W[V] = ie;
        }
    }
    function Oc(h) {
      return h == null || typeof h == "boolean" || h === "";
    }
    function G9(h) {
      var X = {};
      for (var W in h)
        for (var V = mp[W] || [W], Q = 0; Q < V.length; Q++)
          X[V[Q]] = W;
      return X;
    }
    function yA(h, X) {
      {
        if (!X)
          return;
        var W = G9(h), V = G9(X), Q = {};
        for (var ie in W) {
          var le = W[ie], He = V[ie];
          if (He && le !== He) {
            var xe = le + "," + He;
            if (Q[xe])
              continue;
            Q[xe] = !0, s("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", Oc(h[le]) ? "Removing" : "Updating", le, He);
          }
        }
      }
    }
    var e7 = {
      area: !0,
      base: !0,
      br: !0,
      col: !0,
      embed: !0,
      hr: !0,
      img: !0,
      input: !0,
      keygen: !0,
      link: !0,
      meta: !0,
      param: !0,
      source: !0,
      track: !0,
      wbr: !0
      // NOTE: menuitem's close tag should be omitted, but that causes problems.
    }, Be = di({
      menuitem: !0
    }, e7), Qe = "__html";
    function ze(h, X) {
      if (X) {
        if (Be[h] && (X.children != null || X.dangerouslySetInnerHTML != null))
          throw new Error(h + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
        if (X.dangerouslySetInnerHTML != null) {
          if (X.children != null)
            throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
          if (typeof X.dangerouslySetInnerHTML != "object" || !(Qe in X.dangerouslySetInnerHTML))
            throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
        }
        if (!X.suppressContentEditableWarning && X.contentEditable && X.children != null && s("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."), X.style != null && typeof X.style != "object")
          throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
      }
    }
    function rt(h, X) {
      if (h.indexOf("-") === -1)
        return typeof X.is == "string";
      switch (h) {
        case "annotation-xml":
        case "color-profile":
        case "font-face":
        case "font-face-src":
        case "font-face-uri":
        case "font-face-format":
        case "font-face-name":
        case "missing-glyph":
          return !1;
        default:
          return !0;
      }
    }
    var vt = {
      // HTML
      accept: "accept",
      acceptcharset: "acceptCharset",
      "accept-charset": "acceptCharset",
      accesskey: "accessKey",
      action: "action",
      allowfullscreen: "allowFullScreen",
      alt: "alt",
      as: "as",
      async: "async",
      autocapitalize: "autoCapitalize",
      autocomplete: "autoComplete",
      autocorrect: "autoCorrect",
      autofocus: "autoFocus",
      autoplay: "autoPlay",
      autosave: "autoSave",
      capture: "capture",
      cellpadding: "cellPadding",
      cellspacing: "cellSpacing",
      challenge: "challenge",
      charset: "charSet",
      checked: "checked",
      children: "children",
      cite: "cite",
      class: "className",
      classid: "classID",
      classname: "className",
      cols: "cols",
      colspan: "colSpan",
      content: "content",
      contenteditable: "contentEditable",
      contextmenu: "contextMenu",
      controls: "controls",
      controlslist: "controlsList",
      coords: "coords",
      crossorigin: "crossOrigin",
      dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
      data: "data",
      datetime: "dateTime",
      default: "default",
      defaultchecked: "defaultChecked",
      defaultvalue: "defaultValue",
      defer: "defer",
      dir: "dir",
      disabled: "disabled",
      disablepictureinpicture: "disablePictureInPicture",
      disableremoteplayback: "disableRemotePlayback",
      download: "download",
      draggable: "draggable",
      enctype: "encType",
      enterkeyhint: "enterKeyHint",
      for: "htmlFor",
      form: "form",
      formmethod: "formMethod",
      formaction: "formAction",
      formenctype: "formEncType",
      formnovalidate: "formNoValidate",
      formtarget: "formTarget",
      frameborder: "frameBorder",
      headers: "headers",
      height: "height",
      hidden: "hidden",
      high: "high",
      href: "href",
      hreflang: "hrefLang",
      htmlfor: "htmlFor",
      httpequiv: "httpEquiv",
      "http-equiv": "httpEquiv",
      icon: "icon",
      id: "id",
      imagesizes: "imageSizes",
      imagesrcset: "imageSrcSet",
      innerhtml: "innerHTML",
      inputmode: "inputMode",
      integrity: "integrity",
      is: "is",
      itemid: "itemID",
      itemprop: "itemProp",
      itemref: "itemRef",
      itemscope: "itemScope",
      itemtype: "itemType",
      keyparams: "keyParams",
      keytype: "keyType",
      kind: "kind",
      label: "label",
      lang: "lang",
      list: "list",
      loop: "loop",
      low: "low",
      manifest: "manifest",
      marginwidth: "marginWidth",
      marginheight: "marginHeight",
      max: "max",
      maxlength: "maxLength",
      media: "media",
      mediagroup: "mediaGroup",
      method: "method",
      min: "min",
      minlength: "minLength",
      multiple: "multiple",
      muted: "muted",
      name: "name",
      nomodule: "noModule",
      nonce: "nonce",
      novalidate: "noValidate",
      open: "open",
      optimum: "optimum",
      pattern: "pattern",
      placeholder: "placeholder",
      playsinline: "playsInline",
      poster: "poster",
      preload: "preload",
      profile: "profile",
      radiogroup: "radioGroup",
      readonly: "readOnly",
      referrerpolicy: "referrerPolicy",
      rel: "rel",
      required: "required",
      reversed: "reversed",
      role: "role",
      rows: "rows",
      rowspan: "rowSpan",
      sandbox: "sandbox",
      scope: "scope",
      scoped: "scoped",
      scrolling: "scrolling",
      seamless: "seamless",
      selected: "selected",
      shape: "shape",
      size: "size",
      sizes: "sizes",
      span: "span",
      spellcheck: "spellCheck",
      src: "src",
      srcdoc: "srcDoc",
      srclang: "srcLang",
      srcset: "srcSet",
      start: "start",
      step: "step",
      style: "style",
      summary: "summary",
      tabindex: "tabIndex",
      target: "target",
      title: "title",
      type: "type",
      usemap: "useMap",
      value: "value",
      width: "width",
      wmode: "wmode",
      wrap: "wrap",
      // SVG
      about: "about",
      accentheight: "accentHeight",
      "accent-height": "accentHeight",
      accumulate: "accumulate",
      additive: "additive",
      alignmentbaseline: "alignmentBaseline",
      "alignment-baseline": "alignmentBaseline",
      allowreorder: "allowReorder",
      alphabetic: "alphabetic",
      amplitude: "amplitude",
      arabicform: "arabicForm",
      "arabic-form": "arabicForm",
      ascent: "ascent",
      attributename: "attributeName",
      attributetype: "attributeType",
      autoreverse: "autoReverse",
      azimuth: "azimuth",
      basefrequency: "baseFrequency",
      baselineshift: "baselineShift",
      "baseline-shift": "baselineShift",
      baseprofile: "baseProfile",
      bbox: "bbox",
      begin: "begin",
      bias: "bias",
      by: "by",
      calcmode: "calcMode",
      capheight: "capHeight",
      "cap-height": "capHeight",
      clip: "clip",
      clippath: "clipPath",
      "clip-path": "clipPath",
      clippathunits: "clipPathUnits",
      cliprule: "clipRule",
      "clip-rule": "clipRule",
      color: "color",
      colorinterpolation: "colorInterpolation",
      "color-interpolation": "colorInterpolation",
      colorinterpolationfilters: "colorInterpolationFilters",
      "color-interpolation-filters": "colorInterpolationFilters",
      colorprofile: "colorProfile",
      "color-profile": "colorProfile",
      colorrendering: "colorRendering",
      "color-rendering": "colorRendering",
      contentscripttype: "contentScriptType",
      contentstyletype: "contentStyleType",
      cursor: "cursor",
      cx: "cx",
      cy: "cy",
      d: "d",
      datatype: "datatype",
      decelerate: "decelerate",
      descent: "descent",
      diffuseconstant: "diffuseConstant",
      direction: "direction",
      display: "display",
      divisor: "divisor",
      dominantbaseline: "dominantBaseline",
      "dominant-baseline": "dominantBaseline",
      dur: "dur",
      dx: "dx",
      dy: "dy",
      edgemode: "edgeMode",
      elevation: "elevation",
      enablebackground: "enableBackground",
      "enable-background": "enableBackground",
      end: "end",
      exponent: "exponent",
      externalresourcesrequired: "externalResourcesRequired",
      fill: "fill",
      fillopacity: "fillOpacity",
      "fill-opacity": "fillOpacity",
      fillrule: "fillRule",
      "fill-rule": "fillRule",
      filter: "filter",
      filterres: "filterRes",
      filterunits: "filterUnits",
      floodopacity: "floodOpacity",
      "flood-opacity": "floodOpacity",
      floodcolor: "floodColor",
      "flood-color": "floodColor",
      focusable: "focusable",
      fontfamily: "fontFamily",
      "font-family": "fontFamily",
      fontsize: "fontSize",
      "font-size": "fontSize",
      fontsizeadjust: "fontSizeAdjust",
      "font-size-adjust": "fontSizeAdjust",
      fontstretch: "fontStretch",
      "font-stretch": "fontStretch",
      fontstyle: "fontStyle",
      "font-style": "fontStyle",
      fontvariant: "fontVariant",
      "font-variant": "fontVariant",
      fontweight: "fontWeight",
      "font-weight": "fontWeight",
      format: "format",
      from: "from",
      fx: "fx",
      fy: "fy",
      g1: "g1",
      g2: "g2",
      glyphname: "glyphName",
      "glyph-name": "glyphName",
      glyphorientationhorizontal: "glyphOrientationHorizontal",
      "glyph-orientation-horizontal": "glyphOrientationHorizontal",
      glyphorientationvertical: "glyphOrientationVertical",
      "glyph-orientation-vertical": "glyphOrientationVertical",
      glyphref: "glyphRef",
      gradienttransform: "gradientTransform",
      gradientunits: "gradientUnits",
      hanging: "hanging",
      horizadvx: "horizAdvX",
      "horiz-adv-x": "horizAdvX",
      horizoriginx: "horizOriginX",
      "horiz-origin-x": "horizOriginX",
      ideographic: "ideographic",
      imagerendering: "imageRendering",
      "image-rendering": "imageRendering",
      in2: "in2",
      in: "in",
      inlist: "inlist",
      intercept: "intercept",
      k1: "k1",
      k2: "k2",
      k3: "k3",
      k4: "k4",
      k: "k",
      kernelmatrix: "kernelMatrix",
      kernelunitlength: "kernelUnitLength",
      kerning: "kerning",
      keypoints: "keyPoints",
      keysplines: "keySplines",
      keytimes: "keyTimes",
      lengthadjust: "lengthAdjust",
      letterspacing: "letterSpacing",
      "letter-spacing": "letterSpacing",
      lightingcolor: "lightingColor",
      "lighting-color": "lightingColor",
      limitingconeangle: "limitingConeAngle",
      local: "local",
      markerend: "markerEnd",
      "marker-end": "markerEnd",
      markerheight: "markerHeight",
      markermid: "markerMid",
      "marker-mid": "markerMid",
      markerstart: "markerStart",
      "marker-start": "markerStart",
      markerunits: "markerUnits",
      markerwidth: "markerWidth",
      mask: "mask",
      maskcontentunits: "maskContentUnits",
      maskunits: "maskUnits",
      mathematical: "mathematical",
      mode: "mode",
      numoctaves: "numOctaves",
      offset: "offset",
      opacity: "opacity",
      operator: "operator",
      order: "order",
      orient: "orient",
      orientation: "orientation",
      origin: "origin",
      overflow: "overflow",
      overlineposition: "overlinePosition",
      "overline-position": "overlinePosition",
      overlinethickness: "overlineThickness",
      "overline-thickness": "overlineThickness",
      paintorder: "paintOrder",
      "paint-order": "paintOrder",
      panose1: "panose1",
      "panose-1": "panose1",
      pathlength: "pathLength",
      patterncontentunits: "patternContentUnits",
      patterntransform: "patternTransform",
      patternunits: "patternUnits",
      pointerevents: "pointerEvents",
      "pointer-events": "pointerEvents",
      points: "points",
      pointsatx: "pointsAtX",
      pointsaty: "pointsAtY",
      pointsatz: "pointsAtZ",
      prefix: "prefix",
      preservealpha: "preserveAlpha",
      preserveaspectratio: "preserveAspectRatio",
      primitiveunits: "primitiveUnits",
      property: "property",
      r: "r",
      radius: "radius",
      refx: "refX",
      refy: "refY",
      renderingintent: "renderingIntent",
      "rendering-intent": "renderingIntent",
      repeatcount: "repeatCount",
      repeatdur: "repeatDur",
      requiredextensions: "requiredExtensions",
      requiredfeatures: "requiredFeatures",
      resource: "resource",
      restart: "restart",
      result: "result",
      results: "results",
      rotate: "rotate",
      rx: "rx",
      ry: "ry",
      scale: "scale",
      security: "security",
      seed: "seed",
      shaperendering: "shapeRendering",
      "shape-rendering": "shapeRendering",
      slope: "slope",
      spacing: "spacing",
      specularconstant: "specularConstant",
      specularexponent: "specularExponent",
      speed: "speed",
      spreadmethod: "spreadMethod",
      startoffset: "startOffset",
      stddeviation: "stdDeviation",
      stemh: "stemh",
      stemv: "stemv",
      stitchtiles: "stitchTiles",
      stopcolor: "stopColor",
      "stop-color": "stopColor",
      stopopacity: "stopOpacity",
      "stop-opacity": "stopOpacity",
      strikethroughposition: "strikethroughPosition",
      "strikethrough-position": "strikethroughPosition",
      strikethroughthickness: "strikethroughThickness",
      "strikethrough-thickness": "strikethroughThickness",
      string: "string",
      stroke: "stroke",
      strokedasharray: "strokeDasharray",
      "stroke-dasharray": "strokeDasharray",
      strokedashoffset: "strokeDashoffset",
      "stroke-dashoffset": "strokeDashoffset",
      strokelinecap: "strokeLinecap",
      "stroke-linecap": "strokeLinecap",
      strokelinejoin: "strokeLinejoin",
      "stroke-linejoin": "strokeLinejoin",
      strokemiterlimit: "strokeMiterlimit",
      "stroke-miterlimit": "strokeMiterlimit",
      strokewidth: "strokeWidth",
      "stroke-width": "strokeWidth",
      strokeopacity: "strokeOpacity",
      "stroke-opacity": "strokeOpacity",
      suppresscontenteditablewarning: "suppressContentEditableWarning",
      suppresshydrationwarning: "suppressHydrationWarning",
      surfacescale: "surfaceScale",
      systemlanguage: "systemLanguage",
      tablevalues: "tableValues",
      targetx: "targetX",
      targety: "targetY",
      textanchor: "textAnchor",
      "text-anchor": "textAnchor",
      textdecoration: "textDecoration",
      "text-decoration": "textDecoration",
      textlength: "textLength",
      textrendering: "textRendering",
      "text-rendering": "textRendering",
      to: "to",
      transform: "transform",
      typeof: "typeof",
      u1: "u1",
      u2: "u2",
      underlineposition: "underlinePosition",
      "underline-position": "underlinePosition",
      underlinethickness: "underlineThickness",
      "underline-thickness": "underlineThickness",
      unicode: "unicode",
      unicodebidi: "unicodeBidi",
      "unicode-bidi": "unicodeBidi",
      unicoderange: "unicodeRange",
      "unicode-range": "unicodeRange",
      unitsperem: "unitsPerEm",
      "units-per-em": "unitsPerEm",
      unselectable: "unselectable",
      valphabetic: "vAlphabetic",
      "v-alphabetic": "vAlphabetic",
      values: "values",
      vectoreffect: "vectorEffect",
      "vector-effect": "vectorEffect",
      version: "version",
      vertadvy: "vertAdvY",
      "vert-adv-y": "vertAdvY",
      vertoriginx: "vertOriginX",
      "vert-origin-x": "vertOriginX",
      vertoriginy: "vertOriginY",
      "vert-origin-y": "vertOriginY",
      vhanging: "vHanging",
      "v-hanging": "vHanging",
      videographic: "vIdeographic",
      "v-ideographic": "vIdeographic",
      viewbox: "viewBox",
      viewtarget: "viewTarget",
      visibility: "visibility",
      vmathematical: "vMathematical",
      "v-mathematical": "vMathematical",
      vocab: "vocab",
      widths: "widths",
      wordspacing: "wordSpacing",
      "word-spacing": "wordSpacing",
      writingmode: "writingMode",
      "writing-mode": "writingMode",
      x1: "x1",
      x2: "x2",
      x: "x",
      xchannelselector: "xChannelSelector",
      xheight: "xHeight",
      "x-height": "xHeight",
      xlinkactuate: "xlinkActuate",
      "xlink:actuate": "xlinkActuate",
      xlinkarcrole: "xlinkArcrole",
      "xlink:arcrole": "xlinkArcrole",
      xlinkhref: "xlinkHref",
      "xlink:href": "xlinkHref",
      xlinkrole: "xlinkRole",
      "xlink:role": "xlinkRole",
      xlinkshow: "xlinkShow",
      "xlink:show": "xlinkShow",
      xlinktitle: "xlinkTitle",
      "xlink:title": "xlinkTitle",
      xlinktype: "xlinkType",
      "xlink:type": "xlinkType",
      xmlbase: "xmlBase",
      "xml:base": "xmlBase",
      xmllang: "xmlLang",
      "xml:lang": "xmlLang",
      xmlns: "xmlns",
      "xml:space": "xmlSpace",
      xmlnsxlink: "xmlnsXlink",
      "xmlns:xlink": "xmlnsXlink",
      xmlspace: "xmlSpace",
      y1: "y1",
      y2: "y2",
      y: "y",
      ychannelselector: "yChannelSelector",
      z: "z",
      zoomandpan: "zoomAndPan"
    }, yt = {
      "aria-current": 0,
      // state
      "aria-description": 0,
      "aria-details": 0,
      "aria-disabled": 0,
      // state
      "aria-hidden": 0,
      // state
      "aria-invalid": 0,
      // state
      "aria-keyshortcuts": 0,
      "aria-label": 0,
      "aria-roledescription": 0,
      // Widget Attributes
      "aria-autocomplete": 0,
      "aria-checked": 0,
      "aria-expanded": 0,
      "aria-haspopup": 0,
      "aria-level": 0,
      "aria-modal": 0,
      "aria-multiline": 0,
      "aria-multiselectable": 0,
      "aria-orientation": 0,
      "aria-placeholder": 0,
      "aria-pressed": 0,
      "aria-readonly": 0,
      "aria-required": 0,
      "aria-selected": 0,
      "aria-sort": 0,
      "aria-valuemax": 0,
      "aria-valuemin": 0,
      "aria-valuenow": 0,
      "aria-valuetext": 0,
      // Live Region Attributes
      "aria-atomic": 0,
      "aria-busy": 0,
      "aria-live": 0,
      "aria-relevant": 0,
      // Drag-and-Drop Attributes
      "aria-dropeffect": 0,
      "aria-grabbed": 0,
      // Relationship Attributes
      "aria-activedescendant": 0,
      "aria-colcount": 0,
      "aria-colindex": 0,
      "aria-colspan": 0,
      "aria-controls": 0,
      "aria-describedby": 0,
      "aria-errormessage": 0,
      "aria-flowto": 0,
      "aria-labelledby": 0,
      "aria-owns": 0,
      "aria-posinset": 0,
      "aria-rowcount": 0,
      "aria-rowindex": 0,
      "aria-rowspan": 0,
      "aria-setsize": 0
    }, Bt = {}, ar = new RegExp("^(aria)-[" + xr + "]*$"), Pr = new RegExp("^(aria)[A-Z][" + xr + "]*$");
    function Sn(h, X) {
      {
        if (be.call(Bt, X) && Bt[X])
          return !0;
        if (Pr.test(X)) {
          var W = "aria-" + X.slice(4).toLowerCase(), V = yt.hasOwnProperty(W) ? W : null;
          if (V == null)
            return s("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", X), Bt[X] = !0, !0;
          if (X !== V)
            return s("Invalid ARIA attribute `%s`. Did you mean `%s`?", X, V), Bt[X] = !0, !0;
        }
        if (ar.test(X)) {
          var Q = X.toLowerCase(), ie = yt.hasOwnProperty(Q) ? Q : null;
          if (ie == null)
            return Bt[X] = !0, !1;
          if (X !== ie)
            return s("Unknown ARIA attribute `%s`. Did you mean `%s`?", X, ie), Bt[X] = !0, !0;
        }
      }
      return !0;
    }
    function cn(h, X) {
      {
        var W = [];
        for (var V in X) {
          var Q = Sn(h, V);
          Q || W.push(V);
        }
        var ie = W.map(function(le) {
          return "`" + le + "`";
        }).join(", ");
        W.length === 1 ? s("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", ie, h) : W.length > 1 && s("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", ie, h);
      }
    }
    function Gn(h, X) {
      rt(h, X) || cn(h, X);
    }
    var es = !1;
    function Ys(h, X) {
      {
        if (h !== "input" && h !== "textarea" && h !== "select")
          return;
        X != null && X.value === null && !es && (es = !0, h === "select" && X.multiple ? s("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", h) : s("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", h));
      }
    }
    var S1 = function() {
    };
    {
      var ia = {}, x9 = /^on./, Jf = /^on[^A-Z]/, Vo = new RegExp("^(aria)-[" + xr + "]*$"), U1 = new RegExp("^(aria)[A-Z][" + xr + "]*$");
      S1 = function(h, X, W, V) {
        if (be.call(ia, X) && ia[X])
          return !0;
        var Q = X.toLowerCase();
        if (Q === "onfocusin" || Q === "onfocusout")
          return s("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."), ia[X] = !0, !0;
        if (V != null) {
          var ie = V.registrationNameDependencies, le = V.possibleRegistrationNames;
          if (ie.hasOwnProperty(X))
            return !0;
          var He = le.hasOwnProperty(Q) ? le[Q] : null;
          if (He != null)
            return s("Invalid event handler property `%s`. Did you mean `%s`?", X, He), ia[X] = !0, !0;
          if (x9.test(X))
            return s("Unknown event handler property `%s`. It will be ignored.", X), ia[X] = !0, !0;
        } else if (x9.test(X))
          return Jf.test(X) && s("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", X), ia[X] = !0, !0;
        if (Vo.test(X) || U1.test(X))
          return !0;
        if (Q === "innerhtml")
          return s("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."), ia[X] = !0, !0;
        if (Q === "aria")
          return s("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."), ia[X] = !0, !0;
        if (Q === "is" && W !== null && W !== void 0 && typeof W != "string")
          return s("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof W), ia[X] = !0, !0;
        if (typeof W == "number" && isNaN(W))
          return s("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", X), ia[X] = !0, !0;
        var xe = Sr(X), Je = xe !== null && xe.type === tr;
        if (vt.hasOwnProperty(Q)) {
          var _e = vt[Q];
          if (_e !== X)
            return s("Invalid DOM property `%s`. Did you mean `%s`?", X, _e), ia[X] = !0, !0;
        } else if (!Je && X !== Q)
          return s("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", X, Q), ia[X] = !0, !0;
        return typeof W == "boolean" && Wn(X, W, xe, !1) ? (W ? s('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', W, X, X, W, X) : s('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', W, X, X, W, X, X, X), ia[X] = !0, !0) : Je ? !0 : Wn(X, W, xe, !1) ? (ia[X] = !0, !1) : ((W === "false" || W === "true") && xe !== null && xe.type === qr && (s("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", W, X, W === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', X, W), ia[X] = !0), !0);
      };
    }
    var vA = function(h, X, W) {
      {
        var V = [];
        for (var Q in X) {
          var ie = S1(h, Q, X[Q], W);
          ie || V.push(Q);
        }
        var le = V.map(function(He) {
          return "`" + He + "`";
        }).join(", ");
        V.length === 1 ? s("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", le, h) : V.length > 1 && s("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", le, h);
      }
    };
    function Wf(h, X, W) {
      rt(h, X) || vA(h, X, W);
    }
    var _1 = 1, $1 = 2, D9 = 4, kA = _1 | $1 | D9, oP = null;
    function yc(h) {
      oP !== null && s("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."), oP = h;
    }
    function Bq() {
      oP === null && s("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."), oP = null;
    }
    function Xg(h) {
      return h === oP;
    }
    function kc(h) {
      var X = h.target || h.srcElement || window;
      return X.correspondingUseElement && (X = X.correspondingUseElement), X.nodeType === cd ? X.parentNode : X;
    }
    var Pa = null, nv = null, iv = null;
    function O6(h) {
      var X = IP(h);
      if (X) {
        if (typeof Pa != "function")
          throw new Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
        var W = X.stateNode;
        if (W) {
          var V = tT(W);
          Pa(X.stateNode, X.type, V);
        }
      }
    }
    function t7(h) {
      Pa = h;
    }
    function Ec(h) {
      nv ? iv ? iv.push(h) : iv = [h] : nv = h;
    }
    function Vp() {
      return nv !== null || iv !== null;
    }
    function Fc() {
      if (nv) {
        var h = nv, X = iv;
        if (nv = null, iv = null, O6(h), X)
          for (var W = 0; W < X.length; W++)
            O6(X[W]);
      }
    }
    var fP = function(h, X) {
      return h(X);
    }, r7 = function() {
    }, Tg = !1;
    function Wq() {
      var h = Vp();
      h && (r7(), Fc());
    }
    function qg(h, X, W) {
      if (Tg)
        return h(X, W);
      Tg = !0;
      try {
        return fP(h, X, W);
      } finally {
        Tg = !1, Wq();
      }
    }
    function Mu(h, X, W) {
      fP = h, r7 = W;
    }
    function Nc(h) {
      return h === "button" || h === "input" || h === "select" || h === "textarea";
    }
    function Lu(h, X, W) {
      switch (h) {
        case "onClick":
        case "onClickCapture":
        case "onDoubleClick":
        case "onDoubleClickCapture":
        case "onMouseDown":
        case "onMouseDownCapture":
        case "onMouseMove":
        case "onMouseMoveCapture":
        case "onMouseUp":
        case "onMouseUpCapture":
        case "onMouseEnter":
          return !!(W.disabled && Nc(X));
        default:
          return !1;
      }
    }
    function Ku(h, X) {
      var W = h.stateNode;
      if (W === null)
        return null;
      var V = tT(W);
      if (V === null)
        return null;
      var Q = V[X];
      if (Lu(X, h.type, V))
        return null;
      if (Q && typeof Q != "function")
        throw new Error("Expected `" + X + "` listener to be a function, instead got a value of `" + typeof Q + "` type.");
      return Q;
    }
    var Qc = !1;
    if (ke)
      try {
        var sv = {};
        Object.defineProperty(sv, "passive", {
          get: function() {
            Qc = !0;
          }
        }), window.addEventListener("test", sv, sv), window.removeEventListener("test", sv, sv);
      } catch {
        Qc = !1;
      }
    function p4(h, X, W, V, Q, ie, le, He, xe) {
      var Je = Array.prototype.slice.call(arguments, 3);
      try {
        X.apply(W, Je);
      } catch (_e) {
        this.onError(_e);
      }
    }
    var Ju = p4;
    if (typeof window < "u" && typeof window.dispatchEvent == "function" && typeof document < "u" && typeof document.createEvent == "function") {
      var AP = document.createElement("react");
      Ju = function(X, W, V, Q, ie, le, He, xe, Je) {
        if (typeof document > "u" || document === null)
          throw new Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
        var _e = document.createEvent("Event"), qt = !1, Ht = !0, Mt = window.event, Lt = Object.getOwnPropertyDescriptor(window, "event");
        function or() {
          AP.removeEventListener(fr, hi, !1), typeof window.event < "u" && window.hasOwnProperty("event") && (window.event = Mt);
        }
        var yn = Array.prototype.slice.call(arguments, 3);
        function hi() {
          qt = !0, or(), W.apply(V, yn), Ht = !1;
        }
        var Pi, Ks = !1, Is = !1;
        function Vt(Ct) {
          if (Pi = Ct.error, Ks = !0, Pi === null && Ct.colno === 0 && Ct.lineno === 0 && (Is = !0), Ct.defaultPrevented && Pi != null && typeof Pi == "object")
            try {
              Pi._suppressLogging = !0;
            } catch {
            }
        }
        var fr = "react-" + (X || "invokeguardedcallback");
        if (window.addEventListener("error", Vt), AP.addEventListener(fr, hi, !1), _e.initEvent(fr, !1, !1), AP.dispatchEvent(_e), Lt && Object.defineProperty(window, "event", Lt), qt && Ht && (Ks ? Is && (Pi = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")) : Pi = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`), this.onError(Pi)), window.removeEventListener("error", Vt), !qt)
          return or(), p4.apply(this, arguments);
      };
    }
    var n7 = Ju, av = !1, pd = null, Z9 = !1, zu = null, EA = {
      onError: function(h) {
        av = !0, pd = h;
      }
    };
    function _9(h, X, W, V, Q, ie, le, He, xe) {
      av = !1, pd = null, n7.apply(EA, arguments);
    }
    function Sf(h, X, W, V, Q, ie, le, He, xe) {
      if (_9.apply(this, arguments), av) {
        var Je = bg();
        Z9 || (Z9 = !0, zu = Je);
      }
    }
    function Gu() {
      if (Z9) {
        var h = zu;
        throw Z9 = !1, zu = null, h;
      }
    }
    function Sq() {
      return av;
    }
    function bg() {
      if (av) {
        var h = pd;
        return av = !1, pd = null, h;
      } else
        throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
    }
    function Es(h) {
      return h._reactInternals;
    }
    function FA(h) {
      return h._reactInternals !== void 0;
    }
    function Qa(h, X) {
      h._reactInternals = X;
    }
    var fn = (
      /*                      */
      0
    ), Zu = (
      /*                */
      1
    ), Ms = (
      /*                    */
      2
    ), Ni = (
      /*                       */
      4
    ), _s = (
      /*                */
      16
    ), bi = (
      /*                 */
      32
    ), uA = (
      /*                     */
      64
    ), xi = (
      /*                   */
      128
    ), Ya = (
      /*            */
      256
    ), Uf = (
      /*                          */
      512
    ), I1 = (
      /*                     */
      1024
    ), vo = (
      /*                      */
      2048
    ), NA = (
      /*                    */
      4096
    ), _u = (
      /*                   */
      8192
    ), ov = (
      /*             */
      16384
    ), QA = vo | Ni | uA | Uf | I1 | ov, dP = (
      /*               */
      32767
    ), lA = (
      /*                   */
      32768
    ), To = (
      /*                */
      65536
    ), Yc = (
      /* */
      131072
    ), i7 = (
      /*                       */
      1048576
    ), xg = (
      /*                    */
      2097152
    ), $9 = (
      /*                 */
      4194304
    ), _v = (
      /*                */
      8388608
    ), e6 = (
      /*               */
      16777216
    ), $u = (
      /*              */
      33554432
    ), Mc = (
      // TODO: Remove Update flag from before mutation phase by re-landing Visibility
      // flag logic (see #20043)
      Ni | I1 | 0
    ), t6 = Ms | Ni | _s | bi | Uf | NA | _u, zf = Ni | uA | Uf | _u, PA = vo | _s, ef = $9 | _v | xg, $v = t.ReactCurrentOwner;
    function r6(h) {
      var X = h, W = h;
      if (h.alternate)
        for (; X.return; )
          X = X.return;
      else {
        var V = X;
        do
          X = V, (X.flags & (Ms | NA)) !== fn && (W = X.return), V = X.return;
        while (V);
      }
      return X.tag === v ? W : null;
    }
    function Dg(h) {
      if (h.tag === j) {
        var X = h.memoizedState;
        if (X === null) {
          var W = h.alternate;
          W !== null && (X = W.memoizedState);
        }
        if (X !== null)
          return X.dehydrated;
      }
      return null;
    }
    function Cp(h) {
      return h.tag === v ? h.stateNode.containerInfo : null;
    }
    function jg(h) {
      return r6(h) === h;
    }
    function n6(h) {
      {
        var X = $v.current;
        if (X !== null && X.tag === o) {
          var W = X, V = W.stateNode;
          V._warnedAboutRefsInRender || s("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", Fn(W) || "A component"), V._warnedAboutRefsInRender = !0;
        }
      }
      var Q = Es(h);
      return Q ? r6(Q) === Q : !1;
    }
    function r1(h) {
      if (r6(h) !== h)
        throw new Error("Unable to find node on an unmounted component.");
    }
    function Us(h) {
      var X = h.alternate;
      if (!X) {
        var W = r6(h);
        if (W === null)
          throw new Error("Unable to find node on an unmounted component.");
        return W !== h ? null : h;
      }
      for (var V = h, Q = X; ; ) {
        var ie = V.return;
        if (ie === null)
          break;
        var le = ie.alternate;
        if (le === null) {
          var He = ie.return;
          if (He !== null) {
            V = Q = He;
            continue;
          }
          break;
        }
        if (ie.child === le.child) {
          for (var xe = ie.child; xe; ) {
            if (xe === V)
              return r1(ie), h;
            if (xe === Q)
              return r1(ie), X;
            xe = xe.sibling;
          }
          throw new Error("Unable to find node on an unmounted component.");
        }
        if (V.return !== Q.return)
          V = ie, Q = le;
        else {
          for (var Je = !1, _e = ie.child; _e; ) {
            if (_e === V) {
              Je = !0, V = ie, Q = le;
              break;
            }
            if (_e === Q) {
              Je = !0, Q = ie, V = le;
              break;
            }
            _e = _e.sibling;
          }
          if (!Je) {
            for (_e = le.child; _e; ) {
              if (_e === V) {
                Je = !0, V = le, Q = ie;
                break;
              }
              if (_e === Q) {
                Je = !0, Q = le, V = ie;
                break;
              }
              _e = _e.sibling;
            }
            if (!Je)
              throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
          }
        }
        if (V.alternate !== Q)
          throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
      }
      if (V.tag !== v)
        throw new Error("Unable to find node on an unmounted component.");
      return V.stateNode.current === V ? h : X;
    }
    function tf(h) {
      var X = Us(h);
      return X !== null ? fv(X) : null;
    }
    function fv(h) {
      if (h.tag === l || h.tag === P)
        return h;
      for (var X = h.child; X !== null; ) {
        var W = fv(X);
        if (W !== null)
          return W;
        X = X.sibling;
      }
      return null;
    }
    function Lc(h) {
      var X = Us(h);
      return X !== null ? el(X) : null;
    }
    function el(h) {
      if (h.tag === l || h.tag === P)
        return h;
      for (var X = h.child; X !== null; ) {
        if (X.tag !== u) {
          var W = el(X);
          if (W !== null)
            return W;
        }
        X = X.sibling;
      }
      return null;
    }
    var eu = e.unstable_scheduleCallback, h4 = e.unstable_cancelCallback, s7 = e.unstable_shouldYield, wg = e.unstable_requestPaint, qo = e.unstable_now, a7 = e.unstable_getCurrentPriorityLevel, Op = e.unstable_ImmediatePriority, Gf = e.unstable_UserBlockingPriority, Av = e.unstable_NormalPriority, o7 = e.unstable_LowPriority, hd = e.unstable_IdlePriority, f7 = e.unstable_yieldValue, mg = e.unstable_setDisableYieldValue, YA = null, n1 = null, dn = null, i1 = !1, rf = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u";
    function Kc(h) {
      if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u")
        return !1;
      var X = __REACT_DEVTOOLS_GLOBAL_HOOK__;
      if (X.isDisabled)
        return !0;
      if (!X.supportsFiber)
        return s("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"), !0;
      try {
        ge && (h = di({}, h, {
          getLaneLabelMap: ru,
          injectProfilingHooks: dv
        })), YA = X.inject(h), n1 = X;
      } catch (W) {
        s("React instrumentation encountered an error: %s.", W);
      }
      return !!X.checkDCE;
    }
    function vP(h, X) {
      if (n1 && typeof n1.onScheduleFiberRoot == "function")
        try {
          n1.onScheduleFiberRoot(YA, h, X);
        } catch (W) {
          i1 || (i1 = !0, s("React instrumentation encountered an error: %s", W));
        }
    }
    function MA(h, X) {
      if (n1 && typeof n1.onCommitFiberRoot == "function")
        try {
          var W = (h.current.flags & xi) === xi;
          if (me) {
            var V;
            switch (X) {
              case H1:
                V = Op;
                break;
              case _f:
                V = Gf;
                break;
              case Au:
                V = Av;
                break;
              case XP:
                V = hd;
                break;
              default:
                V = Av;
                break;
            }
            n1.onCommitFiberRoot(YA, h, V, W);
          }
        } catch (Q) {
          i1 || (i1 = !0, s("React instrumentation encountered an error: %s", Q));
        }
    }
    function tu(h) {
      if (n1 && typeof n1.onPostCommitFiberRoot == "function")
        try {
          n1.onPostCommitFiberRoot(YA, h);
        } catch (X) {
          i1 || (i1 = !0, s("React instrumentation encountered an error: %s", X));
        }
    }
    function uP(h) {
      if (n1 && typeof n1.onCommitFiberUnmount == "function")
        try {
          n1.onCommitFiberUnmount(YA, h);
        } catch (X) {
          i1 || (i1 = !0, s("React instrumentation encountered an error: %s", X));
        }
    }
    function R1(h) {
      if (typeof f7 == "function" && (mg(h), n(h)), n1 && typeof n1.setStrictMode == "function")
        try {
          n1.setStrictMode(YA, h);
        } catch (X) {
          i1 || (i1 = !0, s("React instrumentation encountered an error: %s", X));
        }
    }
    function dv(h) {
      dn = h;
    }
    function ru() {
      {
        for (var h = /* @__PURE__ */ new Map(), X = 1, W = 0; W < sa; W++) {
          var V = Uq(X);
          h.set(X, V), X *= 2;
        }
        return h;
      }
    }
    function yp(h) {
      dn !== null && typeof dn.markCommitStarted == "function" && dn.markCommitStarted(h);
    }
    function A7() {
      dn !== null && typeof dn.markCommitStopped == "function" && dn.markCommitStopped();
    }
    function vv(h) {
      dn !== null && typeof dn.markComponentRenderStarted == "function" && dn.markComponentRenderStarted(h);
    }
    function lP() {
      dn !== null && typeof dn.markComponentRenderStopped == "function" && dn.markComponentRenderStopped();
    }
    function H4(h) {
      dn !== null && typeof dn.markComponentPassiveEffectMountStarted == "function" && dn.markComponentPassiveEffectMountStarted(h);
    }
    function Bg() {
      dn !== null && typeof dn.markComponentPassiveEffectMountStopped == "function" && dn.markComponentPassiveEffectMountStopped();
    }
    function d7(h) {
      dn !== null && typeof dn.markComponentPassiveEffectUnmountStarted == "function" && dn.markComponentPassiveEffectUnmountStarted(h);
    }
    function v7() {
      dn !== null && typeof dn.markComponentPassiveEffectUnmountStopped == "function" && dn.markComponentPassiveEffectUnmountStopped();
    }
    function Wg(h) {
      dn !== null && typeof dn.markComponentLayoutEffectMountStarted == "function" && dn.markComponentLayoutEffectMountStarted(h);
    }
    function g4() {
      dn !== null && typeof dn.markComponentLayoutEffectMountStopped == "function" && dn.markComponentLayoutEffectMountStopped();
    }
    function kp(h) {
      dn !== null && typeof dn.markComponentLayoutEffectUnmountStarted == "function" && dn.markComponentLayoutEffectUnmountStarted(h);
    }
    function Jc() {
      dn !== null && typeof dn.markComponentLayoutEffectUnmountStopped == "function" && dn.markComponentLayoutEffectUnmountStopped();
    }
    function Ep(h, X, W) {
      dn !== null && typeof dn.markComponentErrored == "function" && dn.markComponentErrored(h, X, W);
    }
    function Sg(h, X, W) {
      dn !== null && typeof dn.markComponentSuspended == "function" && dn.markComponentSuspended(h, X, W);
    }
    function Ug(h) {
      dn !== null && typeof dn.markLayoutEffectsStarted == "function" && dn.markLayoutEffectsStarted(h);
    }
    function zc() {
      dn !== null && typeof dn.markLayoutEffectsStopped == "function" && dn.markLayoutEffectsStopped();
    }
    function Gc(h) {
      dn !== null && typeof dn.markPassiveEffectsStarted == "function" && dn.markPassiveEffectsStarted(h);
    }
    function Fp() {
      dn !== null && typeof dn.markPassiveEffectsStopped == "function" && dn.markPassiveEffectsStopped();
    }
    function j9(h) {
      dn !== null && typeof dn.markRenderStarted == "function" && dn.markRenderStarted(h);
    }
    function tl() {
      dn !== null && typeof dn.markRenderYielded == "function" && dn.markRenderYielded();
    }
    function rl() {
      dn !== null && typeof dn.markRenderStopped == "function" && dn.markRenderStopped();
    }
    function uv(h) {
      dn !== null && typeof dn.markRenderScheduled == "function" && dn.markRenderScheduled(h);
    }
    function u7(h, X) {
      dn !== null && typeof dn.markForceUpdateScheduled == "function" && dn.markForceUpdateScheduled(h, X);
    }
    function y6(h, X) {
      dn !== null && typeof dn.markStateUpdateScheduled == "function" && dn.markStateUpdateScheduled(h, X);
    }
    var Di = (
      /*                         */
      0
    ), Ki = (
      /*                 */
      1
    ), wi = (
      /*                    */
      2
    ), Za = (
      /*               */
      8
    ), k6 = (
      /*              */
      16
    ), Zc = Math.clz32 ? Math.clz32 : nu, Np = Math.log, _c = Math.LN2;
    function nu(h) {
      var X = h >>> 0;
      return X === 0 ? 32 : 31 - (Np(X) / _c | 0) | 0;
    }
    var sa = 31, Ar = (
      /*                        */
      0
    ), Zt = (
      /*                          */
      0
    ), Ln = (
      /*                        */
      1
    ), qs = (
      /*    */
      2
    ), Zf = (
      /*             */
      4
    ), iu = (
      /*            */
      8
    ), Ra = (
      /*                     */
      16
    ), nl = (
      /*                */
      32
    ), su = (
      /*                       */
      4194240
    ), il = (
      /*                        */
      64
    ), E6 = (
      /*                        */
      128
    ), i6 = (
      /*                        */
      256
    ), LA = (
      /*                        */
      512
    ), au = (
      /*                        */
      1024
    ), lv = (
      /*                        */
      2048
    ), $c = (
      /*                        */
      4096
    ), Qp = (
      /*                        */
      8192
    ), e3 = (
      /*                        */
      16384
    ), t3 = (
      /*                       */
      32768
    ), cA = (
      /*                       */
      65536
    ), _a = (
      /*                       */
      131072
    ), Ig = (
      /*                       */
      262144
    ), ba = (
      /*                       */
      524288
    ), KA = (
      /*                       */
      1048576
    ), l7 = (
      /*                       */
      2097152
    ), PP = (
      /*                            */
      130023424
    ), pA = (
      /*                             */
      4194304
    ), Yp = (
      /*                             */
      8388608
    ), Mp = (
      /*                             */
      16777216
    ), Lp = (
      /*                             */
      33554432
    ), Kp = (
      /*                             */
      67108864
    ), Rg = pA, sl = (
      /*          */
      134217728
    ), Jp = (
      /*                          */
      268435455
    ), cP = (
      /*               */
      268435456
    ), Hd = (
      /*                        */
      536870912
    ), s6 = (
      /*                   */
      1073741824
    );
    function Uq(h) {
      {
        if (h & Ln)
          return "Sync";
        if (h & qs)
          return "InputContinuousHydration";
        if (h & Zf)
          return "InputContinuous";
        if (h & iu)
          return "DefaultHydration";
        if (h & Ra)
          return "Default";
        if (h & nl)
          return "TransitionHydration";
        if (h & su)
          return "Transition";
        if (h & PP)
          return "Retry";
        if (h & sl)
          return "SelectiveHydration";
        if (h & cP)
          return "IdleHydration";
        if (h & Hd)
          return "Idle";
        if (h & s6)
          return "Offscreen";
      }
    }
    var Ma = -1, P7 = il, c7 = pA;
    function V1(h) {
      switch (C1(h)) {
        case Ln:
          return Ln;
        case qs:
          return qs;
        case Zf:
          return Zf;
        case iu:
          return iu;
        case Ra:
          return Ra;
        case nl:
          return nl;
        case il:
        case E6:
        case i6:
        case LA:
        case au:
        case lv:
        case $c:
        case Qp:
        case e3:
        case t3:
        case cA:
        case _a:
        case Ig:
        case ba:
        case KA:
        case l7:
          return h & su;
        case pA:
        case Yp:
        case Mp:
        case Lp:
        case Kp:
          return h & PP;
        case sl:
          return sl;
        case cP:
          return cP;
        case Hd:
          return Hd;
        case s6:
          return s6;
        default:
          return s("Should have found matching lanes. This is a bug in React."), h;
      }
    }
    function gd(h, X) {
      var W = h.pendingLanes;
      if (W === Ar)
        return Ar;
      var V = Ar, Q = h.suspendedLanes, ie = h.pingedLanes, le = W & Jp;
      if (le !== Ar) {
        var He = le & ~Q;
        if (He !== Ar)
          V = V1(He);
        else {
          var xe = le & ie;
          xe !== Ar && (V = V1(xe));
        }
      } else {
        var Je = W & ~Q;
        Je !== Ar ? V = V1(Je) : ie !== Ar && (V = V1(ie));
      }
      if (V === Ar)
        return Ar;
      if (X !== Ar && X !== V && // If we already suspended with a delay, then interrupting is fine. Don't
      // bother waiting until the root is complete.
      (X & Q) === Ar) {
        var _e = C1(V), qt = C1(X);
        if (
          // Tests whether the next lane is equal or lower priority than the wip
          // one. This works because the bits decrease in priority as you go left.
          _e >= qt || // Default priority updates should not interrupt transition updates. The
          // only difference between default updates and transition updates is that
          // default updates do not support refresh transitions.
          _e === Ra && (qt & su) !== Ar
        )
          return X;
      }
      (V & Zf) !== Ar && (V |= W & Ra);
      var Ht = h.entangledLanes;
      if (Ht !== Ar)
        for (var Mt = h.entanglements, Lt = V & Ht; Lt > 0; ) {
          var or = al(Lt), yn = 1 << or;
          V |= Mt[or], Lt &= ~yn;
        }
      return V;
    }
    function X4(h, X) {
      for (var W = h.eventTimes, V = Ma; X > 0; ) {
        var Q = al(X), ie = 1 << Q, le = W[Q];
        le > V && (V = le), X &= ~ie;
      }
      return V;
    }
    function nf(h, X) {
      switch (h) {
        case Ln:
        case qs:
        case Zf:
          return X + 250;
        case iu:
        case Ra:
        case nl:
        case il:
        case E6:
        case i6:
        case LA:
        case au:
        case lv:
        case $c:
        case Qp:
        case e3:
        case t3:
        case cA:
        case _a:
        case Ig:
        case ba:
        case KA:
        case l7:
          return X + 5e3;
        case pA:
        case Yp:
        case Mp:
        case Lp:
        case Kp:
          return Ma;
        case sl:
        case cP:
        case Hd:
        case s6:
          return Ma;
        default:
          return s("Should have found matching lanes. This is a bug in React."), Ma;
      }
    }
    function pP(h, X) {
      for (var W = h.pendingLanes, V = h.suspendedLanes, Q = h.pingedLanes, ie = h.expirationTimes, le = W; le > 0; ) {
        var He = al(le), xe = 1 << He, Je = ie[He];
        Je === Ma ? ((xe & V) === Ar || (xe & Q) !== Ar) && (ie[He] = nf(xe, X)) : Je <= X && (h.expiredLanes |= xe), le &= ~xe;
      }
    }
    function ca(h) {
      return V1(h.pendingLanes);
    }
    function hP(h) {
      var X = h.pendingLanes & ~s6;
      return X !== Ar ? X : X & s6 ? s6 : Ar;
    }
    function zp(h) {
      return (h & Ln) !== Ar;
    }
    function r3(h) {
      return (h & Jp) !== Ar;
    }
    function n3(h) {
      return (h & PP) === h;
    }
    function Gp(h) {
      var X = Ln | Zf | Ra;
      return (h & X) === Ar;
    }
    function T4(h) {
      return (h & su) === h;
    }
    function i3(h, X) {
      var W = qs | Zf | iu | Ra;
      return (X & W) !== Ar;
    }
    function q4(h, X) {
      return (X & h.expiredLanes) !== Ar;
    }
    function Vg(h) {
      return (h & su) !== Ar;
    }
    function Zp() {
      var h = P7;
      return P7 <<= 1, (P7 & su) === Ar && (P7 = il), h;
    }
    function Iq() {
      var h = c7;
      return c7 <<= 1, (c7 & PP) === Ar && (c7 = pA), h;
    }
    function C1(h) {
      return h & -h;
    }
    function O1(h) {
      return C1(h);
    }
    function al(h) {
      return 31 - Zc(h);
    }
    function _p(h) {
      return al(h);
    }
    function F6(h, X) {
      return (h & X) !== Ar;
    }
    function HP(h, X) {
      return (h & X) === X;
    }
    function ts(h, X) {
      return h | X;
    }
    function ou(h, X) {
      return h & ~X;
    }
    function p7(h, X) {
      return h & X;
    }
    function Cg(h) {
      return h;
    }
    function b4(h, X) {
      return h !== Zt && h < X ? h : X;
    }
    function h7(h) {
      for (var X = [], W = 0; W < sa; W++)
        X.push(h);
      return X;
    }
    function gP(h, X, W) {
      h.pendingLanes |= X, X !== Hd && (h.suspendedLanes = Ar, h.pingedLanes = Ar);
      var V = h.eventTimes, Q = _p(X);
      V[Q] = W;
    }
    function $p(h, X) {
      h.suspendedLanes |= X, h.pingedLanes &= ~X;
      for (var W = h.expirationTimes, V = X; V > 0; ) {
        var Q = al(V), ie = 1 << Q;
        W[Q] = Ma, V &= ~ie;
      }
    }
    function eh(h, X, W) {
      h.pingedLanes |= h.suspendedLanes & X;
    }
    function Og(h, X) {
      var W = h.pendingLanes & ~X;
      h.pendingLanes = X, h.suspendedLanes = Ar, h.pingedLanes = Ar, h.expiredLanes &= X, h.mutableReadLanes &= X, h.entangledLanes &= X;
      for (var V = h.entanglements, Q = h.eventTimes, ie = h.expirationTimes, le = W; le > 0; ) {
        var He = al(le), xe = 1 << He;
        V[He] = Ar, Q[He] = Ma, ie[He] = Ma, le &= ~xe;
      }
    }
    function s3(h, X) {
      for (var W = h.entangledLanes |= X, V = h.entanglements, Q = W; Q; ) {
        var ie = al(Q), le = 1 << ie;
        // Is this one of the newly entangled lanes?
        le & X | // Is this lane transitively entangled with the newly entangled lanes?
        V[ie] & X && (V[ie] |= X), Q &= ~le;
      }
    }
    function x4(h, X) {
      var W = C1(X), V;
      switch (W) {
        case Zf:
          V = qs;
          break;
        case Ra:
          V = iu;
          break;
        case il:
        case E6:
        case i6:
        case LA:
        case au:
        case lv:
        case $c:
        case Qp:
        case e3:
        case t3:
        case cA:
        case _a:
        case Ig:
        case ba:
        case KA:
        case l7:
        case pA:
        case Yp:
        case Mp:
        case Lp:
        case Kp:
          V = nl;
          break;
        case Hd:
          V = cP;
          break;
        default:
          V = Zt;
          break;
      }
      return (V & (h.suspendedLanes | X)) !== Zt ? Zt : V;
    }
    function yg(h, X, W) {
      if (rf)
        for (var V = h.pendingUpdatersLaneMap; W > 0; ) {
          var Q = _p(W), ie = 1 << Q, le = V[Q];
          le.add(X), W &= ~ie;
        }
    }
    function fu(h, X) {
      if (rf)
        for (var W = h.pendingUpdatersLaneMap, V = h.memoizedUpdaters; X > 0; ) {
          var Q = _p(X), ie = 1 << Q, le = W[Q];
          le.size > 0 && (le.forEach(function(He) {
            var xe = He.alternate;
            (xe === null || !V.has(xe)) && V.add(He);
          }), le.clear()), X &= ~ie;
        }
    }
    function th(h, X) {
      return null;
    }
    var H1 = Ln, _f = Zf, Au = Ra, XP = Hd, ol = Zt;
    function a6() {
      return ol;
    }
    function Co(h) {
      ol = h;
    }
    function a3(h, X) {
      var W = ol;
      try {
        return ol = h, X();
      } finally {
        ol = W;
      }
    }
    function Va(h, X) {
      return h !== 0 && h < X ? h : X;
    }
    function TP(h, X) {
      return h === 0 || h > X ? h : X;
    }
    function rh(h, X) {
      return h !== 0 && h < X;
    }
    function du(h) {
      var X = C1(h);
      return rh(H1, X) ? rh(_f, X) ? r3(X) ? Au : XP : _f : H1;
    }
    function sf(h) {
      var X = h.current.memoizedState;
      return X.isDehydrated;
    }
    var nh;
    function Un(h) {
      nh = h;
    }
    function Xd(h) {
      nh(h);
    }
    var ih;
    function o3(h) {
      ih = h;
    }
    var kg;
    function sh(h) {
      kg = h;
    }
    var ah;
    function Eg(h) {
      ah = h;
    }
    var oh;
    function Fg(h) {
      oh = h;
    }
    var H7 = !1, f3 = [], Pv = null, bo = null, af = null, JA = /* @__PURE__ */ new Map(), A3 = /* @__PURE__ */ new Map(), vu = [], zA = [
      "mousedown",
      "mouseup",
      "touchcancel",
      "touchend",
      "touchstart",
      "auxclick",
      "dblclick",
      "pointercancel",
      "pointerdown",
      "pointerup",
      "dragend",
      "dragstart",
      "drop",
      "compositionend",
      "compositionstart",
      "keydown",
      "keypress",
      "keyup",
      "input",
      "textInput",
      // Intentionally camelCase
      "copy",
      "cut",
      "paste",
      "click",
      "change",
      "contextmenu",
      "reset",
      "submit"
    ];
    function D4(h) {
      return zA.indexOf(h) > -1;
    }
    function Td(h, X, W, V, Q) {
      return {
        blockedOn: h,
        domEventName: X,
        eventSystemFlags: W,
        nativeEvent: Q,
        targetContainers: [V]
      };
    }
    function g7(h, X) {
      switch (h) {
        case "focusin":
        case "focusout":
          Pv = null;
          break;
        case "dragenter":
        case "dragleave":
          bo = null;
          break;
        case "mouseover":
        case "mouseout":
          af = null;
          break;
        case "pointerover":
        case "pointerout": {
          var W = X.pointerId;
          JA.delete(W);
          break;
        }
        case "gotpointercapture":
        case "lostpointercapture": {
          var V = X.pointerId;
          A3.delete(V);
          break;
        }
      }
    }
    function d3(h, X, W, V, Q, ie) {
      if (h === null || h.nativeEvent !== ie) {
        var le = Td(X, W, V, Q, ie);
        if (X !== null) {
          var He = IP(X);
          He !== null && ih(He);
        }
        return le;
      }
      h.eventSystemFlags |= V;
      var xe = h.targetContainers;
      return Q !== null && xe.indexOf(Q) === -1 && xe.push(Q), h;
    }
    function j4(h, X, W, V, Q) {
      switch (X) {
        case "focusin": {
          var ie = Q;
          return Pv = d3(Pv, h, X, W, V, ie), !0;
        }
        case "dragenter": {
          var le = Q;
          return bo = d3(bo, h, X, W, V, le), !0;
        }
        case "mouseover": {
          var He = Q;
          return af = d3(af, h, X, W, V, He), !0;
        }
        case "pointerover": {
          var xe = Q, Je = xe.pointerId;
          return JA.set(Je, d3(JA.get(Je) || null, h, X, W, V, xe)), !0;
        }
        case "gotpointercapture": {
          var _e = Q, qt = _e.pointerId;
          return A3.set(qt, d3(A3.get(qt) || null, h, X, W, V, _e)), !0;
        }
      }
      return !1;
    }
    function X7(h) {
      var X = wh(h.target);
      if (X !== null) {
        var W = r6(X);
        if (W !== null) {
          var V = W.tag;
          if (V === j) {
            var Q = Dg(W);
            if (Q !== null) {
              h.blockedOn = Q, oh(h.priority, function() {
                kg(W);
              });
              return;
            }
          } else if (V === v) {
            var ie = W.stateNode;
            if (sf(ie)) {
              h.blockedOn = Cp(W);
              return;
            }
          }
        }
      }
      h.blockedOn = null;
    }
    function Ng(h) {
      for (var X = ah(), W = {
        blockedOn: null,
        target: h,
        priority: X
      }, V = 0; V < vu.length && rh(X, vu[V].priority); V++)
        ;
      vu.splice(V, 0, W), V === 0 && X7(W);
    }
    function v3(h) {
      if (h.blockedOn !== null)
        return !1;
      for (var X = h.targetContainers; X.length > 0; ) {
        var W = X[0], V = uu(h.domEventName, h.eventSystemFlags, W, h.nativeEvent);
        if (V === null) {
          var Q = h.nativeEvent, ie = new Q.constructor(Q.type, Q);
          yc(ie), Q.target.dispatchEvent(ie), Bq();
        } else {
          var le = IP(V);
          return le !== null && ih(le), h.blockedOn = V, !1;
        }
        X.shift();
      }
      return !0;
    }
    function fh(h, X, W) {
      v3(h) && W.delete(X);
    }
    function Qg() {
      H7 = !1, Pv !== null && v3(Pv) && (Pv = null), bo !== null && v3(bo) && (bo = null), af !== null && v3(af) && (af = null), JA.forEach(fh), A3.forEach(fh);
    }
    function $f(h, X) {
      h.blockedOn === X && (h.blockedOn = null, H7 || (H7 = !0, e.unstable_scheduleCallback(e.unstable_NormalPriority, Qg)));
    }
    function bs(h) {
      if (f3.length > 0) {
        $f(f3[0], h);
        for (var X = 1; X < f3.length; X++) {
          var W = f3[X];
          W.blockedOn === h && (W.blockedOn = null);
        }
      }
      Pv !== null && $f(Pv, h), bo !== null && $f(bo, h), af !== null && $f(af, h);
      var V = function(He) {
        return $f(He, h);
      };
      JA.forEach(V), A3.forEach(V);
      for (var Q = 0; Q < vu.length; Q++) {
        var ie = vu[Q];
        ie.blockedOn === h && (ie.blockedOn = null);
      }
      for (; vu.length > 0; ) {
        var le = vu[0];
        if (le.blockedOn !== null)
          break;
        X7(le), le.blockedOn === null && vu.shift();
      }
    }
    var Oo = t.ReactCurrentBatchConfig, yo = !0;
    function of(h) {
      yo = !!h;
    }
    function o6() {
      return yo;
    }
    function cv(h, X, W) {
      var V = f6(X), Q;
      switch (V) {
        case H1:
          Q = ff;
          break;
        case _f:
          Q = u3;
          break;
        case Au:
        default:
          Q = pv;
          break;
      }
      return Q.bind(null, X, W, h);
    }
    function ff(h, X, W, V) {
      var Q = a6(), ie = Oo.transition;
      Oo.transition = null;
      try {
        Co(H1), pv(h, X, W, V);
      } finally {
        Co(Q), Oo.transition = ie;
      }
    }
    function u3(h, X, W, V) {
      var Q = a6(), ie = Oo.transition;
      Oo.transition = null;
      try {
        Co(_f), pv(h, X, W, V);
      } finally {
        Co(Q), Oo.transition = ie;
      }
    }
    function pv(h, X, W, V) {
      yo && Ah(h, X, W, V);
    }
    function Ah(h, X, W, V) {
      var Q = uu(h, X, W, V);
      if (Q === null) {
        Gq(h, X, V, l3, W), g7(h, V);
        return;
      }
      if (j4(Q, h, X, W, V)) {
        V.stopPropagation();
        return;
      }
      if (g7(h, V), X & D9 && D4(h)) {
        for (; Q !== null; ) {
          var ie = IP(Q);
          ie !== null && Xd(ie);
          var le = uu(h, X, W, V);
          if (le === null && Gq(h, X, V, l3, W), le === Q)
            break;
          Q = le;
        }
        Q !== null && V.stopPropagation();
        return;
      }
      Gq(h, X, V, null, W);
    }
    var l3 = null;
    function uu(h, X, W, V) {
      l3 = null;
      var Q = kc(V), ie = wh(Q);
      if (ie !== null) {
        var le = r6(ie);
        if (le === null)
          ie = null;
        else {
          var He = le.tag;
          if (He === j) {
            var xe = Dg(le);
            if (xe !== null)
              return xe;
            ie = null;
          } else if (He === v) {
            var Je = le.stateNode;
            if (sf(Je))
              return Cp(le);
            ie = null;
          } else
            le !== ie && (ie = null);
        }
      }
      return l3 = ie, null;
    }
    function f6(h) {
      switch (h) {
        case "cancel":
        case "click":
        case "close":
        case "contextmenu":
        case "copy":
        case "cut":
        case "auxclick":
        case "dblclick":
        case "dragend":
        case "dragstart":
        case "drop":
        case "focusin":
        case "focusout":
        case "input":
        case "invalid":
        case "keydown":
        case "keypress":
        case "keyup":
        case "mousedown":
        case "mouseup":
        case "paste":
        case "pause":
        case "play":
        case "pointercancel":
        case "pointerdown":
        case "pointerup":
        case "ratechange":
        case "reset":
        case "resize":
        case "seeked":
        case "submit":
        case "touchcancel":
        case "touchend":
        case "touchstart":
        case "volumechange":
        case "change":
        case "selectionchange":
        case "textInput":
        case "compositionstart":
        case "compositionend":
        case "compositionupdate":
        case "beforeblur":
        case "afterblur":
        case "beforeinput":
        case "blur":
        case "fullscreenchange":
        case "focus":
        case "hashchange":
        case "popstate":
        case "select":
        case "selectstart":
          return H1;
        case "drag":
        case "dragenter":
        case "dragexit":
        case "dragleave":
        case "dragover":
        case "mousemove":
        case "mouseout":
        case "mouseover":
        case "pointermove":
        case "pointerout":
        case "pointerover":
        case "scroll":
        case "toggle":
        case "touchmove":
        case "wheel":
        case "mouseenter":
        case "mouseleave":
        case "pointerenter":
        case "pointerleave":
          return _f;
        case "message": {
          var X = a7();
          switch (X) {
            case Op:
              return H1;
            case Gf:
              return _f;
            case Av:
            case o7:
              return Au;
            case hd:
              return XP;
            default:
              return Au;
          }
        }
        default:
          return Au;
      }
    }
    function T7(h, X, W) {
      return h.addEventListener(X, W, !1), W;
    }
    function P3(h, X, W) {
      return h.addEventListener(X, W, !0), W;
    }
    function hv(h, X, W, V) {
      return h.addEventListener(X, W, {
        capture: !0,
        passive: V
      }), W;
    }
    function c3(h, X, W, V) {
      return h.addEventListener(X, W, {
        passive: V
      }), W;
    }
    var fl = null, A6 = null, lu = null;
    function Al(h) {
      return fl = h, A6 = b7(), !0;
    }
    function q7() {
      fl = null, A6 = null, lu = null;
    }
    function p3() {
      if (lu)
        return lu;
      var h, X = A6, W = X.length, V, Q = b7(), ie = Q.length;
      for (h = 0; h < W && X[h] === Q[h]; h++)
        ;
      var le = W - h;
      for (V = 1; V <= le && X[W - V] === Q[ie - V]; V++)
        ;
      var He = V > 1 ? 1 - V : void 0;
      return lu = Q.slice(h, He), lu;
    }
    function b7() {
      return "value" in fl ? fl.value : fl.textContent;
    }
    function qP(h) {
      var X, W = h.keyCode;
      return "charCode" in h ? (X = h.charCode, X === 0 && W === 13 && (X = 13)) : X = W, X === 10 && (X = 13), X >= 32 || X === 13 ? X : 0;
    }
    function dl() {
      return !0;
    }
    function w9() {
      return !1;
    }
    function y1(h) {
      function X(W, V, Q, ie, le) {
        this._reactName = W, this._targetInst = Q, this.type = V, this.nativeEvent = ie, this.target = le, this.currentTarget = null;
        for (var He in h)
          if (h.hasOwnProperty(He)) {
            var xe = h[He];
            xe ? this[He] = xe(ie) : this[He] = ie[He];
          }
        var Je = ie.defaultPrevented != null ? ie.defaultPrevented : ie.returnValue === !1;
        return Je ? this.isDefaultPrevented = dl : this.isDefaultPrevented = w9, this.isPropagationStopped = w9, this;
      }
      return di(X.prototype, {
        preventDefault: function() {
          this.defaultPrevented = !0;
          var W = this.nativeEvent;
          W && (W.preventDefault ? W.preventDefault() : typeof W.returnValue != "unknown" && (W.returnValue = !1), this.isDefaultPrevented = dl);
        },
        stopPropagation: function() {
          var W = this.nativeEvent;
          W && (W.stopPropagation ? W.stopPropagation() : typeof W.cancelBubble != "unknown" && (W.cancelBubble = !0), this.isPropagationStopped = dl);
        },
        /**
         * We release all dispatched `SyntheticEvent`s after each event loop, adding
         * them back into the pool. This allows a way to hold onto a reference that
         * won't be added back into the pool.
         */
        persist: function() {
        },
        /**
         * Checks if this event should be released back into the pool.
         *
         * @return {boolean} True if this should not be released, false otherwise.
         */
        isPersistent: dl
      }), X;
    }
    var If = {
      eventPhase: 0,
      bubbles: 0,
      cancelable: 0,
      timeStamp: function(h) {
        return h.timeStamp || Date.now();
      },
      defaultPrevented: 0,
      isTrusted: 0
    }, k1 = y1(If), qd = di({}, If, {
      view: 0,
      detail: 0
    }), Yg = y1(qd), h3, Mg, d6;
    function Lg(h) {
      h !== d6 && (d6 && h.type === "mousemove" ? (h3 = h.screenX - d6.screenX, Mg = h.screenY - d6.screenY) : (h3 = 0, Mg = 0), d6 = h);
    }
    var bP = di({}, qd, {
      screenX: 0,
      screenY: 0,
      clientX: 0,
      clientY: 0,
      pageX: 0,
      pageY: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      getModifierState: j7,
      button: 0,
      buttons: 0,
      relatedTarget: function(h) {
        return h.relatedTarget === void 0 ? h.fromElement === h.srcElement ? h.toElement : h.fromElement : h.relatedTarget;
      },
      movementX: function(h) {
        return "movementX" in h ? h.movementX : (Lg(h), h3);
      },
      movementY: function(h) {
        return "movementY" in h ? h.movementY : Mg;
      }
    }), Pu = y1(bP), x7 = di({}, bP, {
      dataTransfer: 0
    }), vl = y1(x7), w4 = di({}, qd, {
      relatedTarget: 0
    }), dh = y1(w4), Kg = di({}, If, {
      animationName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), D7 = y1(Kg), Rq = di({}, If, {
      clipboardData: function(h) {
        return "clipboardData" in h ? h.clipboardData : window.clipboardData;
      }
    }), Vq = y1(Rq), Jg = di({}, If, {
      data: 0
    }), zg = y1(Jg), xP = zg, Cq = {
      Esc: "Escape",
      Spacebar: " ",
      Left: "ArrowLeft",
      Up: "ArrowUp",
      Right: "ArrowRight",
      Down: "ArrowDown",
      Del: "Delete",
      Win: "OS",
      Menu: "ContextMenu",
      Apps: "ContextMenu",
      Scroll: "ScrollLock",
      MozPrintableKey: "Unidentified"
    }, e9 = {
      8: "Backspace",
      9: "Tab",
      12: "Clear",
      13: "Enter",
      16: "Shift",
      17: "Control",
      18: "Alt",
      19: "Pause",
      20: "CapsLock",
      27: "Escape",
      32: " ",
      33: "PageUp",
      34: "PageDown",
      35: "End",
      36: "Home",
      37: "ArrowLeft",
      38: "ArrowUp",
      39: "ArrowRight",
      40: "ArrowDown",
      45: "Insert",
      46: "Delete",
      112: "F1",
      113: "F2",
      114: "F3",
      115: "F4",
      116: "F5",
      117: "F6",
      118: "F7",
      119: "F8",
      120: "F9",
      121: "F10",
      122: "F11",
      123: "F12",
      144: "NumLock",
      145: "ScrollLock",
      224: "Meta"
    };
    function m4(h) {
      if (h.key) {
        var X = Cq[h.key] || h.key;
        if (X !== "Unidentified")
          return X;
      }
      if (h.type === "keypress") {
        var W = qP(h);
        return W === 13 ? "Enter" : String.fromCharCode(W);
      }
      return h.type === "keydown" || h.type === "keyup" ? e9[h.keyCode] || "Unidentified" : "";
    }
    var $a = {
      Alt: "altKey",
      Control: "ctrlKey",
      Meta: "metaKey",
      Shift: "shiftKey"
    };
    function B4(h) {
      var X = this, W = X.nativeEvent;
      if (W.getModifierState)
        return W.getModifierState(h);
      var V = $a[h];
      return V ? !!W[V] : !1;
    }
    function j7(h) {
      return B4;
    }
    var W4 = di({}, qd, {
      key: m4,
      code: 0,
      location: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      repeat: 0,
      locale: 0,
      getModifierState: j7,
      // Legacy Interface
      charCode: function(h) {
        return h.type === "keypress" ? qP(h) : 0;
      },
      keyCode: function(h) {
        return h.type === "keydown" || h.type === "keyup" ? h.keyCode : 0;
      },
      which: function(h) {
        return h.type === "keypress" ? qP(h) : h.type === "keydown" || h.type === "keyup" ? h.keyCode : 0;
      }
    }), Oq = y1(W4), S4 = di({}, bP, {
      pointerId: 0,
      width: 0,
      height: 0,
      pressure: 0,
      tangentialPressure: 0,
      tiltX: 0,
      tiltY: 0,
      twist: 0,
      pointerType: 0,
      isPrimary: 0
    }), Gg = y1(S4), U4 = di({}, qd, {
      touches: 0,
      targetTouches: 0,
      changedTouches: 0,
      altKey: 0,
      metaKey: 0,
      ctrlKey: 0,
      shiftKey: 0,
      getModifierState: j7
    }), N6 = y1(U4), Zg = di({}, If, {
      propertyName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), w7 = y1(Zg), cu = di({}, bP, {
      deltaX: function(h) {
        return "deltaX" in h ? h.deltaX : (
          // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
          "wheelDeltaX" in h ? -h.wheelDeltaX : 0
        );
      },
      deltaY: function(h) {
        return "deltaY" in h ? h.deltaY : (
          // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
          "wheelDeltaY" in h ? -h.wheelDeltaY : (
            // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
            "wheelDelta" in h ? -h.wheelDelta : 0
          )
        );
      },
      deltaZ: 0,
      // Browsers without "deltaMode" is reporting in raw wheel delta where one
      // notch on the scroll is always +/- 120, roughly equivalent to pixels.
      // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
      // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
      deltaMode: 0
    }), H3 = y1(cu), DP = [9, 13, 27, 32], g3 = 229, vh = ke && "CompositionEvent" in window, jP = null;
    ke && "documentMode" in document && (jP = document.documentMode);
    var yq = ke && "TextEvent" in window && !jP, m7 = ke && (!vh || jP && jP > 8 && jP <= 11), wP = 32, X3 = String.fromCharCode(wP);
    function T3() {
      ve("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), ve("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]), ve("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]), ve("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
    }
    var mP = !1;
    function uh(h) {
      return (h.ctrlKey || h.altKey || h.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
      !(h.ctrlKey && h.altKey);
    }
    function I4(h) {
      switch (h) {
        case "compositionstart":
          return "onCompositionStart";
        case "compositionend":
          return "onCompositionEnd";
        case "compositionupdate":
          return "onCompositionUpdate";
      }
    }
    function B7(h, X) {
      return h === "keydown" && X.keyCode === g3;
    }
    function R4(h, X) {
      switch (h) {
        case "keyup":
          return DP.indexOf(X.keyCode) !== -1;
        case "keydown":
          return X.keyCode !== g3;
        case "keypress":
        case "mousedown":
        case "focusout":
          return !0;
        default:
          return !1;
      }
    }
    function W7(h) {
      var X = h.detail;
      return typeof X == "object" && "data" in X ? X.data : null;
    }
    function S7(h) {
      return h.locale === "ko";
    }
    var hA = !1;
    function lh(h, X, W, V, Q) {
      var ie, le;
      if (vh ? ie = I4(X) : hA ? R4(X, V) && (ie = "onCompositionEnd") : B7(X, V) && (ie = "onCompositionStart"), !ie)
        return null;
      m7 && !S7(V) && (!hA && ie === "onCompositionStart" ? hA = Al(Q) : ie === "onCompositionEnd" && hA && (le = p3()));
      var He = Y4(W, ie);
      if (He.length > 0) {
        var xe = new zg(ie, X, null, V, Q);
        if (h.push({
          event: xe,
          listeners: He
        }), le)
          xe.data = le;
        else {
          var Je = W7(V);
          Je !== null && (xe.data = Je);
        }
      }
    }
    function Ph(h, X) {
      switch (h) {
        case "compositionend":
          return W7(X);
        case "keypress":
          var W = X.which;
          return W !== wP ? null : (mP = !0, X3);
        case "textInput":
          var V = X.data;
          return V === X3 && mP ? null : V;
        default:
          return null;
      }
    }
    function V4(h, X) {
      if (hA) {
        if (h === "compositionend" || !vh && R4(h, X)) {
          var W = p3();
          return q7(), hA = !1, W;
        }
        return null;
      }
      switch (h) {
        case "paste":
          return null;
        case "keypress":
          if (!uh(X)) {
            if (X.char && X.char.length > 1)
              return X.char;
            if (X.which)
              return String.fromCharCode(X.which);
          }
          return null;
        case "compositionend":
          return m7 && !S7(X) ? null : X.data;
        default:
          return null;
      }
    }
    function C4(h, X, W, V, Q) {
      var ie;
      if (yq ? ie = Ph(X, V) : ie = V4(X, V), !ie)
        return null;
      var le = Y4(W, "onBeforeInput");
      if (le.length > 0) {
        var He = new xP("onBeforeInput", "beforeinput", null, V, Q);
        h.push({
          event: He,
          listeners: le
        }), He.data = ie;
      }
    }
    function q3(h, X, W, V, Q, ie, le) {
      lh(h, X, W, V, Q), C4(h, X, W, V, Q);
    }
    var uo = {
      color: !0,
      date: !0,
      datetime: !0,
      "datetime-local": !0,
      email: !0,
      month: !0,
      number: !0,
      password: !0,
      range: !0,
      search: !0,
      tel: !0,
      text: !0,
      time: !0,
      url: !0,
      week: !0
    };
    function BP(h) {
      var X = h && h.nodeName && h.nodeName.toLowerCase();
      return X === "input" ? !!uo[h.type] : X === "textarea";
    }
    /**
     * Checks if an event is supported in the current execution environment.
     *
     * NOTE: This will not work correctly for non-generic events such as `change`,
     * `reset`, `load`, `error`, and `select`.
     *
     * Borrows from Modernizr.
     *
     * @param {string} eventNameSuffix Event name, e.g. "click".
     * @return {boolean} True if the event is supported.
     * @internal
     * @license Modernizr 3.0.0pre (Custom Build) | MIT
     */
    function O4(h) {
      if (!ke)
        return !1;
      var X = "on" + h, W = X in document;
      if (!W) {
        var V = document.createElement("div");
        V.setAttribute(X, "return;"), W = typeof V[X] == "function";
      }
      return W;
    }
    function b3() {
      ve("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
    }
    function D(h, X, W, V) {
      Ec(V);
      var Q = Y4(X, "onChange");
      if (Q.length > 0) {
        var ie = new k1("onChange", "change", null, W, V);
        h.push({
          event: ie,
          listeners: Q
        });
      }
    }
    var B = null, E = null;
    function z(h) {
      var X = h.nodeName && h.nodeName.toLowerCase();
      return X === "select" || X === "input" && h.type === "file";
    }
    function Ae(h) {
      var X = [];
      D(X, E, h, kc(h)), qg(pe, X);
    }
    function pe(h) {
      zq(h, 0);
    }
    function Re(h) {
      var X = M6(h);
      if (Gs(X))
        return h;
    }
    function ot(h, X) {
      if (h === "change")
        return X;
    }
    var lt = !1;
    ke && (lt = O4("input") && (!document.documentMode || document.documentMode > 9));
    function Jt(h, X) {
      B = h, E = X, B.attachEvent("onpropertychange", Xr);
    }
    function Wr() {
      B && (B.detachEvent("onpropertychange", Xr), B = null, E = null);
    }
    function Xr(h) {
      h.propertyName === "value" && Re(E) && Ae(h);
    }
    function Dr(h, X, W) {
      h === "focusin" ? (Wr(), Jt(X, W)) : h === "focusout" && Wr();
    }
    function Tn(h, X) {
      if (h === "selectionchange" || h === "keyup" || h === "keydown")
        return Re(E);
    }
    function In(h) {
      var X = h.nodeName;
      return X && X.toLowerCase() === "input" && (h.type === "checkbox" || h.type === "radio");
    }
    function Kn(h, X) {
      if (h === "click")
        return Re(X);
    }
    function La(h, X) {
      if (h === "input" || h === "change")
        return Re(X);
    }
    function mt(h) {
      var X = h._wrapperState;
      !X || !X.controlled || h.type !== "number" || si(h, "number", h.value);
    }
    function pt(h, X, W, V, Q, ie, le) {
      var He = W ? M6(W) : window, xe, Je;
      if (z(He) ? xe = ot : BP(He) ? lt ? xe = La : (xe = Tn, Je = Dr) : In(He) && (xe = Kn), xe) {
        var _e = xe(X, W);
        if (_e) {
          D(h, _e, V, Q);
          return;
        }
      }
      Je && Je(X, He, W), X === "focusout" && mt(He);
    }
    function It() {
      qe("onMouseEnter", ["mouseout", "mouseover"]), qe("onMouseLeave", ["mouseout", "mouseover"]), qe("onPointerEnter", ["pointerout", "pointerover"]), qe("onPointerLeave", ["pointerout", "pointerover"]);
    }
    function Qr(h, X, W, V, Q, ie, le) {
      var He = X === "mouseover" || X === "pointerover", xe = X === "mouseout" || X === "pointerout";
      if (He && !Xg(V)) {
        var Je = V.relatedTarget || V.fromElement;
        if (Je && (wh(Je) || hX(Je)))
          return;
      }
      if (!(!xe && !He)) {
        var _e;
        if (Q.window === Q)
          _e = Q;
        else {
          var qt = Q.ownerDocument;
          qt ? _e = qt.defaultView || qt.parentWindow : _e = window;
        }
        var Ht, Mt;
        if (xe) {
          var Lt = V.relatedTarget || V.toElement;
          if (Ht = W, Mt = Lt ? wh(Lt) : null, Mt !== null) {
            var or = r6(Mt);
            (Mt !== or || Mt.tag !== l && Mt.tag !== P) && (Mt = null);
          }
        } else
          Ht = null, Mt = W;
        if (Ht !== Mt) {
          var yn = Pu, hi = "onMouseLeave", Pi = "onMouseEnter", Ks = "mouse";
          (X === "pointerout" || X === "pointerover") && (yn = Gg, hi = "onPointerLeave", Pi = "onPointerEnter", Ks = "pointer");
          var Is = Ht == null ? _e : M6(Ht), Vt = Mt == null ? _e : M6(Mt), fr = new yn(hi, Ks + "leave", Ht, V, Q);
          fr.target = Is, fr.relatedTarget = Vt;
          var Ct = null, Nr = wh(Q);
          if (Nr === W) {
            var kn = new yn(Pi, Ks + "enter", Mt, V, Q);
            kn.target = Vt, kn.relatedTarget = Is, Ct = kn;
          }
          eB(h, fr, Ct, Ht, Mt);
        }
      }
    }
    function Jn(h, X) {
      return h === X && (h !== 0 || 1 / h === 1 / X) || h !== h && X !== X;
    }
    var On = typeof Object.is == "function" ? Object.is : Jn;
    function vi(h, X) {
      if (On(h, X))
        return !0;
      if (typeof h != "object" || h === null || typeof X != "object" || X === null)
        return !1;
      var W = Object.keys(h), V = Object.keys(X);
      if (W.length !== V.length)
        return !1;
      for (var Q = 0; Q < W.length; Q++) {
        var ie = W[Q];
        if (!be.call(X, ie) || !On(h[ie], X[ie]))
          return !1;
      }
      return !0;
    }
    function Wi(h) {
      for (; h && h.firstChild; )
        h = h.firstChild;
      return h;
    }
    function Af(h) {
      for (; h; ) {
        if (h.nextSibling)
          return h.nextSibling;
        h = h.parentNode;
      }
    }
    function xs(h, X) {
      for (var W = Wi(h), V = 0, Q = 0; W; ) {
        if (W.nodeType === cd) {
          if (Q = V + W.textContent.length, V <= X && Q >= X)
            return {
              node: W,
              offset: X - V
            };
          V = Q;
        }
        W = Wi(Af(W));
      }
    }
    function pu(h) {
      var X = h.ownerDocument, W = X && X.defaultView || window, V = W.getSelection && W.getSelection();
      if (!V || V.rangeCount === 0)
        return null;
      var Q = V.anchorNode, ie = V.anchorOffset, le = V.focusNode, He = V.focusOffset;
      try {
        Q.nodeType, le.nodeType;
      } catch {
        return null;
      }
      return ch(h, Q, ie, le, He);
    }
    function ch(h, X, W, V, Q) {
      var ie = 0, le = -1, He = -1, xe = 0, Je = 0, _e = h, qt = null;
      e:
        for (; ; ) {
          for (var Ht = null; _e === X && (W === 0 || _e.nodeType === cd) && (le = ie + W), _e === V && (Q === 0 || _e.nodeType === cd) && (He = ie + Q), _e.nodeType === cd && (ie += _e.nodeValue.length), (Ht = _e.firstChild) !== null; )
            qt = _e, _e = Ht;
          for (; ; ) {
            if (_e === h)
              break e;
            if (qt === X && ++xe === W && (le = ie), qt === V && ++Je === Q && (He = ie), (Ht = _e.nextSibling) !== null)
              break;
            _e = qt, qt = _e.parentNode;
          }
          _e = Ht;
        }
      return le === -1 || He === -1 ? null : {
        start: le,
        end: He
      };
    }
    function RD(h, X) {
      var W = h.ownerDocument || document, V = W && W.defaultView || window;
      if (V.getSelection) {
        var Q = V.getSelection(), ie = h.textContent.length, le = Math.min(X.start, ie), He = X.end === void 0 ? le : Math.min(X.end, ie);
        if (!Q.extend && le > He) {
          var xe = He;
          He = le, le = xe;
        }
        var Je = xs(h, le), _e = xs(h, He);
        if (Je && _e) {
          if (Q.rangeCount === 1 && Q.anchorNode === Je.node && Q.anchorOffset === Je.offset && Q.focusNode === _e.node && Q.focusOffset === _e.offset)
            return;
          var qt = W.createRange();
          qt.setStart(Je.node, Je.offset), Q.removeAllRanges(), le > He ? (Q.addRange(qt), Q.extend(_e.node, _e.offset)) : (qt.setEnd(_e.node, _e.offset), Q.addRange(qt));
        }
      }
    }
    function kq(h) {
      return h && h.nodeType === cd;
    }
    function VD(h, X) {
      return !h || !X ? !1 : h === X ? !0 : kq(h) ? !1 : kq(X) ? VD(h, X.parentNode) : "contains" in h ? h.contains(X) : h.compareDocumentPosition ? !!(h.compareDocumentPosition(X) & 16) : !1;
    }
    function CD(h) {
      return h && h.ownerDocument && VD(h.ownerDocument.documentElement, h);
    }
    function OD(h) {
      try {
        return typeof h.contentWindow.location.href == "string";
      } catch {
        return !1;
      }
    }
    function _g() {
      for (var h = window, X = ks(); X instanceof h.HTMLIFrameElement; ) {
        if (OD(X))
          h = X.contentWindow;
        else
          return X;
        X = ks(h.document);
      }
      return X;
    }
    function y4(h) {
      var X = h && h.nodeName && h.nodeName.toLowerCase();
      return X && (X === "input" && (h.type === "text" || h.type === "search" || h.type === "tel" || h.type === "url" || h.type === "password") || X === "textarea" || h.contentEditable === "true");
    }
    function Jm() {
      var h = _g();
      return {
        focusedElem: h,
        selectionRange: y4(h) ? yD(h) : null
      };
    }
    function zm(h) {
      var X = _g(), W = h.focusedElem, V = h.selectionRange;
      if (X !== W && CD(W)) {
        V !== null && y4(W) && Gm(W, V);
        for (var Q = [], ie = W; ie = ie.parentNode; )
          ie.nodeType === Kf && Q.push({
            element: ie,
            left: ie.scrollLeft,
            top: ie.scrollTop
          });
        typeof W.focus == "function" && W.focus();
        for (var le = 0; le < Q.length; le++) {
          var He = Q[le];
          He.element.scrollLeft = He.left, He.element.scrollTop = He.top;
        }
      }
    }
    function yD(h) {
      var X;
      return "selectionStart" in h ? X = {
        start: h.selectionStart,
        end: h.selectionEnd
      } : X = pu(h), X || {
        start: 0,
        end: 0
      };
    }
    function Gm(h, X) {
      var W = X.start, V = X.end;
      V === void 0 && (V = W), "selectionStart" in h ? (h.selectionStart = W, h.selectionEnd = Math.min(V, h.value.length)) : RD(h, X);
    }
    var kD = ke && "documentMode" in document && document.documentMode <= 11;
    function Zm() {
      ve("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
    }
    var ph = null, Eq = null, $g = null, k4 = !1;
    function ED(h) {
      if ("selectionStart" in h && y4(h))
        return {
          start: h.selectionStart,
          end: h.selectionEnd
        };
      var X = h.ownerDocument && h.ownerDocument.defaultView || window, W = X.getSelection();
      return {
        anchorNode: W.anchorNode,
        anchorOffset: W.anchorOffset,
        focusNode: W.focusNode,
        focusOffset: W.focusOffset
      };
    }
    function FD(h) {
      return h.window === h ? h.document : h.nodeType === C6 ? h : h.ownerDocument;
    }
    function Fq(h, X, W) {
      var V = FD(W);
      if (!(k4 || ph == null || ph !== ks(V))) {
        var Q = ED(ph);
        if (!$g || !vi($g, Q)) {
          $g = Q;
          var ie = Y4(Eq, "onSelect");
          if (ie.length > 0) {
            var le = new k1("onSelect", "select", null, X, W);
            h.push({
              event: le,
              listeners: ie
            }), le.target = ph;
          }
        }
      }
    }
    function ND(h, X, W, V, Q, ie, le) {
      var He = W ? M6(W) : window;
      switch (X) {
        case "focusin":
          (BP(He) || He.contentEditable === "true") && (ph = He, Eq = W, $g = null);
          break;
        case "focusout":
          ph = null, Eq = null, $g = null;
          break;
        case "mousedown":
          k4 = !0;
          break;
        case "contextmenu":
        case "mouseup":
        case "dragend":
          k4 = !1, Fq(h, V, Q);
          break;
        case "selectionchange":
          if (kD)
            break;
        case "keydown":
        case "keyup":
          Fq(h, V, Q);
      }
    }
    function hh(h, X) {
      var W = {};
      return W[h.toLowerCase()] = X.toLowerCase(), W["Webkit" + h] = "webkit" + X, W["Moz" + h] = "moz" + X, W;
    }
    var ul = {
      animationend: hh("Animation", "AnimationEnd"),
      animationiteration: hh("Animation", "AnimationIteration"),
      animationstart: hh("Animation", "AnimationStart"),
      transitionend: hh("Transition", "TransitionEnd")
    }, Hh = {}, QD = {};
    ke && (QD = document.createElement("div").style, "AnimationEvent" in window || (delete ul.animationend.animation, delete ul.animationiteration.animation, delete ul.animationstart.animation), "TransitionEvent" in window || delete ul.transitionend.transition);
    function eX(h) {
      if (Hh[h])
        return Hh[h];
      if (!ul[h])
        return h;
      var X = ul[h];
      for (var W in X)
        if (X.hasOwnProperty(W) && W in QD)
          return Hh[h] = X[W];
      return h;
    }
    var YD = eX("animationend"), E4 = eX("animationiteration"), Nq = eX("animationstart"), MD = eX("transitionend"), Qq = /* @__PURE__ */ new Map(), Yq = ["abort", "auxClick", "cancel", "canPlay", "canPlayThrough", "click", "close", "contextMenu", "copy", "cut", "drag", "dragEnd", "dragEnter", "dragExit", "dragLeave", "dragOver", "dragStart", "drop", "durationChange", "emptied", "encrypted", "ended", "error", "gotPointerCapture", "input", "invalid", "keyDown", "keyPress", "keyUp", "load", "loadedData", "loadedMetadata", "loadStart", "lostPointerCapture", "mouseDown", "mouseMove", "mouseOut", "mouseOver", "mouseUp", "paste", "pause", "play", "playing", "pointerCancel", "pointerDown", "pointerMove", "pointerOut", "pointerOver", "pointerUp", "progress", "rateChange", "reset", "resize", "seeked", "seeking", "stalled", "submit", "suspend", "timeUpdate", "touchCancel", "touchEnd", "touchStart", "volumeChange", "scroll", "toggle", "touchMove", "waiting", "wheel"];
    function bd(h, X) {
      Qq.set(h, X), ve(X, [h]);
    }
    function Mq() {
      for (var h = 0; h < Yq.length; h++) {
        var X = Yq[h], W = X.toLowerCase(), V = X[0].toUpperCase() + X.slice(1);
        bd(W, "on" + V);
      }
      bd(YD, "onAnimationEnd"), bd(E4, "onAnimationIteration"), bd(Nq, "onAnimationStart"), bd("dblclick", "onDoubleClick"), bd("focusin", "onFocus"), bd("focusout", "onBlur"), bd(MD, "onTransitionEnd");
    }
    function LD(h, X, W, V, Q, ie, le) {
      var He = Qq.get(X);
      if (He !== void 0) {
        var xe = k1, Je = X;
        switch (X) {
          case "keypress":
            if (qP(V) === 0)
              return;
          case "keydown":
          case "keyup":
            xe = Oq;
            break;
          case "focusin":
            Je = "focus", xe = dh;
            break;
          case "focusout":
            Je = "blur", xe = dh;
            break;
          case "beforeblur":
          case "afterblur":
            xe = dh;
            break;
          case "click":
            if (V.button === 2)
              return;
          case "auxclick":
          case "dblclick":
          case "mousedown":
          case "mousemove":
          case "mouseup":
          case "mouseout":
          case "mouseover":
          case "contextmenu":
            xe = Pu;
            break;
          case "drag":
          case "dragend":
          case "dragenter":
          case "dragexit":
          case "dragleave":
          case "dragover":
          case "dragstart":
          case "drop":
            xe = vl;
            break;
          case "touchcancel":
          case "touchend":
          case "touchmove":
          case "touchstart":
            xe = N6;
            break;
          case YD:
          case E4:
          case Nq:
            xe = D7;
            break;
          case MD:
            xe = w7;
            break;
          case "scroll":
            xe = Yg;
            break;
          case "wheel":
            xe = H3;
            break;
          case "copy":
          case "cut":
          case "paste":
            xe = Vq;
            break;
          case "gotpointercapture":
          case "lostpointercapture":
          case "pointercancel":
          case "pointerdown":
          case "pointermove":
          case "pointerout":
          case "pointerover":
          case "pointerup":
            xe = Gg;
            break;
        }
        var _e = (ie & D9) !== 0;
        {
          var qt = !_e && // TODO: ideally, we'd eventually add all events from
          // nonDelegatedEvents list in DOMPluginEventSystem.
          // Then we can remove this special list.
          // This is a breaking change that can wait until React 18.
          X === "scroll", Ht = Zq(W, He, V.type, _e, qt);
          if (Ht.length > 0) {
            var Mt = new xe(He, Je, null, V, Q);
            h.push({
              event: Mt,
              listeners: Ht
            });
          }
        }
      }
    }
    Mq(), It(), b3(), Zm(), T3();
    function Lq(h, X, W, V, Q, ie, le) {
      LD(h, X, W, V, Q, ie);
      var He = (ie & kA) === 0;
      He && (Qr(h, X, W, V, Q), pt(h, X, W, V, Q), ND(h, X, W, V, Q), q3(h, X, W, V, Q));
    }
    var x3 = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "resize", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"], Kq = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(x3));
    function tX(h, X, W) {
      var V = h.type || "unknown-event";
      h.currentTarget = W, Sf(V, X, void 0, h), h.currentTarget = null;
    }
    function Jq(h, X, W) {
      var V;
      if (W)
        for (var Q = X.length - 1; Q >= 0; Q--) {
          var ie = X[Q], le = ie.instance, He = ie.currentTarget, xe = ie.listener;
          if (le !== V && h.isPropagationStopped())
            return;
          tX(h, xe, He), V = le;
        }
      else
        for (var Je = 0; Je < X.length; Je++) {
          var _e = X[Je], qt = _e.instance, Ht = _e.currentTarget, Mt = _e.listener;
          if (qt !== V && h.isPropagationStopped())
            return;
          tX(h, Mt, Ht), V = qt;
        }
    }
    function zq(h, X) {
      for (var W = (X & D9) !== 0, V = 0; V < h.length; V++) {
        var Q = h[V], ie = Q.event, le = Q.listeners;
        Jq(ie, le, W);
      }
      Gu();
    }
    function _m(h, X, W, V, Q) {
      var ie = kc(W), le = [];
      Lq(le, h, V, W, ie, X), zq(le, X);
    }
    function ko(h, X) {
      Kq.has(h) || s('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.', h);
      var W = !1, V = mh(X), Q = JD(h, W);
      V.has(Q) || (Q4(X, h, $1, W), V.add(Q));
    }
    function F4(h, X, W) {
      Kq.has(h) && !X && s('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.', h);
      var V = 0;
      X && (V |= D9), Q4(W, h, V, X);
    }
    var N4 = "_reactListening" + Math.random().toString(36).slice(2);
    function rX(h) {
      if (!h[N4]) {
        h[N4] = !0, De.forEach(function(W) {
          W !== "selectionchange" && (Kq.has(W) || F4(W, !1, h), F4(W, !0, h));
        });
        var X = h.nodeType === C6 ? h : h.ownerDocument;
        X !== null && (X[N4] || (X[N4] = !0, F4("selectionchange", !1, X)));
      }
    }
    function Q4(h, X, W, V, Q) {
      var ie = cv(h, X, W), le = void 0;
      Qc && (X === "touchstart" || X === "touchmove" || X === "wheel") && (le = !0), h = h, V ? le !== void 0 ? hv(h, X, ie, le) : P3(h, X, ie) : le !== void 0 ? c3(h, X, ie, le) : T7(h, X, ie);
    }
    function KD(h, X) {
      return h === X || h.nodeType === Xo && h.parentNode === X;
    }
    function Gq(h, X, W, V, Q) {
      var ie = V;
      if (!(X & _1) && !(X & $1)) {
        var le = Q;
        if (V !== null) {
          var He = V;
          e:
            for (; ; ) {
              if (He === null)
                return;
              var xe = He.tag;
              if (xe === v || xe === u) {
                var Je = He.stateNode.containerInfo;
                if (KD(Je, le))
                  break;
                if (xe === u)
                  for (var _e = He.return; _e !== null; ) {
                    var qt = _e.tag;
                    if (qt === v || qt === u) {
                      var Ht = _e.stateNode.containerInfo;
                      if (KD(Ht, le))
                        return;
                    }
                    _e = _e.return;
                  }
                for (; Je !== null; ) {
                  var Mt = wh(Je);
                  if (Mt === null)
                    return;
                  var Lt = Mt.tag;
                  if (Lt === l || Lt === P) {
                    He = ie = Mt;
                    continue e;
                  }
                  Je = Je.parentNode;
                }
              }
              He = He.return;
            }
        }
      }
      qg(function() {
        return _m(h, X, W, ie);
      });
    }
    function nX(h, X, W) {
      return {
        instance: h,
        listener: X,
        currentTarget: W
      };
    }
    function Zq(h, X, W, V, Q, ie) {
      for (var le = X !== null ? X + "Capture" : null, He = V ? le : X, xe = [], Je = h, _e = null; Je !== null; ) {
        var qt = Je, Ht = qt.stateNode, Mt = qt.tag;
        if (Mt === l && Ht !== null && (_e = Ht, He !== null)) {
          var Lt = Ku(Je, He);
          Lt != null && xe.push(nX(Je, Lt, _e));
        }
        if (Q)
          break;
        Je = Je.return;
      }
      return xe;
    }
    function Y4(h, X) {
      for (var W = X + "Capture", V = [], Q = h; Q !== null; ) {
        var ie = Q, le = ie.stateNode, He = ie.tag;
        if (He === l && le !== null) {
          var xe = le, Je = Ku(Q, W);
          Je != null && V.unshift(nX(Q, Je, xe));
          var _e = Ku(Q, X);
          _e != null && V.push(nX(Q, _e, xe));
        }
        Q = Q.return;
      }
      return V;
    }
    function gh(h) {
      if (h === null)
        return null;
      do
        h = h.return;
      while (h && h.tag !== l);
      return h || null;
    }
    function $m(h, X) {
      for (var W = h, V = X, Q = 0, ie = W; ie; ie = gh(ie))
        Q++;
      for (var le = 0, He = V; He; He = gh(He))
        le++;
      for (; Q - le > 0; )
        W = gh(W), Q--;
      for (; le - Q > 0; )
        V = gh(V), le--;
      for (var xe = Q; xe--; ) {
        if (W === V || V !== null && W === V.alternate)
          return W;
        W = gh(W), V = gh(V);
      }
      return null;
    }
    function iX(h, X, W, V, Q) {
      for (var ie = X._reactName, le = [], He = W; He !== null && He !== V; ) {
        var xe = He, Je = xe.alternate, _e = xe.stateNode, qt = xe.tag;
        if (Je !== null && Je === V)
          break;
        if (qt === l && _e !== null) {
          var Ht = _e;
          if (Q) {
            var Mt = Ku(He, ie);
            Mt != null && le.unshift(nX(He, Mt, Ht));
          } else if (!Q) {
            var Lt = Ku(He, ie);
            Lt != null && le.push(nX(He, Lt, Ht));
          }
        }
        He = He.return;
      }
      le.length !== 0 && h.push({
        event: X,
        listeners: le
      });
    }
    function eB(h, X, W, V, Q) {
      var ie = V && Q ? $m(V, Q) : null;
      V !== null && iX(h, X, V, ie, !1), Q !== null && W !== null && iX(h, W, Q, ie, !0);
    }
    function JD(h, X) {
      return h + "__" + (X ? "capture" : "bubble");
    }
    var HA = !1, sX = "dangerouslySetInnerHTML", aX = "suppressContentEditableWarning", D3 = "suppressHydrationWarning", zD = "autoFocus", Xh = "children", Th = "style", U7 = "__html", _q, M4, I7, GD, qh, ZD, $q;
    _q = {
      // There are working polyfills for <dialog>. Let people use it.
      dialog: !0,
      // Electron ships a custom <webview> tag to display external web content in
      // an isolated frame and process.
      // This tag is not present in non Electron environments such as JSDom which
      // is often used for testing purposes.
      // @see https://electronjs.org/docs/api/webview-tag
      webview: !0
    }, M4 = function(h, X) {
      Gn(h, X), Ys(h, X), Wf(h, X, {
        registrationNameDependencies: ne,
        possibleRegistrationNames: re
      });
    }, ZD = ke && !document.documentMode, I7 = function(h, X, W) {
      if (!HA) {
        var V = oX(W), Q = oX(X);
        Q !== V && (HA = !0, s("Prop `%s` did not match. Server: %s Client: %s", h, JSON.stringify(Q), JSON.stringify(V)));
      }
    }, GD = function(h) {
      if (!HA) {
        HA = !0;
        var X = [];
        h.forEach(function(W) {
          X.push(W);
        }), s("Extra attributes from the server: %s", X);
      }
    }, qh = function(h, X) {
      X === !1 ? s("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", h, h, h) : s("Expected `%s` listener to be a function, instead got a value of `%s` type.", h, typeof X);
    }, $q = function(h, X) {
      var W = h.namespaceURI === t1 ? h.ownerDocument.createElement(h.tagName) : h.ownerDocument.createElementNS(h.namespaceURI, h.tagName);
      return W.innerHTML = X, W.innerHTML;
    };
    var tB = /\r\n?/g, rB = /\u0000|\uFFFD/g;
    function oX(h) {
      lr(h);
      var X = typeof h == "string" ? h : "" + h;
      return X.replace(tB, `
`).replace(rB, "");
    }
    function j3(h, X, W, V) {
      var Q = oX(X), ie = oX(h);
      if (ie !== Q && (V && (HA || (HA = !0, s('Text content did not match. Server: "%s" Client: "%s"', ie, Q))), W && te))
        throw new Error("Text content does not match server-rendered HTML.");
    }
    function eb(h) {
      return h.nodeType === C6 ? h : h.ownerDocument;
    }
    function nB() {
    }
    function R7(h) {
      h.onclick = nB;
    }
    function iB(h, X, W, V, Q) {
      for (var ie in V)
        if (V.hasOwnProperty(ie)) {
          var le = V[ie];
          if (ie === Th)
            le && Object.freeze(le), rv(X, le);
          else if (ie === sX) {
            var He = le ? le[U7] : void 0;
            He != null && Qu(X, He);
          } else if (ie === Xh)
            if (typeof le == "string") {
              var xe = h !== "textarea" || le !== "";
              xe && nP(X, le);
            } else
              typeof le == "number" && nP(X, "" + le);
          else
            ie === aX || ie === D3 || ie === zD || (ne.hasOwnProperty(ie) ? le != null && (typeof le != "function" && qh(ie, le), ie === "onScroll" && ko("scroll", X)) : le != null && oi(X, ie, le, Q));
        }
    }
    function _D(h, X, W, V) {
      for (var Q = 0; Q < X.length; Q += 2) {
        var ie = X[Q], le = X[Q + 1];
        ie === Th ? rv(h, le) : ie === sX ? Qu(h, le) : ie === Xh ? nP(h, le) : oi(h, ie, le, V);
      }
    }
    function sB(h, X, W, V) {
      var Q, ie = eb(W), le, He = V;
      if (He === t1 && (He = fA(h)), He === t1) {
        if (Q = rt(h, X), !Q && h !== h.toLowerCase() && s("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", h), h === "script") {
          var xe = ie.createElement("div");
          xe.innerHTML = "<script><\/script>";
          var Je = xe.firstChild;
          le = xe.removeChild(Je);
        } else if (typeof X.is == "string")
          le = ie.createElement(h, {
            is: X.is
          });
        else if (le = ie.createElement(h), h === "select") {
          var _e = le;
          X.multiple ? _e.multiple = !0 : X.size && (_e.size = X.size);
        }
      } else
        le = ie.createElementNS(He, h);
      return He === t1 && !Q && Object.prototype.toString.call(le) === "[object HTMLUnknownElement]" && !be.call(_q, h) && (_q[h] = !0, s("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", h)), le;
    }
    function $D(h, X) {
      return eb(X).createTextNode(h);
    }
    function aB(h, X, W, V) {
      var Q = rt(X, W);
      M4(X, W);
      var ie;
      switch (X) {
        case "dialog":
          ko("cancel", h), ko("close", h), ie = W;
          break;
        case "iframe":
        case "object":
        case "embed":
          ko("load", h), ie = W;
          break;
        case "video":
        case "audio":
          for (var le = 0; le < x3.length; le++)
            ko(x3[le], h);
          ie = W;
          break;
        case "source":
          ko("error", h), ie = W;
          break;
        case "img":
        case "image":
        case "link":
          ko("error", h), ko("load", h), ie = W;
          break;
        case "details":
          ko("toggle", h), ie = W;
          break;
        case "input":
          dt(h, W), ie = je(h, W), ko("invalid", h);
          break;
        case "option":
          ws(h, W), ie = W;
          break;
        case "select":
          Jv(h, W), ie = ld(h, W), ko("invalid", h);
          break;
        case "textarea":
          eP(h, W), ie = _d(h, W), ko("invalid", h);
          break;
        default:
          ie = W;
      }
      switch (ze(X, ie), iB(X, h, V, ie, Q), X) {
        case "input":
          qi(h), Cr(h, W, !1);
          break;
        case "textarea":
          qi(h), Nu(h);
          break;
        case "option":
          Zs(h, W);
          break;
        case "select":
          zv(h, W);
          break;
        default:
          typeof ie.onClick == "function" && R7(h);
          break;
      }
    }
    function ej(h, X, W, V, Q) {
      M4(X, V);
      var ie = null, le, He;
      switch (X) {
        case "input":
          le = je(h, W), He = je(h, V), ie = [];
          break;
        case "select":
          le = ld(h, W), He = ld(h, V), ie = [];
          break;
        case "textarea":
          le = _d(h, W), He = _d(h, V), ie = [];
          break;
        default:
          le = W, He = V, typeof le.onClick != "function" && typeof He.onClick == "function" && R7(h);
          break;
      }
      ze(X, He);
      var xe, Je, _e = null;
      for (xe in le)
        if (!(He.hasOwnProperty(xe) || !le.hasOwnProperty(xe) || le[xe] == null))
          if (xe === Th) {
            var qt = le[xe];
            for (Je in qt)
              qt.hasOwnProperty(Je) && (_e || (_e = {}), _e[Je] = "");
          } else
            xe === sX || xe === Xh || xe === aX || xe === D3 || xe === zD || (ne.hasOwnProperty(xe) ? ie || (ie = []) : (ie = ie || []).push(xe, null));
      for (xe in He) {
        var Ht = He[xe], Mt = le != null ? le[xe] : void 0;
        if (!(!He.hasOwnProperty(xe) || Ht === Mt || Ht == null && Mt == null))
          if (xe === Th)
            if (Ht && Object.freeze(Ht), Mt) {
              for (Je in Mt)
                Mt.hasOwnProperty(Je) && (!Ht || !Ht.hasOwnProperty(Je)) && (_e || (_e = {}), _e[Je] = "");
              for (Je in Ht)
                Ht.hasOwnProperty(Je) && Mt[Je] !== Ht[Je] && (_e || (_e = {}), _e[Je] = Ht[Je]);
            } else
              _e || (ie || (ie = []), ie.push(xe, _e)), _e = Ht;
          else if (xe === sX) {
            var Lt = Ht ? Ht[U7] : void 0, or = Mt ? Mt[U7] : void 0;
            Lt != null && or !== Lt && (ie = ie || []).push(xe, Lt);
          } else
            xe === Xh ? (typeof Ht == "string" || typeof Ht == "number") && (ie = ie || []).push(xe, "" + Ht) : xe === aX || xe === D3 || (ne.hasOwnProperty(xe) ? (Ht != null && (typeof Ht != "function" && qh(xe, Ht), xe === "onScroll" && ko("scroll", h)), !ie && Mt !== Ht && (ie = [])) : (ie = ie || []).push(xe, Ht));
      }
      return _e && (yA(_e, He[Th]), (ie = ie || []).push(Th, _e)), ie;
    }
    function oB(h, X, W, V, Q) {
      W === "input" && Q.type === "radio" && Q.name != null && kt(h, Q);
      var ie = rt(W, V), le = rt(W, Q);
      switch (_D(h, X, ie, le), W) {
        case "input":
          _t(h, Q);
          break;
        case "textarea":
          J0(h, Q);
          break;
        case "select":
          Wc(h, Q);
          break;
      }
    }
    function fB(h) {
      {
        var X = h.toLowerCase();
        return vt.hasOwnProperty(X) && vt[X] || null;
      }
    }
    function tj(h, X, W, V, Q, ie, le) {
      var He, xe;
      switch (He = rt(X, W), M4(X, W), X) {
        case "dialog":
          ko("cancel", h), ko("close", h);
          break;
        case "iframe":
        case "object":
        case "embed":
          ko("load", h);
          break;
        case "video":
        case "audio":
          for (var Je = 0; Je < x3.length; Je++)
            ko(x3[Je], h);
          break;
        case "source":
          ko("error", h);
          break;
        case "img":
        case "image":
        case "link":
          ko("error", h), ko("load", h);
          break;
        case "details":
          ko("toggle", h);
          break;
        case "input":
          dt(h, W), ko("invalid", h);
          break;
        case "option":
          ws(h, W);
          break;
        case "select":
          Jv(h, W), ko("invalid", h);
          break;
        case "textarea":
          eP(h, W), ko("invalid", h);
          break;
      }
      ze(X, W);
      {
        xe = /* @__PURE__ */ new Set();
        for (var _e = h.attributes, qt = 0; qt < _e.length; qt++) {
          var Ht = _e[qt].name.toLowerCase();
          switch (Ht) {
            case "value":
              break;
            case "checked":
              break;
            case "selected":
              break;
            default:
              xe.add(_e[qt].name);
          }
        }
      }
      var Mt = null;
      for (var Lt in W)
        if (W.hasOwnProperty(Lt)) {
          var or = W[Lt];
          if (Lt === Xh)
            typeof or == "string" ? h.textContent !== or && (W[D3] !== !0 && j3(h.textContent, or, ie, le), Mt = [Xh, or]) : typeof or == "number" && h.textContent !== "" + or && (W[D3] !== !0 && j3(h.textContent, or, ie, le), Mt = [Xh, "" + or]);
          else if (ne.hasOwnProperty(Lt))
            or != null && (typeof or != "function" && qh(Lt, or), Lt === "onScroll" && ko("scroll", h));
          else if (le && // Convince Flow we've calculated it (it's DEV-only in this method.)
          typeof He == "boolean") {
            var yn = void 0, hi = He && ae ? null : Sr(Lt);
            if (W[D3] !== !0) {
              if (!(Lt === aX || Lt === D3 || // Controlled attributes are not validated
              // TODO: Only ignore them on controlled tags.
              Lt === "value" || Lt === "checked" || Lt === "selected")) {
                if (Lt === sX) {
                  var Pi = h.innerHTML, Ks = or ? or[U7] : void 0;
                  if (Ks != null) {
                    var Is = $q(h, Ks);
                    Is !== Pi && I7(Lt, Pi, Is);
                  }
                } else if (Lt === Th) {
                  if (xe.delete(Lt), ZD) {
                    var Vt = Rp(or);
                    yn = h.getAttribute("style"), Vt !== yn && I7(Lt, yn, Vt);
                  }
                } else if (He && !ae)
                  xe.delete(Lt.toLowerCase()), yn = _i(h, Lt, or), or !== yn && I7(Lt, yn, or);
                else if (!an(Lt, hi, He) && !rr(Lt, or, hi, He)) {
                  var fr = !1;
                  if (hi !== null)
                    xe.delete(hi.attributeName), yn = ji(h, Lt, or, hi);
                  else {
                    var Ct = V;
                    if (Ct === t1 && (Ct = fA(X)), Ct === t1)
                      xe.delete(Lt.toLowerCase());
                    else {
                      var Nr = fB(Lt);
                      Nr !== null && Nr !== Lt && (fr = !0, xe.delete(Nr)), xe.delete(Lt);
                    }
                    yn = _i(h, Lt, or);
                  }
                  var kn = ae;
                  !kn && or !== yn && !fr && I7(Lt, yn, or);
                }
              }
            }
          }
        }
      switch (le && // $FlowFixMe - Should be inferred as not undefined.
      xe.size > 0 && W[D3] !== !0 && GD(xe), X) {
        case "input":
          qi(h), Cr(h, W, !0);
          break;
        case "textarea":
          qi(h), Nu(h);
          break;
        case "select":
        case "option":
          break;
        default:
          typeof W.onClick == "function" && R7(h);
          break;
      }
      return Mt;
    }
    function AB(h, X, W) {
      var V = h.nodeValue !== X;
      return V;
    }
    function tb(h, X) {
      {
        if (HA)
          return;
        HA = !0, s("Did not expect server HTML to contain a <%s> in <%s>.", X.nodeName.toLowerCase(), h.nodeName.toLowerCase());
      }
    }
    function rb(h, X) {
      {
        if (HA)
          return;
        HA = !0, s('Did not expect server HTML to contain the text node "%s" in <%s>.', X.nodeValue, h.nodeName.toLowerCase());
      }
    }
    function fX(h, X, W) {
      {
        if (HA)
          return;
        HA = !0, s("Expected server HTML to contain a matching <%s> in <%s>.", X, h.nodeName.toLowerCase());
      }
    }
    function nb(h, X) {
      {
        if (X === "" || HA)
          return;
        HA = !0, s('Expected server HTML to contain a matching text node for "%s" in <%s>.', X, h.nodeName.toLowerCase());
      }
    }
    function dB(h, X, W) {
      switch (X) {
        case "input":
          fi(h, W);
          return;
        case "textarea":
          Uc(h, W);
          return;
        case "select":
          Sc(h, W);
          return;
      }
    }
    var AX = function() {
    }, dX = function() {
    };
    {
      var vB = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"], V7 = [
        "applet",
        "caption",
        "html",
        "table",
        "td",
        "th",
        "marquee",
        "object",
        "template",
        // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
        // TODO: Distinguish by namespace here -- for <title>, including it here
        // errs on the side of fewer warnings
        "foreignObject",
        "desc",
        "title"
      ], vX = V7.concat(["button"]), ib = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"], C7 = {
        current: null,
        formTag: null,
        aTagInScope: null,
        buttonTagInScope: null,
        nobrTagInScope: null,
        pTagInButtonScope: null,
        listItemTagAutoclosing: null,
        dlItemTagAutoclosing: null
      };
      dX = function(h, X) {
        var W = di({}, h || C7), V = {
          tag: X
        };
        return V7.indexOf(X) !== -1 && (W.aTagInScope = null, W.buttonTagInScope = null, W.nobrTagInScope = null), vX.indexOf(X) !== -1 && (W.pTagInButtonScope = null), vB.indexOf(X) !== -1 && X !== "address" && X !== "div" && X !== "p" && (W.listItemTagAutoclosing = null, W.dlItemTagAutoclosing = null), W.current = V, X === "form" && (W.formTag = V), X === "a" && (W.aTagInScope = V), X === "button" && (W.buttonTagInScope = V), X === "nobr" && (W.nobrTagInScope = V), X === "p" && (W.pTagInButtonScope = V), X === "li" && (W.listItemTagAutoclosing = V), (X === "dd" || X === "dt") && (W.dlItemTagAutoclosing = V), W;
      };
      var rj = function(h, X) {
        switch (X) {
          case "select":
            return h === "option" || h === "optgroup" || h === "#text";
          case "optgroup":
            return h === "option" || h === "#text";
          case "option":
            return h === "#text";
          case "tr":
            return h === "th" || h === "td" || h === "style" || h === "script" || h === "template";
          case "tbody":
          case "thead":
          case "tfoot":
            return h === "tr" || h === "style" || h === "script" || h === "template";
          case "colgroup":
            return h === "col" || h === "template";
          case "table":
            return h === "caption" || h === "colgroup" || h === "tbody" || h === "tfoot" || h === "thead" || h === "style" || h === "script" || h === "template";
          case "head":
            return h === "base" || h === "basefont" || h === "bgsound" || h === "link" || h === "meta" || h === "title" || h === "noscript" || h === "noframes" || h === "style" || h === "script" || h === "template";
          case "html":
            return h === "head" || h === "body" || h === "frameset";
          case "frameset":
            return h === "frame";
          case "#document":
            return h === "html";
        }
        switch (h) {
          case "h1":
          case "h2":
          case "h3":
          case "h4":
          case "h5":
          case "h6":
            return X !== "h1" && X !== "h2" && X !== "h3" && X !== "h4" && X !== "h5" && X !== "h6";
          case "rp":
          case "rt":
            return ib.indexOf(X) === -1;
          case "body":
          case "caption":
          case "col":
          case "colgroup":
          case "frameset":
          case "frame":
          case "head":
          case "html":
          case "tbody":
          case "td":
          case "tfoot":
          case "th":
          case "thead":
          case "tr":
            return X == null;
        }
        return !0;
      }, L4 = function(h, X) {
        switch (h) {
          case "address":
          case "article":
          case "aside":
          case "blockquote":
          case "center":
          case "details":
          case "dialog":
          case "dir":
          case "div":
          case "dl":
          case "fieldset":
          case "figcaption":
          case "figure":
          case "footer":
          case "header":
          case "hgroup":
          case "main":
          case "menu":
          case "nav":
          case "ol":
          case "p":
          case "section":
          case "summary":
          case "ul":
          case "pre":
          case "listing":
          case "table":
          case "hr":
          case "xmp":
          case "h1":
          case "h2":
          case "h3":
          case "h4":
          case "h5":
          case "h6":
            return X.pTagInButtonScope;
          case "form":
            return X.formTag || X.pTagInButtonScope;
          case "li":
            return X.listItemTagAutoclosing;
          case "dd":
          case "dt":
            return X.dlItemTagAutoclosing;
          case "button":
            return X.buttonTagInScope;
          case "a":
            return X.aTagInScope;
          case "nobr":
            return X.nobrTagInScope;
        }
        return null;
      }, nj = {};
      AX = function(h, X, W) {
        W = W || C7;
        var V = W.current, Q = V && V.tag;
        X != null && (h != null && s("validateDOMNesting: when childText is passed, childTag should be null"), h = "#text");
        var ie = rj(h, Q) ? null : V, le = ie ? null : L4(h, W), He = ie || le;
        if (He) {
          var xe = He.tag, Je = !!ie + "|" + h + "|" + xe;
          if (!nj[Je]) {
            nj[Je] = !0;
            var _e = h, qt = "";
            if (h === "#text" ? /\S/.test(X) ? _e = "Text nodes" : (_e = "Whitespace text nodes", qt = " Make sure you don't have any extra whitespace between tags on each line of your source code.") : _e = "<" + h + ">", ie) {
              var Ht = "";
              xe === "table" && h === "tr" && (Ht += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."), s("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", _e, xe, qt, Ht);
            } else
              s("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", _e, xe);
          }
        }
      };
    }
    var uX = "suppressHydrationWarning", bh = "$", ll = "/$", xd = "$?", Pl = "$!", lX = "style", PX = null, K4 = null;
    function sb(h) {
      var X, W, V = h.nodeType;
      switch (V) {
        case C6:
        case Zv: {
          X = V === C6 ? "#document" : "#fragment";
          var Q = h.documentElement;
          W = Q ? Q.namespaceURI : tP(null, "");
          break;
        }
        default: {
          var ie = V === Xo ? h.parentNode : h, le = ie.namespaceURI || null;
          X = ie.tagName, W = tP(le, X);
          break;
        }
      }
      {
        var He = X.toLowerCase(), xe = dX(null, He);
        return {
          namespace: W,
          ancestorInfo: xe
        };
      }
    }
    function ij(h, X, W) {
      {
        var V = h, Q = tP(V.namespace, X), ie = dX(V.ancestorInfo, X);
        return {
          namespace: Q,
          ancestorInfo: ie
        };
      }
    }
    function ab(h) {
      return h;
    }
    function hu(h) {
      PX = o6(), K4 = Jm();
      var X = null;
      return of(!1), X;
    }
    function ob(h) {
      zm(K4), of(PX), PX = null, K4 = null;
    }
    function J4(h, X, W, V, Q) {
      var ie;
      {
        var le = V;
        if (AX(h, null, le.ancestorInfo), typeof X.children == "string" || typeof X.children == "number") {
          var He = "" + X.children, xe = dX(le.ancestorInfo, h);
          AX(null, He, xe);
        }
        ie = le.namespace;
      }
      var Je = sB(h, X, W, ie);
      return Xu(Q, Je), RP(Je, X), Je;
    }
    function WP(h, X) {
      h.appendChild(X);
    }
    function w3(h, X, W, V, Q) {
      switch (aB(h, X, W, V), X) {
        case "button":
        case "input":
        case "select":
        case "textarea":
          return !!W.autoFocus;
        case "img":
          return !0;
        default:
          return !1;
      }
    }
    function Q6(h, X, W, V, Q, ie) {
      {
        var le = ie;
        if (typeof V.children != typeof W.children && (typeof V.children == "string" || typeof V.children == "number")) {
          var He = "" + V.children, xe = dX(le.ancestorInfo, X);
          AX(null, He, xe);
        }
      }
      return ej(h, X, W, V);
    }
    function t9(h, X) {
      return h === "textarea" || h === "noscript" || typeof X.children == "string" || typeof X.children == "number" || typeof X.dangerouslySetInnerHTML == "object" && X.dangerouslySetInnerHTML !== null && X.dangerouslySetInnerHTML.__html != null;
    }
    function fb(h, X, W, V) {
      {
        var Q = W;
        AX(null, h, Q.ancestorInfo);
      }
      var ie = $D(h, X);
      return Xu(V, ie), ie;
    }
    function Dd() {
      var h = window.event;
      return h === void 0 ? Au : f6(h.type);
    }
    var Hu = typeof setTimeout == "function" ? setTimeout : void 0, gu = typeof clearTimeout == "function" ? clearTimeout : void 0, cX = -1, m3 = typeof Promise == "function" ? Promise : void 0, sj = typeof queueMicrotask == "function" ? queueMicrotask : typeof m3 < "u" ? function(h) {
      return m3.resolve(null).then(h).catch(O7);
    } : Hu;
    function O7(h) {
      setTimeout(function() {
        throw h;
      });
    }
    function z4(h, X, W, V) {
      switch (X) {
        case "button":
        case "input":
        case "select":
        case "textarea":
          W.autoFocus && h.focus();
          return;
        case "img": {
          W.src && (h.src = W.src);
          return;
        }
      }
    }
    function cl(h, X, W, V, Q, ie) {
      oB(h, X, W, V, Q), RP(h, Q);
    }
    function y7(h) {
      nP(h, "");
    }
    function Ab(h, X, W) {
      h.nodeValue = W;
    }
    function db(h, X) {
      h.appendChild(X);
    }
    function aj(h, X) {
      var W;
      h.nodeType === Xo ? (W = h.parentNode, W.insertBefore(X, h)) : (W = h, W.appendChild(X));
      var V = h._reactRootContainer;
      V == null && W.onclick === null && R7(W);
    }
    function G4(h, X, W) {
      h.insertBefore(X, W);
    }
    function oj(h, X, W) {
      h.nodeType === Xo ? h.parentNode.insertBefore(X, W) : h.insertBefore(X, W);
    }
    function fj(h, X) {
      h.removeChild(X);
    }
    function vb(h, X) {
      h.nodeType === Xo ? h.parentNode.removeChild(X) : h.removeChild(X);
    }
    function k7(h, X) {
      var W = X, V = 0;
      do {
        var Q = W.nextSibling;
        if (h.removeChild(W), Q && Q.nodeType === Xo) {
          var ie = Q.data;
          if (ie === ll)
            if (V === 0) {
              h.removeChild(Q), bs(X);
              return;
            } else
              V--;
          else
            (ie === bh || ie === xd || ie === Pl) && V++;
        }
        W = Q;
      } while (W);
      bs(X);
    }
    function Aj(h, X) {
      h.nodeType === Xo ? k7(h.parentNode, X) : h.nodeType === Kf && k7(h, X), bs(h);
    }
    function Z4(h) {
      h = h;
      var X = h.style;
      typeof X.setProperty == "function" ? X.setProperty("display", "none", "important") : X.display = "none";
    }
    function pl(h) {
      h.nodeValue = "";
    }
    function xh(h, X) {
      h = h;
      var W = X[lX], V = W != null && W.hasOwnProperty("display") ? W.display : null;
      h.style.display = iP("display", V);
    }
    function uB(h, X) {
      h.nodeValue = X;
    }
    function lB(h) {
      h.nodeType === Kf ? h.textContent = "" : h.nodeType === C6 && h.documentElement && h.removeChild(h.documentElement);
    }
    function PB(h, X, W) {
      return h.nodeType !== Kf || X.toLowerCase() !== h.nodeName.toLowerCase() ? null : h;
    }
    function cB(h, X) {
      return X === "" || h.nodeType !== cd ? null : h;
    }
    function dj(h) {
      return h.nodeType !== Xo ? null : h;
    }
    function vj(h) {
      return h.data === xd;
    }
    function pX(h) {
      return h.data === Pl;
    }
    function uj(h) {
      var X = h.nextSibling && h.nextSibling.dataset, W, V, Q;
      return X && (W = X.dgst, V = X.msg, Q = X.stck), {
        message: V,
        digest: W,
        stack: Q
      };
    }
    function pB(h, X) {
      h._reactRetry = X;
    }
    function E7(h) {
      for (; h != null; h = h.nextSibling) {
        var X = h.nodeType;
        if (X === Kf || X === cd)
          break;
        if (X === Xo) {
          var W = h.data;
          if (W === bh || W === Pl || W === xd)
            break;
          if (W === ll)
            return null;
        }
      }
      return h;
    }
    function Dh(h) {
      return E7(h.nextSibling);
    }
    function hB(h) {
      return E7(h.firstChild);
    }
    function _4(h) {
      return E7(h.firstChild);
    }
    function lj(h) {
      return E7(h.nextSibling);
    }
    function Pj(h, X, W, V, Q, ie, le) {
      Xu(ie, h), RP(h, W);
      var He;
      {
        var xe = Q;
        He = xe.namespace;
      }
      var Je = (ie.mode & Ki) !== Di;
      return tj(h, X, W, He, V, Je, le);
    }
    function ub(h, X, W, V) {
      return Xu(W, h), W.mode & Ki, AB(h, X);
    }
    function cj(h, X) {
      Xu(X, h);
    }
    function pj(h) {
      for (var X = h.nextSibling, W = 0; X; ) {
        if (X.nodeType === Xo) {
          var V = X.data;
          if (V === ll) {
            if (W === 0)
              return Dh(X);
            W--;
          } else
            (V === bh || V === Pl || V === xd) && W++;
        }
        X = X.nextSibling;
      }
      return null;
    }
    function GA(h) {
      for (var X = h.previousSibling, W = 0; X; ) {
        if (X.nodeType === Xo) {
          var V = X.data;
          if (V === bh || V === Pl || V === xd) {
            if (W === 0)
              return X;
            W--;
          } else
            V === ll && W++;
        }
        X = X.previousSibling;
      }
      return null;
    }
    function jh(h) {
      bs(h);
    }
    function SP(h) {
      bs(h);
    }
    function hj(h) {
      return h !== "head" && h !== "body";
    }
    function lb(h, X, W, V) {
      var Q = !0;
      j3(X.nodeValue, W, V, Q);
    }
    function Pb(h, X, W, V, Q, ie) {
      if (X[uX] !== !0) {
        var le = !0;
        j3(V.nodeValue, Q, ie, le);
      }
    }
    function HB(h, X) {
      X.nodeType === Kf ? tb(h, X) : X.nodeType === Xo || rb(h, X);
    }
    function cb(h, X) {
      {
        var W = h.parentNode;
        W !== null && (X.nodeType === Kf ? tb(W, X) : X.nodeType === Xo || rb(W, X));
      }
    }
    function UP(h, X, W, V, Q) {
      (Q || X[uX] !== !0) && (V.nodeType === Kf ? tb(W, V) : V.nodeType === Xo || rb(W, V));
    }
    function $4(h, X, W) {
      fX(h, X);
    }
    function pb(h, X) {
      nb(h, X);
    }
    function Hj(h, X, W) {
      {
        var V = h.parentNode;
        V !== null && fX(V, X);
      }
    }
    function Y6(h, X) {
      {
        var W = h.parentNode;
        W !== null && nb(W, X);
      }
    }
    function F7(h, X, W, V, Q, ie) {
      (ie || X[uX] !== !0) && fX(W, V);
    }
    function gj(h, X, W, V, Q) {
      (Q || X[uX] !== !0) && nb(W, V);
    }
    function B3(h) {
      s("An error occurred during hydration. The server HTML was replaced with client content in <%s>.", h.nodeName.toLowerCase());
    }
    function W3(h) {
      rX(h);
    }
    var N7 = Math.random().toString(36).slice(2), S3 = "__reactFiber$" + N7, Hv = "__reactProps$" + N7, Q7 = "__reactContainer$" + N7, eT = "__reactEvents$" + N7, s1 = "__reactListeners$" + N7, E1 = "__reactHandles$" + N7;
    function ZA(h) {
      delete h[S3], delete h[Hv], delete h[eT], delete h[s1], delete h[E1];
    }
    function Xu(h, X) {
      X[S3] = h;
    }
    function v6(h, X) {
      X[Q7] = h;
    }
    function Xj(h) {
      h[Q7] = null;
    }
    function hX(h) {
      return !!h[Q7];
    }
    function wh(h) {
      var X = h[S3];
      if (X)
        return X;
      for (var W = h.parentNode; W; ) {
        if (X = W[Q7] || W[S3], X) {
          var V = X.alternate;
          if (X.child !== null || V !== null && V.child !== null)
            for (var Q = GA(h); Q !== null; ) {
              var ie = Q[S3];
              if (ie)
                return ie;
              Q = GA(Q);
            }
          return X;
        }
        h = W, W = h.parentNode;
      }
      return null;
    }
    function IP(h) {
      var X = h[S3] || h[Q7];
      return X && (X.tag === l || X.tag === P || X.tag === j || X.tag === v) ? X : null;
    }
    function M6(h) {
      if (h.tag === l || h.tag === P)
        return h.stateNode;
      throw new Error("getNodeFromInstance: Invalid argument.");
    }
    function tT(h) {
      return h[Hv] || null;
    }
    function RP(h, X) {
      h[Hv] = X;
    }
    function mh(h) {
      var X = h[eT];
      return X === void 0 && (X = h[eT] = /* @__PURE__ */ new Set()), X;
    }
    var Y7 = {}, M7 = t.ReactDebugCurrentFrame;
    function U3(h) {
      if (h) {
        var X = h._owner, W = Zr(h.type, h._source, X ? X.type : null);
        M7.setExtraStackFrame(W);
      } else
        M7.setExtraStackFrame(null);
    }
    function L6(h, X, W, V, Q) {
      {
        var ie = Function.call.bind(be);
        for (var le in h)
          if (ie(h, le)) {
            var He = void 0;
            try {
              if (typeof h[le] != "function") {
                var xe = Error((V || "React class") + ": " + W + " type `" + le + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[le] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                throw xe.name = "Invariant Violation", xe;
              }
              He = h[le](X, le, V, W, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
            } catch (Je) {
              He = Je;
            }
            He && !(He instanceof Error) && (U3(Q), s("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", V || "React class", W, le, typeof He), U3(null)), He instanceof Error && !(He.message in Y7) && (Y7[He.message] = !0, U3(Q), s("Failed %s type: %s", W, He.message), U3(null));
          }
      }
    }
    var Bh = [], hl;
    hl = [];
    var jd = -1;
    function VP(h) {
      return {
        current: h
      };
    }
    function xo(h, X) {
      if (jd < 0) {
        s("Unexpected pop.");
        return;
      }
      X !== hl[jd] && s("Unexpected Fiber popped."), h.current = Bh[jd], Bh[jd] = null, hl[jd] = null, jd--;
    }
    function Rf(h, X, W) {
      jd++, Bh[jd] = h.current, hl[jd] = W, h.current = X;
    }
    var HX;
    HX = {};
    var gA = {};
    Object.freeze(gA);
    var gv = VP(gA), K6 = VP(!1), L7 = gA;
    function CP(h, X, W) {
      return W && Xv(X) ? L7 : gv.current;
    }
    function gX(h, X, W) {
      {
        var V = h.stateNode;
        V.__reactInternalMemoizedUnmaskedChildContext = X, V.__reactInternalMemoizedMaskedChildContext = W;
      }
    }
    function Wh(h, X) {
      {
        var W = h.type, V = W.contextTypes;
        if (!V)
          return gA;
        var Q = h.stateNode;
        if (Q && Q.__reactInternalMemoizedUnmaskedChildContext === X)
          return Q.__reactInternalMemoizedMaskedChildContext;
        var ie = {};
        for (var le in V)
          ie[le] = X[le];
        {
          var He = Fn(h) || "Unknown";
          L6(V, ie, "context", He);
        }
        return Q && gX(h, X, ie), ie;
      }
    }
    function XX() {
      return K6.current;
    }
    function Xv(h) {
      {
        var X = h.childContextTypes;
        return X != null;
      }
    }
    function K7(h) {
      xo(K6, h), xo(gv, h);
    }
    function hb(h) {
      xo(K6, h), xo(gv, h);
    }
    function Hb(h, X, W) {
      {
        if (gv.current !== gA)
          throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
        Rf(gv, X, h), Rf(K6, W, h);
      }
    }
    function Tj(h, X, W) {
      {
        var V = h.stateNode, Q = X.childContextTypes;
        if (typeof V.getChildContext != "function") {
          {
            var ie = Fn(h) || "Unknown";
            HX[ie] || (HX[ie] = !0, s("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", ie, ie));
          }
          return W;
        }
        var le = V.getChildContext();
        for (var He in le)
          if (!(He in Q))
            throw new Error((Fn(h) || "Unknown") + '.getChildContext(): key "' + He + '" is not defined in childContextTypes.');
        {
          var xe = Fn(h) || "Unknown";
          L6(Q, le, "child context", xe);
        }
        return di({}, W, le);
      }
    }
    function OP(h) {
      {
        var X = h.stateNode, W = X && X.__reactInternalMemoizedMergedChildContext || gA;
        return L7 = gv.current, Rf(gv, W, h), Rf(K6, K6.current, h), !0;
      }
    }
    function F1(h, X, W) {
      {
        var V = h.stateNode;
        if (!V)
          throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
        if (W) {
          var Q = Tj(h, X, L7);
          V.__reactInternalMemoizedMergedChildContext = Q, xo(K6, h), xo(gv, h), Rf(gv, Q, h), Rf(K6, W, h);
        } else
          xo(K6, h), Rf(K6, W, h);
      }
    }
    function qj(h) {
      {
        if (!jg(h) || h.tag !== o)
          throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
        var X = h;
        do {
          switch (X.tag) {
            case v:
              return X.stateNode.context;
            case o: {
              var W = X.type;
              if (Xv(W))
                return X.stateNode.__reactInternalMemoizedMergedChildContext;
              break;
            }
          }
          X = X.return;
        } while (X !== null);
        throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
      }
    }
    var yP = 0, Sh = 1, Tv = null, J7 = !1, z7 = !1;
    function TX(h) {
      Tv === null ? Tv = [h] : Tv.push(h);
    }
    function gb(h) {
      J7 = !0, TX(h);
    }
    function rT() {
      J7 && XA();
    }
    function XA() {
      if (!z7 && Tv !== null) {
        z7 = !0;
        var h = 0, X = a6();
        try {
          var W = !0, V = Tv;
          for (Co(H1); h < V.length; h++) {
            var Q = V[h];
            do
              Q = Q(W);
            while (Q !== null);
          }
          Tv = null, J7 = !1;
        } catch (ie) {
          throw Tv !== null && (Tv = Tv.slice(h + 1)), eu(Op, XA), ie;
        } finally {
          Co(X), z7 = !1;
        }
      }
      return null;
    }
    var wd = [], I3 = 0, nT = null, R3 = 0, qv = [], J6 = 0, Hl = null, gl = 1, Tu = "";
    function gB(h) {
      return EP(), (h.flags & i7) !== fn;
    }
    function bj(h) {
      return EP(), R3;
    }
    function Xb() {
      var h = Tu, X = gl, W = X & ~xj(X);
      return W.toString(32) + h;
    }
    function kP(h, X) {
      EP(), wd[I3++] = R3, wd[I3++] = nT, nT = h, R3 = X;
    }
    function iT(h, X, W) {
      EP(), qv[J6++] = gl, qv[J6++] = Tu, qv[J6++] = Hl, Hl = h;
      var V = gl, Q = Tu, ie = G7(V) - 1, le = V & ~(1 << ie), He = W + 1, xe = G7(X) + ie;
      if (xe > 30) {
        var Je = ie - ie % 5, _e = (1 << Je) - 1, qt = (le & _e).toString(32), Ht = le >> Je, Mt = ie - Je, Lt = G7(X) + Mt, or = He << Mt, yn = or | Ht, hi = qt + Q;
        gl = 1 << Lt | yn, Tu = hi;
      } else {
        var Pi = He << ie, Ks = Pi | le, Is = Q;
        gl = 1 << xe | Ks, Tu = Is;
      }
    }
    function qX(h) {
      EP();
      var X = h.return;
      if (X !== null) {
        var W = 1, V = 0;
        kP(h, W), iT(h, W, V);
      }
    }
    function G7(h) {
      return 32 - Zc(h);
    }
    function xj(h) {
      return 1 << G7(h) - 1;
    }
    function Z7(h) {
      for (; h === nT; )
        nT = wd[--I3], wd[I3] = null, R3 = wd[--I3], wd[I3] = null;
      for (; h === Hl; )
        Hl = qv[--J6], qv[J6] = null, Tu = qv[--J6], qv[J6] = null, gl = qv[--J6], qv[J6] = null;
    }
    function sT() {
      return EP(), Hl !== null ? {
        id: gl,
        overflow: Tu
      } : null;
    }
    function Tb(h, X) {
      EP(), qv[J6++] = gl, qv[J6++] = Tu, qv[J6++] = Hl, gl = X.id, Tu = X.overflow, Hl = h;
    }
    function EP() {
      a1() || s("Expected to be hydrating. This is a bug in React. Please file an issue.");
    }
    var r9 = null, TA = null, md = !1, V3 = !1, C3 = null;
    function Dj() {
      md && s("We should not be hydrating here. This is a bug in React. Please file a bug.");
    }
    function aT() {
      V3 = !0;
    }
    function XB() {
      return V3;
    }
    function jj(h) {
      var X = h.stateNode.containerInfo;
      return TA = _4(X), r9 = h, md = !0, C3 = null, V3 = !1, !0;
    }
    function oT(h, X, W) {
      return TA = lj(X), r9 = h, md = !0, C3 = null, V3 = !1, W !== null && Tb(h, W), !0;
    }
    function wj(h, X) {
      switch (h.tag) {
        case v: {
          HB(h.stateNode.containerInfo, X);
          break;
        }
        case l: {
          var W = (h.mode & Ki) !== Di;
          UP(
            h.type,
            h.memoizedProps,
            h.stateNode,
            X,
            // TODO: Delete this argument when we remove the legacy root API.
            W
          );
          break;
        }
        case j: {
          var V = h.memoizedState;
          V.dehydrated !== null && cb(V.dehydrated, X);
          break;
        }
      }
    }
    function qb(h, X) {
      wj(h, X);
      var W = IV();
      W.stateNode = X, W.return = h;
      var V = h.deletions;
      V === null ? (h.deletions = [W], h.flags |= _s) : V.push(W);
    }
    function bX(h, X) {
      {
        if (V3)
          return;
        switch (h.tag) {
          case v: {
            var W = h.stateNode.containerInfo;
            switch (X.tag) {
              case l:
                var V = X.type;
                X.pendingProps, $4(W, V);
                break;
              case P:
                var Q = X.pendingProps;
                pb(W, Q);
                break;
            }
            break;
          }
          case l: {
            var ie = h.type, le = h.memoizedProps, He = h.stateNode;
            switch (X.tag) {
              case l: {
                var xe = X.type, Je = X.pendingProps, _e = (h.mode & Ki) !== Di;
                F7(
                  ie,
                  le,
                  He,
                  xe,
                  Je,
                  // TODO: Delete this argument when we remove the legacy root API.
                  _e
                );
                break;
              }
              case P: {
                var qt = X.pendingProps, Ht = (h.mode & Ki) !== Di;
                gj(
                  ie,
                  le,
                  He,
                  qt,
                  // TODO: Delete this argument when we remove the legacy root API.
                  Ht
                );
                break;
              }
            }
            break;
          }
          case j: {
            var Mt = h.memoizedState, Lt = Mt.dehydrated;
            if (Lt !== null)
              switch (X.tag) {
                case l:
                  var or = X.type;
                  X.pendingProps, Hj(Lt, or);
                  break;
                case P:
                  var yn = X.pendingProps;
                  Y6(Lt, yn);
                  break;
              }
            break;
          }
          default:
            return;
        }
      }
    }
    function xX(h, X) {
      X.flags = X.flags & ~NA | Ms, bX(h, X);
    }
    function fT(h, X) {
      switch (h.tag) {
        case l: {
          var W = h.type;
          h.pendingProps;
          var V = PB(X, W);
          return V !== null ? (h.stateNode = V, r9 = h, TA = hB(V), !0) : !1;
        }
        case P: {
          var Q = h.pendingProps, ie = cB(X, Q);
          return ie !== null ? (h.stateNode = ie, r9 = h, TA = null, !0) : !1;
        }
        case j: {
          var le = dj(X);
          if (le !== null) {
            var He = {
              dehydrated: le,
              treeContext: sT(),
              retryLane: s6
            };
            h.memoizedState = He;
            var xe = aW(le);
            return xe.return = h, h.child = xe, r9 = h, TA = null, !0;
          }
          return !1;
        }
        default:
          return !1;
      }
    }
    function DX(h) {
      return (h.mode & Ki) !== Di && (h.flags & xi) === fn;
    }
    function jX(h) {
      throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.");
    }
    function AT(h) {
      if (md) {
        var X = TA;
        if (!X) {
          DX(h) && (bX(r9, h), jX()), xX(r9, h), md = !1, r9 = h;
          return;
        }
        var W = X;
        if (!fT(h, X)) {
          DX(h) && (bX(r9, h), jX()), X = Dh(W);
          var V = r9;
          if (!X || !fT(h, X)) {
            xX(r9, h), md = !1, r9 = h;
            return;
          }
          qb(V, W);
        }
      }
    }
    function dT(h, X, W) {
      var V = h.stateNode, Q = !V3, ie = Pj(V, h.type, h.memoizedProps, X, W, h, Q);
      return h.updateQueue = ie, ie !== null;
    }
    function _7(h) {
      var X = h.stateNode, W = h.memoizedProps, V = ub(X, W, h);
      if (V) {
        var Q = r9;
        if (Q !== null)
          switch (Q.tag) {
            case v: {
              var ie = Q.stateNode.containerInfo, le = (Q.mode & Ki) !== Di;
              lb(
                ie,
                X,
                W,
                // TODO: Delete this argument when we remove the legacy root API.
                le
              );
              break;
            }
            case l: {
              var He = Q.type, xe = Q.memoizedProps, Je = Q.stateNode, _e = (Q.mode & Ki) !== Di;
              Pb(
                He,
                xe,
                Je,
                X,
                W,
                // TODO: Delete this argument when we remove the legacy root API.
                _e
              );
              break;
            }
          }
      }
      return V;
    }
    function vT(h) {
      var X = h.memoizedState, W = X !== null ? X.dehydrated : null;
      if (!W)
        throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
      cj(W, h);
    }
    function uT(h) {
      var X = h.memoizedState, W = X !== null ? X.dehydrated : null;
      if (!W)
        throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
      return pj(W);
    }
    function bb(h) {
      for (var X = h.return; X !== null && X.tag !== l && X.tag !== v && X.tag !== j; )
        X = X.return;
      r9 = X;
    }
    function O3(h) {
      if (h !== r9)
        return !1;
      if (!md)
        return bb(h), md = !0, !1;
      if (h.tag !== v && (h.tag !== l || hj(h.type) && !t9(h.type, h.memoizedProps))) {
        var X = TA;
        if (X)
          if (DX(h))
            Bj(h), jX();
          else
            for (; X; )
              qb(h, X), X = Dh(X);
      }
      return bb(h), h.tag === j ? TA = uT(h) : TA = r9 ? Dh(h.stateNode) : null, !0;
    }
    function mj() {
      return md && TA !== null;
    }
    function Bj(h) {
      for (var X = TA; X; )
        wj(h, X), X = Dh(X);
    }
    function Uh() {
      r9 = null, TA = null, md = !1, V3 = !1;
    }
    function $7() {
      C3 !== null && (ww(C3), C3 = null);
    }
    function a1() {
      return md;
    }
    function Ih(h) {
      C3 === null ? C3 = [h] : C3.push(h);
    }
    var lT = t.ReactCurrentBatchConfig, PT = null;
    function Wj() {
      return lT.transition;
    }
    var Bd = {
      recordUnsafeLifecycleWarnings: function(h, X) {
      },
      flushPendingUnsafeLifecycleWarnings: function() {
      },
      recordLegacyContextWarning: function(h, X) {
      },
      flushLegacyContextWarning: function() {
      },
      discardPendingWarnings: function() {
      }
    };
    {
      var Rh = function(h) {
        for (var X = null, W = h; W !== null; )
          W.mode & Za && (X = W), W = W.return;
        return X;
      }, FP = function(h) {
        var X = [];
        return h.forEach(function(W) {
          X.push(W);
        }), X.sort().join(", ");
      }, eH = [], Vh = [], wX = [], tH = [], Ch = [], NP = [], u6 = /* @__PURE__ */ new Set();
      Bd.recordUnsafeLifecycleWarnings = function(h, X) {
        u6.has(h.type) || (typeof X.componentWillMount == "function" && // Don't warn about react-lifecycles-compat polyfilled components.
        X.componentWillMount.__suppressDeprecationWarning !== !0 && eH.push(h), h.mode & Za && typeof X.UNSAFE_componentWillMount == "function" && Vh.push(h), typeof X.componentWillReceiveProps == "function" && X.componentWillReceiveProps.__suppressDeprecationWarning !== !0 && wX.push(h), h.mode & Za && typeof X.UNSAFE_componentWillReceiveProps == "function" && tH.push(h), typeof X.componentWillUpdate == "function" && X.componentWillUpdate.__suppressDeprecationWarning !== !0 && Ch.push(h), h.mode & Za && typeof X.UNSAFE_componentWillUpdate == "function" && NP.push(h));
      }, Bd.flushPendingUnsafeLifecycleWarnings = function() {
        var h = /* @__PURE__ */ new Set();
        eH.length > 0 && (eH.forEach(function(Ht) {
          h.add(Fn(Ht) || "Component"), u6.add(Ht.type);
        }), eH = []);
        var X = /* @__PURE__ */ new Set();
        Vh.length > 0 && (Vh.forEach(function(Ht) {
          X.add(Fn(Ht) || "Component"), u6.add(Ht.type);
        }), Vh = []);
        var W = /* @__PURE__ */ new Set();
        wX.length > 0 && (wX.forEach(function(Ht) {
          W.add(Fn(Ht) || "Component"), u6.add(Ht.type);
        }), wX = []);
        var V = /* @__PURE__ */ new Set();
        tH.length > 0 && (tH.forEach(function(Ht) {
          V.add(Fn(Ht) || "Component"), u6.add(Ht.type);
        }), tH = []);
        var Q = /* @__PURE__ */ new Set();
        Ch.length > 0 && (Ch.forEach(function(Ht) {
          Q.add(Fn(Ht) || "Component"), u6.add(Ht.type);
        }), Ch = []);
        var ie = /* @__PURE__ */ new Set();
        if (NP.length > 0 && (NP.forEach(function(Ht) {
          ie.add(Fn(Ht) || "Component"), u6.add(Ht.type);
        }), NP = []), X.size > 0) {
          var le = FP(X);
          s(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.

Please update the following components: %s`, le);
        }
        if (V.size > 0) {
          var He = FP(V);
          s(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state

Please update the following components: %s`, He);
        }
        if (ie.size > 0) {
          var xe = FP(ie);
          s(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.

Please update the following components: %s`, xe);
        }
        if (h.size > 0) {
          var Je = FP(h);
          i(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`, Je);
        }
        if (W.size > 0) {
          var _e = FP(W);
          i(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`, _e);
        }
        if (Q.size > 0) {
          var qt = FP(Q);
          i(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`, qt);
        }
      };
      var Oh = /* @__PURE__ */ new Map(), rH = /* @__PURE__ */ new Set();
      Bd.recordLegacyContextWarning = function(h, X) {
        var W = Rh(h);
        if (W === null) {
          s("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
          return;
        }
        if (!rH.has(h.type)) {
          var V = Oh.get(W);
          (h.type.contextTypes != null || h.type.childContextTypes != null || X !== null && typeof X.getChildContext == "function") && (V === void 0 && (V = [], Oh.set(W, V)), V.push(h));
        }
      }, Bd.flushLegacyContextWarning = function() {
        Oh.forEach(function(h, X) {
          if (h.length !== 0) {
            var W = h[0], V = /* @__PURE__ */ new Set();
            h.forEach(function(ie) {
              V.add(Fn(ie) || "Component"), rH.add(ie.type);
            });
            var Q = FP(V);
            try {
              vs(W), s(`Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: %s

Learn more about this warning here: https://reactjs.org/link/legacy-context`, Q);
            } finally {
              Ua();
            }
          }
        });
      }, Bd.discardPendingWarnings = function() {
        eH = [], Vh = [], wX = [], tH = [], Ch = [], NP = [], Oh = /* @__PURE__ */ new Map();
      };
    }
    function Wd(h, X) {
      if (h && h.defaultProps) {
        var W = di({}, X), V = h.defaultProps;
        for (var Q in V)
          W[Q] === void 0 && (W[Q] = V[Q]);
        return W;
      }
      return X;
    }
    var xb = VP(null), QP;
    QP = {};
    var Xl = null, nH = null, yh = null, iH = !1;
    function Tl() {
      Xl = null, nH = null, yh = null, iH = !1;
    }
    function kh() {
      iH = !0;
    }
    function sH() {
      iH = !1;
    }
    function _A(h, X, W) {
      Rf(xb, X._currentValue, h), X._currentValue = W, X._currentRenderer !== void 0 && X._currentRenderer !== null && X._currentRenderer !== QP && s("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."), X._currentRenderer = QP;
    }
    function YP(h, X) {
      var W = xb.current;
      xo(xb, X), h._currentValue = W;
    }
    function ql(h, X, W) {
      for (var V = h; V !== null; ) {
        var Q = V.alternate;
        if (HP(V.childLanes, X) ? Q !== null && !HP(Q.childLanes, X) && (Q.childLanes = ts(Q.childLanes, X)) : (V.childLanes = ts(V.childLanes, X), Q !== null && (Q.childLanes = ts(Q.childLanes, X))), V === W)
          break;
        V = V.return;
      }
      V !== W && s("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.");
    }
    function Sj(h, X, W) {
      Uj(h, X, W);
    }
    function Uj(h, X, W) {
      var V = h.child;
      for (V !== null && (V.return = h); V !== null; ) {
        var Q = void 0, ie = V.dependencies;
        if (ie !== null) {
          Q = V.child;
          for (var le = ie.firstContext; le !== null; ) {
            if (le.context === X) {
              if (V.tag === o) {
                var He = O1(W), xe = Sd(Ma, He);
                xe.tag = aH;
                var Je = V.updateQueue;
                if (Je !== null) {
                  var _e = Je.shared, qt = _e.pending;
                  qt === null ? xe.next = xe : (xe.next = qt.next, qt.next = xe), _e.pending = xe;
                }
              }
              V.lanes = ts(V.lanes, W);
              var Ht = V.alternate;
              Ht !== null && (Ht.lanes = ts(Ht.lanes, W)), ql(V.return, W, h), ie.lanes = ts(ie.lanes, W);
              break;
            }
            le = le.next;
          }
        } else if (V.tag === T)
          Q = V.type === h.type ? null : V.child;
        else if (V.tag === k) {
          var Mt = V.return;
          if (Mt === null)
            throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");
          Mt.lanes = ts(Mt.lanes, W);
          var Lt = Mt.alternate;
          Lt !== null && (Lt.lanes = ts(Lt.lanes, W)), ql(Mt, W, h), Q = V.sibling;
        } else
          Q = V.child;
        if (Q !== null)
          Q.return = V;
        else
          for (Q = V; Q !== null; ) {
            if (Q === h) {
              Q = null;
              break;
            }
            var or = Q.sibling;
            if (or !== null) {
              or.return = Q.return, Q = or;
              break;
            }
            Q = Q.return;
          }
        V = Q;
      }
    }
    function y3(h, X) {
      Xl = h, nH = null, yh = null;
      var W = h.dependencies;
      if (W !== null) {
        var V = W.firstContext;
        V !== null && (F6(W.lanes, X) && s0(), W.firstContext = null);
      }
    }
    function df(h) {
      iH && s("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
      var X = h._currentValue;
      if (yh !== h) {
        var W = {
          context: h,
          memoizedValue: X,
          next: null
        };
        if (nH === null) {
          if (Xl === null)
            throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
          nH = W, Xl.dependencies = {
            lanes: Ar,
            firstContext: W
          };
        } else
          nH = nH.next = W;
      }
      return X;
    }
    var MP = null;
    function Db(h) {
      MP === null ? MP = [h] : MP.push(h);
    }
    function TB() {
      if (MP !== null) {
        for (var h = 0; h < MP.length; h++) {
          var X = MP[h], W = X.interleaved;
          if (W !== null) {
            X.interleaved = null;
            var V = W.next, Q = X.pending;
            if (Q !== null) {
              var ie = Q.next;
              Q.next = V, W.next = ie;
            }
            X.pending = W;
          }
        }
        MP = null;
      }
    }
    function jb(h, X, W, V) {
      var Q = X.interleaved;
      return Q === null ? (W.next = W, Db(X)) : (W.next = Q.next, Q.next = W), X.interleaved = W, k3(h, V);
    }
    function Ij(h, X, W, V) {
      var Q = X.interleaved;
      Q === null ? (W.next = W, Db(X)) : (W.next = Q.next, Q.next = W), X.interleaved = W;
    }
    function cT(h, X, W, V) {
      var Q = X.interleaved;
      return Q === null ? (W.next = W, Db(X)) : (W.next = Q.next, Q.next = W), X.interleaved = W, k3(h, V);
    }
    function l6(h, X) {
      return k3(h, X);
    }
    var wb = k3;
    function k3(h, X) {
      h.lanes = ts(h.lanes, X);
      var W = h.alternate;
      W !== null && (W.lanes = ts(W.lanes, X)), W === null && (h.flags & (Ms | NA)) !== fn && s9(h);
      for (var V = h, Q = h.return; Q !== null; )
        Q.childLanes = ts(Q.childLanes, X), W = Q.alternate, W !== null ? W.childLanes = ts(W.childLanes, X) : (Q.flags & (Ms | NA)) !== fn && s9(h), V = Q, Q = Q.return;
      if (V.tag === v) {
        var ie = V.stateNode;
        return ie;
      } else
        return null;
    }
    var mX = 0, Rj = 1, aH = 2, mb = 3, BX = !1, Bb, pn;
    Bb = !1, pn = null;
    function $A(h) {
      var X = {
        baseState: h.memoizedState,
        firstBaseUpdate: null,
        lastBaseUpdate: null,
        shared: {
          pending: null,
          interleaved: null,
          lanes: Ar
        },
        effects: null
      };
      h.updateQueue = X;
    }
    function pT(h, X) {
      var W = X.updateQueue, V = h.updateQueue;
      if (W === V) {
        var Q = {
          baseState: V.baseState,
          firstBaseUpdate: V.firstBaseUpdate,
          lastBaseUpdate: V.lastBaseUpdate,
          shared: V.shared,
          effects: V.effects
        };
        X.updateQueue = Q;
      }
    }
    function Sd(h, X) {
      var W = {
        eventTime: h,
        lane: X,
        tag: mX,
        payload: null,
        callback: null,
        next: null
      };
      return W;
    }
    function bv(h, X, W) {
      var V = h.updateQueue;
      if (V === null)
        return null;
      var Q = V.shared;
      if (pn === Q && !Bb && (s("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."), Bb = !0), jw()) {
        var ie = Q.pending;
        return ie === null ? X.next = X : (X.next = ie.next, ie.next = X), Q.pending = X, wb(h, W);
      } else
        return cT(h, Q, X, W);
    }
    function Ca(h, X, W) {
      var V = X.updateQueue;
      if (V !== null) {
        var Q = V.shared;
        if (Vg(W)) {
          var ie = Q.lanes;
          ie = p7(ie, h.pendingLanes);
          var le = ts(ie, W);
          Q.lanes = le, s3(h, le);
        }
      }
    }
    function m9(h, X) {
      var W = h.updateQueue, V = h.alternate;
      if (V !== null) {
        var Q = V.updateQueue;
        if (W === Q) {
          var ie = null, le = null, He = W.firstBaseUpdate;
          if (He !== null) {
            var xe = He;
            do {
              var Je = {
                eventTime: xe.eventTime,
                lane: xe.lane,
                tag: xe.tag,
                payload: xe.payload,
                callback: xe.callback,
                next: null
              };
              le === null ? ie = le = Je : (le.next = Je, le = Je), xe = xe.next;
            } while (xe !== null);
            le === null ? ie = le = X : (le.next = X, le = X);
          } else
            ie = le = X;
          W = {
            baseState: Q.baseState,
            firstBaseUpdate: ie,
            lastBaseUpdate: le,
            shared: Q.shared,
            effects: Q.effects
          }, h.updateQueue = W;
          return;
        }
      }
      var _e = W.lastBaseUpdate;
      _e === null ? W.firstBaseUpdate = X : _e.next = X, W.lastBaseUpdate = X;
    }
    function B9(h, X, W, V, Q, ie) {
      switch (W.tag) {
        case Rj: {
          var le = W.payload;
          if (typeof le == "function") {
            kh();
            var He = le.call(ie, V, Q);
            {
              if (h.mode & Za) {
                R1(!0);
                try {
                  le.call(ie, V, Q);
                } finally {
                  R1(!1);
                }
              }
              sH();
            }
            return He;
          }
          return le;
        }
        case mb:
          h.flags = h.flags & ~To | xi;
        case mX: {
          var xe = W.payload, Je;
          if (typeof xe == "function") {
            kh(), Je = xe.call(ie, V, Q);
            {
              if (h.mode & Za) {
                R1(!0);
                try {
                  xe.call(ie, V, Q);
                } finally {
                  R1(!1);
                }
              }
              sH();
            }
          } else
            Je = xe;
          return Je == null ? V : di({}, V, Je);
        }
        case aH:
          return BX = !0, V;
      }
      return V;
    }
    function E3(h, X, W, V) {
      var Q = h.updateQueue;
      BX = !1, pn = Q.shared;
      var ie = Q.firstBaseUpdate, le = Q.lastBaseUpdate, He = Q.shared.pending;
      if (He !== null) {
        Q.shared.pending = null;
        var xe = He, Je = xe.next;
        xe.next = null, le === null ? ie = Je : le.next = Je, le = xe;
        var _e = h.alternate;
        if (_e !== null) {
          var qt = _e.updateQueue, Ht = qt.lastBaseUpdate;
          Ht !== le && (Ht === null ? qt.firstBaseUpdate = Je : Ht.next = Je, qt.lastBaseUpdate = xe);
        }
      }
      if (ie !== null) {
        var Mt = Q.baseState, Lt = Ar, or = null, yn = null, hi = null, Pi = ie;
        do {
          var Ks = Pi.lane, Is = Pi.eventTime;
          if (HP(V, Ks)) {
            if (hi !== null) {
              var fr = {
                eventTime: Is,
                // This update is going to be committed so we never want uncommit
                // it. Using NoLane works because 0 is a subset of all bitmasks, so
                // this will never be skipped by the check above.
                lane: Zt,
                tag: Pi.tag,
                payload: Pi.payload,
                callback: Pi.callback,
                next: null
              };
              hi = hi.next = fr;
            }
            Mt = B9(h, Q, Pi, Mt, X, W);
            var Ct = Pi.callback;
            if (Ct !== null && // If the update was already committed, we should not queue its
            // callback again.
            Pi.lane !== Zt) {
              h.flags |= uA;
              var Nr = Q.effects;
              Nr === null ? Q.effects = [Pi] : Nr.push(Pi);
            }
          } else {
            var Vt = {
              eventTime: Is,
              lane: Ks,
              tag: Pi.tag,
              payload: Pi.payload,
              callback: Pi.callback,
              next: null
            };
            hi === null ? (yn = hi = Vt, or = Mt) : hi = hi.next = Vt, Lt = ts(Lt, Ks);
          }
          if (Pi = Pi.next, Pi === null) {
            if (He = Q.shared.pending, He === null)
              break;
            var kn = He, mn = kn.next;
            kn.next = null, Pi = mn, Q.lastBaseUpdate = kn, Q.shared.pending = null;
          }
        } while (!0);
        hi === null && (or = Mt), Q.baseState = or, Q.firstBaseUpdate = yn, Q.lastBaseUpdate = hi;
        var Ei = Q.shared.interleaved;
        if (Ei !== null) {
          var rs = Ei;
          do
            Lt = ts(Lt, rs.lane), rs = rs.next;
          while (rs !== Ei);
        } else
          ie === null && (Q.shared.lanes = Ar);
        U(Lt), h.lanes = Lt, h.memoizedState = Mt;
      }
      pn = null;
    }
    function WX(h, X) {
      if (typeof h != "function")
        throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + h));
      h.call(X);
    }
    function Vj() {
      BX = !1;
    }
    function jr() {
      return BX;
    }
    function Ud(h, X, W) {
      var V = X.effects;
      if (X.effects = null, V !== null)
        for (var Q = 0; Q < V.length; Q++) {
          var ie = V[Q], le = ie.callback;
          le !== null && (ie.callback = null, WX(le, W));
        }
    }
    var bl = {}, SX = new A.Component().refs, Oa, bn, Eh, Wb, P6, hT, xl, HT, UX, LP;
    {
      Oa = /* @__PURE__ */ new Set(), bn = /* @__PURE__ */ new Set(), Eh = /* @__PURE__ */ new Set(), Wb = /* @__PURE__ */ new Set(), HT = /* @__PURE__ */ new Set(), P6 = /* @__PURE__ */ new Set(), UX = /* @__PURE__ */ new Set(), LP = /* @__PURE__ */ new Set();
      var F3 = /* @__PURE__ */ new Set();
      xl = function(h, X) {
        if (!(h === null || typeof h == "function")) {
          var W = X + "_" + h;
          F3.has(W) || (F3.add(W), s("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", X, h));
        }
      }, hT = function(h, X) {
        if (X === void 0) {
          var W = Li(h) || "Component";
          P6.has(W) || (P6.add(W), s("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", W));
        }
      }, Object.defineProperty(bl, "_processChildContext", {
        enumerable: !1,
        value: function() {
          throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
        }
      }), Object.freeze(bl);
    }
    function Sb(h, X, W, V) {
      var Q = h.memoizedState, ie = W(V, Q);
      {
        if (h.mode & Za) {
          R1(!0);
          try {
            ie = W(V, Q);
          } finally {
            R1(!1);
          }
        }
        hT(X, ie);
      }
      var le = ie == null ? Q : di({}, Q, ie);
      if (h.memoizedState = le, h.lanes === Ar) {
        var He = h.updateQueue;
        He.baseState = le;
      }
    }
    var Fh = {
      isMounted: n6,
      enqueueSetState: function(h, X, W) {
        var V = Es(h), Q = I9(), ie = sp(V), le = Sd(Q, ie);
        le.payload = X, W != null && (xl(W, "setState"), le.callback = W);
        var He = bv(V, le, ie);
        He !== null && (Qo(He, V, ie, Q), Ca(He, V, ie)), y6(V, ie);
      },
      enqueueReplaceState: function(h, X, W) {
        var V = Es(h), Q = I9(), ie = sp(V), le = Sd(Q, ie);
        le.tag = Rj, le.payload = X, W != null && (xl(W, "replaceState"), le.callback = W);
        var He = bv(V, le, ie);
        He !== null && (Qo(He, V, ie, Q), Ca(He, V, ie)), y6(V, ie);
      },
      enqueueForceUpdate: function(h, X) {
        var W = Es(h), V = I9(), Q = sp(W), ie = Sd(V, Q);
        ie.tag = aH, X != null && (xl(X, "forceUpdate"), ie.callback = X);
        var le = bv(W, ie, Q);
        le !== null && (Qo(le, W, Q, V), Ca(le, W, Q)), u7(W, Q);
      }
    };
    function gT(h, X, W, V, Q, ie, le) {
      var He = h.stateNode;
      if (typeof He.shouldComponentUpdate == "function") {
        var xe = He.shouldComponentUpdate(V, ie, le);
        {
          if (h.mode & Za) {
            R1(!0);
            try {
              xe = He.shouldComponentUpdate(V, ie, le);
            } finally {
              R1(!1);
            }
          }
          xe === void 0 && s("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", Li(X) || "Component");
        }
        return xe;
      }
      return X.prototype && X.prototype.isPureReactComponent ? !vi(W, V) || !vi(Q, ie) : !0;
    }
    function XT(h, X, W) {
      var V = h.stateNode;
      {
        var Q = Li(X) || "Component", ie = V.render;
        ie || (X.prototype && typeof X.prototype.render == "function" ? s("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", Q) : s("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", Q)), V.getInitialState && !V.getInitialState.isReactClassApproved && !V.state && s("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", Q), V.getDefaultProps && !V.getDefaultProps.isReactClassApproved && s("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", Q), V.propTypes && s("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", Q), V.contextType && s("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", Q), V.contextTypes && s("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", Q), X.contextType && X.contextTypes && !UX.has(X) && (UX.add(X), s("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", Q)), typeof V.componentShouldUpdate == "function" && s("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", Q), X.prototype && X.prototype.isPureReactComponent && typeof V.shouldComponentUpdate < "u" && s("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", Li(X) || "A pure component"), typeof V.componentDidUnmount == "function" && s("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", Q), typeof V.componentDidReceiveProps == "function" && s("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", Q), typeof V.componentWillRecieveProps == "function" && s("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", Q), typeof V.UNSAFE_componentWillRecieveProps == "function" && s("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", Q);
        var le = V.props !== W;
        V.props !== void 0 && le && s("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", Q, Q), V.defaultProps && s("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", Q, Q), typeof V.getSnapshotBeforeUpdate == "function" && typeof V.componentDidUpdate != "function" && !Eh.has(X) && (Eh.add(X), s("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", Li(X))), typeof V.getDerivedStateFromProps == "function" && s("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", Q), typeof V.getDerivedStateFromError == "function" && s("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", Q), typeof X.getSnapshotBeforeUpdate == "function" && s("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", Q);
        var He = V.state;
        He && (typeof He != "object" || cs(He)) && s("%s.state: must be set to an object or null", Q), typeof V.getChildContext == "function" && typeof X.childContextTypes != "object" && s("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", Q);
      }
    }
    function TT(h, X) {
      X.updater = Fh, h.stateNode = X, Qa(X, h), X._reactInternalInstance = bl;
    }
    function Ub(h, X, W) {
      var V = !1, Q = gA, ie = gA, le = X.contextType;
      if ("contextType" in X) {
        var He = (
          // Allow null for conditional declaration
          le === null || le !== void 0 && le.$$typeof === Ur && le._context === void 0
        );
        if (!He && !LP.has(X)) {
          LP.add(X);
          var xe = "";
          le === void 0 ? xe = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : typeof le != "object" ? xe = " However, it is set to a " + typeof le + "." : le.$$typeof === $t ? xe = " Did you accidentally pass the Context.Provider instead?" : le._context !== void 0 ? xe = " Did you accidentally pass the Context.Consumer instead?" : xe = " However, it is set to an object with keys {" + Object.keys(le).join(", ") + "}.", s("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", Li(X) || "Component", xe);
        }
      }
      if (typeof le == "object" && le !== null)
        ie = df(le);
      else {
        Q = CP(h, X, !0);
        var Je = X.contextTypes;
        V = Je != null, ie = V ? Wh(h, Q) : gA;
      }
      var _e = new X(W, ie);
      if (h.mode & Za) {
        R1(!0);
        try {
          _e = new X(W, ie);
        } finally {
          R1(!1);
        }
      }
      var qt = h.memoizedState = _e.state !== null && _e.state !== void 0 ? _e.state : null;
      TT(h, _e);
      {
        if (typeof X.getDerivedStateFromProps == "function" && qt === null) {
          var Ht = Li(X) || "Component";
          bn.has(Ht) || (bn.add(Ht), s("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", Ht, _e.state === null ? "null" : "undefined", Ht));
        }
        if (typeof X.getDerivedStateFromProps == "function" || typeof _e.getSnapshotBeforeUpdate == "function") {
          var Mt = null, Lt = null, or = null;
          if (typeof _e.componentWillMount == "function" && _e.componentWillMount.__suppressDeprecationWarning !== !0 ? Mt = "componentWillMount" : typeof _e.UNSAFE_componentWillMount == "function" && (Mt = "UNSAFE_componentWillMount"), typeof _e.componentWillReceiveProps == "function" && _e.componentWillReceiveProps.__suppressDeprecationWarning !== !0 ? Lt = "componentWillReceiveProps" : typeof _e.UNSAFE_componentWillReceiveProps == "function" && (Lt = "UNSAFE_componentWillReceiveProps"), typeof _e.componentWillUpdate == "function" && _e.componentWillUpdate.__suppressDeprecationWarning !== !0 ? or = "componentWillUpdate" : typeof _e.UNSAFE_componentWillUpdate == "function" && (or = "UNSAFE_componentWillUpdate"), Mt !== null || Lt !== null || or !== null) {
            var yn = Li(X) || "Component", hi = typeof X.getDerivedStateFromProps == "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
            Wb.has(yn) || (Wb.add(yn), s(`Unsafe legacy lifecycles will not be called for components using new component APIs.

%s uses %s but also contains the following legacy lifecycles:%s%s%s

The above lifecycles should be removed. Learn more about this warning here:
https://reactjs.org/link/unsafe-component-lifecycles`, yn, hi, Mt !== null ? `
  ` + Mt : "", Lt !== null ? `
  ` + Lt : "", or !== null ? `
  ` + or : ""));
          }
        }
      }
      return V && gX(h, Q, ie), _e;
    }
    function Cj(h, X) {
      var W = X.state;
      typeof X.componentWillMount == "function" && X.componentWillMount(), typeof X.UNSAFE_componentWillMount == "function" && X.UNSAFE_componentWillMount(), W !== X.state && (s("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", Fn(h) || "Component"), Fh.enqueueReplaceState(X, X.state, null));
    }
    function qT(h, X, W, V) {
      var Q = X.state;
      if (typeof X.componentWillReceiveProps == "function" && X.componentWillReceiveProps(W, V), typeof X.UNSAFE_componentWillReceiveProps == "function" && X.UNSAFE_componentWillReceiveProps(W, V), X.state !== Q) {
        {
          var ie = Fn(h) || "Component";
          Oa.has(ie) || (Oa.add(ie), s("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", ie));
        }
        Fh.enqueueReplaceState(X, X.state, null);
      }
    }
    function oH(h, X, W, V) {
      XT(h, X, W);
      var Q = h.stateNode;
      Q.props = W, Q.state = h.memoizedState, Q.refs = SX, $A(h);
      var ie = X.contextType;
      if (typeof ie == "object" && ie !== null)
        Q.context = df(ie);
      else {
        var le = CP(h, X, !0);
        Q.context = Wh(h, le);
      }
      {
        if (Q.state === W) {
          var He = Li(X) || "Component";
          HT.has(He) || (HT.add(He), s("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", He));
        }
        h.mode & Za && Bd.recordLegacyContextWarning(h, Q), Bd.recordUnsafeLifecycleWarnings(h, Q);
      }
      Q.state = h.memoizedState;
      var xe = X.getDerivedStateFromProps;
      if (typeof xe == "function" && (Sb(h, X, xe, W), Q.state = h.memoizedState), typeof X.getDerivedStateFromProps != "function" && typeof Q.getSnapshotBeforeUpdate != "function" && (typeof Q.UNSAFE_componentWillMount == "function" || typeof Q.componentWillMount == "function") && (Cj(h, Q), E3(h, W, Q, V), Q.state = h.memoizedState), typeof Q.componentDidMount == "function") {
        var Je = Ni;
        Je |= $9, (h.mode & k6) !== Di && (Je |= e6), h.flags |= Je;
      }
    }
    function N3(h, X, W, V) {
      var Q = h.stateNode, ie = h.memoizedProps;
      Q.props = ie;
      var le = Q.context, He = X.contextType, xe = gA;
      if (typeof He == "object" && He !== null)
        xe = df(He);
      else {
        var Je = CP(h, X, !0);
        xe = Wh(h, Je);
      }
      var _e = X.getDerivedStateFromProps, qt = typeof _e == "function" || typeof Q.getSnapshotBeforeUpdate == "function";
      !qt && (typeof Q.UNSAFE_componentWillReceiveProps == "function" || typeof Q.componentWillReceiveProps == "function") && (ie !== W || le !== xe) && qT(h, Q, W, xe), Vj();
      var Ht = h.memoizedState, Mt = Q.state = Ht;
      if (E3(h, W, Q, V), Mt = h.memoizedState, ie === W && Ht === Mt && !XX() && !jr()) {
        if (typeof Q.componentDidMount == "function") {
          var Lt = Ni;
          Lt |= $9, (h.mode & k6) !== Di && (Lt |= e6), h.flags |= Lt;
        }
        return !1;
      }
      typeof _e == "function" && (Sb(h, X, _e, W), Mt = h.memoizedState);
      var or = jr() || gT(h, X, ie, W, Ht, Mt, xe);
      if (or) {
        if (!qt && (typeof Q.UNSAFE_componentWillMount == "function" || typeof Q.componentWillMount == "function") && (typeof Q.componentWillMount == "function" && Q.componentWillMount(), typeof Q.UNSAFE_componentWillMount == "function" && Q.UNSAFE_componentWillMount()), typeof Q.componentDidMount == "function") {
          var yn = Ni;
          yn |= $9, (h.mode & k6) !== Di && (yn |= e6), h.flags |= yn;
        }
      } else {
        if (typeof Q.componentDidMount == "function") {
          var hi = Ni;
          hi |= $9, (h.mode & k6) !== Di && (hi |= e6), h.flags |= hi;
        }
        h.memoizedProps = W, h.memoizedState = Mt;
      }
      return Q.props = W, Q.state = Mt, Q.context = xe, or;
    }
    function IX(h, X, W, V, Q) {
      var ie = X.stateNode;
      pT(h, X);
      var le = X.memoizedProps, He = X.type === X.elementType ? le : Wd(X.type, le);
      ie.props = He;
      var xe = X.pendingProps, Je = ie.context, _e = W.contextType, qt = gA;
      if (typeof _e == "object" && _e !== null)
        qt = df(_e);
      else {
        var Ht = CP(X, W, !0);
        qt = Wh(X, Ht);
      }
      var Mt = W.getDerivedStateFromProps, Lt = typeof Mt == "function" || typeof ie.getSnapshotBeforeUpdate == "function";
      !Lt && (typeof ie.UNSAFE_componentWillReceiveProps == "function" || typeof ie.componentWillReceiveProps == "function") && (le !== xe || Je !== qt) && qT(X, ie, V, qt), Vj();
      var or = X.memoizedState, yn = ie.state = or;
      if (E3(X, V, ie, Q), yn = X.memoizedState, le === xe && or === yn && !XX() && !jr() && !_)
        return typeof ie.componentDidUpdate == "function" && (le !== h.memoizedProps || or !== h.memoizedState) && (X.flags |= Ni), typeof ie.getSnapshotBeforeUpdate == "function" && (le !== h.memoizedProps || or !== h.memoizedState) && (X.flags |= I1), !1;
      typeof Mt == "function" && (Sb(X, W, Mt, V), yn = X.memoizedState);
      var hi = jr() || gT(X, W, He, V, or, yn, qt) || // TODO: In some cases, we'll end up checking if context has changed twice,
      // both before and after `shouldComponentUpdate` has been called. Not ideal,
      // but I'm loath to refactor this function. This only happens for memoized
      // components so it's not that common.
      _;
      return hi ? (!Lt && (typeof ie.UNSAFE_componentWillUpdate == "function" || typeof ie.componentWillUpdate == "function") && (typeof ie.componentWillUpdate == "function" && ie.componentWillUpdate(V, yn, qt), typeof ie.UNSAFE_componentWillUpdate == "function" && ie.UNSAFE_componentWillUpdate(V, yn, qt)), typeof ie.componentDidUpdate == "function" && (X.flags |= Ni), typeof ie.getSnapshotBeforeUpdate == "function" && (X.flags |= I1)) : (typeof ie.componentDidUpdate == "function" && (le !== h.memoizedProps || or !== h.memoizedState) && (X.flags |= Ni), typeof ie.getSnapshotBeforeUpdate == "function" && (le !== h.memoizedProps || or !== h.memoizedState) && (X.flags |= I1), X.memoizedProps = V, X.memoizedState = yn), ie.props = V, ie.state = yn, ie.context = qt, hi;
    }
    var Dl, fH, AH, Q3, RX, VX = function(h, X) {
    };
    Dl = !1, fH = !1, AH = {}, Q3 = {}, RX = {}, VX = function(h, X) {
      if (!(h === null || typeof h != "object") && !(!h._store || h._store.validated || h.key != null)) {
        if (typeof h._store != "object")
          throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
        h._store.validated = !0;
        var W = Fn(X) || "Component";
        Q3[W] || (Q3[W] = !0, s('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'));
      }
    };
    function Y3(h, X, W) {
      var V = W.ref;
      if (V !== null && typeof V != "function" && typeof V != "object") {
        if ((h.mode & Za || Pe) && // We warn in ReactElement.js if owner and self are equal for string refs
        // because these cannot be automatically converted to an arrow function
        // using a codemod. Therefore, we don't have to warn about string refs again.
        !(W._owner && W._self && W._owner.stateNode !== W._self)) {
          var Q = Fn(h) || "Component";
          AH[Q] || (s('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', V), AH[Q] = !0);
        }
        if (W._owner) {
          var ie = W._owner, le;
          if (ie) {
            var He = ie;
            if (He.tag !== o)
              throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
            le = He.stateNode;
          }
          if (!le)
            throw new Error("Missing owner for string ref " + V + ". This error is likely caused by a bug in React. Please file an issue.");
          var xe = le;
          wt(V, "ref");
          var Je = "" + V;
          if (X !== null && X.ref !== null && typeof X.ref == "function" && X.ref._stringRef === Je)
            return X.ref;
          var _e = function(qt) {
            var Ht = xe.refs;
            Ht === SX && (Ht = xe.refs = {}), qt === null ? delete Ht[Je] : Ht[Je] = qt;
          };
          return _e._stringRef = Je, _e;
        } else {
          if (typeof V != "string")
            throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
          if (!W._owner)
            throw new Error("Element ref was specified as a string (" + V + `) but no owner was set. This could happen for one of the following reasons:
1. You may be adding a ref to a function component
2. You may be adding a ref to a component that was not created inside a component's render method
3. You have multiple copies of React loaded
See https://reactjs.org/link/refs-must-have-owner for more information.`);
        }
      }
      return V;
    }
    function KP(h, X) {
      var W = Object.prototype.toString.call(X);
      throw new Error("Objects are not valid as a React child (found: " + (W === "[object Object]" ? "object with keys {" + Object.keys(X).join(", ") + "}" : W) + "). If you meant to render a collection of children, use an array instead.");
    }
    function dH(h) {
      {
        var X = Fn(h) || "Component";
        if (RX[X])
          return;
        RX[X] = !0, s("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
      }
    }
    function CX(h) {
      var X = h._payload, W = h._init;
      return W(X);
    }
    function Ib(h) {
      function X(Vt, fr) {
        if (h) {
          var Ct = Vt.deletions;
          Ct === null ? (Vt.deletions = [fr], Vt.flags |= _s) : Ct.push(fr);
        }
      }
      function W(Vt, fr) {
        if (!h)
          return null;
        for (var Ct = fr; Ct !== null; )
          X(Vt, Ct), Ct = Ct.sibling;
        return null;
      }
      function V(Vt, fr) {
        for (var Ct = /* @__PURE__ */ new Map(), Nr = fr; Nr !== null; )
          Nr.key !== null ? Ct.set(Nr.key, Nr) : Ct.set(Nr.index, Nr), Nr = Nr.sibling;
        return Ct;
      }
      function Q(Vt, fr) {
        var Ct = m2(Vt, fr);
        return Ct.index = 0, Ct.sibling = null, Ct;
      }
      function ie(Vt, fr, Ct) {
        if (Vt.index = Ct, !h)
          return Vt.flags |= i7, fr;
        var Nr = Vt.alternate;
        if (Nr !== null) {
          var kn = Nr.index;
          return kn < fr ? (Vt.flags |= Ms, fr) : kn;
        } else
          return Vt.flags |= Ms, fr;
      }
      function le(Vt) {
        return h && Vt.alternate === null && (Vt.flags |= Ms), Vt;
      }
      function He(Vt, fr, Ct, Nr) {
        if (fr === null || fr.tag !== P) {
          var kn = sW(Ct, Vt.mode, Nr);
          return kn.return = Vt, kn;
        } else {
          var mn = Q(fr, Ct);
          return mn.return = Vt, mn;
        }
      }
      function xe(Vt, fr, Ct, Nr) {
        var kn = Ct.type;
        if (kn === pr)
          return _e(Vt, fr, Ct.props.children, Nr, Ct.key);
        if (fr !== null && (fr.elementType === kn || // Keep this check inline so it only runs on the false path:
        WU(fr, Ct) || // Lazy types should reconcile their resolved type.
        // We need to do this after the Hot Reloading check above,
        // because hot reloading has different semantics than prod because
        // it doesn't resuspend. So we can't let the call below suspend.
        typeof kn == "object" && kn !== null && kn.$$typeof === Lr && CX(kn) === fr.type)) {
          var mn = Q(fr, Ct.props);
          return mn.ref = Y3(Vt, fr, Ct), mn.return = Vt, mn._debugSource = Ct._source, mn._debugOwner = Ct._owner, mn;
        }
        var Ei = nW(Ct, Vt.mode, Nr);
        return Ei.ref = Y3(Vt, fr, Ct), Ei.return = Vt, Ei;
      }
      function Je(Vt, fr, Ct, Nr) {
        if (fr === null || fr.tag !== u || fr.stateNode.containerInfo !== Ct.containerInfo || fr.stateNode.implementation !== Ct.implementation) {
          var kn = oW(Ct, Vt.mode, Nr);
          return kn.return = Vt, kn;
        } else {
          var mn = Q(fr, Ct.children || []);
          return mn.return = Vt, mn;
        }
      }
      function _e(Vt, fr, Ct, Nr, kn) {
        if (fr === null || fr.tag !== p) {
          var mn = yH(Ct, Vt.mode, Nr, kn);
          return mn.return = Vt, mn;
        } else {
          var Ei = Q(fr, Ct);
          return Ei.return = Vt, Ei;
        }
      }
      function qt(Vt, fr, Ct) {
        if (typeof fr == "string" && fr !== "" || typeof fr == "number") {
          var Nr = sW("" + fr, Vt.mode, Ct);
          return Nr.return = Vt, Nr;
        }
        if (typeof fr == "object" && fr !== null) {
          switch (fr.$$typeof) {
            case vr: {
              var kn = nW(fr, Vt.mode, Ct);
              return kn.ref = Y3(Vt, null, fr), kn.return = Vt, kn;
            }
            case Fr: {
              var mn = oW(fr, Vt.mode, Ct);
              return mn.return = Vt, mn;
            }
            case Lr: {
              var Ei = fr._payload, rs = fr._init;
              return qt(Vt, rs(Ei), Ct);
            }
          }
          if (cs(fr) || w1(fr)) {
            var ro = yH(fr, Vt.mode, Ct, null);
            return ro.return = Vt, ro;
          }
          KP(Vt, fr);
        }
        return typeof fr == "function" && dH(Vt), null;
      }
      function Ht(Vt, fr, Ct, Nr) {
        var kn = fr !== null ? fr.key : null;
        if (typeof Ct == "string" && Ct !== "" || typeof Ct == "number")
          return kn !== null ? null : He(Vt, fr, "" + Ct, Nr);
        if (typeof Ct == "object" && Ct !== null) {
          switch (Ct.$$typeof) {
            case vr:
              return Ct.key === kn ? xe(Vt, fr, Ct, Nr) : null;
            case Fr:
              return Ct.key === kn ? Je(Vt, fr, Ct, Nr) : null;
            case Lr: {
              var mn = Ct._payload, Ei = Ct._init;
              return Ht(Vt, fr, Ei(mn), Nr);
            }
          }
          if (cs(Ct) || w1(Ct))
            return kn !== null ? null : _e(Vt, fr, Ct, Nr, null);
          KP(Vt, Ct);
        }
        return typeof Ct == "function" && dH(Vt), null;
      }
      function Mt(Vt, fr, Ct, Nr, kn) {
        if (typeof Nr == "string" && Nr !== "" || typeof Nr == "number") {
          var mn = Vt.get(Ct) || null;
          return He(fr, mn, "" + Nr, kn);
        }
        if (typeof Nr == "object" && Nr !== null) {
          switch (Nr.$$typeof) {
            case vr: {
              var Ei = Vt.get(Nr.key === null ? Ct : Nr.key) || null;
              return xe(fr, Ei, Nr, kn);
            }
            case Fr: {
              var rs = Vt.get(Nr.key === null ? Ct : Nr.key) || null;
              return Je(fr, rs, Nr, kn);
            }
            case Lr:
              var ro = Nr._payload, oa = Nr._init;
              return Mt(Vt, fr, Ct, oa(ro), kn);
          }
          if (cs(Nr) || w1(Nr)) {
            var a9 = Vt.get(Ct) || null;
            return _e(fr, a9, Nr, kn, null);
          }
          KP(fr, Nr);
        }
        return typeof Nr == "function" && dH(fr), null;
      }
      function Lt(Vt, fr, Ct) {
        {
          if (typeof Vt != "object" || Vt === null)
            return fr;
          switch (Vt.$$typeof) {
            case vr:
            case Fr:
              VX(Vt, Ct);
              var Nr = Vt.key;
              if (typeof Nr != "string")
                break;
              if (fr === null) {
                fr = /* @__PURE__ */ new Set(), fr.add(Nr);
                break;
              }
              if (!fr.has(Nr)) {
                fr.add(Nr);
                break;
              }
              s("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.", Nr);
              break;
            case Lr:
              var kn = Vt._payload, mn = Vt._init;
              Lt(mn(kn), fr, Ct);
              break;
          }
        }
        return fr;
      }
      function or(Vt, fr, Ct, Nr) {
        for (var kn = null, mn = 0; mn < Ct.length; mn++) {
          var Ei = Ct[mn];
          kn = Lt(Ei, kn, Vt);
        }
        for (var rs = null, ro = null, oa = fr, a9 = 0, ha = 0, Of = null; oa !== null && ha < Ct.length; ha++) {
          oa.index > ha ? (Of = oa, oa = null) : Of = oa.sibling;
          var bA = Ht(Vt, oa, Ct[ha], Nr);
          if (bA === null) {
            oa === null && (oa = Of);
            break;
          }
          h && oa && bA.alternate === null && X(Vt, oa), a9 = ie(bA, a9, ha), ro === null ? rs = bA : ro.sibling = bA, ro = bA, oa = Of;
        }
        if (ha === Ct.length) {
          if (W(Vt, oa), a1()) {
            var xA = ha;
            kP(Vt, xA);
          }
          return rs;
        }
        if (oa === null) {
          for (; ha < Ct.length; ha++) {
            var Wu = qt(Vt, Ct[ha], Nr);
            Wu !== null && (a9 = ie(Wu, a9, ha), ro === null ? rs = Wu : ro.sibling = Wu, ro = Wu);
          }
          if (a1()) {
            var kd = ha;
            kP(Vt, kd);
          }
          return rs;
        }
        for (var Ed = V(Vt, oa); ha < Ct.length; ha++) {
          var sd = Mt(Ed, Vt, ha, Ct[ha], Nr);
          sd !== null && (h && sd.alternate !== null && Ed.delete(sd.key === null ? ha : sd.key), a9 = ie(sd, a9, ha), ro === null ? rs = sd : ro.sibling = sd, ro = sd);
        }
        if (h && Ed.forEach(function(E8) {
          return X(Vt, E8);
        }), a1()) {
          var c0 = ha;
          kP(Vt, c0);
        }
        return rs;
      }
      function yn(Vt, fr, Ct, Nr) {
        var kn = w1(Ct);
        if (typeof kn != "function")
          throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
        {
          typeof Symbol == "function" && // $FlowFixMe Flow doesn't know about toStringTag
          Ct[Symbol.toStringTag] === "Generator" && (fH || s("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."), fH = !0), Ct.entries === kn && (Dl || s("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), Dl = !0);
          var mn = kn.call(Ct);
          if (mn)
            for (var Ei = null, rs = mn.next(); !rs.done; rs = mn.next()) {
              var ro = rs.value;
              Ei = Lt(ro, Ei, Vt);
            }
        }
        var oa = kn.call(Ct);
        if (oa == null)
          throw new Error("An iterable object provided no iterator.");
        for (var a9 = null, ha = null, Of = fr, bA = 0, xA = 0, Wu = null, kd = oa.next(); Of !== null && !kd.done; xA++, kd = oa.next()) {
          Of.index > xA ? (Wu = Of, Of = null) : Wu = Of.sibling;
          var Ed = Ht(Vt, Of, kd.value, Nr);
          if (Ed === null) {
            Of === null && (Of = Wu);
            break;
          }
          h && Of && Ed.alternate === null && X(Vt, Of), bA = ie(Ed, bA, xA), ha === null ? a9 = Ed : ha.sibling = Ed, ha = Ed, Of = Wu;
        }
        if (kd.done) {
          if (W(Vt, Of), a1()) {
            var sd = xA;
            kP(Vt, sd);
          }
          return a9;
        }
        if (Of === null) {
          for (; !kd.done; xA++, kd = oa.next()) {
            var c0 = qt(Vt, kd.value, Nr);
            c0 !== null && (bA = ie(c0, bA, xA), ha === null ? a9 = c0 : ha.sibling = c0, ha = c0);
          }
          if (a1()) {
            var E8 = xA;
            kP(Vt, E8);
          }
          return a9;
        }
        for (var kx = V(Vt, Of); !kd.done; xA++, kd = oa.next()) {
          var fp = Mt(kx, Vt, xA, kd.value, Nr);
          fp !== null && (h && fp.alternate !== null && kx.delete(fp.key === null ? xA : fp.key), bA = ie(fp, bA, xA), ha === null ? a9 = fp : ha.sibling = fp, ha = fp);
        }
        if (h && kx.forEach(function(tC) {
          return X(Vt, tC);
        }), a1()) {
          var eC = xA;
          kP(Vt, eC);
        }
        return a9;
      }
      function hi(Vt, fr, Ct, Nr) {
        if (fr !== null && fr.tag === P) {
          W(Vt, fr.sibling);
          var kn = Q(fr, Ct);
          return kn.return = Vt, kn;
        }
        W(Vt, fr);
        var mn = sW(Ct, Vt.mode, Nr);
        return mn.return = Vt, mn;
      }
      function Pi(Vt, fr, Ct, Nr) {
        for (var kn = Ct.key, mn = fr; mn !== null; ) {
          if (mn.key === kn) {
            var Ei = Ct.type;
            if (Ei === pr) {
              if (mn.tag === p) {
                W(Vt, mn.sibling);
                var rs = Q(mn, Ct.props.children);
                return rs.return = Vt, rs._debugSource = Ct._source, rs._debugOwner = Ct._owner, rs;
              }
            } else if (mn.elementType === Ei || // Keep this check inline so it only runs on the false path:
            WU(mn, Ct) || // Lazy types should reconcile their resolved type.
            // We need to do this after the Hot Reloading check above,
            // because hot reloading has different semantics than prod because
            // it doesn't resuspend. So we can't let the call below suspend.
            typeof Ei == "object" && Ei !== null && Ei.$$typeof === Lr && CX(Ei) === mn.type) {
              W(Vt, mn.sibling);
              var ro = Q(mn, Ct.props);
              return ro.ref = Y3(Vt, mn, Ct), ro.return = Vt, ro._debugSource = Ct._source, ro._debugOwner = Ct._owner, ro;
            }
            W(Vt, mn);
            break;
          } else
            X(Vt, mn);
          mn = mn.sibling;
        }
        if (Ct.type === pr) {
          var oa = yH(Ct.props.children, Vt.mode, Nr, Ct.key);
          return oa.return = Vt, oa;
        } else {
          var a9 = nW(Ct, Vt.mode, Nr);
          return a9.ref = Y3(Vt, fr, Ct), a9.return = Vt, a9;
        }
      }
      function Ks(Vt, fr, Ct, Nr) {
        for (var kn = Ct.key, mn = fr; mn !== null; ) {
          if (mn.key === kn)
            if (mn.tag === u && mn.stateNode.containerInfo === Ct.containerInfo && mn.stateNode.implementation === Ct.implementation) {
              W(Vt, mn.sibling);
              var Ei = Q(mn, Ct.children || []);
              return Ei.return = Vt, Ei;
            } else {
              W(Vt, mn);
              break;
            }
          else
            X(Vt, mn);
          mn = mn.sibling;
        }
        var rs = oW(Ct, Vt.mode, Nr);
        return rs.return = Vt, rs;
      }
      function Is(Vt, fr, Ct, Nr) {
        var kn = typeof Ct == "object" && Ct !== null && Ct.type === pr && Ct.key === null;
        if (kn && (Ct = Ct.props.children), typeof Ct == "object" && Ct !== null) {
          switch (Ct.$$typeof) {
            case vr:
              return le(Pi(Vt, fr, Ct, Nr));
            case Fr:
              return le(Ks(Vt, fr, Ct, Nr));
            case Lr:
              var mn = Ct._payload, Ei = Ct._init;
              return Is(Vt, fr, Ei(mn), Nr);
          }
          if (cs(Ct))
            return or(Vt, fr, Ct, Nr);
          if (w1(Ct))
            return yn(Vt, fr, Ct, Nr);
          KP(Vt, Ct);
        }
        return typeof Ct == "string" && Ct !== "" || typeof Ct == "number" ? le(hi(Vt, fr, "" + Ct, Nr)) : (typeof Ct == "function" && dH(Vt), W(Vt, fr));
      }
      return Is;
    }
    var JP = Ib(!0), OX = Ib(!1);
    function qB(h, X) {
      if (h !== null && X.child !== h.child)
        throw new Error("Resuming work not yet implemented.");
      if (X.child !== null) {
        var W = X.child, V = m2(W, W.pendingProps);
        for (X.child = V, V.return = X; W.sibling !== null; )
          W = W.sibling, V = V.sibling = m2(W, W.pendingProps), V.return = X;
        V.sibling = null;
      }
    }
    function yX(h, X) {
      for (var W = h.child; W !== null; )
        BV(W, X), W = W.sibling;
    }
    var Nh = {}, qu = VP(Nh), Qh = VP(Nh), M3 = VP(Nh);
    function vH(h) {
      if (h === Nh)
        throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
      return h;
    }
    function bT() {
      var h = vH(M3.current);
      return h;
    }
    function xT(h, X) {
      Rf(M3, X, h), Rf(Qh, h, h), Rf(qu, Nh, h);
      var W = sb(X);
      xo(qu, h), Rf(qu, W, h);
    }
    function uH(h) {
      xo(qu, h), xo(Qh, h), xo(M3, h);
    }
    function kX() {
      var h = vH(qu.current);
      return h;
    }
    function Rb(h) {
      vH(M3.current);
      var X = vH(qu.current), W = ij(X, h.type);
      X !== W && (Rf(Qh, h, h), Rf(qu, W, h));
    }
    function DT(h) {
      Qh.current === h && (xo(qu, h), xo(Qh, h));
    }
    var jT = 0, Oj = 1, Vb = 1, Yh = 2, xv = VP(jT);
    function EX(h, X) {
      return (h & X) !== 0;
    }
    function L3(h) {
      return h & Oj;
    }
    function lH(h, X) {
      return h & Oj | X;
    }
    function wT(h, X) {
      return h | X;
    }
    function zP(h, X) {
      Rf(xv, X, h);
    }
    function Mh(h) {
      xo(xv, h);
    }
    function yj(h, X) {
      var W = h.memoizedState;
      return W !== null ? W.dehydrated !== null : (h.memoizedProps, !0);
    }
    function Id(h) {
      for (var X = h; X !== null; ) {
        if (X.tag === j) {
          var W = X.memoizedState;
          if (W !== null) {
            var V = W.dehydrated;
            if (V === null || vj(V) || pX(V))
              return X;
          }
        } else if (X.tag === R && // revealOrder undefined can't be trusted because it don't
        // keep track of whether it suspended or not.
        X.memoizedProps.revealOrder !== void 0) {
          var Q = (X.flags & xi) !== fn;
          if (Q)
            return X;
        } else if (X.child !== null) {
          X.child.return = X, X = X.child;
          continue;
        }
        if (X === h)
          return null;
        for (; X.sibling === null; ) {
          if (X.return === null || X.return === h)
            return null;
          X = X.return;
        }
        X.sibling.return = X.return, X = X.sibling;
      }
      return null;
    }
    var Eo = (
      /*   */
      0
    ), N1 = (
      /* */
      1
    ), ed = (
      /*  */
      2
    ), ui = (
      /*    */
      4
    ), Vf = (
      /*   */
      8
    ), mT = [];
    function Lh() {
      for (var h = 0; h < mT.length; h++) {
        var X = mT[h];
        X._workInProgressVersionPrimary = null;
      }
      mT.length = 0;
    }
    function kj(h, X) {
      var W = X._getVersion, V = W(X._source);
      h.mutableSourceEagerHydrationData == null ? h.mutableSourceEagerHydrationData = [X, V] : h.mutableSourceEagerHydrationData.push(X, V);
    }
    var xn = t.ReactCurrentDispatcher, Kh = t.ReactCurrentBatchConfig, BT, GP;
    BT = /* @__PURE__ */ new Set();
    var ZP = Ar, $s = null, eo = null, vf = null, K3 = !1, Jh = !1, zh = 0, Cb = 0, Gh = 25, ur = null, z6 = null, uf = -1, WT = !1;
    function aa() {
      {
        var h = ur;
        z6 === null ? z6 = [h] : z6.push(h);
      }
    }
    function un() {
      {
        var h = ur;
        z6 !== null && (uf++, z6[uf] !== h && Ob(h));
      }
    }
    function J3(h) {
      h != null && !cs(h) && s("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", ur, typeof h);
    }
    function Ob(h) {
      {
        var X = Fn($s);
        if (!BT.has(X) && (BT.add(X), z6 !== null)) {
          for (var W = "", V = 30, Q = 0; Q <= uf; Q++) {
            for (var ie = z6[Q], le = Q === uf ? h : ie, He = Q + 1 + ". " + ie; He.length < V; )
              He += " ";
            He += le + `
`, W += He;
          }
          s(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks

   Previous render            Next render
   ------------------------------------------------------
%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`, X, W);
        }
      }
    }
    function G6() {
      throw new Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);
    }
    function ST(h, X) {
      if (WT)
        return !1;
      if (X === null)
        return s("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", ur), !1;
      h.length !== X.length && s(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.

Previous: %s
Incoming: %s`, ur, "[" + X.join(", ") + "]", "[" + h.join(", ") + "]");
      for (var W = 0; W < X.length && W < h.length; W++)
        if (!On(h[W], X[W]))
          return !1;
      return !0;
    }
    function PH(h, X, W, V, Q, ie) {
      ZP = ie, $s = X, z6 = h !== null ? h._debugHookTypes : null, uf = -1, WT = h !== null && h.type !== X.type, X.memoizedState = null, X.updateQueue = null, X.lanes = Ar, h !== null && h.memoizedState !== null ? xn.current = zj : z6 !== null ? xn.current = Jj : xn.current = zb;
      var le = W(V, Q);
      if (Jh) {
        var He = 0;
        do {
          if (Jh = !1, zh = 0, He >= Gh)
            throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
          He += 1, WT = !1, eo = null, vf = null, X.updateQueue = null, uf = -1, xn.current = Gb, le = W(V, Q);
        } while (Jh);
      }
      xn.current = ZX, X._debugHookTypes = z6;
      var xe = eo !== null && eo.next !== null;
      if (ZP = Ar, $s = null, eo = null, vf = null, ur = null, z6 = null, uf = -1, h !== null && (h.flags & ef) !== (X.flags & ef) && // Disable this warning in legacy mode, because legacy Suspense is weird
      // and creates false positives. To make this work in legacy mode, we'd
      // need to mark fibers that commit in an incomplete state, somehow. For
      // now I'll disable the warning that most of the bugs that would trigger
      // it are either exclusive to concurrent mode or exist in both.
      (h.mode & Ki) !== Di && s("Internal React error: Expected static flag was missing. Please notify the React team."), K3 = !1, xe)
        throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
      return le;
    }
    function cH() {
      var h = zh !== 0;
      return zh = 0, h;
    }
    function yb(h, X, W) {
      X.updateQueue = h.updateQueue, (X.mode & k6) !== Di ? X.flags &= ~($u | e6 | vo | Ni) : X.flags &= ~(vo | Ni), h.lanes = ou(h.lanes, W);
    }
    function FX() {
      if (xn.current = ZX, K3) {
        for (var h = $s.memoizedState; h !== null; ) {
          var X = h.queue;
          X !== null && (X.pending = null), h = h.next;
        }
        K3 = !1;
      }
      ZP = Ar, $s = null, eo = null, vf = null, z6 = null, uf = -1, ur = null, Yj = !1, Jh = !1, zh = 0;
    }
    function bu() {
      var h = {
        memoizedState: null,
        baseState: null,
        baseQueue: null,
        queue: null,
        next: null
      };
      return vf === null ? $s.memoizedState = vf = h : vf = vf.next = h, vf;
    }
    function td() {
      var h;
      if (eo === null) {
        var X = $s.alternate;
        X !== null ? h = X.memoizedState : h = null;
      } else
        h = eo.next;
      var W;
      if (vf === null ? W = $s.memoizedState : W = vf.next, W !== null)
        vf = W, W = vf.next, eo = h;
      else {
        if (h === null)
          throw new Error("Rendered more hooks than during the previous render.");
        eo = h;
        var V = {
          memoizedState: eo.memoizedState,
          baseState: eo.baseState,
          baseQueue: eo.baseQueue,
          queue: eo.queue,
          next: null
        };
        vf === null ? $s.memoizedState = vf = V : vf = vf.next = V;
      }
      return vf;
    }
    function UT() {
      return {
        lastEffect: null,
        stores: null
      };
    }
    function kb(h, X) {
      return typeof X == "function" ? X(h) : X;
    }
    function IT(h, X, W) {
      var V = bu(), Q;
      W !== void 0 ? Q = W(X) : Q = X, V.memoizedState = V.baseState = Q;
      var ie = {
        pending: null,
        interleaved: null,
        lanes: Ar,
        dispatch: null,
        lastRenderedReducer: h,
        lastRenderedState: Q
      };
      V.queue = ie;
      var le = ie.dispatch = Kb.bind(null, $s, ie);
      return [V.memoizedState, le];
    }
    function Eb(h, X, W) {
      var V = td(), Q = V.queue;
      if (Q === null)
        throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
      Q.lastRenderedReducer = h;
      var ie = eo, le = ie.baseQueue, He = Q.pending;
      if (He !== null) {
        if (le !== null) {
          var xe = le.next, Je = He.next;
          le.next = Je, He.next = xe;
        }
        ie.baseQueue !== le && s("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."), ie.baseQueue = le = He, Q.pending = null;
      }
      if (le !== null) {
        var _e = le.next, qt = ie.baseState, Ht = null, Mt = null, Lt = null, or = _e;
        do {
          var yn = or.lane;
          if (HP(ZP, yn)) {
            if (Lt !== null) {
              var Pi = {
                // This update is going to be committed so we never want uncommit
                // it. Using NoLane works because 0 is a subset of all bitmasks, so
                // this will never be skipped by the check above.
                lane: Zt,
                action: or.action,
                hasEagerState: or.hasEagerState,
                eagerState: or.eagerState,
                next: null
              };
              Lt = Lt.next = Pi;
            }
            if (or.hasEagerState)
              qt = or.eagerState;
            else {
              var Ks = or.action;
              qt = h(qt, Ks);
            }
          } else {
            var hi = {
              lane: yn,
              action: or.action,
              hasEagerState: or.hasEagerState,
              eagerState: or.eagerState,
              next: null
            };
            Lt === null ? (Mt = Lt = hi, Ht = qt) : Lt = Lt.next = hi, $s.lanes = ts($s.lanes, yn), U(yn);
          }
          or = or.next;
        } while (or !== null && or !== _e);
        Lt === null ? Ht = qt : Lt.next = Mt, On(qt, V.memoizedState) || s0(), V.memoizedState = qt, V.baseState = Ht, V.baseQueue = Lt, Q.lastRenderedState = qt;
      }
      var Is = Q.interleaved;
      if (Is !== null) {
        var Vt = Is;
        do {
          var fr = Vt.lane;
          $s.lanes = ts($s.lanes, fr), U(fr), Vt = Vt.next;
        } while (Vt !== Is);
      } else
        le === null && (Q.lanes = Ar);
      var Ct = Q.dispatch;
      return [V.memoizedState, Ct];
    }
    function RT(h, X, W) {
      var V = td(), Q = V.queue;
      if (Q === null)
        throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
      Q.lastRenderedReducer = h;
      var ie = Q.dispatch, le = Q.pending, He = V.memoizedState;
      if (le !== null) {
        Q.pending = null;
        var xe = le.next, Je = xe;
        do {
          var _e = Je.action;
          He = h(He, _e), Je = Je.next;
        } while (Je !== xe);
        On(He, V.memoizedState) || s0(), V.memoizedState = He, V.baseQueue === null && (V.baseState = He), Q.lastRenderedState = He;
      }
      return [He, ie];
    }
    function wU(h, X, W) {
    }
    function bB(h, X, W) {
    }
    function NX(h, X, W) {
      var V = $s, Q = bu(), ie, le = a1();
      if (le) {
        if (W === void 0)
          throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
        ie = W(), GP || ie !== W() && (s("The result of getServerSnapshot should be cached to avoid an infinite loop"), GP = !0);
      } else {
        if (ie = X(), !GP) {
          var He = X();
          On(ie, He) || (s("The result of getSnapshot should be cached to avoid an infinite loop"), GP = !0);
        }
        var xe = R8();
        if (xe === null)
          throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
        i3(xe, ZP) || QX(V, X, ie);
      }
      Q.memoizedState = ie;
      var Je = {
        value: ie,
        getSnapshot: X
      };
      return Q.queue = Je, kT(Ej.bind(null, V, Je, h), [h]), V.flags |= vo, hH(N1 | Vf, Fb.bind(null, V, Je, ie, X), void 0, null), ie;
    }
    function Zh(h, X, W) {
      var V = $s, Q = td(), ie = X();
      if (!GP) {
        var le = X();
        On(ie, le) || (s("The result of getSnapshot should be cached to avoid an infinite loop"), GP = !0);
      }
      var He = Q.memoizedState, xe = !On(He, ie);
      xe && (Q.memoizedState = ie, s0());
      var Je = Q.queue;
      if (MX(Ej.bind(null, V, Je, h), [h]), Je.getSnapshot !== X || xe || // Check if the susbcribe function changed. We can save some memory by
      // checking whether we scheduled a subscription effect above.
      vf !== null && vf.memoizedState.tag & N1) {
        V.flags |= vo, hH(N1 | Vf, Fb.bind(null, V, Je, ie, X), void 0, null);
        var _e = R8();
        if (_e === null)
          throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
        i3(_e, ZP) || QX(V, X, ie);
      }
      return ie;
    }
    function QX(h, X, W) {
      h.flags |= ov;
      var V = {
        getSnapshot: X,
        value: W
      }, Q = $s.updateQueue;
      if (Q === null)
        Q = UT(), $s.updateQueue = Q, Q.stores = [V];
      else {
        var ie = Q.stores;
        ie === null ? Q.stores = [V] : ie.push(V);
      }
    }
    function Fb(h, X, W, V) {
      X.value = W, X.getSnapshot = V, Nb(X) && Qb(h);
    }
    function Ej(h, X, W) {
      var V = function() {
        Nb(X) && Qb(h);
      };
      return W(V);
    }
    function Nb(h) {
      var X = h.getSnapshot, W = h.value;
      try {
        var V = X();
        return !On(W, V);
      } catch {
        return !0;
      }
    }
    function Qb(h) {
      var X = l6(h, Ln);
      X !== null && Qo(X, h, Ln, Ma);
    }
    function VT(h) {
      var X = bu();
      typeof h == "function" && (h = h()), X.memoizedState = X.baseState = h;
      var W = {
        pending: null,
        interleaved: null,
        lanes: Ar,
        dispatch: null,
        lastRenderedReducer: kb,
        lastRenderedState: h
      };
      X.queue = W;
      var V = W.dispatch = xB.bind(null, $s, W);
      return [X.memoizedState, V];
    }
    function CT(h) {
      return Eb(kb);
    }
    function pH(h) {
      return RT(kb);
    }
    function hH(h, X, W, V) {
      var Q = {
        tag: h,
        create: X,
        destroy: W,
        deps: V,
        // Circular
        next: null
      }, ie = $s.updateQueue;
      if (ie === null)
        ie = UT(), $s.updateQueue = ie, ie.lastEffect = Q.next = Q;
      else {
        var le = ie.lastEffect;
        if (le === null)
          ie.lastEffect = Q.next = Q;
        else {
          var He = le.next;
          le.next = Q, Q.next = He, ie.lastEffect = Q;
        }
      }
      return Q;
    }
    function OT(h) {
      var X = bu();
      {
        var W = {
          current: h
        };
        return X.memoizedState = W, W;
      }
    }
    function YX(h) {
      var X = td();
      return X.memoizedState;
    }
    function HH(h, X, W, V) {
      var Q = bu(), ie = V === void 0 ? null : V;
      $s.flags |= h, Q.memoizedState = hH(N1 | X, W, void 0, ie);
    }
    function yT(h, X, W, V) {
      var Q = td(), ie = V === void 0 ? null : V, le = void 0;
      if (eo !== null) {
        var He = eo.memoizedState;
        if (le = He.destroy, ie !== null) {
          var xe = He.deps;
          if (ST(ie, xe)) {
            Q.memoizedState = hH(X, W, le, ie);
            return;
          }
        }
      }
      $s.flags |= h, Q.memoizedState = hH(N1 | X, W, le, ie);
    }
    function kT(h, X) {
      return ($s.mode & k6) !== Di ? HH($u | vo | _v, Vf, h, X) : HH(vo | _v, Vf, h, X);
    }
    function MX(h, X) {
      return yT(vo, Vf, h, X);
    }
    function ET(h, X) {
      return HH(Ni, ed, h, X);
    }
    function FT(h, X) {
      return yT(Ni, ed, h, X);
    }
    function gH(h, X) {
      var W = Ni;
      return W |= $9, ($s.mode & k6) !== Di && (W |= e6), HH(W, ui, h, X);
    }
    function LX(h, X) {
      return yT(Ni, ui, h, X);
    }
    function Fj(h, X) {
      if (typeof X == "function") {
        var W = X, V = h();
        return W(V), function() {
          W(null);
        };
      } else if (X != null) {
        var Q = X;
        Q.hasOwnProperty("current") || s("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(Q).join(", ") + "}");
        var ie = h();
        return Q.current = ie, function() {
          Q.current = null;
        };
      }
    }
    function NT(h, X, W) {
      typeof X != "function" && s("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", X !== null ? typeof X : "null");
      var V = W != null ? W.concat([h]) : null, Q = Ni;
      return Q |= $9, ($s.mode & k6) !== Di && (Q |= e6), HH(Q, ui, Fj.bind(null, X, h), V);
    }
    function QT(h, X, W) {
      typeof X != "function" && s("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", X !== null ? typeof X : "null");
      var V = W != null ? W.concat([h]) : null;
      return yT(Ni, ui, Fj.bind(null, X, h), V);
    }
    function Nj(h, X) {
    }
    var YT = Nj;
    function KX(h, X) {
      var W = bu(), V = X === void 0 ? null : X;
      return W.memoizedState = [h, V], h;
    }
    function Rd(h, X) {
      var W = td(), V = X === void 0 ? null : X, Q = W.memoizedState;
      if (Q !== null && V !== null) {
        var ie = Q[1];
        if (ST(V, ie))
          return Q[0];
      }
      return W.memoizedState = [h, V], h;
    }
    function Yb(h, X) {
      var W = bu(), V = X === void 0 ? null : X, Q = h();
      return W.memoizedState = [Q, V], Q;
    }
    function JX(h, X) {
      var W = td(), V = X === void 0 ? null : X, Q = W.memoizedState;
      if (Q !== null && V !== null) {
        var ie = Q[1];
        if (ST(V, ie))
          return Q[0];
      }
      var le = h();
      return W.memoizedState = [le, V], le;
    }
    function _P(h) {
      var X = bu();
      return X.memoizedState = h, h;
    }
    function Mb(h) {
      var X = td(), W = eo, V = W.memoizedState;
      return LT(X, V, h);
    }
    function MT(h) {
      var X = td();
      if (eo === null)
        return X.memoizedState = h, h;
      var W = eo.memoizedState;
      return LT(X, W, h);
    }
    function LT(h, X, W) {
      var V = !Gp(ZP);
      if (V) {
        if (!On(W, X)) {
          var Q = Zp();
          $s.lanes = ts($s.lanes, Q), U(Q), h.baseState = !0;
        }
        return X;
      } else
        return h.baseState && (h.baseState = !1, s0()), h.memoizedState = W, W;
    }
    function Qj(h, X, W) {
      var V = a6();
      Co(Va(V, _f)), h(!0);
      var Q = Kh.transition;
      Kh.transition = {};
      var ie = Kh.transition;
      Kh.transition._updatedFibers = /* @__PURE__ */ new Set();
      try {
        h(!1), X();
      } finally {
        if (Co(V), Kh.transition = Q, Q === null && ie._updatedFibers) {
          var le = ie._updatedFibers.size;
          le > 10 && i("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."), ie._updatedFibers.clear();
        }
      }
    }
    function zX() {
      var h = VT(!1), X = h[0], W = h[1], V = Qj.bind(null, W), Q = bu();
      return Q.memoizedState = V, [X, V];
    }
    function XH() {
      var h = CT(), X = h[0], W = td(), V = W.memoizedState;
      return [X, V];
    }
    function Lb() {
      var h = pH(), X = h[0], W = td(), V = W.memoizedState;
      return [X, V];
    }
    var Yj = !1;
    function Mj() {
      return Yj;
    }
    function GX() {
      var h = bu(), X = R8(), W = X.identifierPrefix, V;
      if (a1()) {
        var Q = Xb();
        V = ":" + W + "R" + Q;
        var ie = zh++;
        ie > 0 && (V += "H" + ie.toString(32)), V += ":";
      } else {
        var le = Cb++;
        V = ":" + W + "r" + le.toString(32) + ":";
      }
      return h.memoizedState = V, V;
    }
    function TH() {
      var h = td(), X = h.memoizedState;
      return X;
    }
    function Kb(h, X, W) {
      typeof arguments[3] == "function" && s("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
      var V = sp(h), Q = {
        lane: V,
        action: W,
        hasEagerState: !1,
        eagerState: null,
        next: null
      };
      if (KT(h))
        Jb(X, Q);
      else {
        var ie = jb(h, X, Q, V);
        if (ie !== null) {
          var le = I9();
          Qo(ie, h, V, le), Lj(ie, X, V);
        }
      }
      Kj(h, V);
    }
    function xB(h, X, W) {
      typeof arguments[3] == "function" && s("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
      var V = sp(h), Q = {
        lane: V,
        action: W,
        hasEagerState: !1,
        eagerState: null,
        next: null
      };
      if (KT(h))
        Jb(X, Q);
      else {
        var ie = h.alternate;
        if (h.lanes === Ar && (ie === null || ie.lanes === Ar)) {
          var le = X.lastRenderedReducer;
          if (le !== null) {
            var He;
            He = xn.current, xn.current = xu;
            try {
              var xe = X.lastRenderedState, Je = le(xe, W);
              if (Q.hasEagerState = !0, Q.eagerState = Je, On(Je, xe)) {
                Ij(h, X, Q, V);
                return;
              }
            } catch {
            } finally {
              xn.current = He;
            }
          }
        }
        var _e = jb(h, X, Q, V);
        if (_e !== null) {
          var qt = I9();
          Qo(_e, h, V, qt), Lj(_e, X, V);
        }
      }
      Kj(h, V);
    }
    function KT(h) {
      var X = h.alternate;
      return h === $s || X !== null && X === $s;
    }
    function Jb(h, X) {
      Jh = K3 = !0;
      var W = h.pending;
      W === null ? X.next = X : (X.next = W.next, W.next = X), h.pending = X;
    }
    function Lj(h, X, W) {
      if (Vg(W)) {
        var V = X.lanes;
        V = p7(V, h.pendingLanes);
        var Q = ts(V, W);
        X.lanes = Q, s3(h, Q);
      }
    }
    function Kj(h, X, W) {
      y6(h, X);
    }
    var ZX = {
      readContext: df,
      useCallback: G6,
      useContext: G6,
      useEffect: G6,
      useImperativeHandle: G6,
      useInsertionEffect: G6,
      useLayoutEffect: G6,
      useMemo: G6,
      useReducer: G6,
      useRef: G6,
      useState: G6,
      useDebugValue: G6,
      useDeferredValue: G6,
      useTransition: G6,
      useMutableSource: G6,
      useSyncExternalStore: G6,
      useId: G6,
      unstable_isNewReconciler: fe
    }, zb = null, Jj = null, zj = null, Gb = null, jl = null, xu = null, JT = null;
    {
      var Zb = function() {
        s("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
      }, Qi = function() {
        s("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
      };
      zb = {
        readContext: function(h) {
          return df(h);
        },
        useCallback: function(h, X) {
          return ur = "useCallback", aa(), J3(X), KX(h, X);
        },
        useContext: function(h) {
          return ur = "useContext", aa(), df(h);
        },
        useEffect: function(h, X) {
          return ur = "useEffect", aa(), J3(X), kT(h, X);
        },
        useImperativeHandle: function(h, X, W) {
          return ur = "useImperativeHandle", aa(), J3(W), NT(h, X, W);
        },
        useInsertionEffect: function(h, X) {
          return ur = "useInsertionEffect", aa(), J3(X), ET(h, X);
        },
        useLayoutEffect: function(h, X) {
          return ur = "useLayoutEffect", aa(), J3(X), gH(h, X);
        },
        useMemo: function(h, X) {
          ur = "useMemo", aa(), J3(X);
          var W = xn.current;
          xn.current = jl;
          try {
            return Yb(h, X);
          } finally {
            xn.current = W;
          }
        },
        useReducer: function(h, X, W) {
          ur = "useReducer", aa();
          var V = xn.current;
          xn.current = jl;
          try {
            return IT(h, X, W);
          } finally {
            xn.current = V;
          }
        },
        useRef: function(h) {
          return ur = "useRef", aa(), OT(h);
        },
        useState: function(h) {
          ur = "useState", aa();
          var X = xn.current;
          xn.current = jl;
          try {
            return VT(h);
          } finally {
            xn.current = X;
          }
        },
        useDebugValue: function(h, X) {
          return ur = "useDebugValue", aa(), void 0;
        },
        useDeferredValue: function(h) {
          return ur = "useDeferredValue", aa(), _P(h);
        },
        useTransition: function() {
          return ur = "useTransition", aa(), zX();
        },
        useMutableSource: function(h, X, W) {
          return ur = "useMutableSource", aa(), void 0;
        },
        useSyncExternalStore: function(h, X, W) {
          return ur = "useSyncExternalStore", aa(), NX(h, X, W);
        },
        useId: function() {
          return ur = "useId", aa(), GX();
        },
        unstable_isNewReconciler: fe
      }, Jj = {
        readContext: function(h) {
          return df(h);
        },
        useCallback: function(h, X) {
          return ur = "useCallback", un(), KX(h, X);
        },
        useContext: function(h) {
          return ur = "useContext", un(), df(h);
        },
        useEffect: function(h, X) {
          return ur = "useEffect", un(), kT(h, X);
        },
        useImperativeHandle: function(h, X, W) {
          return ur = "useImperativeHandle", un(), NT(h, X, W);
        },
        useInsertionEffect: function(h, X) {
          return ur = "useInsertionEffect", un(), ET(h, X);
        },
        useLayoutEffect: function(h, X) {
          return ur = "useLayoutEffect", un(), gH(h, X);
        },
        useMemo: function(h, X) {
          ur = "useMemo", un();
          var W = xn.current;
          xn.current = jl;
          try {
            return Yb(h, X);
          } finally {
            xn.current = W;
          }
        },
        useReducer: function(h, X, W) {
          ur = "useReducer", un();
          var V = xn.current;
          xn.current = jl;
          try {
            return IT(h, X, W);
          } finally {
            xn.current = V;
          }
        },
        useRef: function(h) {
          return ur = "useRef", un(), OT(h);
        },
        useState: function(h) {
          ur = "useState", un();
          var X = xn.current;
          xn.current = jl;
          try {
            return VT(h);
          } finally {
            xn.current = X;
          }
        },
        useDebugValue: function(h, X) {
          return ur = "useDebugValue", un(), void 0;
        },
        useDeferredValue: function(h) {
          return ur = "useDeferredValue", un(), _P(h);
        },
        useTransition: function() {
          return ur = "useTransition", un(), zX();
        },
        useMutableSource: function(h, X, W) {
          return ur = "useMutableSource", un(), void 0;
        },
        useSyncExternalStore: function(h, X, W) {
          return ur = "useSyncExternalStore", un(), NX(h, X, W);
        },
        useId: function() {
          return ur = "useId", un(), GX();
        },
        unstable_isNewReconciler: fe
      }, zj = {
        readContext: function(h) {
          return df(h);
        },
        useCallback: function(h, X) {
          return ur = "useCallback", un(), Rd(h, X);
        },
        useContext: function(h) {
          return ur = "useContext", un(), df(h);
        },
        useEffect: function(h, X) {
          return ur = "useEffect", un(), MX(h, X);
        },
        useImperativeHandle: function(h, X, W) {
          return ur = "useImperativeHandle", un(), QT(h, X, W);
        },
        useInsertionEffect: function(h, X) {
          return ur = "useInsertionEffect", un(), FT(h, X);
        },
        useLayoutEffect: function(h, X) {
          return ur = "useLayoutEffect", un(), LX(h, X);
        },
        useMemo: function(h, X) {
          ur = "useMemo", un();
          var W = xn.current;
          xn.current = xu;
          try {
            return JX(h, X);
          } finally {
            xn.current = W;
          }
        },
        useReducer: function(h, X, W) {
          ur = "useReducer", un();
          var V = xn.current;
          xn.current = xu;
          try {
            return Eb(h, X, W);
          } finally {
            xn.current = V;
          }
        },
        useRef: function(h) {
          return ur = "useRef", un(), YX();
        },
        useState: function(h) {
          ur = "useState", un();
          var X = xn.current;
          xn.current = xu;
          try {
            return CT(h);
          } finally {
            xn.current = X;
          }
        },
        useDebugValue: function(h, X) {
          return ur = "useDebugValue", un(), YT();
        },
        useDeferredValue: function(h) {
          return ur = "useDeferredValue", un(), Mb(h);
        },
        useTransition: function() {
          return ur = "useTransition", un(), XH();
        },
        useMutableSource: function(h, X, W) {
          return ur = "useMutableSource", un(), void 0;
        },
        useSyncExternalStore: function(h, X, W) {
          return ur = "useSyncExternalStore", un(), Zh(h, X);
        },
        useId: function() {
          return ur = "useId", un(), TH();
        },
        unstable_isNewReconciler: fe
      }, Gb = {
        readContext: function(h) {
          return df(h);
        },
        useCallback: function(h, X) {
          return ur = "useCallback", un(), Rd(h, X);
        },
        useContext: function(h) {
          return ur = "useContext", un(), df(h);
        },
        useEffect: function(h, X) {
          return ur = "useEffect", un(), MX(h, X);
        },
        useImperativeHandle: function(h, X, W) {
          return ur = "useImperativeHandle", un(), QT(h, X, W);
        },
        useInsertionEffect: function(h, X) {
          return ur = "useInsertionEffect", un(), FT(h, X);
        },
        useLayoutEffect: function(h, X) {
          return ur = "useLayoutEffect", un(), LX(h, X);
        },
        useMemo: function(h, X) {
          ur = "useMemo", un();
          var W = xn.current;
          xn.current = JT;
          try {
            return JX(h, X);
          } finally {
            xn.current = W;
          }
        },
        useReducer: function(h, X, W) {
          ur = "useReducer", un();
          var V = xn.current;
          xn.current = JT;
          try {
            return RT(h, X, W);
          } finally {
            xn.current = V;
          }
        },
        useRef: function(h) {
          return ur = "useRef", un(), YX();
        },
        useState: function(h) {
          ur = "useState", un();
          var X = xn.current;
          xn.current = JT;
          try {
            return pH(h);
          } finally {
            xn.current = X;
          }
        },
        useDebugValue: function(h, X) {
          return ur = "useDebugValue", un(), YT();
        },
        useDeferredValue: function(h) {
          return ur = "useDeferredValue", un(), MT(h);
        },
        useTransition: function() {
          return ur = "useTransition", un(), Lb();
        },
        useMutableSource: function(h, X, W) {
          return ur = "useMutableSource", un(), void 0;
        },
        useSyncExternalStore: function(h, X, W) {
          return ur = "useSyncExternalStore", un(), Zh(h, X);
        },
        useId: function() {
          return ur = "useId", un(), TH();
        },
        unstable_isNewReconciler: fe
      }, jl = {
        readContext: function(h) {
          return Zb(), df(h);
        },
        useCallback: function(h, X) {
          return ur = "useCallback", Qi(), aa(), KX(h, X);
        },
        useContext: function(h) {
          return ur = "useContext", Qi(), aa(), df(h);
        },
        useEffect: function(h, X) {
          return ur = "useEffect", Qi(), aa(), kT(h, X);
        },
        useImperativeHandle: function(h, X, W) {
          return ur = "useImperativeHandle", Qi(), aa(), NT(h, X, W);
        },
        useInsertionEffect: function(h, X) {
          return ur = "useInsertionEffect", Qi(), aa(), ET(h, X);
        },
        useLayoutEffect: function(h, X) {
          return ur = "useLayoutEffect", Qi(), aa(), gH(h, X);
        },
        useMemo: function(h, X) {
          ur = "useMemo", Qi(), aa();
          var W = xn.current;
          xn.current = jl;
          try {
            return Yb(h, X);
          } finally {
            xn.current = W;
          }
        },
        useReducer: function(h, X, W) {
          ur = "useReducer", Qi(), aa();
          var V = xn.current;
          xn.current = jl;
          try {
            return IT(h, X, W);
          } finally {
            xn.current = V;
          }
        },
        useRef: function(h) {
          return ur = "useRef", Qi(), aa(), OT(h);
        },
        useState: function(h) {
          ur = "useState", Qi(), aa();
          var X = xn.current;
          xn.current = jl;
          try {
            return VT(h);
          } finally {
            xn.current = X;
          }
        },
        useDebugValue: function(h, X) {
          return ur = "useDebugValue", Qi(), aa(), void 0;
        },
        useDeferredValue: function(h) {
          return ur = "useDeferredValue", Qi(), aa(), _P(h);
        },
        useTransition: function() {
          return ur = "useTransition", Qi(), aa(), zX();
        },
        useMutableSource: function(h, X, W) {
          return ur = "useMutableSource", Qi(), aa(), void 0;
        },
        useSyncExternalStore: function(h, X, W) {
          return ur = "useSyncExternalStore", Qi(), aa(), NX(h, X, W);
        },
        useId: function() {
          return ur = "useId", Qi(), aa(), GX();
        },
        unstable_isNewReconciler: fe
      }, xu = {
        readContext: function(h) {
          return Zb(), df(h);
        },
        useCallback: function(h, X) {
          return ur = "useCallback", Qi(), un(), Rd(h, X);
        },
        useContext: function(h) {
          return ur = "useContext", Qi(), un(), df(h);
        },
        useEffect: function(h, X) {
          return ur = "useEffect", Qi(), un(), MX(h, X);
        },
        useImperativeHandle: function(h, X, W) {
          return ur = "useImperativeHandle", Qi(), un(), QT(h, X, W);
        },
        useInsertionEffect: function(h, X) {
          return ur = "useInsertionEffect", Qi(), un(), FT(h, X);
        },
        useLayoutEffect: function(h, X) {
          return ur = "useLayoutEffect", Qi(), un(), LX(h, X);
        },
        useMemo: function(h, X) {
          ur = "useMemo", Qi(), un();
          var W = xn.current;
          xn.current = xu;
          try {
            return JX(h, X);
          } finally {
            xn.current = W;
          }
        },
        useReducer: function(h, X, W) {
          ur = "useReducer", Qi(), un();
          var V = xn.current;
          xn.current = xu;
          try {
            return Eb(h, X, W);
          } finally {
            xn.current = V;
          }
        },
        useRef: function(h) {
          return ur = "useRef", Qi(), un(), YX();
        },
        useState: function(h) {
          ur = "useState", Qi(), un();
          var X = xn.current;
          xn.current = xu;
          try {
            return CT(h);
          } finally {
            xn.current = X;
          }
        },
        useDebugValue: function(h, X) {
          return ur = "useDebugValue", Qi(), un(), YT();
        },
        useDeferredValue: function(h) {
          return ur = "useDeferredValue", Qi(), un(), Mb(h);
        },
        useTransition: function() {
          return ur = "useTransition", Qi(), un(), XH();
        },
        useMutableSource: function(h, X, W) {
          return ur = "useMutableSource", Qi(), un(), void 0;
        },
        useSyncExternalStore: function(h, X, W) {
          return ur = "useSyncExternalStore", Qi(), un(), Zh(h, X);
        },
        useId: function() {
          return ur = "useId", Qi(), un(), TH();
        },
        unstable_isNewReconciler: fe
      }, JT = {
        readContext: function(h) {
          return Zb(), df(h);
        },
        useCallback: function(h, X) {
          return ur = "useCallback", Qi(), un(), Rd(h, X);
        },
        useContext: function(h) {
          return ur = "useContext", Qi(), un(), df(h);
        },
        useEffect: function(h, X) {
          return ur = "useEffect", Qi(), un(), MX(h, X);
        },
        useImperativeHandle: function(h, X, W) {
          return ur = "useImperativeHandle", Qi(), un(), QT(h, X, W);
        },
        useInsertionEffect: function(h, X) {
          return ur = "useInsertionEffect", Qi(), un(), FT(h, X);
        },
        useLayoutEffect: function(h, X) {
          return ur = "useLayoutEffect", Qi(), un(), LX(h, X);
        },
        useMemo: function(h, X) {
          ur = "useMemo", Qi(), un();
          var W = xn.current;
          xn.current = xu;
          try {
            return JX(h, X);
          } finally {
            xn.current = W;
          }
        },
        useReducer: function(h, X, W) {
          ur = "useReducer", Qi(), un();
          var V = xn.current;
          xn.current = xu;
          try {
            return RT(h, X, W);
          } finally {
            xn.current = V;
          }
        },
        useRef: function(h) {
          return ur = "useRef", Qi(), un(), YX();
        },
        useState: function(h) {
          ur = "useState", Qi(), un();
          var X = xn.current;
          xn.current = xu;
          try {
            return pH(h);
          } finally {
            xn.current = X;
          }
        },
        useDebugValue: function(h, X) {
          return ur = "useDebugValue", Qi(), un(), YT();
        },
        useDeferredValue: function(h) {
          return ur = "useDeferredValue", Qi(), un(), MT(h);
        },
        useTransition: function() {
          return ur = "useTransition", Qi(), un(), Lb();
        },
        useMutableSource: function(h, X, W) {
          return ur = "useMutableSource", Qi(), un(), void 0;
        },
        useSyncExternalStore: function(h, X, W) {
          return ur = "useSyncExternalStore", Qi(), un(), Zh(h, X);
        },
        useId: function() {
          return ur = "useId", Qi(), un(), TH();
        },
        unstable_isNewReconciler: fe
      };
    }
    var wl = e.unstable_now, _b = 0, zT = -1, _X = -1, $X = -1, _h = !1, e2 = !1;
    function Gj() {
      return _h;
    }
    function Zj() {
      e2 = !0;
    }
    function DB() {
      _h = !1, e2 = !1;
    }
    function $b() {
      _h = e2, e2 = !1;
    }
    function GT() {
      return _b;
    }
    function t2() {
      _b = wl();
    }
    function ZT(h) {
      _X = wl(), h.actualStartTime < 0 && (h.actualStartTime = wl());
    }
    function _j(h) {
      _X = -1;
    }
    function $h(h, X) {
      if (_X >= 0) {
        var W = wl() - _X;
        h.actualDuration += W, X && (h.selfBaseDuration = W), _X = -1;
      }
    }
    function ml(h) {
      if (zT >= 0) {
        var X = wl() - zT;
        zT = -1;
        for (var W = h.return; W !== null; ) {
          switch (W.tag) {
            case v:
              var V = W.stateNode;
              V.effectDuration += X;
              return;
            case b:
              var Q = W.stateNode;
              Q.effectDuration += X;
              return;
          }
          W = W.return;
        }
      }
    }
    function ex(h) {
      if ($X >= 0) {
        var X = wl() - $X;
        $X = -1;
        for (var W = h.return; W !== null; ) {
          switch (W.tag) {
            case v:
              var V = W.stateNode;
              V !== null && (V.passiveEffectDuration += X);
              return;
            case b:
              var Q = W.stateNode;
              Q !== null && (Q.passiveEffectDuration += X);
              return;
          }
          W = W.return;
        }
      }
    }
    function Du() {
      zT = wl();
    }
    function _T() {
      $X = wl();
    }
    function tx(h) {
      for (var X = h.child; X; )
        h.actualDuration += X.actualDuration, X = X.sibling;
    }
    function ju(h, X) {
      return {
        value: h,
        source: X,
        stack: go(X),
        digest: null
      };
    }
    function rx(h, X, W) {
      return {
        value: h,
        source: null,
        stack: W ?? null,
        digest: X ?? null
      };
    }
    function $j(h, X) {
      return !0;
    }
    function nx(h, X) {
      try {
        var W = $j(h, X);
        if (W === !1)
          return;
        var V = X.value, Q = X.source, ie = X.stack, le = ie !== null ? ie : "";
        if (V != null && V._suppressLogging) {
          if (h.tag === o)
            return;
          console.error(V);
        }
        var He = Q ? Fn(Q) : null, xe = He ? "The above error occurred in the <" + He + "> component:" : "The above error occurred in one of your React components:", Je;
        if (h.tag === v)
          Je = `Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;
        else {
          var _e = Fn(h) || "Anonymous";
          Je = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + _e + ".");
        }
        var qt = xe + `
` + le + `

` + ("" + Je);
        console.error(qt);
      } catch (Ht) {
        setTimeout(function() {
          throw Ht;
        });
      }
    }
    var $T = typeof WeakMap == "function" ? WeakMap : Map;
    function e8(h, X, W) {
      var V = Sd(Ma, W);
      V.tag = mb, V.payload = {
        element: null
      };
      var Q = X.value;
      return V.callback = function() {
        Nt(Q), nx(h, X);
      }, V;
    }
    function r2(h, X, W) {
      var V = Sd(Ma, W);
      V.tag = mb;
      var Q = h.type.getDerivedStateFromError;
      if (typeof Q == "function") {
        var ie = X.value;
        V.payload = function() {
          return Q(ie);
        }, V.callback = function() {
          $B(h), nx(h, X);
        };
      }
      var le = h.stateNode;
      return le !== null && typeof le.componentDidCatch == "function" && (V.callback = function() {
        $B(h), nx(h, X), typeof Q != "function" && ea(this);
        var xe = X.value, Je = X.stack;
        this.componentDidCatch(xe, {
          componentStack: Je !== null ? Je : ""
        }), typeof Q != "function" && (F6(h.lanes, Ln) || s("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", Fn(h) || "Unknown"));
      }), V;
    }
    function Fo(h, X, W) {
      var V = h.pingCache, Q;
      if (V === null ? (V = h.pingCache = new $T(), Q = /* @__PURE__ */ new Set(), V.set(X, Q)) : (Q = V.get(X), Q === void 0 && (Q = /* @__PURE__ */ new Set(), V.set(X, Q))), !Q.has(W)) {
        Q.add(W);
        var ie = Or.bind(null, h, X, W);
        rf && op(h, W), X.then(ie, ie);
      }
    }
    function t8(h, X, W, V) {
      var Q = h.updateQueue;
      if (Q === null) {
        var ie = /* @__PURE__ */ new Set();
        ie.add(W), h.updateQueue = ie;
      } else
        Q.add(W);
    }
    function jB(h, X) {
      var W = h.tag;
      if ((h.mode & Ki) === Di && (W === f || W === q || W === m)) {
        var V = h.alternate;
        V ? (h.updateQueue = V.updateQueue, h.memoizedState = V.memoizedState, h.lanes = V.lanes) : (h.updateQueue = null, h.memoizedState = null);
      }
    }
    function n2(h) {
      var X = h;
      do {
        if (X.tag === j && yj(X))
          return X;
        X = X.return;
      } while (X !== null);
      return null;
    }
    function r8(h, X, W, V, Q) {
      if ((h.mode & Ki) === Di) {
        if (h === X)
          h.flags |= To;
        else {
          if (h.flags |= xi, W.flags |= Yc, W.flags &= ~(QA | lA), W.tag === o) {
            var ie = W.alternate;
            if (ie === null)
              W.tag = N;
            else {
              var le = Sd(Ma, Ln);
              le.tag = aH, bv(W, le, Ln);
            }
          }
          W.lanes = ts(W.lanes, Ln);
        }
        return h;
      }
      return h.flags |= To, h.lanes = Q, h;
    }
    function rd(h, X, W, V, Q) {
      if (W.flags |= lA, rf && op(h, Q), V !== null && typeof V == "object" && typeof V.then == "function") {
        var ie = V;
        jB(W), a1() && W.mode & Ki && aT();
        var le = n2(X);
        if (le !== null) {
          le.flags &= ~Ya, r8(le, X, W, h, Q), le.mode & Ki && Fo(h, ie, Q), t8(le, h, ie);
          return;
        } else {
          if (!zp(Q)) {
            Fo(h, ie, Q), K();
            return;
          }
          var He = new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");
          V = He;
        }
      } else if (a1() && W.mode & Ki) {
        aT();
        var xe = n2(X);
        if (xe !== null) {
          (xe.flags & To) === fn && (xe.flags |= Ya), r8(xe, X, W, h, Q), Ih(ju(V, W));
          return;
        }
      }
      V = ju(V, W), oe(V);
      var Je = X;
      do {
        switch (Je.tag) {
          case v: {
            var _e = V;
            Je.flags |= To;
            var qt = O1(Q);
            Je.lanes = ts(Je.lanes, qt);
            var Ht = e8(Je, _e, qt);
            m9(Je, Ht);
            return;
          }
          case o:
            var Mt = V, Lt = Je.type, or = Je.stateNode;
            if ((Je.flags & xi) === fn && (typeof Lt.getDerivedStateFromError == "function" || or !== null && typeof or.componentDidCatch == "function" && !Ci(or))) {
              Je.flags |= To;
              var yn = O1(Q);
              Je.lanes = ts(Je.lanes, yn);
              var hi = r2(Je, Mt, yn);
              m9(Je, hi);
              return;
            }
            break;
        }
        Je = Je.return;
      } while (Je !== null);
    }
    function Bl() {
      return null;
    }
    var e0 = t.ReactCurrentOwner, n9 = !1, qH, z3, t0, bH, i2, Ti, c6, No;
    qH = {}, z3 = {}, t0 = {}, bH = {}, i2 = {}, Ti = !1, c6 = {}, No = {};
    function Ka(h, X, W, V) {
      h === null ? X.child = OX(X, null, W, V) : X.child = JP(X, h.child, W, V);
    }
    function Wl(h, X, W, V) {
      X.child = JP(X, h.child, null, V), X.child = JP(X, null, W, V);
    }
    function n8(h, X, W, V, Q) {
      if (X.type !== X.elementType) {
        var ie = W.propTypes;
        ie && L6(
          ie,
          V,
          // Resolved props
          "prop",
          Li(W)
        );
      }
      var le = W.render, He = X.ref, xe, Je;
      y3(X, Q), vv(X);
      {
        if (e0.current = X, Bf(!0), xe = PH(h, X, le, V, He, Q), Je = cH(), X.mode & Za) {
          R1(!0);
          try {
            xe = PH(h, X, le, V, He, Q), Je = cH();
          } finally {
            R1(!1);
          }
        }
        Bf(!1);
      }
      return lP(), h !== null && !n9 ? (yb(h, X, Q), tc(h, X, Q)) : (a1() && Je && qX(X), X.flags |= Zu, Ka(h, X, xe, Q), X.child);
    }
    function lf(h, X, W, V, Q) {
      if (h === null) {
        var ie = W.type;
        if (IU(ie) && W.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
        W.defaultProps === void 0) {
          var le = ie;
          return le = k8(ie), X.tag = m, X.type = le, ec(X, ie), s2(h, X, le, V, Q);
        }
        {
          var He = ie.propTypes;
          He && L6(
            He,
            V,
            // Resolved props
            "prop",
            Li(ie)
          );
        }
        var xe = Iw(W.type, null, V, X, X.mode, Q);
        return xe.ref = X.ref, xe.return = X, X.child = xe, xe;
      }
      {
        var Je = W.type, _e = Je.propTypes;
        _e && L6(
          _e,
          V,
          // Resolved props
          "prop",
          Li(Je)
        );
      }
      var qt = h.child, Ht = u2(h, Q);
      if (!Ht) {
        var Mt = qt.memoizedProps, Lt = W.compare;
        if (Lt = Lt !== null ? Lt : vi, Lt(Mt, V) && h.ref === X.ref)
          return tc(h, X, Q);
      }
      X.flags |= Zu;
      var or = m2(qt, V);
      return or.ref = X.ref, or.return = X, X.child = or, or;
    }
    function s2(h, X, W, V, Q) {
      if (X.type !== X.elementType) {
        var ie = X.elementType;
        if (ie.$$typeof === Lr) {
          var le = ie, He = le._payload, xe = le._init;
          try {
            ie = xe(He);
          } catch {
            ie = null;
          }
          var Je = ie && ie.propTypes;
          Je && L6(
            Je,
            V,
            // Resolved (SimpleMemoComponent has no defaultProps)
            "prop",
            Li(ie)
          );
        }
      }
      if (h !== null) {
        var _e = h.memoizedProps;
        if (vi(_e, V) && h.ref === X.ref && // Prevent bailout if the implementation changed due to hot reload.
        X.type === h.type)
          if (n9 = !1, X.pendingProps = V = _e, u2(h, Q))
            (h.flags & Yc) !== fn && (n9 = !0);
          else
            return X.lanes = h.lanes, tc(h, X, Q);
      }
      return o2(h, X, W, V, Q);
    }
    function G3(h, X, W) {
      var V = X.pendingProps, Q = V.children, ie = h !== null ? h.memoizedState : null;
      if (V.mode === "hidden" || G)
        if ((X.mode & Ki) === Di) {
          var le = {
            baseLanes: Ar,
            cachePool: null,
            transitions: null
          };
          X.memoizedState = le, C8(X, W);
        } else if (F6(W, s6)) {
          var qt = {
            baseLanes: Ar,
            cachePool: null,
            transitions: null
          };
          X.memoizedState = qt;
          var Ht = ie !== null ? ie.baseLanes : W;
          C8(X, Ht);
        } else {
          var He = null, xe;
          if (ie !== null) {
            var Je = ie.baseLanes;
            xe = ts(Je, W);
          } else
            xe = W;
          X.lanes = X.childLanes = s6;
          var _e = {
            baseLanes: xe,
            cachePool: He,
            transitions: null
          };
          return X.memoizedState = _e, X.updateQueue = null, C8(X, xe), null;
        }
      else {
        var Mt;
        ie !== null ? (Mt = ts(ie.baseLanes, W), X.memoizedState = null) : Mt = W, C8(X, Mt);
      }
      return Ka(h, X, Q, W), X.child;
    }
    function i8(h, X, W) {
      var V = X.pendingProps;
      return Ka(h, X, V, W), X.child;
    }
    function Z3(h, X, W) {
      var V = X.pendingProps.children;
      return Ka(h, X, V, W), X.child;
    }
    function s8(h, X, W) {
      {
        X.flags |= Ni;
        {
          var V = X.stateNode;
          V.effectDuration = 0, V.passiveEffectDuration = 0;
        }
      }
      var Q = X.pendingProps, ie = Q.children;
      return Ka(h, X, ie, W), X.child;
    }
    function a2(h, X) {
      var W = X.ref;
      (h === null && W !== null || h !== null && h.ref !== W) && (X.flags |= Uf, X.flags |= xg);
    }
    function o2(h, X, W, V, Q) {
      if (X.type !== X.elementType) {
        var ie = W.propTypes;
        ie && L6(
          ie,
          V,
          // Resolved props
          "prop",
          Li(W)
        );
      }
      var le;
      {
        var He = CP(X, W, !0);
        le = Wh(X, He);
      }
      var xe, Je;
      y3(X, Q), vv(X);
      {
        if (e0.current = X, Bf(!0), xe = PH(h, X, W, V, le, Q), Je = cH(), X.mode & Za) {
          R1(!0);
          try {
            xe = PH(h, X, W, V, le, Q), Je = cH();
          } finally {
            R1(!1);
          }
        }
        Bf(!1);
      }
      return lP(), h !== null && !n9 ? (yb(h, X, Q), tc(h, X, Q)) : (a1() && Je && qX(X), X.flags |= Zu, Ka(h, X, xe, Q), X.child);
    }
    function ix(h, X, W, V, Q) {
      {
        switch (QU(X)) {
          case !1: {
            var ie = X.stateNode, le = X.type, He = new le(X.memoizedProps, ie.context), xe = He.state;
            ie.updater.enqueueSetState(ie, xe, null);
            break;
          }
          case !0: {
            X.flags |= xi, X.flags |= To;
            var Je = new Error("Simulated error coming from DevTools"), _e = O1(Q);
            X.lanes = ts(X.lanes, _e);
            var qt = r2(X, ju(Je, X), _e);
            m9(X, qt);
            break;
          }
        }
        if (X.type !== X.elementType) {
          var Ht = W.propTypes;
          Ht && L6(
            Ht,
            V,
            // Resolved props
            "prop",
            Li(W)
          );
        }
      }
      var Mt;
      Xv(W) ? (Mt = !0, OP(X)) : Mt = !1, y3(X, Q);
      var Lt = X.stateNode, or;
      Lt === null ? (l8(h, X), Ub(X, W, V), oH(X, W, V, Q), or = !0) : h === null ? or = N3(X, W, V, Q) : or = IX(h, X, W, V, Q);
      var yn = a8(h, X, W, or, Mt, Q);
      {
        var hi = X.stateNode;
        or && hi.props !== V && (Ti || s("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", Fn(X) || "a component"), Ti = !0);
      }
      return yn;
    }
    function a8(h, X, W, V, Q, ie) {
      a2(h, X);
      var le = (X.flags & xi) !== fn;
      if (!V && !le)
        return Q && F1(X, W, !1), tc(h, X, ie);
      var He = X.stateNode;
      e0.current = X;
      var xe;
      if (le && typeof W.getDerivedStateFromError != "function")
        xe = null, _j();
      else {
        vv(X);
        {
          if (Bf(!0), xe = He.render(), X.mode & Za) {
            R1(!0);
            try {
              He.render();
            } finally {
              R1(!1);
            }
          }
          Bf(!1);
        }
        lP();
      }
      return X.flags |= Zu, h !== null && le ? Wl(h, X, xe, ie) : Ka(h, X, xe, ie), X.memoizedState = He.state, Q && F1(X, W, !0), X.child;
    }
    function ew(h) {
      var X = h.stateNode;
      X.pendingContext ? Hb(h, X.pendingContext, X.pendingContext !== X.context) : X.context && Hb(h, X.context, !1), xT(h, X.containerInfo);
    }
    function xH(h, X, W) {
      if (ew(X), h === null)
        throw new Error("Should have a current fiber. This is a bug in React.");
      var V = X.pendingProps, Q = X.memoizedState, ie = Q.element;
      pT(h, X), E3(X, V, null, W);
      var le = X.memoizedState;
      X.stateNode;
      var He = le.element;
      if (Q.isDehydrated) {
        var xe = {
          element: He,
          isDehydrated: !1,
          cache: le.cache,
          pendingSuspenseBoundaries: le.pendingSuspenseBoundaries,
          transitions: le.transitions
        }, Je = X.updateQueue;
        if (Je.baseState = xe, X.memoizedState = xe, X.flags & Ya) {
          var _e = ju(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."), X);
          return o8(h, X, He, W, _e);
        } else if (He !== ie) {
          var qt = ju(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."), X);
          return o8(h, X, He, W, qt);
        } else {
          jj(X);
          var Ht = OX(X, null, He, W);
          X.child = Ht;
          for (var Mt = Ht; Mt; )
            Mt.flags = Mt.flags & ~Ms | NA, Mt = Mt.sibling;
        }
      } else {
        if (Uh(), He === ie)
          return tc(h, X, W);
        Ka(h, X, He, W);
      }
      return X.child;
    }
    function o8(h, X, W, V, Q) {
      return Uh(), Ih(Q), X.flags |= Ya, Ka(h, X, W, V), X.child;
    }
    function zn(h, X, W) {
      Rb(X), h === null && AT(X);
      var V = X.type, Q = X.pendingProps, ie = h !== null ? h.memoizedProps : null, le = Q.children, He = t9(V, Q);
      return He ? le = null : ie !== null && t9(V, ie) && (X.flags |= bi), a2(h, X), Ka(h, X, le, W), X.child;
    }
    function f8(h, X) {
      return h === null && AT(X), null;
    }
    function sx(h, X, W, V) {
      l8(h, X);
      var Q = X.pendingProps, ie = W, le = ie._payload, He = ie._init, xe = He(le);
      X.type = xe;
      var Je = X.tag = mV(xe), _e = Wd(xe, Q), qt;
      switch (Je) {
        case f:
          return ec(X, xe), X.type = xe = k8(xe), qt = o2(null, X, xe, _e, V), qt;
        case o:
          return X.type = xe = _B(xe), qt = ix(null, X, xe, _e, V), qt;
        case q:
          return X.type = xe = Uw(xe), qt = n8(null, X, xe, _e, V), qt;
        case w: {
          if (X.type !== X.elementType) {
            var Ht = xe.propTypes;
            Ht && L6(
              Ht,
              _e,
              // Resolved for outer only
              "prop",
              Li(xe)
            );
          }
          return qt = lf(
            null,
            X,
            xe,
            Wd(xe.type, _e),
            // The inner type can have defaults too
            V
          ), qt;
        }
      }
      var Mt = "";
      throw xe !== null && typeof xe == "object" && xe.$$typeof === Lr && (Mt = " Did you wrap a component in React.lazy() more than once?"), new Error("Element type is invalid. Received a promise that resolves to: " + xe + ". " + ("Lazy element type must resolve to a class or function." + Mt));
    }
    function DH(h, X, W, V, Q) {
      l8(h, X), X.tag = o;
      var ie;
      return Xv(W) ? (ie = !0, OP(X)) : ie = !1, y3(X, Q), Ub(X, W, V), oH(X, W, V, Q), a8(null, X, W, !0, ie, Q);
    }
    function $P(h, X, W, V) {
      l8(h, X);
      var Q = X.pendingProps, ie;
      {
        var le = CP(X, W, !1);
        ie = Wh(X, le);
      }
      y3(X, V);
      var He, xe;
      vv(X);
      {
        if (W.prototype && typeof W.prototype.render == "function") {
          var Je = Li(W) || "Unknown";
          qH[Je] || (s("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", Je, Je), qH[Je] = !0);
        }
        X.mode & Za && Bd.recordLegacyContextWarning(X, null), Bf(!0), e0.current = X, He = PH(null, X, W, Q, ie, V), xe = cH(), Bf(!1);
      }
      if (lP(), X.flags |= Zu, typeof He == "object" && He !== null && typeof He.render == "function" && He.$$typeof === void 0) {
        var _e = Li(W) || "Unknown";
        z3[_e] || (s("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _e, _e, _e), z3[_e] = !0);
      }
      if (
        // Run these checks in production only if the flag is off.
        // Eventually we'll delete this branch altogether.
        typeof He == "object" && He !== null && typeof He.render == "function" && He.$$typeof === void 0
      ) {
        {
          var qt = Li(W) || "Unknown";
          z3[qt] || (s("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", qt, qt, qt), z3[qt] = !0);
        }
        X.tag = o, X.memoizedState = null, X.updateQueue = null;
        var Ht = !1;
        return Xv(W) ? (Ht = !0, OP(X)) : Ht = !1, X.memoizedState = He.state !== null && He.state !== void 0 ? He.state : null, $A(X), TT(X, He), oH(X, W, Q, V), a8(null, X, W, !0, Ht, V);
      } else {
        if (X.tag = f, X.mode & Za) {
          R1(!0);
          try {
            He = PH(null, X, W, Q, ie, V), xe = cH();
          } finally {
            R1(!1);
          }
        }
        return a1() && xe && qX(X), Ka(null, X, He, V), ec(X, W), X.child;
      }
    }
    function ec(h, X) {
      {
        if (X && X.childContextTypes && s("%s(...): childContextTypes cannot be defined on a function component.", X.displayName || X.name || "Component"), h.ref !== null) {
          var W = "", V = e1();
          V && (W += `

Check the render method of \`` + V + "`.");
          var Q = V || "", ie = h._debugSource;
          ie && (Q = ie.fileName + ":" + ie.lineNumber), i2[Q] || (i2[Q] = !0, s("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", W));
        }
        if (typeof X.getDerivedStateFromProps == "function") {
          var le = Li(X) || "Unknown";
          bH[le] || (s("%s: Function components do not support getDerivedStateFromProps.", le), bH[le] = !0);
        }
        if (typeof X.contextType == "object" && X.contextType !== null) {
          var He = Li(X) || "Unknown";
          t0[He] || (s("%s: Function components do not support contextType.", He), t0[He] = !0);
        }
      }
    }
    var r0 = {
      dehydrated: null,
      treeContext: null,
      retryLane: Zt
    };
    function f2(h) {
      return {
        baseLanes: h,
        cachePool: Bl(),
        transitions: null
      };
    }
    function A8(h, X) {
      var W = null;
      return {
        baseLanes: ts(h.baseLanes, X),
        cachePool: W,
        transitions: h.transitions
      };
    }
    function ax(h, X, W, V) {
      if (X !== null) {
        var Q = X.memoizedState;
        if (Q === null)
          return !1;
      }
      return EX(h, Yh);
    }
    function Sl(h, X) {
      return ou(h.childLanes, X);
    }
    function tw(h, X, W) {
      var V = X.pendingProps;
      yV(X) && (X.flags |= xi);
      var Q = xv.current, ie = !1, le = (X.flags & xi) !== fn;
      if (le || ax(Q, h) ? (ie = !0, X.flags &= ~xi) : (h === null || h.memoizedState !== null) && (Q = wT(Q, Vb)), Q = L3(Q), zP(X, Q), h === null) {
        AT(X);
        var He = X.memoizedState;
        if (He !== null) {
          var xe = He.dehydrated;
          if (xe !== null)
            return Ax(X, xe);
        }
        var Je = V.children, _e = V.fallback;
        if (ie) {
          var qt = ox(X, Je, _e, W), Ht = X.child;
          return Ht.memoizedState = f2(W), X.memoizedState = r0, qt;
        } else
          return _3(X, Je);
      } else {
        var Mt = h.memoizedState;
        if (Mt !== null) {
          var Lt = Mt.dehydrated;
          if (Lt !== null)
            return jH(h, X, le, V, Lt, Mt, W);
        }
        if (ie) {
          var or = V.fallback, yn = V.children, hi = d2(h, X, yn, or, W), Pi = X.child, Ks = h.child.memoizedState;
          return Pi.memoizedState = Ks === null ? f2(W) : A8(Ks, W), Pi.childLanes = Sl(h, W), X.memoizedState = r0, hi;
        } else {
          var Is = V.children, Vt = n0(h, X, Is, W);
          return X.memoizedState = null, Vt;
        }
      }
    }
    function _3(h, X, W) {
      var V = h.mode, Q = {
        mode: "visible",
        children: X
      }, ie = fx(Q, V);
      return ie.return = h, h.child = ie, ie;
    }
    function ox(h, X, W, V) {
      var Q = h.mode, ie = h.child, le = {
        mode: "hidden",
        children: X
      }, He, xe;
      return (Q & Ki) === Di && ie !== null ? (He = ie, He.childLanes = Ar, He.pendingProps = le, h.mode & wi && (He.actualDuration = 0, He.actualStartTime = -1, He.selfBaseDuration = 0, He.treeBaseDuration = 0), xe = yH(W, Q, V, null)) : (He = fx(le, Q), xe = yH(W, Q, V, null)), He.return = h, xe.return = h, He.sibling = xe, h.child = He, xe;
    }
    function fx(h, X, W) {
      return RU(h, X, Ar, null);
    }
    function A2(h, X) {
      return m2(h, X);
    }
    function n0(h, X, W, V) {
      var Q = h.child, ie = Q.sibling, le = A2(Q, {
        mode: "visible",
        children: W
      });
      if ((X.mode & Ki) === Di && (le.lanes = V), le.return = X, le.sibling = null, ie !== null) {
        var He = X.deletions;
        He === null ? (X.deletions = [ie], X.flags |= _s) : He.push(ie);
      }
      return X.child = le, le;
    }
    function d2(h, X, W, V, Q) {
      var ie = X.mode, le = h.child, He = le.sibling, xe = {
        mode: "hidden",
        children: W
      }, Je;
      if (
        // In legacy mode, we commit the primary tree as if it successfully
        // completed, even though it's in an inconsistent state.
        (ie & Ki) === Di && // Make sure we're on the second pass, i.e. the primary child fragment was
        // already cloned. In legacy mode, the only case where this isn't true is
        // when DevTools forces us to display a fallback; we skip the first render
        // pass entirely and go straight to rendering the fallback. (In Concurrent
        // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
        // only codepath.)
        X.child !== le
      ) {
        var _e = X.child;
        Je = _e, Je.childLanes = Ar, Je.pendingProps = xe, X.mode & wi && (Je.actualDuration = 0, Je.actualStartTime = -1, Je.selfBaseDuration = le.selfBaseDuration, Je.treeBaseDuration = le.treeBaseDuration), X.deletions = null;
      } else
        Je = A2(le, xe), Je.subtreeFlags = le.subtreeFlags & ef;
      var qt;
      return He !== null ? qt = m2(He, V) : (qt = yH(V, ie, Q, null), qt.flags |= Ms), qt.return = X, Je.return = X, Je.sibling = qt, X.child = Je, qt;
    }
    function Dv(h, X, W, V) {
      V !== null && Ih(V), JP(X, h.child, null, W);
      var Q = X.pendingProps, ie = Q.children, le = _3(X, ie);
      return le.flags |= Ms, X.memoizedState = null, le;
    }
    function d8(h, X, W, V, Q) {
      var ie = X.mode, le = {
        mode: "visible",
        children: W
      }, He = fx(le, ie), xe = yH(V, ie, Q, null);
      return xe.flags |= Ms, He.return = X, xe.return = X, He.sibling = xe, X.child = He, (X.mode & Ki) !== Di && JP(X, h.child, null, Q), xe;
    }
    function Ax(h, X, W) {
      return (h.mode & Ki) === Di ? (s("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components."), h.lanes = Ln) : pX(X) ? h.lanes = iu : h.lanes = s6, null;
    }
    function jH(h, X, W, V, Q, ie, le) {
      if (W)
        if (X.flags & Ya) {
          X.flags &= ~Ya;
          var Vt = rx(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));
          return Dv(h, X, le, Vt);
        } else {
          if (X.memoizedState !== null)
            return X.child = h.child, X.flags |= xi, null;
          var fr = V.children, Ct = V.fallback, Nr = d8(h, X, fr, Ct, le), kn = X.child;
          return kn.memoizedState = f2(le), X.memoizedState = r0, Nr;
        }
      else {
        if (Dj(), (X.mode & Ki) === Di)
          return Dv(
            h,
            X,
            le,
            // TODO: When we delete legacy mode, we should make this error argument
            // required — every concurrent mode path that causes hydration to
            // de-opt to client rendering should have an error message.
            null
          );
        if (pX(Q)) {
          var He, xe, Je;
          {
            var _e = uj(Q);
            He = _e.digest, xe = _e.message, Je = _e.stack;
          }
          var qt;
          xe ? qt = new Error(xe) : qt = new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");
          var Ht = rx(qt, He, Je);
          return Dv(h, X, le, Ht);
        }
        var Mt = F6(le, h.childLanes);
        if (n9 || Mt) {
          var Lt = R8();
          if (Lt !== null) {
            var or = x4(Lt, le);
            if (or !== Zt && or !== ie.retryLane) {
              ie.retryLane = or;
              var yn = Ma;
              l6(h, or), Qo(Lt, h, or, yn);
            }
          }
          K();
          var hi = rx(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));
          return Dv(h, X, le, hi);
        } else if (vj(Q)) {
          X.flags |= xi, X.child = h.child;
          var Pi = Nn.bind(null, h);
          return pB(Q, Pi), null;
        } else {
          oT(X, Q, ie.treeContext);
          var Ks = V.children, Is = _3(X, Ks);
          return Is.flags |= NA, Is;
        }
      }
    }
    function v2(h, X, W) {
      h.lanes = ts(h.lanes, X);
      var V = h.alternate;
      V !== null && (V.lanes = ts(V.lanes, X)), ql(h.return, X, W);
    }
    function v8(h, X, W) {
      for (var V = X; V !== null; ) {
        if (V.tag === j) {
          var Q = V.memoizedState;
          Q !== null && v2(V, W, h);
        } else if (V.tag === R)
          v2(V, W, h);
        else if (V.child !== null) {
          V.child.return = V, V = V.child;
          continue;
        }
        if (V === h)
          return;
        for (; V.sibling === null; ) {
          if (V.return === null || V.return === h)
            return;
          V = V.return;
        }
        V.sibling.return = V.return, V = V.sibling;
      }
    }
    function Vd(h) {
      for (var X = h, W = null; X !== null; ) {
        var V = X.alternate;
        V !== null && Id(V) === null && (W = X), X = X.sibling;
      }
      return W;
    }
    function $3(h) {
      if (h !== void 0 && h !== "forwards" && h !== "backwards" && h !== "together" && !c6[h])
        if (c6[h] = !0, typeof h == "string")
          switch (h.toLowerCase()) {
            case "together":
            case "forwards":
            case "backwards": {
              s('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', h, h.toLowerCase());
              break;
            }
            case "forward":
            case "backward": {
              s('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', h, h.toLowerCase());
              break;
            }
            default:
              s('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', h);
              break;
          }
        else
          s('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', h);
    }
    function wB(h, X) {
      h !== void 0 && !No[h] && (h !== "collapsed" && h !== "hidden" ? (No[h] = !0, s('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', h)) : X !== "forwards" && X !== "backwards" && (No[h] = !0, s('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', h)));
    }
    function W9(h, X) {
      {
        var W = cs(h), V = !W && typeof w1(h) == "function";
        if (W || V) {
          var Q = W ? "array" : "iterable";
          return s("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", Q, X, Q), !1;
        }
      }
      return !0;
    }
    function u8(h, X) {
      if ((X === "forwards" || X === "backwards") && h !== void 0 && h !== null && h !== !1)
        if (cs(h)) {
          for (var W = 0; W < h.length; W++)
            if (!W9(h[W], W))
              return;
        } else {
          var V = w1(h);
          if (typeof V == "function") {
            var Q = V.call(h);
            if (Q)
              for (var ie = Q.next(), le = 0; !ie.done; ie = Q.next()) {
                if (!W9(ie.value, le))
                  return;
                le++;
              }
          } else
            s('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', X);
        }
    }
    function nd(h, X, W, V, Q) {
      var ie = h.memoizedState;
      ie === null ? h.memoizedState = {
        isBackwards: X,
        rendering: null,
        renderingStartTime: 0,
        last: V,
        tail: W,
        tailMode: Q
      } : (ie.isBackwards = X, ie.rendering = null, ie.renderingStartTime = 0, ie.last = V, ie.tail = W, ie.tailMode = Q);
    }
    function dx(h, X, W) {
      var V = X.pendingProps, Q = V.revealOrder, ie = V.tail, le = V.children;
      $3(Q), wB(ie, Q), u8(le, Q), Ka(h, X, le, W);
      var He = xv.current, xe = EX(He, Yh);
      if (xe)
        He = lH(He, Yh), X.flags |= xi;
      else {
        var Je = h !== null && (h.flags & xi) !== fn;
        Je && v8(X, X.child, W), He = L3(He);
      }
      if (zP(X, He), (X.mode & Ki) === Di)
        X.memoizedState = null;
      else
        switch (Q) {
          case "forwards": {
            var _e = Vd(X.child), qt;
            _e === null ? (qt = X.child, X.child = null) : (qt = _e.sibling, _e.sibling = null), nd(
              X,
              !1,
              // isBackwards
              qt,
              _e,
              ie
            );
            break;
          }
          case "backwards": {
            var Ht = null, Mt = X.child;
            for (X.child = null; Mt !== null; ) {
              var Lt = Mt.alternate;
              if (Lt !== null && Id(Lt) === null) {
                X.child = Mt;
                break;
              }
              var or = Mt.sibling;
              Mt.sibling = Ht, Ht = Mt, Mt = or;
            }
            nd(
              X,
              !0,
              // isBackwards
              Ht,
              null,
              // last
              ie
            );
            break;
          }
          case "together": {
            nd(
              X,
              !1,
              // isBackwards
              null,
              // tail
              null,
              // last
              void 0
            );
            break;
          }
          default:
            X.memoizedState = null;
        }
      return X.child;
    }
    function rw(h, X, W) {
      xT(X, X.stateNode.containerInfo);
      var V = X.pendingProps;
      return h === null ? X.child = JP(X, null, V, W) : Ka(h, X, V, W), X.child;
    }
    var i0 = !1;
    function vx(h, X, W) {
      var V = X.type, Q = V._context, ie = X.pendingProps, le = X.memoizedProps, He = ie.value;
      {
        "value" in ie || i0 || (i0 = !0, s("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));
        var xe = X.type.propTypes;
        xe && L6(xe, ie, "prop", "Context.Provider");
      }
      if (_A(X, Q, He), le !== null) {
        var Je = le.value;
        if (On(Je, He)) {
          if (le.children === ie.children && !XX())
            return tc(h, X, W);
        } else
          Sj(X, Q, W);
      }
      var _e = ie.children;
      return Ka(h, X, _e, W), X.child;
    }
    var nw = !1;
    function mB(h, X, W) {
      var V = X.type;
      V._context === void 0 ? V !== V.Consumer && (nw || (nw = !0, s("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))) : V = V._context;
      var Q = X.pendingProps, ie = Q.children;
      typeof ie != "function" && s("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."), y3(X, W);
      var le = df(V);
      vv(X);
      var He;
      return e0.current = X, Bf(!0), He = ie(le), Bf(!1), lP(), X.flags |= Zu, Ka(h, X, He, W), X.child;
    }
    function s0() {
      n9 = !0;
    }
    function l8(h, X) {
      (X.mode & Ki) === Di && h !== null && (h.alternate = null, X.alternate = null, X.flags |= Ms);
    }
    function tc(h, X, W) {
      return h !== null && (X.dependencies = h.dependencies), _j(), U(X.lanes), F6(W, X.childLanes) ? (qB(h, X), X.child) : null;
    }
    function iw(h, X, W) {
      {
        var V = X.return;
        if (V === null)
          throw new Error("Cannot swap the root fiber.");
        if (h.alternate = null, X.alternate = null, W.index = X.index, W.sibling = X.sibling, W.return = X.return, W.ref = X.ref, X === V.child)
          V.child = W;
        else {
          var Q = V.child;
          if (Q === null)
            throw new Error("Expected parent to have a child.");
          for (; Q.sibling !== X; )
            if (Q = Q.sibling, Q === null)
              throw new Error("Expected to find the previous sibling.");
          Q.sibling = W;
        }
        var ie = V.deletions;
        return ie === null ? (V.deletions = [h], V.flags |= _s) : ie.push(h), W.flags |= Ms, W;
      }
    }
    function u2(h, X) {
      var W = h.lanes;
      return !!F6(W, X);
    }
    function P8(h, X, W) {
      switch (X.tag) {
        case v:
          ew(X), X.stateNode, Uh();
          break;
        case l:
          Rb(X);
          break;
        case o: {
          var V = X.type;
          Xv(V) && OP(X);
          break;
        }
        case u:
          xT(X, X.stateNode.containerInfo);
          break;
        case T: {
          var Q = X.memoizedProps.value, ie = X.type._context;
          _A(X, ie, Q);
          break;
        }
        case b:
          {
            var le = F6(W, X.childLanes);
            le && (X.flags |= Ni);
            {
              var He = X.stateNode;
              He.effectDuration = 0, He.passiveEffectDuration = 0;
            }
          }
          break;
        case j: {
          var xe = X.memoizedState;
          if (xe !== null) {
            if (xe.dehydrated !== null)
              return zP(X, L3(xv.current)), X.flags |= xi, null;
            var Je = X.child, _e = Je.childLanes;
            if (F6(W, _e))
              return tw(h, X, W);
            zP(X, L3(xv.current));
            var qt = tc(h, X, W);
            return qt !== null ? qt.sibling : null;
          } else
            zP(X, L3(xv.current));
          break;
        }
        case R: {
          var Ht = (h.flags & xi) !== fn, Mt = F6(W, X.childLanes);
          if (Ht) {
            if (Mt)
              return dx(h, X, W);
            X.flags |= xi;
          }
          var Lt = X.memoizedState;
          if (Lt !== null && (Lt.rendering = null, Lt.tail = null, Lt.lastEffect = null), zP(X, xv.current), Mt)
            break;
          return null;
        }
        case O:
        case Y:
          return X.lanes = Ar, G3(h, X, W);
      }
      return tc(h, X, W);
    }
    function c8(h, X, W) {
      if (X._debugNeedsRemount && h !== null)
        return iw(h, X, Iw(X.type, X.key, X.pendingProps, X._debugOwner || null, X.mode, X.lanes));
      if (h !== null) {
        var V = h.memoizedProps, Q = X.pendingProps;
        if (V !== Q || XX() || // Force a re-render if the implementation changed due to hot reload:
        X.type !== h.type)
          n9 = !0;
        else {
          var ie = u2(h, W);
          if (!ie && // If this is the second pass of an error or suspense boundary, there
          // may not be work scheduled on `current`, so we check for this flag.
          (X.flags & xi) === fn)
            return n9 = !1, P8(h, X, W);
          (h.flags & Yc) !== fn ? n9 = !0 : n9 = !1;
        }
      } else if (n9 = !1, a1() && gB(X)) {
        var le = X.index, He = bj();
        iT(X, He, le);
      }
      switch (X.lanes = Ar, X.tag) {
        case d:
          return $P(h, X, X.type, W);
        case I: {
          var xe = X.elementType;
          return sx(h, X, xe, W);
        }
        case f: {
          var Je = X.type, _e = X.pendingProps, qt = X.elementType === Je ? _e : Wd(Je, _e);
          return o2(h, X, Je, qt, W);
        }
        case o: {
          var Ht = X.type, Mt = X.pendingProps, Lt = X.elementType === Ht ? Mt : Wd(Ht, Mt);
          return ix(h, X, Ht, Lt, W);
        }
        case v:
          return xH(h, X, W);
        case l:
          return zn(h, X, W);
        case P:
          return f8(h, X);
        case j:
          return tw(h, X, W);
        case u:
          return rw(h, X, W);
        case q: {
          var or = X.type, yn = X.pendingProps, hi = X.elementType === or ? yn : Wd(or, yn);
          return n8(h, X, or, hi, W);
        }
        case p:
          return i8(h, X, W);
        case c:
          return Z3(h, X, W);
        case b:
          return s8(h, X, W);
        case T:
          return vx(h, X, W);
        case H:
          return mB(h, X, W);
        case w: {
          var Pi = X.type, Ks = X.pendingProps, Is = Wd(Pi, Ks);
          if (X.type !== X.elementType) {
            var Vt = Pi.propTypes;
            Vt && L6(
              Vt,
              Is,
              // Resolved for outer only
              "prop",
              Li(Pi)
            );
          }
          return Is = Wd(Pi.type, Is), lf(h, X, Pi, Is, W);
        }
        case m:
          return s2(h, X, X.type, X.pendingProps, W);
        case N: {
          var fr = X.type, Ct = X.pendingProps, Nr = X.elementType === fr ? Ct : Wd(fr, Ct);
          return DH(h, X, fr, Nr, W);
        }
        case R:
          return dx(h, X, W);
        case y:
          break;
        case O:
          return G3(h, X, W);
      }
      throw new Error("Unknown unit of work tag (" + X.tag + "). This error is likely caused by a bug in React. Please file an issue.");
    }
    function wu(h) {
      h.flags |= Ni;
    }
    function ux(h) {
      h.flags |= Uf, h.flags |= xg;
    }
    var lx, l2, P2, c2;
    lx = function(h, X, W, V) {
      for (var Q = X.child; Q !== null; ) {
        if (Q.tag === l || Q.tag === P)
          WP(h, Q.stateNode);
        else if (Q.tag !== u) {
          if (Q.child !== null) {
            Q.child.return = Q, Q = Q.child;
            continue;
          }
        }
        if (Q === X)
          return;
        for (; Q.sibling === null; ) {
          if (Q.return === null || Q.return === X)
            return;
          Q = Q.return;
        }
        Q.sibling.return = Q.return, Q = Q.sibling;
      }
    }, l2 = function(h, X) {
    }, P2 = function(h, X, W, V, Q) {
      var ie = h.memoizedProps;
      if (ie !== V) {
        var le = X.stateNode, He = kX(), xe = Q6(le, W, ie, V, Q, He);
        X.updateQueue = xe, xe && wu(X);
      }
    }, c2 = function(h, X, W, V) {
      W !== V && wu(X);
    };
    function p2(h, X) {
      if (!a1())
        switch (h.tailMode) {
          case "hidden": {
            for (var W = h.tail, V = null; W !== null; )
              W.alternate !== null && (V = W), W = W.sibling;
            V === null ? h.tail = null : V.sibling = null;
            break;
          }
          case "collapsed": {
            for (var Q = h.tail, ie = null; Q !== null; )
              Q.alternate !== null && (ie = Q), Q = Q.sibling;
            ie === null ? !X && h.tail !== null ? h.tail.sibling = null : h.tail = null : ie.sibling = null;
            break;
          }
        }
    }
    function Cf(h) {
      var X = h.alternate !== null && h.alternate.child === h.child, W = Ar, V = fn;
      if (X) {
        if ((h.mode & wi) !== Di) {
          for (var xe = h.selfBaseDuration, Je = h.child; Je !== null; )
            W = ts(W, ts(Je.lanes, Je.childLanes)), V |= Je.subtreeFlags & ef, V |= Je.flags & ef, xe += Je.treeBaseDuration, Je = Je.sibling;
          h.treeBaseDuration = xe;
        } else
          for (var _e = h.child; _e !== null; )
            W = ts(W, ts(_e.lanes, _e.childLanes)), V |= _e.subtreeFlags & ef, V |= _e.flags & ef, _e.return = h, _e = _e.sibling;
        h.subtreeFlags |= V;
      } else {
        if ((h.mode & wi) !== Di) {
          for (var Q = h.actualDuration, ie = h.selfBaseDuration, le = h.child; le !== null; )
            W = ts(W, ts(le.lanes, le.childLanes)), V |= le.subtreeFlags, V |= le.flags, Q += le.actualDuration, ie += le.treeBaseDuration, le = le.sibling;
          h.actualDuration = Q, h.treeBaseDuration = ie;
        } else
          for (var He = h.child; He !== null; )
            W = ts(W, ts(He.lanes, He.childLanes)), V |= He.subtreeFlags, V |= He.flags, He.return = h, He = He.sibling;
        h.subtreeFlags |= V;
      }
      return h.childLanes = W, X;
    }
    function BB(h, X, W) {
      if (mj() && (X.mode & Ki) !== Di && (X.flags & xi) === fn)
        return Bj(X), Uh(), X.flags |= Ya | lA | To, !1;
      var V = O3(X);
      if (W !== null && W.dehydrated !== null)
        if (h === null) {
          if (!V)
            throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
          if (vT(X), Cf(X), (X.mode & wi) !== Di) {
            var Q = W !== null;
            if (Q) {
              var ie = X.child;
              ie !== null && (X.treeBaseDuration -= ie.treeBaseDuration);
            }
          }
          return !1;
        } else {
          if (Uh(), (X.flags & xi) === fn && (X.memoizedState = null), X.flags |= Ni, Cf(X), (X.mode & wi) !== Di) {
            var le = W !== null;
            if (le) {
              var He = X.child;
              He !== null && (X.treeBaseDuration -= He.treeBaseDuration);
            }
          }
          return !1;
        }
      else
        return $7(), !0;
    }
    function sw(h, X, W) {
      var V = X.pendingProps;
      switch (Z7(X), X.tag) {
        case d:
        case I:
        case m:
        case f:
        case q:
        case p:
        case c:
        case b:
        case H:
        case w:
          return Cf(X), null;
        case o: {
          var Q = X.type;
          return Xv(Q) && K7(X), Cf(X), null;
        }
        case v: {
          var ie = X.stateNode;
          if (uH(X), hb(X), Lh(), ie.pendingContext && (ie.context = ie.pendingContext, ie.pendingContext = null), h === null || h.child === null) {
            var le = O3(X);
            if (le)
              wu(X);
            else if (h !== null) {
              var He = h.memoizedState;
              // Check if this is a client root
              (!He.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error)
              (X.flags & Ya) !== fn) && (X.flags |= I1, $7());
            }
          }
          return l2(h, X), Cf(X), null;
        }
        case l: {
          DT(X);
          var xe = bT(), Je = X.type;
          if (h !== null && X.stateNode != null)
            P2(h, X, Je, V, xe), h.ref !== X.ref && ux(X);
          else {
            if (!V) {
              if (X.stateNode === null)
                throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
              return Cf(X), null;
            }
            var _e = kX(), qt = O3(X);
            if (qt)
              dT(X, xe, _e) && wu(X);
            else {
              var Ht = J4(Je, V, xe, _e, X);
              lx(Ht, X, !1, !1), X.stateNode = Ht, w3(Ht, Je, V, xe) && wu(X);
            }
            X.ref !== null && ux(X);
          }
          return Cf(X), null;
        }
        case P: {
          var Mt = V;
          if (h && X.stateNode != null) {
            var Lt = h.memoizedProps;
            c2(h, X, Lt, Mt);
          } else {
            if (typeof Mt != "string" && X.stateNode === null)
              throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
            var or = bT(), yn = kX(), hi = O3(X);
            hi ? _7(X) && wu(X) : X.stateNode = fb(Mt, or, yn, X);
          }
          return Cf(X), null;
        }
        case j: {
          Mh(X);
          var Pi = X.memoizedState;
          if (h === null || h.memoizedState !== null && h.memoizedState.dehydrated !== null) {
            var Ks = BB(h, X, Pi);
            if (!Ks)
              return X.flags & To ? X : null;
          }
          if ((X.flags & xi) !== fn)
            return X.lanes = W, (X.mode & wi) !== Di && tx(X), X;
          var Is = Pi !== null, Vt = h !== null && h.memoizedState !== null;
          if (Is !== Vt && Is) {
            var fr = X.child;
            if (fr.flags |= _u, (X.mode & Ki) !== Di) {
              var Ct = h === null && (X.memoizedProps.unstable_avoidThisFallback !== !0 || !L);
              Ct || EX(xv.current, Vb) ? F() : K();
            }
          }
          var Nr = X.updateQueue;
          if (Nr !== null && (X.flags |= Ni), Cf(X), (X.mode & wi) !== Di && Is) {
            var kn = X.child;
            kn !== null && (X.treeBaseDuration -= kn.treeBaseDuration);
          }
          return null;
        }
        case u:
          return uH(X), l2(h, X), h === null && W3(X.stateNode.containerInfo), Cf(X), null;
        case T:
          var mn = X.type._context;
          return YP(mn, X), Cf(X), null;
        case N: {
          var Ei = X.type;
          return Xv(Ei) && K7(X), Cf(X), null;
        }
        case R: {
          Mh(X);
          var rs = X.memoizedState;
          if (rs === null)
            return Cf(X), null;
          var ro = (X.flags & xi) !== fn, oa = rs.rendering;
          if (oa === null)
            if (ro)
              p2(rs, !1);
            else {
              var a9 = ce() && (h === null || (h.flags & xi) === fn);
              if (!a9)
                for (var ha = X.child; ha !== null; ) {
                  var Of = Id(ha);
                  if (Of !== null) {
                    ro = !0, X.flags |= xi, p2(rs, !1);
                    var bA = Of.updateQueue;
                    return bA !== null && (X.updateQueue = bA, X.flags |= Ni), X.subtreeFlags = fn, yX(X, W), zP(X, lH(xv.current, Yh)), X.child;
                  }
                  ha = ha.sibling;
                }
              rs.tail !== null && qo() > Dx() && (X.flags |= xi, ro = !0, p2(rs, !1), X.lanes = Rg);
            }
          else {
            if (!ro) {
              var xA = Id(oa);
              if (xA !== null) {
                X.flags |= xi, ro = !0;
                var Wu = xA.updateQueue;
                if (Wu !== null && (X.updateQueue = Wu, X.flags |= Ni), p2(rs, !0), rs.tail === null && rs.tailMode === "hidden" && !oa.alternate && !a1())
                  return Cf(X), null;
              } else
                // The time it took to render last row is greater than the remaining
                // time we have to render. So rendering one more row would likely
                // exceed it.
                qo() * 2 - rs.renderingStartTime > Dx() && W !== s6 && (X.flags |= xi, ro = !0, p2(rs, !1), X.lanes = Rg);
            }
            if (rs.isBackwards)
              oa.sibling = X.child, X.child = oa;
            else {
              var kd = rs.last;
              kd !== null ? kd.sibling = oa : X.child = oa, rs.last = oa;
            }
          }
          if (rs.tail !== null) {
            var Ed = rs.tail;
            rs.rendering = Ed, rs.tail = Ed.sibling, rs.renderingStartTime = qo(), Ed.sibling = null;
            var sd = xv.current;
            return ro ? sd = lH(sd, Yh) : sd = L3(sd), zP(X, sd), Ed;
          }
          return Cf(X), null;
        }
        case y:
          break;
        case O:
        case Y: {
          Sx(X);
          var c0 = X.memoizedState, E8 = c0 !== null;
          if (h !== null) {
            var kx = h.memoizedState, fp = kx !== null;
            fp !== E8 && // LegacyHidden doesn't do any hiding — it only pre-renders.
            !G && (X.flags |= _u);
          }
          return !E8 || (X.mode & Ki) === Di ? Cf(X) : F6(Il, s6) && (Cf(X), X.subtreeFlags & (Ms | Ni) && (X.flags |= _u)), null;
        }
        case ee:
          return null;
        case Z:
          return null;
      }
      throw new Error("Unknown unit of work tag (" + X.tag + "). This error is likely caused by a bug in React. Please file an issue.");
    }
    function WB(h, X, W) {
      switch (Z7(X), X.tag) {
        case o: {
          var V = X.type;
          Xv(V) && K7(X);
          var Q = X.flags;
          return Q & To ? (X.flags = Q & ~To | xi, (X.mode & wi) !== Di && tx(X), X) : null;
        }
        case v: {
          X.stateNode, uH(X), hb(X), Lh();
          var ie = X.flags;
          return (ie & To) !== fn && (ie & xi) === fn ? (X.flags = ie & ~To | xi, X) : null;
        }
        case l:
          return DT(X), null;
        case j: {
          Mh(X);
          var le = X.memoizedState;
          if (le !== null && le.dehydrated !== null) {
            if (X.alternate === null)
              throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
            Uh();
          }
          var He = X.flags;
          return He & To ? (X.flags = He & ~To | xi, (X.mode & wi) !== Di && tx(X), X) : null;
        }
        case R:
          return Mh(X), null;
        case u:
          return uH(X), null;
        case T:
          var xe = X.type._context;
          return YP(xe, X), null;
        case O:
        case Y:
          return Sx(X), null;
        case ee:
          return null;
        default:
          return null;
      }
    }
    function Px(h, X, W) {
      switch (Z7(X), X.tag) {
        case o: {
          var V = X.type.childContextTypes;
          V != null && K7(X);
          break;
        }
        case v: {
          X.stateNode, uH(X), hb(X), Lh();
          break;
        }
        case l: {
          DT(X);
          break;
        }
        case u:
          uH(X);
          break;
        case j:
          Mh(X);
          break;
        case R:
          Mh(X);
          break;
        case T:
          var Q = X.type._context;
          YP(Q, X);
          break;
        case O:
        case Y:
          Sx(X);
          break;
      }
    }
    var wH = null;
    wH = /* @__PURE__ */ new Set();
    var p8 = !1, p6 = !1, SB = typeof WeakSet == "function" ? WeakSet : Set, Qn = null, ep = null, mH = null;
    function a0(h) {
      _9(null, function() {
        throw h;
      }), bg();
    }
    var UB = function(h, X) {
      if (X.props = h.memoizedProps, X.state = h.memoizedState, h.mode & wi)
        try {
          Du(), X.componentWillUnmount();
        } finally {
          ml(h);
        }
      else
        X.componentWillUnmount();
    };
    function aw(h, X) {
      try {
        Ul(ui, h);
      } catch (W) {
        ht(h, X, W);
      }
    }
    function cx(h, X, W) {
      try {
        UB(h, W);
      } catch (V) {
        ht(h, X, V);
      }
    }
    function IB(h, X, W) {
      try {
        W.componentDidMount();
      } catch (V) {
        ht(h, X, V);
      }
    }
    function jv(h, X) {
      try {
        Aw(h);
      } catch (W) {
        ht(h, X, W);
      }
    }
    function BH(h, X) {
      var W = h.ref;
      if (W !== null)
        if (typeof W == "function") {
          var V;
          try {
            if (me && Xe && h.mode & wi)
              try {
                Du(), V = W(null);
              } finally {
                ml(h);
              }
            else
              V = W(null);
          } catch (Q) {
            ht(h, X, Q);
          }
          typeof V == "function" && s("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", Fn(h));
        } else
          W.current = null;
    }
    function h2(h, X, W) {
      try {
        W();
      } catch (V) {
        ht(h, X, V);
      }
    }
    var ow = !1;
    function RB(h, X) {
      hu(h.containerInfo), Qn = X, px();
      var W = ow;
      return ow = !1, W;
    }
    function px() {
      for (; Qn !== null; ) {
        var h = Qn, X = h.child;
        (h.subtreeFlags & Mc) !== fn && X !== null ? (X.return = h, Qn = X) : VB();
      }
    }
    function VB() {
      for (; Qn !== null; ) {
        var h = Qn;
        vs(h);
        try {
          fw(h);
        } catch (W) {
          ht(h, h.return, W);
        }
        Ua();
        var X = h.sibling;
        if (X !== null) {
          X.return = h.return, Qn = X;
          return;
        }
        Qn = h.return;
      }
    }
    function fw(h) {
      var X = h.alternate, W = h.flags;
      if ((W & I1) !== fn) {
        switch (vs(h), h.tag) {
          case f:
          case q:
          case m:
            break;
          case o: {
            if (X !== null) {
              var V = X.memoizedProps, Q = X.memoizedState, ie = h.stateNode;
              h.type === h.elementType && !Ti && (ie.props !== h.memoizedProps && s("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Fn(h) || "instance"), ie.state !== h.memoizedState && s("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Fn(h) || "instance"));
              var le = ie.getSnapshotBeforeUpdate(h.elementType === h.type ? V : Wd(h.type, V), Q);
              {
                var He = wH;
                le === void 0 && !He.has(h.type) && (He.add(h.type), s("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", Fn(h)));
              }
              ie.__reactInternalSnapshotBeforeUpdate = le;
            }
            break;
          }
          case v: {
            {
              var xe = h.stateNode;
              lB(xe.containerInfo);
            }
            break;
          }
          case l:
          case P:
          case u:
          case N:
            break;
          default:
            throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
        }
        Ua();
      }
    }
    function mu(h, X, W) {
      var V = X.updateQueue, Q = V !== null ? V.lastEffect : null;
      if (Q !== null) {
        var ie = Q.next, le = ie;
        do {
          if ((le.tag & h) === h) {
            var He = le.destroy;
            le.destroy = void 0, He !== void 0 && ((h & Vf) !== Eo ? d7(X) : (h & ui) !== Eo && kp(X), (h & ed) !== Eo && O8(!0), h2(X, W, He), (h & ed) !== Eo && O8(!1), (h & Vf) !== Eo ? v7() : (h & ui) !== Eo && Jc());
          }
          le = le.next;
        } while (le !== ie);
      }
    }
    function Ul(h, X) {
      var W = X.updateQueue, V = W !== null ? W.lastEffect : null;
      if (V !== null) {
        var Q = V.next, ie = Q;
        do {
          if ((ie.tag & h) === h) {
            (h & Vf) !== Eo ? H4(X) : (h & ui) !== Eo && Wg(X);
            var le = ie.create;
            (h & ed) !== Eo && O8(!0), ie.destroy = le(), (h & ed) !== Eo && O8(!1), (h & Vf) !== Eo ? Bg() : (h & ui) !== Eo && g4();
            {
              var He = ie.destroy;
              if (He !== void 0 && typeof He != "function") {
                var xe = void 0;
                (ie.tag & ui) !== fn ? xe = "useLayoutEffect" : (ie.tag & ed) !== fn ? xe = "useInsertionEffect" : xe = "useEffect";
                var Je = void 0;
                He === null ? Je = " You returned null. If your effect does not require clean up, return undefined (or nothing)." : typeof He.then == "function" ? Je = `

It looks like you wrote ` + xe + `(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:

` + xe + `(() => {
  async function fetchData() {
    // You can await here
    const response = await MyAPI.getData(someId);
    // ...
  }
  fetchData();
}, [someId]); // Or [] if effect doesn't need props or state

Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching` : Je = " You returned: " + He, s("%s must not return anything besides a function, which is used for clean-up.%s", xe, Je);
              }
            }
          }
          ie = ie.next;
        } while (ie !== Q);
      }
    }
    function tp(h, X) {
      if ((X.flags & Ni) !== fn)
        switch (X.tag) {
          case b: {
            var W = X.stateNode.passiveEffectDuration, V = X.memoizedProps, Q = V.id, ie = V.onPostCommit, le = GT(), He = X.alternate === null ? "mount" : "update";
            Gj() && (He = "nested-update"), typeof ie == "function" && ie(Q, He, W, le);
            var xe = X.return;
            e:
              for (; xe !== null; ) {
                switch (xe.tag) {
                  case v:
                    var Je = xe.stateNode;
                    Je.passiveEffectDuration += W;
                    break e;
                  case b:
                    var _e = xe.stateNode;
                    _e.passiveEffectDuration += W;
                    break e;
                }
                xe = xe.return;
              }
            break;
          }
        }
    }
    function hx(h, X, W, V) {
      if ((W.flags & zf) !== fn)
        switch (W.tag) {
          case f:
          case q:
          case m: {
            if (!p6)
              if (W.mode & wi)
                try {
                  Du(), Ul(ui | N1, W);
                } finally {
                  ml(W);
                }
              else
                Ul(ui | N1, W);
            break;
          }
          case o: {
            var Q = W.stateNode;
            if (W.flags & Ni && !p6)
              if (X === null)
                if (W.type === W.elementType && !Ti && (Q.props !== W.memoizedProps && s("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Fn(W) || "instance"), Q.state !== W.memoizedState && s("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Fn(W) || "instance")), W.mode & wi)
                  try {
                    Du(), Q.componentDidMount();
                  } finally {
                    ml(W);
                  }
                else
                  Q.componentDidMount();
              else {
                var ie = W.elementType === W.type ? X.memoizedProps : Wd(W.type, X.memoizedProps), le = X.memoizedState;
                if (W.type === W.elementType && !Ti && (Q.props !== W.memoizedProps && s("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Fn(W) || "instance"), Q.state !== W.memoizedState && s("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Fn(W) || "instance")), W.mode & wi)
                  try {
                    Du(), Q.componentDidUpdate(ie, le, Q.__reactInternalSnapshotBeforeUpdate);
                  } finally {
                    ml(W);
                  }
                else
                  Q.componentDidUpdate(ie, le, Q.__reactInternalSnapshotBeforeUpdate);
              }
            var He = W.updateQueue;
            He !== null && (W.type === W.elementType && !Ti && (Q.props !== W.memoizedProps && s("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Fn(W) || "instance"), Q.state !== W.memoizedState && s("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Fn(W) || "instance")), Ud(W, He, Q));
            break;
          }
          case v: {
            var xe = W.updateQueue;
            if (xe !== null) {
              var Je = null;
              if (W.child !== null)
                switch (W.child.tag) {
                  case l:
                    Je = W.child.stateNode;
                    break;
                  case o:
                    Je = W.child.stateNode;
                    break;
                }
              Ud(W, xe, Je);
            }
            break;
          }
          case l: {
            var _e = W.stateNode;
            if (X === null && W.flags & Ni) {
              var qt = W.type, Ht = W.memoizedProps;
              z4(_e, qt, Ht);
            }
            break;
          }
          case P:
            break;
          case u:
            break;
          case b: {
            {
              var Mt = W.memoizedProps, Lt = Mt.onCommit, or = Mt.onRender, yn = W.stateNode.effectDuration, hi = GT(), Pi = X === null ? "mount" : "update";
              Gj() && (Pi = "nested-update"), typeof or == "function" && or(W.memoizedProps.id, Pi, W.actualDuration, W.treeBaseDuration, W.actualStartTime, hi);
              {
                typeof Lt == "function" && Lt(W.memoizedProps.id, Pi, yn, hi), Si(W);
                var Ks = W.return;
                e:
                  for (; Ks !== null; ) {
                    switch (Ks.tag) {
                      case v:
                        var Is = Ks.stateNode;
                        Is.effectDuration += yn;
                        break e;
                      case b:
                        var Vt = Ks.stateNode;
                        Vt.effectDuration += yn;
                        break e;
                    }
                    Ks = Ks.return;
                  }
              }
            }
            break;
          }
          case j: {
            X8(h, W);
            break;
          }
          case R:
          case N:
          case y:
          case O:
          case Y:
          case Z:
            break;
          default:
            throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
        }
      p6 || W.flags & Uf && Aw(W);
    }
    function CB(h) {
      switch (h.tag) {
        case f:
        case q:
        case m: {
          if (h.mode & wi)
            try {
              Du(), aw(h, h.return);
            } finally {
              ml(h);
            }
          else
            aw(h, h.return);
          break;
        }
        case o: {
          var X = h.stateNode;
          typeof X.componentDidMount == "function" && IB(h, h.return, X), jv(h, h.return);
          break;
        }
        case l: {
          jv(h, h.return);
          break;
        }
      }
    }
    function OB(h, X) {
      for (var W = null, V = h; ; ) {
        if (V.tag === l) {
          if (W === null) {
            W = V;
            try {
              var Q = V.stateNode;
              X ? Z4(Q) : xh(V.stateNode, V.memoizedProps);
            } catch (le) {
              ht(h, h.return, le);
            }
          }
        } else if (V.tag === P) {
          if (W === null)
            try {
              var ie = V.stateNode;
              X ? pl(ie) : uB(ie, V.memoizedProps);
            } catch (le) {
              ht(h, h.return, le);
            }
        } else if (!((V.tag === O || V.tag === Y) && V.memoizedState !== null && V !== h)) {
          if (V.child !== null) {
            V.child.return = V, V = V.child;
            continue;
          }
        }
        if (V === h)
          return;
        for (; V.sibling === null; ) {
          if (V.return === null || V.return === h)
            return;
          W === V && (W = null), V = V.return;
        }
        W === V && (W = null), V.sibling.return = V.return, V = V.sibling;
      }
    }
    function Aw(h) {
      var X = h.ref;
      if (X !== null) {
        var W = h.stateNode, V;
        switch (h.tag) {
          case l:
            V = W;
            break;
          default:
            V = W;
        }
        if (typeof X == "function") {
          var Q;
          if (h.mode & wi)
            try {
              Du(), Q = X(V);
            } finally {
              ml(h);
            }
          else
            Q = X(V);
          typeof Q == "function" && s("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", Fn(h));
        } else
          X.hasOwnProperty("current") || s("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", Fn(h)), X.current = V;
      }
    }
    function yB(h) {
      var X = h.alternate;
      X !== null && (X.return = null), h.return = null;
    }
    function h8(h) {
      var X = h.alternate;
      X !== null && (h.alternate = null, h8(X));
      {
        if (h.child = null, h.deletions = null, h.sibling = null, h.tag === l) {
          var W = h.stateNode;
          W !== null && ZA(W);
        }
        h.stateNode = null, h._debugOwner = null, h.return = null, h.dependencies = null, h.memoizedProps = null, h.memoizedState = null, h.pendingProps = null, h.stateNode = null, h.updateQueue = null;
      }
    }
    function H8(h) {
      for (var X = h.return; X !== null; ) {
        if (Hx(X))
          return X;
        X = X.return;
      }
      throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
    }
    function Hx(h) {
      return h.tag === l || h.tag === v || h.tag === u;
    }
    function WH(h) {
      var X = h;
      e:
        for (; ; ) {
          for (; X.sibling === null; ) {
            if (X.return === null || Hx(X.return))
              return null;
            X = X.return;
          }
          for (X.sibling.return = X.return, X = X.sibling; X.tag !== l && X.tag !== P && X.tag !== k; ) {
            if (X.flags & Ms || X.child === null || X.tag === u)
              continue e;
            X.child.return = X, X = X.child;
          }
          if (!(X.flags & Ms))
            return X.stateNode;
        }
    }
    function kB(h) {
      var X = H8(h);
      switch (X.tag) {
        case l: {
          var W = X.stateNode;
          X.flags & bi && (y7(W), X.flags &= ~bi);
          var V = WH(h);
          g8(h, V, W);
          break;
        }
        case v:
        case u: {
          var Q = X.stateNode.containerInfo, ie = WH(h);
          H2(h, ie, Q);
          break;
        }
        default:
          throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
      }
    }
    function H2(h, X, W) {
      var V = h.tag, Q = V === l || V === P;
      if (Q) {
        var ie = h.stateNode;
        X ? oj(W, ie, X) : aj(W, ie);
      } else if (V !== u) {
        var le = h.child;
        if (le !== null) {
          H2(le, X, W);
          for (var He = le.sibling; He !== null; )
            H2(He, X, W), He = He.sibling;
        }
      }
    }
    function g8(h, X, W) {
      var V = h.tag, Q = V === l || V === P;
      if (Q) {
        var ie = h.stateNode;
        X ? G4(W, ie, X) : db(W, ie);
      } else if (V !== u) {
        var le = h.child;
        if (le !== null) {
          g8(le, X, W);
          for (var He = le.sibling; He !== null; )
            g8(He, X, W), He = He.sibling;
        }
      }
    }
    var S9 = null, id = !1;
    function EB(h, X, W) {
      {
        var V = X;
        e:
          for (; V !== null; ) {
            switch (V.tag) {
              case l: {
                S9 = V.stateNode, id = !1;
                break e;
              }
              case v: {
                S9 = V.stateNode.containerInfo, id = !0;
                break e;
              }
              case u: {
                S9 = V.stateNode.containerInfo, id = !0;
                break e;
              }
            }
            V = V.return;
          }
        if (S9 === null)
          throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
        gx(h, X, W), S9 = null, id = !1;
      }
      yB(W);
    }
    function wv(h, X, W) {
      for (var V = W.child; V !== null; )
        gx(h, X, V), V = V.sibling;
    }
    function gx(h, X, W) {
      switch (uP(W), W.tag) {
        case l:
          p6 || BH(W, X);
        case P: {
          {
            var V = S9, Q = id;
            S9 = null, wv(h, X, W), S9 = V, id = Q, S9 !== null && (id ? vb(S9, W.stateNode) : fj(S9, W.stateNode));
          }
          return;
        }
        case k: {
          S9 !== null && (id ? Aj(S9, W.stateNode) : k7(S9, W.stateNode));
          return;
        }
        case u: {
          {
            var ie = S9, le = id;
            S9 = W.stateNode.containerInfo, id = !0, wv(h, X, W), S9 = ie, id = le;
          }
          return;
        }
        case f:
        case q:
        case w:
        case m: {
          if (!p6) {
            var He = W.updateQueue;
            if (He !== null) {
              var xe = He.lastEffect;
              if (xe !== null) {
                var Je = xe.next, _e = Je;
                do {
                  var qt = _e, Ht = qt.destroy, Mt = qt.tag;
                  Ht !== void 0 && ((Mt & ed) !== Eo ? h2(W, X, Ht) : (Mt & ui) !== Eo && (kp(W), W.mode & wi ? (Du(), h2(W, X, Ht), ml(W)) : h2(W, X, Ht), Jc())), _e = _e.next;
                } while (_e !== Je);
              }
            }
          }
          wv(h, X, W);
          return;
        }
        case o: {
          if (!p6) {
            BH(W, X);
            var Lt = W.stateNode;
            typeof Lt.componentWillUnmount == "function" && cx(W, X, Lt);
          }
          wv(h, X, W);
          return;
        }
        case y: {
          wv(h, X, W);
          return;
        }
        case O: {
          if (
            // TODO: Remove this dead flag
            W.mode & Ki
          ) {
            var or = p6;
            p6 = or || W.memoizedState !== null, wv(h, X, W), p6 = or;
          } else
            wv(h, X, W);
          break;
        }
        default: {
          wv(h, X, W);
          return;
        }
      }
    }
    function dw(h) {
      h.memoizedState;
    }
    function X8(h, X) {
      var W = X.memoizedState;
      if (W === null) {
        var V = X.alternate;
        if (V !== null) {
          var Q = V.memoizedState;
          if (Q !== null) {
            var ie = Q.dehydrated;
            ie !== null && SP(ie);
          }
        }
      }
    }
    function vw(h) {
      var X = h.updateQueue;
      if (X !== null) {
        h.updateQueue = null;
        var W = h.stateNode;
        W === null && (W = h.stateNode = new SB()), X.forEach(function(V) {
          var Q = Fs.bind(null, h, V);
          if (!W.has(V)) {
            if (W.add(V), rf)
              if (ep !== null && mH !== null)
                op(mH, ep);
              else
                throw Error("Expected finished root and lanes to be set. This is a bug in React.");
            V.then(Q, Q);
          }
        });
      }
    }
    function uw(h, X, W) {
      ep = W, mH = h, vs(X), T8(X, h), vs(X), ep = null, mH = null;
    }
    function Bu(h, X, W) {
      var V = X.deletions;
      if (V !== null)
        for (var Q = 0; Q < V.length; Q++) {
          var ie = V[Q];
          try {
            EB(h, X, ie);
          } catch (xe) {
            ht(ie, X, xe);
          }
        }
      var le = R6();
      if (X.subtreeFlags & t6)
        for (var He = X.child; He !== null; )
          vs(He), T8(He, h), He = He.sibling;
      vs(le);
    }
    function T8(h, X, W) {
      var V = h.alternate, Q = h.flags;
      switch (h.tag) {
        case f:
        case q:
        case w:
        case m: {
          if (Bu(X, h), Cd(h), Q & Ni) {
            try {
              mu(ed | N1, h, h.return), Ul(ed | N1, h);
            } catch (Ei) {
              ht(h, h.return, Ei);
            }
            if (h.mode & wi) {
              try {
                Du(), mu(ui | N1, h, h.return);
              } catch (Ei) {
                ht(h, h.return, Ei);
              }
              ml(h);
            } else
              try {
                mu(ui | N1, h, h.return);
              } catch (Ei) {
                ht(h, h.return, Ei);
              }
          }
          return;
        }
        case o: {
          Bu(X, h), Cd(h), Q & Uf && V !== null && BH(V, V.return);
          return;
        }
        case l: {
          Bu(X, h), Cd(h), Q & Uf && V !== null && BH(V, V.return);
          {
            if (h.flags & bi) {
              var ie = h.stateNode;
              try {
                y7(ie);
              } catch (Ei) {
                ht(h, h.return, Ei);
              }
            }
            if (Q & Ni) {
              var le = h.stateNode;
              if (le != null) {
                var He = h.memoizedProps, xe = V !== null ? V.memoizedProps : He, Je = h.type, _e = h.updateQueue;
                if (h.updateQueue = null, _e !== null)
                  try {
                    cl(le, _e, Je, xe, He, h);
                  } catch (Ei) {
                    ht(h, h.return, Ei);
                  }
              }
            }
          }
          return;
        }
        case P: {
          if (Bu(X, h), Cd(h), Q & Ni) {
            if (h.stateNode === null)
              throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
            var qt = h.stateNode, Ht = h.memoizedProps, Mt = V !== null ? V.memoizedProps : Ht;
            try {
              Ab(qt, Mt, Ht);
            } catch (Ei) {
              ht(h, h.return, Ei);
            }
          }
          return;
        }
        case v: {
          if (Bu(X, h), Cd(h), Q & Ni && V !== null) {
            var Lt = V.memoizedState;
            if (Lt.isDehydrated)
              try {
                jh(X.containerInfo);
              } catch (Ei) {
                ht(h, h.return, Ei);
              }
          }
          return;
        }
        case u: {
          Bu(X, h), Cd(h);
          return;
        }
        case j: {
          Bu(X, h), Cd(h);
          var or = h.child;
          if (or.flags & _u) {
            var yn = or.stateNode, hi = or.memoizedState, Pi = hi !== null;
            if (yn.isHidden = Pi, Pi) {
              var Ks = or.alternate !== null && or.alternate.memoizedState !== null;
              Ks || x();
            }
          }
          if (Q & Ni) {
            try {
              dw(h);
            } catch (Ei) {
              ht(h, h.return, Ei);
            }
            vw(h);
          }
          return;
        }
        case O: {
          var Is = V !== null && V.memoizedState !== null;
          if (
            // TODO: Remove this dead flag
            h.mode & Ki
          ) {
            var Vt = p6;
            p6 = Vt || Is, Bu(X, h), p6 = Vt;
          } else
            Bu(X, h);
          if (Cd(h), Q & _u) {
            var fr = h.stateNode, Ct = h.memoizedState, Nr = Ct !== null, kn = h;
            if (fr.isHidden = Nr, Nr && !Is && (kn.mode & Ki) !== Di) {
              Qn = kn;
              for (var mn = kn.child; mn !== null; )
                Qn = mn, Pw(mn), mn = mn.sibling;
            }
            OB(kn, Nr);
          }
          return;
        }
        case R: {
          Bu(X, h), Cd(h), Q & Ni && vw(h);
          return;
        }
        case y:
          return;
        default: {
          Bu(X, h), Cd(h);
          return;
        }
      }
    }
    function Cd(h) {
      var X = h.flags;
      if (X & Ms) {
        try {
          kB(h);
        } catch (W) {
          ht(h, h.return, W);
        }
        h.flags &= ~Ms;
      }
      X & NA && (h.flags &= ~NA);
    }
    function lw(h, X, W) {
      ep = W, mH = X, Qn = h, rc(h, X, W), ep = null, mH = null;
    }
    function rc(h, X, W) {
      for (var V = (h.mode & Ki) !== Di; Qn !== null; ) {
        var Q = Qn, ie = Q.child;
        if (Q.tag === O && V) {
          var le = Q.memoizedState !== null, He = le || p8;
          if (He) {
            q8(h, X, W);
            continue;
          } else {
            var xe = Q.alternate, Je = xe !== null && xe.memoizedState !== null, _e = Je || p6, qt = p8, Ht = p6;
            p8 = He, p6 = _e, p6 && !Ht && (Qn = Q, FB(Q));
            for (var Mt = ie; Mt !== null; )
              Qn = Mt, rc(
                Mt,
                // New root; bubble back up to here and stop.
                X,
                W
              ), Mt = Mt.sibling;
            Qn = Q, p8 = qt, p6 = Ht, q8(h, X, W);
            continue;
          }
        }
        (Q.subtreeFlags & zf) !== fn && ie !== null ? (ie.return = Q, Qn = ie) : q8(h, X, W);
      }
    }
    function q8(h, X, W) {
      for (; Qn !== null; ) {
        var V = Qn;
        if ((V.flags & zf) !== fn) {
          var Q = V.alternate;
          vs(V);
          try {
            hx(X, Q, V, W);
          } catch (le) {
            ht(V, V.return, le);
          }
          Ua();
        }
        if (V === h) {
          Qn = null;
          return;
        }
        var ie = V.sibling;
        if (ie !== null) {
          ie.return = V.return, Qn = ie;
          return;
        }
        Qn = V.return;
      }
    }
    function Pw(h) {
      for (; Qn !== null; ) {
        var X = Qn, W = X.child;
        switch (X.tag) {
          case f:
          case q:
          case w:
          case m: {
            if (X.mode & wi)
              try {
                Du(), mu(ui, X, X.return);
              } finally {
                ml(X);
              }
            else
              mu(ui, X, X.return);
            break;
          }
          case o: {
            BH(X, X.return);
            var V = X.stateNode;
            typeof V.componentWillUnmount == "function" && cx(X, X.return, V);
            break;
          }
          case l: {
            BH(X, X.return);
            break;
          }
          case O: {
            var Q = X.memoizedState !== null;
            if (Q) {
              Xx(h);
              continue;
            }
            break;
          }
        }
        W !== null ? (W.return = X, Qn = W) : Xx(h);
      }
    }
    function Xx(h) {
      for (; Qn !== null; ) {
        var X = Qn;
        if (X === h) {
          Qn = null;
          return;
        }
        var W = X.sibling;
        if (W !== null) {
          W.return = X.return, Qn = W;
          return;
        }
        Qn = X.return;
      }
    }
    function FB(h) {
      for (; Qn !== null; ) {
        var X = Qn, W = X.child;
        if (X.tag === O) {
          var V = X.memoizedState !== null;
          if (V) {
            g2(h);
            continue;
          }
        }
        W !== null ? (W.return = X, Qn = W) : g2(h);
      }
    }
    function g2(h) {
      for (; Qn !== null; ) {
        var X = Qn;
        vs(X);
        try {
          CB(X);
        } catch (V) {
          ht(X, X.return, V);
        }
        if (Ua(), X === h) {
          Qn = null;
          return;
        }
        var W = X.sibling;
        if (W !== null) {
          W.return = X.return, Qn = W;
          return;
        }
        Qn = X.return;
      }
    }
    function mv(h, X, W, V) {
      Qn = X, SH(X, h, W, V);
    }
    function SH(h, X, W, V) {
      for (; Qn !== null; ) {
        var Q = Qn, ie = Q.child;
        (Q.subtreeFlags & PA) !== fn && ie !== null ? (ie.return = Q, Qn = ie) : cw(h, X, W, V);
      }
    }
    function cw(h, X, W, V) {
      for (; Qn !== null; ) {
        var Q = Qn;
        if ((Q.flags & vo) !== fn) {
          vs(Q);
          try {
            UH(X, Q, W, V);
          } catch (le) {
            ht(Q, Q.return, le);
          }
          Ua();
        }
        if (Q === h) {
          Qn = null;
          return;
        }
        var ie = Q.sibling;
        if (ie !== null) {
          ie.return = Q.return, Qn = ie;
          return;
        }
        Qn = Q.return;
      }
    }
    function UH(h, X, W, V) {
      switch (X.tag) {
        case f:
        case q:
        case m: {
          if (X.mode & wi) {
            _T();
            try {
              Ul(Vf | N1, X);
            } finally {
              ex(X);
            }
          } else
            Ul(Vf | N1, X);
          break;
        }
      }
    }
    function b8(h) {
      Qn = h, Tx();
    }
    function Tx() {
      for (; Qn !== null; ) {
        var h = Qn, X = h.child;
        if ((Qn.flags & _s) !== fn) {
          var W = h.deletions;
          if (W !== null) {
            for (var V = 0; V < W.length; V++) {
              var Q = W[V];
              Qn = Q, NB(Q, h);
            }
            {
              var ie = h.alternate;
              if (ie !== null) {
                var le = ie.child;
                if (le !== null) {
                  ie.child = null;
                  do {
                    var He = le.sibling;
                    le.sibling = null, le = He;
                  } while (le !== null);
                }
              }
            }
            Qn = h;
          }
        }
        (h.subtreeFlags & PA) !== fn && X !== null ? (X.return = h, Qn = X) : pw();
      }
    }
    function pw() {
      for (; Qn !== null; ) {
        var h = Qn;
        (h.flags & vo) !== fn && (vs(h), hw(h), Ua());
        var X = h.sibling;
        if (X !== null) {
          X.return = h.return, Qn = X;
          return;
        }
        Qn = h.return;
      }
    }
    function hw(h) {
      switch (h.tag) {
        case f:
        case q:
        case m: {
          h.mode & wi ? (_T(), mu(Vf | N1, h, h.return), ex(h)) : mu(Vf | N1, h, h.return);
          break;
        }
      }
    }
    function NB(h, X) {
      for (; Qn !== null; ) {
        var W = Qn;
        vs(W), qx(W, X), Ua();
        var V = W.child;
        V !== null ? (V.return = W, Qn = V) : Hw(h);
      }
    }
    function Hw(h) {
      for (; Qn !== null; ) {
        var X = Qn, W = X.sibling, V = X.return;
        if (h8(X), X === h) {
          Qn = null;
          return;
        }
        if (W !== null) {
          W.return = V, Qn = W;
          return;
        }
        Qn = V;
      }
    }
    function qx(h, X) {
      switch (h.tag) {
        case f:
        case q:
        case m: {
          h.mode & wi ? (_T(), mu(Vf, h, X), ex(h)) : mu(Vf, h, X);
          break;
        }
      }
    }
    function QB(h) {
      switch (h.tag) {
        case f:
        case q:
        case m: {
          try {
            Ul(ui | N1, h);
          } catch (W) {
            ht(h, h.return, W);
          }
          break;
        }
        case o: {
          var X = h.stateNode;
          try {
            X.componentDidMount();
          } catch (W) {
            ht(h, h.return, W);
          }
          break;
        }
      }
    }
    function x8(h) {
      switch (h.tag) {
        case f:
        case q:
        case m: {
          try {
            Ul(Vf | N1, h);
          } catch (X) {
            ht(h, h.return, X);
          }
          break;
        }
      }
    }
    function YB(h) {
      switch (h.tag) {
        case f:
        case q:
        case m: {
          try {
            mu(ui | N1, h, h.return);
          } catch (W) {
            ht(h, h.return, W);
          }
          break;
        }
        case o: {
          var X = h.stateNode;
          typeof X.componentWillUnmount == "function" && cx(h, h.return, X);
          break;
        }
      }
    }
    function MB(h) {
      switch (h.tag) {
        case f:
        case q:
        case m:
          try {
            mu(Vf | N1, h, h.return);
          } catch (X) {
            ht(h, h.return, X);
          }
      }
    }
    if (typeof Symbol == "function" && Symbol.for) {
      var o0 = Symbol.for;
      o0("selector.component"), o0("selector.has_pseudo_class"), o0("selector.role"), o0("selector.test_id"), o0("selector.text");
    }
    var gw = [];
    function LB() {
      gw.forEach(function(h) {
        return h();
      });
    }
    var KB = t.ReactCurrentActQueue;
    function Od(h) {
      {
        var X = (
          // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
          typeof IS_REACT_ACT_ENVIRONMENT < "u" ? IS_REACT_ACT_ENVIRONMENT : void 0
        ), W = typeof jest < "u";
        return W && X !== !1;
      }
    }
    function D8() {
      {
        var h = (
          // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
          typeof IS_REACT_ACT_ENVIRONMENT < "u" ? IS_REACT_ACT_ENVIRONMENT : void 0
        );
        return !h && KB.current !== null && s("The current testing environment is not configured to support act(...)"), h;
      }
    }
    var Xw = Math.ceil, bx = t.ReactCurrentDispatcher, nc = t.ReactCurrentOwner, h6 = t.ReactCurrentBatchConfig, Bv = t.ReactCurrentActQueue, Pf = (
      /*             */
      0
    ), j8 = (
      /*               */
      1
    ), g1 = (
      /*                */
      2
    ), Wv = (
      /*                */
      4
    ), ic = 0, X2 = 1, sc = 2, rp = 3, f0 = 4, Tw = 5, T2 = 6, ms = Pf, U9 = null, X1 = null, i9 = Ar, Il = Ar, q2 = VP(Ar), cf = ic, IH = null, w8 = Ar, b2 = Ar, np = Ar, A0 = null, Z6 = null, x2 = 0, qw = 500, bw = 1 / 0, xx = 500, ac = null;
    function RH() {
      bw = qo() + xx;
    }
    function Dx() {
      return bw;
    }
    var m8 = !1, B8 = null, d0 = null, ip = !1, oc = null, VH = Ar, D2 = [], W8 = null, xw = 50, v0 = 0, S8 = null, U8 = !1, CH = !1, Dw = 50, u0 = 0, OH = null, j2 = Ma, I8 = Ar, jx = !1;
    function R8() {
      return U9;
    }
    function I9() {
      return (ms & (g1 | Wv)) !== Pf ? qo() : (j2 !== Ma || (j2 = qo()), j2);
    }
    function sp(h) {
      var X = h.mode;
      if ((X & Ki) === Di)
        return Ln;
      if ((ms & g1) !== Pf && i9 !== Ar)
        return O1(i9);
      var W = Wj() !== PT;
      if (W) {
        if (h6.transition !== null) {
          var V = h6.transition;
          V._updatedFibers || (V._updatedFibers = /* @__PURE__ */ new Set()), V._updatedFibers.add(h);
        }
        return I8 === Zt && (I8 = Zp()), I8;
      }
      var Q = a6();
      if (Q !== Zt)
        return Q;
      var ie = Dd();
      return ie;
    }
    function JB(h) {
      var X = h.mode;
      return (X & Ki) === Di ? Ln : Iq();
    }
    function Qo(h, X, W, V) {
      o1(), jx && s("useInsertionEffect must not schedule updates."), U8 && (CH = !0), gP(h, W, V), (ms & g1) !== Ar && h === U9 ? P0(X) : (rf && yg(h, X, W), TV(X), h === U9 && ((ms & g1) === Pf && (b2 = ts(b2, W)), cf === f0 && ap(h, i9)), qA(h, V), W === Ln && ms === Pf && (X.mode & Ki) === Di && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
      !Bv.isBatchingLegacy && (RH(), rT()));
    }
    function zB(h, X, W) {
      var V = h.current;
      V.lanes = X, gP(h, X, W), qA(h, W);
    }
    function jw(h) {
      return (
        // TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We
        // decided not to enable it.
        (ms & g1) !== Pf
      );
    }
    function qA(h, X) {
      var W = h.callbackNode;
      pP(h, X);
      var V = gd(h, h === U9 ? i9 : Ar);
      if (V === Ar) {
        W !== null && mU(W), h.callbackNode = null, h.callbackPriority = Zt;
        return;
      }
      var Q = C1(V), ie = h.callbackPriority;
      if (ie === Q && // Special case related to `act`. If the currently scheduled task is a
      // Scheduler task, rather than an `act` task, cancel it and re-scheduled
      // on the `act` queue.
      !(Bv.current !== null && W !== Vl)) {
        W == null && ie !== Ln && s("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");
        return;
      }
      W != null && mU(W);
      var le;
      if (Q === Ln)
        h.tag === yP ? (Bv.isBatchingLegacy !== null && (Bv.didScheduleLegacyUpdate = !0), gb(Bw.bind(null, h))) : TX(Bw.bind(null, h)), Bv.current !== null ? Bv.current.push(XA) : sj(function() {
          (ms & (g1 | Wv)) === Pf && XA();
        }), le = null;
      else {
        var He;
        switch (du(V)) {
          case H1:
            He = Op;
            break;
          case _f:
            He = Gf;
            break;
          case Au:
            He = Av;
            break;
          case XP:
            He = hd;
            break;
          default:
            He = Av;
            break;
        }
        le = Ix(He, w2.bind(null, h));
      }
      h.callbackPriority = Q, h.callbackNode = le;
    }
    function w2(h, X) {
      if (DB(), j2 = Ma, I8 = Ar, (ms & (g1 | Wv)) !== Pf)
        throw new Error("Should not already be working.");
      var W = h.callbackNode, V = Yr();
      if (V && h.callbackNode !== W)
        return null;
      var Q = gd(h, h === U9 ? i9 : Ar);
      if (Q === Ar)
        return null;
      var ie = !i3(h, Q) && !q4(h, Q) && !X, le = ie ? tt(h, Q) : Te(h, Q);
      if (le !== ic) {
        if (le === sc) {
          var He = hP(h);
          He !== Ar && (Q = He, le = mx(h, He));
        }
        if (le === X2) {
          var xe = IH;
          throw l0(h, Ar), ap(h, Q), qA(h, qo()), xe;
        }
        if (le === T2)
          ap(h, Q);
        else {
          var Je = !i3(h, Q), _e = h.current.alternate;
          if (Je && !V8(_e)) {
            if (le = Te(h, Q), le === sc) {
              var qt = hP(h);
              qt !== Ar && (Q = qt, le = mx(h, qt));
            }
            if (le === X2) {
              var Ht = IH;
              throw l0(h, Ar), ap(h, Q), qA(h, qo()), Ht;
            }
          }
          h.finishedWork = _e, h.finishedLanes = Q, mw(h, le, Q);
        }
      }
      return qA(h, qo()), h.callbackNode === W ? w2.bind(null, h) : null;
    }
    function mx(h, X) {
      var W = A0;
      if (sf(h)) {
        var V = l0(h, X);
        V.flags |= Ya, B3(h.containerInfo);
      }
      var Q = Te(h, X);
      if (Q !== sc) {
        var ie = Z6;
        Z6 = W, ie !== null && ww(ie);
      }
      return Q;
    }
    function ww(h) {
      Z6 === null ? Z6 = h : Z6.push.apply(Z6, h);
    }
    function mw(h, X, W) {
      switch (X) {
        case ic:
        case X2:
          throw new Error("Root did not complete. This is a bug in React.");
        case sc: {
          Ft(h, Z6, ac);
          break;
        }
        case rp: {
          if (ap(h, W), n3(W) && // do not delay if we're inside an act() scope
          !BU()) {
            var V = x2 + qw - qo();
            if (V > 10) {
              var Q = gd(h, Ar);
              if (Q !== Ar)
                break;
              var ie = h.suspendedLanes;
              if (!HP(ie, W)) {
                I9(), eh(h, ie);
                break;
              }
              h.timeoutHandle = Hu(Ft.bind(null, h, Z6, ac), V);
              break;
            }
          }
          Ft(h, Z6, ac);
          break;
        }
        case f0: {
          if (ap(h, W), T4(W))
            break;
          if (!BU()) {
            var le = X4(h, W), He = le, xe = qo() - He, Je = Do(xe) - xe;
            if (Je > 10) {
              h.timeoutHandle = Hu(Ft.bind(null, h, Z6, ac), Je);
              break;
            }
          }
          Ft(h, Z6, ac);
          break;
        }
        case Tw: {
          Ft(h, Z6, ac);
          break;
        }
        default:
          throw new Error("Unknown root exit status.");
      }
    }
    function V8(h) {
      for (var X = h; ; ) {
        if (X.flags & ov) {
          var W = X.updateQueue;
          if (W !== null) {
            var V = W.stores;
            if (V !== null)
              for (var Q = 0; Q < V.length; Q++) {
                var ie = V[Q], le = ie.getSnapshot, He = ie.value;
                try {
                  if (!On(le(), He))
                    return !1;
                } catch {
                  return !1;
                }
              }
          }
        }
        var xe = X.child;
        if (X.subtreeFlags & ov && xe !== null) {
          xe.return = X, X = xe;
          continue;
        }
        if (X === h)
          return !0;
        for (; X.sibling === null; ) {
          if (X.return === null || X.return === h)
            return !0;
          X = X.return;
        }
        X.sibling.return = X.return, X = X.sibling;
      }
      return !0;
    }
    function ap(h, X) {
      X = ou(X, np), X = ou(X, b2), $p(h, X);
    }
    function Bw(h) {
      if ($b(), (ms & (g1 | Wv)) !== Pf)
        throw new Error("Should not already be working.");
      Yr();
      var X = gd(h, Ar);
      if (!F6(X, Ln))
        return qA(h, qo()), null;
      var W = Te(h, X);
      if (h.tag !== yP && W === sc) {
        var V = hP(h);
        V !== Ar && (X = V, W = mx(h, V));
      }
      if (W === X2) {
        var Q = IH;
        throw l0(h, Ar), ap(h, X), qA(h, qo()), Q;
      }
      if (W === T2)
        throw new Error("Root did not complete. This is a bug in React.");
      var ie = h.current.alternate;
      return h.finishedWork = ie, h.finishedLanes = X, Ft(h, Z6, ac), qA(h, qo()), null;
    }
    function Ww(h, X) {
      X !== Ar && (s3(h, ts(X, Ln)), qA(h, qo()), (ms & (g1 | Wv)) === Pf && (RH(), XA()));
    }
    function Bx(h, X) {
      var W = ms;
      ms |= j8;
      try {
        return h(X);
      } finally {
        ms = W, ms === Pf && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
        !Bv.isBatchingLegacy && (RH(), rT());
      }
    }
    function GB(h, X, W, V, Q) {
      var ie = a6(), le = h6.transition;
      try {
        return h6.transition = null, Co(H1), h(X, W, V, Q);
      } finally {
        Co(ie), h6.transition = le, ms === Pf && RH();
      }
    }
    function yd(h) {
      oc !== null && oc.tag === yP && (ms & (g1 | Wv)) === Pf && Yr();
      var X = ms;
      ms |= j8;
      var W = h6.transition, V = a6();
      try {
        return h6.transition = null, Co(H1), h ? h() : void 0;
      } finally {
        Co(V), h6.transition = W, ms = X, (ms & (g1 | Wv)) === Pf && XA();
      }
    }
    function Wx() {
      return (ms & (g1 | Wv)) !== Pf;
    }
    function C8(h, X) {
      Rf(q2, Il, h), Il = ts(Il, X);
    }
    function Sx(h) {
      Il = q2.current, xo(q2, h);
    }
    function l0(h, X) {
      h.finishedWork = null, h.finishedLanes = Ar;
      var W = h.timeoutHandle;
      if (W !== cX && (h.timeoutHandle = cX, gu(W)), X1 !== null)
        for (var V = X1.return; V !== null; ) {
          var Q = V.alternate;
          Px(Q, V), V = V.return;
        }
      U9 = h;
      var ie = m2(h.current, null);
      return X1 = ie, i9 = Il = X, cf = ic, IH = null, w8 = Ar, b2 = Ar, np = Ar, A0 = null, Z6 = null, TB(), Bd.discardPendingWarnings(), ie;
    }
    function Sw(h, X) {
      do {
        var W = X1;
        try {
          if (Tl(), FX(), Ua(), nc.current = null, W === null || W.return === null) {
            cf = X2, IH = X, X1 = null;
            return;
          }
          if (me && W.mode & wi && $h(W, !0), ge)
            if (lP(), X !== null && typeof X == "object" && typeof X.then == "function") {
              var V = X;
              Sg(W, V, i9);
            } else
              Ep(W, X, i9);
          rd(h, W.return, W, X, i9), ct(W);
        } catch (Q) {
          X = Q, X1 === W && W !== null ? (W = W.return, X1 = W) : W = X1;
          continue;
        }
        return;
      } while (!0);
    }
    function Ux() {
      var h = bx.current;
      return bx.current = ZX, h === null ? ZX : h;
    }
    function g(h) {
      bx.current = h;
    }
    function x() {
      x2 = qo();
    }
    function U(h) {
      w8 = ts(h, w8);
    }
    function F() {
      cf === ic && (cf = rp);
    }
    function K() {
      (cf === ic || cf === rp || cf === sc) && (cf = f0), U9 !== null && (r3(w8) || r3(b2)) && ap(U9, i9);
    }
    function oe(h) {
      cf !== f0 && (cf = sc), A0 === null ? A0 = [h] : A0.push(h);
    }
    function ce() {
      return cf === ic;
    }
    function Te(h, X) {
      var W = ms;
      ms |= g1;
      var V = Ux();
      if (U9 !== h || i9 !== X) {
        if (rf) {
          var Q = h.memoizedUpdaters;
          Q.size > 0 && (op(h, i9), Q.clear()), fu(h, X);
        }
        ac = th(), l0(h, X);
      }
      j9(X);
      do
        try {
          Ce();
          break;
        } catch (ie) {
          Sw(h, ie);
        }
      while (!0);
      if (Tl(), ms = W, g(V), X1 !== null)
        throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
      return rl(), U9 = null, i9 = Ar, cf;
    }
    function Ce() {
      for (; X1 !== null; )
        Rt(X1);
    }
    function tt(h, X) {
      var W = ms;
      ms |= g1;
      var V = Ux();
      if (U9 !== h || i9 !== X) {
        if (rf) {
          var Q = h.memoizedUpdaters;
          Q.size > 0 && (op(h, i9), Q.clear()), fu(h, X);
        }
        ac = th(), RH(), l0(h, X);
      }
      j9(X);
      do
        try {
          ft();
          break;
        } catch (ie) {
          Sw(h, ie);
        }
      while (!0);
      return Tl(), g(V), ms = W, X1 !== null ? (tl(), ic) : (rl(), U9 = null, i9 = Ar, cf);
    }
    function ft() {
      for (; X1 !== null && !s7(); )
        Rt(X1);
    }
    function Rt(h) {
      var X = h.alternate;
      vs(h);
      var W;
      (h.mode & wi) !== Di ? (ZT(h), W = Yo(X, h, Il), $h(h, !0)) : W = Yo(X, h, Il), Ua(), h.memoizedProps = h.pendingProps, W === null ? ct(h) : X1 = W, nc.current = null;
    }
    function ct(h) {
      var X = h;
      do {
        var W = X.alternate, V = X.return;
        if ((X.flags & lA) === fn) {
          vs(X);
          var Q = void 0;
          if ((X.mode & wi) === Di ? Q = sw(W, X, Il) : (ZT(X), Q = sw(W, X, Il), $h(X, !1)), Ua(), Q !== null) {
            X1 = Q;
            return;
          }
        } else {
          var ie = WB(W, X);
          if (ie !== null) {
            ie.flags &= dP, X1 = ie;
            return;
          }
          if ((X.mode & wi) !== Di) {
            $h(X, !1);
            for (var le = X.actualDuration, He = X.child; He !== null; )
              le += He.actualDuration, He = He.sibling;
            X.actualDuration = le;
          }
          if (V !== null)
            V.flags |= lA, V.subtreeFlags = fn, V.deletions = null;
          else {
            cf = T2, X1 = null;
            return;
          }
        }
        var xe = X.sibling;
        if (xe !== null) {
          X1 = xe;
          return;
        }
        X = V, X1 = X;
      } while (X !== null);
      cf === ic && (cf = Tw);
    }
    function Ft(h, X, W) {
      var V = a6(), Q = h6.transition;
      try {
        h6.transition = null, Co(H1), wr(h, X, W, V);
      } finally {
        h6.transition = Q, Co(V);
      }
      return null;
    }
    function wr(h, X, W, V) {
      do
        Yr();
      while (oc !== null);
      if (pa(), (ms & (g1 | Wv)) !== Pf)
        throw new Error("Should not already be working.");
      var Q = h.finishedWork, ie = h.finishedLanes;
      if (yp(ie), Q === null)
        return A7(), null;
      if (ie === Ar && s("root.finishedLanes should not be empty during a commit. This is a bug in React."), h.finishedWork = null, h.finishedLanes = Ar, Q === h.current)
        throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
      h.callbackNode = null, h.callbackPriority = Zt;
      var le = ts(Q.lanes, Q.childLanes);
      Og(h, le), h === U9 && (U9 = null, X1 = null, i9 = Ar), ((Q.subtreeFlags & PA) !== fn || (Q.flags & PA) !== fn) && (ip || (ip = !0, W8 = W, Ix(Av, function() {
        return Yr(), null;
      })));
      var He = (Q.subtreeFlags & (Mc | t6 | zf | PA)) !== fn, xe = (Q.flags & (Mc | t6 | zf | PA)) !== fn;
      if (He || xe) {
        var Je = h6.transition;
        h6.transition = null;
        var _e = a6();
        Co(H1);
        var qt = ms;
        ms |= Wv, nc.current = null, RB(h, Q), t2(), uw(h, Q, ie), ob(h.containerInfo), h.current = Q, Ug(ie), lw(Q, h, ie), zc(), wg(), ms = qt, Co(_e), h6.transition = Je;
      } else
        h.current = Q, t2();
      var Ht = ip;
      if (ip ? (ip = !1, oc = h, VH = ie) : (u0 = 0, OH = null), le = h.pendingLanes, le === Ar && (d0 = null), Ht || pf(h.current, !1), MA(Q.stateNode, V), rf && h.memoizedUpdaters.clear(), LB(), qA(h, qo()), X !== null)
        for (var Mt = h.onRecoverableError, Lt = 0; Lt < X.length; Lt++) {
          var or = X[Lt], yn = or.stack, hi = or.digest;
          Mt(or.value, {
            componentStack: yn,
            digest: hi
          });
        }
      if (m8) {
        m8 = !1;
        var Pi = B8;
        throw B8 = null, Pi;
      }
      return F6(VH, Ln) && h.tag !== yP && Yr(), le = h.pendingLanes, F6(le, Ln) ? (Zj(), h === S8 ? v0++ : (v0 = 0, S8 = h)) : v0 = 0, XA(), A7(), null;
    }
    function Yr() {
      if (oc !== null) {
        var h = du(VH), X = TP(Au, h), W = h6.transition, V = a6();
        try {
          return h6.transition = null, Co(X), os();
        } finally {
          Co(V), h6.transition = W;
        }
      }
      return !1;
    }
    function Si(h) {
      D2.push(h), ip || (ip = !0, Ix(Av, function() {
        return Yr(), null;
      }));
    }
    function os() {
      if (oc === null)
        return !1;
      var h = W8;
      W8 = null;
      var X = oc, W = VH;
      if (oc = null, VH = Ar, (ms & (g1 | Wv)) !== Pf)
        throw new Error("Cannot flush passive effects while already rendering.");
      U8 = !0, CH = !1, Gc(W);
      var V = ms;
      ms |= Wv, b8(X.current), mv(X, X.current, W, h);
      {
        var Q = D2;
        D2 = [];
        for (var ie = 0; ie < Q.length; ie++) {
          var le = Q[ie];
          tp(X, le);
        }
      }
      Fp(), pf(X.current, !0), ms = V, XA(), CH ? X === OH ? u0++ : (u0 = 0, OH = X) : u0 = 0, U8 = !1, CH = !1, tu(X);
      {
        var He = X.current.stateNode;
        He.effectDuration = 0, He.passiveEffectDuration = 0;
      }
      return !0;
    }
    function Ci(h) {
      return d0 !== null && d0.has(h);
    }
    function ea(h) {
      d0 === null ? d0 = /* @__PURE__ */ new Set([h]) : d0.add(h);
    }
    function to(h) {
      m8 || (m8 = !0, B8 = h);
    }
    var Nt = to;
    function dr(h, X, W) {
      var V = ju(W, X), Q = e8(h, V, Ln), ie = bv(h, Q, Ln), le = I9();
      ie !== null && (gP(ie, Ln, le), qA(ie, le));
    }
    function ht(h, X, W) {
      if (a0(W), O8(!1), h.tag === v) {
        dr(h, h, W);
        return;
      }
      var V = null;
      for (V = X; V !== null; ) {
        if (V.tag === v) {
          dr(V, h, W);
          return;
        } else if (V.tag === o) {
          var Q = V.type, ie = V.stateNode;
          if (typeof Q.getDerivedStateFromError == "function" || typeof ie.componentDidCatch == "function" && !Ci(ie)) {
            var le = ju(W, h), He = r2(V, le, Ln), xe = bv(V, He, Ln), Je = I9();
            xe !== null && (gP(xe, Ln, Je), qA(xe, Je));
            return;
          }
        }
        V = V.return;
      }
      s(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

%s`, W);
    }
    function Or(h, X, W) {
      var V = h.pingCache;
      V !== null && V.delete(X);
      var Q = I9();
      eh(h, W), qV(h), U9 === h && HP(i9, W) && (cf === f0 || cf === rp && n3(i9) && qo() - x2 < qw ? l0(h, Ar) : np = ts(np, W)), qA(h, Q);
    }
    function hn(h, X) {
      X === Zt && (X = JB(h));
      var W = I9(), V = l6(h, X);
      V !== null && (gP(V, X, W), qA(V, W));
    }
    function Nn(h) {
      var X = h.memoizedState, W = Zt;
      X !== null && (W = X.retryLane), hn(h, W);
    }
    function Fs(h, X) {
      var W = Zt, V;
      switch (h.tag) {
        case j:
          V = h.stateNode;
          var Q = h.memoizedState;
          Q !== null && (W = Q.retryLane);
          break;
        case R:
          V = h.stateNode;
          break;
        default:
          throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
      }
      V !== null && V.delete(X), hn(h, W);
    }
    function Do(h) {
      return h < 120 ? 120 : h < 480 ? 480 : h < 1080 ? 1080 : h < 1920 ? 1920 : h < 3e3 ? 3e3 : h < 4320 ? 4320 : Xw(h / 1960) * 1960;
    }
    function o1() {
      if (v0 > xw)
        throw v0 = 0, S8 = null, new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
      u0 > Dw && (u0 = 0, OH = null, s("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."));
    }
    function pa() {
      Bd.flushLegacyContextWarning(), Bd.flushPendingUnsafeLifecycleWarnings();
    }
    function pf(h, X) {
      vs(h), Ls(h, e6, YB), X && Ls(h, $u, MB), Ls(h, e6, QB), X && Ls(h, $u, x8), Ua();
    }
    function Ls(h, X, W) {
      for (var V = h, Q = null; V !== null; ) {
        var ie = V.subtreeFlags & X;
        V !== Q && V.child !== null && ie !== fn ? V = V.child : ((V.flags & X) !== fn && W(V), V.sibling !== null ? V = V.sibling : V = Q = V.return);
      }
    }
    var lo = null;
    function s9(h) {
      {
        if ((ms & g1) !== Pf || !(h.mode & Ki))
          return;
        var X = h.tag;
        if (X !== d && X !== v && X !== o && X !== f && X !== q && X !== w && X !== m)
          return;
        var W = Fn(h) || "ReactComponent";
        if (lo !== null) {
          if (lo.has(W))
            return;
          lo.add(W);
        } else
          lo = /* @__PURE__ */ new Set([W]);
        var V = $i;
        try {
          vs(h), s("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
        } finally {
          V ? vs(h) : Ua();
        }
      }
    }
    var Yo;
    {
      var Rl = null;
      Yo = function(h, X, W) {
        var V = VU(Rl, X);
        try {
          return c8(h, X, W);
        } catch (ie) {
          if (XB() || ie !== null && typeof ie == "object" && typeof ie.then == "function")
            throw ie;
          if (Tl(), FX(), Px(h, X), VU(X, V), X.mode & wi && ZT(X), _9(null, c8, null, h, X, W), Sq()) {
            var Q = bg();
            typeof Q == "object" && Q !== null && Q._suppressLogging && typeof ie == "object" && ie !== null && !ie._suppressLogging && (ie._suppressLogging = !0);
          }
          throw ie;
        }
      };
    }
    var Q1 = !1, Sv;
    Sv = /* @__PURE__ */ new Set();
    function P0(h) {
      if (Ga && !Mj())
        switch (h.tag) {
          case f:
          case q:
          case m: {
            var X = X1 && Fn(X1) || "Unknown", W = X;
            if (!Sv.has(W)) {
              Sv.add(W);
              var V = Fn(h) || "Unknown";
              s("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", V, X, X);
            }
            break;
          }
          case o: {
            Q1 || (s("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."), Q1 = !0);
            break;
          }
        }
    }
    function op(h, X) {
      if (rf) {
        var W = h.memoizedUpdaters;
        W.forEach(function(V) {
          yg(h, V, X);
        });
      }
    }
    var Vl = {};
    function Ix(h, X) {
      {
        var W = Bv.current;
        return W !== null ? (W.push(X), Vl) : eu(h, X);
      }
    }
    function mU(h) {
      if (h !== Vl)
        return h4(h);
    }
    function BU() {
      return Bv.current !== null;
    }
    function TV(h) {
      {
        if (h.mode & Ki) {
          if (!D8())
            return;
        } else if (!Od() || ms !== Pf || h.tag !== f && h.tag !== q && h.tag !== m)
          return;
        if (Bv.current === null) {
          var X = $i;
          try {
            vs(h), s(`An update to %s inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`, Fn(h));
          } finally {
            X ? vs(h) : Ua();
          }
        }
      }
    }
    function qV(h) {
      h.tag !== yP && D8() && Bv.current === null && s(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).

When testing, code that resolves suspended data should be wrapped into act(...):

act(() => {
  /* finish loading suspended data */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`);
    }
    function O8(h) {
      jx = h;
    }
    var Cl = null, y8 = null, ZB = function(h) {
      Cl = h;
    };
    function k8(h) {
      {
        if (Cl === null)
          return h;
        var X = Cl(h);
        return X === void 0 ? h : X.current;
      }
    }
    function _B(h) {
      return k8(h);
    }
    function Uw(h) {
      {
        if (Cl === null)
          return h;
        var X = Cl(h);
        if (X === void 0) {
          if (h != null && typeof h.render == "function") {
            var W = k8(h.render);
            if (h.render !== W) {
              var V = {
                $$typeof: $e,
                render: W
              };
              return h.displayName !== void 0 && (V.displayName = h.displayName), V;
            }
          }
          return h;
        }
        return X.current;
      }
    }
    function WU(h, X) {
      {
        if (Cl === null)
          return !1;
        var W = h.elementType, V = X.type, Q = !1, ie = typeof V == "object" && V !== null ? V.$$typeof : null;
        switch (h.tag) {
          case o: {
            typeof V == "function" && (Q = !0);
            break;
          }
          case f: {
            (typeof V == "function" || ie === Lr) && (Q = !0);
            break;
          }
          case q: {
            (ie === $e || ie === Lr) && (Q = !0);
            break;
          }
          case w:
          case m: {
            (ie === Vr || ie === Lr) && (Q = !0);
            break;
          }
          default:
            return !1;
        }
        if (Q) {
          var le = Cl(W);
          if (le !== void 0 && le === Cl(V))
            return !0;
        }
        return !1;
      }
    }
    function $B(h) {
      {
        if (Cl === null || typeof WeakSet != "function")
          return;
        y8 === null && (y8 = /* @__PURE__ */ new WeakSet()), y8.add(h);
      }
    }
    var bV = function(h, X) {
      {
        if (Cl === null)
          return;
        var W = X.staleFamilies, V = X.updatedFamilies;
        Yr(), yd(function() {
          eW(h.current, V, W);
        });
      }
    }, xV = function(h, X) {
      {
        if (h.context !== gA)
          return;
        Yr(), yd(function() {
          Vx(X, h, null, null);
        });
      }
    };
    function eW(h, X, W) {
      {
        var V = h.alternate, Q = h.child, ie = h.sibling, le = h.tag, He = h.type, xe = null;
        switch (le) {
          case f:
          case m:
          case o:
            xe = He;
            break;
          case q:
            xe = He.render;
            break;
        }
        if (Cl === null)
          throw new Error("Expected resolveFamily to be set during hot reload.");
        var Je = !1, _e = !1;
        if (xe !== null) {
          var qt = Cl(xe);
          qt !== void 0 && (W.has(qt) ? _e = !0 : X.has(qt) && (le === o ? _e = !0 : Je = !0));
        }
        if (y8 !== null && (y8.has(h) || V !== null && y8.has(V)) && (_e = !0), _e && (h._debugNeedsRemount = !0), _e || Je) {
          var Ht = l6(h, Ln);
          Ht !== null && Qo(Ht, h, Ln, Ma);
        }
        Q !== null && !_e && eW(Q, X, W), ie !== null && eW(ie, X, W);
      }
    }
    var DV = function(h, X) {
      {
        var W = /* @__PURE__ */ new Set(), V = new Set(X.map(function(Q) {
          return Q.current;
        }));
        return tW(h.current, V, W), W;
      }
    };
    function tW(h, X, W) {
      {
        var V = h.child, Q = h.sibling, ie = h.tag, le = h.type, He = null;
        switch (ie) {
          case f:
          case m:
          case o:
            He = le;
            break;
          case q:
            He = le.render;
            break;
        }
        var xe = !1;
        He !== null && X.has(He) && (xe = !0), xe ? SU(h, W) : V !== null && tW(V, X, W), Q !== null && tW(Q, X, W);
      }
    }
    function SU(h, X) {
      {
        var W = jV(h, X);
        if (W)
          return;
        for (var V = h; ; ) {
          switch (V.tag) {
            case l:
              X.add(V.stateNode);
              return;
            case u:
              X.add(V.stateNode.containerInfo);
              return;
            case v:
              X.add(V.stateNode.containerInfo);
              return;
          }
          if (V.return === null)
            throw new Error("Expected to reach root first.");
          V = V.return;
        }
      }
    }
    function jV(h, X) {
      for (var W = h, V = !1; ; ) {
        if (W.tag === l)
          V = !0, X.add(W.stateNode);
        else if (W.child !== null) {
          W.child.return = W, W = W.child;
          continue;
        }
        if (W === h)
          return V;
        for (; W.sibling === null; ) {
          if (W.return === null || W.return === h)
            return V;
          W = W.return;
        }
        W.sibling.return = W.return, W = W.sibling;
      }
      return !1;
    }
    var Rx;
    {
      Rx = !1;
      try {
        var UU = Object.preventExtensions({});
      } catch {
        Rx = !0;
      }
    }
    function wV(h, X, W, V) {
      this.tag = h, this.key = W, this.elementType = null, this.type = null, this.stateNode = null, this.return = null, this.child = null, this.sibling = null, this.index = 0, this.ref = null, this.pendingProps = X, this.memoizedProps = null, this.updateQueue = null, this.memoizedState = null, this.dependencies = null, this.mode = V, this.flags = fn, this.subtreeFlags = fn, this.deletions = null, this.lanes = Ar, this.childLanes = Ar, this.alternate = null, this.actualDuration = Number.NaN, this.actualStartTime = Number.NaN, this.selfBaseDuration = Number.NaN, this.treeBaseDuration = Number.NaN, this.actualDuration = 0, this.actualStartTime = -1, this.selfBaseDuration = 0, this.treeBaseDuration = 0, this._debugSource = null, this._debugOwner = null, this._debugNeedsRemount = !1, this._debugHookTypes = null, !Rx && typeof Object.preventExtensions == "function" && Object.preventExtensions(this);
    }
    var Uv = function(h, X, W, V) {
      return new wV(h, X, W, V);
    };
    function rW(h) {
      var X = h.prototype;
      return !!(X && X.isReactComponent);
    }
    function IU(h) {
      return typeof h == "function" && !rW(h) && h.defaultProps === void 0;
    }
    function mV(h) {
      if (typeof h == "function")
        return rW(h) ? o : f;
      if (h != null) {
        var X = h.$$typeof;
        if (X === $e)
          return q;
        if (X === Vr)
          return w;
      }
      return d;
    }
    function m2(h, X) {
      var W = h.alternate;
      W === null ? (W = Uv(h.tag, X, h.key, h.mode), W.elementType = h.elementType, W.type = h.type, W.stateNode = h.stateNode, W._debugSource = h._debugSource, W._debugOwner = h._debugOwner, W._debugHookTypes = h._debugHookTypes, W.alternate = h, h.alternate = W) : (W.pendingProps = X, W.type = h.type, W.flags = fn, W.subtreeFlags = fn, W.deletions = null, W.actualDuration = 0, W.actualStartTime = -1), W.flags = h.flags & ef, W.childLanes = h.childLanes, W.lanes = h.lanes, W.child = h.child, W.memoizedProps = h.memoizedProps, W.memoizedState = h.memoizedState, W.updateQueue = h.updateQueue;
      var V = h.dependencies;
      switch (W.dependencies = V === null ? null : {
        lanes: V.lanes,
        firstContext: V.firstContext
      }, W.sibling = h.sibling, W.index = h.index, W.ref = h.ref, W.selfBaseDuration = h.selfBaseDuration, W.treeBaseDuration = h.treeBaseDuration, W._debugNeedsRemount = h._debugNeedsRemount, W.tag) {
        case d:
        case f:
        case m:
          W.type = k8(h.type);
          break;
        case o:
          W.type = _B(h.type);
          break;
        case q:
          W.type = Uw(h.type);
          break;
      }
      return W;
    }
    function BV(h, X) {
      h.flags &= ef | Ms;
      var W = h.alternate;
      if (W === null)
        h.childLanes = Ar, h.lanes = X, h.child = null, h.subtreeFlags = fn, h.memoizedProps = null, h.memoizedState = null, h.updateQueue = null, h.dependencies = null, h.stateNode = null, h.selfBaseDuration = 0, h.treeBaseDuration = 0;
      else {
        h.childLanes = W.childLanes, h.lanes = W.lanes, h.child = W.child, h.subtreeFlags = fn, h.deletions = null, h.memoizedProps = W.memoizedProps, h.memoizedState = W.memoizedState, h.updateQueue = W.updateQueue, h.type = W.type;
        var V = W.dependencies;
        h.dependencies = V === null ? null : {
          lanes: V.lanes,
          firstContext: V.firstContext
        }, h.selfBaseDuration = W.selfBaseDuration, h.treeBaseDuration = W.treeBaseDuration;
      }
      return h;
    }
    function WV(h, X, W) {
      var V;
      return h === Sh ? (V = Ki, X === !0 && (V |= Za, V |= k6)) : V = Di, rf && (V |= wi), Uv(v, null, null, V);
    }
    function Iw(h, X, W, V, Q, ie) {
      var le = d, He = h;
      if (typeof h == "function")
        rW(h) ? (le = o, He = _B(He)) : He = k8(He);
      else if (typeof h == "string")
        le = l;
      else
        e:
          switch (h) {
            case pr:
              return yH(W.children, Q, ie, X);
            case ds:
              le = c, Q |= Za, (Q & Ki) !== Di && (Q |= k6);
              break;
            case it:
              return iW(W, Q, ie, X);
            case Kt:
              return SV(W, Q, ie, X);
            case cr:
              return UV(W, Q, ie, X);
            case Cn:
              return RU(W, Q, ie, X);
            case Mi:
            case pi:
            case li:
            case Xs:
            case zr:
            default: {
              if (typeof h == "object" && h !== null)
                switch (h.$$typeof) {
                  case $t:
                    le = T;
                    break e;
                  case Ur:
                    le = H;
                    break e;
                  case $e:
                    le = q, He = Uw(He);
                    break e;
                  case Vr:
                    le = w;
                    break e;
                  case Lr:
                    le = I, He = null;
                    break e;
                }
              var xe = "";
              {
                (h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (xe += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
                var Je = V ? Fn(V) : null;
                Je && (xe += `

Check the render method of \`` + Je + "`.");
              }
              throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + ("but got: " + (h == null ? h : typeof h) + "." + xe));
            }
          }
      var _e = Uv(le, W, X, Q);
      return _e.elementType = h, _e.type = He, _e.lanes = ie, _e._debugOwner = V, _e;
    }
    function nW(h, X, W) {
      var V = null;
      V = h._owner;
      var Q = h.type, ie = h.key, le = h.props, He = Iw(Q, ie, le, V, X, W);
      return He._debugSource = h._source, He._debugOwner = h._owner, He;
    }
    function yH(h, X, W, V) {
      var Q = Uv(p, h, V, X);
      return Q.lanes = W, Q;
    }
    function iW(h, X, W, V) {
      typeof h.id != "string" && s('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof h.id);
      var Q = Uv(b, h, V, X | wi);
      return Q.elementType = it, Q.lanes = W, Q.stateNode = {
        effectDuration: 0,
        passiveEffectDuration: 0
      }, Q;
    }
    function SV(h, X, W, V) {
      var Q = Uv(j, h, V, X);
      return Q.elementType = Kt, Q.lanes = W, Q;
    }
    function UV(h, X, W, V) {
      var Q = Uv(R, h, V, X);
      return Q.elementType = cr, Q.lanes = W, Q;
    }
    function RU(h, X, W, V) {
      var Q = Uv(O, h, V, X);
      Q.elementType = Cn, Q.lanes = W;
      var ie = {
        isHidden: !1
      };
      return Q.stateNode = ie, Q;
    }
    function sW(h, X, W) {
      var V = Uv(P, h, null, X);
      return V.lanes = W, V;
    }
    function IV() {
      var h = Uv(l, null, null, Di);
      return h.elementType = "DELETED", h;
    }
    function aW(h) {
      var X = Uv(k, null, null, Di);
      return X.stateNode = h, X;
    }
    function oW(h, X, W) {
      var V = h.children !== null ? h.children : [], Q = Uv(u, V, h.key, X);
      return Q.lanes = W, Q.stateNode = {
        containerInfo: h.containerInfo,
        pendingChildren: null,
        // Used by persistent updates
        implementation: h.implementation
      }, Q;
    }
    function VU(h, X) {
      return h === null && (h = Uv(d, null, null, Di)), h.tag = X.tag, h.key = X.key, h.elementType = X.elementType, h.type = X.type, h.stateNode = X.stateNode, h.return = X.return, h.child = X.child, h.sibling = X.sibling, h.index = X.index, h.ref = X.ref, h.pendingProps = X.pendingProps, h.memoizedProps = X.memoizedProps, h.updateQueue = X.updateQueue, h.memoizedState = X.memoizedState, h.dependencies = X.dependencies, h.mode = X.mode, h.flags = X.flags, h.subtreeFlags = X.subtreeFlags, h.deletions = X.deletions, h.lanes = X.lanes, h.childLanes = X.childLanes, h.alternate = X.alternate, h.actualDuration = X.actualDuration, h.actualStartTime = X.actualStartTime, h.selfBaseDuration = X.selfBaseDuration, h.treeBaseDuration = X.treeBaseDuration, h._debugSource = X._debugSource, h._debugOwner = X._debugOwner, h._debugNeedsRemount = X._debugNeedsRemount, h._debugHookTypes = X._debugHookTypes, h;
    }
    function RV(h, X, W, V, Q) {
      this.tag = X, this.containerInfo = h, this.pendingChildren = null, this.current = null, this.pingCache = null, this.finishedWork = null, this.timeoutHandle = cX, this.context = null, this.pendingContext = null, this.callbackNode = null, this.callbackPriority = Zt, this.eventTimes = h7(Ar), this.expirationTimes = h7(Ma), this.pendingLanes = Ar, this.suspendedLanes = Ar, this.pingedLanes = Ar, this.expiredLanes = Ar, this.mutableReadLanes = Ar, this.finishedLanes = Ar, this.entangledLanes = Ar, this.entanglements = h7(Ar), this.identifierPrefix = V, this.onRecoverableError = Q, this.mutableSourceEagerHydrationData = null, this.effectDuration = 0, this.passiveEffectDuration = 0;
      {
        this.memoizedUpdaters = /* @__PURE__ */ new Set();
        for (var ie = this.pendingUpdatersLaneMap = [], le = 0; le < sa; le++)
          ie.push(/* @__PURE__ */ new Set());
      }
      switch (X) {
        case Sh:
          this._debugRootType = W ? "hydrateRoot()" : "createRoot()";
          break;
        case yP:
          this._debugRootType = W ? "hydrate()" : "render()";
          break;
      }
    }
    function CU(h, X, W, V, Q, ie, le, He, xe, Je) {
      var _e = new RV(h, X, W, He, xe), qt = WV(X, ie);
      _e.current = qt, qt.stateNode = _e;
      {
        var Ht = {
          element: V,
          isDehydrated: W,
          cache: null,
          // not enabled yet
          transitions: null,
          pendingSuspenseBoundaries: null
        };
        qt.memoizedState = Ht;
      }
      return $A(qt), _e;
    }
    var Rw = "18.2.0";
    function VV(h, X, W) {
      var V = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
      return bt(V), {
        // This tag allow us to uniquely identify this as a React Portal
        $$typeof: Fr,
        key: V == null ? null : "" + V,
        children: h,
        containerInfo: X,
        implementation: W
      };
    }
    var fW, AW;
    fW = !1, AW = {};
    function dW(h) {
      if (!h)
        return gA;
      var X = Es(h), W = qj(X);
      if (X.tag === o) {
        var V = X.type;
        if (Xv(V))
          return Tj(X, V, W);
      }
      return W;
    }
    function CV(h, X) {
      {
        var W = Es(h);
        if (W === void 0) {
          if (typeof h.render == "function")
            throw new Error("Unable to find node on an unmounted component.");
          var V = Object.keys(h).join(",");
          throw new Error("Argument appears to not be a ReactComponent. Keys: " + V);
        }
        var Q = tf(W);
        if (Q === null)
          return null;
        if (Q.mode & Za) {
          var ie = Fn(W) || "Component";
          if (!AW[ie]) {
            AW[ie] = !0;
            var le = $i;
            try {
              vs(Q), W.mode & Za ? s("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", X, X, ie) : s("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", X, X, ie);
            } finally {
              le ? vs(le) : Ua();
            }
          }
        }
        return Q.stateNode;
      }
    }
    function OU(h, X, W, V, Q, ie, le, He) {
      var xe = !1, Je = null;
      return CU(h, X, xe, Je, W, V, Q, ie, le);
    }
    function yU(h, X, W, V, Q, ie, le, He, xe, Je) {
      var _e = !0, qt = CU(W, V, _e, h, Q, ie, le, He, xe);
      qt.context = dW(null);
      var Ht = qt.current, Mt = I9(), Lt = sp(Ht), or = Sd(Mt, Lt);
      return or.callback = X ?? null, bv(Ht, or, Lt), zB(qt, Lt, Mt), qt;
    }
    function Vx(h, X, W, V) {
      vP(X, h);
      var Q = X.current, ie = I9(), le = sp(Q);
      uv(le);
      var He = dW(W);
      X.context === null ? X.context = He : X.pendingContext = He, Ga && $i !== null && !fW && (fW = !0, s(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.

Check the render method of %s.`, Fn($i) || "Unknown"));
      var xe = Sd(ie, le);
      xe.payload = {
        element: h
      }, V = V === void 0 ? null : V, V !== null && (typeof V != "function" && s("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", V), xe.callback = V);
      var Je = bv(Q, xe, le);
      return Je !== null && (Qo(Je, Q, le, ie), Ca(Je, Q, le)), le;
    }
    function Vw(h) {
      var X = h.current;
      if (!X.child)
        return null;
      switch (X.child.tag) {
        case l:
          return X.child.stateNode;
        default:
          return X.child.stateNode;
      }
    }
    function kU(h) {
      switch (h.tag) {
        case v: {
          var X = h.stateNode;
          if (sf(X)) {
            var W = ca(X);
            Ww(X, W);
          }
          break;
        }
        case j: {
          yd(function() {
            var Q = l6(h, Ln);
            if (Q !== null) {
              var ie = I9();
              Qo(Q, h, Ln, ie);
            }
          });
          var V = Ln;
          vW(h, V);
          break;
        }
      }
    }
    function EU(h, X) {
      var W = h.memoizedState;
      W !== null && W.dehydrated !== null && (W.retryLane = b4(W.retryLane, X));
    }
    function vW(h, X) {
      EU(h, X);
      var W = h.alternate;
      W && EU(W, X);
    }
    function uW(h) {
      if (h.tag === j) {
        var X = sl, W = l6(h, X);
        if (W !== null) {
          var V = I9();
          Qo(W, h, X, V);
        }
        vW(h, X);
      }
    }
    function OV(h) {
      if (h.tag === j) {
        var X = sp(h), W = l6(h, X);
        if (W !== null) {
          var V = I9();
          Qo(W, h, X, V);
        }
        vW(h, X);
      }
    }
    function FU(h) {
      var X = Lc(h);
      return X === null ? null : X.stateNode;
    }
    var NU = function(h) {
      return null;
    };
    function QU(h) {
      return NU(h);
    }
    var YU = function(h) {
      return !1;
    };
    function yV(h) {
      return YU(h);
    }
    var lW = null, MU = null, LU = null, KU = null, PW = null, JU = null, zU = null, cW = null, GU = null;
    {
      var pW = function(h, X, W) {
        var V = X[W], Q = cs(h) ? h.slice() : di({}, h);
        return W + 1 === X.length ? (cs(Q) ? Q.splice(V, 1) : delete Q[V], Q) : (Q[V] = pW(h[V], X, W + 1), Q);
      }, ZU = function(h, X) {
        return pW(h, X, 0);
      }, _U = function(h, X, W, V) {
        var Q = X[V], ie = cs(h) ? h.slice() : di({}, h);
        if (V + 1 === X.length) {
          var le = W[V];
          ie[le] = ie[Q], cs(ie) ? ie.splice(Q, 1) : delete ie[Q];
        } else
          ie[Q] = _U(
            // $FlowFixMe number or string is fine here
            h[Q],
            X,
            W,
            V + 1
          );
        return ie;
      }, $U = function(h, X, W) {
        if (X.length !== W.length) {
          i("copyWithRename() expects paths of the same length");
          return;
        } else
          for (var V = 0; V < W.length - 1; V++)
            if (X[V] !== W[V]) {
              i("copyWithRename() expects paths to be the same except for the deepest key");
              return;
            }
        return _U(h, X, W, 0);
      }, hW = function(h, X, W, V) {
        if (W >= X.length)
          return V;
        var Q = X[W], ie = cs(h) ? h.slice() : di({}, h);
        return ie[Q] = hW(h[Q], X, W + 1, V), ie;
      }, eI = function(h, X, W) {
        return hW(h, X, 0, W);
      }, HW = function(h, X) {
        for (var W = h.memoizedState; W !== null && X > 0; )
          W = W.next, X--;
        return W;
      };
      lW = function(h, X, W, V) {
        var Q = HW(h, X);
        if (Q !== null) {
          var ie = eI(Q.memoizedState, W, V);
          Q.memoizedState = ie, Q.baseState = ie, h.memoizedProps = di({}, h.memoizedProps);
          var le = l6(h, Ln);
          le !== null && Qo(le, h, Ln, Ma);
        }
      }, MU = function(h, X, W) {
        var V = HW(h, X);
        if (V !== null) {
          var Q = ZU(V.memoizedState, W);
          V.memoizedState = Q, V.baseState = Q, h.memoizedProps = di({}, h.memoizedProps);
          var ie = l6(h, Ln);
          ie !== null && Qo(ie, h, Ln, Ma);
        }
      }, LU = function(h, X, W, V) {
        var Q = HW(h, X);
        if (Q !== null) {
          var ie = $U(Q.memoizedState, W, V);
          Q.memoizedState = ie, Q.baseState = ie, h.memoizedProps = di({}, h.memoizedProps);
          var le = l6(h, Ln);
          le !== null && Qo(le, h, Ln, Ma);
        }
      }, KU = function(h, X, W) {
        h.pendingProps = eI(h.memoizedProps, X, W), h.alternate && (h.alternate.pendingProps = h.pendingProps);
        var V = l6(h, Ln);
        V !== null && Qo(V, h, Ln, Ma);
      }, PW = function(h, X) {
        h.pendingProps = ZU(h.memoizedProps, X), h.alternate && (h.alternate.pendingProps = h.pendingProps);
        var W = l6(h, Ln);
        W !== null && Qo(W, h, Ln, Ma);
      }, JU = function(h, X, W) {
        h.pendingProps = $U(h.memoizedProps, X, W), h.alternate && (h.alternate.pendingProps = h.pendingProps);
        var V = l6(h, Ln);
        V !== null && Qo(V, h, Ln, Ma);
      }, zU = function(h) {
        var X = l6(h, Ln);
        X !== null && Qo(X, h, Ln, Ma);
      }, cW = function(h) {
        NU = h;
      }, GU = function(h) {
        YU = h;
      };
    }
    function tI(h) {
      var X = tf(h);
      return X === null ? null : X.stateNode;
    }
    function kV(h) {
      return null;
    }
    function rI() {
      return $i;
    }
    function EV(h) {
      var X = h.findFiberByHostInstance, W = t.ReactCurrentDispatcher;
      return Kc({
        bundleType: h.bundleType,
        version: h.version,
        rendererPackageName: h.rendererPackageName,
        rendererConfig: h.rendererConfig,
        overrideHookState: lW,
        overrideHookStateDeletePath: MU,
        overrideHookStateRenamePath: LU,
        overrideProps: KU,
        overridePropsDeletePath: PW,
        overridePropsRenamePath: JU,
        setErrorHandler: cW,
        setSuspenseHandler: GU,
        scheduleUpdate: zU,
        currentDispatcherRef: W,
        findHostInstanceByFiber: tI,
        findFiberByHostInstance: X || kV,
        // React Refresh
        findHostInstancesForRefresh: DV,
        scheduleRefresh: bV,
        scheduleRoot: xV,
        setRefreshHandler: ZB,
        // Enables DevTools to append owner stacks to error messages in DEV mode.
        getCurrentFiber: rI,
        // Enables DevTools to detect reconciler version rather than renderer version
        // which may not match for third party renderers.
        reconcilerVersion: Rw
      });
    }
    var nI = typeof reportError == "function" ? (
      // In modern browsers, reportError will dispatch an error event,
      // emulating an uncaught JavaScript error.
      reportError
    ) : function(h) {
      console.error(h);
    };
    function Cw(h) {
      this._internalRoot = h;
    }
    Ow.prototype.render = Cw.prototype.render = function(h) {
      var X = this._internalRoot;
      if (X === null)
        throw new Error("Cannot update an unmounted root.");
      {
        typeof arguments[1] == "function" ? s("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().") : yw(arguments[1]) ? s("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root.") : typeof arguments[1] < "u" && s("You passed a second argument to root.render(...) but it only accepts one argument.");
        var W = X.containerInfo;
        if (W.nodeType !== Xo) {
          var V = FU(X.current);
          V && V.parentNode !== W && s("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
        }
      }
      Vx(h, X, null, null);
    }, Ow.prototype.unmount = Cw.prototype.unmount = function() {
      typeof arguments[0] == "function" && s("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
      var h = this._internalRoot;
      if (h !== null) {
        this._internalRoot = null;
        var X = h.containerInfo;
        Wx() && s("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."), yd(function() {
          Vx(null, h, null, null);
        }), Xj(X);
      }
    };
    function FV(h, X) {
      if (!yw(h))
        throw new Error("createRoot(...): Target container is not a DOM element.");
      XW(h);
      var W = !1, V = !1, Q = "", ie = nI;
      X != null && (X.hydrate ? i("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.") : typeof X == "object" && X !== null && X.$$typeof === vr && s(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:

  let root = createRoot(domContainer);
  root.render(<App />);`), X.unstable_strictMode === !0 && (W = !0), X.identifierPrefix !== void 0 && (Q = X.identifierPrefix), X.onRecoverableError !== void 0 && (ie = X.onRecoverableError), X.transitionCallbacks !== void 0 && X.transitionCallbacks);
      var le = OU(h, Sh, null, W, V, Q, ie);
      v6(le.current, h);
      var He = h.nodeType === Xo ? h.parentNode : h;
      return rX(He), new Cw(le);
    }
    function Ow(h) {
      this._internalRoot = h;
    }
    function gW(h) {
      h && Ng(h);
    }
    Ow.prototype.unstable_scheduleHydration = gW;
    function NV(h, X, W) {
      if (!yw(h))
        throw new Error("hydrateRoot(...): Target container is not a DOM element.");
      XW(h), X === void 0 && s("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");
      var V = W ?? null, Q = W != null && W.hydratedSources || null, ie = !1, le = !1, He = "", xe = nI;
      W != null && (W.unstable_strictMode === !0 && (ie = !0), W.identifierPrefix !== void 0 && (He = W.identifierPrefix), W.onRecoverableError !== void 0 && (xe = W.onRecoverableError));
      var Je = yU(X, null, h, Sh, V, ie, le, He, xe);
      if (v6(Je.current, h), rX(h), Q)
        for (var _e = 0; _e < Q.length; _e++) {
          var qt = Q[_e];
          kj(Je, qt);
        }
      return new Ow(Je);
    }
    function yw(h) {
      return !!(h && (h.nodeType === Kf || h.nodeType === C6 || h.nodeType === Zv || !$));
    }
    function Cx(h) {
      return !!(h && (h.nodeType === Kf || h.nodeType === C6 || h.nodeType === Zv || h.nodeType === Xo && h.nodeValue === " react-mount-point-unstable "));
    }
    function XW(h) {
      h.nodeType === Kf && h.tagName && h.tagName.toUpperCase() === "BODY" && s("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app."), hX(h) && (h._reactRootContainer ? s("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.") : s("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."));
    }
    var QV = t.ReactCurrentOwner, TW;
    TW = function(h) {
      if (h._reactRootContainer && h.nodeType !== Xo) {
        var X = FU(h._reactRootContainer.current);
        X && X.parentNode !== h && s("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
      }
      var W = !!h._reactRootContainer, V = qW(h), Q = !!(V && IP(V));
      Q && !W && s("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."), h.nodeType === Kf && h.tagName && h.tagName.toUpperCase() === "BODY" && s("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
    };
    function qW(h) {
      return h ? h.nodeType === C6 ? h.documentElement : h.firstChild : null;
    }
    function bW() {
    }
    function YV(h, X, W, V, Q) {
      if (Q) {
        if (typeof V == "function") {
          var ie = V;
          V = function() {
            var Ht = Vw(le);
            ie.call(Ht);
          };
        }
        var le = yU(
          X,
          V,
          h,
          yP,
          null,
          // hydrationCallbacks
          !1,
          // isStrictMode
          !1,
          // concurrentUpdatesByDefaultOverride,
          "",
          // identifierPrefix
          bW
        );
        h._reactRootContainer = le, v6(le.current, h);
        var He = h.nodeType === Xo ? h.parentNode : h;
        return rX(He), yd(), le;
      } else {
        for (var xe; xe = h.lastChild; )
          h.removeChild(xe);
        if (typeof V == "function") {
          var Je = V;
          V = function() {
            var Ht = Vw(_e);
            Je.call(Ht);
          };
        }
        var _e = OU(
          h,
          yP,
          null,
          // hydrationCallbacks
          !1,
          // isStrictMode
          !1,
          // concurrentUpdatesByDefaultOverride,
          "",
          // identifierPrefix
          bW
        );
        h._reactRootContainer = _e, v6(_e.current, h);
        var qt = h.nodeType === Xo ? h.parentNode : h;
        return rX(qt), yd(function() {
          Vx(X, _e, W, V);
        }), _e;
      }
    }
    function MV(h, X) {
      h !== null && typeof h != "function" && s("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", X, h);
    }
    function Ox(h, X, W, V, Q) {
      TW(W), MV(Q === void 0 ? null : Q, "render");
      var ie = W._reactRootContainer, le;
      if (!ie)
        le = YV(W, X, h, Q, V);
      else {
        if (le = ie, typeof Q == "function") {
          var He = Q;
          Q = function() {
            var xe = Vw(le);
            He.call(xe);
          };
        }
        Vx(X, le, h, Q);
      }
      return Vw(le);
    }
    function LV(h) {
      {
        var X = QV.current;
        if (X !== null && X.stateNode !== null) {
          var W = X.stateNode._warnedAboutRefsInRender;
          W || s("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", Li(X.type) || "A component"), X.stateNode._warnedAboutRefsInRender = !0;
        }
      }
      return h == null ? null : h.nodeType === Kf ? h : CV(h, "findDOMNode");
    }
    function iI(h, X, W) {
      if (s("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"), !Cx(X))
        throw new Error("Target container is not a DOM element.");
      {
        var V = hX(X) && X._reactRootContainer === void 0;
        V && s("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?");
      }
      return Ox(null, h, X, !0, W);
    }
    function KV(h, X, W) {
      if (s("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"), !Cx(X))
        throw new Error("Target container is not a DOM element.");
      {
        var V = hX(X) && X._reactRootContainer === void 0;
        V && s("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?");
      }
      return Ox(null, h, X, !1, W);
    }
    function JV(h, X, W, V) {
      if (s("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"), !Cx(W))
        throw new Error("Target container is not a DOM element.");
      if (h == null || !FA(h))
        throw new Error("parentComponent must be a valid React Component");
      return Ox(h, X, W, !1, V);
    }
    function zV(h) {
      if (!Cx(h))
        throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");
      {
        var X = hX(h) && h._reactRootContainer === void 0;
        X && s("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?");
      }
      if (h._reactRootContainer) {
        {
          var W = qW(h), V = W && !IP(W);
          V && s("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
        }
        return yd(function() {
          Ox(null, null, h, !1, function() {
            h._reactRootContainer = null, Xj(h);
          });
        }), !0;
      } else {
        {
          var Q = qW(h), ie = !!(Q && IP(Q)), le = h.nodeType === Kf && Cx(h.parentNode) && !!h.parentNode._reactRootContainer;
          ie && s("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", le ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
        }
        return !1;
      }
    }
    Un(kU), o3(uW), sh(OV), Eg(a6), Fg(a3), (typeof Map != "function" || // $FlowIssue Flow incorrectly thinks Map has no prototype
    Map.prototype == null || typeof Map.prototype.forEach != "function" || typeof Set != "function" || // $FlowIssue Flow incorrectly thinks Set has no prototype
    Set.prototype == null || typeof Set.prototype.clear != "function" || typeof Set.prototype.forEach != "function") && s("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), t7(dB), Mu(Bx, GB, yd);
    function yx(h, X) {
      var W = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
      if (!yw(X))
        throw new Error("Target container is not a DOM element.");
      return VV(h, X, null, W);
    }
    function GV(h, X, W, V) {
      return JV(h, X, W, V);
    }
    var xW = {
      usingClientEntryPoint: !1,
      // Keep in sync with ReactTestUtils.js.
      // This is an array for better minification.
      Events: [IP, M6, tT, Ec, Fc, Bx]
    };
    function ZV(h, X) {
      return xW.usingClientEntryPoint || s('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'), FV(h, X);
    }
    function _V(h, X, W) {
      return xW.usingClientEntryPoint || s('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'), NV(h, X, W);
    }
    function sI(h) {
      return Wx() && s("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."), yd(h);
    }
    var $V = EV({
      findFiberByHostInstance: wh,
      bundleType: 1,
      version: Rw,
      rendererPackageName: "react-dom"
    });
    if (!$V && ke && window.top === window.self && (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1)) {
      var DW = window.location.protocol;
      /^(https?|file):$/.test(DW) && console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (DW === "file:" ? `
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq` : ""), "font-weight:bold");
    }
    fc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = xW, fc.createPortal = yx, fc.createRoot = ZV, fc.findDOMNode = LV, fc.flushSync = sI, fc.hydrate = iI, fc.hydrateRoot = _V, fc.render = KV, fc.unmountComponentAtNode = zV, fc.unstable_batchedUpdates = Bx, fc.unstable_renderSubtreeIntoContainer = GV, fc.version = Rw, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
  }()), fc;
}
var Ac = {};
/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var n$;
function iwe() {
  if (n$)
    return Ac;
  n$ = 1;
  var A = F0, e = f9e();
  function t(D) {
    for (var B = "https://reactjs.org/docs/error-decoder.html?invariant=" + D, E = 1; E < arguments.length; E++)
      B += "&args[]=" + encodeURIComponent(arguments[E]);
    return "Minified React error #" + D + "; visit " + B + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  var r = /* @__PURE__ */ new Set(), n = {};
  function i(D, B) {
    s(D, B), s(D + "Capture", B);
  }
  function s(D, B) {
    for (n[D] = B, D = 0; D < B.length; D++)
      r.add(B[D]);
  }
  var a = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), f = Object.prototype.hasOwnProperty, o = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, d = {}, v = {};
  function u(D) {
    return f.call(v, D) ? !0 : f.call(d, D) ? !1 : o.test(D) ? v[D] = !0 : (d[D] = !0, !1);
  }
  function l(D, B, E, z) {
    if (E !== null && E.type === 0)
      return !1;
    switch (typeof B) {
      case "function":
      case "symbol":
        return !0;
      case "boolean":
        return z ? !1 : E !== null ? !E.acceptsBooleans : (D = D.toLowerCase().slice(0, 5), D !== "data-" && D !== "aria-");
      default:
        return !1;
    }
  }
  function P(D, B, E, z) {
    if (B === null || typeof B > "u" || l(D, B, E, z))
      return !0;
    if (z)
      return !1;
    if (E !== null)
      switch (E.type) {
        case 3:
          return !B;
        case 4:
          return B === !1;
        case 5:
          return isNaN(B);
        case 6:
          return isNaN(B) || 1 > B;
      }
    return !1;
  }
  function p(D, B, E, z, Ae, pe, Re) {
    this.acceptsBooleans = B === 2 || B === 3 || B === 4, this.attributeName = z, this.attributeNamespace = Ae, this.mustUseProperty = E, this.propertyName = D, this.type = B, this.sanitizeURL = pe, this.removeEmptyString = Re;
  }
  var c = {};
  "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(D) {
    c[D] = new p(D, 0, !1, D, null, !1, !1);
  }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(D) {
    var B = D[0];
    c[B] = new p(B, 1, !1, D[1], null, !1, !1);
  }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(D) {
    c[D] = new p(D, 2, !1, D.toLowerCase(), null, !1, !1);
  }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(D) {
    c[D] = new p(D, 2, !1, D, null, !1, !1);
  }), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(D) {
    c[D] = new p(D, 3, !1, D.toLowerCase(), null, !1, !1);
  }), ["checked", "multiple", "muted", "selected"].forEach(function(D) {
    c[D] = new p(D, 3, !0, D, null, !1, !1);
  }), ["capture", "download"].forEach(function(D) {
    c[D] = new p(D, 4, !1, D, null, !1, !1);
  }), ["cols", "rows", "size", "span"].forEach(function(D) {
    c[D] = new p(D, 6, !1, D, null, !1, !1);
  }), ["rowSpan", "start"].forEach(function(D) {
    c[D] = new p(D, 5, !1, D.toLowerCase(), null, !1, !1);
  });
  var H = /[\-:]([a-z])/g;
  function T(D) {
    return D[1].toUpperCase();
  }
  "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(D) {
    var B = D.replace(
      H,
      T
    );
    c[B] = new p(B, 1, !1, D, null, !1, !1);
  }), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(D) {
    var B = D.replace(H, T);
    c[B] = new p(B, 1, !1, D, "http://www.w3.org/1999/xlink", !1, !1);
  }), ["xml:base", "xml:lang", "xml:space"].forEach(function(D) {
    var B = D.replace(H, T);
    c[B] = new p(B, 1, !1, D, "http://www.w3.org/XML/1998/namespace", !1, !1);
  }), ["tabIndex", "crossOrigin"].forEach(function(D) {
    c[D] = new p(D, 1, !1, D.toLowerCase(), null, !1, !1);
  }), c.xlinkHref = new p("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1), ["src", "href", "action", "formAction"].forEach(function(D) {
    c[D] = new p(D, 1, !1, D.toLowerCase(), null, !0, !0);
  });
  function q(D, B, E, z) {
    var Ae = c.hasOwnProperty(B) ? c[B] : null;
    (Ae !== null ? Ae.type !== 0 : z || !(2 < B.length) || B[0] !== "o" && B[0] !== "O" || B[1] !== "n" && B[1] !== "N") && (P(B, E, Ae, z) && (E = null), z || Ae === null ? u(B) && (E === null ? D.removeAttribute(B) : D.setAttribute(B, "" + E)) : Ae.mustUseProperty ? D[Ae.propertyName] = E === null ? Ae.type === 3 ? !1 : "" : E : (B = Ae.attributeName, z = Ae.attributeNamespace, E === null ? D.removeAttribute(B) : (Ae = Ae.type, E = Ae === 3 || Ae === 4 && E === !0 ? "" : "" + E, z ? D.setAttributeNS(z, B, E) : D.setAttribute(B, E))));
  }
  var b = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, j = Symbol.for("react.element"), w = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), I = Symbol.for("react.strict_mode"), N = Symbol.for("react.profiler"), k = Symbol.for("react.provider"), R = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), ee = Symbol.for("react.memo"), Z = Symbol.for("react.lazy"), te = Symbol.for("react.offscreen"), fe = Symbol.iterator;
  function _(D) {
    return D === null || typeof D != "object" ? null : (D = fe && D[fe] || D["@@iterator"], typeof D == "function" ? D : null);
  }
  var G = Object.assign, L;
  function $(D) {
    if (L === void 0)
      try {
        throw Error();
      } catch (E) {
        var B = E.stack.trim().match(/\n( *(at )?)/);
        L = B && B[1] || "";
      }
    return `
` + L + D;
  }
  var ae = !1;
  function Pe(D, B) {
    if (!D || ae)
      return "";
    ae = !0;
    var E = Error.prepareStackTrace;
    Error.prepareStackTrace = void 0;
    try {
      if (B)
        if (B = function() {
          throw Error();
        }, Object.defineProperty(B.prototype, "props", { set: function() {
          throw Error();
        } }), typeof Reflect == "object" && Reflect.construct) {
          try {
            Reflect.construct(B, []);
          } catch (Jt) {
            var z = Jt;
          }
          Reflect.construct(D, [], B);
        } else {
          try {
            B.call();
          } catch (Jt) {
            z = Jt;
          }
          D.call(B.prototype);
        }
      else {
        try {
          throw Error();
        } catch (Jt) {
          z = Jt;
        }
        D();
      }
    } catch (Jt) {
      if (Jt && z && typeof Jt.stack == "string") {
        for (var Ae = Jt.stack.split(`
`), pe = z.stack.split(`
`), Re = Ae.length - 1, ot = pe.length - 1; 1 <= Re && 0 <= ot && Ae[Re] !== pe[ot]; )
          ot--;
        for (; 1 <= Re && 0 <= ot; Re--, ot--)
          if (Ae[Re] !== pe[ot]) {
            if (Re !== 1 || ot !== 1)
              do
                if (Re--, ot--, 0 > ot || Ae[Re] !== pe[ot]) {
                  var lt = `
` + Ae[Re].replace(" at new ", " at ");
                  return D.displayName && lt.includes("<anonymous>") && (lt = lt.replace("<anonymous>", D.displayName)), lt;
                }
              while (1 <= Re && 0 <= ot);
            break;
          }
      }
    } finally {
      ae = !1, Error.prepareStackTrace = E;
    }
    return (D = D ? D.displayName || D.name : "") ? $(D) : "";
  }
  function ge(D) {
    switch (D.tag) {
      case 5:
        return $(D.type);
      case 16:
        return $("Lazy");
      case 13:
        return $("Suspense");
      case 19:
        return $("SuspenseList");
      case 0:
      case 2:
      case 15:
        return D = Pe(D.type, !1), D;
      case 11:
        return D = Pe(D.type.render, !1), D;
      case 1:
        return D = Pe(D.type, !0), D;
      default:
        return "";
    }
  }
  function me(D) {
    if (D == null)
      return null;
    if (typeof D == "function")
      return D.displayName || D.name || null;
    if (typeof D == "string")
      return D;
    switch (D) {
      case m:
        return "Fragment";
      case w:
        return "Portal";
      case N:
        return "Profiler";
      case I:
        return "StrictMode";
      case O:
        return "Suspense";
      case Y:
        return "SuspenseList";
    }
    if (typeof D == "object")
      switch (D.$$typeof) {
        case R:
          return (D.displayName || "Context") + ".Consumer";
        case k:
          return (D._context.displayName || "Context") + ".Provider";
        case y:
          var B = D.render;
          return D = D.displayName, D || (D = B.displayName || B.name || "", D = D !== "" ? "ForwardRef(" + D + ")" : "ForwardRef"), D;
        case ee:
          return B = D.displayName || null, B !== null ? B : me(D.type) || "Memo";
        case Z:
          B = D._payload, D = D._init;
          try {
            return me(D(B));
          } catch {
          }
      }
    return null;
  }
  function Xe(D) {
    var B = D.type;
    switch (D.tag) {
      case 24:
        return "Cache";
      case 9:
        return (B.displayName || "Context") + ".Consumer";
      case 10:
        return (B._context.displayName || "Context") + ".Provider";
      case 18:
        return "DehydratedFragment";
      case 11:
        return D = B.render, D = D.displayName || D.name || "", B.displayName || (D !== "" ? "ForwardRef(" + D + ")" : "ForwardRef");
      case 7:
        return "Fragment";
      case 5:
        return B;
      case 4:
        return "Portal";
      case 3:
        return "Root";
      case 6:
        return "Text";
      case 16:
        return me(B);
      case 8:
        return B === I ? "StrictMode" : "Mode";
      case 22:
        return "Offscreen";
      case 12:
        return "Profiler";
      case 21:
        return "Scope";
      case 13:
        return "Suspense";
      case 19:
        return "SuspenseList";
      case 25:
        return "TracingMarker";
      case 1:
      case 0:
      case 17:
      case 2:
      case 14:
      case 15:
        if (typeof B == "function")
          return B.displayName || B.name || null;
        if (typeof B == "string")
          return B;
    }
    return null;
  }
  function De(D) {
    switch (typeof D) {
      case "boolean":
      case "number":
      case "string":
      case "undefined":
        return D;
      case "object":
        return D;
      default:
        return "";
    }
  }
  function ne(D) {
    var B = D.type;
    return (D = D.nodeName) && D.toLowerCase() === "input" && (B === "checkbox" || B === "radio");
  }
  function re(D) {
    var B = ne(D) ? "checked" : "value", E = Object.getOwnPropertyDescriptor(D.constructor.prototype, B), z = "" + D[B];
    if (!D.hasOwnProperty(B) && typeof E < "u" && typeof E.get == "function" && typeof E.set == "function") {
      var Ae = E.get, pe = E.set;
      return Object.defineProperty(D, B, { configurable: !0, get: function() {
        return Ae.call(this);
      }, set: function(Re) {
        z = "" + Re, pe.call(this, Re);
      } }), Object.defineProperty(D, B, { enumerable: E.enumerable }), { getValue: function() {
        return z;
      }, setValue: function(Re) {
        z = "" + Re;
      }, stopTracking: function() {
        D._valueTracker = null, delete D[B];
      } };
    }
  }
  function ve(D) {
    D._valueTracker || (D._valueTracker = re(D));
  }
  function qe(D) {
    if (!D)
      return !1;
    var B = D._valueTracker;
    if (!B)
      return !0;
    var E = B.getValue(), z = "";
    return D && (z = ne(D) ? D.checked ? "true" : "false" : D.value), D = z, D !== E ? (B.setValue(D), !0) : !1;
  }
  function ke(D) {
    if (D = D || (typeof document < "u" ? document : void 0), typeof D > "u")
      return null;
    try {
      return D.activeElement || D.body;
    } catch {
      return D.body;
    }
  }
  function be(D, B) {
    var E = B.checked;
    return G({}, B, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: E ?? D._wrapperState.initialChecked });
  }
  function Fe(D, B) {
    var E = B.defaultValue == null ? "" : B.defaultValue, z = B.checked != null ? B.checked : B.defaultChecked;
    E = De(B.value != null ? B.value : E), D._wrapperState = { initialChecked: z, initialValue: E, controlled: B.type === "checkbox" || B.type === "radio" ? B.checked != null : B.value != null };
  }
  function Ke(D, B) {
    B = B.checked, B != null && q(D, "checked", B, !1);
  }
  function nt(D, B) {
    Ke(D, B);
    var E = De(B.value), z = B.type;
    if (E != null)
      z === "number" ? (E === 0 && D.value === "" || D.value != E) && (D.value = "" + E) : D.value !== "" + E && (D.value = "" + E);
    else if (z === "submit" || z === "reset") {
      D.removeAttribute("value");
      return;
    }
    B.hasOwnProperty("value") ? bt(D, B.type, E) : B.hasOwnProperty("defaultValue") && bt(D, B.type, De(B.defaultValue)), B.checked == null && B.defaultChecked != null && (D.defaultChecked = !!B.defaultChecked);
  }
  function ut(D, B, E) {
    if (B.hasOwnProperty("value") || B.hasOwnProperty("defaultValue")) {
      var z = B.type;
      if (!(z !== "submit" && z !== "reset" || B.value !== void 0 && B.value !== null))
        return;
      B = "" + D._wrapperState.initialValue, E || B === D.value || (D.value = B), D.defaultValue = B;
    }
    E = D.name, E !== "" && (D.name = ""), D.defaultChecked = !!D._wrapperState.initialChecked, E !== "" && (D.name = E);
  }
  function bt(D, B, E) {
    (B !== "number" || ke(D.ownerDocument) !== D) && (E == null ? D.defaultValue = "" + D._wrapperState.initialValue : D.defaultValue !== "" + E && (D.defaultValue = "" + E));
  }
  var wt = Array.isArray;
  function Tt(D, B, E, z) {
    if (D = D.options, B) {
      B = {};
      for (var Ae = 0; Ae < E.length; Ae++)
        B["$" + E[Ae]] = !0;
      for (E = 0; E < D.length; E++)
        Ae = B.hasOwnProperty("$" + D[E].value), D[E].selected !== Ae && (D[E].selected = Ae), Ae && z && (D[E].defaultSelected = !0);
    } else {
      for (E = "" + De(E), B = null, Ae = 0; Ae < D.length; Ae++) {
        if (D[Ae].value === E) {
          D[Ae].selected = !0, z && (D[Ae].defaultSelected = !0);
          return;
        }
        B !== null || D[Ae].disabled || (B = D[Ae]);
      }
      B !== null && (B.selected = !0);
    }
  }
  function lr(D, B) {
    if (B.dangerouslySetInnerHTML != null)
      throw Error(t(91));
    return G({}, B, { value: void 0, defaultValue: void 0, children: "" + D._wrapperState.initialValue });
  }
  function Qt(D, B) {
    var E = B.value;
    if (E == null) {
      if (E = B.children, B = B.defaultValue, E != null) {
        if (B != null)
          throw Error(t(92));
        if (wt(E)) {
          if (1 < E.length)
            throw Error(t(93));
          E = E[0];
        }
        B = E;
      }
      B == null && (B = ""), E = B;
    }
    D._wrapperState = { initialValue: De(E) };
  }
  function tr(D, B) {
    var E = De(B.value), z = De(B.defaultValue);
    E != null && (E = "" + E, E !== D.value && (D.value = E), B.defaultValue == null && D.defaultValue !== E && (D.defaultValue = E)), z != null && (D.defaultValue = "" + z);
  }
  function br(D) {
    var B = D.textContent;
    B === D._wrapperState.initialValue && B !== "" && B !== null && (D.value = B);
  }
  function Xn(D) {
    switch (D) {
      case "svg":
        return "http://www.w3.org/2000/svg";
      case "math":
        return "http://www.w3.org/1998/Math/MathML";
      default:
        return "http://www.w3.org/1999/xhtml";
    }
  }
  function qr(D, B) {
    return D == null || D === "http://www.w3.org/1999/xhtml" ? Xn(B) : D === "http://www.w3.org/2000/svg" && B === "foreignObject" ? "http://www.w3.org/1999/xhtml" : D;
  }
  var En, Bn = function(D) {
    return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(B, E, z, Ae) {
      MSApp.execUnsafeLocalFunction(function() {
        return D(B, E, z, Ae);
      });
    } : D;
  }(function(D, B) {
    if (D.namespaceURI !== "http://www.w3.org/2000/svg" || "innerHTML" in D)
      D.innerHTML = B;
    else {
      for (En = En || document.createElement("div"), En.innerHTML = "<svg>" + B.valueOf().toString() + "</svg>", B = En.firstChild; D.firstChild; )
        D.removeChild(D.firstChild);
      for (; B.firstChild; )
        D.appendChild(B.firstChild);
    }
  });
  function Fi(D, B) {
    if (B) {
      var E = D.firstChild;
      if (E && E === D.lastChild && E.nodeType === 3) {
        E.nodeValue = B;
        return;
      }
    }
    D.textContent = B;
  }
  var Gt = {
    animationIterationCount: !0,
    aspectRatio: !0,
    borderImageOutset: !0,
    borderImageSlice: !0,
    borderImageWidth: !0,
    boxFlex: !0,
    boxFlexGroup: !0,
    boxOrdinalGroup: !0,
    columnCount: !0,
    columns: !0,
    flex: !0,
    flexGrow: !0,
    flexPositive: !0,
    flexShrink: !0,
    flexNegative: !0,
    flexOrder: !0,
    gridArea: !0,
    gridRow: !0,
    gridRowEnd: !0,
    gridRowSpan: !0,
    gridRowStart: !0,
    gridColumn: !0,
    gridColumnEnd: !0,
    gridColumnSpan: !0,
    gridColumnStart: !0,
    fontWeight: !0,
    lineClamp: !0,
    lineHeight: !0,
    opacity: !0,
    order: !0,
    orphans: !0,
    tabSize: !0,
    widows: !0,
    zIndex: !0,
    zoom: !0,
    fillOpacity: !0,
    floodOpacity: !0,
    stopOpacity: !0,
    strokeDasharray: !0,
    strokeDashoffset: !0,
    strokeMiterlimit: !0,
    strokeOpacity: !0,
    strokeWidth: !0
  }, xr = ["Webkit", "ms", "Moz", "O"];
  Object.keys(Gt).forEach(function(D) {
    xr.forEach(function(B) {
      B = B + D.charAt(0).toUpperCase() + D.substring(1), Gt[B] = Gt[D];
    });
  });
  function Br(D, B, E) {
    return B == null || typeof B == "boolean" || B === "" ? "" : E || typeof B != "number" || B === 0 || Gt.hasOwnProperty(D) && Gt[D] ? ("" + B).trim() : B + "px";
  }
  function nn(D, B) {
    D = D.style;
    for (var E in B)
      if (B.hasOwnProperty(E)) {
        var z = E.indexOf("--") === 0, Ae = Br(E, B[E], z);
        E === "float" && (E = "cssFloat"), z ? D.setProperty(E, Ae) : D[E] = Ae;
      }
  }
  var sn = G({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 });
  function Pn(D, B) {
    if (B) {
      if (sn[D] && (B.children != null || B.dangerouslySetInnerHTML != null))
        throw Error(t(137, D));
      if (B.dangerouslySetInnerHTML != null) {
        if (B.children != null)
          throw Error(t(60));
        if (typeof B.dangerouslySetInnerHTML != "object" || !("__html" in B.dangerouslySetInnerHTML))
          throw Error(t(61));
      }
      if (B.style != null && typeof B.style != "object")
        throw Error(t(62));
    }
  }
  function an(D, B) {
    if (D.indexOf("-") === -1)
      return typeof B.is == "string";
    switch (D) {
      case "annotation-xml":
      case "color-profile":
      case "font-face":
      case "font-face-src":
      case "font-face-uri":
      case "font-face-format":
      case "font-face-name":
      case "missing-glyph":
        return !1;
      default:
        return !0;
    }
  }
  var Wn = null;
  function rr(D) {
    return D = D.target || D.srcElement || window, D.correspondingUseElement && (D = D.correspondingUseElement), D.nodeType === 3 ? D.parentNode : D;
  }
  var Sr = null, nr = null, Er = null;
  function Rn(D) {
    if (D = FA(D)) {
      if (typeof Sr != "function")
        throw Error(t(280));
      var B = D.stateNode;
      B && (B = fn(B), Sr(D.stateNode, D.type, B));
    }
  }
  function Vn(D) {
    nr ? Er ? Er.push(D) : Er = [D] : nr = D;
  }
  function ki() {
    if (nr) {
      var D = nr, B = Er;
      if (Er = nr = null, Rn(D), B)
        for (D = 0; D < B.length; D++)
          Rn(B[D]);
    }
  }
  function as(D, B) {
    return D(B);
  }
  function Rr() {
  }
  var Ii = !1;
  function is(D, B, E) {
    if (Ii)
      return D(B, E);
    Ii = !0;
    try {
      return as(D, B, E);
    } finally {
      Ii = !1, (nr !== null || Er !== null) && (Rr(), ki());
    }
  }
  function ji(D, B) {
    var E = D.stateNode;
    if (E === null)
      return null;
    var z = fn(E);
    if (z === null)
      return null;
    E = z[B];
    e:
      switch (B) {
        case "onClick":
        case "onClickCapture":
        case "onDoubleClick":
        case "onDoubleClickCapture":
        case "onMouseDown":
        case "onMouseDownCapture":
        case "onMouseMove":
        case "onMouseMoveCapture":
        case "onMouseUp":
        case "onMouseUpCapture":
        case "onMouseEnter":
          (z = !z.disabled) || (D = D.type, z = !(D === "button" || D === "input" || D === "select" || D === "textarea")), D = !z;
          break e;
        default:
          D = !1;
      }
    if (D)
      return null;
    if (E && typeof E != "function")
      throw Error(t(231, B, typeof E));
    return E;
  }
  var _i = !1;
  if (a)
    try {
      var oi = {};
      Object.defineProperty(oi, "passive", { get: function() {
        _i = !0;
      } }), window.addEventListener("test", oi, oi), window.removeEventListener("test", oi, oi);
    } catch {
      _i = !1;
    }
  function vr(D, B, E, z, Ae, pe, Re, ot, lt) {
    var Jt = Array.prototype.slice.call(arguments, 3);
    try {
      B.apply(E, Jt);
    } catch (Wr) {
      this.onError(Wr);
    }
  }
  var Fr = !1, pr = null, ds = !1, it = null, $t = { onError: function(D) {
    Fr = !0, pr = D;
  } };
  function Ur(D, B, E, z, Ae, pe, Re, ot, lt) {
    Fr = !1, pr = null, vr.apply($t, arguments);
  }
  function $e(D, B, E, z, Ae, pe, Re, ot, lt) {
    if (Ur.apply(this, arguments), Fr) {
      if (Fr) {
        var Jt = pr;
        Fr = !1, pr = null;
      } else
        throw Error(t(198));
      ds || (ds = !0, it = Jt);
    }
  }
  function Kt(D) {
    var B = D, E = D;
    if (D.alternate)
      for (; B.return; )
        B = B.return;
    else {
      D = B;
      do
        B = D, B.flags & 4098 && (E = B.return), D = B.return;
      while (D);
    }
    return B.tag === 3 ? E : null;
  }
  function cr(D) {
    if (D.tag === 13) {
      var B = D.memoizedState;
      if (B === null && (D = D.alternate, D !== null && (B = D.memoizedState)), B !== null)
        return B.dehydrated;
    }
    return null;
  }
  function Vr(D) {
    if (Kt(D) !== D)
      throw Error(t(188));
  }
  function Lr(D) {
    var B = D.alternate;
    if (!B) {
      if (B = Kt(D), B === null)
        throw Error(t(188));
      return B !== D ? null : D;
    }
    for (var E = D, z = B; ; ) {
      var Ae = E.return;
      if (Ae === null)
        break;
      var pe = Ae.alternate;
      if (pe === null) {
        if (z = Ae.return, z !== null) {
          E = z;
          continue;
        }
        break;
      }
      if (Ae.child === pe.child) {
        for (pe = Ae.child; pe; ) {
          if (pe === E)
            return Vr(Ae), D;
          if (pe === z)
            return Vr(Ae), B;
          pe = pe.sibling;
        }
        throw Error(t(188));
      }
      if (E.return !== z.return)
        E = Ae, z = pe;
      else {
        for (var Re = !1, ot = Ae.child; ot; ) {
          if (ot === E) {
            Re = !0, E = Ae, z = pe;
            break;
          }
          if (ot === z) {
            Re = !0, z = Ae, E = pe;
            break;
          }
          ot = ot.sibling;
        }
        if (!Re) {
          for (ot = pe.child; ot; ) {
            if (ot === E) {
              Re = !0, E = pe, z = Ae;
              break;
            }
            if (ot === z) {
              Re = !0, z = pe, E = Ae;
              break;
            }
            ot = ot.sibling;
          }
          if (!Re)
            throw Error(t(189));
        }
      }
      if (E.alternate !== z)
        throw Error(t(190));
    }
    if (E.tag !== 3)
      throw Error(t(188));
    return E.stateNode.current === E ? D : B;
  }
  function pi(D) {
    return D = Lr(D), D !== null ? zr(D) : null;
  }
  function zr(D) {
    if (D.tag === 5 || D.tag === 6)
      return D;
    for (D = D.child; D !== null; ) {
      var B = zr(D);
      if (B !== null)
        return B;
      D = D.sibling;
    }
    return null;
  }
  var Cn = e.unstable_scheduleCallback, Mi = e.unstable_cancelCallback, li = e.unstable_shouldYield, Xs = e.unstable_requestPaint, Ri = e.unstable_now, j1 = e.unstable_getCurrentPriorityLevel, w1 = e.unstable_ImmediatePriority, di = e.unstable_UserBlockingPriority, jf = e.unstable_NormalPriority, B6 = e.unstable_LowPriority, W6 = e.unstable_IdlePriority, S6 = null, qa = null;
  function m1(D) {
    if (qa && typeof qa.onCommitFiberRoot == "function")
      try {
        qa.onCommitFiberRoot(S6, D, void 0, (D.current.flags & 128) === 128);
      } catch {
      }
  }
  var Ho = Math.clz32 ? Math.clz32 : T9, X9 = Math.log, $o = Math.LN2;
  function T9(D) {
    return D >>>= 0, D === 0 ? 32 : 31 - (X9(D) / $o | 0) | 0;
  }
  var q9 = 64, wf = 4194304;
  function mf(D) {
    switch (D & -D) {
      case 1:
        return 1;
      case 2:
        return 2;
      case 4:
        return 4;
      case 8:
        return 8;
      case 16:
        return 16;
      case 32:
        return 32;
      case 64:
      case 128:
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return D & 4194240;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
      case 67108864:
        return D & 130023424;
      case 134217728:
        return 134217728;
      case 268435456:
        return 268435456;
      case 536870912:
        return 536870912;
      case 1073741824:
        return 1073741824;
      default:
        return D;
    }
  }
  function B1(D, B) {
    var E = D.pendingLanes;
    if (E === 0)
      return 0;
    var z = 0, Ae = D.suspendedLanes, pe = D.pingedLanes, Re = E & 268435455;
    if (Re !== 0) {
      var ot = Re & ~Ae;
      ot !== 0 ? z = mf(ot) : (pe &= Re, pe !== 0 && (z = mf(pe)));
    } else
      Re = E & ~Ae, Re !== 0 ? z = mf(Re) : pe !== 0 && (z = mf(pe));
    if (z === 0)
      return 0;
    if (B !== 0 && B !== z && !(B & Ae) && (Ae = z & -z, pe = B & -B, Ae >= pe || Ae === 16 && (pe & 4194240) !== 0))
      return B;
    if (z & 4 && (z |= E & 16), B = D.entangledLanes, B !== 0)
      for (D = D.entanglements, B &= z; 0 < B; )
        E = 31 - Ho(B), Ae = 1 << E, z |= D[E], B &= ~Ae;
    return z;
  }
  function h1(D, B) {
    switch (D) {
      case 1:
      case 2:
      case 4:
        return B + 250;
      case 8:
      case 16:
      case 32:
      case 64:
      case 128:
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return B + 5e3;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
      case 67108864:
        return -1;
      case 134217728:
      case 268435456:
      case 536870912:
      case 1073741824:
        return -1;
      default:
        return -1;
    }
  }
  function U6(D, B) {
    for (var E = D.suspendedLanes, z = D.pingedLanes, Ae = D.expirationTimes, pe = D.pendingLanes; 0 < pe; ) {
      var Re = 31 - Ho(pe), ot = 1 << Re, lt = Ae[Re];
      lt === -1 ? (!(ot & E) || ot & z) && (Ae[Re] = h1(ot, B)) : lt <= B && (D.expiredLanes |= ot), pe &= ~ot;
    }
  }
  function b9(D) {
    return D = D.pendingLanes & -1073741825, D !== 0 ? D : D & 1073741824 ? 1073741824 : 0;
  }
  function J9() {
    var D = q9;
    return q9 <<= 1, !(q9 & 4194240) && (q9 = 64), D;
  }
  function OA(D) {
    for (var B = [], E = 0; 31 > E; E++)
      B.push(D);
    return B;
  }
  function z1(D, B, E) {
    D.pendingLanes |= B, B !== 536870912 && (D.suspendedLanes = 0, D.pingedLanes = 0), D = D.eventTimes, B = 31 - Ho(B), D[B] = E;
  }
  function Zd(D, B) {
    var E = D.pendingLanes & ~B;
    D.pendingLanes = B, D.suspendedLanes = 0, D.pingedLanes = 0, D.expiredLanes &= B, D.mutableReadLanes &= B, D.entangledLanes &= B, B = D.entanglements;
    var z = D.eventTimes;
    for (D = D.expirationTimes; 0 < E; ) {
      var Ae = 31 - Ho(E), pe = 1 << Ae;
      B[Ae] = 0, z[Ae] = -1, D[Ae] = -1, E &= ~pe;
    }
  }
  function Zr(D, B) {
    var E = D.entangledLanes |= B;
    for (D = D.entanglements; E; ) {
      var z = 31 - Ho(E), Ae = 1 << z;
      Ae & B | D[z] & B && (D[z] |= B), E &= ~Ae;
    }
  }
  var Ts = 0;
  function go(D) {
    return D &= -D, 1 < D ? 4 < D ? D & 268435455 ? 16 : 536870912 : 4 : 1;
  }
  var G1, z9, Li, Fa, Sa, Fn = !1, I6 = [], $i = null, Ga = null, e1 = null, Lf = /* @__PURE__ */ new Map(), Ua = /* @__PURE__ */ new Map(), vs = [], R6 = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
  function Bf(D, B) {
    switch (D) {
      case "focusin":
      case "focusout":
        $i = null;
        break;
      case "dragenter":
      case "dragleave":
        Ga = null;
        break;
      case "mouseover":
      case "mouseout":
        e1 = null;
        break;
      case "pointerover":
      case "pointerout":
        Lf.delete(B.pointerId);
        break;
      case "gotpointercapture":
      case "lostpointercapture":
        Ua.delete(B.pointerId);
    }
  }
  function Ie(D, B, E, z, Ae, pe) {
    return D === null || D.nativeEvent !== pe ? (D = { blockedOn: B, domEventName: E, eventSystemFlags: z, nativeEvent: pe, targetContainers: [Ae] }, B !== null && (B = FA(B), B !== null && z9(B)), D) : (D.eventSystemFlags |= z, B = D.targetContainers, Ae !== null && B.indexOf(Ae) === -1 && B.push(Ae), D);
  }
  function Pt(D, B, E, z, Ae) {
    switch (B) {
      case "focusin":
        return $i = Ie($i, D, B, E, z, Ae), !0;
      case "dragenter":
        return Ga = Ie(Ga, D, B, E, z, Ae), !0;
      case "mouseover":
        return e1 = Ie(e1, D, B, E, z, Ae), !0;
      case "pointerover":
        var pe = Ae.pointerId;
        return Lf.set(pe, Ie(Lf.get(pe) || null, D, B, E, z, Ae)), !0;
      case "gotpointercapture":
        return pe = Ae.pointerId, Ua.set(pe, Ie(Ua.get(pe) || null, D, B, E, z, Ae)), !0;
    }
    return !1;
  }
  function Et(D) {
    var B = Es(D.target);
    if (B !== null) {
      var E = Kt(B);
      if (E !== null) {
        if (B = E.tag, B === 13) {
          if (B = cr(E), B !== null) {
            D.blockedOn = B, Sa(D.priority, function() {
              Li(E);
            });
            return;
          }
        } else if (B === 3 && E.stateNode.current.memoizedState.isDehydrated) {
          D.blockedOn = E.tag === 3 ? E.stateNode.containerInfo : null;
          return;
        }
      }
    }
    D.blockedOn = null;
  }
  function er(D) {
    if (D.blockedOn !== null)
      return !1;
    for (var B = D.targetContainers; 0 < B.length; ) {
      var E = Ro(D.domEventName, D.eventSystemFlags, B[0], D.nativeEvent);
      if (E === null) {
        E = D.nativeEvent;
        var z = new E.constructor(E.type, E);
        Wn = z, E.target.dispatchEvent(z), Wn = null;
      } else
        return B = FA(E), B !== null && z9(B), D.blockedOn = E, !1;
      B.shift();
    }
    return !0;
  }
  function _r(D, B, E) {
    er(D) && E.delete(B);
  }
  function Xi() {
    Fn = !1, $i !== null && er($i) && ($i = null), Ga !== null && er(Ga) && (Ga = null), e1 !== null && er(e1) && (e1 = null), Lf.forEach(_r), Ua.forEach(_r);
  }
  function Mn(D, B) {
    D.blockedOn === B && (D.blockedOn = null, Fn || (Fn = !0, e.unstable_scheduleCallback(e.unstable_NormalPriority, Xi)));
  }
  function _n(D) {
    function B(Ae) {
      return Mn(Ae, D);
    }
    if (0 < I6.length) {
      Mn(I6[0], D);
      for (var E = 1; E < I6.length; E++) {
        var z = I6[E];
        z.blockedOn === D && (z.blockedOn = null);
      }
    }
    for ($i !== null && Mn($i, D), Ga !== null && Mn(Ga, D), e1 !== null && Mn(e1, D), Lf.forEach(B), Ua.forEach(B), E = 0; E < vs.length; E++)
      z = vs[E], z.blockedOn === D && (z.blockedOn = null);
    for (; 0 < vs.length && (E = vs[0], E.blockedOn === null); )
      Et(E), E.blockedOn === null && vs.shift();
  }
  var Ps = b.ReactCurrentBatchConfig, qi = !0;
  function Gs(D, B, E, z) {
    var Ae = Ts, pe = Ps.transition;
    Ps.transition = null;
    try {
      Ts = 1, Na(D, B, E, z);
    } finally {
      Ts = Ae, Ps.transition = pe;
    }
  }
  function ks(D, B, E, z) {
    var Ae = Ts, pe = Ps.transition;
    Ps.transition = null;
    try {
      Ts = 4, Na(D, B, E, z);
    } finally {
      Ts = Ae, Ps.transition = pe;
    }
  }
  function Na(D, B, E, z) {
    if (qi) {
      var Ae = Ro(D, B, E, z);
      if (Ae === null)
        Ec(D, B, z, Ao, E), Bf(D, z);
      else if (Pt(Ae, D, B, E, z))
        z.stopPropagation();
      else if (Bf(D, z), B & 4 && -1 < R6.indexOf(D)) {
        for (; Ae !== null; ) {
          var pe = FA(Ae);
          if (pe !== null && G1(pe), pe = Ro(D, B, E, z), pe === null && Ec(D, B, z, Ao, E), pe === Ae)
            break;
          Ae = pe;
        }
        Ae !== null && z.stopPropagation();
      } else
        Ec(D, B, z, null, E);
    }
  }
  var Ao = null;
  function Ro(D, B, E, z) {
    if (Ao = null, D = rr(z), D = Es(D), D !== null)
      if (B = Kt(D), B === null)
        D = null;
      else if (E = B.tag, E === 13) {
        if (D = cr(B), D !== null)
          return D;
        D = null;
      } else if (E === 3) {
        if (B.stateNode.current.memoizedState.isDehydrated)
          return B.tag === 3 ? B.stateNode.containerInfo : null;
        D = null;
      } else
        B !== D && (D = null);
    return Ao = D, null;
  }
  function oA(D) {
    switch (D) {
      case "cancel":
      case "click":
      case "close":
      case "contextmenu":
      case "copy":
      case "cut":
      case "auxclick":
      case "dblclick":
      case "dragend":
      case "dragstart":
      case "drop":
      case "focusin":
      case "focusout":
      case "input":
      case "invalid":
      case "keydown":
      case "keypress":
      case "keyup":
      case "mousedown":
      case "mouseup":
      case "paste":
      case "pause":
      case "play":
      case "pointercancel":
      case "pointerdown":
      case "pointerup":
      case "ratechange":
      case "reset":
      case "resize":
      case "seeked":
      case "submit":
      case "touchcancel":
      case "touchend":
      case "touchstart":
      case "volumechange":
      case "change":
      case "selectionchange":
      case "textInput":
      case "compositionstart":
      case "compositionend":
      case "compositionupdate":
      case "beforeblur":
      case "afterblur":
      case "beforeinput":
      case "blur":
      case "fullscreenchange":
      case "focus":
      case "hashchange":
      case "popstate":
      case "select":
      case "selectstart":
        return 1;
      case "drag":
      case "dragenter":
      case "dragexit":
      case "dragleave":
      case "dragover":
      case "mousemove":
      case "mouseout":
      case "mouseover":
      case "pointermove":
      case "pointerout":
      case "pointerover":
      case "scroll":
      case "toggle":
      case "touchmove":
      case "wheel":
      case "mouseenter":
      case "mouseleave":
      case "pointerenter":
      case "pointerleave":
        return 4;
      case "message":
        switch (j1()) {
          case w1:
            return 1;
          case di:
            return 4;
          case jf:
          case B6:
            return 16;
          case W6:
            return 536870912;
          default:
            return 16;
        }
      default:
        return 16;
    }
  }
  var W1 = null, je = null, dt = null;
  function kt() {
    if (dt)
      return dt;
    var D, B = je, E = B.length, z, Ae = "value" in W1 ? W1.value : W1.textContent, pe = Ae.length;
    for (D = 0; D < E && B[D] === Ae[D]; D++)
      ;
    var Re = E - D;
    for (z = 1; z <= Re && B[E - z] === Ae[pe - z]; z++)
      ;
    return dt = Ae.slice(D, 1 < z ? 1 - z : void 0);
  }
  function _t(D) {
    var B = D.keyCode;
    return "charCode" in D ? (D = D.charCode, D === 0 && B === 13 && (D = 13)) : D = B, D === 10 && (D = 13), 32 <= D || D === 13 ? D : 0;
  }
  function Cr() {
    return !0;
  }
  function fi() {
    return !1;
  }
  function on(D) {
    function B(E, z, Ae, pe, Re) {
      this._reactName = E, this._targetInst = Ae, this.type = z, this.nativeEvent = pe, this.target = Re, this.currentTarget = null;
      for (var ot in D)
        D.hasOwnProperty(ot) && (E = D[ot], this[ot] = E ? E(pe) : pe[ot]);
      return this.isDefaultPrevented = (pe.defaultPrevented != null ? pe.defaultPrevented : pe.returnValue === !1) ? Cr : fi, this.isPropagationStopped = fi, this;
    }
    return G(B.prototype, { preventDefault: function() {
      this.defaultPrevented = !0;
      var E = this.nativeEvent;
      E && (E.preventDefault ? E.preventDefault() : typeof E.returnValue != "unknown" && (E.returnValue = !1), this.isDefaultPrevented = Cr);
    }, stopPropagation: function() {
      var E = this.nativeEvent;
      E && (E.stopPropagation ? E.stopPropagation() : typeof E.cancelBubble != "unknown" && (E.cancelBubble = !0), this.isPropagationStopped = Cr);
    }, persist: function() {
    }, isPersistent: Cr }), B;
  }
  var si = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(D) {
    return D.timeStamp || Date.now();
  }, defaultPrevented: 0, isTrusted: 0 }, ss = on(si), hs = G({}, si, { view: 0, detail: 0 }), js = on(hs), ws, Zs, Ia, cs = G({}, hs, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: Uc, button: 0, buttons: 0, relatedTarget: function(D) {
    return D.relatedTarget === void 0 ? D.fromElement === D.srcElement ? D.toElement : D.fromElement : D.relatedTarget;
  }, movementX: function(D) {
    return "movementX" in D ? D.movementX : (D !== Ia && (Ia && D.type === "mousemove" ? (ws = D.screenX - Ia.screenX, Zs = D.screenY - Ia.screenY) : Zs = ws = 0, Ia = D), ws);
  }, movementY: function(D) {
    return "movementY" in D ? D.movementY : Zs;
  } }), ud = on(cs), Lv = G({}, cs, { dataTransfer: 0 }), Kv = on(Lv), $l = G({}, hs, { relatedTarget: 0 }), V6 = on($l), ld = G({}, si, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), Jv = on(ld), zv = G({}, si, { clipboardData: function(D) {
    return "clipboardData" in D ? D.clipboardData : window.clipboardData;
  } }), Wc = on(zv), Sc = G({}, si, { data: 0 }), Gv = on(Sc), _d = {
    Esc: "Escape",
    Spacebar: " ",
    Left: "ArrowLeft",
    Up: "ArrowUp",
    Right: "ArrowRight",
    Down: "ArrowDown",
    Del: "Delete",
    Win: "OS",
    Menu: "ContextMenu",
    Apps: "ContextMenu",
    Scroll: "ScrollLock",
    MozPrintableKey: "Unidentified"
  }, eP = {
    8: "Backspace",
    9: "Tab",
    12: "Clear",
    13: "Enter",
    16: "Shift",
    17: "Control",
    18: "Alt",
    19: "Pause",
    20: "CapsLock",
    27: "Escape",
    32: " ",
    33: "PageUp",
    34: "PageDown",
    35: "End",
    36: "Home",
    37: "ArrowLeft",
    38: "ArrowUp",
    39: "ArrowRight",
    40: "ArrowDown",
    45: "Insert",
    46: "Delete",
    112: "F1",
    113: "F2",
    114: "F3",
    115: "F4",
    116: "F5",
    117: "F6",
    118: "F7",
    119: "F8",
    120: "F9",
    121: "F10",
    122: "F11",
    123: "F12",
    144: "NumLock",
    145: "ScrollLock",
    224: "Meta"
  }, J0 = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" };
  function Nu(D) {
    var B = this.nativeEvent;
    return B.getModifierState ? B.getModifierState(D) : (D = J0[D]) ? !!B[D] : !1;
  }
  function Uc() {
    return Nu;
  }
  var t1 = G({}, hs, { key: function(D) {
    if (D.key) {
      var B = _d[D.key] || D.key;
      if (B !== "Unidentified")
        return B;
    }
    return D.type === "keypress" ? (D = _t(D), D === 13 ? "Enter" : String.fromCharCode(D)) : D.type === "keydown" || D.type === "keyup" ? eP[D.keyCode] || "Unidentified" : "";
  }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: Uc, charCode: function(D) {
    return D.type === "keypress" ? _t(D) : 0;
  }, keyCode: function(D) {
    return D.type === "keydown" || D.type === "keyup" ? D.keyCode : 0;
  }, which: function(D) {
    return D.type === "keypress" ? _t(D) : D.type === "keydown" || D.type === "keyup" ? D.keyCode : 0;
  } }), Pd = on(t1), Z1 = G({}, cs, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), fA = on(Z1), tP = G({}, hs, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: Uc }), AA = on(tP), rP = G({}, si, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Qu = on(rP), Kf = G({}, cs, {
    deltaX: function(D) {
      return "deltaX" in D ? D.deltaX : "wheelDeltaX" in D ? -D.wheelDeltaX : 0;
    },
    deltaY: function(D) {
      return "deltaY" in D ? D.deltaY : "wheelDeltaY" in D ? -D.wheelDeltaY : "wheelDelta" in D ? -D.wheelDelta : 0;
    },
    deltaZ: 0,
    deltaMode: 0
  }), cd = on(Kf), Xo = [9, 13, 27, 32], C6 = a && "CompositionEvent" in window, Zv = null;
  a && "documentMode" in document && (Zv = document.documentMode);
  var nP = a && "TextEvent" in window && !Zv, mp = a && (!C6 || Zv && 8 < Zv && 11 >= Zv), $d = " ", z0 = !1;
  function Ic(D, B) {
    switch (D) {
      case "keyup":
        return Xo.indexOf(B.keyCode) !== -1;
      case "keydown":
        return B.keyCode !== 229;
      case "keypress":
      case "mousedown":
      case "focusout":
        return !0;
      default:
        return !1;
    }
  }
  function iP(D) {
    return D = D.detail, typeof D == "object" && "data" in D ? D.data : null;
  }
  var dA = !1;
  function Rc(D, B) {
    switch (D) {
      case "compositionend":
        return iP(B);
      case "keypress":
        return B.which !== 32 ? null : (z0 = !0, $d);
      case "textInput":
        return D = B.data, D === $d && z0 ? null : D;
      default:
        return null;
    }
  }
  function G0(D, B) {
    if (dA)
      return D === "compositionend" || !C6 && Ic(D, B) ? (D = kt(), dt = je = W1 = null, dA = !1, D) : null;
    switch (D) {
      case "paste":
        return null;
      case "keypress":
        if (!(B.ctrlKey || B.altKey || B.metaKey) || B.ctrlKey && B.altKey) {
          if (B.char && 1 < B.char.length)
            return B.char;
          if (B.which)
            return String.fromCharCode(B.which);
        }
        return null;
      case "compositionend":
        return mp && B.locale !== "ko" ? null : B.data;
      default:
        return null;
    }
  }
  var Vc = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0 };
  function Z0(D) {
    var B = D && D.nodeName && D.nodeName.toLowerCase();
    return B === "input" ? !!Vc[D.type] : B === "textarea";
  }
  function Cc(D, B, E, z) {
    Vn(z), B = Fc(B, "onChange"), 0 < B.length && (E = new ss("onChange", "change", null, E, z), D.push({ event: E, listeners: B }));
  }
  var sP = null, ev = null;
  function tv(D) {
    kc(D, 0);
  }
  function Yu(D) {
    var B = Qa(D);
    if (qe(B))
      return D;
  }
  function Bp(D, B) {
    if (D === "change")
      return B;
  }
  var Wp = !1;
  if (a) {
    var aP;
    if (a) {
      var Sp = "oninput" in document;
      if (!Sp) {
        var Up = document.createElement("div");
        Up.setAttribute("oninput", "return;"), Sp = typeof Up.oninput == "function";
      }
      aP = Sp;
    } else
      aP = !1;
    Wp = aP && (!document.documentMode || 9 < document.documentMode);
  }
  function Ip() {
    sP && (sP.detachEvent("onpropertychange", _0), ev = sP = null);
  }
  function _0(D) {
    if (D.propertyName === "value" && Yu(ev)) {
      var B = [];
      Cc(B, ev, D, rr(D)), is(tv, B);
    }
  }
  function gg(D, B, E) {
    D === "focusin" ? (Ip(), sP = B, ev = E, sP.attachEvent("onpropertychange", _0)) : D === "focusout" && Ip();
  }
  function $0(D) {
    if (D === "selectionchange" || D === "keyup" || D === "keydown")
      return Yu(ev);
  }
  function Rp(D, B) {
    if (D === "click")
      return Yu(B);
  }
  function rv(D, B) {
    if (D === "input" || D === "change")
      return Yu(B);
  }
  function Oc(D, B) {
    return D === B && (D !== 0 || 1 / D === 1 / B) || D !== D && B !== B;
  }
  var G9 = typeof Object.is == "function" ? Object.is : Oc;
  function yA(D, B) {
    if (G9(D, B))
      return !0;
    if (typeof D != "object" || D === null || typeof B != "object" || B === null)
      return !1;
    var E = Object.keys(D), z = Object.keys(B);
    if (E.length !== z.length)
      return !1;
    for (z = 0; z < E.length; z++) {
      var Ae = E[z];
      if (!f.call(B, Ae) || !G9(D[Ae], B[Ae]))
        return !1;
    }
    return !0;
  }
  function e7(D) {
    for (; D && D.firstChild; )
      D = D.firstChild;
    return D;
  }
  function Be(D, B) {
    var E = e7(D);
    D = 0;
    for (var z; E; ) {
      if (E.nodeType === 3) {
        if (z = D + E.textContent.length, D <= B && z >= B)
          return { node: E, offset: B - D };
        D = z;
      }
      e: {
        for (; E; ) {
          if (E.nextSibling) {
            E = E.nextSibling;
            break e;
          }
          E = E.parentNode;
        }
        E = void 0;
      }
      E = e7(E);
    }
  }
  function Qe(D, B) {
    return D && B ? D === B ? !0 : D && D.nodeType === 3 ? !1 : B && B.nodeType === 3 ? Qe(D, B.parentNode) : "contains" in D ? D.contains(B) : D.compareDocumentPosition ? !!(D.compareDocumentPosition(B) & 16) : !1 : !1;
  }
  function ze() {
    for (var D = window, B = ke(); B instanceof D.HTMLIFrameElement; ) {
      try {
        var E = typeof B.contentWindow.location.href == "string";
      } catch {
        E = !1;
      }
      if (E)
        D = B.contentWindow;
      else
        break;
      B = ke(D.document);
    }
    return B;
  }
  function rt(D) {
    var B = D && D.nodeName && D.nodeName.toLowerCase();
    return B && (B === "input" && (D.type === "text" || D.type === "search" || D.type === "tel" || D.type === "url" || D.type === "password") || B === "textarea" || D.contentEditable === "true");
  }
  function vt(D) {
    var B = ze(), E = D.focusedElem, z = D.selectionRange;
    if (B !== E && E && E.ownerDocument && Qe(E.ownerDocument.documentElement, E)) {
      if (z !== null && rt(E)) {
        if (B = z.start, D = z.end, D === void 0 && (D = B), "selectionStart" in E)
          E.selectionStart = B, E.selectionEnd = Math.min(D, E.value.length);
        else if (D = (B = E.ownerDocument || document) && B.defaultView || window, D.getSelection) {
          D = D.getSelection();
          var Ae = E.textContent.length, pe = Math.min(z.start, Ae);
          z = z.end === void 0 ? pe : Math.min(z.end, Ae), !D.extend && pe > z && (Ae = z, z = pe, pe = Ae), Ae = Be(E, pe);
          var Re = Be(
            E,
            z
          );
          Ae && Re && (D.rangeCount !== 1 || D.anchorNode !== Ae.node || D.anchorOffset !== Ae.offset || D.focusNode !== Re.node || D.focusOffset !== Re.offset) && (B = B.createRange(), B.setStart(Ae.node, Ae.offset), D.removeAllRanges(), pe > z ? (D.addRange(B), D.extend(Re.node, Re.offset)) : (B.setEnd(Re.node, Re.offset), D.addRange(B)));
        }
      }
      for (B = [], D = E; D = D.parentNode; )
        D.nodeType === 1 && B.push({ element: D, left: D.scrollLeft, top: D.scrollTop });
      for (typeof E.focus == "function" && E.focus(), E = 0; E < B.length; E++)
        D = B[E], D.element.scrollLeft = D.left, D.element.scrollTop = D.top;
    }
  }
  var yt = a && "documentMode" in document && 11 >= document.documentMode, Bt = null, ar = null, Pr = null, Sn = !1;
  function cn(D, B, E) {
    var z = E.window === E ? E.document : E.nodeType === 9 ? E : E.ownerDocument;
    Sn || Bt == null || Bt !== ke(z) || (z = Bt, "selectionStart" in z && rt(z) ? z = { start: z.selectionStart, end: z.selectionEnd } : (z = (z.ownerDocument && z.ownerDocument.defaultView || window).getSelection(), z = { anchorNode: z.anchorNode, anchorOffset: z.anchorOffset, focusNode: z.focusNode, focusOffset: z.focusOffset }), Pr && yA(Pr, z) || (Pr = z, z = Fc(ar, "onSelect"), 0 < z.length && (B = new ss("onSelect", "select", null, B, E), D.push({ event: B, listeners: z }), B.target = Bt)));
  }
  function Gn(D, B) {
    var E = {};
    return E[D.toLowerCase()] = B.toLowerCase(), E["Webkit" + D] = "webkit" + B, E["Moz" + D] = "moz" + B, E;
  }
  var es = { animationend: Gn("Animation", "AnimationEnd"), animationiteration: Gn("Animation", "AnimationIteration"), animationstart: Gn("Animation", "AnimationStart"), transitionend: Gn("Transition", "TransitionEnd") }, Ys = {}, S1 = {};
  a && (S1 = document.createElement("div").style, "AnimationEvent" in window || (delete es.animationend.animation, delete es.animationiteration.animation, delete es.animationstart.animation), "TransitionEvent" in window || delete es.transitionend.transition);
  function ia(D) {
    if (Ys[D])
      return Ys[D];
    if (!es[D])
      return D;
    var B = es[D], E;
    for (E in B)
      if (B.hasOwnProperty(E) && E in S1)
        return Ys[D] = B[E];
    return D;
  }
  var x9 = ia("animationend"), Jf = ia("animationiteration"), Vo = ia("animationstart"), U1 = ia("transitionend"), vA = /* @__PURE__ */ new Map(), Wf = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");
  function _1(D, B) {
    vA.set(D, B), i(B, [D]);
  }
  for (var $1 = 0; $1 < Wf.length; $1++) {
    var D9 = Wf[$1], kA = D9.toLowerCase(), oP = D9[0].toUpperCase() + D9.slice(1);
    _1(kA, "on" + oP);
  }
  _1(x9, "onAnimationEnd"), _1(Jf, "onAnimationIteration"), _1(Vo, "onAnimationStart"), _1("dblclick", "onDoubleClick"), _1("focusin", "onFocus"), _1("focusout", "onBlur"), _1(U1, "onTransitionEnd"), s("onMouseEnter", ["mouseout", "mouseover"]), s("onMouseLeave", ["mouseout", "mouseover"]), s("onPointerEnter", ["pointerout", "pointerover"]), s("onPointerLeave", ["pointerout", "pointerover"]), i("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")), i("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")), i("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), i("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")), i("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")), i("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" "));
  var yc = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), Bq = new Set("cancel close invalid load scroll toggle".split(" ").concat(yc));
  function Xg(D, B, E) {
    var z = D.type || "unknown-event";
    D.currentTarget = E, $e(z, B, void 0, D), D.currentTarget = null;
  }
  function kc(D, B) {
    B = (B & 4) !== 0;
    for (var E = 0; E < D.length; E++) {
      var z = D[E], Ae = z.event;
      z = z.listeners;
      e: {
        var pe = void 0;
        if (B)
          for (var Re = z.length - 1; 0 <= Re; Re--) {
            var ot = z[Re], lt = ot.instance, Jt = ot.currentTarget;
            if (ot = ot.listener, lt !== pe && Ae.isPropagationStopped())
              break e;
            Xg(Ae, ot, Jt), pe = lt;
          }
        else
          for (Re = 0; Re < z.length; Re++) {
            if (ot = z[Re], lt = ot.instance, Jt = ot.currentTarget, ot = ot.listener, lt !== pe && Ae.isPropagationStopped())
              break e;
            Xg(Ae, ot, Jt), pe = lt;
          }
      }
    }
    if (ds)
      throw D = it, ds = !1, it = null, D;
  }
  function Pa(D, B) {
    var E = B[Gu];
    E === void 0 && (E = B[Gu] = /* @__PURE__ */ new Set());
    var z = D + "__bubble";
    E.has(z) || (t7(B, D, 2, !1), E.add(z));
  }
  function nv(D, B, E) {
    var z = 0;
    B && (z |= 4), t7(E, D, z, B);
  }
  var iv = "_reactListening" + Math.random().toString(36).slice(2);
  function O6(D) {
    if (!D[iv]) {
      D[iv] = !0, r.forEach(function(E) {
        E !== "selectionchange" && (Bq.has(E) || nv(E, !1, D), nv(E, !0, D));
      });
      var B = D.nodeType === 9 ? D : D.ownerDocument;
      B === null || B[iv] || (B[iv] = !0, nv("selectionchange", !1, B));
    }
  }
  function t7(D, B, E, z) {
    switch (oA(B)) {
      case 1:
        var Ae = Gs;
        break;
      case 4:
        Ae = ks;
        break;
      default:
        Ae = Na;
    }
    E = Ae.bind(null, B, E, D), Ae = void 0, !_i || B !== "touchstart" && B !== "touchmove" && B !== "wheel" || (Ae = !0), z ? Ae !== void 0 ? D.addEventListener(B, E, { capture: !0, passive: Ae }) : D.addEventListener(B, E, !0) : Ae !== void 0 ? D.addEventListener(B, E, { passive: Ae }) : D.addEventListener(B, E, !1);
  }
  function Ec(D, B, E, z, Ae) {
    var pe = z;
    if (!(B & 1) && !(B & 2) && z !== null)
      e:
        for (; ; ) {
          if (z === null)
            return;
          var Re = z.tag;
          if (Re === 3 || Re === 4) {
            var ot = z.stateNode.containerInfo;
            if (ot === Ae || ot.nodeType === 8 && ot.parentNode === Ae)
              break;
            if (Re === 4)
              for (Re = z.return; Re !== null; ) {
                var lt = Re.tag;
                if ((lt === 3 || lt === 4) && (lt = Re.stateNode.containerInfo, lt === Ae || lt.nodeType === 8 && lt.parentNode === Ae))
                  return;
                Re = Re.return;
              }
            for (; ot !== null; ) {
              if (Re = Es(ot), Re === null)
                return;
              if (lt = Re.tag, lt === 5 || lt === 6) {
                z = pe = Re;
                continue e;
              }
              ot = ot.parentNode;
            }
          }
          z = z.return;
        }
    is(function() {
      var Jt = pe, Wr = rr(E), Xr = [];
      e: {
        var Dr = vA.get(D);
        if (Dr !== void 0) {
          var Tn = ss, In = D;
          switch (D) {
            case "keypress":
              if (_t(E) === 0)
                break e;
            case "keydown":
            case "keyup":
              Tn = Pd;
              break;
            case "focusin":
              In = "focus", Tn = V6;
              break;
            case "focusout":
              In = "blur", Tn = V6;
              break;
            case "beforeblur":
            case "afterblur":
              Tn = V6;
              break;
            case "click":
              if (E.button === 2)
                break e;
            case "auxclick":
            case "dblclick":
            case "mousedown":
            case "mousemove":
            case "mouseup":
            case "mouseout":
            case "mouseover":
            case "contextmenu":
              Tn = ud;
              break;
            case "drag":
            case "dragend":
            case "dragenter":
            case "dragexit":
            case "dragleave":
            case "dragover":
            case "dragstart":
            case "drop":
              Tn = Kv;
              break;
            case "touchcancel":
            case "touchend":
            case "touchmove":
            case "touchstart":
              Tn = AA;
              break;
            case x9:
            case Jf:
            case Vo:
              Tn = Jv;
              break;
            case U1:
              Tn = Qu;
              break;
            case "scroll":
              Tn = js;
              break;
            case "wheel":
              Tn = cd;
              break;
            case "copy":
            case "cut":
            case "paste":
              Tn = Wc;
              break;
            case "gotpointercapture":
            case "lostpointercapture":
            case "pointercancel":
            case "pointerdown":
            case "pointermove":
            case "pointerout":
            case "pointerover":
            case "pointerup":
              Tn = fA;
          }
          var Kn = (B & 4) !== 0, La = !Kn && D === "scroll", mt = Kn ? Dr !== null ? Dr + "Capture" : null : Dr;
          Kn = [];
          for (var pt = Jt, It; pt !== null; ) {
            It = pt;
            var Qr = It.stateNode;
            if (It.tag === 5 && Qr !== null && (It = Qr, mt !== null && (Qr = ji(pt, mt), Qr != null && Kn.push(Vp(pt, Qr, It)))), La)
              break;
            pt = pt.return;
          }
          0 < Kn.length && (Dr = new Tn(Dr, In, null, E, Wr), Xr.push({ event: Dr, listeners: Kn }));
        }
      }
      if (!(B & 7)) {
        e: {
          if (Dr = D === "mouseover" || D === "pointerover", Tn = D === "mouseout" || D === "pointerout", Dr && E !== Wn && (In = E.relatedTarget || E.fromElement) && (Es(In) || In[Sf]))
            break e;
          if ((Tn || Dr) && (Dr = Wr.window === Wr ? Wr : (Dr = Wr.ownerDocument) ? Dr.defaultView || Dr.parentWindow : window, Tn ? (In = E.relatedTarget || E.toElement, Tn = Jt, In = In ? Es(In) : null, In !== null && (La = Kt(In), In !== La || In.tag !== 5 && In.tag !== 6) && (In = null)) : (Tn = null, In = Jt), Tn !== In)) {
            if (Kn = ud, Qr = "onMouseLeave", mt = "onMouseEnter", pt = "mouse", (D === "pointerout" || D === "pointerover") && (Kn = fA, Qr = "onPointerLeave", mt = "onPointerEnter", pt = "pointer"), La = Tn == null ? Dr : Qa(Tn), It = In == null ? Dr : Qa(In), Dr = new Kn(Qr, pt + "leave", Tn, E, Wr), Dr.target = La, Dr.relatedTarget = It, Qr = null, Es(Wr) === Jt && (Kn = new Kn(mt, pt + "enter", In, E, Wr), Kn.target = It, Kn.relatedTarget = La, Qr = Kn), La = Qr, Tn && In)
              t: {
                for (Kn = Tn, mt = In, pt = 0, It = Kn; It; It = fP(It))
                  pt++;
                for (It = 0, Qr = mt; Qr; Qr = fP(Qr))
                  It++;
                for (; 0 < pt - It; )
                  Kn = fP(Kn), pt--;
                for (; 0 < It - pt; )
                  mt = fP(mt), It--;
                for (; pt--; ) {
                  if (Kn === mt || mt !== null && Kn === mt.alternate)
                    break t;
                  Kn = fP(Kn), mt = fP(mt);
                }
                Kn = null;
              }
            else
              Kn = null;
            Tn !== null && r7(Xr, Dr, Tn, Kn, !1), In !== null && La !== null && r7(Xr, La, In, Kn, !0);
          }
        }
        e: {
          if (Dr = Jt ? Qa(Jt) : window, Tn = Dr.nodeName && Dr.nodeName.toLowerCase(), Tn === "select" || Tn === "input" && Dr.type === "file")
            var Jn = Bp;
          else if (Z0(Dr))
            if (Wp)
              Jn = rv;
            else {
              Jn = $0;
              var On = gg;
            }
          else
            (Tn = Dr.nodeName) && Tn.toLowerCase() === "input" && (Dr.type === "checkbox" || Dr.type === "radio") && (Jn = Rp);
          if (Jn && (Jn = Jn(D, Jt))) {
            Cc(Xr, Jn, E, Wr);
            break e;
          }
          On && On(D, Dr, Jt), D === "focusout" && (On = Dr._wrapperState) && On.controlled && Dr.type === "number" && bt(Dr, "number", Dr.value);
        }
        switch (On = Jt ? Qa(Jt) : window, D) {
          case "focusin":
            (Z0(On) || On.contentEditable === "true") && (Bt = On, ar = Jt, Pr = null);
            break;
          case "focusout":
            Pr = ar = Bt = null;
            break;
          case "mousedown":
            Sn = !0;
            break;
          case "contextmenu":
          case "mouseup":
          case "dragend":
            Sn = !1, cn(Xr, E, Wr);
            break;
          case "selectionchange":
            if (yt)
              break;
          case "keydown":
          case "keyup":
            cn(Xr, E, Wr);
        }
        var vi;
        if (C6)
          e: {
            switch (D) {
              case "compositionstart":
                var Wi = "onCompositionStart";
                break e;
              case "compositionend":
                Wi = "onCompositionEnd";
                break e;
              case "compositionupdate":
                Wi = "onCompositionUpdate";
                break e;
            }
            Wi = void 0;
          }
        else
          dA ? Ic(D, E) && (Wi = "onCompositionEnd") : D === "keydown" && E.keyCode === 229 && (Wi = "onCompositionStart");
        Wi && (mp && E.locale !== "ko" && (dA || Wi !== "onCompositionStart" ? Wi === "onCompositionEnd" && dA && (vi = kt()) : (W1 = Wr, je = "value" in W1 ? W1.value : W1.textContent, dA = !0)), On = Fc(Jt, Wi), 0 < On.length && (Wi = new Gv(Wi, D, null, E, Wr), Xr.push({ event: Wi, listeners: On }), vi ? Wi.data = vi : (vi = iP(E), vi !== null && (Wi.data = vi)))), (vi = nP ? Rc(D, E) : G0(D, E)) && (Jt = Fc(Jt, "onBeforeInput"), 0 < Jt.length && (Wr = new Gv("onBeforeInput", "beforeinput", null, E, Wr), Xr.push({ event: Wr, listeners: Jt }), Wr.data = vi));
      }
      kc(Xr, B);
    });
  }
  function Vp(D, B, E) {
    return { instance: D, listener: B, currentTarget: E };
  }
  function Fc(D, B) {
    for (var E = B + "Capture", z = []; D !== null; ) {
      var Ae = D, pe = Ae.stateNode;
      Ae.tag === 5 && pe !== null && (Ae = pe, pe = ji(D, E), pe != null && z.unshift(Vp(D, pe, Ae)), pe = ji(D, B), pe != null && z.push(Vp(D, pe, Ae))), D = D.return;
    }
    return z;
  }
  function fP(D) {
    if (D === null)
      return null;
    do
      D = D.return;
    while (D && D.tag !== 5);
    return D || null;
  }
  function r7(D, B, E, z, Ae) {
    for (var pe = B._reactName, Re = []; E !== null && E !== z; ) {
      var ot = E, lt = ot.alternate, Jt = ot.stateNode;
      if (lt !== null && lt === z)
        break;
      ot.tag === 5 && Jt !== null && (ot = Jt, Ae ? (lt = ji(E, pe), lt != null && Re.unshift(Vp(E, lt, ot))) : Ae || (lt = ji(E, pe), lt != null && Re.push(Vp(E, lt, ot)))), E = E.return;
    }
    Re.length !== 0 && D.push({ event: B, listeners: Re });
  }
  var Tg = /\r\n?/g, Wq = /\u0000|\uFFFD/g;
  function qg(D) {
    return (typeof D == "string" ? D : "" + D).replace(Tg, `
`).replace(Wq, "");
  }
  function Mu(D, B, E) {
    if (B = qg(B), qg(D) !== B && E)
      throw Error(t(425));
  }
  function Nc() {
  }
  var Lu = null, Ku = null;
  function Qc(D, B) {
    return D === "textarea" || D === "noscript" || typeof B.children == "string" || typeof B.children == "number" || typeof B.dangerouslySetInnerHTML == "object" && B.dangerouslySetInnerHTML !== null && B.dangerouslySetInnerHTML.__html != null;
  }
  var sv = typeof setTimeout == "function" ? setTimeout : void 0, p4 = typeof clearTimeout == "function" ? clearTimeout : void 0, Ju = typeof Promise == "function" ? Promise : void 0, AP = typeof queueMicrotask == "function" ? queueMicrotask : typeof Ju < "u" ? function(D) {
    return Ju.resolve(null).then(D).catch(n7);
  } : sv;
  function n7(D) {
    setTimeout(function() {
      throw D;
    });
  }
  function av(D, B) {
    var E = B, z = 0;
    do {
      var Ae = E.nextSibling;
      if (D.removeChild(E), Ae && Ae.nodeType === 8)
        if (E = Ae.data, E === "/$") {
          if (z === 0) {
            D.removeChild(Ae), _n(B);
            return;
          }
          z--;
        } else
          E !== "$" && E !== "$?" && E !== "$!" || z++;
      E = Ae;
    } while (E);
    _n(B);
  }
  function pd(D) {
    for (; D != null; D = D.nextSibling) {
      var B = D.nodeType;
      if (B === 1 || B === 3)
        break;
      if (B === 8) {
        if (B = D.data, B === "$" || B === "$!" || B === "$?")
          break;
        if (B === "/$")
          return null;
      }
    }
    return D;
  }
  function Z9(D) {
    D = D.previousSibling;
    for (var B = 0; D; ) {
      if (D.nodeType === 8) {
        var E = D.data;
        if (E === "$" || E === "$!" || E === "$?") {
          if (B === 0)
            return D;
          B--;
        } else
          E === "/$" && B++;
      }
      D = D.previousSibling;
    }
    return null;
  }
  var zu = Math.random().toString(36).slice(2), EA = "__reactFiber$" + zu, _9 = "__reactProps$" + zu, Sf = "__reactContainer$" + zu, Gu = "__reactEvents$" + zu, Sq = "__reactListeners$" + zu, bg = "__reactHandles$" + zu;
  function Es(D) {
    var B = D[EA];
    if (B)
      return B;
    for (var E = D.parentNode; E; ) {
      if (B = E[Sf] || E[EA]) {
        if (E = B.alternate, B.child !== null || E !== null && E.child !== null)
          for (D = Z9(D); D !== null; ) {
            if (E = D[EA])
              return E;
            D = Z9(D);
          }
        return B;
      }
      D = E, E = D.parentNode;
    }
    return null;
  }
  function FA(D) {
    return D = D[EA] || D[Sf], !D || D.tag !== 5 && D.tag !== 6 && D.tag !== 13 && D.tag !== 3 ? null : D;
  }
  function Qa(D) {
    if (D.tag === 5 || D.tag === 6)
      return D.stateNode;
    throw Error(t(33));
  }
  function fn(D) {
    return D[_9] || null;
  }
  var Zu = [], Ms = -1;
  function Ni(D) {
    return { current: D };
  }
  function _s(D) {
    0 > Ms || (D.current = Zu[Ms], Zu[Ms] = null, Ms--);
  }
  function bi(D, B) {
    Ms++, Zu[Ms] = D.current, D.current = B;
  }
  var uA = {}, xi = Ni(uA), Ya = Ni(!1), Uf = uA;
  function I1(D, B) {
    var E = D.type.contextTypes;
    if (!E)
      return uA;
    var z = D.stateNode;
    if (z && z.__reactInternalMemoizedUnmaskedChildContext === B)
      return z.__reactInternalMemoizedMaskedChildContext;
    var Ae = {}, pe;
    for (pe in E)
      Ae[pe] = B[pe];
    return z && (D = D.stateNode, D.__reactInternalMemoizedUnmaskedChildContext = B, D.__reactInternalMemoizedMaskedChildContext = Ae), Ae;
  }
  function vo(D) {
    return D = D.childContextTypes, D != null;
  }
  function NA() {
    _s(Ya), _s(xi);
  }
  function _u(D, B, E) {
    if (xi.current !== uA)
      throw Error(t(168));
    bi(xi, B), bi(Ya, E);
  }
  function ov(D, B, E) {
    var z = D.stateNode;
    if (B = B.childContextTypes, typeof z.getChildContext != "function")
      return E;
    z = z.getChildContext();
    for (var Ae in z)
      if (!(Ae in B))
        throw Error(t(108, Xe(D) || "Unknown", Ae));
    return G({}, E, z);
  }
  function QA(D) {
    return D = (D = D.stateNode) && D.__reactInternalMemoizedMergedChildContext || uA, Uf = xi.current, bi(xi, D), bi(Ya, Ya.current), !0;
  }
  function dP(D, B, E) {
    var z = D.stateNode;
    if (!z)
      throw Error(t(169));
    E ? (D = ov(D, B, Uf), z.__reactInternalMemoizedMergedChildContext = D, _s(Ya), _s(xi), bi(xi, D)) : _s(Ya), bi(Ya, E);
  }
  var lA = null, To = !1, Yc = !1;
  function i7(D) {
    lA === null ? lA = [D] : lA.push(D);
  }
  function xg(D) {
    To = !0, i7(D);
  }
  function $9() {
    if (!Yc && lA !== null) {
      Yc = !0;
      var D = 0, B = Ts;
      try {
        var E = lA;
        for (Ts = 1; D < E.length; D++) {
          var z = E[D];
          do
            z = z(!0);
          while (z !== null);
        }
        lA = null, To = !1;
      } catch (Ae) {
        throw lA !== null && (lA = lA.slice(D + 1)), Cn(w1, $9), Ae;
      } finally {
        Ts = B, Yc = !1;
      }
    }
    return null;
  }
  var _v = [], e6 = 0, $u = null, Mc = 0, t6 = [], zf = 0, PA = null, ef = 1, $v = "";
  function r6(D, B) {
    _v[e6++] = Mc, _v[e6++] = $u, $u = D, Mc = B;
  }
  function Dg(D, B, E) {
    t6[zf++] = ef, t6[zf++] = $v, t6[zf++] = PA, PA = D;
    var z = ef;
    D = $v;
    var Ae = 32 - Ho(z) - 1;
    z &= ~(1 << Ae), E += 1;
    var pe = 32 - Ho(B) + Ae;
    if (30 < pe) {
      var Re = Ae - Ae % 5;
      pe = (z & (1 << Re) - 1).toString(32), z >>= Re, Ae -= Re, ef = 1 << 32 - Ho(B) + Ae | E << Ae | z, $v = pe + D;
    } else
      ef = 1 << pe | E << Ae | z, $v = D;
  }
  function Cp(D) {
    D.return !== null && (r6(D, 1), Dg(D, 1, 0));
  }
  function jg(D) {
    for (; D === $u; )
      $u = _v[--e6], _v[e6] = null, Mc = _v[--e6], _v[e6] = null;
    for (; D === PA; )
      PA = t6[--zf], t6[zf] = null, $v = t6[--zf], t6[zf] = null, ef = t6[--zf], t6[zf] = null;
  }
  var n6 = null, r1 = null, Us = !1, tf = null;
  function fv(D, B) {
    var E = N6(5, null, null, 0);
    E.elementType = "DELETED", E.stateNode = B, E.return = D, B = D.deletions, B === null ? (D.deletions = [E], D.flags |= 16) : B.push(E);
  }
  function Lc(D, B) {
    switch (D.tag) {
      case 5:
        var E = D.type;
        return B = B.nodeType !== 1 || E.toLowerCase() !== B.nodeName.toLowerCase() ? null : B, B !== null ? (D.stateNode = B, n6 = D, r1 = pd(B.firstChild), !0) : !1;
      case 6:
        return B = D.pendingProps === "" || B.nodeType !== 3 ? null : B, B !== null ? (D.stateNode = B, n6 = D, r1 = null, !0) : !1;
      case 13:
        return B = B.nodeType !== 8 ? null : B, B !== null ? (E = PA !== null ? { id: ef, overflow: $v } : null, D.memoizedState = { dehydrated: B, treeContext: E, retryLane: 1073741824 }, E = N6(18, null, null, 0), E.stateNode = B, E.return = D, D.child = E, n6 = D, r1 = null, !0) : !1;
      default:
        return !1;
    }
  }
  function el(D) {
    return (D.mode & 1) !== 0 && (D.flags & 128) === 0;
  }
  function eu(D) {
    if (Us) {
      var B = r1;
      if (B) {
        var E = B;
        if (!Lc(D, B)) {
          if (el(D))
            throw Error(t(418));
          B = pd(E.nextSibling);
          var z = n6;
          B && Lc(D, B) ? fv(z, E) : (D.flags = D.flags & -4097 | 2, Us = !1, n6 = D);
        }
      } else {
        if (el(D))
          throw Error(t(418));
        D.flags = D.flags & -4097 | 2, Us = !1, n6 = D;
      }
    }
  }
  function h4(D) {
    for (D = D.return; D !== null && D.tag !== 5 && D.tag !== 3 && D.tag !== 13; )
      D = D.return;
    n6 = D;
  }
  function s7(D) {
    if (D !== n6)
      return !1;
    if (!Us)
      return h4(D), Us = !0, !1;
    var B;
    if ((B = D.tag !== 3) && !(B = D.tag !== 5) && (B = D.type, B = B !== "head" && B !== "body" && !Qc(D.type, D.memoizedProps)), B && (B = r1)) {
      if (el(D))
        throw wg(), Error(t(418));
      for (; B; )
        fv(D, B), B = pd(B.nextSibling);
    }
    if (h4(D), D.tag === 13) {
      if (D = D.memoizedState, D = D !== null ? D.dehydrated : null, !D)
        throw Error(t(317));
      e: {
        for (D = D.nextSibling, B = 0; D; ) {
          if (D.nodeType === 8) {
            var E = D.data;
            if (E === "/$") {
              if (B === 0) {
                r1 = pd(D.nextSibling);
                break e;
              }
              B--;
            } else
              E !== "$" && E !== "$!" && E !== "$?" || B++;
          }
          D = D.nextSibling;
        }
        r1 = null;
      }
    } else
      r1 = n6 ? pd(D.stateNode.nextSibling) : null;
    return !0;
  }
  function wg() {
    for (var D = r1; D; )
      D = pd(D.nextSibling);
  }
  function qo() {
    r1 = n6 = null, Us = !1;
  }
  function a7(D) {
    tf === null ? tf = [D] : tf.push(D);
  }
  var Op = b.ReactCurrentBatchConfig;
  function Gf(D, B) {
    if (D && D.defaultProps) {
      B = G({}, B), D = D.defaultProps;
      for (var E in D)
        B[E] === void 0 && (B[E] = D[E]);
      return B;
    }
    return B;
  }
  var Av = Ni(null), o7 = null, hd = null, f7 = null;
  function mg() {
    f7 = hd = o7 = null;
  }
  function YA(D) {
    var B = Av.current;
    _s(Av), D._currentValue = B;
  }
  function n1(D, B, E) {
    for (; D !== null; ) {
      var z = D.alternate;
      if ((D.childLanes & B) !== B ? (D.childLanes |= B, z !== null && (z.childLanes |= B)) : z !== null && (z.childLanes & B) !== B && (z.childLanes |= B), D === E)
        break;
      D = D.return;
    }
  }
  function dn(D, B) {
    o7 = D, f7 = hd = null, D = D.dependencies, D !== null && D.firstContext !== null && (D.lanes & B && (C1 = !0), D.firstContext = null);
  }
  function i1(D) {
    var B = D._currentValue;
    if (f7 !== D)
      if (D = { context: D, memoizedValue: B, next: null }, hd === null) {
        if (o7 === null)
          throw Error(t(308));
        hd = D, o7.dependencies = { lanes: 0, firstContext: D };
      } else
        hd = hd.next = D;
    return B;
  }
  var rf = null;
  function Kc(D) {
    rf === null ? rf = [D] : rf.push(D);
  }
  function vP(D, B, E, z) {
    var Ae = B.interleaved;
    return Ae === null ? (E.next = E, Kc(B)) : (E.next = Ae.next, Ae.next = E), B.interleaved = E, MA(D, z);
  }
  function MA(D, B) {
    D.lanes |= B;
    var E = D.alternate;
    for (E !== null && (E.lanes |= B), E = D, D = D.return; D !== null; )
      D.childLanes |= B, E = D.alternate, E !== null && (E.childLanes |= B), E = D, D = D.return;
    return E.tag === 3 ? E.stateNode : null;
  }
  var tu = !1;
  function uP(D) {
    D.updateQueue = { baseState: D.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null };
  }
  function R1(D, B) {
    D = D.updateQueue, B.updateQueue === D && (B.updateQueue = { baseState: D.baseState, firstBaseUpdate: D.firstBaseUpdate, lastBaseUpdate: D.lastBaseUpdate, shared: D.shared, effects: D.effects });
  }
  function dv(D, B) {
    return { eventTime: D, lane: B, tag: 0, payload: null, callback: null, next: null };
  }
  function ru(D, B, E) {
    var z = D.updateQueue;
    if (z === null)
      return null;
    if (z = z.shared, bs & 2) {
      var Ae = z.pending;
      return Ae === null ? B.next = B : (B.next = Ae.next, Ae.next = B), z.pending = B, MA(D, E);
    }
    return Ae = z.interleaved, Ae === null ? (B.next = B, Kc(z)) : (B.next = Ae.next, Ae.next = B), z.interleaved = B, MA(D, E);
  }
  function yp(D, B, E) {
    if (B = B.updateQueue, B !== null && (B = B.shared, (E & 4194240) !== 0)) {
      var z = B.lanes;
      z &= D.pendingLanes, E |= z, B.lanes = E, Zr(D, E);
    }
  }
  function A7(D, B) {
    var E = D.updateQueue, z = D.alternate;
    if (z !== null && (z = z.updateQueue, E === z)) {
      var Ae = null, pe = null;
      if (E = E.firstBaseUpdate, E !== null) {
        do {
          var Re = { eventTime: E.eventTime, lane: E.lane, tag: E.tag, payload: E.payload, callback: E.callback, next: null };
          pe === null ? Ae = pe = Re : pe = pe.next = Re, E = E.next;
        } while (E !== null);
        pe === null ? Ae = pe = B : pe = pe.next = B;
      } else
        Ae = pe = B;
      E = { baseState: z.baseState, firstBaseUpdate: Ae, lastBaseUpdate: pe, shared: z.shared, effects: z.effects }, D.updateQueue = E;
      return;
    }
    D = E.lastBaseUpdate, D === null ? E.firstBaseUpdate = B : D.next = B, E.lastBaseUpdate = B;
  }
  function vv(D, B, E, z) {
    var Ae = D.updateQueue;
    tu = !1;
    var pe = Ae.firstBaseUpdate, Re = Ae.lastBaseUpdate, ot = Ae.shared.pending;
    if (ot !== null) {
      Ae.shared.pending = null;
      var lt = ot, Jt = lt.next;
      lt.next = null, Re === null ? pe = Jt : Re.next = Jt, Re = lt;
      var Wr = D.alternate;
      Wr !== null && (Wr = Wr.updateQueue, ot = Wr.lastBaseUpdate, ot !== Re && (ot === null ? Wr.firstBaseUpdate = Jt : ot.next = Jt, Wr.lastBaseUpdate = lt));
    }
    if (pe !== null) {
      var Xr = Ae.baseState;
      Re = 0, Wr = Jt = lt = null, ot = pe;
      do {
        var Dr = ot.lane, Tn = ot.eventTime;
        if ((z & Dr) === Dr) {
          Wr !== null && (Wr = Wr.next = {
            eventTime: Tn,
            lane: 0,
            tag: ot.tag,
            payload: ot.payload,
            callback: ot.callback,
            next: null
          });
          e: {
            var In = D, Kn = ot;
            switch (Dr = B, Tn = E, Kn.tag) {
              case 1:
                if (In = Kn.payload, typeof In == "function") {
                  Xr = In.call(Tn, Xr, Dr);
                  break e;
                }
                Xr = In;
                break e;
              case 3:
                In.flags = In.flags & -65537 | 128;
              case 0:
                if (In = Kn.payload, Dr = typeof In == "function" ? In.call(Tn, Xr, Dr) : In, Dr == null)
                  break e;
                Xr = G({}, Xr, Dr);
                break e;
              case 2:
                tu = !0;
            }
          }
          ot.callback !== null && ot.lane !== 0 && (D.flags |= 64, Dr = Ae.effects, Dr === null ? Ae.effects = [ot] : Dr.push(ot));
        } else
          Tn = { eventTime: Tn, lane: Dr, tag: ot.tag, payload: ot.payload, callback: ot.callback, next: null }, Wr === null ? (Jt = Wr = Tn, lt = Xr) : Wr = Wr.next = Tn, Re |= Dr;
        if (ot = ot.next, ot === null) {
          if (ot = Ae.shared.pending, ot === null)
            break;
          Dr = ot, ot = Dr.next, Dr.next = null, Ae.lastBaseUpdate = Dr, Ae.shared.pending = null;
        }
      } while (!0);
      if (Wr === null && (lt = Xr), Ae.baseState = lt, Ae.firstBaseUpdate = Jt, Ae.lastBaseUpdate = Wr, B = Ae.shared.interleaved, B !== null) {
        Ae = B;
        do
          Re |= Ae.lane, Ae = Ae.next;
        while (Ae !== B);
      } else
        pe === null && (Ae.shared.lanes = 0);
      pv |= Re, D.lanes = Re, D.memoizedState = Xr;
    }
  }
  function lP(D, B, E) {
    if (D = B.effects, B.effects = null, D !== null)
      for (B = 0; B < D.length; B++) {
        var z = D[B], Ae = z.callback;
        if (Ae !== null) {
          if (z.callback = null, z = E, typeof Ae != "function")
            throw Error(t(191, Ae));
          Ae.call(z);
        }
      }
  }
  var H4 = new A.Component().refs;
  function Bg(D, B, E, z) {
    B = D.memoizedState, E = E(z, B), E = E == null ? B : G({}, B, E), D.memoizedState = E, D.lanes === 0 && (D.updateQueue.baseState = E);
  }
  var d7 = { isMounted: function(D) {
    return (D = D._reactInternals) ? Kt(D) === D : !1;
  }, enqueueSetState: function(D, B, E) {
    D = D._reactInternals;
    var z = w9(), Ae = y1(D), pe = dv(z, Ae);
    pe.payload = B, E != null && (pe.callback = E), B = ru(D, pe, Ae), B !== null && (If(B, D, Ae, z), yp(B, D, Ae));
  }, enqueueReplaceState: function(D, B, E) {
    D = D._reactInternals;
    var z = w9(), Ae = y1(D), pe = dv(z, Ae);
    pe.tag = 1, pe.payload = B, E != null && (pe.callback = E), B = ru(D, pe, Ae), B !== null && (If(B, D, Ae, z), yp(B, D, Ae));
  }, enqueueForceUpdate: function(D, B) {
    D = D._reactInternals;
    var E = w9(), z = y1(D), Ae = dv(E, z);
    Ae.tag = 2, B != null && (Ae.callback = B), B = ru(D, Ae, z), B !== null && (If(B, D, z, E), yp(B, D, z));
  } };
  function v7(D, B, E, z, Ae, pe, Re) {
    return D = D.stateNode, typeof D.shouldComponentUpdate == "function" ? D.shouldComponentUpdate(z, pe, Re) : B.prototype && B.prototype.isPureReactComponent ? !yA(E, z) || !yA(Ae, pe) : !0;
  }
  function Wg(D, B, E) {
    var z = !1, Ae = uA, pe = B.contextType;
    return typeof pe == "object" && pe !== null ? pe = i1(pe) : (Ae = vo(B) ? Uf : xi.current, z = B.contextTypes, pe = (z = z != null) ? I1(D, Ae) : uA), B = new B(E, pe), D.memoizedState = B.state !== null && B.state !== void 0 ? B.state : null, B.updater = d7, D.stateNode = B, B._reactInternals = D, z && (D = D.stateNode, D.__reactInternalMemoizedUnmaskedChildContext = Ae, D.__reactInternalMemoizedMaskedChildContext = pe), B;
  }
  function g4(D, B, E, z) {
    D = B.state, typeof B.componentWillReceiveProps == "function" && B.componentWillReceiveProps(E, z), typeof B.UNSAFE_componentWillReceiveProps == "function" && B.UNSAFE_componentWillReceiveProps(E, z), B.state !== D && d7.enqueueReplaceState(B, B.state, null);
  }
  function kp(D, B, E, z) {
    var Ae = D.stateNode;
    Ae.props = E, Ae.state = D.memoizedState, Ae.refs = H4, uP(D);
    var pe = B.contextType;
    typeof pe == "object" && pe !== null ? Ae.context = i1(pe) : (pe = vo(B) ? Uf : xi.current, Ae.context = I1(D, pe)), Ae.state = D.memoizedState, pe = B.getDerivedStateFromProps, typeof pe == "function" && (Bg(D, B, pe, E), Ae.state = D.memoizedState), typeof B.getDerivedStateFromProps == "function" || typeof Ae.getSnapshotBeforeUpdate == "function" || typeof Ae.UNSAFE_componentWillMount != "function" && typeof Ae.componentWillMount != "function" || (B = Ae.state, typeof Ae.componentWillMount == "function" && Ae.componentWillMount(), typeof Ae.UNSAFE_componentWillMount == "function" && Ae.UNSAFE_componentWillMount(), B !== Ae.state && d7.enqueueReplaceState(Ae, Ae.state, null), vv(D, E, Ae, z), Ae.state = D.memoizedState), typeof Ae.componentDidMount == "function" && (D.flags |= 4194308);
  }
  function Jc(D, B, E) {
    if (D = E.ref, D !== null && typeof D != "function" && typeof D != "object") {
      if (E._owner) {
        if (E = E._owner, E) {
          if (E.tag !== 1)
            throw Error(t(309));
          var z = E.stateNode;
        }
        if (!z)
          throw Error(t(147, D));
        var Ae = z, pe = "" + D;
        return B !== null && B.ref !== null && typeof B.ref == "function" && B.ref._stringRef === pe ? B.ref : (B = function(Re) {
          var ot = Ae.refs;
          ot === H4 && (ot = Ae.refs = {}), Re === null ? delete ot[pe] : ot[pe] = Re;
        }, B._stringRef = pe, B);
      }
      if (typeof D != "string")
        throw Error(t(284));
      if (!E._owner)
        throw Error(t(290, D));
    }
    return D;
  }
  function Ep(D, B) {
    throw D = Object.prototype.toString.call(B), Error(t(31, D === "[object Object]" ? "object with keys {" + Object.keys(B).join(", ") + "}" : D));
  }
  function Sg(D) {
    var B = D._init;
    return B(D._payload);
  }
  function Ug(D) {
    function B(mt, pt) {
      if (D) {
        var It = mt.deletions;
        It === null ? (mt.deletions = [pt], mt.flags |= 16) : It.push(pt);
      }
    }
    function E(mt, pt) {
      if (!D)
        return null;
      for (; pt !== null; )
        B(mt, pt), pt = pt.sibling;
      return null;
    }
    function z(mt, pt) {
      for (mt = /* @__PURE__ */ new Map(); pt !== null; )
        pt.key !== null ? mt.set(pt.key, pt) : mt.set(pt.index, pt), pt = pt.sibling;
      return mt;
    }
    function Ae(mt, pt) {
      return mt = cu(mt, pt), mt.index = 0, mt.sibling = null, mt;
    }
    function pe(mt, pt, It) {
      return mt.index = It, D ? (It = mt.alternate, It !== null ? (It = It.index, It < pt ? (mt.flags |= 2, pt) : It) : (mt.flags |= 2, pt)) : (mt.flags |= 1048576, pt);
    }
    function Re(mt) {
      return D && mt.alternate === null && (mt.flags |= 2), mt;
    }
    function ot(mt, pt, It, Qr) {
      return pt === null || pt.tag !== 6 ? (pt = vh(It, mt.mode, Qr), pt.return = mt, pt) : (pt = Ae(pt, It), pt.return = mt, pt);
    }
    function lt(mt, pt, It, Qr) {
      var Jn = It.type;
      return Jn === m ? Wr(mt, pt, It.props.children, Qr, It.key) : pt !== null && (pt.elementType === Jn || typeof Jn == "object" && Jn !== null && Jn.$$typeof === Z && Sg(Jn) === pt.type) ? (Qr = Ae(pt, It.props), Qr.ref = Jc(mt, pt, It), Qr.return = mt, Qr) : (Qr = H3(It.type, It.key, It.props, null, mt.mode, Qr), Qr.ref = Jc(mt, pt, It), Qr.return = mt, Qr);
    }
    function Jt(mt, pt, It, Qr) {
      return pt === null || pt.tag !== 4 || pt.stateNode.containerInfo !== It.containerInfo || pt.stateNode.implementation !== It.implementation ? (pt = jP(It, mt.mode, Qr), pt.return = mt, pt) : (pt = Ae(pt, It.children || []), pt.return = mt, pt);
    }
    function Wr(mt, pt, It, Qr, Jn) {
      return pt === null || pt.tag !== 7 ? (pt = DP(It, mt.mode, Qr, Jn), pt.return = mt, pt) : (pt = Ae(pt, It), pt.return = mt, pt);
    }
    function Xr(mt, pt, It) {
      if (typeof pt == "string" && pt !== "" || typeof pt == "number")
        return pt = vh("" + pt, mt.mode, It), pt.return = mt, pt;
      if (typeof pt == "object" && pt !== null) {
        switch (pt.$$typeof) {
          case j:
            return It = H3(pt.type, pt.key, pt.props, null, mt.mode, It), It.ref = Jc(mt, null, pt), It.return = mt, It;
          case w:
            return pt = jP(pt, mt.mode, It), pt.return = mt, pt;
          case Z:
            var Qr = pt._init;
            return Xr(mt, Qr(pt._payload), It);
        }
        if (wt(pt) || _(pt))
          return pt = DP(pt, mt.mode, It, null), pt.return = mt, pt;
        Ep(mt, pt);
      }
      return null;
    }
    function Dr(mt, pt, It, Qr) {
      var Jn = pt !== null ? pt.key : null;
      if (typeof It == "string" && It !== "" || typeof It == "number")
        return Jn !== null ? null : ot(mt, pt, "" + It, Qr);
      if (typeof It == "object" && It !== null) {
        switch (It.$$typeof) {
          case j:
            return It.key === Jn ? lt(mt, pt, It, Qr) : null;
          case w:
            return It.key === Jn ? Jt(mt, pt, It, Qr) : null;
          case Z:
            return Jn = It._init, Dr(
              mt,
              pt,
              Jn(It._payload),
              Qr
            );
        }
        if (wt(It) || _(It))
          return Jn !== null ? null : Wr(mt, pt, It, Qr, null);
        Ep(mt, It);
      }
      return null;
    }
    function Tn(mt, pt, It, Qr, Jn) {
      if (typeof Qr == "string" && Qr !== "" || typeof Qr == "number")
        return mt = mt.get(It) || null, ot(pt, mt, "" + Qr, Jn);
      if (typeof Qr == "object" && Qr !== null) {
        switch (Qr.$$typeof) {
          case j:
            return mt = mt.get(Qr.key === null ? It : Qr.key) || null, lt(pt, mt, Qr, Jn);
          case w:
            return mt = mt.get(Qr.key === null ? It : Qr.key) || null, Jt(pt, mt, Qr, Jn);
          case Z:
            var On = Qr._init;
            return Tn(mt, pt, It, On(Qr._payload), Jn);
        }
        if (wt(Qr) || _(Qr))
          return mt = mt.get(It) || null, Wr(pt, mt, Qr, Jn, null);
        Ep(pt, Qr);
      }
      return null;
    }
    function In(mt, pt, It, Qr) {
      for (var Jn = null, On = null, vi = pt, Wi = pt = 0, Af = null; vi !== null && Wi < It.length; Wi++) {
        vi.index > Wi ? (Af = vi, vi = null) : Af = vi.sibling;
        var xs = Dr(mt, vi, It[Wi], Qr);
        if (xs === null) {
          vi === null && (vi = Af);
          break;
        }
        D && vi && xs.alternate === null && B(mt, vi), pt = pe(xs, pt, Wi), On === null ? Jn = xs : On.sibling = xs, On = xs, vi = Af;
      }
      if (Wi === It.length)
        return E(mt, vi), Us && r6(mt, Wi), Jn;
      if (vi === null) {
        for (; Wi < It.length; Wi++)
          vi = Xr(mt, It[Wi], Qr), vi !== null && (pt = pe(vi, pt, Wi), On === null ? Jn = vi : On.sibling = vi, On = vi);
        return Us && r6(mt, Wi), Jn;
      }
      for (vi = z(mt, vi); Wi < It.length; Wi++)
        Af = Tn(vi, mt, Wi, It[Wi], Qr), Af !== null && (D && Af.alternate !== null && vi.delete(Af.key === null ? Wi : Af.key), pt = pe(Af, pt, Wi), On === null ? Jn = Af : On.sibling = Af, On = Af);
      return D && vi.forEach(function(pu) {
        return B(mt, pu);
      }), Us && r6(mt, Wi), Jn;
    }
    function Kn(mt, pt, It, Qr) {
      var Jn = _(It);
      if (typeof Jn != "function")
        throw Error(t(150));
      if (It = Jn.call(It), It == null)
        throw Error(t(151));
      for (var On = Jn = null, vi = pt, Wi = pt = 0, Af = null, xs = It.next(); vi !== null && !xs.done; Wi++, xs = It.next()) {
        vi.index > Wi ? (Af = vi, vi = null) : Af = vi.sibling;
        var pu = Dr(mt, vi, xs.value, Qr);
        if (pu === null) {
          vi === null && (vi = Af);
          break;
        }
        D && vi && pu.alternate === null && B(mt, vi), pt = pe(pu, pt, Wi), On === null ? Jn = pu : On.sibling = pu, On = pu, vi = Af;
      }
      if (xs.done)
        return E(
          mt,
          vi
        ), Us && r6(mt, Wi), Jn;
      if (vi === null) {
        for (; !xs.done; Wi++, xs = It.next())
          xs = Xr(mt, xs.value, Qr), xs !== null && (pt = pe(xs, pt, Wi), On === null ? Jn = xs : On.sibling = xs, On = xs);
        return Us && r6(mt, Wi), Jn;
      }
      for (vi = z(mt, vi); !xs.done; Wi++, xs = It.next())
        xs = Tn(vi, mt, Wi, xs.value, Qr), xs !== null && (D && xs.alternate !== null && vi.delete(xs.key === null ? Wi : xs.key), pt = pe(xs, pt, Wi), On === null ? Jn = xs : On.sibling = xs, On = xs);
      return D && vi.forEach(function(ch) {
        return B(mt, ch);
      }), Us && r6(mt, Wi), Jn;
    }
    function La(mt, pt, It, Qr) {
      if (typeof It == "object" && It !== null && It.type === m && It.key === null && (It = It.props.children), typeof It == "object" && It !== null) {
        switch (It.$$typeof) {
          case j:
            e: {
              for (var Jn = It.key, On = pt; On !== null; ) {
                if (On.key === Jn) {
                  if (Jn = It.type, Jn === m) {
                    if (On.tag === 7) {
                      E(mt, On.sibling), pt = Ae(On, It.props.children), pt.return = mt, mt = pt;
                      break e;
                    }
                  } else if (On.elementType === Jn || typeof Jn == "object" && Jn !== null && Jn.$$typeof === Z && Sg(Jn) === On.type) {
                    E(mt, On.sibling), pt = Ae(On, It.props), pt.ref = Jc(mt, On, It), pt.return = mt, mt = pt;
                    break e;
                  }
                  E(mt, On);
                  break;
                } else
                  B(mt, On);
                On = On.sibling;
              }
              It.type === m ? (pt = DP(It.props.children, mt.mode, Qr, It.key), pt.return = mt, mt = pt) : (Qr = H3(It.type, It.key, It.props, null, mt.mode, Qr), Qr.ref = Jc(mt, pt, It), Qr.return = mt, mt = Qr);
            }
            return Re(mt);
          case w:
            e: {
              for (On = It.key; pt !== null; ) {
                if (pt.key === On)
                  if (pt.tag === 4 && pt.stateNode.containerInfo === It.containerInfo && pt.stateNode.implementation === It.implementation) {
                    E(mt, pt.sibling), pt = Ae(pt, It.children || []), pt.return = mt, mt = pt;
                    break e;
                  } else {
                    E(mt, pt);
                    break;
                  }
                else
                  B(mt, pt);
                pt = pt.sibling;
              }
              pt = jP(It, mt.mode, Qr), pt.return = mt, mt = pt;
            }
            return Re(mt);
          case Z:
            return On = It._init, La(mt, pt, On(It._payload), Qr);
        }
        if (wt(It))
          return In(mt, pt, It, Qr);
        if (_(It))
          return Kn(mt, pt, It, Qr);
        Ep(mt, It);
      }
      return typeof It == "string" && It !== "" || typeof It == "number" ? (It = "" + It, pt !== null && pt.tag === 6 ? (E(mt, pt.sibling), pt = Ae(pt, It), pt.return = mt, mt = pt) : (E(mt, pt), pt = vh(It, mt.mode, Qr), pt.return = mt, mt = pt), Re(mt)) : E(mt, pt);
    }
    return La;
  }
  var zc = Ug(!0), Gc = Ug(!1), Fp = {}, j9 = Ni(Fp), tl = Ni(Fp), rl = Ni(Fp);
  function uv(D) {
    if (D === Fp)
      throw Error(t(174));
    return D;
  }
  function u7(D, B) {
    switch (bi(rl, B), bi(tl, D), bi(j9, Fp), D = B.nodeType, D) {
      case 9:
      case 11:
        B = (B = B.documentElement) ? B.namespaceURI : qr(null, "");
        break;
      default:
        D = D === 8 ? B.parentNode : B, B = D.namespaceURI || null, D = D.tagName, B = qr(B, D);
    }
    _s(j9), bi(j9, B);
  }
  function y6() {
    _s(j9), _s(tl), _s(rl);
  }
  function Di(D) {
    uv(rl.current);
    var B = uv(j9.current), E = qr(B, D.type);
    B !== E && (bi(tl, D), bi(j9, E));
  }
  function Ki(D) {
    tl.current === D && (_s(j9), _s(tl));
  }
  var wi = Ni(0);
  function Za(D) {
    for (var B = D; B !== null; ) {
      if (B.tag === 13) {
        var E = B.memoizedState;
        if (E !== null && (E = E.dehydrated, E === null || E.data === "$?" || E.data === "$!"))
          return B;
      } else if (B.tag === 19 && B.memoizedProps.revealOrder !== void 0) {
        if (B.flags & 128)
          return B;
      } else if (B.child !== null) {
        B.child.return = B, B = B.child;
        continue;
      }
      if (B === D)
        break;
      for (; B.sibling === null; ) {
        if (B.return === null || B.return === D)
          return null;
        B = B.return;
      }
      B.sibling.return = B.return, B = B.sibling;
    }
    return null;
  }
  var k6 = [];
  function Zc() {
    for (var D = 0; D < k6.length; D++)
      k6[D]._workInProgressVersionPrimary = null;
    k6.length = 0;
  }
  var Np = b.ReactCurrentDispatcher, _c = b.ReactCurrentBatchConfig, nu = 0, sa = null, Ar = null, Zt = null, Ln = !1, qs = !1, Zf = 0, iu = 0;
  function Ra() {
    throw Error(t(321));
  }
  function nl(D, B) {
    if (B === null)
      return !1;
    for (var E = 0; E < B.length && E < D.length; E++)
      if (!G9(D[E], B[E]))
        return !1;
    return !0;
  }
  function su(D, B, E, z, Ae, pe) {
    if (nu = pe, sa = B, B.memoizedState = null, B.updateQueue = null, B.lanes = 0, Np.current = D === null || D.memoizedState === null ? pP : ca, D = E(z, Ae), qs) {
      pe = 0;
      do {
        if (qs = !1, Zf = 0, 25 <= pe)
          throw Error(t(301));
        pe += 1, Zt = Ar = null, B.updateQueue = null, Np.current = hP, D = E(z, Ae);
      } while (qs);
    }
    if (Np.current = nf, B = Ar !== null && Ar.next !== null, nu = 0, Zt = Ar = sa = null, Ln = !1, B)
      throw Error(t(300));
    return D;
  }
  function il() {
    var D = Zf !== 0;
    return Zf = 0, D;
  }
  function E6() {
    var D = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null };
    return Zt === null ? sa.memoizedState = Zt = D : Zt = Zt.next = D, Zt;
  }
  function i6() {
    if (Ar === null) {
      var D = sa.alternate;
      D = D !== null ? D.memoizedState : null;
    } else
      D = Ar.next;
    var B = Zt === null ? sa.memoizedState : Zt.next;
    if (B !== null)
      Zt = B, Ar = D;
    else {
      if (D === null)
        throw Error(t(310));
      Ar = D, D = { memoizedState: Ar.memoizedState, baseState: Ar.baseState, baseQueue: Ar.baseQueue, queue: Ar.queue, next: null }, Zt === null ? sa.memoizedState = Zt = D : Zt = Zt.next = D;
    }
    return Zt;
  }
  function LA(D, B) {
    return typeof B == "function" ? B(D) : B;
  }
  function au(D) {
    var B = i6(), E = B.queue;
    if (E === null)
      throw Error(t(311));
    E.lastRenderedReducer = D;
    var z = Ar, Ae = z.baseQueue, pe = E.pending;
    if (pe !== null) {
      if (Ae !== null) {
        var Re = Ae.next;
        Ae.next = pe.next, pe.next = Re;
      }
      z.baseQueue = Ae = pe, E.pending = null;
    }
    if (Ae !== null) {
      pe = Ae.next, z = z.baseState;
      var ot = Re = null, lt = null, Jt = pe;
      do {
        var Wr = Jt.lane;
        if ((nu & Wr) === Wr)
          lt !== null && (lt = lt.next = { lane: 0, action: Jt.action, hasEagerState: Jt.hasEagerState, eagerState: Jt.eagerState, next: null }), z = Jt.hasEagerState ? Jt.eagerState : D(z, Jt.action);
        else {
          var Xr = {
            lane: Wr,
            action: Jt.action,
            hasEagerState: Jt.hasEagerState,
            eagerState: Jt.eagerState,
            next: null
          };
          lt === null ? (ot = lt = Xr, Re = z) : lt = lt.next = Xr, sa.lanes |= Wr, pv |= Wr;
        }
        Jt = Jt.next;
      } while (Jt !== null && Jt !== pe);
      lt === null ? Re = z : lt.next = ot, G9(z, B.memoizedState) || (C1 = !0), B.memoizedState = z, B.baseState = Re, B.baseQueue = lt, E.lastRenderedState = z;
    }
    if (D = E.interleaved, D !== null) {
      Ae = D;
      do
        pe = Ae.lane, sa.lanes |= pe, pv |= pe, Ae = Ae.next;
      while (Ae !== D);
    } else
      Ae === null && (E.lanes = 0);
    return [B.memoizedState, E.dispatch];
  }
  function lv(D) {
    var B = i6(), E = B.queue;
    if (E === null)
      throw Error(t(311));
    E.lastRenderedReducer = D;
    var z = E.dispatch, Ae = E.pending, pe = B.memoizedState;
    if (Ae !== null) {
      E.pending = null;
      var Re = Ae = Ae.next;
      do
        pe = D(pe, Re.action), Re = Re.next;
      while (Re !== Ae);
      G9(pe, B.memoizedState) || (C1 = !0), B.memoizedState = pe, B.baseQueue === null && (B.baseState = pe), E.lastRenderedState = pe;
    }
    return [pe, z];
  }
  function $c() {
  }
  function Qp(D, B) {
    var E = sa, z = i6(), Ae = B(), pe = !G9(z.memoizedState, Ae);
    if (pe && (z.memoizedState = Ae, C1 = !0), z = z.queue, Mp(cA.bind(null, E, z, D), [D]), z.getSnapshot !== B || pe || Zt !== null && Zt.memoizedState.tag & 1) {
      if (E.flags |= 2048, KA(9, t3.bind(null, E, z, Ae, B), void 0, null), Oo === null)
        throw Error(t(349));
      nu & 30 || e3(E, B, Ae);
    }
    return Ae;
  }
  function e3(D, B, E) {
    D.flags |= 16384, D = { getSnapshot: B, value: E }, B = sa.updateQueue, B === null ? (B = { lastEffect: null, stores: null }, sa.updateQueue = B, B.stores = [D]) : (E = B.stores, E === null ? B.stores = [D] : E.push(D));
  }
  function t3(D, B, E, z) {
    B.value = E, B.getSnapshot = z, _a(B) && Ig(D);
  }
  function cA(D, B, E) {
    return E(function() {
      _a(B) && Ig(D);
    });
  }
  function _a(D) {
    var B = D.getSnapshot;
    D = D.value;
    try {
      var E = B();
      return !G9(D, E);
    } catch {
      return !0;
    }
  }
  function Ig(D) {
    var B = MA(D, 1);
    B !== null && If(B, D, 1, -1);
  }
  function ba(D) {
    var B = E6();
    return typeof D == "function" && (D = D()), B.memoizedState = B.baseState = D, D = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: LA, lastRenderedState: D }, B.queue = D, D = D.dispatch = c7.bind(null, sa, D), [B.memoizedState, D];
  }
  function KA(D, B, E, z) {
    return D = { tag: D, create: B, destroy: E, deps: z, next: null }, B = sa.updateQueue, B === null ? (B = { lastEffect: null, stores: null }, sa.updateQueue = B, B.lastEffect = D.next = D) : (E = B.lastEffect, E === null ? B.lastEffect = D.next = D : (z = E.next, E.next = D, D.next = z, B.lastEffect = D)), D;
  }
  function l7() {
    return i6().memoizedState;
  }
  function PP(D, B, E, z) {
    var Ae = E6();
    sa.flags |= D, Ae.memoizedState = KA(1 | B, E, void 0, z === void 0 ? null : z);
  }
  function pA(D, B, E, z) {
    var Ae = i6();
    z = z === void 0 ? null : z;
    var pe = void 0;
    if (Ar !== null) {
      var Re = Ar.memoizedState;
      if (pe = Re.destroy, z !== null && nl(z, Re.deps)) {
        Ae.memoizedState = KA(B, E, pe, z);
        return;
      }
    }
    sa.flags |= D, Ae.memoizedState = KA(1 | B, E, pe, z);
  }
  function Yp(D, B) {
    return PP(8390656, 8, D, B);
  }
  function Mp(D, B) {
    return pA(2048, 8, D, B);
  }
  function Lp(D, B) {
    return pA(4, 2, D, B);
  }
  function Kp(D, B) {
    return pA(4, 4, D, B);
  }
  function Rg(D, B) {
    if (typeof B == "function")
      return D = D(), B(D), function() {
        B(null);
      };
    if (B != null)
      return D = D(), B.current = D, function() {
        B.current = null;
      };
  }
  function sl(D, B, E) {
    return E = E != null ? E.concat([D]) : null, pA(4, 4, Rg.bind(null, B, D), E);
  }
  function Jp() {
  }
  function cP(D, B) {
    var E = i6();
    B = B === void 0 ? null : B;
    var z = E.memoizedState;
    return z !== null && B !== null && nl(B, z[1]) ? z[0] : (E.memoizedState = [D, B], D);
  }
  function Hd(D, B) {
    var E = i6();
    B = B === void 0 ? null : B;
    var z = E.memoizedState;
    return z !== null && B !== null && nl(B, z[1]) ? z[0] : (D = D(), E.memoizedState = [D, B], D);
  }
  function s6(D, B, E) {
    return nu & 21 ? (G9(E, B) || (E = J9(), sa.lanes |= E, pv |= E, D.baseState = !0), B) : (D.baseState && (D.baseState = !1, C1 = !0), D.memoizedState = E);
  }
  function Uq(D, B) {
    var E = Ts;
    Ts = E !== 0 && 4 > E ? E : 4, D(!0);
    var z = _c.transition;
    _c.transition = {};
    try {
      D(!1), B();
    } finally {
      Ts = E, _c.transition = z;
    }
  }
  function Ma() {
    return i6().memoizedState;
  }
  function P7(D, B, E) {
    var z = y1(D);
    if (E = { lane: z, action: E, hasEagerState: !1, eagerState: null, next: null }, V1(D))
      gd(B, E);
    else if (E = vP(D, B, E, z), E !== null) {
      var Ae = w9();
      If(E, D, z, Ae), X4(E, B, z);
    }
  }
  function c7(D, B, E) {
    var z = y1(D), Ae = { lane: z, action: E, hasEagerState: !1, eagerState: null, next: null };
    if (V1(D))
      gd(B, Ae);
    else {
      var pe = D.alternate;
      if (D.lanes === 0 && (pe === null || pe.lanes === 0) && (pe = B.lastRenderedReducer, pe !== null))
        try {
          var Re = B.lastRenderedState, ot = pe(Re, E);
          if (Ae.hasEagerState = !0, Ae.eagerState = ot, G9(ot, Re)) {
            var lt = B.interleaved;
            lt === null ? (Ae.next = Ae, Kc(B)) : (Ae.next = lt.next, lt.next = Ae), B.interleaved = Ae;
            return;
          }
        } catch {
        } finally {
        }
      E = vP(D, B, Ae, z), E !== null && (Ae = w9(), If(E, D, z, Ae), X4(E, B, z));
    }
  }
  function V1(D) {
    var B = D.alternate;
    return D === sa || B !== null && B === sa;
  }
  function gd(D, B) {
    qs = Ln = !0;
    var E = D.pending;
    E === null ? B.next = B : (B.next = E.next, E.next = B), D.pending = B;
  }
  function X4(D, B, E) {
    if (E & 4194240) {
      var z = B.lanes;
      z &= D.pendingLanes, E |= z, B.lanes = E, Zr(D, E);
    }
  }
  var nf = { readContext: i1, useCallback: Ra, useContext: Ra, useEffect: Ra, useImperativeHandle: Ra, useInsertionEffect: Ra, useLayoutEffect: Ra, useMemo: Ra, useReducer: Ra, useRef: Ra, useState: Ra, useDebugValue: Ra, useDeferredValue: Ra, useTransition: Ra, useMutableSource: Ra, useSyncExternalStore: Ra, useId: Ra, unstable_isNewReconciler: !1 }, pP = { readContext: i1, useCallback: function(D, B) {
    return E6().memoizedState = [D, B === void 0 ? null : B], D;
  }, useContext: i1, useEffect: Yp, useImperativeHandle: function(D, B, E) {
    return E = E != null ? E.concat([D]) : null, PP(
      4194308,
      4,
      Rg.bind(null, B, D),
      E
    );
  }, useLayoutEffect: function(D, B) {
    return PP(4194308, 4, D, B);
  }, useInsertionEffect: function(D, B) {
    return PP(4, 2, D, B);
  }, useMemo: function(D, B) {
    var E = E6();
    return B = B === void 0 ? null : B, D = D(), E.memoizedState = [D, B], D;
  }, useReducer: function(D, B, E) {
    var z = E6();
    return B = E !== void 0 ? E(B) : B, z.memoizedState = z.baseState = B, D = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: D, lastRenderedState: B }, z.queue = D, D = D.dispatch = P7.bind(null, sa, D), [z.memoizedState, D];
  }, useRef: function(D) {
    var B = E6();
    return D = { current: D }, B.memoizedState = D;
  }, useState: ba, useDebugValue: Jp, useDeferredValue: function(D) {
    return E6().memoizedState = D;
  }, useTransition: function() {
    var D = ba(!1), B = D[0];
    return D = Uq.bind(null, D[1]), E6().memoizedState = D, [B, D];
  }, useMutableSource: function() {
  }, useSyncExternalStore: function(D, B, E) {
    var z = sa, Ae = E6();
    if (Us) {
      if (E === void 0)
        throw Error(t(407));
      E = E();
    } else {
      if (E = B(), Oo === null)
        throw Error(t(349));
      nu & 30 || e3(z, B, E);
    }
    Ae.memoizedState = E;
    var pe = { value: E, getSnapshot: B };
    return Ae.queue = pe, Yp(cA.bind(
      null,
      z,
      pe,
      D
    ), [D]), z.flags |= 2048, KA(9, t3.bind(null, z, pe, E, B), void 0, null), E;
  }, useId: function() {
    var D = E6(), B = Oo.identifierPrefix;
    if (Us) {
      var E = $v, z = ef;
      E = (z & ~(1 << 32 - Ho(z) - 1)).toString(32) + E, B = ":" + B + "R" + E, E = Zf++, 0 < E && (B += "H" + E.toString(32)), B += ":";
    } else
      E = iu++, B = ":" + B + "r" + E.toString(32) + ":";
    return D.memoizedState = B;
  }, unstable_isNewReconciler: !1 }, ca = {
    readContext: i1,
    useCallback: cP,
    useContext: i1,
    useEffect: Mp,
    useImperativeHandle: sl,
    useInsertionEffect: Lp,
    useLayoutEffect: Kp,
    useMemo: Hd,
    useReducer: au,
    useRef: l7,
    useState: function() {
      return au(LA);
    },
    useDebugValue: Jp,
    useDeferredValue: function(D) {
      var B = i6();
      return s6(B, Ar.memoizedState, D);
    },
    useTransition: function() {
      var D = au(LA)[0], B = i6().memoizedState;
      return [D, B];
    },
    useMutableSource: $c,
    useSyncExternalStore: Qp,
    useId: Ma,
    unstable_isNewReconciler: !1
  }, hP = { readContext: i1, useCallback: cP, useContext: i1, useEffect: Mp, useImperativeHandle: sl, useInsertionEffect: Lp, useLayoutEffect: Kp, useMemo: Hd, useReducer: lv, useRef: l7, useState: function() {
    return lv(LA);
  }, useDebugValue: Jp, useDeferredValue: function(D) {
    var B = i6();
    return Ar === null ? B.memoizedState = D : s6(B, Ar.memoizedState, D);
  }, useTransition: function() {
    var D = lv(LA)[0], B = i6().memoizedState;
    return [D, B];
  }, useMutableSource: $c, useSyncExternalStore: Qp, useId: Ma, unstable_isNewReconciler: !1 };
  function zp(D, B) {
    try {
      var E = "", z = B;
      do
        E += ge(z), z = z.return;
      while (z);
      var Ae = E;
    } catch (pe) {
      Ae = `
Error generating stack: ` + pe.message + `
` + pe.stack;
    }
    return { value: D, source: B, stack: Ae, digest: null };
  }
  function r3(D, B, E) {
    return { value: D, source: null, stack: E ?? null, digest: B ?? null };
  }
  function n3(D, B) {
    try {
      console.error(B.value);
    } catch (E) {
      setTimeout(function() {
        throw E;
      });
    }
  }
  var Gp = typeof WeakMap == "function" ? WeakMap : Map;
  function T4(D, B, E) {
    E = dv(-1, E), E.tag = 3, E.payload = { element: null };
    var z = B.value;
    return E.callback = function() {
      c3 || (c3 = !0, fl = z), n3(D, B);
    }, E;
  }
  function i3(D, B, E) {
    E = dv(-1, E), E.tag = 3;
    var z = D.type.getDerivedStateFromError;
    if (typeof z == "function") {
      var Ae = B.value;
      E.payload = function() {
        return z(Ae);
      }, E.callback = function() {
        n3(D, B);
      };
    }
    var pe = D.stateNode;
    return pe !== null && typeof pe.componentDidCatch == "function" && (E.callback = function() {
      n3(D, B), typeof z != "function" && (A6 === null ? A6 = /* @__PURE__ */ new Set([this]) : A6.add(this));
      var Re = B.stack;
      this.componentDidCatch(B.value, { componentStack: Re !== null ? Re : "" });
    }), E;
  }
  function q4(D, B, E) {
    var z = D.pingCache;
    if (z === null) {
      z = D.pingCache = new Gp();
      var Ae = /* @__PURE__ */ new Set();
      z.set(B, Ae);
    } else
      Ae = z.get(B), Ae === void 0 && (Ae = /* @__PURE__ */ new Set(), z.set(B, Ae));
    Ae.has(E) || (Ae.add(E), D = B4.bind(null, D, B, E), B.then(D, D));
  }
  function Vg(D) {
    do {
      var B;
      if ((B = D.tag === 13) && (B = D.memoizedState, B = B !== null ? B.dehydrated !== null : !0), B)
        return D;
      D = D.return;
    } while (D !== null);
    return null;
  }
  function Zp(D, B, E, z, Ae) {
    return D.mode & 1 ? (D.flags |= 65536, D.lanes = Ae, D) : (D === B ? D.flags |= 65536 : (D.flags |= 128, E.flags |= 131072, E.flags &= -52805, E.tag === 1 && (E.alternate === null ? E.tag = 17 : (B = dv(-1, 1), B.tag = 2, ru(E, B, 1))), E.lanes |= 1), D);
  }
  var Iq = b.ReactCurrentOwner, C1 = !1;
  function O1(D, B, E, z) {
    B.child = D === null ? Gc(B, null, E, z) : zc(B, D.child, E, z);
  }
  function al(D, B, E, z, Ae) {
    E = E.render;
    var pe = B.ref;
    return dn(B, Ae), z = su(D, B, E, z, pe, Ae), E = il(), D !== null && !C1 ? (B.updateQueue = D.updateQueue, B.flags &= -2053, D.lanes &= ~Ae, _f(D, B, Ae)) : (Us && E && Cp(B), B.flags |= 1, O1(D, B, z, Ae), B.child);
  }
  function _p(D, B, E, z, Ae) {
    if (D === null) {
      var pe = E.type;
      return typeof pe == "function" && !Zg(pe) && pe.defaultProps === void 0 && E.compare === null && E.defaultProps === void 0 ? (B.tag = 15, B.type = pe, F6(D, B, pe, z, Ae)) : (D = H3(E.type, null, z, B, B.mode, Ae), D.ref = B.ref, D.return = B, B.child = D);
    }
    if (pe = D.child, !(D.lanes & Ae)) {
      var Re = pe.memoizedProps;
      if (E = E.compare, E = E !== null ? E : yA, E(Re, z) && D.ref === B.ref)
        return _f(D, B, Ae);
    }
    return B.flags |= 1, D = cu(pe, z), D.ref = B.ref, D.return = B, B.child = D;
  }
  function F6(D, B, E, z, Ae) {
    if (D !== null) {
      var pe = D.memoizedProps;
      if (yA(pe, z) && D.ref === B.ref)
        if (C1 = !1, B.pendingProps = z = pe, (D.lanes & Ae) !== 0)
          D.flags & 131072 && (C1 = !0);
        else
          return B.lanes = D.lanes, _f(D, B, Ae);
    }
    return ou(D, B, E, z, Ae);
  }
  function HP(D, B, E) {
    var z = B.pendingProps, Ae = z.children, pe = D !== null ? D.memoizedState : null;
    if (z.mode === "hidden")
      if (!(B.mode & 1))
        B.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, bi(cv, o6), o6 |= E;
      else {
        if (!(E & 1073741824))
          return D = pe !== null ? pe.baseLanes | E : E, B.lanes = B.childLanes = 1073741824, B.memoizedState = { baseLanes: D, cachePool: null, transitions: null }, B.updateQueue = null, bi(cv, o6), o6 |= D, null;
        B.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, z = pe !== null ? pe.baseLanes : E, bi(cv, o6), o6 |= z;
      }
    else
      pe !== null ? (z = pe.baseLanes | E, B.memoizedState = null) : z = E, bi(cv, o6), o6 |= z;
    return O1(D, B, Ae, E), B.child;
  }
  function ts(D, B) {
    var E = B.ref;
    (D === null && E !== null || D !== null && D.ref !== E) && (B.flags |= 512, B.flags |= 2097152);
  }
  function ou(D, B, E, z, Ae) {
    var pe = vo(E) ? Uf : xi.current;
    return pe = I1(B, pe), dn(B, Ae), E = su(D, B, E, z, pe, Ae), z = il(), D !== null && !C1 ? (B.updateQueue = D.updateQueue, B.flags &= -2053, D.lanes &= ~Ae, _f(D, B, Ae)) : (Us && z && Cp(B), B.flags |= 1, O1(D, B, E, Ae), B.child);
  }
  function p7(D, B, E, z, Ae) {
    if (vo(E)) {
      var pe = !0;
      QA(B);
    } else
      pe = !1;
    if (dn(B, Ae), B.stateNode === null)
      H1(D, B), Wg(B, E, z), kp(B, E, z, Ae), z = !0;
    else if (D === null) {
      var Re = B.stateNode, ot = B.memoizedProps;
      Re.props = ot;
      var lt = Re.context, Jt = E.contextType;
      typeof Jt == "object" && Jt !== null ? Jt = i1(Jt) : (Jt = vo(E) ? Uf : xi.current, Jt = I1(B, Jt));
      var Wr = E.getDerivedStateFromProps, Xr = typeof Wr == "function" || typeof Re.getSnapshotBeforeUpdate == "function";
      Xr || typeof Re.UNSAFE_componentWillReceiveProps != "function" && typeof Re.componentWillReceiveProps != "function" || (ot !== z || lt !== Jt) && g4(B, Re, z, Jt), tu = !1;
      var Dr = B.memoizedState;
      Re.state = Dr, vv(B, z, Re, Ae), lt = B.memoizedState, ot !== z || Dr !== lt || Ya.current || tu ? (typeof Wr == "function" && (Bg(B, E, Wr, z), lt = B.memoizedState), (ot = tu || v7(B, E, ot, z, Dr, lt, Jt)) ? (Xr || typeof Re.UNSAFE_componentWillMount != "function" && typeof Re.componentWillMount != "function" || (typeof Re.componentWillMount == "function" && Re.componentWillMount(), typeof Re.UNSAFE_componentWillMount == "function" && Re.UNSAFE_componentWillMount()), typeof Re.componentDidMount == "function" && (B.flags |= 4194308)) : (typeof Re.componentDidMount == "function" && (B.flags |= 4194308), B.memoizedProps = z, B.memoizedState = lt), Re.props = z, Re.state = lt, Re.context = Jt, z = ot) : (typeof Re.componentDidMount == "function" && (B.flags |= 4194308), z = !1);
    } else {
      Re = B.stateNode, R1(D, B), ot = B.memoizedProps, Jt = B.type === B.elementType ? ot : Gf(B.type, ot), Re.props = Jt, Xr = B.pendingProps, Dr = Re.context, lt = E.contextType, typeof lt == "object" && lt !== null ? lt = i1(lt) : (lt = vo(E) ? Uf : xi.current, lt = I1(B, lt));
      var Tn = E.getDerivedStateFromProps;
      (Wr = typeof Tn == "function" || typeof Re.getSnapshotBeforeUpdate == "function") || typeof Re.UNSAFE_componentWillReceiveProps != "function" && typeof Re.componentWillReceiveProps != "function" || (ot !== Xr || Dr !== lt) && g4(B, Re, z, lt), tu = !1, Dr = B.memoizedState, Re.state = Dr, vv(B, z, Re, Ae);
      var In = B.memoizedState;
      ot !== Xr || Dr !== In || Ya.current || tu ? (typeof Tn == "function" && (Bg(B, E, Tn, z), In = B.memoizedState), (Jt = tu || v7(B, E, Jt, z, Dr, In, lt) || !1) ? (Wr || typeof Re.UNSAFE_componentWillUpdate != "function" && typeof Re.componentWillUpdate != "function" || (typeof Re.componentWillUpdate == "function" && Re.componentWillUpdate(z, In, lt), typeof Re.UNSAFE_componentWillUpdate == "function" && Re.UNSAFE_componentWillUpdate(z, In, lt)), typeof Re.componentDidUpdate == "function" && (B.flags |= 4), typeof Re.getSnapshotBeforeUpdate == "function" && (B.flags |= 1024)) : (typeof Re.componentDidUpdate != "function" || ot === D.memoizedProps && Dr === D.memoizedState || (B.flags |= 4), typeof Re.getSnapshotBeforeUpdate != "function" || ot === D.memoizedProps && Dr === D.memoizedState || (B.flags |= 1024), B.memoizedProps = z, B.memoizedState = In), Re.props = z, Re.state = In, Re.context = lt, z = Jt) : (typeof Re.componentDidUpdate != "function" || ot === D.memoizedProps && Dr === D.memoizedState || (B.flags |= 4), typeof Re.getSnapshotBeforeUpdate != "function" || ot === D.memoizedProps && Dr === D.memoizedState || (B.flags |= 1024), z = !1);
    }
    return Cg(D, B, E, z, pe, Ae);
  }
  function Cg(D, B, E, z, Ae, pe) {
    ts(D, B);
    var Re = (B.flags & 128) !== 0;
    if (!z && !Re)
      return Ae && dP(B, E, !1), _f(D, B, pe);
    z = B.stateNode, Iq.current = B;
    var ot = Re && typeof E.getDerivedStateFromError != "function" ? null : z.render();
    return B.flags |= 1, D !== null && Re ? (B.child = zc(B, D.child, null, pe), B.child = zc(B, null, ot, pe)) : O1(D, B, ot, pe), B.memoizedState = z.state, Ae && dP(B, E, !0), B.child;
  }
  function b4(D) {
    var B = D.stateNode;
    B.pendingContext ? _u(D, B.pendingContext, B.pendingContext !== B.context) : B.context && _u(D, B.context, !1), u7(D, B.containerInfo);
  }
  function h7(D, B, E, z, Ae) {
    return qo(), a7(Ae), B.flags |= 256, O1(D, B, E, z), B.child;
  }
  var gP = { dehydrated: null, treeContext: null, retryLane: 0 };
  function $p(D) {
    return { baseLanes: D, cachePool: null, transitions: null };
  }
  function eh(D, B, E) {
    var z = B.pendingProps, Ae = wi.current, pe = !1, Re = (B.flags & 128) !== 0, ot;
    if ((ot = Re) || (ot = D !== null && D.memoizedState === null ? !1 : (Ae & 2) !== 0), ot ? (pe = !0, B.flags &= -129) : (D === null || D.memoizedState !== null) && (Ae |= 1), bi(wi, Ae & 1), D === null)
      return eu(B), D = B.memoizedState, D !== null && (D = D.dehydrated, D !== null) ? (B.mode & 1 ? D.data === "$!" ? B.lanes = 8 : B.lanes = 1073741824 : B.lanes = 1, null) : (Re = z.children, D = z.fallback, pe ? (z = B.mode, pe = B.child, Re = { mode: "hidden", children: Re }, !(z & 1) && pe !== null ? (pe.childLanes = 0, pe.pendingProps = Re) : pe = g3(Re, z, 0, null), D = DP(D, z, E, null), pe.return = B, D.return = B, pe.sibling = D, B.child = pe, B.child.memoizedState = $p(E), B.memoizedState = gP, D) : Og(B, Re));
    if (Ae = D.memoizedState, Ae !== null && (ot = Ae.dehydrated, ot !== null))
      return x4(D, B, Re, z, ot, Ae, E);
    if (pe) {
      pe = z.fallback, Re = B.mode, Ae = D.child, ot = Ae.sibling;
      var lt = { mode: "hidden", children: z.children };
      return !(Re & 1) && B.child !== Ae ? (z = B.child, z.childLanes = 0, z.pendingProps = lt, B.deletions = null) : (z = cu(Ae, lt), z.subtreeFlags = Ae.subtreeFlags & 14680064), ot !== null ? pe = cu(ot, pe) : (pe = DP(pe, Re, E, null), pe.flags |= 2), pe.return = B, z.return = B, z.sibling = pe, B.child = z, z = pe, pe = B.child, Re = D.child.memoizedState, Re = Re === null ? $p(E) : { baseLanes: Re.baseLanes | E, cachePool: null, transitions: Re.transitions }, pe.memoizedState = Re, pe.childLanes = D.childLanes & ~E, B.memoizedState = gP, z;
    }
    return pe = D.child, D = pe.sibling, z = cu(pe, { mode: "visible", children: z.children }), !(B.mode & 1) && (z.lanes = E), z.return = B, z.sibling = null, D !== null && (E = B.deletions, E === null ? (B.deletions = [D], B.flags |= 16) : E.push(D)), B.child = z, B.memoizedState = null, z;
  }
  function Og(D, B) {
    return B = g3({ mode: "visible", children: B }, D.mode, 0, null), B.return = D, D.child = B;
  }
  function s3(D, B, E, z) {
    return z !== null && a7(z), zc(B, D.child, null, E), D = Og(B, B.pendingProps.children), D.flags |= 2, B.memoizedState = null, D;
  }
  function x4(D, B, E, z, Ae, pe, Re) {
    if (E)
      return B.flags & 256 ? (B.flags &= -257, z = r3(Error(t(422))), s3(D, B, Re, z)) : B.memoizedState !== null ? (B.child = D.child, B.flags |= 128, null) : (pe = z.fallback, Ae = B.mode, z = g3({ mode: "visible", children: z.children }, Ae, 0, null), pe = DP(pe, Ae, Re, null), pe.flags |= 2, z.return = B, pe.return = B, z.sibling = pe, B.child = z, B.mode & 1 && zc(B, D.child, null, Re), B.child.memoizedState = $p(Re), B.memoizedState = gP, pe);
    if (!(B.mode & 1))
      return s3(D, B, Re, null);
    if (Ae.data === "$!") {
      if (z = Ae.nextSibling && Ae.nextSibling.dataset, z)
        var ot = z.dgst;
      return z = ot, pe = Error(t(419)), z = r3(pe, z, void 0), s3(D, B, Re, z);
    }
    if (ot = (Re & D.childLanes) !== 0, C1 || ot) {
      if (z = Oo, z !== null) {
        switch (Re & -Re) {
          case 4:
            Ae = 2;
            break;
          case 16:
            Ae = 8;
            break;
          case 64:
          case 128:
          case 256:
          case 512:
          case 1024:
          case 2048:
          case 4096:
          case 8192:
          case 16384:
          case 32768:
          case 65536:
          case 131072:
          case 262144:
          case 524288:
          case 1048576:
          case 2097152:
          case 4194304:
          case 8388608:
          case 16777216:
          case 33554432:
          case 67108864:
            Ae = 32;
            break;
          case 536870912:
            Ae = 268435456;
            break;
          default:
            Ae = 0;
        }
        Ae = Ae & (z.suspendedLanes | Re) ? 0 : Ae, Ae !== 0 && Ae !== pe.retryLane && (pe.retryLane = Ae, MA(D, Ae), If(z, D, Ae, -1));
      }
      return Kg(), z = r3(Error(t(421))), s3(D, B, Re, z);
    }
    return Ae.data === "$?" ? (B.flags |= 128, B.child = D.child, B = W4.bind(null, D), Ae._reactRetry = B, null) : (D = pe.treeContext, r1 = pd(Ae.nextSibling), n6 = B, Us = !0, tf = null, D !== null && (t6[zf++] = ef, t6[zf++] = $v, t6[zf++] = PA, ef = D.id, $v = D.overflow, PA = B), B = Og(B, z.children), B.flags |= 4096, B);
  }
  function yg(D, B, E) {
    D.lanes |= B;
    var z = D.alternate;
    z !== null && (z.lanes |= B), n1(D.return, B, E);
  }
  function fu(D, B, E, z, Ae) {
    var pe = D.memoizedState;
    pe === null ? D.memoizedState = { isBackwards: B, rendering: null, renderingStartTime: 0, last: z, tail: E, tailMode: Ae } : (pe.isBackwards = B, pe.rendering = null, pe.renderingStartTime = 0, pe.last = z, pe.tail = E, pe.tailMode = Ae);
  }
  function th(D, B, E) {
    var z = B.pendingProps, Ae = z.revealOrder, pe = z.tail;
    if (O1(D, B, z.children, E), z = wi.current, z & 2)
      z = z & 1 | 2, B.flags |= 128;
    else {
      if (D !== null && D.flags & 128)
        e:
          for (D = B.child; D !== null; ) {
            if (D.tag === 13)
              D.memoizedState !== null && yg(D, E, B);
            else if (D.tag === 19)
              yg(D, E, B);
            else if (D.child !== null) {
              D.child.return = D, D = D.child;
              continue;
            }
            if (D === B)
              break e;
            for (; D.sibling === null; ) {
              if (D.return === null || D.return === B)
                break e;
              D = D.return;
            }
            D.sibling.return = D.return, D = D.sibling;
          }
      z &= 1;
    }
    if (bi(wi, z), !(B.mode & 1))
      B.memoizedState = null;
    else
      switch (Ae) {
        case "forwards":
          for (E = B.child, Ae = null; E !== null; )
            D = E.alternate, D !== null && Za(D) === null && (Ae = E), E = E.sibling;
          E = Ae, E === null ? (Ae = B.child, B.child = null) : (Ae = E.sibling, E.sibling = null), fu(B, !1, Ae, E, pe);
          break;
        case "backwards":
          for (E = null, Ae = B.child, B.child = null; Ae !== null; ) {
            if (D = Ae.alternate, D !== null && Za(D) === null) {
              B.child = Ae;
              break;
            }
            D = Ae.sibling, Ae.sibling = E, E = Ae, Ae = D;
          }
          fu(B, !0, E, null, pe);
          break;
        case "together":
          fu(B, !1, null, null, void 0);
          break;
        default:
          B.memoizedState = null;
      }
    return B.child;
  }
  function H1(D, B) {
    !(B.mode & 1) && D !== null && (D.alternate = null, B.alternate = null, B.flags |= 2);
  }
  function _f(D, B, E) {
    if (D !== null && (B.dependencies = D.dependencies), pv |= B.lanes, !(E & B.childLanes))
      return null;
    if (D !== null && B.child !== D.child)
      throw Error(t(153));
    if (B.child !== null) {
      for (D = B.child, E = cu(D, D.pendingProps), B.child = E, E.return = B; D.sibling !== null; )
        D = D.sibling, E = E.sibling = cu(D, D.pendingProps), E.return = B;
      E.sibling = null;
    }
    return B.child;
  }
  function Au(D, B, E) {
    switch (B.tag) {
      case 3:
        b4(B), qo();
        break;
      case 5:
        Di(B);
        break;
      case 1:
        vo(B.type) && QA(B);
        break;
      case 4:
        u7(B, B.stateNode.containerInfo);
        break;
      case 10:
        var z = B.type._context, Ae = B.memoizedProps.value;
        bi(Av, z._currentValue), z._currentValue = Ae;
        break;
      case 13:
        if (z = B.memoizedState, z !== null)
          return z.dehydrated !== null ? (bi(wi, wi.current & 1), B.flags |= 128, null) : E & B.child.childLanes ? eh(D, B, E) : (bi(wi, wi.current & 1), D = _f(D, B, E), D !== null ? D.sibling : null);
        bi(wi, wi.current & 1);
        break;
      case 19:
        if (z = (E & B.childLanes) !== 0, D.flags & 128) {
          if (z)
            return th(D, B, E);
          B.flags |= 128;
        }
        if (Ae = B.memoizedState, Ae !== null && (Ae.rendering = null, Ae.tail = null, Ae.lastEffect = null), bi(wi, wi.current), z)
          break;
        return null;
      case 22:
      case 23:
        return B.lanes = 0, HP(D, B, E);
    }
    return _f(D, B, E);
  }
  var XP, ol, a6, Co;
  XP = function(D, B) {
    for (var E = B.child; E !== null; ) {
      if (E.tag === 5 || E.tag === 6)
        D.appendChild(E.stateNode);
      else if (E.tag !== 4 && E.child !== null) {
        E.child.return = E, E = E.child;
        continue;
      }
      if (E === B)
        break;
      for (; E.sibling === null; ) {
        if (E.return === null || E.return === B)
          return;
        E = E.return;
      }
      E.sibling.return = E.return, E = E.sibling;
    }
  }, ol = function() {
  }, a6 = function(D, B, E, z) {
    var Ae = D.memoizedProps;
    if (Ae !== z) {
      D = B.stateNode, uv(j9.current);
      var pe = null;
      switch (E) {
        case "input":
          Ae = be(D, Ae), z = be(D, z), pe = [];
          break;
        case "select":
          Ae = G({}, Ae, { value: void 0 }), z = G({}, z, { value: void 0 }), pe = [];
          break;
        case "textarea":
          Ae = lr(D, Ae), z = lr(D, z), pe = [];
          break;
        default:
          typeof Ae.onClick != "function" && typeof z.onClick == "function" && (D.onclick = Nc);
      }
      Pn(E, z);
      var Re;
      E = null;
      for (Jt in Ae)
        if (!z.hasOwnProperty(Jt) && Ae.hasOwnProperty(Jt) && Ae[Jt] != null)
          if (Jt === "style") {
            var ot = Ae[Jt];
            for (Re in ot)
              ot.hasOwnProperty(Re) && (E || (E = {}), E[Re] = "");
          } else
            Jt !== "dangerouslySetInnerHTML" && Jt !== "children" && Jt !== "suppressContentEditableWarning" && Jt !== "suppressHydrationWarning" && Jt !== "autoFocus" && (n.hasOwnProperty(Jt) ? pe || (pe = []) : (pe = pe || []).push(Jt, null));
      for (Jt in z) {
        var lt = z[Jt];
        if (ot = Ae != null ? Ae[Jt] : void 0, z.hasOwnProperty(Jt) && lt !== ot && (lt != null || ot != null))
          if (Jt === "style")
            if (ot) {
              for (Re in ot)
                !ot.hasOwnProperty(Re) || lt && lt.hasOwnProperty(Re) || (E || (E = {}), E[Re] = "");
              for (Re in lt)
                lt.hasOwnProperty(Re) && ot[Re] !== lt[Re] && (E || (E = {}), E[Re] = lt[Re]);
            } else
              E || (pe || (pe = []), pe.push(
                Jt,
                E
              )), E = lt;
          else
            Jt === "dangerouslySetInnerHTML" ? (lt = lt ? lt.__html : void 0, ot = ot ? ot.__html : void 0, lt != null && ot !== lt && (pe = pe || []).push(Jt, lt)) : Jt === "children" ? typeof lt != "string" && typeof lt != "number" || (pe = pe || []).push(Jt, "" + lt) : Jt !== "suppressContentEditableWarning" && Jt !== "suppressHydrationWarning" && (n.hasOwnProperty(Jt) ? (lt != null && Jt === "onScroll" && Pa("scroll", D), pe || ot === lt || (pe = [])) : (pe = pe || []).push(Jt, lt));
      }
      E && (pe = pe || []).push("style", E);
      var Jt = pe;
      (B.updateQueue = Jt) && (B.flags |= 4);
    }
  }, Co = function(D, B, E, z) {
    E !== z && (B.flags |= 4);
  };
  function a3(D, B) {
    if (!Us)
      switch (D.tailMode) {
        case "hidden":
          B = D.tail;
          for (var E = null; B !== null; )
            B.alternate !== null && (E = B), B = B.sibling;
          E === null ? D.tail = null : E.sibling = null;
          break;
        case "collapsed":
          E = D.tail;
          for (var z = null; E !== null; )
            E.alternate !== null && (z = E), E = E.sibling;
          z === null ? B || D.tail === null ? D.tail = null : D.tail.sibling = null : z.sibling = null;
      }
  }
  function Va(D) {
    var B = D.alternate !== null && D.alternate.child === D.child, E = 0, z = 0;
    if (B)
      for (var Ae = D.child; Ae !== null; )
        E |= Ae.lanes | Ae.childLanes, z |= Ae.subtreeFlags & 14680064, z |= Ae.flags & 14680064, Ae.return = D, Ae = Ae.sibling;
    else
      for (Ae = D.child; Ae !== null; )
        E |= Ae.lanes | Ae.childLanes, z |= Ae.subtreeFlags, z |= Ae.flags, Ae.return = D, Ae = Ae.sibling;
    return D.subtreeFlags |= z, D.childLanes = E, B;
  }
  function TP(D, B, E) {
    var z = B.pendingProps;
    switch (jg(B), B.tag) {
      case 2:
      case 16:
      case 15:
      case 0:
      case 11:
      case 7:
      case 8:
      case 12:
      case 9:
      case 14:
        return Va(B), null;
      case 1:
        return vo(B.type) && NA(), Va(B), null;
      case 3:
        return z = B.stateNode, y6(), _s(Ya), _s(xi), Zc(), z.pendingContext && (z.context = z.pendingContext, z.pendingContext = null), (D === null || D.child === null) && (s7(B) ? B.flags |= 4 : D === null || D.memoizedState.isDehydrated && !(B.flags & 256) || (B.flags |= 1024, tf !== null && (h3(tf), tf = null))), ol(D, B), Va(B), null;
      case 5:
        Ki(B);
        var Ae = uv(rl.current);
        if (E = B.type, D !== null && B.stateNode != null)
          a6(D, B, E, z, Ae), D.ref !== B.ref && (B.flags |= 512, B.flags |= 2097152);
        else {
          if (!z) {
            if (B.stateNode === null)
              throw Error(t(166));
            return Va(B), null;
          }
          if (D = uv(j9.current), s7(B)) {
            z = B.stateNode, E = B.type;
            var pe = B.memoizedProps;
            switch (z[EA] = B, z[_9] = pe, D = (B.mode & 1) !== 0, E) {
              case "dialog":
                Pa("cancel", z), Pa("close", z);
                break;
              case "iframe":
              case "object":
              case "embed":
                Pa("load", z);
                break;
              case "video":
              case "audio":
                for (Ae = 0; Ae < yc.length; Ae++)
                  Pa(yc[Ae], z);
                break;
              case "source":
                Pa("error", z);
                break;
              case "img":
              case "image":
              case "link":
                Pa(
                  "error",
                  z
                ), Pa("load", z);
                break;
              case "details":
                Pa("toggle", z);
                break;
              case "input":
                Fe(z, pe), Pa("invalid", z);
                break;
              case "select":
                z._wrapperState = { wasMultiple: !!pe.multiple }, Pa("invalid", z);
                break;
              case "textarea":
                Qt(z, pe), Pa("invalid", z);
            }
            Pn(E, pe), Ae = null;
            for (var Re in pe)
              if (pe.hasOwnProperty(Re)) {
                var ot = pe[Re];
                Re === "children" ? typeof ot == "string" ? z.textContent !== ot && (pe.suppressHydrationWarning !== !0 && Mu(z.textContent, ot, D), Ae = ["children", ot]) : typeof ot == "number" && z.textContent !== "" + ot && (pe.suppressHydrationWarning !== !0 && Mu(
                  z.textContent,
                  ot,
                  D
                ), Ae = ["children", "" + ot]) : n.hasOwnProperty(Re) && ot != null && Re === "onScroll" && Pa("scroll", z);
              }
            switch (E) {
              case "input":
                ve(z), ut(z, pe, !0);
                break;
              case "textarea":
                ve(z), br(z);
                break;
              case "select":
              case "option":
                break;
              default:
                typeof pe.onClick == "function" && (z.onclick = Nc);
            }
            z = Ae, B.updateQueue = z, z !== null && (B.flags |= 4);
          } else {
            Re = Ae.nodeType === 9 ? Ae : Ae.ownerDocument, D === "http://www.w3.org/1999/xhtml" && (D = Xn(E)), D === "http://www.w3.org/1999/xhtml" ? E === "script" ? (D = Re.createElement("div"), D.innerHTML = "<script><\/script>", D = D.removeChild(D.firstChild)) : typeof z.is == "string" ? D = Re.createElement(E, { is: z.is }) : (D = Re.createElement(E), E === "select" && (Re = D, z.multiple ? Re.multiple = !0 : z.size && (Re.size = z.size))) : D = Re.createElementNS(D, E), D[EA] = B, D[_9] = z, XP(D, B, !1, !1), B.stateNode = D;
            e: {
              switch (Re = an(E, z), E) {
                case "dialog":
                  Pa("cancel", D), Pa("close", D), Ae = z;
                  break;
                case "iframe":
                case "object":
                case "embed":
                  Pa("load", D), Ae = z;
                  break;
                case "video":
                case "audio":
                  for (Ae = 0; Ae < yc.length; Ae++)
                    Pa(yc[Ae], D);
                  Ae = z;
                  break;
                case "source":
                  Pa("error", D), Ae = z;
                  break;
                case "img":
                case "image":
                case "link":
                  Pa(
                    "error",
                    D
                  ), Pa("load", D), Ae = z;
                  break;
                case "details":
                  Pa("toggle", D), Ae = z;
                  break;
                case "input":
                  Fe(D, z), Ae = be(D, z), Pa("invalid", D);
                  break;
                case "option":
                  Ae = z;
                  break;
                case "select":
                  D._wrapperState = { wasMultiple: !!z.multiple }, Ae = G({}, z, { value: void 0 }), Pa("invalid", D);
                  break;
                case "textarea":
                  Qt(D, z), Ae = lr(D, z), Pa("invalid", D);
                  break;
                default:
                  Ae = z;
              }
              Pn(E, Ae), ot = Ae;
              for (pe in ot)
                if (ot.hasOwnProperty(pe)) {
                  var lt = ot[pe];
                  pe === "style" ? nn(D, lt) : pe === "dangerouslySetInnerHTML" ? (lt = lt ? lt.__html : void 0, lt != null && Bn(D, lt)) : pe === "children" ? typeof lt == "string" ? (E !== "textarea" || lt !== "") && Fi(D, lt) : typeof lt == "number" && Fi(D, "" + lt) : pe !== "suppressContentEditableWarning" && pe !== "suppressHydrationWarning" && pe !== "autoFocus" && (n.hasOwnProperty(pe) ? lt != null && pe === "onScroll" && Pa("scroll", D) : lt != null && q(D, pe, lt, Re));
                }
              switch (E) {
                case "input":
                  ve(D), ut(D, z, !1);
                  break;
                case "textarea":
                  ve(D), br(D);
                  break;
                case "option":
                  z.value != null && D.setAttribute("value", "" + De(z.value));
                  break;
                case "select":
                  D.multiple = !!z.multiple, pe = z.value, pe != null ? Tt(D, !!z.multiple, pe, !1) : z.defaultValue != null && Tt(
                    D,
                    !!z.multiple,
                    z.defaultValue,
                    !0
                  );
                  break;
                default:
                  typeof Ae.onClick == "function" && (D.onclick = Nc);
              }
              switch (E) {
                case "button":
                case "input":
                case "select":
                case "textarea":
                  z = !!z.autoFocus;
                  break e;
                case "img":
                  z = !0;
                  break e;
                default:
                  z = !1;
              }
            }
            z && (B.flags |= 4);
          }
          B.ref !== null && (B.flags |= 512, B.flags |= 2097152);
        }
        return Va(B), null;
      case 6:
        if (D && B.stateNode != null)
          Co(D, B, D.memoizedProps, z);
        else {
          if (typeof z != "string" && B.stateNode === null)
            throw Error(t(166));
          if (E = uv(rl.current), uv(j9.current), s7(B)) {
            if (z = B.stateNode, E = B.memoizedProps, z[EA] = B, (pe = z.nodeValue !== E) && (D = n6, D !== null))
              switch (D.tag) {
                case 3:
                  Mu(z.nodeValue, E, (D.mode & 1) !== 0);
                  break;
                case 5:
                  D.memoizedProps.suppressHydrationWarning !== !0 && Mu(z.nodeValue, E, (D.mode & 1) !== 0);
              }
            pe && (B.flags |= 4);
          } else
            z = (E.nodeType === 9 ? E : E.ownerDocument).createTextNode(z), z[EA] = B, B.stateNode = z;
        }
        return Va(B), null;
      case 13:
        if (_s(wi), z = B.memoizedState, D === null || D.memoizedState !== null && D.memoizedState.dehydrated !== null) {
          if (Us && r1 !== null && B.mode & 1 && !(B.flags & 128))
            wg(), qo(), B.flags |= 98560, pe = !1;
          else if (pe = s7(B), z !== null && z.dehydrated !== null) {
            if (D === null) {
              if (!pe)
                throw Error(t(318));
              if (pe = B.memoizedState, pe = pe !== null ? pe.dehydrated : null, !pe)
                throw Error(t(317));
              pe[EA] = B;
            } else
              qo(), !(B.flags & 128) && (B.memoizedState = null), B.flags |= 4;
            Va(B), pe = !1;
          } else
            tf !== null && (h3(tf), tf = null), pe = !0;
          if (!pe)
            return B.flags & 65536 ? B : null;
        }
        return B.flags & 128 ? (B.lanes = E, B) : (z = z !== null, z !== (D !== null && D.memoizedState !== null) && z && (B.child.flags |= 8192, B.mode & 1 && (D === null || wi.current & 1 ? ff === 0 && (ff = 3) : Kg())), B.updateQueue !== null && (B.flags |= 4), Va(B), null);
      case 4:
        return y6(), ol(D, B), D === null && O6(B.stateNode.containerInfo), Va(B), null;
      case 10:
        return YA(B.type._context), Va(B), null;
      case 17:
        return vo(B.type) && NA(), Va(B), null;
      case 19:
        if (_s(wi), pe = B.memoizedState, pe === null)
          return Va(B), null;
        if (z = (B.flags & 128) !== 0, Re = pe.rendering, Re === null)
          if (z)
            a3(pe, !1);
          else {
            if (ff !== 0 || D !== null && D.flags & 128)
              for (D = B.child; D !== null; ) {
                if (Re = Za(D), Re !== null) {
                  for (B.flags |= 128, a3(pe, !1), z = Re.updateQueue, z !== null && (B.updateQueue = z, B.flags |= 4), B.subtreeFlags = 0, z = E, E = B.child; E !== null; )
                    pe = E, D = z, pe.flags &= 14680066, Re = pe.alternate, Re === null ? (pe.childLanes = 0, pe.lanes = D, pe.child = null, pe.subtreeFlags = 0, pe.memoizedProps = null, pe.memoizedState = null, pe.updateQueue = null, pe.dependencies = null, pe.stateNode = null) : (pe.childLanes = Re.childLanes, pe.lanes = Re.lanes, pe.child = Re.child, pe.subtreeFlags = 0, pe.deletions = null, pe.memoizedProps = Re.memoizedProps, pe.memoizedState = Re.memoizedState, pe.updateQueue = Re.updateQueue, pe.type = Re.type, D = Re.dependencies, pe.dependencies = D === null ? null : { lanes: D.lanes, firstContext: D.firstContext }), E = E.sibling;
                  return bi(wi, wi.current & 1 | 2), B.child;
                }
                D = D.sibling;
              }
            pe.tail !== null && Ri() > P3 && (B.flags |= 128, z = !0, a3(pe, !1), B.lanes = 4194304);
          }
        else {
          if (!z)
            if (D = Za(Re), D !== null) {
              if (B.flags |= 128, z = !0, E = D.updateQueue, E !== null && (B.updateQueue = E, B.flags |= 4), a3(pe, !0), pe.tail === null && pe.tailMode === "hidden" && !Re.alternate && !Us)
                return Va(B), null;
            } else
              2 * Ri() - pe.renderingStartTime > P3 && E !== 1073741824 && (B.flags |= 128, z = !0, a3(pe, !1), B.lanes = 4194304);
          pe.isBackwards ? (Re.sibling = B.child, B.child = Re) : (E = pe.last, E !== null ? E.sibling = Re : B.child = Re, pe.last = Re);
        }
        return pe.tail !== null ? (B = pe.tail, pe.rendering = B, pe.tail = B.sibling, pe.renderingStartTime = Ri(), B.sibling = null, E = wi.current, bi(wi, z ? E & 1 | 2 : E & 1), B) : (Va(B), null);
      case 22:
      case 23:
        return x7(), z = B.memoizedState !== null, D !== null && D.memoizedState !== null !== z && (B.flags |= 8192), z && B.mode & 1 ? o6 & 1073741824 && (Va(B), B.subtreeFlags & 6 && (B.flags |= 8192)) : Va(B), null;
      case 24:
        return null;
      case 25:
        return null;
    }
    throw Error(t(156, B.tag));
  }
  function rh(D, B) {
    switch (jg(B), B.tag) {
      case 1:
        return vo(B.type) && NA(), D = B.flags, D & 65536 ? (B.flags = D & -65537 | 128, B) : null;
      case 3:
        return y6(), _s(Ya), _s(xi), Zc(), D = B.flags, D & 65536 && !(D & 128) ? (B.flags = D & -65537 | 128, B) : null;
      case 5:
        return Ki(B), null;
      case 13:
        if (_s(wi), D = B.memoizedState, D !== null && D.dehydrated !== null) {
          if (B.alternate === null)
            throw Error(t(340));
          qo();
        }
        return D = B.flags, D & 65536 ? (B.flags = D & -65537 | 128, B) : null;
      case 19:
        return _s(wi), null;
      case 4:
        return y6(), null;
      case 10:
        return YA(B.type._context), null;
      case 22:
      case 23:
        return x7(), null;
      case 24:
        return null;
      default:
        return null;
    }
  }
  var du = !1, sf = !1, nh = typeof WeakSet == "function" ? WeakSet : Set, Un = null;
  function Xd(D, B) {
    var E = D.ref;
    if (E !== null)
      if (typeof E == "function")
        try {
          E(null);
        } catch (z) {
          $a(D, B, z);
        }
      else
        E.current = null;
  }
  function ih(D, B, E) {
    try {
      E();
    } catch (z) {
      $a(D, B, z);
    }
  }
  var o3 = !1;
  function kg(D, B) {
    if (Lu = qi, D = ze(), rt(D)) {
      if ("selectionStart" in D)
        var E = { start: D.selectionStart, end: D.selectionEnd };
      else
        e: {
          E = (E = D.ownerDocument) && E.defaultView || window;
          var z = E.getSelection && E.getSelection();
          if (z && z.rangeCount !== 0) {
            E = z.anchorNode;
            var Ae = z.anchorOffset, pe = z.focusNode;
            z = z.focusOffset;
            try {
              E.nodeType, pe.nodeType;
            } catch {
              E = null;
              break e;
            }
            var Re = 0, ot = -1, lt = -1, Jt = 0, Wr = 0, Xr = D, Dr = null;
            t:
              for (; ; ) {
                for (var Tn; Xr !== E || Ae !== 0 && Xr.nodeType !== 3 || (ot = Re + Ae), Xr !== pe || z !== 0 && Xr.nodeType !== 3 || (lt = Re + z), Xr.nodeType === 3 && (Re += Xr.nodeValue.length), (Tn = Xr.firstChild) !== null; )
                  Dr = Xr, Xr = Tn;
                for (; ; ) {
                  if (Xr === D)
                    break t;
                  if (Dr === E && ++Jt === Ae && (ot = Re), Dr === pe && ++Wr === z && (lt = Re), (Tn = Xr.nextSibling) !== null)
                    break;
                  Xr = Dr, Dr = Xr.parentNode;
                }
                Xr = Tn;
              }
            E = ot === -1 || lt === -1 ? null : { start: ot, end: lt };
          } else
            E = null;
        }
      E = E || { start: 0, end: 0 };
    } else
      E = null;
    for (Ku = { focusedElem: D, selectionRange: E }, qi = !1, Un = B; Un !== null; )
      if (B = Un, D = B.child, (B.subtreeFlags & 1028) !== 0 && D !== null)
        D.return = B, Un = D;
      else
        for (; Un !== null; ) {
          B = Un;
          try {
            var In = B.alternate;
            if (B.flags & 1024)
              switch (B.tag) {
                case 0:
                case 11:
                case 15:
                  break;
                case 1:
                  if (In !== null) {
                    var Kn = In.memoizedProps, La = In.memoizedState, mt = B.stateNode, pt = mt.getSnapshotBeforeUpdate(B.elementType === B.type ? Kn : Gf(B.type, Kn), La);
                    mt.__reactInternalSnapshotBeforeUpdate = pt;
                  }
                  break;
                case 3:
                  var It = B.stateNode.containerInfo;
                  It.nodeType === 1 ? It.textContent = "" : It.nodeType === 9 && It.documentElement && It.removeChild(It.documentElement);
                  break;
                case 5:
                case 6:
                case 4:
                case 17:
                  break;
                default:
                  throw Error(t(163));
              }
          } catch (Qr) {
            $a(B, B.return, Qr);
          }
          if (D = B.sibling, D !== null) {
            D.return = B.return, Un = D;
            break;
          }
          Un = B.return;
        }
    return In = o3, o3 = !1, In;
  }
  function sh(D, B, E) {
    var z = B.updateQueue;
    if (z = z !== null ? z.lastEffect : null, z !== null) {
      var Ae = z = z.next;
      do {
        if ((Ae.tag & D) === D) {
          var pe = Ae.destroy;
          Ae.destroy = void 0, pe !== void 0 && ih(B, E, pe);
        }
        Ae = Ae.next;
      } while (Ae !== z);
    }
  }
  function ah(D, B) {
    if (B = B.updateQueue, B = B !== null ? B.lastEffect : null, B !== null) {
      var E = B = B.next;
      do {
        if ((E.tag & D) === D) {
          var z = E.create;
          E.destroy = z();
        }
        E = E.next;
      } while (E !== B);
    }
  }
  function Eg(D) {
    var B = D.ref;
    if (B !== null) {
      var E = D.stateNode;
      switch (D.tag) {
        case 5:
          D = E;
          break;
        default:
          D = E;
      }
      typeof B == "function" ? B(D) : B.current = D;
    }
  }
  function oh(D) {
    var B = D.alternate;
    B !== null && (D.alternate = null, oh(B)), D.child = null, D.deletions = null, D.sibling = null, D.tag === 5 && (B = D.stateNode, B !== null && (delete B[EA], delete B[_9], delete B[Gu], delete B[Sq], delete B[bg])), D.stateNode = null, D.return = null, D.dependencies = null, D.memoizedProps = null, D.memoizedState = null, D.pendingProps = null, D.stateNode = null, D.updateQueue = null;
  }
  function Fg(D) {
    return D.tag === 5 || D.tag === 3 || D.tag === 4;
  }
  function H7(D) {
    e:
      for (; ; ) {
        for (; D.sibling === null; ) {
          if (D.return === null || Fg(D.return))
            return null;
          D = D.return;
        }
        for (D.sibling.return = D.return, D = D.sibling; D.tag !== 5 && D.tag !== 6 && D.tag !== 18; ) {
          if (D.flags & 2 || D.child === null || D.tag === 4)
            continue e;
          D.child.return = D, D = D.child;
        }
        if (!(D.flags & 2))
          return D.stateNode;
      }
  }
  function f3(D, B, E) {
    var z = D.tag;
    if (z === 5 || z === 6)
      D = D.stateNode, B ? E.nodeType === 8 ? E.parentNode.insertBefore(D, B) : E.insertBefore(D, B) : (E.nodeType === 8 ? (B = E.parentNode, B.insertBefore(D, E)) : (B = E, B.appendChild(D)), E = E._reactRootContainer, E != null || B.onclick !== null || (B.onclick = Nc));
    else if (z !== 4 && (D = D.child, D !== null))
      for (f3(D, B, E), D = D.sibling; D !== null; )
        f3(D, B, E), D = D.sibling;
  }
  function Pv(D, B, E) {
    var z = D.tag;
    if (z === 5 || z === 6)
      D = D.stateNode, B ? E.insertBefore(D, B) : E.appendChild(D);
    else if (z !== 4 && (D = D.child, D !== null))
      for (Pv(D, B, E), D = D.sibling; D !== null; )
        Pv(D, B, E), D = D.sibling;
  }
  var bo = null, af = !1;
  function JA(D, B, E) {
    for (E = E.child; E !== null; )
      A3(D, B, E), E = E.sibling;
  }
  function A3(D, B, E) {
    if (qa && typeof qa.onCommitFiberUnmount == "function")
      try {
        qa.onCommitFiberUnmount(S6, E);
      } catch {
      }
    switch (E.tag) {
      case 5:
        sf || Xd(E, B);
      case 6:
        var z = bo, Ae = af;
        bo = null, JA(D, B, E), bo = z, af = Ae, bo !== null && (af ? (D = bo, E = E.stateNode, D.nodeType === 8 ? D.parentNode.removeChild(E) : D.removeChild(E)) : bo.removeChild(E.stateNode));
        break;
      case 18:
        bo !== null && (af ? (D = bo, E = E.stateNode, D.nodeType === 8 ? av(D.parentNode, E) : D.nodeType === 1 && av(D, E), _n(D)) : av(bo, E.stateNode));
        break;
      case 4:
        z = bo, Ae = af, bo = E.stateNode.containerInfo, af = !0, JA(D, B, E), bo = z, af = Ae;
        break;
      case 0:
      case 11:
      case 14:
      case 15:
        if (!sf && (z = E.updateQueue, z !== null && (z = z.lastEffect, z !== null))) {
          Ae = z = z.next;
          do {
            var pe = Ae, Re = pe.destroy;
            pe = pe.tag, Re !== void 0 && (pe & 2 || pe & 4) && ih(E, B, Re), Ae = Ae.next;
          } while (Ae !== z);
        }
        JA(D, B, E);
        break;
      case 1:
        if (!sf && (Xd(E, B), z = E.stateNode, typeof z.componentWillUnmount == "function"))
          try {
            z.props = E.memoizedProps, z.state = E.memoizedState, z.componentWillUnmount();
          } catch (ot) {
            $a(E, B, ot);
          }
        JA(D, B, E);
        break;
      case 21:
        JA(D, B, E);
        break;
      case 22:
        E.mode & 1 ? (sf = (z = sf) || E.memoizedState !== null, JA(D, B, E), sf = z) : JA(D, B, E);
        break;
      default:
        JA(D, B, E);
    }
  }
  function vu(D) {
    var B = D.updateQueue;
    if (B !== null) {
      D.updateQueue = null;
      var E = D.stateNode;
      E === null && (E = D.stateNode = new nh()), B.forEach(function(z) {
        var Ae = Oq.bind(null, D, z);
        E.has(z) || (E.add(z), z.then(Ae, Ae));
      });
    }
  }
  function zA(D, B) {
    var E = B.deletions;
    if (E !== null)
      for (var z = 0; z < E.length; z++) {
        var Ae = E[z];
        try {
          var pe = D, Re = B, ot = Re;
          e:
            for (; ot !== null; ) {
              switch (ot.tag) {
                case 5:
                  bo = ot.stateNode, af = !1;
                  break e;
                case 3:
                  bo = ot.stateNode.containerInfo, af = !0;
                  break e;
                case 4:
                  bo = ot.stateNode.containerInfo, af = !0;
                  break e;
              }
              ot = ot.return;
            }
          if (bo === null)
            throw Error(t(160));
          A3(pe, Re, Ae), bo = null, af = !1;
          var lt = Ae.alternate;
          lt !== null && (lt.return = null), Ae.return = null;
        } catch (Jt) {
          $a(Ae, B, Jt);
        }
      }
    if (B.subtreeFlags & 12854)
      for (B = B.child; B !== null; )
        D4(B, D), B = B.sibling;
  }
  function D4(D, B) {
    var E = D.alternate, z = D.flags;
    switch (D.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
        if (zA(B, D), Td(D), z & 4) {
          try {
            sh(3, D, D.return), ah(3, D);
          } catch (Kn) {
            $a(D, D.return, Kn);
          }
          try {
            sh(5, D, D.return);
          } catch (Kn) {
            $a(D, D.return, Kn);
          }
        }
        break;
      case 1:
        zA(B, D), Td(D), z & 512 && E !== null && Xd(E, E.return);
        break;
      case 5:
        if (zA(B, D), Td(D), z & 512 && E !== null && Xd(E, E.return), D.flags & 32) {
          var Ae = D.stateNode;
          try {
            Fi(Ae, "");
          } catch (Kn) {
            $a(D, D.return, Kn);
          }
        }
        if (z & 4 && (Ae = D.stateNode, Ae != null)) {
          var pe = D.memoizedProps, Re = E !== null ? E.memoizedProps : pe, ot = D.type, lt = D.updateQueue;
          if (D.updateQueue = null, lt !== null)
            try {
              ot === "input" && pe.type === "radio" && pe.name != null && Ke(Ae, pe), an(ot, Re);
              var Jt = an(ot, pe);
              for (Re = 0; Re < lt.length; Re += 2) {
                var Wr = lt[Re], Xr = lt[Re + 1];
                Wr === "style" ? nn(Ae, Xr) : Wr === "dangerouslySetInnerHTML" ? Bn(Ae, Xr) : Wr === "children" ? Fi(Ae, Xr) : q(Ae, Wr, Xr, Jt);
              }
              switch (ot) {
                case "input":
                  nt(Ae, pe);
                  break;
                case "textarea":
                  tr(Ae, pe);
                  break;
                case "select":
                  var Dr = Ae._wrapperState.wasMultiple;
                  Ae._wrapperState.wasMultiple = !!pe.multiple;
                  var Tn = pe.value;
                  Tn != null ? Tt(Ae, !!pe.multiple, Tn, !1) : Dr !== !!pe.multiple && (pe.defaultValue != null ? Tt(
                    Ae,
                    !!pe.multiple,
                    pe.defaultValue,
                    !0
                  ) : Tt(Ae, !!pe.multiple, pe.multiple ? [] : "", !1));
              }
              Ae[_9] = pe;
            } catch (Kn) {
              $a(D, D.return, Kn);
            }
        }
        break;
      case 6:
        if (zA(B, D), Td(D), z & 4) {
          if (D.stateNode === null)
            throw Error(t(162));
          Ae = D.stateNode, pe = D.memoizedProps;
          try {
            Ae.nodeValue = pe;
          } catch (Kn) {
            $a(D, D.return, Kn);
          }
        }
        break;
      case 3:
        if (zA(B, D), Td(D), z & 4 && E !== null && E.memoizedState.isDehydrated)
          try {
            _n(B.containerInfo);
          } catch (Kn) {
            $a(D, D.return, Kn);
          }
        break;
      case 4:
        zA(B, D), Td(D);
        break;
      case 13:
        zA(B, D), Td(D), Ae = D.child, Ae.flags & 8192 && (pe = Ae.memoizedState !== null, Ae.stateNode.isHidden = pe, !pe || Ae.alternate !== null && Ae.alternate.memoizedState !== null || (T7 = Ri())), z & 4 && vu(D);
        break;
      case 22:
        if (Wr = E !== null && E.memoizedState !== null, D.mode & 1 ? (sf = (Jt = sf) || Wr, zA(B, D), sf = Jt) : zA(B, D), Td(D), z & 8192) {
          if (Jt = D.memoizedState !== null, (D.stateNode.isHidden = Jt) && !Wr && D.mode & 1)
            for (Un = D, Wr = D.child; Wr !== null; ) {
              for (Xr = Un = Wr; Un !== null; ) {
                switch (Dr = Un, Tn = Dr.child, Dr.tag) {
                  case 0:
                  case 11:
                  case 14:
                  case 15:
                    sh(4, Dr, Dr.return);
                    break;
                  case 1:
                    Xd(Dr, Dr.return);
                    var In = Dr.stateNode;
                    if (typeof In.componentWillUnmount == "function") {
                      z = Dr, E = Dr.return;
                      try {
                        B = z, In.props = B.memoizedProps, In.state = B.memoizedState, In.componentWillUnmount();
                      } catch (Kn) {
                        $a(z, E, Kn);
                      }
                    }
                    break;
                  case 5:
                    Xd(Dr, Dr.return);
                    break;
                  case 22:
                    if (Dr.memoizedState !== null) {
                      X7(Xr);
                      continue;
                    }
                }
                Tn !== null ? (Tn.return = Dr, Un = Tn) : X7(Xr);
              }
              Wr = Wr.sibling;
            }
          e:
            for (Wr = null, Xr = D; ; ) {
              if (Xr.tag === 5) {
                if (Wr === null) {
                  Wr = Xr;
                  try {
                    Ae = Xr.stateNode, Jt ? (pe = Ae.style, typeof pe.setProperty == "function" ? pe.setProperty("display", "none", "important") : pe.display = "none") : (ot = Xr.stateNode, lt = Xr.memoizedProps.style, Re = lt != null && lt.hasOwnProperty("display") ? lt.display : null, ot.style.display = Br("display", Re));
                  } catch (Kn) {
                    $a(D, D.return, Kn);
                  }
                }
              } else if (Xr.tag === 6) {
                if (Wr === null)
                  try {
                    Xr.stateNode.nodeValue = Jt ? "" : Xr.memoizedProps;
                  } catch (Kn) {
                    $a(D, D.return, Kn);
                  }
              } else if ((Xr.tag !== 22 && Xr.tag !== 23 || Xr.memoizedState === null || Xr === D) && Xr.child !== null) {
                Xr.child.return = Xr, Xr = Xr.child;
                continue;
              }
              if (Xr === D)
                break e;
              for (; Xr.sibling === null; ) {
                if (Xr.return === null || Xr.return === D)
                  break e;
                Wr === Xr && (Wr = null), Xr = Xr.return;
              }
              Wr === Xr && (Wr = null), Xr.sibling.return = Xr.return, Xr = Xr.sibling;
            }
        }
        break;
      case 19:
        zA(B, D), Td(D), z & 4 && vu(D);
        break;
      case 21:
        break;
      default:
        zA(
          B,
          D
        ), Td(D);
    }
  }
  function Td(D) {
    var B = D.flags;
    if (B & 2) {
      try {
        e: {
          for (var E = D.return; E !== null; ) {
            if (Fg(E)) {
              var z = E;
              break e;
            }
            E = E.return;
          }
          throw Error(t(160));
        }
        switch (z.tag) {
          case 5:
            var Ae = z.stateNode;
            z.flags & 32 && (Fi(Ae, ""), z.flags &= -33);
            var pe = H7(D);
            Pv(D, pe, Ae);
            break;
          case 3:
          case 4:
            var Re = z.stateNode.containerInfo, ot = H7(D);
            f3(D, ot, Re);
            break;
          default:
            throw Error(t(161));
        }
      } catch (lt) {
        $a(D, D.return, lt);
      }
      D.flags &= -3;
    }
    B & 4096 && (D.flags &= -4097);
  }
  function g7(D, B, E) {
    Un = D, d3(D);
  }
  function d3(D, B, E) {
    for (var z = (D.mode & 1) !== 0; Un !== null; ) {
      var Ae = Un, pe = Ae.child;
      if (Ae.tag === 22 && z) {
        var Re = Ae.memoizedState !== null || du;
        if (!Re) {
          var ot = Ae.alternate, lt = ot !== null && ot.memoizedState !== null || sf;
          ot = du;
          var Jt = sf;
          if (du = Re, (sf = lt) && !Jt)
            for (Un = Ae; Un !== null; )
              Re = Un, lt = Re.child, Re.tag === 22 && Re.memoizedState !== null ? Ng(Ae) : lt !== null ? (lt.return = Re, Un = lt) : Ng(Ae);
          for (; pe !== null; )
            Un = pe, d3(pe), pe = pe.sibling;
          Un = Ae, du = ot, sf = Jt;
        }
        j4(D);
      } else
        Ae.subtreeFlags & 8772 && pe !== null ? (pe.return = Ae, Un = pe) : j4(D);
    }
  }
  function j4(D) {
    for (; Un !== null; ) {
      var B = Un;
      if (B.flags & 8772) {
        var E = B.alternate;
        try {
          if (B.flags & 8772)
            switch (B.tag) {
              case 0:
              case 11:
              case 15:
                sf || ah(5, B);
                break;
              case 1:
                var z = B.stateNode;
                if (B.flags & 4 && !sf)
                  if (E === null)
                    z.componentDidMount();
                  else {
                    var Ae = B.elementType === B.type ? E.memoizedProps : Gf(B.type, E.memoizedProps);
                    z.componentDidUpdate(Ae, E.memoizedState, z.__reactInternalSnapshotBeforeUpdate);
                  }
                var pe = B.updateQueue;
                pe !== null && lP(B, pe, z);
                break;
              case 3:
                var Re = B.updateQueue;
                if (Re !== null) {
                  if (E = null, B.child !== null)
                    switch (B.child.tag) {
                      case 5:
                        E = B.child.stateNode;
                        break;
                      case 1:
                        E = B.child.stateNode;
                    }
                  lP(B, Re, E);
                }
                break;
              case 5:
                var ot = B.stateNode;
                if (E === null && B.flags & 4) {
                  E = ot;
                  var lt = B.memoizedProps;
                  switch (B.type) {
                    case "button":
                    case "input":
                    case "select":
                    case "textarea":
                      lt.autoFocus && E.focus();
                      break;
                    case "img":
                      lt.src && (E.src = lt.src);
                  }
                }
                break;
              case 6:
                break;
              case 4:
                break;
              case 12:
                break;
              case 13:
                if (B.memoizedState === null) {
                  var Jt = B.alternate;
                  if (Jt !== null) {
                    var Wr = Jt.memoizedState;
                    if (Wr !== null) {
                      var Xr = Wr.dehydrated;
                      Xr !== null && _n(Xr);
                    }
                  }
                }
                break;
              case 19:
              case 17:
              case 21:
              case 22:
              case 23:
              case 25:
                break;
              default:
                throw Error(t(163));
            }
          sf || B.flags & 512 && Eg(B);
        } catch (Dr) {
          $a(B, B.return, Dr);
        }
      }
      if (B === D) {
        Un = null;
        break;
      }
      if (E = B.sibling, E !== null) {
        E.return = B.return, Un = E;
        break;
      }
      Un = B.return;
    }
  }
  function X7(D) {
    for (; Un !== null; ) {
      var B = Un;
      if (B === D) {
        Un = null;
        break;
      }
      var E = B.sibling;
      if (E !== null) {
        E.return = B.return, Un = E;
        break;
      }
      Un = B.return;
    }
  }
  function Ng(D) {
    for (; Un !== null; ) {
      var B = Un;
      try {
        switch (B.tag) {
          case 0:
          case 11:
          case 15:
            var E = B.return;
            try {
              ah(4, B);
            } catch (lt) {
              $a(B, E, lt);
            }
            break;
          case 1:
            var z = B.stateNode;
            if (typeof z.componentDidMount == "function") {
              var Ae = B.return;
              try {
                z.componentDidMount();
              } catch (lt) {
                $a(B, Ae, lt);
              }
            }
            var pe = B.return;
            try {
              Eg(B);
            } catch (lt) {
              $a(B, pe, lt);
            }
            break;
          case 5:
            var Re = B.return;
            try {
              Eg(B);
            } catch (lt) {
              $a(B, Re, lt);
            }
        }
      } catch (lt) {
        $a(B, B.return, lt);
      }
      if (B === D) {
        Un = null;
        break;
      }
      var ot = B.sibling;
      if (ot !== null) {
        ot.return = B.return, Un = ot;
        break;
      }
      Un = B.return;
    }
  }
  var v3 = Math.ceil, fh = b.ReactCurrentDispatcher, Qg = b.ReactCurrentOwner, $f = b.ReactCurrentBatchConfig, bs = 0, Oo = null, yo = null, of = 0, o6 = 0, cv = Ni(0), ff = 0, u3 = null, pv = 0, Ah = 0, l3 = 0, uu = null, f6 = null, T7 = 0, P3 = 1 / 0, hv = null, c3 = !1, fl = null, A6 = null, lu = !1, Al = null, q7 = 0, p3 = 0, b7 = null, qP = -1, dl = 0;
  function w9() {
    return bs & 6 ? Ri() : qP !== -1 ? qP : qP = Ri();
  }
  function y1(D) {
    return D.mode & 1 ? bs & 2 && of !== 0 ? of & -of : Op.transition !== null ? (dl === 0 && (dl = J9()), dl) : (D = Ts, D !== 0 || (D = window.event, D = D === void 0 ? 16 : oA(D.type)), D) : 1;
  }
  function If(D, B, E, z) {
    if (50 < p3)
      throw p3 = 0, b7 = null, Error(t(185));
    z1(D, E, z), (!(bs & 2) || D !== Oo) && (D === Oo && (!(bs & 2) && (Ah |= E), ff === 4 && d6(D, of)), k1(D, z), E === 1 && bs === 0 && !(B.mode & 1) && (P3 = Ri() + 500, To && $9()));
  }
  function k1(D, B) {
    var E = D.callbackNode;
    U6(D, B);
    var z = B1(D, D === Oo ? of : 0);
    if (z === 0)
      E !== null && Mi(E), D.callbackNode = null, D.callbackPriority = 0;
    else if (B = z & -z, D.callbackPriority !== B) {
      if (E != null && Mi(E), B === 1)
        D.tag === 0 ? xg(Lg.bind(null, D)) : i7(Lg.bind(null, D)), AP(function() {
          !(bs & 6) && $9();
        }), E = null;
      else {
        switch (go(z)) {
          case 1:
            E = w1;
            break;
          case 4:
            E = di;
            break;
          case 16:
            E = jf;
            break;
          case 536870912:
            E = W6;
            break;
          default:
            E = jf;
        }
        E = Gg(E, qd.bind(null, D));
      }
      D.callbackPriority = B, D.callbackNode = E;
    }
  }
  function qd(D, B) {
    if (qP = -1, dl = 0, bs & 6)
      throw Error(t(327));
    var E = D.callbackNode;
    if (e9() && D.callbackNode !== E)
      return null;
    var z = B1(D, D === Oo ? of : 0);
    if (z === 0)
      return null;
    if (z & 30 || z & D.expiredLanes || B)
      B = D7(D, z);
    else {
      B = z;
      var Ae = bs;
      bs |= 2;
      var pe = dh();
      (Oo !== D || of !== B) && (hv = null, P3 = Ri() + 500, vl(D, B));
      do
        try {
          Vq();
          break;
        } catch (ot) {
          w4(D, ot);
        }
      while (!0);
      mg(), fh.current = pe, bs = Ae, yo !== null ? B = 0 : (Oo = null, of = 0, B = ff);
    }
    if (B !== 0) {
      if (B === 2 && (Ae = b9(D), Ae !== 0 && (z = Ae, B = Yg(D, Ae))), B === 1)
        throw E = u3, vl(D, 0), d6(D, z), k1(D, Ri()), E;
      if (B === 6)
        d6(D, z);
      else {
        if (Ae = D.current.alternate, !(z & 30) && !Mg(Ae) && (B = D7(D, z), B === 2 && (pe = b9(D), pe !== 0 && (z = pe, B = Yg(D, pe))), B === 1))
          throw E = u3, vl(D, 0), d6(D, z), k1(D, Ri()), E;
        switch (D.finishedWork = Ae, D.finishedLanes = z, B) {
          case 0:
          case 1:
            throw Error(t(345));
          case 2:
            xP(D, f6, hv);
            break;
          case 3:
            if (d6(D, z), (z & 130023424) === z && (B = T7 + 500 - Ri(), 10 < B)) {
              if (B1(D, 0) !== 0)
                break;
              if (Ae = D.suspendedLanes, (Ae & z) !== z) {
                w9(), D.pingedLanes |= D.suspendedLanes & Ae;
                break;
              }
              D.timeoutHandle = sv(xP.bind(null, D, f6, hv), B);
              break;
            }
            xP(D, f6, hv);
            break;
          case 4:
            if (d6(D, z), (z & 4194240) === z)
              break;
            for (B = D.eventTimes, Ae = -1; 0 < z; ) {
              var Re = 31 - Ho(z);
              pe = 1 << Re, Re = B[Re], Re > Ae && (Ae = Re), z &= ~pe;
            }
            if (z = Ae, z = Ri() - z, z = (120 > z ? 120 : 480 > z ? 480 : 1080 > z ? 1080 : 1920 > z ? 1920 : 3e3 > z ? 3e3 : 4320 > z ? 4320 : 1960 * v3(z / 1960)) - z, 10 < z) {
              D.timeoutHandle = sv(xP.bind(null, D, f6, hv), z);
              break;
            }
            xP(D, f6, hv);
            break;
          case 5:
            xP(D, f6, hv);
            break;
          default:
            throw Error(t(329));
        }
      }
    }
    return k1(D, Ri()), D.callbackNode === E ? qd.bind(null, D) : null;
  }
  function Yg(D, B) {
    var E = uu;
    return D.current.memoizedState.isDehydrated && (vl(D, B).flags |= 256), D = D7(D, B), D !== 2 && (B = f6, f6 = E, B !== null && h3(B)), D;
  }
  function h3(D) {
    f6 === null ? f6 = D : f6.push.apply(f6, D);
  }
  function Mg(D) {
    for (var B = D; ; ) {
      if (B.flags & 16384) {
        var E = B.updateQueue;
        if (E !== null && (E = E.stores, E !== null))
          for (var z = 0; z < E.length; z++) {
            var Ae = E[z], pe = Ae.getSnapshot;
            Ae = Ae.value;
            try {
              if (!G9(pe(), Ae))
                return !1;
            } catch {
              return !1;
            }
          }
      }
      if (E = B.child, B.subtreeFlags & 16384 && E !== null)
        E.return = B, B = E;
      else {
        if (B === D)
          break;
        for (; B.sibling === null; ) {
          if (B.return === null || B.return === D)
            return !0;
          B = B.return;
        }
        B.sibling.return = B.return, B = B.sibling;
      }
    }
    return !0;
  }
  function d6(D, B) {
    for (B &= ~l3, B &= ~Ah, D.suspendedLanes |= B, D.pingedLanes &= ~B, D = D.expirationTimes; 0 < B; ) {
      var E = 31 - Ho(B), z = 1 << E;
      D[E] = -1, B &= ~z;
    }
  }
  function Lg(D) {
    if (bs & 6)
      throw Error(t(327));
    e9();
    var B = B1(D, 0);
    if (!(B & 1))
      return k1(D, Ri()), null;
    var E = D7(D, B);
    if (D.tag !== 0 && E === 2) {
      var z = b9(D);
      z !== 0 && (B = z, E = Yg(D, z));
    }
    if (E === 1)
      throw E = u3, vl(D, 0), d6(D, B), k1(D, Ri()), E;
    if (E === 6)
      throw Error(t(345));
    return D.finishedWork = D.current.alternate, D.finishedLanes = B, xP(D, f6, hv), k1(D, Ri()), null;
  }
  function bP(D, B) {
    var E = bs;
    bs |= 1;
    try {
      return D(B);
    } finally {
      bs = E, bs === 0 && (P3 = Ri() + 500, To && $9());
    }
  }
  function Pu(D) {
    Al !== null && Al.tag === 0 && !(bs & 6) && e9();
    var B = bs;
    bs |= 1;
    var E = $f.transition, z = Ts;
    try {
      if ($f.transition = null, Ts = 1, D)
        return D();
    } finally {
      Ts = z, $f.transition = E, bs = B, !(bs & 6) && $9();
    }
  }
  function x7() {
    o6 = cv.current, _s(cv);
  }
  function vl(D, B) {
    D.finishedWork = null, D.finishedLanes = 0;
    var E = D.timeoutHandle;
    if (E !== -1 && (D.timeoutHandle = -1, p4(E)), yo !== null)
      for (E = yo.return; E !== null; ) {
        var z = E;
        switch (jg(z), z.tag) {
          case 1:
            z = z.type.childContextTypes, z != null && NA();
            break;
          case 3:
            y6(), _s(Ya), _s(xi), Zc();
            break;
          case 5:
            Ki(z);
            break;
          case 4:
            y6();
            break;
          case 13:
            _s(wi);
            break;
          case 19:
            _s(wi);
            break;
          case 10:
            YA(z.type._context);
            break;
          case 22:
          case 23:
            x7();
        }
        E = E.return;
      }
    if (Oo = D, yo = D = cu(D.current, null), of = o6 = B, ff = 0, u3 = null, l3 = Ah = pv = 0, f6 = uu = null, rf !== null) {
      for (B = 0; B < rf.length; B++)
        if (E = rf[B], z = E.interleaved, z !== null) {
          E.interleaved = null;
          var Ae = z.next, pe = E.pending;
          if (pe !== null) {
            var Re = pe.next;
            pe.next = Ae, z.next = Re;
          }
          E.pending = z;
        }
      rf = null;
    }
    return D;
  }
  function w4(D, B) {
    do {
      var E = yo;
      try {
        if (mg(), Np.current = nf, Ln) {
          for (var z = sa.memoizedState; z !== null; ) {
            var Ae = z.queue;
            Ae !== null && (Ae.pending = null), z = z.next;
          }
          Ln = !1;
        }
        if (nu = 0, Zt = Ar = sa = null, qs = !1, Zf = 0, Qg.current = null, E === null || E.return === null) {
          ff = 1, u3 = B, yo = null;
          break;
        }
        e: {
          var pe = D, Re = E.return, ot = E, lt = B;
          if (B = of, ot.flags |= 32768, lt !== null && typeof lt == "object" && typeof lt.then == "function") {
            var Jt = lt, Wr = ot, Xr = Wr.tag;
            if (!(Wr.mode & 1) && (Xr === 0 || Xr === 11 || Xr === 15)) {
              var Dr = Wr.alternate;
              Dr ? (Wr.updateQueue = Dr.updateQueue, Wr.memoizedState = Dr.memoizedState, Wr.lanes = Dr.lanes) : (Wr.updateQueue = null, Wr.memoizedState = null);
            }
            var Tn = Vg(Re);
            if (Tn !== null) {
              Tn.flags &= -257, Zp(Tn, Re, ot, pe, B), Tn.mode & 1 && q4(pe, Jt, B), B = Tn, lt = Jt;
              var In = B.updateQueue;
              if (In === null) {
                var Kn = /* @__PURE__ */ new Set();
                Kn.add(lt), B.updateQueue = Kn;
              } else
                In.add(lt);
              break e;
            } else {
              if (!(B & 1)) {
                q4(pe, Jt, B), Kg();
                break e;
              }
              lt = Error(t(426));
            }
          } else if (Us && ot.mode & 1) {
            var La = Vg(Re);
            if (La !== null) {
              !(La.flags & 65536) && (La.flags |= 256), Zp(La, Re, ot, pe, B), a7(zp(lt, ot));
              break e;
            }
          }
          pe = lt = zp(lt, ot), ff !== 4 && (ff = 2), uu === null ? uu = [pe] : uu.push(pe), pe = Re;
          do {
            switch (pe.tag) {
              case 3:
                pe.flags |= 65536, B &= -B, pe.lanes |= B;
                var mt = T4(pe, lt, B);
                A7(pe, mt);
                break e;
              case 1:
                ot = lt;
                var pt = pe.type, It = pe.stateNode;
                if (!(pe.flags & 128) && (typeof pt.getDerivedStateFromError == "function" || It !== null && typeof It.componentDidCatch == "function" && (A6 === null || !A6.has(It)))) {
                  pe.flags |= 65536, B &= -B, pe.lanes |= B;
                  var Qr = i3(pe, ot, B);
                  A7(pe, Qr);
                  break e;
                }
            }
            pe = pe.return;
          } while (pe !== null);
        }
        zg(E);
      } catch (Jn) {
        B = Jn, yo === E && E !== null && (yo = E = E.return);
        continue;
      }
      break;
    } while (!0);
  }
  function dh() {
    var D = fh.current;
    return fh.current = nf, D === null ? nf : D;
  }
  function Kg() {
    (ff === 0 || ff === 3 || ff === 2) && (ff = 4), Oo === null || !(pv & 268435455) && !(Ah & 268435455) || d6(Oo, of);
  }
  function D7(D, B) {
    var E = bs;
    bs |= 2;
    var z = dh();
    (Oo !== D || of !== B) && (hv = null, vl(D, B));
    do
      try {
        Rq();
        break;
      } catch (Ae) {
        w4(D, Ae);
      }
    while (!0);
    if (mg(), bs = E, fh.current = z, yo !== null)
      throw Error(t(261));
    return Oo = null, of = 0, ff;
  }
  function Rq() {
    for (; yo !== null; )
      Jg(yo);
  }
  function Vq() {
    for (; yo !== null && !li(); )
      Jg(yo);
  }
  function Jg(D) {
    var B = S4(D.alternate, D, o6);
    D.memoizedProps = D.pendingProps, B === null ? zg(D) : yo = B, Qg.current = null;
  }
  function zg(D) {
    var B = D;
    do {
      var E = B.alternate;
      if (D = B.return, B.flags & 32768) {
        if (E = rh(E, B), E !== null) {
          E.flags &= 32767, yo = E;
          return;
        }
        if (D !== null)
          D.flags |= 32768, D.subtreeFlags = 0, D.deletions = null;
        else {
          ff = 6, yo = null;
          return;
        }
      } else if (E = TP(E, B, o6), E !== null) {
        yo = E;
        return;
      }
      if (B = B.sibling, B !== null) {
        yo = B;
        return;
      }
      yo = B = D;
    } while (B !== null);
    ff === 0 && (ff = 5);
  }
  function xP(D, B, E) {
    var z = Ts, Ae = $f.transition;
    try {
      $f.transition = null, Ts = 1, Cq(D, B, E, z);
    } finally {
      $f.transition = Ae, Ts = z;
    }
    return null;
  }
  function Cq(D, B, E, z) {
    do
      e9();
    while (Al !== null);
    if (bs & 6)
      throw Error(t(327));
    E = D.finishedWork;
    var Ae = D.finishedLanes;
    if (E === null)
      return null;
    if (D.finishedWork = null, D.finishedLanes = 0, E === D.current)
      throw Error(t(177));
    D.callbackNode = null, D.callbackPriority = 0;
    var pe = E.lanes | E.childLanes;
    if (Zd(D, pe), D === Oo && (yo = Oo = null, of = 0), !(E.subtreeFlags & 2064) && !(E.flags & 2064) || lu || (lu = !0, Gg(jf, function() {
      return e9(), null;
    })), pe = (E.flags & 15990) !== 0, E.subtreeFlags & 15990 || pe) {
      pe = $f.transition, $f.transition = null;
      var Re = Ts;
      Ts = 1;
      var ot = bs;
      bs |= 4, Qg.current = null, kg(D, E), D4(E, D), vt(Ku), qi = !!Lu, Ku = Lu = null, D.current = E, g7(E), Xs(), bs = ot, Ts = Re, $f.transition = pe;
    } else
      D.current = E;
    if (lu && (lu = !1, Al = D, q7 = Ae), pe = D.pendingLanes, pe === 0 && (A6 = null), m1(E.stateNode), k1(D, Ri()), B !== null)
      for (z = D.onRecoverableError, E = 0; E < B.length; E++)
        Ae = B[E], z(Ae.value, { componentStack: Ae.stack, digest: Ae.digest });
    if (c3)
      throw c3 = !1, D = fl, fl = null, D;
    return q7 & 1 && D.tag !== 0 && e9(), pe = D.pendingLanes, pe & 1 ? D === b7 ? p3++ : (p3 = 0, b7 = D) : p3 = 0, $9(), null;
  }
  function e9() {
    if (Al !== null) {
      var D = go(q7), B = $f.transition, E = Ts;
      try {
        if ($f.transition = null, Ts = 16 > D ? 16 : D, Al === null)
          var z = !1;
        else {
          if (D = Al, Al = null, q7 = 0, bs & 6)
            throw Error(t(331));
          var Ae = bs;
          for (bs |= 4, Un = D.current; Un !== null; ) {
            var pe = Un, Re = pe.child;
            if (Un.flags & 16) {
              var ot = pe.deletions;
              if (ot !== null) {
                for (var lt = 0; lt < ot.length; lt++) {
                  var Jt = ot[lt];
                  for (Un = Jt; Un !== null; ) {
                    var Wr = Un;
                    switch (Wr.tag) {
                      case 0:
                      case 11:
                      case 15:
                        sh(8, Wr, pe);
                    }
                    var Xr = Wr.child;
                    if (Xr !== null)
                      Xr.return = Wr, Un = Xr;
                    else
                      for (; Un !== null; ) {
                        Wr = Un;
                        var Dr = Wr.sibling, Tn = Wr.return;
                        if (oh(Wr), Wr === Jt) {
                          Un = null;
                          break;
                        }
                        if (Dr !== null) {
                          Dr.return = Tn, Un = Dr;
                          break;
                        }
                        Un = Tn;
                      }
                  }
                }
                var In = pe.alternate;
                if (In !== null) {
                  var Kn = In.child;
                  if (Kn !== null) {
                    In.child = null;
                    do {
                      var La = Kn.sibling;
                      Kn.sibling = null, Kn = La;
                    } while (Kn !== null);
                  }
                }
                Un = pe;
              }
            }
            if (pe.subtreeFlags & 2064 && Re !== null)
              Re.return = pe, Un = Re;
            else
              e:
                for (; Un !== null; ) {
                  if (pe = Un, pe.flags & 2048)
                    switch (pe.tag) {
                      case 0:
                      case 11:
                      case 15:
                        sh(9, pe, pe.return);
                    }
                  var mt = pe.sibling;
                  if (mt !== null) {
                    mt.return = pe.return, Un = mt;
                    break e;
                  }
                  Un = pe.return;
                }
          }
          var pt = D.current;
          for (Un = pt; Un !== null; ) {
            Re = Un;
            var It = Re.child;
            if (Re.subtreeFlags & 2064 && It !== null)
              It.return = Re, Un = It;
            else
              e:
                for (Re = pt; Un !== null; ) {
                  if (ot = Un, ot.flags & 2048)
                    try {
                      switch (ot.tag) {
                        case 0:
                        case 11:
                        case 15:
                          ah(9, ot);
                      }
                    } catch (Jn) {
                      $a(ot, ot.return, Jn);
                    }
                  if (ot === Re) {
                    Un = null;
                    break e;
                  }
                  var Qr = ot.sibling;
                  if (Qr !== null) {
                    Qr.return = ot.return, Un = Qr;
                    break e;
                  }
                  Un = ot.return;
                }
          }
          if (bs = Ae, $9(), qa && typeof qa.onPostCommitFiberRoot == "function")
            try {
              qa.onPostCommitFiberRoot(S6, D);
            } catch {
            }
          z = !0;
        }
        return z;
      } finally {
        Ts = E, $f.transition = B;
      }
    }
    return !1;
  }
  function m4(D, B, E) {
    B = zp(E, B), B = T4(D, B, 1), D = ru(D, B, 1), B = w9(), D !== null && (z1(D, 1, B), k1(D, B));
  }
  function $a(D, B, E) {
    if (D.tag === 3)
      m4(D, D, E);
    else
      for (; B !== null; ) {
        if (B.tag === 3) {
          m4(B, D, E);
          break;
        } else if (B.tag === 1) {
          var z = B.stateNode;
          if (typeof B.type.getDerivedStateFromError == "function" || typeof z.componentDidCatch == "function" && (A6 === null || !A6.has(z))) {
            D = zp(E, D), D = i3(B, D, 1), B = ru(B, D, 1), D = w9(), B !== null && (z1(B, 1, D), k1(B, D));
            break;
          }
        }
        B = B.return;
      }
  }
  function B4(D, B, E) {
    var z = D.pingCache;
    z !== null && z.delete(B), B = w9(), D.pingedLanes |= D.suspendedLanes & E, Oo === D && (of & E) === E && (ff === 4 || ff === 3 && (of & 130023424) === of && 500 > Ri() - T7 ? vl(D, 0) : l3 |= E), k1(D, B);
  }
  function j7(D, B) {
    B === 0 && (D.mode & 1 ? (B = wf, wf <<= 1, !(wf & 130023424) && (wf = 4194304)) : B = 1);
    var E = w9();
    D = MA(D, B), D !== null && (z1(D, B, E), k1(D, E));
  }
  function W4(D) {
    var B = D.memoizedState, E = 0;
    B !== null && (E = B.retryLane), j7(D, E);
  }
  function Oq(D, B) {
    var E = 0;
    switch (D.tag) {
      case 13:
        var z = D.stateNode, Ae = D.memoizedState;
        Ae !== null && (E = Ae.retryLane);
        break;
      case 19:
        z = D.stateNode;
        break;
      default:
        throw Error(t(314));
    }
    z !== null && z.delete(B), j7(D, E);
  }
  var S4;
  S4 = function(D, B, E) {
    if (D !== null)
      if (D.memoizedProps !== B.pendingProps || Ya.current)
        C1 = !0;
      else {
        if (!(D.lanes & E) && !(B.flags & 128))
          return C1 = !1, Au(D, B, E);
        C1 = !!(D.flags & 131072);
      }
    else
      C1 = !1, Us && B.flags & 1048576 && Dg(B, Mc, B.index);
    switch (B.lanes = 0, B.tag) {
      case 2:
        var z = B.type;
        H1(D, B), D = B.pendingProps;
        var Ae = I1(B, xi.current);
        dn(B, E), Ae = su(null, B, z, D, Ae, E);
        var pe = il();
        return B.flags |= 1, typeof Ae == "object" && Ae !== null && typeof Ae.render == "function" && Ae.$$typeof === void 0 ? (B.tag = 1, B.memoizedState = null, B.updateQueue = null, vo(z) ? (pe = !0, QA(B)) : pe = !1, B.memoizedState = Ae.state !== null && Ae.state !== void 0 ? Ae.state : null, uP(B), Ae.updater = d7, B.stateNode = Ae, Ae._reactInternals = B, kp(B, z, D, E), B = Cg(null, B, z, !0, pe, E)) : (B.tag = 0, Us && pe && Cp(B), O1(null, B, Ae, E), B = B.child), B;
      case 16:
        z = B.elementType;
        e: {
          switch (H1(D, B), D = B.pendingProps, Ae = z._init, z = Ae(z._payload), B.type = z, Ae = B.tag = w7(z), D = Gf(z, D), Ae) {
            case 0:
              B = ou(null, B, z, D, E);
              break e;
            case 1:
              B = p7(null, B, z, D, E);
              break e;
            case 11:
              B = al(null, B, z, D, E);
              break e;
            case 14:
              B = _p(null, B, z, Gf(z.type, D), E);
              break e;
          }
          throw Error(t(
            306,
            z,
            ""
          ));
        }
        return B;
      case 0:
        return z = B.type, Ae = B.pendingProps, Ae = B.elementType === z ? Ae : Gf(z, Ae), ou(D, B, z, Ae, E);
      case 1:
        return z = B.type, Ae = B.pendingProps, Ae = B.elementType === z ? Ae : Gf(z, Ae), p7(D, B, z, Ae, E);
      case 3:
        e: {
          if (b4(B), D === null)
            throw Error(t(387));
          z = B.pendingProps, pe = B.memoizedState, Ae = pe.element, R1(D, B), vv(B, z, null, E);
          var Re = B.memoizedState;
          if (z = Re.element, pe.isDehydrated)
            if (pe = { element: z, isDehydrated: !1, cache: Re.cache, pendingSuspenseBoundaries: Re.pendingSuspenseBoundaries, transitions: Re.transitions }, B.updateQueue.baseState = pe, B.memoizedState = pe, B.flags & 256) {
              Ae = zp(Error(t(423)), B), B = h7(D, B, z, E, Ae);
              break e;
            } else if (z !== Ae) {
              Ae = zp(Error(t(424)), B), B = h7(D, B, z, E, Ae);
              break e;
            } else
              for (r1 = pd(B.stateNode.containerInfo.firstChild), n6 = B, Us = !0, tf = null, E = Gc(B, null, z, E), B.child = E; E; )
                E.flags = E.flags & -3 | 4096, E = E.sibling;
          else {
            if (qo(), z === Ae) {
              B = _f(D, B, E);
              break e;
            }
            O1(D, B, z, E);
          }
          B = B.child;
        }
        return B;
      case 5:
        return Di(B), D === null && eu(B), z = B.type, Ae = B.pendingProps, pe = D !== null ? D.memoizedProps : null, Re = Ae.children, Qc(z, Ae) ? Re = null : pe !== null && Qc(z, pe) && (B.flags |= 32), ts(D, B), O1(D, B, Re, E), B.child;
      case 6:
        return D === null && eu(B), null;
      case 13:
        return eh(D, B, E);
      case 4:
        return u7(B, B.stateNode.containerInfo), z = B.pendingProps, D === null ? B.child = zc(B, null, z, E) : O1(D, B, z, E), B.child;
      case 11:
        return z = B.type, Ae = B.pendingProps, Ae = B.elementType === z ? Ae : Gf(z, Ae), al(D, B, z, Ae, E);
      case 7:
        return O1(D, B, B.pendingProps, E), B.child;
      case 8:
        return O1(D, B, B.pendingProps.children, E), B.child;
      case 12:
        return O1(D, B, B.pendingProps.children, E), B.child;
      case 10:
        e: {
          if (z = B.type._context, Ae = B.pendingProps, pe = B.memoizedProps, Re = Ae.value, bi(Av, z._currentValue), z._currentValue = Re, pe !== null)
            if (G9(pe.value, Re)) {
              if (pe.children === Ae.children && !Ya.current) {
                B = _f(D, B, E);
                break e;
              }
            } else
              for (pe = B.child, pe !== null && (pe.return = B); pe !== null; ) {
                var ot = pe.dependencies;
                if (ot !== null) {
                  Re = pe.child;
                  for (var lt = ot.firstContext; lt !== null; ) {
                    if (lt.context === z) {
                      if (pe.tag === 1) {
                        lt = dv(-1, E & -E), lt.tag = 2;
                        var Jt = pe.updateQueue;
                        if (Jt !== null) {
                          Jt = Jt.shared;
                          var Wr = Jt.pending;
                          Wr === null ? lt.next = lt : (lt.next = Wr.next, Wr.next = lt), Jt.pending = lt;
                        }
                      }
                      pe.lanes |= E, lt = pe.alternate, lt !== null && (lt.lanes |= E), n1(
                        pe.return,
                        E,
                        B
                      ), ot.lanes |= E;
                      break;
                    }
                    lt = lt.next;
                  }
                } else if (pe.tag === 10)
                  Re = pe.type === B.type ? null : pe.child;
                else if (pe.tag === 18) {
                  if (Re = pe.return, Re === null)
                    throw Error(t(341));
                  Re.lanes |= E, ot = Re.alternate, ot !== null && (ot.lanes |= E), n1(Re, E, B), Re = pe.sibling;
                } else
                  Re = pe.child;
                if (Re !== null)
                  Re.return = pe;
                else
                  for (Re = pe; Re !== null; ) {
                    if (Re === B) {
                      Re = null;
                      break;
                    }
                    if (pe = Re.sibling, pe !== null) {
                      pe.return = Re.return, Re = pe;
                      break;
                    }
                    Re = Re.return;
                  }
                pe = Re;
              }
          O1(D, B, Ae.children, E), B = B.child;
        }
        return B;
      case 9:
        return Ae = B.type, z = B.pendingProps.children, dn(B, E), Ae = i1(Ae), z = z(Ae), B.flags |= 1, O1(D, B, z, E), B.child;
      case 14:
        return z = B.type, Ae = Gf(z, B.pendingProps), Ae = Gf(z.type, Ae), _p(D, B, z, Ae, E);
      case 15:
        return F6(D, B, B.type, B.pendingProps, E);
      case 17:
        return z = B.type, Ae = B.pendingProps, Ae = B.elementType === z ? Ae : Gf(z, Ae), H1(D, B), B.tag = 1, vo(z) ? (D = !0, QA(B)) : D = !1, dn(B, E), Wg(B, z, Ae), kp(B, z, Ae, E), Cg(null, B, z, !0, D, E);
      case 19:
        return th(D, B, E);
      case 22:
        return HP(D, B, E);
    }
    throw Error(t(156, B.tag));
  };
  function Gg(D, B) {
    return Cn(D, B);
  }
  function U4(D, B, E, z) {
    this.tag = D, this.key = E, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.ref = null, this.pendingProps = B, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = z, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null;
  }
  function N6(D, B, E, z) {
    return new U4(D, B, E, z);
  }
  function Zg(D) {
    return D = D.prototype, !(!D || !D.isReactComponent);
  }
  function w7(D) {
    if (typeof D == "function")
      return Zg(D) ? 1 : 0;
    if (D != null) {
      if (D = D.$$typeof, D === y)
        return 11;
      if (D === ee)
        return 14;
    }
    return 2;
  }
  function cu(D, B) {
    var E = D.alternate;
    return E === null ? (E = N6(D.tag, B, D.key, D.mode), E.elementType = D.elementType, E.type = D.type, E.stateNode = D.stateNode, E.alternate = D, D.alternate = E) : (E.pendingProps = B, E.type = D.type, E.flags = 0, E.subtreeFlags = 0, E.deletions = null), E.flags = D.flags & 14680064, E.childLanes = D.childLanes, E.lanes = D.lanes, E.child = D.child, E.memoizedProps = D.memoizedProps, E.memoizedState = D.memoizedState, E.updateQueue = D.updateQueue, B = D.dependencies, E.dependencies = B === null ? null : { lanes: B.lanes, firstContext: B.firstContext }, E.sibling = D.sibling, E.index = D.index, E.ref = D.ref, E;
  }
  function H3(D, B, E, z, Ae, pe) {
    var Re = 2;
    if (z = D, typeof D == "function")
      Zg(D) && (Re = 1);
    else if (typeof D == "string")
      Re = 5;
    else
      e:
        switch (D) {
          case m:
            return DP(E.children, Ae, pe, B);
          case I:
            Re = 8, Ae |= 8;
            break;
          case N:
            return D = N6(12, E, B, Ae | 2), D.elementType = N, D.lanes = pe, D;
          case O:
            return D = N6(13, E, B, Ae), D.elementType = O, D.lanes = pe, D;
          case Y:
            return D = N6(19, E, B, Ae), D.elementType = Y, D.lanes = pe, D;
          case te:
            return g3(E, Ae, pe, B);
          default:
            if (typeof D == "object" && D !== null)
              switch (D.$$typeof) {
                case k:
                  Re = 10;
                  break e;
                case R:
                  Re = 9;
                  break e;
                case y:
                  Re = 11;
                  break e;
                case ee:
                  Re = 14;
                  break e;
                case Z:
                  Re = 16, z = null;
                  break e;
              }
            throw Error(t(130, D == null ? D : typeof D, ""));
        }
    return B = N6(Re, E, B, Ae), B.elementType = D, B.type = z, B.lanes = pe, B;
  }
  function DP(D, B, E, z) {
    return D = N6(7, D, z, B), D.lanes = E, D;
  }
  function g3(D, B, E, z) {
    return D = N6(22, D, z, B), D.elementType = te, D.lanes = E, D.stateNode = { isHidden: !1 }, D;
  }
  function vh(D, B, E) {
    return D = N6(6, D, null, B), D.lanes = E, D;
  }
  function jP(D, B, E) {
    return B = N6(4, D.children !== null ? D.children : [], D.key, B), B.lanes = E, B.stateNode = { containerInfo: D.containerInfo, pendingChildren: null, implementation: D.implementation }, B;
  }
  function yq(D, B, E, z, Ae) {
    this.tag = B, this.containerInfo = D, this.finishedWork = this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = -1, this.callbackNode = this.pendingContext = this.context = null, this.callbackPriority = 0, this.eventTimes = OA(0), this.expirationTimes = OA(-1), this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = OA(0), this.identifierPrefix = z, this.onRecoverableError = Ae, this.mutableSourceEagerHydrationData = null;
  }
  function m7(D, B, E, z, Ae, pe, Re, ot, lt) {
    return D = new yq(D, B, E, ot, lt), B === 1 ? (B = 1, pe === !0 && (B |= 8)) : B = 0, pe = N6(3, null, null, B), D.current = pe, pe.stateNode = D, pe.memoizedState = { element: z, isDehydrated: E, cache: null, transitions: null, pendingSuspenseBoundaries: null }, uP(pe), D;
  }
  function wP(D, B, E) {
    var z = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
    return { $$typeof: w, key: z == null ? null : "" + z, children: D, containerInfo: B, implementation: E };
  }
  function X3(D) {
    if (!D)
      return uA;
    D = D._reactInternals;
    e: {
      if (Kt(D) !== D || D.tag !== 1)
        throw Error(t(170));
      var B = D;
      do {
        switch (B.tag) {
          case 3:
            B = B.stateNode.context;
            break e;
          case 1:
            if (vo(B.type)) {
              B = B.stateNode.__reactInternalMemoizedMergedChildContext;
              break e;
            }
        }
        B = B.return;
      } while (B !== null);
      throw Error(t(171));
    }
    if (D.tag === 1) {
      var E = D.type;
      if (vo(E))
        return ov(D, E, B);
    }
    return B;
  }
  function T3(D, B, E, z, Ae, pe, Re, ot, lt) {
    return D = m7(E, z, !0, D, Ae, pe, Re, ot, lt), D.context = X3(null), E = D.current, z = w9(), Ae = y1(E), pe = dv(z, Ae), pe.callback = B ?? null, ru(E, pe, Ae), D.current.lanes = Ae, z1(D, Ae, z), k1(D, z), D;
  }
  function mP(D, B, E, z) {
    var Ae = B.current, pe = w9(), Re = y1(Ae);
    return E = X3(E), B.context === null ? B.context = E : B.pendingContext = E, B = dv(pe, Re), B.payload = { element: D }, z = z === void 0 ? null : z, z !== null && (B.callback = z), D = ru(Ae, B, Re), D !== null && (If(D, Ae, Re, pe), yp(D, Ae, Re)), Re;
  }
  function uh(D) {
    if (D = D.current, !D.child)
      return null;
    switch (D.child.tag) {
      case 5:
        return D.child.stateNode;
      default:
        return D.child.stateNode;
    }
  }
  function I4(D, B) {
    if (D = D.memoizedState, D !== null && D.dehydrated !== null) {
      var E = D.retryLane;
      D.retryLane = E !== 0 && E < B ? E : B;
    }
  }
  function B7(D, B) {
    I4(D, B), (D = D.alternate) && I4(D, B);
  }
  function R4() {
    return null;
  }
  var W7 = typeof reportError == "function" ? reportError : function(D) {
    console.error(D);
  };
  function S7(D) {
    this._internalRoot = D;
  }
  hA.prototype.render = S7.prototype.render = function(D) {
    var B = this._internalRoot;
    if (B === null)
      throw Error(t(409));
    mP(D, B, null, null);
  }, hA.prototype.unmount = S7.prototype.unmount = function() {
    var D = this._internalRoot;
    if (D !== null) {
      this._internalRoot = null;
      var B = D.containerInfo;
      Pu(function() {
        mP(null, D, null, null);
      }), B[Sf] = null;
    }
  };
  function hA(D) {
    this._internalRoot = D;
  }
  hA.prototype.unstable_scheduleHydration = function(D) {
    if (D) {
      var B = Fa();
      D = { blockedOn: null, target: D, priority: B };
      for (var E = 0; E < vs.length && B !== 0 && B < vs[E].priority; E++)
        ;
      vs.splice(E, 0, D), E === 0 && Et(D);
    }
  };
  function lh(D) {
    return !(!D || D.nodeType !== 1 && D.nodeType !== 9 && D.nodeType !== 11);
  }
  function Ph(D) {
    return !(!D || D.nodeType !== 1 && D.nodeType !== 9 && D.nodeType !== 11 && (D.nodeType !== 8 || D.nodeValue !== " react-mount-point-unstable "));
  }
  function V4() {
  }
  function C4(D, B, E, z, Ae) {
    if (Ae) {
      if (typeof z == "function") {
        var pe = z;
        z = function() {
          var Jt = uh(Re);
          pe.call(Jt);
        };
      }
      var Re = T3(B, z, D, 0, null, !1, !1, "", V4);
      return D._reactRootContainer = Re, D[Sf] = Re.current, O6(D.nodeType === 8 ? D.parentNode : D), Pu(), Re;
    }
    for (; Ae = D.lastChild; )
      D.removeChild(Ae);
    if (typeof z == "function") {
      var ot = z;
      z = function() {
        var Jt = uh(lt);
        ot.call(Jt);
      };
    }
    var lt = m7(D, 0, !1, null, null, !1, !1, "", V4);
    return D._reactRootContainer = lt, D[Sf] = lt.current, O6(D.nodeType === 8 ? D.parentNode : D), Pu(function() {
      mP(B, lt, E, z);
    }), lt;
  }
  function q3(D, B, E, z, Ae) {
    var pe = E._reactRootContainer;
    if (pe) {
      var Re = pe;
      if (typeof Ae == "function") {
        var ot = Ae;
        Ae = function() {
          var lt = uh(Re);
          ot.call(lt);
        };
      }
      mP(B, Re, D, Ae);
    } else
      Re = C4(E, B, D, Ae, z);
    return uh(Re);
  }
  G1 = function(D) {
    switch (D.tag) {
      case 3:
        var B = D.stateNode;
        if (B.current.memoizedState.isDehydrated) {
          var E = mf(B.pendingLanes);
          E !== 0 && (Zr(B, E | 1), k1(B, Ri()), !(bs & 6) && (P3 = Ri() + 500, $9()));
        }
        break;
      case 13:
        Pu(function() {
          var z = MA(D, 1);
          if (z !== null) {
            var Ae = w9();
            If(z, D, 1, Ae);
          }
        }), B7(D, 1);
    }
  }, z9 = function(D) {
    if (D.tag === 13) {
      var B = MA(D, 134217728);
      if (B !== null) {
        var E = w9();
        If(B, D, 134217728, E);
      }
      B7(D, 134217728);
    }
  }, Li = function(D) {
    if (D.tag === 13) {
      var B = y1(D), E = MA(D, B);
      if (E !== null) {
        var z = w9();
        If(E, D, B, z);
      }
      B7(D, B);
    }
  }, Fa = function() {
    return Ts;
  }, Sa = function(D, B) {
    var E = Ts;
    try {
      return Ts = D, B();
    } finally {
      Ts = E;
    }
  }, Sr = function(D, B, E) {
    switch (B) {
      case "input":
        if (nt(D, E), B = E.name, E.type === "radio" && B != null) {
          for (E = D; E.parentNode; )
            E = E.parentNode;
          for (E = E.querySelectorAll("input[name=" + JSON.stringify("" + B) + '][type="radio"]'), B = 0; B < E.length; B++) {
            var z = E[B];
            if (z !== D && z.form === D.form) {
              var Ae = fn(z);
              if (!Ae)
                throw Error(t(90));
              qe(z), nt(z, Ae);
            }
          }
        }
        break;
      case "textarea":
        tr(D, E);
        break;
      case "select":
        B = E.value, B != null && Tt(D, !!E.multiple, B, !1);
    }
  }, as = bP, Rr = Pu;
  var uo = { usingClientEntryPoint: !1, Events: [FA, Qa, fn, Vn, ki, bP] }, BP = { findFiberByHostInstance: Es, bundleType: 0, version: "18.2.0", rendererPackageName: "react-dom" }, O4 = { bundleType: BP.bundleType, version: BP.version, rendererPackageName: BP.rendererPackageName, rendererConfig: BP.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setErrorHandler: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: b.ReactCurrentDispatcher, findHostInstanceByFiber: function(D) {
    return D = pi(D), D === null ? null : D.stateNode;
  }, findFiberByHostInstance: BP.findFiberByHostInstance || R4, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, reconcilerVersion: "18.2.0-next-9e3b772b8-20220608" };
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u") {
    var b3 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
    if (!b3.isDisabled && b3.supportsFiber)
      try {
        S6 = b3.inject(O4), qa = b3;
      } catch {
      }
  }
  return Ac.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = uo, Ac.createPortal = function(D, B) {
    var E = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
    if (!lh(B))
      throw Error(t(200));
    return wP(D, B, null, E);
  }, Ac.createRoot = function(D, B) {
    if (!lh(D))
      throw Error(t(299));
    var E = !1, z = "", Ae = W7;
    return B != null && (B.unstable_strictMode === !0 && (E = !0), B.identifierPrefix !== void 0 && (z = B.identifierPrefix), B.onRecoverableError !== void 0 && (Ae = B.onRecoverableError)), B = m7(D, 1, !1, null, null, E, !1, z, Ae), D[Sf] = B.current, O6(D.nodeType === 8 ? D.parentNode : D), new S7(B);
  }, Ac.findDOMNode = function(D) {
    if (D == null)
      return null;
    if (D.nodeType === 1)
      return D;
    var B = D._reactInternals;
    if (B === void 0)
      throw typeof D.render == "function" ? Error(t(188)) : (D = Object.keys(D).join(","), Error(t(268, D)));
    return D = pi(B), D = D === null ? null : D.stateNode, D;
  }, Ac.flushSync = function(D) {
    return Pu(D);
  }, Ac.hydrate = function(D, B, E) {
    if (!Ph(B))
      throw Error(t(200));
    return q3(null, D, B, !0, E);
  }, Ac.hydrateRoot = function(D, B, E) {
    if (!lh(D))
      throw Error(t(405));
    var z = E != null && E.hydratedSources || null, Ae = !1, pe = "", Re = W7;
    if (E != null && (E.unstable_strictMode === !0 && (Ae = !0), E.identifierPrefix !== void 0 && (pe = E.identifierPrefix), E.onRecoverableError !== void 0 && (Re = E.onRecoverableError)), B = T3(B, null, D, 1, E ?? null, Ae, !1, pe, Re), D[Sf] = B.current, O6(D), z)
      for (D = 0; D < z.length; D++)
        E = z[D], Ae = E._getVersion, Ae = Ae(E._source), B.mutableSourceEagerHydrationData == null ? B.mutableSourceEagerHydrationData = [E, Ae] : B.mutableSourceEagerHydrationData.push(
          E,
          Ae
        );
    return new hA(B);
  }, Ac.render = function(D, B, E) {
    if (!Ph(B))
      throw Error(t(200));
    return q3(null, D, B, !1, E);
  }, Ac.unmountComponentAtNode = function(D) {
    if (!Ph(D))
      throw Error(t(40));
    return D._reactRootContainer ? (Pu(function() {
      q3(null, null, D, !1, function() {
        D._reactRootContainer = null, D[Sf] = null;
      });
    }), !0) : !1;
  }, Ac.unstable_batchedUpdates = bP, Ac.unstable_renderSubtreeIntoContainer = function(D, B, E, z) {
    if (!Ph(E))
      throw Error(t(200));
    if (D == null || D._reactInternals === void 0)
      throw Error(t(38));
    return q3(D, B, E, !1, z);
  }, Ac.version = "18.2.0-next-9e3b772b8-20220608", Ac;
}
function A9e() {
  if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) {
    if (process.env.NODE_ENV !== "production")
      throw new Error("^_^");
    try {
      __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(A9e);
    } catch (A) {
      console.error(A);
    }
  }
}
process.env.NODE_ENV === "production" ? (A9e(), WN.exports = iwe()) : WN.exports = nwe();
var swe = WN.exports, SN, PI = swe;
if (process.env.NODE_ENV === "production")
  SN = LW.createRoot = PI.createRoot, LW.hydrateRoot = PI.hydrateRoot;
else {
  var bC = PI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
  SN = LW.createRoot = function(A, e) {
    bC.usingClientEntryPoint = !0;
    try {
      return PI.createRoot(A, e);
    } finally {
      bC.usingClientEntryPoint = !1;
    }
  }, LW.hydrateRoot = function(A, e, t) {
    bC.usingClientEntryPoint = !0;
    try {
      return PI.hydrateRoot(A, e, t);
    } finally {
      bC.usingClientEntryPoint = !1;
    }
  };
}
const awe = "_buttonClass_1g22z_1", owe = "_inputcontainer_1g22z_79", fwe = "_inputrow_1g22z_89", Awe = "_inputtext_1g22z_99", dwe = "_inputfield_1g22z_113", vwe = "_inputrange_1g22z_131", uwe = "_pointList_1g22z_145", Nx = {
  buttonClass: awe,
  inputcontainer: owe,
  inputrow: fwe,
  inputtext: Awe,
  inputfield: dwe,
  inputrange: vwe,
  pointList: uwe
}, lwe = (A) => {
  const [e, t] = F0.useState(1), [r, n] = F0.useState(0.1), i = () => {
    A.tubeManager.continue();
  }, s = (P) => {
    console.log(P), P.target.value && (t(P.target.value), A.tubeManager.changeRadius(P.target.value));
  }, a = (P) => {
    P.target.value && (n(P.target.value), console.log(r), A.tubeManager.changerCircular(P.target.value));
  }, f = (P) => P.toFixed(2), o = (P) => {
    let p = A.tubeManager.getPointList();
    p = p.splice(P, 1), l(v(p));
  }, d = (P) => {
    A.tubeManager.gizmo.attachedMesh = A.tubeManager.getPointList()[P];
  }, v = (P) => (console.log(), P.map((p, c) => /* @__PURE__ */ mi.jsxs("div", { children: [
    /* @__PURE__ */ mi.jsx("span", { children: f(p.position.x) + "|" + f(p.position.y) + "|" + f(p.position.z) }),
    /* @__PURE__ */ mi.jsx("span", { children: /* @__PURE__ */ mi.jsx(
      "button",
      {
        onClick: () => d(c),
        children: "选择"
      }
    ) }),
    /* @__PURE__ */ mi.jsx("span", { children: /* @__PURE__ */ mi.jsx(
      "button",
      {
        onClick: () => o(c),
        children: "删除"
      }
    ) })
  ] })));
  let [u, l] = F0.useState(v(A.tubeManager.getPointList()));
  return /* @__PURE__ */ mi.jsxs("div", { children: [
    /* @__PURE__ */ mi.jsx("div", { children: "管道编辑控件" }),
    /* @__PURE__ */ mi.jsx("div", { children: "键盘按下C键后可在当前控制器所在位置生成一个新的节点" }),
    /* @__PURE__ */ mi.jsx(
      "input",
      {
        type: "button",
        className: Nx.buttonClass,
        value: "继续",
        onClick: i
      }
    ),
    /* @__PURE__ */ mi.jsxs("div", { className: Nx.inputrow, children: [
      /* @__PURE__ */ mi.jsx("span", { className: Nx.inputtext, children: "管道半径:" }),
      /* @__PURE__ */ mi.jsx(
        "input",
        {
          type: "text",
          className: Nx.inputfield,
          placeholder: "请输入内容",
          defaultValue: e,
          onChange: s
        }
      )
    ] }),
    /* @__PURE__ */ mi.jsxs("div", { className: Nx.inputrow, children: [
      /* @__PURE__ */ mi.jsx("span", { className: Nx.inputtext, children: "圆角比例:" }),
      /* @__PURE__ */ mi.jsx(
        "input",
        {
          type: "range",
          className: Nx.inputrange,
          defaultValue: r,
          max: 0.5,
          min: 0.1,
          step: 0.01,
          onChange: a
        }
      )
    ] }),
    /* @__PURE__ */ mi.jsxs("div", { className: Nx.pointList, children: [
      ...u
    ] })
  ] });
};
class Pwe {
  constructor(e, t) {
    this._option = {
      circular: 0.1
    }, this.initRoot = (n) => {
      let i = document.createElement("div");
      return i.id = "editTubeUI", i.style.position = "absolute", i.style.top = "0%", i.style.right = "0%", i.style.width = "300px", i.style.height = "200px", i.style.backgroundColor = "rgba(00, 31, 44, 0.5)", this._rootDiv = i, n.parentElement.appendChild(i), LW.createRoot(i);
    }, this.tubeEdit = (n) => /* @__PURE__ */ mi.jsx("div", { children: /* @__PURE__ */ mi.jsx(lwe, { tubeManager: n }) }), this.dispose = () => {
      var n, i;
      (n = this.root) == null || n.unmount(), (i = this._parent) == null || i.removeChild(this._rootDiv), this._parent = void 0, this._rootDiv = void 0, this.root = void 0;
    }, this._parent = e.parentElement;
    let r = this.tubeEdit(t);
    this.root = this.initRoot(e), this.tubeManager = t, this.root.render(r);
  }
}
function lUe(A, e, t, r, n, i) {
  let s;
  const a = [];
  if (e) {
    let f = Math.PI / 180;
    n && (f = n), s = A / e;
    for (let o = 0; o <= e; o += f)
      a.push(new S(Math.cos(o) * s, 0, Math.sin(o) * s));
  } else
    a.push(new S(-A * 0.5, 0, 0)), a.push(new S(A * 0.5, 0, 0));
  if (i) {
    let f = i.getAbsolutePosition().clone(), o = i.parent, d = i.getChildren();
    d$(d, null);
    let v = i.name;
    const u = M9(i.metadata), l = Ef.CreateTube(v, { path: a, radius: t, sideOrientation: Ee.DOUBLESIDE }, r);
    return i.dispose(), l.position = f, l.setParent(o), l.metadata = u, d$(d, l), l;
  } else {
    let f = "";
    return Ef.CreateTube(f, { path: a, radius: t, sideOrientation: Ee.DOUBLESIDE }, r);
  }
}
function PUe() {
}
const Uu = class Uu {
  constructor(e, t) {
    this.tubeMap = /* @__PURE__ */ new Map(), this._pointList = [], this._isCreasting = !0, this._isSelectRoot = !1, this.initPointListParent = () => {
      this._pointList.length > 0 && this._pointList[0].parent && this._pointList.forEach((n) => {
        console.log("setParent"), n.setParent(null);
      });
    }, this.setPointParent = () => {
      this._pointList.length > 0 && !this._pointList[0].parent && this._pointList.forEach((n) => {
        n.parent || n.setParent(this.editMesh);
      });
    }, this.initStart = () => {
      this._pointList.length > 0 && (this._pointList.length = 0);
      var n = Ee.CreateSphere("startSphere", 4, Uu.radius, this.scene);
      return this._pointList.push(n), n;
    }, this.createTube = (n = Uu.radius, i = Uu.circular, s) => {
      let a = [];
      s ? a = s.map((o) => S.FromArray(o)) : a = this._pointList.map((o) => o.getAbsolutePosition().clone());
      let f = d9e(a, i);
      if (this.editMesh && Uu.SetPivot(1, this.editMesh), this.editMesh = v9e(this.editMesh.name, {
        path: f,
        radius: n,
        instance: this.editMesh,
        sideOrientation: 2
      }, this.scene), this.metadata.__initOption.radius = n, this.metadata.__initOption.path = a.map((o) => o.asArray()), this.metadata.__initOption.circular = i, this._pointList.length > 1) {
        const o = this._pointList[0].getAbsolutePosition().clone();
        Uu.SetPivot(0, this.editMesh, o);
      }
    }, this.initDomUI = () => {
      this._tubeEdit = new Pwe(this.scene.getEngine().getRenderingCanvas().parentElement, this);
    }, this.continue = () => {
      this.gizmo.attachedMesh = this.startSphere;
    }, this.changeRadius = (n) => {
      Uu.radius = n, this.initPointListParent(), this.createTube(), this.setPointParent();
    }, this.changerCircular = (n) => {
      Uu.circular = n, this.initPointListParent(), this.createTube(), this.setPointParent();
    }, this.dispose = () => {
      var n, i, s;
      this.clearPathSphere(), (n = this.gizmo) == null || n.dispose(), this.metadata = void 0, (s = (i = this.scene) == null ? void 0 : i.onKeyboardObservable) == null || s.remove(this.ob), this.startSphere.dispose(), this.startMat.dispose(), this.sphereMat.dispose(), this._tubeEdit.dispose(), this._recordManager.dispose();
    }, this.clearPathSphere = () => {
      this._pointList.forEach((n) => {
        n.dispose();
      }), this._pointList.length = 0;
    }, this.showPathSphere = (n, i, s = !0) => {
      this._pointList.length = 0, n.forEach((a, f) => {
        const o = this.startSphere.clone("le5le_tubePathSp");
        o.material = this.sphereMat, o.renderingGroupId = 1, o.position = S.FromArray(a), this._pointList.push(o), f > 0 && s && o.setParent(this._pointList[0]);
      }), s && (this._pointList[0].position = i.position.clone(), this._pointList[0].rotation = i.rotation.clone(), this._pointList.forEach((a) => {
        a.setParent(null), a.setParent(i);
      }));
    }, this.setRecord = () => {
      this._recordManager.setRecord({
        targetId: this.editMesh,
        property: {
          radius: Uu.radius,
          path: this._pointList.map((n) => n.getAbsolutePosition().clone().asArray()),
          circular: Uu.circular
        }
      });
    }, this.id = t, this.manager = e, this.manager.selectorManager.selectedNodes = [], e.root.running || (this._recordManager = new cwe(this)), this.scene = e.scene.scene, this.startSphere = Ef.CreateSphere("le5le_start", { diameter: 1 }, this.scene), this.startMat = new Wt("le5le_startMat", this.scene), this.startMat.emissiveColor = Ne.FromHexString("#FF9F32"), this.startSphere.material = this.startMat, this.manager.scene.activeCamera.target = S.Zero(), this.gizmo = new oy(), this.gizmo.planarGizmoEnabled = !0, this.gizmo.attachedMesh = this.startSphere, this.pickOb = this.scene.onPointerObservable.add((n, i) => {
      if (!this.isSelectRoot && n.type == 1 && n.event.button === 0) {
        let s = this.scene.pick(this.scene.pointerX, this.scene.pointerY, (a) => {
          var f;
          return ((f = a == null ? void 0 : a.name) == null ? void 0 : f.includes("le5le_tubePathSp")) || a.name == this.startSphere.name;
        });
        s.pickedMesh && (this.gizmo.attachedMesh = s.pickedMesh);
      }
    });
    let r = !1;
    this.gizmo.onDragObservable.add(() => {
      if (!r && this.gizmo.attachedMesh.name != this.startSphere.name) {
        r = !0;
        let n = setTimeout(() => {
          this.initPointListParent(), this.createTube(), this.setPointParent(), r = !1, clearTimeout(n);
        }, 150);
      }
    }), this.gizmo.onDragEndObservable.add(() => {
      var n;
      if (this.editMesh && ((n = this.gizmo.attachedMesh) == null ? void 0 : n.name) != this.startSphere.name) {
        let i = setTimeout(() => {
          this._recordManager.setRecord({
            targetId: this.editMesh,
            property: {
              radius: Uu.radius,
              path: this._pointList.map((s) => s.getAbsolutePosition().clone().asArray()),
              circular: Uu.circular
            }
          }), clearTimeout(i);
        }, 50);
      }
    }), this.sphereMat = new Wt("le5le_tubeSphere", this.scene), this.sphereMat.emissiveColor = Ne.FromHexString("#FF9F32"), this.sphereMat.diffuseColor = new Ne(0, 0, 0), this.editMesh = this.scene.getMeshByName(this.id), this.metadata = this.manager.getMetadata(this.editMesh), this.showPathSphere(this.metadata.__initOption.path, this.editMesh), this.startSphere.position = this._pointList[0].position.clone(), this.ob = this.scene.onKeyboardObservable.add((n) => {
      if (n.event.key.toLocaleLowerCase() === "c" && n.type === 2) {
        var i = this.startSphere.clone("le5le_tubePathSp");
        i.name = "le5le_tubePathSp", this._pointList.push(i), i.position = this.startSphere.getAbsolutePosition().clone(), i.renderingGroupId = 1, i.material = this.sphereMat, this._pointList.forEach((s) => {
          s.parent && s.setParent(null);
        }), this.createTube(), this.setPointParent();
      }
    }), this.initDomUI();
  }
  get isSelectRoot() {
    return this._isSelectRoot;
  }
  set isSelectRoot(e) {
    this._isSelectRoot = e;
  }
  get isCreasting() {
    return this._isCreasting;
  }
  set isCreasting(e) {
    this._isCreasting = e;
  }
  getPointList() {
    return this._pointList;
  }
};
Uu.radius = 1, Uu.circular = 0.2, Uu.SetPivot = (e, t, r) => {
  let n, i = t.getAbsolutePosition().clone();
  switch (e) {
    case 0:
      n = r.clone(), t.position = i.subtract(n.subtract(i)), t.bakeCurrentTransformIntoVertices(), t.position = n;
      break;
    case 1:
      t.bakeCurrentTransformIntoVertices();
      break;
  }
};
let gO = Uu;
function d9e(A, e) {
  let t = [];
  if (A.length <= 2)
    return A.forEach((r) => {
      t.push(r);
    }), t;
  t.push(A[0]);
  for (let r = 1; r < A.length - 1; r++) {
    let n = A[r - 1], i = A[r], s = A[r + 1], a = n.add(i.subtract(n).scale(1 - e)), f = i.add(s.subtract(i).scale(e));
    j0.CreateQuadraticBezier(a, i, f, 10).getPoints().forEach((d) => {
      t.push(d);
    });
  }
  return t.push(A[A.length - 1]), t;
}
function v9e(A, e, t = null) {
  let r;
  if (e.path.length < 2)
    r = new Ee(A, t);
  else {
    const i = e.path;
    let s = 1;
    e.radius !== void 0 && (s = e.radius);
    const a = e.tessellation || 64, f = e.radiusFunction || null;
    let o = e.cap || Ee.NO_CAP;
    const d = e.invertUV || !1, v = e.updatable, u = Ee._GetDefaultSideOrientation(e.sideOrientation);
    e.arc = e.arc && (e.arc <= 0 || e.arc > 1) ? 1 : e.arc || 1;
    const l = (H, T, q, b, j, w, m, I) => {
      const N = T.getTangents(), k = T.getNormals(), R = T.getDistances(), O = Math.PI * 2 / j * I, ee = w || (() => b);
      let Z, te, fe, _;
      const G = ue.Matrix[0];
      let L = m === Ee.NO_CAP || m === Ee.CAP_END ? 0 : 2;
      for (let ae = 0; ae < H.length; ae++) {
        te = ee(ae, R[ae]), Z = Array(), fe = k[ae];
        for (let Pe = 0; Pe < j; Pe++)
          he.RotationAxisToRef(N[ae], O * Pe, G), _ = Z[Pe] ? Z[Pe] : S.Zero(), S.TransformCoordinatesToRef(fe, G, _), _.scaleInPlace(te).addInPlace(H[ae]), Z[Pe] = _;
        q[L] = Z, L++;
      }
      const $ = (ae, Pe) => {
        const ge = Array();
        for (let me = 0; me < ae; me++)
          ge.push(H[Pe]);
        return ge;
      };
      switch (m) {
        case Ee.NO_CAP:
          break;
        case Ee.CAP_START:
          q[0] = $(j, 0), q[1] = q[2].slice(0);
          break;
        case Ee.CAP_END:
          q[L] = q[L - 1].slice(0), q[L + 1] = $(j, H.length - 1);
          break;
        case Ee.CAP_ALL:
          q[0] = $(j, 0), q[1] = q[2].slice(0), q[L] = q[L - 1].slice(0), q[L + 1] = $(j, H.length - 1);
          break;
      }
      return q;
    };
    let P, p;
    P = new vm(i);
    const c = new Array();
    o = o < 0 || o > 3 ? 0 : o, p = l(i, P, c, s, a, f, o, e.arc), r = n4(
      A,
      {
        pathArray: p,
        closePath: !0,
        closeArray: !1,
        updatable: v,
        sideOrientation: u,
        invertUV: d,
        frontUVs: e.frontUVs,
        backUVs: e.backUVs
      },
      t
    ), r._creationDataStorage.pathArray = p, r._creationDataStorage.path3D = P, r._creationDataStorage.tessellation = a, r._creationDataStorage.cap = o, r._creationDataStorage.arc = e.arc, r._creationDataStorage.radius = s;
  }
  const n = e.instance;
  if (n) {
    let i = r.geometry;
    const s = new Ut();
    return i && (s.indices = i.getIndices(), s.positions = i.getVerticesData(
      J.PositionKind,
      !0,
      !0
    ), s.uvs = i.getVerticesData(J.UVKind, !0, !0), s.normals = i.getVerticesData(
      J.NormalKind,
      !0,
      !0
    ), s.colors = i.getVerticesData(
      J.ColorKind,
      !0,
      !0
    ), s.uvs2 = i.getVerticesData(J.UV2Kind, !0, !0), s.uvs3 = i.getVerticesData(J.UV3Kind, !0, !0), s.uvs4 = i.getVerticesData(J.UV4Kind, !0, !0), s.uvs5 = i.getVerticesData(J.UV5Kind, !0, !0), s.matricesIndices = i.getVerticesData(
      J.MatricesIndicesKind,
      !0,
      !0
    ), s.matricesWeights = i.getVerticesData(
      J.MatricesWeightsKind,
      !0,
      !0
    ), s.matricesWeightsExtra = i.getVerticesData(
      J.MatricesWeightsExtraKind,
      !0,
      !0
    ), s.matricesWeightsExtra = i.getVerticesData(
      J.MatricesWeightsExtraKind,
      !0,
      !0
    ), s.tangents = i.getVerticesData(
      J.TangentKind,
      !0,
      !0
    )), s.applyToMesh(n), r.dispose(), n;
  }
  return r;
}
class cwe {
  constructor(e) {
    this.recordList = [], this.setRecord = (t) => {
      this._undoIndex + 1 < this.recordList.length && (this.recordList = this.recordList.splice(0, this._undoIndex + 1)), this.recordList.push(t), this._undoIndex = this.recordList.length - 1;
    }, this.undoRedo = (t = !0) => {
      if (t)
        if (this._undoIndex > 0)
          this._undoIndex--;
        else
          return;
      else if (this._undoIndex < this.recordList.length - 1)
        this._undoIndex++;
      else
        return;
      let r = this.recordList[this._undoIndex];
      this.tubeManager.initPointListParent(), this.tubeManager.createTube(
        r.property.radius,
        r.property.circular,
        r.property.path
      ), this.tubeManager.clearPathSphere(), this.tubeManager.showPathSphere(r.property.path, this.tubeManager.editMesh, !1), this.tubeManager.gizmo.attachedMesh = null;
    }, this.dispose = () => {
      this.recordList.length = 0, this._undoIndex = void 0;
    }, this.tubeManager = e;
  }
}
var pwe = /* @__PURE__ */ ((A) => (A.Container = "container", A.Component = "component", A))(pwe || {}), u9e = /* @__PURE__ */ ((A) => (A.Text = "Text", A.Image = "Image", A.Button = "Button", A.Icon = "Icon", A.Input = "Input", A.Select = "Select", A.Checkbox = "Checkbox", A.Radio = "Radio", A.Echarts = "Echarts", A.Video = "Video", A))(u9e || {});
const i$ = {
  id: "",
  enabled: !0,
  opacity: 1,
  width: 100,
  height: 100,
  backgroundColor: "#fff",
  linkType: 0,
  targetId: "",
  offsetX: 0,
  offsetY: 0,
  x: 0,
  y: 0,
  z: 0,
  alignH: 0,
  alignV: 0,
  parent: "",
  children: []
};
class hwe {
  constructor(e) {
    this._visible = !1, this._defaultDOMContainerData = {
      name: "容器",
      type: "container",
      ...i$
    }, this._defaultDOMComponentData = {
      name: "文本",
      type: "component",
      text: "文本",
      ...i$
    }, this._createRootDOM = () => {
      const t = document.createElement("div");
      return t.style.width = "0", t.style.height = "0", t.style.position = "absolute", t.style.left = "0", t.style.top = "0", t;
    }, this.show = () => {
      this._rootDOM || (this._rootDOM = this._createRootDOM()), this.manager.root.rootDOM.contains(this._rootDOM) || this.manager.root.rootDOM.appendChild(this._rootDOM), this._rootReact || (this._rootReact = SN(this._rootDOM)), this.manager.root.emit("DOMShow"), this.render();
    }, this.hide = () => {
      this._rootReact && (this._rootReact.unmount(), this._rootReact = void 0), this.manager.root.rootDOM.contains(this._rootDOM) && this.manager.root.rootDOM.removeChild(this._rootDOM), this._rootDOM = void 0, this.manager.root.emit("DOMHide");
    }, this.load = (t) => {
      this.map.clear(), t.forEach((r) => this.map.set(r.id, r)), this.render();
    }, this.data = () => M9([...this.map.values()]), this.get = (t) => this.map.get(t), this.set = (t) => {
      const n = Xa(t).map((i) => {
        const s = i.id ?? e4(), f = { ...this.get(s) || { id: s }, ...i };
        return this.map.set(s, {
          ...f.type === "container" ? this._defaultDOMContainerData : this._defaultDOMComponentData,
          ...f
        }), f;
      });
      return this.render(), n;
    }, this.delete = (t) => {
      Xa(t).forEach((r) => this.map.delete(r)), this.render();
    }, this.render = () => {
      this._rootReact && this._rootReact.render(
        /* @__PURE__ */ mi.jsx(
          Hwe,
          {
            datas: [...this.map.values()].filter((t) => !t.parent),
            manager: this.manager
          }
        )
      );
    }, this.doms = (t = [...this.map.values()].filter((r) => !r.parent).map((r) => r.id)) => t.reduce((r, n) => {
      const i = this.DOMRefs.get(n);
      return i ? [...r, i, ...this.doms(i.data.children)] : r;
    }, []), this.getAbsolutePosition = (t) => {
      const r = this.DOMRefs.get(t);
      if (!r)
        return { x: 0, y: 0 };
      let n = r.ref.rect.offsetLeft, i = r.ref.rect.offsetTop, s = r.data.parent;
      for (; s; ) {
        const a = this.DOMRefs.get(s);
        if (!a)
          break;
        n += a.ref.rect.offsetLeft, i += a.ref.rect.offsetTop, s = a.data.parent;
      }
      return { left: n, top: i };
    }, this.pointInRef = (t, r) => {
      const n = this.DOMRefs.get(t);
      if (!n)
        return !1;
      const { left: i, top: s, width: a, height: f } = n.ref.rect, o = r.x >= i && r.x <= i + a && r.y >= s && r.y <= s + f;
      return o && n.data.parent ? this.pointInRef(n.data.parent, r) : o;
    }, this.include = (t, r) => {
      var a;
      const n = this.DOMRefs.get(t), i = this.DOMRefs.get(r);
      return !n || !i || !((a = n.data.children) != null && a.length) ? !1 : n.data.children.some((f) => f === r) ? !0 : n.data.children.some((f) => this.include(f, r));
    }, this.contain = (t, r) => {
      const n = this.DOMRefs.get(r), i = this.DOMRefs.get(t);
      return !n || !i || !i.data.parent ? !1 : i.data.parent === r ? !0 : this.contain(i.data.parent, r);
    }, this.dispose = () => {
      var t;
      this.hide(), this.map.clear(), this._rootDOM = void 0, (t = this._cameraObserver) == null || t.remove(), this._cameraObserver = void 0;
    }, this.manager = e, this.map = /* @__PURE__ */ new Map(), this.DOMRefs = /* @__PURE__ */ new Map(), this._rootDOM = this._createRootDOM(), this._cameraObserver = this.manager.scene.arcRotateCamera.onViewMatrixChangedObservable.add(
      this.render
    );
  }
  get visible() {
    return this._visible;
  }
  set visible(e) {
    this._visible = e, e ? this.show() : this.hide();
  }
}
const Hwe = ({
  datas: A,
  manager: e
}) => {
  e.DOMManager.DOMRefs.clear();
  const t = A.map(
    (r, n) => l9e(r, e, void 0)
  );
  return F0.useEffect(() => () => {
    e.root.emit("DOMRendered", {
      sceneManager: e,
      DOMManager: e.DOMManager,
      refs: []
    });
  }, []), F0.useEffect(() => {
    const r = e.DOMManager.doms().map((n) => {
      const { left: i, top: s } = e.DOMManager.getAbsolutePosition(n.data.id);
      return n.ref.rect.left = i, n.ref.rect.top = s, n;
    });
    e.root.emit("DOMRendered", {
      sceneManager: e,
      DOMManager: e.DOMManager,
      refs: r
    });
  }, [A]), /* @__PURE__ */ mi.jsx(
    "div",
    {
      style: {
        width: "0",
        height: "0",
        position: "absolute",
        left: 0,
        top: 0,
        pointerEvents: e.root.running ? "auto" : "none"
      },
      children: t
    }
  );
}, gwe = (A) => {
  switch (A.componentType) {
    case u9e.Text:
      return Twe;
    default:
      return null;
  }
}, Xwe = ({
  data: A,
  position: e,
  manager: t
}) => {
  const r = DM(A), n = Gy(A), i = gwe(A);
  return /* @__PURE__ */ mi.jsx(
    "div",
    {
      id: A.id,
      style: { position: "absolute", ...e, ...n },
      onContextMenu: (s) => s.preventDefault(),
      ref: (s) => {
        if (!s)
          return;
        const a = {
          data: r,
          style: n,
          position: e,
          ref: {
            isInViewport: !0,
            rect: {
              top: s.offsetTop,
              left: s.offsetLeft,
              width: n.width,
              height: n.height,
              offsetTop: s.offsetTop,
              offsetLeft: s.offsetLeft
            }
          }
        };
        t.DOMManager.DOMRefs.set(A.id, a);
      },
      children: /* @__PURE__ */ mi.jsx(i, { data: A })
    }
  );
}, Twe = (A) => {
  const e = Gy(A.data);
  return /* @__PURE__ */ mi.jsx("div", { style: e, children: A.data.text });
}, qwe = ({
  data: A,
  position: e,
  manager: t
}) => {
  var s;
  const r = DM(A), n = Gy(A), i = (s = A.children) == null ? void 0 : s.map((a) => {
    const f = t.DOMManager.get(a);
    return f ? l9e(f, t, A) : null;
  });
  return /* @__PURE__ */ mi.jsx(
    "div",
    {
      id: A.id,
      style: {
        overflow: "hidden",
        position: "absolute",
        ...e,
        ...n
      },
      onContextMenu: (a) => a.preventDefault(),
      ref: (a) => {
        if (!a)
          return;
        const f = {
          data: r,
          style: n,
          position: e,
          ref: {
            isInViewport: !0,
            rect: {
              top: a.offsetTop,
              left: a.offsetLeft,
              width: n.width,
              height: n.height,
              offsetTop: a.offsetTop,
              offsetLeft: a.offsetLeft
            }
          }
        };
        t.DOMManager.DOMRefs.set(A.id, f);
      },
      children: i
    }
  );
}, bwe = ({
  data: A,
  position: e,
  manager: t
}) => {
  const r = DM(A), n = Gy(A), { width: i, height: s } = n;
  return /* @__PURE__ */ mi.jsx(
    "div",
    {
      id: A.id,
      style: {
        width: i,
        height: s,
        opacity: 0,
        pointerEvents: "none",
        position: "absolute",
        ...e
      },
      onContextMenu: (a) => a.preventDefault(),
      ref: (a) => {
        if (!a)
          return;
        const f = {
          data: r,
          style: n,
          position: e,
          ref: {
            isInViewport: !1,
            rect: {
              top: a.offsetTop,
              left: a.offsetLeft,
              width: n.width,
              height: n.height,
              offsetTop: a.offsetTop,
              offsetLeft: a.offsetLeft
            }
          }
        };
        t.DOMManager.DOMRefs.set(A.id, f);
      }
    }
  );
}, l9e = (A, e, t) => {
  const { isInViewport: r, ...n } = xwe(A, e, t);
  return r ? A.type === "container" ? /* @__PURE__ */ mi.jsx(
    qwe,
    {
      data: A,
      position: n,
      manager: e
    },
    A.id
  ) : /* @__PURE__ */ mi.jsx(
    Xwe,
    {
      data: A,
      position: n,
      manager: e
    },
    A.id
  ) : /* @__PURE__ */ mi.jsx(bwe, { data: A, position: n, manager: e }, A.id);
}, DM = (A) => {
  const { width: e, height: t, backgroundColor: r, opacity: n, ...i } = A;
  return i;
}, Gy = (A) => ({
  width: A.width,
  height: A.height,
  backgroundColor: A.backgroundColor,
  opacity: A.opacity
}), xwe = (A, e, t) => {
  var q, b;
  const r = t ? { width: t.width, height: t.height } : {
    width: e.root.engine.getRenderWidth(),
    height: e.root.engine.getRenderHeight()
  }, {
    width: n,
    height: i,
    linkType: s,
    offsetX: a,
    offsetY: f,
    targetId: o,
    x: d,
    y: v,
    z: u,
    alignH: l,
    alignV: P
  } = A, { width: p, height: c } = r, H = {};
  if (s === 0)
    l === 0 ? H.left = a : l === 1 ? H.left = (p - n) / 2 + a : l === 2 && (H.right = -a), P === 0 ? H.top = f : P === 1 ? H.top = (c - i) / 2 + f : P === 2 && (H.bottom = -f);
  else if (s === 1 || s === 2) {
    let j, w = 0, m = 0;
    s === 1 ? j = (b = (q = e.getTargetById(o)) == null ? void 0 : q.getAbsolutePosition) == null ? void 0 : b.call(q) : j = new S(d, v, u), j || (j = new S(0, 0, 0));
    const I = i9e(j, e.scene.scene);
    l === 0 ? w = I.x + a : l === 1 ? w = I.x - n / 2 + a : l === 2 && (w = I.x - n + a), P === 0 ? m = I.y + f : P === 1 ? m = I.y - i / 2 + f : P === 2 && (m = I.y - i + f), H.left = w, H.top = m;
  }
  const T = (H.left !== void 0 && H.left > -n && H.left < p || H.right !== void 0 && H.right > -n && H.right < p) && (H.top !== void 0 && H.top > -i && H.top < c || H.bottom !== void 0 && H.bottom > -i && H.bottom < c);
  return { ...H, isInViewport: T };
};
class Ai {
  /**
   * Creates a new ValueAndUnit
   * @param value defines the value to store
   * @param unit defines the unit to store - defaults to ValueAndUnit.UNITMODE_PIXEL
   * @param negativeValueAllowed defines a boolean indicating if the value can be negative
   */
  constructor(e, t = Ai.UNITMODE_PIXEL, r = !0) {
    this.negativeValueAllowed = r, this._value = 1, this._unit = Ai.UNITMODE_PIXEL, this.ignoreAdaptiveScaling = !1, this.onChangedObservable = new Oe(), this._value = e, this._unit = t, this._originalUnit = t;
  }
  /** Gets a boolean indicating if the value is a percentage */
  get isPercentage() {
    return this._unit === Ai.UNITMODE_PERCENTAGE;
  }
  /** Gets a boolean indicating if the value is store as pixel */
  get isPixel() {
    return this._unit === Ai.UNITMODE_PIXEL;
  }
  /**
   * Gets value (without units)
   * @deprecated use value property instead
   */
  get internalValue() {
    return this._value;
  }
  /** Gets value (without units) */
  get value() {
    return this._value;
  }
  /** Sets value (without units) */
  set value(e) {
    e !== this._value && (this._value = e, this.onChangedObservable.notifyObservers());
  }
  /** Gets units (without value) */
  get unit() {
    return this._unit;
  }
  /** Sets units (without value) */
  set unit(e) {
    e !== this._unit && (this._unit = e, this.onChangedObservable.notifyObservers());
  }
  /**
   * Gets value as pixel
   * @param host defines the root host
   * @param refValue defines the reference value for percentages
   * @returns the value as pixel
   */
  getValueInPixel(e, t) {
    return this.isPixel ? this.getValue(e) : this.getValue(e) * t;
  }
  /**
   * Update the current value and unit.
   * @param value defines the value to store
   * @param unit defines the unit to store
   * @returns the current ValueAndUnit
   */
  updateInPlace(e, t = Ai.UNITMODE_PIXEL) {
    return (this.value !== e || this.unit !== t) && (this._value = e, this._unit = t, this.onChangedObservable.notifyObservers()), this;
  }
  /**
   * Gets the value accordingly to its unit
   * @param host  defines the root host
   * @returns the value
   */
  getValue(e) {
    if (e && !this.ignoreAdaptiveScaling && this.unit !== Ai.UNITMODE_PERCENTAGE) {
      let t = 0, r = 0;
      if (e.idealWidth && (t = Math.ceil(this._value * e.getSize().width / e.idealWidth)), e.idealHeight && (r = Math.ceil(this._value * e.getSize().height / e.idealHeight)), e.useSmallestIdeal && e.idealWidth && e.idealHeight)
        return window.innerWidth < window.innerHeight ? t : r;
      if (e.idealWidth)
        return t;
      if (e.idealHeight)
        return r;
    }
    return this._value;
  }
  /**
   * Gets a string representation of the value
   * @param host defines the root host
   * @param decimals defines an optional number of decimals to display
   * @returns a string
   */
  toString(e, t) {
    switch (this._unit) {
      case Ai.UNITMODE_PERCENTAGE: {
        const r = this.getValue(e) * 100;
        return (t ? r.toFixed(t) : r) + "%";
      }
      case Ai.UNITMODE_PIXEL: {
        const r = this.getValue(e);
        return (t ? r.toFixed(t) : r) + "px";
      }
    }
    return this._unit.toString();
  }
  /**
   * Store a value parsed from a string
   * @param source defines the source string
   * @returns true if the value was successfully parsed and updated
   */
  fromString(e) {
    const t = Ai._Regex.exec(e.toString());
    if (!t || t.length === 0)
      return !1;
    let r = parseFloat(t[1]), n = this._originalUnit;
    if (this.negativeValueAllowed || r < 0 && (r = 0), t.length === 4)
      switch (t[3]) {
        case "px":
          n = Ai.UNITMODE_PIXEL;
          break;
        case "%":
          n = Ai.UNITMODE_PERCENTAGE, r /= 100;
          break;
      }
    return r === this._value && n === this._unit ? !1 : (this._value = r, this._unit = n, this.onChangedObservable.notifyObservers(), !0);
  }
  /** UNITMODE_PERCENTAGE */
  static get UNITMODE_PERCENTAGE() {
    return Ai._UNITMODE_PERCENTAGE;
  }
  /** UNITMODE_PIXEL */
  static get UNITMODE_PIXEL() {
    return Ai._UNITMODE_PIXEL;
  }
}
Ai._Regex = /(^-?\d*(\.\d+)?)(%|px)?/;
Ai._UNITMODE_PERCENTAGE = 0;
Ai._UNITMODE_PIXEL = 1;
const OW = [new at(0, 0), new at(0, 0), new at(0, 0), new at(0, 0)], cI = [new at(0, 0), new at(0, 0), new at(0, 0), new at(0, 0)], Y8 = new at(0, 0), Ew = new at(0, 0);
class b6 {
  /**
   * Creates a new measure
   * @param left defines left coordinate
   * @param top defines top coordinate
   * @param width defines width dimension
   * @param height defines height dimension
   */
  constructor(e, t, r, n) {
    this.left = e, this.top = t, this.width = r, this.height = n;
  }
  /**
   * Copy from another measure
   * @param other defines the other measure to copy from
   */
  copyFrom(e) {
    this.left = e.left, this.top = e.top, this.width = e.width, this.height = e.height;
  }
  /**
   * Copy from a group of 4 floats
   * @param left defines left coordinate
   * @param top defines top coordinate
   * @param width defines width dimension
   * @param height defines height dimension
   */
  copyFromFloats(e, t, r, n) {
    this.left = e, this.top = t, this.width = r, this.height = n;
  }
  /**
   * Computes the axis aligned bounding box measure for two given measures
   * @param a Input measure
   * @param b Input measure
   * @param result the resulting bounding measure
   */
  static CombineToRef(e, t, r) {
    const n = Math.min(e.left, t.left), i = Math.min(e.top, t.top), s = Math.max(e.left + e.width, t.left + t.width), a = Math.max(e.top + e.height, t.top + t.height);
    r.left = n, r.top = i, r.width = s - n, r.height = a - i;
  }
  /**
   * Computes the axis aligned bounding box of the measure after it is modified by a given transform
   * @param transform the matrix to transform the measure before computing the AABB
   * @param addX number to add to left
   * @param addY number to add to top
   * @param addWidth number to add to width
   * @param addHeight number to add to height
   * @param result the resulting AABB
   */
  addAndTransformToRef(e, t, r, n, i, s) {
    const a = this.left + t, f = this.top + r, o = this.width + n, d = this.height + i;
    OW[0].copyFromFloats(a, f), OW[1].copyFromFloats(a + o, f), OW[2].copyFromFloats(a + o, f + d), OW[3].copyFromFloats(a, f + d), Y8.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE), Ew.copyFromFloats(0, 0);
    for (let v = 0; v < 4; v++)
      e.transformCoordinates(OW[v].x, OW[v].y, cI[v]), Y8.x = Math.floor(Math.min(Y8.x, cI[v].x)), Y8.y = Math.floor(Math.min(Y8.y, cI[v].y)), Ew.x = Math.ceil(Math.max(Ew.x, cI[v].x)), Ew.y = Math.ceil(Math.max(Ew.y, cI[v].y));
    s.left = Y8.x, s.top = Y8.y, s.width = Ew.x - Y8.x, s.height = Ew.y - Y8.y;
  }
  /**
   * Computes the axis aligned bounding box of the measure after it is modified by a given transform
   * @param transform the matrix to transform the measure before computing the AABB
   * @param result the resulting AABB
   */
  transformToRef(e, t) {
    this.addAndTransformToRef(e, 0, 0, 0, 0, t);
  }
  /**
   * Check equality between this measure and another one
   * @param other defines the other measures
   * @returns true if both measures are equals
   */
  isEqualsTo(e) {
    return !(this.left !== e.left || this.top !== e.top || this.width !== e.width || this.height !== e.height);
  }
  /**
   * Creates an empty measure
   * @returns a new measure
   */
  static Empty() {
    return new b6(0, 0, 0, 0);
  }
}
class k5 extends at {
  /**
   * Creates a new Vector2WithInfo
   * @param source defines the vector2 data to transport
   * @param buttonIndex defines the current mouse button index
   */
  constructor(e, t = 0) {
    super(e.x, e.y), this.buttonIndex = t;
  }
}
class Js {
  /**
   * Creates a new matrix
   * @param m00 defines value for (0, 0)
   * @param m01 defines value for (0, 1)
   * @param m10 defines value for (1, 0)
   * @param m11 defines value for (1, 1)
   * @param m20 defines value for (2, 0)
   * @param m21 defines value for (2, 1)
   */
  constructor(e, t, r, n, i, s) {
    this.m = new Float32Array(6), this.fromValues(e, t, r, n, i, s);
  }
  /**
   * Fills the matrix from direct values
   * @param m00 defines value for (0, 0)
   * @param m01 defines value for (0, 1)
   * @param m10 defines value for (1, 0)
   * @param m11 defines value for (1, 1)
   * @param m20 defines value for (2, 0)
   * @param m21 defines value for (2, 1)
   * @returns the current modified matrix
   */
  fromValues(e, t, r, n, i, s) {
    return this.m[0] = e, this.m[1] = t, this.m[2] = r, this.m[3] = n, this.m[4] = i, this.m[5] = s, this;
  }
  /**
   * Gets matrix determinant
   * @returns the determinant
   */
  determinant() {
    return this.m[0] * this.m[3] - this.m[1] * this.m[2];
  }
  /**
   * Inverses the matrix and stores it in a target matrix
   * @param result defines the target matrix
   * @returns the current matrix
   */
  invertToRef(e) {
    const t = this.m[0], r = this.m[1], n = this.m[2], i = this.m[3], s = this.m[4], a = this.m[5], f = this.determinant();
    if (f < Dn * Dn)
      return e.m[0] = 0, e.m[1] = 0, e.m[2] = 0, e.m[3] = 0, e.m[4] = 0, e.m[5] = 0, this;
    const o = 1 / f, d = n * a - i * s, v = r * s - t * a;
    return e.m[0] = i * o, e.m[1] = -r * o, e.m[2] = -n * o, e.m[3] = t * o, e.m[4] = d * o, e.m[5] = v * o, this;
  }
  /**
   * Multiplies the current matrix with another one
   * @param other defines the second operand
   * @param result defines the target matrix
   * @returns the current matrix
   */
  multiplyToRef(e, t) {
    const r = this.m[0], n = this.m[1], i = this.m[2], s = this.m[3], a = this.m[4], f = this.m[5], o = e.m[0], d = e.m[1], v = e.m[2], u = e.m[3], l = e.m[4], P = e.m[5];
    return t.m[0] = r * o + n * v, t.m[1] = r * d + n * u, t.m[2] = i * o + s * v, t.m[3] = i * d + s * u, t.m[4] = a * o + f * v + l, t.m[5] = a * d + f * u + P, this;
  }
  /**
   * Applies the current matrix to a set of 2 floats and stores the result in a vector2
   * @param x defines the x coordinate to transform
   * @param y defines the x coordinate to transform
   * @param result defines the target vector2
   * @returns the current matrix
   */
  transformCoordinates(e, t, r) {
    return r.x = e * this.m[0] + t * this.m[2] + this.m[4], r.y = e * this.m[1] + t * this.m[3] + this.m[5], this;
  }
  // Statics
  /**
   * Creates an identity matrix
   * @returns a new matrix
   */
  static Identity() {
    return new Js(1, 0, 0, 1, 0, 0);
  }
  /**
   * Creates an identity matrix and stores it in a target matrix
   * @param result defines the target matrix
   */
  static IdentityToRef(e) {
    e.m[0] = 1, e.m[1] = 0, e.m[2] = 0, e.m[3] = 1, e.m[4] = 0, e.m[5] = 0;
  }
  /**
   * Creates a translation matrix and stores it in a target matrix
   * @param x defines the x coordinate of the translation
   * @param y defines the y coordinate of the translation
   * @param result defines the target matrix
   */
  static TranslationToRef(e, t, r) {
    r.fromValues(1, 0, 0, 1, e, t);
  }
  /**
   * Creates a scaling matrix and stores it in a target matrix
   * @param x defines the x coordinate of the scaling
   * @param y defines the y coordinate of the scaling
   * @param result defines the target matrix
   */
  static ScalingToRef(e, t, r) {
    r.fromValues(e, 0, 0, t, 0, 0);
  }
  /**
   * Creates a rotation matrix and stores it in a target matrix
   * @param angle defines the rotation angle
   * @param result defines the target matrix
   */
  static RotationToRef(e, t) {
    const r = Math.sin(e), n = Math.cos(e);
    t.fromValues(n, r, -r, n, 0, 0);
  }
  /**
   * Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix
   * @param tx defines the x coordinate of the translation
   * @param ty defines the y coordinate of the translation
   * @param angle defines the rotation angle
   * @param scaleX defines the x coordinate of the scaling
   * @param scaleY defines the y coordinate of the scaling
   * @param parentMatrix defines the parent matrix to multiply by (can be null)
   * @param result defines the target matrix
   */
  static ComposeToRef(e, t, r, n, i, s, a) {
    Js.TranslationToRef(e, t, Js._TempPreTranslationMatrix), Js.ScalingToRef(n, i, Js._TempScalingMatrix), Js.RotationToRef(r, Js._TempRotationMatrix), Js.TranslationToRef(-e, -t, Js._TempPostTranslationMatrix), Js._TempPreTranslationMatrix.multiplyToRef(Js._TempScalingMatrix, Js._TempCompose0), Js._TempCompose0.multiplyToRef(Js._TempRotationMatrix, Js._TempCompose1), s ? (Js._TempCompose1.multiplyToRef(Js._TempPostTranslationMatrix, Js._TempCompose2), Js._TempCompose2.multiplyToRef(s, a)) : Js._TempCompose1.multiplyToRef(Js._TempPostTranslationMatrix, a);
  }
}
Js._TempPreTranslationMatrix = Js.Identity();
Js._TempPostTranslationMatrix = Js.Identity();
Js._TempRotationMatrix = Js.Identity();
Js._TempScalingMatrix = Js.Identity();
Js._TempCompose0 = Js.Identity();
Js._TempCompose1 = Js.Identity();
Js._TempCompose2 = Js.Identity();
class St {
  /**
   * Gets or sets a boolean indicating if the control is readonly (default: false).
   * A readonly control will still raise pointer events but will not react to them
   */
  get isReadOnly() {
    return this._isReadOnly;
  }
  set isReadOnly(e) {
    this._isReadOnly = e;
  }
  /**
   * Gets the transformed measure, that is the bounding box of the control after applying all transformations
   */
  get transformedMeasure() {
    return this._evaluatedMeasure;
  }
  /**
   * Sets/Gets a boolean indicating if the children are clipped to the current control bounds.
   * Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children
   */
  set clipChildren(e) {
    this._clipChildren = e;
  }
  get clipChildren() {
    return this._clipChildren;
  }
  /**
   * Sets/Gets a boolean indicating that control content must be clipped
   * Please note that not clipping content may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children
   */
  set clipContent(e) {
    this._clipContent = e;
  }
  get clipContent() {
    return this._clipContent;
  }
  /** Gets or sets a value indicating the offset to apply on X axis to render the shadow */
  get shadowOffsetX() {
    return this._shadowOffsetX;
  }
  set shadowOffsetX(e) {
    this._shadowOffsetX !== e && (this._shadowOffsetX = e, this._markAsDirty());
  }
  /** Gets or sets a value indicating the offset to apply on Y axis to render the shadow */
  get shadowOffsetY() {
    return this._shadowOffsetY;
  }
  set shadowOffsetY(e) {
    this._shadowOffsetY !== e && (this._shadowOffsetY = e, this._markAsDirty());
  }
  /** Gets or sets a value indicating the amount of blur to use to render the shadow */
  get shadowBlur() {
    return this._shadowBlur;
  }
  set shadowBlur(e) {
    this._shadowBlur !== e && (this._previousShadowBlur = this._shadowBlur, this._shadowBlur = e, this._markAsDirty());
  }
  /** Gets or sets a value indicating the color of the shadow (black by default ie. "#000") */
  get shadowColor() {
    return this._shadowColor;
  }
  set shadowColor(e) {
    this._shadowColor !== e && (this._shadowColor = e, this._markAsDirty());
  }
  // Properties
  /** Gets the control type name */
  get typeName() {
    return this._getTypeName();
  }
  /**
   * Get the current class name of the control.
   * @returns current class name
   */
  getClassName() {
    return this._getTypeName();
  }
  /**
   * Gets or sets the accessibility tag to describe the control for accessibility purpose.
   * By default, GUI controls already indicate accessibility info, but one can override the info using this tag.
   */
  set accessibilityTag(e) {
    this._accessibilityTag = e, this.onAccessibilityTagChangedObservable.notifyObservers(e);
  }
  get accessibilityTag() {
    return this._accessibilityTag;
  }
  /**
   * Get the hosting AdvancedDynamicTexture
   */
  get host() {
    return this._host;
  }
  /** Gets or set information about font offsets (used to render and align text) */
  get fontOffset() {
    return this._fontOffset;
  }
  set fontOffset(e) {
    this._fontOffset = e;
  }
  /** Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent) */
  get alpha() {
    return this._alpha;
  }
  set alpha(e) {
    this._alpha !== e && (this._alphaSet = !0, this._alpha = e, this._markAsDirty());
  }
  /**
   * Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)
   */
  get highlightLineWidth() {
    return this._highlightLineWidth;
  }
  set highlightLineWidth(e) {
    this._highlightLineWidth !== e && (this._highlightLineWidth = e, this._markAsDirty());
  }
  /**
   * Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)
   */
  get isHighlighted() {
    return this._isHighlighted;
  }
  set isHighlighted(e) {
    this._isHighlighted !== e && (this._isHighlighted = e, this._markAsDirty());
  }
  /**
   * Gets or sets a string defining the color to use for highlighting this control
   */
  get highlightColor() {
    return this._highlightColor;
  }
  set highlightColor(e) {
    this._highlightColor !== e && (this._highlightColor = e, this._markAsDirty());
  }
  /** Gets or sets a value indicating the scale factor on X axis (1 by default)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling
   */
  get scaleX() {
    return this._scaleX;
  }
  set scaleX(e) {
    this._scaleX !== e && (this._scaleX = e, this._markAsDirty(), this._markMatrixAsDirty());
  }
  /** Gets or sets a value indicating the scale factor on Y axis (1 by default)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling
   */
  get scaleY() {
    return this._scaleY;
  }
  set scaleY(e) {
    this._scaleY !== e && (this._scaleY = e, this._markAsDirty(), this._markMatrixAsDirty());
  }
  /** Gets or sets the rotation angle (0 by default)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling
   */
  get rotation() {
    return this._rotation;
  }
  set rotation(e) {
    this._rotation !== e && (this._rotation = e, this._markAsDirty(), this._markMatrixAsDirty());
  }
  /** Gets or sets the transformation center on Y axis (0 by default)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling
   */
  get transformCenterY() {
    return this._transformCenterY;
  }
  set transformCenterY(e) {
    this._transformCenterY !== e && (this._transformCenterY = e, this._markAsDirty(), this._markMatrixAsDirty());
  }
  /** Gets or sets the transformation center on X axis (0 by default)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling
   */
  get transformCenterX() {
    return this._transformCenterX;
  }
  set transformCenterX(e) {
    this._transformCenterX !== e && (this._transformCenterX = e, this._markAsDirty(), this._markMatrixAsDirty());
  }
  /**
   * Gets or sets the horizontal alignment
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#alignments
   */
  get horizontalAlignment() {
    return this._horizontalAlignment;
  }
  set horizontalAlignment(e) {
    this._horizontalAlignment !== e && (this._horizontalAlignment = e, this._markAsDirty());
  }
  /**
   * Gets or sets the vertical alignment
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#alignments
   */
  get verticalAlignment() {
    return this._verticalAlignment;
  }
  set verticalAlignment(e) {
    this._verticalAlignment !== e && (this._verticalAlignment = e, this._markAsDirty());
  }
  set fixedRatio(e) {
    this._fixedRatio !== e && (this._fixedRatio = e, this._markAsDirty());
  }
  /**
   * Gets or sets a fixed ratio for this control.
   * When different from 0, the ratio is used to compute the "second" dimension.
   * The first dimension used in the computation is the last one set (by setting width / widthInPixels or height / heightInPixels), and the
   * second dimension is computed as first dimension * fixedRatio
   */
  get fixedRatio() {
    return this._fixedRatio;
  }
  set fixedRatioMasterIsWidth(e) {
    this._fixedRatioMasterIsWidth !== e && (this._fixedRatioMasterIsWidth = e, this._markAsDirty());
  }
  /**
   * Gets or sets a boolean indicating that the fixed ratio is set on the width instead of the height. True by default.
   * When the height of a control is set, this property is changed to false.
   */
  get fixedRatioMasterIsWidth() {
    return this._fixedRatioMasterIsWidth;
  }
  /**
   * Gets or sets control width
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get width() {
    return this._width.toString(this._host);
  }
  set width(e) {
    this._fixedRatioMasterIsWidth = !0, this._width.toString(this._host) !== e && this._width.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets the control width in pixel
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get widthInPixels() {
    return this._width.getValueInPixel(this._host, this._cachedParentMeasure.width);
  }
  set widthInPixels(e) {
    isNaN(e) || (this._fixedRatioMasterIsWidth = !0, this.width = e + "px");
  }
  /**
   * Gets or sets control height
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get height() {
    return this._height.toString(this._host);
  }
  set height(e) {
    this._fixedRatioMasterIsWidth = !1, this._height.toString(this._host) !== e && this._height.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets control height in pixel
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get heightInPixels() {
    return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
  }
  set heightInPixels(e) {
    isNaN(e) || (this._fixedRatioMasterIsWidth = !1, this.height = e + "px");
  }
  /** Gets or set font family */
  get fontFamily() {
    return this._fontFamily;
  }
  set fontFamily(e) {
    this._fontFamily !== e && (this._fontFamily = e, this._resetFontCache());
  }
  /** Gets or sets font style */
  get fontStyle() {
    return this._fontStyle;
  }
  set fontStyle(e) {
    this._fontStyle !== e && (this._fontStyle = e, this._resetFontCache());
  }
  /** Gets or sets font weight */
  get fontWeight() {
    return this._fontWeight;
  }
  set fontWeight(e) {
    this._fontWeight !== e && (this._fontWeight = e, this._resetFontCache());
  }
  /**
   * Gets or sets style
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#styles
   */
  get style() {
    return this._style;
  }
  set style(e) {
    this._style && (this._style.onChangedObservable.remove(this._styleObserver), this._styleObserver = null), this._style = e, this._style && (this._styleObserver = this._style.onChangedObservable.add(() => {
      this._markAsDirty(), this._resetFontCache();
    })), this._markAsDirty(), this._resetFontCache();
  }
  /** @internal */
  get _isFontSizeInPercentage() {
    return this._fontSize.isPercentage;
  }
  /** Gets or sets font size in pixels */
  get fontSizeInPixels() {
    const e = this._style ? this._style._fontSize : this._fontSize;
    return e.isPixel ? e.getValue(this._host) : e.getValueInPixel(this._host, this._tempParentMeasure.height || this._cachedParentMeasure.height);
  }
  set fontSizeInPixels(e) {
    isNaN(e) || (this.fontSize = e + "px");
  }
  /** Gets or sets font size */
  get fontSize() {
    return this._fontSize.toString(this._host);
  }
  set fontSize(e) {
    this._fontSize.toString(this._host) !== e && this._fontSize.fromString(e) && (this._markAsDirty(), this._resetFontCache());
  }
  /** Gets or sets foreground color */
  get color() {
    return this._color;
  }
  set color(e) {
    this._color !== e && (this._color = e, this._markAsDirty());
  }
  /** Gets or sets gradient. Setting a gradient will override the color */
  get gradient() {
    return this._gradient;
  }
  set gradient(e) {
    this._gradient !== e && (this._gradient = e, this._markAsDirty());
  }
  /** Gets or sets z index which is used to reorder controls on the z axis */
  get zIndex() {
    return this._zIndex;
  }
  set zIndex(e) {
    this.zIndex !== e && (this._zIndex = e, this.parent && this.parent._reOrderControl(this));
  }
  /** Gets or sets a boolean indicating if the control can be rendered */
  get notRenderable() {
    return this._doNotRender;
  }
  set notRenderable(e) {
    this._doNotRender !== e && (this._doNotRender = e, this._markAsDirty());
  }
  /** Gets or sets a boolean indicating if the control is visible */
  get isVisible() {
    return this._isVisible;
  }
  set isVisible(e) {
    this._isVisible !== e && (this._isVisible = e, this._markAsDirty(!0), this.onIsVisibleChangedObservable.notifyObservers(e));
  }
  /** Gets a boolean indicating that the control needs to update its rendering */
  get isDirty() {
    return this._isDirty;
  }
  /**
   * Gets the current linked mesh (or null if none)
   */
  get linkedMesh() {
    return this._linkedMesh;
  }
  /**
   * Gets or sets a value indicating the padding should work like in CSS.
   * Basically, it will add the padding amount on each side of the parent control for its children.
   */
  get descendantsOnlyPadding() {
    return this._descendantsOnlyPadding;
  }
  set descendantsOnlyPadding(e) {
    this._descendantsOnlyPadding !== e && (this._descendantsOnlyPadding = e, this._markAsDirty());
  }
  /**
   * Gets or sets a value indicating the padding to use on the left of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get paddingLeft() {
    return this._paddingLeft.toString(this._host);
  }
  set paddingLeft(e) {
    this._paddingLeft.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets a value indicating the padding in pixels to use on the left of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get paddingLeftInPixels() {
    return this._paddingLeft.getValueInPixel(this._host, this._cachedParentMeasure.width);
  }
  set paddingLeftInPixels(e) {
    isNaN(e) || (this.paddingLeft = e + "px");
  }
  /** @internal */
  get _paddingLeftInPixels() {
    return this._descendantsOnlyPadding ? 0 : this.paddingLeftInPixels;
  }
  /**
   * Gets or sets a value indicating the padding to use on the right of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get paddingRight() {
    return this._paddingRight.toString(this._host);
  }
  set paddingRight(e) {
    this._paddingRight.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets a value indicating the padding in pixels to use on the right of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get paddingRightInPixels() {
    return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width);
  }
  set paddingRightInPixels(e) {
    isNaN(e) || (this.paddingRight = e + "px");
  }
  /** @internal */
  get _paddingRightInPixels() {
    return this._descendantsOnlyPadding ? 0 : this.paddingRightInPixels;
  }
  /**
   * Gets or sets a value indicating the padding to use on the top of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get paddingTop() {
    return this._paddingTop.toString(this._host);
  }
  set paddingTop(e) {
    this._paddingTop.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets a value indicating the padding in pixels to use on the top of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get paddingTopInPixels() {
    return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height);
  }
  set paddingTopInPixels(e) {
    isNaN(e) || (this.paddingTop = e + "px");
  }
  /** @internal */
  get _paddingTopInPixels() {
    return this._descendantsOnlyPadding ? 0 : this.paddingTopInPixels;
  }
  /**
   * Gets or sets a value indicating the padding to use on the bottom of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get paddingBottom() {
    return this._paddingBottom.toString(this._host);
  }
  set paddingBottom(e) {
    this._paddingBottom.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets a value indicating the padding in pixels to use on the bottom of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get paddingBottomInPixels() {
    return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height);
  }
  set paddingBottomInPixels(e) {
    isNaN(e) || (this.paddingBottom = e + "px");
  }
  /** @internal */
  get _paddingBottomInPixels() {
    return this._descendantsOnlyPadding ? 0 : this.paddingBottomInPixels;
  }
  /**
   * Gets or sets a value indicating the left coordinate of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get left() {
    return this._left.toString(this._host);
  }
  set left(e) {
    this._left.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets a value indicating the left coordinate in pixels of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get leftInPixels() {
    return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width);
  }
  set leftInPixels(e) {
    isNaN(e) || (this.left = e + "px");
  }
  /**
   * Gets or sets a value indicating the top coordinate of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get top() {
    return this._top.toString(this._host);
  }
  set top(e) {
    this._top.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets a value indicating the top coordinate in pixels of the control
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get topInPixels() {
    return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height);
  }
  set topInPixels(e) {
    isNaN(e) || (this.top = e + "px");
  }
  /**
   * Gets or sets a value indicating the offset on X axis to the linked mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions
   */
  get linkOffsetX() {
    return this._linkOffsetX.toString(this._host);
  }
  set linkOffsetX(e) {
    this._linkOffsetX.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets a value indicating the offset in pixels on X axis to the linked mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions
   */
  get linkOffsetXInPixels() {
    return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width);
  }
  set linkOffsetXInPixels(e) {
    isNaN(e) || (this.linkOffsetX = e + "px");
  }
  /**
   * Gets or sets a value indicating the offset on Y axis to the linked mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions
   */
  get linkOffsetY() {
    return this._linkOffsetY.toString(this._host);
  }
  set linkOffsetY(e) {
    this._linkOffsetY.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions
   */
  get linkOffsetYInPixels() {
    return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height);
  }
  set linkOffsetYInPixels(e) {
    isNaN(e) || (this.linkOffsetY = e + "px");
  }
  /** Gets the center coordinate on X axis */
  get centerX() {
    return this._currentMeasure.left + this._currentMeasure.width / 2;
  }
  /** Gets the center coordinate on Y axis */
  get centerY() {
    return this._currentMeasure.top + this._currentMeasure.height / 2;
  }
  /** Gets or sets if control is Enabled */
  get isEnabled() {
    return this._isEnabled;
  }
  set isEnabled(e) {
    if (this._isEnabled === e)
      return;
    this._isEnabled = e, this._markAsDirty();
    const t = (r) => {
      if (r.host) {
        for (const n in r.host._lastControlOver)
          r === this.host._lastControlOver[n] && (r._onPointerOut(r, null, !0), delete r.host._lastControlOver[n]);
        r.children !== void 0 && r.children.forEach(t);
      }
    };
    t(this), this.onEnabledStateChangedObservable.notifyObservers(e);
  }
  /** Gets or sets background color of control if it's disabled. Only applies to Button class. */
  get disabledColor() {
    return this._disabledColor;
  }
  set disabledColor(e) {
    this._disabledColor !== e && (this._disabledColor = e, this._markAsDirty());
  }
  /** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */
  get disabledColorItem() {
    return this._disabledColorItem;
  }
  set disabledColorItem(e) {
    this._disabledColorItem !== e && (this._disabledColorItem = e, this._markAsDirty());
  }
  // Functions
  /**
   * Creates a new control
   * @param name defines the name of the control
   */
  constructor(e) {
    this.name = e, this._alpha = 1, this._alphaSet = !1, this._zIndex = 0, this._currentMeasure = b6.Empty(), this._tempPaddingMeasure = b6.Empty(), this._fontFamily = "", this._fontStyle = "", this._fontWeight = "", this._fontSize = new Ai(18, Ai.UNITMODE_PIXEL, !1), this._width = new Ai(1, Ai.UNITMODE_PERCENTAGE, !1), this._height = new Ai(1, Ai.UNITMODE_PERCENTAGE, !1), this._color = "", this._style = null, this._horizontalAlignment = St.HORIZONTAL_ALIGNMENT_CENTER, this._verticalAlignment = St.VERTICAL_ALIGNMENT_CENTER, this._isDirty = !0, this._wasDirty = !1, this._tempParentMeasure = b6.Empty(), this._prevCurrentMeasureTransformedIntoGlobalSpace = b6.Empty(), this._cachedParentMeasure = b6.Empty(), this._descendantsOnlyPadding = !1, this._paddingLeft = new Ai(0), this._paddingRight = new Ai(0), this._paddingTop = new Ai(0), this._paddingBottom = new Ai(0), this._left = new Ai(0), this._top = new Ai(0), this._scaleX = 1, this._scaleY = 1, this._rotation = 0, this._transformCenterX = 0.5, this._transformCenterY = 0.5, this._transformMatrix = Js.Identity(), this._invertTransformMatrix = Js.Identity(), this._transformedPosition = at.Zero(), this._isMatrixDirty = !0, this._isVisible = !0, this._isHighlighted = !1, this._highlightColor = "#4affff", this._highlightLineWidth = 2, this._fontSet = !1, this._dummyVector2 = at.Zero(), this._downCount = 0, this._enterCount = -1, this._doNotRender = !1, this._downPointerIds = {}, this._evaluatedMeasure = new b6(0, 0, 0, 0), this._evaluatedParentMeasure = new b6(0, 0, 0, 0), this._isEnabled = !0, this._disabledColor = "#9a9a9a", this._disabledColorItem = "#6a6a6a", this._isReadOnly = !1, this._gradient = null, this._rebuildLayout = !1, this.onEnabledStateChangedObservable = new Oe(), this._customData = {}, this._isClipped = !1, this._automaticSize = !1, this.metadata = null, this.isHitTestVisible = !0, this.isPointerBlocker = !1, this.isFocusInvisible = !1, this._clipChildren = !0, this._clipContent = !0, this.useBitmapCache = !1, this._shadowOffsetX = 0, this._shadowOffsetY = 0, this._shadowBlur = 0, this._previousShadowBlur = 0, this._shadowColor = "black", this.hoverCursor = "", this._linkOffsetX = new Ai(0), this._linkOffsetY = new Ai(0), this._accessibilityTag = null, this.onAccessibilityTagChangedObservable = new Oe(), this.onWheelObservable = new Oe(), this.onPointerMoveObservable = new Oe(), this.onPointerOutObservable = new Oe(), this.onPointerDownObservable = new Oe(), this.onPointerUpObservable = new Oe(), this.onPointerClickObservable = new Oe(), this.onPointerEnterObservable = new Oe(), this.onDirtyObservable = new Oe(), this.onBeforeDrawObservable = new Oe(), this.onAfterDrawObservable = new Oe(), this.onDisposeObservable = new Oe(), this.onIsVisibleChangedObservable = new Oe(), this._fixedRatio = 0, this._fixedRatioMasterIsWidth = !0, this.animations = null, this._tmpMeasureA = new b6(0, 0, 0, 0);
  }
  /** @internal */
  _getTypeName() {
    return "Control";
  }
  /**
   * Gets the first ascendant in the hierarchy of the given type
   * @param className defines the required type
   * @returns the ascendant or null if not found
   */
  getAscendantOfClass(e) {
    return this.parent ? this.parent.getClassName() === e ? this.parent : this.parent.getAscendantOfClass(e) : null;
  }
  /**
   * Mark control element as dirty
   * @param force force non visible elements to be marked too
   */
  markAsDirty(e = !1) {
    this._markAsDirty(e);
  }
  /**
   * Mark the element and its children as dirty
   */
  markAllAsDirty() {
    this._markAllAsDirty();
  }
  /** @internal */
  _resetFontCache() {
    this._fontSet = !0, this._markAsDirty();
  }
  /**
   * Determines if a container is an ascendant of the current control
   * @param container defines the container to look for
   * @returns true if the container is one of the ascendant of the control
   */
  isAscendant(e) {
    return this.parent ? this.parent === e ? !0 : this.parent.isAscendant(e) : !1;
  }
  /**
   * Gets coordinates in local control space
   * @param globalCoordinates defines the coordinates to transform
   * @returns the new coordinates in local space
   */
  getLocalCoordinates(e) {
    const t = at.Zero();
    return this.getLocalCoordinatesToRef(e, t), t;
  }
  /**
   * Gets coordinates in local control space
   * @param globalCoordinates defines the coordinates to transform
   * @param result defines the target vector2 where to store the result
   * @returns the current control
   */
  getLocalCoordinatesToRef(e, t) {
    return t.x = e.x - this._currentMeasure.left, t.y = e.y - this._currentMeasure.top, this;
  }
  /**
   * Gets coordinates in parent local control space
   * @param globalCoordinates defines the coordinates to transform
   * @returns the new coordinates in parent local space
   */
  getParentLocalCoordinates(e) {
    const t = at.Zero();
    return t.x = e.x - this._cachedParentMeasure.left, t.y = e.y - this._cachedParentMeasure.top, t;
  }
  /**
   * Move the current control to a vector3 position projected onto the screen.
   * @param position defines the target position
   * @param scene defines the hosting scene
   */
  moveToVector3(e, t) {
    if (!this._host || this.parent !== this._host._rootContainer) {
      ye.Error("Cannot move a control to a vector3 if the control is not at root level");
      return;
    }
    this.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, this.verticalAlignment = St.VERTICAL_ALIGNMENT_TOP;
    const r = this._host._getGlobalViewport(), n = S.Project(e, he.IdentityReadOnly, t.getTransformMatrix(), r);
    if (this._moveToProjectedPosition(n), n.z < 0 || n.z > 1) {
      this.notRenderable = !0;
      return;
    }
    this.notRenderable = !1;
  }
  /**
   * Will store all controls that have this control as ascendant in a given array
   * @param results defines the array where to store the descendants
   * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
   * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
   */
  getDescendantsToRef(e, t = !1, r) {
  }
  /**
   * Will return all controls that have this control as ascendant
   * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
   * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
   * @returns all child controls
   */
  getDescendants(e, t) {
    const r = [];
    return this.getDescendantsToRef(r, e, t), r;
  }
  /**
   * Link current control with a target mesh
   * @param mesh defines the mesh to link with
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions
   */
  linkWithMesh(e) {
    if (!this._host || this.parent && this.parent !== this._host._rootContainer) {
      e && ye.Error("Cannot link a control to a mesh if the control is not at root level");
      return;
    }
    const t = this._host._linkedControls.indexOf(this);
    if (t !== -1) {
      this._linkedMesh = e, e || this._host._linkedControls.splice(t, 1);
      return;
    } else if (!e)
      return;
    this.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, this.verticalAlignment = St.VERTICAL_ALIGNMENT_TOP, this._linkedMesh = e, this._host._linkedControls.push(this);
  }
  /**
   * Shorthand function to set the top, right, bottom, and left padding values on the control.
   * @param { string | number} paddingTop - The value of the top padding.
   * @param { string | number} paddingRight - The value of the right padding. If omitted, top is used.
   * @param { string | number} paddingBottom - The value of the bottom padding. If omitted, top is used.
   * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  setPadding(e, t, r, n) {
    const i = e, s = t ?? i, a = r ?? i, f = n ?? s;
    this.paddingTop = i, this.paddingRight = s, this.paddingBottom = a, this.paddingLeft = f;
  }
  /**
   * Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.
   * @param { number} paddingTop - The value in pixels of the top padding.
   * @param { number} paddingRight - The value in pixels of the right padding. If omitted, top is used.
   * @param { number} paddingBottom - The value in pixels of the bottom padding. If omitted, top is used.
   * @param { number} paddingLeft - The value in pixels of the left padding. If omitted, right is used.
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  setPaddingInPixels(e, t, r, n) {
    const i = e, s = t ?? i, a = r ?? i, f = n ?? s;
    this.paddingTopInPixels = i, this.paddingRightInPixels = s, this.paddingBottomInPixels = a, this.paddingLeftInPixels = f;
  }
  /**
   * @internal
   */
  _moveToProjectedPosition(e) {
    var t;
    const r = this._left.getValue(this._host), n = this._top.getValue(this._host), i = (t = this.parent) === null || t === void 0 ? void 0 : t._currentMeasure;
    i && this._processMeasures(i, this._host.getContext());
    let s = e.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2, a = e.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2;
    const f = this._left.ignoreAdaptiveScaling && this._top.ignoreAdaptiveScaling;
    f && (Math.abs(s - r) < 0.5 && (s = r), Math.abs(a - n) < 0.5 && (a = n)), !(!f && r === s && n === a) && (this.left = s + "px", this.top = a + "px", this._left.ignoreAdaptiveScaling = !0, this._top.ignoreAdaptiveScaling = !0, this._markAsDirty());
  }
  /**
   * @internal
   */
  _offsetLeft(e) {
    this._isDirty = !0, this._currentMeasure.left += e;
  }
  /**
   * @internal
   */
  _offsetTop(e) {
    this._isDirty = !0, this._currentMeasure.top += e;
  }
  /** @internal */
  _markMatrixAsDirty() {
    this._isMatrixDirty = !0, this._flagDescendantsAsMatrixDirty();
  }
  /** @internal */
  _flagDescendantsAsMatrixDirty() {
  }
  /**
   * @internal
   */
  _intersectsRect(e, t) {
    return this._transform(t), !(this._evaluatedMeasure.left >= e.left + e.width || this._evaluatedMeasure.top >= e.top + e.height || this._evaluatedMeasure.left + this._evaluatedMeasure.width <= e.left || this._evaluatedMeasure.top + this._evaluatedMeasure.height <= e.top);
  }
  /** @internal */
  _computeAdditionalOffsetX() {
    return 0;
  }
  /** @internal */
  _computeAdditionalOffsetY() {
    return 0;
  }
  /** @internal */
  // eslint-disable-next-line @typescript-eslint/naming-convention
  invalidateRect() {
    if (this._transform(), this.host && this.host.useInvalidateRectOptimization) {
      this._currentMeasure.transformToRef(this._transformMatrix, this._tmpMeasureA), b6.CombineToRef(this._tmpMeasureA, this._prevCurrentMeasureTransformedIntoGlobalSpace, this._tmpMeasureA);
      const e = this.shadowOffsetX, t = this.shadowOffsetY, r = Math.max(this._previousShadowBlur, this.shadowBlur), n = Math.min(Math.min(e, 0) - r * 2, 0), i = Math.max(Math.max(e, 0) + r * 2, 0), s = Math.min(Math.min(t, 0) - r * 2, 0), a = Math.max(Math.max(t, 0) + r * 2, 0), f = this._computeAdditionalOffsetX(), o = this._computeAdditionalOffsetY();
      this.host.invalidateRect(Math.floor(this._tmpMeasureA.left + n - f), Math.floor(this._tmpMeasureA.top + s - o), Math.ceil(this._tmpMeasureA.left + this._tmpMeasureA.width + i + f), Math.ceil(this._tmpMeasureA.top + this._tmpMeasureA.height + a + o));
    }
  }
  /**
   * @internal
   */
  _markAsDirty(e = !1) {
    !this._isVisible && !e || (this._isDirty = !0, this._markMatrixAsDirty(), this._host && this._host.markAsDirty());
  }
  /** @internal */
  _markAllAsDirty() {
    this._markAsDirty(), this._font && this._prepareFont();
  }
  /**
   * @internal
   */
  _link(e) {
    this._host = e, this._host && (this.uniqueId = this._host.getScene().getUniqueId());
  }
  /**
   * @internal
   */
  _transform(e) {
    if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0)
      return;
    const t = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left, r = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top;
    e && (e.translate(t, r), e.rotate(this._rotation), e.scale(this._scaleX, this._scaleY), e.translate(-t, -r)), (this._isMatrixDirty || this._cachedOffsetX !== t || this._cachedOffsetY !== r) && (this._cachedOffsetX = t, this._cachedOffsetY = r, this._isMatrixDirty = !1, this._flagDescendantsAsMatrixDirty(), Js.ComposeToRef(-t, -r, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix), this._transformMatrix.invertToRef(this._invertTransformMatrix), this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure));
  }
  /**
   * @internal
   */
  _renderHighlight(e) {
    this.isHighlighted && (e.save(), e.strokeStyle = this._highlightColor, e.lineWidth = this._highlightLineWidth, this._renderHighlightSpecific(e), e.restore());
  }
  /**
   * @internal
   */
  _renderHighlightSpecific(e) {
    e.strokeRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
  }
  _getColor(e) {
    return this.gradient ? this.gradient.getCanvasGradient(e) : this.color;
  }
  /**
   * @internal
   */
  _applyStates(e) {
    this._isFontSizeInPercentage && (this._fontSet = !0), this._host && this._host.useSmallestIdeal && !this._font && (this._fontSet = !0), this._fontSet && (this._prepareFont(), this._fontSet = !1), this._font && (e.font = this._font), (this._color || this.gradient) && (e.fillStyle = this._getColor(e)), St.AllowAlphaInheritance ? e.globalAlpha *= this._alpha : this._alphaSet && (e.globalAlpha = this.parent && !this.parent.renderToIntermediateTexture ? this.parent.alpha * this._alpha : this._alpha);
  }
  /**
   * @internal
   */
  _layout(e, t) {
    if (!this.isDirty && (!this.isVisible || this.notRenderable))
      return !1;
    if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(e)) {
      this.host._numLayoutCalls++, this._currentMeasure.addAndTransformToRef(this._transformMatrix, -this._paddingLeftInPixels | 0, -this._paddingTopInPixels | 0, this._paddingRightInPixels | 0, this._paddingBottomInPixels | 0, this._prevCurrentMeasureTransformedIntoGlobalSpace), t.save(), this._applyStates(t);
      let r = 0;
      do
        this._rebuildLayout = !1, this._processMeasures(e, t), r++;
      while (this._rebuildLayout && r < 3);
      r >= 3 && Se.Error(`Layout cycle detected in GUI (Control name=${this.name}, uniqueId=${this.uniqueId})`), t.restore(), this.invalidateRect(), this._evaluateClippingState(e);
    }
    return this._wasDirty = this._isDirty, this._isDirty = !1, !0;
  }
  /**
   * @internal
   */
  _processMeasures(e, t) {
    this._tempPaddingMeasure.copyFrom(e), this.parent && this.parent.descendantsOnlyPadding && (this._tempPaddingMeasure.left += this.parent.paddingLeftInPixels, this._tempPaddingMeasure.top += this.parent.paddingTopInPixels, this._tempPaddingMeasure.width -= this.parent.paddingLeftInPixels + this.parent.paddingRightInPixels, this._tempPaddingMeasure.height -= this.parent.paddingTopInPixels + this.parent.paddingBottomInPixels), this._currentMeasure.copyFrom(this._tempPaddingMeasure), this._preMeasure(this._tempPaddingMeasure, t), this._measure(), this._postMeasure(this._tempPaddingMeasure, t), this._computeAlignment(this._tempPaddingMeasure, t), this._currentMeasure.left = this._currentMeasure.left | 0, this._currentMeasure.top = this._currentMeasure.top | 0, this._currentMeasure.width = this._currentMeasure.width | 0, this._currentMeasure.height = this._currentMeasure.height | 0, this._additionalProcessing(this._tempPaddingMeasure, t), this._cachedParentMeasure.copyFrom(this._tempPaddingMeasure), this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure), this.onDirtyObservable.hasObservers() && this.onDirtyObservable.notifyObservers(this);
  }
  _evaluateClippingState(e) {
    if (this._transform(), this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure), this.parent && this.parent.clipChildren) {
      if (e.transformToRef(this.parent._transformMatrix, this._evaluatedParentMeasure), this._evaluatedMeasure.left > this._evaluatedParentMeasure.left + this._evaluatedParentMeasure.width) {
        this._isClipped = !0;
        return;
      }
      if (this._evaluatedMeasure.left + this._evaluatedMeasure.width < this._evaluatedParentMeasure.left) {
        this._isClipped = !0;
        return;
      }
      if (this._evaluatedMeasure.top > this._evaluatedParentMeasure.top + this._evaluatedParentMeasure.height) {
        this._isClipped = !0;
        return;
      }
      if (this._evaluatedMeasure.top + this._evaluatedMeasure.height < this._evaluatedParentMeasure.top) {
        this._isClipped = !0;
        return;
      }
    }
    this._isClipped = !1;
  }
  /** @internal */
  _measure() {
    this._width.isPixel ? this._currentMeasure.width = this._width.getValue(this._host) : this._currentMeasure.width *= this._width.getValue(this._host), this._height.isPixel ? this._currentMeasure.height = this._height.getValue(this._host) : this._currentMeasure.height *= this._height.getValue(this._host), this._fixedRatio !== 0 && (this._fixedRatioMasterIsWidth ? this._currentMeasure.height = this._currentMeasure.width * this._fixedRatio : this._currentMeasure.width = this._currentMeasure.height * this._fixedRatio);
  }
  /**
   * @internal
   */
  _computeAlignment(e, t) {
    const r = this._currentMeasure.width, n = this._currentMeasure.height, i = e.width, s = e.height;
    let a = 0, f = 0;
    switch (this.horizontalAlignment) {
      case St.HORIZONTAL_ALIGNMENT_LEFT:
        a = 0;
        break;
      case St.HORIZONTAL_ALIGNMENT_RIGHT:
        a = i - r;
        break;
      case St.HORIZONTAL_ALIGNMENT_CENTER:
        a = (i - r) / 2;
        break;
    }
    switch (this.verticalAlignment) {
      case St.VERTICAL_ALIGNMENT_TOP:
        f = 0;
        break;
      case St.VERTICAL_ALIGNMENT_BOTTOM:
        f = s - n;
        break;
      case St.VERTICAL_ALIGNMENT_CENTER:
        f = (s - n) / 2;
        break;
    }
    this.descendantsOnlyPadding || (this._paddingLeft.isPixel ? (this._currentMeasure.left += this._paddingLeft.getValue(this._host), this._currentMeasure.width -= this._paddingLeft.getValue(this._host)) : (this._currentMeasure.left += i * this._paddingLeft.getValue(this._host), this._currentMeasure.width -= i * this._paddingLeft.getValue(this._host)), this._paddingRight.isPixel ? this._currentMeasure.width -= this._paddingRight.getValue(this._host) : this._currentMeasure.width -= i * this._paddingRight.getValue(this._host), this._paddingTop.isPixel ? (this._currentMeasure.top += this._paddingTop.getValue(this._host), this._currentMeasure.height -= this._paddingTop.getValue(this._host)) : (this._currentMeasure.top += s * this._paddingTop.getValue(this._host), this._currentMeasure.height -= s * this._paddingTop.getValue(this._host)), this._paddingBottom.isPixel ? this._currentMeasure.height -= this._paddingBottom.getValue(this._host) : this._currentMeasure.height -= s * this._paddingBottom.getValue(this._host)), this._left.isPixel ? this._currentMeasure.left += this._left.getValue(this._host) : this._currentMeasure.left += i * this._left.getValue(this._host), this._top.isPixel ? this._currentMeasure.top += this._top.getValue(this._host) : this._currentMeasure.top += s * this._top.getValue(this._host), this._currentMeasure.left += a, this._currentMeasure.top += f;
  }
  /**
   * @internal
   */
  _preMeasure(e, t) {
  }
  /**
   * @internal
   */
  _postMeasure(e, t) {
  }
  /**
   * @internal
   */
  _additionalProcessing(e, t) {
  }
  /**
   * @internal
   */
  _clipForChildren(e) {
  }
  _clip(e, t) {
    if (e.beginPath(), St._ClipMeasure.copyFrom(this._currentMeasure), t) {
      t.transformToRef(this._invertTransformMatrix, this._tmpMeasureA);
      const r = new b6(0, 0, 0, 0);
      r.left = Math.max(this._tmpMeasureA.left, this._currentMeasure.left), r.top = Math.max(this._tmpMeasureA.top, this._currentMeasure.top), r.width = Math.min(this._tmpMeasureA.left + this._tmpMeasureA.width, this._currentMeasure.left + this._currentMeasure.width) - r.left, r.height = Math.min(this._tmpMeasureA.top + this._tmpMeasureA.height, this._currentMeasure.top + this._currentMeasure.height) - r.top, St._ClipMeasure.copyFrom(r);
    }
    if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
      const r = this.shadowOffsetX, n = this.shadowOffsetY, i = this.shadowBlur, s = Math.min(Math.min(r, 0) - i * 2, 0), a = Math.max(Math.max(r, 0) + i * 2, 0), f = Math.min(Math.min(n, 0) - i * 2, 0), o = Math.max(Math.max(n, 0) + i * 2, 0);
      e.rect(St._ClipMeasure.left + s, St._ClipMeasure.top + f, St._ClipMeasure.width + a - s, St._ClipMeasure.height + o - f);
    } else
      e.rect(St._ClipMeasure.left, St._ClipMeasure.top, St._ClipMeasure.width, St._ClipMeasure.height);
    e.clip();
  }
  /**
   * @internal
   */
  _render(e, t) {
    return !this.isVisible || this.notRenderable || this._isClipped ? (this._isDirty = !1, !1) : (this.host._numRenderCalls++, e.save(), this._applyStates(e), this._transform(e), this.clipContent && this._clip(e, t), this.onBeforeDrawObservable.hasObservers() && this.onBeforeDrawObservable.notifyObservers(this), this.useBitmapCache && !this._wasDirty && this._cacheData ? e.putImageData(this._cacheData, this._currentMeasure.left, this._currentMeasure.top) : this._draw(e, t), this.useBitmapCache && this._wasDirty && (this._cacheData = e.getImageData(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height)), this._renderHighlight(e), this.onAfterDrawObservable.hasObservers() && this.onAfterDrawObservable.notifyObservers(this), e.restore(), !0);
  }
  /**
   * @internal
   */
  _draw(e, t) {
  }
  /**
   * Tests if a given coordinates belong to the current control
   * @param x defines x coordinate to test
   * @param y defines y coordinate to test
   * @returns true if the coordinates are inside the control
   */
  contains(e, t) {
    return this._invertTransformMatrix.transformCoordinates(e, t, this._transformedPosition), e = this._transformedPosition.x, t = this._transformedPosition.y, e < this._currentMeasure.left || e > this._currentMeasure.left + this._currentMeasure.width || t < this._currentMeasure.top || t > this._currentMeasure.top + this._currentMeasure.height ? !1 : (this.isPointerBlocker && (this._host._shouldBlockPointer = !0), !0);
  }
  /**
   * @internal
   */
  _processPicking(e, t, r, n, i, s, a, f) {
    return !this._isEnabled || !this.isHitTestVisible || !this.isVisible || this._doNotRender || !this.contains(e, t) ? !1 : (this._processObservables(n, e, t, r, i, s, a, f), !0);
  }
  /**
   * @internal
   */
  _onPointerMove(e, t, r, n) {
    this.onPointerMoveObservable.notifyObservers(t, -1, e, this, n) && this.parent != null && !this.isPointerBlocker && this.parent._onPointerMove(e, t, r, n);
  }
  /**
   * @internal
   */
  _onPointerEnter(e, t) {
    return !this._isEnabled || this._enterCount > 0 ? !1 : (this._enterCount === -1 && (this._enterCount = 0), this._enterCount++, this.onPointerEnterObservable.notifyObservers(this, -1, e, this, t) && this.parent != null && !this.isPointerBlocker && this.parent._onPointerEnter(e, t), !0);
  }
  /**
   * @internal
   */
  _onPointerOut(e, t, r = !1) {
    if (!r && (!this._isEnabled || e === this))
      return;
    this._enterCount = 0;
    let n = !0;
    e.isAscendant(this) || (n = this.onPointerOutObservable.notifyObservers(this, -1, e, this, t)), n && this.parent != null && !this.isPointerBlocker && this.parent._onPointerOut(e, t, r);
  }
  /**
   * @internal
   */
  _onPointerDown(e, t, r, n, i) {
    return this._onPointerEnter(this, i), this._downCount !== 0 ? !1 : (this._downCount++, this._downPointerIds[r] = !0, this.onPointerDownObservable.notifyObservers(new k5(t, n), -1, e, this, i) && this.parent != null && !this.isPointerBlocker && this.parent._onPointerDown(e, t, r, n, i), i && this.uniqueId !== this._host.rootContainer.uniqueId && this._host._capturedPointerIds.add(i.event.pointerId), !0);
  }
  /**
   * @internal
   */
  _onPointerUp(e, t, r, n, i, s) {
    if (!this._isEnabled)
      return;
    this._downCount = 0, delete this._downPointerIds[r];
    let a = i;
    i && (this._enterCount > 0 || this._enterCount === -1) && (a = this.onPointerClickObservable.notifyObservers(new k5(t, n), -1, e, this, s)), this.onPointerUpObservable.notifyObservers(new k5(t, n), -1, e, this, s) && this.parent != null && !this.isPointerBlocker && this.parent._onPointerUp(e, t, r, n, a, s), s && this.uniqueId !== this._host.rootContainer.uniqueId && this._host._capturedPointerIds.delete(s.event.pointerId);
  }
  /**
   * @internal
   */
  _forcePointerUp(e = null) {
    if (e !== null)
      this._onPointerUp(this, at.Zero(), e, 0, !0);
    else
      for (const t in this._downPointerIds)
        this._onPointerUp(this, at.Zero(), +t, 0, !0);
  }
  /**
   * @internal
   */
  _onWheelScroll(e, t) {
    if (!this._isEnabled)
      return;
    this.onWheelObservable.notifyObservers(new at(e, t)) && this.parent != null && this.parent._onWheelScroll(e, t);
  }
  /** @internal */
  _onCanvasBlur() {
  }
  /**
   * @internal
   */
  _processObservables(e, t, r, n, i, s, a, f) {
    if (!this._isEnabled)
      return !1;
    if (this._dummyVector2.copyFromFloats(t, r), e === ir.POINTERMOVE) {
      this._onPointerMove(this, this._dummyVector2, i, n);
      const o = this._host._lastControlOver[i];
      return o && o !== this && o._onPointerOut(this, n), o !== this && this._onPointerEnter(this, n), this._host._lastControlOver[i] = this, !0;
    }
    return e === ir.POINTERDOWN ? (this._onPointerDown(this, this._dummyVector2, i, s, n), this._host._registerLastControlDown(this, i), this._host._lastPickedControl = this, !0) : e === ir.POINTERUP ? (this._host._lastControlDown[i] && this._host._lastControlDown[i]._onPointerUp(this, this._dummyVector2, i, s, !0, n), delete this._host._lastControlDown[i], !0) : e === ir.POINTERWHEEL && this._host._lastControlOver[i] ? (this._host._lastControlOver[i]._onWheelScroll(a, f), !0) : !1;
  }
  _getStyleProperty(e, t) {
    var r;
    const n = (r = this._style && this._style[e]) !== null && r !== void 0 ? r : this[e];
    return !n && this.parent ? this.parent._getStyleProperty(e, t) : this.parent ? n : t;
  }
  _prepareFont() {
    !this._font && !this._fontSet || (this._font = this._getStyleProperty("fontStyle", "") + " " + this._getStyleProperty("fontWeight", "") + " " + this.fontSizeInPixels + "px " + this._getStyleProperty("fontFamily", "Arial"), this._fontOffset = St._GetFontOffset(this._font), this.getDescendants().forEach((e) => e._markAllAsDirty()));
  }
  /**
   * A control has a dimension fully defined if that dimension doesn't depend on the parent's dimension.
   * As an example, a control that has dimensions in pixels is fully defined, while in percentage is not fully defined.
   * @param dim the dimension to check (width or height)
   * @returns if the dimension is fully defined
   */
  isDimensionFullyDefined(e) {
    return this.getDimension(e).isPixel;
  }
  /**
   * Gets the dimension of the control along a specified axis
   * @param dim the dimension to retrieve (width or height)
   * @returns the dimension value along the specified axis
   */
  getDimension(e) {
    return e === "width" ? this._width : this._height;
  }
  /**
   * Clones a control and its descendants
   * @param host the texture where the control will be instantiated. Can be empty, in which case the control will be created on the same texture
   * @returns the cloned control
   */
  clone(e) {
    const t = {};
    this.serialize(t);
    const r = ye.Instantiate("BABYLON.GUI." + t.className), n = new r();
    return n.parse(t, e), n;
  }
  /**
   * Parses a serialized object into this control
   * @param serializedObject the object with the serialized properties
   * @param host the texture where the control will be instantiated. Can be empty, in which case the control will be created on the same texture
   * @returns this control
   */
  parse(e, t) {
    return jt.Parse(() => this, e, null), this.name = e.name, this._parseFromContent(e, t ?? this._host), this;
  }
  /**
   * Serializes the current control
   * @param serializationObject defined the JSON serialized object
   */
  serialize(e) {
    jt.Serialize(this, e), e.name = this.name, e.className = this.getClassName(), this._prepareFont(), this._font && (e.fontFamily = this._fontFamily, e.fontSize = this.fontSize, e.fontWeight = this.fontWeight, e.fontStyle = this.fontStyle), this._gradient && (e.gradient = {}, this._gradient.serialize(e.gradient)), jt.AppendSerializedAnimations(this, e);
  }
  /**
   * @internal
   */
  _parseFromContent(e, t) {
    var r, n;
    if (e.fontFamily && (this.fontFamily = e.fontFamily), e.fontSize && (this.fontSize = e.fontSize), e.fontWeight && (this.fontWeight = e.fontWeight), e.fontStyle && (this.fontStyle = e.fontStyle), e.gradient) {
      const i = ye.Instantiate("BABYLON.GUI." + e.gradient.className);
      this._gradient = new i(), (r = this._gradient) === null || r === void 0 || r.parse(e.gradient);
    }
    if (e.animations) {
      this.animations = [];
      for (let i = 0; i < e.animations.length; i++) {
        const s = e.animations[i], a = Jo("BABYLON.Animation");
        a && this.animations.push(a.Parse(s));
      }
      e.autoAnimate && this._host && this._host.getScene() && this._host.getScene().beginAnimation(this, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1);
    }
    this.fixedRatioMasterIsWidth = (n = e.fixedRatioMasterIsWidth) !== null && n !== void 0 ? n : this.fixedRatioMasterIsWidth;
  }
  /** Releases associated resources */
  dispose() {
    this.onDirtyObservable.clear(), this.onBeforeDrawObservable.clear(), this.onAfterDrawObservable.clear(), this.onPointerDownObservable.clear(), this.onPointerEnterObservable.clear(), this.onPointerMoveObservable.clear(), this.onPointerOutObservable.clear(), this.onPointerUpObservable.clear(), this.onPointerClickObservable.clear(), this.onWheelObservable.clear(), this._styleObserver && this._style && (this._style.onChangedObservable.remove(this._styleObserver), this._styleObserver = null), this.parent && (this.parent.removeControl(this), this.parent = null), this._host && this._host._linkedControls.indexOf(this) > -1 && this.linkWithMesh(null), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();
  }
  /** HORIZONTAL_ALIGNMENT_LEFT */
  static get HORIZONTAL_ALIGNMENT_LEFT() {
    return St._HORIZONTAL_ALIGNMENT_LEFT;
  }
  /** HORIZONTAL_ALIGNMENT_RIGHT */
  static get HORIZONTAL_ALIGNMENT_RIGHT() {
    return St._HORIZONTAL_ALIGNMENT_RIGHT;
  }
  /** HORIZONTAL_ALIGNMENT_CENTER */
  static get HORIZONTAL_ALIGNMENT_CENTER() {
    return St._HORIZONTAL_ALIGNMENT_CENTER;
  }
  /** VERTICAL_ALIGNMENT_TOP */
  static get VERTICAL_ALIGNMENT_TOP() {
    return St._VERTICAL_ALIGNMENT_TOP;
  }
  /** VERTICAL_ALIGNMENT_BOTTOM */
  static get VERTICAL_ALIGNMENT_BOTTOM() {
    return St._VERTICAL_ALIGNMENT_BOTTOM;
  }
  /** VERTICAL_ALIGNMENT_CENTER */
  static get VERTICAL_ALIGNMENT_CENTER() {
    return St._VERTICAL_ALIGNMENT_CENTER;
  }
  /**
   * @internal
   */
  static _GetFontOffset(e) {
    if (St._FontHeightSizes[e])
      return St._FontHeightSizes[e];
    const t = gr.LastCreatedEngine;
    if (!t)
      throw new Error("Invalid engine. Unable to create a canvas.");
    const r = t.getFontOffset(e);
    return St._FontHeightSizes[e] = r, r;
  }
  /**
   * Creates a Control from parsed data
   * @param serializedObject defines parsed data
   * @param host defines the hosting AdvancedDynamicTexture
   * @returns a new Control
   */
  static Parse(e, t) {
    const r = ye.Instantiate("BABYLON.GUI." + e.className), n = jt.Parse(() => new r(), e, null);
    return n.name = e.name, n._parseFromContent(e, t), n;
  }
  /**
   * @internal
   */
  static drawEllipse(e, t, r, n, i) {
    i.translate(e, t), i.scale(r, n), i.beginPath(), i.arc(0, 0, 1, 0, 2 * Math.PI), i.closePath(), i.scale(1 / r, 1 / n), i.translate(-e, -t);
  }
  /**
   * Returns true if the control is ready to be used
   * @returns
   */
  isReady() {
    return !0;
  }
}
St.AllowAlphaInheritance = !1;
St._ClipMeasure = new b6(0, 0, 0, 0);
St._HORIZONTAL_ALIGNMENT_LEFT = 0;
St._HORIZONTAL_ALIGNMENT_RIGHT = 1;
St._HORIZONTAL_ALIGNMENT_CENTER = 2;
St._VERTICAL_ALIGNMENT_TOP = 0;
St._VERTICAL_ALIGNMENT_BOTTOM = 1;
St._VERTICAL_ALIGNMENT_CENTER = 2;
St._FontHeightSizes = {};
St.AddHeader = () => {
};
C([
  M()
], St.prototype, "metadata", void 0);
C([
  M()
], St.prototype, "isHitTestVisible", void 0);
C([
  M()
], St.prototype, "isPointerBlocker", void 0);
C([
  M()
], St.prototype, "isFocusInvisible", void 0);
C([
  M()
], St.prototype, "clipChildren", null);
C([
  M()
], St.prototype, "clipContent", null);
C([
  M()
], St.prototype, "useBitmapCache", void 0);
C([
  M()
], St.prototype, "shadowOffsetX", null);
C([
  M()
], St.prototype, "shadowOffsetY", null);
C([
  M()
], St.prototype, "shadowBlur", null);
C([
  M()
], St.prototype, "shadowColor", null);
C([
  M()
], St.prototype, "hoverCursor", void 0);
C([
  M()
], St.prototype, "fontOffset", null);
C([
  M()
], St.prototype, "alpha", null);
C([
  M()
], St.prototype, "scaleX", null);
C([
  M()
], St.prototype, "scaleY", null);
C([
  M()
], St.prototype, "rotation", null);
C([
  M()
], St.prototype, "transformCenterY", null);
C([
  M()
], St.prototype, "transformCenterX", null);
C([
  M()
], St.prototype, "horizontalAlignment", null);
C([
  M()
], St.prototype, "verticalAlignment", null);
C([
  M()
], St.prototype, "fixedRatio", null);
C([
  M()
], St.prototype, "fixedRatioMasterIsWidth", null);
C([
  M()
], St.prototype, "width", null);
C([
  M()
], St.prototype, "height", null);
C([
  M()
], St.prototype, "style", null);
C([
  M()
], St.prototype, "color", null);
C([
  M()
], St.prototype, "gradient", null);
C([
  M()
], St.prototype, "zIndex", null);
C([
  M()
], St.prototype, "notRenderable", null);
C([
  M()
], St.prototype, "isVisible", null);
C([
  M()
], St.prototype, "descendantsOnlyPadding", null);
C([
  M()
], St.prototype, "paddingLeft", null);
C([
  M()
], St.prototype, "paddingRight", null);
C([
  M()
], St.prototype, "paddingTop", null);
C([
  M()
], St.prototype, "paddingBottom", null);
C([
  M()
], St.prototype, "left", null);
C([
  M()
], St.prototype, "top", null);
C([
  M()
], St.prototype, "linkOffsetX", null);
C([
  M()
], St.prototype, "linkOffsetY", null);
C([
  M()
], St.prototype, "isEnabled", null);
C([
  M()
], St.prototype, "disabledColor", null);
C([
  M()
], St.prototype, "disabledColorItem", null);
C([
  M()
], St.prototype, "overlapGroup", void 0);
C([
  M()
], St.prototype, "overlapDeltaMultiplier", void 0);
Ue("BABYLON.GUI.Control", St);
class Ev extends St {
  /** Gets or sets boolean indicating if children should be rendered to an intermediate texture rather than directly to host, useful for alpha blending */
  get renderToIntermediateTexture() {
    return this._renderToIntermediateTexture;
  }
  set renderToIntermediateTexture(e) {
    this._renderToIntermediateTexture !== e && (this._renderToIntermediateTexture = e, this._markAsDirty());
  }
  /** Gets or sets a boolean indicating if the container should try to adapt to its children height */
  get adaptHeightToChildren() {
    return this._adaptHeightToChildren;
  }
  set adaptHeightToChildren(e) {
    this._adaptHeightToChildren !== e && (this._adaptHeightToChildren = e, e && (this.height = "100%"), this._markAsDirty());
  }
  /** Gets or sets a boolean indicating if the container should try to adapt to its children width */
  get adaptWidthToChildren() {
    return this._adaptWidthToChildren;
  }
  set adaptWidthToChildren(e) {
    this._adaptWidthToChildren !== e && (this._adaptWidthToChildren = e, e && (this.width = "100%"), this._markAsDirty());
  }
  /** Gets or sets background color */
  get background() {
    return this._background;
  }
  set background(e) {
    this._background !== e && (this._background = e, this._markAsDirty());
  }
  /** Gets or sets background gradient color. Takes precedence over background */
  get backgroundGradient() {
    return this._backgroundGradient;
  }
  set backgroundGradient(e) {
    this._backgroundGradient !== e && (this._backgroundGradient = e, this._markAsDirty());
  }
  /** Gets the list of children */
  get children() {
    return this._children;
  }
  get isReadOnly() {
    return this._isReadOnly;
  }
  set isReadOnly(e) {
    this._isReadOnly = e;
    for (const t of this._children)
      t.isReadOnly = e;
  }
  /**
   * Creates a new Container
   * @param name defines the name of the container
   */
  constructor(e) {
    super(e), this.name = e, this._children = new Array(), this._measureForChildren = b6.Empty(), this._background = "", this._backgroundGradient = null, this._adaptWidthToChildren = !1, this._adaptHeightToChildren = !1, this._renderToIntermediateTexture = !1, this._intermediateTexture = null, this.logLayoutCycleErrors = !1, this.maxLayoutCycle = 3, this.onControlAddedObservable = new Oe(), this.onControlRemovedObservable = new Oe(), this._inverseTransformMatrix = Js.Identity(), this._inverseMeasure = new b6(0, 0, 0, 0);
  }
  _getTypeName() {
    return "Container";
  }
  _flagDescendantsAsMatrixDirty() {
    for (const e of this.children)
      e._isClipped = !1, e._markMatrixAsDirty();
  }
  /**
   * Gets a child using its name
   * @param name defines the child name to look for
   * @returns the child control if found
   */
  getChildByName(e) {
    for (const t of this.children)
      if (t.name === e)
        return t;
    return null;
  }
  /**
   * Gets a child using its type and its name
   * @param name defines the child name to look for
   * @param type defines the child type to look for
   * @returns the child control if found
   */
  getChildByType(e, t) {
    for (const r of this.children)
      if (r.typeName === t)
        return r;
    return null;
  }
  /**
   * Search for a specific control in children
   * @param control defines the control to look for
   * @returns true if the control is in child list
   */
  containsControl(e) {
    return this.children.indexOf(e) !== -1;
  }
  /**
   * Adds a new control to the current container
   * @param control defines the control to add
   * @returns the current container
   */
  addControl(e) {
    return e ? this._children.indexOf(e) !== -1 ? this : (e._link(this._host), e._markAllAsDirty(), this._reOrderControl(e), this._markAsDirty(), this.onControlAddedObservable.notifyObservers(e), this) : this;
  }
  /**
   * Removes all controls from the current container
   * @returns the current container
   */
  clearControls() {
    const e = this.children.slice();
    for (const t of e)
      this.removeControl(t);
    return this;
  }
  /**
   * Removes a control from the current container
   * @param control defines the control to remove
   * @returns the current container
   */
  removeControl(e) {
    const t = this._children.indexOf(e);
    return t !== -1 && (this._children.splice(t, 1), e.parent = null), e.linkWithMesh(null), this._host && this._host._cleanControlAfterRemoval(e), this._markAsDirty(), this.onControlRemovedObservable.notifyObservers(e), this;
  }
  /**
   * @internal
   */
  _reOrderControl(e) {
    const t = e.linkedMesh;
    this.removeControl(e);
    let r = !1;
    for (let n = 0; n < this._children.length; n++)
      if (this._children[n].zIndex > e.zIndex) {
        this._children.splice(n, 0, e), r = !0;
        break;
      }
    r || this._children.push(e), e.parent = this, t && e.linkWithMesh(t), this._markAsDirty();
  }
  /**
   * @internal
   */
  _offsetLeft(e) {
    super._offsetLeft(e);
    for (const t of this._children)
      t._offsetLeft(e);
  }
  /**
   * @internal
   */
  _offsetTop(e) {
    super._offsetTop(e);
    for (const t of this._children)
      t._offsetTop(e);
  }
  /** @internal */
  _markAllAsDirty() {
    super._markAllAsDirty();
    for (let e = 0; e < this._children.length; e++)
      this._children[e]._markAllAsDirty();
  }
  _getBackgroundColor(e) {
    return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(e) : this._background;
  }
  /**
   * @internal
   */
  _localDraw(e) {
    (this._background || this._backgroundGradient) && (e.save(), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY), e.fillStyle = this._getBackgroundColor(e), e.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height), e.restore());
  }
  /**
   * @internal
   */
  _link(e) {
    super._link(e);
    for (const t of this._children)
      t._link(e);
  }
  /** @internal */
  _beforeLayout() {
  }
  /**
   * @internal
   */
  _processMeasures(e, t) {
    (this._isDirty || !this._cachedParentMeasure.isEqualsTo(e)) && (super._processMeasures(e, t), this._evaluateClippingState(e), this._renderToIntermediateTexture && (this._intermediateTexture && this._host.getScene() != this._intermediateTexture.getScene() && (this._intermediateTexture.dispose(), this._intermediateTexture = null), this._intermediateTexture ? this._intermediateTexture.scaleTo(this._currentMeasure.width, this._currentMeasure.height) : (this._intermediateTexture = new Xp("", { width: this._currentMeasure.width, height: this._currentMeasure.height }, this._host.getScene(), !1, We.NEAREST_SAMPLINGMODE, et.TEXTUREFORMAT_RGBA, !1), this._intermediateTexture.hasAlpha = !0)));
  }
  /**
   * @internal
   */
  _layout(e, t) {
    var r, n;
    if (!this.isDirty && (!this.isVisible || this.notRenderable))
      return !1;
    this.host._numLayoutCalls++, this._isDirty && this._currentMeasure.transformToRef(this._transformMatrix, this._prevCurrentMeasureTransformedIntoGlobalSpace);
    let i = 0;
    t.save(), this._applyStates(t), this._beforeLayout();
    do {
      let s = -1, a = -1;
      if (this._rebuildLayout = !1, this._processMeasures(e, t), !this._isClipped) {
        for (const f of this._children)
          f._tempParentMeasure.copyFrom(this._measureForChildren), f._layout(this._measureForChildren, t) && f.isVisible && !f.notRenderable && (this.adaptWidthToChildren && f._width.isPixel && (s = Math.max(s, f._currentMeasure.width + f._paddingLeftInPixels + f._paddingRightInPixels)), this.adaptHeightToChildren && f._height.isPixel && (a = Math.max(a, f._currentMeasure.height + f._paddingTopInPixels + f._paddingBottomInPixels)));
        this.adaptWidthToChildren && s >= 0 && (s += this.paddingLeftInPixels + this.paddingRightInPixels, this.width !== s + "px" && ((r = this.parent) === null || r === void 0 || r._markAsDirty(), this.width = s + "px", this._width.ignoreAdaptiveScaling = !0, this._rebuildLayout = !0)), this.adaptHeightToChildren && a >= 0 && (a += this.paddingTopInPixels + this.paddingBottomInPixels, this.height !== a + "px" && ((n = this.parent) === null || n === void 0 || n._markAsDirty(), this.height = a + "px", this._height.ignoreAdaptiveScaling = !0, this._rebuildLayout = !0)), this._postMeasure();
      }
      i++;
    } while (this._rebuildLayout && i < this.maxLayoutCycle);
    return i >= 3 && this.logLayoutCycleErrors && Se.Error(`Layout cycle detected in GUI (Container name=${this.name}, uniqueId=${this.uniqueId})`), t.restore(), this._isDirty && (this.invalidateRect(), this._isDirty = !1), !0;
  }
  _postMeasure() {
  }
  /**
   * @internal
   */
  _draw(e, t) {
    const r = this._renderToIntermediateTexture && this._intermediateTexture, n = r ? this._intermediateTexture.getContext() : e;
    r && (n.save(), n.translate(-this._currentMeasure.left, -this._currentMeasure.top), t ? (this._transformMatrix.invertToRef(this._inverseTransformMatrix), t.transformToRef(this._inverseTransformMatrix, this._inverseMeasure), n.clearRect(this._inverseMeasure.left, this._inverseMeasure.top, this._inverseMeasure.width, this._inverseMeasure.height)) : n.clearRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height)), this._localDraw(n), e.save(), this.clipChildren && this._clipForChildren(n);
    for (const i of this._children)
      t && !i._intersectsRect(t) || i._render(n, t);
    r && (n.restore(), e.save(), e.globalAlpha = this.alpha, e.drawImage(n.canvas, this._currentMeasure.left, this._currentMeasure.top), e.restore()), e.restore();
  }
  getDescendantsToRef(e, t = !1, r) {
    if (this.children)
      for (let n = 0; n < this.children.length; n++) {
        const i = this.children[n];
        (!r || r(i)) && e.push(i), t || i.getDescendantsToRef(e, !1, r);
      }
  }
  /**
   * @internal
   */
  _processPicking(e, t, r, n, i, s, a, f) {
    if (!this._isEnabled || !this.isVisible || this.notRenderable)
      return !1;
    const o = super.contains(e, t);
    if (!o && this.clipChildren)
      return !1;
    for (let d = this._children.length - 1; d >= 0; d--) {
      const v = this._children[d];
      if (v._processPicking(e, t, r, n, i, s, a, f))
        return v.hoverCursor && this._host._changeCursor(v.hoverCursor), !0;
    }
    return !o || !this.isHitTestVisible ? !1 : this._processObservables(n, e, t, r, i, s, a, f);
  }
  /**
   * @internal
   */
  _additionalProcessing(e, t) {
    super._additionalProcessing(e, t), this._measureForChildren.copyFrom(this._currentMeasure);
  }
  _getAdaptDimTo(e) {
    return e === "width" ? this.adaptWidthToChildren : this.adaptHeightToChildren;
  }
  isDimensionFullyDefined(e) {
    if (this._getAdaptDimTo(e)) {
      for (const t of this.children)
        if (!t.isDimensionFullyDefined(e))
          return !1;
      return !0;
    }
    return super.isDimensionFullyDefined(e);
  }
  /**
   * Serializes the current control
   * @param serializationObject defined the JSON serialized object
   */
  serialize(e) {
    if (super.serialize(e), this.backgroundGradient && (e.backgroundGradient = {}, this.backgroundGradient.serialize(e.backgroundGradient)), !!this.children.length) {
      e.children = [];
      for (const t of this.children) {
        const r = {};
        t.serialize(r), e.children.push(r);
      }
    }
  }
  /** Releases associated resources */
  dispose() {
    var e;
    super.dispose();
    for (let t = this.children.length - 1; t >= 0; t--)
      this.children[t].dispose();
    (e = this._intermediateTexture) === null || e === void 0 || e.dispose();
  }
  /**
   * @internal
   */
  _parseFromContent(e, t) {
    var r;
    if (super._parseFromContent(e, t), this._link(t), e.backgroundGradient) {
      const n = ye.Instantiate("BABYLON.GUI." + e.backgroundGradient.className);
      this._backgroundGradient = new n(), (r = this._backgroundGradient) === null || r === void 0 || r.parse(e.backgroundGradient);
    }
    if (e.children)
      for (const n of e.children)
        this.addControl(St.Parse(n, t));
  }
  isReady() {
    for (const e of this.children)
      if (!e.isReady())
        return !1;
    return !0;
  }
}
C([
  M()
], Ev.prototype, "renderToIntermediateTexture", null);
C([
  M()
], Ev.prototype, "maxLayoutCycle", void 0);
C([
  M()
], Ev.prototype, "adaptHeightToChildren", null);
C([
  M()
], Ev.prototype, "adaptWidthToChildren", null);
C([
  M()
], Ev.prototype, "background", null);
C([
  M()
], Ev.prototype, "backgroundGradient", null);
Ue("BABYLON.GUI.Container", Ev);
class p9 extends Ev {
  /** Gets or sets border thickness */
  get thickness() {
    return this._thickness;
  }
  set thickness(e) {
    this._thickness !== e && (this._thickness = e, this._markAsDirty());
  }
  /** Gets or sets the corner radius of all angles */
  get cornerRadius() {
    return this._cornerRadius[0];
  }
  set cornerRadius(e) {
    e < 0 && (e = 0), !(this._cornerRadius[0] === e && this._cornerRadius[1] === e && this._cornerRadius[2] === e && this._cornerRadius[3] === e) && (this._cornerRadius[0] = this._cornerRadius[1] = this._cornerRadius[2] = this._cornerRadius[3] = e, this._markAsDirty());
  }
  /** Gets or sets the corner radius top left angle */
  get cornerRadiusX() {
    return this._cornerRadius[0];
  }
  set cornerRadiusX(e) {
    this._cornerRadius[0] !== e && (this._cornerRadius[0] = e);
  }
  /** Gets or sets the corner radius top right angle */
  get cornerRadiusY() {
    return this._cornerRadius[1];
  }
  set cornerRadiusY(e) {
    this._cornerRadius[1] !== e && (this._cornerRadius[1] = e);
  }
  /** Gets or sets the corner radius bottom left angle */
  get cornerRadiusZ() {
    return this._cornerRadius[2];
  }
  set cornerRadiusZ(e) {
    this._cornerRadius[2] !== e && (this._cornerRadius[2] = e);
  }
  /** Gets or sets the corner radius bottom right angle */
  get cornerRadiusW() {
    return this._cornerRadius[3];
  }
  set cornerRadiusW(e) {
    this._cornerRadius[3] !== e && (this._cornerRadius[3] = e);
  }
  /**
   * Creates a new Rectangle
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._thickness = 1, this._cornerRadius = [0, 0, 0, 0], this._cachedRadius = [0, 0, 0, 0];
  }
  _getTypeName() {
    return "Rectangle";
  }
  /** @internal */
  _computeAdditionalOffsetX() {
    let e = 0;
    return (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) && (e += 1), this.thickness && (e += this.thickness / 2), e;
  }
  /** @internal */
  _computeAdditionalOffsetY() {
    let e = 0;
    return (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) && (e += 1), this.thickness && (e += this.thickness / 2), e;
  }
  _getRectangleFill(e) {
    return this._getBackgroundColor(e);
  }
  _localDraw(e) {
    e.save(), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY), (this._background || this._backgroundGradient) && (e.fillStyle = this._getRectangleFill(e), this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0 ? (this._drawRoundedRect(e, this._thickness / 2), e.fill()) : e.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height)), this._thickness && ((this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0), (this.color || this.gradient) && (e.strokeStyle = this.gradient ? this.gradient.getCanvasGradient(e) : this.color), e.lineWidth = this._thickness, this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0 ? (this._drawRoundedRect(e, this._thickness / 2), e.stroke()) : e.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness)), e.restore();
  }
  _additionalProcessing(e, t) {
    super._additionalProcessing(e, t), this._measureForChildren.width -= 2 * this._thickness, this._measureForChildren.height -= 2 * this._thickness, this._measureForChildren.left += this._thickness, this._measureForChildren.top += this._thickness;
  }
  _drawRoundedRect(e, t = 0) {
    const r = this._currentMeasure.left + t, n = this._currentMeasure.top + t, i = this._currentMeasure.width - t * 2, s = this._currentMeasure.height - t * 2;
    for (let a = 0; a < this._cornerRadius.length; a++)
      this._cachedRadius[a] = Math.abs(Math.min(s / 2, Math.min(i / 2, this._cornerRadius[a])));
    e.beginPath(), e.moveTo(r + this._cachedRadius[0], n), e.lineTo(r + i - this._cachedRadius[1], n), e.arc(r + i - this._cachedRadius[1], n + this._cachedRadius[1], this._cachedRadius[1], 3 * Math.PI / 2, Math.PI * 2), e.lineTo(r + i, n + s - this._cachedRadius[2]), e.arc(r + i - this._cachedRadius[2], n + s - this._cachedRadius[2], this._cachedRadius[2], 0, Math.PI / 2), e.lineTo(r + this._cachedRadius[3], n + s), e.arc(r + this._cachedRadius[3], n + s - this._cachedRadius[3], this._cachedRadius[3], Math.PI / 2, Math.PI), e.lineTo(r, n + this._cachedRadius[0]), e.arc(r + this._cachedRadius[0], n + this._cachedRadius[0], this._cachedRadius[0], Math.PI, 3 * Math.PI / 2), e.closePath();
  }
  _clipForChildren(e) {
    (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) && (this._drawRoundedRect(e, this._thickness), e.clip());
  }
}
C([
  M()
], p9.prototype, "thickness", null);
C([
  M()
], p9.prototype, "cornerRadius", null);
C([
  M()
], p9.prototype, "cornerRadiusX", null);
C([
  M()
], p9.prototype, "cornerRadiusY", null);
C([
  M()
], p9.prototype, "cornerRadiusZ", null);
C([
  M()
], p9.prototype, "cornerRadiusW", null);
Ue("BABYLON.GUI.Rectangle", p9);
var Yw;
(function(A) {
  A[A.Clip = 0] = "Clip", A[A.WordWrap = 1] = "WordWrap", A[A.Ellipsis = 2] = "Ellipsis", A[A.WordWrapEllipsis = 3] = "WordWrapEllipsis";
})(Yw || (Yw = {}));
class oo extends St {
  /**
   * Return the line list (you may need to use the onLinesReadyObservable to make sure the list is ready)
   */
  get lines() {
    return this._lines;
  }
  /**
       * Gets or sets a boolean indicating that the TextBlock will be resized to fit its content
  
       */
  get resizeToFit() {
    return this._resizeToFit;
  }
  /**
       * Gets or sets a boolean indicating that the TextBlock will be resized to fit its content
  
       */
  set resizeToFit(e) {
    this._resizeToFit !== e && (this._resizeToFit = e, this._resizeToFit && (this._width.ignoreAdaptiveScaling = !0, this._height.ignoreAdaptiveScaling = !0), this._markAsDirty());
  }
  /**
   * Gets or sets a boolean indicating if text must be wrapped
   */
  get textWrapping() {
    return this._textWrapping;
  }
  /**
   * Gets or sets a boolean indicating if text must be wrapped
   */
  set textWrapping(e) {
    this._textWrapping !== e && (this._textWrapping = +e, this._markAsDirty());
  }
  /**
   * Gets or sets text to display
   */
  get text() {
    return this._text;
  }
  /**
   * Gets or sets text to display
   */
  set text(e) {
    this._text !== e && (this._text = e + "", this._markAsDirty(), this.onTextChangedObservable.notifyObservers(this));
  }
  /**
   * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)
   */
  get textHorizontalAlignment() {
    return this._textHorizontalAlignment;
  }
  /**
   * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)
   */
  set textHorizontalAlignment(e) {
    this._textHorizontalAlignment !== e && (this._textHorizontalAlignment = e, this._markAsDirty());
  }
  /**
   * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)
   */
  get textVerticalAlignment() {
    return this._textVerticalAlignment;
  }
  /**
   * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)
   */
  set textVerticalAlignment(e) {
    this._textVerticalAlignment !== e && (this._textVerticalAlignment = e, this._markAsDirty());
  }
  /**
   * Gets or sets line spacing value
   */
  set lineSpacing(e) {
    this._lineSpacing.fromString(e) && this._markAsDirty();
  }
  /**
   * Gets or sets line spacing value
   */
  get lineSpacing() {
    return this._lineSpacing.toString(this._host);
  }
  /**
   * Gets or sets outlineWidth of the text to display
   */
  get outlineWidth() {
    return this._outlineWidth;
  }
  /**
   * Gets or sets outlineWidth of the text to display
   */
  set outlineWidth(e) {
    this._outlineWidth !== e && (this._outlineWidth = e, this._markAsDirty());
  }
  /**
   * Gets or sets a boolean indicating that text must have underline
   */
  get underline() {
    return this._underline;
  }
  /**
   * Gets or sets a boolean indicating that text must have underline
   */
  set underline(e) {
    this._underline !== e && (this._underline = e, this._markAsDirty());
  }
  /**
   * Gets or sets an boolean indicating that text must be crossed out
   */
  get lineThrough() {
    return this._lineThrough;
  }
  /**
   * Gets or sets an boolean indicating that text must be crossed out
   */
  set lineThrough(e) {
    this._lineThrough !== e && (this._lineThrough = e, this._markAsDirty());
  }
  /**
   * If the outline should be applied to the underline/strike-through too. Has different behavior in Edge/Chrome vs Firefox.
   */
  get applyOutlineToUnderline() {
    return this._applyOutlineToUnderline;
  }
  set applyOutlineToUnderline(e) {
    this._applyOutlineToUnderline !== e && (this._applyOutlineToUnderline = e, this._markAsDirty());
  }
  /**
   * Gets or sets outlineColor of the text to display
   */
  get outlineColor() {
    return this._outlineColor;
  }
  /**
   * Gets or sets outlineColor of the text to display
   */
  set outlineColor(e) {
    this._outlineColor !== e && (this._outlineColor = e, this._markAsDirty());
  }
  /**
   * Gets or sets word divider
   */
  get wordDivider() {
    return this._wordDivider;
  }
  /**
   * Gets or sets word divider
   */
  set wordDivider(e) {
    this._wordDivider !== e && (this._wordDivider = e, this._markAsDirty());
  }
  /**
   * By default, if a text block has text wrapping other than Clip, its width
   * is not resized even if resizeToFit = true. This parameter forces the width
   * to be resized.
   */
  get forceResizeWidth() {
    return this._forceResizeWidth;
  }
  set forceResizeWidth(e) {
    this._forceResizeWidth !== e && (this._forceResizeWidth = e, this._markAsDirty());
  }
  /**
   * Creates a new TextBlock object
   * @param name defines the name of the control
   * @param text defines the text to display (empty string by default)
   */
  constructor(e, t = "") {
    super(e), this.name = e, this._text = "", this._textWrapping = Yw.Clip, this._textHorizontalAlignment = St.HORIZONTAL_ALIGNMENT_CENTER, this._textVerticalAlignment = St.VERTICAL_ALIGNMENT_CENTER, this._resizeToFit = !1, this._lineSpacing = new Ai(0), this._outlineWidth = 0, this._outlineColor = "white", this._underline = !1, this._lineThrough = !1, this._wordDivider = " ", this._forceResizeWidth = !1, this._applyOutlineToUnderline = !1, this.onTextChangedObservable = new Oe(), this.onLinesReadyObservable = new Oe(), this._linesTemp = [], this.text = t;
  }
  _getTypeName() {
    return "TextBlock";
  }
  _processMeasures(e, t) {
    (!this._fontOffset || this.isDirty) && (this._fontOffset = St._GetFontOffset(t.font)), super._processMeasures(e, t), this._lines = this._breakLines(this._currentMeasure.width, this._currentMeasure.height, t), this.onLinesReadyObservable.notifyObservers(this);
    let r = 0;
    for (let n = 0; n < this._lines.length; n++) {
      const i = this._lines[n];
      i.width > r && (r = i.width);
    }
    if (this._resizeToFit) {
      if (this._textWrapping === Yw.Clip || this._forceResizeWidth) {
        const i = Math.ceil(this._paddingLeftInPixels) + Math.ceil(this._paddingRightInPixels) + Math.ceil(r);
        i !== this._width.getValueInPixel(this._host, this._tempParentMeasure.width) && (this._width.updateInPlace(i, Ai.UNITMODE_PIXEL), this._rebuildLayout = !0);
      }
      let n = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * this._lines.length | 0;
      if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) {
        let i = 0;
        this._lineSpacing.isPixel ? i = this._lineSpacing.getValue(this._host) : i = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height), n += (this._lines.length - 1) * i;
      }
      n !== this._height.internalValue && (this._height.updateInPlace(n, Ai.UNITMODE_PIXEL), this._rebuildLayout = !0);
    }
  }
  _drawText(e, t, r, n) {
    const i = this._currentMeasure.width;
    let s = 0;
    switch (this._textHorizontalAlignment) {
      case St.HORIZONTAL_ALIGNMENT_LEFT:
        s = 0;
        break;
      case St.HORIZONTAL_ALIGNMENT_RIGHT:
        s = i - t;
        break;
      case St.HORIZONTAL_ALIGNMENT_CENTER:
        s = (i - t) / 2;
        break;
    }
    (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (n.shadowColor = this.shadowColor, n.shadowBlur = this.shadowBlur, n.shadowOffsetX = this.shadowOffsetX, n.shadowOffsetY = this.shadowOffsetY), this.outlineWidth && n.strokeText(e, this._currentMeasure.left + s, r), n.fillText(e, this._currentMeasure.left + s, r), this._underline && this._drawLine(this._currentMeasure.left + s, r + 3, this._currentMeasure.left + s + t, r + 3, n), this._lineThrough && this._drawLine(this._currentMeasure.left + s, r - this.fontSizeInPixels / 3, this._currentMeasure.left + s + t, r - this.fontSizeInPixels / 3, n);
  }
  _drawLine(e, t, r, n, i) {
    if (i.beginPath(), i.lineWidth = Math.round(this.fontSizeInPixels * 0.05), i.moveTo(e, t), i.lineTo(r, n), this.outlineWidth && this.applyOutlineToUnderline)
      i.stroke(), i.fill();
    else {
      const s = i.strokeStyle;
      i.strokeStyle = i.fillStyle, i.stroke(), i.strokeStyle = s;
    }
    i.closePath();
  }
  /**
   * @internal
   */
  _draw(e) {
    e.save(), this._applyStates(e), this._renderLines(e), e.restore();
  }
  _applyStates(e) {
    super._applyStates(e), this.outlineWidth && (e.lineWidth = this.outlineWidth, e.strokeStyle = this.outlineColor, e.lineJoin = "miter", e.miterLimit = 2);
  }
  _breakLines(e, t, r) {
    this._linesTemp.length = 0;
    const n = this.text.split(`
`);
    if (this._textWrapping === Yw.Ellipsis)
      for (const i of n)
        this._linesTemp.push(this._parseLineEllipsis(i, e, r));
    else if (this._textWrapping === Yw.WordWrap)
      for (const i of n)
        this._linesTemp.push(...this._parseLineWordWrap(i, e, r));
    else if (this._textWrapping === Yw.WordWrapEllipsis)
      for (const i of n)
        this._linesTemp.push(...this._parseLineWordWrapEllipsis(i, e, t, r));
    else
      for (const i of n)
        this._linesTemp.push(this._parseLine(i, r));
    return this._linesTemp;
  }
  _parseLine(e = "", t) {
    return { text: e, width: this._getTextMetricsWidth(t.measureText(e)) };
  }
  //Calculate how many characters approximately we need to remove
  _getCharsToRemove(e, t, r) {
    const n = e > t ? e - t : 0, i = e / r;
    return Math.max(Math.floor(n / i), 1);
  }
  _parseLineEllipsis(e = "", t, r) {
    let n = this._getTextMetricsWidth(r.measureText(e)), i = this._getCharsToRemove(n, t, e.length);
    const s = Array.from && Array.from(e);
    if (s)
      for (; s.length && n > t; )
        s.splice(s.length - i, i), e = `${s.join("")}…`, n = this._getTextMetricsWidth(r.measureText(e)), i = this._getCharsToRemove(n, t, e.length);
    else {
      for (; e.length > 2 && n > t; )
        e = e.slice(0, -i), n = this._getTextMetricsWidth(r.measureText(e + "…")), i = this._getCharsToRemove(n, t, e.length);
      e += "…";
    }
    return { text: e, width: n };
  }
  _getTextMetricsWidth(e) {
    return e.actualBoundingBoxLeft !== void 0 ? Math.abs(e.actualBoundingBoxLeft) + Math.abs(e.actualBoundingBoxRight) : e.width;
  }
  _parseLineWordWrap(e = "", t, r) {
    const n = [], i = this.wordSplittingFunction ? this.wordSplittingFunction(e) : e.split(this._wordDivider);
    let s = this._getTextMetricsWidth(r.measureText(e));
    for (let a = 0; a < i.length; a++) {
      const f = a > 0 ? e + this._wordDivider + i[a] : i[0], o = this._getTextMetricsWidth(r.measureText(f));
      o > t && a > 0 ? (n.push({ text: e, width: s }), e = i[a], s = this._getTextMetricsWidth(r.measureText(e))) : (s = o, e = f);
    }
    return n.push({ text: e, width: s }), n;
  }
  _parseLineWordWrapEllipsis(e = "", t, r, n) {
    const i = this._parseLineWordWrap(e, t, n);
    for (let s = 1; s <= i.length; s++)
      if (this._computeHeightForLinesOf(s) > r && s > 1) {
        const f = i[s - 2], o = i[s - 1];
        i[s - 2] = this._parseLineEllipsis(f.text + this._wordDivider + o.text, t, n);
        const d = i.length - s + 1;
        for (let v = 0; v < d; v++)
          i.pop();
        return i;
      }
    return i;
  }
  _renderLines(e) {
    if (!this._fontOffset || !this._lines)
      return;
    const t = this._currentMeasure.height;
    let r = 0;
    switch (this._textVerticalAlignment) {
      case St.VERTICAL_ALIGNMENT_TOP:
        r = this._fontOffset.ascent;
        break;
      case St.VERTICAL_ALIGNMENT_BOTTOM:
        r = t - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent;
        break;
      case St.VERTICAL_ALIGNMENT_CENTER:
        r = this._fontOffset.ascent + (t - this._fontOffset.height * this._lines.length) / 2;
        break;
    }
    r += this._currentMeasure.top;
    for (let n = 0; n < this._lines.length; n++) {
      const i = this._lines[n];
      n !== 0 && this._lineSpacing.internalValue !== 0 && (this._lineSpacing.isPixel ? r += this._lineSpacing.getValue(this._host) : r = r + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height)), this._drawText(i.text, i.width, r, e), r += this._fontOffset.height;
    }
  }
  _computeHeightForLinesOf(e) {
    let t = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * e;
    if (e > 0 && this._lineSpacing.internalValue !== 0) {
      let r = 0;
      this._lineSpacing.isPixel ? r = this._lineSpacing.getValue(this._host) : r = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height), t += (e - 1) * r;
    }
    return t;
  }
  isDimensionFullyDefined(e) {
    return this.resizeToFit ? !0 : super.isDimensionFullyDefined(e);
  }
  /**
   * Given a width constraint applied on the text block, find the expected height
   * @returns expected height
   */
  computeExpectedHeight() {
    var e;
    if (this.text && this.widthInPixels) {
      const t = (e = gr.LastCreatedEngine) === null || e === void 0 ? void 0 : e.createCanvas(0, 0).getContext("2d");
      if (t) {
        this._applyStates(t), this._fontOffset || (this._fontOffset = St._GetFontOffset(t.font));
        const r = this._lines ? this._lines : this._breakLines(this.widthInPixels - this._paddingLeftInPixels - this._paddingRightInPixels, this.heightInPixels - this._paddingTopInPixels - this._paddingBottomInPixels, t);
        return this._computeHeightForLinesOf(r.length);
      }
    }
    return 0;
  }
  dispose() {
    super.dispose(), this.onTextChangedObservable.clear();
  }
}
C([
  M()
], oo.prototype, "resizeToFit", null);
C([
  M()
], oo.prototype, "textWrapping", null);
C([
  M()
], oo.prototype, "text", null);
C([
  M()
], oo.prototype, "textHorizontalAlignment", null);
C([
  M()
], oo.prototype, "textVerticalAlignment", null);
C([
  M()
], oo.prototype, "lineSpacing", null);
C([
  M()
], oo.prototype, "outlineWidth", null);
C([
  M()
], oo.prototype, "underline", null);
C([
  M()
], oo.prototype, "lineThrough", null);
C([
  M()
], oo.prototype, "applyOutlineToUnderline", null);
C([
  M()
], oo.prototype, "outlineColor", null);
C([
  M()
], oo.prototype, "wordDivider", null);
C([
  M()
], oo.prototype, "forceResizeWidth", null);
Ue("BABYLON.GUI.TextBlock", oo);
let ua = class DA extends St {
  /**
   * Gets a boolean indicating that the content is loaded
   */
  get isLoaded() {
    return this._loaded;
  }
  isReady() {
    return this.isLoaded;
  }
  /**
   * Gets or sets a boolean indicating if pointers should only be validated on pixels with alpha > 0.
   * Beware using this as this will consume more memory as the image has to be stored twice
   */
  get detectPointerOnOpaqueOnly() {
    return this._detectPointerOnOpaqueOnly;
  }
  set detectPointerOnOpaqueOnly(e) {
    this._detectPointerOnOpaqueOnly !== e && (this._detectPointerOnOpaqueOnly = e);
  }
  /**
   * Gets or sets the left value for slicing (9-patch)
   */
  get sliceLeft() {
    return this._sliceLeft;
  }
  set sliceLeft(e) {
    this._sliceLeft !== e && (this._sliceLeft = e, this._markAsDirty());
  }
  /**
   * Gets or sets the right value for slicing (9-patch)
   */
  get sliceRight() {
    return this._sliceRight;
  }
  set sliceRight(e) {
    this._sliceRight !== e && (this._sliceRight = e, this._markAsDirty());
  }
  /**
   * Gets or sets the top value for slicing (9-patch)
   */
  get sliceTop() {
    return this._sliceTop;
  }
  set sliceTop(e) {
    this._sliceTop !== e && (this._sliceTop = e, this._markAsDirty());
  }
  /**
   * Gets or sets the bottom value for slicing (9-patch)
   */
  get sliceBottom() {
    return this._sliceBottom;
  }
  set sliceBottom(e) {
    this._sliceBottom !== e && (this._sliceBottom = e, this._markAsDirty());
  }
  /**
   * Gets or sets the left coordinate in the source image
   */
  get sourceLeft() {
    return this._sourceLeft;
  }
  set sourceLeft(e) {
    this._sourceLeft !== e && (this._sourceLeft = e, this._markAsDirty());
  }
  /**
   * Gets or sets the top coordinate in the source image
   */
  get sourceTop() {
    return this._sourceTop;
  }
  set sourceTop(e) {
    this._sourceTop !== e && (this._sourceTop = e, this._markAsDirty());
  }
  /**
   * Gets or sets the width to capture in the source image
   */
  get sourceWidth() {
    return this._sourceWidth;
  }
  set sourceWidth(e) {
    this._sourceWidth !== e && (this._sourceWidth = e, this._markAsDirty());
  }
  /**
   * Gets or sets the height to capture in the source image
   */
  get sourceHeight() {
    return this._sourceHeight;
  }
  set sourceHeight(e) {
    this._sourceHeight !== e && (this._sourceHeight = e, this._markAsDirty());
  }
  /**
   * Gets the image width
   */
  get imageWidth() {
    return this._imageWidth;
  }
  /**
   * Gets the image height
   */
  get imageHeight() {
    return this._imageHeight;
  }
  /**
   * Gets or sets a boolean indicating if nine patch slices (left, top, right, bottom) should be read from image data
   */
  get populateNinePatchSlicesFromImage() {
    return this._populateNinePatchSlicesFromImage;
  }
  set populateNinePatchSlicesFromImage(e) {
    this._populateNinePatchSlicesFromImage !== e && (this._populateNinePatchSlicesFromImage = e, this._populateNinePatchSlicesFromImage && this._loaded && this._extractNinePatchSliceDataFromImage());
  }
  /** Indicates if the format of the image is SVG */
  get isSVG() {
    return this._isSVG;
  }
  /** Gets the status of the SVG attributes computation (sourceLeft, sourceTop, sourceWidth, sourceHeight) */
  get svgAttributesComputationCompleted() {
    return this._svgAttributesComputationCompleted;
  }
  /**
   * Gets or sets a boolean indicating if the image can force its container to adapt its size
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image
   */
  get autoScale() {
    return this._autoScale;
  }
  set autoScale(e) {
    this._autoScale !== e && (this._autoScale = e, e && this._loaded && this.synchronizeSizeWithContent());
  }
  /** Gets or sets the stretching mode used by the image */
  get stretch() {
    return this._stretch;
  }
  set stretch(e) {
    this._stretch !== e && (this._stretch = e, this._markAsDirty());
  }
  /**
   * @internal
   */
  _rotate90(e, t = !1) {
    var r, n;
    const i = this._domImage.width, s = this._domImage.height, a = ((n = (r = this._host) === null || r === void 0 ? void 0 : r.getScene()) === null || n === void 0 ? void 0 : n.getEngine()) || gr.LastCreatedEngine;
    if (!a)
      throw new Error("Invalid engine. Unable to create a canvas.");
    const f = a.createCanvas(s, i), o = f.getContext("2d");
    o.translate(f.width / 2, f.height / 2), o.rotate(e * Math.PI / 2), o.drawImage(this._domImage, 0, 0, i, s, -i / 2, -s / 2, i, s);
    const d = f.toDataURL("image/jpg"), v = new DA(this.name + "rotated", d);
    return t && (v._stretch = this._stretch, v._autoScale = this._autoScale, v._cellId = this._cellId, v._cellWidth = e % 1 ? this._cellHeight : this._cellWidth, v._cellHeight = e % 1 ? this._cellWidth : this._cellHeight), this._handleRotationForSVGImage(this, v, e), this._imageDataCache.data = null, v;
  }
  _handleRotationForSVGImage(e, t, r) {
    e._isSVG && (e._svgAttributesComputationCompleted ? (this._rotate90SourceProperties(e, t, r), this._markAsDirty()) : e.onSVGAttributesComputedObservable.addOnce(() => {
      this._rotate90SourceProperties(e, t, r), this._markAsDirty();
    }));
  }
  _rotate90SourceProperties(e, t, r) {
    let n = e.sourceLeft, i = e.sourceTop, s = e.domImage.width, a = e.domImage.height, f = n, o = i, d = e.sourceWidth, v = e.sourceHeight;
    if (r != 0) {
      const u = r < 0 ? -1 : 1;
      r = r % 4;
      for (let l = 0; l < Math.abs(r); ++l)
        f = -(i - a / 2) * u + a / 2, o = (n - s / 2) * u + s / 2, [d, v] = [v, d], r < 0 ? o -= v : f -= d, n = f, i = o, [s, a] = [a, s];
    }
    t.sourceLeft = f, t.sourceTop = o, t.sourceWidth = d, t.sourceHeight = v;
  }
  _extractNinePatchSliceDataFromImage() {
    var e, t;
    const r = this._domImage.width, n = this._domImage.height;
    if (!this._workingCanvas) {
      const f = ((t = (e = this._host) === null || e === void 0 ? void 0 : e.getScene()) === null || t === void 0 ? void 0 : t.getEngine()) || gr.LastCreatedEngine;
      if (!f)
        throw new Error("Invalid engine. Unable to create a canvas.");
      this._workingCanvas = f.createCanvas(r, n);
    }
    const s = this._workingCanvas.getContext("2d");
    s.drawImage(this._domImage, 0, 0, r, n);
    const a = s.getImageData(0, 0, r, n);
    this._sliceLeft = -1, this._sliceRight = -1;
    for (let f = 0; f < r; f++) {
      const o = a.data[f * 4 + 3];
      if (o > 127 && this._sliceLeft === -1) {
        this._sliceLeft = f;
        continue;
      }
      if (o < 127 && this._sliceLeft > -1) {
        this._sliceRight = f;
        break;
      }
    }
    this._sliceTop = -1, this._sliceBottom = -1;
    for (let f = 0; f < n; f++) {
      const o = a.data[f * r * 4 + 3];
      if (o > 127 && this._sliceTop === -1) {
        this._sliceTop = f;
        continue;
      }
      if (o < 127 && this._sliceTop > -1) {
        this._sliceBottom = f;
        break;
      }
    }
  }
  /**
   * Gets or sets the internal DOM image used to render the control
   */
  set domImage(e) {
    this._domImage = e, this._loaded = !1, this._imageDataCache.data = null, this._domImage.width ? this._onImageLoaded() : this._domImage.onload = () => {
      this._onImageLoaded();
    };
  }
  get domImage() {
    return this._domImage;
  }
  _onImageLoaded() {
    this._imageDataCache.data = null, this._imageWidth = this._domImage.width, this._imageHeight = this._domImage.height, this._loaded = !0, this._populateNinePatchSlicesFromImage && this._extractNinePatchSliceDataFromImage(), this._autoScale && this.synchronizeSizeWithContent(), this.onImageLoadedObservable.notifyObservers(this), this._markAsDirty();
  }
  /**
   * Gets the image source url
   */
  get source() {
    return this._source;
  }
  /**
   * Resets the internal Image Element cache. Can reduce memory usage.
   */
  static ResetImageCache() {
    DA.SourceImgCache.clear();
  }
  _removeCacheUsage(e) {
    const t = e && DA.SourceImgCache.get(e);
    t && (t.timesUsed -= 1, t.timesUsed === 0 && DA.SourceImgCache.delete(e));
  }
  /**
   * Gets or sets image source url
   */
  set source(e) {
    var t, r;
    if (this._source === e)
      return;
    this._removeCacheUsage(this._source), this._loaded = !1, this._source = e, this._imageDataCache.data = null, e && (e = this._svgCheck(e));
    const n = ((r = (t = this._host) === null || t === void 0 ? void 0 : t.getScene()) === null || r === void 0 ? void 0 : r.getEngine()) || gr.LastCreatedEngine;
    if (!n)
      throw new Error("Invalid engine. Unable to create a canvas.");
    if (e && DA.SourceImgCache.has(e)) {
      const i = DA.SourceImgCache.get(e);
      this._domImage = i.img, i.timesUsed += 1, i.loaded ? this._onImageLoaded() : i.waitingForLoadCallback.push(this._onImageLoaded.bind(this));
      return;
    }
    this._domImage = n.createCanvasImage(), e && DA.SourceImgCache.set(e, { img: this._domImage, timesUsed: 1, loaded: !1, waitingForLoadCallback: [this._onImageLoaded.bind(this)] }), this._domImage.onload = () => {
      if (e) {
        const i = DA.SourceImgCache.get(e);
        if (i) {
          i.loaded = !0;
          for (const s of i.waitingForLoadCallback)
            s();
          i.waitingForLoadCallback.length = 0;
          return;
        }
      }
      this._onImageLoaded();
    }, e && (ye.SetCorsBehavior(e, this._domImage), ye.SetReferrerPolicyBehavior(this.referrerPolicy, this._domImage), this._domImage.src = e);
  }
  /**
   * Checks for svg document with icon id present
   * @param value
   */
  _svgCheck(e) {
    if (window.SVGSVGElement && e.search(/.svg#/gi) !== -1 && e.indexOf("#") === e.lastIndexOf("#")) {
      this._isSVG = !0;
      const t = e.split("#")[0], r = e.split("#")[1], n = document.body.querySelector('object[data="' + t + '"]');
      if (n) {
        const i = n.contentDocument;
        if (i && i.documentElement) {
          const s = i.documentElement.getAttribute("viewBox"), a = Number(i.documentElement.getAttribute("width")), f = Number(i.documentElement.getAttribute("height"));
          if (i.getElementById(r) && s && a && f)
            return this._getSVGAttribs(n, r), e;
        }
        n.addEventListener("load", () => {
          this._getSVGAttribs(n, r);
        });
      } else {
        const i = document.createElement("object");
        i.data = t, i.type = "image/svg+xml", i.width = "0%", i.height = "0%", document.body.appendChild(i), i.onload = () => {
          const s = document.body.querySelector('object[data="' + t + '"]');
          s && this._getSVGAttribs(s, r);
        };
      }
      return t;
    } else
      return e;
  }
  /**
   * Sets sourceLeft, sourceTop, sourceWidth, sourceHeight automatically
   * given external svg file and icon id
   * @param svgsrc
   * @param elemid
   */
  _getSVGAttribs(e, t) {
    const r = e.contentDocument;
    if (r && r.documentElement) {
      const n = r.documentElement.getAttribute("viewBox"), i = Number(r.documentElement.getAttribute("width")), s = Number(r.documentElement.getAttribute("height")), a = r.getElementById(t);
      if (n && i && s && a) {
        const f = Number(n.split(" ")[2]), o = Number(n.split(" ")[3]), d = a.getBBox();
        let v = 1, u = 1, l = 0, P = 0;
        const p = a.transform.baseVal.consolidate().matrix;
        a.transform && a.transform.baseVal.consolidate() && (v = p.a, u = p.d, l = p.e, P = p.f), this.sourceLeft = (v * d.x + l) * i / f, this.sourceTop = (u * d.y + P) * s / o, this.sourceWidth = d.width * v * (i / f), this.sourceHeight = d.height * u * (s / o), this._svgAttributesComputationCompleted = !0, this.onSVGAttributesComputedObservable.notifyObservers(this);
      }
    }
  }
  /**
   * Gets or sets the cell width to use when animation sheet is enabled
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image
   */
  get cellWidth() {
    return this._cellWidth;
  }
  set cellWidth(e) {
    this._cellWidth !== e && (this._cellWidth = e, this._markAsDirty());
  }
  /**
   * Gets or sets the cell height to use when animation sheet is enabled
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image
   */
  get cellHeight() {
    return this._cellHeight;
  }
  set cellHeight(e) {
    this._cellHeight !== e && (this._cellHeight = e, this._markAsDirty());
  }
  /**
   * Gets or sets the cell id to use (this will turn on the animation sheet mode)
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image
   */
  get cellId() {
    return this._cellId;
  }
  set cellId(e) {
    this._cellId !== e && (this._cellId = e, this._markAsDirty());
  }
  /**
   * Creates a new Image
   * @param name defines the control name
   * @param url defines the image url
   */
  constructor(e, t = null) {
    super(e), this.name = e, this._workingCanvas = null, this._loaded = !1, this._stretch = DA.STRETCH_FILL, this._autoScale = !1, this._sourceLeft = 0, this._sourceTop = 0, this._sourceWidth = 0, this._sourceHeight = 0, this._svgAttributesComputationCompleted = !1, this._isSVG = !1, this._cellWidth = 0, this._cellHeight = 0, this._cellId = -1, this._populateNinePatchSlicesFromImage = !1, this._imageDataCache = { data: null, key: "" }, this.onImageLoadedObservable = new Oe(), this.onSVGAttributesComputedObservable = new Oe(), this.source = t;
  }
  /**
   * Tests if a given coordinates belong to the current control
   * @param x defines x coordinate to test
   * @param y defines y coordinate to test
   * @returns true if the coordinates are inside the control
   */
  contains(e, t) {
    if (!super.contains(e, t))
      return !1;
    if (!this._detectPointerOnOpaqueOnly || !this._workingCanvas)
      return !0;
    const r = this._currentMeasure.width | 0, n = this._currentMeasure.height | 0, i = r + "_" + n;
    let s = this._imageDataCache.data;
    if (!s || this._imageDataCache.key !== i) {
      const o = this._workingCanvas.getContext("2d");
      this._imageDataCache.data = s = o.getImageData(0, 0, r, n).data, this._imageDataCache.key = i;
    }
    return e = e - this._currentMeasure.left | 0, t = t - this._currentMeasure.top | 0, s[(e + t * r) * 4 + 3] > 0;
  }
  _getTypeName() {
    return "Image";
  }
  /** Force the control to synchronize with its content */
  synchronizeSizeWithContent() {
    this._loaded && (this.width = this._domImage.width + "px", this.height = this._domImage.height + "px");
  }
  _processMeasures(e, t) {
    if (this._loaded)
      switch (this._stretch) {
        case DA.STRETCH_NONE:
          break;
        case DA.STRETCH_FILL:
          break;
        case DA.STRETCH_UNIFORM:
          break;
        case DA.STRETCH_NINE_PATCH:
          break;
        case DA.STRETCH_EXTEND:
          this._autoScale && this.synchronizeSizeWithContent(), this.parent && this.parent.parent && (this.parent.adaptWidthToChildren = !0, this.parent.adaptHeightToChildren = !0);
          break;
      }
    super._processMeasures(e, t);
  }
  _prepareWorkingCanvasForOpaqueDetection() {
    var e, t;
    if (!this._detectPointerOnOpaqueOnly)
      return;
    const r = this._currentMeasure.width, n = this._currentMeasure.height;
    if (!this._workingCanvas) {
      const a = ((t = (e = this._host) === null || e === void 0 ? void 0 : e.getScene()) === null || t === void 0 ? void 0 : t.getEngine()) || gr.LastCreatedEngine;
      if (!a)
        throw new Error("Invalid engine. Unable to create a canvas.");
      this._workingCanvas = a.createCanvas(r, n);
    }
    this._workingCanvas.getContext("2d").clearRect(0, 0, r, n);
  }
  _drawImage(e, t, r, n, i, s, a, f, o) {
    if (e.drawImage(this._domImage, t, r, n, i, s, a, f, o), !this._detectPointerOnOpaqueOnly)
      return;
    const d = e.getTransform(), u = this._workingCanvas.getContext("2d");
    u.save();
    const l = s - this._currentMeasure.left, P = a - this._currentMeasure.top;
    u.setTransform(d.a, d.b, d.c, d.d, (l + f) / 2, (P + o) / 2), u.translate(-(l + f) / 2, -(P + o) / 2), u.drawImage(this._domImage, t, r, n, i, l, P, f, o), u.restore();
  }
  _draw(e) {
    e.save(), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY);
    let t, r, n, i;
    if (this.cellId == -1)
      t = this._sourceLeft, r = this._sourceTop, n = this._sourceWidth ? this._sourceWidth : this._imageWidth, i = this._sourceHeight ? this._sourceHeight : this._imageHeight;
    else {
      const s = this._domImage.naturalWidth / this.cellWidth, a = this.cellId / s >> 0, f = this.cellId % s;
      t = this.cellWidth * f, r = this.cellHeight * a, n = this.cellWidth, i = this.cellHeight;
    }
    if (this._prepareWorkingCanvasForOpaqueDetection(), this._applyStates(e), this._loaded)
      switch (this._stretch) {
        case DA.STRETCH_NONE:
          this._drawImage(e, t, r, n, i, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
          break;
        case DA.STRETCH_FILL:
          this._drawImage(e, t, r, n, i, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
          break;
        case DA.STRETCH_UNIFORM: {
          const s = this._currentMeasure.width / n, a = this._currentMeasure.height / i, f = Math.min(s, a), o = (this._currentMeasure.width - n * f) / 2, d = (this._currentMeasure.height - i * f) / 2;
          this._drawImage(e, t, r, n, i, this._currentMeasure.left + o, this._currentMeasure.top + d, n * f, i * f);
          break;
        }
        case DA.STRETCH_EXTEND:
          this._drawImage(e, t, r, n, i, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
          break;
        case DA.STRETCH_NINE_PATCH:
          this._renderNinePatch(e, t, r, n, i);
          break;
      }
    e.restore();
  }
  _renderNinePatch(e, t, r, n, i) {
    const s = this._sliceLeft, a = this._sliceTop, f = i - this._sliceBottom, o = n - this._sliceRight, d = this._sliceRight - this._sliceLeft, v = this._sliceBottom - this._sliceTop, u = this._currentMeasure.width - o - s + 2, l = this._currentMeasure.height - f - a + 2, P = this._currentMeasure.left + s - 1, p = this._currentMeasure.top + a - 1, c = this._currentMeasure.left + this._currentMeasure.width - o, H = this._currentMeasure.top + this._currentMeasure.height - f;
    this._drawImage(e, t, r, s, a, this._currentMeasure.left, this._currentMeasure.top, s, a), this._drawImage(e, t + this._sliceLeft, r, d, a, P + 1, this._currentMeasure.top, u - 2, a), this._drawImage(e, t + this._sliceRight, r, o, a, c, this._currentMeasure.top, o, a), this._drawImage(e, t, r + this._sliceTop, s, v, this._currentMeasure.left, p + 1, s, l - 2), this._drawImage(e, t + this._sliceLeft, r + this._sliceTop, d, v, P, p, u, l), this._drawImage(e, t + this._sliceRight, r + this._sliceTop, o, v, c, p + 1, o, l - 2), this._drawImage(e, t, r + this._sliceBottom, s, f, this._currentMeasure.left, H, s, f), this._drawImage(e, t + this.sliceLeft, r + this._sliceBottom, d, f, P + 1, H, u - 2, f), this._drawImage(e, t + this._sliceRight, r + this._sliceBottom, o, f, c, H, o, f);
  }
  dispose() {
    super.dispose(), this.onImageLoadedObservable.clear(), this.onSVGAttributesComputedObservable.clear(), this._removeCacheUsage(this._source);
  }
};
ua.SourceImgCache = /* @__PURE__ */ new Map();
ua.STRETCH_NONE = 0;
ua.STRETCH_FILL = 1;
ua.STRETCH_UNIFORM = 2;
ua.STRETCH_EXTEND = 3;
ua.STRETCH_NINE_PATCH = 4;
C([
  M()
], ua.prototype, "detectPointerOnOpaqueOnly", null);
C([
  M()
], ua.prototype, "sliceLeft", null);
C([
  M()
], ua.prototype, "sliceRight", null);
C([
  M()
], ua.prototype, "sliceTop", null);
C([
  M()
], ua.prototype, "sliceBottom", null);
C([
  M()
], ua.prototype, "sourceLeft", null);
C([
  M()
], ua.prototype, "sourceTop", null);
C([
  M()
], ua.prototype, "sourceWidth", null);
C([
  M()
], ua.prototype, "sourceHeight", null);
C([
  M()
], ua.prototype, "populateNinePatchSlicesFromImage", null);
C([
  M()
], ua.prototype, "autoScale", null);
C([
  M()
], ua.prototype, "stretch", null);
C([
  M()
], ua.prototype, "source", null);
C([
  M()
], ua.prototype, "cellWidth", null);
C([
  M()
], ua.prototype, "cellHeight", null);
C([
  M()
], ua.prototype, "cellId", null);
Ue("BABYLON.GUI.Image", ua);
class V2 extends p9 {
  /**
   * Returns the image part of the button (if any)
   */
  get image() {
    return this._image;
  }
  /**
   * Returns the TextBlock part of the button (if any)
   */
  get textBlock() {
    return this._textBlock;
  }
  /**
   * Creates a new Button
   * @param name defines the name of the button
   */
  constructor(e) {
    super(e), this.name = e, this.delegatePickingToChildren = !1, this.thickness = 1, this.isPointerBlocker = !0;
    let t = null;
    this.pointerEnterAnimation = () => {
      t = this.alpha, this.alpha -= 0.1;
    }, this.pointerOutAnimation = () => {
      t !== null && (this.alpha = t);
    }, this.pointerDownAnimation = () => {
      this.scaleX -= 0.05, this.scaleY -= 0.05;
    }, this.pointerUpAnimation = () => {
      this.scaleX += 0.05, this.scaleY += 0.05;
    };
  }
  _getTypeName() {
    return "Button";
  }
  // While being a container, the button behaves like a control.
  /**
   * @internal
   */
  _processPicking(e, t, r, n, i, s, a, f) {
    if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable || !super.contains(e, t))
      return !1;
    if (this.delegatePickingToChildren) {
      let o = !1;
      for (let d = this._children.length - 1; d >= 0; d--) {
        const v = this._children[d];
        if (v.isEnabled && v.isHitTestVisible && v.isVisible && !v.notRenderable && v.contains(e, t)) {
          o = !0;
          break;
        }
      }
      if (!o)
        return !1;
    }
    return this._processObservables(n, e, t, r, i, s, a, f), !0;
  }
  /**
   * @internal
   */
  _onPointerEnter(e, t) {
    return super._onPointerEnter(e, t) ? (!this.isReadOnly && this.pointerEnterAnimation && this.pointerEnterAnimation(), !0) : !1;
  }
  /**
   * @internal
   */
  _onPointerOut(e, t, r = !1) {
    !this.isReadOnly && this.pointerOutAnimation && this.pointerOutAnimation(), super._onPointerOut(e, t, r);
  }
  /**
   * @internal
   */
  _onPointerDown(e, t, r, n, i) {
    return super._onPointerDown(e, t, r, n, i) ? (!this.isReadOnly && this.pointerDownAnimation && this.pointerDownAnimation(), !0) : !1;
  }
  _getRectangleFill(e) {
    return this.isEnabled ? this._getBackgroundColor(e) : this._disabledColor;
  }
  /**
   * @internal
   */
  _onPointerUp(e, t, r, n, i, s) {
    !this.isReadOnly && this.pointerUpAnimation && this.pointerUpAnimation(), super._onPointerUp(e, t, r, n, i, s);
  }
  /**
   * Serializes the current button
   * @param serializationObject defines the JSON serialized object
   */
  serialize(e) {
    super.serialize(e), this._textBlock && (e.textBlockName = this._textBlock.name), this._image && (e.imageName = this._image.name);
  }
  /**
   * @internal
   */
  _parseFromContent(e, t) {
    super._parseFromContent(e, t), e.textBlockName && (this._textBlock = this.getChildByName(e.textBlockName)), e.imageName && (this._image = this.getChildByName(e.imageName));
  }
  // Statics
  /**
   * Creates a new button made with an image and a text
   * @param name defines the name of the button
   * @param text defines the text of the button
   * @param imageUrl defines the url of the image
   * @returns a new Button
   */
  static CreateImageButton(e, t, r) {
    const n = new this(e), i = new oo(e + "_button", t);
    i.textWrapping = !0, i.textHorizontalAlignment = St.HORIZONTAL_ALIGNMENT_CENTER, i.paddingLeft = "20%", n.addControl(i);
    const s = new ua(e + "_icon", r);
    return s.width = "20%", s.stretch = ua.STRETCH_UNIFORM, s.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, n.addControl(s), n._image = s, n._textBlock = i, n;
  }
  /**
   * Creates a new button made with an image
   * @param name defines the name of the button
   * @param imageUrl defines the url of the image
   * @returns a new Button
   */
  static CreateImageOnlyButton(e, t) {
    const r = new this(e), n = new ua(e + "_icon", t);
    return n.stretch = ua.STRETCH_FILL, n.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, r.addControl(n), r._image = n, r;
  }
  /**
   * Creates a new button made with a text
   * @param name defines the name of the button
   * @param text defines the text of the button
   * @returns a new Button
   */
  static CreateSimpleButton(e, t) {
    const r = new this(e), n = new oo(e + "_button", t);
    return n.textWrapping = !0, n.textHorizontalAlignment = St.HORIZONTAL_ALIGNMENT_CENTER, r.addControl(n), r._textBlock = n, r;
  }
  /**
   * Creates a new button made with an image and a centered text
   * @param name defines the name of the button
   * @param text defines the text of the button
   * @param imageUrl defines the url of the image
   * @returns a new Button
   */
  static CreateImageWithCenterTextButton(e, t, r) {
    const n = new this(e), i = new ua(e + "_icon", r);
    i.stretch = ua.STRETCH_FILL, n.addControl(i);
    const s = new oo(e + "_button", t);
    return s.textWrapping = !0, s.textHorizontalAlignment = St.HORIZONTAL_ALIGNMENT_CENTER, n.addControl(s), n._image = i, n._textBlock = s, n;
  }
}
Ue("BABYLON.GUI.Button", V2);
class ug extends Ev {
  /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
  get isVertical() {
    return this._isVertical;
  }
  set isVertical(e) {
    this._isVertical !== e && (this._isVertical = e, this._markAsDirty());
  }
  /**
   * Gets or sets the spacing (in pixels) between each child.
   */
  get spacing() {
    return this._spacing;
  }
  set spacing(e) {
    this._spacing !== e && (this._spacing = e, this._markAsDirty());
  }
  /**
   * Gets or sets panel width.
   * This value should not be set when in horizontal mode as it will be computed automatically
   */
  set width(e) {
    this._doNotTrackManualChanges || (this._manualWidth = !0), this._width.toString(this._host) !== e && this._width.fromString(e) && this._markAsDirty();
  }
  get width() {
    return this._width.toString(this._host);
  }
  /**
   * Gets or sets panel height.
   * This value should not be set when in vertical mode as it will be computed automatically
   */
  set height(e) {
    this._doNotTrackManualChanges || (this._manualHeight = !0), this._height.toString(this._host) !== e && this._height.fromString(e) && this._markAsDirty();
  }
  get height() {
    return this._height.toString(this._host);
  }
  /**
   * Creates a new StackPanel
   * @param name defines control name
   */
  constructor(e) {
    super(e), this.name = e, this._isVertical = !0, this._manualWidth = !1, this._manualHeight = !1, this._doNotTrackManualChanges = !1, this._spacing = 0, this.ignoreLayoutWarnings = !1;
  }
  _getTypeName() {
    return "StackPanel";
  }
  /**
   * @internal
   */
  _preMeasure(e, t) {
    for (const r of this._children)
      this._isVertical ? r.verticalAlignment = St.VERTICAL_ALIGNMENT_TOP : r.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT;
    super._preMeasure(e, t);
  }
  _additionalProcessing(e, t) {
    super._additionalProcessing(e, t), this._measureForChildren.copyFrom(e), this._measureForChildren.left = this._currentMeasure.left, this._measureForChildren.top = this._currentMeasure.top, (!this.isVertical || this._manualWidth) && (this._measureForChildren.width = this._currentMeasure.width), (this.isVertical || this._manualHeight) && (this._measureForChildren.height = this._currentMeasure.height);
  }
  _postMeasure() {
    let e = 0, t = 0;
    const r = this._children.length;
    for (let s = 0; s < r; s++) {
      const a = this._children[s];
      !a.isVisible || a.notRenderable || (this._isVertical ? (a.top !== t + "px" && (a.top = t + "px", this._rebuildLayout = !0, a._top.ignoreAdaptiveScaling = !0), !this.ignoreLayoutWarnings && !a.isDimensionFullyDefined("height") ? Se.Warn(`Control (Name:${a.name}, UniqueId:${a.uniqueId}) is using height in percentage mode inside a vertical StackPanel`, 1) : t += a._currentMeasure.height + a._paddingTopInPixels + a._paddingBottomInPixels + (s < r - 1 ? this._spacing : 0)) : (a.left !== e + "px" && (a.left = e + "px", this._rebuildLayout = !0, a._left.ignoreAdaptiveScaling = !0), !this.ignoreLayoutWarnings && !a.isDimensionFullyDefined("width") ? Se.Warn(`Control (Name:${a.name}, UniqueId:${a.uniqueId}) is using width in percentage mode inside a horizontal StackPanel`, 1) : e += a._currentMeasure.width + a._paddingLeftInPixels + a._paddingRightInPixels + (s < r - 1 ? this._spacing : 0)));
    }
    e += this._paddingLeftInPixels + this._paddingRightInPixels, t += this._paddingTopInPixels + this._paddingBottomInPixels, this._doNotTrackManualChanges = !0;
    let n = !1, i = !1;
    if ((!this._manualHeight || this.adaptHeightToChildren) && this._isVertical) {
      const s = this.height;
      this.height = t + "px", i = s !== this.height || !this._height.ignoreAdaptiveScaling;
    }
    if ((!this._manualWidth || this.adaptWidthToChildren) && !this._isVertical) {
      const s = this.width;
      this.width = e + "px", n = s !== this.width || !this._width.ignoreAdaptiveScaling;
    }
    i && (this._height.ignoreAdaptiveScaling = !0), n && (this._width.ignoreAdaptiveScaling = !0), this._doNotTrackManualChanges = !1, (n || i) && (this._rebuildLayout = !0), super._postMeasure();
  }
  _getManualDim(e) {
    return e === "width" ? this._manualWidth : this._manualHeight;
  }
  isDimensionFullyDefined(e) {
    if (e === "height" ? this.isVertical : !this.isVertical && !this._getManualDim(e)) {
      for (const t of this._children)
        if (!t.isDimensionFullyDefined(e))
          return !1;
      return !0;
    }
    return this.getDimension(e).isPixel || this._getAdaptDimTo(e);
  }
  /**
   * Serializes the current control
   * @param serializationObject defined the JSON serialized object
   */
  serialize(e) {
    super.serialize(e), e.manualWidth = this._manualWidth, e.manualHeight = this._manualHeight;
  }
  /**
   * @internal
   */
  _parseFromContent(e, t) {
    this._manualWidth = e.manualWidth, this._manualHeight = e.manualHeight, super._parseFromContent(e, t);
  }
}
C([
  M()
], ug.prototype, "ignoreLayoutWarnings", void 0);
C([
  M()
], ug.prototype, "isVertical", null);
C([
  M()
], ug.prototype, "spacing", null);
C([
  M()
], ug.prototype, "width", null);
C([
  M()
], ug.prototype, "height", null);
Ue("BABYLON.GUI.StackPanel", ug);
class Lm extends St {
  /** Gets or sets border thickness  */
  get thickness() {
    return this._thickness;
  }
  set thickness(e) {
    this._thickness !== e && (this._thickness = e, this._markAsDirty());
  }
  /** Gets or sets a value indicating the ratio between overall size and check size */
  get checkSizeRatio() {
    return this._checkSizeRatio;
  }
  set checkSizeRatio(e) {
    e = Math.max(Math.min(1, e), 0), this._checkSizeRatio !== e && (this._checkSizeRatio = e, this._markAsDirty());
  }
  /** Gets or sets background color */
  get background() {
    return this._background;
  }
  set background(e) {
    this._background !== e && (this._background = e, this._markAsDirty());
  }
  /** Gets or sets a boolean indicating if the checkbox is checked or not */
  get isChecked() {
    return this._isChecked;
  }
  set isChecked(e) {
    this._isChecked !== e && (this._isChecked = e, this._markAsDirty(), this.onIsCheckedChangedObservable.notifyObservers(e));
  }
  /**
   * Creates a new CheckBox
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._isChecked = !1, this._background = "black", this._checkSizeRatio = 0.8, this._thickness = 1, this.onIsCheckedChangedObservable = new Oe(), this.isPointerBlocker = !0;
  }
  _getTypeName() {
    return "Checkbox";
  }
  /**
   * @internal
   */
  _draw(e) {
    e.save(), this._applyStates(e);
    const t = this._currentMeasure.width - this._thickness, r = this._currentMeasure.height - this._thickness;
    if ((this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY), e.fillStyle = this._isEnabled ? this._background : this._disabledColor, e.fillRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, t, r), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0), this._isChecked) {
      e.fillStyle = this._isEnabled ? this.color : this._disabledColorItem;
      const n = t * this._checkSizeRatio, i = r * this._checkSizeRatio;
      e.fillRect(this._currentMeasure.left + this._thickness / 2 + (t - n) / 2, this._currentMeasure.top + this._thickness / 2 + (r - i) / 2, n, i);
    }
    e.strokeStyle = this.color, e.lineWidth = this._thickness, e.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, t, r), e.restore();
  }
  // Events
  /**
   * @internal
   */
  _onPointerDown(e, t, r, n, i) {
    return super._onPointerDown(e, t, r, n, i) ? (this.isReadOnly || (this.isChecked = !this.isChecked), !0) : !1;
  }
  /**
   * Utility function to easily create a checkbox with a header
   * @param title defines the label to use for the header
   * @param onValueChanged defines the callback to call when value changes
   * @returns a StackPanel containing the checkbox and a textBlock
   */
  static AddCheckBoxWithHeader(e, t) {
    const r = new ug();
    r.isVertical = !1, r.height = "30px";
    const n = new Lm();
    n.width = "20px", n.height = "20px", n.isChecked = !0, n.color = "green", n.onIsCheckedChangedObservable.add(t), r.addControl(n);
    const i = new oo();
    return i.text = e, i.width = "180px", i.paddingLeft = "5px", i.textHorizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, i.color = "white", r.addControl(i), r;
  }
}
C([
  M()
], Lm.prototype, "thickness", null);
C([
  M()
], Lm.prototype, "checkSizeRatio", null);
C([
  M()
], Lm.prototype, "background", null);
C([
  M()
], Lm.prototype, "isChecked", null);
Ue("BABYLON.GUI.Checkbox", Lm);
class UN {
  get text() {
    return this._characters ? this._characters.join("") : this._text;
  }
  set text(e) {
    this._text = e, this._characters = Array.from && Array.from(e);
  }
  get length() {
    return this._characters ? this._characters.length : this._text.length;
  }
  removePart(e, t, r) {
    if (this._text = this._text.slice(0, e) + (r || "") + this._text.slice(t), this._characters) {
      const n = r ? Array.from(r) : [];
      this._characters.splice(e, t - e, ...n);
    }
  }
  charAt(e) {
    return this._characters ? this._characters[e] : this._text.charAt(e);
  }
  substr(e, t) {
    if (this._characters) {
      isNaN(e) ? e = 0 : e >= 0 ? e = Math.min(e, this._characters.length) : e = this._characters.length + Math.max(e, -this._characters.length), t === void 0 ? t = this._characters.length - e : (isNaN(t) || t < 0) && (t = 0);
      const r = [];
      for (; --t >= 0; )
        r[t] = this._characters[e + t];
      return r.join("");
    }
    return this._text.substr(e, t);
  }
  substring(e, t) {
    if (this._characters) {
      isNaN(e) ? e = 0 : e > this._characters.length ? e = this._characters.length : e < 0 && (e = 0), t === void 0 ? t = this._characters.length : isNaN(t) ? t = 0 : t > this._characters.length ? t = this._characters.length : t < 0 && (t = 0);
      const r = [];
      let n = 0;
      for (; e < t; )
        r[n++] = this._characters[e++];
      return r.join("");
    }
    return this._text.substring(e, t);
  }
  isWord(e) {
    const t = /\w/g;
    return this._characters ? this._characters[e].search(t) !== -1 : this._text.search(t) !== -1;
  }
}
class K1 extends St {
  /** Gets or sets the maximum width allowed by the control */
  get maxWidth() {
    return this._maxWidth.toString(this._host);
  }
  /** Gets the maximum width allowed by the control in pixels */
  get maxWidthInPixels() {
    return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
  }
  set maxWidth(e) {
    this._maxWidth.toString(this._host) !== e && this._maxWidth.fromString(e) && this._markAsDirty();
  }
  /** Gets or sets the text highlighter transparency; default: 0.4 */
  get highligherOpacity() {
    return this._highligherOpacity;
  }
  set highligherOpacity(e) {
    this._highligherOpacity !== e && (this._highligherOpacity = e, this._markAsDirty());
  }
  /** Gets or sets a boolean indicating whether to select complete text by default on input focus */
  get onFocusSelectAll() {
    return this._onFocusSelectAll;
  }
  set onFocusSelectAll(e) {
    this._onFocusSelectAll !== e && (this._onFocusSelectAll = e, this._markAsDirty());
  }
  /** Gets or sets the text hightlight color */
  get textHighlightColor() {
    return this._textHighlightColor;
  }
  set textHighlightColor(e) {
    this._textHighlightColor !== e && (this._textHighlightColor = e, this._markAsDirty());
  }
  /** Gets or sets control margin */
  get margin() {
    return this._margin.toString(this._host);
  }
  /** Gets control margin in pixels */
  get marginInPixels() {
    return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);
  }
  set margin(e) {
    this._margin.toString(this._host) !== e && this._margin.fromString(e) && this._markAsDirty();
  }
  /** Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text */
  get autoStretchWidth() {
    return this._autoStretchWidth;
  }
  set autoStretchWidth(e) {
    this._autoStretchWidth !== e && (this._autoStretchWidth = e, this._markAsDirty());
  }
  /** Gets or sets border thickness */
  get thickness() {
    return this._thickness;
  }
  set thickness(e) {
    this._thickness !== e && (this._thickness = e, this._markAsDirty());
  }
  /** Gets or sets the background color when focused */
  get focusedBackground() {
    return this._focusedBackground;
  }
  set focusedBackground(e) {
    this._focusedBackground !== e && (this._focusedBackground = e, this._markAsDirty());
  }
  /** Gets or sets the background color when focused */
  get focusedColor() {
    return this._focusedColor;
  }
  set focusedColor(e) {
    this._focusedColor !== e && (this._focusedColor = e, this._markAsDirty());
  }
  /** Gets or sets the background color */
  get background() {
    return this._background;
  }
  set background(e) {
    this._background !== e && (this._background = e, this._markAsDirty());
  }
  /** Gets or sets the placeholder color */
  get placeholderColor() {
    return this._placeholderColor;
  }
  set placeholderColor(e) {
    this._placeholderColor !== e && (this._placeholderColor = e, this._markAsDirty());
  }
  /** Gets or sets the text displayed when the control is empty */
  get placeholderText() {
    return this._placeholderText;
  }
  set placeholderText(e) {
    this._placeholderText !== e && (this._placeholderText = e, this._markAsDirty());
  }
  /** Gets or sets the dead key. 0 to disable. */
  get deadKey() {
    return this._deadKey;
  }
  set deadKey(e) {
    this._deadKey = e;
  }
  /** Gets or sets the highlight text */
  get highlightedText() {
    return this._highlightedText;
  }
  set highlightedText(e) {
    this._highlightedText !== e && (this._highlightedText = e, this._markAsDirty());
  }
  /** Gets or sets if the current key should be added */
  get addKey() {
    return this._addKey;
  }
  set addKey(e) {
    this._addKey = e;
  }
  /** Gets or sets the value of the current key being entered */
  get currentKey() {
    return this._currentKey;
  }
  set currentKey(e) {
    this._currentKey = e;
  }
  /** Gets or sets the text displayed in the control */
  get text() {
    return this._textWrapper.text;
  }
  set text(e) {
    const t = e.toString();
    this._textWrapper || (this._textWrapper = new UN()), this._textWrapper.text !== t && (this._textWrapper.text = t, this._textHasChanged());
  }
  _textHasChanged() {
    this._markAsDirty(), this.onTextChangedObservable.notifyObservers(this);
  }
  /** Gets or sets control width */
  get width() {
    return this._width.toString(this._host);
  }
  set width(e) {
    this._width.toString(this._host) !== e && (this._width.fromString(e) && this._markAsDirty(), this.autoStretchWidth = !1);
  }
  /**
   * Creates a new InputText
   * @param name defines the control name
   * @param text defines the text of the control
   */
  constructor(e, t = "") {
    super(e), this.name = e, this._placeholderText = "", this._background = "#222222", this._focusedBackground = "#000000", this._focusedColor = "white", this._placeholderColor = "gray", this._thickness = 1, this._margin = new Ai(10, Ai.UNITMODE_PIXEL), this._autoStretchWidth = !0, this._maxWidth = new Ai(1, Ai.UNITMODE_PERCENTAGE, !1), this._isFocused = !1, this._blinkIsEven = !1, this._cursorOffset = 0, this._deadKey = !1, this._addKey = !0, this._currentKey = "", this._isTextHighlightOn = !1, this._textHighlightColor = "#d5e0ff", this._highligherOpacity = 0.4, this._highlightedText = "", this._startHighlightIndex = 0, this._endHighlightIndex = 0, this._cursorIndex = -1, this._onFocusSelectAll = !1, this._isPointerDown = !1, this.promptMessage = "Please enter text:", this.disableMobilePrompt = !1, this.onTextChangedObservable = new Oe(), this.onBeforeKeyAddObservable = new Oe(), this.onFocusObservable = new Oe(), this.onBlurObservable = new Oe(), this.onTextHighlightObservable = new Oe(), this.onTextCopyObservable = new Oe(), this.onTextCutObservable = new Oe(), this.onTextPasteObservable = new Oe(), this.onKeyboardEventProcessedObservable = new Oe(), this.text = t, this.isPointerBlocker = !0;
  }
  /** @internal */
  onBlur() {
    this._isFocused = !1, this._scrollLeft = null, this._cursorOffset = 0, clearTimeout(this._blinkTimeout), this._markAsDirty(), this.onBlurObservable.notifyObservers(this), this._host.unRegisterClipboardEvents(), this._onClipboardObserver && this._host.onClipboardObservable.remove(this._onClipboardObserver);
    const e = this._host.getScene();
    this._onPointerDblTapObserver && e && e.onPointerObservable.remove(this._onPointerDblTapObserver);
  }
  /** @internal */
  onFocus() {
    if (!this._isEnabled)
      return;
    if (this._scrollLeft = null, this._isFocused = !0, this._blinkIsEven = !1, this._cursorOffset = 0, this._markAsDirty(), this.onFocusObservable.notifyObservers(this), this._focusedBy === "touch" && !this.disableMobilePrompt) {
      const t = prompt(this.promptMessage);
      t !== null && (this.text = t), this._host.focusedControl = null;
      return;
    }
    this._host.registerClipboardEvents(), this._onClipboardObserver = this._host.onClipboardObservable.add((t) => {
      switch (t.type) {
        case qp.COPY:
          this._onCopyText(t.event), this.onTextCopyObservable.notifyObservers(this);
          break;
        case qp.CUT:
          this._onCutText(t.event), this.onTextCutObservable.notifyObservers(this);
          break;
        case qp.PASTE:
          this._onPasteText(t.event), this.onTextPasteObservable.notifyObservers(this);
          break;
        default:
          return;
      }
    });
    const e = this._host.getScene();
    e && (this._onPointerDblTapObserver = e.onPointerObservable.add((t) => {
      this._isFocused && t.type === ir.POINTERDOUBLETAP && this._processDblClick(t);
    })), this._onFocusSelectAll && this._selectAllText();
  }
  /**
   * Function to focus an inputText programmatically
   */
  focus() {
    this._host.moveFocusToControl(this);
  }
  /**
   * Function to unfocus an inputText programmatically
   */
  blur() {
    this._host.focusedControl = null;
  }
  _getTypeName() {
    return "InputText";
  }
  /**
   * Function called to get the list of controls that should not steal the focus from this control
   * @returns an array of controls
   */
  keepsFocusWith() {
    return this._connectedVirtualKeyboard ? [this._connectedVirtualKeyboard] : null;
  }
  /**
   * @internal
   */
  processKey(e, t, r) {
    var n;
    if (!this.isReadOnly && !(r && (r.ctrlKey || r.metaKey) && (e === 67 || e === 86 || e === 88))) {
      if (r && (r.ctrlKey || r.metaKey) && e === 65) {
        this._selectAllText(), r.preventDefault();
        return;
      }
      switch (e) {
        case 32:
          t = " ";
          break;
        case 191:
          r && r.preventDefault();
          break;
        case 8:
          if (this._textWrapper.text && this._textWrapper.length > 0) {
            if (this.isTextHighlightOn) {
              this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex), this._textHasChanged(), this.isTextHighlightOn = !1, this._cursorOffset = this._textWrapper.length - this._startHighlightIndex, this._blinkIsEven = !1, r && r.preventDefault();
              return;
            }
            if (this._cursorOffset === 0)
              this.text = this._textWrapper.substr(0, this._textWrapper.length - 1);
            else {
              const i = this._textWrapper.length - this._cursorOffset;
              i > 0 && (this._textWrapper.removePart(i - 1, i), this._textHasChanged());
            }
          }
          r && r.preventDefault();
          return;
        case 46:
          if (this.isTextHighlightOn) {
            this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex), this._textHasChanged(), this.isTextHighlightOn = !1, this._cursorOffset = this._textWrapper.length - this._startHighlightIndex, r && r.preventDefault();
            return;
          }
          if (this._textWrapper.text && this._textWrapper.length > 0 && this._cursorOffset > 0) {
            const i = this._textWrapper.length - this._cursorOffset;
            this._textWrapper.removePart(i, i + 1), this._textHasChanged(), this._cursorOffset--;
          }
          r && r.preventDefault();
          return;
        case 13:
          this._host.focusedControl = null, this.isTextHighlightOn = !1;
          return;
        case 35:
          this._cursorOffset = 0, this._blinkIsEven = !1, this.isTextHighlightOn = !1, this._markAsDirty();
          return;
        case 36:
          this._cursorOffset = this._textWrapper.length, this._blinkIsEven = !1, this.isTextHighlightOn = !1, this._markAsDirty();
          return;
        case 37:
          if (this._cursorOffset++, this._cursorOffset > this._textWrapper.length && (this._cursorOffset = this._textWrapper.length), r && r.shiftKey) {
            if (this._blinkIsEven = !1, r.ctrlKey || r.metaKey) {
              if (!this.isTextHighlightOn) {
                if (this._textWrapper.length === this._cursorOffset)
                  return;
                this._endHighlightIndex = this._textWrapper.length - this._cursorOffset + 1;
              }
              this._startHighlightIndex = 0, this._cursorIndex = this._textWrapper.length - this._endHighlightIndex, this._cursorOffset = this._textWrapper.length, this.isTextHighlightOn = !0, this._markAsDirty();
              return;
            }
            this.isTextHighlightOn ? this._cursorIndex === -1 && (this._cursorIndex = this._textWrapper.length - this._endHighlightIndex, this._cursorOffset = this._startHighlightIndex === 0 ? this._textWrapper.length : this._textWrapper.length - this._startHighlightIndex + 1) : (this.isTextHighlightOn = !0, this._cursorIndex = this._cursorOffset >= this._textWrapper.length ? this._textWrapper.length : this._cursorOffset - 1), this._cursorIndex < this._cursorOffset ? (this._endHighlightIndex = this._textWrapper.length - this._cursorIndex, this._startHighlightIndex = this._textWrapper.length - this._cursorOffset) : this._cursorIndex > this._cursorOffset ? (this._endHighlightIndex = this._textWrapper.length - this._cursorOffset, this._startHighlightIndex = this._textWrapper.length - this._cursorIndex) : this.isTextHighlightOn = !1, this._markAsDirty();
            return;
          }
          this.isTextHighlightOn && (this._cursorOffset = this._textWrapper.length - this._startHighlightIndex, this.isTextHighlightOn = !1), r && (r.ctrlKey || r.metaKey) && (this._cursorOffset = this._textWrapper.length, r.preventDefault()), this._blinkIsEven = !1, this.isTextHighlightOn = !1, this._cursorIndex = -1, this._markAsDirty();
          return;
        case 39:
          if (this._cursorOffset--, this._cursorOffset < 0 && (this._cursorOffset = 0), r && r.shiftKey) {
            if (this._blinkIsEven = !1, r.ctrlKey || r.metaKey) {
              if (!this.isTextHighlightOn) {
                if (this._cursorOffset === 0)
                  return;
                this._startHighlightIndex = this._textWrapper.length - this._cursorOffset - 1;
              }
              this._endHighlightIndex = this._textWrapper.length, this.isTextHighlightOn = !0, this._cursorIndex = this._textWrapper.length - this._startHighlightIndex, this._cursorOffset = 0, this._markAsDirty();
              return;
            }
            this.isTextHighlightOn ? this._cursorIndex === -1 && (this._cursorIndex = this._textWrapper.length - this._startHighlightIndex, this._cursorOffset = this._textWrapper.length === this._endHighlightIndex ? 0 : this._textWrapper.length - this._endHighlightIndex - 1) : (this.isTextHighlightOn = !0, this._cursorIndex = this._cursorOffset <= 0 ? 0 : this._cursorOffset + 1), this._cursorIndex < this._cursorOffset ? (this._endHighlightIndex = this._textWrapper.length - this._cursorIndex, this._startHighlightIndex = this._textWrapper.length - this._cursorOffset) : this._cursorIndex > this._cursorOffset ? (this._endHighlightIndex = this._textWrapper.length - this._cursorOffset, this._startHighlightIndex = this._textWrapper.length - this._cursorIndex) : this.isTextHighlightOn = !1, this._markAsDirty();
            return;
          }
          this.isTextHighlightOn && (this._cursorOffset = this._textWrapper.length - this._endHighlightIndex, this.isTextHighlightOn = !1), r && (r.ctrlKey || r.metaKey) && (this._cursorOffset = 0, r.preventDefault()), this._blinkIsEven = !1, this.isTextHighlightOn = !1, this._cursorIndex = -1, this._markAsDirty();
          return;
      }
      if (e === 32 && (t = (n = r == null ? void 0 : r.key) !== null && n !== void 0 ? n : " "), this._deadKey = t === "Dead", t && (e === -1 || // Direct access
      e === 32 || // Space
      e === 34 || // "    add support for single and double quotes
      e === 39 || // '
      e > 47 && e < 64 || // Numbers
      e > 64 && e < 91 || // Letters
      e > 159 && e < 193 || // Special characters
      e > 218 && e < 223 || // Special characters
      e > 95 && e < 112) && (this._currentKey = t, this.onBeforeKeyAddObservable.notifyObservers(this), t = this._currentKey, this._addKey && !this._deadKey))
        if (this.isTextHighlightOn)
          this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex, t), this._textHasChanged(), this._cursorOffset = this._textWrapper.length - (this._startHighlightIndex + 1), this.isTextHighlightOn = !1, this._blinkIsEven = !1, this._markAsDirty();
        else if (this._cursorOffset === 0)
          this.text += this._deadKey && (r != null && r.key) ? r.key : t;
        else {
          const i = this._textWrapper.length - this._cursorOffset;
          this._textWrapper.removePart(i, i, t), this._textHasChanged();
        }
    }
  }
  /**
   * @internal
   */
  _updateValueFromCursorIndex(e) {
    if (this._blinkIsEven = !1, this._cursorIndex === -1)
      this._cursorIndex = e;
    else if (this._cursorIndex < this._cursorOffset)
      this._endHighlightIndex = this._textWrapper.length - this._cursorIndex, this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;
    else if (this._cursorIndex > this._cursorOffset)
      this._endHighlightIndex = this._textWrapper.length - this._cursorOffset, this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;
    else {
      this.isTextHighlightOn = !1, this._markAsDirty();
      return;
    }
    this.isTextHighlightOn = !0, this._markAsDirty();
  }
  /**
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _processDblClick(e) {
    this._startHighlightIndex = this._textWrapper.length - this._cursorOffset, this._endHighlightIndex = this._startHighlightIndex;
    let t, r;
    do
      r = this._endHighlightIndex < this._textWrapper.length && this._textWrapper.isWord(this._endHighlightIndex) ? ++this._endHighlightIndex : 0, t = this._startHighlightIndex > 0 && this._textWrapper.isWord(this._startHighlightIndex - 1) ? --this._startHighlightIndex : 0;
    while (t || r);
    this._cursorOffset = this._textWrapper.length - this._startHighlightIndex, this.isTextHighlightOn = !0, this._clickedCoordinate = null, this._blinkIsEven = !0, this._cursorIndex = -1, this._markAsDirty();
  }
  /** @internal */
  _selectAllText() {
    this._blinkIsEven = !0, this.isTextHighlightOn = !0, this._startHighlightIndex = 0, this._endHighlightIndex = this._textWrapper.length, this._cursorOffset = this._textWrapper.length, this._cursorIndex = -1, this._markAsDirty();
  }
  /**
   * Handles the keyboard event
   * @param evt Defines the KeyboardEvent
   */
  processKeyboard(e) {
    this.processKey(e.keyCode, e.key, e), this.onKeyboardEventProcessedObservable.notifyObservers(e);
  }
  /**
   * @internal
   */
  _onCopyText(e) {
    this.isTextHighlightOn = !1;
    try {
      e.clipboardData && e.clipboardData.setData("text/plain", this._highlightedText);
    } catch {
    }
    this._host.clipboardData = this._highlightedText;
  }
  /**
   * @internal
   */
  _onCutText(e) {
    if (this._highlightedText) {
      this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex), this._textHasChanged(), this.isTextHighlightOn = !1, this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
      try {
        e.clipboardData && e.clipboardData.setData("text/plain", this._highlightedText);
      } catch {
      }
      this._host.clipboardData = this._highlightedText, this._highlightedText = "";
    }
  }
  /**
   * @internal
   */
  _onPasteText(e) {
    let t = "";
    e.clipboardData && e.clipboardData.types.indexOf("text/plain") !== -1 ? t = e.clipboardData.getData("text/plain") : t = this._host.clipboardData;
    const r = this._textWrapper.length - this._cursorOffset;
    this._textWrapper.removePart(r, r, t), this._textHasChanged();
  }
  _draw(e) {
    e.save(), this._applyStates(e), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY), this._isFocused ? this._focusedBackground && (e.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor, e.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height)) : this._background && (e.fillStyle = this._isEnabled ? this._background : this._disabledColor, e.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height)), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0), (!this._fontOffset || this._wasDirty) && (this._fontOffset = St._GetFontOffset(e.font));
    const t = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._tempParentMeasure.width);
    this.color && (e.fillStyle = this.color);
    let r = this._beforeRenderText(this._textWrapper);
    !this._isFocused && !this._textWrapper.text && this._placeholderText && (r = new UN(), r.text = this._placeholderText, this._placeholderColor && (e.fillStyle = this._placeholderColor)), this._textWidth = e.measureText(r.text).width;
    const n = this._margin.getValueInPixel(this._host, this._tempParentMeasure.width) * 2;
    this._autoStretchWidth && (this.width = Math.min(this._maxWidth.getValueInPixel(this._host, this._tempParentMeasure.width), this._textWidth + n) + "px", this._autoStretchWidth = !0);
    const i = this._fontOffset.ascent + (this._currentMeasure.height - this._fontOffset.height) / 2, s = this._width.getValueInPixel(this._host, this._tempParentMeasure.width) - n;
    if (e.save(), e.beginPath(), e.rect(t, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, s + 2, this._currentMeasure.height), e.clip(), this._isFocused && this._textWidth > s) {
      const a = t - this._textWidth + s;
      this._scrollLeft || (this._scrollLeft = a);
    } else
      this._scrollLeft = t;
    if (e.fillText(r.text, this._scrollLeft, this._currentMeasure.top + i), this._isFocused) {
      if (this._clickedCoordinate) {
        const f = this._scrollLeft + this._textWidth - this._clickedCoordinate;
        let o = 0;
        this._cursorOffset = 0;
        let d = 0;
        do
          this._cursorOffset && (d = Math.abs(f - o)), this._cursorOffset++, o = e.measureText(r.substr(r.length - this._cursorOffset, this._cursorOffset)).width;
        while (o < f && r.length >= this._cursorOffset);
        Math.abs(f - o) > d && this._cursorOffset--, this._blinkIsEven = !1, this._clickedCoordinate = null;
      }
      if (!this._blinkIsEven) {
        const a = r.substr(r.length - this._cursorOffset), f = e.measureText(a).width;
        let o = this._scrollLeft + this._textWidth - f;
        o < t ? (this._scrollLeft += t - o, o = t, this._markAsDirty()) : o > t + s && (this._scrollLeft += t + s - o, o = t + s, this._markAsDirty()), this.isTextHighlightOn || e.fillRect(o, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, 2, this._fontOffset.height);
      }
      if (clearTimeout(this._blinkTimeout), this._blinkTimeout = setTimeout(() => {
        this._blinkIsEven = !this._blinkIsEven, this._markAsDirty();
      }, 500), this.isTextHighlightOn) {
        clearTimeout(this._blinkTimeout);
        const a = e.measureText(r.substring(this._startHighlightIndex)).width;
        let f = this._scrollLeft + this._textWidth - a;
        this._highlightedText = r.substring(this._startHighlightIndex, this._endHighlightIndex);
        let o = e.measureText(r.substring(this._startHighlightIndex, this._endHighlightIndex)).width;
        f < t && (o = o - (t - f), o || (o = e.measureText(r.charAt(r.length - this._cursorOffset)).width), f = t), e.globalAlpha = this._highligherOpacity, e.fillStyle = this._textHighlightColor, e.fillRect(f, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, o, this._fontOffset.height), e.globalAlpha = 1;
      }
    }
    e.restore(), this._thickness && (this._isFocused ? this.focusedColor && (e.strokeStyle = this.focusedColor) : this.color && (e.strokeStyle = this.color), e.lineWidth = this._thickness, e.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness)), e.restore();
  }
  _onPointerDown(e, t, r, n, i) {
    return super._onPointerDown(e, t, r, n, i) ? this.isReadOnly ? !0 : (this._clickedCoordinate = t.x, this.isTextHighlightOn = !1, this._highlightedText = "", this._cursorIndex = -1, this._isPointerDown = !0, this._host._capturingControl[r] = this, this._focusedBy = i.event.pointerType, this._host.focusedControl === this ? (clearTimeout(this._blinkTimeout), this._markAsDirty(), !0) : this._isEnabled ? (this._host.focusedControl = this, !0) : !1) : !1;
  }
  _onPointerMove(e, t, r, n) {
    this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly && (this._clickedCoordinate = t.x, this._markAsDirty(), this._updateValueFromCursorIndex(this._cursorOffset)), super._onPointerMove(e, t, r, n);
  }
  _onPointerUp(e, t, r, n, i) {
    this._isPointerDown = !1, delete this._host._capturingControl[r], super._onPointerUp(e, t, r, n, i);
  }
  _beforeRenderText(e) {
    return e;
  }
  /** @internal */
  set isTextHighlightOn(e) {
    this._isTextHighlightOn !== e && (e && this.onTextHighlightObservable.notifyObservers(this), this._isTextHighlightOn = e);
  }
  /** @internal */
  get isTextHighlightOn() {
    return this._isTextHighlightOn;
  }
  dispose() {
    super.dispose(), this.onBlurObservable.clear(), this.onFocusObservable.clear(), this.onTextChangedObservable.clear(), this.onTextCopyObservable.clear(), this.onTextCutObservable.clear(), this.onTextPasteObservable.clear(), this.onTextHighlightObservable.clear(), this.onKeyboardEventProcessedObservable.clear();
  }
}
C([
  M()
], K1.prototype, "promptMessage", void 0);
C([
  M()
], K1.prototype, "disableMobilePrompt", void 0);
C([
  M()
], K1.prototype, "maxWidth", null);
C([
  M()
], K1.prototype, "highligherOpacity", null);
C([
  M()
], K1.prototype, "onFocusSelectAll", null);
C([
  M()
], K1.prototype, "textHighlightColor", null);
C([
  M()
], K1.prototype, "margin", null);
C([
  M()
], K1.prototype, "autoStretchWidth", null);
C([
  M()
], K1.prototype, "thickness", null);
C([
  M()
], K1.prototype, "focusedBackground", null);
C([
  M()
], K1.prototype, "focusedColor", null);
C([
  M()
], K1.prototype, "background", null);
C([
  M()
], K1.prototype, "placeholderColor", null);
C([
  M()
], K1.prototype, "placeholderText", null);
C([
  M()
], K1.prototype, "deadKey", null);
C([
  M()
], K1.prototype, "text", null);
C([
  M()
], K1.prototype, "width", null);
Ue("BABYLON.GUI.InputText", K1);
class Iu extends Ev {
  /**
   * Sets/Gets a boolean indicating that control content must be clipped
   * Please note that not clipping content may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children
   */
  set clipContent(e) {
    this._clipContent = e;
    for (const t in this._cells)
      this._cells[t].clipContent = e;
  }
  get clipContent() {
    return this._clipContent;
  }
  /**
   * Sets/Gets a boolean indicating if the children are clipped to the current control bounds.
   * Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children
   */
  set clipChildren(e) {
    this._clipChildren = e;
    for (const t in this._cells)
      this._cells[t].clipChildren = e;
  }
  get clipChildren() {
    return this._clipChildren;
  }
  /**
   * Gets the number of columns
   */
  get columnCount() {
    return this._columnDefinitions.length;
  }
  /**
   * Gets the number of rows
   */
  get rowCount() {
    return this._rowDefinitions.length;
  }
  /** Gets the list of children */
  get children() {
    return this._childControls;
  }
  /** Gets the list of cells (e.g. the containers) */
  get cells() {
    return this._cells;
  }
  /**
   * Gets the definition of a specific row
   * @param index defines the index of the row
   * @returns the row definition
   */
  getRowDefinition(e) {
    return e < 0 || e >= this._rowDefinitions.length ? null : this._rowDefinitions[e];
  }
  /**
   * Gets the definition of a specific column
   * @param index defines the index of the column
   * @returns the column definition
   */
  getColumnDefinition(e) {
    return e < 0 || e >= this._columnDefinitions.length ? null : this._columnDefinitions[e];
  }
  /**
   * Adds a new row to the grid
   * @param height defines the height of the row (either in pixel or a value between 0 and 1)
   * @param isPixel defines if the height is expressed in pixel (or in percentage)
   * @returns the current grid
   */
  addRowDefinition(e, t = !1) {
    return this._rowDefinitions.push(new Ai(e, t ? Ai.UNITMODE_PIXEL : Ai.UNITMODE_PERCENTAGE)), this._rowDefinitionObservers.push(this._rowDefinitions[this.rowCount - 1].onChangedObservable.add(() => this._markAsDirty())), this._markAsDirty(), this;
  }
  /**
   * Adds a new column to the grid
   * @param width defines the width of the column (either in pixel or a value between 0 and 1)
   * @param isPixel defines if the width is expressed in pixel (or in percentage)
   * @returns the current grid
   */
  addColumnDefinition(e, t = !1) {
    return this._columnDefinitions.push(new Ai(e, t ? Ai.UNITMODE_PIXEL : Ai.UNITMODE_PERCENTAGE)), this._columnDefinitionObservers.push(this._columnDefinitions[this.columnCount - 1].onChangedObservable.add(() => this._markAsDirty())), this._markAsDirty(), this;
  }
  /**
   * Update a row definition
   * @param index defines the index of the row to update
   * @param height defines the height of the row (either in pixel or a value between 0 and 1)
   * @param isPixel defines if the weight is expressed in pixel (or in percentage)
   * @returns the current grid
   */
  setRowDefinition(e, t, r = !1) {
    if (e < 0 || e >= this._rowDefinitions.length)
      return this;
    const n = this._rowDefinitions[e];
    return n && n.isPixel === r && n.value === t ? this : (this._rowDefinitions[e].onChangedObservable.remove(this._rowDefinitionObservers[e]), this._rowDefinitions[e] = new Ai(t, r ? Ai.UNITMODE_PIXEL : Ai.UNITMODE_PERCENTAGE), this._rowDefinitionObservers[e] = this._rowDefinitions[e].onChangedObservable.add(() => this._markAsDirty()), this._markAsDirty(), this);
  }
  /**
   * Update a column definition
   * @param index defines the index of the column to update
   * @param width defines the width of the column (either in pixel or a value between 0 and 1)
   * @param isPixel defines if the width is expressed in pixel (or in percentage)
   * @returns the current grid
   */
  setColumnDefinition(e, t, r = !1) {
    if (e < 0 || e >= this._columnDefinitions.length)
      return this;
    const n = this._columnDefinitions[e];
    return n && n.isPixel === r && n.value === t ? this : (this._columnDefinitions[e].onChangedObservable.remove(this._columnDefinitionObservers[e]), this._columnDefinitions[e] = new Ai(t, r ? Ai.UNITMODE_PIXEL : Ai.UNITMODE_PERCENTAGE), this._columnDefinitionObservers[e] = this._columnDefinitions[e].onChangedObservable.add(() => this._markAsDirty()), this._markAsDirty(), this);
  }
  /**
   * Gets the list of children stored in a specific cell
   * @param row defines the row to check
   * @param column defines the column to check
   * @returns the list of controls
   */
  getChildrenAt(e, t) {
    const r = this._cells[`${e}:${t}`];
    return r ? r.children : null;
  }
  /**
   * Gets a string representing the child cell info (row x column)
   * @param child defines the control to get info from
   * @returns a string containing the child cell info (row x column)
   */
  getChildCellInfo(e) {
    return e._tag;
  }
  _removeCell(e, t) {
    if (e) {
      super.removeControl(e);
      for (const r of e.children) {
        const n = this._childControls.indexOf(r);
        n !== -1 && this._childControls.splice(n, 1);
      }
      delete this._cells[t];
    }
  }
  _offsetCell(e, t) {
    if (this._cells[t]) {
      this._cells[e] = this._cells[t];
      for (const r of this._cells[e].children)
        r._tag = e;
      delete this._cells[t];
    }
  }
  /**
   * Remove a column definition at specified index
   * @param index defines the index of the column to remove
   * @returns the current grid
   */
  removeColumnDefinition(e) {
    if (e < 0 || e >= this._columnDefinitions.length)
      return this;
    for (let t = 0; t < this._rowDefinitions.length; t++) {
      const r = `${t}:${e}`, n = this._cells[r];
      this._removeCell(n, r);
    }
    for (let t = 0; t < this._rowDefinitions.length; t++)
      for (let r = e + 1; r < this._columnDefinitions.length; r++) {
        const n = `${t}:${r - 1}`, i = `${t}:${r}`;
        this._offsetCell(n, i);
      }
    return this._columnDefinitions[e].onChangedObservable.remove(this._columnDefinitionObservers[e]), this._columnDefinitions.splice(e, 1), this._columnDefinitionObservers.splice(e, 1), this._markAsDirty(), this;
  }
  /**
   * Remove a row definition at specified index
   * @param index defines the index of the row to remove
   * @returns the current grid
   */
  removeRowDefinition(e) {
    if (e < 0 || e >= this._rowDefinitions.length)
      return this;
    for (let t = 0; t < this._columnDefinitions.length; t++) {
      const r = `${e}:${t}`, n = this._cells[r];
      this._removeCell(n, r);
    }
    for (let t = 0; t < this._columnDefinitions.length; t++)
      for (let r = e + 1; r < this._rowDefinitions.length; r++) {
        const n = `${r - 1}:${t}`, i = `${r}:${t}`;
        this._offsetCell(n, i);
      }
    return this._rowDefinitions[e].onChangedObservable.remove(this._rowDefinitionObservers[e]), this._rowDefinitions.splice(e, 1), this._rowDefinitionObservers.splice(e, 1), this._markAsDirty(), this;
  }
  /**
   * Adds a new control to the current grid
   * @param control defines the control to add
   * @param row defines the row where to add the control (0 by default)
   * @param column defines the column where to add the control (0 by default)
   * @returns the current grid
   */
  addControl(e, t = 0, r = 0) {
    if (this._rowDefinitions.length === 0 && this.addRowDefinition(1, !1), this._columnDefinitions.length === 0 && this.addColumnDefinition(1, !1), this._childControls.indexOf(e) !== -1)
      return ye.Warn(`Control (Name:${e.name}, UniqueId:${e.uniqueId}) is already associated with this grid. You must remove it before reattaching it`), this;
    const n = Math.min(t, this._rowDefinitions.length - 1), i = Math.min(r, this._columnDefinitions.length - 1), s = `${n}:${i}`;
    let a = this._cells[s];
    return a || (a = new Ev(s), this._cells[s] = a, a.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, a.verticalAlignment = St.VERTICAL_ALIGNMENT_TOP, a.clipContent = this.clipContent, a.clipChildren = this.clipChildren, super.addControl(a)), a.addControl(e), this._childControls.push(e), e._tag = s, e.parent = this, this._markAsDirty(), this;
  }
  /**
   * Removes a control from the current container
   * @param control defines the control to remove
   * @returns the current container
   */
  removeControl(e) {
    const t = this._childControls.indexOf(e);
    t !== -1 && this._childControls.splice(t, 1);
    const r = this._cells[e._tag];
    return r && (r.removeControl(e), e._tag = null), this._markAsDirty(), this;
  }
  /**
   * Creates a new Grid
   * @param name defines control name
   */
  constructor(e) {
    super(e), this.name = e, this._rowDefinitions = new Array(), this._rowDefinitionObservers = [], this._columnDefinitions = new Array(), this._columnDefinitionObservers = [], this._cells = {}, this._childControls = new Array();
  }
  _getTypeName() {
    return "Grid";
  }
  _getGridDefinitions(e) {
    const t = [], r = [], n = [], i = [];
    let s = this._currentMeasure.width, a = 0, f = this._currentMeasure.height, o = 0, d = 0;
    for (const l of this._rowDefinitions) {
      if (l.isPixel) {
        const P = l.getValue(this._host);
        f -= P, r[d] = P;
      } else
        o += l.value;
      d++;
    }
    let v = 0;
    d = 0;
    for (const l of this._rowDefinitions) {
      if (i.push(v), l.isPixel)
        v += l.getValue(this._host);
      else {
        const P = Math.round(l.value / o * f);
        v += P, r[d] = P;
      }
      d++;
    }
    d = 0;
    for (const l of this._columnDefinitions) {
      if (l.isPixel) {
        const P = l.getValue(this._host);
        s -= P, t[d] = P;
      } else
        a += l.value;
      d++;
    }
    let u = 0;
    d = 0;
    for (const l of this._columnDefinitions) {
      if (n.push(u), l.isPixel)
        u += l.getValue(this._host);
      else {
        const P = Math.round(l.value / a * s);
        u += P, t[d] = P;
      }
      d++;
    }
    e(n, i, t, r);
  }
  _additionalProcessing(e, t) {
    this._getGridDefinitions((r, n, i, s) => {
      for (const a in this._cells) {
        if (!Object.prototype.hasOwnProperty.call(this._cells, a))
          continue;
        const f = a.split(":"), o = parseInt(f[0]), d = parseInt(f[1]), v = this._cells[a];
        v.leftInPixels = r[d], v.topInPixels = n[o], v.widthInPixels = i[d], v.heightInPixels = s[o], v._left.ignoreAdaptiveScaling = !0, v._top.ignoreAdaptiveScaling = !0, v._width.ignoreAdaptiveScaling = !0, v._height.ignoreAdaptiveScaling = !0;
      }
    }), super._additionalProcessing(e, t);
  }
  _flagDescendantsAsMatrixDirty() {
    for (const e in this._cells) {
      if (!Object.prototype.hasOwnProperty.call(this._cells, e))
        continue;
      this._cells[e]._markMatrixAsDirty();
    }
  }
  _renderHighlightSpecific(e) {
    super._renderHighlightSpecific(e), this._getGridDefinitions((t, r, n, i) => {
      for (let s = 0; s < t.length; s++) {
        const a = this._currentMeasure.left + t[s] + n[s];
        e.beginPath(), e.moveTo(a, this._currentMeasure.top), e.lineTo(a, this._currentMeasure.top + this._currentMeasure.height), e.stroke();
      }
      for (let s = 0; s < r.length; s++) {
        const a = this._currentMeasure.top + r[s] + i[s];
        e.beginPath(), e.moveTo(this._currentMeasure.left, a), e.lineTo(this._currentMeasure.left + this._currentMeasure.width, a), e.stroke();
      }
    }), e.restore();
  }
  /** Releases associated resources */
  dispose() {
    super.dispose();
    for (const e of this._childControls)
      e.dispose();
    for (let e = 0; e < this._rowDefinitions.length; e++)
      this._rowDefinitions[e].onChangedObservable.remove(this._rowDefinitionObservers[e]);
    for (let e = 0; e < this._columnDefinitions.length; e++)
      this._columnDefinitions[e].onChangedObservable.remove(this._columnDefinitionObservers[e]);
    this._rowDefinitionObservers.length = 0, this._rowDefinitions.length = 0, this._columnDefinitionObservers.length = 0, this._columnDefinitions.length = 0, this._cells = {}, this._childControls.length = 0;
  }
  /**
   * Serializes the current control
   * @param serializationObject defined the JSON serialized object
   */
  serialize(e) {
    super.serialize(e), e.columnCount = this.columnCount, e.rowCount = this.rowCount, e.columns = [], e.rows = [], e.tags = [];
    for (let t = 0; t < this.columnCount; ++t) {
      const r = this.getColumnDefinition(t), n = { value: r == null ? void 0 : r.getValue(this.host), unit: r == null ? void 0 : r.unit };
      e.columns.push(n);
    }
    for (let t = 0; t < this.rowCount; ++t) {
      const r = this.getRowDefinition(t), n = { value: r == null ? void 0 : r.getValue(this.host), unit: r == null ? void 0 : r.unit };
      e.rows.push(n);
    }
    this.children.forEach((t) => {
      e.tags.push(t._tag);
    });
  }
  /**
   * @internal
   */
  _parseFromContent(e, t) {
    super._parseFromContent(e, t);
    const r = [];
    this.children.forEach((n) => {
      r.push(n);
    }), this.removeRowDefinition(0), this.removeColumnDefinition(0);
    for (let n = 0; n < e.columnCount; ++n) {
      const i = e.columns[n].value, s = e.columns[n].unit;
      this.addColumnDefinition(i, s === 1);
    }
    for (let n = 0; n < e.rowCount; ++n) {
      const i = e.rows[n].value, s = e.rows[n].unit;
      this.addRowDefinition(i, s === 1);
    }
    for (let n = 0; n < r.length; ++n) {
      const i = e.tags[n];
      let s = parseInt(i.substring(0, i.search(":")));
      isNaN(s) && (s = 0);
      let a = parseInt(i.substring(i.search(":") + 1));
      isNaN(a) && (a = 0), this.addControl(r[n], s, a);
    }
  }
}
C([
  M()
], Iu.prototype, "clipContent", null);
Ue("BABYLON.GUI.Grid", Iu);
class Cu extends St {
  /** Gets or sets the color of the color picker */
  get value() {
    return this._value;
  }
  set value(e) {
    this._value.equals(e) || (this._value.copyFrom(e), this._value.toHSVToRef(this._tmpColor), this._h = this._tmpColor.r, this._s = Math.max(this._tmpColor.g, 1e-5), this._v = Math.max(this._tmpColor.b, 1e-5), this._markAsDirty(), this._value.r <= Cu._Epsilon && (this._value.r = 0), this._value.g <= Cu._Epsilon && (this._value.g = 0), this._value.b <= Cu._Epsilon && (this._value.b = 0), this._value.r >= 1 - Cu._Epsilon && (this._value.r = 1), this._value.g >= 1 - Cu._Epsilon && (this._value.g = 1), this._value.b >= 1 - Cu._Epsilon && (this._value.b = 1), this.onValueChangedObservable.notifyObservers(this._value));
  }
  /**
   * Gets or sets control width
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get width() {
    return this._width.toString(this._host);
  }
  set width(e) {
    this._width.toString(this._host) !== e && this._width.fromString(e) && (this._width.getValue(this._host) === 0 && (e = "1px", this._width.fromString(e)), this._height.fromString(e), this._markAsDirty());
  }
  /**
   * Gets or sets control height
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size
   */
  get height() {
    return this._height.toString(this._host);
  }
  /** Gets or sets control height */
  set height(e) {
    this._height.toString(this._host) !== e && this._height.fromString(e) && (this._height.getValue(this._host) === 0 && (e = "1px", this._height.fromString(e)), this._width.fromString(e), this._markAsDirty());
  }
  /** Gets or sets control size */
  get size() {
    return this.width;
  }
  set size(e) {
    this.width = e;
  }
  /**
   * Creates a new ColorPicker
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._value = Ne.Red(), this._tmpColor = new Ne(), this._pointerStartedOnSquare = !1, this._pointerStartedOnWheel = !1, this._squareLeft = 0, this._squareTop = 0, this._squareSize = 0, this._h = 360, this._s = 1, this._v = 1, this._lastPointerDownId = -1, this.onValueChangedObservable = new Oe(), this._pointerIsDown = !1, this.value = new Ne(0.88, 0.1, 0.1), this.size = "200px", this.isPointerBlocker = !0;
  }
  _getTypeName() {
    return "ColorPicker";
  }
  /**
   * @internal
   */
  _preMeasure(e) {
    e.width < e.height ? this._currentMeasure.height = e.width : this._currentMeasure.width = e.height;
  }
  _updateSquareProps() {
    const e = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5, t = e * 0.2, n = (e - t) * 2 / Math.sqrt(2), i = e - n * 0.5;
    this._squareLeft = this._currentMeasure.left + i, this._squareTop = this._currentMeasure.top + i, this._squareSize = n;
  }
  _drawGradientSquare(e, t, r, n, i, s) {
    const a = s.createLinearGradient(t, r, n + t, r);
    a.addColorStop(0, "#fff"), a.addColorStop(1, "hsl(" + e + ", 100%, 50%)"), s.fillStyle = a, s.fillRect(t, r, n, i);
    const f = s.createLinearGradient(t, r, t, i + r);
    f.addColorStop(0, "rgba(0,0,0,0)"), f.addColorStop(1, "#000"), s.fillStyle = f, s.fillRect(t, r, n, i);
  }
  _drawCircle(e, t, r, n) {
    n.beginPath(), n.arc(e, t, r + 1, 0, 2 * Math.PI, !1), n.lineWidth = 3, n.strokeStyle = "#333333", n.stroke(), n.beginPath(), n.arc(e, t, r, 0, 2 * Math.PI, !1), n.lineWidth = 3, n.strokeStyle = "#ffffff", n.stroke();
  }
  _createColorWheelCanvas(e, t) {
    const r = gr.LastCreatedEngine;
    if (!r)
      throw new Error("Invalid engine. Unable to create a canvas.");
    const n = r.createCanvas(e * 2, e * 2), i = n.getContext("2d"), s = i.getImageData(0, 0, e * 2, e * 2), a = s.data, f = this._tmpColor, o = e * e, d = e - t, v = d * d;
    for (let u = -e; u < e; u++)
      for (let l = -e; l < e; l++) {
        const P = u * u + l * l;
        if (P > o || P < v)
          continue;
        const p = Math.sqrt(P), c = Math.atan2(l, u);
        Ne.HSVtoRGBToRef(c * 180 / Math.PI + 180, p / e, 1, f);
        const H = (u + e + (l + e) * 2 * e) * 4;
        a[H] = f.r * 255, a[H + 1] = f.g * 255, a[H + 2] = f.b * 255;
        let T = (p - d) / (e - d), q = 0.2;
        const b = 0.2, j = 0.04, w = 50, m = 150;
        e < w ? q = b : e > m ? q = j : q = (j - b) * (e - w) / (m - w) + b, T = (p - d) / (e - d), T < q ? a[H + 3] = 255 * (T / q) : T > 1 - q ? a[H + 3] = 255 * (1 - (T - (1 - q)) / q) : a[H + 3] = 255;
      }
    return i.putImageData(s, 0, 0), n;
  }
  /**
   * @internal
   */
  _draw(e) {
    e.save(), this._applyStates(e);
    const t = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5, r = t * 0.2, n = this._currentMeasure.left, i = this._currentMeasure.top;
    (!this._colorWheelCanvas || this._colorWheelCanvas.width != t * 2) && (this._colorWheelCanvas = this._createColorWheelCanvas(t, r)), this._updateSquareProps(), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY, e.fillRect(this._squareLeft, this._squareTop, this._squareSize, this._squareSize)), e.drawImage(this._colorWheelCanvas, n, i), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0), this._drawGradientSquare(this._h, this._squareLeft, this._squareTop, this._squareSize, this._squareSize, e);
    let s = this._squareLeft + this._squareSize * this._s, a = this._squareTop + this._squareSize * (1 - this._v);
    this._drawCircle(s, a, t * 0.04, e);
    const f = t - r * 0.5;
    s = n + t + Math.cos((this._h - 180) * Math.PI / 180) * f, a = i + t + Math.sin((this._h - 180) * Math.PI / 180) * f, this._drawCircle(s, a, r * 0.35, e), e.restore();
  }
  _updateValueFromPointer(e, t) {
    if (this._pointerStartedOnWheel) {
      const r = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5, n = r + this._currentMeasure.left, i = r + this._currentMeasure.top;
      this._h = Math.atan2(t - i, e - n) * 180 / Math.PI + 180;
    } else
      this._pointerStartedOnSquare && (this._updateSquareProps(), this._s = (e - this._squareLeft) / this._squareSize, this._v = 1 - (t - this._squareTop) / this._squareSize, this._s = Math.min(this._s, 1), this._s = Math.max(this._s, Cu._Epsilon), this._v = Math.min(this._v, 1), this._v = Math.max(this._v, Cu._Epsilon));
    Ne.HSVtoRGBToRef(this._h, this._s, this._v, this._tmpColor), this.value = this._tmpColor;
  }
  _isPointOnSquare(e, t) {
    this._updateSquareProps();
    const r = this._squareLeft, n = this._squareTop, i = this._squareSize;
    return e >= r && e <= r + i && t >= n && t <= n + i;
  }
  _isPointOnWheel(e, t) {
    const r = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5, n = r + this._currentMeasure.left, i = r + this._currentMeasure.top, s = r * 0.2, a = r - s, f = r * r, o = a * a, d = e - n, v = t - i, u = d * d + v * v;
    return u <= f && u >= o;
  }
  _onPointerDown(e, t, r, n, i) {
    if (!super._onPointerDown(e, t, r, n, i))
      return !1;
    if (this.isReadOnly)
      return !0;
    this._pointerIsDown = !0, this._pointerStartedOnSquare = !1, this._pointerStartedOnWheel = !1, this._invertTransformMatrix.transformCoordinates(t.x, t.y, this._transformedPosition);
    const s = this._transformedPosition.x, a = this._transformedPosition.y;
    return this._isPointOnSquare(s, a) ? this._pointerStartedOnSquare = !0 : this._isPointOnWheel(s, a) && (this._pointerStartedOnWheel = !0), this._updateValueFromPointer(s, a), this._host._capturingControl[r] = this, this._lastPointerDownId = r, !0;
  }
  _onPointerMove(e, t, r, n) {
    if (r == this._lastPointerDownId) {
      if (!this.isReadOnly) {
        this._invertTransformMatrix.transformCoordinates(t.x, t.y, this._transformedPosition);
        const i = this._transformedPosition.x, s = this._transformedPosition.y;
        this._pointerIsDown && this._updateValueFromPointer(i, s);
      }
      super._onPointerMove(e, t, r, n);
    }
  }
  _onPointerUp(e, t, r, n, i, s) {
    this._pointerIsDown = !1, delete this._host._capturingControl[r], super._onPointerUp(e, t, r, n, i, s);
  }
  _onCanvasBlur() {
    this._forcePointerUp(), super._onCanvasBlur();
  }
  /**
   * This function expands the color picker by creating a color picker dialog with manual
   * color value input and the ability to save colors into an array to be used later in
   * subsequent launches of the dialogue.
   * @param advancedTexture defines the AdvancedDynamicTexture the dialog is assigned to
   * @param options defines size for dialog and options for saved colors. Also accepts last color picked as hex string and saved colors array as hex strings.
   * @param options.pickerWidth
   * @param options.pickerHeight
   * @param options.headerHeight
   * @param options.lastColor
   * @param options.swatchLimit
   * @param options.numSwatchesPerLine
   * @param options.savedColors
   * @returns picked color as a hex string and the saved colors array as hex strings.
   */
  static ShowPickerDialogAsync(e, t) {
    return new Promise((r) => {
      t.pickerWidth = t.pickerWidth || "640px", t.pickerHeight = t.pickerHeight || "400px", t.headerHeight = t.headerHeight || "35px", t.lastColor = t.lastColor || "#000000", t.swatchLimit = t.swatchLimit || 20, t.numSwatchesPerLine = t.numSwatchesPerLine || 10;
      const n = t.swatchLimit / t.numSwatchesPerLine, i = parseFloat(t.pickerWidth) / t.numSwatchesPerLine, s = Math.floor(i * 0.25), a = s * (t.numSwatchesPerLine + 1), f = Math.floor((parseFloat(t.pickerWidth) - a) / t.numSwatchesPerLine), o = f * n + s * (n + 1), d = (parseInt(t.pickerHeight) + o + Math.floor(f * 0.25)).toString() + "px", v = "#c0c0c0", u = "#535353", l = "#414141", P = "515151", p = "#555555", c = "#454545", H = "#404040", T = Ne.FromHexString("#dddddd"), q = T.r + T.g + T.b, b = "#aaaaaa", j = "#ffffff";
      let w, m;
      const I = ["R", "G", "B"], N = "#454545", k = "#f0f0f0";
      let R, y, O = !1, Y, ee, Z;
      const te = new Iu();
      if (te.name = "Dialog Container", te.width = t.pickerWidth, t.savedColors) {
        te.height = d;
        const vr = parseInt(t.pickerHeight) / parseInt(d);
        te.addRowDefinition(vr, !1), te.addRowDefinition(1 - vr, !1);
      } else
        te.height = t.pickerHeight, te.addRowDefinition(1, !1);
      if (e.addControl(te), t.savedColors) {
        y = new Iu(), y.name = "Swatch Drawer", y.verticalAlignment = St.VERTICAL_ALIGNMENT_TOP, y.background = u, y.width = t.pickerWidth;
        const vr = t.savedColors.length / t.numSwatchesPerLine;
        let Fr;
        vr == 0 ? Fr = 0 : Fr = vr + 1, y.height = (f * vr + Fr * s).toString() + "px", y.top = Math.floor(f * 0.25).toString() + "px";
        for (let pr = 0; pr < Math.ceil(t.savedColors.length / t.numSwatchesPerLine) * 2 + 1; pr++)
          pr % 2 != 0 ? y.addRowDefinition(f, !0) : y.addRowDefinition(s, !0);
        for (let pr = 0; pr < t.numSwatchesPerLine * 2 + 1; pr++)
          pr % 2 != 0 ? y.addColumnDefinition(f, !0) : y.addColumnDefinition(s, !0);
        te.addControl(y, 1, 0);
      }
      const fe = new Iu();
      fe.name = "Picker Panel", fe.height = t.pickerHeight;
      const _ = parseInt(t.headerHeight) / parseInt(t.pickerHeight), G = [_, 1 - _];
      fe.addRowDefinition(G[0], !1), fe.addRowDefinition(G[1], !1), te.addControl(fe, 0, 0);
      const L = new p9();
      L.name = "Dialogue Header Bar", L.background = "#cccccc", L.thickness = 0, fe.addControl(L, 0, 0);
      const $ = V2.CreateSimpleButton("closeButton", "a");
      $.fontFamily = "coreglyphs";
      const ae = Ne.FromHexString(L.background), Pe = new Ne(1 - ae.r, 1 - ae.g, 1 - ae.b);
      $.color = Pe.toHexString(), $.fontSize = Math.floor(parseInt(t.headerHeight) * 0.6), $.textBlock.textVerticalAlignment = St.VERTICAL_ALIGNMENT_CENTER, $.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_RIGHT, $.height = $.width = t.headerHeight, $.background = L.background, $.thickness = 0, $.pointerDownAnimation = () => {
      }, $.pointerUpAnimation = () => {
        $.background = L.background;
      }, $.pointerEnterAnimation = () => {
        $.color = L.background, $.background = "red";
      }, $.pointerOutAnimation = () => {
        $.color = Pe.toHexString(), $.background = L.background;
      }, $.onPointerClickObservable.add(() => {
        oi(Tt.background);
      }), fe.addControl($, 0, 0);
      const ge = new Iu();
      ge.name = "Dialogue Body", ge.background = u;
      const me = [0.4375, 0.5625];
      ge.addRowDefinition(1, !1), ge.addColumnDefinition(me[0], !1), ge.addColumnDefinition(me[1], !1), fe.addControl(ge, 1, 0);
      const Xe = new Iu();
      Xe.name = "Picker Grid", Xe.addRowDefinition(0.85, !1), Xe.addRowDefinition(0.15, !1), ge.addControl(Xe, 0, 0);
      const De = new Cu();
      De.name = "GUI Color Picker", t.pickerHeight < t.pickerWidth ? De.width = 0.89 : De.height = 0.89, De.value = Ne.FromHexString(t.lastColor), De.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_CENTER, De.verticalAlignment = St.VERTICAL_ALIGNMENT_CENTER, De.onPointerDownObservable.add(() => {
        Z = De.name, ee = "", Ii(!1);
      }), De.onValueChangedObservable.add(function(vr) {
        Z == De.name && Rn(vr, De.name);
      }), Xe.addControl(De, 0, 0);
      const ne = new Iu();
      ne.name = "Dialogue Right Half", ne.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT;
      const re = [0.514, 0.486];
      ne.addRowDefinition(re[0], !1), ne.addRowDefinition(re[1], !1), ge.addControl(ne, 1, 1);
      const ve = new Iu();
      ve.name = "Swatches and Buttons";
      const qe = [0.417, 0.583];
      ve.addRowDefinition(1, !1), ve.addColumnDefinition(qe[0], !1), ve.addColumnDefinition(qe[1], !1), ne.addControl(ve, 0, 0);
      const ke = new Iu();
      ke.name = "New and Current Swatches";
      const be = [0.04, 0.16, 0.64, 0.16];
      ke.addRowDefinition(be[0], !1), ke.addRowDefinition(be[1], !1), ke.addRowDefinition(be[2], !1), ke.addRowDefinition(be[3], !1), ve.addControl(ke, 0, 0);
      const Fe = new Iu();
      Fe.name = "Active Swatches", Fe.width = 0.67, Fe.addRowDefinition(0.5, !1), Fe.addRowDefinition(0.5, !1), ke.addControl(Fe, 2, 0);
      const Ke = Math.floor(parseInt(t.pickerWidth) * me[1] * qe[0] * 0.11), nt = Math.floor(parseInt(t.pickerHeight) * G[1] * re[0] * be[1] * 0.5);
      let ut;
      t.pickerWidth > t.pickerHeight ? ut = nt : ut = Ke;
      const bt = new oo();
      bt.text = "new", bt.name = "New Color Label", bt.color = v, bt.fontSize = ut, ke.addControl(bt, 1, 0);
      const wt = new p9();
      wt.name = "New Color Swatch", wt.background = t.lastColor, wt.thickness = 0, Fe.addControl(wt, 0, 0);
      const Tt = V2.CreateSimpleButton("currentSwatch", "");
      Tt.background = t.lastColor, Tt.thickness = 0, Tt.onPointerClickObservable.add(() => {
        const vr = Ne.FromHexString(Tt.background);
        Rn(vr, Tt.name), Ii(!1);
      }), Tt.pointerDownAnimation = () => {
      }, Tt.pointerUpAnimation = () => {
      }, Tt.pointerEnterAnimation = () => {
      }, Tt.pointerOutAnimation = () => {
      }, Fe.addControl(Tt, 1, 0);
      const lr = new p9();
      lr.name = "Swatch Outline", lr.width = 0.67, lr.thickness = 2, lr.color = H, lr.isHitTestVisible = !1, ke.addControl(lr, 2, 0);
      const Qt = new oo();
      Qt.name = "Current Color Label", Qt.text = "current", Qt.color = v, Qt.fontSize = ut, ke.addControl(Qt, 3, 0);
      const tr = new Iu();
      tr.name = "Button Grid", tr.height = 0.8;
      const br = 1 / 3;
      tr.addRowDefinition(br, !1), tr.addRowDefinition(br, !1), tr.addRowDefinition(br, !1), ve.addControl(tr, 0, 1);
      const Xn = Math.floor(parseInt(t.pickerWidth) * me[1] * qe[1] * 0.67).toString() + "px", qr = Math.floor(parseInt(t.pickerHeight) * G[1] * re[0] * (parseFloat(tr.height.toString()) / 100) * br * 0.7).toString() + "px";
      parseFloat(Xn) > parseFloat(qr) ? w = Math.floor(parseFloat(qr) * 0.45) : w = Math.floor(parseFloat(Xn) * 0.11);
      const En = V2.CreateSimpleButton("butOK", "OK");
      En.width = Xn, En.height = qr, En.verticalAlignment = St.VERTICAL_ALIGNMENT_CENTER, En.thickness = 2, En.color = v, En.fontSize = w, En.background = u, En.onPointerEnterObservable.add(() => {
        En.background = l;
      }), En.onPointerOutObservable.add(() => {
        En.background = u;
      }), En.pointerDownAnimation = () => {
        En.background = P;
      }, En.pointerUpAnimation = () => {
        En.background = l;
      }, En.onPointerClickObservable.add(() => {
        Ii(!1), oi(wt.background);
      }), tr.addControl(En, 0, 0);
      const Bn = V2.CreateSimpleButton("butCancel", "Cancel");
      Bn.width = Xn, Bn.height = qr, Bn.verticalAlignment = St.VERTICAL_ALIGNMENT_CENTER, Bn.thickness = 2, Bn.color = v, Bn.fontSize = w, Bn.background = u, Bn.onPointerEnterObservable.add(() => {
        Bn.background = l;
      }), Bn.onPointerOutObservable.add(() => {
        Bn.background = u;
      }), Bn.pointerDownAnimation = () => {
        Bn.background = P;
      }, Bn.pointerUpAnimation = () => {
        Bn.background = l;
      }, Bn.onPointerClickObservable.add(() => {
        Ii(!1), oi(Tt.background);
      }), tr.addControl(Bn, 1, 0), t.savedColors && (Y = V2.CreateSimpleButton("butSave", "Save"), Y.width = Xn, Y.height = qr, Y.verticalAlignment = St.VERTICAL_ALIGNMENT_CENTER, Y.thickness = 2, Y.fontSize = w, t.savedColors.length < t.swatchLimit ? (Y.color = v, Y.background = u) : _i(Y, !0), Y.onPointerEnterObservable.add(() => {
        t.savedColors && t.savedColors.length < t.swatchLimit && (Y.background = l);
      }), Y.onPointerOutObservable.add(() => {
        t.savedColors && t.savedColors.length < t.swatchLimit && (Y.background = u);
      }), Y.pointerDownAnimation = () => {
        t.savedColors && t.savedColors.length < t.swatchLimit && (Y.background = P);
      }, Y.pointerUpAnimation = () => {
        t.savedColors && t.savedColors.length < t.swatchLimit && (Y.background = l);
      }, Y.onPointerClickObservable.add(() => {
        t.savedColors && (t.savedColors.length == 0 && ji(!0), t.savedColors.length < t.swatchLimit && is(wt.background, Y), Ii(!1));
      }), t.savedColors.length > 0 && ji(!0), tr.addControl(Y, 2, 0));
      const Fi = new Iu();
      Fi.name = "Dialog Lower Right", Fi.addRowDefinition(0.02, !1), Fi.addRowDefinition(0.63, !1), Fi.addRowDefinition(0.21, !1), Fi.addRowDefinition(0.14, !1), ne.addControl(Fi, 1, 0);
      const Gt = Ne.FromHexString(t.lastColor), xr = new Iu();
      xr.name = "RGB Values", xr.width = 0.82, xr.verticalAlignment = St.VERTICAL_ALIGNMENT_CENTER, xr.addRowDefinition(1 / 3, !1), xr.addRowDefinition(1 / 3, !1), xr.addRowDefinition(1 / 3, !1), xr.addColumnDefinition(0.1, !1), xr.addColumnDefinition(0.2, !1), xr.addColumnDefinition(0.7, !1), Fi.addControl(xr, 1, 0);
      for (let vr = 0; vr < I.length; vr++) {
        const Fr = new oo();
        Fr.text = I[vr], Fr.color = v, Fr.fontSize = w, xr.addControl(Fr, vr, 0);
      }
      const Br = new K1();
      Br.width = 0.83, Br.height = 0.72, Br.name = "rIntField", Br.fontSize = w, Br.text = (Gt.r * 255).toString(), Br.color = k, Br.background = N, Br.onFocusObservable.add(() => {
        Z = Br.name, ee = Br.text, Ii(!1);
      }), Br.onBlurObservable.add(() => {
        Br.text == "" && (Br.text = "0"), Vn(Br, "r"), Z == Br.name && (Z = "");
      }), Br.onTextChangedObservable.add(() => {
        Z == Br.name && Vn(Br, "r");
      }), xr.addControl(Br, 0, 1);
      const nn = new K1();
      nn.width = 0.83, nn.height = 0.72, nn.name = "gIntField", nn.fontSize = w, nn.text = (Gt.g * 255).toString(), nn.color = k, nn.background = N, nn.onFocusObservable.add(() => {
        Z = nn.name, ee = nn.text, Ii(!1);
      }), nn.onBlurObservable.add(() => {
        nn.text == "" && (nn.text = "0"), Vn(nn, "g"), Z == nn.name && (Z = "");
      }), nn.onTextChangedObservable.add(() => {
        Z == nn.name && Vn(nn, "g");
      }), xr.addControl(nn, 1, 1);
      const sn = new K1();
      sn.width = 0.83, sn.height = 0.72, sn.name = "bIntField", sn.fontSize = w, sn.text = (Gt.b * 255).toString(), sn.color = k, sn.background = N, sn.onFocusObservable.add(() => {
        Z = sn.name, ee = sn.text, Ii(!1);
      }), sn.onBlurObservable.add(() => {
        sn.text == "" && (sn.text = "0"), Vn(sn, "b"), Z == sn.name && (Z = "");
      }), sn.onTextChangedObservable.add(() => {
        Z == sn.name && Vn(sn, "b");
      }), xr.addControl(sn, 2, 1);
      const Pn = new K1();
      Pn.width = 0.95, Pn.height = 0.72, Pn.name = "rDecField", Pn.fontSize = w, Pn.text = Gt.r.toString(), Pn.color = k, Pn.background = N, Pn.onFocusObservable.add(() => {
        Z = Pn.name, ee = Pn.text, Ii(!1);
      }), Pn.onBlurObservable.add(() => {
        (parseFloat(Pn.text) == 0 || Pn.text == "") && (Pn.text = "0", ki(Pn, "r")), Z == Pn.name && (Z = "");
      }), Pn.onTextChangedObservable.add(() => {
        Z == Pn.name && ki(Pn, "r");
      }), xr.addControl(Pn, 0, 2);
      const an = new K1();
      an.width = 0.95, an.height = 0.72, an.name = "gDecField", an.fontSize = w, an.text = Gt.g.toString(), an.color = k, an.background = N, an.onFocusObservable.add(() => {
        Z = an.name, ee = an.text, Ii(!1);
      }), an.onBlurObservable.add(() => {
        (parseFloat(an.text) == 0 || an.text == "") && (an.text = "0", ki(an, "g")), Z == an.name && (Z = "");
      }), an.onTextChangedObservable.add(() => {
        Z == an.name && ki(an, "g");
      }), xr.addControl(an, 1, 2);
      const Wn = new K1();
      Wn.width = 0.95, Wn.height = 0.72, Wn.name = "bDecField", Wn.fontSize = w, Wn.text = Gt.b.toString(), Wn.color = k, Wn.background = N, Wn.onFocusObservable.add(() => {
        Z = Wn.name, ee = Wn.text, Ii(!1);
      }), Wn.onBlurObservable.add(() => {
        (parseFloat(Wn.text) == 0 || Wn.text == "") && (Wn.text = "0", ki(Wn, "b")), Z == Wn.name && (Z = "");
      }), Wn.onTextChangedObservable.add(() => {
        Z == Wn.name && ki(Wn, "b");
      }), xr.addControl(Wn, 2, 2);
      const rr = new Iu();
      rr.name = "Hex Value", rr.width = 0.82, rr.addRowDefinition(1, !1), rr.addColumnDefinition(0.1, !1), rr.addColumnDefinition(0.9, !1), Fi.addControl(rr, 2, 0);
      const Sr = new oo();
      Sr.text = "#", Sr.color = v, Sr.fontSize = w, rr.addControl(Sr, 0, 0);
      const nr = new K1();
      nr.width = 0.96, nr.height = 0.72, nr.name = "hexField", nr.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_CENTER, nr.fontSize = w;
      const Er = t.lastColor.split("#");
      nr.text = Er[1], nr.color = k, nr.background = N, nr.onFocusObservable.add(() => {
        Z = nr.name, ee = nr.text, Ii(!1);
      }), nr.onBlurObservable.add(() => {
        if (nr.text.length == 3) {
          const vr = nr.text.split("");
          nr.text = vr[0] + vr[0] + vr[1] + vr[1] + vr[2] + vr[2];
        }
        nr.text == "" && (nr.text = "000000", Rn(Ne.FromHexString(nr.text), "b")), Z == nr.name && (Z = "");
      }), nr.onTextChangedObservable.add(() => {
        let vr = nr.text;
        const Fr = /[^0-9A-F]/i.test(vr);
        if ((nr.text.length > 6 || Fr) && Z == nr.name)
          nr.text = ee;
        else {
          if (nr.text.length < 6) {
            const pr = 6 - nr.text.length;
            for (let ds = 0; ds < pr; ds++)
              vr = "0" + vr;
          }
          if (nr.text.length == 3) {
            const pr = nr.text.split("");
            vr = pr[0] + pr[0] + pr[1] + pr[1] + pr[2] + pr[2];
          }
          vr = "#" + vr, Z == nr.name && (ee = nr.text, Rn(Ne.FromHexString(vr), nr.name));
        }
      }), rr.addControl(nr, 0, 1), t.savedColors && t.savedColors.length > 0 && is("", Y);
      function Rn(vr, Fr) {
        Z = Fr;
        const pr = vr.toHexString();
        if (wt.background = pr, Br.name != Z && (Br.text = Math.floor(vr.r * 255).toString()), nn.name != Z && (nn.text = Math.floor(vr.g * 255).toString()), sn.name != Z && (sn.text = Math.floor(vr.b * 255).toString()), Pn.name != Z && (Pn.text = vr.r.toString()), an.name != Z && (an.text = vr.g.toString()), Wn.name != Z && (Wn.text = vr.b.toString()), nr.name != Z) {
          const ds = pr.split("#");
          nr.text = ds[1];
        }
        De.name != Z && (De.value = vr);
      }
      function Vn(vr, Fr) {
        let pr = vr.text;
        if (/[^0-9]/g.test(pr)) {
          vr.text = ee;
          return;
        } else
          pr != "" && (Math.floor(parseInt(pr)) < 0 ? pr = "0" : Math.floor(parseInt(pr)) > 255 ? pr = "255" : isNaN(parseInt(pr)) && (pr = "0")), Z == vr.name && (ee = pr);
        if (pr != "") {
          pr = parseInt(pr).toString(), vr.text = pr;
          const it = Ne.FromHexString(wt.background);
          Z == vr.name && (Fr == "r" ? Rn(new Ne(parseInt(pr) / 255, it.g, it.b), vr.name) : Fr == "g" ? Rn(new Ne(it.r, parseInt(pr) / 255, it.b), vr.name) : Rn(new Ne(it.r, it.g, parseInt(pr) / 255), vr.name));
        }
      }
      function ki(vr, Fr) {
        let pr = vr.text;
        if (/[^0-9.]/g.test(pr)) {
          vr.text = ee;
          return;
        } else
          pr != "" && pr != "." && parseFloat(pr) != 0 && (parseFloat(pr) < 0 ? pr = "0.0" : parseFloat(pr) > 1 ? pr = "1.0" : isNaN(parseFloat(pr)) && (pr = "0.0")), Z == vr.name && (ee = pr);
        pr != "" && pr != "." && parseFloat(pr) != 0 ? (pr = parseFloat(pr).toString(), vr.text = pr) : pr = "0.0";
        const it = Ne.FromHexString(wt.background);
        Z == vr.name && (Fr == "r" ? Rn(new Ne(parseFloat(pr), it.g, it.b), vr.name) : Fr == "g" ? Rn(new Ne(it.r, parseFloat(pr), it.b), vr.name) : Rn(new Ne(it.r, it.g, parseFloat(pr)), vr.name));
      }
      function as(vr) {
        t.savedColors && t.savedColors.splice(vr, 1), t.savedColors && t.savedColors.length == 0 && (ji(!1), O = !1);
      }
      function Rr() {
        if (t.savedColors && t.savedColors[R]) {
          let vr;
          O ? vr = "b" : vr = "";
          const Fr = V2.CreateSimpleButton("Swatch_" + R, vr);
          Fr.fontFamily = "coreglyphs";
          const pr = Ne.FromHexString(t.savedColors[R]);
          pr.r + pr.g + pr.b > q ? Fr.color = b : Fr.color = j, Fr.fontSize = Math.floor(f * 0.7), Fr.textBlock.verticalAlignment = St.VERTICAL_ALIGNMENT_CENTER, Fr.height = Fr.width = f.toString() + "px", Fr.background = t.savedColors[R], Fr.thickness = 2;
          const it = R;
          return Fr.pointerDownAnimation = () => {
            Fr.thickness = 4;
          }, Fr.pointerUpAnimation = () => {
            Fr.thickness = 3;
          }, Fr.pointerEnterAnimation = () => {
            Fr.thickness = 3;
          }, Fr.pointerOutAnimation = () => {
            Fr.thickness = 2;
          }, Fr.onPointerClickObservable.add(() => {
            O ? (as(it), is("", Y)) : t.savedColors && Rn(Ne.FromHexString(t.savedColors[it]), Fr.name);
          }), Fr;
        } else
          return null;
      }
      function Ii(vr) {
        vr !== void 0 && (O = vr);
        let Fr;
        if (O) {
          for (let pr = 0; pr < y.children.length; pr++)
            Fr = y.children[pr], Fr.textBlock.text = "b";
          m !== void 0 && (m.textBlock.text = "Done");
        } else {
          for (let pr = 0; pr < y.children.length; pr++)
            Fr = y.children[pr], Fr.textBlock.text = "";
          m !== void 0 && (m.textBlock.text = "Edit");
        }
      }
      function is(vr, Fr) {
        if (t.savedColors) {
          vr != "" && t.savedColors.push(vr), R = 0, y.clearControls();
          const pr = Math.ceil(t.savedColors.length / t.numSwatchesPerLine);
          let ds;
          if (pr == 0 ? ds = 0 : ds = pr + 1, y.rowCount != pr + ds) {
            const it = y.rowCount;
            for (let $t = 0; $t < it; $t++)
              y.removeRowDefinition(0);
            for (let $t = 0; $t < pr + ds; $t++)
              $t % 2 ? y.addRowDefinition(f, !0) : y.addRowDefinition(s, !0);
          }
          y.height = (f * pr + ds * s).toString() + "px";
          for (let it = 1, $t = 1; it < pr + ds; it += 2, $t++) {
            let Ur;
            t.savedColors.length > $t * t.numSwatchesPerLine ? Ur = t.numSwatchesPerLine : Ur = t.savedColors.length - ($t - 1) * t.numSwatchesPerLine;
            const $e = Math.min(Math.max(Ur, 0), t.numSwatchesPerLine);
            for (let Kt = 0, cr = 1; Kt < $e; Kt++) {
              if (Kt > t.numSwatchesPerLine)
                continue;
              const Vr = Rr();
              if (Vr != null)
                y.addControl(Vr, it, cr), cr += 2, R++;
              else
                continue;
            }
          }
          t.savedColors.length >= t.swatchLimit ? _i(Fr, !0) : _i(Fr, !1);
        }
      }
      function ji(vr) {
        vr ? (m = V2.CreateSimpleButton("butEdit", "Edit"), m.width = Xn, m.height = qr, m.left = Math.floor(parseInt(Xn) * 0.1).toString() + "px", m.top = (parseFloat(m.left) * -1).toString() + "px", m.verticalAlignment = St.VERTICAL_ALIGNMENT_BOTTOM, m.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, m.thickness = 2, m.color = v, m.fontSize = w, m.background = u, m.onPointerEnterObservable.add(() => {
          m.background = l;
        }), m.onPointerOutObservable.add(() => {
          m.background = u;
        }), m.pointerDownAnimation = () => {
          m.background = P;
        }, m.pointerUpAnimation = () => {
          m.background = l;
        }, m.onPointerClickObservable.add(() => {
          O ? O = !1 : O = !0, Ii();
        }), Xe.addControl(m, 1, 0)) : Xe.removeControl(m);
      }
      function _i(vr, Fr) {
        Fr ? (vr.color = p, vr.background = c) : (vr.color = v, vr.background = u);
      }
      function oi(vr) {
        t.savedColors && t.savedColors.length > 0 ? r({
          savedColors: t.savedColors,
          pickedColor: vr
        }) : r({
          pickedColor: vr
        }), e.removeControl(te);
      }
    });
  }
}
Cu._Epsilon = 1e-6;
C([
  M()
], Cu.prototype, "value", null);
C([
  M()
], Cu.prototype, "width", null);
C([
  M()
], Cu.prototype, "height", null);
C([
  M()
], Cu.prototype, "size", null);
Ue("BABYLON.GUI.ColorPicker", Cu);
class P9e extends Ev {
  /** Gets or sets border thickness */
  get thickness() {
    return this._thickness;
  }
  set thickness(e) {
    this._thickness !== e && (this._thickness = e, this._markAsDirty());
  }
  /**
   * Creates a new Ellipse
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._thickness = 1;
  }
  _getTypeName() {
    return "Ellipse";
  }
  _localDraw(e) {
    e.save(), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY), St.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._thickness / 2, this._currentMeasure.height / 2 - this._thickness / 2, e), (this._backgroundGradient || this._background) && (e.fillStyle = this._getBackgroundColor(e), e.fill()), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0), this._thickness && (this.color && (e.strokeStyle = this.color), e.lineWidth = this._thickness, e.stroke()), e.restore();
  }
  _additionalProcessing(e, t) {
    super._additionalProcessing(e, t), this._measureForChildren.width -= 2 * this._thickness, this._measureForChildren.height -= 2 * this._thickness, this._measureForChildren.left += this._thickness, this._measureForChildren.top += this._thickness;
  }
  _clipForChildren(e) {
    St.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2, this._currentMeasure.height / 2, e), e.clip();
  }
  _renderHighlightSpecific(e) {
    St.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._highlightLineWidth / 2, this._currentMeasure.height / 2 - this._highlightLineWidth / 2, e), e.stroke();
  }
}
C([
  M()
], P9e.prototype, "thickness", null);
Ue("BABYLON.GUI.Ellipse", P9e);
class Dwe extends V2 {
  constructor(e) {
    super(e), this.name = e, this.focusedColor = null, this._isFocused = !1, this._unfocusedColor = null, this.onFocusObservable = new Oe(), this.onBlurObservable = new Oe(), this.onKeyboardEventProcessedObservable = new Oe(), this._unfocusedColor = this.color;
  }
  /** @internal */
  onBlur() {
    this._isFocused && (this._isFocused = !1, this.focusedColor && this._unfocusedColor != null && (this.color = this._unfocusedColor), this.onBlurObservable.notifyObservers(this));
  }
  /** @internal */
  onFocus() {
    this._isFocused = !0, this.focusedColor && (this._unfocusedColor = this.color, this.color = this.focusedColor), this.onFocusObservable.notifyObservers(this);
  }
  /**
   * Function called to get the list of controls that should not steal the focus from this control
   * @returns an array of controls
   */
  keepsFocusWith() {
    return null;
  }
  /**
   * Function to focus a button programmatically
   */
  focus() {
    this._host.moveFocusToControl(this);
  }
  /**
   * Function to unfocus a button programmatically
   */
  blur() {
    this._host.focusedControl = null;
  }
  /**
   * Handles the keyboard event
   * @param evt Defines the KeyboardEvent
   */
  processKeyboard(e) {
    this.onKeyboardEventProcessedObservable.notifyObservers(e, -1, this);
  }
  /**
   * @internal
   */
  _onPointerDown(e, t, r, n, i) {
    return this.isReadOnly || this.focus(), super._onPointerDown(e, t, r, n, i);
  }
  /** @internal */
  displose() {
    super.dispose(), this.onBlurObservable.clear(), this.onFocusObservable.clear(), this.onKeyboardEventProcessedObservable.clear();
  }
}
Ue("BABYLON.GUI.FocusableButton", Dwe);
class bS extends K1 {
  /**
   * Gets or sets outlineWidth of the text to display
   */
  get outlineWidth() {
    return this._outlineWidth;
  }
  /**
   * Gets or sets outlineWidth of the text to display
   */
  set outlineWidth(e) {
    this._outlineWidth !== e && (this._outlineWidth = e, this._markAsDirty());
  }
  /**
   * Gets or sets outlineColor of the text to display
   */
  get outlineColor() {
    return this._outlineColor;
  }
  /**
   * Gets or sets outlineColor of the text to display
   */
  set outlineColor(e) {
    this._outlineColor !== e && (this._outlineColor = e, this._markAsDirty());
  }
  /** Gets or sets a boolean indicating if the control can auto stretch its height to adapt to the text */
  get autoStretchHeight() {
    return this._autoStretchHeight;
  }
  set autoStretchHeight(e) {
    this._autoStretchHeight !== e && (this._autoStretchHeight = e, this._markAsDirty());
  }
  set height(e) {
    this.fixedRatioMasterIsWidth = !1, this._height.toString(this._host) !== e && (this._height.fromString(e) && this._markAsDirty(), this._autoStretchHeight = !1);
  }
  get maxHeight() {
    return this._maxHeight.toString(this._host);
  }
  /** Gets the maximum width allowed by the control in pixels */
  get maxHeightInPixels() {
    return this._maxHeight.getValueInPixel(this._host, this._cachedParentMeasure.height);
  }
  set maxHeight(e) {
    this._maxHeight.toString(this._host) !== e && this._maxHeight.fromString(e) && this._markAsDirty();
  }
  /**
   * Creates a new InputTextArea
   * @param name defines the control name
   * @param text defines the text of the control
   */
  constructor(e, t = "") {
    super(e), this.name = e, this._textHorizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, this._textVerticalAlignment = St.VERTICAL_ALIGNMENT_TOP, this._lineSpacing = new Ai(0), this._outlineWidth = 0, this._outlineColor = "white", this._maxHeight = new Ai(1, Ai.UNITMODE_PERCENTAGE, !1), this.onLinesReadyObservable = new Oe(), this.text = t, this.isPointerBlocker = !0, this.onLinesReadyObservable.add(() => this._updateCursorPosition()), this._highlightCursorInfo = {
      initialStartIndex: -1,
      initialRelativeStartIndex: -1,
      initialLineIndex: -1
    }, this._cursorInfo = {
      globalStartIndex: 0,
      globalEndIndex: 0,
      relativeEndIndex: 0,
      relativeStartIndex: 0,
      currentLineIndex: 0
    };
  }
  _getTypeName() {
    return "InputTextArea";
  }
  /**
   * Handles the keyboard event
   * @param evt Defines the KeyboardEvent
   */
  processKeyboard(e) {
    this.isReadOnly || (this.alternativeProcessKey(e.code, e.key, e), this.onKeyboardEventProcessedObservable.notifyObservers(e));
  }
  /**
   * Process the last keyboard input
   *
   * @param code The ascii input number
   * @param key The key string representation
   * @param evt The keyboard event emits with input
   * @internal
   */
  alternativeProcessKey(e, t, r) {
    if (!(r && (r.ctrlKey || r.metaKey) && (e === "KeyC" || e === "KeyV" || e === "KeyX"))) {
      switch (e) {
        case "KeyA":
          if (r && (r.ctrlKey || r.metaKey)) {
            this._selectAllText(), r.preventDefault();
            return;
          }
          break;
        case "Period":
          r && r.shiftKey && r.preventDefault();
          break;
        case "Backspace":
          !this._isTextHighlightOn && this._cursorInfo.globalStartIndex > 0 && (this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex, this._cursorInfo.globalStartIndex--), this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex), this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex, r && r.preventDefault(), this._blinkIsEven = !1, this._isTextHighlightOn = !1, this._textHasChanged();
          break;
        case "Delete":
          !this._isTextHighlightOn && this._cursorInfo.globalEndIndex < this.text.length && (this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex + 1), this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex), this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex, r && r.preventDefault(), this._blinkIsEven = !1, this._isTextHighlightOn = !1, this._textHasChanged();
          break;
        case "Enter":
          this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, `
`), this._cursorInfo.globalStartIndex++, this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex, this._blinkIsEven = !1, this._isTextHighlightOn = !1, this._textHasChanged();
          return;
        case "End":
          this._cursorInfo.globalStartIndex = this.text.length, this._blinkIsEven = !1, this._isTextHighlightOn = !1, this._markAsDirty();
          return;
        case "Home":
          this._cursorInfo.globalStartIndex = 0, this._blinkIsEven = !1, this._isTextHighlightOn = !1, this._markAsDirty();
          return;
        case "ArrowLeft":
          if (this._markAsDirty(), r && r.shiftKey) {
            (r.ctrlKey || r.metaKey) && (this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex, this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex), this._isTextHighlightOn ? this._cursorInfo.globalEndIndex > this._highlightCursorInfo.initialStartIndex ? this._cursorInfo.globalEndIndex-- : this._cursorInfo.globalStartIndex-- : (this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex, this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex, this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex, this._cursorInfo.globalStartIndex--, this._isTextHighlightOn = !0), this._blinkIsEven = !0, r.preventDefault();
            return;
          }
          this._isTextHighlightOn ? this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex : r && (r.ctrlKey || r.metaKey) ? (this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex, r.preventDefault()) : this._cursorInfo.globalStartIndex > 0 && this._cursorInfo.globalStartIndex--, this._blinkIsEven = !1, this._isTextHighlightOn = !1;
          return;
        case "ArrowRight":
          if (this._markAsDirty(), r && r.shiftKey) {
            if (r.ctrlKey || r.metaKey) {
              const n = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex - 1;
              this._cursorInfo.globalEndIndex += n, this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex;
            }
            this._isTextHighlightOn ? this._cursorInfo.globalStartIndex < this._highlightCursorInfo.initialStartIndex ? this._cursorInfo.globalStartIndex++ : this._cursorInfo.globalEndIndex++ : (this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex, this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex, this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex++, this._isTextHighlightOn = !0), this._blinkIsEven = !0, r.preventDefault();
            return;
          }
          if (this._isTextHighlightOn)
            this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex;
          else if (r && (r.ctrlKey || r.metaKey)) {
            const n = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex;
            this._cursorInfo.globalStartIndex += n;
          } else
            this._cursorInfo.globalStartIndex < this.text.length && this._cursorInfo.globalStartIndex++;
          this._blinkIsEven = !1, this._isTextHighlightOn = !1;
          return;
        case "ArrowUp":
          if (this._blinkIsEven = !1, r && (r.shiftKey ? (this._isTextHighlightOn || (this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex, this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex), this._isTextHighlightOn = !0, this._blinkIsEven = !0) : this._isTextHighlightOn = !1, r.preventDefault()), this._cursorInfo.currentLineIndex === 0)
            this._cursorInfo.globalStartIndex = 0;
          else {
            const n = this._lines[this._cursorInfo.currentLineIndex], i = this._lines[this._cursorInfo.currentLineIndex - 1];
            let s = 0, a = 0;
            !this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex ? (s = this._cursorInfo.globalStartIndex, a = this._cursorInfo.relativeStartIndex) : (s = this._cursorInfo.globalEndIndex, a = this._cursorInfo.relativeEndIndex);
            const f = n.text.substr(0, a), o = this._contextForBreakLines.measureText(f).width;
            let d = 0, v = 0;
            s -= a, s -= i.text.length + i.lineEnding.length;
            let u = 0;
            for (; d < o && u < i.text.length; )
              s++, u++, v = Math.abs(o - d), d = this._contextForBreakLines.measureText(i.text.substr(0, u)).width;
            Math.abs(o - d) > v && u > 0 && s--, this._isTextHighlightOn ? this._cursorInfo.currentLineIndex <= this._highlightCursorInfo.initialLineIndex ? (this._cursorInfo.globalStartIndex = s, this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex, this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex) : this._cursorInfo.globalEndIndex = s : this._cursorInfo.globalStartIndex = s;
          }
          this._markAsDirty();
          return;
        case "ArrowDown":
          if (this._blinkIsEven = !1, r && (r.shiftKey ? (this._isTextHighlightOn || (this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex, this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex), this._isTextHighlightOn = !0, this._blinkIsEven = !0) : this._isTextHighlightOn = !1, r.preventDefault()), this._cursorInfo.currentLineIndex === this._lines.length - 1)
            this._cursorInfo.globalStartIndex = this.text.length;
          else {
            const n = this._lines[this._cursorInfo.currentLineIndex], i = this._lines[this._cursorInfo.currentLineIndex + 1];
            let s = 0, a = 0;
            !this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex ? (s = this._cursorInfo.globalStartIndex, a = this._cursorInfo.relativeStartIndex) : (s = this._cursorInfo.globalEndIndex, a = this._cursorInfo.relativeEndIndex);
            const f = n.text.substr(0, a), o = this._contextForBreakLines.measureText(f).width;
            let d = 0, v = 0;
            s += n.text.length - a + n.lineEnding.length;
            let u = 0;
            for (; d < o && u < i.text.length; )
              s++, u++, v = Math.abs(o - d), d = this._contextForBreakLines.measureText(i.text.substr(0, u)).width;
            Math.abs(o - d) > v && u > 0 && s--, this._isTextHighlightOn ? this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex ? (this._cursorInfo.globalStartIndex = s, this._cursorInfo.globalStartIndex > this._cursorInfo.globalEndIndex && (this._cursorInfo.globalEndIndex += this._cursorInfo.globalStartIndex, this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex -= this._cursorInfo.globalStartIndex)) : (this._cursorInfo.globalEndIndex = s, this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex) : this._cursorInfo.globalStartIndex = s;
          }
          this._markAsDirty();
          return;
      }
      (t == null ? void 0 : t.length) === 1 && (r == null || r.preventDefault(), this._currentKey = t, this.onBeforeKeyAddObservable.notifyObservers(this), t = this._currentKey, this._addKey && (this._isTextHighlightOn = !1, this._blinkIsEven = !1, this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, t), this._cursorInfo.globalStartIndex += t.length, this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex, this._textHasChanged()));
    }
  }
  _parseLineWordWrap(e = "", t, r) {
    const n = [], i = e.split(" ");
    let s = 0;
    for (let a = 0; a < i.length; a++) {
      const f = a > 0 ? e + " " + i[a] : i[0], d = r.measureText(f).width;
      if (d > t) {
        a > 0 && (s = r.measureText(e).width, n.push({ text: e, width: s, lineEnding: " " })), e = i[a];
        let v = "";
        e.split("").map((u) => {
          r.measureText(v + u).width > t && (n.push({ text: v, width: r.measureText(v).width, lineEnding: "" }), v = ""), v += u;
        }), e = v, s = r.measureText(e).width;
      } else
        s = d, e = f;
    }
    return n.push({ text: e, width: s, lineEnding: " " }), n;
  }
  _breakLines(e, t) {
    const r = [], n = this.text.split(`
`);
    if (this.clipContent)
      for (const i of n)
        r.push(...this._parseLineWordWrap(i, e, t));
    else
      for (const i of n)
        r.push(this._parseLine(i, t));
    return r[r.length - 1].lineEnding = `
`, r;
  }
  _parseLine(e = "", t) {
    return { text: e, width: t.measureText(e).width, lineEnding: " " };
  }
  /**
   * Processing of child right before the parent measurement update
   *
   * @param parentMeasure The parent measure
   * @param context The rendering canvas
   * @internal
   */
  _preMeasure(e, t) {
    (!this._fontOffset || this._wasDirty) && (this._fontOffset = St._GetFontOffset(t.font));
    let r = this._beforeRenderText(this._textWrapper).text;
    !this._isFocused && !this.text && this._placeholderText && (r = this._placeholderText, this._placeholderColor && (t.fillStyle = this._placeholderColor)), this._textWidth = t.measureText(r).width;
    const n = this._margin.getValueInPixel(this._host, e.width) * 2;
    if (this._autoStretchWidth) {
      const s = r.split(`
`).reduce((f, o) => {
        const d = t.measureText(o).width, v = t.measureText(f).width;
        return d > v ? o : f;
      }, ""), a = t.measureText(s).width;
      this.width = Math.min(this._maxWidth.getValueInPixel(this._host, e.width), a + n) + "px", this.autoStretchWidth = !0;
    }
    if (this._availableWidth = this._width.getValueInPixel(this._host, e.width) - n, this._lines = this._breakLines(this._availableWidth, t), this._contextForBreakLines = t, this._autoStretchHeight) {
      const s = this._lines.length * this._fontOffset.height + this._margin.getValueInPixel(this._host, e.height) * 2;
      this.height = Math.min(this._maxHeight.getValueInPixel(this._host, e.height), s) + "px", this._autoStretchHeight = !0;
    }
    if (this._availableHeight = this._height.getValueInPixel(this._host, e.height) - n, this._isFocused) {
      this._cursorInfo.currentLineIndex = 0;
      let i = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length, s = 0;
      for (; s + i <= this._cursorInfo.globalStartIndex; )
        s += i, this._cursorInfo.currentLineIndex < this._lines.length - 1 && (this._cursorInfo.currentLineIndex++, i = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length);
    }
  }
  _computeScroll() {
    if (this._clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width), this._clipTextTop = this._currentMeasure.top + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.height), this._isFocused && this._lines[this._cursorInfo.currentLineIndex].width > this._availableWidth) {
      const e = this._clipTextLeft - this._lines[this._cursorInfo.currentLineIndex].width + this._availableWidth;
      this._scrollLeft || (this._scrollLeft = e);
    } else
      this._scrollLeft = this._clipTextLeft;
    if (this._isFocused && !this._autoStretchHeight) {
      const e = (this._cursorInfo.currentLineIndex + 1) * this._fontOffset.height, t = this._clipTextTop - e;
      this._scrollTop || (this._scrollTop = t);
    } else
      this._scrollTop = this._clipTextTop;
  }
  /**
   * Processing of child after the parent measurement update
   *
   * @internal
   */
  _additionalProcessing() {
    this.highlightedText = "", this.onLinesReadyObservable.notifyObservers(this);
  }
  _drawText(e, t, r, n) {
    const i = this._currentMeasure.width;
    let s = this._scrollLeft;
    switch (this._textHorizontalAlignment) {
      case St.HORIZONTAL_ALIGNMENT_LEFT:
        s += 0;
        break;
      case St.HORIZONTAL_ALIGNMENT_RIGHT:
        s += i - t;
        break;
      case St.HORIZONTAL_ALIGNMENT_CENTER:
        s += (i - t) / 2;
        break;
    }
    (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (n.shadowColor = this.shadowColor, n.shadowBlur = this.shadowBlur, n.shadowOffsetX = this.shadowOffsetX, n.shadowOffsetY = this.shadowOffsetY), this.outlineWidth && n.strokeText(e, this._currentMeasure.left + s, r), n.fillText(e, s, r);
  }
  /**
   * Copy the text in the clipboard
   *
   * @param ev The clipboard event
   * @internal
   */
  _onCopyText(e) {
    this._isTextHighlightOn = !1;
    try {
      e.clipboardData && e.clipboardData.setData("text/plain", this._highlightedText);
    } catch {
    }
    this._host.clipboardData = this._highlightedText;
  }
  /**
   * Cut the text and copy it in the clipboard
   *
   * @param ev The clipboard event
   * @internal
   */
  _onCutText(e) {
    if (this._highlightedText) {
      try {
        e.clipboardData && e.clipboardData.setData("text/plain", this._highlightedText);
      } catch {
      }
      this._host.clipboardData = this._highlightedText, this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex), this._textHasChanged();
    }
  }
  /**
   * Paste the copied text from the clipboard
   *
   * @param ev The clipboard event
   * @internal
   */
  _onPasteText(e) {
    let t = "";
    e.clipboardData && e.clipboardData.types.indexOf("text/plain") !== -1 ? t = e.clipboardData.getData("text/plain") : t = this._host.clipboardData, this._isTextHighlightOn = !1, this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, t);
    const r = t.length - (this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex);
    this._cursorInfo.globalStartIndex += r, this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex, this._textHasChanged();
  }
  _draw(e) {
    var t, r;
    this._computeScroll(), this._scrollLeft = (t = this._scrollLeft) !== null && t !== void 0 ? t : 0, this._scrollTop = (r = this._scrollTop) !== null && r !== void 0 ? r : 0, e.save(), this._applyStates(e), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY), this._isFocused ? this._focusedBackground && (e.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor, e.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height)) : this._background && (e.fillStyle = this._isEnabled ? this._background : this._disabledColor, e.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height)), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0), this.color && (e.fillStyle = this.color);
    const n = this._currentMeasure.height, i = this._currentMeasure.width;
    let s = 0;
    switch (this._textVerticalAlignment) {
      case St.VERTICAL_ALIGNMENT_TOP:
        s = this._fontOffset.ascent;
        break;
      case St.VERTICAL_ALIGNMENT_BOTTOM:
        s = n - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent;
        break;
      case St.VERTICAL_ALIGNMENT_CENTER:
        s = this._fontOffset.ascent + (n - this._fontOffset.height * this._lines.length) / 2;
        break;
    }
    e.save(), e.beginPath(), e.fillStyle = this.fontStyle, e.rect(this._clipTextLeft, this._clipTextTop, this._availableWidth + 2, this._availableHeight + 2), e.clip(), s += this._scrollTop;
    for (let a = 0; a < this._lines.length; a++) {
      const f = this._lines[a];
      a !== 0 && this._lineSpacing.internalValue !== 0 && (this._lineSpacing.isPixel ? s += this._lineSpacing.getValue(this._host) : s = s + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height)), this._drawText(f.text, f.width, s, e), s += this._fontOffset.height;
    }
    if (e.restore(), this._isFocused) {
      if (!this._blinkIsEven || this._isTextHighlightOn) {
        let a = this._scrollLeft + e.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, this._cursorInfo.relativeStartIndex)).width;
        a < this._clipTextLeft ? (this._scrollLeft += this._clipTextLeft - a, a = this._clipTextLeft, this._markAsDirty()) : a > this._clipTextLeft + this._availableWidth && (this._scrollLeft += this._clipTextLeft + this._availableWidth - a, a = this._clipTextLeft + this._availableWidth, this._markAsDirty());
        let f = this._scrollTop + this._cursorInfo.currentLineIndex * this._fontOffset.height;
        f < this._clipTextTop ? (this._scrollTop += this._clipTextTop - f, f = this._clipTextTop, this._markAsDirty()) : f + this._fontOffset.height > this._clipTextTop + this._availableHeight && (this._scrollTop += this._clipTextTop + this._availableHeight - f - this._fontOffset.height, f = this._clipTextTop + this._availableHeight - this._fontOffset.height, this._markAsDirty()), this._isTextHighlightOn || e.fillRect(a, f, 2, this._fontOffset.height);
      }
      if (this._resetBlinking(), this._isTextHighlightOn) {
        clearTimeout(this._blinkTimeout), this._highlightedText = this.text.substring(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex), e.globalAlpha = this._highligherOpacity, e.fillStyle = this._textHighlightColor;
        const a = Math.min(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex), f = Math.max(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex);
        let o = this._scrollTop + a * this._fontOffset.height;
        for (let d = a; d <= f; d++) {
          const v = this._lines[d];
          let u = this._scrollLeft;
          switch (this._textHorizontalAlignment) {
            case St.HORIZONTAL_ALIGNMENT_LEFT:
              u += 0;
              break;
            case St.HORIZONTAL_ALIGNMENT_RIGHT:
              u += i - v.width;
              break;
            case St.HORIZONTAL_ALIGNMENT_CENTER:
              u += (i - v.width) / 2;
              break;
          }
          const l = d === a ? this._cursorInfo.relativeStartIndex : 0, P = d === f ? this._cursorInfo.relativeEndIndex : v.text.length, p = e.measureText(v.text.substr(0, l)).width, c = v.text.substring(l, P), H = e.measureText(c).width;
          e.fillRect(u + p, o, H, this._fontOffset.height), o += this._fontOffset.height;
        }
        this._cursorInfo.globalEndIndex === this._cursorInfo.globalStartIndex && this._resetBlinking();
      }
    }
    e.restore(), this._thickness && (this._isFocused ? this.focusedColor && (e.strokeStyle = this.focusedColor) : this.color && (e.strokeStyle = this.color), e.lineWidth = this._thickness, e.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness));
  }
  _resetBlinking() {
    clearTimeout(this._blinkTimeout), this._blinkTimeout = setTimeout(() => {
      this._blinkIsEven = !this._blinkIsEven, this._markAsDirty();
    }, 500);
  }
  _applyStates(e) {
    super._applyStates(e), this.outlineWidth && (e.lineWidth = this.outlineWidth, e.strokeStyle = this.outlineColor);
  }
  _onPointerDown(e, t, r, n, i) {
    return super._onPointerDown(e, t, r, n, i) ? this.isReadOnly ? !0 : (this._clickedCoordinateX = t.x, this._clickedCoordinateY = t.y, this._isTextHighlightOn = !1, this._highlightedText = "", this._isPointerDown = !0, this._host._capturingControl[r] = this, this._host.focusedControl === this ? (clearTimeout(this._blinkTimeout), this._markAsDirty(), !0) : this._isEnabled ? (this._host.focusedControl = this, !0) : !1) : !1;
  }
  // for textselection
  _onPointerMove(e, t, r, n) {
    n.event.movementX === 0 && n.event.movementY === 0 || (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly && (this._clickedCoordinateX = t.x, this._clickedCoordinateY = t.y, this._isTextHighlightOn || (this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex, this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex, this._isTextHighlightOn = !0), this._markAsDirty()), super._onPointerMove(e, t, r, n));
  }
  /**
   * Apply the correct position of cursor according to current modification
   */
  _updateCursorPosition() {
    var e;
    if (this._isFocused)
      if (this._clickedCoordinateX && this._clickedCoordinateY) {
        this._isTextHighlightOn || (this._cursorInfo = {
          globalStartIndex: 0,
          globalEndIndex: 0,
          relativeStartIndex: 0,
          relativeEndIndex: 0,
          currentLineIndex: 0
        });
        let t = 0, r = 0;
        const n = this._clickedCoordinateY - this._scrollTop, i = Math.floor(n / this._fontOffset.height);
        this._cursorInfo.currentLineIndex = Math.min(Math.max(i, 0), this._lines.length - 1);
        let s = 0;
        const a = this._clickedCoordinateX - ((e = this._scrollLeft) !== null && e !== void 0 ? e : 0);
        let f = 0;
        for (let o = 0; o < this._cursorInfo.currentLineIndex; o++) {
          const d = this._lines[o];
          t += d.text.length + d.lineEnding.length;
        }
        for (; s < a && this._lines[this._cursorInfo.currentLineIndex].text.length > r; )
          r++, f = Math.abs(a - s), s = this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, r)).width;
        Math.abs(a - s) > f && r > 0 && r--, t += r, this._isTextHighlightOn ? t < this._highlightCursorInfo.initialStartIndex ? (this._cursorInfo.globalStartIndex = t, this._cursorInfo.relativeStartIndex = r, this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex, this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex) : (this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex, this._cursorInfo.relativeStartIndex = this._highlightCursorInfo.initialRelativeStartIndex, this._cursorInfo.globalEndIndex = t, this._cursorInfo.relativeEndIndex = r) : (this._cursorInfo.globalStartIndex = t, this._cursorInfo.relativeStartIndex = r, this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex, this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex), this._blinkIsEven = this._isTextHighlightOn, this._clickedCoordinateX = null, this._clickedCoordinateY = null;
      } else {
        this._cursorInfo.relativeStartIndex = 0, this._cursorInfo.currentLineIndex = 0;
        let t = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length, r = 0;
        for (; r + t <= this._cursorInfo.globalStartIndex; )
          r += t, this._cursorInfo.currentLineIndex < this._lines.length - 1 && (this._cursorInfo.currentLineIndex++, t = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length);
        if (this._cursorInfo.relativeStartIndex = this._cursorInfo.globalStartIndex - r, this._highlightCursorInfo.initialStartIndex !== -1 && this._cursorInfo.globalStartIndex >= this._highlightCursorInfo.initialStartIndex) {
          for (; r + t <= this._cursorInfo.globalEndIndex; )
            r += t, this._cursorInfo.currentLineIndex < this._lines.length - 1 && (this._cursorInfo.currentLineIndex++, t = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length);
          this._cursorInfo.relativeEndIndex = this._cursorInfo.globalEndIndex - r;
        } else
          this._isTextHighlightOn || (this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex, this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex);
      }
  }
  /**
   * Update all values of cursor information based on cursorIndex value
   *
   * @param offset The index to take care of
   * @internal
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _updateValueFromCursorIndex(e) {
  }
  /**
   * Select the word immediatly under the cursor on double click
   *
   * @param _evt Pointer informations of double click
   * @internal
   */
  _processDblClick(e) {
    let t, r;
    do
      t = this._cursorInfo.globalStartIndex > 0 && this._textWrapper.isWord(this._cursorInfo.globalStartIndex - 1) ? --this._cursorInfo.globalStartIndex : 0, r = this._cursorInfo.globalEndIndex < this._textWrapper.length && this._textWrapper.isWord(this._cursorInfo.globalEndIndex) ? ++this._cursorInfo.globalEndIndex : 0;
    while (t || r);
    this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex, this.onTextHighlightObservable.notifyObservers(this), this._isTextHighlightOn = !0, this._blinkIsEven = !0, this._markAsDirty();
  }
  /** @internal */
  _selectAllText() {
    this._isTextHighlightOn = !0, this._blinkIsEven = !0, this._highlightCursorInfo = {
      initialStartIndex: 0,
      initialRelativeStartIndex: 0,
      initialLineIndex: 0
    }, this._cursorInfo = {
      globalStartIndex: 0,
      globalEndIndex: this._textWrapper.length,
      relativeEndIndex: this._lines[this._lines.length - 1].text.length,
      relativeStartIndex: 0,
      currentLineIndex: this._lines.length - 1
    }, this._markAsDirty();
  }
  dispose() {
    super.dispose(), this.onLinesReadyObservable.clear();
  }
}
C([
  M()
], bS.prototype, "autoStretchHeight", null);
C([
  M()
], bS.prototype, "maxHeight", null);
Ue("BABYLON.GUI.InputTextArea", bS);
class jwe extends K1 {
  _getTypeName() {
    return "InputPassword";
  }
  _beforeRenderText(e) {
    const t = new UN();
    let r = "";
    for (let n = 0; n < e.length; n++)
      r += "•";
    return t.text = r, t;
  }
}
Ue("BABYLON.GUI.InputPassword", jwe);
class Km extends St {
  /** Gets or sets the dash pattern */
  get dash() {
    return this._dash;
  }
  set dash(e) {
    this._dash !== e && (this._dash = e, this._markAsDirty());
  }
  /** Gets or sets the control connected with the line end */
  get connectedControl() {
    return this._connectedControl;
  }
  set connectedControl(e) {
    this._connectedControl !== e && (this._connectedControlDirtyObserver && this._connectedControl && (this._connectedControl.onDirtyObservable.remove(this._connectedControlDirtyObserver), this._connectedControlDirtyObserver = null), e && (this._connectedControlDirtyObserver = e.onDirtyObservable.add(() => this._markAsDirty())), this._connectedControl = e, this._markAsDirty());
  }
  /** Gets or sets start coordinates on X axis */
  get x1() {
    return this._x1.toString(this._host);
  }
  set x1(e) {
    this._x1.toString(this._host) !== e && this._x1.fromString(e) && this._markAsDirty();
  }
  /** Gets or sets start coordinates on Y axis */
  get y1() {
    return this._y1.toString(this._host);
  }
  set y1(e) {
    this._y1.toString(this._host) !== e && this._y1.fromString(e) && this._markAsDirty();
  }
  /** Gets or sets end coordinates on X axis */
  get x2() {
    return this._x2.toString(this._host);
  }
  set x2(e) {
    this._x2.toString(this._host) !== e && this._x2.fromString(e) && this._markAsDirty();
  }
  /** Gets or sets end coordinates on Y axis */
  get y2() {
    return this._y2.toString(this._host);
  }
  set y2(e) {
    this._y2.toString(this._host) !== e && this._y2.fromString(e) && this._markAsDirty();
  }
  /** Gets or sets line width */
  get lineWidth() {
    return this._lineWidth;
  }
  set lineWidth(e) {
    this._lineWidth !== e && (this._lineWidth = e, this._markAsDirty());
  }
  /** Gets or sets horizontal alignment */
  set horizontalAlignment(e) {
  }
  /** Gets or sets vertical alignment */
  set verticalAlignment(e) {
  }
  /** @internal */
  get _effectiveX2() {
    return (this._connectedControl ? this._connectedControl.centerX : 0) + this._x2.getValue(this._host);
  }
  /** @internal */
  get _effectiveY2() {
    return (this._connectedControl ? this._connectedControl.centerY : 0) + this._y2.getValue(this._host);
  }
  /**
   * Creates a new Line
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._lineWidth = 1, this._x1 = new Ai(0), this._y1 = new Ai(0), this._x2 = new Ai(0), this._y2 = new Ai(0), this._dash = new Array(), this._automaticSize = !0, this.isHitTestVisible = !1, this._horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, this._verticalAlignment = St.VERTICAL_ALIGNMENT_TOP;
  }
  _getTypeName() {
    return "Line";
  }
  _draw(e) {
    e.save(), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY), this._applyStates(e), e.strokeStyle = this._getColor(e), e.lineWidth = this._lineWidth, e.setLineDash(this._dash), e.beginPath(), e.moveTo(this._cachedParentMeasure.left + this._x1.getValue(this._host), this._cachedParentMeasure.top + this._y1.getValue(this._host)), e.lineTo(this._cachedParentMeasure.left + this._effectiveX2, this._cachedParentMeasure.top + this._effectiveY2), e.stroke(), e.restore();
  }
  _measure() {
    this._currentMeasure.width = Math.abs(this._x1.getValue(this._host) - this._effectiveX2) + this._lineWidth, this._currentMeasure.height = Math.abs(this._y1.getValue(this._host) - this._effectiveY2) + this._lineWidth;
  }
  _computeAlignment(e) {
    this._currentMeasure.left = e.left + Math.min(this._x1.getValue(this._host), this._effectiveX2) - this._lineWidth / 2, this._currentMeasure.top = e.top + Math.min(this._y1.getValue(this._host), this._effectiveY2) - this._lineWidth / 2;
  }
  /**
   * Move one end of the line given 3D cartesian coordinates.
   * @param position Targeted world position
   * @param scene Scene
   * @param end (opt) Set to true to assign x2 and y2 coordinates of the line. Default assign to x1 and y1.
   */
  moveToVector3(e, t, r = !1) {
    if (!this._host || this.parent !== this._host._rootContainer) {
      ye.Error("Cannot move a control to a vector3 if the control is not at root level");
      return;
    }
    const n = this._host._getGlobalViewport(), i = S.Project(e, he.IdentityReadOnly, t.getTransformMatrix(), n);
    if (this._moveToProjectedPosition(i, r), i.z < 0 || i.z > 1) {
      this.notRenderable = !0;
      return;
    }
    this.notRenderable = !1;
  }
  /**
   * Move one end of the line to a position in screen absolute space.
   * @param projectedPosition Position in screen absolute space (X, Y)
   * @param end (opt) Set to true to assign x2 and y2 coordinates of the line. Default assign to x1 and y1.
   */
  _moveToProjectedPosition(e, t = !1) {
    const r = e.x + this._linkOffsetX.getValue(this._host) + "px", n = e.y + this._linkOffsetY.getValue(this._host) + "px";
    t ? (this.x2 = r, this.y2 = n, this._x2.ignoreAdaptiveScaling = !0, this._y2.ignoreAdaptiveScaling = !0) : (this.x1 = r, this.y1 = n, this._x1.ignoreAdaptiveScaling = !0, this._y1.ignoreAdaptiveScaling = !0);
  }
}
C([
  M()
], Km.prototype, "dash", null);
C([
  M()
], Km.prototype, "x1", null);
C([
  M()
], Km.prototype, "y1", null);
C([
  M()
], Km.prototype, "x2", null);
C([
  M()
], Km.prototype, "y2", null);
C([
  M()
], Km.prototype, "lineWidth", null);
Ue("BABYLON.GUI.Line", Km);
class s$ {
  /**
   * Creates a new MultiLinePoint
   * @param multiLine defines the source MultiLine object
   */
  constructor(e) {
    this._multiLine = e, this._x = new Ai(0), this._y = new Ai(0), this._point = new S(0, 0, 0);
  }
  /** Gets or sets x coordinate */
  get x() {
    return this._x.toString(this._multiLine._host);
  }
  set x(e) {
    this._x.toString(this._multiLine._host) !== e && this._x.fromString(e) && this._multiLine._markAsDirty();
  }
  /** Gets or sets y coordinate */
  get y() {
    return this._y.toString(this._multiLine._host);
  }
  set y(e) {
    this._y.toString(this._multiLine._host) !== e && this._y.fromString(e) && this._multiLine._markAsDirty();
  }
  /** Gets or sets the control associated with this point */
  get control() {
    return this._control;
  }
  set control(e) {
    this._control !== e && (this._control && this._controlObserver && (this._control.onDirtyObservable.remove(this._controlObserver), this._controlObserver = null), this._control = e, this._control && (this._controlObserver = this._control.onDirtyObservable.add(this._multiLine.onPointUpdate)), this._multiLine._markAsDirty());
  }
  /** Gets or sets the mesh associated with this point */
  get mesh() {
    return this._mesh;
  }
  set mesh(e) {
    this._mesh !== e && (this._mesh && this._meshObserver && this._mesh.getScene().onAfterCameraRenderObservable.remove(this._meshObserver), this._mesh = e, this._mesh && (this._meshObserver = this._mesh.getScene().onAfterCameraRenderObservable.add(this._multiLine.onPointUpdate)), this._multiLine._markAsDirty());
  }
  /** Resets links */
  resetLinks() {
    this.control = null, this.mesh = null;
  }
  /**
   * Gets a translation vector with Z component
   * @returns the translation vector
   */
  translate() {
    return this._point = this._translatePoint(), this._point;
  }
  _translatePoint() {
    if (this._mesh != null)
      return this._multiLine._host.getProjectedPositionWithZ(this._mesh.getBoundingInfo().boundingSphere.center, this._mesh.getWorldMatrix());
    if (this._control != null)
      return new S(this._control.centerX, this._control.centerY, 1 - Dn);
    {
      const e = this._multiLine._host, t = this._x.getValueInPixel(e, Number(e._canvas.width)), r = this._y.getValueInPixel(e, Number(e._canvas.height));
      return new S(t, r, 1 - Dn);
    }
  }
  /** Release associated resources */
  dispose() {
    this.resetLinks();
  }
}
class c9e extends St {
  /**
   * Creates a new MultiLine
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._lineWidth = 1, this.onPointUpdate = () => {
      this._markAsDirty();
    }, this._automaticSize = !0, this.isHitTestVisible = !1, this._horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, this._verticalAlignment = St.VERTICAL_ALIGNMENT_TOP, this._dash = [], this._points = [];
  }
  /** Gets or sets dash pattern */
  get dash() {
    return this._dash;
  }
  set dash(e) {
    this._dash !== e && (this._dash = e, this._markAsDirty());
  }
  /**
   * Gets point stored at specified index
   * @param index defines the index to look for
   * @returns the requested point if found
   */
  getAt(e) {
    return this._points[e] || (this._points[e] = new s$(this)), this._points[e];
  }
  /**
   * Adds new points to the point collection
   * @param items defines the list of items (mesh, control or 2d coordinates) to add
   * @returns the list of created MultiLinePoint
   */
  add(...e) {
    return e.map((t) => this.push(t));
  }
  /**
   * Adds a new point to the point collection
   * @param item defines the item (mesh, control or 2d coordinates) to add
   * @returns the created MultiLinePoint
   */
  push(e) {
    const t = this.getAt(this._points.length);
    return e == null || (e instanceof jn ? t.mesh = e : e instanceof St ? t.control = e : e.x != null && e.y != null && (t.x = e.x, t.y = e.y)), t;
  }
  /**
   * Remove a specific value or point from the active point collection
   * @param value defines the value or point to remove
   */
  remove(e) {
    let t;
    if (e instanceof s$) {
      if (t = this._points.indexOf(e), t === -1)
        return;
    } else
      t = e;
    const r = this._points[t];
    r && (r.dispose(), this._points.splice(t, 1));
  }
  /**
   * Resets this object to initial state (no point)
   */
  reset() {
    for (; this._points.length > 0; )
      this.remove(this._points.length - 1);
  }
  /**
   * Resets all links
   */
  resetLinks() {
    this._points.forEach((e) => {
      e != null && e.resetLinks();
    });
  }
  /** Gets or sets line width */
  get lineWidth() {
    return this._lineWidth;
  }
  set lineWidth(e) {
    this._lineWidth !== e && (this._lineWidth = e, this._markAsDirty());
  }
  set horizontalAlignment(e) {
  }
  set verticalAlignment(e) {
  }
  _getTypeName() {
    return "MultiLine";
  }
  _draw(e) {
    e.save(), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY), this._applyStates(e), e.strokeStyle = this.color, e.lineWidth = this._lineWidth, e.setLineDash(this._dash), e.beginPath();
    let t = !0, r;
    this._points.forEach((n) => {
      n && (t ? (e.moveTo(n._point.x, n._point.y), t = !1) : n._point.z < 1 && r.z < 1 ? e.lineTo(n._point.x, n._point.y) : e.moveTo(n._point.x, n._point.y), r = n._point);
    }), e.stroke(), e.restore();
  }
  _additionalProcessing() {
    this._minX = null, this._minY = null, this._maxX = null, this._maxY = null, this._points.forEach((e) => {
      e && (e.translate(), (this._minX == null || e._point.x < this._minX) && (this._minX = e._point.x), (this._minY == null || e._point.y < this._minY) && (this._minY = e._point.y), (this._maxX == null || e._point.x > this._maxX) && (this._maxX = e._point.x), (this._maxY == null || e._point.y > this._maxY) && (this._maxY = e._point.y));
    }), this._minX == null && (this._minX = 0), this._minY == null && (this._minY = 0), this._maxX == null && (this._maxX = 0), this._maxY == null && (this._maxY = 0);
  }
  _measure() {
    this._minX == null || this._maxX == null || this._minY == null || this._maxY == null || (this._currentMeasure.width = Math.abs(this._maxX - this._minX) + this._lineWidth, this._currentMeasure.height = Math.abs(this._maxY - this._minY) + this._lineWidth);
  }
  _computeAlignment() {
    this._minX == null || this._minY == null || (this._currentMeasure.left = this._minX - this._lineWidth / 2, this._currentMeasure.top = this._minY - this._lineWidth / 2);
  }
  dispose() {
    this.reset(), super.dispose();
  }
}
C([
  M()
], c9e.prototype, "dash", null);
Ue("BABYLON.GUI.MultiLine", c9e);
class fg extends St {
  /** Gets or sets border thickness */
  get thickness() {
    return this._thickness;
  }
  set thickness(e) {
    this._thickness !== e && (this._thickness = e, this._markAsDirty());
  }
  /** Gets or sets a value indicating the ratio between overall size and check size */
  get checkSizeRatio() {
    return this._checkSizeRatio;
  }
  set checkSizeRatio(e) {
    e = Math.max(Math.min(1, e), 0), this._checkSizeRatio !== e && (this._checkSizeRatio = e, this._markAsDirty());
  }
  /** Gets or sets background color */
  get background() {
    return this._background;
  }
  set background(e) {
    this._background !== e && (this._background = e, this._markAsDirty());
  }
  /** Gets or sets a boolean indicating if the checkbox is checked or not */
  get isChecked() {
    return this._isChecked;
  }
  set isChecked(e) {
    this._isChecked !== e && (this._isChecked = e, this._markAsDirty(), this.onIsCheckedChangedObservable.notifyObservers(e), this._isChecked && this._host && this._host.executeOnAllControls((t) => {
      if (t === this || t.group === void 0)
        return;
      const r = t;
      r.group === this.group && (r.isChecked = !1);
    }));
  }
  /**
   * Creates a new RadioButton
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._isChecked = !1, this._background = "black", this._checkSizeRatio = 0.8, this._thickness = 1, this.group = "", this.onIsCheckedChangedObservable = new Oe(), this.isPointerBlocker = !0;
  }
  _getTypeName() {
    return "RadioButton";
  }
  _draw(e) {
    e.save(), this._applyStates(e);
    const t = this._currentMeasure.width - this._thickness, r = this._currentMeasure.height - this._thickness;
    if ((this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY), St.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._thickness / 2, this._currentMeasure.height / 2 - this._thickness / 2, e), e.fillStyle = this._isEnabled ? this._background : this._disabledColor, e.fill(), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0), e.strokeStyle = this.color, e.lineWidth = this._thickness, e.stroke(), this._isChecked) {
      e.fillStyle = this._isEnabled ? this.color : this._disabledColor;
      const n = t * this._checkSizeRatio, i = r * this._checkSizeRatio;
      St.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, n / 2 - this._thickness / 2, i / 2 - this._thickness / 2, e), e.fill();
    }
    e.restore();
  }
  // Events
  _onPointerDown(e, t, r, n, i) {
    return super._onPointerDown(e, t, r, n, i) ? (this.isReadOnly || this.isChecked || (this.isChecked = !0), !0) : !1;
  }
  /**
   * Utility function to easily create a radio button with a header
   * @param title defines the label to use for the header
   * @param group defines the group to use for the radio button
   * @param isChecked defines the initial state of the radio button
   * @param onValueChanged defines the callback to call when value changes
   * @returns a StackPanel containing the radio button and a textBlock
   */
  static AddRadioButtonWithHeader(e, t, r, n) {
    const i = new ug();
    i.isVertical = !1, i.height = "30px";
    const s = new fg();
    s.width = "20px", s.height = "20px", s.isChecked = r, s.color = "green", s.group = t, s.onIsCheckedChangedObservable.add((f) => n(s, f)), i.addControl(s);
    const a = new oo();
    return a.text = e, a.width = "180px", a.paddingLeft = "5px", a.textHorizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, a.color = "white", i.addControl(a), i;
  }
}
C([
  M()
], fg.prototype, "thickness", null);
C([
  M()
], fg.prototype, "group", void 0);
C([
  M()
], fg.prototype, "checkSizeRatio", null);
C([
  M()
], fg.prototype, "background", null);
C([
  M()
], fg.prototype, "isChecked", null);
Ue("BABYLON.GUI.RadioButton", fg);
class wp extends St {
  /** Gets or sets a boolean indicating if the thumb must be rendered */
  get displayThumb() {
    return this._displayThumb;
  }
  set displayThumb(e) {
    this._displayThumb !== e && (this._displayThumb = e, this._markAsDirty());
  }
  /** Gets or sets a step to apply to values (0 by default) */
  get step() {
    return this._step;
  }
  set step(e) {
    this._step !== e && (this._step = e, this._markAsDirty());
  }
  /** Gets or sets main bar offset (ie. the margin applied to the value bar) */
  get barOffset() {
    return this._barOffset.toString(this._host);
  }
  /** Gets main bar offset in pixels*/
  get barOffsetInPixels() {
    return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);
  }
  set barOffset(e) {
    this._barOffset.toString(this._host) !== e && this._barOffset.fromString(e) && this._markAsDirty();
  }
  /** Gets or sets thumb width */
  get thumbWidth() {
    return this._thumbWidth.toString(this._host);
  }
  /** Gets thumb width in pixels */
  get thumbWidthInPixels() {
    return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
  }
  set thumbWidth(e) {
    this._thumbWidth.toString(this._host) !== e && this._thumbWidth.fromString(e) && this._markAsDirty();
  }
  /** Gets or sets minimum value */
  get minimum() {
    return this._minimum;
  }
  set minimum(e) {
    this._minimum !== e && (this._minimum = e, this._markAsDirty(), this.value = Math.max(Math.min(this.value, this._maximum), this._minimum));
  }
  /** Gets or sets maximum value */
  get maximum() {
    return this._maximum;
  }
  set maximum(e) {
    this._maximum !== e && (this._maximum = e, this._markAsDirty(), this.value = Math.max(Math.min(this.value, this._maximum), this._minimum));
  }
  /** Gets or sets current value */
  get value() {
    return this._value;
  }
  set value(e) {
    e = Math.max(Math.min(e, this._maximum), this._minimum), this._value !== e && (this._value = e, this._markAsDirty(), this.onValueChangedObservable.notifyObservers(this._value));
  }
  /**Gets or sets a boolean indicating if the slider should be vertical or horizontal */
  get isVertical() {
    return this._isVertical;
  }
  set isVertical(e) {
    this._isVertical !== e && (this._isVertical = e, this._markAsDirty());
  }
  /** Gets or sets a value indicating if the thumb can go over main bar extends */
  get isThumbClamped() {
    return this._isThumbClamped;
  }
  set isThumbClamped(e) {
    this._isThumbClamped !== e && (this._isThumbClamped = e, this._markAsDirty());
  }
  /**
   * Creates a new BaseSlider
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._thumbWidth = new Ai(20, Ai.UNITMODE_PIXEL, !1), this._minimum = 0, this._maximum = 100, this._value = 50, this._isVertical = !1, this._barOffset = new Ai(5, Ai.UNITMODE_PIXEL, !1), this._isThumbClamped = !1, this._displayThumb = !0, this._step = 0, this._lastPointerDownId = -1, this._effectiveBarOffset = 0, this.onValueChangedObservable = new Oe(), this._pointerIsDown = !1, this.isPointerBlocker = !0;
  }
  _getTypeName() {
    return "BaseSlider";
  }
  _getThumbPosition() {
    return this.isVertical ? (this.maximum - this.value) / (this.maximum - this.minimum) * this._backgroundBoxLength : (this.value - this.minimum) / (this.maximum - this.minimum) * this._backgroundBoxLength;
  }
  _getThumbThickness(e) {
    let t = 0;
    switch (e) {
      case "circle":
        this._thumbWidth.isPixel ? t = Math.max(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness) : t = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);
        break;
      case "rectangle":
        this._thumbWidth.isPixel ? t = Math.min(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness) : t = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);
    }
    return t;
  }
  _prepareRenderingData(e) {
    if (this._effectiveBarOffset = 0, this._renderLeft = this._currentMeasure.left, this._renderTop = this._currentMeasure.top, this._renderWidth = this._currentMeasure.width, this._renderHeight = this._currentMeasure.height, this._backgroundBoxLength = Math.max(this._currentMeasure.width, this._currentMeasure.height), this._backgroundBoxThickness = Math.min(this._currentMeasure.width, this._currentMeasure.height), this._effectiveThumbThickness = this._getThumbThickness(e), this.displayThumb && (this._backgroundBoxLength -= this._effectiveThumbThickness), this.isVertical && this._currentMeasure.height < this._currentMeasure.width) {
      console.error("Height should be greater than width");
      return;
    }
    this._barOffset.isPixel ? this._effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._backgroundBoxThickness) : this._effectiveBarOffset = this._backgroundBoxThickness * this._barOffset.getValue(this._host), this._backgroundBoxThickness -= this._effectiveBarOffset * 2, this.isVertical ? (this._renderLeft += this._effectiveBarOffset, !this.isThumbClamped && this.displayThumb && (this._renderTop += this._effectiveThumbThickness / 2), this._renderHeight = this._backgroundBoxLength, this._renderWidth = this._backgroundBoxThickness) : (this._renderTop += this._effectiveBarOffset, !this.isThumbClamped && this.displayThumb && (this._renderLeft += this._effectiveThumbThickness / 2), this._renderHeight = this._backgroundBoxThickness, this._renderWidth = this._backgroundBoxLength);
  }
  /**
   * @internal
   */
  _updateValueFromPointer(e, t) {
    this.rotation != 0 && (this._invertTransformMatrix.transformCoordinates(e, t, this._transformedPosition), e = this._transformedPosition.x, t = this._transformedPosition.y);
    let r;
    this._isVertical ? r = this._minimum + (1 - (t - this._currentMeasure.top) / this._currentMeasure.height) * (this._maximum - this._minimum) : r = this._minimum + (e - this._currentMeasure.left) / this._currentMeasure.width * (this._maximum - this._minimum), this.value = this._step ? Math.round(r / this._step) * this._step : r;
  }
  _onPointerDown(e, t, r, n, i) {
    return super._onPointerDown(e, t, r, n, i) ? (this.isReadOnly || (this._pointerIsDown = !0, this._updateValueFromPointer(t.x, t.y), this._host._capturingControl[r] = this, this._lastPointerDownId = r), !0) : !1;
  }
  _onPointerMove(e, t, r, n) {
    r == this._lastPointerDownId && (this._pointerIsDown && !this.isReadOnly && this._updateValueFromPointer(t.x, t.y), super._onPointerMove(e, t, r, n));
  }
  _onPointerUp(e, t, r, n, i) {
    this._pointerIsDown = !1, delete this._host._capturingControl[r], super._onPointerUp(e, t, r, n, i);
  }
  _onCanvasBlur() {
    this._forcePointerUp(), super._onCanvasBlur();
  }
}
C([
  M()
], wp.prototype, "displayThumb", null);
C([
  M()
], wp.prototype, "step", null);
C([
  M()
], wp.prototype, "barOffset", null);
C([
  M()
], wp.prototype, "thumbWidth", null);
C([
  M()
], wp.prototype, "minimum", null);
C([
  M()
], wp.prototype, "maximum", null);
C([
  M()
], wp.prototype, "value", null);
C([
  M()
], wp.prototype, "isVertical", null);
C([
  M()
], wp.prototype, "isThumbClamped", null);
class DU extends wp {
  /** Gets or sets a boolean indicating if the value bar must be rendered */
  get displayValueBar() {
    return this._displayValueBar;
  }
  set displayValueBar(e) {
    this._displayValueBar !== e && (this._displayValueBar = e, this._markAsDirty());
  }
  /** Gets or sets border color */
  get borderColor() {
    return this._borderColor;
  }
  set borderColor(e) {
    this._borderColor !== e && (this._borderColor = e, this._markAsDirty());
  }
  /** Gets or sets background color */
  get background() {
    return this._background;
  }
  set background(e) {
    this._background !== e && (this._background = e, this._markAsDirty());
  }
  /** Gets or sets background gradient */
  get backgroundGradient() {
    return this._backgroundGradient;
  }
  set backgroundGradient(e) {
    this._backgroundGradient !== e && (this._backgroundGradient = e, this._markAsDirty());
  }
  /** Gets or sets thumb's color */
  get thumbColor() {
    return this._thumbColor;
  }
  set thumbColor(e) {
    this._thumbColor !== e && (this._thumbColor = e, this._markAsDirty());
  }
  /** Gets or sets a boolean indicating if the thumb should be round or square */
  get isThumbCircle() {
    return this._isThumbCircle;
  }
  set isThumbCircle(e) {
    this._isThumbCircle !== e && (this._isThumbCircle = e, this._markAsDirty());
  }
  /**
   * Creates a new Slider
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._background = "black", this._borderColor = "white", this._thumbColor = "", this._isThumbCircle = !1, this._displayValueBar = !0, this._backgroundGradient = null;
  }
  _getTypeName() {
    return "Slider";
  }
  _getBackgroundColor(e) {
    return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(e) : this._background;
  }
  _draw(e) {
    e.save(), this._applyStates(e), this._prepareRenderingData(this.isThumbCircle ? "circle" : "rectangle");
    let t = this._renderLeft, r = this._renderTop;
    const n = this._renderWidth, i = this._renderHeight;
    let s = 0;
    this.isThumbClamped && this.isThumbCircle ? (this.isVertical ? r += this._effectiveThumbThickness / 2 : t += this._effectiveThumbThickness / 2, s = this._backgroundBoxThickness / 2) : s = (this._effectiveThumbThickness - this._effectiveBarOffset) / 2, (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY);
    const a = this._getThumbPosition();
    e.fillStyle = this._getBackgroundColor(e), this.isVertical ? this.isThumbClamped ? this.isThumbCircle ? (e.beginPath(), e.arc(t + this._backgroundBoxThickness / 2, r, s, Math.PI, 2 * Math.PI), e.fill(), e.fillRect(t, r, n, i)) : e.fillRect(t, r, n, i + this._effectiveThumbThickness) : e.fillRect(t, r, n, i) : this.isThumbClamped ? this.isThumbCircle ? (e.beginPath(), e.arc(t + this._backgroundBoxLength, r + this._backgroundBoxThickness / 2, s, 0, 2 * Math.PI), e.fill(), e.fillRect(t, r, n, i)) : e.fillRect(t, r, n + this._effectiveThumbThickness, i) : e.fillRect(t, r, n, i), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0), e.fillStyle = this._getColor(e), this._displayValueBar && (this.isVertical ? this.isThumbClamped ? this.isThumbCircle ? (e.beginPath(), e.arc(t + this._backgroundBoxThickness / 2, r + this._backgroundBoxLength, s, 0, 2 * Math.PI), e.fill(), e.fillRect(t, r + a, n, i - a)) : e.fillRect(t, r + a, n, i - a + this._effectiveThumbThickness) : e.fillRect(t, r + a, n, i - a) : (this.isThumbClamped && this.isThumbCircle && (e.beginPath(), e.arc(t, r + this._backgroundBoxThickness / 2, s, 0, 2 * Math.PI), e.fill()), e.fillRect(t, r, a, i))), e.fillStyle = this._thumbColor || this._getColor(e), this.displayThumb && ((this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowColor = this.shadowColor, e.shadowBlur = this.shadowBlur, e.shadowOffsetX = this.shadowOffsetX, e.shadowOffsetY = this.shadowOffsetY), this._isThumbCircle ? (e.beginPath(), this.isVertical ? e.arc(t + this._backgroundBoxThickness / 2, r + a, s, 0, 2 * Math.PI) : e.arc(t + a, r + this._backgroundBoxThickness / 2, s, 0, 2 * Math.PI), e.fill(), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0), e.strokeStyle = this._borderColor, e.stroke()) : (this.isVertical ? e.fillRect(t - this._effectiveBarOffset, this._currentMeasure.top + a, this._currentMeasure.width, this._effectiveThumbThickness) : e.fillRect(this._currentMeasure.left + a, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height), (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) && (e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0), e.strokeStyle = this._borderColor, this.isVertical ? e.strokeRect(t - this._effectiveBarOffset, this._currentMeasure.top + a, this._currentMeasure.width, this._effectiveThumbThickness) : e.strokeRect(this._currentMeasure.left + a, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height))), e.restore();
  }
  serialize(e) {
    super.serialize(e), this.backgroundGradient && (e.backgroundGradient = {}, this.backgroundGradient.serialize(e.backgroundGradient));
  }
  /** @internal */
  _parseFromContent(e, t) {
    if (super._parseFromContent(e, t), e.backgroundGradient) {
      const r = ye.Instantiate("BABYLON.GUI." + e.backgroundGradient.className);
      this.backgroundGradient = new r(), this.backgroundGradient.parse(e.backgroundGradient);
    }
  }
}
C([
  M()
], DU.prototype, "displayValueBar", null);
C([
  M()
], DU.prototype, "borderColor", null);
C([
  M()
], DU.prototype, "background", null);
C([
  M()
], DU.prototype, "thumbColor", null);
C([
  M()
], DU.prototype, "isThumbCircle", null);
Ue("BABYLON.GUI.Slider", DU);
class wwe extends Ev {
  get freezeControls() {
    return this._freezeControls;
  }
  set freezeControls(e) {
    if (this._freezeControls === e)
      return;
    e || this._restoreMeasures(), this._freezeControls = !1;
    const t = this.host.getSize(), r = t.width, n = t.height, i = this.host.getContext(), s = new b6(0, 0, r, n);
    this.host._numLayoutCalls = 0, this.host._rootContainer._layout(s, i), e && (this._updateMeasures(), this._useBuckets() && this._makeBuckets()), this._freezeControls = e, this.host.markAsDirty();
  }
  get bucketWidth() {
    return this._bucketWidth;
  }
  get bucketHeight() {
    return this._bucketHeight;
  }
  setBucketSizes(e, t) {
    this._bucketWidth = e, this._bucketHeight = t, this._useBuckets() ? this._freezeControls && this._makeBuckets() : this._buckets = {};
  }
  _useBuckets() {
    return this._bucketWidth > 0 && this._bucketHeight > 0;
  }
  _makeBuckets() {
    this._buckets = {}, this._bucketLen = Math.ceil(this.widthInPixels / this._bucketWidth), this._dispatchInBuckets(this._children), this._oldLeft = null, this._oldTop = null;
  }
  _dispatchInBuckets(e) {
    for (let t = 0; t < e.length; ++t) {
      const r = e[t], n = Math.max(0, Math.floor((r._customData._origLeft - this._customData.origLeft) / this._bucketWidth)), i = Math.floor((r._customData._origLeft - this._customData.origLeft + r._currentMeasure.width - 1) / this._bucketWidth), s = Math.floor((r._customData._origTop - this._customData.origTop + r._currentMeasure.height - 1) / this._bucketHeight);
      let a = Math.max(0, Math.floor((r._customData._origTop - this._customData.origTop) / this._bucketHeight));
      for (; a <= s; ) {
        for (let f = n; f <= i; ++f) {
          const o = a * this._bucketLen + f;
          let d = this._buckets[o];
          d || (d = [], this._buckets[o] = d), d.push(r);
        }
        a++;
      }
      r instanceof Ev && r._children.length > 0 && this._dispatchInBuckets(r._children);
    }
  }
  // reset left and top measures for the window and all its children
  _updateMeasures() {
    const e = this.leftInPixels | 0, t = this.topInPixels | 0;
    this._measureForChildren.left -= e, this._measureForChildren.top -= t, this._currentMeasure.left -= e, this._currentMeasure.top -= t, this._customData.origLeftForChildren = this._measureForChildren.left, this._customData.origTopForChildren = this._measureForChildren.top, this._customData.origLeft = this._currentMeasure.left, this._customData.origTop = this._currentMeasure.top, this._updateChildrenMeasures(this._children, e, t);
  }
  _updateChildrenMeasures(e, t, r) {
    for (let n = 0; n < e.length; ++n) {
      const i = e[n];
      i._currentMeasure.left -= t, i._currentMeasure.top -= r, i._customData._origLeft = i._currentMeasure.left, i._customData._origTop = i._currentMeasure.top, i instanceof Ev && i._children.length > 0 && this._updateChildrenMeasures(i._children, t, r);
    }
  }
  _restoreMeasures() {
    const e = this.leftInPixels | 0, t = this.topInPixels | 0;
    this._measureForChildren.left = this._customData.origLeftForChildren + e, this._measureForChildren.top = this._customData.origTopForChildren + t, this._currentMeasure.left = this._customData.origLeft + e, this._currentMeasure.top = this._customData.origTop + t;
  }
  /**
   * Creates a new ScrollViewerWindow
   * @param name of ScrollViewerWindow
   */
  constructor(e) {
    super(e), this._freezeControls = !1, this._bucketWidth = 0, this._bucketHeight = 0, this._buckets = {};
  }
  _getTypeName() {
    return "ScrollViewerWindow";
  }
  /**
   * @internal
   */
  _additionalProcessing(e, t) {
    super._additionalProcessing(e, t), this._parentMeasure = e, this._measureForChildren.left = this._currentMeasure.left, this._measureForChildren.top = this._currentMeasure.top, this._measureForChildren.width = e.width, this._measureForChildren.height = e.height;
  }
  /**
   * @internal
   */
  _layout(e, t) {
    return this._freezeControls ? (this.invalidateRect(), !1) : super._layout(e, t);
  }
  _scrollChildren(e, t, r) {
    for (let n = 0; n < e.length; ++n) {
      const i = e[n];
      i._currentMeasure.left = i._customData._origLeft + t, i._currentMeasure.top = i._customData._origTop + r, i._isClipped = !1, i instanceof Ev && i._children.length > 0 && this._scrollChildren(i._children, t, r);
    }
  }
  _scrollChildrenWithBuckets(e, t, r, n) {
    const i = Math.max(0, Math.floor(-e / this._bucketWidth)), s = Math.floor((-e + this._parentMeasure.width - 1) / this._bucketWidth), a = Math.floor((-t + this._parentMeasure.height - 1) / this._bucketHeight);
    let f = Math.max(0, Math.floor(-t / this._bucketHeight));
    for (; f <= a; ) {
      for (let o = i; o <= s; ++o) {
        const d = f * this._bucketLen + o, v = this._buckets[d];
        if (v)
          for (let u = 0; u < v.length; ++u) {
            const l = v[u];
            l._currentMeasure.left = l._customData._origLeft + r, l._currentMeasure.top = l._customData._origTop + n, l._isClipped = !1;
          }
      }
      f++;
    }
  }
  /**
   * @internal
   */
  _draw(e, t) {
    if (!this._freezeControls) {
      super._draw(e, t);
      return;
    }
    this._localDraw(e), this.clipChildren && this._clipForChildren(e);
    const r = this.leftInPixels | 0, n = this.topInPixels | 0;
    this._useBuckets() ? this._oldLeft !== null && this._oldTop !== null ? (this._scrollChildrenWithBuckets(this._oldLeft, this._oldTop, r, n), this._scrollChildrenWithBuckets(r, n, r, n)) : this._scrollChildren(this._children, r, n) : this._scrollChildren(this._children, r, n), this._oldLeft = r, this._oldTop = n;
    for (const i of this._children)
      i._intersectsRect(this._parentMeasure) && i._render(e, this._parentMeasure);
  }
  _postMeasure() {
    if (this._freezeControls) {
      super._postMeasure();
      return;
    }
    let e = this.parentClientWidth, t = this.parentClientHeight;
    for (const r of this.children)
      !r.isVisible || r.notRenderable || (r.horizontalAlignment === St.HORIZONTAL_ALIGNMENT_CENTER && r._offsetLeft(this._currentMeasure.left - r._currentMeasure.left), r.verticalAlignment === St.VERTICAL_ALIGNMENT_CENTER && r._offsetTop(this._currentMeasure.top - r._currentMeasure.top), e = Math.max(e, r._currentMeasure.left - this._currentMeasure.left + r._currentMeasure.width + r.paddingRightInPixels), t = Math.max(t, r._currentMeasure.top - this._currentMeasure.top + r._currentMeasure.height + r.paddingBottomInPixels));
    this._currentMeasure.width !== e && (this._width.updateInPlace(e, Ai.UNITMODE_PIXEL), this._currentMeasure.width = e, this._rebuildLayout = !0, this._isDirty = !0), this._currentMeasure.height !== t && (this._height.updateInPlace(t, Ai.UNITMODE_PIXEL), this._currentMeasure.height = t, this._rebuildLayout = !0, this._isDirty = !0), super._postMeasure();
  }
}
class $S extends wp {
  /** Gets or sets border color */
  get borderColor() {
    return this._borderColor;
  }
  set borderColor(e) {
    this._borderColor !== e && (this._borderColor = e, this._markAsDirty());
  }
  /** Gets or sets background color */
  get background() {
    return this._background;
  }
  set background(e) {
    this._background !== e && (this._background = e, this._markAsDirty());
  }
  /** Gets or sets background gradient. Takes precedence over gradient. */
  get backgroundGradient() {
    return this._backgroundGradient;
  }
  set backgroundGradient(e) {
    this._backgroundGradient !== e && (this._backgroundGradient = e, this._markAsDirty());
  }
  /** Inverts the scrolling direction (default: false) */
  get invertScrollDirection() {
    return this._invertScrollDirection;
  }
  set invertScrollDirection(e) {
    this._invertScrollDirection = e;
  }
  /**
   * Creates a new Slider
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._background = "black", this._borderColor = "white", this._tempMeasure = new b6(0, 0, 0, 0), this._invertScrollDirection = !1, this._backgroundGradient = null;
  }
  _getTypeName() {
    return "Scrollbar";
  }
  _getThumbThickness() {
    let e = 0;
    return this._thumbWidth.isPixel ? e = this._thumbWidth.getValue(this._host) : e = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host), e;
  }
  _getBackgroundColor(e) {
    return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(e) : this._background;
  }
  _draw(e) {
    e.save(), this._applyStates(e), this._prepareRenderingData("rectangle");
    const t = this._renderLeft, r = this._getThumbPosition();
    e.fillStyle = this._getBackgroundColor(e), e.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height), e.fillStyle = this._getColor(e), this.isVertical ? (this._tempMeasure.left = t - this._effectiveBarOffset, this._tempMeasure.top = this._currentMeasure.top + r, this._tempMeasure.width = this._currentMeasure.width, this._tempMeasure.height = this._effectiveThumbThickness) : (this._tempMeasure.left = this._currentMeasure.left + r, this._tempMeasure.top = this._currentMeasure.top, this._tempMeasure.width = this._effectiveThumbThickness, this._tempMeasure.height = this._currentMeasure.height), e.fillRect(this._tempMeasure.left, this._tempMeasure.top, this._tempMeasure.width, this._tempMeasure.height), e.restore();
  }
  /**
   * @internal
   */
  _updateValueFromPointer(e, t) {
    this.rotation != 0 && (this._invertTransformMatrix.transformCoordinates(e, t, this._transformedPosition), e = this._transformedPosition.x, t = this._transformedPosition.y);
    const r = this._invertScrollDirection ? -1 : 1;
    this._first && (this._first = !1, this._originX = e, this._originY = t, (e < this._tempMeasure.left || e > this._tempMeasure.left + this._tempMeasure.width || t < this._tempMeasure.top || t > this._tempMeasure.top + this._tempMeasure.height) && (this.isVertical ? this.value = this.minimum + (1 - (t - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum) : this.value = this.minimum + (e - this._currentMeasure.left) / this._currentMeasure.width * (this.maximum - this.minimum)));
    let n = 0;
    this.isVertical ? n = -((t - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness)) : n = (e - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness), this.value += r * n * (this.maximum - this.minimum), this._originX = e, this._originY = t;
  }
  _onPointerDown(e, t, r, n, i) {
    return this._first = !0, super._onPointerDown(e, t, r, n, i);
  }
  serialize(e) {
    super.serialize(e), this.backgroundGradient && (e.backgroundGradient = {}, this.backgroundGradient.serialize(e.backgroundGradient));
  }
  _parseFromContent(e, t) {
    if (super._parseFromContent(e, t), e.backgroundGradient) {
      const r = ye.Instantiate("BABYLON.GUI." + e.backgroundGradient.className);
      this.backgroundGradient = new r(), this.backgroundGradient.parse(e.backgroundGradient);
    }
  }
}
C([
  M()
], $S.prototype, "borderColor", null);
C([
  M()
], $S.prototype, "background", null);
C([
  M()
], $S.prototype, "invertScrollDirection", null);
Ue("BABYLON.GUI.Scrollbar", $S);
class XO extends wp {
  /** Inverts the scrolling direction (default: false) */
  get invertScrollDirection() {
    return this._invertScrollDirection;
  }
  set invertScrollDirection(e) {
    this._invertScrollDirection = e;
  }
  /**
   * Gets or sets the image used to render the background for horizontal bar
   */
  get backgroundImage() {
    return this._backgroundBaseImage;
  }
  set backgroundImage(e) {
    this._backgroundBaseImage !== e && (this._backgroundBaseImage = e, this.isVertical && this.num90RotationInVerticalMode !== 0 ? e.isLoaded ? (this._backgroundImage = e._rotate90(this.num90RotationInVerticalMode, !0), this._markAsDirty()) : e.onImageLoadedObservable.addOnce(() => {
      const t = e._rotate90(this.num90RotationInVerticalMode, !0);
      this._backgroundImage = t, t.isLoaded || t.onImageLoadedObservable.addOnce(() => {
        this._markAsDirty();
      }), this._markAsDirty();
    }) : (this._backgroundImage = e, e && !e.isLoaded && e.onImageLoadedObservable.addOnce(() => {
      this._markAsDirty();
    }), this._markAsDirty()));
  }
  /**
   * Gets or sets the image used to render the thumb
   */
  get thumbImage() {
    return this._thumbBaseImage;
  }
  set thumbImage(e) {
    this._thumbBaseImage !== e && (this._thumbBaseImage = e, this.isVertical && this.num90RotationInVerticalMode !== 0 ? e.isLoaded ? (this._thumbImage = e._rotate90(-this.num90RotationInVerticalMode, !0), this._markAsDirty()) : e.onImageLoadedObservable.addOnce(() => {
      const t = e._rotate90(-this.num90RotationInVerticalMode, !0);
      this._thumbImage = t, t.isLoaded || t.onImageLoadedObservable.addOnce(() => {
        this._markAsDirty();
      }), this._markAsDirty();
    }) : (this._thumbImage = e, e && !e.isLoaded && e.onImageLoadedObservable.addOnce(() => {
      this._markAsDirty();
    }), this._markAsDirty()));
  }
  /**
   * Gets or sets the length of the thumb
   */
  get thumbLength() {
    return this._thumbLength;
  }
  set thumbLength(e) {
    this._thumbLength !== e && (this._thumbLength = e, this._markAsDirty());
  }
  /**
   * Gets or sets the height of the thumb
   */
  get thumbHeight() {
    return this._thumbHeight;
  }
  set thumbHeight(e) {
    this._thumbLength !== e && (this._thumbHeight = e, this._markAsDirty());
  }
  /**
   * Gets or sets the height of the bar image
   */
  get barImageHeight() {
    return this._barImageHeight;
  }
  set barImageHeight(e) {
    this._barImageHeight !== e && (this._barImageHeight = e, this._markAsDirty());
  }
  /**
   * Creates a new ImageScrollBar
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._thumbLength = 0.5, this._thumbHeight = 1, this._barImageHeight = 1, this._tempMeasure = new b6(0, 0, 0, 0), this._invertScrollDirection = !1, this.num90RotationInVerticalMode = 1;
  }
  _getTypeName() {
    return "ImageScrollBar";
  }
  _getThumbThickness() {
    let e = 0;
    return this._thumbWidth.isPixel ? e = this._thumbWidth.getValue(this._host) : e = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host), e;
  }
  _draw(e) {
    e.save(), this._applyStates(e), this._prepareRenderingData("rectangle");
    const t = this._getThumbPosition(), r = this._renderLeft, n = this._renderTop, i = this._renderWidth, s = this._renderHeight;
    this._backgroundImage && (this._tempMeasure.copyFromFloats(r, n, i, s), this.isVertical ? (this._tempMeasure.copyFromFloats(r + i * (1 - this._barImageHeight) * 0.5, this._currentMeasure.top, i * this._barImageHeight, s), this._tempMeasure.height += this._effectiveThumbThickness, this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure)) : (this._tempMeasure.copyFromFloats(this._currentMeasure.left, n + s * (1 - this._barImageHeight) * 0.5, i, s * this._barImageHeight), this._tempMeasure.width += this._effectiveThumbThickness, this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure)), this._backgroundImage._draw(e)), this.isVertical ? this._tempMeasure.copyFromFloats(r - this._effectiveBarOffset + this._currentMeasure.width * (1 - this._thumbHeight) * 0.5, this._currentMeasure.top + t, this._currentMeasure.width * this._thumbHeight, this._effectiveThumbThickness) : this._tempMeasure.copyFromFloats(this._currentMeasure.left + t, this._currentMeasure.top + this._currentMeasure.height * (1 - this._thumbHeight) * 0.5, this._effectiveThumbThickness, this._currentMeasure.height * this._thumbHeight), this._thumbImage && (this._thumbImage._currentMeasure.copyFrom(this._tempMeasure), this._thumbImage._draw(e)), e.restore();
  }
  /**
   * @internal
   */
  _updateValueFromPointer(e, t) {
    this.rotation != 0 && (this._invertTransformMatrix.transformCoordinates(e, t, this._transformedPosition), e = this._transformedPosition.x, t = this._transformedPosition.y);
    const r = this._invertScrollDirection ? -1 : 1;
    this._first && (this._first = !1, this._originX = e, this._originY = t, (e < this._tempMeasure.left || e > this._tempMeasure.left + this._tempMeasure.width || t < this._tempMeasure.top || t > this._tempMeasure.top + this._tempMeasure.height) && (this.isVertical ? this.value = this.minimum + (1 - (t - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum) : this.value = this.minimum + (e - this._currentMeasure.left) / this._currentMeasure.width * (this.maximum - this.minimum)));
    let n = 0;
    this.isVertical ? n = -((t - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness)) : n = (e - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness), this.value += r * n * (this.maximum - this.minimum), this._originX = e, this._originY = t;
  }
  _onPointerDown(e, t, r, n, i) {
    return this._first = !0, super._onPointerDown(e, t, r, n, i);
  }
}
C([
  M()
], XO.prototype, "num90RotationInVerticalMode", void 0);
C([
  M()
], XO.prototype, "invertScrollDirection", null);
class jU extends p9 {
  /**
   * Gets the horizontal scrollbar
   */
  get horizontalBar() {
    return this._horizontalBar;
  }
  /**
   * Gets the vertical scrollbar
   */
  get verticalBar() {
    return this._verticalBar;
  }
  /**
   * Adds a new control to the current container
   * @param control defines the control to add
   * @returns the current container
   */
  addControl(e) {
    return e ? (this._window.addControl(e), this) : this;
  }
  /**
   * Removes a control from the current container
   * @param control defines the control to remove
   * @returns the current container
   */
  removeControl(e) {
    return this._window.removeControl(e), this;
  }
  /** Gets the list of children */
  get children() {
    return this._window.children;
  }
  _flagDescendantsAsMatrixDirty() {
    for (const e of this._children)
      e._markMatrixAsDirty();
  }
  /**
   * Freezes or unfreezes the controls in the window.
   * When controls are frozen, the scroll viewer can render a lot more quickly but updates to positions/sizes of controls
   * are not taken into account. If you want to change positions/sizes, unfreeze, perform the changes then freeze again
   */
  get freezeControls() {
    return this._window.freezeControls;
  }
  set freezeControls(e) {
    this._window.freezeControls = e;
  }
  /** Gets the bucket width */
  get bucketWidth() {
    return this._window.bucketWidth;
  }
  /** Gets the bucket height */
  get bucketHeight() {
    return this._window.bucketHeight;
  }
  /**
   * Sets the bucket sizes.
   * When freezeControls is true, setting a non-zero bucket size will improve performances by updating only
   * controls that are visible. The bucket sizes is used to subdivide (internally) the window area to smaller areas into which
   * controls are dispatched. So, the size should be roughly equals to the mean size of all the controls of
   * the window. To disable the usage of buckets, sets either width or height (or both) to 0.
   * Please note that using this option will raise the memory usage (the higher the bucket sizes, the less memory
   * used), that's why it is not enabled by default.
   * @param width width of the bucket
   * @param height height of the bucket
   */
  setBucketSizes(e, t) {
    this._window.setBucketSizes(e, t);
  }
  /**
   * Forces the horizontal scroll bar to be displayed
   */
  get forceHorizontalBar() {
    return this._forceHorizontalBar;
  }
  set forceHorizontalBar(e) {
    this._grid.setRowDefinition(1, e ? this._barSize : 0, !0), this._horizontalBar.isVisible = e, this._forceHorizontalBar = e;
  }
  /**
   * Forces the vertical scroll bar to be displayed
   */
  get forceVerticalBar() {
    return this._forceVerticalBar;
  }
  set forceVerticalBar(e) {
    this._grid.setColumnDefinition(1, e ? this._barSize : 0, !0), this._verticalBar.isVisible = e, this._forceVerticalBar = e;
  }
  /**
   * Creates a new ScrollViewer
   * @param name of ScrollViewer
   * @param isImageBased
   */
  constructor(e, t) {
    super(e), this._barSize = 20, this._pointerIsOver = !1, this._wheelPrecision = 0.05, this._thumbLength = 0.5, this._thumbHeight = 1, this._barImageHeight = 1, this._horizontalBarImageHeight = 1, this._verticalBarImageHeight = 1, this._oldWindowContentsWidth = 0, this._oldWindowContentsHeight = 0, this._forceHorizontalBar = !1, this._forceVerticalBar = !1, this._useImageBar = t || !1, this.onDirtyObservable.add(() => {
      this._horizontalBarSpace.color = this.color, this._verticalBarSpace.color = this.color, this._dragSpace.color = this.color;
    }), this.onPointerEnterObservable.add(() => {
      this._pointerIsOver = !0;
    }), this.onPointerOutObservable.add(() => {
      this._pointerIsOver = !1;
    }), this._grid = new Iu(), this._useImageBar ? (this._horizontalBar = new XO(), this._verticalBar = new XO()) : (this._horizontalBar = new $S(), this._verticalBar = new $S()), this._window = new wwe("scrollViewer_window"), this._window.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, this._window.verticalAlignment = St.VERTICAL_ALIGNMENT_TOP, this._grid.addColumnDefinition(1), this._grid.addColumnDefinition(0, !0), this._grid.addRowDefinition(1), this._grid.addRowDefinition(0, !0), super.addControl(this._grid), this._grid.addControl(this._window, 0, 0), this._verticalBarSpace = new p9(), this._verticalBarSpace.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, this._verticalBarSpace.verticalAlignment = St.VERTICAL_ALIGNMENT_TOP, this._verticalBarSpace.thickness = 1, this._grid.addControl(this._verticalBarSpace, 0, 1), this._addBar(this._verticalBar, this._verticalBarSpace, !0, Math.PI), this._horizontalBarSpace = new p9(), this._horizontalBarSpace.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, this._horizontalBarSpace.verticalAlignment = St.VERTICAL_ALIGNMENT_TOP, this._horizontalBarSpace.thickness = 1, this._grid.addControl(this._horizontalBarSpace, 1, 0), this._addBar(this._horizontalBar, this._horizontalBarSpace, !1, 0), this._dragSpace = new p9(), this._dragSpace.thickness = 1, this._grid.addControl(this._dragSpace, 1, 1), this._useImageBar || (this.barColor = "grey", this.barBackground = "transparent");
  }
  /** Reset the scroll viewer window to initial size */
  resetWindow() {
    this._window.width = "100%", this._window.height = "100%";
  }
  _getTypeName() {
    return "ScrollViewer";
  }
  _buildClientSizes() {
    const e = this.host.idealRatio;
    this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * e : 0) - 2 * this.thickness, this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * e : 0) - 2 * this.thickness, this._clientWidth = this._window.parentClientWidth, this._clientHeight = this._window.parentClientHeight;
  }
  _additionalProcessing(e, t) {
    super._additionalProcessing(e, t), this._buildClientSizes();
  }
  _postMeasure() {
    super._postMeasure(), this._updateScroller(), this._setWindowPosition(!1);
  }
  /**
   * Gets or sets the mouse wheel precision
   * from 0 to 1 with a default value of 0.05
   * */
  get wheelPrecision() {
    return this._wheelPrecision;
  }
  set wheelPrecision(e) {
    this._wheelPrecision !== e && (e < 0 && (e = 0), e > 1 && (e = 1), this._wheelPrecision = e);
  }
  /** Gets or sets the scroll bar container background color */
  get scrollBackground() {
    return this._horizontalBarSpace.background;
  }
  set scrollBackground(e) {
    this._horizontalBarSpace.background !== e && (this._horizontalBarSpace.background = e, this._verticalBarSpace.background = e);
  }
  /** Gets or sets the bar color */
  get barColor() {
    return this._barColor;
  }
  set barColor(e) {
    this._barColor !== e && (this._barColor = e, this._horizontalBar.color = e, this._verticalBar.color = e);
  }
  /** Gets or sets the bar image */
  get thumbImage() {
    return this._barImage;
  }
  set thumbImage(e) {
    if (this._barImage === e)
      return;
    this._barImage = e;
    const t = this._horizontalBar, r = this._verticalBar;
    t.thumbImage = e, r.thumbImage = e;
  }
  /** Gets or sets the horizontal bar image */
  get horizontalThumbImage() {
    return this._horizontalBarImage;
  }
  set horizontalThumbImage(e) {
    if (this._horizontalBarImage === e)
      return;
    this._horizontalBarImage = e;
    const t = this._horizontalBar;
    t.thumbImage = e;
  }
  /** Gets or sets the vertical bar image */
  get verticalThumbImage() {
    return this._verticalBarImage;
  }
  set verticalThumbImage(e) {
    if (this._verticalBarImage === e)
      return;
    this._verticalBarImage = e;
    const t = this._verticalBar;
    t.thumbImage = e;
  }
  /** Gets or sets the size of the bar */
  get barSize() {
    return this._barSize;
  }
  set barSize(e) {
    this._barSize !== e && (this._barSize = e, this._markAsDirty(), this._horizontalBar.isVisible && this._grid.setRowDefinition(1, this._barSize, !0), this._verticalBar.isVisible && this._grid.setColumnDefinition(1, this._barSize, !0));
  }
  /** Gets or sets the length of the thumb */
  get thumbLength() {
    return this._thumbLength;
  }
  set thumbLength(e) {
    if (this._thumbLength === e)
      return;
    e <= 0 && (e = 0.1), e > 1 && (e = 1), this._thumbLength = e;
    const t = this._horizontalBar, r = this._verticalBar;
    t.thumbLength = e, r.thumbLength = e, this._markAsDirty();
  }
  /** Gets or sets the height of the thumb */
  get thumbHeight() {
    return this._thumbHeight;
  }
  set thumbHeight(e) {
    if (this._thumbHeight === e)
      return;
    e <= 0 && (e = 0.1), e > 1 && (e = 1), this._thumbHeight = e;
    const t = this._horizontalBar, r = this._verticalBar;
    t.thumbHeight = e, r.thumbHeight = e, this._markAsDirty();
  }
  /** Gets or sets the height of the bar image */
  get barImageHeight() {
    return this._barImageHeight;
  }
  set barImageHeight(e) {
    if (this._barImageHeight === e)
      return;
    e <= 0 && (e = 0.1), e > 1 && (e = 1), this._barImageHeight = e;
    const t = this._horizontalBar, r = this._verticalBar;
    t.barImageHeight = e, r.barImageHeight = e, this._markAsDirty();
  }
  /** Gets or sets the height of the horizontal bar image */
  get horizontalBarImageHeight() {
    return this._horizontalBarImageHeight;
  }
  set horizontalBarImageHeight(e) {
    if (this._horizontalBarImageHeight === e)
      return;
    e <= 0 && (e = 0.1), e > 1 && (e = 1), this._horizontalBarImageHeight = e;
    const t = this._horizontalBar;
    t.barImageHeight = e, this._markAsDirty();
  }
  /** Gets or sets the height of the vertical bar image */
  get verticalBarImageHeight() {
    return this._verticalBarImageHeight;
  }
  set verticalBarImageHeight(e) {
    if (this._verticalBarImageHeight === e)
      return;
    e <= 0 && (e = 0.1), e > 1 && (e = 1), this._verticalBarImageHeight = e;
    const t = this._verticalBar;
    t.barImageHeight = e, this._markAsDirty();
  }
  /** Gets or sets the bar background */
  get barBackground() {
    return this._barBackground;
  }
  set barBackground(e) {
    if (this._barBackground === e)
      return;
    this._barBackground = e;
    const t = this._horizontalBar, r = this._verticalBar;
    t.background = e, r.background = e, this._dragSpace.background = e;
  }
  /** Gets or sets the bar background image */
  get barImage() {
    return this._barBackgroundImage;
  }
  set barImage(e) {
    this._barBackgroundImage = e;
    const t = this._horizontalBar, r = this._verticalBar;
    t.backgroundImage = e, r.backgroundImage = e;
  }
  /** Gets or sets the horizontal bar background image */
  get horizontalBarImage() {
    return this._horizontalBarBackgroundImage;
  }
  set horizontalBarImage(e) {
    this._horizontalBarBackgroundImage = e;
    const t = this._horizontalBar;
    t.backgroundImage = e;
  }
  /** Gets or sets the vertical bar background image */
  get verticalBarImage() {
    return this._verticalBarBackgroundImage;
  }
  set verticalBarImage(e) {
    this._verticalBarBackgroundImage = e;
    const t = this._verticalBar;
    t.backgroundImage = e;
  }
  _setWindowPosition(e = !0) {
    const t = this.host.idealRatio, r = this._window._currentMeasure.width, n = this._window._currentMeasure.height;
    if (!e && this._oldWindowContentsWidth === r && this._oldWindowContentsHeight === n)
      return;
    this._oldWindowContentsWidth = r, this._oldWindowContentsHeight = n;
    const i = this._clientWidth - r, s = this._clientHeight - n, a = this._horizontalBar.value / t * i + "px", f = this._verticalBar.value / t * s + "px";
    a !== this._window.left && (this._window.left = a, this.freezeControls || (this._rebuildLayout = !0)), f !== this._window.top && (this._window.top = f, this.freezeControls || (this._rebuildLayout = !0));
  }
  /** @internal */
  _updateScroller() {
    const e = this._window._currentMeasure.width, t = this._window._currentMeasure.height;
    this._horizontalBar.isVisible && e <= this._clientWidth && !this.forceHorizontalBar ? (this._grid.setRowDefinition(1, 0, !0), this._horizontalBar.isVisible = !1, this._horizontalBar.value = 0, this._rebuildLayout = !0) : !this._horizontalBar.isVisible && (e > this._clientWidth || this.forceHorizontalBar) && (this._grid.setRowDefinition(1, this._barSize, !0), this._horizontalBar.isVisible = !0, this._rebuildLayout = !0), this._verticalBar.isVisible && t <= this._clientHeight && !this.forceVerticalBar ? (this._grid.setColumnDefinition(1, 0, !0), this._verticalBar.isVisible = !1, this._verticalBar.value = 0, this._rebuildLayout = !0) : !this._verticalBar.isVisible && (t > this._clientHeight || this.forceVerticalBar) && (this._grid.setColumnDefinition(1, this._barSize, !0), this._verticalBar.isVisible = !0, this._rebuildLayout = !0), this._buildClientSizes();
    const r = this.host.idealRatio;
    this._horizontalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientWidth / r) + "px", this._verticalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientHeight / r) + "px";
  }
  _link(e) {
    super._link(e), this._attachWheel();
  }
  /**
   * @internal
   */
  _addBar(e, t, r, n) {
    e.paddingLeft = 0, e.width = "100%", e.height = "100%", e.barOffset = 0, e.value = 0, e.maximum = 1, e.horizontalAlignment = St.HORIZONTAL_ALIGNMENT_CENTER, e.verticalAlignment = St.VERTICAL_ALIGNMENT_CENTER, e.isVertical = r, e.rotation = n, e.isVisible = !1, t.addControl(e), e.onValueChangedObservable.add(() => {
      this._setWindowPosition();
    });
  }
  /** @internal */
  _attachWheel() {
    !this._host || this._onWheelObserver || (this._onWheelObserver = this.onWheelObservable.add((e) => {
      !this._pointerIsOver || this.isReadOnly || (this._verticalBar.isVisible == !0 && (e.y < 0 && this._verticalBar.value > 0 ? this._verticalBar.value -= this._wheelPrecision : e.y > 0 && this._verticalBar.value < this._verticalBar.maximum && (this._verticalBar.value += this._wheelPrecision)), this._horizontalBar.isVisible == !0 && (e.x < 0 && this._horizontalBar.value < this._horizontalBar.maximum ? this._horizontalBar.value += this._wheelPrecision : e.x > 0 && this._horizontalBar.value > 0 && (this._horizontalBar.value -= this._wheelPrecision)));
    }));
  }
  _renderHighlightSpecific(e) {
    this.isHighlighted && (super._renderHighlightSpecific(e), this._grid._renderHighlightSpecific(e), e.restore());
  }
  /** Releases associated resources */
  dispose() {
    this.onWheelObservable.remove(this._onWheelObserver), this._onWheelObserver = null, super.dispose();
  }
}
C([
  M()
], jU.prototype, "wheelPrecision", null);
C([
  M()
], jU.prototype, "scrollBackground", null);
C([
  M()
], jU.prototype, "barColor", null);
C([
  M()
], jU.prototype, "barSize", null);
C([
  M()
], jU.prototype, "barBackground", null);
Ue("BABYLON.GUI.ScrollViewer", jU);
class mwe extends p9 {
  /** Gets or sets group name this toggle button belongs to */
  get group() {
    return this._group;
  }
  set group(e) {
    this._group !== e && (this._group = e);
  }
  /** Gets or sets a boolean indicating if the toggle button is active or not */
  get isActive() {
    return this._isActive;
  }
  set isActive(e) {
    var t, r;
    this._isActive !== e && (this._isActive = e, this._isActive ? (t = this.toActiveAnimation) === null || t === void 0 || t.call(this) : (r = this.toInactiveAnimation) === null || r === void 0 || r.call(this), this._markAsDirty(), this.onIsActiveChangedObservable.notifyObservers(e), this._isActive && this._host && this._group && this._host.executeOnAllControls((n) => {
      if (n.typeName === "ToggleButton") {
        if (n === this)
          return;
        const i = n;
        i.group === this.group && (i.isActive = !1);
      }
    }));
  }
  /**
   * Creates a new ToggleButton
   * @param name defines the control name
   * @param group defines the toggle group this toggle belongs to
   */
  constructor(e, t) {
    super(e), this.name = e, this.onIsActiveChangedObservable = new Oe(), this.delegatePickingToChildren = !1, this._isActive = !1, this.group = t ?? "", this.thickness = 0, this.isPointerBlocker = !0;
    let r = null;
    this.toActiveAnimation = () => {
      this.thickness = 1;
    }, this.toInactiveAnimation = () => {
      this.thickness = 0;
    }, this.pointerEnterActiveAnimation = () => {
      r = this.alpha, this.alpha -= 0.1;
    }, this.pointerOutActiveAnimation = () => {
      r !== null && (this.alpha = r);
    }, this.pointerDownActiveAnimation = () => {
      this.scaleX -= 0.05, this.scaleY -= 0.05;
    }, this.pointerUpActiveAnimation = () => {
      this.scaleX += 0.05, this.scaleY += 0.05;
    }, this.pointerEnterInactiveAnimation = () => {
      r = this.alpha, this.alpha -= 0.1;
    }, this.pointerOutInactiveAnimation = () => {
      r !== null && (this.alpha = r);
    }, this.pointerDownInactiveAnimation = () => {
      this.scaleX -= 0.05, this.scaleY -= 0.05;
    }, this.pointerUpInactiveAnimation = () => {
      this.scaleX += 0.05, this.scaleY += 0.05;
    };
  }
  _getTypeName() {
    return "ToggleButton";
  }
  // While being a container, the toggle button behaves like a control.
  /**
   * @internal
   */
  _processPicking(e, t, r, n, i, s, a, f) {
    if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable || !super.contains(e, t))
      return !1;
    if (this.delegatePickingToChildren) {
      let o = !1;
      for (let d = this._children.length - 1; d >= 0; d--) {
        const v = this._children[d];
        if (v.isEnabled && v.isHitTestVisible && v.isVisible && !v.notRenderable && v.contains(e, t)) {
          o = !0;
          break;
        }
      }
      if (!o)
        return !1;
    }
    return this._processObservables(n, e, t, r, i, s, a, f), !0;
  }
  /**
   * @internal
   */
  _onPointerEnter(e, t) {
    return super._onPointerEnter(e, t) ? (this.isReadOnly || (this._isActive ? this.pointerEnterActiveAnimation && this.pointerEnterActiveAnimation() : this.pointerEnterInactiveAnimation && this.pointerEnterInactiveAnimation()), !0) : !1;
  }
  /**
   * @internal
   */
  _onPointerOut(e, t, r = !1) {
    this.isReadOnly || (this._isActive ? this.pointerOutActiveAnimation && this.pointerOutActiveAnimation() : this.pointerOutInactiveAnimation && this.pointerOutInactiveAnimation()), super._onPointerOut(e, t, r);
  }
  /**
   * @internal
   */
  _onPointerDown(e, t, r, n, i) {
    return super._onPointerDown(e, t, r, n, i) ? (this.isReadOnly || (this._isActive ? this.pointerDownActiveAnimation && this.pointerDownActiveAnimation() : this.pointerDownInactiveAnimation && this.pointerDownInactiveAnimation()), !0) : !1;
  }
  /**
   * @internal
   */
  _onPointerUp(e, t, r, n, i, s) {
    this.isReadOnly || (this._isActive ? this.pointerUpActiveAnimation && this.pointerUpActiveAnimation() : this.pointerUpInactiveAnimation && this.pointerUpInactiveAnimation()), super._onPointerUp(e, t, r, n, i, s);
  }
}
Ue("BABYLON.GUI.ToggleButton", mwe);
class jM extends ug {
  constructor() {
    super(...arguments), this.onKeyPressObservable = new Oe(), this.defaultButtonWidth = "40px", this.defaultButtonHeight = "40px", this.defaultButtonPaddingLeft = "2px", this.defaultButtonPaddingRight = "2px", this.defaultButtonPaddingTop = "2px", this.defaultButtonPaddingBottom = "2px", this.defaultButtonColor = "#DDD", this.defaultButtonBackground = "#070707", this.shiftButtonColor = "#7799FF", this.selectedShiftThickness = 1, this.shiftState = 0, this._currentlyConnectedInputText = null, this._connectedInputTexts = [], this._onKeyPressObserver = null;
  }
  _getTypeName() {
    return "VirtualKeyboard";
  }
  _createKey(e, t) {
    const r = V2.CreateSimpleButton(e, e);
    return r.width = t && t.width ? t.width : this.defaultButtonWidth, r.height = t && t.height ? t.height : this.defaultButtonHeight, r.color = t && t.color ? t.color : this.defaultButtonColor, r.background = t && t.background ? t.background : this.defaultButtonBackground, r.paddingLeft = t && t.paddingLeft ? t.paddingLeft : this.defaultButtonPaddingLeft, r.paddingRight = t && t.paddingRight ? t.paddingRight : this.defaultButtonPaddingRight, r.paddingTop = t && t.paddingTop ? t.paddingTop : this.defaultButtonPaddingTop, r.paddingBottom = t && t.paddingBottom ? t.paddingBottom : this.defaultButtonPaddingBottom, r.thickness = 0, r.isFocusInvisible = !0, r.shadowColor = this.shadowColor, r.shadowBlur = this.shadowBlur, r.shadowOffsetX = this.shadowOffsetX, r.shadowOffsetY = this.shadowOffsetY, r.onPointerUpObservable.add(() => {
      this.onKeyPressObservable.notifyObservers(e);
    }), r;
  }
  /**
   * Adds a new row of keys
   * @param keys defines the list of keys to add
   * @param propertySets defines the associated property sets
   */
  addKeysRow(e, t) {
    const r = new ug();
    r.isVertical = !1, r.isFocusInvisible = !0;
    let n = null;
    for (let i = 0; i < e.length; i++) {
      let s = null;
      t && t.length === e.length && (s = t[i]);
      const a = this._createKey(e[i], s);
      (!n || a.heightInPixels > n.heightInPixels) && (n = a), r.addControl(a);
    }
    r.height = n ? n.height : this.defaultButtonHeight, this.addControl(r);
  }
  /**
   * Set the shift key to a specific state
   * @param shiftState defines the new shift state
   */
  applyShiftState(e) {
    if (this.children)
      for (let t = 0; t < this.children.length; t++) {
        const r = this.children[t];
        if (!r || !r.children)
          continue;
        const n = r;
        for (let i = 0; i < n.children.length; i++) {
          const s = n.children[i];
          if (!s || !s.children[0])
            continue;
          const a = s.children[0];
          a.text === "⇧" && (s.color = e ? this.shiftButtonColor : this.defaultButtonColor, s.thickness = e > 1 ? this.selectedShiftThickness : 0), a.text = e > 0 ? a.text.toUpperCase() : a.text.toLowerCase();
        }
      }
  }
  /** Gets the input text control currently attached to the keyboard */
  get connectedInputText() {
    return this._currentlyConnectedInputText;
  }
  /**
   * Connects the keyboard with an input text control
   *
   * @param input defines the target control
   */
  connect(e) {
    if (this._connectedInputTexts.some((i) => i.input === e))
      return;
    this._onKeyPressObserver === null && (this._onKeyPressObserver = this.onKeyPressObservable.add((i) => {
      if (this._currentlyConnectedInputText) {
        switch (this._currentlyConnectedInputText._host.focusedControl = this._currentlyConnectedInputText, i) {
          case "⇧":
            this.shiftState++, this.shiftState > 2 && (this.shiftState = 0), this.applyShiftState(this.shiftState);
            return;
          case "←":
            this._currentlyConnectedInputText instanceof bS ? this._currentlyConnectedInputText.alternativeProcessKey("Backspace") : this._currentlyConnectedInputText.processKey(8);
            return;
          case "↵":
            this._currentlyConnectedInputText instanceof bS ? this._currentlyConnectedInputText.alternativeProcessKey("Enter") : this._currentlyConnectedInputText.processKey(13);
            return;
        }
        this._currentlyConnectedInputText instanceof bS ? this._currentlyConnectedInputText.alternativeProcessKey("", this.shiftState ? i.toUpperCase() : i) : this._currentlyConnectedInputText.processKey(-1, this.shiftState ? i.toUpperCase() : i), this.shiftState === 1 && (this.shiftState = 0, this.applyShiftState(this.shiftState));
      }
    })), this.isVisible = !1, this._currentlyConnectedInputText = e, e._connectedVirtualKeyboard = this;
    const r = e.onFocusObservable.add(() => {
      this._currentlyConnectedInputText = e, e._connectedVirtualKeyboard = this, this.isVisible = !0;
    }), n = e.onBlurObservable.add(() => {
      e._connectedVirtualKeyboard = null, this._currentlyConnectedInputText = null, this.isVisible = !1;
    });
    this._connectedInputTexts.push({
      input: e,
      onBlurObserver: n,
      onFocusObserver: r
    });
  }
  /**
   * Disconnects the keyboard from connected InputText controls
   *
   * @param input optionally defines a target control, otherwise all are disconnected
   */
  disconnect(e) {
    if (e) {
      const t = this._connectedInputTexts.filter((r) => r.input === e);
      t.length === 1 && (this._removeConnectedInputObservables(t[0]), this._connectedInputTexts = this._connectedInputTexts.filter((r) => r.input !== e), this._currentlyConnectedInputText === e && (this._currentlyConnectedInputText = null));
    } else
      this._connectedInputTexts.forEach((t) => {
        this._removeConnectedInputObservables(t);
      }), this._connectedInputTexts.length = 0;
    this._connectedInputTexts.length === 0 && (this._currentlyConnectedInputText = null, this.onKeyPressObservable.remove(this._onKeyPressObserver), this._onKeyPressObserver = null);
  }
  _removeConnectedInputObservables(e) {
    e.input._connectedVirtualKeyboard = null, e.input.onFocusObservable.remove(e.onFocusObserver), e.input.onBlurObservable.remove(e.onBlurObserver);
  }
  /**
   * Release all resources
   */
  dispose() {
    super.dispose(), this.disconnect();
  }
  // Statics
  /**
   * Creates a new keyboard using a default layout
   *
   * @param name defines control name
   * @returns a new VirtualKeyboard
   */
  static CreateDefaultLayout(e) {
    const t = new jM(e);
    return t.addKeysRow(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "←"]), t.addKeysRow(["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"]), t.addKeysRow(["a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "↵"]), t.addKeysRow(["⇧", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/"]), t.addKeysRow([" "], [{ width: "200px" }]), t;
  }
  /**
   * @internal
   */
  _parseFromContent(e, t) {
    super._parseFromContent(e, t);
    for (const r of this.children)
      if (r.getClassName() === "StackPanel") {
        const n = r;
        for (const i of n.children)
          i.getClassName() === "Button" && i.name && i.onPointerUpObservable.add(() => {
            this.onKeyPressObservable.notifyObservers(i.name);
          });
      }
  }
}
Ue("BABYLON.GUI.VirtualKeyboard", jM);
class Hg extends St {
  /** Gets or sets a boolean indicating if minor lines must be rendered (true by default)) */
  get displayMinorLines() {
    return this._displayMinorLines;
  }
  set displayMinorLines(e) {
    this._displayMinorLines !== e && (this._displayMinorLines = e, this._markAsDirty());
  }
  /** Gets or sets a boolean indicating if major lines must be rendered (true by default)) */
  get displayMajorLines() {
    return this._displayMajorLines;
  }
  set displayMajorLines(e) {
    this._displayMajorLines !== e && (this._displayMajorLines = e, this._markAsDirty());
  }
  /** Gets or sets background color (Black by default) */
  get background() {
    return this._background;
  }
  set background(e) {
    this._background !== e && (this._background = e, this._markAsDirty());
  }
  /** Gets or sets the width of each cell (20 by default) */
  get cellWidth() {
    return this._cellWidth;
  }
  set cellWidth(e) {
    this._cellWidth = e, this._markAsDirty();
  }
  /** Gets or sets the height of each cell (20 by default) */
  get cellHeight() {
    return this._cellHeight;
  }
  set cellHeight(e) {
    this._cellHeight = e, this._markAsDirty();
  }
  /** Gets or sets the tickness of minor lines (1 by default) */
  get minorLineTickness() {
    return this._minorLineTickness;
  }
  set minorLineTickness(e) {
    this._minorLineTickness = e, this._markAsDirty();
  }
  /** Gets or sets the color of minor lines (DarkGray by default) */
  get minorLineColor() {
    return this._minorLineColor;
  }
  set minorLineColor(e) {
    this._minorLineColor = e, this._markAsDirty();
  }
  /** Gets or sets the tickness of major lines (2 by default) */
  get majorLineTickness() {
    return this._majorLineTickness;
  }
  set majorLineTickness(e) {
    this._majorLineTickness = e, this._markAsDirty();
  }
  /** Gets or sets the color of major lines (White by default) */
  get majorLineColor() {
    return this._majorLineColor;
  }
  set majorLineColor(e) {
    this._majorLineColor = e, this._markAsDirty();
  }
  /** Gets or sets the frequency of major lines (default is 1 every 5 minor lines)*/
  get majorLineFrequency() {
    return this._majorLineFrequency;
  }
  set majorLineFrequency(e) {
    this._majorLineFrequency = e, this._markAsDirty();
  }
  /**
   * Creates a new GridDisplayRectangle
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._cellWidth = 20, this._cellHeight = 20, this._minorLineTickness = 1, this._minorLineColor = "DarkGray", this._majorLineTickness = 2, this._majorLineColor = "White", this._majorLineFrequency = 5, this._background = "Black", this._displayMajorLines = !0, this._displayMinorLines = !0;
  }
  _draw(e) {
    if (e.save(), this._applyStates(e), this._isEnabled) {
      this._background && (e.fillStyle = this._background, e.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height));
      const t = this._currentMeasure.width / this._cellWidth, r = this._currentMeasure.height / this._cellHeight, n = this._currentMeasure.left + this._currentMeasure.width / 2, i = this._currentMeasure.top + this._currentMeasure.height / 2;
      if (this._displayMinorLines) {
        e.strokeStyle = this._minorLineColor, e.lineWidth = this._minorLineTickness;
        for (let s = -t / 2 + 1; s < t / 2; s++) {
          const a = n + s * this.cellWidth;
          e.beginPath(), e.moveTo(a, this._currentMeasure.top), e.lineTo(a, this._currentMeasure.top + this._currentMeasure.height), e.stroke();
        }
        for (let s = -r / 2 + 1; s < r / 2; s++) {
          const a = i + s * this.cellHeight;
          e.beginPath(), e.moveTo(this._currentMeasure.left, a), e.lineTo(this._currentMeasure.left + this._currentMeasure.width, a), e.stroke();
        }
      }
      if (this._displayMajorLines) {
        e.strokeStyle = this._majorLineColor, e.lineWidth = this._majorLineTickness;
        for (let s = -t / 2 + this._majorLineFrequency; s < t / 2; s += this._majorLineFrequency) {
          const a = n + s * this.cellWidth;
          e.beginPath(), e.moveTo(a, this._currentMeasure.top), e.lineTo(a, this._currentMeasure.top + this._currentMeasure.height), e.stroke();
        }
        for (let s = -r / 2 + this._majorLineFrequency; s < r / 2; s += this._majorLineFrequency) {
          const a = i + s * this.cellHeight;
          e.moveTo(this._currentMeasure.left, a), e.lineTo(this._currentMeasure.left + this._currentMeasure.width, a), e.closePath(), e.stroke();
        }
      }
    }
    e.restore();
  }
  _getTypeName() {
    return "DisplayGrid";
  }
}
C([
  M()
], Hg.prototype, "displayMinorLines", null);
C([
  M()
], Hg.prototype, "displayMajorLines", null);
C([
  M()
], Hg.prototype, "background", null);
C([
  M()
], Hg.prototype, "cellWidth", null);
C([
  M()
], Hg.prototype, "cellHeight", null);
C([
  M()
], Hg.prototype, "minorLineTickness", null);
C([
  M()
], Hg.prototype, "minorLineColor", null);
C([
  M()
], Hg.prototype, "majorLineTickness", null);
C([
  M()
], Hg.prototype, "majorLineColor", null);
C([
  M()
], Hg.prototype, "majorLineFrequency", null);
Ue("BABYLON.GUI.DisplayGrid", Hg);
class p9e extends wp {
  get displayThumb() {
    return this._displayThumb && this.thumbImage != null;
  }
  set displayThumb(e) {
    this._displayThumb !== e && (this._displayThumb = e, this._markAsDirty());
  }
  /**
   * Gets or sets the image used to render the background
   */
  get backgroundImage() {
    return this._backgroundImage;
  }
  set backgroundImage(e) {
    this._backgroundImage !== e && (this._backgroundImage = e, e && !e.isLoaded && e.onImageLoadedObservable.addOnce(() => this._markAsDirty()), this._markAsDirty());
  }
  /**
   * Gets or sets the image used to render the value bar
   */
  get valueBarImage() {
    return this._valueBarImage;
  }
  set valueBarImage(e) {
    this._valueBarImage !== e && (this._valueBarImage = e, e && !e.isLoaded && e.onImageLoadedObservable.addOnce(() => this._markAsDirty()), this._markAsDirty());
  }
  /**
   * Gets or sets the image used to render the thumb
   */
  get thumbImage() {
    return this._thumbImage;
  }
  set thumbImage(e) {
    this._thumbImage !== e && (this._thumbImage = e, e && !e.isLoaded && e.onImageLoadedObservable.addOnce(() => this._markAsDirty()), this._markAsDirty());
  }
  /**
   * Creates a new ImageBasedSlider
   * @param name defines the control name
   */
  constructor(e) {
    super(e), this.name = e, this._tempMeasure = new b6(0, 0, 0, 0);
  }
  _getTypeName() {
    return "ImageBasedSlider";
  }
  _draw(e) {
    e.save(), this._applyStates(e), this._prepareRenderingData("rectangle");
    const t = this._getThumbPosition(), r = this._renderLeft, n = this._renderTop, i = this._renderWidth, s = this._renderHeight;
    this._backgroundImage && (this._tempMeasure.copyFromFloats(r, n, i, s), this.isThumbClamped && this.displayThumb && (this.isVertical ? this._tempMeasure.height += this._effectiveThumbThickness : this._tempMeasure.width += this._effectiveThumbThickness), this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure), this._backgroundImage._draw(e)), this._valueBarImage && (this.isVertical ? this.isThumbClamped && this.displayThumb ? this._tempMeasure.copyFromFloats(r, n + t, i, s - t + this._effectiveThumbThickness) : this._tempMeasure.copyFromFloats(r, n + t, i, s - t) : this.isThumbClamped && this.displayThumb ? this._tempMeasure.copyFromFloats(r, n, t + this._effectiveThumbThickness / 2, s) : this._tempMeasure.copyFromFloats(r, n, t, s), this._valueBarImage._currentMeasure.copyFrom(this._tempMeasure), this._valueBarImage._draw(e)), this.displayThumb && (this.isVertical ? this._tempMeasure.copyFromFloats(r - this._effectiveBarOffset, this._currentMeasure.top + t, this._currentMeasure.width, this._effectiveThumbThickness) : this._tempMeasure.copyFromFloats(this._currentMeasure.left + t, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height), this._thumbImage._currentMeasure.copyFrom(this._tempMeasure), this._thumbImage._draw(e)), e.restore();
  }
  /**
   * Serializes the current control
   * @param serializationObject defined the JSON serialized object
   */
  serialize(e) {
    super.serialize(e);
    const t = {}, r = {}, n = {};
    this.backgroundImage.serialize(t), this.thumbImage.serialize(r), this.valueBarImage.serialize(n), e.backgroundImage = t, e.thumbImage = r, e.valueBarImage = n;
  }
  /**
   * @internal
   */
  _parseFromContent(e, t) {
    super._parseFromContent(e, t), this.backgroundImage = ua.Parse(e.backgroundImage, t), this.thumbImage = ua.Parse(e.thumbImage, t), this.valueBarImage = ua.Parse(e.valueBarImage, t);
  }
}
C([
  M()
], p9e.prototype, "displayThumb", null);
Ue("BABYLON.GUI.ImageBasedSlider", p9e);
St.AddHeader = function(A, e, t, r) {
  const n = new ug("panel"), i = r ? r.isHorizontal : !0, s = r ? r.controlFirst : !0;
  n.isVertical = !i;
  const a = new oo("header");
  return a.text = e, a.textHorizontalAlignment = St.HORIZONTAL_ALIGNMENT_LEFT, i ? a.width = t : a.height = t, s ? (n.addControl(A), n.addControl(a), a.paddingLeft = "5px") : (n.addControl(a), n.addControl(A), a.paddingRight = "5px"), a.shadowBlur = A.shadowBlur, a.shadowColor = A.shadowColor, a.shadowOffsetX = A.shadowOffsetX, a.shadowOffsetY = A.shadowOffsetY, n;
};
class h9e {
  constructor() {
    this._colorStops = [], this._gradientDirty = !0;
  }
  _addColorStopsToCanvasGradient() {
    for (const e of this._colorStops)
      this._canvasGradient.addColorStop(e.offset, e.color);
  }
  /**
   * If there are any changes or the context changed, regenerate the canvas gradient object. Else,
   * reuse the existing gradient.
   **/
  getCanvasGradient(e) {
    return (this._gradientDirty || this._context !== e) && (this._context = e, this._canvasGradient = this._createCanvasGradient(e), this._addColorStopsToCanvasGradient(), this._gradientDirty = !1), this._canvasGradient;
  }
  /**
   * Adds a new color stop to the gradient.
   * @param offset the offset of the stop on the gradient. Should be between 0 and 1
   * @param color the color of the stop
   */
  addColorStop(e, t) {
    this._colorStops.push({ offset: e, color: t }), this._gradientDirty = !0;
  }
  /**
   * Removes an existing color stop with the specified offset from the gradient
   * @param offset the offset of the stop to be removed
   */
  removeColorStop(e) {
    this._colorStops = this._colorStops.filter((t) => t.offset !== e), this._gradientDirty = !0;
  }
  /**
   * Removes all color stops from the gradient
   */
  clearColorStops() {
    this._colorStops = [], this._gradientDirty = !0;
  }
  /** Color stops of the gradient */
  get colorStops() {
    return this._colorStops;
  }
  /** Type of the gradient */
  getClassName() {
    return "BaseGradient";
  }
  /** Serialize into a json object */
  serialize(e) {
    e.colorStops = this._colorStops, e.className = this.getClassName();
  }
  /** Parse from json object */
  parse(e) {
    this._colorStops = e.colorStops;
  }
}
class Bwe extends h9e {
  /**
   * Creates a new linear gradient
   * @param x0
   * @param y0
   * @param x1
   * @param y1
   */
  constructor(e, t, r, n) {
    super(), this._x0 = e ?? 0, this._y0 = t ?? 0, this._x1 = r ?? 0, this._y1 = n ?? 0;
  }
  _createCanvasGradient(e) {
    return e.createLinearGradient(this._x0, this._y0, this._x1, this._y1);
  }
  /** X axis coordinate of the starting point in the line */
  get x0() {
    return this._x0;
  }
  /** X axis coordinate of the ending point in the line */
  get x1() {
    return this._x1;
  }
  /** Y axis coordinate of the starting point in the line */
  get y0() {
    return this._y0;
  }
  /** Y axis coordinate of the ending point in the line */
  get y1() {
    return this._y1;
  }
  /**
   * Class name of the gradient
   * @returns the class name of the gradient
   */
  getClassName() {
    return "LinearGradient";
  }
  /**
   * Serializes this gradient
   * @param serializationObject the object to serialize to
   */
  serialize(e) {
    super.serialize(e), e.x0 = this._x0, e.y0 = this._y0, e.x1 = this._x1, e.y1 = this._y1;
  }
  /**
   * Parses a gradient from a serialization object
   * @param serializationObject the object to parse from
   */
  parse(e) {
    super.parse(e), this._x0 = e.x0, this._y0 = e.y0, this._x1 = e.x1, this._y1 = e.y1;
  }
}
Ue("BABYLON.GUI.LinearGradient", Bwe);
class Wwe extends h9e {
  /**
   * Creates a new radial gradient
   * @param x0 x coordinate of the first circle's center
   * @param y0 y coordinate of the first circle's center
   * @param r0 radius of the first circle
   * @param x1 x coordinate of the second circle's center
   * @param y1 y coordinate of the second circle's center
   * @param r1 radius of the second circle
   */
  constructor(e, t, r, n, i, s) {
    super(), this._x0 = e ?? 0, this._y0 = t ?? 0, this._r0 = r ?? 0, this._x1 = n ?? 0, this._y1 = i ?? 0, this._r1 = s ?? 0;
  }
  _createCanvasGradient(e) {
    return e.createRadialGradient(this._x0, this._y0, this._r0, this._x1, this._y1, this._r1);
  }
  /** x coordinate of the first circle's center */
  get x0() {
    return this._x0;
  }
  /** x coordinate of the second circle's center */
  get x1() {
    return this._x1;
  }
  /** y coordinate of the first circle's center */
  get y0() {
    return this._y0;
  }
  /** y coordinate of the second circle's center */
  get y1() {
    return this._y1;
  }
  /** radius of the first circle */
  get r0() {
    return this._r0;
  }
  /** radius of the second circle */
  get r1() {
    return this._r1;
  }
  /**
   * Class name of the gradient
   * @returns the class name of the gradient
   */
  getClassName() {
    return "RadialGradient";
  }
  /**
   * Serializes this gradient
   * @param serializationObject the object to serialize to
   */
  serialize(e) {
    super.serialize(e), e.x0 = this._x0, e.y0 = this._y0, e.r0 = this._r0, e.x1 = this._x1, e.y1 = this._y1, e.r1 = this._r1;
  }
  /**
   * Parses a gradient from a serialization object
   * @param serializationObject the object to parse from
   */
  parse(e) {
    super.parse(e), this._x0 = e.x0, this._y0 = e.y0, this._r0 = e.r0, this._x1 = e.x1, this._y1 = e.y1, this._r1 = e.r1;
  }
}
Ue("BABYLON.GUI.RadialGradient", Wwe);
class Swe {
  /**
   * Creates a new style object
   * @param host defines the AdvancedDynamicTexture which hosts this style
   */
  constructor(e) {
    this._fontFamily = "Arial", this._fontStyle = "", this._fontWeight = "", this._fontSize = new Ai(18, Ai.UNITMODE_PIXEL, !1), this.onChangedObservable = new Oe(), this._host = e;
  }
  /**
   * Gets or sets the font size
   */
  get fontSize() {
    return this._fontSize.toString(this._host);
  }
  set fontSize(e) {
    this._fontSize.toString(this._host) !== e && this._fontSize.fromString(e) && this.onChangedObservable.notifyObservers(this);
  }
  /**
   * Gets or sets the font family
   */
  get fontFamily() {
    return this._fontFamily;
  }
  set fontFamily(e) {
    this._fontFamily !== e && (this._fontFamily = e, this.onChangedObservable.notifyObservers(this));
  }
  /**
   * Gets or sets the font style
   */
  get fontStyle() {
    return this._fontStyle;
  }
  set fontStyle(e) {
    this._fontStyle !== e && (this._fontStyle = e, this.onChangedObservable.notifyObservers(this));
  }
  /** Gets or sets font weight */
  get fontWeight() {
    return this._fontWeight;
  }
  set fontWeight(e) {
    this._fontWeight !== e && (this._fontWeight = e, this.onChangedObservable.notifyObservers(this));
  }
  /** Dispose all associated resources */
  dispose() {
    this.onChangedObservable.clear();
  }
}
class g6 extends Xp {
  /** Gets the number of layout calls made the last time the ADT has been rendered */
  get numLayoutCalls() {
    return this._numLayoutCalls;
  }
  /** Gets the number of render calls made the last time the ADT has been rendered */
  get numRenderCalls() {
    return this._numRenderCalls;
  }
  /**
   * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
   * Useful when you want more antialiasing
   */
  get renderScale() {
    return this._renderScale;
  }
  set renderScale(e) {
    e !== this._renderScale && (this._renderScale = e, this._onResize());
  }
  /** Gets or sets the background color */
  get background() {
    return this._background;
  }
  set background(e) {
    this._background !== e && (this._background = e, this.markAsDirty());
  }
  /**
   * Gets or sets the ideal width used to design controls.
   * The GUI will then rescale everything accordingly
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling
   */
  get idealWidth() {
    return this._idealWidth;
  }
  set idealWidth(e) {
    this._idealWidth !== e && (this._idealWidth = e, this.markAsDirty(), this._rootContainer._markAllAsDirty());
  }
  /**
   * Gets or sets the ideal height used to design controls.
   * The GUI will then rescale everything accordingly
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling
   */
  get idealHeight() {
    return this._idealHeight;
  }
  set idealHeight(e) {
    this._idealHeight !== e && (this._idealHeight = e, this.markAsDirty(), this._rootContainer._markAllAsDirty());
  }
  /**
   * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling
   */
  get useSmallestIdeal() {
    return this._useSmallestIdeal;
  }
  set useSmallestIdeal(e) {
    this._useSmallestIdeal !== e && (this._useSmallestIdeal = e, this.markAsDirty(), this._rootContainer._markAllAsDirty());
  }
  /**
   * Gets or sets a boolean indicating if adaptive scaling must be used
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling
   */
  get renderAtIdealSize() {
    return this._renderAtIdealSize;
  }
  set renderAtIdealSize(e) {
    this._renderAtIdealSize !== e && (this._renderAtIdealSize = e, this._onResize());
  }
  /**
   * Gets the ratio used when in "ideal mode"
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling
   * */
  get idealRatio() {
    let e = 0, t = 0;
    return this._idealWidth && (e = this.getSize().width / this._idealWidth), this._idealHeight && (t = this.getSize().height / this._idealHeight), this._useSmallestIdeal && this._idealWidth && this._idealHeight ? window.innerWidth < window.innerHeight ? e : t : this._idealWidth ? e : this._idealHeight ? t : 1;
  }
  /**
   * Gets the underlying layer used to render the texture when in fullscreen mode
   */
  get layer() {
    return this._layerToDispose;
  }
  /**
   * Gets the root container control
   */
  get rootContainer() {
    return this._rootContainer;
  }
  /**
   * Returns an array containing the root container.
   * This is mostly used to let the Inspector introspects the ADT
   * @returns an array containing the rootContainer
   */
  getChildren() {
    return [this._rootContainer];
  }
  /**
   * Will return all controls that are inside this texture
   * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
   * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
   * @returns all child controls
   */
  getDescendants(e, t) {
    return this._rootContainer.getDescendants(e, t);
  }
  /**
   * Will return all controls with the given type name
   * @param typeName defines the type name to search for
   * @returns an array of all controls found
   */
  getControlsByType(e) {
    return this._rootContainer.getDescendants(!1, (t) => t.typeName === e);
  }
  /**
   * Will return the first control with the given name
   * @param name defines the name to search for
   * @returns the first control found or null
   */
  getControlByName(e) {
    return this._getControlByKey("name", e);
  }
  _getControlByKey(e, t) {
    return this._rootContainer.getDescendants().find((r) => r[e] === t) || null;
  }
  /**
   * Gets or sets the current focused control
   */
  get focusedControl() {
    return this._focusedControl;
  }
  set focusedControl(e) {
    this._focusedControl != e && (this._focusedControl && this._focusedControl.onBlur(), e && e.onFocus(), this._focusedControl = e);
  }
  /**
   * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
   */
  get isForeground() {
    return this.layer ? !this.layer.isBackground : !0;
  }
  set isForeground(e) {
    this.layer && this.layer.isBackground !== !e && (this.layer.isBackground = !e);
  }
  /**
   * Gets or set information about clipboardData
   */
  get clipboardData() {
    return this._clipboardData;
  }
  set clipboardData(e) {
    this._clipboardData = e;
  }
  /**
   * Creates a new AdvancedDynamicTexture
   * @param name defines the name of the texture
   * @param width defines the width of the texture
   * @param height defines the height of the texture
   * @param scene defines the hosting scene
   * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
   * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
   * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
   */
  constructor(e, t = 0, r = 0, n, i = !1, s = We.NEAREST_SAMPLINGMODE, a = !0) {
    super(e, { width: t, height: r }, n, i, s, et.TEXTUREFORMAT_RGBA, a), this.onGuiReadyObservable = new Oe(), this._isDirty = !1, this._rootContainer = new Ev("root"), this._lastControlOver = {}, this._lastControlDown = {}, this._capturingControl = {}, this._linkedControls = new Array(), this._isFullscreen = !1, this._fullscreenViewport = new WA(0, 0, 1, 1), this._idealWidth = 0, this._idealHeight = 0, this._useSmallestIdeal = !1, this._renderAtIdealSize = !1, this._blockNextFocusCheck = !1, this._renderScale = 1, this._cursorChanged = !1, this._defaultMousePointerId = 0, this._rootChildrenHaveChanged = !1, this._capturedPointerIds = /* @__PURE__ */ new Set(), this._numLayoutCalls = 0, this._numRenderCalls = 0, this._clipboardData = "", this.onClipboardObservable = new Oe(), this.onControlPickedObservable = new Oe(), this.onBeginLayoutObservable = new Oe(), this.onEndLayoutObservable = new Oe(), this.onBeginRenderObservable = new Oe(), this.onEndRenderObservable = new Oe(), this.premulAlpha = !1, this.applyYInversionOnUpdate = !0, this.skipBlockEvents = 0, this.checkPointerEveryFrame = !1, this._useInvalidateRectOptimization = !0, this._invalidatedRectangle = null, this._clearMeasure = new b6(0, 0, 0, 0), this._onClipboardCopy = (f) => {
      const o = f, d = new wC(qp.COPY, o);
      this.onClipboardObservable.notifyObservers(d), o.preventDefault();
    }, this._onClipboardCut = (f) => {
      const o = f, d = new wC(qp.CUT, o);
      this.onClipboardObservable.notifyObservers(d), o.preventDefault();
    }, this._onClipboardPaste = (f) => {
      const o = f, d = new wC(qp.PASTE, o);
      this.onClipboardObservable.notifyObservers(d), o.preventDefault();
    }, this.parseContent = this.parseSerializedObject, n = this.getScene(), !(!n || !this._texture) && (this.applyYInversionOnUpdate = a, this._rootElement = n.getEngine().getInputElement(), this._renderObserver = n.onBeforeCameraRenderObservable.add((f) => this._checkUpdate(f)), this._controlAddedObserver = this._rootContainer.onControlAddedObservable.add((f) => {
      f && (this._rootChildrenHaveChanged = !0);
    }), this._controlRemovedObserver = this._rootContainer.onControlRemovedObservable.add((f) => {
      f && (this._rootChildrenHaveChanged = !0);
    }), this._preKeyboardObserver = n.onPreKeyboardObservable.add((f) => {
      this._focusedControl && (f.type === t4.KEYDOWN && this._focusedControl.processKeyboard(f.event), f.skipOnPointerObservable = !0);
    }), this._rootContainer._link(this), this.hasAlpha = !0, (!t || !r) && (this._resizeObserver = n.getEngine().onResizeObservable.add(() => this._onResize()), this._onResize()), this._texture.isReady = !0);
  }
  /**
   * Get the current class name of the texture useful for serialization or dynamic coding.
   * @returns "AdvancedDynamicTexture"
   */
  getClassName() {
    return "AdvancedDynamicTexture";
  }
  /**
   * Function used to execute a function on all controls
   * @param func defines the function to execute
   * @param container defines the container where controls belong. If null the root container will be used
   */
  executeOnAllControls(e, t) {
    t || (t = this._rootContainer), e(t);
    for (const r of t.children) {
      if (r.children) {
        this.executeOnAllControls(e, r);
        continue;
      }
      e(r);
    }
  }
  /**
   * Gets or sets a boolean indicating if the InvalidateRect optimization should be turned on
   */
  get useInvalidateRectOptimization() {
    return this._useInvalidateRectOptimization;
  }
  set useInvalidateRectOptimization(e) {
    this._useInvalidateRectOptimization = e;
  }
  /**
   * Invalidates a rectangle area on the gui texture
   * @param invalidMinX left most position of the rectangle to invalidate in the texture
   * @param invalidMinY top most position of the rectangle to invalidate in the texture
   * @param invalidMaxX right most position of the rectangle to invalidate in the texture
   * @param invalidMaxY bottom most position of the rectangle to invalidate in the texture
   */
  invalidateRect(e, t, r, n) {
    if (this._useInvalidateRectOptimization)
      if (!this._invalidatedRectangle)
        this._invalidatedRectangle = new b6(e, t, r - e + 1, n - t + 1);
      else {
        const i = Math.ceil(Math.max(this._invalidatedRectangle.left + this._invalidatedRectangle.width - 1, r)), s = Math.ceil(Math.max(this._invalidatedRectangle.top + this._invalidatedRectangle.height - 1, n));
        this._invalidatedRectangle.left = Math.floor(Math.min(this._invalidatedRectangle.left, e)), this._invalidatedRectangle.top = Math.floor(Math.min(this._invalidatedRectangle.top, t)), this._invalidatedRectangle.width = i - this._invalidatedRectangle.left + 1, this._invalidatedRectangle.height = s - this._invalidatedRectangle.top + 1;
      }
  }
  /**
   * Marks the texture as dirty forcing a complete update
   */
  markAsDirty() {
    this._isDirty = !0;
  }
  /**
   * Helper function used to create a new style
   * @returns a new style
   * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#styles
   */
  createStyle() {
    return new Swe(this);
  }
  /**
   * Adds a new control to the root container
   * @param control defines the control to add
   * @returns the current texture
   */
  addControl(e) {
    return this._rootContainer.addControl(e), this;
  }
  /**
   * Removes a control from the root container
   * @param control defines the control to remove
   * @returns the current texture
   */
  removeControl(e) {
    return this._rootContainer.removeControl(e), this;
  }
  /**
   * Moves overlapped controls towards a position where it is not overlapping anymore.
   * Please note that this method alters linkOffsetXInPixels and linkOffsetYInPixels.
   * @param overlapGroup the overlap group which will be processed or undefined to process all overlap groups
   * @param deltaStep the step size (speed) to reach the target non overlapping position (default 0.1)
   * @param repelFactor how much is the control repelled by other controls
   */
  moveToNonOverlappedPosition(e, t = 1, r = 1) {
    let n;
    if (Array.isArray(e))
      n = e;
    else {
      const i = this.getDescendants(!0);
      n = e === void 0 ? i.filter((s) => s.overlapGroup !== void 0) : i.filter((s) => s.overlapGroup === e);
    }
    n.forEach((i) => {
      var s;
      let a = at.Zero();
      const f = new at(i.centerX, i.centerY);
      n.forEach((o) => {
        if (i !== o && g6._Overlaps(i, o)) {
          const d = f.subtract(new at(o.centerX, o.centerY)), v = d.length();
          v > 0 && (a = a.add(d.normalize().scale(r / v)));
        }
      }), a.length() > 0 && (a = a.normalize().scale(t * ((s = i.overlapDeltaMultiplier) !== null && s !== void 0 ? s : 1)), i.linkOffsetXInPixels += a.x, i.linkOffsetYInPixels += a.y);
    });
  }
  /**
   * Release all resources
   */
  dispose() {
    const e = this.getScene();
    e && (this._rootElement = null, e.onBeforeCameraRenderObservable.remove(this._renderObserver), this._resizeObserver && e.getEngine().onResizeObservable.remove(this._resizeObserver), this._prePointerObserver && e.onPrePointerObservable.remove(this._prePointerObserver), this._sceneRenderObserver && e.onBeforeRenderObservable.remove(this._sceneRenderObserver), this._pointerObserver && e.onPointerObservable.remove(this._pointerObserver), this._preKeyboardObserver && e.onPreKeyboardObservable.remove(this._preKeyboardObserver), this._canvasPointerOutObserver && e.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver), this._canvasBlurObserver && e.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver), this._controlAddedObserver && this._rootContainer.onControlAddedObservable.remove(this._controlAddedObserver), this._controlRemovedObserver && this._rootContainer.onControlRemovedObservable.remove(this._controlRemovedObserver), this._layerToDispose && (this._layerToDispose.texture = null, this._layerToDispose.dispose(), this._layerToDispose = null), this._rootContainer.dispose(), this.onClipboardObservable.clear(), this.onControlPickedObservable.clear(), this.onBeginRenderObservable.clear(), this.onEndRenderObservable.clear(), this.onBeginLayoutObservable.clear(), this.onEndLayoutObservable.clear(), this.onGuiReadyObservable.clear(), super.dispose());
  }
  _onResize() {
    const e = this.getScene();
    if (!e)
      return;
    const t = e.getEngine(), r = this.getSize();
    let n = t.getRenderWidth() * this._renderScale, i = t.getRenderHeight() * this._renderScale;
    this._renderAtIdealSize && (this._idealWidth ? (i = i * this._idealWidth / n, n = this._idealWidth) : this._idealHeight && (n = n * this._idealHeight / i, i = this._idealHeight)), (r.width !== n || r.height !== i) && (this.scaleTo(n, i), this.markAsDirty(), (this._idealWidth || this._idealHeight) && this._rootContainer._markAllAsDirty()), this.invalidateRect(0, 0, r.width - 1, r.height - 1);
  }
  /** @internal */
  _getGlobalViewport() {
    const e = this.getSize(), t = this._fullscreenViewport.toGlobal(e.width, e.height), r = Math.round(t.width * (1 / this.rootContainer.scaleX)), n = Math.round(t.height * (1 / this.rootContainer.scaleY));
    return t.x += (t.width - r) / 2, t.y += (t.height - n) / 2, t.width = r, t.height = n, t;
  }
  /**
   * Get screen coordinates for a vector3
   * @param position defines the position to project
   * @param worldMatrix defines the world matrix to use
   * @returns the projected position
   */
  getProjectedPosition(e, t) {
    const r = this.getProjectedPositionWithZ(e, t);
    return new at(r.x, r.y);
  }
  /**
   * Get screen coordinates for a vector3
   * @param position defines the position to project
   * @param worldMatrix defines the world matrix to use
   * @returns the projected position with Z
   */
  getProjectedPositionWithZ(e, t) {
    const r = this.getScene();
    if (!r)
      return S.Zero();
    const n = this._getGlobalViewport(), i = S.Project(e, t, r.getTransformMatrix(), n);
    return new S(i.x, i.y, i.z);
  }
  _checkUpdate(e, t) {
    if (!(this._layerToDispose && !(e.layerMask & this._layerToDispose.layerMask))) {
      if (this._isFullscreen && this._linkedControls.length) {
        const r = this.getScene();
        if (!r)
          return;
        const n = this._getGlobalViewport();
        for (const i of this._linkedControls) {
          if (!i.isVisible)
            continue;
          const s = i._linkedMesh;
          if (!s || s.isDisposed()) {
            ye.SetImmediate(() => {
              i.linkWithMesh(null);
            });
            continue;
          }
          const a = s.getBoundingInfo ? s.getBoundingInfo().boundingSphere.center : S.ZeroReadOnly, f = S.Project(a, s.getWorldMatrix(), r.getTransformMatrix(), n);
          if (f.z < 0 || f.z > 1) {
            i.notRenderable = !0;
            continue;
          }
          i.notRenderable = !1, this.useInvalidateRectOptimization && i.invalidateRect(), i._moveToProjectedPosition(f);
        }
      }
      !this._isDirty && !this._rootContainer.isDirty || (this._isDirty = !1, this._render(t), t || this.update(this.applyYInversionOnUpdate, this.premulAlpha, g6.AllowGPUOptimizations));
    }
  }
  _render(e) {
    var t;
    const r = this.getSize(), n = r.width, i = r.height, s = this.getContext();
    if (s.font = "18px Arial", s.strokeStyle = "white", this.onGuiReadyObservable.hasObservers() && this._checkGuiIsReady(), this._rootChildrenHaveChanged) {
      const f = (t = this.getScene()) === null || t === void 0 ? void 0 : t.activeCamera;
      f && (this._rootChildrenHaveChanged = !1, this._checkUpdate(f, !0));
    }
    this.onBeginLayoutObservable.notifyObservers(this);
    const a = new b6(0, 0, n, i);
    this._numLayoutCalls = 0, this._rootContainer._layout(a, s), this.onEndLayoutObservable.notifyObservers(this), this._isDirty = !1, !e && (this._invalidatedRectangle ? this._clearMeasure.copyFrom(this._invalidatedRectangle) : this._clearMeasure.copyFromFloats(0, 0, n, i), s.clearRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height), this._background && (s.save(), s.fillStyle = this._background, s.fillRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height), s.restore()), this.onBeginRenderObservable.notifyObservers(this), this._numRenderCalls = 0, this._rootContainer._render(s, this._invalidatedRectangle), this.onEndRenderObservable.notifyObservers(this), this._invalidatedRectangle = null);
  }
  /**
   * @internal
   */
  _changeCursor(e) {
    this._rootElement && (this._rootElement.style.cursor = e, this._cursorChanged = !0);
  }
  /**
   * @internal
   */
  _registerLastControlDown(e, t) {
    this._lastControlDown[t] = e, this.onControlPickedObservable.notifyObservers(e);
  }
  _doPicking(e, t, r, n, i, s, a, f) {
    const o = this.getScene();
    if (!o)
      return;
    const d = o.getEngine(), v = this.getSize();
    if (this._isFullscreen) {
      const u = o.cameraToUseForPointers || o.activeCamera;
      if (!u)
        return;
      const l = u.viewport;
      e = e * (v.width / (d.getRenderWidth() * l.width)), t = t * (v.height / (d.getRenderHeight() * l.height));
    }
    if (this._capturingControl[i]) {
      this._capturingControl[i].isPointerBlocker && (this._shouldBlockPointer = !0), this._capturingControl[i]._processObservables(n, e, t, r, i, s);
      return;
    }
    this._cursorChanged = !1, this._rootContainer._processPicking(e, t, r, n, i, s, a, f) || (o.doNotHandleCursors || this._changeCursor(""), n === ir.POINTERMOVE && this._lastControlOver[i] && (this._lastControlOver[i]._onPointerOut(this._lastControlOver[i], r), delete this._lastControlOver[i])), !this._cursorChanged && !o.doNotHandleCursors && this._changeCursor(""), this._manageFocus();
  }
  /**
   * @internal
   */
  _cleanControlAfterRemovalFromList(e, t) {
    for (const r in e) {
      if (!Object.prototype.hasOwnProperty.call(e, r))
        continue;
      e[r] === t && delete e[r];
    }
  }
  /**
   * @internal
   */
  _cleanControlAfterRemoval(e) {
    this._cleanControlAfterRemovalFromList(this._lastControlDown, e), this._cleanControlAfterRemovalFromList(this._lastControlOver, e);
  }
  /**
   * This function will run a pointer event on this ADT and will trigger any pointer events on any controls
   * This will work on a fullscreen ADT only. For mesh based ADT, simulate pointer events using the scene directly.
   * @param x pointer X on the canvas for the picking
   * @param y pointer Y on the canvas for the picking
   * @param pi optional pointer information
   */
  pick(e, t, r = null) {
    this._isFullscreen && this._scene && this._translateToPicking(this._scene, new WA(0, 0, 0, 0), r, e, t);
  }
  _translateToPicking(e, t, r, n = e.pointerX, i = e.pointerY) {
    const s = e.cameraToUseForPointers || e.activeCamera, a = e.getEngine(), f = e.cameraToUseForPointers;
    if (!s)
      t.x = 0, t.y = 0, t.width = a.getRenderWidth(), t.height = a.getRenderHeight();
    else if (s.rigCameras.length) {
      const v = new WA(0, 0, 1, 1);
      s.rigCameras.forEach((u) => {
        u.viewport.toGlobalToRef(a.getRenderWidth(), a.getRenderHeight(), v);
        const l = n / a.getHardwareScalingLevel() - v.x, P = i / a.getHardwareScalingLevel() - (a.getRenderHeight() - v.y - v.height);
        l < 0 || P < 0 || n > v.width || i > v.height || (e.cameraToUseForPointers = u, t.x = v.x, t.y = v.y, t.width = v.width, t.height = v.height);
      });
    } else
      s.viewport.toGlobalToRef(a.getRenderWidth(), a.getRenderHeight(), t);
    const o = n / a.getHardwareScalingLevel() - t.x, d = i / a.getHardwareScalingLevel() - (a.getRenderHeight() - t.y - t.height);
    if (this._shouldBlockPointer = !1, r) {
      const v = r.event.pointerId || this._defaultMousePointerId;
      this._doPicking(o, d, r, r.type, v, r.event.button, r.event.deltaX, r.event.deltaY), (this._shouldBlockPointer && !(r.type & this.skipBlockEvents) || this._capturingControl[v]) && (r.skipOnPointerObservable = !0);
    } else
      this._doPicking(o, d, null, ir.POINTERMOVE, this._defaultMousePointerId, 0);
    e.cameraToUseForPointers = f;
  }
  /** Attach to all scene events required to support pointer events */
  attach() {
    const e = this.getScene();
    if (!e)
      return;
    const t = new WA(0, 0, 0, 0);
    this._prePointerObserver = e.onPrePointerObservable.add((r) => {
      if (!(e.isPointerCaptured(r.event.pointerId) && r.type === ir.POINTERUP && !this._capturedPointerIds.has(r.event.pointerId)) && !(r.type !== ir.POINTERMOVE && r.type !== ir.POINTERUP && r.type !== ir.POINTERDOWN && r.type !== ir.POINTERWHEEL)) {
        if (r.type === ir.POINTERMOVE) {
          if (e.isPointerCaptured(r.event.pointerId))
            return;
          r.event.pointerId && (this._defaultMousePointerId = r.event.pointerId);
        }
        this._translateToPicking(e, t, r);
      }
    }), this._attachPickingToSceneRender(e, () => this._translateToPicking(e, t, null), !1), this._attachToOnPointerOut(e), this._attachToOnBlur(e);
  }
  /**
   * Register the clipboard Events onto the canvas
   */
  registerClipboardEvents() {
    self.addEventListener("copy", this._onClipboardCopy, !1), self.addEventListener("cut", this._onClipboardCut, !1), self.addEventListener("paste", this._onClipboardPaste, !1);
  }
  /**
   * Unregister the clipboard Events from the canvas
   */
  unRegisterClipboardEvents() {
    self.removeEventListener("copy", this._onClipboardCopy), self.removeEventListener("cut", this._onClipboardCut), self.removeEventListener("paste", this._onClipboardPaste);
  }
  /**
   * Transform uvs from mesh space to texture space, taking the texture into account
   * @param uv the uvs in mesh space
   * @returns the uvs in texture space
   */
  _transformUvs(e) {
    const t = this.getTextureMatrix();
    let r;
    if (t.isIdentityAs3x2())
      r = e;
    else {
      const n = ue.Matrix[0];
      t.getRowToRef(0, ue.Vector4[0]), t.getRowToRef(1, ue.Vector4[1]), t.getRowToRef(2, ue.Vector4[2]);
      const i = ue.Vector4[0], s = ue.Vector4[1], a = ue.Vector4[2];
      n.setRowFromFloats(0, i.x, i.y, 0, 0), n.setRowFromFloats(1, s.x, s.y, 0, 0), n.setRowFromFloats(2, 0, 0, 1, 0), n.setRowFromFloats(3, a.x, a.y, 0, 1), r = ue.Vector2[0], at.TransformToRef(e, n, r);
    }
    if ((this.wrapU === We.WRAP_ADDRESSMODE || this.wrapU === We.MIRROR_ADDRESSMODE) && r.x > 1) {
      let n = r.x - Math.trunc(r.x);
      this.wrapU === We.MIRROR_ADDRESSMODE && Math.trunc(r.x) % 2 === 1 && (n = 1 - n), r.x = n;
    }
    if ((this.wrapV === We.WRAP_ADDRESSMODE || this.wrapV === We.MIRROR_ADDRESSMODE) && r.y > 1) {
      let n = r.y - Math.trunc(r.y);
      this.wrapV === We.MIRROR_ADDRESSMODE && Math.trunc(r.x) % 2 === 1 && (n = 1 - n), r.y = n;
    }
    return r;
  }
  /**
   * Connect the texture to a hosting mesh to enable interactions
   * @param mesh defines the mesh to attach to
   * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
   */
  attachToMesh(e, t = !0) {
    const r = this.getScene();
    r && (this._pointerObserver && r.onPointerObservable.remove(this._pointerObserver), this._pointerObserver = r.onPointerObservable.add((n) => {
      if (n.type !== ir.POINTERMOVE && n.type !== ir.POINTERUP && n.type !== ir.POINTERDOWN && n.type !== ir.POINTERWHEEL)
        return;
      n.type === ir.POINTERMOVE && n.event.pointerId && (this._defaultMousePointerId = n.event.pointerId);
      const i = n.event.pointerId || this._defaultMousePointerId;
      if (n.pickInfo && n.pickInfo.hit && n.pickInfo.pickedMesh === e) {
        let s = n.pickInfo.getTextureCoordinates();
        if (s) {
          s = this._transformUvs(s);
          const a = this.getSize();
          this._doPicking(s.x * a.width, (this.applyYInversionOnUpdate ? 1 - s.y : s.y) * a.height, n, n.type, i, n.event.button, n.event.deltaX, n.event.deltaY);
        }
      } else if (n.type === ir.POINTERUP) {
        if (this._lastControlDown[i] && this._lastControlDown[i]._forcePointerUp(i), delete this._lastControlDown[i], this.focusedControl) {
          const s = this.focusedControl.keepsFocusWith();
          let a = !0;
          if (s)
            for (const f of s) {
              if (this === f._host)
                continue;
              const o = f._host;
              if (o._lastControlOver[i] && o._lastControlOver[i].isAscendant(f)) {
                a = !1;
                break;
              }
            }
          a && (this.focusedControl = null);
        }
      } else
        n.type === ir.POINTERMOVE && (this._lastControlOver[i] && this._lastControlOver[i]._onPointerOut(this._lastControlOver[i], n, !0), delete this._lastControlOver[i]);
    }), e.enablePointerMoveEvents = t, this._attachPickingToSceneRender(r, () => {
      const n = this._defaultMousePointerId, i = r == null ? void 0 : r.pick(r.pointerX, r.pointerY);
      if (i && i.hit && i.pickedMesh === e) {
        let s = i.getTextureCoordinates();
        if (s) {
          s = this._transformUvs(s);
          const a = this.getSize();
          this._doPicking(s.x * a.width, (this.applyYInversionOnUpdate ? 1 - s.y : s.y) * a.height, null, ir.POINTERMOVE, n, 0);
        }
      } else
        this._lastControlOver[n] && this._lastControlOver[n]._onPointerOut(this._lastControlOver[n], null, !0), delete this._lastControlOver[n];
    }, !0), this._attachToOnPointerOut(r), this._attachToOnBlur(r));
  }
  /**
   * Move the focus to a specific control
   * @param control defines the control which will receive the focus
   */
  moveFocusToControl(e) {
    this.focusedControl = e, this._lastPickedControl = e, this._blockNextFocusCheck = !0;
  }
  _manageFocus() {
    if (this._blockNextFocusCheck) {
      this._blockNextFocusCheck = !1, this._lastPickedControl = this._focusedControl;
      return;
    }
    if (this._focusedControl && this._focusedControl !== this._lastPickedControl) {
      if (this._lastPickedControl.isFocusInvisible)
        return;
      this.focusedControl = null;
    }
  }
  _attachPickingToSceneRender(e, t, r) {
    this._sceneRenderObserver = e.onBeforeRenderObservable.add(() => {
      this.checkPointerEveryFrame && (this._linkedControls.length > 0 || r) && t();
    });
  }
  _attachToOnPointerOut(e) {
    this._canvasPointerOutObserver = e.getEngine().onCanvasPointerOutObservable.add((t) => {
      this._lastControlOver[t.pointerId] && this._lastControlOver[t.pointerId]._onPointerOut(this._lastControlOver[t.pointerId], null), delete this._lastControlOver[t.pointerId], this._lastControlDown[t.pointerId] && this._lastControlDown[t.pointerId] !== this._capturingControl[t.pointerId] && (this._lastControlDown[t.pointerId]._forcePointerUp(t.pointerId), delete this._lastControlDown[t.pointerId]);
    });
  }
  _attachToOnBlur(e) {
    this._canvasBlurObserver = e.getEngine().onCanvasBlurObservable.add(() => {
      Object.entries(this._lastControlDown).forEach(([, t]) => {
        t._onCanvasBlur();
      }), this.focusedControl = null, this._lastControlDown = {};
    });
  }
  /**
   * Serializes the entire GUI system
   * @returns an object with the JSON serialized data
   */
  serializeContent() {
    const e = this.getSize(), t = {
      root: {},
      width: e.width,
      height: e.height
    };
    return this._rootContainer.serialize(t.root), t;
  }
  /**
   * Recreate the content of the ADT from a JSON object
   * @param serializedObject define the JSON serialized object to restore from
   * @param scaleToSize defines whether to scale to texture to the saved size
   */
  parseSerializedObject(e, t) {
    if (this._rootContainer = St.Parse(e.root, this), t) {
      const r = e.width, n = e.height;
      typeof r == "number" && typeof n == "number" && r >= 0 && n >= 0 ? this.scaleTo(r, n) : this.scaleTo(1920, 1080);
    }
  }
  /**
   * Clones the ADT
   * @param newName defines the name of the new ADT
   * @returns the clone of the ADT
   */
  clone(e) {
    const t = this.getScene();
    if (!t)
      return this;
    const r = this.getSize(), n = this.serializeContent(), i = new g6(e ?? "Clone of " + this.name, r.width, r.height, t, !this.noMipmap, this.samplingMode);
    return i.parseSerializedObject(n), i;
  }
  /**
   * Recreate the content of the ADT from a snippet saved by the GUI editor
   * @param snippetId defines the snippet to load
   * @param scaleToSize defines whether to scale to texture to the saved size
   * @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.
   * @returns a promise that will resolve on success
   */
  static async ParseFromSnippetAsync(e, t, r) {
    const n = r ?? g6.CreateFullscreenUI("ADT from snippet");
    if (e === "_BLANK")
      return n;
    const i = await g6._LoadURLContentAsync(g6.SnippetUrl + "/" + e.replace(/#/g, "/"), !0);
    return n.parseSerializedObject(i, t), n;
  }
  /**
   * Recreate the content of the ADT from a snippet saved by the GUI editor
   * @param snippetId defines the snippet to load
   * @param scaleToSize defines whether to scale to texture to the saved size
   * @returns a promise that will resolve on success
   */
  parseFromSnippetAsync(e, t) {
    return g6.ParseFromSnippetAsync(e, t, this);
  }
  /**
   * Recreate the content of the ADT from a url json
   * @param url defines the url to load
   * @param scaleToSize defines whether to scale to texture to the saved size
   * @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.
   * @returns a promise that will resolve on success
   */
  static async ParseFromFileAsync(e, t, r) {
    const n = r ?? g6.CreateFullscreenUI("ADT from URL"), i = await g6._LoadURLContentAsync(e);
    return n.parseSerializedObject(i, t), n;
  }
  /**
   * Recreate the content of the ADT from a url json
   * @param url defines the url to load
   * @param scaleToSize defines whether to scale to texture to the saved size
   * @returns a promise that will resolve on success
   */
  parseFromURLAsync(e, t) {
    return g6.ParseFromFileAsync(e, t, this);
  }
  static _LoadURLContentAsync(e, t = !1) {
    return e === "" ? Promise.reject("No URL provided") : new Promise((r, n) => {
      const i = new ho();
      i.addEventListener("readystatechange", () => {
        if (i.readyState == 4)
          if (i.status == 200) {
            let s;
            if (t) {
              const f = JSON.parse(JSON.parse(i.responseText).jsonPayload);
              s = f.encodedGui ? new TextDecoder("utf-8").decode(TR(f.encodedGui)) : f.gui;
            } else
              s = i.responseText;
            const a = JSON.parse(s);
            r(a);
          } else
            n("Unable to load");
      }), i.open("GET", e), i.send();
    });
  }
  // Statics
  /**
   * Compares two rectangle based controls for pixel overlap
   * @param control1 The first control to compare
   * @param control2 The second control to compare
   * @returns true if overlaps, otherwise false
   */
  static _Overlaps(e, t) {
    return !(e.centerX > t.centerX + t.widthInPixels || e.centerX + e.widthInPixels < t.centerX || e.centerY + e.heightInPixels < t.centerY || e.centerY > t.centerY + t.heightInPixels);
  }
  /**
   * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
   * @param mesh defines the mesh which will receive the texture
   * @param width defines the texture width (1024 by default)
   * @param height defines the texture height (1024 by default)
   * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
   * @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)
   * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
   * @param materialSetupCallback defines a custom way of creating and setting up the material on the mesh
   * @returns a new AdvancedDynamicTexture
   */
  static CreateForMesh(e, t = 1024, r = 1024, n = !0, i = !1, s, a = this._CreateMaterial) {
    const f = v4(), o = new g6(`AdvancedDynamicTexture for ${e.name} [${f}]`, t, r, e.getScene(), !0, We.TRILINEAR_SAMPLINGMODE, s);
    return a(e, f, o, i), o.attachToMesh(e, n), o;
  }
  static _CreateMaterial(e, t, r, n) {
    const i = Jo("BABYLON.StandardMaterial");
    if (!i)
      throw "StandardMaterial needs to be imported before as it contains a side-effect required by your code.";
    const s = new i(`AdvancedDynamicTextureMaterial for ${e.name} [${t}]`, e.getScene());
    s.backFaceCulling = !1, s.diffuseColor = Ne.Black(), s.specularColor = Ne.Black(), n ? (s.diffuseTexture = r, s.emissiveTexture = r, r.hasAlpha = !0) : (s.emissiveTexture = r, s.opacityTexture = r), e.material = s;
  }
  /**
   * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) BUT do not create a new material for the mesh. You will be responsible for connecting the texture
   * @param mesh defines the mesh which will receive the texture
   * @param width defines the texture width (1024 by default)
   * @param height defines the texture height (1024 by default)
   * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
   * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
   * @returns a new AdvancedDynamicTexture
   */
  static CreateForMeshTexture(e, t = 1024, r = 1024, n = !0, i) {
    const s = new g6(e.name + " AdvancedDynamicTexture", t, r, e.getScene(), !0, We.TRILINEAR_SAMPLINGMODE, i);
    return s.attachToMesh(e, n), s;
  }
  /**
   * Creates a new AdvancedDynamicTexture in fullscreen mode.
   * In this mode the texture will rely on a layer for its rendering.
   * This allows it to be treated like any other layer.
   * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
   * LayerMask is set through advancedTexture.layer.layerMask
   * @param name defines name for the texture
   * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
   * @param scene defines the hosting scene
   * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
   * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)
   * @returns a new AdvancedDynamicTexture
   */
  static CreateFullscreenUI(e, t = !0, r = null, n = We.BILINEAR_SAMPLINGMODE, i = !1) {
    const s = new g6(e, 0, 0, r, !1, n), a = s.getScene(), f = new Yte(e + "_layer", null, a, !t);
    if (f.texture = s, s._layerToDispose = f, s._isFullscreen = !0, i && a) {
      const o = 1 / a.getEngine().getHardwareScalingLevel();
      s._rootContainer.scaleX = o, s._rootContainer.scaleY = o;
    }
    return s.attach(), s;
  }
  /**
   * Scales the texture
   * @param ratio the scale factor to apply to both width and height
   */
  scale(e) {
    super.scale(e), this.markAsDirty();
  }
  /**
   * Resizes the texture
   * @param width the new width
   * @param height the new height
   */
  scaleTo(e, t) {
    super.scaleTo(e, t), this.markAsDirty();
  }
  _checkGuiIsReady() {
    this.guiIsReady() && (this.onGuiReadyObservable.notifyObservers(this), this.onGuiReadyObservable.clear());
  }
  /**
   * Returns true if all the GUI components are ready to render
   */
  guiIsReady() {
    return this._rootContainer.isReady();
  }
}
g6.SnippetUrl = et.SnippetUrl;
g6.AllowGPUOptimizations = !0;
const Uwe = "fluentVertexShader", Iwe = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;uniform mat4 world;uniform mat4 viewProjection;varying vec2 vUV;
#ifdef BORDER
varying vec2 scaleInfo;uniform float borderWidth;uniform vec3 scaleFactor;
#endif
#ifdef HOVERLIGHT
varying vec3 worldPosition;
#endif
void main(void) {vUV=uv;
#ifdef BORDER
vec3 scale=scaleFactor;float minScale=min(min(scale.x,scale.y),scale.z);float maxScale=max(max(scale.x,scale.y),scale.z);float minOverMiddleScale=minScale/(scale.x+scale.y+scale.z-minScale-maxScale);float areaYZ=scale.y*scale.z;float areaXZ=scale.x*scale.z;float areaXY=scale.x*scale.y;float scaledBorderWidth=borderWidth; 
if (abs(normal.x)==1.0) 
{scale.x=scale.y;scale.y=scale.z;if (areaYZ>areaXZ && areaYZ>areaXY)
{scaledBorderWidth*=minOverMiddleScale;}}
else if (abs(normal.y)==1.0) 
{scale.x=scale.z;if (areaXZ>areaXY && areaXZ>areaYZ)
{scaledBorderWidth*=minOverMiddleScale;}}
else 
{if (areaXY>areaYZ && areaXY>areaXZ)
{scaledBorderWidth*=minOverMiddleScale;}}
float scaleRatio=min(scale.x,scale.y)/max(scale.x,scale.y);if (scale.x>scale.y)
{scaleInfo.x=1.0-(scaledBorderWidth*scaleRatio);scaleInfo.y=1.0-scaledBorderWidth;}
else
{scaleInfo.x=1.0-scaledBorderWidth;scaleInfo.y=1.0-(scaledBorderWidth*scaleRatio);} 
#endif 
vec4 worldPos=world*vec4(position,1.0);
#ifdef HOVERLIGHT
worldPosition=worldPos.xyz;
#endif
gl_Position=viewProjection*worldPos;}
`;
Le.ShadersStore[Uwe] = Iwe;
const Rwe = "fluentPixelShader", Vwe = `precision highp float;varying vec2 vUV;uniform vec4 albedoColor;
#ifdef INNERGLOW
uniform vec4 innerGlowColor;
#endif
#ifdef BORDER
varying vec2 scaleInfo;uniform float edgeSmoothingValue;uniform float borderMinValue;
#endif
#ifdef HOVERLIGHT
varying vec3 worldPosition;uniform vec3 hoverPosition;uniform vec4 hoverColor;uniform float hoverRadius;
#endif
#ifdef TEXTURE
uniform sampler2D albedoSampler;uniform mat4 textureMatrix;vec2 finalUV;
#endif
void main(void) {vec3 albedo=albedoColor.rgb;float alpha=albedoColor.a;
#ifdef TEXTURE
finalUV=vec2(textureMatrix*vec4(vUV,1.0,0.0));albedo=texture2D(albedoSampler,finalUV).rgb;
#endif
#ifdef HOVERLIGHT
float pointToHover=(1.0-clamp(length(hoverPosition-worldPosition)/hoverRadius,0.,1.))*hoverColor.a;albedo=clamp(albedo+hoverColor.rgb*pointToHover,0.,1.);
#else
float pointToHover=1.0;
#endif
#ifdef BORDER 
float borderPower=10.0;float inverseBorderPower=1.0/borderPower;vec3 borderColor=albedo*borderPower;vec2 distanceToEdge;distanceToEdge.x=abs(vUV.x-0.5)*2.0;distanceToEdge.y=abs(vUV.y-0.5)*2.0;float borderValue=max(smoothstep(scaleInfo.x-edgeSmoothingValue,scaleInfo.x+edgeSmoothingValue,distanceToEdge.x),
smoothstep(scaleInfo.y-edgeSmoothingValue,scaleInfo.y+edgeSmoothingValue,distanceToEdge.y));borderColor=borderColor*borderValue*max(borderMinValue*inverseBorderPower,pointToHover); 
albedo+=borderColor;alpha=max(alpha,borderValue);
#endif
#ifdef INNERGLOW
vec2 uvGlow=(vUV-vec2(0.5,0.5))*(innerGlowColor.a*2.0);uvGlow=uvGlow*uvGlow;uvGlow=uvGlow*uvGlow;albedo+=mix(vec3(0.0,0.0,0.0),innerGlowColor.rgb,uvGlow.x+uvGlow.y); 
#endif
gl_FragColor=vec4(albedo,alpha);}`;
Le.ShadersStore[Rwe] = Vwe;
class Cwe extends na {
  constructor() {
    super(), this.INNERGLOW = !1, this.BORDER = !1, this.HOVERLIGHT = !1, this.TEXTURE = !1, this.rebuild();
  }
}
class Qv extends P1 {
  /**
   * Creates a new Fluent material
   * @param name defines the name of the material
   * @param scene defines the hosting scene
   */
  constructor(e, t) {
    super(e, t), this.innerGlowColorIntensity = 0.5, this.innerGlowColor = new Ne(1, 1, 1), this.albedoColor = new Ne(0.3, 0.35, 0.4), this.renderBorders = !1, this.borderWidth = 0.5, this.edgeSmoothingValue = 0.02, this.borderMinValue = 0.1, this.renderHoverLight = !1, this.hoverRadius = 0.01, this.hoverColor = new xt(0.3, 0.3, 0.3, 1), this.hoverPosition = S.Zero();
  }
  needAlphaBlending() {
    return this.alpha !== 1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  isReadyForSubMesh(e, t) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady)
      return !0;
    t.materialDefines || (t.materialDefines = new Cwe());
    const r = this.getScene(), n = t.materialDefines;
    if (!this.checkReadyOnEveryCall && t.effect && n._renderId === r.getRenderId())
      return !0;
    if (n._areTexturesDirty)
      if (n.INNERGLOW = this.innerGlowColorIntensity > 0, n.BORDER = this.renderBorders, n.HOVERLIGHT = this.renderHoverLight, this._albedoTexture)
        if (this._albedoTexture.isReadyOrNotBlocking())
          n.TEXTURE = !0;
        else
          return !1;
      else
        n.TEXTURE = !1;
    const i = r.getEngine();
    if (n.isDirty) {
      n.markAsProcessed(), r.resetCachedMaterial();
      const s = [J.PositionKind];
      s.push(J.NormalKind), s.push(J.UVKind);
      const a = "fluent", f = [
        "world",
        "viewProjection",
        "innerGlowColor",
        "albedoColor",
        "borderWidth",
        "edgeSmoothingValue",
        "scaleFactor",
        "borderMinValue",
        "hoverColor",
        "hoverPosition",
        "hoverRadius",
        "textureMatrix"
      ], o = ["albedoSampler"], d = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: f,
        uniformBuffersNames: d,
        samplers: o,
        defines: n,
        maxSimultaneousLights: 4
      });
      const v = n.toString();
      t.setEffect(r.getEngine().createEffect(a, {
        attributes: s,
        uniformsNames: f,
        uniformBuffersNames: d,
        samplers: o,
        defines: v,
        fallbacks: null,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, i), n, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (n._renderId = r.getRenderId(), t.effect._wasPreviouslyReady = !0, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene(), i = r.materialDefines;
    if (!i)
      return;
    const s = r.effect;
    if (s) {
      if (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), this._mustRebind(n, s) && (this._activeEffect.setColor4("albedoColor", this.albedoColor, this.alpha), i.INNERGLOW && this._activeEffect.setColor4("innerGlowColor", this.innerGlowColor, this.innerGlowColorIntensity), i.BORDER && (this._activeEffect.setFloat("borderWidth", this.borderWidth), this._activeEffect.setFloat("edgeSmoothingValue", this.edgeSmoothingValue), this._activeEffect.setFloat("borderMinValue", this.borderMinValue), t.getBoundingInfo().boundingBox.extendSize.multiplyToRef(t.scaling, ue.Vector3[0]), this._activeEffect.setVector3("scaleFactor", ue.Vector3[0])), i.HOVERLIGHT && (this._activeEffect.setDirectColor4("hoverColor", this.hoverColor), this._activeEffect.setFloat("hoverRadius", this.hoverRadius), this._activeEffect.setVector3("hoverPosition", this.hoverPosition)), i.TEXTURE && this._albedoTexture)) {
        this._activeEffect.setTexture("albedoSampler", this._albedoTexture);
        const a = this._albedoTexture.getTextureMatrix();
        this._activeEffect.setMatrix("textureMatrix", a);
      }
      this._afterBind(t, this._activeEffect);
    }
  }
  getActiveTextures() {
    return super.getActiveTextures();
  }
  hasTexture(e) {
    return !!super.hasTexture(e);
  }
  dispose(e) {
    super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new Qv(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.GUI.FluentMaterial", e;
  }
  getClassName() {
    return "FluentMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new Qv(e.name, t), e, t, r);
  }
}
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], Qv.prototype, "innerGlowColorIntensity", void 0);
C([
  Oi()
], Qv.prototype, "innerGlowColor", void 0);
C([
  Oi()
], Qv.prototype, "albedoColor", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], Qv.prototype, "renderBorders", void 0);
C([
  M()
], Qv.prototype, "borderWidth", void 0);
C([
  M()
], Qv.prototype, "edgeSmoothingValue", void 0);
C([
  M()
], Qv.prototype, "borderMinValue", void 0);
C([
  M(),
  At("_markAllSubMeshesAsTexturesDirty")
], Qv.prototype, "renderHoverLight", void 0);
C([
  M()
], Qv.prototype, "hoverRadius", void 0);
C([
  rU()
], Qv.prototype, "hoverColor", void 0);
C([
  fo()
], Qv.prototype, "hoverPosition", void 0);
C([
  en("albedoTexture")
], Qv.prototype, "_albedoTexture", void 0);
C([
  At("_markAllSubMeshesAsTexturesAndMiscDirty")
], Qv.prototype, "albedoTexture", void 0);
Ue("BABYLON.GUI.FluentMaterial", Qv);
const Owe = "fluentBackplatePixelShader", ywe = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform float _Angle_;uniform float _Fade_Out_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform sampler2D _Iridescent_Map_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Round_Rect_Fragment_B31(
float Radius,
float Line_Width,
vec4 Line_Color,
float Filter_Width,
vec2 UV,
float Line_Visibility,
vec4 Rect_Parms,
vec4 Fill_Color,
out vec4 Color)
{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;}
void Blob_Fragment_B71(
sampler2D Blob_Texture,
vec4 Blob_Info1,
vec4 Blob_Info2,
out vec4 Blob_Color)
{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k1<k2 ? vec3(k1,Blob_Info1.z,Blob_Info1.w) : vec3(k2,Blob_Info2.z,Blob_Info2.w);Blob_Color=closer.z*texture(Blob_Texture,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);}
void Line_Fragment_B48(
vec4 Base_Color,
vec4 Highlight_Color,
float Highlight_Width,
vec3 Line_Vertex,
float Highlight,
out vec4 Line_Color)
{float k2=1.0-clamp(abs(Line_Vertex.y/Highlight_Width),0.0,1.0);Line_Color=mix(Base_Color,Highlight_Color,Highlight*k2);}
void Scale_RGB_B54(
vec4 Color,
float Scalar,
out vec4 Result)
{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}
void Conditional_Float_B38(
bool Which,
float If_True,
float If_False,
out float Result)
{Result=Which ? If_True : If_False;}
void main()
{float R_Q72;float G_Q72;float B_Q72;float A_Q72;R_Q72=vColor.r; G_Q72=vColor.g; B_Q72=vColor.b; A_Q72=vColor.a;vec4 Blob_Color_Q71;
#if BLOB_ENABLE
float k1=dot(vExtra2.xy,vExtra2.xy);float k2=dot(vExtra3.xy,vExtra3.xy);vec3 closer=k1<k2 ? vec3(k1,vExtra2.z,vExtra2.w) : vec3(k2,vExtra3.z,vExtra3.w);Blob_Color_Q71=closer.z*texture(_Blob_Texture_,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);
#else
Blob_Color_Q71=vec4(0,0,0,0);
#endif
vec4 Line_Color_Q48;Line_Fragment_B48(_Line_Color_,_Highlight_Color_,_Highlight_Width_,vTangent,_Highlight_,Line_Color_Q48);float X_Q67;float Y_Q67;X_Q67=vUV.x;Y_Q67=vUV.y;vec3 Incident_Q66=normalize(vPosition-cameraPosition);vec3 Reflected_Q60=reflect(Incident_Q66,vBinormal);float Product_Q63=Y_Q67*_Vertical_Offset_;float Dot_Q68=dot(Incident_Q66, Reflected_Q60);float Dot_Q57=dot(vNormal, Incident_Q66);float Result_Q38;Conditional_Float_B38(_Reflected_,Dot_Q68,Dot_Q57,Result_Q38);float Product_Q64=Result_Q38*_Frequency_;float Sum_Q69=Product_Q64+1.0;float Product_Q70=Sum_Q69*0.5;float Sum_Q62=Product_Q63+Product_Q70;float FractF_Q59=fract(Sum_Q62);vec2 Vec2_Q65=vec2(FractF_Q59,0.5);vec4 Color_Q58;
#if IRIDESCENT_MAP_ENABLE
Color_Q58=texture(_Iridescent_Map_,Vec2_Q65);
#else
Color_Q58=vec4(0,0,0,0);
#endif
vec4 Result_Q54;Scale_RGB_B54(Color_Q58,_Iridescence_Edge_Intensity_,Result_Q54);vec4 Result_Q55;Scale_RGB_B54(Color_Q58,_Iridescence_Intensity_,Result_Q55);vec4 Base_And_Iridescent_Q53;Base_And_Iridescent_Q53=Line_Color_Q48+vec4(Result_Q54.rgb,0.0);vec4 Base_And_Iridescent_Q56;Base_And_Iridescent_Q56=_Base_Color_+vec4(Result_Q55.rgb,0.0);vec4 Result_Q52=Base_And_Iridescent_Q53; Result_Q52.a=1.0;vec4 Result_Q35=Blob_Color_Q71+(1.0-Blob_Color_Q71.a)*Base_And_Iridescent_Q56;vec4 Color_Q31;Round_Rect_Fragment_B31(R_Q72,G_Q72,Result_Q52,_Filter_Width_,vUV,1.0,vExtra1,Result_Q35,Color_Q31);vec4 Result_Q47=_Fade_Out_*Color_Q31;vec4 Out_Color=Result_Q47;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}`;
Le.ShadersStore[Owe] = ywe;
const kwe = "fluentBackplateVertexShader", Ewe = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;
#ifdef TANGENT
attribute vec3 tangent;
#else
const vec3 tangent=vec3(0.);
#endif
uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform float _Angle_;uniform float _Fade_Out_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform sampler2D _Iridescent_Map_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B115(
vec3 Pos_Object,
out vec3 Pos_World)
{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}
void PickDir_B140(
float Degrees,
vec3 DirX,
vec3 DirY,
out vec3 Dir)
{float a=Degrees*3.14159/180.0;Dir=cos(a)*DirX+sin(a)*DirY;}
void Round_Rect_Vertex_B139(
vec2 UV,
float Radius,
float Margin,
float Anisotropy,
float Gradient1,
float Gradient2,
out vec2 Rect_UV,
out vec4 Rect_Parms,
out vec2 Scale_XY,
out vec2 Line_UV)
{Scale_XY=vec2(Anisotropy,1.0);Line_UV=(UV-vec2(0.5,0.5));Rect_UV=Line_UV*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);Rect_Parms.z=Gradient1; 
Rect_Parms.w=Gradient2;}
void Line_Vertex_B135(
vec2 Scale_XY,
vec2 UV,
float Time,
float Rate,
vec4 Highlight_Transform,
out vec3 Line_Vertex)
{float angle2=(Rate*Time)*2.0*3.1416;float sinAngle2=sin(angle2);float cosAngle2=cos(angle2);vec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;Line_Vertex.x=0.0;Line_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;Line_Vertex.z=0.0; }
void Blob_Vertex_B180(
vec3 Position,
vec3 Normal,
vec3 Tangent,
vec3 Bitangent,
vec3 Blob_Position,
float Intensity,
float Blob_Near_Size,
float Blob_Far_Size,
float Blob_Near_Distance,
float Blob_Far_Distance,
float Blob_Fade_Length,
float Blob_Pulse,
float Blob_Fade,
out vec4 Blob_Info)
{vec3 blob=Blob_Position;vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);}
void Move_Verts_B129(
float Anisotropy,
vec3 P,
float Radius,
out vec3 New_P,
out vec2 New_UV,
out float Radial_Gradient,
out vec3 Radial_Dir)
{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);New_UV=center+r2*(UV-2.0*center+0.5);New_P=vec3(New_UV-0.5,P.z);Radial_Gradient=1.0-length(delta)*2.0;Radial_Dir=vec3(delta*r2,0.0);}
void Object_To_World_Dir_B132(
vec3 Dir_Object,
out vec3 Binormal_World,
out vec3 Binormal_World_N,
out float Binormal_Length)
{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;}
void RelativeOrAbsoluteDetail_B147(
float Nominal_Radius,
float Nominal_LineWidth,
bool Absolute_Measurements,
float Height,
out float Radius,
out float Line_Width)
{float scale=Absolute_Measurements ? 1.0/Height : 1.0;Radius=Nominal_Radius*scale;Line_Width=Nominal_LineWidth*scale;}
void Edge_AA_Vertex_B130(
vec3 Position_World,
vec3 Position_Object,
vec3 Normal_Object,
vec3 Eye,
float Radial_Gradient,
vec3 Radial_Dir,
vec3 Tangent,
out float Gradient1,
out float Gradient2)
{vec3 I=(Eye-Position_World);vec3 T=(world* vec4(Tangent,0.0)).xyz;float g=(dot(T,I)<0.0) ? 0.0 : 1.0;if (Normal_Object.z==0.0) { 
Gradient1=Position_Object.z>0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}}
void Pick_Radius_B144(
float Radius,
float Radius_Top_Left,
float Radius_Top_Right,
float Radius_Bottom_Left,
float Radius_Bottom_Right,
vec3 Position,
out float Result)
{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}
void main()
{vec3 Nrm_World_Q128;Nrm_World_Q128=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q131;vec3 Tangent_World_N_Q131;float Tangent_Length_Q131;Tangent_World_Q131=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q131=length(Tangent_World_Q131);Tangent_World_N_Q131=Tangent_World_Q131/Tangent_Length_Q131;vec3 Binormal_World_Q132;vec3 Binormal_World_N_Q132;float Binormal_Length_Q132;Object_To_World_Dir_B132(vec3(0,1,0),Binormal_World_Q132,Binormal_World_N_Q132,Binormal_Length_Q132);float Anisotropy_Q133=Tangent_Length_Q131/Binormal_Length_Q132;vec3 Result_Q177;Result_Q177=mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(_Use_Global_Left_Index_));vec3 Result_Q178;Result_Q178=mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(_Use_Global_Right_Index_));float Result_Q144;Pick_Radius_B144(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q144);vec3 Dir_Q140;PickDir_B140(_Angle_,Tangent_World_N_Q131,Binormal_World_N_Q132,Dir_Q140);float Radius_Q147;float Line_Width_Q147;RelativeOrAbsoluteDetail_B147(Result_Q144,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q132,Radius_Q147,Line_Width_Q147);vec4 Out_Color_Q145=vec4(Radius_Q147,Line_Width_Q147,0,1);vec3 New_P_Q129;vec2 New_UV_Q129;float Radial_Gradient_Q129;vec3 Radial_Dir_Q129;Move_Verts_B129(Anisotropy_Q133,position,Radius_Q147,New_P_Q129,New_UV_Q129,Radial_Gradient_Q129,Radial_Dir_Q129);vec3 Pos_World_Q115;Object_To_World_Pos_B115(New_P_Q129,Pos_World_Q115);vec4 Blob_Info_Q180;
#if BLOB_ENABLE
Blob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q177,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q180);
#else
Blob_Info_Q180=vec4(0,0,0,0);
#endif
vec4 Blob_Info_Q181;
#if BLOB_ENABLE_2
Blob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q178,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q181);
#else
Blob_Info_Q181=vec4(0,0,0,0);
#endif
float Gradient1_Q130;float Gradient2_Q130;
#if SMOOTH_EDGES
Edge_AA_Vertex_B130(Pos_World_Q115,position,normal,cameraPosition,Radial_Gradient_Q129,Radial_Dir_Q129,tangent,Gradient1_Q130,Gradient2_Q130);
#else
Gradient1_Q130=1.0;Gradient2_Q130=1.0;
#endif
vec2 Rect_UV_Q139;vec4 Rect_Parms_Q139;vec2 Scale_XY_Q139;vec2 Line_UV_Q139;Round_Rect_Vertex_B139(New_UV_Q129,Radius_Q147,0.0,Anisotropy_Q133,Gradient1_Q130,Gradient2_Q130,Rect_UV_Q139,Rect_Parms_Q139,Scale_XY_Q139,Line_UV_Q139);vec3 Line_Vertex_Q135;Line_Vertex_B135(Scale_XY_Q139,Line_UV_Q139,0.0,_Rate_,_Highlight_Transform_,Line_Vertex_Q135);vec3 Position=Pos_World_Q115;vec3 Normal=Dir_Q140;vec2 UV=Rect_UV_Q139;vec3 Tangent=Line_Vertex_Q135;vec3 Binormal=Nrm_World_Q128;vec4 Color=Out_Color_Q145;vec4 Extra1=Rect_Parms_Q139;vec4 Extra2=Blob_Info_Q180;vec4 Extra3=Blob_Info_Q181;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`;
Le.ShadersStore[kwe] = Ewe;
class Fwe extends na {
  constructor() {
    super(), this.BLOB_ENABLE = !0, this.BLOB_ENABLE_2 = !0, this.SMOOTH_EDGES = !0, this.IRIDESCENT_MAP_ENABLE = !0, this._needNormals = !0, this.rebuild();
  }
}
class Uo extends P1 {
  constructor(e, t) {
    super(e, t), this.radius = 0.03, this.lineWidth = 0.01, this.absoluteSizes = !1, this._filterWidth = 1, this.baseColor = new xt(0.0392157, 0.0666667, 0.207843, 1), this.lineColor = new xt(0.14902, 0.133333, 0.384314, 1), this.blobIntensity = 0.98, this.blobFarSize = 0.04, this.blobNearDistance = 0, this.blobFarDistance = 0.08, this.blobFadeLength = 0.08, this.blobNearSize = 0.22, this.blobPulse = 0, this.blobFade = 0, this.blobNearSize2 = 0.22, this.blobPulse2 = 0, this.blobFade2 = 0, this._rate = 0.135, this.highlightColor = new xt(0.98, 0.98, 0.98, 1), this.highlightWidth = 0.25, this._highlightTransform = new Ir(1, 1, 0, 0), this._highlight = 1, this.iridescenceIntensity = 0, this.iridescenceEdgeIntensity = 1, this._angle = -45, this.fadeOut = 1, this._reflected = !0, this._frequency = 1, this._verticalOffset = 0, this.globalLeftIndexTipPosition = S.Zero(), this._globalLeftIndexTipPosition4 = Ir.Zero(), this.globalRightIndexTipPosition = S.Zero(), this._globalRightIndexTipPosition4 = Ir.Zero(), this.alphaMode = et.ALPHA_DISABLE, this.backFaceCulling = !1, this._blobTexture = new We(Uo.BLOB_TEXTURE_URL, this.getScene(), !0, !1, We.NEAREST_SAMPLINGMODE), this._iridescentMap = new We(Uo.IM_TEXTURE_URL, this.getScene(), !0, !1, We.NEAREST_SAMPLINGMODE);
  }
  needAlphaBlending() {
    return !1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  isReadyForSubMesh(e, t) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady)
      return !0;
    t.materialDefines || (t.materialDefines = new Fwe());
    const r = t.materialDefines, n = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const i = n.getEngine();
    if (Ye.PrepareDefinesForAttributes(e, r, !1, !1), r.isDirty) {
      r.markAsProcessed(), n.resetCachedMaterial();
      const s = new c1();
      r.FOG && s.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(r, s), r.IMAGEPROCESSINGPOSTPROCESS = n.imageProcessingConfiguration.applyByPostProcess;
      const a = [J.PositionKind];
      r.NORMAL && a.push(J.NormalKind), r.UV1 && a.push(J.UVKind), r.UV2 && a.push(J.UV2Kind), r.VERTEXCOLOR && a.push(J.ColorKind), r.TANGENT && a.push(J.TangentKind), Ye.PrepareAttributesForInstances(a, r);
      const f = "fluentBackplate", o = r.toString(), d = [
        "world",
        "viewProjection",
        "cameraPosition",
        "_Radius_",
        "_Line_Width_",
        "_Absolute_Sizes_",
        "_Filter_Width_",
        "_Base_Color_",
        "_Line_Color_",
        "_Radius_Top_Left_",
        "_Radius_Top_Right_",
        "_Radius_Bottom_Left_",
        "_Radius_Bottom_Right_",
        "_Blob_Position_",
        "_Blob_Intensity_",
        "_Blob_Near_Size_",
        "_Blob_Far_Size_",
        "_Blob_Near_Distance_",
        "_Blob_Far_Distance_",
        "_Blob_Fade_Length_",
        "_Blob_Pulse_",
        "_Blob_Fade_",
        "_Blob_Texture_",
        "_Blob_Position_2_",
        "_Blob_Near_Size_2_",
        "_Blob_Pulse_2_",
        "_Blob_Fade_2_",
        "_Rate_",
        "_Highlight_Color_",
        "_Highlight_Width_",
        "_Highlight_Transform_",
        "_Highlight_",
        "_Iridescence_Intensity_",
        "_Iridescence_Edge_Intensity_",
        "_Angle_",
        "_Fade_Out_",
        "_Reflected_",
        "_Frequency_",
        "_Vertical_Offset_",
        "_Iridescent_Map_",
        "_Use_Global_Left_Index_",
        "_Use_Global_Right_Index_",
        "Global_Left_Index_Tip_Position",
        "Global_Right_Index_Tip_Position"
      ], v = ["_Blob_Texture_", "_Iridescent_Map_"], u = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: r,
        maxSimultaneousLights: 4
      }), t.setEffect(n.getEngine().createEffect(f, {
        attributes: a,
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: o,
        fallbacks: s,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, i), r, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (r._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, !0);
  }
  bindForSubMesh(e, t, r) {
    var n, i;
    if (!r.materialDefines)
      return;
    const a = r.effect;
    a && (this._activeEffect = a, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()), this._activeEffect.setVector3("cameraPosition", (i = (n = this.getScene().activeCamera) === null || n === void 0 ? void 0 : n.position) !== null && i !== void 0 ? i : S.ZeroReadOnly), this._activeEffect.setFloat("_Radius_", this.radius), this._activeEffect.setFloat("_Line_Width_", this.lineWidth), this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1 : 0), this._activeEffect.setFloat("_Filter_Width_", this._filterWidth), this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor), this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor), this._activeEffect.setFloat("_Radius_Top_Left_", 1), this._activeEffect.setFloat("_Radius_Top_Right_", 1), this._activeEffect.setFloat("_Radius_Bottom_Left_", 1), this._activeEffect.setFloat("_Radius_Bottom_Right_", 1), this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity), this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize), this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize), this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance), this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance), this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength), this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse), this._activeEffect.setFloat("_Blob_Fade_", this.blobFade), this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture), this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2), this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2), this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2), this._activeEffect.setFloat("_Rate_", this._rate), this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor), this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth), this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform), this._activeEffect.setFloat("_Highlight_", this._highlight), this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity), this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity), this._activeEffect.setFloat("_Angle_", this._angle), this._activeEffect.setFloat("_Fade_Out_", this.fadeOut), this._activeEffect.setFloat("_Reflected_", this._reflected ? 1 : 0), this._activeEffect.setFloat("_Frequency_", this._frequency), this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset), this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap), this._activeEffect.setFloat("_Use_Global_Left_Index_", 1), this._activeEffect.setFloat("_Use_Global_Right_Index_", 1), this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1), this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4), this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1), this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4), this._afterBind(t, this._activeEffect));
  }
  /**
   * Get the list of animatables in the material.
   * @returns the list of animatables object used in the material
   */
  getAnimatables() {
    return [];
  }
  dispose(e) {
    super.dispose(e), this._blobTexture.dispose(), this._iridescentMap.dispose();
  }
  clone(e) {
    return jt.Clone(() => new Uo(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.FluentBackplateMaterial", e;
  }
  getClassName() {
    return "FluentBackplateMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new Uo(e.name, t), e, t, r);
  }
}
Uo.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png";
Uo.IM_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png";
C([
  M()
], Uo.prototype, "radius", void 0);
C([
  M()
], Uo.prototype, "lineWidth", void 0);
C([
  M()
], Uo.prototype, "absoluteSizes", void 0);
C([
  M()
], Uo.prototype, "baseColor", void 0);
C([
  M()
], Uo.prototype, "lineColor", void 0);
C([
  M()
], Uo.prototype, "blobIntensity", void 0);
C([
  M()
], Uo.prototype, "blobFarSize", void 0);
C([
  M()
], Uo.prototype, "blobNearDistance", void 0);
C([
  M()
], Uo.prototype, "blobFarDistance", void 0);
C([
  M()
], Uo.prototype, "blobFadeLength", void 0);
C([
  M()
], Uo.prototype, "blobNearSize", void 0);
C([
  M()
], Uo.prototype, "blobPulse", void 0);
C([
  M()
], Uo.prototype, "blobFade", void 0);
C([
  M()
], Uo.prototype, "blobNearSize2", void 0);
C([
  M()
], Uo.prototype, "blobPulse2", void 0);
C([
  M()
], Uo.prototype, "blobFade2", void 0);
C([
  M()
], Uo.prototype, "highlightColor", void 0);
C([
  M()
], Uo.prototype, "highlightWidth", void 0);
C([
  M()
], Uo.prototype, "iridescenceIntensity", void 0);
C([
  M()
], Uo.prototype, "iridescenceEdgeIntensity", void 0);
C([
  M()
], Uo.prototype, "fadeOut", void 0);
C([
  fo()
], Uo.prototype, "globalLeftIndexTipPosition", void 0);
C([
  fo()
], Uo.prototype, "globalRightIndexTipPosition", void 0);
Ue("BABYLON.GUI.FluentBackplateMaterial", Uo);
const Nwe = "fluentButtonPixelShader", Qwe = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform bool _Relative_Width_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool Enable_Fade;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool _Use_Blob_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Holo_Edge_Fragment_B35(
vec4 Edges,
float Edge_Width,
out float NotEdge)
{vec2 c=vec2(min(Edges.r,Edges.g),min(Edges.b,Edges.a));vec2 df=fwidth(c)*Edge_Width;vec2 g=clamp(c/df,0.0,1.0);NotEdge=g.x*g.y;}
void Blob_Fragment_B39(
vec2 UV,
vec3 Blob_Info,
sampler2D Blob_Texture,
out vec4 Blob_Color)
{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));}
vec2 FilterStep(vec2 Edge,vec2 X)
{vec2 dX=max(fwidth(X),vec2(0.00001,0.00001));return clamp( (X+dX-max(Edge,X-dX))/(dX*2.0),0.0,1.0);}
void Wireframe_Fragment_B59(
vec3 Widths,
vec2 UV,
float Proximity,
vec4 Edge_Color,
out vec4 Wireframe)
{vec2 c=min(UV,vec2(1.0,1.0)-UV);vec2 g=FilterStep(Widths.xy*0.5,c); 
Wireframe=(1.0-min(g.x,g.y))*Proximity*Edge_Color;}
void Proximity_B53(
vec3 Proximity_Center,
vec3 Proximity_Center_2,
float Proximity_Max_Intensity,
float Proximity_Near_Radius,
vec3 Position,
vec3 Show_Selection,
vec4 Extra1,
float Dist_To_Face,
float Intensity,
out float Proximity)
{vec2 delta1=Extra1.xy;vec2 delta2=Extra1.zw;float d2=sqrt(min(dot(delta1,delta1),dot(delta2,delta2))+Dist_To_Face*Dist_To_Face);Proximity=Intensity*Proximity_Max_Intensity*(1.0-clamp(d2/Proximity_Near_Radius,0.0,1.0))*(1.0-Show_Selection.x)+Show_Selection.x;}
void To_XYZ_B46(
vec3 Vec3,
out float X,
out float Y,
out float Z)
{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}
void main()
{float NotEdge_Q35;
#if ENABLE_FADE
Holo_Edge_Fragment_B35(vColor,_Fade_Width_,NotEdge_Q35);
#else
NotEdge_Q35=1.0;
#endif
vec4 Blob_Color_Q39;float k=dot(vUV,vUV);vec2 blobTextureCoord=vec2(vec2(sqrt(k),vTangent.x).x,1.0-vec2(sqrt(k),vTangent.x).y);vec4 blobColor=mix(vec4(1.0,1.0,1.0,1.0)*step(1.0-vTangent.x,clamp(sqrt(k)+0.1,0.0,1.0)),texture(_Blob_Texture_,blobTextureCoord),float(_Use_Blob_Texture_));Blob_Color_Q39=vTangent.y*blobColor*(1.0-clamp(k,0.0,1.0));float Is_Quad_Q24;Is_Quad_Q24=vNormal.z;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));float X_Q46;float Y_Q46;float Z_Q46;To_XYZ_B46(vBinormal,X_Q46,Y_Q46,Z_Q46);float Proximity_Q53;Proximity_B53(Blob_Position_Q41,Blob_Position_Q42,_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vPosition,vBinormal,vExtra1,Y_Q46,Z_Q46,Proximity_Q53);vec4 Wireframe_Q59;Wireframe_Fragment_B59(vNormal,vUV,Proximity_Q53,_Edge_Color_,Wireframe_Q59);vec4 Wire_Or_Blob_Q23=mix(Wireframe_Q59,Blob_Color_Q39,Is_Quad_Q24);vec4 Result_Q22;Result_Q22=mix(Wire_Or_Blob_Q23,vec4(0.3,0.3,0.3,0.3),float(_Show_Frame_));vec4 Final_Color_Q37=NotEdge_Q35*Result_Q22;vec4 Out_Color=Final_Color_Q37;float Clip_Threshold=0.0;bool To_sRGB=false;gl_FragColor=Out_Color;}`;
Le.ShadersStore[Nwe] = Qwe;
const Ywe = "fluentButtonVertexShader", Mwe = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool _Enable_Fade_;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;void Blob_Vertex_B47(
vec3 Position,
vec3 Normal,
vec3 Tangent,
vec3 Bitangent,
vec3 Blob_Position,
float Intensity,
float Blob_Near_Size,
float Blob_Far_Size,
float Blob_Near_Distance,
float Blob_Far_Distance,
vec4 Vx_Color,
vec2 UV,
vec3 Face_Center,
vec2 Face_Size,
vec2 In_UV,
float Blob_Fade_Length,
float Selection_Fade,
float Selection_Fade_Size,
float Inner_Fade,
vec3 Active_Face_Center,
float Blob_Pulse,
float Blob_Fade,
float Blob_Enabled,
out vec3 Out_Position,
out vec2 Out_UV,
out vec3 Blob_Info)
{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal);Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; 
vec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);}
vec2 ProjectProximity(
vec3 blobPosition,
vec3 position,
vec3 center,
vec3 dir,
vec3 xdir,
vec3 ydir,
out float vdistance
)
{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;}
void Proximity_Vertex_B66(
vec3 Blob_Position,
vec3 Blob_Position_2,
vec3 Active_Face_Center,
vec3 Active_Face_Dir,
vec3 Position,
float Proximity_Far_Distance,
float Relative_Scale,
float Proximity_Anisotropy,
vec3 Up,
out vec4 Extra1,
out float Distance_To_Face,
out float Intensity)
{vec3 Active_Face_Dir_X=normalize(cross(Active_Face_Dir,Up));vec3 Active_Face_Dir_Y=cross(Active_Face_Dir,Active_Face_Dir_X);float distz1,distz2;Extra1.xy=ProjectProximity(Blob_Position,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz1)/Relative_Scale;Extra1.zw=ProjectProximity(Blob_Position_2,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz2)/Relative_Scale;Distance_To_Face=dot(Active_Face_Dir,Position-Active_Face_Center);Intensity=1.0-clamp(min(distz1,distz2)/Proximity_Far_Distance,0.0,1.0);}
void Holo_Edge_Vertex_B44(
vec3 Incident,
vec3 Normal,
vec2 UV,
vec3 Tangent,
vec3 Bitangent,
bool Smooth_Active_Face,
float Active,
out vec4 Holo_Edges)
{float NdotI=dot(Incident,Normal);vec2 flip=(UV-vec2(0.5,0.5));float udot=dot(Incident,Tangent)*flip.x*NdotI;float uval=1.0-float(udot>0.0);float vdot=-dot(Incident,Bitangent)*flip.y*NdotI;float vval=1.0-float(vdot>0.0);float Smooth_And_Active=step(1.0,float(Smooth_Active_Face && Active>0.0));uval=mix(uval,max(1.0,uval),Smooth_And_Active); 
vval=mix(vval,max(1.0,vval),Smooth_And_Active);Holo_Edges=vec4(1.0,1.0,1.0,1.0)-vec4(uval*UV.x,uval*(1.0-UV.x),vval*UV.y,vval*(1.0-UV.y));}
void Object_To_World_Pos_B13(
vec3 Pos_Object,
out vec3 Pos_World)
{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}
void Choose_Blob_B38(
vec4 Vx_Color,
vec3 Position1,
vec3 Position2,
bool Blob_Enable_1,
bool Blob_Enable_2,
float Near_Size_1,
float Near_Size_2,
float Blob_Inner_Fade_1,
float Blob_Inner_Fade_2,
float Blob_Pulse_1,
float Blob_Pulse_2,
float Blob_Fade_1,
float Blob_Fade_2,
out vec3 Position,
out float Near_Size,
out float Inner_Fade,
out float Blob_Enable,
out float Fade,
out float Pulse)
{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=float(Blob_Enable_1);float b2=float(Blob_Enable_2);Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;}
void Wireframe_Vertex_B51(
vec3 Position,
vec3 Normal,
vec3 Tangent,
vec3 Bitangent,
float Edge_Width,
vec2 Face_Size,
out vec3 Wire_Vx_Pos,
out vec2 UV,
out vec2 Widths)
{Widths.xy=Edge_Width/Face_Size;float x=dot(Position,Tangent);float y=dot(Position,Bitangent);float dx=0.5-abs(x);float newx=(0.5-dx*Widths.x*2.0)*sign(x);float dy=0.5-abs(y);float newy=(0.5-dy*Widths.y*2.0)*sign(y);Wire_Vx_Pos=Normal*0.5+newx*Tangent+newy*Bitangent;UV.x=dot(Wire_Vx_Pos,Tangent)+0.5;UV.y=dot(Wire_Vx_Pos,Bitangent)+0.5;}
vec2 ramp2(vec2 start,vec2 end,vec2 x)
{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));}
float computeSelection(
vec3 blobPosition,
vec3 normal,
vec3 tangent,
vec3 bitangent,
vec3 faceCenter,
vec2 faceSize,
float selectionFuzz,
float farDistance,
float fadeLength
)
{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;}
void Selection_Vertex_B48(
vec3 Blob_Position,
vec3 Blob_Position_2,
vec3 Face_Center,
vec2 Face_Size,
vec3 Normal,
vec3 Tangent,
vec3 Bitangent,
float Selection_Fuzz,
float Selected,
float Far_Distance,
float Fade_Length,
vec3 Active_Face_Dir,
out float Show_Selection)
{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float Active=max(0.0,dot(Active_Face_Dir,Normal));Show_Selection=mix(max(select1,select2),1.0,Selected)*Active;}
void Proximity_Visibility_B54(
float Selection,
vec3 Proximity_Center,
vec3 Proximity_Center_2,
float Input_Width,
float Proximity_Far_Distance,
float Proximity_Radius,
vec3 Active_Face_Center,
vec3 Active_Face_Dir,
out float Width)
{vec3 boxEdges=(world*vec4(vec3(0.5,0.5,0.5),0.0)).xyz;float boxMaxSize=length(boxEdges);float d1=dot(Proximity_Center-Active_Face_Center,Active_Face_Dir);vec3 blob1=Proximity_Center-d1*Active_Face_Dir;float d2=dot(Proximity_Center_2-Active_Face_Center,Active_Face_Dir);vec3 blob2=Proximity_Center_2-d2*Active_Face_Dir;vec3 delta1=blob1-Active_Face_Center;vec3 delta2=blob2-Active_Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=Input_Width*(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));}
void Object_To_World_Dir_B67(
vec3 Dir_Object,
out vec3 Dir_World)
{Dir_World=(world*vec4(Dir_Object,0.0)).xyz;}
void main()
{vec3 Active_Face_Center_Q49;Active_Face_Center_Q49=(world*vec4(_Active_Face_Dir_*0.5,1.0)).xyz;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));vec3 Active_Face_Dir_Q64=normalize((world*vec4(_Active_Face_Dir_,0.0)).xyz);float Relative_Scale_Q57;
#if RELATIVE_WIDTH
Relative_Scale_Q57=length((world*vec4(vec3(0,1,0),0.0)).xyz);
#else
Relative_Scale_Q57=1.0;
#endif
vec3 Tangent_World_Q30;Tangent_World_Q30=(world*vec4(tangent,0.0)).xyz;vec3 Binormal_World_Q31;Binormal_World_Q31=(world*vec4((cross(normal,tangent)),0.0)).xyz;vec3 Normal_World_Q60;Normal_World_Q60=(world*vec4(normal,0.0)).xyz;vec3 Result_Q18=0.5*normal;vec3 Dir_World_Q67;Object_To_World_Dir_B67(_Active_Face_Up_,Dir_World_Q67);float Product_Q56=_Edge_Width_*Relative_Scale_Q57;vec3 Normal_World_N_Q29=normalize(Normal_World_Q60);vec3 Tangent_World_N_Q28=normalize(Tangent_World_Q30);vec3 Binormal_World_N_Q32=normalize(Binormal_World_Q31);vec3 Position_Q38;float Near_Size_Q38;float Inner_Fade_Q38;float Blob_Enable_Q38;float Fade_Q38;float Pulse_Q38;Choose_Blob_B38(color,Blob_Position_Q41,Blob_Position_Q42,_Blob_Enable_,_Blob_Enable_2_,_Blob_Near_Size_,_Blob_Near_Size_2_,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q38,Near_Size_Q38,Inner_Fade_Q38,Blob_Enable_Q38,Fade_Q38,Pulse_Q38);vec3 Face_Center_Q33;Face_Center_Q33=(world*vec4(Result_Q18,1.0)).xyz;vec2 Face_Size_Q50=vec2(length(Tangent_World_Q30),length(Binormal_World_Q31));float Show_Selection_Q48;Selection_Vertex_B48(Blob_Position_Q41,Blob_Position_Q42,Face_Center_Q33,Face_Size_Q50,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,Active_Face_Dir_Q64,Show_Selection_Q48);vec3 Normalized_Q72=normalize(Dir_World_Q67);float Active_Q34=max(0.0,dot(Active_Face_Dir_Q64,Normal_World_N_Q29));float Width_Q54;Proximity_Visibility_B54(Show_Selection_Q48,Blob_Position_Q41,Blob_Position_Q42,Product_Q56,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Active_Face_Center_Q49,Active_Face_Dir_Q64,Width_Q54);vec3 Wire_Vx_Pos_Q51;vec2 UV_Q51;vec2 Widths_Q51;Wireframe_Vertex_B51(position,normal,tangent,(cross(normal,tangent)),Width_Q54,Face_Size_Q50,Wire_Vx_Pos_Q51,UV_Q51,Widths_Q51);vec3 Vec3_Q27=vec3(Widths_Q51.x,Widths_Q51.y,color.r);vec3 Pos_World_Q13;Object_To_World_Pos_B13(Wire_Vx_Pos_Q51,Pos_World_Q13);vec3 Incident_Q36=normalize(Pos_World_Q13-cameraPosition);vec3 Out_Position_Q47;vec2 Out_UV_Q47;vec3 Blob_Info_Q47;Blob_Vertex_B47(Pos_World_Q13,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,Position_Q38,_Blob_Intensity_,Near_Size_Q38,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q33,Face_Size_Q50,UV_Q51,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q38,Active_Face_Center_Q49,Pulse_Q38,Fade_Q38,Blob_Enable_Q38,Out_Position_Q47,Out_UV_Q47,Blob_Info_Q47);vec4 Extra1_Q66;float Distance_To_Face_Q66;float Intensity_Q66;Proximity_Vertex_B66(Blob_Position_Q41,Blob_Position_Q42,Active_Face_Center_Q49,Active_Face_Dir_Q64,Pos_World_Q13,_Proximity_Far_Distance_,Relative_Scale_Q57,_Proximity_Anisotropy_,Normalized_Q72,Extra1_Q66,Distance_To_Face_Q66,Intensity_Q66);vec4 Holo_Edges_Q44;Holo_Edge_Vertex_B44(Incident_Q36,Normal_World_N_Q29,uv,Tangent_World_Q30,Binormal_World_Q31,_Smooth_Active_Face_,Active_Q34,Holo_Edges_Q44);vec3 Vec3_Q19=vec3(Show_Selection_Q48,Distance_To_Face_Q66,Intensity_Q66);vec3 Position=Out_Position_Q47;vec2 UV=Out_UV_Q47;vec3 Tangent=Blob_Info_Q47;vec3 Binormal=Vec3_Q19;vec3 Normal=Vec3_Q27;vec4 Extra1=Extra1_Q66;vec4 Color=Holo_Edges_Q44;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;}`;
Le.ShadersStore[Ywe] = Mwe;
class Lwe extends na {
  constructor() {
    super(), this.RELATIVE_WIDTH = !0, this.ENABLE_FADE = !0, this._needNormals = !0, this._needUVs = !0, this.rebuild();
  }
}
class Os extends P1 {
  constructor(e, t) {
    super(e, t), this.edgeWidth = 0.04, this.edgeColor = new xt(0.592157, 0.592157, 0.592157, 1), this.proximityMaxIntensity = 0.45, this.proximityFarDistance = 0.16, this.proximityNearRadius = 1.5, this.proximityAnisotropy = 1, this.selectionFuzz = 0.5, this.selected = 0, this.selectionFade = 0, this.selectionFadeSize = 0.3, this.selectedDistance = 0.08, this.selectedFadeLength = 0.08, this.blobIntensity = 0.5, this.blobFarSize = 0.05, this.blobNearDistance = 0, this.blobFarDistance = 0.08, this.blobFadeLength = 0.08, this.leftBlobEnable = !0, this.leftBlobNearSize = 0.025, this.leftBlobPulse = 0, this.leftBlobFade = 1, this.leftBlobInnerFade = 0.01, this.rightBlobEnable = !0, this.rightBlobNearSize = 0.025, this.rightBlobPulse = 0, this.rightBlobFade = 1, this.rightBlobInnerFade = 0.01, this.activeFaceDir = new S(0, 0, -1), this.activeFaceUp = new S(0, 1, 0), this.enableFade = !0, this.fadeWidth = 1.5, this.smoothActiveFace = !0, this.showFrame = !1, this.useBlobTexture = !0, this.globalLeftIndexTipPosition = S.Zero(), this.globalRightIndexTipPosition = S.Zero(), this.alphaMode = et.ALPHA_ADD, this.disableDepthWrite = !0, this.backFaceCulling = !1, this._blobTexture = new We(Os.BLOB_TEXTURE_URL, this.getScene(), !0, !1, We.NEAREST_SAMPLINGMODE);
  }
  needAlphaBlending() {
    return !0;
  }
  needAlphaTesting() {
    return !0;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady)
      return !0;
    t.materialDefines || (t.materialDefines = new Lwe());
    const r = t.materialDefines, n = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const i = n.getEngine();
    if (Ye.PrepareDefinesForAttributes(e, r, !0, !1), r.isDirty) {
      r.markAsProcessed(), n.resetCachedMaterial();
      const s = new c1();
      r.FOG && s.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(r, s), r.IMAGEPROCESSINGPOSTPROCESS = n.imageProcessingConfiguration.applyByPostProcess;
      const a = [J.PositionKind];
      r.NORMAL && a.push(J.NormalKind), r.UV1 && a.push(J.UVKind), r.UV2 && a.push(J.UV2Kind), r.VERTEXCOLOR && a.push(J.ColorKind), r.TANGENT && a.push(J.TangentKind), Ye.PrepareAttributesForInstances(a, r);
      const f = "fluentButton", o = r.toString(), d = [
        "world",
        "viewProjection",
        "cameraPosition",
        "_Edge_Width_",
        "_Edge_Color_",
        "_Relative_Width_",
        "_Proximity_Max_Intensity_",
        "_Proximity_Far_Distance_",
        "_Proximity_Near_Radius_",
        "_Proximity_Anisotropy_",
        "_Selection_Fuzz_",
        "_Selected_",
        "_Selection_Fade_",
        "_Selection_Fade_Size_",
        "_Selected_Distance_",
        "_Selected_Fade_Length_",
        "_Blob_Enable_",
        "_Blob_Position_",
        "_Blob_Intensity_",
        "_Blob_Near_Size_",
        "_Blob_Far_Size_",
        "_Blob_Near_Distance_",
        "_Blob_Far_Distance_",
        "_Blob_Fade_Length_",
        "_Blob_Inner_Fade_",
        "_Blob_Pulse_",
        "_Blob_Fade_",
        "_Blob_Texture_",
        "_Blob_Enable_2_",
        "_Blob_Position_2_",
        "_Blob_Near_Size_2_",
        "_Blob_Inner_Fade_2_",
        "_Blob_Pulse_2_",
        "_Blob_Fade_2_",
        "_Active_Face_Dir_",
        "_Active_Face_Up_",
        "_Enable_Fade_",
        "_Fade_Width_",
        "_Smooth_Active_Face_",
        "_Show_Frame_",
        "_Use_Blob_Texture_",
        "Use_Global_Left_Index",
        "Use_Global_Right_Index",
        "Global_Left_Index_Tip_Position",
        "Global_Right_Index_Tip_Position",
        "Global_Left_Thumb_Tip_Position",
        "Global_Right_Thumb_Tip_Position",
        "Global_Left_Index_Tip_Proximity",
        "Global_Right_Index_Tip_Proximity"
      ], v = ["_Blob_Texture_"], u = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: r,
        maxSimultaneousLights: 4
      }), t.setEffect(n.getEngine().createEffect(f, {
        attributes: a,
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: o,
        fallbacks: s,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, i), r, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (r._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene();
    if (!r.materialDefines)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), this._activeEffect.setVector3("cameraPosition", n.activeCamera.position), this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture), this._activeEffect.setFloat("_Edge_Width_", this.edgeWidth), this._activeEffect.setColor4("_Edge_Color_", new Ne(this.edgeColor.r, this.edgeColor.g, this.edgeColor.b), this.edgeColor.a), this._activeEffect.setFloat("_Proximity_Max_Intensity_", this.proximityMaxIntensity), this._activeEffect.setFloat("_Proximity_Far_Distance_", this.proximityFarDistance), this._activeEffect.setFloat("_Proximity_Near_Radius_", this.proximityNearRadius), this._activeEffect.setFloat("_Proximity_Anisotropy_", this.proximityAnisotropy), this._activeEffect.setFloat("_Selection_Fuzz_", this.selectionFuzz), this._activeEffect.setFloat("_Selected_", this.selected), this._activeEffect.setFloat("_Selection_Fade_", this.selectionFade), this._activeEffect.setFloat("_Selection_Fade_Size_", this.selectionFadeSize), this._activeEffect.setFloat("_Selected_Distance_", this.selectedDistance), this._activeEffect.setFloat("_Selected_Fade_Length_", this.selectedFadeLength), this._activeEffect.setFloat("_Blob_Enable_", this.leftBlobEnable ? 1 : 0), this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity), this._activeEffect.setFloat("_Blob_Near_Size_", this.leftBlobNearSize), this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize), this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance), this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance), this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength), this._activeEffect.setFloat("_Blob_Inner_Fade_", this.leftBlobInnerFade), this._activeEffect.setFloat("_Blob_Pulse_", this.leftBlobPulse), this._activeEffect.setFloat("_Blob_Fade_", this.leftBlobFade), this._activeEffect.setFloat("_Blob_Enable_2_", this.rightBlobEnable ? 1 : 0), this._activeEffect.setFloat("_Blob_Near_Size_2_", this.rightBlobNearSize), this._activeEffect.setFloat("_Blob_Inner_Fade_2_", this.rightBlobInnerFade), this._activeEffect.setFloat("_Blob_Pulse_2_", this.rightBlobPulse), this._activeEffect.setFloat("_Blob_Fade_2_", this.rightBlobFade), this._activeEffect.setVector3("_Active_Face_Dir_", this.activeFaceDir), this._activeEffect.setVector3("_Active_Face_Up_", this.activeFaceUp), this._activeEffect.setFloat("_Fade_Width_", this.fadeWidth), this._activeEffect.setFloat("_Smooth_Active_Face_", this.smoothActiveFace ? 1 : 0), this._activeEffect.setFloat("_Show_Frame_", this.showFrame ? 1 : 0), this._activeEffect.setFloat("_Use_Blob_Texture_", this.useBlobTexture ? 1 : 0), this._activeEffect.setFloat("Use_Global_Left_Index", 1), this._activeEffect.setFloat("Use_Global_Right_Index", 1), this._activeEffect.setVector4("Global_Left_Index_Tip_Position", new Ir(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1)), this._activeEffect.setVector4("Global_Right_Index_Tip_Position", new Ir(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1)), this._afterBind(t, this._activeEffect));
  }
  /**
   * Get the list of animatables in the material.
   * @returns the list of animatables object used in the material
   */
  getAnimatables() {
    return [];
  }
  dispose(e) {
    super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new Os(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.FluentButtonMaterial", e;
  }
  getClassName() {
    return "FluentButtonMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new Os(e.name, t), e, t, r);
  }
}
Os.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-button-blob.png";
C([
  M()
], Os.prototype, "edgeWidth", void 0);
C([
  rU()
], Os.prototype, "edgeColor", void 0);
C([
  M()
], Os.prototype, "proximityMaxIntensity", void 0);
C([
  M()
], Os.prototype, "proximityFarDistance", void 0);
C([
  M()
], Os.prototype, "proximityNearRadius", void 0);
C([
  M()
], Os.prototype, "proximityAnisotropy", void 0);
C([
  M()
], Os.prototype, "selectionFuzz", void 0);
C([
  M()
], Os.prototype, "selected", void 0);
C([
  M()
], Os.prototype, "selectionFade", void 0);
C([
  M()
], Os.prototype, "selectionFadeSize", void 0);
C([
  M()
], Os.prototype, "selectedDistance", void 0);
C([
  M()
], Os.prototype, "selectedFadeLength", void 0);
C([
  M()
], Os.prototype, "blobIntensity", void 0);
C([
  M()
], Os.prototype, "blobFarSize", void 0);
C([
  M()
], Os.prototype, "blobNearDistance", void 0);
C([
  M()
], Os.prototype, "blobFarDistance", void 0);
C([
  M()
], Os.prototype, "blobFadeLength", void 0);
C([
  M()
], Os.prototype, "leftBlobEnable", void 0);
C([
  M()
], Os.prototype, "leftBlobNearSize", void 0);
C([
  M()
], Os.prototype, "leftBlobPulse", void 0);
C([
  M()
], Os.prototype, "leftBlobFade", void 0);
C([
  M()
], Os.prototype, "leftBlobInnerFade", void 0);
C([
  M()
], Os.prototype, "rightBlobEnable", void 0);
C([
  M()
], Os.prototype, "rightBlobNearSize", void 0);
C([
  M()
], Os.prototype, "rightBlobPulse", void 0);
C([
  M()
], Os.prototype, "rightBlobFade", void 0);
C([
  M()
], Os.prototype, "rightBlobInnerFade", void 0);
C([
  fo()
], Os.prototype, "activeFaceDir", void 0);
C([
  fo()
], Os.prototype, "activeFaceUp", void 0);
C([
  M()
], Os.prototype, "enableFade", void 0);
C([
  M()
], Os.prototype, "fadeWidth", void 0);
C([
  M()
], Os.prototype, "smoothActiveFace", void 0);
C([
  M()
], Os.prototype, "showFrame", void 0);
C([
  M()
], Os.prototype, "useBlobTexture", void 0);
C([
  fo()
], Os.prototype, "globalLeftIndexTipPosition", void 0);
C([
  fo()
], Os.prototype, "globalRightIndexTipPosition", void 0);
Ue("BABYLON.GUI.FluentButtonMaterial", Os);
const Kwe = "handleVertexShader", Jwe = "precision highp float;attribute vec3 position;uniform vec3 positionOffset;uniform mat4 worldViewProjection;uniform float scale;void main(void) {vec4 vPos=vec4((vec3(position)+positionOffset)*scale,1.0);gl_Position=worldViewProjection*vPos;}";
Le.ShadersStore[Kwe] = Jwe;
const zwe = "handlePixelShader", Gwe = "uniform vec3 color;void main(void) {gl_FragColor=vec4(color,1.0);}";
Le.ShadersStore[zwe] = Gwe;
var a$;
(function(A) {
  A[A.IDLE = 0] = "IDLE", A[A.HOVER = 1] = "HOVER", A[A.DRAG = 2] = "DRAG";
})(a$ || (a$ = {}));
const Zwe = "mrdlSliderBarPixelShader", _we = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B30(
sampler2D Blob_Texture,
vec4 Blob_Info1,
vec4 Blob_Info2,
out vec4 Blob_Color)
{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k1<k2 ? vec3(k1,Blob_Info1.z,Blob_Info1.w) : vec3(k2,Blob_Info2.z,Blob_Info2.w);Blob_Color=closer.z*texture(Blob_Texture,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);}
void FastLinearTosRGB_B42(
vec4 Linear,
out vec4 sRGB)
{sRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));sRGB.a=Linear.a;}
void Scale_RGB_B59(
vec4 Color,
float Scalar,
out vec4 Result)
{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}
void Fragment_Main_B121(
float Sun_Intensity,
float Sun_Theta,
float Sun_Phi,
vec3 Normal,
vec4 Albedo,
float Fresnel_Reflect,
float Shininess,
vec3 Incident,
vec4 Horizon_Color,
vec4 Sky_Color,
vec4 Ground_Color,
float Indirect_Diffuse,
float Specular,
float Horizon_Power,
float Reflection,
vec4 Reflection_Sample,
vec4 Indirect_Sample,
float Sharpness,
float SSS,
float Subsurface,
vec4 Translucence,
vec4 Rim_Light,
vec4 Iridescence,
out vec4 Result)
{float theta=Sun_Theta*2.0*3.14159;float phi=Sun_Phi*3.14159;vec3 lightDir= vec3(cos(phi)*cos(theta),sin(phi),cos(phi)*sin(theta));float NdotL=max(dot(lightDir,Normal),0.0);vec3 R=reflect(Incident,Normal);float RdotL=max(0.0,dot(R,lightDir));float specular=pow(RdotL,Shininess);specular=mix(specular,smoothstep(0.495*Sharpness,1.0-0.495*Sharpness,specular),Sharpness);vec4 gi=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);Result=((Sun_Intensity*NdotL+Indirect_Sample*Indirect_Diffuse+Translucence)*(1.0+SSS*Subsurface))*Albedo*(1.0-Fresnel_Reflect)+(Sun_Intensity*specular*Specular+Fresnel_Reflect*Reflection*Reflection_Sample)+Fresnel_Reflect*Rim_Light+Iridescence;}
void Bulge_B79(
bool Enabled,
vec3 Normal,
vec3 Tangent,
float Bulge_Height,
vec4 UV,
float Bulge_Radius,
vec3 ButtonN,
out vec3 New_Normal)
{vec2 xy=clamp(UV.xy*2.0,vec2(-1,-1),vec2(1,1));vec3 B=(cross(Normal,Tangent));float k=-clamp(1.0-length(xy)/Bulge_Radius,0.0,1.0)*Bulge_Height;k=sin(k*3.14159*0.5);k*=smoothstep(0.9998,0.9999,abs(dot(ButtonN,Normal)));New_Normal=Normal*sqrt(1.0-k*k)+(xy.x*Tangent+xy.y*B)*k;New_Normal=Enabled ? New_Normal : Normal;}
void SSS_B77(
vec3 ButtonN,
vec3 Normal,
vec3 Incident,
out float Result)
{float NdotI=abs(dot(Normal,Incident));float BdotI=abs(dot(ButtonN,Incident));Result=(abs(NdotI-BdotI)); }
void FingerOcclusion_B67(
float Width,
float DistToCenter,
float Fuzz,
float Min_Fuzz,
vec3 Position,
vec3 Forward,
vec3 Nearest,
float Fade_Out,
out float NotInShadow)
{float d=dot((Nearest-Position),Forward);float sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);NotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);}
void FingerOcclusion_B68(
float Width,
float DistToCenter,
float Fuzz,
float Min_Fuzz,
vec3 Position,
vec3 Forward,
vec3 Nearest,
float Fade_Out,
out float NotInShadow)
{float d=dot((Nearest-Position),Forward);float sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);NotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);}
void Scale_Color_B91(
vec4 Color,
float Scalar,
out vec4 Result)
{Result=Scalar*Color;}
void From_HSV_B73(
float Hue,
float Saturation,
float Value,
float Alpha,
out vec4 Color)
{vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);vec3 p=abs(fract(vec3(Hue,Hue,Hue)+K.xyz)*6.0-K.www);Color.rgb=Value*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),Saturation);Color.a=Alpha;}
void Fast_Fresnel_B122(
float Front_Reflect,
float Edge_Reflect,
float Power,
vec3 Normal,
vec3 Incident,
out float Transmit,
out float Reflect)
{float d=max(-dot(Incident,Normal),0.0);Reflect=Front_Reflect+(Edge_Reflect-Front_Reflect)*pow(.01-d,Power);Transmit=1.0-Reflect;}
void Mapped_Environment_B51(
sampler2D Reflected_Environment,
sampler2D Indirect_Environment,
vec3 Dir,
out vec4 Reflected_Color,
out vec4 Indirect_Diffuse)
{Reflected_Color=texture(Reflected_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));Indirect_Diffuse=texture(Indirect_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));}
vec4 SampleEnv_Bid50(vec3 D,vec4 S,vec4 H,vec4 G,float exponent)
{float k=pow(abs(D.y),exponent);vec4 C;if (D.y>0.0) {C=mix(H,S,k);} else {C=mix(H,G,k); }
return C;}
void Sky_Environment_B50(
vec3 Normal,
vec3 Reflected,
vec4 Sky_Color,
vec4 Horizon_Color,
vec4 Ground_Color,
float Horizon_Power,
out vec4 Reflected_Color,
out vec4 Indirect_Color)
{Reflected_Color=SampleEnv_Bid50(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);}
void Min_Segment_Distance_B65(
vec3 P0,
vec3 P1,
vec3 Q0,
vec3 Q1,
out vec3 NearP,
out vec3 NearQ,
out float Distance)
{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}}
if (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}}
sc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);}
void To_XYZ_B74(
vec3 Vec3,
out float X,
out float Y,
out float Z)
{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}
void Finger_Positions_B64(
vec3 Left_Index_Pos,
vec3 Right_Index_Pos,
vec3 Left_Index_Middle_Pos,
vec3 Right_Index_Middle_Pos,
out vec3 Left_Index,
out vec3 Right_Index,
out vec3 Left_Index_Middle,
out vec3 Right_Index_Middle)
{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);}
void VaryHSV_B108(
vec3 HSV_In,
float Hue_Shift,
float Saturation_Shift,
float Value_Shift,
out vec3 HSV_Out)
{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));}
void Remap_Range_B114(
float In_Min,
float In_Max,
float Out_Min,
float Out_Max,
float In,
out float Out)
{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}
void To_HSV_B75(
vec4 Color,
out float Hue,
out float Saturation,
out float Value,
out float Alpha,
out vec3 HSV)
{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g<Color.b ? vec4(Color.bg,K.wz) : vec4(Color.gb,K.xy);vec4 q=Color.r<p.x ? vec4(p.xyw,Color.r) : vec4(Color.r,p.yzx);float d=q.x-min(q.w,q.y);float e=1.0e-10;Hue=abs(q.z+(q.w-q.y)/(6.0*d+e));Saturation=d/(q.x+e);Value=q.x;Alpha=Color.a;HSV=vec3(Hue,Saturation,Value);}
void Code_B110(
float X,
out float Result)
{Result=(acos(X)/3.14159-0.5)*2.0;}
void Rim_Light_B132(
vec3 Front,
vec3 Normal,
vec3 Incident,
float Rim_Intensity,
sampler2D Texture,
out vec4 Result)
{vec3 R=reflect(Incident,Normal);float RdotF=dot(R,Front);float RdotL=sqrt(1.0-RdotF*RdotF);vec2 UV=vec2(R.y*0.5+0.5,0.5);vec4 Color=texture(Texture,UV);Result=Color;}
void main()
{vec4 Blob_Color_Q30;
#if BLOB_ENABLE
Blob_Fragment_B30(_Blob_Texture_,vExtra2,vExtra3,Blob_Color_Q30);
#else
Blob_Color_Q30=vec4(0,0,0,0);
#endif
vec3 Incident_Q39=normalize(vPosition-cameraPosition);vec3 Normalized_Q38=normalize(vNormal);vec3 Normalized_Q71=normalize(vTangent);vec4 Color_Q83;
#if DECAL_ENABLE
Color_Q83=texture(_Decal_,vUV);
#else
Color_Q83=vec4(0,0,0,0);
#endif
float X_Q90;float Y_Q90;float Z_Q90;float W_Q90;X_Q90=vExtra1.x;Y_Q90=vExtra1.y;Z_Q90=vExtra1.z;W_Q90=vExtra1.w;vec4 Linear_Q43;Linear_Q43.rgb=clamp(_Sky_Color_.rgb*_Sky_Color_.rgb,0.0,1.0);Linear_Q43.a=_Sky_Color_.a;vec4 Linear_Q44;Linear_Q44.rgb=clamp(_Horizon_Color_.rgb*_Horizon_Color_.rgb,0.0,1.0);Linear_Q44.a=_Horizon_Color_.a;vec4 Linear_Q45;Linear_Q45.rgb=clamp(_Ground_Color_.rgb*_Ground_Color_.rgb,0.0,1.0);Linear_Q45.a=_Ground_Color_.a;vec3 Left_Index_Q64;vec3 Right_Index_Q64;vec3 Left_Index_Middle_Q64;vec3 Right_Index_Middle_Q64;Finger_Positions_B64(_Left_Index_Pos_,_Right_Index_Pos_,_Left_Index_Middle_Pos_,_Right_Index_Middle_Pos_,Left_Index_Q64,Right_Index_Q64,Left_Index_Middle_Q64,Right_Index_Middle_Q64);vec4 Linear_Q46;Linear_Q46.rgb=clamp(_Albedo_.rgb*_Albedo_.rgb,0.0,1.0);Linear_Q46.a=_Albedo_.a;vec3 Normalized_Q107=normalize(vBinormal);vec3 Incident_Q70=normalize(vPosition-cameraPosition);vec3 New_Normal_Q79;Bulge_B79(_Bulge_Enabled_,Normalized_Q38,Normalized_Q71,_Bulge_Height_,vColor,_Bulge_Radius_,vBinormal,New_Normal_Q79);float Result_Q77;SSS_B77(vBinormal,New_Normal_Q79,Incident_Q39,Result_Q77);vec4 Result_Q91;Scale_Color_B91(Color_Q83,X_Q90,Result_Q91);float Transmit_Q122;float Reflect_Q122;Fast_Fresnel_B122(_Front_Reflect_,_Edge_Reflect_,_Power_,New_Normal_Q79,Incident_Q39,Transmit_Q122,Reflect_Q122);float Product_Q125=Y_Q90*Y_Q90;vec3 NearP_Q65;vec3 NearQ_Q65;float Distance_Q65;Min_Segment_Distance_B65(Left_Index_Q64,Left_Index_Middle_Q64,vPosition,cameraPosition,NearP_Q65,NearQ_Q65,Distance_Q65);vec3 NearP_Q63;vec3 NearQ_Q63;float Distance_Q63;Min_Segment_Distance_B65(Right_Index_Q64,Right_Index_Middle_Q64,vPosition,cameraPosition,NearP_Q63,NearQ_Q63,Distance_Q63);vec3 Reflected_Q47=reflect(Incident_Q39,New_Normal_Q79);vec4 Product_Q103=Linear_Q46*vec4(1,1,1,1);vec4 Result_Q132;Rim_Light_B132(Normalized_Q107,Normalized_Q38,Incident_Q70,_Rim_Intensity_,_Rim_Texture_,Result_Q132);float Dot_Q72=dot(Incident_Q70, Normalized_Q71);float MaxAB_Q123=max(Reflect_Q122,Product_Q125);float NotInShadow_Q67;
#if OCCLUSION_ENABLED
FingerOcclusion_B67(_Width_,Distance_Q65,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q65,_Clip_Fade_,NotInShadow_Q67);
#else
NotInShadow_Q67=1.0;
#endif
float NotInShadow_Q68;
#if OCCLUSION_ENABLED
FingerOcclusion_B68(_Width_,Distance_Q63,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q63,_Clip_Fade_,NotInShadow_Q68);
#else
NotInShadow_Q68=1.0;
#endif
vec4 Reflected_Color_Q51;vec4 Indirect_Diffuse_Q51;
#if ENV_ENABLE
Mapped_Environment_B51(_Reflection_Map_,_Indirect_Environment_,Reflected_Q47,Reflected_Color_Q51,Indirect_Diffuse_Q51);
#else
Reflected_Color_Q51=vec4(0,0,0,1);Indirect_Diffuse_Q51=vec4(0,0,0,1);
#endif
vec4 Reflected_Color_Q50;vec4 Indirect_Color_Q50;
#if SKY_ENABLED
Sky_Environment_B50(New_Normal_Q79,Reflected_Q47,Linear_Q43,Linear_Q44,Linear_Q45,_Horizon_Power_,Reflected_Color_Q50,Indirect_Color_Q50);
#else
Reflected_Color_Q50=vec4(0,0,0,1);Indirect_Color_Q50=vec4(0,0,0,1);
#endif
float Hue_Q75;float Saturation_Q75;float Value_Q75;float Alpha_Q75;vec3 HSV_Q75;To_HSV_B75(Product_Q103,Hue_Q75,Saturation_Q75,Value_Q75,Alpha_Q75,HSV_Q75);float Hue_Q127;float Saturation_Q127;float Value_Q127;float Alpha_Q127;vec3 HSV_Q127;To_HSV_B75(Result_Q132,Hue_Q127,Saturation_Q127,Value_Q127,Alpha_Q127,HSV_Q127);float Result_Q110;Code_B110(Dot_Q72,Result_Q110);float AbsA_Q76=abs(Result_Q110);float MinAB_Q58=min(NotInShadow_Q67,NotInShadow_Q68);vec4 Sum_Q48=Reflected_Color_Q51+Reflected_Color_Q50;vec4 Sum_Q49=Indirect_Diffuse_Q51+Indirect_Color_Q50;vec3 HSV_Out_Q126;VaryHSV_B108(HSV_Q127,_Rim_Hue_Shift_,_Rim_Saturation_Shift_,_Rim_Value_Shift_,HSV_Out_Q126);float Out_Q114;Remap_Range_B114(-1.0,1.0,0.0,1.0,Result_Q110,Out_Q114);float Product_Q106;Product_Q106=AbsA_Q76*_Hue_Shift_;float X_Q128;float Y_Q128;float Z_Q128;To_XYZ_B74(HSV_Out_Q126,X_Q128,Y_Q128,Z_Q128);vec2 Vec2_Q112=vec2(Out_Q114,0.5);vec3 HSV_Out_Q108;VaryHSV_B108(HSV_Q75,Product_Q106,_Saturation_Shift_,_Value_Shift_,HSV_Out_Q108);vec4 Color_Q129;From_HSV_B73(X_Q128,Y_Q128,Z_Q128,0.0,Color_Q129);vec4 Color_Q111;
#if IRIDESCENCE_ENABLED
Color_Q111=texture(_Iridescence_Texture_,Vec2_Q112);
#else
Color_Q111=vec4(0,0,0,0);
#endif
float X_Q74;float Y_Q74;float Z_Q74;To_XYZ_B74(HSV_Out_Q108,X_Q74,Y_Q74,Z_Q74);vec4 Result_Q131=_Rim_Intensity_*Color_Q129;vec4 Result_Q113=_Iridescence_Intensity_*Color_Q111;vec4 Color_Q73;From_HSV_B73(X_Q74,Y_Q74,Z_Q74,0.0,Color_Q73);vec4 Result_Q84=Result_Q91+(1.0-Result_Q91.a)*Color_Q73;vec4 Result_Q121;Fragment_Main_B121(_Sun_Intensity_,_Sun_Theta_,_Sun_Phi_,New_Normal_Q79,Result_Q84,MaxAB_Q123,_Shininess_,Incident_Q39,_Horizon_Color_,_Sky_Color_,_Ground_Color_,_Indirect_Diffuse_,_Specular_,_Horizon_Power_,_Reflection_,Sum_Q48,Sum_Q49,_Sharpness_,Result_Q77,_Subsurface_,vec4(0,0,0,0),Result_Q131,Result_Q113,Result_Q121);vec4 Result_Q59;Scale_RGB_B59(Result_Q121,MinAB_Q58,Result_Q59);vec4 sRGB_Q42;FastLinearTosRGB_B42(Result_Q59,sRGB_Q42);vec4 Result_Q31=Blob_Color_Q30+(1.0-Blob_Color_Q30.a)*sRGB_Q42;vec4 Result_Q40=Result_Q31; Result_Q40.a=1.0;vec4 Out_Color=Result_Q40;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}`;
Le.ShadersStore[Zwe] = _we;
const $we = "mrdlSliderBarVertexShader", eme = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;
#ifdef TANGENT
attribute vec3 tangent;
#else
const vec3 tangent=vec3(0.);
#endif
uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B12(
vec3 Pos_Object,
out vec3 Pos_World)
{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}
void Object_To_World_Normal_B32(
vec3 Nrm_Object,
out vec3 Nrm_World)
{Nrm_World=(vec4(Nrm_Object,0.0)).xyz;}
void Blob_Vertex_B23(
vec3 Position,
vec3 Normal,
vec3 Tangent,
vec3 Bitangent,
vec3 Blob_Position,
float Intensity,
float Blob_Near_Size,
float Blob_Far_Size,
float Blob_Near_Distance,
float Blob_Far_Distance,
float Blob_Fade_Length,
float Blob_Pulse,
float Blob_Fade,
out vec4 Blob_Info)
{vec3 blob= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);}
void Blob_Vertex_B24(
vec3 Position,
vec3 Normal,
vec3 Tangent,
vec3 Bitangent,
vec3 Blob_Position,
float Intensity,
float Blob_Near_Size,
float Blob_Far_Size,
float Blob_Near_Distance,
float Blob_Far_Distance,
float Blob_Fade_Length,
float Blob_Pulse,
float Blob_Fade,
out vec4 Blob_Info)
{vec3 blob= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);}
void Move_Verts_B130(
float Anisotropy,
vec3 P,
float Radius,
float Bevel,
vec3 Normal_Object,
float ScaleZ,
float Stretch,
out vec3 New_P,
out vec2 New_UV,
out float Radial_Gradient,
out vec3 Radial_Dir,
out vec3 New_Normal)
{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;float deltad=(length(delta)*2.0);float f=(Bevel+(Radius-Bevel)*Stretch)/Radius;float innerd=clamp(deltad*2.0,0.0,1.0);float outerd=clamp(deltad*2.0-1.0,0.0,1.0);float bevelAngle=outerd*3.14159*0.5;float sinb=sin(bevelAngle);float cosb=cos(bevelAngle);float beveld=(1.0-f)*innerd+f*sinb;float br=outerd;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);float dir=P.z<0.0001 ? 1.0 : -1.0;New_UV=center+r2*((0.5-center)+normalize(delta+vec2(0.0,0.000001))*beveld*0.5);New_P=vec3(New_UV-0.5,P.z+dir*(1.0-cosb)*Bevel*ScaleZ);Radial_Gradient=clamp((deltad-0.5)*2.0,0.0,1.0);Radial_Dir=vec3(delta*r2,0.0);vec3 beveledNormal=cosb*Normal_Object+sinb*vec3(delta.x,delta.y,0.0);New_Normal=Normal_Object.z==0.0 ? Normal_Object : beveledNormal;}
void Object_To_World_Dir_B60(
vec3 Dir_Object,
out vec3 Normal_World,
out vec3 Normal_World_N,
out float Normal_Length)
{Normal_World=(world*vec4(Dir_Object,0.0)).xyz;Normal_Length=length(Normal_World);Normal_World_N=Normal_World/Normal_Length;}
void To_XYZ_B78(
vec3 Vec3,
out float X,
out float Y,
out float Z)
{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}
void Conditional_Float_B93(
bool Which,
float If_True,
float If_False,
out float Result)
{Result=Which ? If_True : If_False;}
void Object_To_World_Dir_B28(
vec3 Dir_Object,
out vec3 Binormal_World,
out vec3 Binormal_World_N,
out float Binormal_Length)
{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;}
void Pick_Radius_B69(
float Radius,
float Radius_Top_Left,
float Radius_Top_Right,
float Radius_Bottom_Left,
float Radius_Bottom_Right,
vec3 Position,
out float Result)
{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}
void Conditional_Float_B36(
bool Which,
float If_True,
float If_False,
out float Result)
{Result=Which ? If_True : If_False;}
void Greater_Than_B37(
float Left,
float Right,
out bool Not_Greater_Than,
out bool Greater_Than)
{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;}
void Remap_Range_B105(
float In_Min,
float In_Max,
float Out_Min,
float Out_Max,
float In,
out float Out)
{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}
void main()
{vec2 XY_Q85;XY_Q85=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q27;vec3 Tangent_World_N_Q27;float Tangent_Length_Q27;Tangent_World_Q27=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q27=length(Tangent_World_Q27);Tangent_World_N_Q27=Tangent_World_Q27/Tangent_Length_Q27;vec3 Normal_World_Q60;vec3 Normal_World_N_Q60;float Normal_Length_Q60;Object_To_World_Dir_B60(vec3(0,0,1),Normal_World_Q60,Normal_World_N_Q60,Normal_Length_Q60);float X_Q78;float Y_Q78;float Z_Q78;To_XYZ_B78(position,X_Q78,Y_Q78,Z_Q78);vec3 Nrm_World_Q26;Nrm_World_Q26=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q28;vec3 Binormal_World_N_Q28;float Binormal_Length_Q28;Object_To_World_Dir_B28(vec3(0,1,0),Binormal_World_Q28,Binormal_World_N_Q28,Binormal_Length_Q28);float Anisotropy_Q29=Tangent_Length_Q27/Binormal_Length_Q28;float Result_Q69;Pick_Radius_B69(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q69);float Anisotropy_Q53=Binormal_Length_Q28/Normal_Length_Q60;bool Not_Greater_Than_Q37;bool Greater_Than_Q37;Greater_Than_B37(Z_Q78,0.0,Not_Greater_Than_Q37,Greater_Than_Q37);vec4 Linear_Q101;Linear_Q101.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q101.a=_Left_Color_.a;vec4 Linear_Q102;Linear_Q102.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q102.a=_Right_Color_.a;vec3 Difference_Q61=vec3(0,0,0)-Normal_World_N_Q60;vec4 Out_Color_Q34=vec4(X_Q78,Y_Q78,Z_Q78,1);float Result_Q36;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_,_Bevel_Front_,Result_Q36);float Result_Q94;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q94);vec3 New_P_Q130;vec2 New_UV_Q130;float Radial_Gradient_Q130;vec3 Radial_Dir_Q130;vec3 New_Normal_Q130;Move_Verts_B130(Anisotropy_Q29,position,Result_Q69,Result_Q36,normal,Anisotropy_Q53,Result_Q94,New_P_Q130,New_UV_Q130,Radial_Gradient_Q130,Radial_Dir_Q130,New_Normal_Q130);float X_Q98;float Y_Q98;X_Q98=New_UV_Q130.x;Y_Q98=New_UV_Q130.y;vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q130,Pos_World_Q12);vec3 Nrm_World_Q32;Object_To_World_Normal_B32(New_Normal_Q130,Nrm_World_Q32);vec4 Blob_Info_Q23;
#if BLOB_ENABLE
Blob_Vertex_B23(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q23);
#else
Blob_Info_Q23=vec4(0,0,0,0);
#endif
vec4 Blob_Info_Q24;
#if BLOB_ENABLE_2
Blob_Vertex_B24(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q24);
#else
Blob_Info_Q24=vec4(0,0,0,0);
#endif
float Out_Q105;Remap_Range_B105(0.0,1.0,0.0,1.0,X_Q98,Out_Q105);float X_Q86;float Y_Q86;float Z_Q86;To_XYZ_B78(Nrm_World_Q32,X_Q86,Y_Q86,Z_Q86);vec4 Color_At_T_Q97=mix(Linear_Q101,Linear_Q102,Out_Q105);float Minus_F_Q87=-Z_Q86;float R_Q99;float G_Q99;float B_Q99;float A_Q99;R_Q99=Color_At_T_Q97.r; G_Q99=Color_At_T_Q97.g; B_Q99=Color_At_T_Q97.b; A_Q99=Color_At_T_Q97.a;float ClampF_Q88=clamp(0.0,Minus_F_Q87,1.0);float Result_Q93;Conditional_Float_B93(_Decal_Front_Only_,ClampF_Q88,1.0,Result_Q93);vec4 Vec4_Q89=vec4(Result_Q93,Radial_Gradient_Q130,G_Q99,B_Q99);vec3 Position=Pos_World_Q12;vec3 Normal=Nrm_World_Q32;vec2 UV=XY_Q85;vec3 Tangent=Tangent_World_N_Q27;vec3 Binormal=Difference_Q61;vec4 Color=Out_Color_Q34;vec4 Extra1=Vec4_Q89;vec4 Extra2=Blob_Info_Q23;vec4 Extra3=Blob_Info_Q24;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`;
Le.ShadersStore[$we] = eme;
class tme extends na {
  constructor() {
    super(), this.SKY_ENABLED = !0, this.BLOB_ENABLE_2 = !0, this.IRIDESCENCE_ENABLED = !0, this._needNormals = !0, this._needUVs = !0, this.rebuild();
  }
}
class ni extends P1 {
  constructor(e, t) {
    super(e, t), this.radius = 0.6, this.bevelFront = 0.6, this.bevelFrontStretch = 0.077, this.bevelBack = 0, this.bevelBackStretch = 0, this.radiusTopLeft = 1, this.radiusTopRight = 1, this.radiusBottomLeft = 1, this.radiusBottomRight = 1, this.bulgeEnabled = !1, this.bulgeHeight = -0.323, this.bulgeRadius = 0.73, this.sunIntensity = 1.102, this.sunTheta = 0.76, this.sunPhi = 0.526, this.indirectDiffuse = 0.658, this.albedo = new xt(0.0117647, 0.505882, 0.996078, 1), this.specular = 0, this.shininess = 10, this.sharpness = 0, this.subsurface = 0, this.leftGradientColor = new xt(0.0117647, 0.505882, 0.996078, 1), this.rightGradientColor = new xt(0.0117647, 0.505882, 0.996078, 1), this.reflection = 0.749, this.frontReflect = 0, this.edgeReflect = 0.09, this.power = 8.13, this.skyColor = new xt(0.0117647, 0.964706, 0.996078, 1), this.horizonColor = new xt(0.0117647, 0.333333, 0.996078, 1), this.groundColor = new xt(0, 0.254902, 0.996078, 1), this.horizonPower = 1, this.width = 0.02, this.fuzz = 0.5, this.minFuzz = 1e-3, this.clipFade = 0.01, this.hueShift = 0, this.saturationShift = 0, this.valueShift = 0, this.blobPosition = new S(0, 0, 0.1), this.blobIntensity = 0.5, this.blobNearSize = 0.01, this.blobFarSize = 0.03, this.blobNearDistance = 0, this.blobFarDistance = 0.08, this.blobFadeLength = 0.576, this.blobPulse = 0, this.blobFade = 1, this.blobPosition2 = new S(0.2, 0, 0.1), this.blobNearSize2 = 0.01, this.blobPulse2 = 0, this.blobFade2 = 1, this.blobTexture = new We("", this.getScene()), this.leftIndexPosition = new S(0, 0, 1), this.rightIndexPosition = new S(-1, -1, -1), this.leftIndexMiddlePosition = new S(0, 0, 0), this.rightIndexMiddlePosition = new S(0, 0, 0), this.decalScaleXY = new at(1.5, 1.5), this.decalFrontOnly = !0, this.rimIntensity = 0.287, this.rimHueShift = 0, this.rimSaturationShift = 0, this.rimValueShift = -1, this.iridescenceIntensity = 0, this.useGlobalLeftIndex = 1, this.useGlobalRightIndex = 1, this.globalLeftIndexTipProximity = 0, this.globalRightIndexTipProximity = 0, this.globalLeftIndexTipPosition = new Ir(0.5, 0, -0.55, 1), this.globaRightIndexTipPosition = new Ir(0, 0, 0, 1), this.globalLeftThumbTipPosition = new Ir(0.5, 0, -0.55, 1), this.globalRightThumbTipPosition = new Ir(0, 0, 0, 1), this.globalLeftIndexMiddlePosition = new Ir(0.5, 0, -0.55, 1), this.globalRightIndexMiddlePosition = new Ir(0, 0, 0, 1), this.alphaMode = et.ALPHA_DISABLE, this.backFaceCulling = !1, this._blueGradientTexture = new We(ni.BLUE_GRADIENT_TEXTURE_URL, this.getScene(), !0, !1, We.NEAREST_SAMPLINGMODE), this._decalTexture = new We("", this.getScene()), this._reflectionMapTexture = new We("", this.getScene()), this._indirectEnvTexture = new We("", this.getScene());
  }
  needAlphaBlending() {
    return !1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady)
      return !0;
    t.materialDefines || (t.materialDefines = new tme());
    const r = t.materialDefines, n = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const i = n.getEngine();
    if (Ye.PrepareDefinesForAttributes(e, r, !1, !1), r.isDirty) {
      r.markAsProcessed(), n.resetCachedMaterial();
      const s = new c1();
      r.FOG && s.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(r, s), r.IMAGEPROCESSINGPOSTPROCESS = n.imageProcessingConfiguration.applyByPostProcess;
      const a = [J.PositionKind];
      r.NORMAL && a.push(J.NormalKind), r.UV1 && a.push(J.UVKind), r.UV2 && a.push(J.UV2Kind), r.VERTEXCOLOR && a.push(J.ColorKind), r.TANGENT && a.push(J.TangentKind), Ye.PrepareAttributesForInstances(a, r);
      const f = "mrdlSliderBar", o = r.toString(), d = [
        "world",
        "viewProjection",
        "cameraPosition",
        "_Radius_",
        "_Bevel_Front_",
        "_Bevel_Front_Stretch_",
        "_Bevel_Back_",
        "_Bevel_Back_Stretch_",
        "_Radius_Top_Left_",
        "_Radius_Top_Right_",
        "_Radius_Bottom_Left_",
        "_Radius_Bottom_Right_",
        "_Bulge_Enabled_",
        "_Bulge_Height_",
        "_Bulge_Radius_",
        "_Sun_Intensity_",
        "_Sun_Theta_",
        "_Sun_Phi_",
        "_Indirect_Diffuse_",
        "_Albedo_",
        "_Specular_",
        "_Shininess_",
        "_Sharpness_",
        "_Subsurface_",
        "_Left_Color_",
        "_Right_Color_",
        "_Reflection_",
        "_Front_Reflect_",
        "_Edge_Reflect_",
        "_Power_",
        "_Sky_Color_",
        "_Horizon_Color_",
        "_Ground_Color_",
        "_Horizon_Power_",
        "_Reflection_Map_",
        "_Indirect_Environment_",
        "_Width_",
        "_Fuzz_",
        "_Min_Fuzz_",
        "_Clip_Fade_",
        "_Hue_Shift_",
        "_Saturation_Shift_",
        "_Value_Shift_",
        "_Blob_Position_",
        "_Blob_Intensity_",
        "_Blob_Near_Size_",
        "_Blob_Far_Size_",
        "_Blob_Near_Distance_",
        "_Blob_Far_Distance_",
        "_Blob_Fade_Length_",
        "_Blob_Pulse_",
        "_Blob_Fade_",
        "_Blob_Texture_",
        "_Blob_Position_2_",
        "_Blob_Near_Size_2_",
        "_Blob_Pulse_2_",
        "_Blob_Fade_2_",
        "_Left_Index_Pos_",
        "_Right_Index_Pos_",
        "_Left_Index_Middle_Pos_",
        "_Right_Index_Middle_Pos_",
        "_Decal_",
        "_Decal_Scale_XY_",
        "_Decal_Front_Only_",
        "_Rim_Intensity_",
        "_Rim_Texture_",
        "_Rim_Hue_Shift_",
        "_Rim_Saturation_Shift_",
        "_Rim_Value_Shift_",
        "_Iridescence_Intensity_",
        "_Iridescence_Texture_",
        "Use_Global_Left_Index",
        "Use_Global_Right_Index",
        "Global_Left_Index_Tip_Position",
        "Global_Right_Index_Tip_Position",
        "Global_Left_Thumb_Tip_Position",
        "Global_Right_Thumb_Tip_Position",
        "Global_Left_Index_Middle_Position;",
        "Global_Right_Index_Middle_Position",
        "Global_Left_Index_Tip_Proximity",
        "Global_Right_Index_Tip_Proximity"
      ], v = ["_Rim_Texture_", "_Iridescence_Texture_"], u = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: r,
        maxSimultaneousLights: 4
      }), t.setEffect(n.getEngine().createEffect(f, {
        attributes: a,
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: o,
        fallbacks: s,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, i), r, this._materialContext);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (r._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, !0);
  }
  bindForSubMesh(e, t, r) {
    if (!r.materialDefines)
      return;
    const i = r.effect;
    i && (this._activeEffect = i, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()), this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position), this._activeEffect.setFloat("_Radius_", this.radius), this._activeEffect.setFloat("_Bevel_Front_", this.bevelFront), this._activeEffect.setFloat("_Bevel_Front_Stretch_", this.bevelFrontStretch), this._activeEffect.setFloat("_Bevel_Back_", this.bevelBack), this._activeEffect.setFloat("_Bevel_Back_Stretch_", this.bevelBackStretch), this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft), this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight), this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft), this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight), this._activeEffect.setFloat("_Bulge_Enabled_", this.bulgeEnabled ? 1 : 0), this._activeEffect.setFloat("_Bulge_Height_", this.bulgeHeight), this._activeEffect.setFloat("_Bulge_Radius_", this.bulgeRadius), this._activeEffect.setFloat("_Sun_Intensity_", this.sunIntensity), this._activeEffect.setFloat("_Sun_Theta_", this.sunTheta), this._activeEffect.setFloat("_Sun_Phi_", this.sunPhi), this._activeEffect.setFloat("_Indirect_Diffuse_", this.indirectDiffuse), this._activeEffect.setDirectColor4("_Albedo_", this.albedo), this._activeEffect.setFloat("_Specular_", this.specular), this._activeEffect.setFloat("_Shininess_", this.shininess), this._activeEffect.setFloat("_Sharpness_", this.sharpness), this._activeEffect.setFloat("_Subsurface_", this.subsurface), this._activeEffect.setDirectColor4("_Left_Color_", this.leftGradientColor), this._activeEffect.setDirectColor4("_Right_Color_", this.rightGradientColor), this._activeEffect.setFloat("_Reflection_", this.reflection), this._activeEffect.setFloat("_Front_Reflect_", this.frontReflect), this._activeEffect.setFloat("_Edge_Reflect_", this.edgeReflect), this._activeEffect.setFloat("_Power_", this.power), this._activeEffect.setDirectColor4("_Sky_Color_", this.skyColor), this._activeEffect.setDirectColor4("_Horizon_Color_", this.horizonColor), this._activeEffect.setDirectColor4("_Ground_Color_", this.groundColor), this._activeEffect.setFloat("_Horizon_Power_", this.horizonPower), this._activeEffect.setTexture("_Reflection_Map_", this._reflectionMapTexture), this._activeEffect.setTexture("_Indirect_Environment_", this._indirectEnvTexture), this._activeEffect.setFloat("_Width_", this.width), this._activeEffect.setFloat("_Fuzz_", this.fuzz), this._activeEffect.setFloat("_Min_Fuzz_", this.minFuzz), this._activeEffect.setFloat("_Clip_Fade_", this.clipFade), this._activeEffect.setFloat("_Hue_Shift_", this.hueShift), this._activeEffect.setFloat("_Saturation_Shift_", this.saturationShift), this._activeEffect.setFloat("_Value_Shift_", this.valueShift), this._activeEffect.setVector3("_Blob_Position_", this.blobPosition), this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity), this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize), this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize), this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance), this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance), this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength), this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse), this._activeEffect.setFloat("_Blob_Fade_", this.blobFade), this._activeEffect.setTexture("_Blob_Texture_", this.blobTexture), this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2), this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2), this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2), this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2), this._activeEffect.setVector3("_Left_Index_Pos_", this.leftIndexPosition), this._activeEffect.setVector3("_Right_Index_Pos_", this.rightIndexPosition), this._activeEffect.setVector3("_Left_Index_Middle_Pos_", this.leftIndexMiddlePosition), this._activeEffect.setVector3("_Right_Index_Middle_Pos_", this.rightIndexMiddlePosition), this._activeEffect.setTexture("_Decal_", this._decalTexture), this._activeEffect.setVector2("_Decal_Scale_XY_", this.decalScaleXY), this._activeEffect.setFloat("_Decal_Front_Only_", this.decalFrontOnly ? 1 : 0), this._activeEffect.setFloat("_Rim_Intensity_", this.rimIntensity), this._activeEffect.setTexture("_Rim_Texture_", this._blueGradientTexture), this._activeEffect.setFloat("_Rim_Hue_Shift_", this.rimHueShift), this._activeEffect.setFloat("_Rim_Saturation_Shift_", this.rimSaturationShift), this._activeEffect.setFloat("_Rim_Value_Shift_", this.rimValueShift), this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity), this._activeEffect.setTexture("_Iridescence_Texture_", this._blueGradientTexture), this._activeEffect.setFloat("Use_Global_Left_Index", this.useGlobalLeftIndex), this._activeEffect.setFloat("Use_Global_Right_Index", this.useGlobalRightIndex), this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this.globalLeftIndexTipPosition), this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this.globaRightIndexTipPosition), this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position", this.globalLeftThumbTipPosition), this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position", this.globalRightThumbTipPosition), this._activeEffect.setVector4("Global_Left_Index_Middle_Position", this.globalLeftIndexMiddlePosition), this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition), this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity), this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity), this._afterBind(t, this._activeEffect));
  }
  /**
   * Get the list of animatables in the material.
   * @returns the list of animatables object used in the material
   */
  getAnimatables() {
    return [];
  }
  dispose(e) {
    super.dispose(e), this._reflectionMapTexture.dispose(), this._indirectEnvTexture.dispose(), this._blueGradientTexture.dispose(), this._decalTexture.dispose();
  }
  clone(e) {
    return jt.Clone(() => new ni(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.MRDLSliderBarMaterial", e;
  }
  getClassName() {
    return "MRDLSliderBarMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new ni(e.name, t), e, t, r);
  }
}
ni.BLUE_GRADIENT_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png";
C([
  M()
], ni.prototype, "radius", void 0);
C([
  M()
], ni.prototype, "bevelFront", void 0);
C([
  M()
], ni.prototype, "bevelFrontStretch", void 0);
C([
  M()
], ni.prototype, "bevelBack", void 0);
C([
  M()
], ni.prototype, "bevelBackStretch", void 0);
C([
  M()
], ni.prototype, "radiusTopLeft", void 0);
C([
  M()
], ni.prototype, "radiusTopRight", void 0);
C([
  M()
], ni.prototype, "radiusBottomLeft", void 0);
C([
  M()
], ni.prototype, "radiusBottomRight", void 0);
C([
  M()
], ni.prototype, "bulgeEnabled", void 0);
C([
  M()
], ni.prototype, "bulgeHeight", void 0);
C([
  M()
], ni.prototype, "bulgeRadius", void 0);
C([
  M()
], ni.prototype, "sunIntensity", void 0);
C([
  M()
], ni.prototype, "sunTheta", void 0);
C([
  M()
], ni.prototype, "sunPhi", void 0);
C([
  M()
], ni.prototype, "indirectDiffuse", void 0);
C([
  M()
], ni.prototype, "albedo", void 0);
C([
  M()
], ni.prototype, "specular", void 0);
C([
  M()
], ni.prototype, "shininess", void 0);
C([
  M()
], ni.prototype, "sharpness", void 0);
C([
  M()
], ni.prototype, "subsurface", void 0);
C([
  M()
], ni.prototype, "leftGradientColor", void 0);
C([
  M()
], ni.prototype, "rightGradientColor", void 0);
C([
  M()
], ni.prototype, "reflection", void 0);
C([
  M()
], ni.prototype, "frontReflect", void 0);
C([
  M()
], ni.prototype, "edgeReflect", void 0);
C([
  M()
], ni.prototype, "power", void 0);
C([
  M()
], ni.prototype, "skyColor", void 0);
C([
  M()
], ni.prototype, "horizonColor", void 0);
C([
  M()
], ni.prototype, "groundColor", void 0);
C([
  M()
], ni.prototype, "horizonPower", void 0);
C([
  M()
], ni.prototype, "width", void 0);
C([
  M()
], ni.prototype, "fuzz", void 0);
C([
  M()
], ni.prototype, "minFuzz", void 0);
C([
  M()
], ni.prototype, "clipFade", void 0);
C([
  M()
], ni.prototype, "hueShift", void 0);
C([
  M()
], ni.prototype, "saturationShift", void 0);
C([
  M()
], ni.prototype, "valueShift", void 0);
C([
  M()
], ni.prototype, "blobPosition", void 0);
C([
  M()
], ni.prototype, "blobIntensity", void 0);
C([
  M()
], ni.prototype, "blobNearSize", void 0);
C([
  M()
], ni.prototype, "blobFarSize", void 0);
C([
  M()
], ni.prototype, "blobNearDistance", void 0);
C([
  M()
], ni.prototype, "blobFarDistance", void 0);
C([
  M()
], ni.prototype, "blobFadeLength", void 0);
C([
  M()
], ni.prototype, "blobPulse", void 0);
C([
  M()
], ni.prototype, "blobFade", void 0);
C([
  M()
], ni.prototype, "blobPosition2", void 0);
C([
  M()
], ni.prototype, "blobNearSize2", void 0);
C([
  M()
], ni.prototype, "blobPulse2", void 0);
C([
  M()
], ni.prototype, "blobFade2", void 0);
C([
  M()
], ni.prototype, "blobTexture", void 0);
C([
  M()
], ni.prototype, "leftIndexPosition", void 0);
C([
  M()
], ni.prototype, "rightIndexPosition", void 0);
C([
  M()
], ni.prototype, "leftIndexMiddlePosition", void 0);
C([
  M()
], ni.prototype, "rightIndexMiddlePosition", void 0);
C([
  M()
], ni.prototype, "decalScaleXY", void 0);
C([
  M()
], ni.prototype, "decalFrontOnly", void 0);
C([
  M()
], ni.prototype, "rimIntensity", void 0);
C([
  M()
], ni.prototype, "rimHueShift", void 0);
C([
  M()
], ni.prototype, "rimSaturationShift", void 0);
C([
  M()
], ni.prototype, "rimValueShift", void 0);
C([
  M()
], ni.prototype, "iridescenceIntensity", void 0);
Ue("BABYLON.GUI.MRDLSliderBarMaterial", ni);
const rme = "mrdlSliderThumbPixelShader", nme = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B180(
sampler2D Blob_Texture,
vec4 Blob_Info1,
vec4 Blob_Info2,
out vec4 Blob_Color)
{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k1<k2 ? vec3(k1,Blob_Info1.z,Blob_Info1.w) : vec3(k2,Blob_Info2.z,Blob_Info2.w);Blob_Color=closer.z*texture(Blob_Texture,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);}
void FastLinearTosRGB_B192(
vec4 Linear,
out vec4 sRGB)
{sRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));sRGB.a=Linear.a;}
void Scale_RGB_B209(
vec4 Color,
float Scalar,
out vec4 Result)
{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}
void Fragment_Main_B271(
float Sun_Intensity,
float Sun_Theta,
float Sun_Phi,
vec3 Normal,
vec4 Albedo,
float Fresnel_Reflect,
float Shininess,
vec3 Incident,
vec4 Horizon_Color,
vec4 Sky_Color,
vec4 Ground_Color,
float Indirect_Diffuse,
float Specular,
float Horizon_Power,
float Reflection,
vec4 Reflection_Sample,
vec4 Indirect_Sample,
float Sharpness,
float SSS,
float Subsurface,
vec4 Translucence,
vec4 Rim_Light,
vec4 Iridescence,
out vec4 Result)
{float theta=Sun_Theta*2.0*3.14159;float phi=Sun_Phi*3.14159;vec3 lightDir= vec3(cos(phi)*cos(theta),sin(phi),cos(phi)*sin(theta));float NdotL=max(dot(lightDir,Normal),0.0);vec3 R=reflect(Incident,Normal);float RdotL=max(0.0,dot(R,lightDir));float specular=pow(RdotL,Shininess);specular=mix(specular,smoothstep(0.495*Sharpness,1.0-0.495*Sharpness,specular),Sharpness);vec4 gi=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);Result=((Sun_Intensity*NdotL+Indirect_Sample*Indirect_Diffuse+Translucence)*(1.0+SSS*Subsurface))*Albedo*(1.0-Fresnel_Reflect)+(Sun_Intensity*specular*Specular+Fresnel_Reflect*Reflection*Reflection_Sample)+Fresnel_Reflect*Rim_Light+Iridescence;}
void Bulge_B229(
bool Enabled,
vec3 Normal,
vec3 Tangent,
float Bulge_Height,
vec4 UV,
float Bulge_Radius,
vec3 ButtonN,
out vec3 New_Normal)
{vec2 xy=clamp(UV.xy*2.0,vec2(-1,-1),vec2(1,1));vec3 B=(cross(Normal,Tangent));float k=-clamp(1.0-length(xy)/Bulge_Radius,0.0,1.0)*Bulge_Height;k=sin(k*3.14159*0.5);k*=smoothstep(0.9998,0.9999,abs(dot(ButtonN,Normal)));New_Normal=Normal*sqrt(1.0-k*k)+(xy.x*Tangent+xy.y*B)*k;New_Normal=Enabled ? New_Normal : Normal;}
void SSS_B227(
vec3 ButtonN,
vec3 Normal,
vec3 Incident,
out float Result)
{float NdotI=abs(dot(Normal,Incident));float BdotI=abs(dot(ButtonN,Incident));Result=(abs(NdotI-BdotI)); }
void FingerOcclusion_B217(
float Width,
float DistToCenter,
float Fuzz,
float Min_Fuzz,
vec3 Position,
vec3 Forward,
vec3 Nearest,
float Fade_Out,
out float NotInShadow)
{float d=dot((Nearest-Position),Forward);float sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);NotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);}
void FingerOcclusion_B218(
float Width,
float DistToCenter,
float Fuzz,
float Min_Fuzz,
vec3 Position,
vec3 Forward,
vec3 Nearest,
float Fade_Out,
out float NotInShadow)
{float d=dot((Nearest-Position),Forward);float sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);NotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);}
void Scale_Color_B241(
vec4 Color,
float Scalar,
out vec4 Result)
{Result=Scalar*Color;}
void From_HSV_B223(
float Hue,
float Saturation,
float Value,
float Alpha,
out vec4 Color)
{vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);vec3 p=abs(fract(vec3(Hue,Hue,Hue)+K.xyz)*6.0-K.www);Color.rgb=Value*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),Saturation);Color.a=Alpha;}
void Fast_Fresnel_B272(
float Front_Reflect,
float Edge_Reflect,
float Power,
vec3 Normal,
vec3 Incident,
out float Transmit,
out float Reflect)
{float d=max(-dot(Incident,Normal),0.0);Reflect=Front_Reflect+(Edge_Reflect-Front_Reflect)*pow(1.0-d,Power);Transmit=1.0-Reflect;}
void Mapped_Environment_B201(
sampler2D Reflected_Environment,
sampler2D Indirect_Environment,
vec3 Dir,
out vec4 Reflected_Color,
out vec4 Indirect_Diffuse)
{Reflected_Color=texture(Reflected_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));Indirect_Diffuse=texture(Indirect_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));}
vec4 SampleEnv_Bid200(vec3 D,vec4 S,vec4 H,vec4 G,float exponent)
{float k=pow(abs(D.y),exponent);vec4 C;if (D.y>0.0) {C=mix(H,S,k);} else {C=mix(H,G,k); }
return C;}
void Sky_Environment_B200(
vec3 Normal,
vec3 Reflected,
vec4 Sky_Color,
vec4 Horizon_Color,
vec4 Ground_Color,
float Horizon_Power,
out vec4 Reflected_Color,
out vec4 Indirect_Color)
{Reflected_Color=SampleEnv_Bid200(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);}
void Min_Segment_Distance_B215(
vec3 P0,
vec3 P1,
vec3 Q0,
vec3 Q1,
out vec3 NearP,
out vec3 NearQ,
out float Distance)
{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}}
if (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}}
sc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);}
void To_XYZ_B224(
vec3 Vec3,
out float X,
out float Y,
out float Z)
{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}
void Finger_Positions_B214(
vec3 Left_Index_Pos,
vec3 Right_Index_Pos,
vec3 Left_Index_Middle_Pos,
vec3 Right_Index_Middle_Pos,
out vec3 Left_Index,
out vec3 Right_Index,
out vec3 Left_Index_Middle,
out vec3 Right_Index_Middle)
{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);}
void VaryHSV_B258(
vec3 HSV_In,
float Hue_Shift,
float Saturation_Shift,
float Value_Shift,
out vec3 HSV_Out)
{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));}
void Remap_Range_B264(
float In_Min,
float In_Max,
float Out_Min,
float Out_Max,
float In,
out float Out)
{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}
void To_HSV_B225(
vec4 Color,
out float Hue,
out float Saturation,
out float Value,
out float Alpha,
out vec3 HSV)
{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g<Color.b ? vec4(Color.bg,K.wz) : vec4(Color.gb,K.xy);vec4 q=Color.r<p.x ? vec4(p.xyw,Color.r) : vec4(Color.r,p.yzx);float d=q.x-min(q.w,q.y);float e=1.0e-10;Hue=abs(q.z+(q.w-q.y)/(6.0*d+e));Saturation=d/(q.x+e);Value=q.x;Alpha=Color.a;HSV=vec3(Hue,Saturation,Value);}
void Code_B260(
float X,
out float Result)
{Result=(acos(X)/3.14159-0.5)*2.0;}
void Rim_Light_B282(
vec3 Front,
vec3 Normal,
vec3 Incident,
float Rim_Intensity,
sampler2D Texture,
out vec4 Result)
{vec3 R=reflect(Incident,Normal);float RdotF=dot(R,Front);float RdotL=sqrt(1.0-RdotF*RdotF);vec2 UV=vec2(R.y*0.5+0.5,0.5);vec4 Color=texture(Texture,UV);Result=Color;}
void main()
{vec4 Blob_Color_Q180;
#if BLOB_ENABLE
Blob_Fragment_B180(_Blob_Texture_,vExtra2,vExtra3,Blob_Color_Q180);
#else
Blob_Color_Q180=vec4(0,0,0,0);
#endif
vec3 Incident_Q189=normalize(vPosition-cameraPosition);vec3 Normalized_Q188=normalize(vNormal);vec3 Normalized_Q221=normalize(vTangent);vec4 Color_Q233;
#if DECAL_ENABLE
Color_Q233=texture(_Decal_,vUV);
#else
Color_Q233=vec4(0,0,0,0);
#endif
float X_Q240;float Y_Q240;float Z_Q240;float W_Q240;X_Q240=vExtra1.x;Y_Q240=vExtra1.y;Z_Q240=vExtra1.z;W_Q240=vExtra1.w;vec4 Linear_Q193;Linear_Q193.rgb=clamp(_Sky_Color_.rgb*_Sky_Color_.rgb,0.0,1.0);Linear_Q193.a=_Sky_Color_.a;vec4 Linear_Q194;Linear_Q194.rgb=clamp(_Horizon_Color_.rgb*_Horizon_Color_.rgb,0.0,1.0);Linear_Q194.a=_Horizon_Color_.a;vec4 Linear_Q195;Linear_Q195.rgb=clamp(_Ground_Color_.rgb*_Ground_Color_.rgb,0.0,1.0);Linear_Q195.a=_Ground_Color_.a;vec3 Left_Index_Q214;vec3 Right_Index_Q214;vec3 Left_Index_Middle_Q214;vec3 Right_Index_Middle_Q214;Finger_Positions_B214(_Left_Index_Pos_,_Right_Index_Pos_,_Left_Index_Middle_Pos_,_Right_Index_Middle_Pos_,Left_Index_Q214,Right_Index_Q214,Left_Index_Middle_Q214,Right_Index_Middle_Q214);vec4 Linear_Q196;Linear_Q196.rgb=clamp(_Albedo_.rgb*_Albedo_.rgb,0.0,1.0);Linear_Q196.a=_Albedo_.a;vec3 Normalized_Q257=normalize(vBinormal);vec3 Incident_Q220=normalize(vPosition-cameraPosition);vec3 New_Normal_Q229;Bulge_B229(_Bulge_Enabled_,Normalized_Q188,Normalized_Q221,_Bulge_Height_,vColor,_Bulge_Radius_,vBinormal,New_Normal_Q229);float Result_Q227;SSS_B227(vBinormal,New_Normal_Q229,Incident_Q189,Result_Q227);vec4 Result_Q241;Scale_Color_B241(Color_Q233,X_Q240,Result_Q241);float Transmit_Q272;float Reflect_Q272;Fast_Fresnel_B272(_Front_Reflect_,_Edge_Reflect_,_Power_,New_Normal_Q229,Incident_Q189,Transmit_Q272,Reflect_Q272);float Product_Q275=Y_Q240*Y_Q240;vec3 NearP_Q215;vec3 NearQ_Q215;float Distance_Q215;Min_Segment_Distance_B215(Left_Index_Q214,Left_Index_Middle_Q214,vPosition,cameraPosition,NearP_Q215,NearQ_Q215,Distance_Q215);vec3 NearP_Q213;vec3 NearQ_Q213;float Distance_Q213;Min_Segment_Distance_B215(Right_Index_Q214,Right_Index_Middle_Q214,vPosition,cameraPosition,NearP_Q213,NearQ_Q213,Distance_Q213);vec3 Reflected_Q197=reflect(Incident_Q189,New_Normal_Q229);vec4 Product_Q253=Linear_Q196*vec4(1,1,1,1);vec4 Result_Q282;Rim_Light_B282(Normalized_Q257,Normalized_Q188,Incident_Q220,_Rim_Intensity_,_Rim_Texture_,Result_Q282);float Dot_Q222=dot(Incident_Q220, Normalized_Q221);float MaxAB_Q273=max(Reflect_Q272,Product_Q275);float NotInShadow_Q217;
#if OCCLUSION_ENABLED
FingerOcclusion_B217(_Width_,Distance_Q215,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q215,_Clip_Fade_,NotInShadow_Q217);
#else
NotInShadow_Q217=1.0;
#endif
float NotInShadow_Q218;
#if OCCLUSION_ENABLED
FingerOcclusion_B218(_Width_,Distance_Q213,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q213,_Clip_Fade_,NotInShadow_Q218);
#else
NotInShadow_Q218=1.0;
#endif
vec4 Reflected_Color_Q201;vec4 Indirect_Diffuse_Q201;
#if ENV_ENABLE
Mapped_Environment_B201(_Reflection_Map_,_Indirect_Environment_,Reflected_Q197,Reflected_Color_Q201,Indirect_Diffuse_Q201);
#else
Reflected_Color_Q201=vec4(0,0,0,1);Indirect_Diffuse_Q201=vec4(0,0,0,1);
#endif
vec4 Reflected_Color_Q200;vec4 Indirect_Color_Q200;
#if SKY_ENABLED
Sky_Environment_B200(New_Normal_Q229,Reflected_Q197,Linear_Q193,Linear_Q194,Linear_Q195,_Horizon_Power_,Reflected_Color_Q200,Indirect_Color_Q200);
#else
Reflected_Color_Q200=vec4(0,0,0,1);Indirect_Color_Q200=vec4(0,0,0,1);
#endif
float Hue_Q225;float Saturation_Q225;float Value_Q225;float Alpha_Q225;vec3 HSV_Q225;To_HSV_B225(Product_Q253,Hue_Q225,Saturation_Q225,Value_Q225,Alpha_Q225,HSV_Q225);float Hue_Q277;float Saturation_Q277;float Value_Q277;float Alpha_Q277;vec3 HSV_Q277;To_HSV_B225(Result_Q282,Hue_Q277,Saturation_Q277,Value_Q277,Alpha_Q277,HSV_Q277);float Result_Q260;Code_B260(Dot_Q222,Result_Q260);float AbsA_Q226=abs(Result_Q260);float MinAB_Q208=min(NotInShadow_Q217,NotInShadow_Q218);vec4 Sum_Q198=Reflected_Color_Q201+Reflected_Color_Q200;vec4 Sum_Q199=Indirect_Diffuse_Q201+Indirect_Color_Q200;vec3 HSV_Out_Q276;VaryHSV_B258(HSV_Q277,_Rim_Hue_Shift_,_Rim_Saturation_Shift_,_Rim_Value_Shift_,HSV_Out_Q276);float Out_Q264;Remap_Range_B264(-1.0,1.0,0.0,1.0,Result_Q260,Out_Q264);float Product_Q256;Product_Q256=AbsA_Q226*_Hue_Shift_;float X_Q278;float Y_Q278;float Z_Q278;To_XYZ_B224(HSV_Out_Q276,X_Q278,Y_Q278,Z_Q278);vec2 Vec2_Q262=vec2(Out_Q264,0.5);vec3 HSV_Out_Q258;VaryHSV_B258(HSV_Q225,Product_Q256,_Saturation_Shift_,_Value_Shift_,HSV_Out_Q258);vec4 Color_Q279;From_HSV_B223(X_Q278,Y_Q278,Z_Q278,0.0,Color_Q279);vec4 Color_Q261;
#if IRIDESCENCE_ENABLED
Color_Q261=texture(_Iridescence_Texture_,Vec2_Q262);
#else
Color_Q261=vec4(0,0,0,0);
#endif
float X_Q224;float Y_Q224;float Z_Q224;To_XYZ_B224(HSV_Out_Q258,X_Q224,Y_Q224,Z_Q224);vec4 Result_Q281=_Rim_Intensity_*Color_Q279;vec4 Result_Q263=_Iridescence_Intensity_*Color_Q261;vec4 Color_Q223;From_HSV_B223(X_Q224,Y_Q224,Z_Q224,0.0,Color_Q223);vec4 Result_Q234=Result_Q241+(1.0-Result_Q241.a)*Color_Q223;vec4 Result_Q271;Fragment_Main_B271(_Sun_Intensity_,_Sun_Theta_,_Sun_Phi_,New_Normal_Q229,Result_Q234,MaxAB_Q273,_Shininess_,Incident_Q189,_Horizon_Color_,_Sky_Color_,_Ground_Color_,_Indirect_Diffuse_,_Specular_,_Horizon_Power_,_Reflection_,Sum_Q198,Sum_Q199,_Sharpness_,Result_Q227,_Subsurface_,vec4(0,0,0,0),Result_Q281,Result_Q263,Result_Q271);vec4 Result_Q209;Scale_RGB_B209(Result_Q271,MinAB_Q208,Result_Q209);vec4 sRGB_Q192;FastLinearTosRGB_B192(Result_Q209,sRGB_Q192);vec4 Result_Q181=Blob_Color_Q180+(1.0-Blob_Color_Q180.a)*sRGB_Q192;vec4 Result_Q190=Result_Q181; Result_Q190.a=1.0;vec4 Out_Color=Result_Q190;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}`;
Le.ShadersStore[rme] = nme;
const ime = "mrdlSliderThumbVertexShader", sme = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;
#ifdef TANGENT
attribute vec3 tangent;
#else
const vec3 tangent=vec3(0.);
#endif
uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B162(
vec3 Pos_Object,
out vec3 Pos_World)
{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}
void Object_To_World_Normal_B182(
vec3 Nrm_Object,
out vec3 Nrm_World)
{Nrm_World=(vec4(Nrm_Object,0.0)).xyz;}
void Blob_Vertex_B173(
vec3 Position,
vec3 Normal,
vec3 Tangent,
vec3 Bitangent,
vec3 Blob_Position,
float Intensity,
float Blob_Near_Size,
float Blob_Far_Size,
float Blob_Near_Distance,
float Blob_Far_Distance,
float Blob_Fade_Length,
float Blob_Pulse,
float Blob_Fade,
out vec4 Blob_Info)
{vec3 blob= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);}
void Blob_Vertex_B174(
vec3 Position,
vec3 Normal,
vec3 Tangent,
vec3 Bitangent,
vec3 Blob_Position,
float Intensity,
float Blob_Near_Size,
float Blob_Far_Size,
float Blob_Near_Distance,
float Blob_Far_Distance,
float Blob_Fade_Length,
float Blob_Pulse,
float Blob_Fade,
out vec4 Blob_Info)
{vec3 blob= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);}
void Move_Verts_B280(
float Anisotropy,
vec3 P,
float Radius,
float Bevel,
vec3 Normal_Object,
float ScaleZ,
float Stretch,
out vec3 New_P,
out vec2 New_UV,
out float Radial_Gradient,
out vec3 Radial_Dir,
out vec3 New_Normal)
{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;float deltad=(length(delta)*2.0);float f=(Bevel+(Radius-Bevel)*Stretch)/Radius;float innerd=clamp(deltad*2.0,0.0,1.0);float outerd=clamp(deltad*2.0-1.0,0.0,1.0);float bevelAngle=outerd*3.14159*0.5;float sinb=sin(bevelAngle);float cosb=cos(bevelAngle);float beveld=(1.0-f)*innerd+f*sinb;float br=outerd;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);float dir=P.z<0.0001 ? 1.0 : -1.0;New_UV=center+r2*((0.5-center)+normalize(delta+vec2(0.0,0.000001))*beveld*0.5);New_P=vec3(New_UV-0.5,P.z+dir*(1.0-cosb)*Bevel*ScaleZ);Radial_Gradient=clamp((deltad-0.5)*2.0,0.0,1.0);Radial_Dir=vec3(delta*r2,0.0);vec3 beveledNormal=cosb*Normal_Object+sinb*vec3(delta.x,delta.y,0.0);New_Normal=Normal_Object.z==0.0 ? Normal_Object : beveledNormal;}
void Object_To_World_Dir_B210(
vec3 Dir_Object,
out vec3 Normal_World,
out vec3 Normal_World_N,
out float Normal_Length)
{Normal_World=(world*vec4(Dir_Object,0.0)).xyz;Normal_Length=length(Normal_World);Normal_World_N=Normal_World/Normal_Length;}
void To_XYZ_B228(
vec3 Vec3,
out float X,
out float Y,
out float Z)
{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}
void Conditional_Float_B243(
bool Which,
float If_True,
float If_False,
out float Result)
{Result=Which ? If_True : If_False;}
void Object_To_World_Dir_B178(
vec3 Dir_Object,
out vec3 Binormal_World,
out vec3 Binormal_World_N,
out float Binormal_Length)
{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;}
void Pick_Radius_B219(
float Radius,
float Radius_Top_Left,
float Radius_Top_Right,
float Radius_Bottom_Left,
float Radius_Bottom_Right,
vec3 Position,
out float Result)
{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}
void Conditional_Float_B186(
bool Which,
float If_True,
float If_False,
out float Result)
{Result=Which ? If_True : If_False;}
void Greater_Than_B187(
float Left,
float Right,
out bool Not_Greater_Than,
out bool Greater_Than)
{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;}
void Remap_Range_B255(
float In_Min,
float In_Max,
float Out_Min,
float Out_Max,
float In,
out float Out)
{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}
void main()
{vec2 XY_Q235;XY_Q235=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q177;vec3 Tangent_World_N_Q177;float Tangent_Length_Q177;Tangent_World_Q177=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q177=length(Tangent_World_Q177);Tangent_World_N_Q177=Tangent_World_Q177/Tangent_Length_Q177;vec3 Normal_World_Q210;vec3 Normal_World_N_Q210;float Normal_Length_Q210;Object_To_World_Dir_B210(vec3(0,0,1),Normal_World_Q210,Normal_World_N_Q210,Normal_Length_Q210);float X_Q228;float Y_Q228;float Z_Q228;To_XYZ_B228(position,X_Q228,Y_Q228,Z_Q228);vec3 Nrm_World_Q176;Nrm_World_Q176=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q178;vec3 Binormal_World_N_Q178;float Binormal_Length_Q178;Object_To_World_Dir_B178(vec3(0,1,0),Binormal_World_Q178,Binormal_World_N_Q178,Binormal_Length_Q178);float Anisotropy_Q179=Tangent_Length_Q177/Binormal_Length_Q178;float Result_Q219;Pick_Radius_B219(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q219);float Anisotropy_Q203=Binormal_Length_Q178/Normal_Length_Q210;bool Not_Greater_Than_Q187;bool Greater_Than_Q187;Greater_Than_B187(Z_Q228,0.0,Not_Greater_Than_Q187,Greater_Than_Q187);vec4 Linear_Q251;Linear_Q251.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q251.a=_Left_Color_.a;vec4 Linear_Q252;Linear_Q252.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q252.a=_Right_Color_.a;vec3 Difference_Q211=vec3(0,0,0)-Normal_World_N_Q210;vec4 Out_Color_Q184=vec4(X_Q228,Y_Q228,Z_Q228,1);float Result_Q186;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_,_Bevel_Front_,Result_Q186);float Result_Q244;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q244);vec3 New_P_Q280;vec2 New_UV_Q280;float Radial_Gradient_Q280;vec3 Radial_Dir_Q280;vec3 New_Normal_Q280;Move_Verts_B280(Anisotropy_Q179,position,Result_Q219,Result_Q186,normal,Anisotropy_Q203,Result_Q244,New_P_Q280,New_UV_Q280,Radial_Gradient_Q280,Radial_Dir_Q280,New_Normal_Q280);float X_Q248;float Y_Q248;X_Q248=New_UV_Q280.x;Y_Q248=New_UV_Q280.y;vec3 Pos_World_Q162;Object_To_World_Pos_B162(New_P_Q280,Pos_World_Q162);vec3 Nrm_World_Q182;Object_To_World_Normal_B182(New_Normal_Q280,Nrm_World_Q182);vec4 Blob_Info_Q173;
#if BLOB_ENABLE
Blob_Vertex_B173(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q173);
#else
Blob_Info_Q173=vec4(0,0,0,0);
#endif
vec4 Blob_Info_Q174;
#if BLOB_ENABLE_2
Blob_Vertex_B174(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q174);
#else
Blob_Info_Q174=vec4(0,0,0,0);
#endif
float Out_Q255;Remap_Range_B255(0.0,1.0,0.0,1.0,X_Q248,Out_Q255);float X_Q236;float Y_Q236;float Z_Q236;To_XYZ_B228(Nrm_World_Q182,X_Q236,Y_Q236,Z_Q236);vec4 Color_At_T_Q247=mix(Linear_Q251,Linear_Q252,Out_Q255);float Minus_F_Q237=-Z_Q236;float R_Q249;float G_Q249;float B_Q249;float A_Q249;R_Q249=Color_At_T_Q247.r; G_Q249=Color_At_T_Q247.g; B_Q249=Color_At_T_Q247.b; A_Q249=Color_At_T_Q247.a;float ClampF_Q238=clamp(0.0,Minus_F_Q237,1.0);float Result_Q243;Conditional_Float_B243(_Decal_Front_Only_,ClampF_Q238,1.0,Result_Q243);vec4 Vec4_Q239=vec4(Result_Q243,Radial_Gradient_Q280,G_Q249,B_Q249);vec3 Position=Pos_World_Q162;vec3 Normal=Nrm_World_Q182;vec2 UV=XY_Q235;vec3 Tangent=Tangent_World_N_Q177;vec3 Binormal=Difference_Q211;vec4 Color=Out_Color_Q184;vec4 Extra1=Vec4_Q239;vec4 Extra2=Blob_Info_Q173;vec4 Extra3=Blob_Info_Q174;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`;
Le.ShadersStore[ime] = sme;
class ame extends na {
  constructor() {
    super(), this.SKY_ENABLED = !0, this.BLOB_ENABLE_2 = !0, this.IRIDESCENCE_ENABLED = !0, this._needNormals = !0, this._needUVs = !0, this.rebuild();
  }
}
class ii extends P1 {
  constructor(e, t) {
    super(e, t), this.radius = 0.157, this.bevelFront = 0.065, this.bevelFrontStretch = 0.077, this.bevelBack = 0.031, this.bevelBackStretch = 0, this.radiusTopLeft = 1, this.radiusTopRight = 1, this.radiusBottomLeft = 1, this.radiusBottomRight = 1, this.bulgeEnabled = !1, this.bulgeHeight = -0.323, this.bulgeRadius = 0.73, this.sunIntensity = 2, this.sunTheta = 0.937, this.sunPhi = 0.555, this.indirectDiffuse = 1, this.albedo = new xt(0.0117647, 0.505882, 0.996078, 1), this.specular = 0, this.shininess = 10, this.sharpness = 0, this.subsurface = 0.31, this.leftGradientColor = new xt(0.0117647, 0.505882, 0.996078, 1), this.rightGradientColor = new xt(0.0117647, 0.505882, 0.996078, 1), this.reflection = 0.749, this.frontReflect = 0, this.edgeReflect = 0.09, this.power = 8.1, this.skyColor = new xt(0.0117647, 0.960784, 0.996078, 1), this.horizonColor = new xt(0.0117647, 0.333333, 0.996078, 1), this.groundColor = new xt(0, 0.254902, 0.996078, 1), this.horizonPower = 1, this.width = 0.02, this.fuzz = 0.5, this.minFuzz = 1e-3, this.clipFade = 0.01, this.hueShift = 0, this.saturationShift = 0, this.valueShift = 0, this.blobPosition = new S(0, 0, 0.1), this.blobIntensity = 0.5, this.blobNearSize = 0.01, this.blobFarSize = 0.03, this.blobNearDistance = 0, this.blobFarDistance = 0.08, this.blobFadeLength = 0.576, this.blobPulse = 0, this.blobFade = 1, this.blobPosition2 = new S(0.2, 0, 0.1), this.blobNearSize2 = 0.01, this.blobPulse2 = 0, this.blobFade2 = 1, this.blobTexture = new We("", this.getScene()), this.leftIndexPosition = new S(0, 0, 1), this.rightIndexPosition = new S(-1, -1, -1), this.leftIndexMiddlePosition = new S(0, 0, 0), this.rightIndexMiddlePosition = new S(0, 0, 0), this.decalScaleXY = new at(1.5, 1.5), this.decalFrontOnly = !0, this.rimIntensity = 0.287, this.rimHueShift = 0, this.rimSaturationShift = 0, this.rimValueShift = -1, this.iridescenceIntensity = 0, this.useGlobalLeftIndex = 1, this.useGlobalRightIndex = 1, this.globalLeftIndexTipProximity = 0, this.globalRightIndexTipProximity = 0, this.globalLeftIndexTipPosition = new Ir(0.5, 0, -0.55, 1), this.globaRightIndexTipPosition = new Ir(0, 0, 0, 1), this.globalLeftThumbTipPosition = new Ir(0.5, 0, -0.55, 1), this.globalRightThumbTipPosition = new Ir(0, 0, 0, 1), this.globalLeftIndexMiddlePosition = new Ir(0.5, 0, -0.55, 1), this.globalRightIndexMiddlePosition = new Ir(0, 0, 0, 1), this.alphaMode = et.ALPHA_DISABLE, this.backFaceCulling = !1, this._blueGradientTexture = new We(ii.BLUE_GRADIENT_TEXTURE_URL, t, !0, !1, We.NEAREST_SAMPLINGMODE), this._decalTexture = new We("", this.getScene()), this._reflectionMapTexture = new We("", this.getScene()), this._indirectEnvTexture = new We("", this.getScene());
  }
  needAlphaBlending() {
    return !1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady)
      return !0;
    t.materialDefines || (t.materialDefines = new ame());
    const r = t.materialDefines, n = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const i = n.getEngine();
    if (Ye.PrepareDefinesForAttributes(e, r, !1, !1), r.isDirty) {
      r.markAsProcessed(), n.resetCachedMaterial();
      const s = new c1();
      r.FOG && s.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(r, s), r.IMAGEPROCESSINGPOSTPROCESS = n.imageProcessingConfiguration.applyByPostProcess;
      const a = [J.PositionKind];
      r.NORMAL && a.push(J.NormalKind), r.UV1 && a.push(J.UVKind), r.UV2 && a.push(J.UV2Kind), r.VERTEXCOLOR && a.push(J.ColorKind), r.TANGENT && a.push(J.TangentKind), Ye.PrepareAttributesForInstances(a, r);
      const f = "mrdlSliderThumb", o = r.toString(), d = [
        "world",
        "viewProjection",
        "cameraPosition",
        "_Radius_",
        "_Bevel_Front_",
        "_Bevel_Front_Stretch_",
        "_Bevel_Back_",
        "_Bevel_Back_Stretch_",
        "_Radius_Top_Left_",
        "_Radius_Top_Right_",
        "_Radius_Bottom_Left_",
        "_Radius_Bottom_Right_",
        "_Bulge_Enabled_",
        "_Bulge_Height_",
        "_Bulge_Radius_",
        "_Sun_Intensity_",
        "_Sun_Theta_",
        "_Sun_Phi_",
        "_Indirect_Diffuse_",
        "_Albedo_",
        "_Specular_",
        "_Shininess_",
        "_Sharpness_",
        "_Subsurface_",
        "_Left_Color_",
        "_Right_Color_",
        "_Reflection_",
        "_Front_Reflect_",
        "_Edge_Reflect_",
        "_Power_",
        "_Sky_Color_",
        "_Horizon_Color_",
        "_Ground_Color_",
        "_Horizon_Power_",
        "_Reflection_Map_",
        "_Indirect_Environment_",
        "_Width_",
        "_Fuzz_",
        "_Min_Fuzz_",
        "_Clip_Fade_",
        "_Hue_Shift_",
        "_Saturation_Shift_",
        "_Value_Shift_",
        "_Blob_Position_",
        "_Blob_Intensity_",
        "_Blob_Near_Size_",
        "_Blob_Far_Size_",
        "_Blob_Near_Distance_",
        "_Blob_Far_Distance_",
        "_Blob_Fade_Length_",
        "_Blob_Pulse_",
        "_Blob_Fade_",
        "_Blob_Texture_",
        "_Blob_Position_2_",
        "_Blob_Near_Size_2_",
        "_Blob_Pulse_2_",
        "_Blob_Fade_2_",
        "_Left_Index_Pos_",
        "_Right_Index_Pos_",
        "_Left_Index_Middle_Pos_",
        "_Right_Index_Middle_Pos_",
        "_Decal_",
        "_Decal_Scale_XY_",
        "_Decal_Front_Only_",
        "_Rim_Intensity_",
        "_Rim_Texture_",
        "_Rim_Hue_Shift_",
        "_Rim_Saturation_Shift_",
        "_Rim_Value_Shift_",
        "_Iridescence_Intensity_",
        "_Iridescence_Texture_",
        "Use_Global_Left_Index",
        "Use_Global_Right_Index",
        "Global_Left_Index_Tip_Position",
        "Global_Right_Index_Tip_Position",
        "Global_Left_Thumb_Tip_Position",
        "Global_Right_Thumb_Tip_Position",
        "Global_Left_Index_Middle_Position;",
        "Global_Right_Index_Middle_Position",
        "Global_Left_Index_Tip_Proximity",
        "Global_Right_Index_Tip_Proximity"
      ], v = ["_Rim_Texture_", "_Iridescence_Texture_"], u = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: r,
        maxSimultaneousLights: 4
      }), t.setEffect(n.getEngine().createEffect(f, {
        attributes: a,
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: o,
        fallbacks: s,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, i), r);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (r._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, !0);
  }
  bindForSubMesh(e, t, r) {
    if (!r.materialDefines)
      return;
    const i = r.effect;
    i && (this._activeEffect = i, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()), this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position), this._activeEffect.setFloat("_Radius_", this.radius), this._activeEffect.setFloat("_Bevel_Front_", this.bevelFront), this._activeEffect.setFloat("_Bevel_Front_Stretch_", this.bevelFrontStretch), this._activeEffect.setFloat("_Bevel_Back_", this.bevelBack), this._activeEffect.setFloat("_Bevel_Back_Stretch_", this.bevelBackStretch), this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft), this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight), this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft), this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight), this._activeEffect.setFloat("_Bulge_Enabled_", this.bulgeEnabled ? 1 : 0), this._activeEffect.setFloat("_Bulge_Height_", this.bulgeHeight), this._activeEffect.setFloat("_Bulge_Radius_", this.bulgeRadius), this._activeEffect.setFloat("_Sun_Intensity_", this.sunIntensity), this._activeEffect.setFloat("_Sun_Theta_", this.sunTheta), this._activeEffect.setFloat("_Sun_Phi_", this.sunPhi), this._activeEffect.setFloat("_Indirect_Diffuse_", this.indirectDiffuse), this._activeEffect.setDirectColor4("_Albedo_", this.albedo), this._activeEffect.setFloat("_Specular_", this.specular), this._activeEffect.setFloat("_Shininess_", this.shininess), this._activeEffect.setFloat("_Sharpness_", this.sharpness), this._activeEffect.setFloat("_Subsurface_", this.subsurface), this._activeEffect.setDirectColor4("_Left_Color_", this.leftGradientColor), this._activeEffect.setDirectColor4("_Right_Color_", this.rightGradientColor), this._activeEffect.setFloat("_Reflection_", this.reflection), this._activeEffect.setFloat("_Front_Reflect_", this.frontReflect), this._activeEffect.setFloat("_Edge_Reflect_", this.edgeReflect), this._activeEffect.setFloat("_Power_", this.power), this._activeEffect.setDirectColor4("_Sky_Color_", this.skyColor), this._activeEffect.setDirectColor4("_Horizon_Color_", this.horizonColor), this._activeEffect.setDirectColor4("_Ground_Color_", this.groundColor), this._activeEffect.setFloat("_Horizon_Power_", this.horizonPower), this._activeEffect.setTexture("_Reflection_Map_", this._reflectionMapTexture), this._activeEffect.setTexture("_Indirect_Environment_", this._indirectEnvTexture), this._activeEffect.setFloat("_Width_", this.width), this._activeEffect.setFloat("_Fuzz_", this.fuzz), this._activeEffect.setFloat("_Min_Fuzz_", this.minFuzz), this._activeEffect.setFloat("_Clip_Fade_", this.clipFade), this._activeEffect.setFloat("_Hue_Shift_", this.hueShift), this._activeEffect.setFloat("_Saturation_Shift_", this.saturationShift), this._activeEffect.setFloat("_Value_Shift_", this.valueShift), this._activeEffect.setVector3("_Blob_Position_", this.blobPosition), this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity), this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize), this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize), this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance), this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance), this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength), this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse), this._activeEffect.setFloat("_Blob_Fade_", this.blobFade), this._activeEffect.setTexture("_Blob_Texture_", this.blobTexture), this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2), this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2), this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2), this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2), this._activeEffect.setVector3("_Left_Index_Pos_", this.leftIndexPosition), this._activeEffect.setVector3("_Right_Index_Pos_", this.rightIndexPosition), this._activeEffect.setVector3("_Left_Index_Middle_Pos_", this.leftIndexMiddlePosition), this._activeEffect.setVector3("_Right_Index_Middle_Pos_", this.rightIndexMiddlePosition), this._activeEffect.setTexture("_Decal_", this._decalTexture), this._activeEffect.setVector2("_Decal_Scale_XY_", this.decalScaleXY), this._activeEffect.setFloat("_Decal_Front_Only_", this.decalFrontOnly ? 1 : 0), this._activeEffect.setFloat("_Rim_Intensity_", this.rimIntensity), this._activeEffect.setTexture("_Rim_Texture_", this._blueGradientTexture), this._activeEffect.setFloat("_Rim_Hue_Shift_", this.rimHueShift), this._activeEffect.setFloat("_Rim_Saturation_Shift_", this.rimSaturationShift), this._activeEffect.setFloat("_Rim_Value_Shift_", this.rimValueShift), this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity), this._activeEffect.setTexture("_Iridescence_Texture_", this._blueGradientTexture), this._activeEffect.setFloat("Use_Global_Left_Index", this.useGlobalLeftIndex), this._activeEffect.setFloat("Use_Global_Right_Index", this.useGlobalRightIndex), this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this.globalLeftIndexTipPosition), this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this.globaRightIndexTipPosition), this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position", this.globalLeftThumbTipPosition), this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position", this.globalRightThumbTipPosition), this._activeEffect.setVector4("Global_Left_Index_Middle_Position", this.globalLeftIndexMiddlePosition), this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition), this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity), this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity), this._afterBind(t, this._activeEffect));
  }
  /**
   * Get the list of animatables in the material.
   * @returns the list of animatables object used in the material
   */
  getAnimatables() {
    return [];
  }
  dispose(e) {
    super.dispose(e), this._reflectionMapTexture.dispose(), this._indirectEnvTexture.dispose(), this._blueGradientTexture.dispose(), this._decalTexture.dispose();
  }
  clone(e) {
    return jt.Clone(() => new ii(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.MRDLSliderThumbMaterial", e;
  }
  getClassName() {
    return "MRDLSliderThumbMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new ii(e.name, t), e, t, r);
  }
}
ii.BLUE_GRADIENT_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png";
C([
  M()
], ii.prototype, "radius", void 0);
C([
  M()
], ii.prototype, "bevelFront", void 0);
C([
  M()
], ii.prototype, "bevelFrontStretch", void 0);
C([
  M()
], ii.prototype, "bevelBack", void 0);
C([
  M()
], ii.prototype, "bevelBackStretch", void 0);
C([
  M()
], ii.prototype, "radiusTopLeft", void 0);
C([
  M()
], ii.prototype, "radiusTopRight", void 0);
C([
  M()
], ii.prototype, "radiusBottomLeft", void 0);
C([
  M()
], ii.prototype, "radiusBottomRight", void 0);
C([
  M()
], ii.prototype, "bulgeEnabled", void 0);
C([
  M()
], ii.prototype, "bulgeHeight", void 0);
C([
  M()
], ii.prototype, "bulgeRadius", void 0);
C([
  M()
], ii.prototype, "sunIntensity", void 0);
C([
  M()
], ii.prototype, "sunTheta", void 0);
C([
  M()
], ii.prototype, "sunPhi", void 0);
C([
  M()
], ii.prototype, "indirectDiffuse", void 0);
C([
  M()
], ii.prototype, "albedo", void 0);
C([
  M()
], ii.prototype, "specular", void 0);
C([
  M()
], ii.prototype, "shininess", void 0);
C([
  M()
], ii.prototype, "sharpness", void 0);
C([
  M()
], ii.prototype, "subsurface", void 0);
C([
  M()
], ii.prototype, "leftGradientColor", void 0);
C([
  M()
], ii.prototype, "rightGradientColor", void 0);
C([
  M()
], ii.prototype, "reflection", void 0);
C([
  M()
], ii.prototype, "frontReflect", void 0);
C([
  M()
], ii.prototype, "edgeReflect", void 0);
C([
  M()
], ii.prototype, "power", void 0);
C([
  M()
], ii.prototype, "skyColor", void 0);
C([
  M()
], ii.prototype, "horizonColor", void 0);
C([
  M()
], ii.prototype, "groundColor", void 0);
C([
  M()
], ii.prototype, "horizonPower", void 0);
C([
  M()
], ii.prototype, "width", void 0);
C([
  M()
], ii.prototype, "fuzz", void 0);
C([
  M()
], ii.prototype, "minFuzz", void 0);
C([
  M()
], ii.prototype, "clipFade", void 0);
C([
  M()
], ii.prototype, "hueShift", void 0);
C([
  M()
], ii.prototype, "saturationShift", void 0);
C([
  M()
], ii.prototype, "valueShift", void 0);
C([
  M()
], ii.prototype, "blobPosition", void 0);
C([
  M()
], ii.prototype, "blobIntensity", void 0);
C([
  M()
], ii.prototype, "blobNearSize", void 0);
C([
  M()
], ii.prototype, "blobFarSize", void 0);
C([
  M()
], ii.prototype, "blobNearDistance", void 0);
C([
  M()
], ii.prototype, "blobFarDistance", void 0);
C([
  M()
], ii.prototype, "blobFadeLength", void 0);
C([
  M()
], ii.prototype, "blobPulse", void 0);
C([
  M()
], ii.prototype, "blobFade", void 0);
C([
  M()
], ii.prototype, "blobPosition2", void 0);
C([
  M()
], ii.prototype, "blobNearSize2", void 0);
C([
  M()
], ii.prototype, "blobPulse2", void 0);
C([
  M()
], ii.prototype, "blobFade2", void 0);
C([
  M()
], ii.prototype, "blobTexture", void 0);
C([
  M()
], ii.prototype, "leftIndexPosition", void 0);
C([
  M()
], ii.prototype, "rightIndexPosition", void 0);
C([
  M()
], ii.prototype, "leftIndexMiddlePosition", void 0);
C([
  M()
], ii.prototype, "rightIndexMiddlePosition", void 0);
C([
  M()
], ii.prototype, "decalScaleXY", void 0);
C([
  M()
], ii.prototype, "decalFrontOnly", void 0);
C([
  M()
], ii.prototype, "rimIntensity", void 0);
C([
  M()
], ii.prototype, "rimHueShift", void 0);
C([
  M()
], ii.prototype, "rimSaturationShift", void 0);
C([
  M()
], ii.prototype, "rimValueShift", void 0);
C([
  M()
], ii.prototype, "iridescenceIntensity", void 0);
Ue("BABYLON.GUI.MRDLSliderThumbMaterial", ii);
const ome = "mrdlBackplatePixelShader", fme = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;void FastLinearTosRGB_B353(
vec4 Linear,
out vec4 sRGB)
{sRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));sRGB.a=Linear.a;}
void Round_Rect_Fragment_B332(
float Radius,
float Line_Width,
vec4 Line_Color,
float Filter_Width,
vec2 UV,
float Line_Visibility,
vec4 Rect_Parms,
vec4 Fill_Color,
out vec4 Color)
{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;}
void Iridescence_B343(
vec3 Position,
vec3 Normal,
vec2 UV,
vec3 Axis,
vec3 Eye,
vec4 Tint,
sampler2D Texture,
bool Reflected,
float Frequency,
float Vertical_Offset,
out vec4 Color)
{vec3 i=normalize(Position-Eye);vec3 r=reflect(i,Normal);float idota=dot(i,Axis);float idotr=dot(i,r);float x=Reflected ? idotr : idota;vec2 xy;xy.x=fract((x*Frequency+1.0)*0.5+UV.y*Vertical_Offset);xy.y=0.5;Color=texture(Texture,xy);Color.rgb*=Tint.rgb;}
void Scale_RGB_B346(
vec4 Color,
float Scalar,
out vec4 Result)
{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}
void Scale_RGB_B344(
float Scalar,
vec4 Color,
out vec4 Result)
{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}
void Line_Fragment_B362(
vec4 Base_Color,
vec4 Highlight_Color,
float Highlight_Width,
vec3 Line_Vertex,
float Highlight,
out vec4 Line_Color)
{float k2=1.0-clamp(abs(Line_Vertex.y/Highlight_Width),0.0,1.0);Line_Color=mix(Base_Color,Highlight_Color,Highlight*k2);}
void Edge_B356(
vec4 RectParms,
float Radius,
float Line_Width,
vec2 UV,
float Edge_Width,
float Edge_Power,
out float Result)
{float d=length(max(abs(UV)-RectParms.xy,0.0));float edge=1.0-clamp((1.0-d/(Radius-Line_Width))/Edge_Width,0.0,1.0);Result=pow(edge,Edge_Power);}
void Gradient_B355(
vec4 Gradient_Color,
vec4 Top_Left,
vec4 Top_Right,
vec4 Bottom_Left,
vec4 Bottom_Right,
vec2 UV,
out vec4 Result)
{vec3 top=Top_Left.rgb+(Top_Right.rgb-Top_Left.rgb)*UV.x;vec3 bottom=Bottom_Left.rgb+(Bottom_Right.rgb-Bottom_Left.rgb)*UV.x;Result.rgb=Gradient_Color.rgb*(bottom+(top-bottom)*UV.y);Result.a=1.0;}
void main()
{float X_Q338;float Y_Q338;float Z_Q338;float W_Q338;X_Q338=vExtra2.x;Y_Q338=vExtra2.y;Z_Q338=vExtra2.z;W_Q338=vExtra2.w;vec4 Color_Q343;
#if IRIDESCENCE_ENABLE
Iridescence_B343(vPosition,vNormal,vUV,vBinormal,cameraPosition,_Iridescence_Tint_,_Iridescent_Map_,_Reflected_,_Frequency_,_Vertical_Offset_,Color_Q343);
#else
Color_Q343=vec4(0,0,0,0);
#endif
vec4 Result_Q344;Scale_RGB_B344(_Iridescence_Intensity_,Color_Q343,Result_Q344);vec4 Line_Color_Q362;Line_Fragment_B362(_Line_Color_,_Highlight_Color_,_Highlight_Width_,vTangent,_Highlight_,Line_Color_Q362);float Result_Q356;
#if EDGE_ONLY
Edge_B356(vExtra1,Z_Q338,W_Q338,vUV,_Edge_Width_,_Edge_Power_,Result_Q356);
#else
Result_Q356=1.0;
#endif
vec2 Vec2_Q339=vec2(X_Q338,Y_Q338);vec4 Result_Q355;Gradient_B355(_Gradient_Color_,_Top_Left_,_Top_Right_,_Bottom_Left_,_Bottom_Right_,Vec2_Q339,Result_Q355);vec4 Linear_Q348;Linear_Q348.rgb=clamp(Result_Q355.rgb*Result_Q355.rgb,0.0,1.0);Linear_Q348.a=Result_Q355.a;vec4 Result_Q346;Scale_RGB_B346(Linear_Q348,Result_Q356,Result_Q346);vec4 Sum_Q345=Result_Q346+Result_Q344;vec4 Color_At_T_Q347=mix(Line_Color_Q362,Result_Q346,_Line_Gradient_Blend_);vec4 Base_And_Iridescent_Q350;Base_And_Iridescent_Q350=_Base_Color_+vec4(Sum_Q345.rgb,0.0);vec4 Sum_Q349=Color_At_T_Q347+_Iridescence_Edge_Intensity_*Color_Q343;vec4 Result_Q351=Sum_Q349; Result_Q351.a=1.0;vec4 Color_Q332;Round_Rect_Fragment_B332(Z_Q338,W_Q338,Result_Q351,_Filter_Width_,vUV,1.0,vExtra1,Base_And_Iridescent_Q350,Color_Q332);vec4 Result_Q354=_Fade_Out_*Color_Q332;vec4 sRGB_Q353;FastLinearTosRGB_B353(Result_Q354,sRGB_Q353);vec4 Out_Color=sRGB_Q353;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}`;
Le.ShadersStore[ome] = fme;
const Ame = "mrdlBackplateVertexShader", dme = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec3 tangent;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;void Object_To_World_Pos_B314(
vec3 Pos_Object,
out vec3 Pos_World)
{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}
void Round_Rect_Vertex_B357(
vec2 UV,
float Radius,
float Margin,
float Anisotropy,
float Gradient1,
float Gradient2,
vec3 Normal,
vec4 Color_Scale_Translate,
out vec2 Rect_UV,
out vec4 Rect_Parms,
out vec2 Scale_XY,
out vec2 Line_UV,
out vec2 Color_UV_Info)
{Scale_XY=vec2(Anisotropy,1.0);Line_UV=(UV-vec2(0.5,0.5));Rect_UV=Line_UV*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);Rect_Parms.z=Gradient1; 
Rect_Parms.w=Gradient2;Color_UV_Info=(Line_UV+vec2(0.5,0.5))*Color_Scale_Translate.xy+Color_Scale_Translate.zw;}
void Line_Vertex_B333(
vec2 Scale_XY,
vec2 UV,
float Time,
float Rate,
vec4 Highlight_Transform,
out vec3 Line_Vertex)
{float angle2=(Rate*Time)*2.0*3.1416;float sinAngle2=sin(angle2);float cosAngle2=cos(angle2);vec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;Line_Vertex.x=0.0;Line_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;Line_Vertex.z=0.0; }
void PickDir_B334(
float Degrees,
vec3 DirX,
vec3 DirY,
out vec3 Dir)
{float a=Degrees*3.14159/180.0;Dir=cos(a)*DirX+sin(a)*DirY;}
void Move_Verts_B327(
float Anisotropy,
vec3 P,
float Radius,
out vec3 New_P,
out vec2 New_UV,
out float Radial_Gradient,
out vec3 Radial_Dir)
{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);New_UV=center+r2*(UV-2.0*center+0.5);New_P=vec3(New_UV-0.5,P.z);Radial_Gradient=1.0-length(delta)*2.0;Radial_Dir=vec3(delta*r2,0.0);}
void Pick_Radius_B336(
float Radius,
float Radius_Top_Left,
float Radius_Top_Right,
float Radius_Bottom_Left,
float Radius_Bottom_Right,
vec3 Position,
out float Result)
{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}
void Edge_AA_Vertex_B328(
vec3 Position_World,
vec3 Position_Object,
vec3 Normal_Object,
vec3 Eye,
float Radial_Gradient,
vec3 Radial_Dir,
vec3 Tangent,
out float Gradient1,
out float Gradient2)
{vec3 I=(Eye-Position_World);vec3 T=(vec4(Tangent,0.0)).xyz;float g=(dot(T,I)<0.0) ? 0.0 : 1.0;if (Normal_Object.z==0.0) { 
Gradient1=Position_Object.z>0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}}
void Object_To_World_Dir_B330(
vec3 Dir_Object,
out vec3 Binormal_World,
out vec3 Binormal_World_N,
out float Binormal_Length)
{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;}
void RelativeOrAbsoluteDetail_B341(
float Nominal_Radius,
float Nominal_LineWidth,
bool Absolute_Measurements,
float Height,
out float Radius,
out float Line_Width)
{float scale=Absolute_Measurements ? 1.0/Height : 1.0;Radius=Nominal_Radius*scale;Line_Width=Nominal_LineWidth*scale;}
void main()
{vec3 Nrm_World_Q326;Nrm_World_Q326=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q329;vec3 Tangent_World_N_Q329;float Tangent_Length_Q329;Tangent_World_Q329=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q329=length(Tangent_World_Q329);Tangent_World_N_Q329=Tangent_World_Q329/Tangent_Length_Q329;vec3 Binormal_World_Q330;vec3 Binormal_World_N_Q330;float Binormal_Length_Q330;Object_To_World_Dir_B330(vec3(0,1,0),Binormal_World_Q330,Binormal_World_N_Q330,Binormal_Length_Q330);float Radius_Q341;float Line_Width_Q341;RelativeOrAbsoluteDetail_B341(_Radius_,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q330,Radius_Q341,Line_Width_Q341);vec3 Dir_Q334;PickDir_B334(_Angle_,Tangent_World_N_Q329,Binormal_World_N_Q330,Dir_Q334);float Result_Q336;Pick_Radius_B336(Radius_Q341,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q336);float Anisotropy_Q331=Tangent_Length_Q329/Binormal_Length_Q330;vec4 Out_Color_Q337=vec4(Result_Q336,Line_Width_Q341,0,1);vec3 New_P_Q327;vec2 New_UV_Q327;float Radial_Gradient_Q327;vec3 Radial_Dir_Q327;Move_Verts_B327(Anisotropy_Q331,position,Result_Q336,New_P_Q327,New_UV_Q327,Radial_Gradient_Q327,Radial_Dir_Q327);vec3 Pos_World_Q314;Object_To_World_Pos_B314(New_P_Q327,Pos_World_Q314);float Gradient1_Q328;float Gradient2_Q328;
#if SMOOTH_EDGES
Edge_AA_Vertex_B328(Pos_World_Q314,position,normal,cameraPosition,Radial_Gradient_Q327,Radial_Dir_Q327,tangent,Gradient1_Q328,Gradient2_Q328);
#else
Gradient1_Q328=1.0;Gradient2_Q328=1.0;
#endif
vec2 Rect_UV_Q357;vec4 Rect_Parms_Q357;vec2 Scale_XY_Q357;vec2 Line_UV_Q357;vec2 Color_UV_Info_Q357;Round_Rect_Vertex_B357(New_UV_Q327,Result_Q336,0.0,Anisotropy_Q331,Gradient1_Q328,Gradient2_Q328,normal,vec4(1,1,0,0),Rect_UV_Q357,Rect_Parms_Q357,Scale_XY_Q357,Line_UV_Q357,Color_UV_Info_Q357);vec3 Line_Vertex_Q333;Line_Vertex_B333(Scale_XY_Q357,Line_UV_Q357,(20.0),_Rate_,_Highlight_Transform_,Line_Vertex_Q333);float X_Q359;float Y_Q359;X_Q359=Color_UV_Info_Q357.x;Y_Q359=Color_UV_Info_Q357.y;vec4 Vec4_Q358=vec4(X_Q359,Y_Q359,Result_Q336,Line_Width_Q341);vec3 Position=Pos_World_Q314;vec3 Normal=Nrm_World_Q326;vec2 UV=Rect_UV_Q357;vec3 Tangent=Line_Vertex_Q333;vec3 Binormal=Dir_Q334;vec4 Color=Out_Color_Q337;vec4 Extra1=Rect_Parms_Q357;vec4 Extra2=Vec4_Q358;vec4 Extra3=vec4(0,0,0,0);gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vExtra1=Extra1;vExtra2=Extra2;}`;
Le.ShadersStore[Ame] = dme;
class vme extends na {
  constructor() {
    super(), this.IRIDESCENCE_ENABLE = !0, this.SMOOTH_EDGES = !0, this._needNormals = !0, this.rebuild();
  }
}
class l1 extends P1 {
  constructor(e, t) {
    super(e, t), this.radius = 0.3, this.lineWidth = 3e-3, this.absoluteSizes = !1, this._filterWidth = 1, this.baseColor = new xt(0, 0, 0, 1), this.lineColor = new xt(0.2, 0.262745, 0.4, 1), this.radiusTopLeft = 1, this.radiusTopRight = 1, this.radiusBottomLeft = 1, this.radiusBottomRight = 1, this._rate = 0, this.highlightColor = new xt(0.239216, 0.435294, 0.827451, 1), this.highlightWidth = 0, this._highlightTransform = new Ir(1, 1, 0, 0), this._highlight = 1, this.iridescenceIntensity = 0.45, this.iridescenceEdgeIntensity = 1, this.iridescenceTint = new xt(1, 1, 1, 1), this._angle = -45, this.fadeOut = 1, this._reflected = !0, this._frequency = 1, this._verticalOffset = 0, this.gradientColor = new xt(0.74902, 0.74902, 0.74902, 1), this.topLeftGradientColor = new xt(784314e-8, 0.294118, 0.580392, 1), this.topRightGradientColor = new xt(0.305882, 0, 1, 1), this.bottomLeftGradientColor = new xt(0.133333, 0.258824, 0.992157, 1), this.bottomRightGradientColor = new xt(0.176471, 0.176471, 0.619608, 1), this.edgeWidth = 0.5, this.edgePower = 1, this.edgeLineGradientBlend = 0.5, this.alphaMode = et.ALPHA_DISABLE, this.backFaceCulling = !1, this._iridescentMapTexture = new We(l1.IRIDESCENT_MAP_TEXTURE_URL, this.getScene(), !0, !1, We.NEAREST_SAMPLINGMODE);
  }
  needAlphaBlending() {
    return !1;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady)
      return !0;
    t.materialDefines || (t.materialDefines = new vme());
    const r = t.materialDefines, n = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const i = n.getEngine();
    if (Ye.PrepareDefinesForAttributes(e, r, !1, !1), r.isDirty) {
      r.markAsProcessed(), n.resetCachedMaterial();
      const s = new c1();
      r.FOG && s.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(r, s), r.IMAGEPROCESSINGPOSTPROCESS = n.imageProcessingConfiguration.applyByPostProcess;
      const a = [J.PositionKind];
      r.NORMAL && a.push(J.NormalKind), r.UV1 && a.push(J.UVKind), r.UV2 && a.push(J.UV2Kind), r.VERTEXCOLOR && a.push(J.ColorKind), r.TANGENT && a.push(J.TangentKind), Ye.PrepareAttributesForInstances(a, r);
      const f = "mrdlBackplate", o = r.toString(), d = [
        "world",
        "viewProjection",
        "cameraPosition",
        "_Radius_",
        "_Line_Width_",
        "_Absolute_Sizes_",
        "_Filter_Width_",
        "_Base_Color_",
        "_Line_Color_",
        "_Radius_Top_Left_",
        "_Radius_Top_Right_",
        "_Radius_Bottom_Left_",
        "_Radius_Bottom_Right_",
        "_Rate_",
        "_Highlight_Color_",
        "_Highlight_Width_",
        "_Highlight_Transform_",
        "_Highlight_",
        "_Iridescence_Intensity_",
        "_Iridescence_Edge_Intensity_",
        "_Iridescence_Tint_",
        "_Iridescent_Map_",
        "_Angle_",
        "_Reflected_",
        "_Frequency_",
        "_Vertical_Offset_",
        "_Gradient_Color_",
        "_Top_Left_",
        "_Top_Right_",
        "_Bottom_Left_",
        "_Bottom_Right_",
        "_Edge_Width_",
        "_Edge_Power_",
        "_Line_Gradient_Blend_",
        "_Fade_Out_"
      ], v = ["_Iridescent_Map_"], u = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: r,
        maxSimultaneousLights: 4
      }), t.setEffect(n.getEngine().createEffect(f, {
        attributes: a,
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: o,
        fallbacks: s,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, i), r);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (r._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, !0);
  }
  bindForSubMesh(e, t, r) {
    if (!r.materialDefines)
      return;
    const i = r.effect;
    i && (this._activeEffect = i, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()), this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position), this._activeEffect.setFloat("_Radius_", this.radius), this._activeEffect.setFloat("_Line_Width_", this.lineWidth), this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1 : 0), this._activeEffect.setFloat("_Filter_Width_", this._filterWidth), this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor), this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor), this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft), this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight), this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft), this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight), this._activeEffect.setFloat("_Rate_", this._rate), this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor), this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth), this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform), this._activeEffect.setFloat("_Highlight_", this._highlight), this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity), this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity), this._activeEffect.setDirectColor4("_Iridescence_Tint_", this.iridescenceTint), this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMapTexture), this._activeEffect.setFloat("_Angle_", this._angle), this._activeEffect.setFloat("_Reflected_", this._reflected ? 1 : 0), this._activeEffect.setFloat("_Frequency_", this._frequency), this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset), this._activeEffect.setDirectColor4("_Gradient_Color_", this.gradientColor), this._activeEffect.setDirectColor4("_Top_Left_", this.topLeftGradientColor), this._activeEffect.setDirectColor4("_Top_Right_", this.topRightGradientColor), this._activeEffect.setDirectColor4("_Bottom_Left_", this.bottomLeftGradientColor), this._activeEffect.setDirectColor4("_Bottom_Right_", this.bottomRightGradientColor), this._activeEffect.setFloat("_Edge_Width_", this.edgeWidth), this._activeEffect.setFloat("_Edge_Power_", this.edgePower), this._activeEffect.setFloat("_Line_Gradient_Blend_", this.edgeLineGradientBlend), this._activeEffect.setFloat("_Fade_Out_", this.fadeOut), this._afterBind(t, this._activeEffect));
  }
  /**
   * Get the list of animatables in the material.
   * @returns the list of animatables object used in the material
   */
  getAnimatables() {
    return [];
  }
  dispose(e) {
    super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new l1(e, this.getScene()), this);
  }
  serialize() {
    const e = super.serialize();
    return e.customType = "BABYLON.MRDLBackplateMaterial", e;
  }
  getClassName() {
    return "MRDLBackplateMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new l1(e.name, t), e, t, r);
  }
}
l1.IRIDESCENT_MAP_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-backplate-iridescence.png";
C([
  M()
], l1.prototype, "radius", void 0);
C([
  M()
], l1.prototype, "lineWidth", void 0);
C([
  M()
], l1.prototype, "absoluteSizes", void 0);
C([
  M()
], l1.prototype, "baseColor", void 0);
C([
  M()
], l1.prototype, "lineColor", void 0);
C([
  M()
], l1.prototype, "radiusTopLeft", void 0);
C([
  M()
], l1.prototype, "radiusTopRight", void 0);
C([
  M()
], l1.prototype, "radiusBottomLeft", void 0);
C([
  M()
], l1.prototype, "radiusBottomRight", void 0);
C([
  M()
], l1.prototype, "highlightColor", void 0);
C([
  M()
], l1.prototype, "highlightWidth", void 0);
C([
  M()
], l1.prototype, "iridescenceIntensity", void 0);
C([
  M()
], l1.prototype, "iridescenceEdgeIntensity", void 0);
C([
  M()
], l1.prototype, "iridescenceTint", void 0);
C([
  M()
], l1.prototype, "fadeOut", void 0);
C([
  M()
], l1.prototype, "gradientColor", void 0);
C([
  M()
], l1.prototype, "topLeftGradientColor", void 0);
C([
  M()
], l1.prototype, "topRightGradientColor", void 0);
C([
  M()
], l1.prototype, "bottomLeftGradientColor", void 0);
C([
  M()
], l1.prototype, "bottomRightGradientColor", void 0);
C([
  M()
], l1.prototype, "edgeWidth", void 0);
C([
  M()
], l1.prototype, "edgePower", void 0);
C([
  M()
], l1.prototype, "edgeLineGradientBlend", void 0);
Ue("BABYLON.GUI.MRDLBackplateMaterial", l1);
const ume = "mrdlBackglowPixelShader", lme = `uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;float BiasFunc(float b,float v) {return pow(v,log(clamp(b,0.001,0.999))/log(0.5));}
void Fuzzy_Round_Rect_B33(
float Size_X,
float Size_Y,
float Radius_X,
float Radius_Y,
float Line_Width,
vec2 UV,
float Outer_Fuzz,
float Max_Outer_Fuzz,
out float Rect_Distance,
out float Inner_Distance)
{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius_X,Radius_Y),halfSize),vec2(0.001,0.001));float radius=min(r.x,r.y)-Max_Outer_Fuzz;vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);float d=distance(nearestp,v);Inner_Distance=clamp(1.0-(radius-d)/Line_Width,0.0,1.0);Rect_Distance=clamp(1.0-(d-radius)/Outer_Fuzz,0.0,1.0)*Inner_Distance;}
void main()
{float X_Q42;float Y_Q42;X_Q42=vNormal.x;Y_Q42=vNormal.y;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Sqrt_F_Q27=sqrt(MaxAB_Q24);float Power_Q43=pow(MaxAB_Q24,_Intensity_Fade_In_Exponent_);float Value_At_T_Q26=mix(_Outer_Fuzz_Start_,_Outer_Fuzz_End_,Sqrt_F_Q27);float Product_Q23=_Max_Intensity_*Power_Q43;float Rect_Distance_Q33;float Inner_Distance_Q33;Fuzzy_Round_Rect_B33(X_Q42,Y_Q42,_Bevel_Radius_,_Bevel_Radius_,_Line_Width_,vUV,Value_At_T_Q26,_Outer_Fuzz_Start_,Rect_Distance_Q33,Inner_Distance_Q33);float Power_Q44=pow(Inner_Distance_Q33,_Blend_Exponent_);float Result_Q45=pow(BiasFunc(_Bias_,Rect_Distance_Q33),_Falloff_);vec4 Color_At_T_Q25=mix(_Inner_Color_,_Color_,Power_Q44);float Product_Q22=Result_Q45*Product_Q23;vec4 Result_Q28=Product_Q22*Color_At_T_Q25;vec4 Out_Color=Result_Q28;float Clip_Threshold=0.0;gl_FragColor=Out_Color;}`;
Le.ShadersStore[ume] = lme;
const Pme = "mrdlBackglowVertexShader", cme = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;varying vec3 vNormal;varying vec2 vUV;void main()
{vec3 Dir_World_Q41=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q40=(world*vec4((cross(normal,tangent)),0.0)).xyz;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Length_Q16=length(Dir_World_Q41);float Length_Q17=length(Dir_World_Q40);bool Greater_Than_Q37=MaxAB_Q24>0.0;vec3 Sizes_Q35;vec2 XY_Q35;Sizes_Q35=(_Absolute_Sizes_ ? vec3(Length_Q16,Length_Q17,0) : vec3(Length_Q16/Length_Q17,1,0));XY_Q35=(uv-vec2(0.5,0.5))*Sizes_Q35.xy;vec3 Result_Q38=Greater_Than_Q37 ? position : vec3(0,0,0);vec3 Pos_World_Q39=(world*vec4(Result_Q38,1.0)).xyz;vec3 Position=Pos_World_Q39;vec3 Normal=Sizes_Q35;vec2 UV=XY_Q35;vec3 Tangent=vec3(0,0,0);vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;}`;
Le.ShadersStore[Pme] = cme;
class pme extends na {
  constructor() {
    super(), this._needNormals = !0, this._needUVs = !0, this.rebuild();
  }
}
class Jd extends P1 {
  constructor(e, t) {
    super(e, t), this.bevelRadius = 0.16, this.lineWidth = 0.16, this.absoluteSizes = !1, this.tuningMotion = 0, this.motion = 1, this.maxIntensity = 0.7, this.intensityFadeInExponent = 2, this.outerFuzzStart = 0.04, this.outerFuzzEnd = 0.04, this.color = new xt(0.682353, 0.698039, 1, 1), this.innerColor = new xt(0.356863, 0.392157, 0.796078, 1), this.blendExponent = 1.5, this.falloff = 2, this.bias = 0.5, this.alphaMode = et.ALPHA_ADD, this.disableDepthWrite = !0, this.backFaceCulling = !1;
  }
  needAlphaBlending() {
    return !0;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady)
      return !0;
    t.materialDefines || (t.materialDefines = new pme());
    const r = t.materialDefines, n = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const i = n.getEngine();
    if (Ye.PrepareDefinesForAttributes(e, r, !1, !1), r.isDirty) {
      r.markAsProcessed(), n.resetCachedMaterial();
      const s = new c1();
      r.FOG && s.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(r, s), r.IMAGEPROCESSINGPOSTPROCESS = n.imageProcessingConfiguration.applyByPostProcess;
      const a = [J.PositionKind];
      r.NORMAL && a.push(J.NormalKind), r.UV1 && a.push(J.UVKind), r.UV2 && a.push(J.UV2Kind), r.VERTEXCOLOR && a.push(J.ColorKind), r.TANGENT && a.push(J.TangentKind), Ye.PrepareAttributesForInstances(a, r);
      const f = "mrdlBackglow", o = r.toString(), d = [
        "world",
        "worldView",
        "worldViewProjection",
        "view",
        "projection",
        "viewProjection",
        "cameraPosition",
        "_Bevel_Radius_",
        "_Line_Width_",
        "_Absolute_Sizes_",
        "_Tuning_Motion_",
        "_Motion_",
        "_Max_Intensity_",
        "_Intensity_Fade_In_Exponent_",
        "_Outer_Fuzz_Start_",
        "_Outer_Fuzz_End_",
        "_Color_",
        "_Inner_Color_",
        "_Blend_Exponent_",
        "_Falloff_",
        "_Bias_"
      ], v = [], u = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: r,
        maxSimultaneousLights: 4
      }), t.setEffect(n.getEngine().createEffect(f, {
        attributes: a,
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: o,
        fallbacks: s,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, i), r);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (r._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene();
    if (!r.materialDefines)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), this._activeEffect.setVector3("cameraPosition", n.activeCamera.position), this._activeEffect.setFloat("_Bevel_Radius_", this.bevelRadius), this._activeEffect.setFloat("_Line_Width_", this.lineWidth), this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1 : 0), this._activeEffect.setFloat("_Tuning_Motion_", this.tuningMotion), this._activeEffect.setFloat("_Motion_", this.motion), this._activeEffect.setFloat("_Max_Intensity_", this.maxIntensity), this._activeEffect.setFloat("_Intensity_Fade_In_Exponent_", this.intensityFadeInExponent), this._activeEffect.setFloat("_Outer_Fuzz_Start_", this.outerFuzzStart), this._activeEffect.setFloat("_Outer_Fuzz_End_", this.outerFuzzEnd), this._activeEffect.setDirectColor4("_Color_", this.color), this._activeEffect.setDirectColor4("_Inner_Color_", this.innerColor), this._activeEffect.setFloat("_Blend_Exponent_", this.blendExponent), this._activeEffect.setFloat("_Falloff_", this.falloff), this._activeEffect.setFloat("_Bias_", this.bias), this._afterBind(t, this._activeEffect));
  }
  /**
   * Get the list of animatables in the material.
   * @returns the list of animatables object used in the material
   */
  getAnimatables() {
    return [];
  }
  dispose(e) {
    super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new Jd(e, this.getScene()), this);
  }
  serialize() {
    const e = jt.Serialize(this);
    return e.customType = "BABYLON.MRDLBackglowMaterial", e;
  }
  getClassName() {
    return "MRDLBackglowMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new Jd(e.name, t), e, t, r);
  }
}
C([
  M()
], Jd.prototype, "bevelRadius", void 0);
C([
  M()
], Jd.prototype, "lineWidth", void 0);
C([
  M()
], Jd.prototype, "absoluteSizes", void 0);
C([
  M()
], Jd.prototype, "tuningMotion", void 0);
C([
  M()
], Jd.prototype, "motion", void 0);
C([
  M()
], Jd.prototype, "maxIntensity", void 0);
C([
  M()
], Jd.prototype, "intensityFadeInExponent", void 0);
C([
  M()
], Jd.prototype, "outerFuzzStart", void 0);
C([
  M()
], Jd.prototype, "outerFuzzEnd", void 0);
C([
  M()
], Jd.prototype, "color", void 0);
C([
  M()
], Jd.prototype, "innerColor", void 0);
C([
  M()
], Jd.prototype, "blendExponent", void 0);
C([
  M()
], Jd.prototype, "falloff", void 0);
C([
  M()
], Jd.prototype, "bias", void 0);
Ue("BABYLON.GUI.MRDLBackglowMaterial", Jd);
const hme = "mrdlFrontplatePixelShader", Hme = `uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Scale_Color_B54(
vec4 Color,
float Scalar,
out vec4 Result)
{Result=Scalar*Color;}
void Scale_RGB_B50(
vec4 Color,
float Scalar,
out vec4 Result)
{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}
void Proximity_Fragment_B51(
float Proximity_Max_Intensity,
float Proximity_Near_Radius,
vec4 Deltas,
float Show_Selection,
float Distance_Fade1,
float Distance_Fade2,
float Strength,
out float Proximity)
{float proximity1=(1.0-clamp(length(Deltas.xy)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade1;float proximity2=(1.0-clamp(length(Deltas.zw)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade2;Proximity=Strength*(Proximity_Max_Intensity*max(proximity1,proximity2) *(1.0-Show_Selection)+Show_Selection);}
void Blob_Fragment_B56(
vec2 UV,
vec3 Blob_Info,
sampler2D Blob_Texture,
out vec4 Blob_Color)
{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));}
void Round_Rect_Fragment_B61(
float Radius,
vec4 Line_Color,
float Filter_Width,
float Line_Visibility,
vec4 Fill_Color,
bool Smooth_Edges,
vec4 Rect_Parms,
out float Inside_Rect)
{float d=length(max(abs(Rect_Parms.zw)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);Inside_Rect=Smooth_Edges ? clamp((Radius-d)/dx,0.0,1.0) : 1.0-step(Radius,d);}
void main()
{float Is_Quad_Q53;Is_Quad_Q53=vNormal.z;vec4 Blob_Color_Q56;Blob_Fragment_B56(vUV,vTangent,_Blob_Texture_,Blob_Color_Q56);float X_Q52;float Y_Q52;float Z_Q52;float W_Q52;X_Q52=vExtra3.x;Y_Q52=vExtra3.y;Z_Q52=vExtra3.z;W_Q52=vExtra3.w;float Proximity_Q51;Proximity_Fragment_B51(_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vExtra2,X_Q52,Y_Q52,Z_Q52,1.0,Proximity_Q51);float Inside_Rect_Q61;Round_Rect_Fragment_B61(W_Q52,vec4(1,1,1,1),_Filter_Width_,1.0,vec4(0,0,0,0),_Smooth_Edges_,vExtra1,Inside_Rect_Q61);vec4 Result_Q50;Scale_RGB_B50(_Edge_Color_,Proximity_Q51,Result_Q50);vec4 Result_Q47=Inside_Rect_Q61*Blob_Color_Q56;vec4 Color_At_T_Q48=mix(Result_Q50,Result_Q47,Is_Quad_Q53);vec4 Result_Q54;Scale_Color_B54(Color_At_T_Q48,_Fade_Out_,Result_Q54);vec4 Out_Color=Result_Q54;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}`;
Le.ShadersStore[hme] = Hme;
const gme = "mrdlFrontplateVertexShader", Xme = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Blob_Vertex_B40(
vec3 Position,
vec3 Normal,
vec3 Tangent,
vec3 Bitangent,
vec3 Blob_Position,
float Intensity,
float Blob_Near_Size,
float Blob_Far_Size,
float Blob_Near_Distance,
float Blob_Far_Distance,
vec4 Vx_Color,
vec2 UV,
vec3 Face_Center,
vec2 Face_Size,
vec2 In_UV,
float Blob_Fade_Length,
float Selection_Fade,
float Selection_Fade_Size,
float Inner_Fade,
float Blob_Pulse,
float Blob_Fade,
float Blob_Enabled,
float DistanceOffset,
out vec3 Out_Position,
out vec2 Out_UV,
out vec3 Blob_Info,
out vec2 Blob_Relative_UV)
{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal)+DistanceOffset*Blob_Far_Distance;Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; 
vec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);Blob_Relative_UV=blobClipped/Face_Size.y;}
void Round_Rect_Vertex_B36(
vec2 UV,
vec3 Tangent,
vec3 Binormal,
float Radius,
float Anisotropy,
vec2 Blob_Center_UV,
out vec2 Rect_UV,
out vec2 Scale_XY,
out vec4 Rect_Parms)
{Scale_XY=vec2(Anisotropy,1.0);Rect_UV=(UV-vec2(0.5,0.5))*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius);Rect_Parms.zw=Blob_Center_UV;}
vec2 ProjectProximity(
vec3 blobPosition,
vec3 position,
vec3 center,
vec3 dir,
vec3 xdir,
vec3 ydir,
out float vdistance
)
{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;}
void Proximity_Vertex_B33(
vec3 Blob_Position,
vec3 Blob_Position_2,
vec3 Face_Center,
vec3 Position,
float Proximity_Far_Distance,
float Relative_Scale,
float Proximity_Anisotropy,
vec3 Normal,
vec3 Tangent,
vec3 Binormal,
out vec4 Extra,
out float Distance_To_Face,
out float Distance_Fade1,
out float Distance_Fade2)
{float distz1,distz2;Extra.xy=ProjectProximity(Blob_Position,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz1)/Relative_Scale;Extra.zw=ProjectProximity(Blob_Position_2,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz2)/Relative_Scale;Distance_To_Face=dot(Normal,Position-Face_Center);Distance_Fade1=1.0-clamp(distz1/Proximity_Far_Distance,0.0,1.0);Distance_Fade2=1.0-clamp(distz2/Proximity_Far_Distance,0.0,1.0);}
void Object_To_World_Pos_B12(
vec3 Pos_Object,
out vec3 Pos_World)
{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}
void Choose_Blob_B27(
vec4 Vx_Color,
vec3 Position1,
vec3 Position2,
bool Blob_Enable_1,
bool Blob_Enable_2,
float Near_Size_1,
float Near_Size_2,
float Blob_Inner_Fade_1,
float Blob_Inner_Fade_2,
float Blob_Pulse_1,
float Blob_Pulse_2,
float Blob_Fade_1,
float Blob_Fade_2,
out vec3 Position,
out float Near_Size,
out float Inner_Fade,
out float Blob_Enable,
out float Fade,
out float Pulse)
{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=Blob_Enable_1 ? 1.0 : 0.0;float b2=Blob_Enable_2 ? 1.0 : 0.0;Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;}
void Move_Verts_B32(
vec2 UV,
float Radius,
float Anisotropy,
float Line_Width,
float Visible,
out vec3 New_P,
out vec2 New_UV)
{vec2 xy=2.0*UV-vec2(0.5,0.5);vec2 center=clamp(xy,0.0,1.0);vec2 delta=2.0*(xy-center);float deltaLength=length(delta);vec2 aniso=vec2(1.0/Anisotropy,1.0);center=(center-vec2(0.5,0.5))*(1.0-2.0*Radius*aniso);New_UV=vec2((2.0-2.0*deltaLength)*Visible,0.0);float deltaRadius= (Radius-Line_Width*New_UV.x);New_P.xy=(center+deltaRadius/deltaLength *aniso*delta);New_P.z=0.0;}
void Object_To_World_Dir_B14(
vec3 Dir_Object,
out vec3 Binormal_World)
{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;}
void Proximity_Visibility_B55(
float Selection,
vec3 Proximity_Center,
vec3 Proximity_Center_2,
float Proximity_Far_Distance,
float Proximity_Radius,
vec3 Face_Center,
vec3 Normal,
vec2 Face_Size,
float Gaze,
out float Width)
{float boxMaxSize=length(Face_Size)*0.5;float d1=dot(Proximity_Center-Face_Center,Normal);vec3 blob1=Proximity_Center-d1*Normal;float d2=dot(Proximity_Center_2-Face_Center,Normal);vec3 blob2=Proximity_Center_2-d2*Normal;vec3 delta1=blob1-Face_Center;vec3 delta2=blob2-Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));Width=max(Gaze,Width);}
vec2 ramp2(vec2 start,vec2 end,vec2 x)
{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));}
float computeSelection(
vec3 blobPosition,
vec3 normal,
vec3 tangent,
vec3 bitangent,
vec3 faceCenter,
vec2 faceSize,
float selectionFuzz,
float farDistance,
float fadeLength
)
{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;}
void Selection_Vertex_B31(
vec3 Blob_Position,
vec3 Blob_Position_2,
vec3 Face_Center,
vec2 Face_Size,
vec3 Normal,
vec3 Tangent,
vec3 Bitangent,
float Selection_Fuzz,
float Selected,
float Far_Distance,
float Fade_Length,
vec3 Active_Face_Dir,
out float Show_Selection)
{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);Show_Selection=mix(max(select1,select2),1.0,Selected);}
void main()
{vec3 Vec3_Q29=vec3(vec2(0,0).x,vec2(0,0).y,color.r);vec3 Nrm_World_Q24;Nrm_World_Q24=normalize((world*vec4(normal,0.0)).xyz);vec3 Face_Center_Q30;Face_Center_Q30=(world*vec4(vec3(0,0,0),1.0)).xyz;vec3 Tangent_World_Q13;Tangent_World_Q13=(world*vec4(tangent,0.0)).xyz;vec3 Result_Q42;Result_Q42=_Use_Global_Left_Index_ ? Global_Left_Index_Tip_Position.xyz : _Blob_Position_;vec3 Result_Q43;Result_Q43=_Use_Global_Right_Index_ ? Global_Right_Index_Tip_Position.xyz : _Blob_Position_2_;float Value_At_T_Q58=mix(_Blob_Near_Size_,_Blob_Pulse_Max_Size_,_Blob_Pulse_);float Value_At_T_Q59=mix(_Blob_Near_Size_2_,_Blob_Pulse_Max_Size_,_Blob_Pulse_2_);vec3 Cross_Q70=cross(normal,tangent);float Product_Q45=_Gaze_Intensity_*_Gaze_Focus_;float Step_Q46=step(0.0001,Product_Q45);vec3 Tangent_World_N_Q15=normalize(Tangent_World_Q13);vec3 Position_Q27;float Near_Size_Q27;float Inner_Fade_Q27;float Blob_Enable_Q27;float Fade_Q27;float Pulse_Q27;Choose_Blob_B27(color,Result_Q42,Result_Q43,_Blob_Enable_,_Blob_Enable_2_,Value_At_T_Q58,Value_At_T_Q59,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q27,Near_Size_Q27,Inner_Fade_Q27,Blob_Enable_Q27,Fade_Q27,Pulse_Q27);vec3 Binormal_World_Q14;Object_To_World_Dir_B14(Cross_Q70,Binormal_World_Q14);float Anisotropy_Q21=length(Tangent_World_Q13)/length(Binormal_World_Q14);vec3 Binormal_World_N_Q16=normalize(Binormal_World_Q14);vec2 Face_Size_Q35;float ScaleY_Q35;Face_Size_Q35=vec2(length(Tangent_World_Q13),length(Binormal_World_Q14));ScaleY_Q35=Face_Size_Q35.y;float Out_Radius_Q38;float Out_Line_Width_Q38;Out_Radius_Q38=_Relative_To_Height_ ? _Radius_ : _Radius_/ScaleY_Q35;Out_Line_Width_Q38=_Relative_To_Height_ ? _Line_Width_ : _Line_Width_/ScaleY_Q35;float Show_Selection_Q31;Selection_Vertex_B31(Result_Q42,Result_Q43,Face_Center_Q30,Face_Size_Q35,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,vec3(0,0,-1),Show_Selection_Q31);float MaxAB_Q41=max(Show_Selection_Q31,Product_Q45);float Width_Q55;Proximity_Visibility_B55(Show_Selection_Q31,Result_Q42,Result_Q43,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Face_Center_Q30,Nrm_World_Q24,Face_Size_Q35,Step_Q46,Width_Q55);vec3 New_P_Q32;vec2 New_UV_Q32;Move_Verts_B32(uv,Out_Radius_Q38,Anisotropy_Q21,Out_Line_Width_Q38,Width_Q55,New_P_Q32,New_UV_Q32);vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q32,Pos_World_Q12);vec3 Out_Position_Q40;vec2 Out_UV_Q40;vec3 Blob_Info_Q40;vec2 Blob_Relative_UV_Q40;Blob_Vertex_B40(Pos_World_Q12,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Position_Q27,_Blob_Intensity_,Near_Size_Q27,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q30,Face_Size_Q35,New_UV_Q32,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q27,Pulse_Q27,Fade_Q27,Blob_Enable_Q27,0.0,Out_Position_Q40,Out_UV_Q40,Blob_Info_Q40,Blob_Relative_UV_Q40);vec2 Rect_UV_Q36;vec2 Scale_XY_Q36;vec4 Rect_Parms_Q36;Round_Rect_Vertex_B36(New_UV_Q32,Tangent_World_Q13,Binormal_World_Q14,Out_Radius_Q38,Anisotropy_Q21,Blob_Relative_UV_Q40,Rect_UV_Q36,Scale_XY_Q36,Rect_Parms_Q36);vec4 Extra_Q33;float Distance_To_Face_Q33;float Distance_Fade1_Q33;float Distance_Fade2_Q33;Proximity_Vertex_B33(Result_Q42,Result_Q43,Face_Center_Q30,Pos_World_Q12,_Proximity_Far_Distance_,1.0,_Proximity_Anisotropy_,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Extra_Q33,Distance_To_Face_Q33,Distance_Fade1_Q33,Distance_Fade2_Q33);vec4 Vec4_Q37=vec4(MaxAB_Q41,Distance_Fade1_Q33,Distance_Fade2_Q33,Out_Radius_Q38);vec3 Position=Out_Position_Q40;vec3 Normal=Vec3_Q29;vec2 UV=Out_UV_Q40;vec3 Tangent=Blob_Info_Q40;vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);vec4 Extra1=Rect_Parms_Q36;vec4 Extra2=Extra_Q33;vec4 Extra3=Vec4_Q37;gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;vTangent=Tangent;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`;
Le.ShadersStore[gme] = Xme;
class Tme extends na {
  constructor() {
    super(), this.SMOOTH_EDGES = !0, this._needNormals = !0, this._needUVs = !0, this.rebuild();
  }
}
class ys extends P1 {
  constructor(e, t) {
    super(e, t), this.radius = 0.12, this.lineWidth = 0.01, this.relativeToHeight = !1, this._filterWidth = 1, this.edgeColor = new xt(0.53, 0.53, 0.53, 1), this.blobEnable = !0, this.blobPosition = new S(100, 100, 100), this.blobIntensity = 0.5, this.blobNearSize = 0.032, this.blobFarSize = 0.048, this.blobNearDistance = 8e-3, this.blobFarDistance = 0.064, this.blobFadeLength = 0.04, this.blobInnerFade = 0.01, this.blobPulse = 0, this.blobFade = 1, this.blobPulseMaxSize = 0.05, this.blobEnable2 = !0, this.blobPosition2 = new S(10, 10.1, -0.6), this.blobNearSize2 = 8e-3, this.blobInnerFade2 = 0.1, this.blobPulse2 = 0, this.blobFade2 = 1, this.gazeIntensity = 0.8, this.gazeFocus = 0, this.selectionFuzz = 0.5, this.selected = 1, this.selectionFade = 0.2, this.selectionFadeSize = 0, this.selectedDistance = 0.08, this.selectedFadeLength = 0.08, this.proximityMaxIntensity = 0.45, this.proximityFarDistance = 0.16, this.proximityNearRadius = 0.016, this.proximityAnisotropy = 1, this.useGlobalLeftIndex = !0, this.useGlobalRightIndex = !0, this.fadeOut = 1, this.alphaMode = et.ALPHA_ADD, this.disableDepthWrite = !0, this.backFaceCulling = !1, this._blobTexture = new We(ys.BLOB_TEXTURE_URL, t, !0, !1, We.NEAREST_SAMPLINGMODE);
  }
  needAlphaBlending() {
    return !0;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady)
      return !0;
    t.materialDefines || (t.materialDefines = new Tme());
    const r = t.materialDefines, n = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const i = n.getEngine();
    if (Ye.PrepareDefinesForAttributes(e, r, !1, !1), r.isDirty) {
      r.markAsProcessed(), n.resetCachedMaterial();
      const s = new c1();
      r.FOG && s.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(r, s), r.IMAGEPROCESSINGPOSTPROCESS = n.imageProcessingConfiguration.applyByPostProcess;
      const a = [J.PositionKind];
      r.NORMAL && a.push(J.NormalKind), r.UV1 && a.push(J.UVKind), r.UV2 && a.push(J.UV2Kind), r.VERTEXCOLOR && a.push(J.ColorKind), r.TANGENT && a.push(J.TangentKind), Ye.PrepareAttributesForInstances(a, r);
      const f = "mrdlFrontplate", o = r.toString(), d = [
        "world",
        "worldView",
        "worldViewProjection",
        "view",
        "projection",
        "viewProjection",
        "cameraPosition",
        "_Radius_",
        "_Line_Width_",
        "_Relative_To_Height_",
        "_Filter_Width_",
        "_Edge_Color_",
        "_Fade_Out_",
        "_Smooth_Edges_",
        "_Blob_Enable_",
        "_Blob_Position_",
        "_Blob_Intensity_",
        "_Blob_Near_Size_",
        "_Blob_Far_Size_",
        "_Blob_Near_Distance_",
        "_Blob_Far_Distance_",
        "_Blob_Fade_Length_",
        "_Blob_Inner_Fade_",
        "_Blob_Pulse_",
        "_Blob_Fade_",
        "_Blob_Pulse_Max_Size_",
        "_Blob_Enable_2_",
        "_Blob_Position_2_",
        "_Blob_Near_Size_2_",
        "_Blob_Inner_Fade_2_",
        "_Blob_Pulse_2_",
        "_Blob_Fade_2_",
        "_Gaze_Intensity_",
        "_Gaze_Focus_",
        "_Blob_Texture_",
        "_Selection_Fuzz_",
        "_Selected_",
        "_Selection_Fade_",
        "_Selection_Fade_Size_",
        "_Selected_Distance_",
        "_Selected_Fade_Length_",
        "_Proximity_Max_Intensity_",
        "_Proximity_Far_Distance_",
        "_Proximity_Near_Radius_",
        "_Proximity_Anisotropy_",
        "Global_Left_Index_Tip_Position",
        "Global_Right_Index_Tip_Position",
        "_Use_Global_Left_Index_",
        "_Use_Global_Right_Index_"
      ], v = [], u = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: r,
        maxSimultaneousLights: 4
      }), t.setEffect(n.getEngine().createEffect(f, {
        attributes: a,
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: o,
        fallbacks: s,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, i), r);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (r._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene();
    if (!r.materialDefines)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), this._activeEffect.setVector3("cameraPosition", n.activeCamera.position), this._activeEffect.setFloat("_Radius_", this.radius), this._activeEffect.setFloat("_Line_Width_", this.lineWidth), this._activeEffect.setFloat("_Relative_To_Height_", this.relativeToHeight ? 1 : 0), this._activeEffect.setFloat("_Filter_Width_", this._filterWidth), this._activeEffect.setDirectColor4("_Edge_Color_", this.edgeColor), this._activeEffect.setFloat("_Fade_Out_", this.fadeOut), this._activeEffect.setFloat("_Blob_Enable_", this.blobEnable ? 1 : 0), this._activeEffect.setVector3("_Blob_Position_", this.blobPosition), this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity), this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize), this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize), this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance), this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance), this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength), this._activeEffect.setFloat("_Blob_Inner_Fade_", this.blobInnerFade), this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse), this._activeEffect.setFloat("_Blob_Fade_", this.blobFade), this._activeEffect.setFloat("_Blob_Pulse_Max_Size_", this.blobPulseMaxSize), this._activeEffect.setFloat("_Blob_Enable_2_", this.blobEnable2 ? 1 : 0), this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2), this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2), this._activeEffect.setFloat("_Blob_Inner_Fade_2_", this.blobInnerFade2), this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2), this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2), this._activeEffect.setFloat("_Gaze_Intensity_", this.gazeIntensity), this._activeEffect.setFloat("_Gaze_Focus_", this.gazeFocus), this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture), this._activeEffect.setFloat("_Selection_Fuzz_", this.selectionFuzz), this._activeEffect.setFloat("_Selected_", this.selected), this._activeEffect.setFloat("_Selection_Fade_", this.selectionFade), this._activeEffect.setFloat("_Selection_Fade_Size_", this.selectionFadeSize), this._activeEffect.setFloat("_Selected_Distance_", this.selectedDistance), this._activeEffect.setFloat("_Selected_Fade_Length_", this.selectedFadeLength), this._activeEffect.setFloat("_Proximity_Max_Intensity_", this.proximityMaxIntensity), this._activeEffect.setFloat("_Proximity_Far_Distance_", this.proximityFarDistance), this._activeEffect.setFloat("_Proximity_Near_Radius_", this.proximityNearRadius), this._activeEffect.setFloat("_Proximity_Anisotropy_", this.proximityAnisotropy), this._activeEffect.setFloat("_Use_Global_Left_Index_", this.useGlobalLeftIndex ? 1 : 0), this._activeEffect.setFloat("_Use_Global_Right_Index_", this.useGlobalRightIndex ? 1 : 0), this._afterBind(t, this._activeEffect));
  }
  /**
   * Get the list of animatables in the material.
   * @returns the list of animatables object used in the material
   */
  getAnimatables() {
    return [];
  }
  dispose(e) {
    super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new ys(e, this.getScene()), this);
  }
  serialize() {
    const e = jt.Serialize(this);
    return e.customType = "BABYLON.MRDLFrontplateMaterial", e;
  }
  getClassName() {
    return "MRDLFrontplateMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new ys(e.name, t), e, t, r);
  }
}
ys.BLOB_TEXTURE_URL = "";
C([
  M()
], ys.prototype, "radius", void 0);
C([
  M()
], ys.prototype, "lineWidth", void 0);
C([
  M()
], ys.prototype, "relativeToHeight", void 0);
C([
  M()
], ys.prototype, "edgeColor", void 0);
C([
  M()
], ys.prototype, "blobEnable", void 0);
C([
  M()
], ys.prototype, "blobPosition", void 0);
C([
  M()
], ys.prototype, "blobIntensity", void 0);
C([
  M()
], ys.prototype, "blobNearSize", void 0);
C([
  M()
], ys.prototype, "blobFarSize", void 0);
C([
  M()
], ys.prototype, "blobNearDistance", void 0);
C([
  M()
], ys.prototype, "blobFarDistance", void 0);
C([
  M()
], ys.prototype, "blobFadeLength", void 0);
C([
  M()
], ys.prototype, "blobInnerFade", void 0);
C([
  M()
], ys.prototype, "blobPulse", void 0);
C([
  M()
], ys.prototype, "blobFade", void 0);
C([
  M()
], ys.prototype, "blobPulseMaxSize", void 0);
C([
  M()
], ys.prototype, "blobEnable2", void 0);
C([
  M()
], ys.prototype, "blobPosition2", void 0);
C([
  M()
], ys.prototype, "blobNearSize2", void 0);
C([
  M()
], ys.prototype, "blobInnerFade2", void 0);
C([
  M()
], ys.prototype, "blobPulse2", void 0);
C([
  M()
], ys.prototype, "blobFade2", void 0);
C([
  M()
], ys.prototype, "gazeIntensity", void 0);
C([
  M()
], ys.prototype, "gazeFocus", void 0);
C([
  M()
], ys.prototype, "selectionFuzz", void 0);
C([
  M()
], ys.prototype, "selected", void 0);
C([
  M()
], ys.prototype, "selectionFade", void 0);
C([
  M()
], ys.prototype, "selectionFadeSize", void 0);
C([
  M()
], ys.prototype, "selectedDistance", void 0);
C([
  M()
], ys.prototype, "selectedFadeLength", void 0);
C([
  M()
], ys.prototype, "proximityMaxIntensity", void 0);
C([
  M()
], ys.prototype, "proximityFarDistance", void 0);
C([
  M()
], ys.prototype, "proximityNearRadius", void 0);
C([
  M()
], ys.prototype, "proximityAnisotropy", void 0);
C([
  M()
], ys.prototype, "useGlobalLeftIndex", void 0);
C([
  M()
], ys.prototype, "useGlobalRightIndex", void 0);
Ue("BABYLON.GUI.MRDLFrontplateMaterial", ys);
const qme = "mrdlInnerquadPixelShader", bme = `uniform vec3 cameraPosition;varying vec2 vUV;varying vec3 vTangent;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;float FilterStep_Bid194(float edge,float x,float filterWidth)
{float dx=max(1.0E-5,fwidth(x)*filterWidth);return max((x+dx*0.5-max(edge,x-dx*0.5))/dx,0.0);}
void Round_Rect_B194(
float Size_X,
float Size_Y,
float Radius,
vec4 Rect_Color,
float Filter_Width,
vec2 UV,
float Glow_Fraction,
float Glow_Max,
float Glow_Falloff,
out vec4 Color)
{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius,Radius),halfSize),vec2(0.01,0.01));vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);vec2 delta=(v-nearestp)/max(vec2(0.01,0.01),r);float Distance=length(delta);float insideRect=1.0-FilterStep_Bid194(1.0-Glow_Fraction,Distance,Filter_Width);float glow=clamp((1.0-Distance)/Glow_Fraction,0.0,1.0);glow=pow(glow,Glow_Falloff);Color=Rect_Color*max(insideRect,glow*Glow_Max);}
void main()
{float X_Q192;float Y_Q192;float Z_Q192;X_Q192=vTangent.x;Y_Q192=vTangent.y;Z_Q192=vTangent.z;vec4 Color_Q194;Round_Rect_B194(X_Q192,1.0,Y_Q192,_Color_,_Filter_Width_,vUV,_Glow_Fraction_,_Glow_Max_,_Glow_Falloff_,Color_Q194);vec4 Out_Color=Color_Q194;float Clip_Threshold=0.0;gl_FragColor=Out_Color;}
`;
Le.ShadersStore[qme] = bme;
const xme = "mrdlInnerquadVertexShader", Dme = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;varying vec2 vUV;varying vec3 vTangent;void main()
{vec3 Pos_World_Q189;Pos_World_Q189=(world*vec4(position,1.0)).xyz;vec3 Dir_World_Q190;Dir_World_Q190=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q191;Dir_World_Q191=(world*vec4((cross(normal,tangent)),0.0)).xyz;float Length_Q180=length(Dir_World_Q190);float Length_Q181=length(Dir_World_Q191);float Quotient_Q184=Length_Q180/Length_Q181;float Quotient_Q195=_Radius_/Length_Q181;vec2 Result_Q193;Result_Q193=vec2((uv.x-0.5)*Length_Q180/Length_Q181,(uv.y-0.5));float Result_Q198=_Fixed_Radius_ ? Quotient_Q195 : _Radius_;vec3 Vec3_Q183=vec3(Quotient_Q184,Result_Q198,0);vec3 Position=Pos_World_Q189;vec3 Normal=vec3(0,0,0);vec2 UV=Result_Q193;vec3 Tangent=Vec3_Q183;vec3 Binormal=vec3(0,0,0);vec4 Color=color;gl_Position=viewProjection*vec4(Position,1);vUV=UV;vTangent=Tangent;}
`;
Le.ShadersStore[xme] = Dme;
class jme extends na {
  constructor() {
    super(), this._needNormals = !0, this._needUVs = !0, this.rebuild();
  }
}
class d4 extends P1 {
  constructor(e, t) {
    super(e, t), this.color = new xt(1, 1, 1, 0.05), this.radius = 0.12, this.fixedRadius = !0, this._filterWidth = 1, this.glowFraction = 0, this.glowMax = 0.5, this.glowFalloff = 2, this.alphaMode = et.ALPHA_COMBINE, this.backFaceCulling = !1;
  }
  needAlphaBlending() {
    return !0;
  }
  needAlphaTesting() {
    return !1;
  }
  getAlphaTestTexture() {
    return null;
  }
  // Methods
  isReadyForSubMesh(e, t) {
    if (this.isFrozen && t.effect && t.effect._wasPreviouslyReady)
      return !0;
    t.materialDefines || (t.materialDefines = new jme());
    const r = t.materialDefines, n = this.getScene();
    if (this._isReadyForSubMesh(t))
      return !0;
    const i = n.getEngine();
    if (Ye.PrepareDefinesForAttributes(e, r, !0, !1), r.isDirty) {
      r.markAsProcessed(), n.resetCachedMaterial();
      const s = new c1();
      r.FOG && s.addFallback(1, "FOG"), Ye.HandleFallbacksForShadows(r, s), r.IMAGEPROCESSINGPOSTPROCESS = n.imageProcessingConfiguration.applyByPostProcess;
      const a = [J.PositionKind];
      r.NORMAL && a.push(J.NormalKind), r.UV1 && a.push(J.UVKind), r.UV2 && a.push(J.UV2Kind), r.VERTEXCOLOR && a.push(J.ColorKind), r.TANGENT && a.push(J.TangentKind), Ye.PrepareAttributesForInstances(a, r);
      const f = "mrdlInnerquad", o = r.toString(), d = [
        "world",
        "worldView",
        "worldViewProjection",
        "view",
        "projection",
        "viewProjection",
        "cameraPosition",
        "_Color_",
        "_Radius_",
        "_Fixed_Radius_",
        "_Filter_Width_",
        "_Glow_Fraction_",
        "_Glow_Max_",
        "_Glow_Falloff_"
      ], v = [], u = [];
      Ye.PrepareUniformsAndSamplersList({
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: r,
        maxSimultaneousLights: 4
      }), t.setEffect(n.getEngine().createEffect(f, {
        attributes: a,
        uniformsNames: d,
        uniformBuffersNames: u,
        samplers: v,
        defines: o,
        fallbacks: s,
        onCompiled: this.onCompiled,
        onError: this.onError,
        indexParameters: { maxSimultaneousLights: 4 }
      }, i), r);
    }
    return !t.effect || !t.effect.isReady() ? !1 : (r._renderId = n.getRenderId(), t.effect._wasPreviouslyReady = !0, !0);
  }
  bindForSubMesh(e, t, r) {
    const n = this.getScene();
    if (!r.materialDefines)
      return;
    const s = r.effect;
    s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", n.getTransformMatrix()), this._activeEffect.setVector3("cameraPosition", n.activeCamera.position), this._activeEffect.setDirectColor4("_Color_", this.color), this._activeEffect.setFloat("_Radius_", this.radius), this._activeEffect.setFloat("_Fixed_Radius_", this.fixedRadius ? 1 : 0), this._activeEffect.setFloat("_Filter_Width_", this._filterWidth), this._activeEffect.setFloat("_Glow_Fraction_", this.glowFraction), this._activeEffect.setFloat("_Glow_Max_", this.glowMax), this._activeEffect.setFloat("_Glow_Falloff_", this.glowFalloff), this._afterBind(t, this._activeEffect));
  }
  /**
   * Get the list of animatables in the material.
   * @returns the list of animatables object used in the material
   */
  getAnimatables() {
    return [];
  }
  dispose(e) {
    super.dispose(e);
  }
  clone(e) {
    return jt.Clone(() => new d4(e, this.getScene()), this);
  }
  serialize() {
    const e = jt.Serialize(this);
    return e.customType = "BABYLON.MRDLInnerquadMaterial", e;
  }
  getClassName() {
    return "MRDLInnerquadMaterial";
  }
  // Statics
  static Parse(e, t, r) {
    return jt.Parse(() => new d4(e.name, t), e, t, r);
  }
}
C([
  M()
], d4.prototype, "color", void 0);
C([
  M()
], d4.prototype, "radius", void 0);
C([
  M()
], d4.prototype, "fixedRadius", void 0);
C([
  M()
], d4.prototype, "glowFraction", void 0);
C([
  M()
], d4.prototype, "glowMax", void 0);
C([
  M()
], d4.prototype, "glowFalloff", void 0);
Ue("BABYLON.GUI.MRDLInnerquadMaterial", d4);
class wme {
  constructor(e) {
    this._panelMap = /* @__PURE__ */ new Map(), this.add = (t, r) => {
      this._panelMap.set(t, new mme(t, this.manager, r));
    }, this.update = (t, r, n) => {
      const i = this._panelMap.get(t);
      i && i.update(r, n);
    }, this.delete = (t) => {
      const r = this._panelMap.get(t);
      r && r.dispose(), this._panelMap.delete(t);
    }, this.dispose = () => {
      this._panelMap.forEach((t) => t.dispose()), this._panelMap.clear(), this.adt.dispose(), this.ob ?? this.manager.scene.scene.onBeforeCameraRenderObservable.remove(this.ob);
    }, this.manager = e, this.adt = g6.CreateFullscreenUI("le5le_fullUI", !0, e.scene.scene);
  }
}
class mme {
  constructor(e, t, r) {
    this.contents = [], this._isFullUI = !1, this._radio = 1, this.init = (n, i) => {
      this.backgroundColor = new p9(), this.backgroundColor.thickness = 0, this._isFullUI ? (this.texture = this.backgroundColor, this.mesh.visibility = 0, this.texture.onPointerClickObservable.add(() => {
        if (this.mesh.isPickable && !this.manager.root.running) {
          let s = setTimeout(() => {
            this.manager.selectorManager.selectedNodes = [...this.manager.selectorManager.selectedNodes, this.mesh], clearTimeout(s);
          }, 100);
        }
      }), this.mesh.onEnabledStateChangedObservable.add((s) => {
        this.texture instanceof p9 && (s ? (this.manager.GUIManager.adt.addControl(this.texture), this.texture.linkWithMesh(this.mesh)) : this.manager.GUIManager.adt.removeControl(this.texture));
      }), this.texture.widthInPixels = (n || 1024) / this._radio, this.texture.heightInPixels = (i || 1024) / this._radio, this.manager.GUIManager.adt.addControl(this.texture), this.texture.linkWithMesh(this.mesh)) : (this.texture = g6.CreateForMesh(this.mesh, n || 1024, i || 1024), this.texture.addControl(this.backgroundColor)), this.backgroundImage = new ua(), this.texture.addControl(this.backgroundImage);
    }, this.update = (n, i) => {
      if (n === "width" || n === "height") {
        this.dispose();
        const { width: s, height: a, backgroundColor: f = "", imageSource: o = "", stretch: d = 1, contents: v = [] } = this.manager.getMetadata(this.mesh);
        this.init(s, a), this.update("backgroundColor", f), this.update("imageSource", o), this.update("stretch", d), this.update("contents", v);
      } else if (n === "backgroundColor")
        this.backgroundColor.background = i;
      else if (n === "imageSource")
        this.backgroundImage.source = i;
      else if (n === "stretch")
        this.backgroundImage.stretch = i;
      else if (n === "contents") {
        const s = i;
        this.contents.forEach((a) => a.dispose()), this.contents = s.map((a) => {
          const f = new Bme(this.texture);
          return f.update(a), f;
        });
      }
    }, this.dispose = () => {
      this.texture.removeControl(this.backgroundColor), this.backgroundColor.dispose(), this.backgroundColor = void 0, this.texture.removeControl(this.backgroundImage), this.backgroundImage.dispose(), this.backgroundImage = void 0, this.contents.forEach((n) => n.dispose()), this.contents = [], this.texture.dispose(), this.texture = void 0;
    }, this.manager = t, this.mesh = e, this._isFullUI = r, this.init(1024, 1024), this._isFullUI && (this._radio = 1024 / 200);
  }
}
class Bme {
  constructor(e) {
    this._radio = 1, this.create = (t = this.type) => {
      t !== this.type && (this.content && (this.texture.removeControl(this.content), this.content.dispose()), t === "text" ? this.content = new oo() : t === "image" && (this.content = new ua()), this.content && (this.texture.addControl(this.content), this.content.horizontalAlignment = 0, this.content.verticalAlignment = 0), this.type = t);
    }, this.update = (t) => {
      const {
        type: r,
        left: n,
        top: i,
        width: s,
        height: a,
        alpha: f,
        text: o,
        source: d,
        fontFamily: v,
        fontSize: u,
        fontStyle: l,
        fontWeight: P,
        textAlign: p,
        verticalAlign: c,
        color: H,
        stretch: T
      } = t;
      if (this.box.update(t), this.create(r), this.content.left = n / this._radio + "px", this.content.top = i / this._radio + "px", this.content.width = s / this._radio + "px", this.content.height = a / this._radio + "px", this.content.alpha = f ?? 1, r === "text") {
        const q = this.content;
        o && (q.text = o), H && (q.color = H), v && (q.fontFamily = v), u && (q.fontSize = u / this._radio), l && (q.fontStyle = l), P && (q.fontWeight = P), p && (q.textHorizontalAlignment = o$(p)), c && (q.textVerticalAlignment = o$(c));
      } else if (r === "image") {
        const q = this.content;
        q.source = d, q.stretch = T ?? 1;
      }
    }, this.dispose = () => {
      this.box.dispose(), this.content && (this.texture.removeControl(this.content), this.content.dispose());
    }, e instanceof p9 && (this._radio = 1024 / 200), this.box = new Wme(e), this.texture = e, this.create();
  }
}
class Wme {
  constructor(e) {
    this._radio = 1, this.update = (t) => {
      const { width: r, height: n, left: i, top: s, backgroundColor: a, alpha: f } = t;
      this.rectangle.width = r / this._radio + "px", this.rectangle.height = n / this._radio + "px", this.rectangle.left = i / this._radio + "px", this.rectangle.top = s / this._radio + "px", this.rectangle.background = a, this.rectangle.alpha = f ?? 1;
    }, this.dispose = () => {
      this.texture.removeControl(this.rectangle), this.rectangle.dispose();
    }, e instanceof p9 && (this._radio = 1024 / 200), this.rectangle = new p9(), this.rectangle.thickness = 0, e.addControl(this.rectangle), this.rectangle.horizontalAlignment = 0, this.rectangle.verticalAlignment = 0, this.texture = e;
  }
}
const o$ = (A = "center") => ({
  start: 0,
  center: 2,
  end: 1
})[A];
function cUe(A, e) {
  const t = Sme(e);
  if (!t)
    return;
  const r = new _ne(Zn(), 0.2, A, { updatable: !0 });
  r.addPoints(t.length, (i, s) => {
    i.color = Ne.Random(), i.position = t[s];
  });
  const n = r.buildMeshAsync();
  return n.then((i) => {
    i.onDispose = () => {
      r.dispose();
    };
  }), n;
}
function Sme(A) {
  const e = [];
  return A.split(`
`).forEach((r, n) => {
    const i = r.split("	");
    if (i[0])
      e.push(S.FromArray([Number(i[0]), Number(i[1]), Number(i[2])]));
    else
      return !1;
  }), e;
}
function pUe(A) {
  const e = [];
  return A.split(`
`).forEach((r, n) => {
    r.split("	").forEach((s) => {
      s && e.push(Number(s));
    });
  }), e;
}
class hUe {
  constructor(e) {
    this.points = [], this.lines = [], this.GUIs = [], this.lineDatas = [], this._currentFP = null, this._currentSP = null, this._currentFPNode = null, this._currentSPNode = null, this._isMark = !1, this.manager = e, this.scene = e.scene.scene;
    const t = this.scene.getTextureByName("fullUI");
    this.adt = t || g6.CreateFullscreenUI("fullUI", !0, this.scene), e.adt = this.adt, this.createGUIHotSpot(), this._obserable = this.scene.onPointerObservable.add((r, n) => {
      n.mask == 32 && r.pickInfo.hit && this._isMark && (this._currentFP ? (this._currentSP = r.pickInfo.pickedPoint, this.createPointLine(
        this._currentFP,
        this._currentSP,
        this.scene
      ), this.isMark = !1) : (this.currentFP = !0, this._currentFP = r.pickInfo.pickedPoint));
    }), this._keyBoardObserable = this.scene.onPreKeyboardObservable.add((r, n) => {
      r.event.key == "l" && n.mask == 2 && (this.isMark = !0, this.adt.addControl(this._Textblock), this._Textblock.text = "请选择一个顶点"), (r.event.key == "Escape" && n.mask == 2 || r.event.key == "z") && (this.isMark = !1, this.adt.removeControl(this._Textblock));
    }), this._Textblock = new oo("textblock"), this._Textblock.top = "-30%", this._Textblock.text = "请选择一个顶点";
  }
  set isShow(e) {
  }
  set isMark(e) {
    this.currentFP = null, this.currentSP = null, this._isMark = e;
  }
  set currentFP(e) {
    var t;
    e instanceof fg && (this._currentFPNode = e, this._currentFP = (t = e == null ? void 0 : e.linkedMesh) == null ? void 0 : t.position), e || (this._currentFP = null), e && (this._Textblock.text = "请选择第二个坐标点");
  }
  set currentSP(e) {
    var t;
    e instanceof fg && (this._currentSP = (t = e == null ? void 0 : e.linkedMesh) == null ? void 0 : t.position, this._currentSPNode = e, this._currentFPNode && (this._currentFPNode.background = "#19CAAD "), this._currentSPNode && (this._currentSPNode.background = "#19CAAD ")), this._isMark = !1, this.adt.removeControl(this._Textblock);
  }
  createPointLine(e, t, r) {
    var p, c;
    const n = S.Center(e, t);
    n.y += 1;
    const i = S.Distance(e, t).toFixed(2), s = S.Normalize(
      S.Cross(n.subtract(e), n.subtract(t))
    ), a = e.subtract(s.scale(Number(i) * 0.3)), f = e, o = S.Center(a, f), d = t.subtract(s.scale(Number(i) * 0.3)), v = t, u = S.Center(d, v), l = Ef.CreateLines(
      "lines",
      {
        points: [a, f, o, u, d, v],
        updatable: !0
      },
      r
    );
    (p = this.manager.highlightLayer) == null || p.addExcludedMesh(l), l.renderingGroupId = 1, l.isPickable = !1, l.color = Ne.FromHexString("#19CAAD");
    const P = new oo("text");
    P.color = "#F4606C", P.resizeToFit = !0, P.linkOffsetYInPixels = -10, (c = this.adt) == null || c.addControl(P), P.linkWithMesh(l), P.text = S.Distance(e, t).toFixed(2) + "m", this.lines.push(l), this.lineDatas.push({
      mesh: l,
      dataList: [e, t],
      control: P
    });
  }
  createPoints(e) {
    this.points.forEach((t) => {
      t.dispose();
    }), this.scene.meshes.forEach((t) => {
    });
  }
  createGUIHotSpot() {
    this.scene.meshes.forEach((e) => {
      !(e instanceof Tp) && !TD(e) && this.addNineHotSpot(e);
    });
  }
  addNineHotSpot(e) {
    const t = e.getBoundingInfo().boundingBox.vectorsWorld;
    [e.getBoundingInfo().boundingBox.centerWorld, ...t].forEach((n) => {
      var a;
      let i = new fg("but");
      (a = this.adt) == null || a.addControl(i);
      const s = new Hr("node", this.scene);
      s.position = n, i.linkWithMesh(s), i.width = "10px", i.height = "10px", i.background = "#19CAAD ", i.onPointerClickObservable.add(() => {
        this._isMark && (i.background = "white", this._currentFP ? (this.currentSP = i, this.createPointLine(
          this._currentFP,
          this._currentSP,
          this.scene
        ), this.isMark = !1) : this.currentFP = i);
      }), this.GUIs.push(i);
    });
  }
  updataLines() {
    this.lineDatas.forEach((e) => {
      const t = e.dataList[0], r = e.dataList[1], n = S.Center(t, r);
      n.y += 1;
      const i = S.Normalize(
        S.Cross(n.subtract(t), n.subtract(r))
      ), s = t.subtract(i), a = t, f = S.Center(s, a), o = r.subtract(i), d = r, v = S.Center(o, d);
      e.mesh = Ef.CreateLines(
        "lines",
        {
          points: [s, a, f, v, o, d],
          updatable: !0,
          instance: e.mesh
        },
        this.scene
      ), e.mesh.bakeCurrentTransformIntoVertices(), e.control.text = S.Distance(e.dataList[0], e.dataList[1]).toFixed(
        2
      ) + "m";
    });
  }
  dispose() {
    this.points.forEach((e) => {
      e.dispose();
    }), this.points.length = 0, this.lines.forEach((e) => {
      e.dispose();
    }), this.lines.length = 0, this.GUIs.forEach((e) => {
      e.dispose();
    }), this.GUIs.length = 0, this._currentFP = null, this._currentSP = null, this._currentFPNode = null, this._currentSPNode = null, this._isMark = null, this.scene.onPointerObservable.remove(this._obserable), this._obserable = null, this.scene.onPreKeyboardObservable.remove(this._keyBoardObserable), this._keyBoardObserable = null;
  }
}
class HUe {
  constructor(e) {
    this._isMark = !1, this.manager = e, this.scene = e.scene.scene;
    const t = this.scene.getTextureByName("fullUI");
    this.adt = t || g6.CreateFullscreenUI("fullUI", !0, this.scene), this._keyBoardObserable = this.scene.onPreKeyboardObservable.add((r, n) => {
      r.event.key == "f" && n.mask == 2 && (this.isMark = !this._isMark, this._isMark ? this.adt.addControl(this._Textblock) : (this.adt.removeControl(this._Textblock), this.sourceMat = null)), (r.event.key == "Escape" && n.mask == 1 || r.event.key == "z") && (this.isMark = !1, this.adt.removeControl(this._Textblock), this.sourceMat = null);
    }), this._Textblock = new oo("textblock"), this._Textblock.top = "-25%", this._Textblock.text = "请选择模板", this._obserable = this.scene.onPointerObservable.add((r, n) => {
      var i, s;
      if (n.mask == 32 && this.manager.id == ((i = this.manager.root.getScene()) == null ? void 0 : i.id) && r.pickInfo.pickedMesh && !TD(r.pickInfo.pickedMesh) && this._isMark) {
        const a = r.pickInfo.pickedMesh;
        this._sourceMat ? this.brashMeshesMat(a, (s = a.material) == null ? void 0 : s.name, this._sourceMat) : this.sourceMat = a.material ? a.material.name : "kong";
      }
    });
  }
  set sourceMat(e) {
    this._sourceMat = e, e ? this._Textblock.text = "请选择格式刷对象,格式刷的对象共享一个资源" : this._Textblock.text = "请选择模板";
  }
  set isMark(e) {
    this._isMark = e, e || (this.sourceMat = null);
  }
  brashMeshesMat(e, t, r) {
    this.record = {
      type: eD.MatBrash,
      infos: [
        {
          target: e.name,
          props: {
            material: {
              oldValue: t,
              newValue: r
            }
          }
        }
      ]
    }, this.manager.undoRedoManager.add(this.record), e instanceof Ee ? e.material = this.scene.getMaterialByName(r) : e instanceof bp && (e.sourceMesh.material = this.scene.getMaterialByName(r));
  }
  dispose() {
    this.sourceMat = void 0, this.scene.onPointerObservable.remove(this._obserable), this._obserable = void 0, this.record = void 0, this._isMark = void 0, this.scene.onPreKeyboardObservable.remove(this._keyBoardObserable);
  }
}
const KW = class KW {
  static Serialize(e) {
    if (e.parent) {
      console.error("结点:+" + e.id + "存在某种绑定关系,请解绑后重试！");
      return;
    }
    const t = e.getScene();
    t.transformNodes.forEach((u) => {
      u.doNotSerialize = !0;
    }), t.meshes.forEach((u) => {
      u.doNotSerialize = !0, u.skeleton && (u.skeleton.doNotSerialize = !0), u.material && (u.material.doNotSerialize = !0);
    });
    const r = [], n = e.getChildTransformNodes(!1);
    n.push(e);
    let i = [];
    const s = /* @__PURE__ */ new Map();
    for (const u of n)
      u.doNotSerialize = !1, u instanceof Ee && (u.material && (u.material.doNotSerialize = !1), u.skeleton && (u.skeleton.doNotSerialize = !1), u.geometry && i.push(u.geometry)), u.metadata.modelAnimations && u.metadata.modelAnimations.forEach((l) => {
        t.animationGroups.forEach((P) => {
          var p;
          l.id == ((p = P.metadata) == null ? void 0 : p.id) && r.push(P.serialize());
        });
      });
    i = Array.from(new Set(i));
    const a = Rme(i), f = {
      boxes: [],
      cylinders: [],
      grounds: [],
      planes: [],
      spheres: [],
      torusKnots: [],
      toruses: [],
      vertexData: a
    };
    t.geometries.forEach((u) => {
      let l = [];
      u.meshes.forEach((P) => {
        l.push(P);
      }), s.set(u, l), l.forEach((P) => {
        u.releaseForMesh(P);
      });
    });
    let o = G2.Serialize(e.getScene());
    s.forEach((u, l) => {
      u.forEach((P) => {
        l.applyToMesh(P);
      });
    }), s.clear();
    const d = {
      animationGroups: r,
      transformNodes: o.transformNodes,
      meshes: o.meshes,
      materials: o.materials,
      geometries: f,
      skeletons: o.skeletons
    }, v = JSON.stringify(d);
    Ume(e.id + KW.FileName, v);
  }
  static Parse(e, t, r, n) {
    return Hn.LoadAssetContainerAsync(e, t, r, n, KW.LoadPlugin);
  }
  static optimizeGlb(e) {
    if (e.parent) {
      console.error("当前节点含有父类元素，无法进行优化！");
      return;
    }
    let t = [], r = /* @__PURE__ */ new Map(), n = e.getScene();
    e.getChildMeshes().forEach((s) => {
      var a, f, o, d, v, u, l, P, p, c, H, T, q, b, j, w, m, I, N;
      if (s.setParent(null), s instanceof Ee && s.geometry) {
        let k = (f = (a = s.geometry) == null ? void 0 : a.getIndices()) == null ? void 0 : f.length, R = (d = (o = s.geometry) == null ? void 0 : o.getVertexBuffer(J.NormalKind)) == null ? void 0 : d.getSize(), y = (u = (v = s.geometry) == null ? void 0 : v.getVertexBuffer(J.PositionKind)) == null ? void 0 : u.getSize(), O = k + "-" + R + "-" + y, Y = !1;
        if (t.includes(O)) {
          let ee = n.getMeshByUniqueId(r.get(O)), Z = (l = s.geometry) == null ? void 0 : l.getIndices(), te = (P = ee.geometry) == null ? void 0 : P.getIndices(), fe = (c = (p = s.geometry) == null ? void 0 : p.getVertexBuffer(J.NormalKind)) == null ? void 0 : c.getData(), _ = (T = (H = ee.geometry) == null ? void 0 : H.getVertexBuffer(J.NormalKind)) == null ? void 0 : T.getData(), G = (q = s.geometry.getVertexBuffer(J.PositionKind)) == null ? void 0 : q.getData(), L = (j = (b = ee.geometry) == null ? void 0 : b.getVertexBuffer(J.PositionKind)) == null ? void 0 : j.getData(), $ = {
            indivces: !1,
            normal: !1,
            position: !1
          };
          te && Z && Z.every((ae, Pe) => ae === te[Pe]) && ($.indivces = !0), fe && _ && _.every((ae, Pe) => ae === fe[Pe]) && ($.normal = !0), G && L && L.every((ae, Pe) => ae === G[Pe]) && ($.position = !0), $.indivces && $.normal && $.position && (Y = !0, console.log("当前认为网格" + s.name + "与网格" + ee.name + "是相同的网格"));
        }
        if (!Y)
          t.push(O), r.set(O, s.uniqueId);
        else {
          let ee = s.position.clone(), Z = (w = s.rotationQuaternion) == null ? void 0 : w.clone(), te = (m = s.rotation) == null ? void 0 : m.clone(), fe = s.scaling.clone();
          console.log("当前的网格数组：" + O);
          let _ = r.get(O), G = s.parent;
          if (_) {
            s.setEnabled(!1);
            let L = n.getMeshByUniqueId(_), $ = L.createInstance(L.name + "Instance");
            L.material && (L.material.backFaceCulling = !1);
            let ae = (I = s.material) == null ? void 0 : I.getActiveTextures();
            ae == null || ae.forEach((Pe) => {
              var ge;
              (ge = L.material) != null && ge.hasTexture(Pe) || Pe.dispose();
            }), L.material != s.material && ((N = s.material) == null || N.dispose()), $.setParent(G), s.dispose(), $.position = ee, Z ? $.rotationQuaternion = Z : $.rotation = te, $.scaling = fe;
          }
        }
      }
    }), console.log(t), r.clear(), t.length = 0;
  }
};
KW.LoadPlugin = ".babylon", KW.FileName = ".l5l";
let f$ = KW;
function Ume(A, e) {
  Ime(A, e);
}
function Ime(A, e) {
  var t = document.createElement("a");
  t.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(e)), t.setAttribute("download", A), t.style.display = "none", document.body.appendChild(t), t.click(), document.body.removeChild(t);
}
function Rme(A) {
  const e = [];
  return A.forEach((t) => {
    let r = t.getIndices(), n = t == null ? void 0 : t.getVerticesData(J.PositionKind, !0, !0), i = t.getVerticesData(J.UVKind, !0, !0), s = t.getVerticesData(
      J.NormalKind,
      !0,
      !0
    ), a = t.getVerticesData(
      J.ColorKind,
      !0,
      !0
    ), f = t.getVerticesData(J.UV2Kind, !0, !0), o = t.getVerticesData(J.UV3Kind, !0, !0), d = t.getVerticesData(J.UV4Kind, !0, !0), v = t.getVerticesData(J.UV5Kind, !0, !0), u = t.getVerticesData(J.UV6Kind, !0, !0), l = t.getVerticesData(
      J.MatricesIndicesKind,
      !0,
      !0
    ), P = t.getVerticesData(
      J.TangentKind,
      !0,
      !0
    ), p = t.getVerticesData(
      J.MatricesWeightsKind,
      !0,
      !0
    ), c = t.getVerticesData(
      J.MatricesWeightsExtraKind,
      !0,
      !0
    ), H = t.getVerticesData(
      J.ColorInstanceKind,
      !0,
      !0
    ), T = t.getVerticesData(
      J.MatricesIndicesExtraKind,
      !0,
      !0
    );
    const q = {
      id: t.id,
      uniqueId: t.uniqueId,
      indices: r,
      uvs: i,
      positions: n,
      normals: s,
      colors: a,
      uvs2: f,
      uvs3: o,
      uvs4: d,
      uvs5: v,
      uvs6: u,
      matricesIndices: l,
      tangents: P,
      matricesWeights: p,
      matricesWeightsExtra: c,
      colorInstance: H,
      matricesIndicesExtraKind: T
    };
    e.push(q);
  }), e;
}
const _6 = class _6 {
};
_6.GetTargetStateDatas = (e, t) => (t.getValue(e, "states") || []).map((n) => ({
  property: n.id,
  name: n.name || n.id,
  fullProperty: n.id,
  fullName: n.name || n.id,
  animatable: n.animatable,
  value: n.value,
  valueType: _6.DataTypeToValueType(n.dataType)
})), _6.GetTargetUpdatableProperties = (e, t) => {
  e = typeof e == "string" ? t.getTargetById(e) : e;
  const r = (n, i, s = "le5le", a = "属性") => {
    const f = [], o = zt.getValueInfo(n, i);
    if (!o)
      return f;
    const d = [];
    return o.forEach((v) => {
      const { property: u, name: l, valueType: P, animatable: p, getValue: c, updatable: H } = v, T = s ? s + "#" + u : u, q = a ? a + "#" + l : l, b = Array.isArray(P) ? zt.typeOf(c(n, i), i) : P;
      if ([
        se.String,
        se.Number,
        se.Boolean,
        se.Color3,
        se.Color4
      ].includes(b))
        H && f.push({
          name: l,
          property: u,
          fullProperty: T,
          fullName: q,
          valueType: b,
          animatable: !!p,
          value: i.getValue(n, u)
        });
      else if (b !== se.Unknown) {
        const j = c(n, i);
        j instanceof Object && "metadata" in j && d.push({
          target: j,
          valueType: b,
          name: l,
          fullName: q,
          property: u,
          fullProperty: T
        });
      }
    }), [
      ...f,
      ...d.reduce(
        (v, u) => [
          ...v,
          ...r(u.target, i, u.fullProperty, u.fullName)
        ],
        []
      )
    ];
  };
  return r(e, t);
}, _6.GetTargetUpdatableContents = (e, t) => {
  const r = t.getValue(e, "contents") || [], n = [];
  return r.forEach((i) => {
    const { name: s, type: a, text: f, color: o, source: d } = i, v = "le5le#contents#" + s + "#", u = `内容#${s}#`;
    a === "text" ? n.push(
      {
        name: "文字",
        property: "text",
        fullName: u + "文字",
        fullProperty: v + "text",
        value: f,
        valueType: se.String,
        animatable: !1
      },
      {
        name: "颜色",
        property: "color",
        fullName: u + "颜色",
        fullProperty: v + "color",
        value: o,
        valueType: se.Color4,
        animatable: !1
      }
    ) : a === "image" && n.push(
      {
        name: "图片",
        property: "source",
        fullName: u + "图片",
        fullProperty: v + "source",
        value: d,
        valueType: se.String,
        animatable: !1
      }
    );
  }), n;
}, _6.GetTargetUpdatableAnimations = (e, t) => {
  const r = t.getValue(e, "animations") || [], n = [];
  return r.forEach((i) => {
    const { name: s, loopMode: a, cycles: f, speedRatio: o, endStatus: d, list: v } = i, u = "le5le#animations#" + s + "#", l = "自定义动画#" + s + "#";
    n.push(
      {
        name: "循环模式",
        property: "loopMode",
        fullName: l + "循环模式",
        fullProperty: u + "loopMode",
        value: a,
        valueType: se.Number,
        animatable: !1
      },
      {
        name: "循环次数",
        property: "cycles",
        fullName: l + "循环次数",
        fullProperty: u + "cycles",
        value: f,
        valueType: se.Number,
        animatable: !1
      },
      {
        name: "动画速率",
        property: "speedRatio",
        fullName: l + "动画速率",
        fullProperty: u + "speedRatio",
        value: o,
        valueType: se.Number,
        animatable: !1
      },
      {
        name: "结束状态",
        property: "endStatus",
        fullName: l + "结束状态",
        fullProperty: u + "endStatus",
        value: d,
        valueType: se.Number,
        animatable: !1
      }
    ), v.forEach((P) => {
      const { name: p, startTime: c, endTime: H, list: T } = P, q = u + "list#" + p + "#", b = l + "时间段#" + p + "#";
      n.push(
        {
          name: "开始时间",
          property: "startTime",
          fullName: b + "开始时间",
          fullProperty: q + "startTime",
          value: c,
          valueType: se.Number,
          animatable: !1
        },
        {
          name: "结束时间",
          property: "endTime",
          fullName: b + "结束时间",
          fullProperty: q + "endTime",
          value: H,
          valueType: se.Number,
          animatable: !1
        }
      ), T.forEach((j) => {
        const {
          property: w,
          valueType: m,
          startValue: I,
          endValue: N,
          name: k = w
        } = j, R = q + "list#" + w + "#", y = b + "属性列表#" + k + "#";
        n.push(
          {
            name: "开始值",
            property: "startValue",
            fullName: y + "开始值",
            fullProperty: R + "startValue",
            value: I,
            valueType: m,
            animatable: !1
          },
          {
            name: "结束值",
            property: "endValue",
            fullName: y + "结束值",
            fullProperty: R + "endValue",
            value: N,
            valueType: m,
            animatable: !1
          }
        );
      });
    });
  }), n;
}, _6.GetTargetUpdatableGroupAnimations = (e, t) => {
  const r = t.getValue(e, "groupAnimations") || [], n = [];
  return r.forEach((i) => {
    const { name: s, cycles: a, speedRatio: f, endStatus: o } = i, d = "le5le#groupAnimations#" + s + "#", v = "自带动画#" + s + "#";
    n.push(
      {
        name: "循环次数",
        property: "cycles",
        fullName: v + "循环次数",
        fullProperty: d + "cycles",
        value: a,
        valueType: se.Number,
        animatable: !1
      },
      {
        name: "动画速率",
        property: "speedRatio",
        fullName: v + "动画速率",
        fullProperty: d + "speedRatio",
        value: f,
        valueType: se.Number,
        animatable: !1
      },
      {
        name: "结束状态",
        property: "endStatus",
        fullName: v + "结束状态",
        fullProperty: d + "endStatus",
        value: o,
        valueType: se.Number,
        animatable: !1
      }
    );
  }), n;
}, _6.GetTargetsCommonStateDatas = (e, t) => {
  const r = e.map(
    (n) => _6.GetTargetStateDatas(n, t)
  );
  return pI(r);
}, _6.GetTargetsCommonUpdatableProperties = (e, t) => {
  const r = e.map(
    (n) => _6.GetTargetUpdatableProperties(n, t)
  );
  return pI(r);
}, _6.GetTargetsCommonUpdatableContents = (e, t) => {
  const r = e.map(
    (n) => _6.GetTargetUpdatableContents(n, t)
  );
  return pI(r);
}, _6.GetTargetsCommonUpdatableAnimations = (e, t) => {
  const r = e.map(
    (n) => _6.GetTargetUpdatableAnimations(n, t)
  );
  return pI(r);
}, _6.GetTargetsCommonUpdatableGroupAnimations = (e, t) => {
  const r = e.map(
    (n) => _6.GetTargetUpdatableGroupAnimations(n, t)
  );
  return pI(r);
}, _6.GetNestedValue = (e, t) => {
  const r = typeof t == "string" ? t.split("#") : t;
  if (!r.length)
    return { success: !0, value: e };
  let n = e, i = r[0];
  for (const s of r.slice(1)) {
    if (V0(n))
      n = e[i];
    else if (XN(n))
      n = n.find((a) => a.name === i);
    else
      return console.error("Methods.GetNestedValue error: 当前对象不是Object或者Array", e, n, r, i), { success: !1, value: void 0 };
    i = s;
  }
  return V0(n) ? { success: !0, value: n[i] } : (console.error("Methods.GetNestedValue error: 当前对象不是Object", e, n, r, i), { success: !1, value: void 0 });
}, _6.SetNestedValue = (e, t, r) => {
  const n = typeof t == "string" ? t.split("#") : t;
  if (!n.length)
    return !1;
  let i = e, s = n[0];
  for (const a of n.slice(1)) {
    if (V0(i))
      i = e[s];
    else if (XN(i))
      i = i.find((f) => f.name === s);
    else
      return console.error("setNestedValue error: 当前对象不是Object或者Array", e, i, n, s), !1;
    s = a;
  }
  return V0(i) ? (i[s] = r, !0) : (console.error("setNestedValue error: 当前对象不是Object", e, i, n, s), !1);
}, _6.DataTypeToValueType = (e) => ({
  [Mo.String]: se.String,
  [Mo.Number]: se.Number,
  [Mo.Boolean]: se.Boolean
})[e];
let hR = _6;
function pI(A) {
  const e = /* @__PURE__ */ new Map();
  return A.forEach(
    (t) => t.forEach((r) => {
      const {
        property: n,
        name: i,
        fullProperty: s,
        fullName: a,
        valueType: f,
        animatable: o,
        value: d
      } = r, v = e.get(s) || {
        count: 0,
        data: {
          property: n,
          name: i,
          fullProperty: s,
          fullName: a,
          valueType: f,
          animatable: o,
          values: []
        }
      };
      v.count++, v.data.values.push(d), e.set(s, v);
    })
  ), [...e.values()].filter((t) => t.count === A.length).map((t) => t.data);
}
class Vme {
  constructor(e) {
    this.getValue = (t, r) => {
      var n, i;
      return (i = (n = this.manager.getValue(t, "states")) == null ? void 0 : n.find((s) => s.id === r)) == null ? void 0 : i.value;
    }, this.setValue = (t, r, n, i = !1) => {
      const s = this.manager.getValue(t, "states");
      if (!(s != null && s.length))
        return;
      const a = s.find((o) => o.id === r);
      if (!a)
        return;
      const f = this._transValue(a, n);
      (i || a.value !== f) && (a.value = f, this.manager.setValue({ target: t, props: { states: s } }, { history: !1, onEnd: () => {
        this.manager.eventManager.executeTrigger("AfterSetValue", t, { target: t, id: r }), this.updateState(t, r);
      } }));
    }, this.updateState = (t, r) => {
      var u;
      const n = (u = this.manager.getValue(t, "states")) == null ? void 0 : u.find((l) => l.id === r);
      if (!n)
        return;
      const {
        id: i,
        value: s,
        list: a,
        duration: f = 0,
        easingMode: o = pp.None
      } = n, [d, ...v] = i.split("#");
      if (v[0] === "le5le") {
        const l = this.manager.getTargetsByRoot(t)[d], [, ...P] = v;
        if (P[0] === "contents" || P[0] === "animations" || P[0] === "groupAnimations") {
          const [p, ...c] = P, H = this.manager.getValue(t, p);
          hR.SetNestedValue(H, c, s) && this.manager.setValue(
            { target: l, props: { [p]: H } },
            { history: !1 }
          );
        } else
          this.manager.setValue(
            {
              target: l,
              props: { [P.join("#")]: s }
            },
            { duration: f, easingMode: o, history: !1 }
          );
      }
      a.forEach((l) => {
        const { matchEvery: P, matches: p, controls: c } = l;
        this._match(s, P, p) && c.forEach((H) => {
          const { actionType: T, actionParam: q } = H;
          this.manager.eventManager.executeAction(
            T,
            t,
            q
          );
        });
      });
    }, this.dispose = () => {
    }, this._transValue = (t, r) => {
      const { id: n, valueType: i, dataType: s } = t, [a, ...f] = n.split("#");
      return f[0] === "le5le" ? p2e(r, i) : FH(r, s);
    }, this._match = (t, r, n) => {
      if (!n.length)
        return !1;
      const i = (s) => {
        const { symbol: a, value: f } = s;
        switch (a) {
          case "=":
            return t === f;
          case "!=":
            return t !== f;
          case "<":
            return t < f;
          case "<=":
            return t <= f;
          case ">":
            return t > f;
          case ">=":
            return t >= f;
        }
      };
      return r ? n.every((s) => i(s)) : n.some((s) => i(s));
    }, this.manager = e;
  }
}
var Cme = /* @__PURE__ */ ((A) => (A.Holographic = "Holographic", A))(Cme || {});
class gUe {
  constructor(e) {
    this.matName = "le5le", this.notStyleGroupId = "notStyle", this.manager = e, this.matMap = /* @__PURE__ */ new Map();
  }
  changeEffectStyleMat(e) {
    let t = [];
    this.manager.groupManager.map.forEach((r) => {
      r.name == this.notStyleGroupId && (t = r.nodeIds);
    }), this.manager.scene.scene.meshes.forEach((r) => {
      r instanceof Ee && !TD(r) && !t.includes(r.name) && (r.material = e);
    });
  }
  recordMatMap() {
    var e;
    (e = this.manager) == null || e.scene.scene.meshes.forEach((t) => {
      t instanceof Ee && !TD(t) && this.matMap.set(t, t.material);
    });
  }
  recoverEffectStyle() {
    this.matMap.forEach((e, t) => {
      t.material = e;
    });
  }
  recoverMat(e) {
    e instanceof Ee && this.matMap.has(e) && (e.material = this.matMap.get(e));
  }
  changeEffectStyle(e) {
    this.recordMatMap();
    const t = this.getEffectStyleMat(e);
    this.changeEffectStyleMat(t);
  }
  getEffectStyleMat(e) {
    const t = e || "Holographic";
    let r = this.manager.scene.scene.getMaterialByName(this.matName + t);
    if (!r) {
      r = new mr(this.matName + t, this.manager.scene.scene), r.roughness = 1, r.metallic = 0, zt.initMetadata(r, this.manager);
      const n = new We("img/textures/" + t + ".png", this.manager.scene.scene);
      r.useAlphaFromAlbedoTexture = !0, r.albedoTexture = n, r.emissiveColor = Ne.FromHexString("#3D85B8"), n.hasAlpha = !0, n.coordinatesIndex = 3, zt.initMetadata(n, this.manager);
    }
    return r.alphaMode = 1, r;
  }
  dispose() {
    var e, t, r;
    this.manager = void 0, (e = this.matMap) == null || e.clear(), (t = this.EffectStyleMat) == null || t.dispose(), this.matName = void 0, (r = this.EffectStyleMap) == null || r.clear(), this.notStyleGroupId = void 0;
  }
}
class Ome {
  constructor(e) {
    this.map = /* @__PURE__ */ new Map(), this.register = (t, r) => {
      this.map.delete(t), r.length && this.map.set(t, r);
    }, this.executeTrigger = (t, r, n) => {
      if (!this.manager.root.running)
        return;
      const i = [];
      if (r) {
        const s = this.manager.getValue(r, "id");
        i.push(
          ...(this.map.get(s) || []).map((a) => ({ target: r, data: a }))
        );
      } else
        this.map.forEach((s, a) => {
          const f = this.manager.getTargetById(a);
          i.push(...s.map((o) => ({ target: f, data: o })));
        });
      i.filter(
        ({ data: s }) => !s.disabled && s.triggerType === t && Ba.pass(
          t,
          r,
          this.manager,
          n,
          s.triggerParam
        )
      ).forEach(({ target: s, data: a }) => {
        a.list.filter(({ condition: f }) => this.parseCondition(s, f)).forEach(({ list: f }) => {
          f.forEach(
            ({ actionType: o, actionParam: d }) => this.executeAction(o, s, d)
          );
        });
      });
    }, this.executeAction = (t, r, n) => {
      this.manager.root.running && Go.execute(t, r, this.manager, n);
    }, this.describeAction = (t, r) => {
      const { actionType: n, actionParam: i } = r;
      return Go.describe(n, t, this.manager, i);
    }, this.parseCondition = (t, r) => {
      if (!r)
        return !0;
      const { list: n, every: i } = r;
      return n.length ? n[i ? "every" : "some"]((s) => {
        const {
          source1: a,
          targetId1: f,
          dataType1: o,
          value1: d,
          source2: v,
          targetId2: u,
          dataType2: l,
          value2: P,
          symbol: p
        } = s, c = this.getValueByConditionSource(t, {
          source: a,
          targetId: f,
          dataType: o,
          value: d
        }), H = this.getValueByConditionSource(t, {
          source: v,
          targetId: u,
          dataType: l,
          value: P
        });
        switch (p) {
          case "=":
            return c === H;
          case "!=":
            return c !== H;
          case "<":
            return c < H;
          case "<=":
            return c <= H;
          case ">":
            return c > H;
          case ">=":
            return c >= H;
        }
      }) : !0;
    }, this.describeCondition = (t, r) => {
      const { every: n, list: i } = r;
      return i.map((s) => {
        const {
          source1: a,
          source2: f,
          targetId1: o,
          targetId2: d,
          value1: v,
          value2: u,
          symbol: l
        } = s, P = l$(a), p = l$(f), c = P$(
          t,
          a,
          o,
          v,
          this.manager
        ), H = P$(
          t,
          f,
          d,
          u,
          this.manager
        ), T = rWe(l);
        return `当 ${[P, c, T, p, H].join(" ")} 时`;
      }).join(n ? " 并且 " : " 或者 ");
    }, this.getValueByConditionSource = (t, r) => {
      const { source: n, targetId: i, dataType: s, value: a } = r;
      if (n === hq.DynamicData)
        return this.manager.dynamicDataManager.getValue(a);
      if (n === hq.Property) {
        if (t = i || t, t)
          return a != null && a.startsWith("le5le#") ? this.manager.getValue(t, a.substring(6)) : this.manager.stateDataManager.getValue(t, a);
      } else if (n === hq.Value)
        return a || {
          [Mo.Boolean]: !1,
          [Mo.Number]: 0,
          [Mo.String]: ""
        }[s];
    }, this.getTriggerDefaultParams = (t) => Ba.getDefaultParam(t), this.getActionDefaultParam = (t) => Go.getDefaultParam(t), this.getActionDefaultParamListItem = (t) => Go.getDefaultParamListItem(t), this.dispose = () => {
      this.map.clear();
    }, this.manager = e;
  }
}
class yme {
  constructor(e) {
    this.nodesMap = /* @__PURE__ */ new Map(), this.idsMap = /* @__PURE__ */ new Map(), this.rootNodes = [], this.layers = [], this.addNodes = (t) => {
      Xa(t).forEach((n) => {
        if (!n)
          return;
        const i = this.rootNodes.find((a) => a.node === n);
        let s = !i || i.removed;
        if (i)
          i.removed = !1;
        else {
          const a = (l) => {
            const P = l.node, p = P.getChildren().filter((c) => !TD(c) && c instanceof Hr);
            this.nodesMap.set(P, { parent: l.parent, children: p }), p.forEach((c) => {
              const H = { node: c, parent: P, children: [] };
              l.children.push(H), a(H);
            });
          }, f = { node: n, parent: null, children: [], removed: !1 };
          a(f), this.rootNodes.push(f);
          const { __valueType: o, __initOption: d } = this.manager.getMetadata(n);
          let v = n, u = null;
          if (o === se.InstancedMesh && (v = this.getTargetById(d.source), u = n), v) {
            const l = this.rootNodes.find(
              (P) => P.node === v
            );
            if (l) {
              const { __glbUrl: P, __glbName: p, __glbUUID: c, __initOption: H } = this.manager.getMetadata(v), T = c ? P + p : H.type, q = c ? p : this._getLayerName(T);
              let b = this.layers.find((w) => w.id === T);
              b || (b = b = { id: T, name: q, children: [] }, this.layers.push(b));
              let j = b.children.find(
                (w) => w.nodeTreeItem === l
              );
              if (j || (j = {
                nodeTreeItem: l,
                instancedNodeTreeItems: []
              }, b.children.push(j)), u) {
                const w = this.rootNodes.find(
                  (m) => m.node === u
                );
                w && !j.instancedNodeTreeItems.includes(w) && j.instancedNodeTreeItems.push(w);
              }
            } else if (u) {
              const P = this.rootNodes.findIndex((p) => p.node === u);
              P > -1 && this.rootNodes.splice(P);
            }
          }
        }
        s && [n, ...this.getChildren(n)].forEach((a) => {
          if (a instanceof jn) {
            const o = a;
            this.manager.getValue(
              o,
              "generateShadow"
            ) && this.manager.scene.scene.lights.forEach((v) => {
              const u = v.getShadowGenerator();
              u == null || u.addShadowCaster(o, !0);
            }), this.manager.scene.scene.meshes.indexOf(o) === -1 && this.manager.scene.scene.addMesh(o, !1);
          } else
            a instanceof Hr && this.manager.scene.scene.transformNodes.indexOf(a) === -1 && this.manager.scene.scene.transformNodes.indexOf(a) === -1 && this.manager.scene.scene.addTransformNode(a);
          const f = this.manager.getMetadata(a);
          this.manager.groupManager.register(a.name, f.groups || []);
        });
      });
    }, this.removeNodes = (t) => {
      Xa(t).forEach((n) => {
        if (!n)
          return;
        const i = this.rootNodes.find((s) => s.node === n);
        (!i || !i.removed) && [n, ...this.getChildren(n)].forEach((s) => {
          if (s instanceof jn) {
            const a = s;
            this.manager.getValue(
              a,
              "generateShadow"
            ) && this.manager.scene.scene.lights.forEach((o) => {
              const d = o.getShadowGenerator();
              d == null || d.removeShadowCaster(a, !0);
            }), this.manager.scene.scene.removeMesh(a, !1);
          } else if (s instanceof Hr) {
            const a = s;
            this.manager.scene.scene.removeTransformNode(a);
          }
          this.manager.groupManager.register(s.name, []);
        }), i && (i.removed = !0);
      });
    }, this.disposeNodes = (t) => {
      Xa(t).forEach((n) => {
        if (!n)
          return;
        const i = this.manager.getMetadata(n);
        if (i) {
          const { __valueType: a, __initOption: f } = i;
          let o = n, d = null;
          if (a === se.InstancedMesh && (o = this.getTargetById(f.source), d = n), o) {
            const { __glbUrl: v, __initOption: u } = this.manager.getMetadata(o), l = v || u.type, P = this.layers.find((p) => p.id === l);
            if (P) {
              const p = this.rootNodes.find(
                (H) => H.node === o
              ), c = P.children.findIndex(
                (H) => H.nodeTreeItem === p
              );
              if (c > -1) {
                const H = P.children[c];
                if (d) {
                  const T = H.instancedNodeTreeItems.findIndex(
                    (q) => q.node === d
                  );
                  T > -1 && H.instancedNodeTreeItems.splice(T, 1);
                } else
                  P.children.splice(c, 1);
              }
            }
          }
        }
        const s = this.rootNodes.findIndex((a) => a.node === n);
        s > -1 && this.rootNodes.splice(s, 1), [n, ...this.getChildren(n)].forEach((a) => {
          a instanceof bp ? a.dispose(!0, !1) : a.dispose(!0, !0), this.nodesMap.delete(a), this.idsMap.delete(a.name);
        });
      });
    }, this.getTargetById = (t, r = [
      se.Scene,
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh,
      se.GridMaterial,
      se.NodeMaterial,
      se.WaterMaterial,
      se.CityMaterial,
      se.ShaderMaterial,
      se.PBRMaterial,
      se.GradientMaterial,
      se.StandardMaterial,
      se.Texture,
      se.CubeTexture,
      se.VideoTexture,
      se.MirrorTexture,
      se.ArcRotateCamera,
      se.DirectionalLight
    ]) => {
      let n = this.idsMap.get(t) || null;
      if (n)
        return n;
      const i = Xa(r), s = [], a = {
        [se.Scene]: "scene",
        [se.TransformNode]: "transformNode",
        [se.AbstractMesh]: "mesh",
        [se.Mesh]: "mesh",
        [se.InstancedMesh]: ["transformNode", "mesh"],
        [se.GridMaterial]: "material",
        [se.NodeMaterial]: "material",
        [se.WaterMaterial]: "material",
        [se.CityMaterial]: "material",
        [se.ShaderMaterial]: "material",
        [se.PBRMaterial]: "material",
        [se.GradientMaterial]: "material",
        [se.StandardMaterial]: "material",
        [se.Texture]: "texture",
        [se.CubeTexture]: "texture",
        [se.VideoTexture]: "texture",
        [se.MirrorTexture]: "texture",
        [se.ArcRotateCamera]: "arcRotateCamera",
        [se.DirectionalLight]: "directionalLight"
      };
      i.forEach((f) => {
        const o = a[f];
        if (o) {
          if (typeof o == "string") {
            !s.includes(o) && s.push(o);
            return;
          }
          o.forEach((d) => {
            !s.includes(d) && s.push(d);
          });
        }
      });
      for (const f of s) {
        if (f === "scene" && this.manager.id === t)
          n = this.manager.scene;
        else if (f === "transformNode") {
          for (const o of this.manager.scene.scene.transformNodes)
            if (o.name === t) {
              n = o;
              break;
            }
        } else if (f === "mesh") {
          for (const o of this.manager.scene.scene.meshes)
            if (o.name === t) {
              n = o;
              break;
            }
        } else if (f === "material") {
          for (const o of this.manager.scene.scene.materials)
            if (o.name === t) {
              n = o;
              break;
            }
        } else if (f === "texture") {
          for (const o of this.manager.scene.scene.textures)
            if (o.name === t) {
              n = o;
              break;
            }
        } else if (f === "arcRotateCamera") {
          for (const o of this.manager.scene.scene.cameras)
            if (o.name === t) {
              n = o;
              break;
            }
        } else if (f === "directionalLight") {
          for (const o of this.manager.scene.scene.lights)
            if (o.name === t) {
              n = o;
              break;
            }
        }
        if (n) {
          this.idsMap.set(t, n);
          break;
        }
      }
      return n;
    }, this.getAllNodes = () => this.rootNodes.filter((t) => !t.removed), this.getAllLayers = () => {
      const t = [];
      return this.layers.forEach((r) => {
        const n = [];
        r.children.forEach((i) => {
          const s = [];
          i.nodeTreeItem.removed || (s.push(
            ...i.instancedNodeTreeItems.filter((a) => !a.removed)
          ), n.push({
            nodeTreeItem: i.nodeTreeItem,
            instancedNodeTreeItems: s
          }));
        }), n.length && t.push({ id: r.id, name: r.name, children: n });
      }), t;
    }, this.getRoot = (t) => {
      if (t instanceof Hr) {
        const r = this.nodesMap.get(t);
        return r ? r.parent ? this.getRoot(r.parent) : t : null;
      }
      return this.manager.scene;
    }, this.getParent = (t) => {
      var r;
      return (r = this.nodesMap.get(t)) == null ? void 0 : r.parent;
    }, this.getParents = (t) => {
      const r = [], n = (i) => {
        const s = this.getParent(i);
        s && (r.push(s), n(s));
      };
      return n(t), r;
    }, this.getChildren = (t, r = !0) => {
      const n = this.nodesMap.get(t);
      return n ? r ? [
        ...n.children,
        ...n.children.reduce((i, s) => [...i, ...this.getChildren(s, r)], [])
      ] : [...n.children] : [];
    }, this._getLayerName = (t) => ({
      box: "立方体",
      sphere: "球体",
      plane: "平面",
      ground: "地面",
      tube: "管道",
      "2DPanel": "面板",
      "2DPanelUI": "全屏面板",
      smoke: "烟雾粒子",
      fire: "火焰粒子"
    })[t], this.manager = e;
  }
}
const dc = (A, e) => A || e;
function XUe(A) {
  let e = A.getMetadata(A.scene), t = A.scene.scene;
  console.log("pColor1", e.pColor1), console.log("pColor2", e.pColor2);
  let r = {
    capacity: dc(e.spriteCapacity, 200),
    particleTexture: dc(e.particleTexture, v2e),
    color1: e.pColor1 ? xt.FromHexString(e.pColor1) : new xt(0.7, 0.8, 1, 1),
    color2: e.pColor2 ? xt.FromHexString(e.pColor2) : new xt(0.2, 0.5, 1, 1),
    colorDead: e.pColorDead ? A4(e.pColorDead).toColor4() : new xt(0, 0, 0.2, 0),
    size: dc(e.pSize, 3),
    emitRate: dc(e.pEmitRate, 1500),
    gravity: e.pDravityDirection ? -1 : 1,
    power: dc(e.pPower, 2),
    updateSpeed: dc(e.updateSpeed, 5e-3),
    height: dc(e.pHeight, -15),
    region: dc(e.pRegion, 500),
    spriteCellWidth: dc(e.spriteCellWidth, 256),
    spriteCellHeight: dc(e.spriteCellHeight, 256),
    isAnimationSheetEnabled: dc(e.isAnimationSheetEnabled, !0),
    startSpriteCellID: dc(e.startSpriteCellID, 0),
    endSpriteCellID: dc(e.endSpriteCellID, 0),
    spriteCellChangeSpeed: dc(e.spriteCellChangeSpeed, 0)
  };
  console.log("option", r);
  var n = new ti("le5le_particle", r.capacity, t);
  n.particleTexture = new We(r.particleTexture, t), n.emitter = S.Zero(), n.minEmitBox = new S(-r.region, r.height, -r.region), n.maxEmitBox = new S(r.region, r.height, r.region), n.color1 = r.color1, n.color2 = r.color2, n.colorDead = r.colorDead, n.minSize = r.size - 1, n.maxSize = r.size + 2, n.minLifeTime = 3, n.maxLifeTime = 6, n.emitRate = r.emitRate, n.blendMode = ti.BLENDMODE_ONEONE, n.gravity = new S(0, 9.81 * r.gravity, 0), n.direction1 = new S(1, 0, 0), n.direction2 = new S(-1, 0, 0), n.minAngularSpeed = 0, n.maxAngularSpeed = 0, n.minEmitPower = r.power - 1, n.maxEmitPower = r.power + 2, n.updateSpeed = r.updateSpeed;
  let i = [
    "isAnimationSheetEnabled",
    "startSpriteCellID",
    "endSpriteCellID",
    "spriteCellChangeSpeed",
    "spriteCellWidth",
    "spriteCellHeight"
  ];
  return i.forEach((s) => {
    n[s] = r[s];
  }), i.length = 0, i = void 0, n.start(), n;
}
var xS = /* @__PURE__ */ ((A) => (A.SMOKE = "smoke", A.RAIN = "rain", A.FIRE = "fire", A))(xS || {});
class kme {
  constructor(e, t) {
    this.manager = e, this.plane = t, t.billboardMode, this.texts = [], this.images = [], this.otherControl = [], this.ADTexture = g6.CreateForMesh(this.plane);
  }
  //创建一个默认plane
  createAdvancedTexture(e) {
    let t = g6.CreateForMesh(e);
    return t.name = "adt" + e.name, t;
  }
  //创建背景长方形；
  createRectangle() {
    let e = new p9("le5le_Rectangle" + this.plane.name);
    return e.thickness = 0, this.ADTexture.addControl(e), e;
  }
  //创建背景图
  createImage(e) {
    var r, n;
    let t;
    return e ? (t = new ua(
      "le5le_Images_" + ((r = this.images) == null ? void 0 : r.length) + this.plane.name
    ), this.ADTexture.addControl(t), (n = this.images) == null || n.push(t)) : (t = new ua("le5le_Image" + this.plane.name), this.ADTexture.addControl(t)), t;
  }
  //创建文本框
  createTextBlock(e) {
    let t = new oo(
      "le5le_textBlock_" + this.texts.length + "&" + this.plane.name,
      e.text
    );
    return t.scaleX = 2, this.ADTexture.addControl(t), this.texts.push(t), t;
  }
  getContral(e) {
    return this.ADTexture.getControlByName(e);
  }
  addRectangle(e) {
    let t = new p9(
      "le5le_Rectangle" + this.otherControl.length + 1 + this.plane.name
    );
    return Object.keys(e).forEach((r) => {
      t[r] = e[r];
    }), this.ADTexture.addControl(t), this.otherControl.push(t), t;
  }
  addImage(e) {
    let t = new ua(
      "le5le_Image" + this.otherControl.length + 1 + this.plane.name
    );
    return Object.keys(e).forEach((r) => {
      t[r] = e[r];
    }), this.ADTexture.addControl(t), this.otherControl.push(t), t;
  }
  addText(e) {
    let t = new oo(
      "le5le_Image" + this.otherControl.length + 1 + this.plane.name
    );
    return Object.keys(e).forEach((r) => {
      t[r] = e[r];
    }), this.ADTexture.addControl(t), this.otherControl.push(t), t;
  }
  dispose() {
    var e, t, r, n, i;
    (e = this.ADTexture) == null || e.dispose(), (t = this.rectangle) == null || t.dispose(), (r = this.image) == null || r.dispose(), (n = this.texts) == null || n.forEach((s) => {
      s == null || s.dispose();
    }), this.texts.length = 0, (i = this.images) == null || i.forEach((s) => {
      s == null || s.dispose();
    }), this.images.length = 0, this.otherControl.forEach((s) => {
      s == null || s.dispose();
    }), this.otherControl.length = 0;
  }
}
var Eme = /* @__PURE__ */ ((A) => (A.FullUI = "FullUI", A.Mesh = "Mesh", A.Image = "Image", A))(Eme || {}), Fme = /* @__PURE__ */ ((A) => (A.Button = "Button", A.Rectangle = "Rectangle", A.Image = "Image", A))(Fme || {});
function TUe(A) {
  if (A instanceof oo)
    return {
      color: A.color,
      text: A.text,
      left: parseInt(A.parent.left),
      top: parseInt(A.parent.top),
      width: parseInt(A.width),
      height: parseInt(A.height),
      fontSize: parseInt(A.fontSize),
      fontFamily: A.fontFamily,
      fontWeight: A.fontWeight
    };
  if (A instanceof ua)
    return {
      source: A.source,
      width: parseInt(A.width),
      height: parseInt(A.height),
      left: parseInt(A.parent.left),
      top: parseInt(A.parent.top)
    };
}
class Nme {
  constructor(e) {
    this.manager = e, this.GUIMap = /* @__PURE__ */ new Map();
  }
  /**
   * 创建一个新的GUI2dM面板
   * @param mesh 指定一个特殊的mesh，默认将创建一个 10x10 plane
   * @returns gui2d
   */
  createGUI2d(e, t) {
    let r = this.GUIMap.get(e), n;
    const { backgroundColor: i, imageSource: s, texts: a, images: f } = t;
    return r ? (n = r, i != n.rectangle.background && (n.rectangle.background = i), s != n.image.source && (s ? F5(s, (o) => {
      n.image.source = o;
    }) : (n.image.moveToVector3(
      n.plane.getAbsolutePosition(),
      this.manager.scene.scene
    ), n.image.top = "0px", n.image.left = "0px", n.image.source = "")), this.changeGUI2DControls(f, n.images, n), this.changeGUI2DControls(a, n.texts, n)) : (n = new kme(this.manager, e), this.GUIMap.set(n.plane, n), n.plane.onDispose = () => {
      n == null || n.dispose(), this.GUIMap.delete(n.plane);
    }, n.rectangle = n.createRectangle(), n.image = n.createImage(), n.image.zIndex = 0, i && (n.rectangle.background = i), s && F5(s, (o) => {
      n.image.source = o;
    }), this.changeGUI2DControls(f, n.images, n), this.changeGUI2DControls(a, n.texts, n)), n;
  }
  dispose() {
    this.GUIMap.forEach((e) => e == null ? void 0 : e.dispose()), this.GUIMap.clear();
  }
  changeGUI2DControls(e, t, r) {
    let n = e.length > t.length ? e : t;
    n == null || n.forEach((i, s) => {
      var a, f;
      if (e[s] && t[s])
        this.updataControl(e[s], t[s]);
      else if (e[s] && !t[s]) {
        let o;
        Object.keys(i).includes("fontSize") ? o = r.createTextBlock(e[s]) : o = r.createImage(e[s]);
        const d = this.addRectangleBorder(r, o);
        o instanceof oo ? d.zIndex = 100 : d.zIndex = 0, d.horizontalAlignment = 0, d.verticalAlignment = 0, this.updataControl(e[s], o);
      } else
        !e[s] && t[s] && ((f = (a = t[s]) == null ? void 0 : a.parent) == null || f.dispose(), t[s].dispose(), t[s] instanceof oo ? r.texts.splice(s, 1) : r.images.splice(s, 1));
    });
  }
  resetControls(e, t, r) {
    r.images.forEach((i) => {
      i.dispose();
    }), r.texts.forEach((i) => {
      i.dispose();
    }), r.otherControl.forEach((i) => {
      i.dispose();
    });
    const n = [];
    t.forEach((i) => {
      const s = new Promise(() => {
        let a = r.createImage(i);
        const f = this.addRectangleBorder(r, a);
        f.horizontalAlignment = 0, f.verticalAlignment = 0, this.updataControl(i, a), a.onAfterDrawObservable.addOnce(() => !0);
      });
      n.push(s);
    }), Promise.all(n).then(() => {
      e.forEach((i) => {
        let s = r.createTextBlock(i);
        const a = this.addRectangleBorder(r, s);
        a.horizontalAlignment = 0, a.verticalAlignment = 0, this.updataControl(i, s);
      });
    });
  }
  updataControl(e, t) {
    let r = [
      "text",
      "color",
      "fontFamily",
      "fontWeight",
      "fontStyle",
      "source",
      "scaleX",
      "scaleY",
      "shadowBlur",
      "shadowOffsetX",
      "shadowOffsetY",
      "shadowColor"
    ];
    Object.keys(e).forEach((n) => {
      e[n] && (r.includes(n) ? n == "source" ? F5(e[n], (i) => {
        t.source = i;
      }) : t[n] = e[n] : ["top", "left"].includes(n) ? (t.parent[n] = e[n], t[n] = 0) : t[n] = e[n] + "px");
    });
  }
  addRectangleBorder(e, t) {
    e.ADTexture.removeControl(t);
    const r = new p9("recBorder_" + t.name);
    return r.thickness = 0, r.addControl(t), r.adaptHeightToChildren = !0, r.adaptWidthToChildren = !0, e.ADTexture.addControl(r), e.otherControl.push(r), r;
  }
  //2D面板拖动转像素算法优化
  moveToVector3(e, t) {
    let r = e.getBoundingInfo().boundingBox.vectorsWorld, n = r[1].subtract(r[3]), i = S.Distance(r[3], r[1]), s = S.Distance(r[3], r[0]), a = t.subtract(r[3]), f = S.Distance(a, S.Zero());
    if (f == 0)
      return {
        left: 0,
        top: 0
      };
    let o = Math.acos(
      S.Dot(n, a) / (S.Distance(n, S.Zero()) * f)
    ), d = f * Math.cos(o), v = f * Math.sin(o);
    return {
      left: d / i,
      top: v / s
    };
  }
}
class Qme {
  constructor() {
    new he(), this.cache = {
      camera: { fov: 0, style: "" },
      objects: /* @__PURE__ */ new WeakMap()
    };
    var e = document.createElement("div");
    e.style.overflow = "hidden", this.domElement = e, this.cameraElement = document.createElement("div"), this.cameraElement.style.webkitTransformStyle = "preserve-3d", this.cameraElement.style.transformStyle = "preserve-3d", e.appendChild(this.cameraElement);
  }
  getSize() {
    return {
      width: this.width,
      height: this.height
    };
  }
  setSize(e, t) {
    this.width = e, this.height = t, this.widthHalf = this.width / 2, this.heightHalf = this.height / 2, this.domElement.style.width = e + "px", this.domElement.style.height = t + "px", this.cameraElement.style.width = e + "px", this.cameraElement.style.height = t + "px";
  }
  epsilon(e) {
    return Math.abs(e) < 1e-10 ? 0 : e;
  }
  getCameraCSSMatrix(e) {
    var t = e.m;
    return "matrix3d(" + this.epsilon(t[0]) + "," + this.epsilon(-t[1]) + "," + this.epsilon(t[2]) + "," + this.epsilon(t[3]) + "," + this.epsilon(t[4]) + "," + this.epsilon(-t[5]) + "," + this.epsilon(t[6]) + "," + this.epsilon(t[7]) + "," + this.epsilon(t[8]) + "," + this.epsilon(-t[9]) + "," + this.epsilon(t[10]) + "," + this.epsilon(t[11]) + "," + this.epsilon(t[12]) + "," + this.epsilon(-t[13]) + "," + this.epsilon(t[14]) + "," + this.epsilon(t[15]) + ")";
  }
  getObjectCSSMatrix(e, t) {
    var r = e.m, n = "matrix3d(" + this.epsilon(r[0]) + "," + this.epsilon(r[1]) + "," + this.epsilon(r[2]) + "," + this.epsilon(r[3]) + "," + this.epsilon(-r[4]) + "," + this.epsilon(-r[5]) + "," + this.epsilon(-r[6]) + "," + this.epsilon(-r[7]) + "," + this.epsilon(r[8]) + "," + this.epsilon(r[9]) + "," + this.epsilon(r[10]) + "," + this.epsilon(r[11]) + "," + this.epsilon(r[12]) + "," + this.epsilon(r[13]) + "," + this.epsilon(r[14]) + "," + this.epsilon(r[15]) + ")";
    return "translate(-50%,-50%)" + n;
  }
  renderObject(e, t, r, n) {
    if (e instanceof H9e) {
      var i, s = e.getWorldMatrix().clone(), a = r.getWorldMatrix(), f = s.m;
      const P = 4.8, p = 3.6;
      f[0] *= 0.01 / P, f[2] *= 0.01 / P, f[5] *= 0.01 / p, f[12] = -a.m[12] + e.position.x, f[13] = -a.m[13] + e.position.y, f[14] = a.m[14] - e.position.z, f[15] = a.m[15] * 1e-5, s = he.FromArray(f), i = this.getObjectCSSMatrix(s, n);
      var o = e.element, d = this.cache.objects.get(e);
      if (d === void 0 || d.style !== i) {
        o.style.webkitTransform = i, o.style.transform = i;
        var v = { style: i };
        this.cache.objects.set(e, v);
      }
      o.parentNode !== this.cameraElement && this.cameraElement.appendChild(o);
    } else if (e instanceof sr)
      for (var u = 0, l = e.meshes.length; u < l; u++)
        this.renderObject(e.meshes[u], t, r, n);
  }
  render(e, t) {
    var r = t.getProjectionMatrix(), n = r.m[5] * this.heightHalf;
    this.cache.camera.fov !== n && (t.mode == Tr.PERSPECTIVE_CAMERA ? (this.domElement.style.webkitPerspective = n + "px", this.domElement.style.perspective = n + "px") : (this.domElement.style.webkitPerspective = "", this.domElement.style.perspective = ""), this.cache.camera.fov = n), t.parent === null && t.computeWorldMatrix();
    var i = t.getWorldMatrix().clone(), s = i.clone().getRotationMatrix().transpose(), a = i.m;
    a[1] = s.m[1], a[2] = -s.m[2], a[4] = -s.m[4], a[6] = -s.m[6], a[8] = -s.m[8], a[9] = -s.m[9], i = he.FromArray(a);
    var f = "translateZ(" + n + "px)" + this.getCameraCSSMatrix(i), o = f + "translate(" + this.widthHalf + "px," + this.heightHalf + "px)";
    this.cache.camera.style !== o && (this.cameraElement.style.webkitTransform = o, this.cameraElement.style.transform = o, this.cache.camera.style = o), this.renderObject(e, e.getScene(), t, f);
  }
}
class H9e extends Ee {
  constructor(e, t, r) {
    super("CSS3DMESH", r), this.element = e, this.element.style.position = "absolute", this.element.style.pointerEvents = "auto", this.name = t, this.onDispose = () => {
      var n;
      (n = this.topParent) == null || n.remove();
    };
  }
}
function Yme(A) {
  let e = document.createElement("div");
  e.id = "css-container", e.style.position = "absolute", e.style.width = "100%", e.style.height = "100%", e.style.zIndex = "1", e.style.pointerEvents = "none";
  let t = A.parentElement;
  t.insertBefore(e, t.firstChild);
  let r = new Qme();
  return e.appendChild(r.domElement), r.setSize(t.offsetWidth, t.offsetHeight), window.addEventListener("resize", (n) => {
    r.setSize(t.offsetWidth, t.offsetHeight);
  }), r;
}
function Mme(A, e, t) {
  let r = 1920, n = 1080;
  var i = document.createElement("div");
  i.style.width = r + "px", i.style.height = n + "px";
  var s = new H9e(i, "box", e);
  s.position.copyFrom(A.getAbsolutePosition()), s.rotation.y = -A.rotation.y, s.scaling.copyFrom(A.scaling);
  var a = document.createElement("iframe");
  return a.style.width = r + "px", a.style.height = n + "px", a.style.border = "0px", a.src = t, i.appendChild(a), s;
}
function qUe(A, e) {
}
function bUe(A, e, t) {
  let r = Yme(e);
  const n = Mme(A, A.getScene(), t);
  return n.topParent = r.domElement.parentElement, A.getScene().onBeforeRenderObservable.add(() => {
    r.render(n, A.getScene().activeCamera);
  }), A.getScene(), n;
}
class Lme {
  constructor(e) {
    this.meshMap = /* @__PURE__ */ new Map(), this.particlePropertyMap = /* @__PURE__ */ new Map(), this.manager = e, e.root.running && (e.scene.scene.onNewMeshAddedObservable.add((t) => {
      if (t instanceof Ee) {
        let r = this.meshMap.get(t);
        r && r.start();
      }
    }), e.scene.scene.onMeshRemovedObservable.add((t) => {
      if (t instanceof Ee) {
        let r = this.meshMap.get(t);
        r && (r instanceof bq ? r.systems.forEach((n) => {
          n.stop();
        }) : r.stop());
      }
    }));
  }
  dispose() {
    this.manager = void 0, this.meshMap.clear();
  }
  async parseParticle(e, t, r) {
    console.log("str", t);
    const n = await fetch(t);
    switch (e) {
      case xS.SMOKE:
        n.text().then((i) => {
          let s = ti.Parse(JSON.parse(i), this.manager.scene.scene, "");
          s.emitter = r, this.meshMap.set(r, s), this.updataPropertySmoke(r, s), r.isEnabled() && s.start(300), r.onEnabledStateChangedObservable.add((a) => {
            a ? s.start() : s.stop();
          });
        });
        break;
      case xS.RAIN:
        break;
      case xS.FIRE:
        n.text().then((i) => {
          let s = bq.Parse(JSON.parse(i), this.manager.scene.scene);
          this.meshMap.set(r, s), r.onEnabledStateChangedObservable.add((f) => {
            f ? s.start() : s.systems.forEach((o) => {
              o.stop();
            });
          });
          let a = setTimeout(() => {
            s.emitterNode = r.getBoundingInfo().boundingBox.centerWorld, r.isEnabled() && s.start(), clearTimeout(a);
          }, 300);
        });
    }
  }
  addProperty(e, t) {
    this.particlePropertyMap.get(e) || this.particlePropertyMap.set(e, []), this.particlePropertyMap.get(e).push(t);
  }
  updataPropertySmoke(e, t) {
    let r = this.particlePropertyMap.get(e);
    r && (r.forEach((n) => {
      if (n.property == "colorGrading")
        t.getColorGradients().forEach((i) => {
          i.color1 = n.value, i.color2 = n.value;
        });
      else if (n.property.includes(".")) {
        let i = n.property.split(".");
        t[i[0]][i[1]] = n.value;
      } else
        t[n.property] = n.value;
    }), this.particlePropertyMap.delete(e));
  }
  setStatus(e, t) {
    let r = this.meshMap.get(e);
    r && (t ? r.start() : r instanceof ti ? r.stop() : r.systems.forEach((n) => {
      n.stop();
    }));
  }
}
const xUe = (A) => {
  var t, r;
  let e = !1;
  return (((t = A.__initOption) == null ? void 0 : t.type) == "smoke" || ((r = A.__initOption) == null ? void 0 : r.type) == "fire") && (e = !0), e;
};
function hI(A, e, t, r) {
  return A = A$(A), e = A$(e), Kme(A, e, t, r);
}
function DUe(A, e, t = 6371001) {
  let r = e * Math.PI / 180, n = A * Math.PI / 180, i = t * Math.cos(r) * Math.cos(n), s = t * Math.cos(r) * Math.sin(n), a = t * Math.sin(r);
  return S.FromArray([i, a, s]);
}
function A$(A) {
  return A * Math.PI / 180;
}
function Kme(A, e, t, r) {
  t = t ?? 0;
  const n = r ? r.radiiSquared : {
    x: 6378137 * 6378137,
    y: 6378137 * 6378137,
    z: 6356752314245179e-9 * 6356752314245179e-9
  }, i = Math.cos(e);
  let s = S.FromArray([
    i * Math.cos(A),
    i * Math.sin(A),
    Math.sin(e)
  ]);
  s = S.Normalize(s);
  let a = S.FromArray([
    n.x * s.x,
    n.y * s.y,
    n.z * s.z
  ]);
  const f = Math.sqrt(S.Dot(s, a));
  a = a.scale(1 / f), s = s.scale(t);
  let o = S.FromArray([
    a.x + s.x,
    a.z + s.z,
    a.y + s.y
  ]), d = S.Distance(o, S.Zero());
  return o = o.normalize().scale(d), o;
}
const NC = S.FromArray([2458172257647332e-29, 2458172257647332e-29, 24747391015697002e-30]), E5 = S.FromArray([
  1567855942887398e-22,
  1567855942887398e-22,
  1573130351105623e-22
]), Jme = 0.1;
function zme(A) {
  A = Zme(A);
  const e = Gme(A);
  if (!e)
    return;
  const t = $me(e);
  if (!t)
    return;
  const r = A.subtract(e), n = ye.ToDegrees(Math.atan2(t.y, t.x)), i = ye.ToDegrees(Math.asin(t.z)), s = S.Dot(r, A);
  let a = 0;
  switch (!0) {
    case s == 0:
      a = 0;
      break;
    case s > 0:
      a = 1;
      break;
    case s < 0:
      a = -1;
      break;
  }
  const f = a * S.Distance(r, S.Zero());
  return {
    longitude: n,
    latitude: i,
    height: f
  };
}
function Gme(A) {
  const e = A.x, t = A.y, r = A.z, n = E5.x, i = E5.y, s = E5.z, a = e * e * n * n, f = t * t * i * i, o = r * r * s * s, d = a + f + o, v = Math.sqrt(1 / d), u = A.scale(v);
  if (d < Jme)
    return isFinite(v) ? u.clone() : void 0;
  const l = NC.x, P = NC.y, p = NC.z, c = S.Zero();
  c.x = u.x * l * 2, c.y = u.y * P * 2, c.z = u.z * p * 2;
  let H = (1 - v) * S.Distance(A, S.Zero()) / (0.5 * S.Distance(c, S.Zero())), T = 0, q, b, j, w, m, I, N, k, R, y, O;
  do {
    H -= T, j = 1 / (1 + H * l), w = 1 / (1 + H * P), m = 1 / (1 + H * p), I = j * j, N = w * w, k = m * m, R = I * j, y = N * w, O = k * m, q = a * I + f * N + o * k - 1, b = a * R * l + f * y * P + o * O * p;
    const Y = -2 * b;
    T = q / Y;
  } while (Math.abs(q) > 1e-12);
  return S.FromArray([
    e * j,
    t * w,
    r * m
  ]);
}
function Zme(A) {
  return S.FromArray([A.x, A.z, A.y]);
}
function _me(A, e) {
  return S.FromArray([
    A.x * e.x,
    A.y * e.y,
    A.z * e.z
  ]);
}
function $me(A) {
  let e = 1e-14;
  if (S.Distance(A, S.Zero()) < e)
    return;
  let t = _me(
    A,
    NC
  );
  return S.Normalize(t);
}
class zs {
  serialize(e, t, r = !1) {
    const n = zt.getInfo(this.valueType);
    if (n)
      return [...n.values()].reduce((i, s) => {
        const { property: a, serializable: f = !0, serialize: o, getDefaultValue: d } = s, v = o(e, t, r);
        return (!r || f && (!d || v !== void 0 && JSON.stringify(v) !== JSON.stringify(d(e, t)))) && (i[a] = v), i;
      }, {});
  }
}
class eBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.AbstractMesh, this.prototype = jn;
  }
  isType(e) {
    return e instanceof jn;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof jn)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(this.valueType, t);
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e) {
    const t = e.scene.scene;
    return new this.prototype(Zn(), t);
  }
}
class tBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.ArcRotateCamera, this.prototype = ps;
  }
  isType(e) {
    return e instanceof ps;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof ps)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t) {
    const r = e.scene.scene, { alpha: n, beta: i, radius: s, target: a } = t;
    return new this.prototype(
      Zn(),
      n,
      i,
      s,
      new S(a.x, a.y, a.z),
      r
    );
  }
}
class rBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Array;
  }
  isType(e) {
    return Array.isArray(e);
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e) {
    return e;
  }
  serialize(e, t, r = !1) {
    return e.map((n) => zt.serialize(n, t, r));
  }
  createInstance() {
    return [];
  }
}
class nBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Boolean;
  }
  isType(e) {
    return typeof e == "boolean";
  }
  clone(e) {
    return e;
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e) {
    return e;
  }
  serialize(e) {
    return e;
  }
  createInstance() {
    return !0;
  }
}
class iBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Color3, this.prototype = Ne;
  }
  isType(e) {
    return e instanceof Ne;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e.equals(t);
  }
  deserialize(e) {
    if (e instanceof Ne)
      return e;
    if (typeof e == "string")
      return A4(e);
  }
  serialize(e) {
    return cO(e);
  }
  createInstance() {
    return new this.prototype(0, 0, 0);
  }
}
class sBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Color4, this.prototype = xt;
  }
  isType(e) {
    return e instanceof xt;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e.equals(t);
  }
  deserialize(e) {
    if (e instanceof xt)
      return e;
    if (typeof e == "string")
      return lR(e);
  }
  serialize(e) {
    return cO(e);
  }
  createInstance() {
    return new this.prototype(0, 0, 0, 1);
  }
}
class aBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.CubeTexture, this.prototype = v1;
  }
  isType(e) {
    return e instanceof v1;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (this.isType(e))
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(this.valueType, t, {
        url: ""
      });
      return zt.setValue(r, e, t), r;
    }
    return null;
  }
  createInstance(e, t) {
    const r = e.scene.scene, n = new this.prototype(t.url, r);
    return n.name = Zn(), n;
  }
}
class oBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.DirectionalLight, this.prototype = IA;
  }
  isType(e) {
    return e instanceof IA;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof IA)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t) {
    const r = e.scene.scene, { direction: n } = t;
    return new this.prototype(
      Zn(),
      new S(n.x, n.y, n.z),
      r
    );
  }
}
class fBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.FollowCamera, this.prototype = Fv;
  }
  isType(e) {
    return e instanceof Fv;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof Fv)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t) {
    const r = e.scene.scene, { position: n } = t;
    return new this.prototype(
      Zn(),
      new S(n.x, n.y, n.z),
      r
    );
  }
}
class ABe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.FreeCamera, this.prototype = SA;
  }
  isType(e) {
    return e instanceof SA;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof SA)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t) {
    const r = e.scene.scene, { position: n } = t;
    return new this.prototype(
      Zn(),
      new S(n.x, n.y, n.z),
      r
    );
  }
}
class dBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.GradientMaterial, this.prototype = Kd;
  }
  isType(e) {
    return e instanceof Kd;
  }
  clone(e) {
    return e.clone(Zn());
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof Kd)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(this.valueType, t);
      return zt.setValue(r, e, t), r;
    }
    return null;
  }
  createInstance(e) {
    const t = e.scene.scene;
    return new this.prototype(Zn(), t);
  }
}
class vBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.GridMaterial, this.prototype = RA;
  }
  isType(e) {
    return e instanceof RA;
  }
  clone(e) {
    return e.clone(Zn());
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof RA)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(this.valueType, t);
      return zt.setValue(r, e, t), r;
    }
    return null;
  }
  createInstance(e) {
    const t = e.scene.scene;
    return new this.prototype(Zn(), t);
  }
}
class uBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.HemisphericLight, this.prototype = y0;
  }
  isType(e) {
    return e instanceof y0;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof y0)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t) {
    const r = e.scene.scene, { direction: n } = t;
    return new this.prototype(
      Zn(),
      new S(n.x, n.y, n.z),
      r
    );
  }
}
class lBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.InstancedMesh, this.prototype = Hr;
  }
  isType(e, t) {
    var r;
    return e instanceof bp ? !0 : ((r = t.getMetadata(e)) == null ? void 0 : r.__valueType) === se.InstancedMesh;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (this.isType(e, t))
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t) {
    const r = e.getTargetById(t.source, [se.TransformNode, se.Mesh]);
    let n;
    return r instanceof Ee && r.geometry ? n = r.createInstance(Zn()) : n = new Hr(Zn(), e.scene.scene, !0), n.id = r == null ? void 0 : r.id, e.setMetadata(n, { __valueType: se.InstancedMesh }), n;
  }
}
class PBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Matrix, this.prototype = he;
  }
  isType(e) {
    return e instanceof he;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e.equals(t);
  }
  deserialize(e) {
    return new he();
  }
  serialize(e) {
    return [];
  }
  createInstance() {
    return new this.prototype();
  }
}
class cBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Mesh, this.prototype = Ee;
  }
  isType(e) {
    return e instanceof Ee;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof Ee)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return e.__initOption.type != "tube" && wM(r, t.pivotPointPlacementMap.get(e.id)), zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t) {
    const r = e.scene.scene, { type: n, ...i } = t || {};
    let s;
    if (n)
      switch (n) {
        case "box":
          const a = {};
          for (const q in i)
            if (q === "faceUV") {
              a[q] = [];
              for (const b of i[q])
                a[q].push(new Ir(b.x, b.y, b.z, b.w));
            } else if (q === "faceColors") {
              a[q] = [];
              for (const b of i[q])
                a[q].push(lR(b));
            } else
              q === "frontUVs" || q === "backUVs" ? a[q] = new Ir(
                i[q].x,
                i[q].y,
                i[q].z,
                i[q].w
              ) : a[q] = i[q];
          s = Ef.CreateBox(Zn(), a, r);
          break;
        case "sphere":
          const f = {};
          for (const q in i)
            q === "frontUVs" || q === "backUVs" ? f[q] = new Ir(
              i[q].x,
              i[q].y,
              i[q].z,
              i[q].w
            ) : f[q] = i[q];
          s = Ef.CreateSphere(Zn(), f, r);
          break;
        case "plane":
        case "2DPanel":
          const o = {};
          for (const q in i)
            q === "frontUVs" || q === "backUVs" ? o[q] = new Ir(
              i[q].x,
              i[q].y,
              i[q].z,
              i[q].w
            ) : o[q] = i[q];
          s = Ef.CreatePlane(Zn(), o, r), e.GUIManager.add(s);
          break;
        case "2DPanelUI":
          const d = {};
          for (const q in i)
            q === "frontUVs" || q === "backUVs" ? d[q] = new Ir(
              i[q].x,
              i[q].y,
              i[q].z,
              i[q].w
            ) : d[q] = i[q];
          s = Ef.CreatePlane(Zn(), d, r), e.GUIManager.add(s, !0);
          break;
        case "ground":
          const v = { ...i };
          s = Ef.CreateGround(Zn(), v, r);
          break;
        case "smoke":
          s = Ef.CreateBox(Zn()), s.visibility = 0, e.particleManager.parseParticle(xS.SMOKE, i.url, s);
          break;
        case "fire":
          s = Ef.CreateBox(Zn(), { height: 5, width: 3, depth: 3 }), s.visibility = 0, e.particleManager.parseParticle(xS.FIRE, i.url, s);
          break;
        case "ribbon":
          const u = {};
          for (const q in i)
            if (q === "frontUVs" || q === "backUVs")
              u[q] = new Ir(
                i[q].x,
                i[q].y,
                i[q].z,
                i[q].w
              );
            else if (q === "pathArray") {
              u[q] = [];
              for (const b of i[q]) {
                const j = [];
                for (const w of b)
                  j.push(new S(w.x, w.y, w.z));
                u[q].push(j);
              }
            } else if (q === "uvs") {
              u[q] = [];
              for (const b of i[q])
                u[q].push(new at(b.x, b.y));
            } else if (q === "colors") {
              u[q] = [];
              for (const b of i[q])
                u[q].push(lR(b));
            } else
              q === "instance" ? u[q] = r.getMeshByName(i[q]) : u[q] = i[q];
          s = Ef.CreateRibbon(Zn(), u, r);
          break;
        case "decal":
          const l = {};
          for (const q in i)
            q === "position" || q === "normal" || q === "size" ? l[q] = new S(
              i[q].x,
              i[q].y,
              i[q].z
            ) : q === "mesh" ? l[q] = r.getMeshByName(i[q]) : l[q] = i[q];
          const { mesh: P, ...p } = l;
          s = Ef.CreateDecal(
            Zn(),
            P,
            p
          );
          break;
        case "tube":
          const c = i;
          let H = [];
          for (const q in i) {
            if (q == "path") {
              let b = [];
              i[q].forEach((j) => {
                b.push(S.FromArray(j));
              }), c[q] = d9e(b, c.circular);
            } else
              c[q] = i[q];
            c.sideOrientation = 2;
          }
          s = v9e(i.instance ?? Zn(), c, r), H.forEach((q) => {
            q.setParent(s);
          });
          let T = i.path[0];
          gO.SetPivot(0, s, T), s.id = "管道";
          break;
      }
    return s || (s = new this.prototype(Zn(), r)), s;
  }
}
class pBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.MirrorTexture, this.prototype = uD;
  }
  isType(e) {
    return e instanceof uD;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof uD)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(this.valueType, t, 5);
      return zt.setValue(r, e, t), r;
    }
    return null;
  }
  createInstance(e, t) {
    const r = e.scene.scene;
    return new this.prototype(Zn(), t, r);
  }
}
class hBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.NodeMaterial, this.prototype = ja;
  }
  isType(e) {
    return e instanceof ja;
  }
  clone(e) {
    return e.clone(Zn());
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof ja)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const { serializeJSON: r, ...n } = e;
      let i;
      try {
        return r ? i = Nqe(t.scene.scene, r) : i = zt.createInstance(this.valueType, t), zt.setValue(i, n, t), i;
      } catch {
      }
    }
    return null;
  }
  serialize(e, t, r = !1) {
    const n = zt.getInfo(this.valueType);
    if (n)
      return [...n.values()].reduce(
        (i, s) => {
          const { property: a, serializable: f = !0, serialize: o, getDefaultValue: d } = s, v = o(e, t);
          return (!r || f && (!d || v != null && JSON.stringify(v) !== JSON.stringify(d(e, t)))) && (i[a] = v), i;
        },
        { serializeJSON: e.serialize() }
      );
  }
  createInstance(e) {
    const t = e.scene.scene;
    return Eqe(t);
  }
}
class HBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Null;
  }
  isType(e) {
    return e === null;
  }
  clone() {
    return null;
  }
  equals(e, t) {
    return this.isType(e) && this.isType(t);
  }
  deserialize() {
    return null;
  }
  serialize() {
    return null;
  }
  createInstance() {
    return null;
  }
}
class gBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Number;
  }
  isType(e) {
    return typeof e == "number";
  }
  clone(e) {
    return e;
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e) {
    return e;
  }
  serialize(e) {
    return e;
  }
  createInstance() {
    return 0;
  }
}
class XBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Object;
  }
  isType(e) {
    return Object.prototype.toString.call(e) === "[object Object]" && !("getClassName" in e);
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (zt.isType(e, se.Object, t)) {
      const r = this.createInstance();
      for (const n in e)
        r[n] = zt.deserialize(e[n], t);
      return r;
    }
  }
  serialize(e, t, r = !1) {
    return Object.keys(e).reduce(
      (n, i) => (n[i] = zt.serialize(e[i], t, r), n),
      {}
    );
  }
  createInstance() {
    return {};
  }
}
class TBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.PBRMaterial, this.prototype = mr;
  }
  isType(e) {
    return e instanceof mr;
  }
  clone(e) {
    return e.clone(Zn());
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof mr)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(this.valueType, t);
      return zt.setValue(r, e, t), r;
    }
    return null;
  }
  createInstance(e) {
    const t = e.scene.scene, r = new this.prototype(Zn(), t);
    return r.metallic = 0.5, r.roughness = 0.5, r;
  }
}
class qBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.PointLight, this.prototype = ag;
  }
  isType(e) {
    return e instanceof ag;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof ag)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t) {
    const r = e.scene.scene, { position: n } = t;
    return new this.prototype(
      Zn(),
      new S(n.x, n.y, n.z),
      r
    );
  }
}
class bBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Quaternion, this.prototype = Ze;
  }
  isType(e) {
    return e instanceof Ze;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e.equals(t);
  }
  deserialize(e, t) {
    if (e instanceof Ze)
      return e;
    if (zt.isType(e, se.Object, t))
      return new Ze(e.x, e.y, e.z, e.w);
  }
  serialize(e) {
    return { x: e.x, y: e.y, z: e.z, w: e.w };
  }
  createInstance() {
    return new this.prototype();
  }
}
class xBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Scene, this.prototype = C0;
  }
  isType(e) {
    return e instanceof C0;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof C0)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e) {
    return new this.prototype(e);
  }
}
class DBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.ShaderMaterial, this.prototype = Zo;
  }
  isType(e) {
    return e instanceof Zo;
  }
  clone(e) {
    return e.clone(Zn());
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof Zo)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const { type: r, ...n } = e, i = zt.createInstance(this.valueType, t, {
        type: r
      });
      return zt.setValue(i, n, t), i;
    }
    return null;
  }
  createInstance(e, t) {
    const r = e.scene.scene, { type: n } = t;
    switch (n) {
      case Rv.Grad:
        return Oqe(Zn(), r);
      case Rv.OutLine:
        return Cqe(Zn(), r);
    }
  }
}
class jBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.CityMaterial, this.prototype = NW;
  }
  isType(e) {
    return e instanceof NW;
  }
  clone(e) {
    return new NW(Zn(), e.getScene());
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof NW)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
    return null;
  }
  createInstance(e, t) {
    const r = e.scene.scene;
    return new NW(Zn(), r);
  }
}
class wBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Size, this.prototype = Qd;
  }
  isType(e) {
    return e instanceof Qd;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e.equals(t);
  }
  deserialize(e, t) {
    if (e instanceof Qd)
      return e;
    if (zt.isType(e, se.Object, t))
      return new Qd(e.width, e.height);
  }
  serialize(e) {
    return { width: e.width, height: e.height };
  }
  createInstance() {
    return new this.prototype(0, 0);
  }
}
class mBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.SpotLight, this.prototype = nA;
  }
  isType(e) {
    return e instanceof nA;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof nA)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t) {
    const r = e.scene.scene, { position: n, direction: i, angle: s, exponent: a } = t;
    return new this.prototype(
      Zn(),
      new S(n.x, n.y, n.z),
      new S(i.x, i.y, i.z),
      ye.ToRadians(s),
      a,
      r
    );
  }
}
class BBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.StandardMaterial, this.prototype = Wt;
  }
  isType(e) {
    return e instanceof Wt;
  }
  clone(e) {
    return e.clone(Zn());
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof Wt)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(this.valueType, t);
      return zt.setValue(r, e, t), r;
    }
    return null;
  }
  createInstance(e) {
    const t = e.scene.scene;
    return new this.prototype(Zn(), t);
  }
}
class WBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.String;
  }
  isType(e) {
    return typeof e == "string";
  }
  clone(e) {
    return e;
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e) {
    return e;
  }
  serialize(e) {
    return e;
  }
  createInstance() {
    return "";
  }
}
class SBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Texture, this.prototype = We;
  }
  isType(e) {
    return e instanceof We;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof We)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const { url: r, ...n } = e, i = zt.createInstance(this.valueType, t, {
        url: r
      });
      return zt.setValue(i, n, t), i;
    }
    return null;
  }
  createInstance(e, t) {
    const r = e.scene.scene, n = new We(t.url, r);
    return n.name = Zn(), n;
  }
}
class UBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.TransformNode, this.prototype = Hr;
  }
  isType(e) {
    return e instanceof Hr;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof Hr)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t = {}) {
    const r = e.scene.scene;
    return new this.prototype(Zn(), r, t.isPure);
  }
}
class IBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Vector2, this.prototype = at;
  }
  isType(e) {
    return e instanceof at;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e.equals(t);
  }
  deserialize(e, t) {
    if (e instanceof at)
      return e;
    if (zt.isType(e, se.Object, t))
      return new at(e.x, e.y);
  }
  serialize(e) {
    return { x: e.x, y: e.y };
  }
  createInstance() {
    return new at();
  }
}
class RBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Vector3, this.prototype = S;
  }
  isType(e) {
    return e instanceof S;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e.equals(t);
  }
  deserialize(e, t) {
    if (e instanceof S)
      return e;
    if (zt.isType(e, se.Object, t))
      return new S(e.x, e.y, e.z);
  }
  serialize(e) {
    return { x: e.x, y: e.y, z: e.z };
  }
  createInstance() {
    return new this.prototype();
  }
}
class VBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Vector4, this.prototype = Ir;
  }
  isType(e) {
    return e instanceof Ir;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e.equals(t);
  }
  deserialize(e, t) {
    if (e instanceof Ir)
      return e;
    if (zt.isType(e, se.Object, t))
      return new Ir(e.x, e.y, e.z, e.w);
  }
  serialize(e) {
    return { x: e.x, y: e.y, z: e.z, w: e.w };
  }
  createInstance() {
    return new this.prototype(0, 0, 0, 0);
  }
}
class CBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.VideoTexture, this.prototype = xc;
  }
  isType(e) {
    return e instanceof xc;
  }
  clone(e) {
    return e.clone();
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof xc)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const { url: r, ...n } = e, i = zt.createInstance(this.valueType, t, {
        url: r
      });
      return zt.setValue(i, n, t), i;
    }
    return null;
  }
  createInstance(e, t) {
    const r = e.scene.scene;
    return new this.prototype(Zn(), t.url, r);
  }
}
class OBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.Void;
  }
  isType(e) {
    return e === void 0;
  }
  clone(e) {
    return e;
  }
  equals(e, t) {
    return this.isType(e) && this.isType(t);
  }
  deserialize(e) {
    return e;
  }
  serialize(e) {
    return e;
  }
  createInstance() {
  }
}
class yBe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.WaterMaterial, this.prototype = la;
  }
  isType(e) {
    return e instanceof la;
  }
  clone(e) {
    return e.clone(Zn());
  }
  equals(e, t) {
    return e === t;
  }
  deserialize(e, t) {
    if (e instanceof la)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(this.valueType, t);
      return zt.setValue(r, e, t), r;
    }
    return null;
  }
  createInstance(e) {
    const t = e.scene.scene;
    return kBe(Zn(), t);
  }
}
const kBe = (A, e) => {
  let t = new la(A, e);
  t.windForce = 0, t.waveHeight = 0, t.windDirection = new at(1, 0), t.bumpHeight = 0, t.waveLength = 0;
  let r = e.getTransformNodeByName("le5le_skybox");
  return r && t.addToRenderList(r.mesh), t;
};
class jUe extends zs {
  constructor() {
    super(...arguments), this.valueType = se.LinesMesh, this.prototype = Tp;
  }
  isType(e) {
    return e instanceof Tp;
  }
  clone(e) {
    return M9(e);
  }
  equals(e, t) {
    return JSON.stringify(e) === JSON.stringify(t);
  }
  deserialize(e, t) {
    if (e instanceof Tp)
      return e;
    if (zt.isType(e, se.Object, t)) {
      const r = zt.createInstance(
        this.valueType,
        t,
        e.__initOption
      );
      return zt.setValue(r, e, t), r;
    }
  }
  createInstance(e, t) {
    const r = e.scene.scene, n = Object.keys(t).reduce(
      (i, s) => (s === "points" ? i.points = t[s].map(
        (a) => new S(a.x, a.y, a.z)
      ) : s === "colors" ? i[s] = t[s].map((a) => lR(a)) : s === "material" ? i[s] = r.getMaterialByName(t[s]) : s === "instance" ? i[s] = r.getMeshByName(t[s]) : i[s] = t[s], i),
      {}
    );
    return Ef.CreateLines(Zn(), n, r);
  }
}
const $n = class $n {
};
$n.map = /* @__PURE__ */ new Map(), $n.infoMap = /* @__PURE__ */ new Map(), $n.register = (e) => {
  $n.map.set(e.valueType, e);
}, $n.typeOf = (e, t) => {
  for (const [, r] of $n.map)
    if (r.isType(e, t))
      return r.valueType;
  return se.Unknown;
}, $n.isType = (e, t, r) => {
  const n = $n.map.get(t);
  return (n == null ? void 0 : n.isType(e, r)) ?? !1;
}, $n.typeToStr = (e) => {
  for (const [t, r] of Object.entries(se))
    if (!Number.isNaN(Number(r)) && r === e)
      return t;
}, $n.isMaterialType = (e) => e === se.StandardMaterial || e === se.PBRMaterial || e === se.GridMaterial || e === se.GradientMaterial || e === se.NodeMaterial || e === se.ShaderMaterial || e === se.CityMaterial || e === se.WaterMaterial, $n.isTextureType = (e) => e === se.Texture || e === se.VideoTexture || e === se.CubeTexture || e === se.MirrorTexture, $n.clone = (e, t) => {
  for (const [, r] of $n.map)
    if (r.isType(e, t))
      return r.clone(e);
  return M9(e);
}, $n.equals = (e, t, r) => {
  const n = $n.typeOf(e, r), i = $n.typeOf(t, r);
  if (n !== i)
    return [
      se.VideoTexture,
      se.CubeTexture,
      se.MirrorTexture,
      se.Texture,
      se.StandardMaterial,
      se.GridMaterial,
      se.PBRMaterial,
      se.GradientMaterial,
      se.CityMaterial,
      se.ShaderMaterial,
      se.NodeMaterial,
      se.WaterMaterial,
      se.Scene,
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh,
      se.ArcRotateCamera,
      se.FreeCamera,
      se.FollowCamera,
      se.PointLight,
      se.SpotLight,
      se.HemisphericLight,
      se.DirectionalLight
    ].some(
      (s) => s === n && i === se.Object || s === i && n === se.Object
    ) ? $n.equals(
      $n.serialize(e, r),
      $n.serialize(t, r),
      r
    ) : !1;
  for (const [, s] of $n.map)
    if (s.valueType === n)
      return s.equals(e, t);
  return e === t;
}, $n.serialize = (e, t, r = !1) => {
  for (const [, n] of $n.map)
    if (n.isType(e, t))
      return n.serialize(e, t, r);
  return e;
}, $n.deserialize = (e, t, r) => {
  let n = $n.typeOf(e, t);
  if (n === se.Object && ("__targetType" in e || "__valueType" in e) && ("__targetType" in e && (e.__valueType = se[e.__targetType]), "__valueType" in e && (n = e.__valueType)), r != null) {
    const i = Xa(r);
    i.includes(n) || (n = i[0]);
  }
  try {
    if (V0(e) && e.id) {
      const s = t.getTargetById(e.id, n);
      if (s)
        return $n.setValue(s, e, t), s;
    }
    if (n == null || n === se.Unknown)
      return e;
    const i = $n.map.get(n);
    return i ? i.deserialize(e, t) : e;
  } catch (i) {
    throw console.error(
      "解析数据失败！数据：",
      e,
      " 类型：",
      $n.typeToStr(n),
      "错误信息：",
      i
    ), new Error();
  }
}, $n.getFinalTargetAndProperty = (e, t, r) => {
  if (t.includes("#")) {
    const n = t.split("#");
    let i = e, s = n.shift();
    for (let a = 0; a < n.length; a++) {
      if (!(i instanceof Object))
        return console.error(
          "执行对象类型不是 Object ，原始对象为：",
          e,
          "属性值为：",
          t,
          "当前解析的执行对象为：",
          i,
          "当前解析的属性为：",
          s
        ), { target: void 0, property: "" };
      const { getValue: f } = $n.getTargetPropertyInfo(
        i,
        s,
        r
      );
      i = f(i, r), s = n[a];
    }
    return { target: i, property: s };
  }
  return { target: e, property: t };
}, $n.getInfo = (e) => {
  if (!$n.infoMap.has(e) && $n.map.has(e)) {
    const t = /* @__PURE__ */ new Map();
    [...g9e, ...DN].forEach((r) => {
      r.verify(e) && t.set(r.property, r);
    }), $n.infoMap.set(e, t);
  }
  return $n.infoMap.get(e);
}, $n.getValueInfo = (e, t) => {
  const r = $n.typeOf(e, t);
  return $n.getInfo(r);
}, $n.getPropertyInfo = (e, t) => $n.getInfo(e).get(t) || {
  property: t,
  name: "",
  valueType: se.Unknown,
  animatable: !1,
  updatable: !1,
  getValue() {
  },
  setValue() {
  },
  serialize() {
  },
  getDefaultValue() {
  },
  verify: () => !1,
  verifyValue: () => !1,
  isMetadata: !1
}, $n.getTargetPropertyInfo = (e, t, r) => {
  const { target: n, property: i } = $n.getFinalTargetAndProperty(e, t, r), s = $n.typeOf(n, r);
  return $n.getPropertyInfo(s, i);
}, $n.createInstance = (e, t, r) => {
  const n = $n.map.get(e);
  if (n) {
    const i = n.createInstance(t, r);
    if (i instanceof Object && "metadata" in i) {
      t.getMetadata(i) || t.setMetadata(i);
      const s = t.getMetadata(i);
      s.__initOption = r, $n.initMetadata(i, t), s.__valueType === se.Mesh && $n.setValue(
        i,
        { receiveShadows: !0, generateShadow: !0 },
        t
      ), i instanceof Hr && (i.reIntegrateRotationIntoRotationQuaternion = !0);
    }
    return i;
  }
}, $n.setValue = (e, t, r) => {
  for (const n in t) {
    const i = t[n], s = n.split("#"), a = {};
    let f = !1, o = e, d;
    for (let v = 0; v < s.length; v++) {
      const u = s[v];
      if (v === s.length - 1)
        if (f)
          if (Array.isArray(d)) {
            const l = d.findIndex((P) => P.id === u);
            d[l] = i;
          } else
            d[u] = i;
        else
          a[u] = i;
      else if (f)
        if (Array.isArray(d)) {
          const l = d.findIndex((P) => P.id === u);
          d = d[l];
        } else if (V0(d))
          d = d[u];
        else
          return console.error(
            "SetValue error: " + u + "值不为Array或Object"
          );
      else {
        const l = $n.typeOf(o, r), P = $n.getPropertyInfo(l, u);
        if (P.valueType === se.Unknown)
          return console.error("SetValue error: 不存在属性" + u);
        {
          const p = P.getValue(o, r);
          $n.typeOf(p, r) < se.Scene ? (f = !0, d = p, a[u] = p) : o = p;
        }
      }
    }
    for (const v in a) {
      const { setValue: u } = $n.getTargetPropertyInfo(
        o,
        v,
        r
      );
      u(o, a[v], r);
    }
  }
}, $n.getValue = (e, t, r, n = !1) => {
  if (!(!e || !t) && e) {
    const { target: i, property: s } = $n.getFinalTargetAndProperty(e, t, r), a = $n.getTargetPropertyInfo(
      i,
      s,
      r
    ), { valueType: f, getValue: o } = a;
    if (f === se.Unknown)
      return;
    const d = o(i, r);
    return n ? d : M9($n.serialize(d, r));
  }
}, $n.initMetadata = (e, t) => {
  if (t.getMetadata(e) || t.setMetadata(e), e instanceof Object && e.getClassName)
    for (const r of DN) {
      const { property: n, getValue: i, setValue: s, getDefaultValue: a, verifyValue: f } = r;
      if (f(e, t)) {
        const o = i(e, t) ?? a(e, t);
        s(e, o, t);
      }
    }
}, $n.loadNode = (e = {}, t) => {
  const {
    data: r = [],
    placeholder: n = !0,
    onEnd: i = () => {
    },
    onProgress: s = () => {
    },
    onRenderRoot: a = () => {
    }
  } = e, f = Xa(r), o = [], d = [], v = f.length;
  let u = 0;
  const l = () => {
    u === v && (i == null || i({ loaded: u, total: v, manager: t, nodes: o }));
  }, P = {}, p = (H) => {
    P[H] || (P[H] = { total: 0, loaded: 0 }), P[H].total++;
  }, c = (H) => {
    P[H].loaded++;
    const { total: T, loaded: q } = P[H];
    T === q && (a(d), delete P[H]);
  };
  f.forEach((H, T) => {
    var Y, ee;
    const {
      __glbUUID: q,
      __glbName: b,
      __glbUrl: j,
      __glbIndex: w,
      __valueType: m,
      __instancedID: I,
      __instancedType: N,
      __initOption: k,
      id: R,
      material: y,
      groupAnimations: O
    } = H;
    if (b && j && q && !t.resourceManager.glbUUIDMap.has(q) && t.resourceManager.glbUUIDMap.set(q, {
      name: b,
      url: j
    }), ("texts" in H || "images" in H) && (H.contents = [
      ...(H.texts || []).map(
        (Z) => (Z.type = "text", Z)
      ),
      ...(H.images || []).map(
        (Z) => (Z.type = "image", Z)
      )
    ]), m === se.Mesh && ((Y = k == null ? void 0 : k.type) != null && Y.startsWith("2DPanel")) && (k.type === "2DPanel2" ? (t.pivotPointPlacementMap.set(R, $2.NX_NY_CZ), k.type = "2DPanel") : k.type === "2DPanel3" && (t.pivotPointPlacementMap.set(R, $2.PX_NY_CZ), k.type = "2DPanel")), m >= se.PointLight && m <= se.FreeCamera)
      u++, s({
        index: T,
        loaded: u,
        total: v,
        data: H,
        manager: t,
        error: { message: "不支持加载模型中的灯光和相机！" }
      }), console.error("不支持加载模型中的灯光和相机！"), o[T] = void 0, d[T] = void 0;
    else if (q)
      if (I) {
        u++;
        const { root: Z, transformNodes: te, meshes: fe } = t.resourceManager.getInstanced(I, q);
        let _;
        N === se.TransformNode ? _ = te[w] : _ = fe[w], R && (_.name = R), $n.deserialize(
          {
            ...H,
            id: _.name,
            __glbIndex: w,
            __glbUUID: q,
            __valueType: m,
            __instancedID: I,
            __instancedType: N
          },
          t
        ), s({ index: T, loaded: u, total: v, data: H, node: _, manager: t }), o[T] = _, d[T] = Z, t.nodeManager.addNodes(Z);
      } else
        p(q), d[T] = (ee = t.resourceManager.get(q, {
          data: H,
          placeholder: n,
          onSuccess: (Z) => {
            Promise.resolve().then(() => {
              u++;
              let te, fe;
              try {
                const _ = m ?? se.Mesh;
                let G = w ?? 0;
                const L = t.resourceManager.getList(_), $ = Z[L];
                if (G >= $.length && (G = G - $.length), te = Z[L][G], R && (te.name = R), $n.isType(y, se.Object, t) && y.__glbUUID) {
                  y.id && (Z.materials[y.__glbIndex].name = y.id);
                  for (const ae in y) {
                    const Pe = y[ae];
                    V0(Pe) && Pe.__glbUUID && Pe.id && (Z.textures[Pe.__glbIndex].name = Pe.id);
                  }
                }
                te === Z.root ? $n.deserialize(
                  {
                    ...H,
                    id: te.name,
                    __valueType: _,
                    __glbIndex: G,
                    groupAnimations: O ?? Z.animationGroups.map(({ id: ae, name: Pe, group: ge }) => ({
                      id: ae,
                      name: Pe,
                      speedRatio: ge.speedRatio,
                      endStatus: qM.Start
                    }))
                  },
                  t
                ) : $n.deserialize(
                  {
                    ...H,
                    id: te.name,
                    __glbIndex: G,
                    __valueType: _
                  },
                  t
                );
              } catch (_) {
                console.error("解析节点数据失败！", _), fe = _;
              } finally {
                s({
                  index: T,
                  loaded: u,
                  total: v,
                  data: H,
                  node: te,
                  manager: t,
                  error: fe
                }), o[T] = te, d[T] = Z.root, t.nodeManager.addNodes(Z.root), c(q), l();
              }
            });
          },
          onError: (Z) => {
            Promise.resolve().then(() => {
              u++, s({ index: T, loaded: u, total: v, data: H, manager: t, error: Z }), o[T] = void 0, d[T] = void 0, c(q), l();
            });
          }
        })) == null ? void 0 : ee.placeholder;
    else {
      u++;
      let Z, te;
      try {
        Z = $n.deserialize(H, t);
      } catch (fe) {
        te = fe;
      } finally {
        s({ index: T, loaded: u, total: v, data: H, node: Z, manager: t, error: te }), o[T] = Z, d[T] = Z, Z instanceof Hr && t.nodeManager.addNodes(Z);
      }
    }
  }), a(d), l();
}, $n.cloneNode = (e, t, r = !1, n, i, s) => {
  const a = Array.from(
    new Set(Xa(e).map((H) => t.getRoot(H)))
  ), f = [], o = [], d = {}, v = {}, u = (H) => {
    if (!H.__glbUUID)
      return;
    v[H.__glbUUID] || (v[H.__glbUUID] = Zn());
    const T = t.resourceManager.glbUUIDMap.get(H.__glbUUID);
    H.__glbUUID = v[H.__glbUUID], t.resourceManager.glbUUIDMap.set(H.__glbUUID, T);
  }, l = a.length;
  let P = 0;
  const p = () => {
    P === l && (n == null || n(f));
  }, c = (H) => {
    const T = t.getMetadata(H);
    return T.__valueType === se.InstancedMesh ? c(
      t.getTargetById(T.__initOption.source, [
        se.TransformNode,
        se.Mesh
      ])
    ) : H;
  };
  for (let H = 0; H < a.length; H++) {
    const T = a[H], q = [T, ...t.getChildren(T)], b = Zn(), j = q.map((w, m) => {
      const I = $n.serialize(w, t, !0), N = I.__glbUUID, k = I.id;
      if (I.id = Zn(), r) {
        const R = c(q[m]);
        I.__instancedID = b, I.__instancedType = R instanceof jn ? se.Mesh : se.TransformNode, I.__valueType = se.InstancedMesh, I.__initOption = { source: R.name };
      } else
        I.__valueType === se.InstancedMesh ? I.__instancedID = b : I.__glbUUID && u(I);
      if (I.material) {
        const R = I.material, y = R.id, O = d[y] || Zn();
        R.id = O, d[y] = O, u(R), Object.keys(R).forEach((Y) => {
          if (V0(R[Y]) && $n.isTextureType(R[Y].__valueType)) {
            const ee = R[Y], Z = ee.id, te = d[Z] || Zn();
            ee.id = te, d[Z] = te, u(ee);
          }
        });
      }
      if (m === 0) {
        const R = t.pivotPointPlacementMap.get(N || k) || $2.None;
        t.pivotPointPlacementMap.set(
          I.__glbUUID || I.id,
          R
        );
      }
      return I;
    });
    $n.loadNode(
      {
        data: j,
        onEnd: ({ nodes: w }) => {
          P++, f[H] = w[0], i == null || i(f[H], H), p();
        },
        onRenderRoot: (w) => {
          o[H] = w[0], o.length === a.length && (s == null || s(o));
        }
      },
      t
    );
  }
};
let zt = $n;
const wUe = (A, e, t) => zt.equals(A, e, t);
function EBe(A) {
  switch (A) {
    case se.Number:
      return 0;
    case se.String:
      return "";
    case se.Boolean:
      return !1;
    case se.Null:
      return null;
    case se.Void:
      return;
    case se.Array:
      return [];
    case se.Object:
      return {};
  }
}
[
  new WBe(),
  new gBe(),
  new nBe(),
  new OBe(),
  new HBe(),
  new aBe(),
  new pBe(),
  new CBe(),
  new SBe(),
  new yBe(),
  new jBe(),
  new DBe(),
  new hBe(),
  new dBe(),
  new vBe(),
  new TBe(),
  new BBe(),
  new iBe(),
  new sBe(),
  new IBe(),
  new RBe(),
  new VBe(),
  new bBe(),
  new wBe(),
  new PBe(),
  new xBe(),
  new lBe(),
  new cBe(),
  new eBe(),
  new UBe(),
  new tBe(),
  new ABe(),
  new fBe(),
  new mBe(),
  new qBe(),
  new uBe(),
  new oBe(),
  new rBe(),
  new XBe()
].forEach((A) => zt.register(A));
const FBe = [
  {
    property: "id",
    name: "ID",
    valueType: se.String,
    getValue(A) {
      return A instanceof C0 ? A.id : A.name;
    },
    setValue(A, e) {
      A instanceof C0 ? A.id = e : A.name = e;
    }
  },
  {
    property: "name",
    name: "名称",
    valueType: se.String,
    getValue(A) {
      return A instanceof C0 ? A.name : A.id;
    },
    setValue(A, e) {
      A instanceof C0 ? A.name = e : A.id = e;
    }
  },
  {
    property: "clearColor",
    name: "背景色",
    valueType: se.Color4,
    animatable: !0,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "useOrderIndependentTransparency",
    name: "场景网格透明顺序增强",
    valueType: se.Boolean,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "lon",
    name: "经度",
    valueType: se.Number,
    animatable: !1,
    includes: [se.Scene]
  },
  {
    property: "lat",
    name: "纬度",
    valueType: se.Number,
    animatable: !1,
    includes: [se.Scene]
  },
  {
    property: "groundEnabled",
    name: "显示网格地面",
    valueType: se.Boolean,
    includes: [se.Scene]
  },
  {
    property: "groundOpacity",
    name: "地面透明度",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "groundMainColor",
    name: "网格颜色",
    valueType: se.Color3,
    includes: [se.Scene]
  },
  {
    property: "groundLineColor",
    name: "线条颜色",
    valueType: se.Color3,
    includes: [se.Scene]
  },
  {
    property: "environmentType",
    name: "环境类型",
    valueType: se.String,
    includes: [se.Scene]
  },
  {
    property: "skyboxUrl",
    name: "天空盒地址",
    valueType: se.String,
    includes: [se.Scene]
  },
  {
    property: "hdrUrl",
    name: "环境贴图地址",
    valueType: se.String,
    includes: [se.Scene]
  },
  {
    property: "hdrIntensity",
    name: "环境亮度",
    valueType: se.Number,
    updatable: !0,
    animatable: !0,
    includes: [se.Scene]
  },
  {
    property: "weather",
    name: "天气",
    valueType: se.String,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "weatherArea",
    name: "天气范围",
    valueType: se.Number,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "weatherEmitRate",
    name: "天气度数",
    valueType: se.Number,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "minutes",
    name: "时间(分钟)",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "sunEnabled",
    name: "是否开启太阳光",
    valueType: se.Boolean,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "sunMaxIntensity",
    name: "阳光最大亮度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "sunShadowEnabled",
    name: "是否产生阴影",
    valueType: se.Boolean,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "sunFilteringQuality",
    name: "阴影质量",
    valueType: se.Number,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "sunBias",
    name: "阴影偏移",
    valueType: se.Number,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "usePipeline",
    name: "开启后处理",
    valueType: se.Boolean,
    includes: [se.Scene]
  },
  // 抗锯齿
  {
    property: "samples",
    name: "抗锯齿",
    valueType: se.Number,
    includes: [se.Scene]
  },
  // 泛光
  {
    property: "bloomEnabled",
    name: "开启绽放",
    valueType: se.Boolean,
    includes: [se.Scene]
  },
  {
    property: "bloomKernel",
    name: "模糊因子",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "bloomScale",
    name: "绽放缩放",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "bloomThreshold",
    name: "绽放阈值",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "bloomWeight",
    name: "绽放权值",
    valueType: se.Number,
    includes: [se.Scene]
  },
  //图像处理
  {
    property: "imageProcessingEnabled",
    name: "开启图像处理",
    valueType: se.Boolean,
    includes: [se.Scene]
  },
  {
    property: "contrast",
    name: "对比度",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "exposure",
    name: "曝光度",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "colorGradingTexture",
    name: "LUT",
    valueType: se.String,
    includes: [se.Scene]
  },
  {
    property: "colorGradingLevel",
    name: "LUT亮度值",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "globalHue",
    name: "全局色调",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "globalSaturation",
    name: "全局饱和度",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "useSharpen",
    name: "锐化",
    valueType: se.Boolean,
    includes: [se.Scene]
  },
  {
    property: "edgeAmount",
    name: "强度",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "colorAmount",
    name: "色彩强度",
    valueType: se.Number,
    includes: [se.Scene]
  },
  //屏幕空间反射SSR
  {
    property: "useSSR",
    name: "屏幕空间反射",
    valueType: se.Boolean,
    includes: [se.Scene]
  },
  {
    property: "SSRStrength",
    name: "反射强度",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "SSRStep",
    name: "反射步长",
    valueType: se.Number,
    includes: [se.Scene]
  },
  //reflectionSpecularFalloffExponent
  {
    property: "SSRRreflectionSpecularFalloffExponent",
    name: "反射步长",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "SSRBlurDispersionStrength",
    name: "反射步长",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "cameraAttached",
    name: "相机交互",
    valueType: se.Boolean,
    includes: [se.Scene]
  },
  {
    property: "activeCameraType",
    name: "相机类型",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "cameraTarget",
    name: "相机目标",
    valueType: se.Vector3,
    includes: [se.Scene]
  },
  {
    property: "cameraTarget.x",
    name: "相机目标-X",
    valueType: se.Number,
    serializable: !1,
    animatable: !0,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "cameraTarget.y",
    name: "相机目标-Y",
    valueType: se.Number,
    serializable: !1,
    animatable: !0,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "cameraTarget.z",
    name: "相机目标-Z",
    valueType: se.Number,
    serializable: !1,
    animatable: !0,
    updatable: !0,
    includes: [se.Scene]
  },
  {
    property: "cameraRadius",
    name: "相机半径",
    animatable: !0,
    updatable: !0,
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "cameraUpperRadiusLimit",
    name: "相机最大半径",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "cameraLowerRadiusLimit",
    name: "相机最小半径",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "cameraAlpha",
    name: "相机水平角度",
    animatable: !0,
    updatable: !0,
    valueType: se.Number,
    includes: [se.Scene]
  },
  /* {
    property: "cameraUpperAlphaLimit",
    name: "相机最大水平角度",
    valueType: ValueType.Number,
    includes: [ValueType.Scene],
  },
  {
    property: "cameraLowerAlphaLimit",
    name: "相机最小水平角度",
    valueType: ValueType.Number,
    includes: [ValueType.Scene],
  }, */
  {
    property: "cameraBeta",
    name: "相机垂直角度",
    animatable: !0,
    updatable: !0,
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "cameraUpperBetaLimit",
    name: "相机最大垂直角度",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "cameraLowerBetaLimit",
    name: "相机最小垂直角度",
    valueType: se.Number,
    includes: [se.Scene]
  },
  {
    property: "enabled",
    name: "是否开启",
    valueType: se.Boolean,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh,
      se.HemisphericLight,
      se.DirectionalLight,
      se.PointLight,
      se.SpotLight
    ],
    updatable: !0,
    getValue(A) {
      return A.isEnabled(!1);
    },
    setValue(A, e) {
      A.setEnabled(e);
    }
  },
  {
    property: "visibility",
    name: "透明度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh,
      se.TransformNode
    ]
  },
  /* {
    property: "sideOrientation",
    name: "透明度",
    valueType: ValueType.Number,
    animatable: true,
    updatable: true,
    includes: [ValueType.AbstractMesh, ValueType.Mesh],
  }, */
  {
    property: "material",
    name: "材质",
    valueType: [
      se.StandardMaterial,
      se.PBRMaterial,
      se.GridMaterial,
      se.GradientMaterial,
      se.NodeMaterial,
      se.CityMaterial,
      se.ShaderMaterial,
      se.WaterMaterial,
      se.String
    ],
    includes: [se.AbstractMesh, se.Mesh],
    setValue(A, e, t) {
      var n, i;
      const r = t.getMetadata(A);
      if (!((i = (n = r == null ? void 0 : r.__initOption) == null ? void 0 : n.type) != null && i.startsWith("2DPanel")))
        if (typeof e == "string") {
          const s = e.substring(3);
          A.material = t.getTargetById(s);
        } else
          A.material = e;
    },
    serializable(A, e) {
      var r, n;
      const t = e.getMetadata(A);
      return !((n = (r = t == null ? void 0 : t.__initOption) == null ? void 0 : r.type) != null && n.startsWith("2DPanel"));
    }
  },
  {
    property: "position",
    name: "位置",
    valueType: se.Vector3,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh,
      se.FreeCamera
    ]
  },
  {
    property: "position.x",
    name: "位置-X",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh,
      se.FreeCamera
    ]
  },
  {
    property: "position.y",
    name: "位置-Y",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh,
      se.FreeCamera
    ]
  },
  {
    property: "position.z",
    name: "位置-Z",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh,
      se.FreeCamera
    ]
  },
  {
    property: "scaling",
    name: "缩放",
    valueType: se.Vector3,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ]
  },
  {
    property: "scaling.x",
    name: "缩放-X",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ]
  },
  {
    property: "scaling.y",
    name: "缩放-Y",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ]
  },
  {
    property: "scaling.z",
    name: "缩放-Z",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ]
  },
  {
    property: "rotation",
    name: "旋转",
    valueType: se.Vector3,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    getValue(A) {
      const e = QC(A);
      return e.x = ye.ToDegrees(e.x), e.y = ye.ToDegrees(e.y), e.z = ye.ToDegrees(e.z), e;
    },
    setValue(A, e) {
      T9e(
        A,
        new S(
          ye.ToRadians(e.x),
          ye.ToRadians(e.y),
          ye.ToRadians(e.z)
        )
      );
    }
  },
  {
    property: "rotation.x",
    name: "旋转-X",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    getValue(A, e) {
      return zt.getValue(A, "rotation", e).x;
    },
    setValue(A, e, t) {
      const r = zt.getValue(A, "rotation", t);
      r.x = e, zt.setValue(A, { rotation: r }, t);
    }
  },
  {
    property: "rotation.y",
    name: "旋转-Y",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    getValue(A, e) {
      return zt.getValue(A, "rotation", e).y;
    },
    setValue(A, e, t) {
      const r = zt.getValue(A, "rotation", t);
      r.y = e, zt.setValue(A, { rotation: r }, t);
    }
  },
  {
    property: "rotation.z",
    name: "旋转-Z",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    getValue(A, e) {
      return zt.getValue(A, "rotation", e).z;
    },
    setValue(A, e, t) {
      const r = zt.getValue(A, "rotation", t);
      r.z = e, zt.setValue(A, { rotation: r }, t);
    }
  },
  {
    property: "receiveShadows",
    name: "接收阴影",
    valueType: se.Boolean,
    includes: [se.AbstractMesh, se.Mesh],
    setValue(A, e, t) {
      [A, ...A.getChildMeshes()].forEach((r) => {
        r instanceof bp || (r.receiveShadows = e);
      });
    }
  },
  {
    property: "direction",
    name: "方向",
    valueType: se.Vector3,
    includes: [se.SpotLight, se.HemisphericLight]
  },
  {
    property: "direction.x",
    name: "方向-X",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [se.HemisphericLight, se.SpotLight]
  },
  {
    property: "direction.y",
    name: "方向-Y",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [se.HemisphericLight, se.SpotLight]
  },
  {
    property: "direction.z",
    name: "方向-Z",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [se.HemisphericLight, se.SpotLight]
  },
  {
    property: "diffuse",
    name: "漫反射色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [
      se.HemisphericLight,
      se.SpotLight,
      se.DirectionalLight,
      se.PointLight
    ]
  },
  {
    property: "specular",
    name: "高光色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [
      se.HemisphericLight,
      se.SpotLight,
      se.DirectionalLight,
      se.PointLight
    ]
  },
  {
    property: "intensity",
    name: "强度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [
      se.HemisphericLight,
      se.SpotLight,
      se.DirectionalLight,
      se.PointLight
    ]
  },
  {
    property: "range",
    name: "范围",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [
      se.HemisphericLight,
      se.SpotLight,
      se.DirectionalLight,
      se.PointLight
    ]
  },
  {
    property: "shadowEnabled",
    name: "是否开启阴影",
    valueType: se.Boolean,
    includes: [
      se.SpotLight,
      se.DirectionalLight,
      se.PointLight
    ],
    setValue(A, e, t) {
      if (e) {
        const r = t.getMetadata(A);
        A.autoUpdateExtends = !0;
        const n = new ln(1024, A);
        n.bias = 0.01, n.normalBias = 0.1, n.usePercentageCloserFiltering = !0;
        const i = r.bias ?? 0.5;
        n.bias = i / 1e4;
        const s = r.filteringQuality ?? ln.QUALITY_LOW;
        n.filteringQuality = s, t.getMeshes().forEach((a) => {
          const f = t.getMetadata(a);
          f != null && f.generateShadow && (n == null || n.addShadowCaster(a, !1));
        });
      } else {
        const r = A.getShadowGenerator();
        r == null || r.dispose();
      }
      A.shadowEnabled = e;
    }
  },
  {
    property: "shadowMinZ",
    name: "是否开启阴影",
    valueType: se.Boolean,
    includes: [
      se.SpotLight,
      se.DirectionalLight,
      se.PointLight
    ]
  },
  {
    property: "shadowMaxZ",
    name: "是否开启阴影",
    valueType: se.Boolean,
    includes: [
      se.SpotLight,
      se.DirectionalLight,
      se.PointLight
    ]
  },
  {
    property: "angle",
    name: "角度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.SpotLight],
    getValue(A) {
      return ye.ToDegrees(A.angle);
    },
    setValue(A, e) {
      A.angle = ye.ToRadians(e);
    }
  },
  {
    property: "exponent",
    name: "衰减度",
    valueType: se.Number,
    animatable: !0,
    includes: [se.SpotLight]
  },
  {
    property: "target",
    name: "目标",
    valueType: se.Vector3,
    includes: [se.ArcRotateCamera, se.FreeCamera]
  },
  {
    property: "target.x",
    name: "目标-X",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [se.ArcRotateCamera, se.FreeCamera]
  },
  {
    property: "target.y",
    name: "目标-Y",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [se.ArcRotateCamera, se.FreeCamera]
  },
  {
    property: "target.z",
    name: "目标-Z",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    serializable: !1,
    includes: [se.ArcRotateCamera, se.FreeCamera]
  },
  {
    property: "speed",
    name: "速度",
    valueType: se.Number,
    animatable: !0,
    includes: [se.ArcRotateCamera, se.FreeCamera]
  },
  {
    property: "panningSensibility",
    name: "平移灵敏度",
    valueType: se.Number,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "wheelPrecision",
    name: "滚轮精度",
    valueType: se.Number,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "angularSensibilityX",
    name: "水平旋转精度",
    valueType: se.Number,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "angularSensibilityY",
    name: "垂直旋转精度",
    valueType: se.Number,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "inertia",
    name: "旋转惯性",
    valueType: se.Number,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "panningInertia",
    name: "平移惯性",
    valueType: se.Number,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "inertialRadiusOffset",
    name: "缩放惯性",
    valueType: se.Number,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "panningAxis",
    name: "平移轴限制",
    valueType: se.Vector3,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "alpha",
    name: "水平角度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.ArcRotateCamera],
    getValue(A) {
      return ye.ToDegrees(A.alpha);
    },
    setValue(A, e) {
      A.alpha = ye.ToRadians(e);
    }
  },
  {
    property: "beta",
    name: "垂直角度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.ArcRotateCamera],
    getValue(A) {
      return ye.ToDegrees(A.beta);
    },
    setValue(A, e) {
      A.beta = ye.ToRadians(e);
    }
  },
  {
    property: "radius",
    name: "半径",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "zoomToMouseLocation",
    name: "缩放至鼠标位置",
    valueType: se.Boolean,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "upperRadiusLimit",
    name: "最大半径",
    valueType: se.Number,
    updatable: !0,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "lowerRadiusLimit",
    name: "最小半径",
    valueType: se.Number,
    updatable: !0,
    includes: [se.ArcRotateCamera]
  },
  {
    property: "upperBetaLimit",
    name: "最大垂直角度",
    valueType: se.Number,
    updatable: !0,
    includes: [se.ArcRotateCamera],
    getValue(A) {
      return ye.ToDegrees(A.upperBetaLimit);
    },
    setValue(A, e) {
      A.upperBetaLimit = ye.ToRadians(e);
    }
  },
  {
    property: "lowerBetaLimit",
    name: "最小垂直角度",
    valueType: se.Number,
    updatable: !0,
    includes: [se.ArcRotateCamera],
    getValue(A) {
      return ye.ToDegrees(A.lowerBetaLimit);
    },
    setValue(A, e) {
      A.lowerBetaLimit = ye.ToRadians(e);
    }
  },
  {
    property: "fov",
    name: "视场角",
    valueType: se.Number,
    includes: [se.ArcRotateCamera],
    getValue(A) {
      return ye.ToDegrees(A.fov);
    },
    setValue(A, e) {
      A.fov = ye.ToRadians(e);
    }
  },
  {
    property: "diffuseColor",
    name: "漫反射色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.StandardMaterial]
  },
  {
    property: "emissiveColor",
    name: "自发光色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.StandardMaterial, se.PBRMaterial],
    setValue(A, e) {
      A.emissiveColor = e, A.linkEmissiveWithDiffuse = !0;
    }
  },
  {
    property: "specularColor",
    name: "高光色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.StandardMaterial]
  },
  {
    property: "diffuseTexture",
    name: "漫反射纹理",
    valueType: [se.Texture, se.String],
    includes: [se.StandardMaterial],
    setValue(A, e, t) {
      var r;
      typeof e == "string" ? A.diffuseTexture = t.getTargetById(e.substring(3)) : A.diffuseTexture = e, (r = A.diffuseTexture) != null && r.hasAlpha && (A.useAlphaFromDiffuseTexture = !0, A.transparencyMode = 2);
    }
  },
  {
    property: "bumpTexture",
    name: "凹凸纹理",
    valueType: [se.Texture, se.String],
    includes: [
      se.StandardMaterial,
      se.PBRMaterial,
      se.WaterMaterial
    ],
    setValue(A, e, t) {
      typeof e == "string" ? A.bumpTexture = t.getTargetById(e.substring(3)) : A.bumpTexture = e;
    }
  },
  {
    property: "ambientTexture",
    name: "环境纹理",
    valueType: [se.Texture, se.String],
    includes: [se.StandardMaterial, se.PBRMaterial],
    setValue(A, e, t) {
      typeof e == "string" ? A.ambientTexture = t.getTargetById(e.substring(3)) : A.ambientTexture = e;
    }
  },
  {
    property: "metallicTexture",
    name: "金属度纹理",
    valueType: [se.Texture, se.String],
    includes: [se.PBRMaterial],
    setValue(A, e, t) {
      typeof e == "string" ? A.metallicTexture = t.getTargetById(e.substring(3)) : A.metallicTexture = e;
    }
  },
  {
    property: "useRoughnessFromMetallicTextureGreen",
    name: "粗糙度关联金属绿色通道",
    valueType: se.Boolean,
    includes: [se.StandardMaterial, se.PBRMaterial]
  },
  {
    property: "emissiveTexture",
    name: "自发光纹理",
    valueType: [se.Texture, se.String],
    includes: [se.StandardMaterial, se.PBRMaterial],
    setValue(A, e, t) {
      typeof e == "string" ? A.emissiveTexture = t.getTargetById(e.substring(3)) : A.emissiveTexture = e;
    }
  },
  {
    property: "lightmapTexture",
    name: "光照纹理",
    valueType: [se.Texture, se.String],
    includes: [se.StandardMaterial, se.PBRMaterial],
    setValue(A, e, t) {
      typeof e == "string" ? A.lightmapTexture = t.getTargetById(e.substring(3)) : A.lightmapTexture = e;
    }
  },
  {
    property: "mainColor",
    name: "网格色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.GridMaterial]
  },
  {
    property: "lineColor",
    name: "线条色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.GridMaterial]
  },
  {
    property: "opacity",
    name: "透明度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.GridMaterial]
  },
  {
    property: "gridRatio",
    name: "线条缩放",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.GridMaterial]
  },
  {
    property: "url",
    name: "地址",
    valueType: se.String,
    updatable: !0,
    includes: [
      se.VideoTexture,
      se.Texture,
      se.CubeTexture,
      se.MirrorTexture
    ],
    setValue(A, e) {
      A.url === e || typeof e == "string" && e.startsWith("data:") || A.updateURL(e || void 0);
    }
  },
  {
    property: "vOffset",
    name: "纵向(v)偏移",
    valueType: se.Number,
    updatable: !0,
    includes: [se.Texture],
    animatable: !0
  },
  {
    property: "uOffset",
    name: "横向(u)偏移",
    valueType: se.Number,
    updatable: !0,
    includes: [se.Texture],
    animatable: !0
  },
  {
    property: "vScale",
    name: "纵向(v)缩放",
    valueType: se.Number,
    updatable: !0,
    includes: [se.Texture],
    animatable: !0
  },
  {
    property: "uScale",
    name: "纵向(u)缩放",
    valueType: se.Number,
    updatable: !0,
    includes: [se.Texture],
    animatable: !0
  },
  {
    property: "coordinatesIndex",
    name: "UV坐标索引",
    valueType: se.Number,
    includes: [se.Texture]
  },
  {
    property: "isRGBD",
    name: "包含RGBD",
    valueType: se.Boolean,
    includes: [se.Texture]
  },
  {
    property: "backFaceCulling",
    name: "隐藏背面",
    valueType: se.Boolean,
    includes: [
      se.StandardMaterial,
      se.PBRMaterial,
      se.GradientMaterial,
      se.GridMaterial,
      se.NodeMaterial,
      se.WaterMaterial,
      se.ShaderMaterial
    ]
  },
  {
    property: "reflectionTexture",
    name: "反射纹理",
    valueType: [se.Texture, se.MirrorTexture, se.String],
    includes: [se.StandardMaterial, se.PBRMaterial],
    setValue(A, e, t) {
      typeof e == "string" ? A.reflectionTexture = t.getTargetById(e.substring(3)) : A.reflectionTexture = e;
    }
  },
  {
    property: "albedoColor",
    name: "漫反射色",
    valueType: se.Color3,
    updatable: !0,
    animatable: !0,
    includes: [se.PBRMaterial]
  },
  {
    property: "reflectionColor",
    name: "反射颜色",
    valueType: se.Color3,
    animatable: !0,
    includes: [se.PBRMaterial, se.StandardMaterial]
  },
  //PBR材质 反射参数
  {
    property: "indexOfRefraction",
    name: "反射索引",
    valueType: se.Number,
    includes: [se.PBRMaterial]
  },
  //PBR材质 反射参数
  {
    property: "metallicF0Factor",
    name: "金属因子",
    valueType: se.Number,
    includes: [se.PBRMaterial]
  },
  //PBR材质 反射参数
  {
    property: "ambientTextureStrength",
    name: "环境纹理强度",
    valueType: se.Number,
    includes: [se.PBRMaterial]
  },
  {
    property: "albedoTexture",
    name: "漫反射纹理",
    valueType: [se.Texture, se.String],
    includes: [se.PBRMaterial],
    setValue(A, e, t) {
      var r, n;
      if (typeof e == "string") {
        let i = t.getTargetById(e.substring(3));
        if ((r = i.url) != null && r.startsWith("data:"))
          return;
        A.albedoTexture = i;
      } else
        A.albedoTexture = e;
      (n = A.albedoTexture) != null && n.hasAlpha && (A.useAlphaFromAlbedoTexture = !0, A.transparencyMode == 0 && (A.transparencyMode = 2));
    }
  },
  {
    property: "isClearCoat",
    name: "isClearCoat",
    valueType: se.Boolean,
    includes: [se.PBRMaterial],
    getValue(A) {
      var e;
      return (e = A == null ? void 0 : A.clearCoat) == null ? void 0 : e.isEnabled;
    },
    setValue(A, e) {
      A.clearCoat && (A.clearCoat.isEnabled = e);
    }
  },
  {
    property: "metallic",
    name: "金属光泽",
    valueType: se.Number,
    animatable: !0,
    includes: [se.PBRMaterial]
  },
  {
    property: "roughness",
    name: "粗糙度",
    valueType: se.Number,
    animatable: !0,
    includes: [se.PBRMaterial]
  },
  {
    property: "topColor",
    name: "开始颜色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.GradientMaterial]
  },
  {
    property: "topColorAlpha",
    name: "开始颜色透明度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.GradientMaterial]
  },
  {
    property: "bottomColor",
    name: "结束颜色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.GradientMaterial]
  },
  {
    property: "bottomColorAlpha",
    name: "结束颜色透明度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.GradientMaterial]
  },
  {
    property: "scale",
    name: "比例值",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.GradientMaterial]
  },
  {
    property: "offset",
    name: "补偿度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.GradientMaterial]
  },
  {
    property: "smoothness",
    name: "光滑度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.GradientMaterial]
  },
  {
    property: "hasAlpha",
    name: "是否透明",
    valueType: se.Boolean,
    includes: [
      se.VideoTexture,
      se.Texture,
      se.CubeTexture
    ],
    //需要将hasAlpha 和 useAlphaFromDiffUseTexture 属性合二为一；
    setValue(A, e, t) {
      const r = t.scene.scene;
      A.hasAlpha = e, r.materials.forEach((n) => {
        if (n.hasTexture(A)) {
          let i = 0;
          e && (i = 2), n.transparencyMode = i, n instanceof mr ? n.useAlphaFromAlbedoTexture = e : n instanceof Wt && (n.useAlphaFromDiffuseTexture = e);
        }
      });
    }
  },
  {
    property: "alphaMode",
    name: "透明模式",
    /**
     *
     * 0 ALPHA_DISABLE
     * 1 ALPHA_ADD
     * 2 ALPHA_COMBINE
     * 3 ALPHA_SUBTRACT
     * 4 ALPHA_MULTIPLY
     * 5 ALPHA_MAXIMIZED
     * 6 ALPHA_ONEONE
     * 7 ALPHA_PREMULTIPLIED
     * 8 ALPHA_PREMULTIPLIED_PORTERDUFF
     * 9 ALPHA_INTERPOLATE
     * 10	ALPHA_SCREENMODE
     */
    valueType: se.Number,
    includes: [se.PBRMaterial, se.StandardMaterial],
    animatable: !1
  },
  {
    property: "coordinatesMode",
    name: "坐标模式",
    /**
     *
     * 0 EXPLICIT_MODE
     * 1 SPHERICAL_MODE
     * 2 PLANAR_MODE
     * 3 CUBIC_MODE
     * 4 PROJECTION_MODE
     * 5 SKYBOX_MODE
     * 6 INVCUBIC_MODE
     * 7 EQUIRECTANGULAR_MODE
     * 8 FIXED_EQUIRECTANGULAR_MODE
     * 9 FIXED_EQUIRECTANGULAR_MIRRORED_MODE
     */
    valueType: se.Number,
    includes: [se.Texture],
    animatable: !1
  },
  {
    property: "emissiveIntensity",
    name: "自发光亮度",
    valueType: se.Number,
    animatable: !0,
    includes: [se.PBRMaterial]
  },
  {
    property: "billboardMode",
    name: "固定朝向",
    valueType: se.Number,
    includes: [se.Mesh]
  },
  {
    property: "renderingGroupId",
    name: "渲染层级",
    valueType: se.Number,
    includes: [se.Mesh]
  },
  {
    property: "useLightmapAsShadowmap",
    name: "混合光影映射",
    valueType: se.Boolean,
    includes: [se.StandardMaterial, se.PBRMaterial]
  },
  {
    property: "isPickable",
    name: "是否可拾取",
    valueType: se.Boolean,
    includes: [
      se.TransformNode,
      se.AbstractMesh,
      se.Mesh,
      se.InstancedMesh
    ],
    getValue(A, e) {
      return A instanceof jn ? A.isPickable : e.getMetadata(A).isPickable ?? !0;
    },
    setValue(A, e, t) {
      [A, ...t.getChildren(A)].forEach((r) => {
        if (r instanceof jn) {
          r.isPickable = e;
          return;
        }
        if (r instanceof Hr) {
          const n = t.getMetadata(r);
          n.isPickable = e;
        }
      });
    }
  },
  {
    property: "windForce",
    name: "流速",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.WaterMaterial]
  },
  {
    property: "bumpHeight",
    name: "跳跃高度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.WaterMaterial]
  },
  {
    property: "waveHeight",
    name: "波峰高度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.WaterMaterial]
  },
  {
    property: "materialAlpha",
    name: "材质透明度",
    valueType: se.Number,
    includes: [se.StandardMaterial, se.PBRMaterial],
    getValue(A) {
      return A.alpha;
    },
    setValue(A, e, t) {
      A.alpha = e;
    }
  },
  {
    property: "waveLength",
    name: "波长",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.WaterMaterial]
  },
  {
    property: "waterColor",
    name: "水色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.WaterMaterial]
  },
  //cityMaterial属性
  {
    property: "mainColor",
    name: "建筑主色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.CityMaterial]
  },
  {
    property: "growColor",
    name: "生长线色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.CityMaterial]
  },
  {
    property: "mixColor",
    name: "横线主色",
    valueType: se.Color3,
    animatable: !0,
    updatable: !0,
    includes: [se.CityMaterial]
  },
  {
    property: "maxHeight",
    name: "最大生长高度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.CityMaterial]
  },
  {
    property: "minHeight",
    name: "最小生长高度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.CityMaterial]
  },
  {
    property: "ringLength",
    name: "圆环宽度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.CityMaterial]
  },
  {
    property: "timeScale1",
    name: "圆环生长速度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.CityMaterial]
  },
  {
    property: "timeScale2",
    name: "线条扫掠速度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.CityMaterial]
  },
  {
    property: "timeScale3",
    name: "生长线生长速度",
    valueType: se.Number,
    animatable: !0,
    updatable: !0,
    includes: [se.CityMaterial]
  }
], g9e = FBe.map((A) => {
  const e = { ...A, isMetadata: !1 }, {
    getValue: t,
    setValue: r,
    serialize: n,
    property: i,
    includes: s,
    excludes: a,
    valueType: f,
    serializable: o = !0
  } = A;
  return e.verify = (d) => (!a || !a.includes(d)) && (!s || s.includes(d)), e.verifyValue = (d, v) => e.verify(zt.typeOf(d, v)), e.getValue = (d, v) => {
    if (e.verifyValue(d, v)) {
      if (t)
        return t(d, v);
      {
        const [u, l] = i.split(".");
        return l ? d[u][l] : d[i];
      }
    }
  }, e.setValue = (d, v, u) => {
    if (e.verifyValue(d, u))
      if (v = zt.deserialize(v, u, f), r)
        r(d, v, u);
      else {
        const [l, P] = i.split(".");
        P ? d[l][P] = v : d[i] = v;
      }
  }, e.serialize = (d, v, u = !1) => {
    if (!(o instanceof Function ? !o(d, v) : !o)) {
      if (n)
        return n(d, v, u);
      {
        const l = e.getValue(d, v);
        if (!V0(l) || !l.doNotSerialize)
          return zt.serialize(l, v, u);
      }
    }
  }, e;
});
function mUe() {
  return /Android|webOS|iPad|iPhone|iPod|BlackBerry/i.test(navigator.userAgent);
}
function NBe(A) {
  return typeof A == "string" ? document.getElementById(A) : A;
}
const BUe = (A, e) => {
  for (; A; ) {
    if (A === e)
      return !0;
    A = A.parentElement;
  }
  return !1;
}, d$ = (A, e) => {
  Xa(A).forEach((t) => {
    t instanceof Hr ? t.setParent(e) : t.parent = e;
  });
}, X9e = (A) => A.length ? A.length === 1 ? A[0] : S.Center(A[0], X9e(A.slice(1))) : S.Zero(), wM = (A, e = $2.None) => {
  if (!e || e === $2.None)
    return;
  const { min: t, max: r } = A.getHierarchyBoundingVectors();
  let n = 0, i = 0, s = 0;
  e.includes("PX") ? n = r.x : e.includes("CX") ? n = (r.x - t.x) / 2 + t.x : e.includes("NX") && (n = t.x), e.includes("PY") ? i = r.y : e.includes("CY") ? i = (r.y - t.y) / 2 + t.y : e.includes("NY") && (i = t.y), e.includes("PZ") ? s = r.z : e.includes("CZ") ? s = (r.z - t.z) / 2 + t.z : e.includes("NZ") && (s = t.z), A.position.x -= n, A.position.y -= i, A.position.z -= s, A.bakeCurrentTransformIntoVertices();
}, WUe = (A, e) => {
  const t = e.getMetadata(A), r = ye.ToRadians(t.lightAlpha ?? 0), n = ye.ToRadians(t.lightBeta ?? 0), i = t.lightRadius ?? 0, { x: s, y: a, z: f } = s9e(i, r, n);
  A.direction = new S(s, a, f), A.position = new S(-s, -a, -f);
}, QC = (A) => A.rotationQuaternion ? A.rotationQuaternion.toEulerAngles() : A.rotation.clone(), T9e = (A, e) => {
  A.reIntegrateRotationIntoRotationQuaternion = !0, A.rotation = e.clone();
};
function SUe(A) {
  return A.name.startsWith("le5le_pivotPoint");
}
function UUe(A) {
  return A.name.startsWith("le5le_transformNodeMesh");
}
function IUe(A) {
  return A.name.startsWith("le5le_lightRange");
}
function RUe(A) {
  return A.name.startsWith(yC);
}
function VUe(A) {
  return A.name.startsWith("le5le_decal");
}
function TD(A) {
  return A.name.startsWith(zd);
}
const CUe = (A) => A.name.startsWith(iM);
function OUe(A) {
  return A.name.startsWith(XV);
}
function yUe(A) {
  return A.name.startsWith(a2e);
}
const kUe = (A) => A.name.startsWith(sM), EUe = (A) => A.name.startsWith(o2e), FUe = (A) => A.name.startsWith(f2e);
function NUe(A) {
  return ID(A).endsWith(".json");
}
function QUe(A) {
  return ID(A).endsWith(".babylon");
}
function QBe(A) {
  return ID(A).endsWith(".glb") || A.endsWith(".gltf");
}
const YUe = (A) => ID(A).endsWith(".l3d"), v$ = (A) => ID(A).endsWith(".l3db"), YBe = (A) => ID(A).endsWith(".l3dm"), MBe = (A) => ID(A).endsWith(".hdr"), ID = (A) => A.split("?")[0];
function MUe(A) {
  const e = typeof A == "string" ? A : A.name;
  return ID(e).split(".").slice(0, -1).join(".");
}
const F5 = (A, e) => {
  TM.get(A, { responseType: "blob" }).then((t) => {
    const r = t instanceof Blob ? t : t.data instanceof Blob ? t.data : null;
    if (r) {
      const n = new FileReader();
      n.onload = (i) => {
        const s = i.target.result;
        e == null || e(s);
      }, n.readAsDataURL(r);
    }
  });
};
function LUe(A, e) {
  A.forEach((t, r) => {
    let n = e.getMaterialByName(r);
    if (n && n instanceof mr && n.albedoTexture) {
      let i = n.albedoTexture;
      i.updateURL(t[0].data, t[0].buffer), i.hasAlpha = !0;
    }
  });
}
function KUe(A, e) {
  A == null || A.forEach((t) => {
    var i;
    const r = new Ut();
    r.indices = t.getIndices(), r.positions = t.getVerticesData(
      J.PositionKind,
      !0,
      !0
    ), r.uvs = t.getVerticesData(J.UVKind, !0, !0), r.normals = t.getVerticesData(
      J.NormalKind,
      !0,
      !0
    ), r.colors = t.getVerticesData(
      J.ColorKind,
      !0,
      !0
    ), r.uvs2 = t.getVerticesData(J.UV2Kind, !0, !0), r.uvs3 = t.getVerticesData(J.UV3Kind, !0, !0), r.uvs4 = t.getVerticesData(J.UV4Kind, !0, !0), r.uvs5 = t.getVerticesData(J.UV5Kind, !0, !0), r.matricesIndices = t.getVerticesData(
      J.MatricesIndicesKind,
      !0,
      !0
    ), r.matricesWeights = t.getVerticesData(
      J.MatricesWeightsKind,
      !0,
      !0
    ), r.matricesWeightsExtra = t.getVerticesData(
      J.MatricesWeightsExtraKind,
      !0,
      !0
    ), r.matricesWeightsExtra = t.getVerticesData(
      J.MatricesWeightsExtraKind,
      !0,
      !0
    ), r.tangents = t.getVerticesData(
      J.TangentKind,
      !0,
      !0
    );
    const n = new Tf(t.id, e, r);
    (i = t.meshes) == null || i.forEach((s) => {
      const a = e.getMeshByName(s.name);
      a && n.applyToMesh(a);
    });
  });
}
function JUe(A, e) {
  e.wrapV = A.wrapV, e.wrapU = A.wrapU, e.wrapR = A.wrapR, e.level = A.level, e.invertZ = A.invertZ, e.hasAlpha = A.hasAlpha, e.metadata = A.metadata, e.wAng = A.wAng - Math.PI, e.vAng = A.vAng - Math.PI, e.uAng = A.uAng, e.uOffset = A.uOffset, e.vOffset = A.vOffset;
}
function zUe(A) {
  A.forEach((e) => {
    e.dispose instanceof Function && e.dispose();
  }), A instanceof Array ? A.length = 0 : A instanceof Map && A.clear();
}
function GUe(A) {
  let e;
  switch (!0) {
    case A instanceof nA:
      e = JBe(A);
      break;
    case A instanceof ag:
      e = KBe(A);
      break;
    case A instanceof IA:
      e = LBe(A);
      break;
  }
  return e;
}
function LBe(A) {
  const e = A;
  let t = e.getScene(), r = t.getMeshByName(
    HN + "&" + e.uniqueId
  );
  const n = [], i = t.getMeshByName(
    XV + "&" + A.name
  );
  i ? n.push(i.getAbsolutePosition()) : n.push(e.direction), n.push(S.Zero()), r = Ef.CreateLines(
    HN + "&" + e.uniqueId,
    { points: n, updatable: !0, instance: r },
    t
  ), r.isPickable = !1;
  const s = r;
  return s.color = e.diffuse, s.renderingGroupId = 1, r;
}
function KBe(A) {
  let e = A;
  e.range > 1e4 && (e.range = 5);
  let t = e.getScene(), r = t.getMeshByName(
    hN + "&" + e.uniqueId
  );
  const n = e.range, i = [];
  for (let a = 0; a < 3.15 * 2; a += 3.15 / 20) {
    let f = e.getAbsolutePosition().x, o = e.getAbsolutePosition().y + n * Math.cos(a), d = e.getAbsolutePosition().z + n * Math.sin(a);
    i.push(new S(f, o, d));
  }
  for (let a = 0; a < 3.15 * 2.5; a += 3.15 / 20) {
    let f = e.getAbsolutePosition().z, o = e.getAbsolutePosition().y + n * Math.cos(a), d = e.getAbsolutePosition().x + n * Math.sin(a);
    i.push(new S(d, o, f));
  }
  for (let a = 0; a < 3.15 * 2; a += 3.15 / 20) {
    let f = e.getAbsolutePosition().y, o = e.getAbsolutePosition().x + n * Math.cos(a), d = e.getAbsolutePosition().z + n * Math.sin(a);
    i.push(new S(o, f, d));
  }
  r = Ef.CreateLines(
    hN + "&" + e.uniqueId,
    { points: i, updatable: !0, instance: r },
    t
  ), r.isPickable = !1;
  const s = r;
  return s.color = e.diffuse, r;
}
function JBe(A) {
  let e = A;
  e.range > 1e4 && (e.range = 5);
  let t = Math.sin(e.angle * 0.5) * e.range, r = e.getAbsolutePosition().clone().add(
    S.Normalize(e.direction).scale(
      e.range * Math.cos(e.angle / 2)
    )
  ), n = e.direction, i;
  n.x == 0 && n.y == 0 && n.z == 0 && (n = new S(0, -1, 0)), n.z !== 0 ? i = new S(1, 1, -(n.x + n.y) / n.z) : n.x !== 0 ? i = new S(-(n.z + n.y) / n.x, 1, 1) : n.y !== 0 && (i = new S(1, -(n.z + n.x) / n.y, 1)), n.x != 0 && n.y != 0 && n.z == 0 && (i = new S(0, 0, 1));
  let s = [];
  s.length = 0;
  let a = e.getScene(), f = a.getMeshByName(
    gN + "&" + e.uniqueId
  ), o = r.add(i).subtract(r);
  if (n.y != 0 && n.x == 0 && n.z == 0)
    for (let u = 0; u <= Math.PI * 2; u += Math.PI / 90) {
      let l = r.x + t * Math.cos(u), P = r.z + t * Math.sin(u);
      s.push(new S(l, r.y, P));
    }
  else
    for (let u = 0; u <= 180; u++) {
      let l = zBe(o, n, 2 * u);
      s.push(r.add(S.Normalize(l).scale(t)));
    }
  s.push(e.getAbsolutePosition().clone()), s.push(s[90]), s.push(e.getAbsolutePosition().clone()), s.push(s[45]), s.push(e.getAbsolutePosition().clone()), s.push(s[135]);
  let d = { points: s, updatable: !0, instance: f };
  f = Ef.CreateLines(
    gN + "&" + e.uniqueId,
    d,
    a
  ), f.isPickable = !1;
  let v = f;
  return v.color = e.diffuse, v.renderingGroupId = 2, f;
}
function zBe(A, e, t) {
  let r = t * Math.PI / 180, n = Math.cos(r), i = Math.sin(r), s = e.x, a = e.y, f = e.z, o = A.x, d = A.x, v = A.z, u = (s * s * (1 - n) + n) * o + (s * a * (1 - n) - f * i) * d + (s * f * (1 - n) + a * i) * v, l = (a * s * (1 - n) + f * i) * o + (a * a * (1 - n) + n) * d + (a * f * (1 - n) - s * i) * v, P = (s * f * (1 - n) - a * i) * o + (a * f * (1 - n) + s * i) * d + (f * f * (1 - n) + n) * v;
  return new S(u, l, P);
}
function ZUe(A) {
  const e = A.getScene();
  [
    hN,
    HN,
    gN
  ].forEach((r) => {
    let n = e.getMeshByName(r + "&" + A.uniqueId);
    n && n.dispose();
  });
}
const GBe = (A = window.location.href) => {
  const [, e] = A.split("?"), t = {};
  return e == null || e.split("&").forEach((r) => {
    const [n, i] = r.split("=");
    t[n] = i;
  }), t;
}, ZBe = (A) => {
  if (A.startsWith("http")) {
    const [e, t] = A.split("//"), [r, ...n] = t.split("/"), i = "/" + n.join("/");
    return {
      protocol: e,
      host: r,
      path: i
    };
  }
  return {
    protocol: "",
    host: "",
    path: A
  };
};
function _Be(A) {
  const e = A.split("/");
  return e[e.length - 1] = "", e.join("/");
}
const u$ = (...A) => A.length < 2 ? A[0] || "" : A.map((e, t) => t === 0 ? e.replace(/\/$/, "") : t === A.length - 1 ? e.replace(/^\//, "") : e.replace(/^\//, "").replace(/\/$/, "")).join("/");
class _Ue {
}
const uc = class uc {
};
uc.map = /* @__PURE__ */ new Map(), uc.register = (e) => {
  uc.map.set(e.type, e);
}, uc.execute = (e, t, r, n) => {
  const i = uc.map.get(e);
  i && i.execute(t, r, n);
}, uc.describe = (e, t, r, n) => {
  const i = uc.map.get(e);
  return i ? i.describe(t, r, {
    ...uc.getDefaultParam(e),
    ...n
  }) : "";
}, uc.getDefaultParam = (e) => {
  const t = uc.map.get(e);
  if (t)
    return t.getDefaultParam();
}, uc.getDefaultParamListItem = (e) => {
  const t = uc.map.get(e);
  if (t)
    return t.getDefaultParamListItem();
};
let Go = uc;
const $Be = (A, e) => A.reduce((t, r) => {
  const { valueSource: n, value: i, property: s } = r;
  return n === gV.DynamicData ? t[s] = e.dynamicDataManager.getValue(i) : t[s] = i, t;
}, {}), eWe = (A, e, t) => {
  const { names: r } = e;
  let n = "";
  return n += `${tWe(A, e, t)} 中名称为 ${r.join("、") || "未设置"} 的自定义动画`, n;
}, q9e = (A, e) => {
  const { id: t } = A;
  let r = "";
  if (!t)
    r = "未设置";
  else {
    const n = e.networkManager.get(t);
    n ? r = n.name || "未命名" : r = "不存在";
  }
  return `名称为 ${r} 的网络请求`;
}, mM = (A = pp.None) => ({
  [pp.In]: "先慢后快",
  [pp.InOut]: "先慢再快后慢",
  [pp.Out]: "先快后慢",
  [pp.None]: "匀速"
})[A], tWe = (A, e, t) => {
  const {
    targetType: r,
    targetList: n = []
  } = e;
  if (r === "id" && !n.length && A)
    return "自己";
  if (n.length) {
    if (r === "id")
      return `指定的目标 ${n.map((s) => {
        const a = t.getTargetById(s);
        return a ? zt.getValue(a, "name", t) || "未命名" : "不存在";
      }).join("、")}`;
    if (r === "name")
      return `名称为 ${n.join("、") || "未命名"} 的目标`;
    if (r === "group")
      return `分组 ${n.map((s) => {
        const a = t.groupManager.get(s);
        return a ? a.name || "未命名" : "不存在";
      }).join("、")} 中的目标`;
  }
  return "目标未设置";
}, $Ue = (A) => ({
  [Mo.String]: "字符串",
  [Mo.Number]: "数值",
  [Mo.Boolean]: "布尔值"
})[A] || A, eIe = (A) => ({
  plus: "加上",
  subtract: "减去",
  multiply: "乘以",
  divider: "除以"
})[A], b9e = (A) => ({
  0: "环绕",
  1: "正交"
})[A] || "未知", tIe = (A) => ({
  dynamicData: "数据集"
})[A] || "固定值", l$ = (A) => {
  switch (A) {
    case hq.DynamicData:
      return "数据集";
    case hq.Property:
      return "属性值";
    case hq.Value:
      return "固定值";
  }
}, P$ = (A, e, t, r, n) => {
}, rWe = (A) => {
  switch (A) {
    case "=":
      return "等于";
    case "!=":
      return "不等于";
    case "<":
      return "小于";
    case "<=":
      return "小于等于";
    case ">":
      return "大于";
    case ">=":
      return "大于等于";
  }
}, rIe = (A) => A.split("#").map(
  (t) => {
    var r;
    return ((r = [...DN, ...g9e].find(
      (n) => n.property === t
    )) == null ? void 0 : r.name) || t;
  }
).join("-"), x9e = (A, e) => {
  const { value: t, value1: r, valueSource: n } = A;
  return n === gV.DynamicData ? e.dynamicDataManager.getValue(r) : t;
}, nIe = (A, e) => {
};
class nWe {
  constructor() {
    this.type = "AnimationBegin", this.getDefaultParam = () => ({
      targetType: "id",
      targetList: [],
      names: []
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { names: n } = r;
      if (!n.length)
        return;
      t.getTargets(r, e).forEach((s) => {
        const a = t.getRoot(s), f = t.getValue(a, "animations"), o = t.getValue(a, "groupAnimations");
        t.animateManager.begin(a, f.filter((d) => n.includes("custom#" + d.name) || n.includes(d.name)).map((d) => d.id)), t.animateManager.beginGroup(a, o.filter((d) => n.includes("group#" + d.name)).map((d) => d.id));
      });
    }, this.describe = (e, t, r) => {
      let n = "";
      return n += `开始 ${eWe(e, r, t)}`, n;
    };
  }
}
Go.register(new nWe());
class iWe {
  constructor() {
    this.type = "AnimationPause", this.getDefaultParam = () => ({
      targetType: "id",
      targetList: [],
      names: []
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { names: n } = r;
      if (!n.length)
        return;
      t.getTargets(r, e).forEach((s) => {
        const a = t.getRoot(s), f = t.getValue(a, "animations"), o = t.getValue(a, "groupAnimations");
        t.animateManager.pause(a, f.filter((d) => n.includes("custom#" + d.name) || n.includes(d.name)).map((d) => d.id)), t.animateManager.pauseGroup(a, o.filter((d) => n.includes("group#" + d.name)).map((d) => d.id));
      });
    }, this.describe = (e, t, r) => "";
  }
}
Go.register(new iWe());
class sWe {
  constructor() {
    this.type = "AnimationRestart", this.getDefaultParam = () => ({
      targetType: "id",
      targetList: [],
      names: []
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { names: n } = r;
      if (!n.length)
        return;
      t.getTargets(r, e).forEach((s) => {
        const a = t.getRoot(s), f = t.getValue(a, "animations"), o = t.getValue(a, "groupAnimations");
        t.animateManager.restart(a, f.filter((d) => n.includes("custom#" + d.name) || n.includes(d.name)).map((d) => d.id)), t.animateManager.restartGroup(a, o.filter((d) => n.includes("group#" + d.name)).map((d) => d.id));
      });
    }, this.describe = (e, t, r) => "";
  }
}
Go.register(new sWe());
class aWe {
  constructor() {
    this.type = "AnimationStop", this.getDefaultParam = () => ({
      targetType: "id",
      targetList: [],
      names: []
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { names: n } = r;
      if (!n.length)
        return;
      t.getTargets(r, e).forEach((s) => {
        const a = t.getRoot(s), f = t.getValue(
          a,
          "animations"
        ), o = t.getValue(
          a,
          "groupAnimations"
        );
        t.animateManager.stop(
          a,
          f.filter(
            (d) => n.includes("custom#" + d.name) || n.includes(d.name)
          ).map((d) => d.id)
        ), t.animateManager.stopGroup(
          a,
          o.filter((d) => n.includes("group#" + d.name)).map((d) => d.id)
        );
      });
    }, this.describe = (e, t, r) => "";
  }
}
Go.register(new aWe());
class oWe {
  constructor() {
    this.type = "CameraAutoRotateBegin", this.getDefaultParam = () => ({
      speed: 60,
      span: void 0,
      direction: 0
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { speed: n, span: i, direction: s } = r;
      t.autoRotateSpan = i, t.autoRotateSpeed = n, t.autoRotateDirection = s, t.beginAutoRotateCamera();
    }, this.describe = (e, t, r) => {
      const { speed: n } = r;
      return `开始自动旋转相机，旋转一周的时间为 ${n} 秒`;
    };
  }
}
Go.register(new oWe());
class fWe {
  constructor() {
    this.type = "CameraAutoRotateStop", this.getDefaultParam = () => {
    }, this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      t.stopAutoRotateCamera();
    }, this.describe = (e, t, r) => "停止自动旋转相机";
  }
}
Go.register(new fWe());
class AWe {
  constructor() {
    this.type = "CameraMove", this.getDefaultParam = () => ({
      type: 0,
      targetList: [],
      targetType: "id",
      x: 0,
      y: 0,
      z: 0,
      zoom: !0,
      alpha: void 0,
      beta: void 0,
      radius: void 0,
      duration: void 0,
      easingMode: void 0
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const {
        type: n = 0,
        x: i = 0,
        y: s = 0,
        z: a = 0,
        zoom: f = !0,
        alpha: o = t.scene.cameraAlpha,
        beta: d = t.scene.cameraBeta,
        radius: v = t.scene.cameraRadius,
        duration: u = 0,
        easingMode: l = pp.None
      } = r;
      if (n === 0) {
        const P = t.getTargets(r, e);
        t.moveCameraToTargets(
          {
            target: P,
            zoom: f,
            alpha: o,
            beta: d,
            radius: v
          },
          {
            duration: u,
            easingMode: l
          }
        );
      } else
        t.moveCamera(
          {
            target: new S(i, s, a),
            alpha: o,
            beta: d,
            radius: v
          },
          {
            duration: u,
            easingMode: l
          }
        );
    }, this.describe = (e, t, r) => "";
  }
}
Go.register(new AWe());
class dWe {
  constructor() {
    this.type = "Dehighlight", this.getDefaultParam = () => ({
      targetType: "id",
      targetList: []
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      t.getTargets(r, e).forEach((i) => {
        const s = t.nodeManager.getRoot(i);
        t.highlightManager.remove(i), t.eventManager.executeTrigger("AfterDehighlight", s, { target: i });
      });
    }, this.describe = (e, t, r) => "停止自动旋转相机";
  }
}
Go.register(new dWe());
class vWe {
  constructor() {
    this.type = "Highlight", this.getDefaultParam = () => ({
      targetType: "id",
      targetList: [],
      color: void 0
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { color: n } = r;
      t.getTargets(r, e).forEach((s) => {
        const a = t.nodeManager.getRoot(s);
        t.highlightManager.add(s, n), t.eventManager.executeTrigger("AfterHighlight", a, { target: s });
      });
    }, this.describe = (e, t, r) => "停止自动旋转相机";
  }
}
Go.register(new vWe());
class uWe {
  constructor() {
    this.type = "JumpLink", this.getDefaultParam = () => ({
      url: "",
      isBlank: !0
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { url: n, isBlank: i } = r;
      n && window.open(n, i ? "_blank" : "_self");
    }, this.describe = (e, t, r) => "";
  }
}
Go.register(new uWe());
class lWe {
  constructor() {
    this.type = "NetworkCancel", this.getDefaultParam = () => ({
      id: ""
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { id: n } = r;
      t.networkManager.cancel(n);
    }, this.describe = (e, t, r) => {
      let n = "";
      return n += `取消 ${q9e(r, t)}`, n;
    };
  }
}
Go.register(new lWe());
class PWe {
  constructor() {
    this.type = "NetworkRequest", this.getDefaultParam = () => ({
      id: ""
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { id: n } = r;
      t.networkManager.request(n, e);
    }, this.describe = (e, t, r) => {
      let n = "";
      return n += `发送 ${q9e(r, t)}`, n;
    };
  }
}
Go.register(new PWe());
class cWe {
  constructor() {
    this.type = "RunCustomFn", this.getDefaultParam = () => ({
      name: e4(),
      fn: ""
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { name: n, fn: i } = r;
      new Function("target", "sceneManager", i)(e, t), t.eventManager.executeTrigger("AfterRunCustomFn", null, { name: n });
    }, this.describe = (e, t, r) => {
      const { name: n } = r;
      let i = "";
      return i += `执行 ${n ? "window." + n : "未设置"} 函数`, i;
    };
  }
}
Go.register(new cWe());
class pWe {
  constructor() {
    this.type = "RunGlobalFn", this.getDefaultParam = () => ({
      name: ""
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      let { name: n } = r;
      n = n.startsWith("window.") ? n.substring(7) : n;
      const i = n.split(".").reduce((s, a) => {
        try {
          return s[a];
        } catch {
          return;
        }
      }, window);
      i instanceof Function ? (i.apply(null, [t, e]), t.eventManager.executeTrigger("AfterRunGlobalFn", null, {
        name: n
      })) : console.error(
        `ExecuteRunCustomFnEvent Error: window.${n} is not a Function`
      );
    }, this.describe = (e, t, r) => {
      const { name: n } = r;
      let i = "";
      return i += `执行 ${n ? "window." + n : "未设置"} 函数`, i;
    };
  }
}
Go.register(new pWe());
class hWe {
  constructor() {
    this.type = "SendWindowMessage", this.getDefaultParam = () => ({
      name: "",
      receiver: 0
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { name: n, receiver: i } = r;
      let s;
      switch (i) {
        case 0:
          s = window;
          break;
        case 1:
          window.parent !== window && (s = window.parent);
          break;
        case 2:
          window.top !== window && (s = window.top);
          break;
      }
      s && s.postMessage(JSON.stringify({ name: n, id: t.root.id }), "*");
    }, this.describe = (e, t, r) => {
      const { name: n } = r;
      let i = "";
      return i += `执行 ${n ? "window." + n : "未设置"} 函数`, i;
    };
  }
}
Go.register(new hWe());
class HWe {
  constructor() {
    this.type = "SetCameraValue", this.getDefaultParam = () => ({
      type: 0,
      list: [],
      duration: void 0,
      easingMode: pp.None
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { type: n, list: i, duration: s, easingMode: a } = r, f = t.scene.getCamera(n);
      if (f) {
        const o = $Be(i, t);
        t.setValue(
          { target: f, props: o },
          {
            history: !1,
            duration: s,
            easingMode: a,
            onEnd: () => {
              i.forEach(({ property: d }) => {
                t.eventManager.executeTrigger(
                  "AfterSetCameraValue",
                  null,
                  {
                    type: n,
                    property: d
                  }
                );
              });
            }
          }
        );
      }
    }, this.describe = (e, t, r) => {
      const { type: n, list: i, duration: s, easingMode: a } = r;
      let f = "";
      return f += `改变 ${b9e(n)} 的属性 `, f += i.length ? i.map((o) => o.property + " 的值为 " + o.value).join(" 、") : "未设置", f += s ? ` ，过渡时间为 ${s} 秒，效果为 ${mM(a)}` : " ，无过渡效果", f;
    };
  }
}
Go.register(new HWe());
class gWe {
  constructor() {
    this.type = "SetDynamicData", this.getDefaultParam = () => ({
      dataId: "",
      value: void 0,
      value1: "",
      valueSource: gV.Value
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { dataId: n } = r, i = x9e(r, t);
      t.dynamicDataManager.setValue(n, i);
    }, this.describe = (e, t, r) => "";
  }
}
Go.register(new gWe());
class XWe {
  constructor() {
    this.type = "SetValue", this.getDefaultParam = () => ({
      targetType: "id",
      targetList: [],
      list: [this.getDefaultParamListItem()]
    }), this.getDefaultParamListItem = () => ({
      id: "",
      value: void 0,
      value1: "",
      valueSource: gV.Value
    }), this.execute = (e, t, r) => {
      const n = t.getTargets(r, e);
      (r.list ?? [
        {
          id: r.id,
          value: r.value,
          value1: r.value1,
          valueSource: r.valueSource,
          duration: r.duration,
          easingMode: r.easingMode
        }
      ]).forEach((s) => {
        const { duration: a, easingMode: f, id: o } = s, d = x9e(s, t);
        n.forEach((v) => {
          const u = t.nodeManager.getRoot(v);
          if (o.startsWith("le5le#")) {
            const [, ...l] = o.split("#");
            if (l[0] === "contents" || l[0] === "animations" || l[0] === "groupAnimations") {
              const [P, ...p] = l, c = t.getValue(u, P);
              hR.SetNestedValue(c, p, d) && t.setValue(
                { target: v, props: { [P]: c } },
                {
                  history: !1,
                  emit: !1,
                  onEnd: () => {
                    t.eventManager.executeTrigger("AfterSetValue", u, {
                      target: v,
                      id: o
                    });
                  }
                }
              );
            } else
              t.setValue(
                { target: v, props: { [l.join("#")]: d } },
                {
                  duration: a,
                  easingMode: f,
                  emit: !1,
                  onEnd: () => {
                    t.eventManager.executeTrigger("AfterSetValue", u, {
                      target: v,
                      id: o
                    });
                  }
                }
              );
          } else
            t.stateDataManager.setValue(u, o, d);
        });
      });
    }, this.describe = (e, t, r) => "";
  }
}
Go.register(new XWe());
class TWe {
  constructor() {
    this.type = "ShowCameraView", this.getDefaultParam = () => ({
      id: "",
      duration: void 0,
      easingMode: pp.None
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { id: n, duration: i = 0, easingMode: s } = r;
      t.showCameraView(n, {
        duration: i,
        easingMode: s
      });
    }, this.describe = (e, t, r) => {
      const { id: n, duration: i, easingMode: s } = r;
      let a = "";
      const f = t.getCameraView(n);
      return a += `移动相机到机位 ${f ? f.id : "不存在"}`, a += i ? ` ，过渡时间为 ${i} 秒，效果为 ${mM(s)}` : " ，无过渡效果", a;
    };
  }
}
Go.register(new TWe());
class qWe {
  constructor() {
    this.type = "SoundPause", this.getDefaultParam = () => ({
      id: "",
      targetType: "id",
      targetList: []
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
    }, this.describe = (e, t, r) => "ActionSoundPause";
  }
}
Go.register(new qWe());
class bWe {
  constructor() {
    this.type = "SoundPlay", this.getDefaultParam = () => ({
      id: "",
      loop: void 0,
      volume: 50,
      playbackRate: 1,
      targetType: "id",
      targetList: []
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
    }, this.describe = (e, t, r) => "ActionSoundPlay";
  }
}
Go.register(new bWe());
class xWe {
  constructor() {
    this.type = "SoundStop", this.getDefaultParam = () => ({
      id: "",
      targetType: "id",
      targetList: []
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
    }, this.describe = (e, t, r) => "ActionSoundStop";
  }
}
Go.register(new xWe());
class DWe {
  constructor() {
    this.type = "SwitchCamera", this.getDefaultParam = () => ({
      type: "arcRotate",
      duration: void 0,
      easingMode: pp.None
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      const { type: n, duration: i, easingMode: s } = r;
      t.switchCamera(n, {
        duration: i,
        easingMode: s
      });
    }, this.describe = (e, t, r) => {
      const { type: n, duration: i, easingMode: s } = r;
      let a = "";
      return a += `切换到 ${b9e(n)} 相机`, a += i ? ` ，过渡时间为 ${i} 秒，效果为 ${mM(s)}` : " ，无过渡效果", a;
    };
  }
}
Go.register(new DWe());
class jWe {
  constructor() {
    this.type = "SwitchScene", this.getDefaultParam = () => ({
      id: ""
    }), this.getDefaultParamListItem = () => {
    }, this.execute = (e, t, r) => {
      r.id && t.root.switchScene(r.id);
    }, this.describe = (e, t, r) => {
      const { id: n } = r;
      let i = "";
      const s = t.root.getScene(n);
      return i += `切换到 ${s ? `名称为 ${s.name || "未设置"}` : "不存在"} 的场景`, i;
    };
  }
}
Go.register(new jWe());
class iIe {
}
const S2 = class S2 {
};
S2.map = /* @__PURE__ */ new Map(), S2.register = (e) => {
  S2.map.set(e.type, e);
}, S2.pass = (e, t, r, n, i) => {
  const s = S2.map.get(e);
  if (s)
    return s.pass(t, r, n, {
      ...S2.getDefaultParam(e),
      ...i
    });
}, S2.getDefaultParam = (e) => {
  const t = S2.map.get(e);
  if (t)
    return t.getDefaultParam();
};
let Ba = S2;
class wWe {
  constructor() {
    this.type = "AfterAnimationBegin", this.pass = (e, t, r, n) => {
      const { type: i, id: s } = r;
      return n.id === `${i}#${s}`;
    }, this.getDefaultParam = () => ({ id: "" });
  }
}
Ba.register(new wWe());
class mWe {
  constructor() {
    this.type = "AfterAnimationPause", this.pass = (e, t, r, n) => {
      const { type: i, id: s } = r;
      return n.id === `${i}#${s}`;
    }, this.getDefaultParam = () => ({ id: "" });
  }
}
Ba.register(new mWe());
class BWe {
  constructor() {
    this.type = "AfterAnimationRestart", this.pass = (e, t, r, n) => {
      const { type: i, id: s } = r;
      return n.id === `${i}#${s}`;
    }, this.getDefaultParam = () => ({ id: "" });
  }
}
Ba.register(new BWe());
class WWe {
  constructor() {
    this.type = "AfterAnimationStop", this.pass = (e, t, r, n) => {
      const { type: i, id: s } = r;
      return n.id === `${i}#${s}`;
    }, this.getDefaultParam = () => ({ id: "" });
  }
}
Ba.register(new WWe());
class SWe {
  constructor() {
    this.type = "AfterCameraAutoRotateBegin", this.pass = (e, t, r, n) => !0, this.getDefaultParam = () => {
    };
  }
}
Ba.register(new SWe());
class UWe {
  constructor() {
    this.type = "AfterCameraAutoRotateStop", this.pass = (e, t, r, n) => !0, this.getDefaultParam = () => {
    };
  }
}
Ba.register(new UWe());
class IWe {
  constructor() {
    this.type = "AfterDehighlight", this.pass = (e, t, r, n) => {
      const { targetIndex: i } = n, s = t.getTargetsByRoot(e);
      return r.target === s[i];
    }, this.getDefaultParam = () => ({ targetIndex: 0 });
  }
}
Ba.register(new IWe());
class RWe {
  constructor() {
    this.type = "AfterHighlight", this.pass = (e, t, r, n) => {
      const { targetIndex: i } = n, s = t.getTargetsByRoot(e);
      return r.target === s[i];
    }, this.getDefaultParam = () => ({ targetIndex: 0 });
  }
}
Ba.register(new RWe());
class VWe {
  constructor() {
    this.type = "AfterNetworkCancel", this.pass = (e, t, r, n) => n.id === r.id, this.getDefaultParam = () => ({ id: "" });
  }
}
Ba.register(new VWe());
class CWe {
  constructor() {
    this.type = "AfterNetworkRequest", this.pass = (e, t, r, n) => n.id === r.id, this.getDefaultParam = () => ({ id: "" });
  }
}
Ba.register(new CWe());
class OWe {
  constructor() {
    this.type = "AfterNetworkResponse", this.pass = (e, t, r, n) => n.id === r.id, this.getDefaultParam = () => ({ id: "" });
  }
}
Ba.register(new OWe());
class yWe {
  constructor() {
    this.type = "AfterReceivingWindowMessage", this.pass = (e, t, r, n) => r.name === n.name, this.getDefaultParam = () => ({ name: "" });
  }
}
Ba.register(new yWe());
class kWe {
  constructor() {
    this.type = "AfterRunCustomFn", this.pass = (e, t, r, n) => r.name === n.name, this.getDefaultParam = () => ({ name: "" });
  }
}
Ba.register(new kWe());
class EWe {
  constructor() {
    this.type = "AfterRunGlobalFn", this.pass = (e, t, r, n) => r.name === n.name, this.getDefaultParam = () => ({ name: "" });
  }
}
Ba.register(new EWe());
class FWe {
  constructor() {
    this.type = "AfterSetCameraValue", this.pass = (e, t, r, n) => n.type === r.type && n.properties.includes(r.property), this.getDefaultParam = () => ({
      type: 0,
      properties: []
    });
  }
}
Ba.register(new FWe());
class NWe {
  constructor() {
    this.type = "AfterSetDynamicData", this.pass = (e, t, r, n) => (n.dataIds ?? (n.dataId ? [n.dataId] : [])).includes(r.dataId), this.getDefaultParam = () => ({ dataIds: [] });
  }
}
Ba.register(new NWe());
class QWe {
  constructor() {
    this.type = "AfterSetValue", this.pass = (e, t, r, n) => {
      const { targetIndex: i, id: s } = n, a = t.getTargetsByRoot(e);
      return r.target === a[i] && r.id === s;
    }, this.getDefaultParam = () => ({
      targetIndex: 0,
      id: ""
    });
  }
}
Ba.register(new QWe());
class YWe {
  constructor() {
    this.type = "AfterShowCameraView", this.pass = (e, t, r, n) => r.id === n.id, this.getDefaultParam = () => ({ id: "" });
  }
}
Ba.register(new YWe());
class MWe {
  constructor() {
    this.type = "AfterSoundPause", this.pass = (e, t, r, n) => !0, this.getDefaultParam = () => {
    };
  }
}
Ba.register(new MWe());
class LWe {
  constructor() {
    this.type = "AfterSoundPlay", this.pass = (e, t, r, n) => !0, this.getDefaultParam = () => {
    };
  }
}
Ba.register(new LWe());
class KWe {
  constructor() {
    this.type = "AfterSoundStop", this.pass = (e, t, r, n) => !0, this.getDefaultParam = () => {
    };
  }
}
Ba.register(new KWe());
class JWe {
  constructor() {
    this.type = "AfterSwitchCamera", this.pass = (e, t, r, n) => r.type === n.type, this.getDefaultParam = () => ({
      type: "arcRotate"
    });
  }
}
Ba.register(new JWe());
class zWe {
  constructor() {
    this.type = "AfterSwitchScene", this.pass = () => !0, this.getDefaultParam = () => {
    };
  }
}
Ba.register(new zWe());
class GWe {
  constructor() {
    this.type = "Click", this.pass = (e, t, r, n) => {
      const { targetIndex: i } = n, s = t.getTargetsByRoot(e);
      return r.target === s[i];
    }, this.getDefaultParam = () => ({ targetIndex: 0 });
  }
}
Ba.register(new GWe());
class ZWe {
  constructor() {
    this.type = "Dblclick", this.pass = (e, t, r, n) => {
      const { targetIndex: i } = n, s = t.getTargetsByRoot(e);
      return r.target === s[i];
    }, this.getDefaultParam = () => ({ targetIndex: 0 });
  }
}
Ba.register(new ZWe());
class _We {
  constructor() {
    this.type = "KeyDown", this.pass = (e, t, r, n) => !0, this.getDefaultParam = () => {
    };
  }
}
Ba.register(new _We());
class $We {
  constructor() {
    this.type = "KeyUp", this.pass = (e, t, r, n) => !0, this.getDefaultParam = () => {
    };
  }
}
Ba.register(new $We());
class eSe {
  constructor() {
    this.type = "MouseDown", this.pass = (e, t, r, n) => {
      const { targetIndex: i } = n, s = t.getTargetsByRoot(e);
      return r.target === s[i];
    }, this.getDefaultParam = () => ({ targetIndex: 0 });
  }
}
Ba.register(new eSe());
class tSe {
  constructor() {
    this.type = "MouseIn", this.pass = (e, t, r, n) => {
      const { targetIndex: i } = n, s = t.getTargetsByRoot(e);
      return r.target === s[i];
    }, this.getDefaultParam = () => ({ targetIndex: 0 });
  }
}
Ba.register(new tSe());
class rSe {
  constructor() {
    this.type = "MouseOut", this.pass = (e, t, r, n) => {
      const { targetIndex: i } = n, s = t.getTargetsByRoot(e);
      return r.target === s[i];
    }, this.getDefaultParam = () => ({ targetIndex: 0 });
  }
}
Ba.register(new rSe());
class nSe {
  constructor() {
    this.type = "MouseUp", this.pass = (e, t, r, n) => {
      const { targetIndex: i } = n, s = t.getTargetsByRoot(e);
      return r.target === s[i];
    }, this.getDefaultParam = () => ({ targetIndex: 0 });
  }
}
Ba.register(new nSe());
class iSe {
  constructor() {
    this.type = "RightClick", this.pass = (e, t, r, n) => {
      const { targetIndex: i } = n, s = t.getTargetsByRoot(e);
      return r.target === s[i];
    }, this.getDefaultParam = () => ({ targetIndex: 0 });
  }
}
Ba.register(new iSe());
var hq = /* @__PURE__ */ ((A) => (A[A.Value = 0] = "Value", A[A.DynamicData = 1] = "DynamicData", A[A.Property = 2] = "Property", A))(hq || {});
const sSe = (A) => {
  const {
    nodes: e,
    dynamicDatas: t,
    dynamicData: r,
    stateDatas: n,
    animateDatas: i,
    eventDatas: s,
    groupDatas: a
  } = A;
  t.push(...r.datas);
  const f = r.relations.reduce((l, P) => {
    const p = {};
    return P.datas.forEach((c) => {
      p[c.stateId] = c;
    }), l[P.targetId] = p, l;
  }, {}), o = i.reduce((l, P) => (l[P.targetId] = P.datas, l), {}), d = n.reduce(
    (l, P) => (l[P.targetId] = P.datas, P.datas.forEach((p) => {
      var H;
      const c = (H = f[P.targetId]) == null ? void 0 : H[p.id];
      c && (p.dataId = c.dataId);
    }), l),
    {}
  ), v = s.reduce((l, P) => (l[P.targetId] = P.datas, l), {}), u = a.reduce((l, P) => (P.nodeIds.forEach((p) => {
    const c = l[p] || [];
    c.push(P.id), l[p] = c;
  }), l), {});
  e.forEach((l) => {
    l.animations = o[l.id] || [], l.states = d[l.id] || [], l.events = v[l.id] || [], l.groups = u[l.id] || [];
  });
}, aSe = (A) => {
  const { nodes: e, instancedNodes: t, scene: r } = A;
  [r, ...e, ...t].forEach((n) => {
    n.events = (n.events || []).map((i) => {
      const {
        id: s,
        name: a,
        triggerParam: f,
        triggerType: o,
        actionParam: d,
        actionType: v,
        condition: u,
        disabled: l
      } = i;
      return o === "AfterSetDynamicData" && (f.dataIds = f.dataIds ?? (f.dataId ? [f.dataId] : []), delete f.dataId), {
        id: s,
        name: a,
        triggerParam: f,
        triggerType: o,
        disabled: l,
        list: [
          {
            id: e4(),
            name: "",
            condition: u,
            list: [
              {
                id: e4(),
                actionParam: d,
                actionType: v
              }
            ]
          }
        ]
      };
    });
  });
}, oSe = (A) => {
  const { nodes: e, instancedNodes: t } = A, r = {}, n = {};
  t.forEach((s) => {
    const {
      __initOption: { source: a },
      __instancedID: f
    } = s;
    if (f)
      return;
    const o = e.find((d) => d.id === a);
    if (!o) {
      e.push(s);
      return;
    }
    if (o.__glbUUID) {
      n[o.__glbUUID] || (n[o.__glbUUID] = {}), n[o.__glbUUID][o.__valueType] || (n[o.__glbUUID][o.__valueType] = {}), r[o.__glbUUID] || (r[o.__glbUUID] = []);
      const d = n[o.__glbUUID][o.__valueType][o.__glbIndex] ?? 0;
      n[o.__glbUUID][o.__valueType][o.__glbIndex] = d + 1;
      const v = r[o.__glbUUID][d] ?? Zn();
      r[o.__glbUUID][d] = v, s.__glbIndex = o.__glbIndex, s.__glbUUID = o.__glbUUID, s.__instancedID = v;
    } else
      s.__instancedID = Zn();
    s.__instancedType = o.__valueType === se.TransformNode ? se.TransformNode : se.Mesh, delete s.__parentId;
  }), t.sort((s, a) => s.__instancedID !== a.__instancedID ? s.__instancedID < a.__instancedID ? -1 : 1 : s.__instancedType !== a.__instancedType ? s.__valueType < a.__valueType ? 1 : -1 : s.__glbIndex !== a.__glbIndex ? s.__glbIndex < a.__glbIndex ? -1 : 1 : 0);
  const i = t.filter(
    (s) => !!s.__instancedID
  );
  t.length = 0, t.push(...i);
}, fSe = (A) => {
  const { nodes: e, instancedNodes: t, scene: r } = A;
  r.__targetIndex = 0;
  const n = {}, i = {};
  e.forEach((s) => {
    s.__glbUUID ? (n[s.__glbUUID] || (n[s.__glbUUID] = {
      id: s.__glbUUID,
      root: null,
      meshes: [],
      transformNodes: []
    }), s.__valueType === se.TransformNode ? n[s.__glbUUID].transformNodes[s.__glbIndex] = s : (s.__glbIndex === 0 && (n[s.__glbUUID].root = s), n[s.__glbUUID].meshes[s.__glbIndex] = s)) : s.__targetIndex = 0;
  }), t.forEach((s) => {
    s.__glbUUID ? (i[s.__instancedID] || (i[s.__instancedID] = {
      id: s.__instancedID,
      root: null,
      meshes: [],
      transformNodes: []
    }), s.__instancedType === se.TransformNode ? i[s.__instancedID].transformNodes[s.__glbIndex] = s : (s.__glbIndex === 0 && (i[s.__instancedID].root = s), i[s.__instancedID].meshes[s.__glbIndex] = s)) : s.__targetIndex = 0;
  }), [...Object.values(n), ...Object.values(i)].forEach((s) => {
    if (!s.root) {
      const a = s.meshes.length / 2;
      s.meshes = s.meshes.slice(a), s.meshes.forEach((o, d) => {
        o.__glbIndex = d;
      });
      const f = s.transformNodes.length / 2;
      s.transformNodes = s.transformNodes.slice(f), s.transformNodes.forEach((o, d) => {
        o.__glbIndex = d;
      }), s.root = s.meshes[0];
    }
    [...s.meshes, ...s.transformNodes].forEach((a, f) => {
      a.__targetIndex = f;
    });
  }), [r, ...e, ...t].forEach((s) => {
    var f, o, d;
    const a = s.__glbUUID ? s.__instancedID ? i[s.__instancedID].root : n[s.__glbUUID].root : s;
    (f = s.animations) == null || f.forEach((v) => {
      v.targetIndex = s.__targetIndex, s !== a && (a.animations || (a.animations = []), a.animations.push(v));
    }), (o = s.states) == null || o.forEach((v) => {
      v.id.startsWith("le5le#animations#") ? v.id = "0#" + v.id : v.id.startsWith("le5le#") && (v.id = s.__targetIndex + "#" + v.id), v.list.forEach((u) => {
        u.controls.forEach((l) => {
          l.actionParam && "targetType" in l.actionParam && l.actionParam.targetType === "id" && !l.actionParam.targetList.length && (l.actionParam.targetList = [s.id]);
        });
      }), s !== a && (a.states || (a.states = []), a.states.push(v));
    }), (d = s.events) == null || d.forEach((v) => {
      if (v.triggerType === "Click" || v.triggerType === "MouseDown" || v.triggerType === "MouseIn" || v.triggerType === "MouseOut" || v.triggerType === "MouseUp" || v.triggerType === "Dblclick" || v.triggerType === "RightClick" || v.triggerType === "AfterDehighlight" || v.triggerType === "AfterHighlight" || v.triggerType === "AfterSetValue") {
        v.triggerParam || (v.triggerParam = {});
        const u = v.triggerParam;
        u.targetIndex = s.__targetIndex, v.triggerType === "AfterSetValue" && u.id.startsWith("le5le#animations#") && (u.targetIndex = 0);
      }
      v.list.forEach((u) => {
        u.condition.list.forEach((l) => {
          var P, p, c, H;
          l.source1 === hq.Property && !l.targetId1 && ((P = l.value1) != null && P.startsWith("le5le#animation") || !((p = l.value1) != null && p.startsWith("le5le#")) ? l.targetId1 = a.id : l.targetId1 = s.id), l.source2 === hq.Property && !l.targetId2 && ((c = l.value2) != null && c.startsWith("le5le#animation") || !((H = l.value2) != null && H.startsWith("le5le#")) ? l.targetId2 = a.id : l.targetId2 = s.id);
        }), u.list.forEach((l) => {
          l.actionParam && "targetType" in l.actionParam && l.actionParam.targetType === "id" && !l.actionParam.targetList.length && (l.actionParam.targetList = [s.id]);
        });
      }), s !== a && (a.events || (a.events = []), a.events.push(v));
    });
  });
}, ASe = (A) => {
  const { scene: e, environment: t } = A, r = e.skyBoxUrl || "", n = e.environmentTextureUrl || "", i = "";
  t.environmentType = t.environmentType ?? i, t.skyboxUrl = t.skyboxUrl ?? r, t.hdrUrl = t.hdrUrl ?? n, t.hdrIntensity = t.hdrIntensity ?? e.environmentIntensity;
}, dSe = (A) => {
  const { id: e, scene: t, environment: r, arcRotateCamera: n } = A;
  delete r.id, delete r.name, delete n.id, delete n.name, Object.assign(t, r, { id: e });
  const i = ([s, ...a]) => s.toUpperCase() + a.join("");
  Object.keys(n).forEach((s) => {
    t["camera" + i(s.split(""))] = n[s];
  });
}, vSe = [
  {
    version: 1,
    compatible: sSe
  },
  {
    version: 1.1,
    compatible: aSe
  },
  {
    version: 1.2,
    compatible: oSe
  },
  {
    version: 1.3,
    compatible: fSe
  },
  {
    version: 1.4,
    compatible: ASe
  },
  {
    version: 1.5,
    compatible: dSe
  }
], uSe = (A) => {
  let {
    version: e = pR.VERSION,
    id: t,
    nodes: r = [],
    arcRotateCamera: n = {},
    instancedNodes: i = [],
    dynamicDatas: s = [],
    groupDatas: a = [],
    scene: f = {},
    environment: o = {},
    dynamicData: d = { datas: [], relations: [] },
    stateDatas: v = [],
    animateDatas: u = [],
    eventDatas: l = [],
    ...P
  } = A;
  return e < pR.VERSION && vSe.filter((p) => p.version > e).forEach((p) => {
    p.compatible({
      id: t,
      nodes: r,
      arcRotateCamera: n,
      dynamicDatas: s,
      dynamicData: d,
      stateDatas: v,
      animateDatas: u,
      eventDatas: l,
      groupDatas: a,
      scene: f,
      environment: o,
      instancedNodes: i
    });
  }), {
    scene: f,
    nodes: r,
    dynamicDatas: s,
    groupDatas: a,
    instancedNodes: i,
    ...P
  };
};
function lSe(A, e) {
  const t = Xa(e);
  for (const r of t) {
    const {
      code: n,
      ctrlKey: i = !1,
      altKey: s = !1,
      shiftKey: a = !1,
      spaceKey: f = !1,
      keyDown: o = !0,
      onlyFirstTrigger: d = !1
    } = r;
    if (n === A.code && i === A.ctrlKey && s === A.altKey && a === A.shiftKey && f === A.spaceKey && o === A.keyDown && (!d || A.firstTrigger === d))
      return !0;
  }
  return !1;
}
function sIe(A) {
  for (const e in OC)
    if (lSe(A, OC[e].buttons))
      return { name: e, info: OC[e] };
}
function aIe(A, e) {
  OC[A] = e;
}
class PSe {
  constructor(e) {
    this.ctrlKey = !1, this.shiftKey = !1, this.altKey = !1, this.spaceKey = !1, this.keyDown = !1, this.mouseDown = !1, this.mouseButton = -1, this.dblclick = !1, this.moveNum = 0, this.code = "", this.firstTrigger = !1, this.offsetX = 0, this.offsetY = 0, this._mouseDownTime = 0, this._mouseDownQueue = [], this._isInCanvas = !1, this._isGizmoDragging = !1, this.getCode = (t) => {
      const { key: r } = t;
      return r === " " ? "space" : r.toLocaleLowerCase();
    }, this.setKeys = (t, r = !0) => {
      const n = this.getCode(t);
      this.firstTrigger = this.keyDown !== r || this.code !== n, this.code = n, this.ctrlKey = t.ctrlKey || t.metaKey, this.shiftKey = t.shiftKey, this.altKey = t.altKey, this.keyDown = r, this.code === "space" && (this.spaceKey = r);
    }, this.preventDefault = (t, r) => {
      const n = t.key.toLocaleLowerCase();
      (r || n === "alt") && t.preventDefault();
    }, this.onMouseDown = (t) => {
      var i;
      const r = this.root.getScene();
      if (!r)
        return;
      this.mouseButton = t.button, this.mouseDown = !0, this.moveNum = 0;
      const n = (/* @__PURE__ */ new Date()).getTime();
      if (this.dblclick = n - this._mouseDownTime <= 200, this._mouseDownTime = n, this.root.running) {
        let a = (i = r.pick().meshPickInfo) == null ? void 0 : i.pickedMesh;
        if (a) {
          const f = r.nodeManager.getRoot(a);
          for (; a; )
            this._mouseDownQueue.push(a), t.button === 0 && r.eventManager.executeTrigger("MouseDown", f, { target: a }), a.parent instanceof Hr ? a = a.parent : a = null;
        } else
          t.button === 0 && r.eventManager.executeTrigger(
            "MouseDown",
            r.scene,
            { target: r.scene }
          );
        return;
      }
      if (r.selectorManager.dragging) {
        this._isGizmoDragging = !0;
        return;
      }
      this.root.emit("mousedown", {
        interactManager: this,
        sceneManager: r,
        event: t
      });
    }, this.onMouseMove = (t) => {
      var s, a;
      this.moveNum++;
      const r = this.root.rootDOM.getBoundingClientRect(), n = t.target.getBoundingClientRect();
      this.offsetX = n.x - r.x + t.offsetX, this.offsetY = n.y - r.y + t.offsetY;
      const i = this.root.getScene();
      if (i) {
        if (this.root.running) {
          const f = i.pick(), o = ((s = this._pickInfo) == null ? void 0 : s.pickedMesh) || null, d = (a = f.meshPickInfo) == null ? void 0 : a.pickedMesh;
          if (this._pickInfo = f.meshPickInfo, o !== d) {
            const v = i.nodeManager.getRoot(o), u = i.nodeManager.getRoot(d), l = o ? [
              o,
              ...i.nodeManager.getParents(o)
            ] : [], P = d ? [
              d,
              ...i.nodeManager.getParents(d)
            ] : [], p = l.filter((H) => !P.includes(H)), c = P.filter((H) => !l.includes(H));
            p.forEach(
              (H) => i.eventManager.executeTrigger("MouseOut", v, { target: H })
            ), c.forEach(
              (H) => i.eventManager.executeTrigger("MouseIn", u, { target: H })
            );
          }
          return;
        }
        if (this.mouseDown && this.mouseButton === i.scene.cameraPanningMouseButton) {
          i.scene.showCameraTargetMesh();
          return;
        }
        this.root.emit("mousemove", {
          interactManager: this,
          sceneManager: i,
          event: t
        });
      }
    }, this.onMouseUp = (t) => {
      var i;
      const r = this.root.running, n = this.root.getScene();
      if (n) {
        if (r) {
          let a = (i = n.pick().meshPickInfo) == null ? void 0 : i.pickedMesh;
          if (a) {
            const f = n.nodeManager.getRoot(a);
            for (; a; )
              t.button === 0 && n.eventManager.executeTrigger("MouseUp", f, { target: a }), this._mouseDownQueue.includes(a) && (t.button === 0 ? (n.eventManager.executeTrigger("Click", f, { target: a }), this.dblclick && n.eventManager.executeTrigger("Dblclick", f, { target: a })) : t.button === 2 && n.eventManager.executeTrigger("RightClick", f, { target: a })), a.parent instanceof Hr ? a = a.parent : a = null;
          } else
            t.button === 0 ? (n.eventManager.executeTrigger(
              "MouseUp",
              n.scene,
              { target: n.scene }
            ), n.eventManager.executeTrigger(
              "Click",
              n.scene,
              { target: n.scene }
            ), this.dblclick && n.eventManager.executeTrigger(
              "Dblclick",
              n.scene,
              { target: n.scene }
            )) : t.button === 2 && n.eventManager.executeTrigger(
              "RightClick",
              n.scene,
              { target: n.scene }
            );
          this.dblclick = !1, this._mouseDownQueue = [];
          return;
        }
        t.button === n.scene.cameraPanningMouseButton && n.scene.hideCameraTargetMesh(), this._isGizmoDragging || ((t.button === 0 || t.button === 2) && this.root.emit("mouseup", {
          interactManager: this,
          sceneManager: n,
          event: t
        }), t.button === 0 && this.dblclick && this.root.emit("dblclick", {
          interactManager: this,
          sceneManager: n,
          event: t
        })), this._isGizmoDragging = !1, this.mouseDown = !1, this.mouseButton = -1;
      }
    }, this.onMouseEnter = (t) => {
      const r = this.root.getScene();
      r && (this.root.running || this.root.emit("mouseenter", {
        interactManager: this,
        sceneManager: r,
        event: t
      }));
    }, this.onMouseLeave = (t) => {
      const r = this.root.getScene();
      r && (this.root.running || this.root.emit("mouseleave", {
        interactManager: this,
        sceneManager: r,
        event: t
      }));
    }, this.onKeyDown = (t) => {
      const r = this.root.running;
      this.root.getScene() && this.setKeys(t);
    }, this.onKeyUp = (t) => {
      const r = this.root.running;
      this.root.getScene() && this.setKeys(t, !1);
    }, this.dispose = () => {
      this.root.rootDOM.removeEventListener("mousedown", this.onMouseDown), this.root.rootDOM.removeEventListener("mousemove", this.onMouseMove), this.root.rootDOM.removeEventListener("mouseup", this.onMouseUp), this.root.rootDOM.removeEventListener("mouseenter", this.onMouseEnter), this.root.rootDOM.removeEventListener("mouseleave", this.onMouseLeave), this.root.rootDOM.removeEventListener("keydown", this.onKeyDown), this.root.rootDOM.removeEventListener("keyup", this.onKeyUp);
    }, this.root = e, this.root.rootDOM.addEventListener("mousedown", this.onMouseDown), this.root.rootDOM.addEventListener("mousemove", this.onMouseMove), this.root.rootDOM.addEventListener("mouseup", this.onMouseUp), this.root.rootDOM.addEventListener("mouseenter", this.onMouseEnter), this.root.rootDOM.addEventListener("mouseleave", this.onMouseLeave), this.root.rootDOM.addEventListener("keydown", this.onKeyDown), this.root.rootDOM.addEventListener("keyup", this.onKeyUp);
  }
  get isInCanvas() {
    return this._isInCanvas;
  }
}
const cSe = (A) => [
  /* {
    title: "复制",
    disabled: () => !root.getScene()?.getSelectedNodes().length,
    suffix: "Ctrl+C",
    click: (item, root) => {
      const manager = root.getScene();
      const nodes = manager.getSelectedNodes();
      manager.copyNodes(nodes);
    },
  },
  {
    title: "粘贴",
    disabled: () => !root.getScene()?.hasCopiedNodes(),
    suffix: "Ctrl+V",
    click: (item, root) => {
      const manager = root.getScene();
      manager.pasteNodes();
    },
  },
  {
    divider: true,
  },
  {
    title: "撤销",
    disabled: () => !root.getScene()?.undoRedoManager.undoable(),
    suffix: "Ctrl+Z",
    click: (item, root) => {
      const manager = root.getScene();
      manager.undo();
    },
  },
  {
    title: "恢复",
    disabled: () => !root.getScene()?.undoRedoManager.redoable(),
    suffix: "Ctrl+Shift+Z",
    click: (item, root) => {
      const manager = root.getScene();
      manager.redo();
    },
  }, */
];
class oIe {
  constructor(e) {
    this.menus = [], this.show = (t) => {
      const r = document.createElement("div");
      this.container = r, r.className = "meta3d-contextmenu-container", r.oncontextmenu = (u) => u.preventDefault(), r.onmousedown = (u) => u.stopPropagation(), r.style.opacity = "0", this.menus.forEach((u) => {
        const {
          divider: l = !1,
          title: P = "",
          suffix: p = "",
          disabled: c = !1,
          click: H = () => {
          }
        } = u;
        let T;
        if (l)
          T = document.createElement("div"), T.className = "divider";
        else {
          const q = c instanceof Function ? c(this.root) : !!c;
          if (typeof P == "string") {
            T = document.createElement("div"), T.className = `${q ? "disabled" : ""}`;
            const b = document.createElement("div");
            if (b.className = "meta3d-contextmenu-item-text text-no-wrap", b.innerText = P, b.style.width = p ? "50%" : "100%", T.appendChild(b), p) {
              const j = document.createElement("div");
              j.className = "meta3d-contextmenu-item-suffix text-no-wrap", j.innerText = p, j.style.width = "50%", T.appendChild(j);
            }
          } else
            T = P;
          T.onclick = (b) => {
            b.button === 0 && !q && (this.hide(), H(u, this.root));
          };
        }
        T.className += " meta3d-contextmenu-item", r.appendChild(T);
      }), this.root.rootDOM.appendChild(r);
      const { clientX: n, clientY: i } = t, { clientHeight: s, clientWidth: a } = document.body, { width: f, height: o } = r.getBoundingClientRect();
      let d = n, v = i;
      n + f > a && (d = n - f), i + o > s && (v = i - o), r.style.left = d + "px", r.style.top = v + "px", r.style.height = "0px", r.style.transitionProperty = "height, opacity", r.style.transitionTimingFunction = "cubic-bezier(0.4, 0, 0.2, 1)", r.style.transitionDuration = "150ms", r.style.height = o + "px", r.style.opacity = "1", window.addEventListener("mousedown", this.hide);
    }, this.hide = () => {
      if (this.container) {
        const t = this.container;
        t.style.height = "0px", t.style.opacity = "0", setTimeout(() => {
          this.root.rootDOM.removeChild(t);
        }, 150), this.container = void 0;
      }
      window.removeEventListener("mousedown", this.hide);
    }, this.root = e, this.menus = cSe();
  }
}
class pSe {
  get bgImage() {
    return this._bgImage;
  }
  set bgImage(e) {
    this.containerDOM && (this.containerDOM.style.backgroundImage = `url(${e})`);
  }
  get status() {
    return this._status;
  }
  set status(e) {
    this._status = e, this.emit("changeStatus", e);
  }
  get value() {
    return this._value;
  }
  set value(e) {
    this._value = e, this._percentDOM && (this._percentDOM.innerHTML = Math.round(e) + "%"), this._barDOM && (this._barDOM.style.width = e + "%"), this.emit("changeValue", e);
  }
  constructor(e) {
    this.rootDOM = null, this.containerDOM = null, this.startValue = 0, this.endValue = 100, this.mode = 0, this._eventMap = /* @__PURE__ */ new Map(), this._percentDOM = null, this._barDOM = null, this._textDOM = null, this._incTimer = null, this._countToTimer = null, this._bgImage = hSe, this._status = -1, this._value = 0, this.show = () => {
      if (this.rootDOM) {
        if (this.rootDOM.style.position = "relative", !this.containerDOM) {
          const t = document.createElement("div"), r = document.createElement("div"), n = document.createElement("div"), i = document.createElement("div"), s = document.createElement("div"), a = document.createElement("div");
          t.style.width = "100%", t.style.height = "100%", t.style.position = "absolute", t.style.left = "0", t.style.top = "0", t.style.backgroundImage = `url(${this.bgImage})`, t.style.backgroundColor = "#000", t.style.backgroundPosition = "center", t.style.backgroundSize = "cover", t.style.backgroundRepeat = "no-repeat", t.style.userSelect = "none", t.style.zIndex = "10000", t.style.transitionProperty = "all", t.style.transitionTimingFunction = "linear", r.style.width = "100%", r.style.position = "absolute", r.style.left = "0", r.style.bottom = "10%", r.style.display = "flex", r.style.flexDirection = "column", r.style.justifyContent = "center", r.style.alignItems = "center", n.style.height = "48px", n.style.lineHeight = "48px", n.style.fontSize = "40px", n.style.fontFamily = "PangMenZhengDao, PangMenZhengDao-3", n.style.color = "rgba(255,255,255,0.85)", n.style.marginBottom = "36px", i.style.width = "50%", i.style.backgroundColor = "rgba(255, 255, 255, 0.08)", s.style.width = "0%", s.style.borderTop = "2px solid", s.style.borderBottom = "2px solid", s.style.borderImage = "linear-gradient(270deg, #91d5ff, #1890ff 100%) 4 4", s.style.boxShadow = "0px 0px 16px 0px #1890ff", a.style.height = "22px", a.style.lineHeight = "22px", a.style.fontSize = "14px", a.style.fontFamily = "PingFangSC, PingFangSC-Regular", a.style.fontWeight = "400", a.style.color = "rgba(255,255,255,0.65)", a.style.marginTop = "20px", t.appendChild(r), r.appendChild(n), r.appendChild(i), i.appendChild(s), r.appendChild(a), this.containerDOM = t, this._percentDOM = n, this._barDOM = s, this._textDOM = a;
        }
        this.rootDOM.contains(this.containerDOM) || this.rootDOM.appendChild(this.containerDOM), this.containerDOM.style.transitionDuration = "0", this.containerDOM.style.opacity = "1";
      }
    }, this.hide = (t = 500) => {
      setTimeout(() => {
        this.containerDOM && (this.containerDOM.style.transitionDuration = "150ms", this.containerDOM.style.opacity = "0"), setTimeout(() => {
          this.rootDOM && this.containerDOM && this.rootDOM.contains(this.containerDOM) && this.rootDOM.removeChild(this.containerDOM);
        }, 150);
      }, t);
    }, this.on = (t, r) => {
      const n = this._eventMap.get(t) || [];
      n.push(r), this._eventMap.set(t, n);
    }, this.off = (t, r) => {
      let n = this._eventMap.get(t);
      n && (n = r ? n.filter((i) => i !== r) : [], this._eventMap.set(t, n));
    }, this.emit = (t, r) => {
      const n = this._eventMap.get(t);
      n == null || n.forEach((i) => i(r));
    }, this.set = (t = {}) => {
      Object.keys(t).forEach((r) => {
        const n = r;
        this[n] = t[n];
      });
    }, this.start = (t) => {
      this.show(), this.value = this.startValue, this.status = 1, this.update(this.startValue, t), this.emit("start", this.value);
    }, this.update = (t, r, n = () => {
    }) => {
      t < this.startValue && (t = this.startValue), t > this.endValue && (t = this.endValue), this._textDOM && typeof r == "string" && (this._textDOM.innerHTML = r), this._incTimer && clearInterval(this._incTimer), this._countTo(t, () => {
        this.mode === 0 && this.status === 1 && this._inc(), n(), this.emit("update", this.value);
      });
    }, this.done = (t, r) => {
      this.status = 0, this.update(this.endValue, t, () => this.hide(r));
    }, this._inc = () => {
      this._incTimer && clearInterval(this._incTimer), this._incTimer = setInterval(() => {
        let t = 0;
        const r = this.startValue + 0.5 * this.endValue, n = this.startValue + 0.7 * this.endValue, i = this.startValue + 0.85 * this.endValue, s = this.startValue + 0.95 * this.endValue, a = this.startValue + 0.994 * this.endValue;
        this.value >= this.startValue && this.value < r ? t = this._random(5) : this.value >= r && this.value < n ? t = this._random(2) : this.value >= n && this.value < i ? t = this._random(1) : this.value >= i && this.value < s ? t = this._random(0.5) : this.value >= s && this.value < a && (t = this._random(0.1)), this._countTo(this.value + t);
      }, 500);
    }, this._countTo = (t, r = () => {
    }) => {
      this._countToTimer && clearInterval(this._countToTimer);
      const n = (t - this.value) / 10;
      let i = 0;
      const s = () => {
        this.value += n, i++, i >= 10 && (this._countToTimer && clearInterval(this._countToTimer), r());
      };
      this._countToTimer = setInterval(s, 15), s();
    }, this._random = (t, r = 0) => Math.random() * (t - r) + r, this.dispose = () => {
      this._eventMap.clear(), this.hide(), this._incTimer && clearInterval(this._incTimer), this._countToTimer && clearInterval(this._countToTimer);
    }, this.rootDOM = typeof e == "string" ? document.getElementById(e) : e;
  }
}
const hSe = "data:image/jpeg;base64,[encoded data, 75064 characters]";
class HSe {
  constructor(e) {
    this.cornerVisible = !1, this.setLoadingDIV = () => {
      this.loadingCornerDiv = document.createElement("div"), this.loadingCornerDiv.className = "meta3d-loading-div loading-div-corner-container", this.loadingCornerDiv.style.transitionDuration = "300ms", this.iconDiv = document.createElement("div"), this.iconDiv.className = "loading-icon", this.iconDiv.innerHTML = gSe, this.loadingCornerDiv.appendChild(this.iconDiv), this.loadingCornerDiv.style.display = "none", this.root.rootDOM.appendChild(this.loadingCornerDiv);
    }, this.show = () => {
      this.gp.show();
    }, this.hide = (t) => {
      this.gp.hide(t);
    }, this.start = (t) => {
      this.gp.start(t);
    }, this.update = (t, r) => {
      this.gp.update(t, r);
    }, this.done = (t, r) => {
      this.gp.done(t, r);
    }, this.showCorner = (t = "rightTop") => {
      this.loadingCornerDiv.className = `meta3d-loading-div loading-div-corner-container ${t}`, this.loadingCornerDiv.style.display = "block", this.cornerVisible = !0;
    }, this.hideCorner = () => {
      this.loadingCornerDiv.style.transitionDuration = "0.3s", this.loadingCornerDiv.style.opacity = "0", setTimeout(() => {
        this.loadingCornerDiv.style.display = "none", this.loadingCornerDiv.style.opacity = "1", this.cornerVisible = !1;
      }, 300);
    }, this.dispose = () => {
      this.root.rootDOM.removeChild(this.loadingCornerDiv), this.loadingCornerDiv = void 0, this.iconDiv = void 0, this.gp.dispose(), this.gp = void 0;
    }, this.root = e, this.setLoadingDIV(), this.gp = new pSe(e.rootDOM), this.gp.set({ startValue: 0, endValue: 100, mode: 1 });
  }
}
const gSe = '<svg t="1642659519421" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10313" width="100%" height="100%"><path d="M843.307 742.24c0 3.217 2.607 5.824 5.824 5.824s5.824-2.607 5.824-5.824c0 0 0 0 0 0 0-3.217-2.607-5.824-5.824-5.824-3.217 0-5.824 2.607-5.824 5.824 0 0 0 0 0 0zM714.731 874.912c0 0 0 0 0 0 0 6.398 5.186 11.584 11.584 11.584 6.398 0 11.584-5.186 11.584-11.584 0 0 0 0 0 0 0 0 0 0 0 0 0-6.398-5.186-11.584-11.584-11.584-6.398 0-11.584 5.186-11.584 11.584s0 0 0 0zM541.419 943.2c0 9.614 7.794 17.408 17.408 17.408s17.408-7.794 17.408-17.408c0-9.614-7.794-17.408-17.408-17.408-9.614 0-17.408 7.794-17.408 17.408zM354.859 934.048c0 0 0 0 0 0 0 12.795 10.373 23.168 23.168 23.168 12.795 0 23.168-10.373 23.168-23.168 0 0 0 0 0 0 0 0 0 0 0 0 0-12.795-10.373-23.168-23.168-23.168-12.795 0-23.168 10.373-23.168 23.168s0 0 0 0zM189.355 849.12c0 16.012 12.98 28.992 28.992 28.992s28.992-12.98 28.992-28.992c0 0 0 0 0 0 0-16.012-12.98-28.992-28.992-28.992-16.012 0-28.992 12.98-28.992 28.992 0 0 0 0 0 0zM74.731 704.736c0 19.228 15.588 34.816 34.816 34.816s34.816-15.588 34.816-34.816c0-19.228-15.588-34.816-34.816-34.816-19.228 0-34.816 15.588-34.816 34.816zM31.723 527.456c0 22.41 18.166 40.576 40.576 40.576s40.576-18.166 40.576-40.576c0-22.41-18.166-40.576-40.576-40.576-22.41 0-40.576 18.166-40.576 40.576zM67.115 351.328c0 25.626 20.774 46.4 46.4 46.4s46.4-20.774 46.4-46.4c0-25.626-20.774-46.4-46.4-46.4-25.626 0-46.4 20.774-46.4 46.4zM173.291 209.312c0 28.843 23.381 52.224 52.224 52.224s52.224-23.381 52.224-52.224c0 0 0 0 0 0 0-28.843-23.381-52.224-52.224-52.224-28.843 0-52.224 23.381-52.224 52.224 0 0 0 0 0 0zM329.195 127.968c0 32.024 25.96 57.984 57.984 57.984s57.984-25.96 57.984-57.984c0-32.024-25.96-57.984-57.984-57.984-32.024 0-57.984 25.96-57.984 57.984zM504.299 122.912c0 35.24 28.568 63.808 63.808 63.808s63.808-28.568 63.808-63.808c0 0 0 0 0 0 0-35.24-28.568-63.808-63.808-63.808-35.24 0-63.808 28.568-63.808 63.808 0 0 0 0 0 0zM664.619 195.04c0 38.421 31.147 69.568 69.568 69.568s69.568-31.147 69.568-69.568c0-38.421-31.147-69.568-69.568-69.568-38.421 0-69.568 31.147-69.568 69.568zM778.539 330.528c0 41.638 33.754 75.392 75.392 75.392s75.392-33.754 75.392-75.392c0-41.638-33.754-75.392-75.392-75.392-41.638 0-75.392 33.754-75.392 75.392zM823.851 506.016c0 44.854 36.362 81.216 81.216 81.216s81.216-36.362 81.216-81.216c0-44.854-36.362-81.216-81.216-81.216-44.854 0-81.216 36.362-81.216 81.216z" p-id="10314"></path></svg>';
function XSe() {
  return {
    selectorType: "position",
    positionStep: 1,
    positionStepEnabled: !1,
    rotationStep: 2,
    rotationStepEnabled: !1,
    scalingStep: 0.5,
    scalingStepEnabled: !1,
    guidabled: !0,
    guideLinabled: !0,
    pivotPointVisible: !1,
    brushInstanced: !1,
    brushScale: !1,
    brushMinScaling: 0.5,
    brushMaxScaling: 1.5,
    brushScaleLimit: "xyz",
    brushRotate: !1,
    brushMinRotation: -360,
    brushMaxRotation: 360,
    brushRotateLimit: "y",
    pollingInterval: 1,
    pivotPointPlacement: $2.CX_NY_CZ,
    operateMode: 1,
    domVisible: !0,
    compassVisible: !1
  };
}
const TSe = "data:image/png;base64,[encoded data, 30228 characters]", qSe = "data:image/png;base64,[encoded data, 10980 characters]", yW = /* @__PURE__ */ new Map(), bSe = (A) => {
  const [e, t] = F0.useState({
    width: "200px",
    height: "200px",
    // backgroundColor: `rgba(00, 31, 44, 1)`,
    display: "flex",
    backgroundImage: `url(${TSe})`,
    backgroundSize: "cover",
    backgroundRepeat: "no-repeat",
    textAlign: "center",
    position: "relative"
  }), [r, n] = F0.useState({
    // position:"absolute",
    width: "20px",
    height: "20px",
    textAlign: "center"
  }), i = {
    width: "200px",
    height: "200px",
    backgroundImage: `url(${qSe})`,
    backgroundSize: "cover",
    backgroundRepeat: "no-repeat",
    backgroundPosition: "center",
    position: "absolute",
    top: "0%",
    left: "0%"
  }, s = {
    width: "20px",
    height: "20px",
    position: "absolute",
    top: "10%",
    left: "50%",
    transform: "translateX(-50%)"
  }, a = {
    width: "20px",
    height: "20px",
    position: "absolute",
    bottom: "10%",
    left: "50%",
    transform: "translateX(-50%)"
  }, f = {
    width: "20px",
    height: "20px",
    position: "absolute",
    top: "50%",
    right: "10%",
    transform: "translateY(-50%)"
  }, o = {
    width: "20px",
    height: "20px",
    position: "absolute",
    top: "50%",
    left: "10%",
    transform: "translateY(-50%)"
  }, d = {
    width: "20px",
    height: "20px",
    lineHeight: "30px",
    position: "absolute",
    top: "10%",
    left: "70.6%",
    transform: "translateX(-50%)"
  }, v = {
    width: "20px",
    height: "20px",
    position: "absolute",
    top: "32.6%",
    right: "13.6%",
    transform: "translateY(-50%)"
  }, u = {
    width: "20px",
    height: "20px",
    lineHeight: "30px",
    position: "absolute",
    top: "63%",
    right: "6%",
    transform: "translateX(-50%)"
  }, l = {
    width: "20px",
    height: "20px",
    position: "absolute",
    bottom: "10%",
    right: "25%",
    transform: "translateY(-50%)"
  }, P = {
    width: "20px",
    height: "20px",
    position: "absolute",
    bottom: "9%",
    right: "62.5%",
    transform: "translateY(-50%)"
  }, p = {
    width: "20px",
    height: "20px",
    position: "absolute",
    bottom: "22.5%",
    right: "74.5%",
    transform: "translateY(-50%)"
  }, c = {
    width: "20px",
    height: "20px",
    lineHeight: "30px",
    position: "absolute",
    top: "12%",
    right: "59.6%",
    transform: "translateX(-50%)"
  }, H = {
    width: "20px",
    height: "20px",
    position: "absolute",
    top: "32.6%",
    left: "13.6%",
    transform: "translateY(-50%)"
  };
  return F0.useEffect(() => {
    const T = A.meta3d.getScene().scene.activeCamera;
    if (T instanceof ps) {
      let b = Math.floor(ye.ToDegrees(T.alpha));
      t(Object.assign({}, e, { transform: `rotate(${b - 90}deg)` })), n(Object.assign({}, r, { transform: `rotate(${90 - b}deg)` }));
    }
    A.meta3d.engine.scenes.forEach((b) => {
      const j = b.activeCamera;
      if (j instanceof ps) {
        let w = j.onViewMatrixChangedObservable.add(() => {
          let m = Math.floor(ye.ToDegrees(j.alpha));
          t(Object.assign({}, e, { transform: `rotate(${m - 90}deg)` })), n(Object.assign({}, r, { transform: `rotate(${90 - m}deg)` }));
        });
        yW.set(b, w);
      }
    });
    let q = A.meta3d.engine.onNewSceneAddedObservable.add((b) => {
      let j = b.onNewCameraAddedObservable.add((w) => {
        if (w instanceof ps) {
          let m = w.onViewMatrixChangedObservable.add(() => {
            let I = Math.floor(ye.ToDegrees(w.alpha));
            t(Object.assign({}, e, { transform: `rotate(${I - 90}deg)` })), n(Object.assign({}, r, { transform: `rotate(${90 - I}deg)` }));
          });
          yW.set(b, m);
        }
      });
      b.onDispose = () => {
        b.onNewCameraAddedObservable.remove(j);
        let w = yW.get(b);
        w && (b.activeCamera.onViewMatrixChangedObservable.remove(w), yW.delete(b));
      };
    });
    return yW.set(A.meta3d.engine, q), () => {
      yW.forEach((b, j) => {
        var w;
        console.log(j), j instanceof sr ? (w = j.activeCamera) == null || w.onViewMatrixChangedObservable.remove(b) : A.meta3d.engine.onNewSceneAddedObservable.remove(b);
      });
    };
  }, []), /* @__PURE__ */ mi.jsxs("div", { children: [
    /* @__PURE__ */ mi.jsxs("div", { style: e, children: [
      /* @__PURE__ */ mi.jsx("div", { style: s, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "北" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: a, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "南" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: f, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "东" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: o, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "西" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: d, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "30" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: v, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "60" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: v, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "60" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: u, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "120" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: l, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "150" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: H, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "300" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: c, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "330" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: P, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "210" }) }),
      /* @__PURE__ */ mi.jsx("div", { style: p, children: /* @__PURE__ */ mi.jsx("div", { style: r, children: "240" }) })
    ] }),
    /* @__PURE__ */ mi.jsx("div", { style: i })
  ] });
};
class xSe {
  constructor(e) {
    this._option = {
      circular: 0.1
    }, this.initRoot = (r) => {
      let n = document.createElement("div");
      return n.id = "directionUI", n.style.position = "absolute", n.style.top = "0%", n.style.right = "0%", n.style.width = "200px", n.style.height = "200px", n.style.borderRadius = "50%", n.style.pointerEvents = "none", n.style.backgroundColor = "rgba(30, 36, 48, 0.5)", this._rootDiv = n, r.parentElement.appendChild(n), n.style.zIndex = "500", LW.createRoot(n);
    }, this.directionUI = () => /* @__PURE__ */ mi.jsx("div", { children: /* @__PURE__ */ mi.jsx(
      bSe,
      {
        meta3d: this.meta3d
      }
    ) }), this.dispose = () => {
      var r, n;
      console.log(" direction dispose"), (r = this.root) == null || r.unmount(), (n = this._parent) == null || n.parentElement.removeChild(this._rootDiv), this._parent = void 0, this._rootDiv = void 0, this.root = void 0;
    }, this.createCameraOb = (r) => r.onViewMatrixChangedObservable.add(() => {
    }), this.meta3d = e, this._parent = e.canvas.parentElement, this.root = this.initRoot(this._parent);
    let t = this.directionUI();
    console.log(t), this.root.render(t);
  }
}
class fIe {
  constructor(e) {
    this.id = Zn(), this.sceneManagersMap = /* @__PURE__ */ new Map(), this.isWebGPU = !1, this.emitter = r2e(), this.options = XSe(), this._running = !0, this._showRuler = !1, this.init = async () => {
      if (this.isWebGPU = !1, this.isWebGPU) {
        const r = new wn(this.canvas);
        await r.initAsync(), this.engine = r;
      } else
        this.engine = new Ge(this.canvas, !0, {
          stencil: !0,
          preserveDrawingBuffer: !0,
          useHighPrecisionMatrix: !0,
          useHighPrecisionFloats: !0
        });
      let t = 1;
      window.devicePixelRatio > 1 && (t = 0.5), this.engine.setHardwareScalingLevel(t), this.interactManager = new PSe(this), this.loadingScreen = new HSe(this), window && (window.addEventListener("resize", this.fitView), window.addEventListener("message", this._onMessage));
    }, this.on = (t, r) => {
      this.emitter.on(t, r);
    }, this.off = (t, r) => {
      this.emitter.off(t, r);
    }, this.emit = (t, r) => {
      this.emitter.emit(t, r);
    }, this.data = () => {
      const t = this.getAllScenes().map(
        (n) => n.data()
      );
      return {
        options: this.getOptions(),
        scenes: t,
        activeSceneId: this.activeSceneId
      };
    }, this.crypto = (t) => pDe(t), this.decrypto = (t) => hO(t), this.setOptions = (t) => {
      const r = {};
      Object.keys(t).forEach((i) => {
        const s = t[i], a = this.options[i];
        s !== a && (r[i] = s, this.options[i] = s);
      });
      const n = Object.keys(r);
      this.emit("setOptions", t), n.forEach((i) => {
        const s = r[i];
        switch (i) {
          case "selectorType":
            this.getAllScenes().forEach((f) => {
              f.selectorManager.type = s;
            });
            break;
          case "operateMode":
            this.getAllScenes().forEach((f) => {
              s === 2 ? f.scene.cameraPanningMouseButton = 0 : f.scene.cameraPanningMouseButton = 2;
            });
            break;
          case "domVisible":
            const a = this.getScene();
            a && (a.DOMManager.visible = s);
            break;
          case "compassVisible":
            this.showRuler = s;
            break;
        }
      });
    }, this.getOptions = () => ({ ...this.options }), this.open = (t = {}) => new Promise((r, n) => {
      fq(
        async () => {
          const {
            data: i = {},
            placeholder: s = !0,
            running: a = !0,
            onProgress: f = () => {
            },
            onEnd: o = () => {
            }
          } = t;
          f("beforeOpen", void 0), [...this.sceneManagersMap.keys()].forEach((H) => {
            this.removeScene(H);
          }), this.stopRender(), this.sceneManagersMap = /* @__PURE__ */ new Map();
          const d = typeof i == "string" ? JSON.parse(i.startsWith("{") ? i : hO(i)) : i, { options: v = {}, scenes: u = [{}], activeSceneId: l } = d;
          let P = a ? 0 : u.findIndex(
            (H) => l && H.id === l
          );
          P === -1 && (P = 0), this.setOptions({ ...this.options, ...v });
          let p = 0;
          for (let H = 0; H < u.length; H++) {
            const T = u[H];
            f("beforeLoadScene", {
              index: H,
              data: T,
              total: u.length
            }), this.addScene({
              data: T,
              placeholder: s,
              onEnd: ({ loaded: q, total: b, manager: j }) => {
                var w;
                p++, f("afterLoadScene", {
                  index: H,
                  data: T,
                  total: u.length,
                  totalNodes: b,
                  loadedNodes: q,
                  manager: j
                }), p === u.length && (f("afterOpen", void 0), o(), this.emit("open", this), this.startRender(), this.switchScene((w = this.getAllScenes()[P]) == null ? void 0 : w.id));
              },
              onProgress: ({ index: q, total: b, data: j, node: w, manager: m }) => {
                f("loadingScene", {
                  index: H,
                  data: T,
                  total: u.length,
                  totalNodes: b,
                  currentNode: q,
                  nodeData: j,
                  node: w,
                  manager: m
                });
              }
            });
          }
          this.running = a;
          const c = this.getAllScenes();
          this.engine.runRenderLoop(() => {
            var H;
            (H = c[P]) == null || H.scene.scene.render();
          }), r(this);
        },
        (i) => {
          n(i);
        }
      );
    }), this.addScene = (t = {}) => {
      const r = new pR(this, t);
      return this.sceneManagersMap.set(r.id, r), this.emit("addScene", r), r;
    }, this.getScene = (t) => this.sceneManagersMap.get(t || this.activeSceneId), this.removeScene = (t) => {
      const r = this.getScene(t);
      if (r) {
        const n = r.id;
        this.sceneManagersMap.delete(n), n === this.activeSceneId && (this.activeSceneId = void 0), r.dispose(), this.emit("removeScene", r);
      }
    }, this.switchScene = (t) => {
      if (!t)
        return;
      const r = this.getScene();
      r && (r.scene.cameraAttached = !1, r.networkManager.cancelAll(), r.animateManager.stopAll(), r.DOMManager.hide()), this.activeSceneId = t;
      const n = this.getScene();
      n && (n.scene.cameraAttached = !0, this.emit("switchScene", {
        prevSceneManager: r,
        sceneManager: n
      }), n.eventManager.executeTrigger(
        "AfterSwitchScene",
        null,
        void 0
      ), this.running && ([
        n.scene,
        ...n.getRootNodes().map((i) => i.node)
      ].forEach((i) => {
        var o;
        if (!n.getMetadata(i))
          return;
        const s = n.getMetadata(i);
        (o = s.states) == null || o.forEach((d) => {
          d.dataId || n.stateDataManager.updateState(i, d.id);
        });
        const a = s.animations || [], f = s.groupAnimations || [];
        n.animateManager.begin(
          i,
          a.filter((d) => d.autoPlay).map((d) => d.id)
        ), n.animateManager.beginGroup(
          i,
          f.filter((d) => d.autoPlay).map((d) => d.id)
        );
      }), n.networkManager.subscribe()), n.DOMManager.visible = this.options.domVisible);
    }, this.getAllScenes = () => Array.from(this.sceneManagersMap.values()), this.startLoading = (t) => {
      this.loadingScreen.start(t);
    }, this.updateLoading = (t, r) => {
      this.loadingScreen.update(t, r);
    }, this.doneLoading = (t, r) => {
      this.loadingScreen.done(t, r);
    }, this.download = (t = "Meta3D") => {
      t += ".l3d";
      const r = this.crypto(JSON.stringify(this.data())), n = new Blob([r], { type: "octet/stream" }), i = (window.webkitURL || window.URL).createObjectURL(n), s = window.document.createElement("a");
      s.href = i, s.download = t;
      const a = document.createEvent("MouseEvents");
      a.initEvent("click", !0, !1), s.dispatchEvent(a);
    }, this.deploy = (t) => {
      const r = this.data(), { scenes: n } = r, i = /* @__PURE__ */ new Map(), s = u$(t, "files"), a = (o) => {
        const d = (v) => {
          if (i.has(v))
            return i.get(v);
          if (typeof v == "string" && ["http", "https", "/"].some((u) => v.startsWith(u))) {
            let { host: u, path: l } = ZBe(v);
            u = u || "assets";
            const P = "/" + u + l, p = s + P;
            return i.set(v, p), p;
          }
          return v;
        };
        if (o.startsWith("data:")) {
          const v = o.substring(5), [u, ...l] = v.split("#").reverse();
          return o = l.reverse().join("#"), "data:" + d(o) + "#" + u;
        }
        return d(o);
      }, f = (o, d, v) => {
        var l;
        if (o.__glbUUID && d && v) {
          const P = d[o.__glbUUID], p = v[o.__glbUUID];
          if (p) {
            const { url: c, name: H } = p;
            P.url = _Be(a(c + H));
          }
        }
        const u = [
          "url",
          "imageSource",
          "skyboxUrl",
          "hdrUrl",
          "colorGradingTexture"
        ];
        for (const P of u) {
          if (!(P in o))
            continue;
          const p = o[P] || "";
          o[P] = a(p);
        }
        if ((l = o.images) != null && l.length)
          for (const P of o.images) {
            const { source: p } = P;
            P.source = a(p);
          }
      };
      for (const o of n) {
        if (!o)
          continue;
        const { nodes: d = [], scene: v = {}, glbMap: u = {}, textures: l = {} } = o, P = M9(u);
        for (const p of [
          v,
          ...d,
          ...Object.keys(l).map((c) => l[c])
        ])
          f(p, u, P);
      }
      return {
        resources: [...i].map(([o, d]) => ({ url: o, path: d })),
        data: this.crypto(JSON.stringify(r))
      };
    }, this.startRender = () => {
      var t;
      (t = this.engine) == null || t.runRenderLoop(this._render), this.getAllScenes().forEach((r) => {
        r.scene.weatherStart();
      });
    }, this.stopRender = () => {
      var t;
      this.getAllScenes().forEach((r) => {
        r.scene.weatherStop();
      }), (t = this.engine) == null || t.stopRenderLoop();
    }, this.getFps = () => {
      var t;
      return (t = this.engine) == null ? void 0 : t.getFps();
    }, this.openNodeMaterialEditor = (t) => {
      if (!(t instanceof ja))
        return !1;
      Fqe(t);
    }, this.fitView = () => {
      var t;
      (t = this.engine) == null || t.resize(), setTimeout(() => {
        const r = this.getScene();
        r == null || r.DOMManager.render();
      }, 0);
    }, this.receiveWindowMessage = (t) => {
      const r = this.getScene();
      r && r.eventManager.executeTrigger(
        "AfterReceivingWindowMessage",
        null,
        { name: t }
      );
    }, this.focus = () => {
      var t;
      (t = this.canvas) == null || t.focus();
    }, this.screenshot = (t, r = () => {
    }) => {
      const n = this.getScene();
      n && ye.CreateScreenshot(
        this.engine,
        n.scene.activeCamera,
        t,
        r
      );
    }, this.encode = (t) => $fe.EnCode(t), this.dispose = () => {
      var t, r, n, i, s, a, f;
      (t = this.loadingScreen) == null || t.dispose(), (r = this.interactManager) == null || r.dispose(), (n = this.sceneManagersMap) == null || n.forEach((o) => o.dispose()), (i = this.engine) == null || i.stopRenderLoop(), (s = this.engine) == null || s.dispose(), (a = this.engine._gl.getExtension("WEBGL_lose_context")) == null || a.loseContext(), this.rootDOM && (this.rootDOM.innerHTML = null), window == null || window.removeEventListener("resize", this.fitView), window == null || window.removeEventListener("message", this._onMessage), (f = this.emitter) == null || f.all.clear();
    }, this._render = () => {
      var t;
      (t = this.getScene()) == null || t.scene.scene.render();
    }, this._onMessage = (t) => {
      t.data && fq(() => {
        const r = typeof t.data == "string" && t.data.startsWith("{") ? JSON.parse(t.data) : t.data;
        if (r instanceof Object) {
          const { name: n, type: i = 0, path: s } = r;
          if (i === 1) {
            if (n === "deploy") {
              const a = this.deploy("/view/projects/assets");
              window.parent !== window && window.parent && window.parent.postMessage(
                JSON.stringify({
                  name: "download",
                  type: 1,
                  data: [
                    ...a.resources,
                    { path: `/view/projects/${s}`, data: a.data }
                  ]
                }),
                "*"
              );
            } else if (n === "toVue3" || n === "toVue2" || n === "toReact") {
              const a = "/meta3d/", f = this.deploy(a);
              window.parent !== window && window.parent && window.parent.postMessage(
                JSON.stringify({
                  name: "download",
                  type: 1,
                  data: [
                    ...f.resources,
                    {
                      path: u$(
                        a,
                        `/data${s ? `-${s}` : ""}`
                      ),
                      data: f.data
                    }
                  ]
                }),
                "*"
              );
            }
          } else
            this.receiveWindowMessage(n);
        }
      });
    }, Yd.Configuration.decoder.fallbackUrl = zge, Yd.Configuration.decoder.wasmBinaryUrl = Gge, Yd.Configuration.decoder.wasmUrl = Zge, Hn.ShowLoadingScreen = !1, aD.DO_NOT_ALTER_FILE_COORDINATES = !0, this.rootDOM = NBe(e), this.rootDOM.style.position = "relative", this.rootDOM.style.overflow = "hidden", this.canvas = document.createElement("canvas"), this.canvas.style.width = "100%", this.canvas.style.height = "100%", this.canvas.style.outline = "0px solid transparent", this.canvas.style.outlineOffset = "0px", this.rootDOM.appendChild(this.canvas);
  }
  get running() {
    return this._running;
  }
  set running(e) {
    this._running = e;
    let t = 0;
    const r = () => {
      t === this.sceneManagersMap.size && (this.emit("running", e), this.switchScene(this.activeSceneId));
    };
    this.sceneManagersMap.forEach((n) => {
      e ? (n.startRunning(), t++, r()) : n.stopRunning(() => {
        t++, r();
      });
    });
  }
  set showRuler(e) {
    var t;
    this._showRuler = e, e ? this.rulerUI || (this.rulerUI = new xSe(this)) : ((t = this.rulerUI) == null || t.dispose(), this.rulerUI = void 0);
  }
  get showRuler() {
    return this._showRuler;
  }
}
class AIe {
  constructor(e) {
    this.dispose = () => {
    }, this.root = e;
  }
}
var DSe = /* @__PURE__ */ ((A) => (A.Default = "Default", A.VolumetricLightScatteringPostProcess = "VolumetricLightScatteringPostProcess", A))(DSe || {});
const dIe = (A, e) => {
  var t = new K9(A, !0, e, e.cameras), r = new so();
  return r.globalHue = 200, r.globalDensity = 80, r.globalSaturation = 80, r.highlightsHue = 20, r.highlightsDensity = 80, r.highlightsSaturation = -80, r.shadowsHue = 2, r.shadowsDensity = 80, r.shadowsSaturation = 40, t.imageProcessing.colorCurves = r, t.depthOfField.focalLength = 150, t;
};
export {
  ISe as ACTIVE_MESH_ID,
  BSe as ALIGN_LINE_ID,
  Z1e as ARC_ROTATE_CAMERA_ID,
  iM as AUXILIARYMESH_PREFIX,
  _Ue as AbstractAction,
  Ml as AbstractActionManager,
  pg as AbstractAssetTask,
  jn as AbstractMesh,
  J1 as AbstractScene,
  iIe as AbstractTrigger,
  Hte as AcquireNativeObjectAsync,
  wa as Action,
  nWe as ActionAnimationBegin,
  iWe as ActionAnimationPause,
  sWe as ActionAnimationRestart,
  aWe as ActionAnimationStop,
  oWe as ActionCameraAutoRotateBegin,
  fWe as ActionCameraAutoRotateStop,
  AWe as ActionCameraMove,
  dWe as ActionDehighlight,
  mo as ActionEvent,
  vWe as ActionHighlight,
  uWe as ActionJumpLink,
  Rs as ActionManager,
  lWe as ActionNetworkCancel,
  PWe as ActionNetworkRequest,
  cWe as ActionRunCustomFn,
  pWe as ActionRunGlobalFn,
  hWe as ActionSendWindowMessage,
  HWe as ActionSetCameraValue,
  gWe as ActionSetDynamicData,
  XWe as ActionSetValue,
  TWe as ActionShowCameraView,
  qWe as ActionSoundPause,
  bWe as ActionSoundPlay,
  xWe as ActionSoundStop,
  DWe as ActionSwitchCamera,
  jWe as ActionSwitchScene,
  Go as Actioner,
  qre as AddBlock,
  zw as AddressMode,
  Eme as AdtType,
  kte as AdvancedTimer,
  Une as AlignBlock,
  k$ as AlphaState,
  eg as AmmoJSPlugin,
  Uee as AnaglyphArcRotateCamera,
  Iee as AnaglyphFreeCamera,
  Ree as AnaglyphGamepadCamera,
  HQ as AnaglyphPostProcess,
  Vee as AnaglyphUniversalCamera,
  H6e as Analyser,
  Mx as AndOrNotEvaluator,
  JH as Angle,
  ZN as Animatable,
  qM as AnimateEndStatus,
  wN as AnimateManager,
  LSe as AnimatedGifTexture,
  tq as AnimatedInputBlockTypes,
  st as Animation,
  sge as AnimationAssetTask,
  wO as AnimationEvent,
  w0 as AnimationGroup,
  d6e as AnimationGroupMask,
  EI as AnimationGroupMaskMode,
  CI as AnimationKeyInterpolation,
  t6e as AnimationPropertiesOverride,
  Am as AnimationRange,
  fV as AnisotropyBlock,
  ty as ApplyPostProcess,
  G$ as Arc2,
  wee as ArcFollowCamera,
  ps as ArcRotateCamera,
  VR as ArcRotateCameraGamepadInput,
  CO as ArcRotateCameraInputsManager,
  M0 as ArcRotateCameraKeyboardMoveInput,
  AU as ArcRotateCameraMouseWheelInput,
  ku as ArcRotateCameraPointersInput,
  lQ as ArcRotateCameraVRDeviceOrientationInput,
  Nre as ArcTan2Block,
  xR as AssetContainer,
  Y2 as AssetTaskState,
  age as AssetsManager,
  pie as AssetsProgressEvent,
  up as AsyncLoop,
  T6e as AttachToBoxBehavior,
  vee as AudioEngine,
  yu as AudioSceneComponent,
  SS as AutoLayoutMode,
  lU as AutoReleaseWorkerPool,
  hee as AutoRotationBehavior,
  aq as AxesViewer,
  bf as Axis,
  lp as AxisDragGizmo,
  Pp as AxisScaleGizmo,
  DUe as BJSlonlat2Vector3,
  WSe as BOUNDINGMESH_ID,
  bPe as BRDFTextureTools,
  SI as BabylonFileLoaderConfiguration,
  _$ as BackEase,
  Vi as BackgroundMaterial,
  mm as BakedVertexAnimationManager,
  $he as BallAndSocketConstraint,
  IR as BaseCameraMouseWheelInput,
  VO as BaseCameraPointersInput,
  dm as BaseError,
  N0 as BaseParticleSystem,
  C2 as BaseSixDofDragBehavior,
  ls as BaseTexture,
  py as BasisTools,
  qq as BasisToolsOptions,
  Npe as BasisTranscodeConfiguration,
  z$ as BezierCurve,
  f6e as BezierCurveEase,
  one as BiPlanarBlock,
  Xie as BinaryFileAssetTask,
  AV as BlackAndWhitePostProcess,
  ad as BlendFactor,
  Z8 as BlendOperation,
  DF as BloomEffect,
  Wy as BloomMergePostProcess,
  c9 as BlurPostProcess,
  da as Bone,
  Bve as BoneAxesViewer,
  hc as BoneIKController,
  wA as BoneLookController,
  nre as BonesBlock,
  Dy as BooleanGeometryBlock,
  ZH as BooleanGeometryOperations,
  r6e as BounceEase,
  fD as BouncingBehavior,
  Qne as BoundingBlock,
  cp as BoundingBox,
  zQ as BoundingBoxGizmo,
  sie as BoundingBoxRenderer,
  Md as BoundingInfo,
  rg as BoundingSphere,
  Xy as BoxBlock,
  Wve as BoxBuilder,
  AD as BoxParticleEmitter,
  P9 as Buffer,
  dq as BufferBindingType,
  aF as BufferMapState,
  ga as BufferUsage,
  a2e as CAMERA_AUXILIARYMESH_ID,
  _1e as CAMERA_TARGET_MESH_ID,
  C1e as CLOUDY_ENV,
  F1e as CLOUDY_JPG,
  YH as CSG,
  Tr as Camera,
  rS as CameraGizmo,
  VA as CameraInputTypes,
  RR as CameraInputsManager,
  JSe as CameraManager,
  sO as CannonJSPlugin,
  JI as CanvasAlphaMode,
  gY as CapsuleBlock,
  Uve as CapsuleBuilder,
  X6 as CascadedShadowGenerator,
  Pg as ChromaticAberrationPostProcess,
  Z$ as CircleEase,
  Om as CircleOfConfusionPostProcess,
  NW as CityMaterial,
  Hy as ClampBlock,
  Xm as ClearCoatBlock,
  Hre as ClipPlanesBlock,
  qp as ClipboardEventTypes,
  wC as ClipboardInfo,
  oY as CloudBlock,
  Zne as CloudPoint,
  LR as Collider,
  Ne as Color3,
  Jne as Color3Gradient,
  xt as Color4,
  dV as ColorCorrectionPostProcess,
  so as ColorCurves,
  yY as ColorGradient,
  PD as ColorGradingTexture,
  mre as ColorMergerBlock,
  vQ as ColorSplitterBlock,
  dF as ColorWrite,
  j$ as CombineAction,
  q6 as CompareFunction,
  us as CompatibilityOptions,
  fF as CompilationMessageType,
  gne as CompleteGreasedLineColorTable,
  Hne as CompleteGreasedLineWidthTable,
  Xwe as Component,
  io as ComputeBindingType,
  Pm as ComputeEffect,
  Dne as ComputeNormalsBlock,
  vF as ComputePassTimestampLocation,
  vU as ComputeShader,
  Kne as ComputeShaderParticleSystem,
  DS as Condition,
  jY as ConditionBlock,
  y9 as ConditionBlockTests,
  ine as ConditionalBlock,
  lc as ConditionalBlockConditions,
  wR as ConeParticleEmitter,
  et as Constants,
  qwe as Container,
  hie as ContainerAssetTask,
  oIe as ContextMenu,
  Fme as ControlType,
  dO as ConversionMode,
  cg as ConvolutionPostProcess,
  Lx as Coordinate,
  lie as CopyTextureToTexture,
  g6e as CopyTools,
  k0 as CreateBox,
  LO as CreateBoxVertexData,
  KR as CreateCapsule,
  JO as CreateCapsuleVertexData,
  Ld as CreateCylinder,
  MO as CreateCylinderVertexData,
  ZO as CreateDashedLines,
  IQ as CreateDashedLinesVertexData,
  ey as CreateDecal,
  uU as CreateDisc,
  zO as CreateDiscVertexData,
  cte as CreateEnvTextureAsync,
  rte as CreateGeodesic,
  ite as CreateGoldberg,
  nte as CreateGoldbergVertexData,
  mhe as CreateGreasedLine,
  hne as CreateGreasedLineMaterial,
  Wm as CreateGround,
  NO as CreateGroundFromHeightMap,
  xQ as CreateGroundFromHeightMapVertexData,
  y2 as CreateGroundVertexData,
  zI as CreateHemisphere,
  UR as CreateIcoSphere,
  RO as CreateIcoSphereVertexData,
  ny as CreateImageDataArrayBufferViews,
  _O as CreateLathe,
  rm as CreateLineSystem,
  UQ as CreateLineSystemVertexData,
  ka as CreateLines,
  u4 as CreatePlane,
  UO as CreatePlaneVertexData,
  JR as CreatePolygon,
  RQ as CreatePolygonVertexData,
  hm as CreatePolyhedron,
  VQ as CreatePolyhedronVertexData,
  ute as CreateResizedCopy,
  n4 as CreateRibbon,
  jQ as CreateRibbonVertexData,
  PV as CreateScreenshot,
  ZY as CreateScreenshotAsync,
  cV as CreateScreenshotUsingRenderTarget,
  _Y as CreateScreenshotUsingRenderTargetAsync,
  mie as CreateScreenshotWithResizeAsync,
  $ee as CreateSegmentedBoxVertexData,
  UA as CreateSphere,
  KO as CreateSphereVertexData,
  ste as CreateText,
  OQ as CreateTextShapePaths,
  BQ as CreateTiledBox,
  mQ as CreateTiledBoxVertexData,
  FO as CreateTiledGround,
  bQ as CreateTiledGroundVertexData,
  wQ as CreateTiledPlane,
  $W as CreateTiledPlaneVertexData,
  Ag as CreateTorus,
  GO as CreateTorusKnot,
  WQ as CreateTorusKnotVertexData,
  QO as CreateTorusVertexData,
  $O as CreateTube,
  xre as CrossBlock,
  Sm as CubeMapToSphericalPolynomialTools,
  v1 as CubeTexture,
  bie as CubeTextureAssetTask,
  n6e as CubicEase,
  eS as CullMode,
  oQ as CurrentScreenBlock,
  j0 as Curve3,
  dne as CurveBlock,
  no as CurveBlockTypes,
  Dre as CustomBlock,
  jie as CustomOptimization,
  dD as CustomParticleEmitter,
  rre as CustomProceduralTexture,
  HY as CylinderBlock,
  mve as CylinderBuilder,
  mR as CylinderDirectedParticleEmitter,
  aU as CylinderParticleEmitter,
  Aa as DDSTools,
  O1e as DEFAULT_ENV,
  wSe as DEFAULT_HDR_PNG,
  u9e as DOMComponentType,
  hwe as DOMManager,
  pwe as DOMType,
  zge as DRACO_DECODER_GLTF_JS,
  Gge as DRACO_DECODER_GLTF_WASM,
  Zge as DRACO_WASM_WRAPPER_GLTF_JS,
  y1e as DUSK_ENV,
  N1e as DUSK_JPG,
  tg as DataBuffer,
  gI as DataReader,
  UF as DataStorage,
  Mo as DataType,
  Cv as Database,
  yne as DebugBlock,
  pm as DebugLayer,
  rF as DebugLayerTab,
  rue as DecalBuilder,
  cU as DecalMapConfiguration,
  vne as DecalMapDefines,
  QN as Decode,
  TR as DecodeBase64ToBinary,
  bO as DecodeBase64ToString,
  iU as DecodeBase64UrlToBinary,
  zN as DecodeBase64UrlToString,
  sA as DeepCopier,
  _ee as DefaultCollisionCoordinator,
  Ite as DefaultKTX2DecoderOptions,
  oq as DefaultLoadingScreen,
  K9 as DefaultRenderingPipeline,
  MW as Deferred,
  YN as DepthCullingState,
  sR as DepthOfFieldBlurPostProcess,
  jF as DepthOfFieldEffect,
  am as DepthOfFieldEffectBlurLevel,
  eie as DepthOfFieldMergePostProcess,
  J2 as DepthPeelingRenderer,
  oie as DepthPeelingSceneComponent,
  Kte as DepthReducer,
  jD as DepthRenderer,
  aie as DepthRendererSceneComponent,
  zne as DepthSortedParticle,
  fre as DerivativeBlock,
  tne as DesaturateBlock,
  l4 as DetailMapConfiguration,
  z5 as DeviceInputEventType,
  lF as DeviceLostReason,
  OO as DeviceOrientationCamera,
  G5 as DeviceSource,
  J$ as DeviceSourceManager,
  vn as DeviceType,
  IA as DirectionalLight,
  aue as DirectionalLightFrustumViewer,
  XY as DiscBlock,
  Rve as DiscBuilder,
  are as DiscardBlock,
  Sy as DisplayPassPostProcess,
  Ore as DistanceBlock,
  e0e as DistanceConstraint,
  w6e as DistanceJoint,
  Sre as DivideBlock,
  RN as DoNothingAction,
  I9e as DomManagement,
  jre as DotBlock,
  Yd as DracoCompression,
  zo as DrawWrapper,
  L5 as DualSenseInput,
  dp as DualShockButton,
  Kw as DualShockDpad,
  M5 as DualShockInput,
  Bee as DualShockPad,
  eA as DumpTools,
  Rxe as DynamicDataManager,
  M8 as DynamicFloat32Array,
  Xp as DynamicTexture,
  u1 as EasingFunction,
  pp as EasingMode,
  uV as EdgesRenderer,
  An as Effect,
  c1 as EffectFallbacks,
  mc as EffectLayer,
  Nte as EffectLayerSceneComponent,
  fU as EffectRenderer,
  Cme as EffectStyle,
  gUe as EffectStyleManager,
  ng as EffectWrapper,
  i6e as ElasticEase,
  ane as ElbowBlock,
  XR as EncodeArrayBufferToBase64,
  C$ as EndsWith,
  Ge as Engine,
  Kle as EngineFactory,
  nO as EngineFormat,
  Ete as EngineInstrumentation,
  gr as EngineStore,
  fue as EngineView,
  gD as EnvironmentHelper,
  hue as EnvironmentTextureTools,
  Dn as Epsilon,
  VS as EquiRectangularCubeTexture,
  Die as EquiRectangularCubeTextureAssetTask,
  Z2 as ErrorCodes,
  PF as ErrorFilter,
  hq as EventConditionSource,
  wm as EventConstants,
  Ome as EventManager,
  IN as EventState,
  w$ as ExecuteCodeAction,
  $$ as ExponentialEase,
  FQ as ExternalTexture,
  By as ExtractHighlightsPostProcess,
  zR as ExtrudePolygon,
  GR as ExtrudeShape,
  ZR as ExtrudeShapeCustom,
  USe as FILL_LIGHT_ID,
  mSe as FREE_CAMERA_ID,
  kY as FactorGradient,
  q6e as FadeInOutBehavior,
  k2 as FeatureName,
  kW as FileTools,
  A9 as FileToolsOptions,
  KY as FilesInput,
  em as FilesInputStore,
  Ji as FilterMode,
  vV as FilterPostProcess,
  JS as FlowGraph,
  mae as FlowGraphACosNumberBlock,
  jae as FlowGraphASinNumberBlock,
  Cae as FlowGraphATan2NumberBlock,
  Wae as FlowGraphATanNumberBlock,
  eae as FlowGraphAbsNumberBlock,
  d1e as FlowGraphAddMatrixAndNumberBlock,
  f1e as FlowGraphAddMatrixBlock,
  Cse as FlowGraphAddNumberBlock,
  roe as FlowGraphAddVector2Block,
  goe as FlowGraphAddVector3Block,
  Moe as FlowGraphAddVector4Block,
  Xse as FlowGraphBitwiseAndBlock,
  xse as FlowGraphBitwiseLeftShiftBlock,
  bse as FlowGraphBitwiseNotBlock,
  Tse as FlowGraphBitwiseOrBlock,
  Dse as FlowGraphBitwiseRightShiftBlock,
  qse as FlowGraphBitwiseXorBlock,
  CA as FlowGraphBlock,
  Mie as FlowGraphBranchBlock,
  aae as FlowGraphCeilNumberBlock,
  x1e as FlowGraphClampMatrixBlock,
  m1e as FlowGraphComposeMatrixBlock,
  fse as FlowGraphConditionalDataBlock,
  vse as FlowGraphConstantBlock,
  lO as FlowGraphContext,
  Qge as FlowGraphContextLogger,
  dse as FlowGraphCoordinateTransformBlock,
  TS as FlowGraphCoordinator,
  qae as FlowGraphCosNumberBlock,
  jse as FlowGraphCountLeadingZerosBlock,
  wse as FlowGraphCountTrailingZerosBlock,
  $ie as FlowGraphCounterBlock,
  coe as FlowGraphCreateVector2Block,
  Ooe as FlowGraphCreateVector3Block,
  i1e as FlowGraphCreateVector4Block,
  Voe as FlowGraphCrossVector3Block,
  tse as FlowGraphDebounceBlock,
  j1e as FlowGraphDecomposeMatrixBlock,
  X1e as FlowGraphDivideMatrixAndNumberBlock,
  H1e as FlowGraphDivideMatrixBlock,
  Nse as FlowGraphDivideNumberBlock,
  foe as FlowGraphDivideVector2Block,
  Doe as FlowGraphDivideVector3Block,
  Zoe as FlowGraphDivideVector4Block,
  Lie as FlowGraphDoNBlock,
  Ioe as FlowGraphDotVector3Block,
  Uae as FlowGraphENumberBlock,
  Yae as FlowGraphEqualsNumberBlock,
  HU as FlowGraphEventBlock,
  og as FlowGraphExecutionBlock,
  uae as FlowGraphExpNumberBlock,
  rse as FlowGraphFlipFlopBlock,
  iae as FlowGraphFloorNumberBlock,
  Kie as FlowGraphForLoopBlock,
  U1e as FlowGraphGetTransformationMatrixBlock,
  Ase as FlowGraphGetVariableBlock,
  Lae as FlowGraphGreaterThanNumberBlock,
  Jae as FlowGraphGreaterThanOrEqualsNumberBlock,
  Gse as FlowGraphIsInfinityNumberBlock,
  Jse as FlowGraphIsNaNNumberBlock,
  uoe as FlowGraphLengthVector2Block,
  Boe as FlowGraphLengthVector3Block,
  t1e as FlowGraphLengthVector4Block,
  Gae as FlowGraphLessThanNumberBlock,
  _ae as FlowGraphLessThanOrEqualsNumberBlock,
  Hae as FlowGraphLnNumberBlock,
  Pae as FlowGraphLog10NumberBlock,
  Fie as FlowGraphLogBlock,
  pae as FlowGraphLogNumberBlock,
  Sse as FlowGraphLogicAndBlock,
  Ise as FlowGraphLogicNotBlock,
  Use as FlowGraphLogicOrBlock,
  Nae as FlowGraphMaxNumberBlock,
  bm as FlowGraphMeshPickEventBlock,
  Eae as FlowGraphMinNumberBlock,
  eoe as FlowGraphMixNumberBlock,
  Yse as FlowGraphModNumberBlock,
  Gie as FlowGraphMultiGateBlock,
  p1e as FlowGraphMultiplyMatrixBlock,
  Ese as FlowGraphMultiplyNumberBlock,
  aoe as FlowGraphMultiplyVector2Block,
  boe as FlowGraphMultiplyVector3Block,
  zoe as FlowGraphMultiplyVector4Block,
  rae as FlowGraphNegateNumberBlock,
  Poe as FlowGraphNormalizeVector2Block,
  Soe as FlowGraphNormalizeVector3Block,
  r1e as FlowGraphNormalizeVector4Block,
  Cy as FlowGraphPath,
  sse as FlowGraphPauseAnimationBlock,
  Rae as FlowGraphPiNumberBlock,
  nse as FlowGraphPlayAnimationBlock,
  ase as FlowGraphPlayAudioBlock,
  Lse as FlowGraphPowNumberBlock,
  W1e as FlowGraphQuaternionToRotationMatrixBlock,
  yae as FlowGraphRandomNumberBlock,
  R1e as FlowGraphReceiveCustomEventBlock,
  hoe as FlowGraphRotate2dVector2Block,
  Foe as FlowGraphRotate3dVector3Block,
  fae as FlowGraphRoundNumberBlock,
  q1e as FlowGraphScaleMatrixBlock,
  doe as FlowGraphScaleVector2Block,
  woe as FlowGraphScaleVector3Block,
  $oe as FlowGraphScaleVector4Block,
  I1e as FlowGraphSceneReadyEventBlock,
  V1e as FlowGraphSceneTickEventBlock,
  Yie as FlowGraphSendCustomEventBlock,
  Qie as FlowGraphSetPropertyBlock,
  Nie as FlowGraphSetVariableBlock,
  uO as FlowGraphSignalConnection,
  Xae as FlowGraphSinNumberBlock,
  poe as FlowGraphSplitVector2Block,
  koe as FlowGraphSplitVector3Block,
  a1e as FlowGraphSplitVector4Block,
  _se as FlowGraphSqrtNumberBlock,
  $x as FlowGraphState,
  ise as FlowGraphStopAnimationBlock,
  ose as FlowGraphStopAudioBlock,
  P1e as FlowGraphSubtractMatrixAndNumberBlock,
  u1e as FlowGraphSubtractMatrixBlock,
  yse as FlowGraphSubtractNumberBlock,
  ioe as FlowGraphSubtractVector2Block,
  Toe as FlowGraphSubtractVector3Block,
  Koe as FlowGraphSubtractVector4Block,
  Zie as FlowGraphSwitchBlock,
  xae as FlowGraphTanNumberBlock,
  Jie as FlowGraphThrottleBlock,
  zie as FlowGraphTimerBlock,
  Qoe as FlowGraphTransformVector3Block,
  dae as FlowGraphTruncNumberBlock,
  _ie as FlowGraphWaitAllBlock,
  ese as FlowGraphWhileLoopBlock,
  Iy as FluidRenderer,
  Pie as FluidRendererSceneComponent,
  Pc as FluidRenderingDebug,
  LY as FluidRenderingObject,
  uie as FluidRenderingObjectCustomParticles,
  vie as FluidRenderingObjectParticleSystem,
  wF as FluidRenderingTargetRenderer,
  FR as FlyCamera,
  Dee as FlyCameraInputsManager,
  jq as FlyCameraKeyboardInput,
  CR as FlyCameraMouseInput,
  pre as FogBlock,
  j6e as FollowBehavior,
  Fv as FollowCamera,
  jee as FollowCameraInputsManager,
  aA as FollowCameraKeyboardMoveInput,
  qD as FollowCameraMouseWheelInput,
  Eu as FollowCameraPointersInput,
  Are as FragCoordBlock,
  lre as FragDepthBlock,
  iq as FragmentOutputBlock,
  Vu as FramingBehavior,
  SA as FreeCamera,
  PQ as FreeCameraDeviceOrientationInput,
  ER as FreeCameraGamepadInput,
  kR as FreeCameraInputsManager,
  wc as FreeCameraKeyboardMoveInput,
  OR as FreeCameraMouseInput,
  L0 as FreeCameraMouseWheelInput,
  yR as FreeCameraTouchInput,
  cQ as FreeCameraVirtualJoystickInput,
  Rre as FresnelBlock,
  GI as FresnelParameters,
  QH as FromHalfFloat,
  MI as FrontFace,
  ore as FrontFacingBlock,
  Xc as Frustum,
  ym as FxaaPostProcess,
  bc as GPUParticleSystem,
  s2e as GROUND_ID,
  kme as GUI2d,
  Nme as GUI2dManager,
  z9e as GUID,
  wme as GUIManager,
  N9 as Gamepad,
  yO as GamepadCamera,
  Wee as GamepadManager,
  See as GamepadSystemSceneComponent,
  Fd as GaussianSplatting,
  SO as GenerateBase64StringFromPixelData,
  rQ as GenerateBase64StringFromTexture,
  nQ as GenerateBase64StringFromTextureAsync,
  xee as GenericPad,
  _R as GeodesicData,
  Tf as Geometry,
  po as GeometryBufferRenderer,
  rie as GeometryBufferRendererSceneComponent,
  BY as GeometryCollectionBlock,
  xne as GeometryElbowBlock,
  kne as GeometryInfoBlock,
  xf as GeometryInputBlock,
  Ty as GeometryOptimizeBlock,
  vY as GeometryOutputBlock,
  CY as GeometryTextureBlock,
  OY as GeometryTextureFetchBlock,
  UY as GeometryTransformBlock,
  SY as GeometryTrigonometryBlock,
  Bs as GeometryTrigonometryBlockOperations,
  Jo as GetClass,
  gR as GetDOMTextContent,
  ry as GetEnvInfo,
  nV as GetEnvironmentBRDFTexture,
  ere as GetInternalFormatFromBasisFormat,
  sV as GetTGAHeader,
  lte as GetTextureDataAsync,
  Lo as Gizmo,
  QI as GizmoAnchorPoint,
  pD as GizmoCoordinatesMode,
  Jle as GizmoManager,
  zl as GlowLayer,
  TDe as GlowLayersManager,
  $R as GoldbergMesh,
  Jre as GradientBlock,
  mC as GradientBlockColorStep,
  kl as GradientHelper,
  km as GrainPostProcess,
  dY as GreasedLineBaseMesh,
  D6 as GreasedLineMaterialDefaults,
  T1 as GreasedLineMesh,
  E2 as GreasedLineMeshColorDistribution,
  K2 as GreasedLineMeshColorDistributionType,
  Tc as GreasedLineMeshColorMode,
  OS as GreasedLineMeshMaterialType,
  rq as GreasedLineMeshWidthDistribution,
  o4 as GreasedLinePluginMaterial,
  cD as GreasedLineRibbonAutoDirectionMode,
  kS as GreasedLineRibbonFacesMode,
  L1 as GreasedLineRibbonMesh,
  m0 as GreasedLineRibbonPointsMode,
  AY as GreasedLineSimpleMaterial,
  Qs as GreasedLineTools,
  pY as GridBlock,
  xve as GroundBuilder,
  dU as GroundMesh,
  Ixe as GroupManager,
  _2 as HDRCubeTexture,
  xie as HDRCubeTextureAssetTask,
  _Q as HDRFiltering,
  iO as HDRTools,
  i2e as HIGHLIGHT_ID,
  E6e as HandConstraintBehavior,
  z8 as HandConstraintOrientation,
  Jx as HandConstraintVisibility,
  Kx as HandConstraintZone,
  J8 as HandPart,
  mF as HardwareScalingOptimization,
  f0e as HavokPlugin,
  aV as HeightToNormalBlock,
  AIe as HelpPanelManager,
  zle as HemisphereBuilder,
  y0 as HemisphericLight,
  BR as HemisphericParticleEmitter,
  Ad as HighlightLayer,
  E0e as HighlightsPostProcess,
  B6e as Hinge2Joint,
  t0e as HingeConstraint,
  m6e as HingeJoint,
  cy as HtmlElementTexture,
  Nge as IFlowGraphCoordinatorConfiguration,
  bge as IWebXRControllerPhysicsOptions,
  PY as IcoSphereBlock,
  y6e as IcoSphereBuilder,
  Tie as ImageAssetTask,
  nY as ImageProcessingBlock,
  Ui as ImageProcessingConfiguration,
  M$ as ImageProcessingConfigurationDefines,
  Uy as ImageProcessingPostProcess,
  E0 as ImageSourceBlock,
  b$ as IncrementValueAction,
  Tq as IndexFormat,
  gi as InputBlock,
  SF as InspectableType,
  SQ as InstancedLinesMesh,
  bp as InstancedMesh,
  ire as InstancesBlock,
  Rne as InstantiateBlock,
  Vne as InstantiateLinearBlock,
  IY as InstantiateOnFacesBlock,
  by as InstantiateOnVerticesBlock,
  RY as InstantiateOnVolumeBlock,
  Cne as InstantiateRadialBlock,
  dee as InstantiatedEntries,
  One as IntFloatConverterBlock,
  PSe as InteractManager,
  As as InternalTexture,
  ri as InternalTextureSource,
  I$ as InterpolateValueAction,
  LC as IntersectionInfo,
  qR as IsBase64DataUrl,
  $w as IsDocumentAvailable,
  JN as IsFileURL,
  Mw as IsNavigatorAvailable,
  u9 as IsWindowObjectExist,
  V9 as JoystickAxis,
  Aee as KeepAssets,
  t4 as KeyboardEventTypes,
  MC as KeyboardInfo,
  Y5 as KeyboardInfoPre,
  yv as KhronosTextureContainer,
  H6 as KhronosTextureContainer2,
  HN as LIGHT_AUXILIARYMESHDIR_ID,
  hN as LIGHT_AUXILIARYMESHPOINT_ID,
  gN as LIGHT_AUXILIARYMESHSPOT_ID,
  XV as LIGHT_AUXILIARYMESH_ID,
  C0 as LScene,
  Kve as LatheBuilder,
  Yte as Layer,
  Qte as LayerSceneComponent,
  yre as LengthBlock,
  ly as LensFlare,
  gm as LensFlareSystem,
  Mte as LensFlareSystemSceneComponent,
  RC as LensFlaresOptimization,
  d7e as LensRenderingPipeline,
  Wre as LerpBlock,
  ci as Light,
  AO as LightBlock,
  D0 as LightGizmo,
  sre as LightInformationBlock,
  fie as LineEdgesRenderer,
  hUe as LineSysManager,
  Nve as LinesBuilder,
  Tp as LinesMesh,
  gq as LoadFile,
  mS as LoadFileError,
  nU as LoadImage,
  f9 as LoadOp,
  fO as LoadTextureFromTranscodeResult,
  HSe as LoadingScreen,
  n0e as LockConstraint,
  Se as Logger,
  Wxe as LoopMode,
  SSe as MAIN_LIGHT_ID,
  vD as MapMode,
  qne as MapRangeBlock,
  VY as MappingBlock,
  GH as MappingTypes,
  HUe as MatBrashTool,
  gt as Material,
  wte as MaterialAnisotropicDefines,
  Dte as MaterialClearCoatDefines,
  na as MaterialDefines,
  Lee as MaterialDetailMapDefines,
  Dt as MaterialFlags,
  une as MaterialGreasedLineDefines,
  Ye as MaterialHelper,
  jte as MaterialIridescenceDefines,
  YSe as MaterialManager,
  Gl as MaterialPluginBase,
  x6 as MaterialPluginEvent,
  sq as MaterialPluginManager,
  mte as MaterialSheenDefines,
  Bte as MaterialSubSurfaceDefines,
  DY as MathBlock,
  Ov as MathBlockOperations,
  he as Matrix,
  nne as MatrixBuilderBlock,
  Ene as MatrixComposeBlock,
  fne as MatrixDeterminantBlock,
  Ane as MatrixTransposeBlock,
  Vre as MaxBlock,
  mY as MergeGeometryBlock,
  uq as MergeMeshesOptimization,
  Ee as Mesh,
  Hie as MeshAssetTask,
  fY as MeshAttributeExistsBlock,
  xa as MeshAttributeExistsBlockTypes,
  lY as MeshBlock,
  Ef as MeshBuilder,
  im as MeshDebugMode,
  Q9 as MeshDebugPluginMaterial,
  oge as MeshExploder,
  fee as MeshLODLevel,
  IO as MeshParticleEmitter,
  Qw as MeshUVSpaceRenderer,
  Q2 as MeshoptCompression,
  fIe as Meta3D,
  hR as Methods,
  Cre as MinBlock,
  Lte as MinMaxReducer,
  oF as MipmapFilterMode,
  uD as MirrorTexture,
  rne as ModBlock,
  xF as ModelShape,
  lD as MorphTarget,
  U0 as MorphTargetManager,
  rY as MorphTargetsBlock,
  BD as MotionBlurPostProcess,
  iQ as MotorEnabledJoint,
  Dc as MultiMaterial,
  JY as MultiObserver,
  x6e as MultiPointerScaleBehavior,
  Zx as MultiRenderTarget,
  zC as MultiplyBlock,
  k1e as NIGHT_ENV,
  Q1e as NIGHT_JPG,
  zre as NLerpBlock,
  hD as NativeDataStream,
  Hm as NativeEngine,
  kI as NativePointerInput,
  Vie as NativeXRFrame,
  Gee as NativeXRLayerRenderTargetTextureProvider,
  zee as NativeXRLayerWrapper,
  Zee as NativeXRRenderTarget,
  kre as NegateBlock,
  Bxe as NetworkManager,
  wxe as NetworkMethod,
  mxe as NetworkParamType,
  jxe as NetworkType,
  Cs as Node,
  Ql as NodeGeometry,
  yi as NodeGeometryBlock,
  Me as NodeGeometryBlockConnectionPointTypes,
  Xne as NodeGeometryBuildState,
  qF as NodeGeometryConnectionPoint,
  $8 as NodeGeometryConnectionPointCompatibilityStates,
  ES as NodeGeometryConnectionPointDirection,
  Ws as NodeGeometryContextualSources,
  yme as NodeManager,
  ja as NodeMaterial,
  Mr as NodeMaterialBlock,
  jA as NodeMaterialBlockConnectionPointMode,
  de as NodeMaterialBlockConnectionPointTypes,
  Ve as NodeMaterialBlockTargets,
  um as NodeMaterialConnectionPoint,
  pc as NodeMaterialConnectionPointCompatibilityStates,
  Ko as NodeMaterialConnectionPointCustomObject,
  ao as NodeMaterialConnectionPointDirection,
  HI as NodeMaterialDefines,
  Vv as NodeMaterialModes,
  _pe as NodeMaterialOptimizer,
  Bi as NodeMaterialSystemValues,
  Xre as NodeMaterialTeleportInBlock,
  Tre as NodeMaterialTeleportOutBlock,
  bne as NoiseBlock,
  ZI as NoiseProceduralTexture,
  Zre as NormalBlendBlock,
  wre as NormalizeBlock,
  wne as NormalizeVectorBlock,
  Tne as NullBlock,
  ote as NullEngine,
  ate as NullEngineOptions,
  n2e as ORTHOGRAPHIC_CAMERA_ID,
  Oe as Observable,
  c$ as Observer,
  bpe as OcclusionMaterial,
  cm as Octree,
  NI as OctreeBlock,
  DQ as OctreeSceneComponent,
  gF as OimoJSPlugin,
  jve as OnAfterEnteringVRObservableEvent,
  iY as OneMinusBlock,
  eD as OperateType,
  tm as Orientation,
  o9e as OrthographicCamera,
  bwe as OutView,
  MS as OutlineRenderer,
  v2e as PARTICAL_TEXTUREURL,
  DD as PBRAnisotropicConfiguration,
  fs as PBRBaseMaterial,
  Yv as PBRBaseSimpleMaterial,
  h9 as PBRClearCoatConfiguration,
  dd as PBRIridescenceConfiguration,
  mr as PBRMaterial,
  cF as PBRMaterialDefines,
  g9 as PBRMetallicRoughnessBlock,
  s4 as PBRMetallicRoughnessMaterial,
  K0 as PBRSheenConfiguration,
  a4 as PBRSpecularGlossinessMaterial,
  _o as PBRSubSurfaceConfiguration,
  kf as PHI,
  A2e as PLACEHOLDER_ID,
  y$ as PadNumber,
  wq as PanoramaToCubeMapTools,
  FS as Particle,
  dQ as ParticleBlendMultiplyBlock,
  Tm as ParticleHelper,
  Lme as ParticleManager,
  AQ as ParticleRampGradientBlock,
  ti as ParticleSystem,
  bq as ParticleSystemSet,
  fQ as ParticleTextureBlock,
  xS as ParticleType,
  VC as ParticlesOptimization,
  hQ as PassCubePostProcess,
  lg as PassPostProcess,
  sU as Path2,
  vm as Path3D,
  A6e as PathCursor,
  pge as PerfCollectionStrategy,
  v9 as PerfCounter,
  k9 as PerformanceConfigurator,
  iee as PerformanceMonitor,
  b0 as PerformanceViewerCollector,
  PU as PerturbNormalBlock,
  US as PhotoDome,
  $ne as Physics6DoFConstraint,
  _he as Physics6DoFLimit,
  a0e as PhysicsAggregate,
  wy as PhysicsBody,
  mD as PhysicsConstraint,
  MH as PhysicsConstraintAxis,
  I2 as PhysicsConstraintAxisLimitMode,
  _x as PhysicsConstraintMotorType,
  kv as PhysicsConstraintType,
  $Q as PhysicsEngine,
  jy as PhysicsEngineV2,
  q0 as PhysicsEventType,
  d0e as PhysicsHelper,
  tn as PhysicsImpostor,
  ta as PhysicsJoint,
  R2 as PhysicsMaterialCombineMode,
  W0 as PhysicsMotionType,
  sS as PhysicsRadialExplosionEventOptions,
  iR as PhysicsRadialImpulseFalloff,
  iV as PhysicsRaycastResult,
  P4 as PhysicsShape,
  QY as PhysicsShapeBox,
  FY as PhysicsShapeCapsule,
  Zhe as PhysicsShapeContainer,
  zhe as PhysicsShapeConvexHull,
  NY as PhysicsShapeCylinder,
  Ghe as PhysicsShapeMesh,
  EY as PhysicsShapeSphere,
  Ff as PhysicsShapeType,
  YY as PhysicsUpdraftEventOptions,
  YS as PhysicsUpdraftMode,
  sue as PhysicsViewer,
  MY as PhysicsVortexEventOptions,
  F9 as PickingInfo,
  AF as PipelineErrorReason,
  $2 as PivotPointPlacement,
  Vs as PivotTools,
  BA as Plane,
  uY as PlaneBlock,
  b6e as PlaneBuilder,
  tS as PlaneDragGizmo,
  S0 as PlaneRotationGizmo,
  x$ as PlayAnimationAction,
  m$ as PlaySoundAction,
  Iv as PointColor,
  ag as PointLight,
  WR as PointParticleEmitter,
  O9 as PointerDragBehavior,
  ir as PointerEventTypes,
  vp as PointerInfo,
  GN as PointerInfoBase,
  K$ as PointerInfoPre,
  Yn as PointerInput,
  _ne as PointsCloudSystem,
  WC as PointsGroup,
  g0 as Polar,
  Yve as Polygon,
  Mve as PolygonBuilder,
  ete as PolygonMeshBuilder,
  zve as PolyhedronBuilder,
  _C as PolyhedronData,
  oy as PositionGizmo,
  aQ as PositionNormalTextureVertex,
  sQ as PositionNormalVertex,
  kr as PostProcess,
  yI as PostProcessManager,
  gs as PostProcessRenderEffect,
  SD as PostProcessRenderPipeline,
  nie as PostProcessRenderPipelineManager,
  iie as PostProcessRenderPipelineManagerSceneComponent,
  IC as PostProcessesOptimization,
  DSe as PostType,
  Lre as PosterizeBlock,
  Ere as PowBlock,
  s6e as PowerEase,
  sF as PowerPreference,
  cre as PrePassOutputBlock,
  mA as PrePassRenderer,
  Aie as PrePassRendererSceneComponent,
  gre as PrePassTextureBlock,
  Yi as PrecisionDate,
  H$ as PredicateCondition,
  f$ as Prefab,
  Vy as PressureObserverWrapper,
  Fl as PrimitiveTopology,
  i0e as PrismaticConstraint,
  Y0 as ProceduralTexture,
  Tee as ProceduralTextureSceneComponent,
  Gr as PropertyTypeForEdition,
  P1 as PushMaterial,
  _N as QuadraticEase,
  cne as QuadraticErrorSimplification,
  a6e as QuarticEase,
  Ze as Quaternion,
  KI as QueryType,
  o6e as QuinticEase,
  $C as RGBDTextureTools,
  sM as ROUTE_ID,
  o2e as ROUTE_LINE_ID,
  f2e as ROUTE_POINT_ID,
  wY as RandomBlock,
  B0 as RandomBlockLocks,
  v4 as RandomGUID,
  Fre as RandomNumberBlock,
  hy as RawCubeTexture,
  Bo as RawTexture,
  Py as RawTexture2DArray,
  zpe as RawTexture3D,
  Hi as Ray,
  yQ as RayHelper,
  BS as ReadFile,
  xO as ReadFileError,
  Yne as RecastJSCrowd,
  Bhe as RecastJSPlugin,
  Yre as ReciprocalBlock,
  $re as ReflectBlock,
  Cm as ReflectionBlock,
  Im as ReflectionProbe,
  hre as ReflectionTextureBlock,
  fR as Reflector,
  ene as RefractBlock,
  wD as RefractionBlock,
  WD as RefractionPostProcess,
  tY as RefractionTexture,
  Ue as RegisterClass,
  Tve as RegisterMaterialPlugin,
  gte as RegisterNativeTypeAsync,
  jR as RemapBlock,
  uF as RenderPassTimestampLocation,
  Ta as RenderTargetTexture,
  DR as RenderTargetWrapper,
  BF as RenderTargetsOptimization,
  x0 as RenderingGroup,
  L$ as RenderingGroupInfo,
  $6 as RenderingManager,
  Mre as ReplaceColorBlock,
  jO as RequestFile,
  OI as RequestFileError,
  n9e as ResourceLoader,
  hDe as ResourceManager,
  V$ as RetryStrategy,
  Ive as RibbonBuilder,
  Zl as RichType,
  w6 as RichTypeAny,
  m6 as RichTypeBoolean,
  Cie as RichTypeColor3,
  Oie as RichTypeColor4,
  D1 as RichTypeMatrix,
  Yt as RichTypeNumber,
  hV as RichTypeQuaternion,
  pV as RichTypeString,
  Y9 as RichTypeVector2,
  ma as RichTypeVector3,
  iA as RichTypeVector4,
  see as RollingAverage,
  _re as Rotate2dBlock,
  zBe as RotateByVector,
  GQ as RotationGizmo,
  mne as RotationXBlock,
  Bne as RotationYBlock,
  Wne as RotationZBlock,
  R$ as RuntimeAnimation,
  O0 as RuntimeError,
  d2e as SELECTOR_MESH_ID,
  yC as SKYBOX_ID,
  H9 as SSAO2RenderingPipeline,
  pU as SSAORenderingPipeline,
  Wa as SSRRenderingPipeline,
  E1e as SUNNY_ENV,
  Y1e as SUNNY_JPG,
  zd as SYSTEM_PREFIX,
  Xq as SamplerBindingType,
  Xt as Scalar,
  bre as ScaleBlock,
  ZQ as ScaleGizmo,
  Sne as ScalingBlock,
  sr as Scene,
  Ot as SceneComponentConstants,
  oV as SceneDepthBlock,
  Fte as SceneInstrumentation,
  Hn as SceneLoader,
  O2 as SceneLoaderAnimationGroupLoadingMode,
  l9 as SceneLoaderFlags,
  pR as SceneManager,
  c4 as SceneOptimization,
  zY as SceneOptimizer,
  om as SceneOptimizerOptions,
  $H as ScenePerformancePriority,
  vge as SceneRecorder,
  G2 as SceneSerializer,
  dre as ScreenSizeBlock,
  vre as ScreenSpaceBlock,
  hU as ScreenSpaceCurvaturePostProcess,
  jp as ScreenSpaceReflectionPostProcess,
  Age as ScreenshotTools,
  Uxe as SelectorManager,
  jt as SerializationHelper,
  bY as SetColorsBlock,
  DO as SetCorsBehavior,
  WY as SetMaterialIDBlock,
  qY as SetNormalsBlock,
  VN as SetParentAction,
  TY as SetPositionsBlock,
  T$ as SetStateAction,
  xY as SetTangentsBlock,
  qy as SetUVsBlock,
  q$ as SetValueAction,
  Aq as ShaderCodeInliner,
  za as ShaderLanguage,
  Rv as ShaderMatType,
  Zo as ShaderMaterial,
  G8 as ShaderStage,
  Le as ShaderStore,
  ehe as ShadowDepthWrapper,
  ln as ShadowGenerator,
  Jte as ShadowGeneratorSceneComponent,
  xD as ShadowLight,
  Pre as ShadowMapBlock,
  UC as ShadowsOptimization,
  Lve as ShapeBuilder,
  Em as SharpenPostProcess,
  Vm as SheenBlock,
  OC as Shortcuts,
  Gre as SimplexPerlin3DBlock,
  pne as SimplicationQueueSceneComponent,
  Pne as SimplificationQueue,
  xhe as SimplificationSettings,
  nR as SimplificationType,
  $N as SineEase,
  Hee as SixDofDragBehavior,
  Qd as Size,
  r4 as Skeleton,
  Ru as SkeletonViewer,
  r0e as SliderConstraint,
  qf as SmartArray,
  K8 as SmartArrayNoDuplicate,
  Qre as SmoothStepBlock,
  bF as SolidParticle,
  Jhe as SolidParticleSystem,
  Gne as SolidParticleVertex,
  qc as Sound,
  uee as SoundTrack,
  pF as SourceTextureFormat,
  ai as Space,
  cY as SphereBlock,
  Sve as SphereBuilder,
  SR as SphereDirectedParticleEmitter,
  oU as SphereParticleEmitter,
  X0 as Spherical,
  HD as SphericalHarmonics,
  i4 as SphericalPolynomial,
  nA as SpotLight,
  s0e as SpringConstraint,
  Ry as Sprite,
  z2 as SpriteManager,
  nge as SpriteMap,
  ige as SpritePackedManager,
  cie as SpriteSceneComponent,
  Y1 as Stage,
  Wt as StandardMaterial,
  Kee as StandardMaterialDefines,
  Ss as StandardRenderingPipeline,
  O$ as StartsWith,
  g$ as StateCondition,
  Vme as StateDataManager,
  T0 as StencilOperation,
  L2 as StencilState,
  KN as StencilStateComposer,
  Ire as StepBlock,
  Oee as StereoscopicArcRotateCamera,
  yee as StereoscopicFreeCamera,
  kee as StereoscopicGamepadCamera,
  z6e as StereoscopicInterlacePostProcess,
  Cee as StereoscopicInterlacePostProcessI,
  G6e as StereoscopicScreenUniversalCamera,
  Eee as StereoscopicUniversalCamera,
  F6e as StickValues,
  D$ as StopAnimationAction,
  B$ as StopSoundAction,
  bee as StorageBuffer,
  eO as StorageTextureAccess,
  Hc as StoreOp,
  YC as StringDictionary,
  R9e as StringTools,
  vq as SubEmitter,
  NS as SubEmitterType,
  rA as SubMesh,
  CS as SubSurfaceBlock,
  die as SubSurfaceSceneComponent,
  Ure as SubtractBlock,
  D6e as SurfaceMagnetismBehavior,
  X$ as SwitchBooleanAction,
  J5 as SwitchInput,
  Rm as TBNBlock,
  Zte as TGATools,
  Zi as Tags,
  b1 as TargetCamera,
  eee as TargetedAnimation,
  Fne as TeleportInBlock,
  Nne as TeleportOutBlock,
  Q$ as TestBase64DataUrl,
  Twe as Text,
  gie as TextFileAssetTask,
  We as Texture,
  zH as TextureAspect,
  qie as TextureAssetTask,
  _I as TextureBlock,
  Hp as TextureDimension,
  we as TextureFormat,
  SC as TextureOptimization,
  I0 as TexturePacker,
  XF as TexturePackerFrame,
  Ll as TextureSampleType,
  MN as TextureSampler,
  Pte as TextureTools,
  Po as TextureUsage,
  Da as TextureViewDimension,
  hr as ThinEngine,
  Gpe as ThinRenderTargetTexture,
  nq as ThinTexture,
  Cve as TiledBoxBuilder,
  Vve as TiledPlaneBuilder,
  Gx as TimerState,
  Hs as TmpColors,
  ue as TmpVectors,
  JW as ToGammaSpace,
  LH as ToHalfFloat,
  xI as ToLinearSpace,
  C7e as TonemapPostProcess,
  _w as TonemappingOperator,
  ye as Tools,
  hY as TorusBlock,
  Dve as TorusBuilder,
  Ove as TorusKnotBuilder,
  pQ as TouchCamera,
  rR as TrailMesh,
  fa as Trajectory,
  vO as TrajectoryClassifier,
  oO as TranscodeAsync,
  nS as TranscodeTarget,
  JC as TransformBlock,
  Hr as TransformNode,
  Ine as TranslationBlock,
  gy as TriPlanarBlock,
  wWe as TriggerAfterAnimationBegin,
  mWe as TriggerAfterAnimationPause,
  BWe as TriggerAfterAnimationRestart,
  WWe as TriggerAfterAnimationStop,
  SWe as TriggerAfterCameraAutoRotateBegin,
  UWe as TriggerAfterCameraAutoRotateStop,
  IWe as TriggerAfterDehighlight,
  RWe as TriggerAfterHighlight,
  VWe as TriggerAfterNetworkCancel,
  CWe as TriggerAfterNetworkRequest,
  OWe as TriggerAfterNetworkResponse,
  yWe as TriggerAfterReceivingWindowMessage,
  kWe as TriggerAfterRunCustomFn,
  EWe as TriggerAfterRunGlobalFn,
  FWe as TriggerAfterSetCameraValue,
  NWe as TriggerAfterSetDynamicData,
  QWe as TriggerAfterSetValue,
  YWe as TriggerAfterShowCameraView,
  MWe as TriggerAfterSoundPause,
  LWe as TriggerAfterSoundPlay,
  KWe as TriggerAfterSoundStop,
  JWe as TriggerAfterSwitchCamera,
  zWe as TriggerAfterSwitchScene,
  GWe as TriggerClick,
  ZWe as TriggerDblclick,
  _We as TriggerKeyDown,
  $We as TriggerKeyUp,
  eSe as TriggerMouseDown,
  tSe as TriggerMouseIn,
  rSe as TriggerMouseOut,
  nSe as TriggerMouseUp,
  iSe as TriggerRightClick,
  Ba as Triggerer,
  uQ as TrigonometryBlock,
  o9 as TrigonometryBlockOperations,
  Jve as TubeBuilder,
  gO as TubeManager,
  ure as TwirlBlock,
  Sxe as UndoRedoManager,
  yr as UniformBuffer,
  bD as UniversalCamera,
  gQ as UnregisterAllMaterialPlugins,
  qve as UnregisterMaterialPlugin,
  eY as UploadContent,
  EQ as UploadEnvLevelsAsync,
  iy as UploadEnvSpherical,
  YI as UploadLevelsAsync,
  Ds as UtilityLayerRenderer,
  eBe as VAbstractMesh,
  tBe as VArcRotateCamera,
  rBe as VArray,
  nBe as VBoolean,
  jBe as VCityMaterial,
  iBe as VColor3,
  sBe as VColor4,
  aBe as VCubeTexture,
  oBe as VDirectionalLight,
  fBe as VFollowCamera,
  ABe as VFreeCamera,
  dBe as VGradientMaterial,
  vBe as VGridMaterial,
  uBe as VHemisphericLight,
  jUe as VLinesMesh,
  PBe as VMatrix,
  cBe as VMesh,
  pBe as VMirrorTexture,
  hBe as VNodeMaterial,
  HBe as VNull,
  gBe as VNumber,
  XBe as VObject,
  TBe as VPBRMaterial,
  qBe as VPointLight,
  bBe as VQuaternion,
  Bm as VRCameraMetrics,
  Yee as VRDeviceOrientationArcRotateCamera,
  EO as VRDeviceOrientationFreeCamera,
  Mee as VRDeviceOrientationGamepadCamera,
  _5 as VRDistortionCorrectionPostProcess,
  lm as VRExperienceHelper,
  Qee as VRMultiviewToSingleviewPostProcess,
  xBe as VScene,
  DBe as VShaderMaterial,
  wBe as VSize,
  mBe as VSpotLight,
  BBe as VStandardMaterial,
  WBe as VString,
  SBe as VTexture,
  UBe as VTransformNode,
  IBe as VVector2,
  RBe as VVector3,
  VBe as VVector4,
  CBe as VVideoTexture,
  OBe as VVoid,
  yBe as VWaterMaterial,
  Xte as ValidatedNativeDataStream,
  zs as Value,
  C9 as ValueCondition,
  gV as ValueSource,
  se as ValueType,
  zt as Valuer,
  at as Vector2,
  S as Vector3,
  Ir as Vector4,
  jne as VectorConverterBlock,
  BI as VectorMergerBlock,
  Bre as VectorSplitterBlock,
  X6e as VertexAnimationBaker,
  J as VertexBuffer,
  Ut as VertexData,
  wI as VertexDataMaterialInfo,
  jo as VertexFormat,
  mI as VertexOutputBlock,
  LI as VertexStepMode,
  uy as VideoDome,
  aR as VideoRecorder,
  xc as VideoTexture,
  sY as ViewDirectionBlock,
  WA as Viewport,
  $r as VirtualJoystick,
  Fee as VirtualJoysticksCamera,
  Bc as VolumetricLightScatteringPostProcess,
  sne as VoronoiNoiseBlock,
  Kre as WaveBlock,
  Gw as WaveBlockKind,
  Lne as WebGL2ParticleSystem,
  LN as WebGL2ShaderProcessor,
  jS as WebGLDataBuffer,
  jm as WebGLHardwareTexture,
  E$ as WebGLPipelineContext,
  d1 as WebGPUCacheBindGroups,
  co as WebGPUCacheRenderPipeline,
  N2 as WebGPUCacheRenderPipelineTree,
  rD as WebGPUCacheSampler,
  qte as WebGPUDataBuffer,
  tV as WebGPUDrawContext,
  wn as WebGPUEngine,
  Nl as WebGPUTintWASM,
  ho as WebRequest,
  L9 as WebXRAbstractFeature,
  Um as WebXRAbstractMotionController,
  aS as WebXRAnchorSystem,
  fS as WebXRBackgroundRemover,
  IS as WebXRCamera,
  Wie as WebXRCompositionLayerWrapper,
  Jl as WebXRControllerComponent,
  Pq as WebXRControllerMovement,
  AS as WebXRControllerPhysics,
  ig as WebXRControllerPointerSelection,
  vy as WebXRDefaultExperience,
  P3e as WebXRDefaultExperienceOptions,
  HS as WebXRDepthSensing,
  PS as WebXRDomOverlay,
  dy as WebXREnterExitUI,
  yte as WebXREnterExitUIButton,
  l3e as WebXREnterExitUIOptions,
  Ay as WebXRExperienceHelper,
  pS as WebXREyeTracking,
  Gi as WebXRFeatureName,
  vS as WebXRFeaturePointSystem,
  So as WebXRFeaturesManager,
  Rie as WebXRGenericHandController,
  RS as WebXRGenericTriggerMotionController,
  qm as WebXRHTCViveMotionController,
  qee as WebXRHand,
  gn as WebXRHandJoint,
  va as WebXRHandTracking,
  dS as WebXRHitTest,
  lq as WebXRHitTestLegacy,
  lS as WebXRImageTracking,
  Ote as WebXRInput,
  Cte as WebXRInputSource,
  hS as WebXRLayers,
  cS as WebXRLightEstimation,
  Jee as WebXRManagedOutputCanvas,
  YR as WebXRManagedOutputCanvasOptions,
  uS as WebXRMeshDetector,
  cq as WebXRMicrosoftMixedRealityController,
  E9 as WebXRMotionControllerManager,
  nm as WebXRMotionControllerTeleportation,
  zx as WebXRNearControllerMode,
  sg as WebXRNearInteraction,
  R0 as WebXROculusTouchMotionController,
  oS as WebXRPlaneDetector,
  Vte as WebXRProfiledMotionController,
  Sie as WebXRProjectionLayerWrapper,
  XS as WebXRRawCameraAccess,
  MR as WebXRSessionManager,
  gS as WebXRSpaceWarp,
  Iie as WebXRSpaceWarpRenderTargetTextureProvider,
  d9 as WebXRState,
  Jw as WebXRTrackingState,
  CC as WebXRWalkingLocomotion,
  lee as WeightedSound,
  Ute as WorkerPool,
  aY as WorleyNoise3DBlock,
  Uie as XRSpaceWarpRenderTarget,
  pUe as XYZ2Num,
  Sme as XYZ2Vec3,
  El as Xbox360Button,
  Lw as Xbox360Dpad,
  mee as Xbox360Pad,
  K5 as XboxInput,
  Tpe as _BabylonLoaderRegistered,
  tre as _BasisTextureLoader,
  tQ as _CreationDataStorage,
  Wte as _DDSTextureLoader,
  Ste as _ENVTextureLoader,
  $te as _HDRTextureLoader,
  Z5 as _InstancesBatch,
  Rte as _KTXTextureLoader,
  aee as _MeshCollisionData,
  Ate as _OcclusionDataStorage,
  CQ as _PrimaryIsoTriangle,
  _te as _TGATextureLoader,
  fte as _TimeToken,
  pte as _UpdateRGBDAsync,
  c3e as _forceSceneHelpersToBundle,
  oue as _forceTransformFeedbackToBundle,
  Y$ as _injectLTSFileTools,
  FN as _staticOffsetValueColor3,
  NN as _staticOffsetValueColor4,
  ON as _staticOffsetValueQuaternion,
  EN as _staticOffsetValueSize,
  kN as _staticOffsetValueVector2,
  yN as _staticOffsetValueVector3,
  Mf as addClipPlaneUniforms,
  _Se as adsorb,
  QSe as alarmAnimation,
  KC as allocateAndCopyTypedBuffer,
  g9e as babylonInfos,
  Df as bindClipPlane,
  xwe as calcPosition,
  Xge as captureEquirectangularFromScene,
  AUe as changeNodePivotPoint,
  G9e as className,
  cO as colorToString,
  uSe as compatible,
  tUe as computedMeshS,
  eUe as computedMeshV,
  Qje as computedv3S,
  Nje as computedv4V,
  kSe as consoleId,
  Mme as createCSSobject,
  uUe as createDecal,
  dIe as createDefaultPipeline,
  ohe as createDetailMapPlugin,
  LBe as createDirLightRange,
  bUe as createHtmlMesh,
  Zn as createId,
  GUe as createLightRange,
  qUe as createMaskingScreen,
  Nqe as createNodeMatByString,
  the as createPBRAnisotropicPlugin,
  rhe as createPBRBRDFPlugin,
  nhe as createPBRClearCoatPlugin,
  ihe as createPBRIridescencePlugin,
  she as createPBRSheenPlugin,
  ahe as createPBRSubSurfacePlugin,
  XUe as createParticleSystem,
  KBe as createPointLightRange,
  cUe as createPointsCloud,
  JBe as createSpotLightRange,
  v9e as createUpdatableTube,
  tee as createYieldingScheduler,
  Eqe as defaultNodeMaterial,
  rn as editableInPropertyPage,
  wUe as equalsValue,
  At as expandToProperty,
  WS as extractMinAndMax,
  nee as extractMinAndMaxIndexed,
  _Be as filepath,
  C5 as findMin,
  oUe as fixDiff,
  Eje as forEachAsync,
  hI as fromDegrees,
  eWe as getAnimationDesc,
  Jje as getBoundingBoxInfo,
  b9e as getCameraTypeDesc,
  X9e as getCenter,
  l9e as getChildComponent,
  gwe as getComponent,
  TUe as getControlProperty,
  $Ue as getDataTypeDesc,
  EBe as getDefaultByValueType,
  XSe as getDefaultOptions,
  qI as getDistance,
  mM as getEasingModeDesc,
  NBe as getElement,
  MUe as getFileName,
  ID as getFilenameWithoutSearch,
  F5 as getImageBase64,
  sUe as getLinesCrossPoint,
  DM as getMetadata,
  q9e as getNetworkDesc,
  eIe as getOperatorTypeDesc,
  rIe as getPropertyDesc,
  GBe as getQuery,
  yie as getRichTypeFromValue,
  iUe as getRightTrianglePoint,
  QC as getRotation,
  sIe as getShortcut,
  l$ as getSourceDesc,
  Gy as getStyle,
  rWe as getSymbolDesc,
  tWe as getTargetDesc,
  x9e as getValueByValueSource,
  nIe as getValueByValueSourceDesc,
  P$ as getValueDesc,
  tIe as getValueSourceDesc,
  s9e as getVector3FromSC,
  Oqe as gradAlphaMat,
  $Se as half,
  vUe as initMeshBoundingBoxPivot,
  Gje as initMeshZeroPivot,
  FI as inlineScheduler,
  XN as isArray,
  CUe as isAuxiliaryMesh,
  QUe as isBabylon,
  c2e as isBoolean,
  yUe as isCameraAuxiliaryMesh,
  KSe as isColorStr,
  u2e as isEmpty,
  ESe as isFunction,
  QBe as isGLB,
  MBe as isHDR,
  BUe as isInElement,
  NUe as isJSON,
  YUe as isL3D,
  v$ as isL3DB,
  YBe as isL3DM,
  OUe as isLightAuxiliaryMesh,
  zje as isMeshFreeInPlace,
  mUe as isMobile,
  NSe as isNull,
  l2e as isNumber,
  V0 as isObject,
  xUe as isParticle,
  EUe as isRouteLine,
  kUe as isRouteMesh,
  FUe as isRoutePoint,
  P2e as isString,
  IUe as isSystemLightRange,
  VUe as isSystemLogo,
  TD as isSystemNode,
  SUe as isSystemPivotPointMesh,
  RUe as isSystemSkyBox,
  UUe as isSystemTransformNodeMesh,
  FSe as isUndefined,
  u$ as joinUrl,
  ZUe as lightRangeMeshDispose,
  gSe as loadingSvg,
  CSe as logVector3,
  aUe as lonlatToXYZ,
  v6e as makeAsyncFunction,
  ree as makeSyncFunction,
  zSe as mapAsync,
  dUe as meshExplorer,
  DN as metadataInfos,
  Hq as nativeOverride,
  eV as normalizeEnvInfo,
  VSe as obj2Array,
  Fqe as openNodeMaterialEditor,
  Cqe as outLineAlphaByMesh,
  MSe as outSkinAlphaByMesh,
  PUe as parameterOD,
  lUe as parameterTube,
  $Be as parsePropertyListItem,
  ZBe as parseUrl,
  oee as prepareDefinesForClipPlanes,
  xq as prepareStringDefinesForClipPlanes,
  zUe as previewCacheClear,
  KUe as previewReLoadVertexData,
  LUe as previewReloadTexture,
  JUe as previewSomeTwoTexture,
  J_ as randomNumber,
  NZ as randomString,
  aIe as registerShortcut,
  eQ as runCoroutine,
  BO as runCoroutineAsync,
  mO as runCoroutineSync,
  K_ as s16,
  OSe as s4,
  e4 as s8,
  rUe as screenXYToVec3,
  M as serialize,
  U$ as serializeAsCameraReference,
  Oi as serializeAsColor3,
  rU as serializeAsColor4,
  W$ as serializeAsColorCurves,
  eU as serializeAsFresnelParameters,
  CN as serializeAsImageProcessingConfiguration,
  qO as serializeAsMatrix,
  tU as serializeAsMeshReference,
  S$ as serializeAsQuaternion,
  en as serializeAsTexture,
  HR as serializeAsVector2,
  fo as serializeAsVector3,
  HF as setAndStartTimer,
  WUe as setLightDirection,
  wM as setMeshPivotPoint,
  d$ as setParent,
  T9e as setRotation,
  NR as setStereoscopicAnaglyphRigMode,
  QR as setStereoscopicRigMode,
  kO as setVRRigMode,
  Yme as setupRenderer,
  d9e as smoothedPoints,
  A4 as stringToColor3,
  lR as stringToColor4,
  Fje as sum,
  ySe as testCloneMesh,
  RSe as testRepeat,
  fUe as to360Angle,
  GSe as toAngle,
  Xa as toArray,
  CW as toRadian,
  ZSe as toSecond,
  nUe as toUnit,
  h2e as transDataTypeByDynamicDataType,
  FH as transValueByDataType,
  p2e as transValueByValueType,
  oD as trimAll,
  fq as tryCatch,
  i9e as vec3ToScreenXY,
  zme as vec3TolonLat
};
